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PxPP):P QQ`WЫTYXWxYZ[PΫlPPѬZP)ѬZPѬ  ZPPPɬZPPP<ݭ[?1yWPxPPPPPYP)խ ,XX X֭鑽 ֭jЭP֭`X1!XPX11Pd1Pc1 1PlXXPPo11Pu1Ps1|1Px11 ^Ѭ լ-Gάޭ[ݬݬ@ ݬݬPP֘{~ ޭP[PЬ[20uY"PY["PZ"[~#[  Z" P!~P[[  [[j[P Ь[*P#DP@ZP +PЬ[ 4PZZPP P  Z[[ڬ۬P(  ^Ь[ԭZk96 PQPQ0QZ[[kPP P P+P-k0ZέPЭPЬZЬY[ [[ ЬPЬRRQ{RPRPPPRRPЬPЬRRQ{RPPR PRPP,X-`PЬSRbcPRbF  &0^nhpuphkraxx(0,0)vmunix Boot : : %s Bad format %d+%d+%d start 0x%x Short read null path %s not found bn negative bn ovf %D bn void %D bn void %D not a directory zero length directory Seek not from beginning of file No more file slotsBad device Unknown device Bad unit specifier Missing offset specification Can't write files yet.. Sorry Exit called%s Trap %o l%8 d  o%Z r%x u% x%P| >{%t~%D.%8h&hpuphkrahttmtsmt`       @ ` `&vd62M2R%s1 JTJ2" 7 & `7&/%/,&%2 @v<&unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry Anot a tape mt hard error: er=%b mt error: er=%b mt: unrecovered error mt: recovered by retry rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry Pte error: er=%bILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOTts: unrecovered error ts: recovered by retry DR2 `7`+ @7p+up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPEh >Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error 0123456789abcdefDR2 `7`+ @7p+up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM Џ^*PԀP^M-^z*N P ^EPPPݬHP5Pݬ*ABݬ*) ݏ59<5PPxPPP更5P<5QQPPPѭ<5~5*P *qG9;[ #PK`[[[Dݏ@8[CZ  xZP@8Z[܀Ҁ<8[ݏ4[w83切[)ݭDP9PY"1eѬ ЬZJЭPԭ xѬ ­׭խխ ݬ!1jí P@ݬ!1Q֭ѭЭP@ CxPXPdx P@wh2l[x P@vЭPЭ@نx P@vέPxPPPZJ1|ݬd!1 ^Ь[լ1[Y<PʏPP@ 9!10 9!12ԭd֭ѭ@>ЭP֭P[pPPXPdp[h2l[-p[ZԭZ~ݬPЭPˏXW2GPPXWGWJ9J2P P@YիXѫX ЫXP@ sЫXP2@P2QQPPX^Ь[ЫTЫdxPxPPEP`PQxQQQPPЭQA`P P@ЭPӏ@ ЭP2$ЭPЭQ2PPQЭP2PPQRPRRQPЭQ2aQQPЭQ2aQQPRQRRPЭPЭ(xPPЭQPݬ[XЭPӏӏ@@/ЭPˏ~ЭPˏ~ݭݭݭPPЫlP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xTPxPPP QQ`Zԭ[PЫdTǏBPPPPPPPPPQQQPQQjZjZ2PxPP2QPQQxlPPPPxPʏPɏPѬjZ2 PPݭ[2jPPXV2 ~2~2~2~2~jZ5ѭ ]P֭1խ XЫlPЬ[k Ь[[1ЫXZԫl[ZPZPЬ[[^Ь[xTPxPP)P QQ`WЫTYXWxYZ[PΫlPPѬZP)ѬZPѬ  ZPPPɬZPPP<ݭ[5/RA/!P!!D/TG/ $" $J/H&x%6&M/)'hphtuptmhktsmtra&vd62M2R%s1 JTJ2" 7/ `7//p///p/2 @v/unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry DR2 `72 @72up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPE0123456789abcdef`       @ ` ` rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry Pte error: er=%bILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOTts: unrecovered error ts: recovered by retry Anot a tape mt hard error: er=%b mt error: er=%b mt: unrecovered error mt: recovered by retry h >Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error LRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOTts: unrecovered error ts: recovered bЏ^.PԀP^4!A0^._q RqE.߭j ߭P_9߭{PH9F9P29Ԭ)91ԭԭ:ѭ0ѭ9VE>.A P0QQP֭(EPЭQA`ЭAѭ2PP@x~--8Ѭ\ЬPݠ E,P-ЬPݠ0,Pi-P P 2S-Q- I-@-;-5-D&-D--`-8<6@PP2@'<&@PP~@?- CCԭ7PЭQA`7ݭ'nC֭ЭP~~PͤQA`͜͜0͜7">͜+B͜0͜PͤQQQxQPPЭP֭P[pPPXPdp[h2l[-p[ZԭZ~ݬPЭPˏXW2GPPXWG|WJJP P@cYիXѫX ЫXP@ sЫXP2@P2QQPPX^Ь[ЫTЫdxPxPPIQP`PQxQQQPgPЭQA`P P@ЭPӏ@ ЭP2$ЭPЭQ2PPQЭP2PPQRPRRQЭPЭQ2aQQPЭQ2aQQPRQRRPЭPЭ(xPPЭQPݬ[XЭPӏӏ@@ЭPˏ~ЭPˏ~ݭݭݭ_PPЫlP^Ь[xTPxPPPP`PˏTQxQQQPYԭЭPˏQ2@PPQ֭ЭP@xT~: i[JЫXZ(l[5PЏXX[ZPZPЬ[[^Ь[xTPxPP;OP`PˏTQxQQQPWY2ZW gZ$ΫlѬ gPѬѬݬ[gWЧXЧX gXX gPˏ~ˏX~hY PY[1@Y j2PlP Ь[ЫZZ ^Ь[xTPxPPNP`xTPxPPNP`PˏTQxQQQPZЫhP PˏhlPP PЭ ɏ֭ЭPΫlPЭQPЭPЭ Ѭ19xPeMP`[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ыlԧݬ[ˏYYX2VV.ΫlPxPPȬPP0ˏYЧˏ,XXPPS$SS$$$$$$$$$$$gˏ~2@DVVӏDPPˏ~Z Z1Z iЫlP ^Ь["xTPxPP/=P ~QQ`yF)FBBAPFB<P'PSFP2PP QPP .FPxPP2PP QP P@F{EPEoEEpP  ˏTPP~E =PիXѫXЫXP@W  ЫXP@8 X^/E2)(n)A2,*hphtuptmhktsmtra&vd62M2R%s1 JTJ2" 7t2 `72/d2/2d22 @v2unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry DR2 `74 @7 5up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPE0123456789abcdef`       @ ` ` rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry Pte error: er=%bILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOTts: unrecovered error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"[~#[  Z" P!~P[[  [[j[P Ь[*P#DP@ZP +PЬ[ 4PZZPP P  Z[[ڬ۬P( ^>P~xPPAPgP11xPP` PxPfP`P֭vNO@H#$ԭԭЭԭѭ1Oԭ/xPնP` PxPVP`P֭ѭխ Џ[[ Ь[xTPxPP~P QQ`ZЫXP@ իXѫX "ЫXP2@PŏBPX Z ^Ь[xTPxPP P QQ`Zԭ[PЫdTǏBPPPPPPPPPQQQPQQjZjZ2PxPP2QPQQxlPPPPxPʏPɏPѬjZ2 PPݭ[2jPPX*2 ~2~2~2~2~jZ5ѭ 1P֭1խ ,ЫlPЬ[k Ь[[1ЫXZԫl[ZPZPЬ[[^Ь[xTPxPP=P QQ`WЫTYXWxYZ[PΫlPPѬZP)ѬZPѬ  ZPPPɬZPPP<ݭ[5PxPP2PP QP P@P˶pP  ˏTPP =PիXѫXЫXP@o  ЫXP@P X^?<<%ȏֵȏϵ2 ﹵ﱵﭵ掠冀ЭPɏQ PPQ ЭPPЭP ^Ь[[PZЫd ˏTPPЫlPQxQQQPѬ!P"PPPZ ݭ[bPݭ[RЫlP ^Ь[ԭZk96 PQPQ0QZ[[kPP P P+P-k0ZέPЭPЬZЬY[ [[ ЬZЬY[ Y[[ ЬPЬRRQ{RPRPPPRRPЬPЬRRQ{RPPR PRPP:PЬSRbcPRbr  &0^n1/dev/rmt8X/ tapeTape? Disk? Last chance before scribbling on %s. diskMissing volume record Tape is not volume %d Missing header block End of tape Unknown header type Resynced at inode %u %u: ilist too small Missing address (header) block Tape read error: inode %u Mount volume %d Cannot open tape! Not a dump tape.Try again Wrong tape. Try again disk write error %D read error %D Out of space Checksum error %o @(#)restor.c 4.3 (Berkeley) 6/3/81null path %s not found bn negative bn ovf %D bn void %D bn void %D not a directory zero length directory Seek not from beginning of file No more file slotsBad device Unknown device Bad unit specifier Missing offset specification Can't write files yet.. Sorry Exit called%s Trap %o 2T|2lZ3B|3%@%p%3#D#| 3(&'38*h)&*3z-x+|hphtuptmhktsmtra&vd62M2R%s1 JTJ2" 7D3 `7T3/43/d3432 @vt3unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry DR2 `75 @75up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPE0123456789abcdef`       @ ` ` rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry Pte error: er=%bILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOTts: unrecovered error ts: recovered by retry Anot a tape mt hard error: er=%b mt error: er=%b mt: unrecovered error mt: recovered by retry h >Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error LRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOTts: unrecovered error ts: recovered by retry Anot a tape mt hard error: er=%b mt error: (@ik @ik ?l?d #8@ik?l?d #8@ikIA@?iii ...pstamp.betabbin%etclibusrlost+foundarchdevomntsystmpzvb{boot.origvatcorejstamp.42 .login4.profileoldvmunix5.cshrctpstamp.1vmunixstamp.125`stamp\stamp.234rarcrppbillfbootch9.rch10.rch11.rch12.rchb.rchc.rhelpindexmklost+found.s@i%kRA @CQOh %...$512restor#ac"accton!arcvarffcatmanchgrpchownclricomsatcrondcheckdelivermaildmesgdumpdumpdirflcopyfsckgettyhalticheckinitmkfs mklost+found mknod mount ncheck quotrebootrenicerestorsashutdownswapontermcapumountupdatevipw|wall|chk}dumpdatespstatgroupmotd6utmppasswdttysttytype analyze0mtabrcbadsect arff.bakconfigsavecore.fstab.rm03fstab.rm05[fstab.rm80fstab.rp06fstab.rk07fstab.up300mfstab.up160mbad144fstab.ra80fstab.rp07ptmp((@i bkLjA FOh b...cadbearYasXcatWccVchkUchmodTcmpScpcshQdatePddOdfNdiffMdueKechoedIfalseHgrepGkillFldElnDloginClsBmailAmake@mkdir?mv>nice=nm<nohup;odZoldcsh9passwd8pr7ps6pwd5rm4rmail3rmdir2sh1size0stty/su.sync-tarxtest+time*tp)true(wall'who&writex[awkmtJsedYstrip,ucblsexprcsh.old@i ok[bA 0LqhhfǪ o...sys@izkeA Ouh(Ǫ z...@ikZMA @RUXqhNpnNpn ...MAKEconsoledrumfloppykUmemkmemmemnullttymailtty00tty01tty02tty03tty04tty05tty06tty07hp0ahp0bhp0chp0dhp0ehp0fhp0ghp0hrhp0arhp0brhp0crhp0drhp0erhp0frhp0grhp0hup0aup0bup0cup0dup0eup0fup0gup0hrup0arup0brup0crup0drup0erup0frup0grup0hhk0ahk0bhk0chk0gNrhk0aMrhk0bLrhk0cKrhk0glpFhk0drhk0dCttyh0Dttyh1#ttyh2$ttyh3ttyh4%ttyh5-ttyh63ttyh7,ttyh8+ttyh9)ttyha2ttyhb*ttyhc(ttyhdttyhettyhfmt0mt4mt8mt12nmt0nmt8nrmt0nrmt8rmt0rmt4rmt8rmt12mt16hk1ahk1b&hk1c'hk1g1rhk1arhk1brhk1crhk1gmt20rmt16rmt20mt1mt5mt9mt13nmt1nmt9nrmt1nrmt9rmt1rmt5rmt9rmt13mt17mt21rmt17rmt21hp3grhp3arhp3brhp3crhp3ghp3dhp3ehp3fhp3hrhp3drhp3erhp3frhp3h((@ikeA [phǪ ...@ikzBA ^adgjph䁖Ǫ ...mail12131415161718191a1b1c1d1e1f102122232425262728292a2b2c2d2e2f203132333435363738393a3b3c3d3e3f304142434445464748494a4b4c4d4e4f405152535455565758595a5b5c5d5e5f506162636465666768696a6b6c6d6e6f607172737475767778797a7b7c7d7e7f708182838485868788898a8b8c8d8e8f809192939495969798999a9b9c9d9e9f900102030405060708090a0b0c0d0e0f00a1a2a3a4a5a6a7a8a9aaabacadaeafa0b1b2b3b4b5b6b7b8b9babbbcbdbebfb0c1c2c3c4c5c6c7c8c9cacbcccdcecfc0d1d2d3d4d5d6d7d8d9dadbdcdddedfd0e1e2e3e4e5e6e7e8e9eaebecedeeefe0f1f2f3f4f5f6f7f8f9fafbfcfdfefff0@ik1CA 0m+: ...include((@ikA pOhWhǪ ...c2ccomcppf1Jcrt0.oIlibc.a__.SYMDEFGmcrt0.ov11821@i kЗOA sVhH"iH"i ...boot.oldarestoricheckmkfs]bootresotremaketape2@i"k_ǨA vuh<< ...as000186ctm001833ctm061873ctm178533ctm164163ctm161603ctm073123as008762t1t2tapeRx00825ctm020673@i$k*,GA y=i7i7i ...qGENERICsysfloppyhconfstandtdevmdecetcSCCSBERTGENERICvmstat.cTOY@i&pkmANuh<< p...mrkdcopyhpdcopy.c<rpdcopy.c/updcopyXupdcopy.cyhpdcopyhpdcopy.oa.out((@i(qk>A C2iii q...ioconf.cuubglue.smakefilebk.h^ct.hdh.h{dn.h}dz.h~hp.htu.hlp.hmba.hmu.hpty.hrk.hte.hts.hra.hup.herrsva.hvp.hassym.stouchmakefile.bakudiv.olocore.clocore.oacct.oalloc.ocalloc.oclock.ofio.oiget.oioctl.omachdep.omain.onami.opartab.opipe.oprf.o~prim.ordwri.ormap.osig.oslp.osubr.osys.osys1.osys2.osys3.o sys4.o sysent.o text.o trap.ovmdrum.ovmmem.o vmmon.ovmpage.ovmproc.ovmpt.ovmsched.ovmsubr.oSvmswap.ocvmsys.ourem.oparam.oparam.cautoconf.sbio.oconf.ocons.odh.odkbad.odkleave.odn.odsort.odz.oflp.ohp.oht.olp.omba.omem.omx1.omx2.omt.ork.osw.otm.ots.otty.ottynew.ottyold.otu.ouba.ouda.oup.ovaxcpu.oioconf.oyvers.oversionxswapgeneric.overs.cnvmunixautoconf.ookautoconf.oioconf.s@i+rkA uhZ<Z< r...@i-kA0) U2iML ...locore.smachdep.cmachdep.cLocore.cacct.calloc.casm.sedcalloc.cclock.cfio.ciget.cioctl.cmain.cnami.cparam.cpartab.cpipe.cprf.cprim.crdwri.crmap.cscb.ssig.cslp.csubr.cxsymbols.rawwsymbols.sortvsys.cusys1.ctsys2.cssys3.crsys4.cqsysent.cptext.cntrap.cmudiv.slurem.skTODOjvmdrum.civmmem.chvmmon.cgvmpage.cLvmproc.cvmpt.cvmsched.cvmsubr.cvmswap.cvmsys.cvmsysent.c@i/k4eA uh(Ǫ ...@i1kA uh<< ((...@i3kC̯AE-i$ڡ$ڡ ...pk.hRcallout.hcpu.hPtmreg.hOcons.hNpte.hMpsl.hLpcb.mKparam.h5mem.hIclock.hHhpreg.hGacct.hFbk.hEbuf.hDupreg.hCcmap.hBconf.hAioctl.h@dir.h?dmap.h>fblk.h=file.h<filsys.h;flp.h:inline.h9ino.h8inode.h7user.h6map.hJnexus.h4mount.h3mtpr.h2mx.h1vcmd.h0pcb.h/pdma.h.proc.h-mtio.h,ubavar.h+reg.h*seg.h)stat.h(systm.h'text.h&timeb.h%times.h$trap.h#tty.h"vmparam.h!clist.h vmmeter.hvm.hpk.pvmsysent.hvtimes.hdk.hvlimit.hubareg.hdkbad.hmtreg.hvmmac.htrace.hmbareg.hvmsystm.hmscp.hudareg.hreboot.hmbavar.hmsgbuf.h rpb.h scb.h rkreg.hutreg.h htreg.htypes.htsreg.h@i6ke7A@U&iE. ...dumpdefboo.cmdbootmkfsrestorcatlsupmboo.cmdbtapeupsboo.cmdrestar.cmdqdefboo.hkhpmboo.cmdanyboo.cmdicheckhpsboo.cmdrdefboo.updefboo.hp@i8k>>}APS%{@i@i@i ...sys.oautoconf.cht.cmakefile]conf.osrt0.caconf.ccat.cboot.c.samhp.cmprf.ork.cls.cmachdep.cmba.cuba.cprf.csys.cXautoconf.osaio.hsavax.hts.ctm.chp.oup.cht.o[mba.oZmt.oWrk.oVtm.o`ts.o^up.ouba.ouda.omachdep.oosrt0.o_boot.o^relsrt0.oscat.o`boot.cb.outls.ofcatnicheck.oQlsemkfs.oichecklrestor.oUmkfsmt.cdtpsrt0.orestorconf.c.samjtpicheckitpmkfsuda.cTtprestorverrs~sboot.osbootZa.outbootconf.c.ancientdboot.c.ancient_bootconf.ov13435v11369@i;kxj A*&iE[ ((...BERTTOYQnewvers.shtouch.ccover.tfilesmakefilegenassym.cGENERICERNIEBET@i=tk*ߢALH&iҹҹ t...swaphk.cautoconf.cbio.cbk.cconf.ccons.cct.cdz.cdkleave.cdsort.cdh.cflp.chp.ctm.c lp.c mba.c mem.c mx1.cmx2.ctty.cpty.crk.csw.cswaphkhk.cswapgeneric.cswaphp.cswaphphp.cswaphpup.cswapup.c ht.cts.cuba.cttynew.cttyold.cup.cva.cvaxcpu.cvp.cswapupup.cdkbad.cswapuphp.cdn.cmt.ctu.cuda.ctu.hht.s@i?k>̣AW>&iڡڡ ...Makefilehtboot.stmtoggle.shttoggle.stsboot.shpboot.shkboot.stmboot.sPerrsRa.outb.outtstoggle.s{htbootVmtboot]tmboottsbootbhpboothkbootupbootutbootinobootupboot.smtboot.smttoggle.sutboot.suttoggle.shttoggleSmttogglebtmtoggleetstoggleuttoggle@iAk[AFs,:,: ...wait.hvframe.hsignal.hsgtty.herrno.ha.out.h@iCkQazzz @iDk! @<hiȪ  ((^Юn PPՀPpPP P^ԭ׬լϴѬ1ϮݼPzPYϘm϶Gϑ ~ϲP5ݭϞݭݏUPϨP@ϦtyPϩݭUЬP`ݏUϤPЬPݠ׬ݭЬ[k[kkPk ~ݬݬ%[P [ЬZjP@0 [jP0PP[Zjj[j ZjjZP^ݏPP[:[~GP[1W:[~-P[P:[ ~P[P:[$~-P[P [(~P[PP)JP PP CP^PPPPPP_PPP[ݬ[4P[P-PPuP[ݬ[~P[Pݬ \~ݬЬP PPЬ [ЬY׬&k ЫP֫`P [PZZZ Z YPЬPЬ[TXXPX 鑫+PPPYkw+ݏݬPZY1ZZIkalYPPPݬWPZ<3ݏݬ}PZYZZݬPZZ)Z%YPPPݬPZZ1hZY kr  XP [i\P@X[ݬPZZݬ^XM[P[74& 0@Xb|$0BQap".AError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large\~ݬPPЬ[  P ݏ] P ի ߘP@ [,j W  P2PPݫ~ PkЫk!k    k1WP֫ Ь[ZZZPЬ[ЬZЬ YY kPYP kPzQQPЬ[ЬZ[XY YY  YXPЬPlP    !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0Pc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ЫZ3[/1xݏPZZ  YYX ZYYXZYZ~(PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP< [ [[[f  Ь[Z = 8[ePZ~9PZ ݫ ԫ kZP{(P^߭ݬDPPPݬݏ tݬݬݏtݬ6.==~*PY}[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ> [=P0YPƏPxPbPZxPZPPZx~@PZZZPZPxPZPPjj=1xYP[PZy|kmfk[P Ь[[ZZZMjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j@~\S^\_%PCЬPЬPЬRRQ{RPPR PRPPPP.pCCCaF@A@CpCaFCpCpC@@@/usr/adm/acct***other/usr/adm/usracctw/usr/adm/savacctwCan't save %.14s %-8s%-8d%7u %9.2fcpu %10.0ftio %12.0fk*sec %8.0f%9s%8.2f%%reu/suscp%8.1fre/cp%10.0favio%10.0ftio%10.0fk%10.0fk*sec%11.2f%s%11.2f%s%9s%8.2f%%Only 1 file with -s rCan't open %s %3d%6.1fcp %6dmem %6dio %.14s /usr/adm/savacctr/usr/adm/usracctrCategorizing commands used %d times or fewer as **junk** **junk**%.14s--%04xPreposterous user id, %d: ignored @(#)sa.c 4.2 (Berkeley) 81/02/28/etc/passwdrr 5 500=@ikkݍ׸ <ADGJMPSVY\2inn  0^Юn PPՀPpPP/ P()^/Ѭ-APruPtlPxck~//(м[1PfмZ/׬kPP- PRՐk[k呭x18iP YJP :ݏ.+P=P.//(<'. (P<ݬݬ~x w.P(' ^U.'P<?..u'PPR1PrPt Pxa3&P.?"'3P.3P.3Pp.&v3P`.&,[ЬP׬P1ݼ T P=xﰐP2h>* F <*~f'a*. P1XJ* P1Q3* P1CP2aΜ^(d*͜)2[[#Kw͜ѬR2PO͜@ P&q͜r P͜P(d`)11ЬPP͜*͜Ѭ2PЬPP͜ '4)P!)P[1Μ^ # 1$[x [Pt ["ݏ( 1\P[#<0~% 1[ ""0"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ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j ~\S^\_ P CЬ{ PЬPЬRRQ{RPPR PRPPPP4/dev/rmt80rstXXXXXX Usage: restor x file file..., restor r filesys, or restor t Bad key character %c restor: %s - cannot create directory temporary %s: cannot open tape Tape is not a dump tape Dump date: %sDumped from: %sTape is not a dump tape Tape is not volume 1 of the dump %s: not on the tape %s: inode %u Mount desired tape volume: Specify volume #: Volume numbers are positive numerics tape is not dump tape Wrong volume (%d) Can't find inode mask! end of tape extract file %u %u%s: cannot create file %s: cannot open Enter starting volume number: Last chance before scribbling on %s. Missing volume record Tape is not volume %d Missing header block End of tape Unknown header type Resynced at inode %u %u: ilist too small Can't find directory header! /Missing address (header) block Tape read error: inode %u Mount volume %d Cannot open tape! Not a dump tape.Try again Wrong tape. Try again /disk write error %ld read error %ld Out of space. Checksum error %o @(#)restor.c 4.3 (Berkeley) 6/3/81M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/|"|"6*@i|k $nqtwz} 2ihiȪ  ^Юn PPՀPpPP PD ^ѬѬ"ϓPЬPݠPѬ ЬPРPϺPPPPѭϐPPω?ϐ v[ngݭݭ ߭ݭϙݏpݭPJM%ݭݭύ ߭ݭPݭݭs ŏp~ݭ.ŏpPPZ[2(PP p[[Z[ZݭώϡϚ~PP~ݭj}[τíPPݭݭ ߭ݭ|ĬݬP[P[Z~&PYԊY[Pݬݬ \~ݬ ЬP PPЬ[ZYk94 ZPQPQ0QZY[[kPP P P+P-k0YZPZPQP^ЬZV0jP`-ԪjPWWW ZVjݬQPPPݭ ߭ѭԏ"ѭԏѭԏ ݭPѭԏ 2P PPPPPЭYY12XYXYXݭݭݭXsPWXXYZ Xj1yj~ݭݭ~*Ь[EW GG4WGG%ЪVݭ1 [kP` Z1nЬ[XXPX 鑫+PPPYkw+ݏݬPZY1ZZykalYPPPݬPZXh  $ : L X j y  % ; J V i Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large^Ь[ЬZԭլ05Ьj ЪP֪`P ZoPYY׭֭ѭ ЭP^Ь[ЬZԭլ.3ЬYj ЪP֪` Z~o Y ֭ѭ ЭPЬ[  P ݏ P ի ߘP@* [D   P2PPݫ~ PkЫk!k    k1WP֫ Ь[ZZZP   !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj~P   BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[T1xݏPZZ  YYX ZYYXZYZ~(PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP<[ [[[f Ь[Z = 8[ePZ~9PZ ݫ ԫ kZP{(P^߭ݬDPPPݬݏ tݬݬݏtݬ6.&~&vpsad~*PYM[Rk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [&PYPƏPxPbPZxPZPPZx~@PZZZPZPxPZPPjjw&k1xYP[PXZQILk=6k[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP} @j@~\S^\_%PCЬPЬPЬRRQ{RPPR PRPPPPusage: renice pid [ priority ] NOT super user 19/dev/kmem/dev/kmem/vmunix/vmunix: _nproc not in namelist/vmunix: _proc not in namelist%d: process not found %d: old nice = %d, new nice = %d @(#)renice.c 4.3 (Berkeley) 81/03/11_proc_nprocrUnknown error: #""&@ik| $ru 2iGhiȪ  $^Юn PPՀPpPP P^YX׬ԭEݼoPX*ݼ[P\1׬լdP/XFZ ݏ8P +ϬZ_ϯoX h A~ ݭ7 ϒIϸixZ~L Z1Xϛ ݬ' zωP[F[υ 2 % n [9[ ^߭K ߭υPPPݭ-ЭPl~ЭPݠ РP@ЭPРP@ЭPݠݠϪݭωݭݬ P5^߭ 2Pl-[P[H  " 4 D P b r   ) = N ] l Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too largeЬ[  P ݏe P ի ߘP@ [P"   P2PPݫ~ PkЫk!k    k1WP֫ Ь[ZZZPЬ[ЬZ[XY YY  YXP$ЬPlP 0   ЬQPa#  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYjl~P   BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[`1xݏPZZ  YYX ZYYXZYZ~HPY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[. Ь[Z = 8[ePZ~YPZ ݫ; ԫ kZP{ Ь[ЬZkPkPzQQP(P^߭ݬDPPPݬݏ tݬݬݏtݬ6.(~ (vpsad~*PYM[Rk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [ (PYPƏPxPbPZxPZPPZx~@PZZZPZPxPZPPjjw (k1xYP[PXZQILk=6k[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP} @j~\S^\_PCЬPЬPЬRRQ{RPPR PRPPPqP0/usr/adm/wtmpTX\`dhlptx|-q-nusage: reboot [ -n ][ -q ] reboot: can't idle init reboot: killCAUTION: some process(es) wouldn't die reboot~shutdown/usr/adm/shutdownloga%02d:%02d %s %s %2d, %4d. Halted for reboot. @(#)reboot.c 4.5 (Berkeley) 4/21/81SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDecM:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJ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XZYZ~HPY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[ Ь[Z = 8[ePZ~YPZ ݫ; ԫ kZP{ Ь[ЬZkPkPzQQP(P^߭ݬDPPPݬݏ tݬݬݏtݬ6.+*~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZn [*P`YPƏPxPGbPZx4PZPPZx$~@PZZZPZPxPZPPjj*1xYP[PZkk[P Ь[[ZZZ}jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@jl~\S^\_QPHCЬ3PЬPЬRRQ{RPPR PRPPP P/etc/mtab%s on %s -aarg count mount/etc/fstab/rorwAttempt to mount FAILED: %s Mounted %s on %s %s (Read Only)/etc/mtab@(#)mount.c 4.3 (Berkeley) 10/15/80/etc/fstabrUnknown error: #  AAAAAABBBBBB &&+@i k3 ?BEHKNQ hiȪ  ^Юn PPՀPpPP P ^Ѭ Ͻ41ЬPPPb2aЬPPPc[2!ЬPݠ SPPAЬPݠ?PP-xPɭP~ݭЬPݠXP G[\=ϣ^ԭѭ0ѭ9P PP0PЬP֬`ЭP,P ,[4xP@X[ݬQPZZݬ[$P[4<F`p ,BT`r -CR^qError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large\~ݬPP Ь[ZZZP  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj ~P ;3 BЫZ֫ZPѫPѬ ZPPXPZ~qPYZkn 1mЫZ3[1xݏPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[ Ь[Z = 8[ePZ~9PZ ݫ ԫ kZP{P^߭ݬ$PPPݬݏ tݬݬݏtݬ6. ~*PY [ k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ  [P YPƏPxPo bPZx\ PZPPZxL ~@PZZZ) " PZP x PZPPjj  1xYP[P Z  k  k[P Ь[[ZZZ jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP @j~\S^\_PCЬPЬPЬRRQ{RPPR PRPPPeP<arg count mknodusage: mknod name b/c major minor @(#)mknod.c 4.1 (Berkeley) 10/1/80Unknown error: #@i kAi T`g1.iȪ mkdir lost+found cd lost+found echo creating slots... for i in 1 2 3 4 5 6 7 8 9 0 a b c d e f do tee ${i}1 ${i}2 ${i}3 ${i}4 ${i}5 ${i}6 ${i}7 ${i}8 < /dev/null tee ${i}9 ${i}a ${i}b ${i}c ${i}d ${i}e ${i}f ${i}0 < /dev/null done echo removing dummy files... for i in 1 2 3 4 5 6 7 8 9 0 a b c d e f do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    PPYYX1XX߭~PYj ~P wo BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[!1xݏPZZ  YYX ZYYXZYZ~(PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PPt[ [[[  Ь[Z = 8[ePZ~9PZ ݫ ԫ kZP{(P^߭ݬDPPPݬݏ tݬݬݏtݬ6D.767.(+~*PY[ k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [7PYPƏPxPbPZxPZPPZx|~@PZZZYRPZPExFPZPPjj/7#1xYP[PZ kk[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP5@jx~\S^\_]PTCЬ?PЬPЬRRQ{RPPR PRPPPP!usage: mkfs filsys proto/size [ m n ] %s: cannot create %s: cannot open r%s: cannot open isize = %D d--777 0 0 $ %s: cannot open init m/n = %d %d %ld/%ld: bad ratio -bcd-u-g%c/%s: bad octal mode digit %s: cannot open ...%c/%s: bad mode %s: bad number EOF read error: %ld write error: %D out of free space indirect block full too many bad blocks ilist too small bad mode %o @(#)mkfs.c 4.2 (Berkeley) 4/20/8133#7@ikr  ux{~2i~hiȪ  t ^Юn PPՀPpPP Pp ^L P[χ p s    ЭlP"^ݭP Ͼ ݏ`ϻP ϋ ϏZ ZjZZ9d A[ ݏN[ PS^P+i P7ݭϯ H- : w ϓ[[ [χ PZFZ϶|7Ͽu(tϟYZ ZϫP KP[JQH?τf_ϰDϙPZP[Zϰ Z ^P[Q_C?rF*&YϺ߭P[խP7϶PZYZfϒ,υ%  <ZϷZHP> A/aPZZ[[ѫ Z ѫ [[[Ь[ի [ ݫ ((pԫ  ϕP[P[[UP[[Eϊ3Z_P[[JZZ FP[[0Je;.0P1jP^߭ PP PPRPPϓ[ [['ϻϮr[1 ^  RPK[2[ϣP[['[[ŕk[Ϥ [ [bk [T[ [[^ϮP[1*ϱϨϐ ݬ\ݏ=ϻ϶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ld (i=%ld,ii=%ld,iii=%ld,d=%ld) free %7ld %ld missing missing%5ld bad mode %u data (small)1st indirectdata (large)2nd indirectdata (huge)3rd indirectdata (garg)%ld bad; inode=%u, class=%s %ld dup; inode=%u, class=%s %ld arg; inode=%u, class=%s Bad free list, s.b. count = %d Bad free list, entry count of block %ld = %d read error %ld No update write error %ld @(#)icheck.c 4.2 (Berkeley) 81/02/07kko@ik (I 2ihiȪ   ^Юn PPՀPpPP P ^P׬լ1խ% χ @d /"ϞsϲP5 "}RZI[ ݏφP #. i[1 Ϻ!)Z ϱ  ϊ ݭ7 ϔ'ݼP1ݼϬPԭ1ݼϖPZ1)!Ϙm1x[~N [1 ϝ ݬ) @oP[F[χ A! 4! !p ![c[ ^߭M ߭χP PPݭ/ЭPl~ЭPݠ РP@ЭPРP@ϙЭPݠݠϹݭϋݭݬ P5^߭ 2P&PPxPPPP2nP2mPЬ[[Ѭ  P PQ QQPQ0QQ P PPP0PP[Pݬ \~ݬЬP PP%4PЬ[,XXbPX 鑫+PPPYkw+ݏݬPZY1ZZEkalYPPPݬcPZ<3ݏݬ}PZYZZݬ%PZZ)Z9YPPPݬPZZ1hZY kr  XP ^ЬP ЬP 1Ѭ sՠn iмZЬլ ~PPZPPZЬP )Z%ѭZPQáPѭPQP­P[[ЬP PQРЬP ݬ [~ЬP~PԼ[h׼ ЬP֠ZݬNЬP BPЬP ԼЬP ЬPPQРݬ ݬЬP~PѭPP [P@X[ݬPZZݬflU[P[?H.  ( 2 L ^ p  ! 1 @ Q e y  Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too largeЬ[  P ݏ P ի ߘP@ [""   P2PPݫ~ PkЫk!k    k1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k[P Ь[[ZZZ(jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPy'@j~\S^\wP[Ь{PЬPЬRRQ{RPPR PRPPլQP!PPMtMMBad -t option %c option? Incompatible options: -n and -%s sSCan't get memory Can't open checklist file: %s /etc/fstabrwrofork/Can't stat root Can't stat %s Can't stat %s %s is not a character device Can't make sense out of name %s Can't make sense out of name %s /r** Checking %s ** Phase 1 - Check Blocks and Sizes UNKNOWN FILE TYPE I=%uCLEARLINK COUNT TABLE OVERFLOWCONTINUEPARTIALLY ALLOCATED INODE I=%uCLEARINTERNAL ERROR: dups with -p** Phase 1b - Rescan For More DUPS ** Phase 2 - Check Pathnames ROOT INODE UNALLOCATED. TERMINATING. ROOT INODE NOT DIRECTORYFIXDUPS/BAD IN ROOT INODE CONTINUE** Phase 3 - Check Connectivity ..** Phase 4 - Check Reference Counts UNREFUNREFBAD/DUPFREE INODE COUNT WRONG IN SUPERBLK (FIXED) FIX** Phase 5 - Check Free List (Ignored) %d BAD BLKS IN FREE LIST %d DUP BLKS IN FREE LIST %ld BLK(S) MISSING FREE BLK COUNT WRONG IN SUPERBLK (FIXED) FIXBAD FREE LIST (SALVAGED) SALVAGE** Phase 6 - Salvage Free List %ld files %ld blocks %ld free ***** FILE SYSTEM WAS MODIFIED ***** %s: %s: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY. %s: BADEXCESSIVE BAD BLKS I=%uCONTINUEDUPEXCESSIVE DUP BLKS I=%uCONTINUEDUP TABLE OVERFLOW.CONTINUEDUPI OUT OF RANGEUNALLOCATEDDUP/BADBAD BLOCKS IN FREE LIST.EXCESSIVE BAD BLKS IN FREE LIST.CONTINUEEXCESSIVE DUP BLKS IN FREE LIST.CONTINUE%ld %s I=%u %s %s=%sDIRFILENAME=%sREMOVEUNREFLINK COUNT %sDIRFILE COUNT %d SHOULD BE %d (ADJUSTED) ADJUST%s %sDIRFILECLEAR (CLEARED) /Can't stat root Can't stat %s file is not a block or character device; OKCan't open %s %sNO WRITE ACCESS (NO WRITE) Size check: fsize %ld isize %d File System: %.12s NEED SCRATCH FILE (%ld BLKS) ENTER FILENAME: Can't create %s INTERNAL ERROR: GOT TO reply() %s? no yes Invalid -s argument, defaults assumed Fatal I/O error Fatal I/O error Fatal I/O error CAN NOT %s: BLK %ldCONTINUEProgram terminated DIRECTORY MISALIGNED I=%u I=%u OWNER=%s %d MODE=%o %s: SIZE=%ld MTIME=%12.12s %4.4s BAD FREEBLK COUNT Default free list spacing assumed UNREF %s DIRFILE (RECONNECTED) RECONNECTSORRY. NO lost+found DIRECTORY SORRY. NO lost+found DIRECTORY SORRY. NO SPACE IN lost+found DIRECTORY DIR I=%u CONNECTED. PARENT WAS I=%u SEEKREADSEEKWRITE@(#)fsck.c 4.13 (Berkeley) 81/03/09lost+found/etc/fstabM:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/etc/fstabr/etc/passwdrUnknown error: #  AAAAAABBBBBB ,d,d$Ph@ikos  IOhiȪ  ^Юn PPՀPpPP PXЬ[2Y[kV׬1-Pr1Pt?fҘPPhϋϒϋ3PWτyf0f9VϧPF Ѭ[kϐP/׬M$  MSχď 1\71U,1ݏ7PWW^)σPW"2ϪZ>Z2PZPPXXY:XW+YZZϥ cϛW;7Z2Y>Z2PZPPXXcW XXYYZZ^ԭݭς Pa/ Ь[ [[Yx[[[PPP[ZZ  xZPPZZZ[PPXPPPPZZPPPZXPZPxPPYPЬ[ЬZЬ YK3[ςPb!ݏYQ Y[ZЬ[ЬZЬ Y3[0PݏYrY[ZЬ[ZYk94 ZPQPQ0QZY[[kPP P P+P-k0YZPZP ЬZ[2[/+P$`P VP[P [ ZPЬP\~ݬlPPЬ[  P ݏ P ի ߘP@ [r _  P2PPݫ~ PkЫk!k    k1WP֫   !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYjL~P og BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[1xݏPZZ  YYX ZYYXZYZ~(PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[ Ь[Z = 8[ePZ~9PZ ݫ ԫ kZP{(P^߭ݬDPPPݬݏ tݬݬݏtݬ6@.t 2p *$'~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [p PYPƏPxPbPZxPZPPZxx~@PZZZUNPZPAxBPZPPjj+p 1xYP[P Zkk[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP1@j~\S^\_PCЬPЬPЬRRQ{RPPR PRPPP PHalftime! floppyfailed to open floppy image, for reading Bad number of tracks floppyfloppyfailed to open floppy imageChange Floppy, Hit return when done. Floppy open failed @(#)flcopy.c 4.3 (Berkeley) 10/20/80/dev/floppyXX@ @ikF% ,#&),/258;>A 2iii  $8^Юn PPՀPpPP# P#q m&Ѭ ЬPPPfЬP`### P+P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ݬݬݏtݬ6 PЬPЬRRQ{RPRPPPRRP.$ ~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ^ [ PPYPƏPxP7bPZx$PZPPZx~@PZZZPZPݿx޿PZPPjjǿ 1xYP[P憎Zkk[P Ь[[ZZZmjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP;@jP~\S^\_5P,CЬPЬPЬRRQ{RPPR PRPPPݵP@ikE(  ,#&),/258;>A 2iii%/dev/rmt8$rstXXXXXX wdumpdir: %s - cannot create directory temporary %s: cannot open tape Tape is not a dump tape Dump date: %sDumped from: %sTape is not volume 1 of the dump r/Can't find directory header! /PANIC - can't find directory %d /...r/%5d %s%-.14s Missing address (header) block Mount volume %d Cannot open tape! Not a dump tape.Try again Wrong tape. Try again Checksum error %o @(#)dumpdir.c 4.4 (Berkeley) 2/28/81M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/'8@ikT `GJMPSVY\_be2ihh  L^Юn PPՀPpPPKPC^լKP\~S"PЭP ^KKﴽE*PyK{K?!PZZݭEPMKOKZFKݭB/K"K~f!PK KPP[ KZx[PJPZ`[ЪZ[ ^X&ZJP`[ZJ[ݭ7PȼѫRXЫHXZxZPxJP ^XZPJP`[ZIJ1 x2JQ'JQPaa[Jݭ[76WJ(P I]ZIP`[ZI]ݭHAdWPŻ~Iu[ݭT6P 1MZxZP[IP1[ݭZxZP?IP1{~PЬP~ݬ\Iݬ&^ݬݏA'QPQPݬP6II P8^8I#IV'P"AIIa 9I(I'PMTݭ߭*P>ޭP(`I߭@ ߭߭4߭ݭ((ЭP ݭ?ݭ?^߭~ݬHݬq*߭'ЬQPЬPՠPP^ЬPPƏPPPйP  PƏPPPיּ Z[K[Z[ZZPƏPPq ^Tf4Џ 6OEHDH DH9;HѬ1L׬м-֬14Ѭ׬мﳸQ3P 3J3P 3C3P r3< c3P  S35 D3P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UDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYjX~P  BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[X1xݏPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[ Ь[Z = 8[ePZ~uPZ ݫ ԫ kZP{ Ь[Zk[ZZP Ь[ЬZkPkPzQQPP^߭ݬxPPPЬ[ЬZ[Y[YPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6,Ь[ѬP ѫѫk֫k׫ЫP`PЬPЬRRQ{RPRPPPRRP.>>~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [>P|YPƏPxPcbPZxPPZPPZx@~@PZZZPZP x PZPPjj>1xYP[PZkk[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j~\S^\wP[ЬPЬPЬRRQ{RPPR PRPPլQPPLthe epochrwCannot open %s level %c dump on %s %-16s %c %sUnknown intermediate format in %s, line %d /etc/dumpdates/etc/dumpdatesw%s: Can not open %s to update. /etc/dumpdates/etc/ddater/dev//dev/%16s %c %[^ ] @(#)dumpitime.c 1.1 (Berkeley) 10/13/80O@>A@/dev/rmt8/dev/rrp1g/etc/dumpdatesubad key '%c%' Date of this level %c dump: %s Date of last level %c dump: %s Dumping %s (%s) to %s Cannot open %s mapping (Pass I) [regular files] mapping (Pass II) [directories] estimated %ld tape blocks on %3.2f tape(s). dumping (Pass III) [directories] dumping (Pass IV) [regular files] DUMP: %ld tape blocks on %d tape(s) DUMP IS DONE DUMP IS DONE! SIGHUP() try rewriting SIGTRAP() try rewriting SIGFPE() try rewriting SIGBUS() try rewriting SIGSEGV() ABORTING! SIGALRM() try rewriting SIGTERM() try rewriting Rewriting attempted as response to unknown signal. /r@(#)dumpmain.c 1.2 (Berkeley) 10/16/80((pR@C/dev/ttyrfopen on /dev/tty fails yes Yes no No "Yes" or "No" ONLY! NEEDS ATTENTION: %s: ("yes" or "no") Interrupt received. Do >>>YOU<<< know what are you doing? Do you really want to abort dump?operatorNo entry in /etc/group for %s. operator/etc/utmprCannot open /etc/utmp ttydttyd/dev/w Message from the dump program to all operators at %d:%02d ... %3.2f%% done, finished in %d:%02d DUMP: Can't open %s for dump table information. /etc/fstabrwroDump these file systems: Last dump(s) done (Dump '>' file systems): ??%c %8s (%6s) Last dump: Level %c, Date %s @(#)dumpoptr.c 1.4 (Berkeley) 12/17/80UTape write error on tape %d TAPE ERROR! Do you want to restart?This tape will rewind. After it is rewound, replace the faulty tape with a new one; this dump volume will be rewritten. Tape rewinding Change Tapes: Mount tape #%d CHANGE TAPES! Is the new tape mounted and ready to go?Do you want to abort?Context save fork fails in parent %d Parent %d waiting for child %d has another child %d return Child %d returns LOB status %o Bad return code from dump: %d Cannot open tape. Do you want to retry the open?Tape %d begins with blocks from ino %d Waiting parent receives interrupt The ENTIRE dump is aborted. @(#)dumptape.c 1.3 (Berkeley) 3/11/810Vbread: lseek fails (This should not happen)bread from %s [block %d]: c=0x%x, regc=0x%x, &c=0x%x, n=0x%x More than %d block read errors from %d DUMP IS AILING! This is an unrecoverable error. Do you want to attempt to continue?@(#)dumptraverse.c 1.1 (Berkeley) 10/13/80JanFebMarAprMayJunJulAugSepOctNovDecV@(#)unctime.c 1.3 (Berkeley) 81/04/18M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/etc/fstabr/etc/grouprr  AAAAAABBBBBB  4 4Y>@i/kkC $2i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ޭP eQ}`aeP[~D;}`խ7^}n^}nP[^OP^}ngP\[[:o}`խ^}n^}nPQ[:j[:[x |:~Nݏj:hN(P[1x^ON15P[1D^} n+:P[:1x 9~NGݏ9MF(PݏZ[1^}n[9r[97}`խ1(5x k9~@iDkN. +{ 2iΪΪpMݏY9WM'@979PPx P~6M{ݏM|'^}nPt[[8}`խ:^}n^}nP1[8[8p^}n8P[1NPPP1f41^}n[G8[88}`խ1^}n 8QQQQP1?[aQ}`aaP^^}nMPP>[E^}n^}nP)խ^}n^}nP ޭP}`ԭ[[k7}`խխޭPޭPaQ}`a`PݭrPPP^ݬ7}`[$^}n^}nPޭP}`[[6d}`խխޭPr`Q}`ah`PݬPP1rޭPv6xm6PPd6^6PPP6N6E686mP/60[ݏ$6x 6~JVݏ5Ii 55Q0^55P5PxPPP5Y5ǏPx PPPZǏ[[0Fݏr9x [~_IݏL9FI[/xYPPPJ*9QPQ1_P^IP44444PxPPP4Z4ǏPx PPP[ǏYxZPK8QPQQK8x Y~Hݏ~8xH" Ь[ЬZZ ^Ь[լSЬP2kQPQG2ZPPP2@kZP2@kPPPZQ2@kPPQޭP]Q}`a]PԭԭЬ[[ì[P[PЬZЬ Y zPyQQP[^3PP3xPҭPPPɭPʭ^ԭԭ[3KYZYP@-P@.xYYZZ[[ЭPЬ[լ~ЬP2kQPQrPP2@kZ2Yլ P2@kY2kP2@kXYZZYJIJZXZYZZP2@kPYPZQPAkZZP2kQPQk2kPP@k. Ь[2Zk2kP2@kZ¬ Z2kPPPPYZYP2kPPZ@kY IJZYY k2kPPЬ[2ZYYP2@kPPZ#YP2@kZYYP2kQPQ2kPPPPZP$.L ݏݬmP@ Pݬ P5^߭ 2P6X6j6|666666667 77-7=7L7]7q777777777 88Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBr((oken pipeArgument too largeResult too large@) Ь["ZZ#PZ jkr kaݬ- +   ZP*0ЬRPQbP,"\~ݬ#"PPЬ[[ ~kЫ0   Ь[  P ݏP ի ߘP@VR [Z! o!F  P2PPݫ~9PkЫk!k    k1WP֫Ь[ի ݫ^ Ь Ыk.PP Ь[ZZZPЬ[ЬZЬ YY kPYP kPzQQPlݬݬ;:0, ЬQPa#QP^BЬ2߭ \~ݬ׭ ЭP֭` ߭rЬP  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj~P w-o- BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[Z1xݏsPZZ  YYX ZYYXZYZ~ PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[ Ь[Z = 8[ePZ~PZ ݫ ԫ kZP{P[P[P[P/[PZ[ZZ&PXYX/P[Y[ZuPX\YPXOE[[ݬP1yk  k^EP[[ Ь[Zk[ZZP Ь[ЬZkPkPzQQP^ݬPP߭ݬPNBNENQEy_NlNoNrNuNxN{N~N@NNNNNBCPLNNN^N!N[unknown]amnesiavaxamnesiavaxMAILER-DAEMON/bin/mail...local%mail-d$u/bin/csh...prog%mail-fc$u/usr/net/bin/sendberkmail...berk%mail-m$h-t$u-h$c/usr/lib/mailers/arpa...arpa%mail$f$h$u/bin/mail...uucp%mail-d$h!$u!@(#)main.c 2.3 1/10/81/tmp/mailtXXXXXX/tmp/mailxXXXXXXNo "from" personMore than one "from" personBad hop count (%s)/dev/nullw%s -f and -a are mutually exclusiveMessage-Id: <%s> Who are you? (uid=%d)networkuucpFrom person = "%s" Usage: /etc/delivermail [flags] addr...Infinite forwarding loop (%s->%s)address overflow@Noone to send to!wCan't create %s@(#)maketemp.c 2.3 12/6/80wCannot create %sMessage-Id: <%s> EOH From >EOH? senderfrommessage-idw MAIL DELETED BECAUSE OF LACK OF DISK SPACE Out of disk space for temp fileCannot write %s/dev/nullwrCannot reopen %s%ld.%d.%s@%s@(#)parse.c 2.5 1/8/81multichar errorsyntax errorparse("%s"): host "%s" user "%s" mailer %d Unbalanced ')'multiple < specUnbalanced `>'()<>@!.,;:\" ()<>@!.,;:\" Address too longUnbalanced '('Unbalanced '"'Unbalanced '<'@(#)alias.c 2.2 12/6/80--- alias --- /usr/lib/aliases%s (%s, %s) aliased to %s @(#)deliver.c 2.5 2/5/81deliver(%s [%d, `%s', `%s']) name too longpipeCannot forkCannot dup to zero!Cannot exec %s wwait%s: stat %ookBad m_badstat %dunknown mailer response %d%serror %dFrom From %s %sFrom %s %sputheader: write errorBroken piperecipient(%s) (%s in SendQ) (%s in AliasQ) -f-rToo many parameters to %s%dInterpolated argv is: %s aFrom %s %s @(#)savemail.c 2.2 1/10/81rootCannot parse root!wrCannot open %s Message from %s Errors occurred while sending mail, transcript follows: savemail: stdout: write err/dev/nullwCan't parse myself!Can't return mail to %sCan't return mail to %s (pw=%u)/usr/tmp/dead.letteraCannot save mail, sorry ----- Mail saved at %s savemail: dead.letter: write errLetter saved in dead.letter ----- Cannot open %sTo: %s Subject: Unable to deliver mail ----- Transcript of session follows ----- ----- Unsent message follows ----- errhdr: I/O error@(#)addr.c 2.1 11/5/80@(#)err.c 2.2 1/10/81: %s: error %ddelivermail: %s %s... @(#)matchhdr.c 2.1 11/5/80@(#)sysexits.c 2.1 11/5/80WW,W>WKWXWlW{WWWW Bad usageData format errorCannot open inputUser unknownHost unknownService unavailableInternal errorOperating system errorSystem file missingCan't create outputI/O error@(#)util.c 2.1 11/5/80Out of memory!!=951-)%! 11r4G(f3YC!d&Yo;VVu7{ʉ0- T;/> [2/a1<=`fvK_zlG6$C w$M670)Yn!N6V1p&83)]H+ܝ<5;71g$+#) n0%a3 $ 2nV01}D9R7N:#68W)9:{2}x|~L'\/qö.pag.dircannot open database %s items not in pairs entry too big split not paired bad delitem bad block M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/etc/utmp/etc/passwdrr/#  AAAAAABBBBBB uu,\/etc/ttys/dev/0(( r<<,L$y/6N>dILPQt YDQai4Rq{RTpLV4dVhVVWP p +++O,/fd/ p0)P04;0>~1ID1Tp1_q2fq03n|3w3v34$4D5T508H888~8$9$99y :0:@:$T::::(:1:9:@:I:Sf<;\fCeyElEsE}FFF;GGGGGG H(H!@HlH|HAHHH 7 KdKK K'K/K8E>D~JrLS~L\FDLfpHLp9LL{ PLyXL\LVM<"0|3D1!(H|[F H\G BL\ CN\ P\  oR\ bT\ V\( X\3 Z\< \\G 9^\N `\X Fb\a d\k h\s NN p\ \ \ \ \ \:I.Z94q26d/8d  \Fv3 t 'V/$@:7p?JQ HYrbluHtx3| + H] tL].D5;Gt$4+03hZ$9A|H6 0T:,/Xhj VE :p:G:  (4 30 8 P]= X]B p KPU*!\'dplu16n088?K98:0::LDTH8K z WVW+#9P *N2Mp0: :Bp1LGRKYG_dZiT5v}H '`] d] h] al] p] "pa `pq tq xqGt!)H' &])|) j"e>*:!y#(*12)9T(A r%KNT&V%_))h0+p`Wwy4X~+K?+ -:,O.fCQu0E~<113HdK 4 ,\ X08 y`J :( :1 3G9 qA 4EK uS F[ VHa @Hg lHn  Kt 7|J} 0 MK crt0.oversion.oconf.o_SccsId_BerkLocalmain.o_SccsIdmaketemp.o_SccsIdparse.o_SccsIdalias.o_SccsIddeliver.o_SccsIdsavemail.o_SccsIdaddr.o_SccsIderr.o_SccsIdmatchhdr.o_SccsIdsysexits.o_SccsIdutil.o_SccsIdbmove.o-ldbmabort.ochmod.octime.ofputs.ofreopen.ogetgid.ogetlogin.ofprintf.ogetpwnam.ogetpwuid.ogetpwent.oatoi.ofgets.ogetuid.oindex.omktemp.oaccess.ofopen.ocreat.oerrlst.odup.ofdopen.opipe.oprintf.orew.octype_.ofilbuf.osetbuf.osetgid.osetuid.ostrlen.ostrncmp.o_exit.oexecv.oexecve.osignal.olseek.otime.ogetpid.osprintf.odoprnt.oflsbuf.oexit.odata.ottyslot.orindex.ostrcmp.ottyname.oclose.ofstat.oisatty.oopen.oread.ostat.ostrcat.ostrcpy.ostty.oioctl.oungetc.ounlink.ourem.omalloc.osbrk.oudiv.ovfork.owait.owrite.ocerror.o_exitstart_main_environ_Version_UseMsgId_ArpaHost_MyLocName_UucpLocal_DaemonName_Mailer_ParseTab_getname_getlogin_getuid_getpwuid_strcpy_ttypath_ttyname_errno_stat_ArpaFmt_FromFlag_Debug_MailBack_BerkNet_WriteBack_HasXscrpt_NoAlias_ForceMail_MeToo_SaveFrom_IgnrDot_SuprErrs_Errors_InFileName_Transcript_From_To_HopCount_ExitStat_SendQ_AliasQ_signal_finis__iob_setbuf_syserr_atoi_freopen_openxscrpt_printf_maketemp_MsgId_strcmp_index_parse_usrerr_strlen_sendto_recipient_alias_strcat_deliver_savemail_unlink_mktemp_chmod_MsgSize_GotHdr_creat_close_fopen_fgets__ctype___filbuf_ungetc_makemsgid_fprintf_strncmp_fputs_matchhdr_prescan_fclose_time_getpid_sprintf_xalloc_makelower_any_lhs_rhs_dbminit_sameaddr_fetch_tkoffq_putonq_forward_stripquotes_getpwnam_giveresponse_mailfile_putheader_buildargv_pipe_rewind_vfork_dup__exit_setuid_execv_fflush_pipesig_fdopen_wait_N_SysEx_SysExMsg_ctime_bmove_errhdr_getgid_setgid_setpwent_open_write_read_sys_nerr_sys_errlist_lower_malloc_bitno_maxbno_blkno_hmask_pagbuf_dirbuf_dirf_pagf_dbrdonly_fstat_forder_calchash_getbit_dbm_access_makdatum_cmpdatum_delete_delitem_lseek_store_additem_clrbuf_setbit_firstkey_firsthash_nextkey_hashinc_chkblk_hitab_hltab_abortcerror_localtime_asctime_ftime_gmtime_dysize__flsbuf_getegid_ttyslot__doprnt_getpwent_endpwent_geteuiduremudiv_access__lastbuf_dup2_free_execve_getppid_isatty__sobuf__cleanup__sibuf_rindex_gtty_stty_ioctl_sbrk_realloc_end_brk@iZkSR2S "%(+.gg  xJ^Юn PPՀPpPP PX^h[ЬPݠ PPPKY׬[[ شKϺY7мP`-"PPiмP~n=ϱYݼ ׬ϠYP ݬ PyYPݬCyYlYݬ>ݏ1<&PPxP@YϪV2~ϞVPJ`PP~<ώV~x ~qV8ݬ ݬbV P ݬϬ[K[^Ѭ  ЬP@UP Ѭ<V~xϤPݏUtЬP@P ^Ь[ԭZk96 PQPQ0QZ[[kPP P P+P-k0ZέPЭPЬZЬY[ [[ \~ݬPP$   !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj0~P sLkL BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[1xݏPZZ  YYX ZYYXZYZ~(PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[ Ь[Z = 8[ePZ~9PZ ݫ ԫ kZP{(P^߭ݬDPPPݬݏ tݬݬݏtݬ60R.db"R`bRRRRR~*PYQ[Qk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZQ [`bPQYPƏPxPQbPZxxQPZPPZxhQ~@PZZZEQ>QPZP1Qx2QPZPPjjQ`bQ1xYP[PPZPPPkPPk[P Ь[[ZZZPjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP!P@j~\S^\_PCЬPЬPЬRRQ{RPPR PRPPPOPBad flag %c cannot open %s %s: Only doing 250000 files Not enough core %5u bad; %u/%.14s %5u arg; %u/%.14s entries link cnt %u %d %d read error %d %u - huge directory @(#)dcheck.c 4.1 (Berkeley) 10/1/80\^\^$xb@ibk?J' 147:=@C]hff  p^Юn PPՀPpPP P<$^ԭP 7ϹϟϬϦϹϟϙϨϟ ϖ ύ Ϥ `϶O ߭6 P1ѭ ЭϹP֠[oϹPݠ[pP[ϧPݠ[^P[ϕPݠ [LP[σPݠ[:P[qPݠ[(P[c[khQError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too largeЬ[  P ݏ P ի ߘP@Z% ["Z G  P2PPݫ~ PkЫk!k    k1WP֫^ԭլݏP$|PݭݭVխѭ¬ Э!Pݬ`$+ЬP}V}X}Z}Э`PЬPЬQ}V}X}Z}\Ё^PP Ь[ZZZPЬ[ЬZЬ Y[X[Y{XPЬ[ЬZЬ YY kPYP kPzQQPЬ[ЬZ[XY YY  YXP  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP (( tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~YPYj~P  BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3["1xݏPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP@[ [[[j Ь[Z = 8[ePZ~9PZ ݫc ԫ kZP{PxP^߭ݬlPPPH8(PЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6 P$.H4D4 ~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [D4PYPƏPxPbPZxlPZPPZx\~@PZZZ92PZP%x&PZPPjjD41xYP[PZkk[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j~\S^\wP[ЬPЬPЬRRQ{RPPR PRPPլQPe P!/usr/spool/mail/etc/utmp/etc/utmp/dev/mail/dev/mail/dev/console/dev/mail0: got %d bytes %d: %d byte control message %*.*s attach %x, uid %d detach %x, uid %d ioctl %x unknown command %d alarm changed ok mailfor %s bad format /dev/notify %s on %s wrong mode wfopen failed %s New mail for %s has arrived:%s ----%s HERE %s's mail starting at %d rCant read the mail ----%s %s ...more...%s ...more...%s %s @(#)comsat.c 4.2 (Berkeley) 10/20/80Unknown error: #L/L/D#\4@iuk dgjmpsv~phhȪ   ^Юn PPՀPpPP P  ^ѬϽω ЬPݠϷ PZЬPݠϳϺ_ [yK1P KϝVK:PP Kϗ;PPx PݭZϋݏ ZJ PKg<[[  [1KϽPP=PPx PݭZݏϏZ PPQxQQQPԭxPPЭQA`@ݭZݏAZf[[1e+" ЬP֬`[ [0[9PPЬ[ZYk94 ZPQPQ0QZY[[kPP P P+P-k0YZPZPp\~ݬgPP   !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0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 0@L^n%9JYhError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large4\~ݬ+PPЬ[[ ~kЫ0   Ь[  P ݏ P ի ߘP@. [ w  P2PPݫ~9 PkЫk!k    k1WP֫ Ь[ZZZP   !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~)PYjP~P  BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[ 1xݏPZZ  YYX ZYYXZYZ~XPY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[ Ь[Z = 8[ePZ~YPZ ݫK ԫ kZP{ Ь[ЬZkPkPzQQP8P^߭ݬTPPPPݬݏ tݬݬݏtݬ6`.&R&JDG58~*PY![&k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [&PYPƏPxPbPZxPZPPZx~@PZZZunPZPaxbPZPPjjK&?1xYP[P,Z% k k[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPQ@j~\S^\_PCЬPЬPЬRRQ{RPPR PRPPPuP8usage: chown uid file ... unknown user id: %s @(#)chown.c 4.1 (Berkeley) 10/1/80/etc/passwdrrUnknown error: #  AAAAAABBBBBB P&((@ikg phiȪ  \ ^Юn PPՀPpPP P@Ѭs$ЬPݠϔPЬPݠ(P5ЬPݠϝPЬPݠώ&ϯPР[3ϧK6Ϻ2Ϟ~K@PKϋϞ[[ϒυЬP֬`[ KρPPP Ь['PZ[j@P9ZP P a Ь[ЬZ kPPZ[kk[P |QPzPoݏ P[[x$:[P[[g$:[nP[PTPM$O$F$:[EP[ [7+$Z[,[ P[kj#PЬ[ZYk94 ZPQPQ0QZY[[kPP P P+P-k0YZPZPЬ [ЬY׬&k ЫP֫`P [PZZZ Z YPЬPЬ[XXPX 鑫+PPPYkw+ݏݬPZY1ZZ kalYPPPݬPZ<3ݏݬ}PZYZZݬPZZ)ZYPPPݬPZZ1hZY kr  XP [ P@X[ݬIPZZݬ.[P[px (:J\h~&5D\iError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too largeT\~ݬKPPЬ[[ ~kЫ0   Ь[  P ݏ P ի ߘP@ [    P2PPݫ~9 PkЫk!k    k1WP֫ Ь[ZZZP   !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmn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ϐݏ мѬѬM:1[xόxXχWXZWYϫЭV1 fiijrXϗPc`Xϭ1*WP8W>Ϭ Ϩ0 Ϸϒ)W Ͻ)PP1kݏW1[ψ)τ)..{)P[[kP@ρ kP@q[kH)ZϥXϴPX1׽ЭPРQ֠aPݭP.V׽ЭPРQ֠aPݭϵPs0׽ЭPРQ֠aPݭϏPo ݭwݭϜ(Y?ϟ(WϰP Ϩ(ϊ(Xϛѭϕ(:WWXP'#AH 2 ݭ&(QP1ݭHVf171 w ϗϋZϚρݭU @P0Pݬ \~ݬ3 ЬP PPЬ[$XXZPX 鑫+PPPYkw+ݏݬPZY1ZZkalYPPPݬPZ<3ݏݬ}PZYZZݬPZZ)ZmYPPPݬPZZ1hZY kr  XP L[9T,P@X[ݬPZZݬu[P[_N(@Jdv *9IXi} )Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large\~ݬPP^Ь[ЬZԭլ05Ьj ЪP֪`P ZoPYY׭֭ѭ ЭP^Ь[ЬZԭլ.3ЬYj ЪP֪` Z~ Y ֭ѭ ЭPЬ[  P ݏ P ի ߘP@" [ v  P2PPݫ~ PkЫk!k    k1WP֫ Ь[ZZZPЬ[ЬZ[XY YY  YXP ^HP+ݬxݏcP[PZ߭%PP Pѭ[MZBЭPݬ4ݬݬ;0^BЬ2߭ \~ݬ׭ ЭP֭` ߭rЬP  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX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ЬPЬRRQ{RPPR PRPPPYP<'^'((@i kk# 0`g#hȪc'o'r'' !"#$%&'   !"#$%&'  /dev/ttyAre you sure you want to clobber the floppy? Are you sure you want to clobber the floppy? arff: bad option `%c' arff: one of [%s] must be specified arff: only one of [%s] allowed usage: ar [%s][%s] archive files ... arff: %s not found arff: phase error on %s %c - %s %d entries remaining. Tempfile: %6.6s %3.3s %02d/%02d/%02d %d %-25.9s %d x - %s Floppy open failed r - %s %s will not fit in currently used file on floppy a - %s Directory full on %s arff: couldn't open %s d - %s @(#)arff.c 4.2 (Berkeley) 11/3/80rxtd/dev/floppyvf ABCDEFGHIJKLMNOPQRSTUVWXYZ$.@0123456789 abcdefghijklmnopqrstuvwxyz$.@0123456789M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec//)T4@i!kIâ  ghhȪ  ^Юn PPՀPpPP PPѬ+ЬPݠ@PWP"׬Ͽ@P [[[[Ѭ KϡϣK[[ρP ^ݬP϶P ݬebݏϗBPϷ υ PσP*G.ݬQ dσ Wz ԭ߭EϨ ѭe90! π PP 1?<~~~ <rϵ?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~QPYj4~P   BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[1xݏPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[ Ь[Z = 8[ePZ~YPZ ݫs ԫ kZP{ Ь[ЬZkPkPzQQP`P^߭ݬDPPP0 ݬݏ tݬݬݏtݬ6 PЬPЬRRQ{RPRPPPRRP.  ~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [ PYPƏPxPwbPZxdPZPPZxT~@PZZZ1*PZPxPZPPjj 1xYP[PZkk[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP @jx~\S^\_]PTCЬ?PЬPЬRRQ{RPPR PRPPPqP((@(#)arcv.c 4.1 10/1/80-t/usr/tmp/arcXXXXXX/tmp/arcXXXXXX%s: arcv: cannot open %s arcv: cannot open temp arcv: %s not old archive format ! %-16.14s%-12ld%-6u%-6u%-8o%-10ld%-2s` arcv: write error /  @i"kc&  E<bhhȪ   ^Юn PPՀPpPP  PѬ ЬPݠ < Ϫ !φ3 [  P@X[ݬ)PZZݬ6t %[P[P (8DVfx 1BQ`xError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large Ь[ZZZPP P^Ь[    PPYYX1XX߭~PYj~P #   BЫZ֫ZPѫPѬ ZPPXPZ~=PYZkn 1mЫZ3[\ 1xݏPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[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ݬݏtݬ6 PЬPЬRRQ{RPRPPPRRP .t p ~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [p PYPƏPxPgbPZxTPZPPZxD~@PZZZ!PZP xPZPPjjp 1xYP[PZkk[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j ~\S^\_y Pp CЬ[ PЬPЬRRQ{RPPR PRPPP P4/dev/rmt80rstXXXXXXUsage: oldrestor x file file..., oldrestor r filesys, or oldrestor t Bad key character %c restor: %s - cannot create directory temporary %s: cannot open tape Tape is not a dump tape Dump date: %sDumped from: %sTape is not a dump tape Tape is not volume 1 of the dump %s: not on the tape %s: inode %u Mount desired tape volume: Specify volume #: Volume numbers are positive numerics tape is not dump tape Wrong volume (%d) Can't find inode mask! end of tape extract file %u %u%s: cannot create file %s: cannot open Enter starting volume number: Last chance before scribbling on %s. Missing volume record Tape is not volume %d Missing header block End of tape Unknown header type Resynced at inode %u %u: ilist too small Can't find directory header! /Missing address (header) block Tape read error: inode %u Mount volume %d Cannot open tape! Not a dump tape.Try again Wrong tape. Try again /disk write error %ld read error %ld Out of space. Checksum error %o @(#)512restor.c 4.2 (Berkeley) 11/15/80M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/ 6 @i&kS $filorux{~2i  ^Юn PPՀPpPP P P^* P߭PѬ όЬPР^ѬР~ϳPZpϱc9' ;Z86Ϟ1cό 1A1>5PPHc߭ϭDP=Cϴ=.ϟ/yϠPnϒ=h#[Z,P1#-lP%[K ѭ ԭKCխ[[P`-4[PK`ܘKխ խѭ ѭܭ1q[[ϸωϮiυ1C9ϪόPϹϋϑϤYPw1s߭dP~vP\e@OЭPݠݠ5V!0-KPPϙݏPNP[fP![PP~iPP[QA` ϴP~Fψtxχ\uP[U[AZ~P ϻ϶PP'ωP[ϥoq[ݬK![Kݬ P5^߭2P?@ABCDEF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έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~1PYj0 ~P 3S+S BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[+1xݏPZZ  YYX ZYYXZYZ~`PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[ Ь[Z = 8[ePZ~9PZ ݫS ԫ kZP{`P^߭ݬlPPP0 @i*kiM 4ǞhfȪPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6 PY.}Y}XXXXX~*PYX[Xk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZX [}PXYPƏPxPkXbPZxXXPZPPZxHX~@PZZZ%XXPZPXxXPZPPjjW}W1xYP[PWZWWWkWWk[P Ь[[ZZZWjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPW@j~\S^\_yPpCЬ[PЬPЬRRQ{RPPR PRPPP VP/dev/rmt0/dev/tapx/usr/mdec/mboot/usr/mdec/tbootTape open error Bad usage mode uid gid tapa size date time name End Out of core Pathname too long - %s File ignored Directory checksum Warning: swabbing required Warning: cannot read prototype boot block. Tape read error Tape write error Tape seek error %c %s .%s -- Cannot open file Directory overflow %s not found Can't open %s %s -- Phase error Tape overflow Tape overflow %4d entries %4d used %4d free %4d last %s%4d%4d%5d%9D %2d/%2d/%2d %2d:%2d %s %s -- create error %s -- write error M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulA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YXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~ PY PP[ [[[ Ь[Z = 8[ePZ~YPZ ݫ ԫ kZP{ Ь[ЬZkPkPzQQPlP^߭ݬPPP<,PЬ[ЬZ[Y[YPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6v.lvhvvvuu~*PYu[uk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZu [hPuYPƏPxPwubPZxduPZPPZxTu~@PZZZ1u*uPZPuxuPZPPjjuht1xYP[PtZtttkttk[P Ь[[ZZZtjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP t@j~\S^\_uPlCЬWPЬPЬRRQ{RPPR PRPPP`P885r-w-s@x- r-w-sx-r-w-tx-4$444L4\4l4444usage: ls [-1ACFRabcdfgilmnqrstux] [files] /etc/passwd/etc/groupr %s: ...total %D r%s unreadable ls: out of memory ls: too many files %s not found %d %5d %D %4D %D %4D %2d %-8.8s%-8d%-8.8s%-8d%3d,%3d%7ld %-7.7s %-4.4s %-12.12s /* %s(null pointer).M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/etc/grouprr/etc/passwdrr8@i-kkN P  #&)ƞLhfȪ  @ /^Юn PPՀPpPP? P:^Ѭs? sЬP@м1DPPoz1Pb11P411]P011HP-~@G6֭мrIr9rr7r3r>P?>P.r">?F?qwq1`q1Wq1Nq1Eq1<>r>q1&ЬP`EP>>PPh?E'1^q1P11P7P51P81Pl Pf11Pc11sPm1@1dPu1,Pr1Pp119Pt11*Pw1Pv11 Px11Zp1<cpp01,P,,P,,P,/>p7P=o>]Dn=!Por<^o7P~oFzoݏoAPZo"o=C"ݬ((.1ow=Qo6P Pn;:%o6Pn"o]=gCxݬ1nsA=nK6P P{nP;:n6P\n"n<B$   <B ^m1m Pm:::{:u:o:<r*mK4:)m<4:mymP~!5m^m߭R1ЬP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Z~PY PPD [ [[[n Ь[Z = 8[ePZ~YPZ ݫ ԫ kZP{ Ь[ЬZkPkPzQQP$PP^߭ݬ\PPPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6Ь[ѬP ѫѫk֫k׫ЫP`P 0PЬPЬRRQ{RPRPPPRRP|?.{n?{f?`?c?Q?T?~*PY=?[B?k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ> [{P>YPƏPxP>bPZx>PZPPZx>~@PZZZ>>PZP}>x~>PZPPjjg>{[>1xYP[PH>ZA>9><>k->&>k[P Ь[[ZZZ >jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPm=@jx ~\S^\] PT Ь? PЬPЬRRQ{RPPR PRPPЭRBQPl4PbPbլQP14PE/tmp/tarXXXXXX/dev/rmt8r-w-s@x- r-w-sx-r-w-tx-,@<@L@d@t@@@@@wTar: cannot create temporary file (%s) !!!!!/!/!/!/!/!/!/! 000 Invalid blocksize. (Max %d) tar: %c: unknown option -Can only create standard output archives tar: cannot open %s -tar: cannot open %s -tar: cannot open %s tar: usage tar -{txru}[cvfblm] [tapefile] [blocksize] file1 file2... sort +0 -1 +1nr %s -o %s; awk '$1 != prev {print; prev=$1}' %s >%sX; mv %sX %sr-CMissing links to %s %o%o%o%lo%lo%odirectory checksum error %s %s tar: %s: cannot open file %s: file name too long %6o......tar: %s is not a file. Not dumped %s: file name too long %6oa %s link to %s Out of memory. Link information lost a %s %ld blocks %6o%s: file changed size %s: cannot link %s linked to %s tar: %s - cannot create x %s, %ld bytes, %ld tape blocks tar: %s: HELP - extract write error tar: %s: HELP - extract write error %s linked to %s %3d/%1d%7D %-12.12s %-4.4s %c/bin/mkdirmkdir/usr/bin/mkdirmkdirtar: cannot find mkdir! %6o %6o %6o %11lo %11lo %c %s: %s %lo/bin/pwdpwd/usr/bin/pwdpwdpwd failed! / Tar: tape read error Tar: tape blocksize error Tar: blocksize = %d Tar: tape write error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Y HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~-PYj` ~P  BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[@$1xݏPZZ  YYX ZYYXZYZ~\PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP [ [[["  Ь[Z = 8[ePZ~PZ ݫO ԫ kZP{P[P[P[P/[PZ[ZZn PXYX/P[Y[ZuPX\YPXO[[ݬP1yk  kP[|7[ Ь[Zk[ZZP Ь[ЬZkPkPzQQP^ݬPP߭ݬP6.&@80( 91)! ;3+# =5-% ?7/'(08@ '/7?&.6>%- 5=$, 4<#+ 3;"* 2:!) 1991)! :2*" ;3+# <4,$?7/'>6.&=5-%      )4%/7(3-!0,1'8"5.*2$                                                                                                                                     /etc@i?/ke ,Y\_behknqtwƞ/utmp/dev/ttyr%s /etc/passwdrr))p%/etc/ttys/dev/7@iA0kF 4}hh   d^Юn PPՀPpPP P^ϡ,Ь-Ь--G-ݏtLϸ-ϱ-ϑ-ݏt4Ϙ-ݏ|t#w-ݏttφ-.eq-#&j-PݠYP;G-1dϩ&=-Pݠ,P1>#-@,10-,ݏtPm&Ϛ 1 ,,P`,K&APA&4P>&'P>Ϥ,ϗ,ȏώ,σ,  ȏ~,ς,ݏtP&&P$Q,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ͼ1 Ϲ "ݏ4#~ݏ%#~ݏ#~ݏ"~ݏ"~ݏ"~Ͼ"~"~ϯݏϳ"~ϟݏϤ"~Ϗϛ"~ϗ"~πϏ"~ω"~qJ`ϕ"bZAPQPQ!խ"PPPj~ԭѪ.K" Zjխ  ^ԭѬѬ Ѭ1Ѭ1Ϛϗ nѬ}w N֭?Ѭ c[ 2֭@ݬJ@ ֭Ѭ3& ֭Ь1I ֭ѭݬݬ ѬϩϛϲωѬϼϖm?Ѭ ϥ}T@ݬϏe<լݬݬvI ЬP@ϯݬ_,ݬ \~ݬcЬP PP [I < P@X[ݬPZZݬ>-[\P[h 0HRl~ 2AQ`q1Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large\~ݬPPЬ[ի ݫ Ь Ыk Ь[ZZZP  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~ PYj|~P  BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[,1xݏPZZ  YYX ZYYXZYZ~8PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[> Ь[Z = 8[ePZ~YPZ ݫ+ ԫ kZP{ Ь[ЬZkPkPzQQPP^߭ݬ4PPPݬݏ tݬݬݏtݬ6p.P6bL6ZTWEH~*PY1[6k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [L6PYPƏPxPbPZxPZPPZx~@PZZZ~PZPqxrPZPPjj[L6O1xYP[P<Z5-0k!k[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPa@j~\S^\_PCЬPЬPЬRRQ{RPPR PRPPPP(*I*K*N*Q*U*Y*_*c*g*k*o* t* y* ~* * *****@*@* * * ********* * ***+ +0+0+ 0+00+ + %+ *+.+2+6+:+@>+@@B+F+J+M+S+eV+e\+_+d+g+@iL0kG 4}hhm+ p+ v+@z+++++++++++++ + +@+@++,,,,%,,,4,<,E, L, T,@\,@e,&.k,'.@p,.u,.z,.,.,.,.,.,.,.,., .,!.2Kn,X` %alleverythingeknewioctlnewcrtioctlcrtoldioctldecioctlgspeedhupspeed/dev/tty%((s unknown unknown mode: %s net discipline, new tty, old tty, input speed output speed speed ; even odd -raw -nl -echo -lcase -tandem -tabs -cbreak nltabcrffbs crt: (crtbs crterase crtkill ctlecho) crt -crtbs -crterase -crtkill -ctlecho -prterase -tostop -intrup -tilde -flusho -mdmbuf -litout -nohang -etxack -pendin erase kill intr quit stop eof erase kill werase rprnt flush lnext susp intr quit stop eof , M-^^%c/ %s%s = M-^^%c%s%d %s%d baud@(#)stty.c 4.6 (Berkeley) 7/8/8105075110134134.515020030060012001800240048009600extaextbeven-evenodd-oddraw-rawcooked-nlnlecho-echoLCASElcase-LCASE-lcase-tabstabstandem-tandemcbreak-cbreakcr0cr1cr2cr3tab0tab1tab2nl0nl1nl2nl3ff0ff1bs0bs133tty3337tty3705vt05tntn300titi700tekcrtbs-crtbsprterase-prterasecrterase-crterasecrtkill-crtkilltilde-tildemdmbuf-mdmbuflitout-litouttostop-tostopflusho-flushonohang-nohangetxack-etxackintrup-intrupctlecho-ctlechopendin-pendindecctlq-decctlqerasekillintrquitstartstopeofbrksuspdsusprprntflushweraselnextUnknown error: #L2L2 .d6@iP1k`= hh  ^Юn PPՀPpPP P<0^Ѭ Ͻ֬Ь1ݼϭ1ϛݼϵPP ߭Pѭ"ѭѭ ݼkϢ\wϑݭݭݭwzPPݭݭf_ѭ ݼ\MWDݭ ׬1?Ь[XXXPX 鑫+PPPYkw+ݏݬPZY1ZZ kalYPPPݬ PZ< 3ݏݬ}PZYZZ ݬ PZZ)ZYPPPݬ PZZ1hZY kr  XPX<\~ݬ3PP^Ь[ЬZԭլ05Ьj ЪP֪`P ZoPYY׭֭ѭ ЭP^Ь[ЬZԭլ.3ЬYj ЪP֪` Z~[ Y ֭ѭ ЭPЬ[  P ݏ P ի ߘP@n ["   P2PPݫ~ PkЫk!k    k1WP֫   !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0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P1ԭGݫMPPPѭQQPQ&ݫ$PZRLLD>1/Э1<ݫP1[ݬݫ 1XݫPXЫ[[1kխD~PWPXPWWXPݫa[[н^߭լݬЬլ ݬ] P PtQPQPP@)7*(ЬRPQbPЬP}V}X}Z}Э`PЬPЬQ}V}X}Z}\Ё^PP;0+QPlP^߭ݬTPPP<,Pݬݏ tݬݬݏtݬ6< PЬPЬRRQ{RPRPPPRRP ~\S^\w P [Ь PЬPЬRRQ{RPPR PRPPլQP P^Ь[    PPYYX1XX߭~PYj ~:P   BЫZ֫ZPѫPѬ ZPPXPZ~=PYZkn 1mЫZ3[LK1xݏWPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~hPY PP[ [[[  Ь[Z = 8[ePZ~PZ ݫs ԫ kZPxnvtsierku Vnewline @ "2@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@//tmp/sh-M VERSION sys137 DATE 1978 Nov 6 14:29:22 bad option(s)you have mail no spacesyntax errorbad numberparameter not setbad substitutioncannot createillegal iorestrictedcannot make pipecannot open - core dumpedarg list too longtext busytoo bigcannot executenot foundbad file numbercannot shiftbad directorybad trapis read onlyis not an identifierPATHHOMEMAILFILEMATCHIFSPS1PS2 :/bin:/usr/bin: -end of file unexpected at line /dev/null+ > $ # .profile(I +I"0I5I9I!>IAIGIJI$OITIYI\IbIdI(fImIrIIIIIIIIIIIIexportreadonlyJ JJJJJ!J&J ((+J -JtH lH4J:J @J IJOJTJYJ_Jinesaccasefordoneifwhiledothenelseeliffiuntil{}HangupQuitIllegal instructionTrace/BPT trapIOT trapEMT trapFloating exceptionKilledBus errorMemory faultBad system callAlarm callTerminatedSignal 16cdreadset:traploginwaiteval.newgrpchdirbreakcontinueshiftexitexectimesumask8G$G G0GJhJ4GJJGJJGJ=/bin/csh/bin/cshptrace: Pwϱ" ω PQQPͰݰf ϽPQQPͰݰB PjYa<ϫ `PQP1hQP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qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~QPYjL ~P g _  BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[h1xݏPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[  Ь[Z = 8[ePZ~YPZ ݫ[ ԫ kZP{ Ь[ЬZkPkPzQQP`P^߭ݬTPPP0 Pݬݏ tݬݬݏtݬ6 P ."" ~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ ["PYPƏPxP{bPZxhPZPPZxX~@PZZZ5.PZP!x"PZPPjj "1xYP[PZkk[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j~\S^\wP[ЬoPЬPЬRRQ{RPPR PRPPլQP!P8rm: unknown option %s ..rm: cannot remove `..' rm: %s nonexistent %s not changed remove directory %s? rm: cannot read %s? %s/%.14srm: %s directory rm: remove %s? rm: override protection %o for %s? rm: %s not removed rm: remove %s? /bin/rmdirrmdir/usr/bin/rmdirrmdirrm: can't find rmdir @(#)rm.c 4.3 (Berkeley) 1/4/81#@i6k@ ORUX[^>hfȪ (( 4 ^Юn PPՀPpPP Pt ^σ 2vϧϯ GϮ Pt| ϴ ϩφ±Ϟ{m` C1ύϝϗCPώQ A`τ~/d  [[K^[]PPPϛFZ[ZPJ@ZZ,[PPP#/K[KK  Pݬ \~ݬЬP PP  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXX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 ݭ!Pѭԏ 2P PPPPPЭYY12XYXYXݭݭݭX[PWXXYZ Xj1yj~ݭݭ~Ь[EW GG4WGG%ЪVݭ1 [kP` Z1@i7kB/lL Padgjmpsvy|2inЬ[\#XX$PX 鑫+PPPYkw+ݏݬPZY1ZZkalYPPPݬPZ<︄3ݏݬ}PZYZZ]ݬPZZ)Z YPPPݬTPZZ1hZY kr  XP` ^ЬP ЬP 1Ѭ sՠn iмZЬլ ~PPZPPZЬP )Z%ѭZPQáPѭPQP­P[[ЬP PQРЬP ݬ [~ЬP~qPԼ[h׼ ЬP֠ZݬzNЬP BPЬP ԼЬP ЬPPQРݬ ݬЬP~PѭPP D [L ﴂP@X[ݬUPZZݬ [(P[''''''''( (0(<(N(^(p(|(((((((()))):)I)X)p)})))))Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg ((list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large\~ݬPPЬЬ ~Ŭ PP~ݬ^]YìPPPYxY~ݭ PPYЭЬ[YZ+Yݭ[ݭ[PPhY[[]ZYݭKZYݭ[YЭ[/ZݭPP[Z[pYZYZZ[>ìPíQPQݬY~Э1ݭݬY1[YݭZ2YЭZ14 ^Ь[ЬZkj׭^Ь[ЬZЬ Ykij׭^Ь[ЬZԭլ05Ьj ЪP֪`P ZPYY׭֭ѭ ЭP^Ь[ЬZԭլ.3ЬYj ЪP֪` Z~ Y ֭ѭ ЭPЬ[[ ~kЫ0   Ь[  P ݏ) P ի ߘP@ﲄ [lG   P2PPݫ~5 PkЫk!k    k1WP֫pPPR RR RP|PpPrPP"{Ь[ի ݫ Ь ЫkЬ[ЬZЬ YY kPYP kPzQQP Ь[ZZZPЬ[ЬZЬ Y[X[Y{XPЬ[Ь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DyDDAACCC@DDD;E/dev/devproc table swapper pagedaemon ip input %.*s error reading kmem at %x kmem/vmcorememdrum/vmunix%s: No namelist nswapmaxslpccpuecmxno room for text table text tableps: specify only one of s,l,v and u SSIZ %s COMMAND ps: error reading %s from %s.rCan't open . in /dev consoledrumfloppynullttyd0??ps: cant read u for pid %d from %s ps: cant read indir pte to get u for pid %d from %s ps: cant read page table for u of pid %d from %s ps: cant read page %d of u of pid %d from %s ()ps: error locating command name for pid %d ()%6x%4d%6u%6u%3d%4d%3d%5x%4d%5d %5x %4.4s %-2.2s%3ld:%02ld%-8.8s %5d%5.1f%5.1f%5d%5d %4.4s%5u %4.4s%3d%3d%7d%5d%5d xx%5d%5d%4d%5.1f%5.1f%4d %5u %4.4svstodbvstodb *ipps: ran out of memory @(#)ps.c 4.13 (Berkeley) 81/07/08_proc_Usrptmap_usrpt_text_nswap_maxslp_ccpu_ecmx_nproc_ntext_hz F UID PID PPID CP PRI NI ADDR SZ RSS WCHAN STAT TT TIMEUSER PID %CPU %MEM SZ RSS TT STAT TIME PID TT STAT TIME SL RE PAGEIN SIZE RSS LIM TSIZ TRS %CPU %MEMSSIZ PID TT STAT TIME1@rzA]ݬ5@3elB#"3h@?ØGe@lB,k$d!r@AA@@@JGSrCu%طK@0qi9IE4Ÿ@;\)@3fG@@@@@@@A@@A/etc/passwdrrrUnknown error: #  AAAAAABBBBBB TTH@i8kr/ (Þ ((  '^Юn PPՀPpPP P^ϫ<!>uP NePxPPPAPԭѬ1мP`-1ּмP`PPfT$6$$$_$$$$$N$$qݼ P-׬ѬЬP`ϥ!׬tArA< ּݼό Pּݼz PּмP``?A 8A.AмP`+ּݼ@ P@1sݬݼϓ֭@խ |@ @@G@ @@)  ^Pϣ@P߭ϗ@ ώ@ݏπ@D^_@ BHH " 1@ݬϧ?ϔϐPυPPσ?x[ Zuv?hiYT?ԬլApݬ& P!ϧ?ݬVςϑ [Zϣ߭ݬAϚ߭ ςլЬP$PPk߭PY!?YeZVPϱQPAϚ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P  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~=PYjP ~P  BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[p%1xݏ PZZ  YYX ZYYXZYZ~lPY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP [ [[[  Ь[Z = 8[ePZ~PZ ݫ_ ԫ kZP{P[P[P[P/[PZ[ZZ^ PXYX/P[Y[ZuPX\YPXO![[ݬP1yk  k P[;[ Ь[Zk[ZZP Ь[ЬZkPkPzQQP^ݬPP߭ݬP6.&@80( 91)! ;3+# =5-% ?7/'(08@ '/7?&.6>%- 5=$, 4<#+ 3;"* 2:!) 1991)! :2*" ;3+# <4,$?7/'>6.&=5-%      )4%/7(3-!0,1'8"5.*2$                                                               @i9k[ ? ,߾                                                                      /etc/utmp/dev/ttyr%s /etc/passwdrr..&/etc/ttys/dev/;@i;kIٸ $ilorux{~2i  (^Юn PPՀPpPP P^) YѬ1м[k-k1PPhF1PXc{PHXePDEYLYE:Y0Y&YY  POPc PbPd1wPwPo1n1]Px1s1N׬ϐ ύτѬ;мP`+2ϑݼϕPݼπύN׬ѬݼϓX3Y IIEYYP24QPQX DϽXZq2PPP~ϪPZOXZPP~ϐmXY I|IϘYYP2QPQYYP2ϼQPQIUYϫϏ(P `  _`ZZY1KPPYP1Z1WݬϳϱPϬ ` ϟ  ZϐώPω ` | ӏY*ӏ?][PV ` I ϶[oӏY[Yx[PP~: Y ϫ ֭ѭϪ^Ь[k+[kx[ x[ϙk0k0ψ[Z . yjԭLY9gPYP0P4kYY0Ya)Yf <5PYPÏWP[kƑk.[kbkBx ݭVIЭЬ[Ь Z+PPPXZWkw+ݏݬPYX1YYkalXPPPݬPY<_3ݏݬPYXYY<ݬ`PYY)YXPPPݬ3PYYPjYX kr  ZPݬ \~ݬЬP PP ^ЬP ЬP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cc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~)PYj ~P   BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3["1xݏPZZ  YYX ZYYXZYZ~XPY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP| [ [[[  Ь[Z = 8[ePZ~YPZ ݫK ԫ kZP{ Ь[ЬZkPkPzQQP8P(P^߭ݬDPPPݬݏ tݬݬݏtݬ6\.,N,F@C14~*PY["k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [,PYPƏPxPbPZxPZPPZx~@PZZZqjPZP]x^PZPPjjG,;1xYP[P(Z!k k[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPM@jP~\S^\_5P,CЬPЬPЬRRQ{RPPR PRPPPqP@(#)nm.c 4.1 10/1/80 <""A"$G"&K"(Q"@W"D\"`b"dg"j"o"s"x"~""""""0"nm: invalid argument -%c a.outrcannot openold archive! bad format %s: no name listold format .o (no string table) or truncated fileout of memoryno string table (old format .o?)no string table (old format .o?)ran out of memoryerror reading string table %s: %s:%s:%08x - %02x %04x %5.5s %s %s:%s: %08x %c %s nm: %s:(%s): %s %02xGSYMFNAMEFUNSTSYMLCSYMRSYMSLINESSYMSOLSYMSOLPSYMENTRYLBRACRBRACBCOMMECOMMECOMLLENGPC((#,@i>k^_B ž߫hfȪ  ^Юn PPՀPpPP P^ Ѭ&ЬPРP`-ЬP~nP׬ѬωϨ5ݭϭ~ЬPݠ:ЬPݠ P@ϛk\~ݬx^ZYhmPZ/ݬP QPЭPP[|ݬ[P[}Ph[Y neP ||̀xxxxPPQ@A||sZZZuݬ|SPPPP P 1WY1WЬ[ЬZЬ Y k: k-kѬ Y/jik[[PPЬ[ЬZ!jЪP֪X``P ZXb PYXYPЬ[Zj7݊[ PYYP Ь[ЬZk =ZPk=Pݬ \~ݬЬP PPЬ[ZYk94 ZPQPQ0QZY[[kPP P P+P-k0YZPZPЬ[k[PP"P0:Tfx)9HYmError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large^ԭլݏPs|PݭݭVխѭ¬ Э!Pݬ+ЬP}V}X}Z}Э`PЬPЬQ}V}X}Z}\Ё^PPݬݬ; 0   !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~((T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPU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ݬݬݏtݬ6 P.))~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZf [)PXYPƏPxP?bPZx,PZPPZx~@PZZZPZPxPZPPjj)1xYP[PZkk[P Ь[[ZZZujPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j~\S^\wP[ЬPЬPЬRRQ{RPPR PRPPլQPPmv: cannot access %s usage: mv [-if] f1 f2; or mv [-if] d1 d2; or mv [-if] f1 ... fn d1 mv: cannot access %s mv: directory rename only %s/%smv: %s is a directory remove %s? mv: %s and %s are identical override protection %o for %s? mv: cannot unlink %s mv: try again /bin/cpcpmv: cannot exec cp mv: cannot unlink %s mv: %s exists mv :target name too long /mv: %s exists mv: ?? source == target, source exists and target doesnt ...mv: cannot rename %s mv: cannot locate parent mv: no write access to %s mv: no write access to %s mv: cannot move directories across devices mv: Sorry, path names including %s aren't allowed ..mv: cannot link %s to %s mv: %s: cannot unlink /..mv: %s: cannot unlink mv: cannot link %s to %s mv: cannot link %s and %s mv: ?? cannot unlink %s .mv: cannot access %s mv: cannot move a directory into itself ..mv: name too long /...../@(#)mv.c 4.4 (Berkeley) 81/04/26H%H%!)@i@k6J' m<h  ^Юn PPՀPpPP P i`W NEѬ%ϗ[ώϯ ЬP`׬iPPPυ  ^Z[ K/[Z[KZ Zݬ߭Ϡ6ޭPZP~ϗ ߭aP߭ݬ&ϽݏAݬPPPݬϡݬ5  ݬPTχݬS  ߭ϘP>OϪQQP ݬ P//QPݬ \~ݬ'ЬP PPQP LP<P!, Ь[ZZZPЬ[ЬZ[XY YY  YXP0   !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WP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ЬSSSP YD S S:P^լ=AD,B!ЭPݠРP~.D,нխB D,zBЭPݠݠD{,нխGB1ЭPݠCR,ЭPՠ C<,լЭP ~C ,ѭA C ,ЭPР~ЭPР6C+"ЭPՠРPݠC+нխЭPР-fC+ЭPݠ]C+нխнխ1zнխ11C^+8P8p^Ь[Լ P3A ݬݫ!C"+OS8 PЫ  PPPPԭԭԭԭݫS Pԭԭ pЫYЩZjZ\ЭZZiYYЫY1KԭЩZb߭~ݪ1Ps@ݭЪPݠlB^*ѭЭѭЪPݠp PpjZZ PP1թ1ѭխխթ@@ݫAp PAp?ݩPAЭ?E P3թ"խݫA^Nk$ЩѭЭiYY1$?YY1gЩ1ЭPРPРxxݫP1v͐;AhP >1AЭPР1(ЭPРPРt|xt'PP1XtPP߭~ݭPѭЭPݠp( PpA>ݭЭPݠq@,(ѭЭb@X>PJ@ЭPРнխ ЭPРխ1Iѭ խխխ3ЭP4нԭխ1нխ1нحխ1ViY1A1 Pݫ?[phP?AխݭݭAP}խ Ppv?P0ݫi?ЭPРխ?ЭPРн<ݫ3?&֭ݫ9?E?<ݫ PD>P7խլ ݫ?<լխݫ?M&_<լV<PPP<4խPPP ѭЭЭЭ ЭPH^ <;P;1>Р;ݭ>%;ݭ-֭-瑽@ݭݭݭQPխd;Pмլ1WHЬPݠ:D;ԭH Ь[kP;Cլ :6[: =P;PP=$I1:ݬ[ PZJxZP xZ~v=Z~=$լ==h$BI1ZP ^Ь[ЫPРЭZP*P?P[ PPkݭPPkԫZЬYiPPZYiǏZPďPPZZ[0KUPݠݬ1P [PǏPQďQQP[KT[PݬxPPcP^<P<P <9P[$9kݬwPԫ  ԫ[88ЬP`. P&P[8ݬ@2T[[P /P֬PЬ[[e%P~:PYYZ <YPЬ[ЬZЬ YYiЬ P^Ь[ЬZЬ Y[Zí[PíZQPQ Z{zP֭ѭ[iP Ь[[PZZPj;c^Ь[ЬZd#; P;;[}j ;ZPl}PP[k  kkk k[kk[i߭fPՠZݠePZЭP k1|k$[k1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*?[]:$`'"\ :;&>|$$No description argument after -f flagCannot open %sUnknown flag argument %smakefileMakefile.IGNORE.SILENT.SUFFIXESNo suffix list. No arguments or description file@ *** %s removed. .PRECIOUS-rDescription file errorOpen directories: %d: %s Macros: %s = %s %s: done=%d (MAIN NAME) depends on: %s commands: %s @(#)main.c 4.1 (Berkeley) 81/02/28Kdoname(%s,%d) TIME(%s)=%ld @?@Too many command lines for `%s' *TIME(%s)=%ld *<@?.DEFAULT<Don't know how to make %s Don't know how to make %s@`%s' not remade because of errors `%s' is up to date. @touch(%s) %s%s *** Error code %d*** Termination code %d (ignored) @(#)doname.c 4.1 (Berkeley) 81/02/28LHash table overflowout of memoryout of memoryinfinitely recursive macro?@*<?Warning: %s changed after being used Make: %s. Stop. Stop. line %d: %s$? list too long @(#)misc.c 4.1 (Berkeley) 81/02/28dNNNNNNNNNO OOO O'O/O6O>OFOQOXOoOvOOOOOOOOOP.P:PIPPPgPPPPPPPPPPQ-Q:QJQQQgQvQ}QQQQQQQQQR;RRRRRRRRRRSAS}./rDirectory %s: Cannot openaUser %s, %s rcannot open %s! %s is not an archive%s is not an object module@(#)files.c 4.2 (Berkeley) 81/02/28.SUFFIXES : .out .o .c .f .e .r .y .yr .ye .l .s .cl .pYACC=yaccYACCR=yacc -rYACCE=yacc -eYFLAGS=LEX=lexLFLAGS=CC=ccAS=asPC=pcPFLAGS=CFLAGS=RC=f77RFLAGS=FC=f77EFLAGS=FFLAGS=LOADLIBES=.c.o : $(CC) $(CFLAGS) -c $<.p.o : $(PC) $(PFLAGS) -c $<.cl.o : class -c $<.e.o .r.o .f.o : $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $<.s.o : $(AS) -o $@ $<.y.o : $(YACC) $(YFLAGS) $< $(CC) $(CFLAGS) -c y.tab.c rm y.tab.c mv y.tab.o $@.yr.o: $(YACCR) $(YFLAGS) $< $(RC) $(RFLAGS) -c y.tab.r rm y.tab.r mv y.tab.o $@.ye.o : $(YACCE) $(YFLAGS) $< $(EC) $(RFLAGS) -c y.tab.e rm y.tab.e mv y.tab.o $@.l.o : $(LEX) $(LFLAGS) $< $(CC) $(CFLAGS) -c lex.yy.c rm lex.yy.c mv lex.yy.o $@.y.c : $(YACC) $(YFLAGS) $< mv y.tab.c $@.l.c : $(LEX) $(LFLAGS) $< mv lex.yy.c $@.yr.r: $(YACCR) $(YFLAGS) $< mv y.tab.r $@.ye.e : $(YACCE) $(YFLAGS) $< mv y.tab.e $@.s.out .c.out .o.out : $(CC) $(CFLAGS) $< $(LOADLIBES) -o $@.f.out .r.out .e.out : $(FC) $(EFLAGS) $(RFLAGS) $(FFLAGS) $< $(LOADLIBES) -o $@ -rm $*.o.y.out : $(YACC) $(YFLAGS) $< $(CC) $(CFLAGS) y.tab.c $(LOADLIBES) -ly -o $@ rm y.tab.c.l.out : $(LEX) $(LFLAGS) $< $(CC) $(CFLAGS) lex.yy.c $(LOADLIBES) -ll -o $@ rm lex.yy.cS/bin/shsh-c-ceCouldn't load Shellbad wait codeCannot load %stouch: file %s does not exist. Cannot touch %s @(#)dosys.c 4.1 (Berkeley) 81/02/28U        Bad character %c (octal %o), line %dline too longyacc stack overflowsyntax errorInconsistent rules lines for `%s' Multiple rules lines for `%s' .SUFFIXESToo many lefts%dMust be a separator on rules line %s@(#)gram.y 4.1 (Berkeley) 81/02/28M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/bin/shPATH:/bin:/usr/binsh/etc/passwdrr  AAAAAABBBBBB __Xp@i BkF D58;>ADGJMPS2iR{  84((^Юn PPՀPpPP7 P0^<#7ϓ7N3QPϸIP P=$P%4PPP 8ύIτIϠIϗ#PB[[ϙ[7U7ϜPGIPC77c<>ЬP`P`rlIЬP`P`r9Ѭ&ЬPРP`-&ϴ7ЬPРP~AP ݬݬR ݬݬ?Ϟݬp$P ݬݬ`$ Ь[ЬZj[PQPQPP4^P!yHρ6ϑ6f߭υ6\1P16χ5ϪPYGP*6e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Z;ZY4Z P2PPkYZ~PY PP [ [[[  Ь[Z = 8[ePZ~PZ ݫ ԫ kZP{P[P[P[P/[PZ[ZZ> PXYX/P[Y[ZuPX\YPXO`&[[ݬP1yk  k>&P[W[ Ь[Zk[ZZP Ь[ЬZkPkPzQQP^ݬPP߭ݬP rmail: cannot reopen %s for reading wmail: cannot open %s Mail saved in %s researcresearchnull name mail: can't create proc for remote %s %suux - %s!rmail \(%s\)uux - %s!rmail %sw/bin/mailUsage: mail [ -f ] people . . . mail: can't send to %s /amail: cannot append to %s /dev/mail%s@%d amnesiavaxvax.lock/usr/spool/mail/tmXXXXXXM:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/etc/utmp/etc/passwdrr/Unknown error: #/bin/shsh-c/bin/shsh-cNNh>/etc/ttys/dev/4X@iCk@B- (knqtwz}<dhfȪ   ^Юn PPՀPpPP Pl0^K#"φ߭ÏNW'׬1ЬPPP-1мP`PPa,qa<qmBqgqqHqqqqqN2U[E&?&'5&/&)&%ϻ&Ϲ&& ϱ&ϯ&ּмP`1r׬Ϛ&x&|&|&|&Ϭ&l&#ϲx&ϲϷݭ P7"լ ֬ϳԭ)ЬP`P[мk2PPP֭ѭ rkPP~f YYX1н[d%%iѬ kk Y"kϷ%ϽY PP~Yj φ%τ% ϲ%) YZZj"Z[ѭY1lLЬZ;% 2~ϖ %ݪϨPςϻ $1ϮϬPϧ` ϙ~2~{2~Fz 2[$2[$[ϟP $![ H bc~ЪPPPP~!  ݪ Z~PYѪ i$Y~Y~ Y~2PPjZ^ѬoPP+ Rԭԭԭ@ѭѭ:֭0խЬPЭQA`֭ѭ PP0P((σPP ѭЬPЭQA`֭Ь1jPxPPЬp#p[݋ [  Ь[ЋZҋPPE#P[ZPk``P ϵk6;[ЬZj/ЬZYYk;P υݬBPϩ ݬq_"ϒB;1 P |5*;p" ;.;Ǒ;.;;ݬZP%PZ:[[K:Kj[ ^:1$P[zx7lϴ:ϲI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P0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, @i3Dk> @2i((1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~=PYjt~P  BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[71xݏ PZZ  YYX ZYYXZYZ~lPY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP [ [[[6 Ь[Z = 8[ePZ~PZ ݫ_ ԫ kZP{P[P[P[P/[PZ[ZZPXYX/P[Y[ZuPX\YPXO![[ݬP1yk  k~!P[tJ[ Ь[Zk[ZZP Ь[ЬZkPkPzQQP^ݬPP߭ݬP6.&@80( 91)! ;3+# =5-% ?7/'(08@ '/7?&.6>%- 5=$, 4<#+ 3;"* 2:!) 1991)! :2*" ;3+# <4,$?7/'>6.&=5-%      )4%/7(3-!0,1'8"5.*2$                                                                                                                                     M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/bin/shPATH:/bin:/usr/binsh/dev/ttyr%s /etc/passwdrrUnknown error: #(=(=8/etc/ttys/dev/J@i:Ek x XhfȪ   ^Юn PPՀPpPP PЬ[׬[լkP ψ[׬լoѬ ЬPϦ@k֬Ѭ*@P@kPA^5ݬϝP%<ϽPʏPP@ݬ%PϔݬhPJ<ψPʏPP@5/ݬPPЬ֭ݭݬqhݬݬ7P ݬ;Pݬ \~ݬЬP PP P [P@X[ݬQPZZݬjPY[$P[C,2 8B\n"1APau!Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too largeT\~ݬKPP Ь[ZZZP^BЬ2߭ \~ݬ׭ ЭP֭` ߭rЬP  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~%PYj0~P s k  BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[1xݏPZZ  YYX ZYYXZYZ~TPY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[ Ь[Z = 8[ePZ~uPZ ݫG ԫ kZP{ Ь[Zk[ZZP Ь[ЬZkPkPzQQPP^߭ݬ4PPPPݬݏ tݬݬݏtݬ6.!!~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [!PtYPƏPxP[bPZxH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errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large\~ݬ(PP Ь[ZZZPЬ[ЬZЬ YY kPYP kPzQQPЬ[ЬZ[XY YY  YXP0@0  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~qPYjx~P // BЫZ֫ZPѫPѬ ZPPXPZ~ PYZkn 1mЫZ3[PO1xݏ?PZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~4PY PP[ [[[: Ь[Z = 8[ePZ~YPZ ݫ ԫ kZP{ Ь[ЬZkPkPzQQPPpP^߭ݬDPPP@0ݬݏ tݬݬݏtݬ6< PЬPЬRRQ{RPRPPPRRP4.r4r44444~*PY4[4k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZn4 [rP`4YPƏPxPG4bPZx44PZPPZx$4~@PZZZ43PZP3x3PZPPjj3r31xYP[P3Z333k33k[P Ь[[ZZZ}3jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP2@j~\S^\_PxCЬcPЬPЬRRQ{RPPR PRPPP5*P@(#)ld.c 4.4 4/26/81SDHXNNNNNNN%s: -o where?-u or -c: arg missing-H: arg missing-H: too late, some text already loaded-A: arg missing-A: only one base file allowed-D: arg missing-D: too small-T: arg missing-T: too late, some text already loadedld: -i ignored -y: symbol name missingran out of memory (-y)-xbad flagbadly formed hex numberl.out%s: %s warning: archive has no table of contents; add one using ranlib(1)ran out of memory (toc)ran out of memory (tocstr)mangled archive table of contentswarning: table of contents for archive is out of date; rerun ranlib(1)too many files loaded from librariesran out of memory (nextlibp) %s no namelisttoo small (old format .o?)no space for string tablebad string table index (pass 1)_end_etext_edata_endUndefined: %s %s: user attempt to redfine loader-defined symbolentry point not in textran out of memory (outb)libseg botchout of space reading string table (pass 2)bad string table index (pass 2)internal error: symbol not foundlocal symbol overflowout of memory (clocseg)%s: multiply defined%s(%s): definition of common %s size %d definition ofreference to external %s %s out of memory (load2td)load2td botch: bad lengthlocal symbol botchrelocation format botch (symbol type))byte displacement overflowword displacement overflowa.outl.outa.outcannot move l.out to a.outa.outpremature EOFloader error; odd offsetbotch: no pagespremature EOF/usr/local/lib/libxxxxxxxxxxxxxxx-la/usr/lib/libxxxxxxxxxxxxxxxcannot openpremature EOF! __.SYMDEFran out of space for symbol tablehash table botchsymbol table overflowsymfree botchenter botchsymx botchld:%s(%s): %s old archivebad magic numbertext/data size oddbad formatran out of memory (savestr)output write erroroutput write errorl.outundefinedabsolutetextdatabsscommon#  AAAAAABBBBBB nnPr@iZGkҸBc "%  ((^Юn PPՀPpPP P<^ԭѬ>υS|ЬPPP-1ЬPРPl9[K~Kw5>[ +0 [!tЬPРPP@(ЬP~ϼP[[[ KЬPݠ2ЬP[KݭKiP [ݭϫ@׬[ѬЭPмP`01`9[P/PZPyPYP@zZϚK׬Ь[ZYk94 ZPQPQ0QZY[[kPP P P+P-k0YZPZP%P$4@Rbt->M\tError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too largex\~ݬoPP  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj~P   BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[X1xݏPZZ  YYX ZYYXZYZ~(PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PPH[ [[[r Ь[Z = 8[ePZ~YPZ ݫ ԫ kZP{ Ь[ЬZkPkPzQQPP^߭ݬ$PPPݬݏ tݬݬݏtݬ6.vnhkY\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PZ[xYPZPP[xYPZP[PPQ@j ~\S^\_ P CЬo PЬPЬRRQ{RPPR PRPPPPHcommand garbled: %s Too much text: %s Label too long: %s No addresses allowed: %s Only one address allowed: %s  @rCannot open pattern-file: %s Unknown flag: %c Too many {'sFirst RE may not be null Too much text: %s Unrecognized command: %s Too many commands: %s Too many }'s Duplicate labels: %s Too many labels: %s Too many labels: %s Too many files in w commands wcannot open %s Too many files in w commands wCannot create %s Too many commands, last: %s RE too long: %s Too many line numbers Undefined label: %s t?x?|?????????????????????????????Can't open %s RE botch, %o output line too long. Output line too long. Output line too long. Too many appends after line %ld %ld %s %s %s %s Too many reads after line%ld %s r\01\02\03\04\05\06\07<->- \13\14\15\16\17\20\21\22\23\24\25\26\27\30\31\32\33\34\35\36\370A@iKkv  |F<fhfȪ  ((^Юn PPՀPpPP P ZѬ%ЬPРP`-ЬPРPn Z׬[8K_P[PϱϯPϪ ` ϝ n[[ZφτP ` r CDЬ[ЬZ!jЪP֪X``P ZXPYXYP^Ь[    PPYYX1XX߭~PYj~P  BЫZ֫ZPѫPѬ ZPPXPZ~qPYZkn 1mЫZ3[<1xݏPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[ Ь[Z = 8[ePZ~9PZ ݫ ԫ kZP{P^߭ݬ$PPPݬݏ tݬݬݏtݬ6 .| x ~*PY [ k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ^  [xPP YPƏPxP7 bPZx$ PZPPZx ~@PZZZ  PZP x PZPPjj x 1xYP[P Z  k  k[P Ь[[ZZZm jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP @j~\S^\_PCЬoPЬPЬRRQ{RPPR PRPPP1 P@(#)echo.c 4.1 (Berkeley) 10/1/80t t l @iLk=$" S2iz 6i /* vmproc.c 4.5 81/03/08 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/mtpr.h" #include "../h/pte.h" #include "../h/map.h" #include "../h/cmap.h" #include "../h/text.h" #include "../h/vm.h" /* * Get virtual memory resources for a new process. * Called after page tables are allocated, but before they * are initialized, we initialize the memory management registers, * and then expand the page tables for the data and stack segments * creating zero fill pte's there. Text pte's are set up elsewhere. * * SHOULD FREE EXTRA PAGE TABLE PAGES HERE OR SOMEWHERE. */ vgetvm(ts, ds, ss) size_t ts, ds, ss; { mtpr(P0LR, ts); u.u_pcb.pcb_p0lr = ts | AST_NONE; mtpr(P1LR, P1TOP - UPAGES); u.u_pcb.pcb_p1lr = P1TOP - UPAGES; u.u_procp->p_tsize = ts; u.u_tsize = ts; expand((int)ss, P1BR); expand((int)ds, P0BR); } /* * Release the virtual memory resources (memory * pages, and swap area) associated with the current process. * Caller must not be swappable. Used at exit or execl. */ vrelvm() { register struct proc *p = u.u_procp; register int n; /* * Release memory; text first, then data and stack pages. */ xfree(); p->p_rssize -= vmemfree(dptopte(p, 0), p->p_dsize); p->p_rssize -= vmemfree(sptopte(p, p->p_ssize - 1), p->p_ssize); if (p->p_rssize != 0) panic("vrelvm rss"); /* * Wait for all page outs to complete, then * release swap space. */ p->p_swrss = 0; while (p->p_poip) sleep((caddr_t)&p->p_poip, PSWP+1); (void) vsexpand((size_t)0, &u.u_dmap, 1); (void) vsexpand((size_t)0, &u.u_smap, 1); p->p_tsize = 0; p->p_dsize = 0; p->p_ssize = 0; u.u_tsize = 0; u.u_dsize = 0; u.u_ssize = 0; /* * Consistency check that there are no mapped pages left. */ for (n = 0; n < NOFILE; n++) if (u.u_vrpages[n]) panic("vrelvm vrpages"); } /* * Pass virtual memory resources from p to q. * P's u. area is up, q's is uq. Used internally * when starting/ending a vfork(). */ vpassvm(p, q, up, uq, umap) register struct proc *p, *q; register struct user *up, *uq; struct pte *umap; { /* * Pass fields related to vm sizes. */ uq->u_tsize = q->p_tsize = p->p_tsize; up->u_tsize = p->p_tsize = 0; uq->u_dsize = q->p_dsize = p->p_dsize; up->u_dsize = p->p_dsize = 0; uq->u_ssize = q->p_ssize = p->p_ssize; up->u_ssize = p->p_ssize = 0; /* * Pass proc table paging statistics. */ q->p_swrss = p->p_swrss; p->p_swrss = 0; q->p_rssize = p->p_rssize; p->p_rssize = 0; q->p_poip = p->p_poip; p->p_poip = 0; /* * Relink text segment. */ q->p_textp = p->p_textp; xrepl(p, q); p->p_textp = 0; /* * Pass swap space maps. */ uq->u_dmap = up->u_dmap; up->u_dmap = zdmap; uq->u_smap = up->u_smap; up->u_smap = zdmap; /* * Pass u. paging statistics. */ uq->u_outime = up->u_outime; up->u_outime = 0; uq->u_vm = up->u_vm; up->u_vm = zvms; uq->u_cvm = up->u_cvm; up->u_cvm = zvms; /* * And finally, pass the page tables themselves. * On return we are running on the other set of * page tables, but still with the same u. area. */ vpasspt(p, q, up, uq, umap); } /* * Change the size of the data+stack regions of the process. * If the size is shrinking, it's easy-- just release virtual memory. * If it's growing, initalize new page table entries as * 'zero fill on demand' pages. */ expand(change, region) { register struct proc *p; register struct pte *base, *p0, *p1; struct pte proto; int a0, a1; p = u.u_procp; if (change == 0) return; if (change % CLSIZE) panic("expand"); #ifdef PGINPROF vmsizmon(); #endif /* * Update the sizes to reflect the change. Note that we may * swap as a result of a ptexpand, but this will work, because * the routines which swap out will get the current text and data * sizes from the arguments they are passed, and when the process * resumes the lengths in the proc structure are used to * build the new page tables. */ if (region == P0BR) { p->p_dsize += change; u.u_dsize += change; } else { p->p_ssize += change; u.u_ssize += change; } /* * Compute the end of the text+data regions and the beginning * of the stack region in the page tables, * and expand the page tables if necessary. */ p0 = (struct pte *)mfpr(P0BR) + mfpr(P0LR); p1 = (struct pte *)mfpr(P1BR) + mfpr(P1LR); if (change > p1 - p0) ptexpand(clrnd(ctopt(change - (p1 - p0)))); /* PTEXPAND SHOULD GIVE BACK EXCESS PAGE TABLE PAGES */ /* * Compute the base of the allocated/freed region. */ if (region == P0BR) { base = (struct pte *)mfpr(P0BR); base += (a0 = mfpr(P0LR)) + (change > 0 ? 0 : change); } else { base = (struct pte *)mfpr(P1BR); base += (a1 = mfpr(P1LR)) - (change > 0 ? change : 0); } /* * If we shrunk, give back the virtual memory. */ if (change < 0) p->p_rssize -= vmemfree(base, -change); /* * Update the processor length registers and copies in the pcb. */ if (region == P0BR) { mtpr(P0LR, a0 + change); u.u_pcb.pcb_p0lr = a0 + change | (u.u_pcb.pcb_p0lr & AST_CLR); } else { mtpr(P1LR, a1 - change); u.u_pcb.pcb_p1lr = a1 - change; } /* * If shrinking, clear pte's, otherwise * initialize zero fill on demand pte's. */ *(int *)&proto = PG_UW; if (change < 0) change = -change; else { proto.pg_fod = 1; ((struct fpte *)&proto)->pg_fileno = PG_FZERO; cnt.v_nzfod += change; } while (--change >= 0) *base++ = proto; /* * We changed mapping for the current process, * so must flush the translation buffer. */ mtpr(TBIA,0); } /* * Create a duplicate copy of the current process * in process slot p, which has been partially initialized * by newproc(). * * Could deadlock here if two large proc's get page tables * and then each gets part of his UPAGES if they then have * consumed all the available memory. This can only happen when * USRPTSIZE + UPAGES * NPROC > maxmem * which is impossible except on systems with tiny real memories, * when large procs stupidly fork() instead of vfork(). */ procdup(p, isvfork) register struct proc *p; { register int n; /* * Allocate page tab((les for new process, waiting * for memory to be free. */ while (vgetpt(p, vmemall) == 0) { kmapwnt++; sleep((caddr_t)kernelmap, PSWP+4); } /* * Snapshot the current u. area pcb and get a u. * for the new process, a copy of our u. */ resume(pcbb(u.u_procp)); (void) vgetu(p, vmemall, Forkmap, &forkutl, &u); /* * Arrange for a non-local goto when the new process * is started, to resume here, returning nonzero from setjmp. */ forkutl.u_pcb.pcb_sswap = u.u_ssav; if (setjmp(forkutl.u_ssav)) /* * Return 1 in child. */ return (1); /* * If the new process is being created in vfork(), then * exchange vm resources with it. We want to end up with * just a u. area and an empty p0 region, so initialize the * prototypes in the other area before the exchange. */ if (isvfork) { forkutl.u_pcb.pcb_p0lr = u.u_pcb.pcb_p0lr & AST_CLR; forkutl.u_pcb.pcb_p1lr = P1TOP - UPAGES; vpassvm(u.u_procp, p, &u, &forkutl, Forkmap); /* * Add extra mapping references to files which * have been vread() so that they can't be closed * during the vork(). */ for (n = 0; n < NOFILE; n++) if (forkutl.u_vrpages[n] != 0) forkutl.u_vrpages[n]++; /* * Return 0 in parent. */ return (0); } /* * A real fork; clear vm statistics of new process * and link into the new text segment. * Equivalent things happen during vfork() in vpassvm(). */ forkutl.u_vm = zvms; forkutl.u_cvm = zvms; forkutl.u_dmap = u.u_cdmap; forkutl.u_smap = u.u_csmap; forkutl.u_outime = 0; /* * Attach to the text segment. */ if (p->p_textp) { p->p_textp->x_count++; xlink(p); } /* * Duplicate data and stack space of current process * in the new process. */ vmdup(p, dptopte(p, 0), dptov(p, 0), p->p_dsize, CDATA); vmdup(p, sptopte(p, p->p_ssize - 1), sptov(p, p->p_ssize - 1), p->p_ssize, CSTACK); /* * Return 0 in parent. */ return (0); } vmdup(p, pte, v, count, type) struct proc *p; register struct pte *pte; register unsigned v; register size_t count; int type; { register struct pte *opte = vtopte(u.u_procp, v); register int i; while (count != 0) { count -= CLSIZE; if (opte->pg_fod) { v += CLSIZE; for (i = 0; i < CLSIZE; i++) *(int *)pte++ = *(int *)opte++; continue; } opte += CLSIZE; (void) vmemall(pte, CLSIZE, p, type); p->p_rssize += CLSIZE; for (i = 0; i < CLSIZE; i++) { copyseg((caddr_t)ctob(v+i), (pte+i)->pg_pfnum); *(int *)(pte+i) |= (PG_V|PG_M) + PG_UW; } v += CLSIZE; munlock(pte->pg_pfnum); pte += CLSIZE; } } /* * Check that a process will not be too large. */ chksize(ts, ds, ss) size_t ts, ds, ss; { if (ts>MAXTSIZ || ds>MAXDSIZ || ss>MAXSSIZ) { u.u_error = ENOMEM; return(1); } return (0); } @iMkBYy   '^Юn PPՀPpPP P ^[ԭѬ[0KP[ϨϱKϱP[ϋ[ωυύPKPPϭϤϠ/ϕLPZ5υPLPP@P>?RZjZP*PP=.P*ݭ "[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\S^\wP[ЬPЬPЬRRQ{RPPR PRPPլQPyP((@(#)diff.c 4.1 10/9/80/bin/diff/usr/lib/diffh/usr/bin/prFILE1FILE2diff: -c: bad count diff: use -Sstart diff: -%s: unknown option diff: two filename arguments required diff: -h doesn't support -e, -f, -c, or -I -diff: -diff: diff: ran out of memory diff: files too big, try -h @CfCiClCdiff: can't specify -I with directories diff: warning: shouldn't give -s or -l with -e diff - : %.*s : %.*s Only in %.*sOnly in %.*sCommon identical filesBinary files which differCommon subdirectories diff: ran out of memory : Only in %.*s %.*s diff: diff: ran out of memory diff: Common subdirectories: %s and %s Files %s and %s are identical Binary files %s and %s differ ed - %.*s << '-*-END-*-' %s%s %s w q -*-END-*- %s %sNo more processesdiff: No more processes @(#)diffdir.c 4.5 (Berkeley) 81/02/28pr-h-f@(#)diffreg.c 4.1 10/9/80diffhdiff: --diff: can't specify - - -No differences encountered /tmp/dXXXXXdiff: diff: -diff: can't specify - with other arg directory %s/%srdiff: rrrr*** %s %s--- %s %s*************** *** , ! - --- , ----- ! + ,, < --- > . #endif %s %d%s%d#else %s%s !#ifndef %s #ifdef %s #ifdef %s #endif %s M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/Unknown error: #  AAAAAABBBBBB TTtGY@iOkR (fh   0^Юn PPՀPpPP P|x^RPl.Ϯ(<ЬPРP`-<ЬPРPPPiϊ(Ϭ4"K$׬ѬϪhPݏ(#ݭ`ݭϋ +( ϩ ϩ ( ϣ Ϭ!Ϫ!Pϥ! ``P ϕ! ϒѬuϱPT~B{Bw x~vPg x~cP{' xq'x7ϪPxςЭP@ ֭ѭ|^߭ݬjP1|   ( 4 F V h t ! 2 A P h u Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open files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^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPm@j~\S^\_PCЬPЬPЬRRQ{RPPR PRPPPP!CCusage: df [ -il ] [ filsys... ] /etc/mtabFilesystem Mounted on kbytes used free hardway %% used iused ifree %%iused/etc/fstabrwro/etc/mtab/dev/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%s: mounted on unknown device cannot open %s %-12.12s%s %6ld %6ld %6ld %6ld %5.0f%% %5ld %5ld %5.0f%% bad free count, b=%D bad free block (%D) read error bno = %ld count = %d; errno = %d //dev//dev/@(#)df.c 4.6 (Berkeley) 7/8/81/etc/fstabrUnknown error: #  AAAAAABBBBBB 00#05@iPkD>f (  <IyheȪ  P^Юn PPՀPpPP P ^}Z1YJϐ!ϼEPݏbPϛ10ϡ%PݏBP1φPݏ"PK!1kPݏP'!1OP !1<ϮP 1)ϗPݏϴPϹ 1wPݏϔPϝ cXPݏuPς D9PݏVPϋ%P_T 'lZZ1ѭ  Ϻ 1 r1]`ϮPOϛPIώP@ρP1lPϢ"WPBPg.PS1kP>1VP)1AP11)ϐ PRP&ݏQ PPϓϋϢѭωϽϻdI`ϥϝ`PwW ύLPgݏ@<T M% N:::"SϞ P"χώ $[ p ϼϸ1 ϯPPϠ0ωϿϠ[{[ϖϬόϸPώϊ>irE fZNPJ`ZSZZXAC ύϞ,53 %[xPPZZkZ[ϱ'PP1ZPPZZZZϦ@ϠϩϧϥύyϥϼP[[x]ad<[ЬP֬`[[#PP^ [ԭk9S PQPQ0Qk0"PЬQA`PP[[s[  Ϟ[MPPϽ zϼ[Ϡ[[ ϽϷ DϪ[yuPPc  bςЬ[[a [z [[A [Z [K(PPPP[[Ѭ 0[Ϛ~ϏϾЬ[[a [z [e[A [Z [KώPPPP[k[(Ѭ 0cTnVRC[m~73$*Ь[[a [z [[A [Z [[[[ϗѬ -ϲ[o gϩϥϖϜ ϔότχ/wτnhπݬ \~ݬKЬP PP\ p[)xP@X[ݬAPZZݬ<[P[   , < T ^ x  , > M ] l }   * = Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large@)  Ь[ZZZP0    !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1,(( 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYjT ~P   BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[ 1xݏPZZ  YYX ZYYXZYZ~(PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[  Ь[Z = 8[ePZ~9PZ ݫ ԫ kZP{(P^߭ݬDPPPݬݏ tݬݬݏtݬ6.<*z8*rlo]`~*PYI[Nk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ  [8*PYPƏPxPbPZxPZPPZx~@PZZZPZPxPZPPjjs8*g1xYP[PTZMEHk92k[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPy@j~\S^\_PCЬPЬPЬRRQ{RPPR PRPPPPP     [.<(+!&]$*);^-/|,%_>?`:#@'="abcdefghijklmnopqr~stuvwxyz{ABCDEFGHI}JKLMNOPQR\STUVWXYZ01234567897-./% <=2&?'@O{[lP}M]\Nk`Kaz^L~no|JZ_myjС !"#$()*+, 01345689:;>ABCDEFGHIQRSTUVWXYbcdefghipqrstuvwx7-./% <=2&?'@Z{[lP}M]\Nk`Kaz^L~no|_myOС !"#$()*+, 01345689:;>ABCDEFGHIQRSTUVWXYbcdefghipqrstuvwxibs=obs=cbs=bs=if=of=skip=seek=count=files=conv=,ebcdicibmasciiblockunblocklcaseucaseswabnoerrorsyncbad arg: %s cannot open: %s cannot create: %s counts: cannot be zero not enough memory readwritedd: argument %D out of range %u+%u records in %u+%u records out %u truncated records @(#)dd.c 4.1 (Berkeley) 10/1/80Unknown error: #8&8&!P*@iQkJ3G !$'*-036?<|wheȪ  ^Юn PPՀPpPP P^"ԭ߭ρѬ'ЬPРP`-ЬPРPu ׬Ѭ1ЬPРϯ.PϺϝvϞ#2P?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXX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oryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too largeЬ[  P ݏ P ի ߘP@ [B /  P2PPݫ~ PkЫk!k    k1WP֫ Ь[ZZZP  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj ~P sk BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[1xݏPZZ  YYX ZYYXZYZ~HPY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[ Ь[Z = 8[ePZ~9PZ ݫ; ԫ kZP{HP8P^߭ݬTPPPPݬݏ tݬݬݏtݬ6 .&|& ~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [|&PYPƏPxP{bPZxhPZPPZxX~@PZZZ5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YYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPY @j~\S^\yPpЬ[PЬPЬRRQ{RPPR PRPPЭRBQP PbPbլQPq P@(#)cc.c 4.1 10/1/80-o would overwrite %scc: warning: -P option obsolete; you should use -E instead -t overwrites earlier option012p-B overwrites earlier option/usr/c/occ: warning: -g disables -O 012p/usr/newccomc2cpp/lib/mcrt0.o/tmp/ctm%05.5d12345%s: cpp-ccom-XP-Xg-wc2as-o-Rld-X-o-lg-lccc: No more processes Can't find %s Fatal error in %s ran out of memory (savestr) /lib/cpp/lib/ccom/lib/c2/bin/as/bin/ld/lib/crt0.o##4'((@iXkqd Y\_behkn<-oheȪ  0 ^Юn PPՀPpPP P ,^ԭϧσGϺ1Pe15Pn1Ps1Pt1Pu1Pv1߭Ԙ~:P[1TݼA1мPP?[χ1 ([_[1[2|PwZ`kЫP֫`PPZPWQZv O JmP Ь[k ЫP֫`P[PZZZ 1X:@9% 5+P&P~OϹϷPϲ$` ϥ$ ϚϘPϓ ` φ ϫ 1LϴPϻPϯϛjϑZ >_<P7Z`\ZϨZZZ @Z~ύ-Z ϹyZ 1ݬ \~ݬЬP PPЬ[XXPX 鑫+PPPYkw+ݏݬPZY1ZZ kalYPPPݬ PZ?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR d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 @@vvvb vc vB vC v v v" @ @v# @ @ @v v vvvs vS v v v(vw w w w w !w&w+w((.space.fill.byte.word.long.int.quad.data.globl.set.text.comm.lcomm.lsym.align.float.double.org.stab.stabs.stabn.stabd.ascii.asciz.file.line.ABORTr0r1r2r3r4r5r6r7r8r9r10r11r12r13r14r15apfpsppcjccjcsjeqljeqlujgeqjgequjgtrjgtrujleqjlequjlssjlssujneqjnequjvcjvsjbrjbcjbsjbccjbscjbcsjbssjlbcjlbsacbbacbdacbfacblacbwadawiaddb2addb3addd2addd3addf2addf3addl2addl3addp4addp6addw2addw3adwcaobleqaoblssashlashpashqbbcbbccbbccibbcsbbsbbscbbssbbssibccbcsbeqlbeqlubgeqbgequbgtrbgtrubicb2bicb3bicl2bicl3bicpswbicw2bicw3bisb2bisb3bisl2bisl3bispswbisw2bisw3bitbbitlbitwblbsblbcbleqblequblssblssubneqbnequbptbrbbrwbsbbbsbwbvcbvscallgcallscasebcaselcasewchmechmkchmschmuclrbclrdclrfclrlclrqclrwcmpbcmpc3cmpc5cmpdcmpfcmplcmpp3cmpp4cmpvcmpwcmpzvcrccvtbdcvtbfcvtblcvtbwcvtdbcvtdfcvtdlcvtdwcvtfbcvtfdcvtflcvtfwcvtlbcvtldcvtlfcvtlpcvtlwcvtplcvttpcvtptcvtpscvtrdlcvtrflcvtspcvtwbcvtwdcvtwfcvtwldecbdecldecwdivb2divb3divd2divd3divf2divf3divl2divl3divpdivw2divw3editpcedivemoddemodfemulextvextzvffcffshaltincbinclincwindexinsqueinsvjmpjsbldpctxloccmatchcmcombmcomlmcomwmfprmnegbmnegdmnegfmneglmnegwmovabmovadmovafmovalmovaqmovawmovbmovc3movc5movdmovfmovlmovpmovpslmovqmovtcmovtucmovwmovzblmovzbwmovzwlmtprmulb2mulb3muld2muld3mulf2mulf3mull2mull3mulpmulw2mulw3noppolydpolyfpoprproberprobewpushabpushadpushafpushalpushaqpushawpushlpushrreiremqueretrotlrsbsbwcscancskpcsobgeqsobgtrspancsubb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* H 2Unexpected end of file writing the interpass tmp fileToo many expressions; try simplyfingToo many expressions; try simplyfingToo many expressions; try simplyfingUnexpected end of file writing the interpass tmp fileUnexpected end of file while reading the interpass tmp fileInternal error: bad skip constructionNew line embedded in a string constant.Illegal character mapped: %d, char read:(octal) %o@(#)asparse.c 4.7 8/20/80Local labels are 0-9L%d%dName expected for a labelNAME expected"%s" is not followed by a ':' for a label definition%s redefined%s redefined: PHASE ERROR, 1st: %d, 2nd: %dUnrecognized instruction or directiveSTRING expectedNAME expectedCM expectedIllegal set?NAME expectedCM expectedIllegal lsymNAME expectedillegal location counterCOLON expectedWidth not absoluteExpression crosses field boundaryIllegal relocation in fieldSpace size not absoluteFill repetition count not absoluteCM expectedFill size not absoluteFill count not in in 1..8CM expectedFill value not absoluteIllegal expression to set originBackwards 'org'.stab directive not supported in; report this compiler bug to system administratorInvalid type in %sCM expectedCM expectedCM expected.stabdInvalid type in .stabdCM expectedCM expected.stabn.stabsSTRING expectedCM expectedNAME expectedCM expectedcomm size not absoluteRedefinition of %sexpression expectedLP expectedregister expectedRP expectedregister expectedexpressi((on, '(' or '$' expectedregister expectedRP expectedregister expectedRP expectedregister expectedRB expectedCM expectedMore than 6 argumentsfloating number expectedIllegal registerAssembler: "%s", line %d: Assembler: "%s", line %d: WARNING: @(#)asexpr.c 4.2 8/15/80Divide checkDivide check (modulo)Internal error: unknown operatorRelocation errorright parenthesis expectedBad expression syntaxReference to undefined local label %dbL%d%d@(#)asmain.c 4.8 8/20/80Caution: absolute origins. Unknown flag: %c-d[124] only-o what???-t what???/asXXXXXXwBad pass 1 temporary file for writing %srCan't open source file %s Reference to undefined local label %dfwCannot create %srBad pass 2 temporary file for reading %sReposition for header rewrite failsRewrite of header failsAssembler panic: bad internal data structure.a.out/tmp/@(#)assyms.c 4.6 11/5/80Ran out of MemoryINTERNAL ERROR: overfilled symbol table indirection tableINTERNAL ERROR: installed %d syms, should have installed %dPadding errorUndefined referenceIllegal Relocation of float, double or quad.INTERNAL ERROR: Wrote %d symbols, wanted to write %d symbols @(#)asjxxx.c 4.5 8/20/80jxxx destination not a labelIllegal `align' argument.align %d in any segment is NOT preserved by the loader.align %d converted to .align 2Intersegment jxxx@(#)ascode.c 4.7 11/5/80 @Too few argumentsToo many argumentsarg %d, branch displacement must be an expressionarg %d, addressing a registerarg %d, addressing an immediate operandarg %d, modifying a constantarg %d, PC used as indexarg %d, indexing the register filearg %d, indexing a constantarg %d, indexing with modified registerBranch too farBranch too far@(#)asio.c 4.3 8/16/80Output write errorOutput write error/@i'ZkT<?NHKTQc]<W`@i@i@i " + Џ^"PԀP^(|"nl" o# ^#.[[ #" ~""i"PP P[ "$^Ь[ЬZ ߭Z7PYY  ѭ "Jݭ"ݭZP1Э֭ӏݭH"BݭݭZPOݭ""Y֭YYݭ! ! Ь[ԫ`PPPPXPd2lp[h[p[ZPPQxQQQPQxQPPZj Ъ Z~[~ ^Ь[kjm!BX[k/[ZjZj/jjݬ[gP8ݬP0jZ[[!Pݬ<~kЭP^Ь[Ь[Yլ 1eѬ ЬZJЭPԭ xѬ ­׭խխ ݬ 1jí P@ݬ 1Q֭ѭЭP@9CxPXPdx P@)h2l[x P@)ЭPЭ@y9x P@m)έPxPPPZJ1|ݬ 1 ^Ь[լ1[Y<PʏPP@ 10 12ԭd֭ѭ@>ЭP֭P[pPPXPdp[h2l[-p[ZԭZ~ݬPP""PPAPgP11xPDP`MPxPDP`P֭v#jDkD\DH?D@D1Dԭ!DDԭЭԭѭ1Oԭ8xPCP`P!xPCP`P֭ѭ! 7Qխ Џ[[^Ь[ЫTZxZPxPPpCP`PZQxQQQPxT~J1>ЭPˏXW2GPPXWGxcWJJP P@_YիXѫX ЫXP@ #ЫXP2@P2QQPPX^Ь[ЫTЫdxPxPPBP`PQxQQQPcPЭQA`P P@ЭPӏ@ ЭP2$ЭPЭQ2PPQЭP2PPQRPRRQЭPЭQ2aQQPЭQ2aQQPRQRRPЭPЭ(xPPЭQPݬ[XЭPӏӏ@@ЭPˏ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έPЭPЬZЬY[ [[ ЬPЬRRQ{RPRPPPRRPЬPЬRRQ{RPPR PRPP,X-`PЬSRbcPRbF  &0^nhpuphkraxx(0,0)vmunix Boot : : %s Bad format %d+%d+%d start 0x%x Short read null path %s not found bn negative bn ovf %D bn void %D bn void %D not a directory zero length directory Seek not from beginning of file No more file slotsBad device Unknown device Bad unit specifier Missing offset specification Can't write files yet.. Sorry Exit called%s Trap %o l%8 d  o%Z r%x u% x%P| >{%t~%D.%8h&hpuphkrahttmtsmt`       @ ` `&vd62M2R%s1 JTJ2" 7 & `7&/%/,&%2 @v<&unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSO@i2ZkW#<?NHKTQc]<W`@i@i@iPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry Anot a tape mt hard error: er=%b mt error: er=%b mt: unrecovered error mt: recovered by retry rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry Pte error: er=%bILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOTts: unrecovered error ts: recovered by retry DR2 `7`+ @7p+up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPEh >Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error 0123456789abcdef " $")"0,6L> BFL P TX\`g.mt{    d |  t h x ! %)t. 26: >CXGKOSX\`f jnt x|  !!t"@"H"p" X-~Ln"A  -# O "A$!  -$  =, 0=1":#@h#GOyH!U\[HekJF r@"y "i$B!  t!& ; 6  ' G8 d mZ " x* 6>GPJZ| R>[ gjtoxmD,. 8h & <N 0N N <N%%F%%% @%%%*!0!6o%?%H &Q &Z,&d <&mL&v\&|2t?d'd{P(4((fpmtd)R(* O KpS,,* xS+ +@+$0`+,p+4+:,B RSJ\,R XW PXbl,kprw N H"p"!relsrt0.oHIGHstartaedataclraendabeginbeginsboot.oL20L38sys.oL18L25L42L63L77_openi_find_dlook_sbmap_matchL86L94L108L125L138L182L190L195L206conf.oL17L22L27L32L37autoconf.oL26hp.oL30L46ht.oL23L43L47L68mba.oL22L31mt.oL23L43L47rk.oL24L33L53tm.oL23L31L35L62ts.oL31L27L46L50up.oL28L40uba.oL22L33uda.oL29L51L62prf.oL13L18L67L79L91L99machdep.oL13L18L23atol.ol3tol.o_exit.ourem.oudiv.o_end_edata_main__rtt_configure_cpu_openfirstentry_badloc_devsw_b_blknos_iob_devname_line_retry_printf_gets_open_copyunix_read__stop__exit_devread_l3tol_lseek_getc_getchar_write_putchar_devwrite_atol_devopen_close_devclose_exit_trap_nullsys_hpstrategy_hpopen_upstrategy_upopen_rkstrategy_rkopen_udstrategy_udopen_htstrategy_htopen_htclose_tmstrategy_tmopen_tmclose_tsstrategy_tsopen_tsclose_mtstrategy_mtopen_mtclose_mbaddr_mbaact_umaddr_ubaddr_ubaddr780_umaddr780_mbaddr780_ubaddr750_umaddr750_mbaddr750_ubaddr7ZZ_umaddr7ZZ_mfpr_mtpr_hp_type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RQ{RPPR PRPP,X-`PЬSRbcPRbF  &0^nhpuphkraxx(0,0)vmunix Boot : : %s Bad format %d+%d+%d start 0x%x Short read null path %s not found bn negative bn ovf %D bn void %D bn void %D not a directory zero length directory Seek not from beginning of file No more file slotsBad device Unknown device Bad unit specifier Missing offset specification Can't write files yet.. Sorry Exit called%s Trap %o l%8 d  o%Z r%x u% x%P| >{%t~%D.%8h&hpuphkrahttmtsmt`       @ ` `&vd62M2R%s1 JTJ2" 7 & `7&/%/,&%2 @v<&unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRC@iF]kҤ -)x!W @i@i@iINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry Anot a tape mt hard error: er=%b mt error: er=%b mt: unrecovered error mt: recovered by retry rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry Pte error: er=%bILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOTts: unrecovered error ts: recovered by retry DR2 `7`+ @7p+up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPEh >Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error 0123456789abcdef@iI^k>W 2i 8i 8i #define NCT 0 @iK_kL?^sp@iii ((\ Ь[[2PxPPP`Ь[[2PxPPP`Ь[[2PxPPP`Ь[[2PxPPP`hpuphkra8Xx     $ ( ,04 8 < $("26D?CdMQZ^jr~_devsw_b_blknos_iob_devreadL17_devwriteL22_devopenL27_devcloseL32_nullsysL37_hpstrategy_hpopen_upstrategy_upopen_rkstrategy_rkopen_udstrategy_udopen@iM`k)H/D$D u@i0i0i /* boot.c 4.6 81/12/01 */ #include "../h/param.h" #include "../h/ino.h" #include "../h/inode.h" #include "../h/filsys.h" #include "../h/dir.h" #include "../h/vm.h" #include #include "saio.h" #include /* * Boot program... arguments passed in r10 and r11 determine * whether boot stops to ask for system name and which device * boot comes from. */ /* Types in r10 specifying major device */ char devname[][2] = { 'h','p', /* 0 = hp */ 0,0, /* 1 = ht */ 'u','p', /* 2 = up */ 'h','k', /* 3 = hk */ 0,0, /* 4 = sw */ 0,0, /* 5 = tm */ 0,0, /* 6 = ts */ 0,0, /* 7 = mt */ 0,0, /* 8 = tu */ 'r','a', /* 9 = ra */ }; char line[100] = "xx(0,0)vmunix"; int retry = 0; main() { register howto, devtype; /* howto=r11, devtype=r10 */ int io; #ifdef lint howto = 0; devtype = 0; #endif printf("\nBoot\n"); #ifdef JUSTASK howto = RB_ASKNAME|RB_SINGLE; #else if ((howto&RB_ASKNAME)==0) { if (devtype>=0 && devtype= 0) copyunix(howto, io); if (++retry > 2) howto = RB_SINGLE|RB_ASKNAME; } } /*ARGSUSED*/ copyunix(howto, io) register howto, io; { struct exec x; register int i; char *addr; i = read(io, (char *)&x, sizeof x); if (i != sizeof x || x.a_magic != 0410) _stop("Bad format\n"); printf("%d", x.a_text); if (read(io, (char *)0, x.a_text) != x.a_text) goto shread; addr = (char *)x.a_text; while ((int)addr & CLOFSET) *addr++ = 0; printf("+%d", x.a_data); if (read(io, addr, x.a_data) != x.a_data) goto shread; addr += x.a_data; printf("+%d", x.a_bss); x.a_bss += 128*512; /* slop */ for (i = 0; i < x.a_bss; i++) *addr++ = 0; x.a_entry &= 0x7fffffff; printf(" start 0x%x\n", x.a_entry); (*((int (*)()) x.a_entry))(); _exit(); shread: _stop("Short read\n"); } @iQakI?V$L/iii /* conf.c 4.9 81/12/01 */ #include "../h/param.h" #include "../h/inode.h" #include "../h/pte.h" #include "../h/mbareg.h" #include "saio.h" devread(io) register struct iob *io; { return( (*devsw[io->i_ino.i_dev].dv_strategy)(io, READ) ); } devwrite(io) register struct iob *io; { return( (*devsw[io->i_ino.i_dev].dv_strategy)(io, WRITE) ); } devopen(io) register struct iob *io; { (*devsw[io->i_ino.i_dev].dv_open)(io); } devclose(io) register struct iob *io; { (*devsw[io->i_ino.i_dev].dv_close)(io); } nullsys() { ; } int nullsys(); int hpstrategy(), hpopen(); int upstrategy(), upopen(); int rkstrategy(), rkopen(); int udstrategy(), udopen(); #ifndef BOOT int htstrategy(), htopen(), htclose(); int tmstrategy(), tmopen(), tmclose(); int tsstrategy(), tsopen(), tsclose(); int mtstrategy(), mtopen(), mtclose(); #endif struct devsw devsw[] = { "hp", hpstrategy, hpopen, nullsys, "up", upstrategy, upopen, nullsys, "hk", rkstrategy, rkopen, nullsys, "ra", udstrategy, udopen, nullsys, #ifndef BOOT "ht", htstrategy, htopen, htclose, "tm", tmstrategy, tmopen, tmclose, "ts", tsstrategy, tsopen, tsclose, "mt", mtstrategy, mtopen, mtclose, #endif 0,0,0,0 }; @iTck{  "%(+.147:=2ieses  #((=^[[PPZZYՊZiZZ.(YkYP{ݬ ݬݬLݬݬ7^ݬݬP+ЭPݬݬPP^լPPPլ PIW խPP խPPPݬݬ2~ݭsoP ݬ ЭPԭѬ1 ݬ \~P1k 2P2ՑPPѬ ݬ6PP1/ݭխޭP\PPݬݭJP1d1W ^ЬЬ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` QP PPݬWRP  Fݏ~9;P Ь[ЬZZ[iPPkPP Z[~iPPssPޕ^լ1WЬt1ݬaQPPPP1Ls|fr,1 1~PA2P PPP0P2QPQQЭP֭`~P׭lGﴐ=Ѭ 7~P`_*i#ݬݬ q֭ *ݬݬ ݭ2~wP1+íKPPKЭ;լ  ׬2~P1n 1b^1 ЬAPPZQQQQQPfQQQP4QQQPpQQQPPլ ag_Kݬ RP-Pݬ P`PumЭF2ݬ P.Pݬ hPP﹎ЭP o Э}֭PPP0*Pa oB*PP oF:(}wx4:R(jk3լ 2z~Pc/1s2~n)1s2~nznݬ' N"bnݬu{MݭLn(1pݭ>n둭C ~ ~''Č1<~nt(㚭~nݭmݭm~}>UOP[S ~ ~&.ݬ ,_PPPíPPPЭ1ݭkm1ݭdm1ݭ^m1ݭXm1ݭQm1ݭKm1ݭDm1ݭݬ 6 %1ݭ#m1ݭm1plЭp~m&'[1Эp~l';1 %1&ЭP֭`~j%"䕽1{֭1u2PPP2QQP~]PҊ12~2PP~^תּelOPPVlowl OPJﱎhW年YWKݭllݭWVcL W߭eP2QPQ&Vk )‰Ѭ}kt%(Ѭ @~bkV% ݬ#^oͭePxPP ЭPѬ0 Ѭ9PP ;PPj j jP@ j1وo%̈Ĉ2~*aPPPP QP~` sh歷UjM@j@2jPPP P jPP\i'PiP^Ь[P #ᅦ[PzPݐi"PPPPЬ[1`ЫP`-ЫPIwi׬[ѬЫqѬЫqЬ5vB?+BETPRPBSSP%FSȆ%<﹆p"$ho"z  h%`CSyhݏ'RYfu׬[Ѭ1ݫ&h7 Pݫh# P1l﹅<$2f~ﶅ1g nY1I7z]Ь[ЬZZ[PZPY[YZYYPJV :Ь(&'QݬR2V~R@(#)message.c 4.2 5/15/81 VERSION VM/VAX4.2 DATE 5/15/81 bad modifierbad commandsymbol not foundautomatic variable not foundc routine not foundcannot locate valueno breakpoint setunexpected ')'address expectedno processbad variabletoo many breakpointsbad a68 framebad a68 linkaddress wrap aroundunexpected `='wait error: process disappeared!process terminatedtry againsyntax errornewline expectedbkpt: command too longbad file formatnot enough space for symbolsfilename too longcannot openbad core magic number$<< nesting too deep[Ï&[P PQPA҈ [k ^Ь [愈Ь麗[[ K杻P@YidYZ12PЏ@vp ,`jjPxPPPP#ݬ5VP9P1P@#2PxPPP2PP .:F[Rw1ݽc11fݽc1ݽc1ݽc1*ѭ41$ |ݬaP2PЭ@hoѭ4 BP2QPA@oec2P@)oAѭ41ݽ8c1jPP{:V1ݬPݬPݭ11ݬP1ݬPݬvP@i_ckv "%(+.147:=2ieses((ݭݽbl*iݬ1*Xݬ1*G12P2@?njPP jPP2P@pKb 2~CbgZ2PQPQ1l[[ [11 2PmP~a ݬ2PP2QQP~PTPaOQrP~?2PPHm1m=m8mPPP~^ԭ[&ݬPPK؄[[ЬP@`PPP ЬP@`ЭP^ЬЬ p~`^ЬЬWIޭPЭQέRA`PxRPPP[PPPPP[ 0[~W[~,խ׭խ@(#)optab.c 4.1 5/14/815!5o !5O !5 !5= !5X 6 66` 6a 6@ !6A '6 -6 36  @ @96! @ @ @?6 E6 K6 P6  W6  ^6x c6 @ @h6y m6  q6  v6  |6  6  6  6  6  6 6 6 6 6 6 6 6 666 6 6 6 6 666 6 7 7 7 77 7 #7 (7 -7 27 87 =7 C7 H7 N7R7 V71!Z7 _70!d7 h7 l7@@r7 @x7~7 7 7 7 7 7 77|777|777) @@7- @ @7q 7Q 7 75 @@77 @ @7  7 7  7 @ @7l8L888h 8v  8j &8i ,8H 28V 88J >8I D8 J8n P8N V8 @\8 b86 @h8& @@ @n8$ @@ @t8 @ @z8k 8K 8  @ @83 8m 8M 82 888888f 8g 8F 8G 8 8 8' @ @ @8 8 88 @@@8{ 9t  9T  9z 9 9 9 "9 &9+90959:9  @9@@G9 L9@P9@T9[9: @`99 @ @g9m9 s9 y9 ~99r 9R 9 9 9@9~E9D9B9~C9>A99( @@9, @ @9p 9P 9 94 @@99} 9. @@ @9/ @@ @9 : ::< : :#:):d /:e 5:D ;:E A: G: M:% @ @ @R: X: ^:b:u @h:U @n: s:  @z:  @:@:E:D:B:C:?A: : ::@:: :: :* @@:; @: : :+ @@:::b ;c  ;B ;C ; ; #;" @ @);# @ @ @/; 5; ;;B;G;s L;S Q; V; [;(_;e;k; q; w; }; ;;;;;;;;;;;;;;;;;;;;;;;<<<<<#<)<0<6<<<B<E<J<O<V<[<a<f<k<o<w<|<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<=== ===="='=.=4=;=?=E=J=P=T=Z=_=e=i=n=r=w={=============================>> >>>>>$>)>.>3>8>>>D>J>M>acbbacbdacbfacblacbwadawiaddb2addb3addd2addd3addf2addf3addl2addl3addp4addp6addw2addw3adwcaobleqaoblssashlashpashqbbcbbccbbccibbcsbbsbbscbbssbbssibccbcsbeqlbeqlubgeqbgequbgtrbgtrubicb2bicb3bicl2bicl3bicpswbicw2bicw3bisb2bisb3bisl2bisl3bispswbisw2bisw3bitbbitlbitwblbsblbcbleqblequblssblssubneqbnequbptbrbbrwbsbbbsbwbvcbvscallgcallscasebcaselcasewchmechmkchmschmuclrbclrdclrfclrlclrqclrwcmpbcmpc3cmpc5cmpdcmpfcmplcmpp3cmpp4cmpvcmpwcmpzvcrccvtbdcvtbfcvtblcvtbwcvtdbcvtdfcvtdlcvtdwcvtfbcvtfdcvtflcvtfwcvtlbcvtldcvtlfcvtlpcvtlwcvtplcvttpcvtptcvtpscvtrdlcvtrflcvtspcvtwbcvtwdcvtwfcvtwldecbdecldecwdivb2divb3divd2divd3divf2divf3divl2divl3divpdivw2divw3editpcedivemoddemodfemulextvextzvffcffshaltincbinclincwindexinsqueinsvjmpjsbldpctxloccmatchcmcombmcomlmcomwmfprmnegbmnegdmnegfmneglmnegwmovabmovadmovafmovalmovaqmovawmovbmovc3movc5movdmovfmovlmovpmovpslmovqmovtcmovtucmovwmovzblmovzbwmovzwlmtprmulb2mulb3muld2muld3mulf2mulf3mull2mull3mulpmulw2mulw3noppolydpolyfpoprproberprobewpushabpushadpushafpushalpushaqpushawpushlpushrreiremqueretrotlrsbsbwcscancskpcsobgeqsobgtrspancsubb2subb3subd2subd3subf2subf3subl2subl3subp4subp6subw2subw3svpctxtstbtstdtstftstltstwxfcxorb2xorb3xorl2xorl3xorw2xorw3escdesceescfindirexitforkreadwriteopenclosewaitcreatlinkunlinkexecchdirtimemknodchmodchownbreakstatseekgetpidmountumountsetuidgetuidstimeptracealarmfstatpause30sttygttyaccessnicesleepsynckillcswsetpgrptellduppipetimesprofiltiusetgidgetgidsignal495051525354555657585960616263r0r1r2r3r4r5r6r7r8r9r10r11apfpsppc0.50.56250.6250.68750.750.81250.8750.93751.01.1251.251.3751.51.6251.751.8752.02.252.52.753.03.253.53.754.04.55.05.56.06.57.07.58.09.010.011.012.013.014.015.016.018.020.022.024.026.028.030.032.036.040.044.048.052.056.060.064.072.080.088.096.0104.0112.0120.0%r%RЬ[ЬZjPP^Ь[2P^eZHTHPP 1oU2P@oP  * ֭ﵭ ֭֭ÏGP2QQP ֭Ï~Ho2G~@4oG1  GGÏGPP lGfG+ÏTG~n2?G~/@n4GÏ%GPG ^Ь\Э1~u1%쑽- l֭r߭EPꑽ.֭߭.PޭnЭн2PPԭ瘭P֭PD40jhjjjjjjj4jBj0jjJ$jjjjjjjjjTjhjjjjjjjjajj~1]1}2P1z ~2~1:@b7T u2QQPRQRRPR2QPRPPխ lޭݭP౭1{2PPࢭꑭr ' 2PPЭP֭`~2PP  2PPޭlЭP֭`1^\~"P[2P@kkk2P@kkkݬC~  ^Ь[9$2P PQQP0PPkPk`0k2P ^ޭPP["Ѭd2PPPP-kkPP ޭP[PPLݬ ~8Pݬ ~y;3{ 0PWPQPQQjjޭP[P^Ь(խέPP-j  +ujojPޭQ2RPBax ފ ޭP2QA`붭ޭP2QA`P0PP jj^ޭ[ˏPP-άݬѬ  APAPP[,ޭ[iPi`iլSd;2d~6d%xiP xiP 6vioi1լbd2d~Y6BIi x2iP2cd xiPL i?dUլ2d2*d~5dh,hxhP cxhP,L^@:2N@~5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Q`aЭP׭PZ[xYPZPP[xYPZP[PPI8@j~\S^\wP[ЬPЬPЬRRQ{RPPR PRPPլQP$P@(#)crt0.c 4.3 (Berkeley) 1/13/82@(#)access.c 4.5 2/2/82not in write modeaddress out of segmentbad p0br or p1br in pcbpage table botchpage not valid/reclaimabledata address not foundtext address not found@(#)command.c 4.3 5/15/81zX"= "^i=:%16t=%8t:%16tadb @(#)expr.c 4.3 5/15/81@(#)format.c 4.1 5/14/81 %s:%16tx%16m%T%M:%16t%16t%-8u%-16U%-8o%-8r%-8r%-16R%-8x%-16X%-24Y%-8q%-16Q%-8o%-16O%-8d%-16D%-16.9f%-32.18FSHELL/bin/shsh-c!^?^%c@(#)input.c 4.1 5/14/81 @(#)main.c 4.2 5/15/81PH-w-k%s adb /usr/lib/adb@(#)opset.c 4.1 5/14/81%s%8t[%s]%s(%s)-(%s)(%s)+(%s)$%s$%r %R: %f@(#)output.c 4.2 2/2/82%+.16e%s%X%D @(#)pcs.c 4.1 5/14/81%d: killedbreakpoint%16tstopped at%16t@(#)print.c 4.5 2/2/82\أXԣTУP̣Ċ|Ȋ̊ЊȣԊģ׊ۊފ2<@DW^huʋ܋*8GQ[eoyь?Wm/not debugging kernel must have 2 <= radix <= 16radix=%d base tenvariables = %Q ? map/ mappcs id = %d no process sigtrampstart?%s(%R) from %X %8t%s:%10t? %R %s:%12t%R No algol 68 on VAXbreakpoints count%8tbkpt%24tcommand %-8.8d%24t%s%12t`%s' -b1 = %-16Re1 = %-16Rf1 = %-16R b2 = %-16Re2 = %-16Rf2 = %-16R%s%6t%R %16t:%16t () ()p1lrp1brp0lrp0brkspespssppslpcuspfpapr11r10r9r8r7r6r5r4r3r2r1r0hangupinterruptquitillegal instructiontrace/BPTIOTEMTfloating exceptionkilledbus errormemory faultbad system callbroken pipealarm callterminatedsignal 16stop (signal)stop (tty)continue (signal)child terminationstop (tty input)stop (tty output)input available (signal)cpu timelimitfile sizelimitsignal 26signal 27signal 28signal 29signal 30signal 31reserved addressing faultpriviliged instruction faultreserved operand faultinteger overflow trapinteger divide by zero trapfloating overflow trapfloating/decimal divide by zero trapfloating underflow trapdecimal overflow trapsubscript out of range trapfloating overflow faultfloating divide by zero faultfloating undeflow fault%Z%%M% %I% %G%%s: running %s: cannot execute %s: cannot open %s: cannot create cannot set breakpoint: - core dumped@(#)setup.c 4.6 82/02/13x~Error reading symbol|string table Not enough space for symbol|string table Old format a.out - no string table _Sysmap_Syssizesbr %X slr %X _masterpaddrcorefile not from this programp0br %X p0lr %X p1br %X p1lr %X -cannot open `%s' a.outcore@(#)sym.c 4.1 5/14/81%R%s+%R%s+%RM:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDecUnknown error: >  AAAAAABBBBBB TTL@i|dkV|6$i/ih /* boot.c 4.4 81/03/22 */ #include "../h/param.h" #include "../h/ino.h" #include "../h/inode.h" #include "../h/filsys.h" #include "../h/dir.h" #include "../h/vm.h" #include #include "saio.h" #include /* * Boot program... arguments passed in r10 and r11 determine * whether boot stops to ask for system name and which device * boot comes from. */ /* Types in r10 specifying major device */ char devname[][2] = { 'h','p', /* 0 = hp */ 0,0, /* 1 = ht */ 'u','p', /* 2 = up */ 'h','k', /* 3 = hk */ }; char line[100] = "xx(0,0)vmunix"; int retry = 0; main() { register howto, devtype; /* howto=r11, devtype=r10 */ int io; #ifdef lint howto = 0; devtype = 0; #endif printf("\nBoot\n"); #ifdef JUSTASK howto = RB_ASKNAME|RB_SINGLE; #else if ((howto&RB_ASKNAME)==0) { if (devtype>=0 && devtype= 0) copyunix(howto, io); if (++retry > 2) howto = RB_SINGLE|RB_ASKNAME; } } /*ARGSUSED*/ copyunix(howto, io) register howto, io; { struct exec x; register int i; char *addr; i = read(io, (char *)&x, sizeof x); if (i != sizeof x || x.a_magic != 0410) _stop("Bad format\n"); printf("%d", x.a_text); if (read(io, (char *)0, x.a_text) != x.a_text) goto shread; addr = (char *)x.a_text; while ((int)addr & CLOFSET) *addr++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rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj ~P  BЫZ֫ZPѫPѬ ZPPXPZ~9PYZkn 1mЫZ3[51xݏoPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~dPY PP4 [ [[[^  Ь[Z = 8[ePZ~YPZ ݫ ԫ kZP{ Ь[ЬZkPkPzQQPPP^߭ݬDPPPp`ݬݏ tݬݬݏtݬ6$Ь[ѬP ѫѫk֫k׫ЫP`P PЬPЬRRQ{RPRPPPRRP .DD~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [DPYPƏPxPgbPZxTPZPPZxD~@PZZZ!PZP xPZPPjjD1xYP[PZkk[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j ~\S^\_u Pl CЬW PЬPЬRRQ{RPPR PRPPP P@(#)ar.c 4.1 10/1/8033444r-w-s@x- r-w-sx-r-w-tx-@0P0`0x000000ar: bad option `%c' vXXXXXv1XXXXXv2XXXXXar: one of [%s] must be specified ar: only one of [%s] allowed ar: cannot open %s ar: %s cannot create <%s> ar: cannot create third temp %s ar: abi not allowed with q ar: %s cannot open ar: cannot create temp file ! ! ar: %s not in archive format ar: creating %s ar: cannot create %s ! ! ar: %s not in archive format usage: ar [%s][%s] archive files ... ar: %s does not exist ar: %s not found ar: %s cannot open ar: creating %s ar: cannot create %s %-16s%-12ld%-6u%-6u%-8o%-10ld%-2s` ` ar: malformed archive (at %ld) %ld%hd%hd%ho%ldar: cannot create second temp ar: phase error on %s %c - %s %3d/%1d%7ld %-12.12s %-4.4s ar write errormrxtdpquvnbail/tmp/vXXXXX/tmp/v1XXXXX/tmp/v2XXXX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 ЬPЬRRQ{RPRPPPRRPЬPЬRRQ{RPPR PRPP,I0"DPЬSRbcPRbB &0^nhpuphkraxx(0,0)vmunix Boot : : %s Bad format %d+%d+%d start 0x%x Short read   xvx,x!xhpuphkranull path %s not found bn negative bn ovf %D bn void %D bn void %D not a directory zero length directory Seek not from beginning of file No more file slotsBad device Unknown device Bad unit specifier Missing offset specification Can't write files yet.. Sorry Exit called%s Trap %o `       @ ` `&vd62M2R%s1 JTJ2" 7 `7//2 @v unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry DR2 `7x  @7 up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPEh >Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error 0123456789abcdef@igkwu*$>c_behknqtwz}R2iIf6i /* vmpage.c 4.16 81/05/12 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/inode.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/reg.h" #include "../h/pte.h" #include "../h/buf.h" #include "../h/text.h" #include "../h/mtpr.h" #include "../h/cmap.h" #include "../h/vm.h" #include "../h/file.h" #include "../h/trace.h" int nohash = 0; /* * Handle a page fault. * * Basic outline * If page is allocated, but just not valid: * Wait if intransit, else just revalidate * Done * Compute from which page operation would take place * If page is text page, and filling from file system or swap space: * If in free list cache, reattach it and then done * Allocate memory for page in * If block here, restart because we could have swapped, etc. * Lock process from swapping for duration * Update pte's to reflect that page is intransit. * If page is zero fill on demand: * Clear pages and flush free list cache of stale cacheing * for this swap pag((e (e.g. before initializing again due * to 407/410 exec). * If page is fill from file and in buffer cache: * Copy the page from the buffer cache. * If not a fill on demand: * Determine swap address and cluster to page in * Do the swap to bring the page in * Instrument the pagein * After swap validate the required new page * Leave prepaged pages reclaimable (not valid) * Update shared copies of text page tables * Complete bookkeeping on pages brought in: * No longer intransit * Hash text pages into core hash structure * Unlock pages (modulo raw i/o requirements) * Flush translation buffer * Process pagein is done */ #ifdef TRACE #define pgtrace(e) trace(e,v,u.u_procp->p_pid) #else #define pgtrace(e) #endif int preptofree = 1; /* send pre-paged pages to free list */ pagein(virtaddr) unsigned virtaddr; { register struct proc *p; register struct pte *pte; register struct inode *ip; register unsigned v; unsigned pf; int type, fileno, prot; struct pte opte; struct buf *bp; dev_t dev; register int i; int klsize; unsigned vsave; struct cmap *c; int j; daddr_t bn, bncache, bnswap; #ifdef PGINPROF int otime, olbolt, oicr, a, s; s = spl6(); otime = time, olbolt = lbolt, oicr = mfpr(ICR); #endif cnt.v_faults++; /* * Classify faulted page into a segment and get a pte * for the faulted page. */ vsave = v = clbase(btop(virtaddr)); p = u.u_procp; if (isatsv(p, v)) type = CTEXT; else if (isassv(p, v)) type = CSTACK; else type = CDATA; pte = vtopte(p, v); if (pte->pg_v) panic("pagein"); /* * If page is reclaimable, reclaim it. * If page is text and intransit, sleep while it is intransit, * If it is valid after the sleep, we are done. * Otherwise we have to start checking again, since page could * even be reclaimable now (we may have swapped for a long time). */ restart: if (pte->pg_fod == 0 && pte->pg_pfnum) { if (type == CTEXT && cmap[pgtocm(pte->pg_pfnum)].c_intrans) { pgtrace(TR_INTRANS); sleep((caddr_t)p->p_textp, PSWP+1); pgtrace(TR_EINTRANS); pte = vtopte(p, v); if (pte->pg_v) { valid: if (p->p_flag & SDLYU) mlock(pte->pg_pfnum); tbiscl(v); cnt.v_intrans++; return; } goto restart; } /* * If page is in the free list, then take * it back into the resident set, updating * the size recorded for the resident set. */ if (cmap[pgtocm(pte->pg_pfnum)].c_free) { pgtrace(TR_FRECLAIM); munlink(pte->pg_pfnum); cnt.v_pgfrec++; if (type == CTEXT) p->p_textp->x_rssize += CLSIZE; else p->p_rssize += CLSIZE; } else pgtrace(TR_RECLAIM); pte->pg_v = 1; if (anycl(pte, pg_m)) pte->pg_m = 1; distcl(pte); if (type == CTEXT) distpte(p->p_textp, vtotp(p, v), pte); u.u_vm.vm_minflt++; cnt.v_pgrec++; if (p->p_flag & SDLYU) mlock(pte->pg_pfnum); tbiscl(v); #ifdef PGINPROF a = vmtime(otime, olbolt, oicr); rectime += a; if (a >= 0) vmfltmon(rmon, a, rmonmin, rres, NRMON); splx(s); #endif return; } #ifdef PGINPROF splx(s); #endif /* * is where data comes from/goes to. * is where data is cached from/to. * is where data will eventually go. */ if (pte->pg_fod == 0) { fileno = -1; bnswap = bncache = bn = dbtofsb(vtod(p, v, &u.u_dmap, &u.u_smap)); dev = swapdev; } else { fileno = ((struct fpte *)pte)->pg_fileno; bn = ((struct fpte *)pte)->pg_blkno; bnswap = dbtofsb(vtod(p, v, &u.u_dmap, &u.u_smap)); if (fileno > PG_FMAX) panic("pagein pg_fileno"); if (fileno == PG_FTEXT) { if (p->p_textp == 0) panic("pagein PG_FTEXT"); dev = p->p_textp->x_iptr->i_dev; bncache = bn; } else if (fileno == PG_FZERO) { dev = swapdev; bncache = bnswap; } else { if (u.u_ofile[fileno] == NULL) panic("pagein u.u_ofile"); ip = u.u_ofile[fileno]->f_inode; dev = ip->i_dev; } } klsize = 1; opte = *pte; /* * Check for text detached but in free list. * This can happen only if the page is filling * from a inode or from the swap device, (e.g. not when reading * in 407/410 execs to a zero fill page.) */ if (type == CTEXT && fileno != PG_FZERO && !nohash) { c = mfind(dev, bncache); if (c) { if (c->c_type != CTEXT || c->c_gone == 0 || c->c_free == 0) panic("pagein mfind"); p->p_textp->x_rssize += CLSIZE; /* * Following code mimics memall(). */ pf = cmtopg(c - cmap); munlink(pf); for (j = 0; j < CLSIZE; j++) { *(int *)pte = pf++; pte->pg_prot = opte.pg_prot; pte++; } pte -= CLSIZE; c->c_free = 0; c->c_gone = 0; if (c->c_intrans || c->c_want) panic("pagein intrans|want"); c->c_lock = 1; if (c->c_page != vtotp(p, v)) panic("pagein c_page chgd"); c->c_ndx = p->p_textp - &text[0]; if (dev == swapdev) { cnt.v_xsfrec++; pgtrace(TR_XSFREC); } else { cnt.v_xifrec++; pgtrace(TR_XIFREC); } cnt.v_pgrec++; u.u_vm.vm_minflt++; if (dev != swapdev) { c = mfind(swapdev, bnswap); if (c) munhash(swapdev, bnswap); pte->pg_swapm = 1; } goto skipswap; } } /* * Wasn't reclaimable or reattachable. * Have to prepare to bring the page in. * We allocate the page before locking so we will * be swappable if there is no free memory. * If we block we have to start over, since anything * could have happened. */ if (freemem < CLSIZE * KLMAX) { pgtrace(TR_WAITMEM); while (freemem < CLSIZE * KLMAX) sleep((caddr_t)&freemem, PSWP+2); pgtrace(TR_EWAITMEM); pte = vtopte(p, v); if (pte->pg_v) goto valid; goto restart; } /* * Now can get memory and committed to bringing in the page. * Lock this process, get a page, * construct the new pte, and increment * the (process or text) resident set size. */ p->p_flag |= SPAGE; (void) memall(pte, CLSIZE, p, type); pte->pg_prot = opte.pg_prot; pf = pte->pg_pfnum; cmap[pgtocm(pf)].c_intrans = 1; distcl(pte); if (type == CTEXT) { p->p_textp->x_rssize += CLSIZE; distpte(p->p_textp, vtotp(p, v), pte); } else p->p_rssize += CLSIZE; /* * Two cases: either fill on demand (zero, or from file or text) * or from swap space. */ if (opte.pg_fod) { pte->pg_swapm = 1; if (fileno == PG_FZERO || fileno == PG_FTEXT) { /* * Flush any previous text page use of this * swap device block. */ if (type == CTEXT) { c = mfind(swapdev, bnswap); if (c) munhash(swapdev, bnswap); } /* * If zero fill, short-circuit hard work * by just clearing pages. */ if (fileno == PG_FZERO) { pgtrace(TR_ZFOD); for (i = 0; i < CLSIZE; i++) clearseg(pf+i); if (type != CTEXT) cnt.v_zfod += CLSIZE; goto skipswap; } pgtrace(TR_EXFOD); cnt.v_exfod += CLSIZE; } else { /* * Vreading block... update summary information. */ if (u.u_ofile[fileno] == NULL) panic("pagein u.u_ofile"); if ((u.u_vrpages[fileno] -= CLSIZE) <= 0) { if (u.u_vrpages[fileno] < 0) panic("pagein u.u_vrpages"); if (--ip->i_vfdcnt < 0) panic("pagein i_vfdcnt"); } cnt.v_vrfod += CLSIZE; pgtrace(TR_VRFOD); } /* * Check that block is not in file system buffer cache. * The way the cache is handled now, this * happens only once every 2 days. */ if (bp = baddr(dev, bn)) { #ifdef TRACE if (type != CTEXT) trace(TR_XFODHIT, dev, bn); #endif pgtrace(TR_CACHEFOD); pte->pg_v = 1; prot = *(int *)pte & PG_PROT; pte->pg_prot = 0; *(int *)pte |= PG_UW; distcl(pte); tbiscl(v); /* THIS ASSUMES THAT CLSIZE*NBPG==BSIZE */ bcopy(bp->b_un.b_addr, ptob(v), BSIZE); brelse(bp); pte->pg_prot = 0; *(int *)pte |= prot; goto skipswap; } #ifdef TRACE if (type != CTEXT) trace(TR_XFODMISS, dev, bn); #endif } else { if (opte.pg_pfnum) panic("pagein pfnum"); pgtrace(TR_SWAPIN); /* * Fill from swap area. Try to find adjacent * pages to bring in also. */ v = kluster(p, v, pte, B_READ, &klsize, (type == CTEXT) ? kltxt : ((p->p_flag & SSEQL) ? klseql : klin), bn); /* THIS COULD BE COMPUTED INCREMENTALLY... */ bncache = bn = dbtofsb(vtod(p, v, &u.u_dmap, &u.u_smap)); pte->pg_vreadm = opte.pg_vreadm; } distcl(pte); swap(p, fsbtodb(bn), ptob(v), klsize * ctob(CLSIZE), B_READ, B_PGIN, dev, 0); #ifdef TRACE trace(TR_PGINDONE, vsave, u.u_procp->p_pid); #endif /* * Instrumentation. */ u.u_vm.vm_majflt++; cnt.v_pgin++; cnt.v_pgpgin += klsize * CLSIZE; #ifdef PGINPROF a = vmtime(otime, olbolt, oicr) / 100; pgintime += a; if (a >= 0) vmfltmon(pmon, a, pmonmin, pres, NPMON); #endif skipswap: /* * Fix page table entries. * * Only page requested in is validated, and rest of pages * can be ``reclaimed''. This allows system to reclaim prepaged pages * quickly if they are not used and memory is tight. */ pte = vtopte(p, vsave); pte->pg_v = 1; distcl(pte); if (type == CTEXT) { distpte(p->p_textp, vtotp(p, vsave), pte); if (opte.pg_fod) p->p_textp->x_flag |= XWRIT; wakeup((caddr_t)p->p_textp); } /* * Memall returned page(s) locked. Unlock all * pages in cluster. If locking pages for raw i/o * leave the page whic@igkss)$>c_behknqtwz}R2iIf6i((h was required to be paged in locked, * but still unlock others. * If text pages, hash into the cmap situation table. */ pte = vtopte(p, v); for (i = 0; i < klsize; i++) { c = &cmap[pgtocm(pte->pg_pfnum)]; c->c_intrans = 0; if (type == CTEXT && c->c_blkno == 0 && bncache && !nohash) { mhash(c, dev, bncache); bncache++; } if (v != vsave || (p->p_flag & SDLYU) == 0) munlock(pte->pg_pfnum); if (v != vsave && type != CTEXT && preptofree) { /* * Throw pre-paged data/stack pages at the * bottom of the free list. */ p->p_rssize -= CLSIZE; memfree(pte, CLSIZE, 0); } tbiscl(v); /* conservative ? */ v += CLSIZE; pte += CLSIZE; } /* * All done. */ p->p_flag &= ~SPAGE; /* * If process is declared fifo, memory is tight, * and this was a data page-in, free memory * klsdist pagein clusters away from the current fault. */ if ((p->p_flag&SSEQL) && freemem < lotsfree && type == CDATA) { int k = (vtodp(p, vsave) / CLSIZE) / klseql; #ifdef notdef if (vsave > u.u_vsave) k -= klsdist; else k += klsdist; dpageout(p, k * klseql * CLSIZE, klout*CLSIZE); u.u_vsave = vsave; #else dpageout(p, (k - klsdist) * klseql * CLSIZE, klout*CLSIZE); dpageout(p, (k + klsdist) * klseql * CLSIZE, klout*CLSIZE); #endif } } #if defined(BERT) int dmod = 1000000; int dcnt; #endif /* * Take away n pages of data space * starting at data page dp. * Used to take pages away from sequential processes. * Mimics pieces of code in pageout() below. */ dpageout(p, dp, n) struct proc *p; int dp, n; { register struct cmap *c; int i, klsize; register struct pte *pte; unsigned v; daddr_t daddr; if (dp < 0) { n += dp; dp = 0; } if (dp + n > p->p_dsize) n = p->p_dsize - dp; #if defined(BERT) if (++dcnt % dmod == 0) printf("dp %d, n %d\n", dp, n); #endif for (i = 0; i < n; i += CLSIZE, dp += CLSIZE) { pte = dptopte(p, dp); if (pte->pg_fod || pte->pg_pfnum == 0) continue; c = &cmap[pgtocm(pte->pg_pfnum)]; if (c->c_lock || c->c_free) continue; if (pte->pg_v) { pte->pg_v = 0; if (anycl(pte, pg_m)) pte->pg_m = 1; distcl(pte); } if (dirtycl(pte)) { if (bswlist.av_forw == NULL) continue; mlock(pte->pg_pfnum); if (anycl(pte, pg_m)) { pte->pg_vreadm = 1; pte->pg_m = 0; } pte->pg_swapm = 0; distcl(pte); p->p_poip++; v = kluster(p, dptov(p, dp), pte, B_WRITE, &klsize, klout, (daddr_t)0); /* THIS ASSUMES THAT p == u.u_procp */ daddr = vtod(p, v, &u.u_dmap, &u.u_smap); swap(p, daddr, ptob(v), klsize * ctob(CLSIZE), B_WRITE, B_DIRTY, swapdev, pte->pg_pfnum); } else { if (c->c_gone == 0) p->p_rssize -= CLSIZE; memfree(pte, CLSIZE, 0); cnt.v_seqfree += CLSIZE; } } } int fifo = 0; /* * The page out daemon, which runs as process 2. * * As long as there are at least lotsfree pages, * this process is not run. When the number of free * pages stays in the range desfree to lotsfree, * this daemon runs through the pages in the loop * at a rate determined in vmsched(), simulating the missing * hardware reference bit, and cleaning pages and transferring * them to the free list. */ pageout() { register struct proc *rp; register struct text *xp; register struct cmap *c; register struct pte *pte; int count, pushes; swblk_t daddr; unsigned v; int maxhand = pgtocm(maxfree); int klsize; loop: /* * Before sleeping, look to see if there are any swap I/O headers * in the ``cleaned'' list that correspond to dirty * pages that have been pushed asynchronously. If so, * empty the list by calling cleanup(). * * N.B.: We guarantee never to block while the cleaned list is nonempty. */ (void) spl6(); if (bclnlist != NULL) cleanup(); sleep((caddr_t)&proc[2], PSWP+1); (void) spl0(); count = 0; pushes = 0; while (nscan < desscan && freemem < lotsfree) { top: /* * An iteration of the clock pointer (hand) around the loop. * Look at the page at hand. If it is a * locked (for physical i/o e.g.), system (u., page table) * or free, then leave it alone. * Otherwise, find a process and text pointer for the * page, and a virtual page number in either the * process or the text image. */ c = &cmap[hand]; if (c->c_lock || c->c_free) goto skip; switch (c->c_type) { case CSYS: goto skip; case CTEXT: xp = &text[c->c_ndx]; rp = xp->x_caddr; v = tptov(rp, c->c_page); pte = tptopte(rp, c->c_page); break; case CDATA: case CSTACK: rp = &proc[c->c_ndx]; while (rp->p_flag & SNOVM) rp = rp->p_xlink; xp = rp->p_textp; if (c->c_type == CDATA) { v = dptov(rp, c->c_page); pte = dptopte(rp, c->c_page); } else { v = sptov(rp, c->c_page); pte = sptopte(rp, c->c_page); } break; } if (pte->pg_pfnum != cmtopg(hand)) panic("bad c_page"); /* * If page is valid; make invalid but reclaimable. * If this pte is not valid, then it must be reclaimable * and we can add it to the free list. */ if (pte->pg_v) { pte->pg_v = 0; if (anycl(pte, pg_m)) pte->pg_m = 1; distcl(pte); if (c->c_type == CTEXT) distpte(xp, vtotp(rp, v), pte); if ((rp->p_flag & (SSEQL|SUANOM)) || fifo || rp->p_rssize > rp->p_maxrss) goto take; } else { take: if (c->c_type != CTEXT) { /* * Guarantee a minimal investment in data * space for jobs in balance set. */ if (rp->p_rssize < saferss - rp->p_slptime) goto skip; } /* * If the page is currently dirty, we * have to arrange to have it cleaned before it * can be freed. We mark it clean immediately. * If it is reclaimed while being pushed, then modified * again, we are assured of the correct order of * writes because we lock the page during the write. * This guarantees that a swap() of this process (and * thus this page), initiated in parallel, will, * in fact, push the page after us. * * The most general worst case here would be for * a reclaim, a modify and a swapout to occur * all before the single page transfer completes. */ if (dirtycl(pte)) { /* * Limit pushes to avoid saturating * pageout device. * * MAGIC 4 BECAUSE WE RUN EVERY 1/4 SEC (clock) */ if (pushes > maxpgio / 4) goto skip; pushes++; /* * If the process is being swapped out * or about to exit, do not bother with its * dirty pages */ if (rp->p_flag & (SLOCK|SWEXIT)) goto skip; /* * Now carefully make sure that there will * be a header available for the push so that * we will not block waiting for a header in * swap(). The reason this is important is * that we (proc[2]) are the one who cleans * dirty swap headers and we could otherwise * deadlock waiting for ourselves to clean * swap headers. The sleep here on &proc[2] * is actually (effectively) a sleep on both * ourselves and &bswlist, and this is known * to iodone and swap in bio.c. That is, * &proc[2] will be awakened both when dirty * headers show up and also to get the pageout * daemon moving. */ (void) spl6(); if (bclnlist != NULL) cleanup(); if (bswlist.av_forw == NULL) { bswlist.b_flags |= B_WANTED; sleep((caddr_t)&proc[2], PSWP+2); (void) spl0(); /* * Page disposition may have changed * since process may have exec'ed, * forked, exited or just about * anything else... try this page * frame again, from the top. */ goto top; } (void) spl0(); mlock((unsigned)cmtopg(hand)); uaccess(rp, Pushmap, &pushutl); /* * Now committed to pushing the page... */ if (anycl(pte, pg_m)) { pte->pg_vreadm = 1; pte->pg_m = 0; } pte->pg_swapm = 0; distcl(pte); if (c->c_type == CTEXT) { xp->x_poip++; distpte(xp, vtotp(rp, v), pte); } else rp->p_poip++; v = kluster(rp, v, pte, B_WRITE, &klsize, klout, (daddr_t)0); if (klsize == 0) panic("pageout klsize"); daddr = vtod(rp, v, &pushutl.u_dmap, &pushutl.u_smap); swap(rp, daddr, ptob(v), klsize * ctob(CLSIZE), B_WRITE, B_DIRTY, swapdev, pte->pg_pfnum); /* * The cleaning of this page will be * completed later, in cleanup() called * (synchronously) by us (proc[2]). In * the meantime, the page frame is locked * so no havoc can result. */ goto skip; } /* * Decrement the resident set size of the current * text object/process, and put the page in the * free list. Note that we don't give memfree the * pte as its argument, since we don't want to destroy * the pte. If it hasn't already been discarded * it may yet have a chance to be reclaimed from * the free list. */ if (c->c_gone == 0) if (c->c_type == CTEXT) xp->x_rssize -= CLSIZE; else rp->p_rssize -= CLSIZE; memfree(pte, CLSIZE, 0); cnt.v_dfree += CLSIZE; /* * We managed to add a page to the free list, * so we give ourselves another couple of trips * around the loop. */ count = 0; } skip: cnt.v_scan++; nscan++; if (++hand >= maxhand) { hand = 0; cnt.v_rev++; if (count > 2) { /* * Extremely unlikely, but we went around * the loop twice and didn't get anywhere. * Don't cycle, stop till the next clock tick. */ goto loop; } count++; } } goto loop; } /* * Process the ``cleaned'' list. * * Scan through the linked list of swap I/O headers * and free the corresponding pages that have been * cleaned by being written back to the paging area. * If the page has been reclaimed during this time, * we do not free the page. As they are processed, * the swap I/O headers are removed from the cleaned * list and inserted into the free list. */ cleanup() { register struct buf *bp; register struct proc *rp; register struct text *xp; register struct cmap *c; register struct pte *pte; unsigned pf; register int i; int s, center; for (;;) { s = spl6(); if ((bp = bclnlist) == 0) break; bclnlist = bp->av_forw; splx(s)((; pte = dptopte(&proc[2], btop(bp->b_un.b_addr)); center = 0; for (i = 0; i < bp->b_bcount; i += CLSIZE * NBPG) { pf = pte->pg_pfnum; munlock(pf); c = &cmap[pgtocm(pf)]; if (pf != bp->b_pfcent) { if (c->c_gone) { memfree(pte, CLSIZE, 0); cnt.v_dfree += CLSIZE; } goto skip; } center++; switch (c->c_type) { case CSYS: panic("cleanup CSYS"); case CTEXT: xp = &text[c->c_ndx]; xp->x_poip--; if (xp->x_poip == 0) wakeup((caddr_t)&xp->x_poip); break; case CDATA: case CSTACK: rp = &proc[c->c_ndx]; while (rp->p_flag & SNOVM) rp = rp->p_xlink; rp->p_poip--; if (rp->p_poip == 0) wakeup((caddr_t)&rp->p_poip); break; } if (c->c_gone == 0) { switch (c->c_type) { case CTEXT: pte = tptopte(xp->x_caddr, c->c_page); break; case CDATA: pte = dptopte(rp, c->c_page); break; case CSTACK: pte = sptopte(rp, c->c_page); break; } if (pte->pg_v) goto skip; if (c->c_type == CTEXT) xp->x_rssize -= CLSIZE; else rp->p_rssize -= CLSIZE; } memfree(pte, CLSIZE, 0); cnt.v_dfree += CLSIZE; skip: pte += CLSIZE; } if (center != 1) panic("cleanup center"); bp->b_flags = 0; bp->av_forw = bswlist.av_forw; bswlist.av_forw = bp; if (bswlist.b_flags & B_WANTED) { bswlist.b_flags &= ~B_WANTED; wakeup((caddr_t)&bswlist); } } splx(s); } /* * Kluster locates pages adjacent to the argument pages * that are immediately available to include in the pagein/pageout, * and given the availability of memory includes them. * It knows that the process image is contiguous in chunks; * an assumption here is that CLSIZE * KLMAX is a divisor of DMMIN, * so that by looking at KLMAX chunks of pages, all such will * necessarily be mapped swap contiguous. */ int noklust; int klicnt[KLMAX]; int klocnt[KLMAX]; kluster(p, v, pte0, rw, pkl, klsize, bn0) register struct proc *p; unsigned v; struct pte *pte0; int rw, *pkl, klsize; daddr_t bn0; { int type, cl, clmax; int kloff, k, klmax; register struct pte *pte; int klback, klforw; register int i; unsigned v0; daddr_t bn; if (rw == B_READ) klicnt[0]++; else klocnt[0]++; *pkl = 1; if (noklust || klsize <= 1 || klsize > KLMAX || (klsize & (klsize - 1))) return (v); if (rw == B_READ && freemem < CLSIZE * KLMAX) return (v); if (isassv(p, v)) { type = CSTACK; cl = vtosp(p, v) / CLSIZE; clmax = p->p_ssize / CLSIZE; } else if (isadsv(p, v)) { type = CDATA; cl = vtodp(p, v) / CLSIZE; clmax = p->p_dsize / CLSIZE; } else { type = CTEXT; cl = vtotp(p, v) / CLSIZE; clmax = p->p_textp->x_size / CLSIZE; } kloff = cl & (klsize - 1); pte = pte0; bn = bn0; for (k = kloff; --k >= 0;) { if (type == CSTACK) pte += CLSIZE; else pte -= CLSIZE; if (type == CTEXT && rw == B_READ && bn) { bn--; if (mfind(swapdev, bn)) break; } if (!klok(pte, rw)) break; } klback = (kloff - k) - 1; pte = pte0; if ((cl - kloff) + klsize > clmax) klmax = clmax - (cl - kloff); else klmax = klsize; bn = bn0; for (k = kloff; ++k < klmax;) { if (type == CSTACK) pte -= CLSIZE; else pte += CLSIZE; if (type == CTEXT && rw == B_READ && bn) { bn++; if (mfind(swapdev, bn)) break; } if (!klok(pte, rw)) break; } klforw = (k - kloff) - 1; if (klforw + klback == 0) return (v); pte = pte0; if (type == CSTACK) { pte -= klforw * CLSIZE; v -= klforw * CLSIZE; } else { pte -= klback * CLSIZE; v -= klback * CLSIZE; } *pkl = klforw + klback + 1; if (rw == B_READ) klicnt[0]--, klicnt[*pkl - 1]++; else klocnt[0]--, klocnt[*pkl - 1]++; v0 = v; for (i = 0; i < *pkl; i++) { if (pte == pte0) goto cont; if (rw == B_WRITE) { mlock(pte->pg_pfnum); if (anycl(pte, pg_m)) { pte->pg_vreadm = 1; pte->pg_m = 0; } pte->pg_swapm = 0; distcl(pte); if (type == CTEXT) distpte(p->p_textp, vtotp(p, v), pte); } else { struct pte opte; int pf; opte = *pte; if (memall(pte, CLSIZE, p, type) == 0) panic("kluster"); pte->pg_prot = opte.pg_prot; pf = pte->pg_pfnum; cmap[pgtocm(pf)].c_intrans = 1; distcl(pte); if (type == CTEXT) { p->p_textp->x_rssize += CLSIZE; distpte(p->p_textp, vtotp(p, v), pte); } else p->p_rssize += CLSIZE; /* if (opte.pg_fod == 0) */ pte->pg_vreadm = opte.pg_vreadm; distcl(pte); } cont: pte += CLSIZE; v += CLSIZE; } return (v0); } klok(pte, rw) register struct pte *pte; int rw; { register struct cmap *c; if (rw == B_WRITE) { if (pte->pg_fod) return (0); if (pte->pg_pfnum == 0) return (0); c = &cmap[pgtocm(pte->pg_pfnum)]; if (c->c_lock || c->c_intrans) return (0); if (!dirtycl(pte)) return (0); return (1); } else { if (pte->pg_fod) return (0); if (pte->pg_pfnum) return (0); return (1); } } @ihkJH$Y\Q2iӍ[6i /* vmmon.c 4.6 81/04/28 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/vmmeter.h" #include "../h/trace.h" #include "../h/mtpr.h" #ifdef PGINPROF int pmonmin = PMONMIN; int pres = PRES; int rmonmin = RMONMIN; int rres = RRES; vmsizmon() { register int i; i = (u.u_dsize / DRES) < NDMON ? (u.u_dsize / DRES):NDMON; dmon[i] += u.u_vm.vm_utime - u.u_outime; i = (u.u_ssize / SRES) < NSMON ? (u.u_ssize / SRES):NSMON; smon[i] += u.u_vm.vm_utime - u.u_outime; u.u_outime = u.u_vm.vm_utime; } vmfltmon(hist, atime, amin, res, nmax) register unsigned int *hist; register int atime, amin, res, nmax; { register int i; i = (atime - amin) / res; if (i>=0 && i= TRCSIZ) { tracex += (TRCSIZ - x); x = 0; } argp = &args; tracep = &tracebuf[x]; tracex += nargs; *tracep++ = (time*60 + lbolt+1)*16667 + mfpr(ICR); nargs--; do *tracep++ = *argp++; while (--nargs > 0); } #endif @iikMV$1258;>ADGJMPQ2i6i /* vmmem.c 4.7 81/07/09 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/pte.h" #include "../h/cmap.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/mtpr.h" #include "../h/text.h" #include "../h/vm.h" #include "../h/file.h" #include "../h/inode.h" #include "../h/buf.h" #include "../h/mount.h" #include "../h/trace.h" #include "../h/map.h" /* * Allocate memory, and always succeed * by jolting page-out daemon * so as to obtain page frames. * To be used in conjunction with vmemfree(). */ vmemall(pte, size, p, type) register struct pte *pte; int size; struct proc *p; { register int m; if (size <= 0 || size > maxmem) panic("vmemall size"); while (size > 0) { if (freemem < desfree) wakeup((caddr_t)&proc[2]); /* jolt daemon */ while (freemem == 0) sleep((caddr_t)&freemem, PSWP+2); m = imin(size, freemem); (void) memall(pte, m, p, type); size -= m; pte += m; } if (freemem < desfree) wakeup((caddr_t)&proc[2]); /* jolt daemon */(( /* * Always succeeds, but return success for * vgetu and vgetpt (e.g.) which call either * memall or vmemall depending on context. */ return (1); } /* * Free valid and reclaimable page frames belonging to the * count pages starting at pte. If a page is valid * or reclaimable and locked (but not a system page), then * we simply mark the page as c_gone and let the pageout * daemon free the page when it is through with it. * If a page is reclaimable, and already in the free list, then * we mark the page as c_gone, and (of course) don't free it. * * Determines the largest contiguous cluster of * valid pages and frees them in one call to memfree. */ vmemfree(pte, count) register struct pte *pte; register int count; { register struct cmap *c; register struct pte *spte; register int j; int size, pcnt, fileno; if (count % CLSIZE) panic("vmemfree"); for (size = 0, pcnt = 0; count > 0; pte += CLSIZE, count -= CLSIZE) { if (pte->pg_fod == 0 && pte->pg_pfnum) { c = &cmap[pgtocm(pte->pg_pfnum)]; pcnt += CLSIZE; if (c->c_lock && c->c_type != CSYS) { for (j = 0; j < CLSIZE; j++) *(int *)(pte+j) &= (PG_PROT|PG_VREADM); c->c_gone = 1; goto free; } if (c->c_free) { pcnt -= CLSIZE; for (j = 0; j < CLSIZE; j++) *(int *)(pte+j) &= (PG_PROT|PG_VREADM); if (c->c_type == CTEXT) distpte(&text[c->c_ndx], (int)c->c_page, pte); c->c_gone = 1; goto free; } if (size == 0) spte = pte; size += CLSIZE; continue; } if (pte->pg_fod) { fileno = ((struct fpte *)pte)->pg_fileno; if (fileno < NOFILE) if ((u.u_vrpages[fileno] -= CLSIZE) <= 0) { if (u.u_vrpages[fileno] < 0) panic("vmemfree vrpages"); if (--u.u_ofile[fileno]->f_inode->i_vfdcnt < 0) panic("vmemfree vfdcnt"); } for (j = 0; j < CLSIZE; j++) *(int *)(pte+j) &= (PG_PROT|PG_VREADM); } free: if (size) { memfree(spte, size, 1); size = 0; } } if (size) memfree(spte, size, 1); return (pcnt); } /* * Unlink a page frame from the free list - * * Performed if the page being reclaimed * is in the free list. */ munlink(pf) unsigned pf; { register int next, prev; next = cmap[pgtocm(pf)].c_next; prev = cmap[pgtocm(pf)].c_prev; cmap[prev].c_next = next; cmap[next].c_prev = prev; cmap[pgtocm(pf)].c_free = 0; if (freemem < minfree) wakeup((caddr_t)&proc[2]); /* jolt paging daemon */ freemem -= CLSIZE; } /* * Allocate memory - * * The free list appears as a doubly linked list * in the core map with cmap[0] serving as a header. */ memall(pte, size, p, type) register struct pte *pte; int size; struct proc *p; { register struct cmap *c; register struct pte *rpte; register struct proc *rp; int i, j, next, curpos; unsigned pf; struct cmap *c1, *c2; if (size % CLSIZE) panic("memall"); if (size > freemem) return (0); #ifdef TRACE trace(TR_MALL, size, u.u_procp->p_pid); #endif for (i = size; i > 0; i -= CLSIZE) { curpos = cmap[CMHEAD].c_next; c = &cmap[curpos]; if (c->c_free == 0) panic("dup mem alloc"); if (cmtopg(curpos) > maxfree) panic("bad mem alloc"); if (c->c_gone == 0 && c->c_type != CSYS) { if (c->c_type == CTEXT) rp = text[c->c_ndx].x_caddr; else rp = &proc[c->c_ndx]; while (rp->p_flag & SNOVM) rp = rp->p_xlink; switch (c->c_type) { case CTEXT: rpte = tptopte(rp, c->c_page); break; case CDATA: rpte = dptopte(rp, c->c_page); break; case CSTACK: rpte = sptopte(rp, c->c_page); break; } zapcl(rpte, pg_pfnum) = 0; if (c->c_type == CTEXT) distpte(&text[c->c_ndx], (int)c->c_page, rpte); } switch (type) { case CSYS: c->c_ndx = p->p_ndx; break; case CTEXT: c->c_page = vtotp(p, ptetov(p, pte)); c->c_ndx = p->p_textp - &text[0]; break; case CDATA: c->c_page = vtodp(p, ptetov(p, pte)); c->c_ndx = p->p_ndx; break; case CSTACK: c->c_page = vtosp(p, ptetov(p, pte)); c->c_ndx = p->p_ndx; break; } if (c->c_blkno) { /* * This is very like munhash(), except * that we really don't want to bother * to calculate a dev to pass to it. */ j = CMHASH(c->c_blkno); c1 = &cmap[cmhash[j]]; if (c1 == c) cmhash[j] = c1->c_hlink; else { for (;;) { if (c1 == ecmap) panic("memall ecmap"); c2 = c1; c1 = &cmap[c2->c_hlink]; if (c1 == c) break; } c2->c_hlink = c1->c_hlink; } if (mfind(c->c_mdev == MSWAPX ? swapdev : mount[c->c_mdev].m_dev, (daddr_t)c->c_blkno)) panic("memall mfind"); c1->c_mdev = 0; c1->c_blkno = 0; c1->c_hlink = 0; } pf = cmtopg(curpos); for (j = 0; j < CLSIZE; j++) *(int *)pte++ = pf++; c->c_free = 0; c->c_gone = 0; if (c->c_intrans || c->c_want) panic("memall intrans|want"); c->c_lock = 1; c->c_type = type; freemem -= CLSIZE; next = c->c_next; cmap[CMHEAD].c_next = next; cmap[next].c_prev = CMHEAD; } return (size); } /* * Free memory - * * The page frames being returned are inserted * to the head/tail of the free list depending * on whether there is any possible future use of them. * * If the freemem count had been zero, * the processes sleeping for memory * are awakened. */ memfree(pte, size, detach) register struct pte *pte; register int size; { register int i, j, prev, next; register struct cmap *c; if (size % CLSIZE) panic("memfree"); if (freemem < CLSIZE * KLMAX) wakeup((caddr_t)&freemem); while (size > 0) { size -= CLSIZE; i = pte->pg_pfnum; if (i < firstfree || i > maxfree) panic("bad mem free"); i = pgtocm(i); c = &cmap[i]; if (c->c_free) panic("dup mem free"); if (detach && c->c_type != CSYS) { for (j = 0; j < CLSIZE; j++) *(int *)(pte+j) &= (PG_PROT|PG_VREADM); c->c_gone = 1; } if (detach && c->c_blkno == 0) { next = cmap[CMHEAD].c_next; cmap[next].c_prev = i; c->c_prev = CMHEAD; c->c_next = next; cmap[CMHEAD].c_next = i; } else { prev = cmap[CMHEAD].c_prev; cmap[prev].c_next = i; c->c_next = CMHEAD; c->c_prev = prev; cmap[CMHEAD].c_prev = i; } c->c_free = 1; freemem += CLSIZE; pte += CLSIZE; } } /* * Allocate wired-down (non-paged) pages in kernel virtual memory. */ caddr_t wmemall(pmemall, n) int (*pmemall)(), n; { int npg; caddr_t va; register int a; npg = btoc(n); a = rmalloc(kernelmap, npg); if (a == 0) return (0); if ((*pmemall)(&Usrptmap[a], npg, &proc[0], CSYS) == 0) { rmfree(kernelmap, npg, a); return (0); } va = (caddr_t) kmxtob(a); vmaccess(&Usrptmap[a], va, npg); return (va); } wmemfree(va, n) caddr_t va; int n; { register int a; int npg; a = btokmx((struct pte *) va); npg = btoc(n); (void) memfree(&Usrptmap[a], npg, 0); rmfree(kernelmap, npg, a); } /* * Enter clist block c on the hash chains. * It contains file system block bn from device dev. * Dev must either be a mounted file system or the swap device * so we panic if getfsx() cannot find it. */ mhash(c, dev, bn) register struct cmap *c; dev_t dev; daddr_t bn; { register int i = CMHASH(bn); c->c_hlink = cmhash[i]; cmhash[i] = c - cmap; c->c_blkno = bn; i = getfsx(dev); if (i == -1) panic("mhash"); c->c_mdev = i; } /* * Pull the clist entry of off the hash chains. * We have checked before calling (using mfind) that the * entry really needs to be unhashed, so panic if we can't * find it (can't happen). */ munhash(dev, bn) dev_t dev; daddr_t bn; { register int i = CMHASH(bn); register struct cmap *c1, *c2; c1 = &cmap[cmhash[i]]; if (c1 == ecmap) panic("munhash"); if (c1->c_blkno == bn && getfsx(dev) == c1->c_mdev) cmhash[i] = c1->c_hlink; else { for (;;) { c2 = c1; c1 = &cmap[c2->c_hlink]; if (c1 == ecmap) panic("munhash"); if (c1->c_blkno == bn && getfsx(dev) == c1->c_mdev) break; } c2->c_hlink = c1->c_hlink; } if (mfind(dev, bn)) panic("munhash mfind"); c1->c_mdev = 0; c1->c_blkno = 0; c1->c_hlink = 0; } /* * Look for block bn of device dev in the free pool. * Currently it should not be possible to find it unless it is * c_free and c_gone, although this may later not be true. * (This is because active texts are locked against file system * writes by the system.) */ struct cmap * mfind(dev, bn) dev_t dev; daddr_t bn; { register struct cmap *c1 = &cmap[cmhash[CMHASH(bn)]]; while (c1 != ecmap) { if (c1->c_blkno == bn && c1->c_mdev == getfsx(dev)) return (c1); c1 = &cmap[c1->c_hlink]; } return ((struct cmap *)0); } /* * Purge blocks from device dev from incore cache * before umount(). */ mpurge(mdev) int mdev; { register struct cmap *c1, *c2; register int i; for (i = 0; i < CMHSIZ; i++) { more: c1 = &cmap[cmhash[i]]; if (c1 == ecmap) continue; if (c1->c_mdev == mdev) cmhash[i] = c1->c_hlink; else { for (;;) { c2 = c1; c1 = &cmap[c1->c_hlink]; if (c1 == ecmap) goto cont; if (c1->c_mdev == mdev) break; } c2->c_hlink = c1->c_hlink; } c1->c_mdev = 0; c1->c_blkno = 0; c1->c_hlink = 0; goto more; cont: ; } } /* * Initialize core map */ meminit(first, last) int first, last; { register @iikMX$1258;>ADGJMPQ2i6i((int i; register struct cmap *c; firstfree = clrnd(first); maxfree = clrnd(last - (CLSIZE - 1)); freemem = maxfree - firstfree; ecmx = ecmap - cmap; if (ecmx < freemem / CLSIZE) freemem = ecmx * CLSIZE; for (i = 1; i <= freemem / CLSIZE; i++) { cmap[i-1].c_next = i; c = &cmap[i]; c->c_prev = i-1; c->c_free = 1; c->c_gone = 1; c->c_type = CSYS; c->c_mdev = 0; c->c_blkno = 0; } cmap[freemem / CLSIZE].c_next = CMHEAD; for (i = 0; i < CMHSIZ; i++) cmhash[i] = ecmx; cmap[CMHEAD].c_prev = freemem / CLSIZE; cmap[CMHEAD].c_type = CSYS; avefree = freemem; hand = 0; } /* * Wait for frame pf to become unlocked * if it is currently locked. * * THIS ROUTINE SHOULD TAKE A CMAP STRUCTURE AS ARGUMENT. */ mwait(pf) unsigned pf; { mlock(pf); munlock(pf); } /* * Lock a page frame. * * THIS ROUTINE SHOULD TAKE A CMAP STRUCTURE AS ARGUMENT. */ mlock(pf) unsigned pf; { register struct cmap *c = &cmap[pgtocm(pf)]; while (c->c_lock) { c->c_want = 1; sleep((caddr_t)c, PSWP+1); } c->c_lock = 1; } /* * Unlock a page frame. * * THIS ROUTINE SHOULD TAKE A CMAP STRUCTURE AS ARGUMENT. */ munlock(pf) unsigned pf; { register struct cmap *c = &cmap[pgtocm(pf)]; if (c->c_lock == 0) panic("dup page unlock"); if (c->c_want) wakeup((caddr_t)c); c->c_lock = 0; c->c_want = 0; } /* * Lock a virtual segment. * * For each cluster of pages, if the cluster is not valid, * touch it to fault it in, otherwise just lock page frame. * Called from physio to ensure that the pages * participating in raw i/o are valid and locked. * We use SDLYU to keep pagein from unlocking pages, * so they make it safely back here locked. */ vslock(base, count) caddr_t base; { register unsigned v; register int npf; register struct pte *pte; u.u_procp->p_flag |= SDLYU; v = btop(base); pte = vtopte(u.u_procp, v); npf = btoc(count + ((int)base & CLOFSET)); while (npf > 0) { if (pte->pg_v) mlock(pte->pg_pfnum); else if (fubyte((caddr_t)ctob(v)) < 0) panic("vslock"); pte += CLSIZE; v += CLSIZE; npf -= CLSIZE; } u.u_procp->p_flag &= ~SDLYU; } /* * Unlock a virtual segment. */ vsunlock(base, count, rw) caddr_t base; { register struct pte *pte; register int npf; pte = vtopte(u.u_procp, btop(base)); npf = btoc(count + ((int)base & CLOFSET)); while (npf > 0) { munlock(pte->pg_pfnum); if (rw == B_READ) /* Reading from device writes memory */ pte->pg_m = 1; pte += CLSIZE; npf -= CLSIZE; } } @ijk-7:$ #&),/Q2i 6i /* vmdrum.c 4.3 81/03/08 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/buf.h" #include "../h/text.h" #include "../h/map.h" #include "../h/pte.h" #include "../h/vm.h" #include "../h/cmap.h" /* * Expand the swap area for both the data and stack segments. * If space is not available for both, retract and return 0. */ swpexpand(ds, ss, dmp, smp) size_t ds, ss; register struct dmap *dmp, *smp; { register struct dmap *tmp; register int ts; size_t ods; /* * If dmap isn't growing, do smap first. * This avoids anomalies if smap will try to grow and * fail, which otherwise would shrink ds without expanding * ss, a rather curious side effect! */ if (dmp->dm_alloc > ds) { tmp = dmp; ts = ds; dmp = smp; ds = ss; smp = tmp; ss = ts; } ods = dmp->dm_size; if (vsexpand(ds, dmp, 0) == 0) goto bad; if (vsexpand(ss, smp, 0) == 0) { (void) vsexpand(ods, dmp, 1); goto bad; } return (1); bad: u.u_error = ENOMEM; return (0); } /* * Expand or contract the virtual swap segment mapped * by the argument diskmap so as to just allow the given size. * * FOR NOW CANT RELEASE UNLESS SHRINKING TO ZERO, SINCE PAGEOUTS MAY * BE IN PROGRESS... TYPICALLY NEVER SHRINK ANYWAYS, SO DOESNT MATTER MUCH */ vsexpand(vssize, dmp, canshrink) register size_t vssize; register struct dmap *dmp; { register int blk = DMMIN; register int vsbase = 0; register swblk_t *ip = dmp->dm_map; size_t oldsize = dmp->dm_size; size_t oldalloc = dmp->dm_alloc; while (vsbase < oldalloc || vsbase < vssize) { if (vsbase >= oldalloc) { *ip = rmalloc(swapmap, ctod(blk)); if (*ip == 0) { dmp->dm_size = vsbase; if (vsexpand(oldsize, dmp, 1) == 0) panic("vsexpand"); return (0); } dmp->dm_alloc += blk; } else if (vssize == 0 || vsbase >= vssize && canshrink) { rmfree(swapmap, ctod(blk), *ip); *ip = 0; dmp->dm_alloc -= blk; } vsbase += blk; if (blk < DMMAX) blk *= 2; ip++; if (ip - dmp->dm_map > NDMAP) panic("vmdrum NDMAP"); } dmp->dm_size = vssize; return (1); } /* * Allocate swap space for a text segment, * in chunks of at most DMTEXT pages. */ vsxalloc(xp) struct text *xp; { register int blk; register swblk_t *dp; swblk_t vsbase; if (xp->x_size > NXDAD * DMTEXT) panic("vsxalloc"); dp = xp->x_daddr; for (vsbase = 0; vsbase < xp->x_size; vsbase += DMTEXT) { blk = xp->x_size - vsbase; if (blk > DMTEXT) blk = DMTEXT; if ((*dp++ = rmalloc(swapmap, blk)) == 0) { vsxfree(xp, vsbase); return (0); } } if (xp->x_flag & XPAGI) { xp->x_ptdaddr = rmalloc(swapmap, clrnd(ctopt(xp->x_size))); if (xp->x_ptdaddr == 0) { vsxfree(xp, xp->x_size); return (0); } } return (1); } /* * Free the swap space of a text segment which * has been allocated ts pages. */ vsxfree(xp, ts) struct text *xp; int ts; { register int blk; register swblk_t *dp; swblk_t vsbase; dp = xp->x_daddr; for (vsbase = 0; vsbase < ts; vsbase += DMTEXT) { blk = ts - vsbase; if (blk > DMTEXT) blk = DMTEXT; rmfree(swapmap, blk, *dp); *dp++ = 0; } if ((xp->x_flag&XPAGI) && xp->x_ptdaddr) { rmfree(swapmap, clrnd(ctopt(xp->x_size)), xp->x_ptdaddr); xp->x_ptdaddr = 0; } } /* * Swap a segment of virtual memory to disk, * by locating the contiguous dirty pte's * and calling vschunk with each chunk. */ vsswap(p, pte, type, vsbase, vscount, dmp) struct proc *p; register struct pte *pte; int type; register int vsbase, vscount; struct dmap *dmp; { register int size = 0; if (vscount % CLSIZE) panic("vsswap"); for (;;) { if (vscount == 0 || !dirtycl(pte)) { if (size) { vschunk(p, vsbase, size, type, dmp); vsbase += size; size = 0; } if (vscount == 0) return; vsbase += CLSIZE; if (pte->pg_fod == 0 && pte->pg_pfnum) if (type == CTEXT) p->p_textp->x_rssize -= vmemfree(pte, CLSIZE); else p->p_rssize -= vmemfree(pte, CLSIZE); } else { size += CLSIZE; mwait(pte->pg_pfnum); if (anycl(pte, pg_m)) zapcl(pte, pg_vreadm) = 1; } vscount -= CLSIZE; if (type == CSTACK) pte -= CLSIZE; else pte += CLSIZE; } } vschunk(p, base, size, type, dmp) register struct proc *p; register int base, size; int type; struct dmap *dmp; { register struct pte *pte; struct dblock db; unsigned v; if (type == CTEXT) { while (size > 0) { db.db_size = DMTEXT - base % DMTEXT; if (db.db_size > size) db.db_size = size; swap(p, p->p_textp->x_daddr[base/DMTEXT] + base%DMTEXT, ptob(tptov(p, base)), ctob(db.db_size), B_WRITE, 0, swapdev, 0); p->p_textp->x_rssize -= vmemfree(tptopte(p, base), db.db_size); base += db.db_size; size -= db.db_size; } return; } do { vstodb(base, size, dmp, &db, type == CSTACK); v = type==CSTACK ? sptov(p, base+db.db_size-1) : dptov(p, base); swap(p, db.db_base, ptob(v), ctob(db.db_size), B_WRITE, 0, swapdev, 0); pte = type==CSTACK ? sptopte(p, base+db.db_size-1) : dptopte(p, base); p->p_rssize -= vmemfree(pte, db.db_size); base += db.db_size; size -= db.db_size; } while (size != 0); } /* * Given a base/size pair in virtual swap area, * return a physical base/size pair which is the * (largest) initial, physically contiguous block. */ vstodb(vsbase, vssize, dmp, dbp, rev) register int vsbase, vssize; struct dmap *dmp; register struct dblock *dbp; { register int blk = DMMIN; register swblk_t *ip = dmp->dm_map; if (vsbase < 0 || vssize < 0 || vsbase + vssize > dmp->dm_size) panic("vstodb"); while (vsbase >= blk) { vsbase -= blk; if (blk < DMMAX) blk *= 2; ip++; } if (*ip + blk > nswap) panic("vstodb *ip"); dbp->db_size = imin(vssize, blk - vsbase); dbp->db_base = *ip + (rev ? blk - (vsbase + dbp->db_size) : vsbase); } /* * Convert a virtual page number * to its corresponding disk block number. * Used in pagein/pageout to initiate single page transfers. */ swblk_t vtod(p, v, dmap, smap) register struct proc *p; unsigned v; struct dmap *dmap, *smap; { struct dblock db; int tp; if (isatsv(p, v)(() { tp = vtotp(p, v); return (p->p_textp->x_daddr[tp/DMTEXT] + tp%DMTEXT); } if (isassv(p, v)) vstodb(vtosp(p, v), 1, smap, &db, 1); else vstodb(vtodp(p, v), 1, dmap, &db, 0); return (db.db_base); } @ikk0m$Q2i:6i /* TODO 4.10 81/04/15 */ 1. Minor - Put u.u_ttyd in proc structure and fix sys.c (/dev/tty) and chfile() - Turn the u. and kernel stack around and use a virtual hole as redzone - Hash the process groups in the proc table so wakeups are fast - Use pointers for process hashing, not indices. - Also use pointers in inode table. - Discard init code after boot. - Allocate spt at boot - Cleanup handling of file table. - Add child and sibling pointers in proc table. - Remove all linear searches of tables. - Deal with dh NXM problem - Test rm80 sse code - Find and fix ttrstrt problem - Why did up drive give i/o errors after uba reset when tape was hung? - Incorporate good stuff from ghg's system - Fix rpb autorestart - Handle sbi alert/fault - Get multi-porting code to work 2. Error logging/handling - Improve error logging, by adding a binary error log file - Write a user mode program to decipher the error log file - Log soft device errors and produce a dec-like error log - (cn,tn,sn) for disks; soft errors; ecc: pat, pos - Write a better analyze program more like sda 3. New stuff - File system (new data structures, new policies) - Vm primitives (segmentation, copy-on-write) - Ipc (fast datagrams, named pipes, vc stuff) - Local net support (chaosnet, etc.) - Incorporate bbn arpa net support - Project support - Sccs replacement 4. Benchmarking - Get hardware clock - Run jm's benchmarks - Run tracing experiments @ilk2$$P2iZo6i # # urem - unsigned remainder for vax-11 # # arguments: dividend, divisor # result: remainder # uses r0-r2 # # if 1 < divisor <= 2147483647, zero-extend the dividend # to 64 bits and let ediv do the work. If the divisor is 1, # ediv will overflow if bit 31 of the dividend is on, so # just return 0. If the divisor is 0, do the ediv also, # so it will generate the proper exception. All other values # of the divisor have bit 31 on: in this case the remainder # must be the dividend if divisor > dividend, and the dividend # minus the divisor otherwise. The comparison must be unsigned. # .text .align 1 .globl urem urem: .word 0x0000 movl 4(ap),r0 # Dividend movl 8(ap),r2 # Divisor jeql div # If divisor=0, force exception cmpl r2,$1 # If divisor <= 1 (signed), jleq nodiv # no division is necessary div: clrl r1 # Zero-extend the dividend ediv r2,r0,r2,r0 # Divide. q->r2 (discarded), r->r0 ret nodiv: jneq nzero # If divisor=1, return 0 clrl r0 # (because doing the divide will overflow ret # if the dividend has its high bit on) nzero: cmpl r0,r2 # If dividend < divisor (unsigned) jlssu retn # remainder is dividend subl2 r2,r0 # else remainder is dividend - divisor retn: ret @imk|$$}P2iZo6i # # udiv - unsigned division for vax-11 # # arguments: dividend, divisor. # result: quotient. # uses r0-r2 # # If 1 < divisor <= 2147483647, zero-extend the dividend # to 64 bits and let ediv do the work. If the divisor is 1, # ediv will overflow if bit 31 of the dividend is on, so # just return the dividend unchanged. If the divisor is 0, # do the ediv also, so it will generate the proper exception. # All other values of the divisor have bit 31 on: in this case # the quotient must be 0 if divisor > dividend, and 1 otherwise, # provided that the comparison is made as unsigned. # .text .align 1 .globl udiv udiv: .word 0x0000 movl 4(ap),r0 # Dividend movl 8(ap),r2 # Divisor jeql div # If divisor=0, force exception cmpl r2,$1 # If divisor <= 1 (signed), jleq nodiv # no division is necessary div: clrl r1 # Zero-extend the dividend ediv r2,r0,r0,r2 # Divide. q->r0, r->r2 (discarded) ret nodiv: jeql retn # If divisor=1, return dividend cmpl r0,r2 # Unsigned comparison between jgequ one # dividend and divisor clrl r0 # Dividend < divisor, return 0 ret one: movl $1,r0 # Dividend >= divisor, return 1 retn: ret ((@inkF$r P2i6i /* trap.c 4.10 81/07/09 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/reg.h" #include "../h/seg.h" #include "../h/trap.h" #include "../h/psl.h" #include "../h/pte.h" #include "../h/inline.h" #include "../h/mtpr.h" #define USER 040 /* user-mode flag added to type */ struct sysent sysent[128]; /* * Called from the trap handler when a processor trap occurs. */ /*ARGSUSED*/ trap(sp, type, code, pc, psl) unsigned code; { register int *locr0 = ((int *)&psl)-PS; register int i; register struct proc *p; time_t syst; syst = u.u_vm.vm_stime; if (USERMODE(locr0[PS])) { type |= USER; u.u_ar0 = locr0; } switch (type) { default: printf("trap type %d, code = %x, pc = %x\n", type, code, pc); panic("trap"); case PROTFLT + USER: /* protection fault */ i = SIGBUS; break; case PRIVINFLT + USER: /* privileged instruction fault */ case RESADFLT + USER: /* reserved addressing fault */ case RESOPFLT + USER: /* resereved operand fault */ u.u_code = type &~ USER; i = SIGILL; break; case ASTFLT + USER: /* Allow process switch */ astoff(); if ((u.u_procp->p_flag & SOWEUPC) && u.u_prof.pr_scale) { addupc(pc, &u.u_prof, 1); u.u_procp->p_flag &= ~SOWEUPC; } goto out; case ARITHTRAP + USER: u.u_code = code; i = SIGFPE; break; /* * If the user SP is above the stack segment, * grow the stack automatically. */ case SEGFLT + USER: if (grow((unsigned)locr0[SP]) || grow(code)) goto out; i = SIGSEGV; break; case TABLEFLT: /* allow page table faults in kernel mode */ case TABLEFLT + USER: /* page table fault */ panic("ptable fault"); case PAGEFLT: /* allow page faults in kernel mode */ case PAGEFLT + USER: /* page fault */ i = u.u_error; pagein(code); u.u_error = i; if (type == PAGEFLT) return; goto out; case BPTFLT + USER: /* bpt instruction fault */ case TRCTRAP + USER: /* trace trap */ locr0[PS] &= ~PSL_T; i = SIGTRAP; break; case XFCFLT + USER: /* xfc instruction fault */ i = SIGEMT; break; case COMPATFLT + USER: /* compatibility mode fault */ u.u_code = code; i = SIGILL; break; } psignal(u.u_procp, i); out: p = u.u_procp; if (p->p_cursig || ISSIG(p)) psig(); p->p_pri = p->p_usrpri; if (runrun) { /* * Since we are u.u_procp, clock will normally just change * our priority without moving us from one queue to another * (since the running process is not on a queue.) * If that happened after we setrq ourselves but before we * swtch()'ed, we might not be on the queue indicated by * our priority. */ (void) spl6(); setrq(p); swtch(); } if (u.u_prof.pr_scale && (syst -= u.u_vm.vm_stime)) addupc(locr0[PC], &u.u_prof, (int)-syst); curpri = p->p_pri; } /* * Called from the trap handler when a system call occurs */ /*ARGSUSED*/ syscall(sp, type, code, pc, psl) unsigned code; { register int *locr0 = ((int *)&psl)-PS; register caddr_t params; /* known to be r10 below */ register int i; /* known to be r9 below */ register struct sysent *callp; register struct proc *p; time_t syst; int opc; syst = u.u_vm.vm_stime; if (!USERMODE(locr0[PS])) panic("syscall"); u.u_ar0 = locr0; params = (caddr_t)locr0[AP] + NBPW; u.u_error = 0; opc = pc - 2; if (code > 63) opc -= 2; callp = &sysent[code&0177]; if (callp == sysent) { i = fuword(params); params += NBPW; callp = &sysent[i&0177]; } if (i = callp->sy_narg * sizeof (int)) { asm("prober $3,r9,(r10)"); /* GROT */ asm("bnequ ok"); /* GROT */ u.u_error = EFAULT; /* GROT */ goto bad; /* GROT */ asm("ok:"); /* GROT */ asm("movc3 r9,(r10),_u+U_ARG"); /* GROT */ } u.u_ap = u.u_arg; u.u_dirp = (caddr_t)u.u_arg[0]; u.u_r.r_val1 = 0; u.u_r.r_val2 = locr0[R1]; if (setjmp(u.u_qsav)) { if (u.u_error == 0 && u.u_eosys == JUSTRETURN) u.u_error = EINTR; } else { u.u_eosys = JUSTRETURN; (*(callp->sy_call))(); } locr0[PS] &= ~PSL_C; if (u.u_eosys == RESTARTSYS) pc = opc; else if (u.u_eosys == SIMULATERTI) dorti(); else if (u.u_error) { bad: locr0[R0] = u.u_error; locr0[PS] |= PSL_C; /* carry bit */ } else { locr0[R0] = u.u_r.r_val1; locr0[R1] = u.u_r.r_val2; } p = u.u_procp; if (p->p_cursig || ISSIG(p)) psig(); p->p_pri = p->p_usrpri; if (runrun) { /* * Since we are u.u_procp, clock will normally just change * our priority without moving us from one queue to another * (since the running process is not on a queue.) * If that happened after we setrq ourselves but before we * swtch()'ed, we might not be on the queue indicated by * our priority. */ (void) spl6(); setrq(p); swtch(); } if (u.u_prof.pr_scale && (syst -= u.u_vm.vm_stime)) addupc(locr0[PC], &u.u_prof, (int)-syst); curpri = p->p_pri; } /* * nonexistent system call-- set fatal error code. */ nosys() { u.u_error = 100; } /* * Ignored system call */ nullsys() { } @ipkk`$^P2i 6i /* text.c 4.5 81/03/08 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/map.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/text.h" #include "../h/inode.h" #include "../h/buf.h" #include "../h/seg.h" #include "../h/pte.h" #include "../h/mtpr.h" #include "../h/vm.h" #include "../h/cmap.h" /* * relinquish use of the shared text segment * of a process. */ xfree() { register struct text *xp; register struct inode *ip; if((xp=u.u_procp->p_textp) == NULL) return; xlock(xp); ip = xp->x_iptr; if(--xp->x_count==0 && (ip->i_mode&ISVTX)==0) { xunlink(u.u_procp); xp->x_rssize -= vmemfree(tptopte(u.u_procp, 0), u.u_tsize); if (xp->x_rssize != 0) panic("xfree rssize"); ip->i_flag &= ~ITEXT; if (ip->i_flag&ILOCK) ip->i_count--; else iput(ip); while (xp->x_poip) sleep((caddr_t)&xp->x_poip, PSWP+1); vsxfree(xp, xp->x_size); xp->x_flag &= ~XLOCK; xp->x_iptr = NULL; } else { xp->x_flag &= ~XLOCK; xccdec(xp, u.u_procp); } u.u_procp->p_textp = NULL; } /* * Attach to a shared text segment. * If there is no shared text, just return. * If there is, hook up to it: * if it is not currently being used, it has to be read * in from the inode (ip); the written bit is set to force it * to be written out as appropriate. * If it is being used, but is not currently in core, * a swap has to be done to get it back. */ xalloc(ip, pagi) register struct inode *ip; { register struct text *xp; register size_t ts; register struct text *xp1; if(u.u_exdata.ux_tsize == 0) return; again: xp1 = NULL; for (xp = text; xp < textNTEXT; xp++) { if(xp->x_iptr == NULL) { if(xp1 == NULL) xp1 = xp; continue; } if ((xp->x_count > 0 || (xp->x_iptr->i_mode&ISVTX)) && xp->x_iptr == ip) { if (xp->x_flag&XLOCK) { xwait(xp); goto again; } xlock(xp); xp->x_count++; u.u_procp->p_textp = xp; xlink(u.u_procp); xunlock(xp); return; } } if((xp=xp1) == NULL) { tablefull("text"); psignal(u.u_procp, SIGKILL); return; } xp->x_flag = XLOAD|XLOCK; if (pagi) xp->x_flag |= XPAGI; ts = clrnd(btoc(u.u_exdata.ux_tsize)); xp->x_size = ts; if (vsxalloc(xp) == NULL) { swkill(u.u_procp, "xalloc"); return; } xp->x_count = 1; xp->x_ccount = 0; xp->x_rssize = 0; xp->x_iptr = ip; ip->i_flag |= ITEXT; ip->i_count++; u.u_procp->p_textp = xp; xlink(u.u_procp); if (pagi == 0) { u.u_count = u.u_exdata.ux_tsize; u.u_offset = sizeof(u.u_exdata); u.u_base = 0; u.u_segflg = 2; settprot(RW); u.u_procp->p_flag |= SKEEP; readi(ip); u.u_procp->p_flag &= ~SKEEP; } settprot(RO); u.u_segflg = 0; xp->x_flag |= XWRIT; xp->x_flag &= ~XLOAD; xunlock(xp); } /* * Lock and unlock a text segment from swapping */ xlock(xp) register struct text *xp; { while(xp->x_flag&XLOCK) { xp->x_flag |= XWANT; sleep((caddr_t)xp, PSWP); } xp->x_flag |= XLOCK; } /* * Wait for xp to be unlocked if it is currently locked. */ xwait(xp) register struct text *xp; { xlock(xp); xunlock(xp); } xunlock(xp) reg((ister struct text *xp; { if (xp->x_flag&XWANT) wakeup((caddr_t)xp); xp->x_flag &= ~(XLOCK|XWANT); } /* * Decrement the in-core usage count of a shared text segment. * When it drops to zero, free the core space. */ xccdec(xp, p) register struct text *xp; register struct proc *p; { if (xp==NULL || xp->x_ccount==0) return; xlock(xp); if (--xp->x_ccount == 0) { if (xp->x_flag & XWRIT) { vsswap(p, tptopte(p, 0), CTEXT, 0, xp->x_size, (struct dmap *)0); if (xp->x_flag & XPAGI) swap(p, xp->x_ptdaddr, (caddr_t)tptopte(p, 0), xp->x_size * sizeof (struct pte), B_WRITE, B_PAGET, swapdev, 0); xp->x_flag &= ~XWRIT; } else xp->x_rssize -= vmemfree(tptopte(p, 0), xp->x_size); if (xp->x_rssize != 0) panic("text rssize"); } xunlink(p); xunlock(xp); } /* * free the swap image of all unused saved-text text segments * which are from device dev (used by umount system call). */ xumount(dev) register dev; { register struct text *xp; for (xp = text; xp < textNTEXT; xp++) if (xp->x_iptr!=NULL && dev==xp->x_iptr->i_dev) xuntext(xp); } /* * remove a shared text segment from the text table, if possible. */ xrele(ip) register struct inode *ip; { register struct text *xp; if ((ip->i_flag&ITEXT)==0) return; for (xp = text; xp < textNTEXT; xp++) if (ip==xp->x_iptr) xuntext(xp); } /* * remove text image from the text table. * the use count must be zero. */ xuntext(xp) register struct text *xp; { register struct inode *ip; xlock(xp); if (xp->x_count) { xunlock(xp); return; } ip = xp->x_iptr; xp->x_flag &= ~XLOCK; xp->x_iptr = NULL; vsxfree(xp, xp->x_size); ip->i_flag &= ~ITEXT; if (ip->i_flag&ILOCK) ip->i_count--; else iput(ip); } /* * Add a process to those sharing a text segment by * getting the page tables and then linking to x_caddr. */ xlink(p) register struct proc *p; { register struct text *xp = p->p_textp; if (xp == 0) return; vinitpt(p); p->p_xlink = xp->x_caddr; xp->x_caddr = p; xp->x_ccount++; } xunlink(p) register struct proc *p; { register struct text *xp = p->p_textp; register struct proc *q; if (xp == 0) return; if (xp->x_caddr == p) { xp->x_caddr = p->p_xlink; p->p_xlink = 0; return; } for (q = xp->x_caddr; q->p_xlink; q = q->p_xlink) if (q->p_xlink == p) { q->p_xlink = p->p_xlink; p->p_xlink = 0; return; } panic("lost text"); } /* * Replace p by q in a text incore linked list. * Used by vfork(), internally. */ xrepl(p, q) struct proc *p, *q; { register struct text *xp = q->p_textp; if (xp == 0) return; xunlink(p); q->p_xlink = xp->x_caddr; xp->x_caddr = q; } @iqk#$ O2i /* sysent.c 4.4 81/03/08 */ /* * This table is the switch used to transfer * to the appropriate routine for processing a system call. * Each row contains the number of arguments expected * and a pointer to the routine. */ #include "../h/param.h" #include "../h/systm.h" int alarm(); int chdir(); int chmod(); int chown(); int chroot(); int close(); int creat(); int dup(); int exec(); int exece(); int fork(); int fstat(); int getgid(); int getpid(); int getuid(); int gtime(); int gtty(); int ioctl(); int kill(); int link(); int mknod(); int mpxchan(); int nice(); int ftime(); int nosys(); int nullsys(); int open(); int pause(); int pipe(); int profil(); int ptrace(); int read(); int reboot(); int rexit(); int saccess(); int sbreak(); int seek(); int setgid(); int setpgrp(); int setuid(); int smount(); int ssig(); int stat(); int stime(); int stty(); int sumount(); int sync(); int sysacct(); int syslock(); int sysphys(); int times(); int umask(); int unlink(); int utime(); int wait(); int write(); #include "../h/vmsysent.h" struct sysent sysent[128] = { 0, nosys, /* 0 = indir */ 1, rexit, /* 1 = exit */ 0, fork, /* 2 = fork */ 3, read, /* 3 = read */ 3, write, /* 4 = write */ 2, open, /* 5 = open */ 1, close, /* 6 = close */ 0, wait, /* 7 = wait */ 2, creat, /* 8 = creat */ 2, link, /* 9 = link */ 1, unlink, /* 10 = unlink */ 2, exec, /* 11 = exec */ 1, chdir, /* 12 = chdir */ 0, gtime, /* 13 = time */ 3, mknod, /* 14 = mknod */ 2, chmod, /* 15 = chmod */ 3, chown, /* 16 = chown; now 3 args */ 1, sbreak, /* 17 = break */ 2, stat, /* 18 = stat */ 3, seek, /* 19 = seek */ 0, getpid, /* 20 = getpid */ 3, smount, /* 21 = mount */ 1, sumount, /* 22 = umount */ 1, setuid, /* 23 = setuid */ 0, getuid, /* 24 = getuid */ 1, stime, /* 25 = stime */ 4, ptrace, /* 26 = ptrace */ 1, alarm, /* 27 = alarm */ 2, fstat, /* 28 = fstat */ 0, pause, /* 29 = pause */ 2, utime, /* 30 = utime */ 2, stty, /* 31 = stty */ 2, gtty, /* 32 = gtty */ 2, saccess, /* 33 = access */ 1, nice, /* 34 = nice */ 1, ftime, /* 35 = ftime; formally sleep; */ 0, sync, /* 36 = sync */ 2, kill, /* 37 = kill */ 0, nullsys, /* 38 = switch; inoperative */ 2, setpgrp, /* 39 = setpgrp */ 0, nosys, /* 40 = tell - obsolete */ 2, dup, /* 41 = dup */ 0, pipe, /* 42 = pipe */ 1, times, /* 43 = times */ 4, profil, /* 44 = prof */ 0, nosys, /* 45 = tiu */ 1, setgid, /* 46 = setgid */ 0, getgid, /* 47 = getgid */ 2, ssig, /* 48 = sig */ 0, nosys, /* 49 = reserved for USG */ 0, nosys, /* 50 = reserved for USG */ 1, sysacct, /* 51 = turn acct off/on */ 3, sysphys, /* 52 = set user physical addresses */ 1, syslock, /* 53 = lock user in core */ 3, ioctl, /* 54 = ioctl */ 1, reboot, /* 55 = reboot */ 4, mpxchan, /* 56 = creat mpx comm channel */ 0, nosys, /* 57 = reserved for USG */ 0, nosys, /* 58 = reserved for USG */ 3, exece, /* 59 = exece */ 1, umask, /* 60 = umask */ 1, chroot, /* 61 = chroot */ 0, nosys, /* 62 = reserved to local sites */ 0, nosys, /* 63 = used internally */ #include "../sys/vmsysent.c" }; @irk%$(O2iUP6i /* sys4.c 4.10 81/07/22 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/reg.h" #include "../h/inode.h" #include "../h/proc.h" #include "../h/clock.h" #include "../h/mtpr.h" #include "../h/timeb.h" #include "../h/times.h" #include "../h/reboot.h" /* * Everything in this file is a routine implementing a system call. */ /* * return the current time (old-style entry) */ gtime() { u.u_r.r_time = time; if (clkwrap()) clkset(); } /* * New time entry-- return TOD with milliseconds, timezone, * DST flag */ ftime() { register struct a { struct timeb *tp; } *uap; struct timeb t; register unsigned ms; uap = (struct a *)u.u_ap; (void) spl7(); t.time = time; ms = lbolt; (void) spl0(); if (ms > hz) { ms -= hz; t.time++; } t.millitm = (1000*ms)/hz; t.timezone = timezone; t.dstflag = dstflag; if (copyout((caddr_t)&t, (caddr_t)uap->tp, sizeof(t)) < 0) u.u_error = EFAULT; if (clkwrap()) clkset(); } /* * Set the time */ st((ime() { register struct a { time_t time; } *uap; uap = (struct a *)u.u_ap; if(suser()) { bootime += uap->time - time; time = uap->time; clkset(); } } setuid() { register uid; register struct a { int uid; } *uap; uap = (struct a *)u.u_ap; uid = uap->uid; if(u.u_ruid == uid || u.u_uid == uid || suser()) { u.u_uid = uid; u.u_procp->p_uid = uid; u.u_ruid = uid; } } getuid() { u.u_r.r_val1 = u.u_ruid; u.u_r.r_val2 = u.u_uid; } setgid() { register gid; register struct a { int gid; } *uap; uap = (struct a *)u.u_ap; gid = uap->gid; if(u.u_rgid == gid || u.u_gid == gid || suser()) { u.u_gid = gid; u.u_rgid = gid; } } getgid() { u.u_r.r_val1 = u.u_rgid; u.u_r.r_val2 = u.u_gid; } getpid() { u.u_r.r_val1 = u.u_procp->p_pid; u.u_r.r_val2 = u.u_procp->p_ppid; } sync() { update(); } nice() { register n; register struct a { int niceness; } *uap; uap = (struct a *)u.u_ap; n = uap->niceness + u.u_procp->p_nice; if(n >= 2*NZERO) n = 2*NZERO -1; if(n < 0) n = 0; if (n < u.u_procp->p_nice && !suser()) return; u.u_procp->p_nice = n; (void) setpri(u.u_procp); /* IF RUNNING MAY HAVE WRONG p->p_pri, BUT WILL FIX ITSELF QUICKLY */ } /* * Unlink system call. * Hard to avoid races here, especially * in unlinking directories. */ unlink() { register struct inode *ip, *pp; struct a { char *fname; }; pp = namei(uchar, 2); if(pp == NULL) return; /* * Check for unlink(".") * to avoid hanging on the iget */ if (pp->i_number == u.u_dent.d_ino) { ip = pp; ip->i_count++; } else ip = iget(pp->i_dev, u.u_dent.d_ino); if(ip == NULL) goto out1; if((ip->i_mode&IFMT)==IFDIR && !suser()) goto out; /* * Don't unlink a mounted file. */ if (ip->i_dev != pp->i_dev) { u.u_error = EBUSY; goto out; } if (ip->i_flag&ITEXT) xrele(ip); /* try once to free text */ /* if ((ip->i_flag&ITEXT) && ip->i_nlink==1) { u.u_error = ETXTBSY; goto out; } */ u.u_offset -= sizeof(struct direct); u.u_base = (caddr_t)&u.u_dent; u.u_count = sizeof(struct direct); u.u_dent.d_ino = 0; writei(pp); ip->i_nlink--; ip->i_flag |= ICHG; out: iput(ip); out1: iput(pp); } chdir() { chdirec(&u.u_cdir); } chroot() { if (suser()) chdirec(&u.u_rdir); } chdirec(ipp) register struct inode **ipp; { register struct inode *ip; struct a { char *fname; }; ip = namei(uchar, 0); if(ip == NULL) return; if((ip->i_mode&IFMT) != IFDIR) { u.u_error = ENOTDIR; goto bad; } if(access(ip, IEXEC)) goto bad; prele(ip); if (*ipp) { plock(*ipp); iput(*ipp); } *ipp = ip; return; bad: iput(ip); } chmod() { register struct inode *ip; register struct a { char *fname; int fmode; } *uap; uap = (struct a *)u.u_ap; if ((ip = owner()) == NULL) return; ip->i_mode &= ~07777; if (u.u_uid) uap->fmode &= ~ISVTX; ip->i_mode |= uap->fmode&07777; ip->i_flag |= ICHG; if (ip->i_flag&ITEXT && (ip->i_mode&ISVTX)==0) xrele(ip); iput(ip); } chown() { register struct inode *ip; register struct a { char *fname; int uid; int gid; } *uap; uap = (struct a *)u.u_ap; if (!suser() || (ip = owner()) == NULL) return; ip->i_uid = uap->uid; ip->i_gid = uap->gid; ip->i_flag |= ICHG; #ifndef INSECURE ip->i_mode &= ~(ISUID|ISGID); #endif iput(ip); } ssig() { register int (*f)(); struct a { int signo; int (*fun)(); } *uap; register struct proc *p = u.u_procp; register a; long sigmask; uap = (struct a *)u.u_ap; a = uap->signo & SIGNUMMASK; f = uap->fun; if(a<=0 || a>=NSIG || a==SIGKILL || a==SIGSTOP || a==SIGCONT && (f == SIG_IGN || f == SIG_HOLD)) { u.u_error = EINVAL; return; } if ((uap->signo &~ SIGNUMMASK) || (f != SIG_DFL && f != SIG_IGN && SIGISDEFER(f))) u.u_procp->p_flag |= SNUSIG; /* * Don't clobber registers if we are to simulate * a ret+rti. */ if ((uap->signo&SIGDORTI) == 0) u.u_r.r_val1 = (int)u.u_signal[a]; /* * Change setting atomically. */ (void) spl6(); sigmask = 1L << (a-1); if (u.u_signal[a] == SIG_IGN) p->p_sig &= ~sigmask; /* never to be seen again */ u.u_signal[a] = f; if (f != SIG_DFL && f != SIG_IGN && f != SIG_HOLD) f = SIG_CATCH; if ((int)f & 1) p->p_siga0 |= sigmask; else p->p_siga0 &= ~sigmask; if ((int)f & 2) p->p_siga1 |= sigmask; else p->p_siga1 &= ~sigmask; (void) spl0(); /* * Now handle options. */ if (uap->signo & SIGDOPAUSE) { /* * Simulate a PDP11 style wait instrution which * atomically lowers priority, enables interrupts * and hangs. */ pause(); /*NOTREACHED*/ } if (uap->signo & SIGDORTI) u.u_eosys = SIMULATERTI; } kill() { register struct proc *p; register a, sig; register struct a { int pid; int signo; } *uap; int f, priv; uap = (struct a *)u.u_ap; f = 0; a = uap->pid; priv = 0; sig = uap->signo; if (sig < 0) /* * A negative signal means send to process group. */ uap->signo = -uap->signo; if (uap->signo == 0 || uap->signo > NSIG) { u.u_error = EINVAL; return; } if (a > 0 && sig > 0) { p = pfind(a); if (p == 0 || u.u_uid && u.u_uid != p->p_uid) { u.u_error = ESRCH; return; } psignal(p, uap->signo); return; } if (a==-1 && u.u_uid==0) { priv++; a = 0; sig = -1; /* like sending to pgrp */ } else if(a==0) { /* * Zero process id means send to my process group. */ sig = -1; a = u.u_procp->p_pgrp; if (a == 0) { u.u_error = EINVAL; return; } } for(p = proc; p < procNPROC; p++) { if(p->p_stat == NULL) continue; if(sig > 0) { if (p->p_pid != a) continue; } else if (p->p_pgrp!=a && priv==0 || p<=&proc[2] || (p->p_flag&SSYS) || (priv && p==u.u_procp)) continue; if(u.u_uid != 0 && u.u_uid != p->p_uid && (uap->signo != SIGCONT || !inferior(p))) continue; f++; psignal(p, uap->signo); } if(f == 0) u.u_error = ESRCH; } times() { register struct a { time_t (*times)[4]; } *uap; struct tms tms; tms.tms_utime = u.u_vm.vm_utime; tms.tms_stime = u.u_vm.vm_stime; tms.tms_cutime = u.u_cvm.vm_utime; tms.tms_cstime = u.u_cvm.vm_stime; uap = (struct a *)u.u_ap; if (copyout((caddr_t)&tms, (caddr_t)uap->times, sizeof(struct tms)) < 0) u.u_error = EFAULT; } profil() { register struct a { short *bufbase; unsigned bufsize; unsigned pcoffset; unsigned pcscale; } *uap; uap = (struct a *)u.u_ap; u.u_prof.pr_base = uap->bufbase; u.u_prof.pr_size = uap->bufsize; u.u_prof.pr_off = uap->pcoffset; u.u_prof.pr_scale = uap->pcscale; } /* * alarm clock signal */ alarm() { register struct proc *p; register c; register struct a { int deltat; } *uap; uap = (struct a *)u.u_ap; p = u.u_procp; c = p->p_clktim; p->p_clktim = uap->deltat; u.u_r.r_val1 = c; } /* * indefinite wait. * no one should wakeup(&u) */ pause() { for(;;) sleep((caddr_t)&u, PSLEP); } /* * mode mask for creation of files */ umask() { register struct a { int mask; } *uap; register t; uap = (struct a *)u.u_ap; t = u.u_cmask; u.u_cmask = uap->mask & 0777; u.u_r.r_val1 = t; } /* * Set IUPD and IACC times on file. * Can't set ICHG. */ utime() { register struct a { char *fname; time_t *tptr; } *uap; register struct inode *ip; time_t tv[2]; uap = (struct a *)u.u_ap; if ((ip = owner()) == NULL) return; if (copyin((caddr_t)uap->tptr, (caddr_t)tv, sizeof(tv))) { u.u_error = EFAULT; } else { ip->i_flag |= IACC|IUPD|ICHG; iupdat(ip, &tv[0], &tv[1], 0); } iput(ip); } /* * Setpgrp on specified process and its descendants. * Pid of zero implies current process. * Pgrp -1 is getpgrp system call returning * current process group. */ setpgrp() { register struct proc *top; register struct a { int pid; int pgrp; } *uap; uap = (struct a *)u.u_ap; if (uap->pid == 0) top = u.u_procp; else { top = pfind(uap->pid); if (top == 0) { u.u_error = ESRCH; return; } } if (uap->pgrp <= 0) { u.u_r.r_val1 = top->p_pgrp; return; } #ifdef notdef u.u_r.r_val1 = spgrp(top, uap->pgrp); if (u.u_r.r_val1 == 0) u.u_error = EPERM; #else if (top->p_uid != u.u_uid && u.u_uid && !inferior(top)) u.u_error = EPERM; else top->p_pgrp = uap->pgrp; #endif } spgrp(top, npgrp) register struct proc *top; { register struct proc *pp, *p; int f = 0; for (p = top; npgrp == -1 || u.u_uid == p->p_uid || !u.u_uid || inferior(p); p = pp) { if (npgrp == -1) { #define bit(a) (1<<(a-1)) p->p_sig &= ~(bit(SIGTSTP)|bit(SIGTTIN)|bit(SIGTTOU)); p->p_flag |= SDETACH; } else p->p_pgrp = npgrp; f++; /* * Search for children. */ for (pp = proc; pp < procNPROC; pp++) if (pp->p_pptr == p) goto cont; /* * Search for siblings. */ for (; p != top; p = p->p_pptr) for (pp = p + 1; pp < procNPROC; pp++) if (pp->p_pptr == p->p_pptr) goto cont; break; cont: ; } return (f); } /* * Is p an inferior of the current process? */ inferior(p) register struct proc *p; { for (; p != u.u_procp; p = p->p_pptr) if (p <= &proc[2]) return (0); return (1); } reboot() { register struct a { int opt; }; if (suser()) boot(RB_BOOT, ((struct a *)u.u_ap)->opt); } /* * lock user into core as much * as possible. swapping may still * occur if core grows. */@irk$$(O2iUP6i(( syslock() { register struct proc *p; register struct a { int flag; } *uap; uap = (struct a *)u.u_ap; if(suser()) { p = u.u_procp; p->p_flag &= ~SULOCK; if(uap->flag) p->p_flag |= SULOCK; } } @isk-$UN2i 6i /* sys3.c 4.9 81/03/08 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/mount.h" #include "../h/ino.h" #include "../h/reg.h" #include "../h/buf.h" #include "../h/filsys.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/inode.h" #include "../h/file.h" #include "../h/conf.h" #include "../h/stat.h" #include "../h/inline.h" /* * the fstat system call. */ fstat() { register struct file *fp; register struct a { int fdes; struct stat *sb; } *uap; uap = (struct a *)u.u_ap; fp = getf(uap->fdes); if(fp == NULL) return; stat1(fp->f_inode, uap->sb, fp->f_flag&FPIPE? fp->f_un.f_offset: 0); } /* * the stat system call. */ stat() { register struct inode *ip; register struct a { char *fname; struct stat *sb; } *uap; uap = (struct a *)u.u_ap; ip = namei(uchar, 0); if(ip == NULL) return; stat1(ip, uap->sb, (off_t)0); iput(ip); } /* * The basic routine for fstat and stat: * get the inode and pass appropriate parts back. */ stat1(ip, ub, pipeadj) register struct inode *ip; struct stat *ub; off_t pipeadj; { register struct dinode *dp; register struct buf *bp; struct stat ds; IUPDAT(ip, &time, &time, 0); /* * first copy from inode table */ ds.st_dev = ip->i_dev; ds.st_ino = ip->i_number; ds.st_mode = ip->i_mode; ds.st_nlink = ip->i_nlink; ds.st_uid = ip->i_uid; ds.st_gid = ip->i_gid; ds.st_rdev = (dev_t)ip->i_un.i_rdev; ds.st_size = ip->i_size - pipeadj; /* * next the dates in the disk */ bp = bread(ip->i_dev, itod(ip->i_number)); dp = bp->b_un.b_dino; dp += itoo(ip->i_number); ds.st_atime = dp->di_atime; ds.st_mtime = dp->di_mtime; ds.st_ctime = dp->di_ctime; brelse(bp); if (copyout((caddr_t)&ds, (caddr_t)ub, sizeof(ds)) < 0) u.u_error = EFAULT; } /* * the dup system call. */ dup() { register struct file *fp; register struct a { int fdes; int fdes2; } *uap; register i, m; uap = (struct a *)u.u_ap; m = uap->fdes & ~077; uap->fdes &= 077; fp = getf(uap->fdes); if(fp == NULL) return; if ((m&0100) == 0) { if ((i = ufalloc()) < 0) return; } else { i = uap->fdes2; if (i<0 || i>=NOFILE) { u.u_error = EBADF; return; } if (u.u_vrpages[i]) { u.u_error = ETXTBSY; return; } u.u_r.r_val1 = i; } if (i!=uap->fdes) { if (u.u_ofile[i]!=NULL) closef(u.u_ofile[i]); u.u_ofile[i] = fp; fp->f_count++; } } /* * the mount system call. */ smount() { dev_t dev; register struct inode *ip; register struct mount *mp; struct mount *smp; register struct filsys *fp; struct buf *bp; register struct a { char *fspec; char *freg; int ronly; } *uap; register char *cp; uap = (struct a *)u.u_ap; dev = getmdev(); if(u.u_error) return; u.u_dirp = (caddr_t)uap->freg; ip = namei(uchar, 0); if(ip == NULL) return; if(ip->i_count!=1 || (ip->i_mode&(IFBLK&IFCHR))!=0) goto out; smp = NULL; for(mp = &mount[0]; mp < &mount[NMOUNT]; mp++) { if(mp->m_bufp != NULL) { if(dev == mp->m_dev) goto out; } else if(smp == NULL) smp = mp; } mp = smp; if(mp == NULL) goto out; (*bdevsw[major(dev)].d_open)(dev, !uap->ronly); if(u.u_error) goto out; bp = bread(dev, SUPERB); if(u.u_error) { brelse(bp); goto out1; } mp->m_inodp = ip; mp->m_dev = dev; bp->b_flags |= B_LOCKED; mp->m_bufp = bp; fp = bp->b_un.b_filsys; fp->s_ilock = 0; fp->s_flock = 0; fp->s_ronly = uap->ronly & 1; fp->s_nbehind = 0; fp->s_lasti = 1; u.u_dirp = uap->freg; for (cp = fp->s_fsmnt; cp < &fp->s_fsmnt[sizeof (fp->s_fsmnt) - 1]; ) if ((*cp++ = uchar()) == 0) u.u_dirp--; /* get 0 again */ *cp = 0; brelse(bp); ip->i_flag |= IMOUNT; prele(ip); return; out: u.u_error = EBUSY; out1: iput(ip); } /* * the umount system call. */ sumount() { dev_t dev; register struct inode *ip; register struct mount *mp; struct buf *bp; int stillopen, flag; register struct a { char *fspec; }; dev = getmdev(); if(u.u_error) return; xumount(dev); /* remove unused sticky files from text table */ update(); for(mp = &mount[0]; mp < &mount[NMOUNT]; mp++) if(mp->m_bufp != NULL && dev == mp->m_dev) goto found; u.u_error = EINVAL; return; found: stillopen = 0; for(ip = inode; ip < inodeNINODE; ip++) if (ip->i_number != 0 && dev == ip->i_dev) { u.u_error = EBUSY; return; } else if (ip->i_number != 0 && (ip->i_mode&IFMT) == IFBLK && ip->i_un.i_rdev == dev) stillopen++; ip = mp->m_inodp; ip->i_flag &= ~IMOUNT; plock(ip); iput(ip); if ((bp = getblk(dev, SUPERB)) != mp->m_bufp) panic("umount"); bp->b_flags &= ~B_LOCKED; flag = !bp->b_un.b_filsys->s_ronly; mp->m_bufp = NULL; brelse(bp); mpurge(mp - &mount[0]); if (!stillopen) { (*bdevsw[major(dev)].d_close)(dev, flag); binval(dev); } } /* * Common code for mount and umount. * Check that the user's argument is a reasonable * thing on which to mount, and return the device number if so. */ dev_t getmdev() { dev_t dev; register struct inode *ip; if (!suser()) return(NODEV); ip = namei(uchar, 0); if(ip == NULL) return(NODEV); if((ip->i_mode&IFMT) != IFBLK) u.u_error = ENOTBLK; dev = (dev_t)ip->i_un.i_rdev; if(major(dev) >= nblkdev) u.u_error = ENXIO; iput(ip); return(dev); } @itko`T$"N2i@96i /* sys2.c 4.7 81/04/13 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/reg.h" #include "../h/file.h" #include "../h/inode.h" #include "../h/pte.h" #include "../h/vm.h" #include "../h/buf.h" #include "../h/mtpr.h" #include "../h/proc.h" #include "../h/inline.h" /* * READ AND WRITE ARE NEAR DUPLICATES OF EACH OTHER TO SAVE * AS MUCH TIME AS POSSIBLE. */ /* * read system call */ read() { register struct file *fp; register struct inode *ip; register struct a { int fdes; char *cbuf; unsigned count; } *uap; uap = (struct a *)u.u_ap; if ((int)uap->count < 0) { u.u_error = EINVAL; return; } GETF(fp, uap->fdes); if((fp->f_flag&FREAD) == 0) { u.u_error = EBADF; return; } u.u_base = (caddr_t)uap->cbuf; u.u_count = uap->count; u.u_segflg = 0; if ((u.u_procp->p_flag&SNUSIG) && setjmp(u.u_qsav)) { if (u.u_count == uap->count) u.u_eosys = RESTARTSYS; } else if((fp->f_flag&FPIPE) != 0) readp(fp); else { ip = fp->f_i((node; if (fp->f_flag&FMP) u.u_offset = 0; else u.u_offset = fp->f_un.f_offset; if((ip->i_mode&(IFCHR&IFBLK)) == 0) plock(ip); readi(ip); if((ip->i_mode&(IFCHR&IFBLK)) == 0) prele(ip); if ((fp->f_flag&FMP) == 0) fp->f_un.f_offset += uap->count-u.u_count; } u.u_r.r_val1 = uap->count-u.u_count; } /* * write system call */ write() { register struct file *fp; register struct inode *ip; register struct a { int fdes; char *cbuf; unsigned count; } *uap; uap = (struct a *)u.u_ap; if ((int)uap->count < 0) { u.u_error = EINVAL; return; } GETF(fp, uap->fdes); if((fp->f_flag&FWRITE) == 0) { u.u_error = EBADF; return; } u.u_base = (caddr_t)uap->cbuf; u.u_count = uap->count; u.u_segflg = 0; if ((u.u_procp->p_flag&SNUSIG) && setjmp(u.u_qsav)) { if (u.u_count == uap->count) u.u_eosys = RESTARTSYS; } else if((fp->f_flag&FPIPE) != 0) writep(fp); else { ip = fp->f_inode; if (fp->f_flag&FMP) u.u_offset = 0; else u.u_offset = fp->f_un.f_offset; if((ip->i_mode&(IFCHR&IFBLK)) == 0) plock(ip); writei(ip); if((ip->i_mode&(IFCHR&IFBLK)) == 0) prele(ip); if ((fp->f_flag&FMP) == 0) fp->f_un.f_offset += uap->count-u.u_count; } u.u_r.r_val1 = uap->count-u.u_count; } /* * common code for virtual read/write calls * check permissions, set base, count, and offset, * and switch out to readi, writei, or pipe code. */ vrdwr(mode) register mode; { register struct file *fp; register struct inode *ip; register struct pte *pte; int npf, n; register struct a { int fdes; char *cbuf; unsigned count; } *uap; uap = (struct a *)u.u_ap; if ((int)uap->count < 0) { u.u_error = EINVAL; return; } fp = getf(uap->fdes); if(fp == NULL) return; if((fp->f_flag&mode) == 0) { u.u_error = EBADF; return; } u.u_base = (caddr_t)uap->cbuf; u.u_count = uap->count; u.u_segflg = 0; if ((u.u_procp->p_flag&SNUSIG) && setjmp(u.u_qsav)) { if (u.u_count == uap->count) u.u_eosys = RESTARTSYS; } else if((fp->f_flag&FPIPE) != 0) { if(mode == FREAD) readp(fp); else writep(fp); } else { ip = fp->f_inode; if (fp->f_flag&FMP) u.u_offset = 0; else u.u_offset = fp->f_un.f_offset; if((ip->i_mode&IFMT)==IFREG) { if (((int)u.u_base & CLOFSET) || (fp->f_un.f_offset & CLOFSET)) { u.u_error = EINVAL; return; } if (!useracc(u.u_base, u.u_count, B_WRITE)) { u.u_error = EFAULT; return; } } if((ip->i_mode&(IFCHR&IFBLK)) == 0) plock(ip); if((ip->i_mode&IFMT)==IFREG) { pte = vtopte(u.u_procp, btop(u.u_base)); npf = clbase(btop((caddr_t)u.u_count)); if (mode == FWRITE) { for (n = npf; n > 0; n -= CLSIZE) { if (pte->pg_fod==0 && (anycl(pte,pg_vreadm) || anycl(pte, pg_m))) { u.u_count = NBPG * CLSIZE; pte->pg_vreadm = 0; if (anycl(pte, pg_m)) { pte->pg_swapm = 1; pte->pg_m = 0; } distcl(pte); tbiscl(btop(u.u_base)); writei(ip); } else { u.u_base += NBPG * CLSIZE; u.u_offset += NBPG * CLSIZE; } pte += CLSIZE; } u.u_count = uap->count - npf * NBPG; } else if (mode == FREAD && u.u_offset < ip->i_size) { npf = clbase(min((unsigned)npf, btop(ip->i_size - u.u_offset))); u.u_procp->p_rssize -= vmemfree(pte, npf); if (u.u_vrpages[uap->fdes] == 0) ip->i_vfdcnt++; vinifod((struct fpte *)pte, uap->fdes, ip, u.u_offset >> BSHIFT, npf); if (u.u_vrpages[uap->fdes] == 0) ip->i_vfdcnt--; n = npf * NBPG; u.u_base += n; u.u_offset += n; u.u_count -= n; } } if(mode == FREAD) readi(ip); else writei(ip); if((ip->i_mode&(IFCHR&IFBLK)) == 0) prele(ip); if ((fp->f_flag&FMP) == 0) fp->f_un.f_offset += uap->count-u.u_count; } u.u_r.r_val1 = uap->count-u.u_count; } /* * open system call */ open() { register struct inode *ip; register struct a { char *fname; int rwmode; } *uap; uap = (struct a *)u.u_ap; ip = namei(uchar, 0); if(ip == NULL) return; open1(ip, ++uap->rwmode, 0); } /* * creat system call */ creat() { register struct inode *ip; register struct a { char *fname; int fmode; } *uap; uap = (struct a *)u.u_ap; ip = namei(uchar, 1); if(ip == NULL) { if(u.u_error) return; ip = maknode(uap->fmode&07777&(~ISVTX)); if (ip==NULL) return; open1(ip, FWRITE, 2); } else open1(ip, FWRITE, 1); } /* * common code for open and creat. * Check permissions, allocate an open file structure, * and call the device open routine if any. */ open1(ip, mode, trf) register struct inode *ip; register mode; { register struct file *fp; int i; if(trf != 2) { if(mode&FREAD) (void) access(ip, IREAD); if(mode&FWRITE) { (void) access(ip, IWRITE); if((ip->i_mode&IFMT) == IFDIR) u.u_error = EISDIR; } } if(trf==1&&ip->i_vfdcnt) u.u_error = ETXTBSY; if(u.u_error) goto out; if(trf == 1) itrunc(ip); prele(ip); if ((fp = falloc()) == NULL) goto out; fp->f_flag = mode&(FREAD|FWRITE); fp->f_inode = ip; i = u.u_r.r_val1; openi(ip, mode&(FREAD|FWRITE)); if(u.u_error == 0) return; u.u_ofile[i] = NULL; fp->f_count--; out: iput(ip); } /* * close system call */ close() { register struct file *fp; register struct a { int fdes; } *uap; uap = (struct a *)u.u_ap; fp = getf(uap->fdes); if(fp == NULL) return; if (u.u_vrpages[uap->fdes]) { u.u_error = ETXTBSY; return; } u.u_ofile[uap->fdes] = NULL; closef(fp); } /* * seek system call */ seek() { register struct file *fp; register struct a { int fdes; off_t off; int sbase; } *uap; uap = (struct a *)u.u_ap; fp = getf(uap->fdes); if(fp == NULL) return; if(fp->f_flag&(FPIPE|FMP)) { u.u_error = ESPIPE; return; } if(uap->sbase == 1) uap->off += fp->f_un.f_offset; else if(uap->sbase == 2) uap->off += fp->f_inode->i_size; fp->f_un.f_offset = uap->off; u.u_r.r_off = uap->off; } /* * link system call */ link() { register struct inode *ip, *xp; register struct a { char *target; char *linkname; } *uap; uap = (struct a *)u.u_ap; ip = namei(uchar, 0); if(ip == NULL) return; if((ip->i_mode&IFMT)==IFDIR && !suser()) goto out1; ip->i_nlink++; ip->i_flag |= ICHG; iupdat(ip, &time, &time, 1); prele(ip); u.u_dirp = (caddr_t)uap->linkname; xp = namei(uchar, 1); if(xp != NULL) { u.u_error = EEXIST; iput(xp); goto out; } if (u.u_error) goto out; if(u.u_pdir->i_dev != ip->i_dev) { iput(u.u_pdir); u.u_error = EXDEV; goto out; } wdir(ip); out: if (u.u_error) { ip->i_nlink--; ip->i_flag |= ICHG; } out1: iput(ip); } /* * mknod system call */ mknod() { register struct inode *ip; register struct a { char *fname; int fmode; int dev; } *uap; uap = (struct a *)u.u_ap; if(suser()) { ip = namei(uchar, 1); if(ip != NULL) { u.u_error = EEXIST; goto out; } } if(u.u_error) return; ip = maknode(uap->fmode); if (ip == NULL) return; if (uap->dev) { /* * Want to be able to use this to make badblock * inodes, so don't truncate the dev number. */ ip->i_un.i_rdev = uap->dev; ip->i_flag |= IACC|IUPD|ICHG; } out: iput(ip); } /* * access system call */ saccess() { register svuid, svgid; register struct inode *ip; register struct a { char *fname; int fmode; } *uap; uap = (struct a *)u.u_ap; svuid = u.u_uid; svgid = u.u_gid; u.u_uid = u.u_ruid; u.u_gid = u.u_rgid; ip = namei(uchar, 0); if (ip != NULL) { if (uap->fmode&(IREAD>>6)) (void) access(ip, IREAD); if (uap->fmode&(IWRITE>>6)) (void) access(ip, IWRITE); if (uap->fmode&(IEXEC>>6)) (void) access(ip, IEXEC); iput(ip); } u.u_uid = svuid; u.u_gid = svgid; } @iuk)[*$D:`cfilorux{~M2i][6i /* sys1.c 4.12 81/04/28 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/map.h" #include "../h/mtpr.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/buf.h" #include "../h/reg.h" #include "../h/inode.h" #include "../h/seg.h" #include "../h/acct.h" #include "/usr/include/wait.h" #include "../h/pte.h" #include "../h/vm.h" #include "../h/text.h" #include "../h/psl.h" #include "../h/vlimit.h" #include "../h/file.h" /* * exec system call, with and without environments. */ struct execa { char *fname; char **argp; char **envp; }; exec() { ((struct execa *)u.u_ap)->envp = NULL; exece(); } exece() { register nc; register char *cp; register struct buf *bp; register struct execa *uap; int na, ne, ucp, ap, c; int indir, uid, gid; char *sharg; struct inode *ip; swblk_t bno; char cfname[DIRSIZ]; char cfarg[SHSIZE]; if ((ip = namei(uchar, 0)) == NULL) return; bno = 0; bp = 0; indir = 0; uid = u.u_uid; gid = u.u_gid; if (ip->i_mode & ISUID(() uid = ip->i_uid; if (ip->i_mode & ISGID) gid = ip->i_gid; again: if(access(ip, IEXEC)) goto bad; if((u.u_procp->p_flag&STRC) && access(ip, IREAD)) goto bad; if((ip->i_mode & IFMT) != IFREG || (ip->i_mode & (IEXEC|(IEXEC>>3)|(IEXEC>>6))) == 0) { u.u_error = EACCES; goto bad; } /* * Read in first few bytes of file for segment sizes, ux_mag: * 407 = plain executable * 410 = RO text * 413 = demand paged RO text * Also an ASCII line beginning with #! is * the file name of a ``shell'' and arguments may be prepended * to the argument list if given here. * * SHELL NAMES ARE LIMITED IN LENGTH. * * ONLY ONE ARGUMENT MAY BE PASSED TO THE SHELL FROM * THE ASCII LINE. */ u.u_base = (caddr_t)&u.u_exdata; u.u_count = sizeof(u.u_exdata); u.u_offset = 0; u.u_segflg = 1; readi(ip); u.u_segflg = 0; if(u.u_error) goto bad; if (u.u_count > sizeof(u.u_exdata) - sizeof(u.u_exdata.Ux_A) && u.u_exdata.ux_shell[0] != '#') { u.u_error = ENOEXEC; goto bad; } switch (u.u_exdata.ux_mag) { case 0407: u.u_exdata.ux_dsize += u.u_exdata.ux_tsize; u.u_exdata.ux_tsize = 0; break; case 0413: case 0410: if (u.u_exdata.ux_tsize == 0) { u.u_error = ENOEXEC; goto bad; } break; default: if (u.u_exdata.ux_shell[0] != '#' || u.u_exdata.ux_shell[1] != '!' || indir) { u.u_error = ENOEXEC; goto bad; } cp = &u.u_exdata.ux_shell[2]; /* skip "#!" */ while (cp < &u.u_exdata.ux_shell[SHSIZE]) { if (*cp == '\t') *cp = ' '; else if (*cp == '\n') { *cp = '\0'; break; } cp++; } if (*cp != '\0') { u.u_error = ENOEXEC; goto bad; } cp = &u.u_exdata.ux_shell[2]; while (*cp == ' ') cp++; u.u_dirp = cp; while (*cp && *cp != ' ') cp++; sharg = NULL; if (*cp) { *cp++ = '\0'; while (*cp == ' ') cp++; if (*cp) { bcopy((caddr_t)cp, (caddr_t)cfarg, SHSIZE); sharg = cfarg; } } bcopy((caddr_t)u.u_dbuf, (caddr_t)cfname, DIRSIZ); indir = 1; iput(ip); ip = namei(schar, 0); if (ip == NULL) return; goto again; } /* * Collect arguments on "file" in swap space. */ na = 0; ne = 0; nc = 0; uap = (struct execa *)u.u_ap; if ((bno = rmalloc(argmap, ctod(clrnd((int) btoc(NCARGS))))) == 0) { swkill(u.u_procp, "exece"); goto bad; } if (bno % CLSIZE) panic("execa rmalloc"); if (uap->argp) for (;;) { ap = NULL; if (indir && (na == 1 || na == 2 && sharg)) ap = (int)uap->fname; else if (uap->argp) { ap = fuword((caddr_t)uap->argp); uap->argp++; } if (ap==NULL && uap->envp) { uap->argp = NULL; if ((ap = fuword((caddr_t)uap->envp)) == NULL) break; uap->envp++; ne++; } if (ap==NULL) break; na++; if(ap == -1) u.u_error = EFAULT; do { if (nc >= NCARGS-1) u.u_error = E2BIG; if (indir && na == 2 && sharg != NULL) c = *sharg++ & 0377; else if ((c = fubyte((caddr_t)ap++)) < 0) u.u_error = EFAULT; if (u.u_error) { if (bp) brelse(bp); bp = 0; goto badarg; } if ((nc&BMASK) == 0) { if (bp) bdwrite(bp); bp = getblk(argdev, (daddr_t)(dbtofsb(bno)+(nc>>BSHIFT))); cp = bp->b_un.b_addr; } nc++; *cp++ = c; } while (c>0); } if (bp) bdwrite(bp); bp = 0; nc = (nc + NBPW-1) & ~(NBPW-1); if (indir) bcopy((caddr_t)cfname, (caddr_t)u.u_dbuf, DIRSIZ); getxfile(ip, nc + (na+4)*NBPW, uid, gid); if (u.u_error) { badarg: for (c = 0; c < nc; c += BSIZE) if (bp = baddr(argdev, dbtofsb(bno)+(c>>BSHIFT))) { bp->b_flags |= B_AGE; /* throw away */ bp->b_flags &= ~B_DELWRI; /* cancel io */ brelse(bp); bp = 0; } goto bad; } /* * copy back arglist */ ucp = USRSTACK - nc - NBPW; ap = ucp - na*NBPW - 3*NBPW; u.u_ar0[SP] = ap; (void) suword((caddr_t)ap, na-ne); nc = 0; for (;;) { ap += NBPW; if (na==ne) { (void) suword((caddr_t)ap, 0); ap += NBPW; } if (--na < 0) break; (void) suword((caddr_t)ap, ucp); do { if ((nc&BMASK) == 0) { if (bp) brelse(bp); bp = bread(argdev, (daddr_t)(dbtofsb(bno)+(nc>>BSHIFT))); bp->b_flags |= B_AGE; /* throw away */ bp->b_flags &= ~B_DELWRI; /* cancel io */ cp = bp->b_un.b_addr; } (void) subyte((caddr_t)ucp++, (c = *cp++)); nc++; } while(c&0377); } (void) suword((caddr_t)ap, 0); (void) suword((caddr_t)ucp, 0); setregs(); bad: if (bp) brelse(bp); if (bno) rmfree(argmap, ctod(clrnd((int) btoc(NCARGS))), bno); iput(ip); } /* * Read in and set up memory for executed file. */ getxfile(ip, nargc, uid, gid) register struct inode *ip; { register size_t ts, ds, ss; int pagi; if (u.u_exdata.ux_mag == 0413) pagi = SPAGI; else pagi = 0; if(u.u_exdata.ux_tsize!=0 && (ip->i_flag&ITEXT)==0 && ip->i_count!=1) { register struct file *fp; for (fp = file; fp < fileNFILE; fp++) if (fp->f_inode == ip && (fp->f_flag&FWRITE)) { u.u_error = ETXTBSY; goto bad; } } /* * find text and data sizes * try them out for possible * exceed of max sizes */ ts = clrnd(btoc(u.u_exdata.ux_tsize)); ds = clrnd(btoc((u.u_exdata.ux_dsize+u.u_exdata.ux_bsize))); ss = clrnd(SSIZE + btoc(nargc)); if (chksize(ts, ds, ss)) goto bad; u.u_cdmap = zdmap; u.u_csmap = zdmap; if (swpexpand(ds, ss, &u.u_cdmap, &u.u_csmap) == NULL) goto bad; /* * At this point, committed to the new image! * Release virtual memory resources of old process, and * initialize the virtual memory of the new process. * If we resulted from vfork(), instead wakeup our * parent who will set SVFDONE when he has taken back * our resources. */ u.u_prof.pr_scale = 0; if ((u.u_procp->p_flag & SVFORK) == 0) vrelvm(); else { u.u_procp->p_flag &= ~SVFORK; u.u_procp->p_flag |= SKEEP; wakeup((caddr_t)u.u_procp); while ((u.u_procp->p_flag & SVFDONE) == 0) sleep((caddr_t)u.u_procp, PZERO - 1); u.u_procp->p_flag &= ~(SVFDONE|SKEEP); } u.u_procp->p_flag &= ~(SPAGI|SSEQL|SUANOM|SNUSIG); u.u_procp->p_flag |= pagi; u.u_dmap = u.u_cdmap; u.u_smap = u.u_csmap; vgetvm(ts, ds, ss); if (pagi == 0) { /* * Read in data segment. */ u.u_base = (char *)ctob(ts); u.u_offset = sizeof(u.u_exdata)+u.u_exdata.ux_tsize; u.u_count = u.u_exdata.ux_dsize; readi(ip); } xalloc(ip, pagi); if (pagi && u.u_procp->p_textp) vinifod((struct fpte *)dptopte(u.u_procp, 0), PG_FTEXT, u.u_procp->p_textp->x_iptr, 1 + ts/CLSIZE, (int)btoc(u.u_exdata.ux_dsize)); /* THIS SHOULD BE DONE AT A LOWER LEVEL, IF AT ALL */ mtpr(TBIA, 0); /* * set SUID/SGID protections, if no tracing */ if ((u.u_procp->p_flag&STRC)==0) { #ifndef MELB if(u.u_uid != 0) #endif { u.u_uid = uid; u.u_procp->p_uid = uid; } u.u_gid = gid; } else psignal(u.u_procp, SIGTRAP); u.u_tsize = ts; u.u_dsize = ds; u.u_ssize = ss; bad: return; } /* * Clear registers on exec */ setregs() { register int (**rp)(); register i; long sigmask; for(rp = &u.u_signal[0], sigmask = 1L; rp < &u.u_signal[NSIG]; sigmask <<= 1, rp++) { switch (*rp) { case SIG_IGN: case SIG_DFL: case SIG_HOLD: continue; default: /* * Normal or deferring catch; revert to default. */ (void) spl6(); *rp = SIG_DFL; if ((int)*rp & 1) u.u_procp->p_siga0 |= sigmask; else u.u_procp->p_siga1 &= ~sigmask; if ((int)*rp & 2) u.u_procp->p_siga1 |= sigmask; else u.u_procp->p_siga1 &= ~sigmask; (void) spl0(); continue; } } /* for(rp = &u.u_ar0[0]; rp < &u.u_ar0[16];) *rp++ = 0; */ u.u_ar0[PC] = u.u_exdata.ux_entloc + 2; /* skip over entry mask */ for(i=0; irval & 0377) << 8); } /* * Release resources. * Save u. area for parent to look at. * Enter zombie state. * Wake up parent and init processes, * and dispose of children. */ exit(rv) { register int i; register struct proc *p, *q; register struct file *f; register int x; #ifdef PGINPROF vmsizmon(); #endif p = u.u_procp; p->p_flag &= ~(STRC|SULOCK); p->p_flag |= SWEXIT; p->p_clktim = 0; (void) spl6(); if ((int)SIG_IGN & 1) p->p_siga0 = ~0; else p->p_siga0 = 0; if ((int)SIG_IGN & 2) p->p_siga1 = ~0; else p->p_siga1 = 0; (void) spl0(); p->p_cpticks = 0; p->p_pctcpu = 0; for(i=0; ip_flag & SVFORK) == 0) vrelvm(); else { p->p_flag &= ~SVFORK; wakeup((caddr_t)p); while ((p->p_flag & SVFDONE) == 0) sleep((caddr_t)p, PZERO - 1); p->p_flag &= ~SVFDONE; } for(i=0; ip_stat = SZOMB; noproc = 1; i = PIDHASH(p->p_pid); x = p - proc; if (pidhash[i] == x) pidhash[i] = p->p_idhash; else { for (i = pidhash[i]; i != 0; i = proc[i].p_idhash) if (proc[i].p_idhash == x) { proc[i].p_idhash = p->p_idhash; goto done; } panic("exit"); } if (p->p_pid == 1) panic("init died"); done: ((struct xproc *)p)->xp_xstat = rv; /* overlay */ ((struct xproc *)p)->xp_vm = u.u_vm; /* overlay */ vmsadd(&((struct xproc *)p)->xp_vm, &u.u_cvm); for(q = proc; q < procNPROC; q++) if(q->p_pptr == p) { q->p_pptr = &proc[1]; q->p_ppid = 1; wakeup((caddr_t)&proc[1]); /* * Traced processes are killed * since their existence means someone is screwing up. * Stopped processes are sent a hangup and a continue. * This is designed to be ``safe'' for setuid * processes since they must be willing to tolerate * hangups anyways. */ if (q->p_flag&STRC) { q->p_flag &= ~STRC; psignal(q, SIGKILL); } else if (q->p_stat == SSTOP) { psignal(q, SIGHUP); psignal(q, SIGCONT); } /* * Protect this process from future * tty signals, clear TSTP/TTIN/TTOU if pending, * and set SDETACH bit on procs. */ (void) spgrp(q, -1); } wakeup((caddr_t)p->p_pptr); psignal(p->p_pptr, SIGCHLD); swtch(); } wait() { struct vtimes vm; struct vtimes *vp; if ((u.u_ar0[PS] & PSL_ALLCC) != PSL_ALLCC) { wait1(0, (struct vtimes *)0); return; } vp = (struct vtimes *)u.u_ar0[R1]; wait1(u.u_ar0[R0], &vm); if (u.u_error) return; (void) copyout((caddr_t)&vm, (caddr_t)vp, sizeof (struct vtimes)); } /* * Wait system call. * Search for a terminated (zombie) child, * finally lay it to rest, and collect its status. * Look also for stopped (traced) children, * and pass back status from them. */ wait1(options, vp) register options; struct vtimes *vp; { register f; register struct proc *p; f = 0; loop: for(p = proc; p < procNPROC; p++) if(p->p_pptr == u.u_procp) { f++; if(p->p_stat == SZOMB) { u.u_r.r_val1 = p->p_pid; u.u_r.r_val2 = ((struct xproc *)p)->xp_xstat; ((struct xproc *)p)->xp_xstat = 0; if (vp) *vp = ((struct xproc *)p)->xp_vm; vmsadd(&u.u_cvm, &((struct xproc *)p)->xp_vm); ((struct xproc *)p)->xp_vm = zvms; p->p_stat = NULL; p->p_pid = 0; p->p_ppid = 0; p->p_pptr = 0; p->p_sig = 0; p->p_siga0 = 0; p->p_siga1 = 0; p->p_pgrp = 0; p->p_flag = 0; p->p_wchan = 0; p->p_cursig = 0; return; } if (p->p_stat == SSTOP && (p->p_flag&SWTED)==0 && (p->p_flag&STRC || options&WUNTRACED)) { p->p_flag |= SWTED; u.u_r.r_val1 = p->p_pid; u.u_r.r_val2 = (p->p_cursig<<8) | WSTOPPED; return; } } if (f==0) { u.u_error = ECHILD; return; } if (options&WNOHANG) { u.u_r.r_val1 = 0; return; } if ((u.u_procp->p_flag&SNUSIG) && setjmp(u.u_qsav)) { u.u_eosys = RESTARTSYS; return; } sleep((caddr_t)u.u_procp, PWAIT); goto loop; } /* * fork system call. */ fork() { u.u_cdmap = zdmap; u.u_csmap = zdmap; if (swpexpand(u.u_dsize, u.u_ssize, &u.u_cdmap, &u.u_csmap) == 0) { u.u_r.r_val2 = 0; return; } fork1(0); } fork1(isvfork) { register struct proc *p1, *p2; register a; a = 0; p2 = NULL; for(p1 = proc; p1 < procNPROC; p1++) { if (p1->p_stat==NULL && p2==NULL) p2 = p1; else { if (p1->p_uid==u.u_uid && p1->p_stat!=NULL) a++; } } /* * Disallow if * No processes at all; * not su and too many procs owned; or * not su and would take last slot. */ if (p2==NULL) tablefull("proc"); if (p2==NULL || (u.u_uid!=0 && (p2==procNPROC-1 || a>MAXUPRC))) { u.u_error = EAGAIN; if (!isvfork) { (void) vsexpand(0, &u.u_cdmap, 1); (void) vsexpand(0, &u.u_csmap, 1); } goto out; } p1 = u.u_procp; if(newproc(isvfork)) { u.u_r.r_val1 = p1->p_pid; u.u_r.r_val2 = 1; /* child */ u.u_start = time; u.u_acflag = AFORK; return; } u.u_r.r_val1 = p2->p_pid; out: u.u_r.r_val2 = 0; } /* * break system call. * -- bad planning: "break" is a dirty word in C. */ sbreak() { struct a { char *nsiz; }; register int n, d; /* * set n to new data size * set d to new-old */ n = btoc(((struct a *)u.u_ap)->nsiz); if (!u.u_sep) n -= ctos(u.u_tsize) * stoc(1); if (n < 0) n = 0; d = clrnd(n - u.u_dsize); if (ctob(u.u_dsize+d) > u.u_limit[LIM_DATA]) { u.u_error = ENOMEM; return; } if (chksize(u.u_tsize, u.u_dsize+d, u.u_ssize)) return; if (swpexpand(u.u_dsize+d, u.u_ssize, &u.u_dmap, &u.u_smap)==0) return; expand(d, P0BR); } @ivkz$]L2i 6i /* sys.c 4.3 81/03/08 */ /* * Indirect driver for controlling tty. */ #include "../h/param.h" #include "../h/systm.h" #include "../h/conf.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/tty.h" #include "../h/proc.h" /*ARGSUSED*/ syopen(dev, flag) { if(u.u_ttyp == NULL || (u.u_procp->p_flag&SDETACH)) { u.u_error = ENXIO; return; } (*cdevsw[major(u.u_ttyd)].d_open)(u.u_ttyd, flag); } /*ARGSUSED*/ syread(dev) { if (u.u_procp->p_flag&SDETACH) { u.u_error = ENXIO; return; } (*cdevsw[major(u.u_ttyd)].d_read)(u.u_ttyd); } /*ARGSUSED*/ sywrite(dev) { if (u.u_procp->p_flag&SDETACH) { u.u_error = ENXIO; return; } (*cdevsw[major(u.u_ttyd)].d_write)(u.u_ttyd); } /*ARGSUSED*/ syioctl(dev, cmd, addr, flag) caddr_t addr; { if (u.u_procp->p_flag&SDETACH) { u.u_error = ENXIO; return; } (*cdevsw[major(u.u_ttyd)].d_ioctl)(u.u_ttyd, cmd, addr, flag); } @iwk%ZL2i6i _Usrptmap _avenrun _bootime _ccpu _cons _cp_time _deficit _dh11 _dk_busy _dk_mspw _dk_seek _dk_time _dk_wds _dk_xfer _dz_cnt _dz_tty _ecmx _file _firstfree _forkstat _inode _maxfree _maxslp _msgbuf _ndh11 _nswap _proc _rate _sum _swapdev _swapmap _text _tk_nin _tk_nout _total _usrpt _version @ixkLWL2iV[6i ((# symbols.raw 4.4 81/05/03 _version #dmesg _msgbuf #iostat _dk_busy _dk_time _dk_xfer _dk_wds _tk_nin _tk_nout _dk_seek _cp_time _dk_mspw # _io_info #ps _proc _Usrptmap _usrpt _text _nswap _maxslp _ccpu _ecmx #pstat _inode _text _proc _dz_tty _dz_cnt _cons _file _Usrptmap _usrpt _nswap _swapmap # _dh11 # _ndh11 #vmstat _cp_time _rate _total _deficit _forkstat _sum _firstfree _maxfree # _rectime # _pgintime _dk_xfer _bootime #w _proc _swapdev _Usrptmap _usrpt _nswap _avenrun _bootime @iyk %Z{cu`v<<<  ,^Юn PPՀPpPP P1d׬լЬP`JP׬լЬP`*P׬լЬP` Po׬bXZH>ݏD eP3Pďď}P1*PݏIm|kPPPݏP:IBPPP7PP,ݏW_ VP*ǏPPݏ[&ݏkFP(ǏPPݏrݏy1ݏ1Ь[ZYk94 ZPQPQ0QZY[[kPP P P+P-k0YZPZP [P@X[ݬQPZZݬt[$P[P 0@Xb|$0BQap".AError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too largex\~ݬoPP Ь[ZZZP   !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBd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1ЫXZԫl[ZPZPЬ[[^Ь[xTPxPP/P QQ`WЫTYXWxYZ[PΫlPPѬZP)ѬZPѬ  ZPPPɬZPPP<ݭ[52 ݏ[.ЫXlݏ[Ь[ݏ[Ь[YZdXX PѬ Ѭ ((l1)[QPYl1Y1YPP1Ѭ ѬɏPPu1g1 dXX PY Y[i_dev; rablock = 0; /* * blocks 0..NADDR-4 are direct blocks */ if(bn < NADDR-3) { i = bn; nb = ip->i_un.i_addr[i]; if(nb == 0) { if(rwflg==B_READ || (bp = alloc(dev))==NULL) return((daddr_t)-1); nb = dbtofsb(bp->b_blkno); if ((ip->i_mode&IFMT) == IFDIR) /* * Write directory blocks synchronously * so they never appear with garbage in * them on the disk. */ bwrite(bp); else bdwrite(bp); ip->i_un.i_addr[i] = nb; ip->i_flag |= IUPD|ICHG; } if(i < NADDR-4) rablock = ip->i_un.i_addr[i+1]; return(nb); } /* * addresses NADDR-3, NADDR-2, and NADDR-1 * have single, double, triple indirect blocks. * the first step is to determine * how many levels of indirection. */ sh = 0; nb = 1; bn -= NADDR-3; for(j=3; j>0; j--) { sh += NSHIFT; nb <<= NSHIFT; if(bn < nb) break; bn -= nb; } if(j == 0) { u.u_error = EFBIG; return((daddr_t)0); } /* * fetch the first indirect block */ nb = ip->i_un.i_addr[NADDR-j]; if(nb == 0) { if(rwflg==B_READ || (bp = alloc(dev))==NULL) return((daddr_t)-1); nb = dbtofsb(bp->b_blkno); /* * Write synchronously so that indirect blocks * never point at garbage. */ bwrite(bp); ip->i_un.i_addr[NADDR-j] = nb; ip->i_flag |= IUPD|ICHG; } /* * fetch through the indirect blocks */ for(; j<=3; j++) { bp = bread(dev, nb); if(bp->b_flags & B_ERROR) { brelse(bp); return((daddr_t)0); } bap = bp->b_un.b_daddr; sh -= NSHIFT; i = (bn>>sh) & NMASK; nb = bap[i]; if(nb == 0) { if(rwflg==B_READ || (nbp = alloc(dev))==NULL) { brelse(bp); return((daddr_t)-1); } nb = dbtofsb(nbp->b_blkno); if (j < 3 || (ip->i_mode&IFMT) == IFDIR) /* * Write synchronously so indirect blocks * never point at garbage and blocks * in directories never contain garbage. */ bwrite(nbp); else bdwrite(nbp); bap[i] = nb; bdwrite(bp); } else brelse(bp); } /* * calculate read-ahead. */ if(i < NINDIR-1) rablock = bap[i+1]; return(nb); } /* * Pass back c to the user at his location u_base; * update u_base, u_count, and u_offset. Return -1 * on the last character of the user's read. * u_base is in the user address space unless u_segflg is set. */ passc(c) register c; { register id; if((id = u.u_segflg) == 1) *u.u_base = c; else if(id?suibyte(u.u_base, c):subyte(u.u_base, c) < 0) { u.u_error = EFAULT; return(-1); } u.u_count--; u.u_offset++; u.u_base++; return(u.u_count == 0? -1: 0); } #include "ct.h" /* * Pick up and return the next character from the user's * write call at location u_base; * update u_base, u_count, and u_offset. Return -1 * when u_count is exhausted. u_base is in the user's * address space unless u_segflg is set. */ cpass() { register c, id; if(u.u_count == 0) return(-1); if((id = u.u_segflg) == 1) c = *u.u_base; else if((c = id==0?fubyte(u.u_base):fuibyte(u.u_base)) < 0) { u.u_error = EFAULT; return(-1); } u.u_count--; u.u_offset++; u.u_base++; return(c&0377); } /* * Routine which sets a user error; placed in * illegal entries in the bdevsw and cdevsw tables. */ nodev() { u.u_error = ENODEV; } /* * Null routine; placed in insignificant entries * in the bdevsw and cdevsw tables. */ nulldev() { } imin(a, b) { ((return (a < b ? a : b); } imax(a, b) { return (a > b ? a : b); } struct proc * pfind(pid) int pid; { register struct proc *p; for (p = &proc[pidhash[PIDHASH(pid)]]; p != &proc[0]; p = &proc[p->p_idhash]) if (p->p_pid == pid) return (p); return ((struct proc *)0); } @iGkA4 < root::0:10:Ernie Co-vax,508JE,0204:/:/bin/csh daemon:*:1:1:The devil himself:/: sklower:8PYh/dUBQT9Ss:2:10:Keith &,524E,4972,8416222:/usr/guest:/bin/csh schmidt:FH83PFo4z55cU:7:10:Eric &,473E,4951,8491755:/usr/guest:/bin/csh wnj:p4H8s/ulDMb7w:8:10:Bill Joy,457E,4948,4155244510:/usr/guest:/bin/csh tbl:cBWEbG59spEmM:10:10:Tom London,2019492006:/usr/guest: jfr:1VYjUQK34CHUg:11:10:JFReiser:/usr/guest: mark:Pb1AmSpsVPG0Y:12:10:& Horton,529bE,4948,5240633:/usr/guest:/bin/csh ozalp:m5syt3.lB5LAE:40:10:& Babaoglu,543E,9955,5484321:/usr/guest:/bin/csh dmr:gfVwhuAMF0Trw:42:10:Dennis Ritchie:/usr/guest: sam:I.12lT2uSLcXY:43:10:& Leffler:/usr/guest:/bin/csh shannon:2hxVRsZVW1oHg:48:10:Bill Shannon:/usr/guest:/bin/csh aps:HqHepvZSyBs0Q:26:10:Armando Stettner:/usr/guest:/bin/csh ken:sq5UDrPlKj1nA:52:10:& Thompson:/usr/guest: uucp:P0CHBwE/mB51k:66:10:UNIX-to-UNIX Copy:/usr/spool/uucppublic:/usr/lib/uucp/uucico @iIk e J*agZiȪ 14console 12tty00 12tty01 12tty02 12tty03 12tty04 12tty05 12tty06 12tty07 @iKkHd k-agiȪ dw console vt100 tty00 vt100 tty01 vt100 tty02 vt100 tty03 vt100 tty04 vt100 tty05 vt100 tty06 vt100 tty07 @iMk*P %Ni Wed May 20 15:18:54 PDT 1981 @iOktg$ 0369<?BEd L2iI6i ((/* slp.c 4.14 81/06/11 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/file.h" #include "../h/inode.h" #include "../h/vm.h" #include "../h/pte.h" #include "../h/inline.h" #include "../h/mtpr.h" #define SQSIZE 0100 /* Must be power of 2 */ #define HASH(x) (( (int) x >> 5) & (SQSIZE-1)) struct proc *slpque[SQSIZE]; /* * Give up the processor till a wakeup occurs * on chan, at which time the process * enters the scheduling queue at priority pri. * The most important effect of pri is that when * pri<=PZERO a signal cannot disturb the sleep; * if pri>PZERO signals will be processed. * Callers of this routine must be prepared for * premature return, and check that the reason for * sleeping has gone away. */ sleep(chan, pri) caddr_t chan; { register struct proc *rp, **hp; register s; rp = u.u_procp; s = spl6(); if (chan==0 || rp->p_stat != SRUN || rp->p_rlink) panic("sleep"); rp->p_wchan = chan; rp->p_slptime = 0; rp->p_pri = pri; hp = &slpque[HASH(chan)]; rp->p_link = *hp; *hp = rp; if(pri > PZERO) { if(ISSIG(rp)) { if (rp->p_wchan) unsleep(rp); rp->p_stat = SRUN; (void) spl0(); goto psig; } if (rp->p_wchan == 0) goto out; rp->p_stat = SSLEEP; (void) spl0(); swtch(); if(ISSIG(rp)) goto psig; } else { rp->p_stat = SSLEEP; (void) spl0(); swtch(); } out: splx(s); return; /* * If priority was low (>PZERO) and * there has been a signal, * execute non-local goto to * the qsav location. * (see trap1/trap.c) */ psig: longjmp(u.u_qsav); /*NOTREACHED*/ } /* * Sleep on chan at pri. * Return in no more than the indicated number of seconds. * (If seconds==0, no timeout implied) * Return TS_OK if chan was awakened normally * TS_TIME if timeout occurred * TS_SIG if asynchronous signal occurred */ tsleep(chan, pri, seconds) caddr_t chan; { label_t lqsav; register struct proc *pp; register sec, n, rval; pp = u.u_procp; n = spl7(); sec = 0; rval = 0; if (pp->p_clktim && pp->p_clktimp_flag |= STIMO; sec = pp->p_clktim-seconds; pp->p_clktim = seconds; } bcopy((caddr_t)u.u_qsav, (caddr_t)lqsav, sizeof (label_t)); if (setjmp(u.u_qsav)) rval = TS_SIG; else { sleep(chan, pri); if ((pp->p_flag&STIMO)==0 && seconds) rval = TS_TIME; else rval = TS_OK; } pp->p_flag &= ~STIMO; bcopy((caddr_t)lqsav, (caddr_t)u.u_qsav, sizeof (label_t)); if (sec > 0) pp->p_clktim += sec; else pp->p_clktim = 0; splx(n); return(rval); } /* * Remove a process from its wait queue */ unsleep(p) register struct proc *p; { register struct proc **hp; register s; s = spl6(); if (p->p_wchan) { hp = &slpque[HASH(p->p_wchan)]; while (*hp != p) hp = &(*hp)->p_link; *hp = p->p_link; p->p_wchan = 0; } splx(s); } /* * Wake up all processes sleeping on chan. */ wakeup(chan) register caddr_t chan; { register struct proc *p, **q, **h; int s; s = spl6(); h = &slpque[HASH(chan)]; restart: for (q = h; p = *q; ) { if (p->p_rlink || p->p_stat != SSLEEP && p->p_stat != SSTOP) panic("wakeup"); if (p->p_wchan==chan) { p->p_wchan = 0; *q = p->p_link; p->p_slptime = 0; if (p->p_stat == SSLEEP) { /* OPTIMIZED INLINE EXPANSION OF setrun(p) */ p->p_stat = SRUN; if (p->p_flag & SLOAD) setrq(p); if(p->p_pri < curpri) { runrun++; aston(); } if ((p->p_flag&SLOAD) == 0) { if (runout != 0) { runout = 0; wakeup((caddr_t)&runout); } wantin++; } /* END INLINE EXPANSION */ goto restart; } } else q = &p->p_link; } splx(s); } /* * Initialize the (doubly-linked) run queues * to be empty. */ rqinit() { register int i; for (i = 0; i < NQS; i++) qs[i].ph_link = qs[i].ph_rlink = (struct proc *)&qs[i]; } /* * Set the process running; * arrange for it to be swapped in if necessary. */ setrun(p) register struct proc *p; { register s; s = spl6(); switch (p->p_stat) { case 0: case SWAIT: case SRUN: case SZOMB: default: panic("setrun"); case SSTOP: case SSLEEP: unsleep(p); /* e.g. when sending signals */ break; case SIDL: break; } p->p_stat = SRUN; if (p->p_flag & SLOAD) setrq(p); splx(s); if(p->p_pri < curpri) { runrun++; aston(); } if ((p->p_flag&SLOAD) == 0) { if(runout != 0) { runout = 0; wakeup((caddr_t)&runout); } wantin++; } } /* * Set user priority. * The rescheduling flag (runrun) * is set if the priority is better * than the currently running process. */ setpri(pp) register struct proc *pp; { register p; p = (pp->p_cpu & 0377)/4; p += PUSER + 2*(pp->p_nice - NZERO); if (pp->p_rssize > pp->p_maxrss && freemem < desfree) p += 2*4; /* effectively, nice(4) */ if(p > 127) p = 127; if(p < curpri) { runrun++; aston(); } pp->p_usrpri = p; return(p); } /* * Create a new process-- the internal version of * sys fork. * It returns 1 in the new process, 0 in the old. */ newproc(isvfork) { register struct proc *p; register struct proc *rpp, *rip; register int n; p = NULL; /* * First, just locate a slot for a process * and copy the useful info from this process into it. * The panic "cannot happen" because fork has already * checked for the existence of a slot. */ retry: mpid++; if(mpid >= 30000) { mpid = 0; goto retry; } for(rpp = proc; rpp < procNPROC; rpp++) { if(rpp->p_stat == NULL && p==NULL) p = rpp; if (rpp->p_pid==mpid || rpp->p_pgrp==mpid) goto retry; } if ((rpp = p)==NULL) panic("no procs"); /* * make proc entry for new proc */ rip = u.u_procp; rpp->p_stat = SIDL; rpp->p_clktim = 0; rpp->p_flag = SLOAD | (rip->p_flag & (SPAGI|SDETACH|SNUSIG)); if (isvfork) { rpp->p_flag |= SVFORK; rpp->p_ndx = rip->p_ndx; } else rpp->p_ndx = rpp - proc; rpp->p_uid = rip->p_uid; rpp->p_pgrp = rip->p_pgrp; rpp->p_nice = rip->p_nice; rpp->p_textp = isvfork ? 0 : rip->p_textp; rpp->p_pid = mpid; rpp->p_ppid = rip->p_pid; rpp->p_pptr = rip; rpp->p_time = 0; rpp->p_cpu = 0; rpp->p_siga0 = rip->p_siga0; rpp->p_siga1 = rip->p_siga1; /* take along any pending signals, like stops? */ if (isvfork) { rpp->p_tsize = rpp->p_dsize = rpp->p_ssize = 0; rpp->p_szpt = clrnd(ctopt(UPAGES)); forkstat.cntvfork++; forkstat.sizvfork += rip->p_dsize + rip->p_ssize; } else { rpp->p_tsize = rip->p_tsize; rpp->p_dsize = rip->p_dsize; rpp->p_ssize = rip->p_ssize; rpp->p_szpt = rip->p_szpt; forkstat.cntfork++; forkstat.sizfork += rip->p_dsize + rip->p_ssize; } rpp->p_rssize = 0; rpp->p_maxrss = rip->p_maxrss; rpp->p_wchan = 0; rpp->p_slptime = 0; rpp->p_pctcpu = 0; rpp->p_cpticks = 0; n = PIDHASH(rpp->p_pid); p->p_idhash = pidhash[n]; pidhash[n] = rpp - proc; /* * make duplicate entries * where needed */ multprog++; for(n=0; nf_count++; if(!isvfork && u.u_vrpages[n]) u.u_ofile[n]->f_inode->i_vfdcnt++; } u.u_cdir->i_count++; if (u.u_rdir) u.u_rdir->i_count++; /* * Partially simulate the environment * of the new process so that when it is actually * created (by copying) it will look right. */ rip->p_flag |= SKEEP; /* prevent parent from being swapped */ if (procdup(rpp, isvfork)) return (1); (void) spl6(); rpp->p_stat = SRUN; setrq(rpp); (void) spl0(); /* SSWAP NOT NEEDED IN THIS CASE AS u.u_pcb.pcb_sswap SUFFICES */ /* rpp->p_flag |= SSWAP; */ rip->p_flag &= ~SKEEP; if (isvfork) { u.u_procp->p_xlink = rpp; u.u_procp->p_flag |= SNOVM; while (rpp->p_flag & SVFORK) sleep((caddr_t)rpp, PZERO - 1); if ((rpp->p_flag & SLOAD) == 0) panic("newproc vfork"); uaccess(rpp, Vfmap, &vfutl); u.u_procp->p_xlink = 0; vpassvm(rpp, u.u_procp, &vfutl, &u, Vfmap); for (n = 0; n < NOFILE; n++) if (vfutl.u_vrpages[n]) { if ((u.u_vrpages[n] = vfutl.u_vrpages[n] - 1) == 0) if (--u.u_ofile[n]->f_inode->i_vfdcnt < 0) panic("newproc i_vfdcnt"); vfutl.u_vrpages[n] = 0; } u.u_procp->p_flag &= ~SNOVM; rpp->p_ndx = rpp - proc; rpp->p_flag |= SVFDONE; wakeup((caddr_t)rpp); } return (0); } @iYk敤 w 2i ((HOME=/; export HOME PATH=/bin:/usr/bin if [ $1x = autobootx ] then echo Automatic reboot in progress... >/dev/console date >/dev/console /etc/fsck -p >/dev/console case $? in 0) date >/dev/console ;; 4) /etc/reboot -n ;; 8) echo "Automatic reboot failed... help!" >/dev/console exit 1 ;; 12) echo "Reboot interrupted" >/dev/console exit 1 ;; *) echo "Unknown error in reboot" > /dev/console exit 1 ;; esac else date >/dev/console fi rm -f /etc/nologin : should fix up the password lock file here if present cp /dev/null /etc/mtab chmod 666 /etc/motd /etc/swapon -a >/dev/console /etc/mount -a >/dev/console echo preserving editor files >/dev/console (cd /tmp; /usr/lib/ex3.6preserve -a) echo clearing /tmp >/dev/console (cd /tmp; rm -f *) echo -n starting daemons: >/dev/console /etc/update; echo -n ' update' >/dev/console /etc/cron; echo -n ' cron' >/dev/console /etc/accton /usr/adm/acct; echo -n ' accounting' >/dev/console if [ -d /usr/net/bin ]; then sh /usr/net/bin/start & echo -n ' network' >/dev/console fi /etc/comsat; echo -n ' mail' >/dev/console if [ -f /dev/cul0 ]; then /usr/lib/dnd > /usr/adm/dndbug echo -n ' dialer' >/dev/console fi cd /usr/spool rm -f uucp/LCK.* if [ -f /dev/lp ]; then rm -f lpd/lock; /usr/lib/lpd; echo -n ' printer' >/dev/console fi if [ -f /dev/vpd ]; then rm -f vpd/lock; /usr/lib/vpd; echo -n ' versatec' >/dev/console fi if [ -f /dev/vad ]; then rm -f vad/lock; /usr/lib/vad; echo -n ' varian' >/dev/console fi echo '.' >/dev/console date >/dev/console /etc/savecore /usr/crash 2>&1 > /dev/console exit 0 @i\kvբ! K<K<K<@i]k! cctȪ@i^k!  tȪ@i_k#! ddtȪ@i`kݦ! ɚ :tȪ@iak,g! O,hetȪ@ibk]! ?<G2Ȫ@ickt! ftȪ((@idk݊K$9  K2i6i /* sig.c 4.12 81/07/03 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/inode.h" #include "../h/reg.h" #include "../h/text.h" #include "../h/seg.h" #include "../h/mtpr.h" #include "../h/pte.h" #include "../h/psl.h" #include "../h/vm.h" #include "../h/buf.h" #include "../h/vlimit.h" /* * Priority for tracing */ #define IPCPRI PZERO /* * Tracing variables. * Used to pass trace command from * parent to child being traced. * This data base cannot be * shared and is locked * per user. */ struct { int ip_lock; int ip_req; int *ip_addr; int ip_data; } ipc; /* * Send the specified signal to * all processes with 'pgrp' as * process group. * Called by tty.c for quits and * interrupts. */ gsignal(pgrp, sig) register pgrp; { register struct proc *p; if(pgrp == 0) return; for(p = proc; p < procNPROC; p++) if(p->p_pgrp == pgrp) psignal(p, sig); } /* * Send the specified signal to * the specified process. */ psignal(p, sig) register struct proc *p; register int sig; { register s; register int (*action)(); long sigmask; if((unsigned)sig >= NSIG) return; sigmask = (1L << (sig-1)); /* * If proc is traced, always give parent a chance. * Otherwise get the signal action from the bits in the proc table. */ if (p->p_flag & STRC) action = SIG_DFL; else { s = (p->p_siga1&sigmask) != 0; s <<= 1; s |= (p->p_siga0&sigmask) != 0; action = (int(*)())s; /* * If the signal is ignored, we forget about it immediately. */ if (action == SIG_IGN) return; } #define mask(sig) (1<<(sig-1)) #define stops (mask(SIGSTOP)|mask(SIGTSTP)|mask(SIGTTIN)|mask(SIGTTOU)) if (sig) { p->p_sig |= sigmask; switch (sig) { case SIGTERM: if ((p->p_flag&STRC) != 0 || action != SIG_DFL) break; /* fall into ... */ case SIGKILL: if (p->p_nice > NZERO) p->p_nice = NZERO; break; case SIGCONT: p->p_sig &= ~stops; break; case SIGSTOP: case SIGTSTP: case SIGTTIN: case SIGTTOU: p->p_sig &= ~mask(SIGCONT); break; } } #undef mask #undef stops /* * Defer further processing for signals which are held. */ if (action == SIG_HOLD) return; s = spl6(); switch (p->p_stat) { case SSLEEP: /* * If process is sleeping at negative priority * we can't interrupt the sleep... the signal will * be noticed when the process returns through * trap() or syscall(). */ if (p->p_pri <= PZERO) goto out; /* * Process is sleeping and traced... make it runnable * so it can discover the signal in issig() and stop * for the parent. */ if (p->p_flag&STRC) goto run; switch (sig) { case SIGSTOP: case SIGTSTP: case SIGTTIN: case SIGTTOU: /* * These are the signals which by default * stop a process. */ if (action != SIG_DFL) goto run; /* * Don't clog system with children of init * stopped from the keyboard. */ if (sig != SIGSTOP && p->p_pptr == &proc[1]) { psignal(p, SIGKILL); p->p_sig &= ~sigmask; splx(s); return; } /* * If a child in vfork(), stopping could * cause deadlock. */ if (p->p_flag&SVFORK) goto out; p->p_sig &= ~sigmask; p->p_cursig = sig; stop(p); goto out; case SIGTINT: case SIGCHLD: /* * These signals are special in that they * don't get propogated... if the process * isn't interested, forget it. */ if (action != SIG_DFL) goto run; p->p_sig &= ~sigmask; /* take it away */ goto out; default: /* * All other signals cause the process to run */ goto run; } /*NOTREACHED*/ case SSTOP: /* * If traced process is already stopped, * then no further action is necessary. */ if (p->p_flag&STRC) goto out; switch (sig) { case SIGKILL: /* * Kill signal always sets processes running. */ goto run; case SIGCONT: /* * If the process catches SIGCONT, let it handle * the signal itself. If it isn't waiting on * an event, then it goes back to run state. * Otherwise, process goes back to sleep state. */ if (action != SIG_DFL || p->p_wchan == 0) goto run; p->p_stat = SSLEEP; goto out; case SIGSTOP: case SIGTSTP: case SIGTTIN: case SIGTTOU: /* * Already stopped, don't need to stop again. * (If we did the shell could get confused.) */ p->p_sig &= ~sigmask; /* take it away */ goto out; default: /* * If process is sleeping interruptibly, then * unstick it so that when it is continued * it can look at the signal. * But don't setrun the process as its not to * be unstopped by the signal alone. */ if (p->p_wchan && p->p_pri > PZERO) unsleep(p); goto out; } /*NOTREACHED*/ default: /* * SRUN, SIDL, SZOMB do nothing with the signal, * other than kicking ourselves if we are running. * It will either never be noticed, or noticed very soon. */ if (p == u.u_procp && !noproc) aston(); goto out; } /*NOTREACHED*/ run: /* * Raise priority to at least PUSER. */ if (p->p_pri > PUSER) if ((p != u.u_procp || noproc) && p->p_stat == SRUN && (p->p_flag & SLOAD)) { remrq(p); p->p_pri = PUSER; setrq(p); } else p->p_pri = PUSER; setrun(p); out: splx(s); } /* * Returns true if the current * process has a signal to process. * The signal to process is put in p_cursig. * This is asked at least once each time a process enters the * system (though this can usually be done without actually * calling issig by checking the pending signal masks.) * A signal does not do anything * directly to a process; it sets * a flag that asks the process to * do something to itself. */ issig() { register struct proc *p; register int sig; long sigbits; long sigmask; p = u.u_procp; for (;;) { sigbits = p->p_sig; if ((p->p_flag&STRC) == 0) sigbits &= ~p->p_ignsig; if (p->p_flag&SVFORK) #define bit(a) (1<<(a-1)) sigbits &= ~(bit(SIGSTOP)|bit(SIGTSTP)|bit(SIGTTIN)|bit(SIGTTOU)); if (sigbits == 0) break; sig = ffs(sigbits); sigmask = 1L << (sig-1); p->p_sig &= ~sigmask; /* take the signal! */ p->p_cursig = sig; if (p->p_flag&STRC && (p->p_flag&SVFORK)==0) { /* * If traced, always stop, and stay * stopped until released by the parent. */ do { stop(p); swtch(); } while (!procxmt() && p->p_flag&STRC); /* * If parent wants us to take the signal, * then it will leave it in p->p_cursig; * otherwise we just look for signals again. */ sig = p->p_cursig; if (sig == 0) continue; } switch (u.u_signal[sig]) { case SIG_DFL: /* * Don't take default actions on system processes. */ if (p <= &proc[2]) break; switch (sig) { case SIGTSTP: case SIGTTIN: case SIGTTOU: /* * Children of init aren't allowed to stop * on signals from the keyboard. */ if (p->p_pptr == &proc[1]) { psignal(p, SIGKILL); continue; } /* fall into ... */ case SIGSTOP: if (p->p_flag&STRC) continue; stop(p); swtch(); continue; case SIGTINT: case SIGCONT: case SIGCHLD: /* * These signals are normally not * sent if the action is the default. * This can happen only if you reset the * signal action from an action which was * not deferred to SIG_DFL before the * system gets a chance to post the signal. */ continue; /* == ignore */ default: goto send; } /*NOTREACHED*/ case SIG_HOLD: case SIG_IGN: /* * Masking above should prevent us * ever trying to take action on a held * or ignored signal, unless process is traced. */ if ((p->p_flag&STRC) == 0) printf("issig\n"); continue; default: /* * This signal has an action, let * psig process it. */ goto send; } /*NOTREACHED*/ } /* * Didn't find a signal to send. */ p->p_cursig = 0; return (0); send: /* * Let psig process the signal. */ return (sig); } #ifndef vax ffs(mask) register long mask; { register int i; for(i=1; i>= 1; } return(0); } #endif /* * Put the argument process into the stopped * state and notify the parent via wakeup and/or signal. */ stop(p) register struct proc *p; { p->p_stat = SSTOP; p->p_flag &= ~SWTED; wakeup((caddr_t)p->p_pptr); /* * Avoid sending signal to parent if process is traced */ if (p->p_flag&STRC) return; psignal(p->p_pptr, SIGCHLD); } /* * Perform the action specified by * the current signal. * The usual sequence is: * if(issig()) * psig(); * The signal bit has already been cleared by issig, * and the current signal number stored in p->p_cursig. */ psig() { register struct proc *rp = u.u_procp; register int n = rp->p_cursig; long sigmask = 1L << (n-1); register int (*action)(); if (rp->p_cursig == 0) panic("psig"); action = u.u_signal[n]; if (action != SIG_DFL) { if (action == SIG_IGN || action == SIG_HOLD) panic("psig action"); u.u_error = 0; if(n != SIGILL && n != SIGTRAP) u.u_signal[n] = 0; /* * If ((this catch value indicates automatic holding of * subsequent signals, set the hold value. */ if (SIGISDEFER(action)) { (void) spl6(); if ((int)SIG_HOLD & 1) rp->p_siga0 |= sigmask; else rp->p_siga0 &= ~sigmask; if ((int)SIG_HOLD & 2) rp->p_siga1 |= sigmask; else rp->p_siga1 &= ~sigmask; u.u_signal[n] = SIG_HOLD; (void) spl0(); action = SIGUNDEFER(action); } sendsig(action, n); rp->p_cursig = 0; return; } switch (n) { case SIGILL: case SIGIOT: case SIGBUS: case SIGQUIT: case SIGTRAP: case SIGEMT: case SIGFPE: case SIGSEGV: case SIGSYS: u.u_arg[0] = n; if(core()) n += 0200; } exit(n); } #ifdef unneeded int corestop = 0; #endif /* * Create a core image on the file "core" * If you are looking for protection glitches, * there are probably a wealth of them here * when this occurs to a suid command. * * It writes UPAGES block of the * user.h area followed by the entire * data+stack segments. */ core() { register struct inode *ip;@iokۋL$9  K2i6i extern schar(); #ifdef unneeded if (corestop) { int i; for (i = 0; i < 10; i++) if (u.u_comm[i]) putchar(u.u_comm[i], 0); printf(", uid %d\n", u.u_uid); if (corestop&2) asm("halt"); } #endif if (ctob(UPAGES+u.u_dsize+u.u_ssize) >= u.u_limit[LIM_CORE]) return (0); u.u_error = 0; u.u_dirp = "core"; ip = namei(schar, 1); if(ip == NULL) { if(u.u_error) return(0); ip = maknode(0666); if (ip==NULL) return(0); } if(!access(ip, IWRITE) && (ip->i_mode&IFMT) == IFREG && ip->i_vfdcnt == 0 && u.u_uid == u.u_ruid && ip->i_nlink == 1) { itrunc(ip); u.u_offset = 0; u.u_base = (caddr_t)&u; u.u_count = ctob(UPAGES); u.u_segflg = 1; writei(ip); u.u_base = (char *)ctob(u.u_tsize); u.u_count = ctob(u.u_dsize); u.u_segflg = 0; writei(ip); u.u_base = (char *)(USRSTACK - ctob(u.u_ssize)); u.u_count = ctob(u.u_ssize); writei(ip); } else u.u_error = EFAULT; iput(ip); return(u.u_error==0); } /* * grow the stack to include the SP * true return if successful. */ grow(sp) unsigned sp; { register si; if(sp >= USRSTACK-ctob(u.u_ssize)) return(0); si = clrnd(btoc((USRSTACK-sp)) - u.u_ssize + SINCR); if (ctob(u.u_ssize+si) > u.u_limit[LIM_STACK]) return(0); if (chksize(u.u_tsize, u.u_dsize, u.u_ssize+si)) return(0); if (swpexpand(u.u_dsize, u.u_ssize+si, &u.u_dmap, &u.u_smap)==0) return(0); expand(si, P1BR); return(1); } /* * sys-trace system call. */ ptrace() { register struct proc *p; register struct a { int req; int pid; int *addr; int data; } *uap; uap = (struct a *)u.u_ap; if (uap->req <= 0) { u.u_procp->p_flag |= STRC; return; } p = pfind(uap->pid); if (p == 0 || p->p_stat != SSTOP || p->p_ppid != u.u_procp->p_pid) { u.u_error = ESRCH; return; } while (ipc.ip_lock) sleep((caddr_t)&ipc, IPCPRI); ipc.ip_lock = p->p_pid; ipc.ip_data = uap->data; ipc.ip_addr = uap->addr; ipc.ip_req = uap->req; p->p_flag &= ~SWTED; while (ipc.ip_req > 0) { if (p->p_stat==SSTOP) setrun(p); sleep((caddr_t)&ipc, IPCPRI); } u.u_r.r_val1 = ipc.ip_data; if (ipc.ip_req < 0) u.u_error = EIO; ipc.ip_lock = 0; wakeup((caddr_t)&ipc); } int ipcreg[] = {R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, AP, FP, SP, PC}; /* * Code that the child process * executes to implement the command * of the parent process in tracing. */ procxmt() { register int i; register *p; register struct text *xp; if (ipc.ip_lock != u.u_procp->p_pid) return(0); u.u_procp->p_slptime = 0; i = ipc.ip_req; ipc.ip_req = 0; switch (i) { /* read user I */ case 1: if (!useracc((caddr_t)ipc.ip_addr, 4, B_READ)) goto error; ipc.ip_data = fuiword((caddr_t)ipc.ip_addr); break; /* read user D */ case 2: if (!useracc((caddr_t)ipc.ip_addr, 4, B_READ)) goto error; ipc.ip_data = fuword((caddr_t)ipc.ip_addr); break; /* read u */ case 3: i = (int)ipc.ip_addr; if (i<0 || i >= ctob(UPAGES)) goto error; ipc.ip_data = ((physadr)&u)->r[i>>2]; break; /* write user I */ /* Must set up to allow writing */ case 4: /* * If text, must assure exclusive use */ if (xp = u.u_procp->p_textp) { if (xp->x_count!=1 || xp->x_iptr->i_mode&ISVTX) goto error; xp->x_iptr->i_flag &= ~ITEXT; } i = -1; if (chgprot((caddr_t)ipc.ip_addr, RW) && chgprot((caddr_t)ipc.ip_addr+(sizeof(int)-1), RW)) i = suiword((caddr_t)ipc.ip_addr, ipc.ip_data); (void) chgprot((caddr_t)ipc.ip_addr, RO); (void) chgprot((caddr_t)ipc.ip_addr+(sizeof(int)-1), RO); if (i < 0) goto error; if (xp) xp->x_flag |= XWRIT; break; /* write user D */ case 5: if (suword((caddr_t)ipc.ip_addr, 0) < 0) goto error; (void) suword((caddr_t)ipc.ip_addr, ipc.ip_data); break; /* write u */ case 6: i = (int)ipc.ip_addr; p = (int *)&((physadr)&u)->r[i>>2]; for (i=0; i<16; i++) if (p == &u.u_ar0[ipcreg[i]]) goto ok; if (p == &u.u_ar0[PS]) { ipc.ip_data |= PSL_CURMOD|PSL_PRVMOD; ipc.ip_data &= ~PSL_USERCLR; goto ok; } goto error; ok: *p = ipc.ip_data; break; /* set signal and continue */ /* one version causes a trace-trap */ case 9: case 7: if ((int)ipc.ip_addr != 1) u.u_ar0[PC] = (int)ipc.ip_addr; if ((unsigned)ipc.ip_data > NSIG) goto error; u.u_procp->p_cursig = ipc.ip_data; /* see issig */ if (i == 9) u.u_ar0[PS] |= PSL_T; wakeup((caddr_t)&ipc); return (1); /* force exit */ case 8: wakeup((caddr_t)&ipc); exit(u.u_procp->p_cursig); default: error: ipc.ip_req = -1; } wakeup((caddr_t)&ipc); return(0); } @iuk! tȪ@ivk! tȪ@iwk! tȪ((@ixkhV! -ɪ@iykW! tttȪ@izk! tȪ@i{kx! HHtȪ@i|k! tȪ@i}k_a S<tȪ@i~kƳa Pt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d^P1qмP@zaݭ{ЬPЭQРݭݭaݭݬa17ЬPРZlРhP1PH PF1PI1Pl#Pd PL1Pf1Pm1ԭxEݬyfݬyeݭI xeYPPN1v1P1b1=P 11P11P1[^ݬ1ЬPРѼa1ЭPР[[ݏݭgaaHPYPݏݭ@ЬPЭQСQРЭPݠЭPРPɏPЭQСQPЭPݠ~ݏIGPP[YGЭPݠMݭG^ЬPԠЭPРPЬQРЭPРPЬQРЭPݠ`15GPYPݏݬV`ЬPYݬ1ѽ ݬЭPݠGC1 ݭ19wr^ЬPԠKм[ݭݬYP11YЬPԠHм[ݭݬYP112ЬPԠfм[ݭݬbYP11 ѬЬPݠ&1ݬЬP1>ݬݬCP1ѼNP PP1ݬPЬPݠЬPЭѼNP PPѼNPPݬݬDP1D1ݬݬDP1-ݬ0P:ЬPݠ&ЬPЭݬ ЬPݠPk@tݬ_ЭPݠݭ1(ݬݬCP11ݬݬBP1[PP<5PP P1[1aP 1PP1P@P>1PB1P1P1N P 11P1#1PH1$P;1 P:1/1bPF11SPK1QPI1J16PL11'Pg1,Pd1lPb1%1Pf1H1Pm1mPl1D1Pn11ѼaݬݬPݬݬDPYPݬݬXP11sЬ[kZˏJ+PPYYZPPI11P.gP'XP 1лP@ ݫ:1ݫXЫPѠ [{2vݫP1PFx8P;ݫ ЫPѠ [02+ݫPH YPKP^HPf4PL1wPd&ݫZݫPmYлP@ Zݫ9ѫ  [:ݫ|1RЬ[kPPPPPL[Nݫ ݫЬ[kPPFMPHDPI;PK2Pd)Pf kPˏ@*PP"PP/ݫЫ[Ь[k8ݬݫЫ[ѬF Ѭd[Zм[[PPRv1P;1F1xP11`P1VP1 ݬ@լݏIݬݏQTլ 15ݏIݬ լ1P1լÏP[P@oм[Ь  ЬPѰ1РPՠЬPРPРP`[PPP 111111w1[YQPPPPP[ЬPаP@ ЬPݠ` ЬPݠPݏIݬ[S= ЬPݠ,ݏIݬ ЬPݠЬPЬ ݬլ ݏIݬ TSݬ լ  ?Ь PPZZݏ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$[ka1kÏkP@ZYYмPYQQQQ@mPPYҬPPPݏLݬ[PZݫZPݫ ݪ1P1yݏRݬ$PZݫZPݫݪP ЫP[ݬPݫ ݬݬݬݫݬ2P2P^Ь [CZk1kPPAa+44|4F44444b|4444kggPgk`[fk~MY[k~ݬ)[k Y9CYx׭x~kMЭPҭPP51iЬPݠYݼ[k~'1H[k~ݬРݭLY1j[k~ݬ_P`51[k~ݬDP51[k~ݬ)P51[k~ݬPk51ЬPP1,P2'P3"PL*PRFPX<1PxPPPмPˏ@jPPЬPЬPРPмPˏ@jPPЬPЬPРP Fi@Fi@.Fi@>Fh$  ?Fh$_@Fh$PFh$_0nFh$0}Fh$0Fh$Fh$Fh$Fh$FnLFnFnF% G%G%Gc 'Gb @*Gb@:Gb@=Gb@LGgO hGg {Gg OGg G LLG G G G G   H   H  2H NH`]HHlHHzHH@HHHC#LHC#LHC#LLHB&LIA#LIA#L*IA#L:I@&L TI@&L dI@&L tINIOINLIOLINIOINLIOLI:#I:LI:#LOI:#LI   I^ J^J^ !J^  2J CJ0 DJ IJ NJ LYJ dJ vJ  J J $,JM$JM$J LLJ LJ LJ#LL K#  K&  %K&   1K?'  @K>  kK#L K# K# K# K #L K # K # K # L((&LL+L&L6L&LOL&LLiL&LtL&LL#LLL#LL#L#LL#L#LL#L# M#$M#>M&LYM&LL eM#  tM#M#  M' M&  M&  M& M&  M&N& (N @ 8NN@N9NO@N:N:@:;Nb@bN ?N@L@N;@;ANn@nBN@ CN @DN @ENaaaaaaaaFN%W% (Berkeley) %G% cvtZLl AL,A1 movzZLl AL,A1 cvtZLf AL,TA1 movzZLl AL,A1 cvtlf A1,TA1 cvtZLd AL,A1 movzZLl AL,A1 cvtld A1,A1 cvtZLZF AL,A1 movzZRl AL,A1 movzZRl AL,A1 cvtZRl AL,A1 cvtZRl AL,A1 .long CL .word CL .byte CL jbr CL jmp *AL jmp (AL) ZS subl2 ZT,sp ZSZSZS movl AR,A1 pushl AR ZS movl (sp)+,AR extv $H,$S,AR,A1 extzv $H,$S,AR,A1 extv $H,$S,AR,-(sp) extzv $H,$S,AR,-(sp) cmpl AL,AR ZP cmpw AL,AR ZP cmpb AL,AR ZP cmpw AL,AR ZP cmpb AL,AR ZP cmpd AL,AR ZP cvtfd AR,A1 cmpd AL,A1 ZP cvtfd AL,A1 cmpd A1,AR ZP cmpf AL,AR ZP movl $1,A1 ZN calls ZC,CL calls ZC,(AL) calls ZC,*AL calls ZC,*AL extzv AR,ZU,AL,AL subl3 AR,$32,A1 extzv AR,A1,AL,AL subl3 AR,$32,A1 extzv AR,A1,AL,AL extzv AR,ZU,AL,A1 ashl AR,AL,AL ashl AR,AL,AL ZB AR,A1 ashl A1,AL,AL ashl AR,AL,A1 ashl AR,AL,A1 ZB AR,A1 ashl A1,AL,A1 ZE ZE ZE ZE ZD ZD ZD ZD ZA insv AR,$H,$S,AL extv $H,$S,AR,AL extzv $H,$S,AR,AL HELP HELP HELP movd AR,A1 movZF AR,A1 cvtfd AR,-(sp) movZR AR,-(sp) ZA ZA tstZR AR pushl AR cvtZRl AR,-(sp) movzZRl AR,-(sp) movd AR,-(sp) cvtfd AR,-(sp) mnegZL AL,A1 mcomZL AL,A1 cvtZLl AL,A1 mcoml A1,A1 bitl ZZ,AL bitw ZZ,AL bitb ZZ,AL bicl2 AR,AL OL2 AR,AL OL2 AR,AL OL3 AR,AL,A1 divl3 AR,AL,A1 mull2 AR,A1 subl2 A1,AL divl3 AR,AL,A1 mull2 AR,A1 subl3 A1,AL,A1 incZL AL incZL AL incZL AL cvtZLl AL,AL incZL AL movzZLl AL,AL decZL AL decZL AL decZL AL cvtZLl AL,AL decZL AL movzZLl AL,AL incZL AL incZL AL cvtZLl AL,AL incZL AL movzZLl AL,AL decZL AL decZL AL cvtZLl AL,AL decZL AL movzZLl AL,AL OL2 AR,AL OL2 AR,AL OW2 AR,AL OW2 AR,AL OB2 AR,AL OB2 AR,AL OW2 AR,AL cvtZLl AL,AL OW2 AR,AL movzZLl AL,AL OB2 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Z1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj$~P שϩ BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[\1xݏPZZ  YYX ZYYXZYZ~@PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[ Ь[Z = 8[ePZ~9PZ ݫ3 ԫ kZP{@P^߭ݬ\PPPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6.00~*PYѯ[֯k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [0PYPƏPxPkbPZxXPZPPZxH~@PZZZ%PZPxPZPPjj01xYP[PܮZծͮЮkﺮk[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j~\S^\_PCЬoPЬPЬRRQ{RPPR PRPPPɤPL%d: : intermediate file read errorlnread overran string bufferintermediate file read errorrcannot open intermediate file %sintermediate file read errorlccopy asked to copy too muchintermediate file read erroroutput file errorop=%d, val = %d, rest = 0%o null opcode ignored switch not yet doneexpression depth exceededexpression poorly formedillegal leaf node: %d%W% (Berkeley) %G%LJ̇҇ه߇QPUTSRYXWVbad option: %cstore called on: SZEROSONESMONESPECIAL+%d|order( %o, ) order( %o, ), cookie , rewrite %s no table entry for op %sillegal initializationexpression causes compiler loop: try simplifying %o) %s %s size=%d align=%d, , NOPREFMUSTDO PREF %s, SU= %d %W% (Berkeley) %G%SANYSAREGSTAREGSBREGSTBREGSCCSNAMESCONSFLDSOREGSTARNMSTARREGINTEMPFORARGSWADDstack overflowusable asked about nontemp registerrfree( %s ), size %d register overfreedillegal freeregister overfreedrbusy( %s ), size %d illegal register pair freedRLEFTRRIGHTRESC1RESC2RESC3RNULLRNOP|reclaim( %o, , ) illegal reclaimcannot reclaimfaulty register movepotential register overwritepotential register overwriteregister allocation error%W% (Berkeley) %G% !@A @tshape( %o, %o), op = %d ttype( %o, %o ) bad setrew%d%d%d%ldbad getlr: %c%W% (Berkeley) %G%'rallo( %o, %d ) bad setstrillegal setasopL%d: stuck starg%W% (Berkeley) %G%L_ c g=kosw{ <ďǏ  ʏՏ $0<<>A=F?K%s, line %d: # line %d, file %s .set LF%d,%ld %s%cno hoptab for %sdflwbzzzcode- bad typel clrl %s clr mnegmoval ,cvtmovzlcvt ,cvtl ,movmovzcvtcvt ,movlcvtl->%d<-$%d %sincdec %saddsub2 ,->%d<-dfl->%d<-$%ld$%d$%dSTASG badSTASG-rstructure size <0=0 or >65535 movb movw movl movq movc3 $%d,, illegal zzzcode %s %s,%s movfmovdmovlillegal makeor2 shumul:op=%d,lop=%d,rop=%d prname=%s,plty=%d, prlval=%D $%ld%sillegal conputinsputupput$%s*-(%s)+[%s]bad arg temp%ld(ap)(%s)*%s(%s)%s-+illegal address%ld%s%s+%ld addl2 $%d,sp jbr L%d bad conditional branch: %saddress of OREG taken%W% (Berkeley) %G%addsubmuldivbisxorbicaddsubmuldivbisxorbicr0r1r2r3r4r5r6r7r8r9r10r11apfpsppc jeql L%d jneq L%d jleq L%d jlss L%d jgeq L%d (( jgtr L%d jlequ L%d jlssu L%d jgequ L%d jgtru L%d udivuremudivuremNAMESTRING^REG_OREGICONFCON`CCODES U- U*U&HUCALLKUFCALLL!M~lFORCEnINIThSCONViPCONV+h+=i!-( -=)! * *= )&h&=i ?:&&||8,;,OP:= </ =/=)>%?%= @<<A<<= 0B>>C>>= 0|h|=i ^h^=i N++ O-- E->FCALLIFCALLP==Q!=R<=S<T>U>YUGTXUGEWULTVULE]A>>!TYPE6[mCBRANCHgFLDjPMCONVkPVCONV$RETURN oCAST %GOTObSTASG cSTARGdSTCALLfUSTCALLĖ˖іٖ, P too many errorscannot recover from earlier errors: goodbye! compiler error: warning: out of tree space; simplify expressionwasted space: %ofreeing blank tree!undeffargcharshortintlongfloatdoublestrtyuniontyenumtymoetyucharushortunsignedulong??PTR FTN ARY %sout of temporary string spaceout of memory (tstr)4,4,0@ik<  L<  < ^Юn PPՀPpPP;Pd4 ($P@H@_;-;Z'E[[|E 0;YЩP֩`iY~i1[FE[9E ^Ь[&E[PPEZEYZPDP :!DZD[DZPPIZDZDY[Z[,PY @#1H B P@B YDZ' PY@ ZdD 1 Q@ A4  1X0D/D)D1 P@0@ c @oPT @ L 9IPЭ@ 9PЭ@[ [Z )ZCj  [P ݏsC 92PX1' & 1)[PC[`181  P@ 8@ J C1B^Ь[81PGQ@a[PPB`PP|PN,lNl,EJ1[P[[A[iP[1[ΑA[[A[BP[ޑ=[[cA[$P[⑋=[[>A1t[P[[["A[P[  P@! 19[@r[@[P[|6t6PРQ֠/aa6/,[[@[@/**% @[PP[FP[/1&[[f@] P@t  G55PРQ֠ a,5 F, =[@[P[P@B*1y [[?[?[PP[?[P[Q5I5PРQ֠*a65*+'55PРQ֠/a 5/+[[a?[V?/*1D 1y[??[4?)1C[[?1T[P[*v 1[>j)1Y [1\%[[>:[P[.[vP[  P@ [[>[P@"A1P@BJ 313#[[>>[/>1F[P[ؘP@@[[>1=[P[(11 YI@4[[=1[=o=1=[1I6>1ZJ7@J>蘋YI"@I >ӘZJ @J=YI?1rI=hZJ?J=SYI?ӘI=PP;P@?[[=10[<[ZJw=1P@x?[[<1[P[Ь[[<[<[P[<P@,>[PЬ[ gc2 $P@4Z1[P[.<1<+<[P@1Z1z1 1 )S1M1cPZ@bÏ;YY[[YY;2PZ@#d;ZÏ\;YZT;Y[[YyzE;Y0;Z P1V &;ZXX;X;XX[P ^Ь[[@P[Z:P:`<Zn%[:[:[P[:  [jA%e:>:[:::P"$ԭ n:g:a:[z"ju0l $[5:[*:[%P[: $[ :yѭlPP cx/ѭ 20'ԭЭP@ս1/нP`#ݭM(>/[Pݽݭ+(/ݭ'ݭ'ݭ'QPA%/P@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PPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~MPYj`~P # BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[0E1xݏPZZ  YYX ZYYXZYZ~|PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[" Ь[Z = 8[ePZ~YPZ ݫo ԫ kZP{ Ь[ЬZkPkPzQQP\P^߭ݬxPPP,Ь[ЬZ[Y[YPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6.;;~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZr [;PdYPƏPxPKbPZx8PZPPZx(~@PZZZPZPxPZPPjj;1xYP[PZkk[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j~\S^\_PCЬoPЬPЬ((RRQ{RPPR PRPPPAPS0E@%s: argument mismatch# %d "%s" token too long%s: unterminated macro call%s: too much pushbackno spacetoken too longbad include syntaxUnreasonable include nestingno space/Can't find include file %stoo much definingillegal macro name%s: missing )bad formal: %stoo many formals: %s%s redefinedIf-less endifIf-less elseundefined control 1%s: %d: too many defines%s: macro recursion%d"%s"%s: actuals too long_$ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890123456789. "'/\ "'\* .too many -D options, ignoring %stoo many -U options, ignoring %sexcessive -I file (%s) ignoredunknown flag %sNo source file %swCan't create %sextraneous name %s/usr/includedefineundefincludeelseendififdefifndefiflineunixvax__LINE____FILE__command lineDDDDDDDD   D,<> -<> .<> /<> 0 1 #:  <  9 ;      !                   "%&'()*+,-./012345678$=  llaaLCC7)  $-!~(*/%+- <>&^|  ?,():)||&&>><<>=<=!===bt n f r \\+-*/%<>&^|?:!~(),defined\ Illegal character %c in preprocessor ifIllegal number %syacc stack overflowsyntax error77`F;@ikD,  \2i  Dt^Юn PPՀPpPPP !"-%L^?M ;AGIK_H \/2Z')BC@EF<=S]1367:[NR abeDJ>ZVX`+049#(* [Z8 dgszTW5cfhijmnoptuvwyY|qrxl{}~kݬ ݬݬ!nݬݬnP[ЬPP4P P6PH #[Pݬ QhPЬ S t#SPЬ@S~S'w Y#R2t'z'$to'h't]'V'tK'D's3'-'P`s''PҬQQsQQ`s&&P`s&&P`sݬtPѼ""bswUsd "KЬPР5sy(sQPPxsݬxrPwe"y"rwxxrQPwPxrd H"ÏwrPP~r|rPpr^^rP~@br[[WOrX7[Y'iYWigiЭgЩЧЭYYXWX[W[X[Zjjݭ!ZZq[qPP~[~}[PPq^   Z;YZmPZPc!V9PjYPi2P@1& P  2P PP[R2P@2P2@gPP-OO171.2P@8W7Prj XXhXh 2hPP>P2-PP6II2P2@$PPPPZY[2P2@PxPPPYYP`O2P@p2P2@P2jQQPPP)2P@ 2P2QQQ2@PPQ2P2@P@ 2PP]?Ie.5DRI 99EsQb)1 z v $ o j 4 H I c i t   !!!!!!!!-D L^i^.<K41x5`2jP2@xPPP4+2P2@ P@(2P@ 12jP@+ZYPZP1[R1mk1^PPPkݫEP&kPPĉu1"  a-1[~1Qv#r1>a~؅1)a~a1~a1PK~1bPK1kPݠЫPݠDЫQPa1k;~1kPݠЫPݠCЫQkPݠЫPݠЫPݠCЫQPaл1Vݫ01mk.PJ1)ݏz/PJ1 kk(/1kݫݫkM.1kݏ-/PpJb1ݫkF}L17} .}enPgP+iU}TUHPPkoCP($O1t|kݫ>CP#1ЫI1|kݫ k k@kɏ@k~ݫݫBP#FI10 ݫݏ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1Pn11Ѽaݬݬ*Pݬݬ8.PYPݬݬP11sЬ[kZˏJPPYYZPPI11P.gP'XP 1лP@Ϟ ݫa1ݫXЫPѠ [+2&ݫP1PFx8P;ݫ ЫPѠ M[2ۯݫPH YPKPHPf4PL1wPd&ݫZݫүPmYлP@˝ Zݫ]ѫ 說 [ݫ|1RЬ[kPPPPPL[Nݫ ݫЬ[kPPFMPHDPI;PK2Pd)Pf kPˏ@PP"PPݫЫ[Ь[k8ݬݫЫ[ѬF Ѭd[Zм[[PPRv1P;1F1xP11`P1VP1 ݬ@լݏIݬݏQլ 15ݏIݬ լ1P1լÏP[P@Aм[Ь  ЬPѰ1РPՠЬPРPРP`[PPP 111111w1[YQPPPPP[ЬPаP@ ЬPݠ` ЬPݠPݏIݬ[= ЬPݠ,ݏIݬ ЬPݠЬPЬ ݬլ ݏIݬ ^ݬ5լ  #Ь PPZZݏЬPݠݬ ݬЬPݠլ  Z#aլ #ЬPPZݏZЬPݠݬ ݬЬPݠլݬݬ ЬPݠЬPݠaݬ ݬЬPݠoլ  #Ь PPYլ "ЬPPX"PZPݏЬPݠ$YXЬPРPݠZ"ݬ ݬЬPРPݠլ X"լ  Y"ЬPa1ЬPѠ1ѠՠРP`լ1ݏIݬլ 1ݏIݬ 1{PPP1P1p1PP1PL11PQ11{PV1&PT PS1VPU11GPX1 PW1-PY1f1PP  g8м {YѬЬP׬P [XмP@MݬEXмPPdP_P^?P_MPb]PcTPdKPfBhvX1ЬPРP@ڞ:֞OXݬ (ЬPݠ︞/XЬPݠﭞX爵XЬPݠH:WЬPѠ 1_ yyWЬPˏP@`^WЬPݠ MW^Ь[k 1>Ыѽ^ЭPРРYРX1ѽѽЭPРWРVѽfW( PYJ[TPV PZ1ZYW[3PW PZZYV[d V PYѽ ѽ1fg^yݦ PjЦѽέPPЧYЦXh ѽhЧXXݭYݫTP_kYЭXݭ7ݬ8 ݬ7[ށȞVUݬݬﺞU^PxPPPP PPxPﳖUխ%ѭ@ ݭr ݭwxUz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ЬQРЬPЬQРЬPЬQРЬPЬQРЬPЬQРЬ[[iPZPЫYk^ݫGk_GY3xYPPPPPdxYPPP~Y~YmjPˏ@`PPPZPݫ[PݫMP[KiKr mp[^[x[խ[PxPЭPfpݏuݬݬx u x{ w- p uݏcoou2uw ݬݬ ݬݬw u~wqw8-.oݏwiu  #L # # # 5 #L O # Z # e # ~&LL&L&L&LL&L&L#LL#L #,#L8#D#LP#\#v##&L&LL #  ##  ' &  8&  D& S&  l&  @ N@NO@N:@:b@bg@g @ @L;@;n@n@ @ @aaaaaaaa cvtZLl AL,A1 movzZLl AL,A1 cvtZLd AL,A1 movzZLl AL,A1 cvtld A1,A1 cvtZLZF AL,A1 movzZRl AL,A1 movzZRl AL,A1 cvtZRl AL,A1 cvtZRl AL,A1 .long CL .word CL .byte CL jbr CL jmp *AL jmp (AL) ZS subl2 ZT,sp ZSZSZS movl AR,A1 pushl AR ZS movl (sp)+,AR extv $H,$S,AR,A1 extzv $H,$S,AR,A1 extv $H,$S,AR,-(sp) extzv $H,$S,AR,-(sp) cmpl AL,AR ZP cmpw AL,AR ZP cmpb AL,AR ZP cmpw AL,AR ZP cmpb AL,AR ZP cmpd AL,AR ZP cvtfd AR,A1 cmpd AL,A1 ZP cvtfd AL,A1 cmpd A1,AR ZP cmpf AL,AR ZP movl $1,A1 ZN calls ZC,CL calls ZC,(AL) calls ZC,*AL calls ZC,*AL extzv AR,ZU,AL,AL subl3 AR,$32,A1 extzv AR,A1,AL,AL subl3 AR,$32,A1 extzv AR,A1,AL,AL extzv AR,ZU,AL,A1 ashl AR,AL,AL ashl AR,AL,AL ZB AR,A1 ashl A1,AL,AL ashl AR,AL,A1 ashl AR,AL,A1 ZB AR,A1 ashl A1,AL,A1 ZE ZE ZE ZE ZD ZD ZD ZD ZA insv AR,$H,$S,AL extv $H,$S,AR,AL extzv $H,$S,AR,AL HELP HELP HELP movd AR,A1 movZF AR,A1 ZA ZA tstZR AR pushl AR cvtZRl AR,-(sp) movzZRl AR,-(sp) movd AR,-(sp) cvtfd AR,-(sp) mnegZL AL,A1 mcomZL AL,A1 cvtZLl AL,A1 mcoml A1,A1 bitl ZZ,AL bitw ZZ,AL bitb ZZ,AL bicl2 AR,AL OL2 AR,AL OL2 AR,AL OL3 AR,AL,A1 divl3 AR,AL,A1 mull2 AR,A1 subl2 A1,AL divl3 AR,AL,A1 mull2 AR,A1 subl3 A1,AL,A1 incZL AL incZL AL incZL AL cvtZLl AL,AL incZL AL movzZLl AL,AL decZL AL decZL AL decZL AL cvtZLl AL,AL decZL AL movzZLl AL,AL incZL AL incZL AL cvtZLl AL,AL incZL AL movzZLl AL,AL decZL AL decZL AL cvtZLl AL,AL decZL AL movzZLl AL,AL OL2 AR,AL OL2 AR,AL OW2 AR,AL OW2 AR,AL OB2 AR,AL OB2 AR,AL OW2 AR,AL cvtZLl AL,AL OW2 AR,AL movzZLl AL,AL OB2 AR,AL cvtZLl AL,AL OB2 AR,AL movzZLl AL,AL OL2 AR,AL OL3 AR,AL,A1 OD2 AR,AL OF2 AR,AL cvtfd ((AR,A1 OD2 A1,AL cvtfd AL,A1 OD2 AR,A1 cvtdf A1,AL OD2 AR,AL OD3 AR,AL,A1 cvtfd AL,A1 OD2 AR,A1 cvtfd AR,A1 OD3 A1,AL,A1 OF3 AR,AL,A1 cvtfd A1,A1 help; I'm in trouble ĬݬP[P[Z~PYԊY[PݬЬ[Ь Z+PPPXZkw+ݏݬPYX1YYkalXPPPݬ"PY<\3ݏݬPYXYYݬPYY)YXPPPݬPYYPjYX kr  ZPݬ \~ݬ+ЬP PPFVSVVVUUЏUUdЏdU}PP1RU#Q yPPRyPVVPWQRU=;Q yPPRyPPRQQVW{VQWPVW{ VPVPPVPRUQyPPRyPPPPnPVnQPdP`VPSrPPRpP~Ь[  P ݏ- P ի ߘP@e [U>U +U  P2PPݫ~% PkЫk!k    k1WP֫pPPR RR RP|PpTPrPP" YЬ[ի ݫ Ь Ыk Ь[ZZZPЬ[ЬZ[XY YY  YXPx^B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uxvwy{/|}t~szuxvwvyw.{y|t}(~szuxsuxvwy{|t}~szuxvwyv{w|y}~szuxt"uxtvwy{|}~szuxvwy{|}~szuxtvwvyw{y|{}t~szuxszuxvwy{|}t~szuxvwy{|}~szuxtVYWXPNOVYWXPNORQRQSTVYWXPSNTOVYWXPNORQRQSTVYWXPSNTOVYWXPNORQRQSTVYWXPSNTOVYWXPNORQRQSTVYWXPSNTOVYWXPNORQvwy{RQ}STszux STVYWXPNOVYWXPNORQ RQSTVYWXSTLVYWXPNOVYWXRQPNORQSTRQSTVYWXPSNTOvwy{RQ|}~szuxvSwy{|}~szuxvwy{|}szuxnRKHk}*}r(\>zG.pGGGGGm:P}*}!GGaT.G!GGGGG5G($_:'GGGlGGMGGGm5UGG G &GG/jGGGG|dtGGF9 [R} {x/v$)us:olkfe d\ZVOH ##%%&&&"""( ))++ ,,..'/' 000233111115566**--447!!89:$$$$$$$$$$$$$$$$$;;;<  (("!#19 2!449826326:2!373338374 0298:4778 :46 223258599::::::::8332 8395)*$%9&+,-(/.57363599999522229573'+399972233933399bad bdtydimension table overflowwhiles, fors, etc. too deeply nestednon-constant case expressioncase not in switchswitch table overflowduplicate default in switchdefault not inside switchswitch table overflowduplicate case in switch, %dyacc stack overflowsyntax errorfunction level error$%dFAKEstructure typed union member must be namedfield outside of structureillegal field sizefield outside of structurezero or negative subscriptfunction declaration in bad contextold-fashioned initialization: use =nesting too deepillegal breakillegal continuestatement not reachedvoid function %s cannot return valueloop not entered at toploop not entered at toploop not entered at topprecedence confusion possible: parenthesize!old-fashioned assignment operator& before array or function: ignoredstructure reference must be addressableundeclared initializer name %s\+vo+u+z+++++++++++++++++FIELD[%d]%W% (Berkeley) %G%SNULLAUTOEXTERNSTATICREGISTEREXTDEFLABELULABELMOSPARAMSTNAMEMOUUNAMETYPEDEFFORTRANENAMEMOEUFORTRANUSTATIC 1@_0  "'`(2)3{4}5[6]7* ?:+ - /<%>&|^! L~M,88;9. D< S>U= ::3171<1)B1G1/L1*U1\1.d1,g1n1's11x1-|111%1&111$11(110111 1111+1PCC/364r1 vax uts3.0Release: %s rwccom:can't open %s abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$01234567890123456789abcdefABCDEF  01234567abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$123456789  unexpected EOFnewline in string or char constantnon-null byte ignored in string initializerempty character constanttoo many characters in character constantunexpected EOFillegal character: %03o (octal)illegal hex constantnewline in BCD constantBCD constant exceeds 6 charactersgcos BCD constant illegalambiguous assignment: assignment op taken=<%c illegal=>%c illegalyylex error, character %03o (octal)out of switch in yylexbad asm constructionbad AR_?? action0,0,LL%d LL%d: Ran out of memory (savestr)ran out of memory (hash)ran out of hash tables%W% (Berkeley) %G%asmautobreakcharcasecontinuedoubledefaultdoexternelseenumforfloatfortrangotoifintlongreturnregisterswitchstructsizeofshortstatictypedefunsignedunionvoidwhile9defid calltyreducedefid( %s (%d), , %s, (%d,%d) ), level %d modified to , %s previous def'n: , %s, (%d,%d) ), level %d declared argument %s is missing previous class: %s redeclaration of: %sredeclaration of %s new entry made void type for %s dimoff, sizoff, offset: %d, %d, %d parameter stack overflowbcsave errorparameter reset errorswitch errordclargs() %s (%d) dclstruct( %s ), szindex = %d ??gummy structure memberillegal zero sized structure member: %szero sized structure dimtab[%d,%d,%d] = %d,%d,%d member %s(%d) redeclaration of formal parameter, %scompiler takes alignment of functioncompiler takes size of functionunknown sizeinitialization alignment errorinoff errorbeginit(), curid = %d instk((%d, %o,%d,%d, %d) no automatic aggregate initializationinsane structure member listendinit(), inoff = %d too many initializersempty array declarationbad scalar initializationcannot initialize extern or union} expecteddoinit(%o) illegal initializationillegal {irbrace(): paramno = %d on entry too many local variablesStructure too largetoo many local variablesillegal field typefield too bigzero size fieldstructure too largestructure too largenidcl error .lcomm L%d,%d .lcomm %s,%d illegal type combinationtymerge: arg 1Null dimensionarray of functions is illegalfunction returns illegal typea function is declared as an argumentfunction illegal in structure or unionfunction has illegal storage classillegal use of fieldillegal classillegal classillegal classillegal register declarationillegal classillegal classfortran declaration must apply to functionfortran function has wrong typeillegal class: %dSymbol table full nonunique entry for %s from %d to %d lookup( %s, %d ), stwart=%d, instruct=%d symbol table fullsymbol table full%s undefinedremoving %s from stab[ %d], flags %o level %d symbol table full%s redefinition hides earlier one %d hidden in %d unhide uncovered %d from %d unhide fails%W% (Berkeley) %G%>buildtree( %s, %o, %o ) constant argument to NOTconstant in conditional contextdivision by 0.illegal lhs of assignment operator%s undefinedmember of structure or union requiredmember %s==%s? illegal member use: %snonunique name demands struct/union or struct/union pointerstruct/union or struct/union pointer requiredundefined structure or unionillegal member use: %sillegal indirectionunacceptable operand of &assignment of different structurestype clash in conditionalillegal functionillegal functionother code %dchkstr( %s(%d), %d ) undefined structure or uniongummy structureillegal member use: perhaps %s.%s?division by 0division by 0illegal comparison of enumsenumeration type clash, operator %sillegal combination of pointer and integer, op %sillegal structure pointer combinationillegal array size combinationillegal pointer combinationpointer requiredillegal oconvert: %dillegal pointer subtractionillegal types in :void type illegal in expressiontymatch(%o): %o %s %o => %o constant expectedconstant too big for cross-compileroperands of %s have incompatible typessizeof returns 0 %o) %s, %ld, %d, , %d, %d statement not reachedL%d%W% (Berkeley) %G%>PQTURSXYVW& error%W% (Berkeley) %G% B   cvtblcvtwlmovlmovlmovfmovd movzbl movzwlmovlmovl ret jbr L%d .align %d .text .data .data 1 .data 2 .stab illegal location counterL%d: .lcomm L%d,%d movab L%d,r1 movab L%d,r0 .set L%d,0x%x .align 1 .word L%d jbr L%d L%d: movab L%d,r0 jsb mcount .data .align 2 L%d: .long 0 .text %s %d(ap),r%d bad argumentbad argument .globl %s %s: " .ascii "\%c\%o" .ascii "%c" .space %d illegal field type%s, line %d: movl casel r0,$%ld,$%ld L%d: .word L%d-L%d L%d: L%d: cmpl r0,$%ld jeql L%d cmpl r0,$%d jeql L%d jbr L%d jgtr L%d jgtr L%d L%d: %W% (Berkeley) %G%HCbad conversionincode: field > int .long 0x%x %s 0%c%.20e .double.float .long 0x%x .comm %s,%ld 0,%d,%d 0,%d,%d 0,%d,0 0,%d,L%d 0,%d,%s 0,%d,%d 0,%d,%d No .stab for %s .stabn .stabs "%s", 0%o, .stabd 0%o,0,0%o 1,0,%d 0,0,LL%d LL%d: 0,%d,_%s %W% (Berkeley) %G%E#E(E.E5E;EBEFELEQEVE\EcEkErEyEQPUTSRYXWVbad option: %cstore called on: SZEROSONESMONESPECIAL+%d|order( %o, ) order( %o, ), cookie , rewrite %s no table entry for op %sillegal initializationexpression causes compiler loop: try simplifying %o) %s %s size=%d align=%d, , NOPREFMUSTDO PREF %s, SU= %d %W% (Berkeley) %G%SANYSAREGSTAREGSBREGSTBREGSCCSNAMESCONSFLDSOREGSTARNMSTARREGINTEMPFORARGSWADDII I J=J JJJJJ J<#J'J+J/J3J4J7J:J=J@JCJFJIJLJOJRJVJZJ]J`JcJ  fJqJ|JJJJJJJJ<J>J=J?J%s, line %d: # line %d, file %s L%d: subl2 $%ld,sp movab -%ld(sp),sp jbr L%d %s%cno hoptab for %sdflwbzzzcode- bad typel clrl %s clr mnegmoval ,cvtmovzlcvt ,cvtl ,movmovzcvtcvt ,movlcvtl->%d<-$%d %sincdec %saddsub2 ,->%d<-dfl->%d<-$%ld$%d$%dSTASG badSTASG-rstructure size <0=0 or >65535 movb movw movl movq movc3 $%d,, illegal zzzcode %s %s,%s movfmovdmovlillegal makeor2 shumul:op=%d,lop=%d,rop=%d prname=%s,plty=%d, prlval=%D $%ld%sillegal conputinsputupput$%s*-(%s)+[%s]bad arg temp%ld(ap)(%s)*%s(%s)%s-+illegal address%ld%s%s+%ld addl2 $%d,sp jbr L%d bad conditional branch: %saddress of OREG taken%W% (Berkeley) %G%addsubmuldivbisxorbicaddsubmuldivbisxorbicr0r1r2r3r4r5r6r7r8r9r10r11apfpsppc jeql L%d jneq L%d jleq L%d jlss L%d jgeq L%d jgtr L%d jlequ L%d jlssu L%d jgequ L%d jgtru L%d udivuremudivurem%?%= @<<A<<= 0B>>C>>= 0|h|=i ^h^=i N++ O-- E->FCALLIFCALLP==Q!=R<=S<T>U>YUGTXUGEWULTVULE]A>>!TYPE6[mCBRANCHgFLDjPMCONVkPVCONV$RETURN oCAST %GOTObSTASG cSTARGdSTCALLfUSTCALL#T)T.T3T9T=TBTHTOTUT]TdTjTpTwTTTT RR too many errorscannot recover from earlier errors: goodbye! compiler error: warning: out of tree space; simplify expressionwasted space: %ofreeing blank tree!undeffargcharshortintlongfloatdoublestrtyuniontyenumtymoetyucharushortunsignedulong??PTR FTN ARY %sout of temporary string spaceout of memory (tstr)%W% (Berkeley) %G%%W% (Berkeley) %G%  AAAAAABBBBBB ^^Vtf@i9k  d2i  X^Юn PPՀPpPPWoPT [Ь[[[[U_PPS_5ݏϲVPݏxXݏ \`GϵS__Z[_ZP1Sԭԭ׬լ1мP`+^1мP`-мPiϜh֭1խIݏ[ݏXݼEPݼݏXݏ \FSݏ|aݏ[G֭3ݏ[ݏXݼφEPݼݏXݏ \zFRݏ|eݏ[ϊG׬1,ωUP^^PP ^' ϖP]]PP]]PP]Z6PY[% ^ 71[Ϸ]Jϧ]*-P-[Z[Zϖ]ϋ]Yխ1ZݏXݏ \ϤE]ݏXݏ \ϏE]ݏXݏ \zE]ݏXݏ \eE\ݏYݏ \PE\ݏYݏ \;E\ݏ+Yݏ \&EϾ\ݏP,i)Y,PYYPԫ1;ݏ4]ݏ1ZϾA1ЭP:P PPݏ4]ݏ5ZϖAЭP$1wP( ݏ:ZoA ψP[ЭPkԫώXϑP1P-1[P%1y2P1UP1 P1P1P 1P+1 P&13P,11vP21 P/1 P.11WP01Y1LP;1 P3117P<11,1)ԫZЭ[[Zԫ k"1ϮWЭP֭`׭ЭP`$PPcP϶ ݏ>Ϡ* ݏ> 6P[ kԫAWЭP֭`-׭ЭP`#WPPPO PPOԫZ[[Zԫ ԫ׭ЭPPЭP(P1 ^1t 1ϝT[PSNSPIS`PʏP ݏ[ς?PZP JϙRZHZ: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bicw2rbicw3bisb2qbisb3bisl2sbisl3bisw2rbisw3bitbbitlbitwblbsblbcbleqblequblssblssu bneqbnequbrbbrwbvcbvscallg calls caseb"casel"casew"clrb clrd clrf clrl clrq clrw cmpbcmpdcmpfcmplcmpwcvtbdQcvtbfAcvtbl1cvtbw!cvtdbcvtdfEcvtdl5cvtdw%cvtfbcvtfdTcvtfl4cvtfw$cvtlbcvtldScvtlfCcvtlw#cvtrdl5cvtrfl4cvtwbcvtwdRcvtwfBcvtwl2decb decl decw divb2qdivb3divd2udivd3divf2tdivf3divl2sdivl3divw2rdivw3extvextzvincb incl incw insvjmpmcombmcomlmcomwmnegbmnegdmnegfmneglmnegwmovab0movad0movaf0moval0movaq0movaw0movb movd movf movl movq movw movzbl)1movzbw)!movzwl)2mulb2qmulb3muld2umuld3mulf2tmulf3mull2smull3mulw2rmulw3pushab1pushad1pushaf1pushal1pushaq1pushaw1pushlret!sobgeq+sobgtr,subb2qsubb3subd2usubd3subf2tsubf3subl2ssubl3subw2rsubw3tstbtstdtstftstltstwxorb2qxorb3xorl2sxorl3xorw2rxorw3movc34.globl.text$.data%.bss&.align'.word*.long2.set3.lcomm;.comm<.end(rsb5jsb6mfpr7mtpr8prober9probew:adawiaddp4addp6adwcashpbicpswbispswbptbsbbbsbwchmechmkchmschmucmpc3cmpc5cmpp3cmpp4cmpvcmpzvcrccvtlpcvtplcvttpcvtptcvtpscvtspdivpeditpcedivemoddemodfemulffcffshaltindexinsqueldpctxloccmatchcmovc5movpmovpslmovtcmovtucmulpnoppolydpolyfpoprpushrreiremquerotlsbwcscancskpcspancsubp4subp6svpctxxfcescdesceescfPЬ[Ь Z+PPPXZ kw+ݏݬPYX1YY$ kalXPPPݬ2 PY<#+3ݏݬPYXYY ݬ PYY)YXPPPݬ PYYPjYX kr  ZPݬ \~ݬ[ЬP PPP|\~ݬPPЬ[  P ݏ} P ի ߘP@) [[f S  P2PPݫ~ PkЫk!k    k1WP֫Ь[ի ݫ6 Ь ЫkЬ[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out of space rC2: can't find %s wC2: can't create %s %d iterations %d jumps to jumps %d inst. after jumps %d jumps to .+1 %d redundant labels %d cross-jumps %d code motions %d branches reversed %d redundant moves %d simplified addresses %d loops inverted %d redundant jumps %d common seqs before jmp's %d skips over jumps %d sob's added %d redundant tst's %d jump on bit %d field operations %dK core ? %s %s %s%c.text L%d:%s:%s %s%cL%d mova%c L%d,%s bwlq.long L%d L%d: .word L%d-L%d @(#)c21.c 4.5 7/5/81  Uses: %d: %s - c2: zero divide fp(fp),fp(fp)$%d]%d%s%s+$-r%dmcountRegs: %d: %d%d %s - $0$0-(sp)-(sp)%s,%s$%d,$%d,%s,%s$1$0  AAAAAABBBBBB |a|a,]r((@iTk $W/iDh /* conf.c 4.7 81/03/15 */ #include "../h/param.h" #include "../h/inode.h" #include "../h/pte.h" #include "../h/mbareg.h" #include "saio.h" devread(io) register struct iob *io; { return( (*devsw[io->i_ino.i_dev].dv_strategy)(io, READ) ); } devwrite(io) register struct iob *io; { return( (*devsw[io->i_ino.i_dev].dv_strategy)(io, WRITE) ); } devopen(io) register struct iob *io; { (*devsw[io->i_ino.i_dev].dv_open)(io); } devclose(io) register struct iob *io; { (*devsw[io->i_ino.i_dev].dv_close)(io); } nullsys() { ; } int nullsys(); int hpstrategy(), hpopen(); int htstrategy(), htopen(), htclose(); int upstrategy(), upopen(); int tmstrategy(), tmopen(), tmclose(); int tsstrategy(), tsopen(), tsclose(); int rkopen(),rkstrategy(); struct devsw devsw[] = { "hp", hpstrategy, hpopen, nullsys, "ht", htstrategy, htopen, htclose, "up", upstrategy, upopen, nullsys, "tm", tmstrategy, tmopen, tmclose, "hk", rkstrategy, rkopen, nullsys, "ts", tsstrategy, tsopen, tsclose, 0,0,0,0 }; @iVkʦ :-LhjȪ cp /dev/null /etc/vipw.lock chmod 0 /etc/vipw.lock ln /etc/vipw.lock /etc/ptmp > /dev/null 2>& 1 case $? in 0) trap '' 1 2 3 15 vi /etc/passwd rm /etc/ptmp ;; *) echo Temporary file busy,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mark, csvax.mark@berkeley, or ucbvax!mark or lose them! sw|switch|intelligent switch:co#80:os:am: su|dumb|un|unknown:co#80:os:am: sp|plugboard:co#80:os:am: se|ethernet|network:co#80:os:am: sd|du|dialup:co#80:os:am: sb|bussiplexer:co#80:os:am: sa|arpanet|network:co#80:os:am: la|adm3a|3a|lsi adm3a:\ :am:bs:cm=\E=%+ %+ :cl=1^Z:co#80:ho=^^:li#24:ma=^K^P:nd=^L:up=^K: h2|2621|hp2621|hp2621a|hp2621p|2621|2621a|2621p|hp 2621:\ :is=\E&j@\r\E3\r:bt=\Ei:cm=\E&a%r%dc%dY:dc=2\EP:ip=2:\ :kh=\Ep\r:ku=\Et\r:kl=\Eu\r:kr=\Ev\r:kd=\Ew\r:\ :kn#8:k1=\Ep\r:k2=\Eq\r:k3=\Er\r:k4=\Es\r:k5=\Et\r:k6=\Eu\r:k7=\Ev\r:\ :k8=\Ew\r:ks=\E&jB:ke=\E&j@:ta=2^I:tc=hp: cr|c100rv|c100rv4p|c100 rev video:\ :is=\EU\Ef\E7\E5\E8\El\ENH\Ek\E\200\Eo&\200\Eo\47\E:vs@:ve@:\ :vb=\EK\200\200\200\200\200\200\200\200\200\200\200\200\200\200\Ek:\ :tc=c100: co|c100|concept|c104|c1004p|concept100|concept 100:\ :is=\EU\Ef\E7\E5\E8\El\ENH\EK\E\200\Eo&\200\Eo\47\E:\ :ti=\EU\Ev 8p\Ep\r:te=\Ev \200\200\200\200\200\200\Ep\r\n:\ :al=3*\E^R:am:bs:cd=16*\E^C:ce=16\E^S:cl=2*^L:cm=\Ea%+ %+ :co#80:\ :dc=16\E^A:dl=3*\E^B:ei=\E\200:eo:im=\E^P:in:ip=16*:li#24:mi:nd=\E=:\ :pt:kb=^h:ta=8\t:ul:up=\E;:db:us=\EG:ue=\Eg:xn:vs=\EW:ve=\Ew:\ :vb=\Ek\200\200\200\200\200\200\200\200\200\200\200\200\200\200\EK:\ :us=\EG:ue=\Eg:ks=\EX:ke=\Ex:ku=\E;:kd=\E<:kl=\E>:kr=\E=:kh=\E?:\ :k1=\E5:k2=\E6:k3=\E7:.dN#9:dC#9: mm|mime|mime1|mime2|mimei|mimeii|microterm mime1:\ :al=80^A:am:bs:cd=^_:ce=^^:cl=\035^C:cm=^T%+^X%> 0%+P:co#80:\ :dl=80^W:ta=2^I:li#24:nd=^X:pt:uc=^U:up=^z:ho=\035:do=^K:is=^S\E:\ :ma=^X ^K^J^Z^P:ku=^Z:kd=^K:kl=^H:kr=^X:sr=3^R: kb|h19|heath|h19b|heathkit|heath-19|z19|zenith|heathkit h19:\ :al=1*\EL:am:bs:cd=\EJ:ce=\EK:cl=\EE:cm=\EY%+ %+ :co#80:dc=\EN:\ :dl=1*\EM:do=\EB:ei=\EO:ho=\EH:im=\E@:li#24:mi:nd=\EC:as=\EF:ae=\EG:\ :ms:pt:sr=\EI:se=\Eq:so=\Ep:up=\EA:vs=\Ex4:ve=\Ey4:\ :kb=^h:ku=\EA:kd=\EB:kl=\ED:kr=\EC:kh=\EH:kn#8:\ :k1=\ES:k2=\ET:k3=\EU:k4=\EV:k5=\EW:\ :l6=blue:l7=red:l8=white:k6=\EP:k7=\EQ:k8=\ER: l3|adm3|3|lsi adm3:\ :am:bs:cl=^Z:li#24:ma=^K^P:co#80: # Termcap source file %W% %G% # Mark Horton, U.C. Berkeley # # This file describes capabilities of various terminals, as needed by # software such as screen editors. It does not attempt to describe # printing terminals very well, nor graphics terminals. Someday. # See termcap(5) in the Unix Programmers Manual for documentation. # # The A manufacturer represents Diablo, DTC, Xerox, Qume, and other Daisy # wheel terminals until such time as termcap distinguishes between them # enough to justify separate codes. # 1620 uses all 132 columns, 1640 sets left margin to 8 and uses snazzy # binary tabset file. Both should work on both terminals. A6|1620|450|diablo 1620:\ :if=/usr/lib/tabset/std:\ :kb=^H:bs:co#132:ff=^L:hc:hu=\EU:hd=\ED:os:pt:up=\E\n: A7|1640|diablo 1640:\ :co#124:if=/usr/lib/tabset/diablo:tc=1620: Ad|dtc300s|300|300s|gsi|dtc|dtc 300s:\ :if=/usr/lib/tabset/std:\ :kb=^h:bs:co#132:ff=^L:hc:hu=\EH:hd=\Eh:os:pt:up=^Z: Ag|gsi:bs:co#132:hc:hd=\Eh:hu=\EH:os:pt:up=^Z: Aj|aj830|aj832|aj|anderson jacobson:\ :bs:hc:hd=\E9:hu=\E8:os:pl:up=\E7: Aq|qume5|qume|Qume Sprint 5:\ :if=/usr/lib/tabset/std:\ :kb=^h:bs:co#80:ff=^L:hc:hu=\EH:hd=\Eh:os:pt:up=^Z: Ax|x1720|x1700|1700|x1750|xerox 1720:co#132:bs:ff=^L:hc:os:pt:if=/usr/lib/tabset/xerox1720 Ca|cdc456|cdc:\ :li#24:co#80:cl=^Y^X:nd=^L:up=^Z:bs:\ :cm=\E1%+ %+ :ho=^Y:al=\E\114:dl=\E\112:ce=^V:cd=^X:am: Cc|cdc456tst:\ :li#24:co#80:cl=^y^x:bs:cm=\E1%+ %+ :am: D0|dm1520|dm1521|1521|1520|datamedia 1520:\ :am:bs:cd=^K:ce=^]:cl=^L:cm=^^%r%+ %.:co#80:ho=^Y:\ :ku=^_:kd=^J:kl=^H:kr=^\:kh=^Y:\ :li#24:nd=^\:up=^_:xn:ma=^\ ^_^P^YH:pt: D1|dm1521|1521|datamedia 1521:\ :am:bs:cd=^K:ce=^]:cl=^L:cm=^^%r%+ %.:co#80:ho=^Y:\ :ku=^_:kd=^J:kl=^H:kr=^\:kh=^Y:\ :li#24:nd=^\:up=^_:xn:ma=^\ ^_^P^YH:pt: D2|dm2500|datamedia2500|2500|datamedia 2500:\ :al=15^P\n^X^]^X^]:bs:ce=^W:cl=^^^^\177:cm=^L%r%n%.%.:co#80:\ :dc=10*^P\b^X^]:dl=10*^P^Z^X^]:dm=^P:ed=^X^]:ei=10\377\377^X^]:ho=^B:\ :ic=10*^P^\^X^]:im=^P:li#24:nc:nd=^\:pc=\377:so@=^N:se=^X^]:up=^Z: D3|dm3025|datamedia 3025a:is=\EQ\EU\EV:\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^NV:ma=^K^J^Z^P^Y :xr: # Since nd is blank, when you want to erase something you # are out of luck. You will have to do ^L's a lot to # redraw the screen. h1000 is untested. It doesn't work in # vi - this terminal is too dumb for even vi. (The code is # there but it isn't debugged for this case.) H1|h1000|hazeltine 1000:bs:ho=^K:cl=^L:nd= :co#80:li#12: # Note: the h1552 appears to be the first Hazeltine terminal which # is not braindamaged. It has tildes and backprimes and everything! # Be sure the auto lf/cr switch is set to cr. H2|h1552|hazeltine 1552:\ :al=\EE:dl=\EO:f1=\EP:l1=blue:f2=\EQ:l2=red:f3=\ER:l3=green:tc=vt52: H3|h1552rv|hazeltine 1552 reverse video:\ :so=\ES:se=\ET:tc=h1552: H5|h1500|hazeltine 1500:\ :al=40~^Z:am:bs:cd=10~^X:ce=~^O:cl=~^\:cm=~^Q%r%.%.:co#80:\ :dl=40~^S:do=~^K:li#24:nd=^P:.se=~^_:.so=~^Y:up=~^L: # h1510 assumed to be in sane escape mode. Else use h1500. H6|h1510|hazeltine 1510:\ :al=\E^Z:am:bs:cd=\E^X:ce=\E^O:cl=\E^\:cm=\E^Q%r%.%.:co#80:\ :dl=\E^S:do=\E^K:li#24:nd=^P:.se=\E^_:.so=\E^Y:up=\E^L: H8|h1520|hazeltine 1520:\ :al=~^Z:am:bs:cd=~^X:ce=~^O:cl=~\034:cm=~^Q%r%.%.\200:co#80:\ :dl=~^S:do=~^K:hz:li#24:nd=^P:se=~^Y:so=~\037:up=~^L:ho=~^R: # Note: h2000 won't work well because of a clash between upper case and ~'s. H7|h2000|hazeltine 2000:\ :al=6~^z:am:bs:cl=6~^\:cm=~^q%r%.%.:co#74:\ :dl=6~^s:ho=~^r:li#27:nc:pc=\177: # One of these should go in the misc category, IBM and ISC can't # both have I. I will wait to see who comes out with more terminals. I8|8001|ISC8001:al=\EU:am:bc=^Z:cl=3*^L:cm=^C%r%.%.:co#80:\ :cd=\EQ:dm=\EQ:ed=\EF:\ :dc=\177:dl=\EV:ei=\EF:im=\EQ:li#40:nd=1^Y:ta=8\t:\ :up=^\:ho=1^H:pc=^@: It|intext|ISC modified owl 1200:\ :al=5.5*\020:am:bc=\037:bs:cd=5.5*\026J:cl=132\014:\ :cm=\017%+ %+ :co#80:dc=5.5*\022:dl=5.5*\021:\ :ei=\026\074:im=\026\073:ip=5.5*:in:li#24:nd=\036:up=\034:\ :ma=^K^P^R^L^L :kl=^H:kd=^J:kr=^L:ku=^K: I9|ibm|ibm3101|3101|i3101|IBM 3101-10:\ :if=/usr/lib/tabset/3101:\ :am:bs:cl=^[K:li#24:co#80:nd=^[C:up=^[A:cd=^[J:ce=^[I:\ :kd=\EB:kl=\ED:kr=\EC:ku=\EA:ho=^[H:cm=\EY%+\40%+\40:pt: L3|digilog|333|digilog 333:bs:co#80:ce=\030:ho=^n:li#16:nd=^i:up=^o: # uses xon/xoff, so no padding needed. ks/ke have nothing to do with arrow # keys. is sets 80 col mode, normal video, autowrap on (for am). # Seems to be no way to get rid of status line. M1|tab132|tab|tab132/15|tab 132/15:is=\E[?7h\E[?3l\E[?5l:dN@:ks@:ke@:\ :da:db:al=\E[L:dl=\E[M:dc=\E[P:ei=\E[4l:im=\E[4h:cm=\E[%i%d;%dH:\ :ku=\E[A:kd=\E[B:kl=\E[D:tc=vt100: M2|tab132w:co#132:is=\E[?7h\E[?3h\E[?5l:tc=tab132: M3|tab132rv:is=\E[?7h\E[?3l\E[?5h:tc=tab132: M4|tab132wrv:is=\E[?7h\E[?3h\E[?5h:tc=tab132w: M5|mw2|Multiwriter 2:\ :co#132:hc:os:de#001202: M6|trs80|trs-80|radio shack trs-80 Model I:\ :am:bs:co#64:li#16: M7|d800|Direct 800/A:\ :co#80:li#24:am:cl=\E[1;1H\E[2J:bs:cm=\E[%i%d;%dH:\ :nd=\E[C:up=\E[A:ce=\E[K:cd=\E[J:\ :if=/dskb/rcd/.dinit:\ :so=\E[7m:se=\E[0m:us=\E[4m:ue=\E[0m:xs:vs=\E[>12l:ve=\E[>12h:\ :sf=\ED:sr=\EM:da:db:as=\E[1m:ae=\E[0m:ms:pt:\ :kl=\E[D:kr=\E[C:ku=\E[A:kd=\E[B:\ :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:\ :k5=\EOT:k6=\EOU:k7=\EOV:k8=\EOW: M8|vc404|volker-craig 404:\ :am:bs:cd=40^W:ce=20^V:cl=40^X:cm=^P%+ %+ :co#80:ho=40^Y:\ :kd=^J:kl=^H:kr=^U:ku=^Z:li#24:ma=^Z^P^U :nd=^U:up=^Z: M9|vc404s|volker-craig 404 w/standout mode:\ :se=^O:so=^N:tc=vc404: MA|vc404na|volker-craig 404 w/no arrow keys:ma@:kr@:ku@:tc=vc404: MB|vc404sna|volker-craig 404 w/standout mode and no arrow keys:\ :se=^O:so=^N:tc=vc404na: # missing in vc303a and vc303 descriptions: they scroll 2 lines at a time MC|vc303a|vc403a|volker-craig 303a:\ :am:bs:ce=20^V:cl=40^X:co#80:ho=40^Y:kd=^J:kl=^H::kr=^U:\ :ku=^Z:li#24:ll=^P^@W:nd=^U:ns:up=^Z: MD|vc303|vc103|vc203|volker-craig 303:\ :am:bs:cl=40^L:co#80:ho=40^K:kd=^J:kl=^H:kr=^I:ku=^N:li#24:\ :ll=^O\200W:nd=^I:ns:up=^N: ME|ampex|d80|dialogue|dialogue80|ampex dialogue 80:\ :am:bs:pt:if=/usr/lib/tabset/stdcrt:cl=\E*:cm=\E=%+ %+ :\ :al=\EE:bt=\EI:ic=\EQ:im=:ei=:dl=\ER:dc=\EW:\ :ce=\Et:cd=\Ey:so=\Ej:se=\Ek:li#24:co#80:nd=^L:up=^K: MF|aaadb|ann arbor ambassador 48/destructive backspace:\ :is=\E[48;0;0;48p\E[H\E[J\E[>30h\E[1Q\E[m:bs@:\ :vs=\E[>30l:ve=\E[>30h:tc=aaa: MG|compucolor|compucolorII:\ :pt:am:cm=%r^C%.%.:bc=^Z:li#32:co#64:\ :cl=^L:ho=^H:nd=^Y:up=^\: MH|d132|datagraphix|datagraphix 132a:\ :co#80:li#30:cl=^l:ho=\Et:da:db:sf=\Ev:sr=\Ew:\ :up=\Ek:nd=\El:vs=\ex:ve=\Em\En:\ :al=\E3:ic=\E5:dc=\E6:in:ic=\E5: MI|soroc|Soroc 120:\ :cd=\EY:ce=\ET:cl=2\E*:ma=^K^P^R^L^L :\ :kl=^H:ku=^K:kr=^L:kd=^J:tc=adm3a: Ma|aa|annarbor|ann arbor:\ :cm=^O%r%B%.%>^S^L%+@:co#80:li#40:bs:cl=2^L:up=^N:nd=^_:ho=^K:am:\ :kb=^^:kd=^J:ku=^N:kl=^H:kr=^_:kh=^K:ma=^_ ^N^P: # Needs function keys added. Also can't use 60 line mode because it needs # too much nl delay - can fix for nl but not out of vi. # The cl delay is sufficent, but a smaller one could do. # This entry is merged from Mike O'Brien@Rand and Howard Katseff at # Bell Labs((@irkpw/ dgjmpsvy|h, and is untested. Mb|aaa|ambas|ambassador|ann arbor ambassador/48 lines:\ :al=\E[L:am:bs:\ :cd=\E[0J:ce=\E[0K:cl=400\E[;H\E[0J:cm=\E[%i%d;%dH:co#80:\ :da:db:dc=\E[4h\E[1Q\E[P\E[4l\E[0Q:dc=\E[P:dl=\E[M:dm=\E[1Q:\ :ed=\E[0Q:ei=\E[0Q:ho=\E[;H:ic=\E[@:if=/usr/lib/tabset/aa:im=\E[1Q:\ :is=\E[48;0;0;48p\E[H\E[J\E[1Q\E[m:li#48:mi:\ :nd=\E[C:nl=\ED:pt:sf=\E[S:sr=\E[T:se=\E[m:so=\E[7m:up=\E[A: Md|datapoint|dp3|dp3360|datapoint 3360:\ :am:bs:cd^_:ce=^^:cl=^]^_:co#82:ho=^]:li#25:nd=^x:up=^z: Mg|dg|dg6053|data general 6053:\ ca:am:bs:cm=^P%r%.%.:cl=^L:ho=^H:nd=^S\ up=^W:ce=^K:co#80:li#24: Mi|cdi|cdi1203:am:bs:hc:os:co#80:cD#200: Mk|teletec|tec|Teletec Datascreen:\ :am:bs:co#80:cl=^l:ho=^^:li#24:nd=^_:up=^k: # ^S is an arrow key! Boy is this guy in for a surprise on v7! Ml|sol:\ :am:bs:cm=\E^1%.\E^2%.:cl=^K:ho=^N:co#64:li#16:nd=^S:up=^W:\ :kl=^A:kr=^S:ku=^W:kd=^Z:ma=^A^H^S ^W^P^Z^N: Mn|xl83|Cybernex XL-83:\ :am:bs:cd=62^P:ce=3^O:cl=62^L:cm=^W%+ %+ :co#80:ho=^K:\ :kd=^J:kl=^H:ku=^N:li#24:up=^N:nd=^I: Mo|omron|Omron 8025AG:\ :al=\EL:am:bs:cd=\ER:co#80:ce=\EK:cl=\EJ:da:db:dc=\EP:dl=\EM:\ :ho=\EH:li#24:nd=\EC:se=\E4:sf=\ES:so=\Ef:sr=\ET:up=\EA:ve=:vs=\EN: Mp|plasma|plasma panel:am:bs:cl=^L:co#85:ho=^^:li#45:nd=\030:up=\026: Ms|swtp|ct82|southwest technical products ct82:\ :am:bs:bc=^d:al=^\^y:cd=^v:ce=^F:cl=^L:cm=%r^k%.%.:co#82:li#20:\ :dl=^z:nd=^s:up=^a:so=^^^v:se=^^^F:dc=^\^h:ic=^\^x:ho=^p:\ :ei=:sf=^n:sr=^o:ll=^c:im=:\ :is=^\^r^^^s^^^d^]^w^i^s^^^]^^^o^]^w^r^i: Mt|terak|Terak emulating Datamedia 1520:tc=dm1520: My|mdl110|cybernex mdl-110:cm=^P%+ %+ :co#80:li#24:am:cl=70^X:bs:\ :nd=^U:up=^Z:ho=^Y:ce=145^N@^V:cd=145^NA^W:al=65^NA^N^]:\ :dl=40^NA^N^^:im=:\ :ei=:ic=3.5^NA^]:dm:ed:dc=3.5^NA^^:so=^NF:se=^NG:ta=43\t:\ :ma=^Z^P:cd=6^N@^V Mz|zen30|z30|zentec 30:\ :mi:co#80:li#24:ma=^L ^R^L^K^P:ul:\ :al=1.5*\EE:bs:ce=1.0*\ET:cm=\E=%+ %+ :cl=\E*:\ :ho=^^:nd=^L:se=\EG0;so=\EG6:up=^K:im=\Eq:ei=\Er:\ :am:dc=\EW:dl=1.5*\ER:cd=\EY: T3|33|tty33|tty|model 33 teletype:\ :co#72:hc:os: T4|43|tty43|model 43 teletype:\ :kb=^h:am:bs:hc:os:co#132: T7|37|tty37|model 37 teletype:\ :bs:hc:hu=\E8:hd=\E9:up=\E7:os: # The Visual 200 beeps when you type a character in insert mode. # This is a horribly obnoxious misfeature, and some of the entries # below try to get around the problem by ignoring the feature or # turning it off when inputting a character. They are said not to # work well at 300 baud. (You could always cut the wire to the bell!) V2|vi200|visual 200 with function keys:\ :al=\EL:am:bs:cd=\Ey:ce=4*\Ex:cl=\Ev:\ :cm=\EY%+ %+ :co#80:dc=4*\EO:dl=4*\EM:ho=\EH:\ :im=:ei=:ic=\Ei \b\Ej:\ :is=\E3\Eb\Ej\E\\\El\EG\Ed\Ek:\ :k0=\EP:k1=\EQ:k2=\ER:k3=\E :k4=\E!:k5=\E":k6=\E#:\ :k7=\E$:k8=\E%:k9=\E&:kl=\ED:kr=\EC:ku=\EA:kd=\EB:kh=\EH:\ :li#24:nd=\EC:pt:sr=\EI:up=\EA:vs=\Ed:ve=\Ec: VR|vi200rvic|visual 200 reverse video using insert char:\ :ei=\Ej:im=\Ei:ic@:tc=vi200rv: # The older Visuals didn't come with function keys. This entry uses # ks and ke so that the keypad keys can be used as function keys. # If your version of vi doesn't support function keys you may want # to use V2. Vf|vi200f|visual|visual 200 no function keys:\ :al=\EL:am:bs:cd=\Ey:ce=4*\Ex:cl=\Ev:\ :cm=\EY%+ %+ :co#80:dc=4*\EO:dl=4*\EM:ho=\EH:\ :im=:ei=:ic=\Ei \b\Ej:\ :is=\E3\Eb\Ej\E\\\El\EG\Ed\Ek:ks=\E=:ke=\E>:\ :k0=\E?p:k1=\E?q:k2=\E?r:k3=\E?s:k4=\E?t:k5=\E?u:k6=\E?v:\ :k7=\E?w:k8=\E?x:k9=\E?y:kl=\ED:kr=\EC:ku=\EA:kd=\EB:kh=\EH:\ :li#24:nd=\EC:pt:sr=\EI:up=\EA:vs=\Ed:ve=\Ec: Vr|vi200rv|visual 200 reverse video:\ :so=\E4:se=\E3:sr@:vs@:ve@:tc=vi200: Vt|vi200ic|visual 200 using insert char:\ :ei=\Ej:im=\Ei:ic@:tc=vi200: Xa|tek|tek4012|4012|tektronix 4012:\ :is=\E^O:bs:cl=1000\E^L:co#75:ns:li#35:os: Xb|tek4013|4013|tektronix 4013:\ :as=\E^N:ae=\E^O:tc=4012: Xc|tek4014|4014|tektronix 4014:\ :is=\E^O\E9:co#81:li#38:dF#1000:tc=tek4012: Xd|tek4015|4015|tektronix 4015:\ :as=\E^N:ae=\E^O:tc=4014: Xe|tek4014sm|4014sm|tektronix 4014 in small font:\ :is=\E^O\E\072:co#121:li#58:tc=tek4014: Xf|tek4015sm|4015sm|tektronix 4015 in small font:\ :as=\E^N:ae=\E^O:tc=4014sm: # I think the 1000UP is supposed to be so expensive it never happens. X4|tek4023|4023|tektronix 4023:\ :so=^_P:se=^_@:cm=\034%r%+ %+ :nd=\t:bs:cl=4\E^L:co#80:li#24:am:\ :up=1000UP: # Can't use cursor motion because it's memory relative, and because # it only works in the workspace, not the monitor. Same for home. # Likewise, standout only works in the workspace. X5|4025|4027|4024|tek4025|tek4027|tek4024|4025cu|4027cu|tektronix 4024/4025/4027:\ :is=\41com 31\r\n^_sto 9,17,25,33,41,49,57,65,73\r:\ :ks=^_lea p4 /h/\r^_lea p8 /k/\r^_lea p6 / /\r^_lea p2 /j/\r^_lea f5 /H/\r:\ :ke=^_lea p2\r^_lea p4\r^_lea p6\r^_lea p8\r^_lea f5\r:\ :am:bs:da:db:pt:li#34:co#80:cl=^_era\r\n\n:up=^K:nd=^_rig\r:\ :al=145^_up\r^_ili\r:dl=^_dli\r:\ :dc=^_dch\r:im=^_ich\r:ei=^F\n^K:nl=^F\n:\ :ce=^_dch 80\r:cd=^_dli 50\r:CC=^_: X7|4025-17|4027-17|tek 4025 17 line window:li#17:tc=4025: X8|4025-17ws|4027-17ws|tek 4025 17 line window in workspace:\ :is=\41com 31\r\n^_sto 9,17,25,33,41,49,57,65,73\r^_wor 17\r^_mon 17\r:\ :ti=^_wor h\r:te=^_mon h\r:so=^_att e\r:se=^_att s\r:tc=4025-17: Xe|4025ex|4027ex|tek 4025 w/!:ti=\41com 31\r:te=^_com 33\r:\ :is=^_com 33\r\n\41sto 9,17,25,33,41,49,57,65,73\r:tc=4025: # Regent: lowest common denominator, works on all regents. a0|regent|adds regent series:\ :am:bs:cl=^L:cm=^K%+ ^P%B%.:co#80:ho=^A:li#24:ll=^A^Z:nd=^F:up=^Z: # Regent 100 has a bug where if computer sends escape when user is holding # down shift key it gets confused, so we avoid escape. a1|regent100|adds regent 100:\ :cm=^K%+ ^P%B%.:k1=^B1\r:k2=^B2\r:k3=^B3\r:k4=^B4\r:\ :k5=^B5\r:k6=^B6\r:k7=^B7\r:k8=^B8\r:\ :kh=^A:kl=^U:kr=^F:ku=^Z:kd=^J:tc=regent: # Regent 20, untested a2|regent20|adds regent 20:\ :cd=\Ek:ce=\EK:cm=\EY%+ %+ :tc=regent: a3|regent25|adds regent 25:\ :k0=^B0\r:k1=^B1\r:k2=^B2\r:k3=^B3\r:k4=^B4\r:\ :k5=^B5\r:k6=^B6\r:k7=^B7\r:k8=^B8\r:k9=^B9\r:\ :kh=^A:kl=^U:kr=^F:ku=^Z:kd=^J:tc=regent20: # Regent 40: untested a4|regent40|adds regent 40:\ :al=\EM:dl=\El:is=\EB:se=\E0@:so=\EOP:ue=\EO@:us=\E0`:vb=\ED\Ed:\ :tc=regent25: # If you have standout problem with regent 200, try so=\ER\EOP:se=\E0@\EV: a6|regent60|regent200|adds Regent 60:\ :dc=\EE:ei=\EF:im=\EF:is=\EV\EB:ko=dc,im,ei:tc=regent40: a7|regent60na|regent 60 w/no arrow keys:\ kl@:kr@:ku@:kd@:tc=regent60: # Note: if return acts weird on a980, check internal switch #2 # on the top chip on the CONTROL pc board. ac|a980|adds consul 980:\ :al=13\E^N:am:bs:cl=^L\200^K@:cm=^K%+@\E^E%2:co#80:dl=13\E^O:\ :k0=\E0:k1=\E1:k2=\E2:k3=\E3:k4=\E4:k5=\E5:k6=\E6:k7=\E7:k8=\E8:k9=\E9:\ :li#24:nd=\E^E01:so=^Y^^^N:se=^O:up=9: # Reports are that most of these Beehive entries (except superbee) have not been # tested and do not work right. se is a trouble spot. Be warned. b2|sb2|sb3|fixed superbee:xb@:tc=superbee: bh|bh3m|beehiveIIIm:if=/usr/lib/tabset/beehive:\ :al=160^S:am:bs:cd=^R:ce=^P:cl=^E^R:co#80:dl=300^Q:ho=^E:li#20:ll=^E^K:\ :nd=^L:pt:se= ^_:so=^] :up=^K: # This loses on lines > 80 chars long, use at your own risk bi|superbeeic|super bee with insert char:\ :ic=:im=\EQ:ei=\ER:tc=superbee: bm|microb|microbee|micro bee series:\ :am:bs:cd=\EJ:ce=\EK:cl=\EE:co#80:cm=\EF%+ %+ :\ :k1=\Ep:k2=\Eq:k3=\Er:k4=\Es:k5=\Et:k6=\Eu:k7=\Ev:k8=\Ew:k9=\Ex:\ :kd=\EB:kh=\EH:kl=\ED:kr=\EC:ku=\EA:\ :li#24:nd=\EC:pt:se=\Ed@ :so= \EdP:ue=\Ed@:up=\EA:us=\Ed`: # Superbee - f1=escape, f2=^C. # Note: there are at least 3 kinds of superbees in the world. The sb1 # holds onto escapes and botches ^C's. The sb2 is the best of the 3. # The sb3 puts garbage on the bottom of the screen when you scroll with # the switch in the back set to CRLF instead of AEP. This description # is tested on the sb2 but should work on all with either switch setting. # The f1/f2 business is for the sb1 and the :xb: can be taken out for # the other two if you want to try to hit that tiny escape key. # This description is tricky: being able to use cm depends on there being # 2048 bytes of memory and the hairy nl string. bs|sb1|superbee|superb|beehive super bee:if=/usr/lib/tabset/stdcrt:is=\EE:\ :am:bs:cd=3\EJ:ce=3\EK:cl=3\EH\EJ:co#80:cm=\EF%r%3%3:cr=1000\r:\ :dC#10:da:db:xb:dc=3\EP:dl=100\EM:so=\E_1:se=\E_0:\ :li#25:nl=\n\200\200\200\n\200\200\200\EA\EK\200\200\200\ET\ET:\ :nd=\EC:pt:up=\EA:ho=\EH:ve=\n:\ :k1=\Ep:k2=\Eq:k3=\Er:k4=\Es:k5=\Et:k6=\Eu:k7=\Ev:k8=\Ew:\ :kd=\EB:kh=\EH:kl=\ED:kr=\EC:ku=\EA: # From vax135!hpk Sat Jun 27 07:41:20 1981 # There seem to be a number of different versions of the C108 PROMS # (with bug fixes in its Z-80 program). # The first one that we had would lock out the keyboard of you # sent lots of short lines (like /usr/dict/words) at 9600 baud. # Try that on your C108 and see if it sends a ^S when you type it. # If so, you have an old version of the PROMs. # The old one also messed up running vi with a 132-character line-length. # You should configure the C108 to send ^S/^Q before running this. # It is much faster (at 9600 baud) than the c100 because the delays # Are not fixed. c8|c108|c108-8|concept 108 w/8 pages and ^S/^Q:\ :ti=\EU\Evh 8p\Ep\r:te=\Ev ^A\177p\Ep\r\n:tc=c108-4: cS|c108((|c108-4|concept 108 w/4 pages and ^S/^Q:\ :is=\EU\E F\Ef\E7\E5\E8\El\ENH\EK\E\200\Eo&\200\Eo\47\E:\ :ti=\EU\Evh 8p\Ep\r:te=\Ev \177p\Ep\r\n:\ :al=\E^R:am:bs:cd=\E^C:ce=\E^S:cl=\E?\E:cm=\Ea%+ %+ :co#80:\ :dc=\E^A:dl=\E^B:ei=\E\200:eo:im=\E^P:in:ip=:li#24:mi:nd=\E=:\ :kb=^h:ul:up=\E;:db:us=\EG:ue=\Eg:xn:vs=\EW:ve=\Ew:\ :vb=\Ek\200\200\200\200\200\200\200\200\200\200\200\200\200\200\EK:\ :us=\EG:ue=\Eg:ks=\EX:ke=\Ex:ku=\E;:kd=\E<:kl=\E>:kr=\E=:kh=\E?:\ :k1=\E5:k2=\E6:k3=\E7:so=\ED\EE:se=\Ed\Ee # Some tty drivers use cr3 for concept, others use nl3, hence dN/dC below. # 2 nulls padding on te isn't always enough. 6 works fine. Maybe less # than 6 but more than 2 will work. # It seems rather strange to have is end in escape. Seems to reprogram # arrow keys to send escape sequences instead of whatever sequences. cp|c100rvpp|c100rv4ppp|c100 with printer port:\ :is=\EU\Ef\E7\E5\E8\El\ENH\Ek\E\200\Eo&\200\Eo!\200\EQ"\EY(^W\Eo\47\E:\ :tc=c100rv: cn|c100rvna|c100rv4pna|c100 with no arrows:ks@:ke@:tc=c100rv: cs|c100s|slowconcept|slowconcept100|slow concept 100:\ :vb=\Ek\200\EK:pt:dC@:dN@:tc=c100: cd|c100rvs|slow reverse concept 100:\ :vb=\EK\200\Ek:pt:dC@:dN@:tc=c100rv: d0|vt100n|vt100 w/no init:is@:if@:tc=vt100: d1|vt100|vt-100|pt100|pt-100|dec vt100:\ :co#80:li#24:am:cl=50\E[;H\E[2J:bs:cm=5\E[%i%2;%2H:nd=2\E[C:up=2\E[A:\ :ce=3\E[K:cd=50\E[J:so=2\E[7m:se=2\E[m:us=2\E[4m:ue=2\E[m:\ :is=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:ks=\E[?1h\E=:ke=\E[?1l\E>:\ :if=/usr/lib/tabset/vt100:ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:\ :kh=\E[H:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:pt:sr=5\EM:xn: d2|gt42|dec gt42:\ :bs:co#72:ns:li#40:os: d3|vt132|vt-132:\ :al=99\E[L:dl=99\E[M:ip=7:dc=7\E[P:ei=\E[4l:im=\E[4h:xn:dN#30:tc=vt100: d4|gt40|dec gt40:\ :bs:co#72:ns:li#30:os: d5|vt50|dec vt50:\ :bs:cd=\EJ:ce=\EK:cl=\EH\EJ:co#80:li#12:nd=\EC:pt:up=\EA: dI|dw1|decwriter I:\ :bs:co#72:hc:os: dh|vt50h|dec vt50h:\ :bs:cd=\EJ:ce=\EK:cl=\EH\EJ:cm=\EY%+ %+ :co#80:li#12:nd=\EC:\ :pt:sr=\EI:up=\EA: ds|vt100s|vt-100s|pt100s|pt-100s|dec vt100 132 cols 14 lines:\ :li#14:tc=vt100w: dt|vt100w|vt-100w|pt100w|pt-100w|dec vt100 132 cols:\ :co#128:li#24:is=\E>\E[?3h\E[?4l\E[?5l\E[?7h\E[?8h:tc=vt100: dv|vt52|dec vt52:\ :bs:cd=\EJ:ce=\EK:cl=\EH\EJ:cm=\EY%+ %+ :co#80:li#24:nd=\EC:\ :pt:sr=\EI:up=\EA:ku=\EA:kd=\EB:kr=\EC:kl=\ED: dw|dw2|dw3|dw4|decwriter II:\ :kb=^h:bs:co#132:hc:os: e1|ep48|ep4080|execuport 4080:am:bs:os:co#80:hu=\036:hd=\034: e2|ep40|ep4000|execuport 4000:am:bs:os:co#136:hu=\036:hd=\034: g2|1200|tn1200|terminet 1200:\ :co#120:hc:os: g3|300|tn300|terminet 300:\ :co#120:hc:os: # Note: no "ho" on HP's since that homes to top of memory, not screen. # Due to severe braindamage, the only way to get the arrow keys to # transmit anything at all is to turn on the function key labels # (f1-f8) with ks, and even then the poor user has to hold down shift! # The default 2621 turns off the labels except when it has to to enable # the function keys. If your installation prefers labels on all the time, # or off all the time (at the "expense" of the function keys) move the # 2621nl or 2621wl labels to the front using reorder. # 2621k45: untested h3|2621k45|hp2621k45|k45|hp 2621 with 45 keyboard:\ :kb=^H:ku=\EA:kd=\EB:kl=\ED:kr=\EC:kh=\Eh:ks=\E&s1A:ke=\E&s0A:tc=2621: h4|hp|hp2645|2645|hp 264x series:\ :if=/usr/lib/tabset/stdcrt:\ :al=\EL:am:bs:cd=\EJ:ce=\EK:ch=\E&a%dC:cl=\EH\EJ:cm=6\E&a%r%dc%dY:\ :co#80:cv=\E&a%dY:da:db:dc=\EP:dl=\EM:ei=\ER:im=\EQ:\ :kb=^H:ku=\EA:kd=\EB:kl=\ED:kr=\EC:kh=\Eh:ks=\E&s1A:ke=\E&s0A:\ :li#24:mi:ml=\El:mu=\Em:nd=\EC:pt:se=\E&d@:so=\E&dJ:\ :us=\E&dD:ue=\E&d@:up=\EA:xs: h6|hp2626|hp2626a|hp2626p|2626|2626a|2626p|hp 2626:\ :is=\E&j@\r\E3\r:if=/usr/lib/tabset/stdcrt:\ :al=\EL:am:bs:bt=\Ei:cd=\EJ:ce=\EK:cl=\EH\EJ:\ :cm=\E&a%r%dc%dY:co#80:da:db:dc=2\EP:dl=\EM:ei=\ER:\ :im=\EQ:ip=2:li#24:mi:nd=\EC:pt:se=\E&d@:so=\E&dB:up=\EA:\ :kh=\Eh:ku=\EA:kl=\ED:kr=\EC:kd=\EB:\ :ma=j^Jk^P^K^Pl :sf=\ES:\ :ta=2^I:xs: # cD a pain - only screw up at 9600 baud. h8|hp2648|hp2648a|2648a|2648|HP 2648a graphics terminal:\ :cl=50\EH\EJ:cm=20\E&a%r%dc%dY:dc=7\EP:ip#5:is=130\Eg:tc=2645: # 2640a doesn't have the Y cursor addressing feature, and C is memory relative # instead of screen relative, as we need. ha|2640|hp2640a|2640a|hp 2640a:cm@:ks@:ke@:tc=2645: hb|2640b|hp2640b|2644a|hp2644a|hp 264x series:ks@:ke@:tc=2645: # 2621 using all 48 lines of memory, only 24 visible at any time. Untested. hb|big2621|48 line 2621:li#48:ho=\EH:cm=\E&a%r%dc%dR:tc=2621: hn|2621nl|hp2621nl|2621|hp 2621 with no labels:ks@:ke@:kh@:ku@:kl@:kr@:kd@:tc=hp2621: # Needed for our vax console, since lsi-11 expands tabs (wrong). ht|2621nt|hp 2621 w/no tabs:pt@:tc=2621: hw|2621wl|hp2621wl|2621|hp 2621 with labels:is=\E&jA\r\E3\r:ke=\E&jA:tc=hp2621: # Infoton is now called General Terminal Corp. or some such thing. # gt100 sounds like something DEC would come out with. Lets hope they don't. i1|i100|gt100|gt100a|General Terminal 100A (formerly Infoton 100):\ :cl=^L:cd=\EJ:ce=\EK:li#24:co#80:\ :al=\EL:dl=\EM:up=\EA:nd=\EC:ho=\EH:cm=\Ef%r%+ %+ :vb=\Eb\Ea:am:bs:\ :so=\Eb:se=\Ea: i4|i400|400|infoton 400:\ :if=/usr/lib/tabset/infoton_tabs:\ :al=\E[L:am:bs:ce=\E[N:cl=\E[2J:cm=%i\E[%3;%3H:co#80:dl=\E[M:li#25:\ :nd=\E[C:up=\E[A:im=\E[4h\E[2Q:ei=\E[4l\E[0Q:\ :dc=\E[4h\E[2Q\E[P\E[4l\E[0Q: ia|addrinfo:\ :li#24:co#80:cl=^L:ho=^H:nd=^Y:cd=^K:\ :up=^\:am:bc=^Z:cm=\037%+\377%+\377:ll=^H^\: ik|infotonKAS:\ :am:bc=^Z:cd=^K:cl=^L:co#80:li#24:nd=^Y:up=^\:ll=^H^\: kA|h19A|heathA|h19A|heathkitA|heathkit h19 ansi mode:\ :al=1*\E[1L:am:bs:cd=\E[J:ce=\E[K:cl=\E[2J:cm=\E[%i%2;%2H:co#80:\ :dc=\E[1P:dl=1*\E[1M:dn=\E[1B:ei=\E[4l:ho=\E[H:im=\E[4h:li#24:mi:\ :nd=\E[1C:as=\E[10m:ae=\E[11m:ms:pt:se=\E[0m:so=\E[7m:up=\E[1A:\ :vs=\E[>4h:ve=\E[>4l:kb=^h:ku=\E[1A:kd=\E[1B:kl=\E[1D:kr=\E[1C:\ :kh=\E[H:kn#8:k1=\EOS:k2=\EOT:k3=\EOU:k4=\EOV:k5=\EOW:l6=blue:\ :l7=red:l8=white:k6=\EOP:k7=\EOQ:k8=\EOR:\ :sr=\EM:is=\E<\E[>1;2;3;4;5;6;7;8;9l\E[0m\E[11m\E[?7h: kB|h19bs|heathkit w/keypad shifted:ks=\Et:ke=\Eu:tc=h19b: kU|h19us|heathkit w/keypad shifted/underscore cursor:ks=\Et:ke=\Eu:tc=h19u: ku|h19u|heathkit with underscore cursor:vs@:ve@:tc=h19b: # If the adm31 gives you trouble with standout mode, check the DIP switch # in position 6, bank @c11, 25% from back end of pc. Should be OFF. # If there is no such switch, you have an old adm31 and must use oadm31 l1|adm31|31|lsi adm31:is=\Eu\E0:\ :al=\EE:am:bs:ce=\ET:cm=\E=%+ %+ :cl=\E*:cd=\EY:co#80:dc=\EW:dl=\ER:\ :ei=\Er:ho=^^:im=\Eq:k0=^A0\r:k1=^A1\r:k2=^A2\r:k3=^A3\r:k4=^A4\r:\ :k5=^A5\r:k6=^A6\r:k7=^A7\r:k8=^A8\r:k9=^A9\r:kd=^J:kl=^H:kr=^L:ku=^K:\ :li#24:ma=j^Jk^P^K^Pl ^R^L^L :mi:nd=^L:\ :se=\EG0:so=\EG1:up=^K:us=\EG1:ue=\EG0: l2|adm2|lsi adm2:\ :al=\EE:am:bs:cd=\EY:ce=\ET:cl=\E;:cm=\E=%+ %+ :co#80:dc=\EW:dl=\ER:\ :ei=:ho=^^:ic=\EQ:im=:kd=^J:kh=^^:kl=^H:kr=^L:ku=^K:li#24:nd=^L:up=^K: l4|adm42|42|lsi adm42:vs=\EC\E3 \E3(:\ :al=270\EE:am:bs:cd=\EY:ce=\ET:cl=\E;:cm=\E=%+ %+ :co#80:\ :dc=\EW:dl=\ER:ei=\Er:im=\Eq:ip=6*:li#24:\ :bt=\EI:nd=^L:se=\EG0:so=\EG4:ta=\t:up=^k:\ :ma=^K^P:pc=\177: l5|adm5|5|lsi adm5:\ :cd=\EY:ce=\ET:do=^J:kb=^H:kd=^J:kh=^^:kl=^H:kr=^L:ku=^K:\ :ma=^Hh^Jj^Kk^Ll^^H:se=\EG:sg#1:so=\EG:tc=adm3a: lb|adm3a+|3a+:kl=^H:kd=^J:ku=^K:kr=^L:tc=adm3a: lo|oadm31|o31|old adm31:so=\EG4:us@:ue@:tc=adm31: # These mime1 entries refer to the Microterm Mime I or Mime II. # The default mime is assumed to be in enhanced act iv mode. m3|mime3a|mime1 emulating 3a:\ :am@:ma=^X ^K^J^Z^P:ku=^Z:kd=^K:kl=^H:kr=^X:tc=adm3a: m4|microterm|act4|microterm act iv:\ :am:bs:cd=^_:ce=^^:cl=^L:cm=^T%.%.:co#80:li#24:nd=^X:up=^Z:ho=^]: # The padding on sr and ta for act5 and mime is a guess and not final. m5|microterm5|act5|microterm act v:\ :uc=\EA:pt:ta=2^I:sr=3\EH:ku=^Z:kd=^K:kl=^H:kr=^X:ma=^Z^P^Xl^Kj:tc=act4: # act5s is not tested and said not to work. mS|act5s|skinny act5:ti=\EP:te=\EQ:li#48:co#39:tc=act5: # Mimes using brightness for standout. Half bright is really dim unless # you turn up the brightness so far that lines show up on the screen. # uc is disabled to get around a curses bug, and should be put back in someday. mf|mimefb|full bright mime1:so=^Y:se=^S:uc@:is=^S\E:tc=mime: mh|mimehb|half bright mime1:so=^S:se=^Y:uc@:is=^Y\E:tc=mime: # These termcaps (for mime 2a) put the terminal in low intensity mode # since high intensity mode is so obnoxious. ms|mime2as|microterm mime2a (emulating an enhanced soroc iq120):\ :al=20*^A:am:bs:cd=20*\EJ:ce=\EK:cl=\EL:cm=\E=%+ %+ :co#80:dc=\ED:\ :dl=20*^W:kl=^H:kr=^L:ku=^K:kd=^J:ho=^^:is=\E):sr=\EI\ :im=\EE:ei=^Z:ip=2:li#24:nd=^L:so=\E\072:se=\E;:up=\EI:\ :us=\E6:ue=\E7: # This is the preferred mode (but ^X can't be used as a kill character) mv|mime2a|mime2av|microterm mime2a (emulating an enhanced vt52):\ :al=20*^A:bs:cd=20*\EQ:co#80:ce=\EP:cl=\EL:cm=\EY%+ %+ :is=^Y\ :dc=^N:dl=20*^W:ip=2:ei=^Z:ho=\EH:im=^O:kd=\EB:kl=\ED:kr=\EC:ku=\EA:\ :li#24:nd=\EC:pt:se=\E9:so=\E8:up=\EA:sr=\EA:us=\E4:ue=\E5: mx|mime3ax|mime1 emulating enhanced 3a:\ :al=80^A:dl=80^W:pt:ce=^X:cd=^_:tc=mime3a: pe|pe550|perkin elmer 550:\ :bs:co#80:ce=20\EI:cl=20\EK:cm=\EX%+ \EY%+ :\ :ho=\EH:li#24:ll=\EH\EA:nd=\EC:up=\EA: :ma=^Z^P:cd=6^N@^V: pf|fox|perkin elmer 1100:if=/usr/lib/tabset/stdcrt:\ :am:bs:cd=5.5*\EJ:ce=\EI:cl=132\EH\EJ:co#80:ho=\EH:li#24:\ :ll=\EH\EA:nd=\EC:cm=\EX%+ \EY%+ :up=\EA:vb=^P^B^P^C: po|owl|perkin elmer 1200:if=/usr/lib/tabset/stdcrt:\ :al=5.5*\EL:am:bs:cd=5.5*\EJ:ce=5.5\EI:cl=132\EH\EJ:ho=\EH:ll=\EH\EA:\ :cm=\EX%+ \EY%+ :co#80:dc=5.5*\EO:dl=5.5*\EM:ei=:ic=\EN:im=:ip=5.5*:\ :kb=^h:in:li#24:nd=\EC:up=\EA:se?=\E!\200:so?=\E!^H:vb=^P^B^P^C:\ :k1=\ERA:k2=\ERB:k3=\ERC:k4=\ERD:k5=\ERE:k6=\ERF:\ :k7=\ERG:k8=\ERH:k9=\ERI:k0=\ERJ: qB|bc|bill croft homebrew:\ :am:bs:cm=\E=%+ %+ :cl=^Z:co#96:ho=^^:li#72:\ :nd=^L:up=^K:vb=: qN|nucterm|rayterm|NUC homebrew:\ :am:bs:cl=1^L:li#24:co#80:nd=^C:up=^N:ho=^B:ll=^K:ce=^A:cd=^E: qb|ex3000:\ :li#24:co#80:ho=^Q: qc|carlock|klc:\ :al=^E:am:bs:ce=^U:cl=100^Z:cm=\E=%+ %+ :co#80:dc=\177:dl=^D:dm=:\ :ed=:ei=^T:ho=^^:im=^T:li#24:nd=^L:se=^V:so=^V:up=^K:vb=\EV\EV: qe|exidy|exidy2500|exidy sorcerer as dm2500:\ :al=^P^J^X:am:bs:ce=^W:cl=^^:cm=^L%r%n%.%.:co#64:\ :dc=\b:dl=^P^Z^X:dm=^P:ed=^X:ei=^X:ho=^B:ic=^\:\ :im=^P((:li#30:nd=^\:pt:so=^N:se=^X:up=^Z: qn|netx|netronics:\ :bs:cd=2000^F^E:ce=1600^E:cl=466^L:cm=\E=%+@%+@:co#64:ho=^D:\ :li#16:ma=j^Jk^Pl :nd=\E+@A:pc=\200:sr=\E=@@^K:up=^K: # This came from the comp ctr who got it from some user. Smart indeed! qs|sexidy|exidy smart:\ :li#24:co#64:cl=^l:ho=^q:nd=^s:up=^w:bs:bc=^a:ma=^x^J:kd=^S: qu|ubell|ubellchar:if=/usr/staff/michael/term/startup:\ :am:bs:pt:ce=\Ed:cl=^Z:cm=\E=%+ %+ :co#80:li#24:nd=^L:up=^K:\ :ma=j^Jk^P^K^Pl :ho=^^: qw|ttyWilliams:\ :co#80:li#12:bc=^Y:do=^K:up=^Z:cl=^^:ce=^_:am:ho=^]:nd=^X: qx|xitex|xitex sct-100:\ :bs:cd=2000^F^E:ce=1600^E:cl=400^L:cm=\E=%+@%+@:co#64:ho=^D:\ :li#16:ma=j^Jk^Pl :nd=\E+@A:pc=\200:sr=\E=@@^K:up=^K: t3|ti|ti700|ti733|735|ti735|ti silent 700:\ :bs:co#80:hc:os:dC#162: t4|ti745|745|743|ti silent 745:\ :bs:co#80:hc:os: t8|ti800|ti omni 800:\ :bs:co#132:hc:os: # There are some tvi's that require incredible amounts of padding and # some that don't. I'm assuming 912 and 920 are the old slow ones, # and 912b, 912c, 920b, 920c are the new ones that don't need padding. v1|tvi912|912|920|tvi920|old televideo:if=/usr/lib/tabset/stdcrt:\ :al=33*\EE:am:bs:ce=\ET:cm=\E=%+ %+ :cl=^Z:co#80:dc=\EW:dl=33*\ER:ei=:\ :kb=^h:ku=^K:kd=^J:kl=^H:kr=^L:k0=^A@\r:k1=^AA\r:k2=^AB\r:k3=^AC\r:\ :k4=^AD\r:k5=^AE\r:k6=^AF\r:k7=^AG\r:k8=^AH\r:k9=^AI\r:\ :ho=^^:im=:ic=\EQ:li#24:nd=^L:pt:se=\Ek:so=\Ej:up=^K:us=\El:ue=\Em:\ :ma=^K^P^L :sg#1:ug#1: v2|912b|912c|920b|920c|tvi|new televideo 912/920:\ :al=5*\EE:dl=5*\ER:tc=912: # set to page 1 when entering ex (\E-17 ) # reset to page 0 when exiting ex (\E-07 ) v2|tvi9122p|tvi9202p|9122p|9202p|tvi2p|televideo w/2 pages:\ :ti=\E-17 :te=\E-07 :tc=tvi912:\ va|tvi950-ap|tvi 950 w/alt pages:is=\E\\1:ti=\E-06 :te=\E-16 :tc=tvi950: vf|tvi950-4p|tvi 950 w/4 pages:ti=\E\\1:te=\E\\3:tc=tvi950: vl|tvi950b|bare tvi950 no is:is@:ks=\El:ke=\Ek:tc=tvi950: vs|tvi950ns|tvi950 w/no standout:so@:se@:us@:ue@:tc=tvi950: vt|tvi950-2p|tvi 950 w/2 pages:ti=\E\\1:te=\E\\2:tc=tvi950: # The following tvi descriptions from B:pjphar # is for all 950 sets the following attributes: # full duplex (\EDF) write protect off (\E() # conversation mode (\EC) graphics mode off (\E%) # white on black (\Ed) auto page flip off (\Ew) # turn off status line (\Eg) # normal video (\E0) monitor mode off (\EX or \Eu) # edit mode (\Er) load blank char to space (\Ee\040) # line edit mode (\EO) enable buffer control (^O) # protect mode off (\E\047) local edit keys (\Ek) # program unshifted send key to send line all (\E016) # program shifted send key to send line unprotected (\E004) # set the following to nulls: # field delimiter (\Ex0\200\200) # line delimiter (\Ex1\200\200) # start-protected field delimiter (\Ex2\200\200) # end-protected field delimiter (\Ex3\200\200) # set end of text delimiter to carriage return/null (\Ex4\r\200) # clear all column tabs (\E3) # # tvi950 sets duplex (send) edit keys (\El) when entering vi # sets local (no send) edit keys (\Ek) when exiting vi # v5|tvi950|950|televideo950:if=/usr/lib/tabset/stdcrt:\ :is=\EDF\EC\Ed\EG0\Eg\Er\EO\E\047\E(\E%\Ew\EX\Ee ^O\ \Ek\E016\E004\Ex0\200\200\Ex1\200\200\Ex2\200\200\ \Ex3\200\200\Ex4\r\200\E3:\ :al=\EE:am:bs:bt=\EI:cd=\Ey:ce=\Et:cl=\E*:cm=\E=%+ %+ :\ :co#80:dc=\EW:dl=\ER:do=^V:ei=\Er:ho=^^:im=\Eq:k0=^A0\r:\ :k1=^A@\r:k2=^AA\r:k3=^AB\r:k4=^AC\r:k5=^AD\r:k6=^AE\r:\ :k7=^AF\r:k8=^AG\r:k9=^AH\r:kb=^H:kd=^V:kh=^^:kl=^H:\ :ko=ic\054dc\054al\054dl\054cl\054bt\054ce\054cd:kr=^L:\ :ku=^K:li#24:ma=^Vj^Kk^Hh^Ll^^H:mi:ms:nd=^L:pt:se=\EG0:\ :sg#1:so=\EG4:sr=\Ej:ue=\EG0:ug#1:up=^K:us=\EG8:\ :vb=\Eb\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\Ed:\ :ve=\Ek:vs=\El:xn: # # is for 950 with two pages adds the following: # set 48 line page (\E\\2) # place cursor at page 0, line 24, column 1 (\E-07 ) # # two page 950 adds the following: # when entering ex, set 24 line page (\E\\1) # when exiting ex, reset 48 line page (\E\\2) # place cursor at 0,24,1 (\E-07 ) # v3|tvi9502p|9502p|televideo950 w/2 pages:\ :is=\EDF\EC\Ed\EG0\Eg\Er\EO\E\047\E(\E%\Ew\EX\Ee ^O\ \Ek\E016\E004\Ex0\200\200\Ex1\200\200\Ex2\200\200\ \Ex3\200\200\Ex4\r\200\E\\2\E-07 \E3\ :te=\E\\2\E-07 :ti=\E\\1\E-07 :tc=tvi950: # # is for 950 with four pages adds the following: # set 96 line page (\E\\3) # place cursor at page 0, line 24, column 1 (\E-07 ) # # four page 950 adds the following: # when entering ex, set 24 line page (\E\\1) # when exiting ex, reset 96 line page (\E\\3) # place cursor at 0,24,1 (\E-07 ) # v4|tvi9504p|9504p|televideo950 w/4 pages:\ :is=\EDF\EC\Ed\EG0\Eg\Er\EO\E\047\E(\E%\Ew\EX\Ee ^O\ \Ek\E016\E004\Ex0\200\200\Ex1\200\200\Ex2\200\200\ \Ex3\200\200\Ex4\r\200\E\\3\E-07 \E3\ :te=\E\\3\E-07 :ti=\E\\1\E-07 :tc=tvi950: # # is for reverse video 950 changes the following: # set reverse video (\Ed) # # set vb accordingly (\Eb ...nulls... \Ed) # vr|tvi950rv|950rv|televideo950 rev video:if=/usr/lib/tabset/stdcrt:\ :is=\EDF\EC\Eb\EG0\Eg\Er\EO\E\047\E(\E%\Ew\EX\Ee ^O\ \Ek\E016\E004\Ex0\200\200\Ex1\200\200\Ex2\200\200\ \Ex3\200\200\Ex4\r\200\E3:\ :vb=\Ed\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\Eb:\ :tc=tvi950: # # uses the appropriate entries from 9502p and 950rv # v3|tvi950rv2p|950rv2p|televideo950 rev video w/2 pages:\ :is=\EDF\EC\Eb\EG0\Eg\Er\EO\E\047\E(\E%\Ew\EX\Ee ^O\ \Ek\E016\E004\Ex0\200\200\Ex1\200\200\Ex2\200\200\ \Ex3\200\200\Ex4\r\200\E\\2\E-07 \E3\ :te=\E\\2\E-07 :ti=\E\\1\E-07 :tc=tvi950rv: # # uses the appropriate entries from 9504p and 950rv # vR|tvi950rv4p|950rv4p|televideo950 rev video w/4 pages:\ :is=\EDF\EC\Eb\EG0\Er\EO\E\047\E(\E%\Ew\EX\Ee ^O\ \Ek\E016\E004\Ex0\200\200\Ex1\200\200\Ex2\200\200\ \Ex3\200\200\Ex4\r\200\E\\3\E-07 \E3\ :te=\E\\3\E-07 :ti=\E\\1\E-07 :tc=tvi950rv: # Note two things called "teleray". Reorder should move the common one # to the front if you have either. A dumb teleray with the cursor stuck # on the bottom and no obvious model number is probably a 3700. y1|t3700|teleray|dumb teleray 3700:\ :bs:cl=^L:co#80:li#24: y3|t3800|teleray 3800 series: \ :bs:cd=\EJ:ce=\EK:cl=^L:cm=\EY%+ %+ :co#80: \ :do=\n:ho=\EH:li#24:ll=\EY7 :nd=\EC:pt:up=^K: y6|t1061|t10|teleray|teleray 1061:if=/usr/lib/tabset/teleray:\ :al=2*\EL:am:bs:cd=1\EJ:ce=\EK:cl=1^L:cm=\EY%+ %+ :co#80:\ :dc=\EQ:dl=2*\EM:ei=:ho=\EH:ic=\EP:im=:ip=0.4*:\ :k1=^Z1:k2=^Z2:k3=^Z3:k4=^Z4:k5=^Z5:k6=^Z6:k7=^Z7:k8=^Z8:\ :li#24:nd=\EC:pt:se=\ER@:so= \ERD:\ :is=\Ee\EU01^Z1\EV\EU02^Z2\EV\EU03^Z3\EV\EU04^Z4\EV\EU05^Z5\EV\EU06^Z6\EV\EU07^Z7\EV\EU08^Z8\EV\Ef:\ :up=\EA:us=\ERH:ue=\ER@:xs:xt:sg=2:ug=1: yf|t1061f|teleray 1061 with fast PROMs:\ al=\EL:ip@:dl=\EM:tc=t1061: # # ---- # Convention: First entry is two chars, first char is manufacturer, # second char is canonical abbreviation for model or mode. # Second entry is canonical abbreviation. # Third entry is the one the editor will print with "set" command. # Last entry is verbose description. # Others are mnemonic synonyms for the terminal. # # If you absolutely MUST check for a specific terminal (this is discouraged) # check for the 2nd entry (the canonical form) since all other codes are # subject to change. The two letter codes are there for version 6 and are # EXTREMELY subject to change, or even to go away if version 6 becomes for # all practical purposes obsolete. # # Special manufacturer codes: # M: Misc. (with only a few terminals) # q: Homemade # s: special (dialup, etc.) # # This file is to be installed with an editor script that moves the most # common terminals to the front of the file. If the source is not available, # it can be constructed by sorting # the above entries by the 2 char initial code. @ikgB$( K2ix`6i /* scb.s 4.9 81/05/13 */ /* * System control block */ .set INTSTK,1 # handle this interrupt on the interrupt stack .set HALT,3 # halt if this interrupt occurs _scb: .globl _scb #define STRAY .long _Xstray+INTSTK #define STRAY8 STRAY;STRAY;STRAY;STRAY;STRAY;STRAY;STRAY;STRAY #define STRAY15 STRAY;STRAY;STRAY;STRAY;STRAY;STRAY;STRAY;STRAY8 #define KS(a) .long _X/**/a #define IS(a) .long _X/**/a+INTSTK #define STOP(a) .long _X/**/a+HALT /* 000 */ STRAY; IS(machcheck); IS(kspnotval); STOP(powfail); /* 010 */ KS(privinflt); KS(xfcflt); KS(resopflt); KS(resadflt); /* 020 */ KS(protflt); KS(transflt); KS(tracep); KS(bptflt); /* 030 */ KS(compatflt); KS(arithtrap); STRAY; STRAY; /* 040 */ KS(syscall); KS(chme); KS(chms); KS(chmu); /* 050 */ STRAY; IS(cmrd); STRAY; STRAY; /* 060 */ IS(wtime); STRAY; STRAY; STRAY; /* 070 */ STRAY; STRAY; STRAY; STRAY; /* 080 */ STRAY; STRAY; KS(astflt); STRAY; /* 090 */ STRAY; STRAY; STRAY; STRAY; /* 0a0 */ IS(softclock); STRAY; STRAY; STRAY; /* 0b0 */ STRAY; ((STRAY; STRAY; STRAY; /* 0c0 */ IS(hardclock); STRAY; STRAY; STRAY; /* 0d0 */ STRAY; STRAY; STRAY; STRAY; /* 0e0 */ STRAY; STRAY; STRAY; STRAY; /* 0f0 */ IS(consdin); IS(consdout); IS(cnrint); IS(cnxint); /* 100 */ IS(nexzvec); STRAY15; /* ipl 0x14, nexus 0-15 */ /* 140 */ IS(nexzvec); STRAY15; /* ipl 0x15, nexus 0-15 */ /* 180 */ IS(nexzvec); STRAY15; /* ipl 0x16, nexus 0-15 */ /* 1c0 */ IS(nexzvec); STRAY15; /* ipl 0x17, nexus 0-15 */ .globl _UNIvec _UNIvec: .space 512 # 750 unibus intr vector # 1st UBA jump table on 780's @ik`$ K2i 6i /* rmap.c 4.4 81/03/08 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/map.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/mtpr.h" #include "../h/text.h" /* * Resource map handling routines. * * A resource map is an array of structures each * of which describes a segment of the address space of an available * resource. The segments are described by their base address and * length, and sorted in address order. Each resource map has a fixed * maximum number of segments allowed. Resources are allocated * by taking part or all of one of the segments of the map. * * Returning of resources will require another segment if * the returned resources are not adjacent in the address * space to an existing segment. If the return of a segment * would require a slot which is not available, then one of * the resource map segments is discarded after a warning is printed. * Returning of resources may also cause the map to collapse * by coalescing two existing segments and the returned space * into a single segment. In this case the resource map is * made smaller by copying together to fill the resultant gap. * * N.B.: the current implementation uses a dense array and does * not admit the value ``0'' as a legal address, since that is used * as a delimiter. */ /* * Initialize map mp to have (mapsize-2) segments * and to be called ``name'', which we print if * the slots become so fragmented that we lose space. * The map itself is initialized with size elements free * starting at addr. */ rminit(mp, size, addr, name, mapsize) register struct map *mp; int size, addr; char *name; int mapsize; { register struct mapent *ep = (struct mapent *)(mp+1); mp->m_name = name; /* N.B.: WE ASSUME HERE THAT sizeof (struct map) == sizeof (struct mapent) */ /* * One of the mapsize slots is taken by the map structure, * segments has size 0 and addr 0, and acts as a delimiter. * We insure that we never use segments past the end of * the array which is given by mp->m_limit. * Instead, when excess segments occur we discard some resources. */ mp->m_limit = (struct mapent *)&mp[mapsize]; /* * Simulate a rmfree(), but with the option to * call with size 0 and addr 0 when we just want * to initialize without freeing. */ ep->m_size = size; ep->m_addr = addr; } /* * Allocate 'size' units from the given * map. Return the base of the allocated space. * In a map, the addresses are increasing and the * list is terminated by a 0 size. * * Algorithm is first-fit. * * This routine knows about the interleaving of the swapmap * and handles that. */ rmalloc(mp, size) register struct map *mp; { register struct mapent *ep = (struct mapent *)(mp+1); register int addr; register struct mapent *bp; swblk_t first, rest; if (size <= 0 || mp == swapmap && size > DMMAX) panic("rmalloc"); /* * Search for a piece of the resource map which has enough * free space to accomodate the request. */ for (bp = ep; bp->m_size; bp++) { if (bp->m_size >= size) { /* * If allocating from swapmap, * then have to respect interleaving * boundaries. */ if (mp == swapmap && (first = DMMAX - bp->m_addr%DMMAX) < bp->m_size) { if (bp->m_size - first < size) continue; addr = bp->m_addr + first; rest = bp->m_size - first - size; bp->m_size = first; if (rest) rmfree(swapmap, rest, addr+size); return (addr); } /* * Allocate from the map. * If there is no space left of the piece * we allocated from, move the rest of * the pieces to the left. */ addr = bp->m_addr; bp->m_addr += size; if ((bp->m_size -= size) == 0) { do { bp++; (bp-1)->m_addr = bp->m_addr; } while ((bp-1)->m_size = bp->m_size); } if (mp == swapmap && addr % CLSIZE) panic("rmalloc swapmap"); return (addr); } } return (0); } /* * Free the previously allocated space at addr * of size units into the specified map. * Sort addr into map and combine on * one or both ends if possible. */ rmfree(mp, size, addr) struct map *mp; register int size, addr; { struct mapent *firstbp; register struct mapent *bp; register int t; /* * Both address and size must be * positive, or the protocol has broken down. */ if (addr <= 0 || size <= 0) goto badrmfree; /* * Locate the piece of the map which starts after the * returned space (or the end of the map). */ firstbp = bp = (struct mapent *)(mp + 1); for (; bp->m_addr <= addr && bp->m_size != 0; bp++) continue; /* * If the piece on the left abuts us, * then we should combine with it. */ if (bp > firstbp && (bp-1)->m_addr+(bp-1)->m_size >= addr) { /* * Check no overlap (internal error). */ if ((bp-1)->m_addr+(bp-1)->m_size > addr) goto badrmfree; /* * Add into piece on the left by increasing its size. */ (bp-1)->m_size += size; /* * If the combined piece abuts the piece on * the right now, compress it in also, * by shifting the remaining pieces of the map over. */ if (bp->m_addr && addr+size >= bp->m_addr) { if (addr+size > bp->m_addr) goto badrmfree; (bp-1)->m_size += bp->m_size; while (bp->m_size) { bp++; (bp-1)->m_addr = bp->m_addr; (bp-1)->m_size = bp->m_size; } } goto done; } /* * Don't abut on the left, check for abutting on * the right. */ if (addr+size >= bp->m_addr && bp->m_size) { if (addr+size > bp->m_addr) goto badrmfree; bp->m_addr -= size; bp->m_size += size; goto done; } /* * Don't abut at all. Make a new entry * and check for map overflow. */ do { t = bp->m_addr; bp->m_addr = addr; addr = t; t = bp->m_size; bp->m_size = size; bp++; } while (size = t); /* * Segment at bp is to be the delimiter; * If there is not room for it * then the table is too full * and we must discard something. */ if (bp+1 > mp->m_limit) { /* * Back bp up to last available segment. * which contains a segment already and must * be made into the delimiter. * Discard second to last entry, * since it is presumably smaller than the last * and move the last entry back one. */ bp--; printf("%s: rmap ovflo, lost [%d,%d)\n", mp->m_name, (bp-1)->m_addr, (bp-1)->m_addr+(bp-1)->m_size); bp[-1] = bp[0]; bp[0].m_size = bp[0].m_addr = 0; } done: /* * THIS IS RIDICULOUS... IT DOESN'T BELONG HERE! */ if ((mp == kernelmap) && kmapwnt) { kmapwnt = 0; wakeup((caddr_t)kernelmap); } return; badrmfree: panic("bad rmfree"); } @ikx$ J2i 6i ((/* rdwri.c 4.6 81/03/08 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/inode.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/buf.h" #include "../h/conf.h" #include "../h/cmap.h" #include "../h/vlimit.h" #include "../h/proc.h" /* * Read the file corresponding to * the inode pointed at by the argument. * The actual read arguments are found * in the variables: * u_base core address for destination * u_offset byte offset in file * u_count number of bytes to read * u_segflg read to kernel/user/user I */ readi(ip) register struct inode *ip; { struct buf *bp; dev_t dev; daddr_t lbn, bn; off_t diff; register int on, type; register unsigned n; extern int mem_no; if(u.u_count == 0) return; dev = (dev_t)ip->i_un.i_rdev; if (u.u_offset < 0 && ((ip->i_mode&IFMT) != IFCHR || mem_no != major(dev))) { u.u_error = EINVAL; return; } ip->i_flag |= IACC; type = ip->i_mode&IFMT; if (type==IFCHR || type==IFMPC) { (*cdevsw[major(dev)].d_read)(dev); return; } do { lbn = bn = u.u_offset >> BSHIFT; on = u.u_offset & BMASK; n = MIN((unsigned)(BSIZE-on), u.u_count); if (type!=IFBLK && type!=IFMPB) { diff = ip->i_size - u.u_offset; if (diff <= 0) return; if (diff < n) n = diff; bn = bmap(ip, bn, B_READ); if (u.u_error) return; dev = ip->i_dev; } else rablock = bn+1; if ((long)bn<0) { bp = geteblk(); clrbuf(bp); } else if (ip->i_un.i_lastr+1==lbn) bp = breada(dev, bn, rablock); else bp = bread(dev, bn); ip->i_un.i_lastr = lbn; n = MIN(n, BSIZE-bp->b_resid); if (n!=0) { #ifdef UNFAST iomove(bp->b_un.b_addr+on, n, B_READ); #else if (u.u_segflg != 1) { if (copyout(bp->b_un.b_addr+on, u.u_base, n)) { u.u_error = EFAULT; goto bad; } } else bcopy(bp->b_un.b_addr+on, u.u_base, n); u.u_base += n; u.u_offset += n; u.u_count -= n; bad: ; #endif } if (n+on==BSIZE || u.u_offset==ip->i_size) { if (ip->i_flag&IPIPE) bp->b_flags &= ~B_DELWRI; /* cancel i/o */ bp->b_flags |= B_AGE; } brelse(bp); } while(u.u_error==0 && u.u_count!=0 && n!=0); } /* * Write the file corresponding to * the inode pointed at by the argument. * The actual write arguments are found * in the variables: * u_base core address for source * u_offset byte offset in file * u_count number of bytes to write * u_segflg write to kernel/user/user I */ writei(ip) register struct inode *ip; { struct buf *bp; dev_t dev; daddr_t bn; register int on, type; register unsigned n; extern int mem_no; dev = (dev_t)ip->i_un.i_rdev; if(u.u_offset < 0 && ((ip->i_mode&IFMT) != IFCHR || mem_no != major(dev)) ) { u.u_error = EINVAL; return; } type = ip->i_mode&IFMT; if (type==IFCHR || type==IFMPC) { ip->i_flag |= IUPD|ICHG; (*cdevsw[major(dev)].d_write)(dev); return; } if (u.u_count == 0) return; if ((ip->i_mode&IFMT)==IFREG && u.u_offset + u.u_count > u.u_limit[LIM_FSIZE]) { psignal(u.u_procp, SIGXFSZ); u.u_error = EMFILE; return; } do { bn = u.u_offset >> BSHIFT; on = u.u_offset & BMASK; n = MIN((unsigned)(BSIZE-on), u.u_count); if (type!=IFBLK && type!=IFMPB) { bn = bmap(ip, bn, B_WRITE); if((long)bn<0) return; dev = ip->i_dev; } if (bn && mfind(dev, bn)) munhash(dev, bn); if(n == BSIZE) bp = getblk(dev, bn); else bp = bread(dev, bn); #ifdef UNFAST iomove(bp->b_un.b_addr+on, n, B_WRITE); #else if (u.u_segflg != 1) { if (copyin(u.u_base, bp->b_un.b_addr+on, n)) { u.u_error = EFAULT; goto bad; } } else bcopy(u.u_base, bp->b_un.b_addr+on, n); u.u_base += n; u.u_offset += n; u.u_count -= n; bad: ; #endif if(u.u_error != 0) brelse(bp); else { if ((ip->i_mode&IFMT) == IFDIR && ((struct direct *)(bp->b_un.b_addr+on))->d_ino == 0) /* * Writing to clear a directory entry. * Must insure the write occurs before * the inode is freed, or may end up * pointing at a new (different) file * if inode is quickly allocated again * and system crashes. */ bwrite(bp); else if (n+on==BSIZE && (ip->i_flag&IPIPE) == 0) { bp->b_flags |= B_AGE; bawrite(bp); } else bdwrite(bp); } if(u.u_offset > ip->i_size && (type==IFDIR || type==IFREG)) ip->i_size = u.u_offset; ip->i_flag |= IUPD|ICHG; #ifndef INSECURE ip->i_mode &= ~(ISUID|ISGID); #endif } while(u.u_error==0 && u.u_count!=0); } /* * Return the logical maximum * of the 2 arguments. */ unsigned max(a, b) unsigned a, b; { if(a > b) return(a); return(b); } /* * Return the logical minimum * of the 2 arguments. */ unsigned min(a, b) unsigned a, b; { if(a < b) return(a); return(b); } /* * Move n bytes at byte location * &bp->b_un.b_addr[o] to/from (flag) the * user/kernel (u.segflg) area starting at u.base. * Update all the arguments by the number * of bytes moved. */ iomove(cp, n, flag) register caddr_t cp; register unsigned n; { register int t; if (n==0) return; if (u.u_segflg != 1) { if (flag==B_WRITE) t = copyin(u.u_base, (caddr_t)cp, n); else t = copyout((caddr_t)cp, u.u_base, n); if (t) { u.u_error = EFAULT; return; } } else if (flag == B_WRITE) bcopy(u.u_base, (caddr_t)cp, n); else bcopy((caddr_t)cp, u.u_base, n); u.u_base += n; u.u_offset += n; u.u_count -= n; } @ik '$ J2iJ6i /* prim.c 4.11 81/04/17 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/conf.h" #include "../h/buf.h" #include "../h/tty.h" #include "../h/clist.h" char cwaiting; /* * Character list get/put */ getc(p) register struct clist *p; { register struct cblock *bp; register int c, s; s = spl5(); if (p->c_cc <= 0) { c = -1; p->c_cc = 0; p->c_cf = p->c_cl = NULL; } else { c = *p->c_cf++ & 0377; if (--p->c_cc<=0) { bp = (struct cblock *)(p->c_cf-1); bp = (struct cblock *) ((int)bp & ~CROUND); p->c_cf = NULL; p->c_cl = NULL; bp->c_next = cfreelist; cfreelist = bp; cfreecount += CBSIZE; if (cwaiting) { wakeup(&cwaiting); cwaiting = 0; } } else if (((int)p->c_cf & CROUND) == 0){ bp = (struct cblock *)(p->c_cf); bp--; p->c_cf = bp->c_next->c_info; bp->c_next = cfreelist; cfreelist = bp; cfreecount += CBSIZE; if (cwaiting) { wakeup(&cwaiting); cwaiting = 0; } } } splx(s); return(c); } /* * copy clist to buffer. * return number of bytes moved. */ q_to_b(q, cp, cc) register struct clist *q; register char *cp; { register struct cblock *bp; register int s; char *acp; if (cc <= 0) return(0); s = spl5(); if (q->c_cc <= 0) { q->c_cc = 0; q->c_cf = q->c_cl = NULL; splx(s); return(0); } acp = cp; cc++; while (--cc) { *cp++ = *q->c_cf++; if (--q->c_cc <= 0) { bp = (struct cblock *)(q->c_cf-1); bp = (struct cblock *)((int)bp & ~CROUND); q->c_cf = q->c_cl = NULL; bp->c_next = cfreelist; cfreelist = bp; cfreecount += CBSIZE; if (cwaiting) { wakeup(&cwaiting); cwaiting = 0; } break; } if (((int)q->c_cf & CROUND) == 0) { bp = (struct cblock *)(q->c_cf); bp--; q->c_cf = bp->c_next->c_info; bp->c_next = cfreelist; cfreelist = bp; cfreecount += CBSIZE; if (cwaiting) { wakeup(&cwaiting); cwaiting = 0; } } } splx(s); return(cp-acp); } /* * Return count of contiguous characters * in clist starting at q->c_cf. * Stop counting if flag&character is non-null. */ ndqb(q, flag) register struct clist *q; { register cc; int s; s = spl5(); if (q->c_cc <= 0) { cc = -q->c_cc; goto out; } cc = ((int)q->c_cf + CBSIZE) & ~CROUND; cc -= (int)q->c_cf; if (q->c_cc < cc) cc = q->c_cc; if (flag) { register char *p, *end; p = q->c_cf; end = p; end += cc; while (p < end) { if (*p & flag) { cc = (int)p; cc -= (int)q->c_cf; break; } p++; } } out: splx(s); return(cc); } /* * Flush cc bytes from q. */ ndflush(q, cc) register struct clist *q; register cc; { register struct cblock *bp; char *end; int rem; register s; s = spl5(); if (q->c_cc < 0) { printf("neg q flush\n"); goto out; } if (q->c_cc == 0) { goto out; } while (cc>0 && q->c_cc) { bp = (struct cblock *)((int)q->c_cf & ~CROUND); if ((int)bp == (((int)q->c_cl-1) & ~CROUND)) { end = q->c_cl; } else { end = (char *)((int)bp + sizeof (struct cblock)); } rem = end - q->c_cf; if (cc >= rem) { cc -= rem; q->c_cc -= r((em; q->c_cf = bp->c_next->c_info; bp->c_next = cfreelist; cfreelist = bp; cfreecount += CBSIZE; if (cwaiting) { wakeup(&cwaiting); cwaiting = 0; } } else { q->c_cc -= cc; q->c_cf += cc; if (q->c_cc <= 0) { bp->c_next = cfreelist; cfreelist = bp; cfreecount += CBSIZE; if (cwaiting) { wakeup(&cwaiting); cwaiting = 0; } } break; } } if (q->c_cc <= 0) { q->c_cf = q->c_cl = NULL; q->c_cc = 0; } out: splx(s); } putc(c, p) register struct clist *p; { register struct cblock *bp; register char *cp; register s; s = spl5(); if ((cp = p->c_cl) == NULL || p->c_cc < 0 ) { if ((bp = cfreelist) == NULL) { splx(s); return(-1); } cfreelist = bp->c_next; cfreecount -= CBSIZE; bp->c_next = NULL; p->c_cf = cp = bp->c_info; } else if (((int)cp & CROUND) == 0) { bp = (struct cblock *)cp - 1; if ((bp->c_next = cfreelist) == NULL) { splx(s); return(-1); } bp = bp->c_next; cfreelist = bp->c_next; cfreecount -= CBSIZE; bp->c_next = NULL; cp = bp->c_info; } *cp++ = c; p->c_cc++; p->c_cl = cp; splx(s); return(0); } /* * copy buffer to clist. * return number of bytes not transfered. */ b_to_q(cp, cc, q) register char *cp; struct clist *q; register int cc; { register char *cq; register struct cblock *bp; register s, acc; if (cc <= 0) return(0); acc = cc; s = spl5(); if ((cq = q->c_cl) == NULL || q->c_cc < 0) { if ((bp = cfreelist) == NULL) goto out; cfreelist = bp->c_next; cfreecount -= CBSIZE; bp->c_next = NULL; q->c_cf = cq = bp->c_info; } while (cc) { if (((int)cq & CROUND) == 0) { bp = (struct cblock *) cq - 1; if ((bp->c_next = cfreelist) == NULL) goto out; bp = bp->c_next; cfreelist = bp->c_next; cfreecount -= CBSIZE; bp->c_next = NULL; cq = bp->c_info; } *cq++ = *cp++; cc--; } out: q->c_cl = cq; q->c_cc += acc-cc; splx(s); return(cc); } /* * Given a non-NULL pointter into the list (like c_cf which * always points to a real character if non-NULL) return the pointer * to the next character in the list or return NULL if no more chars. * * Callers must not allow getc's to happen between nextc's so that the * pointer becomes invalid. Note that interrupts are NOT masked. */ char * nextc(p, cp) register struct clist *p; register char *cp; { if (p->c_cc && ++cp != p->c_cl) { if (((int)cp & CROUND) == 0) return (((struct cblock *)cp)[-1].c_next->c_info); return (cp); } return (0); } /* * Remove the last character in the list and return it. */ unputc(p) register struct clist *p; { register struct cblock *bp; register int c, s; struct cblock *obp; s = spl5(); if (p->c_cc <= 0) c = -1; else { c = *--p->c_cl; if (--p->c_cc <= 0) { bp = (struct cblock *)p->c_cl; bp = (struct cblock *)((int)bp & ~CROUND); p->c_cl = p->c_cf = NULL; bp->c_next = cfreelist; cfreelist = bp; cfreecount += CBSIZE; } else if (((int)p->c_cl & CROUND) == sizeof(bp->c_next)) { p->c_cl = (char *)((int)p->c_cl & ~CROUND); bp = (struct cblock *)p->c_cf; bp = (struct cblock *)((int)bp & ~CROUND); while (bp->c_next != (struct cblock *)p->c_cl) bp = bp->c_next; obp = bp; p->c_cl = (char *)(bp + 1); bp = bp->c_next; bp->c_next = cfreelist; cfreelist = bp; cfreecount += CBSIZE; obp->c_next = NULL; } } splx(s); return (c); } /* * Put the chars in the from que * on the end of the to que. * * SHOULD JUST USE q_to_b AND THEN b_to_q HERE. */ catq(from, to) struct clist *from, *to; { register c; while ((c = getc(from)) >= 0) (void) putc(c, to); } /* * integer (2-byte) get/put * using clists */ #ifdef unneeded getw(p) register struct clist *p; { register int s; if (p->c_cc <= 1) return(-1); s = getc(p); return(s | (getc(p)<<8)); } #endif putw(c, p) register struct clist *p; { register s; s = spl5(); if (cfreelist==NULL) { splx(s); return(-1); } (void) putc(c, p); (void) putc(c>>8, p); splx(s); return(0); } @ikfR5$$ J2i@6i /* prf.c 4.18 81/06/11 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/seg.h" #include "../h/buf.h" #include "../h/conf.h" #include "../h/mtpr.h" #include "../h/reboot.h" #include "../h/vm.h" #include "../h/msgbuf.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/tty.h" /* * In case console is off, * panicstr contains argument to last * call to panic. */ char *panicstr; /* * Scaled down version of C Library printf. * Used to print diagnostic information directly on console tty. * Since it is not interrupt driven, all system activities are * suspended. Printf should not be used for chit-chat. * * One additional format: %b is supported to decode error registers. * Usage is: * printf("reg=%b\n", regval, "*"); * Where is the output base expressed as a control character, * e.g. \10 gives octal; \20 gives hex. Each arg is a sequence of * characters, the first of which gives the bit number to be inspected * (origin 1), and the next characters (up to a control character, i.e. * a character <= 32), give the name of the register. Thus * printf("reg=%b\n", 3, "\10\2BITTWO\1BITONE\n"); * would produce output: * reg=2 */ /*VARARGS1*/ printf(fmt, x1) char *fmt; unsigned x1; { prf(fmt, &x1, 0); } /* * Uprintf prints to the current user's terminal, * guarantees not to sleep (so can be called by interrupt routines) * and does no watermark checking - (so no verbose messages). */ /*VARARGS1*/ uprintf(fmt, x1) char *fmt; unsigned x1; { prf(fmt, &x1, 2); } prf(fmt, adx, touser) register char *fmt; register u_int *adx; { register int b, c, i; char *s; int any; loop: while ((c = *fmt++) != '%') { if(c == '\0') return; putchar(c, touser); } again: c = *fmt++; /* THIS CODE IS VAX DEPENDENT IN HANDLING %l? AND %c */ switch (c) { case 'l': goto again; case 'x': case 'X': b = 16; goto number; case 'd': case 'D': case 'u': /* what a joke */ b = 10; goto number; case 'o': case 'O': b = 8; number: printn((u_long)*adx, b, touser); break; case 'c': b = *adx; for (i = 24; i >= 0; i -= 8) if (c = (b >> i) & 0x7f) putchar(c, touser); break; case 'b': b = *adx++; s = (char *)*adx; printn((u_long)b, *s++, touser); any = 0; if (b) { putchar('<', touser); while (i = *s++) { if (b & (1 << (i-1))) { if (any) putchar(',', touser); any = 1; for (; (c = *s) > 32; s++) putchar(c, touser); } else for (; *s > 32; s++) ; } if (any) putchar('>', touser); } break; case 's': s = (char *)*adx; while (c = *s++) putchar(c, touser); break; case '%': putchar('%', touser); break; } adx++; goto loop; } /* * Printn prints a number n in base b. * We don't use recursion to avoid deep kernel stacks. */ printn(n, b, touser) u_long n; { char prbuf[11]; register char *cp; if (b == 10 && (int)n < 0) { putchar('-', touser); n = (unsigned)(-(int)n); } cp = prbuf; do { *cp++ = "0123456789abcdef"[n%b]; n /= b; } while (n); do putchar(*--cp, touser); while (cp > prbuf); } /* * Panic is called on unresolvable fatal errors. * It prints "panic: mesg", and then reboots. * If we are called twice, then we avoid trying to * sync the disks as this often leads to recursive panics. */ panic(s) char *s; { int bootopt = panicstr ? RB_AUTOBOOT : RB_AUTOBOOT|RB_NOSYNC; panicstr = s; printf("panic: %s\n", s); (void) spl0(); boot(RB_PANIC, bootopt); } /* * Warn that a system table is full. */ tablefull(tab) char *tab; { printf("%s: table is full\n", tab); } /* * Hard error is the preface to plaintive error messages * about failing disk transfers. */ harderr(bp, cp) struct buf *bp; char *cp; { printf("%s%d%c: hard error sn%d ", cp, dkunit(bp), 'a'+(minor(bp->b_dev)&07), bp->b_blkno); } /* * Print a character on console or users terminal. * If destination is console then the last MSGBUFS characters * are saved in msgbuf for inspection later. */ /*ARGSUSED*/ putchar(c, touser) register int c; { if (touser) { register struct tty *tp = u.u_ttyp; if (tp && (tp->t_state&CARR_ON)) { register s = spl6(); if (c == '\n') ttyoutput('\r', tp); ttyoutput(c, tp); ttstart(tp); splx(s); } return; } if (c != '\0' && c != '\r' && c != 0177 && mfpr(MAPEN)) { if (msgbuf.msg_magic != MSG_MAGIC) { msgbuf.msg_bufx = 0; msgbuf.msg_magic = MSG_MAGIC; } if (msgbuf.msg_bufx < 0 || msgbuf.msg_bufx >= MSG_BSIZE) msgbuf.msg_bufx = 0; msgbuf.msg_bufc[msgbuf.msg_bufx++] = c; } if (c == 0) return; cnputc(c); } ((@ikŻ$O H2i 6i /* pipe.c 4.3 81/03/08 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/inode.h" #include "../h/file.h" #include "../h/reg.h" #include "../h/inline.h" #include "../h/proc.h" /* * Max allowable buffering per pipe. * This is also the max size of the * file created to implement the pipe. * If this size is bigger than 5120, * pipes will be implemented with large * files, which is probably not good. */ #define PIPSIZ 4096 /* * The sys-pipe entry. * Allocate an inode on the root device. * Allocate 2 file structures. * Put it all together with flags. */ pipe() { register struct inode *ip; register struct file *rf, *wf; int r; ip = ialloc(pipedev); if(ip == NULL) return; rf = falloc(); if(rf == NULL) { iput(ip); return; } r = u.u_r.r_val1; wf = falloc(); if(wf == NULL) { rf->f_count = 0; u.u_ofile[r] = NULL; iput(ip); return; } u.u_r.r_val2 = u.u_r.r_val1; u.u_r.r_val1 = r; wf->f_flag = FWRITE|FPIPE; wf->f_inode = ip; rf->f_flag = FREAD|FPIPE; rf->f_inode = ip; ip->i_count = 2; ip->i_mode = IFREG; ip->i_flag = IACC|IUPD|ICHG|IPIPE; } /* * Read call directed to a pipe. */ readp(fp) register struct file *fp; { register struct inode *ip; ip = fp->f_inode; loop: /* * Very conservative locking. */ plock(ip); /* * If nothing in the pipe, wait. */ if (ip->i_size == 0) { /* * If there are not both reader and * writer active, return without * satisfying read. */ prele(ip); if(ip->i_count < 2) return; ip->i_mode |= IREAD; sleep((caddr_t)ip+2, PPIPE); goto loop; } /* * Read and return */ u.u_offset = fp->f_un.f_offset; readi(ip); fp->f_un.f_offset = u.u_offset; /* * If reader has caught up with writer, reset * offset and size to 0. */ if (fp->f_un.f_offset == ip->i_size) { fp->f_un.f_offset = 0; ip->i_size = 0; if(ip->i_mode & IWRITE) { ip->i_mode &= ~IWRITE; wakeup((caddr_t)ip+1); } } prele(ip); } /* * Write call directed to a pipe. */ writep(fp) register struct file *fp; { register unsigned c; register struct inode *ip; ip = fp->f_inode; c = u.u_count; loop: /* * If error or all done, return. */ if (u.u_error) return; plock(ip); if(c == 0) { prele(ip); u.u_count = 0; return; } /* * If there are not both read and * write sides of the pipe active, * return error and signal too. */ if(ip->i_count < 2) { prele(ip); u.u_error = EPIPE; psignal(u.u_procp, SIGPIPE); return; } /* * If the pipe is full, * wait for reads to deplete * and truncate it. */ if(ip->i_size >= PIPSIZ) { ip->i_mode |= IWRITE; prele(ip); sleep((caddr_t)ip+1, PPIPE); goto loop; } /* * Write what is possible and * loop back. * If writing less than PIPSIZ, it always goes. * One can therefore get a file > PIPSIZ if write * sizes do not divide PIPSIZ. */ u.u_offset = ip->i_size; u.u_count = MIN(c, PIPSIZ); c -= u.u_count; writei(ip); prele(ip); if(ip->i_mode&IREAD) { ip->i_mode &= ~IREAD; wakeup((caddr_t)ip+2); } goto loop; } #ifdef plock #undef plock #endif #ifdef prele #undef prele #endif /* * Lock a pipe. * If its already locked, * set the WANT bit and sleep. */ plock(ip) register struct inode *ip; { while(ip->i_flag&ILOCK) { ip->i_flag |= IWANT; sleep((caddr_t)ip, PINOD); } ip->i_flag |= ILOCK; } /* * Unlock a pipe. * If WANT bit is on, * wakeup. * This routine is also used * to unlock inodes in general. */ prele(ip) register struct inode *ip; { ip->i_flag &= ~ILOCK; if(ip->i_flag&IWANT) { ip->i_flag &= ~IWANT; wakeup((caddr_t)ip); } } @ikn $G2i 6i /* partab.c 4.2 81/03/08 */ /* * Table giving parity for characters and indicating * character classes to tty driver. In particular, * if the low 6 bits are 0, then the character needs * no special processing on output. */ char partab[] = { 0001,0201,0201,0001,0201,0001,0001,0201, 0202,0004,0003,0201,0005,0206,0201,0001, 0201,0001,0001,0201,0001,0201,0201,0001, 0001,0201,0201,0001,0201,0001,0001,0201, 0200,0000,0000,0200,0000,0200,0200,0000, 0000,0200,0200,0000,0200,0000,0000,0200, 0000,0200,0200,0000,0200,0000,0000,0200, 0200,0000,0000,0200,0000,0200,0200,0000, 0200,0000,0000,0200,0000,0200,0200,0000, 0000,0200,0200,0000,0200,0000,0000,0200, 0000,0200,0200,0000,0200,0000,0000,0200, 0200,0000,0000,0200,0000,0200,0200,0000, 0000,0200,0200,0000,0200,0000,0000,0200, 0200,0000,0000,0200,0000,0200,0200,0000, 0200,0000,0000,0200,0000,0200,0200,0000, 0000,0200,0200,0000,0200,0000,0000,0201, /* * 7 bit ascii ends with the last character above, * but we contine through all 256 codes for the sake * of the tty output routines which use special vax * instructions which need a 256 character trt table. */ 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007 }; @ik<$*G2izJf6i /* param.c 4.2 81/04/02 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/text.h" #include "../h/inode.h" #include "../h/file.h" #include "../h/callout.h" #include "../h/clist.h" #include "../h/cmap.h" /* * System parameter formulae. * * This file is copied into each directory where we compile * the kernel; it should be modified there to suit local taste * if necessary. * * Compiled with -DHZ=xx -DTIMEZONE=x -DDST=x -DMAXUSERS=xx */ int hz = HZ; int timezone = TIMEZONE; int dstflag = DST; #define NPROC (20 + 8 * MAXUSERS) int nproc = NPROC; int ntext = 24 + MAXUSERS; int ninode = (NPROC + 16 + MAXUSERS) + 32; int nfile = 8 * (NPROC + 16 + MAXUSERS) / 10 + 32; int ncallout = 16 + MAXUSERS; int nclist = 100 + 16 * MAXUSERS; /* * These are initialized at bootstrap time * to values dependent on memory size */ int nbuf, nswbuf; /* * These have to be allocated somewhere; allocating * them here forces loader errors i((f this file is omitted. */ struct proc *proc, *procNPROC; struct text *text, *textNTEXT; struct inode *inode, *inodeNINODE; struct file *file, *fileNFILE; struct callout *callout; struct cblock *cfree; struct buf *buf, *swbuf; short *swsize; int *swpf; char *buffers; struct cmap *cmap, *ecmap; @ik)$|G2iIf6i /* nami.c 4.5 81/03/09 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/inode.h" #include "../h/mount.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/buf.h" #include "../h/conf.h" /* * Convert a pathname into a pointer to * an inode. Note that the inode is locked. * * func = function called to get next char of name * &uchar if name is in user space * &schar if name is in system space * flag = 0 if name is sought * 1 if name is to be created * 2 if name is to be deleted */ struct inode * namei(func, flag) int (*func)(); { register struct inode *dp; register c; register char *cp; struct buf *bp; register struct direct *ep; int i; dev_t d; off_t eo; /* * If name starts with '/' start from * root; otherwise start from current dir. */ dp = u.u_cdir; if((c=(*func)()) == '/') if ((dp = u.u_rdir) == NULL) dp = rootdir; (void) iget(dp->i_dev, dp->i_number); while(c == '/') c = (*func)(); if(c == '\0' && flag != 0) u.u_error = ENOENT; cloop: /* * Here dp contains pointer * to last component matched. */ if(u.u_error) goto out; if(c == '\0') return(dp); /* * If there is another component, * Gather up name into * users' dir buffer. */ cp = &u.u_dbuf[0]; while (c != '/' && c != '\0' && u.u_error == 0 ) { if (mpxip!=NULL && c=='!') break; if (flag==1 && c == ('/'|0200)) { u.u_error = ENOENT; goto out; } if (cp < &u.u_dbuf[DIRSIZ]) *cp++ = c; c = (*func)(); } while(cp < &u.u_dbuf[DIRSIZ]) *cp++ = '\0'; while(c == '/') c = (*func)(); if (c == '!' && mpxip != NULL) { iput(dp); plock(mpxip); mpxip->i_count++; return(mpxip); } seloop: /* * dp must be a directory and * must have X permission. */ if((dp->i_mode&IFMT) != IFDIR) u.u_error = ENOTDIR; (void) access(dp, IEXEC); if(u.u_error) goto out; /* * set up to search a directory */ u.u_offset = 0; u.u_segflg = 1; eo = 0; bp = NULL; if (dp == u.u_rdir && u.u_dbuf[0] == '.' && u.u_dbuf[1] == '.' && u.u_dbuf[2] == 0) goto cloop; eloop: /* * If at the end of the directory, * the search failed. Report what * is appropriate as per flag. */ if(u.u_offset >= dp->i_size) { if(bp != NULL) brelse(bp); if(flag==1 && c=='\0' && dp->i_nlink) { if(access(dp, IWRITE)) goto out; u.u_pdir = dp; if(eo) u.u_offset = eo-sizeof(struct direct); else dp->i_flag |= IUPD|ICHG; return(NULL); } u.u_error = ENOENT; goto out; } /* * If offset is on a block boundary, * read the next directory block. * Release previous if it exists. */ if((u.u_offset&BMASK) == 0) { if(bp != NULL) brelse(bp); bp = bread(dp->i_dev, bmap(dp, (daddr_t)(u.u_offset>>BSHIFT), B_READ)); if (bp->b_flags & B_ERROR) { brelse(bp); goto out; } ep = (struct direct *)bp->b_un.b_addr; } else ep++; /* * Note first empty directory slot * in eo for possible creat. * String compare the directory entry * and the current component. * If they do not match, go back to eloop. */ u.u_offset += sizeof(struct direct); if(ep->d_ino == 0) { if(eo == 0) eo = u.u_offset; goto eloop; } for(i=0; id_name[i]) goto eloop; if(u.u_dbuf[i] == 0) break; } /* * Here a component matched in a directory. * If there is more pathname, go back to * cloop, otherwise return. */ bcopy((caddr_t)ep, (caddr_t)&u.u_dent, sizeof(struct direct)); if(bp != NULL) brelse(bp); if(flag==2 && c=='\0') { if(access(dp, IWRITE)) goto out; return(dp); } d = dp->i_dev; if(u.u_dent.d_ino == ROOTINO) if(dp->i_number == ROOTINO) if(u.u_dent.d_name[1] == '.') for(i=1; ii_count++; plock(dp); goto seloop; } iput(dp); dp = iget(d, u.u_dent.d_ino); if(dp == NULL) return(NULL); goto cloop; out: iput(dp); return(NULL); } /* * Return the next character from the * kernel string pointed at by dirp. */ schar() { return(*u.u_dirp++ & 0377); } /* * Return the next character from the * user string pointed at by dirp. */ uchar() { register c; c = fubyte(u.u_dirp++); if(c == -1) u.u_error = EFAULT; return(c); } @ikЩ$jmpsvyF2i7Q6i /* main.c 4.18- 81/08/24 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/filsys.h" #include "../h/mount.h" #include "../h/map.h" #include "../h/proc.h" #include "../h/inode.h" #include "../h/seg.h" #include "../h/conf.h" #include "../h/buf.h" #include "../h/mtpr.h" #include "../h/pte.h" #include "../h/clock.h" #include "../h/vm.h" #include "../h/cmap.h" #include "../h/text.h" #include "../h/vlimit.h" #include "../h/clist.h" /* * Initialization code. * Called from cold start routine as * soon as a stack and segmentation * have been established. * Functions: * clear and free user core * turn on clock * hand craft 0th process * call all initialization routines * fork - process 0 to schedule * - process 2 to page out * - process 1 execute bootstrap * * loop at loc 13 (0xd) in user mode -- /etc/init * cannot be executed. */ main(firstaddr) { register int i; register struct proc *p; rqinit(); startup(firstaddr); /* * set up system process 0 (swapper) */ p = &proc[0]; p->p_p0br = (struct pte *)mfpr(P0BR); p->p_szpt = 1; p->p_addr = uaddr(p); p->p_stat = SRUN; p->p_flag |= SLOAD|SSYS; p->p_nice = NZERO; setredzone(p->p_addr, (caddr_t)&u); u.u_procp = p; u.u_cmask = CMASK; for (i = 1; i < sizeof(u.u_limit)/sizeof(u.u_limit[0]); i++) switch (i) { case LIM_STACK: u.u_limit[i] = 512*1024; continue; case LIM_DATA: u.u_limit[i] = ctob(MAXDSIZ); continue; default: u.u_limit[i] = INFINITY; continue; } p->p_maxrss = INFINITY/NBPG; clkstart(); /* * Initialize devices and * set up 'known' i-nodes */ ihinit(); bhinit(); cinit(); binit(); bswinit(); iinit(); rootdir = iget(rootdev, (ino_t)ROOTINO); rootdir->i_flag &= ~ILOCK; u.u_cdir = iget(rootdev, (ino_t)ROOTINO); u.u_cdir->i_flag &= ~ILOCK; u.u_rdir = NULL; u.u_dmap = zdmap; u.u_smap = zdmap; /* * Set the scan rate and other parameters of the paging subsystem. */ setupclock(); /* * make page-out daemon (pro((cess 2) * the daemon has ctopt(nswbuf*CLSIZE*KLMAX) pages of page * table so that it can map dirty pages into * its address space during asychronous pushes. */ mpid = 1; proc[0].p_szpt = clrnd(ctopt(nswbuf*CLSIZE*KLMAX + UPAGES)); proc[1].p_stat = SZOMB; /* force it to be in proc slot 2 */ if (newproc(0)) { proc[2].p_flag |= SLOAD|SSYS; proc[2].p_dsize = u.u_dsize = nswbuf*CLSIZE*KLMAX; pageout(); } /* * make init process and * enter scheduling loop */ mpid = 0; proc[1].p_stat = 0; proc[0].p_szpt = CLSIZE; if (newproc(0)) { expand(clrnd((int)btoc(szicode)), P0BR); (void) swpexpand(u.u_dsize, 0, &u.u_dmap, &u.u_smap); (void) copyout((caddr_t)icode, (caddr_t)0, (unsigned)szicode); /* * Return goes to loc. 0 of user init * code just copied out. */ return; } proc[0].p_szpt = 1; sched(); } /* * iinit is called once (from main) * very early in initialization. * It reads the root's super block * and initializes the current date * from the last modified date. * * panic: iinit -- cannot read the super * block. Usually because of an IO error. */ iinit() { register struct buf *bp; register struct filsys *fp; register int i; (*bdevsw[major(rootdev)].d_open)(rootdev, 1); bp = bread(rootdev, SUPERB); if(u.u_error) panic("iinit"); bp->b_flags |= B_LOCKED; /* block can never be re-used */ brelse(bp); mount[0].m_dev = rootdev; mount[0].m_bufp = bp; fp = bp->b_un.b_filsys; fp->s_flock = 0; fp->s_ilock = 0; fp->s_ronly = 0; fp->s_lasti = 1; fp->s_nbehind = 0; fp->s_fsmnt[0] = '/'; for (i = 1; i < sizeof(fp->s_fsmnt); i++) fp->s_fsmnt[i] = 0; clkinit(fp->s_time); bootime = time; } /* * Initialize the buffer I/O system by freeing * all buffers and setting all device buffer lists to empty. */ binit() { register struct buf *bp; register struct buf *dp; register int i; struct bdevsw *bdp; struct swdevt *swp; for (dp = bfreelist; dp < &bfreelist[BQUEUES]; dp++) { dp->b_forw = dp->b_back = dp->av_forw = dp->av_back = dp; dp->b_flags = B_HEAD; } dp--; /* dp = &bfreelist[BQUEUES-1]; */ for (i=0; ib_dev = NODEV; bp->b_un.b_addr = buffers + i * BSIZE; bp->b_back = dp; bp->b_forw = dp->b_forw; dp->b_forw->b_back = bp; dp->b_forw = bp; bp->b_flags = B_BUSY|B_INVAL; brelse(bp); } for (bdp = bdevsw; bdp->d_open; bdp++) nblkdev++; /* * Count swap devices, and adjust total swap space available. * Some of this space will not be available until a vswapon() * system is issued, usually when the system goes multi-user. */ nswdev = 0; for (swp = swdevt; swp->sw_dev; swp++) nswdev++; if (nswdev == 0) panic("binit"); if (nswdev > 1) nswap = (nswap/DMMAX)*DMMAX; nswap *= nswdev; maxpgio *= nswdev; swfree(0); } /* * Initialize linked list of free swap * headers. These do not actually point * to buffers, but rather to pages that * are being swapped in and out. */ bswinit() { register int i; register struct buf *sp = swbuf; bswlist.av_forw = sp; for (i=0; iav_forw = sp+1; sp->av_forw = NULL; } /* * Initialize clist by freeing all character blocks, then count * number of character devices. (Once-only routine) */ cinit() { register int ccp; register struct cblock *cp; register struct cdevsw *cdp; ccp = (int)cfree; ccp = (ccp+CROUND) & ~CROUND; for(cp=(struct cblock *)ccp; cp < &cfree[nclist-1]; cp++) { cp->c_next = cfreelist; cfreelist = cp; cfreecount += CBSIZE; } ccp = 0; for(cdp = cdevsw; cdp->d_open; cdp++) ccp++; nchrdev = ccp; } @ik+o:$dgF2i 6i /* ioctl.c 4.4 81/03/08 */ /* * Ioctl. */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/tty.h" #include "../h/proc.h" #include "../h/inode.h" #include "../h/file.h" #include "../h/conf.h" /* * stty/gtty writearound */ stty() { u.u_arg[2] = u.u_arg[1]; u.u_arg[1] = TIOCSETP; ioctl(); } gtty() { u.u_arg[2] = u.u_arg[1]; u.u_arg[1] = TIOCGETP; ioctl(); } /* * ioctl system call * Check legality, execute common code, and switch out to individual * device routine. */ ioctl() { register struct file *fp; register struct inode *ip; register struct a { int fdes; int cmd; caddr_t cmarg; } *uap; register dev_t dev; register fmt; uap = (struct a *)u.u_ap; if ((fp = getf(uap->fdes)) == NULL) return; if ((fp->f_flag & (FREAD|FWRITE)) == 0) { u.u_error = EBADF; return; } if (uap->cmd==FIOCLEX) { u.u_pofile[uap->fdes] |= EXCLOSE; return; } if (uap->cmd==FIONCLEX) { u.u_pofile[uap->fdes] &= ~EXCLOSE; return; } ip = fp->f_inode; fmt = ip->i_mode & IFMT; if (fmt != IFCHR && fmt != IFMPC) { /* begin local */ if (uap->cmd==FIONREAD && (fmt == IFREG || fmt == IFDIR)) { off_t nread = ip->i_size - fp->f_un.f_offset; if (copyout((caddr_t)&nread, uap->cmarg, sizeof(off_t))) u.u_error = EFAULT; } else /* end local */ u.u_error = ENOTTY; return; } dev = ip->i_un.i_rdev; u.u_r.r_val1 = 0; if ((u.u_procp->p_flag&SNUSIG) && setjmp(u.u_qsav)) { u.u_eosys = RESTARTSYS; return; } (*cdevsw[major(dev)].d_ioctl)(dev, uap->cmd, uap->cmarg, 0); } /* * Do nothing specific version of line * discipline specific ioctl command. */ /*ARGSUSED*/ nullioctl(tp, cmd, addr) struct tty *tp; caddr_t addr; { return (cmd); } @ik$LORUX[^aF2i| 6i /* iget.c 4.4 81/03/08 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/mount.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/inode.h" #include "../h/ino.h" #include "../h/filsys.h" #include "../h/conf.h" #include "../h/buf.h" #include "../h/inline.h" #define INOHSZ 63 #define INOHASH(dev,ino) (((dev)+(ino))%INOHSZ) short inohash[INOHSZ]; short ifreel; /* * Initialize hash links for inodes * and build inode free list. */ ihinit() { register int i; register struct inode *ip = inode; ifreel = 0; for (i = 0; i < ninode-1; i++, ip++) ip->i_hlink = i+1; ip->i_hlink = -1; for (i = 0; i < INOHSZ; i++) inohash[i] = -1; } /* * Find an inode if it is incore. * This is the equivalent, for inodes, * of ``incore'' in bio.c or ``pfind'' in subr.c. */ struct inode * ifind(dev, ino) dev_t dev; ino_t ino; { register struct inode *ip; for (ip = &inode[inohash[INOHASH(dev,ino)]]; ip != &inode[-1]; ip = &inode[ip->i_hlink]) if (ino==ip->i_number && dev==ip->i_dev) return (ip); return ((struct inode *)0); } /* * Look up an inode by device,inumber. * If it is in core (in the inode structure), * honor the locking protocol. * If it is not in core, read it in from the * specified device. * If the inode is mounted on, perform * the indicated indirection. * In all cases, a pointer to a locked * inode structure is returned. * * panic: no imt -- if the mounted file * system is not in the mount table. * "cannot happen" */ struct inode * iget(dev, ino) dev_t dev; ino_t ino; { register struct inode *ip; register struct mount *mp; register struct buf *bp; register struct dinode *dp; register int slot; loop: slot = INOHASH(dev, ino); ip = &inode[inohash[slot]]; while (ip != &inode[-1]) { if(ino == ip->i_number && dev == ip->i_dev) { if((ip->i_flag&ILOCK) != 0) { ip->i_flag |= IWANT; sleep((caddr_t)ip, PINOD); goto loop; } if((ip->i_flag&IMOUNT) != 0) { for(mp = &mount[0]; mp < &mount[NMOUNT]; mp++) if(mp->m_inodp == ip) { (( dev = mp->m_dev; ino = ROOTINO; goto loop; } panic("no imt"); } ip->i_count++; ip->i_flag |= ILOCK; return(ip); } ip = &inode[ip->i_hlink]; } if(ifreel < 0) { tablefull("inode"); u.u_error = ENFILE; return(NULL); } ip = &inode[ifreel]; ifreel = ip->i_hlink; ip->i_hlink = inohash[slot]; inohash[slot] = ip - inode; ip->i_dev = dev; ip->i_number = ino; ip->i_flag = ILOCK; ip->i_count++; ip->i_un.i_lastr = 0; bp = bread(dev, itod(ino)); /* * Check I/O errors */ if((bp->b_flags&B_ERROR) != 0) { brelse(bp); iput(ip); return(NULL); } dp = bp->b_un.b_dino; dp += itoo(ino); iexpand(ip, dp); brelse(bp); return(ip); } iexpand(ip, dp) register struct inode *ip; register struct dinode *dp; { register char *p1, *p2; register int i; ip->i_mode = dp->di_mode; ip->i_nlink = dp->di_nlink; ip->i_uid = dp->di_uid; ip->i_gid = dp->di_gid; ip->i_size = dp->di_size; p1 = (char *)ip->i_un.i_addr; p2 = (char *)dp->di_addr; for(i=0; ii_count == 1) { ip->i_flag |= ILOCK; if(ip->i_nlink <= 0) { itrunc(ip); ip->i_mode = 0; ip->i_flag |= IUPD|ICHG; ifree(ip->i_dev, ip->i_number); } IUPDAT(ip, &time, &time, 0); prele(ip); i = INOHASH(ip->i_dev, ip->i_number); x = ip - inode; if (inohash[i] == x) { inohash[i] = ip->i_hlink; } else { for (jp = &inode[inohash[i]]; jp != &inode[-1]; jp = &inode[jp->i_hlink]) if (jp->i_hlink == x) { jp->i_hlink = ip->i_hlink; goto done; } panic("iput"); } done: ip->i_hlink = ifreel; ifreel = x; ip->i_flag = 0; ip->i_number = 0; } else prele(ip); ip->i_count--; } /* * Check accessed and update flags on * an inode structure. * If any is on, update the inode * with the current time. * If waitfor is given, then must insure * i/o order so wait for write to complete. */ iupdat(ip, ta, tm, waitfor) register struct inode *ip; time_t *ta, *tm; int waitfor; { register struct buf *bp; struct dinode *dp; register char *p1, *p2; register int i; if((ip->i_flag&(IUPD|IACC|ICHG)) != 0) { if(getfs(ip->i_dev)->s_ronly) return; bp = bread(ip->i_dev, itod(ip->i_number)); if (bp->b_flags & B_ERROR) { brelse(bp); return; } dp = bp->b_un.b_dino; dp += itoo(ip->i_number); dp->di_mode = ip->i_mode; dp->di_nlink = ip->i_nlink; dp->di_uid = ip->i_uid; dp->di_gid = ip->i_gid; dp->di_size = ip->i_size; p1 = (char *)dp->di_addr; p2 = (char *)ip->i_un.i_addr; for(i=0; ii_mode&IFMT)!=IFMPC && (ip->i_mode&IFMT)!=IFMPB) printf("iaddress > 2^24\n"); } if(ip->i_flag&IACC) dp->di_atime = *ta; if(ip->i_flag&IUPD) dp->di_mtime = *tm; if(ip->i_flag&ICHG) dp->di_ctime = time; ip->i_flag &= ~(IUPD|IACC|ICHG); if (waitfor) bwrite(bp); else bdwrite(bp); } } /* * Free all the disk blocks associated * with the specified inode structure. * The blocks of the file are removed * in reverse order. This FILO * algorithm will tend to maintain * a contiguous free list much longer * than FIFO. */ itrunc(ip) register struct inode *ip; { register i; dev_t dev; daddr_t bn; struct inode itmp; if (ip->i_vfdcnt) panic("itrunc"); i = ip->i_mode & IFMT; if (i!=IFREG && i!=IFDIR) return; /* * Clean inode on disk before freeing blocks * to insure no duplicates if system crashes. */ itmp = *ip; itmp.i_size = 0; for (i = 0; i < NADDR; i++) itmp.i_un.i_addr[i] = 0; itmp.i_flag |= ICHG|IUPD; iupdat(&itmp, &time, &time, 1); ip->i_flag &= ~(IUPD|IACC|ICHG); /* * Now return blocks to free list... if machine * crashes, they will be harmless MISSING blocks. */ dev = ip->i_dev; for(i=NADDR-1; i>=0; i--) { bn = ip->i_un.i_addr[i]; if(bn == (daddr_t)0) continue; ip->i_un.i_addr[i] = (daddr_t)0; switch(i) { default: free(dev, bn); break; case NADDR-3: tloop(dev, bn, 0, 0); break; case NADDR-2: tloop(dev, bn, 1, 0); break; case NADDR-1: tloop(dev, bn, 1, 1); } } ip->i_size = 0; /* * Inode was written and flags updated above. * No need to modify flags here. */ } tloop(dev, bn, f1, f2) dev_t dev; daddr_t bn; { register i; register struct buf *bp; register daddr_t *bap; daddr_t nb; bp = NULL; for(i=NINDIR-1; i>=0; i--) { if(bp == NULL) { bp = bread(dev, bn); if (bp->b_flags & B_ERROR) { brelse(bp); return; } bap = bp->b_un.b_daddr; } nb = bap[i]; if(nb == (daddr_t)0) continue; if(f1) { brelse(bp); bp = NULL; tloop(dev, nb, f2, 0); } else free(dev, nb); } if(bp != NULL) brelse(bp); free(dev, bn); } /* * Make a new file. */ struct inode * maknode(mode) { register struct inode *ip; ip = ialloc(u.u_pdir->i_dev); if(ip == NULL) { iput(u.u_pdir); return(NULL); } ip->i_flag |= IACC|IUPD|ICHG; if((mode&IFMT) == 0) mode |= IFREG; ip->i_mode = mode & ~u.u_cmask; ip->i_nlink = 1; ip->i_uid = u.u_uid; ip->i_gid = u.u_gid; /* * Make sure inode goes to disk before directory entry. */ iupdat(ip, &time, &time, 1); wdir(ip); return(ip); } /* * Write a directory entry with * parameters left as side effects * to a call to namei. */ wdir(ip) struct inode *ip; { u.u_dent.d_ino = ip->i_number; bcopy((caddr_t)u.u_dbuf, (caddr_t)u.u_dent.d_name, DIRSIZ); u.u_count = sizeof(struct direct); u.u_segflg = 1; u.u_base = (caddr_t)&u.u_dent; writei(u.u_pdir); iput(u.u_pdir); } @ik'BQ$=@CFIF2iy 6i /* fio.c 4.8 81/03/08 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/filsys.h" #include "../h/file.h" #include "../h/conf.h" #include "../h/inode.h" #include "../h/reg.h" #include "../h/acct.h" #include "../h/mount.h" /* * Convert a user supplied * file descriptor into a pointer * to a file structure. * Only task is to check range * of the descriptor. */ struct file * getf(f) register int f; { register struct file *fp; if ((unsigned)f >= NOFILE || (fp = u.u_ofile[f]) == NULL) { u.u_error = EBADF; return (NULL); } return (fp); } /* * Internal form of close. * Decrement reference count on * file structure. * Also make sure the pipe protocol * does not constipate. * * Decrement reference count on the inode following * removal to the referencing file structure. * Call device handler on last close. */ closef(fp) register struct file *fp; { register struct inode *ip; register struct mount *mp; int flag, mode; dev_t dev; register int (*cfunc)(); if(fp == NULL) return; if (fp->f_count > 1) { fp->f_count--; return; } ip = fp->f_inode; flag = fp->f_flag; dev = (dev_t)ip->i_un.i_rdev; mode = ip->i_mode & IFMT; plock(ip); fp->f_count = 0; if(flag & FPIPE) { ip->i_mode &= ~(IREAD|IWRITE); wakeup((caddr_t)ip+1); wakeup((caddr_t)ip+2); } iput(ip); switch(mode) { case IFCHR: case IFMPC: cfunc = cdevsw[major(dev)].d_close; break; case IFBLK: /* * We don't want to really close the device if it is mounted */ for (mp = mount; mp < &mount[NMOUNT]; mp++) if (mp->m_bufp != NULL && mp->m_dev == dev) return; case IFMPB: cfunc = bdevsw[major(dev)].d_close; break; default: return; } if ((flag & FMP) == 0) { for(fp=file; fp < fileNFILE; fp++) if (fp->f_count && (ip=fp->f_inode)->i_un.i_rdev==dev && (ip->i_mode&IFMT) == mode) return; if (mode == IFBLK) { /* * on last close of a block device (that isn't mounted) * we must invalidate any in core blocks */ bflush(dev); binval(dev); } } (*cfunc)(dev, flag, fp); } /* * openi called to allow handler * of special files to initialize and * validate before actual IO. */ openi(ip, rw) register struct inode *ip; { dev_t dev; register unsigned int maj; dev = (dev_t)ip->i_un.i_rdev; maj = major(dev); switch(ip->i_mode&IFMT) { case IFCHR: case IFMPC: if(maj >= nchrdev) goto bad; (*cdevsw[maj].d_open)(dev, rw); break; case IFBLK: case IFMPB: if(maj >= nblkdev) goto bad; (*bdevsw[maj].d_open)(dev, rw); } return; bad: u.u_error = ENXIO; } /* * Check mode permission on inode pointer. * Mode is READ, WRITE or EXEC. * In the case of WRITE, the * read-only status of the file * system is checked. * Also in WRITE, prototype text * segments cannot be written. * The mode is shifted to select * the owner/group/other fields. * The super user is granted all * permissions. */ access(ip, mode) register struct inode *ip; { register m; m = mode; if(m == IWRITE) { if(getf((s(ip->i_dev)->s_ronly != 0) { u.u_error = EROFS; return(1); } if (ip->i_flag&ITEXT) /* try to free text */ xrele(ip); if(ip->i_flag & ITEXT) { u.u_error = ETXTBSY; return(1); } } if(u.u_uid == 0) return(0); if(u.u_uid != ip->i_uid) { m >>= 3; if(u.u_gid != ip->i_gid) m >>= 3; } if((ip->i_mode&m) != 0) return(0); u.u_error = EACCES; return(1); } /* * Look up a pathname and test if * the resultant inode is owned by the * current user. * If not, try for super-user. * If permission is granted, * return inode pointer. */ struct inode * owner() { register struct inode *ip; ip = namei(uchar, 0); if(ip == NULL) return(NULL); if(u.u_uid == ip->i_uid) return(ip); if(suser()) return(ip); iput(ip); return(NULL); } /* * Test if the current user is the * super user. */ suser() { if(u.u_uid == 0) { u.u_acflag |= ASU; return(1); } u.u_error = EPERM; return(0); } /* * Allocate a user file descriptor. */ ufalloc() { register i; for(i=0; if_count == 0) goto slot; for (fp = file; fp < lastf; fp++) if (fp->f_count == 0) goto slot; tablefull("file"); u.u_error = ENFILE; return (NULL); slot: u.u_ofile[i] = fp; fp->f_count++; fp->f_un.f_offset = 0; lastf = fp + 1; return (fp); } @ikR$)"%(+.147: F2i6i /* clock.c 4.25 81/08/31 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dk.h" #include "../h/callout.h" #include "../h/seg.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/reg.h" #include "../h/psl.h" #include "../h/vm.h" #include "../h/buf.h" #include "../h/text.h" #include "../h/vlimit.h" #include "../h/mtpr.h" #include "../h/clock.h" #include "../h/cpu.h" #include "bk.h" #include "dh.h" #include "dz.h" /* * Hardclock is called straight from * the real time clock interrupt. * We limit the work we do at real clock interrupt time to: * reloading clock * decrementing time to callouts * recording cpu time usage * modifying priority of current process * arrange for soft clock interrupt * kernel pc profiling * * At software (softclock) interrupt time we: * implement callouts * maintain date * lightning bolt wakeup (every second) * alarm clock signals * jab the scheduler * * On the vax softclock interrupts are implemented by * software interrupts. Note that we may have multiple softclock * interrupts compressed into one (due to excessive interrupt load), * but that hardclock interrupts should never be lost. */ /*ARGSUSED*/ hardclock(pc, ps) caddr_t pc; { register struct callout *p1; register struct proc *pp; register int s, cpstate; /* * reprime clock */ clkreld(); /* * update callout times */ for (p1 = calltodo.c_next; p1 && p1->c_time <= 0; p1 = p1->c_next) ; if (p1) p1->c_time--; /* * Maintain iostat and per-process cpu statistics */ if (!noproc) { s = u.u_procp->p_rssize; u.u_vm.vm_idsrss += s; if (u.u_procp->p_textp) { register int xrss = u.u_procp->p_textp->x_rssize; s += xrss; u.u_vm.vm_ixrss += xrss; } if (s > u.u_vm.vm_maxrss) u.u_vm.vm_maxrss = s; if ((u.u_vm.vm_utime+u.u_vm.vm_stime+1)/hz > u.u_limit[LIM_CPU]) { psignal(u.u_procp, SIGXCPU); if (u.u_limit[LIM_CPU] < INFINITY - 5) u.u_limit[LIM_CPU] += 5; } } /* * Update iostat information. */ if (USERMODE(ps)) { u.u_vm.vm_utime++; if(u.u_procp->p_nice > NZERO) cpstate = CP_NICE; else cpstate = CP_USER; } else { cpstate = CP_SYS; if (noproc) cpstate = CP_IDLE; else u.u_vm.vm_stime++; } cp_time[cpstate]++; for (s = 0; s < DK_NDRIVE; s++) if (dk_busy&(1<p_cpticks++; if(++pp->p_cpu == 0) pp->p_cpu--; if(pp->p_cpu % 4 == 0) { (void) setpri(pp); if (pp->p_pri >= PUSER) pp->p_pri = pp->p_usrpri; } } /* * Time moves on. */ ++lbolt; #if VAX780 /* * On 780's, impelement a fast UBA watcher, * to make sure uba's don't get stuck. */ if (cpu == VAX_780 && panicstr == 0 && !BASEPRI(ps)) unhang(); #endif /* * Schedule a software interrupt for the rest * of clock activities. */ setsoftclock(); } /* * The digital decay cpu usage priority assignment is scaled to run in * time as expanded by the 1 minute load average. Each second we * multiply the the previous cpu usage estimate by * nrscale*avenrun[0] * The following relates the load average to the period over which * cpu usage is 90% forgotten: * loadav 1 5 seconds * loadav 5 24 seconds * loadav 10 47 seconds * loadav 20 93 seconds * This is a great improvement on the previous algorithm which * decayed the priorities by a constant, and decayed away all knowledge * of previous activity in about 20 seconds. Under heavy load, * the previous algorithm degenerated to round-robin with poor response * time when there was a high load average. */ #undef ave #define ave(a,b) ((int)(((int)(a*b))/(b+1))) int nrscale = 2; double avenrun[]; /* * Constant for decay filter for cpu usage field * in process table (used by ps au). */ double ccpu = 0.95122942450071400909; /* exp(-1/20) */ /* * Software clock interrupt. * This routine runs at lower priority than device interrupts. */ /*ARGSUSED*/ softclock(pc, ps) caddr_t pc; { register struct callout *p1; register struct proc *pp; register int a, s; caddr_t arg; int (*func)(); /* * Perform callouts (but not after panic's!) */ if (panicstr == 0) { for (;;) { s = spl7(); if ((p1 = calltodo.c_next) == 0 || p1->c_time > 0) { splx(s); break; } calltodo.c_next = p1->c_next; arg = p1->c_arg; func = p1->c_func; p1->c_next = callfree; callfree = p1; (void) splx(s); (*func)(arg); } } /* * Drain silos. */ #if NDH > 0 s = spl5(); dhtimer(); splx(s); #endif #if NDZ > 0 s = spl5(); dztimer(); splx(s); #endif /* * If idling and processes are waiting to swap in, * check on them. */ if (noproc && runin) { runin = 0; wakeup((caddr_t)&runin); } /* * Run paging daemon every 1/4 sec. */ if (lbolt % (hz/4) == 0) { vmpago(); } /* * Reschedule every 1/10 sec. */ if (lbolt % (hz/10) == 0) { runrun++; aston(); } /* * Lightning bolt every second: * sleep timeouts * process priority recomputation * process %cpu averaging * virtual memory metering * kick swapper if processes want in */ if (lbolt >= hz) { /* * This doesn't mean much on VAX since we run at * software interrupt time... if hardclock() * calls softclock() directly, it prevents * this code from running when the priority * was raised when the clock interrupt occurred. */ if (BASEPRI(ps)) return; /* * If we didn't run a few times because of * long blockage at high ipl, we don't * really want to run this code several times, * so squish out all multiples of hz here. */ time += lbolt / hz; lbolt %= hz; /* * Wakeup lightning bolt sleepers. * Processes sleep on lbolt to wait * for short amounts of time (e.g. 1 second). */ wakeup((caddr_t)&lbolt); /* * Recompute process priority and process * sleep() system calls as well as internal * sleeps with timeouts (tsleep() kernel routine). */ for (pp = proc; pp < procNPROC; pp++) if (pp->p_stat && pp->p_stat!=SZOMB) { /* * Increase resident time, to max of 127 seconds * (it is kept in a character.) For * loaded processes this is time in core; for * swapped processes, this is time on drum. */ if (pp->p_time != 127) pp->p_time++; /* * If process has clock counting down, and it * expires, set it running (if this is a tsleep()), * or give it an SIGALRM (if the user process * is using alarm signals. */ if (pp->p_clktim && --pp->p_clktim == 0) if (pp->p_flag & STIMO) { s = spl6(); switch (pp->p_stat) { case SSLEEP: setrun(pp); break; case SSTOP: unsleep(pp); break; } pp->p_flag &= ~STIMO; splx(s); } else psignal(pp, SIGALRM); /* * If process is blocked, increment computed * time blocked. This is used in swap scheduling. */ if (pp->p_stat==SSLEEP || pp->p_stat==SSTOP) if (pp->p_slptime != 127) pp->p_slptime++; /* * Update digital filter estimation of process * cpu utilization for loaded processes. */ if (pp->p_flag&SLOAD(() pp->p_pctcpu = ccpu * pp->p_pctcpu + (1.0 - ccpu) * (pp->p_cpticks/(float)hz); /* * Recompute process priority. The number p_cpu * is a weighted estimate of cpu time consumed. * A process which consumes cpu time has this * increase regularly. We here decrease it by * a fraction based on load average giving a digital * decay filter which damps out in about 5 seconds * when seconds are measured in time expanded by the * load average. * * If a process is niced, then the nice directly * affects the new priority. The final priority * is in the range 0 to 255, to fit in a character. */ pp->p_cpticks = 0; a = ave((pp->p_cpu & 0377), avenrun[0]*nrscale) + pp->p_nice - NZERO; if (a < 0) a = 0; if (a > 255) a = 255; pp->p_cpu = a; (void) setpri(pp); /* * Now have computed new process priority * in p->p_usrpri. Carefully change p->p_pri. * A process is on a run queue associated with * this priority, so we must block out process * state changes during the transition. */ s = spl6(); if (pp->p_pri >= PUSER) { if ((pp != u.u_procp || noproc) && pp->p_stat == SRUN && (pp->p_flag & SLOAD) && pp->p_pri != pp->p_usrpri) { remrq(pp); pp->p_pri = pp->p_usrpri; setrq(pp); } else pp->p_pri = pp->p_usrpri; } splx(s); } /* * Perform virtual memory metering. */ vmmeter(); /* * If the swap process is trying to bring * a process in, have it look again to see * if it is possible now. */ if (runin!=0) { runin = 0; wakeup((caddr_t)&runin); } /* * If there are pages that have been cleaned, * jolt the pageout daemon to process them. * We do this here so that these pages will be * freed if there is an abundance of memory and the * daemon would not be awakened otherwise. */ if (bclnlist != NULL) wakeup((caddr_t)&proc[2]); /* * If the trap occurred from usermode, * then check to see if it has now been * running more than 10 minutes of user time * and should thus run with reduced priority * to give other processes a chance. */ if (USERMODE(ps)) { pp = u.u_procp; if (pp->p_uid && pp->p_nice == NZERO && u.u_vm.vm_utime > 600 * hz) pp->p_nice = NZERO+4; (void) setpri(pp); pp->p_pri = pp->p_usrpri; } } /* * If trapped user-mode, give it a profiling tick. */ if (USERMODE(ps) && u.u_prof.pr_scale) { u.u_procp->p_flag |= SOWEUPC; aston(); } } /* * Timeout is called to arrange that * fun(arg) is called in tim/hz seconds. * An entry is linked into the callout * structure. The time in each structure * entry is the number of hz's more * than the previous entry. * In this way, decrementing the * first entry has the effect of * updating all entries. * * The panic is there because there is nothing * intelligent to be done if an entry won't fit. */ timeout(fun, arg, tim) int (*fun)(); caddr_t arg; { register struct callout *p1, *p2, @ikY$)"%(+.147: F2i6i*pnew; register int t; int s; /* DEBUGGING CODE */ int ttrstrt(); if (fun == ttrstrt && arg == 0) panic("timeout ttrstr arg"); /* END DEBUGGING CODE */ t = tim; s = spl7(); pnew = callfree; if (pnew == NULL) panic("timeout table overflow"); callfree = pnew->c_next; pnew->c_arg = arg; pnew->c_func = fun; for (p1 = &calltodo; (p2 = p1->c_next) && p2->c_time < t; p1 = p2) t -= p2->c_time; p1->c_next = pnew; pnew->c_next = p2; pnew->c_time = t; if (p2) p2->c_time -= t; splx(s); } @ik#%\$E2iK6i /* calloc.c 4.2 81/04/28 */ #include "../h/param.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/vm.h" #include "../h/pte.h" #include "../h/cmap.h" extern cabase, calimit; extern struct pte camap[]; caddr_t cacur = (caddr_t)&cabase; caddr_t camax = (caddr_t)&cabase; int cax = 0; /* * This is a kernel-mode storage allocator. * It is very primitive, currently, in that * there is no way to give space back. * It serves, for the time being, the needs of * auto-configuration code and the like which * need to allocate some stuff at boot time. */ caddr_t calloc(size) int size; { register caddr_t res; register int i; if (cacur+size >= (caddr_t)&calimit) panic("calloc"); while (cacur+size > camax) { (void) vmemall(&camap[cax], CLSIZE, &proc[0], CSYS); vmaccess(&camap[cax], camax, CLSIZE); for (i = 0; i < CLSIZE; i++) clearseg(camap[cax++].pg_pfnum); camax += NBPG * CLSIZE; } res = cacur; cacur += size; return (res); } @ikD.m$E2i:6i s,81/04/15 4.9 asm.sed,81/04/15 4.9 asm.sed, s/calls $0,_spl0/mfpr $18,r0\ mtpr $0,$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,_bcopy/movc3 8(sp),*(sp),*4(sp)\ addl2 $12,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,_setjmp/movl (sp)+,r0 \ jsb _Setjmp/ s/calls $1,_longjmp/movl (sp)+,r0 \ jsb _Longjmp/ s/calls $1,_ffs/ffs $0,$32,(sp)+,r0 \ bneq 1f \ mnegl $1,r0 \ 1: \ incl r0/ ((@ikZ$l}$#  E2in 6i /* alloc.c 4.8 81/03/08 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/mount.h" #include "../h/filsys.h" #include "../h/fblk.h" #include "../h/conf.h" #include "../h/buf.h" #include "../h/inode.h" #include "../h/ino.h" #include "../h/dir.h" #include "../h/user.h" typedef struct fblk *FBLKP; /* * alloc will obtain the next available * free disk block from the free list of * the specified device. * The super block has up to NICFREE remembered * free blocks; the last of these is read to * obtain NICFREE more . . . */ struct buf * alloc(dev) dev_t dev; { daddr_t bno; register struct filsys *fp; register struct buf *bp; register int i; fp = getfs(dev); while (fp->s_flock) sleep((caddr_t)&fp->s_flock, PINOD); do { if (fp->s_nfree <= 0) goto nospace; if (fp->s_nfree > NICFREE) { fserr(fp, "bad free count"); goto nospace; } bno = fp->s_free[--fp->s_nfree]; if (bno == 0) goto nospace; } while (badblock(fp, bno)); if (fp->s_nfree <= 0) { fp->s_flock++; bp = bread(dev, bno); if ((bp->b_flags&B_ERROR) == 0) { fp->s_nfree = ((FBLKP)(bp->b_un.b_addr))->df_nfree; bcopy((caddr_t)((FBLKP)(bp->b_un.b_addr))->df_free, (caddr_t)fp->s_free, sizeof(fp->s_free)); } brelse(bp); fp->s_flock = 0; wakeup((caddr_t)&fp->s_flock); if (fp->s_nfree <= 0) goto nospace; } bp = getblk(dev, bno); clrbuf(bp); fp->s_fmod = 1; fp->s_tfree--; return (bp); nospace: fp->s_nfree = 0; fp->s_tfree = 0; fserr(fp, "file system full"); /* THIS IS A KLUDGE... */ /* SHOULD RATHER SEND A SIGNAL AND SUSPEND THE PROCESS IN A */ /* STATE FROM WHICH THE SYSTEM CALL WILL RESTART */ uprintf("\n%s: write failed, file system is full\n", fp->s_fsmnt); for (i = 0; i < 5; i++) sleep((caddr_t)&lbolt, PRIBIO); /* END KLUDGE */ u.u_error = ENOSPC; return (NULL); } /* * place the specified disk block * back on the free list of the * specified device. */ free(dev, bno) dev_t dev; daddr_t bno; { register struct filsys *fp; register struct buf *bp; fp = getfs(dev); fp->s_fmod = 1; while (fp->s_flock) sleep((caddr_t)&fp->s_flock, PINOD); if (badblock(fp, bno)) return; if (fp->s_nfree <= 0) { fp->s_nfree = 1; fp->s_free[0] = 0; } if (fp->s_nfree >= NICFREE) { fp->s_flock++; bp = getblk(dev, bno); ((FBLKP)(bp->b_un.b_addr))->df_nfree = fp->s_nfree; bcopy((caddr_t)fp->s_free, (caddr_t)((FBLKP)(bp->b_un.b_addr))->df_free, sizeof(fp->s_free)); fp->s_nfree = 0; bwrite(bp); fp->s_flock = 0; wakeup((caddr_t)&fp->s_flock); } fp->s_free[fp->s_nfree++] = bno; fp->s_tfree++; fp->s_fmod = 1; } /* * Check that a block number is in the * range between the I list and the size * of the device. * This is used mainly to check that a * garbage file system has not been mounted. */ badblock(fp, bn) register struct filsys *fp; daddr_t bn; { if (bn < fp->s_isize || bn >= fp->s_fsize) { fserr(fp, "bad block"); return(1); } return(0); } /* * Allocate an unused inode on the specified device. * Used with file creation. The algorithm keeps up to * NICINOD spare inodes in the super block. When this runs out, * the inodes are searched to pick up more. We keep searching * foreward on the device, remembering the number of inodes * which are freed behind our search point for which there is no * room in the in-core table. When this number passes a threshold * (or if we search to the end of the ilist without finding any inodes) * we restart the search from the beginning. */ struct inode * ialloc(dev) dev_t dev; { register struct filsys *fp; register struct buf *bp; register struct inode *ip; int i; struct dinode *dp; ino_t ino, inobas; int first; daddr_t adr; fp = getfs(dev); while (fp->s_ilock) sleep((caddr_t)&fp->s_ilock, PINOD); loop: if (fp->s_ninode > 0) { ino = fp->s_inode[--fp->s_ninode]; ip = iget(dev, ino); if (ip == NULL) return(NULL); if (ip->i_mode == 0) { for (i=0; ii_un.i_addr[i] = 0; fp->s_fmod = 1; fp->s_tinode--; return(ip); } /* * Inode was allocated after all. * Look some more. */ iput(ip); goto loop; } fp->s_ilock++; /* * If less than 4*NICINOD inodes are known * to be free behind the current search point, * then search forward; else search from beginning. */ if (fp->s_nbehind < 4 * NICINOD) { first = 1; ino = fp->s_lasti; if (itoo(ino)) panic("ialloc"); adr = itod(ino); } else { fromtop: first = 0; ino = 1; adr = SUPERB+1; fp->s_nbehind = 0; } /* * This is the search for free inodes. */ for(; adr < fp->s_isize; adr++) { inobas = ino; bp = bread(dev, adr); if ((bp->b_flags&B_CACHE) == 0) u.u_vm.vm_inblk--; /* no charge! */ if (bp->b_flags & B_ERROR) { brelse(bp); ino += INOPB; continue; } dp = bp->b_un.b_dino; for (i=0; idi_mode != 0 || ifind(dev, ino)) goto cont; fp->s_inode[fp->s_ninode++] = ino; if (fp->s_ninode >= NICINOD) break; cont: ino++; dp++; } brelse(bp); if (fp->s_ninode >= NICINOD) break; } /* * If the search didn't net a full superblock of inodes, * then try it again from the beginning of the ilist. */ if (fp->s_ninode < NICINOD && first) goto fromtop; fp->s_lasti = inobas; fp->s_ilock = 0; wakeup((caddr_t)&fp->s_ilock); if (fp->s_ninode > 0) goto loop; fserr(fp, "out of inodes"); uprintf("\n%s: create failed, no inodes free\n", fp->s_fsmnt); u.u_error = ENOSPC; return (NULL); } /* * Free the specified inode on the specified device. * The algorithm stores up to NICINOD inodes in the super * block and throws away any more. It keeps track of the * number of inodes thrown away which preceded the current * search point in the file system. This lets us rescan * for more inodes from the beginning only when there * are a reasonable number of inodes back there to reallocate. */ ifree(dev, ino) dev_t dev; ino_t ino; { register struct filsys *fp; fp = getfs(dev); fp->s_tinode++; if (fp->s_ilock) return; if (fp->s_ninode >= NICINOD) { if (fp->s_lasti > ino) fp->s_nbehind++; return; } fp->s_inode[fp->s_ninode++] = ino; fp->s_fmod = 1; } /* * getfs maps a device number into * a pointer to the incore super * block. The algorithm is a linear * search through the mount table. * A consistency check of the * in core free-block and i-node * counts is performed. * * panic: no fs -- the device is not mounted. * this "cannot happen" */ struct filsys * getfs(dev) dev_t dev; { register struct mount *mp; register struct filsys *fp; for (mp = &mount[0]; mp < &mount[NMOUNT]; mp++) if (mp->m_bufp != NULL && mp->m_dev == dev) { fp = mp->m_bufp->b_un.b_filsys; if (fp->s_nfree > NICFREE || fp->s_ninode > NICINOD) { fserr(fp, "bad count"); fp->s_nfree = 0; fp->s_ninode = 0; } return(fp); } panic("no fs"); return (NULL); } /* * Fserr prints the name of a file system * with an error diagnostic, in the form * filsys: error message */ fserr(fp, cp) struct filsys *fp; char *cp; { printf("%s: %s\n", fp->s_fsmnt, cp); } /* * Getfsx returns the index in the file system * table of the specified device. The swap device * is also assigned a pseudo-index. The index may * be used as a compressed indication of the location * of a block, recording * * rather than * * provided the information need remain valid only * as long as the file system is mounted. */ getfsx(dev) dev_t dev; { register struct mount *mp; if (dev == swapdev) return (MSWAPX); for(mp = &mount[0]; mp < &mount[NMOUNT]; mp++) if (mp->m_dev == dev) return (mp - &mount[0]); return (-1); } /* * Update is the internal name of 'sync'. It goes through the disk * queues to initiate sandbagged IO; goes through the inodes to write * modified nodes; and it goes through the mount table to initiate modified * super blocks. */ update() { register struct inode *ip; register struct mount *mp; register struct buf *bp; struct filsys *fp; if (updlock) return; updlock++; /* * Write back modified superblocks. * Consistency check that the superblock * of each file system is still in the buffer cache. */ for (mp = &mount[0]; mp < &mount[NMOUNT]; mp++) if (mp->m_bufp != NULL) { fp = mp->m_bufp->b_un.b_filsys; if (fp->s_fmod==0 || fp->s_ilock!=0 || fp->s_flock!=0 || fp->s_ronly!=0) continue; bp = getblk(mp->m_dev, SUPERB); fp->s_fmod = 0; fp->s_time = time; if (bp->b_un.b_filsys != fp) panic("update"); bwrite(bp); } /* * Write back each (modified) inode. */ for (ip = inode; ip < inodeNINODE; ip++) if((ip->i_flag&ILOCK)==0 && ip->i_count) { ip->i_flag |= ILOCK; ip->i_count++; iupdat(ip, &time, &time, 0); iput(ip); } updlock = 0; /* * Force stale buffer cache information to be flushed, * for all devices. */ bflush(NODEV); } ((@ikr$E2ik 6i /* acct.c 4.4 81/03/08 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/acct.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/inode.h" #include "../h/proc.h" #include "../h/seg.h" struct inode *acctp; /* * Perform process accounting functions. */ sysacct() { register struct inode *ip; register struct a { char *fname; } *uap; uap = (struct a *)u.u_ap; if (suser()) { if (uap->fname==NULL) { if (ip = acctp) { plock(ip); iput(ip); acctp = NULL; } return; } if (acctp) { u.u_error = EBUSY; return; } ip = namei(uchar, 0); if(ip == NULL) return; if((ip->i_mode & IFMT) != IFREG) { u.u_error = EACCES; iput(ip); return; } acctp = ip; prele(ip); } } struct acct acctbuf; /* * On exit, write a record on the accounting file. */ acct() { register i; register struct inode *ip; off_t siz; register struct acct *ap = &acctbuf; if ((ip=acctp)==NULL) return; plock(ip); for (i=0; iac_comm); i++) ap->ac_comm[i] = u.u_comm[i]; ap->ac_utime = compress((long)u.u_vm.vm_utime); ap->ac_stime = compress((long)u.u_vm.vm_stime); ap->ac_etime = compress((long)(time - u.u_start)); ap->ac_btime = u.u_start; ap->ac_uid = u.u_ruid; ap->ac_gid = u.u_rgid; ap->ac_mem = 0; if (i = u.u_vm.vm_utime + u.u_vm.vm_stime) ap->ac_mem = (u.u_vm.vm_ixrss + u.u_vm.vm_idsrss) / i; ap->ac_io = compress((long)(u.u_vm.vm_inblk + u.u_vm.vm_oublk)); ap->ac_tty = u.u_ttyd; ap->ac_flag = u.u_acflag; siz = ip->i_size; u.u_offset = siz; u.u_base = (caddr_t)ap; u.u_count = sizeof(acctbuf); u.u_segflg = 1; u.u_error = 0; writei(ip); if(u.u_error) ip->i_size = siz; prele(ip); } /* * Produce a pseudo-floating point representation * with 3 bits base-8 exponent, 13 bits fraction. */ compress(t) register long t; { register exp = 0, round = 0; while (t >= 8192) { exp++; round = t&04; t >>= 3; } if (round) { t++; if (t >= 8192) { t >>= 3; exp++; } } return((exp<<13) + t); } @ik[$ E2i]6i /* Locore.c 4.12 81/08/29 */ #include "dz.h" #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/pte.h" #include "../h/vm.h" #include "../h/tty.h" #include "../h/proc.h" #include "../h/buf.h" #include "../h/ubavar.h" #include "../h/ubareg.h" #include "../h/nexus.h" #include "../h/msgbuf.h" /* * Pseudo file for lint to show what is used/defined in locore.s. */ struct scb scb; int (*UNIvec[128])(); struct rpb rpb; int intstack[3*128]; int masterpaddr; /* p_addr of current process on master cpu */ struct user u; doadump() { dumpsys(); } Xmba3int() { } Xmba2int() { } Xmba1int() { } Xmba0int() { } lowinit() { /* * Pseudo-uses of globals. */ lowinit(); intstack[0] = intstack[1]; rpb = rpb; scb = scb; maxmem = physmem = freemem = 0; u = u; fixctlrmask(); main(0); /* * Routines called from interrupt vectors. */ panic("Machine check"); printf("Write timeout"); (*UNIvec[0])(); ubaerror(0, (struct uba_hd *)0, 0, 0, (struct uba_regs *)0); cnrint(0); cnxint(0); consdin(); consdout(); #if NDZ > 0 dzdma(); #endif hardclock((caddr_t)0, 0); softclock((caddr_t)0, 0); trap(0, 0, (unsigned)0, 0, 0); syscall(0, 0, (unsigned)0, 0, 0); if (vmemall((struct pte *)0, 0, (struct proc *)0, 0)) return; /* use value */ if (forceclose((dev_t)0)) return; /* use value */ machinecheck((caddr_t)0); memerr(); boothowto = 0; } consdin() { } consdout() { } #if NDZ > 0 dzdma() { dzxint((struct tty *)0); } #endif int catcher[256]; int cold = 1; Xustray() { } struct pte Sysmap[6*NPTEPG]; char Sysbase[6*NPTEPG*NBPG]; int umbabeg; struct pte Nexmap[16][16]; struct nexus nexus[MAXNNEXUS]; struct pte UMEMmap[4][16]; char umem[4][16*NBPG]; int umbaend; struct pte Usrptmap[USRPTSIZE]; struct pte usrpt[USRPTSIZE*NPTEPG]; struct pte Forkmap[UPAGES]; struct user forkutl; struct pte Xswapmap[UPAGES]; struct user xswaputl; struct pte Xswap2map[UPAGES]; struct user xswap2utl; struct pte Swapmap[UPAGES]; struct user swaputl; struct pte Pushmap[UPAGES]; struct user pushutl; struct pte Vfmap[UPAGES]; struct user vfutl; struct pte CMAP1; char CADDR1[NBPG]; struct pte CMAP2; char CADDR2[NBPG]; struct pte mmap[1]; char vmmap[NBPG]; struct pte msgbufmap[CLSIZE]; struct msgbuf msgbuf; struct pte camap[32]; int cabase; #ifdef unneeded char caspace[32*NBPG]; #endif int calimit; /*ARGSUSED*/ badaddr(addr, len) caddr_t addr; int len; { return (0); } /*ARGSUSED*/ addupc(pc, prof, n) int pc; struct uprof *prof; { } /*ARGSUSED*/ copyin(udaddr, kaddr, n) caddr_t udaddr, kaddr; unsigned n; { return (0); } /*ARGSUSED*/ copyout(kaddr, udaddr, n) caddr_t kaddr, udaddr; unsigned n; { return (0); } /*ARGSUSED*/ setjmp(lp) label_t lp; { return (0); } /*ARGSUSED*/ longjmp(lp) label_t lp; { /*NOTREACHED*/ } /*ARGSUSED*/ setrq(p) struct proc *p; { } /*ARGSUSED*/ remrq(p) struct proc *p; { } swtch() { if (whichqs) whichqs = 0; } /*ARGSUSED*/ resume(pcbpf) unsigned pcbpf; { } /*ARGSUSED*/ fubyte(base) caddr_t base; { return (0); } /*ARGSUSED*/ subyte(base, i) caddr_t base; { return (0); } /*ARGSUSED*/ suibyte(base, i) caddr_t base; { return (0); } /*ARGSUSED*/ fuword(base) caddr_t base; { return (0); } /*ARGSUSED*/ fuiword(base) caddr_t base; { return (0); } /*ARGSUSED*/ suword(base, i) caddr_t base; { return (0); } /*ARGSUSED*/ suiword(base, i) caddr_t base; { return (0); } /*ARGSUSED*/ copyseg(udaddr, pf) caddr_t udaddr; unsigned pf; { CMAP1 = CMAP1; CADDR1[0] = CADDR1[0]; } /*ARGSUSED*/ clearseg(pf) unsigned pf; { CMAP2 = CMAP2; CADDR2[0] = CADDR2[0]; } /*ARGSUSED*/ useracc(udaddr, bcnt, rw) caddr_t udaddr; unsigned bcnt; { return (0); } /*ARGSUSED*/ kernacc(addr, bcnt, rw) caddr_t addr; unsigned bcnt; { return (0); } /*VARARGS1*/ /*ARGSUSED*/ mtpr(reg, value) int reg, value; { } /*ARGSUSED*/ mfpr(reg) int reg; { return (0); } spl0() { return (0); } spl4() { return (0); } spl5() { return (0); } spl6() { return (0); } spl7() { return (0); } /*ARGSUSED*/ splx(s) int s; { } /*ARGSUSED*/ bcopy(from, to, count) caddr_t from, to; unsigned count; { ; } /*ARGSUSED*/ ffs(i) { return (0); } @ik%$7ND2i^^ ((/* locore.s 4.55- 82/02/17 */ #include "../h/mtpr.h" #include "../h/trap.h" #include "../h/psl.h" #include "../h/pte.h" #include "../h/cpu.h" #include "../h/nexus.h" #include "../h/ubareg.h" #include "dz.h" #include "mba.h" .set HIGH,0x1f # mask for total disable .set MCKVEC,4 # offset into scb of machine check vector .set NBPG,512 .set PGSHIFT,9 .set NISP,3 # number of interrupt stack pages /* * User structure is UPAGES at top of user space. */ .globl _u .set _u,0x80000000 - UPAGES*NBPG /* * Restart parameter block * This is filled in in machdep.c in startup(). * It MUST be page aligned. * When auto-restart occurs, we run restart() in machdep.c, which * takes a core-dump and then cold-starts. */ .globl _rpb _rpb: .space 508 erpb: .space 4 .globl _intstack _intstack: .space NISP*NBPG eintstack: /* * Do a dump. * Called by auto-restart. * May be called manually. */ .align 2 .globl _doadump _doadump: nop; nop # .word 0x0101 #define _rpbmap _Sysmap+8 # scb, UNIvec, rpb, istack*4 bicl2 $PG_PROT,_rpbmap bisl2 $PG_KW,_rpbmap tstl _rpb+RP_FLAG # dump only once! bneq 1f incl _rpb+RP_FLAG mtpr $0,$TBIA movl sp,erpb movab erpb,sp mfpr $PCBB,-(sp) mfpr $MAPEN,-(sp) mfpr $IPL,-(sp) mtpr $0,$MAPEN mtpr $HIGH,$IPL pushr $0x3fff calls $0,_dumpsys 1: halt /* * Interrupt vector routines */ .globl _waittime #define SCBVEC(name) .align 2; .globl _X/**/name; _X/**/name #define PANIC(msg) clrl _waittime; pushab 1f; \ calls $1,_panic; 1: .asciz msg #define PRINTF(n,msg) pushab 1f; calls $n+1,_printf; MSG(msg) #define MSG(msg) .data; 1: .asciz msg; .text #define PUSHR pushr $0x3f #define POPR popr $0x3f SCBVEC(machcheck): PUSHR; pushab 6*4(sp); calls $1,_machinecheck; POPR; addl2 (sp)+,sp; rei SCBVEC(kspnotval): PUSHR; PANIC("KSP not valid"); SCBVEC(powfail): halt SCBVEC(chme): SCBVEC(chms): SCBVEC(chmu): PUSHR; PANIC("CHM? in kernel"); SCBVEC(stray): PUSHR; PRINTF(0, "stray scb interrupt\n"); POPR; rei SCBVEC(nexzvec): PUSHR; mfpr $IPL,-(sp); PRINTF(1, "nexus stray intr ipl%x\n"); POPR; rei SCBVEC(cmrd): PUSHR; calls $0,_memerr; POPR; rei SCBVEC(wtime): PUSHR; pushl 6*4(sp); PRINTF(1,"write timeout %x\n"); POPR; PANIC("wtimo"); #if NMBA > 0 SCBVEC(mba3int): PUSHR; pushl $3; brb 1f SCBVEC(mba2int): PUSHR; pushl $2; brb 1f SCBVEC(mba1int): PUSHR; pushl $1; brb 1f SCBVEC(mba0int): PUSHR; pushl $0 1: calls $1,_mbintr POPR incl _cnt+V_INTR rei #endif #if VAX780 /* * Registers for the uba handling code */ #define rUBANUM r0 #define rUBAHD r1 #define rUVEC r3 #define rUBA r4 /* r2,r5 are scratch */ SCBVEC(ua3int): PUSHR; movl $3,rUBANUM; moval _uba_hd+(3*UH_SIZE),rUBAHD; brb 1f SCBVEC(ua2int): PUSHR; movl $2,rUBANUM; moval _uba_hd+(2*UH_SIZE),rUBAHD; brb 1f SCBVEC(ua1int): PUSHR; movl $1,rUBANUM; moval _uba_hd+(1*UH_SIZE),rUBAHD; brb 1f SCBVEC(ua0int): PUSHR; movl $0,rUBANUM; moval _uba_hd+(0*UH_SIZE),rUBAHD; 1: incl _cnt+V_INTR mfpr $IPL,r2 /* r2 = mfpr(IPL); */ movl UH_UBA(rUBAHD),rUBA /* uba = uhp->uh_uba; */ movl UBA_BRRVR-0x14*4(rUBA)[r2],rUVEC /* uvec = uba->uba_brrvr[r2-0x14] */ ubanorm: bleq ubaerror addl2 UH_VEC(rUBAHD),rUVEC /* uvec += uh->uh_vec */ bicl3 $3,(rUVEC),r1 jmp 2(r1) /* 2 skips ``pushr $0x3f'' */ ubaerror: PUSHR; calls $0,_ubaerror; POPR /* ubaerror r/w's r0-r5 */ tstl rUVEC; jneq ubanorm /* rUVEC contains result */ POPR rei #endif SCBVEC(cnrint): PUSHR; calls $0,_cnrint; POPR; incl _cnt+V_INTR; rei SCBVEC(cnxint): PUSHR; calls $0,_cnxint; POPR; incl _cnt+V_INTR; rei SCBVEC(hardclock): PUSHR pushl 4+6*4(sp); pushl 4+6*4(sp); calls $2,_hardclock # hardclock(pc,psl) POPR; incl _cnt+V_INTR ## temp so not to break vmstat -= HZ rei SCBVEC(softclock): PUSHR pushl 4+6*4(sp); pushl 4+6*4(sp); calls $2,_softclock # softclock(pc,psl) POPR; rei #if defined(VAX750) || defined(VAX7ZZ) SCBVEC(consdin): PUSHR; calls $0,_turintr; POPR; incl _cnt+V_INTR; rei SCBVEC(consdout): PUSHR; calls $0,_tuxintr; POPR; incl _cnt+V_INTR; rei #else SCBVEC(consdin): halt SCBVEC(consdout): halt #endif #if NDZ > 0 /* * DZ pseudo dma routine: * r0 - controller number */ .align 1 .globl _dzdma _dzdma: mull2 $8*20,r0 movab _dzpdma(r0),r3 # pdma structure base # for this controller dzploop: movl r3,r0 movl (r0)+,r1 # device register address movzbl 1(r1),r2 # get line number bitb $0x80,r2 # TRDY on? beql dzprei # no bicb2 $0xf8,r2 # clear garbage bits mull2 $20,r2 addl2 r2,r0 # point at line's pdma structure movl (r0)+,r2 # p_mem cmpl r2,(r0)+ # p_mem < p_end ? bgequ dzpcall # no, go call dzxint movb (r2)+,6(r1) # dztbuf = *p_mem++ movl r2,-8(r0) brb dzploop # check for another line dzprei: POPR incl _cnt+V_PDMA rei dzpcall: pushl r3 pushl (r0)+ # push tty address calls $1,*(r0) # call interrupt rtn movl (sp)+,r3 brb dzploop # check for another line #endif /* * Stray UNIBUS interrupt catch routines */ .data .align 2 #define PJ PUSHR;jsb _Xustray .globl _catcher _catcher: PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ .globl _cold _cold: .long 1 .data .text SCBVEC(ustray): blbc _cold,1f mfpr $IPL,r11 subl3 $_catcher+8,(sp)+,r10 ashl $-1,r10,r10 POPR rei 1: subl3 $_catcher+8,(sp)+,r0 ashl $-1,r0,-(sp) mfpr $IPL,-(sp) PRINTF(2, "uba?: stray intr ipl %x vec %o\n") POPR rei /* * Trap and fault vector routines */ #define TRAP(a) pushl $a; brw alltraps /* * Ast delivery (profiling and/or reschedule) */ SCBVEC(astflt): pushl $0; TRAP(ASTFLT) SCBVEC(privinflt): pushl $0; TRAP(PRIVINFLT) SCBVEC(xfcflt): pushl $0; TRAP(XFCFLT) SCBVEC(resopflt): pushl $0; TRAP(RESOPFLT) SCBVEC(resadflt): pushl $0; TRAP(RESADFLT) SCBVEC(bptflt): pushl $0; TRAP(BPTFLT) SCBVEC(compatflt): TRAP(COMPATFLT); SCBVEC(tracep): pushl $0; TRAP(TRCTRAP) SCBVEC(arithtrap): TRAP(ARITHTRAP) SCBVEC(protflt): blbs (sp)+,segflt TRAP(PROTFLT) segflt: TRAP(SEGFLT) SCBVEC(transflt): bitl $1,(sp)+ bnequ tableflt TRAP(PAGEFLT) tableflt: TRAP(TABLEFLT) alltraps: mfpr $USP,-(sp); calls $0,_trap; mtpr (sp)+,$USP incl _cnt+V_TRAP addl2 $8,sp # pop type, code mtpr $HIGH,$IPL ## dont go to a higher IPL (GROT) rei SCBVEC(syscall): pushl $SYSCALL mfpr $USP,-(sp); calls $0,_syscall; mtpr (sp)+,$USP incl _cnt+V_SYSCALL addl2 $8,sp # pop type, code mtpr $HIGH,$IPL ## dont go to a higher IPL (GROT) rei /* * System page table */ #define vaddr(x) ((((x)-_Sysmap)/4)*NBPG+0x80000000) #define SYSMAP(mname, vname, npte) \ _/**/mname: .globl _/**/mname; \ .space npte*4; \ .globl _/**/vname; \ .set _/**/vname,vaddr(_/**/mname) .data .align 2 SYSMAP(Sysmap ,Sysbase ,SYSPTSIZE ) SYSMAP(UMBAbeg ,umbabeg ,0 ) SYSMAP(Nexmap ,nexus ,16*MAXNNEXUS ) SYSMAP(UMEMmap ,umem ,16*MAXNUBA ) SYSMAP(UMBAend ,umbaend ,0 ) SYSMAP(Usrptmap ,usrpt ,USRPTSIZE ) SYSMAP(Forkmap ,forkutl ,UPAGES ) SYSMAP(Xswapmap ,xswaputl ,UPAGES ) SYSMAP(Xswap2map,xswap2utl ,UPAGES ) SYSMAP(Swapmap ,swaputl ,UPAGES ) SYSMAP(Pushmap ,pushutl ,UPAGES ) SYSMAP(Vfmap ,vfutl ,UPAGES ) SYSMAP(CMAP1 ,CADDR1 ,1 ) SYSMAP(CMAP2 ,CADDR2 ,1 ) SYSMAP(mcrmap ,mcr ,1 ) SYSMAP(mmap ,vmmap ,1 ) SYSMAP(msgbufmap,msgbuf ,CLSIZE ) SYSMAP(camap ,cabase ,16*CLSIZE ) SYSMAP(ecamap ,calimit ,0 ) #ifdef BBNNET SYSMAP(Netmap ,netutl ,NNETPAGES*CLSIZE) #endif eSysmap: .globl _Syssize .set _Syssize,(eSysmap-_Sysmap)/4 .text /* * Initialization * * ipl 0x1f; mapen 0; scbb, pcbb, sbr, slr, isp, ksp not set */ .data .globl _cpu _cpu: .long 0 .text .globl start start: .word 0 /* set system control block base and system page table params */ mtpr $_scb-0x80000000,$SCBB mtpr $_Sysmap-0x80000000,$SBR mtpr $_Syssize,$SLR /* double map the kernel into the virtual user addresses of phys mem */ mtpr $_Sysmap,$P0BR mtpr $_Syssize,$P0LR /* set ISP and get cpu type */ movl $_intstack+NISP*NBPG,sp mfpr $SID,r0 movab _cpu,r1 extzv $24,$8,r0,(r1) /* init RPB */ movab _rpb,r0 movl r0,(r0)+ # rp_selfref movab _doadump,r1 movl r1,(r0)+ # rp_dumprout movl $0x1f,r2 clrl r3 1: addl2 (r1)+,r3; sobgtr r2,1b movl r3,(r0)+ # rp_chksum /* count up memory */ clrl r7 1: pushl $4; pushl r7; calls $2,_badaddr; tstl r0; bneq 9f acbl $8096*1024-1,$64*1024,r7,1b 9: /* clear memory from kernel bss and pages for proc 0 u. and page table */ movab _edata,r6 movab _end,r5 bbcc $31,r5,0f; 0: addl2 $(UPAGES*NBPG)+NBPG+NBPG,r5 1: clrq (r6); acbl r5,$8,r6,1b /* trap() and syscall() save r0-r11 in the entry mask (per ../h/reg.h) */ bisw2 $0x0fff,_trap bisw2 $0x0fff,_syscall calls $0,_fixctlrmask /* initialize system page table: scb and int stack writeable */ clrl r2 movab eintstack,r1; bbcc $31,r1,0f; 0: ashl $-PGSHIFT,r1,r1 1: bisl3 $PG_V|PG_KW,r2,_Sysmap[r2]; aoblss r1,r2,1b /* make rpb read-only as red zone for interrupt stack */ bicl2 $PG_PROT,_rpbmap bisl2 $PG_KR,_rpbmap /* make kernel text space read-only */ movab _etext+NBPG-1,r1; bbcc $31,r1,0f; 0: ashl $-PGSHIFT,r1,r1 1: bisl3 $PG_V|PG_KR,r2,_Sysmap[r2]; aoblss r1,r2,1b /* make kernel data, bss, read-write */ movab _end+NBPG-1,r1; bbcc $31,r1,0f; 0:; ashl $-PGSHIFT,r1,r1 1: bisl3 $PG_V|PG_KW,r2,_Sysmap[r2]; aoblss r1,r2,1b /* now go to mapped mode */ mtpr $1,$TBIA; mtpr $1,$MAPEN; jmp *$0f; 0: /* init mem sizes */ ashl $-PGSHIFT,r7,_maxmem movl _maxmem,_physmem movl _maxmem,_freemem /* setup context for proc[0] == Scheduler */ movab _end+NBPG-1,r6 bicl2 $NBPG-1,r6 # make page boundary /* setup page table for proc[0] */ bbcc $31,r6,0f; 0: ashl $-PGSHIFT,r6,r3 # r3 = btoc(r6) bisl3 $PG_V|PG_KW,r3,_Usrptmap # init first upt entry incl r3 movab _usrpt,r0 mtpr r0,$TBIS /* init p0br, p0lr */ mtpr r0,$P0BR mtpr $0,$P0LR /* init p1br, p1lr */ movab NBPG(r0),r0 movl $0x200000-UPAGES,r1 mtpr r1,$P1LR mnegl r1,r1 moval -4*UPAGES(r0)[r1],r2 mtpr r2,$P1BR /* setup mapping for UPAG((@ik%$7ND2i^^ES of _u */ movl $UPAGES,r2; movab _u+NBPG*UPAGES,r1; addl2 $UPAGES,r3; jbr 2f 1: decl r3 moval -NBPG(r1),r1; bisl3 $PG_V|PG_URKW,r3,-(r0) mtpr r1,$TBIS 2: sobgeq r2,1b /* initialize (slightly) the pcb */ movab UPAGES*NBPG(r1),PCB_KSP(r1) mnegl $1,PCB_ESP(r1) mnegl $1,PCB_SSP(r1) movl r1,PCB_USP(r1) mfpr $P0BR,PCB_P0BR(r1) mfpr $P0LR,PCB_P0LR(r1) movb $4,PCB_P0LR+3(r1) # disable ast mfpr $P1BR,PCB_P1BR(r1) mfpr $P1LR,PCB_P1LR(r1) movl $CLSIZE,PCB_SZPT(r1) # init u.u_pcb.pcb_szpt movl r11,PCB_R11(r1) movab 1f,PCB_PC(r1) # initial pc clrl PCB_PSL(r1) # mode(k,k), ipl=0 ashl $PGSHIFT,r3,r3 mtpr r3,$PCBB # first pcbb /* set regs, p0br, p0lr, p1br, p1lr, astlvl, ksp and change to kernel mode */ ldpctx rei /* put signal trampoline code in u. area */ 1: movab _u,r0 movc3 $12,sigcode,PCB_SIGC(r0) /* save reboot flags in global _boothowto */ movl r11,_boothowto /* calculate firstaddr, and call main() */ movab _end+NBPG-1,r0; bbcc $31,r0,0f; 0:; ashl $-PGSHIFT,r0,-(sp) addl2 $UPAGES+1,(sp); calls $1,_main /* proc[1] == /etc/init now running here; run icode */ pushl $PSL_CURMOD|PSL_PRVMOD; pushl $0; rei /* signal trampoline code: it is known that this code takes exactly 12 bytes */ /* in ../h/pcb.h and in the movc3 above */ sigcode: calls $3,1(pc) rei .word 0x7f # registers 0-6 (6==sp/compat) callg (ap),*12(ap) ret /* * Primitives */ /* * badaddr(addr, len) * see if access addr with a len type instruction causes a machine check * len is length of access (1=byte, 2=short, 4=long) */ .globl _badaddr _badaddr: .word 0 movl $1,r0 mfpr $IPL,r1 mtpr $HIGH,$IPL movl _scb+MCKVEC,r2 movl 4(ap),r3 movl 8(ap),r4 movab 9f+INTSTK,_scb+MCKVEC bbc $0,r4,1f; tstb (r3) 1: bbc $1,r4,1f; tstw (r3) 1: bbc $2,r4,1f; tstl (r3) 1: clrl r0 # made it w/o machine checks 2: movl r2,_scb+MCKVEC mtpr r1,$IPL ret .align 2 9: casel _cpu,$1,$VAX_MAX 0: .word 8f-0b # 1 is 780 .word 5f-0b # 2 is 750 .word 5f-0b # 3 is 7ZZ 5: #if defined(VAX750) || defined(VAX7ZZ) mtpr $0xf,$MCESR #endif brb 1f 8: #if VAX780 mtpr $0,$SBIFS #endif 1: addl2 (sp)+,sp # discard mchchk trash movab 2b,(sp) rei _addupc: .globl _addupc .word 0x0 movl 8(ap),r2 # &u.u_prof subl3 8(r2),4(ap),r0 # corrected pc blss 9f extzv $1,$31,r0,r0 # logical right shift extzv $1,$31,12(r2),r1 # ditto for scale emul r1,r0,$0,r0 ashq $-14,r0,r0 tstl r1 bneq 9f incl r0 bicl2 $1,r0 cmpl r0,4(r2) # length bgequ 9f addl2 (r2),r0 # base probew $3,$2,(r0) beql 8f addw2 12(ap),(r0) 9: ret 8: clrl 12(r2) ret _Copyin: .globl _Copyin # <<>> movl 12(sp),r0 # copy length blss ersb movl 4(sp),r1 # copy user address cmpl $NBPG,r0 # probing one page or less ? bgeq cishort # yes ciloop: prober $3,$NBPG,(r1) # bytes accessible ? beql ersb # no addl2 $NBPG,r1 # incr user address ptr acbl $NBPG+1,$-NBPG,r0,ciloop # reduce count and loop cishort: prober $3,r0,(r1) # bytes accessible ? beql ersb # no movc3 12(sp),*4(sp),*8(sp) clrl r0 rsb ersb: mnegl $1,r0 rsb _Copyout: .globl _Copyout # <<>> movl 12(sp),r0 # get count blss ersb movl 8(sp),r1 # get user address cmpl $NBPG,r0 # can do in one probew? bgeq coshort # yes coloop: probew $3,$NBPG,(r1) # bytes accessible? beql ersb # no addl2 $NBPG,r1 # increment user address acbl $NBPG+1,$-NBPG,r0,coloop # reduce count and loop coshort: probew $3,r0,(r1) # bytes accessible? beql ersb # no movc3 12(sp),*4(sp),*8(sp) clrl r0 rsb /* * non-local goto's */ .globl _Setjmp _Setjmp: movq r6,(r0)+ movq r8,(r0)+ movq r10,(r0)+ movq r12,(r0)+ addl3 $4,sp,(r0)+ movl (sp),(r0) clrl r0 rsb .globl _Longjmp _Longjmp: movq (r0)+,r6 movq (r0)+,r8 movq (r0)+,r10 movq (r0)+,r12 movl (r0)+,r1 cmpl r1,sp # must be a pop bgequ lj2 pushab lj1 calls $1,_panic lj2: movl r1,sp jmp *(r0) # ``rsb'' lj1: .asciz "longjmp" .globl _whichqs .globl _qs .globl _cnt .globl _noproc .comm _noproc,4 .globl _runrun .comm _runrun,4 /* * The following primitives use the fancy VAX instructions * much like VMS does. _whichqs tells which of the 32 queues _qs * have processes in them. Setrq puts processes into queues, Remrq * removes them from queues. The running process is on no queue, * other processes are on a queue related to p->p_pri, divided by 4 * actually to shrink the 0-127 range of priorities into the 32 available * queues. */ /* * Setrq(p), using fancy VAX instructions. * * Call should be made at spl6(), and p->p_stat should be SRUN */ .globl _Setrq # <<>> _Setrq: tstl P_RLINK(r0) ## firewall: p->p_rlink must be 0 beql set1 ## pushab set3 ## calls $1,_panic ## set1: movzbl P_PRI(r0),r1 # put on queue which is p->p_pri / 4 ashl $-2,r1,r1 movaq _qs[r1],r2 insque (r0),*4(r2) # at end of queue bbss r1,_whichqs,set2 # mark queue non-empty set2: rsb set3: .asciz "setrq" /* * Remrq(p), using fancy VAX instructions * * Call should be made at spl6(). */ .globl _Remrq # <<>> _Remrq: movzbl P_PRI(r0),r1 ashl $-2,r1,r1 bbsc r1,_whichqs,rem1 pushab rem3 # it wasn't recorded to be on its q calls $1,_panic rem1: remque (r0),r2 beql rem2 bbss r1,_whichqs,rem2 rem2: clrl P_RLINK(r0) ## for firewall checking rsb rem3: .asciz "remrq" /* * Masterpaddr is the p->p_addr of the running process on the master * processor. When a multiprocessor system, the slave processors will have * an array of slavepaddr's. */ .globl _masterpaddr .data _masterpaddr: .long 0 .text sw0: .asciz "swtch" /* * Swtch(), using fancy VAX instructions */ .globl _Swtch _Swtch: # <<>> movl $1,_noproc clrl _runrun sw1: ffs $0,$32,_whichqs,r0 # look for non-empty queue bneq sw1a mtpr $0,$IPL # must allow interrupts here brw sw1 # this is an idle loop! sw1a: mtpr $0x18,$IPL # lock out all so _whichqs==_qs bbcc r0,_whichqs,sw1 # proc moved via lbolt interrupt movaq _qs[r0],r1 remque *(r1),r2 # r2 = p = highest pri process bvc sw2 # make sure something was there sw1b: pushab sw0 calls $1,_panic sw2: beql sw3 insv $1,r0,$1,_whichqs # still more procs in this queue sw3: clrl _noproc tstl P_WCHAN(r2) ## firewalls bneq sw1b ## movzbl P_STAT(r2),r3 ## cmpl $SRUN,r3 ## bneq sw1b ## clrl P_RLINK(r2) ## movl *P_ADDR(r2),r0 movl r0,_masterpaddr ashl $PGSHIFT,r0,r0 # r0 = pcbb(p) /* mfpr $PCBB,r1 # resume of current proc is easy * cmpl r0,r1 */ beql res0 incl _cnt+V_SWTCH /* fall into... */ /* * Resume(pf) */ .globl _Resume # <<>> _Resume: mtpr $0x18,$IPL # no interrupts, please movl _CMAP2,_u+PCB_CMAP2 # yech svpctx mtpr r0,$PCBB ldpctx movl _u+PCB_CMAP2,_CMAP2 # yech mtpr $_CADDR2,$TBIS res0: tstl _u+PCB_SSWAP beql res1 movl _u+PCB_SSWAP,r0 clrl _u+PCB_SSWAP movab _Longjmp,(sp) movl $PSL_PRVMOD,4(sp) # ``cheating'' (jfr) res1: rei /* * {fu,su},{byte,word}, all massaged by asm.sed to jsb's */ .globl _Fuword _Fuword: prober $3,$4,(r0) beql fserr movl (r0),r0 rsb fserr: mnegl $1,r0 rsb .globl _Fubyte _Fubyte: prober $3,$1,(r0) beql fserr movzbl (r0),r0 rsb .globl _Suword _Suword: probew $3,$4,(r0) beql fserr movl r1,(r0) clrl r0 rsb .globl _Subyte _Subyte: probew $3,$1,(r0) beql fserr movb r1,(r0) clrl r0 rsb /* * Copy 1 relocation unit (NBPG bytes) * from user virtual address to physical address */ _copyseg: .globl _copyseg .word 0x0 bisl3 $PG_V|PG_KW,8(ap),_CMAP2 mtpr $_CADDR2,$TBIS # invalidate entry for copy movc3 $NBPG,*4(ap),_CADDR2 ret /* * zero out physical memory * specified in relocation units (NBPG bytes) */ _clearseg: .globl _clearseg .word 0x0 bisl3 $PG_V|PG_KW,4(ap),_CMAP1 mtpr $_CADDR1,$TBIS movc5 $0,(sp),$0,$NBPG,_CADDR1 ret /* * Check address. * Given virtual address, byte count, and rw flag * returns 0 on no access. */ _useracc: .globl _useracc .word 0x0 movl 4(ap),r0 # get va movl 8(ap),r1 # count tstl 12(ap) # test for read access ? bneq userar # yes cmpl $NBPG,r1 # can we do it in one probe ? bgeq uaw2 # yes uaw1: probew $3,$NBPG,(r0) beql uaerr # no access addl2 $NBPG,r0 acbl $NBPG+1,$-NBPG,r1,uaw1 uaw2: probew $3,r1,(r0) beql uaerr movl $1,r0 ret userar: cmpl $NBPG,r1 bgeq uar2 uar1: prober $3,$NBPG,(r0) beql uaerr addl2 $NBPG,r0 acbl $NBPG+1,$-NBPG,r1,uar1 uar2: prober $3,r1,(r0) beql uaerr movl $1,r0 ret uaerr: clrl r0 ret /* * kernacc - check for kernel access privileges * * We can't use the probe instruction directly because * it ors together current and previous mode. */ .globl _kernacc _kernacc: .word 0x0 movl 4(ap),r0 # virtual address bbcc $31,r0,kacc1 bbs $30,r0,kacerr mfpr $SBR,r2 # address and length of page table (system) bbss $31,r2,0f; 0: mfpr $SLR,r3 brb kacc2 kacc1: bbsc $30,r0,kacc3 mfpr $P0BR,r2 # user P0 mfpr $P0LR,r3 brb kacc2 kacc3: mfpr $P1BR,r2 # user P1 (stack) mfpr $P1LR,r3 kacc2: addl3 8(ap),r0,r1 # ending virtual address addl2 $NBPG-1,r1 ashl $-PGSHIFT,r0,r0 ashl $-PGSHIFT,r1,r1 bbs $31,4(ap),kacc6 bbc $30,4(ap),kac((c6 cmpl r0,r3 # user stack blss kacerr # address too low brb kacc4 kacc6: cmpl r1,r3 # compare last page to P0LR or SLR bgtr kacerr # address too high kacc4: movl (r2)[r0],r3 bbc $31,4(ap),kacc4a bbc $31,r3,kacerr # valid bit is off kacc4a: cmpzv $27,$4,r3,$1 # check protection code bleq kacerr # no access allowed tstb 12(ap) bneq kacc5 # only check read access cmpzv $27,$2,r3,$3 # check low 2 bits of prot code beql kacerr # no write access kacc5: aoblss r1,r0,kacc4 # next page movl $1,r0 # no errors ret kacerr: clrl r0 # error ret @ik>$sTWZ]`]@i*6i /* ubareg.h 4.22 81/04/03 */ /* * VAX UNIBUS adapter registers */ #ifndef LOCORE /* * UBA hardware registers */ struct uba_regs { int uba_cnfgr; /* configuration register */ int uba_cr; /* control register */ int uba_sr; /* status register */ int uba_dcr; /* diagnostic control register */ int uba_fmer; /* failed map entry register */ int uba_fubar; /* failed UNIBUS address register */ int pad1[2]; int uba_brsvr[4]; int uba_brrvr[4]; /* receive vector registers */ int uba_dpr[16]; /* buffered data path register */ int pad2[480]; struct pte uba_map[496]; /* unibus map register */ int pad3[16]; /* no maps for device address space */ }; #endif #if VAX780 /* uba_cnfgr */ #define UBACNFGR_UBINIT 0x00040000 /* unibus init asserted */ #define UBACNFGR_UBPDN 0x00020000 /* unibus power down */ #define UBACNFGR_UBIC 0x00010000 /* unibus init complete */ /* uba_cr */ #define UBACR_MRD16 0x40000000 /* map reg disable bit 4 */ #define UBACR_MRD8 0x20000000 /* map reg disable bit 3 */ #define UBACR_MRD4 0x10000000 /* map reg disable bit 2 */ #define UBACR_MRD2 0x08000000 /* map reg disable bit 1 */ #define UBACR_MRD1 0x04000000 /* map reg disable bit 0 */ #define UBACR_IFS 0x00000040 /* interrupt field switch */ #define UBACR_BRIE 0x00000020 /* BR interrupt enable */ #define UBACR_USEFIE 0x00000010 /* UNIBUS to SBI error field IE */ #define UBACR_SUEFIE 0x00000008 /* SBI to UNIBUS error field IE */ #define UBACR_CNFIE 0x00000004 /* configuration IE */ #define UBACR_UPF 0x00000002 /* UNIBUS power fail */ #define UBACR_ADINIT 0x00000001 /* adapter init */ /* uba_sr */ #define UBASR_BR7FULL 0x08000000 /* BR7 receive vector reg full */ #define UBASR_BR6FULL 0x04000000 /* BR6 receive vector reg full */ #define UBASR_BR5FULL 0x02000000 /* BR5 receive vector reg full */ #define UBASR_BR4FULL 0x01000000 /* BR4 receive vector reg full */ #define UBASR_RDTO 0x00000400 /* UNIBUS to SBI read data timeout */ #define UBASR_RDS 0x00000200 /* read data substitute */ #define UBASR_CRD 0x00000100 /* corrected read data */ #define UBASR_CXTER 0x00000080 /* command transmit error */ #define UBASR_CXTMO 0x00000040 /* command transmit timeout */ #define UBASR_DPPE 0x00000020 /* data path parity error */ #define UBASR_IVMR 0x00000010 /* invalid map register */ #define UBASR_MRPF 0x00000008 /* map register parity failure */ #define UBASR_LEB 0x00000004 /* lost error */ #define UBASR_UBSTO 0x00000002 /* UNIBUS select timeout */ #define UBASR_UBSSYNTO 0x00000001 /* UNIBUS slave sync timeout */ #define UBASR_BITS \ "\20\13RDTO\12RDS\11CRD\10CXTER\7CXTMO\6DPPE\5IVMR\4MRPF\3LEB\2UBSTO\1UBSSYNTO" /* uba_brrvr[] */ #define UBABRRVR_AIRI 0x80000000 /* adapter interrupt request */ #define UBABRRVR_DIV 0x0000ffff /* device interrupt vector field */ #endif VAX780 /* uba_dpr */ #if VAX780 #define UBADPR_BNE 0x80000000 /* buffer not empty - purge */ #define UBADPR_BTE 0x40000000 /* buffer transfer error */ #define UBADPR_DPF 0x20000000 /* DP function (RO) */ #define UBADPR_BS 0x007f0000 /* buffer state field */ #define UBADPR_BUBA 0x0000ffff /* buffered UNIBUS address */ #endif VAX780 #if VAX750 #define UBADPR_ERROR 0x80000000 /* error occurred */ #define UBADPR_NXM 0x40000000 /* nxm from memory */ #define UBADPR_UCE 0x20000000 /* uncorrectable error */ #define UBADPR_PURGE 0x00000001 /* purge bdp */ #endif VAX750 /* uba_mr[] */ #define UBAMR_MRV 0x80000000 /* map register valid */ #define UBAMR_BO 0x02000000 /* byte offset bit */ #define UBAMR_DPDB 0x01e00000 /* data path designator field */ #define UBAMR_SBIPFN 0x000fffff /* SBI page address field */ #define UBAMR_DPSHIFT 21 /* shift to data path designator */ /* * Number of UNIBUS map registers. We can't use the last 8k of UNIBUS * address space for i/o transfers since it is used by the devices, * hence have slightly less than 256K of UNIBUS address space. */ #define NUBMREG 496 /* * Number of unibus buffered data paths and possible uba's per cpu type. */ #define NBDP780 15 #define NBDP750 3 #define NBDP7ZZ 0 #define MAXNBDP 15 #define NUBA780 4 #define NUBA750 1 #define NUBA7ZZ 1 #if VAX780 #define MAXNUBA 4 #else #define MAXNUBA 1 #endif /* * Formulas for locations of the last 8k of UNIBUS memory * for each possible uba. */ #if VAX7ZZ #define UMEM7ZZ ((u_short *)(0xffe000)) #endif #if VAX750 #define UMEM750(i) ((u_short *)(0xffe000-(i)*0x40000)) #endif #if VAX780 #define UMEM780(i) ((u_short *)(0x2013e000+(i)*0x40000)) #endif @ikPߺQo<<<  char *from = "/dev/rhp0c"; char *to = "/dev/rup0h"; char *buf; int bsize = 3*22; int start = 0; int count = 814; /*480 for h file system on ampex*/ main(argc, argv) int argc; char **argv; { argc--, argv++; if (argc > 0) start = atoi(*argv++), argc--; if (argc > 0) bsize = atoi(*argv++), argc--; if (argc > 0) count = atoi(*argv++), argc--; printf("from %s to %s, %d groups of %d blocks offset %d\n", from, to, count, bsize, start); close(0); if (open(from, 0) != 0) perror(from), exit(1); close(1); if (open(to, 1) != 1) perror(to), exit(1); start *= 512; bsize *= 512; buf = (char *)sbrk(bsize); while (count > 0) { if (lseek(0, start, 0) < 0) perror("seek 0"), exit(1); if (lseek(1, start+(200000*512), 0) < 0) perror("seek 1"), exit(1); if (count % 25 == 0) printf("%d\n", count); if (read(0, buf, bsize) != bsize) { printf("read block %d: ", start / 512); perror("read 0"); } else if (write(1, buf, bsize) != bsize) { printf("write block %d: ", start / 512); perror("write 1"); } start += bsize; count--; } printf("DONE!\n"); } ((@ik  %5i5i Mon Aug 31 04:16:42 PDT 1981 @ikP9@g j m p s v y |  D2iQ6i /* machdep.c 4.40- 81/10/27 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/map.h" #include "../h/reg.h" #include "../h/mtpr.h" #include "../h/clock.h" #include "../h/pte.h" #include "../h/vm.h" #include "../h/proc.h" #include "../h/psl.h" #include "../h/buf.h" #include "../h/ubavar.h" #include "../h/ubareg.h" #include "../h/cons.h" #include "../h/reboot.h" #include "../h/conf.h" #include "../h/mem.h" #include "../h/cpu.h" #include "../h/inode.h" #include "../h/file.h" #include "../h/text.h" #include "../h/clist.h" #include "../h/callout.h" #include "../h/cmap.h" #include #include "../h/rpb.h" int icode[] = { 0x9f19af9f, /* pushab [&"init",0]; pushab */ 0x02dd09af, /* "/etc/init"; pushl $2 */ 0xbc5c5ed0, /* movl sp,ap; chmk */ 0x2ffe110b, /* $exec; brb .; "/ */ 0x2f637465, /* etc/ */ 0x74696e69, /* init" */ 0x00000000, /* \0\0\0"; 0 */ 0x00000014, /* [&"init", */ 0x00000000, /* 0] */ }; int szicode = sizeof(icode); /* * Declare these as initialized data so we can patch them. */ int nbuf = 0; int nswbuf = 0; /* * Machine-dependent startup code */ startup(firstaddr) int firstaddr; { register int unixsize; register unsigned i; register struct pte *pte; register caddr_t v; /* * Initialize error message buffer (at end of core). */ maxmem -= CLSIZE; pte = msgbufmap; for (i = 0; i < CLSIZE; i++) *(int *)pte++ = PG_V | PG_KW | (maxmem + i); mtpr(TBIA, 1); /* * Good {morning,afternoon,evening,night}. */ printf(version); printf("real mem = %d\n", ctob(maxmem)); /* * First determine how many buffers are reasonable. * Current alg is 32 per megabyte, with min of 32. * We allocate 1/2 as many swap buffer headers as file i/o buffers. */ if (nbuf == 0) { nbuf = (32 * physmem) / btoc(1024*1024); if (nbuf < 32) nbuf = 32; } if (nswbuf == 0) { nswbuf = (nbuf / 2) &~ 1; /* force even */ if (nswbuf > 256) nswbuf = 256; /* sanity */ } /* * Allocate space for system data structures. */ v = (caddr_t)(0x80000000 | (firstaddr * NBPG)); #define valloc(name, type, num) \ (name) = (type *)(v); (v) = (caddr_t)((name)+(num)) #define valloclim(name, type, num, lim) \ (name) = (type *)(v); (v) = (caddr_t)((lim) = ((name)+(num))) valloc(buffers, char, BSIZE*nbuf); valloc(buf, struct buf, nbuf); valloc(swbuf, struct buf, nswbuf); valloc(swsize, short, nswbuf); /* note: nswbuf is even */ valloc(swpf, int, nswbuf); valloclim(inode, struct inode, ninode, inodeNINODE); valloclim(file, struct file, nfile, fileNFILE); valloclim(proc, struct proc, nproc, procNPROC); valloclim(text, struct text, ntext, textNTEXT); valloc(cfree, struct cblock, nclist); valloc(callout, struct callout, ncallout); valloc(swapmap, struct map, nswapmap = nproc * 2); valloc(argmap, struct map, ARGMAPSIZE); valloc(kernelmap, struct map, nproc); /* * Now allocate space for core map */ ncmap = (physmem*NBPG - ((int)v &~ 0x80000000)) / (NBPG*CLSIZE + sizeof (struct cmap)); valloclim(cmap, struct cmap, ncmap, ecmap); if ((((int)(ecmap+1))&~0x80000000) > SYSPTSIZE*NBPG) panic("sys pt too small"); /* * Clear allocated space, and make r/w entries * for the space in the kernel map. */ unixsize = btoc((int)(ecmap+1) &~ 0x80000000); if (unixsize >= physmem - 8*UPAGES) panic("no memory"); pte = &Sysmap[firstaddr]; for (i = firstaddr; i < unixsize; i++) { *(int *)(&Sysmap[i]) = PG_V | PG_KW | i; clearseg(i); } mtpr(TBIA, 1); /* * Initialize callouts */ callfree = callout; for (i = 1; i < ncallout; i++) callout[i-1].c_next = &callout[i]; /* * Initialize memory allocator and swap * and user page table maps. * * THE USER PAGE TABLE MAP IS CALLED ``kernelmap'' * WHICH IS A VERY UNDESCRIPTIVE AND INCONSISTENT NAME. */ meminit(unixsize, maxmem); maxmem = freemem; printf("avail mem = %d\n", ctob(maxmem)); rminit(kernelmap, USRPTSIZE, 1, "usrpt", nproc); /* * Configure the system. */ configure(); /* * Clear restart inhibit flags. */ tocons(TXDB_CWSI); tocons(TXDB_CCSI); } /* * set up a physical address * into users virtual address space. */ sysphys() { if(!suser()) return; u.u_error = EINVAL; } /* * Initialze the clock, based on the time base which is, e.g. * from a filesystem. Base provides the time to within six months, * and the time of year clock provides the rest. */ clkinit(base) time_t base; { register unsigned todr = mfpr(TODR); long deltat; int year = YRREF; if (base < 5*SECYR) { printf("WARNING: preposterous time in file system"); time = 6*SECYR + 186*SECDAY + SECDAY/2; clkset(); goto check; } /* * Have been told that VMS keeps time internally with base TODRZERO. * If this is correct, then this routine and VMS should maintain * the same date, and switching shouldn't be painful. * (Unfortunately, VMS keeps local time, so when you run UNIX * and VMS, VMS runs on GMT...). */ if (todr < TODRZERO) { printf("WARNING: todr too small"); time = base; /* * Believe the time in the file system for lack of * anything better, resetting the TODR. */ clkset(); goto check; } /* * Sneak to within 6 month of the time in the filesystem, * by starting with the time of the year suggested by the TODR, * and advancing through succesive years. Adding the number of * seconds in the current year takes us to the end of the current year * and then around into the next year to the same position. */ for (time = (todr-TODRZERO)/100; time < base-SECYR/2; time += SECYR) { if (LEAPYEAR(year)) time += SECDAY; year++; } /* * See if we gained/lost two or more days; * if so, assume something is amiss. */ deltat = time - base; if (deltat < 0) deltat = -deltat; if (deltat < 2*SECDAY) return; printf("WARNING: clock %s %d days", time < base ? "lost" : "gained", deltat / SECDAY); check: printf(" -- CHECK AND RESET THE DATE!\n"); } /* * Reset the TODR based on the time value; used when the TODR * has a preposterous value and also when the time is reset * by the stime system call. Also called when the TODR goes past * TODRZERO + 100*(SECYEAR+2*SECDAY) (e.g. on Jan 2 just after midnight) * to wrap the TODR around. */ clkset() { int year = YRREF; unsigned secyr; unsigned yrtime = time; /* * Whittle the time down to an offset in the current year, * by subtracting off whole years as long as possible. */ for (;;) { secyr = SECYR; if (LEAPYEAR(year)) secyr += SECDAY; if (yrtime < secyr) break; yrtime -= secyr; year++; } mtpr(TODR, TODRZERO + yrtime*100); } #ifdef PGINPROF /* * Return the difference (in microseconds) * between the current time and a previous * time as represented by the arguments. * If there is a pending clock interrupt * which has not been serviced due to high * ipl, return error code. */ vmtime(otime, olbolt, oicr) register int otime, olbolt, oicr; { if (mfpr(ICCS)&ICCS_INT) return(-1); else return(((time-otime)*60 + lbolt-olbolt)*16667 + mfpr(ICR)-oicr); } #endif /* * Send an interrupt to process * * SHOULD CHANGE THIS TO ((PASS ONE MORE WORK SO THAT ALL INFORMATION * PROVIDED BY HARDWARE IS AVAILABLE TO THE USER PROCESS. */ sendsig(p, n) int (*p)(); { register int *usp, *regs; regs = u.u_ar0; usp = (int *)regs[SP]; usp -= 5; if ((int)usp <= USRSTACK - ctob(u.u_ssize)) (void) grow((unsigned)usp); ; /* Avoid asm() label botch */ #ifndef lint asm("probew $3,$20,(r11)"); asm("beql bad"); #else if (useracc((caddr_t)usp, 0x20, 1)) goto bad; #endif *usp++ = n; if (n == SIGILL || n == SIGFPE) { *usp++ = u.u_code; u.u_code = 0; } else *usp++ = 0; *usp++ = (int)p; *usp++ = regs[PC]; *usp++ = regs[PS]; regs[SP] = (int)(usp - 5); regs[PS] &= ~(PSL_CM|PSL_FPD); regs[PC] = (int)u.u_pcb.pcb_sigc; return; asm("bad:"); bad: /* * Process has trashed its stack; give it an illegal * instruction to halt it in its tracks. */ u.u_signal[SIGILL] = SIG_DFL; u.u_procp->p_siga0 &= ~(1<<(SIGILL-1)); u.u_procp->p_siga1 &= ~(1<<(SIGILL-1)); psignal(u.u_procp, SIGILL); } dorti() { struct frame frame; register int sp; register int reg, mask; extern int ipcreg[]; (void) copyin((caddr_t)u.u_ar0[FP], (caddr_t)&frame, sizeof (frame)); sp = u.u_ar0[FP] + sizeof (frame); u.u_ar0[PC] = frame.fr_savpc; u.u_ar0[FP] = frame.fr_savfp; u.u_ar0[AP] = frame.fr_savap; mask = frame.fr_mask; for (reg = 0; reg <= 11; reg++) { if (mask&1) { u.u_ar0[ipcreg[reg]] = fuword((caddr_t)sp); sp += 4; } mask >>= 1; } sp += frame.fr_spa; u.u_ar0[PS] = (u.u_ar0[PS] & 0xffff0000) | frame.fr_psw; if (frame.fr_s) sp += 4 + 4 * (fuword((caddr_t)sp) & 0xff); /* phew, now the rei */ u.u_ar0[PC] = fuword((caddr_t)sp); sp += 4; u.u_ar0[PS] = fuword((caddr_t)sp); sp += 4; u.u_ar0[PS] |= PSL_USERSET; u.u_ar0[PS] &= ~PSL_USERCLR; u.u_ar0[SP] = (int)sp; } /* * Memenable enables the memory controlle corrected data reporting. * This runs at regular intervals, turning on the interrupt. * The interrupt is turned off, per memory controller, when error * reporting occurs. Thus we report at most once per memintvl. */ int memintvl = MEMINTVL; memenable() { register struct mcr *mcr; register int m; for (m = 0; m < nmcr; m++) { mcr = mcraddr[m]; switch (cpu) { #if VAX780 case VAX_780: M780_ENA(mcr); break; #endif #if VAX750 case VAX_750: M750_ENA(mcr); break; #endif #if VAX7ZZ case VAX_7ZZ: M7ZZ_ENA(mcr); break; #endif } } if (memintvl > 0) timeout(memenable, (caddr_t)0, memintvl); } /* * Memerr is the interrupt routine for corrected read data * interrupts. It looks to see which memory controllers have * unreported errors, reports them, and disables further * reporting for a time on those controller. */ memerr() { register struct mcr *mcr; register int m; for (m = 0; m < nmcr; m++) { mcr = mcraddr[m]; switch (cpu) { #if VAX780 case VAX_780: if (M780_ERR(mcr)) { printf("mcr%d: soft ecc addr %x syn %x\n", m, M780_ADDR(mcr), M780_SYN(mcr)); M780_INH(mcr); } break; #endif #if VAX750 case VAX_750: if (M750_ERR(mcr)) { printf("mcr%d: soft ecc a@i)kP9@g j m p s v y |  D2iQ6iddr %x syn %x\n", m, M750_ADDR(mcr), M750_SYN(mcr)); M750_INH(mcr); } break; #endif #if VAX7ZZ case VAX_7ZZ: if (M7ZZ_ERR(mcr)) { struct mcr amcr; amcr.mc_reg[0] = mcr->mc_reg[0]; printf("mcr%d: soft ecc addr %x syn %x\n", m, M7ZZ_ADDR(&amcr), M7ZZ_SYN(&amcr)); M7ZZ_INH(mcr); } break; #endif } } } /* * Invalidate single all pte's in a cluster */ tbiscl(v) unsigned v; { register caddr_t addr; /* must be first reg var */ register int i; asm(".set TBIS,58"); addr = ptob(v); for (i = 0; i < CLSIZE; i++) { #ifdef lint mtpr(TBIS, addr); #else asm("mtpr r11,$TBIS"); #endif addr += NBPG; } } int waittime = -1; boot(paniced, arghowto) int paniced, arghowto; { register int howto; /* r11 == how to boot */ register int devtype; /* r10 == major of root dev */ howto = arghowto; if ((howto&RB_NOSYNC)==0 && waittime < 0 && bfreelist[0].b_forw) { waittime = 0; update(); printf("syncing disks... "); while (++waittime <= 5) sleep((caddr_t)&lbolt, PZERO); printf("done\n"); } splx(0x1f); /* extreme priority */ devtype = major(rootdev); if (howto&RB_HALT) { printf("halting (in tight loop); hit\n\t^P\n\tHALT\n\n"); mtpr(IPL, 0x1f); for (;;) ; } else { if (paniced == RB_PANIC) doadump(); tocons(TXDB_BOOT); } #if defined(VAX750) || defined(VAX7ZZ) if (cpu != VAX_780) { asm("movl r11,r5"); } /* boot flags go in r5 */ #endif for (;;) asm("halt"); #ifdef lint printf("howto %d, devtype %d\n", howto, devtype); #endif /*NOTREACHED*/ } tocons(c) { while ((mfpr(TXCS)&TXCS_RDY) == 0) continue; mtpr(TXDB, c); } /* * Doadump comes here after turning off memory management and * getting on the dump stack, either when called above, or by * the auto-restart code. */ dumpsys() { rpb.rp_flag = 1; if ((minor(dumpdev)&07) != 1) return; printf("\ndumping to dev %x, offset %d\n", dumpdev, dumplo); printf("dump "); switch ((*bdevsw[major(dumpdev)].d_dump)(dumpdev)) { case ENXIO: printf("device bad\n"); break; case EFAULT: printf("device not ready\n"); break; case EINVAL: printf("area improper\n"); break; case EIO: printf("i/o error"); break; default: printf("succeeded"); break; } } /* * Machine check error recovery code. * Print out the machine check frame and then give up. */ #if defined(VAX780) char *mc780[] = { "cp read", "ctrl str par", "cp tbuf par", "cp cache par", "cp rdtimo", "cp rds", "ucode lost", 0, 0, 0, "ib tbuf par", 0, "ib rds", "ib rd timo", 0, "ib cache par" }; #endif #if defined(VAX750) char *mc750[] = { 0, "ctrl str par", "memory error", "cp cache par", "write bus err","corr data", "ucode lost", "bad ird", }; #endif #if VAX7ZZ #define NMC7ZZ 12 char *mc7ZZ[] = { "tb par", "bad retry", "bad intr id", "cant write ptem", "unkn mcr err", "iib rd err", "nxm ref", "cp rds", "unalgn ioref", "nonlw ioref", "bad ioaddr", "unalgn ubaddr", }; #endif /* * Frame for each cpu */ struct mc780frame { int mc8_bcnt; /* byte count == 0x28 */ int mc8_summary; /* summary parameter (as above) */ int mc8_cpues; /* cpu error status */ int mc8_upc; /* micro pc */ int mc8_vaviba; /* va/viba register */ int mc8_dreg; /* d register */ int mc8_tber0; /* tbuf error reg 0 */ int mc8_tber1; /* tbuf error reg 1 */ int mc8_timo; /* timeout address divided by 4 */ int mc8_parity; /* parity */ int mc8_sbier; /* sbi error register */ int mc8_pc; /* trapped pc */ int mc8_psl; /* trapped psl */ }; struct mc750frame { int mc5_bcnt; /* byte count == 0x28 */ int mc5_summary; /* summary parameter (as above) */ int mc5_va; /* virtual address register */ int mc5_errpc; /* error pc */ int mc5_mdr; int mc5_svmode; /* saved mode register */ int mc5_rdtimo; /* read lock timeout */ int mc5_tbgpar; /* tb group parity error register */ int mc5_cacherr; /* cache error register */ int mc5_buserr; /* bus error register */ int mc5_mcesr; /* machine check status register */ int mc5_pc; /* trapped pc */ int mc5_psl; /* trapped psl */ }; struct mc7ZZframe { int mc3_bcnt; /* byte count == 0xc */ int mc3_summary; /* summary parameter */ int mc3_parm[2]; /* parameter 1 and 2 */ int mc3_pc; /* trapped pc */ int mc3_psl; /* trapped psl */ }; machinecheck(cmcf) caddr_t cmcf; { register u_int type = ((struct mc780frame *)cmcf)->mc8_summary; printf("machine check %x: ", type); switch (cpu) { #if VAX780 case VAX_780: printf("%s%s\n", mc780[type&0xf], (type&0xf0) ? " abort" : " fault"); break; #endif #if VAX750 case VAX_750: printf("%s\n", mc750[type&0x7]); break; #endif #if VAX7ZZ case VAX_7ZZ: if (type < NMC7ZZ) printf("%s", mc7ZZ[type]); printf("\n"); break; #endif } switch (cpu) { #if VAX780 case VAX_780: { register struct mc780frame *mcf = (struct mc780frame *)cmcf; register int sbifs; printf("\tcpues %x upc %x va/viba %x dreg %x tber %x %x\n", mcf->mc8_cpues, mcf->mc8_upc, mcf->mc8_vaviba, mcf->mc8_dreg, mcf->mc8_tber0, mcf->mc8_tber1); sbifs = mfpr(SBIFS); printf("\ttimo %x parity %x sbier %x pc %x psl %x sbifs %x\n", mcf->mc8_timo*4, mcf->mc8_parity, mcf->mc8_sbier, mcf->mc8_pc, mcf->mc8_psl, sbifs); /* THE FUNNY BITS IN THE FOLLOWING ARE FROM THE ``BLACK */ /* BOOK AND SHOULD BE PUT IN AN ``sbi.h'' */ mtpr(SBIFS, sbifs &~ 0x2000000); mtpr(SBIER, mfpr(SBIER) | 0x70c0); break; } #endif #if VAX750 case VAX_750: { register struct mc750frame *mcf = (struct mc750frame *)cmcf; printf("\tva %x errpc %x mdr %x smr %x rdtimo %x tbgpar %x cacherr %x\n", mcf->mc5_va, mcf->mc5_errpc, mcf->mc5_mdr, mcf->mc5_svmode, mcf->mc5_rdtimo, mcf->mc5_tbgpar, mcf->mc5_cacherr); printf("\tbuserr %x mcesr %x pc %x psl %x mcsr %x\n", mcf->mc5_buserr, mcf->mc5_mcesr, mcf->mc5_pc, mcf->mc5_psl, mfpr(MCSR)); mtpr(MCESR, 0xf); break; } #endif #if VAX7ZZ case VAX_7ZZ: { register struct mc7ZZframe *mcf = (struct mc7ZZframe *)cmcf; printf("params %x,%x pc %x psl %x mcesr %x\n", mcf->mc3_parm[0], mcf->mc3_parm[1], mcf->mc3_pc, mcf->mc3_psl, mfpr(MCESR)); mt((pr(MCESR, 0xf); break; } #endif } panic("mchk"); } @i1kwƨrz/(lh 2i՚՚   ^Юn PPՀPpPP  Pp1׬լ1 ]PPݼP1EMT[bjs|y8dt7  ~<r  ;,  d  ($0:fC. I3Q l YtaLBiq\ {y lN8d  7  crt0.otouch.ochmod.operror.oerrlst.ostrlen.olseek.oexit.oclose.oopen.oread.ostat.owrite.ocerror.oflsbuf.odata.oisatty.ostty.oioctl.omalloc.osbrk.oudiv.o_exitstart_main_environ_stat_chmod_open_lseek_read_write_close_perrorcerror_errno_sys_nerr_sys_errlist_strlen__cleanup__flsbuf__iob_isatty__sobuf_malloc_fflush_fclose__lastbuf_free__sibuf_gtty_stty_ioctludiv_sbrk_realloc_end_brk@i9kU7R +]2i ((, Z[[PPN[PZP[PN[K?[?2P<QQP~PP2PďPPP[ÏPP[PP [P2NPŀ?2P<QQP~IPW2G?P|1/PZSkk [k2ZѪ[ j ZZk[P2NPďPPP[ÏPP[P1x1V2PďPP~P[NtGmNe[PƏPPPGTkԫH<PPP~2~+PYiY[x1ЩX<PPPQxQQQPQxQPPXX[ Y1Ь[ЬZj  Ъ[Y ZPPXW WЬ[1k[.Bk<~2~dFkVP[kk k[4?2P<QQP~PZ[PǏPPY2JPPY NJ<2JPďPPPXÏPPXP*NNNYk"2NPPY2NPkk k[^Ь[Fk12~_<PPP~2~BPZj Z2Ъ<PPPQxQQQPQxQPPЭPЭP ЭP ЭPЫ Y[XW5<PʏPP0!<PʏPPp WW k ЭPм4k ЭPм 8k ЭPl( ^49,sno imtinodeiputiaddress > 2^24 itrunc) = '+ ;< WB `< n) {) B < E F G $ $ '.H I) V) e= p= ~) = < ) < I J J P   R B ) < < < ) *) 6=H J= S= |R T I J ZaU  V W H   DY vI J J Y J Y F $^ /F 6VF hF pF z  F F F F F F F F a F #,39BHQZbhow!,3H:(@xFMTairy,~ D "-07>EMfS&\afnu} _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_mount_zdmap_zvmsU_ARGU_QSAV_inode_inodeNINODE_ninode_rootdir_mpxip_bdevsw_cdevsw_linesw_swdevt_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_inohash_ifreel_ihinitL109_ifindL119urem_igetL127_tablefull_u_sleep_panic_bread_brelse_iput_iexpandL151L158_itrunc_ifree_iupdat_wakeupL180_getfs_printf_bwrite_bdwriteL200_free_tloopL222_maknodeL235_ialloc_wdirL242_writei@i?k~$8@Od2icc HHݏڮn^[kЫ [[[kzPРGPYajr{H(x~ttt(&/8CLS]fow,$/4=FLOX`hsxj_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem((_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_cp_time_dk_busy_dk_time_dk_seek_dk_xfer_dk_wds_dk_mspw_tk_nin_tk_nout_callfree_callout_calltodo_ncallout_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_text_textNTEXT_ntext_cpu_percpu_hardclockL139_nrscale_avenrun_ccpu_u_psignal_setpri_unhang_softclockL175_dhtimer_dztimer_wakeup_vmpago_setrun_unsleep_Remrq_Setrq_vmmeter_timeoutL230_ttrstrt_panic@iEkXs a)%2iss  Ь[[ K Z PZP ^Ь[ЫZ2k2PP<PˏPZZ~Z~|ZsЭPP P0P`FPp^2PPPPPxPPXZЫZЪP2QPQ]<PʏPPLYթi YY2PPPPPPX:[ [[ѭ`2~2~[ݭ2~h ^Ь[2PP2PPPPZ<PʏPP PP0GP`Pp2ݬ2~xZPPZ!ݬ2~ZPP`Z Ь[ЬZZ62~Pk [koPd xZZW xZZZP<QPQ 8f_P[P [PP[5 PP[K#[Kc[P[P PZu ["[Jԫ [[P [[[ [[wh&Pfile7 7 \: u; ; < , 4 4 $+ 1( C) Z= e> ,  +  7 "C /7 87 ID S7 ^7 m7 7 G H 7 < 7 7 7 7 7 7 7 !,M 4( 9M ?M O7 ]M k) s( M P 7 #,39BHQZbhow!,H3(9x?FLW^fnv~ $v  #*18=FKRZ _j_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_file_fileNFILE_nfile_bdevsw_cdevsw_linesw_swdevt_inode_inodeNINODE_ninode_rootdir_mpxip_mount_getfL94_u_closefL100_plock_wakeup_iput_bflush_binval_openiL130_accessL144_getfs_xrele_ownerL157_uchar_namei_suserL165_ufallocL171_lastf_fallocL180_tablefull@iIkS 2iff  ( ^Юn PPՀPpPP' PX$|^ѬЬPР[Р[k1"kPPc[,,,,,,,O,,,,,OOOk~ר`#[kP@_#P.Uݭ&ݏ|ݭ#|y 2}#)ݭy#Y 1x1b1R{ЬPР׬14Ϋɫ7ﯫ"[&ǧP" [lP"B" &ͣvv"Ь%ޡ﹣BB" Z[3x[PP`"x[PP`Z[[ΪZPĪԦ])Ѭc ݬd ^Df1ԭ@[ZPPݭ3~7x P2(PPѭ|xPx PPשPZx P@$[[Z[RP$[Y6xYPǩP`)PРXXxYPP`YY^Ь[z1PP 1}߭[~߭[~  PHP  2~ݭݭݭ߭߭+WG2~D2>.PPP%""%"""ФPɤ `P[~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TPPPPݬݏ tݬݬݏtݬ6|.nf`cQT~*PY=[Bk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [PYPƏPxP׏bPZxďPZPPZxﴏ~@PZZZPZP}x~PZPPjjg[1xYP[PHZA9<k-&k[P Ь[[ZZZ jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPm@j8~\S^\_PCЬPЬPЬRRQ{RPPR PRPPPP$G((((((LX[ !"#$%&'   !"#$%&'  /dev/ttyAre you sure you want to clobber the floppy? Are you sure you want to clobber the floppy? arff: bad option `%c' arff: one of [%s] must be specified arff: only one of [%s] allowed usage: ar [%s][%s] archive files ... arff: %s not found arff: phase error on %s %c - %s %d entries remaining in directory segment %d. Tempfile: %6.6s %3.3s %02d/%02d/%02d %d %-25.9s %d x - %s r+rarff: too many directory segments arff: read error block %d arff: read error block %d arff: write error block %d arff: write error block %d r - %s %s will not fit in currently used file on floppy a - %s %s: no slot for file %s: internal error, added then not found Directory segment #%d full on %s ((arff: couldn't open %s d - %s @(#)arff.c 4.7 (Berkeley) 81/07/08rxtd/dev/floppyvf ABCDEFGHIJKLMNOPQRSTUVWXYZ$.@0123456789 abcdefghijklmnopqrstuvwxyz$.@0123456789M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDecUnknown error: #ppԵ@iwkx`=2iққ d`ts2 tfVU2tH^YiP[k bѩfPiQA`ѩfPiQA`ЫZ<PʏPPXX RX0Iѩf7X X@%ëݩ߭ ^PP lЎPPݩݩ2~2PPPPPxPPP`ЬP> > > "> '> 0> 7C> MC _> p> > D > > > > > %E 0> S9 #,39BHQZbhow!,H3(9x?F O X~agry}< &\16_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_tthiwat_ttlowat_pidhash_proc_procNPROC_nproc_qs_whichqs_inode_inodeNINODE_ninode_rootdir_mpxip_file_fileNFILE_nfile_bdevsw_cdevsw_linesw_swdevt_sttyL102_u_ioctl_gttyL108L112_getf_Copyout_Setjmp_nullioctlL128@izk } 0&   2i  4YZZPɏPZZ9ڮn^x ~ X .ЏP P~x~P4 P  ( & & PP   2 x PɏPXX2x PXPXX, PXPXX , PXPXXx PXPXXx PXPXXŏPPXPXX PXPXXŏpPXPyXXqŏLfPXP]WXXOxHPXPXX L [} j u ((}  | |  B Q h              < D K l          Z "[ ^Y fnv} Z [ | | %,| =Y pxQ  |   |  |    [ 5 =  J  P  W ^ | d k | q  x  U  |      | [   ~ / 8 G M T | b h o | }   |  | [  |  | : A | Z a | 8<@DHLP`hlt|#,39BHQZbhow!,H3(9x?FOYalt}ttt( (2~;ALSW`en t{ ,%07=HOV^iu  !*2= ENSZ]fksx>    H:  d #,10 :? F M$ TY gl_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_swapmap_nswapmap_argmap_kernelmap_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_pidhash_proc_procNPROC_nproc_qs_whichqs_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_numuba_bdevsw_cdevsw_linesw_swdevt_nmcr_mcraddr_cpu_percpu_inode_inodeNINODE_ninode_rootdir_mpxip_file_fileNFILE_nfile_text_textNTEXT_ntext_cfree_nclist_cfreelist_cfreecount_callfree_callout_calltodo_ncallout_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_icode_szicode_startupL194_msgbufmap_printfudiv_panic_Sysmap_clearseg_meminit_rminit_configure_tocons_sysphysL227_suser_u_clkinitL234_clksetL255_sendsigL265_growbad_psignal_dortiL276_memintvl_Copyin_Fuword_ipcreg_memenableL290_timeout_memerrL305_tbisclTBISL324_waittime_bootL333_update_sleep_doadumpL356_dumpsysL363_mc780_mc750_mc7ZZ_rpb_machinecheckL416@ikx8 2iVV   _partab@ikd -봁J"2iݜݜ TD Ь[[ZЬxP[PPkЬjЬ ^Ь[[Zլ[Ѭ ZX1h1[`ǏPx PPPPPPPPh=PhPPuYíhPìPЭhխY~ݭ=TYPШY¬hXШh[YPPPPYPUXh1BP^Ь[Ь Z1[YYi YѩZYUPPZJPPZ1[թ1[ZPP[ZPP1ii1YЩi[ZPPi[ZPP1[[iRЩXZXZiX[iYX[YPP/Y~ݩЬPݠeYP}`ԩЩiѬArmallocrmalloc swapmap%s: rmap ovflo, lost [%d,%d) bad rmfree9$ KR9 h$ $ $  9  < !' ) 1 7' >= EL9 #,39BHQZbhow!,5?GRHY(_xel~u{ $_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_swapmap_nswapmap_argmap_kernelmap_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_text_textNTEXT_ntext_rminitL87_rmallocL92_pani((c_rmfreeL113_printf_wakeup@ikH% X O Y"2i  `T` Ь[Z2&PP[ ݬZpZZ^Ь[ЬZZ ZPxPPP 4XZ1ȭZPP _zzzzzVzuukzuu\ҭPPPPPPYxYYҭPPPPPPYYXX Xʏ3XPPYPPBP1[1ˏ+PɏPڮn^1  ZPPRRRR 21[\ 1 [ЎPj2 [ЎP[1XZ+pDPѫlP [jʭYPڎ ʭZ[X1h ZPP \2իL [X1#իL2 [1w ^i[Ы ʫ ʏ3խPݭ PPPPZZPxPʭZ , '[~2iP ߘZJPPPmPhZPP[P1UZPP0NNNpPѫlP [1 [ ~1 1Ь[ ݫlp ݫl^![ZZPxP W1JYaYY ;Z ZJY!PȭȭJPYZYZPP ZZ PZPPx PPPP$XLEP[ݏ+P[ݏ[P1<PʏPP鵫Lױ[2~[x Bx :}W[x #PPVx N[a[OPPx PPPѬPPìPP PPPPP[[Px PPPm[~yoP[Y~NP [P dZj UP ݪuP[4P*(ND=2(3Ъ 7Ъ+j  [PQ2(PQPPpP[[PPOxN41>qbP`ЎPOPTB;7(P1#ЎP[1[x[P@PРPYD1Щ

2:?GMRYbhznszh  _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_inode_inodeNINODE_ninode_rootdir_mpxip_text_textNTEXT_ntext_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_ipc_gsignalL150_psignalL160_u_Remrq_Setrq_stop_unsleep_setrun_issigL232_Swtch_procxmt_printfL274_wakeup_psigL281_panic_sendsig_exit_coreL315_schar_namei_maknode_access_itrunc_writei_iput_growL331_chksize_swpexpand_expand_ptraceL343_ipcreg_pfind_sleepL357_useracc_Fuword_chgprot_Suword@ikܫSAL | +2i (($ hI I J K L M N O (I ,I 0P 4Q <I @I DR HS PT TT XU \T dV hW lX pY xZ |[ \ ] ^ _ ` a b c d T e I f g T T T T k l m n o I I h p q r s t $u (v ,j 0w 4I 8x <y @z DI HI PI TI X{ \| `T dI hI pI tI x} |~ T T I L M    T I T T T T T I I I I   T T I     T T I      $I (I 0T 4T 8T <T @T DI HI PI TI X \ `T dT h p t x |    i I I   T T  V W    T    T  T T  Z [    T  T T T T T $T (I 0I 4I 8T <I @T DT HI P^ T_ X \ ` dT hT pT tT xT |T T I T T T T T T I T   T  T T T T T T T T T T e I   T T  T T T T T $T (T P TI X \ ` d h lI pI tI xT |T T T T T T T T T        I  I      I I I I I #,39BHQZbhow !,1:@GOW]h,q{  PH(x~ %,9AJQZfnv )5=ENZbnv`| $,5=FOW`hqy %.7@HQZckt} '0:CLT]e nu}_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_tthiwat_ttlowat_bdevsw_cdevsw_linesw_swdevt_text_textNTEXT_ntext_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_file_fileNFILE_nfile_inode_inodeNINODE_ninode_rootdir_mpxip_nulldev_hpstrategy_hpdump_htopen_htclose_htstrategy_htdump_upstrategy_updump_rkstrategy_rkdump_nodev_swstrategy_tmopen_tmclose_tmstrategy_tmdump_tsopen_tsclose_tsstrategy_tsdump_mtopen_mtclose_mtstrategy_mtdump_tuopen_tuclose_tustrategy_udopen_udstrategy_uddump_cons_dh11_dz_tty_cnopen_cnclose_cnread_cnwrite_cnioctl_dzopen_dzclose_dzread_dzwrite_dzioctl_dzstop_dzreset_syopen_syread_sywrite_syioctl_mmread_mmwrite_hpread_hpwrite_htread_htwrite_htioctl_swread_swwrite_flopen_flclose_flread_flwrite_mxopen_mxclose_mxread_mxwrite_mxioctl_rkread_rkwrite_rkreset_dhopen_dhclose_dhread_dhwrite_dhioctl_dhstop_dhreset_upread_upwrite_upreset_tmread_tmwrite_tmioctl_tmreset_lpopen_lpclose_lpwrite_lpreset_tsread_tswrite_tsioctl_tsreset_mtread_mtwrite_mtioctl_dnopen_dnclose_dnwrite_udread_udwrite_udreset_ttyopen_ttread_ttwrite_nullioctl_ttyinput_ttyrend_ntyopen_ntyclose_ntread_ntwrite_ntyinput_ntyrend_ttstart_mcread_mcwrite_nldisp_acctbuf_acctp_mem_no@ikLפ 9@i>> Џ^.PԀP^4!A0^._q RqE.߭j ߭P_9߭{PH9F9P29Ԭ)91ԭԭ:ѭ0ѭ9VE>.A P0QQP֭(EPЭQA`ЭAѭ2PP@x~--8Ѭ\ЬPݠ E,P-ЬPݠ0,Pi-P P 2S-Q- I-@-;-5-D&-D--`-8<6@PP2@'<&@PP~@?- CCԭ7PЭQA`7ݭ'nC֭ЭP~~PͤQA`͜͜0͜7">͜+B͜0͜PͤQQQxQPPЭP֭P[pPPXPdp[h2l[-p[ZԭZ~ݬPЭPˏXW2GPPXWG|WJJP P@cYիXѫX ЫXP@ sЫXP2@P2QQPPX^Ь[ЫTЫdxPxPPIQP`PQxQQQPgPЭQA`P P@ЭPӏ@ ЭP2$ЭPЭQ2PPQЭP2PPQRPRRQЭPЭQ2aQQPЭQ2aQQPRQRRPЭPЭ(xPPЭQPݬ[XЭPӏӏ@@ЭPˏ~ЭPˏ~ݭݭݭ_PPЫlP^Ь[xTPxPPPP`PˏTQxQQQPYԭЭPˏQ2@PPQ֭ЭP@xT~: i[JЫXZ(l[5PЏXX[ZPZPЬ[[^Ь[xTPxPP;OP`PˏTQxQQQPWY2ZW gZ$ΫlѬ gPѬѬݬ[gWЧXЧX gXX gPˏ~ˏX~hY PY[1@Y j2PlP Ь[ЫZZ ^Ь[xTPxPPNP`xTP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ЫTYXWxYZ[PΫlPPѬZP)ѬZPѬ  ZPPPɬZPPP<ݭ[5>((Y Y[P`PˏTQxQQQPWZѬѬ0Ыlԧݬ[ˏYYX2VV.ΫlPxPPȬPP0ˏYЧˏ,XXPPS$SS$$$$$$$$$$$gˏ~2@DVVӏDPPˏ~Z Z1Z iЫlP ^Ь["xTPxPP/=P ~QQ`yF)FBBAPFB<P'PSFP2PP QPP .FPxPP2PP QP P@F{EPEoEEpP  ˏTPP~E =PիXѫXЫXP@W  ЫXP@8 X^/E2)(n)A2,*hphtuptmhktsmtra&vd62M2R%s1 JTJ2" 7t2 `72/d2/2d22 @v2unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry DR2 `74 @7 5up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPE0123456789abcdef`       @ ` ` rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry Pte error: er=%bILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17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PЫdTǏBPPPPPPPPPQQQPQQjZjZ2PxPP2QPQQxlPPPPxPʏPɏPѬjZ2 PPݭ[2jPPXV2 ~2~2~2~2~jZ5ѭ ]P֭1խ XЫlPЬ[k Ь[[1ЫXZԫl[ZPZPЬ[[^Ь[xTPxPP)P QQ`WЫTYXWxYZ[PΫlPPѬZP)ѬZPѬ  ZPPPɬZPPP<ݭ[5/RA/!P!!D/TG/ $" $J/H&x%6&M/)'hphtuptmhktsmtra&vd62M2R%s1 JTJ2" 7/ `7//p///p/2 @v/unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry DR2 `72 @72up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPE0123456789abcdef`       @ ` ` rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry Pte error: er=%bILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIES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0YPЬQ((`a0Y~((0(*ԩlԩԩԩ&ԩ ԩL1 , [# 2(CPxPPȏPP1pYYF1AZ [P ЎPPU1(Hf(HLbXPYZ[& Z[Z$AYp[[dZ sQZ FÏp:PZPY0 լc?[ݬP"2(\Y2( P P[/[[[&[PPPZZPx PPP +Z~JP{-Z~$PZexeceexeca rmallocexitinit diedproca d %e :a Ba pf }a f a a a a a a g a a a a a &a +a 1a ?a V& ]h lra yi a a a a a a a 8a Pj Xk _e l m m a a En Ra Xa go p  q p a  a - 5s Ko ya t t o  u v /t Lt ]t dqo & x j a a \ a ] a a a Uz b( ga p( ua {a a { a a | a a a } a ~ a a a a !a *a /a < Ia Pa Ua [a `a ig u a a a a  a a a a a  a a $a 1a [a ia ya a a a a a a  a a a a a a  $ a Q ] a m | } } ~ a a a a j a a a j a  a  a  " O - B - S , b , k , | - - -  l  l a a - -  - % } C N ] k . w } a  a a  a -  a  a ! a ? a F M ) a a . a a a a a a  ~  (  a # ( ( a . a 4 a : a @ a G { Q a [ h - a .  a . a a a a  a !a ' ,a 3a <a Ba Qa ]a ea ra a a a a a a z a a a a {  #,39BHQZbhow!,5?GRHY(_xel~u{,&,3:t?tEtJ(QZcnw~  %,3;BKSY`gow*  ( /4 :?FLT[cjq w|  ` H _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_swapmap_nswapmap_argmap_kernelmap_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_inode_inodeNINODE_ninode_rootdir_mpxip_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_text_textNTEXT_ntext_file_fileNFILE_nfile_execL158_u_execeL163_uchar_namei_access_readi_rmalloc_swkill_iput_schar_panic_Fuword_Fubyte_brelse_bdwrite_getblk_getxfile_baddr_Suword_bread_Subyte_setregs_rmfreeL262_chksize_swpexpand_vrelvm_wakeup_sleep_vgetvm_xalloc_vinifod_psignalL295_closef_rexitL320_exitL325_plock_acct_vrelpt_vrelu_vmsadd_spgrp_Swtch_waitL370_wait1_CopyoutL378_Setjmp_forkL395_fork1L401_tablefull_vsexpand_newproc_sbreakL421_expand@ikߪ!  pptȪ((@ikr'! p+tȪ@ikwM `gf+iȪ /dev/hk0a:/:rw:1:1 /dev/hk0g:/usr:rw:1:3 /dev/hk1a:/mnt:rw:1:2 /dev/hk1g:/usr/src:rw:1:3 /dev/hk1a:/tmp:xx:1:2 /dev/hk1g:/mnt:xx:1:3 @ik⬨! ootȪ@ik󚨀a n+mtȪ@ik9qHq o$2i lHYթi iP@[ kЩЩ{P &1ЎPPvvk [xgЫZkOЫE j ZHjjZ9 jj jZ!k PPPPYթi iP@[ kЩЩx~P &.ЎPPsvk [ugЫZkLЫB j ZEjjZ6 jj jZk PPPP^Ь[WէgPZ[P2jQPQ ЧЧioP *ЎPPd1r1hj[ Z]1SZQ1GЪYj'Ъ<PʏPP;ӏ1,ӏP i Yii<PʏPP1jP P~rPXvP PPP[1Э}h\h hJ2=hh hh hPP P P~#YXխ1{x PP1[P P~ݭPݭXtQPZ Go Np YZ lt v v Z Z Z w _ x 1Z Ay GZ UZ az jZ tf Z Z Z } Z f Z Z Z o p + A G P c_ kZ so zp Z z Z Z z Z  Z z Z  o p Z Z t =z FZ MZ TZ [Z `Z fZ kZ so zp v v v z Z Z #,39BHQZbhow!,H3(((9x?FLW^erzttt(!*3<FPU^dks{,~ #(.7?GLV_ e jqx: f   B_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_file_fileNFILE_nfile_inode_inodeNINODE_ninode_rootdir_mpxip_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_pidhash_proc_procNPROC_nproc_qs_whichqs_readL151_u_Setjmp_readp_sleep_readi_wakeup_writeL177_writep_writei_vrdwrL200_getf_useracc_vtopte_tbiscl_min_vmemfree_vinifod_openL244_uchar_namei_open1_creatL251_maknodeL259_access_itrunc_falloc_openi_iput_closeL279_closef_seekL287_linkL297_suser_iupdat_wdir_mknodL314_saccessL325@ik`b * G$2i H ZjP[kЫPPPݪݫ7 ZP[ݪ[ [ ^Ь[Fky[pఫⰫ䰫氫 谫 2PPì <PPP~2~-PYЩZ<PPPQxQQQPQxQPPZЪ4Ъ8Ъ"   N@&+27<C0J OTV [ckt y  _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_inode_inodeNINODE_ninode_rootdir_mpxip_pidhash_proc_procNPROC_nproc_qs_whichqs_gtimeL91_uudiv_clkset_ftimeL99_Copyout_stimeL110_suser_setuidL117_getuidL123_setgidL128_getgidL134_getpidL139_syncL144_update_niceL150_setpri_unlinkL159_uchar_namei_iget_xrele_writei_iput_chdirL176_chdirec_chrootL182L187_access_prele_plock_chmodL200_owner_chownL208_ssigL214_pause_killL232_pfind_psignal_inferior_timesL257_profilL263_alarmL268L272_sleep_umaskL281_utimeL286_Copyin_iupdat_setpgrpL296_spgrpL307L328_rebootL337_boot_syslockL344@i kUJ ( %2i % & ' ( $) ,* 4+ <, D- L. T/ \0 d1 l2 t3 |4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H $I ,J 4K <L D% LM TN \O dP l% tQ |R S % % T U V W X Y % % Z [ \ % % % % ] ^ $_ ,` 4a <b Dc L% T% \% dd le t% |% % % % % % f % % % % % % % % % % % % % % $% ,% 4% <% D% L% T% \g d% l% t% |% % % % % % % % h % % % i % % % % #,39BHQZbhow!,4;BHNU[bhou}#)06<ENSY`hp((x~ $,2_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_sysent_nosys_rexit_fork_read_write_open_close_wait_creat_link_unlink_exec_chdir_gtime_mknod_chmod_chown_sbreak_stat_seek_getpid_smount_sumount_setuid_getuid_stime_ptrace_alarm_fstat_pause_utime_stty_gtty_saccess_nice_ftime_sync_kill_nullsys_setpgrp_dup_pipe_times_profil_setgid_getgid_ssig_sysacct_sysphys_syslock_ioctl_reboot_mpxchan_exece_umask_chroot_vfork_vread_vwrite_segalloc_segfree_segsync_vadvise_vhangup_vlimit_vswapon_vtimes_resuba_futz@i k<~T %2i 0P PРP[[AЫDKRtWt]tb(ir{!)0 58Z?@HRY_fow| `   $ )27>C_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_swapmap_nswapmap_argmap_kernelmap_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_text_textNTEXT_ntext_inode_inodeNINODE_ninode_rootdir_mpxip_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_xfreeL161_u_xlock_xunlink_vmemfree_panic_iput_sleep_vsxfree_xccdec_xallocL183_xwait_xlink_xunlock_tablefull_psignal_vsxalloc_swkill_settprot_readiL211L217L221_wakeupL227_vsswap_swap_xumountL241_xuntext_xreleL251L260L267_vinitptL273_xreplL285@i  k6( I_ %2i&& <Hp^\[ˏPP [ЬPP !DDDDDDDDDDDDDDDDDDDh vgݬݬ ݬwpc ZZ(QYթ ˩P,P! PYЎP~Aέ~ݫ  Z1]ˏPɏPڮn^dP 1:ݬq;P 1Ь Z1ݫJP1ݬ 9P Z1P"Zݬ ZѬ 1Z1Z1Ь 1"^\[}ˏPP [ZgѬ ? P~@XXZЎPpPYZYP~@^XxhPPY Yj  1(Yj*ЫЎP PG 6(Э8 &{sxt`Wէ ˧PqPf [PWЎPH~@έ~dݫ(( dtrap type %d, code = %x, pc = %x trapptable faultsyscall 1 *1 2 3 1 4 1 5 6  7 8 1 1 1 '9 / 91 J1 W1 h1 w1 1 9 1 1 : : 3 1 ; 1 1 '1 AH3 O1 Z1 w. . > . 1 1 1 1 1 1 1 1 1 @ 1 1 1 1 $1 41 >A F1 N1 \1 d1 l1 5 6  7 8 1 1 1 9  1 #,39BHQZbhow!,H3(9x?F~OU`gkt|_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_sysent_trapL94_u_printf_panic_psignal_issig_psig_Setrq_Swtch_addupc_grow_pagein_syscallL141_Fuwordok_Setjmp_dorti_nosysL167_nullsysL172@i k~G&2i #,39BHQZbhow!,H3(9x?FtKtQtV(]_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_cnt_rate_sum_total@ik~O3'K: } n k '2i <^MЬP PPPXX[X0XX[PZj cj1jPѭfjPP~zP PoP?ݫP]X[RPZj j~:X1WjPP~P P P j~EѭaЫPP@jjj jPP ѭZXݫPg j~X<j5dX[ePЭЭЭ̭ȰP1jju'X[(Pѭ ѭ&իP ЫPPР~6PPݭ2%~ѭ%WW~ Wѭ151'[ЭP@ ЭP@,ЭP@ L ݭ2~P1jˏjjj jPP XLݏx X~ЭPݠ( ^ݭ'jȭj1P fݭѭ P PPP߭ZX[ PXX[PЭЭPPj jPP 2~ݏ@x ~x X~x~[l|xPPxݭ[HPZj jPP ѭ&ZݭݫP ЫPPFݫP X[PZW1jPP~P PPЭPѭ-ЭPQ!խW ݭ2~ݭ֭X j~~Xѭ <ZYXPXZWW1I  o/*bѭ\ë0PPPx ~PPPP~['x~PPPP~[ ^լ Ԭ PЬQP4 QPì4PP ԭ1~ЬPPQx0QQXPxQQPZj1UjPjPZP~QP PFP[kjjjj jPP jjPjj1P1j~j jjj jPP ЬP,߭ZЬP0~ݬxPlݭݬkPj~2\~ݏ x ~x ~ݭݬ<!ЬP<Z }ѭ 1x^PPPP~Pԭԭ PPYi1%PPhPcQQQYQPQ FhShhh hPP PPXݭZ ӏ  ѫ<@1PP1PQQPѫ$**2iKiKi /* param.c 4.2 81/04/02 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/text.h" #include "../h/inode.h" #include "../h/file.h" #include "../h/callout.h" #include "../h/clist.h" #include "../h/cmap.h" /* * System parameter formulae. * * This file is copied into each directory where we compile * the kernel; it should be modified there to suit local taste * if necessary. * * Compiled with -DHZ=xx -DTIMEZONE=x -DDST=x -DMAXUSERS=xx */ int hz = HZ; int timezone = TIMEZONE; int dstflag = DST; #define NPROC (20 + 8 * MAXUSERS) int nproc = NPROC; int ntext = 24 + MAXUSERS; int ninode = (NPROC + 16 + MAXUSERS) + 32; int nfile = 8 * (NPROC + 16 + MAXUSERS) / 10 + 32; int ncallout = 16 + MAXUSERS; int nclist = 100 + 16 * MAXUSERS; /* * These are initialized at bootstrap time * to values dependent on memory size */ int nbuf, nswbuf; /* * These have to be allocated somewhere; allocating * them here forces loader errors if this file is omitted. */ struct proc *proc, *procNPROC; struct text *text, *textNTEXT; struct inode *inode, *inodeNINODE; struct file *file, *fileNFILE; struct callout *callout; struct cblock *cfree; struct buf *buf, *swbuf; short *swsize; int *swpf; char *buffers; struct cmap *cmap, *ecmap; @ika nntȪ((@i k7)F7 Э[1 Ϩ@1í[PƏpPďpPP~ϕ7~ό7 ~ς72,~z7 ~r7ϴݫk7Ϩ2$~c7ϛ~[7ώ~S7ρ~K7t~C7g2&~;7Z2(~37M2*~+7@??PPƏPxPPϺ?P~@?!߭2?ϭ,PPx PP P~6ݫ<6ݫD684~6L~϶6ϲk~ϭ6ϤP~ϣ6ϕݫTϜ6ωϚ6πp[ŏpPP[P1K ^n6R>33,3h>!ݏ`U>+?6ZZI21Ϝ> 222>Ͽ >π+'6ϕ2=ϔ ݏ=Q+[PP[PǏ`P~[`[Pŏ`QQP[PʕϠ2= ϖ2τ2ω2q= b=*ϑ5$R2F=ݏ3=Ϯ*[PP[PǏ`P~[`[Pŏ`QQP[Pݬ05϶Ь[APP1!ի 1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  YYX ZYYXZYZ~hPY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[" Ь[Z = 8[ePZ~9PZ ݫ[ ԫ kZP{hP^߭ݬDPPP8(ݬݏ tݬݬݏtݬ6Ь[ѬP ѫѫk֫k׫ЫP`P.,Pr(PjdgUX~*PYA[Fk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [(PPYPƏPxPbPZxPZPPZx~@PZZZPZPxPZPPjjk(P_1xYP[PLZE=@k1*k[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPq@j~\S^\_P((CЬPЬPЬRRQ{RPPR PRPPPPlDDDDDDDDDDDDDDDDDE EEE"E)E1E/vmcore%xCan't find %s no namelist %3d/%3d inodes %d/%d active inodes LOC FLAGS CNT DEVICE INO MODE NLK UID SIZE/DEV %8.1x %4d%4d,%3d%6d%6x%4d%4d%6d,%3d%10ld %c %3d/%3d texts %d/%d active texts LOC FLAGS DADDR CADDR RSS SIZE IPTR CNT CCNT %8.1x %5x%11x%5d%5d%10.1x%5d%5d %3d/%3d processes %d/%d processes LOC S F POIP PRI SIG UID SLP TIM CPU NI PGRP PID PPID ADDR RSS SRSS SIZE WCHAN LINK TEXTP CLKT %8x %2d %4x %4d %3d %8x %4d %3d %3d %4d %3d %6d %6d %6d %8x %4x %4x %5x %7x %7x %7x %u 1 cons # RAW CAN OUT MODE ADDR DEL COL STATE PGRP DISC %d dz lines %d dh lines %2d%4d%4d%4d%4d%4d%4d%4d%8.1o %8.1x%3d%4d %6d ntty net pcb %x arg %.1x %9.1x segflg %d error %d uids %d,%d,%d,%d procp %.1x ap %.1x r_val? %.1x %.1x base, count, offset %.1x %.1x %ld cdir rdir %.1x %.1x dbuf %.14s dirp %.1x dent %d %.14s pdir %.1o file %9.1x %9.1x pofile %9.1x %9.1x ssav %9.1x sigs %.1x code %.1x ar0 %.1x prof %X %X %X %X eosys %d sep %d ttyp %.1x ttyd %d,%d exdata %.1D comm %.14s start %D acflag %D fpflag %D cmask %D sizes %.1x %.1x %.1x vm %D cvm %D %3d/%3d files %d/%d open files LOC FLG CNT INO OFFS %8x %4d%9.1x %ld %3d/%3d 00k swap %d used (%d text), %d free, %d missing CHAN FLAGS INDEX LINE GROUP FILE TTYP CTLX PGRP OTTYP OLINE DATQ CTLY %3d %8x %3d %8x %8x %8x %8x %6d %8x %3d %8x %8x CHAN FLAGS INDEX LINE GROUP FILE TTYP CTLX PGRP %3d %8x %3d %8x %8x %8x %8x %6d GROUP STATE INDEX ROT *GROUP *INODE *FILE ROTM DATQ %3d %8x %8x %3d %8x %8x %8x %3d %3d @(#)pstat.c 4.9 (Berkeley) 5/7/81/dev/kmem/vmunix_inode_text_proc_dz_tty_dz_cnt_cons_file_Usrptmap_usrpt_nswap_swapmap_dh11_ndh11_groups_chans_schans_nproc_ntext_nfile_ninode_nswapmapr  AAAAAABBBBBB LLG@P@i8 kok Z888 stty dec set noglob; eval `tset -s` unset noglob set path=(/etc /usr/ucb /bin /usr/bin .) @i:#kЉ!  ++tȪ@i;$kЉ!  ++tȪ@i<%k Љ!  ++tȪ@i=&ka nntȪ((@i>'kla  otȪ@i?(kω! ++uȪ@i@)kω! ++uȪ@iA*kω! ++uȪ@iB+kω! ++uȪ@iC,kω!  ++uȪ@iD-kω!  ++uȪ@iE.kM )`gq+iȪ /dev/hp0a:/:rw:1:1 /dev/hp0g:/usr:rw:1:2 @iG/k&7 % lI<4<4< (( ,^Юn PPՀPpPP P1d׬լЬP`JP׬լЬP`*P׬լЬP` Po׬bXZH>ݏD eP3Pďď}P1*PP PݏIethPݏP:IBPPP7PP,ݏW_ VP*ǏPPݏ[&ݏkFP(ǏPPݏrݏy1ݏ1Ь[ZYk94 ZPQPQ0QZY[[kPP P P+P-k0YZPZP [P@X[ݬQPZZݬt[$P[P 0@Xb|$0BQap".AError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too largex\~ݬoPP Ь[ZZZP   !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj ~P   BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[1xݏPZZ  YYX ZYYXZYZ~(PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP$[ [[[N  Ь[Z = 8[ePZ~9PZ ݫ ԫ kZP{(P^߭ݬDPPPݬݏ tݬݬݏtݬ6`."R"JDG58~*PY![&k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ ["PYPƏPxPbPZxPZPPZx~@PZZZunPZPaxbPZPPjjK"?1xYP[P,Z% k k[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPQ@j(~\S^\_ PCЬPЬPЬRRQ{RPPR PRPPPPB.from %s to %s, %d groups of %d blocks offset %d seek 0seek 1%d read block %d: read 0write block %d: write 1DONE! /dev/rup0h/dev/rhp0cUnknown error: #," r<q%x.T7~|@$HQf Zya h p0yP`p7DT~<r  Y PpqT ; P &-`3D: AKxX$|`.f~&oTvf 30 L>y p74 ,"crt0.oupdcopy.oatoi.operror.oerrlst.oprintf.ostrlen.olseek.odoprnt.oflsbuf.oexit.odata.oclose.oisatty.oopen.oread.ostty.oioctl.omalloc.osbrk.oudiv.owrite.ocerror.o_exitstart_main_environ_from_to_buf_bsize_start_count_atoi_printf_close_open_perror_sbrk_lseek_read_write_errno_sys_nerr_sys_errlist_strlen__iob__doprntcerror__flsbuf_isatty__sobuf_malloc_fflush__cleanup_fclose__lastbuf_free__sibuf_gtty_stty_ioctludiv_realloc_end_brk((@iR0kMբ @c<c<c< /usrhk0g@iT1k|M!  K,h+tȪ@iU2kω! ++uȪ@iV3kω!  ++uȪ@iW4kV cH G<LOLO echo 'erase ^?, kill ^U, intr ^C' stty dec prterase PATH=/etc:/usr/ucb:/bin:/usr/bin:. export PATH @iY5k& 9K 0b0b set path=(/etc /usr/ucb /bin /usr/bin .) set history=100 @i[6k H F<F< ((@i\<kYt bIs<s<s< #include char *from = "/dev/rrp0c"; char *to = "/dev/rrp1c"; char *buf; int bsize = 19*22; int start = 0; int count = 815; main(argc, argv) int argc; char **argv; { argc--, argv++; if (argc > 0) start = atoi(*argv++), argc--; if (argc > 0) bsize = atoi(*argv++), argc--; if (argc > 0) count = atoi(*argv++), argc--; fprintf(stderr, "from %s to %s, %d groups of %d blocks offset %d\n", from, to, count, bsize, start); close(0); if (open(from, 0) != 0) perror(from), exit(1); close(1); if (open(to, 1) != 1) perror(to), exit(1); start *= 512; bsize *= 512; buf = (char *)sbrk(bsize); while (count > 0) { if (lseek(0, start, 0) < 0) perror("seek 0"), exit(1); if (lseek(1, start, 0) < 0) perror("seek 1"), exit(1); if (count % 25 == 0) fprintf(stderr, "%d\n", count); if (read(0, buf, bsize) != bsize) { fprintf(stderr, "read block %d: ", start / 512); perror("read 0"); } else if (write(1, buf, bsize) != bsize) { fprintf(stderr, "write block %d: ", start / 512); perror("write 1"); } start += bsize; count--; } fprintf(stderr, "DONE!\n"); } @i_CkΉ! ++tȪ@i`DkΉ!  ++tȪ@iaFka tȪ@ibGk9# FQ  }cȪ $p^Юn PPՀPpPPÏQQQQQQl Qݏ,QQP-P P<|P#bYPNo space for monitor buffer $*/ S f l ry      ~%/6r?ISZstart_monitor_sbrk_main_exit_IEH3exit_etext_environ__cleanupcountbase_write@idIk5U.       # & ) , h6 6  ! __.SYMDEF 363530555 0 27 100664 3782 `   2 (/6=ZDLT ^fov&}&&&&,...122l3(444788888& =->3?9??"CHDPDXtE`tEiFs G}*H*H*HK&MPTQFOX`hn$wܩ *бr> ..&ƶ,d2޷;CbJ޺Q|X@`ܼh|nu{VҿHHHH  ")0"7?nE KQHYadgdm8t{tt&zV00XB B!(/ 6 >_abort_abs_acct_alloca_atol_calloc_cfree_chdir_chmod_chown_chroot_chrtab_clearerr_setkey_encrypt_crypt_ctime_localtime_asctime_gmtime_dysize__error_execle_execlp_execvp_fabs_fgetc_fork_fputc_fputs_freopen_frexp_setfsent_endfsent_getfsent_getfsspec_getfsfile_ftell_gcvt_ecvt_fcvt_getchar_getcsw_getenv_getgid_getegid_getgrgid_getgrnam_setgrent_endgrent_getgrent_getlogin_getpass_fprintf_getpw_getpwnam_getpwuid_setpwent_endpwent_getpwent_atoi_fgets_gets_getuid_geteuid_getw_index_intss_itol_kill_l3tol_link_locv_ltod_dtol_ltoi_ltol3_makdirmcountcountbasemcountcountbase_mdate_mknod_mktemp_access_modf_monitor_mount_mpx_chan_join_connect_attach_detach_extract_debug_npgrp_ckill_mpxcall_nargs_exect_nice_nlist_fopen_creat_fseek_errno_sys_nerr_perror_sys_errlist_sys_nerr_popen_pclose_dup_dup2_fdopen_pipe_printf_profil_ptrace_putchar_puts_putw_qsort_srand_rand_fread_fwrite_re_comp_re_exec_cclass_backref_setexit_reset_rewind_rin_scanf_fscanf_sscanf__sctab__doscan__getccl__innum__instr_atof__ctype___filbuf_ldexp_setbuf_setgid_setuid_sleep_alarm_pause_setjmp_longjmp_stime_strcatn_strcmpn_strcpyn_strlen_strncat_strncmp_strncpy__strout_yyportlib_wdleng_swab_sync_syscall_system__exit_execl_execv_execve_signal_tell_lseek_time_ftime_times_timezone_tmpnam_getpid_getppid_sprintf__doprnt__flsbuf_fflush__cleanup_fclose_exit__sibuf__sobuf__iob__lastbuf_ttyslot_rindex_strcmp_ttyname_close_fstat_isatty_open_read_stat_strcat_strcpy_stty_gtty_ioctl_umask_umount_errno_ungetc_unlinkurem_utime_vadvise_valloc_malloc_free_realloc_sbrk_brkudiv_vfork_vhangup_vlimit_vread_vtimes_vwait_vwrite_wait_writecerror_errnocerror_errnoabort.o 363529523 0 27 100775 63 `  P _abort abs.o 363529525 0 27 100775 65 `  ЬPPP _abs acct.o 363529530 0 27 100775 97 ` 3   _acctcerror alloca.o 363529535 0 27 100775 84 `  ¬^ЭQ}\^^^Pa _allocaatol.o 363529716 0 27 100775 146 ` \ ^Ь[ԭZk96 PQPQ0QZ[[kPP P P+P-k0ZέPЭPt _atolcalloc.o 363529721 0 27 100775 226 ` H<ĬݬP[P[Z~PYԊY[Pݬ  & @ k 8 y&_calloc_mallocudiv_cfree_freechdir.o 363529539 0 27 100775 98 `  P  _chdircerrorchmod.o 363529542 0 27 100775 98 ` P   _chmodcerrorchown.o 363529544 0 27 100775 98 ` P , _chowncerrorchroot.o 363529546 0 27 100775 99 ` = ( _chrootcerror chrtab.o 363529731 0 27 100775 1592 `  $$~$$~$$>A@>A>ab#C8DH00IFF9    I**I~ @$BBBBBB$8D @@|~ D8 $D~|@@XdB$AAAA>"AAA#   @ @  @$BA@@@@@@A>~AAAAAAAA~~@@@x@@@@@@@|@@@@@>A@@OAAAA>AAAA~AAAAADD8ABDHPpHDBA@@@@@@@@@AcUIAAAAAAAaQIECAAAA>AAAAAAAA>~AAA~@@@@@>AAAAAAYE>~AAA~DBAAA>A@@>A>AAAAAAAAA>AAAAAAA"AAAAIIUcAAAA""AAAA" @@@ 88" <>BB>@@@@|BBBB|BBBB>BBBB>B>@@@@|BBBBB(@@@@FHPpHFvIIIII@|BBBBBBBBB>\b@@@@>@<B<~ BBBBB=AAA"IIIII6B$$BBBB" @~ ~   *~~~~~~~~~~ _chrtabclrerr.o 363529964 0 27 100775 70 `  Ь[0 _clearerrcrypt.o 363529744 0 27 100775 2564 ` $Hl$8^[ЬPKQQA`KNЬPKQQA`KS[[[YH$ZJJZ"ZJJ ZYYPKHQPQZJIP0[QQ@JaJEP0[QQZQ@ZZ[[1V^ZЬPJ(QQA`J @ZԭլíЭZJ J ZZJc P0QQ@ PJaQQPPJ 0ZZZ[K PxZQLQK RxRRK SxSSSRK SxSSSRK SSSSRK SxSSSRRQxPP@aYxZPP[YPPKL YPPK@ YPPK4 xYPPPPK$ ZZ1NZJ&P@ PJQQPPJ ZZJJ Z֭ѭ1ZJf[J~JX[Jp ZZJP@:J@Z^[KB[[1[@.ZZPPPxPYPPPPKZ[Z[֬Y[KwB[[KK0[[Y֬YKYZYY9Y.YZZPxPYPP;[PZP@:[PZP[QZQ@;A[PZP@%ZZ[[[4[[YZxYY[PZP@PPYZ.YY9YYZYYK[[ K P:2*" <4,$ >6.&@80( 91)! ;3+# =5-% ?7/'(08@ '/7?&.6>%- 5=$, 4<#+ 3;"* 2:!) 1991)! :2*" ;3+# <4,$?7/'>6.&=5-%      )4%/7(3-!0,1'8"5.*2$                                                                                                                                     %1DOUagrx*0=IQar}"*2>KQjrx  5f}  _setkey_encrypt_cryptctime.o 363529754 0 27 100775 1486 ` @Hݬ P5^߭2P .!)1((7=FLNW__getpass_open_fdopen__iob_setbuf_signal_gtty_stty_fprintf_fflush__filbuf_fclose fprintf.o 363530028 0 27 100775 122 ` $ݬ \~ݬЬP PP  ~_fprintf__doprntgetpw.o 363530097 0 27 100775 427 ` 0`PPЬY ZZ{PРQ֠aP hPZP ĔЬY[[ZZ:Z ZZ:Z0Z9 [PZP0P[[1zP/etc/passwdr  &29 QYls c t#_getpw_fopen_rewind__filbuf getpwnam.o 363530107 0 27 100775 224 ` 0< P[kݬP[P   ( "*4_getpwnam_setpwent_getpwent_strcmp_endpwentgetpwuid.o 363530112 0 27 100775 192 ` ,0 Ь[PZѪ[ZP   " ",_getpwuid_setpwent_getpwent_endpwentgetpwent.o 363530103 0 27 100775 890 ` l(`0tpVPX P@8+Ь[k:[kk[PsPPݏNP[[[P[[[xP[[P[\P[[Pc[/P[[s[P[[d[ P[[Uk [kk P/etc/passwdrr  (/ 8@G Mt|     )2<EOdt4'/p9+@qF_setpwent_fopen_rewind_endpwent_fclose_getpwent_fgets_atoiatoi.o 363529712 0 27 100775 138 ` T Ь[ZYk94 ZPQPQ0QZY[[kPP P P+P-k0YZPZPq _atoifgets.o 363530007 0 27 100775 160 ` LЬ [ЬY׬&k ЫP֫`P [PZZZ Z YPЬP$ + _fgets__filbufgets.o 363530117 0 27 100775 217 ` T$( ЬZ[2[P`P P[P [ ZPЬP   + 2 y ._gets__iob__filbuf getuid.o 363529581 0 27 100775 93 ` QP _getuid_geteuid getw.o 363530121 0 27 100775 147 ` @^Ь[ޭYZk ЫP֫`P [PZ PЭP' } _getw__filbuf index.o 363529794 0 27 100775 79 `  Ь[k[PPv _index intss.o 363530125 0 27 100775 129 ` $~   .3_intss__iob_isatty itol.o 363529586 0 27 100775 74 `  xPˏQQP _itolkill.o 363529588 0 27 100775 97 ` %P  _killcerror l3tol.o 363529804 0 27 100775 91 ` $ ЬZЬY[ [[  _l3tol link.o 363529591 0 27 100775 97 `  P  _linkcerror locv.o 363529593 0 27 100775 134 ` $ ^ n8 n; QPD _locvltod.o 363529599 0 27 100775 88 ` nPj  _ltod_dtolltoi.o 363529602 0 27 100775 62 `  ЬP _ltoiltol3.o 363529811 0 27 100775 91 ` $ ЬZЬY[ Y[[  _ltol3 makdir.o 363529604 0 27 100775 99 ` P  _makdircerror mcount.o 363529511 0 27 100775 125 `  `QaQnQ`    mcountcountbase mcount.o 363529605 0 27 100775 125 `  `QaQnQ`    mcountcountbase mdate.o 363529608 0 27 100775 98 ` P e _mdatecerrormknod.o 363529610 0 27 100775 98 ` P  _mknodcerrormktemp.o 363529822 0 27 100775 286 ` p<(PZЬ[[ Z0PPk ZPZ{X[aYYzPYkYݬPЬP/  0 Pc x p&_mktemp_getpiduremudiv_accessaccess.o 363529527 0 27 100775 99 ` !  _accesscerror modf.o 363529824 0 27 100775 78 `  tRPnR cP  _modfmon.o 363529828 0 27 100775 446 ` <XլDݏP[[[Ь ЬЬ PЬ`Ь PЬЬ PЬxP P[[ PP [ìPxP[Ѭ[nPn[RfRPd!PjP[<[[ݬݬݬ 4Hmon.out % .4= F OW  .#;*_monitor_profil_creat_write_closemount.o 363529613 0 27 100775 98 ` P  _mountcerrormpx.o 363529837 0 27 100775 973 ` |Xլ% ЬhЬlZЬL:Ь.Ь*Ь ЬЬ iЬЬGЬЬ%ЬЬЬtЬp^ ЬRЬNЬ J4 Ь(Ь$Ь ' 8>G RZ`i t|    # .6>DM X`hnw  V:2Ltn'\/7@G(NRU_mpx_mpxcall_chan_join_connect_attach_detach_extract_debug_npgrp_ckill mpxcall.o 363529615 0 27 100775 100 ` 8 V _mpxcallcerrornargs.o 363529617 0 27 100775 63 `  P _nargs nexect.o 363529620 0 27 100775 94 `  ;  _exectcerrornice.o 363529622 0 27 100775 97 ` "P  _nicecerror nlist.o 363529845 0 27 100775 683 ` TP^ЬZV0jP`-ԪjPWWW ZVj_ݬPPPݭ ߭ѭԏ"ѭԏѭԏ ݭePѭԏ 2P PPPPPЭYY12XYXYXݭݭ ݭXPWXXYZ Xj1PӏPyj~ݭݭ~Ь[EW GG4WGG%ЪVݭg1 [kP` Z1hr+ IS o    : P   $tN!;(e/7_nlist_strlen_fopen_fread_close_fseek_fclose fopen.o 363530024 0 27 100775 565 `  `XЬ[XXPX 鑫+PPPYkw+ݏݬPZY1ZZkalYPPPݬ{PZ FO X e mv  "*$29_errno_sys_nerr_sys_errlist_perror_strlen_write errlst.o 363529770 0 27 100664 1099 ` (8DVfx 1BQ`xError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large#  $(,048<@DHLPTX\`dhlptx|_sys_errlist_sys_nerr popen.o 363530131 0 27 100775 805 ` \P^߭PPrЭPЭPP[rЭPЭPPZPYR[rPPPZZݬmdY1kYKZGݬ[;^ЬP[P$PX PWPY߭PZPKQ ZZXWYЭP/bin/shsh-c  A O h q |     : E P  ?;X%z,3;ACKSY_popen_pipe_vfork_close_dup2_execl__exit_fdopen_pclose_fclose_signal_wait dup.o 363529554 0 27 100775 122 ` $@)  X_dup_dup2cerrorfdopen.o 363529998 0 27 100775 239 ` d0 Ь[ZZPZ jkr kaݬ +   ZP  G  .#_fdopen__iob__lastbuf_lseek pipe.o 363529626 0 27 100775 109 ` *ЬRPQbP  _pipecerror printf.o 363530135 0 27 100775 159 ` ($\~ݬPP    .~_printf__iob__doprnt prof.o 363529629 0 27 100775 64 `  , _profilptrace.o 363529632 0 27 100775 130 ` $  ) _ptracecerror_errnoputchar.o 363530139 0 27 100775 188 ` 4$(Ь[P[``P[   % .  .f_putchar__iob__flsbufputs.o 363530146 0 27 100775 273 ` d$P Ь[(PZ`ZZP ``P     # , 7 ? F T ]  .f_puts__iob__flsbuf putw.o 363530152 0 27 100775 143 ` <Ь[\ZYЫP֫`k[~Y PP&  f_putw__flsbuf qsort.o 363529855 0 27 100775 648 ` ЬЬ Ŭ PP~ݬ^YìPPPYxY~ݭPPYЭЬ[YZ+Yݭ[ݭ[0PPhY[[]ZYݭKZYݭ[YЭ[/ZݭPP[Z[pYZYZZ[>ìPíQPQݬY~Э1ݭݬY1[YݭZ2YЭZ14 ^OЬ[ЬZkj׭^)Ь[ЬZЬ Ykij׭#/N ~*?Zq` _qsortudivrand.o 363529859 0 27 100775 149 ` 0Ь&ŏmNAP90PPP$(  _srand_rand rdwr.o 363530159 0 27 100775 297 ` 0^Ь[ЬZԭլ05Ьj ЪP֪`P ZPYY׭֭ѭ ЭP^Ь[ЬZԭլ.3ЬYj ЪP֪` Z~wY ֭ѭ ЭP1  N [Rf%_fread__filbuf_fwrite__flsbuf regex.o 363529871 0 27 100775 1715 ` txL0H^Ь[Yԭԭޭ[k i^gPk^ [YԭPZ#ޭPѭPwԭ5P PZ*YZPP$FP*)P.P[=P\1Z11խ쑽摽 1gk 1]ZZ^ZZԭPZ-<7ZZ]-֭APPZPPPiY֭Y1Z֭YZZ]1ЭP1ZZ(,ѭ Sԭ(P֭֭1Z)+ޭPѭPԭP ׭ЭP`1]Z11Z:1ZPP1C^Ь[ZYII Y Z[Gj)YkPPYZ[*PЭPPZ[ P㕋 ^Ь[ЬZPPp*910AE[E7=~&&&&&PkP~ZaPjPPZ~ZGP1aP[@1{P[@1mЭP@1[PP1ЭPPQA@PP[1,ЭP@1E[YPQAh@[[ݭP[Y1Z[PЭP­[[Y4[YjZ([YPPP~ZMPjPPZ[Z[rP[Y1IЬ[ЬZKYYKPP Ь[PZZ Ь Pլ PPxRegular expression too longNo previous regular expressionunmatched \(missing ]too many \(\) pairsunmatched \) )8BIQZqz Rd *7Tq -=RXn +9 wF'_re_comp_re_exec_cclass_backref reset.o 363529636 0 27 100775 200 ` D(<P}V}X}Z}Э`PЬPQ}V}X}Z}\Ё^* "_setexit_resetrew.o 363530168 0 27 100775 163 ` 4$Ь[[~kЫ0       L_rewind_fflush_lseek rin.o 363529876 0 27 100775 427 `  <X^pY[P`P PZZZ-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RU=;Q yPPRyPPRQQVW{VQWPVW{ VPVPPVPRUQyPPRyPPPPnPVnQPdP`VPSrPPRpP~zk n x_atof_ldexp ctype_.o 363529758 0 27 100775 189 `   AAAAAABBBBBB  __ctype_ filbuf.o 363530011 0 27 100775 385 ` <8Ь[  P ݏP ի ߘP@z [  P2PPݫ~qPkЫk!k    k1WP֫' FU ^ e l   .L#)__filbuf_malloc__iob_fflush_read ldexp.o 363529806 0 27 100775 162 ` @pPPR RR RP|PpPrPP"(8  x_errno_ldexpsetbuf.o 363530179 0 27 100775 138 ` 8Ь[ի ݫ Ь Ыk  y_setbuf_freesetgid.o 363529641 0 27 100775 99 ` .P  _setgidcerror setuid.o 363529646 0 27 100775 99 ` P  _setuidcerror sleep.o 363529885 0 27 100775 398 ` (HX^ԭլݏPwPݭݭխѭ¬ Э!Pݬye !( 8 B en |    ")2_sleep_alarm_setjmp_signal_pause_longjmpalarm.o 363529533 0 27 100775 86 `   _alarm_pausesetjmp.o 363529643 0 27 100775 145 ` DЬP}V}X}Z}Э`PЬPЬQ}V}X}Z}\Ё^PP _setjmp_longjmp stime.o 363529662 0 27 100775 102 ` мP  W _stimecerrorstrcatn.o 363529894 0 27 100775 97 ` ( Ь[ЬZЬ Y[X[Y{XPj _strcatn strcmpn.o 363529903 0 27 100775 105 ` 0 Ь[ЬZЬ YY kPYP kPzQQP _strcmpn strcpyn.o 363529911 0 27 100775 101 ` , Ь[ЬZ[XY YY  YXP _strcpyn strlen.o 363529914 0 27 100775 76 `  Ь[ZZZP$ _strlenstrncat.o 363529918 0 27 100775 97 ` ( Ь[ЬZЬ Y[X[Y{XP _strncat strncmp.o 363529922 0 27 100775 105 ` 0 Ь[ЬZЬ YY kPYP kPzQQP _strncmp strncpy.o 363529926 0 27 100775 101 ` , Ь[ЬZ[XY YY  YXP _strncpy strout.o 363530190 0 27 100775 274 `  ЬZЬ[ЬY.Y~Zi ЩP֩` Yݬ֬ լ 6k-Ѭ0iЩP֩`ЩP֩`iY~Z i ЩP֩` Yݬe׬ լ  7 u   f__strout__flsbufstuff.o 363530194 0 27 100775 91 `  P_yyportlib_wdleng swab.o 363529935 0 27 100775 98 ` , Ь[ЬZЬ YY2kPxPPkQQPP[Y _swabsync.o 363529667 0 27 100775 62 `  $  _syncsyscall.o 363529669 0 27 100775 108 ` ЬPlP  _syscallcerrorsystem.o 363530200 0 27 100775 415 ` HX ^P+ݬwݏP[PZ߭PP Pѭ[qZfЭP/bin/shsh-c %, 9 D R _    ?z!)/_system_vfork_execl__exit_signal_wait _exit.o 363529521 0 27 100775 63 `   __exit execl.o 363529556 0 27 100775 98 ` ݬ  z _execl_execvexecv.o 363529561 0 27 100775 136 ` $ݬݬ   r_execv_environ_execveexecve.o 363529562 0 27 100775 95 `  ;  _execvecerror signal.o 363529650 0 27 100775 99 ` 0  _signalcerror tell.o 363529939 0 27 100775 101 ` ݬ   _tell_lseek lseek.o 363529596 0 27 100775 98 `   _lseekcerrortime.o 363529670 0 27 100775 93 `  ЬQPa# _time_ftime times.o 363529672 0 27 100775 63 `  + _times timezone.o 363529944 0 27 100775 511 `  8X^['kլ իЫPլ իЫP [kլά<P F ~f_sprintf__doprnt__flsbuf doprnt.o 363529975 0 27 100775 2410 ` l  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX  .On9(U,FX~ f__doprnt__flsbufflsbuf.o 363530019 0 27 100775 923 ` ^Ь[    PPYYX1XX߭~PYj~P  BЫZ֫ZPѫPѬ ZPPXPZ~YPYZkn 1mЫZ3[1xݏ'PZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PPl[ [[[V Ь[Z = 8[ePZ~%PZ ݫ ԫ kZP; F N ] e     x     f .3" *2L2:DLV;]yc__flsbuf_write__iob_isatty__sobuf_malloc_fflush__cleanup_fclose__lastbuf_close_free exit.o 363529565 0 27 100775 96 `    _exit__cleanupdata.o 363529968 0 27 100775 464 ` D0@  @  .@$__sibuf__sobuf__iob__lastbufttyslot.o 363529954 0 27 100775 505 `  TpP[P[P[P/[PZ[ZZPXYX/P[Y[ZPX|YPXo@[[ݬUP1yk  kP[[/etc/ttys  # 6 JQ as     [$,;39_ttyslot_ttyname_rindex_open_strcmp_close_read rindex.o 363529880 0 27 100775 84 `  Ь[Zk[ZZP _rindexstrcmp.o 363529899 0 27 100775 88 `  Ь[ЬZkPkPzQQP _strcmpttyname.o 363529949 0 27 100775 549 `  lx^ݬPP߭ݬP;E_ttyname_isatty_fstat_open_read_strcpy_strcat_stat_close close.o 363529549 0 27 100775 98 ` P ; _closecerrorfstat.o 363529573 0 27 100775 98 ` P  _fstatcerrorisatty.o 363529799 0 27 100775 114 `  ^߭ݬPPP 3 _isatty_gttyopen.o 363529624 0 27 100775 97 `   _opencerror read.o 363529634 0 27 100775 97 `   _readcerror stat.o 363529656 0 27 100775 97 ` P  _statcerror strcat.o 363529890 0 27 100775 84 `  Ь[ЬZ[Y[YP _strcatstrcpy.o 363529906 0 27 100775 80 `  Ь[ЬZ[YYP! _strcpystty.o 363529931 0 27 100775 151 ` ,$ݬݏ tݬݬݏtݬ '  _stty_ioctl_gtty ioctl.o 363529583 0 27 100775 98 ` 6  _ioctlcerrorumask.o 363529674 0 27 100775 98 ` < 1 _umaskcerrorumount.o 363529675 0 27 100775 118 ` $P  _umountcerror_errnoungetc.o 363530209 0 27 100775 120 ` @ Ь[ѬP ѫѫk֫k׫ЫP`PA _ungetcunlink.o 363529677 0 27 100775 99 `  P u _unlinkcerror urem.o 363529516 0 27 100775 93 ` ( ЬPЬRRQ{RPRPPPRRP urem utime.o 363529680 0 27 100775 98 `  w _utimecerrorvadvise.o 363529683 0 27 100775 104 ` HP  5 _vadvisecerrorvalloc.o 363529958 0 27 100775 132 ` 0^~PPPˏPЭP  _valloc_mallocmalloc.o 363529818 0 27 100775 990 ` ,<0$.0, ~PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [,PYPƏPxP6PZxlPZPPZx\~PZZZ92PZP%x&PZPPjj,1xYP[PZkk[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~*PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j $)/4B KR  %,1@GOT[b{ # yl7&_mallocudiv_sbrk_free_reallocsbrk.o 363529639 0 27 100775 235 ` D00<~\S^\!PЬP (5 =  -_sbrk_endcerror_brk udiv.o 363529514 0 27 100775 93 ` ( ЬPЬRRQ{RPPR PRPP udiv vfork.o 363529687 0 27 100775 150 ` 4ЭRBQPPbPb$ ? _vfork_errnovhangup.o 363529690 0 27 100775 65 `  L _vhangup vlimit.o 363529692 0 27 100775 99 ` M  l _vlimitcerror vread.o 363529694 0 27 100775 98 ` C  N _vreadcerrorvtimes.o 363529696 0 27 100775 64 `  kE _vtimesvwait.o 363529699 0 27 100775 106 ` GլQ   _vwaitcerrorvwrite.o 363529701 0 27 100775 99 ` ((D   _vwritecerror wait.o 363529703 0 27 100775 105 ` լQ  _waitcerror write.o 363529705 0 27 100775 98 `   _writecerrorcerror.o 363529509 0 27 100775 94 `  PP  cerror_errnocerror.o 363529537 0 27 100775 94 `  PP  cerror_errno@iJk2z <}cȪ <0^Юn PPՀPpPPP$+ 4  ~r<_exitstart_main_environ@iKk;Ɣ!  +ytȪ@iLkf!  +WtȪ@iMk.e!  VVtȪ@iNk\! e]UtȪ@iPk2 <&i{{ as htboot.s nm -u a.out strip a.out dd if=a.out of=b.out bs=32 skip=1 11+0 records in 11+0 records out dd if=b.out of=htboot conv=sync 0+1 records in 1+0 records out as mtboot.s nm -u a.out strip a.out dd if=a.out of=b.out bs=32 skip=1 12+1 records in 12+1 records out dd if=b.out of=mtboot conv=sync 0+1 records in 1+0 records out as tmboot.s nm -u a.out strip a.out dd if=a.out of=b.out bs=32 skip=1 10+1 records in 10+1 records out dd if=b.out of=tmboot conv=sync 0+1 records in 1+0 records out as tsboot.s nm -u a.out strip a.out dd if=a.out of=b.out bs=32 skip=1 12+1 records in 12+1 records out dd if=b.out of=tsboot conv=sync 0+1 records in 1+0 records out as hpboot.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=b.out 15+1 records in 15+1 records out dd if=b.out of=hpboot conv=sync 0+1 records in 1+0 records out as hkboot.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=b.out 15+0 records in 15+0 records out dd if=b.out of=hkboot conv=sync 0+1 records in 1+0 records out as upboot.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=b.out 15+1 records in 15+1 records out dd if=b.out of=upboot conv=sync 0+1 records in 1+0 records out as utboot.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=b.out 12+1 records in 12+1 records out dd if=b.out of=utboot conv=sync 0+1 records in 1+0 records out echo | dd of=noboot conv=sync 0+1 records in 1+0 records out as httoggle.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=httoggle 2+1 records in 2+1 records out as mttoggle.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=mttoggle 2+1 records in 2+1 records out as tmtoggle.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=tmt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P ?P`xTPxPP>P`PˏTQxQQQPZЫhP PˏhlPP PЭ ɏ֭ЭPΫlPЭQPЭPЭ Ѭ19xPY>P`[xPPPPJ>PxPP6>^Ь[xTPxPP>P`PˏTQxQQQPYԭЭPˏQ2@PPQ֭ЭP@xT~N2@DXXӏD[2ЫXZl[ZPZPЬ[[Ь[xTPxPPJ=P`PˏTQxQQQPWZѬѬ0Ыlԧݬ[ˏYYX2VV.ΫlPxPPȬPP0ˏYЧˏ,XXPPS$SS$$$$$$$$$$$gˏ~w 2@DVVӏDPN Pˏ~i4 Z Z1Z v ЫlP Ь[xTPxPP<P eQQ`ZЫXP@Y իXѫX SЫXP2@1PŏBPX Z ^Ь[xTPxPP;P QQ`Zԭ[PЫdTǏBPPPPPPPPPQQQPQQjZjZ2PxPP2QPQQxlPPPPxPʏPɏPѬjZ2 PPݭ[2jPPX2 ~G2~2~2~2~i jZ5ѭ H P֭1խ , ЫlPЬ[k Ь[[1ЫXZԫl[ZPZPЬ[[^Ь[xTPxPP9P $QQ`WЫTYXWxYZ[PΫlPPѬZP)ѬZPѬ  ZPPPɬZPPP<ݭ[P ;PxPP2PPQPP@`;:PP;:;pPIˏTPP: =PիXѫXЫXP@ ЫXP@tX^:<@:?1yWPxPPPPPYP)խ ,XX X֭鑽 ֭jЭP֭`X1!XPX11Pd1Pc1 1PlXXPPo11Pu1Ps1|1Px11 ^Ѭ լ-Gάޭ[ݬݬ@ ݬݬPP֘{~ ޭP[PЬ[20uY"PY["PZ"[~#[  Z" P!~P[[  [[j[P Ь[*P#DP@ZP +PЬ[ 4PZZPP P  Z[[ڬ۬P(  ^Ь[ԭZk96 PQPQ0QZ[[kPP P P+P-k0ZέPЭPЬZЬY[ [[ ЬPЬRRQ{RPRPPPRRPЬPЬRRQ{RPPR PRPPl+`PЬSRbcPRb  &0^nls : %d %c null path %s not found bn negative bn ovf %D bn void %D bn void %D not a directory zero length directory Seek not from beginning of file No more file slotsBad device Unknown device Bad unit specifier Missing offset specification Can't write files yet.. Sorry Exit called%s Trap %o #H t < #j< #< #< #` N ##T>#Hx6hpuphkrahttmtsmt`       ((@ ` `&vd62M2R%s1 JTJ2" 7`$ `7p$/P$/$P$2 @v$unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry Anot a tape mt hard error: er=%b mt error: er=%b mt: unrecovered error mt: recovered by retry rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered b@iQkVմl+ g ( 5 eX/iiiy retry Pte error: er=%bILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOTts: unrecovered error ts: recovered by retry DR2 `7) @7)up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPEh >Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error 0123456789abcdef@iRkJp <&i'' ď[[Z[Џ]]^P(`mЏ@DЏPPЫDPP0T=P07TQ0P PTQYYЏ0V0]U)Yed/@U1<,<&V%VV1uVW 05WPP]\Ue1T8Pѭ+Vԭԫ,0Ы,RЫʏRRЏЏɏPԪ ԫЪ9kЫRʏRЏQQRPbP0)ЎPP֭ PP!PPPP  P P"RRPPP#@iSk_=&2)2iɟɟ 4@Ь[ЫPZ Z48P0PPƏPPPP.[P*[P[Z ZPu[YxYP@]QxYPP`RQR 4=YY0['Z[Zԫ<PPX [ЎP  eH XPڎ1P^Ь[ZYҭPPPZzYPPXȭfZ[ҭPPPPȭEXPڎYZ[0Y[%P[ԭ1ЬЬ  իP#ЫPPE ЫPPЫPQ@B[ݫPЫ 0) start = atoi(*argv++), argc--; if (argc > 0) bsize = atoi(*argv++), argc--; if (argc > 0) count = atoi(*argv++), argc--; printf("from %s to %s, %d groups of %d blocks offset %d\n", from, to, count, bsize, start); close(0); if (open(from, 0) != 0) perror(from), exit(1); close(1); if (open(to, 1) != 1) perror(to), exit(1); start *= 512; bsize *= 512; buf = (char *)sbrk(bsize); while (count > 0) { if (lseek(0, start+(200000*512), 0) < 0) perror("seek 0"), exit(1); if (lseek(1, start, 0) < 0) perror("seek 1"), exit(1); if (count % 25 == 0) printf("%d\n", count); if (read(0, buf, bsize) != bsize) { printf("read block %d: ", start / 512); perror("read 0"); } else if (write(1, buf, bsize) != bsize) { printf("write block %d: ", start / 512); perror("write 1"); } start += bsize; count--; } printf("DONE!\n"); } @iZkw  3E \C= A B  h^Юn PPՀPpPP P^@Ь[kP#Pl-PPP, TgZV:PZPZ^Z=P+F#PZZP PZZPPZuP1XZW g:XWgX~=tPVZWX'gjZP=PPjPHfX:WZg:ԕjZPPP<PHfXHfV9z7+#P3PP uPPPPP׬[1G1PV11P11PcѬ  ׬[kK1P1kZj-1PPns1 11-1%PXPfPekRcPiZIL1:Pv0PsPq(Pt1$Px1Tj1.[׬լ1Z ?RլMkEP&k;k~tP׬[m2~PPPPII"=32~P&p[2l'  PPPSP2PP1мP-`  1]}rPYXPYF2^~hP 2LY+Y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ԫЫkݫ [ ^/L(Ь[1[Z[k/Z[Z [Z6Z[[k k/kjSZZG~[[Z6ZZ[^ZZ$TZZz/[[ZѬZZj.Z5PZ5P/kk1AЬ[[E[Pݠ P)F :H<3 F 7^߭߭6߭߭߭2<~߭E Ь[[ЋZ)ݏ)9k<j~P()ݏ~)ZPl) Ь[ЬZjk ѫЪ $$Ь[ЬZkjPëQQPY(PVXVfP`fPՠfPРXh1h% h~<7XhPPDC*****O*;*.*{Xkj~ë~ݬ ŏdYPլ Ь QQJ {GZ(J!JPZPJxJPZPPjjI I1xYP[PIII ZIIIkIIk[P Ь[[ZIPZP ZI P |tZZNIjPPjj@I j;I D ^Ь[ [t[PPݬ2PZZ[ZP[Z~(1PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPH@jP ^ԭԭfH[LkZЬPՠ(k PPP[Z~[[ZkZ[[HH~ݭݭW4x7r; 4VV:p 4@T? 6R: 4 4G$$)7.G,8?166L&Y5#Ԫ?-C44@53D3KPV(%];dhAo8u|lF07B4B&tFNhA69 p )G 1  !%.2EJQU_dw{! $9>RWns\~ݬЬZЬ[ЬY-M$k-Ѭ0 ~hZݬ\֬ լ  ՘~HZ ݬ9׬ լ @(#)sh.c 4.2 3/11/81./usr/ucb/bin/usr/bina.outstatus0HOMEhomeUSERuserTERMtermPATHpathshell/bin/csh/tmp/shverboseechoargvprompt# % Switching to new tty driver... Warning: no access to tty; thus no job control in this shell... /.cshrc/.loginlogout Reverting to old tty driver... /.logoutjobsInterrupted%d? mailYou have %smail. new %s in %s. New mailMail@(#)sh.dol.c 4.2 5/3/81\'`"AmbiguousUnmatched %c '`" Word too long$< line too longNo file for $0Variable syntax-*Subscript out of rangehtrqxeBad : mod in $$\'`"<< terminator not found<<Line overflow$\`@(#)sh.err.c 4.1 10/9/80%s: @(#)sh.exec.c 4.1 10/9/80No match/Command not found/bin/sh%d hits, %d misses, %2d%% @(#)sh.exp.c 4.1 10/9/80||&&^=<>Divide by 0Mod by 0!~(Expression syntax{{ ... }Missing }erwxfdzoMissing file name+-*/%()!~^|&>>==!==~!~@(#)sh.func.c 4.5 81/06/19%job%job &Too few argumentsToo many argumentsCan't from terminalaliasunaliasToo dangerous to alias that/bin/login/bin/newgrp/usr/bin/newgrpNot login shellEmpty ifthenImproper thenSyntax errorNot in while/foreachInvalid variableWords not ()'eddefault'"then/endif not foundendsw not foundend not foundlabel not found-n%o Improper masknoraisecputimesecondsfilesizekbytesdatas((izestacksizecoredumpsizememoryuseNo such limitLimits cannot be raised hoursminutesmegabytesunlimitedImproper or unknown scale factorBad scaling; did you mean ``%s''?%s %d %sCan't suspend a login shell (yet)@(#)sh.glob.c 4.2 3/11/81`{[*?noglobnonomatch{}Unknown user: %sMissing ]Arguments too longPathname too longUnmatched `` ... `Too many words from ``@(#)sh.hist.c 4.1 10/9/80history10-r%6d @(#)sh.lex.c 4.1 10/9/80# '`" ;&<>()| Unmatched "'` Expansion buf ovflo:^$*-%Bad ! formNo prev sub Bad substituteNo prev lhsRhs too longBad ! modifier: Modifier failedSubst buf ovflo-$*Bad ! arg selector(=~: \ }No prev search: Event not foundReset tty pgrp from %d to %d ignoreeof Use "logout" to logout. Use "exit" to leave csh. @(#)sh.misc.c 4.1 10/9/80i=%d, j=%d: Out of memory /usr/bill/cshcoreUndefined variable@(#)sh.parse.c 4.1 10/9/80Alias loop;& Too many )'sToo many ('s<>()Badly placed (Missing name for redirectAmbiguous output redirectCan't << within ()'sAmbiguous input redirectBadly placed ()'sInvalid null command@(#)sh.print.c 4.1 10/9/80%d.%d%d:%d%d@(#)sh.sem.c 4.1 10/9/80nicenohupNo more processes/dev/nullnoclobberCan't make pipe%s: File exists@(#)sh.set.c 4.1 10/9/80Missing )histcharsSubscript errorBadly formed numberNo more wordsWarning: ridiculously long PATH truncated @(#)sh.proc.c 4.6 (Berkeley) 81/05/03childnotify BUG: waiting for background job! BUG: process flushed twice( | ; << < >> > ...[%d] %d[%d]%s %c %5d %-21sRunning Exit %-16dDoneBUG: status=%-9o | (core dumped) (wd: (wd now: ) -lUsage: jobs [ -l ]%s Bad signal numberUnknown signal; kill -l lists signals%s: Already stopped Arguments should be jobs or process id's%s There are stopped jobs%%%+No current job%-%#No previous jobNo such jobNo job matches patternNo job control in this shellNo job control in subshells@(#)sh.dir.c 4.1 10/9/80dirsUsage: dirs [ -l ]~%sNo home directoryCan't change to home directory./../cdpathNo other directoryDirectory stack not that deepBad directoryDirectory stack emptycwd@(#)sh.time.c 4.1 10/9/80%Uu %Ss %E %P %X+%Dk %I+%Oio %Fpf+%Ww%d%%@(#)alloc.c 4.1 10/9/80assertion botched: %s allocp>=allocs && allocp<=alloctallock()q>p&&qalloctp>clearbusy(allocs[1].ptr)&&p<=alloctp->ptr > allocp && p->ptr <= alloct%6o %5d %s BUSYFREE%d used, %d free, %l end @(#)sh.init.c 4.1 10/9/80@allocbgbreakbreakswcasecdchdircontinueelseendendifendswevalexecexitfggotohashstatkillonintrpopdpushdrehashrepeatsetsetenvshiftsourcestopsuspendswitchumaskunhashunlimitunsetunsetenvwaitwhilelabelHUPHangupINTInterruptQUITQuitILLIllegal instructionTRAPTrace/BPT trapIOTIOT trapEMTEMT trapFPEFloating exceptionKILLKilledBUSBus errorSEGVSegmentation faultSYSBad system callPIPEBroken pipeALRMAlarm clockTerminatedSignal 16STOPStopped (signal)TSTPStoppedCONTContinuedCHLDChild exitedTTINStopped (tty input)TTOUStopped (tty output)TINTTty input interruptXCPUCputime limit exceededXFSZFilesize limit exceededSignal 26Signal 27Signal 28Signal 29Signal 30Signal 31Signal 32@(#)printf.c 4.1 10/9/80^Ь[Ь Ь\[PZY Y%ZZݭPP[QQ~8Y!cdefg+l-.o0123456789abcdef^U|YPPQPA2QM..._ekvvvvvvvvvPPs1PxzPu1Pr1TPP*1CP1(null)XPZPЌRR:PbQURQpPPoPxPdHPu1[~RS T RSTSVQЌPRSPQAVRe;0Tn n8 n;  ~Z0nݭQUUYPPZPPPQU1ilPP n4 n  n錪  nPUP^QZ1Z1ZZZZ IiY>IY HhX>HXZ1VXZZ1KЌXЌ\Ќ[10ZXXWWVWWWWPPnW3PWPP#VWP֭WP-WxWP@(RnVЭPPX'(AcխXVVVV()cXP%VVX8Wn 1GDeB+B+D.@0RVQPVPQ'խQRVPЎPR QPVPRPQQPRQPRPc0XZXXPPnX.PXPP֭XPP/XxXP@ZlxXPSPQXWQPQ`WWѭ+WPP!PЭWXWPPXWn4WníWX1XWPPXWn4WnWX(nVXP08Xn ׭n8ne QZ+Q; ?a1AZ11pUorUUUR>B€R R RZqPURRRRR dUR R8tPTUPUP  t|UPUP  PpPT~3SRRRRTRdcPSTRgPPRRT BCG@M [u+p^/֬Ь++h2+<+1JP+ 7+u+v.-_+z+FT+o+1+6+wP e[++TJ++AP /+!+,*****\*D<*PP12*PPl*f*/P TH*P [[K*[PPPZ*P[ZQPQJ`ZZ )P/K`[PP)PvQA`[)PK*K`ݬ PݬN_1ά%CP'4ݏݬ'0ЬPЬQQɏPQ0Ь[ЬZ[[  PK?)YZK6)ZZZZ Z9ZZ[ePZZ ZZZYKr)YPЬ[ЬZ[[  DPK(YZK(ZZ ZZZ[PZZ ZZZYK)YPЬ[[ [Ь[[  K(~ɏ[~Ь[[  K( yP~[LPݬ: Ь[K'ZljKH(~[ЬPЬ QլQP PQPЬ[Zj7݊[ PYYP Ь[ЬZk =ZPk=P//QP'P[kݬk P8[P/P ph [Ь[k:[kk[P42PP ݏ&P[[*[P[[*[xP[[P*[\P[[jP**~*[/P[[o*[P[[`*[ P[[Q*k [kk*PЬ[ZYk94 ZPQPQ0QZY[[kPP P P+P-k0YZPZPЬ [ЬY׬&k ЫP֫`P [PZZZ Z YPЬPQP% P! " PЬ[|XXPX 鑫+PPPYkw+ݏݬPZY1ZZ kalYPPPݬ PZ 4D\f(4FUet&2EError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large@)[*LЬRPQbPЬ[[o~kЫ0   PSЬRUT TTT +T-TST|PT04T9/Q yPVyPPVPWQ0TTPQUSUTǑT.SVTeTE[TT+T-STT0T9V FfV>FVSVVVUUЏUUdЏdU}PP1RU#Q yPPRyPVVPWQRU=;Q yPPRyPPRQQVW{VQWPVW{ VPVPPVPRUQyPPRyPPPPnPVnQPdP`VPSrPPRpP~Ь[  P ݏP ի ߘP@" [X R P2PPݫ~yPkЫk!k    k1WP֫pPPR RR RP|Pp PrPP" ^ԭլݏP!|PݭpݭVխѭ¬ Э!:Pݬ`!+ЬP}V}X}Z}Э`PЬPЬQ}V}X}Z}\Ё^PP Ь[ZZZPݬݬݬ;Bݬ  ЬQPa#+QP^Ь[    PPYYX1XX߭~PYjT~P  BЫZ֫ZPѫPѬ ZPPXPZ~9PYZkn 1mЫZ3[h1xݏyPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~dPY PP[ [[[ Ь[Z = 8[ePZ~MPZ ݫ ԫ kZP Ь[ЬZkPkPzQQPPP^߭ݬPPP|l\PЬ[ЬZ[Y[YPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6< P~\S^\yPpЬ[PЬPЬRRQ{RPPR PRPPЭRBQP<PbPbMkPP((!^.[s<Y71PU;P3k֫pN@pCaFpCJE@}oR@|1p|/...getwd: cannot open .. ..getwd: read error in .. getwd: read error in .. getwd: can't change back /etc/passwdrrUnknown error: #h@i [k!4 )١}+iȪ /dev/hp0a:/:rw:1:1 /dev/hp0g:/usr:rw:1:2 @i ]k% =&iB{B{ Џ]]^P(T`m0T=P0TQ0P PTQYݔYЏ0V0]U)Yed/@U1<,<&V%VV1VW 05WPP]\Ue1r PѭVԭlɏ PNȏDk P֭ PP!PPPP  P P"RRPPP#RRkRRR@i ^k˜a[@iߡߡ LX88Џ^BPԀP^(0n ,PЬSRbcPRbz &0^n(2 9 @ F  "6 O X',7<B HTOSPXL_,e`m_end_edata_main__rtt_configure_cpu_openfirstHIGHentrystartaedataclraendabeginbegin_badloc@i `kf%|| Wed Feb 10 17:10:24 PST 1982 @i bk =&iL{L{ ((U[Џ^V(fn)>PPPxPQRQRScYЏ$PP<QP< QP< QP<Q"P< 2QQDxQQQHşHDLЏVP@0ef+0ЏWg)f'<2PP~+ ԭPЭQA`ݭ'z֭ЭPΜ^ݏ@ݏ ݏ`ݏ X~Pݏ 5~_P<-QPQNPRP6ͬiͬͬP@Ͱͬ  1t1\Ͱͬ߭ ^CЬP<PPPЭP<}QPQq b[TݭFDЬP<PPPQxQQQPQxQPPЬPЬPЭQЬPЭQ ЬPЭQ ЬPЭQРЭP4ЭP8ЭP<ЬP<PʏPP 1P@P`P1ԭ!ѭ "ЭPPQRxQQQR@ b֭ѭѼ EЬQP<ԭ PЭQ@ A P@ ݬ ЬPݠ<c ~ ~ݭ@ЬP<~ePfile sys size: file system: %s: cannot open isize = %D d--777 0 0 $ m/n = %d %d %ld/%ld: bad ratio -bcd-u-g%c/%s: bad octal mode digit %s: cannot open ...%c/%s: bad mode %s: bad number EOF read error: %ld write error: %D out of free space indirect block full too many bad blocks ilist too small bad mode %o @(#)mkfs.c 4.2 (Berkeley) 4/20/81  "' -4 > J Q ] d j v      # 7 >L Siow|             '. ; G NW] b h q    1 ;B I ~  M^fn u    ! " %0DSm s      % +2 9 T r      *  '! =D M ` g* v },               6 < G L ] c r |      " U \  c  p  w        %  +  w ~        # 0 ; Y e          ,  8    7     $  -  < ").42<BHO@ TD Y`ekos{R| vj ^ l   %*,16;@E4 MRY^_sccsid_utime_fin_fsi_fso_charp_buf_fbun_string_fsun_fsys_proto_f_n_f_m_error_ino_mainL36L32_printf_gets_open_exit_atoi_wtfs_bflist_cfileL73_getstr_gmode_getnum_newblk_iput_read_close_entryL119L128L137_getch_rdfs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ates unchecked freefiles %u (r=%u,d=%u,b=%u,c=%u) used %ld (i=%ld,ii=%ld,iii=%ld,d=%ld) free %ld %ld missing missing%5ld bad mode %u data (small)1st indirectdata (large)2nd indirectdata (huge)3rd indirectdata (garg)%ld bad; inode=%u, class=%s %ld dup; inode=%u, class=%s %ld arg; inode=%u, class=%s Bad free list, s.b. count = %d Bad free list, entry count of block %ld = %d read error %ld No update write error %ld @(#)icheck.c 4.2 (Berkeley) 81/02/07null path %s not found bn negative bn ovf %D bn void %D bn void %D not a directory zero length directory Seek not from beginning of file No more file slotsBad device Unknown device Bad unit specifier Missing offset specification Can't write files yet.. Sorry Exit called%s Trap %o 8/;/! >/HA/V&T$D/G/J/@M/hpuphkrahttmtsmt`       @ ` `&vd62M2R%s1 JTJ2" 7/ `7//////2 @v0unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry Anot a tape mt hard error: er=%b mt error: er=%b mt: unrecovered error mt: recovered by retry rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry Pte error: er=%bILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOTts: unrecovered error ts: recovered by retry DR2 `7,5 @7<5up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPEh >Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error 0123456789abcdef@i+ mkͧ^%.o/ r<r<r<  ,H^Юn PPՀPpPP P1z׬լЬP`P׬լЬP`fP׬լЬP`FPo׬bXZH>ݏݏRsP 6 APďďP14 PݏIjPݏPx_DPPP9PP.ݏWݏ fP0ǏPPݏ[ݏݏkLP.ǏPPݏrݏ:ݏsrp1ݏݏ1ݬ \~ݬgЬP PPЬ[ZYk94 ZPQPQ0QZY[[kPP P P+P-k0YZPZP l[tP@X[ݬ)PZZݬ8[P[@HRl| ,8N`l((~,9O^j}Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large Ь[ZZZP   !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYjx ~P   BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[1xݏPZZ  YYX ZYYXZYZ~(PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[:  Ь[Z = 8[ePZ~9PZ ݫ ԫ kZP{(P^߭ݬDPPPݬݏ tݬݬݏtݬ6L.">"603!$~*PY [k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ ["PYPƏPxPbPZxPZPPZx~@PZZZaZPZPMxNPZPPjj7"+1xYP[PZ  kk[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP=@j~\S^\_PCЬPЬPЬRRQ{RPPR PRPPPPB.from %s to %s, %d groups of %d blocks offset %d seek 0seek 1%d read block %d: read 0write block %d: write 1DONE! /dev/rrk0c/dev/rrk1cUnknown error: #," r<~&q8/8A$IRf [y(b4i4qDzdt"" "$"0Xh(~<r   Y Ppq$.*3;4:d@8HNUt[Xb~:k r|$hf 3D LRy, 07H  ,"crt0.orkdcopy.ofprintf.oatoi.operror.oerrlst.ostrlen.olseek.odoprnt.oflsbuf.oexit.odata.oclose.oisatty.oopen.oread.ostty.oioctl.omalloc.o_allocs_allocp_alloct_allocxsbrk.oudiv.owrite.ocerror.o_exitstart_main_environ_from_to_buf_bsize_start_count_atoi__iob_fprintf_close_open_perror_sbrk_lseek_read_write__doprnt_errno_sys_nerr_sys_errlist_strlencerror__flsbuf_isatty__sobuf_malloc_fflush__cleanup_fclose__lastbuf_free__sibuf_gt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Y1:YX[~XZPWWXXBPXPPBXZXY[1PeQQPQ?6.l KtePPPPڎP[Rޱ,<e?ڮn^ݏ@ڮn^[Pڎڮn^oPPBx~BoicZTPPH. pdPPPڮn^ݏAڮn^l Ь[ѫ  k[Jԫ dPPPPڎPZ [ P[ [ ZPڎn[8[ekPPPPPЫ ~2~nPkPPPЫЫo4 ێPPPPZbێPPڮn^NZA;9<PP )RnnZ1m<~<~~h[kЫ [HZ S>ZTzPgPP4.~N2 ~P*1W  1. 18PPPPw1b1X@kiݏ@ڮn^ dEg[(R/YK1k0[PP~ݑЫ $[F1~z~چڮn^1ZvmS 1L)ێPP7P0`~ڮn^"ﺆPP,l"7ﮆؐݏ@ڮn^ rﳐ~1=ێPݏ@ڮn^|oI((TQZڮn^:1D ,)ێPP܅ݏ@ڮn^111+PPPP? }ڮn^E1;1. d1Ь[ЬZx YQ,թݩ{\2~PYPk[Q8^Ь[2PP@]WЫ,Y2ԫ4qQ#իz[~2~PЩ Z ԩЩ,֫4ЫЭP2PPg;~zZl2g~ЭP2PˏP~_z2~}2PPPxPP@V1|[rPX﷧: Щ,q2 ~ zȏ(21qPPP&P'P*, ȏ(2P ݭZ2~PZj!P"PP 2PPPxPP ? ЪPQxQQQPOЭ$ȏ(2,xPPC֩$2P@]xP2QPA[թЩ,Ы0PYY0ԩЪ 2P,P@7YY ЩЩPZ Z1^ЬP@.[ЫZPP@XŏP@W2~2h~x}2hPP 1q2h~ݬxWݬpxF2PʏdoPP h[PNQQQPPh PȏPPP2QPQ Pȏ PQPPxPPPh2Pʏ?PP@hШYHP 2^24 itrunc ^\ /etc/init$$1>KXfp{real mem = %d sys pt too smallno memoryavail mem = %d usrptWARNING: preposterous time in file systemWARNING: todr too smallWARNING: clock %s %d dayslostgained -- CHECK AND RESET THE DATE! mcr%d: soft ecc addr %x syn %x mcr%d: soft ecc addr %x syn %x mcr%d: soft ecc addr %x syn %x syncing disks... done halting (in tight loop); hit ^P HALT dumping to dev %x, offset %d dump device bad device not ready area improper i/o errorsucceededmachine check %x: %s%s abort fault%s %s cpues %x upc %x va/viba %x dreg %x tber %x %x timo %x parity %x sbier %x pc %x psl %x sbifs %x va %x errpc %x mdr %x smr %x rdtimo %x tbgpar %x cacherr %x buserr %x mcesr %x pc %x psl %x mcsr %x params %x,%x pc %x psl %x mcesr %x mchkcp readctrl str parcp tbuf parcp cache parcp rdtimocp rdsucode lostib tbuf parib rdsib rd timoib cache parctrl str parmemory errorcp cache parwrite bus errcorr dataucode lostbad irdtb parbad retrybad intr idcant write ptemunkn mcr erriib rd errnxm refcp rdsunalgn iorefnonlw iorefbad ioaddrunalgn ubaddriinitbinit0123456789abcdefpanic: %s %s: table is full %s%d%c: hard error sn%d neg q flush rmallocrmalloc swapmap%s: rmap ovflo, lost [%d,%d) bad rmfreeissig psigpsig actioncoresleepwakeupsetrunno procsnewproc vforknewproc i_vfdcntexeceexeca rmallocexitinit diedprocumountpw{}~ւ2lz„nP$}؆rlT~_00ԋܐ|Fp·E&npRpp8h500Cppn̒pppp`lxppp pppppppvpppppppppppppppppppppppppppppppppppppppxfree rssizetextxalloctext rssizelost texttrap type %d, code = %x, pc = %x trapptable faultsyscallvsexpandvmdrum NDMAPvsxallocvsswapvstodbvstodb *ipvmemall sizevmemfreevmemfree vrpagesvmemfree vfdcntmemalldup mem allocbad mem allocmemall ecmapmemall mfindmemall intrans|wantmemfreebad mem freedup mem freemhashmunhashmunhashmunhash mfinddup page unlockvslockpageinpagein pg_filenopagein PG_FTEXTpagein u.u_ofilepagein mfindpagein intrans|wantpagein c_page chgdpagein u.u_ofilepagein u.u_vrpagespagein i_vfdcntpagein pfnumbad c_pagepageout klsizecleanup CSYScleanup centerklustervrelvm rssvrelvm vrpagesexpandvgetptvgetuptexpand Ak@M{@Ķ~@]μ@WARNING: should run interleaved swap with >= 2Mb vbmapswapinswapoutswapout rssizeswapoutswdsptswdspt4 , $  x h X H cpu type %d not configured mba%d at tr%d %d mba'suba%d at tr%d 5 uba'sdr32mcr%d at tr%d 5 mcr'smpmnexus type %x unsupported (at tr %d) not configured %s%d at %s%d slave %d %s%d at mba%d drive %d uba%s%d at uba%d csr %o zero vector didn't interrupt vec %o, ipl %x %s%d at %s%d slave %d %s%d at uba%d csr %o zero vector didn't interrupt vec %o, ipl %x blkdevdup iodoneIO err in pushswap bad ptebig pushhard IO err in swappid %d: killed due to no swap space killed on swap error sorry, pid %d was %sbmbm (*+,R4bmbmbmbm\erXmXmuXmwxytZt[Z\dȰXmbmXmXmXmXmTbmbmgr20 tmbmnZnnbmbmbmbm>~@Xmbmbmbmbmz%%XmXmbm*+22z2 3XmbmXmXmXmXmXmbmbmbmbmuuXmXmbmHnzXmXmbmVKLNOUbmbmXmXmXmXmXmbmbmbmbmnVnXmXmqNxx J   hbmbmXmXm@wx@Xmր5f6Xm6XmXm9t>~Xm XmXmXmXmXmXmbmbmbmXmbmXmXmbmZt[abbXmXmXmXmXmXmXmbmXmXmXmXmXmXmbmXm XmXmXmXmXmXmXmXmXmXmXmbmXXmXmXmXmXmXmXmXmXm̨bm21jbmbmbmXmXmXmXmXmXmXmXmXmXm`ڠB1xbmbmVKLhQQUbmbmbmbmbmPj./ ./( dh%d: silo overflow dh%d: NXM dh%ddhdm /8/`dn&2qv >d`@@6 > >2MPk2rR >%@s?1= a >JT+jRJ2" "#0H2 7/ `70///\0/2 @v0 00=DCLR attn hp%d: write locked hpmbsr=%b er1=%b er2=%bDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBCDVCSSEDPE mr=%o mr2=%o hp%d%c: soft ecc sn%d hp()*,**D-.0L233CORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLA((tu%d: not online tu%d: no write ring tu%d: can't change density in mid-tape tu%d: hard error bn%d mbsr=%b er=%b ds=%b tu%d: hard error bn%d er=%b ds=%b httuL553 4 lp%dlp DTBUSYNRCONFCRDCBHUNGPGENEDMCPEATTNSPEDTCMP DTABT DLT WCKUP WCKLWR MXFMBEXCMDPEMAPPEINVMAPERRCONFRDSISTIMORDTIMOmbustart%s%d: not ready mba%d: control bus hung cbhungmbintrmbintrmba: zero upagemba, zero entry @ @AYY\](^_$566RDYPRESONL REW PE BOT EOT FPTAVAILSHRMAINTDSE mu%d: not online mu%d: no write ring mu%d: can't change density in mid-tape mt: wrong unit! mu%d: blank tape mu%d: offline mu%d: no write ring mu%d: hard error bn%d mbsr=%b er=%x ds=%b mt: unit %d random interrupt mu%d: blank tape mu%d: no write ring mu%d: offline mu%d: hard error bn%d er=%o ds=%b mtmu >0'l >+i dd|ddPjl799B/6B(7 00F7 irk%d: not ready (came back!) rk%d: write locked rkcs2=%b ds=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSSVALCDAPIP WRL DDTDRDYVVDROTSPLSACLOOFFDRADCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk%d%c: soft ecc sn%d hk%d<%d>hk%d: lost interrupt rkhkswstrategyargmapswapPtwww| 9D:G:  @te%d: not online te%d: no write ring te%d: can't change density in mid-tape te%d: hard error bn%d er=%b ILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTURtmintrte%d: lost interrupt tm%d<%d>tetmP$^p҈L:;;  ts%d: not online ts%d: no write ring ts%d: success ts%d: write locked ts%d: offline ts%d: hard error bn%d xs0=%bTMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOT xs1=%bDLT-COR CRS TIG DBF SCK -IPRSYNIPOIEDPOSPOLUNCMTE xs2=%bOPMSIPBPE CAF - WCF - DTP xs3=%bLMXOPIREVCRFDCKNOILXSRIB tsintr ts%d<%d>tszs|`{}~ABCDEFGHIJKLMNOPQRSTUVWXYZddddddd22xxx}}}}ttrstrt: arg was 0! ioccom canq^ ({)}!|^~'`ttyrub  ({)}!|^~'`tu%d: %d soft errors, %d chksum errors, %d hard errors ON tu: no bp! active %d tu pk_mod %d neither data nor end: %o %o TU protocol error, state %d %o %d %d TU receive state error %d %o tuxintr: state %d ON2 OFF NO IE OFF2 new state %d tu: read stalled %X %X %X %X %X %X %X %X  RDTO RDS CRDCXTERCXTMODPPEIVMRMRPFLEBUBSTOUBSSYNTO uba: zero upageuba zero uentryuba%d: reset uba%d: hung uba%d: too many zero vectors uba%d: sbi fault sr=%b cnfgr=%b  PARFLTWSQFLTURDFLTISQFLTMXTFLTXMTFLTuba%d: uba error sr=%b fmer=%x fubar=%o uba crazyERROR LIMIT > >@Lh\?BȭB 7uda: ubinfo %x uda: um_ubinfo == 0 raudasa %o, state %d uda: bring unit %d online udintr: state %d, udasa %o uda%d: random interrupt ignored uda%d: interrupt in unknown state %d ignored uda%d: fatal error (%o) uda: purge bdp %d uda: command ring transition uda: unit %d online raOFFLINE uda: unit %d attention rastatus %o uda: unknown packet uda%d:%d: %s error, softhardcontroller error, event 0%o host memory access error, event 0%o, addr 0%o disk transfer error, unit %d, grp %d, cyl %d, sec %d, trk %d, lbn %d, retry %d, level %d SDI error, unit %d, event 0%o, cyl %d small disk error, unit %d, event 0%o, cyl %d unknown error, unit %d, format 0%o, event 0%o uda%drauda > >2M=X2rR >2BHCDD `7B @7C 007qxUup%d: not ready (flakey) up%d: word count != 0 up%d: write locked upcs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPEup%d%c: soft ecc sn%d sc%d<%d>sc%d: lost interrupt upsc     () DE EE,EBerkeley VAX/UNIX Version 4.9 Wed Feb 17 15:27:46 PST 1982 0?0??0??0??X2??(5??X2X2(5(5(8HXhx (p7?,H $9?  U) U- V5 ,V=!&D\KX_gv^olwv)ESE0tjP8T|d$(".*84^ <HFXPhZN>bDxlvEFGHIJK (  lNpN_tN! VN;2 |W9 W} H VWN ^XW vX` "Xh  Xn dXu &X} X XT X  X v$X w&X (X  ,X .X 0X 4X J8X GX8  =XSN zX X& (XB5 Dt&Dx&p&|&&{  =  -\ \9X  \ &! \* X&; ed&E \&N `&W ?T&+ j N(\t Q8\z <\ @\)  \@ P\ p t x k0 V c/ N.n6d zy$Y.3' `1 `: `D N+3T `_ |Nf kLEn  %T Y f 1 . ol { f vd <n Z% x l` N l% > & " ^' '" r) @x(0 (9 a@ )H KS a\ ad )l q Z+z @. ~ N/ / &0 r< < 0 0 0 1#w a a a a a Ha a N a( a4 5; $D "1M zV V^ Ai =:q h5z ~5 06 "7 _ u7 W0  8 ,: pH:  8 x v Ae >  A  @ LA z? ' Jg0 9 A DL S v[ adja Eh ?p Ev jF} \Q ^G tH NK  ZJ K ¬ D  Ea iL 6L M N O eO *P+RP kPQt.I(<07@xIFVNZVS/nV[7 WdXl aqPYz\[,`\wo])_m ]adKerl1lXmbm fmzmlm Fn(Zn1n:n@tnGOtY`wi*q/y Xwu8Dlzz{L<|T{$}}~>ւT2;2r"„(/8?F؆L·QwTY&bk%4t|ԋW~LRql yڎ1 P,ܐb^&n&2̒-4F=XEuNxV-p]'|f^0Co?`vOl}xA9 l|vIKԔq.~P ojR#Z-5f;0DMZT\el|tzȥ6|JM6°l%u % >Xe$%d Tb  b( c0F6`&?3If Q.X_F_gp5y`bTh&l&& TXc Hcph^&h1 c oc @@ nc`* c2 "c: dB dG$'P4'YC(emn#xZL[jmxmGEMHJ Hd<Ft{  (Z*&+/G,;(R4CmOW \ecrkmuwjwx y8-tmZ t[ Z\dLȰO}  #Jh E3ZT;D4L'U^:frow20Id>~@z%%422'z2 3'uuMHtnz :VKLN"RO+U4n<VnE qN*V]_Ngxpx y`J   I@E@Bր5Mf669>i~a  agb_b'z /8gAIhXR*[̨dl2urj!`ڠ Bnx hQGQEp.]|.ޑ |T   (=./h.9+PBjL 5(Te.[#.en^x $0 %4  8 @ Pb ̽D j-J1T~ F`p /K/#d- h5WB  Q I 4  HBB'B.NJ5Y:X?IGsJQ NVZWbVjJoJv5}8K G <NLW MV 5(YHYQ\[#]dJ(^m_w  MءfP5[``b ܡ > 9Z6)(7h7   4l7p7 <ddL|d@d&bPj- F5 p< xC :xK7Q7\ SЦd }(n%nv0rr=DfsjhnHinc0Կ 0 ` k a  ȧ 6 t 90$9 Qtw w 9w# Y|* y(4 #hy? 4~H dzzQ p[ c }k u g | H ux   X GL: P: $ ^ p I҈ [  }` pd!? !$X!ʋ!A$!a.!_ 5!<=!dH!>R!(Y!6b!j!ʧs!2~!(!j!l!@! 9! H! p(! 8!h =!2$=!1(=! h!.(! !d!"{X>">">%"/" 9" D" I"?S" /\" e" ȭn" Эt"P?{":?"\""" r" iH" "!T"$"p"$"n" Ю"mB"DC#t@C #TDC# c# 7&# ,#HC3# PC=#F#O#fY#Q`# yh#xCn#CCy# X# <# # ]##n#  #tF#D#E#E# E#,E#r,H#C4H$Uos`ucbPATH=/etc:/usr/ucb:/bin:/usr/bin:/usr/local:/usr/hosts:.s.)path/bin/csh(shell 11637/tmp/sh11637),-#! /bin/csh rewind date cd /nbsd/tp tp cmf /tmp/tape.$$ boot icheck mkfs restor cd /nbsd/usr/mdec cat tsboot htboot tmboot noboot noboot noboot noboot /tmp/tape.$$ | dd of=/dev/rmt12 bs=512 conv=sync rm /tmp/tape.$$ cd / sync /etc/dump 0uf /dev/rmt12 /nbsd date cd /nbsd/usr tar cf /dev/rmt12 [a-r]* s[a-p]* [t-z]* src/dummy cd /nbsd/usr/src tar cf /dev/rmt12 [a-z]* cd /nbsd tar c \ bin/{adb,login,ps,sh} \ lib/ccom lib/c2 etc/arff etc/rc \ etc/{bad144,badsect,config,dmesg,dump,init,fsck,halt} \ etc/{pstat,reboot,renice,savecore,shutdown} \ etc/{delivermail,dumpdir,getty,icheck,sa} usr/ucb/{last,lastcomm} \ bin/{csh,diff,mail,make,mv,od,rm,rmdir,wall} \ bin/{who,write} \ etc/{mkfs,restor} \ sys \ -C / usr/games/{chase,hangman,rogue,worm} \ -C /bill get date dd if=/dev/rmt12 of=/dev/null bs=1b dd if=/dev/rmt12 of=/dev/null bs=20b dd if=/dev/rmt12 of=/dev/null bs=20b dd if=/dev/rmt12 of=/dev/null bs=20b dd if=/dev/rmt12 of=/dev/null bs=20b rewind exit =l@h#IargvYsrc/dummy>H?4"!x!("l!<"!!!!!!!!!!"""H"T"!`"L0/nbsd/usr/srciX!q:JFN T tar cf /dev/rmt12 [a-r]* s[a-p]* [t-z]* src/dummyarX!X!tVnewUnewsPoldozalppreservepubpublicschmidtshannonskelsklowerspoolmcttbltmpi!!u!dict!!coreld=!bin!lost+found!man!include!lib!mdec!!msgs!!net!new!news!!old!tmp"old"preserveetc"pub%"public1"crash9"admE"guestQ"skel]"spool /e"ucbX#37o|""!p" ""/"""/wd""p""/etc/dump"""""""0uf##"##/dev/rmt12 #$#"0#,#/nbsd<#@##pD# dX#d/usr/mdecX#e#/a/wnju# $x#|#cdpath#allout;##D%#~fabry/155#mkfs##X%#restor#$&0&&#unedit$'<$D,$$$\#$0-$0$9$historyE$unedita$$d$**8q$$H$$$&&$$echo SCCS/p.*|sed s/SCCS\\/p.//g*|s$($l&$out$$L&$z$$d$H$$ $%$%%%#(% %=%set old=$cwd; chdir !*M%$P%L(U%cd%set back=$old; set old=$cwd; cd $back; unset back; dirs%<'04*%rme%**(%%'&++H$%%%d(% &#&@%&back &0-&tail&5&-rI&p'|''i&sccs get -p !* | diff - !$ey&$|&l+&sd&'%'&&''&&jobs&&-l&t$&$&j&/usr/adm/messages&#'`)'dm 'fgl' '&%%' 8'8#@#8'E'tape'Q''X' i'4(@(l'y'sccs'get'-e'8&'&'co'suspend'(#''sccs''infot'&'&'info..; (/nbsd/usr/mdec ((sccs/g)()((0(/dd=(sccsI(delgetY(\'\('a(ci(echo !-1:q > /tmp/$$;vi /tmp/$$;typein `cat /tmp/$$`;rm /tmp/$$(tar(($(0((cd ..; echo */SCCS/p.*|sed s/SCCS\\/p.//g)) (#*)),)8)H)x))))5)/etcliaE)/usr/ucb)Q)/binrea\)\)m)%p)'u)ec)/usr/bin*)/usr/local)/usr/hostsp))h*).)H'))z*)p))date*L*)p**%**ls)*,**%1* peA*D*%0I* P* ]*H+d*0*grep !* /usr/games/lib/quiz.k/areas*)*&*area***,,%*****bgl***** 0++p+ +cd+ +*T-,+/nbsd/usr0+=+8,D+ i+grep -i !* /usr/bill/bin/telno y+T*|+#+tel++<<+ + .+--*+++++tail++++++-f+t,+ .+,3,..+),,,,\,5,tail,A,exitQ,4+T,)Y,xi,l,,.q,-fr,tapes/0217b,,,l:,//,,,,,,doret,.,9,,-,%-l-,t--!-<-$-00,1-4--<-9-zI-L-$--Q- 2h-d-<<ph- q-rme--,--ontape.olson--t-,- -:-11------diffea---..tapes/0271b.:-:. -.0.++5. Q.l.T.22-a.d.8.l.i.xy.|.T.8.. on..\,3.-f... .....j..... in.tapes/0271b.bg/4// .)/,//4/1/zA/D///I/ e//h/,u/x/L//}/ls//h///tape//@0/L///(0/ //////diff///00tapes/027100/(0%0tapes/027050800/=0 E0 a01l11l02000 /00p000man00000tp000p00 04*0L/010%1cd!1T1$1011411<191tpI1L1$1T1Q1crma1d1<11i1 y1|1H011tp11l111tv111H01 121H011111tar11121tmv 22112 12\342!!H8A2222D2a22d21q2t2H2|2y2tp22d222tmv22|2H22 2chown2242@32fran202(32H23323 3tp3 32(3%3tmv538332=3 M3P32\3Y3~frani33@32l3333233p333tp33333cmv333p33 3 3T4.,4 44((p3443 44ls-4044354 Q4074""2Y4 u44x4344\444dirs44x4\44 448454ls444\444444<5544 5 5 54(5%5-l556507<5jY56\54i5l5@5t5q5(55\555./maketape255t555>55555&55555tapes/0271b55555; 6 6566write%6(654616olsonA6D66P6M6ttyj2]6`646h6e6<u6x6P666done66h666)66666&666@56 6~fran6/date677@5 77677j%7(776-7 =7@7(584E7 a7|7d76q7t7H7|7y7z77d7H77 788##847 777H777777vipw78778 887 88ls-80888858-ldE88 88a88d8 7q8t8H88}8mkdir88d888~fran888H88 8~fran888878 an898))<998x9 9vi%9`9(9$$75989 9D9A9passwdQ9T9(9`9]9franm9p9D9 9u9 99899~fran/.loginn,c99x989 99,l:9/tmp/ontape99T:9%% 9::9 : :cp::98:5:~diana/.{login,cshrc}E:H: :T:Q:~frana:d:8:9i: y:|:9,: pe:tapes/0270b::.-: ::p::set:p;:;::X;:&&9;;:; ;chown; ;:,;);fran9;<;;X;U;~fran/.{login,cshrc}e;h;,;:m; ;old=$cwd";;:;;;et;;;<<;chdirs;ec;$<;'':;;;;;ls;<;<<-l<<;$<!<~fran1<4<<;9< <L<;T-X</nbsd/usrh<l<pt<p<tar<<\<=<cf<<<+<((;<<<<<chgrp<<<<<27<<<+=~fran/.??*$=H=t<X== =/$=4=/nbsd/usr8=@=tar=L=0ev=12d=h==t=p=[a-r]*==X=====0=/nbsd/usr===0>==date=s[a-p]*>>t=>>[t-z]*s >$>=l>0>src/dummy8>L>(=>/nbsd/usrh>P>x>|>>p> >>p>>cd>>>>>/nbsd/usr/src>>d?p> >>cfD?>p?>set ??> ??old=$cwdt-z,?0??8?4?;D?X? ?d?U?/dev/rmt12?chdirp?t?8?>?/nbsd/usr/src??p??tar?????cf??/nbsd/usr/src?????@@/dev/rmt12@@?$@ @[a-z]*0@4@@p8@ H@L@pT@P@cd`@d@<@@l@/nbsdx@x@@/nbsd/usr/src@|@@@Ap@ @cf@@p@@set@@@A@old=$cwdA/dev/rmt12%A@@C0CC$C[P Ь[*P#AP@ZP +PЬ[ PZZPPP Д[[ 22 20'0root device? bad/missing unit number use hp%%d, up%%d, ra%%d or hk%%d root on %s0 root on %s0 no suitable root hpuprahk L T "(pwT }T V T W  T 3E 9E A@ G@ Z@ jA pA xD ~D = B Z Z N $O (8P <LQ P  $)28?GOU`,is{ttt(#,5?IQU_hpy!*2;BKT\fny0 _bdevsw_cdevsw_linesw_swdevt_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_nummba_mba_hd_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_numuba_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_genericconf_hpdriver_scdriver_udadriver_hkdriver_setconfL152_printf_gets_mbdinit_ubdinit_getcharL188_cnputcL197@i yk>jy82i @ Berkeley VAX/UNIX Version 4.9 Wed Feb 17 15:27:46 PST 1982  _version@i {k!:! 2i 8i 8i #define NDN 1 @i |k{ "  @@jȪ (( `^Юn PPՀPpPP P ^PB P44P4Ѭ1ЬPݠ]PfЬPݠgA) LP|)Q[A`q)׽ЭPРQ֠aP ݭP[PݭGP5)ݭݏ()ݭ ))P@)\u[[P@(Z Z~P Z[[^P[P!AP:y[,߭(ݬ߭ ߭P߭^Y1Pݠݠ'P@'2 Z'YRjXX $PРQ֠ a PРQ֠Xa XZYPYPݬ P5^߭2P?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~EPYjh ~P _!W! BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[1xݏPZZ  YYX ZYYXZYZ~tPY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP [ [[[*  Ь[Z = 8[ePZ~PZ ݫO ԫ kZP{P[P[P[P/[PZ[ZZv PXYX/P[Y[ZuPX\YPXOd'[[ݬP1yk  kB'P[(=[ Ь[Zk[ZZP Ь[ЬZkPkPzQQP^ݬPP߭ݬP%k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ$ [H=P$YPƏPxP$bPZx$PZPPZx$~@PZZZ$$PZPy$xz$PZPPjjc$H=W$1xYP[PD$Z=$5$8$k)$"$k[P Ь[[ZZZ $jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPi#@j~\S^\wP[ЬPЬPЬRRQ{RPPR PRPPլQPP???/etc/utmprCannot open /etc/utmp rCannot open %s Message too long sleeperTry again /dev/wcannot open %s Broadcast Message from %s!%s (%.*s) at %d:%02d ... amnesiavax@(#)wall.c 4.5 (Berkeley) 81/06/12M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec88/etc/ttys/dev/`=@i }k:$ 2i 8i 8i ((#define NDZ 8 @i ~k :' 2i 8i 8i #define NHP 4 @i! k:- 2i 8i 8i #define NLP 1 @i# k:0 2i 8i 8i #define NMBA 4 @i% k:3 2i 8i 8i #define NMU 2 #define NMT 1 @i' kʅ!  ++uȪ((@i( k:6 2i 8i 8i #define NPTY 0 @i* k:9 2i 8i 8i #define NRK 2 #define NHK 1 @i, kW4 ,:,: /* * Header prepended to each a.out file. */ struct exec { long a_magic; /* magic number */ unsigned long a_text; /* size of text segment */ unsigned long a_data; /* size of initialized data */ unsigned long a_bss; /* size of uninitialized data */ unsigned long a_syms; /* size of symbol table */ unsigned long a_entry; /* entry point */ unsigned long a_trsize; /* size of text relocation */ unsigned long a_drsize; /* size of data relocation */ }; #define OMAGIC 0407 /* old impure format */ #define NMAGIC 0410 /* read-only text */ #define ZMAGIC 0413 /* demand load format */ /* * Macros which take exec structures as arguments and tell whether * the file has a reasonable magic number or offsets to text|symbols|strings. */ #define N_BADMAG(x) \ (((x).a_magic)!=OMAGIC && ((x).a_magic)!=NMAGIC && ((x).a_magic)!=ZMAGIC) #define N_TXTOFF(x) \ ((x).a_magic==ZMAGIC ? 1024 : sizeof (struct exec)) #define N_SYMOFF(x) \ (N_TXTOFF(x) + (x).a_text+(x).a_data + (x).a_trsize+(x).a_drsize) #define N_STROFF(x) \ (N_SYMOFF(x) + (x).a_syms) /* * Format of a relocation datum. */ struct relocation_info { int r_address; /* address which is relocated */ unsigned int r_symbolnum:24, /* local symbol ordinal */ r_pcrel:1, /* was relocated pc relative already */ r_length:2, /* 0=byte, 1=word, 2=long */ r_extern:1, /* does not include value of sym referenced */ :4; /* nothing, yet */ }; /* * Format of a symbol table entry; this file is included by * and should be used if you aren't interested the a.out header * or relocation information. */ struct nlist { union { char *n_name; /* for use when in-core */ long n_strx; /* index into file string table */ } n_un; unsigned char n_type; /* type flag, i.e. N_TEXT etc; see below */ char n_other; /* unused */ short n_desc; /* see */ unsigned long n_value; /* value of this symbol (or sdb offset) */ }; #define n_hash n_desc /* used internally by ld */ /* * Simple values for n_type. */ #define N_UNDF 0x0 /* undefined */ #define N_ABS 0x2 /* absolute */ #define N_TEXT 0x4 /* text */ #define N_DATA 0x6 /* data */ #define N_BSS 0x8 /* bss */ #define N_COMM 0x12 /* common (internal to ld) */ #define N_FN 0x1f /* file name symbol */ #define N_EXT 01 /* external bit, or'ed in */ #define N_TYPE 0x1e /* mask for all the type bits */ /* * Sdb entries have some of the N_STAB bits set. * These are given in */ #define N_STAB 0xe0 /* if any of these bits set, a SDB entry */ /* * Format for namelist values. */ #define N_FORMAT "%08x" @i0 k:< 2i 8i 8i #define NTE 2 #define NTM 1 ((@i2 k: 2i 8i 8i #define NTS 1 #define NZS 1 @i4 ktyഁ*2i $<T v#,39BHQZbhow!, 3:BIS [aioz_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_nproc_ntext_ninode_nfile_ncallout_nclist_nbuf_nswbuf_proc_procNPROC_text_textNTEXT_inode_inodeNINODE_file_fileNFILE_callout_cfree_buf_swbuf_swsize_swpf_buffers_cmap_ecmap@i7 k:2i 8i 8i #define NVA 0 @i9 khϴc+]82i ????????????P ?`P?h?ph?P???XL???????x?? ?@?H?P?X?`?h((?p?x?) L) ) ) 0* |+ * * ,+ 8+ P. X0 `2 h4 p6 x8 : ; = > @ A C D F G I J L M O P R S U V X Z L[ X\ ] 0^ <Z Z ` ,L[ x[ \ \ ] (] Ta `b b c c 0c <\c hc c c  c 8^  '/5@,IS\fnyttt(!*3=GOXblvPX`hpx$,6@HR\dnx )3=HR[eoy_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_swapmap_nswapmap_argmap_kernelmap_nummba_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_numuba_mbdinit_hpdriver_htdriver_mtdriver_mbsinit_hkint0_Xrkintr0_lpint0_Xlpintr0_tmint0_Xtmintr0_scint0_Xupintr0_udaint0_Xudintr0_dnint0_Xdnintr0_dhint0_Xdhrint0_Xdhxint0_dhint1_Xdhrint1_Xdhxint1_dzint0_Xdzrint0_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ЭPԠ ЭP֠ 4D<Z/ <"~< ~<~yԨ4< PʏPP1nWPЭPР PPPPCKV$Ef1ZѨD%j ˏDP@P PPMf1/ЭPԠ Ԩ4ը4[ѨDOf ԭԨ4ԨDЩ,ԩԩ$Ъ 2PPPPP$Zթ W >2M=X2rR >2B8X `7 @7 007qxUup%d: not ready (flakey) up%d: word count != 0 up%d: write locked upcs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPEup%d%c: soft ecc sn%d sc%d<%d>sc%d: lost interrupt upsc@x H PW ]x lr- m f l ^t j x ( t :f Kry y f ( * yl z 18 RY s |  k f cl p(  z   OX ^hr| \ j m   -w 3: V ^ ow u| t    k  f  l  t  ' : B I  R k e f w t l  l   c }     l k #,39BHQZbhow!,19@IR[dmu~,H( x!+3>FOU\cthtnts(z  +4:BL V`PiTr{X`8XX 6 ).8BHKSX]elqy~@|  _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_cpu_percpu_nexus_cp_time_dk_busy_dk_time_dk_seek_dk_xfer_dk_wds_dk_mspw_tk_nin_tk_nout_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_zdmap_zvmsU_ARGU_QSAV_swapmap_nswapmap_argmap_kernelmap_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_numuba_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_up_softc_up_sizes_fj_sizes_upSDIST_upRDIST_upminfo_updinfo_upip_upstd_scdriver_upprobe_upslave_upattach_updgo_uputab_upst_up_offset_rupbuf_upwstart_upseek_upwaitdryL191L197L202_upwatch_timeout_upstrategyL212_disksort_upustart_upstart_iodoneL228L252_printf_ubagoL272_upintrL276_harderr_upecc_ubadone_upreadL330_u_minphys_physio_upwriteL338L344_ubapurge_getmemc_putmemc_upresetL356L372_ubareset_updumpL390_ubainit@iM k}Ǵ" QGX Q]f62i h8\@P@Y[4P(( Щ ZPPЬ[2Pv@2 P2QxQQQxPPPQ[a2PЏ@}PxPPP[[KbZ2PP@DYPi(i 2~!ݪ$iP ^P@[ЬP@ЭP֠4ŏP@ZЭPР'ݏZ2~PˏЭP PȏPЭQPk ^Ь[2PPPxP2PPPxPWW1G5ZЪ$YZxPhxPlGի  PPxPlGP2P,P@Xը [ ШP[ [ԫ ըԨթ,X,Щ0PXX0թ4>,թݩO l2~YPYPk[9^Ь[2PP@!WЫ,Y2ԫ4#ի [~2~PЩ Z ԩЩ,֫4ЫЭP2PPg; Z2g~ЭP2PˏP~ 2~}2PPPxPP@qV1|[rPX﷧: Щ,92 ~F 'ȏ(21PP&P'P*, ȏ(2P ݭZ2~PZj!P"PP 2PPPxPP l ЪPQxQQQPlЭ$ȏ(2,xPP?֩$2P@1xP2QPAթЩ,Ы0PYY0ԩЪ 2P,P@YY ЩЩPZ Z1^ЬP@[ЫZPP@XŏP@W2~2h~ 2hPP 1q2h~ݬ gݬ V2PʏdoPP h[6P*QQQPPh PȏPPP2QPQ Pȏ PQPPxPPPh2Pʏ?PP@hШYHP >@Lh28 7uda: ubinfo %x uda: um_ubinfo == 0 raudasa %o, state %d uda: bring unit %d online udintr: state %d, udasa %o uda%d: random interrupt ignored uda%d: interrupt in unknown state %d ignored uda%d: fatal error (%o) uda: purge bdp %d uda: command ring transition uda: unit %d online raOFFLINE uda: unit %d attention rastatus %o uda: unknown packet uda%d:%d: %s error, softhardcontroller error, event 0%o host memory access error, event 0%o, addr 0%o disk transfer error, unit %d, grp %d, cyl %d, sec %d, trk %d, lbn %d, retry %d, level %d SDI error, unit %d, event 0%o, cyl %d small disk error, unit %d, event 0%o, cyl %d unknown error, unit %d, format 0%o, event 0%o uda%drauda f R v #v IOY dl i k { f } { f j *g N k i i /s x\    f \   CL el wk e  \ 9 n\ T W X t 2j Bf Sg Ze ho    \ t ]d o e    e  &l   & : s { i e    e   P s t T    8 A R Y }       ( g ; f q g { r   {  + r 1 8 M j k r f k s s t s >t NDHLTX\k `dj #,39BHQZbhow!,1:@GOW]h,q{H(xtt t( )4=DNW`hr{ $-3;EPUh_hqz 28XX,  #,49CL U_&glt~,$    > `_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_zdmap_zvmsU_ARGU_QSAV_swapmap_nswapmap_argmap_kernelmap_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_numuba_cp_time_dk_busy_dk_time_dk_seek_dk_xfer_dk_wds_dk_mspw_tk_nin_tk_nout_cpu_percpu_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_udadebug_uda_softc_uda_ra_sizes_radsize_udminfo_uddinfo_udip_udstd_udadriver_udprobe_udslave_udattach_rudbuf_udutab_udwtabL185_uba_hdL189L193_udopenL200_u_udinit_sleepL212_uballoc_udstrategyL221_printf_udstart_iodoneL243_ubarelse_harderr_udgetcp_ubasetup_udintrL274_wakeup_ubapurge_udrspL320_uderrorL363L386_udreadL392_minphys_physio_udwrite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azyERROR LIMIT h G{] ` a h )h 0$ n o R 1p Cn q r (s <t Lu ^eq h $ y Ap [y j$ h 5y @y IP~ Y_X v}~ $ h  ~ (L 4! Fh XL ~ ~ ~ !)0q 6Oh $ r #,39BHQZbhow!,19BLT_dmsz,ttt(!*3;ENW`jt|H(x~ )1:FMRZdm r|   0' ,T9XC`MR>\a_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_cpu_percpu_swapmap_nswapmap_argmap_kernelmap_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_numuba_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_bdevsw_cdevsw_linesw_swdevt_nexus_cp_time_dk_busy_dk_time_dk_seek_dk_xfer_dk_wds_dk_mspw_tk_nin_tk_nout_ubasr_bits_ubagoL167_uba_hd_ubasetup_ubadoneL185_ubarelseL191_sleep_rmalloc_rmfree_panic_Sysmap_usrpt_Usrptmap_vtopte_uballocL229L233_wakeup_ubapurgeL249_ubaresetL258_printf_ubainitL269_unhangL284_ubawatchL295_ubawedgecnt_ubacrazy_ubaerrorL307_ubaremapL324@i^ kfǴle ~B 52i88  88PQQPQ^ V PPPPڎP[R~<-rhbUڮn^ݏ@ڮn^[Pڎ6ڮn^-$P%PB~jPP( |PPPpyڮn^ݏAڮn^l Ь[ѫ  k[&ԫ PPPPڎPZ  [ P[ [ ZPڎ[kPPPPPЫy sd~^2V~nPSkPPPEЫEЫA"4 ێPPPPZێPPڮn^ZPP )RnnZ1<~<}~p~`n`[kЫ R[=GZ :20>Z PPP~2~P1W zus x1.kZW \1C8;PPJ-PP@-11@ݏ@ڮn^ [(zs1kX[pmPP~BYTiWЫ GQ$[*1#~~ ڮn^1Z#1)ێPPP`~ڮn^PP,l"7iqTݏ@ڮn^> /8%"1=ێPݏ@ڮn^ ڮn^&1D ێPPݏ@ڮn^1sfl1f\S1+CPPR5PPH? 3ڮn^1c1. 1Ь[ЬZx YGL(Ua fn6w|   _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_zdmap_zvmsU_ARGU_QSAV_cpu_percpu_tudebug_tucmd_tudata_tu_tunull_tuinit_tutimer_tutab_tuopenL104_u_tuwatch_timeout_tureset_sleep_tucloseL120_uprintfL128_tuxintr_tustrategyL134_iodone_tustartL144_tuchk_turintrL152_printf_wakeup_harderrL202L236L246@if k`ִsk 42i X` Ь[Z8&[62>(>>&<[[PWQPQ"<Z28PPPPPxPPP`[PVQPQPP[ժ,[ݪ,[2>~[ Y [j ZY[A [Z [Z["Y[ [PXQPQ [PYQPQ3"YZݏ_P@Ъ,X XIZ@Y0Z['[PDQPQ"Y Z  Z ^Ь[ЬZ:[[:[Z~[[ D2:PʏPP 0BPP[Z~[BP[PPB[:>Y[PQPQZݏ\Q[[a [z [[ : Z #Z~[ BZYKX[[XPP[&.f[Z~ɏ[~ii:PPXXi"iPPPP~P[X[i :PPXXiPȏPPPP[[[ii1z:[1n :PPXX [ [XXiѭ Z~ݏ&֭ Ь[<PPPZի 6ZPڎի  [~PP kP[[ Pի,P``ZPڎP^Ь[GP2@<PW1\Ld ?PdPPYޭZYZ@1#P][$<ի,=5P`` YYYP[P[~ѫP:nYPYP19[~[<[~**Yj?PYX7[~bYѫPѫPY1:YX[~XZ2PWWXX%BPXPPBXZXY[ 1 ({)}!|^~'`S S "S PV  Y  Z [ \  LP  Z _ ` b "M 5b `\ \ d 9 e !f Bd g[ [ _ ` \ N '[ W^Z pN wN [ O [ Li [ Y l /m 8GS Qn y( S S S q S \ S S n S S S ,m Va\ sm }O Z N \ #,39BHQZbhow!,H3(9x?F O X~agry} &,/9BKT]fnw B\ ",6?JOT\ ahouf~_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_tthiwat_ttlowat_pidhash_proc_procNPROC_nproc_qs_whichqs_inode_inodeNINODE_ninode_rootdir_mpxip_file_fileNFILE_nfile_bdevsw_cdevsw_linesw_swdevt_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_cp_time_dk_busy_dk_time_dk_seek_dk_xfer_dk_wds_dk_mspw_tk_nin_tk_nout_partab_maptab_ttyopenL130_u_ttycloseL137_wflushtty_canonL143_getc_b_to_q_putc_ttstart_ttyrendL172_sdata_wakeup_ttyinput_ttyblockL186_flushtty_scontrol_gsignal_ttyoutputL214_max_ttreadL260_passc_sleep_getf_ttwriteL276_iomove@il kAE{m42iۥۥ l$ Ь[Z8&[62>(>>&<~,1Y1aR0[PCQPQ [PDQPQZZP/ [[PCQPQj1ZZP 1[PDQPQW P&jPHQPQj~@R[\RRRZ/%BZ[u [PXQPQ1:BP­PPPBP­PPխ1Z׭jGPЪQ2@PQP11Z[Ps P 2>~zժ,>Fj Z_DZ[RP* P 2>~<ժ, ݪ,-Z$Z[ P <VW<P11^Ь[ЬZ:P&PPZ~[P[P[[[:[ i2:PʏPP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9x?F O X~agry} &,/9BKT]fnw N^ F'j0;DNW_> gm x z     _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_tthiwat_ttlowat_pidhash_proc_procNPROC_nproc_qs_whichqs_inode_inodeNINODE_ninode_rootdir_mpxip_file_fileNFILE_nfile_bdevsw_cdevsw_linesw_swdevt_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_cp_time_dk_busy_dk_time_dk_seek_dk_xfer_dk_wds_dk_mspw_tk_nin_tk_nout_partab_maptab_ntyopenL130_u_wflushtty_ntycloseL139_ntyrendL144_b_to_q_sdata_wakeup_ntyinput_ttyblock_ntypendL160_getcL167_ntyout_flushtty_ntyecho_ntyretype_ttstart_scontrol_gsignal_unputc_ntyrub_putc_ntyoutput_ntbreakc_catqL262_max_ntreadL319_sleep_getf_passc_ntwriteL359_iomoveL391_ntyrubo_panic_nextcL428L436L447L461L465@iu k'^32i D(Ь[TUVWXY#C@DJKLMNOPRЬ[P<[$<[~ի[P Ь[APPZ [~QP[D;[~4<[28PPPPPxPPP`[~P[P@HIRZPڎ Ь[ kPPZk[F <Z$[~W~P <E[&Ь[~s<[ Ь[PPZ!<[$ZPڎ $^Ь[< P28ЬPPvt*1Pt1P tcPt1AP&>["  2&~P tW1Pf1)PPrt Pt/1sPut#1gP~t P}t 1PPtЬPPtt11P t11Pt11PPt1fAݬ ߭ ^P11߭ݬ  ^Pѭ e1tPA[AP(PP`խݬ [ݭ(PP`"AP1$<1<1߭ݬ / ^P1UPA#Ѭ t [O[P1A: Ѭ t [e2:PʏP2QʏQPQJ% [~[( k [P( `kޭP( `  Pի  v[m < FGCD::1<[1FGCD:ݬ ߭ ^P151 <1լ ݭ[o1߭ݬ  ^P1T[~ݬ  ^P1ݬ T[~ ^P11dJ[~ݬ z ^P11Dݬ J[~Z ^P11$APP8P PGݬ ߭, ^P1R1ի ЫPPPP[PP P [Ы ܳ":k>[~ݬ  ^P11ݬ >[~ ^P11s߭ݬ  ^P12PPȭPPP1L߭ݬ g ^P12PPʭP߭ݬ E ^P1kP1 ݬ P[~ ^P1F1ݬ [~ ^P1*1ݬ ЎPPZ .[1Z[ZAP(PP`1Pt113P t1`Pt1Y1P t1C1Pt1,Pt1iPt11Pt1|1Pst1$1Prt1/1P((|t1,Pvt15Put1n1Pwt141sP~t1hP}t1|1VPt1$1G|`{}~ABCDEFGHIJKLMNOPQRSTUVWXYZddddddd22xxx}}}}ttrstrt: arg was 0! ioccom canqoU X Y Y 9 X X @]\ r` d d .d ;d Dd Ye a hU "f 3d Dg Sh \d y: : d g i (Wj k Y f (g Eg bf g f f i l 7g Sf ng g g f f m d "d =: #,39BHQZbhow!,H3(9x?FOX~agry} &,/9BKT]fnwDH " x  "%.7?GNT[dl_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_tthiwat_ttlowat_pidhash_proc_procNPROC_nproc_qs_whichqs_inode_inodeNINODE_ninode_rootdir_mpxip_file_fileNFILE_nfile_bdevsw_cdevsw_linesw_swdevt_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_cp_time_dk_busy_dk_time_dk_seek_dk_xfer_dk_wds_dk_mspw_tk_nin_tk_nout_partab_maptab_ttycharsL130_wflushttyL135_sleep_flushttyL145_getc_wakeup_ttyblockL164_putc_ttstart_ttrstrtL174_printfL181_ttioctlL187_u_gsignal_Copyout_Copyin_nldisp_canon_catq_panic_ntypend_Fubyte@i{ kH䍴  i9T.22iHH  HЬPdYYЬPPPPPZ[PЬP PPPP[[!4[PPPY`KZ=[P2~@'[ "[ 4PPiԩЏ@B Ь[P4PPPZ[ [61 2~ 2~ݏ2~ݏ2~jЬ[4[P@ZKYЩX2=,[PZ,[P4,[P@T2~IPWWWW,2@jX ,PPWWPWP1*֨12PPP,PP[PЫ$PP P 11y«1q 18Ь[2PPZ4ZP@@Y2PPP,PP[P: PѩP P<QQPPЩ P<QQPPP P2~s2~P,P@t2~3X2~P,P@t4gPP[[KOX4[P@4YxPPZZZPPXH [12PPXԫ4ԫ0Ы0,4XP@ 4XP@ի$xPˏP~M[HZ4Ѫ$[.),XP@|Yԩԩի,Y,Ы0PYY0X[XX1. ^4PPP[P,P@ZЬPPmPm1߭ݬ  ^P2PPbbbblllЭYYխY1ݭ2P@2~%ժ$ ;ZmYЭYjⰫ䰫ݬ ߭1 ^P ^ԭ P[ˏ(PРZZЏ@BXXЫYY-ѭPЭPPZYPݭF­խYxYoYV<PPPY>PЬ[ЬZЬ YY#XZPPW ɏ [[Wh Ь[<ZZݬP:L  ts%d: not online ts%d: no write ring ts%d: success ts%d: write locked ts%d: offline ts%d: hard error bn%d xs0=%bTMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOT xs1=%bDLT-COR CRS TIG DBF SCK -IPRSYNIPOIEDPOSPOLUNCMTE xs2=%bOPMSIPBPE CAF - WCF - DTP xs3=%bLMXOPIREVCRFDCKNOILXSRIB tsintr ts%d<%d>tszsfj ub p s p j $3F^sj {a _ _ _ w (J_ oz | } b c )]b ij   _  f j a b 7j      $ - LS t{ `  ` +2 LS n_ j _ #)p 2 H` NU cip r `  b p j p a  ) j 7 j P W ` g b c   j _  p  % p c n  p p Z b b  / T l u ~     b $a #,39BHQZbhow!,1:@GOW]h,q{H(x tt#t((/8ALU\fox, ,&,. 5 ?H:QL[b4lqv{Pf<  4(( ',49AHRW_dlu}Z     _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_zdmap_zvmsU_ARGU_QSAV_file_fileNFILE_nfile_swapmap_nswapmap_argmap_kernelmap_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_numuba_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_cpu_percpu_ctsbuf_rtsbuf_tsminfo_tsdinfo_tsutab_tsstd_zsdriver_tsprobe_tsslave_tsattach_tsdgo_ts_softcL176L183L188_tsopenL193_u_tsinit_tscommand_uprintf_tscloseL207L213_ubasetup_tswaitL222_sleep_tsstrategy_iowait_wakeupL237_tsstartL245_ubadone_iodone_clrbuf_ubagoL269_tsintrL273_printf_panic_tsseteofL336_tsreadL344_tsphys_minphys_physio_tswriteL352L357_tsresetL363_tsioctlL379_Copyin_geterror_Copyout_tsdumpL412_ubainit_tsdwrite_tseofL425L431L438@i kn"K ;q812i  ,H ЬP@ ~PPPPЬPР$PЬQ2QA^PP[[![PPPY`KZD<2 PxPPɏAPȏ`LEݏ@2~& < PʏPPAC[ * 8[ /ЭP<QPQ"[ ³ iԩЏ@BP%Џ@B~2~P Ь[PPPPZ[ [2-2~62~' 2~2~jP2@P,P@[Pիkȏ@k[k kPά Ь$ԫ [*լ [ӏ@k [ʏk^Ь[2PP,P@[Yԫ PЭP@FPР$Zթ  [ ԩժ,Y,Ъ0PYY0ЩP[ [ժ4 ZP ^Ь[ЫXЩ,Ы,YЩ Z2PPЭP@VPP@WЫX2 PxPPPh g$jի [yԫDЪ Zh2PPP2@VP,PPZP[Ѫ$@Ѫ$ 42,(4ݏ,<ΪP P~PPѪ$ Ѫ$ 11 PP j1O PPjЪ$Z1.j  PPЧ PѭP>ΪPPjիD  4<PɭP<VY4 PѭP$ PPP $ P­PPݏ,<2PPP P~PP<PȪ$PP Ь[ЫZxPʏPȫPP^ЬP@ZЪ,ЭPР [2PPЭP@PРYPPPXѪ44i2,Џ@Bi kЪ4WԪ4<PP1,i@ib[$WΫPPԪDЭPЫ 2PP$Z[ЭPР,ЭPՠ 1QԠժ,18Э,192PPP2@P,PP[Pktetmm Ad _k nb }r  s $u +r k v}w k d _ /s Xg| y} c b 8b Dk   d _   D    >a db tk   =d G`  d `    #d -_ k  d  w b k /d 9_ r  d `  r  d  `   ' b 6 r B k K r i a   b c  k $ k 4 W k h d s _ r r   r  g u r Z b b     6 Q   b $a #,39BHQZbhow!,1:@GOW]h,q{H(x tt#t((/8ALU\fox, ,&X.6 = GP$Y*c jt yFv  "(07 <2DIS[bglty b D z  >   _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_zdmap_zvmsU_ARGU_QSAV_file_fileNFILE_nfile_swapmap_nswapmap_argmap_kernelmap_klse((ql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_numuba_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_cpu_percpu_ctmbuf_rtmbuf_tmminfo_tedinfo_teutab_tetotm_tmstd_tmdriver_tmprobe_tmslave_tmattach_tmdgo_te_softcL177_badaddrL183L187_tmopenL193_u_sleep_tmcommand_uprintf_tmtimer_timeout_tmcloseL215L221_tmstrategy_iowait_wakeupL234_tmstartL244_ubadone_iodone_imax_imin_clrbuf_ubagoL276_tmintrL280_tmseteof_printf_panicL321L328_tmreadL336_tmphys_minphys_physio_tmwriteL344L349_tmresetL355_tmioctlL374_Copyin_geterror_Copyout_tmdumpL407_ubainit_tmwait_tmdwrite_tmeofL421L427L434@i kNQ d 502i d`^Ь[PǏPǏ Px PPP PPPP k[Ǐ PPPPxPPvx PP  R[2PPPPPPP`.ݬ# ݬ ^P[<PʏPP`[2PP[2PPPPPPKZ*j!ժ/ÏZPP~Zj  xPx PP[1[&ZZ2Z[M oZPP~SZ~Z~[Zx PP[[1qswstrategyargmapswap7 TB e n ~1 C . F ? G F ? G L M ?N HO ZO m vN }1 N 1 N 1  1   = R < -; 4R @; GS N Y #,39BHQZbhow!,1:@GOW]h,q{H(x, (/7<EMV[d ipwz _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_zdmap_zvmsU_ARGU_QSAV_inode_inodeNINODE_ninode_rootdir_mpxip_swapmap_nswapmap_argmap_kernelmap_rswbuf_swstrategyL110_iodone_panic_swreadL120_minphys_physio_swwriteL126_vswaponL131_uchar_namei_u_iput_swfreeL145_rminit_rmfree@i k_nZ$%f D02i  X YYP Ь[ЬPkЬP k[a 2ZZ2 PPkP2kPP  ЬPkPЬ[vnt _Y2Pv@D2 P2QxQQQxPPPQ[a2PxPP2P@  ^Ь[2PPPxP2PPPxPXX1HZ2P P@Yի Ы PxQQPahЭP2QQPxQQP$P2P,P@hW[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ЭQ2aQQPЭQ2aQQPRQRRPЭPYxPPPiyέPx PPPPy2P2@PPPyݭ)2PPPx PP­խѭ1P1P >0'l >+i ~0B/B 00F7 irk%d: not ready (came back!) rk%d: write locked rkcs2=%b ds=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSSVALCDAPIP WRL DDTDRDYVVDROTSPLSACLOOFFDRADCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk%d%c: soft ecc sn%d hk%d<%d>hk%d: lost interrupt rkhk={   { [ m g u 1l Gt   V t ":J[kg w v Hvg u u V X 7l K   ' 2BPj sz u  k 0g rl V   &- I  m m nu u   : b   z    ! z ' . J t  > N   + ? z v C _ k |  g  l t   ! *k =g Ot Xl |  l  d .DRh r  dul k  #,4=DJSYbksy *2=BKQX`hny,H(x ttt!((1:ENU_hqy #*5>DLVal,u~04~XX\tX  "+7<FPYafksz 4   X &+4_rkpip_rknosval_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_zdmap_zvmsU_ARGU_QSAV_swapmap_nswapmap_argmap_kernelmap_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_numuba_cp_time_dk_busy_dk_time_dk_seek_dk_xfer_dk_wds_dk_mspw_tk_nin_tk_nout_cpu_percpu_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_rk_softc_rk7_sizes_rk6_sizes_rktypes_rkminfo_rkdinfo_rkip_rkstd_hkdriver_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PPP^PPPP[P2@ P,P@ZЬPPmPm1߭ݬ  ^P2PPЭYYխ2P@eWW 2PPWY@ݏݭlPVVW2~2Vر&ժ$!Z3YЭY1}j 谫2~ݬ ߭ ^P ^ԭP[ˏHPРZZP2QxQQQPPYA8t 0 3 RDYPRESONL REW PE BOT EOT FPTAVAILSHRMAINTDSE mu%d: not online mu%d: no write ring mu%d: can't change density in mid-tape mt: wrong unit! mu%d: blank tape mu%d: offline mu%d: no write ring mu%d: hard error bn%d mbsr=%b er=%x ds=%b mt: unit %d random interrupt mu%d: bla((nk tape mu%d: no write ring mu%d: offline mu%d: hard error bn%d er=%o ds=%b mtmuR ~S R S J Y 0LS[ ZY R S H _ <Ka ]b |S J d R S H Cf g g R _fj R k j 6=j bS lG j #*j MR j S H g -g Y`j j S H Y p S G %q 28Y Ap SS ^G dkq ~S J Y Y R R S H  Y , w : Y o  g  Y x  y  Y . B 6 J D J   $(J #,39BHQZbhow!,1:@GOW]h,q{H(x#)16>,F,Nt W_x is|88   j#(27?DINVafnsp{*$ _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_file_fileNFILE_nfile_zdmap_zvmsU_ARGU_QSAV_swapmap_nswapmap_argmap_kernelmap_nummba_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_cpu_percpu_rmtbuf_cmtbuf_mttypes_mtinfo_mtdriver_mtattach_mtslave_mtustart_mtstart_mtdtint_mtndtint_mu_softc_mutomt_mtds_bitsL144L148_mtopenL158_u_mtcommand_uprintf_mtcloseL172L178_sleep_mtstrategy_iowait_wakeupL193_mbustartL201_clrbuf_minL217L223_printf_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[IIԫZЬ[ [kЬ[ЬZPPYj k k[Z~Z kYPڎ ^Ь[[ZPP[PZ2~`Z2 ~SݭPڎЬ[PPZ([Y&k[rPY~ i[~ݬ ݬkի [1P[kݫ@ݬ@[~ZPڎЬ[ЫZjPPPYP@EZ~Z[ЪZYPڎ[P Ь[Ы[իZPP*[kPP@[2PxPPPZZ[PЬ[PPZЫYxZZPPZЩYթZPЬ[PPPQQQPQQP2@PPP2QPQ[ZP@[k֘P@XPPPQQQPQQP@4 YZЪY[P Ь[ЫZ jPЪZZP @ @M G )9M @M HM \R sH 4 4 S M V 4 W  M P %M *M 3[ BP LP UQ |5 6 S G 0_ :B5 j6 s4 {4 W ` W M e M M $M 5M CM _V sM Q M M M M M M  : 2@M NUk [M M M M m M e  M k "M CSM ZM bM lM tM : M M M m V M M M *M ObP ou uQ |Q 4 W M x 2M IXex nx V V M | 6M\x rM M ~ k   & x 5 x _ j x k M M   V x  k )  5 x X k w M ~ e M 4 4  m $ ] j y (( x  x x x x x x  x  D S \    M V    & V ? ~ o | x 2\#,39BHQZbhow!,H3(9x?F~OU`gkt }  &,/9@(HQXbjorz2n   ^  %- 2L 90AIR[dir wp b  D  ~ `    ! ) 0 5:?EJR W]bg lqv {_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_tthiwat_ttlowat_inode_inodeNINODE_ninode_rootdir_mpxip_file_fileNFILE_nfile_bdevsw_cdevsw_linesw_swdevt_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_chans_groups_mpxline_cmask_mcdebugs_getmpxL127_u_mxopenL133_mxnmbuf_nmsize_addch_plock_mpxname_scontrol_sleep_prele_chdrain_chfreeL154_uchar_mxcloseL162_zero_iput_detachL188_m_eot_mxreadL196_getf_msread_nextcp_cpx_sdata_mcread_iomove_mxrstrt_Copyout_mxwriteL233_mswrite_xcp_mxwcontrolL255_mxmove_passc_mcwriteL266_wakeupL274_msgenabL289_gsignalL306_q_to_b_b_to_qL315_mcstartL326L332_chwake_mxioctlL353_Copyin_sioctlL369_wflush_flushL380L384L390_getcL397_tsleepL403_putwL409L420L428L439L445L457@i kЭ9-&PP P0P~PP152P[PЭQPЭPݭЭKЭPЭAЭPԠЭPЭ ЭPЭPЭPЭP[x[PQQP`[ЭPЭЭPԠݭTPЭPРЭP<PʏPP MP01t2PʏPPݭݭPЭPݭPЭP2PP2PPPPPxPPPď`PPЭPՠ,1ݭ,PЭPЭ,ЭPЭЭPЭPЭ ЭPЭQA ݭ1cݭݭDPP1P+Pݭݭݭ PPPQݭݭPPݠ ݭЭPРPЭPЭЭPЭPЭխP PPЭPЭ2PʏPPݭPխ1ЭPԠЭPP ЭQР ЭP5$ЭQ$1ݭPݭ PЭPРЭP<PʏPP[[ 12ЭP2PP2PPPPPxPPךPď`PPPЭPР Э[ЭPЭ ЭPЭQA$[ЭPЭ,ЭPЭ ЭPЭQA#խݭݭ8PP1Z(&խت&խ ЭP2&2&ݭݭPPݭݠЭЭ[[K[[K[Ь[^k k5kUիPЫP2P[YЩZXݩ oZ'H!ի ݫV[M[DPk[5 Ь[ PPZZP[J#Z^Ь[ЬZ[ZRP PZ[[PիPPPYI[IZYPYY ZЬ[ZЫ[ի[PZPլPѬP[ZݬPxZQQP`PYPY[YP[PP[ZZ[P= +< x> > F I J F M WF gN : O ? 9 P 9 :   Q +F COR bS i> }F > F S F T U F V +J :> N X F ?9 jY X F Z Y Y +>R ? N N @9 F Y F F Y ] &F <A LA _ _ ` a b F d F F 'F 5#,39BHQZbhow!,H3(9x?F~OU`gkt } ( %*n38;BGNU^ ckqyV p ' ,1_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_tthiwat_ttlowat_inode_inodeNINODE_ninode_rootdir_mpxip_file_fileNFILE_nfile_bdevsw_cdevsw_linesw_swdevt_chans_schans_groups_mpxline_mpxdev_mcdebugs_challocL109_gpallocL120_u_addchL129_plock_prele_mpxchanL141_Copyin_getf_mcread_mxopen_ialloc_falloc_iput_uchar_namei_maknode_mtree_cpx_xcp_wakeup_detach_mxfalloc_gsignalL246_closef_chdrain_chfree_chwakeL261_ufallocL268_mup_mdownL282L289((@i k\Vt 3 .2i PPxy1ЎPPP PPPYYɏY:ڮn^ h[][~jPZ ?PP~ZMPZZ"[~4 ^P1CLRYaioz,!*1:CLU]fnw~ttt((1:BLU^gq{l _zdmap_zvmsU_ARGU_QSAV_bdevsw_cdevsw_linesw_swdevt_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_mmreadL140_u_Fubyte_mmap_min_Copyout_kernacc_useracc_UNIcpy_mmwriteL171_CopyinL194@i k%ﴁ.2iբբ |Ь[ЫZ[kPРP`P}\,ԫ$ԫ4Ъ ZЫHYԫ<թ,[,Щ0P[<[0$i Y( 2 P@wx PPk$^Ь[]Ъ<,VЪDPˏPP\ЭP2PPPxP~jPݠ-ЭPР Ԫ4Ԫ$ݭЫ,ZЪЪDPӏ@kjPՠ ZjPР P`PX 9P 1PPXЪ@YZP ЭPΠPPXD -x PPs2 P@hЭPxP2 QPAR^4P@?[ЫZЪЭݬDPˏЭk1Ы,YxPPx PPЩXݭYiPРP`P,P8PK<ի, k [:ԩ4Ш Xkԩ$Щ<,թ Ypݭ PPPPWWxWPPG YiPՠԩ$YiPРP`PP#Ph1gԩ4ЩXШ Xթ^Ь[Ы@ZЫZWЭPРP PЭPˏPP Pӏ PЭPР(PPЭӏIYY1ЭPxYQQP`Q YЭPxYQQP`QɏQY4ЭPˏP PP@X׭~XPX`QɏQӏ!ЭPÏPPƏP@X9ݭݭPX'hP XPX`QɏQ׭ԇЭPЬPЬP DTBUSYNRCONFCRDCBHUNGPGENEDMCPEATTNSPEDTCMP DTABT DLT WCKUP WCKLWR MXFMBEXCMDPEMAPPEINVMAPERRCONFRDSISTIMORDTIMOmbustart%s%d: not ready mba%d: control bus hung cbhungmbintrmbintrmba: zero upagemba, zero entry'.f Cg t' % j g d% ( ) J j f % GNf btg g Z@ f o p #q 3r ELf #,39BHQZbhow!,5>GPYajr{,H(x~ %)2;EMX`hpyttt($.9CHOW`emwp_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_cp_time_dk_busy_dk_time_dk_seek_dk_xfer_dk_wds_dk_mspw_tk_nin_tk_nout_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_swapmap_nswapmap_argmap_kernelmap_nummba_mba_hd_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_mbsr_bits_mbustartL161_panic_iodone_mbstartL183_printf_mbasetup_mbintrL200L231_Sysmap_usrpt_Usrptmap_vtopte_mbainitL253((@i knnU' _.2i 8Ph(ЬP2P(PPP[ ЬY@iXXiPPxPPP[P#([PPPY KXVШZ2jPPC rP$PPP  M~2~;P 2~PxPP(P@[ 2~gݫ$ PxPP(P@Y'Щ$PРZ[Z~2~[ݏP[Ь[PxPP(PPPXt[a[z [][PP`0P{P|#P}P~+(W)W'W !W^WW2~pר-[ШZШY[ 1[PP?T KpZY 2~YZ~ZYj 2~YZPPPZ^ըYU[2~`[ Ԩ֨YZPPxP~PZZ[2~YZZ2ZZYPxPP(P@[k GPPxP~C ![k P![ݬP(P@ZЬP@YЩX@hj[ժ  ZP h: j 2hPP@h[j   Z=ժ  PxPP(PPP[PxPP@ZЪY  x~2~  iki2iPPPxP~ ~YI['2PPYEzЫZ@jYYL lp%dlp9 K9 \: kC ~C D  F 9 J 9 5M CMC ZN x9 +Hn9 S - 4S @T T9 `: {V W 9 :  F LS a: {[  : H (x#,29AIOZ,cmq{ #,5=FNW^gpx  ( 2"%.6?dHQV^ glty~JZ_zdmap_zvmsU_ARGU_QSAV_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_swapmap_nswapmap_argmap_kernelmap_numuba_tthiwat_ttlowat_lp_softc_lpinfo_lpstd_lpdriver_lpprobe_lpattachL128L132_lpopenL139_u_geteblk_l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 1iЬPР[[ݬ()*,: x { CORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLAtu%d: not online tu%d: no write ring tu%d: can't change density in mid-tape tu%d: hard error bn%d mbsr=%b er=%b ds=%b tu%d: hard error bn%d er=%b ds=%b httuQ SR wQ R J Y  '[ .Y gQ R H _ &5a Gb fR nJ d Q R H YR cH f ZQ R G q{h i NQ nR xH i ,R 6H Y n R G o Y n R G #o 6R CJ RY [Y pQ Q R H Y u Y . 9 Q Y Z v w Y B J J . F O X     $(,0J #,3((9BHQZbhow!,1:@GOW]h,q{H(x#)16>,F,N W_ is|:8( x  ^V  T%*49AFQY^fk(s| p   _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_file_fileNFILE_nfile_zdmap_zvmsU_ARGU_QSAV_swapmap_nswapmap_argmap_kernelmap_nummba_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_cpu_percpu_rhtbuf_chtbuf_httypes_htinfo_htdriver_htattach_htslave_htustart_htdtint_htndtint_tu_softc_tutoht_hter_bits_htds_bitsL144L148_htopenL154_u_htcommand_uprintf_htcloseL168L174_sleep_htstrategy_iowait_wakeupL189_mbustartL197_clrbufL221_mbsr_bits_printfL240_htreadL263_htphys_minphys_physio_htwriteL271L276_htioctlL282_Copyin_geterror_Copyout_htdumpL314_htdwrite_hteof_htwaitL325L332L339@i k1spb Y -2i  8hЬP2P P@@ [ЬP "2kPxPPnPPgP} RЬP2 PvR@ ^Ь[2PPЫPxP2PPPxP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QQPЭP2QQPRQRRPЭP2iQQP2iQQPRQRRPЭPЭ(xPPЭQPWЭP PPWPɏPWWx PPԪ 1ЭPӏӏ@Px PP­խZXѭ1 P1P >&2qv >d`@@6 > >2MPk2rR >%@s?1= a >JT+jRJ2"> 7 `7T / /  2 @v  00=DCLR attn hp%d: write locked hpmbsr=%b er1=%b er2=%bDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBCDVCSSEDPE mr=%o mr2=%o hp%d%c: soft ecc sn%d hp+<* }k | } ~ !Fv Yt gv  u Sxx x b    " 6= QX ^e sw w w w w   s    's -4 Y;B   ,u 3  ` F k     X`dhpt|k #,39BHQZbhow!,5>GPYajr{,H(x *2:CIPWt\tbtg(nw  &. 9 DT O [ f o x , >T  B $,19>C:JS^fknw _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swa((pdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_cp_time_dk_busy_dk_time_dk_seek_dk_xfer_dk_wds_dk_mspw_tk_nin_tk_nout_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_zdmap_zvmsU_ARGU_QSAV_swapmap_nswapmap_argmap_kernelmap_nummba_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_hp6_sizes_rm3_sizes_rm5_sizes_rm80_sizes_hp7_sizes_hpSDIST_hpRDIST_hptypes_hpinfo_hpdriver_hpattach_hpustart_hpstart_hpdtint_hpst_hp_offset_rhpbuf_bhpbuf_hpbad_hpinit_hprecal_hpseekL177_hpstrategyL184_disksort_mbustart_iodoneL198_printfL216L220_hpecc_harderr_mbsr_bits_hpreadL265_u_minphys_physio_hpwriteL273L279_getmemc_putmemc_isbad_hpdumpL305@i kj^2i88 cat assym.s ../sys/scb.s ../sys/locore.s ubglue.s > locore.c cc -E -DLOCORE -DGENERIC -DVAX7ZZ -DVAX750 -DVAX780 -DKERNEL -DVMUNIX locore.c > locore.i as -o locore.o ${AHEADS} locore.i loading vmunix rearranging symbols text data bss dec hex 123060 27528 24628 175216 2ac70 @i k zM2i (<ЬPЬRRQ{RPPR PRPP  &#udivdivnodivretnone@i kE:n@xw7iwE7i (bY/< U i      ʏx_ȏT19^^~8~~8?.?/?^?=KSP not valid?=CHM? in kernel?D ;??~B:??9,??ݮ6:?.1=wtimo????'+??PQ.?PMQ?PQ?PQbRaTBS ScQ?A?S???'???ݮݮ??ݮݮ5?ďP SSPЀQRRRRRPЀRRRԺ?S݀ЎSڱ[ÏHZxZZ?ÏHPxP~~ﴱ99?1`1X1P1H1@18 12 1(1" 11 1 1~ڎ^~|ڎ^ڏڏd ڏ ڏdڏ Џ ^>PKQPaPPyQQRSSRSWWP~W"VhUUU|fUV愈((jRRQQxQQɏRBSQRʏxLȏAQQxQQɏRBQRAjQQxQQɏRBQR98yxWuxiVʏVVxVSɏSS=oPP:P PЏQQ QQARR RQSSQɏSpQ:RaQ P TW X \`[<HԡLx SSSP( ,l[*iPPxP~ n+ݏl PQaRЬSЬT'MTcTcTcPR2Q &0^nЬRâP1PP QzQPPyPPQPPP bP ` `Ԣ Ю P:ЮQяP a%QP Pa ( PPЮ PЮQяP aQP Pa( P}V}X}Z}\^n`P}V}X}Z}\ЀQQ^ L7Q^longjmpՠ %,7 QxQQ~AR`Qsetrq QxQQQ 6`RQԠremrqswtch P1Py~@yQR 6 PRTբLݚSSԢвPPx PP$ +bPWPHPAnЏ ``PP ``P `Q`P `Q`Pɏڏ:(xɏڏ:,nUЬPЬQլ 0яQ `OPQ Q`4PяQ `PQ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ݠe3ji.jPݠe5L[kaZ,ZjYie﹎2PPPPPxPPxQQP2PPP'n2!nPPn2 nPPPPPxPPmQQQP2PPPm2mPPm2mPPrdЩ mЩm ێPP!ێPP[[  [[@K[P Ь[*P#AP@ZP +PЬ[  KPZZPPP Д[[stray scb interrupt nexus stray intr ipl%x write timeout %x ?R?R?R?R?Q?Q?Q?Q?Q?Q?Q?Q?Q?Q?Q?Q?Q?Q?Q?Q?xQ?pQ?hQ?`Q?XQ?PQ?HQ?@Q?8Q?0Q?(Q? Q?Q?Q?Q?Q?P?P?P?P?P?P?P?P?P?P?P?P?P?P?P?P?xP?pP?hP?`P?XP?PP?HP?@P?8P?0P?(P? P?P?P?P?P?O?O?O?O?O?O?O?O?O?O?O?O?O?O?O?O?xO?pO?hO?`O?XO?PO?HO?@O?8O?0O?(O? O?O?O?O?O?N?N?N?N?N?N?N?N?N?N?N?N?N?N?N?N?xN?pN?hN?`N?XN?PN?HN?@N?8N?0N?(N? Nuba?: stray intr ipl %x vec %o ((((bad free countfile system full %s: write failed, file system is full bad blockiallocout of inodes %s: create failed, no inodes free bad countno fs%s: %s updatecallocs@Ń905@@timeout ttrstr argtimeout table overflowfileno imtinodeiputiaddress > 2^24 itrunc ^\ /etc/init$ *:GRZanzreal mem = %d sys pt too smallno memoryavail mem = %d usrptWARNING: preposterous time in file systemWARNING: todr too smallWARNING: clock %s %d dayslostgained -- CHECK AND RESET THE DATE! mcr%d: soft ecc addr %x syn %x mcr%d: soft ecc addr %x syn %x mcr%d: soft ecc addr %x syn %x syncing disks... done halting (in tight loop); hit ^P HALT dumping to dev %x, offset %d dump device bad device not ready area improper i/o errorsucceededmachine check %x: %s%s abort fault%s cpues %x upc %x va/viba %x dreg %x tber %x %x timo %x parity %x sbier %x pc %x psl %x sbifs %x va %x errpc %x mdr %x smr %x rdtimo %x tbgpar %x cacherr %x buserr %x mcesr %x pc %x psl %x mcsr %x params %x,%x pc %x psl %x mcesr %x mchkcp readctrl str parcp tbuf parcp cache parcp rdtimocp rdsucode lostib tbuf parib rdsib rd timoib cache partb parbad retrybad intr idcant write ptemunkn mcr erriib rd errnxm refcp rdsunalgn iorefnonlw iorefbad ioaddrunalgn ubaddriinitbinit0123456789abcdefpanic: %s %s: table is full %s%d%c: hard error sn%d neg q flush rmallocrmalloc swapmap%s: rmap ovflo, lost [%d,%d) bad rmfreeissig psigpsig actioncoresleepwakeupsetrunno procsnewproc vforknewproc i_vfdcntexeceexeca rmallocexitinit diedprocumount|w{|}Ny"ރ mʍȄlƎ@|p܈̋<_‘<0Z0*P|lE0x|0n||$5x0?|| n֑ڍ||||ht|||(|||||||2h|||||||||||||||||||||||||||||||||||||||xfree rssizetextxalloctext rssizelost texttrap type %d, code = %x, pc = %x trapptable faultsyscallvsexpandvmdrum NDMAPvsxallocvsswapvstodbvstodb *ipvmemall sizevmemfreevmemfree vrpagesvmemfree vfdcntmemalldup mem allocbad mem allocmemall ecmapmemall mfindmemall intrans|wantmemfreebad mem freedup mem freemhashmunhashmunhashmunhash mfinddup page unlockvslockpageinpagein pg_filenopagein PG_FTEXTpagein u.u_ofilepagein mfindpagein intrans|wantpagein c_page chgdpagein u.u_ofilepagein u.u_vrpagespagein i_vfdcntpagein pfnumbad c_pagepageout klsizecleanup CSYScleanup centerklustervrelvm rssvrelvm vrpagesexpandvgetptvgetuptexpand Ak@M{@Ķ~@]μ@WARNING: should run interleaved swap with >= 2Mb vbmapswapinswapoutswapout rssizeswapoutswdsptswdspt4 , $  x h X H cpu type %d not configured mba%d at tr%d %d mba'suba%d at tr%d 5 uba'sdr32mcr%d at tr%d 5 mcr'smpmnexus type %x unsupported (at tr %d) not configured tm04/tu78 unsupported %s%d at %s%d slave %d %s%d at mba%d drive %d uba%s%d at uba%d csr %o zero vector didn't interrupt vec %o, ipl %x %s%d at %s%d slave %d %s%d at uba%d csr %o zero vector didn't interrupt vec %o, ipl %x blkdevdup iodoneIO err in pushswap bad ptebig pushhard IO err in swappid %d: killed due to no swap space killed on swap error sorry, pid %d was %s|l|l%'()0|l|l*|l|lpWerlrl$grliklubvw"yp:|l|l6Z2DXCl|l:mvmm|l|l|l|l<;=rl|l|l|l|l:"|"rlrl|l'(.//rl|lrlrlrlrlrl|l|l|l|lghrlrl|l.:rlrl|lG*IJ|L R|l|lrlrlrlrlrl|l|l|l|l(`j`rlrlchd  X7|l|l6xrlrlik rRrsrlr^23rl83rlrl6bvwv~~rlDrlrlrlrlrlrl|l|l|lrl|lrlrl|lrlrlrlrlrlrl|lrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrl|l1œJ|l|l|lrlrlrlrlrlrlrlrlrlrlH"1`|l|lG*IMhN R|l|l|l|l|ll4X[7`[ dh%d: silo overflow dh%d: NXM dh%ddhdm<[@dz%d: silo overflow dz%ddz >&2qv >d`@@6 > >2MPk2rR >%@s?1= a >JT+jRJ2"VH [ 7 `7//\2 @v 00=DCLR attn hp%d: write locked hpmbsr=%b er1=%b er2=%bDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBCDVCSSEDPE mr=%o mr2=%o hp%d%c: soft ecc sn%d hp()*,X'\')r+*-L   eCORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLAtu%d: not online tu%d: no write ring tu%d: can't change density in mid-tape tu%d: hard error bn%d mbsr=%b er=%b ds=%b tu%d: hard error bn%d er=%b ds=%b httuLH2,2  0f lp%dlp DTBUSYNRCONFCRDCBHUNGPGENEDMCPEATTNSPEDTCMP DTABT DLT WCKUP WCKLWR MXFMBEXCMDPEMAPPEINVMAPERRCONFRDSISTIMORDTIMOmbustart%s%d: not ready mba%d: control bus hung cbhungmbintrmbintrmba: zero upagemba, zero entry @ @ >0'l >+i xVVVd\ <p?pB/$ Bd  00F7 irk%d: not ready (came back!) rk%d: write locked rkcs2=%b ds=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSSVALCDAPIP WRL DDTDRDYVVDROTSPLSACLOOFFDRADCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk%d%c: soft ecc sn%d hk%d<%d>hk%d: lost interrupt rkhkswstrategyargmapswapPiiin\PvLv  @te%d: not online te%d: no write ring te%d: can't change density in mid-tape te%d: hard error bn%d er=%b ILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTURtmintrte%d: lost interrupt tm%d<%d>tetmP4vLv^v {`8wc4w  ts%d: not online ts%d: no write ring ts%d: zero ubaddr addr mod 4 != 0 ts%d: success ts%d: write locked ts%d: offline ts%d: hard error bn%d xs0=%bTMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOT xs1=%bDLT-COR CRS TIG DBF SCK -IPRSYNIPOIEDPOSPOLUNCMTE xs2=%bOPMSIPBPE CAF - WCF - DTP xs3=%bLMXOPIREVCRFDCKNOILXSRIB tsintr ts%d<%d>tszs|`{}~ABCDEFGHIJKLMNOPQRSTUVWXYZddddddd22xxx}}}}ttrstrt: arg was 0! ioccom canq^ ({)}!|^~'`ttyrub  ({)}!|^~'` RDTO RDS CRDCXTERCXTMODPPEIVMRMRPFLEBUBSTOUBSSYNTOuba: zero upageuba zero uentryuba%d: reset uba%d: hung uba%d: too many zero vectors uba%d: sbi fault sr=%b cnfgr=%b  PARFLTWSQFLTURDFLTISQFLTMXTFLTXMTFLTuba%d: uba error sr=%b fmer=%x fubar=%o > >2M=X2rR >2Bh|0ww `7 @7 007qxUup%d: not ready (flakey) up%d: write locked upcs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPEup%d%c: soft ecc sn%d sc%d<%d>sc%d: lost interrupt upsc   ((  () Berkeley VAX/UNIX Version 4.2 Tue Nov 3 14:28:37 PST 1981 ???????X ??X X $4<LTdl| ? `?P$??P ? ? ?L`?`?$?$??? @?@@?H@?P@?X@?`@?h@?p@? x?<T v2$2 0'0boot device? bad/missing unit number use hp%%d, sc%%d or hk%%d root on %s0 root on %s0 no suitable root hpschkrdA 0  0'J L} u6 / @+ X7 M/ / g/ / / /=h XCf Y+ c00R c|+* P+ '] +.ZX *P' p(  * * /0 0 / / Z+ ~XWq4at;oDJvG~"9& $ , 4 f8 H  "XX h xx nX7 8!  &@/)`8b@>DMVd_w h`dp wd0d<FddxpP \$&(-5,=B0HRO4q b<iqhy,[ h xD( %  % % %~=A=> %  %  &# ,$&+!2<9FwMUv7]EeOm[ug~)ES0\Pv5Tn\.^ $$N,D46<@ELJTTFd^lhG|r|HIJKB{_ (&N: |(' ,'}  V4' ^8'! v<'* "@'2 D'8 dH'? &J'G L'P N'T_ T'h X'q v\'z w^' `'  d' f' h' l' Jp' G'8  ='S z' ' ('B  t(   x(! (*r(1G8+>8EEsALGS Y+c`hW0Sp (w T) QX)( e\)+, q`) d) h) d) *K>bG -$d,E42d<y(B2J,Rt)XH)_[fpn;v`,~ZDD{  =  -8+ <+9X D+  H+ e  ! ?+ 4 N`+> Qp+D t+K x+)  \ l +t p{ t x k V c/ N.n6d zy$Y.3 / / 0 +3 0) 0 k8  %T P  YY Lfa 1`i . r o,{ { e vTd <z % x| l40  l% >% > ' ' ~ @4( ( 80 ( J @0& 0. H)6 ; Zn+D -L U N.\ \/e /k rt } <0 x0 Z0 1#w 0 0 0 0 0 H0 0  0 0 5 $ "1  V( A3 =:; $5D :5M 0~6U 6^ ^d u7k W0u <} 8 9 p:  8 vx Ane F  PA  *@ L A zz?  f "  D  h ai$ (E+ ?3 lE9 E@ PG ^FO GT J]  Ie Jn y D   E0 iK 6DL (M M N eO O +O kvP P  I X  x UU/U7V'W/ 04X=L\C0[J,`Sx\Yw_oN]en)<_vl} ]1cKekrl|lllllF:mvmmmt n s"v%6-/5 =XFwMUuD\dDkyqyx{~LX{T{@||}~Jp2";NރȄ** wpB܈'%@08?FWM̋U]0eLnmqu {y ʍ1ڍ l,Ǝ‘bh0x2֑PXu x-|'"^?+?h2Ot9AKTA]9f(olw|2hIKq: \ovR̝f 0 f(!(06> GPԤY6 ajtV{MBίlu>ded T2 2 P2R`23f ._R#,55l=bFTPZ` T2f H3nxvt^n1 3 o3  @ n3h  3 "(3 3 3 C0!m*#4Z=hH[Qm[m"f\oxM  H4<b"{ %Z'(G)(0m*  pWe'm$g3ji;kD l((P8uX-bv`wim"yu#Jh EZp4'::Z2IDd<;= :"|"4."'/+/4'g<hEMMVt.^:g:Go*IxJR|L R(`j` c*]h`d   6IxE r RrBs r%^2-M3683?6Hv~Pi~YabDkt|rœJ!H "n` MGhNE2] ƃ'Q0 X[8=?hI+lR\ 5`[deku~^ $h[ %l[  p[ x[ [b ^ j -d14T~$ [< S@*k3E r[L [T ~[_ [iltf|BX$ Y[bF7Y\{( [ *4bV=FLdW [_ \g RX]n Xev \e \`e#6a"  he e_L  %eX X'\'3) r+f*- e |f+  &8(1o`/9?1C2Jp2R 9f\ f0fd k uOH2~,2534d7p9&;W> 8f Q(l Io p  p>J? v?FUVU#2F+sF5 R>SF>SNLGSpGZ aGi G8pr lpzH.T rJV NU U8PHvOr0QC"PXVxTmSS pp tp xpZ$ )d ( 1 p: pC pI4 P Z$xVcLVl@Vvd\} Fp q q :u   S`u }u%`0d=XXs~Zi`c2  u u k v$ aLv- Pv6 gXv> |vFh\M#`W6i`ii9isYnz yvS#k0qdlqr}vu(v v w 4w 8w U@wG4vLv ^v*I {1 [pw; 2wFxwN}xYpc>k$yt~~A~a_hL&~JL? {  w& Q0 r: tC TL cwU w^ wd gk  $u h~ | f Q0 Hw L <d 0x <x x ]x n    b !!!$!.!r6!C>!cF!bN!V!^!f!n!v!~!!!! !!!zι!B!start_scb_Xstray_Xmachcheck_Xkspnotval_Xpowfail_Xprivinflt_Xxfcflt_Xresopflt_Xresadflt_Xprotflt_Xtransflt_Xtracep_Xbptflt_Xcompatflt_Xarithtrap_Xsyscall_Xchme_Xchms_Xchmu_Xcmrd_Xwtime_Xastflt_Xsoftclock_Xhardclock_Xconsdin_Xconsdout_Xcnrint_Xcnxint_Xnexzvec_UNIvec_u_rpb_intstack_doadump_Sysmap_dumpsys_waittime_machinecheck_panic_printf_memerr_Xmba3int_Xmba2int_Xmba1int_Xmba0int_mbintr_cnt_Xua3int_uba_hd_Xua2int_Xua1int_Xua0int_ubaerror_cnrint_cnxint_hardclock_softclock_dzdma_dzpdma_catcher_Xustray_cold_trap_syscall_Sysbase_UMBAbeg_umbabeg_Nexmap_nexus_UMEMmap_umem_UMBAend_umbaend_Usrptmap_usrpt_Forkmap_forkutl_Xswapmap_xswaputl_Xswap2map_xswap2utl_Swapmap_swaputl_Pushmap_pushutl_Vfmap_vfutl_CMAP1_CADDR1_CMAP2_CADDR2_mcrmap_mcr_mmap_vmmap_msgbufmap_msgbuf_camap_cabase_ecamap_calimit_Syssize_cpu_badaddr_edata_end_fixctlrmask_etext_maxmem_physmem_freemem_boothowto_main_addupc_Copyin_Copyout_Setjmp_Longjmp_whichqs_qs_noproc_runrun_Setrq_Remrq_masterpaddr_Swtch_Resume_Fuword_Fubyte_Suword_Subyte_copyseg_clearseg_useracc_kernacc_Xrkintr0_rkintr_Xlpintr0_lpintr_Xtmintr0_tmintr_Xupintr0_upintr_Xdhrint0_dhrint_Xdhxint0_dhxint_Xdhrint1_Xdhxint1_Xdzrint0_dzrint_Xdzxint0_Xdzrint1_Xdzxint1_Xdzrint2_Xdzxint2_Xdzrint3_Xdzxint3_Xdzrint4_Xdzxint4_Xdzrint5_Xdzxint5_Xdzrint6_Xdzxint6_Xdzrint7_Xdzxint7_Xtsintr0_tsintr_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_kmapwnt_curpri_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_panicstr_wantin_zdmap_zvms_inode_inodeNINODE_ninode_rootdir_mpxip_pidhash_proc_procNPROC_nproc_acctp_sysacct_acctbuf_suser_plock_iput_uchar_namei_prele_acct_compressudiv_writei_mount_bdevsw_cdevsw_linesw_swdevt_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_alloc_getfs_sleep_fserr_uprintf_badblock_bread_brelse_wakeup_getblk_clrbuf_free_bwrite_ialloc_iget_ifind_ifree_getfsx_update_iupdat_bflush_klseql_klsdist_klin_kltxt_klout_rate_sum_total_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_cacur_camax_cax_calloc_vmemall_vmaccess_cp_time_dk_busy_dk_time_dk_seek_dk_xfer_dk_wds_dk_mspw_tk_nin_tk_nout_callfree_callout_calltodo_ncallout_text_textNTEXT_ntext_percpu_nrscale_avenrun_ccpu_psignal_setpri_unhang_dhtimer_dztimer_vmpago_setrun_unsleep_vmmeter_timeout_ttrstrt_file_fileNFILE_nfile_getf_closef_binval_openi_access_xrele_owner_ufalloc_lastf_falloc_tablefull_inohash_ifreel_ihiniturem_iexpand_itrunc_bdwrite_tloop_maknode_wdir_tthiwat_ttlowat_stty_ioctl_gtty_nullioctl_swapmap_nswapmap_argmap_kernelmap_numuba_nmcr_mcraddr_cfree_nclist_cfreelist_cfreecount_icode_szicode_startup_meminit_rminit_configure_tocons_sysphys_clkinit_clkset_sendsig_grow_dorti_memintvl_ipcreg_memenable_tbiscl_boot_mc780_mc7ZZ_rqinit_setredzone_bhinit_cinit_binit_bswinit_iinit_setupclock_newproc_pageout_expand_swpexpand_sched_swfree_bmap_schar_partab_pipe_readp_readi_writep_prf_putchar_printn_harderr_ttyoutput_ttstart_cnputc_cwaiting_getc_q_to_b_ndqb_ndflush_putc_b_to_q_nextc_unputc_catq_putw_mem_no_geteblk_breada_mfind_munhash_bawrite_max_min_iomove_rmalloc_rmfree_ipc_gsignal_stop_issig_procxmt_psig_exit_core_chksize_ptrace_pfind_chgprot_slpque_tsleep_procdup_uaccess_vpassvm_passc_nodev_nulldev_imin_imax_syopen_syread_sywrite_syioctl_exec_exece_swkill_getxfile_baddr_setregs_vrelvm_vgetvm_xalloc_vinifod_rexit_vrelpt_vrelu_vmsadd_spgrp_wait_wait1_fork_fork1_vsexpand_sbreak_read_write_vrdwr_vtopte_vmemfree_open_open1_creat_close_seek_link_mknod_saccess_fstat_stat1_stat_dup_smount_getmdev_sumount_xumount_mpurge_gtime_ftime_stime_setuid_getuid_setgid_getgid_getpid_sync_nice_unlink_chdir_chdirec_chroot_chmod_chown_ssig_pause_kill_inferior_times_profil_alarm_umask_utime_setpgrp_reboot_syslock_sysent_nosys_nullsys_mpxchan_vfork_vread_vwrite_segalloc_segfree_segsync_vadvise_vhangup_vlimit_vswapon_vtimes_resuba_futz_xfree_xlock_xunlink_vsxfree_xccdec_xwait_xlink_xunlock_vsxalloc_settprot_vsswap_swap_xuntext_vinitpt_xrepl_pagein_vschunk_mwait_vstodb_vtod_memall_memfree_distpte_munlink_ptetov_wmemall_wmemfree_mhash_mlock_munlock_vslock_vsunlock_nohash_preptofree_kluster_dpageout_fifo_cleanup_noklust_klicnt_klocnt_klok_vpasspt_ptexpand_vgetpt_vgetu_vmdup_vusize_vrelswu_vgetswu_kmcopy_swapout_slowscan_fastscan_nbig_bigp_bplist_swapin_vmtotal_cexp_loadav_vbmap_getmemc_putmemc_xswapwant_xswaplock_swdspt_swpt_ubareset_both_forceclose_nummba_mba_hd_nexnum_dkn_mbaintv_ubaintv_probenexus_setconf_nxaccess_mbafind_setscbnex_unifind_ubawatch_mbaconfig_mbsinit_mbdinit_ubminit_ubdinit_bufhash_iowait_incore_geterror_iodone_physio_minphys_hpstrategy_hpdump_htopen_htclose_htstrategy_htdump_upstrategy_updump_rkstrategy_rkdump_swstrategy_tmopen_tmclose_tmstrategy_tmdump_tsopen_tsclose_tsstrategy_tsdump_cons_dh11_dz_tty_cnopen_cnclose_cnread_cnwrite_cnioctl_dzopen_dzclose_dzread_dzwrite_dzioctl_dzstop_dzreset_mmread_mmwrite_hpread_hpwrite_htread_htwrite_htioctl_swread_swwrite_flopen_flclose_flread_flwrite_mxopen_mxclose_mxread_mxwrite_mxioctl_rkread_rkwrite_rkreset_dhopen_dhclose_dhread_dhwrite_dhioctl_dhstop_dhreset_upread((_upwrite_upreset_tmread_tmwrite_tmioctl_tmreset_lpopen_lpclose_lpwrite_lpreset_tsread_tswrite_tsioctl_tsreset_ttyopen_ttread_ttwrite_ttyinput_ttyrend_ntyopen_ntyclose_ntread_ntwrite_ntyinput_ntyrend_mcread_mcwrite_nldisp_cnstart_ttychars_ttyclose_cnrfl_consdone_ttioctl_conxfl_mcstart_dhinfo_dhstd_dhdriver_dhprobe_dhattach_dminfo_dmstd_dmdriver_dmprobe_dmattach_dhsar_dhsoftCAR_ndh11_dhact_dh_ubinfo_cbase_dhstart_uballoc_dhparam_dmopen_dmctl_ubarelse_dmintr_flushtty_isbad_disksort_dzinfo_dzstd_dzdriver_dzprobe_dzattach_dz_cnt_dzact_dz_brk_dzsoftCAR_dz_timer_dz_speeds_dzxint_dzscan_dzstart_dzparam_dzmodem_fltab_flstrategy_flstart_hp6_sizes_rm3_sizes_rm5_sizes_rm80_sizes_hp7_sizes_hpSDIST_hpRDIST_hptypes_hpinfo_hpdriver_hpattach_hpustart_hpstart_hpdtint_hpst_hp_offset_rhpbuf_bhpbuf_hpbad_hpinit_hprecal_hpseek_mbustart_hpecc_mbsr_bits_rhtbuf_chtbuf_httypes_htinfo_htdriver_htattach_htslave_htustart_htdtint_htndtint_tu_softc_tutoht_hter_bits_htds_bits_htcommand_htphys_htdwrite_hteof_htwait_lp_softc_lpinfo_lpstd_lpdriver_lpprobe_lpattach_lptout_lpcanon_lpoutput_mbstart_mbasetup_mbainit_UNIcpy_chans_schans_groups_mpxline_mpxdev_mcdebugs_challoc_gpalloc_addch_mtree_cpx_xcp_detach_mxfalloc_chdrain_chfree_chwake_mup_mdown_cmask_getmpx_mxnmbuf_nmsize_mpxname_scontrol_zero_m_eot_msread_nextcp_sdata_mxrstrt_mswrite_mxwcontrol_mxmove_msgenab_sioctl_wflush_flush_rkpip_rknosval_rk_softc_rk7_sizes_rk6_sizes_rktypes_rkminfo_rkdinfo_rkip_rkstd_hkdriver_rkprobe_rkslave_rkattach_rkdgo_rkutab_rkcyl_rkbad_brkbuf_rkst_rk_offset_rrkbuf_rkwstart_rkwait_rkwatch_rkustart_rkstart_ubago_rkecc_ubadone_ubapurge_ubainit_rswbuf_ctmbuf_rtmbuf_tmminfo_tedinfo_teutab_tetotm_tmstd_tmdriver_tmprobe_tmslave_tmattach_tmdgo_te_softc_havetm_tmcommand_tmtimer_tmstart_tmseteof_tmphys_tmwait_tmdwrite_tmeof_ctsbuf_rtsbuf_tsminfo_tsdinfo_tsbuf_tsstd_zsdriver_tsprobe_tsslave_tsattach_tsdgo_ts_softc_ts_ubaddr_tsinit_tscommand_ubasetup_tswait_tsstart_tsseteof_tsphys_tsdwrite_tseof_maptab_wflushtty_ttyblock_canon_ntypend_ntyout_ntyecho_ntyretype_ntyrub_ntyoutput_ntbreakc_ntyrubo_ubasr_bits_ubaremap_up_softc_up_sizes_fj_sizes_upSDIST_upRDIST_upminfo_updinfo_upip_upstd_scdriver_upprobe_upslave_upattach_updgo_uputab_upst_up_offset_rupbuf_upwstart_upseek_upwaitdry_upwatch_upustart_upstart_upecc_umaddr780_umaddr750_umaddr7ZZ_nexty750_nexty7ZZ_hkint0_lpint0_tmint0_scint0_dhint0_dhint1_dzint0_dzint1_dzint2_dzint3_dzint4_dzint5_dzint6_dzint7_zsint0_genericconf_gets_getchar@iu k.[2i #ifdef LOCORE #define P_LINK 0 #define P_RLINK 4 #define P_ADDR 8 #define P_PRI 13 #define P_STAT 15 #define P_WCHAN 76 #define SSLEEP 1 #define SRUN 3 #define UBA_BRRVR 48 #define UH_UBA 0 #define UH_VEC 8 #define UH_SIZE 52 #define RP_FLAG 12 #define V_SWTCH 0 #define V_TRAP 4 #define V_SYSCALL 8 #define V_INTR 12 #define V_PDMA 16 #define UPAGES 8 #define CLSIZE 2 #define SYSPTSIZE 1536 #define USRPTSIZE 1024 #else asm(".set U_ARG,120"); asm(".set U_QSAV,140"); #endif @iw kb=k Nbv|2iߞߞ 82  U i  @   ʏxȏ19^^~8~~8???^?KSP not valid?h[CHM? in kernel?| =??~z &????ݮn ?wtimo??????PIQ.?PQ?PQ?P}QRaTBS ScQ?U?S??C?G?/?3?ݮݮ??ݮݮ?????ďPSSPЀQRRRRRPЀRRRԺ?S݀ЎS [ÏZxZZ?ÏPxP~~ I?1`1X1P1H1@18 12 1(1" 11 1 1~ڎ^~ڎ^ڏڏ ڏ ڏڏ Џ ^>Pc:QPacPPYQQRSSRSWWP~W"V((UUU|fUVRQQxQQɏRBk QRʏxd ȏY QQxQQɏRB4 QRQQxQQɏRB QR98xW^XSMHAVʏVVxVSɏS'SoPP:P PЏQQ QQARR RQSSQɏSpQ:RaQ P TW X \`[<HԡLx SSSP( ,l[}vPPxP~ ncݏl PQARЬSЬT'-TcTcTcPRQ7 &0^nЬRâP1PP QzQPPyPPQPPP bP ` `Ԣ Ю P:ЮQяP a%QP Pa ( PPЮ PЮQяP aQP Pa( P}V}X}Z}\^n`P}V}X}Z}\ЀQQ^ Q^longjmpՠ % QxQQ~AR`Qsetrq QxQQQ `RQzԠremrqswtchb\ TP1PA~@9QR % PբLݚSSԢвPP5x PP+C5BP7.5ڏ:)!PnЏ ``PP ``P `Q`P `Q`Pɏ4ڏ:(Qɏ4ڏ:,n.ЬPЬQլ 0яQ `OPQ Q`4PяQ `PQ Q`PPЬPPPr RR SPR S R SPQQxPPxQQ PS/QS(@bSSS SQPPP?-???? ??????????????????P1?u??P1?]??P1~?E??P1f?-??P1N???P16???P1???P1??stray scb interrupt nexus stray intr ipl%x write timeout %x ??????????????????x?p?h?`?X?P?H?@?8?0?(? ?????????????????????x?p?h?`?X?P?H?@?8?0?(? ?????????????????????x?p?h?`?X?P?H?@?8?0?(? ?????????????????????x?p?h?`?X?P?H?@?8?0?(? ???uba?: stray intr ipl %x vec %o @i k<Ŵ=k Nbv|2iߞߞ((  $(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|   " , 2 M H \ J l I r y K I  K  L  L M  L  I   K ; R C S O U _ U o U  U S [ \ S ] S ^ S _ ` S !a )S 7c lS L )m 2S Hn QS `gnu|  m n  -<GM dn        Znv    K -4K D P h ovK       K   S ).4;CJP      / ? O _ o        / DLT\dlt| $,4<DLT\dlt| $,4<DLT\dlt| $,4<DLT\dlt| $,4<  $+29@ G$N(U,\0c4j8r<z@DHLPTX\`dhl T h  *3>IS^gp|@          ! ).16;E O X`is $ , 4 H X h x   $/:CL.S[<chjqrx{x# ((3 3 788H H*4H?JHS\Ien6+> t2i  h^Юn PPՀPpPP P^@Ь[kP#Pl-PPP, TgZV:PZPZ^Z=P+F#PZZP PZZPPZuP1XZW g:XWgX~=tPVZWX'gjZP=PPjPHfX:WZg:ԕjZPPP<PHfXHfV9z7+#P3PP uPPPPP׬[1G1PV11P11PcѬ  ׬[kK1P1kZj-1PPns1 11-1%PXPfPekRcPiZIL1:Pv0PsPq(Pt1$Px1Tj1.[׬լ1Z ?RլMkEP&k;k~tP׬[m2~PPPPII"=32~P&p[2l'  PPPSP2PP1мP-`  1]}rPYXPYF2^~hP 2LY+Y&PݭݏwtYP1ݏtYP%߭ݏtYg~poDP]WTLݏvtY%27~Y4rݏfnAvm e PqmNfݐPh ﺿ ﭿv~V(21~!]2~zݏvt+"勵ݏtu^[ЬZ j:[Zj[~GmPYЬZ[jCjѭ:խ0jЬPvPP`PKi[խ Z:jZKiYL ݬݬEnP[ݏ[1PoPZ[֍Z x^Ь[icO[n?|[kP$2PP,!Px2PPx [*(1߭oԭ  ֭ѭ1*߭ho* 2 2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****O*;*.*{Xkj~ë~ݬ ŏdYPլ Ь QQJ {GZ(J!JPZPJxJPZPPjjI I1xYP[PIII ZIIIkIIk[P Ь[[ZIPZP ZI P |tZZNIjPPjj@I j;I D ^Ь[ [t[PPݬ2PZZ[ZP[Z~(1PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPH@jP ^ԭԭfH[LkZЬPՠ(k PPP[Z~[[ZkZ[[HH~ݭݭW4x7r; 4VV:p 4@T? 6R: 4 4G$$)7.G,8?166L&Y5#Ԫ?-C44@53D3KPV(%];dhAo8u|lF07B4B&tFNhA69 p )G 1  !%.2EJQU_dw{! $9>RWns\~ݬЬZЬ[ЬY-M$k-Ѭ0 ~hZݬ\֬ լ  ՘~HZ ݬ9׬ լ @(#)sh.c 4.2 3/11/81./usr/ucb/bin/usr/bina.outstatus0HOMEhomeUSERuserTERMtermPATHpathshell/bin/csh/tmp/shverboseechoargvprompt# % Switching to new tty driver... Warning: no access to tty; thus no job control in this shell... /.cshrc/.loginlogout Reverting to old tty driver... /.logoutjobsInterrupted%d? mailYou have %smail. new %s in %s. New mailMail@(#)sh.dol.c 4.2 5/3/81\'`"AmbiguousUnmatched %c '`" Word too long$< line too longNo file for $0Variable syntax-*Subscript out of rangehtrqxeBad : mod in $$\'`"<< terminator not found<<Line overflow$\`@(#)sh.err.c 4.1 10/9/80%s: @(#)sh.exec.c 4.1 10/9/80No match/Command not found/bin/sh%d hits, %d misses, %2d%% @(#)sh.exp.c 4.1 10/9/80||&&^=<>Divide by 0Mod by 0!~(Expression syntax{{ ... }Missing }erwxfdzoMissing file name+-*/%()!~^|&>>==!==~!~@(#)sh.func.c 4.5 81/06/19%job%job &Too few argumentsToo many argumentsCan't from terminalaliasunaliasToo dangerous to alias that/bin/login/bin/newgrp/usr/bin/newgrpNot login shellEmpty ifthenImproper thenSyntax errorNot in while/foreachInvalid variableWords not ()'eddefault'"then/endif not foundendsw not foundend not foundlabel not found-n%o Improper masknoraisecputimesecondsfilesizekbytesdatasizestacksizecoredumpsizememoryuseNo such limitLimits cannot be raised hoursminutesmegabytesunlimitedImproper or unknown scale factorBad scaling; did you mean ``%s''?%s %d %sCan't suspend a login shell (yet)@(#)sh.glob.c 4.2 3/11/81`{[*?noglobnonomatch{}Unknown user: %sMissing ]Arguments too longPathname too longUnmatched `` ... `Too many words from ``@(#)sh.hist.c 4.1 10/9/80history10-r%6d @(#)sh.lex.c 4.1 10/9/80# '`" ;&<>()| Unmatched "'` Expansion buf ovflo:^$*-%Bad ! formNo prev sub Bad substituteNo prev lhsRhs too longBad ! modifier: Modifier failedSubst buf ovflo-$*Bad ! arg selector(=~: \ }No prev search: Event not foundReset tty pgrp from %d to %d ignoreeof Use "logout" to logout. Use "exit" to leave csh. @(#)sh.misc.c 4.1 10/9/80i=%d, j=%d: Out of memory /usr/bill/cshcoreUndefined variable@(#)sh.parse.c 4.1 10/9/80Alias loop;& Too many )'sToo many ('s<>()Badly placed (Missing name for redirectAmbiguous output redirectCan't << within ()'sAmbiguous input redirectBadly placed ()'sInvalid null command@(#)sh.print.c 4.1 10/9/80%d.%d%d:%d%d@(#)sh.sem.c 4.1 10/9/80nicenohupNo more processes/dev/nullnoclobberCan't make pipe%s: File exists@(#)sh.set.c 4.1 10/9/80Missing )histcharsSubscript errorBadly formed numberNo more wordsWarning: ridiculously long PATH truncated @(#)sh.proc.c 4.6 (Berkeley) 81/05/03childnotify BUG: waiting for background job! BUG: process flushed twice( | ; << < >> > ...[%d] %d[%d]%s %c %5d %-21sRunning Exit %-16dDoneBUG: status=%-9o | (core dumped) (wd: (wd now: ) -lUsage: jobs [ -l ]%s Bad signal numberUnknown signal; kill -l lists signals%s: Already stopped Arguments should be jobs or process id's%s There are stopped jobs%%%+No current job%-%#No previous jobNo such jobNo job matches patternNo job control in this shellNo job control in subshells@(#)sh.dir.c 4.1 10/9/80dirsUsage: dirs [ -l ]~%sNo home directoryCan't chan((ge to home directory./../cdpathNo other directoryDirectory stack not that deepBad directoryDirectory stack emptycwd@(#)sh.time.c 4.1 10/9/80%Uu %Ss %E %P %X+%Dk %I+%Oio %Fpf+%Ww%d%%@(#)alloc.c 4.1 10/9/80assertion botched: %s allocp>=allocs && allocp<=alloctallock()q>p&&qalloctp>clearbusy(allocs[1].ptr)&&p<=alloctp->ptr > allocp && p->ptr <= alloct%6o %5d %s BUSYFREE%d used, %d free, %l end @(#)sh.init.c 4.1 10/9/80@allocbgbreakbreakswcasecdchdircontinueelseendendifendswevalexecexitfggotohashstatkillonintrpopdpushdrehashrepeatsetsetenvshiftsourcestopsuspendswitchumaskunhashunlimitunsetunsetenvwaitwhilelabelHUPHangupINTInterruptQUITQuitILLIllegal instructionTRAPTrace/BPT trapIOTIOT trapEMTEMT trapFPEFloating exceptionKILLKilledBUSBus errorSEGVSegmentation faultSYSBad system callPIPEBroken pipeALRMAlarm clockTerminatedSignal 16STOPStopped (signal)TSTPStoppedCONTContinuedCHLDChild exitedTTINStopped (tty input)TTOUStopped (tty output)TINTTty input interruptXCPUCputime limit exceededXFSZFilesize limit exceededSignal 26Signal 27Signal 28Signal 29Signal 30Signal 31Signal 32@(#)printf.c 4.1 10/9/80^Ь[Ь Ь\[PZY Y%ZZݭPP[QQ~8Y!cdefg+l-.o0123456789abcdef^U|YPPQPA2QM..._ekvvvvvvvvvPPs1PxzPu1Pr1TPP*1CP1(null)XPZPЌRR:PbQURQpPPoPxPdHPu1[~RS T RSTSVQЌPRSPQAVRe;0Tn n8 n;  ~Z0nݭQUUYPPZPPPQU1ilPP n4 n  n錪  nPUP^QZ1Z1ZZZZ IiY>IY HhX>HXZ1VXZZ1KЌXЌ\Ќ[10ZXXWWVWWWWPPnW3PWPP#VWP֭WP-WxWP@(RnVЭPPX'(AcխXVVVV()cXP%VVX8Wn 1GDeB+B+D.@0RVQPVPQ'խQRVPЎPR QPVPRPQQPRQPRPc0XZXXPPnX.PXPP֭XPP/XxXP@ZlxXPSPQXWQPQ`WWѭ+WPP!PЭWXWPPXWn4WníWX1XWPPXWn4WnWX(nVXP08Xn ׭n8ne QZ+Q; ?a1AZ11pUorUUUR>B€R R RZqPURRRRR dUR R8tPTUPUP  t|UPUP  PpPT~3SRRRRTRdcPSTRgPPRRT BCG@M [u+p^/֬Ь++h2+<+1JP+ 7+u+v.-_+z+FT+o+1+6+wP e[++TJ++AP /+!+,*****\*D<*PP12*PPl*f*/P TH*P [[K*[PPPZ*P[ZQPQJ`ZZ )P/K`[PP)PvQA`[)PK*K`ݬ PݬN_1ά%CP'4ݏݬ'0ЬPЬQQɏPQ0Ь[ЬZ[[  PK?)YZK6)ZZZZ Z9ZZ[ePZZ ZZZYKr)YPЬ[ЬZ[[  DPK(YZK(ZZ ZZZ[PZZ ZZZYK)YPЬ[[ [Ь[[  K(~ɏ[~Ь[[  K( yP~[LPݬ: Ь[K'ZljKH(~[ЬPЬ QլQP PQPЬ[Zj7݊[ PYYP Ь[ЬZk =ZPk=P//QP'P[kݬk P8[P/P ph [Ь[k:[kk[P42PP ݏ&P[[*[P[[*[xP[[P*[\P[[jP**~*[/P[[o*[P[[`*[ P[[Q*k [kk*PЬ[ZYk94 ZPQPQ0QZY[[kPP P P+P-k0YZPZPЬ [ЬY׬&k ЫP֫`P [PZZZ Z YPЬPQP% P! " PЬ[|XXPX 鑫+PPPYkw+ݏݬPZY1ZZ kalYPPPݬ PZ 4D\f(4FUet&2EError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large@)[*LЬRPQbPЬ[[o~kЫ0   PSЬRUT TTT +T-TST|PT04T9/Q yPVyPPVPWQ0TTPQUSUTǑT.SVTeTE[TT+T-STT0T9V FfV>FVSVVVUUЏUUdЏdU}PP1RU#Q yPPRyPVVPWQRU=;Q yPPRyPPRQQVW{VQWPVW{ VPVPPVPRUQyPPRyPPPPnPVnQPdP`VPSrPPRpP~Ь[  P ݏP ի ߘP@" [X R P2PPݫ~yPkЫk!k    k1WP֫pPPR RR RP|Pp PrPP" ^ԭլݏP!|PݭpݭVխѭ¬ Э!:Pݬ`!+ЬP}V}X}Z}Э`PЬPЬQ}V}X}Z}\Ё^PP Ь[ZZZPݬݬݬ;Bݬ  ЬQPa#+QP^Ь[    PPYYX1XX߭~PYjT~P  BЫZ֫ZPѫPѬ ZPPXPZ~9PYZkn 1mЫZ3[h1xݏyPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~dPY PP[ [[[ Ь[Z = 8[ePZ~MPZ ݫ ԫ kZP Ь[ЬZkPkPzQQPPP^߭ݬPPP|l\PЬ[ЬZ[Y[YPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6< P~\S^\yPpЬ[PЬPЬRRQ{RPPR PRPPЭRBQP<PbPbMkPP!^.[s<Y71PU;P3k֫pN@pCaFpCJE@}oR@|1p|/...getwd: cannot open .. ..getwd: read error in .. getwd: read error in .. getwd: can't change back /etc/passwdrrUnknown error: #h@i k0W44 2i ((0p ZP1j"[[[yP[<PʏPP H[z[r[i^]YVZZI[KKi [P P  ~P[[|{~Px~\P*ЪЭsYd a:5Zg&ЭZQЬ[ZYZˏ[Yx[[[ Y [x[[Zx ZP[P7 8 3 )9 2: 83 ?3 H7 Q; X< y7 : 3 = 6 3 9 7 7 7 7  7 7 7 7 !7 ,7 17 9A C7 H7 PZ7 b7 q7 x7 7 7 7 B 7 = #,39BHQZbhow!,H3(9x?FMZbkr~{   _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_inode_inodeNINODE_ninode_rootdir_mpxip_pidhash_proc_procNPROC_nproc_qs_whichqs_acctp_sysacctL92_acctbuf_u_suser_plock_iput_uchar_namei_prele_acctL108_compressudiv_writeiL120@i kr2iII | PP1q~P@usP@Z\PUxPP@~xZ-!PP1z[[Pcalloc/  0 + 4<1 C2 KQY1 `3 ho|1 4 * * H (x~'-8?CLT]cjqtvt|t(&1:@HOW^ck ox_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_cacur_cabase_camax_cax_callocL79_calimit_panic_camap_vmemall_vmaccess_clearseg@i k"]i,  2i99  @ ݬZێPPX.2.PxPPPxPPXP ݪZp.[[PPЏ_KPЏK ЏK[[Џ?@ݏڮn^ݏڮn^.'|3>u<~2~P<~2~P(H(HxPxPPPƏPPPxQP.mP_P6UPxHPxPP2QP%PP.PSP PPPP~e ^P.2~2PPPPPPP`2g~_P[ Gk[:4/[,ЫZʞʟʡʾ/ʲYIʲ Yʤ^ZZЪ Ъ ЪЏj,ZZ,ZYD,YPP[x YPPZЪЪP[[Џk[iYY`X Nս?9 /   ǏPx P ZZ[ ,Z [,ZP[PԪ [[PP[[ZjZy ZoPxPPdPZP[VY[ Yi[Ciinitbinitn o . Kp Uq \p bp yp p p r s  x 6 6  !x (p /p 5p >$ Cp L$ Qp Xy _ f@ . . z . @ p p . {  . . z | } %p +p 3p :~ @| H N X. d p w 8   p    ( (    !C HC [< k=  > 8   ;          V ' 0? 8D M@ `h tj |j k i h 9  #,39BHQZbhow!,H3(9x?FMV`hs~|),2<DMSZatftltq(x((!*08>IPW_jv| \,j&+29AJOW \a_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_mount_swapmap_nswapmap_argmap_kernelmap_pidhash_proc_procNPROC_nproc_qs_whichqs_inode_inodeNINODE_ninode_rootdir_mpxip_bdevsw_cdevsw_linesw_swdevt_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_text_textNTEXT_ntext_cfree_nclist_cfreelist_cfreecount_mainL171_rqinit_startup_u_setredzone_ihinit_bhinit_cinit_binit_bswinit_iinit_iget_setupclock_newproc_pageout_szicode_expand_swpexpand_icode_Copyout_schedL203_bread_panic_brelse_clkinitL215_swfreeL235L242@i k kY 2iMM ^[PZP/[[<~2~PZZ/Z լpjXZ[PYYZPZZ/=Z951hZ!$ѬZ[BPYPZZ/Z!1[ PPBkӏOխ ݭx~[P2~P P1KЭPРXXjhխ1XX1MԭVPЭQXRQSA`Cb=PЭQA` ֭ѭ6X( ^խ ݭѬZݏ[P11Q1,. P1 P[ P[[<PʏPP@6ݏ@[b!1 9ԭԭ[-).!. 1s1)խ ݭѬ1Zݏ[P1[խ11}֭ѭ1[<~2~P[1N1PxPqPЎPbP[[[P> > #' 3? Q> W> g> q> > ( > @ > ( @ ( A ( ( > 0B :> DC QD cB z> > > > > B E > )> ;) K) X@ c) pA > E > > > > > > > > B E )> :> R@ X> d? x> > > > J > #,39BHQZbhow!,3@HQX_Hf(lxry~, 't.3:?G_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_inode_inodeNINODE_ninode_rootdir_mpxip_mount_zdmap_zvmsU_ARGU_QSAV_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_nameiL105_u_iget_iput_plock_brelse_bmap_bread_access_scharL167_ucharL171_Fubyte@i kԴ ,2i P PPy[RݏaPZ(x< ѫ  ӏ%$Ы$%լZݫЬkPa [kPk Ѭ1JZݫo1q1.[|Ыtԫ$"ێPPUkPPݏ ݏ #ڮn^ ,Z2#PP9djPPݏ ݏ #ڮn^ PPP PP[ɏ[~#ڮn^ [ɏ[~#ڮn^jPP 1w[ɏ[~#ڮn^ת1Qݏ #ڮn^V2PPP9Ъ21j$Z1 Ь[Z[ 2PPPMˏPP!PPת״jjΪ$ZˏPPˏPPjPPT1{6 ; 8 8 %< ,8 28 <8 C? I8 R; e8 lB s8 {8 8 ; C ; ; ; ; 8 8 D E ; B 3; LE R; eqz8 8 8 8 8 8 8 8 B8 k8 t8 }8 8 8 8 8 8 8 D 8 8 8 8 F8 L8 W8 j8 sD 8 #,39BHQZbhow!,4<DLHS(Yx_fktz,8N $v-^5:jCHMU Za f_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_bdevsw_cdevsw_linesw_swdevt_zdmap_zvmsU_ARGU_QSAV_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_cpu_percpu_fltab_flopenL97_u_geteblk_flcloseL104_brelse_flstrategyL110_sleep_min_wakeup_iomove_flstart_flreadL134_flwriteL139L143_conxflL153_cnrflL174((@i kfz P!2i H8\~ݬ\~ݬ^Ь[ЬZ1Xݬ X11PD1W1P%11gPXY1jYWW1KWPxPYPPX ݬ X_WWPxPPPPPYP2խ ݬ ,8XX 1ݬ X֭㑽 1֭jЭP֭`X1ݬ Xݬ %1PO1Yݬ Yj1Pc1.[Pb{ЊYjݬ ЭP֭`~YԭYWݬ <yЭP֭`W1խ7ݬ >Y)Pd Y1wPs13 Po1ZZXX%1VXXPPl1wPuPx1i ^Ѭ լݬ -άޭ[ݬݬ@ݬݬPPݬ {~ޭP[P^PPPЬlݬ@\PݭJݬ%6ЬPݠ PaP~ЬPPxP~ݬЬ[լDAZ:<5PPY[  Z Z[ZYPڎ[h[ c[Z8ێPPQ`0Џ`0vt l_]PRQ[A`G[[50123456789abcdefpanic: %s %s: table is full %s%d%c: hard error sn%d "E;r&<Z CQ[ f{! ! ^ d 0e ;e Df nJ {J J J J J J J J g #,39BHQZbhow!,1:@GOW]h,q{ttt( (2;DMWaiHp(vx|  (t &._hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_msgbuf_zdmap_zvmsU_ARGU_QSAV_tthiwat_ttlowat_printfL121_prf_uprintfL127L131_putchar_printnL182uremudiv_panicL195_boot_tablefullL203_harderrL209L214_u_ttyoutput_ttstart_cnputc@i kX u^!2i˜˜ p^Ь[2PP1<PʏPP 2PPPPPPsk<PˏPYY  Y02~2PPPPPxPPP`xMЭ >ZZPP* ZPPPXY`GYp>PPPѭXЭXݭ[P խPP3HPPݭ2~ݭ2~PЭHЭPà$PXPXP ЭPà$PPX`'X*ЭPZ~; ^P$0XЭPZ~( ^XXXZXPP kPP ݭX1E ^Ь[2PP1<PʏPP 2PPPPPqP,<PʏPPYY  Y0#Bk2~2PPPPPxPP P`<PʏPP,PPkx ZZPP ZPPPXY`%Ypݭ[PPխ ݭ2~aPݭ2~OXݭ2~8ݭ2~(P#XZ~ ^P$0XЭPZ~( ^XXX ݭ\<PʏPP@ЭPZP` ݭ/ZXPPkPPݭd ݭX:Y@ YBk  1=ѬЬPЬPѬЬPЬPЬ[ЬZ:լ Z[ ^Z[ ^PY-dլ  Z[o Ze[( ^ZRZSZH J J DK NJ 8 J J J J J L J % 1M >N Q _O oP J J Q J J J J J J 3R 9J AJ cJ K J 8 J J J J J U !J *J 4J DJ VJ zL V W X P J J Y J J &J -J 4J :J FR sZ [ \ J J J J !J 3J 9Y FJ NQ ]J mJ wJ J J J #,39BHQZbhow!,3@HQXH_(exkrw, ~ &18<ELQT\bks{P_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_inode_inodeNINODE_ninode_rootdir_mpxip_zdmap_zvmsU_ARGU_QSAV_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_pidhash_proc_procNPROC_nproc_qs_whichqs_readiL120_u_mem_no_bmap_geteblk_clrbuf_breada_bread_Copyout_brelse_writeiL152_psignal_mfind_munhash_getblk_Copyin_bwrite_bawrite_bdwrite_maxL185_minL190_iomoveL196((@i kt운 y#2i;; t,X ^Ь[լ PѬ |ЬZJYѬ 2~PPЭP <PʏPP@ ݭ ݭ|ЭJBkZ  ZP@`ЭPԭ xѬ ­׭խխ12í P@1Ѭ 1W2~P Pí PЭ@Bk1ݭ2~P P1ЭPРέPxPPPZJpѬ 2~P ݭt1ЭP ѭ<PʏPP@ ݭC ݭ7ЭJݭ' ݭ֭ѭ16Z1ZP@1 Ь[ZZ@[[ЎPЎQP;,P)Z[tЎPЎQPBPP RP&ZZ6[31#[PZЎP,ЎPP[ѬЬPЬPѬЬPЬP?P?PPP2@PďpPP[P[PP2(PP[P2jPC  BD tE F  D E 1G CH xD H E F F H  C #C -C 9K CC IC OC UC hC tK C C C C C C C C N C N C C <; J< S< #,39BHQZbhow!,4<DLS`hqxH(x,~ $,5<DK PX_ dlsx*_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_bdevsw_cdevsw_linesw_swdevt_inode_inodeNINODE_ninode_rootdir_mpxip_zdmap_zvmsU_ARGU_QSAV_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_pidhash_proc_procNPROC_nproc_qs_whichqs_bmapL111_u_alloc_bwrite_bdwrite_bread_brelse_passcL143_Subyte_cpassL153_Fubyte_nodevL164_nulldevL169_iminL174_imaxL179_pfindL183@i kģ o0 %2iTT 8`^Ь [ЬZѫ[YЬXZ[ЬYZXk[ݬ2P Zݬ P[ݭ ^PP^Ь[ЬZ YXZWjЪ1XAYb[Pgg%XjZݭP A2PY%[ X[լ gY gYYXYYYWZPPWPPP X1\X[[jP ^ЬPѠ40 ЬZԭ}ЬPí4[[2[[wpPIݭ74PƏPPP~JCЬQP0ЬPՠ0+ݠ4ݬ#PЬPѭ41uFP ^ЬZԭ/í[[2[j[ԊѭЬPF2ՠ0-ݠ04PƏPPP~ЬPԠ0Ь[ЬZЬYXYPPPPYP XY3kkP k1kPP sPkXݬݬ XZݬXZXYZkhkPaѬ  [ЬQСPQ2@RPRR@;[ЬQP<&Xk~kkPPYѬ [1)[1# ^Ь[ЬZЬ YѬ1Ѭ1P1ǏZPx PPPZPPѭYY2&~x ~x Z~ǏZPǏZQx QQQZQQ@P~[ݭxZPXP~ЫPQ2@RPRR@Z­YY1oPP߭ݬYZѬЏP PPPZQQQPZ0PP2y~x ~x ~ݭ[^Ѭ#2.PxPPxPPXP$PZQQxQQQPx0PXPxZQQPPXݭXP % F M i d | * $ %  i   i  * " $ + % G * $ % * $ % ' (  '  (  A $ % % . ) 5 A < ) F ) K A ] $ m $ A A $ ) * A $ $ A B     & ' 0 q ; $ O k f ' p q { $  i j s s    i . s G s N x #,39BHQZbhow!,29@KTZbHi(oxu|~ttt($+5>GOYbkt~,"+5=HQ V]elrz@  t ' 05:f BG P U \a h` qv{ :  _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_text_textNTEXT_ntext_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_file_fileNFILE_nfile_inode_inodeNINODE_ninode_rootdir_mpxip_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_mount_swapmap_nswapmap_argmap_kernelmap_vmemallL166_panic_wakeup_sleep_imin_memall_vmemfreeL183_memfreeudiv_distpte_u_munlinkL219L224_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_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_swapmap_nswapmap_argmap_kernelmap_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_text_textNTEXT_ntext_mount_inode_inodeNINODE_ninode_rootdir_mpxip_vgetptL162_panic_rmalloc_Usrptmap_usrpt_vmaccess_rmfree_clearseg_vinitptL179_vinifod_swap_u_distpteL199_vrelptL211_vmemfree_vpassptL218_vusizeL235_vgetuL240_setredzone_vrelswuL254_vgetswuL259_vreluL264_ptexpandL273_memall_Resume_Setjmp_kmcopy_swapout_sleep_SwtchL298_chgprotL305udiv_munhash_tbiscl_settprotL315@i k^; "!2ijj dl^2~P[PZRPY0Эi[j[kЭP@[ Ь[ЫZ]ЫRZaCѫԫԪZ~7jj jZ$j Zjjժjj jZZ~Ь[ЫYZii YiZii iYy*ii iY{ 9 <eѩ(ii iYBY~51aЩZZP2PPPZYii iY1Y~1Ь[k [kkЬ[kk k[ 8 9 ': 09 ;: @: H: s: |; : > : ? ? @ ? *: 1: E@ a? g: ? : : C ? @ : : D ? #? <@ ]? #,39BHQZbhow!,H3(9x?FMZbkrx~  *"'H.3_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_inode_inodeNINODE_ninode_rootdir_mpxip_file_fileNFILE_nfile_pidhash_proc_procNPROC_nproc_qs_whichqs_pipeL96_ialloc_falloc_u_iput_readpL105_readi_wakeup_sleep_writepL122_psignal_writei_plockL141_preleL148@i kliL_ q nV a>2iОО #ifdef LOCORE #define P_LINK 0 #define P_RLINK 4 #define P_ADDR 8 #define P_PRI 13 #define P_STAT 15 #define P_WCHAN 76 #define SSLEEP 1 #define SRUN 3 #define UBA_BRRVR 48 #define UH_UBA 0 #define UH_VEC 8 #define UH_SIZE 52 #define RP_FLAG 12 #define V_SWTCH 0 #define V_TRAP 4 #define V_SYSCALL 8 #define V_INTR 12 #define V_PDMA 16 #define UPAGES 8 #define CLSIZE 2 #define SYSPTSIZE 1536 #define USRPTSIZE 1024 #else asm(".set U_ARG,120"); asm(".set U_QSAV,140"); #endif /* scb.s 4.9 81/05/13 */ /* * System control block */ .set INTSTK,1 # handle this interrupt on the interrupt stack .set HALT,3 # halt if this interrupt occurs _scb: .globl _scb #define STRAY .long _Xstray+INTSTK #define STRAY8 STRAY;STRAY;STRAY;STRAY;STRAY;STRAY;STRAY;STRAY #define STRAY15 STRAY;STRAY;STRAY;STRAY;STRAY;STRAY;STRAY;STRAY8 #define KS(a) .long _X/**/a #define IS(a) .long _X/**/a+INTSTK #define STOP(a) .long _X/**/a+HALT /* 000 */ STRAY; IS(machcheck); IS(kspnotval); STOP(powfail); /* 010 */ KS(privinflt); KS(xfcflt); K((S(resopflt); KS(resadflt); /* 020 */ KS(protflt); KS(transflt); KS(tracep); KS(bptflt); /* 030 */ KS(compatflt); KS(arithtrap); STRAY; STRAY; /* 040 */ KS(syscall); KS(chme); KS(chms); KS(chmu); /* 050 */ STRAY; IS(cmrd); STRAY; STRAY; /* 060 */ IS(wtime); STRAY; STRAY; STRAY; /* 070 */ STRAY; STRAY; STRAY; STRAY; /* 080 */ STRAY; STRAY; KS(astflt); STRAY; /* 090 */ STRAY; STRAY; STRAY; STRAY; /* 0a0 */ IS(softclock); STRAY; STRAY; STRAY; /* 0b0 */ STRAY; STRAY; STRAY; STRAY; /* 0c0 */ IS(hardclock); STRAY; STRAY; STRAY; /* 0d0 */ STRAY; STRAY; STRAY; STRAY; /* 0e0 */ STRAY; STRAY; STRAY; STRAY; /* 0f0 */ IS(consdin); IS(consdout); IS(cnrint); IS(cnxint); /* 100 */ IS(nexzvec); STRAY15; /* ipl 0x14, nexus 0-15 */ /* 140 */ IS(nexzvec); STRAY15; /* ipl 0x15, nexus 0-15 */ /* 180 */ IS(nexzvec); STRAY15; /* ipl 0x16, nexus 0-15 */ /* 1c0 */ IS(nexzvec); STRAY15; /* ipl 0x17, nexus 0-15 */ .globl _UNIvec _UNIvec: .space 512 # 750 unibus intr vector # 1st UBA jump table on 780's /* locore.s 4.55- 82/02/17 */ #include "../h/mtpr.h" #include "../h/trap.h" #include "../h/psl.h" #include "../h/pte.h" #include "../h/cpu.h" #include "../h/nexus.h" #include "../h/ubareg.h" #include "dz.h" #include "mba.h" .set HIGH,0x1f # mask for total disable .set MCKVEC,4 # offset into scb of machine check vector .set NBPG,512 .set PGSHIFT,9 .set NISP,3 # number of interrupt stack pages /* * User structure is UPAGES at top of user space. */ .globl _u .set _u,0x80000000 - UPAGES*NBPG /* * Restart parameter block * This is filled in in machdep.c in startup(). * It MUST be page aligned. * When auto-restart occurs, we run restart() in machdep.c, which * takes a core-dump and then cold-starts. */ .globl _rpb _rpb: .space 508 erpb: .space 4 .globl _intstack _intstack: .space NISP*NBPG eintstack: /* * Do a dump. * Called by auto-restart. * May be called manually. */ .align 2 .globl _doadump _doadump: nop; nop # .word 0x0101 #define _rpbmap _Sysmap+8 # scb, UNIvec, rpb, istack*4 bicl2 $PG_PROT,_rpbmap bisl2 $PG_KW,_rpbmap tstl _rpb+RP_FLAG # dump only once! bneq 1f incl _rpb+RP_FLAG mtpr $0,$TBIA movl sp,erpb movab erpb,sp mfpr $PCBB,-(sp) mfpr $MAPEN,-(sp) mfpr $IPL,-(sp) mtpr $0,$MAPEN mtpr $HIGH,$IPL pushr $0x3fff calls $0,_dumpsys 1: halt /* * Interrupt vector routines */ .globl _waittime #define SCBVEC(name) .align 2; .globl _X/**/name; _X/**/name #define PANIC(msg) clrl _waittime; pushab 1f; \ calls $1,_panic; 1: .asciz msg #define PRINTF(n,msg) pushab 1f; calls $n+1,_printf; MSG(msg) #define MSG(msg) .data; 1: .asciz msg; .text #define PUSHR pushr $0x3f #define POPR popr $0x3f SCBVEC(machcheck): PUSHR; pushab 6*4(sp); calls $1,_machinecheck; POPR; addl2 (sp)+,sp; rei SCBVEC(kspnotval): PUSHR; PANIC("KSP not valid"); SCBVEC(powfail): halt SCBVEC(chme): SCBVEC(chms): SCBVEC(chmu): PUSHR; PANIC("CHM? in kernel"); SCBVEC(stray): PUSHR; PRINTF(0, "stray scb interrupt\n"); POPR; rei SCBVEC(nexzvec): PUSHR; mfpr $IPL,-(sp); PRINTF(1, "nexus stray intr ipl%x\n"); POPR; rei SCBVEC(cmrd): PUSHR; calls $0,_memerr; POPR; rei SCBVEC(wtime): PUSHR; pushl 6*4(sp); PRINTF(1,"write timeout %x\n"); POPR; PANIC("wtimo"); #if NMBA > 0 SCBVEC(mba3int): PUSHR; pushl $3; brb 1f SCBVEC(mba2int): PUSHR; pushl $2; brb 1f SCBVEC(mba1int): PUSHR; pushl $1; brb 1f SCBVEC(mba0int): PUSHR; pushl $0 1: calls $1,_mbintr POPR incl _cnt+V_INTR rei #endif #if VAX780 /* * Registers for the uba handling code */ #define rUBANUM r0 #define rUBAHD r1 #define rUVEC r3 #define rUBA r4 /* r2,r5 are scratch */ SCBVEC(ua3int): PUSHR; movl $3,rUBANUM; moval _uba_hd+(3*UH_SIZE),rUBAHD; brb 1f SCBVEC(ua2int): PUSHR; movl $2,rUBANUM; moval _uba_hd+(2*UH_SIZE),rUBAHD; brb 1f SCBVEC(ua1int): PUSHR; movl $1,rUBANUM; moval _uba_hd+(1*UH_SIZE),rUBAHD; brb 1f SCBVEC(ua0int): PUSHR; movl $0,rUBANUM; moval _uba_hd+(0*UH_SIZE),rUBAHD; 1: incl _cnt+V_INTR mfpr $IPL,r2 /* r2 = mfpr(IPL); */ movl UH_UBA(rUBAHD),rUBA /* uba = uhp->uh_uba; */ movl UBA_BRRVR-0x14*4(rUBA)[r2],rUVEC /* uvec = uba->uba_brrvr[r2-0x14] */ ubanorm: bleq ubaerror addl2 UH_VEC(rUBAHD),rUVEC /* uvec += uh->uh_vec */ bicl3 $3,(rUVEC),r1 jmp 2(r1) /* 2 skips ``pushr $0x3f'' */ ubaerror: PUSHR; calls $0,_ubaerror; POPR /* ubaerror r/w's r0-r5 */ tstl rUVEC; jneq ubanorm /* rUVEC contains result */ POPR rei #endif SCBVEC(cnrint): PUSHR; calls $0,_cnrint; POPR; incl _cnt+V_INTR; rei SCBVEC(cnxint): PUSHR; calls $0,_cnxint; POPR; incl _cnt+V_INTR; rei SCBVEC(hardclock): PUSHR pushl 4+6*4(sp); pushl 4+6*4(sp); calls $2,_hardclock # hardclock(pc,psl) POPR; incl _cnt+V_INTR ## temp so not to break vmstat -= HZ rei SCBVEC(softclock): PUSHR pushl 4+6*4(sp); pushl 4+6*4(sp); calls $2,_softclock # softclock(pc,psl) POPR; rei #if defined(VAX750) || defined(VAX7ZZ) SCBVEC(consdin): PUSHR; calls $0,_turintr; POPR; incl _cnt+V_INTR; rei SCBVEC(consdout): PUSHR; calls $0,_tuxintr; POPR; incl _cnt+V_INTR; rei #else SCBVEC(consdin): halt SCBVEC(consdout): halt #endif #if NDZ > 0 /* * DZ pseudo dma routine: * r0 - controller number */ .align 1 .globl _dzdma _dzdma: mull2 $8*20,r0 movab _dzpdma(r0),r3 # pdma structure base # for this controller dzploop: movl r3,r0 movl (r0)+,r1 # device register address movzbl 1(r1),r2 # get line number bitb $0x80,r2 # TRDY on? beql dzprei # no bicb2 $0xf8,r2 # clear garbage bits mull2 $20,r2 addl2 r2,r0 # point at line's pdma structure movl (r0)+,r2 # p_mem cmpl r2,(r0)+ # p_mem < p_end ? bgequ dzpcall # no, go call dzxint movb (r2)+,6(r1) # dztbuf = *p_mem++ movl r2,-8(r0) brb dzploop # check for another line dzprei: POPR incl _cnt+V_PDMA rei dzpcall: pushl r3 pushl (r0)+ # push tty address calls $1,*(r0) # call interrupt rtn movl (sp)+,r3 brb dzploop # check for another line #endif /* * Stray UNIBUS interrupt catch routines */ .data .align 2 #define PJ PUSHR;jsb _Xustray .globl _catcher _catcher: PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ .globl _cold _cold: .long 1 .data .text SCBVEC(ustray): blbc _cold,1f mfpr $IPL,r11 subl3 $_catcher+8,(sp)+,r10 ashl $-1,r10,r10 POPR rei 1: subl3 $_catcher+8,(sp)+,r0 ashl $-1,r0,-(sp) mfpr $IPL,-(sp) PRINTF(2, "uba?: stray intr ipl %x vec %o\n") POPR rei /* * Trap and fault vector routines */ #define TRAP(a) pushl $a; brw alltraps /* * Ast delivery (profiling and/or reschedule) */ SCBVEC(astflt): pushl $0; TRAP(ASTFLT) SCBVEC(privinflt): pushl $0; TRAP(PRIVINFLT) SCBVEC(xfcflt): pushl $0; TRAP(XFCFLT) SCBVEC(resopflt): pushl $0; TRAP(RESOPFLT) SCBVEC(resadflt): pushl $0; TRAP(RESADFLT) SCBVEC(bptflt): pushl $0; TRAP(BPTFLT) SCBVEC(compatflt): TRAP(COMPATFLT); SCBVEC(tracep): pushl $0; TRAP(TRCTRAP) SCBVEC(arithtrap): TRAP(ARITHTRAP) SCBVEC(protflt): blbs (sp)+,segflt TRAP(PROTFLT) segflt: TRAP(SEGFLT) SCBVEC(transflt): bitl $1,(sp)+ bnequ tableflt TRAP(PAGEFLT) tableflt: TRAP(TABLEFLT) alltraps: mfpr $USP,-(sp); calls $0,_trap; mtpr (sp)+,$USP incl _cnt+V_TRAP addl2 $8,sp # pop type, code mtpr $HIGH,$IPL ## dont go to a higher IPL (GROT) rei SCBVEC(syscall): pushl $SYSCALL mfpr $USP,-(sp); calls $0,_syscall; mtpr (sp)+,$USP incl _cnt+V_SYSCALL addl2 $8,sp # pop type, code mtpr $HIGH,$IPL ## dont go to a higher IPL (GROT) rei /* * System page table */ #define vaddr(x) ((((x)-_Sysmap)/4)*NBPG+0x80000000) #define SYSMAP(mname, vname, npte) \ _/**/mname: .globl _/**/mname; \ .space npte*4; \ .globl _/**/vname; \ .set _/**/vname,vaddr(_/**/mname) .data .align 2 SYSMAP(Sysmap ,Sysbase ,SYSPTSIZE ) SYSMAP(UMBAbeg ,umbabeg ,0 ) SYSMAP(Nexmap ,nexus ,16*MAXNNEXUS ) SYSMAP(UMEMmap ,umem ,16*MAXNUBA ) SYSMAP(UMBAend ,umbaend ,0 ) SYSMAP(Usrptmap ,usrpt ,USRPTSIZE ) SYSMAP(Forkmap ,forkutl ,UPAGES ) SYSMAP(Xswapmap ,xswaputl ,UPAGES ) SYSMAP(Xswap2map,xswap2utl ,UPAGES ) SYSMAP(Swapmap ,swaputl ,UPAGES ) SYSMAP(Pushmap ,pushutl ,UPAGES ) SYSMAP(Vfmap ,vfutl ,UPAGES ) SYSMAP(CMAP1 ,CADDR1 ,1 ) SYSMAP(CMAP2 ,CADDR2 ,1 ) SYSMAP(mcrmap ,mcr ,1 ) SYSMAP(mmap ,vmmap ,1 ) SYSMAP(msgbufmap,msgbuf ,CLSIZE ) SYSMAP(camap ,cabase ,16*CLSIZE ) SYSMAP(ecamap ,calimit ,0 ) #ifdef BBNNET SYSMAP(Netmap ,netutl ,NNETPAGES*CLSIZE) #endif eSysmap: .globl _Syssize .set _Syssize,(eSysmap-_Sysmap)/4 .text /* * Initialization * * ipl 0x1f; mapen 0; scbb, pcbb, sbr, slr, isp, ksp not set */ .data .globl _cpu _cpu: .long 0 .text .globl start start: .word 0 /* set system control block base and system page table params */ mtpr $_scb-0x80000000,$SCBB mtpr $_Sysmap-0x80000000,$SBR mtpr $_Syssize,$SLR /* double map the kernel into the virtual user addresses of phys mem */ mtpr $_Sysmap,$P0BR mtpr $_Syssize,$P0LR @i% kssV_ q nV a>2iОО((/* set ISP and get cpu type */ movl $_intstack+NISP*NBPG,sp mfpr $SID,r0 movab _cpu,r1 extzv $24,$8,r0,(r1) /* init RPB */ movab _rpb,r0 movl r0,(r0)+ # rp_selfref movab _doadump,r1 movl r1,(r0)+ # rp_dumprout movl $0x1f,r2 clrl r3 1: addl2 (r1)+,r3; sobgtr r2,1b movl r3,(r0)+ # rp_chksum /* count up memory */ clrl r7 1: pushl $4; pushl r7; calls $2,_badaddr; tstl r0; bneq 9f acbl $8096*1024-1,$64*1024,r7,1b 9: /* clear memory from kernel bss and pages for proc 0 u. and page table */ movab _edata,r6 movab _end,r5 bbcc $31,r5,0f; 0: addl2 $(UPAGES*NBPG)+NBPG+NBPG,r5 1: clrq (r6); acbl r5,$8,r6,1b /* trap() and syscall() save r0-r11 in the entry mask (per ../h/reg.h) */ bisw2 $0x0fff,_trap bisw2 $0x0fff,_syscall calls $0,_fixctlrmask /* initialize system page table: scb and int stack writeable */ clrl r2 movab eintstack,r1; bbcc $31,r1,0f; 0: ashl $-PGSHIFT,r1,r1 1: bisl3 $PG_V|PG_KW,r2,_Sysmap[r2]; aoblss r1,r2,1b /* make rpb read-only as red zone for interrupt stack */ bicl2 $PG_PROT,_rpbmap bisl2 $PG_KR,_rpbmap /* make kernel text space read-only */ movab _etext+NBPG-1,r1; bbcc $31,r1,0f; 0: ashl $-PGSHIFT,r1,r1 1: bisl3 $PG_V|PG_KR,r2,_Sysmap[r2]; aoblss r1,r2,1b /* make kernel data, bss, read-write */ movab _end+NBPG-1,r1; bbcc $31,r1,0f; 0:; ashl $-PGSHIFT,r1,r1 1: bisl3 $PG_V|PG_KW,r2,_Sysmap[r2]; aoblss r1,r2,1b /* now go to mapped mode */ mtpr $1,$TBIA; mtpr $1,$MAPEN; jmp *$0f; 0: /* init mem sizes */ ashl $-PGSHIFT,r7,_maxmem movl _maxmem,_physmem movl _maxmem,_freemem /* setup context for proc[0] == Scheduler */ movab _end+NBPG-1,r6 bicl2 $NBPG-1,r6 # make page boundary /* setup page table for proc[0] */ bbcc $31,r6,0f; 0: ashl $-PGSHIFT,r6,r3 # r3 = btoc(r6) bisl3 $PG_V|PG_KW,r3,_Usrptmap # init first upt entry incl r3 movab _usrpt,r0 mtpr r0,$TBIS /* init p0br, p0lr */ mtpr r0,$P0BR mtpr $0,$P0LR /* init p1br, p1lr */ movab NBPG(r0),r0 movl $0x200000-UPAGES,r1 mtpr r1,$P1LR mnegl r1,r1 moval -4*UPAGES(r0)[r1],r2 mtpr r2,$P1BR /* setup mapping for UPAGES of _u */ movl $UPAGES,r2; movab _u+NBPG*UPAGES,r1; addl2 $UPAGES,r3; jbr 2f 1: decl r3 moval -NBPG(r1),r1; bisl3 $PG_V|PG_URKW,r3,-(r0) mtpr r1,$TBIS 2: sobgeq r2,1b /* initialize (slightly) the pcb */ movab UPAGES*NBPG(r1),PCB_KSP(r1) mnegl $1,PCB_ESP(r1) mnegl $1,PCB_SSP(r1) movl r1,PCB_USP(r1) mfpr $P0BR,PCB_P0BR(r1) mfpr $P0LR,PCB_P0LR(r1) movb $4,PCB_P0LR+3(r1) # disable ast mfpr $P1BR,PCB_P1BR(r1) mfpr $P1LR,PCB_P1LR(r1) movl $CLSIZE,PCB_SZPT(r1) # init u.u_pcb.pcb_szpt movl r11,PCB_R11(r1) movab 1f,PCB_PC(r1) # initial pc clrl PCB_PSL(r1) # mode(k,k), ipl=0 ashl $PGSHIFT,r3,r3 mtpr r3,$PCBB # first pcbb /* set regs, p0br, p0lr, p1br, p1lr, astlvl, ksp and change to kernel mode */ ldpctx rei /* put signal trampoline code in u. area */ 1: movab _u,r0 movc3 $12,sigcode,PCB_SIGC(r0) /* save reboot flags in global _boothowto */ movl r11,_boothowto /* calculate firstaddr, and call main() */ movab _end+NBPG-1,r0; bbcc $31,r0,0f; 0:; ashl $-PGSHIFT,r0,-(sp) addl2 $UPAGES+1,(sp); calls $1,_main /* proc[1] == /etc/init now running here; run icode */ pushl $PSL_CURMOD|PSL_PRVMOD; pushl $0; rei /* signal trampoline code: it is known that this code takes exactly 12 bytes */ /* in ../h/pcb.h and in the movc3 above */ sigcode: calls $3,1(pc) rei .word 0x7f # registers 0-6 (6==sp/compat) callg (ap),*12(ap) ret /* * Primitives */ /* * badaddr(addr, len) * see if access addr with a len type instruction causes a machine check * len is length of access (1=byte, 2=short, 4=long) */ .globl _badaddr _badaddr: .word 0 movl $1,r0 mfpr $IPL,r1 mtpr $HIGH,$IPL movl _scb+MCKVEC,r2 movl 4(ap),r3 movl 8(ap),r4 movab 9f+INTSTK,_scb+MCKVEC bbc $0,r4,1f; tstb (r3) 1: bbc $1,r4,1f; tstw (r3) 1: bbc $2,r4,1f; tstl (r3) 1: clrl r0 # made it w/o machine checks 2: movl r2,_scb+MCKVEC mtpr r1,$IPL ret .align 2 9: casel _cpu,$1,$VAX_MAX 0: .word 8f-0b # 1 is 780 .word 5f-0b # 2 is 750 .word 5f-0b # 3 is 7ZZ 5: #if defined(VAX750) || defined(VAX7ZZ) mtpr $0xf,$MCESR #endif brb 1f 8: #if VAX780 mtpr $0,$SBIFS #endif 1: addl2 (sp)+,sp # discard mchchk trash movab 2b,(sp) rei _addupc: .globl _addupc .word 0x0 movl 8(ap),r2 # &u.u_prof subl3 8(r2),4(ap),r0 # corrected pc blss 9f extzv $1,$31,r0,r0 # logical right shift extzv $1,$31,12(r2),r1 # ditto for scale emul r1,r0,$0,r0 ashq $-14,r0,r0 tstl r1 bneq 9f incl r0 bicl2 $1,r0 cmpl r0,4(r2) # length bgequ 9f addl2 (r2),r0 # base probew $3,$2,(r0) beql 8f addw2 12(ap),(r0) 9: ret 8: clrl 12(r2) ret _Copyin: .globl _Copyin # <<>> movl 12(sp),r0 # copy length blss ersb movl 4(sp),r1 # copy user address cmpl $NBPG,r0 # probing one page or less ? bgeq cishort # yes ciloop: prober $3,$NBPG,(r1) # bytes accessible ? beql ersb # no addl2 $NBPG,r1 # incr user address ptr acbl $NBPG+1,$-NBPG,r0,ciloop # reduce count and loop cishort: prober $3,r0,(r1) # bytes accessible ? beql ersb # no movc3 12(sp),*4(sp),*8(sp) clrl r0 rsb ersb: mnegl $1,r0 rsb _Copyout: .globl _Copyout # <<>> movl 12(sp),r0 # get count blss ersb movl 8(sp),r1 # get user address cmpl $NBPG,r0 # can do in one probew? bgeq coshort # yes coloop: probew $3,$NBPG,(r1) # bytes accessible? beql ersb # no addl2 $NBPG,r1 # increment user address acbl $NBPG+1,$-NBPG,r0,coloop # reduce count and loop coshort: probew $3,r0,(r1) # bytes accessible? beql ersb # no movc3 12(sp),*4(sp),*8(sp) clrl r0 rsb /* * non-local goto's */ .globl _Setjmp _Setjmp: movq r6,(r0)+ movq r8,(r0)+ movq r10,(r0)+ movq r12,(r0)+ addl3 $4,sp,(r0)+ movl (sp),(r0) clrl r0 rsb .globl _Longjmp _Longjmp: movq (r0)+,r6 movq (r0)+,r8 movq (r0)+,r10 movq (r0)+,r12 movl (r0)+,r1 cmpl r1,sp # must be a pop bgequ lj2 pushab lj1 calls $1,_panic lj2: movl r1,sp jmp *(r0) # ``rsb'' lj1: .asciz "longjmp" .globl _whichqs .globl _qs .globl _cnt .globl _noproc .comm _noproc,4 .globl _runrun .comm _runrun,4 /* * The following primitives use the fancy VAX instructions * much like VMS does. _whichqs tells which of the 32 queues _qs * have processes in them. Setrq puts processes into queues, Remrq * removes them from queues. The running process is on no queue, * other processes are on a queue related to p->p_pri, divided by 4 * actually to shrink the 0-127 range of priorities into the 32 available * queues. */ /* * Setrq(p), using fancy VAX instructions. * * Call should be made at spl6(), and p->p_stat should be SRUN */ .globl _Setrq # <<>> _Setrq: tstl P_RLINK(r0) ## firewall: p->p_rlink must be 0 beql set1 ## pushab set3 ## calls $1,_panic ## set1: movzbl P_PRI(r0),r1 # put on queue which is p->p_pri / 4 ashl $-2,r1,r1 movaq _qs[r1],r2 insque (r0),*4(r2) # at end of queue bbss r1,_whichqs,set2 # mark queue non-empty set2: rsb set3: .asciz "setrq" /* * Remrq(p), using fancy VAX instructions * * Call should be made at spl6(). */ .globl _Remrq # <<>> _Remrq: movzbl P_PRI(r0),r1 ashl $-2,r1,r1 bbsc r1,_whichqs,rem1 pushab rem3 # it wasn't recorded to be on its q calls $1,_panic rem1: remque (r0),r2 beql rem2 bbss r1,_whichqs,rem2 rem2: clrl P_RLINK(r0) ## for firewall checking rsb rem3: .asciz "remrq" /* * Masterpaddr is the p->p_addr of the running process on the master * processor. When a multiprocessor system, the slave processors will have * an array of slavepaddr's. */ .globl _masterpaddr .data _masterpaddr: .long 0 .text sw0: .asciz "swtch" /* * Swtch(), using fancy VAX instructions */ .globl _Swtch _Swtch: # <<>> movl $1,_noproc clrl _runrun sw1: ffs $0,$32,_whichqs,r0 # look for non-empty queue bneq sw1a mtpr $0,$IPL # must allow interrupts here brw sw1 # this is an idle loop! sw1a: mtpr $0x18,$IPL # lock out all so _whichqs==_qs bbcc r0,_whichqs,sw1 # proc moved via lbolt interrupt movaq _qs[r0],r1 remque *(r1),r2 # r2 = p = highest pri process bvc sw2 # make sure something was there sw1b: pushab sw0 calls $1,_panic sw2: beql sw3 insv $1,r0,$1,_whichqs # still more procs in this queue sw3: clrl _noproc tstl P_WCHAN(r2) ## firewalls bneq sw1b ## movzbl P_STAT(r2),r3 ## cmpl $SRUN,r3 ## bneq sw1b ## clrl P_RLINK(r2) ## movl *P_ADDR(r2),r0 movl r0,_masterpaddr ashl $PGSHIFT,r0,r0 # r0 = pcbb(p) /* mfpr $PCBB,r1 # resume of current proc is easy * cmpl r0,r1 */ beql res0 incl _cnt+V_SWTCH /* fall into... */ /* * Resume(pf) */ .globl _Resume # <<>> _Resume: mtpr $0x18,$IPL # no interrupts, please movl _CMAP2,_u+PCB_CMAP2 # yech svpctx mtpr r0,$PCBB ldpctx movl _u+PCB_CMAP2,_CMAP2 # yech mtpr $_CADDR2,$TBIS res0: tstl _u+PCB_SSWAP beql res1 movl _u+PCB_SSWAP,r0 clrl _u+PCB_SSWAP movab _Longjmp,(sp) movl $PSL_PRVMOD,4(sp) # ``cheating'' (jfr) res1: rei /* * {fu,su},{byte,word}, all massaged by asm.sed to jsb's */ .globl _Fuword _Fuword: prober $3,$4,(r0) beql fserr movl (r0),r0 rsb fserr: mnegl $1,r0 rsb .globl _Fubyte _Fubyte: prober $3,$1,(r0) beql fserr movzbl (r0),r0 rsb .globl _Suword _Suword: probew $3,$4,(r0) beql fserr movl r1,(r0) clrl r0 rsb .globl _Subyte _Subyte: probew $3,$1,(r0) beql fserr movb r1,(r0) clrl r0 rsb /* * Copy 1 relocation unit (NBPG bytes) * from user virtual address to physical address */ _copyseg: .globl _copyseg .word 0x0 bisl3 $PG_V|PG_KW,8(ap),_CMAP2 mtpr $_CADDR2,$TBIS # invalidate entry for copy movc3 $NBPG,*4(ap),_CADDR2 ret /* * zero out physical memory * specified in relocation units (NBPG bytes) */ _clearseg: .globl _clearseg .word 0x0 bisl3 $PG_V|PG_KW,4(ap),_CMAP1 mtpr $_CADDR1,$TBIS movc5 $0,(sp),$0,$NBPG,_CADDR1 ret /* * Check address. * Given virtual address, byte count, and rw flag * returns 0 on no access. */ _useracc: .globl _useracc .word 0x0 movl 4(ap),r0 # get va movl 8(ap),r1 # count tstl 12(ap) # test for read access ? bneq userar # yes cmpl $NBPG,r1 # can we do it in one prob((e ? bgeq uaw2 # yes uaw1: probew $3,$NBPG,(r0) beql uaerr # no access addl2 $NBPG,r0 acbl $NBPG+1,$-NBPG,r1,uaw1 uaw2: probew $3,r1,(r0) beql uaerr movl $1,r0 ret userar: cmpl $NBPG,r1 bgeq uar2 uar1: prober $3,$NBPG,(r0) beql uaerr addl2 $NBPG,r0 acbl $NBPG+1,$-NBPG,r1,uar1 uar2: prober $3,r1,(r0) beql uaerr movl $1,r0 ret uaerr: clrl r0 ret /* * kernacc - check for kernel access privileges * * We can't use the probe instruction directly because * it ors together current and previous mode. */ .globl _kernacc _kernacc: .word 0x0 movl 4(ap),r0 # virtual address bbcc $31,r0,kacc1 bbs $30,r0,kacerr mfpr $SBR,r2 # address and length of page table (system) bbss $31,r2,0f; 0: mfpr $SLR,r3 brb kacc2 kacc1: bbsc $30,r0,kacc3 mfpr $P0BR,r2 # user P0 mfpr $P0LR,r3 brb kacc2 kacc3: mfpr $P1BR,r2 # user P1 (stack) mfpr $P1LR,r3 kacc2: addl3 8(ap),r0,r1 # ending virtual address addl2 $NBPG-1,r1 ashl $-PGSHIFT,r0,r0 ashl $-PGSHIFT,r1,r1 bbs $31,4(ap),kacc6 bbc $30,4(ap),kacc6 cmpl r0,r3 # user stack blss kacerr # address too low brb kacc4 kacc6: cmpl r1,r3 # compare last page to P0LR or SLR bgtr kacerr # address too high kacc4: movl (r2)[r0],r3 bbc $31,4(ap),kacc4a bbc $31,r3,kacerr # valid bit is off kacc4a: cmpzv $27,$4,r3,$1 # check protection code bleq kacerr # no access allowed tstb 12(ap) bneq kacc5 # only check read access cmpzv $27,$2,r3,$3 # check low 2 bits of prot code beql kacerr # no write access kacc5: aoblss r1,r0,kacc4 # next page movl $1,r0 # no errors ret kacerr: clrl r0 # error ret .globl _Xrkintr0 .align 2 _Xrkintr0: pushr $0x3f pushl $0 calls $1,_rkintr popr $0x3f rei .globl _Xlpintr0 .align 2 _Xlpintr0: pushr $0x3f pushl $0 calls $1,_lpintr popr $0x3f rei .globl _Xtmintr0 .align 2 _Xtmintr0: pushr $0x3f pushl $0 calls $1,_tmintr popr $0x3f rei .globl _Xupintr0 .align 2 _Xupintr0: pushr $0x3f pushl $0 calls $1,_upintr popr $0x3f rei .globl _Xudintr0 .align 2 _Xudintr0: pushr $0x3f pushl $0 calls $1,_udintr popr $0x3f rei .globl _Xdnintr0 .align 2 _Xdnintr0: pushr $0x3f pushl $0 calls $1,_dnintr popr $0x3f rei .globl _Xdhrint0 .align 2 _Xdhrint0: pushr $0x3f pushl $0 calls $1,_dhrint popr $0x3f rei .globl _Xdhxint0 .align 2 _Xdhxint0: pushr $0x3f pushl $0 calls $1,_dhxint popr $0x3f rei .globl _Xdhrint1 .align 2 _Xdhrint1: pushr $0x3f pushl $1 calls $1,_dhrint popr $0x3f rei .globl _Xdhxint1 .align 2 _Xdhxint1: pushr $0x3f pushl $1 calls $1,_dhxint popr $0x3f rei .globl _Xdzrint0 .align 2 _Xdzrint0: pushr $0x3f pushl $0 calls $1,_dzrint popr $0x3f rei .globl _Xdzxint0 .align 2 _Xdzxint0: pushr $0x3f movl $0,r0 jbr _dzdma .globl _Xdzrint1 .align 2 _Xdzrint1: pushr $0x3f pushl $1 calls $1,_dzrint popr $0x3f rei .globl _Xdzxint1 .align 2 _Xdzxint1: pushr $0x3f movl $1,r0 jbr _dzdma .globl _Xdzrint2 .align 2 _Xdzrint2: pushr $0x3f pushl $2 calls $1,_dzrint popr $0x3f rei .globl _Xdzxint2 .align 2 _Xdzxint2: pushr $0x3f movl $2,r0 jbr _dzdma .globl _Xdzrint3 .align 2 _Xdzrint3: pushr $0x3f pushl $3 calls $1,_dzrint popr $0x3f rei .globl _Xdzxint3 .align 2 _Xdzxint3: pushr $0x3f movl $3,r0 jbr _dzdma .globl _Xdzrint4 .align 2 _Xdzrint4: pushr $0x3f pushl $4 calls $1,_dzrint popr $0x3f rei .globl _Xdzxint4 .align 2 _Xdzxint4: pushr $0x3f movl $4,r0 jbr _dzdma .globl _Xdzrint5 .align 2 _Xdzrint5: pushr $0x3f pushl $5 calls $1,_dzrint popr $0x3f rei .globl _Xdzxint5 .align 2 _Xdzxint5: pushr $0x3f movl $5,r0 jbr _dzdma .globl _Xdzrint6 .align 2 _Xdzrint6: pushr $0x3f pushl $6 calls $1,_dzrint popr $0x3f rei .globl _Xdzxint6 .align 2 _Xdzxint6: pushr $0x3f movl $6,r0 jbr _dzdma .globl _Xdzrint7 .align 2 _Xdzrint7: pushr $0x3f pushl $7 calls $1,_dzrint popr $0x3f rei .globl _Xdzxint7 .align 2 _Xdzxint7: pushr $0x3f movl $7,r0 jbr _dzdma .globl _Xtsintr0 .align 2 _Xtsintr0: pushr $0x3f pushl $0 calls $1,_tsintr popr $0x3f rei @i4 k}нAgZ]  y  E2iaa IDENT=-DGENERIC -DVAX7ZZ -DVAX750 -DVAX780 PARAM=-DHZ=60 -DTIMEZONE=0 -DDST=0 -DMAXUSERS=8 # # Makefile for Berkeley Virtual Vax/Unix, February 1981 # # This makefile is constructed from a machine description: # config machine # Most changes should be made in the machine description # /usr/sys/conf/``machineid'' # after which you should do # config machineid # Generic makefile changes should be made in # /usr/sys/conf/makefile # after which config should be rerun for all machines. # # N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE # IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING # # -DINSECURE old style non-vanishing suid bits # -DUNFAST don't compile in inline expansions and speedups # -DPGINPROF gather statistics about pagein/pageout activity # -DDISKMON monitor disk cacheing activity (bio.c) # -DINTRLVE compile in code for file systems interleaved across drives # -DTRACE compile in kernel tracing hooks # C2= /lib/c2 COPTS= ${IDENT} -DKERNEL -DVMUNIX CFLAGS= -O ${COPTS} AHEADS= ../h/pcb.m OBJS=acct.o alloc.o calloc.o clock.o fio.o iget.o ioctl.o machdep.o \ main.o nami.o partab.o pipe.o prf.o prim.o rdwri.o rmap.o sig.o \ slp.o subr.o sys.o sys1.o sys2.o sys3.o sys4.o sysent.o text.o \ trap.o vmdrum.o vmmem.o vmmon.o vmpage.o vmproc.o vmpt.o \ vmsched.o vmsubr.o vmswap.o vmsys.o udiv.o urem.o autoconf.o \ bio.o conf.o cons.o dh.o dkbad.o dkleave.o dn.o dsort.o dz.o \ flp.o hp.o ht.o lp.o mba.o mem.o mx1.o mx2.o mt.o rk.o sw.o tm.o \ ts.o tty.o ttynew.o ttyold.o tu.o uba.o uda.o up.o vaxcpu.o CFILES=../sys/acct.c ../sys/alloc.c ../sys/calloc.c ../sys/clock.c \ ../sys/fio.c ../sys/iget.c ../sys/ioctl.c ../sys/machdep.c \ ../sys/main.c ../sys/nami.c ../sys/partab.c ../sys/pipe.c \ ../sys/prf.c ../sys/prim.c ../sys/rdwri.c ../sys/rmap.c \ ../sys/sig.c ../sys/slp.c ../sys/subr.c ../sys/sys.c \ ../sys/sys1.c ../sys/sys2.c ../sys/sys3.c ../sys/sys4.c \ ../sys/sysent.c ../sys/text.c ../sys/trap.c ../sys/vmdrum.c \ ../sys/vmmem.c ../sys/vmmon.c ../sys/vmpage.c ../sys/vmproc.c \ ../sys/vmpt.c ../sys/vmsched.c ../sys/vmsubr.c ../sys/vmswap.c \ ../sys/vmsys.c ../dev/autoconf.c ../dev/bio.c ../dev/conf.c \ ../dev/cons.c ../dev/dh.c ../dev/dkbad.c ../dev/dkleave.c \ ../dev/dn.c ../dev/dsort.c ../dev/dz.c ../dev/flp.c ../dev/hp.c \ ../dev/ht.c ../dev/lp.c ../dev/mba.c ../dev/mem.c ../dev/mx1.c \ ../dev/mx2.c ../dev/mt.c ../dev/rk.c ../dev/sw.c ../dev/tm.c \ ../dev/ts.c ../dev/tty.c ../dev/ttynew.c ../dev/ttyold.c \ ../dev/tu.c ../dev/uba.c ../dev/uda.c ../dev/up.c \ ../dev/vaxcpu.c vmunix: makefile locore.o ${OBJS} ioconf.o param.o swapgeneric.o @echo loading vmunix @rm -f vmunix @sh ../conf/newvers.sh @cc $(CFLAGS) -c vers.c @ld -n -o vmunix -e start -x -T 80000000 locore.o ${OBJS} vers.o ioconf.o param.o swapgeneric.o @echo rearranging symbols @-symorder ../sys/symbols.sort vmunix @size vmunix @chmod 755 vmunix swapgeneric.o: ../dev/swapgeneric.c ${CC} -I. -c -S ${COPTS} ../dev/swapgeneric.c ${C2} swapgeneric.s | sed -f ../sys/asm.sed | ${AS} -o swapgeneric.o rm -f swapgeneric.s all: vmunix clean: rm -f eddep *vmunix* tags *.o locore.i [a-tv-z]*.s touch errs linterrs lint: /tmp @lint -hbxn -I. -DGENERIC ${COPTS} ../sys/Locore.c \ ${CFILES} ../dev/swapgeneric.c ioconf.c | \ grep -v 'struct/union .* never defined' | \ grep -v 'possible pointer alignment problem' ../sys/symbols.sort: ../sys/symbols.raw grep -v '^#' ../sys/symbols.raw \ | sed 's/^ //' | sort | uniq > ../sys/symbols.sort locore.o: assym.s ${AHEADS} ../sys/scb.s ../sys/locore.s ubglue.s \ ../h/mtpr.h ../h/trap.h ../h/psl.h ../h/pte.h ../h/cpu.h ../h/mtpr.h mba.h cat assym.s ../sys/scb.s ../sys/locore.s ubglue.s > locore.c cc -E -DLOCORE ${COPTS} locore.c > locore.i @echo 'as -o locore.o $${AHEADS} locore.i' @as -o locore.o ${AHEADS} locore.i @rm locore.i # the following is necessary because autoconf.o depends on #if GENERIC autoconf.o: makefile # the following are necessary because the files depend on the types of # vax cpu's included in the system configuration clock.o machdep.o autoconf.o conf.o cons.o flp.o mba.o uba.o vaxcpu.o : makefile assym.s: ../h/param.h ../h/pte.h ../h/buf.h ../h/vmparam.h ../h/vmmeter.h \ ../h/dir.h ../h/cmap.h ../h/map.h ../h/ubavar.h ../h/proc.h cc ${IDENT} ../conf/genassym.c; ./a.out >assym.s; rm -f a.out ../h/param.h: /usr/include/signal.h touch ./touch ../h/param.h ../h/tty.h: /usr/include/sgtty.h ../h/ioctl.h touch ./touch ../h/tty.h ../h/user.h: ../h/pcb.h ../h/dmap.h ../h/vtimes.h ../h/types.h \ /usr/include/errno.h touch ./touch ../h/user.h ../h/vm.h: ../h/vmmac.h ../h/vmmeter.h ../h/vmparam.h ../h/vmsystm.h touch ./touch ../h/vm.h ../sys/sysent.c: ../sys/vmsysent.c touch ./touch ../sys/sysent.c touch: ../conf/touch.c cc ../conf/touch.c -o touch depend: grep '^#include' ${CFILES} | grep -v '<' | \ sed 's/:[^"]*"\([^"]*\)".*/: \1/' | \ sed 's/\.c/.o/' | sed 's,../[a-z]*/,,' | \ awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \ else { if (length(rec $$2) > 78) { print rec; ((rec = $$0; } \ else rec = rec " " $$2 } } \ END { print rec } ' > makedep echo '$$r makedep' >>eddep echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep echo '$$r makedep' >>eddep echo 'w' >>eddep cp makefile makefile.bak ed - makefile < eddep rm eddep makedep tags: /usr/ucb/ctags ${CFILES} print: @pr -f makefile ../sys/TODO linterrs @/usr/ucb/ctags -x ${CFILES} | pr -f -h XREF @(size vmunix *.o) | pr -f -h sizes @ls -ls | pr -f @cd ../h; ls -ls | pr -f ; pr -f *.m *.h @cd ../sys; pr -f asm.sed Locore.c scb.s locore.s @pr -f ${CFILES} ioconf.o: ioconf.c ../h/param.h ../h/pte.h ../h/buf.h ../h/map.h \ ../h/mbavar.h ../h/vm.h ../h/ubavar.h ${CC} -I. -c -S ${COPTS} ioconf.c ${C2} ioconf.s | sed -f ../sys/asm.sed | ${AS} -o ioconf.o rm -f ioconf.s param.c: ../sys/param.c cp ../sys/param.c . param.o: param.c makefile ${CC} -c -O ${IDENT} ${PARAM} param.c acct.o: ../sys/acct.c ${CC} -I. -c -S ${COPTS} ../sys/acct.c ${C2} acct.s | sed -f ../sys/asm.sed | ${AS} -o acct.o rm -f acct.s alloc.o: ../sys/alloc.c ${CC} -I. -c -S ${COPTS} ../sys/alloc.c ${C2} alloc.s | sed -f ../sys/asm.sed | ${AS} -o alloc.o rm -f alloc.s calloc.o: ../sys/calloc.c ${CC} -I. -c -S ${COPTS} ../sys/calloc.c ${C2} calloc.s | sed -f ../sys/asm.sed | ${AS} -o calloc.o rm -f calloc.s clock.o: ../sys/clock.c ${CC} -I. -c -S ${COPTS} ../sys/clock.c ${C2} clock.s | sed -f ../sys/asm.sed | ${AS} -o clock.o rm -f clock.s fio.o: ../sys/fio.c ${CC} -I. -c -S ${COPTS} ../sys/fio.c ${C2} fio.s | sed -f ../sys/asm.sed | ${AS} -o fio.o rm -f fio.s iget.o: ../sys/iget.c ${CC} -I. -c -S ${COPTS} ../sys/iget.c ${C2} iget.s | sed -f ../sys/asm.sed | ${AS} -o iget.o rm -f iget.s ioctl.o: ../sys/ioctl.c ${CC} -I. -c -S ${COPTS} ../sys/ioctl.c ${C2} ioctl.s | sed -f ../sys/asm.sed | ${AS} -o ioctl.o rm -f ioctl.s machdep.o: ../sys/machdep.c ${CC} -I. -c -S ${COPTS} ../sys/machdep.c ${C2} machdep.s | sed -f ../sys/asm.sed | ${AS} -o machdep.o rm -f machdep.s main.o: ../sys/main.c ${CC} -I. -c -S ${COPTS} ../sys/main.c ${C2} main.s | sed -f ../sys/asm.sed | ${AS} -o main.o rm -f main.s nami.o: ../sys/nami.c ${CC} -I. -c -S ${COPTS} ../sys/nami.c ${C2} nami.s | sed -f ../sys/asm.sed | ${AS} -o nami.o rm -f nami.s partab.o: ../sys/partab.c ${CC} -I. -c -S ${COPTS} ../sys/partab.c ${C2} partab.s | sed -f ../sys/asm.sed | ${AS} -o partab.o rm -f partab.s pipe.o: ../sys/pipe.c ${CC} -I. -c -S ${COPTS} ../sys/pipe.c ${C2} pipe.s | sed -f ../sys/asm.sed | ${AS} -o pipe.o rm -f pipe.s prf.o: ../sys/prf.c ${CC} -I. -c -S ${COPTS} ../sys/prf.c ${C2} prf.s | sed -f ../sys/asm.sed | ${AS} -o prf.o rm -f prf.s prim.o: ../sys/prim.c ${CC} -I. -c -S ${COPTS} ../sys/prim.c ${C2} prim.s | sed -f ../sys/asm.sed | ${AS} -o prim.o rm -f prim.s rdwri.o: ../sys/rdwri.c ${CC} -I. -c -S ${COPTS} ../sys/rdwri.c ${C2} rdwri.s | sed -f ../sys/asm.sed | ${AS} -o rdwri.o rm -f rdwri.s rmap.o: ../sys/rmap.c ${CC} -I. -c -S ${COPTS} ../sys/rmap.c ${C2} rmap.s | sed -f ../sys/asm.sed | ${AS} -o rmap.o rm -f rmap.s sig.o: ../sys/sig.c ${CC} -I. -c -S ${COPTS} ../sys/sig.c ${C2} sig.s | sed -f ../sys/asm.sed | ${AS} -o sig.o rm -f sig.s slp.o: ../sys/slp.c ${CC} -I. -c -S ${COPTS} ../sys/slp.c ${C2} slp.s | sed -f ../sys/asm.sed | ${AS} -o slp.o rm -f slp.s subr.o: ../sys/subr.c ${CC} -I. -c -S ${COPTS} ../sys/subr.c ${C2} subr.s | sed -f ../sys/asm.sed | ${AS} -o subr.o rm -f subr.s sys.o: ../sys/sys.c ${CC} -I. -c -S ${COPTS} ../sys/sys.c ${C2} sys.s | sed -f ../sys/asm.sed | ${AS} -o sys.o rm -f sys.s sys1.o: ../sys/sys1.c ${CC} -I. -c -S ${COPTS} ../sys/sys1.c ${C2} sys1.s | sed -f ../sys/asm.sed | ${AS} -o sys1.o rm -f sys1.s sys2.o: ../sys/sys2.c ${CC} -I. -c -S ${COPTS} ../sys/sys2.c ${C2} sys2.s | sed -f ../sys/asm.sed | ${AS} -o sys2.o rm -f sys2.s sys3.o: ../sys/sys3.c ${CC} -I. -c -S ${COPTS} ../sys/sys3.c ${C2} sys3.s | sed -f ../sys/asm.sed | ${AS} -o sys3.o rm -f sys3.s sys4.o: ../sys/sys4.c ${CC} -I. -c -S ${COPTS} ../sys/sys4.c ${C2} sys4.s | sed -f ../sys/asm.sed | ${AS} -o sys4.o rm -f sys4.s sysent.o: ../sys/sysent.c ${CC} -I. -c -S ${COPTS} ../sys/sysent.c ${C2} sysent.s | sed -f ../sys/asm.sed | ${AS} -o sysent.o rm -f sysent.s text.o: ../sys/text.c ${CC} -I. -c -S ${COPTS} ../sys/text.c ${C2} text.s | sed -f ../sys/asm.sed | ${AS} -o text.o rm -f text.s trap.o: ../sys/trap.c ${CC} -I. -c -S ${COPTS} ../sys/trap.c ${C2} trap.s | sed -f ../sys/asm.sed | ${AS} -o trap.o rm -f trap.s vmdrum.o: ../sys/vmdrum.c ${CC} -I. -c -S ${COPTS} ../sys/vmdrum.c ${C2} vmdrum.s | sed -f ../sys/asm.sed | ${AS} -o vmdrum.o rm -f vmdrum.s vmmem.o: ../sys/vmmem.c ${CC} -I. -c -S ${COPTS} ../sys/vmmem.c ${C2} vmmem.s | sed -f ../sys/asm.sed | ${AS} -o vmmem.o rm -f vmmem.s vmmon.o: ../sys/vmmon.c ${CC} -I. -c -S ${COPTS} ../sys/vmmon.c ${C2} vmmon.s | sed -f ../sys/asm.sed | ${AS} -o vmmon.o rm -f vmmon.s vmpage.o: ../sys/vmpage.c ${CC} -I. -c -S ${COPTS} ../sys/vmpage.c ${C2} vmpage.s | sed -f ../sys/asm.sed | ${AS} -o vmpage.o rm -f vmpage.s vmproc.o@i? kzϼAgZ]  y  E2iaa: ../sys/vmproc.c ${CC} -I. -c -S ${COPTS} ../sys/vmproc.c ${C2} vmproc.s | sed -f ../sys/asm.sed | ${AS} -o vmproc.o rm -f vmproc.s vmpt.o: ../sys/vmpt.c ${CC} -I. -c -S ${COPTS} ../sys/vmpt.c ${C2} vmpt.s | sed -f ../sys/asm.sed | ${AS} -o vmpt.o rm -f vmpt.s vmsched.o: ../sys/vmsched.c ${CC} -I. -c -S ${COPTS} ../sys/vmsched.c ${C2} vmsched.s | sed -f ../sys/asm.sed | ${AS} -o vmsched.o rm -f vmsched.s vmsubr.o: ../sys/vmsubr.c ${CC} -I. -c -S ${COPTS} ../sys/vmsubr.c ${C2} vmsubr.s | sed -f ../sys/asm.sed | ${AS} -o vmsubr.o rm -f vmsubr.s vmswap.o: ../sys/vmswap.c ${CC} -I. -c -S ${COPTS} ../sys/vmswap.c ${C2} vmswap.s | sed -f ../sys/asm.sed | ${AS} -o vmswap.o rm -f vmswap.s vmsys.o: ../sys/vmsys.c ${CC} -I. -c -S ${COPTS} ../sys/vmsys.c ${C2} vmsys.s | sed -f ../sys/asm.sed | ${AS} -o vmsys.o rm -f vmsys.s udiv.o: ../sys/udiv.s ${AS} -o udiv.o ../sys/udiv.s urem.o: ../sys/urem.s ${AS} -o urem.o ../sys/urem.s autoconf.o: ../dev/autoconf.c ${CC} -I. -c -S ${COPTS} ../dev/autoconf.c ${C2} -i autoconf.s | sed -f ../sys/asm.sed | ${AS} -o autoconf.o rm -f autoconf.s bio.o: ../dev/bio.c ${CC} -I. -c -S ${COPTS} ../dev/bio.c ${C2} bio.s | sed -f ../sys/asm.sed | ${AS} -o bio.o rm -f bio.s conf.o: ../dev/conf.c ${CC} -I. -c -S ${COPTS} ../dev/conf.c ${C2} conf.s | sed -f ../sys/asm.sed | ${AS} -o conf.o rm -f conf.s cons.o: ../dev/cons.c ${CC} -I. -c -S ${COPTS} ../dev/cons.c ${C2} cons.s | sed -f ../sys/asm.sed | ${AS} -o cons.o rm -f cons.s dh.o: ../dev/dh.c ${CC} -I. -c -S ${COPTS} ../dev/dh.c ${C2} -i dh.s | sed -f ../sys/asm.sed | ${AS} -o dh.o rm -f dh.s dkbad.o: ../dev/dkbad.c ${CC} -I. -c -S ${COPTS} ../dev/dkbad.c ${C2} dkbad.s | sed -f ../sys/asm.sed | ${AS} -o dkbad.o rm -f dkbad.s dkleave.o: ../dev/dkleave.c ${CC} -I. -c -S ${COPTS} ../dev/dkleave.c ${C2} dkleave.s | sed -f ../sys/asm.sed | ${AS} -o dkleave.o rm -f dkleave.s dn.o: ../dev/dn.c ${CC} -I. -c -S ${COPTS} ../dev/dn.c ${C2} -i dn.s | sed -f ../sys/asm.sed | ${AS} -o dn.o rm -f dn.s dsort.o: ../dev/dsort.c ${CC} -I. -c -S ${COPTS} ../dev/dsort.c ${C2} dsort.s | sed -f ../sys/asm.sed | ${AS} -o dsort.o rm -f dsort.s dz.o: ../dev/dz.c ${CC} -I. -c -S ${COPTS} ../dev/dz.c ${C2} -i dz.s | sed -f ../sys/asm.sed | ${AS} -o dz.o rm -f dz.s flp.o: ../dev/flp.c ${CC} -I. -c -S ${COPTS} ../dev/flp.c ${C2} flp.s | sed -f ../sys/asm.sed | ${AS} -o flp.o rm -f flp.s hp.o: ../dev/hp.c ${CC} -I. -c -S ${COPTS} ../dev/hp.c ${C2} -i hp.s | sed -f ../sys/asm.sed | ${AS} -o hp.o rm -f hp.s ht.o: ../dev/ht.c ${CC} -I. -c -S ${COPTS} ../dev/ht.c ${C2} -i ht.s | sed -f ../sys/asm.sed | ${AS} -o ht.o rm -f ht.s lp.o: ../dev/lp.c ${CC} -I. -c -S ${COPTS} ../dev/lp.c ${C2} -i lp.s | sed -f ../sys/asm.sed | ${AS} -o lp.o rm -f lp.s mba.o: ../dev/mba.c ${CC} -I. -c -S ${COPTS} ../dev/mba.c ${C2} -i mba.s | sed -f ../sys/asm.sed | ${AS} -o mba.o rm -f mba.s mem.o: ../dev/mem.c ${CC} -I. -c -S ${COPTS} ../dev/mem.c ${C2} mem.s | sed -f ../sys/asm.sed | ${AS} -o mem.o rm -f mem.s mx1.o: ../dev/mx1.c ${CC} -I. -c -S ${COPTS} ../dev/mx1.c ${C2} mx1.s | sed -f ../sys/asm.sed | ${AS} -o mx1.o rm -f mx1.s mx2.o: ../dev/mx2.c ${CC} -I. -c -S ${COPTS} ../dev/mx2.c ${C2} mx2.s | sed -f ../sys/asm.sed | ${AS} -o mx2.o rm -f mx2.s mt.o: ../dev/mt.c ${CC} -I. -c -S ${COPTS} ../dev/mt.c ${C2} -i mt.s | sed -f ../sys/asm.sed | ${AS} -o mt.o rm -f mt.s rk.o: ../dev/rk.c ${CC} -I. -c -S ${COPTS} ../dev/rk.c ${C2} -i rk.s | sed -f ../sys/asm.sed | ${AS} -o rk.o rm -f rk.s sw.o: ../dev/sw.c ${CC} -I. -c -S ${COPTS} ../dev/sw.c ${C2} sw.s | sed -f ../sys/asm.sed | ${AS} -o sw.o rm -f sw.s tm.o: ../dev/tm.c ${CC} -I. -c -S ${COPTS} ../dev/tm.c ${C2} -i tm.s | sed -f ../sys/asm.sed | ${AS} -o tm.o rm -f tm.s ts.o: ../dev/ts.c ${CC} -I. -c -S ${COPTS} ../dev/ts.c ${C2} -i ts.s | sed -f ../sys/asm.sed | ${AS} -o ts.o rm -f ts.s tty.o: ../dev/tty.c ${CC} -I. -c -S ${COPTS} ../dev/tty.c ${C2} tty.s | sed -f ../sys/asm.sed | ${AS} -o tty.o rm -f tty.s ttynew.o: ../dev/ttynew.c ${C((C} -I. -c -S ${COPTS} ../dev/ttynew.c ${C2} ttynew.s | sed -f ../sys/asm.sed | ${AS} -o ttynew.o rm -f ttynew.s ttyold.o: ../dev/ttyold.c ${CC} -I. -c -S ${COPTS} ../dev/ttyold.c ${C2} ttyold.s | sed -f ../sys/asm.sed | ${AS} -o ttyold.o rm -f ttyold.s tu.o: ../dev/tu.c ${CC} -I. -c -S ${COPTS} ../dev/tu.c ${C2} tu.s | sed -f ../sys/asm.sed | ${AS} -o tu.o rm -f tu.s uba.o: ../dev/uba.c ${CC} -I. -c -S ${COPTS} ../dev/uba.c ${C2} -i uba.s | sed -f ../sys/asm.sed | ${AS} -o uba.o rm -f uba.s uda.o: ../dev/uda.c ${CC} -I. -c -S ${COPTS} ../dev/uda.c ${C2} -i uda.s | sed -f ../sys/asm.sed | ${AS} -o uda.o rm -f uda.s up.o: ../dev/up.c ${CC} -I. -c -S ${COPTS} ../dev/up.c ${C2} -i up.s | sed -f ../sys/asm.sed | ${AS} -o up.o rm -f up.s vaxcpu.o: ../dev/vaxcpu.c ${CC} -I. -c -S ${COPTS} ../dev/vaxcpu.c ${C2} vaxcpu.s | sed -f ../sys/asm.sed | ${AS} -o vaxcpu.o rm -f vaxcpu.s # DO NOT DELETE THIS LINE -- make depend uses it acct.o: ../h/param.h ../h/systm.h ../h/acct.h ../h/dir.h ../h/user.h acct.o: ../h/inode.h ../h/proc.h ../h/seg.h alloc.o: ../h/param.h ../h/systm.h ../h/mount.h ../h/filsys.h ../h/fblk.h alloc.o: ../h/conf.h ../h/buf.h ../h/inode.h ../h/ino.h ../h/dir.h ../h/user.h calloc.o: ../h/param.h ../h/dir.h ../h/user.h ../h/proc.h ../h/vm.h ../h/pte.h calloc.o: ../h/cmap.h clock.o: ../h/param.h ../h/systm.h ../h/dk.h ../h/callout.h ../h/seg.h clock.o: ../h/dir.h ../h/user.h ../h/proc.h ../h/reg.h ../h/psl.h ../h/vm.h clock.o: ../h/buf.h ../h/text.h ../h/vlimit.h ../h/mtpr.h ../h/clock.h clock.o: ../h/cpu.h bk.h dh.h dz.h fio.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/filsys.h fio.o: ../h/file.h ../h/conf.h ../h/inode.h ../h/reg.h ../h/acct.h ../h/mount.h iget.o: ../h/param.h ../h/systm.h ../h/mount.h ../h/dir.h ../h/user.h iget.o: ../h/inode.h ../h/ino.h ../h/filsys.h ../h/conf.h ../h/buf.h iget.o: ../h/inline.h ioctl.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/tty.h ioctl.o: ../h/proc.h ../h/inode.h ../h/file.h ../h/conf.h machdep.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/map.h machdep.o: ../h/reg.h ../h/mtpr.h ../h/clock.h ../h/pte.h ../h/vm.h ../h/proc.h machdep.o: ../h/psl.h ../h/buf.h ../h/ubavar.h ../h/ubareg.h ../h/cons.h machdep.o: ../h/reboot.h ../h/conf.h ../h/mem.h ../h/cpu.h ../h/inode.h machdep.o: ../h/file.h ../h/text.h ../h/clist.h ../h/callout.h ../h/cmap.h machdep.o: ../h/rpb.h main.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/filsys.h main.o: ../h/mount.h ../h/map.h ../h/proc.h ../h/inode.h ../h/seg.h ../h/conf.h main.o: ../h/buf.h ../h/mtpr.h ../h/pte.h ../h/clock.h ../h/vm.h ../h/cmap.h main.o: ../h/text.h ../h/vlimit.h ../h/clist.h nami.o: ../h/param.h ../h/systm.h ../h/inode.h ../h/mount.h ../h/dir.h nami.o: ../h/user.h ../h/buf.h ../h/conf.h pipe.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/inode.h pipe.o: ../h/file.h ../h/reg.h ../h/inline.h ../h/proc.h prf.o: ../h/param.h ../h/systm.h ../h/seg.h ../h/buf.h ../h/conf.h ../h/mtpr.h prf.o: ../h/reboot.h ../h/vm.h ../h/msgbuf.h ../h/dir.h ../h/user.h ../h/tty.h prim.o: ../h/param.h ../h/systm.h ../h/conf.h ../h/buf.h ../h/tty.h prim.o: ../h/clist.h rdwri.o: ../h/param.h ../h/systm.h ../h/inode.h ../h/dir.h ../h/user.h rdwri.o: ../h/buf.h ../h/conf.h ../h/cmap.h ../h/vlimit.h ../h/proc.h rmap.o: ../h/param.h ../h/systm.h ../h/map.h ../h/dir.h ../h/user.h ../h/proc.h rmap.o: ../h/mtpr.h ../h/text.h sig.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/proc.h sig.o: ../h/inode.h ../h/reg.h ../h/text.h ../h/seg.h ../h/mtpr.h ../h/pte.h sig.o: ../h/psl.h ../h/vm.h ../h/buf.h ../h/vlimit.h slp.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/proc.h ../h/file.h slp.o: ../h/inode.h ../h/vm.h ../h/pte.h ../h/inline.h ../h/mtpr.h subr.o: ../h/param.h ../h/systm.h ../h/conf.h ../h/inode.h ../h/dir.h subr.o: ../h/user.h ../h/buf.h ../h/proc.h ct.h sys.o: ../h/param.h ../h/systm.h ../h/conf.h ../h/dir.h ../h/user.h ../h/tty.h sys.o: ../h/proc.h sys1.o: ../h/param.h ../h/systm.h ../h/map.h ../h/mtpr.h ../h/dir.h ../h/user.h sys1.o: ../h/proc.h ../h/buf.h ../h/reg.h ../h/inode.h ../h/seg.h ../h/acct.h sys1.o: /usr/include/wait.h ../h/pte.h ../h/vm.h ../h/text.h ../h/psl.h sys1.o: ../h/vlimit.h ../h/file.h sys2.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/reg.h ../h/file.h sys2.o: ../h/inode.h ../h/pte.h ../h/vm.h ../h/buf.h ../h/mtpr.h ../h/proc.h sys2.o: ../h/inline.h sys3.o: ../h/param.h ../h/systm.h ../h/mount.h ../h/ino.h ../h/reg.h ../h/buf.h sys3.o: ../h/filsys.h ../h/dir.h ../h/user.h ../h/inode.h ../h/file.h sys3.o: ../h/conf.h ../h/stat.h ../h/inline.h sys4.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/reg.h sys4.o: ../h/inode.h ../h/proc.h ../h/clock.h ../h/mtpr.h ../h/timeb.h sys4.o: ../h/times.h ../h/reboot.h sysent.o: ../h/param.h ../h/systm.h ../h/vmsysent.h ../sys/vmsysent.c text.o: ../h/param.h ../h/systm.h ../h/map.h ../h/dir.h ../h/user.h ../h/proc.h text.o: ../h/text.h ../h/inode.h ../h/buf.h ../h/seg.h ../h/pte.h ../h/mtpr.h text.o: ../h/vm.h ../h/cmap.h trap.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/proc.h ../h/reg.h trap.o: ../h/seg.h ../h/trap.h ../h/psl.h ../h/pte.h ../h/inline.h ../h/mtpr.h vmdrum.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/proc.h vmdrum.o: ../h/buf.h ../h/text.h ../h/map.h ../h/pte.h ../h/vm.h ../h/cmap.h vmmem.o: ../h/param.h ../h/systm.h ../h/pte.h ../h/cmap.h ../h/dir.h vmmem.o: ../h/user.h ../h/proc.h ../h/mtpr.h ../h/text.h ../h/vm.h ../h/file.h vmmem.o: ../h/inode.h ../h/buf.h ../h/mount.h ../h/trace.h ../h/map.h vmmon.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/vmmeter.h vmmon.o: ../h/trace.h ../h/mtpr.h vmpage.o: ../h/param.h ../h/systm.h ../h/inode.h ../h/dir.h ../h/user.h vmpage.o: ../h/proc.h ../h/reg.h ../h/pte.h ../h/buf.h ../h/text.h ../h/mtpr.h vmpage.o: ../h/cmap.h ../h/vm.h ../h/file.h ../h/trace.h vmproc.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/proc.h vmproc.o: ../h/mtpr.h ../h/pte.h ../h/map.h ../h/cmap.h ../h/text.h ../h/vm.h vmpt.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/proc.h ../h/map.h vmpt.o: ../h/mtpr.h ../h/pte.h ../h/cmap.h ../h/vm.h ../h/buf.h ../h/text.h vmpt.o: ../h/mount.h ../h/inode.h vmsched.o: ../h/param.h ../h/systm.h ../h/seg.h ../h/dir.h ../h/user.h vmsched.o: ../h/proc.h ../h/text.h ../h/vm.h ../h/cmap.h vmsubr.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/vm.h vmsubr.o: ../h/proc.h ../h/mtpr.h ../h/pte.h ../h/cmap.h ../h/inode.h vmsubr.o: ../h/buf.h ../h/text.h vmswap.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/proc.h vmswap.o: ../h/text.h ../h/map.h ../h/buf.h ../h/pte.h ../h/mtpr.h ../h/cmap.h vmswap.o: ../h/vm.h vmsys.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/proc.h vmsys.o: ../h/reg.h ../h/file.h ../h/inode.h ../h/vm.h ../h/buf.h ../h/pte.h vmsys.o: ../h/cmap.h ../h/tty.h ../h/mtpr.h ../h/vlimit.h ../h/trace.h autoconf.o: mba.h ../h/param.h ../h/systm.h ../h/map.h ../h/nexus.h ../h/pte.h autoconf.o: ../h/buf.h ../h/mbareg.h ../h/mbavar.h ../h/dk.h ../h/vm.h autoconf.o: ../h/ubareg.h ../h/ubavar.h ../h/mtpr.h ../h/cpu.h ../h/scb.h autoconf.o: ../h/mem.h bio.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/buf.h ../h/conf.h bio.o: ../h/proc.h ../h/seg.h ../h/pte.h ../h/vm.h ../h/trace.h conf.o: ../h/param.h ../h/systm.h ../h/buf.h ../h/tty.h ../h/conf.h ../h/text.h conf.o: ../h/dir.h ../h/user.h ../h/proc.h ../h/file.h ../h/inode.h ../h/acct.h conf.o: ../h/pte.h hp.h tu.h rk.h te.h ts.h mu.h ra.h up.h tj.h ct.h dh.h dz.h conf.o: lp.h va.h vp.h pty.h dn.h bk.h cons.o: ../h/param.h ../h/conf.h ../h/dir.h ../h/user.h ../h/tty.h ../h/systm.h cons.o: ../h/cons.h ../h/mtpr.h ../h/mx.h ../h/cpu.h dh.o: dh.h bk.h ../h/param.h ../h/conf.h ../h/dir.h ../h/user.h ../h/tty.h dh.o: ../h/map.h ../h/pte.h ../h/buf.h ../h/vm.h ../h/ubareg.h ../h/ubavar.h dh.o: ../h/bk.h ../h/clist.h ../h/mx.h ../h/file.h dkbad.o: ../h/param.h ../h/buf.h ../h/dkbad.h dkleave.o: ../h/param.h ../h/buf.h dn.o: dn.h ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/buf.h dn.o: ../h/map.h ../h/pte.h ../h/ubavar.h ../h/conf.h ../h/ioctl.h dsort.o: ../h/param.h ../h/systm.h ../h/buf.h dz.o: dz.h bk.h ../h/param.h ../h/systm.h ../h/tty.h ../h/dir.h ../h/user.h dz.o: ../h/map.h ../h/pte.h ../h/buf.h ../h/vm.h ../h/ubavar.h ../h/conf.h dz.o: ../h/pdma.h ../h/bk.h ../h/file.h ../h/mx.h flp.o: ../h/flp.h ../h/param.h ../h/systm.h ../h/conf.h ../h/dir.h ../h/user.h flp.o: ../h/mtpr.h ../h/buf.h ../h/cons.h ../h/cpu.h hp.o: hp.h ../h/param.h ../h/systm.h ../h/dk.h ../h/buf.h ../h/conf.h hp.o: ../h/dir.h ../h/user.h ../h/map.h ../h/pte.h ../h/mbareg.h ../h/mbavar.h hp.o: ../h/mtpr.h ../h/vm.h ../h/cmap.h ../h/dkbad.h ../h/hpreg.h ht.o: tu.h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h ht.o: ../h/file.h ../h/user.h ../h/map.h ../h/pte.h ../h/mbareg.h ../h/mbavar.h ht.o: ../h/mtio.h ../h/ioctl.h ../h/cmap.h ../h/cpu.h ../h/htreg.h lp.o: lp.h ../h/param.h ../h/dir.h ../h/user.h ../h/buf.h ../h/systm.h lp.o: ../h/map.h ../h/pte.h ../h/ubavar.h ../h/ioctl.h ../h/tty.h mba.o: mba.h ../h/param.h ../h/systm.h ../h/dk.h ../h/buf.h ../h/conf.h mba.o: ../h/dir.h ../h/user.h ../h/proc.h ../h/map.h ../h/pte.h ../h/mbareg.h mba.o: ../h/mbavar.h ../h/mtpr.h ../h/vm.h mem.o: ../h/param.h ../h/dir.h ../h/user.h ../h/conf.h ../h/buf.h ../h/systm.h mem.o: ../h/pte.h ../h/mtpr.h ../h/vm.h ../h/cmap.h mx1.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/reg.h ../h/proc.h mx1.o: ../h/tty.h ../h/inode.h ../h/mx.h ../h/file.h ../h/conf.h mx2.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/proc.h ../h/tty.h mx2.o: ../h/inode.h ../h/mx.h ../h/file.h ../h/conf.h ../h/buf.h mt.o: mu.h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h mt.o: ../h/file.h ../h/user.h ../h/map.h ../h/pte.h ../h/mbareg.h ../h/mbavar.h mt.o: ../h/mtio.h ../h/ioctl.h ../h/cmap.h ../h/cpu.h ../h/mtreg.h rk.o: rk.h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h rk.o: ../h/user.h ../h/pte.h ../h/map.h ../h/vm.h ../h/ubareg.h ../h/ubavar.h rk.o: ../h/dk.h ../h/cpu.h ../h/cmap.h ../h/dkbad.h ../h/rkreg.h sw.o: ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h ../h/user.h sw.o: ../h/inode.h ((../h/map.h tm.o: te.h ts.h ../h/param.h ../h/systm.h ../h/buf.h ../h/dir.h ../h/conf.h tm.o: ../h/user.h ../h/file.h ../h/map.h ../h/pte.h ../h/vm.h ../h/ubareg.h tm.o: ../h/ubavar.h ../h/mtio.h ../h/ioctl.h ../h/cmap.h ../h/cpu.h tm.o: ../h/tmreg.h ts.o: ts.h ../h/param.h ../h/systm.h ../h/buf.h ../h/dir.h ../h/conf.h ts.o: ../h/user.h ../h/file.h ../h/map.h ../h/pte.h ../h/vm.h ../h/ubareg.h ts.o: ../h/ubavar.h ../h/mtio.h ../h/ioctl.h ../h/cmap.h ../h/cpu.h ts.o: ../h/tsreg.h tty.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/tty.h ../h/proc.h tty.o: ../h/mx.h ../h/inode.h ../h/file.h ../h/reg.h ../h/conf.h ../h/buf.h tty.o: ../h/dk.h ttynew.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/tty.h ttynew.o: ../h/proc.h ../h/mx.h ../h/inode.h ../h/file.h ../h/reg.h ../h/conf.h ttynew.o: ../h/buf.h ../h/dk.h ttyold.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/tty.h ttyold.o: ../h/proc.h ../h/mx.h ../h/inode.h ../h/file.h ../h/reg.h ../h/conf.h ttyold.o: ../h/buf.h ../h/dk.h tu.o: ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h ../h/user.h tu.o: ../h/mtpr.h ../h/cpu.h uba.o: ../h/param.h ../h/systm.h ../h/cpu.h ../h/map.h ../h/pte.h ../h/buf.h uba.o: ../h/vm.h ../h/ubareg.h ../h/ubavar.h ../h/dir.h ../h/user.h ../h/proc.h uba.o: ../h/conf.h ../h/mtpr.h ../h/nexus.h ../h/dk.h uda.o: ra.h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h uda.o: ../h/user.h ../h/pte.h ../h/map.h ../h/vm.h ../h/ubareg.h ../h/ubavar.h uda.o: ../h/dk.h ../h/cpu.h ../h/cmap.h ../h/udareg.h ../h/mscp.h up.o: up.h ../h/param.h ../h/systm.h ../h/cpu.h ../h/nexus.h ../h/dk.h up.o: ../h/buf.h ../h/conf.h ../h/dir.h ../h/user.h ../h/map.h ../h/pte.h up.o: ../h/mtpr.h ../h/vm.h ../h/ubavar.h ../h/ubareg.h ../h/cmap.h up.o: ../h/upreg.h vaxcpu.o: ../h/param.h ../h/pte.h ../h/ubareg.h ../h/nexus.h ../h/cpu.h @iP kk rm u/,2iTT (`(ЬY @iЏXXiZ ZZPЬ[2PxPPP@Z2PxPPď`P@YXЫjY NZ`YX2P3@sme_P PPZZ ZPŏ`ZP@[ZPPP4G$ԫ(<<H[FFGȫ:ZZEP<)<[鳏<еdZP[2~AP(PP` ^ZxZŏ`ZP@X[[AP(PP`ZPxPP5QЭRBaSPSSBaл4PBa< Z[Pď`P@[[AP(PP`Pď`P@[[AP(P P`^ԭxPPPPPxWWPYŏ`WPPPX1[a1ZPď`PXP[ŏ`PP[Pv< Z :ZTZZխݬt Z(2:Pʏ?PP)2:Pʏ?PP@[ZAP(PP`2Z1YZxZYŏ`ZP@[ݬ ݬ[AP(PP`PPݬݬ ݬ[gPѬ t Ѭ t ZpЬPPxt_R<ZPxPPIQPQQI л4PIZPxPPIQPQZXЬ[ŏ`[P@Z[PY`Pix[PxPPPF [ FP@PxPP[QQPPX P :XȏPX:XF XXЬ[PPYЫ4Z <<<ë~[~A[AP(P P` [/ի <28PPPxPPjQRPRRYPڎ^Ь[Ы4ZjYPP!<1@<@GPPPЫQ2@{PQP&@<ի,[~ݫ,\ [~OիF : PD[~1PX <ЫЪX28PPPxPPQPQQݭPڎݏ[~PX[~PXXPP~[<Ь[Ы4ZPPY <Ъ<~2>~PYPPX<[[1Kx~4}^ԭݭ[x[P@TYf2PP\W[PxPPP[Px[~"ŏ`[P@Z<![-[t i c c ] a { 3 @ V co xi X | ] # X #,39BHQZbhow!, 5 >HE(KxQXaks~,ttt( &/6@IRZdmv (,0T)3;XFKPX`iq vyD*| ,VJ $-39BHJO TYbluz_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_tthiwat_ttlowat_zdmap_zvmsU_ARGU_QSAV_swapmap_nswapmap_argmap_kernelmap_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_numuba_bdevsw_cdevsw_linesw_swdevt_file_fileNFILE_nfile_dzinfo_dzstd_dzdriver_dzprobe_dzattach_dz_tty_dz_cnt_dzact_dz_brk_dzsoftCAR_dz_timer_dzpdma_dz_speedsL172L179_dzxint_dzscan_timeout_dzopenL190_u_dzstart_ttychars_dzparam_dzmodem_sleep_dzcloseL207_ttyclose_dzreadL214_dzwriteL219_dzrintL223_wakeup_printf_dzioctlL242_ttioctlL259L268_ndflushL279_mcstart_ndqb_getc_ttrstrt_dzstopL296L302L308_gsignal_flushtty_dztimerL324_dzresetL332@iW k{KmV+2i ((@Ь[ЬZЫ Y Z ZԪ Ѫ$$>թ Щ PѠ$$(Щ PѪ$$ Щ Yթ Щ Z YZЩ Yթ Щ PѠ$$Щ PѪ$$Щ Y#,39BHQZbhow!,1:@GOW]h,q{_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_disksortL81@iZ kjUMADGJ,ڡڡ umask 77 for i do case $i in std) /etc/mknod console c 0 0 /etc/mknod drum c 7 0 ; chmod 644 drum /etc/mknod floppy c 8 0 /etc/mknod kUmem c 3 3 ;: no one has ever tried using this /etc/mknod kmem c 3 1 ; chmod 644 kmem /etc/mknod mem c 3 0 ; chmod 644 mem /etc/mknod null c 3 2 ; chmod 666 null /etc/mknod tty c 2 0 ; chmod 666 tty cp /dev/null mail ;: will be made by comsat ;; ht*|mt*|tm*|ts*) umask 0 ; unit=`expr $i : '..\(.*\)'` case $i in ht*) blk=1; chr=5 ;; mt*) blk=7; chr=19;; tm*) blk=5; chr=14;; ts*) blk=6; chr=16;; esac case $unit in 0|1|2|3|4|5|6|7) four=`expr $unit + 4` ; eight=`expr $unit + 8` twelve=`expr $unit + 12` /etc/mknod mt$unit b $blk $unit /etc/mknod mt$four b $blk $four /etc/mknod mt$eight b $blk $eight /etc/mknod mt$twelve b $blk $twelve /etc/mknod nmt$unit b $blk $four ;: sanity with pdp11 v7 /etc/mknod nmt$eight b $blk $twelve ;: ditto /etc/mknod nrmt$unit c $chr $four ;: sanity with pdp11 v7 /etc/mknod nrmt$eight c $chr $twelve ;: ditto /etc/mknod rmt$unit c $chr $unit /etc/mknod rmt$four c $chr $four /etc/mknod rmt$eight c $chr $eight /etc/mknod rmt$twelve c $chr $twelve umask 77 ;; *) bad unit for tape in: $1 ;; esac ;; hp*|hk*|ra*|up*) unit=`expr $i : '..\(.*\)'` case $i in hp*) name=hp; blk=0; chr=4;; hk*) name=hk; blk=3; chr=11;; ra*) name=ra; blk=9; chr=24;; up*) name=up; blk=2; chr=13;; esac case $unit in 0|1|2|3|4|5|6|7) /etc/mknod ${name}${unit}a b $blk `expr $unit '*' 8 + 0` /etc/mknod ${name}${unit}b b $blk `expr $unit '*' 8 + 1` /etc/mknod ${name}${unit}c b $blk `expr $unit '*' 8 + 2` /etc/mknod ${name}${unit}g b $blk `expr $unit '*' 8 + 6` /etc/mknod r${name}${unit}a c $chr `expr $unit '*' 8 + 0` /etc/mknod r${name}${unit}b c $chr `expr $unit '*' 8 + 1` /etc/mknod r${name}${unit}c c $chr `expr $unit '*' 8 + 2` /etc/mknod r${name}${unit}g c $chr `expr $unit '*' 8 + 6` if [ $name != hk ] then /etc/mknod ${name}${unit}d b $blk `expr $unit '*' 8 + 3` /etc/mknod ${name}${unit}e b $blk `expr $unit '*' 8 + 4` /etc/mknod ${name}${unit}f b $blk `expr $unit '*' 8 + 5` /etc/mknod ${name}${unit}h b $blk `expr $unit '*' 8 + 7` /etc/mknod r${name}${unit}d c $chr `expr $unit '*' 8 + 3` /etc/mknod r${name}${unit}e c $chr `expr $unit '*' 8 + 4` /etc/mknod r${name}${unit}f c $chr `expr $unit '*' 8 + 5` /etc/mknod r${name}${unit}h c $chr `expr $unit '*' 8 + 7` fi ;; *) echo bad unit for disk in: $i ;; esac ;; 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("/etc/mknod tty%02d c 1 %d; ",u*8+i,u*8+i); }'` ;; *) echo bad unit for dz in: $i ;; esac ;; dh*) unit=`expr $i : 'dh\(.*\)'` case $unit in 0) ch=h ;; 1) ch=i ;; 2) ch=j ;; 3) ch=k ;; 4) ch=l ;; 5) ch=m ;; 6) ch=n ;; 7) ch=o ;; *) echo bad unit for dh in: $i ;; esac case $ch in h|i|j|k|l|m|n|o) eval `echo $ch $unit | awk ' { ch = $1; u = 16 * $2 } END { for (i = 0; i < 16; i++) printf("/etc/mknod tty%s%x c 12 %d; ",ch,i,u+i); }'` ;; esac ;; dn|dn0) /etc/mknod cua0 c 22 0 ; chmod 222 cua0 ;; lp0) /etc/mknod lp c 15 0 ; chmod 666 lp ;; va|va0) /etc/mknod va0 c 10 0 ; chmod 666 va0 ;; vp|vp0) /etc/mknod vp0 c 6 0 ; chmod 666 vp0 ;; NOTICE) echo THE REST OF THE ENTRIES ARE SYSTEM DEPENDENT ;; LOCAL) : RV cp /dev/null cua0 ; : cua0 will be made mpx by dnd cp /dev/null cua1 ; : cua1 will be made mpx by dnd mv tty8 cul0 ; chmod 666 cul0 mv tty9 cul1 ; chmod 666 cul1 ln cul0 ttya0 ln cul1 ttya1 mv tty10 ttya2 : DIALUPS mv tty11 ttyd0 mv tty12 ttyd1 mv tty13 ttyd2 mv tty14 ttyd3 mv tty15 ttyd4 mv tty16 ttyd5 mv tty17 ttyd6 mv tty18 ttyd7 mv tty19 ttyd8 mv tty20 ttyd9 mv tty21 ttyda : NETWORKS mv ttyi1 ttyny mv ttyi2 ttyni ;; *) echo dont know how to MAKE $i ;; esac done @i_ kX?)>lnWa7i /dev/ra0a:/:rw:1:1 /dev/ra0g:/usr:rw:1:2 @ia kWɴu  +2i ((\0(ЬYiXXi^PxPPPPЭP֭P[pPPXPdp[h2l[-p[ZԭZ~ݬPP""PPAPgP11xPDP`MPxPDP`P֭v#jDkD\DH?D@D1Dԭ!DDԭЭԭѭ1Oԭ8xPCP`P!xPCP`P֭ѭ! 7Qխ Џ[[^Ь[ЫTZxZPxPPpCP`PZQxQQQPxT~J1>ЭPˏXW2GPPXWGxcWJJP P@_YիXѫX ЫXP@ #ЫXP2@P2QQPPX^Ь[ЫTЫdxPxPPBP`PQxQQQPcPЭQA`P P@ЭPӏ@ ЭP2$ЭPЭQ2PPQЭP2PPQRPRRQЭPЭQ2aQQPЭQ2aQQPRQRRPЭPЭ(xPPЭQPݬ[XЭPӏӏ@@ЭPˏ~ЭPˏ~ݭݭݭ[PЫlP^Ь[xTPxPP[AP`PˏTQxQQQPYԭЭPˏQ2@PPQ֭ЭP@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0^nhpuphkraxx(0,0)vmunix Boot : : %s Bad format %d+%d+%d start 0x%x Short read null path %s not found bn negative bn ovf %D bn void %D bn void %D not a directory zero length directory Seek not from beginning of file No more file slotsBad device Unknown device Bad unit specifier Missing offset specification Can't write files yet.. Sorry Exit called%s Trap %o l%8 d  o%Z r%x u% x%P| >{%t~%D.%8h&hpuphkrahttmtsmt`       @ ` `&vd62M2R%s1 JTJ2" 7 & `7&/%/,&%2 @v<&unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRC@ip k%- V25e@i@i@iINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry Anot a tape mt hard error: er=%b mt error: er=%b mt: unrecovered error mt: recovered by retry rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry Pte error: er=%bILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOTts: unrecovered error ts: recovered by retry DR2 `7`+ @7p+up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPEh >Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error 0123456789abcdef@is k<[C5 )2i Ь[Ь ZЬXYhxYPP`QQhXYZݬЬ[ЬZЬ YȏZ:ڮn^ZYY Ь[ЬZx0PXPZPëXZ~p2.PxPPxPPXP$Px8QQPZP#x0PXPZPx0PXPPZPP0PЏP PPP2.QxQQxQQXQ$QZQQQP Ь[ЬZZ0 xZPXPZ0Zx0PXPë0ZQxQQQP2.PxPPxPPXP$PЏQ QQQZQxQQQP^Ь[Ь Z1kkkZ ЬP@PPPkkPkk"Ѭ ЬP@HX[P`HkX[֬1Ѭ 1y9ڮn^ݬZP PǏPQxQQQPݬíPPP~PYYPPYխ1ЭPxQQWkkkkP*kѬ &ЬP@xkkX[P`HkX[Yݭ$)Ygkkk kPP [Yլ19ڮn^ ^Ь[Ѭ  [Pԭ xѬ ­׭խխí P@խݭ2~jPAPX֭έPxPPPZЭPxZQQP`ݭ(խ1aѭЭP^ ЬP PPɏP:ڮn^ P@[ޭP`:ڮn^[P^ЬP PPɏP:ڮn^ P@vޭP`ke:ڮn^Ь[ [ʏxkȏxkլ~:ڮn^vbmap5e - - - j Al - - j - m - 29o p m m s s  & 2s 8 Qs hs n  s  #,39BHQZbhow!,H3(9x?FNW]((dktptvt{( ~&-1:@GNYbhpw, : j( -2: ?fHMPW]e jqxJ_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_pidhash_proc_procNPROC_nproc_qs_whichqs_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_inode_inodeNINODE_ninode_rootdir_mpxip_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_text_textNTEXT_ntext_uaccessL157_vmaccessL165_ptetovL173udiv_vtopteL179_vinifodL187_u_vbmap_imin_brelseL219_panic_bread_getmemcL241_mmap_putmemcL246_setredzoneL251@ix kyWy =&iTP6i /* * Prototype toggle in bootstrap code for mt type tapes. * If on anything but a 780 with a tape at drive 0 of mba 1 * this will have to be repaired by patching mba and mt. */ movl mba,r10 mull3 mt,$0x80,r11 addl3 r11,r10,r11 addl2 $0x400,r11 movzbl $1,4(r10) movzbl $4,8(r11) /* drive zero, one record */ clrl 12(r10) /* set address to zero */ movl $0x80000000,0x800(r10) /* validate map register */ cvtwl $-512,16(r10) /* set byte count */ movzwl $512,20(r11) /* set byte count */ 0: movl 0x44(r11),r0 bbc $15,r0,0b movzbl $071,(r11) /* read forward, go */ halt .align 2 mba: .long 0x20012000 mt: .long 0 @iz kCMgm=&i   /* * VAX tape boot block for distribution tapes * works on massbus tu78 * * reads a program from a tp directory on a tape and executes it * program must be stripped of the header and is loaded ``bits as is'' * you can return to this loader via ``ret'' as you are called ``calls $0,ent'' */ .set RELOC,0x70000 /* a.out defines */ .set HDRSIZ,040 /* size of file header for VAX */ .set MAGIC,0410 /* file type id in header */ .set TSIZ,4 /* text size */ .set DSIZ,8 /* data size */ .set BSIZ,12 /* bss size */ .set TENT,024 /* task header entry loc */ /* tp directory definitions */ .set FILSIZ,38 /* tp direc offset for file size */ .set BNUM,44 /* tp dir offset for start block no. */ .set ENTSIZ,64 /* size of 1 TP dir entry, bytes */ .set PTHSIZ,32 /* size of TP path name, bytes */ .set BLKSIZ,512 /* tape block size, bytes */ .set NUMDIR,24 /* no. of dir blocks on tape */ .set ENTBLK,8 /* no. of dir entries per tape block */ /* processor registers and bits */ .set RXCS,32 .set RXDB,33 .set TXCS,34 .set TXDB,35 .set RXCS_DONE,0x80 .set TXCS_RDY,0x80 .set TXCS_pr,7 /* bit position of TXCS ready bit */ .set RXCS_pd,7 /* bit position of RXCS done bit */ /* MBA registers */ .set MBA_CSR,0 /* configuration and status register */ .set MBA_CR,4 /* MBA control reg */ .set MBA_SR,8 /* MBA status reg */ .set MBA_VAR,12 /* MBA virt addr reg */ .set MBA_BCR,16 /* MBA byte count reg */ .set MBA_MAP,0x800 /* start of MBA map reg's */ .set MRV,0x80000000 .set MBA_pdtc,13 /* position of data transfer complete bit */ /* TU78 mba registers */ .set MTCS,0 /* MT control reg */ .set MTER,4 /* error reg */ .set MTCA,8 /* command address */ .set MTAS,16 /* attention summary */ .set MTBC,20 /* byte count */ .set MTNER,44 /* non-data transfer error register */ .set MTNCS,48 /* non-data transfer command register */ .set MTID,68 /* MT internal data */ /* MT commands */ .set GO,1 /* GO bit */ .set MT_REW,6 /* rewind, on-line */ .set MT_SREV,022 /* space reverse */ .set MT_RCOM,070 /* read forward */ /* MT bits */ .set CCLR,040000 /* controller clear */ .set MT_pr,15 /* bit position of MT TMRDY bit */ /* local stack variables */ .set tapa,-4 /* desired tape addr */ .set mtapa,-8 /* current tape addr */ .set name,-8-PTHSIZ /* operator-typed file name */ /* register usage */ .set rMBA,r10 .set rMT,r11 /* initialization */ init: mull2 $0x80,%rMT addl2 $0x400,%rMT addl2 %rMBA,%rMT movl $RELOC,fp /* core loc to which to move this program */ addl3 $name,fp,sp /* set stack pointer, leaving room for locals */ clrl r0 1: movc3 $end,(r0),(fp) /* move boot up to relocated position */ jmp start+RELOC start: movl $1,MBA_CR(%rMBA) /* MBA init */ movl $CCLR,MTID(%rMT) /* controller clear */ movl $250,r0 0: sobgtr r0,0b 0: movl MTID(%rMT),r0 /* wait for ready */ bbc $MT_pr,r0,0b bsbw rew /* rewind input tape */ movab name(fp),r4 /* start of filename storage */ movzbl $'=,r0 /* prompt character */ bsbw putc /* output char to main console */ /* read in a file name */ movl r4,r1 /* loc at which to store file name */ nxtc: bsbw getc /* get input char's in file name */ cmpb r0,$012 /* terminator ? */ beql nullc movb r0,(r1)+ brb nxtc nullc: subl3 r4,r1,r9 /* size of path name */ beql start /* dumb operator */ clrb (r1)+ incl r9 /* user-specified TP filename has been stored at name(fp) */ /* read in entire tp directory contents into low core */ dirred: movl $8,tapa(fp) /* tp directory starts at block 8 */ movl $(NUMDIR*BLKSIZ),r6 /* no. bytes in total dir */ bsbw taper /* read no. bytes indicated */ /* search entire directory for user-specified file name */ clrl r5 /* dir buff loc = 0 */ nxtdir: cmpc3 r9,(r5),(r4) /* see if dir entry matches filename */ beql fndfil /* found match */ acbl $NUMDIR*BLKSIZ-1,$ENTSIZ,r5,nxtdir /* see if done with tp dir */ brw start /* entry not in directory; start over */ /* found desired tp dir entry */ fndfil: movzwl BNUM(r5),tapa(fp) /* start block no., 2 bytes */ addl2 $7,tapa(fp) /* skip 7 boot blocks */ movzwl FILSIZ(r5),r6 /* low 2 bytes file size */ insv FILSIZ-1(r5),$16,$8,r6 /* file size, high byte */ cmpl r6,$RELOC-512 /* check if file fits below stack */ blss filok /* file o.k. */ brw start /* file too large */ /* time to read in desired file from tape */ filok: movl r6,r7 /* save r6 */ bsbb taper bsbw rew /* clear core */ subl3 r7,$RELOC-4,r0 /* no. bytes to clear */ 1: clrb (r7)+ sobgtr r0,1b /* time to jump to start of file & execute */ addl3 $20,fp,ap clrl r5 calls $0,(r5) brw start /* taper: movcTAPE (r6),tapa(fp),0 */ rew2: bsbb rew /* beginning of tape */ taper0: bsbb rrec /* advance 1 block; never want blk0 */ taper: clrl r0 /* page no. */ cmpl mtapa(fp),tapa(fp) /* current position .vs. desired */ bgtr rew2 blss taper0 1: bsbb rrec acbl $1,$-BLKSIZ,r6,1b rsb /* rew: rewind the tape */ rew: clrl mtapa(fp) /* current position */ clrl MTNER(%rMT) /* clear error */ movl $MT_REW+GO,MTNCS(%rMT) /* rewind */ 1: movl MTNER(%rMT),r2 /* done? */ movl MTAS(%rMT((),MTAS(%rMT) bicl2 $~077,r2 cmpl $1,r2 bneq 1b rsb /* rrec: read 1 block from mag tape into page (r0) */ rrec: /* pushl r0; movzbl $'r,r0; bsbw putc; movl (sp)+,r0; */ rrec2: movl $-BLKSIZ,MBA_BCR(%rMBA) movl $BLKSIZ,MTBC(%rMT) bisl3 $MRV,r0,MBA_MAP(%rMBA) clrl MBA_VAR(%rMBA) clrl MTER(%rMT) movl MBA_SR(%rMBA),MBA_SR(%rMBA) movzbl $4,MTCA(%rMT) /* drive zero, one record */ movl $MT_RCOM+GO,MTCS(%rMT) /* read forward */ 1: movl MTER(%rMT),r2 bicl2 $~077,r2 beql 1b movl $1000,r1 0: sobgtr r1,0b cmpl $1,r2 /* any read errors ? */ beql 2f pushl r0; movzbl $'b,r0; bsbw putc; movl (sp)+,r0; brb rrec2 2: incl r0 /* next page no. */ incl mtapa(fp) /* mag tape block position */ rsb getc: mfpr $RXCS,r0 bbc $RXCS_pd,r0,getc /* receiver ready ? */ mfpr $RXDB,r0 extzv $0,$7,r0,r0 cmpb r0,$015 bneq putc bsbb putc movb $0,r0 bsbb putc movb $012,r0 putc: mfpr $TXCS,r2 bbc $TXCS_pr,r2,putc /* transmitter ready ? */ extzv $0,$7,r0,r0 mtpr r0,$TXDB rsb end: @i k#A J W*2ikk  X Z[ZЪ[ Z[?ݬ2~P[k[Pk2[2PPPPPPP`_[  [ݬ2~BP?ݬ2~P[k*k2[2PPPPPPP`լ `ݬ 2~PNݬ 2~LPZj Z.ȏj2Z2PPPPPPP`[ݬ2~[4[P Ь[kZʏk2 Z^[2PPPPPPP`Z[[q Zk  [  Ь[ k2PPPPPPZ Z [ȏk[Ь[k[?Ь[k [k kkPPYӏkZЪ P[Ъ [ Z6k yZk ZZЪP[ Ъ[Z ʏkYPڎxY2PYP?PQ?QQPQ QAZЪ[ѫ YkPЫ[[ZPݬ2~Pݬ2~P^xXѬЏxX2PXP?PQ?QQPQ QAZk[{PЪ[Uѫ XKDk@PkPPPЫPЫ Ы PЫkݭPڎk[PЫ[[Z2PPPPPP P?Y ѩ Y ,YYY iY1<PЩ [PPЫPЫ Ы PЫkݭPڎ kk[1kЫPЫЫPЫЪZЪP[[X 1 ^jZ,PxZ Ѫ Z ,ZZZPЪ [PPЫPЫ Ы PЫkݭPڎ kk[ ЏkЫPЫЫPЫЪZЪP[[[PЬ[P [mkP[ Ь[k Ak k1k &PPZ [P,PPPP2`[P,PxPPP`$ǏPP[~ZPڎk [ k[ ЬPР[2ZԋZЬPԠ$^PRIBH@[Ы 7PPɬPkӏ`k2ѬP PPP P PPPЬ( 1[P,PPPxPPPQxQQ8PxQQPYЬ P P~ݬPXZ+hPh oYPYh`XZZx 1Ь 1ݬݏ5PZZЬ  3[P,PxPP PЬ `[P,PPPP`[2PPPPPPP` Z vP [kPZkk(ӏլ :tݬpZZP PPPլ1PʏX8kD [;(( ~P^ЬP2(~լ ݭݭЬP2(~ ݬЬP  ^DNkPPЫPЫ Ы PЫkݭPڎ[P7ZЪ [ kЫ [[Z,ZZP ^Ь[ѬPPPPPk[k(1k xt h[ЫZBP ZЫݭ[[P [BkݬZݭ/P k [PZZZk1NʏXkЫ$[ЬPѠ<Ь[k3yp ZЪ[kЫ[[Z ZZblkdevdup iodoneIO err in pushswap bad ptebig pushhard IO err in swappid %d: killed due to no swap space killed on swap error sorry, pid %d was %sT ,W2 aZ j~2 Z 2 &Z 8BfZ }2 Z 2 h "/ */ 1/ 8h a/ / / / T .oT m   n / (/ 1/ m / / / =m n n 1 + - + . A 0A 71 >0 J7 Rh hwh 0 0 m 0 0 0 C C /+ B7 nx n y + . + - '2 <Cn Wm n 0 0 0 0 0 h 7 h   | ) 3 ? | P W } c ~  / / Z  Z  $ Z < m I Z Q Z Y Z p Z x Z Z m Z h Z Z  Z  H Z Q Z Z T T #,39BHQZbhow!,H3(9x?FKTZaiqw,~t tt((1<ELV_hpz  6zp  J :  ).3;@GLQX_h mrz |  r    " V  !_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_pidhash_proc_procNPROC_nproc_qs_whichqs_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_bufhash_bhinitL140_breadL147_getblk_u_iowait_breadaL153_incore_brelse_bwriteL166_geterror_bdwriteL177_bawriteL185L189_wakeupL207_baddrL215L220_sleep_panic_geteblkL242L253_iodoneL260_clrbufL273_swapL281_vtopte_imin_swkillL311_printf_uprintf_psignal_bflushL325_physioL338_useracc_vslock_vsunlock_minphysL354L359_binvalL366@i k~è$M;&iSP6i ((/* uda.c 1.2 81/10/27 */ #include "ra.h" #if NUDA > 0 /* * UDA50/RAxx disk device driver * * Restrictions: * Unit numbers must be less than 8. * * TO DO: * write dump code * test on 750 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/buf.h" #include "../h/conf.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/pte.h" #include "../h/map.h" #include "../h/vm.h" #include "../h/ubareg.h" #include "../h/ubavar.h" #include "../h/dk.h" #include "../h/cpu.h" #include "../h/cmap.h" int udadebug; #define printd if(udadebug&1)printf /* * Parameters for the communications area */ #define NRSPL2 3 #define NCMDL2 3 #define NRSP (1<sc_ivec = (uba_hd[numuba].uh_lastiv -= 4); return(1); } udslave(ui, reg) struct uba_device *ui; caddr_t reg; { /* * TOO HARD TO FIND OUT IF DISK IS THERE UNTIL * INITIALIZED. WE'LL FIND OUT WHEN WE FIRST * TRY TO ACCESS IT. */ return(1); } udattach(ui) register struct uba_device *ui; { if (ui->ui_dk > 0) dk_mspw[ui->ui_dk] = 1.0 / (60 * 31 * 256); /* approx */ ui->ui_flags = 0; udip[ui->ui_ctlr][ui->ui_slave] = ui; radsize[ui->ui_unit] = (daddr_t)0xffffff; /* max possible size */ } /* * Open a UDA. Initialize the device and * set the unit online. */ udopen(dev, flag) dev_t dev; int flag; { register int unit; register struct uba_device *ui; register struct uda_softc *sc; unit = minor(dev) >> 3; if (unit >= NRA || (ui = uddinfo[unit]) == 0 || ui->ui_alive == 0) { u.u_error = ENXIO; return; } sc = &uda_softc[ui->ui_ctlr]; (void) spl5(); if (sc->sc_state != S_RUN) { if (sc->sc_state == S_IDLE) udinit(ui->ui_ctlr); sleep(ui->ui_mi, 0); /* wait for initialization to complete */ if (sc->sc_state != S_RUN) { u.u_error = EIO; return; } } (void) spl0(); /* SHOULD PROBABLY FORCE AN ONLINE ATTEMPT TO SEE IF DISK IS REALLY THERE */ } /* * Initialize a UDA. Set up UBA mapping registers, * initialize data structures, and start hardware * initialization sequence. */ udinit(d) int d; { register struct uda_softc *sc; register struct uda *ud; struct udadevice *udaddr; struct uba_ctlr *um; sc = &uda_softc[d]; um = udminfo[d]; um->um_tab.b_active++; ud = &uda[d]; udaddr = (struct udadevice *)um->um_addr; if (sc->sc_mapped == 0) { /* * Map the communications area and command * and response packets into Unibus address * space. */ sc->sc_ubainfo = uballoc(um->um_ubanum, (caddr_t)ud, sizeof (struct uda), 0); sc->sc_uda = (struct uda *)(sc->sc_ubainfo & 0x3ffff); sc->sc_mapped = 1; } /* * Start the hardware initialization sequence. */ udaddr->udaip = 0; /* start initialization */ while ((udaddr->udasa & UDA_STEP1) == 0) ; udaddr->udasa = UDA_ERR|(NCMDL2<<11)|(NRSPL2<<8)|UDA_IE|(sc->sc_ivec/4); /* * Initialization continues in interrupt routine. */ sc->sc_state = S_STEP1; sc->sc_credits = 0; } udstrategy(bp) register struct buf *bp; { register struct uba_device *ui; register struct uba_ctlr *um; register struct buf *dp; register int unit; int xunit = minor(bp->b_dev) & 07; daddr_t sz, maxsz; sz = (bp->b_bcount+511) >> 9; unit = dkunit(bp); if (unit >= NRA) goto bad; ui = uddinfo[unit]; um = ui->ui_mi; if (ui == 0 || ui->ui_alive == 0) goto bad; if ((maxsz = ra_sizes[xunit].nblocks) < 0) maxsz = radsize[unit] - ra_sizes[xunit].blkoff; if (bp->b_blkno < 0 || bp->b_blkno+sz > maxsz || ra_sizes[xunit].blkoff >= radsize[unit]) goto bad; (void) spl5(); /* * Link the buffer onto the drive queue */ dp = &udutab[ui->ui_unit]; if (dp->b_actf == 0) dp->b_actf = bp; else dp->b_actl->av_forw = bp; dp->b_actl = bp; bp->av_forw = 0; /* * Link the drive onto the controller queue */ if (dp->b_active == 0) { dp->b_forw = NULL; if (um->um_tab.b_actf == NULL) um->um_tab.b_actf = dp; else um->um_tab.b_actl->b_forw = dp; um->um_tab.b_actl = dp; dp->b_active = 1; } if (um->um_tab.b_active == 0) { #if defined(VAX750) if (cpu == VAX_750) { if (um->um_ubinfo != 0) printf("uda: ubinfo %x\n",um->um_ubinfo); else um->um_ubinfo = uballoc(um->um_ubanum, 0, 0, UBA_NEEDBDP); } #endif (void) udstart(um); } (void) spl0(); return; bad: bp->b_flags |= B_ERROR; iodone(bp); return; } udstart(um) register struct uba_ctlr *um; { register struct buf *bp, *dp; register struct mscp *mp; register struct uda_softc *sc; register struct uba_device *ui; struct udadevice *udaddr; int i; sc = &uda_softc[um->um_ctlr]; loop: if ((dp = um->um_tab.b_actf) == NULL) { /* * Release uneeded UBA resources and return */ um->um_tab.b_active = 0; #if defined(VAX750) if (cpu == VAX_750) { if (um->um_ubinfo == 0) printf("uda: um_ubinfo == 0\n"); else ubarelse(um->um_ubanum, &um->um_ubinfo); } #endif return(0); } if ((bp = dp->b_actf) == NULL) { /* * No more requests for this drive, remove * from controller queue and look at next drive. * We know we're at the head of the controller queue. */ dp->b_active = 0; um->um_tab.b_actf = dp->b_forw; goto loop; } um->um_tab.b_active++; udaddr = (struct udadevice *)um->um_addr; if ((udaddr->udasa&UDA_ERR) || sc->sc_state != S_RUN) { harderr(bp, "ra"); printf("udasa %o, state %d\n", udaddr->udasa&0xffff, sc->sc_state); udinit(um->um_ctlr); /* SHOULD REQUEUE OUTSTANDING REQUESTS, LIKE UDRESET */ return; } ui = uddinfo[dkunit(bp)]; /* * If no credits, can't issue any commands * until some outstanding commands complete. */ if (sc->sc_credits < 2) return(0); if ((mp = udgetcp(um)) == NULL) return(0); sc->sc_credits--; /* committed to issuing a command */ if (ui->ui_flags == 0) { /* not online */ mp->mscp_opcode = M_OP_ONLIN; mp->mscp_unit = ui->ui_slave; dp->b_active = 2; um->um_tab.b_actf = dp->b_forw; /* remove from controller q */ printd("uda: bring unit %d online\n", ui->ui_slave); *((long *)mp->mscp_dscptr) |= UDA_OWN|UDA_INT; i = udaddr->udaip; goto loop; } switch (cpu) { case VAX_780: i = UBA_NEEDBDP|UBA_CANTWAIT; break; case VAX_750: i = um->um_ubinfo|UBA_HAVEBDP|UBA_CANTWAIT; break; case VAX_7ZZ: i = UBA_CANTWAIT; break; } if ((i = ubasetup(um->um_ubanum, bp, i)) == 0) { mp->mscp_opcode = M_OP_GTUNT; mp->mscp_unit = ui->ui_slave; *((long *)mp->mscp_dscptr) |= UDA_OWN|UDA_INT; i = udaddr->udaip; /* initiate polling */ return(1); /* wait for interrupt */ } mp->mscp_cmdref = (long)bp; /* pointer to get back */ mp->mscp_opcode = bp->b_flags&B_READ ? M_OP_READ : M_OP_WRITE; mp->mscp_unit = ui->ui_slave; mp->mscp_lbn = bp->b_blkno + ra_sizes[minor(bp->b_dev)&7].blkoff; mp->mscp_bytecnt = bp->b_bcount; mp->mscp_buffer = (i & 0x3ffff) | (((i>>28)&0xf)<<24); #if defined(VAX750) if (cpu == VAX_750) i &= 0xfffffff; /* mask off bdp */ #endif bp->b_ubinfo = i; /* save mapping info */ *((long *)mp->mscp_dscptr) |= UDA_OWN|UDA_INT; i = udaddr->udaip; /* initiate polling */ if (ui->ui_dk >= 0) { dk_busy |= 1<ui_dk; dp->b_qsize++; dk_xfer[ui->ui_dk]++; dk_wds[ui->ui_dk] += bp->b_bcount>>6; } /* * Move drive to the end of the controller queue */ if (dp->b_forw != NULL) { um->um_tab.b_actf = dp->b_forw; um->um_tab.b_actl->b_forw = dp; um->um_tab.b_actl = dp; dp->b_forw = NULL; } /* * Move buffer to I/O wait queue */ dp->b_actf = bp->av_forw; dp = &udwtab[um->um_ctlr]; bp->av_forw = dp; bp->av_back = dp->av_back; dp->av_back->av_forw = bp; dp->av_back = bp; goto loop; } /* * UDA interrupt routine. */ udintr(d) int d; { register struct uba_ctlr *um = udminfo[d]; register struct udadevice *udaddr = (struct udadevice *)um->um_addr; struct buf *bp; register int i; register struct uda_softc *sc = &uda_softc[d]; register struct uda *ud = &uda[d]; struct uda *uud; struct mscp *mp; printd("udintr: state %d((@i k{¨$M;&iSP6i, udasa %o\n", sc->sc_state, udaddr->udasa); switch (sc->sc_state) { case S_IDLE: printf("uda%d: random interrupt ignored\n", d); return; case S_STEP1: #define STEP1GOOD (UDA_STEP2|UDA_IE|(NCMDL2<<3)|NRSPL2) if ((udaddr->udasa&(UDA_ERR|STEP1GOOD)) != STEP1GOOD) { sc->sc_state = S_IDLE; wakeup(um); return; } udaddr->udasa = ((int)&sc->sc_uda->uda_ca.ca_ringbase)| (cpu == VAX_780 ? UDA_PI : 0); sc->sc_state = S_STEP2; return; case S_STEP2: #define STEP2GOOD (UDA_STEP3|UDA_IE|(sc->sc_ivec/4)) if ((udaddr->udasa&(UDA_ERR|STEP2GOOD)) != STEP2GOOD) { sc->sc_state = S_IDLE; wakeup(um); return; } udaddr->udasa = ((int)&sc->sc_uda->uda_ca.ca_ringbase)>>16; sc->sc_state = S_STEP3; return; case S_STEP3: #define STEP3GOOD UDA_STEP4 if ((udaddr->udasa&(UDA_ERR|STEP3GOOD)) != STEP3GOOD) { sc->sc_state = S_IDLE; wakeup(um); return; } udaddr->udasa = UDA_GO; sc->sc_state = S_SCHAR; /* * Initialize the data structures. */ uud = sc->sc_uda; for (i = 0; i < NRSP; i++) { ud->uda_ca.ca_rspdsc[i] = UDA_OWN|UDA_INT| (long)&uud->uda_rsp[i].mscp_cmdref; ud->uda_rsp[i].mscp_dscptr = &ud->uda_ca.ca_rspdsc[i]; ud->uda_rsp[i].mscp_header.uda_msglen = sizeof (struct mscp); } for (i = 0; i < NCMD; i++) { ud->uda_ca.ca_cmddsc[i] = UDA_INT| (long)&uud->uda_cmd[i].mscp_cmdref; ud->uda_cmd[i].mscp_dscptr = &ud->uda_ca.ca_cmddsc[i]; ud->uda_cmd[i].mscp_header.uda_msglen = sizeof (struct mscp); } bp = &udwtab[d]; bp->av_forw = bp->av_back = bp; sc->sc_lastcmd = 0; sc->sc_lastrsp = 0; if ((mp = udgetcp(um)) == NULL) { sc->sc_state = S_IDLE; wakeup(um); return; } mp->mscp_opcode = M_OP_STCON; mp->mscp_cntflgs = M_CF_ATTN|M_CF_MISC|M_CF_THIS; *((long *)mp->mscp_dscptr) |= UDA_OWN|UDA_INT; i = udaddr->udaip; /* initiate polling */ return; case S_SCHAR: case S_RUN: break; default: printf("uda%d: interrupt in unknown state %d ignored\n", d, sc->sc_state); return; } if (udaddr->udasa&UDA_ERR) { printf("uda%d: fatal error (%o)\n", d, udaddr->udasa&0xffff); udaddr->udaip = 0; wakeup(um); } /* * Check for a buffer purge request. */ if (ud->uda_ca.ca_bdp) { /* * THIS IS A KLUDGE. * Maybe we should change the entire * UBA interface structure. */ int s = spl7(); i = um->um_ubinfo; printd("uda: purge bdp %d\n", ud->uda_ca.ca_bdp); um->um_ubinfo = ud->uda_ca.ca_bdp<<28; ubapurge(um); um->um_ubinfo = i; (void) splx(s); ud->uda_ca.ca_bdp = 0; udaddr->udasa = 0; /* signal purge complete */ } /* * Check for response ring transition. */ if (ud->uda_ca.ca_rspint) { ud->uda_ca.ca_rspint = 0; for (i = sc->sc_lastrsp;; i++) { i %= NRSP; if (ud->uda_ca.ca_rspdsc[i]&UDA_OWN) break; udrsp(um, ud, sc, i); ud->uda_ca.ca_rspdsc[i] |= UDA_OWN; } sc->sc_lastrsp = i; } /* * Check for command ring transition. */ if (ud->uda_ca.ca_cmdint) { printd("uda: command ring transition\n"); ud->uda_ca.ca_cmdint = 0; } udstart(um); } /* * Process a response packet */ udrsp(um, ud, sc, i) register struct uba_ctlr *um; register struct uda *ud; register struct uda_softc *sc; int i; { register struct mscp *mp; struct uba_device *ui; struct buf *dp, *bp; int st; mp = &ud->uda_rsp[i]; mp->mscp_header.uda_msglen = sizeof (struct mscp); sc->sc_credits += mp->mscp_header.uda_credits & 0xf; if ((mp->mscp_header.uda_credits & 0xf0) > 0x10) return; /* * If it's an error log message (datagram), * pass it on for more extensive processing. */ if ((mp->mscp_header.uda_credits & 0xf0) == 0x10) { uderror(um, (struct mslg *)mp); return; } if (mp->mscp_unit >= 8) return; if ((ui = udip[um->um_ctlr][mp->mscp_unit]) == 0) return; st = mp->mscp_status&M_ST_MASK; switch (mp->mscp_opcode) { case M_OP_STCON|M_OP_END: if (st == M_ST_SUCC) sc->sc_state = S_RUN; else sc->sc_state = S_IDLE; um->um_tab.b_active = 0; wakeup(um); break; case M_OP_ONLIN|M_OP_END: /* * Link the drive onto the controller queue */ dp = &udutab[ui->ui_unit]; dp->b_forw = NULL; if (um->um_tab.b_actf == NULL) um->um_tab.b_actf = dp; else um->um_tab.b_actl->b_forw = dp; um->um_tab.b_actl = dp; if (st == M_ST_SUCC) { ui->ui_flags = 1; /* mark it online */ radsize[ui->ui_unit] = (daddr_t)mp->mscp_untsize; printd("uda: unit %d online\n", mp->mscp_unit); } else { harderr(dp->b_actf, "ra"); printf("OFFLINE\n"); while (bp = dp->b_actf) { dp->b_actf = bp->av_forw; bp->b_flags |= B_ERROR; iodone(bp); } } dp->b_active = 1; break; case M_OP_AVATN: printd("uda: unit %d attention\n", mp->mscp_unit); ui->ui_flags = 0; /* it went offline and we didn't notice */ break; case M_OP_READ|M_OP_END: case M_OP_WRITE|M_OP_END: bp = (struct buf *)mp->mscp_cmdref; ubarelse(um->um_ubanum, &bp->b_resid); /* * Unlink buffer from I/O wait queue. */ bp->av_back->av_forw = bp->av_forw; bp->av_forw->av_back = bp->av_back; dp = &udutab[ui->ui_unit]; if (ui->ui_dk >= 0) if (--dp->b_qsize == 0) dk_busy &= ~(1<ui_dk); if (st == M_ST_OFFLN || st == M_ST_AVLBL) { ui->ui_flags = 0; /* mark unit offline */ /* * Link the buffer onto the front of the drive queue */ if ((bp->av_forw = dp->b_actf) == 0) dp->b_actl = bp; dp->b_actf = bp; /* * Link the drive onto the controller queue */ if (dp->b_active == 0) { dp->b_forw = NULL; if (um->um_tab.b_actf == NULL) um->um_tab.b_actf = dp; else um->um_tab.b_actl->b_forw = dp; um->um_tab.b_actl = dp; dp->b_active = 1; } return; } if (st != M_ST_SUCC) { harderr(bp, "ra"); printf("status %o\n", mp->mscp_status); bp->b_flags |= B_ERROR; } bp->b_resid = bp->b_bcount - mp->mscp_bytecnt; iodone(bp); break; case M_OP_GTUNT|M_OP_END: break; default: printf("uda: unknown packet\n"); } } /* * Process an error log message * * For now, just log the error on the console. * Only minimal decoding is done, only "useful" * information is printed. Eventually should * send message to an error logger. */ uderror(um, mp) register struct uba_ctlr *um; register struct mslg *mp; { printf("uda%d:%d: %s error, ", um->um_ctlr, mp->mslg_seqnum, mp->mslg_flags&M_LF_SUCC ? "soft" : "hard"); switch (mp->mslg_format) { case M_FM_CNTERR: printf("controller error, event 0%o\n", mp->mslg_event); break; case M_FM_BUSADDR: printf("host memory access error, event 0%o, addr 0%o\n", mp->mslg_event, *((long *)&mp->mslg_busaddr[0])); break; case M_FM_DISKTRN: printf("disk transfer error, unit %d, grp %d, cyl %d, sec %d, ", mp->mslg_unit, mp->mslg_group, mp->mslg_cylinder, mp->mslg_sector); printf("trk %d, lbn %d, retry %d, level %d\n", mp->mslg_track, mp->mslg_lbn, mp->mslg_retry, mp->mslg_level); break; case M_FM_SDI: printf("SDI error, unit %d, event 0%o, cyl %d\n", mp->mslg_unit, mp->mslg_event, mp->mslg_cylinder); break; case M_FM_SMLDSK: printf("small disk error, unit %d, event 0%o, cyl %d\n", mp->mslg_unit, mp->mslg_event, mp->mslg_sdecyl); break; default: printf("unknown error, unit %d, format 0%o, event 0%o\n", mp->mslg_unit, mp->mslg_format, mp->mslg_event); } } /* * Find an unused command packet */ struct mscp * udgetcp(um) struct uba_ctlr *um; { register struct mscp *mp; register struct udaca *cp; register struct uda_softc *sc; register int i; cp = &uda[um->um_ctlr].uda_ca; sc = &uda_softc[um->um_ctlr]; i = sc->sc_lastcmd; if ((cp->ca_cmddsc[i] & (UDA_OWN|UDA_INT)) == UDA_INT) { cp->ca_cmddsc[i] &= ~UDA_INT; mp = &uda[um->um_ctlr].uda_cmd[i]; mp->mscp_unit = mp->mscp_modifier = 0; mp->mscp_opcode = mp->mscp_flags = 0; mp->mscp_bytecnt = mp->mscp_buffer = 0; mp->mscp_errlgfl = mp->mscp_copyspd = 0; sc->sc_lastcmd = (i + 1) % NCMD; return(mp); } return(NULL); } udread(dev) dev_t dev; { register int unit = minor(dev) >> 3; if (unit >= NRA) u.u_error = ENXIO; else physio(udstrategy, &rudbuf[unit], dev, B_READ, minphys); } udwrite(dev) dev_t dev; { register int unit = minor(dev) >> 3; if (unit >= NRA) u.u_error = ENXIO; else physio(udstrategy, &rudbuf[unit], dev, B_WRITE, minphys); } udreset(uban) int uban; { register struct uba_ctlr *um; register struct uba_device *ui; register struct buf *bp, *dp; register int unit; struct buf *nbp; int d; for (d = 0; d < NUDA; d++) { if ((um = udminfo[d]) == 0 || um->um_ubanum != uban || um->um_alive == 0) continue; printf(" uda%d", d); um->um_tab.b_active = 0; um->um_tab.b_actf = um->um_tab.b_actl = 0; uda_softc[d].sc_state = S_IDLE; for (unit = 0; unit < NRA; unit++) { if ((ui = uddinfo[unit]) == 0) continue; if (ui->ui_alive == 0 || ui->ui_mi != um) continue; udutab[unit].b_active = 0; udutab[unit].b_qsize = 0; } for (bp = udwtab[d].av_forw; bp != &udwtab[d]; bp = nbp) { nbp = bp->av_forw; ubarelse(uban, &bp->b_ubinfo); /* * Link the buffer onto the drive queue */ dp = &udutab[dkunit(bp)]; if (dp->b_actf == 0) dp->b_actf = bp; else dp->b_actl-((>av_forw = bp; dp->b_actl = bp; bp->av_forw = 0; /* * Link the drive onto the controller queue */ if (dp->b_active == 0) { dp->b_forw = NULL; if (um->um_tab.b_actf == NULL) um->um_tab.b_actf = dp; else um->um_tab.b_actl->b_forw = dp; um->um_tab.b_actl = dp; dp->b_active = 1; } } udinit(d); } } uddump() { return(ENXIO); } @i kLQhw0;&i66 /* tu.c 82/02/01 4.5 */ #if defined(VAX750) || defined(VAX7ZZ) /* * TU58 DECtape II device driver * * This driver controls the console TU58s on a VAX-11/750 or VAX-11/7ZZ. * It could be easily modified for a Unibus TU58. The TU58 * is treated as a block device (only). Error detection and * recovery is almost non-existant. It is assumed that the * TU58 will follow the RSP protocol exactly, very few protocol * errors are checked for. It is assumed that the 750 uses standard * RSP while the 7ZZ uses Modified RSP (MRSP). At the time when 750's * are converted to MRSP (by replacing EPROMS in the TU58), the tests * based on MRSP can be removed. */ #define NTU ((cpu == VAX_750) ? 1 : 2) #define MRSP (cpu != VAX_750) #include "../h/param.h" #include "../h/systm.h" #include "../h/buf.h" #include "../h/conf.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/mtpr.h" #include "../h/cpu.h" #define printd if(tudebug) printf #ifdef printd int tudebug; /* printd */ #endif printd #define NTUBLK 512 /* number of blocks on a TU58 cassette */ #define TUIPL ((cpu == VAX_750) ? 0x17 : 0x14) /* * Device register bits */ #define READY 0200 /* transmitter ready */ #define DONE 0200 /* receiver done */ #define IE 0100 /* interrupt enable */ #define BREAK 1 /* send break */ /* * Structure of a command packet */ struct packet { u_char pk_flag; /* indicates packet type (cmd, data, etc.) */ u_char pk_mcount; /* length of packet (bytes) */ u_char pk_op; /* operation to perform (read, write, etc.) */ char pk_mod; /* modifier for op or returned status */ u_char pk_unit; /* unit number */ u_char pk_sw; /* switches */ u_short pk_seq; /* sequence number, always zero */ u_short pk_count; /* requested byte count for read or write */ u_short pk_block; /* block number for read, write, or seek */ u_short pk_chksum; /* checksum, by words with end around carry */ }; struct packet tucmd; /* a command sent to the TU58 */ struct packet tudata; /* a command or data returned from TU58 */ /* * State information */ struct tu { u_char *rbptr; /* pointer to buffer for read */ int rcnt; /* how much to read */ u_char *wbptr; /* pointer to buffer for write */ int wcnt; /* how much to write */ int state; /* current state of tansfer operation */ int flag; /* read in progress flag */ char *addr; /* real buffer data address */ int count; /* real requested count */ int serrs; /* count of soft errors */ int cerrs; /* count of checksum errors */ int herrs; /* count of hard errors */ } tu; /* * States */ #define INIT1 0 /* sending nulls */ #define INIT2 1 /* sending inits */ #define IDLE 2 /* initialized, no transfer in progress */ #define SENDH 3 /* sending header */ #define SENDD 4 /* sending data */ #define SENDC 5 /* sending checksum */ #define SENDR 6 /* sending read command packet */ #define SENDW 7 /* sending write command packet */ #define GETH 8 /* reading header */ #define GETD 9 /* reading data */ #define GETC 10 /* reading checksum */ #define GET 11 /* reading an entire packet */ #define WAIT 12 /* waiting for continue */ /* * Packet Flags */ #define TUF_DATA 1 /* data packet */ #define TUF_CMD 2 /* command packet */ #define TUF_INITF 4 /* initialize */ #define TUF_CONT 020 /* continue */ #define TUF_XOFF 023 /* flow control */ /* * Op Codes */ #define TUOP_INIT 1 /* initialize */ #define TUOP_READ 2 /* read block */ #define TUOP_WRITE 3 /* write block */ #define TUOP_SEEK 5 /* seek to block */ #define TUOP_DIAGNOSE 7 /* run micro-diagnostics */ #define TUOP_END 0100 /* end packet */ /* * Switches */ #define TUSW_MRSP 010 /* use Modified RSP */ u_char tunull[2] = { 0, 0 }; /* nulls to send for initialization */ u_char tuinit[2] = { TUF_INITF, TUF_INITF }; /* inits to send */ int tutimer = 0; struct buf tutab; /* I/O queue header */ /* * Open the TU58 */ /*ARGSUSED*/ tuopen(dev, flag) { extern int tuwatch(); register s; #ifdef lint turintr(); tuwintr(); #endif if (minor(dev) >= NTU) { u.u_error = ENXIO; return; } if (tutimer == 0) { tutimer++; timeout(tuwatch, (caddr_t)0, hz); } s = splx(TUIPL); if (tu.state != IDLE) { tureset(); sleep((caddr_t)&tu, PZERO); tutab.b_active = NULL; if (tu.state != IDLE) { /* couldn't initialize */ u.u_error = ENXIO; tu.state = INIT1; tu.rcnt = tu.wcnt = 0; mtpr(CSTS, 0); mtpr(CSRS, 0); } } else mtpr(CSRS, IE); splx(s); } /* * Close the TU58 */ tuclose(dev) { if (tutab.b_active == 0) { mtpr(CSRS, 0); tutimer = 0; } if (tu.serrs + tu.cerrs + tu.herrs != 0) { /* any errors ? */ uprintf("tu%d: %d soft errors, %d chksum errors, %d hard errors\n", minor(dev), tu.serrs, tu.cerrs, tu.herrs); tu.serrs = tu.cerrs = tu.herrs = 0; } } /* * Reset the TU58 */ tureset() { tu.state = INIT1; tu.wbptr = tunull; tu.wcnt = sizeof tunull; tucmd.pk_flag = TUF_CMD; tucmd.pk_mcount = sizeof tucmd - 4; tucmd.pk_mod = 0; tucmd.pk_seq = 0; tucmd.pk_sw = MRSP ? TUSW_MRSP : 0; tutab.b_active++; mtpr(CSRS, 0); mtpr(CSTS, IE|BREAK); tuxintr(); /* start output */ return; } /* * Strategy routine for block I/O */ tustrategy(bp) register struct buf *bp; { register int s; if (bp->b_blkno >= NTUBLK) { /* block number out of range? */ bp->b_flags |= B_ERROR; iodone(bp); return; } bp->av_forw = NULL; s = splx(TUIPL); if (tutab.b_actf == NULL) tutab.b_actf = bp; else tutab.b_actl->av_forw = bp; tutab.b_actl = bp; if (tutab.b_active == NULL) tustart(); splx(s); } /* * Start the transfer */ tustart() { register struct buf *bp; if ((bp = tutab.b_actf) == NULL) return; if (tu.state != IDLE) { tureset(); return; } tutab.b_active++; tutab.b_errcnt = 0; tucmd.pk_op = bp->b_flags&B_READ ? TUOP_READ : TUOP_WRITE; tucmd.pk_unit = minor(bp->b_dev); tucmd.pk_count = tu.count = bp->b_bcount; tucmd.pk_block = bp->b_blkno; tucmd.pk_chksum = tuchk(*((short *)&tucmd), (caddr_t)&tucmd.pk_op, (int)tucmd.pk_mcount); tu.state = bp->b_flags&B_READ ? SENDR : SENDW; tu.addr = bp->b_un.b_addr; tu.count = bp->b_bcount; tu.wbptr = (u_char *)&tucmd; tu.wcnt = sizeof tucmd; tuxintr(); } /* * TU58 receiver interrupt */ turintr() { register struct buf *bp; register int c; c = mfpr(CSRD)&0xff; /* get the char, clear the interrupt */ if (MRSP) { while ((mfpr(CSTS)&READY) == 0) ; mtpr(CSTD, TUF_CONT); /* ACK */ } if (tu.rcnt) { /* still waiting for data? */ *tu.rbptr++ = c; /* yup, put it there */ if (--tu.rcnt) /* decrement count, any left? */ return; /* get some more */ } /* * We got all the data we were expecting for now, * switch on the state of the transfer. */ switch(tu.state) { case INIT2: if (c == TUF_CONT) /* did we get the expected continue? */ tu.state = IDLE; else tu.state = INIT1; /* bad news... */ tu.flag = 0; wakeup((caddr_t)&tu); tustart(); break; case WAIT: /* waiting for continue */ if (c != TUF_CONT) { tu.state = INIT1; /* bad news... */ break; } tu.flag = 0; tudata.pk_flag = TUF_DATA; tudata.pk_mcount = MIN(128, tu.count); tudata.pk_chksum = tuchk(*((short *)&tudata), (caddr_t)tu.addr, (int)tudata.pk_mcount); tu.state = SENDH; tu.wbptr = (u_char *)&tudata; tu.wcnt = 2; tuxintr(); break; case GETH: /* got header, get data */ if (tudata.pk_flag == TUF_DATA) /* data message? */ tu.rbptr = (u_char *)tu.addr; /* yes put in buffer */ tu.rcnt = tudata.pk_mcount; /* amount to get */ tu.state = GETD; break; case GETD: /* got data, get checksum */ tu.rbptr = (u_char *)&tudata.pk_chksum; tu.rcnt = sizeof tudata.pk_chksum; tu.state = GETC; break; case GET: case GETC: /* got entire packet */ #ifdef notdef if (tudata.pk_chksum != tuchk(*((short *)&tudata), tudata.pk_flag == TUF_DATA ? tu.addr : &tudata.pk_op, (int)tudata.pk_mcount)) tu.cerrs++; #endif if (tudata.pk_flag == TUF_DATA) { /* data packet, advance to next */ tu.addr += tudata.pk_mcount; tu.count -= tudata.pk_mcount; tu.state = GETH; tu.rbptr = (u_char *)&tudata; /* next packet */ tu.rcnt = 2; } else if (tudata.pk_((flag==TUF_CMD && tudata.pk_op==TUOP_END) { /* end packet, idle and reenable transmitter */ tu.state = IDLE; tu.flag = 0; mtpr(CSTS, IE); printd("ON "); if ((bp = tutab.b_actf) == NULL) { printf("tu: no bp!\n"); printf("active %d\n", tutab.b_active); tustart(); return; } if (tudata.pk_mod < 0) { /* hard error */ bp->b_flags |= B_ERROR; tu.herrs++; harderr(bp, "tu"); printf(" pk_mod %d\n", -tudata.pk_mod); } else if (tudata.pk_mod > 0) /* soft error */ tu.serrs++; tutab.b_active = NULL; tutab.b_actf = bp->av_forw; bp->b_resid = tu.count; iodone(bp); tustart(); } else { printf("neither data nor end: %o %o\n", tudata.pk_flag&0xff, tudata.pk_op&0xff); mtpr(CSRS, 0); /* flush the rest */ tu.state = INIT1; } break; case IDLE: case INIT1: break; default: if (c == TUF_INITF) { printf("TU protocol error, state %d\n", tu.state); printf("%o %d %d\n", tucmd.pk_op, tucmd.pk_count, tucmd.pk_block); tutab.b_active = NULL; if (bp = tutab.b_actf) { bp->b_flags |= B_ERROR; tutab.b_actf = bp->av_forw; iodone(bp); } tu.state = INIT1; } else { printf("TU receive state error %d %o\n", tu.state, c); /* tu.state = INIT1; */ wakeup((caddr_t)&tu); } } } /* * TU58 transmitter interrupt */ tuxintr() { top: if (tu.wcnt) { /* still stuff to send, send one byte */ while ((mfpr(CSTS) & READY) == 0) ; mtpr(CSTD, *tu.wbptr++); tu.wcnt--; return; } /* * Last message byte was sent out. * Switch on state of transfer. */ printd("tuxintr: state %d\n", tu.state); switch(tu.state) { case INIT1: /* two nulls sent, remove break, send inits */ mtpr(CSTS, IE); printd("ON2 "); tu.state = INIT2; tu.wbptr = tuinit; tu.wcnt = sizeof tuinit; goto top; case INIT2: /* inits sent, wait for continue */ (void) mfpr(CSRD); mtpr(CSRS, IE); tu.flag = 1; break; case IDLE: /* stray interrupt? */ break; case SENDR: /* read cmd packet sent, get ready for @i kKRiy0;&i66data */ tu.state = GETH; tu.rbptr = (u_char *)&tudata; tu.rcnt = 2; tu.flag = 1; mtpr(CSTS, 0); /* disable transmitter interrupts */ printd("OFF "); break; case SENDW: /* write cmd packet sent, wait for continue */ tu.state = WAIT; tu.flag = 1; if ((mfpr(CSRS)&IE) == 0) { printf("NO IE\n"); mtpr(CSRS, IE); } break; case SENDH: /* header sent, send data */ tu.state = SENDD; tu.wbptr = (u_char *)tu.addr; tu.wcnt = tudata.pk_mcount; goto top; case SENDD: /* data sent, send checksum */ tu.state = SENDC; tu.wbptr = (u_char *)&tudata.pk_chksum; tu.wcnt = sizeof tudata.pk_chksum; goto top; case SENDC: /* checksum sent, wait for continue */ tu.addr += tudata.pk_mcount; /* update buffer address */ tu.count -= tudata.pk_mcount; /* and count */ if (tu.count == 0) { /* all done? */ tu.state = GET; /* set up to get end packet */ tu.rbptr = (u_char *)&tudata; tu.rcnt = sizeof tudata; tu.flag = 1; mtpr(CSTS, 0); printd("OFF2 "); } else { tu.state = WAIT; /* wait for continue */ tu.flag = 1; } break; default: /* random interrupt, probably from MRSP ACK */ break; } printd(" new state %d\n", tu.state); } /* * Compute checksum TU58 fashion */ tuchk(word, cp, n) register word; register unsigned short *cp; { register c = n >> 1; register long temp; do { temp = *cp++; /* temp, only because vax cc won't *r++ */ word += temp; } while (--c > 0); if (n & 1) word += *(unsigned char *)cp; while (word & 0xFFFF0000) word = (word & 0xFFFF) + (word >> 16); return (word); } tuwatch() { register int s; register struct buf *bp; if (tutimer == 0) { tu.flag = 0; return; } if (tu.flag) tu.flag++; if (tu.flag > 40) { printf("tu: read stalled\n"); printf("%X %X %X %X %X %X %X %X\n", tu.rbptr, tu.rcnt, tu.wbptr, tu.wcnt, tu.state, tu.flag, tu.addr, tu.count); tu.flag = 0; s = splx(TUIPL); (void) mfpr(CSRD); mtpr(CSRS, IE); /* in case we were flushing */ mtpr(CSTS, IE); tu.state = IDLE; if (tutab.b_active) { if (++tutab.b_errcnt > 1) { if (bp = tutab.b_actf) { bp->b_flags |= B_ERROR; iodone(bp); } } else tustart(); } else wakeup((caddr_t)&tu); splx(s); } timeout(tuwatch, (caddr_t)0, hz); } #endif @i k̈$s7x{~:&i:SP6i /* mt.c 1.2 81/10/27 */ #include "mu.h" #if NMT > 0 /* * TM78/TU78 tape driver * * Behavior in complex error situations is uncertain... * * TODO: * test error recovery * add odd byte count kludge from VMS driver * write dump routine */ #include "../h/param.h" #include "../h/systm.h" #include "../h/buf.h" #include "../h/conf.h" #include "../h/dir.h" #include "../h/file.h" #include "../h/user.h" #include "../h/map.h" #include "../h/pte.h" #include "../h/mbareg.h" #include "../h/mbavar.h" #include "../h/mtio.h" #include "../h/ioctl.h" #include "../h/cmap.h" #include "../h/cpu.h" #include "../h/mtreg.h" struct buf rmtbuf[NMT]; struct buf cmtbuf[NMT]; short mttypes[] = { MBDT_TU78, 0 }; struct mba_device *mtinfo[NMT]; int mtattach(), mtslave(), mtustart(), mtstart(), mtndtint(), mtdtint(); struct mba_driver mtdriver = { mtattach, mtslave, mtustart, mtstart, mtdtint, mtndtint, mttypes, "mt", "mu", mtinfo }; #define MASKREG(r) ((r) & 0xffff) /* bits in minor device */ #define MUUNIT(dev) (minor(dev)&03) #define H_NOREWIND 04 #define H_6250BPI 08 #define MTUNIT(dev) (mutomt[MUUNIT(dev)]) #define INF (daddr_t)1000000L /* a block number that wont exist */ struct mu_softc { char sc_openf; char sc_flags; daddr_t sc_blkno; daddr_t sc_nxrec; u_short sc_erreg; u_short sc_dsreg; short sc_resid; short sc_dens; struct mba_device *sc_mi; int sc_slave; } mu_softc[NMU]; short mutomt[NMU]; /* * Bits for sc_flags. */ #define H_WRITTEN 1 /* last operation was a write */ char mtds_bits[] = MTDS_BITS; /*ARGSUSED*/ mtattach(mi) struct mba_device *mi; { } mtslave(mi, ms) struct mba_device *mi; struct mba_slave *ms; { register struct mu_softc *sc = &mu_softc[ms->ms_unit]; register struct mtdevice *mtaddr = (struct mtdevice *)mi->mi_drv; int s = spl7(), rtn = 0; mtaddr->mtas = -1; mtaddr->mtncs[ms->ms_slave] = MT_SENSE|MT_GO; while (mtaddr->mtas == 0) ; if ((mtaddr->mtner & MTER_INTCODE) == MTER_DONE && (mtaddr->mtds & MTDS_PRES)) { sc->sc_mi = mi; sc->sc_slave = ms->ms_slave; mutomt[ms->ms_unit] = mi->mi_unit; rtn = 1; } mtaddr->mtas = mtaddr->mtas; splx(s); return (rtn); } mtopen(dev, flag) dev_t dev; int flag; { register int muunit; register struct mba_device *mi; register struct mu_softc *sc; int olddens, dens; muunit = MUUNIT(dev); if (muunit >= NMU || (sc = &mu_softc[muunit])->sc_openf || (mi = mtinfo[MTUNIT(dev)]) == 0 || mi->mi_alive == 0) { u.u_error = ENXIO; return; } olddens = sc->sc_dens; dens = sc->sc_dens = (minor(dev)&H_6250BPI) ? MT_GCR : 0; mtcommand(dev, MT_SENSE, 1); sc->sc_dens = olddens; if ((sc->sc_dsreg & MTDS_ONL) == 0) { uprintf("mu%d: not online\n", muunit); u.u_error = EIO; return; } if ((flag&FWRITE) && (sc->sc_dsreg&MTDS_FPT)) { uprintf("mu%d: no write ring\n", muunit); u.u_error = EIO; return; } if ((sc->sc_dsreg & MTDS_BOT) == 0 && (flag&FWRITE) && dens != sc->sc_dens) { uprintf("mu%d: can't change density in mid-tape\n", muunit); u.u_error = EIO; return; } sc->sc_openf = 1; sc->sc_blkno(( = (daddr_t)0; sc->sc_nxrec = INF; sc->sc_flags = 0; sc->sc_dens = dens; } mtclose(dev, flag) register dev_t dev; register flag; { register struct mu_softc *sc = &mu_softc[MUUNIT(dev)]; if (flag == FWRITE || ((flag&FWRITE) && (sc->sc_flags&H_WRITTEN))) mtcommand(dev, MT_CLS|sc->sc_dens, 1); if ((minor(dev)&H_NOREWIND) == 0) mtcommand(dev, MT_REW, 0); sc->sc_openf = 0; } mtcommand(dev, com, count) dev_t dev; int com, count; { register struct buf *bp; bp = &cmtbuf[MTUNIT(dev)]; (void) spl5(); while (bp->b_flags&B_BUSY) { if(bp->b_repcnt == 0 && (bp->b_flags&B_DONE)) break; bp->b_flags |= B_WANTED; sleep((caddr_t)bp, PRIBIO); } bp->b_flags = B_BUSY|B_READ; (void) spl0(); bp->b_dev = dev; bp->b_command = com; bp->b_repcnt = count; bp->b_blkno = 0; mtstrategy(bp); if (count == 0) return; iowait(bp); if (bp->b_flags&B_WANTED) wakeup((caddr_t)bp); bp->b_flags &= B_ERROR; } mtstrategy(bp) register struct buf *bp; { register struct mba_device *mi = mtinfo[MTUNIT(bp->b_dev)]; register struct buf *dp; bp->av_forw = NULL; dp = &mi->mi_tab; (void) spl5(); if (dp->b_actf == NULL) dp->b_actf = bp; else dp->b_actl->av_forw = bp; dp->b_actl = bp; if (dp->b_active == 0) mbustart(mi); (void) spl0(); } mtustart(mi) register struct mba_device *mi; { register struct mtdevice *mtaddr = (struct mtdevice *)mi->mi_drv; register struct buf *bp = mi->mi_tab.b_actf; register struct mu_softc *sc = &mu_softc[MUUNIT(bp->b_dev)]; daddr_t blkno; sc->sc_flags &= ~H_WRITTEN; if (sc->sc_openf < 0) { bp->b_flags |= B_ERROR; return (MBU_NEXT); } if (bp != &cmtbuf[MTUNIT(bp->b_dev)]) { if (dbtofsb(bp->b_blkno) > sc->sc_nxrec) { bp->b_flags |= B_ERROR; bp->b_error = ENXIO; return (MBU_NEXT); } if (dbtofsb(bp->b_blkno) == sc->sc_nxrec && bp->b_flags&B_READ) { bp->b_resid = bp->b_bcount; clrbuf(bp); return (MBU_NEXT); } if ((bp->b_flags&B_READ)==0) sc->sc_nxrec = dbtofsb(bp->b_blkno) + 1; } else { mtaddr->mtncs[MUUNIT(bp->b_dev)] = (bp->b_repcnt<<8)|bp->b_command|MT_GO; return (MBU_STARTED); } if ((blkno = sc->sc_blkno) == dbtofsb(bp->b_blkno)) { if (mi->mi_tab.b_errcnt == 2) { mtaddr->mtca = MUUNIT(bp->b_dev); } else { mtaddr->mtbc = bp->b_bcount; mtaddr->mtca = (1<<2)|MUUNIT(bp->b_dev); } return (MBU_DODATA); } if (blkno < dbtofsb(bp->b_blkno)) mtaddr->mtncs[MUUNIT(bp->b_dev)] = (min(dbtofsb(bp->b_blkno) - blkno, 0377)<<8)| MT_SFORW|MT_GO; else mtaddr->mtncs[MUUNIT(bp->b_dev)] = (min(blkno - dbtofsb(bp->b_blkno), 0377)<<8)| MT_SREV|MT_GO; return (MBU_STARTED); } mtstart(mi) register struct mba_device *mi; { register struct buf *bp = mi->mi_tab.b_actf; register struct mu_softc *sc = &mu_softc[MUUNIT(bp->b_dev)]; if (bp->b_flags & B_READ) if (mi->mi_tab.b_errcnt == 2) return(MT_READREV|MT_GO); else return(MT_READ|MT_GO); else return(MT_WRITE|sc->sc_dens|MT_GO); } mtdtint(mi, mbsr) register struct mba_device *mi; int mbsr; { register struct mtdevice *mtaddr = (struct mtdevice *)mi->mi_drv; register struct buf *bp = mi->mi_tab.b_actf; register struct mu_softc *sc; /* I'M NOT SURE IF THIS SHOULD ALWAYS BE THE CASE SO FOR NOW... */ if ((mtaddr->mtca&3) != MUUNIT(bp->b_dev)) { printf("mt: wrong unit!\n"); mtaddr->mtca = MUUNIT(bp->b_dev); } sc = &mu_softc[MUUNIT(bp->b_dev)]; sc->sc_erreg = mtaddr->mter; if((bp->b_flags & B_READ) == 0) sc->sc_flags |= H_WRITTEN; switch (sc->sc_erreg & MTER_INTCODE) { case MTER_DONE: case MTER_LONGREC: if (mi->mi_tab.b_errcnt != 2) sc->sc_blkno++; bp->b_resid = 0; break; case MTER_NOTCAP: printf("mu%d: blank tape\n", MUUNIT(bp->b_dev)); goto err; case MTER_TM: case MTER_EOT: sc->sc_blkno++; err: bp->b_resid = bp->b_bcount; sc->sc_nxrec = dbtofsb(bp->b_blkno); break; case MTER_SHRTREC: sc->sc_blkno++; if (bp != &rmtbuf[MTUNIT(bp->b_dev)]) bp->b_flags |= B_ERROR; if (mi->mi_tab.b_errcnt == 2) bp->b_bcount = bp->b_resid; /* restore saved value */ bp->b_resid = bp->b_bcount - mtaddr->mtbc; break; case MTER_RDOPP: mi->mi_tab.b_errcnt = 2; /* indicate "read opposite" */ bp->b_resid = bp->b_bcount; /* save it */ bp->b_bcount = mtaddr->mtbc; /* use this instead */ return(MBD_RETRY); case MTER_RETRY: mi->mi_tab.b_errcnt = 1; /* indicate simple retry */ return(MBD_RETRY); case MTER_OFFLINE: if (sc->sc_openf > 0) { sc->sc_openf = -1; printf("mu%d: offline\n", MUUNIT(bp->b_dev)); } bp->b_flags |= B_ERROR; break; case MTER_FPT: printf("mu%d: no write ring\n", MUUNIT(bp->b_dev)); bp->b_flags |= B_ERROR; break; default: printf("mu%d: hard error bn%d mbsr=%b er=%x ds=%b\n", MUUNIT(bp->b_dev), bp->b_blkno, mbsr, mbsr_bits, sc->sc_erreg, sc->sc_dsreg, mtds_bits); bp->b_flags |= B_ERROR; mtaddr->mtid = MTID_CLR; /* reset the TM78 */ DELAY(250); while ((mtaddr->mtid & MTID_RDY) == 0) /* wait for it */ ; return (MBD_DONE); } /* CHECK FOR MBA ERROR WHEN NO OTHER ERROR INDICATED? */ return (MBD_DONE); } mtndtint(mi) register struct mba_device *mi; { register struct mtdevice *mtaddr = (struct mtdevice *)mi->mi_drv; register struct buf *bp = mi->mi_tab.b_actf; register struct mu_softc *sc; int er, fc, unit; unit = (mtaddr->mtner >> 8) & 3; er = MASKREG(mtaddr->mtner); /* WILL THIS OCCUR IF ANOTHER DRIVE COMES ONLINE? */ if (bp == 0 || unit != MUUNIT(bp->b_dev)) { /* consistency check */ if ((er & MTER_INTCODE) != MTER_ONLINE) printf("mt: unit %d random interrupt\n", unit); return (MBN_SKIP); } if (bp == 0) return (MBN_SKIP); fc = (mtaddr->mtncs[unit] >> 8) & 0xff; sc = &mu_softc[unit]; sc->sc_erreg = er; sc->sc_resid = fc; switch (er & MTER_INTCODE) { case MTER_DONE: if (bp == &cmtbuf[MTUNIT(bp->b_dev)]) { done: if (bp->b_command == MT_SENSE) sc->sc_dsreg = MASKREG(mtaddr->mtds); bp->b_resid = fc; return (MBN_DONE); } /* this is UGLY! (but is it correct?) */ if ((fc = dbtofsb(bp->b_blkno) - sc->sc_blkno) < 0) sc->sc_blkno -= min(0377, -fc); else sc->sc_blkno += min(0377, fc); return (MBN_RETRY); case MTER_RWDING: return (MBN_SKIP); /* ignore "rewind started" interrupt */ case MTER_NOTCAP: printf("mu%d: blank tape\n", MUUNIT(bp->b_dev)); case MTER_TM: case MTER_EOT: case MTER_LEOT: if (sc->sc_blkno > dbtofsb(bp->b_blkno)) { sc->sc_nxrec = dbtofsb(bp->b_blkno) + fc; sc->sc_blkno = sc->sc_nxrec; } else { sc->sc_blkno = dbtofsb(bp->b_blkno) - fc; sc->sc_nxrec = sc->sc_blkno - 1; } return (MBN_RETRY); case MTER_FPT: printf("mu%d: no write ring\n", MUUNIT(bp->b_dev)); bp->b_flags |= B_ERROR; return (MBN_DONE); case MTER_OFFLINE: if (sc->sc_openf > 0) { sc->sc_openf = -1; printf("mu%d: offline\n", MUUNIT(bp->b_dev)); } bp->b_flags |= B_ERROR; return (MBN_DONE); case MTER_BOT: if (bp == &cmtbuf[MTUNIT(bp->b_dev)]) goto done; /* FALL THROUGH */ default: printf("mu%d: hard error bn%d er=%o ds=%b\n", MUUNIT(bp->b_dev), bp->b_blkno, sc->sc_erreg, sc->sc_dsreg, mtds_bits); mtaddr->mtid = MTID_CLR; /* reset the TM78 */@i kˉ$s7x{~:&i:SP6i DELAY(250); while ((mtaddr->mtid & MTID_RDY) == 0) /* wait for it */ ; bp->b_flags |= B_ERROR; return (MBN_DONE); } /* NOTREACHED */ } mtread(dev) dev_t dev; { mtphys(dev); if (u.u_error) return; physio(mtstrategy, &rmtbuf[MTUNIT(dev)], dev, B_READ, minphys); } mtwrite(dev) { mtphys(dev); if (u.u_error) return; physio(mtstrategy, &rmtbuf[MTUNIT(dev)], dev, B_WRITE, minphys); } mtphys(dev) dev_t dev; { register int mtunit; register struct mu_softc *sc; register struct mba_device *mi; daddr_t a; mtunit = MTUNIT(dev); if (mtunit >= NMT || (mi = mtinfo[mtunit]) == 0 || mi->mi_alive == 0) { u.u_error = ENXIO; return; } a = u.u_offset >> 9; sc = &mu_softc[MUUNIT(dev)]; sc->sc_blkno = dbtofsb(a); sc->sc_nxrec = dbtofsb(a)+1; } /*ARGSUSED*/ mtioctl(dev, cmd, addr, flag) dev_t dev; int cmd; caddr_t addr; int flag; { register struct mu_softc *sc = &mu_softc[MUUNIT(dev)]; register struct buf *bp = &cmtbuf[MTUNIT(dev)]; register callcount; register int n, op; int fcount; struct mtop mtop; struct mtget mtget; /* we depend of the values and order of the MT codes here */ static mtops[] = {MT_WTM,MT_SFORWF,MT_SREVF,MT_SFORW,MT_SREV,MT_REW,MT_UNLOAD,MT_SENSE}; switch (cmd) { case MTIOCTOP: /* tape operation */ if (copyin((caddr_t)addr, (caddr_t)&mtop, sizeof(mtop))) { u.u_error = EFAULT; return; } switch(mtop.mt_op) { case MTWEOF: callcount = mtop.mt_count; fcount = 1; break; case MTFSF: case MTBSF: callcount = mtop.mt_count; fcount = 1; break; case MTFSR: case MTBSR: callcount = 1; fcount = mtop.mt_count; break; case MTREW: case MTOFFL: callcount = 1; fcount = 1; break; default: u.u_error = ENXIO; return; } if (callcount <= 0 || fcount <= 0) { u.u_error = ENXIO; return; } op = mtops[mtop.mt_op]; if (op == MT_WTM) op |= sc->sc_dens; while (--callcount >= 0) { register int n; do { n = min(fcount, 0xff); mtcommand(dev, op, n); fcount -= n; } while (fcount); i((f ((mtop.mt_op == MTFSR || mtop.mt_op == MTBSR) && bp->b_resid) { u.u_error = EIO; break; } if (bp->b_flags&B_ERROR) break; } geterror(bp); return; case MTIOCGET: mtget.mt_erreg = sc->sc_erreg; mtget.mt_resid = sc->sc_resid; mtcommand(dev, MT_SENSE, 1); /* update drive status */ mtget.mt_dsreg = sc->sc_dsreg; mtget.mt_type = MT_ISMT; if (copyout((caddr_t)&mtget, addr, sizeof(mtget))) u.u_error = EFAULT; return; default: u.u_error = ENXIO; } } #define DBSIZE 20 mtdump() { register struct mba_device *mi; register struct mba_regs *mp; register struct mtdevice *mtaddr; int blk, num; int start; start = 0; num = maxfree; #define phys(a,b) ((b)((int)(a)&0x7fffffff)) if (mtinfo[0] == 0) return (ENXIO); mi = phys(mtinfo[0], struct mba_device *); mp = phys(mi->mi_hd, struct mba_hd *)->mh_physmba; mp->mba_cr = MBCR_IE; mtaddr = (struct mtdevice *)&mp->mba_drv[mi->mi_drive]; #ifdef notyet mtaddr->mttc = MTTC_PDP11|MTTC_1600BPI; mtaddr->mtcs1 = MT_DCLR|MT_GO; while (num > 0) { blk = num > DBSIZE ? DBSIZE : num; mtdwrite(start, blk, mtaddr, mp); start += blk; num -= blk; } mteof(mtaddr); mteof(mtaddr); mtwait(mtaddr); if (mtaddr->mtds&MTDS_ERR) return (EIO); mtaddr->mtcs1 = MT_REW|MT_GO; return (0); } mtdwrite(dbuf, num, mtaddr, mp) register dbuf, num; register struct mtdevice *mtaddr; struct mba_regs *mp; { register struct pte *io; register int i; mtwait(mtaddr); io = mp->mba_map; for (i = 0; i < num; i++) *(int *)io++ = dbuf++ | PG_V; mtaddr->mtfc = -(num*NBPG); mp->mba_sr = -1; mp->mba_bcr = -(num*NBPG); mp->mba_var = 0; mtaddr->mtcs1 = MT_WCOM|MT_GO; } mtwait(mtaddr) struct mtdevice *mtaddr; { register s; do s = mtaddr->mtds; while ((s & MTDS_DRY) == 0); } mteof(mtaddr) struct mtdevice *mtaddr; { mtwait(mtaddr); mtaddr->mtcs1 = MT_WEOF|MT_GO; #endif notyet } #endif @i kQ.$5loru:&i e$ e$ /* dn.c 4.4 82/01/12 */ #include "dn.h" #if NDN > 0 /* * DN-11 ACU interface */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/buf.h" #include "../h/map.h" #include "../h/pte.h" #include "../h/ubavar.h" #include "../h/conf.h" #include "../h/ioctl.h" struct dndevice { u_short dn_reg[4]; }; struct uba_device *dninfo[NDN]; int dnprobe(), dnattach(); u_short dnstd[] = { 0175200 }; struct uba_driver dndriver = { dnprobe, 0, dnattach, 0, dnstd, "dn", dninfo }; #define CRQ 0x001 /* call request */ #define DPR 0x002 /* digit present */ #define MENABLE 0x004 /* master enable */ #define MAINT 0x008 /* maintenance mode */ #define PND 0x010 /* present next digit */ #define DSS 0x020 /* data set status */ #define IENABLE 0x040 /* interrupt enable */ #define DONE 0x080 /* operation complete */ #define DLO 0x1000 /* data line occupied */ #define ACR 0x4000 /* abandon call and retry */ #define PWI 0x8000 /* power indicate */ #define DNPRI (PZERO+5) #define DNUNIT(dev) (minor(dev)>>2) #define DNREG(dev) ((dev)&03) #define OBUFSIZ 40 /* largest phone # dialer can handle */ /* * There's no good way to determine the correct number of dialers attached * to a single device (especially when dialers such as Vadic-821 MACS * exist which can address four chassis, each with its own dialer). */ dnprobe(reg) caddr_t reg; { register int br, cvec; /* value-result, must be r11, r10 */ register struct dndevice *dnaddr = (struct dndevice *)reg; /* * If there's at least one dialer out there it better be * at chassis 0. */ dnaddr->dn_reg[0] = MENABLE|IENABLE|DONE; DELAY(5); dnaddr->dn_reg[0] = 0; } dnattach(ui) struct uba_device *ui; {} /*ARGSUSED*/ dnopen(dev, flag) dev_t dev; { register struct dndevice *dp; register u_short unit, *dnreg; register struct uba_device *ui; register short dialer; if ((unit = DNUNIT(dev)) >= NDN || (ui = dninfo[unit]) == 0 || ui->ui_alive == 0) { u.u_error = ENXIO; return; } dialer = DNREG(dev); dp = (struct dndevice *)ui->ui_addr; if (dp->dn_reg[dialer] & PWI) { u.u_error = ENXIO; return; } dnreg = &(dp->dn_reg[dialer]); if (*dnreg&(DLO|CRQ)) { u.u_error = EBUSY; return; } dp->dn_reg[0] |= MENABLE; *dnreg = IENABLE|MENABLE|CRQ; } /*ARGSUSED*/ dnclose(dev, flag) dev_t dev; { register struct dndevice *dp; dp = (struct dndevice *)dninfo[DNUNIT(dev)]->ui_addr; dp->dn_reg[DNREG(dev)] = MENABLE; } dnwrite(dev) dev_t dev; { register u_short *dnreg; register int cc; register struct dndevice *dp; char buf[OBUFSIZ]; register char *cp; extern lbolt; dp = (struct dndevice *)dninfo[DNUNIT(dev)]->ui_addr; dnreg = &(dp->dn_reg[DNREG(dev)]); cc = MIN(u.u_count, OBUFSIZ); cp = buf; iomove(cp, (unsigned)cc, B_WRITE); if (u.u_error) return; while ((*dnreg & (PWI|ACR|DSS)) == 0 && cc >= 0) { spl4(); if ((*dnreg & PND) == 0 || cc == 0) sleep((caddr_t)dnreg, DNPRI); else switch(*cp) { case '-': sleep((caddr_t)&lbolt, DNPRI); sleep((caddr_t)&lbolt, DNPRI); break; case 'f': *dnreg &= ~CRQ; sleep((caddr_t)&lbolt, DNPRI); *dnreg |= CRQ; break; case '*': case ':': *cp = 012; goto dial; case '#': case ';': *cp = 013; goto dial; case 'e': case '<': *cp = 014; goto dial; case 'w': case '=': *cp = 015; goto dial; default: if (*cp < '0' || *cp > '9') break; dial: *dnreg = (*cp << 8) | (IENABLE|MENABLE|DPR|CRQ); sleep((caddr_t)dnreg, DNPRI); } cp++, cc--; spl0(); } if (*dnreg & (PWI|ACR)) u.u_error = EIO; } dnintr(dev) dev_t dev; { register u_short *basereg, *dnreg; basereg = (u_short *)dninfo[dev]->ui_addr; *basereg &= ~MENABLE; for (dnreg = basereg; dnreg < basereg + 4; dnreg++) if (*dnreg & DONE) { *dnreg &= ~(DONE|DPR); wakeup((caddr_t)dnreg); } *basereg |= MENABLE; } #endif @i k~*2i (<ЬPЬRRQ{RPRPPPRRP  &uremdivnodivnzeroretn@i k]$q ?BK/ikk ((/* uda.c 4.1 81/12/01 */ /* * UDA50/RAxx disk device driver */ #include "../h/param.h" #include "../h/inode.h" #include "../h/pte.h" #include "../h/ubareg.h" #include "saio.h" #include "savax.h" /* * Parameters for the communications area */ #define NRSPL2 0 #define NCMDL2 0 #define NRSP (1<i_unit, udastd[0]); if (ud_ubaddr == 0) { cudbuf.i_ma = (caddr_t)&uda; cudbuf.i_cc = sizeof(uda); ud_ubaddr = (struct uda *)ubasetup(&cudbuf, 2); } udaddr->udaip = 0; while ((udaddr->udasa & UDA_STEP1) == 0) ; udaddr->udasa = UDA_ERR; while ((udaddr->udasa & UDA_STEP2) == 0) ; udaddr->udasa = (short)&ud_ubaddr->uda_ca.ca_ringbase; while ((udaddr->udasa & UDA_STEP3) == 0) ; udaddr->udasa = (short)(((int)&ud_ubaddr->uda_ca.ca_ringbase) >> 16); while ((udaddr->udasa & UDA_STEP4) == 0) ; udaddr->udasa = UDA_GO; uda.uda_ca.ca_rspdsc[0] = (long)&ud_ubaddr->uda_rsp.mscp_cmdref; uda.uda_ca.ca_cmddsc[0] = (long)&ud_ubaddr->uda_cmd.mscp_cmdref; uda.uda_cmd.mscp_cntflgs = 0; if (udcmd(M_OP_STCON) == 0) { _stop("ra: open error, STCON"); return; } uda.uda_cmd.mscp_unit = io->i_unit&7; if (udcmd(M_OP_ONLIN) == 0) { _stop("ra: open error, ONLIN"); return; } if (io->i_boff < 0 || io->i_boff > 7 || uda_off[io->i_boff] == -1) _stop("ra: bad unit"); io->i_boff = uda_off[io->i_boff]; } struct mscp * udcmd(op) int op; { struct mscp *mp; int i; uda.uda_cmd.mscp_opcode = op; uda.uda_rsp.mscp_header.uda_msglen = sizeof (struct mscp); uda.uda_cmd.mscp_header.uda_msglen = sizeof (struct mscp); uda.uda_ca.ca_rspdsc[0] |= UDA_OWN|UDA_INT; uda.uda_ca.ca_cmddsc[0] |= UDA_OWN|UDA_INT; i = udaddr->udaip; for (;;) { if (uda.uda_ca.ca_cmdint) uda.uda_ca.ca_cmdint = 0; if (uda.uda_ca.ca_rspint) break; } uda.uda_ca.ca_rspint = 0; mp = &uda.uda_rsp; if (mp->mscp_opcode != (op|M_OP_END) || (mp->mscp_status&M_ST_MASK) != M_ST_SUCC) return(0); return(mp); } udstrategy(io, func) register struct iob *io; { register struct mscp *mp; int ubinfo; ubinfo = ubasetup(io, 1); mp = &uda.uda_cmd; mp->mscp_lbn = io->i_bn; mp->mscp_unit = io->i_unit&7; mp->mscp_bytecnt = io->i_cc; mp->mscp_buffer = (ubinfo & 0x3ffff) | (((ubinfo>>28)&0xf)<<24); if ((mp = udcmd(func == READ ? M_OP_READ : M_OP_WRITE)) == 0) { printf("ra: I/O error\n"); ubafree(io, ubinfo); return(-1); } ubafree(io, ubinfo); return(io->i_cc); } @i k;$D9/i.m.m /* mt.c 4.1 81/12/01 */ /* * TM78/TU78 tape driver */ #include "../h/mtreg.h" #include "../h/param.h" #include "../h/inode.h" #include "../h/pte.h" #include "../h/mbareg.h" #include "saio.h" #include "savax.h" short mttypes[] = { MBDT_TU78, 0 }; #define MASKREG(reg) ((reg)&0xffff) mtopen(io) register struct iob *io; { register int skip; register struct mtdevice *mtaddr = (struct mtdevice *)mbadrv(io->i_unit); int i; for (i = 0; mttypes[i]; i++) if (mttypes[i] == (mtaddr->mtdt&MBDT_TYPE)) goto found; _stop("not a tape\n"); found: mbainit(UNITTOMBA(io->i_unit)); mtaddr->mtid = MTID_CLR; DELAY(250); while ((mtaddr->mtid & MTID_RDY) == 0) ; mtstrategy(io, MT_REW); skip = io->i_boff; while (skip--) { io->i_cc = -1; mtstrategy(io, MT_SFORWF); } } mtclose(io) register struct iob *io; { mtstrategy(io, MT_REW); } mtstrategy(io, func) register struct iob *io; int func; { register int errcnt, s, ic; register struct mtdevice *mtaddr = (struct mtdevice *)mbadrv(io->i_unit); errcnt = 0; retry: if (func == READ || func == WRITE) { mtaddr->mtca = 1<<2; /* 1 record */ mtaddr->mtbc = io->i_cc; mtaddr->mter = 0; mbastart(io, func); do s = mtaddr->mter & MTER_INTCODE; while (s == 0); ic = s; DELAY(2000); } else { mtaddr->mtas = -1; mtaddr->mtncs[0] = (-io->i_cc << 8)|func|MT_GO; rwait: do s = mtaddr->mtas&0xffff; while (s == 0); mtaddr->mtas = mtaddr->mtas; /* clear attention */ ic = mtaddr->mtner & MTER_INTCODE; } switch (ic) { case MTER_TM: case MTER_EOT: case MTER_LEOT: return (0); case MTER_DONE: break; case MTER_RWDING: goto rwait; default: printf("mt hard error: er=%b\n", MASKREG(mtaddr->mter)); mtaddr->mtid = MTID_CLR; DELAY(250); while ((mtaddr->mtid & MTID_RDY) == 0) ; return (-1); case MTER_RETRY: printf("mt error: er=%b\n", MASKREG(mtaddr->mter)); if (errcnt == 10) { printf("mt: unrecovered error\n"); return (-1); } errcnt++; goto retry; } if (errcnt) printf("mt: recovered by retry\n"); return (io->i_cc); /* NO PARTIAL RECORD READS!!! */ } @i k^ EZ% fA2i2i $ p@ ^>ێPP[QP2kQQPB[TZʏxjȏj:ڮn^[k~  ^Ь[ЫlfZ_P2QPQ1kxPP@Gݭ- Z2P1ի P@2@jyPP*11P1Q1P 1D1P17~z u   l  Z1qk ^XݭZC;5 (" 1K P@, P(PxP@ЭP@x PP@ݭZx1/    1ZmPZ@d^1 19P1uP(1 P 11`P)11UPA!P01q P+115P@1)PCPB1^Ь[4P[4PЬP@.[[Zԭ1ˏ1ѭ ݭ߭PYlg5XZhiR M?@XYhPРP`P.2~2~iPݠ2~hPݠ   XhZ֭[PZP1JЬ[ЬZY1 1iPРXXh1 ZP2hQQP汫?㱫?2~2~2~iPݠ:5D( 2P4P@WWH2PY@ Ы@@@P2QxQQQPD2PiQxPP$PY`   YйP`YPLYi1P[ˏiP `L[ˏkY_ZˏiP `,ZˏjPPY^ԭ4/P@'ݏЭQP0ݏЭPݠ0PPP%P(&ЭPCЭP2ЭPЬЭPЬݏЭQPԭxPxPPPЭQЭRxQQQPa֭ѭ쏀ЭP2(ݬݬ/խЬPPQРЬP`ЬPЏXh112PP?><PP P PݭPխ)ЬPՠ ЬPPQРLXЬPՠ2ZݭнP`Pխխ<~|2~ЭPݠdZSZ[Z/%4((P@Э2PЭQxPP PX`Ш PZQШRxQQQPaZսYi1 i1?2PP?ݭYЭPРP`Pp4gPPP(Э PP?6.X$2PЭQxPPPY`2 ~2~ЭPݠ2~ЭPݠQYЭPРP`,Y1Y1g2PP ?1N <PP P PݭPխЬPՠЬPPQР12Z2~ݭнP`Pխ ЬPՠխ<~52~iPݠZ1Z[Z4PPP(Щ PZQЩ(RxQQQPaZսЭ PP2PЭQxPPPY`YЭPРP`,Yi1T[PHQPA;PA@ˀ+Q@ˀA@PA@@Ь[2 P PZЬP PYɏYYZ9ڮn^cpu type %d not configured mba%d at tr%d %d mba'suba%d at tr%d 5 uba'sdr32mcr%d at tr%d 5 mcr'smpmnexus type %x unsupported (at tr %d) not configured %s%d at %s%d slave %d %s%d at mba%d drive %d uba%s%d at uba%d csr %o zero vector didn't interrupt vec %o, ipl %x %s%d at %s%d slave %d %s%d at uba%d csr %o zero vector didn't interrupt vec %o, ipl %x X (.l Cm Sn Y[ `o ryp \ ( \ r t \ 18p >\ DKp S3 Y`p fmp s\ \ 3 p 3 3 \ V p V p W V   w 3x ?EW SV \d\ jY pwp }Y Y Z Y W $ ,z 3{ E3 M4 T3 ]4 c3 kr|3 ~ p \ p p 4 9] B] J] v  V h    W , \V k   V 't V p p p V V h 3 aV V V h ] ] ]  p + : V r t V  p   p  p  V " h \ V \ \ \ \ _ ` a b d e f g #,39BHQZbhow!,5?GRY^gmt|,%,t1t7t<(CLU`ipz$ !+54 >GPYbju z  8  P"+09rFKT]bjrz_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_swapmap_nswapmap_argmap_kernelmap_nexus_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_nummba_mba_hd_cp_time_dk_busy_dk_time_dk_seek_dk_xfer_dk_wds_dk_mspw_tk_nin_tk_nout_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_numuba_cpu_percpu_nmcr_mcraddr_cold_nexnum_dkn_mbaintv_Xmba0int_Xmba1int_Xmba2int_Xmba3int_ubaintv_Xua0int_Xua1int_Xua2int_Xua3int_uba_hd_configureL163_probenexus_Sysmap_Sysbase_setconf_memenable_printfL179_Nexmap_nxaccess_badaddr_mbafind_setscbnex_UMEMmap_umem_unifind_ubawatch_timeoutL240_mbaconfig_mbsinitL256_mbdinit_fixctlrmaskL275_ubminit_ubdinitL285_calloc_rminit_UNIvec_catcherL344_scbL348@i kW$%&i7TP6i /* udareg.h 81/10/26 1.1 */ /* * UDA-50 registers and structures */ struct udadevice { short udaip; /* initialization and polling */ short udasa; /* status and address */ }; #define UDA_ERR 0100000 /* error bit */ #define UDA_STEP4 0040000 /* step 4 has started */ #define UDA_STEP3 0020000 /* step 3 has started */ #define UDA_STEP2 0010000 /* step 2 has started */ #define UDA_STEP1 0004000 /* step 1 has started */ #define UDA_NV 0002000 /* no host settable interrupt vector */ #define UDA_QB 0001000 /* controller supports Q22 bus */ #define UDA_DI 0000400 /* controller implements diagnostics */ #define UDA_IE 0000200 /* interrupt enable */ #define UDA_PI 0000001 /* host requests adapter purge interrupts */ #define UDA_GO 0000001 /* start operation, after init */ /* * UDA Communications Area */ struct udaca { short ca_xxx1; /* unused */ char ca_xxx2; /* unused */ char ca_bdp; /* BDP to purge */ short ca_cmdint; /* command queue transition interrupt flag */ short ca_rspint; /* response queue transition interrupt flag */ long ca_rspdsc[NRSP];/* response descriptors */ long ca_cmddsc[NCMD];/* command descriptors */ }; #define ca_ringbase ca_rspdsc[0] #define UDA_OWN 0x80000000 /* UDA owns this descriptor */ #define UDA_INT 0x40000000 /* allow interrupt on ring transition */ /* * MSCP packet info */ struct mscp_header { short uda_msglen; /* length of MSCP packet */ char uda_credits; /* low 4 bits: credits, high 4 bits: msgtype */ char uda_vcid; /* virtual circuit id */ }; @i k)U$&% %&i4TP6i ((/* mscp.h 81/10/26 1.1 */ /* * Definitions for the Mass Storage Control Protocol */ /* * Control message opcodes */ #define M_OP_ABORT 0001 /* Abort command */ #define M_OP_GTCMD 0002 /* Get command status command */ #define M_OP_GTUNT 0003 /* Get unit status command */ #define M_OP_STCON 0004 /* Set controller characteristics command */ #define M_OP_SEREX 0007 /* Serious exception end message */ #define M_OP_AVAIL 0010 /* Available command */ #define M_OP_ONLIN 0011 /* Online command */ #define M_OP_STUNT 0012 /* Set unit characteristics command */ #define M_OP_DTACP 0013 /* Determine access paths command */ #define M_OP_ACCES 0020 /* Access command */ #define M_OP_CMPCD 0021 /* Compare controller data command */ #define M_OP_ERASE 0022 /* Erase command */ #define M_OP_FLUSH 0023 /* Flush command */ #define M_OP_REPLC 0024 /* Replace command */ #define M_OP_COMP 0040 /* Compare host data command */ #define M_OP_READ 0041 /* Read command */ #define M_OP_WRITE 0042 /* Write command */ #define M_OP_AVATN 0100 /* Available attention message */ #define M_OP_DUPUN 0101 /* Duplicate unit number attention message */ #define M_OP_ACPTH 0102 /* Access path attention message */ #define M_OP_END 0200 /* End message flag */ /* * Generic command modifiers */ #define M_MD_EXPRS 0100000 /* Express request */ #define M_MD_COMP 0040000 /* Compare */ #define M_MD_CLSEX 0020000 /* Clear serious exception */ #define M_MD_ERROR 0010000 /* Force error */ #define M_MD_SCCHH 0004000 /* Suppress caching (high speed) */ #define M_MD_SCCHL 0002000 /* Suppress caching (low speed) */ #define M_MD_SECOR 0001000 /* Suppress error correction */ #define M_MD_SEREC 0000400 /* Suppress error recovery */ #define M_MD_SSHDW 0000200 /* Suppress shadowing */ #define M_MD_WBKNV 0000100 /* Write back (non-volatile) */ #define M_MD_WBKVL 0000040 /* Write back (volatile) */ #define M_MD_WRSEQ 0000020 /* Write shadow set one unit at a time */ /* * AVAILABLE command modifiers */ #define M_MD_ALLCD 0000002 /* All class drivers */ #define M_MD_SPNDW 0000001 /* Spin down */ /* * FLUSH command modifiers */ #define M_MD_FLENU 0000001 /* Flush entire unit */ #define M_MD_VOLTL 0000002 /* Volatile only */ /* * GET UNIT STATUS command modifiers */ #define M_MD_NXUNT 0000001 /* Next unit */ /* * ONLINE command modifiers */ #define M_MD_RIP 0000001 /* Allow self destruction */ #define M_MD_IGNMF 0000002 /* Ignore media format error */ /* * ONLINE and SET UNIT CHARACTERISTICS command modifiers */ #define M_MD_ALTHI 0000040 /* Alter host identifier */ #define M_MD_SHDSP 0000020 /* Shadow unit specified */ #define M_MD_CLWBL 0000010 /* Clear write-back data lost */ #define M_MD_STWRP 0000004 /* Set write protect */ /* * REPLACE command modifiers */ #define M_MD_PRIMR 0000001 /* Primary replacement block */ /* * End message flags */ #define M_EF_BBLKR 0200 /* Bad block reported */ #define M_EF_BBLKU 0100 /* Bad block unreported */ #define M_EF_ERLOG 0040 /* Error log generated */ #define M_EF_SEREX 0020 /* Serious exception */ /* * Controller flags */ #define M_CF_ATTN 0200 /* Enable attention messages */ #define M_CF_MISC 0100 /* Enable miscellaneous error log messages */ #define M_CF_OTHER 0040 /* Enable other host's error log messages */ #define M_CF_THIS 0020 /* Enable this host's error log messages */ #define M_CF_MLTHS 0004 /* Multi-host */ #define M_CF_SHADW 0002 /* Shadowing */ #define M_CF_576 0001 /* 576 byte sectors */ /* * Unit flags */ #define M_UF_REPLC 0100000 /* Controller initiated bad block replacement */ #define M_UF_INACT 0040000 /* Inactive shadow set unit */ #define M_UF_WRTPH 0020000 /* Write protect (hardware) */ #define M_UF_WRTPS 0010000 /* Write protect (software or volume) */ #define M_UF_SCCHH 0004000 /* Suppress caching (high speed) */ #define M_UF_SCCHL 0002000 /* Suppress caching (low speed) */ #define M_UF_RMVBL 0000200 /* Removable media */ #define M_UF_WBKNV 0000100 /* Write back (non-volatile) */ #define M_UF_576 0000004 /* 576 byte sectors */ #define M_UF_CMPWR 0000002 /* Compare writes */ #define M_UF_CMPRD 0000001 /* Compare reads */ /* * Status codes */ #define M_ST_MASK 037 /* Status code mask */ #define M_ST_SUCC 000 /* Success */ #define M_ST_ICMD 001 /* Invalid command */ #define M_ST_ABRTD 002 /* Command aborted */ #define M_ST_OFFLN 003 /* Unit offline */ #define M_ST_AVLBL 004 /* Unit available */ #define M_ST_MFMTE 005 /* Media format error */ #define M_ST_WRTPR 006 /* Write protected */ #define M_ST_COMP 007 /* Compare error */ #define M_ST_DATA 010 /* Data error */ #define M_ST_HSTBF 011 /* Host buffer access error */ #define M_ST_CNTLR 012 /* Controller error */ #define M_ST_DRIVE 013 /* Drive error */ #define M_ST_DIAG 037 /* Message from an internal diagnostic */ typedef short quad[4]; /* a word-aligned quadword */ /* * An MSCP packet */ struct mscp { struct mscp_header mscp_header;/* device specific header */ long mscp_cmdref; /* command reference number */ short mscp_unit; /* unit number */ short mscp_xxx1; /* unused */ u_char mscp_opcode; /* opcode */ u_char mscp_flags; /* end message flags */ short mscp_modifier; /* modifiers */ union { struct { long Mscp_bytecnt; /* byte count */ long Mscp_buffer; /* buffer descriptor */ long Mscp_xxx2[2]; /* unused */ long Mscp_lbn; /* logical block number */ long Mscp_xxx4; /* unused */ long *Mscp_dscptr; /* pointer to descriptor (software) */ long Mscp_sftwds[4]; /* software words, padding */ } mscp_generic; struct { short Mscp_version; /* MSCP version */ short Mscp_cntflgs; /* controller flags */ short Mscp_hsttmo; /* host timeout */ short Mscp_usefrac; /* use fraction */ long Mscp_time; /* time and date */ } mscp_setcntchar; struct { short Mscp_multunt; /* multi-unit code */ short Mscp_unitflgs; /* unit flags */ long Mscp_hostid; /* host identifier */ quad Mscp_unitid; /* unit identifier */ long Mscp_mediaid; /* media type identifier */ short Mscp_shdwunt; /* shadow unit */ short Mscp_shdwsts; /* shadow status */ short Mscp_track; /* track size */ short Mscp_group; /* group size */ short Mscp_cylinder; /* cylinder size */ short Mscp_xxx3; /* reserved */ short Mscp_rctsize; /* RCT table size */ char Mscp_rbns; /* RBNs / track */ char Mscp_rctcpys; /* RCT copies */ } mscp_getunitsts; } mscp_un; }; /* * generic packet */ #define mscp_bytecnt mscp_un.mscp_generic.Mscp_bytecnt #define mscp_buffer mscp_un.mscp_generic.Mscp_buffer #define mscp_lbn mscp_un.mscp_generic.Mscp_lbn #define mscp_dscptr mscp_un.mscp_generic.Mscp_dscptr #define mscp_sftwds mscp_un.mscp_generic.Mscp_sftwds #define mscp_status mscp_modifier /* * Abort / Get Command Status packet */ #define mscp_outref mscp_bytecnt /* * Online / Set Unit Characteristics packet */ #define mscp_errlgfl mscp_lbn #define mscp_copyspd mscp_shdwsts /* * Replace packet */ #define mscp_rbn mscp_bytecnt /* * Set Controller Characteristics packet */ #define mscp_version mscp_un.mscp_setcntchar.Mscp_version #define mscp_cntflgs mscp_un.mscp_setcntchar.Mscp_cntflgs #define mscp_hsttmo mscp_un.mscp_setcntchar.Mscp_hsttmo #define mscp_usefrac mscp_un.mscp_setcntchar.Mscp_usefrac #define mscp_time mscp_un.mscp_setcntchar.Mscp_time /* * Get Unit Status end packet */ #define mscp_multunt mscp_un.mscp_getunitsts.Mscp_multunt #define mscp_unitflgs mscp_un.mscp_getunitsts.Mscp_unitflgs #define mscp_hostid mscp_un.mscp_getunitsts.Mscp_hostid #define mscp_unitid mscp_un.mscp_getunitsts.Mscp_unitid #define mscp_mediaid mscp_un.mscp_getunitsts.Mscp_mediaid #define mscp_shdwunt mscp_un.mscp_getunitsts.Mscp_shdwunt #define mscp_shdwsts mscp_un.mscp_getunitsts.Mscp_shdwsts #define mscp_track mscp_un.mscp_getunitsts.Mscp_track #define mscp_group mscp_un.mscp_getunitsts.Mscp_group #define mscp_cylinder mscp_un.mscp_getunitsts.Mscp_cylinder #define mscp_rctsize mscp_un.mscp_getunitsts.Mscp_rctsize #define mscp_rbns mscp_un.mscp_getunitsts.Mscp_rbns #define mscp_rctcpys mscp_un.mscp_getunitsts.Mscp_rctcpys /* * Online / Set Unit Characteristics end packet */ #define mscp_untsize mscp_dscptr #define mscp_volser mscp_sftwds[0] /* * Set Controller Characteristics end packet */ #define mscp_cnttmo mscp_hsttmo #define mscp_cntcmdl mscp_usefrac #define mscp_cntid mscp_unitid /* * Error Log message format codes */ #define M_FM_CNTERR 0 /* Controller error */ #define M_FM_BUSADDR 1 /* Host memory access error */ #define M_FM_DISKTRN 2 /* Disk transfer error */ #define M_FM_SDI 3 /* SDI error */ #define M_FM_SMLDSK 4 /* Small disk error */ /* * Error Log message flags */ #define M_LF_SUCC 0200 /* Operation successful */ #define M_LF_CONT 0100 /* Operation continuing */ #define M_LF_SQNRS 0001 /* Sequence number reset */ /* * MSCP Error Log packet * * NOTE: MSCP packet must be padded to this size. */ struct mslg { struct mscp_header mslg_header;/* device specific header */ long mslg_cmdref; /* command reference number */ short mslg_unit; /* unit number */ short mslg_seqnum; /* sequence number */ u_char mslg_format; /* format */ u_char mslg_flags; /* error log message flags */ short mslg_event; /* event code */ quad mslg_cntid; /* controller id */ u_char mslg_cntsvr; /* controller software version */ u_char mslg_cnthvr; /* controller hardware version */ short mslg_multunt; /* multi-unit code */ quad mslg_unitid; /* unit id */ u_char mslg_unitsvr; /* unit software version */ u_char mslg_unithvr; /* unit hardware version */ short mslg_group; /* group */ long mslg_volser; /* volume serial number */ long mslg_cylinder; /* cylinder */ short mslg_track; /* track */ short mslg_sector; /* sector */ long mslg_lbn; /* logical block number */ u_char mslg_level; /* level */ u_char mslg_retry; /* retry */ }; #define mslg_busaddr mslg_unitid #define mslg_sdecyl mslg_group ((@i k$&$&i}j}j /* mtreg.h 4.1 81/11/11 */ struct mtdevice { int mtcs; /* control status register */ int mter; /* error register */ int mtca; /* command address, rec cnt, skp cnt reg */ int mtmr1; /* maintenance register */ int mtas; /* attention summary register */ int mtbc; /* byte count register */ int mtdt; /* drive type register */ int mtds; /* drive status register */ int mtsn; /* serial number register */ int mtmr2; /* maintenance register */ int mtmr3; /* maintenance register */ int mtner; /* non-data transfer error register */ int mtncs[4]; /* non-data transfer command registers */ int mtia; /* internal address */ int mtid; /* internal data */ }; /* mtcs */ #define MT_GO 000001 /* go bit */ #define MT_NOOP 000002 /* no operation */ #define MT_UNLOAD 000004 /* unload tape */ #define MT_REW 000006 /* rewind */ #define MT_SENSE 000010 /* sense */ #define MT_DSE 000012 /* data security erase */ #define MT_WTMPE 000014 /* write phase encoded tape mark */ #define MT_WTM MT_WTMPE /* generic write tape mark */ #define MT_WTMGCR 000016 /* write GCR tape mark */ #define MT_SFORW 000020 /* space forward record */ #define MT_SREV 000022 /* space reverse record */ #define MT_SFORWF 000024 /* space forward file */ #define MT_SREVF 000026 /* space reverse file */ #define MT_SFORWE 000030 /* space forward either */ #define MT_SREVE 000032 /* space reverse either */ #define MT_ERGPE 000034 /* erase tape, set PE */ #define MT_ERASE MT_ERGPE /* generic erase tape */ #define MT_ERGGCR 000036 /* erase tape, set GCR */ #define MT_CLSPE 000040 /* close file PE */ #define MT_CLS MT_CLSPE /* generic close file */ #define MT_CLSGCR 000042 /* close file GCR */ #define MT_SLEOT 000044 /* space to logical EOT */ #define MT_SFLEOT 000046 /* space forward file, stop on LEOT */ #define MT_WCHFWD 000050 /* write check forward */ #define MT_WCHREV 000056 /* write check reverse */ #define MT_WRITEPE 000060 /* write phase encoded */ #define MT_WRITE MT_WRITEPE /* generic write */ #define MT_WRITEGCR 000062 /* write group coded */ #define MT_READ 000070 /* read forward */ #define MT_EXSNS 000072 /* read extended sense error log */ #define MT_READREV 000076 /* read reverse */ #define MT_GCR 000002 /* make generic ops GCR ops */ /* mtds */ #define MTDS_RDY 0100000 /* tape ready */ #define MTDS_PRES 0040000 /* tape unit has power */ #define MTDS_ONL 0020000 /* online */ #define MTDS_REW 0010000 /* tape rewinding */ #define MTDS_PE 0004000 /* tape set for phase encoded */ #define MTDS_BOT 0002000 /* tape at BOT */ #define MTDS_EOT 0001000 /* tape at EOT */ #define MTDS_FPT 0000400 /* write protected */ #define MTDS_AVAIL 0000200 /* unit available */ #define MTDS_SHR 0000100 /* unit is shared */ #define MTDS_MAINT 0000040 /* maintenance mode */ #define MTDS_DSE 0000020 /* DSE in progress */ #define MTDS_BITS \ "\10\20RDY\17PRES\16ONL\15REW\14PE\13BOT\12EOT\11FPT\10AVAIL\ \7SHR\6MAINT\5DSE" /* mter */ #define MTER_INTCODE 0377 /* mask for interrupt code */ /* interrupt codes */ #define MTER_DONE 001 /* operation complete */ #define MTER_TM 002 /* unexpected tape mark */ #define MTER_BOT 003 /* unexpected BOT detected */ #define MTER_EOT 004 /* tape positioned beyond EOT */ #define MTER_LEOT 005 /* unexpected LEOT detected */ #define MTER_NOOP 006 /* no-op completed */ #define MTER_RWDING 007 /* rewinding */ #define MTER_FPT 010 /* write protect error */ #define MTER_NOTRDY 011 /* not ready */ #define MTER_NOTAVL 012 /* not available */ #define MTER_OFFLINE 013 /* offline */ #define MTER_NONEX 014 /* unit does not exist */ #define MTER_NOTCAP 015 /* not capable */ #define MTER_ONLINE 017 /* tape came online */ #define MTER_LONGREC 020 /* long tape record */ #define MTER_SHRTREC 021 /* short tape record */ #define MTER_RETRY 022 /* retry */ #define MTER_RDOPP 023 /* read opposite */ #define MTER_UNREAD 024 /* unreadable */ #define MTER_ERROR 025 /* error */ #define MTER_EOTERR 026 /* EOT error */ #define MTER_BADTAPE 027 /* tape position lost */ #define MTER_TMFLTA 030 /* TM fault A */ #define MTER_TUFLTA 031 /* TU fault A */ #define MTER_TMFLTB 032 /* TM fault B */ #define MTER_MBFLT 034 /* Massbus fault */ #define MTER_KEYFAIL 077 /* keypad entry error */ /* mtdt */ #define MTDT_NSA 0100000 /* not sector addressed; always 1 */ #define MTDT_TAP 0040000 /* tape; always 1 */ #define MTDT_MOH 0020000 /* moving head; always 0 */ #define MTDT_7CH 0010000 /* 7 channel; always 0 */ #define MTDT_DRQ 0004000 /* drive request required */ #define MTDT_SPR 0002000 /* slave present; always 1 ??? */ /* bit 9 is spare */ /* bits 8-0 are formatter/transport type */ /* mtid */ #define MTID_RDY 0100000 /* controller ready */ #define MTID_CLR 0040000 /* controller clear */ #define b_repcnt b_bcount #define b_command b_resid @i k1[,>0t&2i 8i 8i #include "../h/param.h" #include "../h/pte.h" #include "../h/buf.h" #include "../h/map.h" #include "../h/mbavar.h" #include "../h/vm.h" #include "../h/ubavar.h" #define C (caddr_t) extern struct mba_driver hpdriver; extern struct mba_driver hpdriver; extern struct mba_driver hpdriver; extern struct mba_driver hpdriver; extern struct mba_driver htdriver; extern struct mba_driver mtdriver; struct mba_device mbdinit[] = { /* Device, Unit, Mba, Drive, Dk */ { &hpdriver, 0, '?', 0, 1 }, { &hpdriver, 1, '?', '?', 1 }, { &hpdriver, 2, '?', '?', 1 }, { &hpdriver, 3, '?', '?', 1 }, { &htdriver, 0, '?', '?', 0 }, { &mtdriver, 0, '?', '?', 0 }, 0 }; struct mba_slave mbsinit [] = { /* Driver, Ctlr, Unit, Slave */ { &htdriver, 0, 0, 0 }, { &htdriver, 0, 1, 1 }, { &mtdriver, 0, 0, 0 }, { &mtdriver, 0, 1, 1 }, 0 }; extern struct uba_driver hkdriver; extern Xrkintr0(); int (*hkint0[])() = { Xrkintr0, 0 } ; extern struct uba_driver lpdriver; extern Xlpintr0(); int (*lpint0[])() = { Xlpintr0, 0 } ; extern struct uba_driver tmdriver; extern Xtmintr0(); int (*tmint0[])() = { Xtmintr0, 0 } ; extern struct uba_driver scdriver; extern Xupintr0(); int (*scint0[])() = { Xupintr0, 0 } ; extern struct uba_driver udadriver; extern Xudintr0(); int (*udaint0[])() = { Xudintr0, 0 } ; extern struct uba_driver dndriver; extern Xdnintr0(); int (*dnint0[])() = { Xdnintr0, 0 } ; extern struct uba_driver dhdriver; extern Xdhrint0(), Xdhxint0(); int (*dhint0[])() = { Xdhrint0, Xdhxint0, 0 } ; extern struct uba_driver dhdriver; extern Xdhrint1(), Xdhxint1(); int (*dhint1[])() = { Xdhrint1, Xdhxint1, 0 } ; extern struct uba_driver dzdriver; extern Xdzrint0(), Xdzxint0(); int (*dzint0[])() = { Xdzrint0, Xdzxint0, 0 } ; extern struct uba_driver dzdriver; extern Xdzrint1(), Xdzxint1(); int (*dzint1[])() = { Xdzrint1, Xdzxint1, 0 } ; extern struct uba_driver dzdriver; extern Xdzrint2(), Xdzxint2(); int (*dzint2[])() = { Xdzrint2, Xdzxint2, 0 } ; extern struct uba_driver dzdriver; extern Xdzrint3(), Xdzxint3(); int (*dzint3[])() = { Xdzrint3, Xdzxint3, 0 } ; extern struct uba_driver dzdriver; extern Xdzrint4(), Xdzxint4(); int (*dzint4[])() = { Xdzrint4, Xdzxint4, 0 } ; extern struct uba_driver dzdriver; extern Xdzrint5(), Xdzxint5(); int (*dzint5[])() = { Xdzrint5, Xdzxint5, 0 } ; extern struct uba_driver dzdriver; extern Xdzrint6(), Xdzxint6(); int (*dzint6[])() = { Xdzrint6, Xdzxint6, 0 } ; extern struct uba_driver dzdriver; extern Xdzrint7(), Xdzxint7(); int (*dzint7[])() = { Xdzrint7, Xdzxint7, 0 } ; extern struct uba_driver zsdriver; extern Xtsintr0(); int (*zsint0[])() = { Xtsintr0, 0 } ; struct uba_ctlr ubminit[] = { /* driver, ctlr, ubanum, alive, intr, addr */ { &hkdriver, 0, '?', 0, hkint0, C 0177440 }, { &tmdriver, 0, '?', 0, tmint0, C 0172520 }, { &scdriver, 0, '?', 0, scint0, C 0176700 }, { &udadriver, 0, '?', 0, udaint0, C 0177550 }, { &zsdriver, 0, '?', 0, zsint0, C 0172520 }, 0 }; struct uba_device ubdinit[] = { /* driver, unit, ct((lr, ubanum, slave, intr, addr, dk, flags*/ { &hkdriver, 0, 0, '?', 0, 0, C 00 , 1, 0x0 }, { &hkdriver, 1, 0, '?', 1, 0, C 00 , 1, 0x0 }, { &lpdriver, 0, -1, '?', -1, lpint0, C 0177514, 0, 0x0 }, { &tmdriver, 0, 0, '?', 0, 0, C 00 , 0, 0x0 }, { &tmdriver, 1, 0, '?', 1, 0, C 00 , 0, 0x0 }, { &scdriver, 0, 0, '?', 0, 0, C 00 , 1, 0x0 }, { &scdriver, 1, 0, '?', 1, 0, C 00 , 1, 0x0 }, { &udadriver, 0, 0, '?', 0, 0, C 00 , 1, 0x0 }, { &udadriver, 1, 0, '?', 1, 0, C 00 , 1, 0x0 }, { &dndriver, 0, -1, '?', -1, dnint0, C 0160020, 0, 0x0 }, { &dhdriver, 0, -1, '?', -1, dhint0, C 0160020, 0, 0x0 }, { &dhdriver, 1, -1, '?', -1, dhint1, C 0160040, 0, 0x0 }, { &dzdriver, 0, -1, '?', -1, dzint0, C 0160100, 0, 0xff }, { &dzdriver, 1, -1, '?', -1, dzint1, C 0160110, 0, 0xff }, { &dzdriver, 2, -1, '?', -1, dzint2, C 0160120, 0, 0xff }, { &dzdriver, 3, -1, '?', -1, dzint3, C 0160130, 0, 0xff }, { &dzdriver, 4, -1, '?', -1, dzint4, C 0160140, 0, 0xff }, { &dzdriver, 5, -1, '?', -1, dzint5, C 0160150, 0, 0xff }, { &dzdriver, 6, -1, '?', -1, dzint6, C 0160160, 0, 0xff }, { &dzdriver, 7, -1, '?', -1, dzint7, C 0160170, 0, 0xff }, { &zsdriver, 0, 0, '?', 0, 0, C 00 , 0, 0x0 }, 0 }; @i ky~$+2i @i k|~nT+2i `Ь[xPx QQPPYZ[PxZQQP<`PxPP[QxZRRQ<QQPXYXZPYXX ZZ~P '/5@,ISZ^_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_isbadL29@i kEb|_+2i X PЬYi2XXiPЬPPQ2QAЬYiXXiP^ZxZPPYZ IWMŏ`ZPPP[<-#ЧXX4$ԫ(<PP2P@1Lx&PP~2~ 2QPA2Pˏ@P2QPAxYPPPPP@0hxYPPݭPڎ<$[F FGȫ:Z2~[2~AP(PP` Zŏ`ZP@S[[AP(PP`ZPxPPЫ4Q2 RPRR << Z[Pď`P@[[AP(PP`Pď`P@[[AP(P P`^ԭЬP@WЧYxPď`PPPX1[l1ZPď`PXP[< Z(2:Pʏ?PPX2:Pʏ?PP@DZխݬ Z :ZTZ[ZAP(PP`2Z1q Zŏ`ZP@[ݬ ݬ[AP(PP`PPݬݬ ݬ[PѬ t Ѭ t ZaЬPPxtPA+ZPxPPЫ4Q2 RPRR ZPxPPЫ4Q2 RPRZ ^Ь[ŏ`[P@ZЪ4YPP[Pȏ@0PPiF<[GPx PPFQxQQQPXF ȏ@X : PXX: XGXXݭPڎ ^ЬP@TYЩZjjݬ3ЬP>@(2P< QQPPxPPXj12PPP2QPQ1ŏ`XP@[ <<<?XPȏ@0PPj2PQQ@P<QPQQ<~[~A[AP(P P` [X2PPPP1L^Ь[28PPWxWXWWЫ4ZPP!<1@<@GPPPЫQ2@PQP&@<ի,[~ݫ, [~ի| : Pz[~PVV\HP2PQQ@YxYPʏPWPȏ@0PPjxWPPHfYVPP <ݭPڎݏ[~7PV[~'PVVPP~[ <Ь[Ы4ZPPX <&28PPYYPȏ@0PPj<<XPڎ^ЬP@ЬP@ݬxPP~~ݬtЬQPAhЬPˏ@XPЬQPAK[[K@Xwr2PPh[@0ШPx[Zԭŏ`ZP@Y<#ZZ ~2>~Y<<`hX 2H dh%d: silo overflow dh%d: NXM dh%ddhdm,C e8 tO D O O G 2 1 Q G G H 'F :F VR q| D  X D  8D H a8 D _ ((`  9D O nc O D >8 ` B %D O1 ZH ug   i )_ Gj U8 `1 kH B j k l m NG \G fr o2 ~1 Q G G H 8 ` D +GUvD = C v  = = D _ z  ) { 6 { D |  8 08@DH=  $H+(1x7> G PYckv{,ttt( '.8AJR\enwX \   2H)0; A HOZafkpuL}^ (R (  %-2;@IOU^gotB}Lz _bdevsw_cdevsw_linesw_swdevt_zdmap_zvmsU_ARGU_QSAV_tthiwat_ttlowat_swapmap_nswapmap_argmap_kernelmap_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_numuba_cfree_nclist_cfreelist_cfreecount_file_fileNFILE_nfile_dhinfo_dhstd_dhdriver_dhprobe_dhattach_dminfo_dmstd_dmdriver_dmprobe_dmattach_dhsar_dhsoftCAR_dh11_ndh11_dhact_dh_ubinfo_cbaseL129L135L139L145_dhopenL150_u_dhstart_uballoc_ttychars_dhparam_dmopen_dhcloseL167_dmctl_ttyclose_dhreadL175_dhwriteL180_dhrintL184_wakeup_printf_dhioctlL202_ttioctlL219_dhxintL230_ndflushL245_mcstart_ndqb_getc_ttrstrt_timeout_dhstopL264_dhresetL271_ubarelse_dhtimerL287L294_sleepL305_dmintrL317_ttstart_gsignal_flushtty@i k6| MS+2i 0[$ԫ(<[< :< ێPɏ@P~ ڮn^"ێPɏ@P~"ڮn^[2~AP(PP`r[[AP(PP`[UL[[AP(PP`.[[AP(P P` !ێPP[ӏ[ [ZZ[AP(PP`[ݬ ݬ[AP(PP`PPݬݬ ݬ[PQ~|[  G PT^gox )1:AJS[emx}` , v$)16?GMV_gl_bdevsw_cdevsw_linesw_swdevt_zdmap_zvmsU_ARGU_QSAV_tthiwat_ttlowat_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_cpu_percpu_cons_partab_cnopenL85_cnstart_ttychars_u_cncloseL95_ttyclose_cnreadL101_cnwriteL106_cnrintL111_cnrfl_cnioctlL119_consdone_ttioctl_cnxintL128_conxflL136_mcstart_wakeup_getc_ttrstrt_timeout_cnputcL158@i k +%p0yt /iݡݡ 0( Ь[ԫ`PPPPXPd2lp[h[p[ZPPQxQQQPQxQPPZj Ъ Z~[~ ^Ь[kj]rX[k/[ZjZj/jjݬ[gP8ݬP0jZ[[Pݬ<~kЭP^Ь[Ь[Yլ 1eѬ ЬZJЭPԭ xѬ ­׭խխ ݬ1jí P@ݬ1Q֭ѭЭP@\CxPXPdx P@Ah2l[0x P@$ЭPЭ@x P@ έPxPPPZJ1|ݬ1 ^Ь[լ1[Y<PʏPP@ 10 12ԭd֭ѭ@>ЭP֭P[pPPXPdp[h2l[Mp[ZԭZ~ݬPLra: open error, STCONra: open error, ONLINra: bad unitra: I/O error  &/5 = B J R Y ` fl   ! 2 ;Ubi t            `kr ~    (08@HpPX]hqy }| _devsw_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_udastd_cudbuf_udaddr_uda_ud_ubaddr_uda_off_udopenL29_ubasetup_udcmd__stopL51_udstrategyL62_printf_ubafree@i k:ͣ/iZߡZߡ Hڬ۬P(  #_mtprL13_mfprL18_bcopyL23@i ke/i*ޡ*ޡ ^Ь[xTPxPPP`PˏTQxQQQPYԭЭPˏQ2@PPQ֭ЭP@xT~ i[JЫXZ(l[5PЏXX[ZPZPЬ[[^Ь[xTPxPPP`PˏTQxQQQPWY2ZW gZ$ΫlѬ gPѬѬݬ[gWЧXЧX gXX gPˏ~ˏX~t]Y KPY[1@Y &2PlP Ь[ЫZZ()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry  H\dk x  G W{     (08@IQU\eqz~ _devsw_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_httypes_htopenL23__stop_mbainit_htstrategy_htcloseL43L47_htquiet_mbastart_printfL68((@i kڴ /iޡޡ ,0^Ь[ЫTZxZPxPPP`PZQxQQQPxT~J>ЭPˏXW2G'PPXWGhWJJP P@YիXѫX ЫXP@ ;AЫXP2@P2QQPPX^Ь[ЫTЫdxPxPP P`PQxQQQPPЭQA`P P@pЭPӏ@ ЭP2$ЭPЭQ2PPQЭP2PPQRPRRQЭPЭQ2aQQPЭQ2aQQPRQRRPЭPЭ(xPPЭQPݬ[HЭPӏӏ@@ЭPˏ~HЭPˏ~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ь[xTPxPP)P QQ`WЫTYXWxYZ[PΫlPPѬZP)ѬZPѬ  ZPPPɬZPPP<ݭ[5Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error @i! kL&i[6i ! ! BOOTSTRAP ANY DEVICE TO A SINGLE USER SHELL ! SET DEF HEX SET DEF LONG SET REL:0 HALT UNJAM INIT LOAD BOOT D R11 3 ! 3=RB_ASKNAME+RB_SINGLE ! R10 NICHTS ! DEVICE CHOICE ISNT APPLICABLE START 2 @i# kەL&i[6i ! ! BOOTSTRAP ON RP, LEAVING SINGLE USER ! SET DEF HEX SET DEF LONG SET REL:0 HALT UNJAM INIT LOAD BOOT D R10 0 ! DEVICE CHOICE 0=HP D R11 2 ! 2= RB_SINGLE START 2 @i% kL&i[6i ! ! BOOTSTRAP ON RP, GOING MULTI USER ! SET DEF HEX SET DEF LONG SET REL:0 HALT UNJAM INIT LOAD BOOT D R10 0 ! DEVICE CHOICE 0=HP D R11 0 ! 0= AUTOBOOT START 2 @i' kL&i[6i ! RESTART COMMMAND FILE SET DEF HEX SET DEF LONG SET REL:0 HALT ! HALT PROCESSOR UNJAM ! UNJAM SBI INIT ! INITIALIZE PROCESSOR D PC C00 D PSL 0 C @i) kݕL&i[6i ((! ! BOOTSTRAP ON UP, LEAVING SINGLE USER ! SET DEF HEX SET DEF LONG SET REL:0 HALT UNJAM INIT LOAD BOOT D R10 2 ! DEVICE CHOICE 2=UP D R11 2 ! 2= RB_SINGLE START 2 @i+ k=0S! &iT6i HALT ! HALT PROCESSOR UNJAM ! UNJAM SBI DEPOSIT 50000 20009FDE DEPOSIT+ D0512001 DEPOSIT+ 3204A101 DEPOSIT+ C113C08F DEPOSIT+ A1D40424 DEPOSIT+ 008FD00C DEPOSIT+ C1800000 DEPOSIT+ 8F320800 DEPOSIT+ 10A1FE00 DEPOSIT+ 00C139D0 DEPOSIT+ 0004 START 50000 WAIT DONE START 0 @i- kL &i[6i ! ! BOOTSTRAP ON UP, GOING MULTI USER ! SET DEF HEX S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PxPP=P QQ`WЫTYXWxYZ[PΫlPPѬZP)ѬZPѬ  ZPPPɬZPPP<ݭ[5PxPP2PP QP P@P˶pP  ˏTPP =PիXѫXЫXP@o  ЫXP@P X^?<<%ȏֵȏϵ2 ﹵ﱵﭵ掠冀ЭPɏQ PPQ ЭPPЭP ^Ь[[PZЫd ˏTPPЫlPQxQQQPѬ!P"PPPZ ݭ[bPݭ[RЫlP ^Ь[ԭZk96 PQPQ0QZ[[kPP P P+P-k0ZέPЭPЬZЬY[ [[ ЬZЬY[ Y[[ ЬPЬRRQ{RPRPPPRRPЬPЬRRQ{RPPR PRPP:PЬSRbcPRbr  &0^n1/dev/rmt8\/ tapeTape? Disk? Last chance before scribbling on %s. diskMissing volume record Tape is not volume %d Missing header block End of tape Unknown header type Resynced at inode %u %u: ilist too small Missing address (header) block Tape read error: inode %u Mount volume %d Cannot open tape! Not a dump tape.Try again Wrong tape. Try again disk write error %D read error %D Out of space Checksum error %o @(#)restor.c 4.3 (Berkeley) 6/3/81null path %s not found bn negative bn ovf %D bn void %D bn void %D not a directory zero length directory Seek not from beginning of file No more file slotsBad device Unknown device Bad unit specifier Missing offset specification Can't write files yet.. Sorry Exit called%s Trap %o 3X3p^3F 3%D%t% 3#H#3(&'3<*l)**3~-|+hphtuptmhktsmtra&vd62M2R%s1 JTJ2" 7H3 `7X3/83/h3832 @vx3unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry DR2 `75 @75up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPE0123456789abcdef`       @ ` ` rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry Pte error: er=%bILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOTts: unrecovered error ts: recovered by retry Anot a tape mt hard error: er=%b mt error: er=%b mt: unrecovered error mt: recovered by retry h >Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error @iZ kXԤ9|&iDD Џ^.PԀP^8!E0^._q RqE.߭j ߭P_9߭{PH9F9P29Ԭ)91ԭԭ:ѭ0ѭ9VE>.A P0QQP֭(EPЭQA`ЭAѭ2PP@x~--8Ѭ\ЬPݠ E,P-ЬPݠ0,Pi-P P 2S-Q- I-@-;-5-D&-D--`-8<6@PP2@'<&@PP~@?- CCԭ7PЭQA`7ݭ'nC֭ЭP~~PͤQA`͜͜0͜7">͜+B͜0͜PͤQQQxQPPЭP֭P[pPPXPdp[h2l[-p[ZԭZ~ݬPЭPˏXW2GPPXWG|WJJP P@cYիXѫX ЫXP@ sЫXP2@P2QQPPX^Ь[ЫTЫdxPxPPIQP`PQxQQQPgPЭQA`P P@ЭPӏ@ ЭP2$ЭPЭQ2PPQЭP2PPQRPRRQЭPЭQ2aQQPЭQ2aQQPRQRRPЭPЭ(xPPЭQPݬ[XЭPӏӏ@@ЭPˏ~ЭPˏ~ݭݭݭ_PP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%PPZ14ЭP@φ% \ ZYЭPPQAR%@f%PPZZݭϒPZY1[ZP1&ЭPPQA%@,%PPZZY2ZYk[&ZYPPP~[SPkPP[ZZP 1[ZjP1ZY1Ь[ЬZKϟ$Y YKϫ$PP Ь[PZZ Ь Pլ PP }P PPt[ n0[~"Ь[ϖ~ k  *[ЬZm-Hf a\ Z >ZZ)!G"QH"YX"ap"j|"s"{"""""""(#8#H#p#7%%& &0&<&yD(D("~<!r,*,-,0 .7 .> .I cX.O .X 0` "1h 2p  2v $2{ (2 y,2 z02 "82 p84 <4 @4 BD4 H4 L4 dP4 T4  , -X4 U\4 ]`4 h4 <x4 x6 Ix9 x< |< e<,! )<( <0 e<6 f<< <B J<I7,Q >X,` @j @q,x }@ A A (A  vfork() { fork1(1); } vread() { vrdwr(FREAD); } vwrite() { vrdwr(FWRITE); } resuba() { if (suser()) ubareset(u.u_arg[0]); } futz() { } segalloc() { u.u_error = EIO; } segfree() { u.u_error = EIO; } segsync() { u.u_error = EIO; } int both; vadvise() { register struct a { int anom; } *uap; register struct proc *rp = u.u_procp; int oanom = rp->p_flag & SUANOM; register struct pte *pte; register struct cmap *c; register int i; uap = (struct a *)u.u_ap; #ifdef TRACE trace(TR_VADVISE, uap->anom, u.u_procp->p_pid); #endif rp->p_flag &= ~(SSEQL|SUANOM); switch (uap->anom) { case VA_ANOM: rp->p_flag |= SUANOM; break; case VA_SEQL: rp->p_flag |= SSEQL; break; } if (both || (oanom && (rp->p_flag & SUANOM) == 0)) { for (i = 0; i < rp->p_dsize; i += CLSIZE) { pte = dptopte(rp, i); if (pte->pg_v) { c = &cmap[pgtocm(pte->pg_pfnum)]; if (c->c_lock) continue; pte->pg_v = 0; if (anycl(pte, pg_m)) pte->pg_m = 1; distcl(pte); } } mtpr(TBIA, 0); } } vtimes() { register struct a { struct vtimes *par_vm; struct vtimes *ch_vm; } *uap = (struct a *)u.u_ap; if (uap->par_vm == 0) goto onlych; if (copyout((caddr_t)&u.u_vm, (caddr_t)uap->par_vm, sizeof(struct vtimes)) < 0) u.u_error = EFAULT; onlych: if (uap->ch_vm == 0) return; if (copyout((caddr_t)&u.u_cvm, (caddr_t)uap->ch_vm, sizeof(struct vtimes)) < 0) u.u_error = EFAULT; } vmsadd(vp, wp) register struct vtimes *vp, *wp; { vp->vm_utime += wp->vm_utime; vp->vm_stime += wp->vm_stime; vp->vm_nswap += wp->vm_nswap; vp->vm_idsrss += wp->vm_idsrss; vp->vm_ixrss += wp->vm_ixrss; if (vp->vm_maxrss < wp->vm_maxrss) vp->vm_maxrss = wp->vm_maxrss; vp->vm_majflt += wp->vm_majflt; vp->vm_minflt += wp->vm_minflt; vp->vm_inblk += wp->vm_inblk; vp->vm_oublk += wp->vm_oublk; } /* * Revoke access the current tty by all processes. * Used only by the super-user in init * to give ``clean'' terminals at login. */ vhangup() { if (!suser()) return; if (u.u_ttyp == NULL) return; forceclose(u.u_ttyd); if ((u.u_ttyp->t_state) & ISOPEN) gsignal(u.u_ttyp->t_pgrp, SIGHUP); } forceclose(dev) dev_t dev; { register struct file *fp; register struct inode *ip; register int n = 0; for (fp = &file[0]; fp < fileNFILE; fp++) { if (fp->f_count==0) continue; ip = fp->f_inode; if ((ip->i_mode & IFMT) != IFCHR) continue; if (ip->i_un.i_rdev != dev) continue; fp->f_flag &= ~(FREAD|FWRITE); n++; } return (n); } /* * Affect per-process limits. * To just return old limit, specify negative new limit. */ vlimit() { register struct a { unsigned which; int limit; } *uap; uap = (struct a *)u.u_ap; if (uap->which > NLIMITS) { u.u_error = EINVAL; return; } u.u_r.r_val1 = u.u_limit[uap->which]; if (uap->limit < 0) return; switch (uap->which) { case LIM_DATA: if (uap->limit > ctob(MAXDSIZ)) uap->limit = ctob(MAXDSIZ); break; case LIM_STACK: if (uap->limit > ctob(MAXSSIZ)) uap->limit = ctob(MAXSSIZ); break; } if (u.u_limit[LIM_NORAISE] && uap->limit > u.u_limit[uap->which] && !suser()) { u.u_error = EACCES; return; } u.u_limit[uap->which] = uap->limit; if (uap->which == LIM_MAXRSS) u.u_procp->p_maxrss = uap->limit/NBPG; } #ifdef TRACE int nvualarm; vtrace() { register struct a { int request; int value; } *uap; int vdoualarm(); uap = (struct a *)u.u_ap; switch (uap->request) { case VTR_DISABLE: /* disable a trace point */ case VTR_ENABLE: /* enable a trace point */ if (uap->value < 0 || uap->value >= TR_NFLAGS) u.u_error = EINVAL; else { u.u_r.r_val1 = traceflags[uap->value]; traceflags[uap->value] = uap->request; } break; case VTR_VALUE: /* return a trace point setting */ if (uap->value < 0 || uap->value >= TR_NFLAGS) u.u_error = EINVAL; else u.u_r.r_val1 = traceflags[uap->value]; break; case VTR_UALARM: /* set a real-time ualarm, less than 1 min */ if (uap->value <= 0 || uap->value > 60 * hz || nvualarm > 5) u.u_error = EINVAL; else { nvualarm++; timeout(vdoualarm, (caddr_t)u.u_procp->p_pid, uap->value); } break; case VTR_STAMP: trace(TR_STAMP, uap->value, 0); break; } } vdoualarm(arg) int arg; { register struct proc *p; p = pfind(arg); if (p) psignal(p, 16); nvualarm--; } #endif ((@i k-$1+.147:T2i㼪6i /* vmswap.c 4.3 81/06/11 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/text.h" #include "../h/map.h" #include "../h/buf.h" #include "../h/pte.h" #include "../h/mtpr.h" #include "../h/cmap.h" #include "../h/vm.h" /* * Swap a process in. */ swapin(p) register struct proc *p; { register struct text *xp; register int i, s; if (xp = p->p_textp) xlock(xp); p->p_szpt = clrnd(ctopt(p->p_ssize+p->p_dsize+p->p_tsize+UPAGES)); if (vgetpt(p, memall) == 0) goto nomem; if (vgetu(p, memall, Swapmap, &swaputl, (struct user *)0) == 0) { vrelpt(p); goto nomem; } swdspt(p, &swaputl, B_READ); /* * Make sure swdspt didn't smash u. pte's */ for (i = 0; i < UPAGES; i++) { if (Swapmap[i].pg_pfnum != p->p_addr[i].pg_pfnum) panic("swapin"); } vrelswu(p, &swaputl); if (xp) { xlink(p); xunlock(xp); } p->p_rssize = 0; s = spl6(); if (p->p_stat == SRUN) setrq(p); p->p_flag |= SLOAD; if (p->p_flag & SSWAP) { swaputl.u_pcb.pcb_sswap = u.u_ssav; p->p_flag &= ~SSWAP; } splx(s); p->p_time = 0; multprog++; cnt.v_swpin++; return (1); nomem: if (xp) xunlock(xp); return (0); } int xswapwant, xswaplock; /* * Swap out process p. * ds and ss are the old data size and the stack size * of the process, and are supplied during page table * expansion swaps. */ swapout(p, ds, ss) register struct proc *p; size_t ds, ss; { register struct pte *map; register struct user *utl; register int a; int s; int rc = 1; s = 1; map = Xswapmap; utl = &xswaputl; if (xswaplock & s) if ((xswaplock & 2) == 0) { s = 2; map = Xswap2map; utl = &xswap2utl; } a = spl6(); while (xswaplock & s) { xswapwant |= s; sleep((caddr_t)map, PSWP); } xswaplock |= s; splx(a); uaccess(p, map, utl); if (vgetswu(p, utl) == 0) { swkill(p, "swapout"); rc = 0; goto out; } utl->u_vm.vm_nswap++; utl->u_odsize = ds; utl->u_ossize = ss; p->p_flag |= SLOCK; if (p->p_textp) { if (p->p_textp->x_ccount == 1) p->p_textp->x_swrss = p->p_textp->x_rssize; xccdec(p->p_textp, p); } p->p_swrss = p->p_rssize; vsswap(p, dptopte(p, 0), CDATA, 0, ds, &utl->u_dmap); vsswap(p, sptopte(p, CLSIZE-1), CSTACK, 0, ss, &utl->u_smap); if (p->p_rssize != 0) panic("swapout rssize"); swdspt(p, utl, B_WRITE); vrelu(p, 1); if ((p->p_flag & SLOAD) && (p->p_stat != SRUN || p != u.u_procp)) panic("swapout"); p->p_flag &= ~SLOAD; vrelpt(p); p->p_flag &= ~SLOCK; p->p_time = 0; multprog--; cnt.v_swpout++; if(runout) { runout = 0; wakeup((caddr_t)&runout); } out: xswaplock &= ~s; if (xswapwant & s) { xswapwant &= ~s; wakeup((caddr_t)map); } if (rc == 0) { a = spl6(); p->p_flag |= SLOAD; if (p != u.u_procp && p->p_stat == SRUN) setrq(p); splx(a); } return (rc); } /* * Swap the data and stack page tables in or out. * Only hard thing is swapping out when new pt size is different than old. * If we are growing new pt pages, then we must spread pages with 2 swaps. * If we are shrinking pt pages, then we must merge stack pte's into last * data page so as not to lose them (and also do two swaps). */ swdspt(p, utl, rdwri) register struct proc *p; register struct user *utl; { register int szpt, tsz, ssz; int tdlast, slast, tdsz; register struct pte *pte; register int i; szpt = clrnd(ctopt(p->p_tsize+p->p_dsize+p->p_ssize+UPAGES)); tsz = p->p_tsize / NPTEPG; if (szpt == p->p_szpt) { swptstat.pteasy++; swpt(rdwri, p, 0, tsz, (p->p_szpt - tsz) * NBPG - UPAGES * sizeof (struct pte)); goto check; } if (szpt < p->p_szpt) swptstat.ptshrink++; else swptstat.ptexpand++; ssz = clrnd(ctopt(utl->u_ossize+UPAGES)); if (szpt < p->p_szpt && utl->u_odsize && (utl->u_ossize+UPAGES)) { /* * Page tables shrinking... see if last text+data and * last stack page must be merged... if so, copy * stack pte's from last stack page to end of last * data page, and decrease size of stack pt to be swapped. */ tdlast = (p->p_tsize + utl->u_odsize) % (NPTEPG * CLSIZE); slast = (utl->u_ossize + UPAGES) % (NPTEPG * CLSIZE); if (tdlast && slast && tdlast + slast <= (NPTEPG * CLSIZE)) { swptstat.ptpack++; tdsz = clrnd(ctopt(p->p_tsize + utl->u_odsize)); bcopy((caddr_t)sptopte(p, utl->u_ossize - 1), (caddr_t)&p->p_p0br[tdsz * NPTEPG - slast], (unsigned)(slast * sizeof (struct pte))); ssz -= CLSIZE; } } if (ssz) swpt(rdwri, p, szpt - ssz - tsz, p->p_szpt - ssz, ssz * NBPG); if (utl->u_odsize) swpt(rdwri, p, 0, tsz, (clrnd(ctopt(p->p_tsize + utl->u_odsize)) - tsz) * NBPG); check: for (i = 0; i < utl->u_odsize; i++) { pte = dptopte(p, i); if (pte->pg_v || pte->pg_fod == 0 && (pte->pg_pfnum||pte->pg_m)) panic("swdspt"); } for (i = 0; i < utl->u_ossize; i++) { pte = sptopte(p, i); if (pte->pg_v || pte->pg_fod == 0 && (pte->pg_pfnum||pte->pg_m)) panic("swdspt"); } } swpt(rdwri, p, doff, a, n) int rdwri; struct proc *p; int doff, a, n; { if (n <= 0) return; swap(p, p->p_swaddr + ctod(UPAGES) + doff, (caddr_t)&p->p_p0br[a * NPTEPG], n, rdwri, B_PAGET, swapdev, 0); } @i kR$S"%(T2iVt6i /* vmsubr.c 4.6 81/05/28 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/vm.h" #include "../h/proc.h" #include "../h/mtpr.h" #include "../h/pte.h" #include "../h/cmap.h" #include "../h/inode.h" #include "../h/buf.h" #include "../h/text.h" /* * Make uarea of process p addressible at kernel virtual * address uarea through sysmap locations starting at map. */ uaccess(p, map, uarea) register struct proc *p; struct pte *map; register struct user *uarea; { register int i; register struct pte *mp = map; for (i = 0; i < UPAGES; i++) { *(int *)mp = 0; mp->pg_pfnum = p->p_addr[i].pg_pfnum; mp++; } vmaccess(map, (caddr_t)uarea, UPAGES); } /* * Validate the kernel map for size ptes which * start at ppte in the sysmap, and which map * kernel virtual addresses starting with vaddr. */ vmaccess(ppte, vaddr, size) register struct pte *ppte; register caddr_t vaddr; register int size; { while (size != 0) { *(int *)ppte++ |= PG_V|PG_KW; mtpr(TBIS, vaddr); vaddr += NBPG; --size; } } /* * Convert a pte pointer to * a virtual page number. */ ptetov(p, pte) register struct proc *p; register struct pte *pte; { if (isatpte(p, pte)) return (tptov(p, ptetotp(p, pte))); else if (isadpte(p, pte)) return (dptov(p, ptetodp(p, pte))); else return (sptov(p, ptetosp(p, pte))); } /* * Convert a virtual page * number to a pte address. */ struct pte * vtopte(p, v) register struct proc *p; register unsigned v; { if (isatsv(p, v)) return (tptopte(p, vtotp(p, v))); else if (isadsv(p, v)) return (dptopte(p, vtodp(p, v))); else return (sptopte(p, vtosp(p, v))); } struct buf *vbmap(); /* * Initialize the page tables for paging from an inode, * by scouring up the indirect blocks in order. * Corresponding area of memory should have been vmemfree()d * first or just created. */ vinifod(pte, fileno, ip, bstart, count) register struct fpte *pte; int fileno; register struct inode *ip; daddr_t bstart; size_t count; { ((register int i, j; struct buf *bp; int indx; register daddr_t *pp; while (count > 0) { if (bstart < NADDR - 3) { ((struct pte *)pte)->pg_vreadm = 0; pte->pg_fod = 1; pte->pg_fileno = fileno; pte->pg_blkno = ip ? ip->i_un.i_addr[bstart] : 0; if (pte->pg_blkno == 0) { pte->pg_fileno = PG_FZERO; pte->pg_blkno = 0; cnt.v_nzfod += CLSIZE; } else if (fileno == PG_FTEXT) cnt.v_nexfod += CLSIZE; else { cnt.v_nvrfod += CLSIZE; u.u_vrpages[fileno] += CLSIZE; } for (j = 1; j < CLSIZE; j++) pte[j] = pte[0]; pte += CLSIZE; bstart++; count -= CLSIZE; } else { mtpr(TBIA, 0); /* conservative */ bp = vbmap(ip, bstart); indx = (bstart - (NADDR - 3)) % NINDIR; i = imin((NINDIR - indx) * CLSIZE, count); bstart += i / CLSIZE; count -= i; if (bp) { pp = &bp->b_un.b_daddr[indx]; do { ((struct pte *)pte)->pg_vreadm = 0; pte->pg_fod = 1; pte->pg_blkno = *pp++; if (pte->pg_blkno) { pte->pg_fileno = fileno; if (fileno == PG_FTEXT) cnt.v_nexfod += CLSIZE; else { cnt.v_nvrfod += CLSIZE; u.u_vrpages[fileno] += CLSIZE; } } else { pte->pg_fileno = PG_FZERO; pte->pg_blkno = 0; cnt.v_nzfod += CLSIZE; } for (j = 1; j < CLSIZE; j++) pte[j] = pte[0]; pte += CLSIZE; } while ((i -= CLSIZE) > 0); brelse(bp); } else { cnt.v_nzfod += i; do { ((struct pte *)pte)->pg_vreadm = 0; pte->pg_fod = 1; pte->pg_fileno = PG_FZERO; distcl(pte); pte += CLSIZE; } while ((i -= CLSIZE) > 0); } } } mtpr(TBIA, 0); /* necessary! */ } /* * Vbmap returns a block full of indirect pointers for a given block offset * in a file. It returns 0 if a missing address block was encountered, * in which case the pages can be normal zfod pages. */ struct buf * vbmap(ip, bn) register struct inode *ip; daddr_t bn; { register i; struct buf *bp; int j, sh; daddr_t nb; dev_t dev = ip->i_dev; if (bn < NADDR-3) panic("vbmap"); if (ip == 0) return (0); /* * addresses NADDR-3, NADDR-2, and NADDR-1 * have single, double, triple indirect blocks. * the first step is to determine * how many levels of indirection. */ sh = 0; nb = 1; bn -= NADDR-3; for (j = 3; j > 0; j--) { sh += NSHIFT; nb <<= NSHIFT; if(bn < nb) break; bn -= nb; } if (j == 0) goto noblk; /* * fetch the address from the inode */ nb = ip->i_un.i_addr[NADDR-j]; /* * fetch through the indirect blocks */ for (;;) { if (nb == 0) return (0); bp = bread(dev, nb); if (bp->b_flags & B_ERROR) { brelse(bp); goto noblk; } if (j == 3) break; j++; sh -= NSHIFT; i = (bn>>sh) & NMASK; nb = bp->b_un.b_daddr[i]; brelse(bp); if (nb == 0) goto noblk; } return (bp); noblk: return ((struct buf *)0); } getmemc(addr) caddr_t addr; { register int c; struct pte savemap; savemap = mmap[0]; *(int *)mmap = PG_V | PG_KR | btop(addr); mtpr(TBIS, vmmap); c = *(char *)&vmmap[(int)addr & PGOFSET]; mmap[0] = savemap; mtpr(TBIS, vmmap); return (c & 0377); } putmemc(addr, val) caddr_t addr; { struct pte savemap; savemap = mmap[0]; *(int *)mmap = PG_V | PG_KW | btop(addr); mtpr(TBIS, vmmap); *(char *)&vmmap[(int)addr & PGOFSET] = val; mmap[0] = savemap; mtpr(TBIS, vmmap); } /* * Set a red zone in the kernel stack after the u. area. */ setredzone(pte, vaddr) register struct pte *pte; caddr_t vaddr; { pte += (sizeof (struct user) + NBPG - 1) / NBPG; *(int *)pte &= ~PG_PROT; *(int *)pte |= PG_URKR; if (vaddr) mtpr(TBIS, vaddr + sizeof (struct user)); } @i k`JFW$1   T2i'k'k /* vmsched.c 4.16 81/12/02 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/seg.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/text.h" #include "../h/vm.h" #include "../h/cmap.h" int maxslp = MAXSLP; int saferss = SAFERSS; /* * The following parameters control operation of the page replacement * algorithm. They are initialized to 0, and then computed at boot time * based on the size of the system. If they are patched non-zero in * a loaded vmunix they are left alone and may thus be changed per system * using adb on the loaded system. */ int maxpgio = 0; int minfree = 0; int desfree = 0; int lotsfree = 0; int slowscan = 0; int fastscan = 0; int klin = KLIN; int klseql = KLSEQL; int klsdist = KLSDIST; int kltxt = KLTXT; int klout = KLOUT; int multprog = -1; /* so we don't count process 2 */ double avenrun[3]; /* load average, of runnable procs */ /* * Setup the paging constants for the clock algorithm. * Called after the system is initialized and the amount of memory * and number of paging devices is known. */ setupclock() { /* * Setup thresholds for paging: * lotsfree is threshold where paging daemon turns on * desfree is amount of memory desired free. if less * than this for extended period, do swapping * minfree is minimal amount of free memory which is * tolerable. * * Strategy of 4/22/81: * lotsfree is 1/4 of memory free. * desfree is 200k bytes, but at most 1/8 of memory * minfree is 64k bytes, but at most 1/2 of desfree */ if (lotsfree == 0) lotsfree = LOOPPAGES / 4; if (desfree == 0) { desfree = (200*1024) / NBPG; if (desfree > LOOPPAGES / 8) desfree = LOOPPAGES / 8; } if (minfree == 0) { minfree = (64*1024) / NBPG; if (minfree > desfree/2) minfree = desfree / 2; } /* * Maxpgio thresholds how much paging is acceptable. * This figures that 2/3 busy on an arm is all that is * tolerable for paging. We assume one operation per disk rev. */ if (maxpgio == 0) maxpgio = (DISKRPM * 2) / 3; /* * Clock to scan using max of ~~10% of processor time for sampling, * this estimated to allow maximum of 200 samples per second. * This yields a ``fastscan'' of roughly (with CLSIZE=2): * <=1m 2m 3m 4m 8m * 5s 10s 15s 20s 40s */ if (nswdev == 1 && physmem*NBPG > 2*1024*(1024-16)) printf("WARNING: should run interleaved swap with >= 2Mb\n"); if (fastscan == 0) fastscan = (LOOPPAGES/CLSIZE) / 200; if (fastscan < 5) fastscan = 5; if (nswdev == 2) maxpgio = (maxpgio * 3) / 2; /* * Set slow scan time to 1/2 the fast scan time. */ if (slowscan == 0) slowscan = 2 * fastscan; #ifdef notdef printf("slowscan %d, fastscan %d, maxpgio %d\n", slowscan, fastscan, maxpgio); printf("lotsfree %d, desfree %d, minfree %d\n", lotsfree, desfree, minfree); #endif } /* * The main loop of the scheduling (swapping) process. * * The basic idea is: * see if anyone wants to be swapped in; * swap out processes until there is room; * swap him in; * repeat. * If the paging rate is too high, or the average free memory * is very low, then we do not consider swapping anyone in, * but rather look for someone to swap out. * * The runout flag is set whenever someone is swapped out. * Sched sleeps on it awaiting work. * * Sched sleeps on runin whenever it cannot find enough * core (by swapping out or otherwise) to fit the * selected swapped process. It is awakened when the * core situation changes and in any case once per second. * * sched DOESN'T ACCOUNT FOR PAGE TABLE SIZE IN CALCULATIONS. */ #define swappable(p) \ (((p)->p_flag&(SSYS|SLOCK|SULOCK|SLOAD|SPAGE|SKEEP|SWEXIT|SPHYSIO))==SLOAD) /* insure non-zero */ #define nz(x) (x != 0 ? x : 1) #define NBIG 4 #define MAXNBIG 10 int nbig = NBIG; struct bigp { struct proc *bp_proc; int bp_pri; struct bigp *bp_link; } bigp[MAXNBIG], bplist; sched() { register struct proc *rp, *p, *inp; int outpri, inpri, rppri; int sleeper, desperate, deservin, needs, divisor; register struct bigp *bp, *nbp; int biggot, gives; loop: wantin = 0; deservin = 0; sleeper = 0; p = 0; /* * See if paging system is overloaded; if so swap someone out. * Conditions for hard outswap are: * if need kernel map (mix it up). * or * 1. if there are at least 2 runnable processes (on the average) * and 2. the paging rate is excessive or memory is now VERY low. * and 3. the short (5-second) and longer (30-second) average * memory is less than desirable. */ if (kmapwnt || (avenrun[0] >= 2 && imax(avefree, avefree30) < desfree && (rate.v_pgin + rate.v_pgout > maxpgio || avefree < minfree))) { desperate = 1; goto hardswap; } desperate = 0; /* * Not desperate for core, * look for someone who deserves to be brought in. */ outpri = -20000; for (rp = proc; rp < procNPROC; rp++) switch(rp->p_stat) { case SRUN: if ((rp->p_flag&SLOAD) == 0) { rppri = rp->p_time - rp->p_swrss / nz((maxpgio/2) * (klin * CLSIZE)) + rp->p_slptime - (rp->p_nice-NZERO)*8; if (rppri > outpri) { if (((rp->p_poip) continue; if (rp->p_textp && rp->p_textp->x_poip) continue; p = rp; outpri = rppri; } } continue; case SSLEEP: case SSTOP: if ((freemem < desfree || rp->p_rssize == 0) && rp->p_slptime > maxslp && (!rp->p_textp || (rp->p_textp->x_flag&XLOCK)==0) && swappable(rp)) { /* * Kick out deadwood. */ (void) spl6(); rp->p_flag &= ~SLOAD; if (rp->p_stat == SRUN) remrq(rp); (void) spl0(); (void) swapout(rp, rp->p_dsize, rp->p_ssize); goto loop; } continue; } /* * No one wants in, so nothing to do. */ if (outpri == -20000) { (void) spl6(); if (wantin) { wantin = 0; sleep((caddr_t)&lbolt, PSWP); } else { runout++; sleep((caddr_t)&runout, PSWP); } (void) spl0(); goto loop; } /* * Decide how deserving this guy is. If he is deserving * we will be willing to work harder to bring him in. * Needs is an estimate of how much core he will need. * If he has been out for a while, then we will * bring him in with 1/2 the core he will need, otherwise * we are conservative. */ deservin = 0; divisor = 1; if (outpri > maxslp/2) { deservin = 1; divisor = 2; } needs = p->p_swrss; if (p->p_textp && p->p_textp->x_ccount == 0) needs += p->p_textp->x_swrss; needs = imin(needs, lotsfree); if (freemem - deficit > needs / divisor) { deficit += needs; if (swapin(p)) goto loop; deficit -= imin(needs, deficit); } hardswap: /* * Need resources (kernel map or memory), swap someone out. * Select the nbig largest jobs, then the oldest of these * is ``most likely to get booted.'' */ inp = p; sleeper = 0; if (nbig > MAXNBIG) nbig = MAXNBIG; if (nbig < 1) nbig = 1; biggot = 0; bplist.bp_link = 0; for (rp = proc; rp < procNPROC; rp++) { if (!swappable(rp)) continue; if (rp->p_stat==SZOMB) continue; if (rp == inp) continue; if (rp->p_textp && rp->p_textp->x_flag&XLOCK) continue; if (rp->p_slptime > maxslp && (rp->p_stat==SSLEEP&&rp->p_pri>PZERO||rp->p_stat==SSTOP)) { if (sleeper < rp->p_slptime) { p = rp; sleeper = rp->p_slptime; } } else if (!sleeper && (rp->p_stat==SRUN||rp->p_stat==SSLEEP)) { rppri = rp->p_rssize; if (rp->p_textp) rppri += rp->p_textp->x_rssize/rp->p_textp->x_ccount; if (biggot < nbig) nbp = &bigp[biggot++]; else { nbp = bplist.bp_link; if (nbp->bp_pri > rppri) continue; bplist.bp_link = nbp->bp_link; } for (bp = &bplist; bp->bp_link; bp = bp->bp_link) if (rppri < bp->bp_link->bp_pri) break; nbp->bp_link = bp->bp_link; bp->bp_link = nbp; nbp->bp_pri = rppri; nbp->bp_proc = rp; } } if (!sleeper) { p = NULL; inpri = -1000; for (bp = bplist.bp_link; bp; bp = bp->bp_link) { rp = bp->bp_proc; rppri = rp->p_time+rp->p_nice-NZERO; if (rppri >= inpri) { p = rp; inpri = rppri; } } } /* * If we found a long-time sleeper, or we are desperate and * found anyone to swap out, or if someone deserves to come * in and we didn't find a sleeper, but found someone who * has been in core for a reasonable length of time, then * we kick the poor luser out. */ if (sleeper || desperate && p || deservin && inpri > maxslp) { (void) spl6(); p->p_flag &= ~SLOAD; if (p->p_stat == SRUN) remrq(p); (void) spl0(); if (desperate) { /* * Want to give this space to the rest of * the processes in core so give them a chance * by increasing the deficit. */ gives = p->p_rssize; if (p->p_textp) gives += p->p_textp->x_rssize / p->p_textp->x_ccount; gives = imin(gives, lotsfree); deficit += gives; } else gives = 0; /* someone else taketh away */ if (swapout(p, p->p_dsize, p->p_ssize) == 0) deficit -= imin(gives, deficit); goto loop; } /* * Want to swap someone in, but can't * so wait on runin. */ (void) spl6(); runin++; sleep((caddr_t)&runin, PSWP); (void) spl0(); goto loop; } vmmeter() { register unsigned *cp, *rp, *sp; deficit -= imin(deficit, imax(deficit / 10, ((klin * CLSIZE) / 2) * maxpgio / 2)); ave(avefree, freemem, 5); ave(avefree30, freemem, 30); /* v_pgin is maintained by clock.c */ cp = &cnt.v_first; rp = &rate.v_first; sp = &sum.v_first; while (cp <= &cnt.v_last) { ave(*rp, *cp, 5); *sp += *cp; *cp = 0; rp++, cp++, sp++; } if (time % 5 == 0) { vmtotal(); rate.v_swpin = cnt.v_swpin; sum.v_swpin += cnt.v_swpin; cnt.v_swpin = 0; rate.v_swpout = cnt.v_swpout; sum.v_swpout += cnt.v_swpout; cnt.v_swpout = 0; } if (avefree < minfree && runout || proc[0].p_slptime > maxslp/2) { runout = 0; runin = 0; wakeup((caddr_t)&runin); wakeup((caddr_t)&runout); } } vmpago() { register int vavail; register int scanrate; /* * Compute new rate for clock; if * nonzero, restart clock. * Rate ranges linearly from one rev per * slowscan seconds when there is lotsfree memory * available to one rev per fastscan seconds when * there is no memory available. */ nscan = desscan = 0; vavail = freemem - deficit; if (vavail < 0) vav@i k_KGY$1   T2i'k'kail = 0; if (freemem >= lotsfree) return; scanrate = (slowscan * vavail + fastscan * (lotsfree - vavail)) / nz(lotsfree); desscan = (LOOPPAGES / CLSIZE) / nz(scanrate); /* * DIVIDE BY 4 TO ACCOUNT FOR RUNNING 4* A SECOND (see clock.c) */ desscan /= 4; wakeup((caddr_t)&proc[2]); } vmtotal() { register struct proc *p; register struct text *xp; int nrun = 0; total.t_vmtxt = 0; total.t_avmtxt = 0; total.t_rmtxt = 0; total.t_armtxt = 0; for (xp = text; xp < textNTEXT; xp++) if (xp->x_iptr) { total.t_vmtxt += xp->x_size; total.t_rmtxt += xp->x_rssize; for (p = xp->x_caddr; p; p = p->p_xlink) switch (p->p_stat) { case SSTOP: case SSLEEP: if (p->p_slptime >= maxslp) continue; /* fall into... */ case SRUN: case SIDL: total.t_avmtxt += xp->x_size; total.t_armtxt += xp->x_rssize; goto next; } next: ; } total.t_vm = 0; total.t_avm = 0; total.t_rm = 0; total.t_arm = 0; total.t_rq = 0; total.t_dw = 0; total.t_pw = 0; total.t_sl = 0; total.t_sw = 0; for (p = proc; p < procNPROC; p++) { if (p->p_flag & SSYS) continue; if (p->p_stat && p->p_stat != SZOMB) { total.t_vm += p->p_dsize + p->p_ssize; total.t_rm += p->p_rssize; switch (p->p_stat) { case SSLEEP: case SSTOP: if (p->p_pri <= PZERO) nrun++; if (p->p_flag & SPAGE) total.t_pw++; else if (p->p_flag & SLOAD) { if (p->p_pri <= PZERO) total.t_dw++; else if (p->p_slptime < maxslp) total.t_sl++; } else if (p->p_slptime < maxslp) total.t_sw++; if (p->p_slptime < maxslp) goto active; break; case SRUN: case SIDL: nrun++; if (p->p_flag & SLOAD) total.t_rq++; else total.t_sw++; active: total.t_avm += p->p_dsize + p->p_ssize; total.t_arm += p->p_rssize; break; } } } total.t_vm += total.t_vmtxt; total.t_avm += total.t_avmtxt; total.t_rm += total.t_rmtxt; total.t_arm += total.t_armtxt; total.t_free = avefree; loadav(avenrun, nrun); } /* * Constants for averages over 1, 5, and 15 minutes * when sampling at 5 second intervals. */ double cexp[3] = { 0.9200444146293232, /* exp(-1/12) */ 0.9834714538216174, /* exp(-1/60) */ 0.9944598480048967, /* exp(-1/180) */ }; /* * Compute a tenex style load average of a quantity on * 1, 5 and 15 minute intervals. */ loadav(avg, n) register double *avg; int n; { register int i; for (i = 0; i < 3; i++) avg[i] = cexp[i] * avg[i] + n * (1.0 - cexp[i]); } @i k$8 S2i:6i ((/* vmpt.c 4.11 81/04/15 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/map.h" #include "../h/mtpr.h" #include "../h/pte.h" #include "../h/cmap.h" #include "../h/vm.h" #include "../h/buf.h" #include "../h/text.h" #include "../h/mount.h" #include "../h/inode.h" /* * Get page tables for process p. Allocator * for memory is argument; process must be locked * from swapping if vmemall is used; if memall is * used, call will return w/o waiting for memory. * In any case an error return results if no user * page table space is available. */ vgetpt(p, pmemall) register struct proc *p; int (*pmemall)(); { register int a; register int i; if (p->p_szpt == 0) panic("vgetpt"); /* * Allocate space in the kernel map for this process. * Then allocate page table pages, and initialize the * process' p0br and addr pointer to be the kernel * virtual addresses of the base of the page tables and * the pte for the process pcb (at the base of the u.). */ a = rmalloc(kernelmap, p->p_szpt); if (a == 0) return (0); if ((*pmemall)(&Usrptmap[a], p->p_szpt, p, CSYS) == 0) { rmfree(kernelmap, p->p_szpt, a); return (0); } p->p_p0br = kmxtob(a); p->p_addr = uaddr(p); /* * Now validate the system page table entries for the * user page table pages, flushing old translations * for these kernel virtual addresses. Clear the new * page table pages for clean post-mortems. */ vmaccess(&Usrptmap[a], (caddr_t)p->p_p0br, p->p_szpt); for (i = 0; i < p->p_szpt; i++) clearseg(Usrptmap[a + i].pg_pfnum); return (1); } /* * Initialize text portion of page table. */ vinitpt(p) struct proc *p; { register struct text *xp; register struct proc *q; register struct pte *pte; register int i; struct pte proto; xp = p->p_textp; if (xp == 0) return; pte = tptopte(p, 0); /* * If there is another instance of same text in core * then just copy page tables from other process. */ if (q = xp->x_caddr) { bcopy((caddr_t)tptopte(q, 0), (caddr_t)pte, (unsigned) (sizeof(struct pte) * xp->x_size)); goto done; } /* * Initialize text page tables, zfod if we are loading * the text now; unless the process is demand loaded, * this will suffice as the text will henceforth either be * read from a file or demand paged in. */ *(int *)&proto = PG_URKR; if (xp->x_flag & XLOAD) { proto.pg_fod = 1; ((struct fpte *)&proto)->pg_fileno = PG_FZERO; } for (i = 0; i < xp->x_size; i++) *pte++ = proto; if ((xp->x_flag & XPAGI) == 0) goto done; /* * Text is demand loaded. If process is not loaded (i.e. being * swapped in) then retrieve page tables from swap area. Otherwise * this is the first time and we must initialize the page tables * from the blocks in the file system. */ if (xp->x_flag & XLOAD) vinifod((struct fpte *)tptopte(p, 0), PG_FTEXT, xp->x_iptr, (daddr_t)1, xp->x_size); else swap(p, xp->x_ptdaddr, (caddr_t)tptopte(p, 0), xp->x_size * sizeof (struct pte), B_READ, B_PAGET, swapdev, 0); done: /* * In the case where we are overlaying ourself with new page * table entries, old user-space translations should be flushed. */ if (p == u.u_procp) mtpr(TBIA, 0); } /* * Update the page tables of all processes linked * to a particular text segment, by distributing * dpte to the the text page at virtual frame v. * * Note that invalidation in the translation buffer for * the current process is the responsibility of the caller. */ distpte(xp, tp, dpte) struct text *xp; register size_t tp; register struct pte *dpte; { register struct proc *p; register struct pte *pte; register int i; for (p = xp->x_caddr; p; p = p->p_xlink) { pte = tptopte(p, tp); if (pte != dpte) for (i = 0; i < CLSIZE; i++) pte[i] = dpte[i]; } } /* * Release page tables of process p. */ vrelpt(p) register struct proc *p; { register int a; if (p->p_szpt == 0) return; a = btokmx(p->p_p0br); (void) vmemfree(&Usrptmap[a], p->p_szpt); rmfree(kernelmap, p->p_szpt, a); } #define Xu(a) t = up->u_pcb.a; up->u_pcb.a = uq ->u_pcb.a; uq->u_pcb.a = t; #define Xup(a) tp = up->u_pcb.a; up->u_pcb.a = uq ->u_pcb.a; uq->u_pcb.a = tp; #define Xp(a) t = p->a; p->a = q->a; q->a = t; #define Xpp(a) tp = p->a; p->a = q->a; q->a = tp; /* * Pass the page tables of process p to process q. * Used during vfork(). P and q are not symmetric; * p is the giver and q the receiver; after calling vpasspt * p will be ``cleaned out''. Thus before vfork() we call vpasspt * with the child as q and give it our resources; after vfork() we * call vpasspt with the child as p to steal our resources back. * We are cognizant of whether we are p or q because we have to * be careful to keep our u. area and restore the other u. area from * umap after we temporarily put our u. area in both p and q's page tables. */ vpasspt(p, q, up, uq, umap) register struct proc *p, *q; register struct user *up, *uq; struct pte *umap; { int t; int s; struct pte *tp; register int i; s = spl7(); /* conservative, and slightly paranoid */ Xu(pcb_szpt); Xu(pcb_p0lr); Xu(pcb_p1lr); Xup(pcb_p0br); Xup(pcb_p1br); /* * The u. area is contained in the process' p1 region. * Thus we map the current u. area into the process virtual space * of both sets of page tables we will deal with so that it * will stay with us as we rearrange memory management. */ for (i = 0; i < UPAGES; i++) if (up == &u) q->p_addr[i] = p->p_addr[i]; else p->p_addr[i] = q->p_addr[i]; mtpr(TBIA, 0); /* * Now have u. double mapped, and have flushed * any stale translations to new u. area. * Switch the page tables. */ Xpp(p_p0br); Xp(p_szpt); Xpp(p_addr); mtpr(P0BR, u.u_pcb.pcb_p0br); mtpr(P1BR, u.u_pcb.pcb_p1br); mtpr(P0LR, u.u_pcb.pcb_p0lr &~ AST_CLR); mtpr(P1LR, u.u_pcb.pcb_p1lr); /* * Now running on the ``other'' set of page tables. * Flush translation to insure that we get correct u. * Resurrect the u. for the other process in the other * (our old) set of page tables. Thus the other u. has moved * from its old (our current) set of page tables to our old * (its current) set of page tables, while we have kept our * u. by mapping it into the other page table and then keeping * the other page table. */ mtpr(TBIA, 0); for (i = 0; i < UPAGES; i++) { int pf; struct pte *pte; if (up == &u) { pf = umap[i].pg_pfnum; pte = &q->p_addr[i]; pte->pg_pfnum = pf; } else { pf = umap[i].pg_pfnum; pte = &p->p_addr[i]; pte->pg_pfnum = pf; } } mtpr(TBIA, 0); splx(s); } /* * Compute number of pages to be allocated to the u. area * and data and stack area page tables, which are stored on the * disk immediately after the u. area. */ /*ARGSUSED*/ vusize(p, utl) register struct proc *p; struct user *utl; { register int tsz = p->p_tsize / NPTEPG; /* * We do not need page table space on the disk for page * table pages wholly containing text. This is well * understood in the code in vmswap.c. */ return (clrnd(UPAGES + clrnd(ctopt(p->p_tsize+p->p_dsize+p->p_ssize+UPAGES)) - tsz)); } /* * Get u area for process p. If a old u area is given, * then copy the new area from the old, else * swap in as specified in the proc structure. * * Since argument map/newu is potentially shared * when an old u. is provided we have to be careful not * to block after beginning to use them in this case. * (This is not true when called from swapin() with no old u.) */ vgetu(p, palloc, map, newu, oldu) register struct proc *p; int (*palloc)(); register struct pte *map; register struct user *newu; struct user *oldu; { register int i; if ((*palloc)(p->p_addr, clrnd(UPAGES), p, CSYS) == 0) return (0); /* * New u. pages are to be accessible in map/newu as well * as in process p's virtual memory. */ for (i = 0; i < UPAGES; i++) { map[i] = p->p_addr[i]; *(int *)(p->p_addr + i) |= PG_URKW | PG_V; } setredzone(p->p_addr, (caddr_t)0); vmaccess(map, (caddr_t)newu, UPAGES); /* * New u.'s come from forking or inswap. */ if (oldu) { bcopy((caddr_t)oldu, (caddr_t)newu, UPAGES * NBPG); newu->u_procp = p; } else { swap(p, p->p_swaddr, (caddr_t)0, ctob(UPAGES), B_READ, B_UAREA, swapdev, 0); if (newu->u_pcb.pcb_ssp != -1 || newu->u_pcb.pcb_esp != -1 || newu->u_tsize != p->p_tsize || newu->u_dsize != p->p_dsize || newu->u_ssize != p->p_ssize || newu->u_procp != p) panic("vgetu"); } /* * Initialize the pcb copies of the p0 and p1 region bases and * software page table size from the information in the proc structure. */ newu->u_pcb.pcb_p0br = p->p_p0br; newu->u_pcb.pcb_p1br = p->p_p0br + p->p_szpt * NPTEPG - P1TOP; newu->u_pcb.pcb_szpt = p->p_szpt; return (1); } /* * Release swap space for a u. area. */ vrelswu(p, utl) struct proc *p; struct user *utl; { rmfree(swapmap, ctod(vusize(p, utl)), p->p_swaddr); /* p->p_swaddr = 0; */ /* leave for post-mortems */ } /* * Get swap space for a u. area. */ vgetswu(p, utl) struct proc *p; struct user *utl; { p->p_swaddr = rmalloc(swapmap, ctod(vusize(p, utl))); return (p->p_swaddr); } /* * Release u. area, swapping it out if desired. * * Note: we run on the old u. after it is released into swtch(), * and are safe because nothing can happen at interrupt time. */ vrelu(p, swapu) register struct proc *p; { register int i; struct pte uu[UPAGES]; if (swapu) swap(p, p->p_swaddr, (caddr_t)0, ctob(UPAGES), B_WRITE, B_UAREA, swapdev, 0); for (i = 0; i < UPAGES; i++) uu[i] = p->p_addr[i]; (void) vmemfree(uu, clrnd(UPAGES)); } #ifdef unneeded int ptforceswap; #endif /* * Expand a page table, assigning new kernel virtual * space and copying the page table entries over both * in the system map and as necessary in the user page table space. */ ptexpand(change) register int change; { register struct pte *p1, *p2; register int i; register int spages, ss = P1TOP - mfpr(P1LR); register int kold = btokmx((struct pte *)mfpr(P0BR)); int knew, tdpages; int szpt = u.u_pcb.pcb_szpt; int s; if (change <= 0 || change % CLSIZE) panic("ptexpand"); /* * Change is the number of n((@i k$8 S2i:6iew page table pages needed. * Kold is the old index in the kernelmap of the page tables. * Allocate a new kernel map segment of size szpt+change for * the page tables, and the new page table pages in the * middle of this new region. */ top: #ifdef unneeded if (ptforceswap) goto bad; #endif if ((knew=rmalloc(kernelmap, szpt+change)) == 0) goto bad; spages = ss/NPTEPG; tdpages = szpt - spages; if (memall(&Usrptmap[knew+tdpages], change, u.u_procp, CSYS) == 0) { rmfree(kernelmap, szpt+change, knew); goto bad; } /* * Spages pages of u.+stack page tables go over unchanged. * Tdpages of text+data page table may contain a few stack * pages which need to go in one of the newly allocated pages; * this is a rough cut. */ kmcopy(knew, kold, tdpages); kmcopy(knew+tdpages+change, kold+tdpages, spages); /* * Validate and clear the newly allocated page table pages in the * center of the new region of the kernelmap. * Then flush translation since we changed * the kernel page tables. */ i = knew + tdpages; p1 = &Usrptmap[i]; p2 = p1 + change; while (p1 < p2) { *(int *)p1 |= PG_V | PG_KW; clearseg(p1->pg_pfnum); p1++; i++; } mtpr(TBIA, 0); /* * Move the stack or u. pte's which are before the newly * allocated pages into the last of the newly allocated pages. * They are taken from the end of the current p1 region, * and moved to the end of the new p1 region. There are * ss % NPTEPG such pte's. */ p1 = (struct pte *)mfpr(P1BR) + mfpr(P1LR); p2 = kmxtob(knew+szpt+change) - ss; for (i = ss - NPTEPG*spages; i != 0; i--) *p2++ = *p1++; /* * Now switch to the new page tables. */ mtpr(TBIA, 0); /* paranoid */ s = spl7(); /* conservative */ u.u_procp->p_p0br = kmxtob(knew); u.u_pcb.pcb_p0br = kmxtob(knew); u.u_pcb.pcb_p1br = kmxtob(knew+szpt+change) - P1TOP; u.u_pcb.pcb_szpt += change; u.u_procp->p_szpt += change; u.u_procp->p_addr = uaddr(u.u_procp); mtpr(P0BR, u.u_procp->p_p0br); mtpr(P1BR, u.u_pcb.pcb_p1br); mtpr(TBIA, 0); splx(s); /* * Finally, free old kernelmap. */ if (szpt) rmfree(kernelmap, szpt, kold); return; bad: /* * Swap out the process so that the unavailable * resource will be allocated upon swapin. * * When resume is executed for the process, * here is where it will resume. */ resume(pcbb(u.u_procp)); if (setjmp(u.u_ssav)) return; if (swapout(u.u_procp, (size_t)(mfpr(P0LR) - u.u_tsize), ss - UPAGES) == 0) { /* * No space to swap... it is inconvenient to try * to exit, so just wait a bit and hope something * turns up. Could deadlock here. * * SOMEDAY REFLECT ERROR BACK THROUGH expand TO CALLERS * (grow, sbreak) SO CAN'T DEADLOCK HERE. */ sleep((caddr_t)&lbolt, PRIBIO); goto top; } /* * Set SSWAP bit, so that when process is swapped back in * swapin will set u.u_pcb.pcb_sswap to u_sswap and force a * return from the setjmp() above. */ u.u_procp->p_flag |= SSWAP; swtch(); /* no return */ } kmcopy(to, from, count) register int to; int from; register int count; { register struct pte *tp = &Usrptmap[to]; register struct pte *fp = &Usrptmap[from]; while (count != 0) { *tp++ = *fp++; to++; count--; } } /* * Change protection codes of text segment. * Have to flush translation buffer since this * affect virtual memory mapping of current process. */ chgprot(addr, tprot) caddr_t addr; long tprot; { unsigned v; int tp; register struct pte *pte; register struct cmap *c; v = clbase(btop(addr)); if (!isatsv(u.u_procp, v)) { u.u_error = EFAULT; return (0); } tp = vtotp(u.u_procp, v); pte = tptopte(u.u_procp, tp); if (pte->pg_fod == 0 && pte->pg_pfnum) { c = &cmap[pgtocm(pte->pg_pfnum)]; if (c->c_blkno && c->c_mdev != MSWAPX) munhash(mount[c->c_mdev].m_dev, (daddr_t)c->c_blkno); } *(int *)pte &= ~PG_PROT; *(int *)pte |= tprot; distcl(pte); tbiscl(v); return (1); } settprot(tprot) long tprot; { register int *ptaddr, i; ptaddr = (int *)mfpr(P0BR); for (i = 0; i < u.u_tsize; i++) { ptaddr[i] &= ~PG_PROT; ptaddr[i] |= tprot; } mtpr(TBIA, 0); } @i k> 2i 8i 8i #define NDH 2 @i k>* 2i 8i 8i #define NTU 2 #define NHT 1 ((@i k+>2i 8i 8i #define NRA 2 #define NUDA 1 @i k> 2i 8i 8i #define NUP 2 #define NSC 1 @i k>" 2i 8i 8i #define NVP 0 @i kThä:Oi Q @_ -iNN k4`3\ U i  @   ((ʏx_ȏT19^^~8~~8?.?X/?^? C>KSP not valid? >CHM? in kernel?D;??~Br;??},??ݮ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l Ь[ѫ  k[Jԫ dPPPPڎPZ [ P[ [ ZPڎn[8[ekPPPPPЫ ~2~nPkPPPЫЫo4 ێPPPPZbێPPڮn^NZA;9<PP )RnnZ1m<~<~~h[kЫ [HZ S>ZTzPgPP4.~N2 ~P*1W  1. 18PPPPw1b1X@kiݏ@ڮn^ dEg[(R/YK1k0[PP~ݑЫ $[F1~z~چڮn^1ZvmS 1L)ێPP7P0`~ڮn^"ﺆPP,l"7ﮆؐݏ@ڮn^ rﳐ~1=ێPݏ@ڮn^|oITQZڮn^:1D ,)ێPP܅ݏ@ڮn^111+PPPP? }ڮn^E1;1. d1Ь[ЬZx YQ,թݩ{\2~PYPk[Q8^Ь[2PP@]WЫ,Y2ԫ4qQ#իz[~2~PЩ Z ԩЩ,֫4ЫЭP2PPg;~zZl2g~ЭP2PˏP~_z2~}2PPPxPP@V1|[rPX﷧: Щ,q2 ~ zȏ(21qPPP&P'P*, ȏ(2P ݭZ2~PZj!P"PP 2PPPxPP ? ЪPQxQQQPOЭ$ȏ(2,xPPC֩$2P@]xP2QPA[թЩ,Ы0PYY0ԩЪ 2P,P@7YY ЩЩPZ Z1^ЬP@.[ЫZPP@XŏP@W2~2h~x}2hPP 1q2h~ݬxWݬpxF2PʏdoPP h[PNQQQPPh PȏPPP2QPQ Pȏ PQPPxPPPh2Pʏ?PP@hШYHP 2^24 itrunc ^\ /etc/init$$1>KXfp{real mem = %d sys pt too smallno memoryavail mem = %d usrptWARNING: preposterous time in file systemWARNING: todr too smallWARNING: clock %s %d dayslostgained -- CHECK AND RESET THE DATE! mcr%d: soft ecc addr %x syn %x mcr%d: soft ecc addr %x syn %x mcr%d: soft ecc addr %x syn %x syncing disks... done halting (in tight loop); hit ^P HALT dumping to dev %x, offset %d dump device bad device not ready area improper i/o errorsucceededmachine check %x: %s%s abort fault%s %s cpues %x upc %x va/viba %x dreg %x tber %x %x timo %x parity %x sbier %x pc %x psl %x sbifs %x va %x errpc %x mdr %x smr %x rdtimo %x tbgpar %x cacherr %x buserr %x mcesr %x pc %x psl %x mcsr %x params %x,%x pc %x psl %x mcesr %x mchkcp readctrl str parcp tbuf parcp cache parcp rdtimocp rdsucode lostib tbuf parib rdsib rd timoib cache parctrl str parmemory errorcp cache parwrite bus errcorr dataucode lostbad irdtb parbad retrybad intr idcant write ptemunkn mcr erriib rd errnxm refcp rdsunalgn iorefnonlw iorefbad ioaddrunalgn ubaddriinitbinit0123456789abcdefpanic: %s %s: table is full %s%d%c: hard error sn%d neg q flush rmallocrmalloc swapmap%s: rmap ovflo, lost [%d,%d) bad rmfreeissig psigpsig actioncoresleepwakeupsetrunno procsnewproc vforknewproc i_vfdcntexeceexeca rmallocexitinit diedprocumountpw{}~ւ2lz„nP$}؆rlT~_00ԋܐ|Fp·E&npRpp8h500Cppn̒pppp`lxppp pppppppvpppppppppppppppppppppppppppppppppppppppxfree rssizetextxalloctext rssizelost texttrap type %d, code = %x, pc = %x trapptable faultsyscallvsexpandvmdrum NDMAPvsxallocvsswapvstodbvstodb *ipvmemall sizevmemfreevmemfree vrpagesvmemfree vfdcntmemalldup mem allocbad mem allocmemall ecmapmemall mfindmemall intrans|wantmemfreebad mem freedup mem freemhashmunhashmunhashmunhash mfinddup page unlockvslockpageinpagein pg_filenopagein PG_FTEXTpagein u.u_ofilepagein mfindpagein intrans|wantpagein c_page chgdpagein u.u_ofilepagein u.u_vrpagespagein i_vfdcntpagein pfnumbad c_pagepageout klsizecleanup CSYScleanup centerklustervrelvm rssvrelvm vrpagesexpandvgetptvgetuptexpand Ak@M{@Ķ~@]μ@WARNING: should run interleaved swap with >= 2Mb vbmapswapinswapoutswapout rssizeswapoutswdsptswdspt4 , $  x h X H cpu type %d not configured mba%d at tr%d %d mba'suba%d at tr%d 5 uba'sdr32mcr%d at tr%d 5 mcr'smpmnexus type %x unsupported (at tr %d) not configured %s%d at %s%d slave %d %s%d at mba%d drive %d uba%s%d at uba%d csr %o zero vector didn't interrupt vec %o, ipl %x %s%d at %s%d slave %d %s%d at uba%d csr %o zero vector didn't interrupt vec %o, ipl %x blkdevdup iodoneIO err in pushswap bad ptebig pushhard IO err in swappid %d: killed due to no swap space killed on swap error sorry, pid %d was %sbmbm (*+,R4bmbmbmbm\erXmXmuXmwxytZt[Z\dȰXmbmXmXmXmXmTbmbmgr20 tmbmnZnnbmbmbmbm>~@Xmbmbmbmbmz%%XmXmbm*+22z2 3XmbmXmXmXmXmXmbmbmbmbmuuXmXmbmHnzXmXmbmVKLNOUbmbmXmXmXmXmXmbmbmbmbmnVnXmXmqNxx J   hbmbmXmXm@wx@Xmր5f6Xm6XmXm9t>~Xm XmXmXmXmXmXmbmbmbmXmbmXmXmbmZt[abbXmXmXmXmXmXmXmbmXmXmXmXmXmXmbmXm XmXmXmXmXmXmXmXmXmXmXmbmXXmXmXmXmXmXmXmXmXm̨bm21jbmbmbmXmXmXmXmXmXmXmXmXmXm`ڠB1xbmbmVKLhQQUbmbmbmbmbmPj./ ./( dh%d: silo overflow dh%d: NXM dh%ddhdm /8/`dn&2qv >d`@@6 > >2MPk2rR >%@s?1= a >JT+jRJ2" "#0H2 7/ `70///\0/2 @v0 00=DCLR attn hp%d: write locked hpmbsr=%b er1=%b er2=%bDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBCDVCSSEDPE mr=%o mr2=%o hp%d%c: soft ecc sn%d hp()*,**D-.0L233CORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLAtu%d: not online tu%d: no write ring tu%d: can't change density in mid-tape tu%d: hard error bn%d mbsr=%b er=%b ds=%b tu%d: hard error bn%d er=%b ds=%b httuL553 4 lp%dlp DTBUSYNRCONFCRDCBHUNGPGENEDMCPEATTNSPEDTCMP DTABT DLT WCKUP WCKLWR MXFMBEXCMDPEMAPPEINVMAPERRCONFRDSISTIMORDTIMOmbustart%s%d: not ready mba%d: control bus hung cbhungmbintrmbintrmba: zero upagemba, zero entry @ @AYY\](^_$566RDYPRESONL REW PE BOT EOT FPTAVAILSHRMAINTDSE mu%d: not online mu%d: no write ring mu%d: can't change density in mid-tape mt: wrong unit! mu%d: blank tape mu%d: offline mu%d: no write ring mu%d: hard error bn%d mbsr=%b er=%x ds=%b mt: unit %d random interrupt mu%d: blank tape mu%d: no write ring mu%d: offline mu%d: hard error bn%d er=%o ds=%b mtmu >0'l >+i dd|ddPjl799B/6B(7 00F7 irk%d: not ready (came back!) rk%d: write locked rkcs2=%b ds=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSSVALCDAPIP WRL DDTDRDYVVDROTSPLSACLOOFFDRADCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk%d%c: soft ecc sn%d hk%d<%d>hk%d: lost interrupt rkhkswstrategyargmapswapPtwww| 9D:G:  @te%d: not online te%d: no write ring te%d: can't change density in mid-tape te%d: hard error bn%d er=%b ILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTURtmintrte%d: lost interrupt tm%d<%d>tetmP$^p҈L:;;  ts%d: not online ts%d: no write ring ts%d: success ts%d: write locked ts%d: offline ts%d: hard error bn%d xs0=%bTMKRLSLET RLL WLE NEF ILC ((ILAMOTONLIESVCKPEDWLKBOTEOT xs1=%bDLT-COR CRS TIG DBF SCK -IPRSYNIPOIEDPOSPOLUNCMTE xs2=%bOPMSIPBPE CAF - WCF - DTP xs3=%bLMXOPIREVCRFDCKNOILXSRIB tsintr ts%d<%d>tszs|`{}~ABCDEFGHIJKLMNOPQRSTUVWXYZddddddd22xxx}}}}ttrstrt: arg was 0! ioccom canq^ ({)}!|^~'`ttyrub  ({)}!|^~'`tu%d: %d soft errors, %d chksum errors, %d hard errors ON tu: no bp! active %d tu pk_mod %d neither data nor end: %o %o TU protocol error, state %d %o %d %d TU receive state error %d %o tuxintr: state %d ON2 OFF NO IE OFF2 new state %d tu: read stalled %X %X %X %X %X %X %X %X  RDTO RDS CRDCXTERCXTMODPPEIVMRMRPFLEBUBSTOUBSSYNTO uba: zero upageuba zero uentryuba%d: reset uba%d: hung uba%d: too many zero vectors uba%d: sbi fault sr=%b cnfgr=%b  PARFLTWSQFLTURDFLTISQFLTMXTFLTXMTFLTuba%d: uba error sr=%b fmer=%x fubar=%o uba crazyERROR LIMIT > >@Lh\?BȭB 7uda: ubinfo %x uda: um_ubinfo == 0 raudasa %o, state %d uda: bring unit %d online udintr: state %d, udasa %o uda%d: random interrupt ignored uda%d: interrupt in unknown state %d ignored uda%d: fatal error (%o) uda: purge bdp %d uda: command ring transition uda: unit %d online raOFFLINE uda: unit %d attention rastatus %o uda: unknown packet uda%d:%d: %s error, softhardcontroller error, event 0%o host memory access error, event 0%o, addr 0%o disk transfer error, unit %d, grp %d, cyl %d, sec %d, trk %d, lbn %d, retry %d, level %d SDI error, unit %d, event 0%o, cyl %d small disk error, unit %d, event 0%o, cyl %d unknown error, unit %d, format 0%o, event 0%o uda%drauda > >2M=X2rR >2BHCDD `7B @7C 007qxUup%d: not ready (flakey) up%d: word count != 0 up%d: write locked upcs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPEup%d%c: soft ecc sn%d sc%d<%d>sc%d: lost interrupt upsc     () DE EE,EBerkeley VAX/UNIX Version 4.9 Wed Feb 17 15:27:46 PST 1982 0?0??0??0??X2??(5??X2X2(5(5(8HXhx (p7?,H $9?  U) U- V5 ,V=!&D\KX_gv^olwv)ESE0tjP8T|d$(".*84^ <HFXPhZN>bDxlvEFGHIJK (  lNpN_tN! VN;2 |W9 W} H VWN ^XW vX` "Xh  Xn dXu &X} X XT X  X v$X w&X (X  ,X .X 0X 4X J8X GX8  =XSN zX X& (XB5 Dt&Dx&p&|&&{  =  -\ \9X  \ &! \* X&; ed&E \&N `&W ?T&+ j N(\t Q8\z <\ @\)  \@ P\ p t x k0 V c/ N.n6d zy$Y.3' `1 `: `D N+3T `_ |Nf kLEn  %T Y f 1 . ol { f vd <n Z% x l` N l% > & " ^' '" r) @x(0 (9 a@ )H KS a\ ad )l q Z+z @. ~ N/ / &0 r< < 0 0 0 1#w a a a a a Ha a N a( a4 5; $D "1M zV V^ Ai =:q h5z ~5 06 "7 _ u7 W0  8 ,: pH:  8 x v Ae >  A  @ LA z? ' Jg0 9 A DL S v[ adja Eh ?p Ev jF} \Q ^G tH NK  ZJ K ¬ D (( Ea iL 6L M N O eO *P+RP kPQt.I(<07@xIFVNZVS/nV[7 WdXl aqPYz\[,`\wo])_m ]adKerl1lXmbm fmzmlm Fn(Zn1n:n@tnGOtY`wi*q/y Xwu8Dlzz{L<|T{$}}~>ւT2;2r"„(/8?F؆L·QwTY&bk%4t|ԋW~LRql yڎ1 P,ܐb^&n&2̒-4F=XEuNxV-p]'|f^0Co?`vOl}xA9 l|vIKԔq.~P ojR#Z-5f;0DMZT\el|tzȥ6|JM6°l%u % >Xe$%d Tb  b( c0F6`&?3If Q.X_F_gp5y`bTh&l&& TXc Hcph^&h1 c oc @@ nc`* c2 "c: dB dG$'P4'YC(emn#xZL[jmxmGEMHJ Hd<Ft{  (Z*&+/G,;(R4CmOW \ecrkmuwjwx y8-tmZ t[ Z\dLȰO}  #Jh E3ZT;D4L'U^:frow20Id>~@z%%422'z2 3'uuMHtnz :VKLN"RO+U4n<VnE qN*V]_Ngxpx y`J   I@E@Bր5Mf669>i~a  agb_b'z /8gAIhXR*[̨dl2urj!`ڠ Bnx hQGQEp.]|.ޑ |T   (=./h.9+PBjL 5(Te.[#.en^x $0 %4  8 @ Pb ̽D j-J1T~ F`p /K/#d- h5WB  Q I 4  HBB'B.NJ5Y:X?IGsJQ NVZWbVjJoJv5}8K G <NLW MV 5(YHYQ\[#]dJ(^m_w  MءfP5[``b ܡ > 9Z6)(7h7   4l7p7 <ddL|d@d&bPj- F5 p< xC :xK7Q7\ SЦd }(n%nv0rr=DfsjhnHinc0Կ 0 ` k a  ȧ 6 t 90$9 Qtw w 9w# Y|* y(4 #hy? 4~H dzzQ p[ c }k u g | H ux   X GL: P: $ ^ p I҈ [  }` pd!? !$X!ʋ!A$!a.!_ 5!<=!dH!>R!(Y!6b!j!ʧs!2~!(!j!l!@! 9! H! p(! 8!h =!2$=!1(=! h!.(! !d!"{X>">">%"/" 9" D" I"?S" /\" e" ȭn" Эt"P?{":?"\""" r" iH" "!T"$"p"$"n" Ю"mB"DC#t@C #TDC# c# 7&# ,#HC3# PC=#F#O#fY#Q`# yh#xCn#CCy# X# <# # ]##n#  #tF#D#E#E# E#,E#r,H#C4H$U). */ /* * Structure of the information in the first word returned by both * wait and wait3. If w_stopval==WSTOPPED, then the second structure * describes the information returned, else the first. See WUNTRACED below. */ union wait { int w_status; /* used in syscall */ /* * Terminated process status. */ struct { unsigned short w_Termsig:7; /* termination signal */ unsigned short w_Coredump:1; /* core dump indicator */ unsigned short w_Retcode:8; /* exit code if w_termsig==0 */ } w_T; /* * Stopped process status. Returned * only for traced children unless requested * with(( the WUNTRACED option bit. */ struct { unsigned short w_Stopval:8; /* == W_STOPPED if stopped */ unsigned short w_Stopsig:8; /* signal that stopped us */ } 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 #define WSTOPPED 0177 /* value of s.stopval if process is stopped */ /* * Option bits for the second argument of wait3. WNOHANG causes the * wait to not hang if there are no stopped or terminated processes, rather * returning an error indication in this case (pid==0). WUNTRACED * indicates that the caller should receive status about untraced children * which stop due to signals. If children are stopped and a wait without * this option is done, it is as though they were still running... nothing * about them is returned. */ #define WNOHANG 1 /* dont hang in wait */ #define WUNTRACED 2 /* tell about stopped, untraced children */ #define WIFSTOPPED(x) ((x).w_stopval == WSTOPPED) #define WIFSIGNALED(x) ((x).w_stopval != WSTOPPED && (x).w_termsig != 0) #define WIFEXITED(x) ((x).w_stopval != WSTOPPED && (x).w_termsig == 0) @ik4L&"V:&i[6i #include "../h/param.h" #include "../h/conf.h" /* * UP0?+PP0? configuration * root on up0a * paging on up0b and then hp0b */ dev_t rootdev = makedev(2, 0); dev_t pipedev = makedev(2, 0); dev_t argdev = makedev(2, 1); dev_t dumpdev = makedev(2, 1); int dumplo = 33340 - 10 * 2048; /* * Nswap is the basic number of blocks of swap per * swap device, and is multiplied by nswdev after * nswdev is determined at boot. */ int nswap = 33440; struct swdevt swdevt[] = { makedev(2, 1), 0, /* up0b */ makedev(0, 1), 0, /* hp0b */ 0, 0, }; @ikPg07DG'&iQ6i # # GENERIC VAX # cpu "VAX780" cpu "VAX750" cpu "VAX7ZZ" ident GENERIC timezone 0 maxusers 8 config generic vmunix controller mba0 at nexus ? controller mba1 at nexus ? controller mba2 at nexus ? controller mba3 at nexus ? controller uba0 at nexus ? controller uba1 at nexus ? controller uba2 at nexus ? controller uba3 at nexus ? disk hp0 at mba? drive 0 disk hp1 at mba? drive ? disk hp2 at mba? drive ? disk hp3 at mba? drive ? master ht0 at mba? drive ? tape tu0 at ht0 slave 0 tape tu1 at ht0 slave 1 master mt0 at mba? drive ? tape mu0 at mt0 slave 0 tape mu1 at mt0 slave 1 controller hk0 at uba? csr 0177440 vector rkintr disk rk0 at hk0 drive 0 disk rk1 at hk0 drive 1 device lp0 at uba? csr 0177514 vector lpintr controller tm0 at uba? csr 0172520 vector tmintr tape te0 at tm0 drive 0 tape te1 at tm0 drive 1 controller sc0 at uba? csr 0176700 vector upintr disk up0 at sc0 drive 0 disk up1 at sc0 drive 1 controller uda0 at uba? csr 0177550 vector udintr disk ra0 at uda0 drive 0 disk ra1 at uda0 drive 1 device dn0 at uba? csr 0160020 vector dnintr device dh0 at uba? csr 0160020 vector dhrint dhxint device dh1 at uba? csr 0160040 vector dhrint dhxint device dz0 at uba? csr 0160100 flags 0xff vector dzrint dzxint device dz1 at uba? csr 0160110 flags 0xff vector dzrint dzxint device dz2 at uba? csr 0160120 flags 0xff vector dzrint dzxint device dz3 at uba? csr 0160130 flags 0xff vector dzrint dzxint device dz4 at uba? csr 0160140 flags 0xff vector dzrint dzxint device dz5 at uba? csr 0160150 flags 0xff vector dzrint dzxint device dz6 at uba? csr 0160160 flags 0xff vector dzrint dzxint device dz7 at uba? csr 0160170 flags 0xff vector dzrint dzxint controller zs0 at uba? csr 0172520 vector tsintr device ts0 at zs0 drive 0 @ik7>>A'&iJ6i #define VAX780 1 #define VAX750 1 #include "../h/param.h" #include "../h/pte.h" #include "../h/buf.h" #include "../h/vmmeter.h" #include "../h/vmparam.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/cmap.h" #include "../h/map.h" #include "../h/ubareg.h" #include "../h/ubavar.h" #include "../h/proc.h" #include "../h/rpb.h" main() { register struct proc *p = (struct proc *)0; register struct uba_regs *uba = (struct uba_regs *)0; register struct uba_hd *uh = (struct uba_hd *)0; register struct vmmeter *vm = (struct vmmeter *)0; register struct user *up = (struct user *)0; struct rpb *rp = (struct rpb *)0; printf("#ifdef LOCORE\n"); printf("#define\tP_LINK %d\n", &p->p_link); printf("#define\tP_RLINK %d\n", &p->p_rlink); printf("#define\tP_ADDR %d\n", &p->p_addr); printf("#define\tP_PRI %d\n", &p->p_pri); printf("#define\tP_STAT %d\n", &p->p_stat); printf("#define\tP_WCHAN %d\n", &p->p_wchan); printf("#define\tSSLEEP %d\n", SSLEEP); printf("#define\tSRUN %d\n", SRUN); printf("#define\tUBA_BRRVR %d\n", uba->uba_brrvr); printf("#define\tUH_UBA %d\n", &uh->uh_uba); printf("#define\tUH_VEC %d\n", &uh->uh_vec); printf("#define\tUH_SIZE %d\n", sizeof (struct uba_hd)); printf("#define\tRP_FLAG %d\n", &rp->rp_flag); printf("#define\tV_SWTCH %d\n", &vm->v_swtch); printf("#define\tV_TRAP %d\n", &vm->v_trap); printf("#define\tV_SYSCALL %d\n", &vm->v_syscall); printf("#define\tV_INTR %d\n", &vm->v_intr); printf("#define\tV_PDMA %d\n", &vm->v_pdma); printf("#define\tUPAGES %d\n", UPAGES); printf("#define\tCLSIZE %d\n", CLSIZE); printf("#define\tSYSPTSIZE %d\n", SYSPTSIZE); printf("#define\tUSRPTSIZE %d\n", USRPTSIZE); printf("#else\n"); printf("asm(\".set\tU_ARG,%d\");\n", up->u_arg); printf("asm(\".set\tU_QSAV,%d\");\n", up->u_qsav); printf("#endif\n"); } ((@ik#E6h258;'&i6i # # Makefile for Berkeley Virtual Vax/Unix, February 1981 # # This makefile is constructed from a machine description: # config machine # Most changes should be made in the machine description # /usr/sys/conf/``machineid'' # after which you should do # config machineid # Generic makefile changes should be made in # /usr/sys/conf/makefile # after which config should be rerun for all machines. # # N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE # IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING # # -DINSECURE old style non-vanishing suid bits # -DUNFAST don't compile in inline expansions and speedups # -DPGINPROF gather statistics about pagein/pageout activity # -DDISKMON monitor disk cacheing activity (bio.c) # -DINTRLVE compile in code for file systems interleaved across drives # -DTRACE compile in kernel tracing hooks # C2= /lib/c2 COPTS= ${IDENT} -DKERNEL -DVMUNIX CFLAGS= -O ${COPTS} AHEADS= ../h/pcb.m %OBJS %CFILES %LOAD clean: rm -f eddep *vmunix* tags *.o locore.i [a-tv-z]*.s touch errs linterrs lint: /tmp @lint -hbxn -I. -DGENERIC ${COPTS} ../sys/Locore.c \ ${CFILES} ../dev/swapgeneric.c ioconf.c | \ grep -v 'struct/union .* never defined' | \ grep -v 'possible pointer alignment problem' ../sys/symbols.sort: ../sys/symbols.raw grep -v '^#' ../sys/symbols.raw \ | sed 's/^ //' | sort | uniq > ../sys/symbols.sort locore.o: assym.s ${AHEADS} ../sys/scb.s ../sys/locore.s ubglue.s \ ../h/mtpr.h ../h/trap.h ../h/psl.h ../h/pte.h ../h/cpu.h ../h/mtpr.h mba.h cat assym.s ../sys/scb.s ../sys/locore.s ubglue.s > locore.c cc -E -DLOCORE ${COPTS} locore.c > locore.i @echo 'as -o locore.o $${AHEADS} locore.i' @as -o locore.o ${AHEADS} locore.i @rm locore.i # the following is necessary because autoconf.o depends on #if GENERIC autoconf.o: makefile # the following are necessary because the files depend on the types of # vax cpu's included in the system configuration clock.o machdep.o autoconf.o conf.o cons.o flp.o mba.o uba.o vaxcpu.o : makefile assym.s: ../h/param.h ../h/pte.h ../h/buf.h ../h/vmparam.h ../h/vmmeter.h \ ../h/dir.h ../h/cmap.h ../h/map.h ../h/ubavar.h ../h/proc.h cc ${IDENT} ../conf/genassym.c; ./a.out >assym.s; rm -f a.out ../h/param.h: /usr/include/signal.h touch ./touch ../h/param.h ../h/tty.h: /usr/include/sgtty.h ../h/ioctl.h touch ./touch ../h/tty.h ../h/user.h: ../h/pcb.h ../h/dmap.h ../h/vtimes.h ../h/types.h \ /usr/include/errno.h touch ./touch ../h/user.h ../h/vm.h: ../h/vmmac.h ../h/vmmeter.h ../h/vmparam.h ../h/vmsystm.h touch ./touch ../h/vm.h ../sys/sysent.c: ../sys/vmsysent.c touch ./touch ../sys/sysent.c touch: ../conf/touch.c cc ../conf/touch.c -o touch depend: grep '^#include' ${CFILES} | grep -v '<' | \ sed 's/:[^"]*"\([^"]*\)".*/: \1/' | \ sed 's/\.c/.o/' | sed 's,../[a-z]*/,,' | \ awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \ else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \ else rec = rec " " $$2 } } \ END { print rec } ' > makedep echo '$$r makedep' >>eddep echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep echo '$$r makedep' >>eddep echo 'w' >>eddep cp makefile makefile.bak ed - makefile < eddep rm eddep makedep tags: /usr/ucb/ctags ${CFILES} print: @pr -f makefile ../sys/TODO linterrs @/usr/ucb/ctags -x ${CFILES} | pr -f -h XREF @(size vmunix *.o) | pr -f -h sizes @ls -ls | pr -f @cd ../h; ls -ls | pr -f ; pr -f *.m *.h @cd ../sys; pr -f asm.sed Locore.c scb.s locore.s @pr -f ${CFILES} ioconf.o: ioconf.c ../h/param.h ../h/pte.h ../h/buf.h ../h/map.h \ ../h/mbavar.h ../h/vm.h ../h/ubavar.h ${CC} -I. -c -S ${COPTS} ioconf.c ${C2} ioconf.s | sed -f ../sys/asm.sed | ${AS} -o ioconf.o rm -f ioconf.s param.c: ../sys/param.c cp ../sys/param.c . param.o: param.c makefile ${CC} -c -O ${IDENT} ${PARAM} param.c %RULES # DO NOT DELETE THIS LINE -- make depend uses it @ik@rNd,/'&i2ڡ2ڡ sys/acct.c standard sys/alloc.c standard sys/calloc.c standard sys/clock.c standard sys/fio.c standard sys/iget.c standard sys/ioctl.c standard sys/machdep.c standard sys/main.c standard sys/nami.c standard sys/partab.c standard sys/pipe.c standard sys/prf.c standard sys/prim.c standard sys/rdwri.c standard sys/rmap.c standard sys/sig.c standard sys/slp.c standard sys/subr.c standard sys/sys.c standard sys/sys1.c standard sys/sys2.c standard sys/sys3.c standard sys/sys4.c standard sys/sysent.c standard sys/text.c standard sys/trap.c standard sys/vmdrum.c standard sys/vmmem.c standard sys/vmmon.c standard sys/vmpage.c standard sys/vmproc.c standard sys/vmpt.c standard sys/vmsched.c standard sys/vmsubr.c standard sys/vmswap.c standard sys/vmsys.c standard sys/udiv.s standard sys/urem.s standard dev/autoconf.c standard device-driver dev/bio.c standard dev/bk.c optional bk device-driver dev/conf.c standard dev/cons.c standard dev/ct.c optional ct device-driver dev/dh.c optional dh device-driver dev/dkbad.c standard dev/dkleave.c standard dev/dn.c optional dn device-driver dev/dsort.c standard dev/dz.c optional dz device-driver dev/flp.c standard dev/hp.c optional hp device-driver dev/ht.c optional tu device-driver dev/lp.c optional lp device-driver dev/mba.c optional mba device-driver dev/mem.c standard dev/mx1.c standard dev/mx2.c standard dev/mt.c optional mu device-driver dev/pty.c optional pty dev/rk.c optional rk device-driver dev/sw.c standard dev/tm.c optional te device-driver dev/ts.c optional ts device-driver dev/tty.c standard dev/ttynew.c standard dev/ttyold.c standard dev/tu.c standard dev/uba.c standard device-driver dev/uda.c optional ra device-driver dev/up.c optional up device-driver dev/va.c optional va device-driver dev/vaxcpu.c standard dev/vp.c optional vp device-driver @ikG7")7&iJ6i #include "../h/param.h" #include "../h/conf.h" /* * RP0?+UP0? configuration * root on hp0a * paging on hp0b and then up0b */ dev_t rootdev = makedev(0, 0); dev_t pipedev = makedev(0, 0); dev_t argdev = makedev(0, 1); dev_t dumpdev = makedev(0, 1); int dumplo = 33340 - 10 * 2048; /* * Nswap is the basic number of blocks of swap per * swap device, and is multiplied by nswdev after * nswdev is determined at boot. */ int nswap = 33440; struct swdevt swdevt[] = { makedev(0, 1), 0, /* hp0b */ makedev(2, 1), 0, /* up0b */ 0, 0, }; ((@ik^ ~&&&i6i #include #include main(argc, argv) int argc; char **argv; { argc--, argv++; while (argc > 0) { struct stat stb; int c, f; if (stat(*argv, &stb) < 0) goto bad; if (chmod(*argv, stb.st_mode | 0200) < 0) goto bad; f = open(*argv, 2); if (f < 0) goto bad; lseek(f, 0, 0); read(f, &c, 1); lseek(f, 0, 0); write(f, &c, 1); close(f); chmod(*argv, stb.st_mode); argc--, argv++; continue; bad: perror(*argv); argc--, argv++; continue; } } @ik?L ../sys/symbols.sort locore.o: assym.s ${AHEADS} ../sys/scb.s ../sys/locore.s ubglue.s \ ../h/mtpr.h ../h/trap.h ../h/psl.h ../h/pte.h ../h/cpu.h ../h/mtpr.h mba.h cat assym.s ../sys/scb.s ../sys/locore.s ubglue.s > locore.c cc -E -DLOCORE ${COPTS} locore.c > locore.i @echo 'as -o locore.o $${AHEADS} locore.i' @as -o locore.o ${AHEADS} locore.i @rm locore.i # the following is necessary because autoconf.o depends on #if GENERIC autoconf.o: makefile # the following are necessary because the files depend on the types of # vax cpu's included in the system configuration clock.o machdep.o autoconf.o conf.o cons.o flp.o mba.o uba.o vaxcpu.o : makefile assym.s: ../h/param.h ../h/pte.h ../h/buf.h ../h/vmparam.h ../h/vmmeter.h \ ../h/dir.h ../h/cmap.h ../h/map.h ../h/ubavar.h ../h/proc.h cc ${IDENT} ../conf/genassym.c; ./a.out >assym.s; rm -f a.out ../h/param.h: /usr/include/signal.h touch ./touch ../h/param.h ../h/tty.h: /usr/include/sgtty.h ../h/ioctl.h touch ./touch ../h/tty.h ../h/user.h: ../h/pcb.h ../h/dmap.h ../h/vtimes.h ../h/types.h \ /usr/include/errno.h touch ./touch ../h/user.h ../h/vm.h: ../h/vmmac.h ../h/vmmeter.h ../h/vmparam.h ../h/vmsystm.h touch ./touch ../h/vm.h ../sys/sysent.c: ../sys/vmsysent.c touch ./touch ../sys/sysent.c touch: ../conf/touch.c cc ../conf/touch.c -o touch depend: grep '^#include' ${CFILES} | grep -v '<' | \ sed 's/:[^"]*"\([^"]*\)".*/: \1/' | \ sed 's/\.c/.o/' | sed 's,../[a-z]*/,,' | \ awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \ else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \ else rec = rec " " $$2 } } \ END { print rec } ' > makedep echo '$$r makedep' >>eddep echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep echo '$$r makedep' >>eddep echo 'w' >>eddep cp makefile makefile.bak ed - makefile < eddep rm eddep makedep tags: /usr/ucb/ctags ${CFILES} print: @pr -f makefile ../sys/TODO linterrs @/usr/ucb/ctags -x ${CFILES} | pr -f -h XREF @(size vmunix *.o) | pr -f -h sizes @ls -ls | pr -f @cd ../h; ls -ls | pr -f ; pr -f *.m *.h @cd ../sys; pr -f asm.sed Locore.c scb.s locore.s @pr -f ${CFILES} ioconf.o: ioconf.c ../h/param.h ../h/pte.h ../h/buf.h ../h/map.h \ ../h/mbavar.h ../h/vm.h ../h/ubavar.h ${CC} -I. -c -S ${COPTS} ioconf.c ${C2} ioconf.s | sed -f ../sys/asm.sed | ${AS} -o ioconf.o rm -f ioconf.s param.c: ../sys/param.c cp ../sys/param.c . param.o: param.c makefile ${CC} -c -O ${IDENT} ${PARAM} param.c acct.o: ../sys/acct.c ${CC} -I. -c -S ${COPTS} ../sys/acct.c ${C2} acct.s | sed -f ../sys/asm.sed | ${AS} -o acct.o rm -f acct.s alloc.o: ../sys/alloc.c ${CC} -I. -c -S ${COPTS} ../sys/alloc.c ${C2} alloc.s | sed -f ../sys/asm.sed | ${AS} -o alloc.o rm -f alloc.s calloc.o: ../sys/calloc.c ${CC} -I. -c -S ${COPTS} ../sys/calloc.c ${C2} calloc.s | sed -f ../sys/asm.sed | ${AS} -o calloc.o rm -f calloc.s clock.o: ../sys/clock.c ${CC} -I. -c -S ${COPTS} ../sys/clock.c ${C2} clock.s | sed -f ../sys/asm.sed | ${AS} -o clock.o rm -f clock.s fio.o: ../sys/fio.c ${CC} -I. -c -S ${COPTS} ../sys/fio.c ${C2} fio.s | sed -f ../sys/asm.sed | ${AS} -o fio.o rm -f fio.s iget.o: ../sys/iget.c ${CC} -I. -c -S ${COPTS} ../sys/iget.c ${C2} iget.s | sed -f ../sys/asm.sed | ${AS} -o iget.o rm -f iget.s ioctl.o: ../sys/ioctl.c ${CC} -I. -c -S ${COPTS} ../sys/ioctl.c ${C2} ioctl.s | sed -f ../sys/asm.sed | ${AS} -o ioctl.o rm -f ioctl.s machdep.o: ../sys/machdep.c ${CC} -I. -c -S ${COPTS} ../sys/machdep.c ${C2} machdep.s | sed -f ../sys/asm.sed | ${AS} -o machdep.o rm -f machdep.s main.o: ../sys/main.c ${CC} -I. -c -((S ${COPTS} ../sys/main.c ${C2} main.s | sed -f ../sys/asm.sed | ${AS} -o main.o rm -f main.s nami.o: ../sys/nami.c ${CC} -I. -c -S ${COPTS} ../sys/nami.c ${C2} nami.s | sed -f ../sys/asm.sed | ${AS} -o nami.o rm -f nami.s partab.o: ../sys/partab.c ${CC} -I. -c -S ${COPTS} ../sys/partab.c ${C2} partab.s | sed -f ../sys/asm.sed | ${AS} -o partab.o rm -f partab.s pipe.o: ../sys/pipe.c ${CC} -I. -c -S ${COPTS} ../sys/pipe.c ${C2} pipe.s | sed -f ../sys/asm.sed | ${AS} -o pipe.o rm -f pipe.s prf.o: ../sys/prf.c ${CC} -I. -c -S ${COPTS} ../sys/prf.c ${C2} prf.s | sed -f ../sys/asm.sed | ${AS} -o prf.o rm -f prf.s prim.o: ../sys/prim.c ${CC} -I. -c -S ${COPTS} ../sys/prim.c ${C2} prim.s | sed -f ../sys/asm.sed | ${AS} -o prim.o rm -f prim.s rdwri.o: ../sys/rdwri.c ${CC} -I. -c -S ${COPTS} ../sys/rdwri.c ${C2} rdwri.s | sed -f ../sys/asm.sed | ${AS} -o rdwri.o rm -f rdwri.s rmap.o: ../sys/rmap.c ${CC} -I. -c -S ${COPTS} ../sys/rmap.c ${C2} rmap.s | sed -f ../sys/asm.sed | ${AS} -o rmap.o rm -f rmap.s sig.o: ../sys/sig.c ${CC} -I. -c -S ${COPTS} ../sys/sig.c ${C2} sig.s | sed -f ../sys/asm.sed | ${AS} -o sig.o rm -f sig.s slp.o: ../sys/slp.c ${CC} -I. -c -S ${COPTS} ../sys/slp.c ${C2} slp.s | sed -f ../sys/asm.sed | ${AS} -o slp.o rm -f slp.s subr.o: ../sys/subr.c ${CC} -I. -c -S ${COPTS} ../sys/subr.c ${C2} subr.s | sed -f ../sys/asm.sed | ${AS} -o subr.o rm -f subr.s sys.o: ../sys/sys.c ${CC} -I. -c -S ${COPTS} ../sys/sys.c ${C2} sys.s | sed -f ../sys/asm.sed | ${AS} -o sys.o rm -f sys.s sys1.o: ../sys/sys1.c ${CC} -I. -c -S ${COPTS} ../sys/sys1.c ${C2} sys1.s | sed -f ../sys/asm.sed | ${AS} -o sys1.o rm -f sys1.s sys2.o: ../sys/sys2.c ${CC} -I. -c -S ${COPTS} ../sys/sys2.c ${C2} sys2.s | sed -f ../sys/asm.sed | ${AS} -o sys2.o rm -f sys2.s sys3.o: ../sys/sys3.c ${CC} -I. -c -S ${COPTS} ../sys/sys3.c ${C2} sys3.s | sed -f ../sys/asm.sed | ${AS} -o sys3.o rm -f sys3.s sys4.o: ../sys/sys4.c ${CC} -I. -c -S ${COPTS} ../sys/sys4.c ${C2} sys4.s | sed -f ../sys/asm.sed | ${AS} -o sys4.o rm -f sys4.s sysent.o: ../sys/sysent.c ${CC} -I. -c -S ${COPTS} ../sys/sysent.c ${C2} sysent.s | sed -f ../sys/asm.sed | ${AS} -o sysent.o rm -f sysent.s text.o: ../sys/text.c ${CC} -I. -c -S ${COPTS} ../sys/text.c ${C2} text.s | sed -f ../sys/asm.sed | ${AS} -o text.o rm -f text.s trap.o: ../sys/trap.c ${CC} -I. -c -S ${COPTS} ../sys/trap.c ${C2} trap.s | sed -f ../sys/asm.sed | ${AS} -o trap.o rm -f trap.s vmdrum.o: ../sys/vmdrum.c ${CC} -I. -c -S ${COPTS} ../sys/vmdrum.c ${C2} vmdrum.s | sed -f ../sys/asm.sed | ${AS} -o vmdrum.o rm -f vmdrum.s vmmem.o: ../sys/vmmem.c ${CC} -I. -c -S ${COPTS} ../sys/vmmem.c ${C2} vmmem.s | sed -f ../sys/asm.sed | ${AS} -o vmmem.o rm -f vmmem.s vmmon.o: ../sys/vmmon.c ${CC} -I. -c -S ${COPTS} ../sys/vmmon.c ${C2} vmmon.s | sed -f ../sys/asm.sed | ${AS} -o vmmon.o rm -f vmmon.s vmpage.o: ../sys/vmpage.c ${CC} -I. -c -S ${COPTS} ../sys/vmpage.c ${C2} vmpage.s | sed -f ../sys/asm.sed | ${AS} -o vmpage.o rm -f vmpage.s vmproc.o@ik`o,>8)&0377)) /* minor part of a device */ #define minor(x) ((int)((x)&0377)) /* make a device number */ #define makedev(x,y) ((dev_t)(((x)<<8) | (y))) typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; /* SHOULD USE long RATHER THAN int HERE BUT IT WOULD GIVE LINT ON THE KERNEL */ /* GASTRIC DISTRESS AND DON'T HAVE TIME TO FIX THAT JUST NOW */ typedef struct _physadr { int r[1]; } *physadr; typedef int daddr_t; typedef char * caddr_t; typedef u_short ino_t; typedef int swblk_t; typedef int size_t; typedef int time_t; typedef int label_t[14]; typedef short dev_t; typedef int off_t; @i ku&$i&&i46i /* htreg.h 4.1 81/03/21 */ struct htdevice { int htcs1; /* control status register */ int htds; /* drive status register */ int hter; /* error register */ int htmr; /* maintenance register */ int htas; /* attention status register */ int htfc; /* frame counter */ int htdt; /* drive type register */ int htck; /* nrzi check (crc) error character */ int htsn; /* serial number register */ int httc; /* tape controll register */ }; /* htcs1 */ #define HT_GO 000001 /* go bit */ #define HT_SENSE 000000 /* no operations (sense) */ #define HT_REWOFFL 000002 /* rewind offline */ #define HT_REW 000006 /* rewind */ #define HT_DCLR 000010 /* drive clear */ #define HT_RIP 000020 /* read in preset */ #define HT_ERASE 000024 /* erase */ #define HT_WEOF 000026 /* write tape mark */ #define HT_SFORW 000030 /* space forward */ #define HT_SREV 000032 /* space reverse */ #define HT_WCHFWD 000050 /* write check forward */ #define HT_WCHREV 000056 /* write check reverse */ #define HT_WCOM 000060 /* write forward */ #define HT_RCOM 000070 /* read forward */ #define HT_RREV 000076 /* read reverse */ /* htds */ #define HTDS_ATA 0100000 /* attention active */ #define HTDS_ERR 0040000 /* composite error */ #define HTDS_PIP 0020000 /* positioning in progress */ #define HTDS_MOL 0010000 /* medium on line */ #define HTDS_WRL 0004000 /* write lock */ #define HTDS_EOT 0002000 /* end of tape */ /* bit 9 is unused */ #define HTDS_DPR 0000400 /* drive present (always 1) */ #define HTDS_DRY 0000200 /* drive ready */ #define HTDS_SSC 0000100 /* slave status change */ #define HTDS_PES 0000040 /* phase-encoded status */ #define HTDS_SDWN 0000020 /* settle down */ #define HTDS_IDB 0000010 /* identification burst */ #define HTDS_TM 0000004 /* tape mark */ #define HTDS_BOT 0000002 /* beginning of tape */ #define HTDS_SLA 0000001 /* slave attention */ #define HTDS_BITS \ "\10\20ATA\17ERR\16PIP\15MOL\14WRL\13EOT\11DPR\10DRY\ \7SSC\6PES\5SDWN\4IDB\3TM\2BOT\1SLA" /* hter */ #define HTER_CORCRC 0100000 /* correctible data or ecc */ #define HTER_UNS 0040000 /* unsafe */ #define HTER_OPI 0020000 /* operation incomplete */ #define HTER_DTE 0010000 /* drive timing error */ #define HTER_NEF 0004000 /* non-executable function */ #define HTER_CSITM 0002000 /* correctable skew/illegal tape mark */ #define HTER_FCE 0001000 /* frame count error */ #define HTER_NSG 0000400 /* non-standard gap */ #define HTER_PEFLRC 0000200 /* format error or lrc error */ #define HTER_INCVPE 0000100 /* incorrectable data error or vertical parity error */ #define HTER_DPAR 0000040 /* data parity error */ #define HTER_FMT 0000020 /* format error */ #define HTER_CPAR 0000010 /* control bus parity error */ #define HTER_RMR 0000004 /* register modification refused */ #define HTER_ILR 0000002 /* illegal register */ #define HTER_ILF 0000001 /* illegal function */ #define HTER_BITS \ "\10\20CORCRC\17UNS\16OPI\15DTE\14NEF\13CSITM\12FCE\11NSG\10PEFLRC\ \7INCVPE\6DPAR\5FMT\4CPAR\3RMR\2ILR\1ILF" #define HTER_HARD \ (HTER_UNS|HTER_OPI|HTER_NEF|HTER_DPAR|HTER_FMT|HTER_CPAR| \ HTER_RMR|HTER_ILR|HTER_ILF) /* htdt */ #define HTDT_NSA 0100000 /* not sector addressed; always 1 */ #define HTDT_TAP 0040000 /* tape; always 1 */ #define HTDT_MOH 0020000 /* moving head; always 0 */ #define HTDT_7CH 0010000 /* 7 channel; always 0 */ #define HTDT_DRQ 0004000 /* drive requested; always 0 */ #define HTDT_SPR 0002000 /* slave present */ /* bit 9 is spare */ /* bits 8-0 are formatter/transport type */ /* httc */ #define HTTC_ACCL 0100000 /* transport is not reading/writing */ #define HTTC_FCS 0040000 /* frame count status */ #define HTTC_SAC 0020000 /* slave address change */ #define HTTC_EAODTE 0010000 /* enable abort on data xfer errors */ /* bits 8-10 are density select */ #define HTTC_800BPI 0001400 /* in bits 8-10, dens=1600 */ #define HTTC_1600BPI 0002000 /* in bits 8-10, dens=800 */ /* bits 4-7 are format select */ #define HTTC_PDP11 0000300 /* in bits 4-7, pdp11 normal format */ #define HTTC_EVEN 0000010 /* select even parity */ /* bits 0 - 2 are slave select */ #define b_repcnt b_bcount #define b_command b_resid @i kXtD DTWZ]`cfilor[hg,hȪ  4 $S^Юn PPՀPpPP3 Pl0 ^׬լ1ЬP`P`-мV׬1Pu1Pv 1<x;pPmPsѬ1ЬP`$0PI3ЬP`/׬;Pd,Pf;Vf1=fPPDc;_;k;Ѭ3:S/V/ЬP`w/P2ЬP`/2Ѭ ЬPРP3PPd25Ѭ ЬPРP3PPq3}9>.2[:ݫkY3 [kP`2:2:2P:1wPv:2cPf:Z:[PXxP"B:28-9+:::99211~1+#91-|1~0"z90-g9{2rݏpN9{P8929~0"ŏp9~9t0U-ŏp8QPQ2,0~50F"8 0-0~0(("8/,81ݏLu8P_8Y8~/!ŏLD8~58/p,ŏL%8QPQE1+/P/íPW W7WP7PW0b6#+^/P~. W7.+PW0M+#/~. ߭.o+/~v. 7a.B+76U06P6x6~PtPP~. x6~6-*x6QPQ/!X*pE6Z1X12(~/> /1 1ݪX/2.~/ 6XPPǏPW0WPxPP5P~PP~}/WWP2.QPQf/WWP2.QPQ1WPxPP5P~PWPP߭Z5 W40P8PPƏPPPWݪH.)5ZPǏpP~ݪHQ4ZPǏpP~Ǐ0PPWPPP~H~ 4X2.PxPPPxPPXP4PPƏLPďLP4PP(1#Z= PZ|s 2(rWjxWPXPXh[hPThPPY49hPPO4+hP<4P~+P P4PXZ WW03 -Wrx0PXPxWQQPXh[hPThPP39hPP3+hP3P~*P P3PXZJ WW4.3 ,-SW|2.PxPPxPPXP$PxWQQPXh[hPThPP-39hPP#3+hP3P~)P P2PXZWW81{2 ,WxWPP~ZyWa2 c,L2 P,qpZŏpG2P82PZP142Y1թ<1W?2YPǏLP~W4PP2PW4PPGiFWW4F21YPǏLP~4PƏPPP~ݩ0LYŏL1P1PYP1VW # d%( apP 1MpP2(~ +?5pPРP[0 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eB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYjp ~P [[ BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[H;1xݏPZZ  YYX ZYYXZYZ~(PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP [ [[[2  Ь[Z = 8[ePZ~9PZ ݫ ԫ kZP{(P^߭ݬDPPPݬݏ tݬݬݏtݬ6a.a aaaaa~*PYa[ak$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZJa [ P, %s: %x<%x>too many disk blocks lost swap map: start %x size %x overlap in swap mappings: lost swap map: start %x size %x swap space ends at %x at %4x size %4x type %s pid %d readgetpt error reading frame %x readError reading core page %x %xswap page %x: read samepid %d u. pages: %xcore u. readswap u. read page %x %s page %x %s, %d bytes differ page number out of range: page %x type %s pid %d dup page pte %xpte %x and as %s in pid %d page %x type %s pid %d lostlockedmemcm %x %s page %x [%x, %x [text c->c_ndx %d?] (=pid %d) [text c->c_ndx %d?] (=pid %d)] free gone lock want intrans blkno %x mdev %d hlink %x page %x <<< link to non free block: in %x to %x bad free link into non free blockfree list link out of range: in %x to %x bad link infreefreereadget failed on %x vstodbpanic!: %s @(#)analyze.c 4.4 (Berkeley) 5/18/81_proc_usrpt_Usrptmap_firstfree_maxfree_text_freemem_cmap_ecmap_swapmap_nproc_ntext_nswapmapDFREEDDATADSTACKDTEXTDUDOTDPAGETlostdatastackudotpagettextfreeintransitsystextdatastackrUnknown error: #x<$@i kI+V$9<?BE&&i*[6i /* rkreg.h 4.2 81/05/09 */ #define NRK7CYL 815 #define NRK6CYL 411 #define NRKSECT 22 #define NRKTRK 3 struct rkdevice { short rkcs1; /* control status reg 1 */ short rkwc; /* word count */ u_short rkba; /* bus address */ short rkda; /* disk address */ short rkcs2; /* control status reg 2 */ short rkds; /* drive status */ short rker; /* driver error register */ short rkatt; /* attention status/offset register */ short rkcyl; /* current cylinder register */ short rkxxx; short rkdb; /* data buffer register */ short rkmr1; /* maint reg 1 */ short rkec1; /* burst error bit position */ short rkec2; /* burst error bit pattern */ short rkmr2; /* maint reg 2 */ short rkmr3; /* maint reg 3 */ }; /* rkcs1 */ #define RK_CCLR 0100000 /* controller clear (also error) */ #define RK_CERR RK_CCLR #define RK_DI 0040000 /* drive interrupt */ #define RK_DTCPAR 0020000 /* drive to controller parity */ #define RK_CFMT 0010000 /* 18 bit word format */ #define RK_CTO 0004000 /* controller timeout */ #define RK_CDT 0002000 /* drive type (rk07/rk06) */ /* bits 8 and 9 are the extended bus address */ #define RK_CRDY 0000200 /* controller ready */ #define RK_IE 0000100 /* interrupt enable */ /* bits 1 to 4 are the function code */ #define RK_GO 0000001 /* commands */ #define RK_SELECT 000 /* select drive */ #define RK_PACK 002 /* pack acknowledge */ #define RK_DCLR 004 /* drive clear */ #define RK_UNLOAD 006 /* unload */ #define RK_START 010 /* start spindle */ #define RK_RECAL 012 /* recalibrate */ #define RK_OFFSET 014 /* offset */ #define RK_SEEK 016 /* seek */ #define RK_READ 020 /* read data */ #define RK_WRITE 022 /* write data */ #define RK_RHDR 026 /* read header */ #define RK_WHDR 030 /* write header */ /* rkcs2 */ #define RKCS2_DLT 0100000 /* data late */ #define RKCS2_WCE 0040000 /* write check */ #define RKCS2_UPE 0020000 /* unibus parity */ #define RKCS2_NED 0010000 /* non-existant drive */ #define RKCS2_NEM 0004000 /* non-existant memory */ #define RKCS2_PGE 0002000 /* programming error */ #define RKCS2_MDS 0001000 /* multiple drive select */ #define RKCS2_UFE 0000400 /* unit field error */ #define RKCS2_OR 0000200 /* output ready */ #define RKCS2_IR 0000100 /* input ready */ #define RKCS2_SCLR 0000040 /* subsystem clear */ #define RKCS2_BAI 0000020 /* bus address increment inhibit */ #define RKCS2_RLS 0000010 /* release */ /* bits 0-2 are drive select */ #define RKCS2_BITS \ "\10\20DLT\17WCE\16UPE\15NED\14NEM\13PGE\12MDS\11UFE\ \10OR\7IR\6SCLR\5BAI\4RLS" #define RKCS2_HARD (RKCS2_NED|RKCS2_PGE) /* rkds */ #define RKDS_SVAL 0100000 /* status valid */ #define RKDS_CDA 0040000 /* current drive attention */ #define RKDS_PIP 0020000 /* positioning in progress */ /* bit 12 is spare */ #define RKDS_WRL 0004000 /* write lock */ /* bits 9 and 10 are spare */ #define RKDS_DDT 0000400 /* disk drive type */ #define RKDS_DRDY 0000200 /* drive ready */ #define RKDS_VV 0000100 /* volume valid */ #define RKDS_DROT 0000040 /* drive off track */ #((define RKDS_SPLS 0000020 /* speed loss */ #define RKDS_ACLO 0000010 /* ac low */ #define RKDS_OFF 0000004 /* offset mode */ #define RKDS_DRA 0000001 /* drive available */ #define RKDS_DREADY (RKDS_DRA|RKDS_VV|RKDS_DRDY) #define RKDS_BITS \ "\10\20SVAL\17CDA\16PIP\14WRL\11DDT\ \10DRDY\7VV\6DROT\5SPLS\4ACLO\3OFF\1DRA" #define RKDS_HARD (RKDS_ACLO|RKDS_SPLS) /* rker */ #define RKER_DCK 0100000 /* data check */ #define RKER_UNS 0040000 /* drive unsafe */ #define RKER_OPI 0020000 /* operation incomplete */ #define RKER_DTE 0010000 /* drive timing error */ #define RKER_WLE 0004000 /* write lock error */ #define RKER_IDAE 0002000 /* invalid disk address error */ #define RKER_COE 0001000 /* cylinder overflow error */ #define RKER_HRVC 0000400 /* header vertical redundancy check */ #define RKER_BSE 0000200 /* bad sector error */ #define RKER_ECH 0000100 /* hard ecc error */ #define RKER_DTYE 0000040 /* drive type error */ #define RKER_FMTE 0000020 /* format error */ #define RKER_DRPAR 0000010 /* control-to-drive parity error */ #define RKER_NXF 0000004 /* non-executable function */ #define RKER_SKI 0000002 /* seek incomplete */ #define RKER_ILF 0000001 /* illegal function */ #define RKER_BITS \ "\10\20DCK\17UNS\16OPI\15DTE\14WLE\13IDAE\12COE\11HRVC\ \10BSE\7ECH\6DTYE\5FMTE\4DRPAR\3NXF\2SKI\1ILF" #define RKER_HARD \ (RKER_WLE|RKER_IDAE|RKER_COE|RKER_DTYE|RKER_FMTE|RKER_ILF) /* offset bits in rkas */ #define RKAS_P400 0020 /* +400 RK06, +200 RK07 */ #define RKAS_M400 0220 /* -400 RK06, -200 RK07 */ #define RKAS_P800 0040 /* +800 RK06, +400 RK07 */ #define RKAS_M800 0240 /* -800 RK06, -400 RK07 */ #define RKAS_P1200 0060 /* +800 RK06, +400 RK07 */ #define RKAS_M1200 0260 /* -1200 RK06, -1200 RK07 */ @i kno$36&&ia36i /* scb.h 4.3 81/02/21 */ /* * VAX System control block layout */ struct scb { int (*scb_stray)(); /* reserved */ int (*scb_machchk)(); /* machine chack */ int (*scb_kspinval)(); /* KSP invalid */ int (*scb_powfail)(); /* power fail */ int (*scb_resinstr)(); /* reserved instruction */ int (*scb_custinst)(); /* XFC instr */ int (*scb_resopnd)(); /* reserved operand */ int (*scb_resaddr)(); /* reserved addr mode */ int (*scb_acv)(); /* access control violation */ int (*scb_tnv)(); /* translation not valid */ int (*scb_tracep)(); /* trace pending */ int (*scb_bpt)(); /* breakpoint instr */ int (*scb_compat)(); /* compatibility mode fault */ int (*scb_arith)(); /* arithmetic fault */ int (*scb_stray2)(); int (*scb_stray3)(); int (*scb_chmk)(); /* CHMK instr */ int (*scb_chme)(); /* CHME instr */ int (*scb_chms)(); /* CHMS instr */ int (*scb_chmu)(); /* CHMU instr */ int (*scb_sbisilo)(); /* SBI silo compare */ int (*scb_cmrd)(); /* corrected mem read data */ int (*scb_sbialert)(); /* SBI alert */ int (*scb_sbiflt)(); /* SBI fault */ int (*scb_wtime)(); /* memory write timeout */ int (*scb_stray4[8])(); int (*scb_soft[15])(); /* software interrupt */ int (*scb_timer)(); /* interval timer interrupt */ int (*scb_stray5[7])(); int (*scb_stray6[4])(); int (*scb_csdr)(); /* console storage receive */ int (*scb_csdx)(); /* console storage transmit */ int (*scb_ctr)(); /* console terminal receive */ int (*scb_ctx)(); /* console terminal transmit */ int (*scb_ipl14[16])(); /* device interrupts IPL 14 */ int (*scb_ipl15[16])(); /* " " IPL 15 */ int (*scb_ipl16[16])(); /* " " IPL 16 */ int (*scb_ipl17[16])(); /* " " IPL 17 */ int (*scb_ubaint[128])(); /* Unibus device intr */ }; #ifdef KERNEL extern struct scb scb; /* scb.scb_ubaint is the same as UNIvec */ #endif #define scbentry(f, how) ((int (*)())(((int)f)+how)) #define SCB_KSTACK 0 #define SCB_ISTACK 1 #define SCB_WCS 2 #define SCB_HALT 3 @i kwL$0&&i*[6i /* rpb.h 4.3 81/05/01 */ /* * The restart parameter block, which is a page in (very) low * core which runs after a crash. Currently, the restart * procedure takes a dump. */ struct rpb { struct rpb *rp_selfref; /* self-reference */ int (*rp_dumprout)(); /* routine to be called */ long rp_checksum; /* checksum of 31 words of dumprout */ long rp_flag; /* set to 1 when dumprout runs */ /* the dump stack grows from the end of the rpb page not to reach here */ }; #ifdef KERNEL extern struct rpb rpb; #endif @ik)V$-%&iQ6i /* msgbuf.h 4.2 81/02/19 */ #define MSG_MAGIC 0x063060 #define MSG_BSIZE (NBPG*CLSIZE - 2 * sizeof (long)) struct msgbuf { long msg_magic; long msg_bufx; char msg_bufc[MSG_BSIZE]; }; #ifdef KERNEL struct msgbuf msgbuf; #endif @ik8r$!$'*%&i@96i ((/* mbavar.h 4.15 81/04/08 */ /* * This file contains definitions related to the kernel structures * for dealing with the massbus adapters. * * Each mba has a mba_hd structure. * Each massbus device has a mba_device structure. * Each massbus slave has a mba_slave structure. * * At boot time we prowl the structures and fill in the pointers * for devices which we find. */ /* * Per-mba structure. * * The initialization routine uses the information in the mbdinit table * to initialize the what is attached to each massbus slot information. * It counts the number of devices on each mba (to see if bothering to * search/seek is appropriate). * * During normal operation, the devices attached to the mba which wish * to transfer are queued on the mh_act? links. */ struct mba_hd { short mh_active; /* set if mba is active */ short mh_ndrive; /* number of devices, to avoid seeks */ struct mba_regs *mh_mba; /* virt addr of mba */ struct mba_regs *mh_physmba; /* phys addr of mba */ struct mba_device *mh_mbip[8]; /* what is attached to each dev */ struct mba_device *mh_actf; /* head of queue to transfer */ struct mba_device *mh_actl; /* tail of queue to transfer */ }; /* * Per-device structure * (one for each RM/RP disk, and one for each tape formatter). * * This structure is used by the device driver as its argument * to the massbus driver, and by the massbus driver to locate * the device driver for a particular massbus slot. * * The device drivers hang ready buffers on this structure, * and the massbus driver will start i/o on the first such buffer * when appropriate. */ struct mba_device { struct mba_driver *mi_driver; short mi_unit; /* unit number to the system */ short mi_mbanum; /* the mba it is on */ short mi_drive; /* controller on mba */ short mi_dk; /* driver number for iostat */ short mi_alive; /* device exists */ short mi_type; /* driver specific unit type */ struct buf mi_tab; /* head of queue for this device */ struct mba_device *mi_forw; /* we could compute these every time, but hereby save time */ struct mba_regs *mi_mba; struct mba_drv *mi_drv; struct mba_hd *mi_hd; }; /* * Tape formatter slaves are specified by * the following information which is used * at boot time to initialize the tape driver * internal tables. */ struct mba_slave { struct mba_driver *ms_driver; short ms_ctlr; /* which of several formatters */ short ms_unit; /* which unit to system */ short ms_slave; /* which slave to formatter */ short ms_alive; }; /* * Per device-type structure. * * Each massbus driver defines entries for a set of routines used * by the massbus driver, as well as an array of types which are * acceptable to it. */ struct mba_driver { int (*md_attach)(); /* attach a device */ int (*md_slave)(); /* attach a slave */ int (*md_ustart)(); /* unit start routine */ int (*md_start)(); /* setup a data transfer */ int (*md_dtint)(); /* data transfer complete */ int (*md_ndint)(); /* non-data transfer interrupt */ short *md_type; /* array of drive type codes */ char *md_dname, *md_sname; /* device, slave names */ struct mba_device **md_info; /* backpointers to mbinit structs */ }; /* * Possible return values from unit start routines. */ #define MBU_NEXT 0 /* skip to next operation */ #define MBU_BUSY 1 /* dual port busy; wait for intr */ #define MBU_STARTED 2 /* non-data transfer started */ #define MBU_DODATA 3 /* data transfer ready; start mba */ /* * Possible return values from data transfer interrupt handling routines */ #define MBD_DONE 0 /* data transfer complete */ #define MBD_RETRY 1 /* error occurred, please retry */ #define MBD_RESTARTED 2 /* driver restarted i/o itself */ /* * Possible return values from non-data-transfer interrupt handling routines */ #define MBN_DONE 0 /* non-data transfer complete */ #define MBN_RETRY 1 /* failed; retry the operation */ #define MBN_SKIP 2 /* don't do anything */ /* * Clear attention status for specified device. */ #define mbclrattn(mi) ((mi)->mi_mba->mba_drv[0].mbd_as = 1 << (mi)->mi_drive) /* * Kernel definitions related to mba. */ #ifdef KERNEL int nummba; #if NMBA > 0 struct mba_hd mba_hd[NMBA]; extern Xmba0int(), Xmba1int(), Xmba2int(), Xmba3int(); extern struct mba_device mbdinit[]; extern struct mba_slave mbsinit[]; #endif #endif @ik]鍥$%&i[36i /* reboot.h 4.2 81/02/19 */ /* * Arguments to reboot system call. * These are passed to boot program in r11, * and on to init. */ #define RB_AUTOBOOT 0 /* flags for system auto-booting itself */ #define RB_ASKNAME 1 /* ask for file name to reboot from */ #define RB_SINGLE 2 /* reboot to single user only */ #define RB_NOSYNC 4 /* dont sync before reboot */ #define RB_HALT 8 /* don't reboot, just halt */ #define RB_PANIC 0 /* reboot due to panic */ #define RB_BOOT 1 /* reboot due to boot() */ @ik&iJ6i struct header { char sync; char ksize; unsigned short sum; char cntl; char ccntl; }; #define HDRSIZ 6 struct pack { short p_state; /* line state */ short p_bits; /* mask for getepack */ short p_rsize; /* input packet size */ short p_xsize; /* output packet size */ struct header p_ihbuf; /* input header */ struct header p_ohbuf; /* output header */ char *p_rptr; char p_mode; char **p_ipool; char p_xcount; /* # active output buffers */ char p_rcount; char p_nout,p_tout; char p_lpsize; /* log(psize/32) */ char p_timer; char p_obusy; char p_srxmit; char p_rwindow; /* window size */ char p_swindow; char p_msg; /* control msg */ char p_rmsg; /* repeated control msg */ char p_ps,p_pr; /* last packet sent, recv'd */ char p_rpr; char p_nxtps; /* next output seq number */ char p_imap; /* bit map of input buffers */ char p_pscopy; /* newest output packet */ char *p_ob[8]; /* output buffers */ char *p_ib[8]; /* input buffers */ char p_os[8]; /* output buffer status */ char p_is[8]; /* input buffer status */ short p_osum[8]; /* output checksums */ short p_isum[8]; /* input checksums */ DSYSTEM; }; #define CHECK 0125252 #define SYN 020 #define MOD8 7 #define ISCNTL(a) ((a & 0300)==0) #define MIN(a,b) ((at_linep) #define TURNOFF pkturnoff(tp) #ifdef VMUNIX #define UCOUNT u.u_count #else #define UCOUNT uio->u_count #endif #define S tp #define P pk->p_ttyp #define SDEF struct tty *tp #define FS , tp #define SIGNAL psignal(u.u_procp, SIGPIPE) #define TERROR pk->p_istate == R_ERROR #define SETERROR u.u_error = EIO #define OBUSY tp->t_state&BUSY #define ODEAD ((tp->t_state&CARR_ON)==0) char *getepack(); #define GETEPACK getepack(pk->p_bits) #define FREEPACK(a,b) freepack(a, b) #define q1 tp->t_rawq #define q2 tp->t_canq #define q3 tp->t_outq #define LOCK s = spl6() #define UNLOCK splx(s) #define DSYSTEM struct tty *p_ttyp #define ISYSTEM tp = pk->p_ttyp #define SLEEP(a, b) sleep((caddr_t)a, b) #define SLEEPNO (tp->t_chan!=NULL) #define WAKEUP(a) wakeup((caddr_t)a) #define PKGETPKT(p) #define DTOM(a) dtom(a) #include "../h/param.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/pk.h" #include "../h/tty.h" #include "../h/buf.h" #include "../h/proc.h" #include "../h/local.h" #include "../h/file.h" #ifdef PDP #include "../h/var.h" #endif #endif /* * user level */ #ifdef USER #define SLEEP(a, b) #define SIGNAL #define WAKEUP(a) #define DSYSTEM int p_ifn, p_ofn #define ISYSTEM #define GETEPACK malloc(pk->p_xsize) #define FREEPACK(a, b) free(a) #define OBUSY 0 #define PKGETPKT(p) pkgetpack(p); #define DTOM(a) 1; #define S ipk, ibuf, icount #define SDEF int icount; char *ibuf; struct pack *ipk #define UCOUNT icount #define IOMOVE(p, c, f) pkmove(p, ibuf, c, f) ; ibuf += c; UCOUNT -= c #define PADDR ipk #define TURNOFF #define LOCK #define UNLOCK #define SETERROR #define GENERROR(p, s) #define PACKSIZE 64 #define WINDOWS 3 #define PKDEBUG(l, f, s) { extern Debug; if (Debug >= l) fprintf(stderr, f, s);} #define PKASSERT(e, f, v) if (!(e)) {\ fprintf(stderr, "AERROR - (%s) ", "e");\ fprintf(stderr, f, v);\ pkfail();}; #endif @ik[^$< %&i J6i /* vmsystm.h 4.3 81/04/23 */ /* * Miscellaneous virtual memory subsystem variables and structures. */ #ifdef KERNEL int freemem; /* remaining blocks of free memory */ int avefree; /* moving average of remaining free blocks */ int avefree30; /* 30 sec (avefree is 5 sec) moving average */ int deficit; /* estimate of needs of new swapped in procs */ int nscan; /* number of scans in last second */ int multprog; /* current multiprogramming degree */ int desscan; /* desired pages scanned per second */ /* writable copies of tunables */ int maxpgio; /* max paging i/o per sec before start swaps */ int maxslp; /* max sleep time before very swappable */ int lotsfree; /* max free before clock freezes */ int minfree; /* minimum free pages before swapping begins */ int desfree; /* no of pages to try to keep free via daemon */ int saferss; /* no pages not to steal; decays with slptime */ #endif /* * Fork/vfork accounting. */ struct forkstat { int cntfork; int cntvfork; int sizfork; int sizvfork; }; #ifdef KERNEL struct forkstat forkstat; #endif /* * Swap kind accounting. */ struct swptstat { int pteasy; /* easy pt swaps */ int ptexpand; /* pt expansion swaps */ int ptshrink; /* pt shrinking swaps */ int ptpack; /* pt swaps involving spte copying */ }; #ifdef KERNEL struct swptstat swptstat; #endif @ik^4$W ]@i*[6i /* mbareg.h 4.15 81/05/03 */ /* * VAX MASSBUS adapter registers */ struct mba_regs { int mba_csr; /* configuration register */ int mba_cr; /* control register */ int mba_sr; /* status register */ int mba_var; /* virtual address register */ int mba_bcr; /* byte count register */ int mba_dr; int mba_pad1[250]; struct mba_drv { /* per drive registers */ int mbd_cs1; /* control status */ int mbd_ds; /* drive status */ int mbd_er1; /* error register */ int mbd_mr1; /* maintenance register */ int mbd_as; /* attention status */ int mbd_da; /* desired address (disks) */ #define mbd_fc mbd_da /* frame count (tapes) */ int mbd_dt; /* drive type */ int mbd_la; /* look ahead (disks) */ #define mbd_ck mbd_la /* ??? (tapes) */ int mbd_sn; /* serial number */ int mbd_of; /* ??? */ #define mbd_tc mbd_of /* ??? */ int mbd_fill[22]; } mba_drv[8]; struct pte mba_map[256]; /* io space virtual map */ int mba_pad2[256*5]; /* to size of a nexus */ }; /* * Bits in mba_cr */ #define MBCR_INIT 0x1 /* init mba */ #define MBCR_IE 0x4 /* enable mba interrupts */ /* * Bits in mba_sr */ #define MBSR_DTBUSY 0x80000000 /* data transfer busy */ #define MBSR_NRCONF 0x40000000 /* no response confirmation */ #define MBSR_CRD 0x20000000 /* corrected read data */ #define MBSR_CBHUNG 0x00800000 /* control bus hung */ #define MBSR_PGE 0x00080000 /* programming error */ #define MBSR_NED 0x00040000 /* non-existant drive */ #define MBSR_MCPE 0x00020000 /* massbus control parity error */ #define MBSR_ATTN 0x00010000 /* attention from massbus */ #define MBSR_SPE 0x00004000 /* silo parity error */ #define MBSR_DTCMP 0x00002000 /* data transfer completed */ #define MBSR_DTABT 0x00001000 /* data transfer aborted */ #define MBSR_DLT 0x00000800 /* data late */ #define MBSR_WCKUP 0x00000400 /* write check upper */ #define MBSR_WCKLWR 0x00000200 /* write check lower */ #define MBSR_MXF 0x00000100 /* miss transfer error */ #define MBSR_MBEXC 0x00000080 /* massbus exception */ #define MBS((R_MDPE 0x00000040 /* massbus data parity error */ #define MBSR_MAPPE 0x00000020 /* page frame map parity error */ #define MBSR_INVMAP 0x00000010 /* invalid map */ #define MBSR_ERRCONF 0x00000008 /* error confirmation */ #define MBSR_RDS 0x00000004 /* read data substitute */ #define MBSR_ISTIMO 0x00000002 /* interface sequence timeout */ #define MBSR_RDTIMO 0x00000001 /* read data timeout */ #define MBSR_BITS \ "\20\40DTBUSY\37NRCONF\36CRD\30CBHUNG\24PGE\23NED\22MCPE\21ATTN\ \17SPE\16DTCMP\15DTABT\14DLT\13WCKUP\12WCKLWR\11MXF\10MBEXC\7MDPE\ \6MAPPE\5INVMAP\4ERRCONF\3RDS\2ISTIMO\1RDTIMO" #define MBSR_HARD (MBSR_PGE|MBSR_ERRCONF|MBSR_ISTIMO|MBSR_RDTIMO) #define MBSR_EBITS (~(MBSR_DTBUSY|MBSR_CRD|MBSR_ATTN|MBSR_DTCMP)) #ifdef KERNEL extern char mbsr_bits[]; #endif /* * Commands for mbd_cs1 */ #define MB_WCOM 0x30 #define MB_RCOM 0x38 #define MB_GO 0x1 /* * Bits in mbd_ds. */ #define MBDS_ERR 0x00004000 /* error in drive */ #define MBDS_MOL 0x00001000 /* medium on line */ #define MBDS_DPR 0x00000100 /* drive present */ #define MBDS_DRY 0x00000080 /* drive ready */ #define MBDS_DREADY (MBDS_MOL|MBDS_DPR|MBDS_DRY) /* * Bits in mbd_dt */ #define MBDT_NSA 0x8000 /* not sector addressible */ #define MBDT_TAP 0x4000 /* is a tape */ #define MBDT_MOH 0x2000 /* moving head */ #define MBDT_7CH 0x1000 /* 7 channel */ #define MBDT_DRQ 0x800 /* drive request required */ #define MBDT_SPR 0x400 /* slave present */ #define MBDT_TYPE 0x1ff #define MBDT_MASK (MBDT_NSA|MBDT_TAP|MBDT_TYPE) /* type codes for disk drives */ #define MBDT_RP04 020 #define MBDT_RP05 021 #define MBDT_RP06 022 #define MBDT_RP07 042 #define MBDT_RM03 024 #define MBDT_RM05 027 #define MBDT_RM80 026 /* type codes for tape drives */ #define MBDT_TM03 050 #define MBDT_TE16 051 #define MBDT_TU45 052 #define MBDT_TU77 054 #define MBDT_TU78 0101 /* can't handle these (yet) */ @ik\Y$ %&i5TP6i /* trace.h 4.8 81/07/25 */ /* * File system buffer tracing points; all trace */ #define TR_BREADHIT 0 /* buffer read found in cache */ #define TR_BREADMISS 1 /* buffer read not in cache */ #define TR_BWRITE 2 /* buffer written */ #define TR_BREADHITRA 3 /* buffer read-ahead found in cache */ #define TR_BREADMISSRA 4 /* buffer read-ahead not in cache */ #define TR_XFODMISS 5 /* exe fod read */ #define TR_XFODHIT 6 /* exe fod read */ #define TR_BRELSE 7 /* brelse */ /* * Memory allocator trace points; all trace the amount of memory involved */ #define TR_MALL 10 /* memory allocated */ /* * Paging trace points: all are */ #define TR_INTRANS 20 /* page intransit block */ #define TR_EINTRANS 21 /* page intransit wait done */ #define TR_FRECLAIM 22 /* reclaim from free list */ #define TR_RECLAIM 23 /* reclaim from loop */ #define TR_XSFREC 24 /* reclaim from free list instead of drum */ #define TR_XIFREC 25 /* reclaim from free list instead of fsys */ #define TR_WAITMEM 26 /* wait for memory in pagein */ #define TR_EWAITMEM 27 /* end memory wait in pagein */ #define TR_ZFOD 28 /* zfod page fault */ #define TR_EXFOD 29 /* exec fod page fault */ #define TR_VRFOD 30 /* vread fod page fault */ #define TR_CACHEFOD 31 /* fod in file system cache */ #define TR_SWAPIN 32 /* drum page fault */ #define TR_PGINDONE 33 /* page in done */ #define TR_SWAPIO 34 /* swap i/o request arrives */ /* * System call trace points. */ #define TR_VADVISE 40 /* vadvise occurred with */ /* * Miscellaneous */ #define TR_STAMP 50 /* user said vtrace(VTR_STAMP, value); */ /* * This defines the size of the trace flags array. */ #define TR_NFLAGS 100 /* generous */ #define TRCSIZ 4096 /* * Specifications of the vtrace() system call, which takes one argument. */ #define VTRACE 64+51 #define VTR_DISABLE 0 /* set a trace flag to 0 */ #define VTR_ENABLE 1 /* set a trace flag to 1 */ #define VTR_VALUE 2 /* return value of a trace flag */ #define VTR_UALARM 3 /* set alarm to go off (sig 16) */ /* in specified number of hz */ #define VTR_STAMP 4 /* user specified stamp */ #ifdef KERNEL #ifdef TRACE char traceflags[TR_NFLAGS]; struct proc *traceproc; int tracebuf[TRCSIZ]; unsigned tracex; int tracewhich; #define trace(a,b,c) if (traceflags[a]) trace1(a,b,c) #endif #endif @ikEA$e  $&i J6i /* vmmac.h 4.3 81/04/23 */ /* * Virtual memory related conversion macros */ /* Core clicks to number of pages of page tables needed to map that much */ #define ctopt(x) (((x)+NPTEPG-1)/NPTEPG) /* Virtual page numbers to text|data|stack segment page numbers and back */ #define vtotp(p, v) ((int)(v)) #define vtodp(p, v) ((int)((v) - (p)->p_tsize)) #define vtosp(p, v) ((int)(btop(USRSTACK) - 1 - (v))) #define tptov(p, i) ((unsigned)(i)) #define dptov(p, i) ((unsigned)((p)->p_tsize + (i))) #define sptov(p, i) ((unsigned)(btop(USRSTACK) - 1 - (i))) /* Tell whether virtual page numbers are in text|data|stack segment */ #define isassv(p, v) ((v) & P1TOP) #define isatsv(p, v) ((v) < (p)->p_tsize) #define isadsv(p, v) ((v) >= (p)->p_tsize && !isassv(p, v)) /* Tell whether pte's are text|data|stack */ #define isaspte(p, pte) ((pte) > sptopte(p, (p)->p_ssize)) #define isatpte(p, pte) ((pte) < dptopte(p, 0)) #define isadpte(p, pte) (!isaspte(p, pte) && !isatpte(p, pte)) /* Text|data|stack pte's to segment page numbers and back */ #define ptetotp(p, pte) ((pte) - (p)->p_p0br) #define ptetodp(p, pte) ((pte) - ((p)->p_p0br + (p)->p_tsize)) #define ptetosp(p, pte) \ (((p)->p_p0br + (p)->p_szpt*NPTEPG - UPAGES - 1) - (pte)) #define tptopte(p, i) ((p)->p_p0br + (i)) #define dptopte(p, i) ((p)->p_p0br + (p)->p_tsize + (i)) #define sptopte(p, i) \ (((p)->p_p0br + (p)->p_szpt*NPTEPG - UPAGES - 1) - (i)) /* Bytes to pages without rounding, and back */ #define btop(x) (((unsigned)(x)) >> PGSHIFT) #define ptob(x) ((caddr_t)((x) << PGSHIFT)) /* Turn virtual addresses into kernel map indices */ #define kmxtob(a) (usrpt + (a) * NPTEPG) #define btokmx(b) (((b) - usrpt) / NPTEPG) /* User area address and pcb bases */ #define uaddr(p) (&((p)->p_p0br[(p)->p_szpt * NPTEPG - UPAGES])) #define pcbb(p) ((p)->p_addr[0].pg_pfnum) /* Average new into old with aging factor time */ #define ave(smooth, cnt, time) \ smooth = ((time - 1) * (smooth) + (cnt)) / (time) /* * Page clustering macros. * * dirtycl(pte) is the page cluster dirty? * anycl(pte,fld) does any pte in the cluster has fld set? * zapcl(pte,fld) = val set all fields fld in the cluster to val * distcl(pte) distribute high bits to cluster; note that * distcl copies everything but pg_pfnum, * INCLUDING pg_m!!! * * In all cases, pte must be the low pte in the cluster, even if * the segment grows backwards (e.g. the stack). */ #define H(pte) ((struct hpte *)(pte)) #if CLSIZE==1 #define dirtycl(pte) dirty(pte) #define anycl(pte,fld) ((pte)->fld) #define zapcl(pte,fld) (pte)->fld #define distcl(pte) #endif #if CLSIZE==2 #define dirtycl(pte) (dirty(pte) || dirty((pte)+1)) #define anycl(pte,fld) ((pte)->fld || (((pte)+1)->fld)) #define zapcl(pte,fld) (pte)[1].fld = (pte)[0].fld #endif #if CLSIZE==4 #define dirtycl(pte) \ (dirty(pte) || dirty((pte)+1) || dirty((pte)+2) || dirty((pte)+3)) #define anycl(pte,fld) \ ((pte)->fld || (((pte)+1)->fld) || (((pte)+2)->fld) || (((pte)+3)->fld)) #define zapcl(pte,fld) \ (pte)[3].fld = (pte)[2].fld =(( (pte)[1].fld = (pte)[0].fld #endif #ifndef distcl #define distcl(pte) zapcl(H(pte),pg_high) #endif @ikgK$L :&iy\6i /* dkbad.c 4.3 81/05/10 */ #ifndef NOBADSECT #include "../h/param.h" #include "../h/buf.h" #include "../h/dkbad.h" /* * Search the bad sector table looking for * the specified sector. Return index if found. * Return -1 if not found. */ isbad(bt, cyl, trk, sec) register struct dkbad *bt; { register int i; register long blk, bblk; blk = ((long)cyl << 16) + (trk << 8) + sec; for (i = 0; i < 126; i++) { bblk = ((long)bt->bt_bad[i].bt_cyl << 16) + bt->bt_bad[i].bt_trksec; if (blk == bblk) return (i); if (blk < bblk || bblk < 0) break; } return (-1); } #endif @ikͣI/i ^PPP ^Ь[A<<~OZJJ~9wZ+f߭[XPls : %d %c   ! ( 0 7 Hdk ~   d!'+39?NC GM_devsw_b_blknos_iob_line_mainL18_printf_gets_open_lsL31_read@ik}$]@i*6i /* cpu.h 4.6 81/04/03 */ #ifndef LOCORE /* * Cpu identification, from SID register. */ union cpusid { int cpusid; struct cpuany { u_int :24, cp_type:8; } cpuany; struct cpu780 { u_int cp_sno:12, /* serial number */ cp_plant:3, /* plant number */ cp_eco:9, /* eco level */ cp_type:8; /* VAX_780 */ } cpu780; struct cpu750 { u_int cp_hrev:8, /* hardware rev level */ cp_urev:8, /* ucode rev level */ :8, cp_type:8; /* VAX_750 */ } cpu750; /* need structure for 7ZZ */ }; #endif #define VAX_780 1 #define VAX_750 2 #define VAX_7ZZ 3 #define VAX_MAX 3 #ifndef LOCORE /* * Per-cpu information for system. */ struct percpu { short pc_cputype; /* cpu type code */ short pc_nnexus; /* number of nexus slots */ struct nexus *pc_nexbase; /* base of nexus space */ /* we should be able to have just one address for the unibus memories */ /* and calculate successive addresses by adding to the base, but the 750 */ /* doesn't obey the sensible rule: uba1 has a lower address than uba0! */ caddr_t *pc_umaddr; /* unibus memory addresses */ short pc_nubabdp; /* number of bdp's per uba */ short pc_haveubasr; /* have uba status register */ /* the 750 has some slots which don't promise to tell you their types */ /* if this pointer is non-zero, then you get the type from this array */ /* rather than from the (much more sensible) low byte of the config register */ short *pc_nextype; /* botch */ }; #ifdef KERNEL int cpu; struct percpu percpu[]; #endif #endif @ikEn$$&i@96i /* vlimit.h 4.3 81/04/13 */ /* * Limits for u.u_limit[i], per process, inherited. */ #define LIM_NORAISE 0 /* if <> 0, can't raise limits */ #define LIM_CPU 1 /* max secs cpu time */ #define LIM_FSIZE 2 /* max size of file created */ #define LIM_DATA 3 /* max growth of data space */ #define LIM_STACK 4 /* max growth of stack */ #define LIM_CORE 5 /* max size of ``core'' file */ #define LIM_MAXRSS 6 /* max desired data+stack core usage */ #define NLIMITS 6 #define INFINITY 0x7fffffff ((@i kꍥ$}$&iU36i /* dk.h 4.2 81/02/19 */ /* * Instrumentation */ #define CPUSTATES 4 #define CP_USER 0 #define CP_NICE 1 #define CP_SYS 2 #define CP_IDLE 3 #define DK_NDRIVE 4 #ifdef KERNEL long cp_time[CPUSTATES]; int dk_busy; long dk_time[DK_NDRIVE]; long dk_seek[DK_NDRIVE]; long dk_xfer[DK_NDRIVE]; long dk_wds[DK_NDRIVE]; float dk_mspw[DK_NDRIVE]; long tk_nin; long tk_nout; #endif @i k0荥$N$&iU36i /* vtimes.h 4.2 81/02/19 */ /* * Structure returned by vtimes() and in vwait(). * In vtimes() two of these are returned, one for the process itself * and one for all its children. In vwait() these are combined * by adding componentwise (except for maxrss, which is max'ed). */ struct vtimes { int vm_utime; /* user time (60'ths) */ int vm_stime; /* system time (60'ths) */ /* divide next two by utime+stime to get averages */ unsigned vm_idsrss; /* integral of d+s rss */ unsigned vm_ixrss; /* integral of text rss */ int vm_maxrss; /* maximum rss */ int vm_majflt; /* major page faults */ int vm_minflt; /* minor page faults */ int vm_nswap; /* number of swaps */ int vm_inblk; /* block reads */ int vm_oublk; /* block writes */ }; #ifdef KERNEL struct vtimes zvms; /* an empty (componentwise 0) structure */ #endif @ik^$$&i J6i /* vmsysent.h 4.4 81/03/03 */ /* * Externals for functions defined in vmsys.c. */ int nosys(); int nullsys(); int vfork(); /* later, just fork? */ int vread(); /* deprecated */ int vwrite(); /* deprecated */ int vadvise(); /* later, segadvise */ int vhangup(); /* should just do in exit() */ int vlimit(); int vswapon(); int vtimes(); #ifdef TRACE int vtrace(); #endif int segalloc(); /* not in yet */ int segfree(); /* not in yet */ int segsync(); /* not in yet */ int resuba(); int futz(); @ik|ͣ#/iޡޡ <0 ^Ь[ЫhP PˏhlPP PPPѬԬԭxTPxPPP`PxQQPZxPɏPլ  ɭ֭׭ԊxPx QQPȭPPP[0PP P3PЬPxTPxPP P@`Px[QQPȏ`ЬPxTPxPPP@`Px[QQPȏ``<F^      (08@J NW[_devsw_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_ubasetupL22_ubafreeL33@ikC~${x@i:: /* vm.h 4.3 81/04/23 */ /* * #include "../h/vm.h" * or #include in a user program * is a quick way to include all the vm header files. */ #ifdef KERNEL #include "../h/vmparam.h" #include "../h/vmmac.h" #include "../h/vmmeter.h" #include "../h/vmsystm.h" #else #include #include #include #include #endif ((@i k$ #&i J6i  /* vmmeter.h 4.6 4/24/81 */ /* * Virtual memory related instrumentation */ struct vmmeter { #define v_first v_swtch unsigned v_swtch; /* context switches */ unsigned v_trap; /* calls to trap */ unsigned v_syscall; /* calls to syscall() */ unsigned v_intr; /* device interrupts */ unsigned v_pdma; /* pseudo-dma interrupts */ unsigned v_pswpin; /* pages swapped in */ unsigned v_pswpout; /* pages swapped out */ unsigned v_pgin; /* pageins */ unsigned v_pgout; /* pageouts */ unsigned v_pgpgin; /* pages paged in */ unsigned v_pgpgout; /* pages paged out */ unsigned v_intrans; /* intransit blocking page faults */ unsigned v_pgrec; /* total page reclaims */ unsigned v_xsfrec; /* found in free list rather than on swapdev */ unsigned v_xifrec; /* found in free list rather than in filsys */ unsigned v_exfod; /* pages filled on demand from executables */ unsigned v_zfod; /* pages zero filled on demand */ unsigned v_vrfod; /* fills of pages mapped by vread() */ unsigned v_nexfod; /* number of exfod's created */ unsigned v_nzfod; /* number of zfod's created */ unsigned v_nvrfod; /* number of vrfod's created */ unsigned v_pgfrec; /* page reclaims from free list */ unsigned v_faults; /* total faults taken */ unsigned v_scan; /* scans in page out daemon */ unsigned v_rev; /* revolutions of the hand */ unsigned v_seqfree; /* pages taken from sequential programs */ unsigned v_dfree; /* pages freed by daemon */ #define v_last v_dfree unsigned v_swpin; /* swapins */ unsigned v_swpout; /* swapouts */ }; #ifdef KERNEL struct vmmeter cnt, rate, sum; #endif /* systemwide totals computed every five seconds */ struct vmtotal { short t_rq; /* length of the run queue */ short t_dw; /* jobs in ``disk wait'' (neg priority) */ short t_pw; /* jobs in page wait */ short t_sl; /* jobs sleeping in core */ short t_sw; /* swapped out runnable/short block jobs */ int t_vm; /* total virtual memory */ int t_avm; /* active virtual memory */ short t_rm; /* total real memory in use */ short t_arm; /* active real memory */ int t_vmtxt; /* virtual memory used by text */ int t_avmtxt; /* active virtual memory used by text */ short t_rmtxt; /* real memory used by text */ short t_armtxt; /* active real memory used by text */ short t_free; /* free memory pages */ }; #ifdef KERNEL struct vmtotal total; #endif /* * Optional instrumentation. */ #ifdef PGINPROF #define NDMON 128 #define NSMON 128 #define DRES 20 #define SRES 5 #define PMONMIN 20 #define PRES 50 #define NPMON 64 #define RMONMIN 130 #define RRES 5 #define NRMON 64 /* data and stack size distribution counters */ unsigned int dmon[NDMON+1]; unsigned int smon[NSMON+1]; /* page in time distribution counters */ unsigned int pmon[NPMON+2]; /* reclaim time distribution counters */ unsigned int rmon[NRMON+2]; int pmonmin; int pres; int rmonmin; int rres; unsigned rectime; /* accumulator for reclaim times */ unsigned pgintime; /* accumulator for page in times */ #endif @i!kꍥ$#&iR36i /* clist.h 4.4 81/03/09 */ /* * Raw structures for the character list routines. */ struct cblock { struct cblock *c_next; char c_info[CBSIZE]; }; #ifdef KERNEL struct cblock *cfree; int nclist; struct cblock *cfreelist; int cfreecount; #endif @i"k $' #&i J6i /* vmparam.h 4.10 81/04/24 */ /* * Machine dependent constants */ #define NPTEPG (NBPG/(sizeof (struct pte))) /* number of ptes per page */ #define USRSTACK (0x80000000-UPAGES*NBPG) /* Start of user stack */ #define P1TOP 0x200000 /* boundary between P0 and P1 regions */ /* * Virtual memory related constants */ #define SLOP 32 #define MAXTSIZ (6*2048-SLOP) /* max text size (clicks) */ #define MAXDSIZ (12*1024-32-SLOP) /* max data size (clicks) */ #define MAXSSIZ (12*1024-32-SLOP) /* max stack size (clicks) */ /* * Sizes of the system and user portions of the system page table. */ /* SYSPTSIZE IS SILLY; IT SHOULD BE COMPUTED AT BOOT TIME */ #define SYSPTSIZE (12*NPTEPG) #define USRPTSIZE (8*NPTEPG) /* * The size of the clock loop. */ #define LOOPPAGES (maxfree - firstfree) /* * The time for a process to be blocked before being very swappable. * This is a number of seconds which the system takes as being a non-trivial * amount of real time. You probably shouldn't change this; * it is used in subtle ways (fractions and multiples of it are, that is, like * half of a ``long time'', almost a long time, etc.) * It is related to human patience and other factors which don't really * change over time. */ #define MAXSLP 20 /* * A swapped in process is given a small amount of core without being bothered * by the page replacement algorithm. Basically this says that if you are * swapped in you deserve some resources. We protect the last SAFERSS * pages against paging and will just swap you out rather than paging you. * Note that each process has at least UPAGES+CLSIZE pages which are not * paged anyways (this is currently 8+2=10 pages or 5k bytes), so this * number just means a swapped in process is given around 25k bytes. * Just for fun: current memory prices are 4600$ a megabyte on VAX (4/22/81), * so we loan each swapped in process memory worth 100$, or just admit * that we don't consider it worthwhile and swap it out to disk which costs * $30/mb or about $0.75. */ #define SAFERSS 32 /* nominal ``small'' resident set size protected against replacement */ /* * DISKRPM is used to estimate the number of paging i/o operations * which one can expect from a single disk controller. */ #define DISKRPM 60 /* * Klustering constants. Klustering is the gathering * of pages together for pagein/pageout, while clustering * is the treatment of hardware page size as though it were * larger than it really is. * * KLMAX gives maximum cluster size in CLSIZE page (cluster-page) * units. Note that KLMAX*CLSIZE must be <= DMMIN in dmap.h. */ #define KLMAX (32/CLSIZE) #define KLSEQL (16/CLSIZE) /* in klust if vadvise(VA_SEQL) */ #define KLIN (8/CLSIZE) /* default data/stack in klust */ #define KLTXT (4/CLSIZE) /* default text in klust */ #define KLOUT (32/CLSIZE) /* * KLSDIST is the advance or retard of the fifo reclaim for sequential * processes data space. */ #define KLSDIST 3 /* klusters advance/retard for seq. fifo */ #ifdef KERNEL int klseql; int klsdist; ((int klin; int kltxt; int klout; #endif @i#kI$#&i /* tty.h 4.5 81/06/11 */ #ifdef KERNEL #include "../h/ioctl.h" #else #include #endif #include /* * A clist structure is the head * of a linked list queue of characters. * The characters are stored in * blocks containing a link and CBSIZE (param.h) * characters. The routines getc, putc, ... in prim.c * manipulate these structures. */ struct clist { int c_cc; /* character count */ char *c_cf; /* pointer to first char */ char *c_cl; /* pointer to last char */ }; /* * A tty structure is needed for * each UNIX character device that * is used for normal terminal IO. * The routines in tty.c handle the * common code associated with * these structures. The definition * and device dependent code is in * each driver. (cons.c, dh.c, dz.c, kl.c) */ struct tty { union { struct { struct clist T_rawq; struct clist T_canq; } t_t; #define t_rawq t_nu.t_t.T_rawq /* raw characters or partial line */ #define t_canq t_nu.t_t.T_canq /* complete input lines */ struct { struct buf *T_bufp; char *T_cp; int T_inbuf; int T_rec; } t_n; #define t_bufp t_nu.t_n.T_bufp /* buffer allocated to protocol */ #define t_cp t_nu.t_n.T_cp /* pointer into the ripped off buffer */ #define t_inbuf t_nu.t_n.T_inbuf /* number chars in the buffer */ #define t_rec t_nu.t_n.T_rec /* have a complete record */ } t_nu; struct clist t_outq; /* output list to device */ int (*t_oproc)(); /* routine to start output */ int (*t_iproc)(); /* routine to start input */ struct chan *t_chan; /* destination channel */ caddr_t t_linep; /* aux line discipline pointer */ caddr_t t_addr; /* device address */ dev_t t_dev; /* device number */ short t_flags; /* mode, settable by ioctl call */ short t_state; /* internal state, not visible externally */ short t_pgrp; /* process group name */ char t_delct; /* number of delimiters in raw q */ char t_line; /* line discipline */ char t_col; /* printing column of device */ char t_erase; /* erase character */ char t_kill; /* kill character */ char t_char; /* character temporary */ char t_ispeed; /* input speed */ char t_ospeed; /* output speed */ /* begin local */ char t_rocount; /* chars input since a ttwrite() */ char t_rocol; /* t_col when first input this line */ struct ltchars t_lchr; /* local special characters */ short t_local; /* local mode word */ short t_lstate; /* local state bits */ /* end local */ union { struct tchars t_chr; struct clist t_ctlq; } t_un; }; #define tun tp->t_un.t_chr #define tlun tp->t_lchr #define TTIPRI 28 #define TTOPRI 29 #define CTRL(c) ('c'&037) /* default special characters */ #define CERASE '#' #define CEOT CTRL(d) #define CKILL '@' #define CQUIT 034 /* FS, cntl shift L */ #define CINTR 0177 /* DEL */ #define CSTOP CTRL(s) #define CSTART CTRL(q) #define CBRK 0377 /* limits */ #define NSPEEDS 16 #define TTMASK 15 #ifdef KERNEL short tthiwat[NSPEEDS], ttlowat[NSPEEDS]; #define TTHIWAT(tp) tthiwat[(tp)->t_ospeed&TTMASK] #define TTLOWAT(tp) ttlowat[(tp)->t_ospeed&TTMASK] #endif #define TTYHOG 255 /* hardware bits */ #define DONE 0200 #define IENABLE 0100 /* internal state bits */ #define TIMEOUT 01 /* delay timeout in progress */ #define WOPEN 02 /* waiting for open to complete */ #define ISOPEN 04 /* device is open */ #define FLUSH 010 /* outq has been flushed during DMA */ #define CARR_ON 020 /* software copy of carrier-present */ #define BUSY 040 /* output in progress */ #define ASLEEP 0100 /* wakeup when output done */ #define XCLUDE 0200 /* exclusive-use flag against open */ #define TTSTOP 0400 /* output stopped by ctl-s */ #define HUPCLS 01000 /* hang up upon last close */ #define TBLOCK 02000 /* tandem queue blocked */ #define SPEEDS 04000 /* t_ispeed and t_ospeed used by driver */ #define NDQB 010000 #define EXTPROC 020000 /* external processor (kmc) */ #define FSLEEP 040000 /* Wakeup on input framing */ #define BEXT 0100000 /* use (external) system buffers */ /* define partab character types */ #define ORDINARY 0 #define CONTROL 1 #define BACKSPACE 2 #define NEWLINE 3 #define TAB 4 #define VTAB 5 #define RETURN 6 /* define dmctl actions */ #define DMSET 0 #define DMBIS 1 #define DMBIC 2 @i%$kL荥$@#&iQ36i /* trap.h 4.6 81/03/03 */ /* * Trap type values */ /* The first three constant values are known to the real world */ #define RESADFLT 0 /* reserved addressing fault */ #define PRIVINFLT 1 /* privileged instruction fault */ #define RESOPFLT 2 /* reserved operand fault */ /* End of known constants */ #define BPTFLT 3 /* bpt instruction fault */ #define XFCFLT 4 /* xfc instruction fault */ #define SYSCALL 5 /* chmk instruction (syscall trap) */ #define ARITHTRAP 6 /* arithmetic trap */ #define ASTFLT 7 /* software level 2 trap (ast deliv) */ #define SEGFLT 8 /* segmentation fault */ #define PROTFLT 9 /* protection fault */ #define TRCTRAP 10 /* trace trap */ #define COMPATFLT 11 /* compatibility mode fault */ #define PAGEFLT 12 /* page fault */ #define TABLEFLT 13 /* page table fault */ @i'%kꍥ$#&iP36i ((/* times.h 4.2 81/02/19 */ /* * Structure returned by times() */ struct tms { time_t tms_utime; /* user time */ time_t tms_stime; /* system time */ time_t tms_cutime; /* user time, children */ time_t tms_cstime; /* system time, children */ }; @i)&kꍥ$#&iP36i /* timeb.h 4.2 81/02/19 */ /* * Structure returned by ftime system call */ struct timeb { time_t time; unsigned short millitm; short timezone; short dstflag; }; @i+'kC$>#&iO36i /* text.h 4.4 81/03/09 */ /* * Text structure. * One allocated per pure * procedure on swap device. * Manipulated by text.c */ #define NXDAD 12 /* param.h:MAXTSIZ / dmap.h:DMTEXT */ struct text { swblk_t x_daddr[NXDAD]; /* disk addresses of DMTEXT-page segments */ swblk_t x_ptdaddr; /* disk address of page table */ size_t x_size; /* size (clicks) */ struct proc *x_caddr; /* ptr to linked proc, if loaded */ struct inode *x_iptr; /* inode of prototype */ short x_rssize; short x_swrss; char x_count; /* reference count */ char x_ccount; /* number of loaded references */ char x_flag; /* traced, written flags */ char x_slptime; short x_poip; /* page out in progress count */ }; #ifdef KERNEL struct text *text, *textNTEXT; int ntext; #endif #define XTRC 01 /* Text may be written, exclusive use */ #define XWRIT 02 /* Text written into, must swap out */ #define XLOAD 04 /* Currently being read from file */ #define XLOCK 010 /* Being swapped in or out */ #define XWANT 020 /* Wanted for swapping */ #define XPAGI 040 /* Page in on demand from inode */ @i.(k&f$#&i@6i /* systm.h 4.17 81/05/05 */ /* * Random set of variables * used by more than one * routine. */ int hz; /* frequency of the clock */ int timezone; /* minutes west from greenwich */ int dstflag; /* daylight savings time in effect? */ char canonb[CANBSIZ]; /* buffer for erase and kill (#@) */ char version[]; /* system version */ int lbolt; /* time of day in 60th not in time */ time_t time; /* time in sec from 1970 */ time_t bootime; /* time at which booted */ int hand; /* current index into coremap used by daemon */ /* * Nblkdev is the number of entries * (rows) in the block switch. It is * set in binit/bio.c by making * a pass over the switch. * Used in bounds checking on major * device numbers. */ int nblkdev; /* * Number of character switch entries. * Set by cinit/prim.c */ int nchrdev; int nswdev; /* number of swap devices */ int mpid; /* generic for unique process id's */ char runin; /* scheduling flag */ char runout; /* scheduling flag */ int runrun; /* scheduling flag */ char kmapwnt; /* kernel map want flag */ char curpri; /* more scheduling */ int maxmem; /* actual max memory per process */ int physmem; /* physical memory on this CPU */ int nswap; /* size of swap space */ int updlock; /* lock for sync */ daddr_t rablock; /* block to be read ahead */ extern int intstack[]; /* stack for interrupts */ dev_t rootdev; /* device of the root */ dev_t dumpdev; /* device to take dumps on */ long dumplo; /* offset into dumpdev */ dev_t swapdev; /* swapping device */ dev_t argdev; /* device for argument lists */ dev_t pipedev; /* pipe device */ extern int icode[]; /* user init code */ extern int szicode; /* its size */ dev_t getmdev(); daddr_t bmap(); caddr_t calloc(); unsigned max(); unsigned min(); int memall(); int uchar(), schar(); int vmemall(); char *wmemall(); swblk_t vtod(); /* * Structure of the system-entry table */ extern struct sysent { int sy_narg; /* total number of arguments */ int (*sy_call)(); /* handler */ } sysent[]; char vmmap[]; /* poor name! */ int umbabeg,umbaend; /* where sensitive vm begins/ends */ int noproc; /* no one is running just now */ extern int catcher[256]; char *panicstr; int wantin; int boothowto; /* reboot flags, from console subsystem */ ((@i2)k荥$"&iN36i /* stat.h 4.2 81/02/19 */ struct stat { dev_t st_dev; ino_t st_ino; unsigned short st_mode; short st_nlink; short st_uid; short st_gid; dev_t st_rdev; off_t st_size; time_t st_atime; time_t st_mtime; time_t st_ctime; }; #define S_IFMT 0170000 /* type of file */ #define S_IFDIR 0040000 /* directory */ #define S_IFCHR 0020000 /* character special */ #define S_IFBLK 0060000 /* block special */ #define S_IFREG 0100000 /* regular */ #define S_IFMPC 0030000 /* multiplexed char special */ #define S_IFMPB 0070000 /* multiplexed block special */ #define S_ISUID 0004000 /* set user id on execution */ #define S_ISGID 0002000 /* set group id on execution */ #define S_ISVTX 0001000 /* save swapped text even after use */ #define S_IREAD 0000400 /* read permission, owner */ #define S_IWRITE 0000200 /* write permission, owner */ #define S_IEXEC 0000100 /* execute/search permission, owner */ @i4*k덥${"&iN36i /* seg.h 4.2 81/02/19 */ /* * Mapper addresses and bits */ #define RO PG_URKR /* access abilities */ #define RW PG_UW @i6+k鍥$"&iN36i /* reg.h 4.2 81/02/19 */ /* * Location of the users' stored * registers relative to R0. * Usage is u.u_ar0[XX]. */ #define R0 (-18) #define R1 (-17) #define R2 (-16) #define R3 (-15) #define R4 (-14) #define R5 (-13) #define R6 (-12) #define R7 (-11) #define R8 (-10) #define R9 (-9) #define R10 (-8) #define R11 (-7) #define R12 (-21) #define R13 (-20) #define AP (-21) #define FP (-20) #define SP (-5) #define PS (-1) #define PC (-2) @i8,k!G$Hsvy|"&i6TP6i /* ubavar.h 4.21 81/10/27 */ /* * This file contains definitions related to the kernel structures * for dealing with the unibus adapters. * * Each uba has a uba_hd structure. * Each unibus controller which is not a device has a uba_ctlr structure. * Each unibus device has a uba_device structure. */ #ifndef LOCORE /* * Per-uba structure. * * This structure holds the interrupt vector for the uba, * and its address in physical and virtual space. At boot time * we determine the devices attached to the uba's and their * interrupt vectors, filling in uh_vec. We free the map * register and bdp resources of the uba into the structures * defined here. * * During normal operation, resources are allocated and returned * to the structures here. We watch the number of passive releases * on each uba, and if the number is excessive may reset the uba. * * When uba resources are needed and not available, or if a device * which can tolerate no other uba activity (rk07) gets on the bus, * then device drivers may have to wait to get to the bus and are * queued here. It is also possible for processes to block in * the unibus driver in resource wait (mrwant, bdpwant); these * wait states are also recorded here. */ struct uba_hd { struct uba_regs *uh_uba; /* virt addr of uba */ struct uba_regs *uh_physuba; /* phys addr of uba */ int (**uh_vec)(); /* interrupt vector */ struct uba_device *uh_actf; /* head of queue to transfer */ struct uba_device *uh_actl; /* tail of queue to transfer */ short uh_mrwant; /* someone is waiting for map reg */ short uh_bdpwant; /* someone awaits bdp's */ int uh_bdpfree; /* free bdp's */ int uh_hangcnt; /* number of ticks hung */ int uh_zvcnt; /* number of 0 vectors */ int uh_errcnt; /* number of errors */ int uh_lastiv; /* last free interrupt vector */ short uh_users; /* transient bdp use count */ short uh_xclu; /* an rk07 is using this uba! */ #define UAMSIZ 25 struct map *uh_map; /* buffered data path regs free */ }; #ifndef LOCORE /* * Per-controller structure. * (E.g. one for each disk and tape controller, and other things * which use and release buffered data paths.) * * If a controller has devices attached, then there are * cross-referenced uba_drive structures. * This structure is the one which is queued in unibus resource wait, * and saves the information about unibus resources which are used. * The queue of devices waiting to transfer is also attached here. */ struct uba_ctlr { struct uba_driver *um_driver; short um_ctlr; /* controller index in driver */ short um_ubanum; /* the uba it is on */ short um_alive; /* controller exists */ int (**um_intr)(); /* interrupt handler(s) */ caddr_t um_addr; /* address of device in i/o space */ struct uba_hd *um_hd; /* the driver saves the prototype command here for use in its go routine */ int um_cmd; /* communication to dgo() */ int um_ubinfo; /* save unibus registers, etc */ struct buf um_tab; /* queue of devices for this controller */ }; /* * Per ``device'' structure. * (A cont((roller has devices or uses and releases buffered data paths). * (Everything else is a ``device''.) * * If a controller has many drives attached, then there will * be several uba_device structures associated with a single uba_ctlr * structure. * * This structure contains all the information necessary to run * a unibus device such as a dz or a dh. It also contains information * for slaves of unibus controllers as to which device on the slave * this is. A flags field here can also be given in the system specification * and is used to tell which dz lines are hard wired or other device * specific parameters. */ struct uba_device { struct uba_driver *ui_driver; short ui_unit; /* unit number on the system */ short ui_ctlr; /* mass ctlr number; -1 if none */ short ui_ubanum; /* the uba it is on */ short ui_slave; /* slave on controller */ int (**ui_intr)(); /* interrupt handler(s) */ caddr_t ui_addr; /* address of device in i/o space */ short ui_dk; /* if init 1 set to number for iostat */ short ui_flags; /* parameter from system specification */ short ui_alive; /* device exists */ short ui_type; /* driver specific type information */ caddr_t ui_physaddr; /* phys addr, for standalone (dump) code */ /* this is the forward link in a list of devices on a controller */ struct uba_device *ui_forw; /* if the device is connected to a controller, this is the controller */ struct uba_ctlr *ui_mi; struct uba_hd *ui_hd; }; #endif /* * Per-driver structure. * * Each unibus driver defines entries for a set of routines * as well as an array of types which are acceptable to it. * These are used at boot time by the configuration program. */ struct uba_driver { int (*ud_probe)(); /* see if a driver is really there */ int (*ud_slave)(); /* see if a slave is there */ int (*ud_attach)(); /* setup driver for a slave */ int (*ud_dgo)(); /* fill csr/ba to start transfer */ u_short *ud_addr; /* device csr addresses */ char *ud_dname; /* name of a device */ struct uba_device **ud_dinfo; /* backpointers to ubdinit structs */ char *ud_mname; /* name of a controller */ struct uba_ctlr **ud_minfo; /* backpointers to ubminit structs */ short ud_xclu; /* want exclusive use of bdp's */ }; #endif /* * Flags to UBA map/bdp allocation routines */ #define UBA_NEEDBDP 1 /* transfer needs a bdp */ #define UBA_CANTWAIT 2 /* don't block me */ #define UBA_NEED16 4 /* need 16 bit addresses only */ #define UBA_HAVEBDP 8 /* use bdp specified in high bits */ #ifndef LOCORE #ifdef KERNEL /* * UBA related kernel variables */ int numuba; /* number of uba's */ extern struct uba_hd uba_hd[]; /* * Ubminit and ubdinit initialize the mass storage controller and * device tables specifying possible devices. */ extern struct uba_ctlr ubminit[]; extern struct uba_device ubdinit[]; /* * UNIbus device address space is mapped by UMEMmap * into virtual address umem[][]. */ extern struct pte UMEMmap[][16]; /* uba device addr pte's */ extern char umem[][16*NBPG]; /* uba device addr space */ /* * Since some VAXen vector their first (and only) unibus interrupt * vector just adjacent to the system control block, we must * allocate space there when running on ``any'' cpu. This space is * used for the vector for uba0 on all cpu's. */ extern int (*UNIvec[])(); /* unibus vec for uba0 */ #if VAX780 /* * On 780's, we must set the scb vectors for the nexus of the * UNIbus adaptors to vector to locore unibus adaptor interrupt dispatchers * which make 780's look like the other VAXen. */ extern Xua0int(), Xua1int(), Xua2int(), Xua3int(); #endif VAX780 #endif KERNEL #endif !LOCORE @i@-kW4$mp"&i5TP6i /* mtio.h 4.7 81/11/03 */ /* * Structures and definitions for mag tape io control commands */ /* mag tape io control commands */ #define MTIOCTOP (('m'<<8)|1) /* do a mag tape op */ #define MTIOCGET (('m'<<8)|2) /* get mag tape status */ /* structure for MTIOCTOP - mag tape op command */ struct mtop { short mt_op; /* operations defined below */ daddr_t mt_count; /* how many of them */ }; /* operations */ #define MTWEOF 0 /* write an end-of-file record */ #define MTFSF 1 /* forward space file */ #define MTBSF 2 /* backward space file */ #define MTFSR 3 /* forward space record */ #define MTBSR 4 /* backward space record */ #define MTREW 5 /* rewind */ #define MTOFFL 6 /* rewind and put the drive offline */ #define MTNOP 7 /* no operation, sets status only */ /* structure for MTIOCGET - mag tape get status command */ struct mtget { short mt_type; /* type of magtape device */ /* the following two registers are grossly device dependent */ short mt_dsreg; /* ``drive status'' register */ short mt_erreg; /* ``error'' register */ /* end device-dependent registers */ short mt_resid; /* residual count */ /* the following two are not yet implemented */ daddr_t mt_fileno; /* file number of current position */ daddr_t mt_blkno; /* block number of current position */ /* end not yet implemented */ }; /* * Constants for mt_type byte */ #define MT_ISTS 01 #define MT_ISHT 02 #define MT_ISTM 03 #define MT_ISMT 04 #define MT_ISUT 05 @iC.k2$^adgj"&iJ6i /* proc.h 4.8 81/04/23 */ /* * One structure allocated per active * process. It contains all data needed * about the process while the * process may be swapped out. * Other per process data (user.h) * is swapped with the process. */ struct proc { struct proc *p_link; /* linked list of running processes */ struct proc *p_rlink; struct pte *p_addr; /* u-area kernel map address */ char p_usrpri; /* user-priority based on p_cpu and p_nice */ char p_pri; /* priority, negative is high */ char p_cpu; /* cpu usage for scheduling */ char p_stat; char p_time; /* resident time for scheduling */ char p_nice; /* nice for cpu usage */ char p_slptime; /* time since last block */ char p_cursig; long p_sig; /* signals pending to this process */ long p_siga0; /* low bit of 2 bit signal action */ long p_siga1; /* high bit of 2 bit signal action */ #define p_ignsig p_siga0 /* ignored signal mask */ int p_flag; short p_uid; /* user id, used to direct tty signals */ short p_pgrp; /* name of process group leader */ short p_pid; /* unique process id */ short p_ppid; /* process id of parent */ short p_poip; /* count of page outs in progress */ short p_szpt; /* copy of page table size */ size_t p_tsize; /* size of text (clicks) */ size_t p_dsize; /* size of data space (clicks) */ size_t p_ssize; /* copy of stack size (clicks) */ size_t p_rssize; /* current resident set size in clicks */ size_t p_maxrss; /* copy of u.u_limit[MAXRSS] */ size_t p_swrss; /* resident set size before last swap */ swblk_t p_swaddr; /* disk address of u area when swapped */ caddr_t p_wchan; /* event process is awaiting */ struct text *p_textp; /* pointer to text structure */ int p_clktim; /* time to alarm clock signal */ struct pte *p_p0br; /* page table base P0BR */ struct proc *p_xlink; /* linked list of procs sharing same text */ short p_cpticks; /* ticks of cpu time */ float p_pctcpu; /* %cpu for this process during p_time */ short p_ndx; /* proc index for memall (because of vfork) */ short p_idhash; ((/* hashed based on p_pid for kill+exit+... */ struct proc *p_pptr; /* pointer to process structure of parent */ }; #define PIDHSZ 63 #define PIDHASH(pid) ((pid) % PIDHSZ) #ifdef KERNEL short pidhash[PIDHSZ]; struct proc *pfind(); #endif #ifdef KERNEL struct proc *proc, *procNPROC; /* the proc table itself */ int nproc; #define NQS 32 /* 32 run queues */ struct prochd { struct proc *ph_link; /* linked list of running processes */ struct proc *ph_rlink; } qs[NQS]; int whichqs; /* bit mask summarizing non-empty qs's */ #endif /* stat codes */ #define SSLEEP 1 /* awaiting an event */ #define SWAIT 2 /* (abandoned state) */ #define SRUN 3 /* running */ #define SIDL 4 /* intermediate state in process creation */ #define SZOMB 5 /* intermediate state in process termination */ #define SSTOP 6 /* process being traced */ /* flag codes */ #define SLOAD 0x000001 /* in core */ #define SSYS 0x000002 /* swapper or pager process */ #define SLOCK 0x000004 /* process being swapped out */ #define SSWAP 0x000008 /* save area flag */ #define STRC 0x000010 /* process is being traced */ #define SWTED 0x000020 /* another tracing flag */ #define SULOCK 0x000040 /* user settable lock in core */ #define SPAGE 0x000080 /* process in page wait state */ #define SKEEP 0x000100 /* another flag to prevent swap out */ #define SDLYU 0x000200 /* delayed unlock of pages */ #define SWEXIT 0x000400 /* working on exiting */ #define SPHYSIO 0x000800 /* doing physical i/o (bio.c) */ #define SVFORK 0x001000 /* process resulted from vfork() */ #define SVFDONE 0x002000 /* another vfork flag */ #define SNOVM 0x004000 /* no vm, parent in a vfork() */ #define SPAGI 0x008000 /* init data space on demand, from inode */ #define SSEQL 0x010000 /* user warned of sequential vm behavior */ #define SUANOM 0x020000 /* user warned of random vm behavior */ #define STIMO 0x040000 /* timing out during sleep */ #define SDETACH 0x080000 /* detached inherited by init */ #define SNUSIG 0x100000 /* using new signal mechanism */ #define SOWEUPC 0x200000 /* owe process an addupc() call at next ast */ /* * parallel proc structure * to replace part with times * to be passed to parent process * in ZOMBIE state. * * THIS SHOULD BE DONE WITH A union() CONSTRUCTION */ struct xproc { struct proc *xp_link; struct proc *xp_rlink; struct pte *xp_addr; char xp_usrpri; char xp_pri; /* priority, negative is high */ char xp_cpu; /* cpu usage for scheduling */ char xp_stat; char xp_time; /* resident time for scheduling */ char xp_nice; /* nice for cpu usage */ char xp_slptime; char p_cursig; int xp_sig; /* signals pending to this process */ int xp_siga0; int xp_siga1; int xp_flag; short xp_uid; /* user id, used to direct tty signals */ short xp_pgrp; /* name of process group leader */ short xp_pid; /* unique process id */ short xp_ppid; /* process id of parent */ short xp_xstat; /* Exit status for wait */ struct vtimes xp_vm; }; @iI/k4덥$}["&iK36i /* pdma.h 4.2 81/02/19 */ struct pdma { struct device *p_addr; char *p_mem; char *p_end; int p_arg; int (*p_fcn)(); }; @iK0kCAM$BUX"&ijIf6i /* pcb.h 4.5 81/05/14 */ /* * VAX process control block */ struct pcb { int pcb_ksp; /* kernel stack pointer */ int pcb_esp; /* exec stack pointer */ int pcb_ssp; /* supervisor stack pointer */ int pcb_usp; /* user stack pointer */ int pcb_r0; int pcb_r1; int pcb_r2; int pcb_r3; int pcb_r4; int pcb_r5; int pcb_r6; int pcb_r7; int pcb_r8; int pcb_r9; int pcb_r10; int pcb_r11; int pcb_r12; #define pcb_ap pcb_r12 int pcb_r13; #define pcb_fp pcb_r13 int pcb_pc; /* program counter */ int pcb_psl; /* program status longword */ struct pte *pcb_p0br; /* seg 0 base register */ int pcb_p0lr; /* seg 0 length register and astlevel */ struct pte *pcb_p1br; /* seg 1 base register */ int pcb_p1lr; /* seg 1 length register and pme */ /* * Software pcb (extension) */ int pcb_szpt; /* number of pages of user page table */ int pcb_cmap2; int *pcb_sswap; int pcb_sigc[3]; }; #define AST_NONE 0x04000000 /* ast level */ #define AST_USER 0x03000000 /* ast for user mode */ #define ASTLVL_NONE 4 #define ASTLVL_USER 3 #define AST_CLR 0x07000000 #define aston() \ { \ u.u_pcb.pcb_p0lr = (u.u_pcb.pcb_p0lr &~ AST_CLR) | AST_USER; \ mtpr(ASTLVL, ASTLVL_USER); \ } #define astoff() \ { \ u.u_pcb.pcb_p0lr = (u.u_pcb.pcb_p0lr &~ AST_CLR) | AST_NONE; \ mtpr(ASTLVL, ASTLVL_NONE); \ } @iN1k덥$R"&iJ36i /* vcmd.h 4.3 81/02/25 */ #define VPRINT 0100 #define VPLOT 0200 #define VPRINTPLOT 0400 #define VGETSTATE (('v'<<8)|0) #define VSETSTATE (('v'<<8)|1) ((@iP2k=I$ILO!&iJ36i /* mx.h 4.3 81/02/25 */ #define NGROUPS 10 /* number of mpx files permitted at one time */ #define NCHANS 20 /* number of channel structures */ #define NPORTS 30 /* number of channels to i/o ports */ #define CNTLSIZ 10 #define NLEVELS 4 #define NMSIZE 50 /* max size of mxlstn file name */ /* * header returned on read of mpx */ struct rh { short index; short count; short ccount; }; /* * head expected on write of mpx */ struct wh { short index; short count; short ccount; char *data; }; struct mx_args { char *m_name; int m_cmd; int m_arg[3]; }; #ifdef KERNEL /* * internal structure for channel */ struct chan { short c_flags; char c_index; char c_line; struct group *c_group; struct file *c_fy; struct tty *c_ttyp; struct clist c_ctlx; int c_pgrp; struct tty *c_ottyp; char c_oline; union { struct clist datq; } cx; union { struct clist datq; struct chan *c_chan; } cy; struct clist c_ctly; }; struct schan { short c_flags; char c_index; char c_line; struct group *c_group; struct file *c_fy; struct tty *c_ttyp; struct clist c_ctlx; int c_pgrp; }; /* * flags */ #define INUSE 01 #define SIOCTL 02 #define XGRP 04 #define YGRP 010 #define WCLOSE 020 #define ISGRP 0100 #define BLOCK 0200 #define EOTMARK 0400 #define SIGBLK 01000 #define BLKMSG 01000 #define ENAMSG 02000 #define WFLUSH 04000 #define NMBUF 010000 #define PORT 020000 #define ALT 040000 #define FBLOCK 0100000 #endif /* * mpxchan command codes */ #define MPX 5 #define MPXN 6 #define CHAN 1 #define JOIN 2 #define EXTR 3 #define ATTACH 4 #define CONNECT 7 #define DETACH 8 #define DISCON 9 #define DEBUG 10 #define NPGRP 11 #define CSIG 12 #define PACK 13 #define NDEBUGS 30 /* * control channel message codes */ #define M_WATCH 1 #define M_CLOSE 2 #define M_EOT 3 #define M_OPEN 4 #define M_BLK 5 #define M_UBLK 6 #define DO_BLK 7 #define DO_UBLK 8 #define M_IOCTL 12 #define M_IOANS 13 #define M_SIG 14 /* * debug codes other than mpxchan cmds */ #define MCCLOSE 29 #define MCOPEN 28 #define ALL 27 #define SCON 26 #define MSREAD 25 #define SDATA 24 #define MCREAD 23 #define MCWRITE 22 /* mux io controls */ #define MXLSTN (('x'<<8)|1) #define MXNBLK (('x'<<8)|2) @iT3kFR$ @CF^@iI36i /* mtpr.h 4.5 81/02/25 */ /* * VAX processor register numbers */ #define KSP 0x0 /* kernel stack pointer */ #define ESP 0x1 /* exec stack pointer */ #define SSP 0x2 /* supervisor stack pointer */ #define USP 0x3 /* user stack pointer */ #define ISP 0x4 /* interrupt stack pointer */ #define P0BR 0x8 /* p0 base register */ #define P0LR 0x9 /* p0 length register */ #define P1BR 0xa /* p1 base register */ #define P1LR 0xb /* p1 length register */ #define SBR 0xc /* system segment base register */ #define SLR 0xd /* system segment length register */ #define PCBB 0x10 /* process control block base */ #define SCBB 0x11 /* system control block base */ #define IPL 0x12 /* interrupt priority level */ #define ASTLVL 0x13 /* async. system trap level */ #define SIRR 0x14 /* software interrupt request */ #define SISR 0x15 /* software interrupt summary */ #define ICCS 0x18 /* interval clock control */ #define NICR 0x19 /* next interval count */ #define ICR 0x1a /* interval count */ #define TODR 0x1b /* time of year (day) */ #define RXCS 0x20 /* console receiver control and status */ #define RXDB 0x21 /* console receiver data buffer */ #define TXCS 0x22 /* console transmitter control and status */ #define TXDB 0x23 /* console transmitter data buffer */ #define MAPEN 0x38 /* memory management enable */ #define TBIA 0x39 /* translation buffer invalidate all */ #define TBIS 0x3a /* translation buffer invalidate single */ #define PMR 0x3d /* performance monitor enable */ #define SID 0x3e /* system identification */ #if VAX780 #define ACCS 0x28 /* accelerator control and status */ #define ACCR 0x29 /* accelerator maintenance */ #define WCSA 0x2c /* WCS address */ #define WCSD 0x2d /* WCS data */ #define SBIFS 0x30 /* SBI fault and status */ #define SBIS 0x31 /* SBI silo */ #define SBISC 0x32 /* SBI silo comparator */ #define SBIMT 0x33 /* SBI maintenance */ #define SBIER 0x34 /* SBI error register */ #define SBITA 0x35 /* SBI timeout address */ #define SBIQC 0x36 /* SBI quadword clear */ #define MBRK 0x3c /* micro-program breakpoint */ #endif #if VAX750 #define MCSR 0x17 /* machine check status register */ #define CSRS 0x1c /* console storage receive status register */ #define CSRD 0x1d /* console storage receive data register */ #define CSTS 0x1e /* console storage transmit status register */ #define CSTD 0x1f /* console storage transmit data register */ #define TBDR 0x24 /* translation buffer disable register */ #define CADR 0x25 /* cache disable register */ #define MCESR 0x26 /* machine check error summary register */ #define CAER 0x27 /* cache error */ #define IUR 0x37 /* init unibus register */ #define TB 0x3b /* translation buffer */ #endif @iX4kuꍥ$K=!&iH36i /* mount.h 4.3 81/02/26 */ /* * Mount structure. * One allocated on every mount. * Used to find the super block. */ struct mount { dev_t m_dev; /* device mounted */ struct buf *m_bufp; /* pointer to superblock */ struct inode *m_inodp; /* pointer to mounted on inode */ }; #ifdef KERNEL struct mount mount[NMOUNT]; #endif ((@iZ5k*$ &i*6i /* mem.h 4.9 81/04/03 */ /* * Memory controller registers * * The way in which the data is stored in these registers varies * per cpu, so we define macros here to mask that. */ struct mcr { int mc_reg[3]; }; /* * Compute maximum possible number of memory controllers, * for sizing of the mcraddr array. */ #if VAX780 #define MAXNMCR 4 #else #define MAXNMCR 1 #endif /* * For each processor type we define 5 macros: * M???_INH(mcr) inhibits further crd interrupts from mcr * M???_ENA(mcr) enables another crd interrupt from mcr * M???_ERR(mcr) tells whether an error is waiting * M???_SYN(mcr) gives the syndrome bits of the error * M???_ADDR(mcr) gives the address of the error */ #if VAX780 #define M780_ICRD 0x40000000 /* inhibit crd interrupts, in [2] */ #define M780_HIER 0x20000000 /* high error rate, in reg[2] */ #define M780_ERLOG 0x10000000 /* error log request, in reg[2] */ /* on a 780, memory crd's occur only when bit 15 is set in the SBIER */ /* register; bit 14 there is an error bit which we also clear */ /* these bits are in the back of the ``red book'' (or in the VMS code) */ #define M780_INH(mcr) \ (((mcr)->mc_reg[2] = (M780_ICRD|M780_HIER|M780_ERLOG)), mtpr(SBIER, 0)) #define M780_ENA(mcr) \ (((mcr)->mc_reg[2] = (M780_HIER|M780_ERLOG)), mtpr(SBIER, 3<<14)) #define M780_ERR(mcr) \ ((mcr)->mc_reg[2] & (M780_ERLOG)) #define M780_SYN(mcr) ((mcr)->mc_reg[2] & 0xff) #define M780_ADDR(mcr) (((mcr)->mc_reg[2] >> 8) & 0xfffff) #endif #if VAX750 #define M750_ICRD 0x10000000 /* inhibit crd interrupts, in [1] */ #define M750_UNCORR 0xc0000000 /* uncorrectable error, in [0] */ #define M750_CORERR 0x40000000 /* correctable error, in [0] */ #define M750_INH(mcr) ((mcr)->mc_reg[1] = M750_ICRD) #define M750_ENA(mcr) ((mcr)->mc_reg[0] = (M750_UNCORR|M750_CORERR), \ (mcr)->mc_reg[1] = 0) #define M750_ERR(mcr) ((mcr)->mc_reg[0] & (M750_UNCORR|M750_CORERR)) #define M750_SYN(mcr) ((mcr)->mc_reg[0] & 0x3f) #define M750_ADDR(mcr) (((mcr)->mc_reg[0] >> 8) & 0x7fff) #endif #if VAX7ZZ #define M7ZZ_CRD 0x40000000 /* crd, in [1] */ #define M7ZZ_FTBPE 0x20000000 /* force tbuf parity error, in [1] */ #define M7ZZ_ENACRD 0x10000000 /* enable crd interrupt, in [1] */ #define M7ZZ_MME 0x08000000 /* mem-man enable (ala ipr), in [1] */ #define M7ZZ_DM 0x04000000 /* diagnostic mode, in [1] */ #define M7ZZ_DISECC 0x02000000 /* disable ecc, in [1] */ #define M7ZZ_INH(mcr) ((mcr)->mc_reg[1] = M7ZZ_MME) #define M7ZZ_ENA(mcr) ((mcr)->mc_reg[1] = (M7ZZ_MME|M7ZZ_ENACRD)) #define M7ZZ_ERR(mcr) ((mcr)->mc_reg[1] & M7ZZ_CRD) #define M7ZZ_SYN(mcr) ((mcr)->mc_reg[0] & 0x7f) #define M7ZZ_ADDR(mcr) (((mcr)->mc_reg[0] >> 8) & 0x7fff) #endif #define MEMINTVL (60*60*10) /* 10 minutes */ #ifdef KERNEL int nmcr; struct mcr *mcraddr[MAXNMCR]; #endif @i^6kjt$M.1!&iH36i /* map.h 4.5 81/02/28 */ /* * Resource Allocation Maps. * * Associated routines manage sub-allocation of an address space using * an array of segment descriptors. The first element of this array * is a map structure, describing the arrays extent and the name * of the controlled object. Each additional structure represents * a free segment of the address space. * * A call to rminit initializes a resource map and may also be used * to free some address space for the map. Subsequent calls to rmalloc * and rmfree allocate and free space in the resource map. If the resource * map becomes too fragmented to be described in the available space, * then some of the resource is discarded. This may lead to critical * shortages, but is better than not checking (as the previous versions * of these routines did) or giving up and calling panic(). The routines * could use linked lists and call a memory allocator when they run * out of space, but that would not solve the out of space problem when * called at interrupt time. * * N.B.: The address 0 in the resource address space is not available * as it is used internally by the resource map routines. */ struct map { struct mapent *m_limit; /* address of last slot in map */ char *m_name; /* name of resource */ /* we use m_name when the map overflows, in warning messages */ }; struct mapent { int m_size; /* size of this segment of the map */ int m_addr; /* resource-space addr of start of segment */ }; #ifdef KERNEL struct map *swapmap; int nswapmap; struct map *argmap; #define ARGMAPSIZE 16 struct map *kernelmap; #endif @ia7kGp$"%(+!&i /* user.h 4.8 81/04/28 */ #ifdef KERNEL #include "../h/pcb.h" #include "../h/dmap.h" #include "../h/vtimes.h" #include "assym.s" #else #include #include #include #endif /* * The user structure. * One allocated per process. * Contains all per process data * that doesn't need to be referenced * while the process is swapped. * The user block is UPAGES*NBPG bytes * long; resides at virtual user * loc 0x80000000-UPAGES*NBPG; contains the system * stack per user; is cross referenced * with the proc structure for the * same process. */ #define SHSIZE 32 struct user { struct pcb u_pcb; int u_arg[5]; /* arguments to current system call */ label_t u_qsav; /* for non-local gotos on interrupts */ char u_segflg; /* 0:user D; 1:system; 2:user I */ char u_error; /* return error code */ short u_uid; /* effective user id */ short u_gid; /* effective group id */ short u_ruid; /* real user id */ short u_rgid; /* real group id */ struct proc *u_procp; /* pointer to proc structure */ int *u_ap; /* pointer to arglist */ union { /* syscall return values */ struct { int R_val1; int R_val2; } u_rv; #define r_val1 u_rv.R_val1 #define r_val2 u_rv.R_val2 off_t r_off; time_t r_time; } u_r; caddr_t u_base; /* base address for IO */ unsigned int u_count; /* bytes remaining for IO */ off_t u_offset; /* offset in file for IO */ struct inode *u_cdir; /* pointer to inode of current directory */ struct inode *u_rdir; /* root directory of current process */ char u_dbuf[DIRSIZ]; /* current pathname component */ caddr_t u_dirp; /* pathname pointer */ struct direct u_dent; /* current directory entry */ struct inode *u_pdir; /* inode of parent directory of dirp */ struct file *u_ofile[NOFILE]; /* pointers to file structures of open files */ char u_pofile[NOFILE]; /* per-process flags of open files */ #define EXCLOSE 01 /* auto-close on exec */ label_t u_ssav; /* label variable for swapping */ int (*u_signal[NSIG])(); /* dispo((sition of signals */ int u_code; /* ``code'' to trap */ /* on SIGILL code passes compatibility mode fault address */ /* on SIGFPE code passes more specific kind of floating point fault */ int *u_ar0; /* address of users saved R0 */ struct uprof { /* profile arguments */ short *pr_base; /* buffer base */ unsigned pr_size; /* buffer size */ unsigned pr_off; /* pc offset */ unsigned pr_scale; /* pc scaling */ } u_prof; char u_eosys; /* special action on end of syscall */ char u_sep; /* flag for I and D separation */ struct tty *u_ttyp; /* controlling tty pointer */ dev_t u_ttyd; /* controlling tty dev */ union { struct { /* header of executable file */ int Ux_mag; /* magic number */ unsigned Ux_tsize; /* text size */ unsigned Ux_dsize; /* data size */ unsigned Ux_bsize; /* bss size */ unsigned Ux_ssize; /* symbol table size */ unsigned Ux_entloc; /* entry location */ unsigned Ux_unused; unsigned Ux_relflg; } Ux_A; char ux_shell[SHSIZE]; /* #! and name of interpreter */ } u_exdata; #define ux_mag Ux_A.Ux_mag #define ux_tsize Ux_A.Ux_tsize #define ux_dsize Ux_A.Ux_dsize #define ux_bsize Ux_A.Ux_bsize #define ux_ssize Ux_A.Ux_ssize #define ux_entloc Ux_A.Ux_entloc #define ux_unused Ux_A.Ux_unused #define ux_relflg Ux_A.Ux_relflg char u_comm[DIRSIZ]; time_t u_start; char u_acflag; short u_fpflag; /* unused now, will be later */ short u_cmask; /* mask for file creation */ size_t u_tsize; /* text size (clicks) */ size_t u_dsize; /* data size (clicks) */ size_t u_ssize; /* stack size (clicks) */ struct vtimes u_vm; /* stats for this proc */ struct vtimes u_cvm; /* sum of stats for reaped children */ struct dmap u_dmap; /* disk map for data segment */ struct dmap u_smap; /* disk map for stack segment */ struct dmap u_cdmap, u_csmap; /* shadows of u_dmap, u_smap, for use of parent during fork */ time_t u_outime; /* user time at last sample */ size_t u_odsize, u_ossize; /* for (clumsy) expansion swaps */ size_t u_vrpages[NOFILE]; /* number vread pages hanging on fd */ int u_limit[8]; /* see */ #ifdef notdef unsigned u_vsave; /* saved previous fault page number */ #endif int u_stack[1]; /* * kernel stack per user * extends from u + UPAGES*512 * backward not to reach here */ /* SHOULD INSTEAD GROW STACK BACKWARDS ABOVE u. TOWARDS A VIRTUAL HOLE */ }; /* u_eosys values */ #define JUSTRETURN 0 #define RESTARTSYS 1 #define SIMULATERTI 2 /* u_error codes */ #include #ifdef KERNEL extern struct user u; extern struct user swaputl; extern struct user forkutl; extern struct user xswaputl; extern struct user xswap2utl; extern struct user pushutl; extern struct user vfutl; #endif @ig8kp|$ w@iF36i /* inode.h 4.5 81/03/09 */ /* * The I node is the focus of all * file activity in unix. There is a unique * inode allocated for each active file, * each current directory, each mounted-on * file, text file, and the root. An inode is 'named' * by its dev/inumber pair. (iget/iget.c) * Data, from mode on, is read in * from permanent inode on volume. */ #define NADDR 13 #define NINDEX 6 struct group { short g_state; char g_index; char g_rot; struct group *g_group; struct inode *g_inode; struct file *g_file; short g_rotmask; short g_datq; struct chan *g_chans[NINDEX]; }; struct inode { char i_flag; char i_count; /* reference count */ dev_t i_dev; /* device where inode resides */ ino_t i_number; /* i number, 1-to-1 with device address */ unsigned short i_mode; short i_nlink; /* directory entries */ short i_uid; /* owner */ short i_gid; /* group of owner */ off_t i_size; /* size of file */ union { struct { daddr_t I_addr[NADDR]; /* if normal file/directory */ daddr_t I_lastr; /* last read (for read-ahead) */ } i_f; #define i_addr i_f.I_addr #define i_lastr i_f.I_lastr struct { daddr_t I_rdev; /* i_addr[0] */ struct group I_group; /* multiplexor group file */ } i_d; #define i_rdev i_d.I_rdev #define i_group i_d.I_group } i_un; short i_vfdcnt; /* number of fd's vreading this inode */ short i_hlink; /* link in hash chain (iget/iput/ifind) */ }; #ifdef KERNEL struct inode *inode, *inodeNINODE; int ninode; struct inode *rootdir; /* pointer to inode of root directory */ struct inode *mpxip; /* mpx virtual inode */ struct inode *ialloc(); struct inode *ifind(); struct inode *iget(); struct inode *owner(); struct inode *maknode(); struct inode *namei(); #endif /* flags */ #define ILOCK 01 /* inode is locked */ #define IUPD 02 /* file has been modified */ #define IACC 04 /* inode access time to be updated */ #define IMOUNT 010 /* inode is mounted on */ #define IWANT 020 /* some process waiting on lock */ #define ITEXT 040 /* inode is pure text prototype */ #define ICHG 0100 /* inode has been changed */ #define IPIPE 0200 /* inode is a pipe */ /* modes */ #define IFMT 0170000 /* type of file */ #define IFDIR 0040000 /* directory */ #define IFCHR 0020000 /* character special */ #define IFBLK 0060000 /* block special */ #define IFREG 0100000 /* regular */ #define IFMPC 0030000 /* multiplexed char special */ #define IFMPB 0070000 /* multiplexed block special */ #define ISUID 04000 /* set user id on execution */ #define ISGID 02000 /* set group id on execution */ #define ISVTX 01000 /* save swapped text even after use */ #define IREAD 0400 /* read, write, execute permissions */ #define IWRITE 0200 #define IEXEC 0100 @ik9kAύ$>w@iF36i /* ino.h 4.2 81/02/19 */ /* * Inode structure as it appears on * a disk block. */ struct dinode { unsigned short di_mode; /* mode and type of file */ short di_nlink; /* number of links to file */ short di_uid; /* owner's user id */ short di_gid; /* owner's group id */ off_t di_size; /* number of bytes in file */ char di_addr[40]; /* disk block addresses */ time_t di_atime; /* time last accessed */ time_t di_mtime; /* time last modified */ time_t di_ctime; /* time created */ }; /* * the 40 address bytes: * 39 used; 13 addresses * of 3 bytes each. */ @im:k獥$!&iE36i ((/* inline.h 4.3 81/02/26 */ /* * Definitions of inlines, and macro replacements * for them if UNFAST (latter only scantily tested). */ #ifndef UNFAST #define plock(ip) \ { \ while ((ip)->i_flag & ILOCK) { \ (ip)->i_flag |= IWANT; \ sleep((caddr_t)(ip), PINOD); \ } \ (ip)->i_flag |= ILOCK; \ } #define prele(ip) \ { \ (ip)->i_flag &= ~ILOCK; \ if ((ip)->i_flag&IWANT) { \ (ip)->i_flag &= ~IWANT; \ wakeup((caddr_t)(ip)); \ } \ } #define GETF(fp, fd) { \ if ((unsigned)(fd) >= NOFILE || ((fp) = u.u_ofile[fd]) == NULL) { \ u.u_error = EBADF; \ return; \ } \ } #define IUPDAT(ip, t1, t2, waitfor) { \ if (ip->i_flag&(IUPD|IACC|ICHG)) \ iupdat(ip, t1, t2, waitfor); \ } #define ISSIG(p) ((p)->p_sig && \ ((p)->p_flag&STRC || ((p)->p_sig &~ (p)->p_ignsig)) && issig()) #else #define GETF(fp, fd) { \ (fp) = getf(fd); \ if ((fp) == NULL) \ return; \ } #define IUPDAT(ip, t1, t2, waitfor) iupdat(ip, t1, t2, waitfor) #define ISSIG(p) issig(p) #endif @io;k䍘$  !&iE36i /* flp.h 4.4 81/02/25 */ #if VAX780 /* * Console floppy command/status and sectoring information. */ #define FL_FFC 0x200 /* floppy function complete */ #define FL_ERR 0x80 /* error bit in floppy status byte */ #define FL_PERR 0x905 /* floppy protocol error */ #define FL_DATA 0x100 /* floppy data select code */ #define FL_RS 0x900 /* floppy read sector command */ #define FL_WS 0x901 /* floppy write sector command*/ #define FL_STAT 0x902 /* floppy get status command*/ #define FL_CANCEL 0x904 /* cancel floppy function */ #define RXFTRK 77 /* tracks/floppy */ #define RXSTRK 26 /* sectors/track */ #define RXBYSEC 128 /* bytes/sector */ #define MAXSEC (RXFTRK*RXSTRK) /* sectors/floppy */ /* * In the floppy driver routines, the device active byte is used * not as a boolean, but as an indicator of the state we are in. * That is, it contains what to do on the next interrupt. */ #define FL_IDLE 0 /* floppy idle */ #define FL_MAND 1 /* about to send read/write command */ #define FL_SEC 2 /* about to send sector # to LSI */ #define FL_TRACK 3 /* about to send track # to LSI */ #define FL_DAX 4 /* transmitting data */ #define FL_DAR 5 /* receiving data */ #define FL_COM 6 /* completing transmission */ #define FL_CAN 7 /* give cancel order - we had an error, and are to restart */ #define FLERRS 5 /* number of retries before quitting */ /* * The state byte is used to retain exclusivity, * and contains the busy flag. */ #define FL_OPEN 1 #define FL_BUSY 2 #endif @ir<k̍$\w@iE36i /* filsys.h 4.3 81/03/03 */ /* * Structure of the super-block */ struct filsys { unsigned short s_isize; /* size in blocks of i-list */ daddr_t s_fsize; /* size in blocks of entire volume */ short s_nfree; /* number of addresses in s_free */ daddr_t s_free[NICFREE]; /* free block list */ short s_ninode; /* number of i-nodes in s_inode */ ino_t s_inode[NICINOD]; /* free i-node list */ char s_flock; /* lock during free list manipulation */ char s_ilock; /* lock during i-list manipulation */ char s_fmod; /* super block modified flag */ char s_ronly; /* mounted read-only flag */ time_t s_time; /* last super block update */ daddr_t s_tfree; /* total free blocks*/ ino_t s_tinode; /* total free inodes */ short s_dinfo[2]; /* interleave stuff */ #define s_m s_dinfo[0] #define s_n s_dinfo[1] char s_fsmnt[12]; /* ordinary file mounted on */ /* end not maintained */ ino_t s_lasti; /* start place for circular search */ ino_t s_nbehind; /* est # free inodes before s_lasti */ }; #ifdef KERNEL struct filsys *getfs(); #endif @iu=kԺ}$ &ia*6i /* file.h 4.5 81/03/09 */ /* * One file structure is allocated * for each open/creat/pipe call. * Main use is to hold the read/write * pointer associated with each open * file. */ struct file { short f_flag; short f_count; /* reference count */ struct inode *f_inode; /* pointer to inode structure */ union { off_t f_offset; /* read/write character pointer */ struct chan *f_chan; /* mpx channel pointer */ } f_un; }; #ifdef KERNEL struct file *file, *fileNFILE; /* the file table itself */ int nfile; struct file *getf(); struct file *falloc(); #endif /* flags */ #define FREAD 01 #define FWRITE 02 #define FPIPE 04 #define FMPX 010 #define FMPY 020 #define FMP 030 @iw>k덥$Z &iD36i ((/* fblk.h 4.2 81/02/19 */ struct fblk { int df_nfree; daddr_t df_free[NICFREE]; }; @iy?k^$1 &iJ6i /* dmap.h 4.3 81/04/23 */ /* * Definitions for the mapping of vitual swap * space to the physical swap area - the disk map. */ #define NDMAP 16 /* size of the swap area map */ #define DMMIN 32 /* the initial block size in clicks */ #define DMMAX 1024 /* max block size alloc on drum = .5M byte */ #define DMTEXT 1024 /* size of blocks of pure text = .5M byte */ struct dmap { swblk_t dm_size; /* current size used by process */ swblk_t dm_alloc; /* amount of physical swap space allocated */ swblk_t dm_map[NDMAP]; /* first disk block number in each chunk */ }; #ifdef KERNEL struct dmap zdmap; #endif /* * The following structure is that ``returned'' * from a call to vstodb(). */ struct dblock { swblk_t db_base; /* base of physical contig drum block */ swblk_t db_size; /* size of block */ }; @i{@k э$yw@iC36i /* dir.h 4.2 81/02/19 */ #ifndef DIRSIZ #define DIRSIZ 14 #endif struct direct { ino_t d_ino; char d_name[DIRSIZ]; }; @i}AkW$E &i3TP6i /* ioctl.h 4.8 81/08/31 */ /* * ioctl definitions, and special character and local tty definitions */ #ifndef _IOCTL_ #define _IOCTL_ struct tchars { char t_intrc; /* interrupt */ char t_quitc; /* quit */ char t_startc; /* start output */ char t_stopc; /* stop output */ char t_eofc; /* end-of-file */ char t_brkc; /* input delimiter (like nl) */ }; struct ltchars { char t_suspc; /* stop process signal */ char t_dsuspc; /* delayed stop process signal */ char t_rprntc; /* reprint line */ char t_flushc; /* flush output (toggles) */ char t_werasc; /* word erase */ char t_lnextc; /* literal next character */ }; /* * local mode settings */ #define LCRTBS 0000001 /* correct backspacing for crt */ #define LPRTERA 0000002 /* printing terminal \ ... / erase */ #define LCRTERA 0000004 /* do " \b " to wipe out character */ #define LTILDE 0000010 /* IIASA - hazeltine tilde kludge */ #define LMDMBUF 0000020 /* IIASA - start/stop output on carrier intr */ #define LLITOUT 0000040 /* IIASA - suppress any output translations */ #define LTOSTOP 0000100 /* send stop for any background tty output */ #define LFLUSHO 0000200 /* flush output sent to terminal */ #define LNOHANG 0000400 /* IIASA - don't send hangup on carrier drop */ #define LETXACK 0001000 /* IIASA - diablo style buffer hacking */ #define LCRTKIL 0002000 /* erase whole line on kill with " \b " */ #define LINTRUP 0004000 /* interrupt on every input char - SIGTINT */ #define LCTLECH 0010000 /* echo control characters as ^X */ #define LPENDIN 0020000 /* tp->t_rawq is waiting to be reread */ #define LDECCTQ 0040000 /* only ^Q starts after ^S */ #define LNOFLSH 0100000 /* dont flush output on signals */ /* local state */ #define LSBKSL 01 /* state bit for lowercase backslash work */ #define LSQUOT 02 /* last character input was \ */ #define LSERASE 04 /* within a \.../ for LPRTRUB */ #define LSLNCH 010 /* next character is literal */ #define LSTYPEN 020 /* retyping suspended input (LPENDIN) */ #define LSCNTTB 040 /* counting width of tab; leave LFLUSHO alone */ /* * tty ioctl commands */ #define TIOCGETD (('t'<<8)|0) /* get line discipline */ #define TIOCSETD (('t'<<8)|1) /* set line discipline */ #define TIOCHPCL (('t'<<8)|2) /* set hangup line on close bit */ #define TIOCMODG (('t'<<8)|3) /* modem bits get (???) */ #define TIOCMODS (('t'<<8)|4) /* modem bits set (???) */ #define TIOCGETP (('t'<<8)|8) /* get parameters - like old gtty */ #define TIOCSETP (('t'<<8)|9) /* set parameters - like old stty */ #define TIOCSETN (('t'<<8)|10) /* set params w/o flushing buffers */ #define TIOCEXCL (('t'<<8)|13) /* set exclusive use of tty */ #define TIOCNXCL (('t'<<8)|14) /* reset exclusive use of tty */ #define TIOCFLUSH (('t'<<8)|16) /* flush buffers */ #define TIOCSETC (('t'<<8)|17) /* set special characters */ #define TIOCGETC (('t'<<8)|18) /* get special characters */ #define TIOCIOANS (('t'<<8)|20) #define TIOCSIGNAL (('t'<<8)|21) #define TIOCUTTY (('t'<<8)|22) /* locals, from 127 down */ #define TIOCLBIS (('t'<<8)|127) /* bis local mode bits */ #define TIOCLBIC (('t'<<8)|126) /* bic local mode bits */ #define TIOCLSET (('t'<<8)|125) /* set entire local mode word */ #define TIOCLGET (('t'<<8)|124) /* get local modes */ #define TIOCSBRK (('t'<<8)|123) /* set break bit */ #define TIOCCBRK (('t'<<8)|122) /* clear break bit */ #define TIOCSDTR (('t'<<8)|121) /* set data terminal ready */ #define TIOCCDTR (('t'<<8)|120) /* clear data terminal ready */ #define TIOCGPGRP (('t'<<8)|119) /* get pgrp of tty */ #define TIOCSPGRP (('t'<<8)|118) /* set pgrp of tty */ #define TIOCSLTC (('t'<<8)|117) /* set local special characters */ #define TIOCGLTC (('t'<<8)|116) /* get local special characters */ #define TIOCOUTQ (('t'<<8)|115) /* number of chars in output queue */ #define TIOCSTI (('t'<<8)|114) /* simulate a terminal in character */ #define OTTYDISC 0 /* old, v7 std tty driver */ #define NETLDISC 1 /* line discip for berk net */ #define NTTYDISC 2 /* new tty discipline */ #define FIOCLEX (('f'<<8)|1) #define FIONCLEX (('f'<<8)|2) /* another local(( */ #define FIONREAD (('f'<<8)|127) /* get # bytes to read */ #endif @iBk?c|$ &i+6i /* conf.h 4.7 81/04/03 */ /* * Declaration of block device * switch. Each entry (row) is * the only link between the * main unix code and the driver. * The initialization of the * device switches is in the * file conf.c. */ struct bdevsw { int (*d_open)(); int (*d_close)(); int (*d_strategy)(); int (*d_dump)(); int d_flags; }; #ifdef KERNEL struct bdevsw bdevsw[]; #endif /* * Character device switch. */ struct cdevsw { int (*d_open)(); int (*d_close)(); int (*d_read)(); int (*d_write)(); int (*d_ioctl)(); int (*d_stop)(); int (*d_reset)(); struct tty *d_ttys; }; #ifdef KERNEL struct cdevsw cdevsw[]; #endif /* * tty line control switch. */ struct linesw { int (*l_open)(); int (*l_close)(); int (*l_read)(); char *(*l_write)(); int (*l_ioctl)(); int (*l_rint)(); int (*l_rend)(); int (*l_meta)(); int (*l_start)(); int (*l_modem)(); }; #ifdef KERNEL struct linesw linesw[]; #endif /* * Swap device information */ struct swdevt { dev_t sw_dev; int sw_freed; }; #ifdef KERNEL struct swdevt swdevt[]; #endif @iCk$ &iA36i /* cmap.h 4.5 81/03/09 */ /* * core map entry */ struct cmap { unsigned int c_next:13, /* index of next free list entry */ c_prev:13, /* index of previous free list entry */ c_mdev:4, /* which mounted dev this is from */ c_lock:1, /* locked for raw i/o or pagein */ c_want:1, /* wanted */ c_page:16, /* virtual page number in segment */ c_hlink:13, /* hash link for */ c_intrans:1, /* intransit bit */ c_free:1, /* on the free list */ c_gone:1, /* associated page has been released */ c_type:2, /* type CSYS or CTEXT or CSTACK or CDATA */ c_blkno:20, /* disk block this is a copy of */ c_ndx:10; /* index of owner proc or text */ }; #define CMHEAD 0 /* * Shared text pages are not totally abandoned when a process * exits, but are remembered while in the free list hashed by * off the cmhash structure so that they can be reattached * if another instance of the program runs again soon. */ #define CMHSIZ 512 /* SHOULD BE DYNAMIC */ #define CMHASH(bn) ((bn)&(CMHSIZ-1)) #ifdef KERNEL struct cmap *cmap; struct cmap *ecmap; int ncmap; struct cmap *mfind(); int firstfree, maxfree; int ecmx; /* cmap index of ecmap */ short cmhash[CMHSIZ]; #endif /* bits defined in c_type */ #define CSYS 0 /* none of below */ #define CTEXT 1 /* belongs to shared text segment */ #define CDATA 2 /* belongs to data segment */ #define CSTACK 3 /* belongs to stack segment */ #define pgtocm(x) ((((x)-firstfree) / CLSIZE) + 1) #define cmtopg(x) ((((x)-1) * CLSIZE) + firstfree) @iDkZ$ &iR*6i /* upreg.h 4.5 81/04/02 */ /* * Unibus rm emulation via sc21: * registers and bits. */ struct updevice { u_short upcs1; /* control and status register 1 */ short upwc; /* word count register */ u_short upba; /* UNIBUS address register */ u_short upda; /* desired address register */ u_short upcs2; /* control and status register 2 */ u_short upds; /* drive Status */ u_short uper1; /* error register 1 */ u_short upas; /* attention summary */ u_short upla; /* look ahead */ u_short updb; /* data buffer */ u_short upmr; /* maintenance */ u_short updt; /* drive type */ u_short upsn; /* serial number */ u_short upof; /* offset register */ u_short updc; /* desired cylinder address register */ u_short uphr; /* holding register */ u_short upmr2; /* maintenance register 2 */ u_short uper2; /* error register 2 */ u_short upec1; /* burst error bit position */ u_short upec2; /* burst error bit pattern */ }; /* Other bits of upcs1 */ #define UP_SC 0100000 /* special condition */ #define UP_TRE 0040000 /* transfer error */ #define UP_PSEL 0010000 /* port select */ #define UP_DVA 0004000 /* drive available */ /* bits 8 and 9 are the extended address bits */ #define UP_RDY 0000200 /* controller ready */ #define UP_IE 0000100 /* interrupt enable */ /* bits 5-1 are the command */ #define UP_GO 0000001 /* commands */ #define UP_NOP 000 #define UP_SEEK 004 /* seek */ #define UP_RECAL 006 /* recalibrate */ #define UP_DCLR 010 /* drive clear */ #define UP_RELEASE 012 /* release */ #define UP_OFFSET 014 /* offset */ #define UP_RTC 016 /* return to center-line */ #define UP_PRESET 020 /* read-in preset */ #define UP_PACK 022 /* pack acknowledge */ #define UP_DMABAND 024 /* dma bandwidth set */ #define UP_SEARCH 030 /* search */ #define UP_WCDATA 050 /* write check data */ #define UP_WCHDR 052 /* write check header and data */ #define UP_WCOM 060 /* write */ #define UP_WHDR 062 /* write header and data */ #define UP_RCOM 070 /* read data */ #define UP_RHDR 072 /*(( read header and data */ #define UP_BOOT 074 /* boot */ #define UP_FORMAT 076 /* format */ /* upcs2 */ #define UPCS2_DLT 0100000 /* data late */ #define UPCS2_WCE 0040000 /* write check error */ #define UPCS2_UPE 0020000 /* UNIBUS parity error */ #define UPCS2_NED 0010000 /* nonexistent drive */ #define UPCS2_NEM 0004000 /* nonexistent memory */ #define UPCS2_PGE 0002000 /* programming error */ #define UPCS2_MXF 0001000 /* missed transfer */ #define UPCS2_MDPE 0000400 /* massbus data parity error (0) */ #define UPCS2_OR 0000200 /* output ready */ #define UPCS2_IR 0000100 /* input ready */ #define UPCS2_CLR 0000040 /* controller clear */ #define UPCS2_PAT 0000020 /* parity test */ #define UPCS2_BAI 0000010 /* address increment inhibit */ /* bits 0-2 are drive select */ #define UPCS2_BITS \ "\10\20DLT\17WCE\16UPE\15NED\14NEM\13PGE\12MXF\11MDPE\ \10OR\7IR\6CLR\5PAT\4BAI" /* upds */ #define UPDS_ATA 0100000 /* attention active */ #define UPDS_ERR 0040000 /* composite drive error */ #define UPDS_PIP 0020000 /* positioning in progress */ #define UPDS_MOL 0010000 /* medium on line */ #define UPDS_WRL 0004000 /* write locked */ #define UPDS_LST 0002000 /* last sector transferred */ #define UPDS_PGM 0001000 /* programmable */ #define UPDS_DPR 0000400 /* drive present */ #define UPDS_DRY 0000200 /* drive ready */ #define UPDS_VV 0000100 /* volume valid */ /* bits 1-5 are spare */ #define UPDS_OM 0000001 /* offset mode */ #define UPDS_DREADY (UPDS_DPR|UPDS_DRY|UPDS_MOL|UPDS_VV) #define UPDS_BITS \ "\10\20ATA\17ERR\16PIP\15MOL\14WRL\13LST\12PGM\11DPR\10DRY\7VV\1OM" /* uper1 */ #define UPER1_DCK 0100000 /* data check */ #define UPER1_UNS 0040000 /* drive unsafe */ #define UPER1_OPI 0020000 /* operation incomplete */ #define UPER1_DTE 0010000 /* drive timing error */ #define UPER1_WLE 0004000 /* write lock error */ #define UPER1_IAE 0002000 /* invalid address error */ #define UPER1_AOE 0001000 /* address overflow error */ #define UPER1_HCRC 0000400 /* header crc error */ #define UPER1_HCE 0000200 /* header compare error */ #define UPER1_ECH 0000100 /* ecc hard error */ #define UPER1_WCF 0000040 /* write clock fail (0) */ #define UPER1_FER 0000020 /* format error */ #define UPER1_PAR 0000010 /* parity error */ #define UPER1_RMR 0000004 /* register modification refused */ #define UPER1_ILR 0000002 /* illegal register */ #define UPER1_ILF 0000001 /* illegal function */ #define UPER1_BITS \ "\10\20DCK\17UNS\16OPI\15DTE\14WLE\13IAE\12AOE\11HCRC\10HCE\ \7ECH\6WCF\5FER\4PAR\3RMR\2ILR\1ILF" /* uphr */ /* write these int uphr and then read back values */ #define UPHR_MAXCYL 0100027 /* max cyl address */ #define UPHR_MAXTRAK 0100030 /* max track address */ #define UPHR_MAXSECT 0100031 /* max sector address */ /* uper2 */ #define UPER2_BSE 0100000 /* bad sector error */ #define UPER2_SKI 0040000 /* seek incomplete */ #define UPER2_OPE 0020000 /* operator plug error */ #define UPER2_IVC 0010000 /* invalid command */ #define UPER2_LSC 0004000 /* loss of sector clock */ #define UPER2_LBC 0002000 /* loss of bit clock */ #define UPER2_MDS 0001000 /* multiple drive select */ #define UPER2_DCU 0000400 /* dc power unsafe */ #define UPER2_DVC 0000200 /* device check */ #define UPER2_ACU 0000100 /* ac power unsafe */ /* bits 5 and 4 are spare */ #define UPER2_DPE 0000010 /* data parity error (0) */ /* bits 2-0 are spare */ #define UPER2_BITS \ "\10\20BSE\17SKI\16OPE\15IVC\14LSC\13LBC\12MDS\11DCU\10DVC\7ACU\4DPE" /* upof */ #define UPOF_FMT22 0010000 /* 16 bit format */ #define UPOF_ECI 0004000 /* ecc inhibit */ #define UPOF_HCI 0002000 /* header compare inhibit */ /* THE SC21 ACTUALLY JUST IMPLEMENTS ADVANCE/RETARD... */ #define UPOF_P400 0020 /* +400 uinches */ #define UPOF_M400 0220 /* -400 uinches */ #define UPOF_P800 0040 /* +800 uinches */ #define UPOF_M800 0240 /* -800 uinches */ #define UPOF_P1200 0060 /* +1200 uinches */ #define UPOF_M1200 0260 /* -1200 uinches */ @iEkgy$ &i[6i /* buf.h 4.13 81/05/09 */ /* * The header for buffers in the buffer pool and otherwise used * to describe a block i/o request is given here. The routines * which manipulate these things are given in bio.c. * * Each buffer in the pool is usually doubly linked into 2 lists: * hashed into a chain by so it can be located in the cache, * and (usually) on (one of several) queues. These lists are circular and * doubly linked for easy removal. * * There are currently three queues for buffers: * one for buffers which must be kept permanently (super blocks) * one for buffers containing ``useful'' information (the cache) * one for buffers containing ``non-useful'' information * (and empty buffers, pushed onto the front) * The latter two queues contain the buffers which are available for * reallocation, are kept in lru order. When not on one of these queues, * the buffers are ``checked out'' to drivers which use the available list * pointers to keep track of them in their i/o active queues. */ /* * Bufhd structures used at the head of the hashed buffer queues. * We only need three words for these, so this abbreviated * definition saves some space. */ struct bufhd { long b_flags; /* see defines below */ struct buf *b_forw, *b_back; /* fwd/bkwd pointer in chain */ }; struct buf { long b_flags; /* too much goes here to describe */ struct buf *b_forw, *b_back; /* hash chain (2 way street) */ struct buf *av_forw, *av_back; /* position on free list if not BUSY */ #define b_actf av_forw /* alternate names for driver queue */ #define b_actl av_back /* head - isn't history wonderful */ long b_bcount; /* transfer count */ #define b_active b_bcount /* driver queue head: drive active */ short b_error; /* returned after I/O */ dev_t b_dev; /* major+minor device name */ union { caddr_t b_addr; /* low order core address */ int *b_words; /* words for clearing */ struct filsys *b_filsys; /* superblocks */ struct dinode *b_dino; /* ilist */ daddr_t *b_daddr; /* indirect block */ } b_un; daddr_t b_blkno; /* block # on device */ long b_resid; /* words not transferred after error */ #define b_errcnt b_resid /* while i/o in progress: # retries */ #define b_pfcent b_resid /* garbage: don't ask */ struct proc *b_proc; /* proc doing physical or swap I/O */ }; #define BQUEUES 3 /* number of free buffer queues */ #define BQ_LOCKED 0 /* super-blocks &c */ #define BQ_LRU 1 /* lru, useful buffers */ #define BQ_AGE 2 /* rubbish */ #ifdef KERNEL struct buf *buf; /* the buffer pool itself */ char *buffers; int nbuf; struct buf *swbuf; /* swap I/O headers */ int nswbuf; short *swsize; int *swpf; struct buf bfreelist[BQUEUES]; /* heads of available lists */ struct buf bswlist; /* head of free swap header list */ struct buf *bclnlist; /* head of cleaned page list */ struct buf *alloc(); struct buf *baddr(); struct buf *getblk(); struct buf *geteblk(); struct buf *bread(); struct buf *breada(); unsigned minphys(); #endif /* * These flags are kept in b_flags. */ #define B_WRITE 0x000000 /* non-read pseudo-flag */ #define B_READ 0x000001 /* read when I/O occurs */ #define B_DONE 0x000002 /* transaction finished */ #define B_ERROR 0x000004 /* transaction aborted */ #define B_BUSY 0x000008 /* not on av_forw/back list */ #define B_PHYS 0x000010 /* physical IO */ #define B_XXX 0x000020 /* was B_MAP, alloc UNIBUS on pdp-11 */ #define B_WANTED 0x000040 /* issue wakeup when BUSY goes off */ #define B_AGE 0x000080 /* delayed write for correct aging */ #define B_ASYNC 0x000100 /* don't wait for I/O completion */ #define B_DELWRI 0x000200 /* write at exit of avail list */ #define B_TAPE 0x000400 /* this is a magtape (no bdwrite) */ #define B_UAREA 0x000800 /* add u-area to a swap operation */ #define B_PAGET 0x001000 /* page in/out of page table space */ #define B_DIRTY 0x002000 /* dirty page to be pushed out async */ #define B_PGIN 0x004000 /* pagein op, so swap() can count it */ #define B_CACHE 0x008000 /* did bread find us in the cache ? */ #define B_INVAL 0x010000 /* does not contain valid info */ #define B_LOCKED 0x020000 /* locked in core (not reusable) */ #define B_HEAD 0x040000 /* a buffer header, not a buffer */ #define B_BAD 0x100000 /* bad block revectoring in progress */ ((@iFk3ꍥ$&i?36i /* bk.h 4.2 81/02/19 */ /* * Macro definition of bk.c/netinput(). * This is used to replace a call to * (*linesw[tp->t_line].l_rint)(c,tp); * with * * if (tp->t_line == NETLDISC) * BKINPUT(c, tp); * else * (*linesw[tp->t_line].l_rint)(c,tp); */ #define BKINPUT(c, tp) { \ if ((tp)->t_rec == 0) { \ *(tp)->t_cp++ = c; \ if (++(tp)->t_inbuf == BSIZE || (c) == '\n') { \ (tp)->t_rec = 1; \ wakeup((caddr_t)&(tp)->t_rawq); \ } \ } \ } @iGk荥$%&i?36i /* acct.h 4.3 81/03/09 */ /* * Accounting structures; * these use a comp_t type which is a 3 bits base 8 * exponent, 13 bit fraction ``floating point'' number. */ typedef u_short comp_t; struct acct { char ac_comm[10]; /* Accounting command name */ comp_t ac_utime; /* Accounting user time */ comp_t ac_stime; /* Accounting system time */ comp_t ac_etime; /* Accounting elapsed time */ time_t ac_btime; /* Beginning time */ short ac_uid; /* Accounting user ID */ short ac_gid; /* Accounting group ID */ short ac_mem; /* average memory usage */ comp_t ac_io; /* number of disk IO blocks */ dev_t ac_tty; /* control typewriter */ char ac_flag; /* Accounting flag */ }; #define AFORK 01 /* has executed fork, but no exec */ #define ASU 02 /* used super-user privileges */ @iHk$&i6i /* hpreg.h 4.9 81/08/31 */ struct hpdevice { int hpcs1; /* control and status register 1 */ int hpds; /* drive status */ int hper1; /* error register 1 */ int hpmr; /* maintenance */ int hpas; /* attention summary */ int hpda; /* desired address register */ int hpdt; /* drive type */ int hpla; /* look ahead */ int hpsn; /* serial number */ int hpof; /* offset register */ int hpdc; /* desired cylinder address register */ int hpcc; /* current cylinder */ /* on an rp drive, mr2 is called er2 and er2 is called er3 */ /* we use rm terminology here */ int hpmr2; /* maintenance register 2 */ int hper2; /* error register 2 */ int hpec1; /* burst error bit position */ int hpec2; /* burst error bit pattern */ }; /* hpcs1 */ #define HP_SC 0100000 /* special condition */ #define HP_TRE 0040000 /* transfer error */ #define HP_DVA 0004000 /* drive available */ #define HP_RDY 0000200 /* controller ready */ #define HP_IE 0000100 /* interrupt enable */ /* bits 5-1 are the command */ #define HP_GO 0000001 /* commands */ #define HP_NOP 000 /* no operation */ #define HP_UNLOAD 002 /* offline drive */ #define HP_SEEK 004 /* seek */ #define HP_RECAL 006 /* recalibrate */ #define HP_DCLR 010 /* drive clear */ #define HP_RELEASE 012 /* release */ #define HP_OFFSET 014 /* offset */ #define HP_RTC 016 /* return to centerline */ #define HP_PRESET 020 /* read-in preset */ #define HP_PACK 022 /* pack acknowledge */ #define HP_SEARCH 030 /* search */ #define HP_DIAGNOSE 034 /* diagnose drive */ #define HP_WCDATA 050 /* write check data */ #define HP_WCHDR 052 /* write check header and data */ #define HP_WCOM 060 /* write data */ #define HP_WHDR 062 /* write header */ #define HP_WTRACKD 064 /* write track descriptor */ #define HP_RCOM 070 /* read data */ #define HP_RHDR 072 /* read header and data */ #define HP_RTRACKD 074 /* read track descriptor */ /* hpds */ #define HPDS_ATA 0100000 /* attention active */ #define HPDS_ERR 0040000 /* composite drive error */ #define HPDS_PIP 0020000 /* positioning in progress */ #define HPDS_MOL 0010000 /* medium on line */ #define HPDS_WRL 0004000 /* write locked */ #define HPDS_LST 0002000 /* last sector transferred */ #define HPDS_PGM 0001000 /* programmable */ #define HPDS_DPR 0000400 /* drive present */ #define HPDS_DRY 0000200 /* drive ready */ #define HPDS_VV 0000100 /* volume valid */ /* bits 1-5 are spare */ #define HPDS_OM 0000001 /* offset mode */ #define HPDS_DREADY (HPDS_DPR|HPDS_DRY|HPDS_MOL|HPDS_VV) #define HPDS_BITS \ "\10\20ATA\17ERR\16PIP\15MOL\14WRL\13LST\12PGM\11DPR\10DRY\7VV\1OM" /* hper1 */ #define HPER1_DCK 0100000 /* data check */ #define HPER1_UNS 0040000 /* drive unsafe */ #define HPER1_OPI 0020000 /* operation incomplete */ #define HPER1_DTE 0010000 /* drive timing error */ #define HPER1_WLE 0004000 /* write lock error */ #define HPER1_IAE 0002000 /* invalid address error */ #define HPER1_AOE 0001000 /* address overflow error */ #define HPER1_HCRC 0000400 /* header crc error */ #define HPER1_HCE 0000200 /* header compare error */ #define HPER1_ECH 0000100 /* ecc hard error */ #define HPER1_WCF 0000040 /* write clock fail */ #define HPER1_FER 0000020 /* format error */ #define HPER1_PAR 0000010 /* parity error */ #define HPER1_RMR 0000004 /* register modification refused */ #define HPER1_ILR 0000002 /* illegal register */ #define HPER1_ILF 0000001 /* illegal function */ #define HPER1_BITS \ "\10\20DCK\17UNS\16OPI\15DTE\14WLE\13IAE\12AOE\11HCRC\10HCE\ \7ECH\6WCF\5FER\4PAR\3RMR\2ILR\1ILF" #define HPER1_HARD \ (HPER1_WLE|HPER1_IAE|HPER1_AOE|\ HPER1_FER|HPER1_RMR|HPER1_ILR|HPER1_ILF) /* hper2 */ #define HPER2_BSE 0100000 /* bad sector error */ #define HPER2_SKI 0040000 /* seek incomplete */ #define HPER2_OPE 0020000 /* operator plug error */ #define HPER2_IVC 0010000 /* invalid command */ #define HPER2_LSC 0004000 /* loss of system clock */ #define HPER2_LBC 0002000 /* loss of bit check */ #define HPER2_DVC 0000200 /* device check */ #define HPER2_SSE 0000040 /* skip sector error (rm80) */ #define HPER2_DPE 0000010 /* data parity error */ #define HPER2_BITS \ "\10\20BSE\17SKI\16OPE\15IVC\14LSC\13LBC\10DVC\5SSE\4DPE" #define HPER2_HARD (HPER2_OPE) /* hpof */ #define HPOF_CMO 0100000 /* command modifier */ #define HPOF_MTD 0040000 /* move track descriptor */ #define HPOF_FMT22 0010000 /* 16 bit format */ #define HPOF_ECI 0004000 /* ecc inhibit */ #define HPOF_HCI 0002000 /* header compare inhibit */ #define HPOF_SSEI 0001000 /* skip sector inhibit */ #define HPOF_P400 020 /* +400 uinches */ #define HPOF_M400 0220 /* -400 uinches */ #define HPOF_P800 040 /* +800 uinches */ #define HPOF_M800 0240 /* -800 uinches */ #define HPOF_P1200 060 /* +1200 uinches */ #define HPOF_M1200 0260 /* -1200 uinches */ ((@iIk$&i>36i /* clock.h 4.5 81/02/23 */ /* * VAX clock registers */ #define ICCS_RUN 0x00000001 #define ICCS_TRANS 0x00000010 #define ICCS_SS 0x00000020 #define ICCS_IE 0x00000040 #define ICCS_INT 0x00000080 #define ICCS_ERR 0x80000000 #define SECDAY ((unsigned)(24*60*60)) /* seconds per day */ #define SECYR ((unsigned)(365*SECDAY)) /* per common year */ /* * TODRZERO is the what the TODR should contain when the ``year'' begins. * The TODR should always contain a number between 0 and SECYR+SECDAY. */ #define TODRZERO ((unsigned)(1<<28)) #define YRREF 1970 #define LEAPYEAR(year) ((year)%4==0) /* good till time becomes negative */ /* * Start a 60 HZ clock. */ #define clkstart() {\ mtpr(NICR, -16667); /* 16.667 milli-seconds */\ mtpr(ICCS, ICCS_RUN+ICCS_IE+ICCS_TRANS+ICCS_INT+ICCS_ERR);\ } #define clkreld() mtpr(ICCS, ICCS_RUN+ICCS_IE+ICCS_INT+ICCS_ERR) #define clkwrap() (((unsigned)mfpr(TODR) - TODRZERO)/100 > SECYR+SECDAY) /* * Software clock is software interrupt level 8 */ #define setsoftclock() mtpr(SIRR, 0x8) @iJk0+$` 4Q]@i*6i /* nexus.h 4.10 81/04/03 */ /* * Information about nexus's. * * Each machine has an address of backplane slots (nexi). * Each nexus is some type of adapter, whose code is the low * byte of the first word of the adapter address space. * At boot time the system looks through the array of available * slots and finds the interconnects for the machine. */ #if VAX780 #define NNEX780 16 #define NEX780 ((struct nexus *)0x20000000) #endif #if VAX750 #define NNEX750 16 #define NEX750 ((struct nexus *)0xf20000) #endif #if VAX7ZZ #define NNEX7ZZ 16 #define NEX7ZZ ((struct nexus *)0xf20000) #endif #define NEXSIZE 0x2000 #define MAXNNEXUS 16 #ifndef LOCORE struct nexus { union nexcsr { long nex_csr; u_char nex_type; } nexcsr; long nex_pad[NEXSIZE / sizeof (long) - 1]; }; #ifdef KERNEL struct nexus nexus[MAXNNEXUS]; #endif #endif /* * Bits in high word of nexus's. */ #define SBI_PARFLT (1<<31) /* sbi parity fault */ #define SBI_WSQFLT (1<<30) /* write sequence fault */ #define SBI_URDFLT (1<<29) /* unexpected read data fault */ #define SBI_ISQFLT (1<<28) /* interlock sequence fault */ #define SBI_MXTFLT (1<<27) /* multiple transmitter fault */ #define SBI_XMTFLT (1<<26) /* transmit fault */ #define NEX_CFGFLT (0xfc000000) #ifndef LOCORE #if VAX780 #define NEXFLT_BITS \ "\20\40PARFLT\37WSQFLT\36URDFLT\35ISQFLT\34MXTFLT\33XMTFLT" #endif #endif #define NEX_APD (1<<23) /* adaptor power down */ #define NEX_APU (1<<22) /* adaptor power up */ #define MBA_OT (1<<21) /* overtemperature */ #define UBA_UBINIT (1<<18) /* unibus init */ #define UBA_UBPDN (1<<17) /* unibus power down */ #define UBA_UBIC (1<<16) /* unibus initialization complete */ /* * Types for nex_type. */ #define NEX_ANY 0 /* pseudo for handling 11/750 */ #define NEX_MEM4 0x08 /* 4K chips, non-interleaved mem */ #define NEX_MEM4I 0x09 /* 4K chips, interleaved mem */ #define NEX_MEM16 0x10 /* 16K chips, non-interleaved mem */ #define NEX_MEM16I 0x11 /* 16K chips, interleaved mem */ #define NEX_MBA 0x20 /* Massbus adaptor */ #define NEX_UBA0 0x28 /* Unibus adaptor */ #define NEX_UBA1 0x29 /* 4 flavours for 4 addr spaces */ #define NEX_UBA2 0x2a #define NEX_UBA3 0x2b #define NEX_DR32 0x30 /* DR32 user i'face to SBI */ #define NEX_MPM0 0x40 /* Multi-port mem */ #define NEX_MPM1 0x41 /* Who knows why 4 different ones ? */ #define NEX_MPM2 0x42 #define NEX_MPM3 0x43 @iKkM$s}w@iii /* param.h 4.12 81/06/11 */ /* * Tunable variables which do not usually vary per system. * * The sizes of most system tables are configured * into each system description. The file system buffer * cache size is assigned based on available memory. * The tables whose sizes don't vary often are given here. */ #define NMOUNT 15 /* number of mountable file systems */ #define MSWAPX 15 /* pseudo mount table index for swapdev */ #define MAXUPRC 25 /* max processes per user */ #define SSIZE 4 /* initial stack size (*512 bytes) */ #define SINCR 4 /* increment of stack (*512 bytes) */ #define NOFILE 20 /* max open files per process */ /* NOFILE MUST NOT BE >= 31; SEE pte.h */ #define CANBSIZ 256 /* max size of typewriter line */ #define NCARGS 10240 /* # characters in exec arglist */ /* * priorities * probably should not be * altered too much */ #define PSWP 0 #define PINOD 10 #define PRIBIO 20 #define PRIUBA 24 #define PZERO 25 #define PPIPE 26 #define PWAIT 30 #define PSLEP 40 #define PUSER 50 #define NZERO 20 /* * signals * dont change */ #ifndef NSIG #include #endif /* * Return values from tsleep(). */ #define TS_OK 0 /* normal wakeup */ #define TS_TIME 1 /* timed-out wakeup */ #define TS_SIG 2 /* asynchronous signal wakeup */ /* * fundamental constants of the implementation-- * cannot be changed easily. */ #define NBBY 8 /* number of bits in a byte */ #define NBPW sizeof(int) /* number of bytes in an integer */ #define NBPG 512 #define PGOFSET (NBPG-1) /* byte offset into page */ #define PGSHIFT 9 /* LOG2(NBPG) */ #define UPAGES 8 /* pages of u-area */ #define NULL 0 #define CMASK 0 /* default mask for file creation */ #define NODEV (dev_t)(-1) #define ROOTINO ((ino_t)2) /* i number of all roots */ #define SUPERB ((daddr_t)1) /* block number of the super block */ #define DIRSIZ 14 /* max characters per directory */ /* * Clustering of hardware pages on machines with ridiculously small * page sizes is done here. The paging subsystem deals with units of * C((LSIZE pte's describing NBPG (from vm.h) pages each... BSIZE must * be CLSIZE*NBPG in the current implementation, that is the paging subsystem * deals with the same size blocks that the file system uses. * * NOTE: SSIZE, SINCR and UPAGES must be multiples of CLSIZE */ #define CLSIZE 2 #define CLOFSET (CLSIZE*NBPG-1) /* for clusters, like PGOFSET */ /* give the base virtual address (first of CLSIZE) */ #define clbase(i) ((i) &~ (CLSIZE-1)) /* round a number of clicks up to a whole cluster */ #define clrnd(i) (((i) + (CLSIZE-1)) &~ (CLSIZE-1)) #if CLSIZE==1 #define BSIZE 512 /* size of secondary block (bytes) */ #define INOPB 8 /* 8 inodes per block */ #define BMASK 0777 /* BSIZE-1 */ #define BSHIFT 9 /* LOG2(BSIZE) */ #define NMASK 0177 /* NINDIR-1 */ #define NSHIFT 7 /* LOG2(NINDIR) */ #define NICINOD 100 /* number of superblock inodes */ #define NICFREE 50 /* number of superblock free blocks */ #endif #if CLSIZE==2 #define BSIZE 1024 #define INOPB 16 #define BMASK 01777 #define BSHIFT 10 #define NMASK 0377 #define NSHIFT 8 #define NICINOD 100 #define NICFREE 178 #endif #if CLSIZE==4 #define BSIZE 2048 #define INOPB 32 #define BMASK 03777 #define BSHIFT 11 #define NMASK 0777 #define NSHIFT 9 #define NICINOD 100 #define NICFREE 434 #endif #ifndef INTRLVE /* macros replacing interleaving functions */ #define dkblock(bp) ((bp)->b_blkno) #define dkunit(bp) (minor((bp)->b_dev) >> 3) #endif /* inumber to disk address and inumber to disk offset */ #define itod(x) ((daddr_t)((((unsigned)(x)+2*INOPB-1)/INOPB))) #define itoo(x) ((int)(((x)+2*INOPB-1)%INOPB)) /* file system blocks to disk blocks and back */ #define fsbtodb(b) ((b)*CLSIZE) #define dbtofsb(b) ((b)/CLSIZE) #define NINDIR (BSIZE/sizeof(daddr_t)) #define CBSIZE 28 /* number of chars in a clist block */ #define CROUND 0x1F /* clist rounding; sizeof(int *) + CBSIZE -1*/ /* * Macros for fast min/max */ #define MIN(a,b) (((a)<(b))?(a):(b)) #define MAX(a,b) (((a)>(b))?(a):(b)) /* * Some macros for units conversion */ /* Core clicks (512 bytes) to segments and vice versa */ #define ctos(x) (x) #define stoc(x) (x) /* Core clicks (512 bytes) to disk blocks */ #define ctod(x) (x) /* clicks to bytes */ #define ctob(x) ((x)<<9) /* bytes to clicks */ #define btoc(x) ((((unsigned)(x)+511)>>9)) #ifndef KERNEL #include #else #include "../h/types.h" #endif /* * Machine-dependent bits and macros */ #define UMODE PSL_CURMOD /* usermode bits */ #define USERMODE(ps) (((ps) & UMODE) == UMODE) #define BASEPRI(ps) (((ps) & PSL_IPL) != 0) /* * Provide about n microseconds of delay */ #define DELAY(n) { register int N = (n); while (--N > 0); } @iLk>獥$z&i<36i /* pcb.m 4.3 81/02/23 */ /* * VAX process control block */ .set PCB_KSP, 0 .set PCB_ESP, 4 .set PCB_SSP, 8 .set PCB_USP, 12 .set PCB_R0, 16 .set PCB_R1, 20 .set PCB_R2, 24 .set PCB_R3, 28 .set PCB_R4, 32 .set PCB_R5, 36 .set PCB_R6, 40 .set PCB_R7, 44 .set PCB_R8, 48 .set PCB_R9, 52 .set PCB_R10, 56 .set PCB_R11, 60 .set PCB_R12, 64 .set PCB_R13, 68 .set PCB_PC, 72 .set PCB_PSL, 76 .set PCB_P0BR, 80 .set PCB_P0LR, 84 .set PCB_P1BR, 88 .set PCB_P1LR, 92 /* * Software pcb extension */ .set PCB_SZPT, 96 /* number of user page table pages */ .set PCB_CMAP2, 100 /* saved cmap2 across cswitch (ick) */ .set PCB_SSWAP, 104 /* flag for non-local goto */ .set PCB_SIGC, 108 /* signal trampoline code */ @iMk.^$)w&iJ6i /* psl.h 4.4 81/04/22 */ /* * VAX program status longword */ #define PSL_C 0x00000001 /* carry bit */ #define PSL_V 0x00000002 /* overflow bit */ #define PSL_Z 0x00000004 /* zero bit */ #define PSL_N 0x00000008 /* negative bit */ #define PSL_ALLCC 0x0000000f /* all cc bits - unlikely */ #define PSL_T 0x00000010 /* trace enable bit */ #define PSL_IV 0x00000020 /* integer overflow enable bit */ #define PSL_FU 0x00000040 /* floating point underflow enable */ #define PSL_DV 0x00000080 /* decimal overflow enable bit */ #define PSL_IPL 0x001f0000 /* interrupt priority level */ #define PSL_PRVMOD 0x00c00000 /* previous mode (all on is user) */ #define PSL_CURMOD 0x03000000 /* current mode (all on is user) */ #define PSL_IS 0x04000000 /* interrupt stack */ #define PSL_FPD 0x08000000 /* first part done */ #define PSL_TP 0x40000000 /* trace pending */ #define PSL_CM 0x80000000 /* compatibility mode */ #define PSL_MBZ 0x3020ff00 /* must be zero bits */ #define PSL_USERSET (PSL_PRVMOD|PSL_CURMOD) #define PSL_USERCLR (PSL_IS|PSL_IPL|PSL_MBZ) @iNk$qt]@ijIf6i /* pte.h 4.9 81/05/14 */ /* * VAX page table entry * * There are two major kinds of pte's: those which have ever existed (and are * thus either now in core or on the swap device), and those which have * never existed, but which will be filled on demand at first reference. * There is a structure describing each. There is also an ancillary * structure used in page clustering. */ #ifndef LOCORE struct pte { unsigned int pg_pfnum:21, /* core page frame number or 0 */ :2, pg_vreadm:1, /* modified since vread (or with _m) */ pg_swapm:1, /* have to write back to swap */ pg_fod:1, /* is fill on demand (=0) */ pg_m:1, /* hardware maintained modified bit */ pg_prot:4, /* access control */ pg_v:1; /* valid bit */ }; struct hpte { unsigned int pg_pfnum:21, :2, pg_high:9; /* special for clustering */ }; struct fpte { unsigned int pg_blkno:20, /* file system block number */ pg_fileno:5, /* file mapped from or TEXT or ZERO */ pg_fod:1, /* is fill on demand (=1) */ :1, pg_pro((t:4, pg_v:1; }; #endif #define PG_V 0x80000000 #define PG_PROT 0x78000000 #define PG_M 0x04000000 #define PG_FOD 0x02000000 #define PG_VREADM 0x00800000 #define PG_PFNUM 0x001fffff #define PG_FZERO (NOFILE) #define PG_FTEXT (NOFILE+1) #define PG_FMAX (PG_FTEXT) #define PG_NOACC 0 #define PG_KW 0x10000000 #define PG_KR 0x18000000 #define PG_UW 0x20000000 #define PG_URKW 0x70000000 #define PG_URKR 0x78000000 /* * Pte related macros */ #define dirty(pte) ((pte)->pg_fod == 0 && (pte)->pg_pfnum && \ ((pte)->pg_m || (pte)->pg_swapm)) #ifndef LOCORE #ifdef KERNEL struct pte *vtopte(); /* utilities defined in locore.s */ extern struct pte Sysmap[]; extern struct pte Usrptmap[]; extern struct pte usrpt[]; extern struct pte Swapmap[]; extern struct pte Forkmap[]; extern struct pte Xswapmap[]; extern struct pte Xswap2map[]; extern struct pte Pushmap[]; extern struct pte Vfmap[]; extern struct pte mmap[]; extern struct pte msgbufmap[]; extern struct pte camap[]; extern struct pte Nexmap[][16]; #endif #endif @iOk<獥$n&i;36i /* cons.h 4.6 81/02/23 */ /* * VAX console interface registers */ #define RXCS_IE 0x00000040 /* receiver interrupt enable */ #define RXCS_DONE 0x00000080 /* receiver done */ #define RXDB_DATA 0x000000ff /* received character */ #define RXDB_ID 0x00000f00 /* channel id */ #define RXDB_ERR 0x80000000 /* receiver error */ #define TXCS_IE 0x00000040 /* transmitter interrupt enable */ #define TXCS_RDY 0x00000080 /* transmitter ready for next char */ #define TXDB_DATA 0x000000ff /* transmitter byte */ #define TXDB_ID 0x00000f00 /* channel id */ #define TXDB_DONE 0xf01 /* software done */ #define TXDB_BOOT 0xf02 /* reboot */ #define TXDB_CWSI 0xf03 /* clear warm start inhibit */ #define TXDB_CCSI 0xf04 /* clear cold-start inhibit */ @iPkbK*$ehk&iQ6i /* tmreg.h 4.6 81/11/11 */ /* * TM11 controller registers */ struct tmdevice { u_short tmer; /* error register, per drive */ u_short tmcs; /* control-status register */ short tmbc; /* byte/frame count */ u_short tmba; /* address */ short tmdb; /* data buffer */ short tmrd; /* read lines */ short tmmr; /* maintenance register */ }; #define b_repcnt b_bcount #define b_command b_resid /* bits in tmcs */ #define TM_GO 0000001 #define TM_OFFL 0000000 /* offline */ #define TM_RCOM 0000002 /* read */ #define TM_WCOM 0000004 /* write */ #define TM_WEOF 0000006 /* write-eof */ #define TM_SFORW 0000010 /* space forward */ #define TM_SREV 0000012 /* space backwards */ #define TM_WIRG 0000014 /* write with xtra interrecord gap */ #define TM_REW 0000016 /* rewind */ #define TM_SENSE TM_IE /* sense (internal to driver) */ #define tmreverseop(cmd) ((cmd)==TM_SREV || (cmd)==TM_REW) /* TM_SNS is a pseudo-op used to get tape status */ #define TM_IE 0000100 /* interrupt enable */ #define TM_CUR 0000200 /* control unit is ready */ #define TM_DCLR 0010000 /* drive clear */ #define TM_D800 0060000 /* select 800 bpi density */ #define TM_ERR 0100000 /* drive error summary */ /* bits in tmer */ #define TMER_ILC 0100000 /* illegal command */ #define TMER_EOF 0040000 /* end of file */ #define TMER_CRE 0020000 /* cyclic redundancy error */ #define TMER_PAE 0010000 /* parity error */ #define TMER_BGL 0004000 /* bus grant late */ #define TMER_EOT 0002000 /* at end of tape */ #define TMER_RLE 0001000 /* record length error */ #define TMER_BTE 0000400 /* bad tape error */ #define TMER_NXM 0000200 /* non-existant memory */ #define TMER_SELR 0000100 /* tape unit properly selected */ #define TMER_BOT 0000040 /* at beginning of tape */ #define TMER_CH7 0000020 /* 7 channel tape */ #define TMER_SDWN 0000010 /* gap settling down */ #define TMER_WRL 0000004 /* tape unit write protected */ #define TMER_RWS 0000002 /* tape unit rewinding */ #define TMER_TUR 0000001 /* tape unit ready */ #define TMER_BITS \ "\10\20ILC\17EOF\16CRE\15PAE\14BGL\13EOT\12RLE\11BTE\10NXM\ \7SELR\6BOT\5CH7\4SDWN\3WRL\2RWS\1TUR" #define TMER_HARD (TMER_ILC|TMER_EOT) #define TMER_SOFT (TMER_CRE|TMER_PAE|TMER_BGL|TMER_RLE|TMER_BTE|TMER_NXM) @iQkA&&iTIf6i if [ ! -r version ]; then echo 0 > version; fi touch version awk ' { version = $1 + 1; }\ END { printf "char version[] = \"Berkeley VAX/UNIX Version 4.%d ", version > "vers.c";\ printf "%d\n", version > "version"; }' < version echo `date`'\n";' >> vers.c ((@iRk^$\&iJ6i /* callout.h 4.6 81/04/18 */ /* * The callout structure is for * a routine arranging * to be called by the clock interrupt * (clock.c) with a specified argument, * in a specified amount of time. * Used, for example, to time tab * delays on typewriters. */ struct callout { int c_time; /* incremental time */ caddr_t c_arg; /* argument to routine */ int (*c_func)(); /* routine */ struct callout *c_next; }; #ifdef KERNEL struct callout *callfree, *callout, calltodo; int ncallout; #endif @iSk Tz =&ir{r{ FZC[[Z[[Ԫ Џ2<ЫDPP9k  @iTk\ط:@ z ] /iii Џ^.PԀP^\1^1/ /ݏr ^/s*B"-rBCP\BPUB.PPR Pr.*߭,߭PAPw...)[,P ݏ=<=PPxPPPAp9Q P].)A.C9 P-A.Q)9K 9l P$$.)8 PNA8Y P*.(@\=8 P1a @1<@PP~^,P<~@PP~n,PPxQQQ2cPQPJ@<:>~1Μ^(d5͜>[[#Kw͜ѬR2PO͜P1+%q͜P͜P(d`y5==ЬPP͜*͜Ѭ2PЬPP͜ '"5WP5P[1Μ^) 1[x [P [)ݏ(}< P[#<<~W*$=[ C)9)<)+*$ 'P (W Pp<P **'*C$͜P(͜Pݬݏݬ(P(x PP@|  o(Ь[ЬZЬ YY Ь[2ZZ[[?ŏ[Pzݏŏ[P@ݬŏ[Px ~a; ݏݬK; Pݬ&)+# ŏ[P[1\ Z[ŏ P3ݬ ݬŏP@ףŏկPŏ¯PŏZPŏ隷QZ[[1ex ~`:ݏŏZP@P>: Pݬ.(" ݬ ݬŏZP@ ŏZPŏZPЬ^<PӏP9ЬԽ׭ 8^Ь[k66^<5PP~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@xT~N2@DXXӏD[2ЫXZl[ZPZPЬ[[Ь[xTPxPP2P`PˏTQxQQQPWZѬѬ0Ыlԧݬ[ˏYYX2VV.ΫlPxPPȬPP0ˏYЧˏ,XXPPS$SS$$$$$$$$$$$gˏ~w 2@DVVӏDPN Pˏ~e4 Z Z1Z r ЫlP Ь[xTPxPPP aQQ`ZЫXP@U իXѫX OЫXP2@-PŏBPX Z ^Ь[xTPxPPP QQ`Zԭ[PЫdTǏBPPPPPPPPPQQQPQQjZjZ2PxPP2QPQQxlPPPPxPʏPɏPѬjZ2 PPݭ[2jPPX2 ~C2~2~2~2~i jZ5ѭ H P֭1խ , ЫlPЬ[k Ь[[1ЫXZԫl[ZPZPЬ[[^Ь[xTPxPPﹸP QQ`WЫTYXWxYZ[PΫlPPѬZP)ѬZPѬ  ZPPPɬZPPP<ݭ[?1yWPxPPPPPYP)խ ,XX X֭鑽 ֭jЭP֭`X1!XPX11Pd1Pc1 1PlXXPPo11Pu1Ps1|1Px11 ^Ѭ լ-Gάޭ[ݬݬ@ ݬݬPP֘{~ ޭP[PЬ[20uY"PY["PZ"[~#[  Z" P!~P[[  [[j[P Ь[*P#DP@ZP +PЬ[ 4PZZPP P  Z[[ڬ۬P(  ^Ь[ԭZk96 PQPQ0QZ[[kPP P P+P-k0ZέPЭPЬZЬY[ [[ ЬZЬY[ Y[[ ЬPЬRRQ{RPRPPPRRPЬPЬRRQ{RPPR PRPP:PЬSRbcPRbr  &0^n1/dev/rmt8X/ tapeTape? Disk? Last chance before scribbling on %s. diskMissing volume record Tape is not volume %d Missing header block End of tape Unknown header type Resynced at inode %u %u: ilist too small Missing address (header) block Tape read error: inode %u Mount volume %d Cannot open tape! Not a dump tape.Try again Wrong tape. Try again disk write error %D read error %D Out of space Checksum error %o @(#)restor.c 4.3 (Berkeley) 6/3/81null path %s not found bn negative bn ovf %D bn void %D bn void %D not a directory zero length directory Seek not from beginning of file No more file slotsBad device Unknown device Bad unit specifier Missing offset specification Can't write files yet.. Sorry Exit called%s Trap %o 2|2%$|38|3F*D(|3 3! 3#0"~#3vhpuphkrahttmtsmt`       @ ` `&vd62M2R%s1 JTJ2" 73 `73/3/332 @v3unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry Anot a tape mt hard error: er=%b mt error: er=%b mt: unrecovered error mt: recovered by retry rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry Pte error: er=%bILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUP((ESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOTts: unrecovered error ts: recovered by retry DR2 `78 @79up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPEh >Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error 0123456789abcdef@iUka9QHNG= /iii Џ^.PԀP^E0^.)_q,RqE.)߭j,߭P_9߭{PH9F9P29Ԭ)91ԭԭ:ѭ0ѭ9VE>.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xPPwIP QQ`Zԭ[PЫdTǏBPPPPPPPPPQQQPQQjZjZ2PxPP2QPQQxlPPPPxPʏPɏPѬjZ2 PPݭ[2jPPXj2 ~+2~2~2~2~i jZ5ѭ qH P֭1խ l, ЫlP((Ь[k Ь[[1ЫXZԫl[ZPZPЬ[[^Ь[xTPxPPGP QQ`WЫTYXWxYZ[PΫlPPѬZP)ѬZPѬ  ZPPPɬZPPP<ݭ[8P.P@B!?P@㳏1JuF rFOE'POOPOPJOBJ?J9J"JsOPPPJPPPJJIMݏ[.ЫXlݏ[Ь[ݏ[Ь[YZdXXPѬ Ѭ lxI)[)PYldIYYIYPPOIѬ ѬɏPP%IIvdXXiPY Y[q<IPPP=P<PPZ?1yWPxPPPPPYP)խ ,XX X֭鑽 ֭jЭP֭`X1!XPX11Pd1Pc1 1PlXXPPo11Pu1Ps1|1Px11 ^Ѭ լ-Gάޭ[ݬݬ;@ ݬݬNPP֘{~ ޭP[PЬ[20uY"PY["PZ"[~#[  Z" P!~P[[  [[j[P Ь[*P#DP@ZP +PЬ[ 4PZZPP P  Z[[ڬ۬P(  ^Ь[ԭZk96 PQPQ0QZ[[kPP P P+P-k0ZέPЭPЬZЬY[ [[ ЬZЬY[ Y[[ Ь[ZYk94 ZPQPQ0QZY[[kPP P P+P-k0YZPZPЬPЬRRQ{RPRPPPRRPЬPЬRRQ{RPPR PRPP9\PЬSRbcPRb  &0^nL0file sys size: file system: %s: cannot open isize = %D d--777 0 0 $ m/n = %d %d %ld/%ld: bad ratio -bcd-u-g%c/%s: bad octal mode digit %s: cannot open ...%c/%s: bad mode %s: bad number EOF read error: %ld write error: %D out of free space indirect block full too many bad blocks ilist too small bad mode %o @(#)mkfs.c 4.2 (Berkeley) 4/20/81null path %s not found bn negative bn ovf %D bn void %D bn void %D not a directory zero length directory Seek not from beginning of file No more file slotsBad device Unknown device Bad unit specifier Missing offset specification Can't write files yet.. Sorry Exit called%s Trap %o 0232$8$6292)'<2?2R  @ B2"|!"E2hpuphkrahttmtsmt`       @ ` `&vd62M2R%s1 JTJ2" 72 `72/2/222 @v3unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry Anot a tape mt hard error: er=%b mt error: er=%b mt: unrecovered error mt: recovered by retry rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry Pte error: er=%bILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOTts: unrecovered error ts: recovered by retry DR2 `7$8 @748up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPEh >Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error 0123456789abcdef@iVk} I/iޡޡ lp Ь[[1ЫXZԫl[ZPZPЬ[[^Ь[xTPxPPP QQ`WЫTYXWxYZ[yPΫlPPѬZP)ѬZPѬ  ZPPPɬZPPP<ݭ[$f@id@id@i PX^>PPPAPgP11xPP`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n 1mЫZ3[1xݏPZZ  YYX ZYYXZYZ~`PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PPl[ [[[ Ь[Z = 8[ePZ~9PZ ݫS ԫ kZP{`P^߭ݬDPPP0 ݬݏ tݬݬݏtݬ6 PЬPЬRRQ{RPRPPPRRP.TPqt~*PY][bk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [PPYPƏPxPbPZxPZPPZx~@PZZZPZPxPZPPjjP{1xYP[PhZaY\kMFk[P Ь[[ZZZ-jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP @j8~\S^\_PCЬPЬPЬRRQ{RPPR PRPPP P/tmp/sXXXXXcannot create temp file cannot open %s %s not in a.out format %s already stripped %s cannot recreate %s unexpected eof %s unexpected write eof @(#)strip.c 4.1 (Berkeley) 10/1/80/LLh@iZkF7/iVޡVޡ h^Ь[xTPxPPP`PˏTQxQQQPYԭЭPˏQ2@PPQ֭ЭP@xT~2@DXXӏD[2ЫXZl[ZPZPЬ[[Ь[xTPxPPP`PˏTQxQQQPWZѬѬ0Ыlԧݬ[ˏYYX2VV.ΫlPxPPȬPP0ˏYЧˏ,XXPPS$SS$$$$$$$$$$$gˏ~zS2@DVVӏDPx*Pˏ~MZ Z1Z ZЫlPAnot a tape mt hard error: er=%b mt error: er=%b mt: unrecovered error mt: recovered by retry  H\dk x  "       (08@IQU\eqz~_devsw_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_mttypes_mtopenL23__stop_mbainit_mtstrategy_mtcloseL43L47_mbastart_printf@i[kͣ3/i9ޡ9ޡ ( ^Ь[xTPxPPP`xTPxPPP`PˏTQxQQQPZЫhP PˏhlPP PЭ ɏ֭ЭPΫlPЭQPЭPЭ Ѭ19xP5P`[xPPPP"PxPP *      (08@J NW[_devsw_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_mbastartL22_mbainitL31((@i]k9F?1i q/iii x Ь[[2PxPP|P`Ь[[2PxPP|P`Ь[[2PxPPP`Ь[[2PxPPP`t ttthpuphkrahttmtsmt2Nj     $ ( ,04 8 <@D H L PT X \ `d h l pt x |! x $(26<?CXMQtZ^jr~"_devsw_b_blknos_iob_devreadL17_devwriteL22_devopenL27_devcloseL32_nullsysL37_hpstrategy_hpopen_upstrategy_upopen_rkstrategy_rkopen_udstrategy_udopen_htstrategy_htopen_htclose_tmstrategy_tmopen_tmclose_tsstrategy_tsopen_tsclose_mtstrategy_mtopen_mtclose@i^kx5K+/iޡޡ tЬ[xTPxPPP QQ`ZjPЫTQA`. PЫTQA` PЫTQA`PЫTQA`P P@YիXѫX ЫXP@ XЫXP2@P2QQPPX ^Ь[xTPxPP)P <QQ`YUPЫTQA`P P@XЫTЫdЭP2QQP2QQPRQRRPЭP2hQQP2hQQPRQRRP@  ii< Pʏ?PP 0[zPYZxPPPjzΫlPPPzѬ9z1zWWi@ 8<"~?< ~<~ݭݭݭ Pݭ[ЫlPDR2 `7` @7pup bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPE -I\k~  pw    lx  (08@H T@]`epms{_devsw_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_ubastd_up_gottype_up_type_up_off_fj_off_upst_upopenL28__stop_upstrategyL40_ubasetup_printf_ubafree@i_k <:>~1Μ^(d5͜>[[#Kw͜ѬR2PO͜P1+q͜P͜P(d`y5==ЬPP͜*͜Ѭ2PЬPP͜ '"5WP5P[1Μ^) 1[x [P [)ݏ(}< P[#<<~W*=[ C)9)<)+* P (W Pp<P **'*C͜P(͜Pݬݏݬ(P(x PP@|  o(Ь[ЬZЬ YY Ь[2ZZ[[?ŏ[Pzݏŏ[P@ݬŏ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ȏֵȏϵ2 ﹵ﱵﭵ掠冀ЭPɏQ PPQ ЭPPЭP ^Ь[[PZЫd ˏTPPЫlPQxQQQPѬ!P"PPPZ ݭ[bPݭ[RЫlP ^Ь[ԭZk96 PQPQ0QZ[[kPP P P+P-k0ZέPЭPЬZЬY[ [[ ЬZЬY[ Y[[ ЬPЬRRQ{RPRPPPRRPЬPЬRRQ{RPPR PRPP:PЬSRbcPRbr  &0^n1/dev/rmt8X/ tapeTape? Disk? Last chance before scribbling on %s. diskMissing volume record Tape is not volume %d Missing header block End of tape Unknown header type Resynced at inode %u %u: ilist too small Missing address (header) block Tape read error: inode %u Mount volume %d Cannot open tape! Not a dump tape.Try again Wrong tape. Try again disk write error %D read error %D Out of space Checksum error %o @(#)restor.c 4.3 (Berkeley) 6/3/81null path %s not found bn negative bn ovf %D bn void %D bn void %D not a directory zero length directory Seek not from beginning of file No more file slotsBad device Unknown device Bad unit specifier Missing offset specification Can't write files yet.. Sorry Exit called%s Trap %o 2T|2lZ3B|3%@%p%3#D#| 3(&'38*h)&*3z-x+|hphtuptmhktsmtra&vd62M2R%s1 JTJ2" 7D3 `7T3/43/d3432 @vt3unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry DR2 `75 @75up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPE0123456789abcdef`       @ ` ` rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry Pte error: er=%bILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOTts: unrecovered error ts: recovered by retry Anot a tape mt hard error: er=%b mt error: er=%b mt: unrecovered error mt: recovered by retry h >Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error @ibk48=&ix{x{ ((*QЏ RȏPR`  @icke&aM (< *2i H@P Axnd^cZˏ V[ʏ kPP\P^f խ1 Wmx0PXPxWQQPYiUiP1P~(P PPXh,  iii iPP WW49ڮn^[k(ka ^Pnի(ݫd ^PI Ь[ЬZjk ѫЪ $$7P2{~iP< 2>~YY[2*ЫZ<PʏPP ЪP2QPQkY [[YP~[kbkP@eիkPP(P/?kPѫ@9cP. ѫ_ ѫ_Џ_kPЫ@kǏPQP@c f f )k 3l :m Il Sl ]l il zl v [ y X 0l ?l E| Sl dl j| xl k l l l  . C/ Rl _l jl ol l k l l l l #,39BHQZbhow!,H3(9x?F~OU`gktzttt(!+4=EOXajt~,  !( /4;CH$PU\_i@otD~NXb,~ N _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_file_fileNFILE_nfile_inode_inodeNINODE_ninode_rootdir_mpxip_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_tthiwat_ttlowat_vforkL161_fork1_vreadL167_vrdwr_vwriteL173_resubaL178_suser_u_ubareset_futzL186_segallocL191_segfreeL196_segsyncL201_both_vadviseL207udiv_vtimesL224_Copyout_vmsaddL235_vhangupL241_forceclose_gsignalL250_vlimitL261@idk}ͣ*/i 4P (Џ^"PԀP^PЬSRbcPRb &0^n  ' .  . G 8',7<B H4OS@[_end_edata_main__rtt_configure_cpu_openfirstHIGHentrystartaedataclr_badloc@i ekd4>&i}{}{ :Z;2$P[Lk\k`  Td((@i"fk! + > ? H /iii Џ^6!PԀP^u!<^U!߭߭PP ݭݭzP} Ь[ԫ`PPPPXPd2lp[h[p[ZPPQxQQQPQxQPPZj Ъ Z~[~ ^Ь[kj &X[k/[ZjZj/jjݬ[gP8ݬP0jZ[[> Pݬ<~kЭP^Ь[Ь[Yլ  1eѬ ЬZJЭPԭ xѬ ­׭խխ ݬ1jí P@ݬ1Q֭ѭЭP@8CxPXPdx P@(h2l[x P@(ЭPЭ@8x P@(έPxPPPZJ1|ݬ41 ^Ь[լ1[Y<PʏPP@ 10 12ԭd֭ѭ@>ЭP֭P[pPPXPdp[h2l[-p[ZԭZ~ݬPnP ""PPAPgP11xPCP`!PxPCP`P֭vCCC|CH8_C`CQCԭAC2CԭЭԭѭ1Oԭ/xPCP`kPxPBP`P֭ѭխ Џ[[^Ь[ЫTZxZPxPPBP`PZQxQQQPxT~Jm>ЭPˏXW2GPPXWGWJ-J&P P@YիXѫX ЫXP@ ?ЫXP2@P2QQPPX^Ь[ЫTЫdxPxPPAP`PQxQQQPPЭQA`P P@ ЭP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!~P[[  [[j[P Ь[*P#DP@ZP +PЬ[ 4PZZPP P  Z[[ڬ۬P(  ^Ь[ԭZk96 PQPQ0QZ[[kPP P P+P-k0ZέPЭPЬZЬY[ [[ ЬPЬRRQ{RPRPPPRRPЬPЬRRQ{RPPR PRPP +PЬSRbcPRb  &0^nFile: null path %s not found bn negative bn ovf %D bn void %D bn void %D not a directory zero length directory Seek not from beginning of file No more file slotsBad device Unknown device Bad unit specifier Missing offset specification Can't write files yet.. Sorry Exit called%s Trap %o `#  c#Tf#0i#l# 4 o#n,\r#u# hpuphkrahttmtsmt`       @ ` `&v((d62M2R%s1 JTJ2" 7$ `7$/#/ $#2 @v0$unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry Anot a tape mt hard error: er=%b mt error: er=%b mt: unrecovered error mt: recovered by retry rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry Pte error: er=%bILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWS@i-fk#  + > ? H /iiiTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOTts: unrecovered error ts: recovered by retry DR2 `7T) @7d)up bad unitup not readyup error: (c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 0 $ m/n = %d %d %ld/%ld: bad ratio -bcd-u-g%c/%s: bad octal mode digit %s: cannot open ...%c/%s: bad mode %s: bad number EOF read error: %ld write error: %D out of free space indirect block full too many bad blocks ilist too small bad mode %o @(#)mkfs.c 4.2 (Berkeley) 4/20/81null path %s not found bn negative bn ovf %D bn void %D bn void %D not a directory zero length directory Seek not from beginning of file No more file slotsBad device Unknown device Bad unit specifier Missing offset specification Can't write files yet.. Sorry Exit called%s Trap %o ,2/2$4$2252)'82;2N < >2"x!"A2hpuphkrahttmtsmt`       @ ` `&vd62M2R%s1 JTJ2" 72 `72/2/222 @v2unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry Anot a tape mt hard error: er=%b mt error: er=%b mt: unrecovered error mt: recovered by retry rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry Pte error: er=%bILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOTts: unrecovered error ts: recovered by retry DR2 `7 8 @708up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE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ЭQxPPPY`YЭPРP`,Yi1T[PHQPA;PA@ˀ+Q@ˀA@PA@@Ь[2 P PZЬP PYɏYYZ9ڮn^cpu type %d not configured mba%d at tr%d %d mba'suba%d at tr%d 5 uba'sdr32mcr%d at tr%d 5 mcr'smpmnexus type %x unsupported (at tr %d) not configured %s%d at %s%d slave %d %s%d at mba%d drive %d uba%s%d at uba%d csr %o zero vector didn't interrupt vec %o, ipl %x %s%d at %s%d slave %d %s%d at uba%d csr %o zero vector didn't interrupt vec %o, ipl %x X (.l Cm Sn Y[ `o ryp \ ( \ r t \ 18p >\ DKp S3 Y`p fmp s\ \ 3 p 3 3 \ V p V p W V   w 3x ?EW SV \d\ jY pwp }Y Y Z Y W $ ,z 3{ E3 M4 T3 ]4 c3 kr|3 ~ p \ p p 4 9] B] J] v  V h    W , \V k   V 't V p p p V V h 3 aV V V h ] ] ]  p + : V r t V  p   p  p  V " h \ V \ \ \ \ _ ` a b d e f g #,39BHQZbhow!,5?GRY^gmt|,%,t1t7t<(CLU`ipz$ !+54 >GPYbju z  8  P"+09rFKT]bjrz_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_swapmap_nswapmap_argmap_kernelmap_nexus_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_nummba_mba_hd_cp_time_dk_busy_dk_time_dk_seek_dk_xfer_dk_wds_dk_mspw_tk_nin_tk_nout_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_numuba_cpu_percpu_nmcr_mcraddr_cold_nexnum_dkn_mbaintv_Xmba0int_Xmba1int_Xmba2int_Xmba3int_ubaintv_Xua0int_Xua1int_Xua2int_Xua3int_uba_hd_configureL163_probenexus_Sysmap_Sysbase_setconf_memenable_printfL179_Nexmap_nxaccess_badaddr_mbaf((ind_setscbnex_UMEMmap_umem_unifind_ubawatch_timeoutL240_mbaconfig_mbsinitL256_mbdinit_fixctlrmaskL275_ubminit_ubdinitL285_calloc_rminit_UNIvec_catcherL344_scbL348@iKlk  /i  D^ ݏr ^ PP PPR Pr p߭f߭ZPSPK Z 0)P ݏ< PPxPPPQ P1   P  K l P$ uo P^VY P* =70* P1 1P[#<3~+ %[  P PP͜P͜PݬݏݬgP`x PP@I  CЬ[ЬZЬ YY Ь[2ZZ[[?ŏ[Pzݏŏ[P@ݬŏ[Px ~ݏݬPݬzŏ[P[1\ Z[YRŏGP3ݬ ݬŏ+P@+ŏPŏPŏZPŏQZ[[1ex ~ݏŏZP@Pݬvmݬ ݬŏZP@`ŏZPŏZPЬ^<PӏPЬԽ׭ 8^Ь[kF<^<+PP~Pݏݭݏ@ݬ<PP~xPPQQP~^<PӏPf F M T c h            )! /5 <FLS \! b io v      &      ) * 6* G S Y ag o v|               % ,3 9 ? D L SZ f k q w       /    3  h n v      'V ]i p   8    !  &  % 29 @ JRZa nx   (6 C J? Y `@ ry !              $ , D K? ` f m8  !     6 / O y            $ *  4  :  @  O  W  ]  e  o v   !        F k      > E  l          *  ) ' B  J  V * o  )       !  d#)15 ?H2NU\@b@h4ow   ( " d P      */4 =EK, T[ e o~x     F    %*/ 49>CHMRW ]b_sccsid_spcl_sblock_fi_ino_maxi_curino_mt_tapename_magtape_mbuf_eflag_volno_tino_dino_taddr_curbno_dumpmap_clrimap_bct_tbf_cache_curcache_mainL37_doitL44_printf_gets_open_getchar_dread_readhdr_exit_checkvol_gethead_ishead_checktype_close_dwrite_readbitsuremudiv_getdino_itrunc_clri_putdino_l3tol_rstrskip_rstrfile_getfile_ltol3L118_readtape_clearbufL141_read_flsht_copyL165L169L176L183_lseek_writeL195L207L215_bfree_tloopL233L243_ballocL256L252_bmapL264L279_checksumL285L290L294L303L308L314L318L322L326L331_doneL339((@iTmk{C~/iFߡFߡ \~ݬ^Ь[ЬZXXXX%1DPba1PO1PD ZY YYYjFjYWWWPxPYPPX XWЊYjЭP֭`~YԭY<TЭP֭`W >?1yWPxPPPPPYP)խ ,XX X֭鑽 ֭jЭP֭`X1!XPX11Pd1Pc1 1PlXXPPo11Pu1Ps1|1Px11 ^Ѭ լ-Gάޭ[ݬݬ@ ݬݬPP֘{~ ޭP[PЬ[20uY"PY["PZ"[~#[  Z"x kP!^P[[  [[j[P Ь[*P#DP@ZP +PЬ[ 4PZZPP P  Z[[0123456789abcdef +xC  2 H V b py    ""*.38<BHQU[ __printfL13_prfL18_putchar_printnL67uremudivL79_mfpr_mtpr_getcharL91_getsL99@iWnkfg/iWW  8d^    P ^PPPݬPPݬ ݬ qke_YSMGA;ݏ/<PPxPPPPE f v    &       + 4 ;B I O[x ~  #D J[n {            C Z u {               / N T z       .  /     $ C J. Y `1 ry      3  9  ?  E  K  Q  W  ` g  {         @4!(.4:@DIQYairz< < J~fl   @"'8/4;AFM R_sccsid_sblock_itab_iaddr_blist_bmap_sflg_mflg_dflg_fi_ino_nrfile_ndfile_nbfile_ncfile_ndirect_nindir_niindir_niiindir_nfree_ndup_nerror_mainL42L38_printf_gets_checkL47_open_bread_pass1_makefree_close_chk_alloc_dupedL93_l3tolL135L148L154_bfreeL169_bwriteL182_lseek_readL195_writeL202((@i^okͣ/iߡߡ 8P((Џ^&PԀP^PЬSRbcPRb &0^n  ' . 4 . G <',7<B H8OSD[_end_edata_main__rtt_configure_cpu_openfirstHIGHentrystartaedataclr_badloc@i`pkJ+ %Mm-Ȫ Sat Apr 4 22:03:57 PST 1981 @ibqkzqR&i=66i ! ! BOOTSTRAP BY BOOT() SYSCALL ! GO MULTI-USER AFTER CHECKING; BOOT FROM DEFAULT DEVICE ! SET DEF HEX SET DEF LONG SET REL:0 HALT UNJAM INIT LOAD BOOT D/G B 0 ! BOOT PARAMETERS: MULTI USER AFTER CHECK D/G A 3 ! DEV TO BOOT FROM (0=HP, 2=UP, 3=HK) START 2 @idrkyqU&i=66i ! ! BOOTSTRAP BY BOOT() SYSCALL ! GO MULTI-USER AFTER CHECKING; BOOT FROM DEFAULT DEVICE ! SET DEF HEX SET DEF LONG SET REL:0 HALT UNJAM INIT LOAD BOOT D/G B 0 ! BOOT PARAMETERS: MULTI USER AFTER CHECK D/G A 2 ! DEV TO BOOT FROM (0=HP, 2=UP, 3=HK) START 2 @ifskͣO/iߡߡ X`8<^M߭߭PP ݭݭPFile:   $ 8 B Q  "+17_mainL12_printf_gets_open_putchar_getc_exit((@ihvk 6̀.#/i   cc -O -DSTANDALONE -DVAX780 -DVAX750 -DVAX7ZZ -c conf.c ar crv /usr/lib/libsa.a conf.o r - conf.o ranlib /usr/lib/libsa.a cc -O -DSTANDALONE -DVAX780 -DVAX750 -DVAX7ZZ -c boot.c ld -N -T 70000 relsrt0.o boot.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=boot ibs=32 skip=1; rm b.out 361+1 records in 22+1 records out ld -N srt0.o cat.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=cat ibs=32 skip=1; rm b.out 344+1 records in 21+1 records out ld -N srt0.o ls.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=ls ibs=32 skip=1; rm b.out 347+1 records in 21+1 records out ld -N srt0.o icheck.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=icheck ibs=32 skip=1; rm b.out 439+1 records in 27+1 records out ld -N srt0.o mkfs.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=mkfs ibs=32 skip=1; rm b.out 462+1 records in 28+1 records out ld -N srt0.o restor.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=restor ibs=32 skip=1; rm b.out 469+1 records in 29+1 records out ld -N tpsrt0.o icheck.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=tpicheck ibs=32 skip=1; rm b.out 439+1 records in 27+1 records out ld -N tpsrt0.o mkfs.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=tpmkfs ibs=32 skip=1; rm b.out 462+1 records in 28+1 records out ld -N tpsrt0.o restor.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=tprestor ibs=32 skip=1; rm b.out 469+1 records in 29+1 records out cp boot.c sboot.c; chmod +w sboot.c cc -c -O -DJUSTASK sboot.c rm sboot.c ld -N -T 70000 relsrt0.o sboot.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=sboot ibs=32 skip=1; rm b.out 359+1 records in 22+1 records out cp tprestor $DESTDIR/tp/restor cp tpicheck $DESTDIR/tp/icheck cp tpmkfs $DESTDIR/tp/mkfs cp sboot $DESTDIR/tp/boot cp boot icheck mkfs restor cat ls ../floppy cp boot $DESTDIR @ikxki  F<bhfȪ  4^Юn PPՀPpPP PЬЬϵЬP`ϸAϪϮϝP0ϙϕP@ϕωϋzP τvυiP@`FKPPPP/45լ&PD.2xPP`P^6PϳPP ȭPЭP^<PsPϴ!ϪϙPP˭PρЭP9Pz"ϔp_PPPPF^P[[8KT.P:PP.P *ЭP[7P&϶PoPB[Ϩ[ϡ, ϗφPAP8PPP[n,ϣ dSPPPPP[; s 1 PP[4O P#ϣPbP[8 ϾP'yPϺ ϰϟPPP[Ϛ8 ϐP':P{PϽ n]PPPP [Lϒ B1PPPЭ+6r !P%P P[PPЭ 46 P#ύP  [PϷPPP[ϲ * Ϩ ϗPݭPFP [P.PPЭc  ϲ Y HPѭPPЭ;  ώ 1  PѭPPЭ  j PѭPPЭ  F PѭPPЭ  " Ϲ ϨPѭPPЭϛ  ϑ πPѭPPݭ }ݬݬϣPP PdPP ^߭ݬόPPqq1@i}@i}@i p ^[[YJ5PP P[ w$^Ь[ЬZ ߭ZoPYY  ѭ SPݭO@ݭZ2P1Э֭ӏݭݭݭZPOݭY֭YYݭhpuphkraxx(0,0)vmunix Boot : : %s Bad format %d+%d+%d start 0x%x Short read  ! '. 6<C KR em      $ L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39BHQZbhow!,H3(9x?F~OU`gktz0 4 , 8 < ttt(@    # , 5 >HRX_fqz$ ( D x . %-85 : ?P E M R_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_text_textNTEXT_ntext_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_slowscan_fastscan_avenrun_setupclockL118_nbig_bigp_bplist_printf_schedL139_imax_Remrq_swapout_sleep_imin_swapin_vmmeterL209udiv_vmtotal_wakeup_vmpagoL220L226_cexp_loadavL275@ikE =&iG{G{ Џ]]^P(`mxPɏP0Xk00T=P0TQ0P PTQYYЏ0V0]U)Yed/@U1<,<&V%VV1rVW 05WPP]\Ue1Q#PѭVԭpk1ɏPbhk MP֭ PP!PPPP  P P"RRPPP#`x@ikmR82i char version[] = "Berkeley VAX/UNIX Version 4.9 Wed Feb 17 15:27:46 PST 1982\n"; @ik{np82i 9 @ikS+{;,:,: ((/* * Error codes */ #define EPERM 1 #define ENOENT 2 #define ESRCH 3 #define EINTR 4 #define EIO 5 #define ENXIO 6 #define E2BIG 7 #define ENOEXEC 8 #define EBADF 9 #define ECHILD 10 #define EAGAIN 11 #define ENOMEM 12 #define EACCES 13 #define EFAULT 14 #define ENOTBLK 15 #define EBUSY 16 #define EEXIST 17 #define EXDEV 18 #define ENODEV 19 #define ENOTDIR 20 #define EISDIR 21 #define EINVAL 22 #define ENFILE 23 #define EMFILE 24 #define ENOTTY 25 #define ETXTBSY 26 #define EFBIG 27 #define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#[  Z" P!~P[[  [[j[P Ь[*P#DP@ZP +PЬ[ 4PZZPP P  Z[[ڬ۬P(  ^Ь[ԭZk96 PQPQ0QZ[[kPP P P+P-k0ZέPЭPЬZЬY[ [[ ЬPЬRRQ{RPRPPPRRPЬPЬRRQ{RPPR PRPP,I0"DPЬSRbcPRbB &0^nhpuphkraxx(0,0)vmunix Boot : : %s Bad format %d+%d+%d start 0x%x Short read   xvx,x!xhpuphkranull path %s not found bn negative bn ovf %D bn void %D bn void %D not a directory zero length directory Seek not from beginning of file No more file slotsBad device Unknown device Bad unit specifier Missing offset specification Can't write files yet.. Sorry Exit called%s Trap %o `       @ ` `&vd62M2R%s1 JTJ2" 7 `7//2 @v unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIIL((Frk: unrecovered error rk: recovered by retry DR2 `7x  @7 up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPEh >Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error 0123456789abcdef@ikOܴ6/$\6/iii Џ^*PԀP^pQ-^z*&N) P ^EPPPݬHP5Pݬ*A&Bݬ*)& ݏ59<5PPxPPP更5P<5QQPPPѭ<5~5*%P *q%G9;[ #PK`[[[Dݏ@8[CZ  xZP@8Z[܀Ҁ<8[ݏ4[w83切[)ݭDP9PY"1eѬ ЬZJЭPԭ xѬ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PxPPsP QQ`Zԭ[PЫdTǏBPPPPPPPPPQQQPQQjZjZ2PxPP2QPQQxlPPPPxPʏPɏPѬjZ2 PPݭ[2jPPX2 ~o2~2~2~2~(i jZ5ѭ H P֭1խ , ЫlPЬ[k Ь[[1ЫXZԫl[ZPZPЬ[[^Ь[xTPxPP磊P LQQ`WЫTYXWxYZ[PΫlPPѬZP)ѬZPѬ  ZPPPɬZPPP<ݭ[;5ﳏPPP PPPݏ[.ЫXlݏ[Ь[ݏ[Ь[YZdXX;PѬ Ѭ lt)[)PYl`Y((UYPPKѬ ѬɏPP!dXXPY Y[q<PPPP<PPZ<ވ~_P<~tAZ /PZѬ Ѭ1 1Z ЫlPʄgPﴉPPP2PPqQPfP ^PxPP2PPGQP<P@0靖P pP,IˏTPPﮈ =PիXѫXЫXP@ ЫXP@X^_<?1yWPxPPPPPYP)խ ,XX @ikNݴ6/$\6/iiiX֭鑽 ֭jЭP֭`X1!XPX11Pd1Pc1 1PlXXPPo11Pu1Ps1|1Px11 ^Ѭ լ-Gάޭ[ݬݬ@ ݬݬPP֘{~ ޭP[PЬ[20uY"PY["PZ"[~#[  Z" P!~P[[  [[j[P Ь[*P#DP@ZP +PЬ[ 4PZZPP P  Z[[ڬ۬P(  ^Ь[ԭZk96 PQPQ0QZ[[kPP P P+P-k0ZέPЭPЬZЬY[ [[ ЬPЬRRQ{RPRPPPRRPЬPЬRRQ{RPPR PRPP6 PЬSRbcPRb  &0^nT-File: cannot open %s %s: Check fsize and isize: %ld, %u Not enough core; duplicates unchecked freefiles %u (r=%u,d=%u,b=%u,c=%u) used %ld (i=%ld,ii=%ld,iii=%ld,d=%ld) free %ld %ld missing missing%5ld bad mode %u data (small)1st indirectdata (large)2nd indirectdata (huge)3rd indirectdata (garg)%ld bad; inode=%u, class=%s %ld dup; inode=%u, class=%s %ld arg; inode=%u, class=%s Bad free list, s.b. count = %d Bad free list, entry count of block %ld = %d read error %ld No update write error %ld @(#)icheck.c 4.2 (Berkeley) 81/02/07null path %s not found bn negative bn ovf %D bn void %D bn void %D not a directory zero length directory Seek not from beginning of file No more file slotsBad device Unknown device Bad unit specifier Missing offset specification Can't write files yet.. Sorry Exit called%s Trap %o Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error 0123456789abcdef@ikbyC <&i(( ď[[Z[Џ]]^P(`mЏ@DЏPPЫDPP0T=P07TQ0P PTQYYЏ0V0]U)Yed/@U1<,<&V%VV1uVW 05WPP]\Ue1T8Pѭ+Vԭԫ,0Ы,RЫʏRRЏЏɏPԪ ԫЪ9kЫRʏRЏQQRPbP0)ЎPP֭ PP!PPPP  P P"RRPPP#@ik3H|$ /iqJ6i ((/* up.c 4.9 81/04/18 */ #include "../h/param.h" #include "../h/inode.h" #include "../h/upreg.h" #include "../h/pte.h" #include "../h/ubareg.h" #include "saio.h" #include "savax.h" u_short ubastd[] = { 0776700 }; char up_gottype[MAXNUBA*8] = { 0 }; char up_type[MAXNUBA*8] = { 0 }; short up_off[] = { 0, 27, 68, -1, -1, -1, -1, 82 }; short fj_off[] = { 0, 50, 0, -1, -1, -1, -1, 155 }; struct upst { short nsect; short ntrak; short nspc; short ncyl; short *off; } upst[] = { 32, 19, 32*19, 823, up_off, 32, 10, 32*10, 823, fj_off, }; upopen(io) register struct iob *io; { register struct updevice *upaddr = (struct updevice *)ubamem(io->i_unit, ubastd[0]); register struct upst *st; while ((upaddr->upcs1 & UP_DVA) == 0) ; if (up_gottype[io->i_unit] == 0) { upaddr->uphr = UPHR_MAXTRAK; if (upaddr->uphr == 9) up_type[io->i_unit] = 1; /* fuji kludge */ upaddr->upcs2 = UPCS2_CLR; up_gottype[io->i_unit] = 1; } st = &upst[up_type[io->i_unit]]; if (io->i_boff < 0 || io->i_boff > 7 || st->off[io->i_boff] == -1) _stop("up bad unit"); io->i_boff = st->off[io->i_boff] * st->nspc; } upstrategy(io, func) register struct iob *io; { int unit, nspc, ns, cn, tn, sn; daddr_t bn; int info; register short *rp; register struct updevice *upaddr = (struct updevice *)ubamem(io->i_unit, ubastd[0]); register struct upst *st = &upst[up_type[io->i_unit]]; unit = io->i_unit; bn = io->i_bn; cn = bn/st->nspc; sn = bn%st->nspc; tn = sn/st->nsect; sn = sn%st->nsect; upaddr->upcs2 = unit; if ((upaddr->upds & UPDS_VV) == 0) { upaddr->upcs1 = UP_DCLR|UP_GO; upaddr->upcs1 = UP_PRESET|UP_GO; upaddr->upof = UPOF_FMT22; } if ((upaddr->upds & UPDS_DREADY) != UPDS_DREADY) _stop("up not ready"); info = ubasetup(io, 1); rp = (short *) &upaddr->upda; upaddr->updc = cn; *rp = (tn << 8) + sn; *--rp = info; *--rp = -io->i_cc / sizeof (short); if (func == READ) *--rp = UP_RCOM|UP_GO; else *--rp = UP_WCOM|UP_GO; do { DELAY(25); } while ((upaddr->upcs1 & UP_RDY) == 0); if (upaddr->upds & UPDS_ERR) { printf("up error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b\n", cn, tn, sn, upaddr->upcs2, UPCS2_BITS, upaddr->uper1, UPER1_BITS, upaddr->uper2, UPER2_BITS); return (-1); } ubafree(io, info); return (io->i_cc); } @ikJ贁:i f 2/iii Џ^.PԀP^`1^1/ /ݏr ^/s*B"-rBCP\BPUB.PPR Pr.*߭,߭PAPw...)[,P ݏ=<=PPxPPPAp9Q P].)A.C9 P-A.Q)9K 9l P$$.)8 PNA8Y P*.(@\=8 P1a @1<@PP~^,P<~@PP~n,PPxQQQ2cPQPJ@<:>~1Μ^(d5͜>[[#Kw͜ѬR2PO͜P1+%q͜P͜P(d`y5==ЬPP͜*͜Ѭ2PЬPP͜ '"5WP5P[1Μ^) 1[x [P [)ݏ(}< P[#<<~W*$=[ C)9)<)+*$ 'P (W Pp<P **'*C$͜P(͜Pݬݏݬ(P(x PP@|  o(Ь[ЬZЬ YY Ь[2ZZ[[?ŏ[Pzݏŏ[P@ݬŏ[Px ~a; ݏݬK; Pݬ&)+# ŏ[P[1\ Z[ŏ P3ݬ ݬŏP@ףŏկPŏ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ˏhlPP PЭ ɏ֭ЭPΫlPЭQPЭPЭ Ѭ19xPAP`[xPPPP2PxPP^Ь[xTPxPPP`PˏTQxQQQPYԭЭPˏQ2@PPQ֭ЭP@xT~N2@DXXӏD[2ЫXZl[ZPZPЬ[[Ь[xTPxPP2P`PˏTQxQQQPWZѬѬ0Ыlԧݬ[ˏYYX2VV.ΫlPxPPȬPP0ˏYЧˏ,XXPPS$SS$$$$$$$$$$$gˏ~w 2@DVVӏDPN Pˏ~e4 Z Z1Z r ЫlP Ь[xTPxPPP aQQ`ZЫXP@U իXѫX OЫXP2@-PŏBPX Z ^Ь[xTPxPPP QQ`Zԭ[PЫdTǏBPPPPPPPPPQQQPQQjZjZ2PxPP2QPQQxlPPPPxPʏPɏPѬjZ2 PPݭ[2jPPX2 ~C2~2~2~2~i jZ5ѭ H P֭1խ , ЫlPЬ[k Ь[[1ЫXZԫl[ZPZPЬ[[^Ь[xTPxPPﹸP QQ`WЫTYXWxYZ[PΫlPPѬZP)ѬZPѬ  ZPPPɬZPPP<ݭ[?1yWPxPPPPPYP)խ ,XX X֭鑽 ֭jЭP֭`X1!XPX11Pd1Pc1 1PlXXPPo11Pu1Ps1|1Px11 ^Ѭ լ-Gάޭ[ݬݬ@ ݬݬPP֘{~ ޭP[PЬ[20uY"PY["PZ"[~#[  Z" P!~P[[  [[j[P Ь[*P#DP@ZP +PЬ[ 4PZZPP P  Z[[ڬ۬P(  ^Ь[ԭZk96 PQPQ0QZ[[kPP P P+P-k0ZέPЭPЬZЬY[ [[ ЬZЬY[ Y[[ ЬPЬRRQ{RPRPPPRRPЬPЬRRQ{RPPR PRPP:PЬSRbcPRbr  &0^n1/dev/rmt8\/ tapeTape? Disk? Last chance before scribbling on %s. diskMissing volume record Tape is not volume %d Missing header block End of tape Unknown header type Resynced at inode %u %u: ilist too small Missing address (header) block Tape read error: inode %u Mount volume %d Cannot open tape! Not a dump tape.Try again Wrong tape. Try again disk write error %D read error %D Out of space Checksum error %o @(#)restor.c 4.3 (Berkeley) 6/3/81null path %s not found bn negative bn ovf %D bn void %D bn void %D not a directory zero length directory Seek not from beginning of file No more file slotsBad device Unknown device Bad unit specifier Missing offset specification Can't write files yet.. Sorry Exit called%s Trap %o 33%$3< 3J*H( 33 ! 3#4"#3zhpuphkrahttmtsmt`       @ ` `&vd62M2R%s1 JTJ2" 73 `73/3/332 @v3unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry Anot a tape mt hard error: er=%b mt error: er=%b mt: unrecovered error mt: recovered by retry rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry Pte error: er=%bILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOTts: unrecovered error ts: recovered by retry DR2 `78 @79up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPEh >Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error 0123456789abcdef((@ik/$  /ikk /* ts.c 4.4 81/12/01 */ /* * TS11 tape driver */ #include "../h/param.h" #include "../h/tsreg.h" #include "../h/inode.h" #include "../h/pte.h" #include "../h/ubareg.h" #include "saio.h" #include "savax.h" u_short tsstd[] = { 0772520 }; struct iob ctsbuf; u_short ts_uba; /* Unibus address of ts structure */ struct tsdevice *tsaddr = 0; struct ts { struct ts_cmd ts_cmd; struct ts_char ts_char; struct ts_sts ts_sts; } ts; tsopen(io) register struct iob *io; { static struct ts *ts_ubaddr; long i = 0; if (tsaddr == 0) tsaddr = ubamem(io->i_unit, tsstd[0]); tsaddr->tssr = 0; while ((tsaddr->tssr & TS_SSR)==0) { if (++i > 1000000) { printf("ts: not ready\n"); return; } } if (tsaddr->tssr&TS_OFL) { printf("ts: offline\n"); return; } if (tsaddr->tssr&TS_NBA) { int i; ctsbuf.i_ma = (caddr_t) &ts; ctsbuf.i_cc = sizeof(ts); if (ts_ubaddr == 0) ts_ubaddr = (struct ts *)ubasetup(&ctsbuf, 2); ts_uba = (u_short)((long)ts_ubaddr + (((long)ts_ubaddr>>16)&03)); ts.ts_char.char_addr = (int)&ts_ubaddr->ts_sts; ts.ts_char.char_size = sizeof(ts.ts_sts); ts.ts_char.char_mode = TS_ESS; ts.ts_cmd.c_cmd = TS_ACK|TS_SETCHR; i = (int)&ts_ubaddr->ts_char; ts.ts_cmd.c_loba = i; ts.ts_cmd.c_hiba = (i>>16)&3; ts.ts_cmd.c_size = sizeof(ts.ts_char); tsaddr->tsdb = ts_uba; } tsstrategy(io, TS_REW); if (io->i_cc = io->i_boff) tsstrategy(io, TS_SFORWF); } tsclose(io) register struct iob *io; { tsstrategy(io, TS_REW); } tsstrategy(io, func) register struct iob *io; { register int errcnt, info = 0; errcnt = 0; retry: while ((tsaddr->tssr & TS_SSR) == 0) DELAY(100); if (func == TS_REW || func == TS_SFORWF) ts.ts_cmd.c_repcnt = io->i_cc; else { info = ubasetup(io, 1); ts.ts_cmd.c_size = io->i_cc; ts.ts_cmd.c_loba = info; ts.ts_cmd.c_hiba = (info>>16)&3; } if (func == READ) func = TS_RCOM; else if (func == WRITE) func = TS_WCOM; ts.ts_cmd.c_cmd = TS_ACK|TS_CVC|func; tsaddr->tsdb = ts_uba; do DELAY(100) while ((tsaddr->tssr & TS_SSR) == 0); if (info) ubafree(io, info); if (ts.ts_sts.s_xs0 & TS_TMK) return (0); if (tsaddr->tssr & TS_SC) { printf("ts tape error: er=%b, xs0=%b", tsaddr->tssr, TSSR_BITS, ts.ts_sts.s_xs0, TSXS0_BITS); if (errcnt==10) { printf("ts: unrecovered error\n"); return (-1); } errcnt++; if (func == TS_RCOM || func == TS_WCOM) func |= TS_RETRY; goto retry; } if (errcnt) printf("ts: recovered by retry\n"); return (io->i_cc - ts.ts_sts.s_rbpcr); } @ik8$^@iD6i /* savax.h 4.2 81/03/15 */ /* * Standalone definitions peculiar to vaxen * The mba devices in the standalone system are addressed as * xx(unit,section) * where unit is * 8*mbanum+drive * The mbadrv macro gives the address of the device registers * for the specified unit; the mbamba macro gives the address of the * mba registers themselves. * * The uba devices are also addressed by giving, as unit, * 8*ubanum+drive * The ubamem macro converts a specified unibus address (ala pdp-11) * into a unibus memory address space address. */ int cpu; /* see */ #define MAXNMBA 4 struct mba_regs **mbaddr; int mbaact; caddr_t *umaddr; struct uba_regs **ubaddr; #define UNITTOMBA(unit) ((unit)>>3) #define UNITTODRIVE(unit) ((unit)&07) #define mbamba(unit) (mbaddr[UNITTOMBA(unit)]) #define mbadrv(unit) (&mbamba(unit)->mba_drv[UNITTODRIVE(unit)]) #define UNITTOUBA(unit) ((unit)>>3) #define ubauba(unit) (ubaddr[UNITTOUBA(unit)]) #define ubamem(unit, off) ((umaddr[UNITTOUBA(unit)]+(off&017777))) @ikG$x@iD6i /* saio.h 4.4 3/15/81 */ /* * header file for standalone package */ /* * io block: includes an * inode, cells for the use of seek, etc, * and a buffer. */ struct iob { char i_flgs; struct inode i_ino; int i_unit; daddr_t i_boff; daddr_t i_cyloff; off_t i_offset; daddr_t i_bn; char *i_ma; int i_cc; char i_buf[BSIZE]; }; #define F_READ 01 #define F_WRITE 02 #define F_ALLOC 04 #define F_FILE 010 /* * dev switch */ struct devsw { char *dv_name; int (*dv_strategy)(); int (*dv_open)(); int (*dv_close)(); }; struct devsw devsw[]; /* * request codes. Must be the same a F_XXX above */ #define READ 1 #define WRITE 2 #define NBUFS 4 char b[NBUFS][BSIZE]; daddr_t blknos[NBUFS]; #define NFILES 4 struct iob iob[NFILES]; @ikg?$/i6i ((/* sys.c 4.4 81/03/22 */ #include #include #include #include #include #include "saio.h" ino_t dlook(); static openi(n,io) register struct iob *io; { register struct dinode *dp; io->i_offset = 0; io->i_bn = fsbtodb(itod(n)) + io->i_boff; io->i_cc = BSIZE; io->i_ma = io->i_buf; devread(io); dp = (struct dinode *)io->i_buf; dp = &dp[itoo(n)]; io->i_ino.i_number = n; io->i_ino.i_mode = dp->di_mode; io->i_ino.i_size = dp->di_size; l3tol((char *)io->i_ino.i_un.i_addr, (char *)dp->di_addr, NADDR); } static find(path, file) register char *path; struct iob *file; { register char *q; char c; int n; if (path==NULL || *path=='\0') { printf("null path\n"); return(0); } openi((ino_t) ROOTINO, file); while (*path) { while (*path == '/') path++; q = path; while(*q != '/' && *q != '\0') q++; c = *q; *q = '\0'; if ((n=dlook(path, file))!=0) { if (c=='\0') break; openi(n, file); *q = c; path = q; continue; } else { printf("%s not found\n",path); return(0); } } return(n); } static daddr_t sbmap(io, bn) register struct iob *io; daddr_t bn; { register i; register struct inode *ip; int j, sh; daddr_t nb, *bap; int ibn = bn; ip = &io->i_ino; if(bn < 0) { printf("bn negative\n"); return((daddr_t)0); } /* * blocks 0..NADDR-4 are direct blocks */ if(bn < NADDR-3) { i = bn; nb = ip->i_un.i_addr[i]; return(nb); } /* * addresses NADDR-3, NADDR-2, and NADDR-1 * have single, double, triple indirect blocks. * the first step is to determine * how many levels of indirection. */ sh = 0; nb = 1; bn -= NADDR-3; for(j=3; j>0; j--) { sh += NSHIFT; nb <<= NSHIFT; if(bn < nb) break; bn -= nb; } if(j == 0) { printf("bn ovf %D\n",bn); return((daddr_t)0); } /* * fetch the address from the inode */ nb = ip->i_un.i_addr[NADDR-j]; if(nb == 0) { printf("bn void %D\n",bn); return((daddr_t)0); } /* * fetch through the indirect blocks */ for(; j<=3; j++) { if (blknos[j] != nb) { io->i_bn = fsbtodb(nb) + io->i_boff; io->i_ma = b[j]; io->i_cc = BSIZE; devread(io); bap = (daddr_t *)b[j]; blknos[j] = nb; } bap = (daddr_t *)b[j]; sh -= NSHIFT; i = (bn>>sh) & NMASK; nb = bap[i]; if(nb == 0) { printf("bn void %D\n",bn); return((daddr_t)0); } } return(nb); } static ino_t dlook(s, io) char *s; register struct iob *io; { register struct direct *dp; register struct inode *ip; daddr_t bn; int n,dc; if (s==NULL || *s=='\0') return(0); ip = &io->i_ino; if ((ip->i_mode&IFMT)!=IFDIR) { printf("not a directory\n"); return(0); } n = ip->i_size/sizeof(struct direct); if (n==0) { printf("zero length directory\n"); return(0); } dc = BSIZE; bn = (daddr_t)0; while(n--) { if (++dc >= BSIZE/sizeof(struct direct)) { io->i_bn = fsbtodb(sbmap(io, bn++)) + io->i_boff; io->i_ma = io->i_buf; io->i_cc = BSIZE; devread(io); dp = (struct direct *)io->i_buf; dc = 0; } if (match(s, dp->d_name)) return(dp->d_ino); dp++; } return(0); } static match(s1,s2) register char *s1,*s2; { register cc; cc = DIRSIZ; while (cc--) { if (*s1 != *s2) return(0); if (*s1++ && *s2++) continue; else return(1); } return(1); } lseek(fdesc, addr, ptr) int fdesc; off_t addr; int ptr; { register struct iob *io; if (ptr != 0) { printf("Seek not from beginning of file\n"); return(-1); } fdesc -= 3; if (fdesc < 0 || fdesc >= NFILES || ((io = &iob[fdesc])->i_flgs&F_ALLOC) == 0) return(-1); io->i_offset = addr; io->i_bn = fsbtodb(addr/BSIZE) + io->i_boff; io->i_cc = 0; return(0); } getc(fdesc) int fdesc; { register struct iob *io; register char *p; register c; int off; if (fdesc >= 0 && fdesc <= 2) return(getchar()); fdesc -= 3; if (fdesc < 0 || fdesc >= NFILES || ((io = &iob[fdesc])->i_flgs&F_ALLOC) == 0) return(-1); p = io->i_ma; if (io->i_cc <= 0) { io->i_bn = fsbtodb(io->i_offset/(off_t)BSIZE); if (io->i_flgs&F_FILE) io->i_bn = fsbtodb(sbmap(io, dbtofsb(io->i_bn))) + io->i_boff; io->i_ma = io->i_buf; io->i_cc = BSIZE; devread(io); if (io->i_flgs&F_FILE) { off = io->i_offset % (off_t)BSIZE; if (io->i_offset+(BSIZE-off) >= io->i_ino.i_size) io->i_cc = io->i_ino.i_size - io->i_offset + off; io->i_cc -= off; if (io->i_cc <= 0) return(-1); } else off = 0; p = &io->i_buf[off]; } io->i_cc--; io->i_offset++; c = (unsigned)*p++; io->i_ma = p; return(c); } /* does this port? getw(fdesc) int fdesc; { register w,i; register char *cp; int val; for (i = 0, val = 0, cp = &val; i < sizeof(val); i++) { w = getc(fdesc); if (w < 0) { if (i == 0) return(-1); else return(val); } *cp++ = w; } return(val); } */ read(fdesc, buf, count) int fdesc; char *buf; int count; { register i; register struct iob *file; if (fdesc >= 0 & fdesc <= 2) { i = count; do { *buf = getchar(); } while (--i && *buf++ != '\n'); return(count - i); } fdesc -= 3; if (fdesc < 0 || fdesc >= NFILES || ((file = &iob[fdesc])->i_flgs&F_ALLOC) == 0) return(-1); if ((file->i_flgs&F_READ) == 0) return(-1); if ((file->i_flgs&F_FILE) == 0) { file->i_cc = count; file->i_ma = buf; i = devread(file); file->i_bn += CLSIZE; return(i); } else { if (file->i_offset+count > file->i_ino.i_size) count = file->i_ino.i_size - file->i_offset; if ((i = count) <= 0) return(0); do { *buf++ = getc(fdesc+3); } while (--i); return(count); } } write(fdesc, buf, count) int fdesc; char *buf; int count; { register i; register struct iob *file; if (fdesc >= 0 && fdesc <= 2) { i = count; while (i--) putchar(*buf++); return(count); } fdesc -= 3; if (fdesc < 0 || fdesc >= NFILES || ((file = &iob[fdesc])->i_flgs&F_ALLOC) == 0) return(-1); if ((file->i_flgs&F_WRITE) == 0) return(-1); file->i_cc = count; file->i_ma = buf; i = devwrite(file); file->i_bn += CLSIZE; return(i); } int openfirst = 1; open(str, how) char *str; int how; { register char *cp; int i; register struct iob *file; register struct devsw *dp; int fdesc; long atol(); if (openfirst) { for (i = 0; i < NFILES; i++) iob[i].i_flgs = 0; openfirst = 0; } for (fdesc = 0; fdesc < NFILES; fdesc++) if (iob[fdesc].i_flgs == 0) goto gotfile; _stop("No more file slots"); gotfile: (file = &iob[fdesc])->i_flgs |= F_ALLOC; for (cp = str; *cp && *cp != '('; cp++) ; if (*cp != '(') { printf("Bad device\n"); file->i_flgs = 0; return(-1); } *cp++ = '\0'; for (dp = devsw; dp->dv_name; dp++) { if (match(str, dp->dv_name)) goto gotdev; } printf("Unknown device\n"); file->i_flgs = 0; return(-1); gotdev: *(cp-1) = '('; file->i_ino.i_dev = dp-devsw; file->i_unit = *cp++ - '0'; if (*cp >= '0' && *cp <= '9') file->i_unit = file->i_unit * 10 + *cp++ - '0'; if (file->i_unit < 0 || file->i_unit > 31) { printf("Bad unit specifier\n"); file->i_flgs = 0; return(-1); } if (*cp++ != ',') { badoff: printf("Missing offset specification\n"); file->i_flgs = 0; return(-1); } file->i_boff = atol(cp); for (;;) { if (*cp == ')') break; if (*cp++) continue; goto badoff; } devopen(file); if (*++cp == '\0') { file->i_flgs |= how+1; file->i_cc = 0; file->i_offset = 0; return(fdesc+3); } if ((i = find(cp, file)) == 0) { file->i_flgs = 0; return(-1); } if (how != 0) { printf("Can't write files yet.. Sorry\n"); file->i_flgs = 0; return(-1); } openi(i, file); file->i_offset = 0; file->i_cc = 0; file->i_flgs |= F_FILE | (how+1); return(fdesc+3); } close(fdesc) int fdesc; { struct iob *file; fdesc -= 3; if (fdesc < 0 || fdesc >= NFILES || ((file = &iob[fdesc])->i_flgs&F_ALLOC) == 0) return(-1); if ((file->i_flgs&F_FILE) == 0) devclose(file); file->i_flgs = 0; return(0); } exit() { _stop("Exit called"); } _stop(s) char *s; { int i; for (i = 0; i < NFILES; i++) if (iob[i].i_flgs != 0) close(i); printf("%s\n", s); _rtt(); } trap(ps) int ps; { printf("Trap %o\n", ps); for (;;) ; } @ikc$ /i7[6i /* prf.c 4.3 81/05/05 */ #include "../h/param.h" #include "../h/cons.h" #include "../h/mtpr.h" /* * Scaled down version of C Library printf. * Used to print diagnostic information directly on console tty. * Since it is not interrupt driven, all system activities are * suspended. Printf should not be used for chit-chat. * * One additional format: %b is supported to decode error registers. * Usage is: * printf("reg=%b\n", regval, "*"); * Where is the output base expressed as a control character, * e.g. \10 gives octal; \20 gives hex. Each arg is a sequence of * characters, the first of which gives the bit number to be inspected * (origin 1), and the next characters (up to a control character, i.e. * a character <= 32), give the name of the register. Thus * printf("reg=%b\n", 3, "\10\2BITTWO\1BITONE\n"); * would produce output: * reg=2 */ /*VARARGS1*/ printf(fmt, x1) char *fmt; unsigned x1; { prf(fmt, &x1); } prf(fmt, adx) register char *fmt; register(( u_int *adx; { register int b, c, i; char *s; int any; loop: while ((c = *fmt++) != '%') { if(c == '\0') return; putchar(c); } again: c = *fmt++; /* THIS CODE IS VAX DEPENDENT IN HANDLING %l? AND %c */ switch (c) { case 'l': goto again; case 'x': case 'X': b = 16; goto number; case 'd': case 'D': case 'u': /* what a joke */ b = 10; goto number; case 'o': case 'O': b = 8; number: printn((u_long)*adx, b); break; case 'c': b = *adx; for (i = 24; i >= 0; i -= 8) if (c = (b >> i) & 0x7f) putchar(c); break; case 'b': b = *adx++; s = (char *)*adx; printn((u_long)b, *s++); any = 0; if (b) { putchar('<'); while (i = *s++) { if (b & (1 << (i-1))) { if (any) putchar(','); any = 1; for (; (c = *s) > 32; s++) putchar(c); } else for (; *s > 32; s++) ; } putchar('>'); } break; case 's': s = (char *)*adx; while (c = *s++) putchar(c); break; } adx++; goto loop; } /* * Printn prints a number n in base b. * We don't use recursion to avoid deep kernel stacks. */ printn(n, b) u_long n; { char prbuf[11]; register char *cp; if (b == 10 && (int)n < 0) { putchar('-'); n = (unsigned)(-(int)n); } cp = prbuf; do { *cp++ = "0123456789abcdef"[n%b]; n /= b; } while (n); do putchar(*--cp); while (cp > prbuf); } /* * Print a character on console. * Attempts to save and restore device * status. * * Whether or not printing is inhibited, * the last MSGBUFS characters * are saved in msgbuf for inspection later. */ putchar(c) register c; { register s, timo; timo = 30000; /* * Try waiting for the console tty to come ready, * otherwise give up after a reasonable time. */ while((mfpr(TXCS)&TXCS_RDY) == 0) if(--timo == 0) break; if(c == 0) return; s = mfpr(TXCS); mtpr(TXCS,0); mtpr(TXDB, c&0xff); if(c == '\n') putchar('\r'); putchar(0); mtpr(TXCS, s); } getchar() { register c; while((mfpr(RXCS)&RXCS_DONE) == 0) ; c = mfpr(RXDB)&0177; if (c=='\r') c = '\n'; putchar(c); return(c); } gets(buf) char *buf; { register char *lp; register c; lp = buf; for (;;) { c = getchar() & 0177; store: switch(c) { case '\n': case '\r': c = '\n'; *lp++ = '\0'; return; case '\b': case '#': lp--; if (lp < buf) lp = buf; continue; case '@': case 'u'&037: lp = buf; putchar('\n'); continue; default: *lp++ = c; } } } @ik#}q$4/i*6i /* srt0.c 4.8 81/04/03 */ #include "../h/mtpr.h" #define LOCORE #include "../h/cpu.h" /* * Startup code for standalone system * Non-relocating version -- for programs which are loaded by boot */ .globl _end .globl _edata .globl _main .globl __rtt .globl _configure .globl _cpu .globl _openfirst .set HIGH,31 # mask for total disable entry: .globl entry .word 0x0 mtpr $HIGH,$IPL # just in case #ifdef REL movl $RELOC,sp #else movl $RELOC-0x2400,sp #endif start: movl aedata,r0 clr: clrl (r0)+ cmpl r0,sp jlss clr #ifdef REL movc3 aend,*$0,(sp) jmp *abegin begin: #endif mtpr $0,$SCBB calls $0,_configure movl $1,_openfirst calls $0,_main #ifndef TP jmp start #else ret #endif .data #ifdef REL abegin: .long begin aend: .long _end-RELOC aedata: .long _edata-RELOC #else aedata: .long _edata #endif __rtt: .word 0x0 jmp start .globl _badloc _badloc: .word 0 movl $1,r0 movl 4(ap),r3 movl $4,r2 movab 9f,(r2) tstl (r3) 1: clrl r0 # made it w/o machine checks 2: movl $4,r2 clrl (r2) ret .align 2 9: casel _cpu,$1,$VAX_MAX 0: .word 8f-0b # 1 is 780 .word 5f-0b # 2 is 750 .word 5f-0b # 3 is 7ZZ 5: mtpr $0xf,$MCESR brb 1f 8: mtpr $0,$SBIFS 1: addl2 (sp)+,sp # discard mchchk trash movab 2b,(sp) rei @ikZɍ$/iD6i /* mba.c 4.3 81/03/15 */ #include "../h/param.h" #include "../h/inode.h" #include "../h/pte.h" #include "../h/mbareg.h" #include "../h/mtpr.h" #include "../h/vm.h" #include "saio.h" #include "savax.h" mbastart(io, func) register struct iob *io; int func; { struct mba_regs *mba = mbamba(io->i_unit); struct mba_drv *drv = mbadrv(io->i_unit); register struct pte *pte = mba->mba_map; int npf; unsigned v; int o; int vaddr; v = btop(io->i_ma); o = (int)io->i_ma & PGOFSET; npf = btoc(io->i_cc + o); vaddr = o; while (--npf >= 0) *(int *)pte++ = v++ | PG_V; mba->mba_sr = -1; mba->mba_bcr = -io->i_cc; mba->mba_var = vaddr; if (func == WRITE) drv->mbd_cs1 = MB_WCOM | MB_GO; else drv->mbd_cs1 = MB_RCOM | MB_GO; } mbainit(mbanum) int mbanum; { register struct mba_regs *mba = mbaddr[mbanum]; /* SHOULD BADADDR IT */ if (mbaact & (1<mba_cr = MBCR_INIT; mbaact |= 1<i_unit, rkstd[0]); if (rk_off[io->i_boff] == -1 || io->i_boff < 0 || io->i_boff > 7) _stop("rk bad unit"); io->i_boff = rk_off[io->i_boff] * NRKSECT*NRKTRK; rkaddr->rkcs2 = RKCS2_SCLR; rkwait(rkaddr); } rkstrategy(io, func) register struct iob *io; { register struct rkdevice *rkaddr = (struct rkdevice *)ubamem(io->i_unit, rkstd[0]); int com; daddr_t bn; short dn, cn, sn, tn; int ubinfo, errcnt = 0; retry: ubinfo = ubasetup(io, 1); bn = io->i_bn; dn = io->i_unit; cn = bn/(NRKSECT*NRKTRK); sn = bn%NRKSECT; tn = (bn / NRKSECT) % NRKTRK; rkaddr->rkcs2 = dn; rkaddr->rkcs1 = RK_CDT|RK_PACK|RK_GO; rkwait(rkaddr); rkaddr->rkcs1 = RK_CDT|RK_DCLR|RK_GO; rkwait(rkaddr); rkaddr->rkda = sn | (tn << 8); rkaddr->rkcyl = cn; rkaddr->rkba = ubinfo; rkaddr->rkwc = -(io->i_cc >> 1); com = RK_CDT|((ubinfo>>8)&0x300)|RK_GO; if (func == READ) com |= RK_READ; else com |= RK_WRITE; rkaddr->rkcs1 = com; rkwait(rkaddr); while ((rkaddr->rkds & RKDS_SVAL) == 0) ; ubafree(io, ubinfo); if (rkaddr->rkcs1 & RK_CERR) { printf("rk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b\n", cn, tn, sn, rkaddr->rkcs2, RKCS2_BITS, rkaddr->rker, RKER_BITS); rkaddr->rkcs1 = RK_CDT|RK_DCLR|RK_GO; rkwait(rkaddr); if (errcnt == 10) { printf("rk: unrecovered error\n"); return (-1); } errcnt++; goto retry; } if (errcnt) printf("rk: recovered by retry\n"); return (io->i_cc); } rkwait(rkaddr) register struct rkdevice *rkaddr; { while ((rkaddr->rkcs1 & RK_CRDY) == 0) ; } @ikL=&ij{j{ >Z;[[Z[[ k2$Ԫ Џ29k  @ik/$ /i\6i /* hp.c 4.6 81/05/10 */ /* * RP??/RM?? disk driver */ #include "../h/param.h" #include "../h/inode.h" #include "../h/hpreg.h" #include "../h/pte.h" #include "../h/mbareg.h" #include "saio.h" #include "savax.h" #define MASKREG(reg) ((reg)&0xffff) char hp_type[MAXNMBA*8] = { 0 }; /* THIS SHOULD BE READ IN OFF THE PACK, PER DRIVE */ short hp6_off[8] = { 0, 38, 0, -1, -1, -1, 118, -1 }; short rm3_off[8] = { 0, 100, 0, -1, -1, -1, 310, -1 }; short rm5_off[8] = { 0, 27, 0, 562, 589, 681, 562, 82 }; short rm80_off[8] = { 0, 37, 0, -1, -1, -1, 115, 305 }; short hp7_off[8] = { 0, 10, 0, 330, 340, 500, 330, 50 }; /* END SHOULD BE READ IN */ short hptypes[] = { MBDT_RM03, MBDT_RM05, MBDT_RP06, MBDT_RM80, MBDT_RP05, MBDT_RP07, 0 }; struct hpst { short nsect; short ntrak; short nspc; short ncyl; short *off; } hpst[] = { 32, 5, 32*5, 823, rm3_off, /* RM03 */ 32, 19, 32*19, 823, rm5_off, /* RM05 */ 22, 19, 22*19, 815, hp6_off, /* RP06 */ 31, 14, 31*14, 559, rm80_off, /* RM80 */ 22, 19, 22*19, 411, hp6_off, /* RP06 */ 50, 32, 50*32, 630, hp7_off, /* RP07 */ }; hpopen(io) register struct iob *io; { register unit = io->i_unit; struct hpdevice *hpaddr = (struct hpdevice *)mbadrv(unit); register struct hpst *st; mbainit(UNITTOMBA(io->i_unit)); if (hp_type[unit] == 0) { register type = hpaddr->hpdt & MBDT_TYPE; register int i; for (i = 0; hptypes[i]; i++) if (hptypes[i] == type) goto found; _stop("unknown drive type"); found: hp_type[unit] = i; } st = &hpst[hp_type[unit]]; if (io->i_boff < 0 || io->i_boff > 7 || st->off[io->i_boff]== -1) _stop("hp bad minor"); io->i_boff = st->off[io->i_boff] * st->nspc; } hpstrategy(io, func) register struct iob *io; { int unit = io->i_unit; daddr_t bn = io->i_bn; struct hpdevice *hpaddr = (struct hpdevice *)mbadrv(unit); struct hpst *st = &hpst[hp_type[unit]]; int cn, tn, sn; if ((hpaddr->hpds & HPDS_VV) == 0) { hpaddr->hpcs1 = HP_DCLR|HP_GO; hpaddr->hpcs1 = HP_PRESET|HP_GO; hpaddr->hpof = HPOF_FMT22; } cn = bn/st->nspc((; sn = bn%st->nspc; tn = sn/st->nsect; sn = sn%st->nsect; hpaddr->hpdc = cn; hpaddr->hpda = (tn << 8) + sn; mbastart(io, func); while ((hpaddr->hpds & HPDS_DRY) == 0) ; if (hpaddr->hpds&HPDS_ERR) { printf("hp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b\n", cn, tn, sn, MASKREG(hpaddr->hpds), HPDS_BITS, MASKREG(hpaddr->hper1), HPER1_BITS); return (-1); } return (io->i_cc); } @ik?L$W/i|h /* conf.c 4.9 81/12/01 */ #include "../h/param.h" #include "../h/inode.h" #include "../h/pte.h" #include "../h/mbareg.h" #include "saio.h" devread(io) register struct iob *io; { return( (*devsw[io->i_ino.i_dev].dv_strategy)(io, READ) ); } devwrite(io) register struct iob *io; { return( (*devsw[io->i_ino.i_dev].dv_strategy)(io, WRITE) ); } devopen(io) register struct iob *io; { (*devsw[io->i_ino.i_dev].dv_open)(io); } devclose(io) register struct iob *io; { (*devsw[io->i_ino.i_dev].dv_close)(io); } nullsys() { ; } int nullsys(); int hpstrategy(), hpopen(); int htstrategy(), htopen(), htclose(); int upstrategy(), upopen(); int tmstrategy(), tmopen(), tmclose(); int tsstrategy(), tsopen(), tsclose(); int mtstrategy(), mtopen(), mtclose(); int rkstrategy(), rkopen(); int udstrategy(), udopen(); struct devsw devsw[] = { "hp", hpstrategy, hpopen, nullsys, "ht", htstrategy, htopen, htclose, "up", upstrategy, upopen, nullsys, "tm", tmstrategy, tmopen, tmclose, "hk", rkstrategy, rkopen, nullsys, "ts", tsstrategy, tsopen, tsclose, "mt", mtstrategy, mtopen, mtclose, "ra", udstrategy, udopen, nullsys, 0,0,0,0 }; @ikI̍$/iD6i /* cat.c 4.2 81/03/15 */ main() { int c, i; char buf[50]; do { printf("File: "); gets(buf); i = open(buf, 0); } while (i <= 0); while ((c = getc(i)) > 0) putchar(c); exit(0); } @ik<$T/ih /* boot.c 4.6 81/12/01 */ #include "../h/param.h" #include "../h/ino.h" #include "../h/inode.h" #include "../h/filsys.h" #include "../h/dir.h" #include "../h/vm.h" #include #include "saio.h" #include /* * Boot program... arguments passed in r10 and r11 determine * whether boot stops to ask for system name and which device * boot comes from. */ /* Types in r10 specifying major device */ char devname[][2] = { 'h','p', /* 0 = hp */ 0,0, /* 1 = ht */ 'u','p', /* 2 = up */ 'h','k', /* 3 = hk */ 0,0, /* 4 = sw */ 0,0, /* 5 = tm */ 0,0, /* 6 = ts */ 0,0, /* 7 = mt */ 0,0, /* 8 = tu */ 'r','a', /* 9 = ra */ }; char line[100] = "xx(0,0)vmunix"; int retry = 0; main() { register howto, devtype; /* howto=r11, devtype=r10 */ int io; #ifdef lint howto = 0; devtype = 0; #endif printf("\nBoot\n"); #ifdef JUSTASK howto = RB_ASKNAME|RB_SINGLE; #else if ((howto&RB_ASKNAME)==0) { if (devtype>=0 && devtype= 0) copyunix(howto, io); if (++retry > 2) howto = RB_SINGLE|RB_ASKNAME; } } /*ARGSUSED*/ copyunix(howto, io) register howto, io; { struct exec x; register int i; char *addr; i = read(io, (char *)&x, sizeof x); if (i != sizeof x || x.a_magic != 0410) _stop("Bad format\n"); printf("%d", x.a_text); if (read(io, (char *)0, x.a_text) != x.a_text) goto shread; addr = (char *)x.a_text; while ((int)addr & CLOFSET) *addr++ = 0; printf("+%d", x.a_data); if (read(io, addr, x.a_data) != x.a_data) goto shread; addr += x.a_data; printf("+%d", x.a_bss); x.a_bss += 128*512; /* slop */ for (i = 0; i < x.a_bss; i++) *addr++ = 0; x.a_entry &= 0x7fffffff; printf(" start 0x%x\n", x.a_entry); (*((int (*)()) x.a_entry))(); _exit(); shread: _stop("Short read\n"); } ((@ik>^@iU@iU@i /* autoconf.c 4.4 81/04/03 */ #include "../h/param.h" #include "../h/cpu.h" #include "../h/nexus.h" #include "../h/pte.h" #include "../h/ubareg.h" #include "../h/mbareg.h" #include "../h/mtpr.h" #include "savax.h" #define UTR(i) ((struct uba_regs *)(NEX780+(i))) #define UMA(i) ((caddr_t)UMEM780(i)) #define MTR(i) ((struct mba_regs *)(NEX780+(i))) struct uba_regs *ubaddr780[] = { UTR(3), UTR(4), UTR(5), UTR(6) }; caddr_t umaddr780[] = { UMA(0), UMA(1), UMA(2), UMA(3) }; struct mba_regs *mbaddr780[] = { MTR(8), MTR(9), MTR(10), MTR(11) }; #undef UTR #undef UMA #undef MTR #define UTR(i) ((struct uba_regs *)(NEX750+(i))) #define UMA(i) ((caddr_t)UMEM750(i)) #define MTR(i) ((struct mba_regs *)(NEX750+(i))) struct uba_regs *ubaddr750[] = { UTR(8), UTR(9) }; caddr_t umaddr750[] = { UMA(0), UMA(1) }; struct mba_regs *mbaddr750[] = { MTR(4), MTR(5), MTR(6), MTR(7) }; #undef UTR #undef UMA #undef MTR #define UTR(i) ((struct uba_regs *)(NEX7ZZ+(i))) #define UMA ((caddr_t)UMEM7ZZ) struct uba_regs *ubaddr7ZZ[] = { UTR(3) }; caddr_t umaddr7ZZ[] = { UMA }; #undef UTR #undef UMA configure() { union cpusid cpusid; int nmba, nuba, i; cpusid.cpusid = mfpr(SID); cpu = cpusid.cpuany.cp_type; switch (cpu) { case VAX_780: mbaddr = mbaddr780; ubaddr = ubaddr780; umaddr = umaddr780; nmba = sizeof (mbaddr780) / sizeof (mbaddr780[0]); nuba = sizeof (ubaddr780) / sizeof (ubaddr780[0]); break; case VAX_750: mbaddr = mbaddr750; ubaddr = ubaddr750; umaddr = umaddr750; nmba = sizeof (mbaddr750) / sizeof (mbaddr750[0]); nuba = 0; break; case VAX_7ZZ: ubaddr = ubaddr7ZZ; umaddr = umaddr7ZZ; nmba = nuba = 0; break; } /* * Forward into the past... */ for (i = 0; i < nmba; i++) if (!badloc(mbaddr[i])) mbaddr[i]->mba_cr = MBCR_INIT; for (i = 0; i < nuba; i++) if (!badloc(ubaddr[i])) if (cpu == VAX_780) ubaddr[i]->uba_cr = UBACR_ADINIT; if (cpu != VAX_780) mtpr(IUR,0); /* give unibus devices a chance to recover... */ if (nuba > 0) DELAY(2000000); } @ik vy|Z@iii # makefile 4.13 81/12/01 DESTDIR= CFLAGS= -O -DSTANDALONE ${COPTS} COPTS= -DVAX780 -DVAX750 -DVAX7ZZ RELOC= 70000 SRCS= sys.c conf.c prf.c machdep.c \ autoconf.c hp.c ht.c mba.c mt.c rk.c tm.c ts.c up.c uba.c uda.c DRIVERS=autoconf.o hp.o ht.o mba.o mt.o rk.o tm.o ts.o up.o uba.o uda.o ALL= /usr/lib/libsa.a srt0.o boot cat ls icheck mkfs restor \ tpicheck tpmkfs tprestor sboot all: ${ALL} /usr/lib/libsa.a: sys.o conf.o ${DRIVERS} prf.o machdep.o ar crv ${DESTDIR}/usr/lib/libsa.a $? ranlib ${DESTDIR}/usr/lib/libsa.a ${DRIVERS}: cc -c -S ${COPTS} $*.c /lib/c2 -i $*.s | as -o $*.o rm $*.s boot: boot.o bootconf.o relsrt0.o ${DESTDIR}/usr/lib/libsa.a ld -N -T ${RELOC} relsrt0.o boot.o bootconf.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=boot ibs=32 skip=1; rm b.out bootconf.o: conf.c cp conf.c bootconf.c cc -c ${COPTS} -DBOOT bootconf.c rm bootconf.c sboot: boot.c relsrt0.o ${DESTDIR}/usr/lib/libsa.a cp boot.c sboot.c; chmod +w sboot.c cc -c -O -DJUSTASK sboot.c rm sboot.c ld -N -T ${RELOC} relsrt0.o sboot.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=sboot ibs=32 skip=1; rm b.out cat: cat.o srt0.o ${DESTDIR}/usr/lib/libsa.a ld -N srt0.o cat.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=cat ibs=32 skip=1; rm b.out ls: ls.o srt0.o ${DESTDIR}/usr/lib/libsa.a ld -N srt0.o ls.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=ls ibs=32 skip=1; rm b.out imptst: imptst.o srt0.o ld -N srt0.o imptst.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=imptst ibs=32 skip=1; rm b.out mkfs.o: /usr/src/cmd/mkfs.c cc ${CFLAGS} -c /usr/src/cmd/mkfs.c mkfs: mkfs.o srt0.o ${DESTDIR}/usr/lib/libsa.a ld -N srt0.o mkfs.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=mkfs ibs=32 skip=1; rm b.out restor.o: /usr/src/cmd/restor.c cc ${CFLAGS} -c /usr/src/cmd/restor.c restor: restor.o srt0.o ${DESTDIR}/usr/lib/libsa.a ld -N srt0.o restor.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=restor ibs=32 skip=1; rm b.out icheck.o: /usr/src/cmd/icheck.c cc ${CFLAGS} -c /usr/src/cmd/icheck.c icheck: icheck.o srt0.o ${DESTDIR}/usr/lib/libsa.a ld -N srt0.o icheck.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=icheck ibs=32 skip=1; rm b.out tpmkfs: mkfs.o tpsrt0.o ${DESTDIR}/usr/lib/libsa.a ld -N tpsrt0.o mkfs.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=tpmkfs ibs=32 skip=1; rm b.out tprestor: restor.o tpsrt0.o ${DESTDIR}/usr/lib/libsa.a ld -N tpsrt0.o restor.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=tprestor ibs=32 skip=1; rm b.out tpicheck: icheck.o tpsrt0.o ${DESTDIR}/usr/lib/libsa.a ld -N tpsrt0.o icheck.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=tpicheck ibs=32 skip=1; rm b.out srt0.o: srt0.c cc -E -DRELOC=0x${RELOC} ${COPTS} srt0.c | as -o srt0.o tpsrt0.o: srt0.c cc -E -DRELOC=0x${RELOC} -DTP ${COPTS} srt0.c | as -o tpsrt0.o relsrt0.o: srt0.c cc -E -DRELOC=0x${RELOC} -DREL ${COPTS} srt0.c | as -o relsrt0.o print: @pr -f makefile @/usr/ucb/ls -l | pr -f @pr -f *.h *.c clean: rm -f *.o *.exe *.i rm -f a.out b.out boot cat ls icheck mkfs restor rpboot \ tpicheck tpmkfs tprestor sboot lint: lint ${COPTS} -hxbn boot.c ${SRCS} | \ grep -v 'possible pointer alignment' | \ grep -v 'struct/union .* never defined' install: ${ALL} cp tprestor $$DESTDIR/tp/restor cp tpicheck $$DESTDIR/tp/icheck cp tpmkfs $$DESTDIR/tp/mkfs cp sboot $$DESTDIR/tp/boot cp boot icheck mkfs restor cat ls ../floppy cp boot $$DESTDIR @ikd/ $Bmps/ijj /* ht.c 4.6 81/12/01 */ /* * TM03/TU?? tape driver */ #include "../h/htreg.h" #include "../h/param.h" #include "../h/inode.h" #include "../h/pte.h" #include "../h/mbareg.h" #include "saio.h" #include "savax.h" short httypes[] = { MBDT_TM03, MBDT_TE16, MBDT_TU45, MBDT_TU77, 0 }; #define MASKREG(reg) ((reg)&0xffff) htopen(io) register struct iob *io; { register int skip; register struct htdevice *htaddr = (struct htdevice *)mbadrv(io->i_unit); int i; for (i = 0; httypes[i]; i++) if (httypes[i] == (htaddr->htdt&MBDT_TYPE)) goto found; _stop("not a tape\n"); found: mbainit(UNITTOMBA(io->i_unit)); htaddr->htcs1 = HT_DCLR|HT_GO; htstrategy(io, HT_REW); skip = io->i_boff; while (skip--) { io->i_cc = -1; while (htstrategy(io, HT_SFORW)) ; DELAY(65536); htstrategy(io, HT_SENSE); } } htclose(io) register struct iob *io; { htstrategy(io, HT_REW); } htstrategy(io, func) register struct iob *io; int func; { register int den, errcnt, ds; int er; short fc; register struct htde((vice *htaddr = (struct htdevice *)mbadrv(io->i_unit); errcnt = 0; retry: den = HTTC_1600BPI|HTTC_PDP11; htquiet(htaddr); htaddr->htcs1 = HT_DCLR|HT_GO; htaddr->httc = den; htaddr->htfc = -io->i_cc; if (func == HT_SREV) { htaddr->htfc = -1; htaddr->htcs1 = HT_SREV|HT_GO; return (0); } if (func == READ || func == WRITE) mbastart(io, func); else htaddr->htcs1 = func|HT_GO; htquiet(htaddr); ds = htaddr->htds; er = htaddr->hter; if (ds & HTDS_TM) { htaddr->htcs1 = HT_DCLR|HT_GO; return (0); } if (ds & HTDS_ERR) { htaddr->htcs1 = HT_DCLR|HT_GO; if ((er & HTER_CORCRC) == 0) { printf("ht error: ds=%b, er=%b\n", MASKREG(ds), HTDS_BITS, MASKREG(er), HTER_BITS); if (errcnt == 10) { printf("ht: unrecovered error\n"); return (-1); } errcnt++; htstrategy(io, HT_SREV); goto retry; } } if (errcnt) printf("ht: recovered by retry\n"); fc = htaddr->htfc; return (io->i_cc+fc); } htquiet(htaddr) register struct htdevice *htaddr; { register int s; do s = htaddr->htds; while ((s & HTDS_DRY) == 0); } @ikcV$ "%/i[Q6i /* uba.c 4.5 81/11/12 */ #include "../h/param.h" #include "../h/inode.h" #include "../h/cpu.h" #include "../h/pte.h" #include "../h/ubareg.h" #include "../h/vm.h" #include "saio.h" #include "savax.h" /* * Note... this routine does not * really allocate; unless bdp == 2 * you always get the same space. * When bdp == 2 you get some other space. */ ubasetup(io, bdp) register struct iob *io; int bdp; { int npf; unsigned v; register struct pte *pte; int o, temp, reg; static int lastreg = 128+64; v = btop(io->i_ma); o = (int)io->i_ma & PGOFSET; npf = btoc(io->i_cc + o) +1; if (bdp == 2) { reg = lastreg; lastreg += npf; bdp = 0; } else reg = 0; pte = &ubauba(io->i_unit)->uba_map[reg]; temp = (bdp << 21) | UBAMR_MRV; if (bdp && (o & 01)) temp |= UBAMR_BO; v &= 0x1fffff; /* drop to physical addr */ while (--npf != 0) *(int *)pte++ = v++ | temp; *(int *)pte++ = 0; return ((bdp << 28) | (reg << 9) | o); } ubafree(io, mr) struct iob *io; int mr; { register int bdp; bdp = (mr >> 28) & 0x0f; if (bdp == 0) return; switch (cpu) { case VAX_780: ubauba(io->i_unit)->uba_dpr[bdp] |= UBADPR_BNE; break; case VAX_750: ubauba(io->i_unit)->uba_dpr[bdp] |= UBADPR_PURGE|UBADPR_NXM|UBADPR_UCE; break; case VAX_7ZZ: break; } } @ikzqp&i=66i ! ! BOOTSTRAP BY BOOT() SYSCALL ! GO MULTI-USER AFTER CHECKING; BOOT FROM DEFAULT DEVICE ! SET DEF HEX SET DEF LONG SET REL:0 HALT UNJAM INIT LOAD BOOT D/G B 0 ! BOOT PARAMETERS: MULTI USER AFTER CHECK D/G A 0 ! DEV TO BOOT FROM (0=HP, 2=UP, 3=HK) START 2 @ikW+,:,: /* * Structure for stty and gtty system calls. */ #ifndef _IOCTL_ #include #endif struct sgttyb { char sg_ispeed; /* input speed */ char sg_ospeed; /* output speed */ char sg_erase; /* erase character */ char sg_kill; /* kill character */ short sg_flags; /* mode flags */ }; /* * Modes */ #define TANDEM 01 #define CBREAK 02 #define LCASE 04 #define ECHO 010 #define CRMOD 020 #define RAW 040 #define ODDP 0100 #define EVENP 0200 #define ANYP 0300 #define NLDELAY 001400 #define TBDELAY 006000 #define XTABS 06000 #define CRDELAY 030000 #define VTDELAY 040000 #define BSDELAY 0100000 #define ALLDELAY 0177400 /* * Delay algorithms */ #define CR0 0 #define CR1 010000 #define CR2 020000 #define CR3 030000 #define NL0 0 #define NL1 000400 #define NL2 001000 #define NL3 001400 #define TAB0 0 #define TAB1 002000 #define TAB2 004000 #define FF0 0 #define FF1 040000 #define BS0 0 #define BS1 0100000 /* * Speeds */ #define B0 0 #define B50 1 #define B75 2 #define B110 3 #define B134 4 #define B150 5 #define B200 6 #define B300 7 #define B600 8 #define B1200 9 #define B1800 10 #define B2400 11 #define B4800 12 #define B9600 13 #define EXTA 14 #define EXTB 15 ((@ik ,!$'*hfȪ   $ ^Юn PPՀPpPP PDЬp&o&Ьa&Ϭ  \&U&2PxL&P?&P`[?&k(k)kPZ[JrPJϴPZJ[P`[%2P^Ь[Ь Zϕ#[P(ϐ#ZPZ P[ íPY Z[ρPYЬPP$*061J#P3Y!PYYY YYPPYY#P^ #ݬSP#ݬ CP "X ݬB Pݬ 6 PЬPP&-4;BiP[ݭ"[ [P­ĭƭǭPĭPPЬPP_PRφ"ݬ`Px"ݬPP\i"[+Z"ݬ 9PL"ݬ )P="[Ь [[P("ݬ P"ݬPЬ["ݬ P"ݬ P![ݬ P[ݬ  PZ֬[ЬY֬ZPZPYPЬ[ZZPYZό!Yϕ YP[4Z(KJ[[h!PYPd YPZJ[KB!PݬݬAP/!ϜP[P& Ϣ# # P~zP[#[[P Ь[<08.[[a# .ݬP,A#B#[[d#ZZ[ϫ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Q`aЭP׭PZ[xYPZPP[xYPZP[PP@jD ~\S^\_) P CЬ PЬPЬRRQ{RPPR PRPPP-P((%%%%% % %%%%%%%%%"%(%/%6%<%      @>%   +    !"#$%&'()*,-./    & 00;(     )@ik ,!$'*hfȪ -*[0-9]*$[0-9]*$10[0-9]*$[0-9]*$non-numeric argument%D0000000%d%d0%dToo many '\('sRE error%s yacc stack overflowsyntax error%s 0|&+-*/%:===<<=>>=!=matchsubstrlengthindex@(#)expr.y 4.2 (Berkeley) 3/9/81..&$3@ikoK? 2imhhȪ   ^Юn PPՀPpPP  P$^ԭ׬լ ݭݼ#P~ݼiPϑ l֭Ь[ZYk94 ZPQPQ0QZY[[kPP P P+P-k0YZPZPP H [ P  P@X[ݬ)PZZݬ6 %[P[ ,DNhz.=M\m-Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large Ь[ZZZPP! P^Ь[    PPYYX1XX߭~PYj~P  BЫZ֫ZPѫPѬ ZPPXPZ~=PYZkn 1mЫZ3[` 1xݏPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~hPY PP@[ [[[j Ь[Z = 8[ePZ~-PZ ݫ ԫ kZPP^߭ݬ$PPPݬݏ tݬݬݏtݬ6.}~*PYi[nk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ* [PYPƏPxPbPZx PZPPZx ~@PZZZ  PZP x PZPPjj  1xYP[Pt Zm e h kY R k[P Ь[[ZZZ9 jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP @jp~\S^\7UPLЬ7PЬPЬRRQ{RPPR PRPP mknod@(#)badsect.c 4.2 (Berkeley) 81/05/11Unknown error: # @ikR;l ,:,: ((#ifndef NSIG #define NSIG 32 #define SIGHUP 1 /* hangup */ #define SIGINT 2 /* interrupt */ #define SIGQUIT 3 /* quit */ #define SIGILL 4 /* illegal instruction (not reset when caught) */ #define ILL_RESAD_FAULT 0x0 /* reserved addressing fault */ #define ILL_PRIVIN_FAULT 0x1 /* privileged instruction fault */ #define ILL_RESOP_FAULT 0x2 /* reserved operand fault */ /* CHME, CHMS, CHMU are not yet given back to users reasonably */ #define SIGTRAP 5 /* trace trap (not reset when caught) */ #define SIGIOT 6 /* IOT instruction */ #define SIGEMT 7 /* EMT instruction */ #define SIGFPE 8 /* floating point exception */ #define FPE_INTOVF_TRAP 0x1 /* integer overflow */ #define FPE_INTDIV_TRAP 0x2 /* integer divide by zero */ #define FPE_FLTOVF_TRAP 0x3 /* floating overflow */ #define FPE_FLTDIV_TRAP 0x4 /* floating/decimal divide by zero */ #define FPE_FLTUND_TRAP 0x5 /* floating underflow */ #define FPE_DECOVF_TRAP 0x6 /* decimal overflow */ #define FPE_SUBRNG_TRAP 0x7 /* subscript out of range */ #define FPE_FLTOVF_FAULT 0x8 /* floating overflow fault */ #define FPE_FLTDIV_FAULT 0x9 /* divide by zero floating fault */ #define FPE_FLTUND_FAULT 0xa /* floating underflow fault */ #define SIGKILL 9 /* kill (cannot be caught or ignored) */ #define SIGBUS 10 /* bus error */ #define SIGSEGV 11 /* segmentation violation */ #define SIGSYS 12 /* bad argument to system call */ #define SIGPIPE 13 /* write on a pipe with no one to read it */ #define SIGALRM 14 /* alarm clock */ #define SIGTERM 15 /* software termination signal from kill */ #define SIGSTOP 17 /* sendable stop signal not from tty */ #define SIGTSTP 18 /* stop signal from tty */ #define SIGCONT 19 /* continue a stopped process */ #define SIGCHLD 20 /* to parent on child stop or exit */ #define SIGTTIN 21 /* to readers pgrp upon background tty read */ #define SIGTTOU 22 /* like TTIN for output if (tp->t_local<OSTOP) */ #define SIGTINT 23 /* to pgrp on every input character if LINTRUP */ #define SIGXCPU 24 /* exceeded CPU time limit */ #define SIGXFSZ 25 /* exceeded file size limit */ #ifndef KERNEL int (*signal())(); #endif #define BADSIG (int (*)())-1 #define SIG_DFL (int (*)())0 #define SIG_IGN (int (*)())1 #ifdef KERNEL #define SIG_CATCH (int (*)())2 #endif #define SIG_HOLD (int (*)())3 #define SIGISDEFER(x) (((int)(x) & 1) != 0) #define SIGUNDEFER(x) (int (*)())((int)(x) &~ 1) #define DEFERSIG(x) (int (*)())((int)(x) | 1) #define SIGNUMMASK 0377 /* to extract pure signal number */ #define SIGDOPAUSE 0400 /* do pause after setting action */ #define SIGDORTI 01000 /* do ret+rti after setting action */ #endif @ik)X  ;=&i6i /* * UP disk boot program to load "/boot" from * a UNIX filesystem (starting at block 1 on pack on * drive 0) into low core and to execute that file. * * This program can only read regular small 1k byte (3bsd+) files * from the root of a UNIX filesystem. */ .set BLKSIZ,1024 /* file system block size */ .set RELOC,0x50000 .set INOSIZ,64 /* no. bytes/inode entry */ .set INOBLK,BLKSIZ/INOSIZ /* no. inodes/disc block */ .set INOMSK,0xfffffff0 /* changes with inode size */ .set NAMSIZ,14 /* bytes in directory name */ .set ENTADR,024 /* offset to entry addr in a.out */ .set DIRSIZ,16 /* size of directory entry, bytes */ .set ROOTINO,2 /* root dir inode no. */ .set NBOO,1 .set NSUP,1 .set SID,62 /* system ID register */ /* UBA registers */ .set UBA_CNFGR,0 /* UBA configuration register */ .set UBA_CR,4 /* UBA control register offset */ .set UBA_MAP,0x800 /* UBA offset to map reg's */ .set UBAinit,1 /* UBA init bit in UBA control reg */ .set pUBIC,16 /* Unibus init complete */ /* UP registers and bits */ .set UP,0176700-0160000 /* address of UP controller */ .set UP_cs1,UP+0 /* control and status */ .set UP_wc,UP+2 /* word count */ .set UP_ba,UP+4 /* bus address */ .set UP_da,UP+6 /* disk address */ .set UP_cs2,UP+010 /* cs2 register */ .set UP_of,UP+032 /* offset register */ .set UP_dc,UP+034 /* desired cylinder */ .set UP_hr,UP+036 /* holding register */ .set UPHR_MAXTRAK,0100030 .set UPSEC,32 .set UP_GO,1 /* go bit */ .set UP_PACK,022 /* pack acknowledge */ .set UP_DCLR,010 /* drive clear */ .set UP_PRESET,020 /* read-in-preset */ .set UP_RCOM,070 /* read command */ .set UPCS2_CLR,040 .set UP_pRDY,7 /* position of ready bit */ .set UP_pERR,15 /* position of error bit */ .set UP_FMT22,010000 init: .word 0 /* entry mask for dec monitor */ nop;nop;nop;nop;nop;nop;nop;nop /* some no-ops for 750 boot to skip */ nop;nop; /* get cpu type and find the first uba */ mfpr $SID,r0 extzv $24,$8,r0,r0 /* get cpu type */ ashl $2,r0,r1 movab physUBA,r2 /* get physUBA[cpu] */ addl2 r1,r2 movl (r2),r9 movab physUMEM,r2 /* get physUMEM[cpu] */ addl2 r1,r2 movl (r2),r10 /* if 780, init uba */ cmpl r0,$1 bneq 2f movl $UBAinit,UBA_CR(r9) 1: bbc $pUBIC,UBA_CNFGR(r9),1b 2: movl $5000000,r0 1: sobgtr r0,1b /* init up, set vv in drive 0; if any errors, give up */ movw $UPCS2_CLR,UP_cs2(r10) movw $UP_DCLR+UP_GO,UP_cs1(r10) movw $UP_PRESET+UP_GO,UP_cs1(r10) movw $UP_FMT22,UP_of(r10) 1: movw UP_cs1(r10),r0 bbc $UP_pRDY,r0,1b /* relocate to high core */ start: movl r5,r11 /* boot flags */ movl $RELOC,sp moval init,r6 movc3 $end,(r6),(sp) jmp *$RELOC+start2 /* now running relocated */ start2: /* determine tracks; for now must get 10 or 19, otw assume 19 */ /* always assume 32 sectors for now; this all handles fuji's and 300mbs */ movw $UPHR_MAXTRAK,UP_hr(r10) movw UP_hr(r10),r0 incl r0 movw r0,*$uptrk 1: mull3 $32,r0,*$upst /* search for ``boot'' in root inode */ movl $names+RELOC,r6 movzbl $ROOTINO,r0 nxti: clrw *$bno bsbw iget tstb (r6) beql getfil get1b: bsbw rmblk beql start2 movl $buf,r7 nxtent: tstw (r7) beql dirchk cmpc3 $NAMSIZ,(r6),2(r7) bneq dirchk movzwl (r7),r0 addl2 $NAMSIZ,r6 brb nxti dirchk: acbl $buf+BLKSIZ-1,$DIRSIZ,r7,nxtent brb get1b /* found inode for desired file... read it in */ getfil: clrl bufptr getlop: bsbb rmblk beql clear addl2 $BLKSIZ,bufptr brb getlop clear: movl *$size,r3 clrcor: clrq (r3) acbl $RELOC,$8,r3,clrcor /* run loaded program */ movl $2,r10 /* major("/dev/up0a") */ calls $0,*$0 brw start2 /* iget: get inode block whose # is in r0 */ iget: addl3 $(INOBLK*(NBOO+NSUP))-1,r0,r8 divl3 $INOBLK,r8,r4 bsbw rblk bicl2 $INOMSK,r8 mull2 $INOSIZ,r8 addl2 $buf,r8 movc3 $time-inode,(r8),*$inode rsb /* rmblk: read in bno into addr */ rmblk: movzwl *$bno,r0 addw2 $3,*$bno addl2 $addr,r0 /* this boot assumes only small files (<=20 blocks) */ extzv $0,$24,(r0),r4 bneq rblk rsb /* rblk: read disk block whose number is in r4 */ rblk: mull2 $BLKSIZ/512,r4 clrl r5 ediv *$upst,r4,r0,r1 movw r0,UP_dc(r10) clrl r2 ediv $UPSEC,r1,r1,r0 insv r1,$8,$5,r0 movw r0,UP_da(r10) movw $-BLKSIZ/2,UP_wc(r10) ashl $-9,bufptr,r0 bisl3 $0x80000000,r0,UBA_MAP(r9) incl r0 bisl3 $0x80000000,r0,UBA_MAP+4(r9) clrw UP_ba(r10) movw $UP_RCOM+UP_GO,UP_cs1(r10) uprdy: movw UP_cs1(r10),r0 bbc $UP_pRDY,r0,uprdy rsb bufptr: .long buf names: .byte 'b,'o,'o,'t,0,0,0,0,0,0,0,0,0,0 .byte 0 physUBA: .long 0 .long 0x20006000 /* 11/780 */ .long 0xf30000 /* 11/750 */ .long 0xf26000 /* 11/7ZZ */ physUMEM: .long 0 .long 0x2013e000 /* 11/780 */ .long 0xffe000 /* 11/750 */ .long 0xffe000 /* 11/7ZZ */ end: .set buf,RELOC-1536 .set inode,RELOC-512 .set mode,inode .set nlink,mode+2 .set uid,nlink+2 .set gid,uid+2 .set size,gid+2 .set addr,size+4 .set time,addr+40 .set bno,time+12 .set uptrk,bno+4 .set upst,uptrk+4 @i%k9<&i6i ((/* * Prototype toggle in bootstrap code for ts type tapes. * If on anything but a 780 with the drive on uba0 * this will have to be repaired by patching uba and umem. */ .set UBA0,0x20006000 .set UMEM0,0x2013e000 .set UBA_MAP,0x800 .set TSADDR,0772520-0760000 start: movl uba,r10 movl mrv,UBA_MAP(r10) addl3 mrv,$1,UBA_MAP+4(r10) addl3 umem,$TSADDR,r11 clrw 2(r11) 1: tstb 2(r11) bgeq 1b movw $0x200+setchr,(r11) 1: tstb 2(r11) bgeq 1b movw $0x200+read,(r11) halt .align 2 uba: .long UBA0 umem: .long UMEM0 mrv: .long 0x80000000 setchr: .word 0xc004,0x200+char,0,0x8 # set characteristics command char: .word 0x200+status,0,0xe,0 # characteristics read: .word 0xc001,0,0,0x200 # read command status: @i'kĤᤁ<&iƑ'6i /* * VAX tape boot block for distribution tapes * works on unibus tm03 * * reads a program from a tp directory on a tape and executes it * program must be stripped of the header and is loaded ``bits as is'' * you can return to this loader via ``ret'' as you are called ``calls $0,ent'' */ .set RELOC,0x70000 /* a.out defines */ .set HDRSIZ,040 /* size of file header for VAX */ .set MAGIC,0410 /* file type id in header */ .set TSIZ,4 /* text size */ .set DSIZ,8 /* data size */ .set BSIZ,12 /* bss size */ .set TENT,024 /* task header entry loc */ /* tp directory definitions */ .set FILSIZ,38 /* tp direc offset for file size */ .set BNUM,44 /* tp dir offset for start block no. */ .set ENTSIZ,64 /* size of 1 TP dir entry, bytes */ .set PTHSIZ,32 /* size of TP path name, bytes */ .set BLKSIZ,512 /* tape block size, bytes */ .set NUMDIR,24 /* no. of dir blocks on tape */ .set ENTBLK,8 /* no. of dir entries per tape block */ /* processor registers and bits */ .set RXCS,32 .set RXDB,33 .set TXCS,34 .set TXDB,35 .set RXCS_DONE,0x80 .set TXCS_RDY,0x80 .set TXCS_pr,7 /* bit position of TXCS ready bit */ .set RXCS_pd,7 /* bit position of RXCS done bit */ /* UBA registers */ .set UBA_DPR1,68 .set UBA_MAP,2048 .set BNE,0x80000000 .set MRV,0x80000000 .set MR_BDP1,0x200000 /* TM UBA registers */ .set TMER,0 .set TMCS,2 .set TMBC,4 .set TMBA,6 /* TM commands and bits */ .set GO,1 .set TM_REW,016 .set TM_RCOM,02 .set TM_SREV,012 .set TM_DCLR,010000 .set TM_crdy,7 .set TM_gapsd,3 .set TMDENS,0 /* 1600 bpi */ /* local stack variables */ .set tapa,-4 /* desired tape addr */ .set mtapa,-8 /* current tape addr */ .set name,-8-PTHSIZ /* operator-typed file name */ /* register usage */ .set rUBA,r10 .set rTM,r11 /* ===== */ /* initialization */ init: movl $RELOC,fp /* core loc to which to move this program */ addl3 $name,fp,sp /* set stack pointer; leave room for locals */ clrl r0 1: movc3 $end,(r0),(fp) /* move boot up to relocated position */ jmp start+RELOC start: bsbw rew /* rewind input tape */ movab name(fp),r4 /* start of filename storage */ movzbl $'=,r0 /* prompt character */ bsbw putc /* output char to main console */ /* read in a file name */ movl r4,r1 /* loc at which to store file name */ nxtc: bsbw getc /* get input char's in file name */ cmpb r0,$012 /* terminator ? */ beql nullc movb r0,(r1)+ brb nxtc nullc: subl3 r4,r1,r9 /* size of path name */ beql start /* dumb operator */ clrb (r1)+ incl r9 /* user-specified TP filename has been stored at name(fp) */ /* read in entire tp directory contents into low core */ dirred: movl $8,tapa(fp) /* tp directory starts at block 8 */ movl $(NUMDIR*BLKSIZ),r6 /* no. bytes in total dir */ bsbw taper /* read no. bytes indicated */ /* search entire directory for user-specified file name */ clrl r5 /* dir buff loc = 0 */ nxtdir: cmpc3 r9,(r5),(r4) /* see if dir entry matches filename */ beql fndfil /* found match */ acbl $NUMDIR*BLKSIZ-1,$ENTSIZ,r5,nxtdir /* see if done with tp dir */ brw start /* entry not in directory; start over */ /* found desired tp dir entry */ fndfil: movzwl BNUM(r5),tapa(fp) /* start block no., 2 bytes */ addl2 $7,tapa(fp) /* skip 7 boot blocks */ movzwl FILSIZ(r5),r6 /* low 2 bytes file size */ insv FILSIZ-1(r5),$16,$8,r6 /* file size, high byte */ cmpl r6,$RELOC-512 /* check if file fits below stack */ blss filok /* file o.k. */ brw start /* file too large */ /* time to read in desired file from tape */ filok: movl r6,r7 /* save r6 */ bsbb taper bsbw rew /* clear core */ subl3 r7,$RELOC-4,r0 /* no. bytes to clear */ 1: clrb (r7)+ sobgtr r0,1b /* time to jump to start of file & execute */ addl3 $20,fp,ap clrl r5 calls $0,(r5) brw start /* taper: movcTAPE (r6),tapa(fp),0 */ rew2: bsbb rew /* beginning of tape */ taper0: bsbb rrec /* advance 1 block; never want blk 0 */ taper: clrl r0 /* page no. */ cmpl mtapa(fp),tapa(fp) /* current position .vs. desired */ bgtr rew2 blss taper0 1: bsbb rrec acbl $1,$-BLKSIZ,r6,1b rsb /* rew: rewind the tape */ rew: clrl mtapa(fp) /* current position */ movw $TM_REW+TMDENS+GO,TMCS(%rTM) rsb /* rrec: read 1 block from mag tape into page (r0) */ rrec: /* pushl r0; movzbl $'r,r0; bsbw putc; movl (sp)+,r0; */ jsb tmquiet movw $-BLKSIZ,TMBC(%rTM) bisl3 $MRV|MR_BDP1,r0,UBA_MAP(%rUBA) movw $0,TMBA(%rTM) movw $TM_RCOM+TMDENS+GO,TMCS(%rTM) jsb tmquiet bisl2 $BNE,UBA_DPR1(%rUBA) tstw TMER(%rTM) jgeq 2f mnegw $1,TMBC(%rTM) movw $TM_SREV+TMDENS+GO,TMCS(%rTM) jmp rrec 2: incl r0 /* next page no. */ incl mtapa(fp) /* mag tape block position */ rsb getc: mfpr $RXCS,r0 bbc $RXCS_pd,r0,getc /* receiver ready ? */ mfpr $RXDB,r0 extzv $0,$7,r0,r0 cmpb r0,$015 bneq putc bsbb putc movb $0,r0 bsbb putc movb $012,r0 putc: mfpr $TXCS,r2 bbc $TXCS_pr,r2,putc /* transmitter ready ? */ extzv $0,$7,r0,r0 mtpr r0,$TXDB rsb tmquiet: movw TMCS(%rTM),r2 bbc $TM_crdy,r2,tmquiet 1: movw TMER(%rTM),r2 blbc r2,1b /* low bit == TUR */ bbs $TM_gapsd,r2,1b rsb end: @i-kJa<&iH*6i /* * RK07 disk boot program to load "/boot" from * a UNIX filesystem (starting at block 1 on pack on * drive 0) into low core and to execute that file. * * This program can only read regular small 1k byte (3bsd+) files * from the root of a UNIX filesystem. */ .set BLKSIZ,1024 /* file system block size */ .set RELOC,0x50000 .set INOSIZ,64 /* no. bytes/inode entry */ .set INOBLK,BLKSIZ/INOSIZ /* no. inodes/disc block */ .set INOMSK,0xfffffff0 /* changes with inode size */ .set NAMSIZ,14 /* bytes in directory name */ .set ENTADR,024 /* offset to entry addr in a.out */ .set DIRSIZ,16 /* size of directory entry, bytes */ .set ROOTINO,2 /* root dir inode no. */ .set NBOO,1 .set NSUP,1 .set SID,62 /* system ID register */ /* UBA registers */ .set UBA_CNFGR,0 /* UBA configuration register */ .set UBA_CR,4 /* UBA control register offset */ .set UBA_MAP,0x800 /* UBA offset to map reg's */ .set UBAinit,1 /* UBA init bit in UBA control reg */ .set pUBIC,16 /* Unibus init complete */ /* RK611 registers and bits */ .set HK,0177440-0160000 /* address of RK611 */ .set HK_cs1,HK+0 /* control and status */ .set HK_wc,HK+2 /* word count */ .set HK_ba,HK+4 /* bus address */ .set HK_da,HK+6 /* disk address */ .set HK_dc,HK+020 /* desired cylinder */ .set HKSECT,22 .set HKTRAC,3 .set HKST,HKSECT*HKTRAC .set HK_GO,1 /* go bit */ .set HK_PACK,2 /* pack acknowledge */ .set HK_RCOM,020 /* read command */ .set HK_SEL7,02000 /* select RK07 disk */ .set HK_pRDY,7 /* position of ready bit */ .set HK_pERR,15 /* position of error bit */ init: /* r9 UBA address */ /* r10 umem addr */ .word 0 /* entry mask for dec monitor */ nop;nop;nop;nop;nop;nop;nop;nop /* some no-ops for 750 boot to skip */ nop;nop; /* get cpu type and find the first uba */ mfpr $SID,r0 extzv $24,$8,r0,r0 /* get cpu type */ ashl $2,r0,r1 movab physUBA,r2 /* get physUBA[cpu] */ addl2 r1,r2 movl (r2),r9 movab physUMEM,r2 /* get physUMEM[cpu] */ addl2 r1,r2 movl (r2),r10 /* if 780, init ub((a */ cmpl r0,$1 bneq 2f movl $UBAinit,UBA_CR(r9) 1: bbc $pUBIC,UBA_CNFGR(r9),1b 2: /* init rk611, set vv in drive 0; if any errors, give up */ movw $HK_SEL7+HK_GO,HK_cs1(r10) 1: movw HK_cs1(r10),r0 bbc $HK_pRDY,r0,1b bbs $HK_pERR,r0,9f movw $HK_SEL7+HK_PACK+HK_GO,HK_cs1(r10) 1: movw HK_cs1(r10),r0 bbc $HK_pRDY,r0,1b bbc $HK_pERR,r0,start 9: halt /* relocate to high core */ start: movl r5,r11 /* boot flags */ movl $RELOC,sp moval init,r6 movc3 $end,(r6),(sp) jmp *$RELOC+start2 /* now running relocated */ /* search for ``boot'' in root inode */ start2: movl $names+RELOC,r6 movzbl $ROOTINO,r0 nxti: clrw *$bno bsbw iget tstb (r6) beql getfil get1b: bsbw rmblk beql start2 movl $buf,r7 nxtent: tstw (r7) beql dirchk cmpc3 $NAMSIZ,(r6),2(r7) bneq dirchk movzwl (r7),r0 addl2 $NAMSIZ,r6 brb nxti dirchk: acbl $buf+BLKSIZ-1,$DIRSIZ,r7,nxtent brb get1b /* found inode for desired file... read it in */ getfil: clrl bufptr getlop: bsbb rmblk beql clear addl2 $BLKSIZ,bufptr brb getlop clear: movl *$size,r3 clrcor: clrq (r3) acbl $RELOC,$8,r3,clrcor /* run loaded program */ movl $3,r10 /* major("/dev/hk0a") */ calls $0,*$0 brw start2 /* iget: get inode block whose # is in r0 */ iget: addl3 $(INOBLK*(NBOO+NSUP))-1,r0,r8 divl3 $INOBLK,r8,r4 bsbw rblk bicl2 $INOMSK,r8 mull2 $INOSIZ,r8 addl2 $buf,r8 movc3 $time-inode,(r8),*$inode rsb /* rmblk: read in bno into addr */ rmblk: movzwl *$bno,r0 addw2 $3,*$bno addl2 $addr,r0 /* this boot assumes only small files (<=20 blocks) */ extzv $0,$24,(r0),r4 bneq rblk rsb /* rblk: read disk block whose number is in r4 */ rblk: mull2 $BLKSIZ/512,r4 clrl r5 ediv $HKST,r4,r0,r1 movw r0,HK_dc(r10) clrl r2 ediv $HKSECT,r1,r1,r0 insv r1,$8,$3,r0 movw r0,HK_da(r10) movw $-BLKSIZ/2,HK_wc(r10) ashl $-9,bufptr,r0 bisl3 $0x80000000,r0,UBA_MAP(r9) incl r0 bisl3 $0x80000000,r0,UBA_MAP+4(r9) clrw HK_ba(r10) movw $HK_SEL7+HK_RCOM+HK_GO,HK_cs1(r10) hkrdy: movw HK_cs1(r10),r0 bbc $HK_pRDY,r0,hkrdy bbs $HK_pERR,r0,hkerr bicpsw $2 rsb hkerr: halt /* ungraceful */ bufptr: .long buf names: .byte 'b,'o,'o,'t,0,0,0,0,0,0,0,0,0,0 .byte 0 physUBA: .long 0 .long 0x20006000 /* 11/780 */ .long 0xf30000 /* 11/750 */ .long 0xf26000 /* 11/7ZZ */ physUMEM: .long 0 .long 0x2013e000 /* 11/780 */ .long 0xffe000 /* 11/750 */ .long 0xffe000 /* 11/7ZZ */ end: .set buf,RELOC-1536 .set inode,RELOC-512 .set mode,inode .set nlink,mode+2 .set uid,nlink+2 .set gid,uid+2 .set size,gid+2 .set addr,size+4 .set time,addr+40 .set bno,time+12 @i3kfU<&i6i /* * RP??/RM?? disk boot program to load "/boot" from * a UNIX filesystem (starting at block 1 on pack on * drive 0) into low core and to execute that file. * This program can only read regular small version 7 files * from the root of a UNIX filesystem. */ .set BLKSIZ,1024 /* file system block size */ .set RELOC,0x70000 .set HDRSIZ,040 .set INOSIZ,64 /* no. bytes/inode entry */ .set INOBLK,BLKSIZ/INOSIZ /* no. inodes/disc block */ .set INOMSK,0xfffffff0 /* changes with inode size */ .set NAMSIZ,14 /* bytes in directory name */ .set ENTADR,024 /* offset to entry addr in a.out */ .set DIRSIZ,16 /* size of directory entry, bytes */ .set ROOTINO,2 /* root dir inode no. */ .set NBOO,1 .set NSUP,1 /* MBA registers */ .set M_cr,4 /* MBA control reg */ .set M_var,12 /* MBA virt addr reg */ .set M_bc,16 /* MBA byte count reg */ .set M_map,0x800 /* start of MBA map reg's */ .set MBAinit,1 /* MBA init bit in MBA control reg */ /* Drive information */ .set RP6TRK,19 .set RP6SEC,22 .set RM3SEC,32 .set RM3TRK,5 .set RM5SEC,32 .set RM5TRK,19 .set RM80SEC,31 .set RM80TRK,14 .set RP7TRK,32 .set RP7SEC,50 .set RP6typ,022 .set RM3typ,024 .set RM5typ,027 .set RM80typ,026 .set RP7typ,042 .set RP,0x400 /* start of drive registers */ .set RP_cr,RP+0 /* control status register */ .set RP_sr,RP+4 /* drive status reg */ .set RP_stk,RP+0x14 /* desired track/sector reg */ .set RP_dt,RP+0x18 /* drive type reg */ .set RP_off,RP+0x24 /* RP offset reg */ .set RP_cyl,RP+0x28 /* desired cyl reg */ /* RP06 function codes, status bits */ .set RP_GO,1 /* go */ .set RP_RED,070 /* read */ .set RP_DC,010 /* drive clear */ .set RP_RIP,020 /* read in preset */ .set RP_FMT,0x1000 /* format 22 */ .set RP_MOL,0x1000 /* medium on line */ .set RP_DRY,0200 /* drive ready */ .set RP_ERR,040000 /* composite error */ .set RP_pDRY,7 /* bit position of RP_DRY */ .set RP_pERR,14 /* bit position of RP_ERR */ init: .word 0 /* entry mask for DEC monitor */ nop;nop;nop;nop;nop;nop;nop;nop /* some no-ops for 750 boot to skip */ nop;nop; start: movl r5,r11 movl $RELOC,sp moval init,r6 movc3 $end,(r6),(sp) jmp *$RELOC+start1 /* running relocated */ start1: /* get cpu type */ .set SID,0x3e mfpr $SID,r0 extzv $24,$8,r0,r0 ashl $2,r0,r1 /* get mba location and init it */ moval physMBA,r2 addl3 r1,r2,r3 movl (r3),r9 movl $MBAinit,M_cr(r9) /* read-in-preset the drive and set format */ movl $RP_RIP+RP_GO,RP_cr(r9) movl $RP_FMT,RP_off(r9) /* get drive type */ movl RP_dt(r9),r0 cmpb $RP6typ,r0; bneq 1f; movzwl $(RP6SEC<<8)|RP6TRK,r1; 1: cmpb $RM3typ,r0; bneq 1f; movzwl $(RM3SEC<<8)|RM3TRK,r1; 1: cmpb $RM5typ,r0; bneq 1f; movzwl $(RM5SEC<<8)|RM5TRK,r1; 1: cmpb $RM80typ,r0; bneq 1f; movzwl $(RM80SEC<<8)|RM80TRK,r1; 1: cmpb $RP7typ,r0; bneq 1f; movzwl $(RP7SEC<<8)|RP7TRK,r1; 1: movzbl r1,*$rptrk ashl $-8,r1,r1 movzbl r1,*$rpsec mull3 *$rpsec,*$rptrk,*$rpst start2: /* search for ``boot'' program in root inode */ movl $names+RELOC,r6 movzbl $ROOTINO,r0 nxti: clrw *$bno bsbw iget tstb (r6) beql getfil get1b: bsbw rmblk beql start2 movl $buf,r7 nxtent: tstw (r7) beql dirchk cmpc3 $NAMSIZ,(r6),2(r7) bneq dirchk movzwl (r7),r0 addl2 $NAMSIZ,r6 brb nxti dirchk: acbl $buf+BLKSIZ-1,$DIRSIZ,r7,nxtent brb get1b /* found inode, get desired file */ getfil: clrl bufptr getlop: bsbb rmblk beql clear addl2 $BLKSIZ,bufptr brb getlop /* clear core and execute program */ clear: movl *$size,r3 clrcor: clrq (r3) acbl $RELOC,$8,r3,clrcor /* run loaded program */ clrl r10 /* major("/dev/hp0a") */ calls $0,*$0 brw start2 /* iget: get inode whose number is in r0 */ iget: addl3 $(INOBLK*(NBOO+NSUP))-1,r0,r8 divl3 $INOBLK,r8,r4 bsbw rblk bicl2 $INOMSK,r8 mull2 $INOSIZ,r8 addl2 $buf,r8 movc3 $time-inode,(r8),*$inode rsb /* rmblk: read block bno into addr */ rmblk: movzwl *$bno,r0 addw2 $3,*$bno addl2 $addr,r0 /* this boot assumes only small files (<=20 blocks) */ extzv $0,$24,(r0),r4 bneq rblk rsb /* rblk: read block in r4 */ rblk: mull2 $BLKSIZ/512,r4 clrl r5 ediv *$rpst,r4,RP_cyl(r9),r1 clrl r2 ediv *$rpsec,r1,r1,r0 insv r1,$8,$5,r0 movl r0,RP_stk(r9) movl $-BLKSIZ,M_bc(r9) ashl $-9,bufptr,r0 bisl3 $0x80000000,r0,M_map(r9) incl r0 bisl3 $0x80000000,r0,M_map+4(r9) clrl M_var(r9) movl $RP_RED+RP_GO,RP_cr(r9) rprdy: movl RP_sr(r9),r0 bbc $RP_pDRY,r0,rprdy bbs $RP_pERR,r0,rperr bicpsw $2 rsb rperr: halt bufptr: .long buf names: .byte 'b,'o,'o,'t,0,0,0,0,0,0,0,0,0,0 .byte 0 .align 2 physMBA: .long 0 .long 0x20010000 .long 0xf28000 end: .set buf,RELOC-1536 .set inode,RELOC-512 .set mode,inode .set nlink,mode+2 .set uid,nlink+2 .set gid,uid+2 .set size,gid+2 .set addr,size+4 .set time,addr+40 .set bno,time+12 .set rptrk,bno+4 .set rpsec,rptrk+4 .set rpst,rpsec+4 @i9kHx{~<&ie6i ((/* * VAX tape boot block for distribution tapes * works on unibus ts11 * * reads a program from a tp directory on a tape and executes it * program must be stripped of the header and is loaded ``bits as is'' * you can return to this loader via ``ret'' as you are called ``calls $0,ent'' */ .set RELOC,0x70000 /* a.out defines */ .set HDRSIZ,040 /* size of file header for VAX */ .set MAGIC,0410 /* file type id in header */ .set TSIZ,4 /* text size */ .set DSIZ,8 /* data size */ .set BSIZ,12 /* bss size */ .set TENT,024 /* task header entry loc */ /* tp directory definitions */ .set FILSIZ,38 /* tp direc offset for file size */ .set BNUM,44 /* tp dir offset for start block no. */ .set ENTSIZ,64 /* size of 1 TP dir entry, bytes */ .set PTHSIZ,32 /* size of TP path name, bytes */ .set BLKSIZ,512 /* tape block size, bytes */ .set NUMDIR,24 /* no. of dir blocks on tape */ .set ENTBLK,8 /* no. of dir entries per tape block */ /* processor registers and bits */ .set RXCS,32 .set RXDB,33 .set TXCS,34 .set TXDB,35 .set RXCS_DONE,0x80 .set TXCS_RDY,0x80 .set TXCS_pr,7 /* bit position of TXCS ready bit */ .set RXCS_pd,7 /* bit position of RXCS done bit */ /* UBA registers */ .set UBA_DPR1,68 .set UBA_MAP,2048 .set BNE,0x80000000 .set MRV,0x80000000 .set MR_BDP1,0x200000 /* TS UBA registers */ .set TSDB,0 .set TSSR,2 /* TS commands and bits */ .set TSA,0x200 /* page 1, ts command buffer relocation */ .set TS_ACK,0100000 /* ack packet */ .set TS_CVC,040000 /* clear volume check */ .set TS_SETCHR,4 /* set characteristics */ .set TS_READ,1 /* read */ .set TS_RETRY,01000 /* retry, or with read */ .set TS_REWIND,02010 /* local stack variables */ .set tapa,-4 /* desired tape addr */ .set mtapa,-8 /* current tape addr */ .set name,-8-PTHSIZ /* operator-typed file name */ /* register usage */ .set rUBA,r10 .set rTS,r11 /* ===== */ /* initialization */ init: movl $RELOC,fp /* core loc to which to move this program */ addl3 $name,fp,sp /* set stack pointer; leave room for locals */ clrl r0 1: movc3 $end,(r0),(fp) /* move boot up to relocated position */ jmp start+RELOC start: ashl $-9,$RELOC,r0 bisl3 $MRV,r0,UBA_MAP+4(%rUBA) clrw TSSR(%rTS) bsbw tsquiet movw $TSA+setchr,TSDB(%rTS) bsbw tsquiet bsbw rew /* rewind input tape */ movab name(fp),r4 /* start of filename storage */ movzbl $'=,r0 /* prompt character */ bsbw putc /* output char to main console */ /* read in a file name */ movl r4,r1 /* loc at which to store file name */ nxtc: bsbw getc /* get input char's in file name */ cmpb r0,$012 /* terminator ? */ beql nullc movb r0,(r1)+ brb nxtc nullc: subl3 r4,r1,r9 /* size of path name */ beql start /* dumb operator */ clrb (r1)+ incl r9 /* user-specified TP filename has been stored at name(fp) */ /* read in entire tp directory contents into low core */ dirred: movl $8,tapa(fp) /* tp directory starts at block 8 */ movl $(NUMDIR*BLKSIZ),r6 /* no. bytes in total dir */ bsbw taper /* read no. bytes indicated */ /* search entire directory for user-specified file name */ clrl r5 /* dir buff loc = 0 */ nxtdir: cmpc3 r9,(r5),(r4) /* see if dir entry matches filename */ beql fndfil /* found match */ acbl $NUMDIR*BLKSIZ-1,$ENTSIZ,r5,nxtdir /* see if done with tp dir */ brw start /* entry not in directory; start over */ /* found desired tp dir entry */ fndfil: movzwl BNUM(r5),tapa(fp) /* start block no., 2 bytes */ addl2 $7,tapa(fp) /* skip 7 boot blocks */ movzwl FILSIZ(r5),r6 /* low 2 bytes file size */ insv FILSIZ-1(r5),$16,$8,r6 /* file size, high byte */ cmpl r6,$RELOC-512 /* check if file fits below stack */ blss filok /* file o.k. */ brw start /* file too large */ /* time to read in desired file from tape */ filok: movl r6,r7 /* save r6 */ bsbb taper bsbw rew /* clear core */ subl3 r7,$RELOC-4,r0 /* no. bytes to clear */ 1: clrb (r7)+ sobgtr r0,1b /* time to jump to start of file & execute */ addl3 $20,fp,ap clrl r5 calls $0,(r5) brw start /* taper: movcTAPE (r6),tapa(fp),0 */ rew2: bsbb rew /* beginning of tape */ taper0: bsbb rrec /* advance 1 block; never want blk 0 */ taper: clrl r0 /* page no. */ cmpl mtapa(fp),tapa(fp) /* current position .vs. desired */ bgtr rew2 blss taper0 1: bsbb rrec acbl $1,$-BLKSIZ,r6,1b rsb /* rew: rewind the tape */ rew: clrl mtapa(fp) /* current position */ movw $TSA+rewind,TSDB(%rTS) bsbb tsquiet rsb /* rrec: read 1 block from mag tape into page (r0) */ rrec: /* pushl r0; movzbl $'r,r0; bsbw putc; movl (sp)+,r0; */ bisl3 $MRV,r0,UBA_MAP(%rUBA) movw $TS_ACK|TS_CVC|TS_READ,tsread 1: movw $TSA+tsread,TSDB(%rTS) bsbb tsquiet /* bisl2 $BNE,UBA_DPR1(%rUBA) */ tstw TSSR(%rTS) bgeq 2f bisw2 $TS_RETRY,tsread brb 1b 2: incl r0 /* next page no. */ incl mtapa(fp) /* mag tape block position */ rsb tsquiet: tstb TSSR(%rTS) bgeq tsquiet rsb getc: mfpr $RXCS,r0 bbc $RXCS_pd,r0,getc /* receiver ready ? */ mfpr $RXDB,r0 extzv $0,$7,r0,r0 cmpb r0,$015 bneq putc bsbb putc movb $0,r0 bsbb putc movb $012,r0 putc: mfpr $TXCS,r2 bbc $TXCS_pr,r2,putc /* transmitter ready ? */ extzv $0,$7,r0,r0 mtpr r0,$TXDB rsb .align 2 setchr: .word TS_ACK|TS_CVC|TS_SETCHR .long TSA+char .word 0xe char: .long TSA+tsstat .word 0xe .word 0 tsread: .word TS_ACK|TS_CVC|TS_READ .long 0 .word BLKSIZ rewind: .word TS_ACK|TS_CVC|TS_REWIND .long 0 .word 0 tsstat: .space 7*2 end: @i@k<u<&i6i /* * Prototype toggle in bootstrap code for ht type tapes. * If on anything but a 780 with a tape at slave 1 of mba 1 * this will have to be repaired by patching mba and ht. */ movl mba,r10 mull3 ht,$0x80,r11 addl3 r11,r10,r11 addl2 $0x400,r11 movl $1,4(r10) movl $9,(r11) cvtwl $012300,0x24(r11) clrl 12(r10) movl $0x80000000,0x800(r10) cvtwl $-512,16(r10) movl $0x39,(r11) halt .align 2 mba: .long 0x20012000 ht: .long 0 @iBkzr<&i3'6i /* * Prototype toggle in bootstrap code for tm type tapes. * If on anything but a 780 with the drive on uba0 * this will have to be repaired by patching uba and umem. */ begin: movl uba,r1 movl $0x80200000,0x800(r1) clrl 0x804(r1) movl umem,r2 bisl2 $0172520,r2 mnegw $512,4(r2) clrw 6(r2) movw $03,2(r2) halt .align 2 uba: .long 0x20006000 umem: .long 0x2013e000 ((@iDk|̺`cfilo<&i\6i /* * VAX tape boot block for distribution tapes * works on massbus tu10/te16/tu45/tu77 * * reads a program from a tp directory on a tape and executes it * program must be stripped of the header and is loaded ``bits as is'' * you can return to this loader via ``ret'' as you are called ``calls $0,ent'' */ .set RELOC,0x70000 /* a.out defines */ .set HDRSIZ,040 /* size of file header for VAX */ .set MAGIC,0410 /* file type id in header */ .set TSIZ,4 /* text size */ .set DSIZ,8 /* data size */ .set BSIZ,12 /* bss size */ .set TENT,024 /* task header entry loc */ /* tp directory definitions */ .set FILSIZ,38 /* tp direc offset for file size */ .set BNUM,44 /* tp dir offset for start block no. */ .set ENTSIZ,64 /* size of 1 TP dir entry, bytes */ .set PTHSIZ,32 /* size of TP path name, bytes */ .set BLKSIZ,512 /* tape block size, bytes */ .set NUMDIR,24 /* no. of dir blocks on tape */ .set ENTBLK,8 /* no. of dir entries per tape block */ /* processor registers and bits */ .set RXCS,32 .set RXDB,33 .set TXCS,34 .set TXDB,35 .set RXCS_DONE,0x80 .set TXCS_RDY,0x80 .set TXCS_pr,7 /* bit position of TXCS ready bit */ .set RXCS_pd,7 /* bit position of RXCS done bit */ /* MBA registers */ .set MBA_CSR,0 /* configuration and status register */ .set MBA_CR,4 /* MBA control reg */ .set MBA_SR,8 /* MBA status reg */ .set MBA_VAR,12 /* MBA virt addr reg */ .set MBA_BCR,16 /* MBA byte count reg */ .set MBA_MAP,0x800 /* start of MBA map reg's */ .set MRV,0x80000000 /* TE16/TU45/TU77 mba registers */ .set HTCS1,0 /* HT control 1 reg */ .set HTDS,4 /* status reg */ .set HTER,8 /* error reg */ .set HTAS,16 /* attention summary */ .set HTFC,20 /* frame count */ .set HTTC,36 /* HT tape control */ /* HT commands */ .set GO,1 /* GO bit */ .set HT_REW,6 /* rewind, on-line */ .set HT_DCLR,010 /* drive clear */ .set HT_SREV,032 /* space reverse */ .set HT_RCOM,070 /* read forward */ /* HT bits */ .set ERR,040000 /* composite error bit in status reg */ .set TCHAR,012300 /* unit 0, odd parity, PDP11, 1600 BPI NRZ, */ /* abort on error - for tape controller */ .set DRDY,0200 /* HT/drive ready in status reg */ .set HT_pd,7 /* bit position of HT DRDY bit */ .set HT_pe,14 /* bit position of HT ERROR bit */ /* local stack variables */ .set tapa,-4 /* desired tape addr */ .set mtapa,-8 /* current tape addr */ .set name,-8-PTHSIZ /* operator-typed file name */ /* register usage */ .set rMBA,r10 .set rHT,r11 /* initialization */ init: mull2 $0x80,%rHT addl2 $0x400,%rHT addl2 %rMBA,%rHT movl $RELOC,fp /* core loc to which to move this program */ addl3 $name,fp,sp /* set stack pointer, leaving room for locals */ clrl r0 1: movc3 $end,(r0),(fp) /* move boot up to relocated position */ jmp start+RELOC start: movl $1,MBA_CR(%rMBA) /* MBA init */ movl $TCHAR,HTTC(%rHT) /* drive no., etc. */ movl $HT_DCLR+GO,HTCS1(%rHT) /* drive clear */ bsbw rew /* rewind input tape */ movab name(fp),r4 /* start of filename storage */ movzbl $'=,r0 /* prompt character */ bsbw putc /* output char to main console */ /* read in a file name */ movl r4,r1 /* loc at which to store file name */ nxtc: bsbw getc /* get input char's in file name */ cmpb r0,$012 /* terminator ? */ beql nullc movb r0,(r1)+ brb nxtc nullc: subl3 r4,r1,r9 /* size of path name */ beql start /* dumb operator */ clrb (r1)+ incl r9 /* user-specified TP filename has been stored at name(fp) */ /* read in entire tp directory contents into low core */ dirred: movl $8,tapa(fp) /* tp directory starts at block 8 */ movl $(NUMDIR*BLKSIZ),r6 /* no. bytes in total dir */ bsbw taper /* read no. bytes indicated */ /* search entire directory for user-specified file name */ clrl r5 /* dir buff loc = 0 */ nxtdir: cmpc3 r9,(r5),(r4) /* see if dir entry matches filename */ beql fndfil /* found match */ acbl $NUMDIR*BLKSIZ-1,$ENTSIZ,r5,nxtdir /* see if done with tp dir */ brw start /* entry not in directory; start over */ /* found desired tp dir entry */ fndfil: movzwl BNUM(r5),tapa(fp) /* start block no., 2 bytes */ addl2 $7,tapa(fp) /* skip 7 boot blocks */ movzwl FILSIZ(r5),r6 /* low 2 bytes file size */ insv FILSIZ-1(r5),$16,$8,r6 /* file size, high byte */ cmpl r6,$RELOC-512 /* check if file fits below stack */ blss filok /* file o.k. */ brw start /* file too large */ /* time to read in desired file from tape */ filok: movl r6,r7 /* save r6 */ bsbb taper bsbw rew /* clear core */ subl3 r7,$RELOC-4,r0 /* no. bytes to clear */ 1: clrb (r7)+ sobgtr r0,1b /* time to jump to start of file & execute */ addl3 $20,fp,ap clrl r5 calls $0,(r5) brw start /* taper: movcTAPE (r6),tapa(fp),0 */ rew2: bsbb rew /* beginning of tape */ taper0: bsbb rrec /* advance 1 block; never want blk0 */ taper: clrl r0 /* page no. */ cmpl mtapa(fp),tapa(fp) /* current position .vs. desired */ bgtr rew2 blss taper0 1: bsbb rrec acbl $1,$-BLKSIZ,r6,1b rsb /* rew: rewind the tape */ rew: clrl mtapa(fp) /* current position */ movl $HT_REW+GO,HTCS1(%rHT) /* rewind */ rsb /* rrec: read 1 block from mag tape into page (r0) */ rrec: /* pushl r0; movzbl $'r,r0; bsbw putc; movl (sp)+,r0; */ movl HTDS(%rHT),r2 bbc $HT_pd,r2,rrec /* HT & drive ready ? */ movl $-BLKSIZ,MBA_BCR(%rMBA) bisl3 $MRV,r0,MBA_MAP(%rMBA) clrl MBA_VAR(%rMBA) movl $HT_RCOM+GO,HTCS1(%rHT) /* read forward */ 1: movl HTDS(%rHT),r2 bbc $HT_pd,r2,1b movl HTER(%rHT),r2 bbc $HT_pe,r2,2f /* any read errors ? */ clrl HTDS(%rHT) /* clear status - try to recover */ mnegl $1,HTFC(%rHT) /* frame count for backspace */ movl $HT_SREV+GO,HTCS1(%rHT) /* space reverse */ brb rrec 2: incl r0 /* next page no. */ incl mtapa(fp) /* mag tape block position */ rsb getc: mfpr $RXCS,r0 bbc $RXCS_pd,r0,getc /* receiver ready ? */ mfpr $RXDB,r0 extzv $0,$7,r0,r0 cmpb r0,$015 bneq putc bsbb putc movb $0,r0 bsbb putc movb $012,r0 putc: mfpr $TXCS,r2 bbc $TXCS_pr,r2,putc /* transmitter ready ? */ extzv $0,$7,r0,r0 mtpr r0,$TXDB rsb end: @iKk FWZ];&iڡڡ ALL= htboot mtboot tmboot tsboot hpboot hkboot upboot noboot noboot \ httoggle mttoggle tmtoggle tstoggle all: ${ALL} htboot: htboot.s as htboot.s nm -u a.out strip a.out dd if=a.out of=b.out bs=32 skip=1 dd if=b.out of=htboot conv=sync mtboot: mtboot.s as mtboot.s nm -u a.out strip a.out dd if=a.out of=b.out bs=32 skip=1 dd if=b.out of=mtboot conv=sync tmboot: tmboot.s as tmboot.s nm -u a.out strip a.out dd if=a.out of=b.out bs=32 skip=1 dd if=b.out of=tmboot conv=sync tsboot: tsboot.s as tsboot.s nm -u a.out strip a.out dd if=a.out of=b.out bs=32 skip=1 dd if=b.out of=tsboot conv=sync hpboot: hpboot.s as hpboot.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=b.out dd if=b.out of=hpboot conv=sync hkboot: hkboot.s as hkboot.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=b.out dd if=b.out of=hkboot conv=sync upboot: upboot.s as upboot.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=b.out dd if=b.out of=upboot conv=sync httoggle: httoggle.s as httoggle.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=httoggle mttoggle: mttoggle.s as mttoggle.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=mttoggle tstoggle: tstoggle.s as tstoggle.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=tstoggle tmtoggle: tmtoggle.s as tmtoggle.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=tmtoggle noboot: echo | dd of=noboot conv=sync clean: rm -f a.out b.out ${ALL} install: cp *boot /usr/mdec rm -f /usr/mdec/mboot ln /usr/mdec/htboot /usr/mdec/mboot rm -f /usr/mdec/uboot ln /usr/mdec/hpboot /usr/mdec/uboot ((@iNk $-NQT-?$:&i)6i /* vp.c 4.9 81/04/02 */ #include "vp.h" #if NVP > 0 /* * Versatec matrix printer/plotter * dma interface driver * * SETUP NOTES: * Set up both print and plot interrupts to go through the same vector * Give the address of the plcsr register in the config specification */ #include "../h/param.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/buf.h" #include "../h/systm.h" #include "../h/map.h" #include "../h/pte.h" #include "../h/ubavar.h" #include "../h/ubareg.h" #include "../h/vcmd.h" unsigned minvpph(); #define VPPRI (PZERO-1) struct vpdevice { short plbcr; short pbxaddr; short prbcr; u_short pbaddr; short plcsr; short plbuf; short prcsr; u_short prbuf; }; #define VP_ERROR 0100000 #define VP_DTCINTR 0040000 #define VP_DMAACT 0020000 #define VP_READY 0000200 #define VP_IENABLE 0000100 #define VP_TERMCOM 0000040 #define VP_FFCOM 0000020 #define VP_EOTCOM 0000010 #define VP_CLRCOM 0000004 #define VP_RESET 0000002 #define VP_SPP 0000001 struct vp_softc { int sc_state; int sc_count; int sc_bufp; struct buf *sc_bp; int sc_ubinfo; } vp_softc[NVP]; /* sc_state bits */ #define VPSC_BUSY 0001000 #define VPSC_MODE 0000700 #define VPSC_SPP 0000400 #define VPSC_PLOT 0000200 #define VPSC_PRINT 0000100 #define VPSC_CMNDS 0000076 #define VPSC_OPEN 0000001 struct uba_device *vpdinfo[NVP]; #define VPUNIT(dev) (minor(dev)) struct buf rvpbuf[NVP]; int vpprobe(), vpattach(); struct uba_device *vpdinfo[NVP]; u_short vpstd[] = { 0777500, 0 }; struct uba_driver vpdriver = { vpprobe, 0, vpattach, 0, vpstd, "vp", vpdinfo }; vpprobe(reg) caddr_t reg; { register int br, cvec; /* value-result */ register struct vpdevice *vpaddr = (struct vpdevice *)(reg-010); vpaddr->prcsr = VP_IENABLE|VP_DTCINTR; vpaddr->pbaddr = 0; vpaddr->pbxaddr = 0; vpaddr->prbcr = 1; DELAY(10000); vpaddr->prcsr = 0; #ifdef ERNIE /* UNTIL REWIRED, GET INTERRUPT AT 200 BUT WANT 174 */ if (cvec == 0200) { printf("vp reset vec from 200 to 174\n"); cvec = 0174; } #endif } /*ARGSUSED*/ vpattach(ui) struct uba_device *ui; { ui->ui_addr -= 010; ui->ui_physaddr -= 010; } vpopen(dev) dev_t dev; { register struct vp_softc *sc; register struct vpdevice *vpaddr; register struct uba_device *ui; if (VPUNIT(dev) >= NVP || ((sc = &vp_softc[minor(dev)])->sc_state&VPSC_OPEN) || (ui = vpdinfo[VPUNIT(dev)]) == 0 || ui->ui_alive == 0) { u.u_error = ENXIO; return; } vpaddr = (struct vpdevice *)ui->ui_addr; sc->sc_state = VPSC_OPEN|VPSC_PRINT | VP_CLRCOM|VP_RESET; sc->sc_count = 0; vpaddr->prcsr = VP_IENABLE|VP_DTCINTR; vptimo(dev); while (sc->sc_state & VPSC_CMNDS) { (void) spl4(); if (vpwait(dev)) { vpclose(dev); u.u_error = EIO; return; } vpstart(dev); (void) spl0(); } } vpstrategy(bp) register struct buf *bp; { register int e; register struct vp_softc *sc = &vp_softc[VPUNIT(bp->b_dev)]; register struct uba_device *ui = vpdinfo[VPUNIT(bp->b_dev)]; register struct vpdevice *vpaddr = (struct vpdevice *)ui->ui_addr; (void) spl4(); while (sc->sc_state & VPSC_BUSY) sleep((caddr_t)sc, VPPRI); sc->sc_state |= VPSC_BUSY; sc->sc_bp = bp; sc->sc_ubinfo = ubasetup(ui->ui_ubanum, bp, UBA_NEEDBDP); if (e = vpwait(bp->b_dev)) goto brkout; sc->sc_count = bp->b_bcount; vpstart(bp->b_dev); while (((sc->sc_state&VPSC_PLOT) ? vpaddr->plcsr : vpaddr->prcsr) & VP_DMAACT) sleep((caddr_t)sc, VPPRI); sc->sc_count = 0; if ((sc->sc_state&VPSC_MODE) == VPSC_SPP) sc->sc_state = (sc->sc_state &~ VPSC_MODE) | VPSC_PLOT; (void) spl0(); brkout: ubarelse(ui->ui_ubanum, &sc->sc_ubinfo); sc->sc_state &= ~VPSC_BUSY; sc->sc_bp = 0; iodone(bp); if (e) u.u_error = EIO; wakeup((caddr_t)sc); } int vpblock = 16384; unsigned minvpph(bp) struct buf *bp; { if (bp->b_bcount > vpblock) bp->b_bcount = vpblock; } /*ARGSUSED*/ vpwrite(dev) dev_t dev; { physio(vpstrategy, &rvpbuf[VPUNIT(dev)], dev, B_WRITE, minvpph); } vpwait(dev) dev_t dev; { register struct vpdevice *vpaddr = (struct vpdevice *)vpdinfo[VPUNIT(dev)]->ui_addr; register struct vp_softc *sc = &vp_softc[VPUNIT(dev)]; register int e; for (;;) { e = (sc->sc_state & VPSC_PLOT) ? vpaddr->plcsr : vpaddr->prcsr; if (e & (VP_READY|VP_ERROR)) break; sleep((caddr_t)sc, VPPRI); } /* I wish i could tell whether an error indicated an npr timeout */ return (e & VP_ERROR); } vpstart(dev) dev_t; { register struct vp_softc *sc = &vp_softc[VPUNIT(dev)]; register struct vpdevice *vpaddr = (struct vpdevice *)vpdinfo[VPUNIT(dev)]->ui_addr; short bit; if (sc->sc_count) { vpaddr->pbaddr = sc->sc_ubinfo; vpaddr->pbxaddr = (sc->sc_ubinfo>>12)&0x30; if (sc->sc_state & (VPSC_PRINT|VPSC_SPP)) vpaddr->prbcr = sc->sc_count; else vpaddr->plbcr = sc->sc_count; return; } for (bit = 1; bit != 0; bit <<= 1) if (sc->sc_state&bit&VPSC_CMNDS) { vpaddr->plcsr |= bit; sc->sc_state &= ~bit; return; } } /*ARGSUSED*/ vpioctl(dev, cmd, addr, flag) dev_t dev; int cmd; register caddr_t addr; int flag; { register int m; register struct vp_softc *sc = &vp_softc[VPUNIT(dev)]; register struct vpdevice *vpaddr = (struct vpdevice *)vpdinfo[VPUNIT(dev)]->ui_addr; switch (cmd) { case VGETSTATE: (void) suword(addr, sc->sc_state); return; case VSETSTATE: m = fuword(addr); if (m == -1) { u.u_error = EFAULT; return; } sc->sc_state = (sc->sc_state & ~VPSC_MODE) | (m&(VPSC_MODE|VPSC_CMNDS)); break; default: u.u_error = ENOTTY; return; } (void) spl4(); (void) vpwait(dev); if (sc->sc_state&VPSC_SPP) vpaddr->plcsr |= VP_SPP; else vpaddr->plcsr &= ~VP_SPP; sc->sc_count = 0; while (sc->sc_state & VPSC_CMNDS) { (void) vpwait(dev); vpstart(dev); } (void) spl0(); } vptimo(dev) dev_t dev; { register struct vp_softc *sc = &vp_softc[VPUNIT(dev)]; if (sc->sc_state&VPSC_OPEN) timeout(vptimo, (caddr_t)dev, hz/10); vpintr(dev); } /*ARGSUSED*/ vpintr(dev) dev_t dev; { register struct vp_softc *sc = &vp_softc[VPUNIT(dev)]; wakeup((caddr_t)sc); } vpclose(dev) dev_t dev; { register struct vp_softc *sc = &vp_softc[VPUNIT(dev)]; register struct vpdevice *vpaddr = (struct vpdevice *)vpdinfo[VPUNIT(dev)]->ui_addr; sc->sc_state = 0; sc->sc_count = 0; vpaddr->plcsr = 0; } vpreset(uban) int uban; { register int vp11; register struct uba_device *ui; register struct vp_softc *sc = vp_softc; register struct vpdevice *vpaddr; for (vp11 = 0; vp11 < NVP; vp11++, sc++) { if ((ui = vpdinfo[vp11]) == 0 || ui->ui_alive == 0 || ui->ui_ubanum != uban || (sc->sc_state&VPSC_OPEN) == 0) continue; printf(" vp%d", vp11); vpaddr = (struct vpdevice *)ui->ui_addr; vpaddr->prcsr = VP_IENABLE|VP_DTCINTR; if ((sc->sc_state & VPSC_BUSY) == 0) continue; if (sc->sc_ubinfo) { printf("<%d>", (sc->sc_ubinfo>>28)&0xf); ubarelse(ui->ui_ubanum, &sc->sc_ubinfo); } sc->sc_count = sc->sc_bp->b_bcount; vpstart(sc->sc_bp->b_dev); } } #endif @iVk-$s7<?sjmy6ihP6i /* autoconf.c 4.32 81/11/11 */ /* * Setup the system to run on the current machine. * * Configure() is called at boot time and initializes the uba and mba * device tables and the memory controller monitoring. Available * devices are determined (from possibilities mentioned in ioconf.c), * and the drivers are initialized. * * N.B.: A lot of the conditionals based on processor type say * #if VAX780 * and * #if VAX750 * which may be incorrect after more processors are introduced if they * are like either of these machines. * * TODO: * use pcpu info about whether a ubasr exists */ #include "mba.h" #include "../h/param.h" #include "../h/systm.h" #include "../h/map.h" #include "../h/nexus.h" #include "../h/pte.h" #include "../h/buf.h" #include "../h/mbareg.h" #include "../h/mbavar.h" #include "../h/dk.h" #include "../h/vm.h" #include "../h/ubareg.h" #include "../h/ubavar.h" #include "../h/mtpr.h" #include "../h/cpu.h" #include "../h/scb.h" #include "../h/mem.h" /* * The following several vari((ables are related to * the configuration process, and are used in initializing * the machine. */ int cold; /* if 1, still working on cold-start */ int nexnum; /* current nexus number */ int dkn; /* number of iostat dk numbers assigned so far */ /* * Addresses of the (locore) routines which bootstrap us from * hardware traps to C code. Filled into the system control block * as necessary. */ #if NMBA > 0 int (*mbaintv[4])() = { Xmba0int, Xmba1int, Xmba2int, Xmba3int }; #endif #if VAX780 int (*ubaintv[4])() = { Xua0int, Xua1int, Xua2int, Xua3int }; #endif /* * This allocates the space for the per-uba information, * such as buffered data path usage. */ struct uba_hd uba_hd[MAXNUBA]; /* * Determine mass storage and memory configuration for a machine. * Get cpu type, and then switch out to machine specific procedures * which will probe adaptors to see what is out there. */ configure() { union cpusid cpusid; register struct percpu *ocp; register int *ip; extern char Sysbase[]; cpusid.cpusid = mfpr(SID); for (ocp = percpu; ocp->pc_cputype; ocp++) if (ocp->pc_cputype == cpusid.cpuany.cp_type) { probenexus(ocp); /* * Write protect the scb. It is strange * that this code is here, but this is as soon * as we are done mucking with it, and the * write-enable was done in assembly language * to which we will never return. */ ip = (int *)Sysmap; *ip &= ~PG_PROT; *ip |= PG_KR; mtpr(TBIS, Sysbase); #if GENERIC setconf(); #endif cold = 0; memenable(); return; } printf("cpu type %d not configured\n", cpusid.cpuany.cp_type); asm("halt"); } /* * Probe nexus space, finding the interconnects * and setting up and probing mba's and uba's for devices. */ /*ARGSUSED*/ probenexus(pcpu) register struct percpu *pcpu; { register struct nexus *nxv; struct nexus *nxp = pcpu->pc_nexbase; union nexcsr nexcsr; int i; nexnum = 0, nxv = nexus; for (; nexnum < pcpu->pc_nnexus; nexnum++, nxp++, nxv++) { nxaccess(nxp, Nexmap[nexnum]); if (badaddr((caddr_t)nxv, 4)) continue; if (pcpu->pc_nextype && pcpu->pc_nextype[nexnum] != NEX_ANY) nexcsr.nex_csr = pcpu->pc_nextype[nexnum]; else nexcsr = nxv->nexcsr; if (nexcsr.nex_csr&NEX_APD) continue; switch (nexcsr.nex_type) { case NEX_MBA: printf("mba%d at tr%d\n", nummba, nexnum); if (nummba >= NMBA) { printf("%d mba's", nummba); goto unconfig; } #if NMBA > 0 mbafind(nxv, nxp); nummba++; #endif break; case NEX_UBA0: case NEX_UBA1: case NEX_UBA2: case NEX_UBA3: printf("uba%d at tr%d\n", numuba, nexnum); if (numuba >= 4) { printf("5 uba's"); goto unsupp; } #if VAX780 if (cpu == VAX_780) setscbnex(ubaintv[numuba]); #endif i = nexcsr.nex_type - NEX_UBA0; unifind((struct uba_regs *)nxv, (struct uba_regs *)nxp, umem[i], pcpu->pc_umaddr[i], UMEMmap[i]); #if VAX780 if (cpu == VAX_780) ((struct uba_regs *)nxv)->uba_cr = UBACR_IFS|UBACR_BRIE| UBACR_USEFIE|UBACR_SUEFIE; #endif numuba++; break; case NEX_DR32: /* there can be more than one... are there other codes??? */ printf("dr32"); goto unsupp; case NEX_MEM4: case NEX_MEM4I: case NEX_MEM16: case NEX_MEM16I: printf("mcr%d at tr%d\n", nmcr, nexnum); if (nmcr >= 4) { printf("5 mcr's"); goto unsupp; } mcraddr[nmcr++] = (struct mcr *)nxv; break; case NEX_MPM0: case NEX_MPM1: case NEX_MPM2: case NEX_MPM3: printf("mpm"); goto unsupp; default: printf("nexus type %x", nexcsr.nex_type); unsupp: printf(" unsupported (at tr %d)\n", nexnum); continue; unconfig: printf(" not configured\n"); continue; } } #if VAX780 if (cpu == VAX_780) { int ubawatch(); timeout(ubawatch, (caddr_t)0, hz); } #endif } #if NMBA > 0 struct mba_device *mbaconfig(); /* * Find devices attached to a particular mba * and look for each device found in the massbus * initialization tables. */ mbafind(nxv, nxp) struct nexus *nxv, *nxp; { register struct mba_regs *mdp; register struct mba_drv *mbd; register struct mba_device *mi; register struct mba_slave *ms; int dn, dt; struct mba_device fnd; mdp = (struct mba_regs *)nxv; mba_hd[nummba].mh_mba = mdp; mba_hd[nummba].mh_physmba = (struct mba_regs *)nxp; setscbnex(mbaintv[nummba]); fnd.mi_mba = mdp; fnd.mi_mbanum = nummba; for (mbd = mdp->mba_drv, dn = 0; mbd < &mdp->mba_drv[8]; mbd++, dn++) { dt = mbd->mbd_dt & 0xffff; if (dt == 0) continue; if (dt == MBDT_MOH) continue; fnd.mi_drive = dn; if ((mi = mbaconfig(&fnd, dt)) && (dt & MBDT_TAP)) { for (ms = mbsinit; ms->ms_driver; ms++) if (ms->ms_driver == mi->mi_driver && ms->ms_alive == 0 && (ms->ms_ctlr == mi->mi_unit || ms->ms_ctlr=='?')) { if ((*ms->ms_driver->md_slave)(mi, ms)) { printf("%s%d at %s%d slave %d\n", ms->ms_driver->md_sname, ms->ms_unit, mi->mi_driver->md_dname, mi->mi_unit, ms->ms_slave); ms->ms_alive = 1; ms->ms_ctlr = mi->mi_unit; } } } } mdp->mba_cr = MBCR_INIT; mdp->mba_cr = MBCR_IE; } /* * Have found a massbus device; * see if it is in the configuration table. * If so, fill in its data. */ struct mba_device * mbaconfig(ni, type) register struct mba_device *ni; register int type; { register struct mba_device *mi; register short *tp; register struct mba_hd *mh; for (mi = mbdinit; mi->mi_driver; mi++) { if (mi->mi_alive) continue; tp = mi->mi_driver->md_type; for (mi->mi_type = 0; *tp; tp++, mi->mi_type++) if (*tp == (type&MBDT_TYPE)) goto found; continue; found: #define match(fld) (ni->fld == mi->fld || mi->fld == '?') if (!match(mi_drive) || !match(mi_mbanum)) continue; printf("%s%d at mba%d drive %d", mi->mi_driver->md_dname, mi->mi_unit, ni->mi_mbanum, ni->mi_drive); printf("\n"); mi->mi_alive = 1; mh = &mba_hd[ni->mi_mbanum]; mi->mi_hd = mh; mh->mh_mbip[ni->mi_drive] = mi; mh->mh_ndrive++; mi->mi_mba = ni->mi_mba; mi->mi_drv = &mi->mi_mba->mba_drv[ni->mi_drive]; mi->mi_driver->md_info[mi->mi_unit] = mi; mi->mi_mbanum = ni->mi_mbanum; mi->mi_drive = ni->mi_drive; if (mi->mi_dk && dkn < DK_NDRIVE) mi->mi_dk = dkn++; else mi->mi_dk = -1; (*mi->mi_driver->md_attach)(mi); return (mi); } return (0); } #endif /* * Fixctlrmask fixes the masks of the driver ctlr routines * which otherwise save r10 and r11 where the interrupt and br * level are passed through. */ fixctlrmask() { register struct uba_ctlr *um; register struct uba_device *ui; register struct uba_driver *ud; #define phys(a,b) ((b)(((int)(a))&0x7fffffff)) for (um = ubminit; ud = phys(um->um_driver, struct uba_driver *); um++) *phys(ud->ud_probe, short *) &= ~0xc00; for (ui = ubdinit; ud = phys(ui->ui_driver, struct uba_driver *); ui++) *phys(ud->ud_probe, short *) &= ~0xc00; } /* * Find devices on a UNIBUS. * Uses per-driver routine to set into , * and then fills in the tables, with help from a per-driver * slave initialization routine. */ unifind(vubp, pubp, vumem, pumem, memmap) struct uba_regs *vubp, *pubp; caddr_t vumem, pumem; struct pte *memmap; { #ifndef lint register int br, cvec; /* MUST BE r11, r10 */ #else /* * Lint doesn't realize that these * can be initialized asynchronously * when devices interrupt. */ register int br = 0, cvec = 0; #endif register struct uba_device *ui; register struct uba_ctlr *um; u_short *reg, addr; struct uba_hd *uhp; struct uba_driver *udp; int i, (**ivec)(), haveubasr = 0; /* * Initialize the UNIBUS, by freeing the map * registers and the buffered data path registers */ uhp = &uba_hd[numuba]; uhp->uh_map = (struct map *)calloc(UAMSIZ * sizeof (struct map)); rminit(uhp->uh_map, NUBMREG, 1, "uba", UAMSIZ); switch (cpu) { #if VAX780 case VAX_780: uhp->uh_bdpfree = (1<uh_bdpfree = (1<uh_uba = vubp; uhp->uh_physuba = pubp; /* HAVE TO DO SOMETHING SPECIAL FOR SECOND UNIBUS ON COMETS HERE */ if (numuba == 0) uhp->uh_vec = UNIvec; else uhp->uh_vec = (int(**)())calloc(512); for (i = 0; i < 128; i++) uhp->uh_vec[i] = scbentry(&catcher[i*2], SCB_ISTACK); /* * Set last free interrupt vector for devices with * programmable interrupt vectors. Use is to decrement * this number and use result as interrupt vector. */ uhp->uh_lastiv = 0x200; /* THIS IS A CHEAT: USING THE FACT THAT UMEM and NEXI ARE SAME SIZE */ nxaccess((struct nexus *)pumem, memmap); #if VAX780 if (haveubasr) { vubp->uba_sr = vubp->uba_sr; vubp->uba_cr = UBACR_IFS|UBACR_BRIE; } #endif /* * Map the first page of UNIBUS i/o * space to the first page of memory * for devices which will need to dma * output to produce an interrupt. */ *(int *)(&vubp->uba_map[0]) = UBAMR_MRV; #define ubaddr(off) (u_short *)((int)vumem + ((off)&0x1fff)) /* * Check each unibus mass storage@iak.$s7<?sjmy6ihP6i(( controller. * For each one which is potentially on this uba, * see if it is really there, and if it is record it and * then go looking for slaves. */ for (um = ubminit; udp = um->um_driver; um++) { if (um->um_ubanum != numuba && um->um_ubanum != '?') continue; addr = (u_short)um->um_addr; reg = ubaddr(addr); if (badaddr((caddr_t)reg, 2)) continue; #if VAX780 if (haveubasr && vubp->uba_sr) { vubp->uba_sr = vubp->uba_sr; continue; } #endif cvec = 0x200; i = (*udp->ud_probe)(reg); #if VAX780 if (haveubasr && vubp->uba_sr) { vubp->uba_sr = vubp->uba_sr; continue; } #endif if (i == 0) continue; printf("%s%d at uba%d csr %o ", udp->ud_mname, um->um_ctlr, numuba, addr); if (cvec == 0) { printf("zero vector\n"); continue; } if (cvec == 0x200) { printf("didn't interrupt\n"); continue; } printf("vec %o, ipl %x\n", cvec, br); um->um_alive = 1; um->um_ubanum = numuba; um->um_hd = &uba_hd[numuba]; um->um_addr = (caddr_t)reg; udp->ud_minfo[um->um_ctlr] = um; for (ivec = um->um_intr; *ivec; ivec++) { um->um_hd->uh_vec[cvec/4] = scbentry(*ivec, SCB_ISTACK); cvec += 4; } for (ui = ubdinit; ui->ui_driver; ui++) { if (ui->ui_driver != udp || ui->ui_alive || ui->ui_ctlr != um->um_ctlr && ui->ui_ctlr != '?' || ui->ui_ubanum != numuba && ui->ui_ubanum != '?') continue; if ((*udp->ud_slave)(ui, reg)) { ui->ui_alive = 1; ui->ui_ctlr = um->um_ctlr; ui->ui_ubanum = numuba; ui->ui_hd = &uba_hd[numuba]; ui->ui_addr = (caddr_t)reg; ui->ui_physaddr = pumem + (addr&0x1fff); if (ui->ui_dk && dkn < DK_NDRIVE) ui->ui_dk = dkn++; else ui->ui_dk = -1; ui->ui_mi = um; /* ui_type comes from driver */ udp->ud_dinfo[ui->ui_unit] = ui; printf("%s%d at %s%d slave %d\n", udp->ud_dname, ui->ui_unit, udp->ud_mname, um->um_ctlr, ui->ui_slave); (*udp->ud_attach)(ui); } } } /* * Now look for non-mass storage peripherals. */ for (ui = ubdinit; udp = ui->ui_driver; ui++) { if (ui->ui_ubanum != numuba && ui->ui_ubanum != '?' || ui->ui_alive || ui->ui_slave != -1) continue; addr = (u_short)ui->ui_addr; reg = ubaddr(addr); if (badaddr((caddr_t)reg, 2)) continue; #if VAX780 if (haveubasr && vubp->uba_sr) { vubp->uba_sr = vubp->uba_sr; continue; } #endif cvec = 0x200; i = (*udp->ud_probe)(reg, um->um_ctlr); #if VAX780 if (haveubasr && vubp->uba_sr) { vubp->uba_sr = vubp->uba_sr; continue; } #endif if (i == 0) continue; printf("%s%d at uba%d csr %o ", ui->ui_driver->ud_dname, ui->ui_unit, numuba, addr); if (cvec == 0) { printf("zero vector\n"); continue; } if (cvec == 0x200) { printf("didn't interrupt\n"); continue; } printf("vec %o, ipl %x\n", cvec, br); ui->ui_hd = &uba_hd[numuba]; for (ivec = ui->ui_intr; *ivec; ivec++) { ui->ui_hd->uh_vec[cvec/4] = scbentry(*ivec, SCB_ISTACK); cvec += 4; } ui->ui_alive = 1; ui->ui_ubanum = numuba; ui->ui_addr = (caddr_t)reg; ui->ui_physaddr = pumem + (addr&0x1fff); ui->ui_dk = -1; /* ui_type comes from driver */ udp->ud_dinfo[ui->ui_unit] = ui; (*udp->ud_attach)(ui); } } setscbnex(fn) int (*fn)(); { register struct scb *scbp = &scb; scbp->scb_ipl14[nexnum] = scbp->scb_ipl15[nexnum] = scbp->scb_ipl16[nexnum] = scbp->scb_ipl17[nexnum] = scbentry(fn, SCB_ISTACK); } /* * Make a nexus accessible at physical address phys * by mapping kernel ptes starting at pte. * * WE LEAVE ALL NEXI MAPPED; THIS IS PERHAPS UNWISE * SINCE MISSING NEXI DONT RESPOND. BUT THEN AGAIN * PRESENT NEXI DONT RESPOND TO ALL OF THEIR ADDRESS SPACE. */ nxaccess(physa, pte) struct nexus *physa; register struct pte *pte; { register int i = btop(sizeof (struct nexus)); register unsigned v = btop(physa); do *(int *)pte++ = PG_V|PG_KW|v++; while (--i > 0); mtpr(TBIA, 0); } @ifk(~$'*-03699&i6i /* va.c 4.10 81/07/08 */ #include "va.h" #if NVA > 0 /* * Varian printer plotter */ #include "../h/param.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/buf.h" #include "../h/systm.h" #include "../h/map.h" #include "../h/pte.h" #include "../h/ubareg.h" #include "../h/ubavar.h" #include "../h/vcmd.h" unsigned minvaph(); #define VAPRI (PZERO-1) struct vadevice { u_short vaba; /* buffer address */ short vawc; /* word count (2's complement) */ union { short Vacsw; /* control status as word */ struct { /* control status as bytes */ char Vacsl; char Vacsh; } vacsr; } vacs; short vadata; /* programmed i/o data buffer */ }; #define vacsw vacs.Vacsw #define vacsh vacs.vacsr.Vacsh #define vacsl vacs.vacsr.Vacsl /* vacsw bits */ #define VA_ERROR 0100000 /* some error has occurred */ #define VA_NPRTIMO 0001000 /* DMA timeout error */ #define VA_NOTREADY 0000400 /* something besides NPRTIMO */ #define VA_DONE 0000200 #define VA_IENABLE 0000100 /* interrupt enable */ #define VA_SUPPLIESLOW 0000004 #define VA_BOTOFFORM 0000002 #define VA_BYTEREVERSE 0000001 /* reverse byte order in words */ /* vacsh command bytes */ #define VAPLOT 0000340 #define VAPRINT 0000100 #define VAPRINTPLOT 0000160 #define VAAUTOSTEP 0000244 #define VANOAUTOSTEP 0000045 #define VAFORMFEED 0000263 #define VASLEW 0000265 #define VASTEP 0000064 struct va_softc { char sc_openf; char sc_busy; int sc_state; int sc_wc; struct buf *sc_bp; int sc_ubinfo; } va_softc[NVA]; #define VAUNIT(dev) (minor(dev)) struct buf rvabuf[NVA]; int vaprobe(), vaattach(); struct uba_device *vadinfo[NVA]; u_short vastd[] = { 0764000, 0 }; struct uba_driver vadriver = { vaprobe, 0, vaattach, 0, vastd, "va", vadinfo }; vaprobe(reg) caddr_t reg; { register int br, cvec; /* value-result */ register struct vadevice *vaaddr = (struct vadevice *)reg; vaaddr->vacsl = VA_IENABLE; vaaddr->vaba = 0; vaaddr->vacsh = VAPLOT; vaaddr->vacsl = 0; vaaddr->vawc = -1; DELAY(10000); vaaddr->vacsl = 0; } /*ARGSUSED*/ vaattach(ui) struct uba_device *ui; { } vaopen(dev) dev_t dev; { register struct va_softc *sc; register struct vadevice *vaaddr; register struct uba_device *ui; if (VAUNIT(dev) >= NVA || (sc = &va_softc[minor(dev)])->sc_openf || (ui = vadinfo[VAUNIT(dev)]) == 0 || ui->ui_alive == 0) { u.u_error = ENXIO; return; } vaaddr = (struct vadevice *)ui->ui_addr; sc->sc_openf = 1; vaaddr->vawc = 0; sc->sc_wc = 0; sc->sc_state = 0; vaaddr->vacsl = VA_IENABLE; vatimo(dev); vacmd(dev, VPRINT); if (u.u_error) vaclose(dev); } vastrategy(bp) register struct buf *bp; { register int e; register struct va_softc *sc = &va_softc[VAUNIT(bp->b_dev)]; register struct uba_device *ui = vadinfo[VAUNIT(bp->b_dev)]; register struct vadevice *vaaddr = (struct vadevice *)ui->ui_addr; (void) spl4(); while (sc->sc_busy) sleep((caddr_t)sc, VAPRI); sc->sc_busy = 1; sc->sc_bp = bp; sc->sc_ubinfo = ubasetup(ui->ui_ubanum, bp, UBA_NEEDBDP); if (e = vawait(bp->b_dev)) goto brkout; sc->sc_wc = -(bp->b_bcount/2); vastart(bp->b_dev); e = vawait(bp->b_dev); sc->sc_wc = 0; if (sc->sc_state & VPRINTPLOT) { sc->sc_state = (sc->sc_state & ~VPRINTPLOT) | VPLOT; vaaddr->vacsh = VAAUTOSTEP; e |= vawait(bp->b_dev); } (void) spl0(); brkout: ubarelse(ui->ui_ubanum, &sc->sc_ubinfo); sc->sc_bp = 0; sc->sc_busy = 0; iodone(bp); if (e) u.u_error = EIO; wakeup((caddr_t)sc); } int vablock = 16384; unsigned minvaph(bp) struct buf *bp; { if (bp->b_bcount > vablock) bp->b_bcount = vablock; } /*ARGSUSED*/ vawrite(dev) dev_t dev; { physio(vastrategy, &rvabuf[VAUNIT(dev)], dev, B_WRITE, minvaph); } vawait(dev) dev_t dev; { register struct vadevice *vaaddr = (struct vadevice *)vadinfo[VAUNIT(dev)]->ui_addr; register int e; while (((e = vaaddr->vacsw) & (VA_DONE|VA_ERROR)) == 0) sleep((caddr_t)&va_softc[VAUNIT(dev)], VAPRI); if (e & VA_NPRTIMO) printf("va%d: npr timeout\n", VAUNIT(dev)); return (e & VA_ERROR); } vastart(dev) dev_t; { register struct va_softc *sc = &va_softc[VAUNIT(dev)]; register struct vadevice *vaaddr = (struct vadevice *)vadinfo[VAUNIT(dev)]->ui_addr; if (sc->sc_wc == 0) return; vaaddr->vaba = sc->sc_ubinfo; vaaddr->vacsl = (sc->sc_ubinfo >> 12) & 0x30; vaaddr->vawc = sc->sc_wc; } /*ARGSUSED*/ vaioctl(dev, cmd, addr, flag) register caddr_t addr; { register int vcmd; register struct va_softc *sc = &va_softc[VAUNIT(dev)]; switch (cmd) { case VGETSTATE: (void) suword(addr, sc->sc_state); return; case VSETSTATE: vcmd = fuword(addr); if (vcmd == -1) { u.u_error = EFAULT; return; } vacmd(dev, vcmd); return; default: u.u_error = ENOTTY; return; } } vacmd(dev, vcmd) dev_t dev; int vcmd; { register struct va_softc *sc = &va_softc[VAUNIT(dev)]; register struct vadevice *vaaddr = (struct vadevice *)vadinfo[VAUNIT(dev)]->ui_addr; (void) spl4(); (void) vawait(dev); switch (vcmd) { case VPLOT: /* Must turn on plot AND autostep modes. */ vaaddr->vacsh = VAPLOT; if (vawait(dev)) u.u_error = EIO; vaaddr->((vacsh = VAAUTOSTEP; break; case VPRINT: vaaddr->vacsh = VAPRINT; break; case VPRINTPLOT: vaaddr->vacsh = VAPRINTPLOT; break; } sc->sc_state = (sc->sc_state & ~(VPLOT|VPRINT|VPRINTPLOT)) | vcmd; if (vawait(dev)) u.u_error = EIO; (void) spl0(); } vatimo(dev) dev_t dev; { register struct va_softc *sc = &va_softc[VAUNIT(dev)]; if (sc->sc_openf) timeout(vatimo, (caddr_t)dev, hz/10); vaintr(dev); } /*ARGSUSED*/ vaintr(dev) dev_t dev; { register struct va_softc *sc = &va_softc[VAUNIT(dev)]; wakeup((caddr_t)sc); } vaclose(dev) dev_t dev; { register struct va_softc *sc = &va_softc[VAUNIT(dev)]; register struct vadevice *vaaddr = (struct vadevice *)vadinfo[VAUNIT(dev)]->ui_addr; sc->sc_openf = 0; sc->sc_busy = 0; sc->sc_state = 0; sc->sc_ubinfo = 0; vaaddr->vacsl = 0; } vareset(uban) int uban; { register int va11; register struct uba_device *ui; register struct va_softc *sc = va_softc; register struct vadevice *vaaddr; for (va11 = 0; va11 < NVA; va11++, sc++) { if ((ui = vadinfo[va11]) == 0 || ui->ui_alive == 0 || ui->ui_ubanum != uban || sc->sc_openf == 0) continue; printf(" va%d", va11); vaaddr = (struct vadevice *)ui->ui_addr; vaaddr->vacsl = VA_IENABLE; if (sc->sc_state & VPLOT) { vaaddr->vacsh = VAPLOT; DELAY(10000); vaaddr->vacsh = VAAUTOSTEP; } else if (sc->sc_state & VPRINTPLOT) vaaddr->vacsh = VPRINTPLOT; else vaaddr->vacsh = VAPRINTPLOT; DELAY(10000); if (sc->sc_busy == 0) continue; if (sc->sc_ubinfo) { printf("<%d>", (sc->sc_ubinfo>>28)&0xf); ubarelse(ui->ui_ubanum, &sc->sc_ubinfo); } sc->sc_ubinfo = ubasetup(ui->ui_ubanum, sc->sc_bp, UBA_NEEDBDP); sc->sc_wc = -(sc->sc_bp->b_bcount/2); vastart(sc->sc_bp->b_dev); } } #endif @inkx$C7&i6i /* rk.c 4.36 81/07/25 */ #include "rk.h" #if NHK > 0 int rkpip; /* DEBUG */ int rknosval; /* DEBUG */ #ifdef RKDEBUG int rkdebug; #endif #ifdef RKBDEBUG int rkbdebug; #endif /* * RK611/RK0[67] disk driver * * This driver mimics up.c; see it for an explanation of common code. * * TODO: * Learn why we lose an interrupt sometime when spinning drives down */ #include "../h/param.h" #include "../h/systm.h" #include "../h/buf.h" #include "../h/conf.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/pte.h" #include "../h/map.h" #include "../h/vm.h" #include "../h/ubareg.h" #include "../h/ubavar.h" #include "../h/dk.h" #include "../h/cpu.h" #include "../h/cmap.h" #include "../h/dkbad.h" #include "../h/rkreg.h" struct rk_softc { int sc_softas; int sc_ndrive; int sc_wticks; int sc_recal; } rk_softc[NHK]; /* THIS SHOULD BE READ OFF THE PACK, PER DRIVE */ struct size { daddr_t nblocks; int cyloff; } rk7_sizes[8] ={ 15884, 0, /* A=cyl 0 thru 240 */ 10032, 241, /* B=cyl 241 thru 392 */ 53790, 0, /* C=cyl 0 thru 814 */ 0, 0, 0, 0, 0, 0, 27786, 393, /* G=cyl 393 thru 813 */ 0, 0, }, rk6_sizes[8] ={ 15884, 0, /* A=cyl 0 thru 240 */ 11154, 241, /* B=cyl 241 thru 409 */ 27126, 0, /* C=cyl 0 thru 410 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; /* END OF STUFF WHICH SHOULD BE READ IN PER DISK */ short rktypes[] = { RK_CDT, 0 }; int rkprobe(), rkslave(), rkattach(), rkdgo(), rkintr(); struct uba_ctlr *rkminfo[NHK]; struct uba_device *rkdinfo[NRK]; struct uba_device *rkip[NHK][4]; u_short rkstd[] = { 0777440, 0 }; struct uba_driver hkdriver = { rkprobe, rkslave, rkattach, rkdgo, rkstd, "rk", rkdinfo, "hk", rkminfo, 1 }; struct buf rkutab[NRK]; short rkcyl[NRK]; #ifndef NOBADSECT struct dkbad rkbad[NRK]; struct buf brkbuf[NRK]; #endif struct rkst { short nsect; short ntrak; short nspc; short ncyl; struct size *sizes; } rkst[] = { NRKSECT, NRKTRK, NRKSECT*NRKTRK, NRK7CYL, rk7_sizes, NRKSECT, NRKTRK, NRKSECT*NRKTRK, NRK6CYL, rk6_sizes, }; u_char rk_offset[16] = { RKAS_P400,RKAS_M400,RKAS_P400,RKAS_M400,RKAS_P800,RKAS_M800,RKAS_P800, RKAS_M800,RKAS_P1200,RKAS_M1200,RKAS_P1200,RKAS_M1200,0,0,0,0 }; struct buf rrkbuf[NRK]; #define b_cylin b_resid #ifdef INTRLVE daddr_t dkblock(); #endif int rkwstart, rkwatch(); rkprobe(reg) caddr_t reg; { register int br, cvec; #ifdef lint br = 0; cvec = br; br = cvec; #endif ((struct rkdevice *)reg)->rkcs1 = RK_CDT|RK_IE|RK_CRDY; DELAY(10); ((struct rkdevice *)reg)->rkcs1 = RK_CDT; return (1); } rkslave(ui, reg) struct uba_device *ui; caddr_t reg; { register struct rkdevice *rkaddr = (struct rkdevice *)reg; ui->ui_type = 0; rkaddr->rkcs1 = RK_CCLR; rkaddr->rkcs2 = ui->ui_slave; rkaddr->rkcs1 = RK_CDT|RK_DCLR|RK_GO; rkwait(rkaddr); DELAY(50); if (rkaddr->rkcs2&RKCS2_NED || (rkaddr->rkds&RKDS_SVAL) == 0) { rkaddr->rkcs1 = RK_CCLR; return (0); } if (rkaddr->rkcs1&RK_CERR && rkaddr->rker&RKER_DTYE) { ui->ui_type = 1; rkaddr->rkcs1 = RK_CCLR; } return (1); } rkattach(ui) register struct uba_device *ui; { if (rkwstart == 0) { timeout(rkwatch, (caddr_t)0, hz); rkwstart++; } if (ui->ui_dk >= 0) dk_mspw[ui->ui_dk] = 1.0 / (60 * NRKSECT * 256); rkip[ui->ui_ctlr][ui->ui_slave] = ui; rk_softc[ui->ui_ctlr].sc_ndrive++; rkcyl[ui->ui_unit] = -1; ui->ui_flags = 0; } rkstrategy(bp) register struct buf *bp; { register struct uba_device *ui; register struct rkst *st; register int unit; register struct buf *dp; int xunit = minor(bp->b_dev) & 07; long bn, sz; sz = (bp->b_bcount+511) >> 9; unit = dkunit(bp); if (unit >= NRK) goto bad; ui = rkdinfo[unit]; if (ui == 0 || ui->ui_alive == 0) goto bad; st = &rkst[ui->ui_type]; if (bp->b_blkno < 0 || (bn = dkblock(bp))+sz > st->sizes[xunit].nblocks) goto bad; bp->b_cylin = bn/st->nspc + st->sizes[xunit].cyloff; (void) spl5(); dp = &rkutab[ui->ui_unit]; disksort(dp, bp); if (dp->b_active == 0) { (void) rkustart(ui); bp = &ui->ui_mi->um_tab; if (bp->b_actf && bp->b_active == 0) (void) rkstart(ui->ui_mi); } (void) spl0(); return; bad: bp->b_flags |= B_ERROR; iodone(bp); return; } rkustart(ui) register struct uba_device *ui; { register struct buf *bp, *dp; register struct uba_ctlr *um; register struct rkdevice *rkaddr; int didie = 0; if (ui == 0) return (0); dk_busy &= ~(1<ui_dk); dp = &rkutab[ui->ui_unit]; um = ui->ui_mi; rkaddr = (struct rkdevice *)um->um_addr; if (um->um_tab.b_active) { rk_softc[um->um_ctlr].sc_softas |= 1<ui_slave; return (0); } rkaddr->rkcs1 = rktypes[ui->ui_type]|RK_CERR; rkaddr->rkcs2 = ui->ui_slave; rkaddr->rkcs1 = rktypes[ui->ui_type]|RK_DCLR|RK_GO; rkwait(rkaddr); if ((bp = dp->b_actf) == NULL) { rkaddr->rkcs1 = rktypes[ui->ui_type]|RK_DCLR|RK_GO; rkwait(rkaddr); return (0); } if ((rkaddr->rkds & RKDS_VV) == 0 || ui->ui_flags == 0) { /* SHOULD WARN SYSTEM THAT THIS HAPPENED */ #ifndef NOBADSECT struct rkst *st = &rkst[ui->ui_type]; struct buf *bbp = &brkbuf[ui->ui_unit]; #endif rkaddr->rkcs1 = rktypes[ui->ui_type]|RK_PACK|RK_GO; ui->ui_flags = 1; #ifndef NOBADSECT bbp->b_flags = B_READ|B_BUSY; bbp->b_dev = bp->b_dev; bbp->b_bcount = 512; bbp->b_un.b_addr = (caddr_t)&rkbad[ui->ui_unit]; bbp->b_blkno = st->ncyl*st->nspc - st->nsect; bbp->b_cylin = st->ncyl - 1; dp->b_actf = bbp; bbp->av_forw = bp; bp = bbp; #endif rkwait(rkaddr); } if (dp->b_active) goto done; dp->b_active = 1; if ((rkaddr->rkds & RKDS_DREADY) != RKDS_DREADY) goto done; if (rk_softc[um->um_ctlr].sc_ndrive == 1) goto done; if (bp->b_cylin == rkcyl[ui->ui_unit]) goto done; rkaddr->rkcyl = bp->b_cylin; rkcyl[ui->ui_unit] = bp->b_cylin; rkaddr->rkcs1 = rktypes[ui->ui_type]|RK_IE|RK_SEEK|RK_GO; didie = 1; if (ui->ui_dk >= 0) { dk_busy |= 1<ui_dk; dk_seek[ui->ui_dk]++; } goto out; done: if (dp->b_active != 2) { dp->b_forw = NULL; if (um->um_tab.b_actf == NULL) um->um_tab.b_actf = dp; else um->um_tab.b_actl->b_forw = dp; um->um_tab.b_actl = dp; dp->b_active = 2; } out: return (didie); } rkstart(um) register struct uba_ctlr *um; { register struct buf *bp, *dp; register struct uba_device *ui; register struct rkdevice *rkaddr; struct rkst *st; daddr_t bn; int sn, tn, cmd; loop: if ((dp = um->um_tab.b_actf) == NULL) return (0); if ((bp = dp->b_actf) == NULL) { um->um_tab.b_actf = dp->b_forw; goto loop; } um->um_tab.b_active++; ui = rkdinfo[dkunit(bp)]; bn = dkblock(bp); st = &rkst[ui->ui_type]; sn = bn%st->nspc; tn = sn/st->nsect; sn %= st->nsect; rkaddr = (struct rkdevice *)ui->ui_addr; retry: rkaddr->rkcs1 = RK_CCLR; rkaddr->rkcs2 = ui->ui_slave; rkaddr->rkcs1 = rktypes[ui->ui_type]|RK_DCLR|RK_GO; rkwait(rkaddr); if ((rkaddr->rkds&RKDS_SVAL) == 0) { rknosval++; goto nosval; } if (rkaddr->rkds&RKDS_PIP) { rkpip++; goto retry; } if ((rkaddr->rkds&RKDS_DREADY) != RKDS_DREADY) { printf("rk%d: not ready", dkunit(bp)); if ((rkaddr->rkds&RKDS_DREADY) != RKDS_DREADY) { printf("\n"); rkaddr->rkcs1 = rktypes[ui->ui_type]|RK_DCLR|RK_GO; rkwait(rkaddr); rkaddr->rkcs1 = RK_CCLR; rkwait(rkad((dr); um->um_tab.b_active = 0; um->um_tab.b_errcnt = 0; dp->b_actf = bp->av_forw; dp->b_active = 0; bp->b_flags |= B_ERROR; iodone(bp); goto loop; } printf(" (came back!)\n"); } nosval: rkaddr->rkcyl = bp->b_cylin; rkcyl[ui->ui_unit] = bp->b_cylin; rkaddr->rkda = (tn << 8) + sn; rkaddr->rkwc = -bp->b_bcount / sizeof (short); if (bp->b_flags & B_READ) cmd = rktypes[ui->ui_type]|RK_IE|RK_READ|RK_GO; else cmd = rktypes[ui->ui_type]|RK_IE|RK_WRITE|RK_GO; um->um_cmd = cmd; (void) ubago(ui); return (1); } rkdgo(um) register struct uba_ctlr *um; { register struct rkdevice *rkaddr = (struct rkdevice *)um->um_addr; rkaddr->rkba = um->um_ubinfo; rkaddr->rkcs1 = um->um_cmd|((um->um_ubinfo>>8)&0x300); } rkintr(rk11) int rk11; { register struct uba_ctlr *um = rkminfo[rk11]; register struct uba_device *ui; register struct rkdevice *rkaddr = (struct rkdevice *)um->um_addr; register struct buf *bp, *dp; int unit; struct rk_softc *sc = &rk_softc[um->um_ctlr]; int as = (rkaddr->rkatt >> 8) | sc->sc_softas; int needie = 1; sc->sc_wticks = 0; sc->sc_softas = 0; if (um->um_tab.b_active) { dp = um->um_tab.b_actf; bp = dp->b_actf; ui = rkdinfo[dkunit(bp)]; dk_busy &= ~(1 << ui->ui_dk); #ifndef NOBADSECT if (bp->b_flags&B_BAD) if (rkecc(ui, CONT)) return; #endif if (rkaddr->rkcs1 & RK_CERR) { int recal; u_short ds = rkaddr->rkds; u_short cs2 = rkaddr->rkcs2; u_short er = rkaddr->rker; #ifdef RKDEBUG if (rkdebug) { printf("cs2=%b ds=%b er=%b\n", cs2, RKCS2_BITS, ds, RKDS_BITS, er, RKER_BITS); } #endif if (er & RKER_WLE) { printf("rk%d: write locked\n", dkunit(bp)); bp->b_flags |= B_ERROR; } else if (++um->um_tab.b_errcnt > 28 || ds&RKDS_HARD || er&RKER_HARD || cs2&RKCS2_HARD) { hard: harderr(bp, "rk"); printf("cs2=%b ds=%b er=%b\n", cs2, RKCS2_BITS, ds, RKDS_BITS, er, RKER_BITS); bp->b_flags |= B_ERROR; sc->sc_recal = 0; } else if (er & RKER_BSE) { #ifndef NOBADSECT if (rkecc(ui, BSE)) return; else #endif goto hard; } else um->um_tab.b_active = 0; if (cs2&RKCS2_MDS) { rkaddr->rkcs2 = RKCS2_SCLR; goto retry; } recal = 0; if (ds&RKDS_DROT || er&(RKER_OPI|RKER_SKI|RKER_UNS) || (um->um_tab.b_errcnt&07) == 4) recal = 1; if ((er & (RKER_DCK|RKER_ECH)) == RKER_DCK) if (rkecc(ui, ECC)) return; rkaddr->rkcs1 = RK_CCLR; rkaddr->rkcs2 = ui->ui_slave; rkaddr->rkcs1 = rktypes[ui->ui_type]|RK_DCLR|RK_GO; rkwait(rkaddr); if (recal && um->um_tab.b_active == 0) { rkaddr->rkcs1 = rktypes[ui->ui_type]|RK_IE|RK_RECAL|RK_GO; rkcyl[ui->ui_unit] = -1; sc->sc_recal = 0; goto nextrecal; } } retry: switch (sc->sc_recal) { case 1: rkaddr->rkcyl = bp->b_cylin; rkcyl[ui->ui_unit] = bp->b_cylin; rkaddr->rkcs1 = rktypes[ui->ui_type]|RK_IE|RK_SEEK|RK_GO; goto nextrecal; case 2: if (um->um_tab.b_errcnt < 16 || (bp->b_flags&B_READ) == 0) goto donerecal; rkaddr->rkatt @iyky$C7&i6i= rk_offset[um->um_tab.b_errcnt & 017]; rkaddr->rkcs1 = rktypes[ui->ui_type]|RK_IE|RK_OFFSET|RK_GO; /* fall into ... */ nextrecal: sc->sc_recal++; rkwait(rkaddr); um->um_tab.b_active = 1; return; donerecal: case 3: sc->sc_recal = 0; um->um_tab.b_active = 0; break; } ubadone(um); if (um->um_tab.b_active) { um->um_tab.b_active = 0; um->um_tab.b_errcnt = 0; um->um_tab.b_actf = dp->b_forw; dp->b_active = 0; dp->b_errcnt = 0; dp->b_actf = bp->av_forw; bp->b_resid = -rkaddr->rkwc * sizeof(short); iodone(bp); if (dp->b_actf) if (rkustart(ui)) needie = 0; } as &= ~(1<ui_slave); } for (unit = 0; as; as >>= 1, unit++) if (as & 1) { ui = rkip[rk11][unit]; if (ui) { if (rkustart(rkip[rk11][unit])) needie = 0; } else { rkaddr->rkcs1 = RK_CCLR; rkaddr->rkcs2 = unit; rkaddr->rkcs1 = RK_DCLR|RK_GO; rkwait(rkaddr); rkaddr->rkcs1 = RK_CCLR; } } if (um->um_tab.b_actf && um->um_tab.b_active == 0) if (rkstart(um)) needie = 0; if (needie) rkaddr->rkcs1 = RK_IE; } rkwait(addr) register struct rkdevice *addr; { while ((addr->rkcs1 & RK_CRDY) == 0) ; } rkread(dev) dev_t dev; { register int unit = minor(dev) >> 3; if (unit >= NRK) u.u_error = ENXIO; else physio(rkstrategy, &rrkbuf[unit], dev, B_READ, minphys); } rkwrite(dev) dev_t dev; { register int unit = minor(dev) >> 3; if (unit >= NRK) u.u_error = ENXIO; else physio(rkstrategy, &rrkbuf[unit], dev, B_WRITE, minphys); } rkecc(ui, flag) register struct uba_device *ui; { register struct rkdevice *rk = (struct rkdevice *)ui->ui_addr; register struct buf *bp = rkutab[ui->ui_unit].b_actf; register struct uba_ctlr *um = ui->ui_mi; register struct rkst *st; struct uba_regs *ubp = ui->ui_hd->uh_uba; caddr_t addr; int reg, npf, o, cmd, ubaddr; int bn, cn, tn, sn; #ifndef NOBADSECT if (flag == CONT) npf = bp->b_error; else #endif npf = btop((rk->rkwc * sizeof(short)) + bp->b_bcount); reg = btop(um->um_ubinfo&0x3ffff) + npf; o = (int)bp->b_un.b_addr & PGOFSET; bn = dkblock(bp); st = &rkst[ui->ui_type]; cn = bp->b_cylin; sn = bn%st->nspc + npf; tn = sn/st->nsect; sn %= st->nsect; cn += tn/st->ntrak; tn %= st->ntrak; ubapurge(um); um->um_tab.b_active++; /* Either complete or continuing... */ switch (flag) { case ECC: { register int i; int bit, byte, mask; npf--; reg--; printf("rk%d%c: soft ecc sn%d\n", dkunit(bp), 'a'+(minor(bp->b_dev)&07), bp->b_blkno + npf); mask = rk->rkec2; i = rk->rkec1 - 1; /* -1 makes 0 origin */ bit = i&07; i = (i&~07)>>3; byte = i + o; while (i < 512 && (int)ptob(npf)+i < bp->b_bcount && bit > -11) { addr = ptob(ubp->uba_map[reg+btop(byte)].pg_pfnum)+ (byte & PGOFSET); putmemc(addr, getmemc(addr)^(mask<rkwc == 0) return (0); npf++; reg++; break; } #ifndef NOBADSECT case BSE: #ifdef RKBDEBUG if (rkbdebug) printf("rkecc, BSE: bn %d cn %d tn %d sn %d\n", bn, cn, tn, sn); #endif if ((bn = isbad(&rkbad[ui->ui_unit], cn, tn, sn)) < 0) return(0); bp->b_flags |= B_BAD; bp->b_error = npf + 1; bn = st->ncyl*st->nspc - st->nsect - 1 - bn; cn = bn/st->nspc; sn = bn%st->nspc; tn = sn/st->nsect; sn %= st->nsect; #ifdef RKBDEBUG if (rkbdebug) printf("revector to cn %d tn %d sn %d\n", cn, tn, sn); #endif rk->rkwc = -(512 / sizeof (short)); break; case CONT: #ifdef RKBDEBUG if (rkbdebug) printf("rkecc, CONT: bn %d cn %d tn %d sn %d\n", bn,cn,tn,sn); #endif bp->b_flags &= ~B_BAD; rk->rkwc = -((bp->b_bcount - (int)ptob(npf)) / sizeof (short)); if (rk->rkwc == 0) return(0); break; #endif } rk->rkcs1 = RK_CCLR; rk->rkcs2 = ui->ui_slave; rk->rkcs1 = rktypes[ui->ui_type]|RK_DCLR|RK_GO; rkwait(rk); rk->rkcyl = cn; rk->rkda = (tn << 8) | sn; ubaddr = (int)ptob(reg) + o; rk->rkba = ubaddr; cmd = (bp->b_flags&B_READ ? RK_READ : RK_WRITE)|RK_IE|RK_GO; cmd |= (ubaddr >> 8) & 0x300; cmd |= rktypes[ui->ui_type]; rk->rkcs1 = cmd; um->um_tab.b_errcnt = 0; /* error has been corrected */ return (1); } rkreset(uban) int uban; { register struct uba_ctlr *um; register struct uba_device *ui; register rk11, unit; for (rk11 = 0; rk11 < NHK; rk11++) { if ((um = rkminfo[rk11]) == 0 || um->um_ubanum != uban || um->um_alive == 0) continue; printf(" hk%d", rk11); um->um_tab.b_active = 0; um->um_tab.b_actf = um->um_tab.b_actl = 0; rk_softc[um->um_ctlr].sc_recal = 0; if (um->um_ubinfo) { printf("<%d>", (um->um_ubinfo>>28)&0xf); ubadone(um); } for (unit = 0; unit < NRK; unit++) { if ((ui = rkdinfo[unit]) == 0) continue; if (ui->ui_alive == 0 || ui->ui_mi != um) continue; rkutab[unit].b_active = 0; (void) rkustart(ui); } (void) rkstart(um); } } rkwatch() { register struct uba_ctlr *um; register rk11, unit; register struct rk_softc *sc; timeout(rkwatch, (caddr_t)0, hz); for (rk11 = 0; rk11 < NHK; rk11++) { um = rkminfo[rk11]; if (um == 0 || um->um_alive == 0) continue; sc = &rk_softc[rk11]; if (um->um_tab.b_active == 0) { for (unit = 0; unit < NRK; unit++) if (rkutab[unit].b_active && rkdinfo[unit]->ui_mi == um) goto active; sc->sc_wticks = 0; continue; } active: sc->sc_wticks++; if (sc->sc_wticks >= 20) { sc->sc_wticks = 0; printf("hk%d: lost interrupt\n", rk11); ubareset(um->um_ubanum); } } } #define DBSIZE 20 rkdump(dev) dev_t dev; { struct rkdevice *rkaddr; char *start; int num, blk, unit; struct size *sizes; register struct uba_regs *uba; register struct uba_device *ui; register short *rp; struct rkst *st; unit = minor(dev) >> 3; if (unit >= NRK) return (ENXIO); #define phys(cast, addr) ((cast)((int)addr & 0x7fffffff)) ui = phys(struct uba_device *, rkdinfo[unit]); if (ui->ui_alive == 0) return (ENXIO); uba = phys(struct uba_hd *, ui->ui_hd)->uh_physuba; ubainit(uba); rkaddr = (struct rkdevice *)ui->ui_physaddr; num = maxfree; start = 0; rkaddr->rkcs1 = RK_CCLR; rkaddr->rkcs2 = unit; rkaddr->rkcs1 = rktypes[ui->ui_type]|R((K_DCLR|RK_GO; rkwait(rkaddr); if ((rkaddr->rkds & RKDS_VV) == 0) { rkaddr->rkcs1 = rktypes[ui->ui_type]|RK_IE|RK_PACK|RK_GO; rkwait(rkaddr); } st = &rkst[ui->ui_type]; sizes = phys(struct size *, st->sizes); if (dumplo < 0 || dumplo + num >= sizes[minor(dev)&07].nblocks) return (EINVAL); while (num > 0) { register struct pte *io; register int i; int cn, sn, tn; daddr_t bn; blk = num > DBSIZE ? DBSIZE : num; io = uba->uba_map; for (i = 0; i < blk; i++) *(int *)io++ = (btop(start)+i) | (1<<21) | UBAMR_MRV; *(int *)io = 0; bn = dumplo + btop(start); cn = bn/st->nspc + sizes[minor(dev)&07].cyloff; sn = bn%st->nspc; tn = sn/st->nsect; sn = sn%st->nsect; rkaddr->rkcyl = cn; rp = (short *) &rkaddr->rkda; *rp = (tn << 8) + sn; *--rp = 0; *--rp = -blk*NBPG / sizeof (short); *--rp = rktypes[ui->ui_type]|RK_GO|RK_WRITE; rkwait(rkaddr); if (rkaddr->rkcs1 & RK_CERR) return (EIO); start += blk*NBPG; num -= blk; } return (0); } #endif @ik{$>%9&iSP6i /* ttyold.c 4.9 81/07/22 */ /* * general TTY subroutines */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/tty.h" #include "../h/proc.h" #include "../h/mx.h" #include "../h/inode.h" #include "../h/file.h" #include "../h/reg.h" #include "../h/conf.h" #include "../h/buf.h" #include "../h/dk.h" char partab[]; /* * Input mapping table-- if an entry is non-zero, when the * corresponding character is typed preceded by "\" the escape * sequence is replaced by the table value. Mostly used for * upper-case only terminals. */ char maptab[]; #define OBUFSIZ 100 /* * routine called on first teletype open. * establishes a process group for distribution * of quits and interrupts from the tty. */ ttyopen(dev, tp) dev_t dev; register struct tty *tp; { register struct proc *pp; pp = u.u_procp; tp->t_dev = dev; if(pp->p_pgrp == 0) { u.u_ttyp = tp; u.u_ttyd = dev; if (tp->t_pgrp == 0) tp->t_pgrp = pp->p_pid; pp->p_pgrp = tp->t_pgrp; } tp->t_state &= ~WOPEN; tp->t_state |= ISOPEN; tp->t_line = 0; /* conservative */ } /* * clean tp on last close */ ttyclose(tp) register struct tty *tp; { tp->t_pgrp = 0; wflushtty(tp); tp->t_state = 0; tp->t_line = 0; } /* * transfer raw input list to canonical list, * doing erase-kill processing and handling escapes. * It waits until a full line has been typed in cooked mode, * or until any character has been typed in raw mode. */ canon(tp) register struct tty *tp; { register char *bp; char *bp1; register int c; int mc; int s; if ((tp->t_flags&(RAW|CBREAK))==0 && tp->t_delct==0 || (tp->t_flags&(RAW|CBREAK))!=0 && tp->t_rawq.c_cc==0) { return(-1); } s = spl0(); loop: bp = &canonb[2]; while ((c=getc(&tp->t_rawq)) >= 0) { if ((tp->t_flags&(RAW|CBREAK))==0) { if (c==0377) { tp->t_delct--; break; } if (bp[-1]!='\\') { if (c==tp->t_erase) { if (bp > &canonb[2]) bp--; continue; } if (c==tp->t_kill) goto loop; if (c==tun.t_eofc) continue; } else { mc = maptab[c]; if (c==tp->t_erase || c==tp->t_kill) mc = c; if (mc && (mc==c || (tp->t_flags&LCASE))) { if (bp[-2] != '\\') c = mc; bp--; } } } *bp++ = c; if (bp>=canonb+CANBSIZ) break; } bp1 = &canonb[2]; (void) b_to_q(bp1, bp-bp1, &tp->t_canq); if (tp->t_state&TBLOCK && tp->t_rawq.c_cc < TTYHOG/5) { if (putc(tun.t_startc, &tp->t_outq)==0) { tp->t_state &= ~TBLOCK; ttstart(tp); } tp->t_char = 0; } splx(s); return(0); } /* * block transfer input handler. */ ttyrend(tp, pb, pe) register struct tty *tp; register char *pb, *pe; { int tandem; tandem = tp->t_flags&TANDEM; if (tp->t_flags&RAW) { (void) b_to_q(pb, pe-pb, &tp->t_rawq); if (tp->t_chan) (void) sdata(tp->t_chan); wakeup((caddr_t)&tp->t_rawq); } else { tp->t_flags &= ~TANDEM; while (pb < pe) ttyinput(*pb++, tp); tp->t_flags |= tandem; } if (tandem) ttyblock(tp); } /* * Place a character on raw TTY input queue, putting in delimiters * and waking up top half as needed. * Also echo if required. * The arguments are the character and the appropriate * tty structure. */ ttyinput(c, tp) register c; register struct tty *tp; { register int t_flags; register struct chan *cp; tk_nin += 1; c &= 0377; t_flags = tp->t_flags; if (t_flags&TANDEM) ttyblock(tp); if ((t_flags&RAW)==0) { c &= 0177; if (tp->t_state&TTSTOP) { if (c==tun.t_startc) { tp->t_state &= ~TTSTOP; ttstart(tp); return; } if (c==tun.t_stopc) return; if ((tp->t_local & LDECCTQ) == 0) { tp->t_state &= ~TTSTOP; ttstart(tp); } } else { if (c==tun.t_stopc) { tp->t_state |= TTSTOP; (*cdevsw[major(tp->t_dev)].d_stop)(tp); return; } if (c==tun.t_startc) return; } if (c==tun.t_quitc || c==tun.t_intrc) { if ((tp->t_local & LNOFLSH) == 0) flushtty(tp, FREAD|FWRITE); c = (c==tun.t_intrc) ? SIGINT:SIGQUIT; if (tp->t_chan) scontrol(tp->t_chan, M_SIG, c); gsignal(tp->t_pgrp, c); return; } if (c=='\r' && t_flags&CRMOD) c = '\n'; } if (tp->t_rawq.c_cc>TTYHOG) { flushtty(tp, FREAD|FWRITE); return; } if (t_flags&LCASE && c>='A' && c<='Z') c += 'a'-'A'; (void) putc(c, &tp->t_rawq); if (t_flags&(RAW|CBREAK)||(c=='\n'||c==tun.t_eofc||c==tun.t_brkc)) { if ((t_flags&(RAW|CBREAK))==0 && putc(0377, &tp->t_rawq)==0) tp->t_delct++; if ((cp=tp->t_chan)!=NULL) (void) sdata(cp); wakeup((caddr_t)&tp->t_rawq); } if (t_flags&ECHO) { ttyoutput(c, tp); if (c==tp->t_kill && (t_flags&(RAW|CBREAK))==0) ttyoutput('\n', tp); ttstart(tp); } } /* * put character on TTY output queue, adding delays, * expanding tabs, and handling the CR/NL bit. * It is called both from the top half for output, and from * interrupt level for echoing. * The arguments are the character and the tty structure. */ ttyoutput(c, tp) register c; register struct tty *tp; { register char *colp; register ctype; /* * Ignore EOT in normal mode to avoid hanging up * certain terminals. * In raw mode dump the char unchanged. */ if ((tp->t_flags&RAW)==0) { c &= 0177; if ((tp->t_flags&CBREAK)==0 && c==CEOT) return; } else { tk_nout++; (void) putc(c, &tp->t_outq); return; } /* * Turn tabs to spaces as required */ if (c=='\t' && (tp->t_flags&TBDELAY)==XTABS) { c = 8 - (tp->t_col & 7); (void) b_to_q(" ", c, &tp->t_outq); tp->t_col += c; tk_nout += c; return; } tk_nout++; /* * for upper-case-only terminals, * generate escapes. */ if (tp->t_flags&LCASE) { colp = "({)}!|^~'`"; while(*colp++) if(c == *colp++) { ttyoutput('\\', tp); c = colp[-2]; break; } if ('a'<=c && c<='z') c += 'A' - 'a'; } /* * turn to if desired. */ if (c=='\n' && tp->t_flags&CRMOD) ttyoutput('\r', tp); (void) putc(c, &tp->t_outq); /* * Calculate delays. * The numbers here represent clock ticks * and are not necessarily optimal for all terminals. * The delays are indicated by characters above 0200. * In raw mode there are no delays and the * transmission path is 8 bits wide. */ colp = &tp->t_col; ctype = partab[c]; c = 0; switch (ctype&077) { /* ordinary */ case 0: (*colp)++; /* non-printing */ case 1: break; /* backspace */ case 2: if (*colp) (*colp)--; break; /* newline */ case 3: ctype = (tp->t_flags >> 8) & 03; if(ctype == 1) { /* tty 37 */ if (*colp) c = max(((unsigned)*colp>>4) + 3, (unsigned)6); } else if(ctype == 2) { /* vt05 */ c = 6; } *colp = 0; break; /* tab */ case 4: ctype = (tp->t_flags >> 10) & 03; if(ctype == 1) { /* tty 37 */ c = 1 - (*colp | ~07); if(c < 5) c = 0; } *colp |= 07; (*colp)++; break; /* vertical motion */ case 5: if(tp->t_flags & VTDELAY) /* tty 37 */ c = 0177; break; /* carriage return */ case 6: ctype = (tp->t_flags >> 12) & 03; if(ctype == 1) { /* tn 300 */ c = 5; } else if(ctype == 2) { /* ti 700 */ c = 10; } else if(ctype == 3) { /* concept 100 */ int i; if ((i = *colp) >= 0) for (; i<9; i++) (void) putc(0177, &tp->t_outq); } *colp = 0; } if(c) (void) putc(c|0200, &tp->t_outq); } /* * Called from device's read routine after it has * calculated the tty-structure given as argument. */ ttread(tp) register struct tty *tp; { register s; if ((tp->t_state&CARR_ON)==0) return(-1); s = spl5(); if (tp->t_canq.c_cc==0) while (canon(tp)<0) if (tp->t_chan==NULL || (getf(u.u_ap[0])->f_flag&FMP)==0) { sleep((caddr_t)&tp->t_rawq, TTIPRI); } else { splx(s); return(0); } splx(s); while (tp->t_canq.c_cc && passc(getc(&tp->t_canq))>=0) ; return(tp->t_rawq.c_cc+tp->t_canq.c_cc); } /* * Called from the device's write routine after it has * calculated the tty-structure given as argument. */ caddr_t ttwrite(tp) register struct tty *tp; { /* * THE POSITIONING OF CP, CC, AND CE ARE CRITICAL * AND MUST NOT BE CHANGED WITHOUT PATCHING * THE 'ASM' INLINES BELOW. WATCH OUT. */ register char *cp; register int cc, ce; register i((; char obuf[OBUFSIZ]; int hiwat = TTHIWAT(tp); if ((tp->t_state&CARR_ON)==0) return(NULL); while (u.u_count) { cc = MIN(u.u_count, OBUFSIZ); cp = obuf; iomove(cp, (unsigned)cc, B_WRITE); if (u.u_error) break; (void) spl5(); while (tp->t_outq.c_cc > hiwat) { ttstart(tp); tp->t_state |= ASLEEP; if (tp->t_chan && u.u_segflg == 0 && (getf(u.u_ap[0])->f_flag&FMP)) { u.u_base -= cc; u.u_offset -= cc; u.u_count += cc; (void) spl0(); return((caddr_t)&tp->t_outq); } sleep((caddr_t)&tp->t_outq, TTOPRI); } (void) spl0(); if (tp->t_flags&LCASE) { while (cc--) ttyoutput(*cp++,tp); continue; } while (cc) { if (tp->t_flags&RAW) ce=cc; else { #ifdef vax asm(" scanc r9,(r10),_partab,$077"); asm(" subl3 r0,r9,r8"); #else ce=0; while(((partab[*(unsigned char *)(cp+ce)]&077)==0)&&(cet_outq); ce-=i; tk_nout+=ce; tp->t_col+=ce; cp+=ce; cc-=ce; check: if (tp->t_outq.c_cc > hiwat) { (void) spl5(); while (tp->t_outq.c_cc > hiwat) { ttstart(tp); tp->t_state |= ASLEEP; sleep((caddr_t)&tp->t_outq, TTOPRI); } (void) spl0(); } } } ttstart(tp); return(NULL); } @ik ?~$^H9&iSP6i /* ttynew.c 4.13 81/07/22 */ /* * New version of tty driver, supported * as NTTYDISC. Adapted from a tty.c written * by J.E.Kulp of IIASA, Austria (jekulp@mc) */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/tty.h" #include "../h/proc.h" #include "../h/mx.h" #include "../h/inode.h" #include "../h/file.h" #include "../h/reg.h" #include "../h/conf.h" #include "../h/buf.h" #include "../h/dk.h" char partab[]; /* * Input mapping table-- if an entry is non-zero, when the * corresponding character is typed preceded by "\" the escape * sequence is replaced by the table value. Mostly used for * upper-case only terminals. */ char maptab[]; /* see tty.c */ /* * shorthand */ #define q1 tp->t_rawq #define q2 tp->t_canq #define q3 tp->t_outq #define q4 tp->t_un.t_ctlq #define OBUFSIZ 100 /* * routine called on opens while tp->t_line == NTTYDISC * establishes a process group for distribution of * quits and interrupts from the tty. * (actually, pp->p_pgrp can't be 0 when this routine * is called since NTTYDISC is not the default discipline) */ ntyopen(dev, tp) dev_t dev; register struct tty *tp; { register struct proc *pp; pp = u.u_procp; tp->t_dev = dev; if(pp->p_pgrp == 0) { u.u_ttyp = tp; u.u_ttyd = dev; if (tp->t_pgrp == 0) tp->t_pgrp = pp->p_pid; pp->p_pgrp = tp->t_pgrp; } tp->t_state &= ~WOPEN; tp->t_state |= ISOPEN; if (tp->t_line != NTTYDISC) wflushtty(tp); } /* * clean tp on last close */ ntyclose(tp) register struct tty *tp; { wflushtty(tp); /* let ttyclose do the work if we are really closing */ } /* * block transfer input handler. */ ntyrend(tp, pb, pe) register struct tty *tp; register char *pb, *pe; { int tandem; tandem = tp->t_flags&TANDEM; if (tp->t_flags&RAW) { (void) b_to_q(pb, pe-pb, &tp->t_rawq); if (tp->t_chan) (void) sdata(tp->t_chan); wakeup((caddr_t)&tp->t_rawq); } else { tp->t_flags &= ~TANDEM; while (pb < pe) ntyinput(*pb++, tp); tp->t_flags |= tandem; } if (tandem) ttyblock(tp); } /* * reinput pending characters after state switch * call at spl5(). */ ntypend(tp) register struct tty *tp; { struct clist tq; register c; tp->t_local &= ~LPENDIN; tp->t_lstate |= LSTYPEN; tq = tp->t_rawq; tp->t_rawq.c_cc = 0; tp->t_rawq.c_cf = tp->t_rawq.c_cl = 0; while ((c = getc(&tq)) >= 0) ntyinput(c, tp); tp->t_lstate &= ~LSTYPEN; } /* * Place a character on raw TTY input queue, putting in delimiters * and waking up top half as needed. * Also echo if required. * The arguments are the character and the appropriate * tty structure. */ ntyinput(c, tp) register c; register struct tty *tp; { register int t_flags; int i; if (tp->t_local&LPENDIN) ntypend(tp); tk_nin++; c &= 0377; t_flags = tp->t_flags; if (t_flags&TANDEM) ttyblock(tp); if ((t_flags&RAW)==0) { if ((tp->t_lstate&LSTYPEN) == 0) c &= 0177; /* check for literal nexting very first */ if (tp->t_lstate&LSLNCH) { c |= 0200; tp->t_lstate &= ~LSLNCH; } if (c==tlun.t_lnextc) { if (tp->t_flags&ECHO) ntyout("^\b", tp); tp->t_lstate |= LSLNCH; /* check for output control functions */ } else if (c==tun.t_stopc) { if ((tp->t_state&TTSTOP)==0) { tp->t_state |= TTSTOP; (*cdevsw[major(tp->t_dev)].d_stop)(tp); return; } if (c!=tun.t_startc) return; } else if (c==tun.t_startc) { tp->t_state &= ~TTSTOP; tp->t_local &= ~LFLUSHO; ttstart(tp); return; } else if (c==tlun.t_flushc) { if (tp->t_local & LFLUSHO) tp->t_local &= ~LFLUSHO; else { flushtty(tp, FWRITE); ntyecho(c, tp); if (tp->t_rawq.c_cc+tp->t_canq.c_cc) ntyretype(tp); tp->t_local |= LFLUSHO; } ttstart(tp); return; } else if (c==tlun.t_suspc || c==tun.t_intrc || c==tun.t_quitc) { if ((tp->t_local & LNOFLSH) == 0) flushtty(tp, c==tlun.t_suspc ? FREAD : FREAD|FWRITE); ntyecho(c, tp); c = c==tun.t_intrc ? SIGINT : ((c==tun.t_quitc) ? SIGQUIT : SIGTSTP); if (tp->t_chan) scontrol(tp->t_chan, M_SIG, c); gsignal(tp->t_pgrp, c); /* check for buffer editing functions - cooked mode */ } else if ((t_flags&CBREAK) == 0) { if ((tp->t_lstate&LSQUOT) && (c==tp->t_erase||c==tp->t_kill)) { ntyrub(unputc(&tp->t_rawq), tp); c |= 0200; } if (c==tp->t_erase) { if (tp->t_rawq.c_cc) ntyrub(unputc(&tp->t_rawq), tp); } else if (c==tp->t_kill) { if (tp->t_local&LCRTKIL && tp->t_rawq.c_cc == tp->t_rocount) { while (tp->t_rawq.c_cc) ntyrub(unputc(&tp->t_rawq), tp); } else { ntyecho(c, tp); ntyecho('\n', tp); while (getc(&tp->t_rawq) > 0) ; tp->t_rocount = 0; } tp->t_lstate = 0; } else if (c==tlun.t_werasc) { if (tp->t_rawq.c_cc == 0) goto out; do { c = unputc(&tp->t_rawq); if (c != ' ' && c != '\t') goto erasenb; ntyrub(c, tp); } while (tp->t_rawq.c_cc); goto out; erasenb: do { ntyrub(c, tp); if (tp->t_rawq.c_cc == 0) goto out; c = unputc(&tp->t_rawq); } while (c != ' ' && c != '\t'); (void) putc(c, &tp->t_rawq); } else if (c==tlun.t_rprntc) { ntyretype(tp); /* check for cooked mode input buffer overflow */ } else if (tp->t_rawq.c_cc + tp->t_canq.c_cc > TTYHOG) { /* we should start a timeout that flushes the buffer if it stays full - same in CBREAK */ if (tp->t_outq.c_cc < TTHIWAT(tp)) (void) ntyoutput(CTRL(g), tp); /* put data char in q for user and wakeup if a break char */ } else if (putc(c, &tp->t_rawq) >= 0) { if (!ntbreakc(c, tp)) { if (tp->t_rocount++ == 0) tp->t_rocol = tp->t_col; } else { tp->t_rocount = 0; catq(&tp->t_rawq, &tp->t_canq); if (tp->t_chan) (void) sdata(tp->t_chan); wakeup((caddr_t)&tp->t_rawq); if (tp->t_local&LINTRUP) gsignal(tp->t_pgrp, SIGTINT); } tp->t_lstate &= ~LSQUOT; if (c == '\\') tp->t_lstate |= LSQUOT; if (tp->t_lstate&LSERASE) { tp->t_lstate &= ~LSERASE; (void) ntyoutput('/', tp); } i = tp->t_col; ntyecho(c, tp); if (c==tun.t_eofc && tp->t_flags&ECHO) { i = MIN(2, tp->t_col - i); while (i > 0) { (void) ntyoutput('\b', tp); i--; } } } /* CBREAK mode */ } else if (tp->t_rawq.c_cc > TTYHOG) { if (tp->t_outq.c_cc < TTHIWAT(tp)) (void) ntyoutput(CTRL(g), tp); } else if (putc(c, &tp->t_rawq) >= 0) { if (tp->t_local&LINTRUP) gsignal(tp->t_pgrp, SIGTINT); if (tp->t_chan) (void) sdata(tp->t_chan); wakeup((caddr_t)&tp->t_rawq); ntyecho(c, tp); } /* RAW mode */ } else if (tp->t_rawq.c_cc > TTYHOG) flushtty(tp, FREAD|FWRITE); else { if (putc(c, &tp->t_rawq) >= 0) { if (tp->t_local&LINTRUP) gsignal(tp->t_pgrp, SIGTINT); if (tp->t_chan) (void) sdata(tp->t_chan); wakeup((caddr_t)&tp->t_rawq); } ntyecho(c, tp); } out: if (tp->t_local & LDECCTQ && tp->t_state & TTSTOP && tun.t_startc != tun.t_stopc) return; tp->t_state &= ~TTSTOP; tp->t_local &= ~LFLUSHO; ttstart(tp); } /* * put character on TTY ou((tput queue, adding delays, * expanding tabs, and handling the CR/NL bit. * It is called both from the top half for output, and from * interrupt level for echoing. * The arguments are the character and the tty structure. * Returns < 0 if putc succeeds, otherwise returns char to resend * Must be recursive. */ ntyoutput(c, tp) register c; register struct tty *tp; { register char *colp; register ctype; if (tp->t_flags&RAW || tp->t_local&LLITOUT) { if (tp->t_local&LFLUSHO) return (-1); if (putc(c, &tp->t_outq)) return(c); tk_nout++; return (-1); } /* * Ignore EOT in normal mode to avoid hanging up * certain terminals. */ c &= 0177; if (c==CEOT && (tp->t_flags&CBREAK)==0) return (-1); /* * Turn tabs to spaces as required */ if (c=='\t' && (tp->t_flags&TBDELAY)==XTABS) { register int s; c = 8 - (tp->t_col&7); if ((tp->t_local&LFLUSHO) == 0) { s = spl5(); /* don't interrupt tabs */ c -= b_to_q(" ", c, &tp->t_outq); tk_nout += c; splx(s); } tp->t_col += c; return (c ? -1 : '\t'); } tk_nout++; /* * for upper-case-only terminals, * generate escapes. */ if (tp->t_flags&LCASE) { colp = "({)}!|^~'`"; while(*colp++) if(c == *colp++) { if (ntyoutput('\\', tp) >= 0) return (c); c = colp[-2]; break; } if ('A'<=c && c<='Z') { if (ntyoutput('\\', tp) >= 0) return (c); } else if ('a'<=c && c<='z') c += 'A' - 'a'; } /* * turn to if desired. */ if (c=='\n' && tp->t_flags&CRMOD) if (ntyoutput('\r', tp) >= 0) return (c); if (c=='~' && tp->t_local<ILDE) c = '`'; if ((tp->t_local&LFLUSHO) == 0 && putc(c, &tp->t_outq)) return (c); /* * Calculate delays. * The numbers here represent clock ticks * and are not necessarily optimal for all terminals. * The delays are indicated by characters above 0200. * In raw mode there are no delays and the * transmission path is 8 bits wide. */ colp = &tp->t_col; ctype = partab[c]; c = 0; switch (ctype&077) { case ORDINARY: (*colp)++; case CONTROL: break; case BACKSPACE: if (*colp) (*colp)--; break; case NEWLINE: ctype = (tp->t_flags >> 8) & 03; if(ctype == 1) { /* tty 37 */ if (*colp) c = max(((unsigned)*colp>>4) + 3, (unsigned)6); } else if(ctype == 2) { /* vt05 */ c = 6; } *colp = 0; break; case TAB: ctype = (tp->t_flags >> 10) & 03; if(ctype == 1) { /* tty 37 */ c = 1 - (*colp | ~07); if(c < 5) c = 0; } *colp |= 07; (*colp)++; break; case VTAB: if(tp->t_flags & VTDELAY) /* tty 37 */ c = 0177; break; case RETURN: ctype = (tp->t_flags >> 12) & 03; if(ctype == 1) { /* tn 300 */ c = 5; } else if(ctype == 2) { /* ti 700 */ c = 10; } else if(ctype == 3) { /* concept 100 */ int i; if ((i = *colp) >= 0) for (; i<9; i++) (void) putc(0177, &tp->t_outq); } *colp = 0; } if(c && (tp->t_local&LFLUSHO) == 0) (void) putc(c|0200, &tp->t_outq); return (-1); } /* * Called from device's read routine after it has * calculated the tty-s@ik ?~$^H9&iSP6itructure given as argument. */ ntread(tp) register struct tty *tp; { register struct clist *qp; register c, first; if ((tp->t_state&CARR_ON)==0) return(0); loop: (void) spl5(); if (tp->t_local&LPENDIN) ntypend(tp); (void) spl0(); while (tp == u.u_ttyp && u.u_procp->p_pgrp != tp->t_pgrp) { if (u.u_signal[SIGTTIN] == SIG_IGN || u.u_signal[SIGTTIN] == SIG_HOLD || (u.u_procp->p_flag&SDETACH) || u.u_procp->p_flag&SVFORK) return (0); gsignal(u.u_procp->p_pgrp, SIGTTIN); sleep((caddr_t)&lbolt, TTIPRI); } if (tp->t_flags&RAW) { (void) spl5(); if (tp->t_rawq.c_cc <= 0) { if ((tp->t_state&CARR_ON)==0 || (tp->t_chan && getf(u.u_ap[0])->f_flag&FMP)) { (void) spl0(); return (0); } if (tp->t_local&LINTRUP && u.u_signal[SIGTINT] != SIG_DFL) { u.u_error = EIO; (void) spl0(); return (0); } sleep((caddr_t)&tp->t_rawq, TTIPRI); (void) spl0(); goto loop; } (void) spl0(); while (tp->t_rawq.c_cc && passc(getc(&tp->t_rawq))>=0) ; return (0); } else { qp = tp->t_flags & CBREAK ? &tp->t_rawq : &tp->t_canq; (void) spl5(); if (qp->c_cc <= 0) { if ((tp->t_state&CARR_ON)==0 || (tp->t_chan!=NULL && getf(u.u_ap[0])->f_flag&FMP)) { (void) spl0(); return (0); } if (tp->t_local&LINTRUP && u.u_signal[SIGTINT] != SIG_DFL) { u.u_error = EIO; (void) spl0(); return (0); } sleep((caddr_t)&tp->t_rawq, TTIPRI); (void) spl0(); goto loop; } (void) spl0(); first = 1; while ((c = getc(qp)) >= 0) { if (tp->t_flags&CRMOD && c == '\r') c = '\n'; if (tp->t_flags&LCASE && c <= 0177) if (tp->t_lstate&LSBKSL) { if (maptab[c]) c = maptab[c]; tp->t_lstate &= ~LSBKSL; } else if (c >= 'A' && c <= 'Z') c += 'a' - 'A'; else if (c == '\\') { tp->t_lstate |= LSBKSL; continue; } if (c == tlun.t_dsuspc) { gsignal(tp->t_pgrp, SIGTSTP); if (first) { sleep((caddr_t)&lbolt, TTIPRI); goto loop; } break; } if (c == tun.t_eofc && (tp->t_flags&CBREAK)==0) break; if (passc(c & 0177) < 0) break; if ((tp->t_flags&CBREAK)==0 && ntbreakc(c, tp)) break; first = 0; } tp->t_lstate &= ~LSBKSL; } if (tp->t_state&TBLOCK && tp->t_rawq.c_cc < TTYHOG/5) { if (putc(tun.t_startc, &tp->t_outq)==0) { tp->t_state &= ~TBLOCK; ttstart(tp); } tp->t_char = 0; } return (tp->t_rawq.c_cc + tp->t_canq.c_cc); } /* * Called from the device's write routine after it has * calculated the tty-structure given as argument. */ caddr_t ntwrite(tp) register struct tty *tp; { #ifdef vax /* * THE POSITIONING OF CP, CC, AND CE ARE CRITICAL * AND MUST NOT BE CHANGED WITHOUT PATCHING * THE 'ASM' INLINES BELOW. WATCH OUT. */ #endif register char *cp; register int cc, ce; register i; char obuf[OBUFSIZ]; register c; int hiwat = TTHIWAT(tp); if ((tp->t_state&CARR_ON)==0) return (NULL); loop: while (u.u_procp->p_pgrp != tp->t_pgrp && tp == u.u_ttyp && (tp->t_local<OSTOP) && (u.u_procp->p_flag&SVFORK)==0 && u.u_signal[SIGTTOU] != SIG_IGN && u.u_signal[SIGTTOU] != SIG_HOLD && (u.u_procp->p_flag&SDETACH)==0) { gsignal(u.u_procp->p_pgrp, SIGTTOU); sleep((caddr_t)&lbolt, TTIPRI); } while (u.u_count) { cc = MIN(u.u_count, OBUFSIZ); cp = obuf; iomove(cp, (unsigned)cc, B_WRITE); if (u.u_error) break; if (tp->t_outq.c_cc > hiwat) goto ovhiwat; if (tp->t_local&LFLUSHO) continue; if (tp->t_flags&LCASE || tp->t_local<ILDE) { while (cc--) { c = *cp++; tp->t_rocount = 0; while((c = ntyoutput(c, tp)) >= 0) { /* out of clists, wait a bit */ ttstart(tp); sleep((caddr_t)&lbolt, TTOPRI); tp->t_rocount = 0; } if (tp->t_outq.c_cc > hiwat) goto ovhiwat; } continue; } while (cc) { if (tp->t_flags&RAW || tp->t_local&LLITOUT) ce = cc; else { #ifdef vax asm(" scanc r9,(r10),_partab,$077"); asm(" subl3 r0,r9,r8"); #else ce=0; while(((partab[*(unsigned char *)(cp+ce)]&077)==0)&&(cet_rocount = 0; if (ntyoutput(*cp, tp) >= 0) { ttstart(tp); sleep((caddr_t)&lbolt, TTOPRI); continue; } cp++; cc--; if (tp->t_outq.c_cc > hiwat) goto ovhiwat; } } tp->t_rocount = 0; i=b_to_q(cp,ce,&tp->t_outq); ce-=i; tk_nout+=ce; tp->t_col+=ce; cp+=ce; cc-=ce; if (i) { ttstart(tp); sleep((caddr_t)&lbolt, TTOPRI); } if (ce || tp->t_outq.c_cc > hiwat) goto ovhiwat; } } ttstart(tp); return(NULL); ovhiwat: (void) spl5(); u.u_base -= cc; u.u_offset -= cc; u.u_count += cc; if (tp->t_outq.c_cc <= hiwat) { (void) spl0(); goto loop; } ttstart(tp); tp->t_state |= ASLEEP; if (tp->t_chan && u.u_segflg == 0 && (getf(u.u_ap[0])->f_flag&FMP)) { (void) spl0(); return ((caddr_t)&tp->t_outq); } sleep((caddr_t)&tp->t_outq, TTOPRI); (void) spl0(); goto loop; } /* * Rubout one character from the rawq of tp * as cleanly as possible. */ ntyrub(c, tp) register c; register struct tty *tp; { register char *cp; register int savecol; int s; char *nextc(); if ((tp->t_flags&ECHO)==0) return; tp->t_local &= ~LFLUSHO; c &= 0377; if (tp->t_local&LCRTBS) { if (tp->t_rocount == 0) { /* * Screwed by ttwrite; retype */ ntyretype(tp); return; } if (c==('\t'|0200) || c==('\n'|0200)) ntyrubo(tp, 2); else switch(partab[c&=0177] & 0177) { case ORDINARY: if (tp->t_flags&LCASE && c >= 'A' && c <= 'Z') ntyrubo(tp, 2); else ntyrubo(tp, 1); break; case VTAB: case BACKSPACE: case CONTROL: case RETURN: if (tp->t_local & LCTLECH) ntyrubo(tp, 2); break; case TAB: if (tp->t_rocount < tp->t_rawq.c_cc) { ntyretype(tp); return; } s = spl5(); savecol = tp->t_col; tp->t_lstate |= LSCNTTB; tp->t_local |= LFLUSHO; tp->t_col = tp->t_rocol; for (cp = tp->t_rawq.c_cf; cp; cp = nextc(&tp->t_rawq, cp)) ntyecho(*cp, tp); tp->t_local &= ~LFLUSHO; tp->t_lstate &= ~LSCNTTB; splx(s); /* *(( savecol will now be length of the tab */ savecol -= tp->t_col; tp->t_col += savecol; if (savecol > 8) savecol = 8; /* overflow screw */ while (--savecol >= 0) (void) ntyoutput('\b', tp); break; default: panic("ttyrub"); } } else if (tp->t_local&LPRTERA) { if ((tp->t_lstate&LSERASE) == 0) { (void) ntyoutput('\\', tp); tp->t_lstate |= LSERASE; } ntyecho(c, tp); } else ntyecho(tp->t_erase, tp); tp->t_rocount--; } /* * Crt back over cnt chars perhaps * erasing them. */ ntyrubo(tp, cnt) register struct tty *tp; int cnt; { while (--cnt >= 0) ntyout(tp->t_local&LCRTERA ? "\b \b" : "\b", tp); } /* * Reprint the rawq line. * We assume c_cc has already been checked. */ ntyretype(tp) register struct tty *tp; { register char *cp; char *nextc(); int s; if (tlun.t_rprntc != 0377) ntyecho(tlun.t_rprntc, tp); (void) ntyoutput('\n', tp); s = spl5(); for (cp = tp->t_canq.c_cf; cp; cp = nextc(&tp->t_canq, cp)) ntyecho(*cp, tp); for (cp = tp->t_rawq.c_cf; cp; cp = nextc(&tp->t_rawq, cp)) ntyecho(*cp, tp); tp->t_lstate &= ~LSERASE; splx(s); tp->t_rocount = tp->t_rawq.c_cc; tp->t_rocol = 0; } /* * Echo a typed character to the terminal */ ntyecho(c, tp) register c; register struct tty *tp; { if ((tp->t_lstate & LSCNTTB) == 0) tp->t_local &= ~LFLUSHO; if ((tp->t_flags&ECHO) == 0) return; c &= 0377; if (tp->t_flags&RAW) { (void) ntyoutput(c, tp); return; } if (c == '\r' && tp->t_flags&CRMOD) c = '\n'; if (tp->t_local&LCTLECH) { if ((c&0177) <= 037 && c!='\t' && c!='\n' || (c&0177)==0177) { (void) ntyoutput('^', tp); c &= 0177; if (c == 0177) c = '?'; else if (tp->t_flags&LCASE) c += 'a' - 1; else c += 'A' - 1; } } (void) ntyoutput(c & 0177, tp); } /* * Is c a break char for tp? */ ntbreakc(c, tp) register c; register struct tty *tp; { return (c == '\n' || c == tun.t_eofc || c == tun.t_brkc || c == '\r' && (tp->t_flags&CRMOD)); } /* * send string cp to tp */ ntyout(cp, tp) register char *cp; register struct tty *tp; { register char c; while (c = *cp++) (void) ntyoutput(c, tp); } @ikP#$.^adgjmpsvy y-iSP6i /* uba.c 4.36 81/10/27 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/cpu.h" #include "../h/map.h" #include "../h/pte.h" #include "../h/buf.h" #include "../h/vm.h" #include "../h/ubareg.h" #include "../h/ubavar.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/conf.h" #include "../h/mtpr.h" #include "../h/nexus.h" #include "../h/dk.h" #if VAX780 char ubasr_bits[] = UBASR_BITS; #endif /* * Do transfer on device argument. The controller * and uba involved are implied by the device. * We queue for resource wait in the uba code if necessary. * We return 1 if the transfer was started, 0 if it was not. * If you call this routine with the head of the queue for a * UBA, it will automatically remove the device from the UBA * queue before it returns. If some other device is given * as argument, it will be added to the request queue if the * request cannot be started immediately. This means that * passing a device which is on the queue but not at the head * of the request queue is likely to be a disaster. */ ubago(ui) register struct uba_device *ui; { register struct uba_ctlr *um = ui->ui_mi; register struct uba_hd *uh; register int s, unit; uh = &uba_hd[um->um_ubanum]; s = spl6(); if (um->um_driver->ud_xclu && uh->uh_users > 0 || uh->uh_xclu) goto rwait; um->um_ubinfo = ubasetup(um->um_ubanum, um->um_tab.b_actf->b_actf, UBA_NEEDBDP|UBA_CANTWAIT); if (um->um_ubinfo == 0) goto rwait; uh->uh_users++; if (um->um_driver->ud_xclu) uh->uh_xclu = 1; splx(s); if (ui->ui_dk >= 0) { unit = ui->ui_dk; dk_busy |= 1<uh_actf == ui) uh->uh_actf = ui->ui_forw; (*um->um_driver->ud_dgo)(um); if (ui->ui_dk >= 0) { dk_xfer[unit]++; dk_wds[unit] += um->um_tab.b_actf->b_actf->b_bcount>>6; } return (1); rwait: if (uh->uh_actf != ui) { ui->ui_forw = NULL; if (uh->uh_actf == NULL) uh->uh_actf = ui; else uh->uh_actl->ui_forw = ui; uh->uh_actl = ui; } splx(s); return (0); } ubadone(um) register struct uba_ctlr *um; { register struct uba_hd *uh = &uba_hd[um->um_ubanum]; if (um->um_driver->ud_xclu) uh->uh_xclu = 0; uh->uh_users--; ubarelse(um->um_ubanum, &um->um_ubinfo); } /* * Allocate and setup UBA map registers, and bdp's * Flags says whether bdp is needed, whether the caller can't * wait (e.g. if the caller is at interrupt level). * * Return value: * Bits 0-8 Byte offset * Bits 9-17 Start map reg. no. * Bits 18-27 No. mapping reg's * Bits 28-31 BDP no. */ ubasetup(uban, bp, flags) struct buf *bp; { register struct uba_hd *uh = &uba_hd[uban]; register int temp, i; int npf, reg, bdp; unsigned v; register struct pte *pte, *io; struct proc *rp; int a, o, ubinfo; #if VAX7ZZ if (cpu == VAX_7ZZ) flags &= ~UBA_NEEDBDP; #endif v = btop(bp->b_un.b_addr); o = (int)bp->b_un.b_addr & PGOFSET; npf = btoc(bp->b_bcount + o) + 1; a = spl6(); while ((reg = rmalloc(uh->uh_map, npf)) == 0) { if (flags & UBA_CANTWAIT) { splx(a); return (0); } uh->uh_mrwant++; sleep((caddr_t)uh->uh_map, PSWP); } bdp = 0; if (flags & UBA_NEEDBDP) { while ((bdp = ffs(uh->uh_bdpfree)) == 0) { if (flags & UBA_CANTWAIT) { rmfree(uh->uh_map, npf, reg); splx(a); return (0); } uh->uh_bdpwant++; sleep((caddr_t)uh->uh_map, PSWP); } uh->uh_bdpfree &= ~(1 << (bdp-1)); } else if (flags & UBA_HAVEBDP) bdp = (flags >> 28) & 0xf; splx(a); reg--; ubinfo = (bdp << 28) | (npf << 18) | (reg << 9) | o; io = &uh->uh_uba->uba_map[reg]; temp = (bdp << 21) | UBAMR_MRV; rp = bp->b_flags&B_DIRTY ? &proc[2] : bp->b_proc; if (bdp && (o & 01)) temp |= UBAMR_BO; if (bp->b_flags & B_UAREA) { for (i = UPAGES - bp->b_bcount / NBPG; i < UPAGES; i++) { if (rp->p_addr[i].pg_pfnum == 0) panic("uba: zero upage"); *(int *)io++ = rp->p_addr[i].pg_pfnum | temp; } } else if ((bp->b_flags & B_PHYS) == 0) { pte = &Sysmap[btop(((int)bp->b_un.b_addr)&0x7fffffff)]; while (--npf != 0) *(int *)io++ = pte++->pg_pfnum | temp; } else { if (bp->b_flags & B_PAGET) pte = &Usrptmap[btokmx((struct pte *)bp->b_un.b_addr)]; else pte = vtopte(rp, v); while (--npf != 0) { if (pte->pg_pfnum == 0) panic("uba zero uentry"); *(int *)io++ = pte++->pg_pfnum | temp; } } *(int *)io++ = 0; return (ubinfo); } /* * Non buffer setup interface... set up a buffer and call ubasetup. */ uballoc(uban, addr, bcnt, flags) int uban; caddr_t addr; int bcnt, flags; { struct buf ubabuf; ubabuf.b_un.b_addr = addr; ubabuf.b_flags = B_BUSY; ubabuf.b_bcount = bcnt; /* that's all the fields ubasetup() needs */ return (ubasetup(uban, &ubabuf, flags)); } /* * Release resources on uba uban, and then unblock resource waiters. * The map register parameter is by value since we need to block * against uba resets on 11/780's. */ ubarelse(uban, amr) int *amr; { register struct uba_hd *uh = &uba_hd[uban]; register int bdp, reg, npf, s; int mr; /* * Carefully see if we should release the space, since * it may be released asynchronously at uba reset time. */ s = spl6(); mr = *amr; if (mr == 0) { /* * A ubareset() occurred before we got around * to releasing the space... no need to bother. */ splx(s); return; } *amr = 0; splx(s); /* let interrupts in, we're safe for a while */ bdp = (mr >> 28) & 0x0f; if (bdp) { switch (cpu) { #if VAX780 case VAX_780: uh->uh_uba->uba_dpr[bdp] |= UBADPR_BNE; break; #endif #if VAX750 case VAX_750: uh->uh_uba->uba_dpr[bdp] |= UBADPR_PURGE|UBADPR_NXM|UBADPR_UCE; break; #endif } uh->uh_bdpfree |= 1 << (bdp-1); /* atomic */ if (uh->uh_bdpwant) { uh->uh_bdpwant = 0; wakeup((caddr_t)uh->uh_map); } } /* * Put back the registers in the resource map. * The map code must not be reentered, so we do this * at high ipl. */ npf = (mr >> 18) & 0x3ff; reg = ((mr >> 9) & 0x1ff) + 1; s = spl6(); rmfree(uh->uh_map, npf, reg); splx(s); /* * Wakeup sleepers for map registers, * and also, if there are processes blocked in dgo(), * give them a chance at the UNIBUS. */ if (uh->uh_mrwan((t) { uh->uh_mrwant = 0; wakeup((caddr_t)uh->uh_map); } while (uh->uh_actf && ubago(uh->uh_actf)) ; } ubapurge(um) register struct uba_ctlr *um; { register struct uba_hd *uh = um->um_hd; register int bdp = (um->um_ubinfo >> 28) & 0x0f; switch (cpu) { #if VAX780 case VAX_780: uh->uh_uba->uba_dpr[bdp] |= UBADPR_BNE; break; #endif #if VAX750 case VAX_750: uh->uh_uba->uba_dpr[bdp] |= UBADPR_PURGE|UBADPR_NXM|UBADPR_UCE; break; #endif } } /* * Generate a reset on uba number uban. Then * call each device in the character device table, * giving it a chance to clean up so as to be able to continue. */ ubareset(uban) int uban; { register struct cdevsw *cdp; register struct uba_hd *uh = &uba_hd[uban]; int s; s = spl6(); uh->uh_users = 0; uh->uh_zvcnt = 0; uh->uh_xclu = 0; uh->uh_hangcnt = 0; uh->uh_actf = uh->uh_actl = 0; uh->uh_bdpwant = 0; uh->uh_mrwant = 0; wakeup((caddr_t)&uh->uh_bdpwant); wakeup((caddr_t)&uh->uh_mrwant); printf("uba%d: reset", uban); ubainit(uh->uh_uba); for (cdp = cdevsw; cdp->d_open; cdp++) (*cdp->d_reset)(uban); printf("\n"); splx(s); } /* * Init a uba. This is called with a pointer * rather than a virtual address since it is called * by code which runs with memory mapping disabled. * In these cases we really don't need the interrupts * enabled, but since we run with ipl high, we don't care * if they are, they will never happen anyways. */ ubainit(uba) register struct uba_regs *uba; { switch (cpu) { #if VAX780 case VAX_780: uba->uba_cr = UBACR_ADINIT; uba->uba_cr = UBACR_IFS|UBACR_BRIE|UBACR_USEFIE|UBACR_SUEFIE; while ((uba->uba_cnfgr & UBACNFGR_UBIC) == 0) ; break; #endif #if VAX750 case VAX_750: #endif #if VAX7ZZ case VAX_7ZZ: #endif #if defined(VAX750) || defined(VAX7ZZ) mtpr(IUR, 0); /* give devices time to recover from power fail */ /* THIS IS PROBABLY UNNECESSARY */ DELAY(500000); /* END PROBABLY UNNECESSARY */ break; #endif } } #if VAX780 /* * Check to make sure the UNIBUS adaptor is not hung, * with an interrupt in the register to be presented, * but not presenting it for an extended period (5 seconds). */ unhang() { register int uban; for (uban = 0; uban < numuba; uban++) { register struct uba_hd *uh = &uba_hd[uban]; register struct uba_regs *up = uh->uh_uba; if (up->uba_sr == 0) return; up->uba_sr = UBASR_CRD|UBASR_LEB; uh->uh_hangcnt++; if (uh->uh_hangcnt > 5*hz) { uh->uh_hangcnt = 0; printf("uba%d: hung\n", uban); ubareset(uban); } } } /* * This is a timeout routine which decrements the ``i forgot to * interrupt'' counts, on an 11/780. This prevents slowly growing * counts from causing a UBA reset since we are interested only * in hang situations. */ ubawatch() { register struct uba_hd *uh; register int uban; if (panicstr) return; for (uban = 0; uban < numuba; uban++) { uh = &uba_hd[uban]; if (uh->uh_hangcnt) uh->uh_hangcnt--; } } int ubawedgecnt = 10; int ubacrazy = 500; /* * This routine is called by the locore code to * process a UBA error on an 11/780. The arguments are passed * on the stack, and value-result (through some trickery). * In particular, the uvec argument is used for further * uba processing so the result aspect of it is very important. * It must not be declared register. */ /*ARGSUSED*/ ubaerror(uban, uh, xx, uvec, uba) register int uban; register struct uba_hd *uh; int uvec; register struct uba_regs *uba; { register sr, s; if (uvec == 0) { uh->uh_zvcnt++; if (uh->uh_zvcnt > 250000) { printf("uba%d: too many zero vectors\n"); ubareset(uban); } uvec = 0; return; } if (uba->uba_cnfgr & NEX_CFGFLT) { printf("uba%d: sbi fault sr=%b cnfgr=%b\n", uban, uba->uba_sr, ubasr_bits, uba->uba_cnfgr, NEXFLT_BITS); ubareset(uban); uvec = 0; return; } sr = uba->uba_sr; s = spl7(); printf("uba%d: uba error sr=%b fmer=%x fubar=%o\n", uban, uba->uba_sr, ubasr_bits, uba->uba_fmer, 4*uba->uba_fubar); splx(s); uba->uba_sr = sr; uvec &= UBABRRVR_DIV; if (++uh->uh_errcnt % ubawedgecnt == 0) { @ikR%$.^adgjmpsvy y-iSP6i if (uh->uh_errcnt > ubacrazy) panic("uba crazy"); printf("ERROR LIMIT "); ubareset(uban); uvec = 0; return; } return; } #endif /* * This routine allows remapping of previously * allocated UNIBUS bdp and map resources * onto different memory addresses. * It should only be used by routines which need * small fixed length mappings for long periods of time * (like the ARPANET ACC IMP interface). * It only maps kernel addresses. */ ubaremap(uban, ubinfo, addr) int uban; register unsigned ubinfo; caddr_t addr; { register struct uba_hd *uh = &uba_hd[uban]; register struct pte *pte, *io; register int temp, bdp; int npf, o; o = (int)addr & PGOFSET; bdp = (ubinfo >> 28) & 0xf; npf = (ubinfo >> 18) & 0x3ff; io = &uh->uh_uba->uba_map[(ubinfo >> 9) & 0x1ff]; temp = (bdp << 21) | UBAMR_MRV; /* * If using buffered data path initiate purge * of old data and set byte offset bit if next * transfer will be from odd address. */ if (bdp) { switch (cpu) { #if VAX780 case VAX_780: uh->uh_uba->uba_dpr[bdp] |= UBADPR_BNE; break; #endif #if VAX750 case VAX_750: uh->uh_uba->uba_dpr[bdp] |= UBADPR_PURGE|UBADPR_NXM|UBADPR_UCE; break; #endif } if (o & 1) temp |= UBAMR_BO; } /* * Set up the map registers, leaving an invalid reg * at the end to guard against wild unibus transfers. */ pte = &Sysmap[btop(((int)addr)&0x7fffffff)]; while (--npf != 0) *(int *)io++ = pte++->pg_pfnum | temp; *(int *)io = 0; /* * Return effective UNIBUS address. */ return (ubinfo | o); } @ikP$X14:=@CFILOR5&i.m.m /* tm.c 4.45 81/12/03 */ #include "te.h" #include "ts.h" #if NTM > 0 /* * TM11/TE10 tape driver * * TODO: * test driver with more than one slave * test driver with more than one controller * test reset code * what happens if you offline tape during rewind? * test using file system on tape */ #include "../h/param.h" #include "../h/systm.h" #include "../h/buf.h" #include "../h/dir.h" #include "../h/conf.h" #include "../h/user.h" #include "../h/file.h" #include "../h/map.h" #include "../h/pte.h" #include "../h/vm.h" #include "../h/ubareg.h" #include "../h/ubavar.h" #include "../h/mtio.h" #include "../h/ioctl.h" #include "../h/cmap.h" #include "../h/cpu.h" #include "../h/tmreg.h" /* * There is a ctmbuf per tape controller. * It is used as the token to pass to the internal routines * to execute tape ioctls, and also acts as a lock on the slaves * on the controller, since there is only one per controller. * In particular, when the tape is rewinding on close we release * the user process but any further attempts to use the tape drive * before the rewind completes will hang waiting for ctmbuf. */ struct buf ctmbuf[NTM]; /* * Raw tape operations use rtmbuf. The driver * notices when rtmbuf is being used and allows the user * program to continue after errors and read records * not of the standard length (BSIZE). */ struct buf rtmbuf[NTM]; /* * Driver unibus interface routines and variables. */ int tmprobe(), tmslave(), tmattach(), tmdgo(), tmintr(); struct uba_ctlr *tmminfo[NTM]; struct uba_device *tedinfo[NTE]; struct buf teutab[NTE]; short tetotm[NTE]; u_short tmstd[] = { 0772520, 0 }; struct uba_driver tmdriver = { tmprobe, tmslave, tmattach, tmdgo, tmstd, "te", tedinfo, "tm", tmminfo, 0 }; /* bits in minor device */ #define TEUNIT(dev) (minor(dev)&03) #define TMUNIT(dev) (tetotm[TEUNIT(dev)]) #define T_NOREWIND 04 #define T_1600BPI 08 #define INF (daddr_t)1000000L /* * Software state per tape transport. * * 1. A tape drive is a unique-open device; we refuse opens when it is already.(( * 2. We keep track of the current position on a block tape and seek * before operations by forward/back spacing if necessary. * 3. We remember if the last operation was a write on a tape, so if a tape * is open read write and the last thing done is a write we can * write a standard end of tape mark (two eofs). * 4. We remember the status registers after the last command, using * then internally and returning them to the SENSE ioctl. * 5. We remember the last density the tape was used at. If it is * not a BOT when we start using it and we are writing, we don't * let the density be changed. */ struct te_softc { char sc_openf; /* lock against multiple opens */ char sc_lastiow; /* last op was a write */ daddr_t sc_blkno; /* block number, for block device tape */ daddr_t sc_nxrec; /* position of end of tape, if known */ u_short sc_erreg; /* copy of last erreg */ u_short sc_dsreg; /* copy of last dsreg */ short sc_resid; /* copy of last bc */ #ifdef unneeded short sc_lastcmd; /* last command to handle direction changes */ #endif u_short sc_dens; /* prototype command with density info */ daddr_t sc_timo; /* time until timeout expires */ short sc_tact; /* timeout is active */ } te_softc[NTM]; #ifdef unneeded int tmgapsdcnt; /* DEBUG */ #endif /* * States for um->um_tab.b_active, the per controller state flag. * This is used to sequence control in the driver. */ #define SSEEK 1 /* seeking */ #define SIO 2 /* doing seq i/o */ #define SCOM 3 /* sending control command */ #define SREW 4 /* sending a drive rewind */ /* * Determine if there is a controller for * a tm at address reg. Our goal is to make the * device interrupt. */ tmprobe(reg) caddr_t reg; { register int br, cvec; /* must be r11,r10; value-result */ #ifdef lint br = 0; cvec = br; br = cvec; #endif ((struct tmdevice *)reg)->tmcs = TM_IE; /* * If this is a tm11, it ought to have interrupted * by now, if it isn't (ie: it is a ts04) then we just * hope that it didn't interrupt, so autoconf will ignore it. * Just in case, we will reference one * of the more distant registers, and hope for a machine * check, or similar disaster if this is a ts. * * Note: on an 11/780, badaddr will just generate * a uba error for a ts; but our caller will notice that * so we won't check for it. */ if (badaddr((caddr_t)&((struct tmdevice *)reg)->tmrd, 2)) return (0); return (1); } /* * Due to a design flaw, we cannot ascertain if the tape * exists or not unless it is on line - ie: unless a tape is * mounted. This is too servere a restriction to bear, * so all units are assumed to exist. */ /*ARGSUSED*/ tmslave(ui, reg) struct uba_device *ui; caddr_t reg; { return (1); } /* * Record attachment of the unit to the controller. */ /*ARGSUSED*/ tmattach(ui) struct uba_device *ui; { /* * Tetotm is used in TMUNIT to index the ctmbuf and rtmbuf * arrays given a te unit number. */ tetotm[ui->ui_unit] = ui->ui_mi->um_ctlr; } int tmtimer(); /* * Open the device. Tapes are unique open * devices, so we refuse if it is already open. * We also check that a tape is available, and * don't block waiting here; if you want to wait * for a tape you should timeout in user code. */ tmopen(dev, flag) dev_t dev; int flag; { register int teunit; register struct uba_device *ui; register struct te_softc *sc; int olddens, dens; teunit = TEUNIT(dev); if (teunit>=NTE || (sc = &te_softc[teunit])->sc_openf || (ui = tedinfo[teunit]) == 0 || ui->ui_alive == 0) { u.u_error = ENXIO; return; } olddens = sc->sc_dens; dens = TM_IE | TM_GO | (ui->ui_slave << 8); if ((minor(dev) & T_1600BPI) == 0) dens |= TM_D800; sc->sc_dens = dens; get: tmcommand(dev, TM_SENSE, 1); if (sc->sc_erreg&TMER_SDWN) { sleep((caddr_t)&lbolt, PZERO+1); goto get; } sc->sc_dens = olddens; if ((sc->sc_erreg&(TMER_SELR|TMER_TUR)) != (TMER_SELR|TMER_TUR)) { uprintf("te%d: not online\n", teunit); u.u_error = EIO; return; } if ((flag&FWRITE) && (sc->sc_erreg&TMER_WRL)) { uprintf("te%d: no write ring\n", teunit); u.u_error = EIO; return; } if ((sc->sc_erreg&TMER_BOT) == 0 && (flag&FWRITE) && dens != sc->sc_dens) { uprintf("te%d: can't change density in mid-tape\n", teunit); u.u_error = EIO; return; } sc->sc_openf = 1; sc->sc_blkno = (daddr_t)0; sc->sc_nxrec = INF; sc->sc_lastiow = 0; sc->sc_dens = dens; (void) spl6(); if (sc->sc_tact == 0) { sc->sc_timo = INF; sc->sc_tact = 1; timeout(tmtimer, (caddr_t)dev, 5*hz); } (void) spl0(); } /* * Close tape device. * * If tape was open for writing or last operation was * a write, then write two EOF's and backspace over the last one. * Unless this is a non-rewinding special file, rewind the tape. * Make the tape available to others. */ tmclose(dev, flag) register dev_t dev; register flag; { register struct te_softc *sc = &te_softc[TEUNIT(dev)]; if (flag == FWRITE || (flag&FWRITE) && sc->sc_lastiow) { tmcommand(dev, TM_WEOF, 1); tmcommand(dev, TM_WEOF, 1); tmcommand(dev, TM_SREV, 1); } if ((minor(dev)&T_NOREWIND) == 0) /* * 0 count means don't hang waiting for rewind complete * rather ctmbuf stays busy until the operation completes * preventing further opens from completing by * preventing a TM_SENSE from completing. */ tmcommand(dev, TM_REW, 0); sc->sc_openf = 0; } /* * Execute a command on the tape drive * a specified number of times. */ tmcommand(dev, com, count) dev_t dev; int com, count; { register struct buf *bp; bp = &ctmbuf[TMUNIT(dev)]; (void) spl5(); while (bp->b_flags&B_BUSY) { /* * This special check is because B_BUSY never * gets cleared in the non-waiting rewind case. */ if (bp->b_repcnt == 0 && (bp->b_flags&B_DONE)) break; bp->b_flags |= B_WANTED; sleep((caddr_t)bp, PRIBIO); } bp->b_flags = B_BUSY|B_READ; (void) spl0(); bp->b_dev = dev; bp->b_repcnt = -count; bp->b_command = com; bp->b_blkno = 0; tmstrategy(bp); /* * In case of rewind from close, don't wait. * This is the only case where count can be 0. */ if (count == 0) return; iowait(bp); if (bp->b_flags&B_WANTED) wakeup((caddr_t)bp); bp->b_flags &= B_ERROR; } /* * Queue a tape operation. */ tmstrategy(bp) register struct buf *bp; { int teunit = TEUNIT(bp->b_dev); register struct uba_ctlr *um; register struct buf *dp; /* * Put transfer at end of unit queue */ dp = &teutab[teunit]; bp->av_forw = NULL; (void) spl5(); um = tedinfo[teunit]->ui_mi; if (dp->b_actf == NULL) { dp->b_actf = bp; /* * Transport not already active... * put at end of controller queue. */ dp->b_forw = NULL; if (um->um_tab.b_actf == NULL) um->um_tab.b_actf = dp; else um->um_tab.b_actl->b_forw = dp; um->um_tab.b_actl = dp; } else dp->b_actl->av_forw = bp; dp->b_actl = bp; /* * If the controller is not busy, get * it going. */ if (um->um_tab.b_active == 0) tmstart(um); (void) spl0(); } /* * Start activity on a tm controller. */ tmstart(um) register struct uba_ctlr *um; { register struct buf *bp, *dp; register struct tmdevice *addr = (struct tmdevice *)um->um_addr; register struct te_softc *sc; register struct uba_device *ui; int teunit, cmd; daddr_t blkno; /* * Look for an idle transport on the controller. */ loop: if ((dp = um->um_tab.b_actf) == NULL) return; if ((bp = dp->b_actf) == NULL) { um->um_tab.b_actf = dp->b_forw; goto loop; } teunit = TEUNIT(bp->b_dev); ui = tedinfo[teunit]; /* * Record pre-transfer status (e.g. for TM_SENSE) */ sc = &te_softc[teunit]; addr = (struct tmdevice *)um->um_addr; addr->tmcs = (ui->ui_slave << 8); sc->sc_dsreg = addr->tmcs; sc->sc_erreg = addr->tmer; sc->sc_resid = addr->tmbc; /* * Default is that last command was NOT a write command; * if we do a write command we will notice this in tmintr(). */ sc->sc_lastiow = 0; if (sc->sc_openf < 0 || (addr->tmcs&TM_CUR) == 0) { /* * Have had a hard error on a non-raw tape * or the tape unit is now unavailable * (e.g. taken off line). */ bp->b_flags |= B_ERROR; goto next; } if (bp == &ctmbuf[TMUNIT(bp->b_dev)]) { /* * @ik O$X14:=@CFILOR5&i.m.mExecute control operation with the specified count. */ if (bp->b_command == TM_SENSE) goto next; /* * Set next state; give 5 minutes to complete * rewind, or 10 seconds per iteration (minimum 60 * seconds and max 5 minutes) to complete other ops. */ if (bp->b_command == TM_REW) { um->um_tab.b_active = SREW; sc->sc_timo = 5 * 60; } else { um->um_tab.b_active = SCOM; sc->sc_timo = imin(imax(10*(int)-bp->b_repcnt,60),5*60); } if (bp->b_command == TM_SFORW || bp->b_command == TM_SREV) addr->tmbc = bp->b_repcnt; goto dobpcmd; } /* * The following checks handle boundary cases for operation * on non-raw tapes. On raw tapes the initialization of * sc->sc_nxrec by tmphys causes them to be skipped normally * (except in the case of retries). */ if (dbtofsb(bp->b_blkno) > sc->sc_nxrec) { /* * Can't read past known end-of-file. */ bp->b_flags |= B_ERROR; bp->b_error = ENXIO; goto next; } if (dbtofsb(bp->b_blkno) == sc->sc_nxrec && bp-((>b_flags&B_READ) { /* * Reading at end of file returns 0 bytes. */ bp->b_resid = bp->b_bcount; clrbuf(bp); goto next; } if ((bp->b_flags&B_READ) == 0) /* * Writing sets EOF */ sc->sc_nxrec = dbtofsb(bp->b_blkno) + 1; /* * If the data transfer command is in the correct place, * set up all the registers except the csr, and give * control over to the UNIBUS adapter routines, to * wait for resources to start the i/o. */ if ((blkno = sc->sc_blkno) == dbtofsb(bp->b_blkno)) { addr->tmbc = -bp->b_bcount; if ((bp->b_flags&B_READ) == 0) { if (um->um_tab.b_errcnt) cmd = TM_WIRG; else cmd = TM_WCOM; } else cmd = TM_RCOM; um->um_tab.b_active = SIO; um->um_cmd = sc->sc_dens|cmd; #ifdef notdef if (tmreverseop(sc->sc_lastcmd)) while (addr->tmer & TMER_SDWN) tmgapsdcnt++; sc->sc_lastcmd = TM_RCOM; /* will serve */ #endif sc->sc_timo = 60; /* premature, but should serve */ (void) ubago(ui); return; } /* * Tape positioned incorrectly; * set to seek forwards or backwards to the correct spot. * This happens for raw tapes only on error retries. */ um->um_tab.b_active = SSEEK; if (blkno < dbtofsb(bp->b_blkno)) { bp->b_command = TM_SFORW; addr->tmbc = blkno - dbtofsb(bp->b_blkno); } else { bp->b_command = TM_SREV; addr->tmbc = dbtofsb(bp->b_blkno) - blkno; } sc->sc_timo = imin(imax(10 * -addr->tmbc, 60), 5 * 60); dobpcmd: #ifdef notdef /* * It is strictly necessary to wait for the tape * to stop before changing directions, but the TC11 * handles this for us. */ if (tmreverseop(sc->sc_lastcmd) != tmreverseop(bp->b_command)) while (addr->tmer & TM_SDWN) tmgapsdcnt++; sc->sc_lastcmd = bp->b_command; #endif /* * Do the command in bp. */ addr->tmcs = (sc->sc_dens | bp->b_command); return; next: /* * Done with this operation due to error or * the fact that it doesn't do anything. * Release UBA resources (if any), dequeue * the transfer and continue processing this slave. */ if (um->um_ubinfo) ubadone(um); um->um_tab.b_errcnt = 0; dp->b_actf = bp->av_forw; iodone(bp); goto loop; } /* * The UNIBUS resources we needed have been * allocated to us; start the device. */ tmdgo(um) register struct uba_ctlr *um; { register struct tmdevice *addr = (struct tmdevice *)um->um_addr; addr->tmba = um->um_ubinfo; addr->tmcs = um->um_cmd | ((um->um_ubinfo >> 12) & 0x30); } /* * Tm interrupt routine. */ /*ARGSUSED*/ tmintr(tm11) int tm11; { struct buf *dp; register struct buf *bp; register struct uba_ctlr *um = tmminfo[tm11]; register struct tmdevice *addr; register struct te_softc *sc; int teunit; register state; if ((dp = um->um_tab.b_actf) == NULL) return; bp = dp->b_actf; teunit = TEUNIT(bp->b_dev); addr = (struct tmdevice *)tedinfo[teunit]->ui_addr; sc = &te_softc[teunit]; /* * If last command was a rewind, and tape is still * rewinding, wait for the rewind complete interrupt. */ if (um->um_tab.b_active == SREW) { um->um_tab.b_active = SCOM; if (addr->tmer&TMER_RWS) { sc->sc_timo = 5*60; /* 5 minutes */ return; } } /* * An operation completed... record status */ sc->sc_timo = INF; sc->sc_dsreg = addr->tmcs; sc->sc_erreg = addr->tmer; sc->sc_resid = addr->tmbc; if ((bp->b_flags & B_READ) == 0) sc->sc_lastiow = 1; state = um->um_tab.b_active; um->um_tab.b_active = 0; /* * Check for errors. */ if (addr->tmcs&TM_ERR) { while (addr->tmer & TMER_SDWN) ; /* await settle down */ /* * If we hit the end of the tape file, update our position. */ if (addr->tmer&TMER_EOF) { tmseteof(bp); /* set blkno and nxrec */ state = SCOM; /* force completion */ /* * Stuff bc so it will be unstuffed correctly * later to get resid. */ addr->tmbc = -bp->b_bcount; goto opdone; } /* * If we were reading raw tape and the only error was that the * record was too long, then we don't consider this an error. */ if (bp == &rtmbuf[TMUNIT(bp->b_dev)] && (bp->b_flags&B_READ) && (addr->tmer&(TMER_HARD|TMER_SOFT)) == TMER_RLE) goto ignoreerr; /* * If error is not hard, and this was an i/o operation * retry up to 8 times. */ if ((addr->tmer&TMER_HARD)==0 && state==SIO) { if (++um->um_tab.b_errcnt < 7) { sc->sc_blkno++; ubadone(um); goto opcont; } } else /* * Hard or non-i/o errors on non-raw tape * cause it to close. */ if (sc->sc_openf>0 && bp != &rtmbuf[TMUNIT(bp->b_dev)]) sc->sc_openf = -1; /* * Couldn't recover error */ printf("te%d: hard error bn%d er=%b\n", minor(bp->b_dev)&03, bp->b_blkno, sc->sc_erreg, TMER_BITS); bp->b_flags |= B_ERROR; goto opdone; } /* * Advance tape control FSM. */ ignoreerr: switch (state) { case SIO: /* * Read/write increments tape block number */ sc->sc_blkno++; goto opdone; case SCOM: /* * For forward/backward space record update current position. */ if (bp == &ctmbuf[TMUNIT(bp->b_dev)]) switch (bp->b_command) { case TM_SFORW: sc->sc_blkno -= bp->b_repcnt; break; case TM_SREV: sc->sc_blkno += bp->b_repcnt; break; } goto opdone; case SSEEK: sc->sc_blkno = dbtofsb(bp->b_blkno); goto opcont; default: panic("tmintr"); } opdone: /* * Reset error count and remove * from device queue. */ um->um_tab.b_errcnt = 0; dp->b_actf = bp->av_forw; bp->b_resid = -addr->tmbc; ubadone(um); iodone(bp); /* * Circulate slave to end of controller * queue to give other slaves a chance. */ um->um_tab.b_actf = dp->b_forw; if (dp->b_actf) { dp->b_forw = NULL; if (um->um_tab.b_actf == NULL) um->um_tab.b_actf = dp; else um->um_tab.b_actl->b_forw = dp; um->um_tab.b_actl = dp; } if (um->um_tab.b_actf == 0) return; opcont: tmstart(um); } tmtimer(dev) int dev; { register struct te_softc *sc = &te_softc[TEUNIT(dev)]; register short x; if (sc->sc_timo != INF && (sc->sc_timo -= 5) < 0) { printf("te%d: lost interrupt\n", TEUNIT(dev)); sc->sc_timo = INF; x = spl5(); tmintr(TMUNIT(dev)); (void) splx(x); } timeout(tmtimer, (caddr_t)dev, 5*hz); } tmseteof(bp) register struct buf *bp; { register int teunit = TEUNIT(bp->b_dev); register struct tmdevice *addr = (struct tmdevice *)tedinfo[teunit]->ui_addr; register struct te_softc *sc = &te_softc[teunit]; if (bp == &ctmbuf[TMUNIT(bp->b_dev)]) { if (sc->sc_blkno > dbtofsb(bp->b_blkno)) { /* reversing */ sc->sc_nxrec = dbtofsb(bp->b_blkno) - addr->tmbc; sc->sc_blkno = sc->sc_nxrec; } else { /* spacing forward */ sc->sc_blkno = dbtofsb(bp->b_blkno) + addr->tmbc; sc->sc_nxrec = sc->sc_blkno - 1; } return; } /* eof on read */ sc->sc_nxrec = dbtofsb(bp->b_blkno); } tmread(dev) dev_t dev; { tmphys(dev); if (u.u_error) return; physio(tmstrategy, &rtmbuf[TMUNIT(dev)], dev, B_READ, minphys); } tmwrite(dev) dev_t dev; { tmphys(dev); if (u.u_error) return; physio(tmstrategy, &rtmbuf[TMUNIT(dev)], dev, B_WRITE, minphys); } /* * Check that a raw device exists. * If it does, set up sc_blkno and sc_nxrec * so that the tape will appear positioned correctly. */ tmphys(dev) dev_t dev; { register int teunit = TEUNIT(dev); register daddr_t a; register struct te_softc *sc; register struct uba_device *ui; if (teunit >= NTE || (ui=tedinfo[teunit]) == 0 || ui->ui_alive == 0) { u.u_error = ENXIO; return; } sc = &te_softc[teunit]; a = dbtofsb(u.u_offset >> 9); sc->sc_blkno = a; sc->sc_nxrec = a + 1; } tmreset(uban) int uban; { register struct uba_ctlr *um; register tm11, teunit; register struct uba_device *ui; register struct buf *dp; for (tm11 = 0; tm11 < NTM; tm11++) { if ((um = tmminfo[tm11]) == 0 || um->um_alive == 0 || um->um_ubanum != uban) continue; printf(" tm%d", tm11); um->um_tab.b_active = 0; um->um_tab.b_actf = um->um_tab.b_actl = 0; if (um->um_ubinfo) { printf("<%d>", (um->um_ubinfo>>28)&0xf); ubadone(um); } ((struct tmdevice *)(um->um_addr))->tmcs = TM_DCLR; for (teunit = 0; teunit < NTE; teunit++) { if ((ui = tedinfo[teunit]) == 0 || ui->ui_mi != um || ui->ui_alive == 0) continue; dp = &teutab[teunit]; dp->b_active = 0; dp->b_forw = 0; if (um->um_tab.b_actf == NULL) um->um_tab.b_actf = dp; else um->um_tab.b_actl->b_forw = dp; um->um_tab.b_actl = dp; if (te_softc[teunit].sc_openf > 0) te_softc[teunit].sc_openf = -1; } tmstart(um); } } /*ARGSUSED*/ tmioctl(dev, cmd, addr, flag) caddr_t addr; dev_t dev; { int teunit = TEUNIT(dev); register struct te_softc *sc = &te_softc[teunit]; register struct buf *bp = &ctmbuf[TMUNIT(dev)]; register callcount; int fcount; struct mtop mtop; struct mtget mtget; /* we depend of the values and order of the MT codes here */ static tmops[] = {TM_WEOF,TM_SFORW,TM_SREV,TM_SFORW,TM_SREV,TM_REW,TM_OFFL,TM_SENSE}; switch (cmd) { case MTIOCTOP: /* tape operation */ if (copyin((caddr_t)addr, (caddr_t)&mtop, sizeof(mtop))) { u.u_error = EFAULT; return; } switch(mtop.mt_op) { case MTWEOF: callcount = mtop.mt_count; fcount = 1; break; case MTFSF: case MTBSF: callcount = mtop.mt_count; fcount = INF; break; case MTFSR: case MTBSR: callcount = 1; fcount = mtop.mt_count; break; case MTREW: case MTOFFL: case MTNOP: callcount = 1; fcount = 1; break; default: u.u_error = ENXIO; return; } if (callcount <= 0 || fcount <= 0) { u.u_error = ENXIO; return; } while (--callcount >= 0) { tmcommand(dev, tmops[mtop.mt_op], fcount); if ((mtop.mt_op == MTFSR || mtop.mt_op == MTBSR) && bp->b_resid) { u.u_error = EIO; break; } if ((bp->b_flags&B_ERROR) || sc->sc_erreg&TMER_BOT) break; } geterror(bp); return; case MTIOCGET: mtget.mt_dsreg = sc->sc_dsreg; mtget.mt_erreg = sc->sc_erreg; mtget.mt_resid = sc->sc_resid; mtget.mt_type = MT_ISTM; if (copyout((caddr_t)&mtget, addr, sizeof(mtget))) u.u_error = EFAULT; return; default: u.u_error = ENXIO; } } #define DBSIZE 20 tmdump() { register struct uba_device *ui; register struct uba_regs *up; register struct tmdevice *addr; int blk, num; int start; start =(( 0; num = maxfree; #define phys(a,b) ((b)((int)(a)&0x7fffffff)) if (tedinfo[0] == 0) return (ENXIO); ui = phys(tedinfo[0], struct uba_device *); up = phys(ui->ui_hd, struct uba_hd *)->uh_physuba; ubainit(up); DELAY(1000000); addr = (struct tmdevice *)ui->ui_physaddr; tmwait(addr); addr->tmcs = TM_DCLR | TM_GO; while (num > 0) { blk = num > DBSIZE ? DBSIZE : num; tmdwrite(start, blk, addr, up); start += blk; num -= blk; } tmeof(addr); tmeof(addr); tmwait(addr); if (addr->tmcs&TM_ERR) return (EIO); addr->tmcs = TM_REW | TM_GO; tmwait(addr); return (0); } tmdwrite(dbuf, num, addr, up) register dbuf, num; register struct tmdevice *addr; struct uba_regs *up; { register struct pte *io; register int npf; tmwait(addr); io = up->uba_map; npf = num+1; while (--npf != 0) *(int *)io++ = (dbuf++ | (1<tmbc = -(num*NBPG); addr->tmba = 0; addr->tmcs = TM_WCOM | TM_GO; } tmwait(addr) register struct tmdevice *addr; { register s; do s = addr->tmcs; while ((s & TM_CUR) == 0); } tmeof(addr) struct tmdevice *addr; { tmwait(addr); addr->tmcs = TM_WEOF | TM_GO; } #endif @ikUm-$(S+.147:=@FILa)i{{ /* ts.c 4.22 81/12/14 */ #include "ts.h" #if NTS > 0 /* * TS11 tape driver * * TODO: * write dump code */ #include "../h/param.h" #include "../h/systm.h" #include "../h/buf.h" #include "../h/dir.h" #include "../h/conf.h" #include "../h/user.h" #include "../h/file.h" #include "../h/map.h" #include "../h/pte.h" #include "../h/vm.h" #include "../h/ubareg.h" #include "../h/ubavar.h" #include "../h/mtio.h" #include "../h/ioctl.h" #include "../h/cmap.h" #include "../h/cpu.h" #include "../h/tsreg.h" /* * There is a ctsbuf per tape controller. * It is used as the token to pass to the internal routines * to execute tape ioctls. * In particular, when the tape is rewinding on close we release * the user process but any further attempts to use the tape drive * before the rewind completes will hang waiting for ctsbuf. */ struct buf ctsbuf[NTS]; /* * Raw tape operations use rtsbuf. The driver * notices when rtsbuf is being used and allows the user * program to continue after errors and read records * not of the standard length (BSIZE). */ struct buf rtsbuf[NTS]; /* * Driver unibus interface routines and variables. */ int tsprobe(), tsslave(), tsattach(), tsdgo(), tsintr(); struct uba_ctlr *tsminfo[NTS]; struct uba_device *tsdinfo[NTS]; struct buf tsutab[NTS]; u_short tsstd[] = { 0772520, 0 }; /*** PROBABLY DON'T NEED ALL THESE SINCE CONTROLLER == DRIVE ***/ struct uba_driver zsdriver = { tsprobe, tsslave, tsattach, tsdgo, tsstd, "ts", tsdinfo, "zs", tsminfo, 0 }; /* bits in minor device */ #define TSUNIT(dev) (minor(dev)&03) #define T_NOREWIND 04 #define INF (daddr_t)1000000L /* * Software state per tape transport. * Also contains hardware state in message packets. * * 1. A tape drive is a unique-open device; we refuse opens when it is already. * 2. We keep track of the current position on a block tape and seek * before operations by forward/back spacing if necessary. * 3. We remember if the last operation was a write on a tape, so if a tape * is open read write and the last thing done is a write we can * write a standard end of tape mark (two eofs). * 4. We remember the status registers after the last command, using * then internally and returning them to the SENSE ioctl. */ struct ts_softc { char sc_openf; /* lock against multiple opens */ char sc_lastiow; /* last op was a write */ short sc_resid; /* copy of last bc */ daddr_t sc_blkno; /* block number, for block device tape */ daddr_t sc_nxrec; /* position of end of tape, if known */ struct ts_cmd sc_cmd; /* the command packet */ struct ts_sts sc_sts; /* status packet, for returned status */ struct ts_char sc_char; /* characteristics packet */ struct ts_softc *sc_ubaddr; /* Unibus address of ts_softc structure */ u_short sc_uba; /* Unibus addr of cmd pkt for tsdb */ short sc_mapped; /* is ts_sfotc mapped in Unibus space? */ } ts_softc[NTS]; /* * States for um->um_tab.b_active, the per controller state flag. * This is used to sequence control in the driver. */ #define SSEEK 1 /* seeking */ #define SIO 2 /* doing seq i/o */ #define SCOM 3 /* sending control command */ #define SREW 4 /* sending a drive rewind */ /* * Determine if there is a controller for * a ts at address reg. Our goal is to make the * device interrupt. */ /*ARGSUSED*/ tsprobe(reg) caddr_t reg; { register int br, cvec; /* must be r11,r10; value-result */ #ifdef lint br = 0; cvec = br; br = cvec; #endif ((struct tsdevice *)reg)->tssr = 0; DELAY(100); if ((((struct tsdevice *)reg)->tssr & TS_NBA) == 0) return(0); /* IT'S TOO HARD TO MAKE THIS THING INTERRUPT JUST TO FIND ITS VECTOR */ cvec = ((unsigned)reg) & 07 ? 0260 : 0224; br = 0x15; return (1); } /* * TS11 only supports one drive per controller; * check for ui_slave == 0. * * DO WE REALLY NEED THIS ROUTINE??? */ /*ARGSUSED*/ tsslave(ui, reg) struct uba_device *ui; caddr_t reg; { if (ui->ui_slave) /* non-zero slave not allowed */ return(0); return (1); } /* * Record attachment of the unit to the controller. * * SHOULD THIS ROUTINE DO ANYTHING??? */ /*ARGSUSED*/ tsattach(ui) struct uba_device *ui; { } /* * Open the device. Tapes are unique open * devices, so we refuse if it is already open. * We also check that a tape is available, and * don't block waiting here; if you want to wait * for a tape you should timeout in user code. */ tsopen(dev, flag) dev_t dev; int flag; { register int tsunit; register struct uba_device *ui; register struct ts_softc *sc; tsunit = TSUNIT(dev); if (tsunit>=NTS || (sc = &ts_softc[tsunit])->sc_openf || (ui = tsdinfo[tsunit]) == 0 || ui->ui_alive == 0) { u.u_error = ENXIO; return; } if (tsinit(tsunit)) { u.u_error = ENXIO; return; } tscommand(dev, TS_SENSE, 1); if ((sc->sc_sts.s_xs0&TS_ONL) == 0) { uprintf("ts%d: not online\n", tsunit); u.u_error = EIO; return; } if ((flag&(FREAD|FWRITE)) == FWRITE && (sc->sc_sts.s_xs0&TS_WLK)) { uprintf("ts%d: no write ring\n", tsunit); u.u_error = EIO; return; } sc->sc_openf = 1; sc->sc_blkno = (daddr_t)0; sc->sc_nxrec = INF; sc->sc_lastiow = 0; } /* * Close tape device. * * If tape was open for writing or last operation was * a write, then write two EOF's and backspace over the last one. * Unless this is a non-rewinding special file, rewind the tape. * Make the tape available to others. */ tsclose(dev, flag) register dev_t dev; register flag; { register struct ts_softc *sc = &ts_softc[TSUNIT(dev)]; if (flag == FWRITE || (flag&FWRITE) && sc->sc_lastiow) { tscommand(dev, TS_WEOF, 1); tscommand(dev, TS_WEOF, 1); tscommand(dev, TS_SREV, 1); } if ((minor(dev)&T_NOREWIND) == 0) /* * 0 count means don't hang waiting for rewind complete * rather ctsbuf stays busy until the operation completes * preventing further opens from completing by * preventing a TS_SENSE from completing. */ tscommand(dev, TS_REW, 0); sc->sc_openf = 0; } /* * Initialize the TS11. Set up Unibus mapping for command * packets and set device characteristics. */ tsinit(unit) register int unit; { register struct ts_softc *sc = &ts_softc[unit]; register struct uba_ctlr *um = tsminfo[unit]; register struct tsdevice *addr = (struct tsdevice *)um->um_addr; register int i; /* * Map the command and message packets into Unibus * address space. We do all the command and message * packets at once to minimize the amount of Unibus * mapping necessary. */ if (sc->sc_mapped == 0) { ctsbuf[unit].b_un.b_addr = (caddr_t)sc; ctsbuf[unit].b_bcount = sizeof(*sc); i = ubasetup(um->um_ubanum, &ctsbuf[unit], 0); i &= 0777777; sc->sc_ubaddr = (struct ts_softc *)i; sc->sc_mapped++; } /* * Now initialize the TS11 controller. * Set the characteristics. */ if (addr->tssr & (TS_NBA|TS_OFL)) { addr->tssr = 0; /* subsystem initialize */ tswait(addr); i = (int)&sc->sc_ubaddr->sc_cmd; /* Unibus addr of cmd */ sc->sc_uba = (u_short)(i + ((i>>16)&3)); sc->sc_char.char_addr = (int)&sc->sc_ubaddr->sc_sts; sc->sc_char.char_size = sizeof(struct ts_sts); sc->sc_char.char_mode = TS_ESS; sc->sc_cmd.c_cmd = TS_ACK | TS_SETCHR; i = (((int)&sc->sc_ubaddr->sc_char; sc->sc_cmd.c_loba = i; sc->sc_cmd.c_hiba = (i>>16)&3; sc->sc_cmd.c_size = sizeof(struct ts_char); addr->tsdb = sc->sc_uba; tswait(addr); if (addr->tssr & TS_NBA) return(1); } return(0); } /* * Execute a command on the tape drive * a specified number of times. */ tscommand(dev, com, count) dev_t dev; int com, count; { register struct buf *bp; bp = &ctsbuf[TSUNIT(dev)]; (void) spl5(); while (bp->b_flags&B_BUSY) { /* * This special check is because B_BUSY never * gets cleared in the non-waiting rewind case. */ if (bp->b_repcnt == 0 && (bp->b_flags&B_DONE)) break; bp->b_flags |= B_WANTED; sleep((caddr_t)bp, PRIBIO); } bp->b_flags = B_BUSY|B_READ; (void) spl0(); bp->b_dev = dev; bp->b_repcnt = count; bp->b_command = com; bp->b_blkno = 0; tsstrategy(bp); /* * In case of rewind from close, don't wait. * This is the only case where count can be 0. */ if (count == 0) return; iowait(bp); if (bp->b_flags&B_WANTED) wakeup((caddr_t)bp); bp->b_flags &= B_ERROR; } /* * Queue a tape operation. */ tsstrategy(bp) register struct buf *bp; { int tsunit = TSUNIT(bp->b_dev); register struct uba_ctlr *um; register struct buf *dp; /* * Put transfer at end of controller queue */ bp->av_forw = NULL; um = tsdinfo[tsunit]->ui_mi; dp = &tsutab[tsunit]; (void) spl5(); if (dp->b_actf == NULL) dp->b_actf = bp; else dp->b_actl->av_forw = bp; dp->b_actl = bp; um->um_tab.b_actf = um->um_tab.b_actl = dp; /* * If the controller is not busy, get * it going. */ if (um->um_tab.b_active == 0) tsstart(um); (void) spl0(); } /* * Start activity on a ts controller. */ tsstart(um) register struct uba_ctlr *um; { register struct buf *bp; register struct tsdevice *addr = (struct tsdevice *)um->um_addr; register struct ts_softc *sc; register struct ts_cmd *tc; register struct uba_device *ui; int tsunit, cmd; daddr_t blkno; /* * Start the controller if there is something for it to do. */ loop: if ((bp = um->um_tab.b_actf->b_actf) == NULL) return; tsunit = TSUNIT(bp->b_dev); ui = tsdinfo[tsunit]; sc = &ts_softc[tsunit]; tc = &sc->sc_cmd; /* * Default is that last command was NOT a write command; * if we do a write command we will notice this in tsintr(). */ sc->sc_lastiow = 0; if (sc->sc_openf < 0 || (addr->tssr&TS_OFL)) { /* * Have had a hard error on a non-raw tape * or the tape unit is now unavailable * (e.g. taken off line). */ bp->b_flags |= B_ERROR; goto next; } if (bp == &ctsbuf[TSUNIT(bp->b_dev)]) { /* * Execute control operation with the specified count. */ um->um_tab.b_active = bp->b_command == TS_REW ? SREW : SCOM; tc->c_repcnt = bp->b_repcnt; goto dobpcmd; } /* * The following checks handle boundary cases for operation * on non-raw tapes. On raw tapes the initialization of * sc->sc_nxrec by tsphys causes them to be skipped normally * (except in the case of retries). */ if (dbtofsb(bp->b_blkno) > sc->sc_nxrec) { /* * Can't read pas@ikSl-$(S+.147:=@FILa)i{{t known end-of-file. */ bp->b_flags |= B_ERROR; bp->b_error = ENXIO; goto next; } if (dbtofsb(bp->b_blkno) == sc->sc_nxrec && bp->b_flags&B_READ) { /* * Reading at end of file returns 0 bytes. */ bp->b_resid = bp->b_bcount; clrbuf(bp); goto next; } if ((bp->b_flags&B_READ) == 0) /* * Writing sets EOF */ sc->sc_nxrec = dbtofsb(bp->b_blkno) + 1; /* * If the data transfer command is in the correct place, * set up all the registers except the csr, and give * control over to the UNIBUS adapter routines, to * wait for resources to start the i/o. */ if ((blkno = sc->sc_blkno) == dbtofsb(bp->b_blkno)) { tc->c_size = bp->b_bcount; if ((bp->b_flags&B_READ) == 0) cmd = TS_WCOM; else cmd = TS_RCOM; if (um->um_tab.b_errcnt) cmd |= TS_RETRY; um->um_tab.b_active = SIO; tc->c_cmd = TS_ACK | TS_CVC | TS_IE | cmd; (void) ubago(ui); return; } /* * Tape positioned incorrectly; * set to seek forwards or backwards to the correct spot. * This happens for raw tapes only on error retries. */ um->um_tab.b_active = SSEEK; if (blkno < dbtofsb(bp->b_blkno)) { bp->b_command = TS_SFORW; tc->c_repcnt = dbtofsb(bp->b_blkno) - blkno; } else { bp->b_command = TS_SREV; tc->c_repcnt = blkno - dbtofsb(bp->b_blkno); } dobpcmd: /* * Do the command in bp. */ tc->c_cmd = TS_ACK | TS_CVC | TS_IE | bp->b_command; addr->tsdb = sc->sc_uba; return; next: /* * Done with this operation due to error or * the fact that it doesn't do anything. * Release UBA resources (if any), dequeue * the transfer and continue processing this slave. */ if (um->um_ubinfo) ubadone(um); um->um_tab.b_errcnt = 0; um->um_tab.b_actf->b_actf = bp->av_forw; iodone(bp); goto loop; } /* * The UNIBUS resources we needed have been * allocated to us; start the device. */ tsdgo(um) register struct uba_ctlr *um; { register struct tsdevice *addr = (struct tsdevice *)um->um_addr; register struct ts_softc *sc = &ts_softc[um->um_ctlr]; register int i; i = um->um_ubinfo & 0777777; sc->sc_cmd.c_loba = i; sc->sc_cmd.c_hiba = (i>>16)&3; addr->tsdb = sc->sc_uba; } /* * Ts interrupt routine. */ /*ARGSUSED*/ tsintr(ts11) int ts11; { register struct buf *bp; register struct uba_ctlr *um = tsminfo[ts11]; register struct tsdevice *addr; register struct ts_softc *sc; int tsunit; register state; if ((bp = um->um_tab.b_actf->b_actf) == NULL) return; tsunit = TSUNIT(bp->b_dev); addr = (struct tsdevice *)tsdinfo[tsunit]->ui_addr; /* * If last command was a rewind, and tape is still * rewinding, wait for the rewind complete interrupt. * * SHOULD NEVER GET AN INTERRUPT IN THIS STATE. */ if (um->um_tab.b_active == SREW) { um->um_tab.b_active = SCOM; if ((addr->tssr&TS_SSR) == 0) return; } /* * An operation completed... record status */ sc = &ts_softc[tsunit]; if ((bp->b_flags & B_READ) == 0) sc->sc_lastiow = 1; state = um->um_tab.b_active; um->um_tab.b_active = 0; /* * Check for errors. */ if (addr->tssr&TS_SC) { switch (addr->tssr & TS_TC) { case TS_UNREC: /* unrecoverable */ case TS_FATAL: /* fatal error */ case TS_ATTN: /* attention (shouldn't happen) */ case TS_RECNM: /* recoverable, no motion */ break; case TS_SUCC: /* success termination */ printf("ts%d: success\n", TSUNIT(minor(bp->b_dev))); goto ignoreerr; case TS_ALERT: /* tape status alert */ /* * If we hit the end of the tape file, * update our position. */ if (sc->sc_sts.s_xs0 & (TS_TMK|TS_EOT)) { tsseteof(bp); /* set blkno and nxrec */ state = SCOM; /* force completion */ /* * Stuff bc so it will be unstuffed correctly * later to get resid. */ sc->sc_sts.s_rbpcr = bp->b_bcount; goto opdone; } /* * If we were reading raw tape and the record was too long * or too short, then we don't consider this an error. */ if (bp == &rtsbuf[TSUNIT(bp->b_dev)] && (bp->b_flags&B_READ) && sc->sc_sts.s_xs0&(TS_RLS|TS_RLL)) goto ignoreerr; case TS_RECOV: /* recoverable, tape moved */ /* * If this was an i/o operation retry up to 8 times. */ if (state==SIO) { if (++um->um_tab.b_errcnt < 7) { ubadone(um); goto opcont; } else sc->sc_blkno++; } else { /* * Non-i/o errors on non-raw tape * cause it to close. */ if (sc->sc_openf>0 && bp != &rtsbuf[TSUNIT(bp->b_dev)]) sc->sc_openf = -1; } break; case TS_REJECT: /* function reject */ if (state == SIO && sc->sc_sts.s_xs0 & TS_WLE) printf("ts%d: write locked\n", TSUNIT(bp->b_dev)); if ((sc->sc_sts.s_xs0 & TS_ONL) == 0) printf("ts%d: offline\n", TSUNIT(bp->b_dev)); break; } /* * Couldn't recover error */ printf("ts%d: hard error bn%d xs0=%b", TSUNIT(bp->b_dev), bp->b_blkno, sc->sc_sts.s_xs0, TSXS0_BITS); if (sc->sc_sts.s_xs1) printf(" xs1=%b", sc->sc_sts.s_xs1, TSXS1_BITS); if (sc->sc_sts.s_xs2) printf(" xs2=%b", sc->sc_sts.s_xs2, TSXS2_BITS); if (sc->sc_sts.s_xs3) printf(" xs3=%b", sc->sc_sts.s_xs3, TSXS3_BITS); printf("\n"); bp->b_flags |= B_ERROR; goto opdone; } /* * Advance tape control FSM. */ ignoreerr: switch (state) { case SIO: /* * Read/write increments tape block number */ sc->sc_blkno++; goto opdone; case SCOM: /* * For forward/backward space record update current position. */ if (bp == &ctsbuf[TSUNIT(bp->b_dev)]) switch (bp->b_command) { case TS_SFORW: sc->sc_blkno += bp->b_repcnt; break; case TS_SREV: sc->sc_blkno -= bp->b_repcnt; break; } goto opdone; case SSEEK: sc->sc_blkno = dbtofsb(bp->b_blkno); goto opcont; default: panic("tsintr"); } opdone: /* * Reset error count and remove * from device queue. */ um->um_tab.b_errcnt = 0; um->um_tab.b_actf->b_actf = bp->av_forw; bp->b_resid = sc->sc_sts.s_rbpcr; ubadone(um); iodone(bp); if (um->um_tab.b_actf->b_actf == 0) return; opcont: tsstart(um); } tsseteof(bp) register struct buf *bp; { register int tsunit = TSUNIT(bp->b_dev); register struct ts_softc *sc = &ts_so((ftc[tsunit]; if (bp == &ctsbuf[TSUNIT(bp->b_dev)]) { if (sc->sc_blkno > dbtofsb(bp->b_blkno)) { /* reversing */ sc->sc_nxrec = dbtofsb(bp->b_blkno) - sc->sc_sts.s_rbpcr; sc->sc_blkno = sc->sc_nxrec; } else { /* spacing forward */ sc->sc_blkno = dbtofsb(bp->b_blkno) + sc->sc_sts.s_rbpcr; sc->sc_nxrec = sc->sc_blkno - 1; } return; } /* eof on read */ sc->sc_nxrec = dbtofsb(bp->b_blkno); } tsread(dev) dev_t dev; { tsphys(dev); if (u.u_error) return; physio(tsstrategy, &rtsbuf[TSUNIT(dev)], dev, B_READ, minphys); } tswrite(dev) dev_t dev; { tsphys(dev); if (u.u_error) return; physio(tsstrategy, &rtsbuf[TSUNIT(dev)], dev, B_WRITE, minphys); } /* * Check that a raw device exists. * If it does, set up sc_blkno and sc_nxrec * so that the tape will appear positioned correctly. */ tsphys(dev) dev_t dev; { register int tsunit = TSUNIT(dev); register daddr_t a; register struct ts_softc *sc; register struct uba_device *ui; if (tsunit >= NTS || (ui=tsdinfo[tsunit]) == 0 || ui->ui_alive == 0) { u.u_error = ENXIO; return; } sc = &ts_softc[tsunit]; a = dbtofsb(u.u_offset >> 9); sc->sc_blkno = a; sc->sc_nxrec = a + 1; } tsreset(uban) int uban; { register struct uba_ctlr *um; register struct uba_device *ui; register struct buf *dp; register ts11; for (ts11 = 0; ts11 < NTS; ts11++) { if ((um = tsminfo[ts11]) == 0 || um->um_alive == 0 || um->um_ubanum != uban) continue; printf(" ts%d", ts11); um->um_tab.b_active = 0; um->um_tab.b_actf = um->um_tab.b_actl = 0; if (ts_softc[ts11].sc_openf > 0) ts_softc[ts11].sc_openf = -1; if (um->um_ubinfo) { printf("<%d>", (um->um_ubinfo>>28)&0xf); ubadone(um); } if ((ui = tsdinfo[ts11]) && ui->ui_mi == um && ui->ui_alive) { dp = &tsutab[ts11]; dp->b_active = 0; dp->b_forw = 0; if (um->um_tab.b_actf == NULL) um->um_tab.b_actf = dp; else um->um_tab.b_actl->b_forw = dp; um->um_tab.b_actl = dp; } (void) tsinit(ts11); tsstart(um); } } /*ARGSUSED*/ tsioctl(dev, cmd, addr, flag) caddr_t addr; dev_t dev; { int tsunit = TSUNIT(dev); register struct ts_softc *sc = &ts_softc[tsunit]; register struct buf *bp = &ctsbuf[TSUNIT(dev)]; register callcount; int fcount; struct mtop mtop; struct mtget mtget; /* we depend of the values and order of the MT codes here */ static tsops[] = {TS_WEOF,TS_SFORWF,TS_SREVF,TS_SFORW,TS_SREV,TS_REW,TS_OFFL,TS_SENSE}; switch (cmd) { case MTIOCTOP: /* tape operation */ if (copyin((caddr_t)addr, (caddr_t)&mtop, sizeof(mtop))) { u.u_error = EFAULT; return; } switch(mtop.mt_op) { case MTWEOF: callcount = mtop.mt_count; fcount = 1; break; case MTFSF: case MTBSF: case MTFSR: case MTBSR: callcount = 1; fcount = mtop.mt_count; break; case MTREW: case MTOFFL: case MTNOP: callcount = 1; fcount = 1; break; default: u.u_error = ENXIO; return; } if (callcount <= 0 || fcount <= 0) { u.u_error = ENXIO; return; } while (--callcount >= 0) { tscommand(dev, tsops[mtop.mt_op], fcount); if ((mtop.mt_op == MTFSR || mtop.mt_op == MTBSR) && bp->b_resid) { u.u_error = EIO; break; } if ((bp->b_flags&B_ERROR) || sc->sc_sts.s_xs0&TS_BOT) break; } geterror(bp); return; case MTIOCGET: mtget.mt_dsreg = 0; mtget.mt_erreg = sc->sc_sts.s_xs0; mtget.mt_resid = sc->sc_resid; mtget.mt_type = MT_ISTS; if (copyout((caddr_t)&mtget, addr, sizeof(mtget))) u.u_error = EFAULT; return; default: u.u_error = ENXIO; } } #define DBSIZE 20 tsdump() { register struct uba_device *ui; register struct uba_regs *up; register struct tsdevice *addr; int blk, num; int start; start = 0; num = maxfree; #define phys(a,b) ((b)((int)(a)&0x7fffffff)) if (tsdinfo[0] == 0) return (ENXIO); ui = phys(tsdinfo[0], struct uba_device *); up = phys(ui->ui_hd, struct uba_hd *)->uh_physuba; ubainit(up); DELAY(1000000); addr = (struct tsdevice *)ui->ui_physaddr; addr->tssr = 0; tswait(addr); while (num > 0) { blk = num > DBSIZE ? DBSIZE : num; tsdwrite(start, blk, addr, up); start += blk; num -= blk; } tseof(addr); tseof(addr); tswait(addr); if (addr->tssr&TS_SC) return (EIO); addr->tssr = 0; tswait(addr); return (0); } tsdwrite(dbuf, num, addr, up) register dbuf, num; register struct tsdevice *addr; struct uba_regs *up; { register struct pte *io; register int npf; tswait(addr); io = up->uba_map; npf = num+1; while (--npf != 0) *(int *)io++ = (dbuf++ | (1<tsbc = -(num*NBPG); addr->tsba = 0; addr->tscs = TS_WCOM | TM_GO; #endif } tswait(addr) register struct tsdevice *addr; { register s; do s = addr->tssr; while ((s & TS_SSR) == 0); } tseof(addr) struct tsdevice *addr; { tswait(addr); #ifdef notyet addr->tscs = TS_WEOF | TM_GO; #endif } #endif @ikY]&7&iJ6i #include "../h/param.h" #include "../h/conf.h" /* * Single storage module (ampex or cdc 300M or fujitsu 160m) configuration * root on up0a * paging on up0b */ dev_t rootdev = makedev(2, 0); dev_t pipedev = makedev(2, 0); dev_t argdev = makedev(2, 1); dev_t dumpdev = makedev(2, 1); long dumplo = 33440 - 10 * 2048; /* * Nswap is the basic number of blocks of swap per * swap device, and is multiplied by nswdev after * nswdev is determined at boot. */ int nswap = 33440; struct swdevt swdevt[] = { makedev(2, 1), 0, /* up0b */ 0, 0, }; @ik] 2&iJ6i #include "../h/param.h" #include "../h/conf.h" /* * Single rk07 configuration * root on hk00 * paging on hk01 */ dev_t rootdev = makedev(3, 0); dev_t pipedev = makedev(3, 0); dev_t argdev = makedev(3, 1); dev_t dumpdev = makedev(3, 1); long dumplo = 10032 - 2 * 2048; /* not enough... */ /* * Nswap is the basic number of blocks of swap per * swap device, and is multiplied by nswdev after * nswdev is determined at boot. */ int nswap = 10032; struct swdevt swdevt[] = { makedev(3, 1), 1, /* hk0b */ 0, 0, }; @ik@'7&ibIf6i ((#include "../h/param.h" #include "../h/conf.h" /* * Dual rp0?/rm?? configuration * root on hp0a * paging on hp0b and then hp1b */ dev_t rootdev = makedev(0, 0); dev_t pipedev = makedev(0, 0); dev_t argdev = makedev(0, 1); dev_t dumpdev = makedev(0, 1); int dumplo = 33440 - 10 * 2048; /* * Nswap is the basic number of blocks of swap per * swap device, and is multiplied by nswdev after * nswdev is determined at boot. */ int nswap = 33440; struct swdevt swdevt[] = { makedev(0, 1), 0, /* hp0b */ makedev(0, 9), 0, /* hp1b */ 0, 0, }; @ik]7&iJ6i #include "../h/param.h" #include "../h/conf.h" /* * Single rp0?/rm?? configuration * root on hp0a * paging on hp0b */ dev_t rootdev = makedev(0, 0); dev_t pipedev = makedev(0, 0); dev_t argdev = makedev(0, 1); dev_t dumpdev = makedev(0, 1); long dumplo = 33440 - 10 * 2048; /* * Nswap is the basic number of blocks of swap per * swap device, and is multiplied by nswdev after * nswdev is determined at boot. */ int nswap = 33440; struct swdevt swdevt[] = { makedev(0, 1), 0, /* hp0b */ 0, 0, }; @ikMϵ e7&i.m.m /* swapgeneric.c 4.12 81/12/03 */ #include "mba.h" #include "../h/param.h" #include "../h/conf.h" #include "../h/pte.h" #include "../h/buf.h" #include "../h/mbareg.h" #include "../h/mbavar.h" #include "../h/vm.h" #include "../h/ubareg.h" #include "../h/ubavar.h" #include "../h/systm.h" #include "../h/reboot.h" #include "../h/cons.h" #include "../h/mtpr.h" /* * Generic configuration; all in one */ dev_t rootdev, pipedev, argdev, dumpdev; int nswap; struct swdevt swdevt[] = { -1, 1, 0, 0, }; long dumplo; extern struct mba_driver hpdriver; extern struct uba_driver scdriver; extern struct uba_driver hkdriver; extern struct uba_driver udadriver; struct genericconf { caddr_t gc_driver; char *gc_name; dev_t gc_root; long gc_nswap; long gc_dumplo; } genericconf[] = { (caddr_t)&hpdriver, "hp", makedev(0, 0), 33440, 33440 - 10*2048, (caddr_t)&scdriver, "up", makedev(2, 0), 33440, 33440 - 10*2048, (caddr_t)&udadriver, "ra", makedev(9, 0), 33440, 33440 - 10*2048, (caddr_t)&hkdriver, "hk", makedev(3, 0), 10032, 10032 - 2*(2048+1024), 0, }; setconf() { register struct mba_device *mi; register struct uba_device *ui; register struct genericconf *gc; int unit; if (boothowto & RB_ASKNAME) { char name[128]; retry: printf("root device? "); gets(name); for (gc = genericconf; gc->gc_driver; gc++) if (gc->gc_name[0] == name[0] && gc->gc_name[1] == name[1]) goto gotit; goto bad; gotit: if (name[2] >= '0' && name[2] <= '7' && name[3] == 0) { unit = name[2] - '0'; goto found; } printf("bad/missing unit number\n"); bad: printf("use hp%%d, up%%d, ra%%d or hk%%d\n"); goto retry; } unit = 0; for (gc = genericconf; gc->gc_driver; gc++) { for (mi = mbdinit; mi->mi_driver; mi++) { if (mi->mi_alive == 0) continue; if (mi->mi_unit == 0 && mi->mi_driver == (struct mba_driver *)gc->gc_driver) { printf("root on %s0\n", mi->mi_driver->md_dname); goto found; } } for (ui = ubdinit; ui->ui_driver; ui++) { if (ui->ui_alive == 0) continue; if (ui->ui_unit == 0 && ui->ui_driver == (struct uba_driver *)gc->gc_driver) { printf("root on %s0\n", ui->ui_driver->ud_dname); goto found; } } } printf("no suitable root\n"); asm("halt"); found: gc->gc_root = makedev(major(gc->gc_root), unit*8); rootdev = pipedev = gc->gc_root; swdevt[0].sw_dev = argdev = dumpdev = makedev(major(rootdev), minor(rootdev)+1); nswap = gc->gc_nswap; dumplo = gc->gc_dumplo; } getchar() { register c; while((mfpr(RXCS)&RXCS_DONE) == 0) ; c = mfpr(RXDB)&0177; if (c=='\r') c = '\n'; cnputc(c); return(c); } gets(cp) char *cp; { register char *lp; register c; lp = cp; for (;;) { c = getchar() & 0177; switch(c) { case '\n': case '\r': *lp++ = '\0'; return; case '\b': case '#': lp--; if (lp < cp) lp = cp; continue; case '@': case 'u'&037: lp = cp; cnputc('\n'); continue; default: *lp++ = c; } } } @ikV47&ibSP6i #include "../h/param.h" #include "../h/conf.h" /* * Dual rk07 configuration * root on hk0a * paging on hk0b, then hk1b */ dev_t rootdev = makedev(3, 0); dev_t pipedev = makedev(3, 0); dev_t argdev = makedev(3, 1); dev_t dumpdev = makedev(3, 1); long dumplo = 10032 - 2 * 2048; /* not enough... */ /* * Nswap is the basic number of blocks of swap per * swap device, and is multiplied by nswdev after * nswdev is determined at boot. */ int nswap = 10032; struct swdevt swdevt[] = { makedev(3, 1), 0, /* hk0b */ makedev(3, 9), 0, /* hk1b */ 0, 0, }; @ikI۴$ 7&iY/6i ((/* sw.c 4.4 81/03/08 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/buf.h" #include "../h/conf.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/inode.h" #include "../h/map.h" struct buf rswbuf; /* * Indirect driver for multi-controller paging. */ swstrategy(bp) register struct buf *bp; { int sz, off, seg; dev_t dev; sz = (bp->b_bcount+511)/512; off = bp->b_blkno % DMMAX; if (bp->b_blkno+sz > nswap || off+sz > DMMAX) { bp->b_flags |= B_ERROR; iodone(bp); return; } seg = bp->b_blkno / DMMAX; dev = swdevt[seg % nswdev].sw_dev; seg /= nswdev; bp->b_blkno = seg*DMMAX + off; bp->b_dev = dev; if (dev == 0) panic("swstrategy"); (*bdevsw[major(dev)].d_strategy)(bp); } swread(dev) { physio(swstrategy, &rswbuf, dev, B_READ, minphys); } swwrite(dev) { physio(swstrategy, &rswbuf, dev, B_WRITE, minphys); } /* * System call swapon(name) enables swapping on device name, * which must be in the swdevsw. Return EBUSY * if already swapping on this device. */ vswapon() { register struct inode *ip; dev_t dev; register struct swdevt *sp; ip = namei(uchar, 0); if (ip == NULL) return; if ((ip->i_mode&IFMT) != IFBLK) { u.u_error = ENOTBLK; iput(ip); return; } dev = (dev_t)ip->i_un.i_rdev; iput(ip); if (major(dev) >= nblkdev) { u.u_error = ENXIO; return; } /* * Search starting at second table entry, * since first (primary swap area) is freed at boot. */ for (sp = &swdevt[1]; sp->sw_dev; sp++) if (sp->sw_dev == dev) { if (sp->sw_freed) { u.u_error = EBUSY; return; } swfree(sp - swdevt); return; } u.u_error = ENODEV; } /* * Swfree(index) frees the index'th portion of the swap map. * Each of the nswdev devices provides 1/nswdev'th of the swap * space, which is laid out with blocks of DMMAX pages circularly * among the devices. */ swfree(index) int index; { register swblk_t vsbase; register int blk; swdevt[index].sw_freed = 1; for (vsbase = index*DMMAX; vsbase < nswap; vsbase += nswdev*DMMAX) { blk = nswap - vsbase; if (blk > DMMAX) blk = DMMAX; if (vsbase == 0) { /* * Can't free a block starting at 0 in the swapmap * but need some space for argmap so use 1/2 this * hunk which needs special treatment anyways. */ argdev = swdevt[0].sw_dev; rminit(argmap, blk/2-CLSIZE, CLSIZE, "argmap", ARGMAPSIZE); /* * First of all chunks... initialize the swapmap * the second half of the hunk. */ rminit(swapmap, blk/2, blk/2, "swap", nswapmap); } else rmfree(swapmap, blk, vsbase); } } @ik1$R!$`u79&iDQ6i /* up.c 4.41 81/11/12 */ #include "up.h" #if NSC > 0 /* * UNIBUS disk driver with overlapped seeks and ECC recovery. * * TODO: * Add bad sector forwarding code * Check that offset recovery code works */ #include "../h/param.h" #include "../h/systm.h" #include "../h/cpu.h" #include "../h/nexus.h" #include "../h/dk.h" #include "../h/buf.h" #include "../h/conf.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/map.h" #include "../h/pte.h" #include "../h/mtpr.h" #include "../h/vm.h" #include "../h/ubavar.h" #include "../h/ubareg.h" #include "../h/cmap.h" #include "../h/upreg.h" struct up_softc { int sc_softas; int sc_ndrive; int sc_wticks; int sc_recal; } up_softc[NSC]; /* THIS SHOULD BE READ OFF THE PACK, PER DRIVE */ struct size { daddr_t nblocks; int cyloff; } up_sizes[8] = { 15884, 0, /* A=cyl 0 thru 26 */ 33440, 27, /* B=cyl 27 thru 81 */ 495520, 0, /* C=cyl 0 thru 814 */ 15884, 562, /* D=cyl 562 thru 588 */ 55936, 589, /* E=cyl 589 thru 680 */ #ifndef NOBADSECT 81376, 681, /* F=cyl 681 thru 814 */ 153728, 562, /* G=cyl 562 thru 814 */ #else 81472, 681, 153824, 562, #endif 291346, 82, /* H=cyl 82 thru 561 */ }, fj_sizes[8] = { 15884, 0, /* A=cyl 0 thru 49 */ 33440, 50, /* B=cyl 50 thru 154 */ 263360, 0, /* C=cyl 0 thru 822 */ 0, 0, 0, 0, 0, 0, 0, 0, #ifndef NOBADSECT 213664, 155, /* H=cyl 155 thru 822 */ #else 213760, 155, #endif }; /* END OF STUFF WHICH SHOULD BE READ IN PER DISK */ /* * On a 780 upSDIST could be 2, but * in the interest of 750's... */ #define _upSDIST 3 /* 1.5 msec */ #define _upRDIST 4 /* 2.0 msec */ int upSDIST = _upSDIST; int upRDIST = _upRDIST; int upprobe(), upslave(), upattach(), updgo(), upintr(); struct uba_ctlr *upminfo[NSC]; struct uba_device *updinfo[NUP]; struct uba_device *upip[NSC][4]; u_short upstd[] = { 0776700, 0774400, 0776300, 0 }; struct uba_driver scdriver = { upprobe, upslave, upattach, updgo, upstd, "up", updinfo, "sc", upminfo }; struct buf uputab[NUP]; struct upst { short nsect; short ntrak; short nspc; short ncyl; struct size *sizes; } upst[] = { 32, 19, 32*19, 823, up_sizes, /* 9300/cdc */ /* 9300 actually has 815 cylinders... */ 32, 10, 32*10, 823, fj_sizes, /* fujitsu 160m */ }; u_char up_offset[16] = { UPOF_P400, UPOF_M400, UPOF_P400, UPOF_M400, UPOF_P800, UPOF_M800, UPOF_P800, UPOF_M800, UPOF_P1200, UPOF_M1200, UPOF_P1200, UPOF_M1200, 0, 0, 0, 0 }; struct buf rupbuf[NUP]; #define b_cylin b_resid #ifdef INTRLVE daddr_t dkblock(); #endif int upwstart, upwatch(); /* Have started guardian */ int upseek; int upwaitdry; /*ARGSUSED*/ upprobe(reg) caddr_t reg; { register int br, cvec; #ifdef lint br = 0; cvec = br; br = cvec; #endif ((struct updevice *)reg)->upcs1 = UP_IE|UP_RDY; DELAY(10); ((struct updevice *)reg)->upcs1 = 0; return (1); } upslave(ui, reg) struct uba_device *ui; caddr_t reg; { register struct updevice *upaddr = (struct updevice *)reg; upaddr->upcs1 = 0; /* conservative */ upaddr->upcs2 = ui->ui_slave; if (upaddr->upcs2&UPCS2_NED) { upaddr->upcs1 = UP_DCLR|UP_GO; return (0); } return (1); } upattach(ui) register struct uba_device *ui; { register struct updevice *upaddr; if (upwstart == 0) { timeout(upwatch, (caddr_t)0, hz); upwstart++; } if (ui->ui_dk >= 0) dk_mspw[ui->ui_dk] = .0000020345; upip[ui->ui_ctlr][ui->ui_slave] = ui; up_softc[ui->ui_ctlr].sc_ndrive++; upaddr = (struct updevice *)ui->ui_addr; upaddr->upcs1 = 0; upaddr->upcs2 = ui->ui_slave; upaddr->uphr = UPHR_MAXTRAK; if (upaddr->uphr == 9) ui->ui_type = 1; /* fujitsu hack */ upaddr->upcs2 = UPCS2_CLR; /* upaddr->uphr = UPHR_MAXCYL; printf("maxcyl %d\n", upaddr->uphr); upaddr->uphr = UPHR_MAXTRAK; printf("maxtrak %d\n", upaddr->uphr); upaddr->uphr = UPHR_MAXSECT; printf("maxsect %d\n", upaddr->uphr); */ } upstrategy(bp) register struct buf *bp; { register struct uba_device *ui; register struct upst *st; register int unit; register struct buf *dp; int xunit = minor(bp->b_dev) & 07; long bn, sz; sz = (bp->b_bcount+511) >> 9; unit = dkunit(bp); if (unit >= NUP) goto bad; ui = updinfo[unit]; if (ui == 0 || ui->ui_alive == 0) goto bad; st = &upst[ui->ui_type]; if (bp->b_blkno < 0 || (bn = dkblock(bp))+sz > st->sizes[xunit].nblocks) goto bad; bp->b_cylin = bn/st->nspc + st->sizes[xunit].cyloff; (void) spl5(); dp = &uputab[ui->ui_unit]; disksort(dp, bp); if (dp->b_active == 0) { (void) upustart(ui); bp = &ui->ui_mi->um_tab; if (bp->b_actf && bp->b_active == 0) (void) upstart(ui->ui_mi); } (void) spl0(); return; bad: bp->b_flags |= B_ERROR; iodone(bp); return; } /* * Unit start routine. * Seek the drive to be where the data is * and then generate another interrupt * to actually start the transfer. * If there is only one drive on the controller, * or we are very close to the data, don't * bother with the search. If called after * searching once, don't bother to look where * we are, just queue for transfer (to avoid * positioning forever without transferrring.) */ upustart(ui) register struct uba_device *ui; { register struct buf *bp, *dp; register struct uba_ctlr *um; register struct updevice *upaddr; register struct upst *st; daddr_t bn; int sn, csn; /* * The SC21 cancels commands if you just say * cs1 = UP_IE * so we are cautious about handling of cs1. * Also don't bother to clear as bits other than in upintr(). */ int didie = 0; if (ui == 0) return (0); um = ui->ui_mi; dk_busy &= ~(1<ui_dk); dp = &uputab[ui->ui_unit]; if ((bp = dp->b_actf) == NULL) goto out; /* * If the controller is active, just remember * that this device would like to be positioned... * if we tried to position now we would confuse the SC21. */ if (um->um_tab.b_active) { up_softc[um->um_ctlr].sc_softas |= 1<ui_slave; return (0); } /* * If we have already positioned this drive, * then just put it on the ready queue. */ if (dp->b_active) goto done; dp->b_active = 1; upaddr = (struct updevice *)um->um_addr; upaddr->upcs2 = ui->ui_slave; /* * If drive has just come(( up, * setup the pack. */ if ((upaddr->upds & UPDS_VV) == 0) { /* SHOULD WARN SYSTEM THAT THIS HAPPENED */ upaddr->upcs1 = UP_IE|UP_DCLR|UP_GO; upaddr->upcs1 = UP_IE|UP_PRESET|UP_GO; upaddr->upof = UPOF_FMT22; didie = 1; } /* * If drive is offline, forget about positioning. */ if ((upaddr->upds & (UPDS_DPR|UPDS_MOL)) != (UPDS_DPR|UPDS_MOL)) goto done; /* * If there is only one drive, * dont bother searching. */ if (up_softc[um->um_ctlr].sc_ndrive == 1) goto done; /* * Figure out where this transfer is going to * and see if we are close enough to justify not searching. */ st = &upst[ui->ui_type]; bn = dkblock(bp); sn = bn%st->nspc; sn = (sn + st->nsect - upSDIST) % st->nsect; if (bp->b_cylin - upaddr->updc) goto search; /* Not on-cylinder */ else if (upseek) goto done; /* Ok just to be on-cylinder */ csn = (upaddr->upla>>6) - sn - 1; if (csn < 0) csn += st->nsect; if (csn > st->nsect - upRDIST) goto done; search: upaddr->updc = bp->b_cylin; /* * Not on cylinder at correct position, * seek/search. */ if (upseek) upaddr->upcs1 = UP_IE|UP_SEEK|UP_GO; else { upaddr->upda = sn; upaddr->upcs1 = UP_IE|UP_SEARCH|UP_GO; } didie = 1; /* * Mark unit busy for iostat. */ if (ui->ui_dk >= 0) { dk_busy |= 1<ui_dk; dk_seek[ui->ui_dk]++; } goto out; done: /* * Device is ready to go. * Put it on the ready queue for the controller * (unless its already there.) */ if (dp->b_active != 2) { dp->b_forw = NULL; if (um->um_tab.b_actf == NULL) um->um_tab.b_actf = dp; else um->um_tab.b_actl->b_forw = dp; um->um_tab.b_actl = dp; dp->b_active = 2; } out: return (didie); } /* * Start up a transfer on a drive. */ upstart(um) register struct uba_ctlr *um; { register struct buf *bp, *dp; register struct uba_device *ui; register struct updevice *upaddr; struct upst *st; daddr_t bn; int dn, sn, tn, cmd, waitdry; loop: /* * Pull a request off the controller queue */ if ((dp = um->um_tab.b_actf) == NULL) return (0); if ((bp = dp->b_actf) == NULL) { um->um_tab.b_actf = dp->b_forw; goto loop; } /* * Mark controller busy, and * determine destination of this request. */ um->um_tab.b_active++; ui = updinfo[dkunit(bp)]; bn = dkblock(bp); dn = ui->ui_slave; st = &upst[ui->ui_type]; sn = bn%st->nspc; tn = sn/st->nsect; sn %= st->nsect; upaddr = (struct updevice *)ui->ui_addr; /* * Select drive if not selected already. */ if ((upaddr->upcs2&07) != dn) upaddr->upcs2 = dn; /* * Check that it is ready and online */ waitdry = 0; while ((upaddr->upds&UPDS_DRY) == 0) { if (++waitdry > 512) break; upwaitdry++; } if ((upaddr->upds & UPDS_DREADY) != UPDS_DREADY) { printf("up%d: not ready", dkunit(bp)); if ((upaddr->upds & UPDS_DREADY) != UPDS_DREADY) { printf("\n"); um->um_tab.b_active = 0; um->um_tab.b_errcnt = 0; dp->b_actf = bp->av_forw; dp->b_active = 0; bp->b_flags |= B_ERROR; iodone(bp); goto loop; } /* * Oh, well, sometimes this * happens, for reasons unknown. */ printf(" (flakey)\n"); } /* * Setup for the transfer, and get in the * UNIBUS adaptor queue. */ upaddr->updc = bp->b_cylin; upaddr->upda = (tn << 8) + sn; upaddr->upwc = -bp->b_bcount / sizeof (short); if (bp->b_flags & B_READ) cmd = UP_IE|UP_RCOM|UP_GO; else cmd = UP_IE|UP_WCOM|UP_GO; um->um_cmd = cmd; (void) ubago(ui); return (1); } /* * Now all ready to go, stuff the registers. */ updgo(um) struct uba_ctlr *um; { register struct updevice *upaddr = (struct updevice *)um->um_addr; upaddr->upba = um->um_ubinfo; upaddr->upcs1 = um->um_cmd|((um->um_ubinfo>>8)&0x300); } /* * Handle a disk interrupt. */ upintr(sc21) register sc21; { register struct buf *bp, *dp; register struct uba_ctlr *um = upminfo[sc21]; register struct uba_device *ui; register struct updevice *upaddr = (struct updevice *)um->um_addr; register unit; struct up_softc *sc = &up_softc[um->um_ctlr]; int as = (upaddr->upas & 0377) | sc->sc_softas; int needie = 1, waitdry, err; sc->s@ik1$R!$`u79&iDQ6ic_wticks = 0; sc->sc_softas = 0; /* * If controller wasn't transferring, then this is an * interrupt for attention status on seeking drives. * Just service them. */ if (um->um_tab.b_active == 0) { if (upaddr->upcs1 & UP_TRE) upaddr->upcs1 = UP_TRE; goto doattn; } /* * Get device and block structures, and a pointer * to the uba_device for the drive. Select the drive. */ dp = um->um_tab.b_actf; bp = dp->b_actf; ui = updinfo[dkunit(bp)]; dk_busy &= ~(1 << ui->ui_dk); if ((upaddr->upcs2&07) != ui->ui_slave) upaddr->upcs2 = ui->ui_slave; /* * Check for and process errors on * either the drive or the controller. */ if ((err = (upaddr->upds&UPDS_ERR) || (upaddr->upcs1&UP_TRE)) || upaddr->upwc != 0) { if (!err) printf("up%d: word count != 0\n", dkunit(bp)); waitdry = 0; while ((upaddr->upds & UPDS_DRY) == 0) { if (++waitdry > 512) break; upwaitdry++; } if (upaddr->uper1&UPER1_WLE) { /* * Give up on write locked devices * immediately. */ printf("up%d: write locked\n", dkunit(bp)); bp->b_flags |= B_ERROR; } else if (++um->um_tab.b_errcnt > 27) { /* * After 28 retries (16 without offset, and * 12 with offset positioning) give up. */ harderr(bp, "up"); printf("cs2=%b er1=%b er2=%b\n", upaddr->upcs2, UPCS2_BITS, upaddr->uper1, UPER1_BITS, upaddr->uper2, UPER2_BITS); bp->b_flags |= B_ERROR; } else { /* * Retriable error. * If a soft ecc, correct it (continuing * by returning if necessary. * Otherwise fall through and retry the transfer */ um->um_tab.b_active = 0; /* force retry */ if ((upaddr->uper1&(UPER1_DCK|UPER1_ECH))==UPER1_DCK) if (upecc(ui)) return; } /* * Clear drive error and, every eight attempts, * (starting with the fourth) * recalibrate to clear the slate. */ upaddr->upcs1 = UP_TRE|UP_IE|UP_DCLR|UP_GO; needie = 0; if ((um->um_tab.b_errcnt&07) == 4 && um->um_tab.b_active == 0) { upaddr->upcs1 = UP_RECAL|UP_IE|UP_GO; sc->sc_recal = 0; goto nextrecal; } } /* * Advance recalibration finite state machine * if recalibrate in progress, through * RECAL * SEEK * OFFSET (optional) * RETRY */ switch (sc->sc_recal) { case 1: upaddr->updc = bp->b_cylin; upaddr->upcs1 = UP_SEEK|UP_IE|UP_GO; goto nextrecal; case 2: if (um->um_tab.b_errcnt < 16 || (bp->b_flags&B_READ) == 0) goto donerecal; upaddr->upof = up_offset[um->um_tab.b_errcnt & 017] | UPOF_FMT22; upaddr->upcs1 = UP_IE|UP_OFFSET|UP_GO; goto nextrecal; nextrecal: sc->sc_recal++; um->um_tab.b_active = 1; return; donerecal: case 3: sc->sc_recal = 0; um->um_tab.b_active = 0; break; } /* * If still ``active'', then don't need any more retries. */ if (um->um_tab.b_active) { /* * If we were offset positioning, * return to centerline. */ if (um->um_tab.b_errcnt >= 16) { upaddr->upof = UPOF_FMT22; upaddr->upcs1 = UP_RTC|UP_GO|UP_IE; while (upaddr->upds & UPDS_PIP) DELAY(25); needie = 0; } um->um_tab.b_active = 0; um->um_tab.b_errcnt = 0; um->um_tab.b_actf = dp->b_forw; dp->b_active = 0; dp->b_errcnt = 0; dp->b_actf = bp->av_forw; bp->b_resid = (-upaddr->upwc * sizeof(short)); iodone(bp); /* * If this unit has more work to do, * then start it up right away. */ if (dp->b_actf) if (upustart(ui)) needie = 0; } as &= ~(1<ui_slave); /* * Release unibus resources and flush data paths. */ ubadone(um); doattn: /* * Process other units which need attention. * For each unit which needs attention, call * the unit start routine to place the slave * on the controller device queue. */ while (unit = ffs(as)) { unit--; /* was 1 origin */ as &= ~(1<upas = 1<um_tab.b_actf && um->um_tab.b_active == 0) if (upstart(um)) needie = 0; if (needie) upaddr->upcs1 = UP_IE; } upread(dev) dev_t dev; { register int unit = minor(dev) >> 3; if (unit >= NUP) u.u_error = ENXIO; else physio(upstrategy, &rupbuf[unit], dev, B_READ, minphys); } upwrite(dev) dev_t dev; { register int unit = minor(dev) >> 3; if (unit >= NUP) u.u_error = ENXIO; else physio(upstrategy, &rupbuf[unit], dev, B_WRITE, minphys); } /* * Correct an ECC error, and restart the i/o to complete * the transfer if necessary. This is quite complicated because * the transfer may be going to an odd memory address base and/or * across a page boundary. */ upecc(ui) register struct uba_device *ui; { register struct updevice *up = (struct updevice *)ui->ui_addr; register struct buf *bp = uputab[ui->ui_unit].b_actf; register struct uba_ctlr *um = ui->ui_mi; register struct upst *st; struct uba_regs *ubp = ui->ui_hd->uh_uba; register int i; caddr_t addr; int reg, bit, byte, npf, mask, o, cmd, ubaddr; int bn, cn, tn, sn; /* * Npf is the number of sectors transfe((rred before the sector * containing the ECC error, and reg is the UBA register * mapping (the first part of) the transfer. * O is offset within a memory page of the first byte transferred. */ npf = btop((up->upwc * sizeof(short)) + bp->b_bcount) - 1; reg = btop(um->um_ubinfo&0x3ffff) + npf; o = (int)bp->b_un.b_addr & PGOFSET; printf("up%d%c: soft ecc sn%d\n", dkunit(bp), 'a'+(minor(bp->b_dev)&07), bp->b_blkno + npf); mask = up->upec2; #ifdef UPECCDEBUG printf("npf %d reg %x o %d mask %o pos %d\n", npf, reg, o, mask, up->upec1); #endif /* * Flush the buffered data path, and compute the * byte and bit position of the error. The variable i * is the byte offset in the transfer, the variable byte * is the offset from a page boundary in main memory. */ ubapurge(um); i = up->upec1 - 1; /* -1 makes 0 origin */ bit = i&07; i = (i&~07)>>3; byte = i + o; /* * Correct while possible bits remain of mask. Since mask * contains 11 bits, we continue while the bit offset is > -11. * Also watch out for end of this block and the end of the whole * transfer. */ while (i < 512 && (int)ptob(npf)+i < bp->b_bcount && bit > -11) { addr = ptob(ubp->uba_map[reg+btop(byte)].pg_pfnum)+ (byte & PGOFSET); #ifdef UPECCDEBUG printf("addr %x map reg %x\n", addr, *(int *)(&ubp->uba_map[reg+btop(byte)])); printf("old: %x, ", getmemc(addr)); #endif putmemc(addr, getmemc(addr)^(mask<um_tab.b_active++; /* Either complete or continuing... */ if (up->upwc == 0) return (0); /* * Have to continue the transfer... clear the drive, * and compute the position where the transfer is to continue. * We have completed npf+1 sectors of the transfer already; * restart at offset o of next sector (i.e. in UBA register reg+1). */ #ifdef notdef up->uper1 = 0; up->upcs1 |= UP_GO; #else up->upcs1 = UP_TRE|UP_IE|UP_DCLR|UP_GO; bn = dkblock(bp); st = &upst[ui->ui_type]; cn = bp->b_cylin; sn = bn%st->nspc + npf + 1; tn = sn/st->nsect; sn %= st->nsect; cn += tn/st->ntrak; tn %= st->ntrak; up->updc = cn; up->upda = (tn << 8) | sn; ubaddr = (int)ptob(reg+1) + o; up->upba = ubaddr; cmd = (ubaddr >> 8) & 0x300; cmd |= UP_IE|UP_GO|UP_RCOM; up->upcs1 = cmd; #endif return (1); } /* * Reset driver after UBA init. * Cancel software state of all pending transfers * and restart all units and the controller. */ upreset(uban) int uban; { register struct uba_ctlr *um; register struct uba_device *ui; register sc21, unit; for (sc21 = 0; sc21 < NSC; sc21++) { if ((um = upminfo[sc21]) == 0 || um->um_ubanum != uban || um->um_alive == 0) continue; printf(" sc%d", sc21); um->um_tab.b_active = 0; um->um_tab.b_actf = um->um_tab.b_actl = 0; up_softc[sc21].sc_recal = 0; if (um->um_ubinfo) { printf("<%d>", (um->um_ubinfo>>28)&0xf); ubadone(um); } ((struct updevice *)(um->um_addr))->upcs2 = UPCS2_CLR; for (unit = 0; unit < NUP; unit++) { if ((ui = updinfo[unit]) == 0) continue; if (ui->ui_alive == 0 || ui->ui_mi != um) continue; uputab[unit].b_active = 0; (void) upustart(ui); } (void) upstart(um); } } /* * Wake up every second and if an interrupt is pending * but nothing has happened increment a counter. * If nothing happens for 20 seconds, reset the UNIBUS * and begin anew. */ upwatch() { register struct uba_ctlr *um; register sc21, unit; register struct up_softc *sc; timeout(upwatch, (caddr_t)0, hz); for (sc21 = 0; sc21 < NSC; sc21++) { um = upminfo[sc21]; if (um == 0 || um->um_alive == 0) continue; sc = &up_softc[sc21]; if (um->um_tab.b_active == 0) { for (unit = 0; unit < NUP; unit++) if (uputab[unit].b_active && updinfo[unit]->ui_mi == um) goto active; sc->sc_wticks = 0; continue; } active: sc->sc_wticks++; if (sc->sc_wticks >= 20) { sc->sc_wticks = 0; printf("sc%d: lost interrupt\n", sc21); ubareset(um->um_ubanum); } } } #define DBSIZE 20 updump(dev) dev_t dev; { struct updevice *upaddr; char *start; int num, blk, unit; struct size *sizes; register struct uba_regs *uba; register struct uba_device *ui; register short *rp; struct upst *st; unit = minor(dev) >> 3; if (unit >= NUP) return (ENXIO); #define phys(cast, addr) ((cast)((int)addr & 0x7fffffff)) ui = phys(struct uba_device *, updinfo[unit]); if (ui->ui_alive == 0) return (ENXIO); uba = phys(struct uba_hd *, ui->ui_hd)->uh_physuba; ubainit(uba); upaddr = (struct updevice *)ui->ui_physaddr; DELAY(2000000); num = maxfree; start = 0; upaddr->upcs2 = unit; DELAY(100); if ((upaddr->upcs1&UP_DVA) == 0) return (EFAULT); if ((upaddr->upds & UPDS_VV) == 0) { upaddr->upcs1 = UP_DCLR|UP_GO; upaddr->upcs1 = UP_PRESET|UP_GO; upaddr->upof = UPOF_FMT22; } if ((upaddr->upds & UPDS_DREADY) != UPDS_DREADY) return (EFAULT); st = &upst[ui->ui_type]; sizes = phys(struct size *, st->sizes); if (dumplo < 0 || dumplo + num >= sizes[minor(dev)&07].nblocks) return (EINVAL); while (num > 0) { register struct pte *io; register int i; int cn, sn, tn; daddr_t bn; blk = num > DBSIZE ? DBSIZE : num; io = uba->uba_map; for (i = 0; i < blk; i++) *(int *)io++ = (btop(start)+i) | (1<<21) | UBAMR_MRV; *(int *)io = 0; bn = dumplo + btop(start); cn = bn/st->nspc + sizes[minor(dev)&07].cyloff; sn = bn%st->nspc; tn = sn/st->nsect; sn = sn%st->nsect; upaddr->updc = cn; rp = (short *) &upaddr->upda; *rp = (tn << 8) + sn; *--rp = 0; *--rp = -blk*NBPG / sizeof (short); *--rp = UP_GO|UP_WCOM; do { DELAY(25); } while ((upaddr->upcs1 & UP_RDY) == 0); if (upaddr->upds&UPDS_ERR) return (EIO); start += blk*NBPG; num -= blk; } return (0); } #endif @ik]$.6&iQSP6i /* pty.c 4.8 81/08/14 */ /* * Pseudo-teletype Driver * (Actually two drivers, requiring two entries in 'cdevsw') */ #include "pty.h" #if NPTY > 0 #include "../h/param.h" #include "../h/systm.h" #include "../h/tty.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/conf.h" #include "../h/buf.h" #include "../h/file.h" #define NPTY 16 /* Number of pseudo-teletypes */ #define BUFSIZ 100 /* Chunk size iomoved from user */ #define ALLDELAYS (NLDELAY|TBDELAY|XTABS|CRDELAY|VTDELAY) /* * A pseudo-teletype is a special device which is not unlike a pipe. * It is used to communicate between two processes. However, it allows * one to simulate a teletype, including mode setting, interrupt, and * multiple end of files (all not possible on a pipe). There are * really two drivers here. One is the device which looks like a TTY * and can be thought of as the slave device, and hence its routines * are prefixed with 'pts' (PTY Slave). The other driver can be * thought of as the controlling device, and its routines are prefixed * by 'ptc' (PTY Controller). To type on the simulated keyboard of the * PTY, one does a 'write' to the controlling device. To get the * simulated printout from the PTY, one does a 'read' on the controlling * device. Normally, the controlling device is called 'ptyx' and the * slave device is called 'ttyx' (to make programs like 'who' happy). */ struct tty pt_tty[NPTY]; /* TTY headers for PTYs */ /*ARGSUSED*/ ptsopen(dev, flag) dev_t dev; { /* Open for PTY Slave */ register struct tty *tp; if(minor(dev) >= NPTY) { u.u_error = ENXIO; return; } tp = &pt_tty[minor(dev)]; if((tp->t_state & ISOPEN) == 0) { ttychars(tp); /* Set up default chars */ tp->t_flags = 0; /* No features (nor raw mode) */ } else if(tp->t_state&XCLUDE && u.u_uid != 0) { u.u_error = EBUSY; return; } if(tp->t_oproc) /* Ctrlr still around. */ tp->t_state |= CARR_ON; while((tp->t_state & CARR_ON) == 0) { tp->t_state |= WOPEN; sleep((caddr_t)&tp->t_rawq, TTIPRI); } (*linesw[tp->t_line].l_open)(dev, tp); } ptsclose(dev) dev_t dev; { /* Close slave part of PTY */ register struct tty *tp; tp = &pt_tty[minor(dev)]; (*linesw[tp->t_line].l_close)(tp); } ptsread(dev) dev_t dev; { /* Read from PTY, i.e. from data written by controlling device */ register struct tty *tp; tp = &pt_tty[minor(dev)]; if(tp->t_oproc) { (*linesw[tp->t_line].l_read)(tp); /* Wakeup other half if sleeping */ wakeup((caddr_t)&tp->t_rawq.c_cf); } } ptswrite(dev) dev_t dev; { /* Write on PTY, i.e. to be read from controlling device */ register struct tty *tp; tp = &pt_tty[minor(dev)]; /* Wait for controlling device to be opened */ if(tp->t_oproc) (*linesw[tp->t_line].l_write)(tp); } ptsstart(tp) struct tty *tp; { /* Called by 'ttstart' to output a character. Merely wakes up controlling half, which does actual work */ if(tp->t_state & TTSTOP) return; wakeup((caddr_t)&tp->t_outq.c_cf); } /*ARGSUSED*/ ptcopen(dev, flag) dev_t dev; { /* Open for PTY ((Controller */ register struct tty *tp; if(minor(dev) >= NPTY) { u.u_error = ENXIO; return; } tp = &pt_tty[minor(dev)]; if(tp->t_oproc) { u.u_error = EIO; return; } tp->t_oproc = ptsstart; /* Set address of start routine */ tp->t_iproc = 0; if(tp->t_state & WOPEN) wakeup((caddr_t)&tp->t_rawq); tp->t_state |= CARR_ON; } ptcclose(dev) dev_t dev; { /* Close controlling part of PTY */ register struct tty *tp; tp = &pt_tty[minor(dev)]; if(tp->t_state & ISOPEN) gsignal(tp->t_pgrp, SIGHUP); tp->t_state &= ~CARR_ON; /* Virtual carrier is gone */ flushtty(tp, FREAD|FWRITE); /* Clean things up */ tp->t_oproc = 0; /* Mark as closed */ } ptcread(dev) dev_t dev; { /* Read from PTY's output buffer */ register struct tty *tp; tp = &pt_tty[minor(dev)]; if((tp->t_state&(CARR_ON|ISOPEN)) == 0) return; while(tp->t_outq.c_cc == 0 || /* Wait for something to arrive */ (tp->t_state&TTSTOP)) /* (Woken by ptsstart) */ sleep((caddr_t)&tp->t_outq.c_cf, TTIPRI); while(tp->t_outq.c_cc && passc(getc(&tp->t_outq)) >= 0); if(tp->t_outq.c_cc <= TTLOWAT(tp) && (tp->t_state&ASLEEP)) { tp->t_state &= ~ASLEEP; if(tp->t_chan) mcstart(tp->t_chan, (caddr_t)&tp->t_outq); else wakeup((caddr_t)&tp->t_outq); } } ptcwrite(dev) dev_t dev; { /* Stuff characters into PTY's input buffer */ register struct tty *tp; register char *cp, *ce; register int cc; char locbuf[BUFSIZ]; tp = &pt_tty[minor(dev)]; if((tp->t_state&(CARR_ON|ISOPEN)) == 0) return; while(u.u_count) { cc = MIN(u.u_count, BUFSIZ); cp = locbuf; iomove(cp, (unsigned)cc, B_WRITE); if(u.u_error) break; ce = cp + cc; while(cp < ce) { while(tp->t_delct && tp->t_rawq.c_cc >= TTYHOG - 2) { wakeup((caddr_t)&tp->t_rawq); /* Better than just flushing it! */ /* Wait for something to be read */ sleep((caddr_t)&tp->t_rawq.c_cf, TTOPRI); } (*linesw[tp->t_line].l_rint)(*cp++, tp); } } } /* Note: Both slave and controlling device have the same routine for */ /* 'ioctl' (but note check for controller - 4/12/78:mob)*/ /*ARGSUSED*/ ptyioctl(dev, cmd, addr, flag) caddr_t addr; dev_t dev; { /* Read and write status bits */ register struct tty *tp; register int tbd; #ifdef BLAND register int nld; #endif tp = &pt_tty[minor(dev)]; /* if controller stty then must flush to prevent a hang */ if(cdevsw[major(dev)].d_open == ptcopen && cmd == TIOCSETP) while(getc(&tp->t_outq) >= 0); if(ttioctl(tp, cmd, addr, dev)) { if(cmd == TIOCSETP || cmd == TIOCSETN) { #ifdef BLAND nld = tp->t_flags & NLDELAY; #endif tbd = tp->t_flags & TBDELAY; tp->t_flags &= ~ALLDELAYS; if(tbd == TBDELAY) /* Wants tab expansion */ tp->t_flags |= tbd; #ifdef BLAND if(nld == NLDELAY) /* Allow ANN ARBOR mode. */ tp->t_flags |= nld; #endif } } else u.u_error = ENOTTY; } #endif @ik$&ehkn}6&i 6i /* tty.c 4.12 81/07/22 */ /* * TTY subroutines common to more than one line discipline */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/tty.h" #include "../h/proc.h" #include "../h/mx.h" #include "../h/inode.h" #include "../h/file.h" #include "../h/reg.h" #include "../h/conf.h" #include "../h/buf.h" #include "../h/dk.h" char partab[]; /* * Input mapping table-- if an entry is non-zero, when the * corresponding character is typed preceded by "\" the escape * sequence is replaced by the table value. Mostly used for * upper-case only terminals. */ char maptab[] ={ 000,000,000,000,000,000,000,000, 000,000,000,000,000,000,000,000, 000,000,000,000,000,000,000,000, 000,000,000,000,000,000,000,000, 000,'|',000,000,000,000,000,'`', '{','}',000,000,000,000,000,000, 000,000,000,000,000,000,000,000, 000,000,000,000,000,000,000,000, 000,000,000,000,000,000,000,000, 000,000,000,000,000,000,000,000, 000,000,000,000,000,000,000,000, 000,000,000,000,000,000,'~',000, 000,'A','B','C','D','E','F','G', 'H','I','J','K','L','M','N','O', 'P','Q','R','S','T','U','V','W', 'X','Y','Z',000,000,000,000,000, }; short tthiwat[16] = { 100,100,100,100,100,100,100,200,200,400,400,400,650,650,650,650 }; short ttlowat[16] = { 30, 30, 30, 30, 30, 30, 30, 50, 50,120,120,120,125,125,125,125 }; #define OBUFSIZ 100 /* * set default control characters. */ ttychars(tp) register struct tty *tp; { tun.t_intrc = CINTR; tun.t_quitc = CQUIT; tun.t_startc = CSTART; tun.t_stopc = CSTOP; tun.t_eofc = CEOT; tun.t_brkc = CBRK; tp->t_erase = CERASE; tp->t_kill = CKILL; /* begin local */ tlun.t_suspc = CTRL(z); tlun.t_dsuspc = CTRL(y); tlun.t_rprntc = CTRL(r); tlun.t_flushc = CTRL(o); tlun.t_werasc = CTRL(w); tlun.t_lnextc = CTRL(v); tp->t_local = 0; tp->t_lstate = 0; /* end local */ } /* * Wait for output to drain, then flush input waiting. */ wflushtty(tp) register struct tty *tp; { (void) spl5(); while (tp->t_outq.c_cc && tp->t_state&CARR_ON) { (*tp->t_oproc)(tp); tp->t_state |= ASLEEP; sleep((caddr_t)&tp->t_outq, TTOPRI); } flushtty(tp, FREAD|FWRITE); (void) spl0(); } /* * flush all TTY queues */ flushtty(tp, rw) register struct tty *tp; { register s; if (tp->t_line == NETLDISC) return; s = spl6(); if (rw & FREAD) { while (getc(&tp->t_canq) >= 0) ; wakeup((caddr_t)&tp->t_rawq); } if (rw & FWRITE) { wakeup((caddr_t)&tp->t_outq); tp->t_state &= ~TTSTOP; (*cdevsw[major(tp->t_dev)].d_stop)(tp); while (getc(&tp->t_outq) >= 0) ; } if (rw & FREAD) { while (getc(&tp->t_rawq) >= 0) ; tp->t_delct = 0; tp->t_rocount = 0; /* local */ tp->t_rocol = 0; tp->t_lstate = 0; } splx(s); } /* * Send stop character on input overflow. */ ttyblock(tp) register struct tty *tp; { register x; x = tp->t_rawq.c_cc + tp->t_canq.c_cc; if (tp->t_rawq.c_cc > TTYHOG) { flushtty(tp, FREAD|FWRITE); tp->t_state &= ~TBLOCK; } if (x >= TTYHOG/2) { if (putc(tun.t_stopc, &tp->t_outq)==0) { tp->t_state |= TBLOCK; tp->t_char++; ttstart(tp); } } } /* * Restart typewriter output following a delay * timeout. * The name of the routine is passed to the timeout * subroutine and it is called during a clock interrupt. */ ttrstrt(tp) register struct tty *tp; { if (tp == 0) { printf("ttrstrt: arg was 0!\n"); return; } tp->t_state &= ~TIMEOUT; ttstart(tp); } /* * Start output on the typewriter. It is used from the top half * after some characters have been put on the output queue, * from the interrupt routine to transmit the next * character, and after a timeout has finished. */ ttstart(tp) register struct tty *tp; { register s; s = spl5(); if((tp->t_state&(TIMEOUT|TTSTOP|BUSY)) == 0) (*tp->t_oproc)(tp); splx(s); } /* * Common code for tty ioctls. */ /*ARGSUSED*/ ttioctl(tp, com, addr, flag) register struct tty *tp; caddr_t addr; { int dev; unsigned t; struct sgttyb iocb; struct clist tq; extern int nldisp; register c; int temp; /* * This is especially so that isatty() will * fail when carrier is gone. */ if ((tp->t_state&CARR_ON) == 0) { u.u_error = EBADF; return (1); } dev = tp->t_dev; /* * If the ioctl involves modification, * insist on being able to write the device, * and hang if in the background. */ switch(com) { case TIOCSETD: case TIOCSETP: case TIOCSETN: case TIOCFLUSH: case TIOCSETC: case TIOCSLTC: case TIOCSPGRP: case TIOCLBIS: case TIOCLBIC: case TIOCLSET: case TIOCSTI: /* this is reasonable, but impractical... if ((flag & FWRITE) == 0) { u.u_error = EBADF; return (1); } */ while (tp->t_line == NTTYDISC && u.u_procp->p_pgrp != tp->t_pgrp && tp == u.u_ttyp && (u.u_procp->p_flag&SVFORK) == 0 && u.u_signal[SIGTTOU] != SIG_IGN && u.u_signal[SIGTTOU] != SIG_HOLD && (u.u_procp->p_flag&SDETACH)==0) { gsignal(u.u_procp->p_pgrp, SIGTTOU); sleep((caddr_t)&lbolt, TTOPRI); } break; } /* * Process the ioctl. */ switch(com) { /* * Get discipline number */ case TIOCGETD: t = tp->t_line; if (copyout((caddr_t)&t, addr, sizeof(t))) u.u_error = EFAULT; break; /* * Set line discipline */ case TIOCSETD: if (copyin(addr, (caddr_t)&t, sizeof(t))) { u.u_error = EFAULT; break; } if (t >= nldisp) { u.u_error = ENXIO; break; } (void) spl5(); if (tp->t_line) (*linesw[tp->t_line].l_close)(tp); if (t) (*linesw[t].l_open)(dev, tp, addr); if (u.u_error==0) tp->t_line = t; (void) spl0(); break; /* * Prevent more opens on channel */ case TIOCEXCL: tp->t_state |= XCLUDE; break; case TIOCNXCL: tp->t_state &= ~XCLUDE; break; /* * Set new parameters */ case TIOCSETP: case TIOCSETN: if (copyin(addr, (caddr_t)&iocb, sizeof(iocb))) { u.u_error = EFAULT; return(1); } (void) spl5(); if (tp->t_line == 0) { if (com == TIOCSETP) wflushtty(tp); while (canon(tp)>=0) ; #ifdef notdef wakeup((caddr_t)&tp->t_rawq); #endif } else if (tp->t_line == NTTYDISC) { if (tp->t_flags&RAW || iocb.sg_flags&RAW || com(( == TIOCSETP) wflushtty(tp); else if ((tp->t_flags&CBREAK) != (iocb.sg_flags&CBREAK)) { if (iocb.sg_flags & CBREAK) { catq(&tp->t_rawq, &tp->t_canq); tq = tp->t_rawq; tp->t_rawq = tp->t_canq; tp->t_canq = tq; } else { tp->t_local |= LPENDIN; if (tp->t_canq.c_cc) panic("ioccom canq"); #ifdef notdef if (tp->t_chan) (void) sdata(tp->t_chan); else #endif wakeup((caddr_t)&tp->t_rawq); } } } if ((tp->t_state&SPEEDS)==0) { tp->t_ispeed = iocb.sg_ispeed; tp->t_ospeed = iocb.sg_ospeed; } tp->t_erase = iocb.sg_erase; tp->t_kill = iocb.sg_kill; tp->t_flags = iocb.sg_flags; if (tp->t_flags & RAW) { tp->t_state &= ~TTSTOP; ttstart(tp); } (void) spl0(); break; /* * Send current parameters to user */ case TIOCGETP: iocb.sg_ispeed = tp->t_ispeed; iocb.sg_ospeed = tp->t_ospeed; iocb.sg_erase = tp->t_erase; iocb.sg_kill = tp->t_kill; iocb.sg_flags = tp->t_flags; if (copyout((caddr_t)&iocb, addr, sizeof(iocb))) u.u_error = EFAULT; break; /* * Hang up line on last close */ case TIOCHPCL: tp->t_state |= HUPCLS; break; case TIOCFLUSH: { int flags; if (addr == 0) flags = FREAD|FWRITE; else if (copyin(addr, (caddr_t)&flags, sizeof (flags))) { u.u_error = EFAULT; return(1); } flushtty(tp, flags); break; } /* * Set and fetch special characters */ case TIOCSETC: if (copyin(addr, (caddr_t)&tun, sizeof(struct tchars))) u.u_error = EFAULT; break; case TIOCGETC: if (copyout((caddr_t)&tun, addr, sizeof(struct tchars))) u.u_error = EFAULT; break; /* local ioctls */ /* * Set/get local special characters. */ case TIOCSLTC: if (copyin(addr, (caddr_t)&tlun, sizeof (struct ltchars))) u.u_error = EFAULT; break; case TIOCGLTC: if (copyout((caddr_t)&tlun, addr, sizeof (struct ltchars))) u.u_error = EFAULT; break; /* * Return number of characters immediately available. */ case FIONREAD: { off_t nread; switch (tp->t_line) { case NETLDISC: nread = tp->t_rec ? tp->t_inbuf : 0; break; case 0: (void) spl5(); while (canon(tp)>=0) ; (void) spl0(); /* fall into ... */ case NTTYDISC: if (tp->t_local & LPENDIN) ntypend(tp); nread = tp->t_canq.c_cc; if (tp->t_flags & (RAW|CBREAK)) nread += tp->t_rawq.c_cc; break; } if (copyout((caddr_t)&nread, addr, sizeof (off_t))) u.u_error = EFAULT; break; } /* * Should allow SPGRP and GPGRP only if tty open for reading. */ case TIOCSPGRP: if (copyin(addr, (caddr_t)&tp->t_pgrp, sizeof (tp->t_pgrp))) u.u_error = EFAULT; break; case TIOCGPGRP: if (copyout((caddr_t)&tp->t_pgrp, addr, sizeof(tp->t_pgrp))) u.u_error = EFAULT; break; /* * Modify local mode word. */ case TIOCLBIS: if (copyin(addr, (caddr_t)&temp, sizeof (tp->t_local))) u.u_error = EFAULT; else tp->t_local |= temp; break; case TIOCLBIC: if (copyin(addr, (caddr_t)&temp, sizeof (tp->t_local))) u.u_error = EFAULT; else tp->t_local &= ~temp; break; case TIOCLSET: if (copyin(addr, (caddr_t)&temp, sizeof (tp->t_local))) u.u_error = EFAULT; else tp->t_local = temp; break; case TIOCLGET: if (copyout((caddr_t)&tp->t_local, addr, sizeof(tp->t_local))) u.u_error = EFAULT; break; /* * Return number of characters in * the output. */ case TIOCOUTQ: if (copyout((caddr_t)&tp->t_outq.c_cc, addr, sizeof(tp->t_outq.c_cc))) u.u_error = EFAULT; break; /* * Simulate typing of a character at the terminal. */ case TIOCSTI: c = fubyte(addr); if (u.u_uid && u.u_ttyp != tp || c < 0) u.u_error = EFAULT; else (*linesw[tp->t_line].l_rint)(c, tp); break; /* end of locals */ default: return(0); } return(1); } @ikcP$;58;>ADGJMPS6&iJSP6i /* mx2.c 4.7 81/09/11 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/tty.h" #include "../h/inode.h" #include "../h/mx.h" #include "../h/file.h" #include "../h/conf.h" #include "../h/buf.h" /* * multiplexor driver */ struct chan chans[NCHANS]; struct group *groups[NGROUPS]; int mpxline; short cmask[16] ={ 01, 02, 04, 010, 020, 040, 0100, 0200, 0400, 01000, 02000, 04000, 010000, 020000, 040000, 0100000 }; #define IOMOVE iomove struct chan *xcp(),*addch(),*nextcp(); #define HIQ 100 #define LOQ 20 #define FP ((struct file *)cp) char mcdebugs[NDEBUGS]; struct group * getmpx(dev) dev_t dev; { register d; d = minor(dev); if (d >= NGROUPS) { u.u_error = ENXIO; return(NULL); } return(groups[d]); } /*ARGSUSED*/ mxopen(dev, flag) { register struct group *gp; register struct file *fp; register struct chan *cp; int msg; if ((gp=getmpx(dev)) == NULL) { return; } if (!(gp->g_state&INUSE)) { u.u_error = ENXIO; return; } fp = u.u_ofile[u.u_r.r_val1]; if (fp->f_inode != gp->g_inode) { u.u_error = ENXIO; return; } if ((cp=addch(gp->g_inode,0)) == NULL) { u.u_error = ENXIO; return; } cp->c_flags = XGRP; cp->c_ottyp = cp->c_ttyp = (struct tty *)cp; cp->c_line = cp->c_oline = mpxline; fp->f_flag |= FMPY; fp->f_flag |= FREAD+FWRITE; fp->f_un.f_chan = cp; if (gp->g_inode == mpxip) { plock(mpxip); mpxname(cp); msg = M_OPEN; } else msg = M_WATCH; scontrol(cp, msg+(cp->c_index<<8), u.u_uid); sleep((caddr_t)cp,TTIPRI); if (cp->c_flags&NMBUF) prele(mpxip); if (cp->c_flags & WCLOSE) { chdrain(cp); chfree(cp); u.u_error = ENXIO; return; } cp->c_fy = fp; cp->c_pgrp = u.u_procp->p_pgrp; } char mxnmbuf[NMSIZE]; int nmsize; mpxname(cp) register struct chan *cp; { register char *np; register c; np = mxnmbuf; u.u_dirp = (caddr_t)u.u_arg[0]; while (np < &mxnmbuf[NMSIZE]) { c = uchar(); if (c <= 0) break; *np++ = c; } *np++ = '\0'; nmsize = np - mxnmbuf; cp->c_flags |= NMBUF; } mxclose(dev, flag, fp) dev_t dev; register struct file *fp; { register struct chan *cp = fp->f_un.f_chan; register struct group *gp; register struct inode *ip; int i, fmp; fmp = flag&FMP; if ((gp=getmpx(dev)) == NULL) return; ip = gp->g_inode; if (ip==NULL || (ip->i_mode&IFMT)!=IFMPC) { return; } /* * close a channel */ if (cp!=NULL && fmp && fmp!=FMP) { for(fp=file; fp< fileNFILE; fp++) if(fp->f_count && fp->f_flag&FMP && fp->f_un.f_chan==cp){ return; } chdrain(cp); if ((cp->c_flags&WCLOSE)==0) { scontrol(cp, M_CLOSE, 0); cp->c_flags |= WCLOSE; } else { chfree(cp); } goto out; } for(fp=file; fp < fileNFILE; fp++) { if (fp->f_count && (fp->f_flag&FMP)==FMP && fp->f_inode==ip) return; } if (ip == mpxip) { mpxip = NULL; prele(ip); } for(i=0;ig_chans[i]); out: plock(ip); if (ip->i_count == 1) { groups[minor(dev)] = NULL; zero((caddr_t)gp, sizeof (struct group)); ip->i_mode = IFREG + 0666; ip->i_un.i_rdev = 0; ip->i_flag |= IUPD|ICHG; iput(ip); return; } prele(ip); } zero(s, cc) register char *s; register cc; { while (cc--) *s++ = 0; } char m_eot[] ={ M_EOT, 0, 0, 0}; /* * Mxread + mxwrite are entered from cdevsw * for all read/write calls. Operations on * an mpx file are handled here. * Calls are made through linesw to handle actual * data movement. */ mxread(dev) { register struct group *gp; register struct chan *cp; register esc; struct rh h; caddr_t base; unsigned count; int s, xfr, more, fmp; if ((gp=getmpx(dev))==NULL || (FP=getf(u.u_arg[0]))==NULL) { u.u_error = ENXIO; return; } fmp = FP->f_flag & FMP; if (fmp != FMP) { if (u.u_count == 0) return; msread(fmp, FP->f_un.f_chan); return; } if ((int)u.u_base & 1) { u.u_error = ENXIO; return; } s = spl6(); if (u.u_count == 0) { if (gp->g_datq == 0) u.u_error = ENXIO; splx(s); return; } while (gp->g_datq == 0) { sleep((caddr_t)&gp->g_datq, TTIPRI); } splx(s); while (gp->g_datq && u.u_count >= CNTLSIZ + 2) { esc = 0; cp = nextcp(gp); if (cp==NULL) { continue; } h.index = cpx(cp); if (count = cp->c_ctlx.c_cc) { count += CNTLSIZ; if (cp->c_flags&NMBUF) count += nmsize; if (count > u.u_count) { (void) sdata(cp); return; } esc++; } base = u.u_base; count = u.u_count; u.u_base += sizeof h; u.u_count -= sizeof h; xfr = u.u_count; if (esc) { more = mcread(cp); } else { more = (*linesw[cp->c_line].l_read)(cp->c_ttyp); } if (more > 0) (void) sdata(cp); if (more < 0) scontrol(cp, M_CLOSE, 0); (void) spl0(); if (xfr == u.u_count) { esc++; IOMOVE((caddr_t)m_eot, sizeof m_eot, B_READ); } xfr -= u.u_count; if (esc) { h.count = 0; h.ccount = xfr; } else { h.count = xfr; h.ccount = 0; mxrstrt(cp, &cp->cx.datq, BLOCK|ALT); } if (u.u_count && (xfr&1)) { u.u_base++; u.u_count--; } (void) copyout((caddr_t)&h, base, sizeof h); } } mxwrite(dev) { regist((er struct chan *cp; struct wh h; struct group *gp; int ucount, esc, fmp, burpcount; caddr_t ubase, hbase; if ((gp=getmpx(dev))==NULL || (FP=getf(u.u_arg[0]))==NULL) { return; } fmp = FP->f_flag & FMP; if (fmp != FMP) { mswrite(fmp, FP->f_un.f_chan); return; } burpcount = 0; while (u.u_count >= sizeof h) { hbase = u.u_base; IOMOVE((caddr_t)&h, sizeof h, B_WRITE); if (u.u_error) return; esc = 0; if (h.count==0) { esc++; h.count = h.ccount; } cp = xcp(gp, h.index); if (cp==NULL || cp->c_flags&ISGRP) { u.u_error = ENXIO; return; } ucount = u.u_count; ubase = u.u_base; u.u_count = h.count; u.u_base = h.data; if (esc==0) { struct tty *tp; caddr_t waddr; int line; if (cp->c_flags&PORT) { line = cp->c_line; tp = cp->c_ttyp; } else { line = cp->c_oline; tp = cp->c_ottyp; } loop: waddr = (caddr_t)(*linesw[line].l_write)(tp); if (u.u_count) { if (gp->g_state&ENAMSG) { burpcount++; cp->c_flags |= BLKMSG; /* scontrol(cp, M_BLK, u.u_count); */ h.ccount = -1; h.count = u.u_count; h.data = u.u_base; (void) copyout((caddr_t)&h, hbase, sizeof h); } else { if(waddr == 0) { u.u_error = ENXIO; return; } sleep(waddr, TTOPRI); goto loop; } } } else { mxwcontrol(cp); } u.u_count = ucount; u.u_base = ubase; } u.u_count = burpcount; } /* * Mcread and mcwrite move data on an mpx file. * Transfer addr and length is controlled by mxread/mxwrite. * Kernel-to-Kernel and other special transfers are not * yet in. */ mcread(cp) register struct chan *cp; { register struct clist *q; register char *np; q = (cp->c_ctlx.c_cc) ? &cp->c_ctlx : &cp->cx.datq; (void) mxmove(q, B_READ); if (cp->c_flags&NMBUF && q == &cp->c_ctlx) { np = mxnmbuf; while (nmsize--) (void) passc(*np++); cp->c_flags &= ~NMBUF; prele(mpxip); } if (cp->c_flags&PORT) return(cp->c_ctlx.c_cc + cp->c_ttyp->t_rawq.c_cc); else return(cp->c_ctlx.c_cc + cp->cx.datq.c_cc); } caddr_t mcwrite(cp) register struct chan *cp; { register struct clist *q; int s; q = &cp->cy.datq; while (u.u_count) { s = spl6(); if (q->c_cc > HIQ || (cp->c_flags&EOTMARK)) { cp->c_flags |= SIGBLK; splx(s); break; } splx(s); (void) mxmove(q, B_WRITE); } wakeup((caddr_t)q); return((caddr_t)q); } /* * Msread and mswrite move bytes * between user and non-multiplexed channel. */ msread(fmp, cp) register struct chan *cp; { register struct clist *q; int s; q = (fmp&FMPX) ? &cp->cx.datq : &cp->cy.datq; s = spl6(); while (q->c_cc == 0) { if (cp->c_flags&WCLOSE) { u.u_error = ENXIO; goto out; } if (cp->c_flags & EOTMARK) { cp->c_flags &= ~EOTMARK; if(msgenab(cp)) scontrol(cp, M_UBLK, 0); else { wakeup((caddr_t)cp); wakeup((caddr_t)q); } goto out; } sleep((caddr_t)q,TTIPRI); } if (cp->c_flags&WCLOSE) { u.u_error = ENXIO; goto out; } splx(s); while (mxmove(q, B_READ) > 0) ; mxrstrt(cp, q, SIGBLK); return; out: splx(s); } mswrite(fmp, cp) register struct chan *cp; { register struct clist *q; register int cc; q = (fmp&FMPX) ? &cp->cy.datq : &cp->cx.datq; while (u.u_count) { (void) spl6(); if (cp->c_flags&WCLOSE) { gsignal(cp->c_pgrp, SIGPIPE); (void) spl0(); return; } if (q->c_cc>= HIQ || cp->c_flags&FBLOCK) { if (cp->c_flags&WCLOSE) { gsignal(cp->c_pgrp, SIGPIPE); (void) spl0(); return; } (void) sdata(cp); cp->c_flags |= BLOCK; sleep((caddr_t)q+1,TTOPRI); (void) spl0(); continue; } (void) spl0(); cc = mxmove(q, B_WRITE); if (cc < 0) break; } if (fmp&FMPX) { if (cp->c_flags&YGRP) (void) sdata(cp); else wakeup((caddr_t)q); } else { if (cp->c_flags&XGRP) (void) sdata(cp); else wakeup((caddr_t)q); } } /* * move chars between clist and user space. */ mxmove(q, dir) register struct clist *q; register dir; { register cc; char cbuf[HIQ]; cc = MIN(u.u_count, sizeof cbuf); if (dir == B_READ) cc = q_to_b(q, cbuf, cc); if (cc <= 0) return(cc); IOMOVE((caddr_t)cbuf, (unsigned)cc, dir); if (dir == B_WRITE) cc = b_to_q(cbuf, cc, q); return(cc); } mxrstrt(cp, q, b) register struct chan *cp; register struct clist *q; register b; { int s; s = spl6(); if (cp->c_flags&b && q->c_ccc_flags &= ~b; if (b&ALT) wakeup((caddr_t)q+1); else if (b&(BLKMSG)) scontrol(cp, M_UBLK, 0); else wakeup((caddr_t)q); } if (cp->c_flags&WFLUSH) wakeup((caddr_t)q+2); splx(s); } /* * called from driver start or xint routines * to wakeup output sleeper. */ mcstart(cp, q) register struct chan *cp; register caddr_t q; { if (cp->c_flags&(BLKMSG)) { cp->c_flags &= ~BLKMSG; scontrol(cp, M_UBLK, 0); } else wakeup((caddr_t)q); } mxwcontrol(cp) register struct chan *cp; { short cmd; struct sgttyb vec; int s; IOMOVE((caddr_t)&cmd, sizeof cmd, B_WRITE); if (u.u_error) return; switch(cmd) { /* * not ready to queue this up yet. */ case M_EOT: s = spl6(); while (cp->c_flags & EOTMARK) if(msge@i%kaR$;58;>ADGJMPS6&iJSP6inab(cp)){ scontrol(cp, M_BLK, 0); goto out; } else sleep((caddr_t)cp, TTOPRI); cp->c_flags |= EOTMARK; out: wakeup((caddr_t)&cp->cy.datq); splx(s); break; case M_IOCTL: break; case M_IOANS: if (cp->c_flags&SIOCTL) { IOMOVE((caddr_t)&vec, sizeof vec, B_WRITE); (void) b_to_q((caddr_t)&vec, sizeof vec, &cp->c_ctly); cp->c_flags &= ~SIOCTL; wakeup((caddr_t)cp); } break; case M_BLK: cp->c_flags |= FBLOCK; break; case M_UBLK: cp->c_flags &= ~FBLOCK; chwake(cp); break; default: u.u_error = ENXIO; } } /*ARGSUSED*/ mxioctl(dev, cmd, addr, flag) caddr_t addr; { struct group *gp; int fmp; struct file *fp; struct { short c_ctl; short c_cmd; struct sgttyb c_vec; } ctlbuf; if ((gp=getmpx(dev))==NULL || (fp=getf(u.u_arg[0]))==NULL) { return; } fmp = fp->f_flag & FMP; if (fmp == FMP) { switch(cmd) { case MXLSTN: if (mpxip == NULL) { mpxip = gp->g_inode; } else { u.u_error = ENXIO; return; } break; case MXNBLK: gp->g_state |= ENAMSG; break; default: u.u_error = ENXIO; return; } } else { ctlbuf.c_ctl = M_IOCTL; ctlbuf.c_cmd = cmd; (void) copyin(addr, (caddr_t)&ctlbuf.c_vec, sizeof (struct sgttyb)); sioctl(fp->f_un.f_chan, (char *)&ctlbuf, sizeof ctlbuf); (void) copyout((caddr_t)&ctlbuf, addr, sizeof (struct sgttyb)); } } chdrain(cp) register struct chan *cp; { register struct tty *tp; int wflag; chwake(cp); wflag = (cp->c_flags&WCLOSE)==0; tp = cp->c_ttyp; if (tp == NULL) /* prob not required */ return; if (cp->c_flags&PORT && tp->t_chan == cp) { cp->c_ttyp = NULL; tp->t_chan = NULL; return; } if (wflag) wflush(cp,&cp->cx.datq); else flush(&cp->cx.datq); if (!(cp->c_flags&YGRP)) { flush(&cp->cy.datq); } } chwake(cp) register struct chan *cp; { register char *p; wakeup((caddr_t)cp); flush(&cp->c_ctlx); p = (char *)&cp->cx.datq; wakeup((caddr_t)p); wakeup((caddr_t)++p); wakeup((caddr_t)++p); p = (char *)&cp->cy.datq; wakeup((caddr_t)p); wakeup((caddr_t)++p); wakeup((caddr_t)++p); } chfree(cp) register struct chan *cp; { register struct group *gp; register i; gp = cp->c_group; if (gp==NULL) return; i = cp->c_index; if (cp == gp->g_chans[i]) { gp->g_chans[i] = NULL; } cp->c_group = NULL; wakeup((caddr_t)gp); } flush(q) register struct clist *q; { while(q->c_cc) (void) getc(q); } wflush(cp,q) register struct chan *cp; register struct clist *q; { register s; s = spl6(); if(q->c_cc && (cp->c_flags&WCLOSE) == 0) { cp->c_flags |= WFLUSH; (void) sdata(cp); (void) tsleep((caddr_t)q+2, TTOPRI, 30); } flush(q); cp->c_flags &= ~WFLUSH; splx(s); } scontrol(cp,event,value) register struct chan *cp; short event,value; { register struct clist *q; int s; q = &cp->c_ctlx; s = spl6(); if (sdata(cp) == NULL) return; (void) putw(event,q); (void) putw(value,q); splx(s); } sioctl(cp, vec, cc) register struct chan *cp; char *vec; { register s; register struct clist *q; s = spl6(); q = &cp->cx.datq; while (q->c_cc) { cp->c_flags |= BLOCK; if (sdata(cp)==NULL) { u.u_error = ENXIO; return; } sleep((caddr_t)q+1, TTOPRI); } (void) b_to_q(vec, cc, &cp->c_ctlx); cp->c_flags |= SIOCTL; while (cp->c_flags&SIOCTL) { if (cp->c_ctlx.c_cc) if (sdata(cp)==NULL) { u.u_error = ENXIO; return; } sleep((caddr_t)cp, TTOPRI); } (void) q_to_b(&cp->c_ctly, vec, cp->c_ctly.c_cc); splx(s); } sdata(cp) struct chan *cp; { register struct group *gp = (struct group *)cp; register struct group *ngp; register int s; ngp = gp->g_group; if (ngp==NULL || (ngp->g_state&ISGRP)==0) return(NULL); s = spl6(); do { ngp->g_datq |= cmask[gp->g_index]; wakeup((caddr_t)&ngp->g_datq); gp = ngp; } while(ngp=ngp->g_group); splx(s); return((int)gp); } struct chan * xcp(gp, x) register struct group *gp; register short x; { register int i; while (gp->g_group) gp=gp->g_group; for (i=0;i= NINDEX) break; if (gp==NULL || (gp->g_state&ISGRP)==0) return((struct chan *)NULL); gp = (struct ((group *)gp->g_chans[x&017]; x >>= 4; } return((struct chan *)gp); } cpx(cp) register struct chan *cp; { register x; register struct group *gp; x = (-1<<4) + cp->c_index; gp = cp->c_group; while (gp->g_group) { x <<= 4; x |= gp->g_index; gp = gp->g_group; } return(x); } struct chan * nextcp(gp) register struct group *gp; { register struct group *lgp, *ngp; do { while ((gp->g_datq & cmask[gp->g_rot]) == 0) { gp->g_rot = (gp->g_rot+1)%NINDEX; } lgp = gp; gp = (struct group *)gp->g_chans[gp->g_rot]; } while (gp!=NULL && gp->g_state&ISGRP); lgp->g_datq &= ~cmask[lgp->g_rot]; lgp->g_rot = (lgp->g_rot+1)%NINDEX; while (ngp=lgp->g_group) { ngp->g_datq &= ~cmask[lgp->g_index]; if (ngp->g_datq) break; lgp = ngp; } return((struct chan *)gp); } msgenab(cp) register struct chan *cp; { register struct group *gp; for(gp=cp->c_group;gp;gp=gp->g_group) if(gp->g_state & ENAMSG)return(1); return(0); } @i+ k?$' #&),/25&iW/6i /* mx1.c 4.6 81/03/11 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/reg.h" #include "../h/proc.h" #include "../h/tty.h" #include "../h/inode.h" #include "../h/mx.h" #include "../h/file.h" #include "../h/conf.h" /* * Multiplexor: clist version * * installation: * requires a line in cdevsw - * mxopen, mxclose, mxread, mxwrite, mxioctl, 0, * * also requires a line in linesw - * mxopen, mxclose, mcread, mcwrite, mxioctl, nulldev, nulldev, * * The linesw entry for mpx should be the last one in the table. * 'nldisp' (number of line disciplines) should not include the * mpx line. This is to prevent mpx from being enabled by an ioctl. */ struct chan chans[NCHANS]; struct schan schans[NPORTS]; struct group *groups[NGROUPS]; int mpxline; struct chan *xcp(); dev_t mpxdev = -1; char mcdebugs[NDEBUGS]; /* * Allocate a channel, set c_index to index. */ struct chan * challoc(index, isport) { register s,i; register struct chan *cp; s = spl6(); for(i=0;i<((isport)?NPORTS:NCHANS);i++) { cp = (isport)? (struct chan *)(schans+i): chans+i; if(cp->c_group == NULL) { cp->c_index = index; cp->c_pgrp = 0; cp->c_flags = 0; splx(s); return(cp); } } splx(s); return(NULL); } /* * Allocate a group table cell. */ gpalloc() { register i; for (i=NGROUPS-1; i>=0; i--) if (groups[i]==NULL) { groups[i]++; return(i); } u.u_error = ENXIO; return(i); } /* * Add a channel to the group in * inode ip. */ struct chan * addch(ip, isport) struct inode *ip; { register struct chan *cp; register struct group *gp; register i; plock(ip); gp = &ip->i_un.i_group; for(i=0;ig_chans[i]; if (cp == NULL) { if ((cp=challoc(i, isport)) != NULL) { gp->g_chans[i] = cp; cp->c_group = gp; } break; } cp = NULL; } prele(ip); return(cp); } /* * Mpxchan system call. */ mpxchan() { extern mxopen(), mcread(), sdata(), scontrol(); struct inode *ip, *gip; struct tty *tp; struct file *fp, *chfp, *gfp; struct chan *cp; struct group *gp, *ngp; struct mx_args vec; struct a { int cmd; int *argvec; } *uap; dev_t dev; register int i; /* * Common setup code. */ uap = (struct a *)u.u_ap; (void) copyin((caddr_t)uap->argvec, (caddr_t)&vec, sizeof vec); gp = NULL; gfp = NULL; cp = NULL; switch(uap->cmd) { case NPGRP: if (vec.m_arg[1] < 0) break; case CHAN: case JOIN: case EXTR: case ATTACH: case DETACH: case CSIG: gfp = getf(vec.m_arg[1]); if (gfp==NULL) return; gip = gfp->f_inode; gp = &gip->i_un.i_group; if (gp->g_inode != gip) { u.u_error = ENXIO; return; } } switch(uap->cmd) { /* * Create an MPX file. */ case MPX: case MPXN: if (mpxdev < 0) { for (i=0; linesw[i].l_open; i++) { if (linesw[i].l_read==mcread) { mpxline = i; for (i=0; cdevsw[i].d_open; i++) { if (cdevsw[i].d_open==mxopen) { mpxdev = (dev_t)(i<<8); } } } } if (mpxdev < 0) { u.u_error = ENXIO; return; } } if (uap->cmd==MPXN) { if ((ip=ialloc(pipedev))==NULL) return; ip->i_mode = ((vec.m_arg[1]&0777)+IFMPC) & ~u.u_cmask; ip->i_flag = IACC|IUPD|ICHG; } else { u.u_dirp = vec.m_name; ip = namei(uchar,1); if (ip != NULL) { i = ip->i_mode&IFMT; u.u_error = EEXIST; if (i==IFMPC || i==IFMPB) { i = minor(ip->i_un.i_rdev); gp = groups[i]; if (gp && gp->g_inode==ip) u.u_error = EBUSY; } iput(ip); return; } if (u.u_error) return; ip = maknode((vec.m_arg[1]&0777)+IFMPC); if (ip == NULL) return; } if ((i=gpalloc()) < 0) { iput(ip); return; } if ((fp=falloc()) == NULL) { iput(ip); groups[i] = NULL; return; } ip->i_un.i_rdev = (daddr_t)(mpxdev+i); ip->i_count++; prele(ip); gp = &ip->i_un.i_group; groups[i] = gp; gp->g_inode = ip; gp->g_state = INUSE|ISGRP; gp->g_group = NULL; gp->g_file = fp; gp->g_index = 0; gp->g_rotmask = 1; gp->g_rot = 0; gp->g_datq = 0; for(i=0;ig_chans[i++] = NULL; fp->f_flag = FREAD|FWRITE|FMP; fp->f_inode = ip; fp->f_un.f_chan = NULL; return; /* * join file descriptor (arg 0) to group (arg 1) * return channel number */ case JOIN: if ((fp=getf(vec.m_arg[0]))==NULL) return; ip = fp->f_inode; switch (ip->i_mode & IFMT) { case IFMPC: if ((fp->f_flag&FMP) != FMP) { u.u_error = ENXIO; return; } ngp = &ip->i_un.i_group; if (mtree(ngp, gp) == NULL) return; fp->f_count++; u.u_r.r_val1 = cpx((struct chan *)ngp); return; case IFCHR: dev = (dev_t)ip->i_un.i_rdev; tp = cdevsw[major(dev)].d_ttys; if (tp==NULL) { u.u_error = ENXIO; return; } tp = &tp[minor(dev)]; if (tp->t_chan) { u.u_error = ENXIO; return; } if ((cp=addch(gip, 1))==NULL) { u.u_error = ENXIO; return; } tp->t_chan = cp; cp->c_fy = fp; fp->f_count++; cp->c_ttyp = tp; cp->c_line = tp->t_line; cp->c_flags = XGRP+PORT; u.u_r.r_val1 = cpx(cp); return; default: u.u_error = ENXIO; return; } /* * Attach channel (arg 0) to group (arg 1). */ case ATTACH: cp = xcp(gp, vec.m_arg[0]); if (cp==NULL || cp->c_flags&ISGRP) { u.u_error = ENXIO; return; } u.u_r.r_val1 = cpx(cp); wakeup((caddr_t)cp); return; case DETACH: cp = xcp(gp, vec.m_arg[0]); if (cp==NULL) { u.u_error = ENXIO; return; } (void) detach(cp); return; /* * Extract channel (arg 0) from group (arg 1). */ case EXTR: cp = xcp(gp, vec.m_arg[0]); if (cp==NULL) { u.u_error = ENXIO; return; } if (cp->c_flags & ISGRP) { (void) mxfalloc(((struct group *)cp)->g_file); return; } if ((fp=cp->c_fy) != NULL) { (void) mxfalloc(fp); return; } if ((fp=falloc()) == NULL) return; fp->f_inode = gip; gip->i_count++; fp->f_un.f_chan = cp; fp->f_flag = (vec.m_arg[2]) ? (FREAD|FWRITE|FMPY) : (FREAD|FWRITE|FMPX); cp->c_fy = fp; return; /* * Make new chan on group (arg 1). */ case CHAN: if((gfp->f_flag&FMP)==FMP)cp = addch(gip, 0); if(cp == NULL){ u.u_error = ENXIO; return; } cp->c_flags = XGRP; cp->c_fy = NULL; cp->c_ttyp = cp->c_ottyp = (struct tty *)cp; cp->c_line = cp->c_oline = mpxline; u.u_r.r_val1 = cpx(cp); return; /* * Connect fd (arg 0) to channel fd (arg 1). * (arg 2 < 0) => fd to chan only * (arg 2 > 0) => chan to fd only * (arg 2 == 0) => both directions */ case CONNECT: if ((fp=getf(vec.m_arg[0]))==NULL) return; if ((chfp=getf(vec.m_arg[1]))==NULL) return; ip = fp->f_inode; i = ip->i_mode&IFMT; if (i!=IFCHR) { u.u_error = ENXIO; return; } dev = (dev_t)ip->i_un.i_rdev; tp = cdevsw[major(dev)].d_ttys; if (tp==NULL) { u.u_error = ENXIO; return; } tp = &tp[minor(dev)]; if (!(chfp->f_flag&FMPY)) { u.u_error = ENXIO; return; } cp = chfp->f_un.f_chan; if (cp==NULL || cp->c_flags&PORT) { u.u_error = ENXIO; return; } i = vec.m_arg[2]; if (i>=0) { cp->c_ottyp = tp; cp->c_oline = tp->t_line; } if (i<=0) { tp->t_chan = cp; cp->c_ttyp = tp; cp->c_line = tp->t_line; } u.u_r.r_val1 = 0; return; case NPGRP: { register struct proc *pp; if (gp != NULL) { cp = xcp(gp, vec.m_arg[0]); if (cp==NULL) { u.u_error = ENXIO; return; } } pp = u.u_procp; pp->p_pgrp = pp->p_pid; if (vec.m_arg[2]) pp->p_pgrp = vec.m_arg[2]; if (gp != NULL) cp->c_pgrp = pp->p_pgrp; u.u_r.r_val1 = pp->p_pgrp; return; } case CSIG: cp = xcp(gp, vec.m_arg[0]); if (cp==NULL) { u.u_error = ENXIO; return; } gsignal(cp->c_pgrp, vec.m_arg[2]); u.u_r.r_val1 = vec.m_arg[2]; return; case DEBUG: i = vec.m_arg[0]; if (i<0 || i>NDEBUGS) return; mcdebugs[i] = vec.m_arg[1]; if (i==ALL) for(i=0;ic_flags&ISGRP) {(( sub = (struct group *)cp; master = sub->g_group; index = sub->g_index; closef(sub->g_file); if (master != NULL) master->g_chans[index] = NULL; return(0); } else if (cp->c_flags&PORT && cp->c_ttyp != NULL) { closef(cp->c_fy); chdrain(cp); chfree(cp); return(0); } if (cp->c_flags & WCLOSE) { if (cp->c_fy) { if (cp->c_fy->f_count) return(1); chdrain(cp); chfree(cp); return(0); } } cp->c_flags |= WCLOSE; chwake(cp); return(1); } mxfalloc(fp) register struct file *fp; { register i; if (fp==NULL) { u.u_error = ENXIO; return(-1); } i = ufalloc(); if (i < 0) return(i); u.u_ofile[i] = fp; fp->f_count++; u.u_r.r_val1 = i; return(i); } /* * Grow a branch on a tree. */ mtree(sub,master) register struct group *sub, *master; { register i; int mtresiz, stresiz; if ((mtresiz=mup(master,sub)) == NULL) { u.u_error = ENXIO; return(NULL); } if ((stresiz=mdown(sub,master)) <= 0) { u.u_error = ENXIO; return(NULL); } if (sub->g_group != NULL) { u.u_error = ENXIO; return(NULL); } if (stresiz+mtresiz > NLEVELS) { u.u_error = ENXIO; return(NULL); } for (i=0;ig_chans[i] != NULL) continue; master->g_chans[i] = (struct chan *)sub; sub->g_group = master; sub->g_index = i; return(1); } u.u_error = ENXIO; return(NULL); } mup(master,sub) struct group *master, *sub; { register struct group *top; register int depth; depth = 1; top = master; while (top->g_group) { depth++; top = top->g_group; } if(top == sub) return(NULL); return(depth); } mdown(sub,master) struct group *sub, *master; { register int maxdepth, i, depth; if(sub == (struct group *)NULL || (sub->g_state&ISGRP) == 0) return(0); if(sub == master) return(-1); maxdepth = 0; for(i=0; ig_chans[i],master)) == -1) return(-1); maxdepth = (depth>maxdepth) ? depth: maxdepth; } return(maxdepth+1); } @i6 kd$Z 5&iW/6i /* mem.c 4.3 81/03/08 */ /* * Memory special file * minor device 0 is physical memory * minor device 1 is kernel memory * minor device 2 is EOF/RATHOLE * minor device 3 is unibus memory (addressed by shorts) */ #include "../h/param.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/conf.h" #include "../h/buf.h" #include "../h/systm.h" #include "../h/pte.h" #include "../h/mtpr.h" #include "../h/vm.h" #include "../h/cmap.h" mmread(dev) { register int o; register unsigned c, v; switch (minor(dev)) { case 0: while (u.u_count != 0 && u.u_error == 0) { if (fubyte(u.u_base) == -1) goto fault; v = btop(u.u_offset); if (v >= physmem) goto fault; *(int *)mmap = v | (PG_V | PG_KR); mtpr(TBIS, vmmap); o = (int)u.u_offset & PGOFSET; c = min((unsigned)(NBPG - o), u.u_count); c = min(c, (unsigned)(NBPG - ((int)u.u_base&PGOFSET))); if (copyout((caddr_t)&vmmap[o], u.u_base, c)) goto fault; u.u_count -= c; u.u_base += c; u.u_offset += c; } return; case 1: if ((caddr_t)u.u_offset < (caddr_t)&umbabeg && (caddr_t)u.u_offset + u.u_count >= (caddr_t)&umbabeg) goto fault; if ((caddr_t)u.u_offset >= (caddr_t)&umbabeg && (caddr_t)u.u_offset < (caddr_t)&umbaend) goto fault; if (!kernacc((caddr_t)u.u_offset, u.u_count, B_READ)) goto fault; if (copyout((caddr_t)u.u_offset, u.u_base, u.u_count)) goto fault; c = u.u_count; u.u_count = 0; u.u_base += c; u.u_offset += c; return; case 2: return; case 3: if (!kernacc((caddr_t)u.u_offset, u.u_count, B_READ)) goto fault; if (!useracc(u.u_base, u.u_count, B_WRITE)) goto fault; UNIcpy((caddr_t)u.u_offset, u.u_base, u.u_count, B_READ); c = u.u_count; u.u_count = 0; u.u_base += c; u.u_offset += c; return; } fault: u.u_error = EFAULT; return; } mmwrite(dev) { register int o; register unsigned c, v; switch (minor(dev)) { case 0: while (u.u_count != 0 && u.u_error == 0) { if (fubyte(u.u_base) == -1) goto fault; v = btop(u.u_offset); if (v >= physmem) goto fault; *(int *)mmap = v | (PG_V | PG_KW); mtpr(TBIS, vmmap); o = (int)u.u_offset & PGOFSET; c = min((unsigned)(NBPG - o), u.u_count); c = min(c, (unsigned)(NBPG - ((int)u.u_base&PGOFSET))); if (copyin(u.u_base, (caddr_t)&vmmap[o], c)) goto fault; u.u_count -= c; u.u_base += c; u.u_offset += c; } return; case 1: if (!kernacc((caddr_t)u.u_offset, u.u_count, B_WRITE)) goto fault; if (copyin(u.u_base, (caddr_t)u.u_offset, u.u_count)) goto fault; u.u_base += u.u_count; u.u_offset += u.u_count; u.u_count = 0; return; case 2: u.u_offset += u.u_count; u.u_count = 0; return; case 3: if (!kernacc((caddr_t)u.u_offset, u.u_count, B_WRITE)) goto fault; if (!useracc(u.u_base, u.u_count, B_READ)) goto fault; UNIcpy((caddr_t)u.u_offset, u.u_base, u.u_count, B_WRITE); u.u_base += u.u_count; u.u_offset += u.u_count; u.u_count = 0; return; } fault: u.u_error = EFAULT; return; } /* * UNIBUS Address Space <--> User Space transfer */ UNIcpy(uniadd, usradd, bknt, direct) caddr_t uniadd, usradd; unsigned bknt; { register short *from, *to; register int i; if (direct == B_READ) { from = (short *) uniadd; to = (short *) usradd; } else { from = (short *) usradd; to = (short *) uniadd; } for (i = (bknt>>1); i > 0; i--) *to++ = *from++; } @i; ki$$5&i){j){j /* mba.c 4.21 81/10/27 */ #include "mba.h" #if NMBA > 0 /* * Massbus driver, arbitrates a massbus among attached devices. */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dk.h" #include "../h/buf.h" #include "../h/conf.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/map.h" #include "../h/pte.h" #include "../h/mbareg.h" #include "../h/mbavar.h" #include "../h/mtpr.h" #include "../h/vm.h" char mbsr_bits[] = MBSR_BITS; /* * Start activity on a massbus device. * We are given the device's mba_device structure and activate * the device via the unit start routine. The unit start * routine may indicate that it is finished (e.g. if the operation * was a ``sense'' on a tape drive), that the (multi-ported) unit * is busy (we will get an interrupt later), that it started the * unit (e.g. for a non-data transfer operation), or that it has * set up a data transfer operation and we should start the massbus adaptor. */ mbustart(mi) register struct mba_device *mi; { register struct buf *bp; /* i/o operation at head of queue */ register struct mba_hd *mhp; /* header for mba device is on */ loop: /* * Get the first thing to do off device queue. */ bp = mi->mi_tab.b_actf; if (bp == NULL) return; /* * Let the drivers unit start routine have at it * and then process the request further, per its instructions. */ switch ((*mi->mi_driver->md_ustart)(mi)) { case MBU_NEXT: /* request is complete (e.g. ``sense'') */ mi->mi_tab.b_active = 0; mi->mi_tab.b_errcnt = 0; mi->mi_tab.b_actf = bp->av_forw; iodone(bp); goto loop; case MBU_DODATA: /* all ready to do data transfer */ /* * Queue the device mba_device structure on the massbus * mba_hd structure for processing as soon as the * data path is available. */ mhp = mi->mi_hd; mi->mi_forw = NULL; if (mhp->mh_actf == NULL) mhp->mh_actf = mi; else mhp->mh_actl->mi_forw = mi; mhp->mh_actl = mi; /* * If data path is idle, start transfer now. * In any case the(( device is ``active'' waiting for the * data to transfer. */ mi->mi_tab.b_active = 1; if (mhp->mh_active == 0) mbstart(mhp); return; case MBU_STARTED: /* driver started a non-data transfer */ /* * Mark device busy during non-data transfer * and count this as a ``seek'' on the device. */ if (mi->mi_dk >= 0) { dk_seek[mi->mi_dk]++; dk_busy |= (1 << mi->mi_dk); } mi->mi_tab.b_active = 1; return; case MBU_BUSY: /* dual port drive busy */ /* * We mark the device structure so that when an * interrupt occurs we will know to restart the unit. */ mi->mi_tab.b_flags |= B_BUSY; return; default: panic("mbustart"); } } /* * Start an i/o operation on the massbus specified by the argument. * We peel the first operation off its queue and insure that the drive * is present and on-line. We then use the drivers start routine * (if any) to prepare the drive, setup the massbus map for the transfer * and start the transfer. */ mbstart(mhp) register struct mba_hd *mhp; { register struct mba_device *mi; struct buf *bp; register struct mba_regs *mbp; register int com; loop: /* * Look for an operation at the front of the queue. */ if ((mi = mhp->mh_actf) == NULL) { return; } if ((bp = mi->mi_tab.b_actf) == NULL) { mhp->mh_actf = mi->mi_forw; goto loop; } /* * If this device isn't present and on-line, then * we screwed up, and can't really do the operation. * Only check for non-tapes because tape drivers check * ONLINE themselves and because TU78 registers are * different. */ if ((mi->mi_drv->mbd_dt & MBDT_TAP) == 0) if ((mi->mi_drv->mbd_ds & MBDS_DREADY) != MBDS_DREADY) { printf("%s%d: not ready\n", mi->mi_driver->md_dname, dkunit(bp)); mi->mi_tab.b_actf = bp->av_forw; mi->mi_tab.b_errcnt = 0; mi->mi_tab.b_active = 0; bp->b_flags |= B_ERROR; iodone(bp); goto loop; } /* * We can do the operation; mark the massbus active * and let the device start routine setup any necessary * device state for the transfer (e.g. desired cylinder, etc * on disks). */ mhp->mh_active = 1; if (mi->mi_driver->md_start) { if ((com = (*mi->mi_driver->md_start)(mi)) == 0) com = (bp->b_flags & B_READ) ? MB_RCOM|MB_GO : MB_WCOM|MB_GO; } else com = (bp->b_flags & B_READ) ? MB_RCOM|MB_GO : MB_WCOM|MB_GO; /* * Setup the massbus control and map registers and start * the transfer. */ mbp = mi->mi_mba; mbp->mba_sr = -1; /* conservative */ mbp->mba_var = mbasetup(mi); mbp->mba_bcr = -bp->b_bcount; mi->mi_drv->mbd_cs1 = com; if (mi->mi_dk >= 0) { dk_busy |= 1 << mi->mi_dk; dk_xfer[mi->mi_dk]++; dk_wds[mi->mi_dk] += bp->b_bcount >> 6; } } /* * Take an interrupt off of massbus mbanum, * and dispatch to drivers as appropriate. */ mbintr(mbanum) int mbanum; { register struct mba_hd *mhp = &mba_hd[mbanum]; register struct mba_regs *mbp = mhp->mh_mba; register struct mba_device *mi; register struct buf *bp; register int drive; int mbasr, as; /* * Read out the massbus status register * and attention status register and clear * the bits in same by writing them back. */ mbasr = mbp->mba_sr; mbp->mba_sr = mbasr; #if VAX750 if (mbasr&MBSR_CBHUNG) { printf("mba%d: control bus hung\n", mbanum); panic("cbhung"); } #endif /* note: the mbd_as register is shared between drives */ as = mbp->mba_drv[0].mbd_as & 0xff; mbp->mba_drv[0].mbd_as = as; /* * If the mba was active, process the data transfer * complete interrupt; otherwise just process units which * are now finished. */ if (mhp->mh_active) { /* * Clear attention status for drive whose data * transfer related operation completed, * and give the dtint driver * routine a chance to say what is next. */ mi = mhp->mh_actf; as &= ~(1 << mi->mi_drive); dk_busy &= ~(1 << mi->mi_dk); bp = mi->mi_tab.b_actf; switch ((*mi->mi_driver->md_dtint)(mi, mbasr)) { case MBD_DONE: /* all done, for better or worse */ /* * Flush request from drive queue. */ mi->mi_tab.b_errcnt = 0; mi->mi_tab.b_actf = bp->av_forw; iodone(bp); /* fall into... */ case MBD_RETRY: /* attempt the operation again */ /* * Dequeue data transfer from massbus queue; * if there is still a i/o request on the device * queue then start the next operation on the device. * (Common code for DONE and RETRY). */ mhp->mh_active = 0; mi->mi_tab.b_active = 0; mhp->mh_actf = mi->mi_forw; if (mi->mi_tab.b_actf) mbustart(mi); break; case MBD_RESTARTED: /* driver restarted op (ecc, e.g.) /* * Note that mhp->mh_active is still on. */ break; default: panic("mbintr"); } } /* * Service drives which require attention * after non-data-transfer operations. */ while (drive = ffs(as)) { drive--; /* was 1 origin */ as &= ~(1 << drive); mi = mhp->mh_mbip[drive]; if (mi == NULL) continue; /* * If driver has a handler for non-data transfer * interrupts, give it a chance to tell us what to do. */ if (mi->mi_driver->md_ndint) { mi->mi_tab.b_active = 0; switch ((*mi->mi_driver->md_ndint)(mi)) { case MBN_DONE: /* operation completed */ mi->mi_tab.b_errcnt = 0; bp = mi->mi_tab.b_actf; mi->mi_tab.b_actf = bp->av_forw; iodone(bp); /* fall into common code */ case MBN_RETRY: /* operation continues */ if (mi->mi_tab.b_actf) mbustart(mi); break; case MBN_SKIP: /* ignore unsol. interrupt */ break; default: panic("mbintr"); } } else /* * If there is no non-data transfer interrupt * routine, then we should just * restart the unit, leading to a mbstart() soon. */ mbustart(mi); } /* * If there is an operation available and * the massbus isn't active, get it going. */ if (mhp->mh_actf && !mhp->mh_active) mbstart(mhp); /* THHHHATS all folks... */ } /* * Setup the mapping registers for a transfer. */ mbasetup(mi) register struct mba_device *mi; { register struct mba_regs *mbap = mi->mi_mba; struct buf *bp = mi->mi_tab.b_actf; register int i; int npf; unsigned v; register struct pte *pte, *io; int o; int vaddr; struct proc *rp; io = mbap->mba_map; v = btop(bp->b_un.b_addr); o = (int)bp->b_un.b_addr & PGOFSET; npf = btoc(bp->b_bcount + o); rp = bp->b_flags&B_DIRTY ? &proc[2] : bp->b_proc; vaddr = o; if (bp->b_flags & B_UAREA) { for (i = 0; i < UPAGES; i++) { if (rp->p_addr[i].pg_pfnum == 0) panic("mba: zero upage"); *(int *)io++ = rp->p_addr[i].pg_pfnum | PG_V; } } else if ((bp->b_flags & B_PHYS) == 0) { pte = &Sysmap[btop(((int)bp->b_un.b_addr)&0x7fffffff)]; while (--npf >= 0) *(int *)io++ = pte++->pg_pfnum | PG_V; } else { if (bp->b_flags & B_PAGET) pte = &Usrptmap[btokmx((struct pte *)bp->b_un.b_addr)]; else pte = vtopte(rp, v); while (--npf >= 0) { if (pte->pg_pfnum == 0) panic("mba, zero entry"); *(int *)io++ = pte++->pg_pfnum | PG_V; } } *(int *)io++ = 0; return (vaddr); } /* * Init and interrupt enable a massbus adapter. */ mbainit(mp) struct mba_regs *mp; { mp->mba_cr = MBCR_INIT; mp->mba_cr = MBCR_IE; } #endif @iF kv$5&i 6i /* lp.c 4.20 81/07/25 */ #include "lp.h" #if NLP > 0 /* * LP-11 Line printer driver * * This driver has been modified to work on printers where * leaving IENABLE set would cause continuous interrupts. * * TODO: * Test driver on multiple printers */ #include "../h/param.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/buf.h" #include "../h/systm.h" #include "../h/map.h" #include "../h/pte.h" #include "../h/ubavar.h" #include "../h/ioctl.h" #include "../h/tty.h" #define LPPRI (PZERO+8) #define IENABLE 0100 #define DONE 0200 #define ERROR 0100000 #define LPLWAT 650 #define LPHWAT 800 #define MAXCOL 132 #define CAP 1 #define LPUNIT(dev) (minor(dev) >> 3) struct lpdevice { short lpsr; short lpbuf; }; struct lp_softc { struct clist sc_outq; int sc_state; int sc_physcol; int sc_logcol; int sc_physline; char sc_flags; int sc_lpchar; struct buf *sc_inbuf; } lp_softc[NLP]; struct uba_device *lpinfo[NLP]; int lpprobe(), lpattach(), lptout(); u_short lpstd[] = { 0177514 }; struct ((uba_driver lpdriver = { lpprobe, 0, lpattach, 0, lpstd, "lp", lpinfo }; /* bits for state */ #define OPEN 1 /* device is open */ #define TOUT 2 /* timeout is active */ #define MOD 4 /* device state has been modified */ #define ASLP 8 /* awaiting draining of printer */ extern lbolt; int lptout(); lpattach(ui) struct uba_device *ui; { register struct lp_softc *sc; sc = &lp_softc[ui->ui_unit]; sc->sc_lpchar = -1; } lpprobe(reg) caddr_t reg; { register int br, cvec; /* value-result */ register struct lpdevice *lpaddr = (struct lpdevice *)reg; #ifdef lint br = 0; cvec = br; br = cvec; #endif lpaddr->lpsr = IENABLE; DELAY(5); lpaddr->lpsr = 0; return (1); } /*ARGSUSED*/ lpopen(dev, flag) dev_t dev; int flag; { register int unit; register struct lpdevice *lpaddr; register struct lp_softc *sc; register struct uba_device *ui; if ((unit = LPUNIT(dev)) >= NLP || (sc = &lp_softc[unit])->sc_state&OPEN || (ui = lpinfo[unit]) == 0 || ui->ui_alive == 0) { u.u_error = ENXIO; return; } lpaddr = (struct lpdevice *)ui->ui_addr; if (lpaddr->lpsr&ERROR) { u.u_error = EIO; return; } sc->sc_state |= OPEN; sc->sc_inbuf = geteblk(); sc->sc_flags = minor(dev) & 07; (void) spl4(); if ((sc->sc_state&TOUT) == 0) { sc->sc_state |= TOUT; timeout(lptout, (caddr_t)dev, 10*hz); } (void) spl0(); lpcanon(dev, '\f'); } /*ARGSUSED*/ lpclose(dev, flag) dev_t dev; int flag; { register struct lp_softc *sc = &lp_softc[LPUNIT(dev)]; lpcanon(dev, '\f'); brelse(sc->sc_inbuf); sc->sc_state &= ~OPEN; } lpwrite(dev) dev_t dev; { register unsigned n; register char *cp; register struct lp_softc *sc = &lp_softc[LPUNIT(dev)]; while (n = min(BSIZE, u.u_count)) { cp = sc->sc_inbuf->b_un.b_addr; iomove(cp, n, B_WRITE); do lpcanon(dev, *cp++); while (--n); } } lpcanon(dev, c) dev_t dev; register int c; { register int logcol, physcol; register struct lp_softc *sc = &lp_softc[LPUNIT(dev)]; if (sc->sc_flags&CAP) { register c2; if (c>='a' && c<='z') c += 'A'-'a'; else switch (c) { case '{': c2 = '('; goto esc; case '}': c2 = ')'; goto esc; case '`': c2 = '\''; goto esc; case '|': c2 = '!'; goto esc; case '~': c2 = '^'; esc: lpcanon(dev, c2); sc->sc_logcol--; c = '-'; } } logcol = sc->sc_logcol; physcol = sc->sc_physcol; if (c == ' ') logcol++; else switch(c) { case '\t': logcol = (logcol+8) & ~7; break; case '\f': if (sc->sc_physline == 0 && physcol == 0) break; /* fall into ... */ case '\n': lpoutput(dev, c); if (c == '\f') sc->sc_physline = 0; else sc->sc_physline++; physcol = 0; /* fall into ... */ case '\r': logcol = 0; (void) spl4(); lpintr(LPUNIT(dev)); (void) spl0(); break; case '\b': if (logcol > 0) logcol--; break; default: if (logcol < physcol) { lpoutput(dev, '\r'); physcol = 0; } if (logcol < MAXCOL) { while (logcol > physcol) { lpoutput(dev, ' '); physcol++; } lpoutput(dev, c); physcol++; } logcol++; } if (logcol > 1000) /* ignore long lines */ logcol = 1000; sc->sc_logcol = logcol; sc->sc_physcol = physcol; } lpoutput(dev, c) dev_t dev; int c; { register struct lp_softc *sc = &lp_softc[LPUNIT(dev)]; if (sc->sc_outq.c_cc >= LPHWAT) { (void) spl4(); lpintr(LPUNIT(dev)); /* unchoke */ while (sc->sc_outq.c_cc >= LPHWAT) { sc->sc_state |= ASLP; /* must be ERROR */ sleep((caddr_t)sc, LPPRI); } (void) spl0(); } while (putc(c, &sc->sc_outq)) sleep((caddr_t)&lbolt, LPPRI); } lpintr(lp11) int lp11; { register int n; register struct lp_softc *sc = &lp_softc[lp11]; register struct uba_device *ui = lpinfo[lp11]; register struct lpdevice *lpaddr = (struct lpdevice *)ui->ui_addr; lpaddr->lpsr &= ~IENABLE; n = sc->sc_outq.c_cc; if (sc->sc_lpchar < 0) sc->sc_lpchar = getc(&sc->sc_outq); while ((lpaddr->lpsr&DONE) && sc->sc_lpchar >= 0) { lpaddr->lpbuf = sc->sc_lpchar; sc->sc_lpchar = getc(&sc->sc_outq); } sc->sc_state |= MOD; if (sc->sc_outq.c_cc > 0 && (lpaddr->lpsr&ERROR)==0) lpaddr->lpsr |= IENABLE; /* ok and more to do later */ if (n>LPLWAT && sc->sc_outq.c_cc<=LPLWAT && sc->sc_state&ASLP) { sc->sc_state &= ~ASLP; wakeup((caddr_t)sc); /* top half should go on */ } } lptout(dev) dev_t dev; { register struct lp_softc *sc; register struct uba_device *ui; register struct lpdevice *lpaddr; sc = &lp_softc[LPUNIT(dev)]; ui = lpinfo[LPUNIT(dev)]; lpaddr = (struct lpdevice *) ui->ui_addr; if ((sc->sc_state&MOD) != 0) { sc->sc_state &= ~MOD; /* something happened */ timeout(lptout, (caddr_t)dev, 2*hz); /* so don't sweat */ return; } if ((sc->sc_state&OPEN) == 0) { sc->sc_state &= ~TOUT; /* no longer open */ lpaddr->lpsr = 0; return; } if (sc->sc_outq.c_cc && (lpaddr->lpsr&DONE) && (lpaddr->lpsr&ERROR)==0) lpintr(LPUNIT(dev)); /* ready to go */ timeout(lptout, (caddr_t)dev, 10*hz); } lpreset(uban) int uban; { register struct uba_device *ui; register struct lpdevice *lpaddr; register int unit; for (unit = 0; unit < NLP; unit++) { if ((ui = lpinfo[unit]) == 0 || ui->ui_ubanum != uban || ui->ui_alive == 0) continue; printf(" lp%d", unit); lpaddr = (struct lpdevice *)ui->ui_addr; lpaddr->lpsr |= IENABLE; } } @iN kGq$d4  7&i.SP6i /* ht.c 4.20 81/10/27 */ #include "tu.h" #if NHT > 0 /* * TM03/TU?? tape driver * * TODO: * cleanup messages on errors * test ioctl's * see how many rewind interrups we get if we kick when not at BOT * fixup rle error on block tape code */ #include "../h/param.h" #include "../h/systm.h" #include "../h/buf.h" #include "../h/conf.h" #include "../h/dir.h" #include "../h/file.h" #include "../h/user.h" #include "../h/map.h" #include "../h/pte.h" #include "../h/mbareg.h" #include "../h/mbavar.h" #include "../h/mtio.h" #include "../h/ioctl.h" #include "../h/cmap.h" #include "../h/cpu.h" #include "../h/htreg.h" struct buf rhtbuf[NHT]; struct buf chtbuf[NHT]; short httypes[] = { MBDT_TM03, MBDT_TE16, MBDT_TU45, MBDT_TU77, 0 }; struct mba_device *htinfo[NHT]; int htattach(), htslave(), htustart(), htndtint(), htdtint(); struct mba_driver htdriver = { htattach, htslave, htustart, 0, htdtint, htndtint, httypes, "ht", "tu", htinfo }; #define MASKREG(r) ((r) & 0xffff) /* bits in minor device */ #define TUUNIT(dev) (minor(dev)&03) #define H_NOREWIND 04 #define H_1600BPI 08 #define HTUNIT(dev) (tutoht[TUUNIT(dev)]) #define INF (daddr_t)1000000L /* a block number that wont exist */ struct tu_softc { char sc_openf; char sc_flags; daddr_t sc_blkno; daddr_t sc_nxrec; u_short sc_erreg; u_short sc_dsreg; short sc_resid; short sc_dens; struct mba_device *sc_mi; int sc_slave; } tu_softc[NTU]; short tutoht[NTU]; /* * Bits for sc_flags. */ #define H_WRITTEN 1 /* last operation was a write */ #define H_ERASED 2 /* last write retry was an erase gap */ #define H_REWIND 4 /* last unit start was a rewind */ char hter_bits[] = HTER_BITS; char htds_bits[] = HTDS_BITS; /*ARGSUSED*/ htattach(mi) struct mba_device *mi; { } htslave(mi, ms) struct mba_device *mi; struct mba_slave *ms; { register struct tu_softc *sc = &tu_softc[ms->ms_unit]; register struct htdevice *htaddr = (struct htdevice *)mi->mi_drv; htaddr->httc = ms->ms_slave; if (htaddr->htdt & HTDT_SPR) { sc->sc_mi = mi; sc->sc_slave = ms->ms_slave; tutoht[ms->ms_unit] = mi->mi_unit; return (1); } else return (0); } htopen(dev, flag) dev_t dev; int flag; { register int tuunit; register struct mba_device *mi; register struct tu_softc *sc; int olddens, dens; tuunit = TUUNIT(dev); if (tuunit >= NTU || (sc = &tu_softc[tuunit])->sc_openf || (mi = htinfo[HTUNIT(dev)]) == 0 || mi->mi_alive == 0) { u.u_error = ENXIO; return; } olddens = sc->sc_dens; dens = sc->sc_dens = ((minor(dev)&H_1600BPI)?HTTC_1600BPI:HTTC_800BPI)| HTTC_PDP11|sc->sc_slave; htcommand(dev, HT_SENSE, 1); sc->sc_dens = olddens; if ((sc->sc_dsreg & HTDS_MOL) == 0) { uprintf("tu%d: not online\n", tuunit); u.u_error = EIO; return; } if ((flag&FWRITE) && (sc->sc_dsreg&HTDS_WRL)) { uprintf("tu%d: no write ring\n", tuunit); u.u_error = EIO; return; } if ((sc->sc_dsreg & HTDS_BOT) == 0 && (flag&FWRITE) && dens != sc->sc_dens) { uprintf("tu%d: can't change density in mid-tape\n", tuunit); u.u_error = EIO; return; } sc-((>sc_openf = 1; sc->sc_blkno = (daddr_t)0; sc->sc_nxrec = INF; sc->sc_flags = 0; sc->sc_dens = dens; } htclose(dev, flag) register dev_t dev; register flag; { register struct tu_softc *sc = &tu_softc[TUUNIT(dev)]; if (flag == FWRITE || ((flag&FWRITE) && (sc->sc_flags&H_WRITTEN))) { htcommand(dev, HT_WEOF, 1); htcommand(dev, HT_WEOF, 1); htcommand(dev, HT_SREV, 1); } if ((minor(dev)&H_NOREWIND) == 0) htcommand(dev, HT_REW, 0); sc->sc_openf = 0; } htcommand(dev, com, count) dev_t dev; int com, count; { register struct buf *bp; bp = &chtbuf[HTUNIT(dev)]; (void) spl5(); while (bp->b_flags&B_BUSY) { if(bp->b_repcnt == 0 && (bp->b_flags&B_DONE)) break; bp->b_flags |= B_WANTED; sleep((caddr_t)bp, PRIBIO); } bp->b_flags = B_BUSY|B_READ; (void) spl0(); bp->b_dev = dev; bp->b_command = com; bp->b_repcnt = count; bp->b_blkno = 0; htstrategy(bp); if (count == 0) return; iowait(bp); if (bp->b_flags&B_WANTED) wakeup((caddr_t)bp); bp->b_flags &= B_ERROR; } htstrategy(bp) register struct buf *bp; { register struct mba_device *mi = htinfo[HTUNIT(bp->b_dev)]; register struct buf *dp; bp->av_forw = NULL; dp = &mi->mi_tab; (void) spl5(); if (dp->b_actf == NULL) dp->b_actf = bp; else dp->b_actl->av_forw = bp; dp->b_actl = bp; if (dp->b_active == 0) mbustart(mi); (void) spl0(); } htustart(mi) register struct mba_device *mi; { register struct htdevice *htaddr = (struct htdevice *)mi->mi_drv; register struct buf *bp = mi->mi_tab.b_actf; register struct tu_softc *sc = &tu_softc[TUUNIT(bp->b_dev)]; daddr_t blkno; htaddr->httc = sc->sc_dens; if (bp == &chtbuf[HTUNIT(bp->b_dev)] && bp->b_command == HT_SENSE) { htaddr->htcs1 = HT_SENSE|HT_GO; mbclrattn(mi); } sc->sc_dsreg = htaddr->htds; sc->sc_erreg = htaddr->hter; sc->sc_resid = htaddr->htfc; sc->sc_flags &= ~(H_WRITTEN|H_REWIND); if ((htaddr->htdt & HTDT_SPR) == 0 || (htaddr->htds & HTDS_MOL) == 0) if (sc->sc_openf > 0) sc->sc_openf = -1; if (sc->sc_openf < 0) { bp->b_flags |= B_ERROR; return (MBU_NEXT); } if (bp != &chtbuf[HTUNIT(bp->b_dev)]) { if (dbtofsb(bp->b_blkno) > sc->sc_nxrec) { bp->b_flags |= B_ERROR; bp->b_error = ENXIO; return (MBU_NEXT); } if (dbtofsb(bp->b_blkno) == sc->sc_nxrec && bp->b_flags&B_READ) { bp->b_resid = bp->b_bcount; clrbuf(bp); return (MBU_NEXT); } if ((bp->b_flags&B_READ)==0) sc->sc_nxrec = dbtofsb(bp->b_blkno) + 1; } else { if (bp->b_command == HT_SENSE) return (MBU_NEXT); if (bp->b_command == HT_REW) sc->sc_flags |= H_REWIND; else htaddr->htfc = -bp->b_bcount; htaddr->htcs1 = bp->b_command|HT_GO; return (MBU_STARTED); } if ((blkno = sc->sc_blkno) == dbtofsb(bp->b_blkno)) { htaddr->htfc = -bp->b_bcount; if ((bp->b_flags&B_READ) == 0) { if (mi->mi_tab.b_errcnt) { if ((sc->sc_flags & H_ERASED) == 0) { sc->sc_flags |= H_ERASED; htaddr->htcs1 = HT_ERASE | HT_GO; return (MBU_STARTED); } sc->sc_flags &= ~H_ERASED; } if (htaddr->htds & HTDS_EOT) { bp->b_resid = bp->b_bcount; return (MBU_NEXT); } } return (MBU_DODATA); } if (blkno < dbtofsb(bp->b_blkno)) { htaddr->htfc = blkno - dbtofsb(bp->b_blkno); htaddr->htcs1 = HT_SFORW|HT_GO; } else { htaddr->htfc = dbtofsb(bp->b_blkno) - blkno; htaddr->htcs1 = HT_SREV|HT_GO; } return (MBU_STARTED); } htdtint(mi, mbsr) register struct mba_device *mi; int mbsr; { register struct htdevice *htaddr = (struct htdevice *)mi->mi_drv; register struct buf *bp = mi->mi_tab.b_actf; register struct tu_softc *sc; int ds, er, mbs; sc = &tu_softc[TUUNIT(bp->b_dev)]; ds = sc->sc_dsreg = MASKREG(htaddr->htds); er = sc->sc_erreg = MASKREG(htaddr->hter); sc->sc_resid = MASKREG(htaddr->htfc); mbs = mbsr; sc->sc_blkno++; if((bp->b_flags & B_READ) == 0) sc->sc_flags |= H_WRITTEN; if ((ds&(HTDS_ERR|HTDS_MOL)) != HTDS_MOL || mbs & MBSR_EBITS) { htaddr->htcs1 = HT_DCLR|HT_GO; mbclrattn(mi); if (bp == &rhtbuf[HTUNIT(bp->b_dev)]) { er &= ~HTER_FCE; mbs &= ~(MBSR_DTABT|MBSR_MBEXC); } if (bp->b_flags & B_READ && ds & HTDS_PES) er &= ~(HTER_CSITM|HTER_CORCRC); if (er&HTER_HARD || mbs&MBSR_EBITS || (ds&HTDS_MOL) == 0 || er && ++mi->mi_tab.b_errcnt >= 7) { if ((ds & HTDS_MOL) == 0 && sc->sc_openf > 0) sc->sc_openf = -1; if ((er&HTER_HARD) == HTER_FCE && (mbs&MBSR_EBITS) == (MBSR_DTABT|MBSR_MBEXC) && (ds&HTDS_MOL)) goto noprint; printf("tu%d: hard error bn%d mbsr=%b er=%b ds=%b\n", TUUNIT(bp->b_dev), bp->b_blkno, mbsr, mbsr_bits, sc->sc_erreg, hter_bits, sc->sc_dsreg, htds_bits); noprint: bp->b_flags |= B_ERROR; return (MBD_DONE); } if (er) return (MBD_RETRY); } bp->b_resid = 0; if (bp->b_flags & B_READ) if (ds&HTDS_TM) { /* must be a read, right? */ bp->b_resid = bp->b_bcount; sc->sc_nxrec = dbtofsb(bp->b_blkno); } else if(bp->b_bcount > MASKREG(htaddr->htfc)) bp->b_resid = bp->b_bcount - MASKREG(htaddr->htfc); return (MBD_DONE); } htndtint(mi) register struct mba_device *mi; { register struct htdevice *htaddr = (struct htdevice *)mi->mi_drv; register struct buf *bp = mi->mi_tab.b_actf; register struct tu_softc *sc; int er, ds, fc; ds = MASKREG(htaddr->htds); er = MASKREG(htaddr->hter); fc = MASKREG(htaddr->htfc); if (er) { htaddr->htcs1 = HT_DCLR|HT_GO; mbclrattn(mi); } if (bp == 0) return (MBN_SKIP); sc = &tu_softc[TUUNIT(bp->b_dev)]; sc->sc_dsreg = ds; sc->sc_erreg = er; sc->sc_resid = fc; if (bp == &chtbuf[HTUNIT(bp->b_dev)]) { switch (bp->b_command) { case HT_REWOFFL: /* offline is on purpose; don't do anything special */ ds |= HTDS_MOL; break; case HT_SREV: /* if backspace file hit bot, its not an error */ if (er == (HTER_NEF|HTER_FCE) && ds&HTDS_BOT && bp->b_repcnt == INF) er &= ~HTER_NEF; break; } er &= ~HTER_FCE; if (er == 0) ds &= ~HTDS_ERR; } if ((ds & (HTDS_ERR|HTDS_MOL)) != HTDS_MOL) { if ((ds & HTDS_MOL) == 0 && sc->sc_openf > 0) sc->sc_openf = -1; printf("tu%d: hard error bn%d er=%b ds=%b\n", TUUNIT(bp->b_dev), bp->b_blkno, sc->sc_erreg, hter_bits, sc->sc_dsreg, htds_bits); bp->b_flags |= B_ERROR; return (MBN_DONE); } if (bp == &chtbuf[HTUNIT(bp->b_dev)]) { if (sc->sc_flags & H_REWIND) return (ds & HTDS_BOT ? MBN_DONE : MBN_RETRY); bp->b_resid = -sc->sc_resid; return (MBN_DONE); } if (ds & HTDS_TM) if (sc->sc_blkno > dbtofsb(bp->b_blkno)) { sc->sc_nxrec = dbtofsb(bp->b_blkno) - fc; sc->sc_blkno = sc->sc_nxrec; } else { sc->sc_blkno = dbtofsb(bp->b_blkno) + fc; sc->sc_nxrec = sc->sc_blkno - 1; } else sc->sc_blkno = dbtofsb(bp->b_blkno); return (MBN_RETRY); } htread(dev) dev_t dev; { htphys(dev); if (u.u_error) return; physio(htstrategy, &rhtbuf[HTUNIT(dev)], dev, B_READ, minphys); } htwrite(dev) { htphys(dev); if (u.u_error) return; physio(htstrategy, &rhtbuf[HTUNIT(dev)], dev, B_WRITE, minphys); } htphys(dev) dev_t dev; { register int htunit; register struct tu_softc *sc; register struct mba_device *mi; daddr_t a; htunit = HTUNIT(dev); if (htu@iY kHr$d4  7&i.SP6init >= NHT || (mi = htinfo[htunit]) == 0 || mi->mi_alive == 0) { u.u_error = ENXIO; return; } a = u.u_offset >> 9; sc = &tu_softc[TUUNIT(dev)]; sc->sc_blkno = dbtofsb(a); sc->sc_nxrec = dbtofsb(a)+1; } /*ARGSUSED*/ htioctl(dev, cmd, addr, flag) dev_t dev; int cmd; caddr_t addr; int flag; { register struct tu_softc *sc = &tu_softc[TUUNIT(dev)]; register struct buf *bp = &chtbuf[HTUNIT(dev)]; register callcount; int fcount; struct mtop mtop; struct mtget mtget; /* we depend of the values and order of the MT codes here */ static htops[] = {HT_WEOF,HT_SFORW,HT_SREV,HT_SFORW,HT_SREV,HT_REW,HT_REWOFFL,HT_SENSE}; switch (cmd) { case MTIOCTOP: /* tape operation */ if (copyin((caddr_t)addr, (caddr_t)&mtop, sizeof(mtop))) { u.u_error = EFAULT; return; } switch(mtop.mt_op) { case MTWEOF: callcount = mtop.mt_count; fcount = 1; break; case MTFSF: case MTBSF: callcount = mtop.mt_count; fcount = INF; break; case MTFSR: case MTBSR: callcount = 1; fcount = mtop.mt_count; break; case MTREW: case MTOFFL: callcount = 1; fcount = 1; break; default: u.u_error = ENXIO; return; } if (callcount <= 0 || fcount <= 0) { u.u_error = ENXIO; return; } while (--callcount >= 0) { htcommand(dev, htops[mtop.mt_op], fcount); if ((mtop.mt_op == MTFSR || mtop.mt_op == MTBSR) && bp->b_resid) { u.u_error = EIO; break; } if ((bp->b_flags&B_ERROR) || sc->sc_dsreg&HTDS_BOT) break; } geterror(bp); return; case MTIOCGET: mtget.mt_dsreg = sc->sc_dsreg; mtget.mt_erreg = sc->sc_erreg; mtget.mt_resid = sc->sc_resid; mtget.mt_type = MT_ISHT; if (copyout((caddr_t)&mtget, addr, sizeof(mtget))) u.u_error = EFAULT; return; default: u.u_error = ENXIO; } } #define DBSIZE 20 htdump() { register struct mba_device *mi; register struct mba_regs *mp; register struct htdevice *htaddr; int blk, num; int start; start = 0; num = maxfree; #define phys(a,b) ((b)((int)(a)&0x7fffffff)) if (htinfo[0] == 0) ((return (ENXIO); mi = phys(htinfo[0], struct mba_device *); mp = phys(mi->mi_hd, struct mba_hd *)->mh_physmba; mp->mba_cr = MBCR_IE; htaddr = (struct htdevice *)&mp->mba_drv[mi->mi_drive]; htaddr->httc = HTTC_PDP11|HTTC_1600BPI; htaddr->htcs1 = HT_DCLR|HT_GO; while (num > 0) { blk = num > DBSIZE ? DBSIZE : num; htdwrite(start, blk, htaddr, mp); start += blk; num -= blk; } hteof(htaddr); hteof(htaddr); htwait(htaddr); if (htaddr->htds&HTDS_ERR) return (EIO); htaddr->htcs1 = HT_REW|HT_GO; return (0); } htdwrite(dbuf, num, htaddr, mp) register dbuf, num; register struct htdevice *htaddr; struct mba_regs *mp; { register struct pte *io; register int i; htwait(htaddr); io = mp->mba_map; for (i = 0; i < num; i++) *(int *)io++ = dbuf++ | PG_V; htaddr->htfc = -(num*NBPG); mp->mba_sr = -1; mp->mba_bcr = -(num*NBPG); mp->mba_var = 0; htaddr->htcs1 = HT_WCOM|HT_GO; } htwait(htaddr) struct htdevice *htaddr; { register s; do s = htaddr->htds; while ((s & HTDS_DRY) == 0); } hteof(htaddr) struct htdevice *htaddr; { htwait(htaddr); htaddr->htcs1 = HT_WEOF|HT_GO; } #endif @i^kN{,$Y64&iu6i /* hp.c 4.41 81/07/09 */ #ifdef HPDEBUG int hpdebug; #endif #ifdef HPBDEBUG int hpbdebug; #endif #include "hp.h" #if NHP > 0 /* * HP disk driver for RP0x+RMxx * * TODO: * check RM80 skip sector handling when ECC's occur later * check offset recovery handling * see if DCLR and/or RELEASE set attention status * print bits of mr && mr2 symbolically */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dk.h" #include "../h/buf.h" #include "../h/conf.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/map.h" #include "../h/pte.h" #include "../h/mbareg.h" #include "../h/mbavar.h" #include "../h/mtpr.h" #include "../h/vm.h" #include "../h/cmap.h" #include "../h/dkbad.h" #include "../h/hpreg.h" /* THIS SHOULD BE READ OFF THE PACK, PER DRIVE */ struct size { daddr_t nblocks; int cyloff; } hp6_sizes[8] = { 15884, 0, /* A=cyl 0 thru 37 */ 33440, 38, /* B=cyl 38 thru 117 */ 340670, 0, /* C=cyl 0 thru 814 */ 0, 0, 0, 0, 0, 0, #ifndef NOBADSECT 291280, 118, /* G=cyl 118 thru 814 */ #else 291346, 118, #endif 0, 0, }, rm3_sizes[8] = { 15884, 0, /* A=cyl 0 thru 99 */ 33440, 100, /* B=cyl 100 thru 309 */ 131680, 0, /* C=cyl 0 thru 822 */ 0, 0, 0, 0, 0, 0, #ifndef NOBADSECT 81984, 310, /* G=cyl 310 thru 822 */ #else 82080, 310, #endif 0, 0, }, rm5_sizes[8] = { 15884, 0, /* A=cyl 0 thru 26 */ 33440, 27, /* B=cyl 27 thru 81 */ 500384, 0, /* C=cyl 0 thru 822 */ 15884, 562, /* D=cyl 562 thru 588 */ 55936, 589, /* E=cyl 589 thru 680 */ #ifndef NOBADSECT 86240, 681, /* F=cyl 681 thru 822 */ 158592, 562, /* G=cyl 562 thru 822 */ #else 86636, 681, 158688, 562, #endif 291346, 82, /* H=cyl 82 thru 561 */ }, rm80_sizes[8] = { 15884, 0, /* A=cyl 0 thru 36 */ 33440, 37, /* B=cyl 37 thru 114 */ 242606, 0, /* C=cyl 0 thru 558 */ 0, 0, 0, 0, 0, 0, 82080, 115, /* G=cyl 115 thru 304 */ 110143, 305, /* H=cyl 305 thru 558 */ }, hp7_sizes[8] = { 15844, 0, /* A=cyl 0 thru 9 */ 64000, 10, /* B=cyl 10 thru 49 */ 1008000,0, /* C=cyl 0 thru 629 */ 15884, 330, /* D=cyl 330 thru 339 */ 256000, 340, /* E=cyl 340 thru 499 */ 207850, 500, /* F=cyl 500 thru 629 */ 479850, 330, /* G=cyl 330 thru 629 */ 448000, 50, /* H=cyl 50 thru 329 */ }; /* END OF STUFF WHICH SHOULD BE READ IN PER DISK */ #define _hpSDIST 2 #define _hpRDIST 3 int hpSDIST = _hpSDIST; int hpRDIST = _hpRDIST; short hptypes[] = { MBDT_RM03, MBDT_RM05, MBDT_RP06, MBDT_RM80, MBDT_RP05, MBDT_RP07, 0 }; struct mba_device *hpinfo[NHP]; int hpattach(),hpustart(),hpstart(),hpdtint(); struct mba_driver hpdriver = { hpattach, 0, hpustart, hpstart, hpdtint, 0, hptypes, "hp", 0, hpinfo }; struct hpst { short nsect; short ntrak; short nspc; short ncyl; struct size *sizes; } hpst[] = { 32, 5, 32*5, 823, rm3_sizes, /* RM03 */ 32, 19, 32*19, 823, rm5_sizes, /* RM05 */ 22, 19, 22*19, 815, hp6_sizes, /* RP06 */ 31, 14, 31*14, 559, rm80_sizes, /* RM80 */ 22, 19, 22*19, 411, hp6_sizes, /* RP05 */ 50, 32, 50*32, 630, hp7_sizes, /* RP07 */ }; u_char hp_offset[16] = { HPOF_P400, HPOF_M400, HPOF_P400, HPOF_M400, HPOF_P800, HPOF_M800, HPOF_P800, HPOF_M800, HPOF_P1200, HPOF_M1200, HPOF_P1200, HPOF_M1200, 0, 0, 0, 0, }; struct buf rhpbuf[NHP]; #ifndef NOBADSECT struct buf bhpbuf[NHP]; struct dkbad hpbad[NHP]; #endif char hpinit[NHP]; char hprecal[NHP]; #define b_cylin b_resid #ifdef INTRLVE daddr_t dkblock(); #endif int hpseek; /*ARGSUSED*/ hpattach(mi, slave) struct mba_device *mi; { register struct hpst *st = &hpst[mi->mi_type]; if (mi->mi_dk >= 0) dk_mspw[mi->mi_dk] = 1.0 / 60 / (st->nsect * 256); } hpstrategy(bp) register struct buf *bp; { register struct mba_device *mi; register struct hpst *st; register int unit; long sz, bn; int xunit = minor(bp->b_dev) & 07; sz = bp->b_bcount; sz = (sz+511) >> 9; unit = dkunit(bp); if (unit >= NHP) goto bad; mi = hpinfo[unit]; if (mi == 0 || mi->mi_alive == 0) goto bad; st = &hpst[mi->mi_type]; if (bp->b_blkno < 0 || (bn = dkblock(bp))+sz > st->sizes[xunit].nblocks) goto bad; bp->b_cylin = bn/st->nspc + st->sizes[xunit].cyloff; (void) spl5(); disksort(&mi->mi_tab, bp); if (mi->mi_tab.b_active == 0) mbustart(mi); (void) spl0(); return; bad: bp->b_flags |= B_ERROR; iodone(bp); return; } hpustart(mi) register struct mba_device *mi; { register struct hpdevice *hpaddr = (struct hpdevice *)mi->mi_drv; register struct buf *bp = mi->mi_tab.b_actf; register struct hpst *st = &hpst[mi->mi_type]; daddr_t bn; int sn, dist; hpaddr->hpcs1 = 0; if ((hpaddr->hpcs1&HP_DVA) == 0) return (MBU_BUSY); if ((hpaddr->hpds & HPDS_VV) == 0 || hpinit[mi->mi_unit] == 0) { #ifndef NOBADSECT struct buf *bbp = &bhpbuf[mi->mi_unit]; #endif hpinit[mi->mi_unit] = 1; hpaddr->hpcs1 = HP_DCLR|HP_GO; if (mi->mi_mba->mba_drv[0].mbd_as & (1<mi_drive)) printf("DCLR attn\n"); hpaddr->hpcs1 = HP_PRESET|HP_GO; hpaddr->hpof = HPOF_FMT22; mbclrattn(mi); #ifndef NOBADSECT bbp->b_flags = B_READ|B_BUSY; bbp->b_dev = bp->b_dev; bbp->b_bcount = 512; bbp->b_un.b_addr = (caddr_t)&hpbad[mi->mi_unit]; bbp->b_blkno = st->ncyl*st->nspc - st->nsect; bbp->b_cylin = st->ncyl - 1; mi->mi_tab.b_actf = bbp; bbp->av_forw = bp; bp = bbp; #endif } if (mi->mi_tab.b_active || mi->mi_hd->mh_ndrive == 1) return (MBU_DODATA); if ((hpaddr->hpds & HPDS_DREADY) != HPDS_DREADY) return (MBU_DODATA); bn = dkblock(bp); sn = bn%st->nspc; sn = (sn+st->nsect-hpSDIST)%st->nsect; if (bp->b_cylin == (hpaddr->hpdc & 0xffff)) { if (hpseek) return (MBU_DODATA); dist = ((hpaddr->hpla & 0xffff)>>6) - st->nsect + 1; if (dist < 0) dist += st->nsect; if (dist > st->nsect - hpRDIST) return (MBU_DODATA); } else hpaddr->hpdc = bp->b_cylin; if (hpseek) hpaddr->hpcs1 = HP_SEEK|HP_GO; else { hpaddr->hpda = sn; hpaddr->hpcs1 = HP_SEARCH|HP_GO; } return (MBU_STARTED); } hpstart(mi) register struct mba_device *mi; { register struct hpdevice *hpaddr = (struct hpdevice *)mi->mi_drv; register struct buf *bp = mi->mi_tab.b_actf; register struct hpst *st = &hpst[mi->mi_type]; daddr_t bn; int sn, tn; bn = dkblock(bp); sn = bn%st->nspc; tn = sn/st->nsect; sn %= st->nsect; hpaddr->hpdc = bp->b_cylin; hpaddr->hpda = (tn << 8) + sn; return(0); } hpdtint(mi, mbsr) register struct mba_device *mi; int mbsr; { register struct hpdevice *hpaddr = (struct hpdevice *)mi->mi_drv; register struct buf *bp = mi->mi_tab.b_actf; int retry = 0; #ifndef NOBADSECT if (bp->b_flags&B_BAD) { if (hpecc(mi, CONT)) return(MBD_RESTARTED); } #endif if (hpaddr->hpds&HPDS_ERR || mbsr&MBSR_EBITS) { #ifdef HPDEBUG if (hpdebug) { int dc = hpaddr->hpdc, da = hpaddr->hpda; printf("hperr: bp %x cyl %d blk %d as %o ", bp, bp->b_cylin, bp->b_blkno, hpaddr->hpas&0xff); printf("dc %x da %x\n",dc&0xffff, da&0xffff); printf("errcnt %d ", mi->mi_tab.b_errcnt); printf("mbsr=%b ", mbsr, mbsr_bits); printf("er1=%b er2=%b\n", hpaddr->hper1, HPER1_BITS, hpaddr->hper2, HPER2_BITS); DELAY(1000000); } #endif if (hpaddr->hper1&HPER1_WLE) { printf("hp%d: write locked\n", dkunit(bp)); b((p->b_flags |= B_ERROR; } else if (++mi->mi_tab.b_errcnt > 27 || mbsr & MBSR_HARD || hpaddr->hper1 & HPER1_HARD || hpaddr->hper2 & HPER2_HARD) { hard: harderr(bp, "hp"); if (mbsr & (MBSR_EBITS &~ (MBSR_DTABT|MBSR_MBEXC))) printf("mbsr=%b ", mbsr, mbsr_bits); printf("er1=%b er2=%b", hpaddr->hper1, HPER1_BITS, hpaddr->hper2, HPER2_BITS); if (hpaddr->hpmr) printf(" mr=%o", hpaddr->hpmr&0xffff); if (hpaddr->hpmr2) printf(" mr2=%o", hpaddr->hpmr2&0xffff); printf("\n"); bp->b_flags |= B_ERROR; hprecal[mi->mi_unit] = 0; } else if (hpaddr->hper2 & HPER2_BSE) { #ifndef NOBADSECT if (hpecc(mi, BSE)) return(MBD_RESTARTED); else #endif goto hard; } else if (hptypes[mi->mi_type] == MBDT_RM80 && hpaddr->hper2&HPER2_SSE) { (void) hpecc(mi, SSE); return (MBD_RESTARTED); } else if ((hpaddr->hper1&(HPER1_DCK|HPER1_ECH))==HPER1_DCK) { if (hpecc(mi, ECC)) return (MBD_RESTARTED); /* else done */ } else retry = 1; hpaddr->hpcs1 = HP_DCLR|HP_GO; if ((mi->mi_tab.b_errcnt&07) == 4) { hpaddr->hpcs1 = HP_RECAL|HP_GO; hprecal[mi->mi_unit] = 1; return(MBD_RESTARTED); } if (retry) return (MBD_RETRY); } #ifdef HPDEBUG else if (hpdebug && hprecal[mi->mi_unit]) { printf("recal %d ", hprecal[mi->mi_unit]); printf("errcnt %d\n", mi->mi_tab.b_errcnt); printf("mbsr=%b ", mbsr, mbsr_bits); printf("er1=%b er2=%b\n", hpaddr->hper1, HPER1_BITS, hpaddr->hper2, HPER2_BITS); } #endif switch (hprecal[mi->mi_unit]) { case 1: hpaddr->hpdc = bp->b_cylin; hpaddr->hpcs1 = HP_SEEK|HP_GO; hprecal[mi->mi_unit]++; return (MBD_RESTARTED); case 2: if (mi->mi_tab.b_errcnt < 16 || (bp->b_flags & B_READ) == 0) goto donerecal; hpaddr->hpof = hp_offset[mi->mi_tab.b_errcnt & 017]|HPOF_FMT22; hpaddr->hpcs1 = HP_OFFSET|HP_GO; hprecal[mi->mi_unit]++; return (MBD_RESTARTED); donerecal: case 3: hprecal[mi->mi_unit] = 0; return (MBD_RETRY); } bp->b_resid = -(mi->mi_mba->mba_bcr) & 0xffff; if (mi->mi_tab.b_errcnt >= 16) { /* * This is fast and occurs rarely; we don't * bother with interrupts. */ hpaddr->hpcs1 = HP_RTC|HP_GO; while (hpaddr->hpds & HPDS_PIP) ; mbclrattn(mi); } hpaddr->hpof = HPOF_FMT22; hpaddr->hpcs1 = HP_RELEASE|HP_GO; return (MBD_DONE); } hpread(dev) dev_t dev; { register int unit = minor(dev) >> 3; if (unit >= NHP) u.u_error = ENXIO; else physio(hpstrategy, &rhpbuf[unit], dev, B_READ, minphys); } hpwrite(dev) dev_t dev; { register int unit = minor(dev) >> 3; if (unit >= NHP) u.u_error = ENXIO; else physio(hpstrategy, &rhpbuf[unit], dev, B_WRITE, minphys); } hpecc(mi, flag) register struct mba_device *mi; int flag; { register struct mba_regs *mbp = mi->mi_mba; register struct hpdevice *rp = (struct hpdevice *)mi->mi_drv; register struct buf *bp = mi->mi_tab.b_actf; register struct hpst *st = &hpst[mi->mi_type]; int npf, o; int bn, cn, tn, sn; int bcr; bcr = mbp->mba_bcr & 0xffff; if (bcr) bcr |= 0xffff0000@iikM|-$Y64&iu6i; /* sxt */ #ifndef NOBADSECT if (flag == CONT) npf = bp->b_error; else #endif npf = btop(bcr + bp->b_bcount); o = (int)bp->b_un.b_addr & PGOFSET; bn = dkblock(bp); cn = bp->b_cylin; sn = bn%(st->nspc) + npf; tn = sn/st->nsect; sn %= st->nsect; cn += tn/st->ntrak; tn %= st->ntrak; switch (flag) { case ECC: { register int i; caddr_t addr; struct pte mpte; int bit, byte, mask; npf--; /* because block in error is previous block */ printf("hp%d%c: soft ecc sn%d\n", dkunit(bp), 'a'+(minor(bp->b_dev)&07), bp->b_blkno + npf); mask = rp->hpec2&0xffff; i = (rp->hpec1&0xffff) - 1; /* -1 makes 0 origin */ bit = i&07; i = (i&~07)>>3; byte = i + o; while (i < 512 && (int)ptob(npf)+i < bp->b_bcount && bit > -11) { mpte = mbp->mba_map[npf+btop(byte)]; addr = ptob(mpte.pg_pfnum) + (byte & PGOFSET); putmemc(addr, getmemc(addr)^(mask<hpof |= HPOF_SSEI; mbp->mba_bcr = -(bp->b_bcount - (int)ptob(npf)); break; #ifndef NOBADSECT case BSE: #ifdef HPBDEBUG if (hpbdebug) printf("hpecc, BSE: bn %d cn %d tn %d sn %d\n", bn, cn, tn, sn); #endif if ((bn = isbad(&hpbad[mi->mi_unit], cn, tn, sn)) < 0) return(0); bp->b_flags |= B_BAD; bp->b_error = npf + 1; bn = st->ncyl*st->nspc - st->nsect - 1 - bn; cn = bn/st->nspc; sn = bn%st->nspc; tn = sn/st->nsect; sn %= st->nsect; mbp->mba_bcr = -512; #ifdef HPBDEBUG if (hpbdebug) printf("revector to cn %d tn %d sn %d\n", cn, tn, sn); #endif break; case CONT: #ifdef HPBDEBUG if (hpbdebug) printf("hpecc, CONT: bn %d cn %d tn %d sn %d\n", bn,cn,tn,sn); #endif npf = bp->b_error; bp->b_flags &= ~B_BAD; mbp->mba_bcr = -(bp->b_bcount - (int)ptob(npf)); if ((mbp->mba_bcr & 0xffff) == 0) return(0); break; #endif } rp->hpcs1 = HP_DCLR|HP_GO; if (rp->hpof&HPOF_SSEI) sn++; rp->hpdc = cn; rp->hpda = (tn<<8) + sn; mbp->mba_sr = -1; mbp->mba_var = (int)ptob(npf) + o; rp->hpcs1 = bp->b_flags&B_READ ? HP_RCOM|HP_GO : HP_WCOM|HP_GO; mi->mi_tab.b_errcnt = 0; /* error has been corrected */ return (1); } #define DBSIZE 20 hpdump(dev) dev_t dev; { register struct mba_device *mi; register struct mba_regs *mba; struct hpdevice *hpaddr; char *start; int num, unit; register struct hpst *st; num = maxfree; start = 0; unit = minor(dev) >> 3; if (unit >= NHP) return (ENXIO); #define phys(a,b) ((b)((int)(a)&0x7fffffff)) mi = phys(hpinfo[unit],struct mba_device *); if (mi == 0 || mi->mi_alive == 0) return (ENXIO); mba = phys(mi->mi_hd, struct mba_hd *)->mh_physmba; mba->mba_cr = MBCR_INIT; hpaddr = (struct hpdevice *)&mba->mba_drv[mi->mi_drive]; if ((hpaddr->hpds & HPDS_VV) == 0) { hpaddr->hpcs1 = HP_DCLR|HP_GO; hpaddr->hpcs1 = HP_PRESET|HP_GO; hpaddr->hpof = HPOF_FMT22; } st = &hpst[mi->mi_type]; if (dumplo < 0 || dumplo + num >= st->sizes[minor(dev)&07].nblocks) return (EINVAL); while (num > 0) { register struct pte *hpte = mba->mba_map; register int i; int blk, cn, sn, tn; daddr_t bn; blk = num > DBSIZE ? DBSIZE : num; bn = dumplo + btop(start); cn = bn/st->nspc + st->sizes[minor(dev)&07].cyloff; sn = bn%st->nspc; tn = sn/st->nsect; sn = sn%st->nsect; hpaddr->hpdc = cn; hpaddr->hpda = (tn << 8) + sn; for (i = 0; i < blk; i++) *(int *)hpte++ = (btop(start)+i) | PG_V; mba->mba_sr = -1; mba->mba_bcr = -(blk*NBPG); mba->mba_var = 0; hpaddr->hpcs1 = HP_WCOM | HP_GO; while ((hpaddr->hpds & HPDS_DRY) == 0) ; if (hpaddr->hpds&HPDS_ERR) return (EIO); start += blk*NBPG; num -= blk; } return (0); } #endif @ink"3$}{~4&iU/6i /* flp.c 4.5 81/03/08 */ #if VAX780 #include "../h/flp.h" #include "../h/param.h" #include "../h/systm.h" #include "../h/conf.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/mtpr.h" #include "../h/buf.h" #include "../h/cons.h" #include "../h/cpu.h" struct { short fl_state; /* open and busy flags */ short fl_active; /* driver state flag */ struct buf *fl_buf; /* buffer we're using */ unsigned char *fl_xaddr; /* transfer address */ short fl_errcnt; } fltab; /*ARGSUSED*/ flopen(dev, flag) dev_t dev; int flag; { struct buf *geteblk(); #if VAX750 if (cpu != VAX_780) { u.u_error = ENXIO; return; } #endif if (fltab.fl_state != 0) { u.u_error = ENXIO; return; } fltab.fl_state = FL_OPEN; fltab.fl_buf = geteblk(); fltab.fl_active = FL_IDLE; } /*ARGSUSED*/ flclose(dev, flag) dev_t dev; int flag; { brelse(fltab.fl_buf); fltab.fl_state = 0; } flstrategy(rw) int rw; { register struct buf *bp; register unsigned i; /* * Assume one block read/written for each call - (( * and enforce this by checking for block size of 128. * Use the b_blkno field to address * physical, 128-byte blocks (u.u_offset/128). * This is checked for validity, and is further interpreted as: * * track# * (sectors/track) + sector # */ if (u.u_count == 0) return; (void) spl4(); while (fltab.fl_state & FL_BUSY) sleep((caddr_t)&fltab, PRIBIO); fltab.fl_state |= FL_BUSY; (void) spl0(); bp = fltab.fl_buf; while ((i = min(RXBYSEC, u.u_count)) != 0) { bp->b_blkno = u.u_offset>>7; if (bp->b_blkno >= MAXSEC || (u.u_offset & 0177) != 0) { /* block number out of range */ /* or offset in middle of block */ u.u_error = ENXIO; break; } if (rw == B_WRITE) { iomove(bp->b_un.b_addr, i, B_WRITE); if (u.u_error != 0) break; } bp->b_flags = rw; (void) spl4(); flstart(); while ((bp->b_flags & B_DONE) == 0) sleep((caddr_t)bp, PRIBIO); (void) spl0(); if (bp->b_flags & B_ERROR) { u.u_error = EIO; break; } if (rw == B_READ) { iomove(bp->b_un.b_addr, i, B_READ); if (u.u_error != 0) break; } } u.u_count = bp->b_resid; fltab.fl_state &= ~FL_BUSY; wakeup((caddr_t)&fltab); } /*ARGSUSED*/ flread(dev) dev_t dev; { flstrategy(B_READ); } /*ARGSUSED*/ flwrite(dev) dev_t dev; { flstrategy(B_WRITE); } flstart() { register struct buf *bp; bp = fltab.fl_buf; fltab.fl_active = FL_MAND; fltab.fl_errcnt = 0; fltab.fl_xaddr = (unsigned char *) bp->b_un.b_addr; bp->b_resid = 0; bp->b_bcount = RXBYSEC; /* always transfer a full sector */ if ((mfpr(TXCS) & TXCS_RDY) == 0) /* not ready to receive order */ return; /* * Wake up floppy LSI software with command */ fltab.fl_active = FL_SEC; if ((bp->b_flags&B_READ) == B_READ) mtpr(TXDB, FL_RS); else mtpr(TXDB, FL_WS); } /* * See if we want to transmit something * to the floppy - and do it */ conxfl() { register int databyte; register struct buf *bp; bp = fltab.fl_buf; switch (fltab.fl_active) { case FL_MAND: /* send command */ if ((bp->b_flags&B_READ) == B_READ) mtpr(TXDB,FL_RS); else mtpr(TXDB, FL_WS); fltab.fl_active = FL_SEC; break; case FL_SEC: /* send sector address */ databyte = (int)bp->b_blkno % RXSTRK + 1; mtpr(TXDB, FL_DATA | databyte); fltab.fl_active = FL_TRACK; break; case FL_TRACK: /* send track address */ databyte = (int)bp->b_blkno / RXSTRK; mtpr(TXDB , FL_DATA | databyte); if ((bp->b_flags&B_READ) == B_READ) /* prepare to receive complete */ fltab.fl_active = FL_COM; else /* prepare to send data */ fltab.fl_active = FL_DAX; break; case FL_DAX: databyte = *(fltab.fl_xaddr++); mtpr(TXDB, FL_DATA | databyte); if (--bp->b_bcount == 0) fltab.fl_active = FL_COM; break; case FL_CAN: /* give cancel order */ mtpr(TXDB, FL_CANCEL); if (++fltab.fl_errcnt <= FLERRS) { /* If error count permits, retry order */ fltab.fl_active = FL_MAND; bp->b_bcount = RXBYSEC; fltab.fl_xaddr = (unsigned char *) bp->b_un.b_addr; } else { /* * We're really stupid today - call it an * error and give up */ bp->b_flags |= B_ERROR | B_DONE; bp->b_resid = -RXBYSEC; fltab.fl_active = FL_IDLE; wakeup((caddr_t)bp); } } } cnrfl(c) int c; { register int datum; register struct buf *bp; datum = c; bp = fltab.fl_buf; if (datum == FL_PERR) { /* * Got a protocol error - cancel the * current function and try again if error count isn't * too great. First, though, make sure that an actual * transaction is in progress (so a spurious error from * the LSI won't screw us up too much! */ if (fltab.fl_active != FL_IDLE) fltab.fl_active = FL_CAN; } else switch(fltab.fl_active ) { case FL_DAR: /* expecting a datum */ if ((c&RXDB_ID) != FL_DATA) goto error; *(fltab.fl_xaddr++) = (c & RXDB_DATA); if (--bp->b_bcount==0) { fltab.fl_active = FL_IDLE; bp->b_flags |= B_DONE; wakeup((caddr_t)bp); } break; case FL_COM: /* expecting a "function complete" */ if ((c&RXDB_ID)!= FL_FFC || (c&FL_ERR) == FL_ERR){ error: bp->b_flags |= B_ERROR | B_DONE; bp->b_resid = -bp->b_bcount; fltab.fl_active = FL_IDLE; wakeup((caddr_t)bp); } else if ((bp->b_flags&B_READ) == B_READ) /* got function complete, now get data */ fltab.fl_active = FL_DAR; else { /* got function complete on write - finish up */ fltab.fl_active = FL_IDLE; bp->b_flags |= B_DONE; wakeup((caddr_t)bp); } break; } } #endif @iuk$C9<?BEHKN]1n4&irr /* dh.c 4.39 81/12/07 */ #include "dh.h" #if NDH > 0 /* * DH-11/DM-11 driver */ #include "bk.h" #include "../h/param.h" #include "../h/conf.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/tty.h" #include "../h/map.h" #include "../h/pte.h" #include "../h/buf.h" #include "../h/vm.h" #include "../h/ubareg.h" #include "../h/ubavar.h" #include "../h/bk.h" #include "../h/clist.h" #include "../h/mx.h" #include "../h/file.h" /* * Definition of the driver for the auto-configuration program. * There is one definition for the dh and one for the dm. */ int dhprobe(), dhattach(), dhrint(), dhxint(); struct uba_device *dhinfo[NDH]; u_short dhstd[] = { 0 }; struct uba_driver dhdriver = { dhprobe, 0, dhattach, 0, dhstd, "dh", dhinfo }; int dmprobe(), dmattach(), dmintr(); struct uba_device *dminfo[NDH]; u_short dmstd[] = { 0 }; struct uba_driver dmdriver = { dmprobe, 0, dmattach, 0, dmstd, "dm", dminfo }; struct dhdevice { union { short dhcsr; /* control-status register */ char dhcsrl; /* low byte for line select */ } un; short dhrcr; /* receive character register */ short dhlpr; /* line parameter register */ u_short dhcar; /* current address register */ short dhbcr; /* byte count register */ u_short dhbar; /* buffer active register */ short dhbreak; /* break control register */ short dhsilo; /* silo status register */ }; /* Bits in dhcsr */ #define DH_TI 0100000 /* transmit interrupt */ #define DH_SI 0040000 /* storage interrupt */ #define DH_TIE 0020000 /* transmit interrupt enable */ #define DH_SIE 0010000 /* storage interrupt enable */ #define DH_MC 0004000 /* master clear */ #define DH_NXM 0002000 /* non-existant memory */ #define DH_MM 0001000 /* maintenance mode */ #define DH_CNI 0000400 /* clear non-existant memory interrupt */ #define DH_RI 0000200 /* receiver interrupt */ #define DH_RIE 0000100 /* receiver interrupt enable */ /* Bits in dhlpr */ #define BITS6 01 #define BITS7 02 #define BITS8 03 #define TWOSB 04 #define PENABLE 020 /* DEC manuals incorrectly say this bit causes generation of even parity. */ #define OPAR 040 #define HDUPLX 040000 #define DH_IE (DH_TIE|DH_SIE|DH_RIE) /* Bits in dhrcr */ #define DH_PE 0010000 /* parity error */ #define DH_FE 0020000 /* framing error */ #define DH_DO 0040000 /* data overrun */ struct dmdevice { short dmcsr; /* control status register */ short dmlstat; /* line status register */ short dmpad1[2]; }; /* bits in dm csr */ #define DM_RF 0100000 /* ring flag */ #define DM_CF 0040000 /* carrier flag */ #define DM_CTS 0020000 /* clear to send */ #define DM_SRF 0010000 /* secondary receive flag */ #define DM_CS 0004000 /* clear scan */ #define DM_CM 0002000 /* clear multiplexor */ #define DM_MM 0001000 /* maintenance mode */ #define DM_STP 0000400 /* step */ #define DM_DONE 0000200 /* scanner is done */ #define DM_IE 0000100 /* interrupt enable */ #define DM_SE 0000040 /* scan enable */ #define DM_BUSY 0000020 /* scan busy */ /* bits in dm lsr */ #define DML_RNG 0000200 /* ring */ #define DML_CAR 0000100 /* carrier detect */ #define DML_CTS 0000040 /* clear to send */ #define DML_SR 0000020 /* secondary receive */ #define DML_ST 0000010 /* secondary transmit */ #define DML_RTS 0000004 /* request to send */ #define DML_DTR 0000002 /* data terminal ready */ #define DML_LE 0000001 /* line enable */ #define DML_ON (DML_DTR|DML_RTS|DML_LE) #define DML_OFF (DML_LE) /* * Local variables for the driver */ short dhsar[NDH]; /* software copy of last bar */ short dhsoftCAR[NDH]; struct tty dh11[NDH*16]; int ndh11 = NDH*16; int dhact; /* mask of active dh's */ int dhstart(), ttrstrt(); /* * The clist space is mapped by the driver onto each UNIBUS. * The UBACVT macro converts a clist space address for unibus uban * into an i/o space address for the DMA routine. */ int dh_ubinfo[MAXNUBA]; /* info about allocated unibus map */ int cbase[MAXNUBA]; /* base address in unibus map */ #define UBACVT(x, uban) (cbase[uban] + ((x)-(char *)cfree)) /* * Routine for configur((ation to force a dh to interrupt. * Set to transmit at 9600 baud, and cause a transmitter interrupt. */ /*ARGSUSED*/ dhprobe(reg) caddr_t reg; { register int br, cvec; /* these are ``value-result'' */ register struct dhdevice *dhaddr = (struct dhdevice *)reg; #ifdef lint br = 0; cvec = br; br = cvec; #endif #ifndef notdef dhaddr->un.dhcsr = DH_RIE|DH_MM|DH_RI; DELAY(1000); dhaddr->un.dhcsr = 0; #else dhaddr->un.dhcsr = DH_TIE; DELAY(5); dhaddr->dhlpr = (B9600 << 10) | (B9600 << 6) | BITS7|PENABLE; dhaddr->dhbcr = -1; dhaddr->dhcar = 0; dhaddr->dhbar = 1; DELAY(100000); /* wait 1/10'th of a sec for interrupt */ dhaddr->un.dhcsr = 0; if (cvec && cvec != 0x200) cvec -= 4; /* transmit -> receive */ #endif return (1); } /* * Routine called to attach a dh. */ dhattach(ui) struct uba_device *ui; { dhsoftCAR[ui->ui_unit] = ui->ui_flags; } /* * Configuration routine to cause a dm to interrupt. */ dmprobe(reg) caddr_t reg; { register int br, vec; /* value-result */ register struct dmdevice *dmaddr = (struct dmdevice *)reg; #ifdef lint br = 0; vec = br; br = vec; #endif dmaddr->dmcsr = DM_DONE|DM_IE; DELAY(20); dmaddr->dmcsr = 0; return (1); } /*ARGSUSED*/ dmattach(ui) struct uba_device *ui; { /* no local state to set up */ } /* * Open a DH11 line, mapping the clist onto the uba if this * is the first dh on this uba. Turn on this dh if this is * the first use of it. Also do a dmopen to wait for carrier. */ /*ARGSUSED*/ dhopen(dev, flag) dev_t dev; { register struct tty *tp; register int unit, dh; register struct dhdevice *addr; register struct uba_device *ui; int s; unit = minor(dev); dh = unit >> 4; if (unit >= NDH*16 || (ui = dhinfo[dh])== 0 || ui->ui_alive == 0) { u.u_error = ENXIO; return; } tp = &dh11[unit]; if (tp->t_state&XCLUDE && u.u_uid!=0) { u.u_error = EBUSY; return; } addr = (struct dhdevice *)ui->ui_addr; tp->t_addr = (caddr_t)addr; tp->t_oproc = dhstart; tp->t_iproc = NULL; tp->t_state |= WOPEN; /* * While setting up state for this uba and this dh, * block uba resets which can clear the state. */ s = spl5(); if (dh_ubinfo[ui->ui_ubanum] == 0) { /* 512+ is a kludge to try to get around a hardware problem */ dh_ubinfo[ui->ui_ubanum] = uballoc(ui->ui_ubanum, (caddr_t)cfree, 512+nclist*sizeof(struct cblock), 0); cbase[ui->ui_ubanum] = dh_ubinfo[ui->ui_ubanum]&0x3ffff; } if ((dhact&(1<un.dhcsr |= DH_IE; dhact |= (1<dhsilo = 16; } splx(s); /* * If this is first open, initialze tty state to default. */ if ((tp->t_state&ISOPEN) == 0) { ttychars(tp); if (tp->t_ispeed == 0) { tp->t_ispeed = B300; tp->t_ospeed = B300; tp->t_flags = ODDP|EVENP|ECHO; } dhparam(unit); } /* * Wait for carrier, then process line discipline specific open. */ dmopen(dev); (*linesw[tp->t_line].l_open)(dev, tp); } /* * Close a DH11 line, turning off the DM11. */ /*ARGSUSED*/ dhclose(dev, flag) dev_t dev; int flag; { register struct tty *tp; register unit; unit = minor(dev); tp = &dh11[unit]; (*linesw[tp->t_line].l_close)(tp); ((struct dhdevice *)(tp->t_addr))->dhbreak &= ~(1<<(unit&017)); if (tp->t_state&HUPCLS || (tp->t_state&ISOPEN)==0) dmctl(unit, DML_OFF, DMSET); ttyclose(tp); } dhread(dev) dev_t dev; { register struct tty *tp; tp = &dh11[minor(dev)]; (*linesw[tp->t_line].l_read)(tp); } dhwrite(dev) dev_t dev; { register struct tty *tp; tp = &dh11[minor(dev)]; (*linesw[tp->t_line].l_write)(tp); } /* * DH11 receiver interrupt. */ dhrint(dh) int dh; { register struct tty *tp; register c; register struct dhdevice *addr; register struct tty *tp0; register struct uba_device *ui; int overrun = 0; ui = dhinfo[dh]; if (ui == 0 || ui->ui_alive == 0) return; addr = (struct dhdevice *)ui->ui_addr; tp0 = &dh11[dh<<4]; /* * Loop fetching characters from the silo for this * dh until there are no more in the silo. */ while ((c = addr->dhrcr) < 0) { tp = tp0 + ((c>>8)&0xf); if ((tp->t_state&ISOPEN)==0) { wakeup((caddr_t)tp); continue; } if (c & DH_PE) if ((tp->t_flags&(EVENP|ODDP))==EVENP || (tp->t_flags&(EVENP|ODDP))==ODDP ) continue; if ((c & DH_DO) && overrun == 0) { printf("dh%d: silo overflow\n", dh); overrun = 1; } if (c & DH_FE) /* * At framing error (break) generate * a null (in raw mode, for getty), or a * interrupt (in cooked/cbreak mode). */ if (tp->t_flags&RAW) c = 0; else c = tun.t_intrc; #if NBK > 0 if (tp->t_line == NETLDISC) { c &= 0177; BKINPUT(c, tp); } else #endif (*linesw[tp->t_line].l_rint)(c, tp); } } /* * Ioctl for DH11. */ /*ARGSUSED*/ dhioctl(dev, cmd, addr, flag) caddr_t addr; { register struct tty *tp; register unit = minor(dev); tp = &dh11[unit]; cmd = (*linesw[tp->t_line].l_ioctl)(tp, cmd, addr); if (cmd == 0) return; if (ttioctl(tp, cmd, addr, flag)) { if (cmd==TIOCSETP || cmd==TIOCSETN) dhparam(unit); } else switch(cmd) { case TIOCSBRK: ((struct dhdevice *)(tp->t_addr))->dhbreak |= 1<<(unit&017); break; case TIOCCBRK: ((struct dhdevice *)(tp->t_addr))->dhbreak &= ~(1<<(unit&017)); break; case TIOCSDTR: dmctl(unit, DML_DTR|DML_RTS, DMBIS); break; case TIOCCDTR: dmctl(unit, DML_DTR|DML_RTS, DMBIC); break; default: u.u_error = ENOTTY; } } /* * Set parameters from open or stty into the DH hardware * registers. */ dhparam(unit) register int unit; { register struct tty *tp; register struct dhdevice *addr; register int lpar; int s; tp = &dh11[unit]; addr = (struct dhdevice *)tp->t_addr; /* * Block interrupts so parameters will be set * before the line interrupts. */ s = spl5(); addr->un.dhcsrl = (unit&0xf) | DH_IE; if ((tp->t_ispeed)==0) { tp->t_state |= HUPCLS; dmctl(unit, DML_OFF, DMSET); return; } lpar = ((tp->t_ospeed)<<10) | ((tp->t_ispeed)<<6); if ((tp->t_ispeed) == B134) lpar |= BITS6|PENABLE|HDUPLX; else if ((tp->t_flags&RAW) || (tp->t_local&LLITOUT)) lpar |= BITS8; else lpar |= BITS7|PENABLE; if ((tp->t_flags&EVENP) == 0) lpar |= OPAR; if ((tp->@ik$C9<?BEHKN]1n4&irrt_ospeed) == B110) lpar |= TWOSB; addr->dhlpr = lpar; splx(s); } /* * DH11 transmitter interrupt. * Restart each line which used to be active but has * terminated transmission since the last interrupt. */ dhxint(dh) int dh; { register struct tty *tp; register struct dhdevice *addr; short ttybit, bar, *sbar; register struct uba_device *ui; register int unit; u_short cntr; ui = dhinfo[dh]; addr = (struct dhdevice *)ui->ui_addr; if (addr->un.dhcsr & DH_NXM) { addr->un.dhcsr |= DH_CNI; printf("dh%d: NXM\n", dh); } sbar = &dhsar[dh]; bar = *sbar & ~addr->dhbar; unit = dh * 16; ttybit = 1; addr->un.dhcsr &= (short)~DH_TI; for (; bar; unit++, ttybit <<= 1) { if (bar & ttybit) { *sbar &= ~ttybit; bar &= ~ttybit; tp = &dh11[unit]; tp->t_state &= ~BUSY; if (tp->t_state&FLUSH) tp->t_state &= ~FLUSH; else { addr->un.dhcsrl = (unit&017)|DH_IE; /* * Do arithmetic in a short to make up * for lost 16&17 bits. */ cntr = addr->dhcar - UBACVT(tp->t_outq.c_cf, ui->ui_ubanum); ndflush(&tp->t_outq, (int)cntr); } if (tp->t_line) (*linesw[tp->t_line].l_start)(tp); else dhstart(tp); } } } /* * Start (restart) transmission on the given DH11 line. */ dhstart(tp) register struct tty *tp; { register struct dhdevice *addr; register int car, dh, unit, nch; int s; unit = minor(tp->t_dev); dh = unit >> 4; unit &= 0xf; addr = (struct dhdevice *)tp->t_addr; /* * Must hold interrupts in following code to prevent * state of the tp from changing. */ s = spl5(); /* * If it's currently active, or delaying, no need to do anything. */ if (tp->t_state&(TIMEOUT|BUSY|TTSTOP)) goto out; /* * If there are sleepers, and output has drained below low * water mark, wake up the sleepers. */ if ((tp->t_state&ASLEEP) && tp->t_outq.c_cc<=TTLOWAT(tp)) { tp->t_state &= ~ASLEEP; if (tp->t_chan) mcstart(tp->t_chan, (caddr_t)&tp->t_outq); else wakeup((caddr_t)&tp->t_outq); } /* * Now restart transmission unless the output queue is * empty. */ if (tp->t_outq.c_cc == 0) goto out; if (tp->t_flags&RAW || tp->t_local&LLITOUT) nch = ndqb(&tp->t_outq, 0); else { nch = ndqb(&tp->t_outq, 0200); /* * If first thing on queue is a delay process it. */ if (nch == 0) { nch = getc(&tp->t_outq); timeout(ttrstrt, (caddr_t)tp, (nch&0x7f)+6); tp->t_state |= TIMEOUT; goto out; } } /* * If characters to transmit, restart transmission. */ if (nch) { car = UBACVT(tp->t_outq.c_cf, dhinfo[dh]->ui_ubanum); addr->un.dhcsrl = unit|((car>>12)&0x30)|DH_IE; /* * The following nonsense with short word * is to make sure the dhbar |= word below * is done with an interlocking bisw2 instruction. */ { short word = 1 << unit; dhsar[dh] |= word; addr->dhcar = car; addr->dhbcr = -nch; addr->dhbar |= word; } tp->t_state |= BUSY; } out: splx(s); } /* * Stop output on a line, e.g. for ^S/^Q or output flush. */ /*ARGSUSED*/ dhstop(tp, flag) register struct tty *tp; { registe((r struct dhdevice *addr; register int unit, s; addr = (struct dhdevice *)tp->t_addr; /* * Block input/output interrupts while messing with state. */ s = spl5(); if (tp->t_state & BUSY) { /* * Device is transmitting; stop output * by selecting the line and setting the byte * count to -1. We will clean up later * by examining the address where the dh stopped. */ unit = minor(tp->t_dev); addr->un.dhcsrl = (unit&017) | DH_IE; if ((tp->t_state&TTSTOP)==0) tp->t_state |= FLUSH; addr->dhbcr = -1; } splx(s); } /* * Reset state of driver if UBA reset was necessary. * Reset the csrl and lpr registers on open lines, and * restart transmitters. */ dhreset(uban) int uban; { register int dh, unit; register struct tty *tp; register struct uba_device *ui; int i; if (dh_ubinfo[uban] == 0) return; ubarelse(uban, &dh_ubinfo[uban]); dh_ubinfo[uban] = uballoc(uban, (caddr_t)cfree, 512+nclist*sizeof (struct cblock), 0); cbase[uban] = dh_ubinfo[uban]&0x3ffff; dh = 0; for (dh = 0; dh < NDH; dh++) { ui = dhinfo[dh]; if (ui == 0 || ui->ui_alive == 0 || ui->ui_ubanum != uban) continue; printf(" dh%d", dh); ((struct dhdevice *)ui->ui_addr)->un.dhcsr |= DH_IE; ((struct dhdevice *)ui->ui_addr)->dhsilo = 16; unit = dh * 16; for (i = 0; i < 16; i++) { tp = &dh11[unit]; if (tp->t_state & (ISOPEN|WOPEN)) { dhparam(unit); dmctl(unit, DML_ON, DMSET); tp->t_state &= ~BUSY; dhstart(tp); } unit++; } } dhtimer(); } /* * At software clock interrupt time or after a UNIBUS reset * empty all the dh silos. */ dhtimer() { register int dh; for (dh = 0; dh < NDH; dh++) dhrint(dh); } /* * Turn on the line associated with dh dev. */ dmopen(dev) dev_t dev; { register struct tty *tp; register struct dmdevice *addr; register struct uba_device *ui; register int unit; register int dm; int s; unit = minor(dev); dm = unit >> 4; tp = &dh11[unit]; unit &= 0xf; if (dm >= NDH || (ui = dminfo[dm]) == 0 || ui->ui_alive == 0 || (dhsoftCAR[dm]&(1<t_state |= CARR_ON; return; } addr = (struct dmdevice *)ui->ui_addr; s = spl5(); addr->dmcsr &= ~DM_SE; while (addr->dmcsr & DM_BUSY) ; addr->dmcsr = unit; addr->dmlstat = DML_ON; if (addr->dmlstat&DML_CAR) tp->t_state |= CARR_ON; addr->dmcsr = DM_IE|DM_SE; while ((tp->t_state&CARR_ON)==0) sleep((caddr_t)&tp->t_rawq, TTIPRI); splx(s); } /* * Dump control bits into the DM registers. */ dmctl(dev, bits, how) dev_t dev; int bits, how; { register struct uba_device *ui; register struct dmdevice *addr; register int unit, s; int dm; unit = minor(dev); dm = unit >> 4; if ((ui = dminfo[dm]) == 0 || ui->ui_alive == 0) return; addr = (struct dmdevice *)ui->ui_addr; s = spl5(); addr->dmcsr &= ~DM_SE; while (addr->dmcsr & DM_BUSY) ; addr->dmcsr = unit & 0xf; switch(how) { case DMSET: addr->dmlstat = bits; break; case DMBIS: addr->dmlstat |= bits; break; case DMBIC: addr->dmlstat &= ~bits; break; } addr->dmcsr = DM_IE|DM_SE; splx(s); } /* * DM11 interrupt; deal with carrier transitions. */ dmintr(dm) register int dm; { register struct uba_device *ui; register struct tty *tp; register struct dmdevice *addr; ui = dminfo[dm]; if (ui == 0) return; addr = (struct dmdevice *)ui->ui_addr; if (addr->dmcsr&DM_DONE) { if (addr->dmcsr&DM_CF) { tp = &dh11[(dm<<4)+(addr->dmcsr&0xf)]; wakeup((caddr_t)&tp->t_rawq); if ((tp->t_state&WOPEN)==0 && (tp->t_local&LMDMBUF)) { if (addr->dmlstat & DML_CAR) { tp->t_state &= ~TTSTOP; ttstart(tp); } else if ((tp->t_state&TTSTOP) == 0) { tp->t_state |= TTSTOP; dhstop(tp, 0); } } else if ((addr->dmlstat&DML_CAR)==0) { if ((tp->t_state&WOPEN)==0 && (tp->t_local&LNOHANG)==0) { gsignal(tp->t_pgrp, SIGHUP); gsignal(tp->t_pgrp, SIGCONT); addr->dmlstat = 0; flushtty(tp, FREAD|FWRITE); } tp->t_state &= ~CARR_ON; } else tp->t_state |= CARR_ON; } addr->dmcsr = DM_IE|DM_SE; } } #endif @ik28$ TWZ3&iU/6i /* dsort.c 4.3 81/03/08 */ /* * Seek sort for disks. We depend on the driver * which calls us using b_resid as the current cylinder number. * * The argument dp structure holds a b_actf activity chain pointer * on which we keep two queues, sorted in ascending cylinder order. * The first queue holds those requests which are positioned after * the current cylinder (in the first request); the second holds * requests which came in after their cylinder number was passed. * Thus we implement a one way scan, retracting after reaching the * end of the drive to the first request on the second queue, * at which time it becomes the first queue. * * A one-way scan is natural because of the way UNIX read-ahead * blocks are allocated. */ #include "../h/param.h" #include "../h/systm.h" #include "../h/buf.h" #define b_cylin b_resid disksort(dp, bp) register struct buf *dp, *bp; { register struct buf *ap; /* * If nothing on the activity queue, then * we become the only thing. */ ap = dp->b_actf; if(ap == NULL) { dp->b_actf = bp; dp->b_actl = bp; bp->av_forw = NULL; return; } /* * If we lie after the first (currently active) * request, then we must locate the second request list * and add ourselves to it. */ if (bp->b_cylin < ap->b_cylin) { while (ap->av_forw) { /* * Check for an ``inversion'' in the * normally ascending cylinder numbers, * indicating the start of the second request list. */ if (ap->av_forw->b_cylin < ap->b_cylin) { /* * Search the second request list * for the first request at a larger * cylinder number. We go before that; * if there is no such request, we go at end. */ do { if (bp->b_cylin < ap->av_forw->b_cylin) goto insert; ap = ap->av_forw; } while (ap->av_forw); goto insert; /* after last */ } ap = ap->av_forw; } /* * No inversions... we will go after the last, and * be the first request in the second request list. */ goto insert; } /* * Request is at/after the current request... * sort in the first request list. */ while (ap->av_forw) { /* * We want to go after the current request * if there is an inversion after it (i.e. it is * the end of the first request list), or if * the next request is a larger cylinder than our request. */ if (ap->av_forw->b_cylin < ap->b_cylin || bp->b_cylin < ap->av_forw->b_cylin) goto insert; ap = ap->av_forw; } /* * Neither a second list nor a larger * request... we go at the end of the first list, * which is the same as the end of the whole schebang. */ insert: bp->av_forw = ap->av_forw; ap->av_forw = bp; if (ap == dp->b_actl) dp->b_actl = bp; } @ikh㍥$Q3&iU/6i /* dkleave.c 4.2 81/03/08 */ #ifdef INTRLVE #include "../h/param.h" #include "../h/buf.h" daddr_t dkblock(bp) register struct buf *bp; { register int dminor; if (((dminor=minor(bp->b_dev))&0100) == 0) return(bp->b_blkno); dminor >>= 3; dminor &= 07; dminor++; return(bp->b_blkno/dminor); } dkunit(bp) register struct buf *bp; { register int dminor; dminor = minor(bp->b_dev) >> 3; if ((dminor&010) == 0) return(dminor); dminor &= 07; dminor++; return(bp->b_blkno%dminor); } #endif ((@ik:$%'!$'*-0363&i6i /* dz.c 4.29 81/08/31 */ #include "dz.h" #if NDZ > 0 /* * DZ-11 Driver * * This driver mimics dh.c; see it for explanation of common code. */ #include "bk.h" #include "../h/param.h" #include "../h/systm.h" #include "../h/tty.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/map.h" #include "../h/pte.h" #include "../h/buf.h" #include "../h/vm.h" #include "../h/ubavar.h" #include "../h/conf.h" #include "../h/pdma.h" #include "../h/bk.h" #include "../h/file.h" #include "../h/mx.h" /* * Driver information for auto-configuration stuff. */ int dzprobe(), dzattach(), dzrint(); struct uba_device *dzinfo[NDZ]; u_short dzstd[] = { 0 }; struct uba_driver dzdriver = { dzprobe, 0, dzattach, 0, dzstd, "dz", dzinfo }; #define NDZLINE (NDZ*8) /* * Registers and bits */ /* Bits in dzlpr */ #define BITS7 020 #define BITS8 030 #define TWOSB 040 #define PENABLE 0100 #define OPAR 0200 /* Bits in dzrbuf */ #define DZ_PE 010000 #define DZ_FE 020000 #define DZ_DO 040000 /* Bits in dzcsr */ #define DZ_CLR 020 /* Reset dz */ #define DZ_MSE 040 /* Master Scan Enable */ #define DZ_RIE 0100 /* Receiver Interrupt Enable */ #define DZ_SAE 010000 /* Silo Alarm Enable */ #define DZ_TIE 040000 /* Transmit Interrupt Enable */ #define DZ_IEN (DZ_MSE|DZ_RIE|DZ_TIE|DZ_SAE) /* Flags for modem-control */ #define DZ_ON 1 #define DZ_OFF 0 int dzstart(), dzxint(), dzdma(); int ttrstrt(); struct tty dz_tty[NDZLINE]; int dz_cnt = { NDZLINE }; int dzact; struct device { short dzcsr; /* control-status register */ short dzrbuf; /* receiver buffer */ #define dzlpr dzrbuf /* line parameter reg is write of dzrbuf */ char dztcr; /* transmit control register */ char dzdtr; /* data terminal ready */ char dztbuf; /* transmit buffer */ char dzbrk; /* break control */ #define dzmsr dzbrk /* modem status register */ }; /* * Software copy of dzbrk since it isn't readable */ char dz_brk[NDZ]; char dzsoftCAR[NDZ]; /* * The dz doesn't interrupt on carrier transitions, so * we have to use a timer to watch it. */ char dz_timer; /* timer started? */ /* * Pdma structures for fast output code */ struct pdma dzpdma[NDZLINE]; char dz_speeds[] = { 0,020,021,022,023,024,0,025,026,027,030,032,034,036,0,0 }; dzprobe(reg) caddr_t reg; { register int br, cvec; register struct device *dzaddr = (struct device *)reg; #ifdef lint br = 0; cvec = br; br = cvec; #endif dzaddr->dzcsr = DZ_TIE|DZ_MSE; dzaddr->dztcr = 1; /* enable any line */ DELAY(100000); dzaddr->dzcsr = DZ_CLR; /* reset everything */ if (cvec && cvec != 0x200) cvec -= 4; return (1); } dzattach(ui) register struct uba_device *ui; { register struct pdma *pdp = &dzpdma[ui->ui_unit*8]; register struct tty *tp = &dz_tty[ui->ui_unit*8]; register int cntr; extern dzscan(); for (cntr = 0; cntr < 8; cntr++) { pdp->p_addr = (struct device *)ui->ui_addr; pdp->p_arg = (int)tp; pdp->p_fcn = dzxint; pdp++, tp++; } dzsoftCAR[ui->ui_unit] = ui->ui_flags; if (dz_timer == 0) { dz_timer++; timeout(dzscan, (caddr_t)0, hz); } } /*ARGSUSED*/ dzopen(dev, flag) dev_t dev; { register struct tty *tp; register int unit; unit = minor(dev); if (unit >= dz_cnt || dzpdma[unit].p_addr == 0) { u.u_error = ENXIO; return; } tp = &dz_tty[unit]; tp->t_addr = (caddr_t)&dzpdma[unit]; tp->t_oproc = dzstart; tp->t_iproc = NULL; tp->t_state |= WOPEN; if ((tp->t_state & ISOPEN) == 0) { ttychars(tp); tp->t_ospeed = tp->t_ispeed = B300; tp->t_flags = ODDP|EVENP|ECHO; /* tp->t_state |= HUPCLS; */ dzparam(unit); } else if (tp->t_state&XCLUDE && u.u_uid != 0) { u.u_error = EBUSY; return; } dzmodem(unit, DZ_ON); (void) spl5(); while ((tp->t_state & CARR_ON) == 0) { tp->t_state |= WOPEN; sleep((caddr_t)&tp->t_rawq, TTIPRI); } (void) spl0(); (*linesw[tp->t_line].l_open)(dev, tp); } /*ARGSUSED*/ dzclose(dev, flag) dev_t dev; { register struct tty *tp; register int unit; int dz; unit = minor(dev); dz = unit >> 3; tp = &dz_tty[unit]; (*linesw[tp->t_line].l_close)(tp); ((struct pdma *)(tp->t_addr))->p_addr->dzbrk = (dz_brk[dz] &= ~(1 << (unit&07))); if (tp->t_state & HUPCLS) dzmodem(unit, DZ_OFF); ttyclose(tp); } dzread(dev) dev_t dev; { register struct tty *tp; tp = &dz_tty[minor(dev)]; (*linesw[tp->t_line].l_read)(tp); } dzwrite(dev) dev_t dev; { register struct tty *tp; tp = &dz_tty[minor(dev)]; (*linesw[tp->t_line].l_write)(tp); } /*ARGSUSED*/ dzrint(dz) int dz; { register struct tty *tp; register int c; register struct device *dzaddr; register struct tty *tp0; register int unit; int overrun = 0; if ((dzact & (1<dzrbuf) < 0) { /* char present */ tp = tp0 + ((c>>8)&07); if (tp >= &dz_tty[dz_cnt]) continue; if ((tp->t_state & ISOPEN) == 0) { wakeup((caddr_t)&tp->t_rawq); continue; } if (c&DZ_FE) if (tp->t_flags & RAW) c = 0; else c = tun.t_intrc; if (c&DZ_DO && overrun == 0) { printf("dz%d: silo overflow\n", dz); overrun = 1; } if (c&DZ_PE) if (((tp->t_flags & (EVENP|ODDP)) == EVENP) || ((tp->t_flags & (EVENP|ODDP)) == ODDP)) continue; #if NBK > 0 if (tp->t_line == NETLDISC) { c &= 0177; BKINPUT(c, tp); } else #endif (*linesw[tp->t_line].l_rint)(c, tp); } } /*ARGSUSED*/ dzioctl(dev, cmd, addr, flag) dev_t dev; caddr_t addr; { register struct tty *tp; register int unit = minor(dev); register int dz = unit >> 3; tp = &dz_tty[unit]; cmd = (*linesw[tp->t_line].l_ioctl)(tp, cmd, addr); if (cmd == 0) return; if (ttioctl(tp, cmd, addr, flag)) { if (cmd==TIOCSETP || cmd==TIOCSETN) dzparam(unit); } else switch(cmd) { case TIOCSBRK: ((struct pdma *)(tp->t_addr))->p_addr->dzbrk = (dz_brk[dz] |= 1 << (unit&07)); break; case TIOCCBRK: ((struct pdma *)(tp->t_addr))->p_addr->dzbrk = (dz_brk[dz] &= ~(1 << (unit&07))); break; case TIOCSDTR: dzmodem(unit, DZ_ON); break; case TIOCCDTR: dzmodem(unit, DZ_OFF); break; default: u.u_error = ENOTTY; } } dzparam(unit) register int unit; { register struct tty *tp; register struct device *dzaddr; register int lpr; tp = &dz_tty[unit]; dzaddr = dzpdma[unit].p_addr; dzaddr->dzcsr = DZ_IEN; dzact |= (1<<(unit>>3)); if (tp->t_ispeed == 0) { dzmodem(unit, DZ_OFF); /* hang up line */ return; } lpr = (dz_speeds[tp->t_ispeed]<<8) | (unit & 07); if ((tp->t_local&LLITOUT) || (tp->t_flags&RAW)) lpr |= BITS8; else lpr |= (BITS7|PENABLE); if ((tp->t_flags & EVENP) == 0) lpr |= OPAR; if (tp->t_ispeed == B110) lpr |= TWOSB; dzaddr->dzlpr = lpr; } dzxint(tp) register struct tty *tp; { register struct pdma *dp; register s; s = spl5(); /* block pdma interrupts */ dp = (struct pdma *)tp->t_addr; tp->t_state &= ~BUSY; if (tp->t_state & FLUSH) tp->t_state &= ~FLUSH; else ndflush(&tp->t_outq, dp->p_mem-tp->t_outq.c_cf); if (tp->t_line) (*linesw[tp->t_line].l_start)(tp); else dzstart(tp); if (tp->t_outq.c_cc == 0 || (tp->t_state&BUSY)==0) dp->p_addr->dztcr &= ~(1 << (minor(tp->t_dev)&07)); splx(s); } dzstart(tp) register struct tty *tp; { register struct pdma *dp; register struct device *dzaddr; register int cc; int s; dp = (struct pdma *)tp->t_addr; dzaddr = dp->p_addr; s = spl5(); if (tp->t_state & (TIMEOUT|BUSY|TTSTOP)) goto out; if (tp->t_state&ASLEEP && tp->t_outq.c_cc <= TTLOWAT(tp)) { tp->t_state &= ~ASLEEP; if (tp->t_chan) mcstart(tp->t_chan, (caddr_t)&tp->t_outq); else wakeup((caddr_t)&tp->t_outq); } if (tp->t_outq.c_cc == 0) goto out; if (tp->t_flags&RAW || tp->t_local&LLITOUT) cc = ndqb(&tp->t_outq, 0); else { cc = ndqb(&tp->t_outq, 0200); if (cc == 0) { cc = getc(&tp->t_outq); timeout(ttrstrt, (caddr_t)tp, (cc&0x7f) + 6); tp->t_state |= TIMEOUT; goto out; } } tp->t_state |= BUSY; dp->p_end = dp->p_mem = tp->t_outq.c_cf; dp->p_end += cc; dzaddr->dztcr |= 1 << (minor(tp->t_dev) & 07); /* force intr */ out: splx(s); } /* * Stop output on a line. */ /*ARGSUSED*/ dzstop(tp, flag) register struct tty *tp; { register struct pdma *dp; register int s; dp = (struct pdma *)tp->t_addr; s = spl5(); if (tp->t_state & BUSY) { dp->p_end = dp->p_mem; if ((tp->t_state&TTSTOP)==0) tp->t_state |= FLUSH; } splx(s); } dzmodem(unit, flag) register int unit; { register struct device *dzaddr; register char bit; dzaddr = dzpdma[unit].p_addr; bit = 1<<(unit&07); if (flag == DZ_OFF) dzaddr->dzdtr &= ~bit; else dzaddr->dzdtr |= bit; } dzscan() { register i; register struct device *dzaddr; register bit; register struct tty *tp; for (i = 0; i < dz_cnt ; i++) { dzaddr = dzpdma[i].p_addr; if (dzaddr == 0) continue; tp = &dz_tty[i]; bit = 1<<(i&07); if ((dzsoftCAR[i>>3]&bit) || (dzaddr->dzmsr&bit)) { /* carrier present */ if ((tp->t_state & CARR_ON) == 0) { wakeup((caddr_t)&tp->t_rawq); tp->t_state |= CARR_ON; } } else { if ((tp->t_state&CARR_ON) && (tp->t_local&LNOHANG)==0) { /* carrier lost */ if (tp->t_state&ISOPEN) { gsignal(tp->t_pgrp, SIGHUP); gsignal(tp->t_pgrp, SIGCONT); (( dzaddr->dzdtr &= ~bit; flushtty(tp, FREAD|FWRITE); } tp->t_state &= ~CARR_ON; } } } timeout(dzscan, (caddr_t)0, 2*hz); } dztimer() { int dz; for (dz = 0; dz < NDZ; dz++) dzrint(dz); } /* * Reset state of driver if UBA reset was necessary. * Reset parameters and restart transmission on open lines. */ dzreset(uban) int uban; { register int unit; register struct tty *tp; register struct uba_device *ui; for (unit = 0; unit < NDZLINE; unit++) { ui = dzinfo[unit >> 3]; if (ui == 0 || ui->ui_ubanum != uban || ui->ui_alive == 0) continue; if (unit%8 == 0) printf(" dz%d", unit>>3); tp = &dz_tty[unit]; if (tp->t_state & (ISOPEN|WOPEN)) { dzparam(unit); dzmodem(unit, DZ_ON); tp->t_state &= ~BUSY; dzstart(tp); } } dztimer(); } #endif @ik"by$ 3&i6i /* ct.c 4.6 81/07/05 */ #include "ct.h" #if NCT > 0 /* * GP DR11C driver used for C/A/T * * BUGS: * This driver hasn't been tested in 4.1bsd */ #include "../h/param.h" #include "../h/systm.h" #include "../h/tty.h" #include "../h/pte.h" #include "../h/map.h" #include "../h/buf.h" #include "../h/ubareg.h" #include "../h/ubavar.h" #include "../h/conf.h" #include "../h/dir.h" #include "../h/user.h" #define PCAT (PZERO+9) #define CATHIWAT 100 #define CATLOWAT 30 struct ct_softc { int sc_openf; struct clist sc_oq; } ct_softc[NCT]; struct ctdevice { short ctcsr; short ctbuf; }; int ctprobe(), ctattach(), ctintr(); struct uba_device *ctdinfo[NCT]; u_short ctstd[] = { 0 }; struct uba_driver ctdriver = { ctprobe, 0, ctattach, 0, ctstd, "ct", ctdinfo }; #define CTUNIT(dev) (minor(dev)) ctprobe(reg) caddr_t reg; { register int br, cvec; /* value-result */ register struct ctdevice *ctaddr = (struct ctdevice *)reg; ctaddr->ctcsr = IENABLE; DELAY(10000); ctaddr->ctcsr = 0; } /*ARGSUSED*/ ctattach(ui) register struct uba_device *ui; { } ctopen(dev) dev_t dev; { register struct ct_softc *sc; register struct uba_device *ui; register struct ctdevice *ctaddr; if (CTUNIT(dev) >= NCT || (ui = ctdinfo[CTUNIT(dev)]) == 0 || ui->ui_alive == 0 || (sc = &ct_softc[CTUNIT(dev)])->sc_openf) { u.u_error = ENXIO; return; } sc->sc_openf = 1; ctaddr->ctcsr |= IENABLE; } ctclose(dev) dev_t dev; { ct_softc[CTUNIT(dev)].sc_openf = 0; ctintr(dev); } ctwrite(dev) dev_t dev; { register struct ct_softc *sc = &ct_softc[CTUNIT(dev)]; register int c; while ((c=cpass()) >= 0) { (void) spl5(); while (sc->sc_oq.c_cc > CATHIWAT) sleep((caddr_t)&sc->sc_oq, PCAT); while (putc(c, &sc->sc_oq) < 0) sleep((caddr_t)&lbolt, PCAT); ctintr(dev); (void) spl0(); } } ctintr(dev) dev_t dev; { register int c; register struct ct_softc *sc = &ct_softc[CTUNIT(dev)]; register struct ctdevice *ctaddr = (struct ctdevice *)ctdinfo[CTUNIT(dev)]->ui_addr; if (ctaddr->ctcsr&DONE) { if ((c = getc(&sc->sc_oq)) >= 0) { #if MH135A c |= (c & 01) << 8; /* for dr11c bug */ #endif ctaddr->ctbuf = c; if (sc->sc_oq.c_cc==0 || sc->sc_oq.c_cc==CATLOWAT) wakeup(&sc->sc_oq); } else { if (sc->sc_openf==0) ctaddr->ctcsr = 0; } } } #endif @ik=$Y   3&i.m.m /* cons.c 4.11 81/12/03 */ /* * VAX console driver and floppy interface */ #include "../h/param.h" #include "../h/conf.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/tty.h" #include "../h/systm.h" #include "../h/cons.h" #include "../h/mtpr.h" #include "../h/mx.h" #include "../h/cpu.h" struct tty cons; int cnstart(); int ttrstrt(); char partab[]; /*ARGSUSED*/ cnopen(dev, flag) dev_t dev; { register struct tty *tp; tp = &cons; tp->t_oproc = cnstart; tp->t_iproc = NULL; if ((tp->t_state&ISOPEN) == 0) { ttychars(tp); tp->t_state = ISOPEN|CARR_ON; tp->t_flags = EVENP|ECHO|XTABS|CRMOD; } if (tp->t_state&XCLUDE && u.u_uid != 0) { u.u_error = EBUSY; return; } mtpr(RXCS, mfpr(RXCS)|RXCS_IE); mtpr(TXCS, mfpr(TXCS)|TXCS_IE); (*linesw[tp->t_line].l_open)(dev, tp); } /*ARGSUSED*/ cnclose(dev) dev_t dev; { register struct tty *tp; tp = &cons; (*linesw[tp->t_line].l_close)(tp); ttyclose(tp); } /*ARGSUSED*/ cnread(dev) dev_t dev; { register struct tty *tp; tp = &cons; (*linesw[tp->t_line].l_read)(tp); } /*ARGSUSED*/ cnwrite(dev) dev_t dev; { register struct tty *tp; tp = &cons; (*linesw[tp->t_line].l_write)(tp); } /* * Got a level-20 receive interrupt - * the LSI wants to give us a character. * Catch the character, and see who it goes to. */ /*ARGSUSED*/ cnrint(dev) dev_t dev; { register int c; register struct tty *tp; c = mfpr(RXDB); if (c&RXDB_ID) { #if VAX780 if (cpu == VAX_780) cnrfl(c); #endif return; } tp = &cons; (*linesw[tp->t_line].l_rint)(c, tp); } /*ARGSUSED*/ cnioctl(dev, cmd, addr, flag) dev_t dev; caddr_t addr; { register struct tty *tp; tp = &cons; cmd = (*linesw[tp->t_line].l_ioctl)(tp, cmd, addr); if (cmd == 0) return; if (ttioctl(tp, cmd, addr, flag) == 0) u.u_error = ENOTTY; } int consdone = 1; /* * Got a level-20 transmission interrupt - * the LSI wants another character. First, * see if we can send something to the typewriter. * If not, try the floppy. */ /*ARGSUSED*/ cnxint(dev) dev_t dev; { register struct tty *tp; consdone++; tp = &cons; tp->t_state &= ~BUSY; if (tp->t_line) (*linesw[tp->t_line].l_start)(tp); else cnstart(tp); #if VAX780 if (cpu==VAX_780 && (tp->t_state & BUSY) == 0) conxfl(); #endif } cnstart(tp) register struct tty *tp; { register c; register s; s = spl5(); if (tp->t_state & (TIMEOUT|BUSY|TTSTOP)) goto out; if (tp->t_state&ASLEEP && tp->t_outq.c_cc <= TTLOWAT(tp)) { tp->t_state &= ~ASLEEP; if (tp->t_chan) mcstart(tp->t_chan, (caddr_t)&tp->t_outq); else wakeup((caddr_t)&tp->t_outq); } if (tp->t_outq.c_cc == 0) goto out; if (consdone == 0) return; c = getc(&tp->t_outq); if (tp->t_flags&RAW || tp->t_local&LLITOUT) mtpr(TXDB, c&0xff); else if (c<=0177) mtpr(TXDB, (c | (partab[c]&0200))&0xff); else { timeout(ttrstrt, (caddr_t)tp, (c&0177)); tp->t_state |= TIMEOUT; goto out; } consdone = 0; tp->t_state |= BUSY; out: splx(s); } /* * Print a character on console. * Attempts to save and restore device * status. */ cnputc(c) register c; { register s, timo; timo = 30000; /* * Try waiting for the console tty to come ready, * otherwise give up after a reasonable time. */ while((mfpr(TXCS)&TXCS_RDY) == 0) if(--timo == 0) break; if(c == 0) return; s = mfpr(TXCS); mtpr(TXCS, 0); mtpr(TXDB, c&0xff); if(c == '\n') cnputc('\r'); cnputc(0); mtpr(TXCS, s); } ((@ikJ$_#c3&i /* conf.c 4.40- 81/11/11 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/buf.h" #include "../h/tty.h" #include "../h/conf.h" #include "../h/text.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/file.h" #include "../h/inode.h" #include "../h/acct.h" #include "../h/pte.h" int nulldev(); int nodev(); #include "hp.h" #if NHP > 0 int hpstrategy(),hpread(),hpwrite(),hpintr(),hpdump(); #else #define hpstrategy nodev #define hpread nodev #define hpwrite nodev #define hpintr nodev #define hpdump nodev #endif #include "tu.h" #if NHT > 0 int htopen(),htclose(),htstrategy(),htread(),htwrite(),htdump(),htioctl(); #else #define htopen nodev #define htclose nodev #define htstrategy nodev #define htread nodev #define htwrite nodev #define htdump nodev #define htioctl nodev #endif #include "rk.h" #if NHK > 0 int rkstrategy(),rkread(),rkwrite(),rkintr(),rkdump(),rkreset(); #else #define rkstrategy nodev #define rkread nodev #define rkwrite nodev #define rkintr nodev #define rkdump nodev #define rkreset nodev #endif #include "te.h" #if NTE > 0 int tmopen(),tmclose(),tmstrategy(),tmread(),tmwrite(); int tmioctl(),tmdump(),tmreset(); #else #define tmopen nodev #define tmclose nodev #define tmstrategy nodev #define tmread nodev #define tmwrite nodev #define tmioctl nodev #define tmdump nodev #define tmreset nodev #endif #include "ts.h" #if NTS > 0 int tsopen(),tsclose(),tsstrategy(),tsread(),tswrite(); int tsioctl(),tsdump(),tsreset(); #else #define tsopen nodev #define tsclose nodev #define tsstrategy nodev #define tsread nodev #define tswrite nodev #define tsioctl nodev #define tsdump nodev #define tsreset nodev #endif #include "mu.h" #if NMT > 0 int mtopen(),mtclose(),mtstrategy(),mtread(),mtwrite(); int mtioctl(),mtdump(); #else #define mtopen nodev #define mtclose nodev #define mtstrategy nodev #define mtread nodev #define mtwrite nodev #define mtioctl nodev #define mtdump nodev #endif #include "ra.h" #if NUDA > 0 int udopen(),udstrategy(),udread(),udwrite(),udreset(),uddump(); #else #define udopen nodev #define udstrategy nodev #define udread nodev #define udwrite nodev #define udreset nulldev #define uddump nodev #endif #include "up.h" #if NSC > 0 int upstrategy(),upread(),upwrite(),upreset(),updump(); #else #define upstrategy nodev #define upread nodev #define upwrite nodev #define upreset nulldev #define updump nodev #endif #if defined(VAX750) || defined(VAX7ZZ) int tuopen(),tuclose(),tustrategy(); #else #define tuopen nodev #define tuclose nodev #define tustrategy nodev #endif int swstrategy(),swread(),swwrite(); struct bdevsw bdevsw[] = { nulldev, nulldev, hpstrategy, hpdump, 0, /*0*/ htopen, htclose, htstrategy, htdump, B_TAPE, /*1*/ nulldev, nulldev, upstrategy, updump, 0, /*2*/ nulldev, nulldev, rkstrategy, rkdump, 0, /*3*/ nodev, nodev, swstrategy, nodev, 0, /*4*/ tmopen, tmclose, tmstrategy, tmdump, B_TAPE, /*5*/ tsopen, tsclose, tsstrategy, tsdump, B_TAPE, /*6*/ mtopen, mtclose, mtstrategy, mtdump, B_TAPE, /*7*/ tuopen, tuclose, tustrategy, nodev, B_TAPE, /*8*/ udopen, nulldev, udstrategy, uddump, 0, /*9*/ nodev, nodev, nodev, nodev, 0, /*10*/ 0, }; int cnopen(),cnclose(),cnread(),cnwrite(),cnioctl(); struct tty cons; #include "ct.h" #if NCT > 0 int ctopen(),ctclose(),ctwrite(); #else #define ctopen nulldev #define ctclose nulldev #define ctwrite nulldev #endif #include "dh.h" #if NDH == 0 #define dhopen nodev #define dhclose nodev #define dhread nodev #define dhwrite nodev #define dhioctl nodev #define dhstop nodev #define dhreset nulldev #define dh11 0 #else int dhopen(),dhclose(),dhread(),dhwrite(),dhioctl(),dhstop(),dhreset(); struct tty dh11[]; #endif #if VAX780 int flopen(),flclose(),flread(),flwrite(); #endif #include "dz.h" #if NDZ == 0 #define dzopen nodev #define dzclose nodev #define dzread nodev #define dzwrite nodev #define dzioctl nodev #define dzstop nodev #define dzreset nulldev #define dz_tty 0 #else int dzopen(),dzclose(),dzread(),dzwrite(),dzioctl(),dzstop(),dzreset(); struct tty dz_tty[]; #endif #include "lp.h" #if NLP > 0 int lpopen(),lpclose(),lpwrite(),lpreset(); #else #define lpopen nodev #define lpclose nodev #define lpwrite nodev #define lpreset nulldev #endif int syopen(),syread(),sywrite(),syioctl(); int mmread(),mmwrite(); #include "va.h" #if NVA > 0 int vaopen(),vaclose(),vawrite(),vaioctl(),vareset(); #else #define vaopen nodev #define vaclose nodev #define vawrite nodev #define vaopen nodev #define vaioctl nodev #define vareset nulldev #endif #include "vp.h" #if NVP > 0 int vpopen(),vpclose(),vpwrite(),vpioctl(),vpreset(); #else #define vpopen nodev #define vpclose nodev #define vpwrite nodev #define vpioctl nodev #define vpreset nulldev #endif int mxopen(),mxclose(),mxread(),mxwrite(),mxioctl(); int mcread(); char *mcwrite(); #include "pty.h" #if NPTY > 0 int ptsopen(), ptsclose(), ptsread(), ptswrite(); int ptcopen(), ptcclose(), ptcread(), ptcwrite(); int ptyioctl(); struct tty pt_tty[]; #else #define ptsopen nodev #define ptsclose nodev #define ptsread nodev #define ptswrite nodev #define ptcopen nodev #define ptcclose nodev #define ptcread nodev #define ptcwrite nodev #define ptyioctl nodev #define pt_tty 0 #endif #include "dn.h" #if NDN > 0 int dnopen(), dnclose(), dnwrite(); #else #define dnopen nodev #define dnclose nodev #define dnwrite nodev #endif struct cdevsw cdevsw[] = { cnopen, cnclose, cnread, cnwrite, /*0*/ cnioctl, nulldev, nulldev, &cons, dzopen, dzclose, dzread, dzwrite, /*1*/ dzioctl, dzstop, dzreset, dz_tty, syopen, nulldev, syread, sywrite, /*2*/ syioctl, nulldev, nulldev, 0, nulldev, nulldev, mmread, mmwrite, /*3*/ nodev, nulldev, nulldev, 0, nulldev, nulldev, hpread, hpwrite, /*4*/ nodev, nodev, nulldev, 0, htopen, htclose, htread, htwrite, /*5*/ htioctl, nodev, nulldev, 0, vpopen, vpclose, nodev, vpwrite, /*6*/ vpioctl, nulldev, vpreset, 0, nulldev, nulldev, swread, swwrite, /*7*/ nodev, nodev, nulldev, 0, #if VAX780 flopen, flclose, flread, flwrite, /*8*/ nodev, nodev, nulldev, 0, #else nodev, nodev, nodev, nodev, /*8*/ nodev, nodev, nodev, 0, #endif mxopen, mxclose, mxread, mxwrite, /*9*/ mxioctl, nulldev, nulldev, 0, vaopen, vaclose, nodev, vawrite, /*10*/ vaioctl, nulldev, vareset, 0, nulldev, nulldev, rkread, rkwrite, /*11*/ nodev, nodev, rkreset, 0, dhopen, dhclose, dhread, dhwrite, /*12*/ dhioctl, dhstop, dhreset, dh11, nulldev, nulldev, upread, upwrite, /*13*/ nodev, nodev, upreset, 0, tmopen, tmclose, tmread, tmwrite, /*14*/ tmioctl, nodev, tmreset, 0, lpopen, lpclose, nodev, lpwrite, /*15*/ nodev, nodev, lpreset, 0, tsopen, tsclose, tsread, tswrite, /*16*/ tsioctl, nodev, tsreset, 0, nodev, nodev, nodev, nodev, /*17*/ nodev, nodev, nulldev, 0, ctopen, ctclose, nodev, ctwrite, /*18*/ nodev, nodev, nulldev, 0, mtopen, mtclose, mtread, mtwrite, /*19*/ mtioctl, nodev, nodev, 0, ptsopen, ptsclose, ptsread, ptswrite, /*20*/ ptyioctl, nulldev, nodev, pt_tty, ptcopen, ptcclose, ptcread, ptcwrite, /*21*/ ptyioctl, nulldev, nodev, pt_tty, dnopen, dnclose, nodev, dnwrite, /*22*/ nodev, nodev, nodev, 0, nodev, nodev, nodev, nodev, /*23*/ nodev, nodev, nodev, 0, udopen, nulldev, udread, udwrite, /*24*/ nodev, nodev, udreset, 0, nodev, nodev, nodev, nodev, /*25*/ nodev, nodev, nodev, 0, /* 25-29 reserved to local sites */ 0, }; int ttyopen(),ttread(),nullioctl(),ttstart(); char *ttwrite(); int ttyinput(),ttyrend(); #include "bk.h" #if NBK > 0 int bkopen(),bkclose(),bkread(),bkinput(),bkioctl(); #endif int ntyopen(),ntyclose(),ntread(); char *ntwrite(); int ntyinput(),ntyrend(); struct linesw linesw[] = { ttyopen, nulldev, ttread, ttwrite, nullioctl, ttyinput, ttyrend, nulldev, nulldev, nulldev, /* 0 */ #if NBK > 0 bkopen, bkclose, bkread, ttwrite, bkioctl, bkinput, nodev, nulldev, ttstart, nulldev, /* 1 */ #else nodev, nodev, nodev, (char *(*)())nodev, nodev, nodev, nodev, nodev, nodev, nodev, #endif ntyopen, ntyclose, ntread, ntwrite, nullioctl, ntyinput, ntyrend, nulldev, ttstart, nulldev, /* 2 */ mxopen, mxclose, mcread, mcwrite, mxioctl, nulldev, nulldev, nulldev, nulldev, nulldev, /* 3 */ 0 }; int nldisp = 3; struct buf bfreelist[BQUEUES]; /* buffer chain headers */ struct buf bswlist; /* free list of swap headers */ struct buf *bclnlist; /* header for list of cleaned pages */ struct acct acctbuf; struct inode *acctp; int mem_no = 3; /* major device number of memory special file */ /* * Swapdev is a fake device implemented * in sw.c used only internally to get to swstrategy. * It cannot be provided to the users, because the * swstrategy routine munches the b_dev and b_blkno entries * before calling the appropriate driver. This would horribly * confuse, e.g. the hashing routines. Instead, /dev/drum is * provided as a character (raw) device. */ dev_t swapdev = makedev(4, 0); extern struct user u; ((@ikꎩ$3&iS/6i /* bk.c 4.6 81/03/11 */ #include "bk.h" #if NBK > 0 #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/tty.h" #include "../h/proc.h" #include "../h/mx.h" #include "../h/inode.h" #include "../h/file.h" #include "../h/conf.h" #include "../h/buf.h" /* * Line discipline for Berkeley network. * * This supplies single lines to a user level program * with a minimum of fuss. Lines are newline terminated. * * This discipline requires that tty device drivers call * the line specific l_ioctl routine from their ioctl routines, * assigning the result to cmd so that we can refuse most tty specific * ioctls which are unsafe because we have ambushed the * teletype input queues, overlaying them with other information. */ /* * Open as networked discipline. Called when discipline changed * with ioctl, this assigns a buffer to the line for input, and * changing the interpretation of the information in the tty structure. */ /*ARGSUSED*/ bkopen(dev, tp) dev_t dev; register struct tty *tp; { register struct buf *bp; if (u.u_error) return; /* paranoia */ if (tp->t_line == NETLDISC) { u.u_error = EBUSY; /* sometimes the network */ return; /* ... opens /dev/tty */ } bp = geteblk(); flushtty(tp, FREAD|FWRITE); tp->t_bufp = bp; tp->t_cp = (char *)bp->b_un.b_addr; tp->t_inbuf = 0; tp->t_rec = 0; } /* * Break down... called when discipline changed or from device * close routine. */ bkclose(tp) register struct tty *tp; { register s; s = spl5(); wakeup((caddr_t)&tp->t_rawq); if (tp->t_bufp) { brelse(tp->t_bufp); tp->t_bufp = 0; } else printf("bkclose: no buf\n"); tp->t_cp = 0; tp->t_inbuf = 0; tp->t_rec = 0; tp->t_line = 0; /* paranoid: avoid races */ splx(s); } /* * Read from a network line. * Characters have been buffered in a system buffer and are * now dumped back to the user in one fell swoop, and with a * minimum of fuss. Note that no input is accepted when a record * is waiting. Our clearing tp->t_rec here allows further input * to accumulate. */ bkread(tp) register struct tty *tp; { register int i; register s; if ((tp->t_state&CARR_ON)==0) return (-1); s = spl5(); while (tp->t_rec == 0 && tp->t_line == NETLDISC) sleep((caddr_t)&tp->t_rawq, TTIPRI); splx(s); if (tp->t_line != NETLDISC) return (-1); i = MIN(tp->t_inbuf, (int)u.u_count); if (copyout(tp->t_bufp->b_un.b_addr, u.u_base, (unsigned)i)) { u.u_error = EFAULT; return (-1); } u.u_count -= i; u.u_base += i; u.u_offset += i; tp->t_cp = (char *)tp->t_bufp->b_un.b_addr; tp->t_inbuf = 0; tp->t_rec = 0; return (0); } /* * Low level character input routine. * Stuff the character in the buffer, and wake up the top * half after setting t_rec if this completes the record * or if the buffer is (ick!) full. * * Thisis where the formatting should get done to allow * 8 character data paths through escapes. * * This rutine should be expanded in-line in the receiver * interrupt routine of the dh-11 to make it run as fast as possible. */ bkinput(c, tp) register c; register struct tty *tp; { if (tp->t_rec) return; *tp->t_cp++ = c; if (++tp->t_inbuf == BSIZE || c == '\n') { tp->t_rec = 1; wakeup((caddr_t)&tp->t_rawq); } } /* * This routine is called whenever a ioctl is about to be performed * and gets a chance to reject the ioctl. We reject all teletype * oriented ioctl's except those which set the discipline, and * those which get parameters (gtty and get special characters). */ /*ARGSUSED*/ bkioctl(tp, cmd, addr) struct tty *tp; caddr_t addr; { if ((cmd>>8) != 't') return (cmd); switch (cmd) { case TIOCSETD: case TIOCGETD: case TIOCGETP: case TIOCGETC: return (cmd); } u.u_error = ENOTTY; return (0); } #endif @ik8$D2&iRP6i /* bio.c 4.23 81/07/25 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/buf.h" #include "../h/conf.h" #include "../h/proc.h" #include "../h/seg.h" #include "../h/pte.h" #include "../h/vm.h" #include "../h/trace.h" /* * The following several routines allocate and free * buffers with various side effects. In general the * arguments to an allocate routine are a device and * a block number, and the value is a pointer to * to the buffer header; the buffer is marked "busy" * so that no one else can touch it. If the block was * already in core, no I/O need be done; if it is * already busy, the process waits until it becomes free. * The following routines allocate a buffer: * getblk * bread * breada * baddr (if it is incore) * Eventually the buffer must be released, possibly with the * side effect of writing it out, by using one of * bwrite * bdwrite * bawrite * brelse */ struct buf bfreelist[BQUEUES]; struct buf bswlist, *bclnlist; #define BUFHSZ 63 struct bufhd bufhash[BUFHSZ]; #define BUFHASH(dev, dblkno) \ ((struct buf *)&bufhash[((int)(dev)+(int)(dblkno)) % BUFHSZ]) /* * Initialize hash links for buffers. */ bhinit() { register int i; register struct bufhd *bp; for (bp = bufhash, i = 0; i < BUFHSZ; i++, bp++) bp->b_forw = bp->b_back = (struct buf *)bp; } /* #define DISKMON 1 */ #ifdef DISKMON struct { int nbuf; long nread; long nreada; long ncache; long nwrite; long bufcount[64]; } io_info; #endif /* * Swap IO headers - * They contain the necessary information for the swap I/O. * At any given time, a swap header can be in three * different lists. When free it is in the free list, * when allocated and the I/O queued, it is on the swap * device list, and finally, if the operation was a dirty * page push, when the I/O completes, it is inserted * in a list of cleaned pages to be processed by the pageout daemon. */ struct buf *swbuf; short *swsize; /* CAN WE JUST USE B_BCOUNT? */ int *swpf; #ifndef UNFAST #define notavail(bp) \ { \ int s = spl6(); \ (bp)->av_back->av_forw = (bp)->av_forw; \ (bp)->av_forw->av_back = (bp)->av_back; \ (bp)->b_flags |= B_BUSY; \ splx(s); \ } #endif /* * Read in (if necessary) the block and return a buffer pointer. */ struct buf * bread(dev, blkno) dev_t dev; daddr_t blkno; { register struct buf *bp; bp = getblk(dev, blkno); if (bp->b_flags&B_DONE) { #ifdef TRACE trace(TR_BREADHIT, dev, blkno); #endif #ifdef DISKMON io_info.ncache++; #endif return(bp); } bp->b_flags |= B_READ; bp->b_bcount = BSIZE; (*bdevsw[major(dev)].d_strategy)(bp); #ifdef TRACE trace(TR_BREADMISS, dev, blkno); #endif #ifdef DISKMON io_info.nread++; #endif u.u_vm.vm_inblk++; /* pay for read */ iowait(bp); return(bp); } /* * Read in the block, like bread, but also start I/O on the * read-ahead block (which is not allocated to the caller) */ struct buf * breada(dev, blkno, rablkno) dev_t dev; daddr_t blkno, rablkno; { register struct buf *bp, *rabp; bp = NULL; if (!incore(dev, blkno)) { bp = getblk(dev, blkno); if ((bp->b_flags&B_DONE) == 0) { bp->b_flags |= B_READ; bp->b_bcount = BSIZE; (*bdevsw[major(dev)].d_strategy)(bp); #ifdef TRACE trace(TR_BREADMISS, dev, blkno); #endif #ifdef DISKMON io_info.nread++; #endif u.u_vm.vm_inblk++; /* pay for read */ } #ifdef TRACE else trace(TR_BREADHIT, dev, blkno); #endif } if (rablkno && !incore(dev, rablkno)) { rabp = getblk(dev, rablkno); if (rabp->b_flags & B_DONE) { brelse(rabp); #ifdef TRACE trace(TR_BREADHITRA, dev, blkno); #endif } else { rabp->b_flags |= B_READ|B_ASYNC; rabp->b_bcount = BSIZE; (*bdevsw[major(dev)].d_strategy)(rabp); #ifdef TRACE trace(TR_BREADMISSRA, dev, rablock); #endif #ifdef DISKMON io_info.nreada++; #endif u.u_vm.vm_inblk++; /* pay in advance */ } } if(bp == NULL) return(bread(dev, blkno)); iowait(bp); return(bp); } /* * Write the buffer, waiting for completion. * Then release the buffer. */ bwrite(bp) register struct buf *bp; { reg((ister flag; flag = bp->b_flags; bp->b_flags &= ~(B_READ | B_DONE | B_ERROR | B_DELWRI | B_AGE); bp->b_bcount = BSIZE; #ifdef DISKMON io_info.nwrite++; #endif if ((flag&B_DELWRI) == 0) u.u_vm.vm_oublk++; /* noone paid yet */ #ifdef TRACE trace(TR_BWRITE, bp->b_dev, bp->b_blkno); #endif (*bdevsw[major(bp->b_dev)].d_strategy)(bp); if ((flag&B_ASYNC) == 0) { iowait(bp); brelse(bp); } else if (flag & B_DELWRI) bp->b_flags |= B_AGE; else geterror(bp); } /* * Release the buffer, marking it so that if it is grabbed * for another purpose it will be written out before being * given up (e.g. when writing a partial block where it is * assumed that another write for the same block will soon follow). * This can't be done for magtape, since writes must be done * in the same order as requested. */ bdwrite(bp) register struct buf *bp; { register int flags; if ((bp->b_flags&B_DELWRI) == 0) u.u_vm.vm_oublk++; /* noone paid yet */ flags = bdevsw[major(bp->b_dev)].d_flags; if(flags & B_TAPE) bawrite(bp); else { bp->b_flags |= B_DELWRI | B_DONE; brelse(bp); } } /* * Release the buffer, start I/O on it, but don't wait for completion. */ bawrite(bp) register struct buf *bp; { bp->b_flags |= B_ASYNC; bwrite(bp); } /* * release the buffer, with no I/O implied. */ brelse(bp) register struct buf *bp; { register struct buf *flist; register s; if (bp->b_flags&B_WANTED) wakeup((caddr_t)bp); if (bfreelist[0].b_flags&B_WANTED) { bfreelist[0].b_flags &= ~B_WANTED; wakeup((caddr_t)bfreelist); } if (bp->b_flags&B_ERROR) if (bp->b_flags & B_LOCKED) bp->b_flags &= ~B_ERROR; /* try again later */ else bp->b_dev = NODEV; /* no assoc */ s = spl6(); if (bp->b_flags & (B_ERROR|B_INVAL)) { /* block has no info ... put at front of most free list */ flist = &bfreelist[BQUEUES-1]; flist->av_forw->av_back = bp; bp->av_forw = flist->av_forw; flist->av_forw = bp; bp->av_back = flist; } else { if (bp->b_flags & B_LOCKED) flist = &bfreelist[BQ_LOCKED]; else if (bp->b_flags & B_AGE) flist = &bfreelist[BQ_AGE]; else flist = &bfreelist[BQ_LRU]; flist->av_back->av_forw = bp; bp->av_back = flist->av_back; flist->av_back = bp; bp->av_forw = flist; } bp->b_flags &= ~(B_WANTED|B_BUSY|B_ASYNC|B_AGE); splx(s); } /* * See if the block is associated with some buffer * (mainly to avoid getting hung up on a wait in breada) */ incore(dev, blkno) dev_t dev; daddr_t blkno; { register struct buf *bp; register struct buf *dp; register int dblkno = fsbtodb(blkno); dp = BUFHASH(dev, dblkno); for (bp = dp->b_forw; bp != dp; bp = bp->b_forw) if (bp->b_blkno == dblkno && bp->b_dev == dev && !(bp->b_flags & B_INVAL)) return (1); return (0); } struct buf * baddr(dev, blkno) dev_t dev; daddr_t blkno; { if (incore(dev, blkno)) return (bread(dev, blkno)); return (0); } /* * Assign a buffer for the given block. If the appropriate * block is already associated, return it; otherwise search * for the oldest non-busy buffer and reassign it. */ struct buf * getblk(dev, blkno) dev_t dev; daddr_t blkno; { register struct buf *bp, *dp, *ep; register int dblkno = fsbtodb(blkno); #ifdef DISKMON register int i; #endif if ((unsigned)blkno >= 1 << (sizeof(int)*NBBY-PGSHIFT)) blkno = 1 << ((sizeof(int)*NBBY-PGSHIFT) + 1); dblkno = fsbtodb(blkno); dp = BUFHASH(dev, dblkno); loop: (void) spl0(); for (bp = dp->b_forw; bp != dp; bp = bp->b_forw) { if (bp->b_blkno != dblkno || bp->b_dev != dev || bp->b_flags&B_INVAL) continue; (void) spl6(); if (bp->b_flags&B_BUSY) { bp->b_flags |= B_WANTED; sleep((caddr_t)bp, PRIBIO+1); goto loop; } (void) spl0(); #ifdef DISKMON i = 0; dp = bp->av_forw; while ((dp->b_flags & B_HEAD) == 0) { i++; dp = dp->av_forw; } if (i<64) io_info.bufcount[i]++; #endif notavail(bp); bp->b_flags |= B_CACHE; return(bp); } if (major(dev) >= nblkdev) panic("blkdev"); (void) spl6(); for (ep = &bfreelist[BQUEUES-1]; ep > bfreelist; ep--) if (ep->av_forw != ep) break; if (ep == bfreelist) { /* no free blocks at all */ ep->b_flags |= B_WANTED; sleep((caddr_t)ep, PRIBIO+1); goto loop; } (void) spl0(); bp = ep->av_forw; notavail(bp); if (bp->b_flags & B_DELWRI) { bp->b_flags |= B_ASYNC; bwrite(bp); goto loop; } #ifdef TRACE trace(TR_BRELSE, bp->b_dev, bp->b_blkno); #endif bp->b_flags = B_BUSY; bp->b_back->b_forw = bp->b_forw; bp->b_forw->b_back = bp->b_back; bp->b_forw = dp->b_forw; bp->b_back = dp; dp->b_forw->b_back = bp; dp->b_forw = bp; bp->b_dev = dev; bp->b_blkno = dblkno; return(bp); } /* * get an empty block, * not assigned to any particular device */ struct buf * geteblk() { register struct buf *bp, *dp; loop: (void) spl6(); for (dp = &bfreelist[BQUEUES-1]; dp > bfreelist; dp--) if (dp->av_forw != dp) break; if (dp == bfreelist) { /* no free blocks */ dp->b_flags |= B_WANTED; sleep((caddr_t)dp, PRIBIO+1); goto loop; } (void) spl0(); bp = dp->av_forw; notavail(bp); if (bp->b_flags & B_DELWRI) { bp->b_flags |= B_ASYNC; bwrite(bp); goto loop; } #ifdef TRACE trace(TR_BRELSE, bp->b_dev, bp->b_blkno); #endif bp->b_flags = B_BUSY|B_INVAL; bp->b_back->b_forw = bp->b_forw; bp->b_forw->b_back = bp->b_back; bp->b_forw = dp->b_forw; bp->b_back = dp; dp->b_forw->b_back = bp; dp->b_forw = bp; bp->b_dev = (dev_t)NODEV; return(bp); } /* * Wait for I/O completion on the buffer; return errors * to the user. */ iowait(bp) register struct buf *bp; { (void) spl6(); while ((bp->b_flags&B_DONE)==0) sleep((caddr_t)bp, PRIBIO); (void) spl0(); geterror(bp); } #ifdef UNFAST /* * Unlink a buffer from the available list and mark it busy. * (internal interface) */ notavail(bp) register struct buf *bp; { register s; s = spl6(); bp->av_back->av_forw = bp->av_forw; bp->av_forw->av_back = bp->av_back; bp->b_flags |= B_BUSY; splx(s); } #endif /* * Mark I/O complete on a buffer. If the header * indicates a dirty page push completion, the * header is inserted into the ``cleaned'' list * to be processed by the pageou@ik8$D2&iRP6it daemon. Otherwise * release it if I/O is asynchronous, and wake * up anyone waiting for it. */ iodone(bp) register struct buf *bp; { register int s; if (bp->b_flags & B_DONE) panic("dup iodone"); bp->b_flags |= B_DONE; if (bp->b_flags & B_DIRTY) { if (bp->b_flags & B_ERROR) panic("IO err in push"); s = spl6(); bp->av_forw = bclnlist; bp->b_bcount = swsize[bp - swbuf]; bp->b_pfcent = swpf[bp - swbuf]; cnt.v_pgout++; cnt.v_pgpgout += bp->b_bcount / NBPG; bclnlist = bp; if (bswlist.b_flags & B_WANTED) wakeup((caddr_t)&proc[2]); splx(s); return; } if (bp->b_flags&B_ASYNC) brelse(bp); else { bp->b_flags &= ~B_WANTED; wakeup((caddr_t)bp); } } /* * Zero the core associated with a buffer. */ clrbuf(bp) struct buf *bp; { register *p; register c; p = bp->b_un.b_words; c = BSIZE/sizeof(int); do *p++ = 0; while (--c); bp->b_resid = 0; } /* * swap I/O - * * If the flag indicates a dirty page push initiated * by the pageout daemon, we map the page into the i th * virtual page of process 2 (the daemon itself) where i is * the index of the swap header that has been allocated. * We simply initialize the header and queue the I/O but * do not wait for completion. When the I/O completes, * iodone() will link the header to a list of cleaned * pages to be processed by the pageout daemon. */ swap(p, dblkno, addr, nbytes, rdflg, flag, dev, pfcent) struct proc *p; swblk_t dblkno; caddr_t addr; int flag, nbytes; dev_t dev; unsigned pfcent; { register struct buf *bp; register int c; int p2dp; register struct pte *dpte, *vpte; (void) spl6(); while (bswlist.av_forw == NULL) { bswlist.b_flags |= B_WANTED; sleep((caddr_t)&bswlist, PSWP+1); } bp = bswlist.av_forw; bswlist.av_forw = bp->av_forw; (void) spl0(); bp->b_flags = B_BUSY | B_PHYS | rdflg | flag; if ((bp->b_flags & (B_DIRTY|B_PGIN)) == 0) if (rdflg == B_READ) sum.v_pswpin += btoc(nbytes); else sum.v_pswpout += btoc(nbytes); bp->b_proc = p; if (flag & B_DIRTY) { p2dp = ((bp - swbuf) * CLSIZE) * KLMAX; dpte = dptopte(&proc[2], p2dp); vpte = vtopte(p, btop(addr)); for (c = 0; c < nbytes; c += NBPG) { if (vpte->pg_pfnum == 0 || vpte->pg_fod) panic("swap bad pte"); *dpte++ = *vpte++; } bp->b_un.b_addr = (caddr_t)ctob(p2dp); } else bp->b_un.b_addr = addr; while (nbytes > 0) { c = imin(ctob(120), nbytes); bp->b_bcount = c; bp->b_blkno = dblkno; bp->b_dev = dev; if (flag & B_DIRTY) { swpf[bp - swbuf] = pfcent; swsize[bp - swbuf] = nbytes; } #ifdef TRACE trace(TR_SWAPIO, dev, bp->b_blkno); #endif (*bdevsw[major(dev)].d_strategy)(bp); if (flag & B_DIRTY) { if (c < nbytes) panic("big push"); return; } (void) spl6(); while((bp->b_flags&B_DONE)==0) sleep((caddr_t)bp, PSWP); (void) spl0(); bp->b_un.b_addr += c; bp->b_flags &= ~B_DONE; if (bp->b_flags & B_ERROR) { if ((flag & (B_UAREA|B_PAGET)) || rdflg == B_WRITE) panic("hard IO err in swap"); swkill(p, (char *)0); } nbytes -= c; dblkno += btoc(c); } (((void) spl6(); bp->b_flags &= ~(B_BUSY|B_WANTED|B_PHYS|B_PAGET|B_UAREA|B_DIRTY); bp->av_forw = bswlist.av_forw; bswlist.av_forw = bp; if (bswlist.b_flags & B_WANTED) { bswlist.b_flags &= ~B_WANTED; wakeup((caddr_t)&bswlist); wakeup((caddr_t)&proc[2]); } (void) spl0(); } /* * If rout == 0 then killed on swap error, else * rout is the name of the routine where we ran out of * swap space. */ swkill(p, rout) struct proc *p; char *rout; { char *mesg; printf("pid %d: ", p->p_pid); if (rout) printf(mesg = "killed due to no swap space\n"); else printf(mesg = "killed on swap error\n"); uprintf("sorry, pid %d was %s", p->p_pid, mesg); /* * To be sure no looping (e.g. in vmsched trying to * swap out) mark process locked in core (as though * done by user) after killing it so noone will try * to swap it out. */ psignal(p, SIGKILL); p->p_flag |= SULOCK; } /* * make sure all write-behind blocks * on dev (or NODEV for all) * are flushed out. * (from umount and update) */ bflush(dev) dev_t dev; { register struct buf *bp; register struct buf *flist; loop: (void) spl6(); for (flist = bfreelist; flist < &bfreelist[BQUEUES]; flist++) for (bp = flist->av_forw; bp != flist; bp = bp->av_forw) { if (bp->b_flags&B_DELWRI && (dev == NODEV||dev==bp->b_dev)) { bp->b_flags |= B_ASYNC; notavail(bp); bwrite(bp); goto loop; } } (void) spl0(); } /* * Raw I/O. The arguments are * The strategy routine for the device * A buffer, which will always be a special buffer * header owned exclusively by the device for this purpose * The device number * Read/write flag * Essentially all the work is computing physical addresses and * validating them. * If the user has the proper access privilidges, the process is * marked 'delayed unlock' and the pages involved in the I/O are * faulted and locked. After the completion of the I/O, the above pages * are unlocked. */ physio(strat, bp, dev, rw, mincnt) int (*strat)(); register struct buf *bp; unsigned (*mincnt)(); { register int c; char *a; if (useracc(u.u_base,u.u_count,rw==B_READ?B_WRITE:B_READ) == NULL) { u.u_error = EFAULT; return; } (void) spl6(); while (bp->b_flags&B_BUSY) { bp->b_flags |= B_WANTED; sleep((caddr_t)bp, PRIBIO+1); } bp->b_error = 0; bp->b_proc = u.u_procp; bp->b_un.b_addr = u.u_base; while (u.u_count != 0) { bp->b_flags = B_BUSY | B_PHYS | rw; bp->b_dev = dev; bp->b_blkno = u.u_offset >> PGSHIFT; bp->b_bcount = u.u_count; (*mincnt)(bp); c = bp->b_bcount; u.u_procp->p_flag |= SPHYSIO; vslock(a = bp->b_un.b_addr, c); (*strat)(bp); (void) spl6(); while ((bp->b_flags&B_DONE) == 0) sleep((caddr_t)bp, PRIBIO); vsunlock(a, c, rw); u.u_procp->p_flag &= ~SPHYSIO; if (bp->b_flags&B_WANTED) wakeup((caddr_t)bp); (void) spl0(); bp->b_un.b_addr += c; u.u_count -= c; u.u_offset += c; if (bp->b_flags&B_ERROR) break; } bp->b_flags &= ~(B_BUSY|B_WANTED|B_PHYS); u.u_count = bp->b_resid; geterror(bp); } /*ARGSUSED*/ unsigned minphys(bp) struct buf *bp; { if (bp->b_bcount > 60 * 1024) bp->b_bcount = 60 * 1024; } /* * Pick up the device's error number and pass it to the user; * if there is an error but the number is 0 set a generalized * code. Actually the latter is always true because devices * don't yet return specific errors. */ geterror(bp) register struct buf *bp; { if (bp->b_flags&B_ERROR) if ((u.u_error = bp->b_error)==0) u.u_error = EIO; } /* * Invalidate in core blocks belonging to closed or umounted filesystem * * This is not nicely done at all - the buffer ought to be removed from the * hash chains & have its dev/blkno fields clobbered, but unfortunately we * can't do that here, as it is quite possible that the block is still * being used for i/o. Eventually, all disc drivers should be forced to * have a close routine, which ought ensure that the queue is empty, then * properly flush the queues. Until that happy day, this suffices for * correctness. ... kre */ binval(dev) dev_t dev; { register struct buf *bp; register struct bufhd *hp; #define dp ((struct buf *)hp) for (hp = bufhash; hp < &bufhash[BUFHSZ]; hp++) for (bp = dp->b_forw; bp != dp; bp = bp->b_forw) if (bp->b_dev == dev) bp->b_flags |= B_INVAL; } @ikn$:&i@96i /* vaxcpu.c 4.5 81/04/13 */ #include "../h/param.h" #include "../h/pte.h" #include "../h/ubareg.h" #include "../h/nexus.h" #include "../h/cpu.h" /* * Initialization of per-cpu data structures. */ /* * These are the (fixed) addresses of the (last 8k bytes of) * unibus memory for each of the possible unibus adapters. Note that the * unibus memory addresses are actually indexed by the unibus adapter type code. */ #if VAX780 caddr_t umaddr780[4] = { (caddr_t) UMEM780(0), (caddr_t) UMEM780(1), (caddr_t) UMEM780(2), (caddr_t) UMEM780(3) }; #endif #if VAX750 caddr_t umaddr750[2] = { (caddr_t) UMEM750(0), (caddr_t) UMEM750(1), }; #endif #if VAX7ZZ caddr_t umaddr7ZZ[1] = { (caddr_t) UMEM7ZZ }; #endif /* * Information to patch around the stupidity of configuration * registers not returning types on some of the processors. */ #if VAX750 short nexty750[NNEX750] = { NEX_MEM16, NEX_MEM16, NEX_MEM16, NEX_MEM16, NEX_MBA, NEX_MBA, NEX_MBA, NEX_MBA, NEX_UBA0, NEX_UBA1, NEX_ANY, NEX_ANY, NEX_ANY, NEX_ANY, NEX_ANY, NEX_ANY }; #endif #if VAX7ZZ short nexty7ZZ[NNEX7ZZ] = { NEX_MEM16, NEX_ANY, NEX_ANY, NEX_ANY, NEX_ANY, NEX_ANY, NEX_ANY, NEX_ANY, }; #endif struct percpu percpu[] = { #if VAX780 VAX_780, NNEX780, NEX780, umaddr780, NBDP780, 1, 0, #endif #if VAX750 VAX_750, NNEX750, NEX750, umaddr750, NBDP750, 0, nexty750, #endif #if VAX7ZZ VAX_7ZZ, NNEX7ZZ, NEX7ZZ, umaddr7ZZ, NBDP7ZZ, 0, nexty7ZZ, #endif 0, }; @ik-W J kh  T7((=^[[PPZZYՊZiZZ Yk"Pz^642ZYZmPZP2PjYi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}`ЬPݠ}`Ѭ1ЭP PP(ЭPݠݭЭPЭQPЭP .ЭP ݠݭЭP V~ݭ^^}nZޭP Q}`aPݭvPݭvPЬPP>ELSzݬ慎ݏ^}nV~ݭ@BDVPqP5ݏFVPqPÅݏGPVPPjPPnPVPdPVRbPRvR1`$^ЬP`&}`ЬPݠ}`ݭ:ݭ0ЭPݠJ*PЭPݠ8*PPPP~8PЭPݠݭ7ЭPݠ~7^}n}`ЭPЭܠЭP ^}nޭPYQ}`aOP^ЬP`﬑ }@ЬP`'}`& ^}n-ЬPݠ}`ޭPQ}`aP^ЬP@<7ЬP`}` ЬP@^}nЬP@_ЬPݠ{}` ЬP@̼^}nvЬPݠD}`ޭPBQ}`a8P4P^ݬݬ}`ЬPՠ;ЭPݠ؄^}nPQ}`aPЬPݠݠЭPݠޭP ^ЬP`}`ݭP[^}nЬPѠ׏ GP`Y-ЬPݠO}`ݭu`Y^}nTЬPРݭЭP ЭP ^ЭQPԭY 1ԭ0ЭPݠp7~ݭP߭kk[k k k k1֭[[k k  k kkkݭd߭'ݭ1P1tЭPݠݭ'$pP~1kk1֭[ k k [kPPYkkݭ߭'ݭPЭPݠݭ#pP~ЭPݠp8~ݭP߭k1t}`ЭP nPЭRvPޭPQ}`aP^ЬP`n}`^}ntЬPݠ#ЬPѠ留 ^}nOЬPݠ}`ޭP3Q}`a)P^ЬP`}`VN0}>^}nЬPݠ}`ʑ ޭPQ}`aP^}n1l^ЬP`V^}`nmЬPѠ社:ݠ1}`VN0}>^}n%ЬPݠ }`ʑ ޭPQ}`aP^}nЬPݠ1F^ЬP`РЭP ݽkݏЭPРԭѭ2CЭP@zݽݭЬPݠ8}`葭,((&}*~ޭPRQ}`aHP⑭֑^}nЭPРխ֭1i^ЬPP&`4flݬݏޭPQ}`aPЬP``t}`ݭ8jPG|^ЬP`ݠ/}`ѭݭOPn"nPv1ѭFݭpP~*ݭpP~ZݭpP~\vP7ѭݭ|jPPѭѭݭ~ݏ^}n}`V~ݭvޭPQ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m_`cdeZ[\]7b!#7" %&_`cdeZ[\]7!#"+ %&b7y!#53"_` %&!"7 %&!#" %&7!#" %&77!#53"!#" %&*7 %&7!#" %&7!#" %&7y7!#!#"" %& %&77!#r"!#s" %& %&J!#!#"qr"s %& %&!#"!#" %&q %&!#" %&!#!#"" %& %&!#!#"" %& %&nopm!#"6 %&66PQ6nopm666666664NO66S666666646{|}~4a6664:H666644644u4v444466444HH44444444$IHFE 9/z)JJMCA#h85""rt5OC(MJ34/z)'! JJJ~B//sF9(}|{8C6z-4&y1xv      {{/(0845 7-+IJ1<2KL;{./{,:9(+-*/%IJ-((((([}&'(){!#$}@=>?^$())))),,(((}}{/;BCD)),,,]"}9|(02)2./));%},),)));2;)))))BuC<uDEFGP7 !"JgA`auug8 GFE56%HI1234tggmuJJfhg g>@RSTUVW^+_,-./09#ijlnoqrgceg=uQYZ[\$KLMg;psNOgX]k:bd; ;?')*  vgg;&(;g;gygxwyacc stack overflowsyntax errorbailing out$zero&null$record$record$record$recordillegal statement>># >:>;>>>>>>>>>>>>>>9>9>9>9>9>>9>9>9>9>9>9>9>9>9>9>9>>!> >>#;>UP((OUUYXYWYNMINFNGNCNBNENLNAN?NNHNDN=<  "99999999999&92999999999 QTRSV@KK999999979%9996995999999999999'9)9999(99998999J99*999199,9/999$999949-99099939.9+9=9 O=>a9: O P'k4}4~6SS;V4}6=;69SS OXZ !QU"#=W$9] O[Yb c#g%$h&\\\\\\\\\\%i'&j?@g<()h*+,,q-67.</)m0?@1!d!e(l2+p/v0w2{3453|R*n8K-r.t*o-s Aj.u??\`lm A B !1x1yn#p1z$?qot8u?s%o&v88 Cw\`< D E F G's H I Ay()x*+,z-x{./ J0 AS128 C345 D E F G H IS8 K L M< JTTTTTTTTTT<L< NLLk K L^ M__________TTTTTTTTTTTTTTTTTTTT` NL"f"f"f"f"f"f"f"f"f"fL`"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f"f^^^^^^^^^^^^^^^^^^^^``^```````````^`\`tؠ@`(ԯ,4@HT`Hlx0`XH0hĚpКܚX8ааа Pа8$а,а8аD@аPа\аh аtа8аxааXěЛܛ (0<DLXdp|H̜؜ (08|@HPX``hpxааааааPаĝpа̝аԝаܝааHаآа а Ȣа`аа$xа,0а4а<DLرT\dlt| ааhаааȞаО0а؞аааааааа(а00а88а@аHаP@аX`8а`аhhаpإаxаааxаааааğа̟аԟа`аааа аа а(0а4Hа<аHаTа\аdpаpаxааааааааȠаԠа(D  0000000000AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA $record%onewline in regular expressionnewline in stringstring too longnewline in character classstring too longbad switch yylook %dunknown type %d in penter unknown type %d in freetrregular expression too long unknown type %d in cfollunknown type %d in first Usage: awk [-f source | 'cmds'] [files]a.outrcan't open %s-d-S-Rnot restored awk.outnot saved /crp/pjw/awkhist/awkhista%-8s %s'%s'-fr #&),/2 5 ; D K OUZaelsy !ľ"ɾ#Ͼ$Ӿ%־&۾'()*+,- ./01 2$3*4/566>7D8L9R:Z;]<d=h>l?q@vAzBCDEFGHIJKLſMlex: %c lex:? %o lex: %s lex:? %o FIRSTTOKENFINALFATALLTLEGTGEEQNEMATCHNOTMATCHAPPENDADDMINUSMULTDIVIDEMODUMINUSASSIGNADDEQSUBEQMULTEQDIVEQMODEQJUMPXBEGINXENDNLPRINTPRINTFSPRINTFSPLITIFELSEWHILEFORINNEXTEXITBREAKCONTINUEPROGRAMPASTATPASTAT2ASGNOPBORANDNOTNUMBERVARARRAYFNCNSUBSTRLSUBSTRINDEXGETLINERELOPMATCHOPORSTRINGDOTCCLNCCLCHARCATSTARPLUSQUESTPOSTINCRPREINCRPOSTDECRPREDECRINCRDECRFIELDINDIRECTLASTTOKEN00$zero&null$recordFS RS OFS ORS OFMT%.6gFILENAMENFNRout of space in makesymtabsymbol table overflow at %scan't set $0can't set $0%.20gillegal reference to array %sfunny variable %o: %s %s %g %oout of space in tostring on %s8((@rcan't open %srecord `%.20s...' too longrecord `%.20s...' has too many fieldsrecord `%.20s...' has too many fieldsNFfield %d: |%s| built giant record `%.20s...'trying to access field %dawk: %s near line %d awk: record number %g $recordillegal statement %ounexpected break, continue or nextunexpected break, continue or nextunknown boolean operator %dunknown relational operator %dout of temporaries in gettempformat item %.20s... too long%snot enough arguments in printf(%s)illegal arithmetic operator %ddivision by zerodivision by zerodivision by zerodivision by zeroillegal assignment operator %d%s%d%d%s is not an arrayillegal jump type %dillegal function type %dstring %.20s ... too long to print%stoo many output files %dwawcan't open file %s%sout of space in ALLOC$recordNNN$:$:$:$:$:$:j8j8N6A6A6A6A6A6ANCNCNCNCNCNCNNNNM G@GIN*JJK^L^L^L^L66ELFN999NNv7LT<N=<7NNNNNNNNDNNNBBBBNNN;89:;?DHMRW[`aeimqux| !"#&),/012 < <= > >= == != ~ !~ + - * / % - = += -= *= /= %= printprintfsprintf splitif(while(for(instatnextexitbreakcontinue || && !fncnsubstrsindexgetline ++++----$(empty restore file 1@rzA]ݬ5@3elB#"3h@?ØGe@lB,k$d!r@AA@@@@AA@@OO@JGSrCu%طK@0qi9IE4Ÿ@;\)@3fG@@@@@M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec@@A@@A/etc/utmpUnknown error: >/bin/shsh-c  AAAAAABBBBBB   /etc/ttys/dev/@ik $ Rl"2imhhȪ  0^Юn PPՀPpPP P ^׬Ѭ!DϐϏaσςgϓ[ЬP`k_PX[kЬP`<JIJ=<T[kA'&[k1ЬPݠ'լ1$PPBϯëPx P~ϭPϽfݏϰPϾqVϊ-<σPP1P1?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj ~P   BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[1xݏPZZ  YYX ZYYXZYZ~HPY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PPd[ [[[  Ь[Z = 8[ePZ~YPZ ݫ; ԫ kZP{ Ь[ЬZkPkPzQQP(P^߭ݬDPPPݬݏ tݬݬݏtݬ6.&r&jdgUX~*PYA[Fk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [&PYPƏPxPbPZxPZPPZx~@PZZZPZPxPZPPjjk&_1xYP[PLZE=@k1*k[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPq@jH~\S^\_-P$CЬPЬPЬRRQ{RPPR PRPPPP`i`  2a2 usage: bad type disk [ snum [ bn ... ] ] e.g.: bad rk07 hk0 %s: not a known disk type known types: %s /dev/r%scbad block information at 0x%x in %s: %s: can't read bad block info (wrong type disk?) cartidge serial number: %d(10) alignment cartridge bt_flag=%x(16)? sn=%d, cn=%d, tn=%d, sn=%d bad: too many bad sectors specified limited to 126 by information format limited to %d (only 2 tracks of sectors) %d: out of range [0,%d) for %s @(#)bad144.c 4.2 (Berkeley) 81/05/11rk06rk07rm03rm05rp06rm80rp05rp07Unknown error: #""0&@i k|8*&&i=If6i # # Configuration file for UC Berkeley ARPAVAX # cpu "VAX780" cpu "VAX750" cpu "VAX7ZZ" options TRACE ident BERT timezone 8 dst maxusers 24 config hpup vmunix config up upvmunix config rk rkvmunix controller mba0 at nexus ? controller uba0 at nexus ? disk hp0 at mba? drive 0 pseudo-device pty pseudo-device bk controller hk0 at uba0 csr 0177440 vector rkintr disk rk0 at hk0 drive 0 disk rk1 at hk0 drive 1 controller tm0 at uba0 csr 0172520 vector tmintr tape te0 at tm0 drive 0 controller sc0 at uba0 csr 0176700 vector upintr disk up0 at sc0 drive 0 device dh0 at uba0 csr 0160020 vector dhrint dhxint device dh1 at uba0 csr 0160040 vector dhrint dhxint device dh2 at uba0 csr 0160060 vector dhrint dhxint device dm0 at uba0 csr 0170500 vector dmintr device dm1 at uba0 csr 0170520 vector dmintr device dm2 at uba0 csr 0170520 vector dmintr device dz0 at uba0 csr 0160100 flags 0xc0 vector dzrint dzxint @i kHB$=$&i|\6i /* dkbad.h 4.3 81/05/10 */ /* * Definitions needed to perform bad sector * revectoring ala DEC STD 144. * * The bad sector information is located in the * first 5 even numbered sectors of the last * track of the disk pack. There are five * identical copies of the information, described * by the dkbad structure. * * Replacement sectors are allocated starting with * the first sector before the bad sector information * and working backwards towards the beginning of * the disk. A maximum of 126 bad sectors are supported. * The position of the bad sector in the bad sector table * determines which replacement sector it corresponds to. * * The bad sector information and replacement sectors * are conventionally only accessible through the * 'c' file system partition of the disk. If that * partition is used for a file system, the user is * responsible for making sure that it does not overlap * the bad sector information or any replacement sector.s */ struct dkbad { long bt_csn; /* cartridge serial number */ u_short bt_mbz; /* unused; should be 0 */ u_short bt_flag; /* -1 => alignment cartridge */ struct bt_bad { u_short bt_cyl; /* cylinder number of bad sector */ u_short bt_trksec; /* track and sector number */ } bt_bad[126]; }; #define ECC 0 #define SSE 1 #define BSE 2 #define CONT 3 ((@ik2 4x{~ 2ioo  (h^Юn PP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Y HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~((]PYj ~P  BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[,1xݏ+PZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~ PY PP0 [ [[[Z  Ь[Z = 8[ePZ~YPZ ݫ ԫ kZP{ Ь[ЬZkPkPzQQPlP^߭ݬPPP<,PЬ[ЬZ[Y[YPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6|.T7nP7f`cQT~*PY=[Bk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [P7PYPƏPxPbPZxPZPPZx~@PZZZPZP}x~PZPPjjgP7[@ik: 4x{~ 2ioo1xYP[PHZA9<k-&k[P Ь[[ZZZ jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPm@j~\S^\_PCЬPЬPЬRRQ{RPPR PRPPPm P0+W+`+h+n+w+++++++++++++++++++++usage: savecore dirname [ system ] /dev/dev/Can't find device %d,%d /vmunix/vmunix: dumpdev not in namelist /vmunix: dumplo not in namelist /vmunix: time not in namelist /vmunix: physmem not in namelist /vmunix: version not in namelist /vmunix: panicstr not in namelist /dev/kmemrCouldn't fdopen kmem rWarning: vmunix version mismatch: %sand %srSystem went down at %sDump time is unreasonable /minfreeDump omitted, not enough space on device rbounds/vmunixvmunix.%dvmcore.%dSaving %d bytes of image in vmcore.%d boundsw%d /usr/adm/shutdownloga%02d:%02d %s %s %2d, %4d. Reboot after panic: %s readlseekwrite@(#)savecore.c 4.7 (Berkeley) 81/05/20_dumpdev_dumplo_time_physmem_version_panicstrSunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDecM:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDecrUnknown error: #22-h7@ik E h  ^Юn PPՀPpPP P ^Ѭc1ЬPݠPѬЬPРPЬPР[[Z[Pj[P Zjj[iYժPPPσϞPis"+ѬЬPݠϵPPG=9ݏm'ώP&jaW[Ь[Zj7݊[ PYYP Ь[ЬZk =ZPk=Pݬ \~ݬЬP PPЬ[ZYk94 ZPQPQ0QZY[[kPP P P+P-k0YZPZP [A4P@X[ݬ)PZZݬ[P[|8@Jdt$0FXdv $1GVbuError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large Ь[ZZZPЬ[ЬZЬ YY kPYP kPzQQP  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxW((P@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~ PYj~P  BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[41xݏPZZ  YYX ZYYXZYZ~8PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PPX[ [[[ Ь[Z = 8[ePZ~YPZ ݫ+ ԫ kZP{ Ь[ЬZkPkPzQQPP^߭ݬ4PPPݬݏ tݬݬݏtݬ6 . ~ x { i l ~*PYU [Z k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ  [P YPƏPxP bPZx PZPPZx ~@PZZZ  PZP x PZPPjj s 1xYP[P` ZY Q T kE > k[P Ь[[ZZZ% jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP @jL~\S^\_1P(CЬPЬPЬRRQ{RPPR PRPPPPusage: mt [ -t tape ] command [ count ] -tTAPE/dev/rmt12mt: don't grok "%s" %s %d failed@(#)mt.c 4.2 (Berkeley) 81/07/05eoffsfbsffsrbsrrewindofflineUnknown error: #d@i'k~M ?`g+iȪ /dev/up0a:/:rw:1:1 /dev/up0g:/usr:rw:1:2 /dev/up0h:/mnt:rw:1:3 @i)kg> )`g`]iȪ /dev/hp0a:/:rw:1:1 /dev/hp0g:/usr:rw:1:2 @i+k_‰!  ++uȪ@i,k`9d$:@/ikk /* tm.c 4.6 81/12/01 */ /* * TM11/TE?? */ #include "../h/param.h" #include "../h/inode.h" #include "../h/pte.h" #include "../h/ubareg.h" #include "saio.h" #include "savax.h" #include "../h/tmreg.h" u_short tmstd[] = { 0172520 }; tmopen(io) register struct iob *io; { register skip; tmstrategy(io, TM_REW); skip = io->i_boff; while (skip--) { io->i_cc = 0; tmstrategy(io, TM_SFORW); } } tmclose(io) register struct iob *io; { tmstrategy(io, TM_REW); } tmstrategy(io, func) register struct iob *io; { register int com, unit, errcnt; register struct tmdevice *tmaddr = (struct tmdevice *)ubamem(io->i_unit, tmstd[0]); int word, info; unit = io->i_unit; errcnt = 0; retry: tmquiet(tmaddr); com = (unit<<8); info = ubasetup(io, 1); tmaddr->tmbc = -io->i_cc; tmaddr->tmba = info; if (func == READ) tmaddr->tmcs = com | TM_RCOM | TM_GO; else if (func == WRITE) tmaddr->tmcs = com | TM_WCOM | TM_GO; else if (func == TM_SREV) { tmaddr->tmbc = -1; tmaddr->tmcs = com | TM_SREV | TM_((GO; return (0); } else tmaddr->tmcs = com | func | TM_GO; for (;;) { word = tmaddr->tmcs; if (word&TM_CUR) break; } ubafree(io, info); word = tmaddr->tmer; if (word&TMER_EOT) return(0); if (word < 0) { if (errcnt == 0) printf("te error: er=%b", tmaddr->tmer, TMER_BITS); if (errcnt==10) { printf("\n"); return(-1); } errcnt++; tmstrategy(io, TM_SREV); goto retry; } if (errcnt) printf(" recovered by retry\n"); return (io->i_cc+tmaddr->tmbc); } tmquiet(tmaddr) register struct tmdevice *tmaddr; { register word; for (;;) { word = tmaddr->tmcs; if (word&TM_CUR) break; } for (;;) { word = tmaddr->tmer; if ((word&TMER_TUR) && (word&TMER_SDWN)==0) break; } } @i/ky.Y | O+@=2iƪhȪ  H 8 ^Юn PPՀPpPPGy PPBtdݬKb( Ь[[ 7P~ZCPZ[ZBZP Ь[,9CPZ(,kj`G Zc OGPZ(ZCGCP[ݬPkݬuP c [c cP[[cЬ[ЬZZ [x1cYQZGݩ[hAP7i *i![JbY6PPYPЩ(YYZ[Jb*60^Ь[bZ[ݪ@PЪ(ZZZ![Jb5PLPjЪYݪ[@P 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;PРQ֠aaP ;ݬ-ЬTzT AkTA|A^bBSBPPP@BP$/*Bݭ3Bݭ:BݭtABݭdHBݭTRBݭDXBݭ4cBݭ$tP1oP[:ЫZ0Z'FBݪ.Pݫ3BݭЫ([[?BݭQBݭP[1ЫZѫ1ZZ?Bݪ".Pի?ݫݫ$B(ݫݫABݫݫYB ݫݫiBKի ѫѫҘ ~ݫ=Pݪ1PݫݫDBݭЫ([[14PBݭHBݭYBݭO[[ЫZQZHЪYBY9EBݩ-P%ݫݫݪPݪ BݭLЫ([[*Bݭ4N[1ի 1ЫZZBݪ,PݫAݭBݭЫ AݭݫݽAݭЭPРAݭݫݫݫAݭ{Ы AݭdݫݽAݭNЭPРAݭ3Ы([[1AݭAݭ^M[1ЫZk 1ZZAݪy+Pի ?ݫݫmA(ݫݫ}AݫݫA ݫݫAIիѫѫի$ݫݫݫݪPݫݫAݭ@Ы([[17Aݭ%AݭAݭ[L[1ЫZѫ1kZZjAݪc*PЪYYAݩ@*PYAݪ**PZի 2ݫݫAݫݫA ݫݫA1$իѫѫЪXW1ЪYݫݫݪݪAQ1ЩXѫݫݫAѫݫݫA1|ի ݫݫB1hիݫݫ9B1TЫWݫ$ ~ݫ[PWXPBݪ)P BP ݪPݫcBݪ(PЫPЪPPAݭ #Ы([[14Bݭݭ$(Ь[ի BPݫݫ B_ZѬAPѬAPݬAIVP Ь[0JZ[j(PZPЪZZP)P[ԫЫ Y[I[Y YP[[Y[P^WA@APP>AW'BA3APPP AP'HP@ݭu H@&H@ݭ8 PРmH@ݭ ((PР@ݭ Hݬ ZZE[nѫdk>PWWPYWPPXhohZYPPHZ>ݬV Wt>ݬD YPPZhЫ[[Z$׼ЬPРQ֠ aaP ݬ  (>ݬZD[dѫZkIP@cGk6PPYZPPHZ=ݬk=ݬYPPZЫ[[Z$׼ЬPРQ֠ aaP ݬ /ݬ!P[[P^CX1Ѩ1hhZZPP[kk~ZZP5=ݬZPYsZY=ݬ1ѨcZ=ݬYY&=ݬYG=.ZJ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d %s connected to non-controller%s %d not definedno %s's to wildcardOHNO!!!ubambaonly uba's and mba's should be connected to the nexuscan't give specific nexus numberstimezone is unreasonableyacc stack overflowsyntax errorHZ specification obsolete; deleteubambambaubambauba%s must be connected to a nexuscan't specify slave--not to masterusage: config rDon't forget to run "make depend" ..//ccTTTT UU UUU U%U +U 2U@UFULUQUVU\U_UbUkUoUxUpC@                        fONhNRNONONMhONhONOOO OhOOhOOQ$OL,OhO4ODOSOMxM 1|g 'M! n'$ Tg,,d 7 > Cr,)In4O.WN`hOiYRq|SxSNS|TOT Hh ehk :lk ,pkoT 68lT(f@JVt) : .BJ)3?P#FDOo Z# d!m+)t zBP$7$j%'M'.*;BC ?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~aPYj ~P w BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[(1xݏ/PZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~$PY PPD [ [[[n  Ь[Z = 8[ePZ~YPZ ݫ ԫ kZP{ Ь[ЬZkPkPzQQPpP`P^߭ݬDPPP0 ݬݏ tݬݬݏtݬ6 PЬPЬRRQ{RPRPPPRRP.P4L4~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [L4PYPƏPxPkbPZxXPZPPZxH~@PZZZ%PZPxPZPPjjL41xYP[PZkk[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j~\S^\_PCЬPЬPЬRRQ{RPPR PRPPP! P 'B'I'er-w-s@x- r-w-sx-r-w-tx-$$4$D$\$l$|$$$$ar11: bad option `%c' ar11: one of [%s] must be specified ar11: only one of [%s] allowed ar11: %s does not exist ar11: cannot open %s ar11: %s cannot create <%s> /tmp/v2XXXXXar11: cannot create third temp %s /tmp/vXXXXXar11: cannot create temp file ar11: %s not in PDP-11 archive format usage: ar11 [%s][%s] archive files ... ar11: %s does not exist ar11: %s not found ar11: %s cannot open ar11: cannot create %s /tmp/v1XXXXXar11: cannot create second temp ar11: phase error on %s %c - %s %3d/%1d%7D %-12.12s %-4.4s ar write error@(#)ar11.c 4.1 (Berkeley) 10/1/80mrxtdpuvnbaiM:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/Unknown error: # 0 0D)d4bin/at 4755 0 33 30000 2552600264 5173 (( $|^Юn PPՀPpPP# P^Ѭ@$'C hЬPݠݬݬϹP()-)ѭ ))))PxPPP)P2nP2mPP[([ [(((((#2ݏT(ϳ Pϓ P` P6(mP PQ&Ϛ(Ѭτ#ЭP@J P}(y(ЭP@b#&F kbP RP#Ͼ' P,(P<#π& (G#?# P6#Y& ݭݏd߭< ݭϖ ߭#'Ϭ ωP[[[#ϩ'ό !!N # P#ݭAPP~ϐP1"ݭ"Z'= 1=(սнϜ"֭֭󕽈н(''PРQ֠a '~֭=&&PРQ֠=a &=&&PРQ֠'a,ϲ&'Ϸϥ& "ϖ&PРQ֠a֭~&'x&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X^Ь[    PPYYX1XX߭~PYj ~P  BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[(1xݏPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~HPY PP [ [[[  Ь[Z = 8[ePZ~YPZ ݫ[ ԫ kZP{ Ь[ЬZkPkPzQQPP^߭ݬDPPPdTݬݏ tݬݬݏtݬ6< P.h2d2~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZB [d2P4YPƏPxPbPZxPZPPZx~@PZZZPZPxPZPPjjd21xYP[PZ}kqjk[P Ь[[ZZZQjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@jd ~\S^\I P@ Ь+ PЬPЬRRQ{RPPR PRPPЭRBQP\ PbPbլQP! P((&3&:&A&I&S&\&c&l&t&}&&&&&&&&&&at: arg count /usr/spool/atrat: cannot open input: %s wat: cannot open memo file pwdrat: can't execute pwd cd %sumask %.1o TERMCAP'\'' export SHELLcsh%s %s << 'xxFUNNYxx'csh%s xxFUNNYxxat: bad time format: at: bad time format at: time out of range at: illegal minute field at: ambiguous month at: illegal day at: ambiguous day of week week%s/%02d.%03d.%04d.%02d@(#)at.c 4.3 (Berkeley) 7/3/81sundaymondaytuesdaywednesdaythursdayfridaysaturdayjanuaryfebruarymarchaprilmayjunejulyaugustseptemberoctobernovemberdecemberM:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/bin/shsh-c  AAAAAABBBBBB --0)|2bin/fgrep 755 0 33 22000 2552600303 5641 }^Юn PPՀPpPP Pd׬1ЬP`P`-ЬP`PPPbU^0g0M0000000E000q,L41w﷔1n׬լ r2ݼPﰔP_ݼ5u>Y1 T1O1J1E1@1мQ׬{Ь լ+ ?c[P$׬ݼݓPPP^լ1ݬP"ݬ3<ZLzlYY([Z1ޭPYPYPYPZޭPY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CЬPЬPЬRRQ{RPPR PRPPPLPx5T7<;00555555555555555 555555555555555555555555555L?; \b&XMLT+~G!)'q("*Z[YVWU,"+)'+(e*+)'()*]*""%,#cda`^#9 oI,$,JK,u## p+)'(*H} 2 >S,S2+)'(S*  2S -  >, S.:   O QRPO C?QRPs QRPO QRP01345678<=s 345678QRP+01)'(*345678/;@D01345678,<=345678345678345678EFAB345678345678EFAB345678345678N_+)'(*fghijklmnrtvwxyz+{|)'+(*)'(*,+)'(*+)'(*+)'(,*,,r,+,)'(*,2) l'l&%lllllllllWClllllll$l"lll jt\MlllllllllllllA:2/llllllll^ll ll4b a_] [U@ZT RC    { ~-(? _ ;+-*/%^=[((=(==~(((),[))}(=([====[[){]]),[))(;<>   ));=])]]]))=},rT efgpppOS\lmn()sw9< !"#ACEGIK&%^3Tefg:BFJ;DHLRPo124567 NhjT((0q^Q[tx8MZ'UV_`abcdY]$=?ik*+,-./8>@ %u%WXvstring space exceededrcannot open input filebundle %d elements at %o bundling space exceededroutput(%o) []s%s teletypec[%s on line %d, %s]pc SLs.0SLs.rcannot open input filequnrecognizable argument /usr/lib/lib.b/bin/dcdc-/usr/bin/dcdc-yacc stack overflowsyntax error0Qps.[]Ps:ls;:QQ0Q0QkKkiIioOofYc s.s. S+-*/%%^=><!=!>!< 0!=+- 0-*/%%^;ld1+sl1+dsl1-dsld1-s;d1+:;1+d:;d1-:;1-d:Kd1+kK1+dkKd1-kK1-dkId1+iI1+diId1-iI1-diOd1+oO1+doOd1-oO1-dolxlx . . .l.ldsldsd:;d:ZX?vLdkKdkdiIdidoOdoKIOlprogram too big@(#)bc.y 4.2 (Berkeley) 81/02/28 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14abcdefghijklmnopqrstuvwxyz.ttD7xbin/cal 755 0 33 16000 2532067363 5313 @^Юn PPՀPpPP P$^ѬpѬ1ЬPݠϢPP1P ЬPݠυP[[['[P@vQϲ[ݭϮZZt~]ZZl ЬPݠP[[1['oϧ[hϜgϓZYI>Y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ZPxYP[PP[1[Zk[[ZZ [( PYPƏPxPbPZxPZPPZx~@PZZZaZPZPMxNPZPPjj7( +1xYP[PZ  kk[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP=@jh~\S^\_MPDCЬ/PЬPЬRRQ{RPPR PRPPPP S M Tu W Th F S!usage: cal [month] year %s %u %s %u %.3s %.3s %.3s %s %s %s Bad argument %s JanuaryFebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecember$$l@ bin/calendar 755 0 33 1024 2663135067 6307 : calendar.sh 4.3 82/02/13 PATH=/bin:/usr/bin: tmp=/tmp/cal$$ trap "rm -f $tmp /tmp/cal2$$" trap exit 1 2 13 15 /usr/lib/calendar >$tmp case $# in 0) trap "rm -f $tmp ; exit" 0 1 2 13 15 egrep -f $tmp calendar;; *) trap "rm -f $tmp /tmp/cal2$$; exit" 0 1 2 13 15 sed ' s/\([^:]*\):.*:\(.*\):[^:]*$/y=\2 z=\1/ ' /etc/passwd \ | while read x do eval $x if test -r $y/calendar then egrep -f $tmp $y/calendar 2>/dev/null > /tmp/cal2$$ if test -s /tmp/cal2$$ then < /tmp/cal2$$ mail $z (( fi fi done esac /02/13 PATH=/bin:/usr/bin: tmp=/tmp/cal$$ trap "rm -f $tmp /tmp/cal2$$" trap exit 1 2 13 15 /usr/lib/calendar >$tmp case $# in 0) trap "rm -f $tmp ; exit" 0 1 2 13 15 egrep -f $tmp calendar;; *) trap "rm -f $tmp /tmp/cal2$$; exit" 0 1 2 13 15 sed ' s/\([^:]*\):.*:\(.*\):[^:]*$/y=\2 z=\1/ ' /etc/passwd \ | while read x do eval $x if test -r $y/calendar then egrep -f $tmp $y/calendar 2>/dev/null > /tmp/cal2$$ if test -s /tmp/cal2$$ then < /tmp/cal2$$ mail $z bin/call 755 0 33 14000 2532067433 5463 ^Юn PPՀPpPP PT Ѭ1Ͻ6ЬPPP-ЬP׬ѬoY H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RRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYjl~P  BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[l1xݏPZZ  YYX ZYYXZYZ~(PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[. Ь[Z = 8[ePZ~9PZ ݫ ԫ kZP{(P^߭ݬDPPPݬݏ tݬݬݏtݬ6T.F>8;),~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ  [P YPƏPxP bPZx PZPPZx ~@PZZZi b PZPU xV PZPPjj? 3 1xYP[P Z   k  k[P Ь[[ZZZ jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPE @j~\S^\_PCЬPЬPЬRRQ{RPPR PRPPPP4$rCan't open %s %s: Spurious EQ, line %d EQ in %c%c, line %d Spurious EN, line %d EN in %c%c, line %d Delim off, line %d New delims %c%c, line %d %c%c in EQ, line %d %d line %c%c, lines %d-%d %d line %c%c, lines %d-%d Unfinished %c%c Unfinished EQ @(#)checkeq.c 4.1 (Berkeley) 10/1/80bin/col 755 0 33 20000 2552600265 5320 @ ^Юn PPՀPpPP P ^=ЬP`ϯ 1ЭP@P`- ЭP@ώ ϖvЭP@ZMPf>Ph/j~U pϜ=jPPb   Zj֭ѭ1h P@Ϻԭ2ϚϷKIPD`P 7:P[P1S[PP11&P :1P11P[[[ [ɭ[~σWG1yPϽ`P ϰϳP[[PP7hP8P9*1DZ-(1a1SN11ԭ11ϢPPϛ1ϔώ1P 1 P 101P 1P1"P1P 11ԭXPǏPQxQQQPQA0:PÏP~+PǏPQxQQQPQAϲ֭ѭPP~2ϒ^ ϒϯPϸϲϖϪϣ߉PP ~wsp f` WRQMP`C?;3/)!"ЬPǏPQxQQQPЬP@ @ϻϲiP~ψЬQPAϚЬP@ϑ [ϻsЬ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Ϸ ϰ ͐ϩ ϓݏѭ߭όP͕! σ 1D%s ͖1͖P͕Q #1ԭЭ%t% a$$ݭϗP$ϼ$ P.ݭn!խϥ$1L͕>͖P͕PP͐϶ ~$y͖p͐oE$15$@ 1ϨP( ϓ1͖ϧ1P!G PP1 P͐P͐ϕ͕$1Ϸ#P1P:#]IP%P$P<1nP>Ϗ#Fϵ P͐1π1,^Ь[Z[k k k$[JZ k  k [kkZ ݭχPEZ ZЭܭ{ݭsjݭbYݭ2P1!ZZЭܭݭώPY ݭϷϣϽ ݭϽ[g"o" ; ԭH"gYP[֭ԑ/"$" &"" sϤ""QP!!6P=!N YϏ!*Hݭ .3ϔݭ1 Ь[ЬZjPPЬ[[P[PS!Ϣk Ph!Ϲ ^^!ϣ C!ϲw) ϯj)EPP ϜP)g Ϝ8)ݭݏ&)υݭ })Ͽ([k k[k([k>[k:[kϝ ϗ Ϗ  ω $k π w Ϫ(>[6Pa ݏ[ϊPM E Ϩ < '[ &  [~ Π^͠ 1B  ޭPѭP ϼ֭ϳ Э͠͠~͡>6ЭP  ׭ЭPϠ͠PP~͠όϫ1π zu"͠PP~͠~-qЭP ׭ЭP9͢>֭:֭1͢>ݭPݏݭ"P@ ͡ϩϻϋRP1ϲ^υ߭ݏtXTլ Ѭ Ѭ ߭ݏ tω^Ь֭ѭì~ݬ=0ݬݬϦϙݬPPݬPcݬ (^G0P;PϣM',ݬA'!PT߭ݬaPP߭íPPPݬϘPݬ&pPPݬP^ԭЭP@ ֭ѭϞѭ ,#ϒ ݭςݏѭd ^XݬϾP~!PP,9ϰݬ)ϠݏϫݬݭfЭPЭ@k^ԭIЭP@W;լ@KݬϳP%ЭP@6uЭP@(ЭP@֭ѭϡ ^߭ݬPPѭPݬP ݬP^ݏ$ݬPP8\~ݭϻݭ/ݬ ݬ|P ݬPݬP^ԭ:ЭP@ ݬݬϋP ԭЭP@ ω֭ѭP֭ЭP@ P ^ݬϑχ߭Ϛ߭Ϝ ^ݬϊπ߭xݏ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  [7PYPƏPxPbPZxPZPPZx~@PZZZPZPxPZPPjjs7g1xYP[PTZMEHk92k[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPy@j$~\S^\w P[ЬPЬPЬRRQ{RPPR PRPPլQPP((X+y++++++++++++,Bad flag %sConnect failed: %sConnectedLost carrierDisconnectedline goneSHELL/bin/shsh-cCan't execute shell!$Can't divert %s</tmp/cu%dwCan't tell other demon to divert%s name to be written in temporary:Use `~~' to start line with `~'takeusage: ~%%take from [to]echo '~>:';tee /dev/null <;echo '~>' putusage: ~%%put from [to]cannot open: %sstty -echo;cat >;stty echo \character missed stopped after %d bytes~%%%s unknown /tmp/cu%drCouldn't open temporaryName of temporary:Name of target file:Creat failed:Can't divert %s Can't divert %s %s does not exist/usr/spool/uucp/LTMP.%dAERROR - (%s) i < MAXLOCKSTOO MANY LOCKS %dAERROR - (%s) p != NULLCAN NOT ALLOCATE FOR %s%s.%s/usr/spool/uucp/LCK.%s.%s/usr/spool/uucp/LCK.@(#)cu.c 4.6 (Berkeley) 81/07/02/dev/cul0/dev/cua0300line busycall droppedno carriercan't forkacu accesstty accesstty hungusage: cu telno [-t] [-s speed] [-l line] [-a acu]lock failed: line busy11h-7bin/dc 755 0 33 64000 2532074370 5141 \^Юn PPՀPpPP[ PWݬݬ$,^[.'PZZs'-P[P0[9[A [F[.[PP^11oPI11P-11|P!1 1OP 1:P[<]K1vbZDNppZJ'pZ'PZתЪjjP`d`Zi+Ѫ  ZEE`֪10?1<P+-1u&P`a%qZ_&iZ(J1:&P_a_PנР__P`_PנР__P`*.-%PZתЪjܭPPj_d_PPbYPPPPK_PPCЭѭЭܭѭbb_PíP~Z<PZ_Ѫ 11P1/,6%PZZG@b@0bPPQѠ  QDb!bP bQСR֡Pba12aaPPa~a?&PZaZ8PYZFa~Fѩ  YCa֩Y1o$PZ_ X1תЪjjP`]êP Ѫ 11jPjjP`PP[ OX1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PTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~QPYjT ~P OG BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[x`1xݏPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[  Ь[Z = 8[ePZ~9PZ ݫ[ ԫ kZP{P^߭ݬDPPPP@ݬݏ tݬݬݏtݬ6Ь[ѬP ѫѫk֫k׫ЫP`P .y y ~*PY [ k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ^  [yPP YPƏPxP7 bPZx$ PZPPZx ~@PZZZPZPxPZPPjjy1xYP[PZkk[P Ь[[ZZZmjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j~\S^\wP[ЬwPЬPЬRRQ{RPPR PRPPլQPPstkall %ld rel %ld headmor %ld nbytes %ld stack empty stack empty stack empty sqrt of neg number stack empty exp not an integer stack empty exp too big stack empty stack empty stack empty stack empty scale too big stack empty stack empty Q? neg Q readstk? empty stack empty stack stack empty %sempty stack save: args stack empty symbol table overflow save:args L? stack empty neg index index too big index too big stack empty stack empty neg index index too big index too big stack empty nesting depth nesting depth %o is unimplemented divide by 0 stack empty stack empty divide by 0 rcan't open file %s out of stack space %c 0 %c\ %c\ %c\ %c\ 0%d%d\ %d.\ %c\ %c\ %c\ 0%d%d\ %c\ %c\ hex digit > 16stack empty stack empty stack empty /bin/shsh-c! sallocsallocmorehdheaderscopycopy size %d copy%s %o rd %o wt %o beg %o last %o %d seekcseekcmoremoreout of space: %s all %ld rel %ld headmor %ld nbytes %ld stkstring %o odd begarray %o elt %d odd tmps %o p %o eltodd ptr %o hdr %o redef-baddummyredefuuaybin/deroff 755 0 33 52000 2552600270 6011 L0 ((^Юn PPՀPpPPK P8G 1P,P1#PP`P`-1PP`PPP`ZjPwwKVvKKjKKK1jPPmAKmsl -KZZjOOvO1LkO KO$ZOP`PO?O:PNP@J1P PpNhN"NNPРQ֠aP N9P6NP"1lPPNN\NNPРQ֠aP sN9PMP1mhIxMMP M^Ь[k- I$^I[7P[IIЭPML MCMPMMP`M7,M&(MP`bPM M M CyMqMPРQ֠aP ^Mo8PLP O*L\H,MP LP ^ MMPРQ֠aP L8PXLP *ELGLP f"LPP *L[Lkk 1L wK nK\amLeLPРQ֠aP RLc7PKP C[KNGLPٔk]LLPРQ֠aP K6PSKP !@KFKPaK FZݪKBP KjZZ64PZFjJ;/PZFFGE4ݬݬF24AK KPРQ֠aP J 6P_JP *LJEJP m)JPP. J' 1uIGGI1IT1]JUJPРQ֠aP BJS5PIP 3*I@EJP rIPgIaIQPa[I{NI}1:IP IIPРQ֠aP I4P IP *HDrIP HPPH1oD1DIbB  ;1, FFPРQ֠aP {F1PEP l*EyAIFP EPP E E[[ F FPРQ֠aP E 1P`EP *ME@EP n*EPPZ[. Z.@Z [E ZQEP T1[T@ZSZCZ&)IEPP@ 1f1\[TZE 2@1A[GZRݏEݏG1?[dZe 1?[i Zg?[a Zm[s@Zo7^CC%VDPDQPaaID1x[nYZxPC :DL D:CPCPC1[hwZwnCCPРQ֠aP C.PCP *C>CP %BPP 1n>1[TZLAC9CPРQ֠aP &C7.PBP *yB$>BP VBPP BBPРQ֠aP B-P!BP *B=BP /APP AA`BXBPРQ֠aP EBV-PAP 6*AC=BP uAPP.mA AAPРQ֠aP A,P7AP *$A<AP EAPPZ11U<1[NwZRnZARAPРQ֠aP ?AP,P@P 0*@=< AP o@PP 1$ ;1\[AZU ZI;n@@PРQ֠aP @+P@P *?;p@P ?PP 1 O@G@PРQ֠aP 4@E+P?P %*?2;@P d?PP ??PРQ֠aP ?*P/?P *?:?P =>PP >>n?f?PРQ֠aP S?d*P>P D*>Q:!?P >PP.{> >>PРQ֠aP >)PE>P *2>9>P S>PPZ11c91[FZSh>`>PРQ֠aP M>^)P=P >*=K9>P }=PP ==PРQ֠aP =(PH=P *5=8=P V=PP ====PРQ֠aP l=}(P<P ]*<j8:=P <PP.< = =PРQ֠aP < (P^<P *K<7<P l(<PPZ11|71[SZH<y<PРQ֠aP f<w'P;P W*;d74<P ;PP <<PРQ֠aP ; 'Pa;P *N;6;P o+;PP ;;;;PРQ֠aP ;&P:P v*:6S;P :PP.: ,;$;PРQ֠aP ;"&Pw:P *d:6:P A:PPZ1151[NZH::PРQ֠aP :%P9P p*9}5M:P 9PP /:':PРQ֠aP :%%Pz9P *g959P D9PP 897999PРQ֠aP 9$P9P *84l9P 8PP.8 E9=9PРQ֠aP *9;$P8P *}8(48P Z8PPZ1131[OZK88PРQ֠aP 8#P7P *73f8P 7PP H8@8PРQ֠aP -8>#P7P *7+37P ]7PP Q7P777PРQ֠aP 7"P7P * 727P +6PP.6 ^7V7PРQ֠aP C7T"P6P 4*6A27P s6PPZ1111[NwZDn66PРQ֠aP 6!P6P *616P %5PP 1n11g1[H|Z  ZUn36+6PРQ֠aP 6)!P~5P *k515P H5PP 1010ZL0 [RݏEݏL155PРQ֠aP m5~ P4P ^*4k0;5P 4PP 00P0.``P170.b)1%//[D[N [KZS ݏE[1/![nZfݏiݏf1/[cZe 1[.pZ.k_4W4PРQ֠aP D4UP3P 5*3B/4P t3PP./[Z .F..1*33PРQ֠aP 3P3P *2.l3P 2PP N3F3PРQ֠aP 33DP2P $*21.3P c2PP.1'22PРQ֠aP 2P+2P *2-2P 91PP.1r2j2PРQ֠aP W2hP1P H*1U-%2P 1PP.1Kx1 k11PРQ֠aP 1PF1P *31,1P T1PP 11PРQ֠aP t1P0P e*0r,B1P 0PP ?,Y11PРQ֠aP 0 Pb0P *O0+0P p,0PP 00PРQ֠aP 0P/P */+_0P /PP.nA090PРQ֠aP &07P/P *y/$+/P V/PP 1'//PРQ֠aP /P/P * /*/P ,.PP[P 1b/Z/PРQ֠aP G/XP.P 8*.E*/P w.PPZP 1E[PQPQ1ZPQPQ..PРQ֠aP .P!.P *.).P /-PP Y)**P*.`*."))P) ``P) "Dq[EhZQ_Y1@-PR-P *?-(-P `-PP 1--PРQ֠aP|-t-PРQ֠aP a-rP,P R*,_(/-P ,PP.- -PРQ֠aP ,P\,P *I,',P j&,PP ',,PРQ֠aP ,P+P r*+'O,P +PP.1,),PРQ֠aP ,'P|+P *i+'+P F+PP ++PРQ֠aP +P+P **&y+P *PP **P+H+PРQ֠aP 5+FP*P &**3&+P e*PP.]* **PРQ֠aP *P'*P **%*P 5)PPZ1)Tr]*U*PРQ֠aP B*SP)P 3*)@%*P r)PPE1))PРQ֠aP )P6)P *#)$)P D)PP ((u)m)PРQ֠aP Z)kP(P K*(X$()P (PP.( )(((PРQ֠aP (PL(P *9(#(P Z(PPT1((PРQ֠aP t(P'P e*'r#B(P 'PPE1^ԭY( (PРQ֠aP 'P\'P *I'"'P j&'PP ''PРQ֠aP 'P&P |*&"Y'P &PP. &'1%/'''PРQ֠aP '%Pz&P *g&"&P D&PP 8& /&E1&&PРQ֠aP &P%P *%!^&P %PPN1'9&1&PРQ֠aP &/P%P *q%!%P N%PP  1Yw!s!Pl!x`\!ݏxI!E!P>! ``P,! խU!!P !.` .  P ``P }~$d1$$PРQ֠aP $PE$P *2$$P S$PPe1t$$PРQ֠aP m$~P#P ^*#k;$P #PPl1$$PРQ֠aP #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=$1; shift; continue;; -n) nflag=-n;shift; continue;; -mm) mflag=$1; shift; continue;; -ms) mflag=$1;shift;continue;; -ml) lflag=$1;shift;continue;; *) rest=$*; break;; esac done $B/deroff $mflag $lflag $rest^$B/dprog -d $nflag $flag $file /pT,pT5̇ /,"bin/diff3 755 0 33 416 2532077212 5505 e= case $1 in -*) e=$1 shift;; esac if test $# = 3 -a -f $1 -a -f $2 -a -f $3 then : else echo usage: diff3 file1 file2 file3 1>&2 exit fi trap "rm -f /tmp/d3[ab]$$" 0 1 2 13 15 diff $1 $3 >/tmp/d3a$$ diff $2 $3 >/tmp/d3b$$ /usr/lib/diff3 $e /tmp/d3[ab]$$ $1 $2 $3 ak;; esac done $B/deroff $mflag $lflag $rest^$B/dprog -d $nflag $flag $file /pT,pT5܇ /,"bin/efl 755 0 33 266000 2552600272 5343 x^Юn PPՀPpPP Pd^Ь[ЬZfAPf/[ZxpfP@; 1`jP`-jPj?P1GjP`-10jY11P#11P 1i~1P2HP3LP4PPMPPmG$Y^1PDYiPP1=8 4+"Yi]iPPcPC1.PWPV1PvPd1\1Pw1[Z[1?h[1:ipcgN]ji]jpPխ7jEqg2dg@jhqqЭݭWѭe ݭ3[Z[1(jPjP`-1GjPRh`b1C^h\ЬggYhh3EYWIhhs=&a P)~PP 6? Jr 1.vP︲q #!nnggc|Pg`fP `!T8^OR!߭~qP5C|:uP Q vP?P7Hu*Z!eePР eݭd{e#eePРeݭ9{e[mRm8MMM~ݏzݏam=ݏnݏiX=NmKmHmEmBmDmNm3m^PPPP[xPPxC=߭'߭P씠~ݭWݭݭz۹ݬЬ[ k=k[k [ݬP[kP^ЭPݠݽ&dս^ЭPݠ ݠݠݽgս^ЭPݠݽeս^լ-ݬ,nPݬnPPPPݬmP 1lݬmP 1VݬmP"}w E-&ݬmPݬtmP ;14ݬVmP Э 1ݬ7mPeݬ#mP j1ݬmP j1ݬlP j1ݬ1ݬlP<[kݬlP[kk [q1Xݬa1EjݬnlP_ݬZlPj1Mݬ@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[[P[yLL8[[#A 6L1L^լЬPݠPPPPy[8լ  PP %PPPP լ PP׭Ы [[[ 7PPլ ݫ$լݫի .Pݫ ^P[kЬP`QQQ РP`QQ PЬЬPРЬPРݬլЫ YPЬ Ь YIZ1jPP jPP*ժժ Z|PPZPPIޭPxYQQP~IcPIfIYY1`խխѭ޶5[P ^ЬP  РРXJ[kZ-ЪYo  PPcѩ\ݭݩXPKjkZo2PYiЬPQQi  ЬP  QQ  խݭZ[PPЭYP-YOPZYPРjPZYy :Ь6 լ%ЬP  QQµPUP[k  ЬЬЬ [PP[kЬ ЬЬ[P ^լЬPРР︥ˏ Pݬԭԭլ@jPPP -2PPխݭ/!3 PPP4P`QQ7`QQ ՠ*ݭsPPPݭD P PP/$ݭݭPխݭլEPP17P1 8ݭխ>ݭ/ (ݭhoݭ1լ1PݭPFݭݭPݭ{PխCݭSݭspPPݭ3Pݭ:ЭPɲhPPy1c-PP>1c0gmݭa1<Ь[1P1j~@ 1ЫZjPPЪY$T 6ݪYݩCݩ.wݩ թ]ݩH"ժ$﷡ .ݪk[[1# ^ѬݬЬ[lPdժ_ժ MժHЪPՠ?߭ݪPPw Ѭ [ݪݪ k[[ЫZjPPժݪժ Ъ Pժ ݪBPP0ݪݭ Ь[[(P[)PxPPZZ:[Zp1ݬyP,IѬ/3Ѭ)-4/$+(",, ^Ѭ1PЬP`PPѬݬn'ЬP`PPcbRRZR說ݬuЬP`P@1WgP@1WpZ~P[UZZ[YZ[PZPP[XYXXZY"߭S2-YZY߭82[߭$2߭fܞ!ghgHݬ:P@﹞Ѭ Ь[1Pfj~cЫZjPPЪY6ݩ8ݩ.ݩ $թ ݩY6ݪժ ݪժ ݪ Zk[[1{\~vЬ[jP*j~=PЫZjPPݪ8ЪY2թթթթZPYPk[[^ЬPРݭHP߭ݭPԭЭP  QQLAݠPﮡPP-P4Pݭ絛PPԭ߭ݭP ѭЬPP[k>PPǼPݭP ԫݭ|Pՠ.ݭkPPЭQPYdPЭPРPРPݠήPݭPﵮPЭQСQСQPЭPԠ[ЬPݠݭ\P{PPЭ ݬЭP ^Ь[Ь ZsG[[P[Jޭ/֭ЭP׭P߭Nޭ[Q[0P[kPP"  PPЫ䕽֭֭ݫ$[ZJjPP)  PP.֭Ъ䕽֭֭ݪ{Zpx1;[1֭ЭPx`ЭP߭1! ^Ь[DPZj[1kPP}  PPWլЬP`cHCԪݫݫPlA-sP[ZP[[P}P[["  PPլЬP`cԬլ~  PP44444C$LԬNũ  P@&ЫP`QQЫPݠI߭m,߭+P[Ь1,^0PЬPР[{Ы[qիiݫPի6ݫPPhPݭXPݭݭCPPk[[ЭP ^Ь[߭ݫP9߭ݫ  P(ի߭ݫPխ íPƭPP֨﹨Pᄄݬ-ЫZ ݪ+jZZ[~ٺ[HЬPݠ6ݬ, Ь[kPPVVVVVVlL<<<<<<<<``<<<<<L<<k~ﮚ<[Mݫݫݫ路  PP ݫeիݫЫZ ݪDjZZ[~ի ݫ!իݫ ^c(?~ﭹݭнݭ ЭPРЭPQЭн ^'[*Ы~ﮙ'ݭﵶk[[')sY''f\'P  QQ   Q'P  QAlMy'PРPݠN>f' !)ת,'1Ę'[-խԭ  P@k[[MЫZժ ԭѭЭP@$*խԭ VP@﫢p֭4^ԭޭ<ս3нPРZ)jPP ! ZE&ZPPѭ~ݭx߭>ޭ &[ ЫP ݫKPPk[[ݭ0߭%%[ ݫk[[$D%Vޭeս\нPРZRjPP J E  PP:  PP/Z:%&f  PPZ|PPѭ}ݭZ߭ <$ﱖR$$&$ﯖ($}u$^$A$[1ЫZ5p>ԭЭP@$rխԭ NЭP@$P@=,Ъ"ЭPРнխ֭ѭ1xk[[17n#ݴЬ[`歹i[~^QZЫY"ZZ y3ݩiYYݫ Ь[kPPP !Pmk~Z ݫ PP [ [2ZJ$J$P@ݞZЫPݠؔZJ$Z$^ԭЬ[bЫZjPP jPPK FPPPP$ +֭ P@Pk[[Ь[[ЫZjPP jPPD  PP9  PP.ԭYI$֭Yѭ!Z5P!k[[YԭЬ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mnopqrstuvwxyz{|}~((T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj{~P K[C[ BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[e1xݏPZZ  YYX ZYYXZYZ~$PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PPz[ [[[{ Ь[Z = 8[ePZ~YPZ ݫ= ԫ kZP{ Ь[ЬZkPkPzQQPP^߭ݬ\PPPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6p `PЭRBQPXPbPbլQPYXP @(#)EFL VERSION 1.14, 19 AUGUST 1980jjk(kee @ ! & + 3 8 HIllegal EFL flag %c -rCannot open file %s%s. Stop End of compilation File %s: Error in source file. external declaration procedure %s terminated prematurelyod **Procedure %s not generated *1 warning *%d warnings Highwater mark %d words. %ld words left over /usr/sif/efl/Meteracannot open meter fileUser %d, %s portableunixgcosgcosbcdcrayibm\clu ! "#$%&'()*+,-./01%213:4@5C6H7N8T9[:^;b<i<p=u>}?@ABCDEFGHIJKMNOPQR  %)-16:?CGKPTY^chntz "&+/59?CHLRV\afkqv|  $).38=DKOTY]bglqw}commoninternalexternalautomaticstaticvalueprocedureblockdatasubroutinefunctionoptionincludedefineendintegerrealcomplexlogicalcharacterstructfieldarraydimensionlongshortinitialequivalenceimplicitdebugifelsewhileuntilrepeatdoforswitchselectcasedefaultgogotobreakexitnextreturncontinuecalldoubleprecisiondoubleprecisionsizeoflengthofreadwritereadbinwritebintruefalseabsiabsabsabsabsdabsabscabssinsinsindsinsincsincoscoscosdcoscosccosatanatanatandatanatan2atan2atan2datan2sqrtsqrtsqrtdsqrtsqrtcsqrtlogaloglogdloglogcloglog10alog10log10dlog10expexpexpdexpexpcexpintintintidintmodmodmodamodmoddmodminmin0minamin1mindmin1maxmax0maxamax1maxdmax1signsignsignisignsigndsignabsiabsdabsaintintidintamodmodamax0amax1max0max1dmax1amin0amin1min0min1dmin1floatifixsignisigndsigndimidimsnglrealaimagdblecmplxconjgexpdexpcexpalogdlogclogalog10dlog10sindsincsincosdcosccostanhsqrtdsqrtcsqrtatandatanatan2datan2dmodcabs|tttuuutttt(u,utttttt ttt tyesondebugndebugpfortratforefldotsioerrornoneibmfortran77unknown ioerror option %ssystemunknown system %scontinuecolumn1procheaderhollincalllongcomplextypelongcomplexprefixfortran77unknown option %si%de%d.%dd%d.%d1h(,1p%s,2h, ,%s,1h)1h(,1p%s,2h, ,%s,1h)l2iformatrformatdformatzformatzdformatlformatftninftnoutcharperintcharcompdeltastnodclintrinsicsisizersizedsizelsizezsizeialignraligndalignlalignzalignyesonnooffP _|Q=;:),%"$ !#&'()-./ HyM@B<:R*+APImNWG1x;EF>DdJ{D>IPmNWL~    E!'(**:/#$AXW376,%I0?BAt<J=GCyzoV\]^_`abcOlmehSkTMNuxw|.snfi-{KL}q8}}24Jz0245~}[Y13 rkDc,a%"$ !#`_ X&'()-./VTUt*R+qropHPD,F%"$ !#?6K&'()-./ f*+nqrop &+"ZUCD,%"$ !#85>&'()-./@*+qropD,%"$ !#&'()-./v*+qropD,%"$ !#&'()-./p*+qropD,%"$ !#&'()j-./97*+qropD,%"$ !#&'()g-./*+qrop,%"$ !#&'()-./ S9*+O[>,\%"$ !#&'()-./Zhjitsl^]edvwubgQ*+qrop>Y,%"$ !#&'()-./ ,%"$ !#*+&'()-./ *+((,%"$ !#D&'()-./*,+%"$ !#&'()-./9>*,+%"$ !#&'()-./*,+%"$ !#&'()-./,%"$ !#*+&'()-./*+  by ]G4za0$bbb kmPEJ _bjZabb2ffc=bXHk;VRthkUUUnYGzX affccf"gBccXcfcac_F)&5"cc:cHZGcnDccccx1Os,\v/ }|"\C{l@z yGxJKpnFkihfdc#Hba`^]\-T PN MLGC:-,+*)( B> ?AyBFCCCCHGGAIJJJKKKEDL MMSROOTTUVVWWQQXZ[ 88888\ 777777 ]^YY99 !&&&&&'"""(($$$%%%::;;)____________ffbcddddgdhh****ijk++eeeeeee-,,..@@@@mmmmm<<<======llll//////noo1pp00`a#????22334444444q56666>NP132$" !*,-.&'()GI+/0FS4>=D@?E597<OPMN;:CABH   JKQR=>7;:9< %   L**68LLU$GKKa&cfghijklrstuwx ,HVWK\.501B&&&&&ILMJboov&z{|}!'*+UY79;=]_ && &QSTpp% (-XZ6/^`CFED&&&Odeqy~2"#)8:>@&&NRSmn3 [<  &&P4?A&&  &state %d, char 0%o yacc stack overflowsyntax errorerror recovery pops state %d, uncovers %d error recovery discards char %d reduce %d Syntax errordeclaration amid executablesstat: dcl stat: exec Syntax errorattributes on unnamed procedureProcedure %s: Pass 1 argument already usedOption statement inside procedureprocedure %s terminated prematurelycontrol stack not empty upon ENDmultiple dimensionillegal initialization operatormultiple dimensionmultiple initializationAUTOMATIC not yet implemented VALUE not yet implemented multiple declaration for type %s.true..false.may not assign to a functionexec done no statement functions in EFLexec: { stats } exec:empty exec: continue if-then-else exec: if(expr) exec else exec if-then exec: if(expr) exec repeat done exec: control exec no until until togo %s ?? togo %s ?? while(expr) for (forlist) switch (expr) do loop eeRNRQORMRRRKR RRRRR)R'R R(R&R*R=R RRR/RRRRR,RRRR RRNRMRLRR&R$;K6:+2-0.1%?3>=<D!5P8#L74F>?EB@9CAEFIG " JHBC@AIJGHS-/"H"I2O     "H064i ,<715C'DE!G&L$J0X !"*P'M4YKcjkNd( Pe  )lm8'Mn#$%&Qf*PNd9:Pep|~  *  $K+SiQfWp'N !`x;;;;;;;;;;by'SiWp'N#$%&`xRg !( Rh  )by+;Z;[TjRg;\#$%& -TkRhVnUldz - *]u]ve{Vo]w;Z;[TjUmf|;\g}h~o ! .TkVnUl -dzr -]u]ve{Vo -]w /Umf|tg}h~ / o#$%& - - - - -z - - -r -{ - -} - - / - -t / / - /2z2{} / / / / / / / / / / / / /2 / /32?_ /?_2?`?`?`?`?`?`?`?`?`?`222222222222222=2>>>>>>>>>>_`_`_`_`_`_`_((`_`_`_`?@AB@a@a@b@b@b@b@b@b@b@b@b@bFFFFFFFFFF?@ABFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)OZqZq)O)ZrZrZrZrZrZrZrZrZrZrabababababababababab)O)O)O[s[s)O[t[t[t[t[t[t[t[t[t[t)O)O)O)O)O)O)O)O)O)O)O)O)O)O)O)O+;+;+;+;+;+;+;+;+;+;+Q+R+S+T+U+V+W=]=]=]=]=]=]=]=]=]=]+Q+R+S+T=?=@+U=^+V+Wqrqrqrqrqrqrqrqrqrqrstststststststststst=?=@uu=^uuuuuuuuuuvvvvvvvvvvvv#!@d @<@### # # # L, 4 #@ L$L <X #` #l T$x ,$ # 4& ' # / # # d$ $ $!D1 !#!#$!$0! $. of sub arg valarg static auto common mos external statement function long integer real double precision logical complex char type integer real logical complex double precision pfortratforeflsimple(%d; tag %d,%d) .false..true..true..false.impossible logical operatoref1((ascsimple: attempt to assign incompatible structuresef1asstype match errorLine %d. Non-integer subscriptfold: illegal binary operatorfold: invalid relational operator.true..false..true..true.fold: invalid logical operator.true..falsecoerce type %d to type %d ifix.floatsnglreald0d0dble(%s,0.)cmplx0.impossible conversionimpossible character %d in floating constantstatement number changedLABEL %d goto indirect %o goto %d computed goto excallattempt to use a variable as a subroutinestopstop call can only return values in a functionfunction return without data valueexec: return( ) illegal nextexec: %s nextexit.true.non-logical conditional expression in ifexif called if1 illegal break count %dinvalid break/nextdo parameter out of rangedo parameters out of orderI/O unit must be an integerno error handling err =end =iostat =doiolistio of adjustable array1p0p(%da%d,a%d)(%da%d)a%dfriolistioblockbad format component %sbad format component %s%dh%sno adjustable character formatsc%scannot do I/O on structuresnonconstant implied dobackspacerewindendfilebad I/O operationcannot test value of IOOP without ftn77iostat =on line %d of file %son line %dLabel errorExpression errorError**%s %s: **Error %s: Declaration for %s: %s impossible tag %d in routine %s ***Compiler error %s. %s. *Warning: %s ````````aaaaa#a)a6a>aHaOaYaaamawaaa Pass 2 Pass 2 done no name for n=%ddatas: invalid intermediate tag %dno name for n=%d Bad pass2 value %o,%ono fortran slot for name %s(%s,%s) %4d too many continuation lines &0123456789ABCDEFGHIJ %c continuecall do if if goto returnread write format stop data equivalence common external rewindbackspaceendfilesubroutine function programblockdataendeflc.%defld.%defle.%dwcannot open intermediate filewrite errorread errorrcannot open intermediate file remove %s from st cleanst: illegal entry tag %d, ptr %o, name %s.cleanst: hidlist not emptyfrvarfrtype: bad argumentfrexpr%s %s c main program(, , ) end of common declarations end of symbol table, start of gonelist beginning of hidlist(, (1,1))// , prname: no fortran types for name %sprname, , ((, invalid array bound)%s implicitly typed %sillegal class for procedureprocedure name too longprocedure name already usedmkftnp: zero argumentmkftnpinvalid type for %sFortran names: %s %s never usedtempmkftname: cannot generate fortran name for %stoo many Fortran names generatedM:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec  AAAAAABBBBBB /bin/shsh-c@I@Ifbin/egrep 755 0 33 32000 2552600273 5647 (^Юn PPՀPpPP' P!ݬ*+X  ^PP./1P( 1nP 11VP1@2PP2PP2ԭR'UG'PP^2rP-tխoP&QA`\=POP&QA`e&^`P&QA`&֭&^.P{&QA`o&֭PP]13PPQA`ЭPP)1y2PP$ P*1P+2PP^8P[1 P?2 PP\PdP|2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PݬݼЬPݠ[ݬ4354όQ+^ԭЭݬc3ЬQPЬPԭyíPPЬQPPP2`ԭ߭ݬݬO ݬ߭ݬ ߭xPPP#߭ݬݬ ݬ߭ݬ ߭((t֭ѭ֭ѭ߭߭^I2*PżPP+2ݭPԭ ЭP@֭ѭP@ݬ 9ݬ ߭߭ݬ߭߭ ^ԭЭЭЭ߭ݬ߭ݬխ6ݬ ߭߭߭߭߭߭߭߭߭5߭߭߭߭4^ԭԭЭЭЭЭЭP߭ݬ_߭ݬRj߭߭߭߭߭߭0߭߭߭8߭߭߭ ֭߭߭߭߭߭߭խݬ ߭ݬ ݬ ݬ ߭߭߭|߭r߭h߭^^ЬPРЬPРм έм έέݬ ݬ ݬݬ ߭߭7ѭ μ μPP^Ьԭԭ9ЭP2@ PĭPPPЭQ2AQQPPЭQPAx֭ѭЭP2@PPPЭQPAxPPԭԭ7ЭPPQ2@ P2AQQPPԭPЭQPA֭ѭP^Ѭ 2x PPǬPx PPŭQQPxPPŭQQPЭP<^ԭЭЭЭռ\.a ѼZ\. ЬQPЬPݠݬ ЬPРP2`~ݬЬPРP`ЬPݠ*ԼѼQԼ м-ݼ ЬQPԭ$ЭPЬQPPPЭQЬRQQQ`a֭ѭԼޭޭмPЬQPPP2`PPPPP߭߭ݬ߭߭ݬP2@P2@S-íмPP~ PíмeЭPP2@~ЭPP2@~ЭP2@~ݭݭ PxPP~ݭݭݭ&P׭ЭP@׭խЭЭЭ߭ ߭߭2~߭yЭЬPЭЬ PЭؠíмPPP@׭ЭԼ խ ݭ(խ ߭n ߭d $^ݬS ޭޭԭޭܭ׼ Ь PРQ֠aP ݬ PP1ЭPP 2P -P P-5P\3׼  Ь P֠ݬ pĭ߭ Pέѭ0?ѭ990PPݬ߭߭ݬ߭ݬ߭ݬ 1=+ݭ&ĭP^м έխ+ݬ 2 Э +ݭ PԭЭPЬQPPPЭQ`A֭ѭ~%PPPP[k[խ@ѭ-k[[~*ݬ  ݭ&խ ݭ&ԭԭխ$߭߭ݬ߭2P0PPk[ խ k^мЬPРլ έάխ έέݬ߭ݬ߭(ݬ Ь PЭŭ 2PĭPP^ԭм)ݭYP<ЭPЬQPPPxQ2`PQPǬPЭQPAǬPĬPP׭խP@׭Э Ь PЭխ ݭ%) ݬ)ݬ) ݬ)ݬݬ ݬݬ ݬa^ЬPРЬPРԭռ μέмռ μέмѭ ߭߭߭ ߭߭߭6ݬ Lխέ Э ռ  ݭz$ Ь PЭ^(~Ь QPԭԭuЭPЬQPPP2`íPЬQPPPЭQ2`PPQݭ֭߭߭PѭPPЭQЬ RQQQPax֭ѭ}ԭԭЭPЬQPPP2`íPЬQPPPЭQ2`PPQݭ߭߭ ֭PѭPPЭQЬ RQQQPax֭ѭ1ԭüPPԭüPPPCЭPЬQPPP2`íPЬQPPPЭQ2`PPQݭ߭߭j֭ѭPЭQЬ RQQQPax֭PѭP1oPЬ QPPP`PPPP  ЬP2PPЬPPЬQPּ^%~PԭԭԭЭP@֭ѭ1ЭPЬQPPP2`PPЭQЬRQQQ2aQQPPЭQPAЭPЬQPPP2`PPPЭQPA ԭЭP@֭ѭѭЭP@ м Ь PЭռ  ݭO!^мЬPРмЬPРԭխ9խ$ѭ߭߭߭U߭߭߭έ߭߭߭3խ έέ߭߭߭wέ߭߭߭ݬ VЬ PЭŭPP ^ޭ6$ݼЬ QPԭԭԭЭPЬ QPPP`֭ѭ1ЭPЬQPPP2`PPЭQЬRQQQ2aQQPPЭQЬ RQQQPaЭPЬQPPP2`PPPЭQЬ RQQQPaԭЭPЬ QPPP`֭ѭխ8ԭЭPЬ QPPP`֭ѭм ݬ ߭ݬ  -ЭPЬ QPPP`խPέPPP ׭խЬ Pݠ^ммЬPРЬPРԭխ[խ?ѭ߭߭߭5[έέ߭߭߭5έ߭߭߭:խέ߭߭߭Ѭ  խݬѬ  խݬݬ Ь PЭŭPP ^ݬммέPPխ!ݭ=ЬQPԭ$ЭPЬQPPPЭQЬRQQQ`a֭ѭ^xPP~1PPW!PݬT!!(! ;ռЬPݠ8Լ^мխέPPЭPЬQPPP`׭խѭխ ݬռЭέPP^ PլR ЭQPЭP'g ЭQPάPЭQPЭPլԽ ^ѼüPԭ߭ݬݬЭ߭ЭPPTQPP[PPZ[~Z 0+ZwPZ "++Y y+P ^q"P-P  ݭ]  P߭ЭP~V2߭ЭP~%ݬ ^Ql*[Z3[DZ׽ЭPРQ֠aP ݭPZP ĔkL5߭ЭP~ݭ ѭd9 ݭz)Pݬ \~ݬ ЬP PP Ь[PZѪ[:ZPP Ь[k:[kk[PzP|Pqݏ(P[[,[P[[,[xP[[P,[\P[[jP,,,[/P[[w,[P[[h,[ P[[Y,k [kk$,PЬ[ZYk94 ZPQPQ0QZY[[kPP P P+P-k0YZPZPЬ [ЬY׬&k ЫP֫`P [\PZZZ Z YPЬPQPЬ[ XXBPX 鑫+PPPYkw+ݏݬPZY1ZZkalYPPPݬPZ<3ݏݬ}PZYZZݬPZZ)ZYPPPݬPZZ1hZY kr  XP [P@X[ݬPZZݬ[P[lr 0 < N ^ p | !!)!:!I!X!p!}!!!!!Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large@) Ь[lZZPZ jkr kaݬ +   ZP*ЬRPQbPЬŏmNAP90PPP^Ь[ЬZԭլ05Ьj ЪP֪`P ZPYY׭֭ѭ ЭP^Ь[ЬZԭլ.3ЬYj ЪP֪` Z~ Y ֭ѭ ЭPЬ[[ ~kЫ0   Ь[  P ݏP ի ߘP@"% [d9   P2PPݫ~PkЫk!k    k1WP֫Ь[ի ݫ Ь Ыk^ԭլݏP_$|Pݭ$ݭVխѭ¬ Э!Pݬ#+ЬP}V}X}Z}Э`PЬPЬQ}V}X}Z}\Ё^P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ѭݬlCχP^ݏϡf@Ѭݏφf |fYPݏgfPZf)C#Kf(PPݭϑjϼϡe>>oϾ>fϳ>ϯ>PPϥ>ЬYZPPZiǏdZPďdPPZJ[ kݬϙ)Pլ Ь [PЫ[[լ P 4*P[ FЬkЬ J[J^ԭxP_xP|_ϺjU֭xP|_ԭxP0axP,al'֭xP,aϽ=ݬݬKBЬT|V ݬϾK*ύ=լEPSPϦKGV ݬϨK^ì%VPPЬQPA$VVCݬϋKЭP@VπKϰ֭ѭUЬP@UhKϓUPЬ@UϿUP^RKPЬP@ϳUԭP*֭ϝUЭP@ϖU*KEЭP@σUPPѭlU׭1ԭЭԭQЭP@OUPЭQAEUQAV@ X~ݭPЭP@%UP@_VݭPPP֭ѭTݭݭݭϑJϠԭ3ЭP@TPЭ@ VPЭQAϼTQPAυWPP֭ѭ.ЬԭCЭPP@φTPP~~ЭPP@rTPP@jTAЭPQ@TPP֭ѭ'PQTPQQ@VAVTPϰQQ@ZUAVUϢQP@YϘQQ@YA^XS τQP@.U@ϹVݭݭPϘIϐdQϱIσԭ<PѭPϩIPPPPЭP@TϊISЭP@Tϳ֭ѭrI2ЬhS^Ь PYSRSPPPĬPƏdPPPPP,IѬ- Ѭ,$ݬ ݭѬ,IPIPPH0Ѭ*ݭݬ ݭHѬ+ݭݬ ݭHzϺR!HPP@S@}Uݭݬݬ HS^tPЬPwRP PPPPЬPЬQA4U@0UPPQPí@UERݭݭQݬOϘHݬ RݬpݬRݬaݬݭϕHϺݬݭݭݬώHϥQQPPPݭݭϊHσݬݬݭЬPPQAR@ςTPíP~8OwHWݬЬPPQAR@\TPPЬQAϾRPP~ݬݬmH#ݭݭЬP@ϚR~ݬݭpHNPЭ@~RNPЭ@TϾNP@WϴNQ@WAzUݬ8ݭ0^ЬP@S@3RP|N@VsNQ@VA9UPPPPPPPϳPϬPQQQQPѭѬ{ Ѭ })PPPPP֭ЭPPPLPPĭPPPPMQPA SMPí@SPPPϴMQPA]QPPPPQ QQQQQPݭφMRG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ds %d \v'-.4m'\s%d\(->\s0\v'.4m' .ds %d \v'-.4m'\s%d\z\(<-\(->\s0\v'.4m' .ds %d ^ .ds %d ~ .ds %d \s%d\v'-.67m'.\v'.67m'\s0 .ds %d \s%d\v'-.67m'..\v'.67m\s0' .ds %d \s%d\v'.18m'\h'.05m'\l'\n(%du-.1m\(rn'\h'.05m'\v'-.18m'\s0 .ds %d \l'\n(%du\(ul' .nr %d 0 .nr 10 0-%d .nr %d 0 .as %d \h'-\n(%du-\n(%du/2u+\n(%du'\v'0-\n(10u'\*(%d\v'\n(10u'\h'-\n(%du+\n(%du/2u-\n(%du' . diacrit: %c over S%d, lf=%c, rf=%c, h=%d,b=%d . e:eb: S%d <- S%d S%d; b=%d, h=%d \|.nr %d \w'\s%d\*(%d%s' .ds %d \h'|\n(97u-\n(%du'\*(%d .as %d "%s\*(%d .ft %c . setfont %c %c . b:fb: S%d <- \f%c S%d \f%c b=%d,h=%d,lf=%c,rf=%c .ds %d \f%c\*(%d\f%c .ft %c .ds %d \*(%d\h'-\n(%du+%du'\*(%d . fat %d, sh=%d .ft %c .nr %d \n(%d .if \n(%d>\n(%d .nr %d \n(%d .if \n(%d>\n(%d .nr %d \n(%d .ds %d \v'%du'\h'\n(%du-\n(%du/2u'\s%d\*(%d\s%d\h'-\n(%du-\n(%du/2u'\v'%du'\ \h'\n(%du-\n(%du/2u'\*(%d\h'\n(%du-\n(%du/2u'\ \v'%du'\h'-\n(%du-\n(%du/2u'\s%d\*(%d\s%d\h'\n(%du-\n(%du/2u'\v'%du'\ . from to: S%d <- %d f %d t %d; h=%d b=%d \(*S\(cu\(ca\(*Pfunny type %d in funny.ds %d \s%d\v'.3m'\s+5%s\s-5\v'-.3m'\s%d . funny: S%d <- %s; h=%d b=%d  2.ds %d \h'-0.4m'\v'0.4m'\*(%d\v'-0.4m' .ds %d \v'-0.3m'\*(%d\v'0.3m' . integral: S%d; h=%d b=%d \(is.ds %d \s%d\v'.1m'\s+4%s\s-4\v'-.1m'\s%d ]%s.nr 99 \n(.s .nr 98 \n(.f .nr %d \w'\*(%d' .nr MK %d .if %d>\n(.v .ne %du .rn %d 10 \*(10 .ps \n(99 .ft \n(98 .EN%sinput line too long: %.20s .nr 99 \n(.s .nr 98 \n(.f .rm %d .as %d "%s .as %d \*(%d .ps \n(99 .ft \n(98 .as %d "%s.ps \n(99 .ft \n(98 \*(%d . answer <- S%d, h=%d,b=%d .ds %d \x'0'\x'0-%du'\f%c\s%d\*(%d%s\s\n(99\f\n(98\|\x'%du'no eqn strings left.ps %d .nr %d \w'\s%d\*(%d' -rcan't open file %s.ft %c eqn fatal error: file %s, between lines %d and %d eqn: fatal error: file %s, between lines %d and %d rcan't open file %spushback overflowquoted string %.20s... too longmissing " in %.20s. lex token = |%s| . found %s|=%s| . %s is not a keyword token %.20s... too longUnexpected end of input at %.20sUnterminated definition at %.20s. name %s defined as %s out of space in strsave on %sInclude not yet implementedBizarre delimiters at %.20sc#d"dd dd d2d6d7!d0%d1,d40d36d5eCeFeKeNeSeWe\eeejerewe|eeeeeeeeeeeeeeeeeeeff+f/fJfPf`fffkfpfuf{ffffffffffffffffffffffffgg ggggg$g'g,g/g4g:g?gEgJgMgRgUgZg_gdgigngrgwg}ggggggggggggggggggggggggh h hhh$h(h2h6h@hDhNhRh\h`hjhohzhhhhhhhhhhhhhhhhhhi iii$i(i2i5i>iBiLiPiout of space in lookupsub((sup.ENfromtosumhatvecdyaddotdotdotbartildeunderprodintintegralunioninterpilelpilecpilerpileoversqrtabovesizefontfatromanitalicboldleftrightdelimdefinetdefinendefinegsize.gsizegfontincludeupdownfwdbackmarklineupmatrixcollcolccolrcol>=\(>=<=\(<===\(==!=\(!=+-\(+-->\(-><-\(<-inf\(ifinfinity\(ifpartial\(pdhalf\f1\(12\fPprime\f1\(fm\fPdollar\f1$\fPnothingtimes\(mudel\(grgrad\(gr<<<\h'-.3m'<>>>\h'-.3m'>approx\v'-.2m'\z\(ap\v'.25m'\(ap\v'-.05m'cdot\v'-.3m'.\v'.3m'...\v'-.3m'\ .\ .\ .\ \v'.3m',...,,\ .\ .\ .\ ,\|alpha\(*abeta\(*bgamma\(*gGAMMA\(*Gdelta\(*dDELTA\(*Depsilon\(*eEPSILON\f1E\fPomega\(*wOMEGA\(*Wlambda\(*lLAMBDA\(*Lmu\(*mnu\(*ntheta\(*hTHETA\(*Hphi\(*fPHI\(*Fpi\(*pPI\(*Psigma\(*sSIGMA\(*Sxi\(*cXI\(*Czeta\(*ziota\(*ieta\(*ykappa\(*krho\(*rtau\(*tomicron\(*oupsilon\(*uUPSILON\(*Upsi\(*qPSI\(*Qchi\(*xand\f1and\fPfor\f1for\fPif\f1if\fPRe\f1Re\fPIm\f1Im\fPsin\f1sin\fPcos\f1cos\fPtan\f1tan\fPsec\f1sec\fPcsc\f1csc\fParc\f1arc\fPasin\f1asin\fPacos\f1acos\fPatan\f1atan\fPasec\f1asec\fPacsc\f1acsc\fPsinh\f1sinh\fPcoth\f1coth\fPtanh\f1tanh\fPcosh\f1cosh\fPlim\f1lim\fPlog\f1log\fPmax\f1max\fPmin\f1min\fPln\f1ln\fPexp\f1exp\fPdet\f1det\fP.ds %d \k(97\*(%d . mark %d .ds %d \h'|\n(97u' . lineup %d . %d column of S%d, rows=%d \ \ . colct=%d . row %d: b=%d, hb=%d . matrix S%d: r=%d, c=%d, h=%d, b=%d .ds %d "\*(%d%s .ds %d \h'%s%du'\*(%d -\v'-%du'\*(%d\v'%du' \v'%du'\*(%d\v'-%du' . move %d dir %d amt %d; h=%d b=%d . b:bob: S%d <- S%d over S%d; b=%d, h=%d .nr %d \n(%d .if \n(%d>\n(%d .nr %d \n(%d .nr %d \n(%d+\s%d.5m\s0 .ds %d \v'%du'\h'\n(%du-\n(%du/2u'\*(%d\ \h'-\n(%du-\n(%du/2u'\v'%du'\*(%d\ \h'-\n(%du-\n(%du/2u+.1m'\v'%du'\l'\n(%du-.2m'\h'.1m'\v'%du' .ds %d \|\v'%du'\(lf\(bv\(bv\(lf\(lc\(lc\(bv\(bv\b'\(lt\(bv\(lk\(bv\(lb'\(lt\(bv\(lb\(lc\(bv\(lf|||\v'%du'\*(%d\|\v'%du'\(rf\(bv\(bv\(rf\(rc\(rc\(bv\(bv\b'\(rt\(bv\(rk\(bv\(rb'\(rc\(bv\(rf\(rt\(bv\(rb|||\v'%du' . curly: h=%d b=%d n=%d v=%d l=%c, r=%c \b'%s%s%s'. S%d <- %c pile of: S%d;h=%d b=%d .nr %d \n(%d .if \n(%d>\n(%d .nr %d \n(%d .ds %d \v'%du'\h'%du*\n(%du'\ \v'%du'\*(%d\h'-\n(%du'\v'0-%du'\ \v'%du'\h'-\n(%du'\*(%d\v'0-%du'\ \v'%du'\h'\n(%du-\n(%du/2u'\*(%d\h'-\n(%du-\n(%du/2u'\v'0-%du'\ \v'%du'\h'%du*\n(%du' \|\|\|\|. b:b shift b: S%d <- S%d vert %d S%d vert %d; b=%d, h=%d .as %d \v'%du'\s-%d%s\*(%d\s+%d%s\v'%du' . shift: %d;ps=%d . shift2 s%d <- %d %d %d .ds %d \|\*(%d .as %d \| .ds %d \|\|\*(%d .ds %d \|\*(%d .nr %d \n(%d .if \n(%d>\n(%d .nr %d \n(%d .as %d \v'%du'\s%d\*(%d\h'-\n(%du'\v'%du'\ \s%d\*(%d\h'-\n(%du+\n(%du'\s%d\v'%du' . setsize %s; ps = %d . b:sb: S%d <- \s%d S%d \s%d; b=%d, h=%d .ds %d \s%d\*(%d\s%d . sqrt: S%d <- S%d;b=%d, h=%d .as %d \| .ds %d \v'%du'\s%d\v'-.2m'\(sr\l'\n(%du\(rn'\v'.2m'\s%d\v'%du'\h'-\n(%du'\*(%d \ \|\tconverted token %.25s... too long. %dtext: S%d <- %s; b=%d,h=%d,lf=%c,rf=%c .ds %d "%s ؐؐqbin/ex 1755 0 33 330000 2552600302 5214  t^Юn PPՀPpPP؟ PT ^Ь[ЬZr26WPjPjjݏvPjݏwPojݏdlP。no癩PIPP(mPPPPsPP︕=2PXPwPk1jP`-1jPX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@PPY2PЬQPQRPRRQ2PPЬQPQRPRRQIZZ[ZP2QQPk[[ZPP[PxXQPQݬY XY(2PxPP@w~﫨6YYx5=4]ZTPP[YPPYYYX+2PìP~Z~Z~`:XX~*ݬ`Ь[[E& ~ݬ[Ь[M  ~[ [%ݬsЬ[[(([[~M ݬ5z ݬ+Ь[ЬZffދd<PY[YY[PPZZY[ %[P2QPQx[PP]f~2PP[2PPxPPPz0z`1P PPխЭPРЭPР䑭uЭܑu խPPPέܭRݭPZխ-z]1PO11Pc1PX1n1Pd1L1Pu1= Ps11Po111Px1"1 ^Ь[լ [0k[Pԭ ʚ;֭լ Э֭Ïʚ;0PP [ P PPP0PP{ ѬЬZ ZP PPZP0PP{ ZZЬP01w0{P[P[1e ^Ь[[ZZcZZ\ P0PPk-C~Z'Z PP ~׭ ~Z ~( @(#)ex.c 6.4 11/8/80Unknown option %s Key: /usr/lib/ex3.6recoverexrecover-rSHELLdumbTERMEXINITHOME/.exrctagtag|pnextvisual@(#)ex_addr.c 6.1 10/18/80Addr1 > addr2|First address exceeds secondBad count|Nonzero count requiredNo address allowed@on this commandBadly formed addressNo match to BOTTOM|Address search hit BOTTOM without matching patternNo match to TOP|Address search hit TOP without matching patternFail|Pattern not foundMarks are ' and a-zUndefined mark@referencedNegative address@- first buffer line is 1Not that many lines@in buffer@(#)ex_cmds.c 6.3 11/3/80Offset out-of-bounds|Offset after command too largeoabbreviateargsappendcopycdchdirHome directory unknownchangedeleteexeditfileglobalinsertjoinMark what?|%s requires following letterBad mark|Mark must specify a letterlistmapmarkmovenumberopenputpreservePreserve failed!File preserved.printquitrewindNo write@since last chage (:rewind! overrides)readsetshell-isourcestopsuspendOld tty driver|Not using new tty driver/shellsubstituteunmapunabbreviateundoversion@(#) Version 3.6, 11/3/80.vwqwritexityank@* Bad registerAt EOF|At end-of-file%d-cWhat?|Unknown command character '%c'@(#)ex_cmds2.c 6.1 10/18/80Extra chars|Extra characters at end of command [Warning - %s is incomplete]%d files@to editNo more files@to editExtra chars|Extra characters at end of "%s" command%d more file%s@to editNo write@since last change (:%s! overrides)lpgcrWhat?|%s: No such command from open/visualWhat?|%s: Not an editor command[Hit return to continue] @(#)ex_cmdsub.c 6.1 10/18/80Out of memory@- too many lines in file[%sLine overflow|Result line of join would be too long%s where?|%s requires a trailing addressThat move would do nothing!Move to a moved lineCannot put inside global/macroLine too long|Result line after shift would be too longBad tag|Give one tag per lineNo previous tag%s: Bad tags file entryNo write@since last change (:tag! overrides)e! No tags file%s: No such tag@in tags fileCan't yank inside global/macro At EOFHit BOTTOMHit TOPCan't undo in global@commandsNothing to undoNothing changed|Last undoable command didn't change anythingMissing lhs Missing rhsNo tail recursion:Too dangerous to map thatNot mapped|That macro wasn't mappedToo many macrosToo much macro text@(#)ex_data.c 6.1 10/18/80autoindentaiautoprintautowriteawbeautifybfdirectoryedcompatibleerrorbellsebhardtabshtignorecaseiclispmagicmesgnuoptimizeoptparagraphsparapromptreadonlyredrawremapreportscrollscrsectionssectshshiftwidthswshowmatchsmslowopenslowtabstoptstaglengthtltagstermtersetimeouttottytypettywarnwindowwiwrapscanwswrapmarginwmwriteanywa@(#)ex_get.c 6.1 10/18/80 %4d Input line too long^H discarded @(#)ex_io.c 6.2 10/23/80No file|No current filename"%s" [Read only] [Not edited] [Modified]No file line %d of %d --%ld%%--Pattern too longecho #%|Argument buffer overflowNo alternate filename@to substitute for #No current filename@to substitute for %%Can't make pipe to globCan't fork to do glob/dev/nullArg list too longNo match~{[*?$`'"\Missing filenameAmbiguous|Too many file namesFilename too long [New file] Block special file Teletype Character special file Directory Executable Archive Non-ascii file$Write forms are 'w' and 'w>>'/dev/tty File exists| File exists - use "w! %s" to overwrite File is read only Use "w!" to write partial buffer [Existing file] [Incomplete last line] Line too longToo many nested sources %d/%D %d line%s, %D character%s (%D null, %D non-ASCII@(#)ex_put.c 6.4 11/8/80({)}!|^~'`%6d Open and visual must be used interactively@(#)ex_re.c 6.2 10/23/80Global within global@not allowedGlobal needs re|Missing regular expression for globalGlobal command too longsubstitution loopFail|Substitute pattern match failedSubstitute needs re|Missing regular expression for substituteNo previous re|No previous regular expressionNo previous substitute re|No previous substitute to repeatReplacement pattern too long@- limit 256 charactersLine overflow@in substitute%d subs|%d substitutions on %d linesRegular expressions cannot be delimited by letters or digitsNo previous scan re|No previous scanning regular expressionNo previous substitute re|No previous substitute regular expressionBadly formed re|Regular expression \ must be followed by / or ?Missing closing delimiter@for regular expressionRe too complex|Regular expression too complicatedUnmatched \(|More \('s than \)'s in regular expressionAwash in \('s!|Too many \('d subexressions in a regular expressionExtra \)|More \)'s than \('s in regular expressionReplacement pattern contains &@- cannot use in reReplacement pattern contains \d@- cannot use in reIllegal *|Can't * a \( ... \) in regular expressionIllegal *|Can't * a \n in regular expressionBad character class|Empty character class '[]' or '[^]' cannot match]-^\Missing ]No newlines in re's|Can't escape newlines into regular expressionsBadly formed re|Missing closing delimiter for regular expressionRe internal error@(#)ex_set.c 6.3 10/30/80allw300w1200w9600%s: No such option@- 'set all' gives all option valuesOption %s is not a toggleMissing =@in assignment to option %sDigits required@after =String too long@in option assignmentCan't change type of terminal from within open/visual%s%sno%s=%d%s=%s@(#)ex_subr.c 6.3 11/8/80 %c%sNonzero address required@on this commandNo lines@in the buffermore fewer %d %slines@in file after %sOut of memory@saving lines for undo - try using edError 0Not super-userNo such file or directoryNo such processInterrupted system callPhysical I/O errorNo such device or addressArgument list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeMath argumentResult too largeQuota exceededSystem error %demt trap, _ovno is %d @ - try again Interrupt/usr/lib/ex3.6preserveexpreserve@(#)ex_temp.c 6.2 10/23/80/ExXXXXX Tmp file too largeOut of register space (ugh)Nothing in register %cCan't put partial line inside macroRegister too long@to fit in memory/usr/lib/makekeycrypt: cannot generate key@(#)ex_tty.c 6.2 10/30/80xxxx|dumb:((liupjdownleftrightHhomesuspco%s: Unknown terminal typeambsdadbeohchzinmincnsosulxbxnxtxxalbcbtcdceclcmcrdcdldmdoedeik0k1k2k3k4k5k6k7k8k9hoicimipkdkekhklkrkskullndnlpcsesfsosrtatetiupvbvsve@(#)ex_unix.c 6.1 10/18/80Incomplete shell escape command@- use 'shell' to get a shell%#!Command too longNo previous command@to substitute for !No filename@to substitute for %%[No write]|[No write since last change]No previous command@to repeat!%sCan't make pipe for filterNo %s! Can't make pipe Can't make pipe for recovery Can't fork to execute recovery No recovery routine@(#)ex_v.c 6.1 10/18/80Fail|Pattern not found on addressed lineCan't use open/visual unless open option is setRecursive open/visual not allowed[Using open mode]Visual needs addressible cursor or upline capabilityCan't use visual on a terminal which overstrikesVisual requires clear screen capabilityVisual requires scrolling+-^.Screen too large for internal bufferDon't know enough about your terminal to use %sTerminal too wideScreen too large@(#)ex_vadj.c 6.2 10/23/80Internal error: vscrollNo lines in bufferInternal error: vredraw@(#)ex_vget.c 6.2 10/23/80Input read error({)}!|^~'~%d %slineMacro too long@ - maybe recursive?@(#)ex_vmain.c 6.2 10/23/80Infinite macro loope! #e #&@(#)ex_voper.c 6.2 10/23/80/^+-.@(#)ex_vops.c 6.3 10/23/80@(#)ex_vops2.c 6.2 10/23/80^@(#)ex_vops3.c 6.2 10/23/80().!?)]'({[)}][]{}@(#)ex_vput.c 6.1 10/18/80Internal error: vclreolInternal error: vgotoLine too long for open@(#)ex_vwind.c 6.1 10/18/80@(#) printf.c:2.2 6/5/79@(#)printf.c 6.1 10/18/80(null pointer)^YXЬU&`P[]kYk/D&EPPPݬP[ݬu&[Pb&yPPЬ[YX*ݏ\PXPYIZYZ [*\#[P[P/%kݬ&P1,Z1p ^Q PP[{:[%KP[ktcP[~߭ޭZj:ZZj 並 b%߭$PZZj:Z [QQP$*%B[PPP@jZ~[ 1K Zj#EPjkZ[kkj| j:jPjj: j|Zj‘j:ZЬ[Ь[k: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;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=W((xWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj$ ~P G? BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[ 1xݏPZZ  YYX ZYYXZYZ~HPY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[  Ь[Z = 8[ePZ~9PZ ݫ; ԫ kZP{HP8P^߭ݬTPPPPݬݏ tݬݬݏtݬ6.--~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZv [-PhYPƏPxPObPZx<PZPPZx,~@PZZZ PZPxPZPPjj-1xYP[PZkk[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j~\S^\_P|CЬgPЬPЬRRQ{RPPR PRPPP5 P@(#)file.c 4.1 10/1/80LNPTY^behq| rCan't open %s %s: %s: cannot stat characterdirectory char multiplexor block multiplexor block special (%d/%d) cannot open empty demand paged pure jfr or pdp-11 unix 411 executable executable not stripped (old format symbol table) very old archive old archive cpio data ! __.SYMDEFarchive random library ! archive data c program textc program textfortran program textassembler program textroff, nroff, or eqn input textassembler program textroff, nroff, or eqn input textassembler program texttroff (CAT) output data commands texttroff intermediate output textEnglish textascii text with garbage xTresinitfont202V0p1functionsubroutinecommondimensionblockintegerrealdatadoublechmkmovtstclrjmpintcharfloatdoublestructexterngloblbytealigntextdatacomm  AAAAAABBBBBB ))!.bin/f77 755 0 33 31540 2532106507 5157 +t ^Юn PPՀPpPP+ P't^P+P+P+~P+P:9PxP~PD<,6<P,'<P, <<׬լ1ЬP`P`-ЬP`PЬP`[k͘kPPg1F1PN1o1uPE118P611P11k~+w+2P};v;BP2WPFoPaPPlRPm_Ptak~+[1F[kPP1[7*1[0*1[)*1["*1[*1[*1[*169~x+)] 6 6***z*ks*m*1H*O[*U*P@.[ʐN<*6*+[k~P***kP@.琏X))1k~*( ‘4[)1*?),%))1~)1t)1w*91l*($)1v)L*($1:*[1$P 1*)1(ЬP`d(׬1;)1_21x4s~)' -[881[(P(k` ((1[(P(k` ((1nPC11PI1QPF191PM11PT1)PRPO11PS1B1zPc1MPU1n1]Pd1C1NPp1i,Pm1Pl11#Po1[1Pv1Pu11Pw11j'p7P&`r' &P&PPM7F7ԭ1BPf13Po1PrPPs1iK(ЭP@!P1֭ЭP@#&1Pc1.PeЭP@ P &1ޭ[ЭP@ PЭP֭ܐ`f&M54%q'xxPP5 154ѭe߭4%''߭w4%'xxP& C4X խ%߭B 1%ЭP@ ЭQPAA33 PtftЭP@P1ЭP@s PP, P1yЭ55.51gЭP@33 PPF1ЭP@P1/ЭP@PЭP@ PP P1Э41ЭP@P1ЭP@%#ЭP@#%x~xKPЭP@^ PP P*1sЭP@ PЭP@44֭ѭ1##332#~4^Ь222=2ݬ""$44rP!P1y$e"4>2P PDWPݬԭ11l1}ЭP=$!^">$!Yw11! $߭߭4^1ݬxP[ݬPc"i1 1##4R4P1(01#44!6skݭ0i0n#44ok1!Q# 3%0K09#44c/ݭ| #4k48P #A=!# / ^Ь[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error. No assembly. compiler error. PASS2.%s %s >%s%s %s %s/lib/c2mv %s %scat %s %s >%s ASM.cat %s >>%s%s -o %s %sassembler error -lg-oLOAD.%s couldn't load %s %s /usr/bin/rawCannot load %sNo shell!%s: too largebad wait codeTermination code %drError: Cannot read file %s writing errorxsadSopzA/tmp/%s%d.%scannot open intermediate file %sout of memoryCompiler error in file %s: %s Error in file %s: %s sort %s >%scall sort status = %dra.data 2%s: overlapping initializationsbad intermediate file formatbad intermediate file formatinitialization out of bounds @(#) FORTRAN 77 DRIVER, VERSION 2.03.5, 7 NOVEMBER 1980 -lF77-lI77-lm-lc/usr/lib/f77pass1/lib/f1/bin/as/bin/ld/lib/crt0.o/lib/mcrt0.om4/bin/sha.outfort.byte 0%o,0%o %s .space %ld %s:  AAAAAABBBBBB |7|7l3T=outfort.byte 0%o,0%o %s .space %ld %s:  AAAAAABBBBBBbin/find 755 0 33 34000 2552600303 5461 , ^Юn PPՀPpPP+ P% ^Za6`++σPPݏχ6ݭ,v6ύ@k6Ь6Ь#6Ѭ{+U/(υ%Э5Ox5P5PPP-Gm+x5P5P`w%P-U+xϾ5P5P`]%Pϩ5֭Pϝ5Pѭ1| P+.ϙ$n5+Ϫ.}$U51Zψ5ϓxB5PA5P`Ϫ/i%/ϟ/ϲ$P[:[Zkϋ/υ/P*PPNPϼ*:. j$/kZZPN/PP4ݭP?/f 4Ͼ41eϻ4%ύ*/$43 R5~|*Ϩ$?P[l*P$P.P[mϺG4@4>4[P {P[PZ!*Z#Pυ.P[q)Zϣ#P#)Zϔ#Pj-)Zπ#P33Ͽ3Ͻ3[P".ϳ), #.Ϻ)5P4#PPϽm3f3d3 ^P[u)["P,Ϯ-ϹPP[S)["P1rЭP>)[Ϸ"PuZW^ϐPZj+Z )[|"P)[m"P~ZP((2([K"P~ZP2([)"PSZ( PP7ϻ(Z5 P~ZϐP1Nϟ(σ+Vϳ!~ݭϠ([!P~ZPP1σ([Ϥ!PSZy(ρPP7s(Zϰ P~Z Pϻ1W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bPbլQP= P((/ pwdrUsage: find path-list predicate-list (!find: parsing error find: missing conjunction /find: bad starting directory TRAILER!!!%D blocks -o-a(!-ofind: operand follows operand !()-print-name-mtime-atime-user/etc/passwd[0-9]*find: cannot find -user name -inum-group/etc/group[0-9]*find: cannot find -group name -size-links-perm-type-exec;-ok;-cpiofind: cannot create < %s > -newerfind: cannot access < %s > find: bad option < %s > find: incomplete statement < %s ... %s > ? ./TRAILER!!!find: cannot copy < %s > ;{}rfind: bad status < %s > .find: cannot open < %s > find: cannot read < %s > find: cannot read < %s > find: bad directory tree ..find: bad directory <%s> find: errno: %d, find: can't %s write outputread inputIf you want to go on, type device/file name %s when ready/dev/ttyrThat didn't work@(#)find.c 4.4 (Berkeley) 7/3/81/bin/shPATH:/bin:/usr/binsh/bin/shsh-c;;1@bin/graph 755 0 33 40000 2532107604 5643 4^Юn PPՀPpPP3P4.pPݏݏ99v3:V9PvP9 .P9.P99QA`9ݬݬ=3T9.9 9~Q9 e PЬP ЬPv24 ^v2 9V9PvP8v28V8PvP811=Paa1P-ЬP`1e2\~\~߭9P1VPqP2 R21VPqPp2J:212v^28\~\~8P\~\~f8P11711.Pb1.A81\~\~7 1\~\~7\~\~7YP11\~\~7:P11Pc1Ѭ1(1ЬPР7׬1Pd11APh1sePg1N0\~\~߭PЬP`PP0PnPPvPVPqP11VPqP0J01Pl1p7Ѭ1׬ЬP`ЭP֭ЭQ֭`a1Ps1w(Pr1\~\~T6 P1Ptt6rЬP`P`PPm11Pu1vPx1!$Pw'\~\~5PPy1"׬Ь[Ѽм PРP`l׼  ݬ ݬ[~>Pkݬ ݬ[~%Pݬ ݬ [~ P^Ь [ѼPkPРP`+kP֠瘭P@3P-kPРPA.kPݠvP׼kP^.-4 P454b v.44P P~4*PPЭ4A.Ln4PV4RdPRV4P`RP 4R4RvPb 4P|4PP~ P t4P]4P~ P X4PA4P P[[ 04Q4QP4[1<^4(83(83s3ޭP(8`3[; [P3PP` [P3P [Q3QPa [P3PP[[3 ^3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ZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj ~P   BЫZ֫ZPѫPѬ ZPPXPZ~5PYZkn 1mЫZ3[p1xݏPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~`PY PP[ [[[ Ь[Z = 8[ePZ~YPZ ݫs ԫ kZP{ Ь[ЬZkPkPzQQPP^߭ݬlPPP|l\PЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6 P.,,}~*PYi[nk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ* [,PYPƏPxPbPZxPZPPZx~@PZZZPZPxPZPPjj,1xYP[PtZmehkYRk[P Ь[[ZZZ9jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@jP~\S^\5P,ЬPЬPЬRRQ{RPPR PRPPЭRBQPLPbPbլQPPunknown flag %s DEBUG# %s STARTr%s directory unreadable stat on %s failed unlink file %s /usr/lib/uucp/usr/spool/uucp/usr/lib/uucp/L.sys/usr/lib/uucp/L.sys.cr/usr/lib/uucp/L-devices/usr/lib/uucp/L-dialcodesuuclean deleted file %s mail %sw%s/etc/passwdrr/bin/shsh-c0$0$,pool/uucp/usr/lib/uucp/L.sys/usr/lib/uucp/L.sys.cr/usr/lib/uucp/L-devices/usr/lib/uucp/L-dialcodesuuclean deleted file %s mail %sw%s/etc/passwdrr/bin/shsh-c0$0$bin/iostat 755 0 33 24000 2552600304 6044 ^Юn PPՀPpPP PL^ϿϦ϶Ϸ  MPϼ Pϓ ԭЬPРP`- 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PݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPQ@j~\S^\_PCЬPЬPЬRRQ{RPPR PRPPPuP\@pCpCCzE@/vmunixdk_busy not found in /vmunix namelist /dev/kmemcannot open /dev/kmem dk%d tty %3.3s cpu tin tout sps tps msps us ni sy id %4.0f%5.0f %4.0f%4.0f%5.1f %4.0f%4.0f%5.1f %3.0fiostat: Disk init info not in namelist %c%c%d%c%c%d@(#)iostat.c 4.6 (Berkeley) 81/04/21_dk_busy_dk_time_dk_xfer_dk_wds_tk_nin_tk_nout_dk_seek_cp_time_dk_mspw_mbdinit_ubdinitrH%H%( )bin/install 755 0 33 376 2532110205 6153 cmd=/bin/mv case $1 in -s ) /bin/strip $2 shift ;; -c ) cmd=cp shift esac if [ ! ${2-""} ] then echo 'install : no destination specified.' exit 1 fi $cmd $1 $2 if [ -d $2 ] then file=$2/$1 else file=$2 fi chmod 755 $file /etc/chown root $file /pT,pT5 /,"bin/join 755 0 33 22000 2532110313 5470 (( ,^Юn PPՀPpPP P|^1Pe1Pj1CPo1Ptw1ЬPРP`-1ЬPРPЬPРPPPaЬPРPPP1 P23'15+'1-#'1%ЬPР:׬1ЬPРP1&sЬPРP.|&P@*&ЬP~ϸ&QPAq%5ЬPРP.1ЬP~ό&QPAE%ρ&P@%׬o&k&(yЬPРP`11vЬPРP`2ZЬPРP1ЬPݠs2ЬPРP2ЬPݠWP2ЬPݠDPP׬׬Ѭ1kԭ ЭP@ϑ$֭ѭ%Ѭ P@Ͻ#Z$P@$Q$ЬPРP`- Lϑ'ЬPݠSPzЬPݠϼЬPݠ,PWЬPݠϬϕϮP6PϖPխխ %PPխ"խ P@G#P@"pPխ$ݭխ"խP@ #ϽP@ϯ"2Pխϑ$ ݭϤP1^խBχP@"yP@k"P%ݭݭiOPϯPݭ0+ϔPωP8խ8P@X" P@!ρPݭݭOPխխ%խ P@"P@ϼ!?P1sխݭϞϙЭ1d ^x P@υŏPP@u!ЬP@b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P׭PZ[xYPZPP[xYPZP[PP%5@j~\S^\_PCЬPЬPЬRRQ{RPPR PRPPP(P  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ @(`mtm  Unknown option %crCan't read input file %sstandard inputINITIALINITIAL/usr/lib/lex/ebcformrLex driver missing, file %sToo little core to beginToo little core for state generationToo little core for final packingOOPS - calloc returns a 0%s /usr/lib/lex/ncform/usr/lib/lex/nrform"-#+" ). "  "  *$%&'(,!!!!! ,)&J.^( *+?|/$,})}}     # define YYNEWLINE %d yylex(){ int nstr; extern int yyprevious; Too little core for parse treeToo little core for parse treech table needs redeclaration%T%tCharacter value %d out of rangeCharacter '%c' used twiceCharacter %o used twiceToo late for language specifier%}%s Premature eof , , ,# define %s %d Too many start conditionsStart conditions too longInvalid request %s%s Substitution strings may not begin with digitsNo translation given - null string assumed%d case %d: goto 30997 break; Executable statements should occur right after %%%}%s %d case %d: Definition %s not foundUndefined start condition %sToo many start conditions usedString too longNon-terminated stringNon-portable Character ClassToo many large character classes%s yacc stack overflowsyntax errorToo many definitionsDefinitions too longToo many large character classesExtra slash removedIteration range must be positiveCan't have negative iterationCan't have negative iteration%d: (Error) %d: (Warning) lex.yy.%cwCan't open %s# EOF inside commentNon-terminated string or character constantEOF in string or character constantAction does not terminatePremature EOFrCannot open file %sParse tree too big %s Try using %e numParse tree too big %s Try using %e numParse tree too big %s Try using %e numToo many characters pushedToo many packed character classesToo many positions %s Try using %p numblockdata common /Lvstop/ vstop define Svstop %d integer vstop(Svstop) int yyvstop[] ={ 0, bad state %d %oToo many states %s Try using %n numend 0}; bad transition %d %dToo many transitions %s Try using %a numToo many positions for one state - acomputeToo many right contextsdata vstop(%d)/%d/ %d, data vstop(%d)/%d/ %d, data vstop (%d)/0/ 0, output table overflowj %d nchar %d ctable.nch %d output table overflowdefine YYTOPVAL %d verifadvanstoffsfallextramatchatable# define YYTYPE %s intcharstruct yywork { YYTYPE verify, advance; } yycrank[] ={ %d,%d, 0,0, 0,0}; struct yysvf yysvec[] ={ 0, 0, 0, yycrank+%d, yysvec+%d, 0, yyvstop+%d,0, 0, 0, 0}; struct yywork *yytop = yycrank+%d; struct yysvf *yybgin = yysvec+1; char yymatch[] ={ '%c' ,0%-3o,No space for char table reverse0%-3o,0}; char yyextra[] ={ %d,0}; block data common /L%s/ %s define S%s %d integer %s (S%s) data %s (%d)/%d/, end block data common /L%s/ %s define S%s %d integer %s (S%s) data %s (%d)/%d/, %s (%d)/%d/end # include "stdio.h" # define U(x) ((x)&0377) # define U(x) x # define NLSTATE yyprevious=YYNEWLINE # define BEGIN yybgin = yysvec + 1 + # define INITIAL 0 # define YYLERR yysvec # define YYSTATE (yyestate-yysvec-1) # define YYOPTIM 1 # define YYLMAX 200 # define output(c) putc(c,yyout) %s%d%s # define input() (((yytchar=yysptr>yysbuf?U(*--yysptr):getc(yyin))==?(yylineno++,yytchar):yytchar)==EOF?0:yytchar)# define unput(c) {yytchar= (c);if(yytchar=='\n')yylineno--;*yysptr++=yytchar;} # define yymore() (yymorfg=1) # define ECHO fprintf(yyout, "%%s",yytext) # define REJECT { nstr = yyreject(); goto yyfussy;} int yyleng; extern char yytext[]; int yymorfg; extern char *yysptr, yysbuf[]; int yytchar; FILE *yyin ={stdin}, *yyout ={stdout}; extern int yylineno; struct yysvf { struct yywork *yystoff; struct yysvf *yyother; int *yystops;}; struct yysvf *yyestate; extern struct yysvf yysvec[], *yybgin; integer function yylex(dummy) define YYLMAX 200 define ECHO call yyecho(yytext,yyleng) define REJECT nstr = yyrjct(yytext,yyleng);goto 30998 integer nstr,yylook,yywrap integer yyleng, yytext(YYLMAX) common /yyxel/ yyleng, yytext common /yyldat/ yyfnd, yymorf, yyprev, yybgin, yylsp, yylsta integer yyfnd, yymorf, yyprev, yybgin, yylsp, yylsta(YYLMAX) for(;;){ 30999 nstr = yylook(dummy) goto 30998 30000 k = yywrap(dummy) if(k .ne. 0){ yylex=0; return; } else goto 30998 while((nstr = yylook()) >= 0) yyfussy: switch(nstr){ case 0: if(yywrap()) return(0); break; case -1: break; default: fprintf(yyout,"bad switch yylook %%d",nstr); } return(0); } /* end of yylex */ 30998 if(nstr .lt. 0 .or. nstr .gt. %d)goto 30999 nstr = nstr + 1 goto( %d, 30999),nstr 30997 continue } end %d/%d nodes(%%e), %d/%d positions(%%p), %d/%d (%%n), %ld transitions , %d/%d packed char classes(%%k), %d/%d packed transitions(%%a), %d/%d output slots(%%o)xx8((bin/lint 755 0 33 773 2532112360 5460 L=/usr/lib/lint/lint T=/usr/tmp/lint.$$ PATH=/bin:/usr/bin O="-C -Dlint" X= P=unix LL=/usr/lib/lint trap "rm -f $T; exit" 1 2 15 for A in $* do case $A in -*n*) P= ;; -*p*) P=port ;; esac case $A in *.ln) cat $A >>$T ;; -l*) cat $LL/llib$A.ln >>$T ;; -[IDOU]*) O="$O $A" ;; -X) LL=/usr/scj/lint L=/usr/scj/lint/lpass ;; -*) X="$X$A" ;; *) (/lib/cpp $O $A | ${L}1 $X >>$T)2>&1 esac done case $P in unix) cat $LL/llib-lc.ln >>$T ;; port) cat $LL/llib-port.ln >>$T ;; esac ${L}2 $T $X rm -f $T "bin/newgrp 4755 0 33 26000 2552600310 6066   ^Юn PPՀPpPP P ѬϷ ЬPݠϐP'%ЬPݠϯύ υ PFP%ϟj Ϸ[$$Px[QQ P`ϦP[$Px[QQ P`ϲ$Px[QQ P`![ߜ$oPP O$PРP`Hv$PРP`;e$Pݠ%4P9PK$PݠP ϭ *$PݠP τ P[[[#PР P` #PР PϱPPϰ8υ^[ЬPKBQQA`K+ЬPKGQQA`K+[[YH+ZJy+Jr+Z+|+ZJr+Jk+Zz+YYPKQPQZJP0[Q-Q@+JaJP0[Q-QZQ@*Z[[1Y^ZЬPJQQA`J..@ZԭլíЭZJ(.JB. ZZJ-P0Q-Q@.PJaQQPPJQ.0ZZZ[KE.PxZQ!QK-.RxRRK".SxSSSRK.SxSSSRK.SSSSRK-SxSSSRRQxPP@aYxZPP[YPPK-YPPK-YPPK-xYPPPPK-ZZ1NZJP@g-PJ-QQPPJ- ZZJ'-J, Z֭ѭ1ZJ,[J,J,[J, ZZJP@,J@Z^[K2-B[[1[@.ZZPPPxPYPPPPK-Z[Z[֬Y,[K,B[[KK+0[[Y֬YK,YZYY9Y.YZZPxPYPP;[PZP@+[PZP[QZQ@+A+[PZP@+ZZ[[[7,4[[YZxYY[PZP@,PPYZ.YY9YYZYYK3,[[ K%,, ,, ,P Ь['PZ[jPP9ZPP   Ь[ЬZ kPPZ[kk[P ZX@aP>P3ݏ3+P[[$/:[P[[/:[nP[PTP...:[EP[ [7.Z[,[ P[kj.P ^2PP  ݭ}  P߭ЭP~"2߭ЭP~ݬ#re|/[Z3[7Z׽ЭPРQ֠aP ݭPZP Ĕk L߭ЭP~Pݭ4 ѭD$ ݭZ/Pݬ \~ݬ ЬP PP Ь[PZѪ[:ZP P Ь[k:[kk[PPPݏ.P[[2[P[[1[xP[[P1[\P[[jP111[/P[[1[P[[1[ P[[1k [kkX1PЬ[ZYk94 ZPQPQ0QZY[[kPP P P+P-k0YZPZPЬ [ЬY׬&k ЫP֫`P [|PZZZ Z YPЬPQPЬ[ XXVPX 鑫+PPPYkw+ݏݬPZY1ZZ kalYPPPݬPZ<3ݏݬ}PZYZZݬPZZ)ZYPPPݬPZZ1hZY kr  XPt [=0P@X[ݬPZZݬ [P[P X b | *<H^p|$<I_nzError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large Ь[ZZPZ jkr kaݬ +   ZPH\~ݬP?PPЬ[[G ~kЫ0   Ь[  P ݏ P ի ߘP@6+ [D$   P2PPݫ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sorry setgid/bin/sh-iNo shell! @(#)newgrp.c 4.1 (Berkeley) 10/1/80:2*" <4,$ >6.&@80( 91)! ;3+# =5-% ?7/'(08@ '/7?&.6>%- 5=$, 4<#+ 3;"* 2:!) 1991)! :2*" ;3+# <4,$?7/'>6.&=5-%      )4%/7(3-!0,1'8"5.*2$                                                                                                                                     /etc/grouprr/dev/ttyr%s /etc/passwdrrUnknown error: #))% <bin/lookbib 755 0 33 427 2532122551 6132 A= case $1 in -p) A="$1 $2" shift; shift;; -*) A=$1 shift;; esac case $1 in -p) A="$A $1 $2" shift; shift;; -*) A="$A $1" shift;; esac if test $1x = x then /usr/lib/refer/mkey -s else echo $* | /usr/lib/refer/mkey -s fi | /usr/lib/refer/hunt $A /usr/dict/papers/Ind /pT,pT5 /,"bin/lorder 755 0 33 620 2532122554 5776 trap "rm -f $$sym?ef; exit" 0 1 2 13 15 case $# in 0) echo usage: lorder file ... exit ;; 1) case $1 in *.o) set $1 $1 esac esac nm -g $* | sed ' /^$/d /:$/{ /\.o:/!d s/:// h s/.*/& &/ p d } /[TD] /{ s/.* // G s/\n/ / w '$$symdef' d } s/.* // G s/\n/ / w '$$symref' d ' sort $$symdef -o $$symdef sort $$symref -o $$symref join $$symref $$symdef | sed 's/[^ ]* *//' /pT,pT5 /,"bin/m4 755 0 33 42000 2532123421 5057 4 ,^Юn PPՀPpPP3 P,|^G44444P0PРQ֠aPS0P@#0P@"/YYY1x{//k7 Рj1EZޭPZP06}{/ ̀p/2g/a/PQPQ0f6G8Z5/.#... /..P`PQV/P@&/QaQQ@/PQ`5/P@/PРQ֠aP/P@.PYYq.k.Y-)[.U.(N.H.<.i.PԠ1W1YP-QPQ1| .2.--P`PQ|.P@L.QaQQ@?.PQ`[.P@+.PРQ֠aP@.P@.PYYP -QPQ |61YP,QPQ|Y.4}-9-1/--PРQ֠Ya1-Ym#1Y--1Y#1Y,,,-,,P`PQX-P@(-QaQQ@-PQ`7-P@-PРQ֠aP-P@,PYP 1Y,1v,6,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PPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP<@j ~\S^\ P Ь PЬPЬRRQ{RPPR PRPPЭRBQP3PbPbլQP3P(`',Q@@@;;;unixmaketempifdeflenundefineshiftchangequotedefineevalincludesincludesyscmddumpdeferrprintincrsubstrindextranslitifelsedivertdivnumundivertdnl/tmp/m4aXXXXXrm4: file not found: %s m4: arg(( stack overflow m4: call stack overflow m4: EOF in string m4: unexpected EOF rm4: argument overflow m4: pushback overflow m4: no space for alloc m4: no space for alloc m4: %s defined as itself m4: shift not yet implemented `%s' `%s' `%s' `%s' m4: invalid expression in eval: %s rm4: file not found: %s wrr  !  (   !"#$%&'        /!(-+|&+-*/%) yacc stack overflowsyntax error//bin/shsh-chh=lbin/man 755 0 33 1330 2532124164 5300 cmd= sec= fil= opt= i= all= cmd=n sec=\? cd /usr/man for i do case $i in [1-8]) sec=$i ;; -n) cmd=n ;; -t) cmd=t ;; -k) cmd=k ;; -e | -et | -te) cmd=e ;; -ek | -ke) cmd=ek ;; -ne | -en) cmd=ne ;; -w) cmd=where ;; -*) opt="$opt $i" ;; *) fil=`echo man$sec/$i.*` case $fil in man7/eqnchar.7) all="$all /usr/pub/eqnchar $fil" ;; *\*) echo $i not found 1>&2 ;; *) all="$all $fil" ;; esac esac done case $all in "") exit ;; esac case $cmd in n) nroff $opt -man $all ;; ne) neqn $all | nroff $opt -man ;; t) troff $opt -man $all ;; k) troff -t $opt -man $all | tc ;; e) eqn $all | troff $opt -man ;; ek) eqn $all | troff -t $opt -man | tc ;; where) echo $all ;; esac ;; -w) cmd=where ;; -*) opt="$opt $i" ;; *) fil=`echo man$sec/$i.*` case $fil in man7/eqnchar.7) all="$all /usr/pub/eqnchar $fil" ;; *\*) echo $i not found 1>&2 ;; *) all="$all $fil" ;; esac esac done case $all in "") exit ;; esac case $cmd in n) nroff $opt -bin/ptx 755 0 33 26000 2532137164 5365  %^Юn PPՀPpPP Pd ^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X>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj ~P ,, BЫZ֫ZPѫPѬ ZPPXPZ~!PYZkn 1mЫZ3["1xݏ?PZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~LPY PP[ [[[  Ь[Z = 8[ePZ~9PZ ݫ ԫ kZP{P^߭ݬDPPPxݬݏ tݬݬݏtݬ6<Ь[ѬP ѫѫk֫k׫ЫP`P PЬPЬRRQ{RPRPPPRRP1.M1M11111~*PY1[1k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZn1 [MP`1YPƏPxPG1bPZx41PZPPZx$1~@PZZZ10PZP0x0PZPPjj0M01xYP[P0Z000k00k[P Ь[[ZZZ}0jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP/@j ~\S^\wP[ЬPЬPЬRRQ{RPPR PRPPլQP'P"H1"""-dt-dft$ /usr/lib/eignWrong width:Lines truncated to 200 chars.Only file already given.Ignore file already givenIllegal argument:Too many filenameswCannot open output file:rCannot open break char fileOut of memory spacerCannot open fileToo many wordsToo many words in file/tmp/ptxsXXXXXwCannot open output for sorting:rCannot open data: Cannot fork/usr/bin/sort/usr/bin/sort+0-1+1-o%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JJk[P Ь[[ZZZJjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPI@j&~\S^\_u&Pl&CЬW&PЬPЬRRQ{RPPR PRPPP=AP"<=4;:;:;:XYCE>DAB?@CE>DAB?@CE>DAB?@wxyz"5{WVNMiLKO97o\Q Z~vu[tsq|"]2r^_`a8$#%&'0"3( )*+h  -/.,!p$#%&'0"XY3( )*+wxyzXY  -/.,!$#%&'0"jkl( )*+  -/.,!$#%&'03( )*+  -/.,!$#%&'06( )*+P  -/.,!$#%&'0( )*+  -/.,!1FGHIJ}RSTU}bcdefgmn1111ooooo@oooo@oooooo@@@@oo$oo@@@@@b<`][aZYWV\GUmTSQPON0LJIHGFEDBA6  ! ""  )!$&'(%.{ -*,+  #"26745031{{{{{{/  }}}}}}}{{{{}}}}')MNOHIKJ2TUVWXYZ[\ ,QR?@789:;<=>E-./0L]^PAB3456"#+F%&( S!* $CD 1G yacc stack overflowsyntax errorsyntax error. from: old ps %d, new ps %d, fflg %d . to: old ps %d, new ps %d .nr 10 %du .ds %d \v'-1'_\v'1' .ds %d ^ .ds %d ~ .ds %d \v'-1'.\v'1' .ds %d \v'-1'..\v'1' .ds %d \v'-1'\l'\n(%du'\v'1' .ds %d \l'\n(%du' .as %d \h'-\n(%du-\n(%du/2u'\v'0-\n(10u'\*(%d\v'\n(10u'\h'-\n(%du+\n(%du/2u' . diacrit: %c over S%d, h=%d, b=%d . e:eb: S%d <- S%d S%d; b=%d, h=%d \|.nr %d \w'\s%d\*(%d%s' .ds %d \h'|\n(97u-\n(%du'\*(%d .as %d "%s\*(%d .ft %c . setfont %c . b:fb: S%d <- \f%c S%d \f%c b=%d,h=%d,lf=%c,rf=%c .ds %d \f%c\*(%d\f%c .ft %c .ds %d \*(%d\h'-\n(%du+%du'\*(%d . fat %d, sh=%d .ft %c .nr %d \n(%d .if \n(%d>\n(%d .nr %d \n(%d .if \n(%d>\n(%d .nr %d \n(%d .ds %d \v'%du'\h'\n(%du-\n(%du/2u'\s%d\*(%d\s%d\h'-\n(%du-\n(%du/2u'\v'%du'\ \h'\n(%du-\n(%du/2u'\*(%d\h'\n(%du-\n(%du+2u/2u'\ \v'%du'\h'-\n(%du-\n(%du/2u'\s%d\*(%d\s%d\h'\n(%du-\n(%du/2u'\v'%du'\ . from to: S%d <- %d f %d t %d; h=%d b=%d \(*S\(cu\(ca\(*Pfunny type %d in funny.ds %d %s . funny: S%d <- %s; h=%d b=%d  1. integral: S%d; h=%d b=%d \(is.ds %d %s W%s.nr 99 \n(.s .nr 98 \n(.f .nr %d \w'\*(%d' .nr MK %d .if %d>\n(.v .ne %du .rn %d 10 \*(10 .ps \n(99 .ft \n(98 .EN%sinput line too long: %.20s .nr 99 \n(.s .nr 98 \n(.f .rm %d .as %d "%s .as %d \*(%d .ps \n(99 .ft \n(98 .as %d "%s.ps \n(99 .ft \n(98 \*(%d . answer <- S%d, h=%d,b=%d .ds %d \x'0'\x'0-%du'\f%c\s%d\*(%d%s\s\n(99\f\n(98\|\x'%du'no eqn strings left.ps %d .nr %d \w'\s%d\*(%d' -rcan't open file %s.ft %c eqn fatal error: file %s, between lines %d and %d eqn: fatal error: file %s, between lines %d and %d |rcan't open file %spushback overflowquoted string %.20s... too longmissing " in %.20s. lex token = |%s| . found %s|=%s| . %s is not a keyword token %.20s... too longUnexpected end of input at %.20sUnterminated definition at %.20s. name %s defined as %s out of space in strsave on %sInclude not yet implementedBizarre delimiters at %.20s0^#4^"8^<^A^D^ H^2L^6P^7U^0Y^1`^4d^3j^5p^u^y^^^^^^^^ ^!^^$^%^)^&^'^(^.^/^^^^^_ ___*_+ _-$_,)_ ._ 5_<_ @_E_J_ O_R_W_Z___b_g_j_o_r_w_z_______________((________``` ````"`1`5`9`?`E`K`P`U`Z```e`k`p`v`{````````````````````````aa a aaaaa$a*a/a2a7a:a?aDaIaNaSaWa\abagakapatayaaaaaaaaaaaaaaaaaaaaaaaa b bbb%b)b3b8bCbHbSbXbcbhbsbwbbbbbbbbbbbbbout of space in lookupsubsup.ENfromtosumhatvecdyaddotdotdotbartildeunderprodintintegralunioninterpilelpilecpilerpileoversqrtabovesizefontfatromanitalicboldleftrightdelimdefinetdefinendefinegsize.gsizegfontincludeupdownfwdbackmarklineupmatrixcollcolccolrcol>=\(>=<=\(<===\(==!=\(!=+-\(+-->\(-><-\(<-inf\(ifinfinity\(ifpartial\(pdhalf\f1\(12\fPprime\f1\(fm\fPdollar\f1$\fPnothingtimes\(mudel\(grgrad\(gr<<<<>>>>approx~\d~\ucdot\v'-.5'.\v'.5'......,...,,...,alpha\(*abeta\(*bgamma\(*gGAMMA\(*Gdelta\(*dDELTA\(*Depsilon\(*eEPSILON\f1E\fPomega\(*wOMEGA\(*Wlambda\(*lLAMBDA\(*Lmu\(*mnu\(*ntheta\(*hTHETA\(*Hphi\(*fPHI\(*Fpi\(*pPI\(*Psigma\(*sSIGMA\(*Sxi\(*cXI\(*Czeta\(*ziota\(*ieta\(*ykappa\(*krho\(*rtau\(*tomicron\(*oupsilon\(*uUPSILON\(*Upsi\(*qPSI\(*Qchi\(*xand\f1and\fPfor\f1for\fPif\f1if\fPRe\f1Re\fPIm\f1Im\fPsin\f1sin\fPcos\f1cos\fPtan\f1tan\fParc\f1arc\fPsinh\f1sinh\fPcoth\f1coth\fPtanh\f1tanh\fPcosh\f1cosh\fPlim\f1lim\fPlog\f1log\fPmax\f1max\fPmin\f1min\fPln\f1ln\fPexp\f1exp\fPdet\f1det\fP.ds %d \k(97\*(%d . mark %d .ds %d \h'|\n(97u' . lineup %d . %d column of S%d, rows=%d \ \ . colct=%d . row %d: b=%d, hb=%d . matrix S%d: r=%d, c=%d, h=%d, b=%d .ds %d "\*(%d%s .ds %d \h'%s%du'\*(%d -\v'-%du'\*(%d\v'%du' \v'%du'\*(%d\v'-%du' . move %d dir %d amt %d; h=%d b=%d . b:bob: S%d <- S%d over S%d; b=%d, h=%d .nr %d \n(%d .if \n(%d>\n(%d .nr %d \n(%d .ds %d \v'%du'\h'\n(%du-\n(%du/2u'\*(%d\ \h'-\n(%du-\n(%du/2u'\v'%du'\*(%d\ \h'-\n(%du-\n(%du-2u/2u'\v'%du'\l'\n(%du'\v'%du' .ds %d \|\v'%du'\(lf\(bv\(bv\(lf\(lc\(lc\(bv\(bv\b'\(lt\(bv\(lk\(bv\(lb'\(lt\(bv\(lb\(lc\(bv\(lf|||\v'%du'\*(%d\|\v'%du'\(rf\(bv\(bv\(rf\(rc\(rc\(bv\(bv\b'\(rt\(bv\(rk\(bv\(rb'\(rc\(bv\(rf\(rt\(bv\(rb|||\v'%du' . curly: h=%d b=%d n=%d v=%d l=%c, r=%c \b'%s%s%s'. S%d <- %c pile of: S%d;h=%d b=%d .nr %d \n(%d .if \n(%d>\n(%d .nr %d \n(%d .ds %d \v'%du'\h'%du*\n(%du'\ \v'%du'\*(%d\h'-\n(%du'\v'0-%du'\ \v'%du'\h'-\n(%du'\*(%d\v'0-%du'\ \v'%du'\h'\n(%du-\n(%du/2u'\*(%d\h'-\n(%du-\n(%du/2u'\v'0-%du'\ \v'%du'\h'%du*\n(%du' . b:b shift b: S%d <- S%d vert %d S%d vert %d; b=%d, h=%d .as %d \v'%du'\*(%d\v'%du' . shift: %d;ps=%d . shift2 s%d <- %d %d %d .nr %d \n(%d .if \n(%d>\n(%d .nr %d \n(%d .as %d \v'%du'\*(%d\h'-\n(%du'\v'%du'\ \*(%d\h'-\n(%du+\n(%du'\v'%du' . setsize %s; ps = %d . b:sb: S%d <- \s%d S%d \s%d; b=%d, h=%d .ds %d \s%d\*(%d\s%d .ds %d \v'%du'\e\L'%du'\l'\n(%du'\v'%du'\h'-\n(%du'\*(%d . sqrt: S%d <- S%d;b=%d, h=%d \ \|\tconverted token %.25s... too long. %dtext: S%d <- %s; b=%d,h=%d,lf=%c,rf=%c .ds %d "%s xjԍbin/ranlib 755 0 33 22000 2532140335 6007 ^Юn PPՀPpPP P ^׬1;ݼ`1"ЬP`PPP m P2e?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PnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~UPYj0~P  BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[1xݏPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[ Ь[Z = 8[ePZ~9PZ ݫ+ ԫ kZP{P^߭ݬDPPPTDݬݏ tݬݬݏtݬ6 P.~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZZ [PLYPƏPxP3bPZx PZPPZx~@PZZZPZPxPZPPjj1xYP[PZkk[P Ь[[ZZZijPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j~\S^\PЬPЬPЬRRQ{RPPR PRPPЭRBQPPbPbլQPP@(#)ranlib.c 4.3 4/26/81__.SYMDEFrranlib: cannot open %s ! old format not an archive: %s ranlib: warning: %s(%s): no symbol table ranlib: %s(%s): old format .o file ranlib: ran out of memory wcan't create temporary ar rlb %s %s %s ar rl %s %s ranlib: ``%s'' failed ranlib: symbol table overflow ranlib: string table overflow ranlib: can't reopen %s %-*ld/bin/shsh-cbin/nroff 755 0 33 144000 2552600312 5675 $Tu^Юn PPՀPpPP؟-PX0 "!S3"#`p`Аp@РP`p"! #!4!@``Pp`#s5$#D"1f1@` @P` 0P` @````p``p0#!Q "b"1P```PPp@ P@0`` @!`@PA! "Qp@`p``@F! g 3!Bp ``Phk22jWf@P`@P0@ 00 @P@`0#b&`2gY&FI00 @0 @ @@@ @`6%e`8XC  @`PP P 00p P P p P`P` )Vh`0fuP p`0```0@`P000 `@``8U)rPEVD$*``00 0`p`5"0f Pf"G>B"f()/ /// @/N@//_?OU3u&'=  //`O@//?@/0e:ou36t(OUH/,oL+/???L?>???o,O=U5/63'V /)P./0>._|-ݶm?o//3"? /?@~(wf"J?H2*s0 P0 o UͯfV/ @p o~%hlr"gjC@ `@P0@ `0 @P@`0r&bY*FH0"p @` `P P @@``&@`6%XfXC@  ``P P"`q"cr Q"0`S!Q"0P`Sp!)Vha0f6uP p`@`aR pc"b'cP `0a@ `@``HU)rPUWDD*` p`0  ˙`.`p`5"0 f`ahybusqemru141234mififlffFiFldedgscfmaagaulsl*a*b*g*d*e*z*y*h*i*k*l*m*n*c*o*p*r*s*t*u*f*x*q*w*AA*BB*G*D*EE*ZZ*YH*H*II*KK*L*MM*NN*C*OO*P*RP*S*TT*U*F*XX*Q*Wsrtsrn>=<===~=ap!=-><-uadaeqmudi+-cucasbspibipifpdgrnoisptesmoplrgcobrctddrhlh**bsorciltlbrtrblkrkbvlfrflcrcrrrlhhetalsisipiytotaniniciathinmlibililhfdiaaiorororararuararoarariararararoooooonentanananololieliiaiaitetrererevleDalce%edede$edduceeteaeaarzanzalzrdzelvnivievCuoninuuuquatuttatatortentatouslosisisasr$urigr#rtororherpherrrrcopyntonhononen$nn%ainlininouinomomimllllillcklllllalfalaltablbllalalalikgagiagergmgkgdgifnifereeidididuenclunc&esncerncinc%ancerncarncancalncincusicticieclacfrooeli$ieoontintrinrinpinninminlinlinlin%sinrinlinnlinkinlinlinlinlinlinyhineethnehingindinbinnoutortittiseispisrisnislisuislisbisgisdissraporugurgicaairhifedsciemorarooalracacuselelheltaltaalalvukthtchadua#uaur%gaonaiaia%ririiiiaaea$eaciaiaaaaoiuoi#i#eivsisiisals$es$asoooaithithowowurpoooooo alaioaiolioio%sioionoioiooolooisoiiiiiiteiaightomeoekeeee#aomaiaia$eaiaialeaea#eacrouhieearro#o$iizovvevomut%useost%cerit%ise%ese%asetearert%meaeropaewn$seonrmelldleleknheaheeihethshhechdgrdoundldiducncBa&aca&eca&ica&ega$uuiouiouiou$iueoueoueubesesb%pibCeCeDshDchionsinsalslishtsisgesgsdesdsasearooironrinenieninrighrighligheighhifraf$dgoaoaoahaui$es%quii%osiinni(failailaililiurouar$urenaionrirnlglalfalalbllk&gahleeckeodtudeedaa | TT\l`< ^܂͂P!bﲂ蓼 zЬP`P`~s1KPe11PS11P1ЬP`~'P,$DP 25׬1/ЬP`P`-ЬP`PPPn1^ЬP`~PϕϕЬP`~PЬP`~vP}u1rЬP`P~1xPP((PЬP`~6P1=sTЬP`ЭP֭ЭQ֭`aP:ЬP`~ݭoݭ[Pݭʓk1ЬP`~'11A1|1 ЬP`ЭP֭ЭQ֭`a1XPT1Pi1 Ph1Pm11Pr1,Pp1PPo1=1Pq11Pz1:1Ps191ЬP`P`+$ЬP`~Pլ1ЬЬb(~e!P1PѠu_!k[ﱨ8W`Za[NH+%$*1^P[Miˏ[PPZP=CP[PNˏ[PP 1\Zg Zb19ZVkP[ʏPPZP Z [﷧]P19E}} {P[a[ݏ[|P~PGݏ}[~Pt2ZZJZ Ka[ ?ZZP}P5ZZZ;}P| ZZ&}Pg 3ZZi \:2N}P<ݏMr[ݏ z[P[Pl9<6)ךּﭥAݏ2 PPhS(PP^߭{PFǏQPP4-PPQQQPQQFPxPPPP [Kݤ [PP̹KȤù [凉ЬЏ.P[[Phլ(T9|<B;~2,xݬ ЬZ[֬[[Z} Ь[[PZPPxZP- լQ8 xZPx~kլxZPP` w P[k PZxZPP[[P\*T[ˏ[PP :[P r PP[ʏPPYP1[1Y4iP[>[w1`Y  1QY1Yf﹌9[LP[1^YeY YYrkP[11/Y Q~QFP~JPZˏPYZZ[1YPP`11vP&11P!11Pw1P 1s117Pj1z1Pb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+P+P+P~K+++[7/+ ߭!w+* [[* l+P() n*~I P*P&*P P~(N)g ,* 2P P*P*P*P*P~T**&***[b-* ߭?u*1ݭy$)QP&*))) [[)P)ݬ[ ^+'ݬ Pp)ݬ(߭T)P~ B) $)5)PP)) )PP) Px(QQP ))q#P)((H"^(~< P(P((PxP~?&A'Z w(e(a(fP(gG(PxPP@(P ݽ"P0ѭ!( ս(PP('ѭ'''^'PxPP'P''\ѭ'R'PѠBs'P PѽPѭo'S'PѽЭPA'Q 0'*'PP'^+'?I' P'P%/'!P$["prPdPg!Pg!P`Pj~j~j~m[[!1=e!P!!RnRRfRPpP!p8!;!12!PѠM!1ѠD!VPgX!P!P$!PnPPdL!PcP$!qN1qIj~2j~j~j~j~c*PjP~a'PjP~aPjP~| P`_PPh P~ `qp) # " 1Pe``Pݏe%^yuPnt`^ݏtԭ;ЭP֭CQ<@a +$ЭP֭@~ЬPЭQA`P ``P xPl`ݏlDݬݬݬ ݬplPem`Uݏmݬ^ݬT Pp`ݏpݬݬPQPa~OxPPPQPaxPP~lhPas`QݏsݬZݬPݬ Fݬ<ĬݬwP[P[Z~PYԊY[Pݬݬ \~ݬw ЬP PPЬ[ZYk94 ZPQPQ0QZY[[kPP P P+P-k0YZPZPЬ[<XXrPX 鑫+PPPYkw+ݏݬPZY1ZZkalYPPPݬPZ<3ݏݬ}PZYZZuݬPZZ)Z]YPPPݬ|PZZ1hZY kr  XPD ^ЬP ЬP 1Ѭ sՠn iмZЬլ ~PPZPPZЬP )Z%ѭZPQáPѭPQP­P[[ЬP PQРЬP ݬ [~ЬP~APԼ[h׼ ЬP֠ZݬFNЬP BPЬP ԼЬP ЬPPQРݬ ݬЬP~PѭPP [P@X[ݬyPZZݬ|[LP[Xn<DNhx(4J\hz(5KZfyError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large\~ݬ,wPPЬ>Ь :Ŭ PP~ݬ^YìPPPYxY~ݭPPYЭЬ[YZ+Yݭ[ݭ[PPhY[[]ZYݭKZYݭ[YЭ[/ZݭiPP[Z[pYZYZZ[>ìPíQPQݬY~Э1ݭݬY1[YݭZ2YЭZ14 ^Ь[ЬZkj׭^Ь[ЬZЬ Ykij׭^Ь[ЬZԭլ05Ьj ЪP֪`P ZoPYY׭֭ѭ ЭP^Ь[ЬZԭլ.3ЬYj ЪP֪` Z~ Y ֭ѭ ЭPЬ[  P ݏA P ի ߘP@ [/ ^  P2PPݫ~ PkЫk!k    k1WP֫ Ь[ZZZP0^BЬ2߭ \~ݬ׭ ЭP֭` ߭rЬP  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~)PYj$ ~P   BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[/1xݏPZZ  YYX ZYYXZYZ~XPY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[ Ь[Z = 8[ePZ~YPZ ݫK ԫ kZP{ Ь[ЬZkPkPzQQP8P(P^߭ݬDPPPݬݏ tݬݬݏtݬ6.9~9vpsad~*PYM[Rk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [9PYPƏPxPbPZxPZPPZx~@PZZZPZPxPZPPjjw9k1xYP[PXZQILk=6k[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP}@j~\S^\_uPlCЬWPЬPЬRRQ{RPPR PRPPPP.CE#C333333CpCu>(\@FEEEAFHCEHCB BDEHCa.outmon.out %%time cumsecs #call ms/call name %6.1f%9.2f%7ld %8.2f%7.7s %8.8s %s r%s: bad format %s: no string table (old format?) %s: no room for %d bytes of string table%s: error reading string table %s: no symbols prof: No room for %d bytes of symbol table rprof: No room for %d bytes of count buffer prof: No room for %d sample pc's prof: unexpected EOF after reading %d/%d samples No time accumulated mon.sumwmon.sum%s@(#)prof.c 4.5 (Berkeley) 81/07/02Unknown error: #44D009bin/rev 755 0 33 16000 2532141327 5341 (( ^Юn PPՀPpPP P  GѬ2ϹЬPݠP,ЬPݠϝ϶K [[dPРQ֠aP PZZKZPPUP *[ϊKϽ~ ywPrKϡ`[a_PZ `1yL ϱ 1kvS ׬Ѭ1ݬ \~ݬЬP PPЬ[XXPX 鑫+PPPYkw+ݏݬPZY1ZZ! kalYPPPݬ/ PZ<3ݏݬ}PZYZZ ݬ PZZ)ZYPPPݬ PZZ1hZY kr  XPЬ[  P ݏ P ի ߘP@ [D~ k  P2PPݫ~ PkЫk!k    k1WP֫   !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^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 kZP{(P^߭ݬDPPPݬݏ tݬݬݏtݬ6#.U#U#####~*PY}#[#k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ># [UP0#YPƏPxP#bPZx#PZPPZx"~@PZZZ""PZP"x"PZPPjj"U"1xYP[P"Z"y"|"km"f"k[P Ь[[ZZZM"jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP!@j ~\S^\_ P CЬ PЬPЬRRQ{RPPR PRPPPPswitchSwitches nested > 5 I = if(.not.(I.eq.(Missing left parenthesis in case).or.Missing parenthesis in case)))Missing colon after defaultdefaultSwitches unwound too farYrepeatif(.not.)if(.not.)elsewhileif(.not.)endwhilemissing left parenassigment inside conditionalmissing parenthesismissing left parenmissing right parenformissing left paren in FORillegal FOR clauseif(.not.(missing left paren in FOR clause))invalid FOR clauseendfor = returndo illegal BREAKillegal NEXTratfor:error at line %d, file %s: ****** *****F ratfor:syntax error, line %d, file %s &%s .ge..gt..le..ne..lt..eq..ne..not..and..or.%s more than 19 continuation cards continue goto %s B  !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~rmissing quotepushback overflow888888888899999    #9= =functioncan't openrillegal define statementdoifelseforrepeatuntilwhilebreaknextdefineincludereturnswitchcasedefault - /()',*!"#$% &+.10       !      (( ;{ {} }  !"# yacc stack overflowsyntax errorPPL>(Ubin/refer 755 0 33 76000 2552600314 5654 h,Y^Юn PPՀPpPPgeP,b(^<11PF*1PC11`1%Pa<1JЬPРP~Pug1-ЬPРPPPo׬ЬPРRuѠ>РDg׬1׬ЬPР'uѠ>Рg׬ЬPݠGPf1׬ЬPݠGPf1PT{ЬPРP~)Pf_PlTPiK׬ЬPРt6Ps1Pr׬ЬPР Pt1׬ЬPРP`-1ЬPݠ0P߭a f߭P`P1߭t`[S_FD<_/-%_e߭TAP1e߭uAPe߭^APϘue߭GAP8-e齃:P%e!eI|rIddQdddadIrd9ra,rddddDCPddyddpBΗ`d`dHqA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H PݭoH Pݭݬ Ь PЭP@Э֭  ׭ѭѬA3ЭP,(#׭ѭ~ݬ $ ~ݬ <ѬA1vլݭЭP@~ݬ <1W֭ѭ1P^G\C!լ1CCPЬ QA`~Ь P@YG!C!1ݭ#P-P8GB!֭ѭ ݭݭ߭ݬݬPPЬP֬`)ݬy!P+2խBݬ FyB!^`,ݬЭP@ :PPЭQA`֭ѭݬЬPE@Ҁ@ˀ ;jEPcE`ÏTEPPݏ!FѬdݏdFPQЬRPBa, ֬֬䔼^ЬP֬`ѭ -֬Ь P׬ P֔^֬<խ.֬ԭ+֬JPЭQA`ЭP֭PQ֬Ѭ Δ ^KD8Ьн֭֭PQQPӏP敽 QЭPսЬPΠ^͸Ͱͨͤ͠o@Dg@ͼ1ͼP@1ЭP`~XPc͸Ͱ@D@ЭP~ PЭPʹPͰ!ЭPʹPͰ ͸ʹЭʹ?pPݭ0PЭP`~P1͸1Ͱp?ݭCe? R?ݭ͸CC?͸T)ݭ?PCPPPPͤ͸A1ݭP.PPPͨ1lʹzCP͸1PʹA1H>ݭPPPRͰ)x>ݭo>ʹCc>1O>ݭʹC@>1ͼP@PAPPPͬB >ͬB=ͬ<ݏA=P BPBPPB=G=ݭ|B=+ݭP.PPPͨNͰ(Z=ݭQ=ʹ8BE= 2=ݭʹ$B#=ʹP2=-ݭPPPPA<ʹ͸ʹT)ݭPApPPPPͤʹO)ݭPA<PPPP͠ͼͼ1͸ͰK<fAC<2<ͤNA&<<ͨ=A <;͠,A; ݬݬZPA;e^ԭЭPЬ@֭Ь PЭQPA֭֭PݏJݬݬP@PݏBݬݬP@PݏRݬݬqP@PݏGݬݬRP@PݏIݬݬ3Pp@PݏMݬݬPX@PZ@P^ԭ1ЭP@P`~PЭP@PPP P֭ѭP^Ьԭ1DPЭQA`PP$ѭ\֬s֬-֬2֬խ$ѭ\֬s֬+֬2֬խ ֬խPPPЬP֬`1iѭ\֬s֬+֬2֬ЭP^ЬЬЭ֭Э  ׭ѭЭP,(׭Э  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^ԭԭ5Pr/:':P :`P'Y8U8PN8`P ?8DPgP b7PЭQA`{7PЭQA`0խЭPЭ@֭ЭP֭P1n֭1cխ֭ԭ1Rѭү$#447 %P9 խ4ЭP^ԭ18ЭP@PPPݬ  ݬ ݏd߭ ޭ߭v48eE֭ ѭ;8:/ǕP8߭E8248898𑭌/884߭3֭ѭ1 ^߭ЬP~$ЭP^ԭЭ17ЭP@PPPݬ  ݬ ݏd| |Ph| ݏݬ|?; լ)ݏ|Pխ1F) 6)PЬPPԭЭP2@ʹ֭ЭP2@ʹ֭ЭP2@ʹ֭ЭPЭ@ʹ֭ЭP2@ʹ֭PЭQPAʹ֭ЭPЭ@ʹ֭ԭЭPЭQ@Aʹ֭֭ѭʹݭPM(6ЭPЭQ@A֭Ѭ,w64X69#֭ѭ1*ЭP ^(PЬP֬`ѭ;߭߭1ݬ ݭ' 'ݭݬP^!ݬoPݬݬЬP`PPPЬ:;֭약֭Ь߭߭1ݭ PPԭЬ խ3j11ݬ0{!PM1E1K1ݬ;1ݬP1P1Zݬ0!0P&լ!w0H{0A1 30014ݭ0W ѭ 1 P1w4)0ݽ P1ѭ00/P//`` !/Tv9ݏOe0;0]2- /:////~/(ݏS70 02(PЭPP/Pݬ$ PЬPЭQA`ЭP8^ݬݬ088 ^/ݬP1/ݬ P/ݬPݭPݭP-խ ݭݬ[/ݬPݭSP$խ ݭmԭխ ݭ[ԭPݬ^$խ)/ݬPP^ݬ߭ ݬ߭߭PPP^ݬ߭ݬ߭.߭pPP߭.ЭP. ݬ^z.|.j.PPk+ԭFݭ@P: *P`֭ѭ.ݭ^ݬǏPQďQQPЭP@|լ Ь@{PЭP@{ݬPPP^ЬEíԭԭ&ݭݭPݭݭ ֭ѭխѭ^ԭ#ŭP((PQxQQQQxQPPP֬խЭPέP-B.gݬݬ/.T"..P. `. ^ЬP֬`ЬP֬ЭQ`PQPQPխPPЬ[kPP[P[kP^ݬݬPĬݬP[P[Z~PYԊY[Pݬ PP@QPЬ[ЬZ!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xPPPЬ[ЬZ[Y[YPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6HЬ[ѬP ѫѫk֫k׫ЫP`P P\m.NmFm@mCm1m4m~*PYm["mk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZl [PlYPƏPxPlbPZxlPZPPZxl~@PZZZqljlPZP]lx^lPZPPjjGl;l1xYP[P(lZ!lllk llk[P Ь[[ZZZkjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPMk@j~\S^\PЬPЬPЬRRQ{RPPR PRPPЭRBQP-PbPbլQP,P.ib.ia.ib.icNo space for hash list (%d)No space for hash frequencies (%d)no space for answer listNo files %s //bin/pwdhuntdeliv/usr/lib/referdelivCan't run %shunt-i-t-T-F1-oabuff not big enough %d.ig/tmp/rj%dgfgrepCan't read fgrep index %sCan't write fgrep output %srcan't read fgrep output %sCan't get space for machinesbad fgrep call wordlist too large dtjj tttt jADstandard inputtoo many -p options (%d)/usr/dict/papers/Ind/tmp/rj%dawCan't open scratch file/tmp/rj%dbwCan't open scratch file rCan't read %s.[.]buff too big (%d)Assertion failed: file %s, line %d refer2.c$LIST$ Assertion failed: file %s, line %d refer2.chuntAssertion failed: file %s, line %d refer2.cAccumulated answers too largeanswer too long (%d)Assertion failed: file %s, line %d refer2.cAssertion failed: file %s, line %d refer2.cNo such paper %s too many hits for '%s' delivAssertion failed: file %s, line %d refer2.cAssertion failed: file %s, line %d refer2.cAssertion failed: file %s, line %d refer2.cdeliv%.70s ??? at %s one buff too big (%d)!\*(<\*(>output buff too long (%d)nnn%s%c%s%%.%ds%%s%%s%%s%c%d%c%d.[.[ File %s, line %d- punctuation ignored from: %s\*([.\*(.]%s%s%s r,\|/tmp/((rj%dcwCan't get scratch file %s.ds [F %s%cA An The .\"%s%c%c%s%c%c%d%c%cbflab overflow (%d)nref in labc overflow (%d)the an a .]-%c..%c%s%c.as [%c " %s%c.;,?XYZ[].de [%c%c%s%c.ds [%c%s%c.as [A ",%s \s-2AND\s+2 and%s%c.de [%c%c%s%c.ds [%c%s%c.nr [P %d%c.;,?.;,?..%c.nr [T %d%c.nr [A %d%c.nr [O %d%c.][ %s%c1 journal-article3 article-in-book4 tech-report4 tech-report2 book5 bell-tm0 othertoo many references (%d) for tablereftext too big (%d)sort %s -o %sr.]< %d.]> rCan't reopen %s %dAssertion failed: file %s, line %d hunt2.citem %s hash %d hfreq %d Assertion failed: file %s, line %d hunt2.cAssertion failed: file %s, line %d hunt2.cAssertion failed: file %s, line %d hunt2.cAssertion failed: file %s, line %d hunt2.cAssertion failed: file %s, line %d hunt2.cAssertion failed: file %s, line %d hunt2.cAssertion failed: file %s, line %d hunt3.c%s%s/%s%s/%s fgrep-r-n-i%ld,%d,v%ld,%ldrrAssertion failed: file %s, line %d hunt7.cAssertion failed: file %s, line %d hunt7.cWarning: index predates file '%s' /usr/lib/refer/mkey %s >%s.ig.ig.ig.igrMissing expected file %s0sdr/usr/lib/eignError:   AAAAAABBBBBB /bin/shsh-cu,bin/sort 755 0 33 32000 2532143411 5526 (^Юn PPՀPpPP' P ^2Ь.1ЬPPP-1мPPo3W1mPjЭP-1x.P.P+`1׬ЬP`r.֭ЭP`PPPT׬ЬP`'PP- 0X+D+ ]ּݼt"мP`+x-P-Pм`-׬1.[[1([P@.ѽ*xЭPѠ*jѠ*`Ѡ *VѠ*LѠ}*BнЭPЭQРЭPЭQРЭPЭQР ЭPЭQРЭPС/[g5-x,-P)-P;*`-,% -5**c ~ﱻJ!P,ݭ\!PݭF!{,[Ï[d,\,9!PN,xPJ,xPPD,PB,[!%+cP+o)++++++ݏ$P[++[.))<W[Z$JPQ6+P2# P;+ +++q)L**PP*PP[7[*C[ѭ**ݭ[Э[[PP**[u*&f*['6 ^ԭԭYJ*[?*Zx/*P0*PZP+ *#*P[P[q Y1֭ZZ) խ)*11 Y))PРQ֠aP m)PYY YO) G)ѭ)1_ЭP֭PP ')#&ݭ P( ݭ(1o1Y((PРQ֠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}vPZPixjPZPPjjS=G1xYP[P4Z-%(kk[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPY@j ~\S^\_ P CЬ PЬPЬRRQ{RPPR PRPPPP,- -.T  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~)/-too many keys-can check only 1 file%s/stm%05uaacan't locate temprrdisorder:nonunique:wcan't create wcan't create can't open sort: @(#)sort.c 4.2 (Berkeley) 10/9/80/usr/tmp/tmp  AAAAAABBBBBB 99.>bin/sdb 755 0 33 152000 2552446522 5345 (^Юn PPՀPpPP2P1ݬ ݬ1P[~ﳆxPP(PPPP[[PqݬP[~|xPP(PPPPP~WxPP(PPPP˭ P˭[QQPP[[ݬ|^lЬP@[~xPP(PPPPP~xPP(PPPP˭ P˭[QQPP[ЬP[@^ݬ ݬݬݬݬ1 2~ݬݬ ݬݬݏ<լPPPլ P1 PP PPPݬݬ2~2~VPl'ݭݬݬ2~2~ݏre  5P5PP.ЭPԭݬ \PPPP  2SP2*PPݬ2~!P2 ]PP2~\PP2~P  5P4PPЭP ^1y 1Ь[ PPPZݪjkTP@ݪݪ kAP ê PPk  4Pw4PPPjPPkP1{Ѭ Ѭ PPݬݬP[[PݬݬʏP@(#)access.c 4.1 10/9/80access(mode=%d,adr=%d,space=%d,value=%d) with pid %d ptrace(%d,%d,%d,%d) = %d with error=%d 1wPPPPPPPPPP7A;PPPPPPݏ< ~рPU/PPP"֬ P[  ֬kP! Ь[k [kPPP  cP: 170D9>5ݏ? .P\PPqP: ^֬AZYazK_D.>[7]0-*>$*?ݏP ~P1ݬݏBP1'Ь[kAkZUkakzIk_Ck.>k[8k]2k--k>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z2PʏPP0Y2PxPPʏP2QʏQQPPݬXYZ[ݏ"[PXЬPXP1G 1Zs[[~ rZkk@Pݏ3[PP ;ݏﺤ ЭP֭`~ݏݏ ݏЫP[1~Z ݏg^1]1Y[[x mkkPݏZYP`PʏP ݏ4PydZ Z ЫP[Y ݏţ^1c,[[ ЫP[Yݬ `Ѭ ݬ ݏzݬ ݬ/xѬ  ݏ Vݬݏ"F 1PP CPP/Pнݭݏ%OrPЭP`_[PPݏ.Ţݭݏ2ﳢ[[1ЭPРݭx ]PP^xP [PʏPP$ӘPP3 ]PP$xP [PʏPP$[XCPӏԭ9խ1['%Pݏ6סWݭݏ9ᄀ2~ ݏ=޾{N2~Pѭ ︾ﯾ[> ]PP:wP [&PʏPP$[ PP׭ ݏ>!1ݏ@S3ݏBЭPѠ J3PPPPPV`ݏLﵠݏW蘒PPլ1t$^1XI2PPb"2P@!ݏYU2P@!ݏ\8@(#)display.c 4.2 2/28/81egiknpsuwy{}formaddr(%o, %d) Bad class in formaddr: 0%oStackreg error: frameStackreg error: contentsUnexpected null variable name*->.[->.[->.[_BLNK_%s not an active procedure %s:%s not found %s not found ddchddldfgddddbuhuuludsPTR %d; FTN %d; ARY %d; DESC %s xpPTR %d; FTN %d; ARY %d; SIZE %d; STSIZE %d <%c> No breakpoints set ? No breakpoints set 0x%x ()%s__dbsubc%s(%s(%d%s=,) @ 0x%x [%s:%d] %ssignal %d???1V\Z(:B˵U+hX\dݏ*Ml>6k.*ݏ*;P1 rPPPb11_ݏ&ݏݏ*EPݏݏ*2P1?P15fQ1+ݏ*ݏk-Fݏ*ݏkݏ*Jk11111[kݏw`ݏ +1k .1ݏwPнP`5ЭPѠ ;'ЭPݠ]~`ЭPݠݏݏ+ݏ4w`ݏ*+ 1 ݏݏݏ8+Y1  F 1 ԫ ]ZY Zr1Q F1G   @1 w oPPP 1 I APPP 1 P1 1 zPk~MPXRݏ>+=~8@ .P PPݏ5FE PPݶO ݏĶ5FP1@P1KP1 ^P P1(ݏE+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killed Cannot set breakpointNon existent breakpointAll breakpoints deletedstopped with value %d iUnknown addressxxUnknown variable.-Bad line number1Aݬ6WP( ךݬN率ݏ2ݏ̅P(ݏ߆ݏƸ龜2ﺼݬݏJ&ݬ栗PtPР kPYݏtFQPС[ԋ5PԠ/ݏÏ]PPPM P֠ǏdQďdQQQQ ݏÏ]PP;PPk[キPՠݏݏ2 ݬPPxPP[PP樂ݬ[sm`PU QH^117PQxQQQPP[kPP۠PЭQA`k 1PkPkPPPPvíPPPPݏ0ﭺݏݏP~íPPPPݏíPPߌݭPPݏŒPP=1-PѫP PPݭݏP­PPrݵP~eݏݏ￵P~7íPPkPPPݏ ǏkPx PPP}ukP~ݏݏMP~ŗ1L^11(P؞ ͞Ş1吏޴PР0︴ݏ2Tݏ\ݏ2KЬ[~uP[ݏ2T![ݏ3T[:0PPѬP ֝PP¬ɝЬP^J((PPسQP˳PPPulЬPTݏ3SP[[-tP-[[P&[ЬP@(#)fio.c 4.1 10/9/80r%s: no lines in file No lines in file%d: %sNot that many lines in fileZero or negative line?No lines in file 1#Ь[unЏ7Џ0%ݏDZݏTK'ݫݏ6SPޙ[ӱЫЫԟO$Ы Zj:4/+% ]PPZPݏ6﹓ЭI ]PP]P#'=3ݏ7ツKMX*ƘP˜ݏP菱PlݏZ6rgPxݏ6Qݏtf ݏ"7ݏnVYݏ<UEݏ17!ݏ4sOPPݏ371ӟ~W~ݏE7uݏ4ݏݏN7\&ݏ,ݏݏU7=WMݏm7$J@ݏ7 12 ^13ݏZ6ݬݏ7Ӏݏt,ݏ6͆ݏ7xOݏto@(#)main.c 4.1 10/9/80a.outcore-w`%s' does not exist Warning: `%s' newer than `%s' Sdb restarted *Error; try again cmd %c: %s:%s args-%s;re-%s;integ-%d scallf-%d;reflg-%d colonflag-%d;ncolonflag-%d Illegal floating constant@(#)message.c 4.1 10/9/80bad modifierno breakpoint setno processtext address not founddata address not foundtoo many breakpointswait error: process disappeared!process terminatedtry againbkpt: command too longbad core magic numberH9I9P9Z9_9s9}999999999999: ::/:@:R:k:y::::::: hangupinterruptquitillegal instructiontrace/BPTIOTEMTfloating exceptionkilledbus errormemory faultbad system callbroken pipealarm callterminatedsignal 16stop (signal)stop (tty)continue (signal)child terminationstop (tty input)stop (tty output)input available (signal)cpu timelimitfile sizelimitsignal 26signal 27signal 28signal 29signal 30signal 31@(#)old.c 4.1 10/9/80/^[k#ÏDB[P PQʏQPA [1#Ь [_^PЭPѠHˏ[PPݏA|P4Ь0ʏ[ K-PDBPPYiݏA{YPPZ2PQPQ12PЏ@B , jjPʏPxPPPP#ݬ@PP12PʏPPi4ѭ.ѭ (ݭݭIfP]PPxP\PPP2PxPPP2P1IݽݏAz1,ݽݏAz1?-ݽݏBz1#*ѭP*$m 1KjPʏPxPP PP1zݽݏB4z1*0ݬgPPMӏ52PЭ@ѭP P2QPAf~ݭ2P@TP ѭP11+*ԭݬLYPPݬ6PPӏg1/*ݬPPP6ݬ-PoPݬ PLPݬP)Pͫ1P NEe\V2P2@jPʏPPjPʏPP2P@nݏ Bx2~ݏBxZ1L[[ [12PP1 2PnPPݏBwݬ2PP2QQPPxPʏPPӏ~;PPb1_PPPnho ^14PPЭP^~ݏBv1  i1ѬPDYPݬZaP[Pݏ!Bv[PѬPGXPάPPs`P[P?ݏ$B>v[PѬ)ݬzXPP{ݬݭJP5ݬ_P[Pגݏ'Bu[PݬIP^1լݏ*BuݬI@(#)opset.c 4.1 10/9/80@(#)opset.c 2.40x%04.4x%s [%s]%s(%s)(%s)+$%s$%d %d: %c%s%s%s+@(#)optab.c 4.1 10/9/80dR!iRo !nRO !sR !xR= !}RX RRR` Ra R@ RA R R R  @ @R! @ @ @R R R R  R  Rx R @ @Ry R  R  R  R  S  S  S  S  S S S "S (S -S 3S 8S >SDSJS PS VS ]S cS iSoSuS {S S S S SS S S S S S S S S S SS S1!S S0!S S S@@S @SS T T T T T T#T|(T-T2T|7TA@VEV( @@KV, @ @QVp VVP [V `V4 @@eVlV} qV. @@ @wV/ @@ @~V VVV< V VVVd Ve VD VE V V V% @ @ @V V VVu @VU @V V  @V  @W@WEWDWBWC$W?A+W 1W 7W;W@BWFW KWOW TW* @@ZW; @_W fW mW+ @@sWyWWb Wc WB WC W W W" @ @W# @ @ @W W WWWs WS W W W(WWW W W W XX XXXX"X'X-X2X8X=XCXHXOXTXZX_XeXkXqXwX|XXXXXXXXXXXXXXXXXXXXXXXYY YYYY$Y+Y.Y1Y4Y7Y:Y=Y@YCYFYIYLYOYRYUYXY[Y^YaYdYgYjYmYpYsYvYzY~YYYYYYYYYYYYYYYYYYYYYYYYYYZZ Z ZZZZZ!Z%Z)Z-Z1Z6Z;Z@ZEZJZOZTZYZ^ZcZhZmZrZwZ|ZZZZZZZZZZZZZZZZZZ\ZXZTZPZZZZZZZZ[[ [ [[[[[[[![$[acbbacbdacbfacblacbwadawiaddb2addb3addd2addd3addf2addf3addl2addl3addp4addp6addw2addw3adwcaobleqaoblssashlashpashqbbcbbccbbccibbcsbbsbbscbbssbbssibccbcsbeqlbeqlubgeqbgequbgtrbgtrubicb2bicb3bicl2bicl3bicpswbicw2bicw3bisb2bisb3bisl2bisl3bispswbisw2bisw3bitbbitlbitwblbsblbcbleqblequblssblssubneqbnequbptbrbbrwbsbbbsbwbvcbvscallgcallscasebcaselcasewchmechmkchmschmuclrbclrdclrfclrlclrqclrwcmpbcmpc3cmpc5cmpdcmpfcmplcmpp3cmpp4cmpvcmpwcmpzvcrccvtbdcvtbfcvtblcvtbwcvtdbcvtdfcvtdlcvtdwcvtfbcvtfdcvtflcvtfwcvtlbcvtldcvtlfcvtlpcvtlwcvtplcvttpcvtptcvtpscvtrdlcvtrflcvtspcvtwbcvtwdcvtwfcvtwldecbdecldecwdivb2divb3divd2divd3divf2divf3divl2divl3divpdivw2divw3editpcedivemoddemodfemulextvextzvffcffshaltincbinclincwindexinsqueinsvjmpjsbldpctxloccmatchcmcombmcomlmcomwmfprmnegbmnegdmnegfmneglmnegwmovabmovadmovafmovalmovaqmovawmovbmovc3movc5movdmovfmovlmovpmovpslmovqmovtcmovtucmovwmovzblmovzbwmovzwlmtprmulb2mulb3muld2muld3mulf2mulf3mull2mull3mulpmulw2mulw3noppolydpolyfpoprproberprobewpushabpushadpushafpushalpushaqpushawpushlpushrreiremqueretrotlrsbsbwcscancskpcsobgeqsobgtrspancsubb2subb3subd2subd3subf2subf3subl2subl3subp4subp6subw2subw3svpctxtstbtstdtstftstltstwxfcxorb2xorb3xorl2xorl3xorw2xorw3escdesceescfindirexitforkreadwriteopenclosewaitcreatlinkunlinkexecchdirtimemknodchmodchownbreakstatseekgetpidmountumountsetuidgetuidstimeptracealarmfstatpause30sttygttyaccessnicesleepsynckillcswsetpgrptellduppipetimesprofiltiusetgidgetgidsignal495051525354555657585960616263r0r1r2r3r4r5r6r7r8r9r10r11apfpsppc0.50.56250.6250.68750.750.81250.8750.93751.01.1251.251.3751.51.6251.751.8752.02.252.52.753.03.25((3.53.754.04.55.05.56.06.57.07.58.09.010.011.012.013.014.015.016.018.020.022.024.026.028.030.032.036.040.044.048.052.056.060.064.072.080.088.096.0104.0112.0120.0%r%Rp1lrp1brp0lrp0brkspespssppslpcuspfpapr11r10r9r8r7r6r5r4r3r2r1r01yiЬP18y[P[ ݏ7*y8P[ L[[ ЫP[[7ݏTqoP[Pݏ8p*P[xk  ?[PP"P֭2PP q ޔݏ88*2~ݏ][Fݏ7)11 S 2Q~P j1# ݏ7x)2~RP1ݏ7R)1Pb1|XPD1K PB1`PPCPR15PK1PS1.Pr1 ,Pd1Pc141_Pk11PPs11A1>2~2~/ ^1@(#)pcs.c 4.1 10/9/80%d: killed1ZЬP`P1լ(ЬPլgЬ$P`,ݏLmݬ$(Pݏ<ݬ$ݏNm1Y3ЬP`ݏ<ݬݏTmYݏ<ݏZmXݬu2u~ݬݬ ݬݬ(ݬ b ЬP ֬֬ Ь ֬ ]֬2u~ݬݬx)PZ]PP)Pru2ju~ĭPPZݬ(ݬ$ݬ PP Zݬݬ PPݬ ݏ]m~&P  ֬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cs.c 4.1 10/9/80 continue %x %d BPT code; '%s'%o'%o'%dReturning from runpcs Entering endpcs with pid=%d About to doexec pid=%d About to open symfil = %s %s: cannot execute %d %s exbkpt: %d <> <> %s: cannot open %s: cannot create <> About to exect(%s, %d, %d) %s, Returned from exectcannot set breakpoint: %s:%d @ %d Waiting for pid %d Ending wait w = %d; pid = %d; stat = %o; - core dumpedPC = %d, dbsubn = %d _dbsubn_dbsubnx PPݬݬ(H1_MPoofM ]PP2o~P 1MM*ML L  L1dPP3oЭLЭLLLPP o LLPPL2LP1LLsLmLPPLnL12L|LPPhLZL,LSLݏLPLLPP3LKKPP$LLL!P1VPP 1oЭKPPnK  ((K 2P PPmmSRKRPPRuK QKK ^11cKPAl;lKݏݏ2$l~EP1ˏSPPpˏSPPpˏkSPPbx |UPPJx qUPPJx fUPPJJݏJ:PPuJoJPPJmJ NJQJKJPPJIJ *JPiJPJPP^J2YJJIPPJJICJI I  IPJPPPJaaI#2IPPTݏ8ݏ93 qII1)7ݏݬ/PݭC2:I~ݬDP^rݬݏ8PT2I~ݬCP82XePP+HݬoPݬݏ~22P^@(#)setup.c 4.2 4/18/81%s -cannot open `%s' Rs[׼ЬPРQ֠aPʏP ݬ5PZP kZk rPqAZMaz?_8.2[+]$->*? 09 ֬֬ЬP  ֬֬피ЬPЬP֬`PPݬݏԌ1֬֬Ь[ЬZZ[PZPPY[YZYYP-GFGݏt~5 'Ь[ЬZZPj PP!ݬݬ6PPPNPPPPPPPPaݬݬ1ЬP`ЬP`?PPPPP*:ЬPP[[PPPPPPKP[ݏ،~P PPPPPPE^1B>ˏ PP0ЬPѬ@ ЬP@]Pݏdݬw1мP`- ּмP`0`ּмP`x мP`X&ּݏݏĉݬXPŭPݏݏlݬ5PŭPݏݏ ݬPŭP^1W5ԭмP`~ PмPּ`~ŭQQPPЭP^0 7PP P0P0 9PP P0P109afA FPPU09P0Paf PWPAFP7Pݏ݌P 1.' ЬP[109-\PPP[1azAZ _1ݬ]PP]PP`PZZ6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[}G'Pd1--PY--P[լլ1S1>d-\-SZʏPP1ݏsݳ^>PPݭZP--PPݏb靈ݏcЭ,ݏd>,ѭ,A>9ݏ ,,ݏ ݏ[(ݏs=l,f,PZ=(N,wPY[Z1Zݏ_ G,J,ݏ- M=׬1q^11ݏpPݏݏݏ ?Pݏ6ZÏ@]PPY"&Y[[1T &'%P%1D"1@PZPP%%%\G%P% * #\P\PnPrϐJZ"Ï]PZQA`.ݏ08Zݏ((M!1R1s09-ݏ,LP1KazAZ _1$ݏ4ݏ4q`\bP)@P@:P 2)~e`~dUPK$E$A ;$Z1$a '$zґ$_ȑ$. $[$]#-#>#*#?#0 #91r)~ݏg ## )1(Z(:(9(9(:P({(P2 v( j(P ݏP99PPW(Q(ݏ99p9r9 ݏr﹮Ï@]PPYPPPPÏ@]PPYPPP!P@T@PPZPPP"P@eTА"_'" ݏc8 ݏ ݏ !  !,![1ݏ^11]!\PP(*ݽݏбPA\PP'ݏݏ^ݏݏձU &oSPխ ӏ_&PPGSPH&PP0SP׭խcݭSPݭSPԭѭ$]PЭQA`]PЭQA`֭֭ ֭׭PPݏݏܱn^11Dr#R%%ݏ~ݏs%v%ݏYݏ~P1ݏP:6$/1ݏ@ P>PP  ݏ$55PP$$PP5f$u5_$f5\$T$PQ$ 5$ݏt ^11Ьԭ;  ֭֭ݬ"TP+ݏ~ݏЬP֬` hխ;PPЬխ^1o@(#)xeq.c 4.2 7/8/81Breakpoint at Cannot find %s _dbargsProgram not loaded with -lgUnterminated string constantToo many string constantsUnexpected character %c _dbsubcInternal error - cannot find _dbsubcBreakpoint at Too many argumentsmain%s %s %s %s cCsS_dbsubndProcedure returned normally Bad command: %cЬ[ZYk94 ZPQPQ0QZY[[kPP P P+P-k0YZPZPЬ [ЬY׬&k ЫP֫`P [<PZZZ Z YPЬP;Ь[\XXPX 鑫+PPPYkw+ݏݬPZY1ZZkalYPPPݬPZìPíQPQݬY~Э1ݭݬY1[YݭZ2YЭZ14 ^?Ь[ЬZkj׭^?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PЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[  Ь[Z = 8[ePZ~9PZ ݫ ԫ kZP{(P^߭ݬDPPPݬݏ tݬݬݏtݬ60."~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [PYPƏPxPbPZxxPZPPZxh~@PZZZE>PZP1x2PZPPjj1xYP[P Z  k  k[P Ь[[ZZZ jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP! @j~\S^\_PCЬPЬPЬRRQ{RPPR PRPPPmPHrsum: Can't open %s sum: read error on %s -%05u%6ld %s @(#)sum.c 4.1 (Berkeley) 10/1/80bin/spell 755 0 33 1042 2532143604 5644 : B flags, D dictionary, F files, H history, S stop, V data for -v H=${H-/usr/dict/spellhist} T=/tmp/spell.$$ V=/dev/null F= B= trap "rm -f $T*; exit" 0 1 2 13 15 for A in $* do case $A in -v) B="$B -v" V=${T}a ;; -a) ;; -b) D=${D-/usr/dict/hlistb} B="$B -b" ;; *) F="$F $A" esac done deroff -w $F |\ sort -u |\ /usr/lib/spell ${S-/usr/dict/hstop} $T |\ /usr/lib/spell ${D-/usr/dict/hlista} $V $B |\ sort -u +0f +0 - $T |\ tee -a $H who am i >>$H 2>/dev/null case $V in /dev/null) exit esac sed '/^\./d' $V | sort -u +1f +0 H history, S stop, V data for -v H=${H-/usr/dict/spellhist} T=/tmp/spell.$$ V=/dev/null F= B= trap "rm -f $T*; exit" 0 1 2 13 15 for A in $* do case $A in -v) B="$B -v" V=${T}a ;; -a) ;; -b) D=${D-/usr/dict/hlistb} B="$B -b" ;; *) F="$F $A" esac done deroff -w $F |\ sort -u |\ /usr/lib/spell ${S-/usr/dict/hstop} $T |\ /usr/lib/spell ${D-/usr/dict/hlista} $V $B |\ sort -u +0f +0 - $T |\ tee -a $H who am i >>$H 2>/dev/null case $V in /dev/null) exit esacbin/spellin 755 0 33 14710 2552600315 6220 t^Юn PPՀPpP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mЫZ3[ 1xݏPZZ  YYX ZYYXZYZ~(PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP [ [[[6 Ь[Z = 8[ePZ~YPZ ݫ ԫ kZP{ Ь[ЬZkPkPzQQPP^߭ݬ$PPPݬݏ tݬݬݏtݬ6D.460.(+~*PY[ k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [0PYPƏPxPbPZxPZPPZx|~@PZZZYRPZPExFPZPPjj/0#1xYP[PZ k  k[P Ь[[ZZZ jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP5 @j~\S^\_PCЬPЬPЬRRQ{RPPR PRPPP P|            -nTERM@(#)tabs.c 4.1 (Berkeley) 10/1/80dasi300300dasi300s300sdasi45045037tty37tn300terminettnhp,,$Hbin/tail 755 0 33 20000 2532145041 5466 ^Юn PPՀPpPP P$^H *PPPЬPРѬ -+ ϊ֬-PPP֭ԭ PQPQ0Q֭P@ϳխխ׭Ѭ,KЬPݠ}PЬPݠ5ԭ1PfPPlcPrE1x ѭԭSP֭PbPcѭ1N&խ2 ѭ1%약խ ѭխϩխ1խSZPZխ:ѭ[í[P%խPѭ[P í[PPPYY1խ*[2P[P@  K[[ԭ[YZYY$խխ1~Ϙυn2YIυ Y[խDZ@YY~Ye~$YPP~Ye~8~;(ZPZPY[1kխY[YYI Y[Y[Y[PP~Ye~!YPP~Ye~ϻ[ϮZ]LUϒϐ?ϤݏzσP[[hUݬ \~ݬЬP PP $[-%, %P@X[ݬPZZݬ[P[4<F`p ,BT`r -CR^qError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArg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tݬ6`.42R02JDG58~*PY![&k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [02PYPƏPxPbPZxPZPPZx~@PZZZunPZPaxbPZPPjjK02?1xYP[P,Z% k k[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPQ@j ~\S^\w P [Ь PЬPЬRRQ{RPPR PRPPլQP PH%0 m ; $;;;;;;::99998889g%i%k%m%o%q%s%u%w%y%{%}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&&&& & & &&&&&&&&& &"&$&*&2&4&<&>&@&B&D&L&N&P&R&T&\&b&d&f&n&v&z&&&&&&&&&&&&&&&&&&&&&&&&&' '''''"'*'2'6'>'D'L'R'T'Z'\'d'h'l'r'x'z'''''''''''''''''''''''''''((((( (((( (&(*(0(2(4(6(8(:(<(D(L(N(V(X(`(b(d(l(r(t(v(|(rtc: cannot open %s fiflfffflffi! ? /bin/sh-sh-c@(#)tc.c 4.2 (Berkeley) 7/6/81htnmlizsdbxfjukp-;a_c`e'orv-wq/.g,&y%QTOHNMLRGIPCVEZDBSYFXAWJUK0123456789*-ZM()[]JM_=O&:+!O~?'|O#L$(Mo_v)V,)?ISZo'o5becjCOM(kTS@UA|l/"E=O[RYN_\I(OJWX`/XFA\]WGIOO=O_V@s)K-SKit'ZXTo`HI'>F@TF>_F@</Cy||||||||||||=++_$^=_*{}'`^#|[c_~O/%M|*ZFO+]gC..)H2bin/struct 755 0 33 466 2532144603 6042 trap "rm -f /tmp/struct*$$" 0 1 2 3 13 15 files=no for i do case $i in -*) ;; *) files=yes esac done case $files in yes) /usr/lib/struct/structure $* >/tmp/struct$$ ;; no) cat >/tmp/structin$$ /usr/lib/struct/structure /tmp/structin$$ $* >/tmp/struct$$ esac && /usr/lib/struct/beautifyPZPPjj'1xYP[PZkk[P Ь[[ZZZjPPj ^Ь[ [[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լ:ݬTPaP#լݬݬ5PPPѭ= ѭ=1)ѭ=1ѭ=1%1׬ЬP@0{ЬPլ^Ьԭѭ\ЬP&P֬Эխ1ԭL.CݭݬP2ѬЬP~PЬP~PЬ֬խ).ЬP~PݭݬP ׬Ѭխ ѭPխ ЭЭЬh `_ZPKPC9ЬP֬*Q#`a甽ЭP^4ѭK;'ѬЭP֬խѭ ѭ%;ԭPЬP֬`P֬P^ЬP֬`ЬP֬ЭQ`PQPQPխPPѬaѬzPѬA ѬZP^ԭ9 PQQP0P֬0ЭPѬ0 Ѭ9PPѬЬPЬPЬP֬ЬQ֬`aЬP@xPЬP@Wu@qЬPŏPQȈQxPPPQaPѬЬPЬP֬Ѭ_ݬݬPsPP^ݬݬdPsP֬Ѭݬݬ>Psԭ֭׬ݬݬPsЭP^֬ݬݬPs֭֬Ѭ~ЭPլ5~!O~(~4z~ ^ЬP@sPԭЭ%ݭݬ'PPPѭ֭ѭ~ЭP ^լPլݬݬ#PP_P--Pѭ==Pѭ^PЬP@^s @UsPѭs~ݬխЬPxQQ@+8ѭa ЭPРPнPPPPTPݭP1qݭ P1^ݬݬPPЬЬPЬQxPPA7P`P`\PPPլP~ݬPխAЬѭ|]ݭݬPsݭݬtPѭP0֭ݭݬPs ֭ѭF|ݭݬ ~ݬݬ^e6$2!|Z ԭ1ЭݭݬPP֭լЭ$լݭݬP}P ֭ѭ{ѭ{+ݬѭ{PЭPPݭݬ?ѭc{1^2f{ 5$1I{  ^ԭ1ЭЬPP#P-P=C5PPPխì PPzլݬfPPPPPz1z ԭЭ1xP­PPѭí~J1z Эլ1oݬѭnݬݬPP>PHЭP`1P 1oխ 0P0P0PPѭ0P0ѭ9ݬݬkPNPIPNЭP`P0y ѭr ~ݬ*P!P@PJ1f0`0խ [0PV0PQ0PPkѭB0P=0RѭL ~ݬP PP ,0" 0(~0x% !/x 2!/xլP ~/xz/2Ѭ /P/PP PPFxݭݭ/Fx'ݭݭ) ~P ~|/xV@2!|/x9w/w&֭ѭ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d %s Illegal optionexpandEXPANDcenterCENTERboxBOXallboxALLBOXdoubleboxDOUBLEBOXframeFRAMEdoubleframeDOUBLEFRAMEtabTABlinesizeLINESIZEdelimDELIM.rm %02d bad table specification charactertoo many lines in specificationno specificationdot not last character on format linetried to widen table in T&, not allowedfirst column can not be S-type.tm warning: can't span a-type cols, changed to l .tm warning: can't span n-type cols, changed to c first row can not contain vertical spantoo many columns in tableNonterminated font namepoint size too largepoint size unreasonablevertical spacing value too largecolumn width too longEOF reading table specification.TE.TC.T&T{Vertical spanning in first row not allowed\^\^.nr %d 0 .%02d .rm %02d .nr %d 0 .nr %d 0 .if \n(%c->\n(%d .nr %d \n(%c- .nr %d 0 .nr %d 0 .nr %d .if \n(%d<\n(%d .nr %d \n(%d .nr %d \w%c%s%c .if \n(%d<\n(%d .nr %d \n(%d .nr %d .if \n(%d<\n(%d .nr %d \n(%d .if \n(%d>=\n(%d .nr %d \n(%du+2n .nr %d \n(%d .nr %d \n(%d+\n(%d .if \n(%d>\n(%d .nr %d \n(%d .if \n(%d<\n(%d .nr %d +(\n(%d-\n(%d)/2 .nr %d %sn .if \n(%d<\n(%d .nr %d \n(%d .nr %d -\n(%d-%dn .if \n(%d>0 .nr %d \n(%d/%d .if \n(%d<0 .nr %d 0 .nr %d +\n(%d/2 .nr %d +\n(%d .nr %d 0 .if \n(%d>\n(%d .nr %d \n(%d .nr %d (100*\n(%d/\n(%d)*\n(%d/100 .nr %d \n(%d .nr %d 0+\n(%d .nr %d \n(.l-\n(%d .nr %d \n(%d/%d .if \n(%d<0 .nr %d 0 .nr %d 1n .nr %d 0 .nr %d \n(%d+(%d*\n(%d) .nr %d +\n(%d .nr %d +\n(%d .nr %d (\n(%d+\n(%d)/2 .nr TW \n(%d .nr TW +%d*\n(%d .if t .if (\n(TW+\n(.o)>7.65i .tm Table at line %d file %s is too wide - \n(TW units \w%c%sP0%c\n(%c-.nr #I \n(.i .in +(\n(.lu-\n(TWu-\n(.iu)/2u .fc %c %c .nr #T 0-1 .fc .nr T. 1 .T# 1 .in \n(#Iu .ta \n(%du \n(%du \n(%du .ne %dv+%dp .nr #%c 0-1 .nr #a 0-1 .eo .de T# .ds #d .d .if \(ts\n(.z\(ts\(ts .ds #d nl .mk ## .nr ## -1v .ls 1 .if \n(#T>=0 .nr #%c \n(#T .if \n(T. .vs \n(.vu-\n(.sp .if \n(T. .if \n(T. .vs .if \n(#%c>=0 .sp -1 .if \n(#%c>=0 \h'|\n(TWu' .if \n(#a>=0 .sp -1 .if \n(#a>=0 \h'|\n(TWu' .ls .. .ec .ne \n(%c|u+\n(.Vu .ne \n(%c|u+\n(.Vu .mk #%c .nr #^ \n(\*(#du .nr #- \n(#^ .if (\n(%c|+\n(^%c-1v)>\n(#- .nr #- +(\n(%c|+\n(^%c-\n(#--1v) .if (\n(%c|+\n(#^-1v)>\n(#- .nr #- +(\n(%c|+\n(#^-\n(#--1v) .nr %d \n(.v .vs \n(.vu-\n(.sp .nr %2d \n(.f .nr 35 1m \&\h'|\n(%du'\v'-(\n(\*(#du-\n(^%cu-((\n(#-u-\n(^%cu)/2u)'%c%c%c%s: line %d: Data ignored on table line %d \l'|\n(%du\&%s'\v'-(\n(\*(#du-\n(^%cu-((\n(#-u-\n(^%cu)/2u)'%c%c%c%c\v'(\n(\*(#du-\n(^%cu-((\n(#-u-\n(^%cu)/2u)' .sp-1 \& .vs \n(%du .nr ^%c \n(#^u %s\f\n(%2d0.mk ## .nr %d \n(## .sp |\n(##u-1v .nr %d (\n(%du+\n(%du-\n(%c-u)/2u \n(%du \n(%du \n(%du-\n(%c-u .in +\n(%du .sp |\n(^%cu .nr %d \n(#-u-\n(^%c-\n(%c|+1v .if \n(%d>0 .sp \n(%du/2u .%c+ .in -\n(%du P.mk %d .if \n(%d>\n(%d .nr %d \n(%d .sp |\n(%du .sp -1 \f(%.2s\f%.2s\s%sWierd. No data in table.Wierd. No real lines in table..TEToo many characters in tableno space for charactersno space for vectors!%&#/?,:;<=>@`^~_{}+-*ABCDEFGHIJKMNOPQRSTUVWXYZabcdefgjkoqrstwxyz:_~^`@;,<=>#%&!/?{}+-*ABCDEFGHIJKMNOPQRSTUVWXZabcdefgjkoqrstuwxyzcouldn't find characters to use for delimiters %s: line %d: %s tbl quits too much backupunexpected EOF.de %d .ps \n(.s .vs \n(.vu .in \n(.iu .if \n(.u .fi .if \n(.j .ad .if \n(.j=0 .na .. .nf .nr #~ 0 .if n .nr #~ 0.6n .%d .nr #%c 0 .rm %c+ %s .ds #d .d .if \(ts\n(.z\(ts\(ts .ds #d nl .if \n+(b.=1 .nr d. \n(.c-\n(c.-1 .if \n-(b.=0 .nr c. \n(.c-\n(d.-%d .fc Too many text block diversions.nr %d \n(.lu .eo .am %02d .br .di %c+ .nr %d \n(.f .ft %s .ft \n(.f .nr %d \n(.v \n(.s+2.ps %s .vs %s .if \n(%du>\n(.vu .sp \n(%du-\n(.vu .ll %sn .ll \n(%du*%du/%du .if \n(.l<\n(%d .ll \n(%du .ll -2n .in 0 T}%s .ft \n(%d .br .ps .vs .br .di .nr %c| \n(dn .nr %c- \n(dl .. .ec \ .nf .ll \n(%du \h'|0'\h'(|\n(%du+|\n(%du)/2u'.nr %d \n(.v .vs \n(.vu-\n(.sp .vs \n(%du \v'-.5m'\v'%dp'1p-1p1p-1p1p\h'%s'-1p1p\h'%s'-1p+1p-1p+1p-1p+1p-1p\h'|\n(%du'\s\n(%d\v'-\n(%dp/6u'\l'|\n(%du'\(ul=\(ru\l'|\n(TWu%s%s'\l'(|\n(%du+|\n(%du)/2u%s%s'\v'\n(%dp/6u'\s0\v'%dp'\v'+.5m'.TH\h'%dp'1v-.5m1v-.5m.5m.5m\v'%s'\v'%dp'\s\n(%d\v'-\n(%dp/6u'\h'-\n(#~u'\L'|\n(#%cu-%s1v\n(35u-(%s)-(%s)%s%dp+'\s0\v'\n(\*(#du-\n(#%cu+%s1v\n(35u+%s%s%dp+'\v'\n(%dp/6u'  AAAAAABBBBBB 0bin/tr 755 0 33 12000 2552600323 5164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PZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~!PYj~P XX BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[x1xݏPZZ  YYX ZYYXZYZ~PPY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PPP[ [[[z Ь[Z = 8[ePZ~9PZ ݫC ԫ kZP{PP^߭ݬDPPP ݬݏ tݬݬݏtݬ6ЬPЬRRQ{RPRPPPRRP^.sr^sj^d^g^U^X^~*PYA^[F^k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ^ [sP]YPƏPxP]bPZx]PZPPZx]~@PZZZ]]PZP]x]PZPPjjk]s_]1xYP[PL]ZE]=]@]k1]*]k[P Ь[[ZZZ]jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPq\@j,~\S^\_PCЬPЬPЬRRQ{RPPR PRPPPSP"]'|:,̼o P1_p6A"67jl';nO-#= p=ף3>9 B>CCCIzEOtJ$TtJ$YnO(k]hTb@@@@@@ B@C@ Brno table you have: you want: * %e / %e conformability underflow or overflow %e %s*%c*cannot recognize %s %d units; %d bytes %sredefinition %s @(#)units.c 4.1 (Berkeley) 10/1/80/usr/lib/unitsattofemtopiconanomicromillicentidecidekahectahectokilomegameggigateraoosbin/troff 755 0 33 154000 2552600324 5707 0r^Юn PPՀPpPPأEP0 "!S3"#`p`Аp@РP`p"! #!4!@``Pp`#s5$#D"1f1@` @P` 0P` @````p``p0#!Q "b"1P```PPp@ P@0`` @!`@PA! "Qp@`p``@F! g 3!Bp ``Phk22jWf@P`@P0@ 00 @P@`0#b&`2gY&FI00 @0 @ @@@ @`6%e`8XC  @`PP P 00p P P p P`P` )Vh`0fuP p`0```0@`P000 `@``8U)rPEVD$*``00 0`p`5"0f Pf"G>B"f()/ /// @/N@//_?OU3u&'=  //`O@//?@/0e:ou36t(OUH/,oL+/???L?>???o,O=U5/63'V /)P./0>._|-ݶm?o//3"? /?@~(wf"J?H2*s0 P0 o UͯfV/ @p o~%hlr"gjC@ `@P0@ `0 @P@`0r&bY*FH0"p @` `P P @@``&@`6%XfXC@  ``P P"`q"cr Q"0`S!Q"0P`Sp!)Vha0f6uP p`@`aR pc"b'cP `0a@ `@``HU)rPUWDD*` p`0  ˙`.`p`5"0 f`arrrlhhetalsisipiytotaniniciathinmlibililhfdiaaiorororararuararoarariararararoooooonentanananololieliiaiaitetrererevleDalce%edede$edduceeteaeaarzanzalzrdzelvnivievCuoninuuuquatuttatatortentatouslosisisasr$urigr#rtororherpherrrrcopyntonhononen$nn%ainlininouinomomimllllillcklllllalfalaltablbllalalalikgagiagergmgkgdgifnifereeidididuenclunc&esncerncinc%ancerncarncancalncincusicticieclacfrooeli$ieoontintrinrinpinninminlinlinlin%sinrinlinnlinkinlinlinlinlinlinyhineethnehingindinbinnoutortittiseispisrisnislisuislisbisgisdissraporugurgicaairhifedsciemorarooalracacuselelheltaltaalalvukthtchadua#uaur%gaonaiaia%ririiiiaaea$eaciaiaaaaoiuoi#i#eivsisiisals$es$asoooaithithowowurpoooooo alaioaiolioio%sioionoioiooolooisoiiiiiiteiaightomeoekeeee#aomaiaia$eaiaialeaea#eacrouhieearro#o$iizovvevomut%useost%cerit%ise%ese%asetearert%meaeropaewn$seonrmelldleleknheaheeihethshhechdgrdoundldiducncBa&aca&eca&ica&ega$uuiouiouiou$iueoueoueubesesb%pibCeCeDshDchionsinsalslishtsisgesgsdesdsasearooironrinenieninrighr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4>.F9DB?;\]ޠ   % "! )i fl&STUVYX^_hݠ·ƭش윞հŸ覤ǶakW磖  $  $ۛ Rɔ SSR $$   $ $ۛ QɓQR P $$  $   $ݜ R̗ TSS$$!!  $$$ WW YUVR$$$$$$$$$$$$$$$"**)  T%nlyrhpctdnmodydwlndlstsbc.(('/usr/lib/tmac/tmac.xxxxx\/dev/cat  ds-as-spRftfps0dvs@nnrIifBUie UelTpoOtl:tmRbpQchPpnhQbrPoti6OneZnfLceNfiLinDNliYllNnsLmkT]rt:Sam-de-di69da&9whhPdt`:it\rm-rr0Irn-adKrsLnaLpl"Pta,ZtrT[ul[cu[ltNnx#so#ig,tcrMfcecYeoYlcMevSrdXab0_flSex *ssnfpbkcsFmbdmlg>khc^MhyMnhMnm0^nn_sv]os]lsvOcc6Mc2JMemSaf&Jhwmc\pmB=uf8\pc<htxfzbcf$<  HH .'.`8pH \ /usr/local/lib/tmac/tmac.Busy. Available. Floating Exception. /usr/adm/tracct/tmp/taXXXXXCannot create temp file. nottyTypesetter busy. Cannot open can't open file can't open file Too many page numbers fiflffffifflWaiting for Typesetter. Troff finished. %Too many string/macro names. Out of temp file space. Bad storage allocation. Core limit reached. Macro argument too long. Cannot divert. Too many number registers. ixcmzvldwIXCMZVLDWDivide by zero. Cannot plant trap. User Abort.Cannot do ev. if-else overflow. :/usr/lib/font/ftXX̨lRIBS $fp: bad font position fp: no font name Cannot open Cannot read Mount font on Line overflow. Trap botch. Word overflow. 9Exception word list full. Zero field width. Excessive paper use. Pages finished. //dev/Fd>d>Pbin/uusend 755 0 33 30000 2532151464 6047 (( ((^Юn PPՀPpPP' P0  Zg''ЬPݠ ׬CЬPРP`-CЬPРP6ЬPРPPPmЬPݠv'Ϗ)b׬ѬѬd'o)BϟЬPРϡ,Рϟ,ϗ,P`- %)j*)]'π,kPV*PЬPݠφS!],ϺPG,PwK,P~E,-*8,),P@*,',ϳ&+)P~; +ϖ&,ώ&)&Ͼ*!&ϱ*TPϻ)1+P`~1/P#Pϴ+Pϯ&d(7ϔߘ+ϔ+ϗ+~APX+Pτ+ϊ&0(`8+Pݠh)y&[)F+N)E)>+Z&6+P )P$+;Ϥ%3Ϟ% +ρ$((PРQ֠[a ([Z߷(ϱ(PРQ֠aP Ϡ(SP[Pϐ(Eϋ(<ϏЬ[k[PP!Pݬ \~ݬcЬP PP'P[kݬ+P8[Pp%l%R%PT% L%U<%4%k'%Ь[k:[kk[P%$$P$P$ݏ1P[[r5[P[[c5[xP[[PK5[\P[[jP3515_$*5[/P[[5[P[[ 5[ P[[4k [kk4PЬ[ZYk94 ZPQPQ0QZY[[kPP P P+P-k0YZPZPЬ [ЬY׬&k ЫP֫`P [PZZZ Z YPЬPЬ[$XX%PX 鑫+PPPYkw+ݏݬPZY1ZZkalYPPPݬPZ<'3ݏݬ}PZYZZyݬPZZ)ZaYPPPݬPZZ1hZY kr  XP <"[&D"&P@X[ݬMPZZݬ"[ P[!z&8HTfv  - A R a p Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large^߭PPrЭPЭPP[rЭPЭPPZ PYR[UrPPPZZ3ݬx  Y1kYK/Zݬ[^ЬP[PF PX PW PY߭tPZPK. ZZXb WW YL ЭP@); Ь[ZZPZ jkr kaݬ  +   ZP*ЬRPQbPЬ[[~ kЫ0   \~ݬJ \~ݬݬ5^Ь[A[[ԭ֭ \~ݬ߭^Ь[Ь Zԭԭ1)ЬPРQ֠aP1LYY%1/ԭY* ZZYԭ PYP0PYIխ20uYlԭ蘋YYhY[ [P[I] YYP߭ݬݭݭYݭPխ֭խVխЭPP׼ЬPРQ֠aP ݬPP P P P ݬPYYPPJP P P P%1׼1ݬ%PPYP14ݬP\ЭP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πLϗ@GLsLz@P NGYLРFLBLP2!LQPQ >GJϢϊ\]G*L-"PϰNP IGϥVGF"PϙNPϽF,#ϭ=KM@%GM?8aNANϰ&8N!߭ϯM-NϞ'P ѭЭ)NP ֭ԭ~wK;FFoMn2ݏ`Mσ"P ֭ѭ ѭ  ϙFϨF7M:!PMT߭2߭πP K}FZZ 2ϚEJnF@Z17Z0ϛ<^ԭ^MЭP@eM*GM<ԭԭЭԭYѭXEЭPx QPQxPPPQaPP@MЭPx QPQxPPPQay֭xխ֭ѭ֭ѭ1|^iYeYaYzԭUYЬPЭQA`PPPx QQPQxPPPQa,Y֭ѭ^rP YԭcЭQPAOL*ԭԭGЭQx RPRxQQQRPb֭ѭ֭ѭώ^ԭϪX /PԭP@ϒXK}XZ֭PѭPnXbXPЭQA`֭֭ѭխeGݏݭϏkDݭϏ;P NG1lԭ ֭1S^ ݬWe.֬߭0#kPC$<<ݭ#ݭ"DC.DD.9 φWݭ?Ͽ? qWݭ

/ Ь PЭ^/5~Ь QPԭԭuЭPЬQPPP2`íPЬQPPPЭQ2`PPQݭ֭߭߭PѭPPЭQЬ RQQQPax֭ѭ}ԭԭЭPЬQPPP2`íPЬQPPPЭQ2`PPQݭ߭߭ ֭PѭPPЭQЬ RQQQPax֭ѭ1ԭüPPԭüPPPCЭPЬQPPP2`íPЬQPPPЭQ2`PPQݭ߭߭j֭ѭPЭQЬ RQQQPax((֭PѭP1oPЬ QPPP`PPPP  ЬP2PPЬPPЬQPּ^3~PԭԭԭЭP@֭ѭ1ЭPЬQPPP2`PPЭQЬRQQQ2aQQPPЭQPAЭPЬQPPP2`PPPЭQPA ԭЭP@֭ѭѭЭP@ м Ь PЭռ  ݭ,^мЬPРмЬPРԭխ9խ$ѭ߭߭߭U߭߭߭έ߭߭߭3խ έέ߭߭߭wέ߭߭߭ݬ VЬ PЭŭPP ^ޭR1ݼЬ QPԭԭԭЭPЬ QPPP`֭ѭ1ЭPЬQPPP2`PPЭQЬRQQQ2aQQPPЭQ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]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj~P o g  BЫZ֫ZPѫPѬ ZPPXPZ~QPYZkn 1mЫZ3[K1xݏ;PZZ  YYX ZYYXZYZ((~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~|PY PP( [ [[[R Ь[Z = 8[ePZ~PZ ݫ ԫ kZP{P[P[P[P/[PZ[ZZ PXYX/P[Y[ZuPX\YPXO*[[ݬP1yk  k*P[j[ Ь[Zk[ZZP Ь[ЬZkPkPzQQP^ݬPP߭ݬP ^PKPϻKPϷKϦ`ϩKPKχGPwϙKϙKϑKϸ ԭѭϿN1ЭP@!MMK=GCGϑL2ϠNτL?P wLϒ 1ϓNGp$\L{@1GLL7PKϠIKF:$zIݏKϫrI"=KPP ?P!NPd1Pn(PqPs?Pw6֭1<ϽK?πJm<ϪJ1rFϫ#1e`J[&όJ υJ SFzJ?qJ֭P@H֭P@ Hݭg0PPFݭ PIPݭ1III;I;1<üP^EσEPϥIsE;oIϻJF>ϓEϮJ>QsISIϾ$bIP @@I0߭J5IϢ%P}LdrLPЭ@JfL"IP XL'EM"N;<$M$\$t$$$$$$Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large@) Ь[%ZZ&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= 8[ePZ~YPZ ݫ ԫ kZP{ Ь[ЬZkPkPzQQPP^߭ݬPPPPЬ[ЬZ[Y[YPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6XЬ[ѬP ѫѫk֫k׫ЫP`P P#.ph#lh###""~*PY"["k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ" [lhP"YPƏPxPw"bPZxd"PZPPZxT"~@PZZZ1"*"PZP"x"PZPPjj"lh!1xYP[P!Z!!!k!!k[P Ь[[ZZZ!jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP !@j@~\S^\%PЬPЬPЬRRQ{RPPR PRPPЭRBQPXPbPbլQPPOOOP%P=P@(#)uucp 2.7WPncd%.7smunknown flag %s ** %s ** STARTcan't get working directory; will try to continue /UNKNOWNAERROR - (%s) ret == 0CAN NOT FIND UID %d UID %d, User %s,Ename (%s) PATH %s usage uucp from ... to %.7sbad system name: %s %.7sbad system name: %s file1 - %s all work here %d can't get file status %s copy failed %s %s - same file; can't copy permission denied can't read file (%s) mode (%o) can't write file (%s) mode (%o) WORK HEREDONEreceive file - %d permission denied R %s %s %s %s send file - %d permission denied %s can't get status for file %s directory name illegal - %s can't read file (%s) mode (%o) can't copy %s D.0S %s %s %s %s %s %o send uucp command - %d permission denied X %s %s!%s Ropt(%s) ename(%s) s1(%s) f1(%s) s2(%s) f2(%s) uux %s %s!uucp %s!%s \(%s!%s\)cmd (%s) wAERROR - (%s) Cfp != NULLCAN'T OPEN %sQUE'D/usr/lib/uucp/usr/spool/uucp/usr/lib/uucp/L.sys/usr/lib/uucp/L.sys.cr/usr/lib/uucp/L-devices/usr/lib/uucp/L-dialcodes pwdrr/full %s w/usr/spool/uucppublic/mkdir %s;chmod 0777 %smkdir - %s %c.%.7s%c%.4sfile - %s LCK.SEQLAERROR - (%s) n < SLOCKTRIESCAN NOT GET %sLCK.SEQL/usr/lib/uucp/SEQFr%4d/usr/lib/uucp/SEQFwAERROR - (%s) fp != NULLCAN NOT OPEN %s/usr/lib/uucp/SEQF/usr/lib/uucp/SEQF/usr/lib/uucp/SEQFw/usr/lib/uucp/SEQF%s%04dLCK.SEQL/dev/null/dev/nullshio - %s AERROR - (%s) f == 0BAD OPEN fileno %dAERROR - (%s) f == 1BAD OPEN fileno %d/bin/shsh-cstatus %d @(#)ulockf 2.3LTMP.%dAERROR - (%s) i < MAXLOCKSTOO MANY LOCKS %dAERROR - (%s) p != NULLCAN NOT ALLOCATE FOR %s%s.%sLCK.%s.%sLCK./dev/null/dev/null/dev/null-s%.7s/usr/lib/uucp/uucicoUUCICO-r1/dev/null/dev/null/dev/null/usr/lib/uucp/uuxqtUUXQT/dev/null/dev/null/dev/null%s -r %suucp/bin/shsh-c@(#)chkpth 2.2AERROR - (%s) ret == 0INIT USERFILE %d..//usr/lib/uucp/USERFILErcAERROR - (%s) ret == 0INIT USERFILE %d@(#)logent 2.1/usr/spool/uucp/LCK.LOG/usr/spool/uucp/LOGFILEa/usr/spool/uucp/LCK.LOG/usr/spool/uucp/LCK.LOG%s/LOG.%05d.%1d/usr/spool/uucpw%s %s (%d/%d-%d:%d-%d) %s (%s) /usr/spool/uucp/SYSLOGa%s %s (%d/%d-%d:%d) %s ucbarpa%.7s%.7srM:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/etc/passwdrr/bin/shsh-c  AAAAAABBBBBB /bin/shsh-ch_h_Xh  AAAAAABBBBBB /bin/shsh-ch_h_((bin/uulog 4755 102 33 32774 2536652160 6015 ,^Юn PPՀPpPP+ PX$δ^2ԭЭܭ1PnfPssPuvPxyЬPݠ+1ЬPРP`-1ЬPРPPPdz+ PЬP~ P:ЬP.ЬP"ЬP~ P+P*׬Ѭ1l**+ +/K + ݭ+VP !# +* P)*+* "+*s PP1+*.{ +*.b ݏm)߭*.4 ߭*P:)߭*L. ߭ݭ:P ߭#߭ݭPݭq!ݭg!ݏq*R yխխ !,)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(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT(( BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj~P ;3 BЫZ֫ZPѫPѬ ZPPXPZ~9PYZkn 1mЫZ3[01xݏoPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~dPY PP [ [[[  Ь[Z = 8[ePZ~YPZ ݫ ԫ kZP{ Ь[ЬZkPkPzQQPP^߭ݬlPPPp`PЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6 Ь[ѬP ѫѫk֫k׫ЫP`P P.;;}~*PYi[nk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ* [;PYPƏPxPbPZxPZPPZx~@PZZZPZPxPZPPjj;1xYP[PtZmehkYRk[P Ь[[ZZZ9jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j ~\S^\_ P CЬ PЬPЬRRQ{RPPR PRPPP P---.%.=.-d option removed unknown flag %s %s START/usr/spool/uucp/usr/spool/uucp/LCK.LOG/usr/spool/uucp/LOGFILEa/usr/spool/uucp/LCK.LOGcan't open %s /usr/spool/uucp/LOGFILE/usr/spool/uucprAERROR - (%s) lsp != NULLCAN NOT OPEN %s/usr/spool/uucpfile-%s LOG.copy file %s /usr/spool/uucp/LOGFILE/usr/spool/uucp/LOGFILErAERROR - (%s) plogf != NULLCAN NOT OPEN %s/usr/spool/uucp/LOGFILE%s%su s %s %s %sr/usr/lib/uucp/usr/spool/uucp/usr/lib/uucp/L.sys/usr/lib/uucp/L.sys.cr/usr/lib/uucp/L-devices/usr/lib/uucp/L-dialcodes/dev/null/dev/null/dev/null-s%.7s/usr/lib/uucp/uucicoUUCICO-r1/dev/null/dev/null/dev/null/usr/lib/uucp/uuxqtUUXQT/dev/null/dev/null/dev/null%s -r %suucp/bin/shsh-c@(#)ulockf 2.3LTMP.%dAERROR - (%s) i < MAXLOCKSTOO MANY LOCKS %dAERROR - (%s) p != NULLCAN NOT ALLOCATE FOR %s%s.%sLCK.%s.%sLCK.  AAAAAABBBBBB $7$71;bin/uuname 4755 102 33 14670 2536652162 6151 ^Юn PPՀPpPP P4x^ЬPРP`-4ЬPРPl%xx Ѭxe qPjn0 Lԭ֭xPЭQA` xPЭQA`xxyxzxxEݭݏxIP(  ^ЬPѭP֭ЭP֭`ЬPЬ [ЬY׬&k ЫP֫`P [|PZZZ Z YPЬPЬ[XXPX 鑫+PPPYkw+ݏݬPZY1ZZI kalYPPPݬW PZ?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj~P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tݬ6Ь[ѬP ѫѫk֫k׫ЫP`P Pl~.4^~0V~P~S~A~D~~*PY-~[2~k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ} [0P}YPƏPxP}bPZx}PZPPZx}~@PZZZ}z}PZPm}xn}PZPPjjW}0K}1xYP[P8}Z1})},}k}}k[P Ь[[ZZZ|jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP]|@j|~\S^\_aPXCЬCPЬPЬRRQ{RPPR PRPPPhPx/usr/lib/yaccparrcannot find parser %s/usr/lib/yaccparyyr1yyr2yychkyydefyacc.actsrcannot reopen action tempfileyacc.acts : item too big (%d) %d/%d terminals, %d/%d nonterminals %d/%d grammar rules, %d/%d states %d shift/reduce, %d reduce/reduce conflicts reported %d/%d working sets used memory: states,etc. %d/%d, parser %d/%d %d/%d distinct lookahead sets %d extra closures %d shift entries, %d exceptions %d goto entries %d entries saved by goto default conflicts: %d shift/reduce, %d reduce/reduce fatal error: , line %d NULL { %s }nonterminal %s not defined!internal Yacc error: pyield %d %s: %d yacc state/nolook errortoo many statesputitem(%s), state %d out of state spacenonterminal %s never derives any token string%d: %s %d, working set overflow State %d, nolook = %d flag set! %s too many lookahead setsy.outputwcannot open y.outputy.tab.hw`o' flag now default in yacc Ratfor Yacc is dead: sorry... illegal option: %cy.tab.cwcannot open table fileyacc.tmpwyacc.actswcannot open temp filercannot open input file$enderror$acceptbad %%start constructionbad syntax in %%typetype redeclaration of token %stype redeclaration of nonterminal %sredeclaration of precedence of %sredeclaration of type of %splease define type number of %s earliersyntax errorunexpected EOF before %%#define yyclearin yychar = -1 #define yyerrok yyerrflag = 0 extern int yychar; extern short yyerrflag; #ifndef YYMAXDEPTH #define YYMAXDEPTH 150 #endif #ifndef YYSTYPE #define YYSTYPE int #endif YYSTYPE yylval, yyval; bad syntax on first ruletoken illegal on LHS of grammar ruleillegal rule: missing semicolon or | ?illegal %%prec syntaxnonterminal %s illegal after %%prec case %d: break;$$%dmore than %d rulesmust return a value, since LHS has a typedefault action causes potential type clashmore than %d rules # line %d "%s" # define YYERRCODE %d too many nonterminals, limit %dtoo many terminals, limit %dinvalid escapeillegal \nnn construction'\000' is illegal# define %s %d # define %s %d too many characters in id's and literalsunterminated < ... > clauseillegal or missing ' or "termtokenleftnonassocbinaryrightprecstarttypeunioninvalid escape, or illegal reserved word: %smust specify type for %s%s should have been defined earlier # line %d "%s" typedef union typedef union EOF encountered while processing %%union YYSTYPE; YYSTYPE; extern YYSTYPE yylval; # line %d "%s" eof before %%}illegal commentEOF inside comment # line %d "%s" bad syntax on $ clauseyyval.%sIllegal use of $%dyypvt[-%d]must specify type of $%d.%sEOF inside commentnewline in string or char. const.EOF in string or character constantaction does not terminateshort yyexca[] ={ %d: reduce/reduce conflict (red'ns %d and %d ) on %s }; YYNPRODoff = %d, k = %d action table overflow %d no space in action table$ %d,%d,%d %s: gotos on %s %d: shift/reduce conflict (shift %d, red'n %d) on %s-1, %d, %d, %d, %d,%d, -2, %d, state %d %s %s %s accepterrorshift %dreduce %d . reduce %d . error %s goto %d # define %s %d short %s[]={ %4d }; ,Rule not reduced: %s %d rules never reduced xm\yacc.tmproptimizer cannot open tempfilebad tempfilebad tempfileState %d: null %4d %4d yacc.tmpa array overflowa array overflowNonterminal %d, entry at %d cannot place goto %d State %d: entry at %d equals state %d out of space in optimizer a arrayclobber of a array, pos'n %d, by %dState %d: entry at %d Error; failure to place state %d nxti = %d, max = %d Optimizer space used: input %d/%d, output %d/%d %d table entries, %d zero maximum spread: %d, maximum offset: %d # define YYLAST %d yyactyypactyypgoshort %s[]={ %4d }; ,out of space  AAAAAABBBBBB ((hmH((bin/uux 4755 102 33 53004 2536652147 5475 H ^Юn PPՀPpPPG P@Ό^ԭԭ͔͓͘R!QQ1PpLPrJPxGЬPݠG;P5MЬPРP`-MЬPРPPP͘(͔"ЬP~%P GPG׬ѬGFG4GO#͜HFݼGO#G͜@ЬP`͜?׬ѬF͜FEOZ#P P͔P&FO1#FP?(F!%P͘0/P͘^PFͬ 40((߭ݏXͬݏDlF߭P%PͨP(<(;ͼʹ(ʹͬʹ= DʹEL ʹPNʹEL ͨW<ͤL<߭=߭=ݏe ͘1G߭ݏBʹݏDb D߭#P͠P(< (͓1(|(^:0P(P(͌݌(͌(݌ (((1ͼ (zP͔A $ClJAͼ CLJaoA͔B,JA ͬ :0P(P'͓!ͼ͌݌(͌(݌10A BI@ͬBI͓>5ͼ~ ͼ ͼݏOVBͨ1͔!ͼ͌݌(͌(݌1ͬʹC9Pd ʹ09PQͼ͓<ͼݏIAͨ1 ͼ͌݌(͌(݌1ͬ 8P1yͼ*߭ݏAʹݏD ?ͼmAoHͼ_AIPͼ:PPPP ͼ+A#H8i߭ͼ!P#߭ͼ AG4߭%I߭ͼ@͓֭ͤ<,߭ݏI@ͨ߭ݏF@1ͼ P͌݌(͌(݌ (((ͼ P߭ݏF@1ʹͬ=7P1_߭ݏR ݏC߭߭7DG@߭P͜P߭ݏI?1ͼy P߭ݏF?ͨͼR P͌݌(͌(݌1ʹ 5P1z߭ݏR ݏD߭߭66C#?߭5P͠P<??REg߭ ?͠͠4߭F߭߭>͓֭ͤ<,߭ݏF>ͨ߭ݏI>1ͼP߭ݏFm>ͨtͼP͌݌(͌(݌Kͼ~ ͼ͓<ͼݏI>1ͼ͌݌(͌(݌ (((͓(,P,10ݏC=ͨͨF3߭߭;4Xͬʹ3P:߭߭߭4͔@խi= ,S #߭|D߭߭C=ͤ1֭ͤ2խM߭ݏAʹݏC߭߭߭4͔ ʹ   ߭3 9ݬ<Bݬ2^1='=TPIPݏdݬP)ݬ&PPP` ݭPݭP ^߭ݬ~2PPPp^<ݬPPݬ͐h2pݬ.2P=^ԭ 9PR"ѭ?99e>z99L>aݏ99P1߭9ݭݭ99PP?9}9=9~9=ݏݏ{939y9LPPݏq9Sԭ֭ݭq9ݬ"P\9ݭXݭ,J9UP^ݬP PЭPݠݬ -ݽݬ-P^ݬP PЭPݠݬ i-ЭPРPЬP֬P^ݬ9!Pѭ ׭ЭP`/֭ЭP^ЬP֬`ЬP֬` PPP^լ?8լ <8 23ݬ28;P1<,<++ݬ,PP<77;ݭ7z;ݏ+ݏݬ 5PP<772;Gݭ7;1ݏ^߭߭ݬP ݭݬ7z7l7ݏd*߭.PP P1ݭ77:ЭP(^57#P%7P%7EݬE7P`߭ݬ*PP߭:íPPPݬ<+Pݬ'E6PPݬP^ԭЭP@; ֭ѭj6ѭ ЭP@ ݬݬ}P"ԭЭP@ (֭ѭP֭ЭP@ P ^ݬ44߭߭l ^ݬp4d4߭lݏ߭PPP^߭Pԭ%ЭP@8߭ЭP@8(֭ѭ3^ P1&&&3&3&3&]RG <ЬP`P3߭f߭33k3ݏd%P1&%%B3&=3&83%w l33#ݏdJ%^*P1V%M%D%2e%2V%2G% ݬ2222v2Rݏdy$4^u2Z6VPP?k2V2,4A;2U24(ݏU2;6ԭ7ݽݬ#P+ЭPݠݬ#P֭ѭ1ѭ1  11խPЭPР Ь  /֭ݭ1P֭ЭPР ݬ ݽPPսݬ G*Pݬ z`DˑX1l^K1.1 P1;1fxP~EP19L#QP,ݼPP ݼxPPPЬPмP`J0 Ь@0ЬP+0P"0m0"PЬPЬPPP~^ЬQP С JP@ݏP/!P!P ^e/Z3FPP?//11+//1ݏE /+3ԭ!((ݬݽ P ЭPP֭ѭ.Pt^߭ݬ"!PPݬx9!xPtt߭x PPլ ѭ܏ ݬP^ԭЭP@֬   ,ЭPЬ@֭֬   ֬ЭP^֬   딼P>< |;@֬֬+)~P%֭ ֬֬ѭЬP(Ǒ 쑼 摼<>ڑ|ӕΑ;ȑ ֬֬^(C)~OP/֬  ֬֬ ѭ  ݬݬ |P!ݬP۔ԭЬP֬ЬQ֬`a֭ݭݬ 6P ^ -ЬPѭP֭ЭP֭`ЬPθ^/,ͼvݬ,bͼPP.%{,ݽPP_ݭݏ,"P=  P͸PҔݸPݭ9ݭ-սPĬݬP[P[Z~!PYԊY[Pݬ t!Pd!P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Ь[ЬZkPkPzQQPP^߭ݬPPPPЬ[ЬZ[Y[YPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6XЬ[ѬP ѫѫk֫k׫ЫP`P P.``~x{il~*PYU[Zk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [`PYPƏPxPbPZxPZPPZx~@PZZZPZPxPZPPjj`s1xYP[P`ZYQTkE>k[P Ь[[ZZZ%jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j ~\S^\m Pd ЬO PЬPЬRRQ{RPPR PRPPЭRBQPPbPbլQPP(($K2KBKVKmKK@(#)uux 2.2unknown flag %s ** %s ** STARTarg - %s: arg - %s can't get working directory; will try to continue /UNKNOWN%.7swAERROR - (%s) fprx != NULLCAN'T OPEN %swAERROR - (%s) fpc != NULLCAN'T OPEN %s%c %s %s xsys %s bad system name: %s wAERROR - (%s) fpd != NULLCAN'T OPEN %sS %s %s %s - %s 0666 %c %s %c %s prm - %s s - %s, r - %s, ret - %d file s- %s, local - %s %c %s %s %c %s rest %s permission denied %s can't copy %s to %s S %s %s %s - %s 0666 %c %s %c %s %c %s %s wAERROR - (%s) fp != NULLCAN'T OPEN %sR %s %s %s - %c %s %c %s %c %s %s wAERROR - (%s) fpd != NULLCAN'T OPEN %sR %s %s %s - S %s %s %s - %s 0666 %c %s %c %s %c %s %s %c %s %c %s S %s %s %s - %s 0666 exit code %d /usr/lib/uucp/usr/spool/uucp/usr/lib/uucp/L.sys/usr/lib/uucp/L.sys.cr/usr/lib/uucp/L-devices/usr/lib/uucp/L-dialcodespwdrr/full %s w/usr/spool/uucppublic/mkdir %s;chmod 0777 %smkdir - %s %c.%.7s%c%.4sfile - %s LCK.SEQLAERROR - (%s) n < SLOCKTRIESCAN NOT GET %sLCK.SEQL/usr/lib/uucp/SEQFr%4d/usr/lib/uucp/SEQFwAERROR - (%s) fp != NULLCAN NOT OPEN %s/usr/lib/uucp/SEQF/usr/lib/uucp/SEQF/usr/lib/uucp/SEQFw/usr/lib/uucp/SEQF%s%04dLCK.SEQL/dev/null/dev/nullshio - %s AERROR - (%s) f == 0BAD OPEN fileno %dAERROR - (%s) f == 1BAD OPEN fileno %d/bin/shsh-cstatus %d @(#)ulockf 2.3LTMP.%dAERROR - (%s) i < MAXLOCKSTOO MANY LOCKS %dAERROR - (%s) p != NULLCAN NOT ALLOCATE FOR %s%s.%sLCK.%s.%sLCK./dev/null/dev/null/dev/null-s%.7s/usr/lib/uucp/uucicoUUCICO-r1/dev/null/dev/null/dev/null/usr/lib/uucp/uuxqtUUXQT/dev/null/dev/null/dev/null%s -r %suucp/bin/shsh-c@(#)chkpth 2.2AERROR - (%s) ret == 0INIT USERFILE %d..//usr/lib/uucp/USERFILErcAERROR - (%s) ret == 0INIT USERFILE %ducbarpa%.7s%.7sr/etc/passwdrr/bin/shsh-c  AAAAAABBBBBB XXQ`  AAAAAABBBBBB XXQcore 644 0 12 100000 2704666436 4747 ,x( (LL,qΎ l  (xa߽x|pVcore%]corepV<$$ $ $maketapel~$;`GX/0q$``8   &&_,Ĵ h7/ T9 h7/4d@*/hDTl1 /  ~V 0@+/3,܆/4  ܆/܆SD{/tL#q.t(t\(p܆ s /.Sz33,E3t3U/T0!bE U3/t\k EE(|j.ǻ :/e| ((@(#)crt0.c 4.3 (Berkeley) 1/13/82!^.'1M <M4`Mhpx@pCaFpCJE@*Pi["1Un"gp/...getwd: cannot open .. ..getwd: read error in .. getwd: read error in .. getwd: can't change back /etc/passwdrrUnknown error: @pp@(#)closedir.c 4.3 3/30/82@(#)opendir.c 4.3 3/30/82@(#)readdir.c 4.3 3/30/82A, mK#9>$cwdmpt,(n',MppYY <"((< ( ? #      ?     !  #   '  1   0           TBroken pipe =,!tar cf /dev/rmt12 [a-r]* s[a-p]* [t-z]* src/dummyboot /usr/mdec/noboot ...1 ,!,!:d`Ey01" A>A@lddA@iddbillEguest40%58 AstatusxT<d`/dev/rrk0aptDpx !$cwd/X!homerootuserdw3 %term`8p@<cdLP(\\/nbsd/usr`PATH=/etc:/usr/ucb:/bin:/usr/bin:/usr/local:/usr/hosts:.s #path/bin/csh(shell 9035/tmp/sh9035%()#! /bin/csh rewind date cd /nbsd/tp tp cmf /tmp/tape boot icheck mkfs restor cat /usr/mdec/tsboot /usr/mdec/htboot /usr/mdec/tmboot /usr/mdec/noboot /usr/mdec/noboot /usr/mdec/noboot /usr/mdec/noboot /tmp/tape | dd of=/dev/rmt12 bs=512 conv=sync rm /tmp/tape sync /etc/dump 0uf /dev/rmt12 /dev/rrk0a cd /nbsd/usr date tar cf /dev/rmt12 [a-r]* s[a-p]* [t-z]* src/dummy cd /nbsd/usr/src tar cf /dev/rmt12 [a-z]* cd /nbsd tar c \ bin/{adb,login,ps,sh} \ lib/ccom lib/c2 etc/arff etc/rc \ etc/{bad144,badsect,config,dmesg,dump,init,fsck,halt} \ etc/{pstat,reboot,renice,savecore,shutdown} \ etc/{delivermail,dumpdir,getty,icheck,sa} usr/ucb/{last,lastcomm} \ bin/{csh,diff,mail,make,mv,od,rm,rmdir,wall} \ bin/{who,write} \ etc/{mkfs,restor} \ sys \ -C / usr/games/{chase,hangman,rogue,worm} \ -C /bill get date dd if=/dev/rmt12 of=/dev/null bs=1b dd if=/dev/rmt12 of=/dev/null bs=20b dd if=/dev/rmt12 of=/dev/null bs=20b dd if=/dev/rmt12 of=/dev/null bs=20b dd if=/dev/rmt12 of=/dev/null bs=20b mt rew exit 9l<d#Eargv 3XHhl pp psettold=$cwd; chdirev12/billdate  \ /nbsd/usr- /nbsd/tp8 8 0@ tar  lsN+  /etc/dump 0uf /dev/rmt12 /dev/rrk0a  p  date   p   /nbsd/usr !  !0! !p@!$!tar(!=!0 0  L!P!!h!T!cfe! !t!x!@!!!/dev/rmt12!!h!!![a-r]*!!!!!s[a-p]*!!!"![t-z]*!/nbsd/usr!!!old ""!""src/dummy$"D!x"(",!W#m |""date""""p" """""< # ##(#4#@##cf#cfo#/dev/rmt12$#[a-r]*0#s[a-p]*<#[t-z]*L#src/dummyT#T#a#/a/wnjq#$t#|}#cdpath###0ot#/dev/rmt12###%##T%##$$%t(((#src#&$/etc$$X#$0)$,$5$historyE$D'H$0'M$dmP$a$$&d$$echo SCCS/p.*|sed s/SCCS\\/p.//g*|s$($h&$sccslia$sccsut$out$$$H&$/usr/ucb%$/bin$$$% %%/usr/bin% %9%set old=$cwd; chdir !*I%$L%H(Q%cd%set back=$old; set old=$cwd; cd $back; unset back; dirs%/usr/mdec/nobootd%`(#)%'%SSl9%%%&%xrestor%xrestor &# &<%&back%&(&%&-&xhm0&E&l'x''e&sccs get -p !* | diff - !$eu&$x& +}&sd&''&&info&&T$&$&infoe&&&'&src&&'&0-'echo !-1:q > /tmp/$$;vi /tmp/$$;typein `cat /tmp/$$`;rm /tmp/$$='#'&@'U'(((e'0(<(h'u'sccs}'get'-e'4&'8$'co'sccs'unedita'&'+'unedito'ecr''&%' sp'(suspend (tailCS\(-r)(%((,()9(sccsE(delgetU(X'X('](cip(/tmp/tapep((/usr/local(/usr/hosts((/usr/adm/messages(h$(.((cd ..; echo */SCCS/p.*|sed s/SCCS\\/p.//g))()D* )allout))*)9904)xhm4)Q)))TT%\)umounti)*p)0)&))z))8)))pd)))8)) ))%8+)|c)))))xmount)`*)******0A*grep !* /usr/games/lib/quiz.k/areasQ*`)T*%]*aream*/dev/hk0at*775*(,*UU8)**x***xrestor***+***))* *xhm**+*0+grep -i !* /usr/bill/bin/telno -+*0+'5+telL+H+)-L+ddi++l+VVx*y+|+P+++zm++l+P+++*(,+src+ +T5+WWP++++,+kill++exit,*,t) ,x,@,+4$,-rf5,8,+x*=, I,-HUP,e,,h,XX+u,x,L,,},zs,,h,L,, ,,: -::), ,,,YYL,,,,,,xn--,, - --,$-!-xls1-- -:M-(9P-11]-`-4-h-e-setu-x-P-(9-notify-/usr/lib,- -/-==0---/-,08+1--..;;,-xls.((@9.224-).,..4.1.setA.D..P.M.promptv].`.4.h.e.=u.x.P.@9."arpa # "..-..pwd..:.33......mount.X9.9...-/ /`/-/-/D:0/44.=/@//P/M//etc/mount]/:0/(:m//usr/lib-x/x/as/l:/55///|///cd/\:/l:///-/ / d/0/66|/ 0 0/00ls!0$0//)0 @0of=/dev/rmt12@0]0:`077/m0p0D0x0u0ls01`0:0 0<;0<<-000;0pdw000:088D000010ls 1:0:1killt1%1usr.libA1|1D1>>-Q1T1(1\1Y1xlsi1l1D1|1y1/usr/binick11\1(11 11-31bs=5121L21DD4111021xls122??(1 22122pd%2(221-2 /a=2@21L2I2/libY2\2021a2 }222EE122d222pd232d2222@@122222lsw22222usr.bin/bin 3 3223 3 D3,31l583conv=syncD3pl5a3:d3AA2q3t3H3|3y3ls33d3:3ucb/bin334t4HH533\43FFd2333<43ls 4$4 4BBH3443$4!4pdp1444 4394 I4L43\4Y4/lib/binhk1i4l4<43q4 44344xls44t434 4z4H5,T54T;4CC344444xls4:4T;55l; 5GG3-50558555lsE5; 5l;Q575155a5d54+i5 og5|53p5 55p55rm555|65/tmp/tape555II355555ls56556 !6;9QQ6(6zE6;H6JJ5U6X6,6`6]6lsnm6p6H6;y6etc/bin665p6 666KK,666666pd66666 686PP8 7 7677fsck7 768=7t7@7LL6M7P7$7X7U7xlse7h7@7t7q7/etcdev77X7$77 77687/dev/hk0ads77z777MM$777777pds77778 88768 898;<8NN7I8L8 8T8Q8cda8;<8;8t8p8|8sync88d8p8 88<;88|<8OO 888888cpint888<9rlogind996;9fsck$9rm5989h-4-=9 M9P9h..U9 e9/dev/hk1gh9999RR699l999xmount99999/dev/hk0g.c999l99 9 99.:9/mnt: ::9.: %:/dev/hk1gd5:8:P/D:A:/mnt:Q:T:(:/Y: i:/mnt/src:y:|:/|/: ::x0D0: :usr.lib/bin::10: ::$-,: ::|3H3: ds;/usr/ucb ;lib/bin; ;0<;9;~mckusick/newfs/cmdsetI;L;;0Q; oma;d;44i; sry;|;855; ;;`6,6; ;etc/bin;;T8 8; ;;9;;/dev/hk0g;;;6; n/ </tmp/tapets << <8(<%<rmt5<8<<D<A<rshd<Q<T<(<`<]<rwhodsm<p<D<|<y</etcucb<<`<8< <src/dummy ="#P?>D?>X?>>>>>>>? ?? ?0?8?d?p?|??<a==,! X#md==tar cf /dev/rmt12 [a-r]* s[a-p]* [t-z]* src/dummy>dnetVnewUnewsPoldozalppreservepubpublicschmidtshannonskelsklowerspoolmcttbltmp>dict>bin>lost+found>man>include>lib>mdec>msgs?net?new?news?old,?preserve4?pub@?publicL?crashT?adm`?guestl?skelx?spool?tmp?ucb A,hPؚ$,h`.,L4ؚ$|(lP,  Q.wdM  .0=yHMHM.\@fTdMM,@N Q.wd,{XX,wKH hQ.w4#] Q.wdM  .(=y<M<M.T8fTdMM,@NI# xQ.wd< hh,{<<,wK< ""#P?>D?>X?>>>>>>>? ?? ?0?8?d?p?|??< Q.wd,0{D.8D.8,-8. .(.0.8. Q.wd  ,{!!, !!((..(jd;<8Q.dDw5.t555,` 15orgnwfs/cmds/.history tQ.wd(..d`((.`((.,/zA>;rPJjU  Lfx78F0"jhFR-|bKgwv; 4VȬWj&J>cL_TOvqC`hԡAS+U+LnU ,˗ͱbuS6Kgߖ3Fi&]z MC&p``Ap{F !I(i[ZPpǜ([Fj?t U+.c $t{((7Ģ/b^+%5K٭!H̠1ĉ 8:11 نz%xCXչ--WpnH Ez=ߞ۸{l@{uI)cL:⬢4Pݤ((@/O0( DyAjI~=Z!&[K J(פ^},N.VF DvkHm|xh ,br٪E r^4P-'ma-Xr.hJn]ppG*k*I`.A͞kkgO _+`ԡEub3ªӹx YmgY]bE|+TKjڋWbp.Vh\&pD骺? ] 9i?B@fsA c$Rk>+lZ̪u:v >=yH\遙iةI)i(/_.O",}yz̕';?1CW"8#|M `PdFGQgs}qx:ڰ7fH]@v:ÑһaSh .d`A*k9" A,j~~5ʝ`蓩`[7$ Ŕ= k'I7Ń)w|?+5yuQM ax8פ,VyCV%}LK\kNS g b9Y7p/{H@ "ٽ7BÙ!2Zkhe3(!)K9=~Ev{ eo3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@@ 0 (@@ @@ 8 @@E@ @@@ @@ @ 0 @       $@  @ @ B!B @  `@@@@( @@ @ DP@@ @ !@@!  H@@ @ @@ @ @ @@ B @@@@@  @ A   @    @@ @ H@  D@ @    P@@@ @ @ @   @@@D @@ @$   @   @   (  @@@@     @@((`  @   ` A  @@P@@ @@@@ &   @@  @@ @@@@   `@ @ "  @ @@ @   @@hA@ @@(   @    @   @   $ 4 @B @   @ @ @@@ @ @@$@ @ `@  @`@@ @@ @   $@P@  @  "    @ @@ @@ @@@  @D@   @ (@ @@ "  @  A@ @  @  @ @@( !0@@@ @@ @@ @@@@ $"   @@@  @@@  "@ @@@ @@@   ( @@ $ @@@ @  @ @ @@ @@  @@@  @@@  P@@ @  PH@@(@$@  @  @ @ @@ @@@   @  @  @ @  @@ P@ @ @@ @(  @   @  @ @  "` @@@@ T  @  @ @ @@  @ @ @@@@@@ @  @ @@@@@ @  @ @ @`  & "$  @` @ @@   @@    @@ @ @"@  @@H  @ B@P 4   @ @  @@    B  (HH  P@@@@  ((@@@ @0  @ @  @ 0@ @  @ "D@@@ H@@ @ @ @ @B@ @@D@   @@ @   @ @ @    0  @  @@! @@H@ @ @    @@  @ @`   0 @@A@ @   H@B @ @@ @@@  @ @@  @P @D@  @@!   @@ @@P@@ @@"  " @@P @@ @$@ @ @ $ @@`  P  @ @  PP @ @ "  @ @@ @@@(@ @@@A  @ P"@   @ @@   @ @ @@ "@ 0  @ A`@(@@" `@ @@,  @@  @@ H  @H  @$  @@ B  B  @@@@ @@ @@@   @@ HB `@ @   @@  H@@@ $@ @@@@@ @ @ @    @ 2@@@D@@ @@ P@  @@@@@@@ $ @& @  @ @@ p@@ @@@ @ @ ` @0  @ @ @" @@ D`@" @  @P@@@@@@ @@ !@ )@  @@ P" @  @ @@  @ @@ @ EP@ @D@ @@  @ @ @@@ @((   @ @@  @H P  @ @ @@@ @@@ @ @ @ @@ @ P@  @ @@P   @@@@@A@D @ @@  @@@  @ @@  @ `D `   @@ P @ @   @ @@@!@@@  @@  @  @  @ @B@D $@  "A @$  @ @@  @@  @ @  0@@@*@@@ !@C@@ @@@   @   @ $@ !B  @&D    @@@!@D  @ @@ @ @    @ @@ @ @@ @ @ @@ @@ @  @@@@@  @@@@@@A@  @!@   @ @ "$@(@@ @ `@@@   @  `P @ @  ( (@@@ @@    D@A @@ @@@@@ @ @@  @@ @@@$ !@H @@ @ @!! @@@@ @ @@@@@  @H @ @ @2@ " @@  " @@    B @  @P@ @@@@@@P@@  @     @ !  @ @@@@ @@  @ @0 A   0  @ P@@ B@P@ @A @   @@@@@ @@@ `  0@P@@@ H  @A@ @  @  @ @@D@ @ B@  0@(("@!@  @ @@@@@@@P@ X@h  "P @     @ @@@@@ @@@ @  $@@@B  @ @@!   @  @@  @ @ @ @@@   `@@@ B"   @  @ @@@  @ @@    @@@@@ @  @@@@@@ @ @ @ A@D@@@@@@ @0 @  @ @ ! @@@ H@0@@A  @@ @  @   @@  @@  @ @ B @  @ @  @0   @ @  @@  @  @@ @@@@@@@  @@ A  @@(@ @@@@  "  @  @ @@@@   " @@ @@@  @ @P @@$ @ @@@@@  @@ @ @@   @H@@ @B  @@@@  @@  (@ @0@B@ !  @!@ @@ !H @A    $    @ @A  @Adict/spellhist 666 0 33 0 2423027045 6620 dict/words 644 0 33 610510 2423026752 6104 10th 1st 2nd 3rd 4th 5th 6th 7th 8th 9th a Aaron ABA Ababa aback abalone abandon abase abash abate abbas abbe abbey abbot Abbott abbreviate abc abdicate abdomen abdominal abduct Abe abed Abel Abelian Abelson Aberdeen Abernathy aberrant aberrate abet abetted abetting abeyance abeyant abhorred abhorrent abide Abidjan Abigail abject ablate ablaze able ablution Abner abnormal Abo aboard abode abolish abolition abominable abominate aboriginal aborigine aborning abort abound about above aboveboard aboveground abovementioned abrade Abraham Abram Abramson abrasion abrasive abreact abreast abridge abridgment abroad abrogate abrupt abscess abscissa abscissae absence absent absentee absenteeism absentia absentminded absinthe absolute absolution absolve absorb absorbent absorption absorptive abstain abstention abstinent abstract abstractor abstruse absurd abuilding abundant abusable abuse abusive abut abutted abutting abysmal abyss Abyssinia AC academia academic academician academy Acadia acanthus Acapulco accede accelerate accelerometer accent accentual accentuate accept acceptant acceptor access accessible accession accessory accident accidental accipiter acclaim acclamation acclimate acclimatize accolade accommodate accompaniment accompanist accompany accomplice accomplish accord accordant accordion accost account accountant accouter Accra accredit accreditate accretion accrual accrue acculturate accumulate accuracy accurate accusation accusative accuse accustom ace acetate acetic acetone acetylene ache achieve Achilles(( aching achromatic acid acidic acidulous Ackerman Ackley acknowledge acknowledgeable ACM acme acolyte acorn acoustic acquaint acquaintance acquiesce acquiescent acquire acquisition acquisitive acquit acquittal acquitting acre acreage acrid acrobacy acrobat acrobatic acronym acropolis across acrylate acrylic act Actaeon actinic actinide actinium actinolite actinometer activate activation activism Acton actor actress Acts actual actuarial actuate acuity acumen acute acyclic ad Ada adage adagio Adair Adam adamant Adams Adamson adapt adaptation adaptive add added addend addenda addendum addict Addis Addison addition additional additive addle address addressee Addressograph adduce Adelaide Adele Adelia Aden adenoma adept adequacy adequate adhere adherent adhesion adhesive adiabatic adieu adipic Adirondack adjacent adject adjectival adjoin adjoint adjourn adjudge adjudicate adjunct adjust adjutant Adkins Adler administer administrable administrate administratrix admiral admiralty admiration admire admissible admission admit admittance admitted admitting admix admixture admonish admonition ado adobe adolescent Adolph Adolphus Adonis adopt adoption adoptive adore adorn adrenal adrenaline Adrian Adriatic Adrienne adrift adroit adsorb adsorbate adsorption adsorptive adulate adult adulterate adulterous adultery adulthood advance advantage advantageous advent adventitious adventure adventurous adverb adverbial adversary adverse advert advertise advice advisable advise advisee advisor advisory advocacy advocate Aegean aegis Aeneas Aeneid aeolian Aeolus aerate aerial Aerobacter aerobic aerodynamic aerogene aeronautic aerosol aerospace Aeschylus aesthete aesthetic afar affable affair affect affectate affectionate afferent affiance affidavit affiliate affine affinity affirm affirmation affirmative affix afflict affluence affluent afford afforest afforestation affront Afghan Afghanistan aficionado afield afire aflame afloat afoot aforementioned aforesaid aforethought afraid afresh Africa afro aft aftereffect afterglow afterimage afterlife aftermath afternoon afterthought afterward again against Agamemnon agate Agatha agave age Agee agenda agent agglomerate agglutinate agglutinin aggravate aggregate aggression aggressive aggressor aggrieve aghast agile aging agitate agleam Agnes Agnew agnomen agnostic ago agone agony agouti agrarian agree agreeable agreed agreeing Agricola agricultural agriculture agrimony ague Agway ah ahead ahem Ahmadabad ahoy aid Aida aide Aides Aiken ail ailanthus aile aileron aim ain't Ainu air airborne aircraft airdrop airedale Aires airfare airfield airflow airframe airlift airline airlock airmail airman airmass airmen airpark airplane airport airspeed airstrip airtight airway airy aisle Aitken ajar Ajax Akers akin Akron ala Alabama Alabamian alabaster alacrity alai Alameda Alamo alan alarm Alaska alb alba albacore Albania Albanian Albany albatross albeit Alberich Albert Alberta Alberto Albrecht Albright album albumin Albuquerque Alcestis alchemy Alcmena Alcoa alcohol alcoholic alcoholism Alcott alcove Aldebaran aldehyde Alden alder alderman aldermen Aldrich aldrin ale Alec Aleck aleph alert alewife Alex Alexander Alexandra Alexandre Alexandria Alexei Alexis alfalfa alfonso Alfred Alfredo alfresco alga algae algaecide algal algebra algebraic Algenib Alger Algeria Algerian Algiers alginate Algol Algonquin algorithm algorithmic Alhambra alia alias alibi Alice Alicia alien alienate alight align alike alimony aliphatic aliquot Alison Alistair alive alizarin alkali alkaline alkaloid all Allah allay allegate allege Allegheny allegiant allegoric allegory Allegra allegro allele allemand Allen Allentown allergic allergy alleviate alley alleyway alliance allied alligator Allis Allison alliterate allocable allocate allot allotropic allotted allotting allow allowance alloy allspice Allstate allude allure allusion allusive alluvial alluvium ally allyl Allyn alma Almaden almagest almanac almighty almond almost aloe aloft aloha alone along alongside aloof aloud alp alpenstock Alpert alpha alphabet alphabetic alphanumeric Alpheratz Alphonse alpine Alps already Alsatian also Alsop Altair altar alter alterate altercate alterman altern alternate althea although altimeter altitude alto altogether Alton altruism altruist alum alumina aluminate alumna alumnae alumni alumnus alundum Alva Alvarez alveolar alveoli alveolus Alvin alway alyssum am AMA Amadeus amalgam amalgamate amanita amanuensis amaranth Amarillo amass amateur amateurish amatory amaze Amazon ambassador amber ambiance ambidextrous ambient ambiguity ambiguous ambition ambitious ambivalent amble ambling ambrose ambrosia ambrosial ambulant ambulatory ambuscade ambush Amelia ameliorate amen amend amende Amerada America American Americana Americanism americium Ames amethyst amethystine Amherst ami amicable amid amide amidst amigo amino aminobenzoic amiss amity Amman Ammerman ammeter ammo ammonia ammoniac ammonium ammunition Amoco amoeba amoebae amok among amongst amoral amorphous amort Amos amount amperage ampere ampersand Ampex amphetamine amphibian amphibious amphibole amphibology ample amplifier amplify amplitude amply amputate amra Amsterdam Amtrak amulet amuse amy amygdaloid an ana Anabaptist Anabel anachronism anachronistic anaconda anaerobic anaglyph anagram Anaheim analeptic analgesic analogous analogue analogy analyses analysis analyst analytic anamorphic anaplasmosis anarch anarchic anarchy anastigmat anastigmatic anastomosis anastomotic anathema Anatole anatomic anatomy ancestor ancestral ancestry anchor anchorage anchorite anchoritism anchovy ancient ancillary and Andean Andersen Anderson Andes andesine andesite Andorra Andover Andre Andrea Andrei Andrew Andrews Andromache Andromeda Andy anecdotal anecdote anemone anent anew angel Angela Angeles angelfish angelic Angelica Angelina Angeline Angelo anger Angie angiosperm angle Angles Anglican Anglicanism angling Anglo Anglophobia Angola Angora angry angst angstrom anguish angular Angus anharmonic Anheuser anhydride anhydrite anhydrous ani aniline animadversion animadvert animal animate animism animosity anion anionic anise aniseikonic anisotropic anisotropy Anita Ankara ankle Ann Anna annal Annale Annalen Annapolis Anne anneal annex Annie annihilate anniversary annotate announce annoy annoyance annual annuity annul annular annuli annulled annulling annulus annum annunciate anode anodic anomalous anomaly anomie anonymity anonymous anorexia anorthic anorthite anorthosite another Anselm Anselmo ANSI answer ant antacid Antaeus antagonism antagonist antagonistic Antarctica Antares ante anteater antebellum antecedent antedate antelope antenna antennae anterior anthem anther anthology Anthony anthracite anthracnose anthropogenic anthropology anthropomorphic anti antic anticipate anticipatory Antietam antigen Antigone antigorite antimony Antioch antipasto antipathy antiperspirant antiphonal antipodes antiquarian antiquary antiquated antique antiquity antisemitic antisemitism antithetic antler Antoine Antoinette Anton Antonio Antony anus anvil anxiety anxious any anybody anybody'd anyhow anyone anyplace anything anyway anywhere aorta A&P apache apart apartheid apathetic apathy apatite ape aperiodic aperture apex aphasia aphasic aphelion aphid aphorism Aphrodite apices apiece aplomb apocalypse apocalyptic Apocrypha apocryphal apogee Apollo Apollonian apologetic apologia apology apostate apostle apostolic apostrophe apothecary apothegm apotheosis Appalachia appall appanage apparatus apparel apparent apparition appeal appear appearance appeasable appease appellant appellate append appendage appendices appendix appertain appetite Appian applaud applause apple Appleby applejack Appleton appliance applicable applicant applicate applied applique apply appoint appointe appointee apport apposite apposition appraisal appraise appreciable appreciate apprehend apprehension apprehensive apprentice apprise approach approbation appropriable appropriate approval approve approximable approximant approximate apricot April apron apropos apse apt aptitude aqua aquarium Aquarius aquatic aqueduct aqueous Aquila Aquinas Arab arabesque Arabia Arabic Araby Arachne arachnid arbiter arbitrage arbitrary arbitrate arboreal arboretum arbutus arc arcade Arcadia arcana arcane arccos arccosine arch archae archaic archaism archangel archbishop archdiocese archenemy Archer archery archetype archetypical archfool Archibald Archimedes arching archipelago architect architectonic architectural architecture archival archive arcing arcsin arcsine arctan arctangent arctic Arcturus Arden ardency ardent arduous are area areaway areawide arena arenaceous aren't Arequipa Ares Argentina argillaceous Argive argo argon Argonaut Argonne argot argue argument argumentation argumentative Argus arhat Ariadne Arianism arid Aries arise arisen aristocracy aristocrat aristocratic Aristotelean Aristotelian Aristotle arithmetic Arizona ark Arkansan Arkansas Arlen Arlene Arlington arm armada armadillo Armageddon armament Armata armature armchair Armco Armenian armful armhole armillaria armistice armload armoire Armonk Armour armpit Armstrong army Arnold aroma aromatic arose around arousal arouse ARPA arpeggio arrack Arragon arraign arrange arrangeable array arrear arrest Arrhenius arrival arrive arrogant arrogate arrow arrowhead arrowroot arroyo arsenal arsenate arsenic arsenide arsine arson art Artemis artemisia arterial arteriole arteriolosclerosis arteriosclerosis artery artful arthritis Arthur artichoke article articulate articulatory Artie artifact artifice artificial artillery artisan artistry Arturo artwork arty Aruba arum aryl a's as asbestos ascend ascendant ascension ascent ascertain ascetic asceticism ascomycetes ascribe ascription aseptic ash ashame ashen Asher Asheville Ashland Ashley ashman ashmen Ashmolean ashore ashtray ashy Asia Asiatic aside Asilomar asinine ask askance askew asleep asocial asparagus aspect aspen asperity aspersion asphalt aspheric asphyxiate aspidistra aspirant aspirate aspire aspirin asplenium ass assai assail assailant Assam assassin assassinate assault assay assemblage assemble assent assert assess assessor asset assiduity assiduous assign assignation assignee assimilable a((ssimilate assist assistant associable associate associative assonant assort assuage assume assumption assurance assure Assyria Assyriology Astarte astatine aster asteria asterisk asteroid asteroidal asthma astigmat astigmatic astigmatism ASTM astonish Astor Astoria astound astraddle astral astray astride astringent astronaut astronautic astronomer astronomic astronomy astrophysical astrophysics astute Asuncion asunder asylum asymmetric asymmetry asymptote asymptotic asynchronous asynchrony at Atalanta atavism atavistic Atchison ate Athabascan atheist Athena Athenian Athens athlete athletic athwart Atkins Atkinson Atlanta atlantes atlantic Atlantica Atlantis atlas atmosphere atmospheric atom atomic atonal atone atop Atreus atrocious atrocity atrophic atrophy Atropos AT&T attach attache attack attain attainder attempt attend attendant attendee attention attentive attenuate attest attestation attic Attica attire attitude attorney attract attribute attribution attributive attrition attune Atwater Atwood atypic Auberge Aubrey auburn auction auctioneer audacious audacity audible audience audio audiotape audiovisual audit audition auditor auditorium auditory Audrey Audubon Auerbach Aug Augean auger augite augment augmentation augur august Augusta Augustan Augustine Augustus auk aunt auntie aura aural Aurelius aureomycin auric Auriga aurora Auschwitz auspices auspicious austere Austin Australia Australis australite Austria authentic authenticate author authoritarian authoritative autism autistic auto autobiography autoclave autocollimate autocorrelate autocracy autocrat autocratic autograph automat automata automate automatic automaton automobile automotive autonomic autonomous autonomy autopsy autosuggestible autotransformer autumn autumnal auxiliary avail avalanche avarice avaricious Ave avenge Aventine avenue aver average averred averring averse aversion avert avertive Avery Avesta aviary aviate aviatrix avid avionic Avis Aviv avocado avocate avocet Avogadro avoid avoidance Avon avow await awake awaken award aware awash away awe awesome awful awhile awkward awl awn awoke awry ax axe axes axial axiology axiom axiomatic axis axisymmetric axle axon aye Ayers Aylesbury azalea Azerbaijan azimuth azimuthal Aztec Aztecan azure b babbitt babble Babcock babe Babel baboon baby babyhood Babylon Babylonian babysat babysit babysitting baccarat Bacchus Bach bachelor bacilli bacillus back backboard backbone backdrop backfill background backhand backlash backlog backorder backpack backplane backplate backside backspace backstage backstitch backstop backtrack backup backward backwater backwood backyard bacon bacteria bacterial bacterium bad bade Baden badge badinage badland badminton Baffin baffle bag bagatelle baggage bagging baggy Baghdad Bagley bagpipe bah Bahama Bahrein bail Bailey bailiff Baird bait bake Bakelite Bakersfield bakery Bakhtiari baklava Baku balance Balboa balcony bald baldpate Baldwin baldy bale baleen baleful Balfour Bali Balinese balk Balkan balky ball ballad Ballard ballast balled ballerina ballet balletomane ballfield balloon ballot ballroom ballyhoo balm balmy balsa balsam Baltic Baltimore Baltimorean balustrade Balzac bam Bamako Bamberger Bambi bamboo ban banal banana Banbury band bandage bandgap bandit bandpass bandstand bandstop bandwagon bandwidth bandy bane baneberry baneful bang bangkok Bangladesh bangle Bangor Bangui banish banister banjo bank bankrupt bankruptcy Banks banning banquet banshee bantam banter Bantu Bantus baptism baptismal Baptist Baptiste baptistery bar barb Barbados Barbara barbarian barbaric barbarism barbarous barbecue barbell barber barberry barbital barbiturate Barbour barbudo Barcelona Barclay bard bare barefaced barefoot barfly bargain barge baritone barium bark barkeep barley Barlow barn Barnabas barnacle Barnard Barnes Barnet Barnett Barney Barnhard barnstorm barnyard barometer barometric baron baroness baronet baronial barony baroque Barr barrack barracuda barrage barre barrel barren Barrett barrette barricade barrier barring Barrington barrow Barry Barrymore Barstow bartend bartender barter Barth Bartholomew Bartlett Bartok Barton barycentric basal base baseball baseband baseboard Basel baseline baseman basemen baseplate bash bashaw bashful basic basidiomycetes basil basilar basilisk basin basis bask basket basketball basophilic bass Bassett bassi bassinet basso basswood bastard baste bastion bat Batavia batch Batchelder bate bateau Bateman bater Bates bath bathe bathos bathrobe bathroom bathtub Bathurst batik baton Bator batt battalion Battelle batten battery battle battlefield battlefront battleground batwing bauble baud Baudelaire Bauer Bauhaus Bausch bauxite Bavaria bawd bawdy bawl Baxter bay bayberry Bayda bayed Bayesian Baylor bayonet Bayonne bayou Bayport Bayreuth bazaar be beach beachhead beacon bead beadle beady beak beam bean bear bearberry beard Beardsley bearish beast beat beaten beater beatific beatify beatitude beatnik Beatrice beau Beaujolais Beaumont Beauregard beauteous beautiful beautify beauty beaux beaver bebop becalm became because Bechtel beck Becker becket Beckman beckon Becky become bed bedazzle bedbug bedding bedfast Bedford bedim bedimmed bedimming bedlam bedpost bedraggle bedridden bedrock bedroom bedside bedspread bedspring bedstraw bedtime bee Beebe beebread beech Beecham beechwood beef beefsteak beefy beehive been beep beer beet Beethoven beetle befall befallen befell befit befitting befog befogging before beforehand befoul befuddle beg began beget begetting beggar beggary begging begin beginner beginning begonia begotten begrudge beguile begun behalf behave behavioral behead beheld behind behold beige being Beirut bel Bela belate belch Belfast belfry Belgian Belgium Belgrade belie belief believe belittle bell Bella belladonna Bellamy Bellatrix bellboy belle bellflower bellhop bellicose belligerent Bellingham Bellini bellman bellmen bellow bellum bellwether belly bellyache bellyfull Belmont Beloit belong belove below Belshazzar belt Beltsville belvedere belvidere belying BEMA bemadden beman bemoan bemuse Ben bench benchmark bend Bender Bendix beneath Benedict Benedictine benediction benefactor benefice beneficent beneficial beneficiary benefit Benelux benevolent Bengal Bengali benight benign Benjamin Bennett Bennington Benny Benson bent Bentham benthic Bentley Benton Benz Benzedrine benzene Beowulf beplaster bequeath bequest berate Berea bereave bereft Berenices beret berg bergamot Bergen Bergland Berglund Bergman Bergson Bergstrom beribbon beriberi Berkeley berkelium Berkowitz Berkshire Berlin Berlioz Berlitz Berman Bermuda Bern Bernadine Bernard Bernardino Bernardo berne Bernet Bernhard Bernice Bernie Berniece Bernini Bernoulli Bernstein Berra berry berserk Bert berth Bertha Bertie Bertram Bertrand Berwick beryl beryllium beseech beset besetting beside besiege besmirch besotted bespeak bespectacled bespoke Bess Bessel Bessemer Bessie best bestial bestir bestirring bestow bestowal bestseller bestselling bestubble bet beta betatron betel Betelgeuse beth bethel Bethesda Bethlehem bethought betide betoken betony betray betrayal betrayer betroth betrothal Betsey Betsy Bette betting bettor Betty between betwixt bevel beverage Beverly bevy bewail beware bewhisker bewilder bewitch bey beyond bezel bhoy Bhutan bianco bias biaxial bib bibb Bible biblical bibliography bibliophile bicameral bicarbonate bicep biceps bichromate bicker biconcave biconnected bicycle bid biddable bidding biddy bide bidiagonal bidirectional bien biennial biennium bifocal bifurcate big Bigelow Biggs bigot bigotry biharmonic bijouterie bikini bilateral bilayer bile bilge bilharziasis bilinear bilingual bilk bill billboard billet billiard Billie Billiken Billings billion billionth billow billy Biltmore bimetallic bimetallism Bimini bimodal bimolecular bimonthly bin binary binaural bind bindery bindle bindweed bing binge Bingham Binghamton bingle Bini binocular binomial binuclear biochemic biochemist biochemistry biograph biography biology biomass biomedical biometric Biometrika biometry biophysic biophysical biophysicist biopsy bioscience biosphere biostatistic biosynthesize biota biotic biotite bipartisan bipartite biplane bipolar biracial birch bird birdbath birdie birdlike birdseed birdwatch birefringent Birgit Birmingham birth birthday birthplace birthright biscuit bisect bishop bishopric Bismarck Bismark bismuth bison bisque Bissau bistable bistate bit bitch bite bitt bitten bittern bitternut bitterroot bittersweet bitumen bituminous bitwise bivalve bivariate bivouac biz bizarre Bizet blab blabbing black blackball blackberry blackbird blackboard blackbody Blackburn blacken Blackfeet blackjack blackmail Blackman blackout blacksmith Blackstone Blackwell bladder bladdernut bladderwort blade Blaine Blair Blake blame blameworthy blanc blanch Blanchard Blanche bland blank blanket blare blaspheme blasphemous blasphemy blast blat blatant blather blatting Blatz blaze blazon bleach bleak bleary bleat bled bleed Bleeker blemish blend Blenheim bless blest blew blight blimp blind blindfold blink Blinn blip bliss blissful blister blithe blitz blizzard bloat blob bloc Bloch block blockade blockage blockhouse blocky bloke Blomberg Blomquist blond blonde blood bloodbath bloodhound bloodroot bloodshed bloodshot bloodstain bloodstone bloodstream bloody bloom Bloomfield Bloomington bloop blossom blot blotch blotting blouse blow blowfish blown blowup blubber bludgeon blue blueback blueberry bluebill bluebird bluebonnet bluebook bluebush bluefish bluegill bluegrass bluejacket blueprint bluestocking bluet bluff bluish Blum Blumenthal blunder blunt blur blurring blurry blurt blush bluster blustery blutwurst Blythe BMW boa boar board boardinghouse boast boastful boat boathouse boatload boatman boatmen boatswain boatyard bob Bobbie bobbin bobbing bobble bobby bobcat bobolink Boca bock bode bodhisattva bodice bodied Bodleian body bodybuilder bodybuilding bodyguard Boeing Boeotian bog bogey bogeymen bogging boggle boggy Bogota bogus bogy Bohemia Bohr boil Bois Boise boisterous bold boldface bole boletus bolivar Bolivia bolo Bologna bolometer Bolshevik Bolshevism Bolshevist Bolshoi bolster bolt Bolton Boltzmann bomb bombard bombast bombast((ic Bombay bombproof bon bona bonanza Bonaparte Bonaventure bond bondage bondsman bondsmen bone bonfire bong bongo Boniface bonito Bonn bonnet Bonneville Bonnie bonus bony bonze boo booby boogie book bookbind bookcase bookend bookie bookish bookkeep booklet bookplate bookseller bookshelf bookshelves bookstore booky boolean boom boomerang boon Boone boor boorish boost boot Bootes booth bootleg bootlegger bootlegging bootstrap bootstrapping booty booze bop bopping borate borax Bordeaux bordello Borden border borderland borderline bore Borealis Boreas boredom Borg boric Boris born borne Borneo boron borosilicate borough Borroughs borrow Bosch Bose bosom boson boss Boston Bostonian Boswell botanic botanist botany botch botfly both bothersome Botswana bottle bottleneck bottom bottommost botulin botulism Boucher bouffant bough bought boulder boulevard bounce bouncy bound boundary bounty bouquet bourbon bourgeois bourgeoisie bourn boustrophedon bout boutique bovine bow Bowditch Bowdoin bowel Bowen bowfin bowie bowl bowline bowman bowmen bowstring box boxcar boxwood boxy boy boyar Boyce boycott Boyd boyhood boyish Boyle Boylston BP brace bracelet bracken bracket brackish bract brad Bradbury Bradford Bradley Bradshaw Brady brae brag Bragg bragging Brahmaputra Brahms Brahmsian braid Braille brain Brainard brainstorm brainwash brainy brake brakeman bramble bran branch brand Brandeis Brandenburg brandish Brandon Brandt brandy brandywine Braniff brant brash Brasilia brass brassiere brassy bratwurst Braun bravado brave bravery bravo bravura brawl bray brazen brazier Brazil Brazilian Brazzaville breach bread breadboard breadfruit breadroot breadth break breakage breakaway breakdown breakfast breakoff breakpoint breakthrough breakup breakwater bream breast breastplate breastwork breath breathe breathtaking breathy breccia bred breech breeches breed breeze breezy Bremen bremsstrahlung Brenda Brendan Brennan Brenner Brent Brest brethren Breton Brett breve brevet brevity brew brewery Brewster Brian briar bribe bribery Brice brick brickbat bricklayer bricklaying bridal bride bridegroom bridesmaid bridge bridgeable bridgehead Bridgeport Bridget Bridgetown Bridgewater bridgework bridle brief briefcase brig brigade brigadier brigantine Briggs Brigham bright brighten Brighton brilliant Brillouin brim brimful brimming brimstone Brindisi brindle brine bring brink brinkmanship briny Brisbane brisk bristle Bristol Britain Britannic Britannica britches British Briton Brittany Britten brittle broach broad broadcast broaden broadloom broadside Broadway brocade broccoli brochure Brock brockle Broglie broil broke broken brokerage Bromfield bromide bromine Bromley bronchi bronchial bronchiolar bronchiole bronchitis bronchus bronco Bronx bronze bronzy brood broody brook Brooke Brookhaven Brookline Brooklyn brookside broom broomcorn broth brothel brother brotherhood brought brouhaha brow browbeaten brown Browne Brownell Brownian brownie brownish browse Bruce brucellosis Bruckner Bruegel bruise bruit Brumidi brunch brunette Brunhilde Bruno Brunswick brunt brush brushfire brushlike brushwork brushy brusque Brussels brutal brute Bryan Bryant Bryce Bryn bryophyta bryophyte bryozoa b's BSTJ BTL bub bubble Buchanan Bucharest Buchenwald Buchwald buck buckaroo buckboard bucket bucketfull buckeye buckhorn buckle Buckley Bucknell buckshot buckskin buckthorn buckwheat bucolic bud Budapest Budd Buddha Buddhism Buddhist budding buddy budge budget budgetary Budweiser Buena Buenos buff buffalo buffet bufflehead buffoon bug bugaboo bugeyed bugging buggy bugle Buick build buildup built builtin Bujumbura bulb bulblet Bulgaria bulge bulk bulkhead bulky bull bulldog bulldoze bullet bulletin bullfinch bullfrog bullhead bullhide bullish bullock bullseye bullwhack bully bullyboy bulrush bulwark bum bumble bumblebee bumming bump bumptious bun bunch Bundestag bundle bundy bungalow bungle bunk bunkmate bunny Bunsen bunt Bunyan buoy buoyant burbank Burch burden burdensome burdock bureau bureaucracy bureaucrat bureaucratic buret burette burg burgeon burgess burgher burglar burglarproof burglary Burgundian Burgundy burial buried Burke burl burlap burlesque burley Burlington burly Burma Burmese burn Burnett Burnham burnish Burnside burnt burp Burr burro Burroughs burrow bursitis burst bursty Burt Burton Burtt Burundi bury bus busboy Busch bush bushel bushmaster Bushnell bushwhack bushy business businessman businessmen buss bust bustard bustle busy but butadiene butane butch butchery butene buteo butler butt butte butterball buttercup butterfat Butterfield butterfly buttermilk butternut buttery buttock button buttonhole buttonweed buttress Buttrick butyl butyrate buxom Buxtehude Buxton buy buyer buzz Buzzard buzzer buzzing buzzword buzzy by bye Byers bygone bylaw byline bypass bypath byproduct Byrd Byrne byroad Byron Byronic bystander byte byway byword Byzantine Byzantium c cab cabal cabana cabaret cabbage cabdriver cabin cabinet cabinetmake cabinetry cable Cabot cacao cachalot cache cackle CACM cacophonist cacophony cacti cactus cadaver cadaverous caddis caddy cadent cadenza cadet Cadillac cadmium cadre Cady Caesar cafe cafeteria cage cagey Cahill cahoot caiman Cain Caine cairn Cairo cajole cake Cal Calais calamitous calamity calamus calcareous calcify calcite calcium calculable calculate calculi calculus Calcutta Calder caldera Caldwell Caleb calendar calendrical calf calfskin Calgary Calhoun caliber calibrate calibre calico California californium caliper caliph caliphate calisthenic Calkins call calla Callaghan Callahan caller calligraph calligraphy calliope Callisto callous callus calm caloric calorie calorimeter calorimetric calorimetry Calumet calumniate calumny Calvary calve Calvert Calvin Calvinist calypso cam camaraderie camber Cambodia cambric Cambridge Camden came camel camelback camellia camelopard Camelot cameo camera cameraman cameramen Cameron Cameroun camilla Camille Camino camouflage camp campaign campanile Campbell campfire campground campion campsite campus can Canaan Canada Canadian canal canary Canaveral Canberra cancel cancellate cancer cancerous candela candelabra candid candidacy candidate Candide candle candlelight candlestick candlewick candy cane Canfield canine Canis canister canker cankerworm canna cannabis cannel cannery cannibal canning cannister cannon cannonball cannot canny canoe Canoga canon canonic canopy can't cant cantaloupe canteen Canterbury canterelle canticle cantilever cantle canto canton Cantonese cantor canvas canvasback canvass canyon cap capacious capacitance capacitate capacitive capacitor capacity cape capella caper Capetown capillary Capistrano capita capital capitol Capitoline capitulate capo capping caprice capricious Capricorn capstan capstone capsule captain captaincy caption captious captivate captive captor capture Caputo capybara car carabao Caracas caramel caravan caraway carbide carbine carbohydrate Carboloy carbon carbonaceous carbonate Carbondale Carbone carbonic carbonyl carborundum carboxy carboy carbuncle carcass carcinogen carcinogenic carcinoma card cardamom cardboard cardiac cardinal cardiology cardiovascular care careen career carefree careful caress caret caretaker careworn Carey Cargill cargo cargoes Carib Caribbean caribou caricature Carl Carla Carleton Carlin Carlisle Carlo carload Carlson Carlton Carlyle Carmela Carmen Carmichael carmine carnage carnal carnation carne Carnegie carney carnival carob carol Carolina Caroline Carolingian Carolinian Carolyn carouse carp Carpathia carpenter carpentry carpet carport Carr carrageen Carrara carrel carriage Carrie carrion Carroll carrot Carruthers carry carryover Carson cart carte cartel Cartesian Carthage cartilage cartographer cartographic cartography carton cartoon cartridge cartwheel Caruso carve carven Casanova casbah cascade cascara case casebook casein casework Casey cash cashew cashier cashmere casino cask casket Cassandra casserole cassette Cassiopeia Cassius cassock cast castanet caste casteth castigate Castillo castle castor Castro casual casualty cat cataclysmic Catalina catalogue catalpa catalysis catalyst catalytic catapult cataract catastrophe catastrophic catatonia catatonic catawba catbird catch catchup catchword catchy catechism categoric category catenate cater caterpillar catfish catharsis cathedral Catherine Catherwood catheter cathode cathodic catholic Catholicism Cathy cation cationic catkin catlike catnip Catskill catsup cattail cattle cattleman cattlemen Caucasian Caucasus Cauchy caucus caught cauliflower caulk causal causate cause caustic caution cautionary cautious cavalcade cavalier cavalry cave caveat caveman cavemen Cavendish cavern cavernous caviar cavil cavilling Caviness cavort caw cayenne Cayley Cayuga CBS CDC cease Cecil Cecilia Cecropia cedar cede cedilla Cedric ceil celandine Celanese Celebes celebrant celebrate celebrity celerity celery celesta celestial Celia cell cellar cellophane cellular cellulose Celsius Celtic cement cemetery Cenozoic censor censorial censure census cent centaur centenary centennial centerline centerpiece centigrade centipede central centrex centric centrifugal centrifugate centrifuge centrist centroid centum century Cepheus ceramic ceramium Cerberus cereal cerebellum cerebral cerebrate ceremonial ceremonious ceremony Ceres cereus cerise cerium CERN certain certainty certificate certified certify certiorari certitude cerulean Cervantes Cesare cesium cessation cession Cessna cetera Cetus Ceylon Cezanne Chablis Chad Chadwick chafe chaff chagrin chain chair chairlady chairman chairmen chairperson chairwoman chairwomen chaise chalcedony chalcocite chalice chalk chalkline chalky challenge Chalmers chamber chamberlain chambermaid Chambers chameleon chamfer chamois chamomile champ champagne Champaign champion Champlain chance chancel chancellor chancery chancy chandelier chandler Chang change changeable changeover channel chanson chant chantey Chantilly chantry Chao chaos chaotic chap chaparral chapel chaperon chaperone chaplain Chaplin Chapman chapping chapter char character characteristic charcoal chard charge chargeable chariot charisma charismatic charitable charity Charles Charleston Charley Charlie Charlotte Charlottesville charm Charon cha((rring chart Charta Chartres chartreuse chartroom Charybdis chase chasm chassis chaste chastise chastity chat chateau chateaux Chatham Chattanooga chattel chatting chatty Chaucer chauffeur Chauncey Chautauqua chaw cheap cheat cheater check checkbook checkerberry checkerboard checklist checkout checkpoint checksum checksummed checksumming checkup cheek cheekbone cheeky cheer cheerful cheerleader cheery cheese cheesecloth cheesy cheetah chef chelate chemic chemise chemisorb chemisorption chemist chemistry Chen Cheney chenille cherish Cherokee cherry chert cherub cherubim Chesapeake Cheshire chess chest Chester Chesterton chestnut chevalier Chevrolet chevron chevy chew Cheyenne chi Chiang chianti chic Chicago Chicagoan chicanery Chicano chick chickadee chicken chickweed chicory chide chief chiefdom chieftain chiffon chigger chignon chilblain child childbirth childhood childish childlike children Chile chili chill chilly chime chimera chimeric Chimique chimney chimpanzee chin china Chinaman Chinamen Chinatown chinch chinchilla chine Chinese chink chinning Chinook chinquapin chip chipboard chipmunk Chippendale chipping chiropractor chirp chisel Chisholm chit chiton chivalrous chivalry chive chlorate chlordane chloride chlorine chloroform chlorophyll chloroplatinate chock chocolate Choctaw choice choir choirmaster choke chokeberry cholera cholesterol cholinesterase chomp choose choosy chop Chopin chopping choppy choral chorale chord chordal chordata chordate chore choreograph choreography chorine chortle chorus chose chosen Chou chow chowder Chris Christ christen Christendom Christensen Christenson Christian Christiana Christianson Christie Christina Christine Christlike Christmas Christoffel Christopher Christy chromate chromatic chromatogram chromatograph chromatography chrome chromic chromium chromosphere chronic chronicle chronograph chronography chronology chrysanthemum Chrysler chrysolite chub chubby chuck chuckle chuckwalla chuff chug chugging chum chumming chummy chump Chungking chunk chunky church churchgoer churchgoing Churchill Churchillian churchman churchmen churchwoman churchwomen churchyard churn chute chutney CIA cicada Cicero Ciceronian cider cigar cigarette cilia ciliate cimcumvention cinch Cincinnati cinder Cinderella cinema cinematic Cinerama cinnabar cinnamon cinquefoil cipher circa Circe circle circlet circuit circuitous circuitry circulant circular circulate circulatory circumcircle circumcise circumcision circumference circumferential circumflex circumlocution circumpolar circumscribe circumscription circumspect circumsphere circumstance circumstantial circumvent circumvention circus cirmcumferential cistern citadel citation cite citizen citizenry citrate citric Citroen citron citrus city cityscape citywide civet civic civil civilian clad cladding cladophora claim claimant Claire clairvoyant clam clamber clamming clammy clamp clamshell clan clandestine clang clank clannish clap clapboard Clapeyron clapping Clara Clare Claremont Clarence Clarendon claret clarify clarinet clarity Clark Clarke clash clasp class classic classification classificatory classify classmate classroom classy clatter clattery Claude Claudia Claudio Claus clause Clausen Clausius claustrophobia claustrophobic claw clay Clayton clean cleanse cleanup clear clearance clearheaded Clearwater cleat cleavage cleave cleft clement Clemson clench clergy clergyman clergymen cleric clerk Cleveland clever cliche click client clientele cliff cliffhang Clifford Clifton climactic climate climatic climatology climax climb clime clinch cling clinging clinic clinician clink Clint Clinton Clio clip clipboard clipping clique Clive cloak cloakroom clobber clock clockwatcher clockwise clockwork clod cloddish clog clogging cloister clomp clone clonic close closet closeup closure clot cloth clothbound clothe clothesbrush clotheshorse clothesline clothesman clothesmen clothier Clotho clotting cloture cloud cloudburst cloudy clout clove clown cloy club clubbing clubhouse clubroom cluck clue clump clumsy clung cluster clutch clutter Clyde Clytemnestra coach coachman coachmen coachwork coadjutor coagulable coagulate coal coalesce coalescent coalition coarse coarsen coast coastal coastline coat Coates coattail coauthor coax coaxial cobalt Cobb cobble cobblestone Cobol cobra cobweb coca cocaine coccidiosis cochineal cochlea Cochran Cochrane cock cockatoo cockcrow cockeye cockle cocklebur cockleshell cockpit cockroach cocksure cocktail cocky coco cocoa coconut cocoon cod coda Coddington coddle code codebreak codeposit codetermine codeword codfish codicil codify codpiece Cody coed coeditor coeducation coefficient coequal coerce coercible coercion coercive coexist coexistent coextensive cofactor coffee coffeecup coffeepot coffer Coffey coffin Coffman cog cogent cogitate cognac cognate cognition cognitive cognizable cognizant Cohen cohere coherent cohesion cohesive Cohn cohort cohosh coiffure coil coin coinage coincide coincident coincidental coke col cola colander colatitude Colby cold Cole Coleman Coleridge Colette coleus Colgate colicky coliform coliseum collaborate collage collagen collapse collapsible collar collarbone collard collate collateral colleague collect collectible collector college collegian collegiate collet collide collie Collier collimate collinear Collins collision collocation colloidal colloquia colloquial colloquium colloquy collude collusion Cologne Colombia Colombo colon colonel colonial colonist colonnade colony Colorado colorate coloratura colorimeter colorimetry colossal Colosseum colossi colossus colt coltish coltsfoot Columbia columbine Columbus column columnar colza coma Comanche comatose comb combat combatant combatted combinate combinator combinatorial combinatoric combine combustible combustion come comeback comedian comedy comet cometary cometh comfort comic Cominform comma command commandant commandeer commando commemorate commend commendation commendatory commensurable commensurate comment commentary commentator commerce commercial commingle commiserate commissariat commissary commission commit committable committal committed committee committeeman committeemen committeewoman committeewomen committing commodious commodity commodore common commonality commonplace commonweal commonwealth commotion communal commune communicable communicant communicate communion communique commutate commute compact Compagnie companion companionway company comparative comparator compare comparison compartment compass compassion compassionate compatible compatriot compel compellable compelled compelling compendia compendium compensable compensate compensatory compete competent competition competitive competitor compilation compile complacent complain complainant complaint complaisant complement complementarity complementary complementation complete completion complex complexion compliant complicate complicity compliment complimentary compline comply component componentry comport compose composite composition compositor compost composure compote compound comprehend comprehensible comprehension comprehensive compress compressible compression compressive compressor comprise compromise Compton comptroller compulsion compulsive compulsory computation compute comrade con Conakry Conant concatenate concave conceal concede conceit conceive concentrate concentric concept conception conceptual concern concert concerti concertina concertmaster concerto concession concessionaire conch concierge conciliate conciliatory concise concision conclave conclude conclusion conclusive concoct concomitant concord concordant concourse concrete concretion concubine concur concurred concurrent concurring concussion condemn condemnate condemnatory condensate condense condensible condescend condescension condiment condition condolence condone conduce conducive conduct conductance conductive conductor conduit cone coneflower Conestoga coney confabulate confect confectionery confederacy confederate confer conferee conference conferrable conferred conferring confess confession confessor confidant confidante confide confident confidential configuration configure confine confirm confirmation confirmatory confiscable confiscate confiscatory conflagrate conflict confluent confocal conform conformal conformance conformation confound confrere confront confrontation Confucian Confucianism Confucius confuse confusion confute congeal congener congenial congenital congest congestion congestive conglomerate Congo Congolese congratulate congratulatory congregate congress congressional congressman congressmen congresswoman congresswomen congruent conic conifer coniferous conjectural conjecture conjoin conjoint conjugal conjugate conjunct conjuncture conjure Conklin Conley conn Connally connect Connecticut connector Conner Connie connivance connive connoisseur Connors connotation connotative connote connubial conquer conqueror conquest conquistador Conrad Conrail consanguine consanguineous conscience conscientious conscionable conscious conscript conscription consecrate consecutive consensus consent consequent consequential conservation conservatism conservative conservator conservatory conserve consider considerate consign consignee consignor consist consistent consolation console consolidate consonant consonantal consort consortium conspicuous conspiracy conspirator conspiratorial conspire Constance constant Constantine Constantinople constellate consternate constituent constitute constitution constrain constraint constrict constrictor construct constructible constructor construe consul consular consulate consult consultant consultation consultative consume consummate consumption consumptive contact contagion contagious contain contaminant contaminate contemplate contemporaneous contemporary contempt contemptible contemptuous contend content contention contentious contest contestant context contextual contiguity contiguous continent continental contingent continua continual continuant continuation continue continued continuity continuo continuous continuum contort contour contraband contrabass contraception contraceptive contract contractor contractual contradict contradictory contradistinct contradistinguish contralatera((l contralto contraption contrariety contrary contrast contravariant contravene contravention contretemps contribute contribution contributor contributory contrite contrition contrivance contrive control controllable controlled controller controlling controversial controversy controvertible contumacy contusion conundrum Convair convalesce convalescent convect convene convenient convent convention converge convergent conversant conversation converse conversion convert convertible convex convey conveyance conveyor convict convince convivial convocate convoke convolute convolution convolve convoy convulse convulsion convulsive Conway cony coo cook cookbook Cooke cookery cookie cooky cool coolant Cooley coolheaded Coolidge coon coop cooperate coordinate Coors coot cop cope Copeland Copenhagen Copernican Copernicus copious coplanar copolymer copperas Copperfield copperhead coppery copra coprinus copter copy copybook copyright copywriter coquette coquina coral coralberry coralline corbel Corbett Corcoran cord cordage cordial cordite cordon corduroy core Corey coriander Corinth Corinthian Coriolanus cork corkscrew cormorant corn cornbread cornea Cornelia Cornelius Cornell cornerstone cornet cornfield cornflower cornish cornmeal cornstarch cornucopia Cornwall corny corollary corona Coronado coronary coronate coroner coronet coroutine Corp corpora corporal corporate corporeal corps corpse corpsman corpsmen corpulent corpus corpuscular corral corralled correct corrector correlate correspond correspondent corridor corrigenda corrigendum corrigible corroborate corroboree corrode corrodible corrosion corrosive corrugate corrupt corruptible corruption corsage cortege cortex cortical Cortland corundum coruscate corvette Corvus cos cosec coset Cosgrove cosh cosine cosmetic cosmic cosmology cosmopolitan cosmos cosponsor Cossack cost Costello costume cosy cot cotangent cotillion cotman cotoneaster cotta cottage cotton cottonmouth cottonseed cottonwood cottony Cottrell cotty couch cougar cough could couldn't coulomb Coulter council councilman councilmen councilwoman councilwomen counsel counselor count countenance counteract counterargument counterattack counterbalance counterclockwise counterexample counterfeit counterflow counterintuitive counterman countermen counterpart counterpoint counterpoise counterproductive counterproposal countersink countersunk countervail countrify country countryman countrymen countryside countrywide county countywide coup coupe couple coupon courage courageous courier course court courteous courtesan courtesy courthouse courtier Courtney courtroom courtyard cousin couturier covalent covariant covariate covary cove coven covenant Coventry cover coverage coverall coverlet covert covet covetous cow Cowan coward cowardice cowbell cowbird cowboy cowhand cowherd cowhide cowl cowlick cowman cowmen coworker cowpea cowpoke cowpony cowpox cowpunch cowry cowslip cox coxcomb coy coyote coypu cozen cozier cozy CPA crab crabapple crabbing crack crackle crackpot cradle craft craftsman craftsmen craftspeople craftsperson crafty crag craggy Craig cram Cramer cramming cramp cranberry Crandall crane cranelike Cranford crania cranium crank crankcase crankshaft cranky cranny Cranston crap crappie crash crass crate crater cravat crave craven craw Crawford crawl crawlspace crayfish crayon craze crazy creak creaky cream creamery creamy crease create creating creature creche credent credential credenza credible credit creditor credo credulity credulous creed creedal creek creekside creep creepy cremate crematory Creole Creon creosote crepe crept crescendo crescent cress crest crestfallen Crestview Cretaceous Cretan Crete cretin cretinous crevice crew crewcut crewel crewman crewmen crib cribbing cricket cried crime Crimea criminal crimp crimson cringe crinkle cripple crises crisis crisp Crispin criss crisscross criteria criterion critic critique critter croak crochet crock crockery Crockett crocodile crocodilian crocus croft Croix Cromwell Cromwellian crone crony crook croon crop cropping Crosby cross crossarm crossbar crossbill crosscut crosshatch crossover crosspoint crossroad crosstalk crosswalk crossway crosswise crosswort crotch crotchety crouch croupier crow crowbait crowberry crowd crowfoot Crowley crown croydon CRT crucial crucible crucifix crucifixion crucify crud cruddy crude cruel cruelty Cruickshank cruise crumb crumble crummy crump crumple crunch crupper crusade crush Crusoe crust crutch crux cry cryogenic cryostat crypt cryptanalysis cryptanalyst cryptanalytic cryptic cryptogram cryptographer cryptography crystal crystalline crystallite crystallographer crystallography c's cub Cuba cubbyhole cube cubic cuckoo cucumber cud cuddle cuddly cudgel cue cuff cufflink cuisine Culbertson culinary cull culminate culpa culpable culprit cult cultivable cultivate cultural culture Culver culvert Cumberland cumbersome cumin Cummings Cummins cumulate cumulus Cunard cunning Cunningham CUNY cup cupboard cupful Cupid cupidity cupping cupric cuprous cur curate curb curbside curd curdle cure curfew curia curie curio curiosity curious curium curl curlew curlicue Curran currant current curricula curricular curriculum curry curse cursive cursor cursory curt curtail curtain Curtis curtsey curvaceous curvature curve curvilinear Cushing cushion Cushman cusp Custer custodial custodian custody custom customary customhouse cut cutaneous cutback cute cutlass cutler cutlet cutoff cutout cutover cutthroat cutting cuttlebone cuttlefish cutworm Cyanamid cyanate cyanic cyanide cybernetics cycad Cyclades cycle cyclic cyclist cyclone cyclopean Cyclops cyclorama cyclotron Cygnus cylinder cylindric cynic Cynthia cypress Cyprian Cypriot Cyprus Cyril Cyrus cyst cytochemistry cytolysis cytoplasm czar czarina Czechoslovakia Czerniak d dab dabbing dabble Dacca dachshund dactyl dactylic dad Dadaism Dadaist daddy Dade Daedalus daffodil daffy dagger Dahl dahlia Dahomey Dailey Daimler dainty dairy Dairylea dairyman dairymen dais daisy Dakar Dakota dale Daley Dallas dally Dalton Daly Dalzell dam damage Damascus damask dame damming damn damnation Damon damp dampen damsel Dan Dana Danbury dance dandelion dandy Dane dang danger dangerous dangle Daniel Danielson Danish dank Danny Dante Danube Danubian Danzig Daphne dapper dapple Dar dare Darius dark darken darkle Darlene darling darn Darrell d'art dart Dartmouth Darwin Darwinian dash dashboard dastard data database date dateline dater Datsun datum daub Daugherty daughter daunt dauphin dauphine Dave davenport David Davidson Davies Davis Davison davit Davy dawn Dawson day daybed daybreak daydream daylight daytime Dayton Daytona daze dazzle DC De deacon deaconess deactivate dead deaden deadhead deadline deadlock deadwood deaf deafen deal deallocate dealt dean Deane Deanna dear Dearborn dearie dearth death deathbed deathward debacle debar debarring debase debate debater debauch debauchery Debbie Debby debenture debilitate debility debit debonair Deborah Debra debrief debris debt debtor debug debugged debugger debugging debunk Debussy debut debutante Dec decade decadent decal decant decathlon Decatur decay Decca decease decedent deceit deceitful deceive decelerate December decennial decent deception deceptive decertify decibel decide deciduous decile decimal decipher decision decisional decisive deck Decker declaim declamation declamatory declaration declarative declarator declaratory declare declassify declination decline declivity decode decolletage decollimate decompile decomposable decompose decomposition decompress decompression decontrol decontrolled decontrolling deconvolution deconvolve decor decorate decorous decorticate decorum decouple decrease decree decreeing decrement decry decrypt decryption dedicate deduce deducible deduct deductible Dee deed deem deep deepen deer Deere deerskin deerstalker deface default defeat defecate defect defend defendant defensible defensive defer deferent deferrable deferred deferring defiant deficient deficit define definite definition definitive deflate deflater deflect deflector defocus deforest deforestation deform deformation defraud defray defrost deft defunct defy degas degassing degeneracy degenerate degradation degrade degrease degree degum degumming dehumidify dehydrate deify deign deity deja deject Del Delaney Delano Delaware delay delectable delectate delegable delegate delete deleterious deletion Delhi Delia deliberate delicacy delicate delicatessen delicious delicti delight delightful Delilah delimit delimitation delineament delineate delinquent deliquesce deliquescent delirious delirium deliver deliverance delivery dell Della Delmarva delouse Delphi Delphic delphine delphinium Delphinus delta deltoid delude deluge delusion delusive deluxe delve demagnify demagogue demand demarcate demark demean demented demerit demigod demijohn demiscible demise demit demitted demitting democracy democrat democratic demodulate demography demolish demolition demon demoniac demonic demonstrable demonstrate demote demountable Dempsey demultiplex demur demure demurred demurrer demurring demythologize den denature Deneb Denebola deniable denial denigrate denizen Denmark Dennis Denny denominate denotation denotative denote denouement denounce dense densitometer densitometric densitometry dent dental dentistry Denton denture denudation denude denumerable denunciate Denver deny deodorant deoxyribonucleic depart department departure depend dependent depict deplete depletion deplore deploy deport deportation deportee depose deposit depositary deposition depositor depository depot deprave deprecate deprecatory depreciable depreciate depress depressant depressed depressible depressing depression depressive depressor deprivation deprive depth deputation depute deputy derail derange derate derby Derbyshire dereference deregulate Derek derelict deride derision derisive derivate derive derogate derogatory derrick derriere dervish Des descant Descartes descend descendant descendent descent describe description descriptive descriptor desecrate desecrater desegregate desert deserve desiderata desideratum design designate desire desirous desist desk Desmond desolate desolater desorption despair desperado desperate despicable despise ((despite despoil despond despondent despot despotic dessert dessicate destabilize destinate destine destiny destitute destroy destruct destructor desuetude desultory desynchronize detach detail detain d'etat detect detector detent detente detention deter detergent deteriorate determinant determinate determine deterred deterrent deterring detest detestation detonable detonate detour detract detractor detriment Detroit deuce deus deuterate deuterium devastate develop deviant deviate device devil devilish devious devise devisee devoid devolve Devon Devonshire devote devotee devotion devour devout dew dewar dewdrop Dewey Dewitt dewy dexter dexterity dextrous dey Dhabi dharma diabase diabetes diabetic diabolic diachronic diacritical diadem diagnosable diagnose diagnoses diagnosis diagnostic diagnostician diagonal diagram diagrammatic dial dialect dialectic dialogue dialysis diamagnetic diamegnetism diameter diametric diamond Diana Diane Dianne diaper diaphanous diaphragm diary diathermy diathesis diatom diatomaceous diatomic diatonic dibble dice dichloride dichondra dichotomy dick dickcissel dickens Dickerson dickey Dickinson Dickson dicotyledon dicta dictate dictatorial diction dictionary dictum did didactic diddle didn't Dido die Diebold died Diego diehard dieldrin dielectric diem diesel diet dietary dietetic diethylstilbestrol dietician Dietrich diety Dietz differ different differentiable differential differentiate difficult difficulty diffident diffract diffractometer diffuse diffusible diffusion diffusive difluoride dig digest digestible digestion digestive digging digit digital digitalis dignify dignitary dignity digram digress digression dihedral dilapidate dilatation dilate dilation dilatory dilemma dilettante diligent dill Dillon dilogarithm diluent dilute dilution dim dime dimension dimethyl diminish diminution diminutive dimming dimple din Dinah dine ding dinghy dingo dingy dinnertime dinnerware dinosaur dint diocesan diocese diode Dionysian Dionysus Diophantine diopter diorama diorite dioxide dip diphthong diploma diplomacy diplomat diplomatic dipole dipping Dirac dire direct director directorate directory directrices directrix dirge Dirichlet dirt dirty Dis disambiguate disastrous disburse disc discern discernible disciple disciplinary discipline discoid discomfit discordant discovery discreet discrepant discrete discretion discretionary discriminable discriminant discriminate discriminatory discus discuss discussant discussion disdain disdainful disembowel disgruntle disgustful dish dishevel dishwasher dishwater disjunct disk dismal dismissal Disney Disneyland disparage disparate dispel dispelled dispelling dispensary dispensate dispense dispersal disperse dispersible dispersion dispersive disposable disposal disputant dispute disquietude disquisition disrupt disruption disruptive dissemble disseminate dissension dissertation dissident dissipate dissociable dissociate dissonant dissuade distaff distal distant distillate distillery distinct distinguish distort distortion distraught distribution distributive distributor district disturb disturbance disulfide disyllable ditch dither ditto ditty diurnal diva divalent divan dive diverge divergent diverse diversify diversion diversionary divert divest divestiture divide dividend divination divine divisible division divisional divisive divisor divorce divorcee divulge Dixie dixieland Dixon dizzy Djakarta DNA Dnieper do Dobbin Dobbs doberman dobson docile dock docket dockside dockyard doctor doctoral doctorate doctrinaire doctrinal doctrine document documentary documentation DOD Dodd dodecahedra dodecahedral dodecahedron dodge Dodson doe doesn't d'oeuvre doff dog dogbane dogberry Doge dogfish dogging doggone doghouse dogleg dogma dogmatic dogmatism dogtooth dogtrot dogwood Doherty Dolan dolce doldrum dole doleful doll dollar dolly dolomite dolomitic Dolores dolphin dolt doltish domain dome Domenico Domesday domestic domicile dominant dominate domineer Domingo Dominic Dominican Dominick dominion Dominique domino don Donahue Donald Donaldson donate done Doneck donkey Donna Donnelly Donner donning donnybrook donor Donovan don't doodle Dooley Doolittle doom doomsday door doorbell doorkeep doorkeeper doorknob doorman doormen doorstep doorway dopant dope Doppler Dora Dorado Dorcas Dorchester Doreen Doria Doric Doris dormant dormitory Dorothea Dorothy Dorset dosage dose dosimeter dossier Dostoevsky dot dote dotting double Doubleday doubleheader doublet doubleton doubloon doubt doubtful douce Doug dough Dougherty doughnut Douglas Douglass dour douse dove dovekie dovetail Dow dowager dowel dowitcher Dowling down downbeat downcast downdraft Downey downfall downgrade downhill Downing downplay downpour downright Downs downside downslope downspout downstairs downstream downtown downtrend downtrodden downturn downward downwind dowry Doyle doze dozen Dr drab Draco draft draftee draftsman draftsmen draftsperson drafty drag dragging dragnet dragon dragonfly dragonhead dragoon drain drainage drake dram drama dramatic dramatist dramaturgy drank drape drapery drastic draw drawback drawbridge drawl drawn dread dreadful dreadnought dream dreamboat dreamlike dreamt dreamy dreary dredge dreg drench dress dressmake dressy drew Drexel Dreyfuss drib dribble dried drier drift drill drink drip dripping drippy Driscoll drive driven driveway drizzle drizzly droll dromedary drone drool droop droopy drop drophead droplet dropout dropping drosophila dross drought drove drown drowse drowsy drub drubbing drudge drudgery drug drugging drugstore druid drum drumhead drumlin drumming Drummond drunk drunkard drunken Drury dry dryad Dryden d's du dual dualism Duane dub Dubhe dubious dubitable Dublin ducat duchess duck duckling duct ductile ductwork dud Dudley due duel duet duff duffel Duffy dug Dugan dugout duke dulcet dull dully dulse Duluth duly Duma dumb dumbbell dummy dump Dumpty dumpy dun Dunbar Duncan dunce dune Dunedin dung dungeon Dunham dunk Dunkirk Dunlap Dunlop Dunn duopolist duopoly dupe duplex duplicable duplicate duplicity DuPont durable Durango duration Durer duress Durham during Durkee Durkin Durrell Durward Dusenberg Dusenbury dusk dusky Dusseldorf dust dustbin dusty Dutch dutchess Dutchman Dutchmen dutiable dutiful Dutton duty dwarf dwarves dwell dwelt Dwight dwindle Dwyer dyad dyadic dye dyer dying Dyke Dylan dynamic dynamism dynamite dynamo dynast dynastic dynasty dyne dysentery dyspeptic dysplasia dysprosium dystrophy e each Eagan eager eagle ear eardrum earl earmark earn earnest earphone earring earsplitting earth earthen earthenware earthmen earthmover earthmoving earthquake earthworm earthy earwig ease easel east eastbound eastern easternmost Eastland Eastman eastward Eastwood easy easygoing eat eaten eater Eaton eave eavesdrop eavesdropping ebb Eben ebony ebullient eccentric Eccles ecclesiastic echelon echinoderm echo echoes eclat eclectic eclipse ecliptic eclogue Ecole ecology econometric Econometrica economic economist economy ecosystem ecstasy ecstatic Ecuador ecumenic ecumenist Ed Eddie eddy edelweiss edematous Eden Edgar edge Edgerton edgewise edging edgy edible edict edifice edify Edinburgh Edison edit Edith edition editor editorial Edmonds Edmondson Edmonton Edmund Edna EDT educable educate Edward Edwardian Edwards Edwin Edwina eel eelgrass EEOC e'er eerie eerily efface effaceable effect effectual effectuate effeminate efferent effete efficacious efficacy efficient Effie effloresce efflorescent effluent effluvia effluvium effort effusive eft egalitarian Egan egg egghead eggplant eggshell ego egocentric egotism egotist egregious egress egret Egypt Egyptian eh Ehrlich eider eidetic eigenfunction eigenstate eigenvalue eigenvector eight eighteen eighteenth eightfold eighth eightieth eighty Eileen Einstein Einsteinian einsteinium Eire Eisenhower Eisner either ejaculate eject ejector eke Ekstrom Ektachrome el elaborate Elaine elan elapse elastic elastomer elate Elba elbow elder eldest Eldon Eleanor Eleazar elect elector electoral electorate Electra electress electret electric electrician electrify electro electrocardiogram electrocardiograph electrode electroencephalogram electroencephalograph electroencephalography electrolysis electrolyte electrolytic electron electronic electrophoresis electrophorus elegant elegiac elegy element elementary Elena elephant elephantine elevate eleven eleventh elfin Elgin Eli elicit elide eligible Elijah eliminate Elinor Eliot Elisabeth Elisha elision elite Elizabeth Elizabethan elk Elkhart ell Ella Ellen Elliott ellipse ellipsis ellipsoid ellipsoidal ellipsometer ellipsometry elliptic Ellis Ellison Ellsworth Ellwood elm Elmer Elmhurst Elmira Elmsford Eloise elongate elope eloquent else Elsevier elsewhere Elsie Elsinore Elton eluate elucidate elude elusive elute elution elves Ely Elysee elysian em emaciate emanate emancipate Emanuel emasculate embalm embank embarcadero embargo embargoes embark embarrass embassy embattle embed embedded embedder embedding embellish ember embezzle emblematic embodiment embody embolden emboss embouchure embower embrace embraceable embrittle embroider embroidery embroil embryo embryonic emcee emendable emerald emerge emergent emeritus Emerson Emery emigrant emigrate Emil Emile Emilio Emily eminent emirate emissary emission emissivity emit emittance emitted emitter emitting emma Emmanuel Emmett emolument Emory emotion emotional empathy emperor emphases emphasis emphatic emphysema emphysematous empire empiric emplace employ employed employee employer employing emporium empower empress empty emulate emulsify emulsion en enact enamel encamp encapsulate encase encephalitis enchain enchant enchantress encipher encircle enclave enclose enclosure encode encomia encomium encompass encore encounter encourage encroach encrust encrypt encryption encumber encumbrance encyclical encyclopedic end endanger endear endgame Endicott endogamous endogamy endogenous endorse endosperm endothelial endothermic endow endpoint endurance endure enemy energetic energy enervate enfant enfeeble Enfield enforce enforceable enforcible enfranchise Eng engage Engel engender engine engineer England Englander Engle Englewood English Englishman Englishmen engrave engross engulf enhance ((Enid enigma enigmatic enjoin enjoinder enjoy enlarge enlargeable enlighten enlist enliven enmesh enmity Enoch enormity enormous Enos enough enquire enquiry enrage enrapture enrich Enrico enroll enrollee ensconce ensemble enshroud ensign enslave ensnare enstatite ensue ensure entail entangle entendre enter enterprise entertain enthalpy enthrall enthrone enthusiasm enthusiast enthusiastic entice entire entirety entitle entity entomb entomology entourage entrain entrance entranceway entrant entrap entrapping entreat entreaty entree entrench entrepreneur entrepreneurial entropy entrust entry entwine enumerable enumerate enunciable enunciate envelop envelope envenom enviable envious environ envisage envision envoy envy enzymatic enzyme enzymology Eocene eohippus eosine EPA epaulet ephemeral ephemerides ephemeris Ephesian Ephesus Ephraim epic epicure Epicurean epicycle epicyclic epidemic epidemiology epidermic epidermis epigenetic epigram epigrammatic epigraph epileptic epilogue Epiphany epiphyseal epiphysis episcopal Episcopalian episcopate episode epistemology epistle epistolatory epitaph epitaxial epitaxy epithelial epithelium epithet epitome epoch epoxy epsilon Epsom Epstein equable equal equanimity equate equatorial equestrian equidistant equilateral equilibrate equilibria equilibrium equine equinoctial equinox equip equipoise equipotent equipped equipping equitable equitation equity equivalent equivocal era eradicable eradicate erasable erase Erasmus Erastus erasure Erato Eratosthenes erbium ERDA ere erect erg ergodic Eric Erich Erickson Ericsson Erie Erlenmeyer Ernest Ernestine Ernie Ernst erode erodible Eros erosible erosion erosive erotic erotica err errancy errand errant errantry errata erratic erratum Errol erroneous error ersatz Erskine erudite erudition erupt eruption Ervin Erwin e's escadrille escalate escapade escape escapee escheat eschew escort escritoire escrow escutcheon Eskimo Esmark esophagi esoteric especial espionage esplanade Esposito espousal espouse esprit esquire essay Essen essence essential Essex EST establish estate esteem Estella ester Estes Esther estimable estimate estop estoppal estrange estuarine estuary et eta etc etch eternal eternity Ethan ethane ethanol Ethel ether ethereal ethic Ethiopia ethnic ethnography ethnology ethology ethos ethyl ethylene etiology etiquette Etruscan etude etymology eucalyptus Eucharist Euclid Euclidean eucre Eugene Eugenia eugenic Euler Eulerian eulogy Eumenides Eunice euphemism euphemist euphorbia euphoria euphoric Euphrates Eurasia eureka Euridyce Euripides Europa Europe European europium Eurydice eutectic Euterpe euthanasia Eva evacuate evade evaluable evaluate evanescent evangel evangelic Evans Evanston Evansville evaporate evasion evasive eve Evelyn even evenhanded evensong event eventful eventide eventual eventuate Eveready Everett Everglades evergreen Everhart everlasting every everybody everyday everyman everyone everything everywhere evict evident evidential evil evildoer evince evocable evocate evoke evolution evolutionary evolve evzone ewe Ewing exacerbate exact exaggerate exalt exaltation exam examination examine example exasperate exasperater excavate exceed excel excelled excellent excelling excelsior except exception exceptional excerpt excess excessive exchange exchangeable exchequer excisable excise excision excitation excitatory excite exciton exclaim exclamation exclamatory exclude exclusion exclusionary exclusive excommunicate excoriate excrescent excresence excrete excretion excretory excruciate exculpatory excursion excursus excusable excuse execrable execrate execute execution executive executor executrix exegesis exegete exemplar exemplary exemplify exempt exemption exercisable exercise exert Exeter exhale exhaust exhaustible exhaustion exhaustive exhibit exhibition exhibitor exhilarate exhort exhortation exhumation exhume exigent exile exist existent existential exit exodus exogamous exogamy exogenous exonerate exorbitant exorcise exorcism exorcist exoskeleton exothermic exotic exotica expand expanse expansible expansion expansive expatiate expect expectant expectation expectorant expectorate expedient expedite expedition expeditious expel expellable expelled expelling expend expenditure expense expensive experience experiential experiment experimentation expert expertise expiable expiate expiration expire explain explanation explanatory expletive explicable explicate explicit explode exploit exploitation exploration exploratory explore explosion explosive exponent exponential exponentiate export exportation expose exposit exposition expositor expository exposure expound express expressible expression expressive expressway expropriate expulsion expunge expurgate exquisite extant extemporaneous extempore extend extendible extensible extension extensive extensor extent extenuate exterior exterminate external extinct extinguish extirpate extol extolled extoller extolling extort extra extracellular extract extractor extraditable extralegal extramarital extraneous extraordinary extrapolate extraterrestrial extravagant extravaganza extrema extremal extreme extremum extricable extricate extrinsic extroversion extrovert extrude extrusion extrusive exuberant exudation exude exult exultant exultation Exxon eye eyeball eyebright eyebrow eyed eyeful eyeglass eyelash eyelet eyelid eyepiece eyesight eyewitness Ezekiel Ezra f FAA Faber Fabian fable fabric fabricate fabulous facade face faceplate facet facetious facial facile facilitate facsimile fact factious facto factor factorial factory factual faculty fad fade fadeout faery Fafnir fag Fahey Fahrenheit fail failsoft failure fain faint fair Fairchild Fairfax Fairfield fairgoer Fairport fairway fairy faith faithful fake falcon falconry fall fallacious fallacy fallen fallible falloff fallout fallow Falmouth false falsehood falsify Falstaff falter fame familial familiar familiarly familism family famine famous fan fanatic fanciful fancy fanfare fanfold fang fangled fanning Fanny fanout fantasia fantasist fantastic fantasy fantod far farad Faraday Farber farce farcical fare farewell farfetched Fargo farina Farkas Farley farm farmhouse Farmington farmland Farnsworth faro Farrell farsighted farther farthest fascicle fasciculate fascinate fascism fascist fashion fast fasten fastidious fat fatal fate fateful father fathom fatigue Fatima fatten fatty fatuous faucet Faulkner fault faulty faun fauna Faust Faustian Faustus fawn fay Fayette Fayetteville faze FBI FCC FDA Fe fealty fear fearful fearsome feasible feast feat feather featherbed featherbedding featherbrain feathertop featherweight feathery feature Feb febrile February fecund fed Fedders federal federate Fedora fee feeble feed feedback feel Feeney feet feign feint Feldman feldspar Felice Felicia felicitous felicity feline Felix fell fellow felon felonious felony felsite felt female feminine feminism feminist femur fence fencepost fend fennel Fenton fenugreek Ferber Ferdinand Ferguson Fermat ferment fermentation Fermi fermion fermium fern Fernando fernery ferocious ferocity Ferrer ferret ferric ferris ferrite ferroelectric ferromagnet ferromagnetic ferromagnetism ferrous ferruginous ferrule ferry fertile fervent fescue fest festival festive fetal fetch fete fetid fetish fetter fettle fetus feud feudal feudatory fever feverish few fiance fiancee fiasco fiat fib fibbing fiberboard Fiberglas Fibonacci fibrin fibrosis fibrous fiche fickle fiction fictitious fictive fiddle fiddlestick fide fidelity fidget fiducial fief fiefdom field Fields fieldstone fieldwork fiend fiendish fierce fiery fiesta fife FIFO fifteen fifteenth fifth fiftieth fifty fig figaro fight figural figurate figure figurine filament filamentary filbert filch file filet filial filibuster filigree Filipino fill filled filler fillet fillip filly film filmdom filmmake filmstrip filmy filter filth filthy filtrate fin final finale finance financial financier finch find fine finesse finessed finessing finger fingernail fingerprint fingertip finial finicky finish finite fink Finland Finley Finn Finnegan Finnish finny fir fire firearm fireboat firebreak firebug firecracker firefly firehouse firelight fireman firemen fireplace firepower fireproof fireside Firestone firewall firewood firework firm first firsthand fiscal Fischbein Fischer fish fisherman fishermen fishery fishmonger fishpond fishy Fisk Fiske fissile fission fissure fist fisticuff fit Fitch Fitchburg fitful fitting Fitzgerald Fitzpatrick Fitzroy five fivefold fix fixate fixture Fizeau fizzle fjord flabbergast flack flag flagellate flageolet flagging Flagler flagpole flagrant Flagstaff flagstone flail flair flak flake flaky flam flamboyant flame flamingo flammable Flanagan Flanders flange flank flannel flap flapping flare flash flashback flashlight flashy flask flat flatbed flathead flatiron flatland flatten flattery flatulent flatus flatworm flaunt flautist flaw flax flaxen flaxseed flea fleabane fleawort fleck fled fledge fledgling flee fleece fleeing fleet Fleming flemish flesh fleshy fletch Fletcher flew flex flexible flexural flexure flick flier flight flimsy flinch fling flint flintlock flinty flip flipflop flippant flipping flirt flirtation flirtatious flit flitting Flo float floc flocculate flock floe flog flogging flood floodgate floodlight floodlit floor floorboard flop flopping floppy flora floral Florence Florentine florican florid Florida Floridian florin florist flotation flotilla flounce flounder flour flourish floury flout flow flowchart flowerpot flowery flown Floyd flu flub flubbing fluctuate flue fluency fluent fluff fluffy fluid fluke flung fluoresce fluorescein fluorescent fluoridate fluoride fluorine fluorite fluorocarbon fluorspar flurry flush fluster flute flutter flux fly flycatcher flyer Flynn flyway FM FMC foal foam foamflower foamy fob fobbing focal foci focus focussed fodder foe fog fogging foggy fogy foible foil foist fold foldout Foley foliage foliate folio folk folklore folksong folksy follicle follicular follow followeth folly Fomalhaut fond fondle fondly font Fontaine Fontainebleau food foodstuff fool foolhardy foolish foolproof foot footage football footbridge Foote footfall foothill footman footmen footnote footpad footpath footp((rint footstep footstool footwear footwork fop foppish for forage foray forbade forbear forbearance Forbes forbid forbidden forbidding forbore forborne force forceful forcible ford Fordham fore foreign forensic forest forestry forever forfeit forfeiture forfend forgave forge forgery forget forgetful forgettable forgetting forgive forgiven forgot forgotten fork forklift forlorn form formal formaldehyde formant format formate formatting formic Formica formidable Formosa formula formulae formulaic formulate Forrest forsake forsaken forsook forswear Forsythe fort forte Fortescue forth forthcome forthright forthwith fortieth fortify fortin fortiori fortitude fortnight Fortran fortress fortunate fortune forty forum forward Foss fossil fossiliferous foster fosterite fought foul foulmouth found foundation foundling foundry fount fountain fountainhead four fourfold Fourier foursome foursquare fourteen fourteenth fourth fovea fowl fox foxglove Foxhall foxhole foxhound foxtail foxy foyer FPC fraction fractionate fractious fracture fragile fragment fragmentary fragmentation fragrant frail frailty frambesia frame framework franc franca France Frances franchise Francis Franciscan Francisco francium franco frangipani frank Frankfort Frankfurt frankfurter franklin frantic Franz Fraser fraternal fraternity Frau fraud fraudulent fraught fray frayed Frazier frazzle freak freakish freckle Fred Freddie Freddy Frederic Frederick Fredericks Fredericksburg Fredericton Fredholm Fredrickson free freeboot freed Freedman freedmen freedom freehand freehold freeing freeman freemen Freeport freer freest freestone freethink Freetown freeway freewheel freeze freight French Frenchman Frenchmen frenetic frenzy freon frequent fresco frescoes fresh freshen freshman freshmen freshwater Fresnel Fresno fret fretting Freud Freudian Frey Freya friable friar fricative Frick friction frictional Friday fried Friedman friend frieze frigate Frigga fright frighten frightful frigid Frigidaire frill frilly fringe frisky fritillary fritter Fritz frivolity frivolous frizzle fro frock frog frolic from front frontage frontal frontier frontiersman frontiersmen frost frostbite frostbitten frosty froth frothy frown frowzy froze frozen Fruehauf frugal fruit fruitful fruition frustrate frustrater frustum fry Frye f's FTC Fuchs Fuchsia fudge fuel fugal fugitive fugue Fuji Fujitsu fulcrum fulfill full fullback Fullerton fully fulminate fulsome Fulton fum fumble fume fumigant fumigate fun function functionary functor fund fundamental funeral funereal fungal fungi fungible fungicide fungoid fungus funk funnel funny fur furbish furious furl furlong furlough Furman furnace furnish furniture furrier furring furrow furry further furthermore furthermost furthest furtive fury furze fuse fuselage fusible fusiform fusillade fusion fuss fussy fusty futile future fuzz fuzzy g gab gabardine gabbing gabble gabbro Gaberones gable Gabon Gabriel Gabrielle gad gadding gadfly gadget gadgetry gadolinium gadwall Gaelic gaff gaffe gag gage gagging gaggle gagwriter gaiety Gail gaillardia gain Gaines Gainesville gainful gait Gaithersburg gal gala galactic Galapagos Galatea Galatia galaxy Galbreath gale Galen galena galenite Galilee gall Gallagher gallant gallantry gallberry gallery galley gallinule gallium gallivant gallon gallonage gallop Galloway gallows gallstone Gallup gallus Galois Galt galvanic galvanism galvanometer Galveston Galway gam Gambia gambit gamble gambol game gamecock gamin gamma gamut gander gang Ganges gangland gangling ganglion gangplank gangster gangway gannet Gannett gantlet gantry Ganymede GAO gap gape gar garage garb garbage garble Garcia garden gardenia Gardner Garfield gargantuan gargle Garibaldi garish garland garlic garner garnet Garrett garrison Garrisonian garrulous Garry garter Garth Garvey Gary gas Gascony gaseous gash gasify gasket gaslight gasoline gasp Gaspee gassing gassy Gaston gastrointestinal gastronome gastronomy gate Gates gateway gather Gatlinburg gator gauche gaucherie gaudy gauge gaugeable Gauguin Gaul gauleiter Gaulle gaunt gauntlet gaur gauss Gaussian gauze gave gavel Gavin gavotte gawk gawky gay Gaylord gaze gazelle gazette GE gear gecko gee geese Gegenschein Geiger Geigy geisha gel gelable gelatin gelatine gelatinous geld gem Gemini gemlike Gemma gender gene genealogy genera general generate generic generosity generous Genesco genesis genetic Geneva Genevieve genial genie genii genius Genoa genotype genre gent genteel gentian gentile gentility gentle gentleman gentlemen gentry genuine genus geocentric geochemical geochemistry geochronology geodesic geodesy geodetic geoduck Geoffrey geographer geography geology geometer geometric geometrician geometry geophysical geophysics geopolitic George Georgetown Georgia Gerald Geraldine geranium Gerard Gerber gerbil Gerhard Gerhardt geriatric germ German germane Germanic germanium Germantown Germany germicidal germicide germinal germinate Gerry Gershwin Gertrude gerund gerundial gerundive gestalt Gestapo gesticulate gesture get getaway getting Getty Gettysburg geyser Ghana ghastly Ghent gherkin ghetto ghost ghostlike ghostly ghoul ghoulish Giacomo giant giantess gibberish gibbet gibbon Gibbons gibbous Gibbs gibby gibe giblet Gibraltar Gibson giddap giddy Gideon Gifford gift gig gigacycle gigahertz gigantic gigavolt gigawatt gigging giggle Gil gila gilbert Gilbertson Gilchrist gild Gilead Giles gill Gillespie Gillette Gilligan Gilmore gilt gimbal Gimbel gimpy gin Gina ginger gingham gingko ginkgo ginmill Ginn ginning Gino Ginsberg Ginsburg ginseng Giovanni giraffe gird girdle girl girlie girlish girth gist Giuliano Giuseppe give giveaway given giveth glacial glaciate glacier glacis glad gladden gladdy glade gladiator gladiolus Gladstone Gladys glamor glamorous glamour glance gland glandular glare Glasgow glass glassine glassware glasswort glassy Glaswegian glaucoma glaucous glaze gleam glean Gleason glee gleeful glen Glenda Glendale Glenn glib Glidden glide glimmer glimpse glint glissade glisten glitch glitter gloat glob global globe globular globule globulin glom glomerular gloom gloomy Gloria Gloriana glorify glorious glory gloss glossary glossed glossolalia glossy glottal glottis Gloucester glove glow glue glued gluey gluing glum glut glutamic glutinous glutting glutton glyceride glycerin glycerinate glycerine glycerol glycol glyph GM GMT gnarl gnash gnat gnaw gneiss gnome gnomon gnomonic gnostic GNP gnu go Goa goad goal goat gob gobble gobbledygook goblet god Goddard goddess godfather Godfrey godhead godkin godlike godmother godparent godsend godson Godwin godwit goer goes Goethe Goff gog goggle Gogh gogo gold Goldberg golden goldeneye goldenrod goldenseal goldfinch goldfish Goldman goldsmith Goldstein Goldstine Goldwater Goleta golf Goliath golly gondola gone gong Gonzales Gonzalez goober good Goode Goodman Goodrich goodwill Goodwin goody Goodyear goof goofy goose gooseberry GOP gopher Gordian Gordon gore Goren gorge gorgeous gorgon Gorham gorilla Gorky gorse Gorton gory gosh goshawk gosling gospel gossamer gossip got Gotham Gothic gotten Gottfried gouge Gould gourd gourmet gout govern governance governess governor gown GPO grab grabbing grace graceful gracious grackle grad gradate grade gradient gradual graduate Grady Graff graft graham grail grain grammar grammarian grammatic granary grand grandchild grandchildren granddaughter grandeur grandfather grandiloquent grandiose grandma grandmother grandnephew grandniece grandpa grandparent grandson grandstand granite granitic granny granola grant grantee grantor granular granulate granule Granville grape grapefruit grapevine graph grapheme graphic graphite grapple grasp grass grassland grassy grata grate grateful grater gratify gratis gratitude gratuitous gratuity grave gravel graven Graves gravestone graveyard gravid gravitate gravy gray graybeard Grayson graywacke graze grease greasy great greatcoat greater grebe Grecian Greece greed greedy Greek green Greenbelt Greenberg Greenblatt Greenbriar Greene greenery Greenfield greengrocer greenhouse greenish Greenland Greensboro greensward greenware Greenwich greenwood Greer greet Greg gregarious Gregg Gregory grenade Grendel Grenoble Gresham Greta Gretchen grew grey greyhound greylag grid griddle gridiron grief grievance grieve grievous griffin Griffith grill grille grilled grillwork grim grimace Grimaldi grime Grimes Grimm grin grind grindstone grinning grip gripe grippe gripping grisly grist gristmill Griswold grit gritty grizzle grizzly groan groat grocer grocery groggy groin grommet groom groove grope grosbeak gross Grosset Grossman Grosvenor grotesque Groton ground groundsel groundskeep groundwork group grout grove grovel Grover grow growl grown grownup growth grub grubbing grubby grudge gruesome gruff grumble Grumman grunt gryphon g's GSA Guam guanidine guano guarantee guaranteeing guaranty guard guardhouse Guardia guardian Guatemala gubernatorial Guenther guerdon guernsey guerrilla guess guesswork guest guffaw Guggenheim Guiana guidance guide guidebook guideline guidepost guiding guignol guild guildhall guile Guilford guillemot guilt guilty guinea guise guitar gules gulf gull Gullah gullet gullible gully gulp gum gumbo gumming gummy gumption gumshoe gun Gunderson gunfight gunfire gunflint gunk gunky gunman gunmen gunnery gunning gunny gunplay gunpowder gunshot gunsling Gunther gurgle Gurkha guru Gus gush gusset gust Gustafson Gustav Gustave Gustavus gusto gusty gut Gutenberg Guthrie gutsy gutting guttural guy Guyana guzzle Gwen Gwyn gym gymnasium gymnast gymnastic gymnosperm gyp gypping gypsite gypsum gypsy gyrate gyrfalcon gyro gyrocompass gyroscope h ha Haag Haas habeas haberdashery Haberman Habib habit habitant habitat habitation habitual habituate hacienda hack hackberry Hackett hackle hackmatack hackney hackneyed hacksaw had Hadamard Haddad haddock Hades Hadley hadn't Hadrian hadron hafnium Hagen Hager haggard haggle Hagstrom Hague Hahn Haifa haiku hail hailstone hailstorm Haines hair haircut hairdo hairpin hairy Haiti Haitian Hal halcyon hale Haley half halfback halfhearted halfway halibut halide Halifax halite hall hallelujah Halley hallmark hallow Halloween hallucinate hallway halma halo halocarbon halogen Halsey Halstead halt halv((ah halve Halverson ham Hamal Hamburg hamburger Hamilton Hamiltonian hamlet Hamlin hammerhead hamming hammock Hammond hamper Hampshire Hampton hamster Han Hancock hand handbag handbook handclasp handcuff Handel handful handgun handhold handicap handicapped handicapper handicapping handicraft handicraftsman handicraftsmen handiwork handkerchief handle handleable handlebar handline handmade handmaiden handout handset handshake handsome handspike handstand handwrite handwritten handy handyman handymen Haney Hanford hang hangable hangar hangman hangmen hangout hangover hank Hankel Hanley Hanlon Hanna Hannah Hannibal Hanoi Hanover Hanoverian Hans Hansel Hansen hansom Hanson Hanukkah hap haphazard happen happenstance happy harangue harass Harbin harbinger Harcourt hard hardbake hardboard hardboiled harden hardhat Hardin Harding hardscrabble hardtack hardtop hardware hardwood hardworking hardy hare harelip harem hark Harlan Harlem Harley harm harmful Harmon harmonic harmonious harmony harness Harold harp harpsichord Harpy Harriet Harriman Harrington Harris Harrisburg Harrison harrow harry harsh harshen hart Hartford Hartley Hartman Harvard harvest harvestman Harvey hash hashish hasn't hasp hassle hast haste hasten Hastings hasty hat hatch hatchet hatchway hate hateful hater Hatfield hath Hathaway hatred Hatteras Hattie Haugen haughty haul haulage haunch haunt Havana have haven haven't Havilland havoc haw Hawaii Hawaiian hawk Hawkins Hawley hawthorn Hawthorne hay Hayden Haydn Hayes hayfield Haynes Hays haystack hayward hazard hazardous haze hazel hazelnut hazy he head headache headboard headdress headland headlight headline headmaster headphone headquarter headroom headset headsman headsmen headstand headstone headwall headwater headway heady heal Healey health healthful healthy Healy heap hear heard hearken hearsay hearse Hearst heart heartbeat heartbreak hearten heartfelt hearth hearty heat heater heath heathen heathenish Heathkit heave heaven heavenward heavy heavyweight Hebe hebephrenic Hebraic Hebrew Hecate hecatomb heck heckle Heckman hectic hector Hecuba he'd hedge hedgehog hedonism hedonist heed heel heft hefty Hegelian hegemony Heidelberg heigh height heighten Heine Heinz heir heiress Heisenberg held Helen Helena Helene helical helicopter heliocentric heliotrope helium helix he'll hell hellbender hellebore Hellenic hellfire hellgrammite hellish hello helm helmet Helmholtz helmsman helmsmen Helmut help helpful helpmate Helsinki Helvetica hem hematite Hemingway hemisphere hemispheric hemlock hemming hemoglobin hemolytic hemorrhage hemorrhoid hemosiderin hemp Hempstead hen henbane hence henceforth henchman henchmen Henderson Hendrick Hendricks Hendrickson henequen Henley Henning henpeck Henri Henrietta henry hepatica hepatitis Hepburn heptane her Hera Heraclitus herald herb Herbert Herculean Hercules herd herdsman here hereabout hereafter hereby hereditary heredity Hereford herein hereinabove hereinafter hereinbelow hereof heresy heretic hereto heretofore hereunder hereunto herewith heritable heritage Herkimer Herman hermeneutic Hermes hermetic Hermite hermitian Hermosa hero Herodotus heroes heroic heroin heroine heroism heron herpes herpetology Herr herring herringbone Herschel herself Hershel Hershey hertz Hertzog hesitant hesitate hesitater Hesperus Hess Hessian Hester heterodyne heterogamous heterogeneity heterogeneous heterosexual heterostructure heterozygous Hetman Hettie Hetty Heublein heuristic Heusen Heuser hew Hewett Hewitt Hewlett hewn hex hexachloride hexadecimal hexafluoride hexagon hexagonal hexameter hexane hey heyday hi Hiatt Hiawatha hibachi Hibbard hibernate Hibernia hick Hickey Hickman hickory Hicks hid hidalgo hidden hide hideaway hideous hideout hierarchal hierarchic hierarchy hieratic hieroglyphic Hieronymus hifalutin Higgins high highball highboy highest highfalutin highhanded highland highlight highroad hightail highway highwayman highwaymen hijack hike hilarious hilarity Hilbert Hildebrand hill hillbilly Hillcrest Hillel hillman hillmen hillside hilltop hilly hilt Hilton hilum him Himalaya himself hind hindmost hindrance hindsight Hindu Hinduism Hines hinge Hinman hint hinterland hip hipping hippo hippodrome hippopotamus hippy hipster Hiram hire hireling Hiroshi Hiroshima Hirsch his hiss histochemic histochemistry histogram histology historian historic historiography history histrionic hit Hitachi hitch Hitchcock hither hitherto Hitler hitting hive ho hoagie Hoagland hoagy hoar hoard hoarfrost hoarse hob Hobart Hobbes hobble Hobbs hobby hobbyhorse hobo Hoboken hoc hock hockey hodge hodgepodge Hodges Hodgkin hoe Hoff Hoffman hog hogan hogging hoi Hokan Holbrook Holcomb hold holden holdover holdup hole holeable holiday Holland Hollandaise holler Hollerith Hollingsworth Hollister hollow Holloway hollowware holly hollyhock Hollywood Holm Holman Holmdel Holmes holmium holocaust Holocene hologram holography Holst Holstein holster holt Holyoke holystone homage home homebound homebuilder homebuilding homecoming homeland homemade homemake homeomorph homeomorphic homeopath homeowner Homeric homesick homestead homeward homework homicidal homicide homily homo homogenate homogeneity homogeneous homologous homologue homology homomorphic homomorphism homonym homosexual homotopy homozygous Honda hondo Honduras hone honest honesty honey honeybee honeycomb honeydew honeymoon honeysuckle Honeywell hong honk Honolulu honorarium honorary honoree Honshu hooch hood hoodlum hoof hoofmark hook hookup hookworm hooligan hoop hoopla hoosegow Hoosier hoot Hoover hooves hop hope hopeful Hopkins Hopkinsian hopping hopple hopscotch Horace Horatio horde horehound horizon horizontal hormone horn hornbeam hornblende Hornblower hornet hornmouth horntail hornwort horny horology horoscope Horowitz horrendous horrible horrid horrify horror horse horseback horsedom horseflesh horsefly horsehair horselike horseman horsemen horseplay horsepower horseshoe horsetail horsewoman horsewomen horticulture Horton Horus hose hosiery hospice hospitable hospital host hostage hostelry hostess hostile hostler hot hotbed hotbox hotel hotelman hothead hothouse hotrod Houdaille Houdini hough Houghton hound hour hourglass house houseboat housebreak housebroken housefly household housekeep housewife housewives housework Houston hove hovel hover how Howard howdy Howe Howell however howl howsoever howsomever hoy hoyden hoydenish Hoyt Hrothgar h's hub Hubbard Hubbell hubbub hubby Huber Hubert huck huckleberry huckster huddle Hudson hue hued huff Huffman hug huge hugging Huggins Hugh Hughes Hugo huh hulk hull hum human humane humanitarian humble Humboldt humerus humid humidify humidistat humiliate humility Hummel humming hummingbird hummock humorous hump humpback Humphrey humpty humus Hun hunch hundred hundredfold hundredth hung Hungarian Hungary hungry hunk hunt Hunter Huntington Huntley Huntsville Hurd hurdle hurl hurley Huron hurrah hurray hurricane hurry Hurst hurt hurtle hurty Hurwitz husband husbandman husbandmen husbandry hush husky hustle Huston hut hutch Hutchins Hutchinson Hutchison Huxley Huxtable huzzah hyacinth Hyades hyaline Hyannis hybrid Hyde hydra hydrangea hydrant hydrate hydraulic hydride hydro hydrocarbon hydrochemistry hydrochloric hydrochloride hydrodynamic hydroelectric hydrofluoric hydrogen hydrogenate hydrology hydrolysis hydrometer hydrophilic hydrophobia hydrophobic hydrosphere hydrostatic hydrothermal hydrous hydroxide hydroxy hydroxyl hydroxylate hyena hygiene hygrometer hygroscopic hying hymen hymn hymnal hyperbola hyperbolic hyperboloid hyperboloidal hypertensive hyphen hyphenate hypnosis hypnotic hypoactive hypocrisy hypocrite hypocritic hypocycloid hypodermic hypophyseal hypotenuse hypothalamic hypothalamus hypotheses hypothesis hypothetic hypothyroid hysterectomy hysteresis hysteria hysteric hysteron i iambic Iberia ibex ibid ibis IBM Ibn Icarus ICC ice iceberg icebox iceland Icelandic ichneumon icicle icing icon iconoclasm iconoclast icosahedra icosahedral icosahedron icy I'd Ida Idaho idea ideal ideate idempotent identical identify identity ideology idiocy idiom idiomatic idiosyncrasy idiosyncratic idiot idiotic idle idol idolatry idyll idyllic IEEE if iffy Ifni igloo igneous ignite ignition ignoble ignominious ignoramus ignorant ignore ii iii Ike ileum iliac Iliad I'll ill illegal illegible illegitimacy illegitimate illicit illimitable Illinois illiteracy illiterate illogic illume illuminate illumine illusion illusionary illusive illusory illustrate illustrious Ilona Ilyushin I'm image imagery imaginary imaginate imagine imbalance imbecile imbibe Imbrium imbroglio imbrue imbue imitable imitate immaculate immanent immaterial immature immeasurable immediacy immediate immemorial immense immerse immersion immigrant immigrate imminent immobile immobility immoderate immodest immodesty immoral immortal immovable immune immunization immunoelectrophoresis immutable imp impact impair impale impalpable impart impartation impartial impassable impasse impassion impassive impatient impeach impeccable impedance impede impediment impel impelled impeller impelling impend impenetrable imperate imperceivable imperceptible imperfect imperial imperil imperious imperishable impermeable impermissible impersonal impersonate impertinent imperturbable impervious impetuous impetus impiety impinge impious impish implacable implant implantation implausible implement implementation implementer implementor implicant implicate implicit implore impolite impolitic imponderable import important importation importunate importune impose imposition impossible impost imposture impotent impound impoverish impracticable impractical imprecate imprecise impregnable impregnate impresario impress impressible impression impressive imprimatur imprint imprison improbable impromptu improper impropriety improve improvident improvisate improvise imprudent impudent impugn impulse impulsive impunity impure imputation impute in inability inaccessible inaccuracy inaccurate inaction inactivate inactive inadequacy inadequate inadmissible inadvertent inadvisable inalienable inalterable inane inanimate inappeasable inapplicable inappreciable inapproachable inappropriate inapt inaptitude inarticulate inasmuc((h inattention inattentive inaudible inaugural inaugurate inauspicious inboard inborn inbred inbreed Inc Inca incalculable incandescent incant incantation incapable incapacitate incapacity incarcerate incarnate incautious incendiary incense incentive inception inceptor incessant incest incestuous inch incident incidental incinerate incipient incise incisive incite inclement inclination incline inclose include inclusion inclusive incoherent incombustible income incommensurable incommensurate incommunicable incommutable incomparable incompatible incompetent incomplete incompletion incomprehensible incomprehension incompressible incomputable inconceivable inconclusive incondensable incongruity incongruous inconsequential inconsiderable inconsiderate inconsistent inconsolable inconspicuous inconstant incontestable incontrollable incontrovertible inconvenient inconvertible incorporable incorporate incorrect incorrigible incorruptible increasable increase incredible incredulity incredulous increment incriminate incubate incubi incubus inculcate inculpable incumbent incur incurred incurrer incurring incursion indebted indecent indecipherable indecision indecisive indecomposable indeed indefatigable indefensible indefinable indefinite indelible indelicate indemnity indent indentation indenture independent indescribable indestructible indeterminable indeterminacy indeterminate index India Indian Indiana Indianapolis indicant indicate indices indict Indies indifferent indigene indigenous indigent indigestible indigestion indignant indignation indignity indigo Indira indirect indiscernible indiscoverable indiscreet indiscretion indiscriminate indispensable indispose indisposition indisputable indissoluble indistinct indistinguishable indium individual individualism individuate indivisible Indochina indoctrinate indolent indomitable Indonesia Indonesian indoor indorse indubitable induce inducible induct inductance inductee inductor indulge indulgent industrial industrialism industrious industry indwell indy ineducable ineffable ineffective ineffectual inefficacy inefficient inelastic inelegant ineligible ineluctable inept inequality inequitable inequity inequivalent ineradicable inert inertance inertia inertial inescapable inestimable inevitable inexact inexcusable inexhaustible inexorable inexpedient inexpensive inexperience inexpert inexpiable inexplainable inexplicable inexplicit inexpressible inextinguishable inextricable infallible infamous infamy infancy infant infantile infantry infantryman infantrymen infarct infatuate infeasible infect infectious infelicitous infelicity infer inference inferential inferior infernal inferno inferred inferring infertile infest infestation infidel infield infighting infiltrate infima infimum infinite infinitesimal infinitive infinitude infinitum infinity infirm infirmary infix inflame inflammable inflammation inflammatory inflate inflater inflect inflexible inflict inflow influence influent influential influenza influx inform informal informant Informatica information informative infra infract infrared infrastructure infrequent infringe infuriate infuse infusible infusion ingather ingenious ingenuity ingenuous Ingersoll ingest ingestible ingestion inglorious ingot Ingram ingrate ingratiate ingratitude ingredient ingrown inhabit inhabitant inhabitation inhalation inhale inharmonious inhere inherent inherit inheritance inheritor inhibit inhibition inhibitor inhibitory inholding inhomogeneity inhomogeneous inhospitable inhuman inhumane inimical inimitable iniquitous iniquity initial initiate inject injudicious Injun injunct injure injurious injury injustice ink inkling inlaid inland inlay inlet Inman inmate inn innards innate inner innermost inning innocent innovate innuendo innumerable inoculate inoperable inoperative inopportune inordinate inorganic input inquest inquire inquiry inquisition inquisitive inquisitor inroad insane insatiable inscribe inscription inscrutable insect insecticide insecure inseminate insensible insensitive inseparable insert inset inshore inside insidious insight insightful insignia insignificant insincere insinuate insipid insist insistent insofar insolent insoluble insolvable insolvent insomnia insomniac insouciant inspect inspector inspiration inspire instable install installation instalment instance instant instantaneous instead instep instigate instill instillation instinct instinctual institute institution instruct instructor instrument instrumentation insubordinate insubstantial insufferable insufficient insular insulate insulin insult insuperable insupportable insuppressible insurance insure insurgent insurmountable insurrect intact intake intangible integer integrable integral integrand integrate integrity integument intellect intellectual intelligent intelligentsia intelligible intemperance intemperate intend intendant intense intensify intensive intent intention inter intercalate intercept interception interceptor intercom interdict interest interfere interference interferometer interferometric interferometry interim interior interject interlude intermediary intermit intermittent intern internal internescine Interpol interpolate interpolatory interpret interpretation interpretive interregnum interrogate interrogatory interrupt interruptible interruption intersect intersperse interstice interstitial interval intervene intervenor intervention interviewee intestate intestine intimacy intimal intimate intimater intimidate into intolerable intolerant intonate intone intoxicant intoxicate intracity intractable intradepartment intramural intramuscular intranasal intransigent intransitive intraoffice intrastate intravenous intrepid intricacy intricate intrigue intrinsic introduce introduction introductory introit introject introspect introversion introvert intrude intrusion intrusive intuitable intuition intuitive inundate inure invade invalid invalidate invaluable invariable invariant invasion invasive invective inveigh inveigle invent invention inventive inventor inventory Inverness inverse inversion invert invertebrate invertible invest investigate investigatory investor inveterate inviable invidious invigorate invincible inviolable inviolate invisible invitation invite invitee invocate invoice invoke involuntary involute involution involutorial involve invulnerable inward Io iodate iodide iodinate iodine ion ionic ionosphere ionospheric iota Iowa ipecac ipsilateral ipso IQ IR Ira Iran Iraq irate ire Ireland Irene iridium iris Irish Irishman Irishmen irk irksome Irma iron ironic ironside ironstone ironwood irony Iroquois irradiate irrational Irrawaddy irreclaimable irreconcilable irrecoverable irredeemable irredentism irredentist irreducible irrefutable irregular irrelevancy irrelevant irremediable irremovable irreparable irreplaceable irrepressible irreproachable irreproducible irresistible irresolute irresolution irresolvable irrespective irresponsible irretrievable irreverent irreversible irrevocable irrigate irritable irritant irritate irruption IRS Irvin Irvine Irving Irwin i's is Isaac Isaacson Isabel Isabella Isaiah isentropic Isfahan Ising isinglass Isis Islam Islamabad Islamic island isle isn't isochronal isochronous isocline isolate Isolde isomer isomorph isomorphic isopleth isotherm isothermal isotope isotopic isotropic isotropy Israel Israeli Israelite issuance issuant issue Istanbul it Italian italic Italy itch it'd item iterate Ithaca itinerant itinerary it'll Ito itself IT&T ITT iv Ivan Ivanhoe I've Iverson ivory ivy ix Izvestia j jab jabbing Jablonsky jack jackanapes jackass jackboot jackdaw jacket Jackie jackknife Jackman jackpot Jackson Jacksonian Jacksonville Jacky JACM Jacob Jacobean Jacobi Jacobian Jacobite Jacobs Jacobsen Jacobson Jacobus Jacqueline Jacques jade Jaeger jag jagging jaguar jail Jakarta jake jalopy jam Jamaica jamboree James Jamestown jamming Jan Jane Janeiro Janet jangle Janice janissary janitor janitorial Janos Jansenist January Janus Japan Japanese jar jargon jarring Jarvin Jason jasper jaundice jaunty Java javelin jaw jawbone jay jazz jazzy jealous jealousy jean Jeannie Jed jeep Jeff Jefferson Jeffersonian Jeffrey Jehovah jejune jejunum jelly jellyfish Jenkins Jennie Jennifer Jennings jenny Jensen jeopard jeopardy Jeremiah Jeremy Jeres Jericho jerk jerky Jeroboam Jerome jerry jersey Jerusalem jess Jesse Jessica Jessie jest Jesuit Jesus jet jetliner jetting jettison Jew jewel Jewell jewelry Jewett Jewish jibe jiffy jig jigging jiggle jigsaw Jill jilt Jim Jimenez Jimmie jimmy jingle jinx jitter jitterbug jittery jive Jo Joan Joanna Joanne Joaquin job jobbing jobholder jock jockey jockstrap jocose jocular jocund Joe Joel joey jog jogging joggle Johann Johannes Johannesburg Johansen Johanson John Johnny Johns Johnsen Johnson Johnston Johnstown join joint joke Joliet Jolla jolly jolt Jon Jonas Jonathan Jones jonquil Jordan Jorge Jorgensen Jorgenson Jose Josef Joseph Josephine Josephson Josephus Joshua Josiah joss jostle jot jotting joule jounce journal journalese journey journeyman journeymen joust Jovanovich Jove jovial Jovian jowl jowly joy Joyce joyful joyous joyride joystick Jr j's Juan Juanita jubilant jubilate Judaism Judas Judd Jude judge judicable judicatory judicature judicial judiciary judicious Judith judo Judson Judy jug jugate jugging juggle juice juicy juju jujube juke Jukes julep Jules Julia Julie Juliet Julio Julius July jumble jumbo jump jumpy junco junction junctor juncture June Juneau jungle junior juniper junk junkerdom junketeer junky Juno junta Jupiter Jura jure juridic jurisdiction jurisprudent jurisprudential juror jury just justice justiciable justify Justine Justinian jut jute Jutish jutting juvenile juxtapose juxtaposition k Kabuki Kabul Kaddish Kafka Kafkaesque Kahn kaiser Kajar Kalamazoo kale kaleidescope kaleidoscope kalmia Kalmuk Kamchatka kamikaze Kampala Kane kangaroo Kankakee Kansas Kant kaolin kaolinite Kaplan kapok kappa Karachi Karamazov karate Karen Karl Karol Karp karyatid Kaskaskia Kate Katharine Katherine Kathleen Kathy Katie Katmandu Katowice Katz Kauffman Kaufman kava Kay kayo kazoo Keaton Keats keddah keel keelson keen Keenan keep keeshond keg Keith Keller Kelley Kellogg kelly kelp Kelsey Kelvin Kemp ken Kendal((l Kennan Kennecott Kennedy kennel Kenneth Kenney kenning keno Kensington Kent Kenton Kentucky Kenya Kenyon Kepler kept kerchief Kermit kern kernel kerosene Kerr kerry kerygma Kessler kestrel ketch ketchup ketone ketosis Kettering kettle Kevin key keyboard keyed Keyes keyhole Keynes Keynesian keynote keypunch keys keystone keyword khaki khan Khartoum Khmer Khrushchev kibbutzim kibitz kick kickback kickoff kid Kidde kiddie kidding kidnap kidnapping kidney Kieffer Kiev Kiewit Kigali Kikuyu Kilgore kill killdeer killjoy kilobit kilobuck kilobyte kilogauss kilohertz kilohm kilojoule kiloton kilovolt kilowatt kiloword Kim Kimball Kimberly kimono kin kind kindergarten kindle kindred kinematic kinesic kinesthesis kinetic king kingbird kingdom kingfisher kinglet kingpin Kingsbury Kingsley Kingston kink kinky Kinney Kinshasha kiosk Kiowa Kipling Kirby Kirchner Kirchoff kirk Kirkland Kirkpatrick Kirov kiss kissing kit Kitakyushu kitchen kitchenette kite kitten kittenish kittle kitty kiva kivu Kiwanis Klan Klaus klaxon kleenex Klein Kline Klux klystron knack Knapp knapsack Knauer knead knee kneecap kneel knelt knew knick Knickerbocker knife knifelike knight Knightsbridge knit knitting knives knob knobby knock knockdown knockout knoll knot Knott knotting knotty know knoweth knowhow knowledge knowledgeable Knowles Knowlton known Knox Knoxville knuckle knuckleball Knudsen Knudson knurl Knutsen Knutson koala Koch Kochab Kodachrome kodak Kodiak Koenig Koenigsberg kohlrabi koinonia kola kolkhoz kombu Kong Koppers Koran Korea kosher Kowalewski Kowalski kraft Krakatoa Krakow Kramer Krause kraut Kremlin Kresge Krieger Krishna Kristin Kronecker Krueger Kruger Kruse krypton k's Ku kudo kudzu Kuhn kulak kumquat Kurd Kurt Kuwait kwashiorkor Kyle Kyoto l la lab Laban label labile laboratory laborious labour Labrador labradorite labyrinth lac lace lacerate Lacerta lacewing Lachesis lack lackadaisic lackey lacquer lacrosse lactate lacuna lacunae lacustrine lacy lad laden ladle lady ladyfern ladylike Lafayette lag lager lagging lagoon Lagos Lagrange Lagrangian Laguerre Lahore laid Laidlaw lain lair laissez laity lake Lakehurst lakeside lam Lamar lamb lambda lambert lame lamellar lament lamentation laminate lamming lamp lampblack lamplight lampoon lamprey Lana Lancashire Lancaster lance land landau landfill landhold Landis landlord landmark landowner landscape landslide lane Lang Lange Langley Langmuir language languid languish Lanka lanky Lansing lantern lanthanide lanthanum Lao Laocoon Laos Laotian lap lapel lapelled lapidary Laplace lappet lapping lapse Laramie larceny larch lard Laredo Lares large largemouth largesse lariat lark Larkin larkspur Larry Lars Larsen Larson larva larvae larval laryngeal larynges larynx lascar lascivious lase lash lass lasso last latch late latent later latera lateral Lateran laterite latest latex lath lathe Lathrop Latin Latinate latitude latitudinal latitudinary Latrobe latter lattice latus laud laudanum laudatory Lauderdale Laue laugh laughingstock Laughlin laughter launch launder laundry laura laureate laurel Lauren Laurence Laurent Laurentian Laurie Lausanne lava lavabo lavatory lavender lavish Lavoisier law lawbreaker lawbreaking lawful lawgiver lawgiving lawmake lawman lawmen lawn Lawrence lawrencium Lawson lawsuit lawyer lax laxative lay layette layman laymen layoff layout Layton layup Lazarus laze lazy lazybones lea leach leachate lead leaden leadeth leadsman leadsmen leaf leaflet leafy league leak leakage leaky lean Leander leap leapfrog leapt Lear learn lease leasehold leash least leather leatherback leatherneck leatherwork leathery leave leaven Leavenworth Lebanese Lebanon lebensraum Lebesgue lecher lechery lectionary lecture led ledge lee leech Leeds leek leer leery leeward leeway left leftmost leftover leftward lefty leg legacy legal legate legatee legato legend legendary Legendre legerdemain legging leggy leghorn legible legion legislate legislature legitimacy legitimate legume leguminous Lehigh Lehman Leigh Leighton Leila leisure leitmotif leitmotiv Leland lemma lemming lemon lemonade Lemuel Len Lena lend length lengthen lengthwise lengthy lenient Lenin Leningrad Leninism Leninist Lennox Lenny lens lent Lenten lenticular lentil Leo Leon Leona Leonard Leonardo Leone Leonid leonine leopard Leopold leper lepidolite leprosy Leroy Lesbian lesion Leslie Lesotho less lessee lessen lesson lessor lest Lester let lethal lethargy Lethe Letitia letterhead letterman lettermen letting lettuce leukemia levee level lever leverage Levi Levin Levine Levis levitate Leviticus Levitt levity levy lew lewd lewis lexical lexicography lexicon Lexington Leyden liable liaison liar libation libel libelous liberal liberate Liberia libertarian libertine liberty libidinous libido librarian library librate librettist libretto Libreville Libya lice licensable licensee licensor licentious lichen lick licorice lid lidding lie Liechtenstein lied lien lieu lieutenant life lifeblood lifeboat lifeguard lifelike lifelong lifespan lifestyle lifetime LIFO lift ligament ligand ligature Ligget Liggett light lighten lightface lighthearted lighthouse lightning lightproof lightweight lignite lignum like liken likewise Lila lilac Lilian Lillian Lilliputian Lilly lilt lily Lima limb limbic limbo lime limelight Limerick limestone limit limitate limousine limp limpet limpid limpkin Lin Lincoln Lind Linda Lindberg Lindbergh linden Lindholm Lindquist Lindsay Lindsey Lindstrom line lineage lineal linear linebacker lineman linemen linen lineup linger lingerie lingo lingua lingual linguist liniment link linkage linoleum Linotype linseed lint Linus lion Lionel lioness lip lipid Lippincott Lipschitz Lipscomb lipstick Lipton liquefaction liquefy liqueur liquid liquidate liquor Lisa Lisbon Lise lisle lisp Lissajous list listen lit litany literacy literal literary literate literature lithe lithic lithium lithograph lithography lithology lithosphere lithospheric litigant litigate litigious litmus litterbug little littleneck Littleton Litton littoral liturgic liturgy live Livermore Liverpool liverwort livery livestock liveth livid Livingston livre Liz lizard Lizzie Lloyd lo load loaf loam loamy loan loath loathe loathsome loaves lob lobar lobby lobe loblolly lobo lobscouse lobster lobular lobule local locale locate loci lock Locke Lockhart Lockheed Lockian locknut lockout locksmith lockup Lockwood locomote locomotion locomotive locomotor locomotory locoweed locus locust locutor lodestone lodge lodgepole Lodowick Loeb l'oeil loess loft lofty log Logan logarithm logarithmic loge loggerhead logging logic logistic logjam loin loincloth Loire Lois loiter Loki Lola loll lollipop lolly Lomb Lombard Lombardy Lome London lone lonesome long longevity Longfellow longhand longhorn longish longitude longitudinal longleg longstanding longtime longue look lookout lookup loom Loomis loon loop loophole loose looseleaf loosen loosestrife loot lop lope Lopez lopping lopseed lopsided loquacious loquacity lord lore Lorelei Loren Lorinda Lorraine Los losable lose loss lossy lost lot lotion Lotte lottery Lottie lotus Lou loud loudspeaker loudspeaking Louis Louisa Louise Louisiana Louisville lounge Lounsbury Lourdes louse lousewort lousy louver Louvre love lovebird Lovelace Loveland lovelorn low lowboy lowdown Lowe Lowell lower lowland Lowry loy loyal loyalty lozenge l's LSI LTV Lubbock Lubell lubricant lubricate lubricious lubricity Lucas Lucerne Lucia Lucian lucid Lucifer Lucille Lucius luck lucky lucrative lucre Lucretia Lucretius lucy ludicrous Ludlow Ludwig Lufthansa Luftwaffe lug luge luger luggage lugging Luis luke lukemia lukewarm lull lullaby lulu lumbar lumber lumberman lumbermen lumen luminance luminary luminescent luminosity luminous lummox lump lumpish Lumpur lumpy lunacy lunar lunary lunate lunatic lunch luncheon lunchroom lunchtime Lund Lundberg Lundquist lung lunge lupine Lura lurch lure lurid lurk Lusaka luscious lush lust lustful lustrous lusty lutanist lute lutetium Luther Lutheran Lutz lux luxe Luxembourg luxuriant luxuriate luxurious luxury Luzon lycopodium Lydia lye lying Lykes Lyle Lyman lymph lymphocyte lymphoma lynch Lynchburg Lynn lynx Lyon Lyons Lyra lyric lyricism lysergic m ma Mabel Mac macabre macaque MacArthur Macassar Macbeth MacDonald mace Macedon Macedonia MacGregor Mach Machiavelli machination machine machinelike machinery machismo macho macintosh mack MacKenzie mackerel Mackey Mackinac Mackinaw mackintosh MacMillan Macon macro macromolecule macrophage macroscopic mad Madagascar madam Madame madcap madden madding Maddox made Madeira Madeleine Madeline madhouse Madison madman madmen Madonna Madras Madrid madrigal Madsen madstone Mae Maelstrom maestro magazine Magdalene magenta Maggie maggot maggoty magi magic magician magisterial magistrate magna magnanimity magnanimous magnate magnesia magnesite magnesium magnet magnetic magnetite magneto magnetron magnificent magnify magnitude magnolia magnum Magnuson Magog magpie Magruder Mahayana Mahayanist mahogany Mahoney maid maiden maidenhair maidservant Maier mail mailbox mailman mailmen maim main Maine mainland mainline mainstream maintain maintenance maitre majestic majesty major make makeshift makeup Malabar maladapt maladaptive maladjust maladroit malady Malagasy malaise malaprop malaria malarial Malawi Malay Malaysia Malcolm malconduct malcontent Malden maldistribute Maldive male maledict malevolent malfeasant malformation malformed malfunction Mali malice malicious malign malignant mall mallard malleable mallet Mallory mallow malnourished malnutrition malocclusion Malone Maloney malposed malpractice Malraux malt Malta Maltese Malton maltreat mambo mamma mammal mammalian mammoth man mana manage manageable managerial Managua Manama manatee Manchester mandamus mandarin mandate mandatory mandrake mandrel mandrill mane maneuver Manfred manganese mange mangel mangle Manhattan manhole manhood mania maniac maniacal manic manifest manifestation manifold manikin Manila manipulable manipulate Manitoba mankind Manley Mann manna mannequin mannerism manning manometer manometric manor manpower Mans manse manservant Mansfield mansion manslaughter mantel mantic mantis mantissa mantle mantlepiece mantrap manual Manuel manufacture manumission manumi((t manumitted manure manuscript Manville many manzanita Mao Maori map maple mapping mar marathon maraud marble Marc Marceau Marcel Marcello march Marcia Marco Marcus Marcy Mardi mare Margaret margarine Margery margin marginal marginalia Margo Marguerite maria Marie Marietta marigold marijuana Marilyn marimba Marin marina marinade marinate marine Marino Mario Marion marionette marital maritime Marjorie Marjory mark market marketeer marketplace marketwise Markham Markov Markovian Marks marksman marksmen Marlboro Marlborough Marlene marlin Marlowe marmalade marmot maroon marque marquee marquess Marquette marquis marriage marriageable married Marrietta marring Marriott marrow marrowbone marry Mars Marseilles marsh Marsha marshal Marshall marshland marshmallow mart marten Martha martial Martian martin Martinez martingale martini Martinique Martinson Marty martyr martyrdom marvel marvelous Marvin Marx Mary Maryland mascara masculine maser Maseru mash mask mason Masonic Masonite masonry masque masquerade mass Massachusetts massacre massage masseur Massey massif massive mast masterful mastermind masterpiece mastery mastic mastiff mastodon mat match matchbook matchmake mate Mateo mater material materiel maternal maternity math mathematic mathematician Mathematik Mathews Mathewson Mathias Mathieu Matilda matinal matinee matins Matisse matriarch matriarchal matrices matriculate matrimonial matrimony matrix matroid matron Matson matte Matthew Matthews matting mattock mattress Mattson maturate mature maudlin maul Maureen Maurice Maurine Mauritania Mauritius mausoleum mauve maverick Mavis maw mawkish Mawr Max maxim maxima maximal Maximilian maximum Maxine maxwell Maxwellian may Maya mayapple maybe Mayer Mayfair Mayflower mayhem Maynard Mayo mayonnaise mayor mayoral mayst Mazda maze mazurka MBA Mbabane McAdams McAllister McBride McCabe McCall McCann McCarthy McCarty McCauley McClain McClellan McClure McCluskey McConnel McConnell McCormick McCoy McCracken McCullough McDaniel McDermott McDonald McDonnell McDougall McDowell McElroy McFadden McFarland McGee McGill McGinnis McGovern McGowan McGrath McGraw McGregor McGuire McHugh McIntosh McIntyre McKay McKee McKenna McKenzie McKeon McKesson McKinley McKinney McKnight McLaughlin McLean McLeod McMahon McMillan McMullen McNally McNaughton McNeil McPherson me mead meadow meadowland meadowsweet meager meal mealtime mealy mean meander meaningful meant meantime meanwhile measle measure meat meaty Mecca mechanic mechanism mechanist mecum medal medallion meddle Medea media medial median mediate medic medicate Medici medicinal medicine medico mediocre mediocrity meditate Mediterranean medium medley Medusa meek meet meetinghouse Meg megabit megabyte megahertz megalomania megalomaniac megaton megavolt megawatt megaword megohm Meier Meistersinger Mekong Mel melamine melancholy Melanesia melange Melanie melanin melanoma Melbourne Melcher meld melee Melinda meliorate Melissa Mellon mellow melodic melodious melodrama melodramatic melody melon Melpomene melt Melville Melvin member membrane memento memo memoir memorabilia memorable memoranda memorandum memorial memory Memphis men menace menagerie menarche mend mendacious mendacity mendelevium Mendelssohn Menelaus menfolk menhaden menial Menlo Mennonite menstruate mensurable mensuration mental mention mentor menu Menzies Mephistopheles mercantile Mercator Mercedes mercenary mercer merchandise merchant merciful mercilessly Merck mercurial mercuric mercury mercy mere Meredith meretricious merganser merge meridian meridional meringue merit meritorious Merle merlin mermaid Merriam Merrill Merrimack merriment Merritt merry merrymake Mervin mesa mescal mescaline mesenteric mesh mesmeric meson Mesozoic mesquite mess message messenger Messiah messieurs Messrs messy met metabole metabolic metabolism metabolite metal metallic metalliferous metallography metalloid metallurgic metallurgy metalwork metamorphic metamorphism metamorphose metamorphosis metaphor metaphoric Metcalf mete meteor meteoric meteorite meteoritic meteorology meter methacrylate methane method methodic Methodism Methodist methodology Methuen Methuselah methyl methylene meticulous metier metric metro metronome metropolis metropolitan mettle mettlesome Metzler mew Mexican Mexico Meyer Meyers mezzo mi Miami miasma miasmal mica mice Michael Michaelangelo Michelangelo Michelin Michelson michigan Mickelson Mickey Micky micro microbial microcosm micrography microjoule micron Micronesia microscopy mid Midas midband midday middle Middlebury middleman middlemen Middlesex Middleton Middletown middleweight midge midget midland midmorn midnight midpoint midrange midscale midsection midshipman midshipmen midspan midst midstream midway midweek Midwest Midwestern midwife midwives mien miff mig might mightn't mighty mignon migrant migrate migratory Miguel mike mila Milan milch mild mildew Mildred mile mileage Miles milestone milieu militant militarism militarist military militate militia militiamen milk milkweed milky mill Millard millenarian millenia millennia millennium miller millet milliammeter milliampere Millie millihenry millijoule Millikan millinery million millionaire millionth millipede millisecond millivolt millivoltmeter milliwatt Mills millstone milord milt Milton Miltonic Milwaukee mimeograph mimesis mimetic Mimi mimic mimicked mimicking minaret mince mincemeat mind Mindanao mindful mine minefield mineral mineralogy Minerva minesweeper mingle mini miniature minicomputer minim minima minimal minimax minimum minion ministerial ministry mink Minneapolis Minnesota Minnie minnow Minoan minor Minos minot Minsky minstrel minstrelsy mint minuend minuet minus minuscule minute minuteman minutemen minutiae Miocene Mira miracle miraculous mirage Miranda mire Mirfak Miriam mirror mirth misanthrope misanthropic miscegenation miscellaneous miscellany mischievous miscreant miser misery misnomer misogynist misogyny mispronunciation miss misshapen missile mission missionary Mississippi Mississippian missive Missoula Missouri Missy mist mistletoe mistress misty MIT Mitchell mite miterwort mitigate mitral mitre mitt mitten mix mixture mixup Mizar mnemonic moan moat mob mobbing mobcap Mobil mobile mobility mobster moccasin mock mockernut mockery mockingbird mockup modal mode model modem moderate modern modest Modesto modesty modicum modify modish modular modulate module moduli modulo modulus Moe Moen Mogadiscio Mohammedan Mohawk Mohr moiety Moines moire Moiseyev moist moisten moisture molal molar molasses mold moldboard mole molecular molecule molehill molest Moliere Moline Moll Mollie mollify mollusk Molly mollycoddle Moloch molt molten Moluccas molybdate molybdenite molybdenum moment momenta momentary momentous momentum mommy Mona Monaco monad monadic monarch monarchic monarchy monastery monastic monaural Monday monel monetarism monetary money moneymake moneywort Mongolia mongoose Monica monies monitor monitory monk monkey monkeyflower monkish Monmouth Monoceros monochromatic monochromator monocotyledon monocular monogamous monogamy monolith monologist monologue monomer monomeric monomial Monongahela monopoly monotonous monoxide Monroe Monrovia Monsanto monsieur monsoon monster monstrosity monstrous Mont montage Montague Montana Montclair monte Montenegrin Monterey Monteverdi Montevideo Montgomery month Monticello Montmartre Montpelier Montrachet Montreal Monty monument moo mood moody moon Mooney moonlight moonlike moonlit moor Moore Moorish moose moot mop mopping moraine moral morale Moran morass moratorium Moravia morbid more morel Moreland moreover Moresby Morgan morgen morgue Moriarty moribund Morley Mormon morn Moroccan Morocco moron morose morpheme morphemic morphine morphology morphophonemic Morrill morris Morrison Morrissey Morristown morrow Morse morsel mort mortal mortar mortem mortgage mortgagee mortgagor mortician mortify mortise Morton mosaic Moscow Moser Moses Moslem mosque mosquito moss mossy most mot motel motet moth mother motherhood motherland motif motion motivate motive motley motor motorcycle Motorola mottle motto mould Moulton mound mount mountain mountaineer mountainous mountainside mourn mournful mouse moustache mousy mouth mouthful mouthpiece Mouton move movie mow Moyer Mozart MPH Mr Mrs Ms m's mu much mucilage muck mucosa mucus mud Mudd mudding muddle muddlehead muddy mudguard mudsling Mueller muezzin muff muffin muffle mug mugging muggy mugho Muir Mukden mulatto mulberry mulch mulct mule mulish mull mullah mullein Mullen mulligan mulligatawny mullion multi multinomial multiple multiplex multiplexor multipliable multiplicand multiplication multiplicative multiplicity multiply multitude multitudinous mum mumble Mumford mummy munch Muncie mundane mung Munich municipal munificent munition Munson muon Muong mural murder murderous muriatic Muriel murk murky murmur Murphy Murray murre Muscat muscle Muscovite Muscovy muscular musculature muse museum mush mushroom mushy music musicale musician musicology musk Muskegon muskellunge musket muskmelon muskox muskoxen muskrat muslim muslin mussel must mustache mustachio mustang mustard mustn't musty mutandis mutant mutate mutatis mute mutilate mutineer mutiny mutt mutter mutton mutual mutuel Muzak Muzo muzzle my Mycenae Mycenaean mycobacteria mycology myel myeline myeloid Myers mylar mynah Mynheer myocardial myocardium myofibril myopia myopic myosin Myra myriad Myron myrrh myrtle myself mysterious mystery mystic mystify mystique myth mythic mythology n NAACP nab nabbing Nabisco Nadine nadir nag Nagasaki nagging Nagoya Nagy naiad nail Nair Nairobi naive naivete naked name nameable nameplate namesake Nan Nancy Nanette Nanking nanosecond Nantucket Naomi nap napkin Naples Napoleon Napoleonic napping Narbonne narcissist narcissus narcosis narcotic Narragansett narrate narrow nary NASA nasal nascent Nash Nashua Nashville Nassau nasturtium nasty Nat natal Natalie Natchez Nathan Nathaniel nation nationhood nationwide native NATO natty natural nature naturopath naughty nausea nauseate nauseum nautical nautilus Navajo naval nave navel navigable navigate navy nay Nazarene Nazareth Nazi Nazism NBC NBS NC NCAA NCR ND Ndjamena ne Neal Neanderthal Neapolitan near nearby nearest nearsighted neat neater(( neath Nebraska nebula nebulae nebular nebulous necessary necessitate necessity neck necklace neckline necktie necromancer necromancy necromantic necropsy necrosis necrotic nectar nectareous nectary Ned nee need needful needham needle needlepoint needn't needy Neff negate neglect negligee negligent negligible negotiable negotiate Negro Negroes Negroid Nehru Neil neither Nell Nellie Nelsen Nelson nemesis neoclassic neodymium neolithic neologism neon neonatal neonate neophyte neoprene Nepal nepenthe nephew Neptune neptunium nereid Nero nerve nervous Ness nest nestle Nestor net nether Netherlands netherworld netting nettle nettlesome network Neumann neural neuralgia neurasthenic neuritis neuroanatomic neuroanatomy neuroanotomy neurology neuromuscular neuron neuronal neuropathology neurophysiology neuropsychiatric neuroses neurosis neurotic neuter neutral neutrino neutron Neva Nevada neve nevertheless Nevins new Newark Newbold newborn Newcastle newcomer newel Newell newfound Newfoundland newlywed Newman Newport newsboy newscast newsletter newsman newsmen newspaper newspaperman newspapermen newsreel newsstand Newsweek newt newton Newtonian next Nguyen NH Niagara Niamey nib nibble Nibelung nibs Nicaragua nice nicety niche Nicholas Nicholls Nichols Nicholson nichrome nick nickel nickname Nicodemus Nicosia nicotine niece Nielsen Nielson Nietzsche Niger Nigeria niggardly nigger niggle nigh night nightcap nightclub nightdress nightfall nightgown nighthawk nightingale nightmare nightmarish nightshirt nighttime NIH nihilism nihilist Nikko Nikolai nil Nile nilpotent nimble nimbus NIMH Nina nine ninebark ninefold nineteen nineteenth ninetieth ninety Nineveh ninth Niobe niobium nip nipping nipple Nippon nirvana nit nitpick nitrate nitric nitride nitrite nitrogen nitrogenous nitroglycerine nitrous nitty Nixon NJ NM no NOAA Noah nob Nobel nobelium noble nobleman noblemen noblesse nobody nobody'd nocturnal nocturne nod nodal nodding node nodular nodule Noel noise noisemake noisy Nolan Noll nolo nomenclature nominal nominate nominee non nonce nonchalant nondescript none nonetheless nonogenarian nonsensic noodle nook noon noontime noose nor Nordhoff Nordstrom Noreen Norfolk norm Norma normal normalcy Norman Normandy normative Norris north Northampton northbound northeast northeastern northerly northern northernmost northland Northrop Northrup Northumberland northward northwest northwestern Norton Norwalk Norway Norwegian Norwich nose nosebag nosebleed nostalgia nostalgic Nostradamus Nostrand nostril not notarize notary notate notch note notebook noteworthy nothing notice noticeable notify notion notoriety notorious Nottingham notwithstanding Nouakchott noun nourish nouveau Nov nova Novak novel novelty November novice novitiate novo Novosibirsk now nowaday nowhere nowise noxious nozzle NRC n's NSF NTIS nu nuance Nubia nubile nucleant nuclear nucleate nuclei nucleic nucleoli nucleolus nucleotide nucleus nuclide nude nudge nugatory nugget nuisance null nullify numb numerable numeral numerate numeric Numerische numerology numerous numinous numismatic numismatist nun nuptial nurse nursery nurture nut nutate nutcrack nuthatch nutmeg nutria nutrient nutrition nutritious nutritive nutshell nutting nuzzle NY NYC nylon nymph nymphomania nymphomaniac Nyquist NYU o oaf oak oaken Oakland Oakley oakwood oar oases oasis oat oath oatmeal obduracy obdurate obedient obeisant obelisk Oberlin obese obey obfuscate obfuscatory obituary object objectify objectivity objector objet obligate obligatory oblige oblique obliterate oblivion oblivious oblong obnoxious oboe oboist O'Brien obscene obscure obsequious obsequy observant observation observatory observe obsess obsession obsessive obsidian obsolescent obsolete obstacle obstinacy obstinate obstruct obtain obtrude obtrusive obverse obviate obvious ocarina occasion occident occidental occipital occlude occlusion occlusive occult occultate occupant occupation occupy occur occurred occurrent occurring ocean Oceania oceanic oceanography oceanside ocelot o'clock O'Connell O'Connor Oct octagon octagonal octahedra octahedral octahedron octal octane octave Octavia octennial octet octile octillion October octogenarian octopus octoroon ocular odd ode O'Dell Odessa Odin odious odium odometer O'Donnell odorous O'Dwyer Odysseus Odyssey Oedipal Oedipus o'er oersted of off offal offbeat Offenbach offend offensive offer offertory offhand office officeholder officemate official officialdom officiate officio officious offing offload offsaddle offset offsetting offshoot offshore offspring offstage oft often oftentimes Ogden ogle ogre ogress oh O'Hare Ohio ohm ohmic ohmmeter oil oilcloth oilman oilmen oilseed oily oint OK Okay Okinawa Oklahoma Olaf old olden Oldenburg Oldsmobile oldster oldy oleander O'Leary olefin oleomargarine Olga oligarchic oligarchy oligoclase oligopoly Olin olive Oliver Olivetti Olivia olivine Olsen Olson Olympia Olympic Omaha Oman omega omelet omen omicron ominous omission omit omitted omitting omnibus omnipotent omnipresent omniscient on once oncology oncoming one Oneida onerous oneself onetime oneupmanship ongoing onion onlooker onlooking only Onondaga onrush onrushing onset onslaught Ontario onto ontogeny ontology onus onward onyx oodles ooze opacity opal opalescent opaque OPEC Opel open opera operable operand operant operate operatic operetta Ophiucus opiate opinion opinionate opium opossum Oppenheimer opponent opportune opposable oppose opposite opposition oppress oppression oppressive oppressor opprobrium opt opthalmic opthalmologic opthalmology optic optima optimal optimism optimist optimistic optimum option optoacoustic optoisolate optometric optometrist optometry opulent opus or oracle oral orange orangeroot orangutan orate oratoric oratorio oratory orb orbit orbital orchard orchestra orchestral orchestrate orchid orchis ordain ordeal order orderly ordinal ordinance ordinary ordinate ordnance ore oregano Oregon Oresteia Orestes organ organdy organic organismic organometallic orgasm orgiastic orgy orient oriental orifice origin original originate Orin Orinoco oriole Orion Orkney Orlando Orleans ornament ornamentation ornate ornately ornery orographic orography Orono orphan orphanage Orpheus Orphic Orr Ortega orthant orthicon orthoclase orthodontic orthodontist orthodox orthodoxy orthogonal orthography orthonormal orthopedic orthophosphate orthorhombic Orville Orwell Orwellian o's Osaka Osborn Osborne Oscar oscillate oscillatory oscilloscope Osgood O'Shea Oshkosh osier Osiris Oslo osmium osmosis osmotic osprey osseous ossify ostensible ostentatious osteology osteopath osteopathic osteopathy osteoporosis ostracism ostracod Ostrander ostrich O'Sullivan Oswald Othello other otherwise otherworld otherworldly Otis Ott Ottawa otter Otto Ottoman Ouagadougou ouch ought oughtn't ounce our ourselves oust out outermost outlandish outlawry outrageous ouzel ouzo ova oval ovary ovate oven ovenbird over overhang overt overture Ovid oviform ow owe Owens owing owl owly own ox oxalate oxalic oxcart oxen oxeye Oxford oxidant oxidate oxide Oxnard oxygen oxygenate oyster Ozark ozone p pa Pablo Pabst pace pacemake pacesetting pacific pacifism pacifist pacify pack package Packard packet pact pad padding paddle paddock paddy padlock padre paean pagan page pageant pageantry paginate pagoda paid pail pain Paine painful painstaking paint paintbrush pair pairwise Pakistan Pakistani pal palace palate Palatine palazzi palazzo pale Paleolithic Paleozoic Palermo Palestine palette palfrey palindrome palindromic palisade pall palladia Palladian palladium pallet palliate pallid palm palmate palmetto Palmolive Palmyra Palo Palomar palpable palsy Pam Pamela pampa pamper pamphlet pan panacea panama pancake Pancho panda Pandanus pandemic pandemonium pander Pandora pane panel pang panic panicked panicky panicle panjandrum panning panoply panorama panoramic pansy pant pantheism pantheist pantheon panther pantomime pantomimic pantry panty Paoli pap papa papal papaw paper paperback paperweight paperwork papery papillary papoose Pappas pappy paprika Papua papyri papyrus par parabola parabolic paraboloid paraboloidal parachute parade paradigm paradigmatic paradise paradox paradoxic paraffin paragon paragonite paragraph Paraguay parakeet paralinguistic parallax parallel parallelepiped paralysis paramagnet paramagnetic parameter parametric paramilitary paramount Paramus paranoia paranoiac paranoid paranormal parapet paraphernalia paraphrase parapsychology parasite parasitic parasol parasympathetic paratroop paraxial parboil parcel parch pardon pare paregoric parent parentage parental parentheses parenthesis parenthetic parenthood Pareto pariah parimutuel Paris parish parishioner Parisian park Parke Parkinson parkish parkland parklike Parks parkway parlance parlay parley parliament parliamentarian parliamentary parochial parody parole parolee parquet Parr Parrish parrot parrotlike parry parse Parsifal parsimonious parsimony parsley parsnip parson parsonage Parsons part partake Parthenon partial participant participate participle particle particular particulate partisan partition partner partook partridge party parvenu Pasadena Pascal paschal pasha Paso pass passage passageway Passaic passband passe passenger passer passerby passion passionate passivate passive Passover passport password past paste pasteboard pastel pasteup Pasteur pastiche pastime pastor pastoral pastry pasture pasty pat Patagonia patch patchwork patchy pate patent patentee pater paternal paternoster Paterson path pathetic pathogen pathogenesis pathogenic pathology pathos pathway patient patina patio patriarch patriarchal patriarchy Patrice Patricia patrician Patrick patrimonial patrimony patriot patriotic patristic patrol patrolled patrolling patrolman patrolmen patron patronage patroness Patsy pattern Patterson Patti patting Patton patty paucity Paul Paula Paulette Pauli Pauline Paulo Paulsen Paulson Paulus paunch paunchy pauper pause pavanne pave pavilion Pavlov paw pawn pawnshop Pawtucket pax pay paycheck payday paymaster Payne payoff payroll Paz PBS pea Peabody peace peaceable peaceful peacemake peacetime peach Peachtree peacock peafowl peak peaky peal Peale peanut pear Pearce pearl pearlstone Pearson ((peasant peasanthood Pease peat pebble pecan peccary peck Pecos pectoral pectoralis peculate peculiar pecuniary pedagogic pedagogue pedagogy pedal pedant pedantic pedantry peddle pedestal pedestrian pediatric pediatrician pedigree pediment Pedro pee peed peek peel peep peephole peepy peer peg Pegasus pegboard pegging Peggy pejorative Peking Pelham pelican pellagra pellet pelt peltry pelvic pelvis Pembroke pemmican pen penal penalty penance penates pence penchant pencil pend pendant pendulum Penelope penetrable penetrate penguin Penh penicillin peninsula penitent penitential penitentiary penman penmen Penn penna pennant penning Pennsylvania penny pennyroyal Penrose Pensacola pension pensive pent pentagon pentagonal pentane Pentecost pentecostal penthouse penultimate penumbra penurious penury peony people Peoria pep peppergrass peppermint pepperoni peppery pepping peppy Pepsi PepsiCo peptide per perceive percent percentage percentile percept perceptible perception perceptive perceptual perch perchance perchlorate Percival percolate percussion percussive Percy perdition peremptory perennial Perez perfect perfectible perfidious perfidy perforate perforce perform performance perfume perfumery perfunctory perfusion Pergamon perhaps Periclean Pericles peridotite perihelion peril Perilla perilous perimeter period periodic peripatetic peripheral periphery periphrastic periscope perish peritectic periwinkle perjure perjury perk Perkins perky Perle permalloy permanent permeable permeate Permian permissible permission permissive permit permitted permitting permutation permute pernicious peroxide perpendicular perpetrate perpetual perpetuate perpetuity perplex perquisite Perry persecute persecution persecutory Perseus perseverance persevere Pershing Persia Persian persiflage persimmon persist persistent person persona personage personal personify personnel perspective perspicacious perspicous perspicuity perspicuous perspiration perspire persuade persuasion persuasive pert pertain Perth pertinacious pertinent perturb perturbate Peru perusal peruse Peruvian pervade pervasion pervasive perverse perversion pervert pessimal pessimism pessimist pessimum pest peste pesticide pestilent pestilential pestle pet petal Pete Peter Peters Petersburg Petersen Peterson petit petite petition petrel petri petrify petrochemical petroglyph petrol petroleum petrology petticoat petting petty petulant petunia Peugeot pew pewee pewter pfennig Pfizer phagocyte phalanger phalanx phalarope phantasy phantom pharmaceutic pharmacist pharmacology pharmacopoeia pharmacy phase PhD pheasant Phelps phenol phenolic phenomena phenomenal phenomenology phenomenon phenotype phenyl phi Phil Philadelphia philanthrope philanthropic philanthropy philharmonic Philip Philippine Philistine Phillips philodendron philology philosoph philosophic philosophy Phipps phloem phlox phobic phoebe Phoenicia phoenix phon phone phoneme phonemic phonetic phonic phonograph phonology phonon phony phosgene phosphate phosphide phosphine phosphor phosphoresce phosphorescent phosphoric phosphorus photo photogenic photography photolysis photolytic photometric photometry photon phrase phrasemake phraseology phthalate phycomycetes phyla Phyllis phylogeny physic physician Physik physiochemical physiognomy physiology physiotherapist physiotherapy physique phytoplankton pi pianissimo pianist piano piazza pica Picasso picayune Piccadilly piccolo pick pickaxe pickerel Pickering picket Pickett Pickford pickle Pickman pickoff pickup picky picnic picnicked picnicker picnicking picofarad picojoule picosecond pictorial picture picturesque piddle pidgin pie piece piecemeal piecewise Piedmont pier pierce Pierre Pierson pietism piety piezoelectric pig pigeon pigeonberry pigeonfoot pigeonhole pigging piggish piggy pigment pigmentation pigpen pigroot pigskin pigtail pike Pilate pile pilewort pilfer pilferage pilgrim pilgrimage pill pillage pillar pillory pillow Pillsbury pilot pimp pimple pin pinafore pinball pinch pincushion pine pineapple Pinehurst ping pinhead pinhole pinion pink pinkie pinkish pinnacle pinnate pinning pinochle pinpoint pinscher Pinsky pint pintail pinto pinwheel pinxter pion pioneer pious pip pipe pipeline Piper pipette pipsissewa piquant pique piracy Piraeus pirate pirogue pirouette Piscataway Pisces piss pistachio pistol pistole piston pit pitch pitchblende pitchfork pitchstone piteous pitfall pith pithy pitiable pitiful pitilessly pitman Pitney Pitt pitting Pittsburgh Pittsfield Pittston pituitary pity Pius pivot pivotal pixel pixy pizza pizzicato placate placater place placeable placebo placeholder placenta placental placid plagiarism plagiarist plagioclase plague plagued plaguey plaid plain Plainfield plaintiff plaintive plan planar Planck plane planeload planet planetaria planetarium planetary planetesimal planetoid plank plankton planning planoconcave planoconvex plant plantain plantation plaque plasm plasma plasmon plaster plastic plastisol plastron plat plate plateau platelet platen platform platinize platinum platitude platitudinous Plato platonic Platonism Platonist platoon Platte platting plausible play playa playback playboy playful playground playhouse playmate playoff playroom playtime playwright playwriting plaza plea plead pleasant please pleasure pleat plebeian plebian pledge Pleiades Pleistocene plenary plenipotentiary plenitude plentiful plenty plenum plethora pleura pleural Plexiglas pliable pliancy pliant pliers plight Pliny Pliocene plod plodding plop plopping plot plotting plover plow plowman plowshare pluck plucky plug pluggable plugging plum plumage plumb plumbago plumbate plume plummet plump plunder plunge plunk plural plus plush plushy Plutarch Pluto plutonium ply Plymouth plyscore plywood PM pneumatic pneumonia Po poach pocket pocketbook pocketful Pocono pod podge podia podium Poe poem poesy poet poetic poetry pogo pogrom poi poignant Poincare poinsettia point poise poison poisonous Poisson poke pokerface pol Poland polar polarimeter polarimetry Polaris polariscope polariton polarogram polarograph polarography Polaroid polaron pole polecat polemic police policeman policemen policy polio polis polish Politburo polite politic politician politicking politico polity Polk polka poll Pollard pollcadot pollen pollock polloi pollutant pollute pollution Pollux polo polonaise polonium polopony polygon polygonal polygynous polyhedra polyhedral polyhedron Polyhymnia polymer polymerase polymeric polymorph polymorphic polynomial Polyphemus polyphony polypropylene polytechnic polytope polytypy pomade pomegranate Pomona pomp pompadour pompano Pompeii pompey pompon pomposity pompous Ponce Ponchartrain poncho pond ponder ponderous pong pont Pontiac pontiff pontific pontificate pony pooch poodle pooh pool Poole poop poor pop pope popish poplar poplin popping poppy populace popular populate populous porcelain porch porcine porcupine pore pork pornographer pornography porosity porous porphyry porpoise porridge port portage portal Porte portend portent portentous porterhouse portfolio Portia portico portland portmanteau Porto portrait portraiture portray portrayal Portsmouth Portugal Portuguese portulaca pose Poseidon poseur posey posh posit position positive positron posse posseman possemen possess possession possessive possessor possible possum post postage postal postcard postcondition postdoctoral posterior posteriori posterity postfix postgraduate posthumous postlude postman postmark postmaster postmen postmortem postmultiply postoperative postorder postpone postprocess postprocessor postscript postulate posture postwar posy pot potable potash potassium potato potatoes potbelly potboil potent potentate potential potentiometer pothole potion potlatch Potomac potpourri pottery potting Potts pouch Poughkeepsie poultice poultry pounce pound pour pout poverty pow powder powderpuff powdery Powell power powerful Powers Poynting ppm practicable practical practice practise practitioner Prado pragmatic pragmatism pragmatist Prague prairie praise praiseworthy pram prance prank praseodymium Pratt Pravda pray prayer prayerful preach preachy preamble Precambrian precarious precaution precautionary precede precedent precept precess precession precinct precious precipice precipitable precipitate precipitous precise precision preclude precocious precocity precursor predatory predecessor predicament predicate predict predictor predilect predispose predisposition predominant predominate preeminent preempt preemption preemptive preemptor preen prefab prefabricate preface prefatory prefect prefecture prefer preference preferential preferred preferring prefix pregnant prehistoric prejudice prejudicial preliminary prelude premature premeditate premier premiere premise premium premonition premonitory Prentice preoccupy prep preparation preparative preparatory prepare preponderant preponderate preposition preposterous prepping prerequisite prerogative presage Presbyterian Prescott prescribe prescript prescription prescriptive presence present presentation presentational preservation preserve preside president presidential press pressure prestidigitate prestige prestigious presto Preston presume presumed presuming presumption presumptive presumptuous presuppose presupposition pretend pretense pretension pretentious pretext Pretoria pretty prevail prevalent prevent prevention preventive preview previous prexy prey Priam price prick prickle pride priest Priestley prig priggish prim prima primacy primal primary primate prime primeval primitive primitivism primp primrose prince princess Princeton principal Principia principle print printmake printout prior priori priory Priscilla prism prismatic prison prissy pristine Pritchard privacy private privet privilege privy prize prizewinning pro probabilist probate probe probity problem problematic procaine procedural procedure proceed process procession processor proclaim proclamation proclivity procrastinate procreate procrustean Procrustes Procter proctor procure Procyon prod prodding prodigal prodigious prodigy produce producible product productivity Prof profane profess profession professional professor professorial proffer proficient profile profit profligate profound profundity profuse p((rofusion progenitor progeny prognosis prognosticate programmable programmed programmer programming progress progression progressive prohibit prohibition prohibitive prohibitory project projectile projector Prokofieff prolate proletariat proliferate prolific prolix prologue prolong prolongate prolusion promenade Promethean Prometheus promethium prominent promiscuous promise promote promotion prompt promptitude promulgate prone prong pronoun pronounce pronounceable pronto pronunciation proof proofread prop propaganda propagandist propagate propane propel propellant propelled propeller propelling propensity proper property prophecy prophesy prophet prophetic propionate propitiate propitious proponent proportion proportionate propos proposal propose proposition propping proprietary proprietor propriety proprioception proprioceptive propulsion propyl propylene prorate prorogue prosaic proscenium proscribe proscription prose prosecute prosecution prosecutor Proserpine prosodic prosody prosopopoeia prospect prospector prospectus prosper prosperous prostate prosthetic prostitute prostitution prostrate protactinium protagonist protean protease protect protector protectorate protege protein proteolysis proteolytic protest protestant protestation prothonotary protocol proton protoplasm protoplasmic prototype prototypic Protozoa protozoan protract protrude protrusion protrusive protuberant proud Proust prove proven provenance proverb proverbial provide provident providential province provincial provision provisional proviso provocateur provocation provocative provoke provost prow prowess prowl proximal proximate proximity proxy prudent prudential prune prurient Prussia pry p's psalm psalter pseudo psi psych psyche psychiatric psychiatrist psychiatry psychic psycho psychoacoustic psychoanalysis psychoanalyst psychoanalytic psychobiology psychology psychometric psychometry psychopath psychopathic psychophysic psychophysical psychophysics psychophysiology psychopomp psychoses psychosis psychosomatic psychotherapeutic psychotherapist psychotherapy psychotic psyllium PTA ptarmigan Ptolemaic Ptolemy pub puberty pubescent public publication publish Puccini puck puckish pudding puddingstone puddle puddly pueblo puerile Puerto puff puffball puffed puffery puffin puffy pug Pugh puissant puke Pulaski Pulitzer pull pulley Pullman pullover pulmonary pulp pulpit pulsar pulsate pulse pulverable puma pumice pummel pump pumpkin pumpkinseed pun punch punctual punctuate puncture pundit punditry pungent Punic punish punitive punk punky punning punster punt puny pup pupal pupate pupil puppet puppeteer puppy puppyish Purcell purchasable purchase Purdue pure purgation purgative purgatory purge purify Purina Puritan puritanic purl purloin purple purport purpose purposeful purposive purr purse purslane pursuant pursue pursuer pursuit purvey purveyor purview pus Pusan Pusey push pushbutton pussy pussycat put putative Putnam putt putty puzzle PVC Pygmalion pygmy Pyhrric pyknotic Pyle Pyongyang pyracanth pyramid pyramidal pyre Pyrex pyridine pyrite pyroelectric pyrolyse pyrolysis pyrometer pyrometry pyrophosphate pyrotechnic pyroxene pyroxenite Pythagoras Pythagorean python q Qatar QED q's qua quack quackery quad quadrangle quadrangular quadrant quadratic quadrature quadrennial quadric quadriceps quadrilateral quadrille quadrillion quadripartite quadrivium quadruple quadrupole quaff quagmire quahog quail quaint quake Quakeress qualified qualify qualitative quality qualm quandary quanta Quantico quantify quantile quantitative quantity quantum quarantine quark quarrel quarrelsome quarry quarryman quarrymen quart quarterback quartermaster quartet quartic quartile quartz quartzite quasar quash quasi quasiparticle quaternary quatrain quaver quay queasy Quebec queen queer quell quench querulous query quest question questionnaire quetzal queue Quezon quibble quick quicken quickie quicklime quicksand quicksilver quickstep quiescent quiet quietus quill quillwort quilt quince quinine Quinn quint quintet quintic quintillion quintus quip quipping Quirinal quirk quirky quirt quit quite Quito quitting quiver Quixote quixotic quiz quizzical quo quod quonset quorum quota quotation quote quotient r rabat rabbet rabbi rabbit rabble rabid rabies Rabin raccoon race racetrack raceway Rachel Rachmaninoff racial rack racket racketeer rackety racy radar Radcliffe radial radian radiant radiate radical radices radii radio radioactive radioastronomy radiocarbon radiochemical radiochemistry radiography radiology radiometer radiometric radiometry radiophysics radiosonde radiosterilize radiotherapy radish radium radius radix radon Rae Rafael Rafferty raffia raffish raft rag rage ragging ragout ragweed raid rail railbird railhead raillery railroad railway rain rainbow raincoat raindrop rainfall rainstorm rainy raise raisin raj rajah rake rakish Raleigh rally Ralph Ralston ram Ramada Raman ramble ramify ramming Ramo ramp rampage rampant rampart ramrod Ramsey ran ranch rancho rancid rancorous Rand Randall Randolph random randy rang range rangeland Rangoon rangy Ranier rank Rankin rankle ransack ransom rant Raoul rap rapacious rape Raphael rapid rapier rapping rapport rapprochement rapt rapture rare rarefy Raritan rarity rasa rascal rash Rasmussen rasp raspberry raster Rastus rat rata rate rater rather ratify ratio ratiocinate rationale rattail rattle rattlesnake raucous ravage rave ravel raven ravenous ravine ravish raw rawboned rawhide Rawlinson ray Rayleigh Raymond Raytheon raze razor razorback RCA R&D re reach reactant reactionary read readout ready Reagan reagent real realisable realm realtor realty ream reap rear reason reave reb Rebecca rebel rebelled rebelling rebellion rebellious rebuke rebut rebuttal rebutted rebutting recalcitrant recant recappable recede receipt receive recent receptacle reception receptive receptor recess recession recessive recherche Recife recipe recipient reciprocal reciprocate reciprocity recital recitative reck reckon reclamation recline recluse recompense reconcile recondite reconnaissance record recoup recourse recovery recriminate recruit rectangle rectangular rectifier rectify rectilinear rectitude rector rectory recumbent recuperate recur recurred recurrent recurring recursion recursive recusant recuse red redact redactor redbird redbud redcoat redden reddish redeem redemption redemptive redhead Redmond redneck redound redpoll redshank redstart Redstone redtop reduce reducible reduct redundant redwood reed reedbuck reedy reef reek reel Reese reeve Reeves refectory refer referee refereeing referenda referendum referent referential referral referred referring refinery reflect reflectance reflector reflexive reforestation reformatory refract refractometer refractory refrain refrigerate refuge refugee refusal refutation refute regal regale regalia regard regatta regent regime regimen regiment regimentation Regina Reginald region regional Regis registrable registrant registrar registration registry regress regression regret regretful regrettable regretted regretting regular regulate regulatory Regulus rehabilitate rehearsal rehearse Reich Reid reign Reilly reimbursable reimburse rein reindeer reinforce Reinhold reinstate reject rejoice rejoinder relate relax relaxation relay releasable relevant reliable reliant relic relict relief relieve religion religiosity religious relinquish reliquary relish reluctant remainder reman remand remark Rembrandt remediable remedial remedy remember remembrance Remington reminisce reminiscent remiss remission remit remittance remitted remitting remnant remonstrate remorse remorseful remote removal remunerate Remus Rena renaissance renal Renault rend render rendezvous rendition renegotiable renewal Renoir renounce renovate renown Rensselaer rent rental renunciate rep repairman repairmen reparation repartee repeal repeat repeater repel repelled repellent repelling repent repentant repertoire repertory repetition repetitious repetitive replaceable replenish replete replica replicate report reportorial repository reprehensible representative repression repressive reprieve reprimand reprisal reprise reproach reptile reptilian republic republican repudiate repugnant repulsion repulsive reputation repute request require requisite requisition requited reredos rescind rescue resemblant resemble resent resentful reserpine reservation reserve reservoir reside resident residential residual residuary residue residuum resign resignation resilient resin resinlike resiny resist resistant resistible resistive resistor resolute resolution resolve resonant resonate resorcinol resort resourceful respect respectful respiration respirator respiratory respire respite resplendent respond respondent response responsible responsive rest restaurant restaurateur restful restitution restive restoration restorative restrain restraint restrict restroom result resultant resume resuming resumption resurgent resurrect resuscitate ret retail retain retaliate retaliatory retard retardant retardation retch retention retentive reticent reticulate reticulum retina retinal retinue retire retiree retort retract retribution retrieval retrieve retroactive retrofit retrofitting retrograde retrogress retrogressive retrorocket retrospect retrovision return Reub Reuben Reuters reveal revel revelation revelatory revelry revenge revenue rever reverberate revere reverend reverent reverie reversal reverse reversible reversion revert revertive revery revet revile revisable revisal revise revision revisionary revival revive revocable revoke revolt revolution revolutionary revolve revulsion revved revving reward Rex Reykjavik Reynolds rhapsodic rhapsody Rhea Rhenish rhenium rheology rheostat rhesus rhetoric rhetorician rheum rheumatic rheumatism Rhine rhinestone rhino rhinoceros rho Rhoda Rhode Rhodes Rhodesia rhodium rhododendron rhodolite rhodonite rhombi rhombic rhombus rhubarb rhyme rhythm rhythmic rib ribald ribbing ribbon riboflavin ribonucleic Rica rice rich Richard Richards Richardson Richfield Richmond Richter rick rickets Rickettsia rickety rickshaw Rico ricochet rid riddance ridden ridding riddle ride ridge ridgepole Ridgway ridicule ridiculous Riemann riffle rifle rifleman riflemen rift rig R((igel rigging Riggs right righteous rightful rightmost rightward rigid rigorous Riley rill rilly rim rime rimming rimy Rinehart ring ringlet ringside rink rinse Rio Riordan riot riotous rip riparian ripe ripen Ripley ripoff ripping ripple rise risen risible risk risky Ritchie rite Ritter ritual Ritz rival rivalry riven river riverbank riverfront riverine riverside rivet Riviera rivulet Riyadh roach road roadbed roadblock roadhouse roadside roadster roadway roam roar roast rob robbery robbin robbing Robbins robe Robert Roberta Roberto Roberts Robertson robin Robinson robot robotics robust Rochester rock rockabye rockaway rockbound Rockefeller rocket Rockford Rockies Rockland rocklike Rockwell rocky rococo rod rode rodent rodeo Rodgers Rodney Rodriguez roe roebuck Roentgen Roger Rogers rogue roil roister Roland role roll rollback rollick Rollins Roman romance Romano romantic Rome Romeo romp Romulus Ron Ronald rondo Ronnie rood roof rooftop rooftree rook rookie rooky room roomful roommate roomy Roosevelt Rooseveltian roost root rope Rosa Rosalie rosary rose rosebud rosebush Roseland rosemary Rosen Rosenberg Rosenblum Rosenthal Rosenzweig rosette Ross roster rostrum rosy rot Rotarian rotary rotate ROTC rotenone Roth rotogravure rotor rototill rotten rotting rotund rotunda rouge rough roughcast roughen roughish roughneck roughshod roulette round roundabout roundhead roundhouse roundoff roundtable roundup roundworm rouse Rousseau roustabout rout route routine rove row rowboat rowdy Rowe Rowena Rowland Rowley Roy royal royalty Royce RPM r's RSVP Ruanda rub rubbery rubbing rubbish rubble rubdown Rube Ruben rubicund rubidium rubric ruby ruckus rudder ruddy rude rudiment rudimentary Rudolf Rudolph Rudy Rudyard rue rueful ruffian ruffle rufous Rufus rug ruin ruinous rule rum Rumania rumble rumen Rumford ruminant rummage rummy rump rumple rumpus run runabout runaway rundown rune rung Runge runic runneth running Runnymede runoff runt runty runway Runyon rupee rupture rural ruse rush Rushmore rusk Russ Russell russet Russia Russo russula rust rustic rustle rustproof rusty rut rutabaga Rutgers Ruth ruthenium Rutherford ruthless rutile Rutland Rutledge rutting rutty Rwanda Ryan Rydberg Ryder rye s sa sabbath sabbatical Sabina Sabine sable sabotage sabra sac sachem sack sacral sacrament Sacramento sacred sacrifice sacrificial sacrilege sacrilegious sacrosanct sad sadden saddle saddlebag Sadie sadism sadist Sadler safari safe safeguard safekeeping safety saffron sag saga sagacious sagacity sage sagebrush sagging Saginaw sagittal Sagittarius sago saguaro Sahara said Saigon sail sailboat sailfish sailor saint sainthood sake Sal Salaam salacious salad salamander salami salaried salary sale Salem Salerno salesgirl Salesian saleslady salesman salesmen salesperson salient Salina saline Salisbury Salish saliva salivary salivate Salk Salle sallow sally salmon salmonberry salon saloon saloonkeep salsify salt saltbush saltwater salty salubrious salutary salutation salute Salvador salvage salvageable salvation Salvatore salve salvo Sam samarium samba same Sammy Samoa samovar sample Sampson Samson Samuel Samuelson San Sana sanatoria sanatorium Sanborn Sanchez Sancho sanctify sanctimonious sanction sanctity sanctuary sand sandal sandalwood sandbag sandblast Sandburg sanderling Sanders Sanderson sandhill Sandia sandman sandpaper sandpile sandpiper Sandra sandstone Sandusky sandwich sandy sane Sanford sang sangaree sanguinary sanguine sanguineous Sanhedrin sanicle sanitarium sanitary sanitate sank sans Santa Santayana Santiago Santo Sao sap sapiens sapient sapling saponify sapphire sapping sappy sapsucker Sara Saracen Sarah Saran Sarasota Saratoga sarcasm sarcastic sarcoma sardine sardonic Sargent sari sarsaparilla sarsparilla sash sashay Saskatchewan sassafras sat satan satanic satellite satiable satiate satiety satin satire satiric satisfaction satisfactory satisfy saturable saturate saturater Saturday Saturn Saturnalia saturnine satyr sauce saucepan saucy Saud Saudi sauerkraut Saul Sault Saunders sausage saute sauterne savage savagery Savannah savant save Saviour Savonarola savoy Savoyard savvy saw sawbelly sawdust sawfish sawfly sawmill sawtimber sawtooth sawyer sax saxifrage Saxon Saxony saxophone say SC scab scabbard scabious scabrous scaffold Scala scalar scald scale scallop scalp scamp scan scandal scandalous Scandinavia scandium scanning scant scanty scapegoat scapula scapular scar Scarborough scarce scare scarecrow scarf scarface scarify scarlet Scarsdale scarves scary scat scathe scatterbrain scattergun scatting scaup scavenge scenario scene scenery scenic scent sceptic Schaefer Schafer Schantz schedule schelling schema schemata schematic scheme Schenectady scherzo Schiller schism schist schizoid schizomycetes schizophrenia schizophrenic Schlesinger schlieren Schlitz Schloss Schmidt Schmitt Schnabel schnapps Schneider Schoenberg Schofield scholar scholastic school schoolbook schoolboy schoolgirl schoolgirlish schoolhouse schoolmarm schoolmaster schoolmate schoolroom schoolteacher schoolwork schooner Schottky Schroeder Schroedinger Schubert Schultz Schulz Schumacher Schumann Schuster Schuyler Schuylkill Schwab Schwartz Schweitzer sciatica science scientific scientist scimitar scintillate scion scissor sclerosis sclerotic SCM scoff scold scoop scoot scope scopic scops scorch score scoreboard scorecard scoria scorn scornful Scorpio scorpion Scot scotch Scotia Scotland Scotsman Scotsmen Scott Scottish Scottsdale Scotty scoundrel scour scourge scout scowl scrabble scraggly scram scramble scramming Scranton scrap scrapbook scrape scrapping scratch scratchy scrawl scrawny scream screech screechy screed screen screenplay screw screwball screwbean screwdriver screwworm scribble scribe Scribners scrim scrimmage Scripps script scription scriptural scripture scriven scroll scrooge scrounge scrub scrubbing scrumptious scruple scrupulosity scrupulous scrutable scrutiny scuba scud scudding scuff scuffle scull sculpin sculpt sculptor sculptural sculpture scum scurrilous scurry scurvy scuttle scutum Scylla scythe Scythia SD sea seaboard seacoast seafare seafood Seagram seagull seahorse seal sealant seam seaman seamen seamy Sean seance seaport seaquake sear search searchlight Sears seashore seaside season seasonal seat seater Seattle seaward seaweed Sebastian sec secant secede secession seclude seclusion second secondary secondhand secrecy secret secretarial secretariat secretary secrete secretion secretive sect sectarian section sector secular secure sedan sedate sedentary seder sedge sediment sedimentary sedimentation sedition seditious seduce seduction seductive sedulous see seeable seed seedbed seedling seedy seeing seek seem seen seep seepage seersucker seethe segment segmentation Segovia segregant segregate Segundo Seidel seismic seismograph seismography seismology seize seizure seldom select selectman selectmen selector Selectric Selena selenate selenite selenium self selfish Selfridge Selkirk sell seller sellout Selma seltzer selves Selwyn semantic semaphore semblance semester semi seminal seminar seminarian seminary Seminole Semiramis Semite Semitic semper sen senate senatorial send Seneca Senegal senile senior senor Senora senorita sensate sense sensible sensitive sensor sensory sensual sensuous sent sentence sentential sentient sentiment sentinel sentry Seoul sepal separable separate sepia Sepoy sept septa septate September septennial septic septillion septuagenarian septum sepuchral sepulchral sequel sequent sequential sequester sequestration sequin sequitur Sequoia sera seraglio serape seraphim serenade serendipitous serene serge sergeant Sergei serial seriatim series serif serious sermon serology Serpens serpent serpentine serum servant serve service serviceable serviceberry serviceman servicemen serviette servile servitor servo servomechanism sesame session set setback Seth Seton setscrew setting settle setup seven sevenfold seventeen seventeenth seventh seventieth seventy sever several severalfold severalty severe Severn Seville sew sewage Seward sewerage sewn sex Sextans sextet sextillion sexton sextuple sextuplet sexual sexy Seymour sforzando shabby shack shackle shad shadbush shade shadflower shadow shadowy shady Shafer Shaffer shaft shag shagbark shagging shaggy shah shake shakeable shakedown shaken Shakespeare Shakespearean Shakespearian shako shaky shale shall shallot shallow shalom sham shamble shame shameface shameful shampoo shamrock Shanghai shank Shannon shan't Shantung shanty shape Shapiro shard share sharecrop shareholder Shari shark Sharon sharp Sharpe sharpen sharpshoot Shasta shatter shatterproof Shattuck shave shaven shaw shawl Shawnee shay she Shea sheaf shear Shearer sheath sheathe sheave she'd shed shedding Shedir Sheehan sheen sheep sheepskin sheer sheet Sheffield sheik Sheila Shelby Sheldon shelf she'll shell Shelley shelter Shelton shelve Shenandoah shenanigan Shepard shepherd Sheppard Sheraton sherbet Sheridan sheriff Sherlock Sherman Sherrill sherry Sherwin Sherwood shibboleth shied shield Shields shift shifty shill Shiloh shim shimming shimmy shin shinbone shine shingle Shinto shiny ship shipboard shipbuild shipbuilding shiplap Shipley shipman shipmate shipmen shipping shipshape shipwreck shipyard shire shirk Shirley shirt shirtmake shish shitepoke shiv shiver shivery shoal shock Shockley shod shoddy shoe shoehorn shoelace shoemake shoestring shoji shone shoo shoofly shook shoot shop shopkeep shopping shopworn shore shoreline short shortage shortcoming shortcut shorten shortfall shorthand shortish shortsighted shortstop shot shotbush shotgun should shoulder shouldn't shout shove shovel show showboat showcase showdown showman showmen shown showpiece showplace showroom showy shrank shrapnel shred shredding Shreveport shrew shrewd shrewish shriek shrift shrike shrill shrilly shrimp shrine shrink shrinkage shrive shrivel shroud shrove shrub shrubbery shrug shrugging shrunk shrunken Shu shuck shudder shuddery shuffle shuffleboard Shulman shun shunning shunt shut shutdown shutoff shutout shutting shuttle shuttlecock shy Shylock sial SIAM Siamese Sian sib Siberia sibilant Sibley sibling sibyl sic Sicilian Sicily sick sicken sickish sickle sicklewort ((sickroom side sidearm sideband sideboard sidecar sidelight sideline sidelong sideman sidemen sidereal siderite sidesaddle sideshow sidestep sidestepping sidetrack sidewalk sidewall sideway sidewinder sidewise sidle Sidney siege Siegel Siegfried Sieglinda Siegmund Siemens sienna sierra siesta sieve sift sigh sight sightsee sightseeing sightseer sigma Sigmund sign signal signature signboard signet significant signify Signor Signora signpost Sikorsky silage silane Silas silent silhouette silica silicate siliceous silicic silicide silicon silicone silk silken silkworm silky sill silly silo silt siltation siltstone silty silver Silverman silversmith silverware silvery sima similar simile similitude simmer Simmons Simon Simons Simonson simper simple simplectic simpleminded simpleton simplex simplicity simplify simplistic simply Simpson Sims simulate simulcast simultaneity simultaneous sin Sinai since sincere Sinclair sine sinew sinewy sinful sing singable Singapore singe single singlehanded singlet singleton singsong singular sinh sinister sinistral sink sinkhole sinning sinter sinuous sinus sinusoid sinusoidal Sioux sip sipping sir sire siren Sirius sis sisal siskin sister Sistine Sisyphean Sisyphus sit site sitting situ situate situs siva six sixfold sixgun sixteen sixteenth sixth sixtieth sixty size sizzle skat skate skater skeet skeletal skeleton skeptic sketch sketchbook sketchpad sketchy skew ski skid skidding skiddy skied skiff skill skillet skillful skim skimming skimp skimpy skin skindive skinning skinny skip skipjack skipping Skippy skirmish skirt skit skittle skulk skull skullcap skullduggery skunk sky Skye skyhook skyjack skylark skylight skyline skyrocket skyscrape skyward skywave skyway slab slack slacken sladang slag slain slake slam slamming slander slanderous slang slant slap slapping slapstick slash slat slate slater slatting slaughter slaughterhouse Slav slave slavery Slavic slavish slay sled sledding sledge sledgehammer sleek sleep sleepwalk sleepy sleet sleety sleeve sleigh sleight slender slept sleuth slew slice slick slid slide slight slim slime slimy sling slingshot slip slippage slippery slipping slit slither slitting sliver slivery Sloan Sloane slob Slocum sloe slog slogan sloganeer slogging sloop slop slope slopping sloppy slosh slot sloth slothful slouch slough sloven slow slowdown sludge slug slugging sluggish sluice slum slumber slumming slump slung slur slurp slurring slurry sly smack small smaller Smalley smallish smallpox smalltime smart smash smattering smear smell smelt smile smirk smith smithereens Smithfield Smithson Smithsonian smithy smitten smog smoke smokehouse smokescreen smokestack smoky smolder smooch smooth smoothbore smother Smucker smudge smudgy smug smuggle smut smutty Smyrna Smythe snack snafu snag snagging snail snake snakebird snakelike snakeroot snap snapback snapdragon snapping snappish snappy snapshot snare snark snarl snatch snazzy sneak sneaky sneer sneeze snell snick Snider sniff sniffle sniffly snifter snigger snip snipe snippet snippy snivel snob snobbery snobbish snook snoop snoopy snore snorkel snort snotty snout snow snowball snowfall snowflake snowstorm snowy snub snubbing snuff snuffer snuffle snuffly snug snuggle snuggly snyaptic Snyder so soak soap soapstone soapsud soapy soar sob sobbing sober sobriety sobriquet soccer sociable social societal Societe society socioeconomic sociology sociometric sociometry sock socket sockeye Socrates Socratic sod soda sodden sodding sodium sofa soffit Sofia soft softball soften software softwood soggy soignee soil soiree sojourn Sol solace solar sold solder soldier soldiery sole solecism solemn solemnity solenoid solicit solicitation solicitor solicitous solicitude solid solidarity solidify soliloquy solipsism solitary solitude solo Solomon Solon solstice soluble solute solution solvate solve solvent soma somal Somali somatic somber sombre some somebody somebody'll someday somehow someone someone'll someplace Somers somersault Somerset Somerville something sometime somewhat somewhere sommelier Sommerfeld somnolent son sonar sonata song songbag songbook songful sonic sonnet sonny Sonoma Sonora sonority sonorous Sony soon soot sooth soothe soothsay soothsayer sop sophia Sophie sophism sophisticate sophistry Sophoclean Sophocles sophomore sophomoric sopping soprano sora sorb sorcery sordid sore Sorensen Sorenson sorghum sorority sorption sorrel sorrow sorrowful sorry sort sortie sou souffle sought soul soulful sound soundproof soup sour sourberry source sourdough sourwood Sousa soutane south Southampton southbound southeast southeastern southern southernmost Southey southland southpaw southward southwest southwestern souvenir sovereign sovereignty soviet sovkhoz sow sowbelly sown soy soya soybean spa space spacecraft spacesuit spacious spade spaghetti Spain spalding span spandrel spangle Spaniard spaniel Spanish spanning spar spare sparge spark sparkle Sparkman sparky sparling sparring sparrow sparse Sparta Spartan spasm spastic spat spate spatial spatlum spatterdock spatula Spaulding spavin spawn spay spayed speak speakeasy spear spearhead spearmint spec special specie species specific specify specimen specious speck speckle spectacle spectacular spectator Spector spectra spectral spectrogram spectrograph spectrography spectrometer spectrometric spectrometry spectrophotometer spectrophotometric spectrophotometry spectroscope spectroscopic spectroscopy spectrum specular speculate sped speech speed speedboat speedometer speedup speedwell speedy spell spellbound Spencer Spencerian spend spent sperm spermatophyte Sperry spew sphagnum sphalerite sphere spheric spheroid spheroidal spherule sphinx Spica spice spicebush spicy spider spiderwort spidery Spiegel spigot spike spikenard spiky spill spilt spin spinach spinal spindle spine spinnaker spinneret spinning spinodal spinoff spinster spiny spiral spire spirit spiritual Spiro spit spite spiteful spitfire spitting spittle spitz splash splashy splat splay splayed spleen spleenwort splendid splenetic splice spline splint splintery split splitting splotch splotchy splurge splutter spoil spoilage Spokane spoke spoken spokesman spokesmen sponge spongy sponsor spontaneity spontaneous spoof spook spooky spool spoon spoonful sporadic spore sport sportsman sportsmen sportswear sportswriter sportswriting sporty spot spotlight spotting spotty spouse spout Sprague sprain sprang sprawl spray spread spree sprig sprightly spring springboard springe Springfield springtail springtime springy sprinkle sprint sprite sprocket Sproul sprout spruce sprue sprung spud spume spumoni spun spunk spur spurge spurious spurn spurring spurt sputnik sputter spy spyglass squabble squad squadron squalid squall squamous squander square squash squashberry squashy squat squatting squaw squawbush squawk squawroot squeak squeaky squeal squeamish squeegee squeeze squelch Squibb squid squill squint squire squirehood squirm squirmy squirrel squirt squishy Sri s's SST St St. stab stabbing stabile stable stableman stablemen staccato stack Stacy stadia stadium staff Stafford stag stage stagecoach stagnant stagnate stagy Stahl staid stain stair staircase stairway stairwell stake stalactite stale stalemate Staley Stalin stalk stall stallion stalwart stamen Stamford stamina staminate stammer stamp stampede Stan stance stanch stanchion stand standard standby standeth Standish standoff standpoint standstill Stanford Stanhope stank Stanley stannic stannous Stanton stanza staph staphylococcus staple Stapleton star starboard starch starchy stardom stare starfish stargaze stark Starkey starlet starlight starling Starr starring start startle startup starvation starve stash stasis state Staten stater stateroom statesman statesmanlike statesmen statewide static stationarity stationary stationery stationmaster statistician Statler stator statuary statue statuette stature status statute statutory Stauffer staunch Staunton stave stay stayed stead steadfast steady steak steal stealth stealthy steam steamboat steamy Stearns steed steel Steele steelmake steely Steen steep steepen steeple steeplebush steer steeve Stefan stein Steinberg Steiner stella stellar stem stemming stench stencil stenographer stenography stenotype step stepchild Stephanie stephanotis Stephen Stephens Stephenson stepmother steppe stepping steprelation stepson stepwise steradian stereo stereography stereoscopy sterile sterling stern sternal Sterno sternum steroid stethoscope Stetson Steuben Steve stevedore Steven Stevens Stevenson stew steward stewardess Stewart stick stickle stickleback stickpin sticktight sticky stiff stiffen stifle stigma stigmata stile stiletto still stillbirth stillwater stilt stimulant stimulate stimulatory stimuli stimulus sting stingy stink stinkpot stinky stint stipend stipple stipulate stir Stirling stirring stirrup stitch stochastic stock stockade stockbroker stockholder Stockholm stockpile stockroom Stockton stocky stodgy stoic stoichiometric stoichiometry stoke Stokes stole stolen stolid stomach stomp stone stonecrop Stonehenge stonewall stoneware stonewort stony stood stooge stool stoop stop stopband stopcock stopgap stopover stoppage stopping stopwatch storage store storehouse storekeep storeroom Storey stork storm stormbound stormy story storyboard storyteller stout stove stow stowage strabismic strabismus straddle strafe straggle straight straightaway straighten straightforward straightway strain strait strand strange strangle strangulate strap strapping strata stratagem strategic strategist strategy Stratford stratify stratosphere stratospheric Stratton stratum Strauss straw strawberry strawflower stray streak stream streamline streamside street streetcar strength strengthen strenuous streptococcus stress stressful stretch strewn striate stricken Strickland strict stricture stride strife strike strikebreak string stringent stringy strip stripe stripping striptease strive striven strobe stroboscopic strode stroke stroll Strom Stromberg strong stronghold strongroom strontium strop strophe stropping strove struck structural structure struggle strum strumming strung strut strutting strychnine Stuart stub stubbing stubble stubborn stubby stucco stuck stud studding Studeba((ker student studio studious study stuff stuffy stultify stumble stump stumpage stumpy stun stung stunk stunning stunt stupefy stupendous stupid stupor Sturbridge sturdy sturgeon Sturm stutter Stuttgart Stuyvesant Stygian style styli stylish stylites stylus stymie styrene Styrofoam Styx suave sub subbing subject subjectivity sublimate subliminal submersible submit submittal submitted submitting subpoena subrogation subservient subsidiary subsidy subsist subsistent substantial substantiate substantive substituent substitute substitution substitutionary substrate subsume subsumed subsuming subterfuge subterranean subtle subtlety subtly subtrahend suburb suburbia subversive subvert succeed success successful succession successive successor succinct succubus succumb such suck suckling suction sud Sudan Sudanese sudden suds sue suey Suez suffer suffice sufficient suffix suffocate Suffolk suffrage suffragette suffuse sugar suggest suggestible suggestion suggestive suicidal suicide suit suitcase suite suitor sulfa sulfate sulfide sulfite sulfonamide sulfur sulfuric sulfurous sulk sulky sullen Sullivan sully sulphur sultan sultry sum sumac Sumatra Sumerian summand summarily summary summate Summers summertime summing summit summitry summon Sumner sumptuous Sumter sun sunbeam sunbonnet sunburn sunburnt Sunday sunder sundew sundial sundown sundry sunfish sunflower sung sunk sunken sunlight sunlit sunning sunny Sunnyvale sunrise sunset sunshade sunshine sunshiny sunspot suntan suntanned suntanning SUNY sup super superannuate superb superbly supercilious superficial superfluity superfluous superintendent superior superlative superlunary supernatant superposable supersede superstition superstitious supervene supervisory supine supping supplant supple supplementary supplicate supply support supposable suppose supposition suppress suppressible suppression suppressor supra supranational supremacy supreme surcease surcharge sure surety surf surface surfactant surfeit surge surgeon surgery surgical surmise surmount surname surpass surplus surprise surreal surrender surreptitious surrey surrogate surround surtax surtout surveillant survey surveyor survival survive survivor Sus Susan Susanne susceptible sushi Susie suspect suspend suspense suspension suspensor suspicion suspicious Sussex sustain sustenance Sutherland Sutton suture Suzanne suzerain suzerainty Suzuki svelte swab swabbing swabby swag Swahili swain swallow swallowtail swam swami swamp swampy swan swank swanky swanlike Swanson swap swapping swarm swart Swarthmore Swarthout swarthy swastika swat swatch swath swathe swatting sway Swaziland swear sweat sweatband sweater sweatshirt sweaty Swede Sweden Swedish Sweeney sweep sweepstake sweet sweetheart sweetish swell swelt swelter Swenson swept swerve swift swig swigging swim swimming swimsuit swindle swine swing swingable swingy swipe swirl swirly swish swishy swiss switch switchblade switchboard switchgear switchman Switzer Switzerland swivel swizzle swollen swoop sword swordfish swordplay swordtail swore sworn swum swung sybarite Sybil sycamore sycophant sycophantic Sydney syenite Sykes syllabic syllabify syllable syllogism syllogistic sylvan Sylvania Sylvester Sylvia symbiosis symbiotic symbol symbolic symmetric symmetry sympathetic sympathy symphonic symphony symposia symposium symptom symptomatic synagogue synapse synapses synaptic synchronism synchronous synchrony synchrotron syncopate syndic syndicate syndrome synergism synergistic synergy synod synonym synonymous synonymy synopses synopsis synoptic syntactic syntax synthesis synthetic Syracuse Syria syringa syringe syrinx syrup syrupy system systematic systemic systemization systemwide t tab tabbing tabernacle table tableau tableaux tablecloth tableland tablespoon tablespoonful tablet tabloid taboo tabu tabula tabular tabulate tachinid tachometer tacit Tacitus tack tackle tacky Tacoma tact tactful tactic tactile tactual tad tadpole taffeta taffy taft tag tagging Tahiti Tahoe tail tailgate tailor taint Taipei Taiwan take taken takeoff takeover talc talcum tale talent talisman talismanic talk talkative talkie talky tall Tallahassee tallow tally tallyho Talmud talon talus tam tamale tamarack tamarind tambourine tame Tammany tamp Tampa tampon tan tanager Tanaka Tananarive tandem tang tangent tangential tangerine tangible tangle tango tangy tanh tank tannin tanning tansy tantalum Tantalus tantamount tantrum Tanya Tanzania tao Taoist Taos tap tapa tape taper tapestry tapeworm tapir tapis tappa tappet tapping tar tara tarantara tarantula Tarbell tardy target tariff tarnish tarpaper tarpaulin tarpon tarring tarry Tarrytown tart tartar Tartary Tarzan task taskmaster Tasmania Tass tassel taste tasteful tasting tasty tat tate tater tatting tattle tattler tattletale tattoo tatty tau taught taunt Taurus taut tautology tavern taverna tawdry tawny tax taxation taxi taxicab taxied taxonomy taxpayer taxpaying Taylor tea teacart teach teacup teahouse teakettle teakwood teal team teammate teamster teamwork teapot tear teardrop tearful tease teasel teaspoon teaspoonful teat tech technetium technic technician technique technology tectonic tecum ted tedding Teddy tedious tedium tee teeing teem teen teenage teensy teet teeth teethe teetotal Teflon Tegucigalpa Teheran Tehran tektite Tektronix telecommunicate teleconference Teledyne Telefunken telegram telegraph telegraphy telekinesis telemeter telemetric telemetry teleology teleost telepathic telepathy telephone telephonic telephony telephotography teleprinter teleprocessing teleprompter telescope telescopic teletype teletypesetting teletypewrite televise television Telex tell teller tellurium temerity temper tempera temperance temperate temperature tempest tempestuous template temple Templeton tempo temporal temporary tempt temptation temptress ten tenable tenacious tenacity tenant tend tendency tenderfoot tenderloin tendon tenebrous tenement tenet tenfold Tenneco Tennessee Tenney tennis Tennyson tenon tenor tense tensile tension tensional tensor tenspot tent tentacle tentative tenth tenuous tenure tepee tepid teratogenic teratology terbium tercel Teresa term terminable terminal terminate termini terminology terminus termite tern ternary Terpsichore terpsichorean Terra terrace terrain terramycin terrapin Terre terrestrial terrible terrier terrific terrify territorial territory terror terry terse tertiary Tess tessellate test testament testamentary testate testes testicle testicular testify testimonial testimony testy tetanus tete tether tetrachloride tetrafluouride tetragonal tetrahedra tetrahedral tetrahedron tetravalent Teutonic Texaco Texan Texas text textbook textile Textron textual textural texture Thai Thailand Thalia thallium thallophyte than thank thankful thanksgiving that thatch that'd that'll thaw Thayer the Thea theatric Thebes thee theft their Thelma them thematic theme themselves then thence thenceforth theocracy Theodore Theodosian theologian theology theorem theoretic theoretician theorist theory therapeutic therapist therapy there thereabouts thereafter thereat thereby there'd therefor therefore therefrom therein there'll thereof thereon Theresa thereto theretofore thereunder thereupon therewith thermal thermionic thermistor thermo thermocouple thermodynamic thermoelastic thermoelectric Thermofax thermometer thermometric thermometry thermomigrate thermonuclear thermopile thermoplastic thermopower thermosetting thermostable thermostat thermostatic thesaurus these theses Theseus thesis thespian theta Thetis they they'd they'll they're they've thiamin thick thicken thicket thickish thief thieves thieving thigh thimble Thimbu thin thine thing think thinning thinnish thiocyanate thiouracil third thirst thirsty thirteen thirteenth thirtieth thirty this this'll thistle thistledown thither Thomas Thomistic Thompson Thomson thong Thor Thoreau thoriate thorium thorn Thornton thorny thorough thoroughbred thoroughfare thoroughgoing Thorpe Thorstein those thou though thought thoughtful thousand thousandth thrash thread threadbare threat threaten three threefold threesome thresh threshold threw thrice thrift thrifty thrill thrips thrive throat throaty throb throbbing throes thrombosis throne throng throttle through throughout throughput throw throwback thrown thrum thrumming thrush thrust Thruway Thuban thud thudding thug thuggee Thule thulium thumb thumbnail thump thunder thunderclap thunderflower thunderous thunderstorm Thurman Thursday thus thwack thwart thy thyratron thyroglobulin thyroid thyroidal thyronine thyrotoxic thyroxine ti Tiber tibet Tibetan tibia tic tick ticket tickle ticklish tid tidal tidbit tide tideland tidewater tidings tidy tie tied Tientsin tier Tiffany tift tiger tight tighten tigress Tigris til tilde tile till tilt tilth Tim timber timberland timbre time timeout timepiece timeshare timetable timeworn Timex timid Timon timothy tin tincture tinder tine tinfoil tinge tingle tinker tinkle tinning tinsel tint tintype tiny Tioga tip tipoff Tipperary tipping tipple tippy tipsy tiptoe tirade Tirana tire tiresome tissue tit Titan titanate titanic titanium tithe titian titillate title titmouse titrate titular Titus TNT to toad toady toast tobacco Tobago toccata today today'll Todd toddle toe toenail toffee tofu tog together togging toggle Togo togs toil toilet toilsome tokamak token Tokyo told Toledo tolerable tolerant tolerate toll tollgate tollhouse Tolstoy toluene Tom tomato tomatoes tomb tomblike tombstone tome Tomlinson Tommie tommy tomography tomorrow Tompkins ton tonal tone tong tongue Toni tonic tonight tonk tonnage tonsil tonsillitis tony too toodle took tool toolkit toolmake toolsmith toot tooth toothbrush toothpaste tootle top topaz topcoat Topeka topgallant topic topmost topnotch topocentric topography topology topping topple topsoil Topsy tor torah torch tore tori torn tornado toroid toroidal Toronto torpedo torpid torpor torque torr Torrance torrent torrid torsion torso tort tortoise tortoiseshell tortuous torture torus tory Toshiba toss tot total totalitarian tote totem totemic touch touchdown touchstone touchy tough tour tournament tousle tout tow toward towboat towel tower towhead towhee town townhouse Townsend townsman townsmen toxic toxi((cology toxin toy Toyota trace traceable tracery trachea track trackage tract tractor Tracy trade trademark tradeoff tradesman tradesmen tradition traffic trafficked trafficking trag tragedian tragedy tragic tragicomic trail trailside train trainee trainman trainmen traipse trait traitor traitorous trajectory tram trammel tramp trample tramway trance tranquil tranquillity transact transalpine transatlantic transceiver transcend transcendent transcendental transconductance transcontinental transcribe transcript transcription transducer transduction transect transept transfer transferee transference transferor transferral transferred transferring transfix transform transformation transfusable transfuse transfusion transgress transgression transgressor transient transistor transit Transite transition transitive transitory translate transliterate translucent transmissible transmission transmit transmittable transmittal transmittance transmitted transmitter transmitting transmutation transmute transoceanic transom transpacific transparent transpiration transpire transplant transplantation transport transportation transposable transpose transposition transship transshipping transversal transverse transvestite trap trapezium trapezoid trapezoidal trapping trash trashy Trastevere trauma traumatic travail travel travelogue traversable traversal traverse travertine travesty Travis trawl tray treacherous treachery tread treadle treadmill treason treasonous treasure treasury treat treatise treaty treble tree treelike treetop trefoil trek trekking trellis tremble tremendous tremor tremulous trench trenchant trencherman trenchermen trend trendy Trenton trepidation trespass tress trestle Trevelyan triable triad trial triangle triangular triangulate Triangulum Trianon triatomic tribal tribe tribesman tribesmen tribulate tribunal tribune tributary tribute Trichinella trichloroacetic trichloroethane trichrome trick trickery trickle trickster tricky trident tridiagonal tried triennial trifle trifluouride trig trigonal trigonometric trigonometry trigram trill trillion trilobite trilogy trim trimer trimester trimming Trinidad trinitarian trinity trinket trio triode trioxide trip tripartite tripe triphenylphosphine triple triplet Triplett triplex triplicate tripod tripoli tripping triptych trisodium Tristan tristate trisyllable trite tritium triton triumph triumphal triumphant triune trivalent trivia trivial trivium trod trodden troglodyte troika Trojan troll trolley trollop trombone trompe troop trophic trophy tropic tropopause troposphere tropospheric trot trotting trouble troubleshoot troublesome trough trounce troupe trouser trout Troutman troy truancy truant truce truck truculent trudge Trudy true truism truly Truman Trumbull trump trumpery trumpet truncate trundle trunk truss trust trustee trustful trustworthy truth truthful TRW try trypsin t's tsar tsarina tsunami TTL TTY tub tuba tube tuberculin tuberculosis tubular tubule tuck Tucson Tudor Tuesday tuff tuft tug tugging tuition Tulane tularemia tulip tulle Tulsa tum tumble tumbrel tumult tumultuous tun tuna tundra tune tuneful tung tungstate tungsten tunic Tunis Tunisia tunnel tupelo turban turbinate turbine turbofan turbojet turbulent turf Turin Turing turk turkey Turkish turmoil turn turnabout turnaround turnery turnip turnkey turnoff turnout turnover turnpike turnstone turntable turpentine turpitude turquoise turret turtle turtleback turtleneck turvy Tuscaloosa Tuscan Tuscany Tuscarora tusk Tuskegee tussle tutelage tutor tutorial Tuttle tutu tuxedo TV TVA TWA twaddle twain tweak tweed tweedy tweeze twelfth twelve twentieth twenty twice twiddle twig twigging twilight twill twin twine twinge twinkle twinning twirl twirly twist twisty twit twitch twitchy twitting two twofold Twombly twosome TWX Tyburn tycoon tying Tyler type typeface typescript typeset typesetter typesetting typewrite typewritten typhoid Typhon typhoon typhus typic typify typo typographer typography typology tyrannic tyrannicide tyranny tyrant tyrosine Tyson u ubiquitous ubiquity UCLA Uganda ugh ugly UK Ukrainian Ulan ulcer ulcerate Ullman Ulster ulterior ultimate ultimatum ultra ultracentrifuge ultraconservative ultrafast ultramarine ultramodern ultrashort ultrasonic ultrasound ultrastructure ultraviolet Ulysses umber umbilical umbilici umbilicus umbra umbrage umbrella umpire UN unanimity unanimous unary unbeknownst unbidden unchristian uncle uncouth unction under underclassman underclassmen underling undulate UNESCO uniaxial unicorn unidimensional unidirectional uniform unify unilateral unimodal uninominal union uniplex unipolar uniprocessor unique Uniroyal unison unit unitarian unitary unite unity Univac univalent univariate universal universe Unix unkempt unruly until unwieldy up upbeat upbraid upbring upcome update updraft upend upgrade upheaval upheld uphill uphold upholster upholstery upkeep upland uplift upon upper upperclassman upperclassmen uppercut uppermost upraise upright uprise upriver uproar uproarious uproot upset upsetting upshot upside upsilon upslope upstair upstand upstate upstater upstream upsurge upswing uptake Upton uptown uptrend upturn upward upwind urania uranium Uranus uranyl urban Urbana urbane urbanite urchin urea uremia urethane urethra urge urgency urgent urging urinal urinary urine Uris urn Ursa Ursula Ursuline Uruguay u's us USA usable USAF usage USC USC&GS USDA use useful USGS usher USIA USN USPS USSR usual usurer usurious usurp usurpation usury Utah utensil uterine Utica utile utilitarian utility utmost utopia utopian utter utterance uttermost v vacant vacate vacationland vaccinate vaccine vacillate vacua vacuo vacuolate vacuole vacuous vacuum vade Vaduz vagabond vagary vagina vaginal vagrant vague Vail vain vainglorious vale valedictorian valedictory valent valentine Valerie Valery valet valeur Valhalla valiant valid validate Valkyrie Valletta valley Valois valuate value valve vamp vampire van vanadium Vance Vancouver vandal Vandenberg Vanderbilt Vanderpoel vanguard vanilla vanish vanity vanquish vantage variable variac Varian variant variate variegate variety various varistor Varitype varnish vary vascular vase vassal vast vat Vatican vaudeville Vaudois Vaughan Vaughn vault veal vector vectorial Veda vee veer veery Vega vegetable vegetarian vegetate vehement vehicle vehicular veil vein Velasquez veldt Vella vellum velocity velours velvet velvety venal vend vendetta vendible vendor veneer venerable venerate venereal Venetian Veneto Venezuela vengeance vengeful venial Venice venison venom venomous vent ventilate ventricle venture venturesome venturi Venus Venusian Vera veracious veracity veranda verandah verb verbal verbatim verbena verbiage verbose verbosity verdant Verde Verdi verdict verge veridic verify verisimilitude veritable verity Verlag vermeil vermiculite vermilion vermin Vermont vermouth Verna vernacular vernal Verne vernier Vernon Verona Veronica versa Versailles versatile verse version versus vertebra vertebrae vertebral vertebrate vertex vertical vertices vertigo verve very vesicular vesper vessel vest vestal vestibule vestige vestigial vestry vet vetch veteran veterinarian veterinary veto vetting vex vexation vexatious vi via viaduct vial vibrant vibrate vibrato viburnum vicar vicarious vice vicelike viceroy Vichy vicinal vicinity vicious vicissitude Vicksburg Vicky victim victor Victoria Victorian victorious victory victrola victual Vida video videotape vie Vienna Viennese Vientiane Viet Vietnam Vietnamese view viewpoint vigil vigilant vigilante vigilantism vignette vigorous vii viii Viking vile vilify villa village villain villainous villein Vincent vindicate vindictive vine vinegar vineyard Vinson vintage vintner vinyl viola violate violent violet violin Virgil virgin virginal Virginia Virginian Virgo virgule virile virtual virtue virtuosi virtuosity virtuoso virtuous virulent virus vis visa visage viscera visceral viscoelastic viscometer viscosity viscount viscous vise viselike Vishnu visible Visigoth vision visionary visit visitation visitor visor vista visual vita vitae vital vitamin vitiate Vito vitreous vitrify vitriol vitriolic vitro viva vivace vivacious vivacity Vivaldi Vivian vivid vivify vivo vixen viz Vladimir Vladivostok vocable vocabularian vocabulary vocal vocalic vocate vociferous Vogel vogue voice voiceband void volatile volcanic volcanism volcano volition Volkswagen volley volleyball Volstead volt Volta voltage voltaic Voltaire Volterra voltmeter voluble volume volumetric voluminous voluntary volunteer voluptuous Volvo vomit von voodoo voracious voracity vortex vortices vorticity Voss votary vote votive vouch vouchsafe Vought vow vowel voyage Vreeland v's Vulcan vulgar vulnerable vulpine vulture vulturelike vying w Waals Wabash WAC wack wacke wacky Waco wad waddle wade wadi Wadsworth wafer waffle wag wage wagging waggle Wagner wagoneer wah Wahl wail wainscot Wainwright waist waistcoat waistline wait Waite waitress waive wake Wakefield wakeful waken wakerobin wakeup Walcott Walden Waldo Waldorf Waldron wale Walgreen walk walkie walkout walkover walkway wall wallaby Wallace wallboard Waller wallet Wallis wallop wallow wallpaper Walls wally walnut Walpole walrus Walsh Walt Walter Walters Waltham Walton waltz wan wand wander wane Wang wangle want wanton wapato wapiti Wappinger war warble ward warden wardrobe wardroom ware warehouse warehouseman warfare warhead Waring warlike warm warmhearted warmish warmonger warmth warmup warn warp warrant warranty warren warring warrior Warsaw wart wartime warty Warwick wary was wash washbasin washboard washbowl Washburn Washington washout washy wasn't wasp waspish Wasserman wast wastage waste wastebasket wasteful wasteland wastewater wastrel watch watchband watchdog watchful watchmake watchman watchmen watchword water Waterbury watercourse waterfall waterfront Watergate Waterhouse waterline Waterloo Waterman watermelon waterproof Waters watershed waterside Watertown waterway watery Watkins Watson watt wattage wattle Watts wave waveform wavefront waveguide wavelength wavenumber wavy wax waxen waxwork waxy way waybill waylaid waylay Wayne wayside wayward we weak weaken weal wealth wealthy wean weapon weaponry wear wearied wearisome weary wease((l weather weatherbeaten weatherproof weatherstrip weatherstripping weave web Webb webbing weber Webster WECo we'd wed wedding wedge wedlock Wednesday wee weed weedy week weekday weekend Weeks weep Wehr Wei Weierstrass weigh weight weighty Weinberg Weinstein weir weird Weiss Welch welcome weld Weldon welfare we'll well wellbeing Weller Welles Wellesley wellington Wells welsh welt Wendell Wendy went wept we're were weren't Werner wert Werther Wesley Wesleyan west westbound Westchester westerly western westernmost Westfield Westinghouse Westminster Weston westward wet wetland wetting we've Weyerhauser whack whale Whalen wham whamming wharf Wharton wharves what what'd whatever Whatley whatnot what're whatsoever wheat Wheatstone whee wheedle wheel wheelbase wheelchair wheelhouse wheeze wheezy Whelan whelk Wheller whelm whelp when whence whenever where whereabout whereas whereby where'd wherefore wherein whereof whereon where're wheresoever whereupon wherever wherewith whet whether whetting which whichever whiff whig while whim whimper whimsey whimsic whine whinny whip whiplash Whippany whippet whipping Whipple whipsaw whir whirl whirligig whirlpool whirlwind whirring whisk whisper whistle whistleable whit Whitaker Whitcomb white whiteface Whitehall whitehead Whitehorse whiten whitetail whitewash whither Whitlock Whitman Whitney Whittaker Whittier whiz whizzing who whoa who'd whoever whole wholehearted wholesale wholesome who'll wholly whom whomsoever whoop whoosh whop whopping whore whose whosoever whup why Wichita wick wicket wide widen widespread widgeon widget widow widowhood width widthwise wield wiener Wier wife wig wigging Wiggins wiggle wiggly wigmake Wilbur Wilcox wild wildcat wildcatter wilderness wildfire wildlife wile Wiley Wilfred wilful Wilhelm Wilhelmina Wilkes Wilkins Wilkinson will Willa Willard willful William Williams Williamsburg Williamson Willie Willis Willoughby willow willowy Wills Wilma Wilmington Wilshire Wilson Wilsonian wilt wily win wince winch Winchester wind windbag windbreak windfall windmill window windowpane windowsill windshield Windsor windstorm windup windward windy wine winemake winemaster winery wineskin Winfield wing wingback wingman wingmen wingspan wingtip Winifred wink winkle Winnetka Winnie winning Winnipeg Winnipesaukee winnow wino Winslow winsome Winston winter Winters wintertime Winthrop wintry winy wipe wire wireman wiremen wiry Wisconsin wisdom wise wiseacre wisecrack wisenheimer wish wishbone wishful wishy wisp wispy wistful wit witch witchcraft with withal withdraw withdrawal withdrawn withdrew withe wither withheld withhold within without withstand withstood withy witness Witt witting witty wive wizard wobble woe woebegone woeful wok woke Wolcott wold wolf Wolfe Wolff Wolfgang wolfish wolve woman womanhood womb women won wonder wonderful wonderland wondrous Wong won't wont woo wood Woodard Woodbury woodcarver woodcock woodcut wooden woodgrain woodhen woodland Woodlawn woodlot woodpeck woodrow woodruff Woods woodshed woodside woodward woodwind woodwork woody woodyard wool woolen woolgather Woolworth Wooster wop Worcester word Wordsworth wordy wore work workbench workday workhorse workload workman workmanlike workmen workout workpiece worksheet workshop workspace worktable world worldwide worm wormy worn worrisome worry worse worsen worship worshipful worst worth Worthington worthwhile worthy Wotan would wouldn't wound wove woven wow wrack wraith wrangle wrap wrapping wrapup wrath wrathful wreak wreath wreathe wreck wreckage wrench wrest wrestle wretch wriggle wright Wrigley wring wrinkle wrist wristband wristwatch writ write writeup writhe written wrong wrongdoer wrongdoing wrongful Wronskian wrote wrought wry w's Wu Wuhan Wyandotte Wyatt Wyeth Wylie Wyman Wyner wynn Wyoming x Xavier xenon xenophobia xerography Xerox Xerxes xi x's xylem xylene xylophone y yacht yachtsman yachtsmen yah yak Yakima Yale Yalta yam Yamaha yang yank Yankee Yankton Yaounde yap yapping Yaqui yard yardage yardstick Yarmouth yarmulke yarn yarrow Yates yaw yawl yawn ye yea Yeager yeah year yearbook yearn yeast yeasty Yeats yell yellow yellowish Yellowknife yelp Yemen yen yeoman yeomanry yeshiva yesterday yesteryear yet Yiddish yield yin yip yipping YMCA yodel Yoder yoga yogi yoke yokel Yokohama Yokuts yolk yon yond Yonkers yore York Yorktown Yosemite Yost you you'd you'll young youngish youngster Youngstown your you're yourself yourselves youth youthful you've yow Ypsilanti y's ytterbium yttrium Yucatan yucca Yugoslav Yugoslavia yuh Yuki Yukon yule Yves Yvette YWCA z Zachary zag zagging Zaire Zambia Zan Zanzibar zap zapping zeal Zealand zealot zealous zebra Zeiss Zellerbach Zen zenith zero zeroes zeroth zest zesty zeta Zeus Ziegler zig zigging zigzag zigzagging zilch Zimmerman zinc zing Zion Zionism zip zipping zircon zirconium zloty zodiac zodiacal Zoe Zomba zombie zone zoo zoology zoom Zoroaster Zoroastrian zounds z's Zurich lf yourselves youth youthful you've yow Ypsilanti y's ytterbium yttrium Yucatan yucca Yugoslav Yugoslavia yuh Yuki Yukon yule Yves Yvette YWCA z Zachary zag zagging Zaire Zambia Zan Zaguest/ 775 10 33 0 2552547747 5141 guest/.cshrc 644 0 33 1711 2523673305 6272 set history=40 set cdpath=(/usr/sys /usr/src/cmd) set sys=/usr/sys alias sd 'sccs get -p \!* | diff - \!$' alias sgrind 'vgrind `sccs info | sed s/:.\*// | sed s/\ \*// | sort`' alias ec \ 'echo \!-1:q > /tmp/$$ ; vi /tmp/$$ ; typein `cat /tmp/$$` ; rm /tmp/$$' alias cd 'set old=$cwd; chdir \!*' alias back 'set back=$old; set old=$cwd; cd $back; unset back; dirs' alias dm tail -r /usr/adm/messages alias uu tail -r /usr/spool/uucp/LOGFILE alias info sccs info alias co sccs get -e alias ci sccs delget alias allout "(cd $sys; echo */SCCS/p.*|sed s/SCCS\\/p.//g)" alias out "echo SCCS/p.*|sed s/SCCS\\/p.//g" alias cot set x=\`fgrep ^\!^\ tags \| \ awk \' { print \$2 \;}\'\` \; \ co \$x \; vit \!^ \; unset x alias md 'make \!* >& make.out &' alias netall 'tar cf - \!:2* | net - "mkdir \!^;cd \!^;tar xf -"' alias print netlpr -c vpr alias vit vi -t \!\* alias c /bin/cat alias h history alias vt52 "set term vt52" alias la36 "set term la36" sccs info alias co sccs get -e alias ci sccs delget aguest/.login 644 0 33 372 2506516657 6271 set path=(/usr/ucb /bin /usr/bin /usr/local /usr/games .) setenv EXINIT 'se ai shell=/bin/csh terse nowarn sm' set ignoreeof time=15 alias ts \ 'set noglob; eval `tset -s vt100`' alias . logout ts; stty dec crt; biff y uptime alias . exec /bin/date &' alias netall 'tar cf - \!:2* | net - "mkdir \!^;cd \!^;tar xf -"' alias print netlpr -c vpr alias vit vi -t \!\* alias c /bin/cat alias h history alias vt52 "set t/pT,pT5ć /,"guest/.plan 644 0 33 455 2523673554 6114 Bill Joy: Phone: (415) 642-7780 U.S.Mail: EECS/CS Division Evans Hall University of California Berkeley CA 94720 Armando Stetner: Phone: (603) 884-5485 U.S.Mail: Digital Equipment Corp. Continental Blvd MK1-1/D29 Merrimack New Hampshire, 03054 ^;cd \!^;tar xf -"' alias print netlpr -c vpr alias vit vi -t \!\* alias c /bin/cat alias h history alias vt52 "set t/pT,pT5ԇ /,"guest/sizes.c 644 0 33 5143 2514500771 6467 #include #include #include #include #include #define N 6 struct filsys filsys; int counts[10000]; int blocks; int totsz[N+1] = { 1,512,1024,2048,4096,1024,512 }; int indsz[N+1] = { 0,512*512/4,1024*1024/4, 2048*2048/4, 4096*4096/4,1024*1024/4,512*512/4}; int cnt1,cnt8, cnt51, cnt58; main(argc, argv) char **argv; { char inobuf[BSIZE*60]; ino_t inum, tino; register struct dinode *dp; int nleft, f; int tot[N+1]; argc--, argv++; if (arg((c==0) fprintf(stderr, "sizes filsys\n"), exit(1); f = open(*argv, 0); if (f < 0) perror(*argv), exit(1); lseek(f, BSIZE, 0); read(f, &filsys, sizeof (struct filsys)); lseek(f, 2*BSIZE, 0); tino = (filsys.s_isize-2) * (BSIZE / sizeof (struct dinode)) + 1; printf("tino %d\n", tino); nleft = 0; for (inum = 1; inum < tino; inum++) { if (nleft == 0) { read(f, inobuf, sizeof (inobuf)); nleft = (BSIZE * 60) / sizeof (struct dinode); dp = (struct dinode *)&inobuf; } else { --nleft; dp++; } if (dp->di_mode) { register int i; blocks = dp->di_size / 512; for (i = 0; i < N-1; i++) { tot[i] += (dp->di_size+totsz[i]-1)/totsz[i]; if (i && dp->di_size > totsz[i] * 10) tot[i] += (dp->di_size-totsz[i]*10+indsz[i]-1)/indsz[i]; } if (dp->di_size < 24*1024) { tot[N] += (dp->di_size+511)/512; cnt51 += (dp->di_size+511)/512; if (dp->di_size > totsz[i] * 8) tot[N] += (dp->di_size-totsz[N]*8+indsz[N]-1)/indsz[N]; } else { tot[N] += 8*((dp->di_size+4095)/4096) + (dp->di_size-totsz[N]*8+indsz[N]-1)/indsz[N]; cnt58 += ((dp->di_size+4095)/4096)*8; cnt58 -= 6; cnt51 += 48; } if (dp->di_size < 24*1024) { tot[N-1] += (dp->di_size+1023)/1024; cnt1 += (dp->di_size+1023)/1024; if (dp->di_size > totsz[i] * 8) tot[N-1] += (dp->di_size-totsz[N-1]*8+indsz[N-1]-1)/indsz[N-1]; } else { tot[N-1] += 8*((dp->di_size+8191)/8192) + (dp->di_size-totsz[N-1]*8+indsz[N-1]-1)/indsz[N-1]; cnt8 += ((dp->di_size+8191)/8192)*8; cnt8 -= 3; cnt1 += 24; } if (blocks >= 0 && blocks < 10000) counts[blocks]++; else printf("lost inum %d size %d\n", inum, dp->di_size); } } for (blocks = 0; blocks < 10000; blocks++) if (counts[blocks]) printf("%d\t%d\n", blocks, counts[blocks]); printf("size\tspace\t\tratio\tblocks\n"); for (blocks = 0; blocks < N+1; blocks++) printf("%d\t%d\t%7.4f\t%d\n", totsz[blocks], tot[blocks]*totsz[blocks], ((float)tot[blocks])*totsz[blocks]/(float)tot[0], tot[blocks]); printf("cnt1=%d, cnt8=%d\n", cnt1, cnt8); printf("cnt51=%d, cnt58=%d\n", cnt51, cnt58); } ; else printf("lost inum %d size %d\n", inum, dp->di_size); } } for (blocks = 0; blocks < 10000; blocks++) if (counts[blocks]) printf("%d\t%d\n", blocks, counts[blocks]); printf("size\tspace\t\tratio\tblocks\n"); for (blocks = 0; blocks < N+1; blocks++) printf("%d\t%d\t%7.4f\t%d\n", totsz[blocks], tot[blocks]*totsz[blocks], ((float)tot[blocks])*totsz[blocks]/(float)tot[0], tot[bloguest/typein 755 0 33 11461 2514500771 6444 p^Юn PPՀPpPP P12 ]PPݏt]P(`]PPݏ t׬լEм[[k[ݏrtq[ѬݏݏrtR׬ ]PPݏ t4]PPݏt ^186P9P^Ь[ PPYYX1XX߭ ~PYj~P  BЫZ֫ZPѫPѬ ZPPXPZ ~RPYZkn 1mЫZ3[1xݏPZZ  YYX ZYYXZYZ ~PY2kZXY 1ЬPЬ[ PʏPP@ЫZ:ZY3Z P2PPkYZ ~PY PPN[ [[[x Ь[Z < 7[gPZ ~-PZ ݫ ԫ kZPP^߭ݬ$PPPݬݏ tݬݬݏtݬ.P L ~*PY}[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ> [L P0YPƏPxPbPZxPZPPZx~@PZZZPZPxPZPPjjL 1xYP[PZy|kmfk[P Ь[[ZZZMjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j~\S^\WP;ЬoPЬPЬRRQ{RPPR PRPP p p H p <   ((1 4:,A,I<R\Ybip x ~~<r( h f4 .3< p LXH ;,y p r\ &7/ p49crt0.oexittypein.oexit.oioctl.ocerror.oflsbuf.odata.oclose.oisatty.ostty.omalloc.osbrk.oudiv.owrite.o_exitstart_main_environ_ioctl__cleanupcerror_errno__flsbuf_write__iob_isatty__sobuf_malloc_fflush_fclose__lastbuf_close_free__sibuf_gtty_sttyudiv_sbrk_realloc_end_brk.3< p LXH ;,y p r\ &7/ p49crt0guest/typein.c 644 0 33 730 2514500771 6617 #include #include main(argc, argv) int argc; char **argv; { register char *cp; struct sgttyb stb, stb2; int pendin = LPENDIN; ioctl(2, TIOCGETP, &stb); stb2 = stb; stb.sg_flags &= ~ECHO; ioctl(2, TIOCSETN, &stb); for (argc--, argv++; argc > 0; argc--, argv++) { for (cp = *argv; cp && *cp; cp++) ioctl(2, TIOCSTI, cp); if (argc > 1) ioctl(2, TIOCSTI, " "); } ioctl(2, TIOCSETN, &stb2); ioctl(2, TIOCLBIS, &pendin); exit(0); } /,"include/ 775 0 33 0 2552567016 5403 include/local/ 775 0 33 0 2510246623 6465 ((include/local/uparm.h 644 0 33 330 2423036137 10021 #define libpath(file) "/usr/lib/file" #define loclibpath(file) "/usr/local/lib/file" #define binpath(file) "/usr/ucb/file" #define usrpath(file) "/usr/file" #define E_TERMCAP "/etc/termcap" #define B_CSH "/bin/csh" Proc. 4th ACM Symp. on Principles of Programming Languages %P 21-28 %D January 1977 llman %T The Generation of Optimal Code for Arithmetic Expressions %J J. Assoc. Comp. Mach. %K jacm %V /0 C. /\@,\D"include/sys/ 775 0 33 0 2552566514 6223 include/sys/acct.h 444 0 33 1445 2531445224 7362 /* acct.h 4.3 81/03/09 */ /* * Accounting structures; * these use a comp_t type which is a 3 bits base 8 * exponent, 13 bit fraction ``floating point'' number. */ typedef u_short comp_t; struct acct { char ac_comm[10]; /* Accounting command name */ comp_t ac_utime; /* Accounting user time */ comp_t ac_stime; /* Accounting system time */ comp_t ac_etime; /* Accounting elapsed time */ time_t ac_btime; /* Beginning time */ short ac_uid; /* Accounting user ID */ short ac_gid; /* Accounting group ID */ short ac_mem; /* average memory usage */ comp_t ac_io; /* number of disk IO blocks */ dev_t ac_tty; /* control typewriter */ char ac_flag; /* Accounting flag */ }; #define AFORK 01 /* has executed fork, but no exec */ #define ASU 02 /* used super-user privileges */ r time */ comp_t ac_stime; /* Accounting system time */ comp_t ac_etime; /* Accounting elapsed time */ time_t ac_btime; /* Beginning time */ short ac_uid; /* Accounting user ID */ short ac_gid; /* Accountinginclude/sys/bk.h 444 0 33 717 2531445224 7025 /* bk.h 4.2 81/02/19 */ /* * Macro definition of bk.c/netinput(). * This is used to replace a call to * (*linesw[tp->t_line].l_rint)(c,tp); * with * * if (tp->t_line == NETLDISC) * BKINPUT(c, tp); * else * (*linesw[tp->t_line].l_rint)(c,tp); */ #define BKINPUT(c, tp) { \ if ((tp)->t_rec == 0) { \ *(tp)->t_cp++ = c; \ if (++(tp)->t_inbuf == BSIZE || (c) == '\n') { \ (tp)->t_rec = 1; \ wakeup((caddr_t)&(tp)->t_rawq); \ } \ } \ }  /\@,\D"include/sys/buf.h 444 0 33 10365 2531445225 7246 /* buf.h 4.13 81/05/09 */ /* * The header for buffers in the buffer pool and otherwise used * to describe a block i/o request is given here. The routines * which manipulate these things are given in bio.c. * * Each buffer in the pool is usually doubly linked into 2 lists: * hashed into a chain by so it can be located in the cache, * and (usually) on (one of several) queues. These lists are circular and * doubly linked for easy removal. * * There are currently three queues for buffers: * one for buffers which must be kept permanently (super blocks) * one for buffers containing ``useful'' information (the cache) * one for buffers containing ``non-useful'' information * (and empty buffers, pushed onto the front) * The latter two queues contain the buffers which are available for * reallocation, are kept in lru order. When not on one of these queues, * the buffers are ``checked out'' to drivers which use the available list * pointers to keep track of them in their i/o active queues. */ /* * Bufhd structures used at the head of the hashed buffer queues. * We only need three words for these, so this abbreviated * definition saves some space. */ struct bufhd { long b_flags; /* see defines below */ struct buf *b_forw, *b_back; /* fwd/bkwd pointer in chain */ }; struct buf { long b_flags; /* too much goes here to describe */ struct buf *b_forw, *b_back; /* hash chain (2 way street) */ struct buf *av_forw, *av_back; /* position on free list if not BUSY */ #define b_actf av_forw /* alternate names for driver queue */ #define b_actl av_back /* head - isn't history wonderful */ long b_bcount; /* transfer count */ #define b_active b_bcount /* driver queue head: drive active */ short b_error; /* returned after I/O */ dev_t b_dev; /* major+minor device name */ union { caddr_t b_addr; /* low order core address */ int *b_words; /* words for clearing */ struct filsys *b_filsys; /* superblocks */ struct dinode *b_dino; /* ilist */ daddr_t *b_daddr; /* indirect block */ } b_un; daddr_t b_blkno; /* block # on device */ long b_resid; /* words not transferred after error */ #define b_errcnt b_resid /* while i/o in progress: # retries */ #define b_pfcent b_resid /* garbage: don't ask */ struct proc *b_proc; /* proc doing physical or swap I/O */ }; #define BQUEUES 3 /* number of free buffer queues */ #define BQ_LOCKED 0 /* super-blocks &c */ #define BQ_LRU 1 /* lru, useful buffers */ #define BQ_AGE 2 /* rubbish */ #ifdef KERNEL struct buf *buf; /* the buffer pool itself */ char *buffers; int nbuf; struct buf *swbuf; /* swap I/O headers */ int nswbuf; short *swsize; int *swpf; struct buf bfreelist[BQUEUES]; /* heads of available lists */ struct buf bswlist; /* head of free swap header list */ struct buf *bclnlist; /* head of cleaned page list */ struct buf *alloc(); struct buf *baddr(); struct buf *getblk(); struct buf *geteblk(); struct buf *bread(); struct buf *breada(); unsigned minphys(); #endif /* * These flags are kept in b_flags. */ #define B_WRITE 0x000000 /* non-read pseudo-flag */ #define B_READ 0x000001 /* read when I/O occurs */ #define B_DONE 0x000002 /* transaction finished */ #define B_ERROR 0x000004 /* transaction aborted */ #define B_BUSY 0x000008 /* not on av_forw/back list */ #define B_PHYS 0x000010 /* physical IO */ #define B_XXX 0x000020 /* was B_MAP, alloc UNIBUS on pdp-11 */ #define B_WANTED 0x000040 /* issue wakeup when BUSY goes off */ #define B_AGE 0x000080 /* delayed write for correct aging */ #define B_ASYNC 0x000100 /* don't wait for I/O completion */ #define B_DELWRI 0x000200 /* write at exit of avail list */ #define B_TAPE 0x000400 /* this is a magtape (no bdwrite) */ #define B_UAREA 0x000800 /* add u-area to a swap operation */ #define B_PAGET 0x001000 /* page in/out of page table space */ #define B_DIRTY 0x002000 /* dirty page to be pushed out async */ #define B_PGIN 0x004000 /* pagein op, so swap() can count it */ #define B_CACHE 0x008000 /* did bread find us in the cache ? */ #define B_INVAL 0x010000 /* does not contain valid info */ #define B_LOCKED 0x020000 /* locked in core (not reusable) */ #define B_HEAD 0x040000 /* a buffer header, not a buffer */ #define B_BAD 0x100000 /* bad block revectoring in progress */ */ #define B_PAGET 0x001000 /* page in/out of page table space */ #define B_DIRTY 0x002000 /* dirty page to be pushed out async */ #define B_PGIN 0x004000 /* pagein op, so swap() can count it */ #define B_CACHE 0x008000 /* did bread find us in the cache ? */ #deinclude/sys/callout.h 444 0 33 770 2531445225 10074 /* callout.h 4.6 81/04/18 */ /* * The callout structure is for * a routine arranging * to be called by the clock interrupt * (clock.c) with a specified argument, * in a specified amount of time. * Used, for example, to time tab * delays on typewriters. */ struct callout { int c_time; /* incremental time */ caddr_t c_arg; /* argument to routine */ int (*c_func)(); /* routine */ struct callout *c_next; }; #ifdef KERNEL struct callout *callfree, *callout, calltodo; int ncallout; #endif D"((include/sys/mx.h 444 0 33 4244 2531445236 7077 /* mx.h 4.3 81/02/25 */ #define NGROUPS 10 /* number of mpx files permitted at one time */ #define NCHANS 20 /* number of channel structures */ #define NPORTS 30 /* number of channels to i/o ports */ #define CNTLSIZ 10 #define NLEVELS 4 #define NMSIZE 50 /* max size of mxlstn file name */ /* * header returned on read of mpx */ struct rh { short index; short count; short ccount; }; /* * head expected on write of mpx */ struct wh { short index; short count; short ccount; char *data; }; struct mx_args { char *m_name; int m_cmd; int m_arg[3]; }; #ifdef KERNEL /* * internal structure for channel */ struct chan { short c_flags; char c_index; char c_line; struct group *c_group; struct file *c_fy; struct tty *c_ttyp; struct clist c_ctlx; int c_pgrp; struct tty *c_ottyp; char c_oline; union { struct clist datq; } cx; union { struct clist datq; struct chan *c_chan; } cy; struct clist c_ctly; }; struct schan { short c_flags; char c_index; char c_line; struct group *c_group; struct file *c_fy; struct tty *c_ttyp; struct clist c_ctlx; int c_pgrp; }; /* * flags */ #define INUSE 01 #define SIOCTL 02 #define XGRP 04 #define YGRP 010 #define WCLOSE 020 #define ISGRP 0100 #define BLOCK 0200 #define EOTMARK 0400 #define SIGBLK 01000 #define BLKMSG 01000 #define ENAMSG 02000 #define WFLUSH 04000 #define NMBUF 010000 #define PORT 020000 #define ALT 040000 #define FBLOCK 0100000 #endif /* * mpxchan command codes */ #define MPX 5 #define MPXN 6 #define CHAN 1 #define JOIN 2 #define EXTR 3 #define ATTACH 4 #define CONNECT 7 #define DETACH 8 #define DISCON 9 #define DEBUG 10 #define NPGRP 11 #define CSIG 12 #define PACK 13 #define NDEBUGS 30 /* * control channel message codes */ #define M_WATCH 1 #define M_CLOSE 2 #define M_EOT 3 #define M_OPEN 4 #define M_BLK 5 #define M_UBLK 6 #define DO_BLK 7 #define DO_UBLK 8 #define M_IOCTL 12 #define M_IOANS 13 #define M_SIG 14 /* * debug codes other than mpxchan cmds */ #define MCCLOSE 29 #define MCOPEN 28 #define ALL 27 #define SCON 26 #define MSREAD 25 #define SDATA 24 #define MCREAD 23 #define MCWRITE 22 /* mux io controls */ #define MXLSTN (('x'<<8)|1) #define MXNBLK (('x'<<8)|2) e NDEBUGS 30 /* * control channel message codes */ #define M_WATCH 1 #define M_CLOSE 2 #define M_EOT 3 #define M_OPEN 4 #define M_BLK 5 #define M_UBLK 6 #define DO_BLK 7 #define DO_UBLK 8 #define M_IOCTL 12 #define M_IOANS 13 #define M_SIG 14 /* * debug codes other than mpxchan cmds */ #define MCCLOSE 29 #define MCOPEN 28 #define ALL 27 #definclude/sys/nexus.h 444 0 33 4540 2531445237 7615 /* nexus.h 4.10 81/04/03 */ /* * Information about nexus's. * * Each machine has an address of backplane slots (nexi). * Each nexus is some type of adapter, whose code is the low * byte of the first word of the adapter address space. * At boot time the system looks through the array of available * slots and finds the interconnects for the machine. */ #if VAX780 #define NNEX780 16 #define NEX780 ((struct nexus *)0x20000000) #endif #if VAX750 #define NNEX750 16 #define NEX750 ((struct nexus *)0xf20000) #endif #if VAX7ZZ #define NNEX7ZZ 16 #define NEX7ZZ ((struct nexus *)0xf20000) #endif #define NEXSIZE 0x2000 #define MAXNNEXUS 16 #ifndef LOCORE struct nexus { union nexcsr { long nex_csr; u_char nex_type; } nexcsr; long nex_pad[NEXSIZE / sizeof (long) - 1]; }; #ifdef KERNEL struct nexus nexus[MAXNNEXUS]; #endif #endif /* * Bits in high word of nexus's. */ #define SBI_PARFLT (1<<31) /* sbi parity fault */ #define SBI_WSQFLT (1<<30) /* write sequence fault */ #define SBI_URDFLT (1<<29) /* unexpected read data fault */ #define SBI_ISQFLT (1<<28) /* interlock sequence fault */ #define SBI_MXTFLT (1<<27) /* multiple transmitter fault */ #define SBI_XMTFLT (1<<26) /* transmit fault */ #define NEX_CFGFLT (0xfc000000) #ifndef LOCORE #if VAX780 #define NEXFLT_BITS \ "\20\40PARFLT\37WSQFLT\36URDFLT\35ISQFLT\34MXTFLT\33XMTFLT" #endif #endif #define NEX_APD (1<<23) /* adaptor power down */ #define NEX_APU (1<<22) /* adaptor power up */ #define MBA_OT (1<<21) /* overtemperature */ #define UBA_UBINIT (1<<18) /* unibus init */ #define UBA_UBPDN (1<<17) /* unibus power down */ #define UBA_UBIC (1<<16) /* unibus initialization complete */ /* * Types for nex_type. */ #define NEX_ANY 0 /* pseudo for handling 11/750 */ #define NEX_MEM4 0x08 /* 4K chips, non-interleaved mem */ #define NEX_MEM4I 0x09 /* 4K chips, interleaved mem */ #define NEX_MEM16 0x10 /* 16K chips, non-interleaved mem */ #define NEX_MEM16I 0x11 /* 16K chips, interleaved mem */ #define NEX_MBA 0x20 /* Massbus adaptor */ #define NEX_UBA0 0x28 /* Unibus adaptor */ #define NEX_UBA1 0x29 /* 4 flavours for 4 addr spaces */ #define NEX_UBA2 0x2a #define NEX_UBA3 0x2b #define NEX_DR32 0x30 /* DR32 user i'face to SBI */ #define NEX_MPM0 0x40 /* Multi-port mem */ #define NEX_MPM1 0x41 /* Who knows why 4 different ones ? */ #define NEX_MPM2 0x42 #define NEX_MPM3 0x43 define NEX_MEM16 0x10 /* 16K chips, non-interleaved mem */ #define NEX_MEM16I 0x11 /* 16K chips, interleaved mem */ #define NEX_MBA 0x20 /* Massbus adaptor include/sys/param.h 444 0 33 11163 2552566433 7577 /* param.h 4.12 81/06/11 */ /* * Tunable variables which do not usually vary per system. * * The sizes of most system tables are configured * into each system description. The file system buffer * cache size is assigned based on available memory. * The tables whose sizes don't vary often are given here. */ #define NMOUNT 15 /* number of mountable file systems */ #define MSWAPX 15 /* pseudo mount table index for swapdev */ #define MAXUPRC 25 /* max processes per user */ #define SSIZE 4 /* initial stack size (*512 bytes) */ #define SINCR 4 /* increment of stack (*512 bytes) */ #define NOFILE 20 /* max open files per process */ /* NOFILE MUST NOT BE >= 31; SEE pte.h */ #define CANBSIZ 256 /* max size of typewriter line */ #define NCARGS 10240 /* # characters in exec arglist */ /* * priorities * probably should not be * altered too much */ #define PSWP 0 #define PINOD 10 #define PRIBIO 20 #define PRIUBA 24 #define PZERO 25 #define PPIPE 26 #define PWAIT 30 #define PSLEP 40 #define PUSER 50 #define NZERO 20 /* * signals * dont change */ #ifndef NSIG #include #endif /* * Return values from tsleep(). */ #define TS_OK 0 /* normal wakeup */ #define TS_TIME 1 /* timed-out wakeup */ #define TS_SIG 2 /* asynchronous signal wakeup */ /* * fundamental constants of the implementation-- * cannot be changed easily. */ #define NBBY 8 /* number of bits in a byte */ #define NBPW sizeof(int) /* number of bytes in an integer */ #define NBPG 512 #define PGOFSET (NBPG-1) /* byte offset into page */ #define PGSHIFT 9 /* LOG2(NBPG) */ #define UPAGES 8 /* pages of u-area */ #define NULL 0 #define CMASK 0 /* default mask for file creation */ #define NODEV (dev_t)(-1) #define ROOTINO ((ino_t)2) /* i number of all roots */ #define SUPERB ((daddr_t)1) /* block number of the super block */ #define DIRSIZ 14 /* max characters per directory */ /* * Clustering of hardware pages on machines with ridiculously small * page sizes is done here. The paging subsystem deals with units of * CLSIZE pte's describing NBPG (from vm.h) pages each... BSIZE must * be CLSIZE*NBPG in the current implementation, that is the paging subsystem * deals with the same size blocks that the file system uses. * * NOTE: SSIZE, SINCR and UPAGES must be multiples of CLSIZE */ #define CLSIZE 2 #define CLOFSET (CLSIZE*NBPG-1) /* for clusters, like PGOFSET */ /* give the base virtual address (first of CLSIZE) */ #define clbase(i) ((i) &~ (CLSIZE-1)) /* round a number of clicks up to a whole cluster */ #define clrnd(i) (((i) + (CLSIZE-1)) &~ (CLSIZE-1)) #if CLSIZE==1 #define BSIZE 512 /* size of secondary block (bytes) */ #define INOPB 8 /* 8 inodes per block */ #define BMASK 0777 /* BSIZE-1 */ #define BSHIFT 9 /* LOG2(BSIZE) */ #define NMASK 0177 /* NINDIR-1 */ #define NSHIFT 7 /* LOG2(NINDIR) */ #define NICINOD 100 /* number of superblock inodes */ #define NICFREE 50 /* number of superblock free blocks */ #endif #if CLSIZE==2 #define BSIZE 1024 #define INOPB 16 #define BMASK 01777 #define BSHIFT 10 #define NMASK 0377 #define NSHIFT 8 #define NICINOD 100 #define NICFREE 178 #endif #if CLSIZE==4 #define BSIZE 2048 #define INOPB 32 #define BMASK 03777 #define BSHIFT 11 #define NMASK 0777 #define NSHIFT 9 #define NICINOD 100 #define NICFREE 434 #endif #ifndef INTRLVE /* macros replacing interleaving functions */ #define dkblock(bp) ((bp)->b_blkno) #define dkunit(bp) (minor((bp)->b_dev) >> 3) #endif /* inumber to disk address and inumber to disk offset */ #define itod(x) ((daddr_t)((((unsigned)(x)+2*INOPB((-1)/INOPB))) #define itoo(x) ((int)(((x)+2*INOPB-1)%INOPB)) /* file system blocks to disk blocks and back */ #define fsbtodb(b) ((b)*CLSIZE) #define dbtofsb(b) ((b)/CLSIZE) #define NINDIR (BSIZE/sizeof(daddr_t)) #define CBSIZE 28 /* number of chars in a clist block */ #define CROUND 0x1F /* clist rounding; sizeof(int *) + CBSIZE -1*/ /* * Macros for fast min/max */ #define MIN(a,b) (((a)<(b))?(a):(b)) #define MAX(a,b) (((a)>(b))?(a):(b)) /* * Some macros for units conversion */ /* Core clicks (512 bytes) to segments and vice versa */ #define ctos(x) (x) #define stoc(x) (x) /* Core clicks (512 bytes) to disk blocks */ #define ctod(x) (x) /* clicks to bytes */ #define ctob(x) ((x)<<9) /* bytes to clicks */ #define btoc(x) ((((unsigned)(x)+511)>>9)) #ifndef KERNEL #include #else #include "../h/types.h" #endif /* * Machine-dependent bits and macros */ #define UMODE PSL_CURMOD /* usermode bits */ #define USERMODE(ps) (((ps) & UMODE) == UMODE) #define BASEPRI(ps) (((ps) & PSL_IPL) != 0) /* * Provide about n microseconds of delay */ #define DELAY(n) { register int N = (n); while (--N > 0); } blocks */ #define ctod(x) (x) /* clicks to bytes */ #define ctob(x) ((x)<<9) /* bytes to clicks */ #define btoc(x) ((((unsigned)(x)+511)>>9)) #ifndef KERNEL #include #else #include "../h/types.h" #endif /* * Machine-dependent bits and macros */ #define UMODE PSL_CURMOD /* usermode bits */ #define USERMODE(ps) (((ps) & UMODE) == UMODE) #define BASEPRI(ps) (((ps) & PSL_IPL) include/sys/clist.h 444 0 33 370 2531445225 7543 /* clist.h 4.4 81/03/09 */ /* * Raw structures for the character list routines. */ struct cblock { struct cblock *c_next; char c_info[CBSIZE]; }; #ifdef KERNEL struct cblock *cfree; int nclist; struct cblock *cfreelist; int cfreecount; #endif +511)>>9)) #ifndef KERNEL #include #else #include "../h/types.h" #endif /* * Machine-dependent bits and macros */ #define UMODE PSL_CURMOD /* usermode bi/( ,( 54 /\@,\D"include/sys/clock.h 444 0 33 2020 2531445225 7532 /* clock.h 4.5 81/02/23 */ /* * VAX clock registers */ #define ICCS_RUN 0x00000001 #define ICCS_TRANS 0x00000010 #define ICCS_SS 0x00000020 #define ICCS_IE 0x00000040 #define ICCS_INT 0x00000080 #define ICCS_ERR 0x80000000 #define SECDAY ((unsigned)(24*60*60)) /* seconds per day */ #define SECYR ((unsigned)(365*SECDAY)) /* per common year */ /* * TODRZERO is the what the TODR should contain when the ``year'' begins. * The TODR should always contain a number between 0 and SECYR+SECDAY. */ #define TODRZERO ((unsigned)(1<<28)) #define YRREF 1970 #define LEAPYEAR(year) ((year)%4==0) /* good till time becomes negative */ /* * Start a 60 HZ clock. */ #define clkstart() {\ mtpr(NICR, -16667); /* 16.667 milli-seconds */\ mtpr(ICCS, ICCS_RUN+ICCS_IE+ICCS_TRANS+ICCS_INT+ICCS_ERR);\ } #define clkreld() mtpr(ICCS, ICCS_RUN+ICCS_IE+ICCS_INT+ICCS_ERR) #define clkwrap() (((unsigned)mfpr(TODR) - TODRZERO)/100 > SECYR+SECDAY) /* * Software clock is software interrupt level 8 */ #define setsoftclock() mtpr(SIRR, 0x8) signed)(1<<28)) #define YRREF 1970 #define LEAPYEAR(year) ((year)%4==0) /* good till time becomes negative */ /* * Start a 60 HZ clock. */ #define clkstart() {\ mtpr(NICR, -16667); /* 16.667 milli-seconds */\ mtpr(ICCS, ICCS_RUN+ICCS_IE+ICCS_TRANS+ICCS_INT+ICCS_ERR);\ } #define clkreld() mtpr(ICCS, ICCS_RUN+ICCS_IE+ICCS_INT+ICCS_ERR) #define clkwrap() (((unsigned)mfpr(TODR) - TODRZERO)/100 > SECYR+SECDAY) /* * Software clock is software interrupt level 8 */ #define setsoftclock() include/sys/cmap.h 444 0 33 2776 2531445226 7402 /* cmap.h 4.5 81/03/09 */ /* * core map entry */ struct cmap { unsigned int c_next:13, /* index of next free list entry */ c_prev:13, /* index of previous free list entry */ c_mdev:4, /* which mounted dev this is from */ c_lock:1, /* locked for raw i/o or pagein */ c_want:1, /* wanted */ c_page:16, /* virtual page number in segment */ c_hlink:13, /* hash link for */ c_intrans:1, /* intransit bit */ c_free:1, /* on the free list */ c_gone:1, /* associated page has been released */ c_type:2, /* type CSYS or CTEXT or CSTACK or CDATA */ c_blkno:20, /* disk block this is a copy of */ c_ndx:10; /* index of owner proc or text */ }; #define CMHEAD 0 /* * Shared text pages are not totally abandoned when a process * exits, but are remembered while in the free list hashed by * off the cmhash structure so that they can be reattached * if another instance of the program runs again soon. */ #define CMHSIZ 512 /* SHOULD BE DYNAMIC */ #define CMHASH(bn) ((bn)&(CMHSIZ-1)) #ifdef KERNEL struct cmap *cmap; struct cmap *ecmap; int ncmap; struct cmap *mfind(); int firstfree, maxfree; int ecmx; /* cmap index of ecmap */ short cmhash[CMHSIZ]; #endif /* bits defined in c_type */ #define CSYS 0 /* none of below */ #define CTEXT 1 /* belongs to shared text segment */ #define CDATA 2 /* belongs to data segment */ #define CSTACK 3 /* belongs to stack segment */ #define pgtocm(x) ((((x)-firstfree) / CLSIZE) + 1) #define cmtopg(x) ((((x)-1) * CLSIZE) + firstfree) MHinclude/sys/conf.h 444 0 33 2037 2531445226 7375 /* conf.h 4.7 81/04/03 */ /* * Declaration of block device * switch. Each entry (row) is * the only link between the * main unix code and the driver. * The initialization of the * device switches is in the * file conf.c. */ struct bdevsw { int (*d_open)(); int (*d_close)(); int (*d_strategy)(); int (*d_dump)(); int d_flags; }; #ifdef KERNEL struct bdevsw bdevsw[]; #endif /* * Character device switch. */ struct cdevsw { int (*d_open)(); int (*d_close)(); int (*d_read)(); int (*d_write)(); int (*d_ioctl)(); int (*d_stop)(); int (*d_reset)(); struct tty *d_ttys; }; #ifdef KERNEL struct cdevsw cdevsw[]; #endif /* * tty line control switch. */ struct linesw { int (*l_open)(); int (*l_close)(); int (*l_read)(); char *(*l_write)(); int (*l_ioctl)(); int (*l_rint)(); int (*l_rend)(); int (*l_meta)(); int (*l_start)(); int (*l_modem)(); }; #ifdef KERNEL struct linesw linesw[]; #endif /* * Swap device information */ struct swdevt { dev_t sw_dev; int sw_freed; }; #ifdef KERNEL struct swdevt swdevt[]; #endif top)(); int (*d_reset)(); struct tty *d_ttys; }; #ifdef KERNEL struct cdevsw cdevsw[]; #endif /* * tty line control switch. */ struct linesw { int (*l_open)(); int (*l_close)(); int (*l_read)(); char *(*l_write)(); int (*l_ioctl)(); int (*l_rint)(); int (*l_rend)(); int (*l_meta)(); int (*l_start)(); int (*l_modem)(); }; #ifdef KERNEL struct linesw linesw[]; #endif /* * Swap device information */ struct swdevt { dev_t sw_dev; int sw_freed; }; #ifdef KERNEL include/sys/cons.h 444 0 33 1357 2531445226 7416 /* cons.h 4.6 81/02/23 */ /* * VAX console interface registers */ #define RXCS_IE 0x00000040 /* receiver interrupt enable */ #define RXCS_DONE 0x00000080 /* receiver done */ #define RXDB_DATA 0x000000ff /* received character */ #define RXDB_ID 0x00000f00 /* channel id */ #define RXDB_ERR 0x80000000 /* receiver error */ #define TXCS_IE 0x00000040 /* transmitter interrupt enable */ #define TXCS_RDY 0x00000080 /* transmitter ready for next char */ #define TXDB_DATA 0x000000ff /* transmitter byte */ #define TXDB_ID 0x00000f00 /* channel id */ #define TXDB_DONE 0xf01 /* software done */ #define TXDB_BOOT 0xf02 /* reboot */ #define TXDB_CWSI 0xf03 /* clear warm start inhibit */ #define TXDB_CCSI 0xf04 /* clear cold-start inhibit */ ne RXDB_ID 0x00000f00 /* channel id */ #define RXDB_ERR 0x80000000 /* receiver error */ #define TXCS_IE 0x00000040 /* transmitter interrupt enable */ #define TXCS_RDY 0x00000080 /* transmitter ready for next char */ #define TXDB_DATA 0x000000ff /* transmitter byte */ #d((include/sys/cpu.h 444 0 33 2752 2531445226 7243 /* cpu.h 4.6 81/04/03 */ #ifndef LOCORE /* * Cpu identification, from SID register. */ union cpusid { int cpusid; struct cpuany { u_int :24, cp_type:8; } cpuany; struct cpu780 { u_int cp_sno:12, /* serial number */ cp_plant:3, /* plant number */ cp_eco:9, /* eco level */ cp_type:8; /* VAX_780 */ } cpu780; struct cpu750 { u_int cp_hrev:8, /* hardware rev level */ cp_urev:8, /* ucode rev level */ :8, cp_type:8; /* VAX_750 */ } cpu750; /* need structure for 7ZZ */ }; #endif #define VAX_780 1 #define VAX_750 2 #define VAX_7ZZ 3 #define VAX_MAX 3 #ifndef LOCORE /* * Per-cpu information for system. */ struct percpu { short pc_cputype; /* cpu type code */ short pc_nnexus; /* number of nexus slots */ struct nexus *pc_nexbase; /* base of nexus space */ /* we should be able to have just one address for the unibus memories */ /* and calculate successive addresses by adding to the base, but the 750 */ /* doesn't obey the sensible rule: uba1 has a lower address than uba0! */ caddr_t *pc_umaddr; /* unibus memory addresses */ short pc_nubabdp; /* number of bdp's per uba */ short pc_haveubasr; /* have uba status register */ /* the 750 has some slots which don't promise to tell you their types */ /* if this pointer is non-zero, then you get the type from this array */ /* rather than from the (much more sensible) low byte of the config register */ short *pc_nextype; /* botch */ }; #ifdef KERNEL int cpu; struct percpu percpu[]; #endif #endif as a lower address thainclude/sys/dir.h 444 0 33 171 2531445227 7204 /* dir.h 4.2 81/02/19 */ #ifndef DIRSIZ #define DIRSIZ 14 #endif struct direct { ino_t d_ino; char d_name[DIRSIZ]; }; c_haveubasr; /* have uba status register */ /* the 750 has some slots which don't promise to tell you their types */ /* if this pointer is non-zero, then you get the type from this array */ /* rather than from the (much more sensible) low byte of the config register */ short *pc_nextype; /* botc/( ,( 5 /\@,\D"include/sys/dk.h 444 0 33 575 2531445227 7034 /* dk.h 4.2 81/02/19 */ /* * Instrumentation */ #define CPUSTATES 4 #define CP_USER 0 #define CP_NICE 1 #define CP_SYS 2 #define CP_IDLE 3 #define DK_NDRIVE 4 #ifdef KERNEL long cp_time[CPUSTATES]; int dk_busy; long dk_time[DK_NDRIVE]; long dk_seek[DK_NDRIVE]; long dk_xfer[DK_NDRIVE]; long dk_wds[DK_NDRIVE]; float dk_mspw[DK_NDRIVE]; long tk_nin; long tk_nout; #endif egister */ short *pc_nextype; /* botc/( ,( 5 /\@,\D"include/sys/dmap.h 444 0 33 1461 2531445227 7372 /* dmap.h 4.3 81/04/23 */ /* * Definitions for the mapping of vitual swap * space to the physical swap area - the disk map. */ #define NDMAP 16 /* size of the swap area map */ #define DMMIN 32 /* the initial block size in clicks */ #define DMMAX 1024 /* max block size alloc on drum = .5M byte */ #define DMTEXT 1024 /* size of blocks of pure text = .5M byte */ struct dmap { swblk_t dm_size; /* current size used by process */ swblk_t dm_alloc; /* amount of physical swap space allocated */ swblk_t dm_map[NDMAP]; /* first disk block number in each chunk */ }; #ifdef KERNEL struct dmap zdmap; #endif /* * The following structure is that ``returned'' * from a call to vstodb(). */ struct dblock { swblk_t db_base; /* base of physical contig drum block */ swblk_t db_size; /* size of block */ }; / #define DMTEXT 1024 /* size of blocks of pure text = .5M byte */ struct dmap { swblk_t dm_size; /* current size used by process */ swblk_t dm_alloc; /* amount of physical swap space allocated */ swblkinclude/sys/fblk.h 444 0 33 132 2531445230 7333 /* fblk.h 4.2 81/02/19 */ struct fblk { int df_nfree; daddr_t df_free[NICFREE]; }; zdmap; #endif /* * The following structure is that ``returned'' * from a call to vstodb(). */ struct dblock { swblk_t db_base; /* base of physical contig drum block */ swblk_t db_size; /* size of block */ }; / #define DMTEXT 1024 /* size of blocks of pure text = .5M byte */ struct dmap { swblk_t dm_size; /* current siz/( ,( 5Ĉ /\@,\D"include/sys/file.h 444 0 33 1260 2531445230 7357 /* file.h 4.5 81/03/09 */ /* * One file structure is allocated * for each open/creat/pipe call. * Main use is to hold the read/write * pointer associated with each open * file. */ struct file { short f_flag; short f_count; /* reference count */ struct inode *f_inode; /* pointer to inode structure */ union { off_t f_offset; /* read/write character pointer */ struct chan *f_chan; /* mpx channel pointer */ } f_un; }; #ifdef KERNEL struct file *file, *fileNFILE; /* the file table itself */ int nfile; struct file *getf(); struct file *falloc(); #endif /* flags */ #define FREAD 01 #define FWRITE 02 #define FPIPE 04 #define FMPX 010 #define FMPY 020 #define FMP 030 file. */ struct file { short f_flag; short f_count; /* reference count */ struct inode *f_inode; /* pointer to inode structure */ union { off_t f_offset; /* read/write character pointer */ struct chan *f_chan; /* mpx channel pointer */ } f_un; }; #ifdef KERNEL struct file *file, *fileNFILE; /* the file table itself */ ininclude/sys/filsys.h 444 0 33 2134 2531445230 7752 /* filsys.h 4.3 81/03/03 */ /* * Structure of the super-block */ struct filsys { unsigned short s_isize; /* size in blocks of i-list */ daddr_t s_fsize; /* size in blocks of entire volume */ short s_nfree; /* number of addresses in s_free */ daddr_t s_free[NICFREE]; /* free block list */ short s_ninode; /* number of i-nodes in s_inode */ ino_t s_inode[NICINOD]; /* free i-node list */ char s_flock; /* lock during free list manipulation */ char s_ilock; /* lock during i-list manipulation */ char s_fmod; /* super block modified flag */ char s_ronly; /* mounted read-only flag */ time_t s_time; /* last super block update */ daddr_t s_tfree; /* total free blocks*/ ino_t s_tinode; /* total free inodes */ short s_dinfo[2]; /* interleave stuff */ #define s_m s_dinfo[0] #define s_n s_dinfo[1] char s_fsmnt[12]; /* ordinary file mounted on */ /* end not maintained */ ino_t s_lasti; /* start place for circular search */ ino_t s_nbehind; /* est # free inodes before s_lasti */ }; #ifdef KERNEL struct filsys *getfs(); #endif nly; /* mounted read-only flag */ time_t s_time; /* last super block update */ daddr_t s_tfree; /* total free blocks*/ ino_t s_tinode; /* total free inodes */ short s_dinfo[2]; /* interleave stuff */ #define s_m s_dinfo[0] #define s_n s_dinfo[1] char s_fsmnt[12]; /* ordinary file mounted on */ /* end not maintained */ ino_t s_lasti; /* start place for circular search */ ino_t s_nbehin((include/sys/flp.h 444 0 33 2763 2531445231 7233 /* flp.h 4.4 81/02/25 */ #if VAX780 /* * Console floppy command/status and sectoring information. */ #define FL_FFC 0x200 /* floppy function complete */ #define FL_ERR 0x80 /* error bit in floppy status byte */ #define FL_PERR 0x905 /* floppy protocol error */ #define FL_DATA 0x100 /* floppy data select code */ #define FL_RS 0x900 /* floppy read sector command */ #define FL_WS 0x901 /* floppy write sector command*/ #define FL_STAT 0x902 /* floppy get status command*/ #define FL_CANCEL 0x904 /* cancel floppy function */ #define RXFTRK 77 /* tracks/floppy */ #define RXSTRK 26 /* sectors/track */ #define RXBYSEC 128 /* bytes/sector */ #define MAXSEC (RXFTRK*RXSTRK) /* sectors/floppy */ /* * In the floppy driver routines, the device active byte is used * not as a boolean, but as an indicator of the state we are in. * That is, it contains what to do on the next interrupt. */ #define FL_IDLE 0 /* floppy idle */ #define FL_MAND 1 /* about to send read/write command */ #define FL_SEC 2 /* about to send sector # to LSI */ #define FL_TRACK 3 /* about to send track # to LSI */ #define FL_DAX 4 /* transmitting data */ #define FL_DAR 5 /* receiving data */ #define FL_COM 6 /* completing transmission */ #define FL_CAN 7 /* give cancel order - we had an error, and are to restart */ #define FLERRS 5 /* number of retries before quitting */ /* * The state byte is used to retain exclusivity, * and contains the busy flag. */ #define FL_OPEN 1 #define FL_BUSY 2 #endif ine FL_SEC 2include/sys/hpreg.h 444 0 33 11377 2552566375 7620 /* hpreg.h 4.8 81/06/27 */ struct hpdevice { int hpcs1; /* control and status register 1 */ int hpds; /* drive status */ int hper1; /* error register 1 */ int hpmr; /* maintenance */ int hpas; /* attention summary */ int hpda; /* desired address register */ int hpdt; /* drive type */ int hpla; /* look ahead */ int hpsn; /* serial number */ int hpof; /* offset register */ int hpdc; /* desired cylinder address register */ int hpcc; /* current cylinder */ /* on an rp drive, mr2 is called er2 and er2 is called er3 */ /* we use rm terminology here */ int hpmr2; /* maintenance register 2 */ int hper2; /* error register 2 */ int hpec1; /* burst error bit position */ int hpec2; /* burst error bit pattern */ }; /* hpcs1 */ #define HP_SC 0100000 /* special condition */ #define HP_TRE 0040000 /* transfer error */ #define HP_DVA 0004000 /* drive available */ #define HP_RDY 0000200 /* controller ready */ #define HP_IE 0000100 /* interrupt enable */ /* bits 5-1 are the command */ #define HP_GO 0000001 /* commands */ #define HP_NOP 000 /* no operation */ #define HP_UNLOAD 002 /* offline drive */ #define HP_SEEK 004 /* seek */ #define HP_RECAL 006 /* recalibrate */ #define HP_DCLR 010 /* drive clear */ #define HP_RELEASE 012 /* release */ #define HP_OFFSET 014 /* offset */ #define HP_RTC 016 /* return to centerline */ #define HP_PRESET 020 /* read-in preset */ #define HP_PACK 022 /* pack acknowledge */ #define HP_SEARCH 030 /* search */ #define HP_DIAGNOSE 034 /* diagnose drive */ #define HP_WCDATA 050 /* write check data */ #define HP_WCHDR 052 /* write check header and data */ #define HP_WCOM 060 /* write data */ #define HP_WHDR 062 /* write header */ #define HP_WTRACKD 064 /* write track descriptor */ #define HP_RCOM 070 /* read data */ #define HP_RHDR 072 /* read header and data */ #define HP_RTRACKD 074 /* read track descriptor */ /* hpds */ #define HPDS_ATA 0100000 /* attention active */ #define HPDS_ERR 0040000 /* composite drive error */ #define HPDS_PIP 0020000 /* positioning in progress */ #define HPDS_MOL 0010000 /* medium on line */ #define HPDS_WRL 0004000 /* write locked */ #define HPDS_LST 0002000 /* last sector transferred */ #define HPDS_PGM 0001000 /* programmable */ #define HPDS_DPR 0000400 /* drive present */ #define HPDS_DRY 0000200 /* drive ready */ #define HPDS_VV 0000100 /* volume valid */ /* bits 1-5 are spare */ #define HPDS_OM 0000001 /* offset mode */ #define HPDS_DREADY (HPDS_DPR|HPDS_DRY|HPDS_MOL|HPDS_VV) #define HPDS_BITS \ "\10\20ATA\17ERR\16PIP\15MOL\14WRL\13LST\12PGM\11DPR\10DRY\7VV\1OM" /* hper1 */ #define HPER1_DCK 0100000 /* data check */ #define HPER1_UNS 0040000 /* drive unsafe */ #define HPER1_OPI 0020000 /* operation incomplete */ #define HPER1_DTE 0010000 /* drive timing error */ #define HPER1_WLE 0004000 /* write lock error */ #define HPER1_IAE 0002000 /* invalid address error */ #define HPER1_AOE 0001000 /* address overflow error */ #define HPER1_HCRC 0000400 /* header crc error */ #define HPER1_HCE 0000200 /* header compare error */ #define HPER1_ECH 0000100 /* ecc hard error */ #define HPER1_WCF 0000040 /* write clock fail */ #define HPER1_FER 0000020 /* format error */ #define HPER1_PAR 0000010 /* parity error */ #define HPER1_RMR 0000004 /* register modification refused */ #define HPER1_ILR 0000002 /* illegal register */ #define HPER1_ILF 0000001 /* illegal function */ #define HPER1_BITS \ "\10\20DCK\17UNS\16OPI\15DTE\14WLE\13IAE\12AOE\11HCRC\10HCE\ \7ECH\6WCF\5FER\4PAR\3RMR\2ILR\1ILF" #define HPER1_HARD \ (HPER1_WLE|HPER1_IAE|HPER1_AOE|\ HPER1_FER|HPER1_RMR|HPER1_ILR|HPER1_ILF) /* hper2 */ #define HPER2_BSE 0100000 /* bad sector error */ #define HPER2_SKI 0040000 /* seek incomplete */ #define HPER2_OPE 0020000 /* operator plug error */ #define HPER2_IVC 0010000 /* invalid command */ #define HPER2_LSC 0004000 /* loss of system clock */ #define HPER2_LBC 0002000 /* loss of bit check */ #define HPER2_DVC 0000200 /* device check */ #define HPER2_SSE 0000040 /* skip sector error (rm80) */ #define HPER2_DPE 0000010 /* data parity error */ #define HPER2_BITS \ "\10\20BSE\17SKI\16OPE\15IVC\14LSC\13LBC\10DVC\5SSE\4DPE" #define HPER2_HARD (HPER2_BSE|HPER2_OPE) /* hpof */ #define HPOF_CMO 0100000 /* command modifier */ #define HPOF_MTD 0040000 /* move track descriptor */ #define HPOF_FMT22 0010000 /* 16 bit format */ #define HPOF_ECI 0004000 /* ecc inhibit */ #define HPOF_HCI 0002000 /* header compare inhibit */ #define HPOF_SSEI 0001000 /* skip sector inhibit */ #define HPOF_P400 020 /* +400 uinches */ #define HPOF_M400 0220 /* -400 uinches */ #define HPOF_P800 040 /* +800 uinches */ #define HPOF_M800 0240 /* -800 uinches */ #define HPOF_P1200 060 /* +1200 uinches */ #define HPOF_M1200 0260 /* -1200 uinches */ e HPOF_MTD 0040000 /* move track descriptor */ #define HPOF_FMT22 0010000 /* 16 bit format */ #define HPOF_ECI 0004000 /* ecc inhibit */ #define HPOF_HCI 0002000 /* header compare inhibit */ #define HPOF_SSEI 0001000 /* skip sector inhibit */ #define include/sys/htreg.h 444 0 33 10151 2531445232 7572 /* htreg.h 4.1 81/03/21 */ struct htdevice { int htcs1; /* control status register */ int htds; /* drive status register */ int hter; /* error register */ int htmr; /* maintenance register */ int htas; /* attention status register */ int htfc; /* frame counter */ int htdt; /* drive type register */ int htck; /* nrzi check (crc) error character */ int htsn; /* serial number register */ int httc; /* tape controll register */ }; /* htcs1 */ #define HT_GO 000001 /* go bit */ #define HT_SENSE 000000 /* no operations (sense) */ #define HT_REWOFFL 000002 /* rewind offline */ #define HT_REW 000006 /* rewind */ #define HT_DCLR 000010 /* drive clear */ #define HT_RIP 000020 /* read in preset */ #define HT_ERASE 000024 /* erase */ #define HT_WEOF 000026 /* write tape mark */ #define HT_SFORW 000030 /* space forward */ #define HT_SREV 000032 /* space reverse */ #define HT_WCHFWD 000050 /* write check forward */ #define HT_WCHREV 000056 /* write check reverse */ #define HT_WCOM 000060 /* write forward */ #define HT_RCOM 000070 /* read forward */ #define HT_RREV 000076 /* read reverse */ /* htds */ #define HTDS_ATA 0100000 /* attention active */ #define HTDS_ERR 0040000 /* composite error */ #define HTDS_PIP 0020000 /* positioning in progress */ #define HTDS_MOL 0010000 /* medium on line */ #define HTDS_WRL 0004000 /* write lock */ #define HTDS_EOT 0002000 /* end of tape */ /* bit 9 is unused */ #define HTDS_DPR 0000400 /* drive present (always 1) */ #define HTDS_DRY 0000200 /* drive ready */ #define HTDS_SSC 0000100 /* slave status change */ #define HTDS_PES 0000040 /* phase-encoded status */ #define HTDS_SDWN 0000020 /* settle down */ #define HTDS_IDB 0000010 /* identification burst */ #define HTDS_TM 0000004 /* tape mark */ #define HTDS_BOT 0000002 /* beginning of tape */ #define HTDS_SLA 0000001 /* slave attention */ #define HTDS_BITS \ "\10\20ATA\17ERR\16PIP\15MOL\14WRL\13EOT\11DPR\10DRY\ \7SSC\6PES\5SDWN\4IDB\3TM\2BOT\1SLA" /* hter */ #define HTER_CORCRC 01((00000 /* correctible data or ecc */ #define HTER_UNS 0040000 /* unsafe */ #define HTER_OPI 0020000 /* operation incomplete */ #define HTER_DTE 0010000 /* drive timing error */ #define HTER_NEF 0004000 /* non-executable function */ #define HTER_CSITM 0002000 /* correctable skew/illegal tape mark */ #define HTER_FCE 0001000 /* frame count error */ #define HTER_NSG 0000400 /* non-standard gap */ #define HTER_PEFLRC 0000200 /* format error or lrc error */ #define HTER_INCVPE 0000100 /* incorrectable data error or vertical parity error */ #define HTER_DPAR 0000040 /* data parity error */ #define HTER_FMT 0000020 /* format error */ #define HTER_CPAR 0000010 /* control bus parity error */ #define HTER_RMR 0000004 /* register modification refused */ #define HTER_ILR 0000002 /* illegal register */ #define HTER_ILF 0000001 /* illegal function */ #define HTER_BITS \ "\10\20CORCRC\17UNS\16OPI\15DTE\14NEF\13CSITM\12FCE\11NSG\10PEFLRC\ \7INCVPE\6DPAR\5FMT\4CPAR\3RMR\2ILR\1ILF" #define HTER_HARD \ (HTER_UNS|HTER_OPI|HTER_NEF|HTER_DPAR|HTER_FMT|HTER_CPAR| \ HTER_RMR|HTER_ILR|HTER_ILF) /* htdt */ #define HTDT_NSA 0100000 /* not sector addressed; always 1 */ #define HTDT_TAP 0040000 /* tape; always 1 */ #define HTDT_MOH 0020000 /* moving head; always 0 */ #define HTDT_7CH 0010000 /* 7 channel; always 0 */ #define HTDT_DRQ 0004000 /* drive requested; always 0 */ #define HTDT_SPR 0002000 /* slave present */ /* bit 9 is spare */ /* bits 8-0 are formatter/transport type */ /* httc */ #define HTTC_ACCL 0100000 /* transport is not reading/writing */ #define HTTC_FCS 0040000 /* frame count status */ #define HTTC_SAC 0020000 /* slave address change */ #define HTTC_EAODTE 0010000 /* enable abort on data xfer errors */ /* bits 8-10 are density select */ #define HTTC_800BPI 0001400 /* in bits 8-10, dens=1600 */ #define HTTC_1600BPI 0002000 /* in bits 8-10, dens=800 */ /* bits 4-7 are format select */ #define HTTC_PDP11 0000300 /* in bits 4-7, pdp11 normal format */ #define HTTC_EVEN 0000010 /* select even parity */ /* bits 0 - 2 are slave select */ #define b_repcnt b_bcount #define b_command b_resid efine HTTC_SAC 0020000 /* slave address change */ #define HTTC_EAODTE 0010000 /* enable abort on data xfer errors */ /* bits 8-10 are density select */ #define HTTC_800BPI 0001400 /* in bits 8-10, dens=1600 */ #define HTTC_1600BPI 0002000 /* in bits 8-10, dens=800 */ /* bits 4-7 are format select */ #define HTTC_PDP11 0000300 /* in bits 4-7, pdp11 normal format */ #define HTTC_EVEN 0000010 /* selecinclude/sys/inline.h 444 0 33 1727 2531445232 7730 /* inline.h 4.3 81/02/26 */ /* * Definitions of inlines, and macro replacements * for them if UNFAST (latter only scantily tested). */ #ifndef UNFAST #define plock(ip) \ { \ while ((ip)->i_flag & ILOCK) { \ (ip)->i_flag |= IWANT; \ sleep((caddr_t)(ip), PINOD); \ } \ (ip)->i_flag |= ILOCK; \ } #define prele(ip) \ { \ (ip)->i_flag &= ~ILOCK; \ if ((ip)->i_flag&IWANT) { \ (ip)->i_flag &= ~IWANT; \ wakeup((caddr_t)(ip)); \ } \ } #define GETF(fp, fd) { \ if ((unsigned)(fd) >= NOFILE || ((fp) = u.u_ofile[fd]) == NULL) { \ u.u_error = EBADF; \ return; \ } \ } #define IUPDAT(ip, t1, t2, waitfor) { \ if (ip->i_flag&(IUPD|IACC|ICHG)) \ iupdat(ip, t1, t2, waitfor); \ } #define ISSIG(p) ((p)->p_sig && \ ((p)->p_flag&STRC || ((p)->p_sig &~ (p)->p_ignsig)) && issig()) #else #define GETF(fp, fd) { \ (fp) = getf(fd); \ if ((fp) == NULL) \ return; \ } #define IUPDAT(ip, t1, t2, waitfor) iupdat(ip, t1, t2, waitfor) #define ISSIG(p) issig(p) #endif { \ if ((unsigned)(fd) >= NOFILE || ((fpinclude/sys/ino.h 444 0 33 1076 2531445232 7234 /* ino.h 4.2 81/02/19 */ /* * Inode structure as it appears on * a disk block. */ struct dinode { unsigned short di_mode; /* mode and type of file */ short di_nlink; /* number of links to file */ short di_uid; /* owner's user id */ short di_gid; /* owner's group id */ off_t di_size; /* number of bytes in file */ char di_addr[40]; /* disk block addresses */ time_t di_atime; /* time last accessed */ time_t di_mtime; /* time last modified */ time_t di_ctime; /* time created */ }; /* * the 40 address bytes: * 39 used; 13 addresses * of 3 bytes each. */ on * a disk block. */ struct dinode { unsigned short di_mode; /* mode and type of file */ short di_nlink; /* number of links to file */ short di_uid; /* owner's user id */ short di_gid; /* owner's group id */ off_t di_size; /* number of bytes in file */ char di_addr[40]; /* disk block addresses */ time_t di_atime; /* time last accessed */ time_t di_mtime; /* time last modified */ time_t di_ctime; /* time created */ }; /* * the 40 adinclude/sys/inode.h 444 0 33 5251 2531445233 7545 /* inode.h 4.5 81/03/09 */ /* * The I node is the focus of all * file activity in unix. There is a unique * inode allocated for each active file, * each current directory, each mounted-on * file, text file, and the root. An inode is 'named' * by its dev/inumber pair. (iget/iget.c) * Data, from mode on, is read in * from permanent inode on volume. */ #define NADDR 13 #define NINDEX 6 struct group { short g_state; char g_index; char g_rot; struct group *g_group; struct inode *g_inode; struct file *g_file; short g_rotmask; short g_datq; struct chan *g_chans[NINDEX]; }; struct inode { char i_flag; char i_count; /* reference count */ dev_t i_dev; /* device where inode resides */ ino_t i_number; /* i number, 1-to-1 with device address */ unsigned short i_mode; short i_nlink; /* directory entries */ short i_uid; /* owner */ short i_gid; /* group of owner */ off_t i_size; /* size of file */ union { struct { daddr_t I_addr[NADDR]; /* if normal file/directory */ daddr_t I_lastr; /* last read (for read-ahead) */ } i_f; #define i_addr i_f.I_addr #define i_lastr i_f.I_lastr struct { daddr_t I_rdev; /* i_addr[0] */ struct group I_group; /* multiplexor group file */ } i_d; #define i_rdev i_d.I_rdev #define i_group i_d.I_group } i_un; short i_vfdcnt; /* number of fd's vreading this inode */ short i_hlink; /* link in hash chain (iget/iput/ifind) */ }; #ifdef KERNEL struct inode *inode, *inodeNINODE; int ninode; struct inode *rootdir; /* pointer to inode of root directory */ struct inode *mpxip; /* mpx virtual inode */ struct inode *ialloc(); struct inode *ifind(); struct inode *iget(); struct inode *owner(); struct inode *maknode(); struct inode *namei(); #endif /* flags */ #define ILOCK 01 /* inode is locked */ #define IUPD 02 /* file has been modified */ #define IACC 04 /* inode access time to be updated */ #define IMOUNT 010 /* inode is mounted on */ #define IWANT 020 /* some process waiting on lock */ #define ITEXT 040 /* inode is pure text prototype */ #define ICHG 0100 /* inode has been changed */ #define IPIPE 0200 /* inode is a pipe */ /* modes */ #define IFMT 0170000 /* type of file */ #define IFDIR 0040000 /* directory */ #define IFCHR 0020000 /* character special */ #define IFBLK 0060000 /* block special */ #define IFREG 0100000 /* regular */ #define IFMPC 0030000 /* multiplexed char special */ #define IFMPB 0070000 /* multiplexed block special */ #define ISUID 04000 /* set user id on execution */ #define ISGID 02000 /* set group id on execution */ #define ISVTX 01000 /* save swapped text even after use */ #define IREAD 0400 /* read, write, execute permissions */ #define IWRITE 0200 #define IEXEC 0100 directory */ #define IFCHR 0020000 /* character special */ #define IFBLK 0060000 /* block special */ #define IFREG 0100000 /* regular */ #define IFMPC 0030000 /* multiplexed char special */ #define IFMPB 0070000 /* multiplexed block special */ #define ISUID 04000 /* set user id on execution */ #define ISGID 02000 /* set group id on exinclude/sys/ioctl.h 444 0 33 10011 2531445234 7570 /* ioctl.h 4.7 81/03/17 */ /* * ioctl definitions, and special character and local tty definitions */ #ifndef _IOCTL_ #define _IOCTL_ struct tchars { char t_intrc; /* interrupt */ char t_quitc; /* quit */ char t_startc; /* start output */ char t_stopc; /* stop output */ char t_eofc; /* end-of-file */ char t_brkc; /* input delimiter (like nl) */ }; struct ltchars { char t_suspc; /* stop process signal */ char t_dsuspc; /* delayed stop process signal */ char t_rprntc; /* reprint line */ char t_f((lushc; /* flush output (toggles) */ char t_werasc; /* word erase */ char t_lnextc; /* literal next character */ }; /* * local mode settings */ #define LCRTBS 0000001 /* correct backspacing for crt */ #define LPRTERA 0000002 /* printing terminal \ ... / erase */ #define LCRTERA 0000004 /* do " \b " to wipe out character */ #define LTILDE 0000010 /* IIASA - hazeltine tilde kludge */ #define LMDMBUF 0000020 /* IIASA - start/stop output on carrier intr */ #define LLITOUT 0000040 /* IIASA - suppress any output translations */ #define LTOSTOP 0000100 /* send stop for any background tty output */ #define LFLUSHO 0000200 /* flush output sent to terminal */ #define LNOHANG 0000400 /* IIASA - don't send hangup on carrier drop */ #define LETXACK 0001000 /* IIASA - diablo style buffer hacking */ #define LCRTKIL 0002000 /* erase whole line on kill with " \b " */ #define LINTRUP 0004000 /* interrupt on every input char - SIGTINT */ #define LCTLECH 0010000 /* echo control characters as ^X */ #define LPENDIN 0020000 /* tp->t_rawq is waiting to be reread */ #define LDECCTQ 0040000 /* only ^Q starts after ^S */ /* local state */ #define LSBKSL 01 /* state bit for lowercase backslash work */ #define LSQUOT 02 /* last character input was \ */ #define LSERASE 04 /* within a \.../ for LPRTRUB */ #define LSLNCH 010 /* next character is literal */ #define LSTYPEN 020 /* retyping suspended input (LPENDIN) */ #define LSCNTTB 040 /* counting width of tab; leave LFLUSHO alone */ /* * tty ioctl commands */ #define TIOCGETD (('t'<<8)|0) /* get line discipline */ #define TIOCSETD (('t'<<8)|1) /* set line discipline */ #define TIOCHPCL (('t'<<8)|2) /* set hangup line on close bit */ #define TIOCMODG (('t'<<8)|3) /* modem bits get (???) */ #define TIOCMODS (('t'<<8)|4) /* modem bits set (???) */ #define TIOCGETP (('t'<<8)|8) /* get parameters - like old gtty */ #define TIOCSETP (('t'<<8)|9) /* set parameters - like old stty */ #define TIOCSETN (('t'<<8)|10) /* set params w/o flushing buffers */ #define TIOCEXCL (('t'<<8)|13) /* set exclusive use of tty */ #define TIOCNXCL (('t'<<8)|14) /* reset exclusive use of tty */ #define TIOCFLUSH (('t'<<8)|16) /* flush buffers */ #define TIOCSETC (('t'<<8)|17) /* set special characters */ #define TIOCGETC (('t'<<8)|18) /* get special characters */ #define TIOCIOANS (('t'<<8)|20) #define TIOCSIGNAL (('t'<<8)|21) #define TIOCUTTY (('t'<<8)|22) /* locals, from 127 down */ #define TIOCLBIS (('t'<<8)|127) /* bis local mode bits */ #define TIOCLBIC (('t'<<8)|126) /* bic local mode bits */ #define TIOCLSET (('t'<<8)|125) /* set entire local mode word */ #define TIOCLGET (('t'<<8)|124) /* get local modes */ #define TIOCSBRK (('t'<<8)|123) /* set break bit */ #define TIOCCBRK (('t'<<8)|122) /* clear break bit */ #define TIOCSDTR (('t'<<8)|121) /* set data terminal ready */ #define TIOCCDTR (('t'<<8)|120) /* clear data terminal ready */ #define TIOCGPGRP (('t'<<8)|119) /* get pgrp of tty */ #define TIOCSPGRP (('t'<<8)|118) /* set pgrp of tty */ #define TIOCSLTC (('t'<<8)|117) /* set local special characters */ #define TIOCGLTC (('t'<<8)|116) /* get local special characters */ #define TIOCOUTQ (('t'<<8)|115) /* number of chars in output queue */ #define TIOCSTI (('t'<<8)|114) /* simulate a terminal in character */ #define OTTYDISC 0 /* old, v7 std tty driver */ #define NETLDISC 1 /* line discip for berk net */ #define NTTYDISC 2 /* new tty discipline */ #define FIOCLEX (('f'<<8)|1) #define FIONCLEX (('f'<<8)|2) /* another local */ #define FIONREAD (('f'<<8)|127) /* get # bytes to read */ #endif aracters */ #define TIOCGLTC (('t'<<8)|116) /* get local special characters */ #define TIOCOUTQ (('t'<<8)|115) /* number of chars in output queue */ #define TIOCSTI (('t'<<8)|114) /* simulate a terminal in character */ #define OTTYDISC 0 /* old, v7 std tty driver */ #define NETLDISC 1 /* line discip for berk net */ #define NTTYDISC 2 /* new tty discipline */ #define FIOCLEX (('f'<<8)|1) #define FIONCLEX (('f'<<8)|2) /* another local */ #define FIONREAD (('f'<<8)|127) /* get # bytes to read *include/sys/map.h 444 0 33 3115 2531445234 7222 /* map.h 4.5 81/02/28 */ /* * Resource Allocation Maps. * * Associated routines manage sub-allocation of an address space using * an array of segment descriptors. The first element of this array * is a map structure, describing the arrays extent and the name * of the controlled object. Each additional structure represents * a free segment of the address space. * * A call to rminit initializes a resource map and may also be used * to free some address space for the map. Subsequent calls to rmalloc * and rmfree allocate and free space in the resource map. If the resource * map becomes too fragmented to be described in the available space, * then some of the resource is discarded. This may lead to critical * shortages, but is better than not checking (as the previous versions * of these routines did) or giving up and calling panic(). The routines * could use linked lists and call a memory allocator when they run * out of space, but that would not solve the out of space problem when * called at interrupt time. * * N.B.: The address 0 in the resource address space is not available * as it is used internally by the resource map routines. */ struct map { struct mapent *m_limit; /* address of last slot in map */ char *m_name; /* name of resource */ /* we use m_name when the map overflows, in warning messages */ }; struct mapent { int m_size; /* size of this segment of the map */ int m_addr; /* resource-space addr of start of segment */ }; #ifdef KERNEL struct map *swapmap; int nswapmap; struct map *argmap; #define ARGMAPSIZE 16 struct map *kernelmap; #endif e is not available * as it is used internally by the resource map routines. */ struct map { struct mapent *m_limit; /* address of last slot in map */ char *m_name; /* name of resource */ /* we use m_name when the map overflows, in warning messages */ }; struct mapent { int m_size; /* size of this segment of the map */ int m_addr; /* resource-space addr of start of segment */ }; #ifdef KERNEL struct map *swapmap; int nswapinclude/sys/mbareg.h 444 0 33 7527 2531445234 7715 /* mbareg.h 4.15 81/05/03 */ /* * VAX MASSBUS adapter registers */ struct mba_regs { int mba_csr; /* configuration register */ int mba_cr; /* control register */ int mba_sr; /* status register */ int mba_var; /* virtual address register */ int mba_bcr; /* byte count register */ int mba_dr; int mba_pad1[250]; struct mba_drv { /* per drive registers */ int mbd_cs1; /* control status */ int mbd_ds; /* drive status */ int mbd_er1; /* error register */ int mbd_mr1; /* maintenance register */ int mbd_as; /* attention status */ int mbd_da; /* desired address (disks) */ #define mbd_fc mbd_da /* frame count (tapes) */ int mbd_dt; /* drive type */ int mbd_la; /* look ahead (disks) */ #define mbd_ck mbd_la /* ??? (tapes) */ int mbd_sn; /* serial number */ int mbd_of; /* ??? */ #define mbd_tc mbd_of /* ??? */ int mbd_fill[22]; } mba_drv[8]; struct pte mba_map[256]; /* io space virtual map */ int mba_pad2[256*5]; /* to size of a nexus */ }; /* * Bits in mba_cr */ #define MBCR_INIT 0x1 /* init mba */ #define MBCR_IE 0x4 /* enable mba interrupts */ /* * Bits in mba_sr */ #define MBSR_DTBUSY 0x80000000 /* data transfer busy */ #define MBSR_NRCONF 0x40000000 /* no response confirmation */ #define MBSR_CRD 0x20000000 /* corrected read data */ #define MBSR_CBHUNG 0x00800000 /* control bus hung */ #define MBSR_PGE 0x00080000 /* programming error */ #define MBSR_NED 0x00040000 /* non-existant drive */ #define MBSR_MCPE 0x00020000 /* massbus control parity error */ #define MBSR_ATTN 0x00010000 /* attention from massbus */ #define MBSR_SPE 0x00004000 /* silo parity error */ #define MBSR_DTCMP 0x00002000 /* data transfer completed */ #define MBSR_DTABT 0x00001000 /* data transfer aborted */ #define MBSR_DLT 0x00000800 /* data late */ #define MBSR_WCKUP 0x00000400 /* write check upper */ #define MBSR_WCKLWR 0x00000200 /* write check lower */ #define MBSR_MXF 0x00000100 /* miss transfer error */ #define MBSR_MBEXC 0x00000080 /* massbus exception */ #define MBSR_MDPE 0x00000040 /* massbus data parity error */ #define MBSR_MAPPE 0x00000020 /* page frame map parity error */ #define MBSR_INVMAP 0x00000010 /* invalid map */ #define MBSR_ERRCONF 0x00000008 /* error confirmation */ #define MBSR_RDS 0x00000004 /* read data substitute */ #define MBSR_ISTIMO 0x00000002 /* interface sequence timeout */ #define MBSR_RDTIMO 0x00000001 /* read data timeout */ #define MBSR_BITS \ "\20\40DTBUSY\37NRCONF\36CRD\30CBHUNG\24PGE\23NED\22MCPE\21ATTN\ \17SPE\16DTCMP\15DTABT\14DLT\13WCKUP\12WCKLWR\11MXF\10MBEXC\7MDPE\ \6MAPPE\5INVMAP\4ERRCONF\3RDS\2ISTIMO\1RDTIMO" #define MBSR_HARD (MBSR_PGE|MBSR_ERRCONF|MBSR_ISTIMO|MBSR_RDTIMO) #define MBSR_EBITS (~(MBSR_DTBUSY|MBSR_CRD|MBSR_ATTN|MBSR_DTCMP)) #ifdef KERNEL extern char mbsr_bits[]; #endif /* * Commands for mbd_cs1 */ #define MB_WCOM 0x30 #define MB_RCOM 0x38 #define MB_GO 0x1 /* * Bits in mbd_ds. */ #define MBDS_ERR 0x00004000 /* error in drive */ #define MBDS_MOL 0x00001000 /* medium on line */ #define MBDS_DPR 0x00000100 /((* drive present */ #define MBDS_DRY 0x00000080 /* drive ready */ #define MBDS_DREADY (MBDS_MOL|MBDS_DPR|MBDS_DRY) /* * Bits in mbd_dt */ #define MBDT_NSA 0x8000 /* not sector addressible */ #define MBDT_TAP 0x4000 /* is a tape */ #define MBDT_MOH 0x2000 /* moving head */ #define MBDT_7CH 0x1000 /* 7 channel */ #define MBDT_DRQ 0x800 /* drive request required */ #define MBDT_SPR 0x400 /* slave present */ #define MBDT_TYPE 0x1ff #define MBDT_MASK (MBDT_NSA|MBDT_TAP|MBDT_TYPE) /* type codes for disk drives */ #define MBDT_RP04 020 #define MBDT_RP05 021 #define MBDT_RP06 022 #define MBDT_RP07 042 #define MBDT_RM03 024 #define MBDT_RM05 027 #define MBDT_RM80 026 /* type codes for tape drives */ #define MBDT_TM03 050 #define MBDT_TE16 051 #define MBDT_TU45 052 #define MBDT_TU77 054 #define MBDT_TU78 0101 /* can't handle these (yet) */ /* drive request required */ #define MBDT_SPR 0x400 /* slave present */ #define MBDT_TYPE 0x1ff #define MBDT_MASK (MBDT_NSA|MBDT_TAP|MBDT_TYPE) /* type codes for disinclude/sys/mbavar.h 444 0 33 10405 2531445235 7736 /* mbavar.h 4.15 81/04/08 */ /* * This file contains definitions related to the kernel structures * for dealing with the massbus adapters. * * Each mba has a mba_hd structure. * Each massbus device has a mba_device structure. * Each massbus slave has a mba_slave structure. * * At boot time we prowl the structures and fill in the pointers * for devices which we find. */ /* * Per-mba structure. * * The initialization routine uses the information in the mbdinit table * to initialize the what is attached to each massbus slot information. * It counts the number of devices on each mba (to see if bothering to * search/seek is appropriate). * * During normal operation, the devices attached to the mba which wish * to transfer are queued on the mh_act? links. */ struct mba_hd { short mh_active; /* set if mba is active */ short mh_ndrive; /* number of devices, to avoid seeks */ struct mba_regs *mh_mba; /* virt addr of mba */ struct mba_regs *mh_physmba; /* phys addr of mba */ struct mba_device *mh_mbip[8]; /* what is attached to each dev */ struct mba_device *mh_actf; /* head of queue to transfer */ struct mba_device *mh_actl; /* tail of queue to transfer */ }; /* * Per-device structure * (one for each RM/RP disk, and one for each tape formatter). * * This structure is used by the device driver as its argument * to the massbus driver, and by the massbus driver to locate * the device driver for a particular massbus slot. * * The device drivers hang ready buffers on this structure, * and the massbus driver will start i/o on the first such buffer * when appropriate. */ struct mba_device { struct mba_driver *mi_driver; short mi_unit; /* unit number to the system */ short mi_mbanum; /* the mba it is on */ short mi_drive; /* controller on mba */ short mi_dk; /* driver number for iostat */ short mi_alive; /* device exists */ short mi_type; /* driver specific unit type */ struct buf mi_tab; /* head of queue for this device */ struct mba_device *mi_forw; /* we could compute these every time, but hereby save time */ struct mba_regs *mi_mba; struct mba_drv *mi_drv; struct mba_hd *mi_hd; }; /* * Tape formatter slaves are specified by * the following information which is used * at boot time to initialize the tape driver * internal tables. */ struct mba_slave { struct mba_driver *ms_driver; short ms_ctlr; /* which of several formatters */ short ms_unit; /* which unit to system */ short ms_slave; /* which slave to formatter */ short ms_alive; }; /* * Per device-type structure. * * Each massbus driver defines entries for a set of routines used * by the massbus driver, as well as an array of types which are * acceptable to it. */ struct mba_driver { int (*md_attach)(); /* attach a device */ int (*md_slave)(); /* attach a slave */ int (*md_ustart)(); /* unit start routine */ int (*md_start)(); /* setup a data transfer */ int (*md_dtint)(); /* data transfer complete */ int (*md_ndint)(); /* non-data transfer interrupt */ short *md_type; /* array of drive type codes */ char *md_dname, *md_sname; /* device, slave names */ struct mba_device **md_info; /* backpointers to mbinit structs */ }; /* * Possible return values from unit start routines. */ #define MBU_NEXT 0 /* skip to next operation */ #define MBU_BUSY 1 /* dual port busy; wait for intr */ #define MBU_STARTED 2 /* non-data transfer started */ #define MBU_DODATA 3 /* data transfer ready; start mba */ /* * Possible return values from data transfer interrupt handling routines */ #define MBD_DONE 0 /* data transfer complete */ #define MBD_RETRY 1 /* error occurred, please retry */ #define MBD_RESTARTED 2 /* driver restarted i/o itself */ /* * Possible return values from non-data-transfer interrupt handling routines */ #define MBN_DONE 0 /* non-data transfer complete */ #define MBN_RETRY 1 /* failed; retry the operation */ #define MBN_SKIP 2 /* don't do anything */ /* * Clear attention status for specified device. */ #define mbclrattn(mi) ((mi)->mi_mba->mba_drv[0].mbd_as = 1 << (mi)->mi_drive) /* * Kernel definitions related to mba. */ #ifdef KERNEL int nummba; #if NMBA > 0 struct mba_hd mba_hd[NMBA]; extern Xmba0int(), Xmba1int(), Xmba2int(), Xmba3int(); extern struct mba_device mbdinit[]; extern struct mba_slave mbsinit[]; #endif #endif ata transfer complete */ #define MBN_RETRY 1 /* failed; retry the operation */ #define MBN_SKIP 2 /* don't do anything */ /* * Clear attention status for specified device. */ #define mbclrattn(mi) ((mi)->mi_mba->mba_drv[0].mbd_as = 1 << (mi)->mi_include/sys/mem.h 444 0 33 5353 2531445235 7232 /* mem.h 4.9 81/04/03 */ /* * Memory controller registers * * The way in which the data is stored in these registers varies * per cpu, so we define macros here to mask that. */ struct mcr { int mc_reg[3]; }; /* * Compute maximum possible number of memory controllers, * for sizing of the mcraddr array. */ #if VAX780 #define MAXNMCR 4 #else #define MAXNMCR 1 #endif /* * For each processor type we define 5 macros: * M???_INH(mcr) inhibits further crd interrupts from mcr * M???_ENA(mcr) enables another crd interrupt from mcr * M???_ERR(mcr) tells whether an error is waiting * M???_SYN(mcr) gives the syndrome bits of the error * M???_ADDR(mcr) gives the address of the error */ #if VAX780 #define M780_ICRD 0x40000000 /* inhibit crd interrupts, in [2] */ #define M780_HIER 0x20000000 /* high error rate, in reg[2] */ #define M780_ERLOG 0x10000000 /* error log request, in reg[2] */ /* on a 780, memory crd's occur only when bit 15 is set in the SBIER */ /* register; bit 14 there is an error bit which we also clear */ /* these bits are in the back of the ``red book'' (or in the VMS code) */ #define M780_INH(mcr) \ (((mcr)->mc_reg[2] = (M780_ICRD|M780_HIER|M780_ERLOG)), mtpr(SBIER, 0)) #define M780_ENA(mcr) \ (((mcr)->mc_reg[2] = (M780_HIER|M780_ERLOG)), mtpr(SBIER, 3<<14)) #define M780_ERR(mcr) \ ((mcr)->mc_reg[2] & (M780_ERLOG)) #define M780_SYN(mcr) ((mcr)->mc_reg[2] & 0xff) #define M780_ADDR(mcr) (((mcr)->mc_reg[2] >> 8) & 0xfffff) #endif #if VAX750 #define M750_ICRD 0x10000000 /* inhibit crd interrupts, in [1] */ #define M750_UNCORR 0xc0000000 /* uncorrectable error, in [0] */ #define M750_CORERR 0x40000000 /* correctable error, in [0] */ #define M750_INH(mcr) ((mcr)->mc_reg[1] = M750_ICRD) #define M750_ENA(mcr) ((mcr)->mc_reg[0] = (M750_UNCORR|M750_CORERR), \ (mcr)->mc_reg[1] = 0) #define M750_ERR(mcr) ((mcr)->mc_reg[0] & (M750_UNCORR|M750_CORERR)) #define M750_SYN(mcr) ((mcr)->mc_reg[0] & 0x3f) #define M750_ADDR(mcr) (((mcr)->mc_reg[0] >> 8) & 0x7fff) #endif #if VAX7ZZ #define M7ZZ_CRD 0x40000000 /* crd, in [1] */ #define M7ZZ_FTBPE 0x20000000 /* force tbuf parity error, in [1] */ #define M7ZZ_ENACRD 0x10000000 /* enable crd interrupt, in [1] */ #define M7ZZ_MME 0x08000000 /* mem-man enable (ala ipr), in [1] */ #define M7ZZ_DM 0x04000000 /* diagnostic mode, in [1] */ #define M7ZZ_DISECC 0x02000000 /* disable ecc, in [1] */ #define M7ZZ_INH(mcr) ((mcr)->mc_reg[1] = M7ZZ_MME) #define M7ZZ_ENA(mcr) ((mcr)->mc_reg[1] = (M7ZZ_MME|M7ZZ_ENACRD)) #define M7ZZ_ERR(mcr) ((mcr)->mc_reg[1] & M7ZZ_CRD) #define M7ZZ_SYN(mcr) ((mcr)->mc_reg[0] & 0x7f) #define M7ZZ_ADDR(mcr) (((mcr)->mc_reg[0] >> 8) & 0x7fff) #endif #define MEMINTVL (60*60*10) /* 10 minutes */ #ifdef KERNEL int nmcr; struct mcr *mcraddr[MAXNMCR]; #endif */ #define M7ZZ_DM 0x04000000 /* diagnostic mode, in [1] */ #define M7ZZ_DISECC 0x02000000 /* disable ecc, in [1] */ #define M7ZZ_INH(mcr) ((mcr)->mc_reg[1] = M7ZZ_MME) #define M7ZZ_ENA(mcr) ((mcr)->mc_reg[1] = (M7ZZ_MME|M7ZZ_ENACRD)) #define M7ZZ_ERR(mcr) ((mcr)->mc_reg[1]include/sys/mount.h 444 0 33 513 2531445235 7567 ((/* mount.h 4.3 81/02/26 */ /* * Mount structure. * One allocated on every mount. * Used to find the super block. */ struct mount { dev_t m_dev; /* device mounted */ struct buf *m_bufp; /* pointer to superblock */ struct inode *m_inodp; /* pointer to mounted on inode */ }; #ifdef KERNEL struct mount mount[NMOUNT]; #endif disable ecc, in [1] */ #define M7ZZ_INH(mcr) ((mcr)->mc_reg[1] = M7ZZ_MME) #define M7ZZ_/( ,( 5 /\@,\D"include/sys/msgbuf.h 444 0 33 346 2531445236 7715 /* msgbuf.h 4.2 81/02/19 */ #define MSG_MAGIC 0x063060 #define MSG_BSIZE (NBPG*CLSIZE - 2 * sizeof (long)) struct msgbuf { long msg_magic; long msg_bufx; char msg_bufc[MSG_BSIZE]; }; #ifdef KERNEL struct msgbuf msgbuf; #endif node *m_inodp; /* pointer to mounted on inode */ }; #ifdef KERNEL struct mount mount[NMOUNT]; #endif disable ecc, in [1] */ #define M7ZZ_INH(mcr) ((mcr)->mc_reg[1] = M7ZZ_MME) #define M7ZZ_/( ,( 5 /\@,\D"include/sys/mtio.h 444 0 33 2614 2531445236 7422 /* mtio.h 4.5 81/04/02 */ /* * Structures and definitions for mag tape io control commands */ /* mag tape io control commands */ #define MTIOCTOP (('m'<<8)|1) /* do a mag tape op */ #define MTIOCGET (('m'<<8)|2) /* get mag tape status */ /* structure for MTIOCTOP - mag tape op command */ struct mtop { short mt_op; /* operations defined below */ daddr_t mt_count; /* how many of them */ }; /* operations */ #define MTWEOF 0 /* write an end-of-file record */ #define MTFSF 1 /* forward space file */ #define MTBSF 2 /* backward space file */ #define MTFSR 3 /* forward space record */ #define MTBSR 4 /* backward space record */ #define MTREW 5 /* rewind */ #define MTOFFL 6 /* rewind and put the drive offline */ #define MTNOP 7 /* no operation, sets status only */ /* structure for MTIOCGET - mag tape get status command */ struct mtget { short mt_type; /* type of magtape device */ /* the following two registers are grossly device dependent */ short mt_dsreg; /* ``drive status'' register */ short mt_erreg; /* ``error'' register */ /* end device-dependent registers */ short mt_resid; /* residual count */ /* the following two are not yet implemented */ daddr_t mt_fileno; /* file number of current position */ daddr_t mt_blkno; /* block number of current position */ /* end not yet implemented */ }; /* * Constants for mt_type byte */ #define MT_ISTS 01 #define MT_ISHT 02 #define MT_ISTM 03 wing two registers are grossly device dependent */ short mt_dsreg; /* ``drive status'' register */ short mt_erreg;include/sys/mtpr.h 444 0 33 5255 2531445236 7440 /* mtpr.h 4.5 81/02/25 */ /* * VAX processor register numbers */ #define KSP 0x0 /* kernel stack pointer */ #define ESP 0x1 /* exec stack pointer */ #define SSP 0x2 /* supervisor stack pointer */ #define USP 0x3 /* user stack pointer */ #define ISP 0x4 /* interrupt stack pointer */ #define P0BR 0x8 /* p0 base register */ #define P0LR 0x9 /* p0 length register */ #define P1BR 0xa /* p1 base register */ #define P1LR 0xb /* p1 length register */ #define SBR 0xc /* system segment base register */ #define SLR 0xd /* system segment length register */ #define PCBB 0x10 /* process control block base */ #define SCBB 0x11 /* system control block base */ #define IPL 0x12 /* interrupt priority level */ #define ASTLVL 0x13 /* async. system trap level */ #define SIRR 0x14 /* software interrupt request */ #define SISR 0x15 /* software interrupt summary */ #define ICCS 0x18 /* interval clock control */ #define NICR 0x19 /* next interval count */ #define ICR 0x1a /* interval count */ #define TODR 0x1b /* time of year (day) */ #define RXCS 0x20 /* console receiver control and status */ #define RXDB 0x21 /* console receiver data buffer */ #define TXCS 0x22 /* console transmitter control and status */ #define TXDB 0x23 /* console transmitter data buffer */ #define MAPEN 0x38 /* memory management enable */ #define TBIA 0x39 /* translation buffer invalidate all */ #define TBIS 0x3a /* translation buffer invalidate single */ #define PMR 0x3d /* performance monitor enable */ #define SID 0x3e /* system identification */ #if VAX780 #define ACCS 0x28 /* accelerator control and status */ #define ACCR 0x29 /* accelerator maintenance */ #define WCSA 0x2c /* WCS address */ #define WCSD 0x2d /* WCS data */ #define SBIFS 0x30 /* SBI fault and status */ #define SBIS 0x31 /* SBI silo */ #define SBISC 0x32 /* SBI silo comparator */ #define SBIMT 0x33 /* SBI maintenance */ #define SBIER 0x34 /* SBI error register */ #define SBITA 0x35 /* SBI timeout address */ #define SBIQC 0x36 /* SBI quadword clear */ #define MBRK 0x3c /* micro-program breakpoint */ #endif #if VAX750 #define MCSR 0x17 /* machine check status register */ #define CSRS 0x1c /* console storage receive status register */ #define CSRD 0x1d /* console storage receive data register */ #define CSTS 0x1e /* console storage transmit status register */ #define CSTD 0x1f /* console storage transmit data register */ #define TBDR 0x24 /* translation buffer disable register */ #define CADR 0x25 /* cache disable register */ #define MCESR 0x26 /* machine check error summary register */ #define CAER 0x27 /* cache error */ #define IUR 0x37 /* init unibus register */ #define TB 0x3b /* translation buffer */ #endif tus register */ #define CSRD 0x1d /* console storage receive data register */ #define CSTS 0x1e /* console storage transmit status register */ #define CSTD 0x1f /* console storage transmit data register */ #define TBDR 0x24 /* translation buffer disable register */ #define CADR 0x25 /* cache disable register */ #define MCESR 0x26 /include/sys/pcb.h 444 0 33 2502 2531445240 7205 /* pcb.h 4.5 81/05/14 */ /* * VAX process control block */ struct pcb { int pcb_ksp; /* kernel stack pointer */ int pcb_esp; /* exec stack pointer */ int pcb_ssp; /* supervisor stack pointer */ int pcb_usp; /* user stack pointer */ int pcb_r0; int pcb_r1; int pcb_r2; int pcb_r3; int pcb_r4; int pcb_r5; int pcb_r6; int pcb_r7; int pcb_r8; int pcb_r9; int pcb_r10; int pcb_r11; int pcb_r12; #define pcb_ap pcb_r12 int pcb_r13; #define pcb_fp pcb_r13 int pcb_pc; /* program counter */ int pcb_psl; /* program status longword */ struct pte *pcb_p0br; /* seg 0 base register */ int pcb_p0lr; /* seg 0 length register and astlevel */ struct pte *pcb_p1br; /* seg 1 base register */ int pcb_p1lr; /* seg 1 length register and pme */ /* * Software pcb (extension) */ int pcb_szpt; /* number of pages of user page table */ int pcb_cmap2; int *pcb_sswap; int pcb_sigc[3]; }; #define AST_NONE 0x04000000 /* ast level */ #define AST_USER 0x03000000 /* ast for user mode */ #define ASTLVL_NONE 4 #define ASTLVL_USER 3 #define AST_CLR 0x07000000 #define aston() \ { \ u.u_pcb.pcb_p0lr = (u.u_pcb.pcb_p0lr &~ AST_CLR) | AST_USER; \ mtpr(ASTLVL, ASTLVL_USER); \ } #define astoff() \ { \ u.u_pcb.pcb_p0lr = (u.u_pcb.pcb_p0lr &~ AST_CLR) | AST_NONE; \ mtpr(ASTLVL, ASTLVL_NONE); \ } * number of pages of user page table */ int pcb_cmap2; int *pcb_sswap; int pcb_sigc[3]; }; #define AST_NONE 0x04000000 /* ast level */ #define AST_USER 0x03000000 /* ast for user mode */include/sys/pcb.m 444 0 33 1352 2531445240 7214 /* pcb.m 4.3 81/02/23 */ /* * VAX process control block */ .set PCB_KSP, 0 .set PCB_ESP, 4 .set PCB_SSP, 8 .set PCB_USP, 12 .set PCB_R0, 16 .set PCB_R1, 20 .set PCB_R2, 24 .set PCB_R3, 28 .set PCB_R4, 32 .set PCB_R5, 36 .set PCB_R6, 40 .set PCB_R7, 44 .set PCB_R8, 48 .set PCB_R9, 52 .set PCB_R10, 56 .set PCB_R11, 60 .set PCB_R12, 64 .set PCB_R13, 68 .set PCB_PC, 72 .set PCB_PSL, 76 .set PCB_P0BR, 80 .set PCB_P0LR, 84 .set PCB_P1BR, 88 .set PCB_P1LR, 92 /* * Software p((cb extension */ .set PCB_SZPT, 96 /* number of user page table pages */ .set PCB_CMAP2, 100 /* saved cmap2 across cswitch (ick) */ .set PCB_SSWAP, 104 /* flag for non-local goto */ .set PCB_SIGC, 108 /* signal trampoline code */ , 36 .set PCB_R6, 40 .set PCB_R7, 44 .set PCB_R8, 48 .set PCB_R9, 52 .set PCB_R10, 56 .set PCB_R11, 60 .set PCB_R12, 64 .set PCB_R13, 68 .set PCB_PC, 72 .set PCB_PSL, 76 .set PCB_P0BR, 80 .set PCB_P0LR, 84 .set PCB_P1BR, 88 .set PCB_P1LR, 92 /* * Software pinclude/sys/pdma.h 444 0 33 175 2531445240 7346 /* pdma.h 4.2 81/02/19 */ struct pdma { struct device *p_addr; char *p_mem; char *p_end; int p_arg; int (*p_fcn)(); }; (ick) */ .set PCB_SSWAP, 104 /* flag for non-local goto */ .set PCB_SIGC, 108 /* signal trampoline code */ , 36 .set PCB_R6, 40 .set PCB_R7, 44 .set PCB_R8, 48 .set PCB_R9, 52 .set PCB_R10, 56 .set PCB_R11, 60 .set PCB_R12, 64 .set PCB_R13, 68 .set PCB_PC, 72 .set PCB_PSL, 76 /( ,( 5 /\@,\D"include/sys/pk.h 644 0 33 4233 2531445240 7060 struct header { char sync; char ksize; unsigned short sum; char cntl; char ccntl; }; #define HDRSIZ 6 struct pack { short p_state; /* line state */ short p_bits; /* mask for getepack */ short p_rsize; /* input packet size */ short p_xsize; /* output packet size */ struct header p_ihbuf; /* input header */ struct header p_ohbuf; /* output header */ char *p_rptr; char p_mode; char **p_ipool; char p_xcount; /* # active output buffers */ char p_rcount; char p_nout,p_tout; char p_lpsize; /* log(psize/32) */ char p_timer; char p_obusy; char p_srxmit; char p_rwindow; /* window size */ char p_swindow; char p_msg; /* control msg */ char p_rmsg; /* repeated control msg */ char p_ps,p_pr; /* last packet sent, recv'd */ char p_rpr; char p_nxtps; /* next output seq number */ char p_imap; /* bit map of input buffers */ char p_pscopy; /* newest output packet */ char *p_ob[8]; /* output buffers */ char *p_ib[8]; /* input buffers */ char p_os[8]; /* output buffer status */ char p_is[8]; /* input buffer status */ short p_osum[8]; /* output checksums */ short p_isum[8]; /* input checksums */ DSYSTEM; }; #define CHECK 0125252 #define SYN 020 #define MOD8 7 #define ISCNTL(a) ((a & 0300)==0) #define MIN(a,b) ((at_linep) #define TURNOFF pkturnoff(tp) #ifdef VMUNIX #define UCOUNT u.u_count #else #define UCOUNT uio->u_count #endif #define S tp #define P pk->p_ttyp #define SDEF struct tty *tp #define FS , tp #define SIGNAL psignal(u.u_procp, SIGPIPE) #define TERROR pk->p_istate == R_ERROR #define SETERROR u.u_error = EIO #define OBUSY tp->t_state&BUSY #define ODEAD ((tp->t_state&CARR_ON)==0) char *getepack(); #define GETEPACK getepack(pk->p_bits) #define FREEPACK(a,b) freepack(a, b) #define q1 tp->t_rawq #define q2 tp->t_canq #define q3 tp->t_outq #define LOCK s = spl6() #define UNLOCK splx(s) #define DSYSTEM struct tty *p_ttyp #define ISYSTEM tp = pk->p_ttyp #define SLEEP(a, b) sleep((caddr_t)a, b) #define SLEEPNO (tp->t_chan!=NULL) #define WAKEUP(a) wakeup((caddr_t)a) #define PKGETPKT(p) #define DTOM(a) dtom(a) #include "../h/param.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/pk.h" #include "../h/tty.h" #include "../h/buf.h" #include "../h/proc.h" #include "../h/local.h" #include "../h/file.h" #ifdef PDP #include "../h/var.h" #endif #endif /* * user level */ #ifdef USER #define SLEEP(a, b) #define SIGNAL #define WAKEUP(a) #define DSYSTEM int p_ifn, p_ofn #define ISYSTEM #define GETEPACK malloc(pk->p_xsize) #define FREEPACK(a, b) free(a) #define OBUSY 0 #define PKGETPKT(p) pkgetpack(p); #define DTOM(a) 1; #define S ipk, ibuf, icount #define SDEF int icount; char *ibuf; struct pack *ipk #define UCOUNT icount #define IOMOVE(p, c, f) pkmove(p, ibuf, c, f) ; ibuf += c; UCOUNT -= c #define PADDR ipk #define TURNOFF #define LOCK #define UNLOCK #define SETERROR #define GENERROR(p, s) #define PACKSIZE 64 #define WINDOWS 3 #define PKDEBUG(l, f, s) { extern Debug; if (Debug >= l) fprintf(stderr, f, s);} #define PKASSERT(e, f, v) if (!(e)) {\ fprintf(stderr, "AERROR - (%s) ", "e");\ fprintf(stderr, f, v);\ pkfail();}; #endif pk, ibuf, icount #define SDEF int icount; char *ibuf; struct pinclude/sys/proc.h 444 0 33 11611 2531445241 7426 /* proc.h 4.8 81/04/23 */ /* * One structure allocated per active * process. It contains all data needed * about the process while the * process may be swapped out. * Other per process data (user.h) * is swapped with the process. */ struct proc { struct proc *p_link; /* linked list of running processes */ struct proc *p_rlink; struct pte *p_addr; /* u-area kernel map address */ char p_usrpri; /* user-priority based on p_cpu and p_nice */ char p_pri; /* priority, negative is high */ char p_cpu; /* cpu usage for scheduling */ char p_stat; char p_time; /* resident time for scheduling */ char p_nice; /* nice for cpu usage */ char p_slptime; /* time since last block */ char p_cursig; long p_sig; /* signals pending to this process */ long p_siga0; /* low bit of 2 bit signal action */ long p_siga1; /* high bit of 2 bit signal action */ #define p_ignsig p_siga0 /* ignored signal mask */ int p_flag; short p_uid; /* user id, used to direct tty signals */ short p_pgrp; /* name of process group leader */ short p_pid; /* unique process id */ short p_ppid; /* process id of parent */ short p_poip; /* count of page outs in progress */ short p_szpt; /* copy of page table size */ size_t p_tsize; /* size of text (clicks) */ size_t p_dsize; /* size of data space (clicks) */ size_t p_ssize; /* copy of stack size (clicks) */ size_t p_rssize; /* current resident set size in clicks */ size_t p_maxrss; /* copy of u.u_limit[MAXRSS] */ size_t p_swrss; /* resident set size before last swap */ swblk_t p_swaddr; /* disk address of u area when swapped */ caddr_t p_wchan; /* event process is awaiting */ struct text *p_textp; /* pointer to text structure */ int p_clktim; /* time to alarm clock signal */ struct pte *p_p0br; /* page table base P0BR */ struct proc *p_xlink; /* linked list of procs sharing same text */ short p_cpticks; /* ticks of cpu time */ float p_pctcpu; /* %cpu for this process during p_time */ short p_ndx; /* proc index for memall (because of vfork) */ short p_idhash; /* hashed based on p_pid for kill+exit+... */ struct proc *p_pptr; /* pointer to process structure of parent */ }; #define PIDHSZ 63 #define PIDHASH(pid) ((pid) % PIDHSZ) #ifdef KERNEL short pidhash[PIDHSZ]; struct proc *pfind(); #endif #ifdef KERNEL struct proc *proc, *procNPROC; /* the proc table itself */ int nproc; #define NQS 32 /* 32 run queues */ struct prochd { struct proc *ph_link; /* linked list of running processes */ struct proc *ph_rlink; } qs[NQS]; int whichqs; /* bit mask summarizi((ng non-empty qs's */ #endif /* stat codes */ #define SSLEEP 1 /* awaiting an event */ #define SWAIT 2 /* (abandoned state) */ #define SRUN 3 /* running */ #define SIDL 4 /* intermediate state in process creation */ #define SZOMB 5 /* intermediate state in process termination */ #define SSTOP 6 /* process being traced */ /* flag codes */ #define SLOAD 0x000001 /* in core */ #define SSYS 0x000002 /* swapper or pager process */ #define SLOCK 0x000004 /* process being swapped out */ #define SSWAP 0x000008 /* save area flag */ #define STRC 0x000010 /* process is being traced */ #define SWTED 0x000020 /* another tracing flag */ #define SULOCK 0x000040 /* user settable lock in core */ #define SPAGE 0x000080 /* process in page wait state */ #define SKEEP 0x000100 /* another flag to prevent swap out */ #define SDLYU 0x000200 /* delayed unlock of pages */ #define SWEXIT 0x000400 /* working on exiting */ #define SPHYSIO 0x000800 /* doing physical i/o (bio.c) */ #define SVFORK 0x001000 /* process resulted from vfork() */ #define SVFDONE 0x002000 /* another vfork flag */ #define SNOVM 0x004000 /* no vm, parent in a vfork() */ #define SPAGI 0x008000 /* init data space on demand, from inode */ #define SSEQL 0x010000 /* user warned of sequential vm behavior */ #define SUANOM 0x020000 /* user warned of random vm behavior */ #define STIMO 0x040000 /* timing out during sleep */ #define SDETACH 0x080000 /* detached inherited by init */ #define SNUSIG 0x100000 /* using new signal mechanism */ #define SOWEUPC 0x200000 /* owe process an addupc() call at next ast */ /* * parallel proc structure * to replace part with times * to be passed to parent process * in ZOMBIE state. * * THIS SHOULD BE DONE WITH A union() CONSTRUCTION */ struct xproc { struct proc *xp_link; struct proc *xp_rlink; struct pte *xp_addr; char xp_usrpri; char xp_pri; /* priority, negative is high */ char xp_cpu; /* cpu usage for scheduling */ char xp_stat; char xp_time; /* resident time for scheduling */ char xp_nice; /* nice for cpu usage */ char xp_slptime; char p_cursig; int xp_sig; /* signals pending to this process */ int xp_siga0; int xp_siga1; int xp_flag; short xp_uid; /* user id, used to direct tty signals */ short xp_pgrp; /* name of process group leader */ short xp_pid; /* unique process id */ short xp_ppid; /* process id of parent */ short xp_xstat; /* Exit status for wait */ struct vtimes xp_vm; }; r scheduling */ char xp_stat; char xp_time; /* resident time for scheduling */ char xp_nice; /* nice for cpu usage *include/sys/psl.h 444 0 33 2051 2531445241 7237 /* psl.h 4.4 81/04/22 */ /* * VAX program status longword */ #define PSL_C 0x00000001 /* carry bit */ #define PSL_V 0x00000002 /* overflow bit */ #define PSL_Z 0x00000004 /* zero bit */ #define PSL_N 0x00000008 /* negative bit */ #define PSL_ALLCC 0x0000000f /* all cc bits - unlikely */ #define PSL_T 0x00000010 /* trace enable bit */ #define PSL_IV 0x00000020 /* integer overflow enable bit */ #define PSL_FU 0x00000040 /* floating point underflow enable */ #define PSL_DV 0x00000080 /* decimal overflow enable bit */ #define PSL_IPL 0x001f0000 /* interrupt priority level */ #define PSL_PRVMOD 0x00c00000 /* previous mode (all on is user) */ #define PSL_CURMOD 0x03000000 /* current mode (all on is user) */ #define PSL_IS 0x04000000 /* interrupt stack */ #define PSL_FPD 0x08000000 /* first part done */ #define PSL_TP 0x40000000 /* trace pending */ #define PSL_CM 0x80000000 /* compatibility mode */ #define PSL_MBZ 0x3020ff00 /* must be zero bits */ #define PSL_USERSET (PSL_PRVMOD|PSL_CURMOD) #define PSL_USERCLR (PSL_IS|PSL_IPL|PSL_MBZ) 1f0000 /* interrupt priority level */ #define PSL_PRVMOD 0x00c00000 /* previous mode (all on is user) */ #define PSL_CURMOD 0x03000000 /* current mode (all on is user) */ #define PSL_IS 0x04000000 /* interrupt stack */ #define PSL_FPD 0x08000000 /* first part done */ #define PSL_TP 0x40000000 /* trace pending */ #define PSL_CM 0x80000000 /* compatibility mode */ #define PSL_MBZ 0x3020ff00 /* must be zero bits */ #define PSL_USERSET (PSL_PRVMOD|PSL_CURMOD) #definclude/sys/pte.h 444 0 33 4016 2531445241 7234 /* pte.h 4.9 81/05/14 */ /* * VAX page table entry * * There are two major kinds of pte's: those which have ever existed (and are * thus either now in core or on the swap device), and those which have * never existed, but which will be filled on demand at first reference. * There is a structure describing each. There is also an ancillary * structure used in page clustering. */ #ifndef LOCORE struct pte { unsigned int pg_pfnum:21, /* core page frame number or 0 */ :2, pg_vreadm:1, /* modified since vread (or with _m) */ pg_swapm:1, /* have to write back to swap */ pg_fod:1, /* is fill on demand (=0) */ pg_m:1, /* hardware maintained modified bit */ pg_prot:4, /* access control */ pg_v:1; /* valid bit */ }; struct hpte { unsigned int pg_pfnum:21, :2, pg_high:9; /* special for clustering */ }; struct fpte { unsigned int pg_blkno:20, /* file system block number */ pg_fileno:5, /* file mapped from or TEXT or ZERO */ pg_fod:1, /* is fill on demand (=1) */ :1, pg_prot:4, pg_v:1; }; #endif #define PG_V 0x80000000 #define PG_PROT 0x78000000 #define PG_M 0x04000000 #define PG_FOD 0x02000000 #define PG_VREADM 0x00800000 #define PG_PFNUM 0x001fffff #define PG_FZERO (NOFILE) #define PG_FTEXT (NOFILE+1) #define PG_FMAX (PG_FTEXT) #define PG_NOACC 0 #define PG_KW 0x10000000 #define PG_KR 0x18000000 #define PG_UW 0x20000000 #define PG_URKW 0x70000000 #define PG_URKR 0x78000000 /* * Pte related macros */ #define dirty(pte) ((pte)->pg_fod == 0 && (pte)->pg_pfnum && \ ((pte)->pg_m || (pte)->pg_swapm)) #ifndef LOCORE #ifdef KERNEL struct pte *vtopte(); /* utilities defined in locore.s */ extern struct pte Sysmap[]; extern struct pte Usrptmap[]; extern struct pte usrpt[]; extern struct pte Swapmap[]; extern struct pte Forkmap[]; extern struct pte Xswapmap[]; extern struct pte Xswap2map[]; extern struct pte Pushmap[]; extern struct pte Vfmap[]; extern struct pte mmap[]; extern struct pte msgbufmap[]; extern struct pte camap[]; extern struct pte Nexmap[][16]; #endif #endif (pte)->pg_m || (pte)->pg_swapm)) #ifndef LOCORE #ifdef KERNEL struct pte *vtopte(); /* utilities defined in locore.s */ extern struct pte Sysmap[]; extern struct pte Usrptmap[]; extern struct pte usrpt[]; extern struct pte Swapmap[]; extern struct pte Forkmap[]; extern struct pte Xswapmap[]; extern struct pte Xswap2map[]; extern struct pte Pushmap[]; extern struct pte Vfmap[]; extern struct pte mmap[]; extern struct pte msgbufmap[]; extern struct pte camap[]; extern struct pte Nexmap[][16]; include/sys/reboot.h 444 0 33 771 2531445242 7723 /* reboot.h 4.2 81/02/19 */ /* * Arguments to reboot system call. * These are passed to boot program in r11, * and on to init. */ #define RB_AUTOBOOT 0 /* flags for system auto-booting itself */ #define RB_ASKNAME 1 /* ask for file name to reboot from */ #define RB_SINGLE 2 /* reboot to single user only */ #define RB_NOSYNC 4 /* dont sync before reboot */ #define RB_HALT 8 /* don't reboot, just halt */ #define RB_PANIC 0 /* reboot due to panic */ #define RB_BOOT 1 /* reboot due to boot() */ "include/sys/reg.h 444 0 33 671 2531445242 7205 /* reg.h 4.2 81/02/19 */ /* * Location of the users' stored * registers relative to R0. * Usage is u.u_ar0[XX]. */ #define R0 (-18) #define R1 (-17) #define R2 (-16) #define R3 (-15) #define R4 (-14) #define R5 (-13) #define R6 (-12) #define R7 (-11) #define R8 (-10) #define R9 (-9) #define R10 (-8) #define R11 (-7) #define R12 (-21) #define R13 (-20) #define AP (-21) #define FP (-20) #define SP (-5) #define PS (-1) #define PC (-2) ,( 5t /\@,\D"include/sys/rkreg.h 444 0 33 11337 2531445243 7604 ((/* rkreg.h 4.2 81/05/09 */ #define NRK7CYL 815 #define NRK6CYL 411 #define NRKSECT 22 #define NRKTRK 3 struct rkdevice { short rkcs1; /* control status reg 1 */ short rkwc; /* word count */ u_short rkba; /* bus address */ short rkda; /* disk address */ short rkcs2; /* control status reg 2 */ short rkds; /* drive status */ short rker; /* driver error register */ short rkatt; /* attention status/offset register */ short rkcyl; /* current cylinder register */ short rkxxx; short rkdb; /* data buffer register */ short rkmr1; /* maint reg 1 */ short rkec1; /* burst error bit position */ short rkec2; /* burst error bit pattern */ short rkmr2; /* maint reg 2 */ short rkmr3; /* maint reg 3 */ }; /* rkcs1 */ #define RK_CCLR 0100000 /* controller clear (also error) */ #define RK_CERR RK_CCLR #define RK_DI 0040000 /* drive interrupt */ #define RK_DTCPAR 0020000 /* drive to controller parity */ #define RK_CFMT 0010000 /* 18 bit word format */ #define RK_CTO 0004000 /* controller timeout */ #define RK_CDT 0002000 /* drive type (rk07/rk06) */ /* bits 8 and 9 are the extended bus address */ #define RK_CRDY 0000200 /* controller ready */ #define RK_IE 0000100 /* interrupt enable */ /* bits 1 to 4 are the function code */ #define RK_GO 0000001 /* commands */ #define RK_SELECT 000 /* select drive */ #define RK_PACK 002 /* pack acknowledge */ #define RK_DCLR 004 /* drive clear */ #define RK_UNLOAD 006 /* unload */ #define RK_START 010 /* start spindle */ #define RK_RECAL 012 /* recalibrate */ #define RK_OFFSET 014 /* offset */ #define RK_SEEK 016 /* seek */ #define RK_READ 020 /* read data */ #define RK_WRITE 022 /* write data */ #define RK_RHDR 026 /* read header */ #define RK_WHDR 030 /* write header */ /* rkcs2 */ #define RKCS2_DLT 0100000 /* data late */ #define RKCS2_WCE 0040000 /* write check */ #define RKCS2_UPE 0020000 /* unibus parity */ #define RKCS2_NED 0010000 /* non-existant drive */ #define RKCS2_NEM 0004000 /* non-existant memory */ #define RKCS2_PGE 0002000 /* programming error */ #define RKCS2_MDS 0001000 /* multiple drive select */ #define RKCS2_UFE 0000400 /* unit field error */ #define RKCS2_OR 0000200 /* output ready */ #define RKCS2_IR 0000100 /* input ready */ #define RKCS2_SCLR 0000040 /* subsystem clear */ #define RKCS2_BAI 0000020 /* bus address increment inhibit */ #define RKCS2_RLS 0000010 /* release */ /* bits 0-2 are drive select */ #define RKCS2_BITS \ "\10\20DLT\17WCE\16UPE\15NED\14NEM\13PGE\12MDS\11UFE\ \10OR\7IR\6SCLR\5BAI\4RLS" #define RKCS2_HARD (RKCS2_NED|RKCS2_PGE) /* rkds */ #define RKDS_SVAL 0100000 /* status valid */ #define RKDS_CDA 0040000 /* current drive attention */ #define RKDS_PIP 0020000 /* positioning in progress */ /* bit 12 is spare */ #define RKDS_WRL 0004000 /* write lock */ /* bits 9 and 10 are spare */ #define RKDS_DDT 0000400 /* disk drive type */ #define RKDS_DRDY 0000200 /* drive ready */ #define RKDS_VV 0000100 /* volume valid */ #define RKDS_DROT 0000040 /* drive off track */ #define RKDS_SPLS 0000020 /* speed loss */ #define RKDS_ACLO 0000010 /* ac low */ #define RKDS_OFF 0000004 /* offset mode */ #define RKDS_DRA 0000001 /* drive available */ #define RKDS_DREADY (RKDS_DRA|RKDS_VV|RKDS_DRDY) #define RKDS_BITS \ "\10\20SVAL\17CDA\16PIP\14WRL\11DDT\ \10DRDY\7VV\6DROT\5SPLS\4ACLO\3OFF\1DRA" #define RKDS_HARD (RKDS_ACLO|RKDS_SPLS) /* rker */ #define RKER_DCK 0100000 /* data check */ #define RKER_UNS 0040000 /* drive unsafe */ #define RKER_OPI 0020000 /* operation incomplete */ #define RKER_DTE 0010000 /* drive timing error */ #define RKER_WLE 0004000 /* write lock error */ #define RKER_IDAE 0002000 /* invalid disk address error */ #define RKER_COE 0001000 /* cylinder overflow error */ #define RKER_HRVC 0000400 /* header vertical redundancy check */ #define RKER_BSE 0000200 /* bad sector error */ #define RKER_ECH 0000100 /* hard ecc error */ #define RKER_DTYE 0000040 /* drive type error */ #define RKER_FMTE 0000020 /* format error */ #define RKER_DRPAR 0000010 /* control-to-drive parity error */ #define RKER_NXF 0000004 /* non-executable function */ #define RKER_SKI 0000002 /* seek incomplete */ #define RKER_ILF 0000001 /* illegal function */ #define RKER_BITS \ "\10\20DCK\17UNS\16OPI\15DTE\14WLE\13IDAE\12COE\11HRVC\ \10BSE\7ECH\6DTYE\5FMTE\4DRPAR\3NXF\2SKI\1ILF" #define RKER_HARD \ (RKER_WLE|RKER_IDAE|RKER_COE|RKER_DTYE|RKER_FMTE|RKER_ILF) /* offset bits in rkas */ #define RKAS_P400 0020 /* +400 RK06, +200 RK07 */ #define RKAS_M400 0220 /* -400 RK06, -200 RK07 */ #define RKAS_P800 0040 /* +800 RK06, +400 RK07 */ #define RKAS_M800 0240 /* -800 RK06, -400 RK07 */ #define RKAS_P1200 0060 /* +800 RK06, +400 RK07 */ #define RKAS_M1200 0260 /* -1200 RK06, -1200 RK07 */ 6OPI\15DTE\14WLE\13IDAE\12COE\11HRVC\ \10BSE\7ECH\6DTYE\5FMTE\4DRPAR\3NXF\2SKI\1ILF" #define RKER_HARD \ (RKER_WLE|RKER_IDAE|RKER_COE|RKER_DTYE|RKER_FMTE|RKER_ILF) /* offset bits in rkas */ #define RKAS_P400 0020 /* +400 RK06, +200 RK07 */ #define RKAS_M400 0220 /* -400 RK06, -200include/sys/rpb.h 444 0 33 1007 2531445243 7226 /* rpb.h 4.3 81/05/01 */ /* * The restart parameter block, which is a page in (very) low * core which runs after a crash. Currently, the restart * procedure takes a dump. */ struct rpb { struct rpb *rp_selfref; /* self-reference */ int (*rp_dumprout)(); /* routine to be called */ long rp_checksum; /* checksum of 31 words of dumprout */ long rp_flag; /* set to 1 when dumprout runs */ /* the dump stack grows from the end of the rpb page not to reach here */ }; #ifdef KERNEL extern struct rpb rpb; #endif h 4.3 81/05/01 */ /* * The restart parameter block, which is a page in (very) low * core which runs after a crash. Currently, the restart * procedure takes a dump. */ struct rpb { struct rpb *rp_selfref; /* self-reference */ int (*rp_dumprout)(); /* routine to be called */ long rp_checksum; /* checksum of 31 words of dumprout */ long rp_flag; /* set to 1 when dumprout runs */ /* the dump stack grows from the end of the rpb page not to reach here */ }; #ifdef KERNEL extern struct rpb rpb; include/sys/scb.h 444 0 33 3711 2531445245 7220 /* scb.h 4.3 81/02/21 */ /* * VAX System control block layout */ struct scb { int (*scb_stray)(); /* reserved */ int (*scb_machchk)(); /* machine chack */ int (*scb_kspinval)(); /* KSP invalid */ int (*scb_powfail)(); /* power fail */ int (*scb_resinstr)(); /* reserved instruction */ int (*scb_custinst)(); /* XFC instr */ int (*scb_resopnd)(); /* reserved operand */ int (*scb_resaddr)(); /* reserved addr mode */ int (*scb_acv)(); /* access control violation */ int (*scb_tnv)(); /* translation not valid */ int (*scb_tracep)(); /* trace pending */ int (*scb_bpt)(); /* breakpoint instr */ int (*scb_compat)(); /* compatibility mode fault */ int (*scb_arith)(); /* arithmetic fault */ int (*scb_stray2)(); int (*scb_stray3)(); int (*scb_chmk)(); /* CHMK instr */ int (*scb_chme)(); /* CHME instr */ int (*scb_chms)(); /* CHMS instr */ int (*scb_chmu)(); /* CHMU instr */ int (*scb_sbisilo)(); /* SBI silo compare */ int (*scb_cmrd)(); /* corrected mem read data */ int (*scb_sbialert)(); /* SBI alert */ int (*scb_sbiflt)(); /* SBI fault */ int (*scb_wtime)(); /* memory write timeout */ int (*scb_stray4[8])(); int (*scb_soft[15])(); /* software interrupt */ int (*scb_timer)(); /* interval timer interrupt */ int (*scb_stray5[7])(); int (*scb_stray6[4])(); int (*scb_csdr)(); /* console storage receive */ int (*scb_csdx)(); /* console storage transmit */ int (*scb_ctr)(); /* console terminal receive */ int (*scb_ctx)(); /* console terminal transmit */ int (*scb_ipl14[16])(); /* device interrupts IPL 14 */ int (*scb_ipl15[16])(); /* " " IPL 15 */ int (*scb_ipl16[16])(); /* " " IPL 16 */ int (*scb_ipl17[16])(); /* " " IPL 17 */ int (*scb_ubaint[128])(); /* Unibus device intr */ }; #ifdef KERNEL extern struct scb scb; /* scb.scb_ubaint is the same as UNIvec */ #endif #define scbentry(f, how) ((int (*)())(((int)f)+how)) #define SCB_KSTACK 0 #define SCB_ISTACK 1 #define SCB_WCS 2 #define SCB_HALT 3 /* console terminal transmit */ int (*scb_ipl14[16])(include/sys/seg.h 444 0 33 173 2531445245 7206 /* seg.h 4.2 81/02/19 */ /* * Mapper addresses and bits */ #define RO PG_URKR /* access abilities */ #define RW PG_UW 16 */ int (*scb_ipl17[16])(); /* " " IPL 17 */ int (*scb_ubaint[128])(); /* Unibus device intr */ }; #ifdef KERNEL extern struct scb scb; /* scb.scb_ubaint is the same as UNIvec */ #endif #define scbentry(f, how) ((int (*)())(((int)f)+how)) #define SCB_KSTACK 0 #define SCB_ISTACK 1 #/( ,( 5 /\@,\D"((include/sys/stat.h 444 0 33 1621 2531445245 7422 /* stat.h 4.2 81/02/19 */ struct stat { dev_t st_dev; ino_t st_ino; unsigned short st_mode; short st_nlink; short st_uid; short st_gid; dev_t st_rdev; off_t st_size; time_t st_atime; time_t st_mtime; time_t st_ctime; }; #define S_IFMT 0170000 /* type of file */ #define S_IFDIR 0040000 /* directory */ #define S_IFCHR 0020000 /* character special */ #define S_IFBLK 0060000 /* block special */ #define S_IFREG 0100000 /* regular */ #define S_IFMPC 0030000 /* multiplexed char special */ #define S_IFMPB 0070000 /* multiplexed block special */ #define S_ISUID 0004000 /* set user id on execution */ #define S_ISGID 0002000 /* set group id on execution */ #define S_ISVTX 0001000 /* save swapped text even after use */ #define S_IREAD 0000400 /* read permission, owner */ #define S_IWRITE 0000200 /* write permission, owner */ #define S_IEXEC 0000100 /* execute/search permission, owner */ pecial */ #define S_IFREG 0100000 /* regular */ #define S_IFMPC 0030000 /* multiplexed char special */ #defininclude/sys/systm.h 444 0 33 4360 2552566521 7635 /* systm.h 4.17 81/05/05 */ /* * Random set of variables * used by more than one * routine. */ int hz; /* frequency of the clock */ int timezone; /* minutes west from greenwich */ int dstflag; /* daylight savings time in effect? */ char canonb[CANBSIZ]; /* buffer for erase and kill (#@) */ char version[]; /* system version */ int lbolt; /* time of day in 60th not in time */ time_t time; /* time in sec from 1970 */ time_t bootime; /* time at which booted */ int hand; /* current index into coremap used by daemon */ /* * Nblkdev is the number of entries * (rows) in the block switch. It is * set in binit/bio.c by making * a pass over the switch. * Used in bounds checking on major * device numbers. */ int nblkdev; /* * Number of character switch entries. * Set by cinit/prim.c */ int nchrdev; int nswdev; /* number of swap devices */ int mpid; /* generic for unique process id's */ char runin; /* scheduling flag */ char runout; /* scheduling flag */ int runrun; /* scheduling flag */ char kmapwnt; /* kernel map want flag */ char curpri; /* more scheduling */ int maxmem; /* actual max memory per process */ int physmem; /* physical memory on this CPU */ int nswap; /* size of swap space */ int updlock; /* lock for sync */ daddr_t rablock; /* block to be read ahead */ extern int intstack[]; /* stack for interrupts */ dev_t rootdev; /* device of the root */ dev_t dumpdev; /* device to take dumps on */ long dumplo; /* offset into dumpdev */ dev_t swapdev; /* swapping device */ dev_t argdev; /* device for argument lists */ dev_t pipedev; /* pipe device */ extern int icode[]; /* user init code */ extern int szicode; /* its size */ dev_t getmdev(); daddr_t bmap(); caddr_t calloc(); unsigned max(); unsigned min(); int memall(); int uchar(), schar(); int vmemall(); char *wmemall(); swblk_t vtod(); /* * Structure of the system-entry table */ extern struct sysent { int sy_narg; /* total number of arguments */ int (*sy_call)(); /* handler */ } sysent[]; char vmmap[]; /* poor name! */ int umbabeg,umbaend; /* where sensitive vm begins/ends */ int noproc; /* no one is running just now */ extern int catcher[256]; char *panicstr; int wantin; int boothowto; /* reboot flags, from console subsystem */ nsigned min(); int memall(); int uchar(), schar(); int vmemall(); char *wmemall(); swblk_t vtod(); /* * Structure of the system-entry table */ extern struct sysent { int sy_narg; /* total number of arguments */ int (*sy_call)(); /* handler */ } sysent[]; char vmmainclude/sys/text.h 444 0 33 2076 2531445246 7441 /* text.h 4.4 81/03/09 */ /* * Text structure. * One allocated per pure * procedure on swap device. * Manipulated by text.c */ #define NXDAD 12 /* param.h:MAXTSIZ / dmap.h:DMTEXT */ struct text { swblk_t x_daddr[NXDAD]; /* disk addresses of DMTEXT-page segments */ swblk_t x_ptdaddr; /* disk address of page table */ size_t x_size; /* size (clicks) */ struct proc *x_caddr; /* ptr to linked proc, if loaded */ struct inode *x_iptr; /* inode of prototype */ short x_rssize; short x_swrss; char x_count; /* reference count */ char x_ccount; /* number of loaded references */ char x_flag; /* traced, written flags */ char x_slptime; short x_poip; /* page out in progress count */ }; #ifdef KERNEL struct text *text, *textNTEXT; int ntext; #endif #define XTRC 01 /* Text may be written, exclusive use */ #define XWRIT 02 /* Text written into, must swap out */ #define XLOAD 04 /* Currently being read from file */ #define XLOCK 010 /* Being swapped in or out */ #define XWANT 020 /* Wanted for swapping */ #define XPAGI 040 /* Page in on demand from inode */ ed references */ char x_flag; /* traced, written flags */ char x_slptime; short x_poip; /* page out in progress count */ }; #ifdef KERNEL struct text *text, *textNTEXT; int ntext; #endif #define XTRC 01 /* Text may be written, exclusive use */ #define XWRIT 02 /* Text written into, must swap out */ #define XLOAD 04 /* Currently being read from file */ #define XLOCK 010 /* Being swapped in or out */ #define XWANT 020 /* Wanted for swapinclude/sys/timeb.h 444 0 33 250 2531445246 7525 /* timeb.h 4.2 81/02/19 */ /* * Structure returned by ftime system call */ struct timeb { time_t time; unsigned short millitm; short timezone; short dstflag; }; n progress count */ }; #ifdef KERNEL struct text *text, *textNTEXT; int ntext; #endif #define XTRC 01 /* Text may be written, exclusive use */ #define XWRIT 02 /* Text written into, must swap out */ #define XLOAD 04 /* Currently being read from fi/( ,( 5 /\@,\D"include/sys/times.h 444 0 33 376 2531445246 7557 /* times.h 4.2 81/02/19 */ /* * Structure returned by times() */ struct tms { time_t tms_utime; /* user time */ time_t tms_stime; /* system time */ time_t tms_cutime; /* user time, children */ time_t tms_cstime; /* system time, children */ }; #define XTRC 01 /* Text may be written, exclusive use */ #define XWRIT 02 /* Text written into, must swap out */ #define XLOAD 04 /* Currently being read from fi/( ,( 5 /\@,\D"include/sys/tmreg.h 444 0 33 4350 2531445246 7570 /* tmreg.h 4.5 81/03/09 */ /* * TM11 controller registers */ struct device { u_short tmer; /* error register, per drive */ u_short tmcs; /* control-status register */ short tmbc; /* byte/frame count */ u_short tmba; /* address */ short tmdb; /* data buffer */ short tmrd; /* read lines */ short tmmr; /* maintenance register */ }; #define b_repcnt b_bcount #define b_command b_resid /* bits in tmcs */ #define TM_GO 0000001 #define TM_OFFL 0000000 /* offline */ #define TM_RCOM 0000002 /* read */ #define TM_WCOM 0000004 /* write */ #define TM_WEOF 0000006 /* write-eof */ #define TM_SFORW 0000010 /* space forward */ #define TM_SREV 0000012 /* space backwards */ #define TM_WIRG 0000014 /* write with xtra interrecord gap */ #define TM_REW 0000016 /* rewind */ #define TM_SENSE TM_IE /* sense (internal to driver) */ #define tmreverseop(cmd) ((cmd)==TM_SREV || (cmd)==TM_REW) /* TM_SNS is a pseudo-op used to get tape status */ #define TM_IE 0000100 /* interrupt enable */ #define ((TM_CUR 0000200 /* control unit is ready */ #define TM_DCLR 0010000 /* drive clear */ #define TM_D800 0060000 /* select 800 bpi density */ #define TM_ERR 0100000 /* drive error summary */ /* bits in tmer */ #define TMER_ILC 0100000 /* illegal command */ #define TMER_EOF 0040000 /* end of file */ #define TMER_CRE 0020000 /* cyclic redundancy error */ #define TMER_PAE 0010000 /* parity error */ #define TMER_BGL 0004000 /* bus grant late */ #define TMER_EOT 0002000 /* at end of tape */ #define TMER_RLE 0001000 /* record length error */ #define TMER_BTE 0000400 /* bad tape error */ #define TMER_NXM 0000200 /* non-existant memory */ #define TMER_SELR 0000100 /* tape unit properly selected */ #define TMER_BOT 0000040 /* at beginning of tape */ #define TMER_CH7 0000020 /* 7 channel tape */ #define TMER_SDWN 0000010 /* gap settling down */ #define TMER_WRL 0000004 /* tape unit write protected */ #define TMER_RWS 0000002 /* tape unit rewinding */ #define TMER_TUR 0000001 /* tape unit ready */ #define TMER_BITS \ "\10\20ILC\17EOF\16CRE\15PAE\14BGL\13EOT\12RLE\11BTE\10NXM\ \7SELR\6BOT\5CH7\4SDWN\3WRL\2RWS\1TUR" #define TMER_HARD (TMER_ILC|TMER_EOT) #define TMER_SOFT (TMER_CRE|TMER_PAE|TMER_BGL|TMER_RLE|TMER_BTE|TMER_NXM) t beginning of tape */ #define TMER_CH7 0000020 /* 7 channel tape */ #define TMER_SDWN 0000010 /* gap settling down */ #define TMER_WRL 0000004 /* tape unit write protected */ #define TMER_RWS 0000002 /* tape unit rewinding */ #define TMER_TUR 0000001 /* tape unit ready */ include/sys/trace.h 444 0 33 4354 2531445247 7555 /* trace.h 4.7 81/04/18 */ /* * File system buffer tracing points; all trace */ #define TR_BREADHIT 0 /* buffer read found in cache */ #define TR_BREADMISS 1 /* buffer read not in cache */ #define TR_BWRITE 2 /* buffer written */ #define TR_BREADHITRA 3 /* buffer read-ahead found in cache */ #define TR_BREADMISSRA 4 /* buffer read-ahead not in cache */ #define TR_XFODMISS 5 /* exe fod read */ #define TR_XFODHIT 6 /* exe fod read */ #define TR_BRELSE 7 /* brelse */ /* * Memory allocator trace points; all trace the amount of memory involved */ #define TR_MALL 10 /* memory allocated */ /* * Paging trace points: all are */ #define TR_INTRANS 20 /* page intransit block */ #define TR_EINTRANS 21 /* page intransit wait done */ #define TR_FRECLAIM 22 /* reclaim from free list */ #define TR_RECLAIM 23 /* reclaim from loop */ #define TR_XSFREC 24 /* reclaim from free list instead of drum */ #define TR_XIFREC 25 /* reclaim from free list instead of fsys */ #define TR_WAITMEM 26 /* wait for memory in pagein */ #define TR_EWAITMEM 27 /* end memory wait in pagein */ #define TR_ZFOD 28 /* zfod page fault */ #define TR_EXFOD 29 /* exec fod page fault */ #define TR_VRFOD 30 /* vread fod page fault */ #define TR_CACHEFOD 31 /* fod in file system cache */ #define TR_SWAPIN 32 /* drum page fault */ #define TR_PGINDONE 33 /* page in done */ /* * System call trace points. */ #define TR_VADVISE 40 /* vadvise occurred with */ /* * Miscellaneous */ #define TR_STAMP 50 /* user said vtrace(VTR_STAMP, value); */ /* * This defines the size of the trace flags array. */ #define TR_NFLAGS 100 /* generous */ #define TRCSIZ 4096 /* * Specifications of the vtrace() system call, which takes one argument. */ #define VTRACE 64+51 #define VTR_DISABLE 0 /* set a trace flag to 0 */ #define VTR_ENABLE 1 /* set a trace flag to 1 */ #define VTR_VALUE 2 /* return value of a trace flag */ #define VTR_UALARM 3 /* set alarm to go off (sig 16) */ /* in specified number of hz */ #define VTR_STAMP 4 /* user specified stamp */ #ifdef KERNEL #ifdef TRACE char traceflags[TR_NFLAGS]; struct proc *traceproc; int tracebuf[TRCSIZ]; unsigned tracex; int tracewhich; #define trace(a,b,c) if (traceflags[a]) trace1(a,b,c) #endif #endif CE 64+51 #define VTR_DISABLE 0 /* set a trace flag to 0 */ #define VTR_ENABLE 1 /* set a trace flag to 1 */ #define VTR_VALUE 2 /* return value of a trace flag */ #define VTR_UALARM 3 /* set alarm to go off (sig 16) */ /* in specified number of hz */ #define VTR_STinclude/sys/trap.h 444 0 33 1500 2531445247 7413 /* trap.h 4.6 81/03/03 */ /* * Trap type values */ /* The first three constant values are known to the real world */ #define RESADFLT 0 /* reserved addressing fault */ #define PRIVINFLT 1 /* privileged instruction fault */ #define RESOPFLT 2 /* reserved operand fault */ /* End of known constants */ #define BPTFLT 3 /* bpt instruction fault */ #define XFCFLT 4 /* xfc instruction fault */ #define SYSCALL 5 /* chmk instruction (syscall trap) */ #define ARITHTRAP 6 /* arithmetic trap */ #define ASTFLT 7 /* software level 2 trap (ast deliv) */ #define SEGFLT 8 /* segmentation fault */ #define PROTFLT 9 /* protection fault */ #define TRCTRAP 10 /* trace trap */ #define COMPATFLT 11 /* compatibility mode fault */ #define PAGEFLT 12 /* page fault */ #define TABLEFLT 13 /* page table fault */ efine BPTFLT 3 /* bpt instruction fault */ #define XFCFLT 4 /* xfc instruction fault */ #define SYSCALL 5 /* chmk instruction (syscall trap) */ #define ARITHTRAP 6 /* arithmetic trap */include/sys/tsreg.h 444 0 33 13057 2531445250 7615 /* tsreg.h 4.1 81/03/21 */ /* * TS11 controller registers */ struct device { u_short tsdb; /* data buffer */ u_short tssr; /* status register */ }; /* Bits in (unibus) status register */ #define TS_SC 0100000 /* special condition (error) */ #define TS_UPE 0040000 /* Unibus parity error */ #define TS_SPE 0020000 /* serial bus parity error */ #define TS_RMR 0010000 /* register modification refused */ #define TS_NXM 0004000 /* nonexistant memory */ #define TS_NBA 0002000 /* need buffer address */ #define TS_XMEM 0001400 /* Unibus xmem bits */ #define TS_SSR 0000200 /* subsytem ready */ #define TS_OFL 0000100 /* off-line */ #define TS_FTC 0000060 /* fatal termination class */ #define TS_TC 0000016 /* termination class */ #define TS_SUCC 000 /* successful termination */ #define TS_ATTN 002 /* attention */ #define TS_ALERT 004 /* tape status alert */ #define TS_REJECT 06 /* function reject */ #define TS_RECOV 010 /* recoverable error */ #define TS_RECNM 012 /* recoverable error, no tape motion */ #define TS_UNREC 014 /* unrecoverable error */ #define TS_FATAL 016 /* fatal error */ #define TSSR_BITS \ "\10\20SC\17UPE\16SPE\15RMR\14NXM\13NBA\12A17\11A16\10SSR\ \7OFL\6FC1\5FC0\4TC2\3TC1\2TC0\1-" #define b_repcnt b_bcount #define b_command b_resid /* status message */ struct ts_sts { u_short s_sts; /* packet header */ u_short s_len; /* packet length */ u_short s_rbpcr; /* residual frame count */ u_short s_xs0; /* extended status 0 - 3 */ u_short s_xs1; u_short s_xs2; u_short s_xs3; }; /* Error codes in xstat 0 */ #define TS_TMK 0100000 /* tape mark detected */ #define TS_RLS 0040000 /* record length short */ #define TS_LET 0020000 /* logical end of tape */ #define TS_RLL 0010000 /* record length long */ #define TS_WLE 0004000 /* write lock error */ #define TS_NEF 0002000 /* non-executable function */ #define TS_ILC 0001000 /* illegal command */ #define TS_ILA 0000400 /* illegal address */ #define TS_MOT 0000200 /* capstan is moving */ #define TS_ONL 0000100 /* on-line */ #define TS_IES 0000040 /* interrupt enable status */ #define TS_VCK 0000020 /* volume check */ #define TS_PED 0000010 /* phase-encoded drive */ #define TS_WLK 0000004 /* write locked */ #define TS_BOT 0000002 /* beginning of tape */ #define TS_EOT 0000001 /* end of tape */ #define TSXS0_BITS \ "\10\20TMK\17RLS\16LET\15RLL\14WLE\13NEF\12ILC\11ILA\10MOT\ \7ONL\6IES\5VCK\4PED\3WLK\2BOT\1EOT" /* Error codes in xstat 1 */ #define TS_DLT 0100000 /* data late */ #define TS_COR 0020000 /* correctable data */ #define TS_CRS 0010000 /* crease detected */ #define TS_TIG 0004000 /* trash in the gap */ #define TS_DBF 0002000 /* deskew buffer full */ #define TS_SCK 0001000 /* speed check */ #define TS_IPR 0000200 /* invalid preamble */ #define TS_SYN 0000100 /* synchronization failure */ #define TS_IPO 0000040 /* invalid postamble */ #define TS_IED 0000020 /* invalid end of data */ #define TS_POS 0000010 /* postamble short */ #define TS_POL 0000004 /* postamble long */ #define TS_UNC 0000002 /* uncorrectable data */ #define TS_MTE 0000001 /* multitrack error */ #define TSXS1_BITS \ "\10\20DLT\17-\16COR\15CRS\14TIG\13DBF\12SCK\11-\10IPR\ \7SYN\6IPO\5IED\4POS\3POL\2UNC\1MTE" /* Error codes in xstat 2 */ #define TS_OPM 0100000 /* operation in progress */ #define TS_SIP 0040000 /* silo parity error */ #define TS_BPE 0020000 /* serial bus parity error */ #define TS_CAF 0010000 /* capstan acceleration failure */ #define TS_WCF 0002000 /* write card fail */ #define TS_DTP 0000400 /* dead track parity *((/ #define TS_DT 0000377 /* dead tracks */ #define TSXS2_BITS \ "\10\20OPM\17SIP\16BPE\15CAF\14-\13WCF\12-\11DTP" /* Error codes in xstat 3 */ #define TS_MEC 0177400 /* microdiagnostic error code */ #define TS_LMX 0000200 /* limit exceeded */ #define TS_OPI 0000100 /* operation incomplete */ #define TS_REV 0000040 /* reverse */ #define TS_CRF 0000020 /* capstan response fail */ #define TS_DCK 0000010 /* density check */ #define TS_NOI 0000004 /* noise record */ #define TS_LXS 0000002 /* limit exceeded statically */ #define TS_RIB 0000001 /* reverse into BOT */ #define TSXS3_BITS \ "\10\10LMX\7OPI\6REV\5CRF\4DCK\3NOI\2LXS\1RIB" /* command message */ struct ts_cmd { u_short c_cmd; /* command */ u_short c_loba; /* low order buffer address */ u_short c_hiba; /* high order buffer address */ #define c_repcnt c_loba u_short c_size; /* byte count */ }; /* commands and command bits */ #define TS_ACK 0100000 /* ack - release command packet */ #define TS_CVC 0040000 /* clear volume check */ #define TS_IE 0000200 #define TS_RCOM 0000001 #define TS_REREAD 0001001 /* read data retry */ #define TS_SETCHR 0000004 /* set characteristics */ #define TS_WCOM 0000005 #define TS_REWRITE 0001005 /* write data retry */ #define TS_RETRY 0001000 /* retry bit for read and write */ #define TS_SFORW 0000010 /* forward space record */ #define TS_SREV 0000410 /* reverse space record */ #define TS_SFORWF 0001010 /* forward space file */ #define TS_SREVF 0001410 /* reverse space file */ #define TS_REW 0002010 /* rewind */ #define TS_OFFL 0000412 /* unload */ #define TS_WEOF 0000011 /* write tape mark */ #define TS_SENSE 0000017 /* get status */ /* characteristics data */ struct ts_char { long char_addr; /* address of status packet */ u_short char_size; /* its size */ u_short char_mode; /* characteristics */ }; /* characteristics */ #define TS_ESS 0200 /* enable skip tape marks stop */ #define TS_ENB 0100 /* ??? */ #define TS_EAI 0040 /* enable attention interrupts */ #define TS_ERI 0020 /* enable message buffer release interrupts */ * unload */ #define TS_WEOF 0000011 /* write tape mark */ #define TS_SENSE 0000017 /* get status */ /* characteristics data */ struct ts_char { long char_addr; /* address of status packet */ u_short char_size; /* its size */ u_short char_mode; /* characteristics */ }; /* characteristics */ #define TS_ESS 0200 /* enable skip tape marks stop */ #define TS_ENB 0100 /* ??? */ #define TS_EAI 0040 /* enable attention interrupts */ #define TS_ERI 0020 include/sys/tty.h 444 0 33 10207 2552566374 7321 /* tty.h 4.5 81/06/11 */ #ifdef KERNEL #include "../h/ioctl.h" #else #include #endif #include /* * A clist structure is the head * of a linked list queue of characters. * The characters are stored in * blocks containing a link and CBSIZE (param.h) * characters. The routines getc, putc, ... in prim.c * manipulate these structures. */ struct clist { int c_cc; /* character count */ char *c_cf; /* pointer to first char */ char *c_cl; /* pointer to last char */ }; /* * A tty structure is needed for * each UNIX character device that * is used for normal terminal IO. * The routines in tty.c handle the * common code associated with * these structures. The definition * and device dependent code is in * each driver. (cons.c, dh.c, dz.c, kl.c) */ struct tty { union { struct { struct clist T_rawq; struct clist T_canq; } t_t; #define t_rawq t_nu.t_t.T_rawq /* raw characters or partial line */ #define t_canq t_nu.t_t.T_canq /* complete input lines */ struct { struct buf *T_bufp; char *T_cp; int T_inbuf; int T_rec; } t_n; #define t_bufp t_nu.t_n.T_bufp /* buffer allocated to protocol */ #define t_cp t_nu.t_n.T_cp /* pointer into the ripped off buffer */ #define t_inbuf t_nu.t_n.T_inbuf /* number chars in the buffer */ #define t_rec t_nu.t_n.T_rec /* have a complete record */ } t_nu; struct clist t_outq; /* output list to device */ int (*t_oproc)(); /* routine to start output */ int (*t_iproc)(); /* routine to start input */ struct chan *t_chan; /* destination channel */ caddr_t t_linep; /* aux line discipline pointer */ caddr_t t_addr; /* device address */ dev_t t_dev; /* device number */ short t_flags; /* mode, settable by ioctl call */ short t_state; /* internal state, not visible externally */ short t_pgrp; /* process group name */ char t_delct; /* number of delimiters in raw q */ char t_line; /* line discipline */ char t_col; /* printing column of device */ char t_erase; /* erase character */ char t_kill; /* kill character */ char t_char; /* character temporary */ char t_ispeed; /* input speed */ char t_ospeed; /* output speed */ /* begin local */ char t_rocount; /* chars input since a ttwrite() */ char t_rocol; /* t_col when first input this line */ struct ltchars t_lchr; /* local special characters */ short t_local; /* local mode word */ short t_lstate; /* local state bits */ /* end local */ union { struct tchars t_chr; struct clist t_ctlq; } t_un; }; #define tun tp->t_un.t_chr #define tlun tp->t_lchr #define TTIPRI 28 #define TTOPRI 29 #define CTRL(c) ('c'&037) /* default special characters */ #define CERASE '#' #define CEOT CTRL(d) #define CKILL '@' #define CQUIT 034 /* FS, cntl shift L */ #define CINTR 0177 /* DEL */ #define CSTOP CTRL(s) #define CSTART CTRL(q) #define CBRK 0377 /* limits */ #define NSPEEDS 16 #define TTMASK 15 #ifdef KERNEL short tthiwat[NSPEEDS], ttlowat[NSPEEDS]; #define TTHIWAT(tp) tthiwat[(tp)->t_ospeed&TTMASK] #define TTLOWAT(tp) ttlowat[(tp)->t_ospeed&TTMASK] #endif #define TTYHOG 255 /* hardware bits */ #define DONE 0200 #define IENABLE 0100 /* internal state bits */ #define TIMEOUT 01 /* delay timeout in progress */ #define WOPEN 02 /* waiting for open to complete */ #define ISOPEN 04 /* device is open */ #define FLUSH 010 /* outq has been flushed during DMA */ #define CARR_ON 020 /* software copy of carrier-present */ #define BUSY 040 /* output in progress */ #define ASLEEP 0100 /* wakeup when output done */ #define XCLUDE 0200 /* exclusive-use flag against open */ #define TTSTOP 0400 /* output stopped by ctl-s */ #define HUPCLS 01000 /* hang up upon last close */ #define TBLOCK 02000 /* tandem queue blocked */ #define SPEEDS 04000 /* t_ispeed and t_ospeed used by driver */ #define NDQB 010000 #define EXTPROC 020000 /* external processor (kmc) */ #define FSLEEP 040000 /* Wakeup on input framing */ #define BEXT 0100000 /* use (external) system buffers */ /* define partab character types */ #define ORDINARY 0 #define CONTROL 1 #define BACKSPACE 2 #define NEWLINE 3 #define TAB 4 #define VTAB 5 #define RETURN 6 /* define dmctl actions */ #define DMSET 0 #define DMBIS 1 #define DMBIC 2 m queue blocked */ #define SPEEDS 04000 /* t_ispeed and t_ospeed used by driver */ #define NDQB 010000 #define EXTPROC 020000 /* external processor (kmc) */ #define FSLEEP 040000 /* Wakeup on input framing */ #define BEXT 0100000 /* use (external) system buffers */ /* define partab character types */ #define ORDINARY 0 #define CONTROL 1 #define BACKSPACE 2 #define NEWLinclude/sys/types.h 444 0 33 1505 2531445251 7611 /* types.h 4.1 81/03/21 */ /* * Basic system types and major/minor device constructing/busting macros. */ /* major part of a device */ #define major(x) ((int)(((unsigned)(x)>>8)&0377)) /* minor part of a device */ #define minor(x) ((int)((x)&0377)) /* make a device number */ #define makedev(x,y) ((dev_t)(((x)<<8) | (y))) typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; /* SHOULD USE long RATHER THAN int HERE BUT IT WOULD GIVE LINT ON THE KERNEL */ /* GASTRIC DISTRESS AND DON'T HAVE TIME TO FIX THAT JUST NOW */ typedef struct _physadr { int r[1]; } *physadr; typedef int daddr_t; typedef char * caddr_t; typedef u_short ino_t; typedef int swblk_t; typedef int size_t; typedef int time_t; typedef int label_t[14]; typedef short dev_t; typedef int off_t; ))) typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; /* SHOULD USE long RATHER THAN int HERE BUT IT WOULD GIVE LINinclude/sys/ubareg.h 444 0 33 10563 2531445251 7736 /* ubareg.h 4.22 81/04/03 */ /* * VAX UNIBUS adapter registers */ #ifndef LOCORE /* * UBA hardware registers */ struct uba_regs { int uba_cnfgr; /* configuration register */ int uba_cr; /* control register */ int uba_sr; /* status register */ int uba_dcr; /* diagnostic control register */ int uba_fmer; /* failed map entry register */ int uba_fubar; /* failed UNIBUS address register */ int pad1[2]; int uba_brsvr[4]; int uba_brrvr[4]; /* receive vector registers */ int uba_dpr[16]; /*(( buffered data path register */ int pad2[480]; struct pte uba_map[496]; /* unibus map register */ int pad3[16]; /* no maps for device address space */ }; #endif #if VAX780 /* uba_cnfgr */ #define UBACNFGR_UBINIT 0x00040000 /* unibus init asserted */ #define UBACNFGR_UBPDN 0x00020000 /* unibus power down */ #define UBACNFGR_UBIC 0x00010000 /* unibus init complete */ /* uba_cr */ #define UBACR_MRD16 0x40000000 /* map reg disable bit 4 */ #define UBACR_MRD8 0x20000000 /* map reg disable bit 3 */ #define UBACR_MRD4 0x10000000 /* map reg disable bit 2 */ #define UBACR_MRD2 0x08000000 /* map reg disable bit 1 */ #define UBACR_MRD1 0x04000000 /* map reg disable bit 0 */ #define UBACR_IFS 0x00000040 /* interrupt field switch */ #define UBACR_BRIE 0x00000020 /* BR interrupt enable */ #define UBACR_USEFIE 0x00000010 /* UNIBUS to SBI error field IE */ #define UBACR_SUEFIE 0x00000008 /* SBI to UNIBUS error field IE */ #define UBACR_CNFIE 0x00000004 /* configuration IE */ #define UBACR_UPF 0x00000002 /* UNIBUS power fail */ #define UBACR_ADINIT 0x00000001 /* adapter init */ /* uba_sr */ #define UBASR_BR7FULL 0x08000000 /* BR7 receive vector reg full */ #define UBASR_BR6FULL 0x04000000 /* BR6 receive vector reg full */ #define UBASR_BR5FULL 0x02000000 /* BR5 receive vector reg full */ #define UBASR_BR4FULL 0x01000000 /* BR4 receive vector reg full */ #define UBASR_RDTO 0x00000400 /* UNIBUS to SBI read data timeout */ #define UBASR_RDS 0x00000200 /* read data substitute */ #define UBASR_CRD 0x00000100 /* corrected read data */ #define UBASR_CXTER 0x00000080 /* command transmit error */ #define UBASR_CXTMO 0x00000040 /* command transmit timeout */ #define UBASR_DPPE 0x00000020 /* data path parity error */ #define UBASR_IVMR 0x00000010 /* invalid map register */ #define UBASR_MRPF 0x00000008 /* map register parity failure */ #define UBASR_LEB 0x00000004 /* lost error */ #define UBASR_UBSTO 0x00000002 /* UNIBUS select timeout */ #define UBASR_UBSSYNTO 0x00000001 /* UNIBUS slave sync timeout */ #define UBASR_BITS \ "\20\13RDTO\12RDS\11CRD\10CXTER\7CXTMO\6DPPE\5IVMR\4MRPF\3LEB\2UBSTO\1UBSSYNTO" /* uba_brrvr[] */ #define UBABRRVR_AIRI 0x80000000 /* adapter interrupt request */ #define UBABRRVR_DIV 0x0000ffff /* device interrupt vector field */ #endif VAX780 /* uba_dpr */ #if VAX780 #define UBADPR_BNE 0x80000000 /* buffer not empty - purge */ #define UBADPR_BTE 0x40000000 /* buffer transfer error */ #define UBADPR_DPF 0x20000000 /* DP function (RO) */ #define UBADPR_BS 0x007f0000 /* buffer state field */ #define UBADPR_BUBA 0x0000ffff /* buffered UNIBUS address */ #endif VAX780 #if VAX750 #define UBADPR_ERROR 0x80000000 /* error occurred */ #define UBADPR_NXM 0x40000000 /* nxm from memory */ #define UBADPR_UCE 0x20000000 /* uncorrectable error */ #define UBADPR_PURGE 0x00000001 /* purge bdp */ #endif VAX750 /* uba_mr[] */ #define UBAMR_MRV 0x80000000 /* map register valid */ #define UBAMR_BO 0x02000000 /* byte offset bit */ #define UBAMR_DPDB 0x01e00000 /* data path designator field */ #define UBAMR_SBIPFN 0x000fffff /* SBI page address field */ #define UBAMR_DPSHIFT 21 /* shift to data path designator */ /* * Number of UNIBUS map registers. We can't use the last 8k of UNIBUS * address space for i/o transfers since it is used by the devices, * hence have slightly less than 256K of UNIBUS address space. */ #define NUBMREG 496 /* * Number of unibus buffered data paths and possible uba's per cpu type. */ #define NBDP780 15 #define NBDP750 3 #define NBDP7ZZ 0 #define MAXNBDP 15 #define NUBA780 4 #define NUBA750 1 #define NUBA7ZZ 1 #if VAX780 #define MAXNUBA 4 #else #define MAXNUBA 1 #endif /* * Formulas for locations of the last 8k of UNIBUS memory * for each possible uba. */ #if VAX7ZZ #define UMEM7ZZ ((u_short *)(0xffe000)) #endif #if VAX750 #define UMEM750(i) ((u_short *)(0xffe000-(i)*0x40000)) #endif #if VAX780 #define UMEM780(i) ((u_short *)(0x2013e000+(i)*0x40000)) #endif uba's per cpu type. */ #define NBDP780 15 #define NBDP750 3 #define NBDP7ZZ 0 #define MAXNBDP 15 #define NUBA780 4 #define NUBA750 1 #defininclude/sys/ubavar.h 444 0 33 14662 2531445252 7756 /* ubavar.h 4.18 81/03/09 */ /* * This file contains definitions related to the kernel structures * for dealing with the unibus adapters. * * Each uba has a uba_hd structure. * Each unibus controller which is not a device has a uba_ctlr structure. * Each unibus device has a uba_device structure. */ #ifndef LOCORE /* * Per-uba structure. * * This structure holds the interrupt vector for the uba, * and its address in physical and virtual space. At boot time * we determine the devices attached to the uba's and their * interrupt vectors, filling in uh_vec. We free the map * register and bdp resources of the uba into the structures * defined here. * * During normal operation, resources are allocated and returned * to the structures here. We watch the number of passive releases * on each uba, and if the number is excessive may reset the uba. * * When uba resources are needed and not available, or if a device * which can tolerate no other uba activity (rk07) gets on the bus, * then device drivers may have to wait to get to the bus and are * queued here. It is also possible for processes to block in * the unibus driver in resource wait (mrwant, bdpwant); these * wait states are also recorded here. */ struct uba_hd { struct uba_regs *uh_uba; /* virt addr of uba */ struct uba_regs *uh_physuba; /* phys addr of uba */ int (**uh_vec)(); /* interrupt vector */ struct uba_device *uh_actf; /* head of queue to transfer */ struct uba_device *uh_actl; /* tail of queue to transfer */ short uh_mrwant; /* someone is waiting for map reg */ short uh_bdpwant; /* someone awaits bdp's */ int uh_bdpfree; /* free bdp's */ int uh_hangcnt; /* number of ticks hung */ int uh_zvcnt; /* number of 0 vectors */ short uh_users; /* transient bdp use count */ short uh_xclu; /* an rk07 is using this uba! */ #define UAMSIZ 25 struct map *uh_map; /* buffered data path regs free */ }; #ifndef LOCORE /* * Per-controller structure. * (E.g. one for each disk and tape controller, and other things * which use and release buffered data paths.) * * If a controller has devices attached, then there are * cross-referenced uba_drive structures. * This structure is the one which is queued in unibus resource wait, * and saves the information about unibus resources which are used. * The queue of devices waiting to transfer is also attached here. */ struct uba_ctlr { struct uba_driver *um_driver; short um_ctlr; /* controller index in driver */ short um_ubanum; /* the uba it is on */ short um_alive; /* controller exists */ int (**um_intr)(); /* interrupt handler(s) */ caddr_t um_addr; /* address of device in i/o space */ struct uba_hd *um_hd; /* the driver saves the prototype command here for use in its go routine */ int um_cmd; /* communication to dgo() */ int um_ubinfo; /* save unibus registers, etc */ struct buf um_tab; /* queue of devices for this controller */ }; /* * Per ``device'' structure. * (A controller has devices or uses and releases buffered data paths). * (Everything else is a ``device''.) * * If a controller has many drives attached, then there will * be several uba_device structures associated with a single uba_ctlr * structure. * * This structure contains all the information necessary to run * a unibus device such as a dz or a dh. It also contains information * for slaves of unibus controllers as to which device on the slave * this is. A flags field here can also be given in the system specification * and is used to tell which dz lines are hard wired or other device * specific parameters. */ struct uba_device { struct uba_driver *ui_driver; short ui_unit; /* unit number on the system */ short ui_ctlr; /* mass ctlr number; -1 if none */ short ui_ubanum; /* the uba it is on */ short ui_slave; /* slave on controller */ int (**ui_intr)(); /* interrupt handler(s) */ caddr_t ui_addr; /* address of device in i/o space */ short ui_dk; /* if init 1 set to number for iostat */ short ui_flags; /* parameter from system specification */ short ui_alive; /* device exists */ short ui_type; /* driver specific type information */ caddr_t ui_physaddr; /* phys addr, for standalone (dump) code */ /* this is the forward link in a list of devices on a controller */ struct uba_device *ui_forw; /* if the device is connected to a controller, this is the controller */ struct uba_ctlr *ui_mi; struct uba_hd *ui_hd; }; #endif /* * Per-driver structure. * * Each unibus driver defines entries for a set of routines * as well as an array of types which are acceptable to it. * These are used at boot time by the configuration program. */ struct uba_driver { int (*ud_probe)(); /* see if a driver is really there */ int (*ud_slave)(); /* see if a slave is there */ int (*ud_attach)(); /* setup driver for a slave */ int (*ud_dgo)(); /* fill csr/ba to start transfer */ u_short *ud_addr; /* device csr addresses */ char *ud_dname; /* name of a device */ struct uba_device **ud_dinfo; /* backpointers to ubdinit structs */ char *ud_mname; /* name of a controller */ struct uba_ctlr **ud_minfo; /* backpointers to ubminit structs */ short ud_xclu; /* want exclusive use of bdp's */ }; #endif /* * Flags to UBA map/bdp allocation routines */ #define UBA_NEEDBDP 1 /* transfer needs a bdp */ #define UBA_CANTWAIT 2 /* don't block me */ #define UBA_NEED16 3 /* need 16 bit addresses only */ #ifndef LOCORE #ifdef KERNEL /* * UBA related kernel variables */ int numuba; /* number of uba's */ extern struct uba_hd uba_hd[]; /* * Ubminit and ubdinit initialize the mass storage cont((roller and * device tables specifying possible devices. */ extern struct uba_ctlr ubminit[]; extern struct uba_device ubdinit[]; /* * UNIbus device address space is mapped by UMEMmap * into virtual address umem[][]. */ extern struct pte UMEMmap[][16]; /* uba device addr pte's */ extern char umem[][16*NBPG]; /* uba device addr space */ /* * Since some VAXen vector their first (and only) unibus interrupt * vector just adjacent to the system control block, we must * allocate space there when running on ``any'' cpu. This space is * used for the vector for uba0 on all cpu's. */ extern int (*UNIvec[])(); /* unibus vec for uba0 */ #if VAX780 /* * On 780's, we must set the scb vectors for the nexus of the * UNIbus adaptors to vector to locore unibus adaptor interrupt dispatchers * which make 780's look like the other VAXen. */ extern Xua0int(), Xua1int(), Xua2int(), Xua3int(); #endif VAX780 #endif KERNEL #endif !LOCORE cent to the system control block, we must * allocate space there when runninginclude/sys/upreg.h 444 0 33 13632 2531445252 7614 /* upreg.h 4.5 81/04/02 */ /* * Unibus rm emulation via sc21: * registers and bits. */ struct updevice { u_short upcs1; /* control and status register 1 */ short upwc; /* word count register */ u_short upba; /* UNIBUS address register */ u_short upda; /* desired address register */ u_short upcs2; /* control and status register 2 */ u_short upds; /* drive Status */ u_short uper1; /* error register 1 */ u_short upas; /* attention summary */ u_short upla; /* look ahead */ u_short updb; /* data buffer */ u_short upmr; /* maintenance */ u_short updt; /* drive type */ u_short upsn; /* serial number */ u_short upof; /* offset register */ u_short updc; /* desired cylinder address register */ u_short uphr; /* holding register */ u_short upmr2; /* maintenance register 2 */ u_short uper2; /* error register 2 */ u_short upec1; /* burst error bit position */ u_short upec2; /* burst error bit pattern */ }; /* Other bits of upcs1 */ #define UP_SC 0100000 /* special condition */ #define UP_TRE 0040000 /* transfer error */ #define UP_PSEL 0010000 /* port select */ #define UP_DVA 0004000 /* drive available */ /* bits 8 and 9 are the extended address bits */ #define UP_RDY 0000200 /* controller ready */ #define UP_IE 0000100 /* interrupt enable */ /* bits 5-1 are the command */ #define UP_GO 0000001 /* commands */ #define UP_NOP 000 #define UP_SEEK 004 /* seek */ #define UP_RECAL 006 /* recalibrate */ #define UP_DCLR 010 /* drive clear */ #define UP_RELEASE 012 /* release */ #define UP_OFFSET 014 /* offset */ #define UP_RTC 016 /* return to center-line */ #define UP_PRESET 020 /* read-in preset */ #define UP_PACK 022 /* pack acknowledge */ #define UP_DMABAND 024 /* dma bandwidth set */ #define UP_SEARCH 030 /* search */ #define UP_WCDATA 050 /* write check data */ #define UP_WCHDR 052 /* write check header and data */ #define UP_WCOM 060 /* write */ #define UP_WHDR 062 /* write header and data */ #define UP_RCOM 070 /* read data */ #define UP_RHDR 072 /* read header and data */ #define UP_BOOT 074 /* boot */ #define UP_FORMAT 076 /* format */ /* upcs2 */ #define UPCS2_DLT 0100000 /* data late */ #define UPCS2_WCE 0040000 /* write check error */ #define UPCS2_UPE 0020000 /* UNIBUS parity error */ #define UPCS2_NED 0010000 /* nonexistent drive */ #define UPCS2_NEM 0004000 /* nonexistent memory */ #define UPCS2_PGE 0002000 /* programming error */ #define UPCS2_MXF 0001000 /* missed transfer */ #define UPCS2_MDPE 0000400 /* massbus data parity error (0) */ #define UPCS2_OR 0000200 /* output ready */ #define UPCS2_IR 0000100 /* input ready */ #define UPCS2_CLR 0000040 /* controller clear */ #define UPCS2_PAT 0000020 /* parity test */ #define UPCS2_BAI 0000010 /* address increment inhibit */ /* bits 0-2 are drive select */ #define UPCS2_BITS \ "\10\20DLT\17WCE\16UPE\15NED\14NEM\13PGE\12MXF\11MDPE\ \10OR\7IR\6CLR\5PAT\4BAI" /* upds */ #define UPDS_ATA 0100000 /* attention active */ #define UPDS_ERR 0040000 /* composite drive error */ #define UPDS_PIP 0020000 /* positioning in progress */ #define UPDS_MOL 0010000 /* medium on line */ #define UPDS_WRL 0004000 /* write locked */ #define UPDS_LST 0002000 /* last sector transferred */ #define UPDS_PGM 0001000 /* programmable */ #define UPDS_DPR 0000400 /* drive present */ #define UPDS_DRY 0000200 /* drive ready */ #define UPDS_VV 0000100 /* volume valid */ /* bits 1-5 are spare */ #define UPDS_OM 0000001 /* offset mode */ #define UPDS_DREADY (UPDS_DPR|UPDS_DRY|UPDS_MOL|UPDS_VV) #define UPDS_BITS \ "\10\20ATA\17ERR\16PIP\15MOL\14WRL\13LST\12PGM\11DPR\10DRY\7VV\1OM" /* uper1 */ #define UPER1_DCK 0100000 /* data check */ #define UPER1_UNS 0040000 /* drive unsafe */ #define UPER1_OPI 0020000 /* operation incomplete */ #define UPER1_DTE 0010000 /* drive timing error */ #define UPER1_WLE 0004000 /* write lock error */ #define UPER1_IAE 0002000 /* invalid address error */ #define UPER1_AOE 0001000 /* address overflow error */ #define UPER1_HCRC 0000400 /* header crc error */ #define UPER1_HCE 0000200 /* header compare error */ #define UPER1_ECH 0000100 /* ecc hard error */ #define UPER1_WCF 0000040 /* write clock fail (0) */ #define UPER1_FER 0000020 /* format error */ #define UPER1_PAR 0000010 /* parity error */ #define UPER1_RMR 0000004 /* register modification refused */ #define UPER1_ILR 0000002 /* illegal register */ #define UPER1_ILF 0000001 /* illegal function */ #define UPER1_BITS \ "\10\20DCK\17UNS\16OPI\15DTE\14WLE\13IAE\12AOE\11HCRC\10HCE\ \7ECH\6WCF\5FER\4PAR\3RMR\2ILR\1ILF" /* uphr */ /* write these int uphr and then read back values */ #define UPHR_MAXCYL 0100027 /* max cyl address */ #define UPHR_MAXTRAK 0100030 /* max track address */ #define UPHR_MAXSECT 0100031 /* max sector address */ /* uper2 */ #define UPER2_BSE 0100000 /* bad sector error */ #define UPER2_SKI 0040000 /* seek incomplete */ #define UPER2_OPE 0020000 /* operator plug error */ #define UPER2_IVC 0010000 /* invalid command */ #define UPER2_LSC 0004000 /* loss of sector clock */ #define UPER2_LBC 0002000 /* loss of bit clock */ #define UPER2_MDS 0001000 /* multiple drive select */ #define UPER2_DCU 0000400 /* dc power unsafe */ #define UPER2_DVC 0000200 /* device check */ #define UPER2_ACU 0000100 /* ac power unsafe */ /* bits 5 and 4 are spare */ #define UPER2_DPE 0000010 /* data parity error (0) */ /* bits 2-0 are spare */ #define UPER2_BITS \ "\10\20BSE\17SKI\16OPE\15IVC\14LSC\13LBC\12MDS\11DCU\10DVC\7ACU\4DPE" /* upof */ #define UPOF_FMT22 0010000 /* 16 bit format */ #define UPOF_ECI 0004000 /* ecc inhibit */ #define UPOF_HCI 0002000 /* header compare inhibit */ /* THE SC21 ACTUALLY JUST IMPLEMENTS ADVANCE/RETARD... */ #define UPOF_P400 0020 /* +400 uinches */ #define UPOF_M400 0220 /* -400 uinches */ #define UPOF_P800 0040 /* +800 uinches */ #define UPOF_M800 0240 /* -800 uinches */ #define UPOF_P1200 0060 /* +1200 uinches */ #define UPOF_M1200 0260 /* -1200 uinches */ 2MDS\11DCU\10DVC\7ACU\4DPE" /* upof */ #define UPOF_FMT22 0010000 /* 16 bit format */ #define UPOF_Einclude/sys/user.h 444 0 33 11312 2531445253 7442 /* user.h 4.8 81/04/28 */ #ifdef KERNEL #include "../h/pcb.h" #include "../h/dmap.h" #include "../h/vtimes.h" #include "assym.s" #else #include #include #include #endif /* * The user structure. * One allocated per process. * Contains all per process data * that doesn't need to be referenced * while the process is swapped. * The user block is UPAGES*NBPG bytes * long; resides at virtual user * loc 0x80000000-UPAGES*NBPG; contains the system * stack per user; is cross referenced * with the proc structure for the * same process. */ #define SHSIZE 32 struct user { struct pcb u_pcb; int u_arg[5]; /* arguments to current system call */ label_t u_qsav; /* for non-local gotos on interrupts */ char u_segflg; /* 0:user D; 1:system; 2:user I */ char u_error; /* return error code */ short u_uid; /* effective user id */ short u_gid; /* effective group id */ short u_ruid; /* real user id */ short u_rgid; /* real group id */ struct proc *u_procp; /* pointer to proc structure */ int *u_ap; /* pointer to arglist */ union { /* syscall return values */ struct { int R_val1; int R_val2; } u_rv; #define r_val1 u_rv.R_val1 #define r_val2 u_rv.R_val2 off_t r_off; time_t r_time; } u_r; caddr_t u_base; /* base address for IO */ unsigned int u_count; /* bytes remaining for IO */ off_t u_offset; /* offset in file for IO */ struct inode *u_cdir; /* pointer to inode of current directory */ struct inode *u_rdir; /* root directory of current process */ char u_dbuf[DIRSIZ]; /* current pathname component */ caddr_t u_dirp; /* pathname pointer */ struct direct u_dent; /* current directory entry */ struct inode *u_pdir; /* inode of parent directory of dirp */ struct file *u_ofile[NOFILE]; /* pointers to file structures of open files */ char u_pofile[NOFILE]; /* per-process flags of open files */ #define EXCLOSE 01 /* auto-close on exec */ label_t u_ssav; /* label variable for swapping */ int (*u_signal[NSIG])(); /* dispo((sition of signals */ int u_code; /* ``code'' to trap */ /* on SIGILL code passes compatibility mode fault address */ /* on SIGFPE code passes more specific kind of floating point fault */ int *u_ar0; /* address of users saved R0 */ struct uprof { /* profile arguments */ short *pr_base; /* buffer base */ unsigned pr_size; /* buffer size */ unsigned pr_off; /* pc offset */ unsigned pr_scale; /* pc scaling */ } u_prof; char u_eosys; /* special action on end of syscall */ char u_sep; /* flag for I and D separation */ struct tty *u_ttyp; /* controlling tty pointer */ dev_t u_ttyd; /* controlling tty dev */ union { struct { /* header of executable file */ int Ux_mag; /* magic number */ unsigned Ux_tsize; /* text size */ unsigned Ux_dsize; /* data size */ unsigned Ux_bsize; /* bss size */ unsigned Ux_ssize; /* symbol table size */ unsigned Ux_entloc; /* entry location */ unsigned Ux_unused; unsigned Ux_relflg; } Ux_A; char ux_shell[SHSIZE]; /* #! and name of interpreter */ } u_exdata; #define ux_mag Ux_A.Ux_mag #define ux_tsize Ux_A.Ux_tsize #define ux_dsize Ux_A.Ux_dsize #define ux_bsize Ux_A.Ux_bsize #define ux_ssize Ux_A.Ux_ssize #define ux_entloc Ux_A.Ux_entloc #define ux_unused Ux_A.Ux_unused #define ux_relflg Ux_A.Ux_relflg char u_comm[DIRSIZ]; time_t u_start; char u_acflag; short u_fpflag; /* unused now, will be later */ short u_cmask; /* mask for file creation */ size_t u_tsize; /* text size (clicks) */ size_t u_dsize; /* data size (clicks) */ size_t u_ssize; /* stack size (clicks) */ struct vtimes u_vm; /* stats for this proc */ struct vtimes u_cvm; /* sum of stats for reaped children */ struct dmap u_dmap; /* disk map for data segment */ struct dmap u_smap; /* disk map for stack segment */ struct dmap u_cdmap, u_csmap; /* shadows of u_dmap, u_smap, for use of parent during fork */ time_t u_outime; /* user time at last sample */ size_t u_odsize, u_ossize; /* for (clumsy) expansion swaps */ size_t u_vrpages[NOFILE]; /* number vread pages hanging on fd */ int u_limit[8]; /* see */ #ifdef notdef unsigned u_vsave; /* saved previous fault page number */ #endif int u_stack[1]; /* * kernel stack per user * extends from u + UPAGES*512 * backward not to reach here */ /* SHOULD INSTEAD GROW STACK BACKWARDS ABOVE u. TOWARDS A VIRTUAL HOLE */ }; /* u_eosys values */ #define JUSTRETURN 0 #define RESTARTSYS 1 #define SIMULATERTI 2 /* u_error codes */ #include #ifdef KERNEL extern struct user u; extern struct user swaputl; extern struct user forkutl; extern struct user xswaputl; extern struct user xswap2utl; extern struct user pushutl; extern struct user vfutl; #endif stack per user * extends from u + UPAGES*512 * backward not to reach here */ /* SHOULD INSTEAD GROW STACK BACKWARDS ABOVE u. TOWARDS A VIRTUAL HOLE */ }; /* u_eosys values */ #define JUSTRETURN 0 #define RESTARTSYS 1 #define SIMULATERTI 2 /* u_error codes */ #include #ifdef KERinclude/sys/vcmd.h 444 0 33 233 2531445253 7355 /* vcmd.h 4.3 81/02/25 */ #define VPRINT 0100 #define VPLOT 0200 #define VPRINTPLOT 0400 #define VGETSTATE (('v'<<8)|0) #define VSETSTATE (('v'<<8)|1) user pushutl; extern struct user vfutl; #endif stack per user * extends from u + UPAGES*512 * backward not to reach here */ /* SHOULD INSTEAD GROW STACK BACKWARDS ABOVE u. TOWARDS A VIRTUAL HOLE */ }; /* u_eosys values */ #define JUSTRETURN 0 #d/( ,( 5ċ /\@,\D"include/sys/vlimit.h 444 0 33 757 2531445253 7743 /* vlimit.h 4.3 81/04/13 */ /* * Limits for u.u_limit[i], per process, inherited. */ #define LIM_NORAISE 0 /* if <> 0, can't raise limits */ #define LIM_CPU 1 /* max secs cpu time */ #define LIM_FSIZE 2 /* max size of file created */ #define LIM_DATA 3 /* max growth of data space */ #define LIM_STACK 4 /* max growth of stack */ #define LIM_CORE 5 /* max size of ``core'' file */ #define LIM_MAXRSS 6 /* max desired data+stack core usage */ #define NLIMITS 6 #define INFINITY 0x7fffffff ,\D"include/sys/vm.h 444 0 33 573 2531445253 7055 /* vm.h 4.3 81/04/23 */ /* * #include "../h/vm.h" * or #include in a user program * is a quick way to include all the vm header files. */ #ifdef KERNEL #include "../h/vmparam.h" #include "../h/vmmac.h" #include "../h/vmmeter.h" #include "../h/vmsystm.h" #else #include #include #include #include #endif le */ #define LIM_MAXRSS 6 /* max desired/( ,( 5 /\@,\D"include/sys/vmmac.h 444 0 33 6145 2531445254 7560 /* vmmac.h 4.3 81/04/23 */ /* * Virtual memory related conversion macros */ /* Core clicks to number of pages of page tables needed to map that much */ #define ctopt(x) (((x)+NPTEPG-1)/NPTEPG) /* Virtual page numbers to text|data|stack segment page numbers and back */ #define vtotp(p, v) ((int)(v)) #define vtodp(p, v) ((int)((v) - (p)->p_tsize)) #define vtosp(p, v) ((int)(btop(USRSTACK) - 1 - (v))) #define tptov(p, i) ((unsigned)(i)) #define dptov(p, i) ((unsigned)((p)->p_tsize + (i))) #define sptov(p, i) ((unsigned)(btop(USRSTACK) - 1 - (i))) /* Tell whether virtual page numbers are in text|data|stack segment */ #define isassv(p, v) ((v) & P1TOP) #define isatsv(p, v) ((v) < (p)->p_tsize) #define isadsv(p, v) ((v) >= (p)->p_tsize && !isassv(p, v)) /* Tell whether pte's are text|data|stack */ #define isaspte(p, pte) ((pte) > sptopte(p, (p)->p_ssize)) #define isatpte(p, pte) ((pte) < dptopte(p, 0)) #define isadpte(p, pte) (!isaspte(p, pte) && !isatpte(p, pte)) /* Text|data|stack pte's to segment page numbers and back */ #define ptetotp(p, pte) ((pte) - (p)->p_p0br) #define ptetodp(p, pte) ((pte) - ((p)->p_p0br + (p)->p_tsize)) #define ptetosp(p, pte) \ (((p)->p_p0br + (p)->p_szpt*NPTEPG - UPAGES - 1) - (pte)) #define tptopte(p, i) ((p)->p_p0br + (i)) #define dptopte(p, i) ((p)->p_p0br + (p)->p_tsize + (i)) #define sptopte(p, i) \ (((p)->p_p0br + (p)->p_szpt*NPTEPG - UPAGES - 1) - (i)) /* Bytes to pages without rounding, and back */ #define btop(x) (((unsigned)(x)) >> PGSHIFT) #define ptob(x) ((caddr_t)((x) << PGSHIFT)) /* Turn virtual addresses into kernel map indices */ #define kmxtob(a) (usrpt + (a) * NPTEPG) #define btokmx(b) (((b) - usrpt) / NPTEPG) /* User area address and pcb bases */ #define uaddr(p) (&((p)->p_p0br[(p)->p_szpt * NPTEPG - UPAGES])) #define pcbb(p) ((p)->p_addr[0].pg_pfnum) /* Average new into old with aging factor time */ #define ave(smooth, cnt, time) \ smooth = ((time - 1) * (smooth) + (cnt)) / (time) /* * Page clustering macros. * * dirtycl(pte) is the page cluster dirty? * anycl(pte,fld) does any pte in the cluster has fld set? * zapcl(pte,fld) = val set all fields fld in the cluster to val * distcl(pte) distribute high bits to cluster; note that * distcl copies everything but pg_pfnum, * INCLUDING pg_m!!! * * In all cases, pte must be the low pte in the cluster, even if * the segment grows backwards (e.g. the stack). */ #define H(pte) ((struct hpte *)(pte)) #if CLSIZE==1 #define dirtycl(pte) dirty(pte) #define anycl(pte,fld) ((pte)->fld) #define zapcl(pte,fld) (pte)->fld #define distcl(pte) #endif #if CLSIZE==2 #define dirtycl(pte) (dirty(pte) || dirty((pte)+1)) #define anycl(pte,fld) ((pte)->fld || (((pte)+1)->fld)) #define zapcl(pte,fld) (pte)[1].fld = (pte)[0].fld #endif #if CLSIZE==4 #define dirtycl(pte) \ (dirty(pte) || dirty((pte)+1) || dirty((pte)+2) || dirty((pte)+3)) #define anycl(pte,fld) \ ((pte)->fld || (((pte)+1)->fld) || (((pte)+2)->fld) || (((pte)+3)->fld)) #define zapcl(pte,fld) \ (pte)[3].fld = (pte)[2].fld = (pte)[1].fld = (pte)[0].fld #endif #ifndef distcl #define distcl(pte) zapcl(H(pte),pg_high) #endif rty(pte) || dirty((pte)+1)) #define anycl(pte,fld) ((pte)->fld || (((pte)+1)->fld)) #define zapcl(pte,fld) (pte)[1].fld = (pte)[0].fld #endif #if CLSIZE==4 #define dirtycl(pte) \ (dirty(pte) || dirty((pte)+1) || dirty((pte)+2) || dirty((pte)+3)) #define anycl(pte,fld) \ ((pte)->fld || (((pte)+1)->fld) || (((pte)+2)->fld) || (((pte)+3)->fld)) #define zapcl(pte,fld) \ (pte)[3].fld = (pte)[2].fld =((include/sys/vmmeter.h 444 0 33 5666 2531445255 10144 /* vmmeter.h 4.6 4/24/81 */ /* * Virtual memory related instrumentation */ struct vmmeter { #define v_first v_swtch unsigned v_swtch; /* context switches */ unsigned v_trap; /* calls to trap */ unsigned v_syscall; /* calls to syscall() */ unsigned v_intr; /* device interrupts */ unsigned v_pdma; /* pseudo-dma interrupts */ unsigned v_pswpin; /* pages swapped in */ unsigned v_pswpout; /* pages swapped out */ unsigned v_pgin; /* pageins */ unsigned v_pgout; /* pageouts */ unsigned v_pgpgin; /* pages paged in */ unsigned v_pgpgout; /* pages paged out */ unsigned v_intrans; /* intransit blocking page faults */ unsigned v_pgrec; /* total page reclaims */ unsigned v_xsfrec; /* found in free list rather than on swapdev */ unsigned v_xifrec; /* found in free list rather than in filsys */ unsigned v_exfod; /* pages filled on demand from executables */ unsigned v_zfod; /* pages zero filled on demand */ unsigned v_vrfod; /* fills of pages mapped by vread() */ unsigned v_nexfod; /* number of exfod's created */ unsigned v_nzfod; /* number of zfod's created */ unsigned v_nvrfod; /* number of vrfod's created */ unsigned v_pgfrec; /* page reclaims from free list */ unsigned v_faults; /* total faults taken */ unsigned v_scan; /* scans in page out daemon */ unsigned v_rev; /* revolutions of the hand */ unsigned v_seqfree; /* pages taken from sequential programs */ unsigned v_dfree; /* pages freed by daemon */ #define v_last v_dfree unsigned v_swpin; /* swapins */ unsigned v_swpout; /* swapouts */ }; #ifdef KERNEL struct vmmeter cnt, rate, sum; #endif /* systemwide totals computed every five seconds */ struct vmtotal { short t_rq; /* length of the run queue */ short t_dw; /* jobs in ``disk wait'' (neg priority) */ short t_pw; /* jobs in page wait */ short t_sl; /* jobs sleeping in core */ short t_sw; /* swapped out runnable/short block jobs */ int t_vm; /* total virtual memory */ int t_avm; /* active virtual memory */ short t_rm; /* total real memory in use */ short t_arm; /* active real memory */ int t_vmtxt; /* virtual memory used by text */ int t_avmtxt; /* active virtual memory used by text */ short t_rmtxt; /* real memory used by text */ short t_armtxt; /* active real memory used by text */ short t_free; /* free memory pages */ }; #ifdef KERNEL struct vmtotal total; #endif /* * Optional instrumentation. */ #ifdef PGINPROF #define NDMON 128 #define NSMON 128 #define DRES 20 #define SRES 5 #define PMONMIN 20 #define PRES 50 #define NPMON 64 #define RMONMIN 130 #define RRES 5 #define NRMON 64 /* data and stack size distribution counters */ unsigned int dmon[NDMON+1]; unsigned int smon[NSMON+1]; /* page in time distribution counters */ unsigned int pmon[NPMON+2]; /* reclaim time distribution counters */ unsigned int rmon[NRMON+2]; int pmonmin; int pres; int rmonmin; int rres; unsigned rectime; /* accumulator for reclaim times */ unsigned pgintime; /* accumulator for page in times */ #endif ine PMONMIN 20 #define PRES 50 #define NPMON 64 #define RMONMIN 130 #defiinclude/sys/vmparam.h 444 0 33 6047 2531445255 10122 /* vmparam.h 4.10 81/04/24 */ /* * Machine dependent constants */ #define NPTEPG (NBPG/(sizeof (struct pte))) /* number of ptes per page */ #define USRSTACK (0x80000000-UPAGES*NBPG) /* Start of user stack */ #define P1TOP 0x200000 /* boundary between P0 and P1 regions */ /* * Virtual memory related constants */ #define SLOP 32 #define MAXTSIZ (6*2048-SLOP) /* max text size (clicks) */ #define MAXDSIZ (12*1024-32-SLOP) /* max data size (clicks) */ #define MAXSSIZ (12*1024-32-SLOP) /* max stack size (clicks) */ /* * Sizes of the system and user portions of the system page table. */ /* SYSPTSIZE IS SILLY; IT SHOULD BE COMPUTED AT BOOT TIME */ #define SYSPTSIZE (12*NPTEPG) #define USRPTSIZE (8*NPTEPG) /* * The size of the clock loop. */ #define LOOPPAGES (maxfree - firstfree) /* * The time for a process to be blocked before being very swappable. * This is a number of seconds which the system takes as being a non-trivial * amount of real time. You probably shouldn't change this; * it is used in subtle ways (fractions and multiples of it are, that is, like * half of a ``long time'', almost a long time, etc.) * It is related to human patience and other factors which don't really * change over time. */ #define MAXSLP 20 /* * A swapped in process is given a small amount of core without being bothered * by the page replacement algorithm. Basically this says that if you are * swapped in you deserve some resources. We protect the last SAFERSS * pages against paging and will just swap you out rather than paging you. * Note that each process has at least UPAGES+CLSIZE pages which are not * paged anyways (this is currently 8+2=10 pages or 5k bytes), so this * number just means a swapped in process is given around 25k bytes. * Just for fun: current memory prices are 4600$ a megabyte on VAX (4/22/81), * so we loan each swapped in process memory worth 100$, or just admit * that we don't consider it worthwhile and swap it out to disk which costs * $30/mb or about $0.75. */ #define SAFERSS 32 /* nominal ``small'' resident set size protected against replacement */ /* * DISKRPM is used to estimate the number of paging i/o operations * which one can expect from a single disk controller. */ #define DISKRPM 60 /* * Klustering constants. Klustering is the gathering * of pages together for pagein/pageout, while clustering * is the treatment of hardware page size as though it were * larger than it really is. * * KLMAX gives maximum cluster size in CLSIZE page (cluster-page) * units. Note that KLMAX*CLSIZE must be <= DMMIN in dmap.h. */ #define KLMAX (32/CLSIZE) #define KLSEQL (16/CLSIZE) /* in klust if vadvise(VA_SEQL) */ #define KLIN (8/CLSIZE) /* default data/stack in klust */ #define KLTXT (4/CLSIZE) /* default text in klust */ #define KLOUT (32/CLSIZE) /* * KLSDIST is the advance or retard of the fifo reclaim for sequential * processes data space. */ #define KLSDIST 3 /* klusters advance/retard for seq. fifo */ #ifdef KERNEL int klseql; int klsdist; int klin; int kltxt; int klout; #endif SIZE must be <= DMMIN in dmap.h. */ #define KLMAX (32/CLSIZE) #define KLSEQL (16/CLSIZE) /* in klust if vadvise(VA_SEQL) */ #define KLIN (8/CLSIZE) /* default data/stack in klust */ #define KLTXT (4/CLSIZE) /* default text in klust */ #define KLOUT (32/CLSIZE) /* * KLSDIST is the advance or retard of the fifo reclaim for sequential * processes data space. */ #define KLSDIST 3 /* klusters advance/retard for seq. fifo */ #ifdef KERNEL int klseql; int klsdist; include/sys/vmsysent.h 444 0 33 774 2531445255 10330 /* vmsysent.h 4.4 81/03/03 */ /* * Externals for functions defined in vmsys.c. */ int nosys(); int nullsys(); int vfork(); /* later, just fork? */ int vread(); /* deprecated */ int vwrite(); /* deprecated */ int vadvise(); /* later, segadvise */ int vhangup(); /* should just do in exit() */ int vlimit(); int vswapon(); int vtimes(); #ifdef TRACE int vtrace(); #endif int segalloc(); /* not in yet */ int segfree(); /* not in yet */ int segsync(); /* not in yet */ int resuba(); int futz(); "include/sys/vmsystm.h 444 0 33 2474 2531445256 10202 /* vmsystm.h 4.3 81/04/23 */ /* * Miscellaneous virtual memory subsystem variables and structures. */ #ifdef KERNEL int freemem; /* remaining blocks of free memory */ int avefree; /* moving average of remaining free blocks */ int avefree30; /* 30 sec (avefree is 5 sec) moving average */ int deficit; /* estimate of needs of new swapped in procs */ int nscan; /* number of scans in last second */ int multprog; /* current multiprogramming degree */ int desscan; /* desired pages scanned per second */ /* writable copies of tunables */ int maxpgio; /* max paging i/o per sec before start swaps */ int maxslp; /* max sleep time before very swappable */ int lotsfree; /* max free before clock freezes */ int minfree; /* minimum free pages before swapping begins */ int desfree; /* no of pages to try to keep free via daemon */ int saferss; /* no pages not to steal; decays with slptime */ #endif /* * Fork/vfork accounting. */ struct forkstat { int cntfork; int cntvfork; int sizfork; int sizvfork; }((; #ifdef KERNEL struct forkstat forkstat; #endif /* * Swap kind accounting. */ struct swptstat { int pteasy; /* easy pt swaps */ int ptexpand; /* pt expansion swaps */ int ptshrink; /* pt shrinking swaps */ int ptpack; /* pt swaps involving spte copying */ }; #ifdef KERNEL struct swptstat swptstat; #endif via daemon */ int saferss; /* no pages not to steal; decays with slptime */ #endif /* * Fork/vfork accounting. */ struct forkstat { int cntfork; int cntvfork; int sizfork; int sizvfork; }include/sys/vtimes.h 444 0 33 1516 2531445256 7763 /* vtimes.h 4.2 81/02/19 */ /* * Structure returned by vtimes() and in vwait(). * In vtimes() two of these are returned, one for the process itself * and one for all its children. In vwait() these are combined * by adding componentwise (except for maxrss, which is max'ed). */ struct vtimes { int vm_utime; /* user time (60'ths) */ int vm_stime; /* system time (60'ths) */ /* divide next two by utime+stime to get averages */ unsigned vm_idsrss; /* integral of d+s rss */ unsigned vm_ixrss; /* integral of text rss */ int vm_maxrss; /* maximum rss */ int vm_majflt; /* major page faults */ int vm_minflt; /* minor page faults */ int vm_nswap; /* number of swaps */ int vm_inblk; /* block reads */ int vm_oublk; /* block writes */ }; #ifdef KERNEL struct vtimes zvms; /* an empty (componentwise 0) structure */ #endif s) */ int vm_stime; /* system time (60'ths) */ /* divide next two by utime+stime to get averages */ unsigned vm_idsrss; /* integral of d+s rss */ unsigned vm_ixrss; /* intinclude/sys/dkbad.h 444 0 33 2475 2531445227 7524 /* dkbad.h 4.3 81/05/10 */ /* * Definitions needed to perform bad sector * revectoring ala DEC STD 144. * * The bad sector information is located in the * first 5 even numbered sectors of the last * track of the disk pack. There are five * identical copies of the information, described * by the dkbad structure. * * Replacement sectors are allocated starting with * the first sector before the bad sector information * and working backwards towards the beginning of * the disk. A maximum of 126 bad sectors are supported. * The position of the bad sector in the bad sector table * determines which replacement sector it corresponds to. * * The bad sector information and replacement sectors * are conventionally only accessible through the * 'c' file system partition of the disk. If that * partition is used for a file system, the user is * responsible for making sure that it does not overlap * the bad sector information or any replacement sector.s */ struct dkbad { long bt_csn; /* cartridge serial number */ u_short bt_mbz; /* unused; should be 0 */ u_short bt_flag; /* -1 => alignment cartridge */ struct bt_bad { u_short bt_cyl; /* cylinder number of bad sector */ u_short bt_trksec; /* track and sector number */ } bt_bad[126]; }; #define ECC 0 #define SSE 1 #define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does not overlap * the bad sector information or any replacement sector.s */ struct dkbad { long bt_csn; /* cartriinclude/a.out.h 644 0 33 5016 2504605452 6661 /* * Header prepended to each a.out file. */ struct exec { long a_magic; /* magic number */ unsigned long a_text; /* size of text segment */ unsigned long a_data; /* size of initialized data */ unsigned long a_bss; /* size of uninitialized data */ unsigned long a_syms; /* size of symbol table */ unsigned long a_entry; /* entry point */ unsigned long a_trsize; /* size of text relocation */ unsigned long a_drsize; /* size of data relocation */ }; #define OMAGIC 0407 /* old impure format */ #define NMAGIC 0410 /* read-only text */ #define ZMAGIC 0413 /* demand load format */ /* * Macros which take exec structures as arguments and tell whether * the file has a reasonable magic number or offsets to text|symbols|strings. */ #define N_BADMAG(x) \ (((x).a_magic)!=OMAGIC && ((x).a_magic)!=NMAGIC && ((x).a_magic)!=ZMAGIC) #define N_TXTOFF(x) \ ((x).a_magic==ZMAGIC ? 1024 : sizeof (struct exec)) #define N_SYMOFF(x) \ (N_TXTOFF(x) + (x).a_text+(x).a_data + (x).a_trsize+(x).a_drsize) #define N_STROFF(x) \ (N_SYMOFF(x) + (x).a_syms) /* * Format of a relocation datum. */ struct relocation_info { int r_address; /* address which is relocated */ unsigned int r_symbolnum:24, /* local symbol ordinal */ r_pcrel:1, /* was relocated pc relative already */ r_length:2, /* 0=byte, 1=word, 2=long */ r_extern:1, /* does not include value of sym referenced */ :4; /* nothing, yet */ }; /* * Format of a symbol table entry; this file is included by * and should be used if you aren't interested the a.out header * or relocation information. */ struct nlist { union { char *n_name; /* for use when in-core */ long n_strx; /* index into file string table */ } n_un; unsigned char n_type; /* type flag, i.e. N_TEXT etc; see below */ char n_other; /* unused */ short n_desc; /* see */ unsigned long n_value; /* value of this symbol (or sdb offset) */ }; #define n_hash n_desc /* used internally by ld */ /* * Simple values for n_type. */ #define N_UNDF 0x0 /* undefined */ #define N_ABS 0x2 /* absolute */ #define N_TEXT 0x4 /* text */ #define N_DATA 0x6 /* data */ #define N_BSS 0x8 /* bss */ #define N_COMM 0x12 /* common (internal to ld) */ #define N_FN 0x1f /* file name symbol */ #define N_EXT 01 /* external bit, or'ed in */ #define N_TYPE 0x1e /* mask for all the type bits */ /* * Sdb entries have some of the N_STAB bits set. * These are given in */ #define N_STAB 0xe0 /* if any of these bits set, a SDB entry */ /* * Format for namelist values. */ #define N_FORMAT "%08x" solute */ #define N_TEXT 0x4 /* text */ #define N_DATA 0x6 /* data */ #define N_BSS 0x8 /* bss */ #define N_COMM 0x12 /* common (internal to ld) */ #define N_FN 0x1f /* file name symbol */ #define N_EXT 01 /* external bit, or'ed in */ #define N_TYPE 0x1e /* mask for all the type bits */ /* * Sdb entries have some of the N_STAB bits set. * These are given in */ #define N_STAB 0xe0 /* if any of these bits set, a SDB entry */ /* * Format for namelist values. */ #define N_include/ar.h 644 0 33 324 2504605452 6212 #define ARMAG "!\n" #define SARMAG 8 #define ARFMAG "`\n" struct ar_hdr { char ar_name[16]; char ar_date[12]; char ar_uid[6]; char ar_gid[6]; char ar_mode[8]; char ar_size[10]; char ar_fmag[2]; }; fine N_EXT 01 /* external bit, or'ed in */ #define N_TYPE 0x1e /* mask for all the type bits */ /* * Sdb entries have some of the N_STAB bits set. * These are given in */ #define N_STAB 0xe0 //pT,pT5 /,"include/assert.h 644 0 33 471 2504605453 7115 # ifndef NDEBUG # define _assert(ex) {if (!(ex)){fprintf(stderr,"Assertion failed: file %s, line %d\n", __FILE__, __LINE__);exit(1);}} # define assert(ex) {if (!(ex)){fprintf(stderr,"Assertion failed: file %s, line %d\n", __FILE__, __LINE__);exit(1);}} # else # define _assert(ex) ; # define assert(ex) ; # endif * Sdb entries have some of the N_STAB bits set. * These are given in */ #define N_STAB 0xe0 //pT,pT5 /,"include/core.h 644 0 33 241 2504605453 6537 ((/* machine dependent stuff for core files */ #define TXTRNDSIZ 1024L #define stacktop(siz) (0x80000000L-6*0x200) #define stackbas(siz) (0x80000000L-6*0x200-siz) (ex)){fprintf(stderr,"Assertion failed: file %s, line %d\n", __FILE__, __LINE__);exit(1);}} # else # define _assert(ex) ; # define assert(ex) ; # endif * Sdb entries have some of the N_STAB bits set. * These are given in */ #define N_STAB 0xe0 //pT,pT5 /,"include/ctype.h 644 0 33 1255 2504605453 6761 #define _U 01 #define _L 02 #define _N 04 #define _S 010 #define _P 020 #define _C 040 #define _X 0100 extern char _ctype_[]; #define isalpha(c) ((_ctype_+1)[c]&(_U|_L)) #define isupper(c) ((_ctype_+1)[c]&_U) #define islower(c) ((_ctype_+1)[c]&_L) #define isdigit(c) ((_ctype_+1)[c]&_N) #define isxdigit(c) ((_ctype_+1)[c]&(_N|_X)) #define isspace(c) ((_ctype_+1)[c]&_S) #define ispunct(c) ((_ctype_+1)[c]&_P) #define isalnum(c) ((_ctype_+1)[c]&(_U|_L|_N)) #define isprint(c) ((_ctype_+1)[c]&(_P|_U|_L|_N)) #define iscntrl(c) ((_ctype_+1)[c]&_C) #define isascii(c) ((unsigned)(c)<=0177) #define toupper(c) ((c)-'a'+'A') #define tolower(c) ((c)-'A'+'a') #define toascii(c) ((c)&0177) define isupper(c) ((_ctype_+1)[c]&_U) #define islower(c) ((_ctype_+1)[c]&_L) #define isdigit(c) ((_ctype_+1)[c]&_N) #define isxdigit(c) ((_ctype_+1)[c]&(_N|_X)) #define isspace(c) ((_ctype_+1)[c]&_S) #define ispunct(c) ((_ctype_+1)[c]&_P) #define isalnum(c) ((_ctype_+1)[c]&(_U|_L|_N)) #define isprint(c) ((_ctype_+1)[c]&(_P|_U|_L|_N)) #deinclude/curses.h 644 0 33 10251 2527224067 7160 /* 4/17/81 (Berkeley) @(#)curses.h 1.7 */ # ifndef WINDOW # include # include # define bool char # define reg register # define TRUE (1) # define FALSE (0) # define ERR (0) # define OK (1) # define _SUBWIN 01 # define _ENDLINE 02 # define _FULLWIN 04 # define _SCROLLWIN 010 # define _FLUSH 020 # define _STANDOUT 0200 # define _NOCHANGE -1 # define _puts(s) tputs(s, 0, _putchar); typedef struct sgttyb SGTTY; /* * Capabilities from termcap */ extern bool AM, BS, CA, DA, DB, EO, GT, HZ, IN, MI, MS, NC, OS, UL, XN; extern char *AL, *BC, *BT, *CD, *CE, *CL, *CM, *DC, *DL, *DM, *DO, *ED, *EI, *HO, *IC, *IM, *IP, *LL, *MA, *ND, *SE, *SF, *SO, *SR, *TA, *TE, *TI, *UC, *UE, *UP, *US, *VB, *VE, *VS, PC; /* * From the tty modes... */ extern bool NONL, UPPERCASE, normtty, _pfast; struct _win_st { short _cury, _curx; short _maxy, _maxx; short _begy, _begx; short _flags; bool _clear; bool _leave; bool _scroll; char **_y; short *_firstch; short *_lastch; }; # define WINDOW struct _win_st extern bool My_term, _echoit, _rawmode, _endwin; extern char *Def_term, ttytype[]; extern int LINES, COLS, _tty_ch, _res_flg; extern SGTTY _tty; extern WINDOW *stdscr, *curscr; /* * Define VOID to stop lint from generating "null effect" * comments. */ # ifdef lint int __void__; # define VOID(x) (__void__ = (int) (x)) # else # define VOID(x) (x) # endif /* * psuedo functions for standard screen */ # define addch(ch) VOID(waddch(stdscr, ch)) # define getch() VOID(wgetch(stdscr)) # define addstr(str) VOID(waddstr(stdscr, str)) # define getstr(str) VOID(wgetstr(stdscr, str)) # define move(y, x) VOID(wmove(stdscr, y, x)) # define clear() VOID(wclear(stdscr)) # define erase() VOID(werase(stdscr)) # define clrtobot() VOID(wclrtobot(stdscr)) # define clrtoeol() VOID(wclrtoeol(stdscr)) # define insertln() VOID(winsertln(stdscr)) # define deleteln() VOID(wdeleteln(stdscr)) # define refresh() VOID(wrefresh(stdscr)) # define inch() VOID(winch(stdscr)) # define insch(c) VOID(winsch(stdscr,c)) # define delch() VOID(wdelch(stdscr)) # define standout() VOID(wstandout(stdscr)) # define standend() VOID(wstandend(stdscr)) /* * mv functions */ #define mvwaddch(win,y,x,ch) VOID(wmove(win,y,x)==ERR?ERR:waddch(win,ch)) #define mvwgetch(win,y,x) VOID(wmove(win,y,x)==ERR?ERR:wgetch(win)) #define mvwaddstr(win,y,x,str) VOID(wmove(win,y,x)==ERR?ERR:waddstr(win,str)) #define mvwgetstr(win,y,x) VOID(wmove(win,y,x)==ERR?ERR:wgetstr(win)) #define mvwinch(win,y,x) VOID(wmove(win,y,x) == ERR ? ERR : winch(win)) #define mvwdelch(win,y,x) VOID(wmove(win,y,x) == ERR ? ERR : wdelch(win)) #define mvwinsch(win,y,x,c) VOID(wmove(win,y,x) == ERR ? ERR:winsch(win,c)) #define mvaddch(y,x,ch) mvwaddch(stdscr,y,x,ch) #define mvgetch(y,x) mvwgetch(stdscr,y,x) #define mvaddstr(y,x,str) mvwaddstr(stdscr,y,x,str) #define mvgetstr(y,x) mvwgetstr(stdscr,y,x) #define mvinch(y,x) mvwinch(stdscr,y,x) #define mvdelch(y,x) mvwdelch(stdscr,y,x) #define mvinsch(y,x,c) mvwinsch(stdscr,y,x,c) /* * psuedo functions */ #define clearok(win,bf) (win->_clear = bf) #define leaveok(win,bf) (win->_leave = bf) #define scrollok(win,bf) (win->_scroll = bf) #define flushok(win,bf) (bf ? (win->_flags |= _FLUSH):(win->_flags &= ~_FLUSH)) #define getyx(win,y,x) y = win->_cury, x = win->_curx #define winch(win) (win->_y[win->_cury][win->_curx]) #define raw() (_tty.sg_flags|=RAW, _pfast=_rawmode=TRUE, stty(_tty_ch,&_tty)) #define noraw() (_tty.sg_flags&=~RAW,_rawmode=FALSE,_pfast=!(_tty.sg_flags&CRMOD),stty(_tty_ch,&_tty)) #define crmode() (_tty.sg_flags |= CBREAK, _rawmode = TRUE, stty(_tty_ch,&_tty)) #define nocrmode() (_tty.sg_flags &= ~CBREAK,_rawmode=FALSE,stty(_tty_ch,&_tty)) #define echo() (_tty.sg_flags |= ECHO, _echoit = TRUE, stty(_tty_ch, &_tty)) #define noecho() (_tty.sg_flags &= ~ECHO, _echoit = FALSE, stty(_tty_ch, &_tty)) #define nl() (_tty.sg_flags |= CRMOD,_pfast = _rawmode,stty(_tty_ch, &_tty)) #define nonl() (_tty.sg_flags &= ~CRMOD, _pfast = TRUE, stty(_tty_ch, &_tty)) #define savetty() (gtty(_tty_ch, &_tty), _res_flg = _tty.sg_flags) #define resetty() (_tty.sg_flags = _res_flg, stty(_tty_ch, &_tty)) WINDOW *initscr(), *newwin(), *subwin(); char *longname(); # endif echo() (_tty.sg_flags |= ECHO, _echoit = TRUE, stty(_tty_ch, &_tty)) #define noecho() (_tty.sg_flags &= ~ECHO, _echoit = FALSE, stty(_tty_ch, &_tty)) #define nl() (_tty.sg_flags |= CRMOD,_pfast = _rawmode,stty(_tty_ch, &_tty)) #define nonl() (_tty.sg_flags &= ~CRMOD, _pfast = TRUE, stty(_tty_ch, &_tty)) #define savetty() (gtty(_tty_ch, &include/dbm.h 644 0 33 606 2504605453 6356 #define PBLKSIZ 1024 #define DBLKSIZ 4096 #define BYTESIZ 8 #define NULL ((char *) 0) long bitno; long maxbno; long blkno; long hmask; char pagbuf[PBLKSIZ]; char dirbuf[DBLKSIZ]; int dirf; int pagf; int dbrdonly; typedef struct { char *dptr; int dsize; } datum; datum fetch(); datum makdatum(); datum firstkey(); datum nextkey(); datum firsthash(); long calchash(); long hashinc(); &_tty)) #define nonl() (_tty/pT,pT54 /,"include/dir.h 644 0 33 134 2504605453 6366 #ifndef DIRSIZ #define DIRSIZ 14 #endif struct dir { ino_t d_ino; char d_name[DIRSIZ]; }; bitno; long maxbno; long blkno; long hmask; char pagbuf[PBLKSIZ]; char dirbuf[DBLKSIZ]; int dirf; int pagf; int dbrdonly; typedef struct { char *dptr; int dsize; } datum; datum fetch(); datum makdatum(); datum firstkey(); datum nextkey(); datum firsthash(); long calchash(); long hashinc(); &_tty)) #define nonl() (_tty/pT,pT5D /,"include/dumprestor.h 644 0 33 1233 2504605454 10036 #define NTREC 10 #define MLEN 16 #define MSIZ 4096 #define TS_TAPE 1 #define TS_INODE 2 #define TS_BITS 3 #define TS_ADDR 4 #define TS_END 5 #define TS_CLRI 6 #define MAGIC (int)60011 #define CHECKSUM (int)84446 struct spcl { int c_type; time_t c_date; time_t c_ddate; int c_volume; daddr_t c_tapea; ino_t c_inumber; int c_magic; int c_checksum; struct dinode c_dinode; int c_count; char c_addr[BSIZE]; } spcl; struct idates { char id_name[16]; char id_incno; time_t id_ddate((; }; #define DUMPOUTFMT "%-16s %c %s" /* for printf */ /* name, incno, ctime(date) */ #define DUMPINFMT "%16s %c %[^\n]\n" /* inverse for scanf */ 5 #define TS_CLRI 6 #define MAGIC (int)60011 #define CHECKSUM (int)84446 struct spcl { int c_type; time_t c_date; time_t c_ddate; int c_volume; daddr_t c_tapea; ino_t c_inumber; int c_magic; int c_checksum; struct dinode c_dinode; int c_count; char c_addr[BSIZE]; } spcl; struct idates { char id_name[16]; char id_incno; time_t id_ddateinclude/errno.h 644 0 33 1173 2504605454 6762 /* * Error codes */ #define EPERM 1 #define ENOENT 2 #define ESRCH 3 #define EINTR 4 #define EIO 5 #define ENXIO 6 #define E2BIG 7 #define ENOEXEC 8 #define EBADF 9 #define ECHILD 10 #define EAGAIN 11 #define ENOMEM 12 #define EACCES 13 #define EFAULT 14 #define ENOTBLK 15 #define EBUSY 16 #define EEXIST 17 #define EXDEV 18 #define ENODEV 19 #define ENOTDIR 20 #define EISDIR 21 #define EINVAL 22 #define ENFILE 23 #define EMFILE 24 #define ENOTTY 25 #define ETXTBSY 26 #define EFBIG 27 #define ENOSPC 28 #define ESPIPE 29 #define EROFS 30 #define EMLINK 31 #define EPIPE 32 /* math software */ #define EDOM 33 #define ERANGE 34 ne E2BIG 7 #define ENOEXEC 8 #define EBADF 9 #define ECHILD 10 #define EAGAIN 11 #define ENOMEM 12 #define EACCES 13 #define EFAULT 14 #define ENOTBLK 15 #define EBUSY 16 #define EEXIST 17 #define EXDEV 18 #define ENODEV 19 #define ENOTDIR 20 #define EISDIR 21 #define EINVAL 22 #define ENFILE 23 #define EMFILE 24 #define ENOTTY 25 #define ETXTBSY 26 #define EFBIG 27 #define ENOSPC 28 #dinclude/frame.h 644 0 33 576 2504605454 6715 /* * Definition of the vax calls/callg frame. */ struct frame { int fr_handler; u_int fr_psw:16, /* saved psw */ fr_mask:12, /* register save mask */ :1, fr_s:1, /* call was a calls, not callg */ fr_spa:2; /* stack pointer alignment */ int fr_savap; /* saved arg pointer */ int fr_savfp; /* saved frame pointer */ int fr_savpc; /* saved program counter */ }; 1 #define EINVAL 22 #define ENFILE 23 /pT,pT5t /,"include/fstab.h 644 0 33 2020 2504605454 6724 /* * File system table, see fstab (5) * * Used by dump, mount, umount, swapon, fsck, df, ... * * The fs_spec field is the block special name. * Programs that want to use the character special name must * create that name by prepending a 'r' after the right most slash. */ #define FSTAB "/etc/fstab" #define FSNMLG 16 #define FSTABFMT "%16s:%16s:%2s:%d:%d\n" #define FSTABARG(p) (p)->fs_spec, (p)->fs_file, \ (p)->fs_type, &(p)->fs_freq, &(p)->fs_passno #define FSTABNARGS 5 #define FSTAB_RW "rw" /* read write device */ #define FSTAB_RO "ro" /* read only device */ #define FSTAB_SW "sw" /* swap device */ #define FSTAB_XX "xx" /* ignore totally */ struct fstab{ char fs_spec[FSNMLG]; /* block special device name */ char fs_file[FSNMLG]; /* file system path prefix */ char fs_type[3]; /* rw,ro,sw or xx */ int fs_freq; /* dump frequency, in days */ int fs_passno; /* pass number on parallel dump */ }; struct fstab *getfsent(); struct fstab *getfsspec(); struct fstab *getfsfile(); int setfsent(); int endfsent(); vice */ #define FSTAB_RO "ro" /* read only device */ #define FSTAB_SW "sw" /* swap device */ #define FSTAB_XX "xx" /* ignore totally */ struct fstab{ char fs_spec[FSNMLG]; /* block special device name */ char fs_file[FSNMLG]; /* file system path prefix */ char fs_type[3]; /* rw,ro,sw or xx */ int fs_freq; /* dump frequency, in days */ int fs_passno; /* pass number on parallel dump */ }; struct fstab *getfsent(); struct fstab *getfsspec(); struct fstab *getfsfile(); int setfsent(); include/grp.h 644 0 33 147 2504605454 6405 struct group { /* see getgrent(3) */ char *gr_name; char *gr_passwd; int gr_gid; char **gr_mem; }; ce */ #define FSTAB_XX "xx" /* ignore totally */ struct fstab{ char fs_spec[FSNMLG]; /* block special device name */ char fs_file[FSNMLG]; /* file system path prefix */ char fs_type[3]; /* rw,ro,sw or xx */ int fs_freq; /* dump frequency, in days */ int fs_passno; /* pass number on parallel dump */ }; stru/pT,pT5 /,"include/ident.h 644 0 33 67 2515545626 6707 char myname[] = "Berkeley 4.1 VAX/UNIX (Amnesia-Vax)"; har *gr_passwd; int gr_gid; char **gr_mem; }; ce */ #define FSTAB_XX "xx" /* ignore totally */ struct fstab{ char fs_spec[FSNMLG]; /* block special device name */ char fs_file[FSNMLG]; /* file system path prefix */ char fs_type[3]; /* rw,ro,sw or xx */ int fs_freq; /* dump frequency, in days */ int fs_passno; /* pass number on parallel dump */ }; stru/pT,pT5 /,"include/lastlog.h 644 0 33 67 2504605454 7243 struct lastlog { time_t ll_time; char ll_line[8]; }; har *gr_passwd; int gr_gid; char **gr_mem; }; ce */ #define FSTAB_XX "xx" /* ignore totally */ struct fstab{ char fs_spec[FSNMLG]; /* block special device name */ char fs_file[FSNMLG]; /* file system path prefix */ char fs_type[3]; /* rw,ro,sw or xx */ int fs_freq; /* dump frequency, in days */ int fs_passno; /* pass number on parallel dump */ }; stru/pT,pT5 /,"include/math.h 644 0 33 555 2551201144 6537 extern double fabs(), floor(), ceil(), fmod(), ldexp(), frexp(); extern double sqrt(), hypot(), atof(); extern double sin(), cos(), tan(), asin(), acos(), atan(), atan2(); extern double exp(), log(), log10(), pow(); extern double sinh(), cosh(), tanh(); extern double gamma(); extern double j0(), j1(), jn(), y0(), y1(), yn(); #define HUGE 1.701411733192644270e38 fs_passno; /* pass number on parallel dump */ }; stru/pT,pT5Ĉ /,"include/mp.h 644 0 33 1011 2504605455 6241 #define MINT struct mint MINT { int len; short *val; }; #define FREE(x) {if(x.len!=0) {free((char *)x.val); x.len=0;}} #ifndef DBG #define shfree(u) free((char *)u) #else #include "stdio.h" #define shfree(u) { if(dbg) fprintf(stderr, "free %o\n", u); free((char *)u);} extern int dbg; #endif #ifndef vax struct half { short high; short low; }; #else struct half { short low; short high; }; #endif extern MINT *itom(); extern short *xalloc(); #ifdef lint extern xv_oid; #define VOID xv_oid = #else #define VOI((D #endif INT struct mint MINT { int len; short *val; }; #define FREE(x) {if(x.len!=0) {free((char *)x.val); x.len=0;}} #ifndef DBG #define shfree(u) free((char *)u) #else #include "stdio.h" #define shfree(u) { if(dbg) fprintf(stderr, "free %o\n", u); free((char *)u);} extern int dbg; #endif #ifndef vax struct half { short high; short low; }; #else struct half { short low; short high; }; #endif extern MINT *itom(); extern short *xalloc(); #ifdef lint extern xv_oid; #define VOID xv_oid = #else #define VOIinclude/mtab.h 644 0 33 156 2504605455 6541 struct mtab { char m_path[32]; /* mounted on pathname */ char m_dname[32]; /* block device pathname */ }; .len=0;}} #ifndef DBG #define shfree(u) free((char *)u) #else #include "stdio.h" #define shfree(u) { if(dbg) fprintf(stderr, "free %o\n", u); free((char *)u);} extern int dbg; #endif #ifndef vax struct half { short high; short low; }; #else struct half { short low; short high; }; #endif extern MINT *itom();/pT,pT5 /,"include/nlist.h 644 0 33 2100 2504605455 6756 /* * Format of a symbol table entry; this file is included by * and should be used if you aren't interested the a.out header * or relocation information. */ struct nlist { char *n_name; /* for use when in-core */ unsigned char n_type; /* type flag, i.e. N_TEXT etc; see below */ char n_other; /* unused */ short n_desc; /* see */ unsigned long n_value; /* value of this symbol (or sdb offset) */ }; #define n_hash n_desc /* used internally by ld */ /* * Simple values for n_type. */ #define N_UNDF 0x0 /* undefined */ #define N_ABS 0x2 /* absolute */ #define N_TEXT 0x4 /* text */ #define N_DATA 0x6 /* data */ #define N_BSS 0x8 /* bss */ #define N_COMM 0x12 /* common (internal to ld) */ #define N_FN 0x1f /* file name symbol */ #define N_EXT 01 /* external bit, or'ed in */ #define N_TYPE 0x1e /* mask for all the type bits */ /* * Sdb entries have some of the N_STAB bits set. * These are given in */ #define N_STAB 0xe0 /* if any of these bits set, a SDB entry */ /* * Format for namelist values. */ #define N_FORMAT "%08x" solute */ #define N_TEXT 0x4 /* text */ #define N_DATA 0x6 /* data */ #define N_BSS 0x8 /* bss */ #define N_COMM 0x12 /* common (internal to ld) */ #define N_FN 0x1f /* file name symbol */ #define N_EXT 01 /* external bit, or'ed in */ #define N_TYPE 0x1e /* mask for all the type bits */ /* * Sdb entries have some of the N_STAB bits set. * These are given in */ #define N_STAB 0xe0 /* if any of these bits set, a SDB entry */include/unctrl.h 644 0 33 204 2504605460 7113 /* * unctrl.h * * 1/26/81 (Berkeley) @(#)unctrl.h 1.1 */ extern char *_unctrl[]; # define unctrl(ch) (_unctrl[(unsigned) ch]) */ #define N_BSS 0x8 /* bss */ #define N_COMM 0x12 /* common (internal to ld) */ #define N_FN 0x1f /* file name symbol */ #define N_EXT 01 /* external bit, or'ed in */ #define N_TYPE 0x1e /* mask for all the type bits */ /* * Sdb entries have some of the N_STAB bits set. * Thes/pT,pT5 /,"include/olddump.h 644 0 33 2555 2504605455 7307 #define MAXSIZE 500 /* max size in blocks of dumped files */ #define NILIST 100 /* max files extracted at once */ #define BFACT 20 /* tape blocking factor */ int tden 1600; /* tape density */ int tlen 2200; /* tape length (feet) */ char *dump_cmd[] = { /* default args for dump */ "dump", "i", "/dev/rp0", 0 }; char *rest_cmd[] = { /* defaults for restor */ "restor", "t", 0 }; char *tape "/dev/rmt1"; char dfile[] "/dev/dtab"; char tfile[] "/tmp/dtmp"; char name[100]; #define NDTAB 10 struct { char dt_name[16]; time_t dt_date; } dtab[NDTAB]; struct thdr { ino_t isize; ino_t maxi; daddr_t fsize; time_t cdate; time_t ddate; long tsize; int nflg; }; struct fhdr { short xmagic; ino_t xino; short xmode; short xnlink; short xuid; short xgid; daddr_t xaddr; off_t xsize; time_t xatime; time_t xmtime; time_t xctime; }; #define FMAGIC 012345 #define SMAGIC 031415 #define DAPTB 127 /* (BSIZE-2*sizeof(short))/sizeof(daddr_t)) */ FILE *tmpf; long getsize() { register c; long j; c = getc(tmpf); if(c == EOF) return((long)-1); if(c <= 253) return((long)c); if(c == 255) return((long)-1); j = 0; for(c=0;c<3;c++) j = (j<<8) + (getc(tmpf)&0377); return(j); } putsize(s) long s; { if(s <= 253) { putc((char)s, tmpf); return; } putc(254, tmpf); putc((char)(s>>16), tmpf); putc((char)(s>>8), tmpf); putc((char)s, tmpf); } 012345 #define SMAGIC 031415 #define DAPTB 127 /* (BSIZE-2*sizeof(short))/sizeof(daddr_t)) */ FILE *tmpf; long getsize() { register c; long j;include/pagsiz.h 644 0 33 274 2504605455 7114 #define NBPG 512 #define PGOFSET 511 #define CLSIZE 2 #define CLOFSET 1023 #define BSIZE 1024 #define BMASK 1023 #define BSHIFT 10 #define PAGSIZ (NBPG*CLSIZE) #define PAGRND ((PAGSIZ)-1) j); } putsize(s) long s; { if(s <= 253) { putc((char)s, tmpf); return; } putc(254, tmpf); putc((char)(s>>16), tmpf); putc((char)(s>>8), tmpf); putc((char)s, tmpf); } 012345 #define SMAGIC 031415 #define DAPTB 127 /* (BSI/pT,pT5$ /,"include/pwd.h 644 0 33 270 2504605455 6405 struct passwd { /* see getpwent(3) */ char *pw_name; char *pw_passwd; int pw_uid; int pw_gid; int pw_quota; char *pw_comment; char *pw_gecos; char *pw_dir; char *pw_shell; }; -1) j); } putsize(s) long s; { if(s <= 253) { putc((char)s, tmpf); return; } putc(254, tmpf); putc((char)(s>>16), tmpf); putc((char)(s>>8), tmpf); putc((char)s, tmpf); } 012345 #define SMAGIC 031415 #define DAPTB 127 /* (BSI/pT,pT54 /,"include/ranlib.h 644 0 33 1104 2504605455 7077 /* * Structure of the __.SYMDEF table of contents for an archive. * __.SYMDEF begins with a word giving the number of ranlib structures * which immediately follow, and then continues with a string * table consisting of a word giving the number of bytes of strings * which follow and then the strings themselves. * The ran_strx fields index the string table whose first byte is numbered 0. */ struct ranlib { union { off_t ran_strx; /* string table index of */ char *ran_name; /* symbol defined by */ } ran_un; off_t ran_off; /* library member at this offset */ }; * __.SYMDEF begins with a word giving the number of ranlib structures * which immediately follow, and then continues with a string * table consisting of a word giving the number of bytes of strings * which follow and then the strings themselves. * The ran_strx fields index the string table whose first byte is numbered 0. */ struct ranlib { union { off_t ran_strx; /* string table index of */ char *ran_name; /* symbol defined by */((include/saio.h 644 0 33 1527 2504605456 6575 /* %M% %I% %G% */ /* * header file for standalone package */ /* * io block: includes an * inode, cells for the use of seek, etc, * and a buffer. */ struct iob { char i_flgs; struct inode i_ino; int i_unit; daddr_t i_boff; daddr_t i_cyloff; off_t i_offset; daddr_t i_bn; char *i_ma; int i_cc; char i_buf[BSIZE]; }; #define F_READ 01 #define F_WRITE 02 #define F_ALLOC 04 #define F_FILE 010 /* * dev switch */ struct devsw { char *dv_name; int (*dv_strategy)(); int (*dv_open)(); int (*dv_close)(); }; struct devsw devsw[]; /* * request codes. Must be the same a F_XXX above */ #define READ 1 #define WRITE 2 #define NBUFS 4 char b[NBUFS][BSIZE]; daddr_t blknos[NBUFS]; #define NFILES 4 struct iob iob[NFILES]; #define PHYSUBA0 0x20006000 #define PHYSMBA0 0x20010000 #define PHYSMBA1 0x20012000 #define PHYSUMEM 0x2013e000 READ 01 #define F_WRITE 02 #define F_ALLOC 04 #define F_FILE 010 /* * dev switch */ struct devsw { char *dv_name; int (*dv_strategy)(); int (*dv_open)(); int (*dvinclude/sccs.h 644 0 33 62 2504605456 6526 #define SCCSID(arg) static char Sccsid[] = "arg"; t codes. Must be the same a F_XXX above */ #define READ 1 #define WRITE 2 #define NBUFS 4 char b[NBUFS][BSIZE]; daddr_t blknos[NBUFS]; #define NFILES 4 struct iob iob[NFILES]; #define PHYSUBA0 0x20006000 #define PHYSMBA0 0x20010000 #define PHYSMBA1 0x20012000 #define PHYSUMEM 0x2013e000 READ 01 #define F_WRITE 02 #define F_ALLOC 04 #define F_FILE 010 /* * dev s/pT,pT5d /,"include/setjmp.h 644 0 33 31 2504605456 7071 typedef int jmp_buf[10]; c char Sccsid[] = "arg"; t codes. Must be the same a F_XXX above */ #define READ 1 #define WRITE 2 #define NBUFS 4 char b[NBUFS][BSIZE]; daddr_t blknos[NBUFS]; #define NFILES 4 struct iob iob[NFILES]; #define PHYSUBA0 0x20006000 #define PHYSMBA0 0x20010000 #define PHYSMBA1 0x20012000 #define PHYSUMEM 0x2013e000 READ 01 #define F_WRITE 02 #define F_ALLOC 04 #define F_FILE 010 /* * dev s/pT,pT5t /,"include/sgtty.h 644 0 33 2255 2504605456 7013 /* * Structure for stty and gtty system calls. */ #ifndef _IOCTL_ #include #endif struct sgttyb { char sg_ispeed; /* input speed */ char sg_ospeed; /* output speed */ char sg_erase; /* erase character */ char sg_kill; /* kill character */ short sg_flags; /* mode flags */ }; /* * Modes */ #define TANDEM 01 #define CBREAK 02 #define LCASE 04 #define ECHO 010 #define CRMOD 020 #define RAW 040 #define ODDP 0100 #define EVENP 0200 #define ANYP 0300 #define NLDELAY 001400 #define TBDELAY 006000 #define XTABS 06000 #define CRDELAY 030000 #define VTDELAY 040000 #define BSDELAY 0100000 #define ALLDELAY 0177400 /* * Delay algorithms */ #define CR0 0 #define CR1 010000 #define CR2 020000 #define CR3 030000 #define NL0 0 #define NL1 000400 #define NL2 001000 #define NL3 001400 #define TAB0 0 #define TAB1 002000 #define TAB2 004000 #define FF0 0 #define FF1 040000 #define BS0 0 #define BS1 0100000 /* * Speeds */ #define B0 0 #define B50 1 #define B75 2 #define B110 3 #define B134 4 #define B150 5 #define B200 6 #define B300 7 #define B600 8 #define B1200 9 #define B1800 10 #define B2400 11 #define B4800 12 #define B9600 13 #define EXTA 14 #define EXTB 15 fine CR1 010000 #define CR2 020000 #define CR3 030000 #define NL0 0 #define NL1 000400 #define NL2 001000 #define NL3 001400 #define TAB0 0 #define TAB1 002000 #define TAB2 004000 #define FF0 0 #define FF1 040000 #define BS0 0 #define BS1 0100000 /* * Speeds */ #define B0 0 #define B50 1 #define B75 2 #define B110 3 #define B134 4 #deinclude/signal.h 644 0 33 5154 2504605457 7120 #ifndef NSIG #define NSIG 32 #define SIGHUP 1 /* hangup */ #define SIGINT 2 /* interrupt */ #define SIGQUIT 3 /* quit */ #define SIGILL 4 /* illegal instruction (not reset when caught) */ #define ILL_RESAD_FAULT 0x0 /* reserved addressing fault */ #define ILL_PRIVIN_FAULT 0x1 /* privileged instruction fault */ #define ILL_RESOP_FAULT 0x2 /* reserved operand fault */ /* CHME, CHMS, CHMU are not yet given back to users reasonably */ #define SIGTRAP 5 /* trace trap (not reset when caught) */ #define SIGIOT 6 /* IOT instruction */ #define SIGEMT 7 /* EMT instruction */ #define SIGFPE 8 /* floating point exception */ #define FPE_INTOVF_TRAP 0x1 /* integer overflow */ #define FPE_INTDIV_TRAP 0x2 /* integer divide by zero */ #define FPE_FLTOVF_TRAP 0x3 /* floating overflow */ #define FPE_FLTDIV_TRAP 0x4 /* floating/decimal divide by zero */ #define FPE_FLTUND_TRAP 0x5 /* floating underflow */ #define FPE_DECOVF_TRAP 0x6 /* decimal overflow */ #define FPE_SUBRNG_TRAP 0x7 /* subscript out of range */ #define FPE_FLTOVF_FAULT 0x8 /* floating overflow fault */ #define FPE_FLTDIV_FAULT 0x9 /* divide by zero floating fault */ #define FPE_FLTUND_FAULT 0xa /* floating underflow fault */ #define SIGKILL 9 /* kill (cannot be caught or ignored) */ #define SIGBUS 10 /* bus error */ #define SIGSEGV 11 /* segmentation violation */ #define SIGSYS 12 /* bad argument to system call */ #define SIGPIPE 13 /* write on a pipe with no one to read it */ #define SIGALRM 14 /* alarm clock */ #define SIGTERM 15 /* software termination signal from kill */ #define SIGSTOP 17 /* sendable stop signal not from tty */ #define SIGTSTP 18 /* stop signal from tty */ #define SIGCONT 19 /* continue a stopped process */ #define SIGCHLD 20 /* to parent on child stop or exit */ #define SIGTTIN 21 /* to readers pgrp upon background tty read */ #define SIGTTOU 22 /* like TTIN for output if (tp->t_local<OSTOP) */ #define SIGTINT 23 /* to pgrp on every input character if LINTRUP */ #define SIGXCPU 24 /* exceeded CPU time limit */ #define SIGXFSZ 25 /* exceeded file size limit */ #ifndef KERNEL int (*signal())(); #endif #define BADSIG (int (*)())-1 #define SIG_DFL (int (*)())0 #define SIG_IGN (int (*)())1 #ifdef KERNEL #define SIG_CATCH (int (*)())2 #endif #define SIG_HOLD (int (*)())3 #define SIGISDEFER(x) (((int)(x) & 1) != 0) #define SIGUNDEFER(x) (int (*)())((int)(x) &~ 1) #define DEFERSIG(x) (int (*)())((int)(x) | 1) #define SIGNUMMASK 0377 /* to extract pure signal number */ #define SIGDOPAUSE 0400 /* do pause after setting action */ #define SIGDORTI 01000 /* do ret+rti after setting action */ #endif #endif #define BADSIG (int (*)())-1 #define SIG_DFL (int (*)())0 #define SIG_IGN (int (*)())1 #ifdef KERNEL #define SIG_CATCH (int (*)())2 #endif #define SIG_HOLD (int (*)())3 #define SIGISDEFER(x) (((int)(x) & 1) != 0) #define SIGUNDEFER(x) (int (*)())((int)(x) &~ 1) #define DEFERSIG(x) (int (*)())((int)(x) | 1) #define SIGNUMMASK 0377 /* to extract pure signal number */ #define SIGDOPAUSE 040include/stab.h 644 0 33 3123 2504605457 6566 /* IF YOU ADD DEFINITIONS, ADD THEM TO nm.c as well */ /* * This file gives definitions supplementing * for permanent symbol table entries. * These must have one of the N_STAB bits on, * and are subject to relocation according to the masks in . */ /* * for symbolic debugger, sdb(1): */ #define N_GSYM 0x20 /* global symbol: name,,0,type,0 */ #define N_FNAME 0x22 /* procedure name (f77 kludge): name,,0 */ #define N_FUN 0x24 /* procedure: name,,0,linenumber,address */ #define N_STS((YM 0x26 /* static symbol: name,,0,type,address */ #define N_LCSYM 0x28 /* .lcomm symbol: name,,0,type,address */ #define N_RSYM 0x40 /* register sym: name,,0,type,register */ #define N_SLINE 0x44 /* src line: 0,,0,linenumber,address */ #define N_SSYM 0x60 /* structure elt: name,,0,type,struct_offset */ #define N_SO 0x64 /* source file name: name,,0,0,address */ #define N_LSYM 0x80 /* local sym: name,,0,type,offset */ #define N_SOL 0x84 /* #included file name: name,,0,0,address */ #define N_PSYM 0xa0 /* parameter: name,,0,type,offset */ #define N_ENTRY 0xa4 /* alternate entry: name,linenumber,address */ #define N_LBRAC 0xc0 /* left bracket: 0,,0,nesting level,address */ #define N_RBRAC 0xe0 /* right bracket: 0,,0,nesting level,address */ #define N_BCOMM 0xe2 /* begin common: name,, */ #define N_ECOMM 0xe4 /* end common: name,, */ #define N_ECOML 0xe8 /* end common (local name): ,,address */ #define N_LENG 0xfe /* second stab entry with length information */ /* * for the berkeley pascal compiler, pc(1): */ #define N_PC 0x30 /* global pascal symbol: name,,0,subtype,line */ me,linenumber,address */ #define N_LBRAC 0xc0 /* left bracket: 0,,0,nesting level,address */ #define N_RBRAC 0xe0 /* right bracket: 0,,0,nesting level,address */ #define N_BCOMM 0xe2 /* begin common: name,, */ #define N_ECOMM 0xe4 /* end common: name,, */ #define N_ECOML 0xe8 /* end common (local name): ,,address */ #define N_LENG 0xfe /* second stab entry with length information */ /* * for the berkeley pascal compilinclude/stat.h 644 0 33 1576 2504605457 6622 struct stat { dev_t st_dev; ino_t st_ino; unsigned short st_mode; short st_nlink; short st_uid; short st_gid; dev_t st_rdev; off_t st_size; time_t st_atime; time_t st_mtime; time_t st_ctime; }; #define S_IFMT 0170000 /* type of file */ #define S_IFDIR 0040000 /* directory */ #define S_IFCHR 0020000 /* character special */ #define S_IFBLK 0060000 /* block special */ #define S_IFREG 0100000 /* regular */ #define S_IFMPC 0030000 /* multiplexed char special */ #define S_IFMPB 0070000 /* multiplexed block special */ #define S_ISUID 0004000 /* set user id on execution */ #define S_ISGID 0002000 /* set group id on execution */ #define S_ISVTX 0001000 /* save swapped text even after use */ #define S_IREAD 0000400 /* read permission, owner */ #define S_IWRITE 0000200 /* write permission, owner */ #define S_IEXEC 0000100 /* execute/search permission, owner */ ecial */ #define S_IFREG 0100000 /* regular */ #define S_IFMPC 0030000 /* multiplexed char special */ #define S_IFMPB 0070000 /include/stdio.h 644 0 33 1647 2504605457 6770 /* @(#)stdio.h 1.1 (Berkeley) 3/9/81 */ #define BUFSIZ 1024 #define _NFILE 20 # ifndef FILE extern struct _iobuf { int _cnt; char *_ptr; char *_base; short _flag; char _file; } _iob[_NFILE]; # endif #define _IOREAD 01 #define _IOWRT 02 #define _IONBF 04 #define _IOMYBUF 010 #define _IOEOF 020 #define _IOERR 040 #define _IOSTRG 0100 #define _IOLBF 0200 #define _IORW 0400 #define NULL 0 #define FILE struct _iobuf #define EOF (-1) #define stdin (&_iob[0]) #define stdout (&_iob[1]) #define stderr (&_iob[2]) #define getc(p) (--(p)->_cnt>=0? *(p)->_ptr++&0377:_filbuf(p)) #define getchar() getc(stdin) #define putc(x,p) (--(p)->_cnt>=0? ((int)(*(p)->_ptr++=(unsigned)(x))):_flsbuf((unsigned)(x),p)) #define putchar(x) putc(x,stdout) #define feof(p) (((p)->_flag&_IOEOF)!=0) #define ferror(p) (((p)->_flag&_IOERR)!=0) #define fileno(p) ((p)->_file) FILE *fopen(); FILE *fdopen(); FILE *freopen(); long ftell(); char *fgets(); efine EOF (-1) #define stdin (&_iob[0]) #define stdout (&_iob[1]) #define stderr (&_iob[include/sys.s 644 0 33 1710 2504605457 6466 .set exit,1 .set fork,2 .set read,3 .set write,4 .set open,5 .set close,6 .set wait,7 .set creat,8 .set link,9 .set unlink,10 .set exec,11 .set chdir,12 .set time,13 .set mknod,14 .set chmod,15 .set chown,16 .set break,17 .set stat,18 .set lseek,19 .set getpid,20 .set mount,21 .set umount,22 .set setuid,23 .set getuid,24 .set stime,25 .set ptrace,26 .set alarm,27 .set fstat,28 .set pause,29 .set utime,30 .set smdate,30 .set stty,31 .set gtty,32 .set access,33 .set nice,34 .set ftime,35 .set sync,36 .set kill,37 # .set switch,38 # inoperative .set setpgrp,39 # .set tell,40 # obsolete .set dup,41 .set pipe,42 .set times,43 .set prof,44 .set setgid,46 .set getgid,47 .set signal,48 # USG 49 # USG 50 .set acct,51 .set setphys,52 .set syslock,53 .set ioctl,54 # .set reboot,55 .set mpx,56 # USG 57 # USG 58 .set exece,59 .set umask,60 .set chroot,61 # LOCAL 62 .set vfork,66 .set vread,67 .set vwrite,68 set stty,31 .set gtty,32 .set access,33 .set nice,34 include/sysexits.h 644 0 33 5244 2504605457 7536 /* ** SYSEXITS.H -- Exit status codes for system programs. ** ** This include file attempts to categorize possible error ** exit statuses for system programs, notably delivermail ** and the Berkeley network. ** ** Error numbers begin at EX__BASE to reduce the possibility of ** clashing with other exit statuses that random programs may ** already return. The meaning of the codes is approximately ** as follows: ** ** EX_USAGE -- The command was used incorrectly, e.g., with ** the wrong number of arguments, a bad flag, a bad ** syntax in a parameter, or whatever. ** EX_DATAERR -- The input data was incorrect in some way. ** This should only be used for user's data & not ** system files. ** EX_NOINPUT -- An input file (not a system file) did not ** exist or was not readable. This could also include ** errors like "No message" to a mailer (if it cared ** to catch it). ** EX_NOUSER -- The user specified did not exist. This might ** be used for mail addresses or remote logins. ** EX_NOHOST -- The host specified did not exist. This is used ** in mail addresses or network requests. ** EX_UNAVAILABLE -- A service is unavailable. This can occur ** if a support program or file does not exist. This ** can also be used as a catchall message when something ** you wanted to do doesn't work, but you don't know ** why. ** EX_SOFTWARE -- An internal software error has been detected. ** This should be limited to non-operating system related ** errors as possible. ** EX_OSERR -- An operating system error has been detected. ** This is intended to be used for such things as "cannot ** fork", "cannot create pipe", or the like. It includes ** things like getuid returning a user that does not ** exist in the passwd file. ** EX_OSFILE -- Some system file (e.g., /etc/passwd, /etc/utmp, ** etc.) does not exist, cannot be opened, or has some ** sort of error (e.g., syntax error). ** EX_CANTCREAT -- A (user specified) output file cannot be ** created. ** EX_IOERR -- An error occurred while doing I/O on some file. */ # define EX_OK 0 /* successful termination */ # define EX__BASE 64 /* base value for error messages */ # define EX_USAGE 64 /* command line usage error */ # define EX_DATAERR 65 /* data format error */ # define EX_NOINPUT 66 /* cannot open input */ # define EX_NOUSER 67 /* addressee unknown */ # define EX_NOHOST 68 /* host name unknown */ # define EX_UNAVAILABLE 69 /* service unavailable */ # define EX_SOFTWARE 70 /* internal software error */ # define EX_OSERR 71 /* system error (e.g., can't fork) */ # define EX_OSFILE 72 /* critical OS file missing */ # define EX_CANTCREAT 73 /* can't create (user) output file */ # define EX_IOERR 74 /* input/output error */ define EX_DATAERR 65 /* data format error */ # define EX_NOINPUT 66 /* cannot open input */ # define EX_NOUSER 67 /* addressee unknown */ # define EX_NOHOST 68 /* host name unknown */ # define EX_UNAVAILABLE 69 /* service unavailable */ # define EX_SOFTWARE 70 /* internal software error */ # define EX_OSERR 71 /* system error (e.g., can't fork) *include/time.h 644 0 33 236 2504605457 6555 ((struct tm { /* see ctime(3) */ int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst; }; or */ define EX_DATAERR 65 /* data format error */ # define EX_NOINPUT 66 /* cannot open input */ # define EX_NOUSER 67 /* addressee unknown */ # define EX_NOHOST 68 /* host name unknown */ # define EX_UNAVAILABLE 69 /* service unavailable */ # define EX_SOFTWAR/pT,pT5 /,"include/utmp.h 644 0 33 305 2504605460 6573 /* * Structure of utmp and wtmp files. * * Assuming the number 8 is unwise. */ struct utmp { char ut_line[8]; /* tty name */ char ut_name[8]; /* user id */ long ut_time; /* time on */ }; at error */ # define EX_NOINPUT 66 /* cannot open input */ # define EX_NOUSER 67 /* addressee unknown */ # define EX_NOHOST 68 /* host name unknown */ # define EX_UNAVAILABLE 69 /* service unavailable */ # define EX_SOFTWAR/pT,pT5 /,"include/vadvise.h 644 0 33 466 2524073230 7253 /* * Parameters to vadvise() to tell system of particular paging * behaviour: * VA_NORM Normal strategy * VA_ANOM Sampling page behaviour is not a win, don't bother * Suitable during GCs in LISP, or sequential or random * page referencing. */ #define VA_NORM 0 #define VA_ANOM 1 #define VA_SEQL 2 EX_NOHOST 68 /* host name unknown */ # define EX_UNAVAILABLE 69 /* service unavailable */ # define EX_SOFTWAR/pT,pT5 /,"include/valign.h 644 0 33 24 2504605460 7044 #define VALSIZ 1024 vadvise() to tell system of particular paging * behaviour: * VA_NORM Normal strategy * VA_ANOM Sampling page behaviour is not a win, don't bother * Suitable during GCs in LISP, or sequential or random * page referencing. */ #define VA_NORM 0 #define VA_ANOM 1 #define VA_SEQL 2 EX_NOHOST 68 /* host name unknown */ # define EX_UNAVAILABLE 69 /* service unavailable */ # define EX_SOFTWAR/pT,pT5$ /,"include/varargs.h 644 0 33 275 2504605460 7261 typedef char *va_list; # define va_dcl int va_alist; # define va_start(list) list = (char *) &va_alist # define va_end(list) # define va_arg(list,mode) ((mode *)(list += sizeof(mode)))[-1] ng GCs in LISP, or sequential or random * page referencing. */ #define VA_NORM 0 #define VA_ANOM 1 #define VA_SEQL 2 EX_NOHOST 68 /* host name unknown */ # define EX_UNAVAILABLE 69 /* service unavailable */ # define EX_SOFTWAR/pT,pT54 /,"include/vfont.h 644 0 33 467 2504605460 6753 /* * The structures header and dispatch define the format of a font file. * * See vfont(5) for more details. */ struct header { short magic; unsigned short size; short maxx; short maxy; short xtend; }; struct dispatch { unsigned short addr; short nbytes; char up,down,left,right; short width; }; EX_NOHOST 68 /* host name unknown */ # define EX_UNAVAILABLE 69 /* service unavailable */ # define EX_SOFTWAR/pT,pT5D /,"include/wait.h 644 0 33 4232 2504605460 6575 /* * This file holds definitions relevent to the wait system call. * Some of the options here are available only through the ``wait3'' * entry point; the old entry point with one argument has more fixed * semantics, never returning status of unstopped children, hanging until * a process terminates if any are outstanding, and never returns * detailed information about process resource utilization (). */ /* * Structure of the information in the first word returned by both * wait and wait3. If w_stopval==WSTOPPED, then the second structure * describes the information returned, else the first. See WUNTRACED below. */ union wait { int w_status; /* used in syscall */ /* * Terminated process status. */ struct { unsigned short w_Termsig:7; /* termination signal */ unsigned short w_Coredump:1; /* core dump indicator */ unsigned short w_Retcode:8; /* exit code if w_termsig==0 */ } w_T; /* * Stopped process status. Returned * only for traced children unless requested * with the WUNTRACED option bit. */ struct { unsigned short w_Stopval:8; /* == W_STOPPED if stopped */ unsigned short w_Stopsig:8; /* signal that stopped us */ } 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 #define WSTOPPED 0177 /* value of s.stopval if process is stopped */ /* * Option bits for the second argument of wait3. WNOHANG causes the * wait to not hang if there are no stopped or terminated processes, rather * returning an error indication in this case (pid==0). WUNTRACED * indicates that the caller should receive status about untraced children * which stop due to signals. If children are stopped and a wait without * this option is done, it is as though they were still running... nothing * about them is returned. */ #define WNOHANG 1 /* dont hang in wait */ #define WUNTRACED 2 /* tell about stopped, untraced children */ #define WIFSTOPPED(x) ((x).w_stopval == WSTOPPED) #define WIFSIGNALED(x) ((x).w_stopval != WSTOPPED && (x).w_termsig != 0) #define WIFEXITED(x) ((x).w_stopval != WSTOPPED && (x).w_termsig == 0) tatus about untraced children * which stop due to signals. If children are stopped and a wait without * this option is done, it is as though they were still running... nothing * about them is returned. */ #define WNOHANG 1 /* dont hang in wait */ #define WUNTRACED 2 /* tell about stopped, untraced children */ #define WIFSTOPPED(x) ((x).w_stopval == include/whoami 644 0 33 10 2504605460 6615 ARPAVAX ) #define WIFSIGNALED(x) ((x).w_stopval != WSTOPPED && (x).w_termsig != 0) #define WIFEXITED(x) ((x).w_stopval != WSTOPPED && (x).w_termsig == 0) tatus about untraced children * which stop due to signals. If children are stopped and a wait without * this option is done, it is as though they were still running... nothing * about them is returned. */ #define WNOHANG 1 /* dont hang in wait */ #define WUNTR/pT,pT5d /,"include/whoami.h 644 0 33 60 2504605460 7050 ((#define AMNESIAVAX #define sysname "amnesiavax" != WSTOPPED && (x).w_termsig != 0) #define WIFEXITED(x) ((x).w_stopval != WSTOPPED && (x).w_termsig == 0) tatus about untraced children * which stop due to signals. If children are stopped and a wait without * this option is done, it is as though they were still running... nothing * about them is returned. */ #define WNOHANG 1 /* dont hang in wait */ #define WUNTR/pT,pT5t /,"lib/ 775 0 33 0 2552606207 4522 lib/font/ 775 0 33 0 2510246674 5472 lib/font/ftTI 644 0 33 400 2115666154 6320   $ $ۛ QɓQR P $$}; #define ECC 0 #define SSE 1 #define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap /0 C. /\@,\D"lib/font/ftBC 644 0 33 400 2111461362 6256    ѐ  Mnj MM  L  $  }; #define ECC 0 #define SSE 1 #define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 58  /\@,\D"lib/font/ftC 644 0 33 400 2111461362 6154    ґ NȎOO  N  $$ }; #define ECC 0 #define SSE 1 #define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5H  /\@,\D"lib/font/ftCE 644 0 33 400 2111461362 6261     ښ T̔SST$ }; #define ECC 0 #define SSE 1 #define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5X  /\@,\D"lib/font/ftCI 644 0 33 400 2111461362 6265     ܝ S͕TTT$!}; #define ECC 0 #define SSE 1 #define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5h  /\@,\D"lib/font/ftCK 644 0 33 400 2111461362 6267     ܝ S͕TTT$!}; #define ECC 0 #define SSE 1 #define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5x  /\@,\D"lib/font/ftCW 644 0 33 400 2111461362 6303  !!!!!!!!!!!!!!!!!ᡡ!!!!!!aᡡ!!!aa!!!!!!a!!!!!!!!!!!!!!!!!!!!!!}; #define ECC 0 #define SSE 1 #define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5  /\@,\D"lib/font/ftFD 644 0 33 400 2111461362 6263       ۓ TɒTT R$ }; #define ECC 0 #define SSE 1 #define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5  /\@,\D"lib/font/ftG 644 0 33 400 2111461362 6160 ((  $ $ݚ UʕVVT$$$"" }; #define ECC 0 #define SSE 1 #define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5  /\@,\D"lib/font/ftGI 644 0 33 400 2111461362 6271   $ $ݚ Vʔ VV S$$$"" }; #define ECC 0 #define SSE 1 #define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5  /\@,\D"lib/font/ftGM 644 0 33 400 2111461362 6275    ޚ W˖ WWU$ && }; #define ECC 0 #define SSE 1 #define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5Ȉ  /\@,\D"lib/font/ftGR 644 0 33 400 2111461362 6302     ޝ UҕUUX&" }; #define ECC 0 #define SSE 1 #define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5؈  /\@,\D"lib/font/ftH 644 0 33 400 2111461362 6161   $ $ݚ UʕVVT$$$"" }; #define ECC 0 #define SSE 1 #define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5  /\@,\D"lib/font/ftHI 644 0 33 400 2111461362 6272   $ $ݚ Vʔ VV S$$$"" }; #define ECC 0 #define SSE 1 #define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5  /\@,\D"lib/font/ftHM 644 0 33 400 2111461362 6276    ޚ W˖ WWU$ && }; #define ECC 0 #define SSE 1 #define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5  /\@,\D"lib/font/ftB 644 0 33 420 2311102057 6150     ښ VΙ'WVV  && _XXw0 #define SSE 1 #define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5  /\@,\D"lib/font/ftL 644 0 33 400 2111461362 6165     ܘ UɓUU R $_XXw0 #define SSE 1 #define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5(  /\@,\D"lib/font/ftLI 644 0 33 400 2111461362 6276   $  $ܘ VɔVV R $$!!_XXw0 #define SSE 1 #define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 58  /\@,\D"lib/font/ftPA 644 0 33 400 2111461362 6272 ((    ݙ S˔ UST$!!  _XXw0 #define SSE 1 #define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5H  /\@,\D"lib/font/ftPB 644 0 33 400 2111461362 6273     ݚ T̖ VTU$ "" _XXw0 #define SSE 1 #define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5X  /\@,\D"lib/font/ftPI 644 0 33 400 2111461362 6302     ۙ P̐RPS$ _XXw0 #define SSE 1 #define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5h  /\@,\D"lib/font/ftTS 644 0 33 400 2111461363 6321  $$$ WW YUVR$$$$$$$$$$$$$$$"**)  _XXw0 #define SSE 1 #define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5x  /\@,\D"lib/font/ftTB 644 0 33 400 2115666153 6310   $   $ݜ R̗ TSS$$!! _XXw0 #define SSE 1 #define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5  /\@,\D"lib/font/ftSB 644 0 33 400 2111461363 6277       ݛ UʕUUV $ %% _XXw0 #define SSE 1 #define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5  /\@,\D"lib/font/ftSI 644 0 33 400 2111461363 6306     ژ SʒSS R $_XXw0 #define SSE 1 #define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5 /\@,\D"lib/font/ftSM 644 0 33 400 2111461363 6312     ۗ UʔUUT $  _XXw0 #define SSE 1 #define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5, /\@,\D"lib/font/ftUD 644 0 33 400 2111461363 6303       ۓ TɒTT R$ _XXw0 #define SSE 1 #define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5< /\@,\D"lib/font/ftch.old 644 0 33 440 2135251331 7144  ddEdEEEdEE$ddddddddddd$dddddddddddLL0_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5L /\@,\D"lib/font/ftI 644 0 33 420 2311102015 6151 ((    ڝ VΖ&WV W  '' _XXw_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5\ /\@,\D"lib/font/ftR 644 0 33 420 2115722764 6207      ښ V̘%XVV  %% _Rw_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5l /\@,\D"lib/font/ftS 644 0 33 400 2421533011 6167  VY ZVYUڝ$U   _Rw_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5| /\@,\D"lib/font/ftch 644 0 33 420 2310600023 6354  dddd$dddddddddddd$d$dddddddddddddd_XXw_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5 /\@,\D"lib/font/ftTR 644 0 33 400 2115666156 6333   $  $ۛ Rɔ SSR $$ _XXw_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5 /\@,\D"lib/font/ftwp 644 0 33 440 2145415203 6424  zz:LL0_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5  /\@,\D"lib/font/ftI.bak 644 0 33 420 2311057433 6722      ڝ VΖ%XV X  && _XXw_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 50 /\@,\D"lib/font/ftdb 644 0 33 420 2325772267 6401  ҒRҒRRR_XXw_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5@ /\@,\D"lib/font/ftcl 644 0 33 420 2330032661 6371      ݝ WΛXX X_XXw_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5P /\@,\D"lib/font/ftgb 644 0 33 440 2134464623 6376  UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUULL0_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5` /\@,\D"lib/font/ftgr 644 0 33 440 2134464623 11056 1lib/font/ftgb((lib/font/ftgi 644 0 33 440 2134464623 11045 1lib/font/ftgblib/font/ftoi 644 0 33 440 2134517613 6413    RRRRRRRRRR ZYVZYZY_QU]Vb[WZWYUWZWc[ZY   SRQUQQVSLSSM_SRUSNNMURZUSR LL0_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5h /\@,\D"lib/font/ftor 644 0 33 440 2134517624 6426   QQQQQQQQQQ YWW[WUYZNRZU^[WVWYRYYY`ZZU   QSPRPNSSJJSJ[RQRRPNNURYRRPLL0_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5h /\@,\D"lib/font/ftob 644 0 33 440 2134517633 6406   QQQQQQQQQQ YWW[WUYZNRZU^[WVWYRYYY`ZZU   QSPRPNSSLLSL[RQRRPNNURYRRPLL0_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5$h /\@,\D"lib/font/ftmb 644 0 33 440 2134711627 6403     ZZZZZZZZZZ[[YZYWZ^PV^Yg^[Z[ZVZ^^m`^YUYUYUSY]PR[Pg[VYYURQ[Zh[[S LL0_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 54h /\@,\D"lib/font/ftmi 644 0 33 440 2134711636 6412     YYYYYYYYYY ZZWZZYY^SV[Ug_ZZYZWVZ[h^YZ SVUWUUW[PS[PcZUYZUSMVWcZYSLL0_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5Dh /\@,\D"lib/font/ftmr 644 0 33 440 2134711643 6421     YYYYYYYYYY ZYWYWVZ]NU]Wf]YWYYUY]]k_ZU+SVSVSRVZNPZNcYUVVRQPZYfZYR )LL0_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5Th /\@,\D"lib/font/ftbb 644 0 33 440 2134546742 6374      OMOOQPOOPO XUWYUSXZNOZU]YYVZYRXZY`YXU  PROQNORRKMRJ\SPSRMMLRRXSRN    LL0_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5dh /\@,\D"lib/font/ftbi 644 0 33 440 2134546751 6403     RMRSPRRORO  VVUYWXW]MWZV`^WXWYSWXV`YUSPMLRMLPPJKPJWRMROMMKROVPNN    LL0_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5th /\@,\D"lib/font/ftbr 644 0 33 440 2134546760 6414      OJPNPNPNPO XXXYVSZ[LP[V_Z\V[XRYZ[a[XS PRMRNNQSJLQIZRPRPMLJRRWRON   LL0_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5h /\@,\D"lib/font/ftco 644 0 33 420 2330412741 6375 (( _XXw_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5h /\@,\D"lib/font/ftnb 644 0 33 440 2134712003 6371     YYYYYYYYYYZY[ZWV[ZJUYU^Y[W[YZWYYfYWUWWWWWRWWJNWJ_VVWWQUPVVbWWU ,LL0_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5h /\@,\D"lib/font/ftni 644 0 33 440 2134712011 6377     YYYYYYYYYY VWYYWWYZLUWRb[ZWZWWRYVb[VZ SVUWUQYUNQSL^UUVVQSMUR^WSULL0_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5h /\@,\D"lib/font/ftnr 644 0 33 440 2134712016 6415     YYYYYYYYYY VVZYVUZWLSWS^WYWYWYVWVcYVWVVVVWPVUIMUI[UUVVNUPUV^YVS (LL0_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5Čh /\@,\D"lib/font/ftgk 644 0 33 420 2330032763 6377  VޗVVQ PRVRRPMV_XXw_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5Ԍh /\@,\D"lib/font/ftm 644 0 33 440 2134553545 6244     ZMYYYYYYYY YYZZYYZZJWYW`YZY[ZZZZ]dZZY  $ UVUVUPVVILRI^UVVVPVNVS`SSR LL0_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5h /\@,\D"lib/font/ftgf 644 0 33 420 2330531233 6366  OOOϏOOOOOOOOOOOOO_XXw_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5h /\@,\D"lib/font/ftbk 644 0 33 440 2134773732 6406    RLTTUSTTTUXWVXUUXXNSYVc[UVU\UYXZcZZYSSQSSKSSHKVH]SSSSNSKSTYSSSLL0_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5h /\@,\D"lib/font/ftct 644 0 33 420 2330536101 6377  ɏ͎ ֡ӥߖ֖٘ם Lʋ MK  K _XXw_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5h /\@,\D"lib/font/ftap 644 0 33 440 2135222035 6374   RRRRRRRRRR[PRJNPRRMIHVFPRPNPJYQRVQVWYVZYZY_QU]Vb[WZWYUWZZc[ZY  LL0_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5$h /\@,\D"lib/font/fttb 644 0 33 420 2330745016 6405 ((   QQQQQQQQQQ YWW[WUYZNRZU^[WVWYRYYY`ZZU   QSPRPNSSLLSL[RQRRPNNURYRRP "# _XXw_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 54h /\@,\D"lib/font/ftcy 644 0 33 425 2421164042 6413  ]WRRMNPMSLNOPORONMNMORNNL _XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5Dh /\@,\D"lib/font/fttr 644 0 33 420 2330745025 6425    QQQQQQQQQQ YWW[WUYZNRZU^[WVWYRYYY`ZZU   QSPRPNSSJJSJ[RQRRPNNURYRRP _XXw_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5Th /\@,\D"lib/font/ftti 644 0 33 420 2330745036 6416    RRRRRRRRRR ZYVZYZY_QU]Vb[WZWYUWZWc[ZY   SRQUQQVSLSSM_SRUSNNMURZUSR  "" _XXw_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5dh /\@,\D"lib/font/ftts 644 0 33 420 2330720301 6414   VQZUUQUUWWPSWWUUVZVUVVW[SRUNMUUQJVPQRNQUPRRRPMVNWQ_XXw_XXw#define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does overlap //( ,( 5th /\@,\D"lib/font/fontlist 644 0 33 1372 2257260006 7336 B times bold BC boston condensed C news condensed CE century schoolbook expanded CI century bold italic CK century bold italic = CI CW constant width courier FD futura demibold G geneva regular GI geneva regular italic GM geneva medium GR text greek H geneva (helvetica) regular = G HI geneva regular italic = GI HM geneva medium = GM I times italic L geneva light LI geneva light italic PA palatino PB palatino bold PI palatino italic R times roman S special font SB stymie bold SI stymie medium italic SM stymie medium UD futura demibold = FD ap apl b baskerville bk bocklin ch chess cy cyrillic dx delegate fx fix gx gacham hb hebrew m microgramma mn mona mx meteor nx nonie oe old english ox bodoni pb playbill pp pip sc script sg sign sh shadow wp wumpus H geneva (helvetica) regular = G HI geneva regular italic = GI HM geneva medium = GM I times italic L geneva light LI geneva light italic PA palatino PB palatino bold PI palatino italic R times roman S special font SB stymie bold SI stymie medium italic SM stymilib/font/ftsg 644 0 33 440 2140467124 6413  LL0_XXwneva regular italic = GI HM geneva medium = GM I times italic L geneva light LI geneva light italic PA palatino PB palatino bold PI /( ,( 5h /\@,\D"lib/font/ftsc 644 0 33 440 2140732357 6412  OJQQOPNOON b\W`WZYeYUi`cY\\\\^\YYd\Z`LKKOINNNFKLJSLJOLIHILKPKLJLL0_XXwneva regular italic = GI HM geneva medium = GM I times italic L geneva light LI geneva light italic PA palatino PB palatino bold PI /( ,( 5h /\@,\D"lib/font/ftci 644 0 33 420 2331227336 6374   ( ӓ (((ߟ Rѕ#USS    _XXw_XXwneva regular italic = GI HM geneva medium = GM I times italic L geneva light LI geneva light italic PA palatino PB palatino bold PI /( ,( 5h /\@,\D"lib/font/ftsh 644 0 33 440 2140472754 6421     LL0_XXwneva regular italic = GI HM geneva medium = GM I times italic L geneva light LI geneva light italic PA palatino PB palatino bold PI /( ,( 5čh /\@,\D"((lib/font/ftcr 644 0 33 420 2331227345 6405   ߟS͖ VSU  _XXw_XXwneva regular italic = GI HM geneva medium = GM I times italic L geneva light LI geneva light italic PA palatino PB palatino bold PI /( ,( 5ԍh /\@,\D"lib/font/ftmn 644 0 33 425 2421255052 6414   NINNPNNNNN XZXZXWZXMPZXaYXXZZYXXW^WWYNNNNNNMNIMNGSNNNNNNMOOQNMN  _XXwneva regular italic = GI HM geneva medium = GM I times italic L geneva light LI geneva light italic PA palatino PB palatino bold PI /( ,( 5h /\@,\D"lib/font/ftcb 644 0 33 420 2331227373 6366  & (  (((ߟ  ( S͖ VSU    _XXw_XXwneva regular italic = GI HM geneva medium = GM I times italic L geneva light LI geneva light italic PA palatino PB palatino bold PI /( ,( 5h /\@,\D"lib/font/ftpp 644 0 33 440 2140476112 6416     LL0_XXwneva regular italic = GI HM geneva medium = GM I times italic L geneva light LI geneva light italic PA palatino PB palatino bold PI /( ,( 5h /\@,\D"lib/font/ftxx 644 0 33 420 2331242607 6436  _XXw_XXwneva regular italic = GI HM geneva medium = GM I times italic L geneva light LI geneva light italic PA palatino PB palatino bold PI /( ,( 5h /\@,\D"lib/font/fthb 644 0 33 420 2343046076 6375    OO NO O ONGF  _XXw_XXwneva regular italic = GI HM geneva medium = GM I times italic L geneva light LI geneva light italic PA palatino PB palatino bold PI /( ,( 5$h /\@,\D"lib/font/ftdi 644 0 33 440 2140506322 6370  QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQLL0_XXwneva regular italic = GI HM geneva medium = GM I times italic L geneva light LI geneva light italic PA palatino PB palatino bold PI /( ,( 54h /\@,\D"lib/font/ftdr 644 0 33 440 2140505735 6410  RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRLL0_XXwneva regular italic = GI HM geneva medium = GM I times italic L geneva light LI geneva light italic PA palatino PB palatino bold PI /( ,( 5Dh /\@,\D"lib/font/ftfx 644 0 33 440 2143772765 6434  UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUULL0_XXwneva regular italic = GI HM geneva medium = GM I times italic L geneva light LI geneva light italic PA palatino PB palatino bold PI /( ,( 5Th /\@,\D"lib/font/ftoe 644 0 33 440 2156574053 6414    UOSTSSUSUU`_]````cQVa[ha_^_`^\`ah^`]SSOSROSSIKTI^SQSQPSKSQ[SSQLL0_XXwneva regular italic = GI HM geneva medium = GM I times italic L geneva light LI geneva light italic PA palatino PB palatino bold PI /( ,( 5dh /\@,\D"((lib/font/ftpb 644 0 33 440 2156711531 6404    LLNN   PNMPNNNUJNPNSQMNNQMQMRSPRMNMMMMLPNLJPISMJLLMMLPJRMML LL0_XXwneva regular italic = GI HM geneva medium = GM I times italic L geneva light LI geneva light italic PA palatino PB palatino bold PI /( ,( 5th /\@,\D"lib/font/fthn 644 0 33 425 2442702205 6407  ZZZZZZZZZZZZZZZZZZ _XXwneva regular italic = GI HM geneva medium = GM I times italic L geneva light LI geneva light italic PA palatino PB palatino bold PI /( ,( 5h /\@,\D"lib/font/ftsr 644 0 33 400 2115666156 11027 1lib/font/ftTRlib/font/ftsb 644 0 33 400 2115666153 10764 1lib/font/ftTBlib/font/ftsi 644 0 33 400 2115666154 11003 1lib/font/ftTIlib/lisp/ 775 0 33 0 2552755010 5466 lib/lisp/manual/ 775 0 33 0 2552762113 6745 lib/lisp/manual/ch0.r 664 0 33 15662 2552762076 7731 The FRANZ LISP Manual by _J_o_h_n _K_. _F_o_d_e_r_a_r_o _K_e_i_t_h _L_. _S_k_l_o_w_e_r A document in four movements 9 9 _O_v_e_r_t_u_r_e _A _c_h_o_r_u_s _o_f _s_t_u_d_e_n_t_s, _u_n_d_e_r _t_h_e _d_i_r_e_c_t_i_o_n _o_f _R_i_c_h_a_r_d _F_a_t_e_m_a_n, _h_a_v_e _c_o_n_t_r_i_b_u_t_e_d _t_o _b_u_i_l_d_i_n_g _F_R_A_N_Z _L_I_S_P _f_r_o_m _a _m_e_r_e _m_e_l_o_d_y _i_n_t_o _a _f_u_l_l _s_y_m_p_h_o_n_y . _T_h_e _m_a_j_o_r _c_o_n_t_r_i_b_u_t_o_r_s _t_o _t_h_e _i_n_i_t_i_a_l _s_y_s_t_e_m _w_e_r_e _M_i_k_e _C_u_r_r_y, _J_o_h_n _B_r_e_e_d_l_o_v_e _a_n_d _J_e_f_f _L_e_v_i_n_- _s_k_y. _B_i_l_l _R_o_w_a_n _a_d_d_e_d _t_h_e _g_a_r_b_a_g_e _c_o_l_l_e_c_t_o_r _a_n_d _a_r_r_a_y _p_a_c_k_a_g_e. _T_o_m _L_o_n_d_o_n _w_o_r_k_e_d _o_n _a_n _e_a_r_l_y _c_o_m_- _p_i_l_e_r _a_n_d _h_e_l_p_e_d _i_n _o_v_e_r_a_l_l _s_y_s_t_e_m _d_e_s_i_g_n. _K_e_i_t_h _S_k_l_o_w_e_r _h_a_s _c_o_n_t_r_i_b_u_t_e_d _m_u_c_h _t_o _F_R_A_N_Z _L_I_S_P, _a_d_d_i_n_g _t_h_e _b_i_g_n_u_m _p_a_c_k_a_g_e _a_n_d _r_e_w_r_i_t_i_n_g _m_o_s_t _o_f _c_o_d_e _t_o _i_n_c_r_e_a_s_e _i_t_s _e_f_f_i_c_i_e_n_c_y _a_n_d _c_l_a_r_i_t_y. _K_i_p_p _H_i_c_k_m_a_n _a_n_d _C_h_a_r_l_e_s _K_o_e_s_t_e_r _a_d_d_e_d _h_u_n_k_s. _M_i_t_c_h _M_a_r_c_u_s _a_d_d_e_d *_r_s_e_t, _e_v_a_l_h_o_o_k _a_n_d _e_v_a_l_f_r_a_m_e. _D_o_n _C_o_h_e_n _a_n_d _o_t_h_e_r_s _a_t _C_a_r_n_e_g_i_e-_M_e_l_l_o_n _m_a_d_e _s_o_m_e _i_m_p_r_o_v_e_- _m_e_n_t_s _t_o _e_v_a_l_f_r_a_m_e _a_n_d _m_a_i_n_t_a_i_n _t_h_e _s_o_f_t_w_a_r_e _t_o _u_s_e _i_t. _J_o_h_n _F_o_d_e_r_a_r_o _w_r_o_t_e _t_h_e _c_o_m_p_i_l_e_r, _a_d_d_e_d _a _f_e_w _f_u_n_c_t_i_o_n_s, _a_n_d _w_r_o_t_e _t_h_i_s _m_o_d_e_s_t _m_a_n_u_a_l. 8c9 1980 by the Regents of the University of California. All rights reserved. Work reported herein was supported in part by the U. S. Depart- ment of Energy, Contract DE-AT03-76SF00034, Project Agreement DE-AS03-79ER10358, and the National Science Foundation under Grant No. MCS 7807291 UNIX is a trademark of Bell Laboratories. 9 9 Score First Movement (_a_l_l_e_g_r_o _n_o_n _t_r_o_p_p_o) 1. FRANZ LISZT _I_n_t_r_o_d_u_c_t_i_o_n _t_o _F_R_A_N_Z _L_I_S_P, _d_e_t_a_i_l_s _o_f _d_a_t_a _t_y_p_e_s, _a_n_d _d_e_s_c_r_i_p_t_i_o_n _o_f _n_o_t_a_t_i_o_n 2. Data Structure Access _F_u_n_c_t_i_o_n_s _f_o_r _t_h_e _c_r_e_a_t_i_o_n, _d_e_s_t_r_u_c_t_i_o_n _a_n_d _m_a_n_i_p_u_l_a_- _t_i_o_n _o_f _l_i_s_p _d_a_t_a _o_b_j_e_c_t_s. 3. Arithmetic Functions _F_u_n_c_t_i_o_n_s _t_o _p_e_r_f_o_r_m _a_r_i_t_h_m_e_t_i_c _o_p_e_r_a_t_i_o_n_s. 4. Special Functions _F_u_n_c_t_i_o_n_s _f_o_r _a_l_t_e_r_i_n_g _f_l_o_w _o_f _c_o_n_t_r_o_l. _F_u_n_c_t_i_o_n_s _f_o_r _m_a_p_p_i_n_g _o_t_h_e_r _f_u_n_c_t_i_o_n_s _o_v_e_r _l_i_s_t_s. 5. I/O Functions _F_u_n_c_t_i_o_n_s _f_o_r _r_e_a_d_i_n_g _a_n_d _w_r_i_t_i_n_g _f_r_o_m _p_o_r_t_s. _F_u_n_c_- _t_i_o_n_s _f_o_r _t_h_e _m_o_d_i_f_i_c_a_t_i_o_n _o_f _t_h_e _r_e_a_d_e_r'_s _s_y_n_t_a_x. 6. System Functions _F_u_n_c_t_i_o_n_s _f_o_r _s_t_o_r_a_g_e _m_a_n_a_g_e_m_e_n_t, _d_e_b_u_g_g_i_n_g, _a_n_d _f_o_r _t_h_e _r_e_a_d_i_n_g _a_n_d _s_e_t_t_i_n_g _o_f _g_l_o_b_a_l _L_i_s_p _s_t_a_t_u_s _v_a_r_i_- _a_b_l_e_s. _F_u_n_c_t_i_o_n_s _f_o_r _d_o_i_n_g _U_N_I_X _s_p_e_c_i_f_i_c _t_a_s_k_s _s_u_c_h _a_s _p_r_o_c_e_s_s _c_o_n_t_r_o_l. Second Movement (_L_a_r_g_o)(( 7. The Reader _A _d_e_s_c_r_i_p_t_i_o_n _o_f _t_h_e _s_y_n_t_a_x _c_o_d_e_s _u_s_e_d _b_y _t_h_e _r_e_a_d_e_r. _A_n _e_x_p_l_a_n_a_t_i_o_n _o_f _c_h_a_r_a_c_t_e_r _m_a_c_r_o_s. 8. Functions and Macros _A _d_e_s_c_r_i_p_t_i_o_n _o_f _t_h_e _v_a_r_i_o_u_s _t_y_p_e_s _o_f _f_u_n_c_t_i_o_n_s _a_n_d _m_a_c_r_o_s. _A_n _e_x_a_m_p_l_e _o_f _t_h_e _u_s_e _o_f _f_o_r_e_i_g_n _f_u_n_c_t_i_o_n_s. 9. Arrays _A _d_e_t_a_i_l_e_d _d_e_s_c_r_i_p_t_i_o_n _o_f _t_h_e _p_a_r_t_s _o_f _a_n _a_r_r_a_y _a_n_d _o_f _M_a_c_l_i_s_p _c_o_m_p_a_t_i_b_l_e _a_r_r_a_y_s. 10. Exception Handling _A _d_e_s_c_r_i_p_t_i_o_n _o_f _t_h_e _e_r_r_o_r _h_a_n_d_l_i_n_g _s_e_q_u_e_n_c_e _a_n_d _o_f _a_u_t_o_l_o_a_d_i_n_g. Third Movement (_S_c_h_e_r_z_o) 11. The Joseph Lister Trace Package _A _d_e_s_c_r_i_p_t_i_o_n _o_f _a _v_e_r_y _u_s_e_f_u_l _d_e_b_u_g_g_i_n_g _a_i_d. 12. Liszt, the lisp compiler _A _d_e_s_c_r_i_p_t_i_o_n _o_f _t_h_e _o_p_e_r_a_t_i_o_n _o_f _t_h_e _c_o_m_p_i_l_e_r _a_n_d _h_i_n_t_s _f_o_r _m_a_k_i_n_g _f_u_n_c_t_i_o_n_s _c_o_m_p_i_l_a_b_l_e. Final Movement (_a_l_l_e_g_r_o) Appendix A - Function Index Appendix B - List of Special Symbols Appendix C - Short Subjects _G_a_r_b_a_g_e _c_o_l_l_e_c_t_o_r, _D_e_b_u_g_g_i_n_g, _T_o_p _L_e_v_e_l 9 9 _e _c_o_m_p_i_l_e_r _a_n_d _h_i_n_t_s _f_o_r _lib/lisp/manual/ch1.r 664 0 33 53137 2552762100 7715 CHAPTER 1 FRANZ LISP _1._1. FRANZ LISP[] was created as a tool to further research in Symbolic Algebraic Manipulation, Artifi- cial Intelligence, and programming languages at the University of California at Berkeley. Its roots are in the PDP-11 Lisp system which originally came from Harvard. As it grew it adopted features of Maclisp and Lisp Machine Lisp which enables our work to be shared with colleagues at the Laboratory for Computer Science at M.I.T. It is written almost entirely in the programming language C. A small part is written in the assembler language for the current host machine, a VAX 11/780, and part is written in Lisp. Because FRANZ LISP is written in C, it is portable and easy to comprehend. FRANZ LISP is capable of running large lisp pro- grams in a timesharing environment, has facilities for arrays and user defined structures, has a user con- trolled reader with character and word macro capabil- ities, and can interact directly with compiled Lisp, C, Fortran, and Pascal code. _1._2. This document is a reference manual for the FRANZ LISP system. It is not a Lisp primer or introduction to the language. Some parts will be of interest only to those maintaining FRANZ LISP at their computer site. This document is divided into four Movements. In the first one we will attempt to describe the language of FRANZ LISP precisely and completely as it now stands (Opus 33b, October 1980). In the second Movement we will look at the reader, function types, arrays and exception handling. In the third Movement ____________________ 9 []It is rumored that this name has something to do with Franz Liszt [F_rants List] (1811-1886) a Hungarian composer and keyboard virtuoso. These allegations have never been proven. 9FRANZ LISP 1-1 FRANZ LISP 1-2 we will look at several large support packages written to help the FRANZ LISP user, namely the trace package and compiler. Finally the fourth movement contains an index into the other movements. In the rest of this chapter we shall examine the data types of FRANZ LISP. The conventions used in the description of the FRANZ LISP functions will be given in section 1.4 -- it is very important that these conventions are understood. _1._3. _D_a_t_a _T_y_p_e_s FRANZ LISP has eleven data types. In this section we shall look in detail at each type and if a type is divisible we shall look inside it. There is a Lisp function _t_y_p_e which will return the type name of a lisp object. This is the official FRANZ LISP name for that type and we will use this name and this name only in the manual to avoid confusing the reader. The types are listed in terms of importance rather than alphabetically. _1._3._0. _l_i_s_p_v_a_l This is the name we use to describe any lisp object. The function _t_y_p_e will never return `lispval'. _1._3._1. _s_y_m_b_o_l This object corresponds to a variable in most other programming languages. It may have a value or may be `unbound'. A symbol may be _l_a_m_b_d_a _b_o_u_n_d meaning that its current value is stored away somewhere and the symbol is given a new value for the duration of a certain context. When the Lisp processor leaves that context, the symbol's current value is thrown away and its old value is restored. 9 A symbol may also have a _f_u_n_c_t_i_o_n _b_i_n_d_i_n_g. This function binding is static; it cannot be lambda bound. Whenever the symbol is used in the func- tional position of a Lisp expression the function binding of the symbol is examined (see 4 for more details on evaluation). 9 A symbol may also have a _p_r_o_p_e_r_t_y _l_i_s_t, another static data structure. The property list consists of a list of an even number of elements, considered to be grouped as pairs. The first element of the Printed: July 9, 1981 FRANZ LISP 1-3 pair is the _i_n_d_i_c_a_t_o_r the second the _v_a_l_u_e of that indicator. 9 Each symbol has a print name (_p_n_a_m_e) which is how this symbol is accessed from input and referred to on (printed) output. This is also used when one tests for equality of symbols using the function _e_q_u_a_l. 9 A symbol also has a hashlink used to link symbols together in the oblist -- this field is inaccessi- ble to the lisp user. 9 Symbols are created by the reader and by the func- tions _c_o_n_c_a_t, _m_a_k_n_a_m and their derivatives. Most symbols live on FRANZ LISP's sole _o_b_l_i_s_t, and therefore two symbols with the same print name are usually the exact same object (they are _e_q). Sym- bols which are not on the oblist are said to be _u_n_i_n_t_e_r_n_e_d. The function _m_a_k_n_a_m creates uninterned symbols while _c_o_n_c_a_t creates _i_n_t_e_r_n_e_d ones. 8 ____________________________________________________________ Subpart name Get value Set value Type 8 ________________________________________________________________________________________________________________________ value eval set lispval setq 8 ____________________________________________________________ property plist setplist list or nil list get putprop 8 ____________________________________________________________ function getd putd array, binary, list binding def or nil 8 ____________________________________________________________ print name get_pname string 8 ____________________________________________________________ hash link 8 ____________________________________________________________ 7 |7|7|7|7|7|7|7|7|7|7|7|7| |7|7|7|7|7|7|7|7|7|7|7|7| |7|7|7|7|7|7|7|7|7|7|7|7| |7|7|7|7|7|7|7|7|7|7|7|7| |7|7|7|7|7|7|7|7|7|7|7|7| _1._3._2. _l_i_s_t A list cell has two parts, called the car and cdr. List cells are created by the func- tion _c_o_n_s. 8 ________________________________________________ Subpart name Get(( value Set value Type 8 ________________________________________________________________________________________________ car car rplaca lispval 8 ________________________________________________ cdr cdr rplacd lispval 8 ________________________________________________ 7 |8|7|7|7|7| 9 |8|7|7|7|7| 9 |8|7|7|7|7| 9 |8|7|7|7|7| 9 |8|7|7|7|7| 99 9 Printed: July 9, 1981 FRANZ LISP 1-4 _1._3._3. _b_i_n_a_r_y This type acts as a function header for machine coded functions. It has two parts, a pointer to the start of the function and a symbol whose print name describes the argument _d_i_s_c_i_p_l_i_n_e. The discipline (if _l_a_m_b_d_a, _m_a_c_r_o or _n_l_a_m_b_d_a) deter- mines whether the arguments to this function will be evaluated by the caller before this function is called. If the discipline is a string (either "_s_u_b_r_o_u_t_i_n_e", "_f_u_n_c_t_i_o_n", "_i_n_t_e_g_e_r-_f_u_n_c_t_i_o_n", or "_r_e_a_l-_f_u_n_c_t_i_o_n") then this function is a foreign subroutine or function (see 8.4 for more details on this). Although the type of the _e_n_t_r_y field of a binary type object is either string or fixnum, the object pointed to is actually a sequence of machine instructions. Objects of type binary are created by _m_f_u_n_c_t_i_o_n. 8 _________________________________________________________ Subpart name Get value Set value Type 8 __________________________________________________________________________________________________________________ entry getentry string or fixnum 8 _________________________________________________________ discipline getdisc putdisc symbol or fixnum 8 _________________________________________________________ 7 |8|7|7|7|7| 9 |8|7|7|7|7| 9 |8|7|7|7|7| 9 |8|7|7|7|7| 9 |8|7|7|7|7| 9 _1._3._4. _f_i_x_n_u_m A fixnum is an integer constant in the range -2[31] to 2[31]-1. Small fixnums (-1024 to 1023) are stored in a special table so they needn't be allocated each time one is needed. _1._3._5. _f_l_o_n_u_m A flonum is a double precision real number in the range +_2.9x10[-37] to +_1.7x10[38]. There are approximately sixteen decimal digits of precision. _1._3._6. _b_i_g_n_u_m A bignum is an integer of potentially unbounded size. When integer arithmetic exceeds the limits mentioned above the calculation is automatically done with bignums. Should calcula- tion with bignums give a result which can be represented as a fixnum, then the fixnum represen- 9 9 Printed: July 9, 1981 FRANZ LISP 1-5 tation will be used[]. This contraction is known as _i_n_t_e_g_e_r _n_o_r_m_a_l_i_z_a_t_i_o_n. Many Lisp functions assume that integers are normalized. If the user chooses to rewrite the bignum package he should take this into account. The functions used for the extraction and modifica- tion of parts of bignums may change from what is shown in the table sometime in the future. 8 ________________________________________________________ Subpart name Get value Set value Type 8 ________________________________________________________________________________________________________________ i car rplaca unboxed integer 8 ________________________________________________________ CDR cdr rplacd bignum or the symbol nil 8 ________________________________________________________ 7 |8|7|7|7|7|7| 9 |8|7|7|7|7|7| 9 |8|7|7|7|7|7| 9 |8|7|7|7|7|7| 9 |8|7|7|7|7|7| 9 _1._3._7. _s_t_r_i_n_g A string is a null terminated sequence of characters. Most functions of symbols which operate on the symbol's print name will also work on strings. The default reader syntax is set so that a string object is surrounded by double quotes. _1._3._8. _p_o_r_t A port is a structure which the system I/O routines can reference to transfer data between the Lisp system and external media. Unlike other Lisp objects there are a very limited number of ports (20). Ports are allocated by _i_n_f_i_l_e and _o_u_t_- _f_i_l_e and deallocated by _c_l_o_s_e and _r_e_s_e_t_i_o. ____________________ 9 []The current algorithms for integer arithmetic opera- tions will return (in certain cases) a result between +_2[30] and 2[31] as a bignum although this could be represented as a fixnum. 9 Printed: July 9, 1981 FRANZ LISP 1-6 _1._3._9. _a_r_r_a_y Arrays are rather complicated types and are fully described in 9. An array consists of a block of contiguous data, a function to reference that data and auxiliary fields for use by the referencing function. Since an array's referencing function is created by the user, an array can have any form the user chooses (e.g. n-dimensional, tri- angular, or hash table). Arrays are created by the function _m_a_r_r_a_y. 8 _______________________________________________________________ Subpart name Get value Set value Type 8 ______________________________________________________________________________________________________________________________ access function getaccess putaccess binary, list or symbol 8 _______________________________________________________________ auxiliary getaux putaux lispval 8 _______________________________________________________________ data arrayref replace block of contiguous set lispval 8 _______________________________________________________________ length getlength putlength fixnum 8 _______________________________________________________________ delta getdelta putdelta fixnum 8 _______________________________________________________________ 7 |7|7|7|7|7|7|7|7|7|7|7| |7|7|7|7|7|7|7|7|7|7|7| |7|7|7|7|7|7|7|7|7|7|7| |7|7|7|7|7|7|7|7|7|7|7| |7|7|7|7|7|7|7|7|7|7|7| _1._3._1_0. _v_a_l_u_e A value cell contains a pointer to a lispval. This type is used mainly by arrays of general lisp objects. Value cells are created with the _p_t_r function. _1._3._1_1. _h_u_n_k A hunk is a vector of from 1 to 128 lispvals. Once a hunk is created (by _h_u_n_k or _m_a_k_h_u_n_k) it cannot grow or shrink. The access time for an element of a hunk is slower than a list cell element but faster than an array. Hunks are really only allocated in sizes which are powers of two, but can appear to the user to be any size in the 1 to 128 range. Users of hunks must realize that (_n_o_t (_a_t_o_m '_l_i_s_p_v_a_l)) will return true if _l_i_s_p_v_a_l is a hunk. Most lisp systems do not have a direct test for a list cell and instead use the above test and assume that a true result means _l_i_s_p_v_a_l is a list cell. In FRANZ LISP you can use _d_t_p_r to check for a list cell. Although hunks are not list cells, you can still access the first two hunk ele- ments with _c_d_r and _c_a_r and you can access any hunk 9 Printed: July 9, 1981 FRANZ LISP 1-7 element with _c_x_r[]. You can set the value of the first two elements of a hunk with _r_p_l_a_c_d and _r_p_l_a_c_a and you can set the value of any element of the hunk with _r_p_l_a_c_x. ((A hunk is printed by printing its contents surrounded by { and }. However a hunk cannot be read in in this way in the standard lisp system. It is easy to write a reader macro to do this if desired. _1._4. _D_o_c_u_m_e_n_t_a_t_i_o_n The conventions used in the follow- ing chapters were designed to give a great deal of information in a brief space. The first line of a function description contains the function name in bold face and then lists the arguments, if any. The arguments all have names which begin with a letter and an underscore. The letter gives the allowable type(s) for that argument according to this table. 8 _______________________________________________________ Letter Allowable type(s) 8 ______________________________________________________________________________________________________________ g any type 8 _______________________________________________________ s symbol (although nil may not be allowed) 8 _______________________________________________________ t string 8 _______________________________________________________ l list (although nil may be allowed) 8 _______________________________________________________ n number (fixnum, flonum, bignum) 8 _______________________________________________________ i integer (fixnum, bignum) 8 _______________________________________________________ x fixnum 8 _______________________________________________________ b bignum 8 _______________________________________________________ f flonum 8 _______________________________________________________ u function type (either binary or lambda body) 8 _______________________________________________________ y binary 8 _______________________________________________________ a array 8 _______________________________________________________ v value 8 _______________________________________________________ p port (or nil) 8 _______________________________________________________ h hunk ____________________ 9 []In a hunk, the function _c_d_r references the first ele- ment and _c_a_r the second. 9 Printed: July 9, 1981 FRANZ LISP 1-8 8 _______________________________________________________ 799 |99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99| 7777777777777777777777799 |99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99| 7777777777777777777777799 |99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99| 777777777777777777777 In the first line of a function description those arguments preceded by a quote mark are evaluated (usu- ally before the function is called). The quoting con- vention is used so that we can give a name to the result of evaluating the argument and we can describe the allowable types. If an argument is not quoted it does not mean that that argument will not be evaluated, but rather that if it is evaluated the time at which it is evaluated will be specifically men- tioned in the function description. Optional argu- ments are surrounded by square brackets. An ellipsis means zero or more occurrences of an argument of the directly preceding type. 9 Printed: July 9, 1981 quoted it does not mean that that argument will not be evaluated, but rather that if it is evaluated the time at which it is evaluated will be specifically men- tioned in the function description. Optional argu- ments are surrounded by square brackets. An ellipsis means zero or more occurrences of an argument of the directly preceding type. lib/lisp/manual/ch10.r 664 0 33 25701 2552762111 7773 CHAPTER 10 Exception Handling _1_0._1. _E_r_r_s_e_t _a_n_d _E_r_r_o_r _H_a_n_d_l_e_r _F_u_n_c_t_i_o_n_s FRANZ LISP allows the user to handle in a number of ways the errors which arise during computation. One way is through the use of the _e_r_r_s_e_t function. If an error occurs during the evaluation of the _e_r_r_s_e_t's first argument, then the locus of control will return to the errset which will return nil (except in special cases, such as _e_r_r). The other method of error han- dling is through an error handler function. When an error occurs, the interrupt handler is called and is given as an argument a description of the error which just occured. The error handler may take one of the following actions: (1) it could take some drastic action like a _r_e_s_e_t or a _t_h_r_o_w. (2) it could, assuming that the error is continuable, cause a value to be returned from the error handler to the function which noticed the error. The error handler indicates that it wants to return a value from the error by returning a list whose _c_a_r is the value it wants to return. (3) it could decide not to handle the error and return a non-list to indicate this fact. _1_0._2. _T_h_e _A_n_a_t_o_m_y _o_f _a_n _e_r_r_o_r Each error is described by a list of these items: (1) error type - This is a symbol which indicates the general classification of the error. This clas- sification may determine which function handles this error. (2) unique id - This is a fixnum unique to this error. Exception Handling 10-1 Exception Handling 10-2 (3) continuable - If this is non-nil then this error is continuable. There are some who feel that every error should be continuable and the reason that some (in fact most) errors in FRANZ LISP are not continuable is due to the laziness of the programmers. (4) message string - This is a symbol whose print name is a message describing the error. (5) data - There may be from zero to three lisp values which help describe this particular error. For example, the unbound variable error contains one datum value, the symbol whose value is unbound. The list describing that error might look like: (ER%misc 0 t |Unbound Variable:| foobar) _1_0._3. _E_r_r_o_r _h_a_n_d_l_i_n_g _a_l_g_o_r_i_t_h_m This is the sequence of operations which is done when an error occurs: (1) If the symbol _E_R%_a_l_l has a non nil value then this value is the name of an error handler func- tion. That function is called with a description of the error. If that function returns (and of course it may choose not to) and the value is a list and this error is continuable, then we return the _c_a_r of the list to the function which called the error. Presumably the function will use this value to retry the operation. On the other hand, if the error handler returns a non list, then it has chosen not to handle this error, so we go on to step (2). Something spe- cial happens before we call the _E_R%_a_l_l error handler which does not happen in any of the other cases we will describe below. To help insure that we don't get infinitely recursive errors if _E_R%_a_l_l is set to a bad value, the value of _E_R%_a_l_l is set to nil before the handler is called. Thus it is the responsibility of the _E_R%_a_l_l handler to `reenable' itself by storing its name in _E_R%_a_l_l. (2) Next the specific error handler for the type of error which just occured is called (if one exists) to see if it wants to handle the error. The names of the handlers for the specific types of errors are stored as the values of the symbols whose names are the types. For example the Printed: July 9, 1981 Exception Handling 10-3 handler for miscellaneous errors is stored as the value of _E_R%_m_i_s_c. Of course, if _E_R%_m_i_s_c has a value of nil, then there is not error handler for this type of error. Appendix B c((ontains list of all error types. The process of classifying the errors is not complete and thus most errors are lumped into the ER%misc category. Just as in step (1), the error handler function may choose not to handle the error by returning a non-list, and then we go to step (3). (3) Next a check is made to see if there is an _e_r_r_s_e_t surrounding this error. If so the second argu- ment to the _e_r_r_s_e_t call is examined. If the second argument was not given or is non nil then the error message associated with this error is printed Finally the stack is popped to the con- text of the _e_r_r_s_e_t and then the _e_r_r_s_e_t returns nil. If there was no _e_r_r_s_e_t we go to step (4). (4) If the symbol _E_R%_t_p_l has a value then it is the name of and error handler which is called in a manner similar to the that discussed above. If it chooses not to handle the error, we go to step (5). (5) At this point it has been determined that the user doesn't want to handle this error. Thus the error message is printed out and a _r_e_s_e_t is done to send the flow of control to the top-level. To summarize the error handling system: When an error occurs, you have two chances to handle it before the search for an _e_r_r_s_e_t is done. Then, if there is no _e_r_r_s_e_t, you have one more chance to handle the error before control jumps to the top level. Every error handler works in the same way: It is given a description of the error (as described in the previous section). It may or may not return. If it returns, then it returns either a list or a non-list. If it returns a list and the error is continuable, then the _c_a_r of the list is returned to the function which noticed the error. Otherwise the error handler has decided not to handle the error and we go on to some- thing else. _1_0._4. _D_e_f_a_u_l_t _a_i_d_s There are two standard error handlers which will probably handle the needs of most users. One of these Printed: July 9, 1981 Exception Handling 10-4 is the lisp coded function _b_r_e_a_k-_e_r_r-_h_a_n_d_l_e_r which is the default value of _E_R%_t_p_l. Thus when all other handlers have ignored an error, _b_r_e_a_k-_e_r_r-_h_a_n_d_l_e_r will take over. It will print out the error message and go into a read-eval-print loop. For a further discussion of _b_r_e_a_k-_e_r_r-_h_a_n_d_l_e_r, see section xx. The other stan- dard error handler is _d_e_b_u_g-_e_r_r-_h_a_n_d_l_e_r. This handler is designed to be connected to _E_R%_a_l_l. It is useful if your program uses _e_r_r_s_e_t and you want to look at the error it is thrown up to the _e_r_r_s_e_t. _1_0._5. _A_u_t_o_l_o_a_d_i_n_g When _e_v_a_l, _a_p_p_l_y or _f_u_n_c_a_l_l are told to call an undefined function, an ER%undef error is signaled. The default handler for this error is _u_n_d_e_f-_f_u_n_c- _h_a_n_d_l_e_r. This function checks the property list of the undefined function for the indicator autoload. If present, the value of that indicator should be the name of the file which contains the definition of the undefined function. _U_n_d_e_f-_f_u_n_c-_h_a_n_d_l_e_r will load the file and check if it has defined the function which caused the error. If it has, the error handler will return and the computation will continue as if the error did not occur. This provides a way for the user to tell the lisp system about the location of commonly used functions. The trace package sets up an autoload property to point to /usr/lib/lisp/trace. _1_0._6. _I_n_t_e_r_r_u_p_t _p_r_o_c_e_s_s_i_n_g The UNIX operating system provides one user interrupt character which defaults to ^C.[]. The user may select a lisp function to run when an interrupt occurs. Since this interrupt could occur at any time, and in particular could occur at a time when the internal stack pointers were in an inconsistent state, the processing of the interrupt may be delayed until a safe time. When the first ^C is typed, the lisp sys- tem sets a flag that an interrupt has been requested. This flag is checked at safe places within the inter- preter and in the _q_l_i_n_k_e_r function. If the lisp ____________________ 9 []Actually there are two but the lisp system does not al- low you to catch the QUIT interrupt. 9 Printed: July 9, 1981 Exception Handling 10-5 system doesn't respond to the first ^C, another ^C should be typed. This will cause all of the transfer tables to be cleared forcing all calls from compiled code to go through the _q_l_i_n_k_e_r function where the interrupt flag will be checked. If the lisp system still doesn't respond, a third ^C will cause an immediate interrupt. This interrupt will not neces- sarily be in a safe place so the user should _r_e_s_e_t the lisp system as soon as possible. 9 9 Printed: July 9, 1981 cing all calls from compiled code to go through thelib/lisp/manual/ch11.r 664 0 33 22311 2552762111 7766 CHAPTER 11 The Joseph Lister Trace Package The Joseph Lister[] Trace package is an important tool for the interactive debugging of a Lisp program. It allows you to examine selected calls to a function or functions, and optionally to stop execution of the Lisp program to examine the values of variables. The trace package is a set of Lisp programs located in the Lisp program library (usually in the file /usr/lib/lisp/trace.l). There are two user callable func- tions in the trace package: _t_r_a_c_e and _u_n_t_r_a_c_e. The trace package will be loaded automatically when you first use the _t_r_a_c_e function. Both _t_r_a_c_eand _u_n_t_r_a_c_e are nlambdas (their arguments are not evaluated). The form of a call to _t_r_a_c_e is (trace _a_r_g_1 _a_r_g_2 _._._.) where the _a_r_g_i have one of the following forms: foo - when foo is entered and exited, the trace informa- tion will be printed. (foo break) - when foo is entered and exited the trace information will be printed. Also, just after the trace information for foo is printed upon entry, you will be put in a special break loop. The prompt is `T>' and you may type any Lisp expression, and see its value printed. The _ith argument to the function just called can be accessed as (arg _i). To leave the trace loop, just type ^D or (tracereturn) and execu- tion will continue. Note that ^D will work only on UNIX systems. (foo if expression) - when foo is entered and the expres- sion evaluates to non-nil, then the trace information will be printed for both exit and entry. If expres- sion evaluates to nil, then no trace information will be printed. ____________________ 9 []_L_i_s_t_e_r, _J_o_s_e_p_h 1st Baron Lister of Lyme Regis, 1827-1912; English surgeon: introduced antiseptic surgery. 9The Joseph Lister Trace Package 11-1 The Joseph Lister Trace Package 11-2 (foo ifnot expression) - when foo is entered and the expression evaluates to nil, then the trace informa- tion will be printed for both entry and exit. If both if and _i_f_n_o_t are specified, then the _i_f expres- sion must evaluate to non nil AND the _i_f_n_o_t expres- sion must evaluate to nil for the trace information to be printed out. (foo evalin expression) - when foo is entered and after the entry trace information is printed, expression will be evaluated. Exit trace information will be printed when foo exits. (foo evalout expression) - when foo is entered, entry trace information will be printed. When foo exits, and before the exit trace information is printed, expression will be evaluated. (foo evalinout expression) - this has the same effect as (trace (foo evalin expression evalout expression)). (foo lprint) - this tells _t_r_a_c_e to use the level printer when printing the arguments to and the result of a call to foo. The level printer prints only the top levels of list structure. Any structure below three levels is printed as a &. This allows you to trace functions with massive arguments or results. The ((following trace options permit one to have greater control over each action which takes place when a function is traced. These options are only meant to be used by peo- ple who need special hooks into the trace package. Most people should skip reading this section. (foo traceenter tefunc) - this tells _t_r_a_c_e that the func- tion to be called when foo is entered is tefunc. tefunc should be a lambda of two arguments, the first argument will be bound to the name of the function being traced, foo in this case. The second argument will be bound to the list of arguments to which foo should be applied. The function tefunc should print some sort of "entering foo" message. It should not apply foo to the arguments, however. That is done later on. 9 9 Printed: July 9, 1981 The Joseph Lister Trace Package 11-3 (foo traceexit txfunc) - this tells _t_r_a_c_e that the func- tion to be called when foo is exited is txfunc. txfunc should be a lambda of two arguments, the first argument will be bound to the name of the function being traced, foo in this case. The second argument will be bound to the result of the call to foo. The function txfunc should print some sort of "exiting foo" message. (foo evfcn evfunc) - this tells _t_r_a_c_e that the form evfunc should be evaluated to get the value of foo applied to its arguments. This option is a bit different from the other special options since evfunc will usually be an expression, not just the name of a function, and that expression will be specific to the evalua- tion of function foo. The argument list to be applied will be available as T-arglist. (foo printargs prfunc) - this tells _t_r_a_c_e to used prfunc to print the arguments to be applied to the function foo. prfunc should be a lambda of one argument. You might want to use this option if you wanted a print function which could handle circular lists. This option will work only if you do not specify your own _t_r_a_c_e_e_n_t_e_r function. Specifying the option _l_p_r_i_n_t is just a simple way of changing the printargs function to the level printer. (foo printres prfunc) - this tells _t_r_a_c_e to use prfunc to print the result of evaluating foo. prfunc should be a lambda of one argument. This option will work only if you do not specify your own _t_r_a_c_e_e_x_i_t function. Specifying the option _l_p_r_i_n_t changes printres to the level printer. You may specify more than one option for each function traced. For example: (_t_r_a_c_e (_f_o_o _i_f (_e_q _3 (_a_r_g _1)) _b_r_e_a_k _l_p_r_i_n_t) (_b_a_r _e_v_a_l_i_n (_p_r_i_n_t _x_y_z_z_y))) This tells _t_r_a_c_e to trace two more functions, foo and bar. Should foo be called with the first argument _e_q to 3, then the entering foo message will be printed with the level printer. Next it will enter a trace break loop, allowing you to evaluate any lisp expressions. When you exit the trace break loop, foo will be applied to its arguments and the resulting value will be printed, again using the level Printed: July 9, 1981 The Joseph Lister Trace Package 11-4 printer. Bar is also traced, and each time bar is entered, an entering bar message will be printed and then the value of xyzzy will be printed. Next bar will be applied to its arguments and the result will be printed. If you tell _t_r_a_c_e to trace a function which is already traced, it will first _u_n_t_r_a_c_e it. Thus if you want to specify more than one trace option for a function, you must do it all at once. The fol- lowing is _n_o_t equivalent to the preceding call to _t_r_a_c_e for foo: (_t_r_a_c_e (_f_o_o _i_f (_e_q _3 (_a_r_g _1))) (_f_o_o _b_r_e_a_k) (_f_o_o _l_p_r_i_n_t)) In this example, only the last option, lprint, will be in effect. The function _t_r_a_c_e returns a list of functions is was able to trace. The function _u_n_t_r_a_c_e untraces those func- tions its is argument list. If the argument list is empty then all functions being traced are untraced. _U_n_t_r_a_c_e returns a list of functions untraced. Generally the trace package has its own internal names for the the lisp functions it uses, so that you can feel free to trace system functions like _c_o_n_d and not worry about adverse interaction with the actions of the trace package. You can trace any type of function: lambda, nlambda, lexpr or macro whether compiled or interpreted and you can even trace array references (however you should not attempt to store in an array which has been traced). When tracing compiled code keep in mind that many func- tion calls are translated directly to machine language or other equivalent function calls. A full list of open coded functions is listed at the beginning of the liszt compiler source. _T_r_a_c_e will do a (_s_s_t_a_t_u_s _t_r_a_n_s_l_i_n_k _n_i_l) to insure that the new traced definitions it defines are called instead of the old untraced ones. You may notice that com- piled code will run slower after this is done. 9 9 Printed: July 9, 1981 tly to machine language or other equivalent function calls. A full list of open coded functions is listed at the beginning of the liszt compiler source. _T_r_a_c_e will do a (_s_s_t_a_t_u_s _t_r_a_n_s_l_i_n_k _n_i_l) to insure that the new traced definitions it defines arlib/lisp/manual/ch12.r 664 0 33 57071 2552762112 10003 CHAPTER 12 Liszt - the lisp compiler _1_2._1. _G_e_n_e_r_a_l _s_t_r_a_t_e_g_y _o_f _t_h_e _c_o_m_p_i_l_e_r The purpose of the lisp compiler, Liszt, is to create an object module which when brought into the lisp system using _f_a_s_l will have the same effect as bringing in the corresponding lisp coded source module with _l_o_a_d with one important exception, functions will be defined as sequences of machine language instruc- tions, instead of lisp S-expressions. Liszt is not a function compiler, it is a _f_i_l_e compiler. Such a file can contain more than function definitions; it can contain other lisp S-expressions which are evaluated at load time. These other S-expressions will also be stored in the object module produced by Liszt and will be evaluated at fasl time. As is almost universally true of Lisp compilers, the main pass of Liszt is written in Lisp. A subse- quent pass is the assembler, for which we use the standard UNIX assembler. _1_2._2. _R_u_n_n_i_n_g _t_h_e _c_o_m_p_i_l_e_r The compiler is normally run in this manner: % liszt foo will compile the file foo.l or foo (the preferred way to indicate a lisp source file is to end the file name with `.l'). The result of the compilation will be placed in the file foo.o if no fatal errors were detected. All messages which Liszt generates go to the standard output. Normally each function name is printed before it is compiled (the -q option suppresses this). 9 9Liszt - the lisp compiler 12-1 Liszt - the lisp compiler 12-2 _1_2._3. _S_p_e_c_i_a_l _f_o_r_m_s Liszt makes one pass over the source file. It processes each form in this way: _1_2._3._1. _m_a_c_r_o_e_x_p_a_n_s_i_o_n If the form is a macro invo- cation (i.e it is a list whose car is a symbol whose function binding is a macro), then that macro invocation is expanded. This is repeated until the top level form is not a macro invocation. When Liszt begins, there are already some macros defined, in fact some functions (such as defun) are actually macros. The user may define his own mac- ros as well. For a macro to be used it must be defined in the Lisp system in which Liszt runs. _1_2._3._2. _c_l_a_s_s_i_f_i_c_a_t_i_o_n After all macro expansion is done, the form is classified according to its _c_a_r (if the form is not a list, then it is classified as an _o_t_h_e_r). _1_2._3._2._1. _e_v_a_l-_w_h_e_n The form of eval-when is (_e_v_a_l-_w_h_e_n (_t_i_m_e_1 _t_i_m_e_2 ...) _f_o_r_m_1 _f_o_r_m_2 ...) where the time_i are one of _e_v_a_l, _c_o_m_p_i_l_e, or _l_o_a_d. The compiler examines the form_i in sequence and the action taken depends on what is in the time list. If _c_o_m_p_i_l_e is in the list then the compiler will invoke _e_v_a_l on each form_i (( as it examines it. If _l_o_a_d is in the list then the compile will recursively call itself to com- pile each form_i as it examines it. Note that if _c_o_m_p_i_l_e and _l_o_a_d are in the time list, then the compiler will both evaluate and compile each form. This is useful if you need a function to be defined in the compiler at both compile time (perhaps to aid macro expansion) and at run time (after the file is _f_a_s_led in). 9 9 Printed: July 9, 1981 Liszt - the lisp compiler 12-3 _1_2._3._2._2. _d_e_c_l_a_r_e Declare is used to provide information about functions and variables to the compiler. It is (almost) equivalent to (_e_v_a_l- _w_h_e_n (_c_o_m_p_i_l_e) ...). You may declare functions to be one of three types: lambda (*expr), nlambda (*fexpr), lexpr (*lexpr). The names in parenthesis are the Maclisp names and are accepted by the compiler as well (and not just when the compiler is in Maclisp mode). Func- tions are assumed to be lambdas until they are declared otherwise or are defined differently. The compiler treats calls to lambdas and lexprs equivalently, so you needn't worry about declar- ing lexprs either. It is important to declare nlambdas or define them before calling them. Another attribute you can declare for a function is localf which makes the function `local'. A local function's name is known only to the func- tions defined within the file itself. The advantage of a local function is that is can be entered and exited very quickly and it can have the same name as a function in another file and there will be no name conflict. Variables may be declared special or unspe- cial. When a special variable is lambda bound (either in a lambda, prog or do expression), its old value is stored away on a stack for the duration of the lambda, prog or do expression. This takes time and is often not necessary. Therefore the default classification for vari- ables is unspecial. Space for unspecial vari- ables is dynamically allocated on a stack. An unspecial variable can only be accessed from within the function where it is created by its presence in a lambda, prog or do expression variable list. It is possible to declare that all variables are special as will be shown below. You may declare any number of things in each declare statement. A sample declaration is (_d_e_c_l_a_r_e (_l_a_m_b_d_a _f_u_n_c_1 _f_u_n_c_2) (*_f_e_x_p_r _f_u_n_c_3) (*_l_e_x_p_r _f_u_n_c_4) (_l_o_c_a_l_f _f_u_n_c_5) (_s_p_e_c_i_a_l _v_a_r_1 _v_a_r_2 _v_a_r_3) (_u_n_s_p_e_c_i_a_l _v_a_r_4)) You may also declare all variables to be special with (_d_e_c_l_a_r_e (_s_p_e_c_i_a_l_s _t)). You may declare that macro definitions should be Printed: July 9, 1981 Liszt - the lisp compiler 12-4 compiled as well as evaluated at compile time by (_d_e_c_l_a_r_e (_m_a_c_r_o_s _t)). In fact, as was mentioned above, declare is much like (_e_v_a_l- _w_h_e_n (_c_o_m_p_i_l_e) ...). Thus if the compiler sees (_d_e_c_l_a_r_e (_f_o_o _b_a_r)) and foo is defined, then it will evaluate (_f_o_o _b_a_r). If foo is not defined then an undefined declare attribute warning will be issued. _1_2._3._2._3. (_p_r_o_g_n '_c_o_m_p_i_l_e form1 form2 ... formn) When the compiler sees this it simply com- piles form1 through formn as if they too were seen at top level. One use for this is to allow a macro at top-level to expand into more than one function definition for the compiler to com- pile. _1_2._3._2._4. _i_n_c_l_u_d_e/_i_n_c_l_u_d_e_f _I_n_c_l_u_d_e and _i_n_c_l_u_d_e_f cause another file to be read and compiled by the compiler. The result is the same as if the included file were textually inserted into the original file. The only difference between _i_n_c_l_u_d_e and _i_n_c_l_u_d_e_f is that include doesn't evaluate its argument and includef does. Nested includes are allowed. _1_2._3._2._5. _d_e_f A def form is used to define a function. The macros _d_e_f_u_n and _d_e_f_m_a_c_r_o expand to a def form. If the function being defined is a lambda, nlambda or lexpr then the compiler con- verts the lisp definition to a sequence of machine language instructions. If the function being defined is a macro, then the compiler will evaluate the definition, thus defining the macro withing the running Lisp compiler. Furthermore, if the variable _m_a_c_r_o_s is set to a non nil value, then the macro definition will also be translated to machine language and thus will be defined when the object file is fasled in. The variable _m_a_c_r_o_s is set to t by Printed: July 9, 1981 Liszt - the lisp compiler 12-5 (_d_e_c_l_a_r_e (_m_a_c_r_o_s _t)). When a function or macro definition is com- piled, macro expansion is done whenever possi- ble. If the compiler can determine that a form would be evaluated if this function were inter- preted then it will macro expand it. It will not macro expand arguments to a nlambda unless the characteristics of the nlambda is known (as is the case with _c_o_n_d). The map functions ( _m_a_p, _m_a_p_c, _m_a_p_c_a_r, and so on) are expanded to a _d_o statement. This allows the first argument to the map function to be a lambda expression which references local variables of the function being defined. _1_2._3._2._6. _o_t_h_e_r _f_o_r_m_s All other forms are simply stored in the object file and are evaluated when the file is _f_a_s_led in. _1_2._4. _U_s_i_n_g _t_h_e _c_o_m_p_i_l_e_r The previous section describes exactly what the compiler does with its input. Generally you won't have to worry about all that detail as files which work interpreted will work compiled. Following is a list of steps you should follow to insure that a file will compile correctly. [1] Make sure all macro definitions precede their use in functions or other macro definitions. If you want the macros to be around when you _f_a_s_l in the object file you should include this statement at the beginning of the file: (_d_e_c_l_a_r_e (_m_a_c_r_o_s _t)) [2] Make sure all nlambdas are defined or declared before they are used. If the compiler comes across a call to a function which has not been defined in the current file, which does not currently have a function binding, and whose type has not been declared then it will assume that the function needs its arguments evaluated (i.e. it is a lambda or lexpr) and will generate code accordingly. This means that you do not have to declare nlambda functions like _s_t_a_t_u_s since they Printed: July 9, 1981 Liszt - the lisp compiler 12-6 have an nlambda function binding. [3] Locate all variables which are used for communi- cating values between functions. These variables must be declared special at the beginning of a file. In most cases there won't be many special declarations but if you fail to declare a vari- able special that should be, the compiled code could fail in mysterious ways. Let's look at a common problem, assume that a file contains just these three lines: (_d_e_f _a_a_a (_l_a_m_b_d_a (_g_l_o_b _l_o_c) (_b_b_b _l_o_c))) (_d_e_f _b_b_b (_l_a_m_b_d_a (_m_y_l_o_c) (_a_d_d _g_l_o_b _m_y_l_o_c))) (_d_e_f _c_c_c (_l_a_m_b_d_a (_g_l_o_b _l_o_c) (_b_b_b _l_o_c))) We can see that if we load in these two defini- tions then (aaa 3 4) is the same as (add 3 4) and will give us 7. Suppose we compile the file con- taining these definitions. When Liszt compiles aaa, it wi((ll assume that both glob and loc are local variables and will allocate space on the temporary stack for their values when aaa is called. Thus the values of the local variables glob and loc will not affect the values of the symbols glob and loc in the Lisp system. Now Liszt moves on to function bbb. Myloc is assumed to be local. When it sees the add statement, it find a reference to a variable called glob. This variable is not a local variable to this function and therefore glob must refer to the value of the symbol glob. Liszt will automatically declare glob to be special and it will print a warning to that effect. Thus subsequent uses of glob will always refer to the symbol glob. Next Liszt com- piles ccc and treats glob as a special and loc as a local. When the object file is _f_a_s_l'ed in, and (ccc 3 4) is evaluated, the symbol glob will be lambda bound to 3 bbb will be called and will return 7. However (aaa 3 4) will fail since when bbb is called, glob will be unbound. What should be done here is to put (_d_e_c_l_a_r_e (_s_p_e_c_i_a_l _g_l_o_b) at the beginning of the file. [4] Make sure that all calls to _a_r_g are within the lexpr whose arguments they reference. If _f_o_o is a compiled lexpr and it calls _b_a_r then _b_a_r cannot use _a_r_g to get at _f_o_o's arguments. If both _f_o_o and _b_a_r are interpreted this will work however. The macro _l_i_s_t_i_f_y can be used to put all of some of a lexprs arguments in a list which then can be Printed: July 9, 1981 Liszt - the lisp compiler 12-7 passed to other functions. _1_2._5. _C_o_m_p_i_l_e_r _o_p_t_i_o_n_s The compiler recognizes a number of options which are described below. The options are typed anywhere on the command line preceded by a minus sign. The entire command line is scanned and all options recorded before any action is taken. Thus % liszt -mx foo % liszt -m -x foo % liszt foo -mx are all equivalent. The meaning of the options are: C The assembler language output of the compiler is commented. This is useful when debugging the compiler and is not normally done since it slows down compilation. i Compile this program in interlisp compatibility mode. This is not implemented yet. m Compile this program in Maclisp mode. The reader syntax will be changed to the Maclisp syntax and a file of macro definitions will be loaded in (usually named /usr/lib/lisp/machacks). This switch brings us sufficiently close to Maclisp to allow us to compile Macsyma, a large Maclisp pro- gram. However Maclisp is a moving target and we can't guarantee that this switch will allow you to compile any given program. o Select a different object file name. This is the only switch with an argument, which must follow the switch. For example % liszt foo -o xxx.o will compile foo and into xxx.o instead of the default foo.o. q Run in quiet mode. The names of functions being compiled and various "Note"'s are not printed. S Create an assembler language file only. % liszt -S foo will create the file assembler language file foo.s and will not attempt to assemble it. If this option is not specified, the assembler language file will be put in the temporary disk area under a automatically generated name based on the lisp compiler's process id. Then if there Printed: July 9, 1981 Liszt - the lisp compiler 12-8 are no compilation errors, the assembler will be invoked to assemble the file. T Print the assembler language output on the stan- dard output file. This is useful when debugging the compiler. u Run in UCI-Lisp mode. The character syntax is changed to that of UCI-Lisp and a UCI-Lisp compa- tibility package of macros is read in. w Suppress warning messages. x Create an cross reference file. % liszt -x foo not only compiles foo into foo.o but also gen- erates the file foo.x . The file foo.x is lisp readable and lists for each function all func- tions which that function could call. The pro- gram lxref reads one or more of these ".x" files and produces a human readable cross reference listing. _1_2._6. _t_r_a_n_s_f_e_r _t_a_b_l_e_s A transfer table is setup by _f_a_s_l when the object file is loaded in. There is one entry in the transfer table for each function which is called in that object file. The entry for a call to the function _f_o_o has two parts whose contents are: [1] function address - This will initially point to the internal function _q_l_i_n_k_e_r. It may some time in the future point to the function _f_o_o if cer- tain conditions are satisfied (more on this below). [2] function name - This is a pointer to the symbol _f_o_o. This will be used by _q_l_i_n_k_e_r. When a call is made to the function _f_o_o the call will actually be made to the address in the transfer table entry and will end up in the _q_l_i_n_k_e_r function. _Q_l_i_n_k_e_r will determine that _f_o_o was the function being called by locating the function name entry in the transfer table[]. If the function being called is not ____________________ 9 []_Q_l_i_n_k_e_r does this by tracing back the call stack until it finds the _c_a_l_l_s machine instruction which called it. The 9 Printed: July 9, 1981 Liszt - the lisp compiler 12-9 compiled then _q_l_i_n_k_e_r just calls _f_u_n_c_a_l_l to perform the function call. If _f_o_o is compiled and if (_s_t_a_t_u_s _t_r_a_n_s_l_i_n_k) is non nil, then _q_l_i_n_k_e_r will modify the function address part of the transfer table to point directly to the function _f_o_o. Finally _q_l_i_n_k_e_r will call _f_o_o directly . The next time a call is made to _f_o_o the call will go directly to _f_o_o and not through _q_l_i_n_k_e_r. This will result in a substan- tial speedup in compiled code to compiled code transfers. A disadvantage is that no debugging infor- mation is left on the stack, so _s_h_o_w_s_t_a_c_k and _b_a_k_t_r_a_c_e are useless. Another disadvantage is that if you redefine a compiled function either through loading in a new version or interactively defining it, then the old version may still be called from compiled code if the fast linking described above has already been done. The solution to these problems is to use (_s_s_t_a_t_u_s _t_r_a_n_s_l_i_n_k _v_a_l_u_e). If value is _n_i_l All transfer tables will be cleared, i.e. all function addresses will be set to point to _q_l_i_n_k_e_r. This means that the next time a func- tion is called _q_l_i_n_k_e_r will be called and will look at the current definition. Also, no fast links will be set up since (_s_t_a_t_u_s _t_r_a_n_s_l_i_n_k) will be nil. The end result is that _s_h_o_w_s_t_a_c_k and _b_a_k_t_r_a_c_e will work and the function defini- tion at the time of call will always be used. _o_n This causes the lisp system to go through all transfer tables and set up fast links wherever possible. This is normally used after you have _f_a_s_led in all of your files. Furthermore since (_s_t_a_t_u_s _t_r_a_n_s_l_i_n_k) is not nil, _q_l_i_n_k_e_r will make new fast links if the situation arises (which isn't likely unless you _f_a_s_l in another file). _t This or any other value not previously mentioned will just make (_s_t_a_t_u_s _t_r_a_n_s_l_i_n_k) be non nil, and as a result fast links will be made by _q_l_i_n_k_e_r if the called function is compiled. ____________________ 9address field of the _c_a_l_l_s contains the address of the transfer table entry. 9 Printed: July 9, 1981 Liszt - the lisp compiler 12-10 _1_2._7. _F_i_x_n_u_m _f_u_n_c_t_i_o_n_s The compiler will generate inline arithmetic code for fixnum only functions. Such functions include +, -, *, /, 1+ and 1-. The code generated will be much faster than using _a_d_d, _d_i_f_f_e_r_e_n_c_e, etc. However it will only work if the arguments to and results of the functions are fixnums. No type checking is done. 9 9 (( Printed: July 9, 1981 _o_n_s The compiler will generate inline arithmetic code for fixnum only functions. Such functions include +, -, *, /, 1+ and 1-. The code generated will be much faster than using _a_d_d, _d_i_f_f_e_r_e_n_c_e, etc. However it will only work if the arguments to and results of the functions are fixnums. No type checking is done. 9 9 lib/lisp/manual/ch2.r 664 0 33 113002 2552762103 7725 CHAPTER 2 Data Structure Access The following functions allow one to create and manipu- late the various types of lisp data structures. Refer to 1.3 for details of the data structures known to FRANZ LISP. (*array 's_name 's_type 'x_dim1 ... x_dim_n) WHERE: s_type may be one of t, nil, fixnum, flonum, fixnum-block and flonum-block. RETURNS: an array of type s_type with n dimensions of extents given by the x_dim_i. SIDE EFFECT: If s_name is non nil, the function defini- tion of s_name is set to the array struc- ture returned. NOTE: The *_a_r_r_a_y function creates a Maclisp compatible array. Arrays are fully described in 9. In FRANZ LISP arrays of type t, nil, fixnum and flo- num are equivalent and the elements of these arrays can be any type of lisp object. Fixnum- block and flonum-block arrays are restricted to fixnums and flonums respectively and are used mainly to communicate with foreign functions (see 8.4). (aexplode 's_arg) RETURNS: a list of single character symbols which _p_r_i_n_t would use to print out g_arg, that is the list returned will contain quoting characters if _p_r_i_n_t would have used them to print s_arg. NOTE: this is restricted to symbols and is mainly for use by explode. 9 9Data Structure Access 2-1 Data Structure Access 2-2 (aexplodec 's_arg) RETURNS: a list of symbols whose pnames are the charac- ters in s_arg's pname. (aexploden 's_arg) RETURNS: a list of fixnums which represent the charac- ters of s_arg's pname. ____________________________________________________ -> (_s_e_t_q _x '|_q_u_o_t_e _t_h_i_s _\| _o_k?|) |quote this \| ok?| -> (_a_e_x_p_l_o_d_e _x) (q u o t e |\\| | | t h i s |\\| | | |\\| |\|| |\\| | | o k ?) ; note that |\\| just means the single character: backslash. ; and |\|| just means the single character: vertical bar -> (_a_e_x_p_l_o_d_e_c _x) (q u o t e | | t h i s | | |\|| | | o k ?) -> (_a_e_x_p_l_o_d_e_n _x) (113 117 111 116 101 32 116 104 105 115 32 124 32 111 107 63) ____________________________________________________ (alphalessp 'st_arg1 'st_arg2) RETURNS: t iff the `name' of st_arg1 is alphabetically less than the name of st_arg2. If st_arg is a symbol than its `name' is its print name. If st_arg is a string, then its `name' is the string itself. (append 'l_arg1 'l_arg2) RETURNS: a list containing the elements of l_arg1 fol- lowed by l_arg2. NOTE: To generate the result, the top level list cells of l_arg1 are duplicated and the cdr of the last list cell is set to point to l_arg2. Thus this is an expensive operation if l_arg1 is large. See the description of nconc for a cheaper way of doing the append. 9 9 Printed: July 9, 1981 Data Structure Access 2-3 (append1 'l_arg1 'g_arg2) RETURNS: a list like l_arg1 with g_arg2 as the last element. NOTE: this is equivalent to (append 'l_arg1 (list 'g_arg2)). ____________________________________________________ ; A common mistake is using append to add one element to the end of a list -> (_a_p_p_e_n_d '(_a _b _c _d) '_e) (a b c d . e) ; better is append1 -> (_a_p_p_e_n_d_1 '(_a _b _c _d) '_e) (a b c d e) -> ____________________________________________________ (array s_name s_type x_dim1 ... x_dim_i) NOTE: this is the same as *array except the arguments are not evaluated. (arraycall s_type 'as_array 'x_ind1 ... ) RETURNS: the element selected by the indicies from the array a_array of type s_type. NOTE: if as_array is a symbol then the function binding of this symbol should contain an array object. s_type is ignored by _a_r_r_a_y_c_a_l_l but is included for compatibility with Maclisp. (arraydims 's_name) RETURNS: a list of the type and bounds of the array s_name. 9 9 Printed: July 9, 1981 Data Structure Access 2-4 (arrayp 'g_arg) RETURNS: t iff g_arg is of type array. (arrayref 'a_name 'x_ind) RETURNS: the x_ind_t_h element of the array object a_name. x_ind of zero accesses the first ele- ment. NOTE: _a_r_r_a_y_r_e_f used the data, length and delta fields of a_name to determine which object to return. ____________________________________________________ ; We will create a 3 by 4 array of general lisp objects -> (_a_r_r_a_y _e_r_n_i_e _t _3 _4) array[12] ; the array header is stored in the function definition slot of the ; symbol ernie -> (_a_r_r_a_y_p (_g_e_t_d '_e_r_n_i_e)) t -> (_a_r_r_a_y_d_i_m_s (_g_e_t_d '_e_r_n_i_e)) (t 3 4) ; store in ernie[2][2] the list (test list) -> (_s_t_o_r_e (_e_r_n_i_e _2 _2) '(_t_e_s_t _l_i_s_t)) (test list) ; check to see if it is there -> (_e_r_n_i_e _2 _2) (test list) ; now use the low level function _a_r_r_a_y_r_e_f to find the same element ; arrays are 0 based and row-major (the last subscript varies the fastest) ; thus element [2][2] is the 10th element , (starting at 0). -> (_a_r_r_a_y_r_e_f (_g_e_t_d '_e_r_n_i_e) _1_0) (ptr to)(test list) ; the result is a value cell (thus the (ptr to)) ____________________________________________________ 9 9 Printed: July 9, 1981 Data Structure Access 2-5 (ascii x_charnum) WHERE: x_charnum is between 0 and 255. RETURNS: a symbol whose print name is the single char- acter whose fixnum representation is x_charnum. (assoc 'g_arg1 'l_arg2) RETURNS: the first top level element of l_arg2 whose _c_a_r is _e_q_u_a_l to g_arg1. NOTE: the test is make with the lisp function equal. Usually l_arg2 has an _a-_l_i_s_t structure and g_arg1 acts as key. (assq 'g_arg1 'l_arg2) RETURNS: the first top level element of l_arg2 whose _c_a_r is equal to g_arg1 using the lisp function _e_q. NOTE: This is faster than assoc since eq is faster than equal but lisp objects which print alike are not always _e_q. See the description of eq for more details. 9 9 Printed: July 9, 1981 Data Structure Access 2-6 ____________________________________________________ ; an `assoc list' (or alist) is a common lisp data structure. It has the ; form ((key1 . value1) (key2 . value2) (key3 . value3) ... (keyn . valuen)) ; _a_s_s_o_c or _a_s_s_q is given a key and an assoc list and returns ; the key and value item if it exists, they differ only in how they test ; for equality of the keys. -> (_s_e_t_q _a_l_i_s_t '((_a_l_p_h_a . _a) ( (_c_o_m_p_l_e_x _k_e_y) . _b) (_j_u_n_k . _x))) ((alpha . a) ((complex key) . b) (junk . x)) ; we should use _a_s_s_q when the key is an atom -> (_a_s_s_q '_a_l_p_h_a _a_l_i_s_t) (alpha . a) ; but it may not work when the key is a list -> (_a_s_s_q '(_c_o_m_p_l_e_x _k_e_y) _a_l_i_s_t) nil ; however _a_s_s_o_c will always work -> (_a_s_s_o_c '(_c_o_m_p_l_e_x _k_e_y) _a_l_i_s_t) ((complex key) . b) ____________________________________________________ (atom 'g_arg) RETURNS: t iff g_arg is not a list or hunk object. NOTE: (atom '()) returns t. (bcdad 's_funcname) RETURNS: a fixnum which is the address in memory where the function s_funcname begins. If s_funcname is not a machine coded function (binary) then bcdad returns nil. 9 9 Printed: July 9, 1981 Data Structure Access 2-7 (bcdp 'g_arg) RETURNS: t iff g_arg is a data object of type binary. NOTE: the name of this function is a throwback to the PDP-11 ((Lisp system. (bigp 'g_arg) RETURNS: t iff g_arg is a bignum. (c..r 'lh_arg) WHERE: the .. represents any positive number of a's and d's. RETURNS: the result of accessing the list structure in the way determined by the function name. The a's and d's are read from right to left, a _d directing the access down the cdr part of the list cell and an _a down the car part. NOTE: lh_arg may also be nil, and it is guaranteed that the car and cdr of nil is nil. Currently one may dissect hunks and bignums with c..r as well although this is subject to change. (concat ['stn_arg1 ... ]) RETURNS: a symbol whose print name is the result of concatenating the print names, string charac- ters or numerical representations of the sn_arg_i. NOTE: If no arguments are given, a symbol with a null pname is returned. Concat places the symbol created on the oblist, the function uconcat does the same thing but does not place the new symbol on the oblist. EXAMPLE: (_c_o_n_c_a_t '_a_b_c (_a_d_d _3 _4) "_d_e_f") ==> abc7def 9 9 Printed: July 9, 1981 Data Structure Access 2-8 (cons 'g_arg1 'g_arg2) RETURNS: a new list cell whose car is g_arg1 and whose cdr is g_arg2. (copy 'g_arg) RETURNS: A structure _e_q_u_a_l to g_arg but with new list cells. (copysymbol 's_arg 'g_pred) RETURNS: an uninterned symbol with the same print name as s_arg. If g_pred is non nil, then the value, function binding and property list of the new symbol are made _e_q to those of s_arg. (cpy1 'xvt_arg) RETURNS: a new cell of the same type as xvt_arg with the same value as xvt_arg. (cxr 'x_ind 'h_hunk) RETURNS: element x_ind (starting at 0) of hunk h_hunk. (defprop ls_name g_val g_ind) RETURNS: g_val. SIDE EFFECT: The property list of ls_name is updated by adding g_val as the value of indicator g_ind. NOTE: this is similar to putprop except that the argu- ments to defprop are not evaluated. ls_name may be a disembodied property list, see _g_e_t. 9 9 Printed: July 9, 1981 Data Structure Access 2-9 (delete 'g_val 'l_list ['x_count]) RETURNS: the result of splicing g_val from the top level of l_list no more than x_count times. NOTE: x_count defaults to a very large number, thus if x_count is not given, all occurances of g_val are removed from the top level of l_list. g_val is compared with successive _c_a_r's of l_list using the function _e_q_u_a_l. SIDE EFFECT: l_list is modified using rplacd, no new list cells are used. (delq 'g_val 'l_list ['x_count]) RETURNS: the result of splicing g_val from the top level of l_list no more than x_count times. NOTE: _d_e_l_q is the same as _d_e_l_e_t_e except that _e_q is used for comparison instead of _e_q_u_a_l. ____________________________________________________ ; note that you should use the value returned by _d_e_l_e_t_e or _d_e_l_q ; and not assume that g_val will always show the deletions. ; For example -> (_s_e_t_q _t_e_s_t '(_a _b _c _a _d _e)) (a b c a d e) -> (_d_e_l_e_t_e '_a _t_e_s_t) (b c d e) ; the value returned is what we would expect -> _t_e_s_t (a b c d e) ; but test still has the first a in the list! ____________________________________________________ 9 9 Printed: July 9, 1981 Data Structure Access 2-10 (dtpr 'g_arg) RETURNS: t iff g_arg is a list cell. NOTE: that (dtpr '()) is nil. (eq 'g_arg1 'g_arg2) RETURNS: t if g_arg1 and g_arg2 are the exact same lisp object. NOTE: _E_q simply tests if g_arg1 and g_arg2 are located in the exact same place in memory. Lisp objects which print the same are not necessarily _e_q. The only objects guaranteed to be _e_q are interned symbols with the same print name. [Unless a sym- bol is created in a special way (such as with uconcat or maknam) it will be interned.] (equal 'g_arg1 'g_arg2) RETURNS: t iff g_arg1 and g_arg2 have the same struc- ture as described below. NOTE: g_arg and g_arg2 are _e_q_u_a_l if (1) they are eq. (2) they are both fixnums with the same value (3) they are both flonums with the same value (4) they are both bignums with the same value (5) they are both strings and are identical. (6) they are both lists and their cars and cdrs are _e_q_u_a_l. 9 9 Printed: July 9, 1981 Data Structure Access 2-11 ____________________________________________________ ; _e_q is much faster than _e_q_u_a_l, especially in compiled code, ; however you cannot use _e_q to test for equality of numbers outside ; of the range -1024 to 1023. _e_q_u_a_l will always work. -> (_e_q _1_0_2_3 _1_0_2_3) t -> (_e_q _1_0_2_4 _1_0_2_4) nil -> (_e_q_u_a_l _1_0_2_4 _1_0_2_4) t ____________________________________________________ (explode 'g_arg) RETURNS: a list of single character symbols which _p_r_i_n_t would use to print g_arg. (explodec 'g_val) RETURNS: the list of characters which print would use to print g_val except that special characters in symbols are not escaped (just as if patom were used to print them). (exploden 'g_val) RETURNS: a list of fixnums which print would use to print g_val except that special characters in symbols are not escaped (just as if patom were used to print them). (fillarray 's_array 'l_itms) RETURNS: s_array SIDE EFFECT: the array s_array is filled with elements from l_itms. If there are not enough ele- ments in l_itms to fill the entire array, then the last element of l_itms is used to fill the remaining parts of the array. 9 9 Printed: July 9, 1981 Data Structure Access 2-12 (gensym 's_leader) RETURNS: a new uninterned atom beginning with the first character of s_leader's pname, or beginning with g if s_leader is not given. NOTE: The symbol looks like x0nnnnn where x is s_leader's first character and nnnnn is the number of times you have called gensym. (get 'ls_name 'g_ind) RETURNS: the value under indicator g_ind in ls_name's property list if ls_name is a symbol. NOTE: If there is no indicator g_ind in ls_name's pro- perty list nil is returned. If ls_name is a list of an odd number of elements then it is a disem- bodied property list. _g_e_t searches a disembodied property list by starting at its _c_d_r and looking at every other element for g_ind. ____________________________________________________ -> (_p_u_t_p_r_o_p '_x_l_a_t_e '_a '_a_l_p_h_a) a -> (_p_u_t_p_r_o_p '_x_l_a_t_e '_b '_b_e_t_a) b -> (_p_l_i_s_t '_x_l_a_t_e) (alpha a beta b) -> (_g_e_t '_x_l_a_t_e '_a_l_p_h_a) a -> (_g_e_t '(_n_i_l _f_a_t_e_m_a_n _r_j_f _s_k_l_o_w_e_r _k_l_s _f_o_d_e_r_a_r_o _j_k_f) '_s_k_l_o_w_e_r) kls ____________________________________________________ 9 9 Printed: July 9, 1981 Data Structure Access 2-13 (get_pname 's_arg) RETURNS: the string which is the print name of s_arg. (getaccess 'a_array) RETURNS: the access function for the array a_array. NOTE: this function will most likely disappear in future releases. (getaddress 's_entry1 's_binder1 'st_discipline1 [... ...]) RETURNS: the binary object which s_binder1's function field is set to. NOTE: This looks in the running lisp's symbol table for a symbol with the same name as s_entry_i. It then creates a binary object whose entry field points to s_entry_i and whose discipline is st_discipline_i. This binary object is stored in the function field of s_binder_i. If st_discipline_i is nil, then "subroutine" is used by default. This is especially useful for _c_f_a_s_l users. (getaux 'a_array) RETURNS: the auxiliary field for the array a_array. NOTE: this function will most likely disappear in future releases. (getchar 's_arg 'x_index) RETURNS: the x_index'th character of the print name of s_arg or nil if x_index is less than 1 or greater than the length of s_arg's print name. 9 9 Printed: July 9, 1981 Data Structure Access 2-14 (getcharn 's_arg 'x_index) RETURNS: the fixnum representation of the x_ind((ex'th character of the print name of s_arg or nil if x_index is less than 1 or greater than the length of s_arg's print name. (getd 's_arg) RETURNS: the function definition of s_arg or nil if there is no function definition. NOTE: the function definition may turn out to be an array header. (getdelta 'a_array) RETURNS: the delta field for a_array. NOTE: this function will most likely disappear in future releases. (getentry 'y_funchd) RETURNS: the entry field of the binary y_funchd. NOTE: this function will most likely disappear in future releases. (getlength 'a_array) RETURNS: the length field of the array a_array. NOTE: this function will most likely disappear in future releases. (hunk 'g_val1 ['g_val2 ... 'g_val_n]) RETURNS: a hunk of length n whose elements are initial- ized to the g_val_i. NOTE: the maximum size of a hunk is 128. EXAMPLE: (_h_u_n_k _4 '_s_h_a_r_p '_k_e_y_s) ==> {4 sharp keys} 9 9 Printed: July 9, 1981 Data Structure Access 2-15 (hunksize 'h_arg) RETURNS: the size of the hunk h_arg. EXAMPLE: (_h_u_n_k_s_i_z_e (_h_u_n_k _1 _2 _3)) ==> 3 (implode 'l_arg) WHERE: l_arg is a list of symbols, strings and small fixnums. RETURNS: The symbol whose print name is the result of concatenating the first characters of the print names of the symbols and strings in the list. Any fixnums are converted to the equivalent ascii character. In order to con- catenate entire strings or print names, use the function _c_o_n_c_a_t. (intern 's_arg) RETURNS: s_arg SIDE EFFECT: s_arg is put on the oblist if it is not already there. (last 'l_arg) RETURNS: the last list cell in the list l_arg. EXAMPLE: _l_a_s_t does NOT return the last element of a list! (_l_a_s_t '(_a _b)) ==> (b) (length 'l_arg) RETURNS: the number of elements in the top level of list l_arg. 9 9 Printed: July 9, 1981 Data Structure Access 2-16 (list ['g_arg1 ... ]) RETURNS: a list whose elements are the g_arg_i. (makhunk 'xl_arg) RETURNS: a hunk of length xl_arg initialized to all nils if xl_arg is a fixnum. If xl_arg is a list, then we return a hunk of size (_l_e_n_g_t_h '_x_l__a_r_g) initialized to the elements in xl_arg. NOTE: (_m_a_k_h_u_n_k '(_a _b _c)) is equivalent to (_h_u_n_k '_a '_b '_c). EXAMPLE: (_m_a_k_h_u_n_k _4) ==> {nil nil nil nil} (*makhunk 'x_arg) RETURNS: a hunk of size 2[x_arg] initialized to EMPTY. NOTE: This is only to be used by such functions as _h_u_n_k and _m_a_k_h_u_n_k which create and initialize hunks for users. (maknam 'l_arg) RETURNS: what implode would return except the resulting symbol is uninterned. (makunbound 's_arg) RETURNS: s_arg SIDE EFFECT: the value of s_arg is made `unbound'. If the interpreter attempts to evaluate s_arg before it is again given a value, an unbound variable error will occur. 9 9 Printed: July 9, 1981 Data Structure Access 2-17 (marray 'g_data 's_access 'g_aux 'x_length 'x_delta) RETURNS: an array type with the fields set up from the above arguments in the obvious way (see 1.3.9). (member 'g_arg1 'l_arg2) RETURNS: that part of the l_arg2 beginning with the first occurrence of g_arg1. If g_arg1 is not in the top level of l_arg2, nil is returned. NOTE: the test for equality is made with _e_q_u_a_l. (memq 'g_arg1 'l_arg2) RETURNS: that part of the l_arg2 beginning with the first occurance of g_arg1. If g_arg1 is not in the top level of l_arg2, nil is returned. NOTE: the test for equality is made with _e_q. (nconc 'l_arg1 'l_arg2 ['l_arg3 ...]) RETURNS: A list consisting of the elements of l_arg1 followed by the elements of l_arg2 followed by l_arg3 and so on. NOTE: The _c_d_r of the last list cell of l_arg_i is changed to point to l_arg_i+_1. 9 9 Printed: July 9, 1981 Data Structure Access 2-18 ____________________________________________________ ; _n_c_o_n_c is faster than _a_p_p_e_n_d because it doesn't allocate new list ; cells. -> (_s_e_t_q _l_i_s_1 '(_a _b _c)) (a b c) -> (_s_e_t_q _l_i_s_2 '(_d _e _f)) (d e f) -> (_a_p_p_e_n_d _l_i_s_1 _l_i_s_2) (a b c d e f) -> _l_i_s_1 (a b c) ; note that lis1 has not been changed by _a_p_p_e_n_d -> (_n_c_o_n_c _l_i_s_1 _l_i_s_2) (a b c d e f) ; _n_c_o_n_c returns the same value as _a_p_p_e_n_d -> _l_i_s_1 (a b c d e f) ; but in doing so alters lis1 ____________________________________________________ (ncons 'g_arg) RETURNS: a new list cell with g_arg as car and nil as cdr. (not 'g_arg) RETURNS: t iff g_arg is nil. (nreconc 'l_lis1 'g_arg) RETURNS: (_n_c_o_n_c (_n_r_e_v_e_r_s_e '_l__l_i_s_1) '_g__a_r_g) ____________________________________________________ -> (_n_r_e_c_o_n_c '(_a _b _c) '(_x _y _z)) (c b a x y z) ____________________________________________________ 9 9 Printed: July 9, 1981 Data Structure Access 2-19 (nreverse 'l_arg) RETURNS: the reverse of l_arg. NOTE: The reverse is done in place, that is the list structure is modified. No new list cells are allocated. (nthelem 'n_arg1 'l_arg2) RETURNS: The n_arg1'_s_t element of the list l_arg2. NOTE: If n_arg1 is non-positive or greater than the length of the list, nil is returned. (null 'g_arg) RETURNS: t iff g_arg is nil. EQUIVALENT TO: not. (plist 's_name) RETURNS: the property list of s_name. (ptr 'g_arg) RETURNS: a value cell initialize to point to g_arg. (putaccess 'a_array 's_func) RETURNS: s_func. SIDE EFFECT: replaces the access field of a_array with s_func. NOTE: this function will most likely disappear in future releases. 9 9 Printed: July 9, 1981 Data Structure Access 2-20 (putaux 'a_array 'g_aux) RETURNS: s_aux. SIDE EFFECT: replaces the auxillary field of a_array with g_aux. NOTE: this function will most likely disappear in future releases. (putdelta 'a_array 'x_delta) RETURNS: x_delta. SIDE EFFECT: replaces the delta field of a_array with x_delta. NOTE: this function will most likely disappear in future releases. (putdisc 'y_func 's_discipline) RETURNS: s_discipline SIDE EFFECT: the discipline field of y_func is set to s_discipline. (putlength 'a_array 'x_length) RETURNS: x_length SIDE EFFECT: replaces the length field of a_array with x_length. NOTE: this function will most likely disappear in future releases. (putprop 'ls_name 'g_val 'g_ind) RETURNS: g_val. SIDE EFFECT: Adds to the property list of ls_name the value g_val under the indicator g_ind. NOTE: this is similar to _d_e_f_p_r_o_p except the arguments are evaluated to _p_u_t_p_r_o_p. ls_name may be a disembodied property list, see _g_e_t. 9 9 Printed: July 9, 1981 Data Structure Access 2-21 (quote g_arg) RETURNS: g_arg. NOTE: the reader allows you to abbreviate (quote foo) as 'foo. (rematom 's_arg) RETURNS: t if s_arg is indeed an atom. SIDE EFFECT: s_arg is put on the free atoms list, effectively reclaiming an atom cell. NOTE: This function does _n_o_t check to see if s_arg is on the oblist or is referenced anywhere. Thus calling _r_e_m_a_t_o_m on an atom in the oblist may result in disaster when that atom cell is reused! (remob 's_symbol) RETURNS: s_symbol SIDE EFFECT: s_symbol is removed from the oblist. (removeaddress 's_entry1 [...]) RETURNS: t iff all went well. SIDE EFFECT: The symbol table for the running lisp is modifed so that the entry points s_entry_n are local entry points. Making an entry point local will permit it to be redefined by _c_f_a_s_l. Any entry points given in the argument list which aren't in the symbol table are ignored. (remprop 'ls_name 'g_ind) RETURNS: the portion of ls_name's property list begin- ning with the property under the indicator g_ind. If there is no g_ind indicator in ls_name's plist, nil is returned. SIDE EFFECT: the value under indicat((or g_ind and g_ind itself is removed from the property list of ls_name. 9 9 Printed: July 9, 1981 Data Structure Access 2-22 NOTE: ls_name may be a disembodied property list, see _g_e_t. (replace 'g_arg1 'g_arg2) WHERE: g_arg1 and g_arg2 must be the same type of lispval and not symbols or hunks. RETURNS: g_arg2. SIDE EFFECT: The effect of _r_e_p_l_a_c_e is dependent on the type of the g_arg_i although one will notice a similarity in the effects. To understand what _r_e_p_l_a_c_e does to fixnum and flonum arguments you must first understand that such numbers are `boxed' in FRANZ LISP. What this means is that if the sym- bol x has a value 32412, then in memory the value element of x's symbol structure contains the address of another word of memory (called a box) with 32412 in it. Thus there are two ways of changing the value of x, one is to change the value element of x's symbol structure to point to a word of memory with a different value. Another way is to change the value in the box which x points to. The former method is used almost all of the time, the latter is used very rarely and has the potential to cause great confusion. The function _r_e_p_l_a_c_e allows you to do the latter, that is to actually change the value in the box. You should watch out for these situations. If you do (_s_e_t_q _y _x) then both x and y will point to the same box. If you now (_r_e_p_l_a_c_e _x _1_2_3_4_5) then y will also have the value 12345. And in fact there may be many other pointers to that box. Another problem with replacing fixnums is that some boxes are read only. The fixnums between -1024 and 1023 are stored in a read only area and attempts to replace them will result in an "Illegal memory reference" error (see the description of _c_o_p_y_i_n_t* for a way around this problem).. For the other valid types, the effect of _r_e_p_l_a_c_e is easy to understand. The fields of g_val1's structure are made eq to the corresponding fields of g_val2's struc- ture. For example, if x and y have lists as values then the effect of Printed: July 9, 1981 Data Structure Access 2-23 (_r_e_p_l_a_c_e _x _y) is the same as (_r_p_l_a_c_a _x (_c_a_r _y)) and (_r_p_l_a_c_d _x (_c_d_r _y)). (reverse 'l_arg) RETURNS: the reverse of the list l_arg. NOTE: The _r_e_v_e_r_s_e is performed by allocating new list cells to duplicate the top level of l_arg. This can be expensive if l_arg is large. The function nreverse will reverse the list without allocating new list cells. (rplaca 'lh_arg1 'g_arg2) RETURNS: the modified lh_arg1. SIDE EFFECT: the car of lh_arg1 is set to g_arg2. If lh_arg1 is a hunk then the second element of the hunk is set to g_arg2. (rplacd 'lh_arg1 'g_arg2) RETURNS: the modified lh_arg1. SIDE EFFECT: the cdr of lh_arg2 is set to g_arg2. If lh_arg1 is a hunk then the first element of the hunk is set to g_arg2. (rplacx 'x_ind 'h_hunk 'g_val) RETURNS: h_hunk SIDE EFFECT: Element x_ind (starting at 0) of h_hunk is set to g_val. (*rplacx 'x_ind 'h_hunk 'g_val) RETURNS: h_hunk SIDE EFFECT: Element x_ind (starting at 0) of h_hunk is set to g_val. NOTE: This is the same as _r_p_l_a_c_x except you may replace uninitialized hunk entries. This is only to be used by functions such as _h_u_n_k and _m_a_k_h_u_n_k which create hunks of sizes which are not powers of two. Printed: July 9, 1981 Data Structure Access 2-24 (sassoc 'g_arg1 'l_arg2 'sl_func) RETURNS: the result of (_c_o_n_d ((_a_s_s_o_c '_g__a_r_g '_l__a_r_g_2) (_a_p_p_l_y '_s_l__f_u_n_c _n_i_l))) NOTE: sassoc is written as a macro. (sassq 'g_arg1 'l_arg2 'sl_func) RETURNS: the result of (_c_o_n_d ((_a_s_s_q '_g__a_r_g '_l__a_r_g_2) (_a_p_p_l_y '_s_l__f_u_n_c _n_i_l))) NOTE: sassq is written as a macro. (set 's_arg1 'g_arg2) RETURNS: g_arg2. SIDE EFFECT: the value of s_arg1 is set to g_arg2. (setplist 's_atm 'l_plist) RETURNS: l_plist. SIDE EFFECT: the property list of s_atm is set to l_plist. (setq s_atm1 'g_val1 [ s_atm2 'g_val2 ... ... ]) WHERE: the arguments are pairs of atom names and expressions. RETURNS: the last g_val_i. SIDE EFFECT: each s_atm_i is set to have the value g_val_i. 9 9 Printed: July 9, 1981 Data Structure Access 2-25 (stringp 'g_arg) RETURNS: t iff g_arg is a string. (substring 'st_name 'x_start ['x_length]) RETURNS: the string of length at most x_length begin- ning at character x_start of st_name. NOTE: If st_name is a symbol, its print name is used. x_start selects the first character of the string to return. If x_start is 1, then the first char- acter of st_name is selected. If x_start is -1 then the last character of st_name is selected. If the magnitude of x_start is greater than the length of the st_name, then nil is returned. If x_length is not given or is less than zero, then infinity is assumed. (substringn 'st_name 'x_start ['x_length]) RETURNS: the fixnum representation of the character string of length x_length beginning at posi- tion x_start in the string st_name. NOTE: If st_name is a symbol, then its print name is used. x_start selects the character in the same way as in _s_u_b_s_t_r_i_n_g. A fixnum representation of a character string is a list of the fixnum equivalents of the characters. If x_length is not given or is negative, infinity is assumed. If x_length is 0 then the result is the same as if x_length were 1 except the single fixnum is returned instead of putting it in a list. (symbolp 'g_arg) RETURNS: t iff g_arg is a symbol. 9 9 Printed: July 9, 1981 Data Structure Access 2-26 (type 'g_arg) RETURNS: a symbol whose pname describes the type of g_arg. (typep 'g_arg) EQUIVALENT TO: type. (uconcat ['s_arg1 ... ]) RETURNS: a symbol whose pname is the result of con- catenating the print names (pnames) of the s_arg_i. NOTE: If no arguments are given, a symbol with a null pname is returned. _u_c_o_n_c_a_t does not place the symbol created on the oblist, the function concat does the same thing but does place the new symbol on the oblist. (valuep 'g_arg) RETURNS: t iff g_arg is a value cell 9 9 Printed: July 9, 1981 catenating the print names (pnames) of the s_arg_i. NOTE: If no arguments are given, a symbol with a null pname is returned. _u_c_o_n_c_a_t does not place the symbol created on the oblist, the function concat does the same thing but does place the new symbol on the oblist. (valuep 'g_arg) RETURNS: t iff g_arg is a value cell 9 9 Printed: July 9, 1981 lib/lisp/manual/ch3.r 664 0 33 26021 2552762103 7712 CHAPTER 3 Arithmetic Functions _3._1. This chapter describes FRANZ LISP's functions for doing arithmetic. Often the same function is know by many names, such as _a_d_d which is also _p_l_u_s, _s_u_m, and +. This is due to our desire to be compatible with other Lisps. The FRANZ LISP user is advised to avoid using functions with names such as + and * unless their arguments are fix((nums. The lisp compiler takes advantage of the fact that their arguments are fix- nums. An attempt to divide by zero will cause a float- ing exception signal from the UNIX operating system. The user can catch and process this interrupt if he wishes (see the description of the _s_i_g_n_a_l function). (abs 'n_arg) RETURNS: the absolute value of n_arg. (absval 'n_arg) EQUIVALENT TO: abs. (add ['n_arg1 ...]) RETURNS: the sum of the arguments. If no arguments are given, 0 is returned. NOTE: if the size of the partial sum exceeds the limit of a fixnum, the partial sum will be converted to a bignum. If any of the arguments are flonums, the partial sum will be converted to a flonum when that argument is processed and the result will thus be a flonum. Currently, if in the pro- cess of doing the addition a bignum must be con- verted into a flonum an error message will result. 9 9Arithmetic Functions 3-1 Arithmetic Functions 3-2 (add1 'n-arg) RETURNS: n_arg plus 1. (acos 'fx_arg) RETURNS: the arc cosine of fx_arg in the range 0 to Ji. (asin 'fx_arg) RETURNS: the arc sine of fx_arg in the range -J/2 to J/2. (atan 'fx_arg1 'fx_arg2) RETURNS: the arc tangent of fx_arg1/fx_arg2 in the range -J to J. (boole 'x_key 'x_v1 'x_v2 ...) RETURNS: the result of the bitwise boolean operation as described in the following table. NOTE: If there are more than 3 arguments, then evalua- tion proceeds left to right with each partial result becoming the new value of x_v1. That is, (_b_o_o_l_e '_k_e_y '_v_1 '_v_2 '_v_3) =_ (_b_o_o_l_e '_k_e_y (_b_o_o_l_e '_k_e_y '_v_1 '_v_2) '_v_3). In the following table, * represents bitwise and, + represents bitwise or, O+ represents bitwise xor and _ represents bitwise negation and is the highest precedence operator. 8___________________________________________________________________________________________ (boole 'key 'x 'y) 8______________________________________________________________________________________________________________________________________________________________________________________ key 0 1 2 3 4 5 6 7 result 0 x * y _ x * y y x * _ y x x O+ y x + y 8___________________________________________________________________________________________ key 8 9 10 11 12 13 14 15 result _ (x + y) _(x O+ y) _ x _ x + y _ y x + _ y _ x + _ y -1 8___________________________________________________________________________________________ 7|8|7|7|7|7|7|7|7|7| 9 |8|7|7|7|7|7|7|7|7| 9 9 9 Printed: July 9, 1981 Arithmetic Functions 3-3 (cos 'fx_angle) RETURNS: the cosine of fx_angle (which is assumed to be in radians). (diff ['n_arg1 ... ]) RETURNS: the result of subtracting from n_arg1 all sub- sequent arguments. If no arguments are given, 0 is returned. NOTE: See the description of add for details on data type conversions and restrictions. (difference ['n_arg1 ...]) EQUIVALENT TO: diff. (Divide 'i_dividend 'i_divisor) RETURNS: a list whose car is the quotient and whose cadr is the remainder of the division of i_dividend by i_divisor. NOTE: this is restricted to integer division. (Emuldiv 'x_fact1 'x_fact2 'x_addn 'x_divisor) RETURNS: a list of the quotient and remainder of this operation: ((x_fact1 * x_fact2) + (sign extended) x_addn) / x_divisor. NOTE: this is useful for creating a bignum arithmetic package in Lisp. (exp 'fx_arg) RETURNS: _e raised to the fx_arg power. 9 9 Printed: July 9, 1981 Arithmetic Functions 3-4 (expt 'n_base 'n_power) RETURNS: n_base raised to the i_power power. NOTE: if either of the arguments are flonums, the cal- culation will be done using _l_o_g and _e_x_p. (fact 'x_arg) RETURNS: x_arg factorial. (fix 'n_arg) RETURNS: a fixnum as close as we can get to n_arg. NOTE: _f_i_x will round down. Currently, if n_arg is a flonum larger than the size of a fixnum, this will fail. (fixp 'g_arg) RETURNS: t iff g_arg is a fixnum or bignum. (float 'n_arg) RETURNS: a flonum as close as we can get to n_arg. NOTE: if n_arg is a bignum larger than the maximum size of a flonum, then a floating exception will occur. (floatp 'g_arg) RETURNS: t iff g_arg is a flonum. (greaterp ['n_arg1 ...]) RETURNS: t iff the arguments are in a strictly decreas- ing order. NOTE: the function difference is used to compare adja- cent values. If any of the arguments are non numbers, the error message will come from the difference function. 9 9 Printed: July 9, 1981 Arithmetic Functions 3-5 (haipart bx_number x_bits) RETURNS: the x_bits high bits of |bx_number| if x_bits is positive, otherwise it returns the |x_bits| low bits of |bx_number|. (haulong bx_number) RETURNS: the number of significant bits in bx_number. NOTE: the result is equal to the least integer greater to or equal to the base two logarithm of |bx_number| + 1. (lessp ['n_arg1 ...]) RETURNS: t iff the arguments are in a strictly increas- ing order. NOTE: the function _d_i_f_f_e_r_e_n_c_e is used to compare adja- cent values. If any of the arguments are non numbers, the error message will come from the _d_i_f_f_e_r_e_n_c_e function. (log 'fx_arg) RETURNS: the natural logarithm of fx_arg. (lsh 'x_val 'x_amt) RETURNS: x_val shifted left by x_amt if x_amt is posi- tive. If x_amt is negative, then _l_s_h returns x_val shifted right by the magnitude if x_amt. (max 'n_arg1 ... ) RETURNS: the maximum value in the list of arguments. 9 9 Printed: July 9, 1981 Arithmetic Functions 3-6 (min 'n_arg1 ... ) RETURNS: the minimum value in the list of arguments. (minus 'n_arg) RETURNS: zero minus n_arg. (minusp 'g_arg) RETURNS: t iff g_arg is a negative number. (mod 'i_dividend 'i_divisor) RETURNS: the remainder when i_dividend is divided by i_divisor. (numberp 'g_arg) RETURNS: t iff g_arg is a number (fixnum, flonum or bignum). (numbp 'g_arg) EQUIVALENT TO: numberp. (onep 'g_arg) RETURNS: t iff g_arg is a number equal to 1. (plus ['n_arg ...]) EQUIVALENT TO: to add. 9 9 Printed: July 9, 1981 Arithmetic Functions 3-7 (plusp 'n_arg) RETURNS: t iff n_arg is greater than zero. (product ['n_arg1 ... ]) RETURNS: the product of all of its arguments. It returns 1 if there are no arguments. NOTE: See the description of the function _a_d_d for details and restrictions to the automatic data type coercion. (quotient ['n_arg1 ...]) RETURNS: the result of dividing the first argument by succeeding ones. NOTE: If there are no arguments, 1 is returned. See the description of the function _a_d_d for details and restrictions of data type coercion. A divide by zero will cause a floating exception interrupt -- see the description of the _s_i_g_n_a_l function. (random ['x_limit]) RETURNS: a fixnum between 0 and x_limit 1 if x_limit is given. If x_limit is not given, any fix- num, positive or negative, might be returned. (remainder 'i_dividend 'i_divisor) EQUIVALENT TO: mod. (rot 'x_val 'x_amt) RETURNS: x_val rotated left by x_amt if x_amt is posi- tive. If x_amt is negative, then x_val is rotated right by the magnitude of x_amt. 9 9 Printed: July 9, 1981 Arithmetic Functions 3-8 (sin 'fx_angle) RETURNS: the sine of fx_angle (which is assumed to be in radians). (sqrt 'fx_arg) RETURNS: the square root of fx_arg. (sub1 'n_arg) RETURNS: n_arg minus 1. (sum ['n_arg1 ...]) EQUIVALENT TO: add and plus. (times ['n_arg1 ... ]) EQUIVALENT TO: product. (zerop 'g_arg) RETURNS: t iff g_arg is a number equal to 0. _3._2. These functions are restricted to fixnum argu- ments in Maclisp. The lisp compiler will assume the arguments are fixnums and open code most of these func- tions. (1+ 'n_arg) EQUIVALENT TO: add1. 9 9 Printed: July 9, ((1981 Arithmetic Functions 3-9 (1- 'n_arg) EQUIVALENT TO: sub1. (+ 'n_arg) EQUIVALENT TO: add. (* 'n_arg) EQUIVALENT TO: times. (- 'n_arg) EQUIVALENT TO: difference. (/ 'n_arg1 'n_arg2) EQUIVALENT TO: quotient (< 'n_arg1 'n_arg2) EQUIVALENT TO: lessp. (= 'g_arg1 'g_arg2) EQUIVALENT TO: equal. (> 'n_arg1 'n_arg2) EQUIVALENT TO: greaterp. 9 9 Printed: July 9, 1981 metic Functions 3-9 (1- 'n_arg) EQUIVALENT TO: sub1. (+ 'n_arg) EQUIVALENT TO: add. (* 'n_arg) EQUIVALENT TO: times. (- 'n_arg) EQUIVALENT TO: difference. (/ 'n_arg1 'n_arg2) EQUIVALENT TO: quotient (< 'n_arg1 'n_arg2) EQUIVALENT TO: lessp. (= 'g_arg1 'g_arg2) EQUIVALENT TO: equal. (> 'n_arg1 'n_arg2) EQUIVALENT TO: greaterp. 9 9 Printed:lib/lisp/manual/ch4.r 664 0 33 57651 2552762104 7731 CHAPTER 4 Special Functions (and [g_arg1 ...]) RETURNS: the value of the last argument if all argu- ments evaluate to a non nil value, otherwise _a_n_d returns nil. It returns t if there are no arguments. NOTE: the arguments are evaluated left to right and evaluation will cease with the first nil encoun- tered (apply 'u_func 'l_args) RETURNS: the result of applying function u_func to the arguments in the list l_args. NOTE: If u_func is a lambda, then the (_l_e_n_g_t_h _l__a_r_g_s) should equal the number of formal parameters for the u_func. If u_func is a nlambda or macro, then l_args is bound to the single formal parame- ter. 9 9 Special Functions 4-1 Special Functions 4-2 ____________________________________________________ ; _a_d_d_1 is a lambda of 1 argument -> (_a_p_p_l_y '_a_d_d_1 '(_3)) 4 ; we will define _p_l_u_s_1 as a macro which will be equivalent to _a_d_d_1 -> (_d_e_f _p_l_u_s_1 (_m_a_c_r_o (_a_r_g) (_l_i_s_t '_a_d_d_1 (_c_a_d_r _a_r_g)))) plus1 -> (_p_l_u_s_1 _3) 4 ; now if we _a_p_p_l_y a macro we obtain the form it changes to. -> (_a_p_p_l_y '_p_l_u_s_1 '(_p_l_u_s_1 _3)) (add1 3) ; if we _f_u_n_c_a_l_l a macro however, the result of the macro is _e_v_a_led ; before it is returned. -> (_f_u_n_c_a_l_l '_p_l_u_s_1 '(_p_l_u_s_1 _3)) 4 ____________________________________________________ (arg ['x_numb]) RETURNS: if x_numb is specified then the x_numb'_t_h argument to the enclosing lexpr If x_numb is not specified then this returns the number of arguments to the enclosing lexpr. NOTE: it is an error to the interpreter if x_numb is given and out of range. (break [g_message ['g_pred]]) WHERE: if g_message is not given it is assumed to be the null string, and if g_pred is not given it is assumed to be t. RETURNS: the value of (*break 'g_pred 'g_message) 9 9 Printed: July 9, 1981 Special Functions 4-3 (*break 'g_pred 'g_message) RETURNS: nil immediately if g_pred is nil, else the value of the next (return 'value) expression typed in at top level. SIDE EFFECT: If the predicate, g_pred, evaluates to non nil, the lisp system stops and prints out `Break ' followed by g_message. It then enters a break loop which allows one to interactively debug a program. To con- tinue execution from a break you can use the _r_e_t_u_r_n function. to return to top level or another break level, you can use _r_e_t_b_r_k or _r_e_s_e_t. (catch g_exp [ls_tag]) WHERE: if ls_tag is not given, it is assumed to be nil. RETURNS: the result of (*catch 'ls_tag g_exp) NOTE: catch is defined as a macro. (*catch 'ls_tag g_exp) WHERE: ls_tag is either a symbol or a list of sym- bols. RETURNS: the result of evaluating g_exp or the value thrown during the evaluation of g_exp. SIDE EFFECT: this first sets up a `catch frame' on the lisp runtime stack. Then it begins to evaluate g_exp. If g_exp evaluates nor- mally, its value is returned. If, however a _t_h_r_o_w is done during the evaluation of g_exp we will catch the value thrown iff one of these cases is true: (1) the tag thrown to is ls_tag (2) ls_tag is a list and the tag thrown to is a member of this list (3) ls_tag is nil. NOTE: Errors are implemented as a special kind of throw. A catch with no tag will not catch an error but a catch whose tag is the error type Printed: July 9, 1981 Special Functions 4-4 will catch that type of error. See 10 for more information. (comment [g_arg ...]) RETURNS: the symbol comment. NOTE: This does absolutely nothing. (cond [l_clause1 ...]) RETURNS: the last value evaluated in the first clause satisfied. If no clauses are satisfied then nil is returned. NOTE: This is the basic conditional `statement' in lisp. The clauses are processed from left to right. The first element of a clause is evaluated. If it evaluated to a non nil value then that clause is satisfied and all following elements of that clause are evaluated. The last value computed is returned as the value of the cond. If there is just one element in the clause then its value is returned. If the first element of a clause evaluates to nil, then the other ele- ments of that clause are not evaluated and the system moves to the next clause. (declare [g_arg ...]) RETURNS: nil NOTE: this is a no-op to the evaluator. It has special meaning to the compiler. (def s_name (s_type l_argl g_exp1 ...)) WHERE: s_type is one of lambda, nlambda, macro or lexpr. RETURNS: s_name SIDE EFFECT: This defines the function s_name to the lisp system. If s_type is nlambda or macro then the argument list l_argl must contain exactly one non-nil symbol. 9 9 Printed: July 9, 1981 Special Functions 4-5 (defun s_name [s_mtype] ls_argl g_exp1 ... ) WHERE: s_mtype is one of fexpr, expr, args or macro. RETURNS: s_name SIDE EFFECT: This defines the function s_name. NOTE: this exists for MAClisp compatibility, it is just a macro which changes the defun form to the def form. An s_mtype of fexpr is converted to nlambda and of expr to lambda. Macro remains the same. If ls_arg1 is a non-nil symbol, then the type is assumed to be lexpr and ls_arg1 is the symbol which is bound to the number of args when the function is entered. ____________________________________________________ ; _d_e_f and _d_e_f_u_n here are used to define identical functions ; you can decide for yourself which is easier to use. -> (_d_e_f _a_p_p_e_n_d_1 (_l_a_m_b_d_a (_l_i_s _e_x_t_r_a) (_a_p_p_e_n_d _l_i_s (_l_i_s_t _e_x_t_r_a)))) append1 -> (_d_e_f_u_n _a_p_p_e_n_d_1 (_l_i_s _e_x_t_r_a) (_a_p_p_e_n_d _l_i_s (_l_i_s_t _e_x_t_r_a))) append1 ____________________________________________________ (do l_vrbs l_test g_exp1 ...) RETURNS: the last form in the cdr of l_test evaluated, or a value explicitly given by a return evaluated within the do body. NOTE: This is the basic iteration form for FRANZ LISP. l_vrbs is a list of zero or more var-init-repeat forms. A var-init-repeat form looks like: (s_name [g_init [g_repeat]]) There are three cases depending on what is present in the form. If just s_name is present, this means that when the do is entered, s_name is lambda-bound to nil and is never modified by the system (though the program is certainly free to modify its value). If the form is (s_name 'g_init) then the only difference is that s_name is lambda-bound to the value of g_init instead of nil. If g_repeat is also present then s_name is lambda-bound to g_init when the loop is Printed: ((July 9, 1981 Special Functions 4-6 entered and after each pass through the do body s_name is bound to the value of g_repeat. l_test is either nil or has the form of a cond clause. If it is nil then the do body will be evaluated only once and the do will return nil. Otherwise, before the do body is evaluated the car of l_test is evaluated and if the result is non nil this signals an end to the looping. Then the rest of the forms in l_test are evaluated and the value of the last one is returned as the value of the do. If the cdr of l_test is nil, then nil is returned -- thus this is not exactly like a cond clause. g_exp1 and those forms which follow constitute the do body. A do body is like a prog body and thus may have labels and one may use the func- tions go and return. The sequence of evaluations is this: (1) the init forms are evaluated left to right and stored in temporary locations. (2) Simultaneously all do variables are lambda bound to the value of their init forms or nil. (3) If l_test is non nil then the car is evaluated and if it is non nil the rest of the forms in l_test are evaluated and the last value is returned as the value of the do. (4) The forms in the do body are evaluated left to right. (5) If l_test is nil the do function returns with the value nil. (6) The repeat forms are evaluated and saved in tem- porary locations. (7) The variables with repeat forms are simultaneously bound to the values of those forms. (8) Go to step 3. NOTE: there is an alternate form of do which can be used when there is only one do variable. It is described next. 9 9 Printed: July 9, 1981 Special Functions 4-7 (do s_name g_init g_repeat g_test g_exp1 ...) NOTE: this is another, less general, form of do. It is evaluated by: (1) evaluating g_init (2) lambda binding s_name to value of g_init (3) g_test is evaluated and if it is not nil the do function returns with nil. (4) the do body is evaluated beginning at g_exp1. (5) the repeat form is evaluated and stored in s_name. (6) go to step 3. (err ['s_value [nil]]) RETURNS: nothing (it never returns). SIDE EFFECT: This causes an error and if this error is caught by an _e_r_r_s_e_t then that _e_r_r_s_e_t will return s_value instead of nil. If the second arg is given, then it must be nil (MAClisp compatibility). (error ['s_message1 ['s_message2]]) RETURNS: nothing (it never returns). SIDE EFFECT: s_message1 and s_message2 are _p_a_t_o_med if they are given and then _e_r_r is called which causes an error. (errset g_expr [s_flag]) RETURNS: a list of one element, which is the value resulting from evaluating g_expr. If an error occurs during the evaluation of g_expr, then the locus of control will return to the _e_r_r_s_e_t which will then return nil (unless the error was caused by a call to _e_r_r). SIDE EFFECT: S_flag is evaluated before g_expr is evaluated. If s_flag is not given, then it is assumed to be t. If an error occurs during the evaluation of g_expr, and s_flag evaluated to a non nil value, then Printed: July 9, 1981 Special Functions 4-8 the error message associated with the error is printed before control returns to the errset. (eval 'g_val) RETURNS: the result of evaluating g_val. NOTE: The evaluator evaluates g_val in this way: If g_val is a symbol, then the evaluator returns its value. If g_val had never been assigned a value, then this causes an 'Unbound Variable' error. If g_val is of type value, then its value is returned. If g_val is a list object then g_val is either a function call or array refer- ence. Let g_car be the first element of g_val. We continually evaluate g_car until we end up with a symbol with a non nil function binding or a non-symbol. Call what we end up with: g_func. g_func must be one of three types: list, binary or array. If it is a list then the first element of the list, which we shall call g_functype, must be either lambda, nlambda, macro or lexpr. If g_func is a binary, then its discipline, which we shall call g_functype, is either lambda, nlambda, macro or a string "subroutine", "function", "integer-function" or "real-function". If g_func is an array then this form is evaluated spe- cially, see 9 on arrays. If g_func is a list or binary, then g_functype will determine how the arguments to this function, the cdr of g_val, are processed. If g_functype is a string, then this is a foreign function call (see 8.4 for more details). If g_functype is lambda or lexpr, the arguments are evaluated (by calling _e_v_a_l recur- sively) and stacked. If g_functype is nlambda then the argument list is stacked. If g_functype is macro then the entire form, g_val is stacked. Next the formal variables are lambda bound. The formal variables are the cadr of g_func - if g_functype is nlambda, lexpr or macro, there should only be one formal variable. The values on the stack are lambda bound to the formal vari- ables except in the case of a lexpr, where the number of actual arguments is bound to the formal variable. After the binding is done, the func- tion is invoked, either by jumping to the entry point in the case of a binary or by evaluating the list of forms beginning at cddr g_func. The result of this function invocation is returned as the value of the call to eval. 9 9 Printed: July 9, 1981 Special Functions 4-9 (eval-when l_times g_exp1 ... g_expn) WHERE: l_times is a list containing any combination of compile, eval and load. RETURNS: nil if the symbol eval is not member of l_times, else returns the value of g_expn. SIDE EFFECT: If eval is a member of l_times, then the forms g_exp_i are evaluated. NOTE: this is used mainly to control when the compiler evaluates forms. (exec s_arg1 ...) RETURNS: the result of forking and executing the com- mand named by concatenating the s_arg_i together with spaces in between. (exece 's_fname ['l_args ['l_envir]]) RETURNS: the error code from the system if it was unable to execute the command s_fname with arguments l_args and with the environment set up as specified in l_envir. If this function is successful, it will not return, instead the lisp system will be overlaid by the new com- mand. (funcall 'u_func ['g_arg1 ...]) RETURNS: the value of applying function u_func to the arguments g_arg_i and then evaluating that result if u_func is a macro. NOTE: If u_func is a macro or nlambda then there should be only one g_arg. _f_u_n_c_a_l_l is the function which the evaluator uses to evaluate lists. If _f_o_o is a lambda or lexpr or array, then (_f_u_n_c_a_l_l '_f_o_o '_a '_b '_c) is equivalent to (_f_o_o '_a '_b '_c). If _f_o_o is a nlambda then (_f_u_n_c_a_l_l '_f_o_o '(_a _b _c)) is equivalent to (_f_o_o _a _b _c). Finally, if _f_o_o is a macro then (_f_u_n_c_a_l_l '_f_o_o '(_f_o_o _a _b _c)) is equivalent to (_f_o_o _a _b _c). 9 9 Printed: July 9, 1981 Special Functions 4-10 (function u_func) RETURNS: the function binding of u_func if it is an symbol with a function binding otherwise u_func is returned. (getdisc 't_func) RETURNS: the discipline of the machine coded function (either lambda, nlambda or macro). (go g_labexp) WHERE: g_labexp is either a symbol or an expression. SIDE EFFECT: If g_labexp is an expression, that expres- sion is evaluated and should result in a symbol. The locus of control moves to just following the symbol g_labexp in the current prog or do body. NOTE: this is only valid in the context of a prog or do body. The interpreter and compiler will allow non-local _g_o's although the compiler won't allow a _g_o to leave a function body. The compiler will not allow g_labexp to be an expression. (map 'u_func (('l_arg1 ...) RETURNS: l_arg1 NOTE: The function u_func is applied to successive sub- lists of the l_arg_i. All sublists should have the same length. (mapc 'u_func 'l_arg1 ...) RETURNS: l_arg1. NOTE: The function u_func is applied to successive ele- ments of the argument lists. All of the lists should have the same length. 9 9 Printed: July 9, 1981 Special Functions 4-11 (mapcan 'u_func 'l_arg1 ...) RETURNS: nconc applied to the results of the functional evaluations. NOTE: The function u_func is applied to successive ele- ments of the argument lists. All sublists should have the same length. (mapcar 'u_func 'l_arg1 ...) RETURNS: a list of the values returned from the func- tional application. NOTE: the function u_func is applied to successive ele- ments of the argument lists. All sublists should have the same length. (mapcon 'u_func 'l_arg1 ...) RETURNS: nconc applied to the results of the functional evaluation. NOTE: the function u_func is applied to successive sub- lists of the argument lists. All sublists should have the same length. (maplist 'u_func 'l_arg1 ...) RETURNS: a list of the results of the functional evaluations. NOTE: the function u_func is applied to successive sub- lists of the arguments lists. All sublists should have the same length. (mfunction entry 's_disc) RETURNS: a lisp object of type binary composed of entry and s_disc. NOTE: entry is a pointer to the machine code for a function, and s_disc is the discipline (e.g. lambda). 9 9 Printed: July 9, 1981 Special Functions 4-12 (oblist) RETURNS: a list of all symbols on the oblist. (or [g_arg1 ... ]) RETURNS: the value of the first non nil argument or nil if all arguments evaluate to nil. NOTE: Evaluation proceeds left to right and stops as soon as one of the arguments evaluates to a non nil value. (prog l_vrbls g_exp1 ...) RETURNS: the value explicitly given in a return form or else nil if no return is done by the time the last g_exp_i is evaluated. NOTE: the local variables are lambda bound to nil then the g_exp are evaluated from left to right. This is a prog body (obviously) and this means than any symbols seen are not evaluated, instead they are treated as labels. This also means that returns and go's are allowed. (prog2 g_exp1 g_exp2 [g_exp3 ...]) RETURNS: the value of g_exp2. NOTE: the forms are evaluated from left to right and the value of g_exp2 is returned. (progn g_exp1 [g_exp2 ...]) RETURNS: the value of the last g_exp_i. NOTE: the forms are evaluated from left to right and the value of the last one is returned. 9 9 Printed: July 9, 1981 Special Functions 4-13 (progv 'l_locv 'l_initv g_exp1 ...) WHERE: l_locv is a list of symbols and l_initv is a list of expressions. RETURNS: the value of the last g_exp_i evaluated. NOTE: The expressions in l_initv are evaluated from left to right and then lambda-bound to the sym- bols in _locv. If there are too few expressions in l_initv then the missing values are assumed to be nil. If there are too many expressions in l_initv then the extra ones are ignored (although they are evaluated). Then the g_exp_i are evaluated left to right. The body of a progv is like the body of a progn, it is _n_o_t a prog body. (putd 's_name 'u_func) RETURNS: this sets the function binding of symbol s_name to u_func. (return ['g_val]) RETURNS: g_val (or nil if g_val is not present) from the enclosing prog or do body. NOTE: this form is only valid in the context of a prog or do body. (setarg 'x_argnum 'g_val) WHERE: x_argnum is greater than zero and less than or equal to the number of arguments to the lexpr. RETURNS: g_val SIDE EFFECT: the lexpr's x_argnum'th argument is set to g-val. NOTE: this can only be used within the body of a lexpr. 9 9 Printed: July 9, 1981 Special Functions 4-14 (throw 'g_val [s_tag]) WHERE: if s_tag is not given, it is assumed to be nil. RETURNS: the value of (*_t_h_r_o_w '_s__t_a_g '_g__v_a_l). (*throw 's_tag 'g_val) RETURNS: g_val from the first enclosing catch with the tag s_tag or with no tag at all. NOTE: this is used in conjunction with *_c_a_t_c_h to cause a clean jump to an enclosing context. 9 9 Printed: July 9, 1981 RE: if s_tag is not given, it is assumed to be nil. RETURNS: lib/lisp/manual/ch5.r 664 0 33 44735 2552762105 7732 CHAPTER 5 Input/Output The following functions are used to read and write to and from external devices and programs (through pipes). All I/O goes through the lisp data type called the port. A port may be open for either reading or writing but not both simul- taneously. There are only a limited number of ports (20) and they will not be reclaimed unless you _c_l_o_s_e them. All ports are reclaimed by a _r_e_s_e_t_i_o call but this drastic step won't be necessary if the program closes what it uses. If you don't supply a port argument to a function which requires one or if you supply a bad port argument (such as nil) then FRANZ LISP will use the default port according to this scheme. If you are reading then the default port is the value of the symbol _p_i_p_o_r_t and if you are writing it is the value of the symbol _p_o_p_o_r_t. Furthermore if the value of piport or poport is not a valid port then the standard input or standard output will be used, respectively. The standard input and standard output are usually the keyboard and ter- minal display unless your job is running in the background and its input or output is connected to a pipe. All output which goes to the standard output will also go to the port _p_t_p_o_r_t if it is a valid port. Output destined for the stan- dard output will not reach it if the symbol ^_w is non nil (although it will still go to _p_t_p_o_r_t if _p_t_p_o_r_t is a valid port). (cfasl 'st_file 'st_entry 's_funcname ['st_disc ['st_library]]) RETURNS: t SIDE EFFECT: This is use to load in a foreign function (see 8.4). The object file st_file is loaded into the lisp system. St_entry should be an entry point in the file just loaded. The function binding of the sym- bol s_funcname will be set to point to st_entry, so that when the lisp function s_funcname is called, st_entry will be run. st_disc is the discipline to be given to s_funcname. st_disc defaults to "subroutine" if it is not given or if it is given as nil. If st_library is non nil, then after st_file is loaded, the libraries given in st_library will be searched to resolve external references. Input/Output 5-1 Input/Output 5-2 The form of st_library should be something like "-lS -lm". The c library (" -lc " ) is always searched so when loading in a C file you probably won't need to specify a library. For Fortran files, you should specify "-lF77" and if you are doing any I/O that should be "-lF77 -lIf77". For Pascal files "-lpc" is required. NOTE: This function may be used to load the output of the assembler, C compiler, Fortran compiler, and Pascal compiler but NOT the lisp compiler (use _f_a_s_l for that). If a file has more than one entry point, then use _g_e_t_a_d_d_r_e_s_s to locate and setup other foreign functions. It is an error to load in a file which has a glo- bal entry point of the same name as a global entry point in the running lisp. As soon as you load in a file with _c_f_a_s_l, its global entry points become part of the lisp's entry points. Thus you cannot _c_f_a_s_l in the same file twice unless you use _r_e_m_o_v_e_a_d_d_r_e_s_s to change certain global entry points to local ent((ry points. (close 'p_port) RETURNS: SIDE EFFECT: the specified port is drained and closed, releasing the port. NOTE: The standard defaults are not used in this case since you probably never want to close the stan- dard output or standard input. (cprintf 'st_format 'xfst_val ['p_port]) RETURNS: xfst_val SIDE EFFECT: The UNIX formatted output function printf is called with arguments st_format and xfst_val. If xfst_val is a symbol then its print name is passed to printf. The format string may contain characters which are just printed literally and it may con- tain special formatting commands preceded by a percent sign. The complete set of formatting characters is described in the UNIX manual. Some useful ones are %d for printing a fixnum in decimal, %f or %e for printing a flonum, and %s for printing a Printed: July 9, 1981 Input/Output 5-3 character string (or print name of a sym- bol). EXAMPLE: (_c_p_r_i_n_t_f "_P_i _e_q_u_a_l_s %_f" _3._1_4_1_5_9) prints `Pi equals 3.14159' (drain ['p_port]) RETURNS: nil SIDE EFFECT: If this is an output port then the charac- ters in the output buffer are all sent to the device. If this is an input port then all pending characters are flushed. The default port for this function is the default output port. (fasl 'st_name ['st_mapf ['g_warn]]) WHERE: st_mapf and g_warn default to nil. RETURNS: t if the function succeeded, nil otherwise. SIDE EFFECT: this function is designed to load in an object file generated by the lisp compiler Liszt. File names for object files usu- ally end in `.o', so _f_a_s_l will append `.o' to st_name (if it is not already present). If st_mapf is non nil, then it is the name of the map file to create. _F_a_s_l writes in the map file the names and addresses of the functions it loads and defines. Normally the map file is created (i.e. truncated if it exists), but if (_s_s_t_a_t_u_s _a_p_p_e_n_d_m_a_p _t) is done then the map file will be appended. If g_warn is non nil and if a function is loaded from the file which is already defined, then a warning message will be printed. 9 9 Printed: July 9, 1981 Input/Output 5-4 (ffasl 'st_file 'st_entry 'st_funcname ['st_discipline]) RETURNS: the binary object created. SIDE EFFECT: the fortran object file st_file is loaded into the lisp system. St_entry should be an entry point in the file just loaded. A binary object will be created and its entry field will be set to point to st_entry. The discipline field of the binary will be set to st_discipline or "subroutine" by default. After st_file is loaded, the standard fortran libraries will be searched to resolve external references. NOTE: in F77 on Unix, the entry point for the fortran function foo is named `_foo_'. (flatc 'g_form ['x_max]) RETURNS: the number of characters required to print g_form using _p_a_t_o_m. If x_max is given, and the _f_l_a_t_c determines that it will return a value greater than x_max, then it gives up and returns the current value it has computed. This is useful if you just want to see if an expression is larger than a certain size. (flatsize 'g_form ['x_max]) RETURNS: the number of characters required to print g_form using _p_r_i_n_t. The meaning of x_max is the same as for flatc. NOTE: Currently this just _e_x_p_l_o_d_e's g_form and checks its length. (fseek 'p_port 'x_offset 'x_flag) RETURNS: the position in the file after the function is performed. SIDE EFFECT: this function position the read/write pointer before a certain byte in the file. If x_flag is 0 then the pointer is set to x_offset bytes from the beginning of the file. If x_flag is 1 then the pointer is set to x_offset bytes from the current location in the file. If x_flag is 2 then Printed: July 9, 1981 Input/Output 5-5 the pointer is set to x_offset bytes from the end of the file (the bytes between the end of the file and the new position will be filled with zeroes). (infile 's_filename) RETURNS: a port ready to read s_filename. SIDE EFFECT: this tries to open s_filename and if it cannot or if there are no ports available it gives an error message. NOTE: to allow your program to continue on a file not found error you can use something like: (_c_o_n_d ((_n_u_l_l (_s_e_t_q _m_y_p_o_r_t (_c_a_r (_e_r_r_s_e_t (_i_n_f_i_l_e _n_a_m_e) _n_i_l)))) (_p_a_t_o_m '"_c_o_u_l_d_n'_t _o_p_e_n _t_h_e _f_i_l_e"))) which will set myport to the port to read from if the file exists or will print a message if it couldn't open it and also set myport to nil. (load 's_filename ['st_map ['g_warn]]) RETURNS: t NOTE: The function of _l_o_a_d has changed since previous releases of FRANZ LISP and the following descrip- tion should be read carefully. SIDE EFFECT: _l_o_a_d now serves the function of both _f_a_s_l and the old _l_o_a_d. _L_o_a_d will search a user defined search path for a lisp source or object file with the filename s_filename (with the extension .l or .o added as appropriate). The search path which _l_o_a_d uses is the value of (_s_t_a_t_u_s _l_o_a_d-_s_e_a_r_c_h- _p_a_t_h). The default is (|.| /usr/lib/lisp) which means look in the current directory first and then /usr/lib/lisp. The file which _l_o_a_d looks for depends on the last two characters of s_filename. If s_filename ends with ".l" then _l_o_a_d will only look for a file name s_filename and will assume that this is a FRANZ LISP source file. If s_filename ends with ".o" then _l_o_a_d will only look for a file named s_filename and will assume that this is a FRANZ LISP object file to be _f_a_s_led in. Otherwise, _l_o_a_d will first look for s_filename.o, then s_filename.l and Printed: July 9, 1981 Input/Output 5-6 finally s_filename itself. If it finds s_filename.o it will assume that this is an object file, otherwise it will assume that it is a source file. An object file is loaded using _f_a_s_l and a source file is loaded by reading and evaluating each form in the file. The optional arguments st_map and g_warn are passed to _f_a_s_l should _f_a_s_l be called. NOTE: _l_o_a_d requires a port to open the file s_filename. It then lambda binds the symbol piport to this port and reads and evaluates the forms. (makereadtable ['s_flag]) WHERE: if s_flag is not present it is assumed to be nil. RETURNS: a readtable equal to the original readtable if s_flag is non nil, or else equal to the current readtable. See chapter 7 for a description of readtables and their uses. (nwritn ['p_port]) RETURNS: the number of characters in the buffer of the given port but not yet written out to the file or device. The buffer is flushed automati- cally after the buffer (of 512 characters) is filled or when _t_e_r_p_r is called. (outfile 's_filename) RETURNS: a port or nil SIDE EFFECT: this opens a port to write s_filename. The file opened is truncated by the _o_u_t_- _f_i_l_e if it existed beforehand. If there are no free ports, outfile returns nil. 9 9 Printed: July 9, 1981 Input/Output 5-7 (patom 'g_exp ['p_port]) RETURNS: g_exp SIDE EFFECT: g_exp is printed to the given port or the de((fault port. If g_exp is a symbol then the print name is printed without any escape characters around special charac- ters in the print name. If g_exp is a list then _p_a_t_o_m has the same effect as _p_r_i_n_t. (pntlen 'xfs_arg) WHERE: xfs_arg is a fixnum, flonum or symbol. RETURNS: the number of characters needed to print xfs_arg. (portp 'g_arg) RETURNS: t iff g_arg is a port. (pp [l_option] s_name1 ...) RETURNS: t SIDE EFFECT: If s_name_i has a function binding, it is pretty printed, otherwise if s_name_i has a value then that is pretty printed. Nor- mally the output of the pretty printer goes to the standard output port poport. The options allow you to redirect it. The option (_F _f_i_l_e_n_a_m_e) causes output to go to the file filename. The option (_P _p_o_r_t_n_a_m_e) causes output to go to the port portname which should have been opened previously. 9 9 Printed: July 9, 1981 Input/Output 5-8 (princ 'g_arg ['p_port]) EQUIVALENT TO: patom. (print 'g_arg ['p_port]) RETURNS: nil SIDE EFFECT: prints g_arg on the port p_port or the default port. (probef 'st_file) RETURNS: t iff the file st_file exists. NOTE: Just because it exists doesn't mean you can read it. (ratom ['p_port ['g_eof]]) RETURNS: the next atom read from the given or default port. On end of file, g_eof (default nil) is returned. (read ['p_port ['g_eof]]) RETURNS: the next lisp expression read from the given or default port. On end of file, g_eof (default nil) is returned. (readc ['p_port ['g_eof]]) RETURNS: the next character read from the given or default port. On end of file, g_eof (default nil) is returned. 9 9 Printed: July 9, 1981 Input/Output 5-9 (readlist 'l_arg) RETURNS: the lisp expression read from the list of characters in l_arg. (resetio) RETURNS: nil SIDE EFFECT: all ports except the standard input, out- put and error are closed. (setsyntax 's_symbol 'sx_code ['ls_func]) RETURNS: t SIDE EFFECT: this sets the code for s_symbol to sx_code in the current readtable. If sx_code is _m_a_c_r_o or _s_p_l_i_c_i_n_g then ls_func is the associated function. See section 7 on the reader for more details. (terpr ['p_port]) RETURNS: nil SIDE EFFECT: a terminate line character sequence is sent to the given port or the default port. This will also flush the buffer. (terpri ['p_port]) EQUIVALENT TO: terpr. (tyi ['p_port]) RETURNS: the fixnum representation of the next charac- ter read. On end of file, -1 is returned. 9 9 Printed: July 9, 1981 Input/Output 5-10 (tyipeek ['p_port]) RETURNS: the fixnum representation of the next charac- ter to be read. NOTE: This does not actually read the character, it just peeks at it. (tyo 'x_char ['p_port]) RETURNS: x_char. SIDE EFFECT: the fixnum representation of a character, x_code, is printed as a character on the given output port or the default output port. (zapline) RETURNS: nil SIDE EFFECT: all characters up to and including the line termination character are read and discarded from the last port used for input. NOTE: this is used as the macro function for the semi- colon character when it acts as a comment charac- ter. 9 9 Printed: July 9, 1981 default output lib/lisp/manual/ch6.r 664 0 33 50211 2552762106 7716 CHAPTER 6 System Functions This chapter describes the functions which one uses to interact with FRANZ LISP running in the UNIX environment. (allocate 's_type 'x_pages) WHERE: s_type is one of the FRANZ LISP data types described in 1.3. RETURNS: x_pages. SIDE EFFECT: FRANZ LISP attempts to allocate x_pages of type s_type. It allocates pages one at a time so that if an error occurs this means that all free storage has been allocated. The storage that is allocated is not given to the caller, instead it is added to the free storage list of s_type. The func- tions _s_e_g_m_e_n_t and _s_m_a_l_l-_s_e_g_m_e_n_t allocate blocks of storage and return it to the caller. (argv 'x_argnumb) RETURNS: a symbol whose pname is the x_argnumb_t_h argu- ment (starting at 0) on the command line which invoked the current lisp. NOTE: if x_argnumb is less that zero, a fixnum whose value is the number of arguments on the command line is returned. (_a_r_g_v _0) returns the name of the lisp you are running. 9 9System Functions 6-1 System Functions 6-2 (baktrace) RETURNS: nil SIDE EFFECT: the lisp runtime stack is examined and the name of (most) of the functions currently in execution are printed, most active first. NOTE: this will occasionally miss the names of compiled lisp functions due to incomplete information on the stack. If you are tracing compiled code, then _b_a_k_t_r_a_c_e won't be able to interpret the stack unless (_s_s_t_a_t_u_s _t_r_a_n_s_l_i_n_k _n_i_l) was done. See the function _s_h_o_w_s_t_a_c_k for another way of printing the lisp runtime stack. (boundp 's_name) RETURNS: nil if s_name is unbound, that is it has never be given a value. If x_name has the value g_val, then (nil . g_val) is returned. (chdir 's_path) RETURNS: t iff the system call succeeds. SIDE EFFECT: the current directory set to s_path. Among other things, this will affect the default location where the input/output functions look for and create files. NOTE: _c_h_d_i_r follows the standard UNIX conventions, if s_path does not begin with a slash, the default path is changed to the current path with s_path appended. (dumplisp s_name) RETURNS: nil SIDE EFFECT: the current lisp is dumped to the disk with the file name s_name. When s_name is executed, you will be in a lisp in the same state as when the dumplisp was done. NOTE: dumplisp will fail if one tries to write over the current running file. UNIX does not allow you to modify the file you are running. 9 9 Printed: July 9, 1981 System Functions 6-3 (eval-when l_time g_exp1 ...) SIDE EFFECT: l_time may contain any combination of the symbols _l_o_a_d, _e_v_a_l, and _c_o_m_p_i_l_e. The effects of load and compile will is dis- cussed in the section on the compiler. If eval is present however, this simply means that the expressions g_exp1 and so on are evaluated from left to right. If eval is not present, the forms are not evaluated. (exit ['x_code]) RETURNS: nothing (it never returns). SIDE EFFECT: the lisp system dies with exit code x_code or 0 if x_code is not specified. (fake 'x_addr) RETURNS: the lisp object at address x_addr. NOTE: This is intended to be used by people debugging the lisp system. (gc) RETURNS: nil SIDE EFFECT: this causes a garbage collection. NOTE: garbage collection occurs automatically whenever internal free lists are exhausted. (gcafter s_type) WHERE: s_type is one of the FRANZ LISP data types listed in 1.3. NOTE: this function is called by the garbage collector after a garbage collection which was caused by running out of data type s_type. This function should determine if more space need be allocated and if so should allocate it. There is a default gcafter function but users who want control over space al((location can define their own -- but note that it must be an nlambda. 9 9 Printed: July 9, 1981 System Functions 6-4 (getenv 's_name) RETURNS: a symbol whose pname is the value of s_name in the current UNIX environment. If s_name doesn't exist in the current environment, a symbol with a null pname is returned. (hashtabstat) RETURNS: a list of fixnums representing the number of symbols in each bucket of the oblist. NOTE: the oblist is stored a hash table of buckets. Ideally there would be the same number of symbols in each bucket. (include s_filename) RETURNS: nil SIDE EFFECT: The given filename is _l_o_a_ded into the lisp. NOTE: this is similar to load except the argument is not evaluated. Include means something special to the compiler. (includef 's_filename) RETURNS: nil SIDE EFFECT: this is the same as _i_n_c_l_u_d_e except the argument is evaluated. (maknum 'g_arg) RETURNS: the address of its argument converted into a fixnum. 9 9 Printed: July 9, 1981 System Functions 6-5 (opval 's_arg ['g_newval]) RETURNS: the value associated with s_arg before the call. SIDE EFFECT: If g_newval is specified, the value asso- ciated with s_arg is changed to g_newval. NOTE: _o_p_v_a_l keeps track of storage allocation. If s_arg is one of the data types then _o_p_v_a_l will return a list of three fixnums representing the number of items of that type in use, the number of pages allocated and the number of items of that type per page. You should never try to change the value _o_p_v_a_l associates with a data type using _o_p_v_a_l. If s_arg is _p_a_g_e_l_i_m_i_t then _o_p_v_a_l will return (and set if g_newval is given) the maximum amount of lisp data pages it will allocate. This limit should remain small unless you know your program requires lots of space as this limit will catch programs in infinite loops which gobble up memory. (process s_pgrm [s_frompipe s_topipe]) RETURNS: if the optional arguments are not present a fixnum which is the exit code when s_prgm dies. If the optional arguments are present, it returns a fixnum which is the process id of the child. SIDE EFFECT: If s_frompipe and s_topipe are given, they are bound to ports which are pipes which direct characters from FRANZ LISP to the new process and to FRANZ LISP from the new process respectively. this forks a pro- cess named s_prgm and waits for it to die iff there are no pipe arguments given. 9 9 Printed: July 9, 1981 System Functions 6-6 (ptime) RETURNS: a list of two elements, the first is the amount of processor time used by the lisp sys- tem so far, the second is the amount of time used by the garbage collector so far. NOTE: the first number includes the second number. The amount of time used by garbage collection is not recorded until the first call to ptime. This is done to prevent overhead when the user is not interested garbage collection times. (reset) SIDE EFFECT: the lisp runtime stack is cleared and the system restarts at the top level by exe- cuting a (_f_u_n_c_a_l_l _t_o_p-_l_e_v_e_l _n_i_l). (retbrk ['x_level]) WHERE: x_level is a small integer of either sign. SIDE EFFECT: The default error handler keeps a notion of the current level of the error caught. If x_level is negative, control is thrown to this default error handler whose level is that many less than the present, or to _t_o_p-_l_e_v_e_l if there aren't enough. If x_level is non-negative, control is passed to the handler at that level. If x_level is not present, the value -1 is taken by default. (segment 's_type 'x_size) WHERE: s_type is one of the data types given in 1.3 RETURNS: a segment of contiguous lispvals of type s_type. NOTE: In reality, _s_e_g_m_e_n_t returns a new data cell of type s_type and allocates space for x_size - 1 more s_type's beyond the one returned. _S_e_g_m_e_n_t always allocates new space and does so in 512 byte chunks. If you ask for 2 fixnums, segment will actually allocate 128 of them thus wasting 126 fixnums. The function _s_m_a_l_l-_s_e_g_m_e_n_t is a smarter space allocator and should be used when- ever possible. Printed: July 9, 1981 System Functions 6-7 (shell) RETURNS: the exit code of the shell when it dies. SIDE EFFECT: this forks a new shell and returns when the shell dies. (showstack) RETURNS: nil SIDE EFFECT: all forms currently in evaluation are printed, beginning with the most recent. For compiled code the most that showstack will show is the function name and it may not show all of them. (signal 'x_signum 's_name) RETURNS: nil if no previous call to signal has been made, or the previously installed s_name. SIDE EFFECT: this declares that the function named s_name will handle the signal number x_signum. If s_name is nil, the signal is ignored. Presently only four UNIX signals are caught, they and their numbers are: Interrupt(2), Floating exception(8), Alarm(14), and Hang-up(1). (sizeof 'g_arg) RETURNS: the number of bytes required to store one object of type g_arg, encoded as a fixnum. (small-segment 's_type 'x_cells) WHERE: s_type is one of fixnum, flonum and value. RETURNS: a segment of x_cells data objects of type s_type. SIDE EFFECT: This may call _s_e_g_m_e_n_t to allocate new space or it may be able to fill the request on a page already allocated. The value returned by _s_m_a_l_l-_s_e_g_m_e_n_t is usually stored in the data subpart of an array object. 9 9 Printed: July 9, 1981 System Functions 6-8 (sstatus g_type g_val) RETURNS: g_val SIDE EFFECT: If g_type is not one of the special sstatus codes described in the next few pages this simply sets g_val as the value of status type g_type in the system status property list. (sstatus appendmap g_val) RETURNS: g_val SIDE EFFECT: If g_val is non nil then when _f_a_s_l is told to create a load map, it will append to the file name given in the _f_a_s_l command, rather than creating a new map file. (sstatus automatic-reset g_val) RETURNS: g_val SIDE EFFECT: If g_val is non nil then when an error occurs which no one wants to handle, a _r_e_s_e_t will be done instead of entering a primitive internal break loop. (sstatus chainatom g_val) RETURNS: g_val SIDE EFFECT: If g_val is non nil and a _c_a_r or _c_d_r of a symbol is done, then nil will be returned instead of an error being signaled. This only affects the interpreter, not the com- piler. 9 9 Printed: July 9, 1981 System Functions 6-9 (sstatus dumpcore g_val) RETURNS: g_val SIDE EFFECT: If g_val is nil, FRANZ LISP tells UNIX that a segmentation violation or bus error should cause a core dump. If g_val is non nil then FRANZ LISP will catch those errors and print a message advising the user to reset. NOTE: The default value for this flag is nil, and only those knowledgeable of the innards of the lisp system should ever set this flag non nil. (sstatus dumpmode x_val) RETURNS: x_val SIDE EFFECT: All subsequent _d_u_m_p_l_i_s_p's will be done in mode x_val. x_val may be either 413 or 410 (decimal). NOTE: the advantage of mode 413 is that the dumped Lisp can be demand paged in when first started, which will make it start faster and disrupt other users less. (sstatus feature g_val) RETURNS: g_val SIDE EFFECT: g_val is added to the (_s_t_a_t_u_s _f_e_a_t_u_r_e_s) list, (sstatus ignoreeof g_val) RETURNS: g_val SIDE EFFECT: I((f g_val is non nil then if a end of file (CNTL D on UNIX) is typed to the top level interpreter it will be ignored rather then cause the lisp system to exit. If the the standard input is a file or pipe then this has no effect, a EOF will always cause lisp to exit. 9 9 Printed: July 9, 1981 System Functions 6-10 (sstatus nofeature g_val) RETURNS: g_val SIDE EFFECT: g_val is removed from the status features list if it was present. (sstatus translink g_val) RETURNS: g_val SIDE EFFECT: If g_val is nil then all transfer tables are cleared and further calls through the transfer table will not cause the fast links to be set up. If g_val is the sym- bol _o_n then all possible transfer table entries will be linked and the flag will be set to cause fast links to be set up dynamically. Otherwise all that is done is to set the flag to cause fast links to be set up dynamically. NOTE: For a discussion of transfer tables, see the Sec- tion on the compiler. (sstatus uctolc g_val) RETURNS: g_val SIDE EFFECT: If g_val is not nil then all unescaped capital letters in symbols read by the reader will be converted to lower case. NOTE: This allows FRANZ LISP to be compatible with sin- gle case lisp systems (e.g. MAClisp). (status g_code) RETURNS: the value associated with the status code g_code if g_code is not one of the special cases given below 9 9 Printed: July 9, 1981 System Functions 6-11 (status ctime) RETURNS: a symbol whose print name is the current time and date. EXAMPLE: (_s_t_a_t_u_s _c_t_i_m_e) ==> |Sun Jun 29 16:51:26 1980| (status feature g_val) RETURNS: t iff g_val is in the status features list. (status features) RETURNS: the value of the features code, which is a list of features which are present in this system. You add to this list with (_s_s_t_a_t_u_s _f_e_a_t_u_r_e '_g__v_a_l) and test if feature g_feat is present with (_s_t_a_t_u_s _f_e_a_t_u_r_e '_g__f_e_a_t). (status isatty) RETURNS: t iff the standard input is a terminal. (status localtime) RETURNS: a list of fixnums representing the current time as described in the UNIX manual under LOCALTIME(3). EXAMPLE: (_s_t_a_t_u_s _l_o_c_a_l_t_i_m_e) ==> (20 51 16 29 5 80 0 1 nil) (status syntax s_char) RETURNS: a fixnum which is the syntax code associated with the character s_char in the current readtable. NOTE: You cannot set the syntax code with with (_s_s_t_a_t_u_s _s_y_n_t_a_x _c_h), you must use _s_e_t_s_y_n_t_a_x. 9 9 Printed: July 9, 1981 System Functions 6-12 (status undeffunc) RETURNS: a list of all functions which transfer table entries point to but which are not defined at this point. NOTE: Some of the undefined functions listed could be arrays which have yet to be created. (status version) RETURNS: a string which is the current lisp version name. EXAMPLE: (_s_t_a_t_u_s _v_e_r_s_i_o_n) ==> "Franz Lisp, Opus 33b" (syscall 'x_index ['xst_arg1 ...]) RETURNS: the result of issuing the UNIX system call number x_index with arguments xst_arg_i. NOTE: The UNIX system calls are described in section 2 of the UNIX manual. If xst_arg_i is a fixnum, then its value is passed as an argument, if it is a symbol then its pname is passed and finally if it is a string then the string itself is passed as an argument. Some useful syscalls are: (_s_y_s_c_a_l_l _2_0) returns process id. (_s_y_s_c_a_l_l _1_3) returns the number of seconds since Jan 1, 1970. (_s_y_s_c_a_l_l _1_0 '_f_o_o) will unlink (delete) the file foo. (top-level) RETURNS: nothing (it never returns) NOTE: This function is the top-level read-eval-print loop. It never returns any value. Its main utility is that if you redefine it, and do a (reset) then the redefined (top-level) is then invoked. 9 9 Printed: July 9, 1981 Jan 1, 1970. (_s_y_s_c_a_l_l _1_0 '_f_o_o) will unlink (delete) the file foo. (top-level) RETURNS: nothing (it never returns) NOTE: This function is the top-level read-eval-print loop. It never returns any value. Its main utility is that if you redefine it, and do a (reset) tlib/lisp/manual/ch7.r 664 0 33 22232 2552762106 7721 CHAPTER 7 The Reader The FRANZ LISP reader is controlled by a _r_e_a_d_t_a_b_l_e. A readtable is an array of fixnums, one fixnum for each of the 128 ascii characters. The fixnums tell the reader what the properties of the each character are. The initial readtable is described below. The user may create new readtables using the _m_a_k_e_r_e_a_d_t_a_b_l_e function. The current readtable is the value of the lisp symbol _r_e_a_d_t_a_b_l_e which, like any lisp symbol, may be lambda bound to allow the user to change the reader syntax very quickly. The values which may appear in the readtable are: 8_________________________________________________________________________ type value (decimal) meaning default 8__________________________________________________________________________________________________________________________________________________ vnum 0 digit 0-9 8_________________________________________________________________________ vsign 1 plus or minus + - 8_________________________________________________________________________ vchar 2 alphabetic character 7 A-Z a-z ^H ! $ % & * , / : ; < = > ? @ ^ _ ` { | } ~ 8_________________________________________________________________________ vsca 66 single char atom none 8_________________________________________________________________________ vlpara 195 left paren ( 8_________________________________________________________________________ vrpara 196 right paren ) 8_________________________________________________________________________ vperd 197 period . 8_________________________________________________________________________ vlbrkt 198 left bracket [ 8_________________________________________________________________________ vrbrkt 199 right bracket ] 8_________________________________________________________________________ veof 200 end of file rubout 8_________________________________________________________________________ vsq 201 single quote ' 8_________________________________________________________________________ vdq 138 | 7 double quote, all char- acters between matching double quotes are es- caped (i.e. treated as vchar) 8_________________________________________________________________________ vsd 137 " 7 string delimiter, all characters between matching delimiters are _c_o_n_c_a_ted into an object of type string 8_________________________________________________________________________ 9The Reader 7-1 The Reader 7-2 verr 203 illegal character 7 null ^A-^I ^N- ^Z ^\-^_ 8_______________________((__________________________________________________ vsep 204 separator ^I-^M esc space 8_________________________________________________________________________ vspl 205 splicing macro character none 8_________________________________________________________________________ vmac 206 macro character none 8_________________________________________________________________________ vesc 143 escape character \ 8_________________________________________________________________________ 799|99|99|99|99|99|99|99|99|99|99| 77777777777799 |99|99|99|99|99|99|99|99|99|99| 77777777777799 |99|99|99|99|99|99|99|99|99|99| 77777777777799 |99|99|99|99|99|99|99|99|99|99| 77777777777799 |99|99|99|99|99|99|99|99|99|99| 7777777777 The names in the type column are not known to Franz, we are just using them to tag the various classes. You must use the value in the second column. The default column shows the syntax values of characters in the raw lisp, i.e., the lisp which contains only machine language functions. The lisp which you get when you give the lisp command to the shell is an augmented version of the raw lisp, with addi- tional lisp coded functions and changes in the readtable. The syntax changes in the lisp may differ from installation to installation but will probably include making one charac- ter be a comment character. In the lisp at Berkeley, semi- colon is the comment character. This was done by declaring it to be a splicing macro character which invokes the func- tion _z_a_p_l_i_n_e when seen. To read the syntax of a character, you may use (status syntax s_char). To change the syntax bits of a character, use the _s_e_t_- _s_y_n_t_a_x function. There are two forms, one when you just want to change the syntax bits, and the other when you want to define a character macro. The first form is: (setsyntax _'_s___c _'_x___v_a_l_u_e) Here _s__c may be the character itself or it may be the fixnum representation of that character. _x__v_a_l_u_e is one of the values given above in the second column. You should be careful when you change the syntax of a character as the change lasts until you explicitly change it back or until you begin with a new lisp. Also, some syntax changes are silly and will probably cause system errors (e.g. changing the syntax of an alphabetic character to be a _v_n_u_m ). The only syntax values you will probably ever use are: _v_d_q and _v_e_s_c. You should not change the syntax to _v_s_p_l or _v_m_a_c using the above form, instead it will be done automatically when you use the form below. To declare a character macro use: (setsyntax _'_s___c _'_s___t_y_p_e _'_s___f_c_n) 9 Printed: July 9, 1981 The Reader 7-3 Where _s__c is again either the character itself or its fixnum equivalent, type is _s_p_l_i_c_i_n_g or _m_a_c_r_o, and _s__f_c_n is either the name of a function expecting no arguments or is a lambda expression. The result of the setsyntax function is two- fold: the readtable value for that character is changed to _v_s_p_l or _v_m_a_c, and the function is put on the property list of the character under the indicator "macro". The differ- ence between a splicing macro and a macro is this: the value returned by a splicing macro is _n_c_o_n_ced to what has been read so far (i.e. (nconc sofar justreturned)), while the value returned by a macro is added to what has been read, (i.e (nconc sofar (list justread)). Thus if a splicing macro returns nil, then it isn't seen since (nconc any nil) ==> any. In particular, splicing macros are useful for conditional loading of lisp expressions. FRANZ LISP treats left and right square brackets in a special way when building lists. A left bracket is just like a left parenthesis, and a right bracket matches a left bracket or all open left parentheses, whichever comes first. When building atoms, a character with the syntax code _v_e_s_c will cause the next character to be read in and treated as a _v_c_h_a_r. To escape an entire string of characters, you surround them with matching characters having the _v_d_q syntax code. To escape the _v_d_q character within the string of characters you use any character of class _v_e_s_c. The stan- dard UNIX escape character, backslash (`\'), is in this class by default. 9 9 Printed: July 9, 1981 _e_s_c will cause the next character to be read in and treated as a _v_c_h_a_r. To escape an entire string of characters, you surround them with matching characters having the _v_d_q syntax code. To escape the _v_d_q character within the string of characters you use any character of class _v_e_s_c. The stan- dard UNIX escape clib/lisp/manual/ch8.r 664 0 33 63032 2552762110 7720 CHAPTER 8 Functions and Macros _8._1. _v_a_l_i_d _f_u_n_c_t_i_o_n _o_b_j_e_c_t_s There are many different objects which can occupy the function field of a symbol object. The following table shows all of the possibilities, how to recognize them and where to look for documentation. 8 _____________________________________________________________ informal name object type documentation 8 __________________________________________________________________________________________________________________________ interpreted list with _c_a_r 8.2 lambda function _e_q to lambda 8 _____________________________________________________________ interpreted list with _c_a_r 8.2 nlambda function _e_q to nlambda 8 _____________________________________________________________ interpreted list with _c_a_r 8.2 lexpr function _e_q to lexpr 8 _____________________________________________________________ interpreted list with _c_a_r 8.3 macro _e_q to macro 8 _____________________________________________________________ compiled binary with discipline 8.2 lambda or lexpr _e_q to lambda function 8 _____________________________________________________________ compiled binary with discipline 8.2 nlambda function _e_q to nlambda 8 _____________________________________________________________ compiled binary with discipline 8.3 macro _e_q to macro 8 _____________________________________________________________ foreign binary with discipline 8.4 subroutine of "subroutine"[] 8 _____________________________________________________________ foreign binary with discipline 8.4 function of "function"[] 8 _____________________________________________________________ foreign binary with discipline 8.4 integer function of "integer-function"[] 8 _____________________________________________________________ foreign binary with discipline 8.4 real function of "real-function"[] 8 _____________________________________________________________ array array object 9 9Functions and Macros 8-1 Functions and Macros 8-2 8 _____________________________________________________________ 799 |99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99| 77777777777777777777799 |99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99| 77777777777777777777799 |99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99| 77777777777777777777799 |99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99|99| 7777777777777777777 _8._2. _f_u_n_c_t_i_o_n_s The basic lisp function is the lambda function. When a lambda function is called, the actual arguments are evaluated from left to right and are lambda-bound to the formal parameters of the lambda function. An nlambda function is usually used for functions which are invoked by the user at top level. Some built-in functions which evaluate their argu((ments in special ways are also nlambdas (e.g _c_o_n_d, _d_o, _o_r). When an nlambda function is called, the list of unevaluated arguments is lambda bound to the single formal parameter of the nlambda function. Some programmers will use an nlambda function when they are not sure how many arguments will be passed. Then the first thing the nlambda function does is map _e_v_a_l over the list of unevaluated argu- ments it has been passed. This is usually the wrong thing to do as it won't work compiled if any of the arguments are local variables. The solution is to use a lexpr. When a lexpr function is called, the argu- ments are evaluated and the number of arguments is lambda-bound to the single formal parameter of the lexpr function. The lexpr then accesses the arguments using the _a_r_g function. When a function is compiled _s_p_e_c_i_a_l declaration may be needed to preserve its behavior. An argument is not lambda-bound to the name of the corresponding formal parameter unless that formal parameter has been declared _s_p_e_c_i_a_l (see 12.3.2.2). Lambda and lexpr functions both compile into a binary object with a discipline of lambda. However, a compiled lexpr still acts like an interpreted lexpr. _8._3. _m_a_c_r_o_s An important features of Lisp is its abil- ity to manipulate programs as data. As a result of this, most Lisp implementations have very powerful macro facilities. The Lisp language's macro facility ____________________ 9 []Only the first character of the string is significant (i.e "s" is ok for "subroutine") Printed: July 9, 1981 Functions and Macros 8-3 can be used to incorporate popular features of the other languages into Lisp. For example, there are macro packages which allow one to create records (ala Pascal) and refer to elements of those records by the key names.[] Another popular use for macros is to create more readable control structures which expand into _c_o_n_d, _o_r and _a_n_d. One such example is the If macro in the jkfmacs.l package. It allows you to write (_I_f (_e_q_u_a_l _n_u_m_b _0) _t_h_e_n (_p_r_i_n_t '_z_e_r_o) (_t_e_r_p_r) _e_l_s_e_i_f (_e_q_u_a_l _n_u_m_b _1) _t_h_e_n (_p_r_i_n_t '_o_n_e) (_t_e_r_p_r) _e_l_s_e (_p_r_i_n_t '|_I _g_i_v_e _u_p|)) which expands to (_c_o_n_d ((_e_q_u_a_l _n_u_m_b _0) (_p_r_i_n_t '_z_e_r_o) (_t_e_r_p_r)) ((_e_q_u_a_l _n_u_m_b _1) (_p_r_i_n_t '_o_n_e) (_t_e_r_p_r)) (_t (_p_r_i_n_t '|_I _g_i_v_e _u_p|))) _8._3._1. _m_a_c_r_o _f_o_r_m_s A macro is a function which accepts a Lisp expression as input and returns another Lisp expression. The action the macro takes is called macro expansion. Here is a simple example: -> (_d_e_f _f_i_r_s_t (_m_a_c_r_o (_x) (_c_o_n_s '_c_a_r (_c_d_r _x)))) first -> (_f_i_r_s_t '(_a _b _c)) a -> (_a_p_p_l_y '_f_i_r_s_t '(_f_i_r_s_t '(_a _b _c))) (car '(a b c)) The first input line defines a macro called _f_i_r_s_t. Notice that the macro has one formal parameter, _x. On the second input line, we ask the interpreter to evaluate (_f_i_r_s_t '(_a _b _c)). _E_v_a_l sees that _f_i_r_s_t has a function definition of type macro so it evaluates _f_i_r_s_t's definition passing to _f_i_r_s_t as an argument, the form _e_v_a_l itself was trying to evalu- ate, (_f_i_r_s_t '(_a _b _c)). The _f_i_r_s_t macro chops off the car of the argument with _c_d_r, cons' a _c_a_r at ____________________ 9 []A record definition macro package especially suited for FRANZ LISP is in the planning stages at Berkeley. At this time the Maclisp _s_t_r_u_c_t package can be used. 9 Printed: July 9, 1981 Functions and Macros 8-4 the beginning of the list and returns (_c_a_r '(_a _b _c)). Now _e_v_a_l evaluates that, and the value is _a which is returned as the value of (_f_i_r_s_t '(_a _b _c)). Thus whenever _e_v_a_l tries to evaluate a list whose car has a macro definition it ends up doing (at least) two operations, one is a call to the macro to let it macro expand the form, and the other is the evaluation of the result of the macro. The result of the macro may be yet another call to a macro, so _e_v_a_l may have to do even more evaluations until it can finally deter- mine the value of an expression. One way to see how a macro will expand is to use _a_p_p_l_y as shown on the third input line above. _8._3._2. _d_e_f_m_a_c_r_o The macro _d_e_f_m_a_c_r_o makes it easier to define macros because it allows you to name the arguments to the macro call. For example, suppose we find ourselves often writing code like (_s_e_t_q _s_t_a_c_k (_c_o_n_s _n_e_w_e_l_t _s_t_a_c_k). We could define a macro named _p_u_s_h to do this for us. One way to define it is: -> (_d_e_f _p_u_s_h (_m_a_c_r_o (_x) (_l_i_s_t '_s_e_t_q (_c_a_d_d_r _x) (_l_i_s_t '_c_o_n_s (_c_a_d_r _x) (_c_a_d_d_r _x))))) push then (_p_u_s_h _n_e_w_e_l_t _s_t_a_c_k) will expand to the form mentioned above. The same macro written using def- macro would be: -> (_d_e_f_m_a_c_r_o _p_u_s_h (_v_a_l_u_e _s_t_a_c_k) (_l_i_s_t '_s_e_t_q _s_t_a_c_k (_l_i_s_t '_c_o_n_s _v_a_l_u_e _s_t_a_c_k)) push Defmacro allows you to name the arguments of the macro call, and makes the macro definition look more like a function definition. _8._3._3. _t_h_e _b_a_c_k_q_u_o_t_e _c_h_a_r_a_c_t_e_r _m_a_c_r_o The default syntax for FRANZ LISP has only three characters with associated character macros. One is semicolon for comments. The other two are backquote and comma which are used by the backquote character macro. The backquote macro is used to create lists where many of the elements are fixed (quoted). This makes it very useful for creating macro defini- tions. In the simplest case, a backquote acts just like a single quote: Printed: July 9, 1981 Functions and Macros 8-5 ->`(_a _b _c _d _e) (a b c d e) If a comma precedes an element of a backquoted list then that element is evaluated and its value is put in the list. ->(_s_e_t_q _d '(_x _y _z)) (x y z) ->`(_a _b _c ,_d _e) (a b c (x y z) e) If a comma followed by an at sign precedes an ele- ment in a backquoted list, then that element is evaluated and spliced into the list with _a_p_p_e_n_d. ->`(_a _b _c ,@_d _e) (a b c x y z e) Once a list begins with a backquote, the commas may appear anywhere in the list as this example shows: ->`(_a _b (_c _d ,(_c_d_r _d)) (_e _f (_g _h ,@(_c_d_d_r _d) ,@_d))) (a b (c d (y z)) (e f (g h z x y z))) It is also possible and sometimes even useful to use the backquote macro within itself. As a final demonstration of the backquote macro, we shall define the first and push macros using all the power at our disposal, defmacro and the backquote macro. ->(_d_e_f_m_a_c_r_o _f_i_r_s_t (_l_i_s_t) `(_c_a_r ,_l_i_s_t)) first ->(_d_e_f_m_a_c_r_o _p_u_s_h (_v_a_l_u_e _s_t_a_c_k) `(_s_e_t_q ,_s_t_a_c_k (_c_o_n_s ,_v_a_l_u_e ,_s_t_a_c_k))) stack _8._4. _f_o_r_e_i_g_n _s_u_b_r_o_u_t_i_n_e_s _a_n_d _f_u_n_c_t_i_o_n_s FRANZ LISP has the ability to dynamically load object files produced by other compilers and then call functions defined in those files. These functions are called _f_o_r_e_i_g_n func- tions. There are four types of foreign functions and they are characterized by the type of result they return: subroutine This does not return anything. The lisp system always returns t after calling a subroutine. 9 9 Printed: July 9, 1981 Functions and Macros 8-6 function This returns whatever the function returns. This must be a valid lisp object or it may cause the lisp system to fail. integer-function This returns an integer which the lisp system makes into a fixnum and returns. real-function This returns a double precision real number which the lisp system makes into a flonum and returns. A foreign function is(( accessed through a binary object just like a compiled lisp function. The difference is that the discipline field for a binary object of a foreign function is a string whose first character is s for a subroutine, f for a function, i for an integer-function and r for a real-function. Two func- tions are provided for the setting up of foreign func- tions. _C_f_a_s_l loads an object file into the lisp sys- tem and sets up one foreign function binary object. If there is more than one function in an object file, _g_e_t_a_d_d_r_e_s_s can be used to set up further foreign func- tion objects. Foreign functions are called just like other functions, e.g (_f_u_n_n_a_m_e _a_r_g_1 _a_r_g_2). When one is called, the arguments are evaluated and then examined. List, hunk and symbol arguments are passed unchanged to the foreign function. Fixnum and flonum arguments are copied into a temporary location and a pointer to the value is passed (this is because Fortran uses call by reference and it is dangerous to modify the con- tents of a fixnum or flonum which something else might point to). If an array object is an argument the data field of the array object is passed to the foreign function (this is the easiest way to send large amounts of data to and receive large amounts of data from a foreign function). If a binary object is an argument, the entry field of that object is passed to the foreign function (the entry field is the address of a function, so this amounts to passing a function as an argument). The method a foreign function uses to access the arguments provided by lisp is dependent on the language of the foreign function. The following scripts demonstrate how how lisp can interact with three languages: C, Pascal and Fortran. C and Pascal have pointer types and the first script shows how to use pointers to extract information from lisp objects. There are two functions defined for each language. Printed: July 9, 1981 Functions and Macros 8-7 The first (cfoo is C, pfoo in Pascal) is given four arguments, a fixnum, a flonum-block array, a hunk of at least two fixnums and a list of at least two fix- nums. To demonstrate that the values were passed, each ?foo function prints its arguments (or parts of them). The ?foo function then modifies the second element of the flonum-block array and returns a 3 to lisp. The second function (cmemq in C, pmemq in Pas- cal) acts just like the lisp _m_e_m_q function (except it won't work for fixnums whereas the lisp _m_e_m_q will work for small fixnums). In the script, typed input is in _b_o_l_d, computer output is in roman and comments are in _i_t_a_l_i_c. _T_h_e_s_e _a_r_e _t_h_e _C _c_o_d_e_d _f_u_n_c_t_i_o_n_s % cat ch8auxc.c /* demonstration of c coded foreign integer-function */ /* the following will be used to extract fixnums out of a list of fixnums */ struct listoffixnumscell { struct listoffixnumscell *cdr; int *fixnum; }; struct listcell { struct listcell *cdr; int car; }; cfoo(a,b,c,d) int *a; double b[]; int *c[]; struct listoffixnumscell *d; { printf("a: %d, b[0]: %f, b[1]: %f0, *a, b[0], b[1]); printf(" c (first): %d c (second): %d0, *c[0],*c[1]); printf(" ( %d %d ... ) ", *(d->fixnum), *(d->cdr->fixnum)); b[1] = 3.1415926; return(3); } struct listcell * cmemq(element,list) int element; struct listcell *list; { for( ; list && element != list->car ; list = list->cdr); return(list); } 9 9 Printed: July 9, 1981 Functions and Macros 8-8 _T_h_e_s_e _a_r_e _t_h_e _P_a_s_c_a_l _c_o_d_e_d _f_u_n_c_t_i_o_n_s % cat ch8auxp.p type pinteger = ^integer; realarray = array[0..10] of real; pintarray = array[0..10] of pinteger; listoffixnumscell = record cdr : ^listoffixnumscell; fixnum : pinteger; end; plistcell = ^listcell; listcell = record cdr : plistcell; car : integer; end; function pfoo ( var a : integer ; var b : realarray; var c : pintarray; var d : listoffixnumscell) : integer; begin writeln(' a:',a, ' b[0]:', b[0], ' b[1]:', b[1]); writeln(' c (first):', c[0]^,' c (second):', c[1]^); writeln(' ( ', d.fixnum^, d.cdr^.fixnum^, ' ...) '); b[1] := 3.1415926; pfoo := 3 end ; { the function pmemq looks for the lisp pointer given as the first argument in the list pointed to by the second argument. Note that we declare " a : integer " instead of " var a : integer " since we are interested in the pointer value instead of what it points to (which could be any lisp object) } function pmemq( a : integer; list : plistcell) : plistcell; begin while (list <> nil) and (list^.car <> a) do list := list^.cdr; pmemq := list; end ; _T_h_e _f_i_l_e_s _a_r_e _c_o_m_p_i_l_e_d % cc -c ch8auxc.c 1.0u 1.2s 0:15 14% 30+39k 33+20io 147pf+0w % pc -c ch8auxp.p 3.0u 1.7s 0:37 12% 27+32k 53+32io 143pf+0w % lisp Franz Lisp, Opus 33b _F_i_r_s_t _t_h_e _f_i_l_e_s _a_r_e _l_o_a_d_e_d _a_n_d _w_e _s_e_t _u_p _o_n_e _f_o_r_e_i_g_n _f_u_n_c_t_i_o_n _b_i_n_a_r_y. _W_e _h_a_v_e _t_w_o _f_u_n_c_t_i_o_n_s _i_n _e_a_c_h _f_i_l_e _s_o _w_e _m_u_s_t _c_h_o_o_s_e _o_n_e _t_o _t_e_l_l _c_f_a_s_l _a_b_o_u_t. _T_h_e _c_h_o_i_c_e _i_s _a_r_b_i_t_r_a_r_y. Printed: July 9, 1981 Functions and Macros 8-9 -> (cfasl 'ch8auxc.o '_cfoo 'cfoo "integer-function") /usr/lib/lisp/nld -N -A /usr/local/lisp -T 63000 ch8auxc.o -e _cfoo -o /tmp/Li7055.0 -lc #63000-"integer-function" -> (cfasl 'ch8auxp.o '_pfoo 'pfoo "integer-function" "-lpc") /usr/lib/lisp/nld -N -A /tmp/Li7055.0 -T 63200 ch8auxp.o -e _pfoo -o /tmp/Li7055.1 -lpc -lc #63200-"integer-function" _H_e_r_e _w_e _s_e_t _u_p _t_h_e _o_t_h_e_r _f_o_r_e_i_g_n _f_u_n_c_t_i_o_n _b_i_n_a_r_y _o_b_j_e_c_t_s -> (getaddress '_cmemq 'cmemq "function" '_pmemq 'pmemq "function") #6306c-"function" _W_e _w_a_n_t _t_o _c_r_e_a_t_e _a_n_d _i_n_i_t_i_a_l_i_z_e _a_n _a_r_r_a_y _t_o _p_a_s_s _t_o _t_h_e _c_f_o_o _f_u_n_c_t_i_o_n. _I_n _t_h_i_s _c_a_s_e _w_e _c_r_e_a_t_e _a_n _u_n_n_a_m_e_d _a_r_r_a_y _a_n_d _s_t_o_r_e _i_t _i_n _t_h_e _v_a_l_u_e _c_e_l_l _o_f _t_e_s_t_a_r_r. _W_h_e_n _w_e _c_r_e_a_t_e _a_n _a_r_r_a_y _t_o _p_a_s_s _t_o _t_h_e _P_a_s_c_a_l _p_r_o_g_r_a_m _w_e _w_i_l_l _u_s_e_d _a _n_a_m_e_d _a_r_r_a_y _j_u_s_t _t_o _d_e_m_o_n_s_t_r_a_t_e _t_h_e _d_i_f_- _f_e_r_e_n_t _w_a_y _t_h_a_t _n_a_m_e_d _a_n_d _u_n_n_a_m_e_d _a_r_r_a_y_s _a_r_e _c_r_e_a_t_e_d _a_n_d _a_c_c_e_s_s_e_d. -> (setq testarr (array nil flonum-block 2)) array[2] -> (store (funcall testarr 0) 1.234) 1.234 -> (store (funcall testarr 1) 5.678) 5.678 -> (cfoo 385 testarr (hunk 10 11 13 14) '(15 16 17)) a: 385, b[0]: 1.234000, b[1]: 5.678000 c (first): 10 c (second): 11 ( 15 16 ... ) 3 _N_o_t_e _t_h_a_t _c_f_o_o _h_a_s _r_e_t_u_r_n_e_d _3 _a_s _i_t _s_h_o_u_l_d. _I_t _a_l_s_o _h_a_d _t_h_e _s_i_d_e _e_f_f_e_c_t _o_f _c_h_a_n_g_i_n_g _t_h_e _s_e_c_o_n_d _v_a_l_u_e _o_f _t_h_e _a_r_r_a_y _t_o _3._1_4_1_5_9_2_6 _w_h_i_c_h _c_h_e_c_k _n_e_x_t. -> (funcall testarr 1) 3.1415926 _I_n _p_r_e_p_a_r_a_t_i_o_n _f_o_r _c_a_l_l_i_n_g _p_f_o_o _w_e _c_r_e_a_t_e _a_n _a_r_r_a_y. -> (array test flonum-block 2) array[2] -> (store (test 0) 1.234) 1.234 -> (store (test 1) 5.678) 5.678 -> (pfoo 385 (getd 'test) (hunk 10 11 13 14) '(15 16 17)) a: 385 b[0]: 1.23400000000000E+00 b[1]: 5.67800000000000E+00 c (first): 10 c (second): 11 ( 15 16 ...) 3 -> (test 1) 3.1415926 _N_o_w _t_o _t_e_s_t _o_u_t _t_h_e _m_e_m_q'_s -> (cmemq 'a '(b c a d e f)) (_a _d _e _f) -> (pmemq 'e '(a d f g a x)) Printed: July 9, 1981 Functions and Macros 8-10 _n_i_l The Fortran example will be much shorter since in Fortran you can't follow pointers as you can in other languages. The Fortran function ffo((o is given three arguments: a fixnum, a fixnum-block array and a flo- num. These arguments are printed out to verify that they made it and then the first value of the array is modified. The function returns a double precision value which is converted to a flonum by lisp and printed. Note that the entry point corresponding to the Fortran function ffoo is _ffoo_ as opposed to the C and Pascal convention of preceding the name with an underscore. % cat ch8auxf.f double precision function ffoo(a,b,c) integer a,b(10) double precision c print 2,a,b(1),b(2),c 2 format(' a=',i4,', b(1)=',i5,', b(2)=',i5,' c=',f6.4) b(1) = 22 ffoo = 1.23456 return end % f77 -c ch8auxf.f ch8auxf.f: ffoo: 0.9u 1.8s 0:12 22% 20+22k 54+48io 158pf+0w % lisp Franz Lisp, Opus 33b -> (cfasl 'ch8auxf.o '_ffoo_ 'ffoo "real-function" "-lF77 -lI77") /usr/lib/lisp/nld -N -A /usr/local/lisp -T 63000 ch8auxf.o -e _ffoo_ -o /tmp/Li11066.0 -lF77 -lI77 -lc #6307c-"real-function" -> (array test fixnum-block 2) array[2] -> (store (test 0) 10) 10 -> (store (test 1) 11) 11 -> (ffoo 385 (getd 'test) 5.678) a= 385, b(1)= 10, b(2)= 11 c=5.6780 1.234559893608093 -> (test 0) 22 9 9 Printed: July 9, 1981 al-function" "-lF77 -lI77") /usr/lib/lisp/nld -N -A /usr/local/lisp -T 63000 ch8auxf.o -e _ffoo_ -o /tmp/Li11066.0 -lF77 -lI77 -lc #6307c-"real-function" -> (array test fixnum-block 2) array[2] -> (store (test 0) 10) 10 -> (store (test 1) 11) 11 -> (ffoo 385 (getd 'test) 5.678) a= 385, b(1)= 10, b(2)= 11 c=5.6780 1.234559893608093 -> (test 0) 22 9 9 lib/lisp/manual/ch9.r 664 0 33 26367 2552762111 7734 CHAPTER 9 Arrays Arrays in FRANZ LISP provide a programmable data struc- ture access mechanism. One possible use for FRANZ LISP arrays is to implement Maclisp style arrays which are simple vectors of fixnums, flonums or general lispvalues. This is described in more detail in 9.3 but first we will describe how array references are handled by the lisp system. The structure of an array object is given in 1.3.9 and reproduced here for your convenience. 8_______________________________________________________________ Subpart name Get value Set value Type 8______________________________________________________________________________________________________________________________ access function getaccess putaccess binary, list or symbol 8_______________________________________________________________ auxiliary getaux putaux lispval 8_______________________________________________________________ data arrayref replace block of contiguous set lispval 8_______________________________________________________________ length getlength putlength fixnum 8_______________________________________________________________ delta getdelta putdelta fixnum 8_______________________________________________________________ 7|7|7|7|7|7|7|7|7|7|7|7| |7|7|7|7|7|7|7|7|7|7|7| |7|7|7|7|7|7|7|7|7|7|7| |7|7|7|7|7|7|7|7|7|7|7| |7|7|7|7|7|7|7|7|7|7|7| _9._1. _g_e_n_e_r_a_l _a_r_r_a_y_s Suppose the evaluator is told to evaluate (_f_o_o _a _b) and the function cell of the symbol foo contains an array object (which we will call foo_arr_obj). First the evaluator will evaluate and stack the values of _a and _b. Next it will stack the array object foo_arr_obj. Finally it will call the access function of foo_arr_obj. The access function should be a lexpr[] or a symbol whose function cell contains a lexpr. The access function is responsible for locating and returning a value from the array. The array access function is free to interpret the arguments as it wishes. The Maclisp compatible array ____________________ 9 []A lexpr is a function which accepts any number of argu- ments which are evaluated before the function is called. Arrays 9-1 Arrays 9-2 access function which is provided in the standard FRANZ LISP system interprets the arguments as sub- scripts in the same way as languages like Fortran and Pascal. The array access function will also be called up to store elements in the array. For example, (_s_t_o_r_e (_f_o_o _a _b) _c) will automatically expand to (foo c a b) and when the evaluator is called to evaluate this, it will evaluate the arguments _c, _b and _a. Then it will stack the array object (which is stored in the function cell of foo) and call the array access func- tion with (now) four arguments. The array access function must be able to tell this is a store opera- tion which it can by checking the number of arguments it has been given (a lexpr can do this very easily). _9._2. _s_u_b_p_a_r_t_s _o_f _a_n _a_r_r_a_y _o_b_j_e_c_t When an array is created a raw array object is allocated with _m_a_r_r_a_y and the user is responsible for filling in the parts. Certain lisp functions interpret the values of the subparts of the array object in special ways as described in the following text. Placing illegal values in these subparts may cause the lisp system to fail. _9._2._1. _a_c_c_e_s_s _f_u_n_c_t_i_o_n The function of the access function has been described above. The contents of the access function should be a lexpr, either a binary (compiled function) or a list (interpreted function). It may also be a symbol whose function cell contains a function definition. This subpart is used by _e_v_a_l, _f_u_n_c_a_l_l, and _a_p_p_l_y when evaluating array references. _9._2._2. _a_u_x_i_l_i_a_r_y This can be used for any purpose. If it is a list and the first element of that list is the symbol unmarked_array then the data subpart will not be marked by the garbage collector (this is used in the Maclisp compatible array package and has the potential for causing strange errors if used incorrectly). 9 9 Printed: July 9, 1981 Arrays 9-3 _9._2._3. _d_a_t_a This is either nil or points to a block of data space allocated by _s_e_g_m_e_n_t or _s_m_a_l_l- _s_e_g_m_e_n_t. _9._2._4. _l_e_n_g_t_h This is a fixnum whose value is the number of elements in the data block. This is used by the garbage collector and by _a_r_r_a_y_r_e_f to deter- mine if your index is in bounds. _9._2._5. _d_e_l_t_a This is a fixnum whose value is the number of bytes in each element of the data block. This will be four for an array of fixnums or value cells, and eight for an array of flonums. This is used by the garbage collector and _a_r_r_a_y_r_e_f as well. _9._3. _T_h_e _M_a_c_l_i_s_p _c_o_m_p_a_t_i_b_l_e _a_r_r_a_y _p_a_c_k_a_g_e A Maclisp style array is similar to what are know as arrays in other languages: a block of homogeneous data elements which is indexed by one or more integers called subscripts. The data elements can be all fix- nums, flonums or general lisp objects. An array is created by a call to the function _a_r_r_a_y or *array . The only difference is that *_a_r_r_a_y evaluates its argu- ments. This call: (_a_r_r_a_y _f_o_o _t _3 _5) sets up an array called foo of dimensions 3 by 5. The subscripts are zero based. The first element is (_f_o_o _0 _0), the next is (_f_o_o _0 _1) and so on up to (_f_o_o _2 _4). The t indi- cates a general lisp object array which means each element of foo can be any type. Each element can be any type since all that is stored in the array is a pointer to a lisp object, not the object itself. _A_r_r_a_y does this by allocating an array object with _m_a_r_r_a_y and then allocating a segment of 15 consecutive value cells with _s_m_a_l_l-_s_e_g_m_e_n_t and stor((ing a pointer to that segment in the data subpart of the array object. The length and delta subpart of the array object are filled in (with 15 and 4 respectively) and the access function subpart is set to point to the appropriate array access function. In this case there is a special access function for two dimensional value cell arrays called arrac-twoD, and this access function is used. The auxiliary subpart is set to (t 3 5) which describes the type of array and the Printed: July 9, 1981 Arrays 9-4 bounds of the subscripts. Finally this array object is placed in the function cell of the symbol foo. Now when (_f_o_o _1 _3) is evaluated, the array access function is invoked with three arguments: 1, 3 and the array object. From the auxiliary field of the array object it gets a description of the particular array. It then determines which element (_f_o_o _1 _3) refers to and uses arrayref to extract that element. Since this is an array of value cells, what arrayref returns is a value cell whose value what we want, so we evaluate the value cell and return it as the value of (_f_o_o _1 _3). In Maclisp the call (_a_r_r_a_y _f_o_o _f_i_x_n_u_m _2_5) returns an array whose data object is a block of 25 memory words. When fixnums are stored in this array, the actual numbers are be stored instead of pointers to the numbers as are done in general lisp object arrays. This is efficient under Maclisp but inefficient in FRANZ LISP since every time a value was referenced from an array it had to be copied and a pointer to the copy returned to prevent aliasing[]. Thus t, fixnum and flonum arrays are all implemented in the same manner. This should not affect the compatibility of Maclisp and FRANZ LISP. If there is an application where a block of fixnums or flonums is required, then the exact same effect of fixnum and flonum arrays in Maclisp can be achieved by using fixnum-block and flonum-block arrays. Such arrays are required if you want to pass a large number of arguments to a Fortran or C coded function and then get answers back. The Maclisp compatible array package is just one example of how a general array scheme can be imple- mented. Another type of array you could implement would be hashed arrays. The subscript could be any- thing, not just a number. The access function would hash the subscript and use the result to select an array element. With the generality of arrays also comes extra cost; if you just want a simple vector of (less than 128) general lisp objects you would be wise to look into using hunks. ____________________ 9 []Aliasing is when two variables are share the same storage location. For example if the copying mentioned weren't done then after (_s_e_t_q _x (_f_o_o _2)) was done, the value of x and (foo 2) would share the same location. Then should the value of (foo 2) change, x's value would change as well. This is considered dangerous and as a result pointers are never returned into the data space of arrays. 9 Printed: July 9, 1981 Arrays 9-5 9 9 Printed: July 9, 1981 2)) was done, the value of x and (foo 2) would share the same location. Then should the value of (foo 2) change, x's value would change as well. This is considered dangerous and as a result pointers are never returned into the data space of arrays. 9 lib/lisp/manual/chb.r 664 0 33 15164 2552762113 10000 APPENDIX B Special Symbols The values of these symbols have a predefined meaning. Some values are counters while others are simply flags whose value the user can change to affect the operation of lisp system. In all cases, only the value cell of the symbol is important, the function cell is not. The value of some of the symbols (like ER%misc) are functions - what this means is that the value cell of those symbols either contains a lambda expression, a binary object, or symbol with a func- tion binding. The values of the special symbols are: $gccount$ - The number of garbage collections which have occurred. $gcprint - If bound to a non nil value, then after each garbage collection and subsequent storage allocation a summary of storage allocation will be printed. $ldprint - If bound to a non nil value, then during each _f_a_s_l or _c_f_a_s_l a diagnostic message will be printed. ER%all - The function which is the error handler for all errors (see 10) ER%brk - The function which is the handler for the error signal generated by the evaluation of the _b_r_e_a_k func- tion (see 10). ER%err - The function which is the handler for the error signal generated by the evaluation of the _e_r_r function (see 10). ER%misc - The function which is the handler of the error signal generated by one of the unclassified errors (see 10). Most errors are unclassified at this point. ER%tpl - The function which is the handler to be called when an error has occurred which has not been handled (see 10). ER%undef - The function which is the handler for the error signal generated when a call to an undefined function is made. 9 9 B-1 B-2 ^w - When bound to a non nil value this will prevent output to the standard output port (poport) from reaching the standard output (usually a terminal). Note that ^w is a two character symbol and should not be confused with ^W which is how we would denote control-w. The value of ^w is checked when the standard output buffer is flushed which occurs after a _t_e_r_p_r, _d_r_a_i_n or when the buffer overflows. This is most useful in conjunction with ptport described below. System error handlers rebind ^w to nil when they are invoked to assure that error messages are not lost. (This was introduced for Maclisp compatibility). defmacro-for-compiling - The has an effect during compila- tion. If non-nil it causes macros defined by defmacro to be compiled and included in the object file. environment - The UNIX environment in assoc list form. errlist - When a _r_e_s_e_t is done, the value of errlist is saved away and control is thrown to the top level. _E_v_a_l is then mapped over the saved away value of this list. errport - This port is initially bound to the standard error file. gcdisable - If non nil, then garbage collections will not be done automatically when a collectable data type runs out. ibase - This is the input radix used by the lisp reader. It may be either eight or ten. Numbers followed by a decimal point are assumed to be decimal regardless of what ibase is. linel - The line length used by the pretty printer, pp. This should be used by _p_r_i_n_t but it is not at this time. nil - This symbol represents the null list and thus can be written (). Its value is always nil. Any attempt to change the value will result in an error. piport - Initially bound to the standard input (usually the keyboard). A read with no arguments reads from piport. poport - Initially bound to the standard output (usually the terminal console). A print with no second argument writes to poport. See also: ^w and ptport. prinlength - If this is a positive fixnum, then the _p_r_i_n_t function will print no more than prinlength elements of Printed: July 9, 1981 B-3 a list or hunk and further elements abbreviated as `...'. The initial value of prinlength is nil. prinlevel - If this is a positive fixnum, then the _p_r_i_n_t function will print only prinlevel levels of nested lists or hunks. Lists below this level will be abbre- viated by `&' and hunks below this level will be abbre- viated by a `%'. The initial value of prinlevel is nil. ptport - Initially bound to nil. If bound to a port, then all output sent to the standard output will also be sent to this port as long as this port is not also the standard output (as this would cause a loop). Note that ptport will not get a copy of whatever is sent to poport if poport is not bound to the standard output. readtable - The value of this is the current readtable. It is an array but you should NOT try to change the value of the elements of the array using the array functions. This is because the readtable is an array of bytes and the smallest unit the array functions work with is a full word (4 bytes). You can use _s_e_t_s_y_n_t_a_x to change (( the values and (_s_t_a_t_u_s _s_y_n_t_a_x ...) to read the values. t - This symbol always has the value t. It is possible to change the value of this symbol for short periods of time but you are strongly advised against it. top-level - In a lisp system without /usr/lib/lisp/toplevel.l loaded, after a _r_e_s_e_t is done, the lisp system will _f_u_n_c_a_l_l the value of top-level if it is non nil. This provides a way for the user to introduce his own top level interpreter. When /usr/lib/lisp/toplevel.l is loaded, it sets top-level to franz-top-level and changes the _r_e_s_e_t function so that once franz-top-level starts, it cannot be replaced by changing top-level. Franz-top-level does provide a way of changing the top level however, and that is through user-top-level. user-top-level - If this is bound then after a _r_e_s_e_t, the value of this variable will be _f_u_n_c_a_l_led. 9 9 Printed: July 9, 1981 t sets top-level to franz-top-level and changes the _r_e_s_e_t function so that once franz-top-level starts, it cannot be replaced by changing top-level. Franz-top-level does provide a way of changing the top level however, and that is through user-top-level. user-top-level - If this is bound then after a _r_e_s_e_t, the value of this varialib/lisp/manual/chc.r 664 0 33 12764 2552762114 10005 APPENDIX C Short Subjects. The Garbage Collector The garbage collector is invoked automatically whenever a collectable data type runs out. All data types are col- lectable except strings and atoms are not. After a garbage collection finishes, the collector will call the function _g_c_a_f_t_e_r which should be a lambda of one argument. The argu- ment passed to _g_c_a_f_t_e_r is the name of the data type which ran out and caused the garbage collection. It is _g_c_a_f_t_e_r's responsibility to allocate more pages of free space. The default _g_c_a_f_t_e_r makes its decision based on the percentage of space still in use after the garbage collection. If there is a large percentage of space still in use, _g_c_a_f_t_e_r allocates a larger amount of free space than if only a small percentage of space is still in use. The default _g_c_a_f_t_e_r will also print a summary of the space in use if the vari- able $_g_c_p_r_i_n_t is non nil. The summary always includes the state of the list and fixnum space and will include another type if it caused the garbage collection. The type which caused the garbage collection is preceded by an asterisk. Debugging There are two built-in functions to help you debug your programs: _b_a_k_t_r_a_c_e and _s_h_o_w_s_t_a_c_k. When an error occurs (or when you type the interrupt character), you will be left at a break level with the state of the computation frozen in the stack. At this point, calling the function _s_h_o_w_s_t_a_c_k will cause the contents of the lisp evaluation stack to be printed in reverse chronological order (most recent first). When the programs you are running are interpreted or traced, the output of _s_h_o_w_s_t_a_c_k can be very verbose. The function _b_a_k_t_r_a_c_e prints a summary of what _s_h_o_w_s_t_a_c_k prints. That is, if showstack would print a list, _b_a_k_t_r_a_c_e would only print the first element of the list. If you are running compiled code with the (_s_t_a_t_u_s _t_r_a_n_s_l_i_n_k) non nil, then fast links are being made. In this case, there is not enough information on the stack for _s_h_o_w_s_t_a_c_k and _b_a_k_t_r_a_c_e. Thus, if you are debugging compiled code you should probably do (_s_s_t_a_t_u_s _t_r_a_n_s_l_i_n_k _n_i_l). 9 9 C-1 C-2 If the contents of the stack don't tell you enough about your problem, the next thing you may want to try is to run your program with certain functions traced. You can direct the trace package to stop program execution when it enters a function, allowing you to examine the contents of variables or call other functions. The trace package is documented in 11. It is also possible to single step the evaluator and to look at stack frames within lisp. The programs which take advantage of these things are in /usr/lib/lisp and are called step and fixit. They are maintained by the people at Carnegie-Mellon (currently Lars Ericson is in charge of the code there). There are documentation files for these pro- grams in /usr/lib/lisp as well. We run compiled lisp almost exclusively at Berkeley. Sites which run a mostly inter- preted code should examine these files. 9 9 Printed: July 9, 1981 C-3 The Interpreter's Top Level The top level interpreter for Franz, named _f_r_a_n_z-_t_o_p- _l_e_v_e_l is defined in /usr/lib/lisp/toplevel.l It is given control when the lisp system starts up because the variable top-level is bound to the symbol _f_r_a_n_z-_t_o_p-_l_e_v_e_l. The first action _f_r_a_n_z-_t_o_p-_l_e_v_e_l takes is to print out the name of the current version of the lisp system. Then it loads the file .lisprc from the HOME directory of the person invoking the lisp system if that file exists. The .lisprc file allows you to set up your own defaults, read in files, set up auto- loading or anything else you might want to do to personal- ize the lisp system. Next, the top level goes into a prompt-read-eval-print loop. Each time around the loop, before printing the prompt it checks if the variable user- top-level is bound. If so, then the value of user-top-level will be _f_u_n_c_a_l_led. This provides a convenient way for a user to introduce his own top level (Liszt, the lisp com- piler, is an example of a program which uses this). If the user types a ^D (which is the end of file character), and the standard input is not from a keyboard, the lisp system will exit. If the standard input is a keyboard and if the value of (_s_t_a_t_u_s _i_g_n_o_r_e_e_o_f) is nil, the lisp system will also exit. Otherwise the end of file will be ignored. When a _r_e_s_e_t is done the current value of _e_r_r_l_i_s_t is saved away and control is thrown back up to the top level where _e_v_a_l is mapped over the saved value of _e_r_r_l_i_s_t. 9 9 Printed: July 9, 1981 exit. Iflib/lisp/manual/helpindex 664 0 33 10346 2552762114 10762 (*array ch2.r) (aexplode ch2.r) (aexplodec ch2.r) (aexploden ch2.r) (alphalessp ch2.r) (append ch2.r) (append1 ch2.r) (array ch2.r) (arraycall ch2.r) (arraydims ch2.r) (arrayp ch2.r) (arrayref ch2.r) (ascii ch2.r) (assoc ch2.r) (assq ch2.r) (atom ch2.r) (bcdad ch2.r) (bcdp ch2.r) (bigp ch2.r) (c..r ch2.r) (concat ch2.r) (cons ch2.r) (copy ch2.r) (copysymbol ch2.r) (cpy1 ch2.r) (cxr ch2.r) (defprop ch2.r) (delete ch2.r) (delq ch2.r) (dtpr ch2.r) (eq ch2.r) (equal ch2.r) (explode ch2.r) (explodec ch2.r) (exploden ch2.r) (fillarray ch2.r) (gensym ch2.r) (get ch2.r) (get_pname ch2.r) (getaccess ch2.r) (getaddress ch2.r) (getaux ch2.r) (getchar ch2.r) (getcharn ch2.r) (getd ch2.r) (getdelta ch2.r) (getentry ch2.r) (getlength ch2.r) (hunk ch2.r) (hunksize ch2.r) (implode ch2.r) (intern ch2.r) (last ch2.r) (length ch2.r) (list ch2.r) (makhunk ch2.r) (*makhunk ch2.r) (maknam ch2.r) (makunbound ch2.r) (marray ch2.r) (member ch2.r) (memq ch2.r) (nconc ch2.r) (ncons ch2.r) (not ch2.r) (nreconc ch2.r) (nreverse ch2.r) (nthelem ch2.r) (null ch2.r) (plist ch2.r) (ptr ch2.r) (putaccess ch2.r) (putaux ch2.r) (putdelta ch2.r) (putdisc ch2.r) (putlength ch2.r) (putprop ch2.r) (quote ch2.r) (rematom ch2.r) (remob ch2.r) (removeaddress ch2.r) (remprop ch2.r) (replace ch2.r) (reverse ch2.r) (rplaca ch2.r) (rplacd ch2.r) (rplacx ch2.r) (*rplacx ch2.r) (sassoc ch2.r) (sassq ch2.r) (set ch2.r) (setplist ch2.r) (setq ch2.r) (stringp ch2.r) (substring ch2.r) (substringn ch2.r) (symbolp ch2.r) (type ch2.r) (typep ch2.r) (uconcat ch2.r) (valuep ch2.r) (abs ch3.r) (absval ch3.r) (add ch3.r) (add1 ch3.r) (acos ch3.r) (asin ch3.r) (atan ch3.r) (boole ch3.r) (cos ch3.r) (diff ch3.r) (difference ch3.r) (Divide ch3.r) (Emuldiv ch3.r) (exp ch3.r) (expt ch3.r) (fact ch3.r) (fix ch3.r) (fixp ch3.r) (float ch3.r) (floatp ch3.r) (greaterp ch3.r) (haipart ch3.r) (haulong ch3.r) (lessp ch3.r) (log ch3.r) (lsh ch3.r) (max ch3.r) (min ch3.r) (minus ch3.r) (minusp ch3.r) (mod ch3.r) (numberp ch3.r) (numbp ch3.r) (onep ch3.r) (plus ch3.r) (plusp ch3.r) (pro((duct ch3.r) (quotient ch3.r) (random ch3.r) (remainder ch3.r) (rot ch3.r) (sin ch3.r) (sqrt ch3.r) (sub1 ch3.r) (sum ch3.r) (times ch3.r) (zerop ch3.r) (1+ ch3.r) (1\(mi ch3.r) (\(pl ch3.r) (\(** ch3.r) (\(mi ch3.r) (/ ch3.r) (< ch3.r) (\(eq ch3.r) (> ch3.r) (and ch4.r) (apply ch4.r) (arg ch4.r) (break ch4.r) (*break ch4.r) (catch ch4.r) (*catch ch4.r) (comment ch4.r) (cond ch4.r) (declare ch4.r) (def ch4.r) (defun ch4.r) (do ch4.r) (do ch4.r) (err ch4.r) (error ch4.r) (errset ch4.r) (eval ch4.r) (eval-when ch4.r) (exec ch4.r) (exece ch4.r) (funcall ch4.r) (function ch4.r) (getdisc ch4.r) (go ch4.r) (map ch4.r) (mapc ch4.r) (mapcan ch4.r) (mapcar ch4.r) (mapcon ch4.r) (maplist ch4.r) (mfunction ch4.r) (oblist ch4.r) (or ch4.r) (prog ch4.r) (prog2 ch4.r) (progn ch4.r) (progv ch4.r) (putd ch4.r) (return ch4.r) (setarg ch4.r) (throw ch4.r) (*throw ch4.r) (cfasl ch5.r) (close ch5.r) (cprintf ch5.r) (drain ch5.r) (fasl ch5.r) (ffasl ch5.r) (flatc ch5.r) (flatsize ch5.r) (fseek ch5.r) (infile ch5.r) (load ch5.r) (makereadtable ch5.r) (nwritn ch5.r) (outfile ch5.r) (patom ch5.r) (pntlen ch5.r) (portp ch5.r) (pp ch5.r) (princ ch5.r) (print ch5.r) (probef ch5.r) (ratom ch5.r) (read ch5.r) (readc ch5.r) (readlist ch5.r) (resetio ch5.r) (setsyntax ch5.r) (terpr ch5.r) (terpri ch5.r) (tyi ch5.r) (tyipeek ch5.r) (tyo ch5.r) (zapline ch5.r) (allocate ch6.r) (argv ch6.r) (baktrace ch6.r) (boundp ch6.r) (chdir ch6.r) (dumplisp ch6.r) (eval-when ch6.r) (exit ch6.r) (fake ch6.r) (gc ch6.r) (gcafter ch6.r) (getenv ch6.r) (hashtabstat ch6.r) (include ch6.r) (includef ch6.r) (maknum ch6.r) (opval ch6.r) (process ch6.r) (ptime ch6.r) (reset ch6.r) (retbrk ch6.r) (segment ch6.r) (shell ch6.r) (showstack ch6.r) (signal ch6.r) (sizeof ch6.r) (small-segment ch6.r) (sstatus ch6.r) (sstatus appendmap ch6.r) (sstatus automatic-reset ch6.r) (sstatus chainatom ch6.r) (sstatus dumpcore ch6.r) (sstatus dumpmode ch6.r) (sstatus feature ch6.r) (sstatus ignoreeof ch6.r) (sstatus nofeature ch6.r) (sstatus translink ch6.r) (sstatus uctolc ch6.r) (status ch6.r) (status ctime ch6.r) (status feature ch6.r) (status features ch6.r) (status isatty ch6.r) (status localtime ch6.r) (status syntax ch6.r) (status undeffunc ch6.r) (status version ch6.r) (syscall ch6.r) (top-level ch6.r) r) (sstatus ch6.r) (sstatus appendmap ch6.r) (sstatus automatic-reset ch6.r) (sstatus chainatom ch6.r) (sstatus dumpcore ch6.r) (sstatus dumpmode ch6.r) (sstatus feature ch6.r) (sstatus ignoreeof ch6.r) (sstatus nofeature ch6.r) (sstatus translink ch6.r) (sstatus uctolc ch6.r) (stalib/lisp/manual/ch14.r 664 0 33 13073 2552762113 10000 CHAPTER 14 The LISP Stepper _1_4._1. _S_i_m_p_l_e _U_s_e _O_f _S_t_e_p_p_i_n_g (step s_arg1...) NOTE: The LISP "stepping" package is intended to give the LISP programmer a facility analogous to the Instruction Step mode of running a machine language program. The user interface is through the function (fexpr) step, which sets switches to put the LISP interpreter in and out of "stepping" mode. The most common _s_t_e_p invocations follow. These invocations are usually typed at the top- level, and will take effect immediately (i.e. the next S-expression typed in will be evaluated in stepping mode). ____________________________________________________ (_s_t_e_p _t) ; Turn on stepping mode. (_s_t_e_p _n_i_l) ; Turn off stepping mode. ____________________________________________________ SIDE EFFECT: In stepping mode, the LISP evaluator will print out each S-exp to be evaluated before evaluation, and the returned value after evaluation, calling itself recur- sively to display the stepped evaluation of each argument, if the S-exp is a func- tion call. In stepping mode, the evalua- tor will wait after displaying each S-exp before evaluation for a command character from the console. 9 9The LISP Stepper 14-1 The LISP Stepper 14-2 ____________________________________________________ _S_T_E_P _C_O_M_M_A_N_D _S_U_M_M_A_R_Y Continue stepping recursively. c Show returned value from this level only, and continue stepping upward. e Only step interpreted code. g Turn off stepping mode. (but continue evaluation without stepping). n Step through evaluations without stopping p Redisplay current form in full (i.e. rebind prinlevel and prinlength to nil) b Get breakpoint q Quit d Call debug ____________________________________________________ _1_4._2. _A_d_v_a_n_c_e_d _F_e_a_t_u_r_e_s _1_4._2._1. _S_e_l_e_c_t_i_v_e_l_y _T_u_r_n_i_n_g _O_n _S_t_e_p_p_i_n_g. If (_s_t_e_p _f_o_o_1 _f_o_o_2 ...) is typed at top level, stepping will not commence immediately, but rather when the evaluator first encounters an S-expression whose car is one of _f_o_o_1, _f_o_o_2, etc. This form will then display at the console, and the evaluator will be in stepping mode waiting for a command character. Normally the stepper intercepts calls to _f_u_n_- _c_a_l_l and _e_v_a_l. When _f_u_n_c_a_l_l is intercepted, the Printed: July 9, 1981 The LISP Stepper 14-3 arguments to the function have already been evaluated but when _e_v_a_l is intercepted, the argu- ments have not been evaluated. To differentiate the two cases, when printing the form in evalua- tion, the stepper preceeded intercepted calls to _f_u_n_c_a_l_l with "f:". Calls to _f_u_n_c_a_l_l are normally caused by compiled lisp code calling other func- tions, whereas calls to _e_v_a_l usually occur when lisp code is interpreted. To step only calls to eval use: (_s_t_e_p _e) _1_4._2._2. _S_t_e_p_p_i_n_g _W_i_t_h _B_r_e_a_k_p_o_i_n_t_s. For the moment, step is turned off inside of error breaks, but not by the break function. Upon exiting the error, step is reenabled. However, executing (_s_t_e_p _n_i_l) inside a error loop will turn off stepping globally, i.e. within the error loop, and after return has be made from the loop. _1_4._3. _O_v_e_r_h_e_a_d _o_f _S_t_e_p_p_i_n_g. If stepping mode has been turned off by (_s_t_e_p _n_i_l), the execution overhead of having the stepping packing in your LISP is identically nil. If one stops stepping by typing "g", every call to eval incurs a small overhead--several machine instructions, corresponding to the compiled code for a simple cond and one function pushdown. Running with (_s_t_e_p _f_o_o_1 _f_o_o_2 ...) can be more expensive, since a member of the car of the current form into the list (_f_o_o_1 _f_o_o_2 ...) is required at each call to eval. 9 9 Printed: July 9, 1981 y typing "g", every call to eval incurs a small overhead--several machine instructions, corresponding to the compiled code for a simple cond and one function pushdown. Running with (_s_t_e_p _f_o_o_1 _f_o_o_2 ...) can be more expensive, since a member of the car of the current form into the list (_f_o_o_1 _f_o_o_2 ...) is required at each call to eval. 9 9 lib/lisp/manual/ch15.r 664 0 33 17773 2552762113 10014 CHAPTER 15 The FIXIT Debugger _1_5._1. _I_n_t_r_o_d_u_c_t_i_o_n FIXIT is a debugging environment for FRANZ LISP users doing program development. This documentation and FIXIT were written by David S. Touretzky of Carnegie-Mellon University for MACLisp, and adapted to FRANZ LISP by Mitch Marcus of Bell Labs. One of FIXIT's goals is to get the program run- ning again as qu((ickly as possible. The user is assisted in making changes to his functions "on the fly", i.e. in the midst of execution, and then compu- tation is resumed. To enter the debugger type (_d_e_b_u_g). The debugger goes into its own read-eval-print loop. Like the top-level, the debugger understands certain special commands. One of these is help, which prints a list of the available commands. The basic idea is that you are somewhere in a stack of calls to eval. The com- mand "bka" is probably the most appropriate for look- ing at the stack. There are commands to move up and down. If you want to know the value of "x" as of some place in the stack, move to that place and type "x" (or (cdr x) or anything else that you might want to evaluate). All evaluation is done as of the current stack position. You can fix the problem by changing the values of variables, editing functions or expres- sions in the stack etc. Then you can continue from the current stack position (or anywhere else) with the "redo" command. Or you can simply return the right answer with the "return" command. When it is not immediately obvious why an error has occurred or how the program got itself into its current state, FIXIT comes to the rescue by providing a powerful debugging loop in which the user can: - examine the stack - evaluate expressions in context - enter stepping mode - restart the computation at any point The FIXIT Debugger 15-1 The FIXIT Debugger 15-2 The result is that program errors can be located and fixed extremely rapidly, and with a minimum of frus- tration. The debugger can only work effectively when extra information is kept about forms in evaluation by the lisp system. Evaluating (*_r_s_e_t _t) tells the lisp sys- tem to maintain this information. If you are debugging compiled code you should also be sure that the com- piled code to compiled code linkage tables are unlinked, i.e do (_s_s_t_a_t_u_s _t_r_a_n_s_l_i_n_k _n_i_l). (debug [ s_msg ]) NOTE: Within a program, you may enter a debug loop directly by putting in a call to _d_e_b_u_g where you would normally put a call to _b_r_e_a_k. Also, within a break loop you may enter FIXIT by typing _d_e_b_u_g. If an argument is given to DEBUG, it is treated as a message to be printed before the debug loop is entered. Thus you can put (_d_e_b_u_g |_j_u_s_t _b_e_f_o_r_e _l_o_o_p|) into a program to indicate what part of the program is being debugged. 9 9 Printed: July 9, 1981 The FIXIT Debugger 15-3 ____________________________________________________ _F_I_X_I_T _C_o_m_m_a_n_d _S_u_m_m_a_r_y TOP go to top of stack (latest expression) BOT go to bottom of stack (first expression) P show current expression (with ellipsis) PP show current expression in full WHERE give current stack position HELP types the abbreviated command summary found in /usr/lisp/doc/fixit.help. H and ? work too. U go up one stack frame U n go up n stack frames U f go up to the next occurrence of function f U n f go up n occurrences of function f UP go up to the next user-written function UP n go up n user-written functions ...the DN and DNFN commands are similar, but go down ...instead of up. OK resume processing; continue after an error or debug loop REDO restart the computation with the current stack frame. The OK command is equivalent to TOP followed by REDO. REDO f restart the computation with the last call to function f. (The stack is searched downward from the current position.) STEP restart the computation at the current stack frame, but first turn on stepping mode. (Assumes Rich stepper is loaded.) RETURN e return from the current position in the computation with the value of expression e. BK.. print a backtrace. There are many backtrace commands, formed by adding suffixes to the BK command. "BK" gives a backtrace showing only user-written functions, and uses ellipsis. The BK command may be suffixed by one or more of the following modifiers: ..F.. show function names instead of expressions ..A.. show all functions/expressions, not just user-written ones ..V.. show variable bindings as well as functions/expressions ..E.. show everything in the expression, i.e. don't use ellipsis ..C.. go no further than the current position on the stack Some of the more useful combinations are BKFV, BKFA, and BKFAV. BK.. n show only n levels of the stack (starting at the top). (BK n counts only user functions; BKA n counts all functions.) BK.. f show stack down to first call of function f BK.. n f show stack down to nth call of function f ____________________________________________________ 9 9 Printed: July 9, 1981 The FIXIT Debugger 15-4 _1_5._2. _I_n_t_e_r_a_c_t_i_o_n _w_i_t_h _t_r_a_c_e FIXIT knows about the standard Franz trace package, and tries to make trac- ing invisible while in the debug loop. However, because of the way _t_r_a_c_e works, it may sometimes be the case that the functions on the stack are really un_i_n_t_e_r_ned atoms that have the same name as a traced function. (This only happens when a function is traced WHEREIN another one.) FIXIT will call atten- tion to _t_r_a_c_e'_s hackery by printing an appropriate tag next to these stack entries. _1_5._3. _I_n_t_e_r_a_c_t_i_o_n _w_i_t_h _s_t_e_p The _s_t_e_p function may be invoked from within FIXIT via the STEP command. FIXIT initially turns off stepping when the debug loop is entered. If you step through a function and get an error, FIXIT will still be invoked normally. At any time during stepping, you may explicitly enter FIXIT via the "D" (debug) command. _1_5._4. _M_u_l_t_i_p_l_e _e_r_r_o_r _l_e_v_e_l_s FIXIT will evaluate arbi- trary LISP expressions in its debug loop. The evalua- tion is not done within an _e_r_r_s_e_t, so, if an error occurrs, another invocation of the debugger can be made. When there are multiple errors on the stack, FIXIT displays a barrier symbol between each level that looks something like <------------UDF-->. The UDF in this case stands for UnDefined Function. Thus, the upper level debug loop was invoked by an undefined function error that occurred while in the lower loop. 9 9 Printed: July 9, 1981 lib/lisp/fix.o 664 0 33 50473 2552754760 6565  ?XWZVUиhԸUP ШjPWWVPUХUXWZV|ԆUиШԸи Ш Ը иШԸиШԸUKи ոШ W:WVfW5WVP'Ш$Ш(W#WVPԆP P и WWVPи PРWWVPjTդGѤ,@fWWVШ0WWVjWWVfWWV1PиԆWWVfWWVո4Ը41yШ,QjPP Q`P1`PԆWfWVШ8WDWVfWOWVPЪЏѦW3WVPV)ЪЏѦWWVPhVиPPݨ<P ~PиWWVPԆ^XQС OP Ш@1rЪЏ8ѦWzWVPV)ЪЏѦWOWVPVfWWVfWWV1ѪȔWиWWVPȘWWVиWXWV`PРиW7WV1dѪȜHժЪии WWVPոиP`TФиWWV1ѪȠ=иP`TФWWVP иP`TФЪ WWV1Ѫ,иW&WV1ѪȤ1ժ9иWWVPWhWVP иPРP1UEPxPP@dgиPPݨ<OPHB :P-ȤЪԆ&PWWVPԆ QС Ը1ѪȨ1иWWVPѸL ѸL#иLPPLLLժиLP`xLP@ ЪPЪժ"fWWVȬWWVPЪPиPиԆWsWV1 ѪȰ1иWWVPѸL ѸL#иLPPLLLժиLP`xLP@ ЪPЪPиPЪԆWWVѸ"fWWVȴWWVЪ1WѪȸ1иW:WVPѸL ѸL#иLP%PLLLժиLP`xLP@ ЪPЪPժ"fW WVȼWWVPЪPЪPиԆWWV1Ѫ1иWxWVPѸL ѸL#иLP[PLLLժиLP`xLP@6 ЪPЪP иPРPиԆWAWVѸ"fWWVȴWWVP1Ѫ`1ЪииWWVPѸL ѸL#иLPPLLLժиLP`xLP@e ЪPЪPոиԆWzWV1'Ѫh1Ъии WWVPѸL ѸL#иLPPLLLժиLP`xLP@ ЪPЪPոиԆWWV1ѪGШWnWVW[WVfWVWV<иPРPxPP@6иPРиW+WV иPРVиPЪPPPUХUVUХХUXWZVUиШjU|ԆUиШԸиLШLԸLUvԆиPРWyWVаЪժP1ЪTФ=UЪU%Ѫ PAѪ P2Ѫ P#Ѫ PѪ PPVPЪPUХUVк1HVиP`TФPxPP@P@P`PPPФP-dSУPxPP@YP@TP`PPPУPPP Ъ WKWVPЪP/QЪPP Q`PЪPPиP`TФPxPP@PxPPPФP5dSУPxPP@PxPPPУPժ  ЏPPPLոL/QЪPPQ`PЪPиPРPP1ժ 1и PРQЪPP[Q`PNи PРPаPРPxPP@PxPPP&и PРPаPРPРWWVP*ѸL ѸL#иLPPLLLиLP`xLP@ иP1QЪPPyQ`PlиWWWVPѸL ѸL#иLP:PLLLժиLP`xLP@ ЪPЪjиWWVPѸL ѸL#иLPPLLLժиLP`xLP@ ЪPЪPиP иPРP1и PРиLЏѦWWVPRVи PРPаPРPxPP@/PxPPP'Ъ и PРPаPРPРPvP и PРP~Ъ ии WWVPѸL ѸL#иLPPLLLժиLP`xLP@ ЪPЪPиPРPPиЪЪWWVииPРPvP/fWtWVȴWiWVfWTWV fWEWVQЪPPEQ`P8fWWVиPРWWVWWVPЪPUХХU VUХUXWZ VqUиШjU]Ԇи PР QЪPPJQ`P=к TdSУPxPP@"PxPPPУRТW"WVP2Ъ ЪW(WVѪ WWV+Ѫ "fWWV WWVPѪ иP$Ъ WJWVP ժ иP1VdUХUVMXWZV?UиШjU+Ԇ#UUQЪPP Q`PЏ ЏиPаTФPxPP@PxPPPTfWWVWWVиPаTФWWVWWVиP1PQЪPP1,Q`P1иPаTФSУQ PPQ`PSP`PРЪPWУPxPP@PxPPP9УPРPxPP@"иPаTФSУPРP`PРЪPPP1Ԇժ'xP@PxPPPЪԆzЪPP Ъ ժPCЪTФЪиW0WVPиPW=WVVкVQЪPP4Q`P'иPаTФSУWWVPP1иPаTФSУQ$PP1Q`P1fWWV(WWVиPаTФSУ,ժP#Ъ ЪTФSУPvPSP PкV`PРWWV0WaWV1УPP#fW?WV4W4WV1QЪPPoQ`PbfWWVиPаTФSУWWVP8WWVиPаTФSУWWV[fWWVиPРPP<иPаTФP иPаTФSУSP`PР0PWWVиPаTФSУPxPP@.УУWWVvP@W WVиPUХХUVUХUXWZ VUиШЪUpиЪԆWWVPոPNиPаTФPxPP@4PxPPPФPPjиPФSУPPjиPPUХUXWZVUиШjUոP_иPаTФPxPP@PxPPP#ФSУQЪPPQ`PиPиW'WVPPUХUB9XWZV+UиШjUոPfиPаTФPxPP@PxPPP#ФSУQЪPPQ`PиPиP`TФWWVPUХUXWZjV|DШ$nPWxWVP1кTdSУPxPP@:PxPPP}УRТPPoФWPWVРPPHRкTФW/WVаPРPРQ$PP'Q`PкTФWWVPNjJЪTФPPH;дSУRТQ$PP&Q`PdWЧWWVP1ЪTФPPHдSУRТPxPP@-P@(P`PPPТТW7WVvPsкTФW,WVPWкTФWWVP;кTФWWVPкTФWWVP13\кTdSУPxPP@pPxPPP9УRТQLPP(Q`PФWvWVP11ЪTФPPHдSУRТPP<RP`PаPՠxRP`PаPРPxPP@PxPPP3RP`PаPРЏѦWWVP"VкTФWWVP1ժ1ЪjfPjкTФWWVP1jW|WV&XWZ VUиШjUиQЪPP Q `PPPPP`QЪPP Q`PЪTФPeժP\ЪTФPаPРPxPP@PxPPP!дP`PРPРWWVP ЪTФP PкTUХUF=XWZV/UиШjUииԆW>WVUХUXWZVUиШjUии ԆWWVUХUXWZVUиШjUmииPWWVLUХU>5XWZV'UиШjUии TW3WVUХUXWZVUиШЪXXjXUfWWVWWVXWWV\WWVPPݨ<TPMG ?P-XиPаTdSУWWVPԆ QС PxP@PxPPP`PЪTФPVPWDWVUХХUXWZVUиШjU}||иPаTФ иЪW0WVPժ1 кTdSУRТPРЪ ЪWrWVP1dW@WVкTdSУRТWkWVЪhЪ PlԆPPPкTdSУRТWWVиP1 Ъ кTdSУPvPЪ УWWVPЪWWVP1PиWWVPժ*Ъ кTdSУWWWVP ЪиPаTФЪ ФW(WVP;hЪ PlԆPPPԆԆWWVиPVuUХUg^XWZVиPPݨ<EP>8 0PIЪhjPԆ PPԆWJWVPԆQС РPXWZVUиШjUոPrиPаTФPxPP@4ФSУPxPP@oУPРPxPP@XиP#иWWVPWWV%UХUXWZVUиШjUոP\иPРPP<*иPаTФPxPP@PxPPPиP#иWcWVPWWVUХUsjXWZjV]UиШԸUJи PРиP`TФWkWVPfWWVPиPаTФPxPP@+ФSУPPиP`TФԆWWVPUХUXWZVUиШjU|Ԇи WWV`UU~иQиPP Q `PPPWWV`UUU2Pи WWV`UúU~U PиԆW5WVfWWVպ&xP@ pWWV1պ%xP@ tWWVvxWWVЪWWVЪЏѦWWVPV|WjWVȀWUWVfW@WVиPаTФPxPP@PxPPPиPРPP<P1Џи к TdSУRТЪ и WvWVP "Ѫ#ЪPPȄWWVЪWWVȈW~WVиPаTФSУW`WVȌWMWVfW8WVP VUХUXWZVUjUWWVP3xP@"PРPxPP@ШPPPlUХU^UXWZjVfWWVPԆj ЪؐؐP(jTФPՠФЪPPкjXWZVUjUPUХUXWZVUиШЪUjиPРPP<$иPаTФdSУWcWV1иPРPPH1HȔиPаTФSУԆ)P PȔиPаTдSУԆPPԆPPPиPаTdSУWWVPPW`WVUХUXWZVԆjȘWWVPЪ[PЪTФPPȘdWZWVuPЏ(jWWVvPЪW'WVBjWtWVPQȜPP Q`PjWWV1DPccccccccccccccccc((cpiportdebugrframelistframelistframecmdtevalhook-switch(nil)(nil)(debug)edit;debug\ hush-debugtype\ e\ to\ edit,\ \ to\ debug:\ ER%all(ok):" Huh? - type h for help"cntsymbolbk(u up)ups(d dn)dnstopbotpppwherehelp/usr/lisp/doc/fixit\.ref(? h)(go ok)popstep(t)redoreturneditfuduptop\ of\ stackdnsysdebug-sysmode"sysmode now "xffnsasyspvbindeexprccurrentbogususer\ contains\ an\ invalid\ bk\ modifier\ \ \ <---\ you\ are\ here\ \ <---\ you\ are\ somewhere\ in\ hereprinlengthprinlevel\ \ \ \ <-\ eval\ error(prog lambda)interrupt-handlers<------------handler-labels--><------debug------>\ \ eval\ \ (nil)apply(evalhook* evalhook)(user)(user)var\ =\ ?===tty:you\ are\ at\ top\ of\ stack\.you\ are\ at\ bottom\ of\ stack\.you\ are\ \ frame\ from\ the\ top\.\ frames\ from\ the\ top\.there\ are\ \ \'s\ below\.system-functions\quoteEOF(41 93)evalstepdebug-getframesdebug-scanstkreversedebug-findexprterpriprincdebug-print1draintyiequaldebug-neditdebug-pop%linereadresetprintdebug1getchardebug-bktrace$prprdebug-wheretyfreturnfretrydebug-dnframedebug-findcalldebug-findusrfnfuncalldebug-upframedebug-upfndebug-dnfnpatomterprdebug-showvarexplodecdebug-syspdebug-printconcatdebug-nextframeevalframenreversedebug-insidepeditelengthsyspoblistreadtyipeek(setq SCCS-fix "@(#)fix.l 1.2 7/9/81")(setq fixfns (quote ((*** This is FIXIT written by David Touretzky and adapted to Franz by Don Cohen) (declare (special framelist rframelist interrupt-handlers handler-labels) (special prinlevel prinlength evalhook-switch traced-stuff) (special lastword piport hush-debug) (*fexpr editf step type)) (sstatus feature fixit) (*rset t) ER%tpl fixit debug debug-iter debug1 debug-bktrace debug-print debug-print1 debug-findcall debug-scanflist debug-scanstk debug-getframes debug-nextframe debug-upframe debug-dnframe debug-upfn debug-dnfn debug-showvar debug-nedit debug-insidep debug-findusrfn debug-findexpr debug-pop debug-where debug-sysp interrupt-handlers handler-labels (or (boundp (quote traced-stuff)) (setq traced-stuff nil)) (or (boundp (quote evalhook-switch)) (setq evalhook-switch nil)) (setq hush-debug nil))))((lambda (atomname) (and (boundp (quote %changes)) (setq %changes (cons form %changes)) name) atomname) (quote fixfns))(or (boundp (quote traced-stuff)) (setq traced-stuff nil))(or (boundp (quote evalhook-switch)) (setq evalhook-switch nil))(or (boundp (quote debug-sysmode)) (setq debug-sysmode nil))(setq hush-debug nil)nil(sstatus feature fixit)(*rset t)fixitdebugdebug1debug-bktracedebug-printdebug-print1debug-findcalldebug-scanflistdebug-scanstkdebug-getframesdebug-nextframedebug-upframedebug-dnframedebug-upfndebug-dnfndebug-showvardebug-neditdebug-insidepdebug-findusrfndebug-findexprdebug-popdebug-wheredebug-sysp(setq interrupt-handlers (quote (fixit)))((lambda (atomname) (and (boundp (quote %changes)) (setq %changes (cons form %changes)) name) atomname) (quote interrupt-handlers))(setq handler-labels (quote ((fixit error) (debug-ubv-handler ubv) (debug-udf-handler udf) (debug-fac-handler fac) (debug-ugt-handler ugt) (debug-wta-handler wta) (debug-wna-handler wna) (debug-iol-handler iol) (debug-*rset-handler rst) (debug-mer-handler mer) (debug-gcd-handler gcd) (debug-gcl-handler gcl) (debug-gco-handler gco) (debug-pdl-handler pdl))))((lambda (atomname) (and (boundp (quote %changes)) (setq %changes (cons form %changes)) name) atomname) (quote handler-labels))(or (boundp (quote traced-stuff)) (setq traced-stuff nil))(or (boundp (quote evalhook-switch)) (setq evalhook-switch nil))(setq hush-debug nil)build-syspsysp(or (boundp (quote system-functions\)) (build-sysp))fretry%lineread  $ 9 G T b k }       2 R d u       ! L i p v ~        ( 9 K [ n       4 F R o x        5 Q n    9 m      D Y     & C Z l       6  [  l           #  H n      4 d  x     3  \  |     "  M  r    4 ^         3 < J ^ h     < F T y       3 X  $ I j     . T    = c       $ 7 J ] f t }      . D W z        A W j    ( j     T g     * H _ }      ' 6 I R ` i w       * > _        K Z h q      E      , H d   & Y  x        b! ! ! ! ! ! ! ! ! " " $" 8" M" V" d" m" {" " " " " " " " # # # !# /# S# ]# p# # # # # # # # # # # $ 8$ A$ T$ ]$ k$ $ $ $ $ % ,% <% E% N% k% % % % % $& ?& O& X& a& u& & & & & & & & & & & ' ' ' '' 4' B' V' w' ' ' ' ' ' ' ' ' ( @( a( r( {( ( ( ( ( ( ( ) ,) ;) I) R) `) t) ) ) )! ) )! * * )* <* T* g* |* * * * * * + V+ s+" + + + + + + , , , ', >, N, c, {, , , , , , - - '- /- =- F- T- i- - - - - . . . ". ?. T. ]. k. t. . . . . . / 2/  %g,8>FR]tdmx8yem !"i""#Y$&0''(N),,,%B-,p.3A/<hH1S/[ ?cF00007linker_bnp_qconstrantbF00013_qpushframe_errp_retval_lispretval_typetableF00055_tynames_qoneminusF00187F00272F00285F00332F00342F00350F00358F00377F00392F00394F00396F00398F00400F00406F00421F00425F00431F00437F00446_qnewint_qoneplusF00468F00474F00481F00483F00488bind_orglinker_sizetrans_sizelit_orglit_endN),,,%B-,p.3A/<hH1S/[ ?cF00007linker_bnp_qconstrantbF00lib/lisp/as 755 0 33 124000 2527227460 6144 &((^Юn PPՀPpPP؏5PH1)E,/ ڡPסϡPԠܡեá﹡ﻡx ﴡPdPP里數1z11iPb[Q @a1XPx PPdLݏ>Px PPdPPƪP ~ƋPݏ<>-#Px PPdQdx PlP A`ݏx ǠPdPPSP ~SP1 1[[1P1 1Dݏr{,Z٩kj[Ԫ Ԫ Zﻩ1sﶩDݏ4,Zpkj[Dݏ,hZ`kj[k[$C1tk9[0s1!1k[N1k[:12kPPP[11A;PxPPtPPﰨ3k~[PPPP2kPPP[|8kv[,POEEn_nn-EE161稜6|PР{mPj^][NFPР=C1[I1ݏ>PЭԭѭ!PЭЭ֭ԝPԠ͝PP[ ﺝ1ﵝx ﮝPdPPPP[Ty=ݏk P ~ Pݏ)j4 =ݏP ~Pݏ9)[PP1X[P ^1>1Ь[ЬZ ﭜP︠PPX[XPPZXQQQP#k[mPP[[ZݏS(3[ZPPP#[ZPPPkZP[PP[ խ"׭^1XЬ[ЬZЬ YYY&ﻉЬ'ЬԦѦ 1PPPPЭ[ZZ|ݏݏ~PխPPPZZ<jz ZZ$ЭP^1Y1 PPVPPފXX(PXXX 1רּP'0wPP~VPPfPPPV$fV[V1UP2@K[[P1gX1|PXX1kҐ*1ԭ*    ֭ 1!)PXX1/PPPխ!Э[1xA[[1{21P@_꘭P@K]ԭ蘭P@: PQQP0PP萈٘P@ꑭ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^PЭQA`YY 1}Y! z\1oPPl\1aЫZPʏPP PPD\19jY1-/\j j\j j[1kY_ЬP@Q]PЭQA`Yӏ@YYʏYЫZPʏPP! jj?ժ YY1YPaPʏPP ժ ˏjPPjYPPPQ[3H[*?[!6[.[PPqqqqt֭[1;Z*C5[[[PРQ֠aaPݬm[x!ԭѭ 1kYЫZYXZBF4[$,[Pȏ@PСR֡PbPȏ@PPZ!YYYYP1+P15`1-p1%1ЬP@s[PЭQA`YY 5YPPjPPYYY Y ݏr!1Y!CYPPjjYYY Y ݏxYPPjԭ1P@EPPQPQQP@EPP1TPʏPP 'P@EPQPQQP@E1j1ԭj j j j 1kY^ЬP@ZPЭQA`Yӏ@YYʏYPʏPP$ jj?ժY Yj^Yѭѭ5PʏPP% ժˏjPPj xjPPPHW"@6XXXPРQ֠aaP~dXoѭ ݭZw֭[1^1@(#)aspseudo.c 4.3 8/16/80hooouo{oooooooo o o ooo o ooooooopp pp*p*p*p* p*#p*&p*)p*,p*/p *2p *6p *:p *>p *Bp*Fp*Jp *Mp *Pp*Sp*VpZp^pcpipnptpyppppppppppppppppppp!po !pO !p !p= !pX ppp` qa  q@ qA q q !q  @ @'q! @ @ @-q 3q 9q >q  Eq  Lqx Qq @ @Vqy [q  _q  dq  jq  oq  sq  xq  }q  q q q q q q q q qqq q q q q qqq q q q q rr  r r r r  r &r +r 1r 6r sN Ds @Js Ps6 @Vs& @@ @\s$ @@ @bs @ @hsk osK vs  @ @|s3 sm sM s2 ssssssf sg sF sG s s s' @ @ @s s s8 @@@s{ st  sT  sz t t  t t ttt#t(t  .t@@5t :t@>t@BtIt: @Nt9 @ @Ut[t at gt ltrtr xtR ~t t t@t~EtDtBt~Ct>Att( @@t, @ @tp tP t t4 @@tt} t. @@ @t/ @@ @t ttt< u  uuud ue #uD )uE /u 5u ;u% @ @ @@u Fu LuPuu @VuU @\u au  @hu  @ou@vuE}uDuBuCu?Au u uu@uu uu u* @@u; @u u u+ @@uuub uc uB uC v  v v" @ @v# @ @ @v #v )v0v5vs :vS ?v Dv Iv(MvSvYv _v ev kv qvvv{v.space.fill.byte.word.long.int.quad.data.globl.set.text.comm.lcomm.lsym.align.float.double.org.stab.stabs.stabn.stabd.ascii.asciz.file.line.ABORTr0r1r2r3r4r5r6r7r8r9r10r11r12r13r14r15apfpsppcjccjcsjeqljeqlujgeqjgequjgtrjgtrujleqjlequjlssjlssujneqjnequjvcjvsjbrjbcjbsjbccjbscjbcsjbssjlbcjlbsacbbacbdacbfacblacbwadawiaddb2addb3addd2addd3addf2addf3addl2addl3addp4addp6addw2addw3adwcaobleqaoblssashlashpashqbbcbbccbbccibbcsbbsbbscbbssbbssibccbcsbeqlbeqlubgeqbgequbgtrbgtrubicb2bicb3bicl2bicl3bicpswbicw2bicw3bisb2bisb3bisl2bisl3bispswbisw2bisw3bitbbitlbitwblbsblbcbleqblequblssblssubneqbnequbptbrbbrwbsbbbsbwbvcbvscallgcallscasebcaselcasewchmechmkchmschmuclrbclrdclrfclrlclrqclrwcmpbcmpc3cmpc5cmpdcmpfcmplcmpp3cmpp4cmpvcmpwcmpzvcrccvtbdcvtbfcvtblcvtbwcvtdbcvtdfcvtdlcvtdwcvtfbcvtfdcvtflcvtfwcvtlbcvtldcvtlfcvtlpcvtlwcvtplcvttpcvtptcvtpscvtrdlcvtrflcvtspcvtwbcvtwdcvtwfcvtwldecbdecldecwdivb2divb3divd2divd3divf2divf3divl2divl3divpdivw2divw3editpcedivemoddemodfemulextvextzvffcffshaltincbinclincwindexinsqueinsvjmpjsbldpctxloccmatchcmcombmcomlmcomwmfprmnegbmnegdmnegfmneglmnegwmovabmovadmovafmovalmovaqmovawmovbmovc3movc5movdmovfmovlmovpmovpslmovqmovtcmovtucmovwmovzblmovzbwmovzwlmtprmulb2mulb3muld2muld3mulf2mulf3mull2mull3mulpmulw2mulw3noppolydpolyfpoprproberprobewpushabpushadpushafpushalpushaqpushawpushlpushrreiremqueretrotlrsbsbwcscancskpcsobgeqsobgtrspancsubb2subb3subd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Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R^tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[ PPYYX1XX߭ ~JPYj4~P 22 BЫZ֫ZPѫPѬ ZPPXPZ ~PYZkn 1mЫZ3[1xݏPZZ  YYX ZYYXZYZ ~yPY2kZXY 1ЬPЬ[ PʏPP@ЫZ:ZY3Z P2PPkYZ ~PY PP[ [[[ Ь[Z < 7[gPZ ~9PZ ݫo ԫ kZP}|P^߭ݬ`PPPL<Ь[ЬZ[Y[YPݬݏ tݬݬݏtݬ6 PЬPЬRRQ{RPRPPPRRPh@.Z@R@L@O@=@@@~*PY)@[.@k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ? [P?YPƏPxP?bPZx?PZPPZx?~@PZZZ}?v?PZPi?xj?PZPPjjS?G?1xYP[P4?Z-?%?(?k??k[P Ь[[ZZZ>jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPY>@j~\S^\_eP\CЬGPЬPЬRRQ{RPPR PRPPPi-P@(#)asscan.c 4.6 9/8/8003544444444524454444444444444444445H9:,1F8-L+DI=6A7777777777CB;4<4466666666666666666666666666J4K@6>666666666666666666666666664E4G4@@     ,@, @  *@* H 2Unexpected end of file writing the interpass tmp fileToo many expressions; try simplyfingToo many expressions; try simplyfingToo many expressions; try simplyfingUnexpected end of file writing the interpass tmp fileUnexpected end of file while reading the interpass tmp fileInternal error: bad skip constructionNew line embedded in a string constant.Illegal character mapped: %d, char read:(octal) %o@(#)asparse.c 4.7 8/20/80Local labels are 0-9L%d%dName expected for a labelNAME expected"%s" is not followed by a ':' for a label definition%s redefined%s redefined: PHASE ERROR, 1st: %d, 2nd: %dUnrecognized instruction or directiveSTRING expectedNAME expectedCM expectedIllegal set?NAME expectedCM expectedIllegal lsymNAME expectedillegal location counterCOLON expectedWidth not absoluteExpression crosses field boundaryIllegal relocation in fieldSpace size not absoluteFill repetition count not absoluteCM expectedFill size not absoluteFill count not in in 1..8CM expectedFill value not absoluteIllegal expression to set originBackwards 'org'.stab directive not supported in; report this compiler bug to system administratorInvalid type in %sCM expectedCM expectedCM expected.stabdInvalid type in .stabdCM expectedCM expected.stabn.stabsSTRING expectedCM expectedNAME expectedCM expectedcomm size not absoluteRedefinition of %sexpression expectedLP expectedregister expectedRP expectedregister expectedexpression, '(' or '$' expectedregister expectedRP expectedregister expectedRP expectedregister expectedRB expectedCM expectedMore than 6 argumentsfloating number expectedIllegal registerAssembler: "%s", line %d: Assembler: "%s", line %d: WARNING: @(#)asexpr.c 4.2 8/15/80Divide checkDivide check (modulo)Internal error: unknown operatorRelocation errorright parenthesis expectedBad expression syntaxReference to undefined local label %dbL%d%d@(#)asmain.c 4.8 8/20/80Caution: absolute origins. Unknown flag: %c-d[124] only-o what???-t what???/asXXXXXXwBad pass 1 temporary file for writing %srCan't open source file %s Reference to undefined local label %dfwCannot create %srBad pass 2 temporary file for reading %sReposition for header rewrite failsRewrite of header failsAssembler panic: bad internal data structure.a.out/tmp/@(#)assyms.c 4.6 11/5/80Ran out of MemoryINTERNAL ERROR: overfilled symbol table indirection tableINTERNAL ERROR: installed %d syms, should have installed %dPadding errorUndefined referenceIllegal Relocation of float, double or quad.INTERNAL ERROR: Wrote %d symbols, wanted to write %d symbols @(#)asjxxx.c 4.5 8/20/80jxxx destination not a labelIllegal `align' argument.align %d in any segment is NOT preserved by the loader.align %d converted to .align 2Intersegment jxxx@(#)ascode.c 4.7 11/5/80 @Too few argumentsToo many argumentsarg %d, branch displacement must be an expressionarg %d, addressing a registerarg %d, addressing an immediate operandarg %d, modifying a constantarg %d, PC use((d as indexarg %d, indexing the register filearg %d, indexing a constantarg %d, indexing with modified registerBranch too farBranch too far@(#)asio.c 4.3 8/16/80Output write errorOutput write error/lib/lisp/auxfns0.l 444 0 33 176543 2552754307 7400 (setq SCCS-auxfns0 "@(#)auxfns0.l 1.29 7/9/81") (setsyntax '\; 'splicing 'zapline) ; vi: set lisp : ;---------------- auxfns0 --------------- ; this file contains the definitions of the most common functions. ; It should only be loaded in Opus 30 Franz Lisp. ; These functions should be loaded into every lisp. ; ;------------------------------------------------ ; preliminaries: (eval-when (eval load) (cond ((null (getd 'back=quotify)) (cond ((atom (errset (fasl '/usr/lib/lisp/backquote))) (load 'backquote)))))) (eval-when (compile) (setq macros t)) ;---- Table of Contents. ; ; I. Functions required to be defined right away ; declare append concatl max ; memq ; ; II. Macros ; catch throw defmacro (defmacrosrch,defmcroopption) ; defun desetq let (de-compose) ; let* listify sassoc unwind-protect ; ; III. Interrupt functions ; FPEINT INT ; ; IV. garbage collection functions ; prtpagesused gcafter ; ; V. the functions ; append1 assoc bigp ; comment copy copysymbol cvttomaclisp ; defprop delete delq evenp ; ex (exvi) exec exl explode ; explodec exploden expt ffasl ; filepos fixp ; flatsize floatp getchar getcharn ; getl help hunk ; last include includef ; length macroexpand makhunk member ; min ; nconc nreverse oddp plusp ; prog1 ; reverse shell sload ; sort (sorthelp,exchange2) sortcar (sortcarhelp) ; sublis (sublishelp) subst vi ; vil xcons ; ; VI. array functions ; array [macro] arracfun *array ; arraycall [macro] (ev-arraycall) ; arrcomputeint ; store [macro] (storeintern) arracfcnsimp ; arraydims fillarray ; ; VII. equivalences ; abs add chrct diff ; numbp princ remainder terpri ; typep symeval ; < = > - ; / + - *diff ; \ 1+ 1+$ 1- ; 1-$ * *$ /$ ; +$ -$ ; ;--- Section I - functions which must be declared immediately ;--- declare - ignore whatever is given, this is for the compiler ; (def declare (nlambda (x) nil)) ;--- append - x : list ; - y : list ; (declare (localf append2args)) (def append2args (lambda (x y) (prog (l l*) (cond ((null x) (return y)) ((atom x) (err (list '"Non-list to append:" x)))) (setq l* (setq l (cons (car x) nil))) loop (cond ((atom x) (err (list '"Non-list to append:" x))) ((setq x (cdr x)) (setq l* (cdr (rplacd l* (cons (car x) nil)))) (go loop))) (rplacd l* y) (return l)))) (def append (lexpr (nargs) (cond ((eq nargs 2) (append2args (arg 1) (arg 2))) ((zerop nargs) nil) (t (do ((i (1- nargs) (1- i)) (res (arg nargs))) ((zerop i) res) (setq res (append2args (arg i) res))))))) ;--- concatl - l : list of atoms ; returns the list of atoms concatentated ; (def concatl (lambda (x) (apply 'concat x))) ;--- max - arg1 arg2 ... : sequence of numbe ; returns the maximum ; (def max (lexpr (nargs) (do ((i nargs (1- i)) (max (arg 1))) ((< i 2) max) (cond ((greaterp (arg i) max) (setq max (arg i))))))) ;--- memq - arg : (probably a symbol) ; - lis : list ; returns part of lis beginning with arg if arg is in lis ; (def memq (lambda ($a$ $l$) (do ((ll $l$ (cdr ll))) ((null ll) nil) (cond ((eq $a$ (car ll)) (return ll)))))) ; ---Section II - macros ; ;--- catch form [tag] ; catch is now a macro which translates to (*catch 'tag form) ; (def catch (macro (l) `(*catch ',(caddr l) ,(cadr l)))) ;--- throw form [tag] ; throw isnow a macro ; (def throw (macro (l) `(*throw ',(caddr l) ,(cadr l)))) ; defmacro for franz, written 20sep79 by jkf (declare (special defmacrooptlist protect-list protect-evform)) ;--- defmacro - name - name of macro being defined ; - pattrn - formal arguments plus other fun stuff ; - body - body of the macro ; This is an intellegent macro creator. The pattern may contain ; symbols which are formal paramters, lists which show how the ; actual paramters will appear in the args, and these key words ; &rest name - the rest of the args (or nil if there are no other args) ; is bound to name ; &optional name - bind the next arg to name if it exists, otherwise ; bind it to nil ; &optional (name init) - bind the next arg to name if it exists, otherwise ; bind it to init evaluted. (the evaluation is done left ; to right for optional forms) ; &optional (name init given) - bind the next arg to name and given to t ; if the arg exists, else bind name to the value of ; init and given to nil. ; &aux name ; &aux (name init) ; ; Method of operation: ; the list returned from defmcrosrc has the form ((cxxr name) ...) ; where cxxr is the loc of the macro arg and name is it formal name ; defmcrooptlist has the form ((initv cxxr name) ...) ; which is use for &optional args with an initial value. ; here cxxr looks like cdd..dr which will test of the arg exists. ; ; the variable defmacro-for-compiling determines if the defmacro forms ; will be compiled. If it is t, then we return (progn 'compile (def xx..)) ; to insure that it is compiled ; (declare (special defmacro-for-compiling)) (cond ((null (boundp 'defmacro-for-compiling)) ; insure it has a value (setq defmacro-for-compiling nil))) (def defmacro (macro (args) ((lambda (tmp tmp2 defmacrooptlist body protect-evform protect-list gutz) (setq tmp (defmcrosrch (caddr args) '(d r) nil) body `(def ,(cadr args) (macro (defmacroarg) ((lambda ,(mapcar 'cdr tmp) ,@(mapcar '(lambda (arg) `(cond ((setq ,(caddr arg) (,(cadr arg) defmacroarg)) ,@(cond ((setq tmp2 (cadddr arg)) `((setq ,tmp2 t)))) (setq ,(caddr arg) (car ,(caddr arg)))) (t (setq ,(caddr arg) ,(car arg))))) defmacrooptlist) ,@(cond (protect-evform (setq gutz (eval `((lambda ,(mapcar 'cdr tmp) ,@(cdddr args)) ,@(mapcar '(lambda (x) `',(cdr x)) tmp)))) (ncons `(cond (,protect-evform `((lambda ,',(mapcar 'cdr tmp) ,',gutz) ,,@(mapcar 'cdr tmp))) (t ,@(cdddr args))))) (t (cdddr args)))) ,@(mapcar '(lambda (arg) (cond ((dtpr (car arg)) (caar arg)) ((car arg) `(,(car arg) defmacroarg)))) tmp))))) (cond (defmacro-for-compiling `(progn 'compile ,body)) (t body))) nil nil nil nil nil nil nil))) (def defmcrosrch (lambda (pat form sofar) (cond ((null pat) sofar) ((atom pat) (cons (cons (concatl `(c ,@form)) pat) sofar)) ((eq (car pat) '&rest) (append (defmcrosrch (cadr pat) form nil) (defmcrosrch (cddr pat) form sofar))) ((eq (car pat) '&optional) (defmcrooption (cdr pat) form sofar)) ((eq (car pat) '&protect) (setq protect-list (cond ((atom (cadr pat)) (ncons (cadr pat))) (t (cadr pat))) protect-evform (cons 'or (mapcar '(lambda (x) `(dtpr ,x)) protect-list))) (defmcrosrch (cddr pat) form sofar)) ((eq (car pat) '&aux) (mapcar '(lambda (frm) (cond ((atom frm) `((nil) . ,frm)) (t `((,(cadr frm)) . ,(car frm))))) (cdr pat))) (t (append (defmcrosrch (car pat) (cons 'a form) nil) (defmcrosrch (cdr pat) (cons 'd form) sofar)))))) (def defmcrooption (lambda (pat form sofar) ((lambda (tmp tmp2) (cond ((null pat) sofar) ((eq (car pat) '&rest) (defmcrosrch (cadr pat) form sofar)) (t (cond ((atom (car pat)) (setq tmp (car pat))) (t (setq tmp (caar pat)) (setq defmacrooptlist `((,(cadar pat) ,(concatl `(c ,@form)) ,tmp ,(setq tmp2 (caddar pat))) . ,defmacrooptlist)))) (defmcrooption (cdr pat) (cons 'd form) `( (,(concatl `(ca ,@form)) . ,tmp) ,@(cond (tmp2 `((nil . ,tmp2)))) . ,sofar))))) nil nil))) ;--- defun - standard maclisp function definition form. ; (def defun (macro (l) (prog (name type arglist body specind specnam) (setq name (cadr l) l (cddr l)) (cond ((dtpr name) (cond ((memq (cadr name) '(macro expr fexpr lexpr)) (setq l (cons (cadr name) l) name (car name))) (t (setq specnam (car name) specind (cadr name) name (concat (gensym) "::" specnam)))))) (cond ((null (car l)) (setq type 'lambda)) ((eq 'fexpr (car l)) (setq type 'nlambda l (cdr l))) ((eq 'expr (car l)) (setq type 'lambda l (cdr l))) ((eq 'macro (car l)) (setq type 'macro l (cdr l))) ((atom (car l)) (setq type 'lexpr l `((,(car l)) ,@(cdr l)))) (t (setq type 'lambda(())) (cond ((and (eq 'lambda type) (or (memq '&aux (car l)) (memq '&optional (car l)) (memq '&rest (car l)))) (setq l (lambdacvt l) type (car l) l (cdr l)))) (setq body `(def ,name (,type ,@l))) (cond (specnam (return `(progn 'compile ,body (putprop ',specnam (getd ',name) ',specind)))) (t (return body)))))) ;--- lambdacvt ; converts a lambda expression with &optional, &rest and &aux forms in ; the argument list into a lexpr which will do the desired function. ; method of operation ; the argument list is examined and the following lists are made: ; vbs - list of variables to be lambda bound ; opl - list of optional forms ; vals - list of values to be assigned to the vbs ; (def lambdacvt (lambda (exp) (prog (arg vbs vals opl rest opflg restflg narg narg2 narg3 auxflg avbs) (do ((ll (car exp) (cdr ll)) (count 1 (1+ count))) ((null ll)) (cond ((eq '&rest (car ll)) (setq restflg t opflg nil count (1- count))) ((eq '&optional (car ll)) (setq opflg t count (1- count))) ((eq '&aux (car ll)) (setq auxflg t opflg nil restflg nil count (1- count))) (opflg (cond ((atom (setq arg (car ll))) (setq opl (cons (cons (ncons arg) count) opl) vbs (cons arg vbs) vals (cons nil vals))) ((cddr arg) (setq vbs (cons (car arg) (cons (caddr arg) vbs)) vals (cons nil (cons nil vals)) opl (cons (cons arg count) opl))) (t (setq vbs (cons (car arg) vbs) vals (cons nil vals) opl (cons (cons arg count) opl))))) (restflg (setq vbs (cons (car ll) vbs) vals (cons nil vals) rest (cons (car ll) count))) (auxflg (setq count (1- count)) (cond ((atom (setq arg (car ll))) (setq avbs (cons (ncons arg) avbs))) (t (setq avbs (cons arg avbs))))) (t (setq vbs (cons (car ll) vbs) vals (cons `(arg ,count) vals))))) (setq narg (gensym)) (return `(lexpr (,narg) ((lambda ,(nreverse vbs) ,@(mapcar '(lambda (arg) `(cond ((greaterp ,(cdr arg) ,narg) ,@(cond ((cadar arg) `((setq ,(caar arg) ,(cadar arg)))))) (t (setq ,(caar arg) (arg ,(cdr arg))) ,@(cond ((cddar arg) `((setq ,(caddar arg) t))))))) (nreverse opl)) ,@(cond (rest (setq narg2 (gensym) narg3 (gensym)) `((do ((,narg2 ,narg (1- ,narg2)) (,narg3 nil (cons (arg ,narg2) ,narg3))) ((lessp ,narg2 ,(cdr rest)) (setq ,(car rest) ,narg3)))))) ,@(cond (auxflg `((let* ,(nreverse avbs) ,@(cdr exp)))) (t (cdr exp)))) ,@(nreverse vals))))))) ;--- desetq ; - pattern - pattern containing vrbl names ; - expr - expression to be evaluated ; (defmacro desetq (&rest forms &aux newgen destrs) (do ((xx forms (cddr xx)) (res) (patt) (expr)) ((null xx) (cond ((null (cdr res)) (car res)) (t (cons 'progn (nreverse res))))) (setq patt (car xx) expr (cadr xx)) (setq res (cons (cond ((atom patt) `(setq ,patt ,expr)) ;trivial case (t (setq newgen (gensym) destrs (de-compose patt '(r))) `((lambda (,newgen) ,@(mapcar '(lambda (frm) `(setq ,(cdr frm) (,(car frm) ,newgen))) destrs)) ,expr))) res)))) ; let for franz (with destructuring) ;--- let ; - binds - binding forms ; - . body - forms to execute ; the binding forms may have these forms ; a local variable a, initially nil ; (a x) local variable a, x is evaled and a gets its value initially ; ((a . (b . c)) x) three local variables, a,b and c which are given ; values corresponding to the location in the value ; of x. Any structure is allowed here. ; (defmacro let (binds &rest body &aux vrbls vals destrs newgen) (mapc '(lambda (form) (cond ((atom form) (setq vrbls (cons form vrbls) vals (cons nil vals))) ((atom (car form)) (setq vrbls (cons (car form) vrbls) vals (cons (cadr form) vals))) (t (setq newgen (gensym) destrs `((,newgen ,@(de-compose (car form) '(r))) ,@destrs) vrbls (cons newgen vrbls) vals (cons (cadr form) vals))))) binds) (mapc '(lambda (frm) (do ((ll (cdr frm) (cdr ll))) ((null ll)) (setq vrbls (cons (cdar ll) vrbls) vals (cons nil vals)))) destrs) (setq vals (nreverse vals) vrbls (nreverse vrbls) destrs (nreverse destrs)) `((lambda ,vrbls ,@(mapcan '(lambda (frm) (mapcar '(lambda (vrb) `(setq ,(cdr vrb) (,(car vrb) ,(car frm)))) (cdr frm))) destrs) ,@body) ,@vals)) ;--- de-compose ; form - pattern to de-compose ; sofar - the sequence of cxxr's needed to get to this part ; of the pattern ; de-compose returns a list of this form ; ; ((cxxr . a) (cyyr . b) ... ) ; which tells how to get to the value for a and b ..etc.. ; (def de-compose (lambda (form sofar) (cond ((null form ) nil) ((atom form) (ncons (cons (apply 'concat (cons 'c sofar)) form))) (t (nconc (de-compose (car form) (cons 'a sofar)) (de-compose (cdr form) (cons 'd sofar))))))) ;--- let* ; - binds - binding forms (like let) ; - body - forms to eval (like let) ; this is the same as let, except forms are done in a left to right manner ; in fact, all we do is generate nested lets ; (defmacro let* (binds &rest body) (do ((ll (reverse binds) (cdr ll))) ((null ll) (car body)) (setq body `((let (,(car ll)) ,@body))))) ;--- listify : n - integer ; returns a list of the first n args to the enclosing lexpr if ; n is positive, else returns the last -n args to the lexpr if n is ; negative. ; (def listify (macro (lis) `(let ((n ,(cadr lis))) (cond ((minusp n) (do ((i (arg nil) (1- i)) (result nil (cons (arg i) result))) ((< i (+ (arg nil) n 1)) result) )) (t (do ((i n (1- i)) (result nil (cons (arg i) result))) ((< i 1) result) )))))) ;--- sassoc ; - x : form ; - y : assoc list ; - fcn : function or lambda expression ; If (assoc x y) is non nil, then we apply the function fcn to nil. ; This must be written as a macro if we expect to handle the case of ; a lambda expression as fcn in the compiler. ; (defmacro sassoc (x y fcn) (cond ((or (atom fcn) (not (eq 'quote (car fcn)))) `(or (assoc ,x ,y) (apply ,fcn nil))) (t `(or (assoc ,x ,y) (,(cadr fcn) nil))))) ;--- sassq ; - x : form ; - y : assoc list ; - fcn : function or lambda expression ; like sassoc above except it uses assq instead of assoc. ; (defmacro sassq (x y fcn) (cond ((or (atom fcn) (not (eq 'quote (car fcn)))) `(or (assq ,x ,y) (apply ,fcn nil))) (t `(or (assq ,x ,y) (,(cadr fcn) nil))))) ;--- signp - test - unevaluated atom ; - value - evaluated value ; test can be l, le, e, n, ge or g with the obvious meaning ; we return t if value compares to 0 by test '(def signp (macro (l) `(signphelpfcn ',(cadr l) ,(caddr l)))) (defmacro signp (tst val) (setq tst (cond ((eq 'l tst) `(minusp signp-arg)) ((eq 'le tst) `(not (greaterp signp-arg 0))) ((eq 'e tst) `(zerop signp-arg)) ((eq 'n tst) `(not (zerop signp-arg))) ((eq 'ge tst) `(not (minusp signp-arg))) ((eq 'g tst) `(greaterp signp-arg 0)) (t (error "bad arg to signp " tst)))) (cond ((atom val) `(and (numberp ,val) ,(subst val 'signp-arg tst))) (t `((lambda (signp-arg) (and (numberp signp-arg) ,tst)) ,val)))) ;-- signphelpfcn ; not needed for new code anymore (def signphelpfcn (lambda (tst val) (cond ((eq 'l tst) (minusp val)) ((eq 'le tst) (or (zerop val) (minusp val))) ((eq 'e tst) (zerop val)) ((eq 'n tst) (not (zerop val))) ((eq 'ge tst) (not (minusp val))) ((eq 'g tst) (greaterp val 0))))) ;--- unwind-protect ; The form of a call to unwind-protect is ; (unwind-protect pform ; form1 form2 ...) ; and it works as follows: ; pform is evaluated, if nothing unusual happens, form1 form2 etc are ; then evaluated and unwind-protect returns the value of pform. ; if while evaluating pform, a throw or error caught by an errset which ; would cause control to pass through the unwind-protect, then ; form1 form2 etc are evaluated and then the error or throw continues. ; Thus, no matter what happens, form1, form2 etc will be evaluated. ; (defmacro unwind-protect (protected &rest conseq &aux (localv (gensym 'G))) `((lambda (,localv) (setq ,localv (*catch 'ER%unwind-protect ,protected)) ,@conseq (cond ((and (dtpr ,localv) (eq 'ER%unwind-protect (car ,localv))) (I-throw-err (cdr ,localv))) (t ,localv))) nil)) ;----Section III -- Interrupt handlers ; (def FPEINT (lambda (x$) (error "Floating Exception "))) (def INT (lambda (dummy) (patom '"Interrupt: ") (drain) (break))) (signal 8 'FPEINT) (signal 2 'INT) ;---- Section IV - interrupt handlers ; (cond ((null (boundp '$gcprint)) (setq $gcprint nil))) ; dont print gc stats by default (cond ((null (boundp '$gccount$)) (setq $gccount$ 0))) ;--- prtpagesused - [arg] : type of page allocated last time. ; prints a summary of pages used for certain selected types ; of pages. If arg is given we put a star beside that type ; of page. This is normally called after a gc. ; (def prtpagesused (lambda (space tottime gctime) (patom "[") (do ((curtypl (cond ((memq space '(list fixnum )) '(list fixnum)) (t (cons space '(list fixnum)))) (cdr curtypl)) (temp)) ((null curtypl) (print 'ut:) (print (max 0 (quotient (times 100 (diff tottime gctime)) tottime))) (patom "%]") (terpr)) (setq temp (car curtypl)) (cond ((greaterp (cadr (opval temp)) 0) (cond ((eq space temp) (patom '*))) (patom temp) (patom '":") (print (cadr (opval temp))) (patom '"{") (print (fix (quotient (times 100.0 (( (car (opval temp))) (* (cadr (opval temp)) (caddr (opval temp)))))) (patom '"%}") (patom '"; ")))))) (declare (special gcafter-panic-mode $gccount$ $gc_midlim $gc_minalloc $gc_pct $gc_lowlim $gcprint ptimeatlastgc)) (setq gcafter-panic-mode nil) (setq $gc_minalloc 10) (setq $gc_lowlim 60) (setq $gc_midlim 85) (setq $gc_pct .10) (setq ptimeatlastgc (ptime)) ;--- gcafter - [s] : type of item which ran out forcing garbage collection. ; This is called after each gc. ; the form of an opval element is (number_of_items_in_use ; number_of_pages_allocated ; number_of_items_per_page) ; ; (def gcafter (nlambda (s) (prog (x pct amt-to-allocate thisptime diffptime difftottime diffgctime) (cond ((null s) (return))) (cond ((null (boundp '$gccount$)) (setq $gccount$ 0))) (setq $gccount$ (1+ $gccount$)) (setq x (opval (car s))) (setq thisptime (ptime) difftottime (max (diff (car thisptime) (car ptimeatlastgc)) 1) diffgctime (diff (cadr thisptime) (cadr ptimeatlastgc)) ptimeatlastgc thisptime) ; pct is the percentage of space used (setq pct (quotient (times 100 (car x)) (max 1 (times (cadr x) (caddr x))))) (setq amt-to-allocate (cond (gcafter-panic-mode (cond ((greaterp pct 95) (patom "[Storage space totally exausted]") (terpr) (error "Space exausted when allocating " (car s))) (t 0))) ((greaterp pct $gc_midlim) (max $gc_minalloc (fix (times $gc_pct (cadr x))))) ((greaterp pct $gc_lowlim) $gc_minalloc) ((lessp (cadr x) 100) $gc_minalloc) (t 0))) (cond ((and (null gcafter-panic-mode) (greaterp amt-to-allocate 0)) (cond ((atom (errset (allocate (car s) amt-to-allocate))) (cond ($gcprint (patom "[Now in storage allocation panic mode]") (terpr))) (setq gcafter-panic-mode t))))) (cond ($gcprint (prtpagesused (car s) difftottime diffgctime) (comment (cond ((and (getd 'gcstat) (eq $gcprint '$all)) (print (gcstat)) (terpr))))))))) ;----Section V - the functions ; ;--- append - x : list ; - y : list ; [ must appear at the beginning to allow backquote to work ] ;--- append1 - x : list ; - y : lispval ; puts y at the end of list x ; (def append1 (lambda (x y) (append x (list y)))) ;--- assoc - x : lispval ; - l : list ; l is a list of lists. The list is examined and the first ; sublist whose car equals x is returned. ; (def assoc (lambda (val alist) (do ((al alist (cdr al))) ((null al) nil) (cond ((null (car al))) ((not (dtpr (car al))) (error "bad arg to assoc" al)) ((equal val (caar al)) (return (car al))))))) ;--- bigp - x : lispval ; returns t if x is a bignum ; (def bigp (lambda (arg) (equal (type arg) 'bignum))) ;--- comment - any ; ignores the rest of the things in the list (def comment (nlambda (x) 'comment)) ;--- concatl - l : list of atoms ; returns the list of atoms concatentated ; [ must appear at top to allow defmacro to work ] ;--- copy - l : list (will work if atom but will have no effect) ; makes a copy of the list. ; FIX THIS UP TO REMOVE RECURSION ON TAIL ; (def copy (lambda (l) (cond ((atom l) l) (t (cons (copy (car l)) (copy (cdr l))))))) ;--- copysymbol - sym : symbol to copy ; - flag : t or nil ; generates an uninterned symbol with the same name as sym. If flag is t ; then the value, function binding and property list of sym are placed ; in the uninterned symbol. ; (def copysymbol (lambda (sym flag) ((lambda (newsym) (cond (flag (cond ((boundp sym) (set newsym (eval sym)))) (putd newsym (getd sym)) (setplist newsym (plist sym)))) newsym) (uconcat sym)))) ;--- cvttointlisp -- convert reader syntax to conform to interlisp ; (def cvttointlisp (lambda nil (setsyntax '\% 143.) ; escape character (setsyntax '\\ 2.) ; normal character (setsyntax '\` 2.) ; normal character (setsyntax '\, 2.) ; normal character (sstatus uctolc t) ; one case )) ;--- cvttomaclisp - converts the readtable to a maclisp character syntax ; (def cvttomaclisp (lambda nil (setsyntax '\| 138.) ; double quoting char (setsyntax '\/ 143.) ; escape (setsyntax '\\ 2) ; normal char ; not needed in new lisp (setsyntax '\" 2) ; normal char (setsyntax '\[ 2) ; normal char (setsyntax '\] 2) ; normal char (sstatus uctolc t))) ;--- cvttoucilisp - converts the readtable to a ucilisp character syntax ; (def cvttoucilisp (lambda nil (sstatus uctolc t) ; upper case to lower case ; change backquote character. ; to ` and ! and !@ from ` , and ,@ ; undo comma. (cond ((eq (status syntax \,) 205) (setsyntax '\! 'splicing (get '\, 'macro)))) (setsyntax '\, 2) ; ; ~ as comment character, not ; and / instead of \ for escape (setsyntax '\~ 'splicing 'zapline) (setsyntax '\; 2) (setsyntax '\/ 143) (setsyntax '\\ 2))) ;--- defprop - like putprop except args are not evaled ; (def defprop (nlambda (argl) (putprop (car argl) (cadr argl) (caddr argl) ))) ;--- delete ; - val - lispval ; - lst - list ; - n - Optional arg, number of occurances to delete ; removes up to n occurances of val from the top level of lst. ; if n is not given, all occurances will be removed. ; (def delete (lexpr (nargs) (prog (val lst cur ret nmb) (cond ((< nargs 2) (error " too few args to delete " nargs)) ((= nargs 3) (setq nmb (arg 3)) (cond ((not (greaterp nmb 0)) (return (arg 2)))))) (setq val (arg 1) lst (arg 2)) (cond ((and (atom lst) (not (null lst))) (error " non list arg to delete " lst))) (setq cur (cons nil lst) ret cur) loop (cond ((null lst) (return (cdr ret))) ((equal val (car lst)) (rplacd cur (cdr lst)) (cond ((and nmb (zerop (setq nmb (1- nmb)))) (return (cdr ret))))) (t (setq cur (cdr cur)))) (setq lst (cdr lst)) (go loop)))) ;--- delq ; same as delete except eq is used for testing. ; (def delq (lexpr (nargs) (prog (val lst cur ret nmb) (cond ((< nargs 2) (error " too few args to delete " nargs)) ((= nargs 3) (setq nmb (arg 3)) (cond ((not (greaterp nmb 0)) (return (arg 2)))))) (setq val (arg 1) lst (arg 2)) (cond ((and (atom lst) (not (null lst))) (error " non list arg to delete " lst))) (setq cur (cons nil lst) ret cur) loop (cond ((null lst) (return (cdr ret))) ((eq val (car lst)) (rplacd cur (cdr lst)) (cond ((and nmb (zerop (setq nmb (1- nmb)))) (return (cdr ret))))) (t (setq cur (cdr cur)))) (setq lst (cdr lst)) (go loop)))) ;--- delete - val - s-expression ; - list - list to delete fromm ; -[n] optional count , if not specified, it is infinity ; delete removes every thing in the top level of list which equals val ; the list structure is modified ; ;(def delete ; (lexpr (nargs) ; ((lambda (val list n) ; (cond ((or (null list) (zerop n)) list) ; ((atom list) (error "Bad arg to delete " list)) ; ((equal val (car list)) ; (delete val (cdr list) (1- n))) ; (t (rplacd list (delete val (cdr list) n))))) ; (arg 1) ; (arg 2) ; (cond ((equal nargs 3) (arg 3)) ; (t 99999999))))) ; ; ;--- delq - val - s-expression ; - list - list to delete fromm ; -[n] optional count , if not specified, it is infinity ; delq removes every thing in the top level of list which eq's val ; the list structure is modified ; ;(def delq ; (lexpr (nargs) ; ((lambda (val list n) ; (cond ((or (atom list) (zerop n)) list) ; ((eq val (car list)) ; (delq val (cdr list) (1- n))) ; (t (rplacd list (delq val (cdr list) n))))) ; (arg 1) ; (arg 2) ; (cond ((equal nargs 3) (arg 3)) ; (t -1))))) ; ;--- evenp : num - return ; ; (def evenp (lambda (n) (cond ((not (zerop (boole 4 1 n))) t)))) ;--- ex [name] : unevaluated name of file to edit. ; the ex editor is forked to edit the given file, if no ; name is given the previous name is used ; (def ex (nlambda (x) (exvi 'ex x nil))) (declare (special edit_file)) (def exvi (lambda (cmd x doload) (prog (handy handyport bigname) (cond ((null x) (setq x (list edit_file))) (t (setq edit_file (car x)))) (setq bigname (concat (car x) '".l")) (cond ((setq handyport (car (errset (infile bigname) nil))) (close handyport) (setq handy bigname)) (t (setq handy (car x)))) (setq handy (concat cmd '" " handy)) (setq handy (list 'process handy)) (eval handy) (cond (doload (load edit_file)))))) ;--- exec - arg1 [arg2 [arg3 ...] ] unevaluated atoms ; A string of all the args concatenated together seperated by ; blanks is forked as a process. ; (def exec (nlambda ($list) (prog ($handy) (setq $handy (quote "")) loop (cond ((null $list) (return (eval (list (quote process) $handy)))) (t (setq $handy (concat (concat $handy (car $list)) (quote " "))) (setq $list (cdr $list)) (go loop)))))) ;--- exl - [name] : unevaluated name of file to edit and load. ; If name is not given the last file edited will be used. ; After the file is edited it will be `load'ed into lisp. ; (def exl (nlambda (x) (exvi 'ex x t))) ;----- explode functions ------- ; These functions, explode , explodec and exploden, implement the ; maclisp explode functions completely. ; They have a similar structure and are written with efficiency, not ; beauty in mind (and as a result they are quite ugly) ; The basic idea in all of them is to keep a pointer to the last ; thing added to the list, and rplacd the last cons cell of it each time. ; ;--- explode - arg : lispval ; explode returns a list of characters which print would use to ; print out arg. Slashification is included. ; (def explode (lambda (arg) (cond ((atom arg) (aexpl((ode arg)) (t (do ((ll (cdr arg) (cdr ll)) (sofar (setq arg (cons '"(" (explode (car arg))))) (xx)) ((cond ((null ll) (rplacd (last sofar) (ncons '")" )) t) ((atom ll) (rplacd (last sofar) `(" " "." " " ,@(explode ll) ,@(ncons '")"))) t)) arg) (setq xx (last sofar) sofar (cons '" " (explode (car ll)))) (rplacd xx sofar)))))) ;--- explodec - arg : lispval ; returns the list of character which would be use to print arg assuming that ; patom were used to print all atoms. ; that is, no slashification would be used. ; (def explodec (lambda (arg) (cond ((atom arg) (aexplodec arg)) (t (do ((ll (cdr arg) (cdr ll)) (sofar (setq arg (cons '"(" (explodec (car arg))))) (xx)) ((cond ((null ll) (rplacd (last sofar) (ncons '")" )) t) ((atom ll) (rplacd (last sofar) `(" " "." " " ,@(explodec ll) ,@(ncons '")"))) t)) arg) (setq xx (last sofar) sofar (cons '" " (explodec (car ll)))) (rplacd xx sofar)))))) ;--- exploden - arg : lispval ; returns a list just like explodec, except we return fixnums instead ; of characters. ; (def exploden (lambda (arg) (cond ((atom arg) (aexploden arg)) (t (do ((ll (cdr arg) (cdr ll)) (sofar (setq arg (cons 40. (exploden (car arg))))) (xx)) ((cond ((null ll) (rplacd (last sofar) (ncons 41.)) t) ((atom ll) (rplacd (last sofar) `(32. 46. 32. ,@(exploden ll) ,@(ncons 41.))) t)) arg) (setq xx (last sofar) sofar (cons 32. (exploden (car ll)))) (rplacd xx sofar)))))) ;-- expt - x ; - y ; ; y ; returns x ; (defun expt (x y) (cond ((equal x 1) x) ((zerop x) x) ; Maclisp does this ((lessp y 0) (quotient 1.0 (expt x (times -1 y)))) ((floatp y) (exp (times y (log x)))) ; bomb out for (-3)^4 or (-3)^4.0 or 0^y. (t ; y is integer, y>= 0 (prog (res) (setq res 1) loop (cond ((equal y 0) (return res)) ((oddp y)(setq res (times res x) y (1- y))) (t (setq x (times x x) y (/ y 2)))) (go loop))))) ;--- expt ; old '(defun expt(x y) (prog (res) (setq res 1) loop (cond ((equal y 0) (return res)) (t (setq res (times x res) y (1- y)))) (go loop))) ;--- ffasl :: fasl in a fortran file ; arg # ; 1 - fnam : file name ; 2 - entry : entry point name ; 3 - fcn : entry name ; 4 - disc : optional discipline (defun ffasl (fnam entry fcn &optional (disc 'subroutine)) (cfasl fnam entry fcn disc "-lI77 -lF77 -lm")) ; ; filepos function (maclisp compatibility) ; (defun filepos n (cond ((zerop n) nil) ((onep n) (fseek (arg 1) 0 1)) ((equal n 2) (fseek (arg 1) (arg 2) 0)))) ;--- fixp - l : lispval ; returns t if l is a fixnum or bignum ; (defun fixp (x) (or (equal (type x) 'fixnum) (equal (type x) 'bignum))) ;--- flatsize - l : lispval ; the second arg should be: ; - n : limit for what we care about ; but we dont care about this at present, since we have ; to explode the whole thing anyway. ; returns the number of characters which print would ; use to print l ; (defun flatsize n (length (explode (arg 1)))) ;--- floatp - l : lispval ; returns t if l is a flonum ; (defun floatp (x) (equal 'flonum (type x))) ;--- getchar,getcharn - x : atom ; - n : fixnum ; returns the n'th character of x's pname (the first corresponds to n=1) ; if n is negative then it counts from the end of the pname ; if n is out of bounds, nil is returned (def getchar (lambda (x n) (concat (substring x n 1)))) (def getcharn (lambda (x n) (substringn x n 0))) (def getl (lambda (atm lis) (do ((ll (cond ((atom atm) (plist atm)) (t (cdr atm))) (cddr ll))) ((null ll) nil) (cond ((memq (car ll) lis) (return ll)))))) ;--- help ; retrive selected portions of the Franz Lisp manual. ; There are four types of help offered: ; (help) prints a description of the other three options ; (help tc) prints a table of contents. ; (help n) {where n is a number or b or c} prints the whole chapter. ; (help fcn) prints info on function fcn ; ; An index to the functions is kept in the documentation directory. ; The index has entries like (append ch2.r). ; When asked to print info on a function, it locates the chapter ; using the index then asks more to locate the definition. ; (declare (localf locatefunction)) (defun help fexpr (lis) (cond ((null lis) (patom "type (help fnc) for info on function fnc")(terpr) (patom "type (help n) to see chapter n")(terpr) (patom "type (help tc) for a table of contents")(terpr)) (t (do ((ll lis (cdr ll)) (fcn)) ((null ll)) (cond ((not (atom (setq fcn (car ll)))) (patom "Bad option to help ")(print fcn)(terpr)) ((and (stringp fcn) (setq fcn (concat fcn)) nil)) ((eq fcn 'tc) (patom "Table of contents")(terpr) (patom "1 - intro; 2 - data structure; 3 - arithmetic; 4 - special")(terpr) (patom "5 - i/o; 6 - system; 7 - reader; 8 - functions; 9 - arrays")(terpr) (patom "10 - exceptions; 11 - trace package; 12 - Liszt;")(terpr) (patom "14 - step package; 15 - fixit package") (terpr) (patom "b - special symbols; c - gc & debugging & top level ")(terpr)) ((or (and (numberp fcn) (lessp fcn 16) (greaterp fcn -1)) (memq fcn '(b c))) (apply 'process (ncons (concat "/usr/ucb/ul /usr/lib/lisp/manual/ch" fcn ".r | /usr/ucb/more -f" )))) ((locatefunction fcn)) (t (patom "Unknown function: ")(print fcn)(terpr))))))) (declare (special readtable)) (defun locatefunction (fc) (let (x inf ) (cond ((null (get 'append 'helplocation)) (patom "[Reading help index]")(drain) (setq inf (infile "/usr/lib/lisp/manual/helpindex")) (do ((readtable (makereadtable t)) (x (read inf) (read inf))) ((null x) (close inf) (terpr)) (cond ((null (cddr x)) (putprop (car x) (cadr x) 'helplocation)) (t (putprop (concat (car x) " " (cadr x)) (caddr x) 'helplocation)))))) (cond ((setq x (get fc 'helplocation)) (apply 'process (ncons (concat "/usr/ucb/ul /usr/lib/lisp/manual/" x " | /usr/ucb/more -f \"+/(" fc "\""))) t)))) ; ; (hunk 'g_arg1 [...'g_argn]) ; ; This function makes a hunk. The hunk is preinitialized to the ; arguments present. The size of the hunk is determined by the ; number of arguments present. ; (defun hunk n (prog (size) (setq size -1) (cond ((> n 128) (error "hunk: size is too big" n)) ((eq n 1) (setq size 0)) ((eq n 0) (return nil)) ; hunk of zero length (t (setq size (1- (haulong (1- n)))))) (setq size (*makhunk size)) (do ((argnum 0 (1+ argnum))) ((eq argnum n)) (*rplacx argnum size (arg (1+ argnum)))) (return size))) ;--- last - l : list ; returns the last cons cell of the list, NOT the last element ; (def last (lambda (a) (do ((ll a (cdr ll))) ((null (cdr ll)) ll)))) ;---- load (declare (localf load-a-file)) (declare (special gcdisable)) (defun load (filename &rest fasl-args) (cond ((not (or (symbolp filename) (stringp filename))) (error "load: illegal filename " filename))) (let ( load-only fasl-only no-ext len search-path name pred shortname explf) ; determine the length of the filename, ignoring the possible ; list of directories. set explf to the reversed exploded filename (setq len (do ((xx (setq explf (nreverse (exploden filename))) (cdr xx)) (i 0 (1+ i))) ((null xx) i) (cond ((eq #// (car xx)) (return i))))) (cond ((> len 2) (cond ((eq (cadr explf) #/.) (cond ((eq (car explf) #/o) (setq fasl-only t)) ((eq (car explf) #/l) (setq load-only t)) (t (setq no-ext t)))) (t (setq no-ext t)))) (t (setq no-ext t))) ; a short name is less or equal 12 characters. If a name is not ; short, then load will not try to append .l or .o (cond ((< len 12) (setq shortname t))) (cond ((and (> len 0) (eq (getchar filename 1) '/)) (setq search-path '(||))) (t (setq search-path (status load-search-path)))) (do ((xx search-path (cdr xx))) ((null xx) (error "load: file not found " filename)) (setq pred (cond ((memq (car xx) '(|| |.|)) '||) (t (concat (car xx) "/")))) (cond (no-ext (cond ((and shortname (probef (setq name (concat pred filename ".o")))) (return (fasl name (car fasl-args) (cadr fasl-args)))) ((and shortname (probef (setq name (concat pred filename ".l")))) (return (load-a-file name))) ((probef (setq name (concat pred filename))) (cond (fasl-args (return (fasl name (car fasl-args) (cadr fasl-args)))) (t (return (load-a-file name))))))) (fasl-only (cond ((probef (setq name (concat pred filename))) (return (fasl name (car fasl-args) (cadr fasl-args)))))) (load-only (cond ((probef (setq name (concat pred filename))) (return (load-a-file name))))))))) (defun load-a-file (name) (let ((piport (infile name)) (gcdisable t) ; don't gc when loading, it slows things down (eof (list nil))) (do ((form (read piport eof) (read piport eof))) ((eq eof form) (close piport) t) (eval form)))) (sstatus load-search-path (|.| /usr/lib/lisp)) ;--- include - read in the file name given, the name not evaluated ; (def include (nlambda (l) (load (car l)))) ;--- includef - read in the file name given and eval the first arg ; (def includef (lambda (l) (load l))) ;--- length - l : list ; returns the number of elements in the list. ; (def length (lambda ($l$) (cond ((null $l$) 0) (t (do ((ll (cdr $l$) (cdr ll)) (i 1 (1+ i))) ((null ll) i)))))) ;--- list-to-bignum ; convert a list of fixnums to a bignum. ; there is a function bignum-to-list but it is written in C ; ;(author: kls) ; (def list-to-bignum (lambda (x) (cond (x (scons (car x) (list-to-bignum (cdr x)))) (t nil)))) ;--- macroexpand - form ; expands out all macros it can ; (def ma((croexpand (lambda (form) (prog nil top (cond ((atom form) (return form)) ((atom (car form)) (return (let ((nam (car form)) def disc) (setq def (getd nam)) (setq disc (cond ((bcdp def) (getdisc def)) ((arrayp def) 'array) ((dtpr def) (car def)))) (cond ((memq disc '(array lambda lexpr nil)) (cons nam (mapcar 'macroexpand (cdr form)))) ((eq disc 'macro) (setq form (apply nam form)) (go top)) (t form))))) (t (return (cons (macroexpand (car form)) (mapcar 'macroexpand (cdr form))))))))) ; ; (makhunk 'n) ; ; This function is similar to hunk, except that: ; ; n can be a fixnum, which specifies the length of the hunk. ; The hunk is preinitialized to nil's ; n can be a list which is used to preinitialize the hunk. ; (defun makhunk (n) (prog (size Hunk) (setq size -1) (cond ((numberp n) ; ; If n is a number then build a nil hunk of the right size ; (cond ((greaterp n 128) (error "makhunk: size is too big" n)) (t (setq size (1- (haulong n))))) (cond ((minusp size) (return nil))) (setq Hunk (*makhunk size)) (do ((i 0 (1+ i))) ((= i n)) (*rplacx i Hunk nil)) (return Hunk)) ; ; If it isn't a number, then try hunk on it ; (t (return (apply 'hunk n)))))) ;--- member - VAL : lispval ; - LIS : list ; returns that portion of LIS beginning with the first occurance ; of VAL if VAL is found at the top level of list LIS. ; uses equal for comparisons. ; (def member (lambda ($a$ $l$) (do ((ll $l$ (cdr ll))) ((null ll) nil) (cond ((equal $a$ (car ll)) (return ll)))))) ;--- memq - arg : (probably a symbol) ; - lis : list ; returns part of lis beginning with arg if arg is in lis ; ; [ defintion moved to top of file to allow backquote macro to work ] ;--- min - arg1 ... numbers ; ; returns minimum of n numbers. ; (def min (lexpr (nargs) (do ((i nargs (1- i)) (min (arg 1))) ((lessp i 2) min) (cond ((lessp (arg i) min) (setq min (arg i))))))) ;--- nconc - x1 x2 ...: lists ; The cdr of the last cons cell of xi is set to xi+1. This is the ; structure modification version of append ; (def nconc (lexpr (nargs) (cond ((eq nargs '2) (cond ((null (arg 1)) (arg 2)) (t (do ((tmp (arg 1) (cdr tmp))) ((null (cdr tmp)) (rplacd tmp (arg 2)) (arg 1)))))) ((zerop nargs) nil) (t (do ((i 1 nxt) (nxt 2 (1+ nxt)) (res (cons nil (arg 1)))) ((eq i nargs) (cdr res)) (cond ((arg i) (rplacd (last (arg i)) (arg nxt))) (t (rplacd (last res) (arg nxt))))))))) (declare (localf nreverse1)) ; quick fcn shared by nreverse and nreconc ;--- nreconc :: nreverse and nconc ; (nreconc list elemt) is equiv to (nconc (nreverse list) element) ; (defun nreconc (list element) (cond ((null list) element) (t (nreverse1 list element)))) ;--- nreverse - l : list ; reverse the list in place ; (defun nreverse (x) (cond ((null x) x) (t (nreverse1 x nil)))) ;--- nreverse1 ; common local function to nreconc and nreverse. [This can just be ; nreconc when I get local global functions allow in the compiler -jkf] ; (defun nreverse1 (x ele) (prog (nxt) loop (setq nxt (cdr x)) (rplacd x ele) (setq ele x) (cond (nxt (setq x nxt) (go loop))) (return x))) ; (def oddp (lambda (n) (cond ((not (zerop (boole 1 1 n))) t)))) ;--- plusp : x - number ; returns t iff x is greater than zero (def plusp (lambda (x) (greaterp x 0))) ;--- princ : l - any s-expression ; [p] - port to write to ; prints using patom for atoms (unslashified) ; (def princ (lexpr (n) (prog (port val) (cond ((eq n 2) (setq port (arg 2)))) (cond ((dtpr (setq val (arg 1))) (cond ((and (eq 'quote (car val)) (dtpr (cdr val)) (null (cddr val))) (patom "'" port) (princ (cadr val) port)) (t (patom "(" port) (do ((xx val)) ((null xx) (patom ")" port)) (princ (car xx) port) (cond ((null (setq xx (cdr xx)))) ((not (dtpr xx)) (patom " . " port) (princ xx port) (setq xx nil)) (t (patom " " port))))))) (t (patom val port))) (return t)))) ;--- prog1 : return the first value computed in a list of forms ; (def prog1 (lexpr (n) (arg 1))) ;--- reverse : l - list ; returns the list reversed using cons to create new list cells. ; (def reverse (lambda (x) (cond ((null x) nil) (t (do ((cur (cons (car x) nil) (cons (car res) cur)) (res (cdr x) (cdr res))) ((null res) cur)))))) ;--- shell - invoke a new c shell ; (def shell (lambda nil ((lambda (shellname) (cond ((lessp (flatc shellname) 1) (setq shellname 'csh))) (apply 'process (ncons shellname))) (getenv 'SHELL)))) ;--- sload : fn - file name (must include the .l) ; loads in the file printing each result as it is seen ; (def sload (lambda (fn) (prog (por eof) (cond ((setq por (infile fn))) (t (patom "bad file name")(terpr)(return nil))) (setq eof (gensym)) (do ((x (read por eof) (read por eof))) ((eq eof x) (close por)) (cond ((dtpr x) (print (cadr x))) (t (print x))) (terpr) (eval x))))) ; these is the old sort functions (comment (defun sort(a fun) (prog (n) (cond ((null a) (return nil)) ;no elements (t (setq n (length a)) (do i 1 (1+ i) (greaterp i n)(sorthelp a fun)) (return a) )))) (defun sorthelp (a fun) (do ((ii a (cdr ii))) ((null (cdr ii))) (cond ((funcall fun (cadr ii) (car ii)) (exchange2 ii))))) ) ;---- bubble merge sort ; it recursively splits the list to sort until the list is small. At that ; point it uses a bubble sort. Finally the sorted lists are merged. (declare (special sort-function)) ;--- sort :: sort a lisp list ; args: lst - list of items ; fcn - function to compare two items. ; returns: the list with such that for each pair of adjacent elements, ; either the elements are equal, or fcn applied to the two ; args returns a non nil value. ; (defun sort (lst fcn) (setq sort-function fcn) ; store function name in global cell ; (setq sort-compares 0) ; count number of comparisons (sortmerge lst (length lst))) ;--- sortmerge :: utility routine to sort ; args: lst - list of items to sort ; nitems - a rough idea of how many items are in the list ; ; result - sorted list (see the result of sort above) ; (defun sortmerge (lst nitems) (prog (tmp tmp2) (cond ((greaterp nitems 7) ; do a split and merge (setq tmp (splitlist lst (setq tmp2 (quotient nitems 2)))) (return (mergelists (sortmerge (car tmp) tmp2) (sortmerge (cdr tmp) tmp2)))) (t ; do a bubble sort (do ((l lst (cdr l)) (fin)) ((null l)) (do ((ll lst (cdr ll))) ((eq fin (cdr ll)) (setq fin ll)) ;(setq sort-compares (1+ sort-compares)) (cond ((not (funcall sort-function (car ll) (cadr ll))) (rplaca ll (prog1 (cadr ll) (rplaca (cdr ll) (car ll)))))))) (return lst))))) ;--- splitlist :: utility routine to split a list ; args : lst - list to split ; spliton - number of items to put in the first list ; ; returns: a cons cell whose car is the first part of the list ; and whose cdr is the second part. ; (defun splitlist (lst spliton) (prog (second) (do ((i spliton (sub1 i)) (l lst)) ((or (null (cdr l)) (zerop i)) (setq second (cdr l)) (rplacd l nil)) (setq l (cdr l))) (return (cons lst second)))) ;--- mergelists ::utility routine to merge two lists based on predicate function ; args: ls1 - lisp list ; ls2 - lisp list ; sort-function (global) - compares items of the lists ; ; returns: a sorted list containing the elements of the two lists. ; (defun mergelists (ls1 ls2) (prog (result current) ; initialize (setq current (setq result (cons nil nil))) loop (cond ((null ls1) (rplacd current ls2) (return (cdr result))) ((null ls2) (rplacd current ls1) (return (cdr result))) ((funcall sort-function (car ls1) (car ls2)) ;(setq sort-compares (1+ sort-compares)) (rplacd current ls1) (setq current ls1 ls1 (cdr ls1))) (t ;(setq sort-compares (1+ sort-compares)) (rplacd current ls2) (setq current ls2 ls2 (cdr ls2)))) (go loop))) ;--- end bubble merge sort (defun sortcar (a fun) (prog (n) (cond ((null a) (return nil)) ;no elements (t (setq n (length a)) (do i 1 (1+ i) (greaterp i n)(sortcarhelp a fun)) (return a) )))) (defun sortcarhelp (a fun) (cond ((null (cdr a)) a) ((funcall fun (caadr a) (caar a)) (exchange2 a) (sortcarhelp (cdr a) fun)) (t (sortcarhelp (cdr a) fun)))) (defun exchange2 (a) (prog (temp) (setq temp (cadr a)) (rplaca (cdr a) (car a)) (rplaca a temp))) ;--- sublis: alst - assoc list ((a . val) (b . val2) ...) ; exp - s-expression ; for each atom in exp which corresponds to a key in alst, the associated ; value from alst is substituted. The substitution is done by adding ; list cells, no struture mangling is done. Only the minimum number ; of list cells will be created. ; (def sublis (lambda (alst exp) (let (tmp) (cond ((atom exp) (cond ((setq tmp (assoc exp alst)) (cdr tmp)) (t exp))) ((setq tmp (sublishelp alst exp)) (car tmp)) (t exp))))) ;--- sublishelp : alst - assoc list ; exp - s-expression ; this function helps sublis work. it is different from sublis in that ; it return nil if no change need be made to exp, or returns a list of ; one element which is the changed exp. ; (def sublishelp (lambda (alst exp) (let (carp cdrp) (cond ((atom exp) (cond ((setq carp (assoc exp alst)) (list (cdr carp))) (t nil))) (t (setq carp (sublishelp alst (car exp)) cdrp (sublishelp alst (cdr exp))) (cond ((not (or carp cdrp)) nil) ; no change ((and carp (not cdrp)) ; car change (list (cons (car carp) (cdr exp)))) ((and (not carp) cdrp) ; cdr change (list (cons (car exp) (car cdrp)))) (t ; both change (( (list (cons (car carp) (car cdrp)))))))))) ;--- subst : new - sexp ; old - sexp ; pat - sexp ; substitutes in patrn all occurrences equal to old with new and returns the ; result ; MUST be put in the manual (declare (special new old)) (def subst (lambda (new old pat) (cond ((symbolp old) (substeq pat)) (t (substequal pat))))) ;use this function for substituting for symbols (def substeq (lambda (pat) (cond ((eq old pat) new) ((atom pat) pat) (t (cons (substeq (car pat))(substeq (cdr pat))))))) (def substequal (lambda (pat) (cond ((equal old pat) new) ((atom pat) pat) (t (cons (substequal (car pat)) ; in interlisp, the next line would be ;(substeq (cdr pat)) ; for maclisp compatibility, we do this. (substequal (cdr pat))))))) (declare (unspecial new old)) ;--- vi: arg is unevaluated name of function to run vi on ; (def vi (nlambda (x) (exvi 'vi x nil))) ;--- vil : arg is unevaluated, edits file and then loads it ; (def vil (nlambda (x) (exvi 'vi x t))) ;--- xcons : a - sexp ; b - sexp ; returns (b . a) that is, it is an exchanged cons ; (def xcons (lambda (a b) (cons b a))) ;--- Section VI - ARRAY functions . ; (def array (macro ($lis$) `(*array ',(cadr $lis$) ',(caddr $lis$) ,@(cdddr $lis$)))) ;--OLD array stuff. new stuff to follow ; array access function ; ; (def arracfun ; (lambda (actlst ardisc) ; (prog (diml ind val) ; ; (setq actlst (mapcar 'eval actlst) ; diml (getaux ardisc)) ; ; (cond ((null (equal (length actlst) ; (length (cdr diml)))) ; (break '"Wrong number of indexes to array ref")) ; ; (t (setq ind (arrcomputeind (cdr actlst) ; (cddr diml) ; (car actlst)) ; val (arrayref ardisc ind)) ; (cond ((or (eq (car diml) t) ; (eq (car diml) 'unmarked_array)) ; (setq val (eval val))) ; (t (setq val (cpy1 val)))) ; (return val)))))) ; ; ; ; ;(def *array ; (lexpr (nargs) ; (prog (name type rtype dims size tname) ; ; (setq name (arg 1) ; type (arg 2) ; rtype (cond ((null type) (setq type 'unmarked_array) ; 'value) ; ((equal type t) ; 'value) ; (t type)) ; dims (do ((i 3 (1+ i)) ; (res nil (cons (arg i) res))) ; ((greaterp i nargs) (nreverse res))) ; size (apply 'times dims)) ; ; (setq tname (marray (segment rtype size) ; (getd 'arracfun) ; (cons type dims) ; size ; (sizeof rtype))) ; (cond (name (set name tname) ; (putd name tname))) ; '(fillarray tname (cond ((eq type 'fixnum) '(0)) ; ((eq type 'flonum) '(0.0)) ; (t '(nil)))) ; (return tname)))) ; ;(defmacro arraycall (type name &rest indexs) ; `(ev-arraycall ',type ,name (list ,@ indexs))) ; ; ;(def ev-arraycall ; (lambda (type ardisc indexs) ; ; form (arraycall type name sub1 sub2 ... subn) ; (cond ((or (not (equal (car (getaux ardisc)) type)) ; (and (eq (car (getaux ardisc)) 'unmarked_array) ; type)) ; ; (patom '" Type given arraycall:") ; (patom type) ; (patom '" doesn't match array type:") ; (patom (car (getaux ardisc))) ; (break nil))) ; (apply (getaccess ardisc) ; (list indexs ardisc)))) ; ; ; ; ;; function to compute the raw array index ; ;(def arrcomputeind ; (lambda (indl diml res) ; (cond ((null diml) res) ; (t (arrcomputeind (cdr indl) ; (cdr diml) ; (+ (* res (car diml)) ; (car indl))))))) ; ;; store ;; we make store a macro to insure that all parts are evaluated at the ;; right time even if it is compiled. ;; (store (foo 34 i) (plus r f)) ;; gets translated to ;; (storeintern foo (plus r f) (list 34 i)) ;; and storeintern is a lambda, so when foo is evaluated it will pass the ;; array descriptor to storeintern, so storeintern can look at the ;; aux part to determine the type of array. ;; ;(defmacro store ( (arrname . indexes) value) ; (prog nil ; ; loop ; (cond ; ((eq 'funcall arrname) ; (setq arrname `(getd ,(car indexes)) ; indexes (cdr indexes))) ; ((eq 'arraycall arrname) ; (setq arrname (cadr indexes) ; indexes (cddr indexes))) ; ((and ((lambda (fnd) ; (cond ((or (and (dtpr fnd) (eq 'macro (car fnd))) ; (and (bcdp fnd) (eq 'macro (getdisc fnd)))) ; (setq fnd (apply arrname (cons arrname indexes))) ; (setq arrname (car fnd) ; indexes (cdr fnd))))) ; (getd arrname)) ; (go loop))) ; (t (setq arrname `(getd ',arrname)))) ; (return `(storeintern ,arrname ,value (list ,@indexes))))) ; ;;-- storeintern - internal store function ;; - arrnam : array descriptor ;; - vl : value to store ;; - actlst : list of actual variable values ;; ;(def storeintern ; (lambda (arrnam vl actlst) ; (prog (loc) ; (cond ((or (eq t (car (getaux arrnam))) ; (eq 'unmarked_array (car (getaux arrnam)))) ; (setq loc (arracfcnsimp actlst arrnam)) ; (set loc vl)) ; ; (t (replace (arracfcnsimp actlst arrnam) vl))) ; (return vl)))) ; ; ;(def arracfcnsimp ; (lambda (indexes adisc) ; (prog (dims) ; (setq dims (cdr (getaux adisc))) ; (cond ((null (equal (length indexes) ; (length dims))) ; (break '"wrong number of indexes to array")) ; (t (setq dims (arrcomputeind (cdr indexes) ; (cdr dims) ; (car indexes))))) ; (return (arrayref adisc dims))))) ; ; ;; new array package (jkf 9/24/80) ; features of the new package: ; Most array will be notype arrays. This is because they are the most ; efficient in Franz. What used to be fixnum and flonums arrays are ; now fixnum-block and flonum-block arrays. ; The array access functions are more specialized and much faster now. ; The array access functions have different semantics. Now they are ; responsible for both accessing and storing in an array. ; When an access function is asked to access a value, it will be given ; the subscripts already evaluated and the array object. These will ; be stacked, so the array access function should be a lexpr to read them. ; When an access function is asked to store a value that value will be ; the first argument, the subscripts will follow and finally there will ; be the array object. ; It is up to the access function to determine if it is being asked to ; store or retrieve a value, and this determination will probably ; be made by looking at the number of arguments. (declare (special gcdisable)) (def *array (lexpr (nargs) (prog (name type rtype dims size tname numdims) (cond ((lessp (setq numdims (- nargs 2)) 1) (error "no bounds to array declaration "))) (setq name (arg 1) type (arg 2) rtype (cond ((memq type '(t nil fixnum flonum)) 'value) ((eq type 'fixnum-block) 'fixnum) ((eq type 'flonum-block) 'flonum) (t (error "array: bad type: " type))) dims (do ((i nargs (1- i)) (res nil (cons (arg i) res))) ((eq i 2) res)) size (apply 'times dims)) (cond ((null type) (setq type 'unmarked_array))) ; we disable gc during the next calculation since ; the data returned from small-segment is unprotected ; and a gc would cause its data to be put on the ; free list. (let ((gcdisable t)) (setq tname (marray (small-segment rtype size) (cond ((eq rtype 'value) (cond ((eq numdims 1) (getd 'arrac-oneD)) ((eq numdims 2) (getd 'arrac-twoD)) (t (getd 'arrac-nD)))) (t (getd 'arrac-nD))) (cons type dims) size (sizeof rtype)))) ; if type is fixnum or flonum ; we must intialize to 0 or 0.0 (cond ((or (and (eq 'fixnum type) (setq rtype 0)) (and (eq 'flonum type) (setq rtype 0.0))) (do ((i size)) ((zerop i)) (set (arrayref tname (setq i (1- i))) rtype)))) (cond (name (putd name tname))) (return tname)))) (defmacro arraycall (type array &rest indexes) `(funcall ,array ,@indexes)) ; this is used by the old array scheme. Keep this around until ; everything is recompiled (defun ev-arraycall (type array indexes) (apply array indexes)) ;;;---- array access functions. ; we first define a macro to evaluate a value cell. In compiled code cdr ; is the fastest way to do this, in interpreted code the type checker ; would not let us use cdr so we have to use eval. (eval-when (compile) (defmacro value-eval (x) `(cdr ,x))) ; one level of indirection (eval-when (eval) (defun value-eval (x) (eval x))) ;- one dimensional (defun arrac-oneD n (cond ((eq n 2) (value-eval (arrayref (arg 2) (arg 1)))) ((eq n 3) (set (arrayref (arg 3) (arg 2)) (arg 1))) (t (error " wrong number of subscripts to array: " (arg n))))) (defun arrac-twoD n (let ((aux (getaux (arg n)))) (cond ((eq n 3) (value-eval (arrayref (arg n) (+ (* (arg 1) (caddr aux)) (arg 2))))) ((eq n 4) (set (arrayref (arg n) (+ (* (arg 2) (caddr aux)) (arg 3))) (arg 1))) (t (error " wrong number of subscripts to array: " (arg n)))))) ;-- n dimensional array access function. (defun arrac-nD n (let ((aux (getaux (arg n))) firstsub subs store (index 0)) (setq subs (length (cdr aux))) (cond ((eq n (1+ subs)) (setq firstsub 1)) ((eq n (+ 2 subs)) (setq firstsub 2 store t)) (t (error "wrong number of subscripts to array: " (arg n)))) (setq index (arg firstsub)) (do ((bounds (cddr aux) (cdr bounds)) (i firstsub)) ((null bounds)) (setq index (+ (* index (car bounds)) (arg (setq i (1+ i)))))) (setq subs (arrayref (arg n) index)) ; get cell requested (cond ((memq (car aux) '(fixnum-block flonum-block)) (cond (store (replace subs (arg 1))) (t (cpy1 subs)))) (t (cond (store (set subs (arg 1))) (t (value-eval subs))))))) (defmacro store ( (arrname . indexes) value) (prog (defered) loop (cond ((eq 'funcall arrname) (setq arrname (car indexes) indexes (cdr indexes) defered t)) ((eq 'arraycall arrname) (setq arrname (cadr indexes) indexes (cddr indexes) defered t)) (( ((arrayp arrname) (setq arrname `',arrname defered t)) ((and ((lambda (fnd) (cond ((or (and (dtpr fnd) (eq 'macro (car fnd))) (and (bcdp fnd) (eq 'macro (getdisc fnd)))) (setq fnd (apply arrname (cons arrname indexes))) (setq arrname (car fnd) indexes (cdr fnd))))) (getd arrname)) (go loop)))) (return (cond (defered `(funcall ,arrname ,value . ,indexes)) (t `(,arrname ,value . ,indexes)))))) ;-- storeintern - there may be residual calls to storeintern from ; old code, we handle it here. this routine can be eliminated when ; code is recompiled (defun storeintern (arrnam value indexes) (apply arrnam (cons value indexes))) ;--- small segment storage allocators. ; this function allocates segments of storage and attempt to use the whole ; block instead of throwing away what isnt used ; (declare (special gcdisable)) (defun small-segment (type n) (prog (lastseg retv elementsize itemsperpage-1 gcdisable tmp) (setq gcdisable t) ; its not a good idea to gc while we are ; handling pointers to things segment returns. (desetq (elementsize . itemsperpage-1) (get 'segment-sizes type)) (cond ((null elementsize) (error "small-segment: bad type " type))) (setq lastseg (get 'segment-types type)) (cond ((and lastseg (not (lessp (car lastseg) n)))) (t ; must allocate a block of storage, want to the least number of ; pages which includes n elements ; there are elementsize elements per page, and ; itemsperpage-1 is the number of elements on a page minus 1 (setq retv (boole 4 (+ n itemsperpage-1) itemsperpage-1)) ; 4 is x & ~y (setq lastseg (cons retv (maknum (segment type retv)))))) (setq retv (cdr lastseg)) (rplaca lastseg (- (car lastseg) n)) (rplacd lastseg (+ (cdr lastseg) (* elementsize n))) (cond ((greaterp (car lastseg) 0) (putprop 'segment-types lastseg type) (cond ((null (setq tmp (get 'segment-arrays type))) (putprop 'segment-arrays (setq tmp (marray nil nil nil nil nil)) type))) (putdata tmp (fake (cdr lastseg))) (putlength tmp (car lastseg)) (putdelta tmp elementsize)) (t ; remove all counters since we no longer have any space ; left and we can't have a zero length array (remprop 'segment-types type) (remprop 'segment-arrays type))) (return (fake retv)))) ; data base for small-segment (putprop 'segment-sizes '( 4 . 127) 'value) (putprop 'segment-sizes '( 4 . 127) 'fixnum) (putprop 'segment-sizes '( 8 . 63) 'flonum) (def arraydims (lambda (arg) (cond ((symbolp arg) (getaux (getd arg))) ((arrayp arg) (getaux arg)) (t (break '"non array arg to arraydims"))))) ; fill array from list or array (def fillarray (lambda (arr lis) (prog (maxv typept) (cond ((symbolp arr) (setq arr (getd arr)))) (cond ((symbolp lis) (setq lis (getd lis)) (return (fillarrayarray arr lis))) ((arrayp lis) (return (fillarrayarray arr lis)))) (setq maxv (1- (getlength arr)) typept (cond ((memq (car (getaux arr)) '(t fixnum flonum unmarked_array)) t) (t nil))) (do ((ls lis) (i 0 (1+ i))) ((greaterp i maxv)) (cond (typept (set (arrayref arr i) (car ls))) (t (replace (arrayref arr i) (car ls)))) (cond ((cdr ls) (setq ls (cdr ls)))))))) (def fillarrayarray (lambda (arrto arrfrom) (prog (maxv) (setq maxv (1- (min (getlength arrto) (getlength arrfrom)))) (do ((i 0 (1+ i))) ((greaterp i maxv)) (replace (arrayref arrto i) (arrayref arrfrom i)))))) (def listarray (lexpr (n) (prog (arr size typ ret newv) (setq arr (arg 1)) (cond ((and (symbolp arr) (arrayp (setq arr (getd arr))))) (t (error "Non array to listarray " arr))) (setq size (cond ((eq n 2) (arg 2)) (t (apply '* (cdr (arraydims arr)))))) (setq typ (car (getaux arr))) (cond ((memq typ '(t fixnum flonum unmarked_array)) (setq typ t)) (t (setq typ nil))) (do ((i (1- size) (1- i))) ((lessp i 0)) (setq newv (arrayref arr i)) (setq ret (cons (cond (typ (eval newv)) (t (cpy1 newv))) ret))) (return ret)))) ;---Section VII - equivalances------------------- ; (putd 'abs (getd 'absval)) (putd 'add (getd 'sum)) (putd 'bcdcall (getd 'funcall)) (putd 'chrct (getd 'charcnt)) (putd 'diff (getd 'difference)) (putd 'numbp (getd 'numberp)) (putd 'remainder (getd 'mod)) (putd 'terpri (getd 'terpr)) (putd 'typep (getd 'type)) (putd 'symeval (getd 'eval)) (putd '< (getd 'lessp)) (putd '= (getd 'equal)) (putd '> (getd 'greaterp)) (putd '*dif (getd 'difference)) (putd '\\ (getd 'mod)) (putd '\1+ (getd 'add1)) (putd '\1+$ (getd 'add1)) (putd '\1- (getd 'sub1)) (putd '\1-$ (getd 'sub1)) (putd '*$ (getd 'times)) (putd '/$ (getd 'quotient)) (putd '+$ (getd 'add)) (putd '-$ (getd 'difference)) 'diff (getd 'difference)) (putd 'numbp (getd 'numberp)) (putd 'remainder (getd 'mod)) (putd 'terpri (getd 'terpr)) (putd 'typep (getd 'type)) (putd 'symevallib/lisp/auxfns0.o 664 0 33 136041 2552754317 7375  $XWZVPZ~Z|jЪP1xjP@PxPPP*hjԆPPWWVPjTФԆPЪ xjP@rPxPPP+ШjԆVPMPW?WV*кj"Ъ jTФԆ!PQvPQ`` PЪ PЪ`ЪPVЎZXW~VZWVPj~jP@P@1պxjP@ P1j j#jPPjкP@ЭպxP@^ ЪPKкP@ЭЪLPѪ Ѫ#ЪPPVXWZVШjWWVXW~VZWVPj~jP@ѺЪPjкP@ЭЪWWVPкP@ЭPѪ Ѫ#ЪPPP9XWZVЪժPjЪTФPvPTP PкXWZVШ ШкTdSУԆPPкTФԆPPXWZVШШкTdSУԆPwPкTФԆdP[PRIXWZVԆԆԆԆԆԆԆ-UиШЪиШЪи Ш Ъ UкTdSУШ$ԆWWVPШ(кTФШ,Ш0Ш4ԆЪժ8P Ъ8TФP`Ъ4P4к88VЪ4WWVVPԆи ժ<P1tЪP5PШ<ЪTФЪ(ԆPPPԆPPԆPPPԆPPժ,MЪ0WWVPкԆWWVPPPԆuкPPԆWWVPWvWVPWeWVP1P(PЪ W6WVPԆW+WVPPԆPPXWZVкԆԆЪԆԆԆժ1պ ЪTФPШ\ЪWWVP1wЪTФdSУxP@bPxPPP)Ш<ЪЪԆAP8P/1fWjWVPЪWgWVP Ш4ЪԆPԆЪ ժ,PeЪ,TФШ<к0Ъ0TФЪԆPPԆPPVPЪ(P(к,,VЪ(WWVVPԆWyWVPEPWVXWZVкTФdЪWWVPժ  ЪTФPTЪ TФԆ~PЪԆWWVP^PUP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WVPԆPW߹WVиLPP VЎZケXW~VZWVPj~ԆЏѺjWWVyj ЏfjP1j j#jPAPjW]WVP P#PPPPЪW-WVPЏѪjP_кUЪPPE`~Ѫ# ЪPﺸP`P@ЭvPѪ#ЪPPVЪPlXWZVjպЪPкFXW~VZWVPj~P@ԆjԆЪ ЏWWVP ЪЪPMѪ  Ѫ #Ъ PݷP к P@ЭЪ︷Pv VxP@)xP@ЪWWVPԆԆԆԆԆԆԆԆԆЪWWVPW^WVP,Ъ,Џժ0Ъ4PFЏЪ0TФPvPЪ4P,Pк0Ѫ4#Ъ4PP444v0VPѺHк,TФPP0Ъ,SУPPиLѣиL иLиLиLѺ иL(PѺ(ЪЏWWVPWWVPЪժ0 ЪWWV1Ъ0TФQPPQ`PPФW!WVP$ժ1ժ(YЪ$ЪWWVP Ъ W׷WVP$Ъ ЪTФdSУWWV1_ժ(BЪ$Ъ WWVP Ъ WyWVP Ъ 1Ъ$ЪWZWVP Ъ WWVﺠXWZVЪj怒XWZVlШкTФԆ{PrPШкTdSУԆXPOPкTдԆW_WVP+P"PXW~VZWVPj~|||ԆUPЪЏWǠWVPpW0WVPP@P@ЪQtPPQ`PxP5Ѫ|ȔP&ѪȀȘPȄЪWğWVP jԆѪ Ъ$PMѪ  Ѫ #Ъ PP к P@ЭЪ$P$v VPȈЪWОWVPժȌPиL羽U$$Ъ $UЪ ЪWmWVPѪ x5Ѫ ȐPРPѪ ȔPРP ȘPРP ȘPРPPЪЪ ((PЪЪ WWVPWWVPUХUޝVȔ Џ Ș1Ȝ yЪպ x P@ PWЪѪ  Ѫ #Ъ PwP  Ъ WdWVPЪ WwWVVPժЪЪW[WVPЪP XWZVкTФdSУcȠЪЪ ԆWWVP͜PĜﻜXWZ VЪЪWWVXW~VZWVPj~j#P@P@WdWV`Pfj 9P@P@W8WVPP@WGWV$ȤкP@ЭWiWVXW~VZWVPj~кP@ЭWŞWVPj `кP@ЭP@P`UU~кTdSУP`UUUU~P@P`UUU]PWWWV`P1juкP@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ЪPѪ Ѫ#ЪPtP1[VЪPccccccccccccccccccccccccccccccccccccccccccc"Non-list to append:""Non-list to append:"concat*catchquote*throwprotect-listprotect-evformdefmacrooptlist(d r)defmacro(defmacroarg)lambdacondsetq(defmacroarg)(t)cartlist(defmacroarg)defmacro-for-compilingprogn(quote compile)c&rest&optional&protectordtpr&aux(nil)adca(macro expr fexpr lexpr)"::"fexprnlambdaexprlexpr(quote compile)putpropgetdarggreaterp(t)do\1-conslessplet*(r)(r)letn((cond ((minusp n) (do ((i (arg nil) (\1- i)) (result nil (cons (arg i) result))) ((< i (+ (arg nil) n 1)) result))) (t (do ((i n (\1- i)) (result nil (cons (arg i) result))) ((< i 1) result)))))assocapply(nil)(nil)assq(nil)(nil)l(minusp signp-arg)le(not (greaterp signp-arg 0))e(zerop signp-arg)(not (zerop signp-arg))ge(not (minusp signp-arg))g(greaterp signp-arg 0)"bad arg to signp "andnumberpsignp-arg(signp-arg)(numberp signp-arg)G(quote ER%unwind-protect)eq(quote ER%unwind-protect)I-throw-errcdr(nil)"Floating Exception ""Interrupt: ""["(list fixnum)(list fixnum)(list fixnum)ut:"%]"*":""{"100.0"%}""; "$gccount$ptimeatlastgcgcafter-panic-mode"[Storage space totally exausted]""Space exausted when allocating "$gc_midlim$gc_minalloc$gc_pct$gc_lowlimER%all$gcprint"[Now in storage allocation panic mode]""bad arg to assoc"bignumcomment%\\`,(uctolc t)\|/\[\](uctolc t)(uctolc t)(syntax ,)!splicing~zapline;" too few args to delete "" non list arg to delete "" too few args to delete "" non list arg to delete "exedit_file".l"" "process""" ""("")"" ""."" "")"" ""("")"" ""."" "")"" "32461.0subroutine"-lI77 -lF77 -lm"fixnumflonum"type (help fnc) for info on function fnc""type (help n) to see chapter n""type (help tc) for a table of contents""Bad option to help "tc"Table of contents""1 - intro; 2 - data structure; 3 - arithmetic; 4 - special""5 - i/o; 6 - system; 7 - reader; 8 - functions; 9 - arrays""10 - exceptions; 11 - trace package; 12 - Liszt;""14 - step package; 15 - fixit package""b - special symbols; c - gc & debugging & top level "(b c)"/usr/ucb/ul /usr/lib/lisp/manual/ch"".r | /usr/ucb/more -f""Unknown function: "appendhelplocation"[Reading help index]""/usr/lib/lisp/manual/helpindex"readtable" ""/usr/ucb/ul /usr/lib/lisp/manual/"" | /usr/ucb/more -f \"+/(""\"""hunk: size is too big""load: illegal filename "(||)(load-search-path)"load: file not found "(|| \.)||"/"".o"".l"gcdisablearray(array lambda lexpr nil)"makhunk: size is too big"hunk2"'""("")"" . "" "SHELLcsh"bad file name"sort-functionoldnewvi*array"no bounds to array declaration "(t nil fixnum flonum)valuefixnum-blockflonum-block"array: bad type: "timesunmarked_arrayarrac-oneDarrac-twoDarrac-nD0.0funcall" wrong number of subscripts to array: "" wrong number of subscripts to array: ""wrong number of subscripts to array: "(fixnum-block flonum-block)arraycallsegment-sizes"small-segment: bad type "segment-typessegment-arrays(quote "non array arg to arraydims")(t fixnum flonum unmarked_array)"Non array to listarray "(t fixnum flonum unmarked_array)errapplygreaterpdefmcrosrchnreverseappendevalconcatldefmcrooptiongensymconcatlambdacvtde-composenconcreverseerrorsubstminusppatomdrain*breakprintdifftimesquotientmaxterpropvalfixboundpptimelesspallocateprtpagesusedequaltypecopyuconcatsetputdplistsetplistsetsyntaxsstatusstatusputpropbooleexviinfilecloseloadaexplodeexplodelastaexplodecexplodecaexplodenexplodenexptlogexpoddpcfaslonepfseeklengthsubstringsubstringnmakereadtablereadhaulong*makhunkgetcharprobeffasllist-to-bignumsconsgetdiscarraypmacroexpandprincgetenvflatcsortmergesplitlistmergelistsfuncallsub1sortcarhelpexchange2assocsublishelpsubsteqsubstequalsmall-segmentsizeofmarrayarrayrefgetauxreplacecpy1segmentmaknumfakeputdataputlengthputdeltarempropfillarrayarraygetlengthminarraydims(setq SCCS-auxfns0 "@(#)auxfns0.l 1.29 7/9/81")(setsyntax (quote ;) (quote splicing) (quote zapline))(cond ((null (getd (quote back=quotify))) (cond ((atom (errset (fasl (quote /usr/lib/lisp/backquote)))) (load (quote backquote))))))declareappendconcatlmaxmemqcatchthrow(cond ((null (boundp (quote defmacro-for-compiling))) (setq defmacro-for-compiling nil)))defmacrodefmcrosrchdefmcrooptiondefunlambdacvtdesetqletde-composelet*listifysassocsassq(quote (def signp (macro (l) (list (quote signphelpfcn) (list (quote quote) (cadr l)) (caddr l)))))signpsignphelpfcnunwind-protectFPEINTINT(signal 8 (quote FPEINT))(signal 2 (quote INT))(cond ((null (boundp (quote $gcprint))) (setq $gcprint nil)))(cond ((null (boundp (quote $gccount$))) (setq $gccount$ 0)))prtpagesused(setq gcafter-panic-mode nil)(setq $gc_minalloc 10)(setq $gc_lowlim 60)(setq $gc_midlim 85)(setq $gc_pct 0.1)(setq ptimeatlastgc (ptime))gcafterappend1assocbigpcommentcopycopysymbolcvttointlispcvttomaclispcvttoucilispdefpropdeletedelqevenpexexviexecexlexplodeexplodecexplodenexpt(quote (defun expt (x y) (prog (res) (setq res 1) loop (cond ((equal y 0) (return res)) (t (setq res (times x res) y (\1- y)))) (go loop))))ffaslfileposfixpflatsizefloatpgetchargetcharngetlhelphunklastload(sstatus load-search-path (\. /usr/lib/lisp))includeincludeflengthlist-to-bignummacroexpandmakhunkmemberminnconcnreconcnreverseoddppluspprincprog1reverseshellsloadsortsortmergesplitlistmergelistssortcarsortcarhelpexchange2sublissublishelpsubstsubsteqsubstequalvivilxconsarray*arrayarraycallev-arraycallarrac-oneDarrac-twoDarrac-nDstorestoreinternsmall-segment(putprop (quote segment-sizes) (quote (4 . 127)) (quote value))(putprop (quote segment-sizes) (quot((e (4 . 127)) (quote fixnum))(putprop (quote segment-sizes) (quote (8 . 63)) (quote flonum))arraydimsfillarrayfillarrayarraylistarray(putd (quote abs) (getd (quote absval)))(putd (quote add) (getd (quote sum)))(putd (quote bcdcall) (getd (quote funcall)))(putd (quote chrct) (getd (quote charcnt)))(putd (quote diff) (getd (quote difference)))(putd (quote numbp) (getd (quote numberp)))(putd (quote remainder) (getd (quote mod)))(putd (quote terpri) (getd (quote terpr)))(putd (quote typep) (getd (quote type)))(putd (quote symeval) (getd (quote eval)))(putd (quote <) (getd (quote lessp)))(putd (quote =) (getd (quote equal)))(putd (quote >) (getd (quote greaterp)))(putd (quote *dif) (getd (quote difference)))(putd (quote \\) (getd (quote mod)))(putd (quote \1+) (getd (quote add1)))(putd (quote \1+$) (getd (quote add1)))(putd (quote \1-) (getd (quote sub1)))(putd (quote \1-$) (getd (quote sub1)))(putd (quote *$) (getd (quote times)))(putd (quote /$) (getd (quote quotient)))(putd (quote +$) (getd (quote add)))(putd (quote -$) (getd (quote difference))) / I R ` v       <P s     % p    " + > G P Y |         ] z        7 @ K T ] h v            R o         $ 2 q         # / 8 C L h t          *  >  [  q  }             2  S  _  m  |        (  @  u  ~       +  =  N  ^  {        ,  ?  x            ) 9 M X n z     0     8 i u            % . 7 @ K T ] f y   T           2 ? W g y       ) 6 J ^ s |       ; D M u ~          $ - 8 L X a l u ~         # B K Z c l w               % 0 P g s |            " - n z        B K V _ h x         B \ l         * < R      d m x      ' 3 < P \ e          & 2 T ~              G  }            ! ! #! ,! 5! `! ! ! ! ! ! ! ! ! " " " (" 3" <" E" N" " " # # -# ;# D# M# n# w# # # # # # # # # # $ =$ g$ $ $ $ $ % !% *% 3% >% G% P% p% y% % % % % % % % % % % & & & #& 6& ?& J& S& \& g& u& & & & & & & & & & ' ' +' \' y' ' ' ' ' ' ' ( #( ?( _( u( ( ( ( ( ( ( ) ) 7) E) V) g) z) ) ) ) ) * ,* O* g* * * * * * + 7+ D+ ^+ + + + + + , @, Y," `,# f,$ n,% , , ,# ,# , , , - &- =- K- W- - - - - - . 0. F. Z. }. . . . . . . / !/ 6/ G/ [/ y/ / / / / / 0 0 80 R0 l0 0 0 0 0 0/ 0 1 #1 =1 W1 q1 }1 1 1 1 2 02 g2 2 2 2 3 +3 a3 3 3 3 4 <4 O4 4 4 4 5 35 Z5 w5 5 5 5 5" 5# 5$ 5% 6 6 6# $6# :6 d6 |6 6 6 6 6 6 6 6 7 /7 G7 f7 r7 7 7 7 7 7 7 8 78 [8 n8 ~8 8 8 8 8 8 8 9 !9 59 O9 p9 |9 9 9 9 9 : : -: >: J: S: \: : : : : : : !; -; I; ^; {; ; ; ; ; ; ; < < :< [< g< < < < < = #= 4= G= \= m= ~= = = = > *> ;> N> > > > > ? 8? Y? ? ? ? ? ? @ )@ P@ a@ m@ @ @ @ @ @ @ A &A :A TA A A A A A A B 7B SB eB rB B B B B B B B C C ,C ?C LC _C lC C C C C D D (Dm am zm m m ((m m n n *n Hn mn n n n n n o 2o Mo wo o o o p 'p Bp Vp fp p  $+2=D!KRYU`gl s zu)a. 1!J"#$&&') #"-*S-1-8,.?B.F.MW/T/[0bhy1o1v]3}4V556C7n79:<J>>?%@i@@@"AA;FG GLLM%sM,M3O:PAEQHQORSVzS]Sd4Tk]TrUyVcVVW+XrYYxZ[[[H\_]]\^^_>_\__b =cdcd!]e(]g/h6i=kD(lKmRnYpbnpyr F00007linker_typetable_qconstrantbF00020_qoneminusF00044F00046F00062F00069F00071F00073_bnpF00119F00142F00151F00178_qoneplusF00223F00237F00274F00279F00284F00286F00291F00296F00307F00331F00333F00335F00337_qnewintF00350_qpushframe_errp_retval_lispretvalF00377F00379F00389F00394F00396F00400F00406F00408F00410_qgetF00414F00416F00454F00490F00499F00501F00512F00518F00520F00530F00540F00550F00571F00583F00598F00608F00612F00617F00619F00621F00633F00660F00682F00691F00753F00755F00757F00766F00770F00796F00815F00824F00840F00879F00883F00893F00902F00904F00923F00927F00934F00938F00947F00949F00963F00971F00979F00989F00994F00997F01004F01017F01021F01026F01033F01035F01037F01039F01041F01085F01087F01089F01106F01129F01163F01179F01181F01193F01198F01222F01233bind_orglinker_sizetrans_sizelit_orglit_end9F00501F00512F00518F00520F00530F00540F00550F00571F00583F00598F00608F00612F00617F00619F00621F00633F00660F00682F00691F00753F00755F00757F00766F00770F00796F00815F00824F00840F00879F00883F00893F00902F00904F00923F00927F00934F00938F00947F00949F00963F00971F00979F00989F00994F00997F01004F01017F01021F01026F01033F01035F01037F01039F01041F01085F01087F01089F01106F01129F01163F01179F01181F01193F01198F01222F01233bind_orglinkerlib/lisp/step.o 664 0 33 12331 2552754760 6741 xXWZVj jTդ1иЏЏ ԸԸjTФPP Ш Ը$ Ш Ш($jP6jTФPPPШPѤPШPPPjPPP ии$Ш,WJWVиW@WVШ0W&WV#Ը ԸЏ ԸШ4WWVXWZVո 1 xjP@PxPPP(Ѹ !jTФQи PPQ`Pи Ѹ 1ЏиP`UxUUPЏ ЏlUи8Ш8Ъ8и<Ш<Ъ"" - single step; n - step times""b - break; q - quit stepping; d - call debug;""c - turn off step for deeper levels; e - stop at eval forms only""h,? - print this"evalsstatus*rsetpatomprinttyoprincevalhookterprigreaterpsub1terprdraintyidebug*breakstepresetreadstephelpformcontinue-evaluationminuspfuncall-evalhook*funcallhook(setq SCCS-step "@(#)step.l 1.3 7/9/81")stepfuncall-evalhook*stephelpformfuncallhook*evalhook*continue-evaluation(or (boundp (quote prinlength)) (setq prinlength nil))(or (boundp (quote prinlevel)) (setq prinlevel nil))      # y       & 9 H c         7 M ^ s        E |     " = T v       + 8 c x       * 7 I _ q        ( ? a ~         =  I  `  m          !  K  w ! 3  ?  Z  f      +49CE J Q\c; jb q z( F00009linkertrantbF00024_typetable_qnewint_bnp_qoneplusF00101F00103_qoneminus_qconsF00129F00131bind_orglinker_sizetrans_sizelit_orglit_end   !  K  w ! 3  ?  Z  f      +49CE J Q\c; jb qlib/lisp/auxfns1.l 444 0 33 21453 2552754310 7340 (setq SCCS-auxfns1 "@(#)auxfns1.l 1.1 10/3/80") ;--- msg - arg1 ... arguments of the form described below ; B - print out a blank ; N - print out a newline (terpr) ; (B n) - print out n blanks ; (P p) - henceforth print on port p ; atom - patom this exactly (no evaluation) ; other - evaluate and patom this expression. ; (def msg (macro (lis) `(progn ,@(msgmake (cdr lis) 'nil)))) (eval-when (eval compile load) (def msgmake (lambda (forms outport) ((lambda (thisform) (cond ((nu((ll forms) `((drain ,@outport))) ((and (eq 'B thisform) (setq thisform '" ") nil)) ((eq 'N thisform) (cons `(terpr ,@outport) (msgmake (cdr forms) outport))) ((atom thisform) (cons `(patom ',thisform ,@outport) (msgmake (cdr forms) outport))) ((eq 'P (car thisform)) (msgmake (cdr forms) `(,@(cdr thisform)))) ((eq 'B (car thisform)) (cons `(printblanks ,@(cdr thisform) ,outport) (msgmake (cdr forms) outport))) (t (cons `(patom ,thisform ,@outport) (msgmake (cdr forms) outport))))) (car forms))))) (def printblanks (lambda (n prt) (do ((i n (1- i))) ((lessp i 1)) (patom '" " prt)))) ; ============================================== ; ; (linelength [numb]) ; ; sets the linelength (actually just varib linel) to the ; number given: numb ; if numb is not given, the current line length is returned ; ================================================= (setq linel 80) (def linelength (nlambda (form) (cond ((null form) linel ) ((numberp (car form)) (setq linel (car form))) (t linel)))) ; ======================================== ; ; (charcnt port) ; returns the number of characters left on the current line ; on the given port ; ; ======================================= (def charcnt (lambda (port) (- linel (nwritn port)))) (def nthcdr (lambda (n x) (cond ((zerop n) x) ((lessp n 0) (cons nil x)) (t (nthcdr (1- n) (cdr x) ))))) (def nth (lambda (n x) (car (nthcdr n x)))) ;r lambda: (nthrest numb list) ;- args: numb - integer ;- list - list ;- returns:the rest of the list beginning at the numb'th element. ;- for convience, (nthrest 0 list) equals (nthrest 1 list) ;- equals list. This is designed to be similar to nthelem ;- which returns the nth element of a list. (def nthrest (lambda (number list) (cond ((lessp number 2) list) (t (nthrest (1- number) (cdr list)))))) ;;============================== ; (assqr val alist) ; acts much like assq, it looks for val in the cdr of elements of ; the alist and returns the element if found. ; fix this when the compiler works (eval-when nil (def assqr (lambda (val alist) (do ((al alist (cdr al))) ((null al) nil) (cond ((eq val (cdar al)) (return (car al)))))))) ; ==================== ; (listp 'x) is t if x is a non-atom or nil ; ==================== (def listp (lambda (val) (or (dtpr val) (null val)))) ;--- memcar - VAL : lispval ; - LIS : list ; returns t if VAL found as the car of a top level element. ;temporarily turn this off till the compiler can handle it. (eval-when nil (def memcar (lambda (a l) (do ((ll l (cdr ll))) ((null ll) nil) (cond ((equal (caar ll) a) (return (cdar ll)))))))) ; ================================= ; ; (memcdr 'val 'listl) ; ; the list listl is searched for a list ; with cdr equal to val. if found, the ; car of that list is returned. ; ================================== ;fix this when compiler works ok (eval-when nil (def memcdr (lambda (a l) (do ((ll l (cdr ll))) ((null ll) nil) (cond ((equal (cdar ll) a) (return (caar l)))))))) ;this looks like funcall, so we will just use it '(def apply* (nlambda ($x$) (eval (cons (eval (car $x$)) (cdr $x$))))) (putd 'apply* (getd 'funcall)) ; ======================================= ; pretty printer top level routine pp ; ; calling form- (pp arg1 arg2 ... argn) ; the args may be names of functions, atoms with associated values ; or output descriptors. ; if argi is: ; an atom - it is assumed to be a function name, if there is no ; function property associated with it,then it is assumed ; to be an atom with a value ; (P port)- port is the output port where the results of the ; pretty printing will be sent. ; poport is the default if no (P port) is given. ; (F fname)- fname is a file name to write the results in ; (A atmname) - means, treat this as an atom with a value, dont ; check if it is the name of a function. ; (declare (special $outport$ $fileopen$ )) ; printret is like print yet it returns the value printed, this is used ; by pp (def printret (macro ($l$) `(progn (print ,@(cdr $l$)) ,(cadr $l$)))) (def pp (nlambda ($xlist$) (prog ($outport$ $cur$ $fileopen$ $prl$ $atm$ funcdef) (setq $outport$ poport) ; default port ; check if more to do, if not close output file if it is ; open and leave toploop (cond ((null (setq $cur$ (car $xlist$))) (condclosefile) (return t))) (cond ((dtpr $cur$) (cond ((equal 'P (car $cur$)) ; specifying a port (condclosefile) ; close file if open (setq $outport$ (eval (cadr $cur$)))) ((equal 'F (car $cur$)) ; specifying a file (condclosefile) ; close file if open (setq $outport$ (outfile (cadr $cur$)) $fileopen$ t)) ((equal 'A (car $cur$)) ; declaring atomness (setq $atm$ t) (setq $cur$ (cadr $cur$)) (go midstuff)) ((eq 'V (car $cur$)) ; print value only (setq $atm$ 'value) (setq $cur$ (cadr $cur$)) (go midstuff)) (t (msg N "bad arg to pp: " (or $cur$)))) (go botloop))) midstuff ; process the atom or function (cond ((eq 'value $atm$) (setq $prl$ (eval $cur$))) ((or $atm$ (null (getd $cur$))) ; check if is atom (cond ((boundp $cur$) ; yes, see if bound (setq $prl$ (list 'setq $cur$ (list 'quote (eval $cur$))))) (t (msg N "pp: atom " (or $cur$) " is unbound") (go botloop)))) ((bcdp (setq funcdef (getd $cur$))) ; is a fcn, see if bcd (msg N "pp: function " (or $cur$) " is machine coded (bcd) ") (go botloop)) ((and (dtpr funcdef) (dtpr (cadr funcdef)) (memq (caadr funcdef) '(T-nargs T-arglist)) (setq $prl$ (list 'def $cur$ (get $cur$ 'original))))) (t (setq $prl$ (list 'def $cur$ funcdef)))) ; now print it ($prpr $prl$) (terpr $outport$) (setq $atm$ nil) ; clear flag botloop (setq $xlist$ (cdr $xlist$)) (go toploop)))) (def condclosefile (lambda nil (cond ($fileopen$ (terpr $outport$) (close $outport$) (setq $fileopen$ nil))))) ; ; these routines are meant to be used by pp but since ; some people insist on using them we will set $outport$ to nil ; as the default (setq $outport$ nil) (def $prpr (lambda (x) (cond ((not (boundp '$outport$)) (setq $outport$ poport))) (terpr $outport$) ($prdf x 0 0))) (declare (special m)) (def $prdf (lambda (l n m) (prog () ($tocolumn n) a (cond ((or (atom l) (lessp (+ m (flatc l (charcnt $outport$))) (charcnt $outport$))) (return (printret l $outport$))) ((and ($patom1 lpar) (lessp 2 (length l)) (atom (car l))) (prog (c f g h) (setq g (cond ((member (car l) '(lambda nlambda)) -7) (t 0))) (setq f (equal (printret (car l) $outport$) 'prog)) ($patom1 ' " ") (setq c ($dinc)) a ($prd1 (cdr l) (+ c (cond ((setq h (and f (cadr l) (atom (cadr l)))) -5) (t g)))) (cond ((cdr (setq l (cdr l))) (cond ((or (null h) (atom (cadr l))) (terpr $outport$))) (go a))))) ((prog (c) (setq c ($dinc)) a ($prd1 l c) (cond ((setq l (cdr l)) (terpr $outport$) (go a)))))) b ($patom1 rpar)))) (def $prd1 (lambda (l n) (prog () ($prdf (car l) n (cond ((null (setq l (cdr l))) (1+ m)) ((atom l) (setq n nil) (plus 4 m (pntlen l))) (t m))) (cond ((null n) ($patom1 ' " . ") (return (printret l $outport$))))))) (def $dinc (lambda () (- (linelength $outport$) (charcnt $outport$)))) (def $tocolumn (lambda (n) (cond ((greaterp (setq n (- n (nwritn $outport$))) 0) (do ((i 0 (1+ i))) ((eq i n)) (patom '" " $outport$)))))) ; ======================================== ; ; (charcnt port) ; returns the number of characters left on the current line ; on the given port ; ; ======================================= (def charcnt (lambda (port) (- linel (nwritn port)))) (def $patom1 (lambda (x) (patom x $outport$))) ) (- (linelength $outport$) (charcnt $outport$)))) (def $tocolumn (lambda (n) (cond ((greaterp (setq n (- n (nwritn $outport$))) 0) (do ((i 0 (1+ i))) ((eq i n)) (patom '" " $outport$))))))lib/lisp/auxfns1.o 664 0 33 14550 2552754320 7350 tXWZVjTФj.hЪԆWWVPPԆ1Ѩ ШPPѨ FШЪԆWWVPyPкЪWkWVPW1fxP@HPxPPPkШШЪԆ'PPЪԆW WVPPPкЪWWVP1ШЪTФPvP*кdԆWWVPЦjЦV1ѨQШ dЪԆ{PWmWVPaPкЪWSWVP?OШTЪԆW%WVPPPкЪWWVPXWZVjЪЏWWVPPBШ$ЪWWVѪ Ѫ#ЪPPnXWZVjи(P.jTФPxPP@JPxPPP Ф(и(Pи(P%XWZVи(P`UU~jW%WV`UUUXWZVպxjP@ ЪPajЏWWVPԆЪ7j j#jPPjкЦjЦV`XWZVjЪWnWVРP6XWZVjЏW(()WVPЪP7j j#jPPjкЦjЦVXWZVxjP@PШ,PjШ,PPPPXWZV||Uи0Ш0Ը0и4Ш4Ը4Uaи84jTФfWxWVи,P1PxP@01MШЪTФѦWCWVP-VfW%WVкTФWWVP41Ш<ЪTФѦWWVP2VfWWVкTФWWVP4и,01Ш@ЪTФѦWWVPVи, кTФhШDЪTФPvPШH dSУHfWhWVШLWWVЪPWWVfW:WV1;PѨH ЪWWVP1ժ  UE1ЪWWVPUШPЪШЪWWVPԆjPaPԆVPMPDPXfWWVШTW:WVЪPW#WVШXWWVfWDWV1E1UEЪPxPP@XfW WVШ\WWVЪPWWVШ`WWVfWWV1xP@cmкTФPxPP@LVФSУQШdPPFQ`P9ШhЪЪШlPԆ PPP*ШhЪЪԆPPPЪW!WVи4WWVԪ кj1>UХХUxXWZjVո0-и4WWVи4WWVԸ0и0PP4XWZVШ4W}WVPи84Pи4WNWVjЏЏWWWVXWZ VUиpШpЪpUЪW!WVxjP@PxPPPgиpP`UU~jи4WWVPWWV`UUUIPи4WWVPW6WVPjи4WWVjP1-иtWWVP1ЏjW~WVPWWVPjTФPxPP@PxPPP||jTФШxW5WVP ЏPЏPPjTФи4WWVjTФPPШ|ѦWiWVPԪVШ,ȀWWVfWWVP кк ~ժ1кTդ(ФPxPP@PxPPPԪШ,Ԫ ЏPЪP`UUUPWNWVкjjP`>ժ кTФPxPP@hPxPPPи4WWVP1IPVOԆfWWVP jЪ WWVкjи4WNWVPPVPP؄W|WVPUХUXWZVjTФЪdjѸp# иpPpPNxjP@zPxPPP2ԪЏиpjWWVPWWVиpPPWWVժ-ȈWWVjи4WWVjPPPXWZjVȌWWV`UU~и4W@WV`UUUXWZVк~и4WWV`UUUtPjjЏW  Y  6\%F00008linkertrantb_qcons_typetableF00018_qoneminusF00026F00031_qnewintF00033F00042F00044F00051F00060_bnp_qgetF00097F00101F00105F00136_qoneplusF00146F00148F00157F00159bind_orglinker_sizetrans_sizelit_orglit_endKT [bi,pgw|% > lib/lisp/backquote.l 444 0 33 10735 2552754305 7736 (setq SCCS-backquote "@(#)backquote.l 1.4 3/7/81") (setsyntax '\; 'splicing 'zapline) ;---- This file contains the definitions of the backquote and sharpsign ; character macros. [The backquote macro actually uses two characters, ; ` and ,] (setq **backquote** 1) (eval-when (eval) (cond ((null (getd 'declare)) (def declare (nlambda (l) nil))))) (declare (special **backquote**)) (def back-quote-ch-macro (lambda nil (back=quotify ((lambda (**backquote**) (read)) (1+ **backquote**))))) (def back-quote-comma-macro (lambda nil ((lambda (**backquote**) (cond ((zerop **backquote**) (error "comma not inside a backquote.")) ((eq (tyipeek) 64) (tyi) (cons '\,@ (read))) ((eq (tyipeek) 46) (tyi) (cons '\,\. (read))) (t (cons '\, (read))))) (1- **backquote**)))) (def back=quotify (lambda (x) ((lambda (a d aa ad dqp) (cond ((atom x) (list 'quote x)) ((eq (car x) '\,) (cdr x)) ((or (atom (car x)) (not (memq (caar x) '( \,@ \,\.)))) (setq a (back=quotify (car x)) d (back=quotify (cdr x)) ad (atom d) aa (atom a) dqp (and (not ad) (eq (car d) 'quote))) (cond ((and dqp (not (atom a)) (eq (car a) 'quote)) (list 'quote (cons (cadr a) (cadr d)))) ((and dqp (null (cadr d))) (list 'list a)) ((and (not ad) (eq (car d) 'list)) (cons 'list (cons a (cdr d)))) (t (list 'cons a d)))) ((eq (caar x) '\,@) (list 'append (cdar x) (back=quotify (cdr x)))) ((eq (caar x) '\,\.) (list 'nconc (cdar x)(back=quotify (cdr x)))) )) nil nil nil nil nil))) (putd '1+ (getd 'add1)) (putd '1- (getd 'sub1)) (setsyntax '\` 'macro 'back-quote-ch-macro) (setsyntax '\, 'macro 'back-quote-comma-macro) ;------- sharpsign macro, used for conditional assembly ;#O or #o reads sexp with ibase bound to 8. ;#+ makes exist if (STATUS FEATURE ) is T ;#- makes exist if (STATUS FEATURE ) is NIL ;#+(OR F1 F2 ...) makes exist of any one of F1,F2,... are in ; the (STATUS FEATURES) list. ;#+(AND F1 F2 ...) works similarly except all must be present in the list. ;#+(NOT ) is the same as #-. ;#/CHAR returns the numerical character code of CHAR. ;#\SYMBOL gets the numerical character code of non-printing characters. ;#' is to FUNCTION as ' is to QUOTE. ;#. evaluates at read time and leaves the result. ;#, evaluates at load time. Here it is the same as "#.". (declare (special franz-symbolic-character-names ibase)) (setsyntax '\# 'splicing 'sharp-sign-macro) (def sharp-sign-macro (lambda () ((lambda (char frob) (setq char (tyi)) (cond ((or (eq char 79.) ;O (eq char 111.)) ;o ((lambda (ibase) (list (read))) 8.)) ((eq char 43.) ;+ (setq frob (read)) (cond ((not (feature-present frob)) (read))) nil) ((eq char 45.) ;- (setq frob (read)) (cond ((feature-present frob) (read))) nil) ((eq char 47.) ;/ (list (tyi))) ;return numeric value of CHAR ;list because splicing ((eq char 94.) ; ^ returns following char (list (boole 1 31. (tyi)))) ; made into a control char ((eq char 39.) ;' (list (list 'function (read)))) ((or (eq char 44.) (eq char 46.)) ;, or . (list (eval (read)))) ((eq char 92.) ;\ (setq frob (read)) ;get symbolic name of character (setq char (cdr (assq frob franz-symbolic-character-names))) (or char (error '|Illegal character name in #\\| frob)) (list char)) (t (error '|Bad character after #| (ascii char))))) nil nil))) (defun feature-present (feature) (cond ((atom feature) (memq feature (status features))) ;damn fsubrs ((eq (car feature) 'not) (not (feature-present (cadr feature)))) ((eq (car feature) 'and) (do ((list (cdr feature) (cdr list))) ((null list) t) (cond ((not (feature-present (car list))) (return nil))))) ((eq (car fe((ature) 'or) (do ((list (cdr feature) (cdr list))) ((null list) nil) (cond ((feature-present (car list)) (return t))))) (t (error '|Unknown form after #+ or #-| feature)))) (setq franz-symbolic-character-names '((eof . -1) (bs . 8.) (backspace . 8.) (tab . 9.) (lf . 10.) (linefeed . 10.) (ff . 12.) (form . 12.) (return . 13.) (cr . 13.) (newline . 10.) (vt . 9.) (alt . 27.) (esc . 27.) (sp . 32.) (space . 32.) (rubout . 127.))) (return nil))))) ((eq (car felib/lisp/backquote.o 664 0 33 10305 2552754316 7740 h XWZjVѸ#иPPUиhjUfWWVUХUVPWWV|XWZjVѸ Ѹ#иPWPGUиhjU4иP`%xP@ ШWWV1fWWVP)fWWVШfWWVPYfWWVP)fWWVШ fWWVPШfW{WVPoiUХU[RXWZVԆԆԆԆԆxjP@5PxPPPШjԆP1JjTФPPdP17xP@PxPPPФSУQШPPQ1z`PjTФWWVPкWWVPxP@PxPPPԪШxP@ePxPPPԪ Ш ժЪTФPPԪШԪժWxP@PxPPP>ЪTФPP0ШкTФкSУPԆPժ$кTդШ ЪԆPVժ+ЪTФPP Ш ЪкPy&Ш$ЪЪԆcPZPQ1jTФSУPP7Ш(cdW0WVPԆPPCУPP 7Ш,cdWWVPԆPPPXWZjVԆԆfWWVPjj< jTЏ Uи0Ш0Ъ0UkfWaWVPԆSMUХU?V1j=fW&WVPЪW8WVPfWWVPP1j=fWWVPЪWWVPfWWVPP1jfWWVPԆ1^jx:ЏЏ|fWWVPWWVPԆI1j3Ш4fW/WVPԆ!PPԆ 1j j,fWWVPWWVPԆ1jprfWWVPЪи8ժ P#ЪЪ TФSУPvPSP Pк V`jjШ<ЪWqWVjԆS&Ш@jWWVPW>WV"XWZVxjP@PxPPP2jШDW8WVvQP Q `PPPPP1jTФPPH$dSУWWVPШPP1ѤL:dժиP'ЪTФWWVPP PкVVѤP:dժP)ЪTФW`WVPиP PкVШTTWWVccccccccc**backquote**"comma not inside a backquote.",@,\.,quote(,@ ,\.)tlistconsappendnconcibasefunctionfranz-symbolic-character-namesIllegal\ character\ name\ in\ #\\Bad\ character\ after\ #(features)notandorUnknown\ form\ after\ #+\ or\ #-readback=quotifyerrortyipeektyifeature-presentbooleevalasciistatus(setq SCCS-backquote "@(#)backquote.l 1.4 3/7/81")(setsyntax (quote ;) (quote splicing) (quote zapline))(setq **backquote** 1)back-quote-ch-macroback-quote-comma-macroback=quotify(putd (quote \1+) (getd (quote add1)))(putd (quote \1-) (getd (quote sub1)))(setsyntax (quote `) (quote macro) (quote back-quote-ch-macro))(setsyntax (quote ,) (quote macro) (quote back-quote-comma-macro))(setsyntax (quote #) (quote splicing) (quote sharp-sign-macro))sharp-sign-macrofeature-present(setq franz-symbolic-character-names (quote ((eof . -1) (bs . 8) (backspace . 8) (tab . 9) (lf . 10) (linefeed . 10) (ff . 12) (form . 12) (return . 13) (cr . 13) (newline . 10) (vt . 9) (alt . 27) (esc . 27) (sp . 32) (space . 32) (rubout . 127))))  / B L U c t         & 2 > T e q          K a u    ! * J S z          # , 5 B W |          2 C b p          - C        K     !(|/:ELS>Zajv 5e F00007linker_qoneplus_bnptrantbF00011_qoneminus_typetable_qconsF00021F00047F00070bind_orglinker_sizetrans_sizelit_orglit_end        - C        K     !(|/:ELS>Zalib/lisp/editor.l 444 0 33 34457 2552754314 7255 (setq SCCS-editor "@(#)editor.l 1.1 10/2/80") ; editor from bbn-lisp c. 1968 ; (transcribed by R. Fateman for UNIX LISP, Oct., 1977) ; (modified and enhanced by P. Pifer, May, 1978) ; (corrected again by R. Fateman for VAX Unix Lisp, Dec., 1978) ; (cleaned up, commented and compiled by J. Foderaro, Aug., 1979) ; ( ... fixed bug in ^ command) ; (declare (special edok em pf pl l)) (setq printflag t) ; print on by default (setq printlevel 3) (setq maxlevel 100) (setq findflag nil) (setq supereditflg t)(setq printflag t)(setq edrptcnt nil) ;--- remedit - removes all traces of the editor from the oblist. ; Note that if the editor is compiled, the code space ; will not be reclaimed ; (def remedit (lambda nil (prog nil (mapc (function (lambda (x) (set x nil))) '(editmacros findflag supereditflg edrptcnt printflag printlevel maxlevel)) (mapc (function (lambda (x) (putd x nil))) '(editf editv tconc eprint eprint1 printlevel dsubst editcoms edit1f edit2f edit2af edit4e editqf edit4e edit4f edit4f1 editnth bpnt bpnt0 subpair subpr ri ro li lo bi bo ldiff nthcdr attach edite editcom editdefault remedit)) (return 'gone)))) ;--- subst - a - newval ; - b : oldvall ; - c : string ; substitute a for b in c ; (def subst (lambda (a b c) (cond ((equal b c) a) ((atom c) c) (t (cons (subst a b (car c)) (subst a b (cdr c))))))) (def tconc (lambda (x p) (cond ((null (car p)) (rplacd p (car (rplaca p (list x))))) (t (rplacd p (cdr (rplacd (cdr p) (list x)))))))) ;--- printlevel - x : new value ; set the printlevel to x and return the old value ; [change this to prog1 ] ; (def printlevel (lambda (x) (prog (a) (setq a printlevel) (setq printlevel x) (return a)))) ;--- editf - funcname : name of function to edit ; - [cmds] : commands to apply right away ; This is the starting point in the editor. You specify the ; file you wish to edit and perhaps some initial commands to ; the editor. If the function is not machine coded you ; enter the editor. ; (def editf (nlambda (x) (prog (a c) (setq a (getd (car x))) (cond ((or (null a) (bcdp a)) (return '(not editable)))) (putd (car x) (car (edite a (cdr x) nil))) (return (car x))))) '(def dsubst (lambda (x y z) (prog nil (cond ((null z) (return z)) ((equal y (car z)) (rplaca z x) (go l))) (cond ((null (atom (car z))) (dsubst x y (car z)))) l (dsubst x y (cdr z)) (return z)))) ;--- dsubst - x : oldval ; - y : newval ; - z : form ; directly substitutes all occurances of x in form z with y. ; It uses rplaca and does not copy the structure. ; (def dsubst (lambda (x y z) (cond ((dptr z) (cond ((equal y (car z)) (rplaca (car z) x)) (t (dsubst x y (car z))))) (t z)) (dsubst x y (cdr z)) z)) (def editcoms (lambda (c) (mapc (function editcom) c))) (def edit1f (lambda (c l) (cond ((equal c 0) (cond ((null (cdr l)) (err nil)) (t (cdr l)))) ((greaterp c 0) (cond ((greaterp c (length (car l))) (err nil)) (t (cons (car (nthcdr (sub1 c) (car l) )) l)))) ((greaterp (times c -1) (length (car l))) (err nil)) (t (cons (car (nthcdr (plus (length (car l)) c) (car l) )) l))))) (def edit2f (lambda (c) (cond ((greaterp (car c) 0) (cond ((greaterp (car c) (length (car l))) (err nil)) (t (rplaca l (edit2af (sub1 (car c)) (car l) (cdr c) nil))))) ((or (equal (car c) 0) (null (cdr c)) (greaterp (times -1 (car c)) (length (car l)))) (err nil)) (t (rplaca l (edit2af (sub1 (times -1 (car c))) (car l) (cdr c) t)))))) (def edit2af (lambda (n x r d) (prog nil (cond ((null (equal n 0)) (rplacd (nthcdr (sub1 n) x) (nconc r (cond (d (nthcdr n x)) (t (nthcdr (add1 n) x )))))) (d (attach (car r) x) (rplacd x (nconc (cdr r) (cdr x)))) (r (rplaca x (car r)) (rplacd x (nconc (cdr r) (cdr x)))(() (t (print (list 'aha x)) (rplaca x (cadr x)) (rplacd x (cddr x)))) (return x)))) (def edit4e (lambda (x y) (cond ((equal x y) t) ((atom x) (eq x '&)) ((atom y) nil) ((edit4e (car x) (car y)) (or (eq (cadr x) '-) (edit4e (cdr x) (cdr y))))))) (def editqf (lambda (s) (prog (q1) (return (cond ((setq q1 (member s (cdar l))) (setq l (cons q1 l))) (t (edit4f s 'n) (cond ((not (atom s)) (setq l (cons (caar l) l)))))))))) (def edit4f (lambda (s n) (prog (ff ll x) (setq ll (cond ((eq n 'n) (cons (caar l) l)) (t l))) (setq x (car ll)) (setq ff (cons nil nil)) (cond ((and n (not (numberp n))) (setq n 1))) lp (cond ((edit4f1 s x maxlevel) (setq l (nconc (car ff) ll)) (return (car l))) ((null n) (err nil))) lp1 (setq x (car ll)) (cond ((null (setq ll (cdr ll))) (err nil)) ((and (setq x (member x (car ll))) (null (atom (setq x (cdr x))))) (go lp))) (go lp1)))) (def edit4f1 (lambda (s a lvl) (prog nil (cond ((null (greaterp lvl 0)) (return nil))) lp (cond ((atom a) (return nil)) ((and (edit4e s (car a)) (or (null n) (equal 0 (setq n (sub1 n))))) (return (tconc a ff))) ((and s (equal s (cdr a)) (or (null n) (equal 0 (setq n (sub1 n))))) (return (tconc a ff))) ((and n (edit4f1 s (car a) (sub1 lvl)) (equal 0 n)) (return (tconc (car a) ff)))) (setq a (cdr a)) (go lp)))) (def editnth (lambda (x n) (cond ((null (setq n (cond ((or (null (lessp n 0)) (greaterp (setq n (plus (length x) n 1)) 0)) (nthcdr (sub1 n) x))))) (err nil)) (t n)))) (def bpnt (lambda (x) (prog (y n) (cond ((equal 0 (car x)) (setq y (car l))) (t (setq y (car (editnth (car l) (car x)))))) (cond ((null (cdr x)) (setq n 3)) ((null (numberp (cadr x))) (go b1)) ((lessp (cadr x) 0) (setq n (plus (cadr x) 2))) (t (setq n (cadr x)))) (return (bpnt0 y 1 n)) b1 (err nil)))) (def bpnt0 (lambda (l n d) (prog (oldl) (setq oldl (printlevel (difference d n))) (cond ((atom (errset (eprint l) t)) (terpri) (terpri))) (printlevel oldl) (return nil)))) (def ro (lambda (n x) (prog (a) (setq a (editnth x n)) (cond ((or (null a) (atom (car a))) (err nil))) (rplacd (last (car a)) (cdr a)) (rplacd a nil)))) (def ri (lambda (m n x) (prog (a b) (setq a (editnth x m)) (setq b (editnth (car a) n)) (cond ((or (null a) (null b)) (err nil))) (rplacd a (nconc (cdr b) (cdr a))) (rplacd b nil)))) (def li (lambda (n x) (prog (a) (setq a (editnth x n)) (cond ((null a) (err nil))) (rplaca a (cons (car a) (cdr a))) (rplacd a nil)))) (def lo (lambda (n x) (prog (a) (setq a (editnth x n)) (cond ((or (null a) (atom (car a))) (err nil))) (rplacd a (cdar a)) (rplaca a (caar a))))) (def bi (lambda (m n x) (prog (a b) (setq b (cdr (setq a (editnth x n)))) (setq x (editnth x m)) (cond ((and a (null (greaterp (length a) (length x)))) (rplacd a nil) (rplaca x (cons (car x) (cdr x))) (rplacd x b)) (t (err nil)))))) (def bo (lambda (n x) (prog nil (setq x (editnth x n)) (cond ((atom (car x)) (err nil))) (rplacd x (nconc (cdar x) (cdr x))) (return (rplaca x (caar x)))))) (def subpair (lambda (x y z fl) (cond (fl (subpr x y (copy z))) ((subpr x y z))))) (def subpr (lambda (x y z) (prog (c d) (setq c x) (setq d y) loop (cond ((or (null c) (null d)) (return z)) (t (dsubst (car d) (car c) z) (setq c (cdr c)) (setq d (cdr d)) (go loop)))))) (def ldiff (lambda (x y) (prog (a b) (setq a x) (setq b nil) loop (cond ((equal a y) (return (reverse b))) ((null a) (return (err nil))) (t (setq b (cons (car a) b)) (setq a (cdr a)) (go loop)))))) (def editv (nlambda (editvx) (prog nil (set (car editvx) (car (edite (eval (car editvx)) (cdr editvx) nil))) (return (car editvx))))) (def nthcdr (lambda (n x) (cond ((equal n 0) x) ((lessp n 0) (cons nil x)) (t (nthcdr (sub1 n)(cdr x)))))) (def attach (lambda (x y) (prog (a) (setq a (cons (car y) (cdr y))) (rplaca y x) (rplacd y a) (return y)))) (def eprint (lambda (x) (print (eprint1 x printlevel)))) (def edite (lambda (x ops l) (prog (c m em edok copied pf pl) (cond ((null l) (setq l (list x)))) (setq em editmacros) (setq pf printflag) (setq pl 3) (cond (ops (cond ((dtpr (errset (mapc (function (lambda (x) (editcom (setq c x)))) ops) t)) (return (car (last l)))) (t (go b))))) (print 'edit) (cond (pf (terpri) (editcom 'p))) (setq pf printflag) ct (setq findflag nil) a (cond (edok (return (cdr edok)))) (terpri) (patom '*) (drain) (cond ((atom (errset (setq c (read)) t)) (go ct))) (cond ((dtpr (errset (editcom c) t)) (cond (pf (editcom 'p))) (setq pf printflag) (go a))) b (terpri) (print c) (patom '?) (terpri) (go ct)))) (def editdefault (lambda (x) (editcom (list 'f x 't)))) (def editcom (lambda (c) (prog (cc c2 c3 cl) a (cond (findflag (setq findflag nil) (editqf c)) ((numberp c) (setq l (edit1f c l))) ((atom c) (cond ((eq c 'ok) (setq ersetflg t) (setq edok (cons t (last l))) (return (setq pf nil))) ((eq c 'e) (setq ersetflg t) (print (eval (read))) (terpri)) ((eq c 'p) (setq pf nil) (bpnt0 (car l) 1 pl)) ((eq c 'pp) (setq pf nil) (terpri) (errset ($prpr (car l)) t) (terpri)) ((eq c 'mark) (setq m (cons l m))) ((eq c '^) (setq l (list (last l)))) ((eq c 'copy) (setq copied (copy l))) ((eq c 'restore) (setq l copied)) ((eq c '<) (cond (m (setq l (car m))) (t (err '"no marks")))) ((eq c '<<) (cond (m (setq l (car m)) (setq m (cdr m))) (t (err '"no marks")))) ((eq c 'poff) (setq pf nil) (setq printflag nil)) ((eq c 'pon) (setq pf t) (setq printflag t)) (t (cond ((and (setq cc (cond ((null (setq cc (assoc c em))) nil) ((cdr cc)))) (null (car cc))) (editcoms (copy cc))) (t (return (editdefault c))))))) ((numberp (setq cc (car c))) (edit2f c)) (t (setq c2 (cadr c)) (setq c3 (cond ((null (cddr c)) nil) ((car (cddr c))))) (setq cl (car l)) (cond ((eq cc 's) (set c2 (car (cond ((null (setq c c3)) l) ((equal c 0) l) (t (editnth cl c)))))) ((eq cc 'r) (dsubst c3 c2 cl)) ((eq cc 'e) (setq cc (eval c2)) (cond ((null (cddr c)) (print cc) (terpri))) (return cc)) ((eq cc 'i) (setq c (cons (cond ((atom c2) c2) (t (eval c2))) (mapcar (function eval) (cddr c)))) (go a)) ((eq cc 'n) (nconc cl (cdr c))) ((eq cc 'p) (bpnt (cdr c)) (setq pf nil)) ((eq cc 'f) (edit4f c2 c3)) ((eq cc 'nth) (setq l (cons (editnth cl c2) l))) ((member cc '(ri ro li lo bi bo)) (apply1 cc (append (cdr c) (list cl)))) ((member cc '(m d)) (setq cc (cond ((atom (setq cc c2)) (cons cc (cons nil (cddr c)))) (t (cons (car cc) (cddr c))))) (setq em (cons cc em)) (cond ((eq (car c) 'm) (setq editmacros (cons cc editmacros))))) ((eq cc 'pl) (cond ((lessp c2 1) (err nil)) (t (setq pl (add 1 c2))))) (t (cond ((or (null (setq cc (cond ((null (setq cc (assoc cc em))) nil) (t (cdr cc))))) (null (cond ((null cc) nil) (t (car cc))))) (return (editdefault c))) ((atom (car cc)) (editcoms (subst (cond ((null c) nil) ((cdr c))) (car cc) (cdr cc)))) (t (editcoms (subpair (car cc) (cdr c) (cdr cc) t)))))))) (return (car l))))) (def eprint1 (lambda (x lev) (cond ((atom x) x) ((equal 0 lev) '&) ((and (atom (cdr x)) (cdr x)) x) (t (mapcar (function (lambda (y) (eprint1 y (sub1 lev)))) x))))) (def assoc (lambda (e l) (cond ((null l) nil) ((equal e (caar l)) (car l)) (t (assoc e (cdr l)))))) (def apply1 (lambda (f l) (eval (cons f (mapcar '(lambda (z) (list 'quote z)) l))))) (def editp (nlambda (x) (prog (a b) (setq a (car x)) (edite (caar x)) (return a)))) (def makefile (nlambda (x) (prog (poport n f ff l df) (setq l (cons nil (cadr x))) (setq ff (eval (car x))) (setq poport (outfile (setq n (concatp 'mkfl)))) l1 (cond ((null (setq l (cdr l))) (go e1))) (setq f (car l)) (cond ((null f) (go l1)) ((null (setq df (getd f))) (go l1)) (t (setq df (list 'def f df)) ($prpr df) (terpri) (go l1))) e1 (close poport) (null (eval (cons 'exec (cons '/bin/mv (cons n (cons ff nil))))))))) (def appfile (nlambda (x) (prog (i poport n f ff l df) (setq l (cons nil (cadr x))) (setq ff (eval (car x))) (setq i (infile ff)) (setq poport (outfile (setq n (concatp 'apfl)))) l1 (cond ((eq (setq f (read i poport)) 'eof) (go l2)) (t ($prpr f) (terpri))) (go l1) l2 (cond ((null (setq l (cdr l))) (go e1))) (setq f (car l)) (cond ((null f) (go l2)) ((null (setq df (getd f))) (go l2)) (t (setq df (list 'def f df)) ($prpr df) (terpri) (go l2))) e1 (close poport) (null (eval (cons 'exec (cons '/bin/mv (cons n (cons ff nil(())))))))) (def exec (nlambda ($list) (prog ($handy) (setq $handy '"") loop (cond ((null $list) (return (eval (list 'process $handy)))) (t (setq $handy (concat (concat $handy (car $list)) '" ")) (setq $list (cdr $list)) (go loop)))))) (setq editmacros nil) ((null (setq df (getd f))) (go l2)) (t (setq df (list 'def f df)) ($prpr df) (terpri) (go l2))) e1 (close poport) (null (eval (cons 'exec (cons '/bin/mv (cons n (cons ff nillib/lisp/fix.doc 664 0 33 12454 2527227466 7071 FIXIT - A New MacLisp Debugger David S. Touretzky Carnegie-Mellon University (modified by Mitch Marcus for Franz Lisp) FIXIT is a debugging environment for MacLisp users doing program development. One of FIXIT's goals is to get the program running again as quickly as possible. The user is assisted in making changes to his functions "on the fly", i.e. in the midst of execution, and then computation is resumed. When it is not immediately obvious why an error has occurred or how the program got itself into its current state, FIXIT comes to the rescue by providing a powerful debugging loop in which the user can: examine the stack evaluate expressions in context enter stepping mode restart the computation at any point The result is that program errors can be located and fixed extremely rapidly, and with a minimum of frustration. How to call FIXIT: FIXIT is usually loaded by the .lisprc file as part of a user's standard initialization sequence. FIXIT may be loaded at any time by typing (fasl "/m2/c122/ucb/lib/lisp/fixit"). Within a program, you may enter a debug loop directly by putting in a call to (DEBUG) where you would normally put a call to BREAK. Also, within a break loop you may enter FIXIT by typing (DEBUG). If an argument is given to DEBUG, it is treated as a message to be printed before the debug loop is entered. Thus you can put (DEBUG |just before loop|) into a program to indicate what part of the program is being debugged. FIXIT Command Summary --------------------- TOP go to top of stack (latest expression) BOT go to bottom of stack (first expression) P show current expression (with ellipsis) PP show current expression in full WHERE give current stack position HELP types the abbreviated command summary found in /m2/c122/ucb/lib/lisp/fixit.help. H and ? work too. U go up one stack frame U n go up n stack frames U f go up to the next occurrence of function f U n f go up n occurrences of function f UP go up to the next user-written function UP n go up n user-written functions ...the DN and DNFN commands are similar, but go down ...instead of up. OK resume processing; continue after an error or debug loop REDO restart the computation with the current stack frame. The OK command is equivalent to TOP followed by REDO. REDO f restart the computation with the last call to function f. (The stack is searched downward from the current position.) STEP restart the computation at the current stack frame, but first turn on stepping mode. (Assumes Rich stepper is loaded.) RETURN e return from the current position in the computation with the value of expression e. BK.. print a backtrace. There are many backtrace commands, formed by adding suffixes to the BK command. "BK" gives a backtrace showing only user-written functions, and uses ellipsis. The BK command may be suffixed by one or more of the following modifiers: ..F.. show function names instead of expressions ..A.. show all functions/expressions, not just user-written ones ..V.. show variable bindings as well as functions/expressions ..E.. show everything in the expression, i.e. don't use ellipsis ..C.. go no further than the current position on the stack Some of the more useful combinations are BKFV, BKFA, and BKFAV. BK.. n show only n levels of the stack (starting at the top). (BK n counts only user functions; BKA n counts all functions.) BK.. f show stack down to first call of function f BK.. n f show stack down to nth call of function f ^LInteraction with TRACE: FIXIT knows about the standard Franz trace package, and tries to make tracing invisible while in the debug loop. However, because of the way TRACE works, it may sometimes be the case that the functions on the stack are really unINTERNed atoms that have the same name as a traced function. (This only happens when a function is traced WHEREIN another one.) FIXIT will call attention to TRACE's hackery by printing an appropriate tag next to these stack entries. Interaction with STEP: The Rich stepper may be invoked from within FIXIT via the STEP command. FIXIT initially turns off stepping when the debug loop is entered. If you step through a function and get an error, FIXIT will still be invoked normally. At any time during stepping, you may explicitly enter FIXIT via the "D" (debug) command. Multiple error levels: FIXIT will evaluate arbitrary LISP expressions in its debug loop. The evaluation is not done within an ERRSET, so, if an error occurrs, another invocation of the debugger can be made. When there are multiple errors on the stack, FIXIT displays a barrier symbol between each level that looks something like <------------UDF-->. The UDF in this case stands for UnDefined Function. Thus, the upper level debug loop was invoked by an undefined function error that occurred while in the lower loop. (This version of FIXIT for Franz lacks It also lacks the hooks into error and software interrupt handling of the CMU version, due to the continuing development of the Franz interrupt and error handling facility. Both features will probably reappear in the near future - Mitch Marcus) h level that looks something like <------------UDF-->. The UDF in this case stands for UnDefined Function. Thus, the upper level debug loop was invoked by an undefined function error that occurred while in the lib/lisp/fix.l 444 0 33 54472 2552754324 6555 (setq SCCS-fix "@(#)fix.l 1.2 7/9/81") ; vi: set lisp : (eval-when (compile eval) (or (get 'cmumacs 'version) (load 'cmumacs))) ; LWE 1/11/81 Hack hack.... ; ; LWE 1/11/81 Bet you didn't know this, but this won't work INTERPRETED, ; but Dave assures me it works compiled. (In MACLisp...) ; (declare (special cmd frame x cnt var init label part incr limit selectq)) (dv fixfns ((*** This is FIXIT written by David Touretzky and adapted to Franz by Don Cohen) (declare (special framelist rframelist interrupt-handlers handler-labels) (special prinlevel prinlength evalhook-switch traced-stuff) (special lastword piport hush-debug) (*fexpr editf step type)) (sstatus feature fixit) (*rset t) ER%tpl fixit debug debug-iter debug1 debug-bktrace debug-print debug-print1 debug-findcall debug-scanflist debug-scanstk debug-getframes debug-nextframe debug-upframe debug-dnframe debug-upfn debug-dnfn debug-showvar debug-nedit debug-insidep debug-findusrfn debug-findexpr debug-pop debug-where debug-sysp interrupt-handlers handler-labels (or (boundp 'traced-stuff) (setq traced-stuff nil)) (or (boundp 'evalhook-switch) (setq evalhook-switch nil)) (setq hush-debug nil))) (or (boundp 'traced-stuff) (setq traced-stuff nil)) (or (boundp 'evalhook-switch) (setq evalhook-switch nil)) (or (boundp 'debug-sysmode) (setq debug-sysmode nil)) (setq hush-debug nil) ; macro which should go somewhere else (*** This is FIXIT written by David Touretzky and adapted to Franz by Don Cohen) (declare (special framelist rframelist interrupt-handlers handler-labels) (special prinlevel prinlength evalhook-switch traced-stuff) (special lastword piport hush-debug debug-sysmode) (*fexpr editf step type)) (sstatus feature fixit) (*rset t) ; (jkf) it is not clear that you want this to take over on all errors, ; but the cmu people seem to want that. #+cmu (progn 'compile (dv ER%tpl fixit) (dv ER%all fixit) ; LWE 1/17/81 MAYBE THIS WILL FIX THIS code ) (def fixit (nlambda (l) (prog (piport) (do nil (nil) (eval (cons 'debug l)))))) (def debug (nlambda (params) (prog (cmd frame framelist rframelist nframe val infile) (setq infile t) (and evalhook-switch (step nil)) (setq rframelist (reverse (setq framelist (or (debug-getframes) (list (debug-scanstk '(nil) '(debug))))))) (setq frame (debug-findexpr (car framelist))) ;(tab 0) (cond ((and (car params) (not (eq (car params) 'edit))) (terpri) (princ '|;debug |) (princ params) (terpri) (go loop))) (debug-print1 frame nil) (terpri) (cond (hush-debug (setq hush-debu((g nil) (go loop)) ((not (memq 'edit params)) (go loop))) (drain nil) (princ '|type e to edit, to debug: |) (setq val (tyi)) (cond ((or (= val 69) (= val 101)) (and (errset (debug-nedit frame)) (setq cmd '(ok)) (go cmdr))) ((or (= val 78) (= val 110)) (terpri) (debug-pop))) loop (terpri) (princ ':) (cond ((null (setq cmd (lineread))) (reset))) cmdr (cond ((dtpr (car cmd)) (setq val (eval (car cmd) (cadddr frame))) (print val) (terpri) (go loop))) (setq nframe (debug1 cmd frame)) (and (not (atom nframe)) (setq frame nframe) (go loop)) (print (or nframe (car cmd))) (princ '" Huh? - type h for help") (go loop)))) (def debug-iter (macro (x) (cons 'prog (cons 'nil (cons 'loop (cons (list 'setq 'nframe (cadr x)) '((setq cnt (|1-| cnt)) (and (or (null nframe) (zerop cnt)) (return nframe)) (setq frame nframe) (go loop)))))))) (def debug1 (lambda (cmd frame) (prog (nframe val topframe cnt item) (setq topframe (car framelist)) (or (eq (typep (car cmd)) 'symbol) (return nil)) (and (eq (getchar (car cmd) 1) 'b) (eq (getchar (car cmd) 2) 'k) (return (debug-bktrace cmd frame))) (setq cnt (cond ((fixp (cadr cmd)) (cadr cmd)) ((fixp (caddr cmd)) (caddr cmd)) (t 1))) (and (< cnt 1) (setq cnt 1)) (setq item (cond ((symbolp (cadr cmd)) (cadr cmd)) ((symbolp (caddr cmd)) (caddr cmd)))) (and item (cond ((memq (car cmd) '(u up)) (setq cmd (cons 'ups (cdr cmd)))) ((memq (car cmd) '(d dn)) (setq cmd (cons 'dns (cdr cmd)))))) (selectq (car cmd) (top (debug-print1 (setq frame topframe) nil)) (bot (debug-print1 (setq frame (car rframelist)) nil)) (p (debug-print1 frame nil)) (pp ($prpr (caddr frame))) (where (debug-where frame)) (help (cond ((cdr cmd) (eval cmd)) (t (ty |/usr/lisp/doc/fixit.ref|)))) ((? h) (ty |/usr/lisp/doc/fixit.ref|)) ((go ok) (setq frame (debug-findexpr topframe)) (cond ((eq (caaddr frame) 'debug) (freturn (cadr frame) t)) (t (fretry (cadr frame) frame)))) (pop (debug-pop)) (step (setq frame (debug-findexpr frame)) (step t) (fretry (cadr (debug-dnframe frame)) frame)) (redo (and item (setq frame (debug-findcall item frame framelist))) (and frame (fretry (cadr frame) frame))) (return (setq val (eval (cadr cmd))) (freturn (cadr frame) val)) (edit (debug-nedit frame)) (editf (cond ((null item) (setq frame (or (debug-findusrfn (debug-nedit frame)) (car rframelist)))) ((dtpr (getd item)) (errset (funcall 'editf (list item)))) (t (setq frame nil)))) (u (debug-iter (debug-upframe frame)) (cond ((null nframe) (terpri) (princ '||))) (debug-print1 (setq frame (or nframe frame)) nil)) (d (setq nframe (or (debug-iter (debug-dnframe frame)) frame)) (debug-print1 nframe nil) (cond ((eq frame nframe) (terpri) (princ '||)) (t (setq frame nframe)))) (up (setq nframe (debug-iter (debug-upfn frame))) (cond ((null nframe) (terpri) (princ '|top of stack|))) (setq frame (or nframe topframe)) (debug-print1 frame nil)) (dn (setq frame (or (debug-iter (debug-dnfn frame)) (car rframelist))) (debug-print1 frame nil) (cond ((not (eq frame nframe)) (terpri) (princ '||)))) (ups (setq frame (debug-iter (debug-findcall item frame rframelist))) (and frame (debug-print1 frame nil))) (dns (setq frame (debug-iter (debug-findcall item frame framelist))) (and frame (debug-print1 frame nil))) (sys (setq debug-sysmode (not debug-sysmode)) (patom "sysmode now ")(patom debug-sysmode) (terpr)) (cond ((not (dtpr (car cmd))) (*** should there also be a boundp test here) (debug-showvar (car cmd) frame)) (t (setq frame (car cmd))))) (return (or frame item))))) (def debug-bktrace (lambda (cmd oframe) (prog (sel cnt item frame nframe) (mapc '(lambda (x) (setq sel (cons (selectq x (f 'fns) (a 'sysp) (v 'bind) (e 'expr) (c 'current) 'bogus) sel))) (cddr (explodec (car cmd)))) (setq item (cond ((eq (typep (cadr cmd)) 'symbol) (cadr cmd)) ((eq (typep (caddr cmd)) 'symbol) (caddr cmd)))) (cond ((debug-sysp item) (setq sel (cons 'sysp sel))) ((not (memq 'sysp sel)) (setq sel (cons 'user sel)))) (setq cnt (cond ((fixp (cadr cmd)) (cadr cmd)) ((fixp (caddr cmd)) (caddr cmd)) (item 1))) (cond ((null cnt) (setq frame (cond ((memq 'current sel) oframe) (t (car rframelist)))) (go dbpr)) ((null item) (setq frame (car framelist)) (and (or (not (memq 'user sel)) (atom (caddr (car framelist))) (not (debug-sysp (caaddr (car framelist))))) (setq cnt (|1-| cnt))) (setq frame (cond ((zerop cnt) frame) ((memq 'user sel) (debug-iter (debug-dnfn frame))) (t (debug-iter (debug-dnframe frame))))) (setq frame (or frame (car rframelist))) (go dbpr)) (t (setq frame (car framelist)))) (setq frame (cond ((and (= cnt 1) (not (atom (caddr (car framelist)))) (eq item (caaddr (car framelist)))) (car framelist)) ((debug-iter (debug-findcall item frame framelist))) (t (car rframelist)))) dbpr (debug-print frame sel oframe) (cond ((eq frame (car rframelist)) (terpri) (princ '||) (terpri)) (t (terpri))) (cond ((memq 'bogus sel) (terpri) (princ (car cmd)) (princ '| contains an invalid bk modifier|))) (return oframe)))) (def debug-print (lambda (frame sel ptr) (prog (curframe) (setq curframe (car framelist)) loop (cond ((not (and (memq 'user sel) (not (atom (caddr curframe))) (debug-sysp (caaddr curframe)))) (debug-print1 curframe sel) (and (eq curframe ptr) (princ '| <--- you are here|))) ((eq curframe ptr) (terpri) (princ '| <--- you are somewhere in here|))) (and (eq curframe frame) (return frame)) (setq curframe (debug-dnframe curframe)) (or curframe (return frame)) (go loop)))) (def debug-print1 (lambda (frame sel) (prog (prinlevel prinlength varlist) (and (not (memq 'expr sel)) (setq prinlevel 2) (setq prinlength 5)) (cond ((atom (caddr frame)) (terpri) (princ '| |) (print (caddr frame)) (princ '| <- eval error|) (return t))) (and (memq 'bind sel) (cond ((memq (caaddr frame) '(prog lambda)) (setq varlist (cadr (caddr frame)))) ((and (atom (caaddr frame)) (dtpr (getd (caaddr frame)))) (setq varlist (cadr (getd (caaddr frame)))))) (mapc (function (lambda (v) (debug-showvar v (or (debug-upframe frame) (( frame)))) (cond ((and varlist (atom varlist)) (ncons varlist)) (t varlist)))) (and (memq 'user sel) (debug-sysp (caaddr frame)) (return nil)) (cond ((memq (caaddr frame) interrupt-handlers) (terpri) (princ '<------------) (print (cadr (assq (caaddr frame) handler-labels))) (princ '-->)) ((eq (caaddr frame) 'debug) (terpri) (princ '<------debug------>)) ((memq 'fns sel) (terpri) (and (debug-sysp (caaddr frame)) (princ '| |)) (print (caaddr frame))) (t (terpri) (print (cond ((eq (car frame) 'eval) (caddr frame)) (t (cons (caaddr frame) (cadr (caddr frame)))))))) (or (not (symbolp (caaddr frame))) (eq (caaddr frame) (concat (caaddr frame))) (princ '| |)) (return t)))) (def debug-findcall (lambda (fn frame flist) (prog nil loop (setq frame (debug-nextframe frame flist nil)) (or frame (return nil)) (cond ((atom (caddr frame)) (cond ((eq (caddr frame) fn) (return frame)) (t (go loop)))) ((eq (caaddr frame) fn) (return frame)) (t (go loop)))))) (def debug-scanflist (lambda (frame fnset) (prog nil loop (or frame (return nil)) (and (not (atom (caddr frame))) (memq (caaddr frame) fnset) (return frame)) (setq frame (debug-dnframe frame)) (go loop)))) (def debug-scanstk (lambda (frame fnset) (prog nil loop (or frame (return nil)) (and (not (atom (caddr frame))) (memq (caaddr frame) fnset) (return frame)) (setq frame (evalframe (cadr frame))) (go loop)))) (def debug-getframes (lambda nil (prog (flist fnew) (setq fnew (debug-scanstk '(nil) (cons 'debug interrupt-handlers))) loop (and (not debug-sysmode) (not (atom (caddr fnew))) (eq (caaddr fnew) 'debug) (eq (car (evalframe (cadr fnew))) 'apply) (memq (caaddr (evalframe (cadr fnew))) interrupt-handlers) (setq fnew (evalframe (cadr fnew)))) (and (not debug-sysmode) (null flist) (eq (car fnew) 'apply) (memq (caaddr fnew) interrupt-handlers) (setq fnew (evalframe (cadr fnew)))) (and (not debug-sysmode) (eq (car fnew) 'apply) (eq (typep (caaddr fnew)) 'symbol) (not (eq (caaddr fnew) (concat (caaddr fnew)))) (setq fnew (evalframe (cadr fnew))) (setq fnew (evalframe (cadr fnew))) (setq fnew (evalframe (cadr fnew))) (setq fnew (evalframe (cadr fnew))) (go loop)) (and (not debug-sysmode) (not (atom (caddr fnew))) (memq (caaddr fnew) '(evalhook* evalhook)) (setq fnew (evalframe (cadr fnew))) (go loop)) (and (not debug-sysmode) (eq (car fnew) 'apply) (eq (caaddr fnew) 'eval) (cadadr (caddr fnew)) (or (not (fixp (cadadr (caddr fnew)))) (= (cadadr (caddr fnew)) -1)) (setq fnew (evalframe (cadr fnew))) (go loop)) (and fnew (setq flist (cons fnew flist)) (setq fnew (evalframe (cadr fnew))) (go loop)) (return (nreverse flist))))) (def debug-nextframe (lambda (frame flist sel) (prog nil (setq flist (cdr (memq frame flist))) (and (not (memq 'user sel)) (return (car flist))) loop (or flist (return nil)) (cond ((or (atom (caddr (car flist))) (not (debug-sysp (caaddr (car flist))))) (return (car flist)))) (setq flist (cdr flist)) (go loop)))) (def debug-upframe (lambda (frame) (debug-nextframe frame rframelist nil))) (def debug-dnframe (lambda (frame) (debug-nextframe frame framelist nil))) (def debug-upfn (lambda (frame) (debug-nextframe frame rframelist '(user)))) (def debug-dnfn (lambda (frame) (debug-nextframe frame framelist '(user)))) (def debug-showvar (lambda (var frame) (terpri) (princ '| |) (princ var) (princ '| = |) (print ((lambda (val) (cond ((atom val) '?) (t (car val)))) (errset (eval var (cadddr frame)) nil))))) (def debug-nedit (lambda (frame) (prog (val body elem nframe) (setq elem (caddr frame)) (setq val frame) scan (setq val (debug-findusrfn val)) (or val (go nofn)) (setq body (getd (caaddr val))) (cond ((debug-insidep elem body) (princ '=) (print (caaddr val)) (edite body (list 'f (cons '== elem) 'tty:) (caaddr val)) (return frame)) ((or (eq elem (caddr val)) (debug-insidep elem (caddr val))) (setq val (debug-dnframe val)) (go scan))) nofn (setq nframe (debug-dnframe frame)) (or nframe (go doit)) (and (debug-insidep elem (caddr nframe)) (setq frame nframe) (go nofn)) doit (edite (caddr frame) (and (debug-insidep elem (caddr frame)) (list 'f (cons '== elem) 'tty:)) nil) (return frame)))) (def debug-insidep (lambda (elem expr) (car (errset (edite expr (list 'f (cons '== elem)) nil))))) (def debug-findusrfn (lambda (frame) (cond ((null frame) nil) ((and (dtpr (caddr frame)) (symbolp (caaddr frame)) (dtpr (getd (caaddr frame)))) frame) (t (debug-findusrfn (debug-dnframe frame)))))) (def debug-findexpr (lambda (frame) (cond ((null frame) nil) ((and (eq (car frame) 'eval) (not (atom (caddr frame)))) frame) (t (debug-findexpr (debug-dnframe frame)))))) (def debug-pop (lambda nil (prog (frame) (setq frame (car framelist)) l (cond ((null (setq frame (evalframe (cadr frame))))(reset))) (cond ((and (dtpr (caddr frame))(eq (caaddr frame) 'debug)) (freturn (cadr frame) nil))) (go l)))) (def debug-where (lambda (frame) (prog (lev diff nframe) (setq lev (- (length framelist) (length (memq frame rframelist)))) (setq diff (- (length framelist) lev 1)) (debug-print1 frame nil) (terpri) (cond ((zerop diff) (princ '|you are at top of stack.|)) ((zerop lev) (princ '|you are at bottom of stack.|)) (t (princ '|you are |) (princ diff) (cond ((= diff 1) (princ '| frame from the top.|)) (t (princ '| frames from the top.|))))) (terpri) (and (or (atom (caddr frame)) (not (eq (car frame) 'eval))) (return nil)) (setq lev 0) (setq nframe frame) lp (and (setq nframe (debug-findcall (caaddr nframe) nframe framelist)) (setq lev (|1+| lev)) (go lp)) (princ '|there are |) (princ lev) (princ '| |) (princ (caaddr frame)) (princ '|'s below.|) (terpri)))) (def debug-sysp (lambda (x) (and (sysp x) (symbolp x) (not (dtpr (getd x)))))) (dv interrupt-handlers (fixit)) (dv handler-labels ((fixit error) (debug-ubv-handler ubv) (debug-udf-handler udf) (debug-fac-handler fac) (debug-ugt-handler ugt) (debug-wta-handler wta) (debug-wna-handler wna) (debug-iol-handler iol) (debug-*rset-handler rst) (debug-mer-handler mer) (debug-gcd-handler gcd) (debug-gcl-handler gcl) (debug-gco-handler gco) (debug-pdl-handler pdl))) (or (boundp 'traced-stuff) (setq traced-stuff nil)) (or (boundp 'evalhook-switch) (setq evalhook-switch nil)) (setq hush-debug nil) ;; other functions grabbed from other cmu files to make this file complete ;; unto itself ;- from sysfunc.l (defun build-sysp nil (do ((temp (oblist) (cdr temp)) (sysfuncs)) ((null temp)(setq system-functions\ sysfuncs));atom has ^G at end (cond ((getd (car temp)) (setq sysfuncs (cons (car temp) sysfuncs)))))) (defun sysp (x) ; (cond ((memq x system-functions\)t)) nil) ; lets assume nothing is a system function. (or (boundp 'system-functions\) (build-sysp)) (defun fretry (pdlpnt frame) (freturn pdlpnt (cond ((eq (car frame) 'eval) (eval (caddr frame) (cadddr frame))) ((eq (car frame) 'apply) (eval `(apply ',(caaddr frame) ',(cadaddr frame)) (cadddr frame)))))) ; - from cmu.l (def %lineread (lambda (chan) (prog (ans) loop (setq ans (cons (read chan 'EOF) ans)) (cond ((eq (car ans) 'EOF) (return (reverse (cdr ans))))) loop2(cond ((eq 10 (tyipeek chan)) (return (reverse ans))) ((memq (tyipeek chan) '(41 93)) (tyi chan) (go loop2)) (t (go loop)))))) d ((eq (car frame) 'eval) (eval (caddr frame) (cadddr frame))) ((eq (car frame) 'apply) (eval `(apply ',(caaddr frame) ',(cadaddr frame)) (cadddr frame)))))) ; - from cmu.l (def %linerlib/lisp/fix.ref 664 0 33 2037 2527227466 7054 (( u / u n / u f / u n f go up, i.e. more recent (n frames) (of function f) up / up n go up to next (nth) non-system function d / dn go down, i.e. less recent (opposite of u and up) ok / go continue after an error or debug loop redo / redo f resume computation from current frame (or at fn f) step restart in single-step mode return e return from call with value of e (default is nil) edit edit the current stack frame editf / editf f edit nearest fn on stack (or edit fn f) top / bot go to top (bottom) of stack p / pp show current stack frame (pretty print) where give current stack position help / h / ? print this table -- /usr/lisp/doc/fixit.ref help ... get the help for ... pop / ^d exit one level of debug (reset) bk / bk n / bk f / bk n f / backtrace (to nth frame) (of fn f) ..f function names only ..a include system functions ..v show variable bindings ..e show expressions in full ..c go no deeper than here *** combinations are allowed *** ----> see /usr/lisp/doc/fixit.doc for more FIXIT help. rent stack frame (pretty print) where give current stack position help / h / ? print this table -- /usr/lisp/doc/fixit.ref help ... get the help for ... pop / ^d exit one level of debug (reset) bk / bk n / bk f / bk n f / backtrace (to nth frame) (of fn f) ..f function names only ..a include system functions ..v show variable bindings ..e show expressions in full ..c go no deeper than here *** combinations are allowed *** ----> see /usr/lisp/doc/lib/lisp/jkfmacs.l 444 0 33 5573 2552754313 7361 (setq SCCS-jkfmacs "@(#)jkfmacs.l 1.3 7/9/81") ;------ jkfmacs :: common and useful macros ; (declare (macros t)) ; contents: ; If macro ; ;--- super if macro ; This macro allow the following forms: ; (If a then b) ==> (cond (a b)) ; (If a thenret) ==> (cond (a)) ; (If a then b else c) ==> (cond (a b) (t c)) ; (If a then b b2 ==> (cond (a b b2) (c d d2) (t e)) ; elseif c then d d2 ; else e) ; ; (defun If macro (lis) (prog (majlis minlis revl) (do ((revl (reverse lis) (cdr revl))) ((null revl)) (cond ((eq (car revl) 'else) (setq majlis `((t ,@minlis) ,@majlis) minlis nil)) ((or (eq (car revl) 'then) (eq (car revl) 'thenret)) (setq revl (cdr revl) majlis `((,(car revl) ,@minlis) ,@majlis) minlis nil)) ((eq (car revl) 'elseif)) ((eq (car revl) 'If) (setq majlis `(cond ,@majlis))) (t (setq minlis `( ,(car revl) ,@minlis))))) ; we displace the previous macro, that is we actually replace ; the if list structure with the corresponding cond, meaning ; that the expansion is done only once (rplaca lis (car majlis)) (rplacd lis (cdr majlis)) (return majlis))) ;--- msg : print a message consisting of strings and values ; arguments are: ; N - print a newline ; (N foo) - print foo newlines (foo is evaluated) ; B - print a blank ; (B foo) - print foo blanks (foo is evaluated) ; (P foo) - print following args to port foo (foo is evaluated) ; D - drain ; other - evaluate a princ the result (remember strings eval to themselves) (defmacro msg (&rest msglist) (do ((ll msglist (cdr ll)) (result) (cur nil nil) (curport nil) (current)) ((null ll) `(progn ,@(nreverse result))) (setq current (car ll)) (If (dtpr current) then (If (eq (car current) 'N) then (setq cur `(msg-tyo-char 10 ,(cadr current))) elseif (eq (car current) 'B) then (setq cur `(msg-tyo-char 32 ,(cadr current))) elseif (eq (car current) 'P) then (setq curport (cadr current)) else (setq cur `(princ ,current))) elseif (eq current 'N) then (setq cur (list 'tyo 10)) ; (can't use backquote elseif (eq current 'B) ; since must have new then (setq cur (list 'tyo 32)) ; dtpr cell at end) elseif (eq current 'D) then (setq cur '(drain)) else (setq cur `(princ ,current))) (If cur then (setq result (cons (If curport then (nconc cur (ncons curport)) else cur) result))))) (defun msg-tyo-char (ch n) (do ((i n (1- n))) ((< n 1)) (tyo ch))) ;--- standard push, unpush and pop macros ; (defmacro push (stack value) `(setq ,stack (cons ,value ,stack))) (defmacro unpush (stack) `(setq ,stack (cdr ,stack))) (defmacro pop (stack) `(prog1 (car stack) (setq ,stack (cdr ,stack)))) (putprop 'jkfmacs 1 'version) urrent))) (If cur then (setq result (cons (If curport then (nconc cur (ncons curport)) else cur) lib/lisp/jkfmacs.o 664 0 33 4611 2552754322 7360 8XWZV|ԆjWWVPժP1"ЪTФPPhKШЪԆWWVPPЪԆWWVPPԪ1ѤѤ SкЪTФЪԆWRWVP>PЪԆW2WVPPԪaЪTФPPSѤ'ШЪԆWWVPP%ФЪԆWWVPPк1VjЪTФQvPQjPк`ЪPXWZVкЪԆԆԆԆժ5ШЪ WaWVPԆWFWVP21ЪTФxP@1ЪSУPP /Ш$Ш(cRТԆPPPcѣ,/Ш$Ш0cRТԆPPP-ѣ4 cRТШ8SԆPwP}Ѫ "Ш<Џ(ԆWPNPTѪ,"Ш<ЏԆ.P%P+Ѫ@ШDШ8ЪԆPPժ?ժ#ЪЪԆPWWVЪPPЪ P PкԪv17XWZVЪѺP=jWWVѪ Ѫ#ЪPRP;XWZVкTФdSУШHЪШLЪЪԆPPPԆPPXWZVкTФШHЪШPЪԆPPԆPPyXWZVкTФШTШXШHЪШPЪԆIP@PԆ5P,P#PԆPPccelsetthenthenretelseifIfcondprognNmsg-tyo-char10B32PprinctyoD(drain)setqconscdrprog1(car stack)reverseappendnreversenconctyo(setq SCCS-jkfmacs "@(#)jkfmacs.l 1.3 7/9/81")Ifmsgmsg-tyo-charpushunpushpop(putprop (quote jkfmacs) 1 (quote version))  P \ p |       8 D {        D M V |        " 0 F e         # , T ] h q z            w'2a9DK(RYbny6F00007linkertrantb_qconsF00018_typetableF00036_qoneminusF00044F00046F00048bind_orglinker_sizetrans_sizelit_orglit_end       # , T ] h q z  lib/lisp/loop.l 444 0 33 107617 2527227471 6760 (setq |SCCS-loop| "@(#)loop.l 1.1 10/2/80") ;-*- Mode:LISP; Package:System-Internals; Base:8; Lowercase:T -*- ;The master copy of this file is on ML:LSB1;LOOP > ;The current Lisp machine copy is on AI:LISPM2;LOOP > ;The FASL and QFASL should also be accessible from LIBLSP; on all machines. ; Bugs/complaints/suggestions/solicitations-for-documentation to BUG-LOOP ; at any ITS site. ;; the file was franzified by JKF. ; ;;;; LOOP Iteration Macro ; Hack up the stuff for data-types. DATA-TYPE? will always be a macro ; so that it will not require the data-type package at run time if ; all uses of the other routines are conditionalized upon that value. (defmacro data-type? (x) `(get ,x ':data-type)) (declare (*lexpr variable-declarations) (*expr initial-value form-wrapper)) ;Loop macro (eval-when (eval compile) (defun lexpr-funcall macro (x) `(apply ,(cadr x) (list* . ,(cddr x))))) (defun loop-displace (x y) ((lambda (val) (rplaca x (car val)) (rplacd x (cdr val)) x) (cond ((atom y) (list 'progn y)) (t y)))) (defmacro loop-finish () '(go end-loop)) (defun neq macro (x) `(not (eq . ,(cdr x)))) (defun loop-make-psetq (frobs) (loop-make-setq (car frobs) (cond ((null (cddr frobs)) (cadr frobs)) (t `(prog1 ,(cadr frobs) ,(loop-make-psetq (cddr frobs))))))) (defmacro loop-psetq (&rest frobs) (loop-make-psetq frobs)) (defvar loop-keyword-alist ;clause introducers '( (initially loop-do-initially) (finally loop-do-finally) (do loop-do-do) (d((oing loop-do-do) (return loop-do-return) (collect loop-do-collect list) (collecting loop-do-collect list) (append loop-do-collect append) (appending loop-do-collect append) (nconc loop-do-collect nconc) (nconcing loop-do-collect nconc) (count loop-do-collect count) (counting loop-do-collect count) (sum loop-do-collect sum) (summing loop-do-collect sum) (maximize loop-do-collect max) (minimize loop-do-collect min) (always loop-do-always t) (never loop-do-always nil) (thereis loop-do-thereis) (while loop-do-while or) (until loop-do-while and) (when loop-do-when nil) (unless loop-do-when t) (with loop-do-with) (for loop-do-for) (as loop-do-for))) (defvar loop-for-keyword-alist ;Types of FOR '( (= loop-for-equals) (in loop-for-in) (on loop-for-on) (from loop-for-arithmetic nil) (downfrom loop-for-arithmetic down) (upfrom loop-for-arithmetic up) (being loop-for-being))) (defvar loop-path-keyword-alist nil) ; PATH functions (defvar loop-variables) ;Variables local to the loop (defvar loop-declarations) ; Local dcls for above (defvar loop-variable-stack) (defvar loop-declaration-stack) (defvar loop-prologue) ;List of forms in reverse order (defvar loop-body) ;.. (defvar loop-after-body) ;.. for FOR steppers (defvar loop-epilogue) ;.. (defvar loop-after-epilogue) ;So COLLECT's RETURN comes after FINALLY (defvar loop-conditionals) ;If non-NIL, condition for next form in body ;The above is actually a list of entries of the form ;(condition forms...) ;When it is output, each successive condition will get ;nested inside the previous one, but it is not built up ;that way because you wouldn't be able to tell a WHEN-generated ;COND from a user-generated COND. (defvar loop-when-it-variable) ;See LOOP-DO-WHEN (defvar loop-collect-cruft) ; for multiple COLLECTs (etc) (defvar loop-source-code) (defvar loop-attachment-transformer ; see attachment definition (cond ((status feature lms) 'progn) (t nil))) (defun loop-lookup-keyword macro (x) `(assq . ,(cdr x))) (defun loop-add-keyword (cruft alist-name) (let ((val (symeval alist-name)) (known?)) (and (setq known? (loop-lookup-keyword (car cruft) val)) (set alist-name (delq known? val))) (set alist-name (cons cruft val)))) (defmacro define-loop-macro (keyword) (or (eq keyword 'loop) (loop-lookup-keyword keyword loop-keyword-alist) (error "lisp: Not a loop keyword -- " keyword)) `(eval-when (compile load eval) (putd ',keyword '(macro (macroarg) (loop-translate macroarg))))) (define-loop-macro loop) (defun loop-translate (x) (loop-displace x (loop-translate-1 x))) (defun loop-translate-1 (loop-source-code) (and (eq (car loop-source-code) 'loop) (setq loop-source-code (cdr loop-source-code))) (do ((loop-variables nil) (loop-declarations nil) (loop-variable-stack nil) (loop-declaration-stack nil) (loop-prologue nil) (loop-body nil) (loop-after-body nil) (loop-epilogue nil) (loop-after-epilogue nil) (loop-conditionals nil) (loop-when-it-variable nil) (loop-collect-cruft nil) (keyword) (tem)) ((null loop-source-code) (and loop-conditionals (error "lisp: hanging conditional in loop macro -- " (caar loop-conditionals))) (cond (loop-variables (push loop-variables loop-variable-stack) (push loop-declarations loop-declaration-stack))) (setq tem `(prog () ,@(nreverse loop-prologue) next-loop ,@(nreverse loop-body) ,@(nreverse loop-after-body) (go next-loop) end-loop ,@(nreverse loop-epilogue) ,@(nreverse loop-after-epilogue))) (do ((vars) (dcls)) ((null loop-variable-stack)) (setq vars (pop loop-variable-stack) dcls (pop loop-declaration-stack)) (and dcls (setq dcls `((declare . ,(nreverse dcls))))) (setq tem `(,@dcls ,tem)) (cond ((do ((l vars (cdr l))) ((null l) nil) (and (not (atom (car l))) (not (atom (caar l))) (return t))) (setq tem `(let ,(nreverse vars) ,.tem))) (t (let ((lambda-vars nil) (lambda-vals nil)) (do ((l vars (cdr l)) (v)) ((null l)) (cond ((atom (setq v (car l))) (push v lambda-vars) (push nil lambda-vals)) (t (push (car v) lambda-vars) (push (cadr v) lambda-vals)))) (setq tem `((lambda ,(nreverse lambda-vars) ,.tem) ,.(nreverse lambda-vals)))))) ) tem) (if (symbolp (setq keyword (pop loop-source-code))) (if (setq tem (loop-lookup-keyword keyword loop-keyword-alist)) (apply (cadr tem) (cddr tem)) (error "lisp: unknown keyword in loop macro -- " keyword)) (error "lisp: loop found object where keyword expected -- " keyword)))) (defun loop-bind-block () (cond ((not (null loop-variables)) (push loop-variables loop-variable-stack) (push loop-declarations loop-declaration-stack) (setq loop-variables nil loop-declarations nil)) (loop-declarations (break barf)))) ;Get FORM argument to a keyword. Read up to atom. PROGNify if necessary. (defun loop-get-form () (do ((forms (list (pop loop-source-code)) (cons (pop loop-source-code) forms)) (nextform (car loop-source-code) (car loop-source-code))) ((atom nextform) (if (null (cdr forms)) (car forms) (cons 'progn (nreverse forms)))))) (defun loop-make-setq (var-or-pattern value) (list (if (atom var-or-pattern) 'setq 'desetq) var-or-pattern value)) (defun loop-imply-type (expression type &aux (frob (and (data-type? type) (form-wrapper type expression)))) (cond ((not (null frob)) frob) (t expression))) (defun loop-make-variable (name initialization dtype) (cond ((null name) (and initialization (push (list nil initialization) loop-variables))) ((atom name) (cond ((data-type? dtype) (setq loop-declarations (append (variable-declarations dtype name) loop-declarations)) (or initialization (setq initialization (initial-value dtype)))) ((memq dtype '(fixnum flonum number)) (or initialization (setq initialization (if (eq dtype 'flonum) 0.0 0))))) (push (if initialization (list name initialization) name) loop-variables)) (initialization (push (list name initialization) loop-variables) (loop-declare-variable name dtype)) (t (let ((tcar) (tcdr)) (cond ((atom dtype) (setq tcar (setq tcdr dtype))) (t (setq tcar (car dtype) tcdr (cdr dtype)))) (loop-make-variable (car name) nil tcar) (loop-make-variable (cdr name) nil tcdr)))) name) (defun loop-declare-variable (name dtype) (cond ((or (null name) (null dtype)) nil) ((atom name) (cond ((data-type? dtype) (setq loop-declarations (append (variable-declarations dtype name) loop-declarations))) )) ((atom dtype) (loop-declare-variable (car name) dtype) (loop-declare-variable (cdr name) dtype)) (t (loop-declare-variable (car name) (car dtype)) (loop-declare-variable (cdr name) (cdr dtype))))) (defun loop-maybe-bind-form (form data-type?) (cond ((or (numberp form) (memq form '(t nil)) (and (not (atom form)) (eq (car form) 'quote))) form) (t (loop-make-variable (gensym) form data-type?)))) (defun loop-optional-type () (let ((token (car loop-source-code))) (and (not (null token)) (or (not (atom token)) (data-type? token) (memq token '(fixnum flonum number))) (pop loop-source-code)))) ;Compare two "tokens". The first is the frob out of LOOP-SOURCE-CODE, ;the second a string (lispm) or symbol (maclisp) to check against. (defmacro loop-tequal (x1 x2) `(eq ,x1 ,x2)) ;Incorporates conditional if necessary (defun loop-emit-body (form) (cond (loop-conditionals (rplacd (last (car (last loop-conditionals))) (cond ((and (not (atom form)) ;Make into list of forms (eq (car form) 'progn)) (append (cdr form) nil)) (t (list form)))) (cond ((loop-tequal (car loop-source-code) "and") (pop loop-source-code)) (t ;Nest up the conditionals and output them (do ((prev (car loop-conditionals) (car l)) (l (cdr loop-conditionals) (cdr l))) ((null l)) (rplacd (last prev) `((cond ,(car l))))) (push `(cond ,(car loop-conditionals)) loop-body) (setq loop-conditionals nil)))) (t (push form loop-body)))) (defun loop-do-initially () (push (loop-get-form) loop-prologue)) (defun loop-do-finally () (push (loop-get-form) loop-epilogue)) (defun loop-do-do () (loop-emit-body (loop-get-form))) (defun loop-do-return () (loop-emit-body `(return ,(loop-get-form)))) (defun loop-do-collect (type) (let ((var) (form) (tem) (tail) (dtype) (cruft) (rvar) (ctype (cond ((memq type '(max min)) 'maxmin) ((memq type '(nconc list append)) 'list) ((memq type '(count sum)) 'sum) (t (error "lisp: unrecognized loop collecting keyword -- " type))))) (setq form (loop-get-form) dtype (loop-optional-type)) (cond ((loop-tequal (car loop-source-code) 'into) (pop loop-source-code) (setq rvar (setq var (pop loop-source-code))))) ; CRUFT will be (varname ctype dtype var tail (optional tem)) (cond ((setq cruft (assq var loop-collect-cruft)) (cond ((not (eq ctype (car (setq cruft (cdr cruft))))) (error "lisp: incompatible loop collections -- " (list ctype (car cruft)))) ((and dtype (not (eq dtype (cadr cruft)))) (error "lisp: loop found unequal types in collector -- " (list type (list dtype (cadr cruft)))))) (setq dtype (car (setq cruft (cdr cruft))) var (car (setq cruft (cdr cruft))) tail (car (setq cruft (cdr cruft))) tem (cadr cruft)) (and (eq ctype 'maxmin) (not (atom form)) (null tem) (rplaca (cdr cruft) (setq tem (loop-make-variable (gensym) nil dtype))))) (t (and (null dtype) (setq dtype (cond ((eq type 'count) 'fixnum) ((memq type '(min max sum)) 'number)))) (or var (push `(return ,(setq var (gensym))) loop-after-epilogue)) (loop-m((ake-variable var nil dtype) (setq tail (cond ((eq ctype 'list) (setq tem (loop-make-variable (gensym) nil nil)) (loop-make-variable (gensym) nil nil)) ((eq ctype 'maxmin) (or (atom form) (setq tem (loop-make-variable (gensym) nil dtype))) (loop-make-variable (gensym) nil nil)))) (push (list rvar ctype dtype var tail tem) loop-collect-cruft))) (loop-emit-body (selectq type (count (setq tem `(setq ,var (1+ ,var))) (cond ((eq form t) tem) (t `(and ,form ,tem)))) (sum `(setq ,var (plus ,(loop-imply-type form dtype) ,var))) ((max min) `(setq ,@(and tem (prog1 `(,tem ,form) (setq form tem))) ,var (cond (,tail (,type ,(loop-imply-type form dtype) ,var)) (t (setq ,tail t) ,form)))) (list `(setq ,tem (ncons ,form) ,tail (cond (,tail (cdr (rplacd ,tail ,tem))) ((setq ,var ,tem)))) ) (nconc `(setq ,tem ,form ,tail (last (cond (,tail (rplacd ,tail ,tem)) ((setq ,var ,tem)))))) (append `(setq ,tem (append ,form nil) ,tail (last (cond (,tail (rplacd ,tail ,tem)) ((setq ,var ,tem)))))))))) (defun loop-do-while (cond) (loop-emit-body `(,cond ,(loop-get-form) (go end-loop)))) (defun loop-do-when (negate?) (let ((form (loop-get-form)) (cond)) (cond ((loop-tequal (cadr loop-source-code) 'it) ;WHEN foo RETURN IT and the like (or loop-when-it-variable (setq loop-when-it-variable (loop-make-variable (gensym) nil nil))) (setq cond `(setq ,loop-when-it-variable ,form)) (setq loop-source-code ;Plug in variable for IT (list* (car loop-source-code) loop-when-it-variable (cddr loop-source-code)))) (t (setq cond form))) (and negate? (setq cond `(not ,cond))) (setq loop-conditionals (nconc loop-conditionals (ncons (list cond)))))) (defun loop-do-with () (do ((var) (equals) (val) (dtype)) (nil) (setq var (pop loop-source-code) equals (car loop-source-code)) (cond ((loop-tequal equals '=) (pop loop-source-code) (setq val (pop loop-source-code) dtype nil)) ((or (loop-tequal equals 'and) (loop-lookup-keyword equals loop-keyword-alist)) (setq val nil dtype nil)) (t (setq dtype (pop loop-source-code) equals (car loop-source-code)) (cond ((loop-tequal equals '=) (pop loop-source-code) (setq val (pop loop-source-code))) ((and (not (null loop-source-code)) (not (loop-lookup-keyword equals loop-keyword-alist)) (not (loop-tequal equals 'and))) (error "lisp: loop was expecting = but found " equals)) (t (setq val nil))))) (loop-make-variable var val dtype) (cond ((not (loop-tequal (car loop-source-code) 'and)) (return nil)) ((pop loop-source-code)))) (loop-bind-block)) (defun loop-do-always (true) (let ((form (loop-get-form))) (or true (setq form `(not ,form))) (loop-emit-body `(or ,form (return nil))) (push '(return t) loop-after-epilogue))) ;THEREIS expression ;If expression evaluates non-nil, return that value. (defun loop-do-thereis () (let ((var (loop-make-variable (gensym) nil nil)) (expr (loop-get-form))) (loop-emit-body `(and (setq ,var ,expr) (return ,var))))) ;FOR variable keyword ..args.. {AND more-clauses} ;For now AND only allowed with the = keyword (defun loop-do-for () (and loop-conditionals (error "lisp: loop for or as starting inside of conditional")) (do ((var) (data-type?) (keyword) (first-arg) (tem) (pretests) (posttests) (inits) (steps)) (nil) (setq var (pop loop-source-code) data-type? (loop-optional-type) keyword (pop loop-source-code) first-arg (pop loop-source-code)) (and (or (not (symbolp keyword)) (null (setq tem (loop-lookup-keyword keyword loop-for-keyword-alist)))) (error "lisp: unknown keyword in for or as loop clause -- " keyword)) (setq tem (lexpr-funcall (cadr tem) var first-arg data-type? (cddr tem))) (and (car tem) (push (car tem) pretests)) (setq inits (nconc inits (append (car (setq tem (cdr tem))) nil))) (and (car (setq tem (cdr tem))) (push (car tem) posttests)) (setq steps (nconc steps (append (car (setq tem (cdr tem))) nil))) (cond ((not (loop-tequal (car loop-source-code) 'and)) (cond ((cdr (setq pretests (nreverse pretests))) (push 'or pretests)) (t (setq pretests (car pretests)))) (cond ((cdr (setq posttests (nreverse posttests))) (push 'or posttests)) (t (setq posttests (car posttests)))) (and pretests (push `(and ,pretests (go end-loop)) loop-body)) (and inits (push (loop-make-psetq inits) loop-body)) (and posttests (push `(and ,posttests (go end-loop)) loop-after-body)) (and steps (push (loop-make-psetq steps) loop-after-body)) (loop-bind-block) (return nil)) (t (pop loop-source-code))))) (defun loop-for-equals (var val data-type?) (cond ((loop-tequal (car loop-source-code) 'then) ;FOR var = first THEN next (pop loop-source-code) (loop-make-variable var val data-type?) (list nil nil nil `(,var ,(loop-get-form)))) (t (loop-make-variable var nil data-type?) (list nil `(,var ,val) nil nil)))) (defun loop-for-on (var val data-type?) (let ((step (if (loop-tequal (car loop-source-code) 'by) (progn (pop loop-source-code) (pop loop-source-code)) '(function cdr))) (var1 (cond ((not (atom var)) ; Destructuring? Then we can't use VAR as the ; iteration variable. (loop-make-variable var nil nil) (loop-make-variable (gensym) val nil)) (t (loop-make-variable var val nil) var)))) (setq step (cond ((or (atom step) (not (memq (car step) '(quote function)))) `(funcall ,(loop-make-variable (gensym) step nil) ,var1)) (t (list (cadr step) var1)))) (list `(null ,var1) (and (not (eq var var1)) `(,var ,var1)) nil `(,var1 ,step)))) (defun loop-for-in (var val data-type?) (let ((var1 (gensym)) ;VAR1 is list, VAR is element (step (if (loop-tequal (car loop-source-code) 'by) (progn (pop loop-source-code) (pop loop-source-code)) '(function cdr)))) (loop-make-variable var1 val nil) (loop-make-variable var nil data-type?) (setq step (cond ((or (atom step) (not (memq (car step) '(quote function)))) `(funcall (loop-make-variable (gensym) step nil) var1)) (t (list (cadr step) var1)))) (list `(null ,var1) `(,var (car ,var1)) nil `(,var1 ,step)))) (defun loop-for-arithmetic (var val data-type? forced-direction) (let ((limit) (step 1) (test) (direction) (eval-to-first t) (inclusive)) (do () (nil) (cond ((not (symbolp (car loop-source-code))) (return nil)) ((loop-tequal (car loop-source-code) 'by) (pop loop-source-code) (setq step (loop-get-form) eval-to-first t)) ((loop-tequal (car loop-source-code) 'to) (pop loop-source-code) (setq limit (loop-get-form) inclusive t eval-to-first nil)) ((loop-tequal (car loop-source-code) 'downto) (pop loop-source-code) (setq limit (loop-get-form) inclusive t eval-to-first nil direction 'down)) ((loop-tequal (car loop-source-code) 'below) (pop loop-source-code) (setq limit (loop-get-form) direction 'up eval-to-first nil)) ((loop-tequal (car loop-source-code) 'above) (pop loop-source-code) (setq limit (loop-get-form) direction 'down eval-to-first nil)) (t (return nil)))) (cond ((null direction) (setq direction (or forced-direction 'up))) ((and forced-direction (not (eq forced-direction direction))) (error "lisp: loop variable stepping lossage with " var))) (or data-type? (setq data-type? 'fixnum)) (and (eq data-type? 'flonum) (fixp step) (setq step (float step))) (loop-make-variable var val data-type?) (cond ((and limit eval-to-first) (setq limit (loop-maybe-bind-form limit data-type?)))) (setq step (loop-maybe-bind-form step data-type?)) (cond ((and limit (not eval-to-first)) (setq limit (loop-maybe-bind-form limit data-type?)))) (cond ((not (null limit)) (let ((z (list var limit))) (setq test (cond ((eq direction 'up) (cond (inclusive `(greaterp . ,z)) (t `(not (lessp . ,z))))) (t (cond (inclusive `(lessp . ,z)) (t `(not (greaterp . ,z)))))))))) (setq step (cond ((eq direction 'up) (cond ((equal step 1) `(add1 ,var)) (t `(plus ,var ,step)))) ((equal step 1) `(sub1 ,var)) (t `(difference ,var ,step)))) ;; The object of the following crock is to get the INTERPRETER to ;; do error checking. This is only correct for data-type of FIXNUM, ;; since floating-point arithmetic is contagious. #M (and (eq data-type? 'fixnum) (rplaca step (cdr (assq (car step) '((sub1 . 1-) (add1 . 1+) (plus . +) (difference . -)))))) (list test nil nil `(,var ,step)))) (defun loop-for-being (var val data-type?) ; FOR var BEING something ... - var = VAR, something = VAL. ; If what passes syntactically for a pathname isn't, then ; we trap to the ATTACHMENTS path; the expression which looked like ; a path is given as an argument to the IN preposition. If ; LOOP-ATTACHMENT-TRANSFORMER is not NIL, then we call that on the ; "form" to get the actual form; otherwise, we quote it. Thus, ; by default, FOR var BEING EACH expr OF expr-2 ; ==> FOR var BEING ATTACHMENTS IN 'expr OF expr-2. (let ((tem) (inclusive?) (ipps) (each?) (attachment)) (cond ((loop-tequal val "each") (setq each? t val (car loop-source-code))) (t (push val loop-source-code))) (cond ((and (setq tem (loop-lookup-keyword val loop-path-keyword-alist)) (or each? (not (loop-tequal (cadr loop-source-code) 'and)))) ;; FOR var BEING {each} path {prep expr}..., but NOT ;; FOR var BEING var-which-looks-like-path AND {ITS} ... (pop loop-source-code)) (t (setq val (loop-get-form)) (cond ((loop-tequal (car loop-source-code) 'and) ;; FOR var BEING value AND ITS path-or-ar (( (or (null each?) (error "lisp: malformed being clause in loop of var " var)) (setq ipps `((of ,val)) inclusive? t) (pop loop-source-code) (or (loop-tequal (setq tem (pop loop-source-code)) 'its) (loop-tequal tem 'his) (loop-tequal tem 'her) (loop-tequal tem 'their) (loop-tequal tem 'each) (error "lisp: loop expected its or each but found " tem)) (cond ((setq tem (loop-lookup-keyword (car loop-source-code) loop-path-keyword-alist)) (pop loop-source-code)) (t (push (setq attachment `(in ,(loop-get-form))) ipps)))) ((not (setq tem (loop-lookup-keyword (car loop-source-code) loop-path-keyword-alist))) ; FOR var BEING {each} a-r ... (setq ipps (list (setq attachment (list 'in val))))) (t ; FOR var BEING {each} pathname ... ; Here, VAL should be just PATHNAME. (pop loop-source-code))))) (cond ((not (null tem))) ((not (setq tem (loop-lookup-keyword 'attachments loop-path-keyword-alist))) (error "lisp: loop trapped to attachments path illegally")) (t (or attachment (break barf)) (rplaca (cdr attachment) (cond (loop-attachment-transformer (funcall loop-attachment-transformer (cadr attachment))) (t (list 'quote (cadr attachment))))))) (setq tem (funcall (cadr tem) (car tem) var data-type? (nreconc ipps (loop-gather-preps (caddr tem))) inclusive? (caddr tem) (cdddr tem))) ;; TEM is now (bindings prologue-forms endtest setups steps) (mapc '(lambda (x) (let (var val dtype) (cond ((atom x) (setq var x)) (t (setq var (car x) val (cadr x) dtype (caddr x)))) (loop-make-variable var val dtype))) (car tem)) (setq loop-prologue (nconc (reverse (cadr tem)) loop-prologue)) (cddr tem))) (defun loop-gather-preps (preps-allowed) (do ((list nil (cons (list (pop loop-source-code) (loop-get-form)) list)) (token (car loop-source-code) (car loop-source-code))) ((not (memq token preps-allowed)) (nreverse list)))) (defun loop-add-path (name data) (loop-add-keyword (cons name data) 'loop-path-keyword-alist)) (defmacro define-loop-path (names &rest cruft &aux forms) (setq forms (mapcar '(lambda (name) `(loop-add-path ',name ',cruft)) (cond ((atom names) (list names)) (t names)))) `(eval-when (eval load compile) ,@forms)) (defun loop-path-carcdr (name var dtype pps inclusive? preps data) preps dtype ;Prevent unused arguments error (let ((vars) (step) (endtest `(,(cadr data) ,var)) (tem)) (or (setq tem (loop-lookup-keyword 'of pps)) (error "lisp: loop path has no initialization -- " name)) (setq vars `((,var ,(cond (inclusive? (cadr tem)) (t `(,(car data) ,(cadr tem)))) ,dtype))) (setq step `(,var (,(car data) ,var))) (list vars nil nil nil endtest step))) (defun loop-interned-symbols-path (path variable data-type prep-phrases inclusive? allowed-preps data) path data-type allowed-preps data ; unused vars ; data-type should maybe be error-checked..... (let ((bindings) (presteps) (pretest) (poststeps) (posttest) (prologue) (indexv) (listv) (ob) (test) (step)) (push variable bindings) (and (not (null prep-phrases)) (or (cdr prep-phrases) (and (not (loop-tequal (caar prep-phrases) 'in)) (not (loop-tequal (caar prep-phrases) 'of)))) (error "Illegal prep phrase(s) in interned-symbols path --" (list* variable 'being path prep-phrases))) (push (list (setq ob (gensym)) (cond ((null prep-phrases) 'obarray ) (t (cadar prep-phrases)))) bindings) ; Multics lisp does not store single-char-obs in the obarray buckets. ; Thus, we need to iterate over the portion of the obarray ; containing them also. (511. = (ascii 0)) (push `(,(setq indexv (gensym)) #+Multics 639. #+(and Maclisp (not Multics)) 511. #Q 0 fixnum) bindings) #M (push `(,(setq listv (gensym)) nil) bindings) #Q (push `(setq ,indexv (array-dimension-n 2 ,ob)) prologue) (setq test `(and #-Multics (null ,listv) #+Multics (or (> ,indexv 510.) (null ,listv)) (prog () lp (cond ((< (setq ,indexv (1- ,indexv)) 0) (return t)) ((setq ,listv (arraycall #+Multics obarray #-Multics t ,ob ,indexv)) (return nil)) (t (go lp))))) ) (setq step `(,variable #+Multics (cond ((> ,indexv 510.) ,listv) (t (prog2 nil (car ,listv) (setq ,listv (cdr ,listv))))) #+(and Maclisp (not Multics)) (car ,listv) #+Lispm (ar-2 ,ob 1 ,indexv))) (cond (inclusive? (setq posttest test poststeps step prologue `((setq ,variable ,ob)))) (t (setq pretest test presteps step))) #+(and Maclisp (not Multics)) (setq poststeps `(,@poststeps ,listv (cdr ,listv))) (list bindings prologue pretest presteps posttest poststeps))) ; We don't want these defined in the compilation environment because ; the appropriate environment hasn't been set up. So, we just bootstrap ; them up. (mapc '(lambda (x) (mapc '(lambda (y) (loop-add-path y (cdr x))) (car x))) '(((car cars) loop-path-carcdr (of) car atom) ((cdr cdrs) loop-path-carcdr (of) cdr atom) ((cddr cddrs) loop-path-carcdr (of) cddr null) ((interned-symbols interned-symbol) loop-interned-symbols-path (in)) )) (or (status feature loop) (sstatus feature loop)) ;Loop macro blathering. ; ; This doc is totally wrong. Complete documentation (nice looking ; hardcopy) is available from GSB, or from ML:LSBDOC;LPDOC (which ; needs to be run through BOLIO). ; ;This is intended to be a cleaned-up version of PSZ's FOR package ;which is a cleaned-up version of the Interlisp CLisp FOR package. ;Note that unlike those crocks, the order of evaluation is the ;same as the textual order of the code, always. ; ;The form is introduced by the word LOOP followed by a series of clauses, ;each of which is introduced by a keyword which however need not be ;in any particular package. Certain keywords may be made "major" ;which means they are global and macros themselves, so you could put ;them at the front of the form and omit the initial "LOOP". ; ;Each clause can generate: ; ; Variables local to the loop. ; ; Prologue Code. ; ; Main Code. ; ; Epilogue Code. ; ;Within each of the three code sections, code is always executed strictly ;in the order that the clauses were written by the user. For parallel assignments ;and such there are special syntaxes within a clause. The prologue is executed ;once to set up. The main code is executed several times as the loop. The epilogue ;is executed once after the loop terminates. ; ;The term expression means any Lisp form. The term expression(s) means any number ;of Lisp forms, where only the first may be atomic. It stops at the first atom ;after the first form. ; ;The following clauses exist: ; ;Prologue: ; INITIALLY expression(s) ; This explicitly inserts code into the prologue. More commonly ; code comes from variable initializations. ; ;Epilogue: ; FINALLY expression(s) ; This is the only way to explicitly insert code into the epilogue. ; ;Side effects: ; DO expression(s) ; The expressions are evaluated. This is how you make a "body". ; DOING is synonymous with DO. ; ;Return values: ; RETURN expression(s) ; The last expression is returned immediately as the value of the form. ; This is equivalent to DO (RETURN expression) which you will ; need to use if you want to return multiple values. ; COLLECT expression(s) ; The return value of the form will be a list (unless over-ridden ; with a RETURN). The list is formed out of the values of the ; last expression. ; COLLECTING is synonymous with COLLECT. ; APPEND (or APPENDING) and NCONC (or NCONCING) can be used ; in place of COLLECT, forming the list in the appropriate ways. ; COUNT expression(s) ; The return value of the form will be the number of times the ; value of the last expression was non-NIL. ; SUM expression(s) ; The return value of the form will be the arithmetic sum of ; the values of the last expression. ; The following are a bit wierd syntactically, but Interlisp has them ; so they must be good. ; ALWAYS expression(s) ; The return value will be T if the last expression is true on ; every iteration, NIL otherwise. ; NEVER expressions(s) ; The return value will be T if the last expression is false on ; every iteration, NIL otherwise. ; THEREIS expression(s) ; This is wierd, I'm not sure what it really does. ; You probably want WHEN (NUMBERP X) RETURN X ; or maybe WHEN expression RETURN IT ; ;Conditionals: (these all affect only the main code) ; ; WHILE expression ; The loop terminates at this point if expression is false. ; UNTIL expression ; The loop terminates at this point if expression is true. ; WHEN expression clause ; Clause is performed only if expression is true. ; This affects only the main-code portion of a clause ; such as COLLECT. Use with FOR is a little unclear. ; IF is synonymous with WHEN. ; WHEN expression RETURN IT (also COLLECT IT, COUNT IT, SUM IT) ; This is a special case, the value of expression is returned if non-NIL. ; This works by generating a temporary variable to hold ; the value of the expression. ; UNLESS expression clause ; Clause is performed only if expression is false. ; ;Variables and iterations: (this is the hairy part) ; ; WITH variable = expression {AND variable = expression}... ; The variable is set to the expression in the prologue. ; If several variables are chained together with AND ; the setq's happen in parallel. Note that all variables ; are bound before any expressions are evaluated (unlike DO). ; ; FOR variable = expression {AND variable = expression}... ; At this point in the main code the variable is set to the expression. ; Equivalent to DO (PSETQ variable expression variable expression...) ; except that the variables are bound local to the loop. ; ; FOR variable FROM expression TO expression {BY expression} ; Nu((meric iteration. BY defaults to 1. ; BY and TO may be in either order. ; If you say DOWNTO instead of TO, BY defaults to -1 and ; the end-test is reversed. ; If you say BELOW instead of TO or ABOVE instead of DOWNTO ; the iteration stops before the end-value instead of after. ; The expressions are evaluated in the prologue then the ; variable takes on its next value at this point in the loop; ; hair is required to win the first time around if this FOR is ; not the first thing in the main code. ; FOR variable IN expression ; Iteration down members of a list. ; FOR variable ON expression ; Iteration down tails of a list. ; FOR variable IN/ON expression BY expression ; This is an Interlisp crock which looks useful. ; FOR var ON list BY expression[var] ; is the same as FOR var = list THEN expression[var] ; FOR var IN list BY expression[var] ; is similar except that var gets tails of the list ; and, kludgiferously, the internal tail-variable ; is substituted for var in expression. ; FOR variable = expression THEN expression ; General DO-type iteration. ; Note that all the different types of FOR clauses can be tied together ; with AND to achieve parallel assignment. Is this worthwhile? ; [It's only implemented for = mode.] ; AS is synonymous with FOR. ; ; FOR variable BEING expression(s) AND ITS pathname ; FOR variable BEING expression(s) AND ITS a-r ; FOR variable BEING {EACH} pathname {OF expression(s)} ; FOR variable BEING {EACH} a-r {OF expression(s)} ; Programmable iteration facility. Each pathname has a ; function associated with it, on LOOP-PATH-KEYWORD-ALIST; the ; alist has entries of the form (pathname function prep-list). ; prep-list is a list of allowed prepositions; after either of ; the above formats is parsed, then pairs of (preposition expression) ; are collected, while preposition is in prep-list. The expression ; may be a progn if there are multiple prepositions before the next ; keyword. The function is then called with arguments of: ; pathnname variable prep-phrases inclusive? prep-list ; Prep-phrases is the list of pairs collected, in order. Inclusive? ; is T for the first format, NIL otherwise; it says that the init ; value of the form takes on expression. For the first format, the ; list (OF expression) is pushed onto the fromt of the prep-phrases. ; In the above examples, a-r is a form to be evaluated to get an ; attachment-relationship. In this case, the pathname is taken as ; being ATTACHMENTS, and a-r is passed in by being treated as if it ; had been used with the preposition IN. The function should return ; a list of the form (bindings init-form step-form end-test); bindings ; are stuffed onto loop-variables, init-form is initialization code, ; step-form is step-code, and end-test tells whether or not to exit. ; ;Declarations? Not needed by Lisp machine. For Maclisp these will be done ;by a reserved word in front of the variable name as in PSZ's macro. ; ;The implementation is as a PROG. No initial values are given for the ;PROG-variables. PROG1 is used for parallel assignment. ; ;The iterating forms of FOR present a special problem. The problem is that ;you must do everything in the order that it was written by the user, but the ;FOR-variable gets its value in a different way in the first iteration than ;in the subsequent iterations. Note that the end-tests created by FOR have ;to be done in the appropriate order, since otherwise the next clause might get ;an error. ; ;The most general way is to introduce a flag, !FIRST-TIME, and compile the ;clause "FOR var = first TO last" as "INITIALLY (SETQ var first) ;WHEN (NOT !FIRST-TIME) DO (SETQ var (1+ var)) WHILE (<= var last)". ;However we try to optimize this by recognizing a special case: ;The special case is recognized where all FOR clauses are at the front of ;the main code; in this case if there is only one its stepping and ;endtest are moved to the end, and a jump to the endtest put at the ;front. If there are more than one their stepping and endtests are moved ;to the end, with duplicate endtests at the front except for the last ;which doesn't need a duplicate endtest. If FORs are embedded in the ;main code it can only be implemented by either a first-time flag or ;starting the iteration variable at a special value (initial minus step ;in the numeric iteration case). This could probably just be regarded as ;an error. The important thing is that it never does anything out of ;order. he ;front. If there are more than one their stepping and endtests are moved ;to the end, with duplicate endtestslib/lisp/machacks.l 444 0 33 25014 2552754311 7523 (setq |SCCS-machacks| "@(#)machacks.l 1.4 2/27/81") ;; machacks - maclisp compatibility package. ;; When this file is fasl'ed into a lisp, it will change the syntax to ;; maclisp's syntax and will define functions know to the standard maclisp. ; ; this file will be fasled whenever the -m switch is set for compilation. ; ;; Vaxima installation note: ; * each site which runs vaxima should set the following symbol to ; the location of the Vaxima main directory (setq vaxima-main-dir "//vb//mac//") (declare (macros t)) ;-- macsyma-env ; This really isn't part of the maclisp compatibility package but we put ; it here to allow us to bootstrap the macsyma macro packages. ; (def macsyma-env ; put at the beginning of each macsyma file (macro (l) `(include |libmax//prelud.l|))) (def coutput (lambda (msg) (print msg) ; should go to unfasl port (terpr))) ;--- displace ; This is useful after a macro has been expanded and you want to save the ; interpreter the trouble of expanding the macro again. ; [This is really only useful for interpretation] (defun displace (old-form new-form) (cond ((atom old-form) (error '|Not able to displace this form| old-form)) ((atom new-form) (rplaca old-form 'progn) (rplacd old-form (list new-form))) (t (rplaca old-form (car new-form)) (rplacd old-form (cdr new-form))))) ;--- caseq ; use is ; (caseq expr ; (match1 do1) ; (match2 do2) ; (t doifallelsefails)) (def caseq (macro (form) ((lambda (x) `((lambda (,x) (cond ,@(mapcar '(lambda (ff) (cond ((eq (car ff) 't) `(t ,(cadr ff))) (t `((eq ,x ',(car ff)) ,(cadr ff))))) (cddr form)))) ,(cadr form))) (gensym 'Z)))) ;A winning macro to store things anywhere: (stolen from AI:ALAN;LSPENV) ;(SETF (CADR X) 3) --> (RPLACA (CDR X) 3) (DEFMACRO SETF (EXPR VAL) (COND ((ATOM EXPR) (OR (SYMBOLP EXPR) (ERROR '|-- SETF can't handle this.| EXPR)) `(SETQ ,EXPR ,VAL)) (T (DO ((Y)) (()) (OR (SYMBOLP (CAR EXPR)) (ERROR '|-- SETF can't handle this.| EXPR)) (AND (SETQ Y (GET (CAR EXPR) 'SETF-EXPAND)) (RETURN (FUNCALL Y EXPR VAL))) (OR (and (SETQ Y (GETd (CAR EXPR))) (or (and (dtpr y) (eq (car y) 'macro)) (and (bcdp y) (eq (getdisc y) 'macro)))) (ERROR '|-- SETF can't handle this.| EXPR)) (SETQ EXPR (apply Y EXPR)))))) (DEFMACRO DEFSETF (NAME VARS &REST BODY) `(eval-when (compile load eval) (DEFPROP ,NAME (LAMBDA ,VARS . ,BODY) SETF-EXPAND))) (DEFSETF CAR (E V) `(RPLACA ,(CADR E) ,V)) (DEFSETF CAAR (E V) `(RPLACA (CAR ,(CADR E)) ,V)) (DEFSETF CADR (E V) `(RPLACA (CDR ,(CADR E)) ,V)) (DEFSETF CAAAR (E V) `(RPLACA (CAAR ,(CADR E)) ,V)) (DEFSETF CADAR (E V) `(RPLACA (CDAR ,(CADR E)) ,V)) (DEFSETF CAADR (E V) `(RPLACA (CADR ,(CADR E)) ,V)) (DEFSETF CADDR (E V) `(RPLACA (CDDR ,(CADR E)) ,V)) (DEFSETF CAAAAR (E V) `(RPLACA (CAAAR ,(CADR E)) ,V)) (DEFSETF CADAAR (E V) `(RPLACA (CDAAR ,(CADR E)) ,V)) (DEFSETF CAADAR (E V) `(RPLACA (CADAR ,(CADR E)) ,V)) (DEFSETF CADDAR (E V) `(RPLACA (CDDAR ,(CADR E)) ,V)) (DEFSETF CAAADR (E V) `(RPLACA (CAADR ,(CADR E)) ,V)) (DEFSETF CADADR (E V) `(RPLACA (CDADR ,(CADR E)) ,V)) (DEFSETF CAADDR (E V) `(RPLACA (CADDR ,(CADR E)) ,V)) (DEFSETF CADDDR (E V) `(RPLACA (CDDDR ,(CADR E)) ,V)) (DEFSETF CDR (E V) `(RPLACD ,(CADR E) ,V)) (DEFSETF CDAR (E V) `(RPLACD (CAR ,(CADR E)) ,V)) (DEFSETF CDDR (E V) `(RPLACD (CDR ,(CADR E)) ,V)) (DEFSETF CDAAR (E V) `(RPLACD (CAAR ,(CADR E)) ,V)) (DEFSETF CDDAR (E V) `(RPLACD (CDAR ,(CADR E)) ,V)) (DEFSETF CDADR (E V) `(RPLACD (CADR ,(CADR E)) ,V)) (DEFSETF CDDDR (E V) `(RPLACD (CDDR ,(CADR E)) ,V)) (DEFSETF CDAAAR (E V) `(RPLACD (CAAAR ,(CADR E)) ,V)) (DEFSETF CDDAAR (E V) `(RPLACD (CDAAR ,(CADR E)) ,V)) (DEFSETF CDADAR (E V) `(RPLACD (CADAR ,(CADR E)) ,V)) (DEFSETF CDDDAR (E V) `(RPLACD (CDDAR ,(CADR E)) ,V)) (DEFSETF CDAADR (E V) `(RPLACD (CAADR ,(CADR E)) ,V)) (DEFSETF CDDADR (E V) `(RPLACD (CDADR ,(CADR E)) ,V)) (DEFSETF CDADDR (E V) `(RPLACD (CADDR ,(CADR E)) ,V)) (DEFSETF CDDDDR (E V) `(RPLACD (CDDDR ,(CADR E)) ,V)) (DEFSETF CXR (E V) `(RPLACX ,(CADR E) ,(CADDR E) ,V)) (DEFSETF NTH (E V) `(RPLACA (NTHCDR ,(CADR E) ,(CADDR E)) ,V)) (DEFSETF ARRAYCALL (E V) `(STORE ,E ,V)) (DEFSETF GET (E V) `(PUTPROP ,(CADR E) ,V ,(CADDR E))) (DEFSETF PLIST (E V) `(SETPLIST ,(CADR E) ,V)) (DEFSETF SYMEVAL (E V) `(SET ,(CADR E) ,V)) (DEFSETF ARG (E V) `(SETARG ,(CADR E) ,V)) (DEFSETF ARGS (E V) `(ARGS ,(CADR E) ,V)) (DEFSETF SFA-GET (E V) `(SFA-STORE ,(CADR E) ,(CADDR E) ,V)) (DEFSETF EXAMINE (E V) `(DEPOSIT ,(CADR E) ,V)) (defmacro list* (&rest forms) (cond ((null forms) nil) ((null (cdr forms)) (car forms)) (t (construct-list* forms)))) (defmacro ttf (&rest l) `(list* . , l)) (defun construct-list* (forms) (setq forms (reverse forms)) (do ((forms (cddr forms) (cdr forms)) (return-form `(cons ,(cadr forms) ,(car forms)) `(cons ,(car forms) ,return-form))) ((null forms) return-form))) ;; lexpr-funcall is a cross(( between apply and funcall. The last arguments ;; is a list of the rest of the arguments (defmacro lexpr-funcall (func &rest args) `(apply ,func (list* ,@args))) ; contents of the file libmax;macros all of these functions are ; (by default) in maclisp ;; (IF X P Q1 Q2 ...) --> (COND (X P) (T Q1 Q2 ...)) ;; It is important that (IF NIL

) returns NIL as Macsyma code depends ;; upon this in places. See also IFN in LIBMAX;MAXMAC. (DEFMACRO IF (PREDICATE THEN &REST ELSE) (COND ((NULL ELSE) `(COND (,PREDICATE ,THEN))) (T `(COND (,PREDICATE ,THEN) (T . ,ELSE))))) ;; LET, LET*, LIST* are now a part of Multics Lisp. Nobody should miss ;; the code commented out below. ;; (LET ((A 3) (B) C) STUFF) --> ((LAMBDA (A B C) STUFF) 3 NIL NIL) ;; (LET* ((A 3) (B 4)) STUFF) --> ((LAMBDA (A) ((LAMBDA (B) STUFF) 4)) 3) ;; (PUSH X S) --> (SETQ S (CONS X S)) (DEFMACRO PUSH (OBJECT LIST) `(SETF ,LIST (CONS ,OBJECT ,LIST))) ;; (POP S) --> (PROG1 (CAR S) (SETF S (CDR S))) ;; (POP S V) --> (PROG1 (SETF V (CAR S)) (SETF S (CDR S))) ;; This relies on the fact that SETF returns the value stored. (DEFMACRO POP (LIST &OPTIONAL (INTO NIL INTO-P)) (COND (INTO-P `(PROG1 (SETF ,INTO (CAR ,LIST)) (SETF ,LIST (CDR ,LIST)))) (T `(PROG1 (CAR ,LIST) (SETF ,LIST (CDR ,LIST)))))) ;; (FOR I m n . BODY) will evaluate BODY with I bound to m,m+1,...,n-1 ;; sequentially. (FOR I 0 n . BODY) --> (DOTIMES (I n) . BODY) (DEFMACRO FOR (VAR START STOP . BODY) `(DO ,VAR ,START (1+ ,VAR) (= ,VAR ,STOP) ,@BODY)) (DEFMACRO EVENP (X) `(NOT (ODDP ,X))) ; these were grabbed from lspsrc;umlmac.5 (DEFMACRO WHEN (P . C) `(COND (,P . ,C))) (DEFMACRO UNLESS (P . C) `(COND ((NOT ,P) . ,C))) (defmacro DOLIST ((var form index) &rest body &aux (dummy (gensym)) decls) (setq decls (cond ((and body (not (atom (car body))) (eq (caar body) 'DECLARE)) (prog2 () (cdar body) (pop body))))) (cond (index (setq index (ncons `(,INDEX 0 (1+ ,INDEX)) )) (push `(FIXNUM ,INDEX) decls))) (and decls (setq decls (ncons `(DECLARE ,.decls)))) `(DO ((,DUMMY ,FORM (CDR ,DUMMY)) (,VAR) ,.index ) ((NULL ,DUMMY)) ,@decls (SETQ ,VAR (CAR ,DUMMY)) ,.BODY)) ;Repeat a number of times. evaluates to the number of times, ;and is executed with bound to 0, 1, ... ;Don't generate dummy variable if is an integer. We could also do this ;if were a symbol, but the symbol may get clobbered inside the body, ;so the behavior of the macro would change. (DEFMACRO DOTIMES (SPEC &REST BODY) (LET (VAR COUNT DUMMY DECLS) (SETQ DECLS `(DECLARE (FIXNUM ,var ) ;LOOP VARIABLE TO BE FILLED IN HERE ,.(cond ((and body (not (atom (car body))) (eq (caar body) 'DECLARE)) (prog2 () (cdar body) (pop body)))))) (COND ((ATOM SPEC) (SETQ VAR (GENSYM) COUNT SPEC)) ('T (DESETQ (VAR COUNT) SPEC) (COND ((NULL VAR) (SETQ VAR (GENSYM)))) (COND ((NOT (FIXP COUNT)) (SETQ DUMMY `((,(gensym) ,count)) COUNT (CAAR DUMMY)))))) (SETF (CADADR DECLS) VAR) `(DO ((,var 0 (1+ ,var)) ,.dummy) ((NOT (< ,var ,count))) ,decls ,.body))) ;; The following is NOT courtesy AI: LISPM2; LMMAC 118 ;; Theirs is buggy! ;; PSETQ looks like SETQ but does its work in parallel. (DEFMACRO PSETQ (&REST REST) (COND ((CDDR REST) `(SETQ ,(CAR REST) (PROG1 ,(CADR REST) (PSETQ . ,(CDDR REST))))) ;; The last pair. Keep it simple; no superfluous ;; (PROG1 (SETQ...) (PSETQ)). ((CDR REST) `(SETQ . ,REST)) (T (error '|Odd number of args to PSETQ| rest 'wrng-no-args)))) (defmacro if-for-maclisp-else-lispm (&rest ll) (car ll)) (PROGN 'COMPILE (DEFMACRO LOGAND (&REST FORMS) `(BOOLE 1 . ,FORMS)) (DEFMACRO LOGIOR (&REST FORMS) `(BOOLE 7 . ,FORMS)) (DEFMACRO LOGXOR (&REST FORMS) `(BOOLE 6 . ,FORMS)) ) (DEFMACRO DEFVAR (VARIABLE &OPTIONAL (INITIAL-VALUE NIL IV-P) DOCUMENTATION) DOCUMENTATION ;; Ignored for now. (IF IV-P `(PROGN 'COMPILE (DECLARE (SPECIAL ,VARIABLE)) (OR (BOUNDP ',VARIABLE) (SETQ ,VARIABLE ,INITIAL-VALUE))) `(DECLARE (SPECIAL ,VARIABLE)))) (DEFMACRO PSETQ (VAR VALUE . REST) (COND (REST `(SETQ ,VAR (PROG1 ,VALUE (PSETQ . ,REST)))) (T `(SETQ ,VAR ,VALUE)))) ;; (DOTIMES (I N) BODY) evaluates BODY N times, with I bound to 0, 1, ..., N-1. ;; (DOLIST (X L) BODY) successively binds X to the elements of L, and evaluates ;; BODY each time. ;; Things to beware of: ;; [1] This won't work for COUNT being a bignum. ;; [2] If COUNT is a symbol, somebody could clobber its value inside the body. ;; [3] Somebody inside of BODY could reference **COUNT**. (DEFMACRO DOTIMES ((VAR COUNT) . BODY) (IF (OR (FIXP COUNT) (SYMBOLP COUNT)) `(DO ((,VAR 0 (1+ ,VAR))) ((>= ,VAR ,COUNT)) (DECLARE (FIXNUM ,VAR)) . ,BODY) `(DO ((,VAR 0 (1+ ,VAR)) (**COUNT** ,COUNT)) ((>= ,VAR **COUNT**)) (DECLARE (FIXNUM ,VAR **COUNT**)) . ,BODY))) (DEFMACRO DOLIST ((VAR LIST) . BODY) `(DO ((**LIST** ,LIST (CDR **LIST**)) (,VAR)) ((NULL **LIST**)) (SETQ ,VAR (CAR **LIST**)) . ,BODY)) ;; CASE is apparently missing from ITS MacLisp. ;; (DEFMACRO SELECT (KEY . FORMS) ;; (SETQ FORMS ;; (MAPCAR #'(LAMBDA (FORM) (IF (EQ (CAR FORM) 'OTHERWISE) ;; (CONS T (CDR FORM)) FORM)) ;; FORMS)) ;; `(CASE ,KEY . ,FORMS)) (DEFMACRO SELECTQ (KEY . FORMS) (SETQ FORMS (MAPCAR '(LAMBDA (FORM) (IF (EQ (CAR FORM) 'OTHERWISE) (CONS T (CDR FORM)) FORM)) FORMS)) `(CASEQ ,KEY . ,FORMS)) (,VAR)) ((NULL **LIST**)) (SETQ ,VAR (CAR **LIST**)) . ,BODY)) ;; CASE is apparently missing from ITS MacLisp. ;; (DEFMACRO SELECT (KEY . FORMS) ;; (SETQ FORMS ;; (MAPCAR #'(LAMBDA (FORM) (IF (EQ (CAR FORM) 'OTHERWISE) ;; (CONS T (CDR FORM)) FORM)) ;; FORMS)) ;; `(CASE ,KEY . ,FORMS)) (DEFMACRO SELECTQ (KEY . FORMS) (SETQ FORMS (MAPCAR '(LAMBDA (FORM) (IF (EQ (CAR FORM) 'OTHERWISE) (CONS T (CDR FORM)) FORM)) FORMS)) `(CASEQ ,KEY lib/lisp/machacks.o 664 0 33 32771 2552754321 7543 (0 XWZVhPXWZVjWWVfWWVXWZVxjP@PxPPPШjWWVTxP@rPxPPP"jPШjЪԆNPQvPQ`jЪTФQvPQjPк`!XWZVШ W"WVPШЪԆPШԆкTdժP1ЪTФЪTФPPШdSУԆPZШЪШ ФԆPPԆzPqPhPкTФԆUPLVPЪWVVPԆW0WVPPԆPPPкTФԆPXWZVкTФdSУxP@PxPPPOxP@~Ш$ЪWwWVШ(ЪЪԆPPGP>1ԆP1ЪTФPxPP@Ш$TWWVЪTФШ,P Ъ ЪЪWWV1ЪTФPР x P@Ъ SУPP0>x P@Ъ WWVP0Ш$ЪWyWVЪ ЪWWVP1V=XWZVкTФdSУcШ4Ш8Ш<ЪШЪЪ PPШ@PPPԆPPXWZVкժP!պ ЪTФPЪWWVtXWZVкШDЪZQXWZVjWWVPjкTdШHФjSУԆPPPժЪP8кШHЪTФЪԆPPPvXWZVкTФdШLЪШDЪԆWWVPzPԆoPfP]TXWZVкTФdSУcժ 3ШЪЪԆ!PPԆ PKШЪЪԆPPШЪ PԆPPXWZVкTФdSУШPЪШHЪЪԆ{PrPiPԆ^PUPLCXWZVкTФdSУԆкTdи ЪSУԪժ 1ШTШPЪШXЪԆPPԆPPPШPЪШ\ЪԆPPԆPPPԆwPnPe{ШTШXЪԆOPFPШPЪШ\ЪԆ+P"PԆPPPԆPPXWZVкTФdSУcRТbШ`ЪЪШdЪԆPPШhЪЪ ԆPyPpPЪԆWWVPPPGP>P5P,#XWZVкTФШlШpЪԆPPԆPXWZVкTФdШЪЪPԆPXWZVкTФdШШlЪԆpPgPЪZPԆOPF=XWZVкTФSУcRТbWЧdfW&WVPԆժNЪTФPxPP@PxPPP.ФSУPPt ԆЪTдФкVЪPVPPժ yЪ ШxШdЪ ԆPPԆ|PsPjPԆ_P Ш|Ъ ԆKPBPЪ5PPժ0ШtЪԆWkWVPPԆPШ`ЪЪШ\ЪԆPPԆPPPЪԆPЪ ԆWWVPP~PȀЪԆjPaPԆVPЪШ(ЪШXЪԆ7P.PԆ#PPPЪԆWUWVPPW WVPPPXWZVкTФdԆԆԆԆШtШ|Ъ ԆPPժNЪTФPxPP@iPxPPP.ФSУPPt ԆЪTд$ФкVЪ$PVPPԆWtWVPPPxP@PxPPPfWWVP Ъ1ЪЪTФ dSУVժ fWWVP PxP@PxPPPCfWWVPЪԆjPaPԆVPЪTФSУPкTдPЪ Ш`Ъ ШxШdЪ ((ԆPPԆPPPЪԆW6WVPPШlȄЪ ЪԆPPPԆPPԆPЪЪԆWWVPaPXPOPF=XWZVккTd^Ш(ЪSУШTФȈdPԆPPPԆPP0TШ(ЪȌЪȐWWVXWZVкЪTФPuXWZVкȔȘЪUPLCXWZVкȔȜЪ#PXWZVкȔȠЪPXWZVкTФдSУdRТԆкTd иЪ SУ Ԫ ժ1ШȤШtȨЪԆ{PrPԆgP^PȬȰШ ЪԆAP8PԆ-P$PШ(ЪЪ Ԇ PPPԆPPPԆPPP2ШtȨЪԆPPԆP{XWZVкTФdSУcժ [Ш(ЪШTЪȈЪ =PԆ2P)P PԆP P&Ш(ЪЪԆPPXWZVкTФSУcRТdxP@PxPPPxP@1Ш`ЪШxШdЪԆlPcPԆXPOPFPԆ;PȴЪЪԆ#PPPԆPШtШ|ЪԆPPԆPPЪ PPP1Ш`ЪШxШdЪԆPPԆwPnPePȸЪԆQPHPԆ=P4PȴЪȼPPԆ PШtШ|ЪPPԆPPЪ PPPXWZVкTФSУcRТdШ`ЪkPbPЪԆSPԆHP?PШ(Ъ$PPЪ PPPXWZVкTФdԆЪժPDЪTФЪTФPPиdTPVPЪ P кVЪ WWVVPЪЪUPLcccccccccccccccccccccccccccccccccccccccccc(include libmax/prelud\.l)Not\ able\ to\ displace\ this\ formprognzlambdacondteqquote--\ SETF\ can\'t\ handle\ this\.setqsetf-expandmacroeval-when(compile load eval)defprop(setf-expand)list*consapplysetfprog1carcdrdo\1+=notoddpdeclare0fixnumnull<psetqOdd\ number\ of\ args\ to\ PSETQwrng-no-argsboole176(quote compile)specialorboundp>=**count**(**count**)(**count**)**list**((cdr **list**))((null **list**))((car **list**))otherwisecaseqprintterprerrorgensymnreverseappendfuncallgetdiscapplyconstruct-list*reversenconc(setq SCCS-machacks "@(#)machacks.l 1.4 22781")(setq vaxima-main-dir "/vb/mac/")macsyma-envcoutputdisplacecaseqsetfdefsetf(defprop car (lambda (e v) (list (quote rplaca) (cadr e) v)) setf-expand)(defprop caar (lambda (e v) (list (quote rplaca) (list (quote car) (cadr e)) v)) setf-expand)(defprop cadr (lambda (e v) (list (quote rplaca) (list (quote cdr) (cadr e)) v)) setf-expand)(defprop caaar (lambda (e v) (list (quote rplaca) (list (quote caar) (cadr e)) v)) setf-expand)(defprop cadar (lambda (e v) (list (quote rplaca) (list (quote cdar) (cadr e)) v)) setf-expand)(defprop caadr (lambda (e v) (list (quote rplaca) (list (quote cadr) (cadr e)) v)) setf-expand)(defprop caddr (lambda (e v) (list (quote rplaca) (list (quote cddr) (cadr e)) v)) setf-expand)(defprop caaaar (lambda (e v) (list (quote rplaca) (list (quote caaar) (cadr e)) v)) setf-expand)(defprop cadaar (lambda (e v) (list (quote rplaca) (list (quote cdaar) (cadr e)) v)) setf-expand)(defprop caadar (lambda (e v) (list (quote rplaca) (list (quote cadar) (cadr e)) v)) setf-expand)(defprop caddar (lambda (e v) (list (quote rplaca) (list (quote cddar) (cadr e)) v)) setf-expand)(defprop caaadr (lambda (e v) (list (quote rplaca) (list (quote caadr) (cadr e)) v)) setf-expand)(defprop cadadr (lambda (e v) (list (quote rplaca) (list (quote cdadr) (cadr e)) v)) setf-expand)(defprop caaddr (lambda (e v) (list (quote rplaca) (list (quote caddr) (cadr e)) v)) setf-expand)(defprop cadddr (lambda (e v) (list (quote rplaca) (list (quote cdddr) (cadr e)) v)) setf-expand)(defprop cdr (lambda (e v) (list (quote rplacd) (cadr e) v)) setf-expand)(defprop cdar (lambda (e v) (list (quote rplacd) (list (quote car) (cadr e)) v)) setf-expand)(defprop cddr (lambda (e v) (list (quote rplacd) (list (quote cdr) (cadr e)) v)) setf-expand)(defprop cdaar (lambda (e v) (list (quote rplacd) (list (quote caar) (cadr e)) v)) setf-expand)(defprop cddar (lambda (e v) (list (quote rplacd) (list (quote cdar) (cadr e)) v)) setf-expand)(defprop cdadr (lambda (e v) (list (quote rplacd) (list (quote cadr) (cadr e)) v)) setf-expand)(defprop cdddr (lambda (e v) (list (quote rplacd) (list (quote cddr) (cadr e)) v)) setf-expand)(defprop cdaaar (lambda (e v) (list (quote rplacd) (list (quote caaar) (cadr e)) v)) setf-expand)(defprop cddaar (lambda (e v) (list (quote rplacd) (list (quote cdaar) (cadr e)) v)) setf-expand)(defprop cdadar (lambda (e v) (list (quote rplacd) (list (quote cadar) (cadr e)) v)) setf-expand)(defprop cdddar (lambda (e v) (list (quote rplacd) (list (quote cddar) (cadr e)) v)) setf-expand)(defprop cdaadr (lambda (e v) (list (quote rplacd) (list (quote caadr) (cadr e)) v)) setf-expand)(defprop cddadr (lambda (e v) (list (quote rplacd) (list (quote cdadr) (cadr e)) v)) setf-expand)(defprop cdaddr (lambda (e v) (list (quote rplacd) (list (quote caddr) (cadr e)) v)) setf-expand)(defprop cddddr (lambda (e v) (list (quote rplacd) (list (quote cdddr) (cadr e)) v)) setf-expand)(defprop cxr (lambda (e v) (list (quote rplacx) (cadr e) (caddr e) v)) setf-expand)(defprop nth (lambda (e v) (list (quote rplaca) (list (quote nthcdr) (cadr e) (caddr e)) v)) setf-expand)(defprop arraycall (lambda (e v) (list (quote store) e v)) setf-expand)(defprop get (lambda (e v) (list (quote putprop) (cadr e) v (caddr e))) setf-expand)(defprop plist (lambda (e v) (list (quote setplist) (cadr e) v)) setf-expand)(defprop symeval (lambda (e v) (list (quote set) (cadr e) v)) setf-expand)(defprop arg (lambda (e v) (list (quote setarg) (cadr e) v)) setf-expand)(defprop args (lambda (e v) (list (quote args) (cadr e) v)) setf-expand)(defprop sfa-get (lambda (e v) (list (quote sfa-store) (cadr e) (caddr e) v)) setf-expand)(defprop examine (lambda (e v) (list (quote deposit) (cadr e) v)) setf-expand)list*ttfconstruct-list*lexpr-funcallifpushpopforevenpwhenunlessdolistdotimespsetqif-for-maclisp-else-lispmlogandlogiorlogxordefvarpsetqdotimesdolistselectq  . ; G [ y      K T n w             0 9 B f         ' G e w        # . 7 @ I |        ! * 3 F v            ( 3 < E N          ' 0 9 T ] h q z               Z c z                 #  H  S  \  e           l  u             )  4  =  F  U  i  u  ~              %  .  7  @  o  x          R  j            * F O X c l w            & / C ^ j                         ) 2 ; D [ d o x           ! * U n             ! * 7 @ I R q z             ! * 7 @ I R [             X m      C'29@>GMTE[biBpwJ~ a  < f}&W7  (%F00007linkerF00009trantbF00011_typetable_qconsF00016F00025_qgetF00040F00042F00047F00049F00054F00056F00060F00062F00068F00070F00072F00074F00076F00086F00100F00105F00107F00109F00111F00113F00119F00123F00128F00130bind_orglinker_sizetrans_sizelit_orglit_end ((lib/lisp/nld 775 0 33 62105 2527227502 6304 @ ^Юn PPՀPpPP? P<^1P1}1Ѭ ;X[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pݬ,P^ЬY[ԭYi i i-֭i9 [PQPQ0Q[i0խ[[[P P...//(/2/L/^/p/////////00!010@0Q0e0y0000000001"1,171E1Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too largeIs a portNot a portNo more portsNo such portid\~ݬPP Ь[ZZZPЬ[ЬZЬ YY kPYP kPzQQPЬ[ЬZ[XY YY  YXP0    !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T3RBcHݭRP֭S}TTP/PacTeR}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R^tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[ PPYYX1XX߭ ~nPYj~P ,, BЫZ֫ZPѫPѬ ZPPXPZ ~PYZkn 1mЫZ3[LK1xݏ<PZZ  YYX ZYYXZYZ ~PY2kZXY 1ЬPЬ[ PʏPP@ЫZ:ZY3Z P2PPkYZ ~3PY PPr[ [[[ Ь[Z < 7[gPZ ~YPZ ݫ ԫ kZP} Ь[ЬZkPkPzQQPPpP^߭ݬDPPP@0ݬݏ tݬݬݏtݬ6< PЬPЬRRQ{RPRPPPRRPP1.nB1n:14171%1(1~*PY1[1k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ0 [nP0YPƏPxP0bPZx0PZPPZx0~@PZZZe0^0PZPQ0xR0PZPPjj;0n/01xYP[P0Z0 00k0/k[P Ь[[ZZZ/jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPA/@j ~\S^\_ P CЬ PЬPЬRRQ{RPPR PRPPP&P@(#)ld.c 4.3 2/7/81O@DTJJJJJJJ%s: -o where?-u or -c: arg missing-H: arg missing-H: too late, some text already loaded-A: arg missing-A: only one base file allowed-D: arg missing-D: too small-T: arg missing-T: too late, some text already loadedld: -i ignored -y: symbol name missingran out of memory (-y)-xbad flagbadly formed hex numberl.out%s: %s warning: archive has no table of contents; add one using ranlib(1)ran out of memory (toc)ran out of memory (tocstr)mangled archive table of contentswarning: table of contents for archive is out of date; rerun ranlib(1)too many files loaded from librariesran out of memory (nextlibp) %s no namelisttoo small (old format .o?)no space for string tablebad string table index (pass 1)_end_etext_edata_endUndefined: %s %s: user attempt to redfine loader-defined symbolentry point not in textran out of memory (outb)libseg botchout of space reading string table (pass 2)bad string table index (pass 2)internal error: symbol not foundlocal symbol overflowout of memory (clocseg)%s: multiply defined%s(%s): definition of common %s size %d definition ofreference to external %s %s out of memory (load2td)load2td botch: bad lengthlocal symbol botchrelocation format botch (symbol type))byte displacement overflowword displacement overflowa.outl.outa.outcannot move l.out to a.outa.outpremature EOFloader error; odd offsetbotch: no pagespremature EOF/usr/local/lib/libxxxxxxxxxxxxxxx-la/usr/lib/libxxxxxxxxxxxxxxxcannot openpremature EOF! __.SYMDEFran out of space for symbol tablehash table botchsymbol table overflowsymfree botchenter botchsymx botchld:%s(%s):(( %s old archivebad magic numbertext/data size oddbad formatran out of memory (savestr)output write erroroutput write errorl.outundefinedabsolutetextdatabsscommon'  AAAAAABBBBBB jj|Ln r<@-tt-(y-0-7q.>(.F8.OT1X~|1a|1j$1t1~11 2fD:y<<H<H<h<x<<<<<<==$=L=7x???%?.<<4:~<@r@I aLQ OZ Ob Ok !Ot UO| O ~O O pO O O@A S DT/A X X X Y qY  Y ;,a ,u= 1= -z "*M4],=FHg#Q<h<XZ _L et-kPx*rE:"y L=@ -    (l)x<z(%y>&%[ |b zb.(. f8.4+"`+*+f,39Ux A[HHCQH<YLc!mBv$={.1<@#$|1<1 f f1 f???J.c nh?mcrt0.old.o_sccsidatol.ocalloc.ochmod.oatoi.olink.ocreat.oerrlst.oprintf.octype_.ostrlen.ostrncmp.ostrncpy.osignal.olseek.odoprnt.oflsbuf.oexit.odata.ostrcmp.oclose.ofstat.oisatty.oopen.oread.ostty.oioctl.oumask.ounlink.ourem.omalloc.osbrk.oudiv.owrite.ocerror.o_exitstart_main_environ_symseg_csymseg_cursym_lastsym_nextsym_addsym_nsym_p_etext_p_edata_p_end_entrypt_li_init_libseg_clibseg_lochash_lhinit_locseg_clocseg_tnum_ssiz_tab_tabstr_page_fpage_text_reloc_filhdr_archdr_trace_xflag_Xflag_Sflag_rflag_arflag_sflag_Mflag_nflag_dflag_zflag_hsize_Aflag_Nflag_funding_yflag_ytab_tsize_dsize_bsize_trsize_drsize_ssize_ctrel_cdrel_cbrel_textbase_database_torigin_dorigin_borigin_errlev_delarg_biobufs_biofd_boffset_tout_dout_trout_drout_sout_strout_offset_ofilfnd_ofilename_infil_filname_curstr_signal_delexit_load1arg_printf_savestr_error_slookup_enter_atoi_htoi_calloc_endload__ctype__bflush_unlink_umask_chmod_middle_setupout_load2arg_bflushc_finishout_getfile_close_load1_step_atol_round_dseek_mget_malloc_ldrand_cfree_nextlibp_getarhdr_symx_readhdr_fstat_symreloc_lookup_free_symfree_ldrsym_fixspec_wroff_toutb_creat_errno_sys_errlist_bopen_bwrite_bflush1_outb_mkfsym_load2_tynames_strcmp_tracesym_symwrite_load2tdurem_link_lseek_read_get_strlen_open_strncmp_savetab_saveleft_strncpy_bwrerror_writeudivcerror_sys_nerr__iob__doprnt__flsbuf_isatty__sobuf_fflush__cleanup_fclose__lastbuf__sibuf_gtty_stty_ioctl_sbrk_realloc_end_brkound_dseek_mget_malloc_ldrand_cfree_nextlibp_getarhdr_symx_readhdr_fstat_symreloc_lookup_free_symfree_ldrsym_fixspec_wroff_toutb_creat_errno_sys_errlist_bopen_bwrite_bflush1_outb_mkfsym_load2_tynames_strcmp_tracesym_symwrite_load2tdurem_link_lseek_read_get_strlen_open_strncmp_savetab_saveleft_strncpy_bwrerror_writeudivcerror_sys_nerr__iob__doprnt__flsbuf_isatty__sobuf_fflush__cleanup_lib/lisp/step.doc 664 0 33 6101 2527227502 7215 How to Use the step Facility The LISP "stepping" package is intended to give the LISP programmer a facility analogous to the Instruction Step mode of running a machine language program. The package contains two compiled functions which are loaded by (fasl "/m2/c122/ucb/lib/lisp/step") The user interface is through the function (fexpr) step, which sets switches to put the LISP interpreter in and out of "stepping" mode. The basic commands are: (step t) Turn on stepping mode. (step nil) Turn off stepping mode. These commands are usually typed at top level, and will take effect immediately (i.e. the next S-exp typed in will be evaluated in stepping mode). In stepping mode, the LISP evaluator will print out each S-exp to be evaluated before evaluation, and the returned value after evaluation, calling itself recursively to display the stepped evaulation of each argument, if the S-exp is a function call. In stepping mode, the evaluator will wait after displaying each S-exp before evaluation for a command character from the console: Continue stepping recursively. c Show returned value from this level only, and continue stepping upward. g Turn off stepping mode. (but continue evaluation without stepping). p Redisplay current form in full (i.e. rebind prinlevel and prinlength to nil) b Get breakpoint q Quit d Call debug **************** More Advanced Features ************************* Selectively turning on step: (step foo1 foo2 ...) If this command is typed at top level, stepping will not commence immediately, but rather when the evaluator first encounters a S-expr whose car is one of foo1, foo2, etc. This form will then display at the console, and the evaluator will be in stepping mode waiting for a command character. Using step with breakpoints: For the moment, step is turned off inside of error breaks, but not by the break function. Upon exiting the error, step is reenabled. However, executing (step nil) inside a error loop will turn off stepping globally, i.e. within the error loop, and after return has be made from the loop. (The more extensive capabilities of the Maclisp version will await full development of the Franz error handling capability.) Overhead of Stepping: If stepping mode has been turned off by (step nil), the execution overhead of having the stepping packing in your LISP is identically nil. If one stops stepping by typing , every call to eval incurs a small overhead--several machine instructions, corresponding to the compiled code for a simple cond and one function pushdown. Running with (step foo1 foo2 ...) can be more expensive, since a member of the car of the current form into the list (foo1 foo2 ...) is required at each call to eval. g: If stepping mode has been turned off by (step nil), the execution overhead of having the stepping packing in your LISP is identically nil. If one stops stepping by typing , every call to eval incurs a small overhead--several machine instructions, corresponding to the compiled code for a simple cond and one function pushdown. Running with (step foo1 foo2 ...) can be more expensive, since a member of the car of the current form i((lib/lisp/step.l 444 0 33 16614 2552754323 6735 (setq SCCS-step "@(#)step.l 1.3 7/9/81") ; vi: set lisp : ;;; LISP Stepping Package ;;; ;;; Adapted by Mitch Marcus for Franz Lisp from Chuck Rich's MACLISP ;;; package. ;;; ;;; ;;; Adapted 2/80 from the Maclisp version of 11/03/76 ;;; Further modified 5/80 by Don Cohen (DNC) ;;; ;;; modified by jkf 6/81 to handle funcallhook. ;;; ;;; User Interface Function ;;; ;;; Valid Forms: ;;; (step) or (step nil) :: turn off stepping ;;; (step t) :: turn on stepping right away. ;;; (step e) :: turn on stepping of eval only ;;; (step foo1 foo2 ...) :: turn on stepping when one of fooi is ;;; :: called ;;; ;------ implementation: ; evalhook* is nil meaning no stepping, or t meaning always step ; or is a list of forms which will start continuous stepping. ; ; The hook functions are evalhook* and funcallhook*. ; (declare (special evalhook-switch piport hookautolfcount funcallhook evalhook evalhook* |evalhook#| prinlevel prinlength fcn-evalhook fcn-funcallhook) (macros nil)) ;; First Some Macros (defun 7bit macro (s) ;; (7BIT n c) tests if n is ascii for c (list '= (list 'boole 1 127. (cadr s)) (caddr s))) ;--- print* ; indent based on current evalhook recursion level then print the ; arg in form ; (defun print* macro (s) ;; print with indentation '(do ((i 1 (1+ i)) (indent (* 2 |evalhook#|)) (prinlevel 3) (prinlength 5)) ((> i indent) (cond ((eq type 'funcall) (patom "f:"))) (print form)) (tyo 32.))) (defun step fexpr (arg) (cond ((or (null arg) (car arg)) (setq evalhook-switch t) ; for fixit package (setq |evalhook#| 0.) ;initialize depth count (setq hookautolfcount 0) ; count if auto lfs at break (setq evalhook nil) ;for safety (setq funcallhook nil) ; (step e) means just step eval things, else step eval and funcal (cond ((eq (car arg) 'e) (setq fcn-evalhook 'evalhook* fcn-funcallhook nil)) (t (setq fcn-evalhook 'evalhook* fcn-funcallhook 'funcallhook*))) (setq evalhook* (cond ((null arg) nil) ((or (eq (car arg) t) (eq (car arg) 'e))) (arg))) (setq evalhook fcn-evalhook) ;turn system hook to my function (setq funcallhook fcn-funcallhook) (sstatus translink nil) (*rset t) ;must be on for hook to work (sstatus evalhook t)) ;arm it (t (setq evalhook* nil) (setq evalhook nil) (setq hookautolfcount 0) ; count if auto lfs at break (setq evalhook-switch nil) (sstatus evalhook nil)))) ;---- funcall-evalhook* ; ; common function to handle evalhook's and funcallhook's. ; the form to be evaluated is given as form and the type (eval or funcall) ; is given as type. ; (defun funcall-evalhook* (form type) (cond (evalhook* ;; see if selective feature kicks in here (and (not (atom form)) (not (eq evalhook* t)) (memq (car form) evalhook*) (setq evalhook* t)) ; yes, begin stepping always (cond ((eq evalhook* t) ;; print out form before evaluation (print*) (cond ((atom form) ;; since form is atom, we just eval it and print ;; out its value, no need to ask user what to do (cond ((not (or (numberp form)(null form)(eq form t))) (princ '" = ") ((lambda (prinlevel prinlength) (setq form (evalhook form nil nil)) (print form)) 3 5))) (terpri)) (t ; s-expression (prog (cmd ehookfn fhookfcn) cmdlp (cond ((greaterp hookautolfcount 0) (setq hookautolfcount (sub1 hookautolfcount)) (terpr) (setq cmd #\lf)) (t (setq cmd(let ((piport nil)) (drain piport) (tyi piport))))) ;; uppercase alphabetics ;; dispatch on command character (cond ((eq cmd #\lf) ; \n so continue (setq ehookfn fcn-evalhook fhookfcn fcn-funcallhook)) ((memq cmd '(#/p #/P)) ; "P" print in full (drain piport) (print form) (go cmdlp)) ; "G" ((memq cmd '(#/g #/G)) (drain piport) (setq evalhook* nil ;stop everything ehookfn nil fhookfcn nil)) ((memq cmd '(#/c #/C)) ;"C" no deeper (drain piport) (setq ehookfn nil fhookfcn nil)) ((memq cmd '(#/d #/D)) ;"D" call debug (setq evalhook-switch nil) (sstatus evalhook nil) (debug) (setq evalhook-switch t) (sstatus evalhook t) (go cmdlp)) ((memq cmd '(#/b #/B)) ; "B" give breakpoint (drain piport) (break step) (print*) (go cmdlp)) ((memq cmd '(#/q #/Q)) ; "Q" stop stepping (step nil) (reset)) ((memq cmd '(#/n #/N)) (setq hookautolfcount (let ((piport nil)) (read))) (cond ((not (numberp hookautolfcount)) (patom "arg to n should be number") (terpr) (setq hookautolfcount 0)))) ; "e" step eval only ((memq cmd '(#/e #/E)) (setq fcn-funcallhook nil)) ; "?", "H" show the options ((memq cmd '(72 104 63.)) #+cmu (ty /usr/lisp/doc/step\.ref) #-cmu(stephelpform) (terpri) (drain piport) (go cmdlp)) (t (princ '"Try one of ?BCDGMPQ or ") (drain piport) (go cmdlp))) ;; evaluate form ((lambda (|evalhook#|) (setq form (continue-evaluation form type ehookfn fhookfcn))) (1+ |evalhook#|)) ;; print out evaluated form (cond ((and evalhook* (or (eq type 'funcall) (not (zerop |evalhook#|)))) (let ((type nil)) (print*)) (terpri) ))))) ;;return evaluated form form) (t (continue-evaluation form type fcn-evalhook fcn-funcallhook)))) (t (continue-evaluation form type fcn-evalhook fcn-funcallhook)))) ;--- stephelpform ; ; print a summary of the functions of step ; (defun stephelpform nil (patom " - single step; n - step times")(terpr) (patom "b - break; q - quit stepping; d - call debug;") (terpri) (patom "c - turn off step for deeper levels; e - stop at eval forms only") (terpri) (patom "h,? - print this") (terpr)) ;--- funcallhook* ; ; automatically called when a funcall is done and funcallhook*'s ; value is the name of this function (funcallhook*). When this is ; called, a function with n-1 args is being funcalled, the args ; to the function are (arg 1) through (arg (sub1 n)), the name of ; the function is (arg n) ; (defun funcallhook* n (let ((name (arg n)) (args (listify (sub1 n)))) (funcall-evalhook* (cons name args) 'funcall))) ;--- evalhook* ; ; called whenever an eval is done and evalhook*'s value is the ; name of this function (evalhook*). arg is the thing being ; evaluated. ; (defun evalhook* (arg) (funcall-evalhook* arg 'eval)) (defun continue-evaluation (form type evalhookfcn funcallhookfcn) (cond ((eq type 'eval) (evalhook form evalhookfcn funcallhookfcn)) (t (funcallhook form funcallhookfcn evalhookfcn)))) (or (boundp 'prinlength) (setq prinlength nil)) (or (boundp 'prinlevel) (setq prinlevel nil)) uncall))) ;--- evalhook* ; ; called whenever an eval is done and evalhook*'s value is the ; name of this functionlib/lisp/step.ref 664 0 33 577 2527227503 7220 Stepper commands: Continue stepping recursively. b cause a break c evaluate this expression without stepping, then resume stepping d call debug g turn off stepping mode and finish evaluation h, ? print this help m do a macro expansion p display current form in full (without &'s) s skip this one q quit (reset) ----> For more documentation see /usr/lisp/doc/step.doc level nil)) uncall))) ;--- evalhook/( ,( 54h /\@,\D"lib/lisp/syscall.l 644 0 33 4125 2552754311 7405 (setq SCCS-syscall "@(#)syscall.l 1.3 5/15/81") ; ; syscall ; ; This file contains macro definitions of some of the Unix system calls. ; The documentation for these system calls can be found in the Unix ; manual. ; ; It is believed that all of these system calls can be executed by the ; Unix emulator Eunice under VMS. ; ; Unix system calls which return values in registers other than r0 cannot ; be called in this way. An example of this is fork, for which there is ; a seperate lisp function. (declare (m((acros t)) (defmacro sys_access (name mode) `(syscall 33 ,name ,mode)) (defmacro sys_alarm (secs) `(syscall 27 ,secs)) (defmacro sys_brk (addr) `(syscall 17 ,addr)) (defmacro sys_chdir (dir) `(syscall 12 ,dir)) (defmacro sys_chmod (name mode) `(syscall 15 ,name ,mode)) (defmacro sys_chown (name ownerid groupid) `(syscall 16 name ownerid groupid)) (defmacro sys_close (filedes) `(syscall 6 ,filedes)) (defmacro sys_creat (name mode) `(syscall 8 ,name ,mode)) (defmacro sys_exit (status) `(syscall 1 ,status)) (defmacro sys_getpid nil `(syscall 20)) (defmacro sys_getuid nil `(syscall 24)) (defmacro sys_getgid nil `(syscall 47)) ; sys_kill - need to get value into r0 (defmacro sys_kill (pid) `(syscall 37 ,pid)) (defmacro sys_link (name newname) `(syscall 9 ,name ,newname)) (defmacro sys_nice (value) `(syscall 34 ,value)) ; sys_lseek this may not be correct the explanation is given for a pdp-11 ; where certain values must be stored in two words. ; also need to get value into r0 (defmacro sys_open (name how) `(syscall 5 ,name ,how)) (defmacro sys_pause nil `(syscall 29)) (defmacro sys_setuid (uid) `(syscall 23 ,uid)) (defmacro sys_setgid (gid) `(syscall 46 ,gid)) (defmacro sys_sync nil `(syscall 36)) (defmacro sys_time nil `(syscall 13)) (defmacro sys_umask (complementmode) `(syscall 60 ,complementmode)) (defmacro sys_unlink (name) `(syscall 10 ,name)) (defmacro sys_wait nil `(syscall 7)) (defmacro sys_ioctl (portnumber arg) `(syscall 54 ,portnumber ,arg)) (putprop 'syscall t 'version) ; flag that this file has been loaded se nil `(syscall 29)) (defmacro sys_setuid (uid) `(syscall 23 ,uid)) (defmacro sys_setgid (gid) `(syscall 46 ,gid)) (defmacro sys_sync nil `(syscall 36)) (defmacro sys_time nil `(syscall 13)) (defmacro sys_umask (complementmode) `(syscall 60 ,complementmode)) (defmacro sys_unlink (name) `(syscall 10 ,name)) (defmacro sys_wait nil `(syscall 7)) (defmacro sys_ioctl (portnumber arg) `(syscall 54 ,porlib/lisp/tackon 775 0 33 23364 2527227504 7014  ^Юn PPՀPpPP PL^׬լѬk!gЬP`Pi"PЬP`(3Ѭ ЬPРPfPPMP*"PQ= P")P 2P PTPXPhPlP`P~!߭!ݭsPݭP!P 2P PTPXPhPlP`P~V!ԭD!4!2߭|PK߭fPP|ޭQQPLL 2߭GP1C ߭ 3ݭݭ  PP~   PP`v  Pc 3߭ݭx߭Эpt p {|PP|PP֭ѭL1T1ݬ \~ݬЬP PPЬ [ЬY׬&k ЫP֫`P [ PZZZ Z YPЬPЬ[ XXBPX 鑫+PPPYkw+ݏݬPZY1ZZkalYPPPݬPZ<(3ݏݬ}PZYZZݬPZZ)Z YPPPݬPZZ1hZY kr  XP lP@X[ݬM PZZݬZI[ P[3d" *DVhx )8I]q Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large\~ݬ PP\~ݬYJ \~ݬݬ5^Ь[A[[ԭ֭ \~ݬ߭^Ь[Ь Zԭԭ1)ЬPРQ֠aP1LYY%1/ԭY* ZZYԭ PYP0PYIխ20uYlԭ蘋YYhY[ [P[I YYP߭ݬݭݭYݭPխ֭խVխЭPP׼ЬPРQ֠aP ݬPP P P P ݬPYYPPJP P P P%1׼1ݬ%PPYP14ݬPPЭP^ѬcѬs Ѭ[#ݬݬݬ ݬլмPPPԭԭԭѬe Ѭf YѬoY ѬxYޭ[ԭԭ׼ЬPРQ֠aP ݬNPZP Z Z Z-.֭Z׼ЬPРQ֠aP ݬPZ׬ 1Z+׬ ׼1ݬ1Za ZfZA1ZF֭YxY xPPPPxZJs0ZZaZf WZ7ZZЭZY 1խ֭Z׼1LЬPРQ֠aPPZ׬ ~J 1^Y1/Z.Ze ZESխNY IխDխ?֭Z׼ЬPРQ֠aP ݬPZZ+1pZ-Z0Z9խέZݬZԼլ ޭP[PPxPȬPPPZZ&&&&&&&&&&&&&**=P߭мRvPb߭мRpPbмP`мPЭ`^Ь[ЬZԼ[XѬcѬ 0u ԭѬsj ЪP֪`P ZPYҭQ@PQP YѬcԭIѬ[?9ҭPIQPQ1[Y׬ %j ЪP֪`P Z9PYYYլ  ZY`Լ[[XѬcPPЬ[Yk^Y[ZY J2J(Z☋ZZPP]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YP[PZPxYP[PP[1[Zk[[ZZ [hP YPƏPxPbPZxPZPPZx~@PZZZPZPxPZPPjjhw1xYP[PdZ]UXkIBk[P Ь[[ZZZ)jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j~\S^\_PCЬPЬPЬRRQ{RPPR PRPPPPusage: tackon map [ a.out ] ra.out No object file to tackon or text busy missing value %x Tackon; string buffer overflow Unknown error: #  AAAAAABBBBBB TT"  AAAAAABBBBBB TTlib/lisp/toplevel.l 444 0 33 25114 2552754310 7603 (setq SCCS-toplevel "@(#)toplevel.l 1.5 7/9/81") ; vi: set lisp : ; special atoms: (declare (special debug-level-count break-level-count errlist tpl-errlist user-top-level franz-not-virgin piport ER%tpl ER%all $ldprint evalhook funcallhook top-level-eof * ** *** + ++ +++ ^w) (macros t)) (setq top-level-eof (gensym 'Q) tpl-errlist nil errlist nil user-top-level nil ) ;------------------------------------------------------ ; Top level function for franz jkf, march 1980 ; ; The following function contains the top-level read, eval, print ; loop. With the help of the error handling functions, ; break-err-handler and debug-err-handler, franz-top-level provides ; a reasonable enviroment for working with franz lisp. ; (def franz-top-level (lambda nil (cond ((or (not (boundp 'franz-not-virgin)) (null franz-not-virgin)) (setq franz-not-virgin t + nil ++ nil +++ nil * nil ** nil *** nil) (setq ER%tpl 'break-err-handler) (putd 'reset (getd 'franz-reset)) (cond ((not (autorunlisp)) (patom (status version)) (terpr) (read-in-lisprc-file))))) ; loop forever (do ((+*) (-) (retval)) (nil) (setq retval (*catch '(top-level-catch break-catch) ; begin or return to top level (progn (setq debug-level-count 0 break-level-count 0 evalhook nil funcallhook nil) (cond (tpl-errlist (mapc 'eval tpl-errlist))) (do ((^w nil nil)) (nil) (cond (user-top-level (funcall user-top-level)) (t (patom "-> ") (cond ((eq top-level-eof (setq - (car (errset (read nil top-level-eof))))) (cond ((not (status isatty)) (exit))) (cond ((null (status ignoreeof)) (terpr) (print 'Goodbye) (terpr) (exit)) (t (terpr) (setq - ''EOF))))) (setq +* (eval -)) ; update list of old forms (let ((val -)) (let ((o+ +) (o++ ++)) (setq + val ++ o+ +++ o++))) ; update list of old values (let ((val +*)) (let ((o* *) (o** **)) (setq * val ** o* *** o**))) (print +*) (terpr))))))) (terpr) (patom "[Return to top level]") (terpr) (cond ((eq 'reset retval) (old-reset-function)))))) ; debug-err-handler is the clb of ER%all when we are doing debugging ; and we want to catch all errors. ; It is just a read eval print loop with errset. ; the only way to leave is: ; (reset) just back to top level ; (return x) return the value to the error checker. ; if nil is returned then we will continue as if the error ; didn't occur. Otherwise if the returned value is a list, ; then if the error is continuable, the car of that list ; will be returned to recontinue computation. ; ^D continue as if this handler wasn't called. ; the form of errmsgs is: ; (error_type unique_id continuable message_string other_args ...) ; (def debug-err-handler (lexpr (n) ((lambda (message debug-level-count retval ^w piport evalhook funcallhook) (cond ((greaterp n 0) (print 'Error:) (mapc '(lambda (a) (patom " ") (patom a) ) (cdddr (arg 1))) (terpr))) (setq ER%all 'debug-err-handler) (do (retval) (nil) (cond ((dtpr (setq retval (errset (do ((form)) (nil) (patom "D<") (patom debug-level-count) (patom ">: ") (cond ((eq top-level-eof (setq form (read nil top-level-eof))) (cond ((null (status isatty)) (exit))) (return nil)) ((and (dtpr form) (eq 'return (car form))) (return (eval (cadr form)))) (t (print (eval form)) (terpr))))))) (return (car retval)))))) nil (add1 debug-level-count) nil nil nil nil nil))) ; this is the break handler, it should be tied to ; ER%tpl always. ; it is entered if there is an error which no one wants to handle. ; We loop forever, printing out our error level until someone ; types a ^D which goes to the next break level above us (or the ; top-level if there are no break levels above us. ; a (return n) will return that value to the error message ; which called us, if that is possible (that is if the error is ; continuable) ; (def break-err-handler (lexpr (n) ((lambda (message break-level-count retval rettype ^w piport evalhook funcallhook) (cond ((greaterp n 0) (print 'Error:) (mapc '(lambda (a) (patom " ") (patom a) ) (cdddr (arg 1))) (terpr) (cond ((caddr (arg 1)) (setq rettype 'contuab)) (t (setq rettype nil)))) (t (setq rettype 'localcall))) (do nil (nil) (cond ((dtpr (setq retval (*catch 'break-catch (do ((form)) (nil) (patom "<") (patom break-level-count) (patom ">: ") (cond ((eq top-level-eof (setq form (read nil top-level-eof))) (cond ((null (status isatty)) (exit))) (eval 1) ; force interrupt check (return (sub1 break-level-count))) ((and (dtpr form) (eq 'return (car form))) (cond ((or (eq rettype 'contuab) (eq rettype 'localcall)) (return (ncons (eval (cadr form))))) (t (patom "Can't continue from this error") (terpr)))) ((and (dtpr form) (eq 'retbrk (car form))) (cond ((numberp (setq form (eval (cadr form)))) (return form)) (t (return (sub1 break-level-count))))) (t (print (eval form)) (terpr))))))) (return (cond ((eq rettype 'localcall) (car retval)) (t retval)))) ((lessp retval break-level-count) (setq tpl-errlist errlist) (*throw 'break-catch retval)) (t (terpr))))) nil (add1 break-level-count) nil nil nil nil nil nil))) (def debugging (lambda (val) (cond (val (setq ER%all 'debug-err-handler) (*rset t)) (t (setq ER%all nil))))) ; the problem with this definition for break is that we are ; forced to put an errset around the break-err-handler. This means ; that we will never get break errors, since all errors will be ; caught by our errset (better ours than one higher up though). ; perhaps the solution is to automatically turn debugmode on. ; (defmacro break (message &optional (pred t)) `(*break ,pred ',message)) (def *break (lambda (pred message) (let ((^w nil)) (cond ((not (boundp 'break-level-count)) (setq break-level-count 1))) (cond (pred (terpr) (patom "Break ") (patom message) (terpr) (do ((form)) (nil) (cond ((dtpr (setq form (errset (break-err-handler)))) (return (car form)))))))))) ; this reset function is designed to work with the franz-top-level. ; When franz-top-level begins, it makes franz-reset be reset. ; when a reset occurs now, we set the global variable tpl-errlist to ; the current value of errlist and throw to top level. At top level, ; then tpl-errlist wil((l be evaluated. ; (def franz-reset (lambda nil (setq tpl-errlist errlist) (errset (*throw 'top-level-catch 'reset) nil) (old-reset-function))) ; this definition will have to do until we have the ability to ; cause and error on any channel in franz (def error (lexpr (n) (cond ((greaterp n 0) (patom (arg 1)) (cond ((greaterp n 1) (patom " ") (patom (arg 2)))) (terpr))) (err))) ; this file is read in just before dumplisping if you want .lisprc ; from your home directory read in before the lisp begins. (def read-in-lisprc-file (lambda nil ((lambda (hom prt) (setq break-level-count 0 ; do this in case break debug-level-count 0) ; occurs during readin (*catch '(break-catch top-level-catch) (cond (hom (cond ((and (errset (progn (setq prt (infile (concat hom '"/.lisprc"))) (close prt)) nil) (null (errset (load (concat hom '"/.lisprc"))))) (patom '"Error in .lisprc file detected") (terpr))))))) (getenv 'HOME) nil))) (putd 'top-level (getd 'franz-top-level)) ; if this is the first time this file has been read in, then ; make franz-reset be the reset function, but remember the original ; reset function as old-reset-function. We need the old reset function ; if we are going to allow the user to change top-levels, for in ; order to do that we really have to jump all the way up to the top. (cond ((null (getd 'old-reset-function)) (putd 'old-reset-function (getd 'reset)))) ;---- autoloader functions (def undef-func-handler (lambda (args) (prog (funcnam file) (setq funcnam (caddddr args)) (cond ((symbolp funcnam) (cond ((setq file (get funcnam 'autoload)) (cond ($ldprint (patom "[autoload ") (patom file) (patom "]")(terpr))) (load file)) (t (return nil))) (cond ((getd funcnam) (return (ncons funcnam))) (t (patom "Autoload file does not contain func ") (return nil)))))))) (setq ER%undef 'undef-func-handler) (declare (special $ldprint)) ;--- autorunlisp :: check if this lisp is supposed to run a program right ; away. ; (defun autorunlisp nil (cond ((and (> (argv -1) 2) (equal (argv 1) '-f)) (let ((progname (argv 2)) ($ldprint nil) (searchlist nil)) ; don't give fasl messages (setq searchlist (cvtsearchpathtolist (getenv 'PATH))) ; give two args to load to insure that a fasl is done. (cond ((null (errset (load-autorunobject progname searchlist))) (exit 0)) (t t)))))) (defun cvtsearchpathtolist (path) (do ((x (explodec path) (cdr x)) (names nil) (cur nil)) ((null x) (nreverse names)) (cond ((or (eq ': (car x)) (and (null (cdr x)) (setq cur (cons (car x) cur)))) (cond (cur (setq names (cons (implode (nreverse cur)) names)) (setq cur nil)) (t (setq names (cons '|.| names))))) (t (setq cur (cons (car x) cur)))))) (defun load-autorunobject (name search) (cond ((memq (getchar name 1) '(/ |.|)) (cond ((probef name) (fasl name)) (t (error "From lisp autorun: can't find file to load")))) (t (do ((xx search (cdr xx)) (fullname)) ((null xx) (error "Can't find file to execute ")) (cond ((probef (setq fullname (concat (car xx) "/" name))) (return (fasl fullname)))))))) (defun debug fexpr (args) (load 'fix) ; load in fix package (eval (cons 'debug args))) ; enter debug through eval ;-- default autoloader properties (putprop 'trace '/usr/lib/lisp/trace 'autoload) (putprop 'step '/usr/lib/lisp/step 'autoload) error "From lisp autorun: can't find file to load")))) (t (do ((xx search (cdr xx)) (fullname)) ((null xx) (error "Can't find file to execute ")) (cond ((probef (setq fullname (concat (car xx) "/" name))) (return (fasl fullname)))))))) (defun debug fexpr (args) (load 'fix) ; load in fix package (eval (cons 'debug args))) ; enter debug through eval ;-- default autoloader properties (putprop 'trace '/lib/lisp/toplevel.o 664 0 33 22154 2552754320 7614 hhXWZjVhWWVPո1иԸԸ ԸԸԸԸШ$ Ш(Ш,PРWWVfWWVP?Ш0WWVPWWVfWWVfWWVPPԆԆԆP1Ш4PP+P$ P1*Џ8Џ<Ը@ԸDոH6ԆиH Ъ ժPЪTФWWVкVPԆUиLШLЪ LUP1ոPиPWWV1zШTWWVиXиPPݨ\XPQK CPԆиXWwWVPԆ!QС РЪPvP1Ш`W WVPfW1WVPШdWWVP;fWWVШhWWVfWWVfWWVfWWVШlPЪWWVPjЪии ЪЪ Ъ VjииЪЪЪ VjWmWVfW0WVԸL1]UХUVQС PfWWVШpWWVfWWVѨ(ԆWWVP1IXW~VZWVPj~Ԇи8WWVPԆԆԆԆԆGUиDШDЪDи@Ш@Ъ@иtШtЪtиLШLЪLи8Ш8Ъ8UjЏWYWVPyШxW+WVԆP@PаP` Ъ ժ$P6Ъ$TФШ|WWVЪ(WWVVк$$VfWWVPȀ\ԆP1nиPPݨ\EP>8 0P1ԆP1ȄW1WVи8WWVȈW WVиXԆиXWWVP$Ъ$PvP,ȌWWVPfWWVPPmx$P@*ȐЪ$TФPvPк$TФWWV3Ъ$WWVPWWVfWYWV1VPԆQС P Ъ PxPP@ Ъ TФPP1VUХХХХХص(UXW~VZWVPj~Ԇи "top-level-eofER%all(isatty)(ignoreeof)Goodbye(quote EOF)"[Return to top level]"piportError:" "debug-err-handler"D<"">: "(isatty)return" "contuablocalcallbreak-catch"<"">: "(isatty)"Can't continue from this error"retbrkerrlist*breakquote"Break "top-level-catch" "HOME(break-catch top-level-catch)"/.lisprc""/.lisprc""Error in .lisprc file(( detected"autoload$ldprint"[autoload ""]""Autoload file does not contain func "-fPATH:\.(/ \.)"From lisp autorun: can't find file to load""Can't find file to execute ""/"fixdebugboundpputdautorunlispstatuspatomterprread-in-lisprc-fileevalfuncallreadexitprintold-reset-functionadd1greaterpsub1lessp*rsetbreak-err-handlererrgetenvconcatinfilecloseloadargvequalcvtsearchpathtolistload-autorunobjectexplodecnreverseimplodegetcharprobeffaslerror(setq SCCS-toplevel "@(#)toplevel.l 1.5 7/9/81")(setq top-level-eof (gensym (quote Q)) tpl-errlist nil errlist nil user-top-level nil)franz-top-leveldebug-err-handlerbreak-err-handlerdebuggingbreak*breakfranz-reseterrorread-in-lisprc-file(putd (quote top-level) (getd (quote franz-top-level)))(cond ((null (getd (quote old-reset-function))) (putd (quote old-reset-function) (getd (quote reset)))))undef-func-handler(setq ER%undef (quote undef-func-handler))autorunlispcvtsearchpathtolistload-autorunobjectdebug(putprop (quote trace) (quote /usr/lib/lisp/trace) (quote autoload))(putprop (quote step) (quote /usr/lib/lisp/step) (quote autoload))  [ h ~        , E Z w            1 B T a n }       # 1 C P g z     ) b t         ( H Y q          ? H m     6 H b         2 C \ n       "  9 Z  p            ?  H  i  ~            ,  P  c  u               (  D  K  Q  Y  l w  }          '  8  I  U  l             " ( 1 I P V ^ t           " > P c p       " A Q i y             , B `        ' Q f {       * 8  %+3?DKvR]DdqD xz  $  Q (@H$eF00007linkertrantb_qpushframe_errp_retval_lispretval_bnp_qconsF00041_typetableF00068_InonlocalgoF00109F00113F00117F00130F00134F00144F00157_qgetF00168F00179F00190F00203bind_orglinker_sizetrans_sizelit_orglit_endDKvR]DdqD xz  $  Q (@H$eF00007linkertrantb_qpushframe_errp_retval_lispretval_bnp_qconsF00041_typetableF00068_InonlocalgoF00109F00113F00117F0lib/lisp/trace.l 444 0 33 31442 2552754313 7053 (setq SCCS-trace "@(#)trace.l 1.9 4/24/81") ;---- The Joseph Lister Trace Package, v1 ; John Foderaro, Sept 1979 ;------------------------------------------------------------------; ; Copyright (c) 1979 The Regents of the University of California ; ; All rights reserved. ; ;------------------------------------------------------------------; (eval-when (eval) (setq old-read-table-trace readtable) (setq readtable (makereadtable t)) (setq old-uctolc-value (status uctolc)) (sstatus uctolc nil) ; turn off case conversion (load 'backquote) ) (declare (nlambda T-status T-sstatus) (special piport if ifnot evalin evalout printargs printres evfcn traceenter traceexit prinlevel prinlength $$functions-in-trace$$ ; active functions $$funcargs-in-trace$$ ; arguments to active functions. $tracemute ; if t, then enters and exits ; are quiet, but info is still ; kept so (tracedump) will work )) (cond ((null (boundp '$$traced-functions$$)) (setq $$traced-functions$$ nil))) (cond ((null (boundp '$$functions-in-trace$$)) (setq $$functions-in-trace$$ nil))) (cond ((null (boundp '$$funcargs-in-trace$$)) (setq $$funcargs-in-trace$$ nil))) (cond ((null (boundp '$tracemute)) (setq $tracemute nil))) ;----> It is important that the trace package not use traced functions ; thus we give the functions the trace package uses different ; names and make them equivalent at this time to their ; traceable counterparts. (defun trace-startup-func nil (do ((i '( (add1 T-add1)(append T-append) (and T-and) (apply T-apply) (cond T-cond) (cons T-cons) (delq T-delq) (def T-def) (do T-do) (drain T-drain) (dtpr T-dtpr) (eval T-eval)(funcall T-funcall) (get T-get) (getd T-getd)(getdisc T-getdisc) (greaterp T-greaterp)(lessp T-lessp) (mapc T-mapc) (not T-not)(nreverse T-nreverse) (patom T-patom) (print T-print) (prog T-prog) (patom T-patom)(putd T-putd) (putprop T-putprop) (read T-read)(remprop T-remprop) (reverse T-reverse) (return T-return) (set T-set) (setq T-setq) (status T-status) (sstatus T-sstatus) (sub1 T-sub1) (terpr T-terpr) (zerop T-zerop)) (cdr i))) ((null i)) (putd (cadar i) (getd (caar i))) (putprop (cadar i) t 'Untraceable))) (trace-startup-func) (putprop 'quote t 'Untraceable) ; this prevents the common error ; of (trace 'foo) from causing big ; problems. ;--- trace - arg1,arg2, ... names of functions to trace ; This is the main user callable trace routine. ; work in progress, documentation incomplete since im not sure exactly ; where this is going. ; (def trace (nlambda (argl) (prog (if ifnot evalin evalout funnm funcd did break printargs printres evfcn traceenter traceexit) ; turn off transfer table linkages if they are on (cond ((T-status translink) (T-sstatus translink nil))) ; process each argument (do ((ll argl (cdr ll)) (funnm) (funcd)) ((null ll)) (setq funnm (car ll) if t break nil ifnot nil evalin nil evalout nil printargs nil printres nil evfcn nil traceenter 'T-traceenter traceexit 'T-traceexit) ; a list as an argument means that the user is specifying ; conditions on the trace (cond ((not (atom funnm)) (cond ((not (atom (setq funnm (car funnm)))) (T-print (car funnm)) (T-patom '" is non an function name") (go botloop))) (do ((rr (cdar ll) (cdr rr))) ((null rr)) (cond ((memq (car rr) '(if ifnot evalin evalout printargs printres evfcn traceenter traceexit)) (T-set (car rr) (cadr rr)) (setq rr (cdr rr))) ((eq (car rr) 'evalinout) (setq evalin (setq evalout (cadr rr)) rr (cdr rr))) ((eq (car rr) 'break) (setq break t)) ((eq (car rr) 'lprint) (setq printargs 'T-levprint printres 'T-levprint)) (t (T-patom '"bad request: ") (T-print (car rr)) (T-terpr)))))) ; if function is untraceable, print error message and skip (cond ((get funnm 'Untraceable) (setq did (cons `(,funnm untraceable) did)) (go botloop))) ; if function is already traced, untrace it first (cond ((get funnm 'original) (apply 'untrace `(,funnm)) (setq did (cons `(,funnm untraced) did)))) ; store the names of the arg printing routines if they are ; different than print (cond (printargs (T-putprop funnm printargs 'trace-printargs))) (cond (printres (T-putprop funnm printres 'trace-printres))) ; we must determine the type of function being traced ; in order to create the correct replacement function (cond ((setq funcd (T-getd funnm)) (cond ((bcdp funcd) ; machine code (cond ((or (eq 'lambda (T-getdisc funcd)) (eq 'nlambda (T-getdisc funcd)) (eq 'macro (T-getdisc funcd))) (setq typ (T-getdisc funcd))) ((stringp (T-getdisc funcd)) ; foreign func (setq typ 'lambda)) ; close enough (t (T-patom '"Unknown type of compiled function") (T-print funnm) (setq typ nil)))) ((dtpr funcd) ; lisp coded (cond ((or (eq 'lambda (car funcd)) (eq 'lexpr (car funcd))) (setq typ 'lambda)) ((or (eq 'nlambda (car funcd)) (eq 'macro (car funcd))) (setq typ (car funcd))) (t (T-patom '"Bad function definition: ") (T-print funnm) (setq typ nil)))) ((arrayp funcd) ; array (setq typ 'lambda)) (t (T-patom '"Bad function defintion: ") (T-print funnm))) ; now that the arguments(( have been examined for this ; function, do the tracing stuff. ; First save the old function on the property list (T-putprop funnm funcd 'original) ; now build a replacement (cond ((eq typ 'lambda) (T-eval `(T-def ,funnm (lexpr (T-nargs) ((lambda (T-arglst T-res T-rslt $$functions-in-trace$$ $$funcargs-in-trace$$) (T-do ((i T-nargs (T-sub1 i))) ((T-zerop i)) (T-setq T-arglst (T-cons (arg i) T-arglst))) (T-setq $$funcargs-in-trace$$ (T-cons T-arglst $$funcargs-in-trace$$)) (T-cond ((T-setq T-res (T-and ,if (T-not ,ifnot))) (,traceenter ',funnm T-arglst) ,@(cond (evalin `((T-patom ,'":in: ") ,evalin (T-terpr)))) (T-cond (,break (trace-break))))) (T-setq T-rslt ,(cond (evfcn) (t `(T-apply ',funcd T-arglst)))) (T-cond (T-res ,@(cond (evalout `((T-patom ,'":out: ") ,evalout (T-terpr)))) (,traceexit ',funnm T-rslt))) T-rslt) nil nil nil (T-cons ',funnm $$functions-in-trace$$) $$funcargs-in-trace$$)))) (setq did (cons funnm did) $$traced-functions$$ (cons funnm $$traced-functions$$))) ((or (eq typ 'nlambda) (eq typ 'macro)) (T-eval `(T-def ,funnm (,typ (T-arglst) ((lambda (T-res T-rslt $$functions-in-trace$$ $$funcargs-in-trace$$) (T-setq $$funcargs-in-trace$$ (T-cons T-arglst $$funcargs-in-trace$$)) (T-cond ((T-setq T-res (T-and ,if (not ,ifnot))) (,traceenter ',funnm T-arglst) ,evalin (T-cond (,break (trace-break))))) (T-setq T-rslt ,(cond (evfcn `(,evfcn ',funcd T-arglst)) (t `(T-apply ',funcd T-arglst)))) (T-cond (T-res ,evalout (,traceexit ',funnm T-rslt))) T-rslt) nil nil (cons ',funnm $$functions-in-trace$$) $$funcargs-in-trace$$)))) (setq did (cons funnm did) $$traced-functions$$ (cons funnm $$traced-functions$$))) (t (T-patom '"No such function as: ") (T-print funnm) (T-terpr))))) botloop ) ; if given no args, just return the function currently being traced (return (cond ((null argl) $$traced-functions$$) (t (T-nreverse did))))))) ;--- untrace ; (untrace foo bar baz) ; untraces foo, bar and baz. ; (untrace) ; untraces all functions being traced. ; (def untrace (nlambda (argl) (cond ((null argl) (setq argl $$traced-functions$$))) (do ((i argl (cdr i)) (curf) (res)) ((null i) (cond ((null $$traced-functions$$) (setq $$functions-in-trace$$ nil) (setq $$funcargs-in-trace$$ nil))) res) (cond ((setq tmp (T-get (setq curf (car i)) 'original)) ; we only want to restore the original definition ; if this function has not been redefined! ; we can check if it has been redefined by seeing ; if its current definition is one the trace package ; would generate. (let ((funcdef (T-getd curf))) (cond ((and (dtpr funcdef) (dtpr (cadr funcdef)) (memq (caadr funcdef) '(T-nargs T-arglst))) (T-putd curf tmp)))) (T-remprop curf 'original) (T-remprop curf 'entercount) (setq $$traced-functions$$ (T-delq curf $$traced-functions$$)) (setq res (cons curf res))) (t (setq res (cons `(,curf not traced) res))))))) ;--- tracedump :: dump the currently active trace frames ; (def tracedump (lambda nil (let (($tracemute nil)) (T-tracedump-recursive $$functions-in-trace$$ $$funcargs-in-trace$$)))) ;--- traceargs :: return list of args to currently entered traced functions ; call is: ; (traceargs foo) returns first call to foo starting at most current ; (traceargs foo 3) returns args to third call to foo, starting at ; most current ; (def traceargs (nlambda (args) (cond ((and args $$functions-in-trace$$) (let ((name (car args)) (amt (cond ((numberp (cadr args)) (cadr args)) (t 1)))) (do ((fit $$functions-in-trace$$ (cdr fit)) (fat $$funcargs-in-trace$$ (cdr fat))) ((null fit)) (cond ((eq name (car fit)) (cond ((zerop (setq amt (1- amt))) (return (car fat)))))))))))) ;--- T-tracedump-recursive ; since the lists of functions being traced and arguments are in the reverse ; of the order we want to print them, we recurse down the lists and on the ; way back we print the information. ; (def T-tracedump-recursive (lambda ($$functions-in-trace$$ $$funcargs-in-trace$$) (cond ((null $$functions-in-trace$$)) (t (T-tracedump-recursive (cdr $$functions-in-trace$$) (cdr $$funcargs-in-trace$$)) (T-traceenter (car $$functions-in-trace$$) (car $$funcargs-in-trace$$)))))) ;--- T-traceenter - funnm : name of function just entered ; - count : count to print out ; This routine is called to print the entry banner for a ; traced function. ; (def T-traceenter (lambda (name args) (prog (count indent) (cond ((not $tracemute) (setq count 0 indent 0) (do ((ll $$functions-in-trace$$ (cdr ll))) ((null ll)) (cond ((eq (car ll) name) (setq count (1+ count)))) (setq indent (1+ indent))) (T-traceindent indent) (T-print count) (T-patom '" ") (T-print name) (T-patom '" ") (cond ((setq count (T-get name 'trace-printargs)) (T-funcall count args)) (t (T-print args))) (T-terpr)))))) (def T-traceexit (lambda (name res) (prog (count indent) (cond ((not $tracemute) (setq count 0 indent 0) (do ((ll $$functions-in-trace$$ (cdr ll))) ((null ll)) (cond ((eq (car ll) name) (setq count (1+ count)))) (setq indent (1+ indent))) (T-traceindent indent) (T-print count) (T-patom " ") (T-print name) (T-patom " ") (cond ((setq count (T-get name 'trace-printres)) (T-funcall count res)) (t (T-print res))) (T-terpr)))))) ; T-traceindent ; - n : indent to column n (def T-traceindent (lambda (col) (do ((i col (1- i)) (char '| |)) ((< i 2)) (T-patom (cond ((eq char '| |) (setq char '\|)) (t (setq char '| |))))))) ; trace-break - this is the trace break loop (def trace-break (lambda nil (prog (tracevalread piport) (T-terpr) (T-patom '"[tracebreak]") loop (T-terpr) (T-patom '"T>") (T-drain) (cond ((or (eq ' (setq tracevalread (car (errset (T-read nil '))))) (and (dtpr tracevalread) (eq 'tracereturn (car tracevalread)))) (T-terpr) (return nil))) (T-print (car (errset (T-eval tracevalread)))) (go loop)))) (def T-levprint (lambda (x) ((lambda (prinlevel prinlength) (print x)) 3 10))) (eval-when (eval) (apply 'sstatus `(uctolc ,old-uctolc-value)) (setq readtable old-read-table-trace) ) drain) (cond ((or (eq ' (setq tracevalread (car (errset (T-read nil '))))) (and (dtpr tracevalread) (eq 'tracereturn (car tracevalread)))) (T-terpr) (return nil)))lib/lisp/trace.o 664 0 33 25657 2552754322 7075  PpXWZjVhjPLjTдSУФRТPРWWVjTдSУиШWWVкjXWZV||Uи Ш Ը иШԸиШԸиШԸиШԸи Ш Ը и$Ш$Ը$и(Ш(Ը(и,Ш,Ը,UШ0WWVPШ4WWVPjԆԆժP1I ЪTФи,ԪԸ(Ը$Ը ԸԸԸШ8Ш< xP@PxPPP1ЪSУЪPxPP@vPxPPP+ЪRТWvWVШ@WlWV1 PЪTдժ P1Ъ TФQШDPP-Q`P ФdSУW'WVк pѤHdSУ и $S VѤLиHѤP ШTШT5ШXWWVЪ TФWWVfWWVк 1AVPЪШ`P"ЪШ\NPЪ AP 1 PЪШ`*PBШdЪԆPWHWVЪШhPЪ P PոЪиШlWWVPոЪиШpWWVPЪWWVP1xP@u1ШtЪWWVvP6ШxЪWWVvPШ|ЪW}WVvPЪWfWVP؀RЪWMWVxPP@Шt؀)ȄWWVЪWWV؀1xP@pШtЪTФPvPȈШt؀MШxЪTФPvPѨ| ЪTФ؀)ȌWrWVЪWXWV؀CЪWWVPШt؀%ȐW)WVЪWWVЪЪШ`WWV؀t1ȔЪȈȘШtȜȠȤȨȬȰȴи,ȸи(ԆxPoPԆdP[PRPԆGP>P5PиȼЪԆPPPPո$и$PPPȨЪPԆPPԆPWWVPP{PԆpPgPȬиP6ȼЪԆ>P5P'PPԆP PPȨȰո и PPPи ȼЪԆPPPPԆPWWVPqPԆfP]POPFP=P4P+P"P((PԆԆԆȼЪԆPPPPPPPPPԆPPPԆPwPnPWWVЪЪ OP Ъ "" "" "" "\ \|piport"[tracebreak]""T>"ER%alltracereturnprinlengthprinlevelputdputpropT-statusT-sstatusT-printT-patomT-setT-terprapplyT-putpropT-getdT-getdiscarraypappendT-evalT-nreverseT-getT-putdT-rempropT-delqT-tracedump-recursiveT-traceenterT-traceindentT-funcallT-drainT-readprint(setq SCCS-trace "@(#)trace.l 1.9 4/24/81")(cond ((null (boundp (quote $$traced-functions$$))) (setq $$traced-functions$$ nil)))(cond ((null (boundp (quote $$functions-in-trace$$))) (setq $$functions-in-trace$$ nil)))(cond ((null (boundp (quote $$funcargs-in-trace$$))) (setq $$funcargs-in-trace$$ nil)))(cond ((null (boundp (quote $tracemute))) (setq $tracemute nil)))trace-startup-func(trace-startup-func)(putprop (quote quote) t (quote Untraceable))traceuntracetracedumptraceargsT-tracedump-recursiveT-traceenterT-traceexitT-traceindenttrace-breakT-levprint 8 Y k }    _     Y o |         6 Y o        1 C Z      '              $ ? J S ^ l x           ! * F O ] f q               " 0 9 B K T _ h q |      %  .  9  B  K  V  _  h               0  9  G  P  h  q                    *  3  <  E  N  W  t  }                  )  @  R  _      /  K  ^  u        - B Q h }     + M       - 6        / K _ l ~    + > O b w      - D S i s             , J e l r z           , 5 H  g %06= D>KR]d2kuz|@Mb F00007linkertrantbF00012_bnp_typetable_qget_qconsF00071F00087F00089_qoneminusF00111F00116_qoneplusF00132F00148F00158_qpushframe_errp_retval_lispretvalF00170bind_orglinker_sizetrans_sizelit_orglit_end%06= D>KRlib/lisp/ucifnc.l 644 0 33 34375 2552754312 7235 (setq SCCS-ucifnc "@(#)ucifnc.l 1.16 7/4/81") ; ; There is problems with the ucilisp do being ; incompatible with maclisp/franz do, ; The problems with compiling do are gone, but ; due to these possible problems, the ucilisp do function ; is in a seperate file ucido.l and users of it ; should also load that file in at compile time before ; any call to do (since do is a macro) (and ; at runtime if do is to be interpreted). ; ; This file is meant to be fasl'd or used with liszt -u ; not to be read in interpr((etively (the syntax changes ; will not work in that case. ; ; to compile this file do liszt ucifnc.l ; ; one who wants to use these functions or compile and run ; a ucilisp program should do both ; liszt -u file.l when compiling. ; and ; (fasl '/usr/lib/lisp/ucifnc) ; before loading in and running them ; programs in lisp. ; This is because some functions are macros and others are too ; complicated and need other functions around. ; Note this file will not load in directly and when fasl'd in will ; cause the syntax of lisp to change to ucilisp syntax. ; (declare (macros t)) ; ; ucilisp (de df dm) declare function macros. ; ; (de name args body) -> declare exprs and lexprs. ; (defun de macro (l) `(defun ,@(cdr l))) ; ; (df name args body) -> declare fexprs. ; (defun df macro (l) `(defun ,(cadr l) fexpr ,@(cddr l))) ; ; macro's are not compiled except under the same ; conditions as in franz lisp. ; (usually just do (declare (macros t)) ; to have macros also compiled). ; ; ; (dm name args body) -> declare macros. same as (defun name 'macro body) ; (defun dm macro (l) `(defun ,(cadr l) macro ,@(cddr l))) ; ; ucilisp let macro. ; (eval-when (compile load eval) (defun let1 (l vars vals body) (cond ((null l) (cons (cons 'lambda (cons vars body)) vals)) (t (let1 (cddr l) (cons (car l) vars) (cons (cadr l) vals) body))))) (defun let macro (l) (let1 (cadr l) nil nil (cddr l))) (defun nconc1 macro (l) `(nconc ,(cadr l) (list ,(caddr l)))) (putd 'expandmacro (getd 'macroexpand)) ; ; ucilisp selectq function. (written by jkf) ; (def selectq (macro (form) ((lambda (x) `((lambda (,x) (cond ,@(maplist '(lambda (ff) (cond ((null (cdr ff)) `(t ,(car ff))) ((atom (caar ff)) `((eq ,x ',(caar ff)) . ,(cdar ff))) (t `((memq ,x ',(caar ff)) . ,(cdar ff))))) (cddr form)))) ,(cadr form))) (gensym 'Z)))) ; ; ucilisp functions which declare read macros. ; ; dsm - declare splicing read macro. ; (defun dsm macro (l) `(eval-when (compile load eval) (setsyntax ',(cadr l) 'splicing ',(caddr l)))) ; ; drm - declare read macro. ; (defun drm macro (l) `(eval-when (compile load eval) (setsyntax ',(cadr l) 'macro ',(caddr l)))) ; ;(:= a b) -> ucilisp assignment macro. ; (defun := macro (expression) (let (lft (macroexpand (cadr expression)) rgt (caddr expression)) (cond ((atom lft) `(setq ,lft ,(subst lft '*-* rgt))) ((get (car lft) 'set-program) (cons (get (car lft) 'set-program) (append (cdr lft) (list (subst lft '*-* rgt)))))))) (defprop car rplaca set-program) (defprop cdr rplacd set-program) (defprop cadr rplacad set-program) (defprop cddr rplacdd set-program) (defprop caddr rplacadd set-program) (defprop cadddr rplacaddd set-program) (defprop get get-set-program set-program) (defun get-set-program (atm prop val) (putprop atm val prop)) (defun rplacad (exp1 exp2) (rplaca (cdr exp1) exp2)) (defun rplacdd (exp1 exp2) (rplacd (cdr exp1) exp2)) (defun rplacadd (exp1 exp2) (rplaca (cddr exp1) exp2)) (defun rplacaddd (exp1 exp2) (rplaca (cdddr exp1) exp2)) ; ; ucilisp record-type package to declare records and field extraction ; macros. ; (declare (special *type*)) (defun record-type macro (l) (let (*type* (cadr l) *flag* (caddr l) slots (car (last l))) `(progn 'compile (defun ,*type* ,(slot-funs-extract slots (and *flag* '(d))) ,(cond ((null *flag*) (struc-cons-form slots)) (t (append `(cons ',*flag*) (list (struc-cons-form slots)))))) ,(cond (*flag* (cond ((dtpr *flag*) (setq *flag* *type*))) `(defun ,(concat 'is- *type*) macro (l) (list 'and (list 'dtpr (cadr l)) (list 'eq (list 'car (cadr l)) '',*flag*)))))))) (defun slot-funs-extract (slots path) (cond ((null slots) nil) ((atom slots) (eval `(defun ,(concat slots ': *type*) macro (l) (list ',(readlist `(c ,@path r)) (cadr l)))) (list slots)) ((nconc (slot-funs-extract (car slots) (cons 'a path)) (slot-funs-extract (cdr slots) (cons 'd path)))))) (defun struc-cons-form (struc) (cond ((null struc) nil) ((atom struc) struc) (t `(cons ,(struc-cons-form (car struc)) ,(struc-cons-form (cdr struc)))))) (defun some macro (l) `((lambda (f a) (prog () loop (cond ((null a) (return nil)) ((funcall f (car a)) (return a)) (t (setq a (cdr a)) (go loop))))) ,(cadr l) ,(caddr l))) (declare (special vars)) (defun for macro (*l*) (let (vars (vars:for *l*) args (args:for *l*) test (test:for *l*) type (type:for *l*) body (body:for *l*)) (cons (make-mapfn vars test type body) (cons (list 'quote (make-lambda vars (add-test test (make-body vars test type body)))) args)))) (defun type:for (*l*) (let (item (item:for '(do save splice filter) *l*)) (cond (item (car item)) ((error '"No body in for loop"))))) (defun error (l x) (cond (x (terpri) (patom l) (terpri) (drain) (break) l) (t l))) (defun vars:for (*m*) (mapcan '(lambda (x) (cond ((is-var-form x) (list (var:var-form x))))) *m*)) (defun args:for (*n*) (mapcan '(lambda (x) (cond ((is-var-form x) (list (args:var-form x))))) *n*)) (defun is-var-form (x) (and (eq (length x) 3) (eq (cadr x) 'in))) (defun var:var-form (x) (car x)) (defun args:var-form (x) (caddr x)) (defun test:for (*o*) (let (item (item:for '(when) *o*)) (cond (item (cadr item))))) (defun body:for (*p*) (let (item (item:for '(do save splice filter) *p*)) (cond ((not item) (error '"NO body in for loop")) ((eq (length (cdr item)) 1) (cadr item)) ((cons 'progn (cdr item)))))) (declare (special *l* item)) (defun item:for (keywords *l*) (let (item nil) (some '(lambda (key) (setq item (assoc key (cdr *l*)))) keywords) item)) (defun make-mapfn (vars test type body) (cond ((equal type 'do) 'mapc) ((not (equal type 'save)) 'mapcan) ((null test) 'mapcar) ((subset-test vars body) 'subset) ('mapcan))) (defun subset-test (vars body) (and (equal (length vars) 1) (equal (car vars) body))) (defun make-body (vars test type body) (cond ((equal type 'filter) (list 'let (list 'x body) '(cond (x (list x))))) ((or (not (equal type 'save)) (null test)) body) ((subset-test vars body) nil) ((list 'list body)))) (defun add-test (test body) (cond ((null test) body) ((null body) test) (t (list 'cond (cond ((eq (car body) 'progn) (cons test (cdr body))) ((list test body))))))) (defun make-lambda (var body) (cond ((equal var (cdr body)) (car body)) ((eq (car body) 'progn) (cons 'lambda (cons vars (cdr body)))) ((list 'lambda vars body)))) (defun pop macro (q) `(prog (*q*) (setq *q* (car ,(cadr q))) (setq ,(cadr q) (cdr ,(cadr q))) (return *q*))) (defun length (*u*) (cond ((null *u*) 0) ((atom *u*) 0) ((add1 (length (cdr *u*)))))) (declare (special l)) (defun every macro (l) `(prog ($$k $v) (setq $$k ,(caddr l)) loop (cond ((null $$k) (return t)) ((apply ,(cadr l) (list (car $$k))) (setq $$k (cdr $$k)) (go loop))) (return nil))) (defun timer fexpr (request) (prog (timein timeout result cpu garbage) (setq timein (ptime)) (prog () loop (setq result (eval (car request))) (setq request (cdr request)) (cond ((null request) (return result)) ((go loop)))) (setq timeout (ptime)) (setq cpu (quotient (times 1000.0 (quotient (difference (car timeout) (car timein)) 60.0)) 1000.0)) (setq garbage (quotient (times 1000.0 (quotient (difference (cadr timeout) (cadr timein)) 60.0)) 1000.0)) (print (cons cpu garbage)) (terpri) (return result))) (defun addprop (id value prop) (putprop id (enter value (get id prop)) prop)) (defun enter (v l) (cond ((member v l) l) (t (cons v l)))) (defmacro subset (fun lis) `(mapcan '(lambda (ele) (cond ((funcall ,fun ele) (ncons ele)))) ,lis)) (defun push macro (varval) `(setq ,(cadr varval) (cons ,(caddr varval) ,(cadr varval)))) (putd 'consp (getd 'dtpr)) (defun prelist (a b) (cond ((null a) nil) ((eq b 0) nil) ((cons (car a) (prelist (cdr a) (sub1 b)))))) (defun suflist (a b) (cond ((null a) nil) ((eq b 0) a) ((suflist (cdr a) (sub1 b))))) (defun loop macro (l) `(prog ,(var-list (get-keyword 'initial l)) ,@(subset (function caddr) (setq-steps (get-keyword 'initial l))) loop ,@(apply (function append) (mapcar (function do-clause) (cdr l))) (go loop) exit (return ,@(get-keyword 'result l)))) (defun do-clause (clause) (cond ((memq (car clause) '(initial result)) nil) ((eq (car clause) 'while) (list (list 'or (cadr clause) '(go exit)))) ((eq (car clause) 'do) (cdr clause)) ((eq (car clause) 'next) (setq-steps (cdr clause))) ((eq (car clause) 'until) (list (list 'and (cadr clause) '(go exit)))) (t (terpri) (patom '"unknown keyword clause") (patom (car clause)) (terpri)))) (defun get-keyword (key l) (cdr (assoc key (cdr l)))) (defun var-list (r) (and r (cons (car r) (var-list (cddr r))))) (defun setq-steps (s) (and s (cons (list 'setq (car s) (cadr s)) (setq-steps (cddr s))))) (putd 'readch (getd 'readc)) ; ; ucilisp msg function. (written by jkf) ; (defmacro msg ( &rest body) `(progn ,@(mapcar '(lambda (form) (cond ((eq form t) '(line-feed 1)) ((numberp form) (cond ((greaterp form 0) `(msg-space ,form)) (t `(line-feed ,(minus form))))) ((atom form) `(patom ,form)) ((eq (car form) t) '(patom '/ )) ((eq (car form) 'e) `(patom ,(cadr form))) (t `(patom ,form)))) body))) ; ; this must be fixed to not use do. ; (defmacro msg-space (n) (cond ((eq 1 n) '(patom '" ")) (t `(do i ,n (sub1 i) (lessp i 1) (patom '/ ))))) (defmacro line-feed (n) (cond ((eq 1 n) '(terpr)) (t `(do i ,n (sub1 i) (lessp i 1) (((terpr))))) (defmacro prog1 ( first &rest rest &aux (foo (gensym))) `((lambda (,foo) ,@rest ,foo) ,first)) (defun append1 (l x) (append l (list x))) ; compatability functions: functions required by uci lisp but not ; present in franz ; ; union uses the franz do loop (not the ucilisp one defined in this file). ; (def union (lexpr (n) (do ((res (arg n)) (i (sub1 n) (sub1 i))) ((zerop i) res) (mapc '(lambda (arg) (cond ((not (member arg res)) (setq res (cons arg res))))) (arg i))))) (putd 'newsym (getd 'gensym)) ; this is not exactly correct. ; it only uses the first letter of the arg. (putd 'remove (getd 'delete)) ; ignore column count (def sprint (lambda (form column) ($prpr form))) (def save (lambda (f) (putprop f (getd f) 'olddef))) (def unsave (lambda (f) (putd f (get f 'olddef)))) (putd 'atcat (getd 'concat)) (putd 'consp (getd 'dtpr)) (defun neq macro (x) `(not (eq ,@(cdr x)))) (putd 'gt (getd '>)) (putd 'lt (getd '<)) (defun le macro (x) `(not (> ,@(cdr x)))) (defun ge macro (x) `(not (< ,@(cdr x)))) (defun litatom macro (x) `(and (atom ,@(cdr x)) (not (numberp ,@(cdr x))))) (putd 'apply\# (getd 'apply)) (defun tconc (ptr x) (cond ((null ptr) (prog (temp) (setq temp (list x)) (return (setq ptr (cons temp (last temp)))))) ((null (car ptr)) (rplaca ptr (list x)) (rplacd ptr (last (car ptr))) ptr) (t (prog (temp) (setq temp (cdr ptr)) (rplacd (cdr ptr) (list x)) (rplacd ptr (cdr temp)) (return ptr))))) ; ; unbound - (setq x (unbound)) will unbind x. ; "this [code] is sick" - jkf. ; (defun unbound macro (l) `(fake -4)) ; ; ; due to problems with franz do in the compiler, this ; has been commented out and is left in a seperate ; file called /usr/lib/lisp/ucido.l ; ;(defun do macro (l) ; ((lambda (dotype alist) ; (selectq dotype ; (while (dowhile (car alist) (cdr alist))) ; (until (dowhile (list 'not (car alist)) ; (cdr alist))) ; (for (dofor (car alist) ; (cadr alist) ; (caddr alist) ; (cdddr alist))) ; `((lambda () ; ,@alist)))) ; (cadr l) ; (cddr l))) ; ;(defun dowhile (expr alist) ; `(prog (returnvar) ; loop ; (cond (,expr ; (setq returnvar ((lambda () ; ,@alist))) ; (go loop)) ; (t (return returnvar))))) ; ;(defun dofor (var fortype varlist stmlist) ; (selectq fortype ; (in `(prog (returnvar l1 l2) ; (setq l2 ',varlist) ; loop ; (setq l1 (car l2)) ; (setq l2 (cdr l2)) ; (cond ((null l1) ; (return returnvar))) ; (setq returnvar ; ((lambda (,var) ; ,@stmlist) ; (l1))) ; (go loop))) ; (on `(prog (returnvar l1 l2) ; (setq l2 ',varlist) ; loop ; (cond ((null l2) ; (return returnvar))) ; (setq returnvar ; ((lambda (,var) ; ,@stmlist) ; (l2))) ; (setq l2 (cdr l2)) ; (go loop))) ; (rpt `(prog (returnvar ,var) ; (setq ,var 1) ; loop ; (cond ((not (> ,var ,varlist)) ; (setq returnvar ((lambda () ; ,@stmlist))) ; (setq ,var (1+ ,var)) ; (go loop)) ; (t (return returnvar))))) ; nil)) ; (putd 'dddd* (getd 'boundp)) (defun boundp (l) (cond ((arrayp l)) ((dddd* l)))) ; ; now change to ucilisp syntax. ; (sstatus uctolc t) ; ; Leave backquote macro in for now. ; These characters should be declared as follows for real ; ucilisp syntax though. ;(setsyntax '\` 2) ;(setsyntax '\, 2) ;(setsyntax '\@ 201) ;(setsyntax '\@ 'macro '(lambda () (list 'quote (read)))) ; ; ~ as comment character, not ; and / instead of \ for escape (setsyntax '\~ 'splicing 'zapline) (setsyntax '\; 2) (setsyntax '\# 2) (setsyntax '\/ 143) (setsyntax '\\ 2) (setsyntax '\! 2) yp l)) ((dddd* l)))) ; ; now change to ucilisp syntax. ; (sstatus uctolc t) ; ; Leave backquote macro in for now. ; These characters should be declared as follows for real ; ucilisp syntax though. ;(setsyntax '\` 2) ;(setsyntax '\, 2) ;(setsyntax '\@ 201)lib/lisp/ucifnc.o 664 0 33 45225 2552754322 7237 l4@XWZVhкԆWWVPXWZVhкTФШdԆWWVPPPyXWZVhкTФШdԆWRWVPFP=P4+XWZVj*Ш ЪЪ  PPЪMкTdjSУЪPкTФЪPЪ ЦjЦЦЦ VXWZVкTФԆԆdWWVqXWZVШкTФШdSУԆJPAPԆ6P-P$XWZVШWWVPШ ЪԆPШԆкTdժP1 Ъպ Ш ЪTФԆP1ЪTФSУPxPP@PxPPPQШ$ЪШ(УԆoPfPԆ[PRPIPЪTд8OШ,ЪШ(УԆPPԆ PPPЪTдVPЪPк1VЪWWVVPԆWWVPPԆPPzPкTФԆgP^UXWZVШ0Ш4Ш8Ш(кTФԆ-P$PШ<Ш(кTdSУԆPPԆPPPPԆPPXWZVШ0Ш@Ш8Ш(кTФԆPPШDШ(кTdSУԆbPYPԆNPEPؠЪ WRWVPPШЪ ԆPPP UХUXWZVjЪP[ժjPQШЪTФPPXjdjTԆPPPPԆP}XWZVjкѦWlWVP VЪTФPWЪTФPPXШ ؠd&P,Ш ؠTԆPPPPXWZVШHкTФԆPPԆPPPШHкTФФԆpPgPԆ\PSPJPPP0PԆ%PPԆPPPԆPPЪԆPPXWZVШHкTФШddSУФԆPPPԆyPpPg^XWZVjPJѪPUЪTФPP ȤP@ѤȨȠdSУԆ PȠTԆPVPЪ P к1VЪ WQWVVPԆWWVPXWZVкTФяȬP+ȰЪȴTPKPB9XWZVкTФяȸP+ȰЪȼPPXWZVкTФdfWWVPШ Ъ ԆPЪЪ ԆPWWVPP{PЪԆlPcZXWZVLUjU5ЪԆ$PWWV UХUXW~VZWVPj~кP@ЭjW#WVPպxP@ ЪP1ԆкP@ Э Ъ ժPBЪTФЪЪWWVPЪЪOPPVкVЪWWVP1dXWZVjWWVXWZVjUEWWVXWZVjjPWhWVXWZVШ$кԆWrWVPfPԆ[PRIXWZVкԆW&WVPPԆPXWZVкԆWWVPPԆPXWZVȈкԆWWVPPкԆWdWVPXPԆMPDPԆ9P0P'XWZVj>ԆЪԆPЪЪW%WVPPjjPVvjTդ?TЪԆPQvPQjjTФWWVPQvPQ`jP/ԆккЪԆvPQvPQ`jPк`jPVUXWZVGUjU0P%UХUXWZVUjUWWVPWWVPPUХUccccccccccccccccccccccccccdefunfexprmacrolambdanconclistZcondteqquotememqeval-when(compile load eval)setsyntax(quote splicing)(compile load eval)(quote macro)setq*-*set-program*type*progn(quote compile)(d)consis-(l)(quote and)(list (quote dtpr) (cadr l))(quote eq)(list (quote car) (cadr l)):(l)c(r)((cadr l))ad(lambda (f a) (prog nil loop (cond ((null a) (return nil)) ((funcall f (car a)) (return a)) (t (setq a (cdr a)) (go loop)))))vars(do save splice filter)"No body in for loop"in(when)(do save splice filter)"NO body in for loop"*l*item(lambda (key) (setq item (assoc key (cdr *l*))))domapcsavemapcanmapcarsubsetfilterletx(cond (x (list x)))prog(*q*)*q*carcdr((return *q*))l($$k $v)$$kloop((null $$k) (return t))apply((list (car $$k)))((setq $$k (cdr $$k)) (go loop))((return nil))1000.060.01000.01000.060.01000.0(ele)funcall(ele)((ncons ele))initial(caddr)(append)(go loop)exitreturnresult(initial result)whileor(go exit)nextuntiland(go exit)"unknown keyword clause"(line-feed 1)msg-spaceline-feedpatom(patom (quote /))e(patom (quote " "))i((sub1 i) (lessp i 1) (patom (quote /)))(terpr)((sub1 i) (lessp i 1) (terpr))olddefnot><atomnumberp(fake -4)appendlet1gensymreversemacroexpandsubstputproplastslot-funs-extractstruc-cons-formconcatreadlistevalnconcbody:fortype:fortest:forargs:forvars:formake-mapfnmake-bodyadd-testmake-lambdaitem:forerrorterpripatomdrain*breakis-var-formvar:var-formargs:var-formlengthfuncallequalsubset-testadd1ptimedifferencequotienttimesprintentermembersub1prelistget-keywordvar-listsetq-stepsfunctiondo-clausenreverseapplyassocgreaterpminus$prprputdarraypdddd*(setq SCCS-ucifnc "@(#)ucifnc.l 1.16 7/4/81")dedfdmlet1letnconc1(putd (quote expandmacro) (getd (quote macroexpand)))selectqdsmdrm:=(defprop car rplaca set-program)(defprop cdr rplacd set-program)(defprop cadr rplacad set-program)(defprop cddr rplacdd set-program)(defprop caddr rplacadd set-program)(defprop cadddr rplacaddd set-program)(defprop get get-set-program set-program)get-set-programrplacadrplacddrplacaddrplacadddrecord-typeslot-funs-extractstruc-cons-formsomefortype:forerrorvars:forargs:foris-var-formvar:var-formargs:var-formtest:forbody:foritem:formake-mapfnsubset-testmake-bodyadd-testmake-lambdapoplengtheverytimeraddpropentersubsetpush(putd (quote consp) (getd (quote dtpr)))prelistsuflistloopdo-clauseget-keywordvar-listsetq-steps(putd (quote readch) (getd (quote readc)))msgmsg-spaceline-feedprog1append1union(putd (quote newsym) (getd (quote gensym)))(putd (quote remove) (getd (quote delete)))sprintsaveunsave(putd (quote atcat) (getd (quote concat)))(putd (quote consp) (getd (quote dtpr)))neq(putd (quote gt) (getd (quote >)))(putd (quote lt) (getd (quote <)))legelitatom(putd (quote apply#) (getd (quote apply)))tconcunbound(putd (quote dddd*) (getd (quote boundp)))boundp(sstatus uctolc t)(setsyntax (quote ~) (quote splicing) (quote zapline))(setsyntax (quote ;) 2)(setsyntax (quote #) 2)(setsyntax (quote /) 143)(setsyntax (quote \\) 2)(setsyntax (quote !) 2)  , 5 \ h q z           4 ]           E N i             % C Y e p y            % 0 9 B K s |            $ O ] f o          0 I f       ) 2 = F X f t         % . 9 B K T _ h q z             6  f  r                  8  F  W  i             )  ?  S  g  {          .  7  D  M  S  a  j           &  W  m  {     " t      ) D _ s        6 D M [ d r     $ 2 ; I ` p        - O X h q z        C S \ m v         F O Z c l            ) : L Z q         ((  # , 5 > D R [ s       8 N _ u          ( ; W ] k t            ) 2 ; f o x         3 Q _ v       #       1 = H Q Z h t           C j s |           * 3 U a n        : R [ q           %  C  Y  e  n       ! ! ! 5! K! ^! l! x! ! ! ! ! ! ! ! ! ! ! " 9" Q" " " " " " # )# 5# N# \# h# # # # # # # # # # # "$ .$ 9$ B$ K$ n$ z$ $ $ $ $ $ $ $ $ $ % % ?% ^% % % % % % % % % & #& :& I& W&   1'.5Y<CJU\Gcjpw~,Ebe  % f  "  p%`7{$+2H9W@GNpU7\cjMqx/jj  !!""#1#d###G$$%%\&w<'%l4-F00007linkertrantb_qconsF00009F00011F00013F00017F00019F00021_typetableF00031F00033F00035_qgetF00040F00042F00044F00046F00048F00050_bnpF00060F00065F00070F00072F00074F00078F00082F00100F00118F00124F00126F00128F00132F00137F00144F00156F00165F00176F00183F00190F00192F00197F00199F00206F00208F00212F00214F00216F00221F00226F00249F00259F00261F00265F00269F00284F00288F00292F00294F00296F00313F00315F00317F00319F00321F00323F00325F00327F00334F00336bind_orglinker_sizetrans_sizelit_orglit_endF00013F00017F00019F00021_typetableF00031F00033F00035_qgetF00040F00042F00044F00046F00048F00050_bnpF00060F00065F00070F00072F00074F00078F00082F00100F00118F00124F00126F00128F00132F00137F00144F00156F00165F00176F00183F00190F00192F00197F00199F00206F00208F00212F00214F00216F00221F00226F00249F00259F00261F00265F00269F002lib/lisp/ucido.l 444 0 33 3517 2552754314 7043 (setq SCCS-ucido "@(#)ucido.l 1.3 6/29/81") ; ; ucilisp do loop, this is a seperate file due to conflicts with ; the franz lisp do function. To use this, one needs ; to load this file in at run time. (And have calls to ; do be close compiled in compiled code). ; ; NOTE: do is a macro and must be declared before calls to it ; in code to be compiled! ; ; to compile this file: liszt ucido.l ; (declare (macros t)) (eval-when (compile) (load 'ucifnc)) (defun do macro (l) ((lambda (dotype alist) (cond ((eq dotype 'while) (dowhile (car alist) (cdr alist))) ((eq dotype 'until) (dowhile (list 'not (car alist)) (cdr alist))) ((eq dotype 'for) (dofor (car alist) (cadr alist) (caddr alist) (cdddr alist))) (t `((lambda () ,@alist))))) (cadr l) (cddr l))) (defun dowhile (expr alist) `(prog (returnvar) loop (cond (,expr (setq returnvar ((lambda () ,@alist))) (go loop)) (t (return returnvar))))) (defun dofor (var fortype varlist stmlist) (selectq fortype (in `(prog (returnvar l1 l2) (setq l2 ',varlist) loop (setq l1 (car l2)) (setq l2 (cdr l2)) (cond ((null l1) (return returnvar))) (setq returnvar ((lambda (,var) ,@stmlist) (l1))) (go loop))) (on `(prog (returnvar l1 l2) (setq l2 ',varlist) loop (cond ((null l2) (return returnvar))) (setq returnvar ((lambda (,var) ,@stmlist) (l2))) (setq l2 (cdr l2)) (go loop))) (rpt `(prog (returnvar ,var) (setq ,var 1) loop (cond ((not (> ,var ,varlist)) (setq returnvar ((lambda () ,@stmlist))) (setq ,var (1+ ,var)) (go loop)) (t (return returnvar))))) nil)) (returnvar l1 l2) (setq l2 ',varlist) loop (cond ((null l2) (return returnvar))) (setq returnvar ((lambda (,var) ,@stmllib/lisp/ucido.o 664 0 33 5566 2552754323 7060 dXWZVкTФdѪhЪTФdWWV1Ѫ4ШЪTФԆPPкWWVgѪ )ЪTФdSУcRТbWeWV7ШԆЪԆWQWVP5P,PԆ!XWZVШШШШ jШ$Ш(ШԆЪԆWWVPPPԆPԆPPPШ,PPШ0~PuPԆjPaPXPOFXWZVЪѪ41ШШ8Ш$Ш<Ш@ЪԆPPԆPPPШШDШHШLШ$Ш(ШjԆPЪ ԆWWVPPPШPPԆPvPmPШT`PWPNPEP\1+((go loop))((t (return returnvar)))dowhiledoforappend(setq SCCS-ucido "@(#)ucido.l 1.3 6/29/81")dodowhiledofor 3 T ] o        * 3 > I R [ h q ~            < P \ e r }              % . P d p y              # E N W b k               ( 6 ? J S \ e n   '.w7!CNVa^F00007linkertrantb_qconsF00013F00015bind_orglinker_sizetrans_sizelit_orglit_end        # E N W b k    lib/atrun 4755 0 33 26000 2532065633 5726 (( $P^Юn PPՀPpPP# Ph4^#6#Ͽ#P1ϱ#?&ϲ'je߭߭߭߭߭߭ϔ#߭P8+'0#'' ''&߭ϣݭ߭ϬPݭE&@Ϗ^߭ϱ߭P[ŏdPPPϘ&Ыϖ&Ыϔ&^ #"PP"@%ϳ(ݬ"ݭϝ ^}PZZ Z",PPݬ"Ͼ"߭߭ݬlݬϤϪ"ϓ߭ݬPϝP[&[σ ݬ\m2~2~ ݬQ"E"5ݬN">"#D";$Ϯ# Pݬ P5^߭)2PFVSVVVUUЏUUdЏdU}PP1RU#Q yPPRyPVVPWQRU=;Q yPPRyPPRQQVW{VQWPVW{ VPVPPVPRUQyPPRyPPPPnPVnQPdP`VPSrPPRpP~Ь[  P ݏ1 P ի ߘP@ [&    P2PPݫ~! PkЫk!k    k1WP֫pPPR RR RP|PpXPrPP". PPЬ[ЬZ[XY YY  YXPݬ\ݬݬ; ЬQPa#^BЬ2߭ \~ݬ׭ ЭP֭` ߭rЬP  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~qPYj ~P   BЫZ֫ZPѫPѬ ZPPXPZ~ PYZkn 1mЫZ3[&1xݏ'PZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~4PY PP` [ [[[  Ь[Z = 8[ePZ~9PZ ݫ{ ԫ kZP{P^߭ݬTPPPp`PPݬݏ tݬݬݏtݬ6Ь[ѬP ѫѫk֫k׫ЫP`P P.<080|mp~*PYY[^k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [80P YPƏPxPbPZxPZPPZx~@PZZZPZPxPZPPjj80w1xYP[PdZ]UXkIBk[P Ь[[ZZZ)jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j~\S^\wP[ЬPЬPЬRRQ{RPPR PRPPլQPP(($/usr/spool/at.rCannot read at directory %2d.%3d.%4d.%2d/usr/spool/at/lasttimedonewcan't write lastfile %04d /dev/null%s/%spastpast/bin/shsh/usr/bin/shshCan't execl shell @(#)atrun.c 4.2 (Berkeley) 10/21/80M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec  AAAAAABBBBBB ++'P0lib/lex/ 775 0 33 0 2510247043 5303 lib/lex/ncform 755 0 33 7515 2532111335 6606 int yylineno =1; # define YYU(x) x # define NLSTATE yyprevious=YYNEWLINE char yytext[YYLMAX]; struct yysvf *yylstate [YYLMAX], **yylsp, **yyolsp; char yysbuf[YYLMAX]; char *yysptr = yysbuf; int *yyfnd; extern struct yysvf *yyestate; int yyprevious = YYNEWLINE; yylook(){ register struct yysvf *yystate, **lsp; register struct yywork *yyt; struct yysvf *yyz; int yych; struct yywork *yyr; # ifdef LEXDEBUG int debug; # endif char *yylastch; /* start off machines */ # ifdef LEXDEBUG debug = 0; # endif if (!yymorfg) yylastch = yytext; else { yymorfg=0; yylastch = yytext+yyleng; } for(;;){ lsp = yylstate; yyestate = yystate = yybgin; if (yyprevious==YYNEWLINE) yystate++; for (;;){ # ifdef LEXDEBUG if(debug)fprintf(yyout,"state %d\n",yystate-yysvec-1); # endif yyt = yystate->yystoff; if(yyt == yycrank){ /* may not be any transitions */ yyz = yystate->yyother; if(yyz == 0)break; if(yyz->yystoff == yycrank)break; } *yylastch++ = yych = input(); tryagain: # ifdef LEXDEBUG if(debug){ fprintf(yyout,"char "); allprint(yych); putchar('\n'); } # endif yyr = yyt; if ( (int)yyt > (int)yycrank){ yyt = yyr + yych; if (yyt <= yytop && yyt->verify+yysvec == yystate){ if(yyt->advance+yysvec == YYLERR) /* error transitions */ {unput(*--yylastch);break;} *lsp++ = yystate = yyt->advance+yysvec; goto contin; } } # ifdef YYOPTIM else if((int)yyt < (int)yycrank) { /* r < yycrank */ yyt = yyr = yycrank+(yycrank-yyt); # ifdef LEXDEBUG if(debug)fprintf(yyout,"compressed state\n"); # endif yyt = yyt + yych; if(yyt <= yytop && yyt->verify+yysvec == yystate){ if(yyt->advance+yysvec == YYLERR) /* error transitions */ {unput(*--yylastch);break;} *lsp++ = yystate = yyt->advance+yysvec; goto contin; } yyt = yyr + YYU(yymatch[yych]); # ifdef LEXDEBUG if(debug){ fprintf(yyout,"try fall back character "); allprint(YYU(yymatch[yych])); putchar('\n'); } # endif if(yyt <= yytop && yyt->verify+yysvec == yystate){ if(yyt->advance+yysvec == YYLERR) /* error transition */ {unput(*--yylastch);break;} *lsp++ = yystate = yyt->advance+yysvec; goto contin; } } if ((yystate = yystate->yyother) && (yyt= yystate->yystoff) != yycrank){ # ifdef LEXDEBUG if(debug)fprintf(yyout,"fall back to state %d\n",yystate-yysvec-1); # endif goto tryagain; } # endif else {unput(*--yylastch);break;} contin: # ifdef LEXDEBUG if(debug){ fprintf(yyout,"state %d char ",yystate-yysvec-1); allprint(yych); putchar('\n'); } # endif ; } # ifdef LEXDEBUG if(debug){ fprintf(yyout,"stopped at %d with ",*(lsp-1)-yysvec-1); allprint(yych); putchar('\n'); } # endif while (lsp-- > yylstate){ *yylastch-- = 0; if (*lsp != 0 && (yyfnd= (*lsp)->yystops) && *yyfnd > 0){ yyolsp = lsp; if(yyextra[*yyfnd]){ /* must backup */ while(yyback((*lsp)->yystops,-*yyfnd) != 1 && lsp > yylstate){ lsp--; unput(*yylastch--); } } yyprevious = YYU(*yylastch); yylsp = lsp; yyleng = yylastch-yytext+1; yytext[yyleng] = 0; # ifdef LEXDEBUG if(debug){ fprintf(yyout,"\nmatch "); sprint(yytext); fprintf(yyout," action %d\n",*yyfnd); } # endif return(*yyfnd++); } unput(*yylastch); } if (yytext[0] == 0 /* && feof(yyin) */) { yysptr=yysbuf; return(0); } yyprevious = yytext[0] = input(); if (yyprevious>0) output(yyprevious); yylastch=yytext; # ifdef LEXDEBUG if(debug)putchar('\n'); # endif } } yyback(p, m) int *p; { if (p==0) return(0); while (*p) { if (*p++ == m) return(1); } return(0); } /* the following are only used in the lex library */ yyinput(){ return(input()); } yyoutput(c) int c; { output(c); } yyunput(c) int c; { unput(c); } } if (yytext[0] == 0 /* && feof(yyin) */) { yysptr=yysbuf; return(0); } yyprevious = yytext[0] = input(); if (yyprevious>0) output(yyprevious); yylastclib/lint/ 775 0 33 0 2510247046 5464 lib/lint/lint1 755 0 33 163144 2532112355 6573 <d^Юn PPՀPpPPاPݬ ݬݬ!qݬݬqP[ЬPP4P P6PH .[Pݬ ykPЬ  T-PЬ@4 9-:aZ,OH=6+$ P`PҬQQQQ`ֿܿP`ǿP`ݬvPѼw,j\] ,ЬPР=7P ݠB!ݬ.x P`K_+\xP ``߉ 2,Ï\PPP^pP~@t[[WaX7[Y'iYWigiЭgЩЧЭYYXWX[W[X[Zjjݭ+ZZ[PP^ZcYZmPZPcX=PjYi2P@1&P2PPP[R2P@2P2@PP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kkPiYkrPxZPP[ZЭP[[Z ѭ1Jdy^[x[խ[PxPЭPݏu]ݬݬc﮲c ~ݏcS]ﻙﳙ`2\Icݬݬ ݬݬC0ck0cqZݏw\7bݬ ݬݬbѱb^b aѭhbK^?ѭEbP﷞PPPѽaPѭP((^o2aѽaݭzyѭ,.ɝѼa ݬլ2 a^Ь[PݭݬݫЫ[Э ԭЭ߭߭ݬ [kPˏ@PPЫ[Э  Ь[kPˏ@ZZ ݬݫZ ݬݫ[D[kPЫ @雷[PkQPAV[k'Aĝ9ЬPPPPQQPˏPPˏPP `ˏPP0ЬP@_f`Ь[[cPZZPPU #ˆ&ݏoPY WY[PPYPnZPPoYP0^լѬ ѬԲ ЬPР P@[ﱜIݭkȜq_ЬPݠeQЬPݠ ݠݬ=P:_ݬݬ}ЬPРݭݬ PЫ /lw^ݭݬPb^[^ݭݭ2~2~~P>^ѭ Kխ ѭ1j4ѭ.ЬPP&&&&&&&k5e L*^խkI Э 2'ث [Ѭ Ѭ  Ѭ1 ݏ ݭ1~[ݭ1ѭ172ЬPРЭ/ЭPЭQ@kAe֭֭xPPQQP0BˏPP0ЭP@,ЭP@ЭPЭQ@A1ѭ ѭ ѭ  ЬP2QQ Ѭ  Ѭ ѬyݭP\"~[P7ݭЬPP$$]$]'</Ѭ Ѭ1 [P@QYս1P@# P@ P@kPtѭح1]ЭPP+%z+zzzzzzzz+zz+%1UխѭѭxˏPP ЭxXѭѭѭݫ PUѭѭѭѭˏPP Э Xѭ1[PѬ 1j1aѭ1Pѫ Pݭ!1nѭˏPP ЭWѭ2P@ѭѭk]Z߭P[1BDѬ>Ѭ8Ѭ2Ѭѭ&[ PЬPЭP@[1kѬˏPP ЭVPP P P  ЬP  PPЬP1ЬPPCTTpp"""""ݫ 2~2~UYVV[ ˏPP Э9V  Ѭݫ S [Ѭ 1V1M 1xW p) q͆CWT2TTPP.W}v2 W cW[1KTZ{ZP@YYn(Zi.Wݩ&ޕWѩ)ݏa6PXZ X nVYy[[XV1mP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>PЬPЬRRQ{RPPR PRPPPI'P(( 298R9R8Q9QO8U9UP 4.,"4&$m!"#1 !"#1)!"#1]YWXPNO d37`\6.RQbn;SKT0nB8YWX#P pN$)O k-eRQ[SJTn(*^ gc_`*)+$#FMrG&o'IAf00_11&E!'0D1 2!l59 H@,+a4 $%'& YWX/ P6NOy _-<3q4RQu9SCT"nv wyv{wm|y}ji~szux2szux=,fvZw7:y5vwhty?{a>|%}u~szuxU  vwy{1|}t~szuxvwy{/|}t~szuxvwvyw.{y|t}(~szuxsuxvwy{|t}~szuxvwyv{w|y}~szuxt"uxtvwy{|}~szuxvwy{|}~szuxtvwvyw{y|{}t~szuxszuxvwy{|}t~szuxvwy{|}~szuxtVYWXPNOVYWXPNORQRQSTVYWXPSNTOVYWXPNORQRQSTVYWXPSNTOVYWXPNORQRQSTVYWXPSNTOVYWXPNORQRQSTVYWXPSNTOVYWXPNORQvwy{RQ}STszux STVYWXPNOVYWXPNORQ RQSTVYWXSTLVYWXPNOVYWXRQPNORQSTRQSTVYWXPSNTOvwy{RQ|}~szuxvSwy{|}~szuxvwy{|}szuxnRKHk}*}r(\>zG.pGGGGGm:P}*}!GGaT.G!GGGGG5G($_:'GGGlGGMGGGm5UGG G &GG/jGGGG|dtGGF9 [R} {x/v$)us:olkfe d\ZVOH ##%%&&&"""( ))++ ,,..'/' 000233111115566**--447!!89:$$$$$$$$$$$$$$$$$;;;<  "!#19 2!449826326:2!373338374 0298:4778 :46 223258599::::::::8332 8395)*$%9&+,-(/.57363599999522229573'+399972233933399!"-%L^?M ;AGIK_H \/2Z')BC@EF<=S]1367:[NR abeDJ>ZVX`+049#(* [Z8 dgszTW5cfhijmnoptuvwyY|qrxl{}~kbad bdtydimension table overflowwhiles, fors, etc. too deeply nestednon-constant case expressioncase not in switchswitch table overflowduplicate default in switchdefault not inside switchswitch table overflowduplicate case in switch, %dyacc stack overflowsyntax errorfunction level error$%dFAKEstructure typed union member must be namedfield outside of structureillegal field sizefield outside of structurezero or negative subscriptfunction declaration in bad contextold-fashioned initialization: use =nesting too deepillegal breakillegal continuestatement not reachedvoid function %s cannot return valueloop not entered at toploop not entered at toploop not entered at topprecedence confusion possible: parenthesize!old-fashioned assignment operator& before array or function: ignoredstructure reference must be addressableundeclared initializer name %s&*08@FJSFIELD[%d]%W% (Berkeley) %G%SNULLAUTOEXTERNSTATICREGISTEREXTDEFLABELULABELMOSPARAMSTNAMEMOUUNAMETYPEDEFFORTRANENAMEMOEUFORTRANUSTATIC@_0  "'`(2)3{4}5[6]7* ?:+ - /<%>&|^! L~M,88;9. D< S>U= ::)/*.,'1- %&#$*3(:A0HNU ]flq+wPCC/364r1 vax uts3.0Release: %s rwccom:can't open %s abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$01234567890123456789abcdefABCDEF  01234567abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$123456789  unexpected EOFnewline in string or char constantnon-null byte ignored in string initializerempty character constanttoo many characters in character constantunexpected EOFVARARGSLINTLIBRARYARGSUSEDNOTREACHEDillegal character: %03o (octal)illegal hex constantnewline in BCD constantBCD constant exceeds 6 charactersgcos BCD constant illegalambiguous assignment: assignment op taken=<%c illegal=>%c illegalyylex error, character %03o (octal)out of switch in yylexbad asm constructionbad AR_?? actionRan out of memory (savestr)ran out of memory (hash)ran out of hash tables%W% (Berkeley) %G%asmautobreakcharcasecontinuedoubledefaultdoexternelseenumforfloatfortrangotoifintlongreturnregisterswitchstructsizeofshortstatictypedefunsignedunionvoidwhilexNAMESTRING^REG_OREGICONFCON`CCODES U- U*U&HUCALLKUFCALLL!M~lFORCEnINIThSCONViPCONV+h+=i!-( -=)! * *= )&h&=i ?:&&||8,;,OP:= </ =/=)>%?%= @<<A<<= 0B>>C>>= 0|h|=i ^h^=i N++ O-- E->FCALLIFCALLP==Q!=R<=S<T>U>YUGTXUGEWULTVULE]A>>!TYPE6[mCBRANCHgFLDjPMCONVkPVCONV$RETURN oCAST %GOTObSTASG cSTARGdSTCALLfUSTCALL (.0t| too many errorscannot recover from earlier errors: goodbye! compiler error: warning: out of tree space; simplify expressionwasted space: %ofreeing blank tree!undeffargcharshortintlongfloatdoublestrtyuniontyenumtymoetyucharushortunsignedulong??PTR FTN ARY %sout of temporary string spaceout of memory (tstr)%W% (Berkeley) %G%Xdefid calltyreducedefid( %s (%d), , %s, (%d,%d) ), level %d modified to , %s previous de((f'n: , %s, (%d,%d) ), level %d declared argument %s is missing previous class: %s redeclaration of: %sredeclaration of %s new entry made void type for %s dimoff, sizoff, offset: %d, %d, %d parameter stack overflowbcsave errorparameter reset errorswitch errordclargs() %s (%d) dclstruct( %s ), szindex = %d ??gummy structure memberillegal zero sized structure member: %szero sized structure dimtab[%d,%d,%d] = %d,%d,%d member %s(%d) redeclaration of formal parameter, %scompiler takes alignment of functioncompiler takes size of functionunknown sizeinitialization alignment errorinoff errorbeginit(), curid = %d instk((%d, %o,%d,%d, %d) no automatic aggregate initializationinsane structure member listendinit(), inoff = %d too many initializersempty array declarationbad scalar initializationcannot initialize extern or union} expecteddoinit(%o) illegal initializationillegal {irbrace(): paramno = %d on entry too many local variablesStructure too largeillegal field typefield too bigzero size fieldstructure too largestructure too largenidcl errorillegal type combinationtymerge: arg 1Null dimensionarray of functions is illegalfunction returns illegal typea function is declared as an argumentfunction illegal in structure or unionfunction has illegal storage classillegal use of fieldillegal classillegal classillegal classillegal register declarationillegal classillegal classfortran keyword nonportablefortran declaration must apply to functionfortran function has wrong typeillegal class: %dSymbol table full nonunique entry for %s from %d to %d lookup( %s, %d ), stwart=%d, instruct=%d symbol table fullsymbol table full%s undefinedremoving %s from stab[ %d], flags %o level %d symbol table full%s redefinition hides earlier one %d hidden in %d unhide uncovered %d from %d unhide fails%W% (Berkeley) %G%,buildtree( %s, %o, %o ) constant argument to NOTconstant in conditional contextdivision by 0.illegal lhs of assignment operator%s undefinedmember of structure or union requiredmember %s==%s? illegal member use: %snonunique name demands struct/union or struct/union pointerstruct/union or struct/union pointer requiredundefined structure or unionillegal member use: %sillegal indirectionunacceptable operand of &assignment of different structurestype clash in conditionalillegal functionillegal functionother code %dchkstr( %s(%d), %d ) undefined structure or uniongummy structureillegal member use: perhaps %s.%s?division by 0division by 0illegal comparison of enumsenumeration type clash, operator %sillegal combination of pointer and integer, op %sillegal structure pointer combinationillegal array size combinationillegal pointer combinationpointer requiredillegal oconvert: %dillegal pointer subtractionillegal types in :void type illegal in expressiontymatch(%o): %o %s %o => %o constant expectedconstant too big for cross-compileroperands of %s have incompatible typessizeof returns 0 %o) %s, %Ld, %d, , %d, %d statement not reached%W% (Berkeley) %G%dPQTURSXYVW& error%W% (Berkeley) %G% @  @ null effectstruct/union %s never definedstatic variable %s unusedlint's little mind is blownno line number for %sdeclare the VARARGS arguments you want checked!nonportable character comparisoncomparison of unsigned with negative constantunsigned comparison with 0?degenerate unsigned comparison%s may be used before set%s evaluation order undefinedfunction %s has return(e); and return;argument %s unused in function %s%s unused in function %s%s set but not used in function %sstructure %s never definedandable errorcan't take & of %slong assignment may lose accuracyassignment to long may sign-extend incorrectlypossible pointer alignment problemquestionable conversion of function pointerbad conversionillegal initialization%s(%d): nonportable field typeillegal field typeoption %c now default: see `man 6 lint'illegal option: %cprecision lost in assignment to (possibly sign-extended) fieldprecision lost in field assignment???  AAAAAABBBBBB \deldprecision lost in field assignment???  AAAAAABBBBBB lib/lint/lint2 755 0 33 24474 2551527061 6563  ^Юn PPՀPpPP P1P@P`-zP@[^Pp&PuDPx?Ph{-v$qkPPXdX[k׬Ѭ1wѬ#ЬPݠj P;"F %"0 ݏ P#[+P[ի[ݬPEP@PU"# PPP2[[[[+[2[![; ҬP2QPQP^ԭЭP@P֭ѭݏp"PЬ@[LP@Dl! ݬݬY! 6F! >[ǏPx PPP[$[P@5"YYZ2iYP$YYK#ݭOP[~ݼY ݬ][ЭPР[P2{QPQЬP#8] /P~\PݼݬЬP#ݼݬЬPӏ/$ѠݼݬЬPbZѠPРˏPP =ЭPPPPQQ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ЭP׭PZ[xYPZPP[xYPZP[PP @j0~\S^\_P CЬPЬPЬRRQ{RPPR PRPPP]Pt#u###d"h"l"p"t" x"@|"""""""@"rcannot open intermediate filemore than %d args?more than %d filespass 2 error:(file %s) too many names definedtoo many types needed%s: variable # of args.%s, arg. %d used inconsistently%s value used inconsistently%s multiply declared%s value declared inconsistently%s function value type must be declared before use %s(%d) :: %s(%d) main%s returns value which is %s ignored sometimesalways%s value is used, but none returned %sLDILIBLDCLDXLRVLUVLUELUMUSEDVUSEDEUSEDRVALVARARGS%s (), use= , line %d, nargs=%d pass 2 error: intermediate file format error (getstr)pass 2 error: ran out of memory (savestr)pass 2 error: ran out of memory (hash)pass 2 error: ran out of hash tables%s used( %s(%d) ), but not defined %s defined( %s(%d) ), but never used %s declared( %s(%d) ), but never used or defined 4% of memory (hash)pass 2 error: ran out of hash tables%s used( %s(%d) ), but not defined %s defined( %s(%d) ), but never used %s declared( %s(%d) ), but never used or defined lib/lint/llib-lc 644 0 33 7415 2532112357 7017 /* LINTLIBRARY */ #include #include #include #include #include #include int errno; int alarm(s) unsigned s; { return(s); } char *brk(a) char *a; { return(a); } int chdir(s) char *s; { return(0); } int chmod(s, m) char *s; { return(0); } int chown(s, u, g) char *s; { return(0); } int close(f) { return(0); } int creat(s, m) char *s; { return(0); } int dup(f) { return(f); } /* VARARGS */ execl(f, a) char *f, *a; {;} execv(s, v) char *s, *v[]; {;} exit(s) {;} int fork() { return(0); } int fstat(f, b) struct stat *b; { return(0); } int getgid() { return(1); } int getegid() { return(1); } int getpid() { return(1); } int getuid() { return(1); } int geteuid() { return(1); } int gtty(f, b) struct sgttyb *b; { return(0); } int kill(p, s) { return(0); } int link(a, b) char *a, *b; { return(0); } long lseek(f, o, d) long o; { return(0); } int mknod(n, m, a) char *n; { return(0); } char *mktemp(p) char *p; { return(p);} int mount(s, n, f) char *s, *n; { return(0); } int nice(p) { return(0); } int open(f, m) char *f; { return(0); } pause() {;} int pipe(f) int f[2]; { return(0); } profil(b, s, o, i) char *b; {;} int ptrace(r, p, a, d) { return(0); } int read(f, b, l) char *b; { return(l); } char *sbrk(i) { return((char *)0); } int setgid(g) { return(0); } int setuid(u) { return(0); } int (*signal(c, f))() int (*f)(); { return(f); } int stat(s, b) char *s; struct stat *b; { return(0); } char *strcat(a, b) char *a, *b; { ; } int strcmp(a, b) char *a, *b; { return(1); } char *strcpy(a, b) char *a, *b; { ; } int strlen(s) char *s; { return(1); } int stty(f, b) struct sgttyb *b; { return(0); } long tell(f) { return((long)0); } int system(s) char *s; { return(0); } time_t time(t) time_t *t; { return( 0 );} int unlink(s) char *s; { return(0); } int wait(s) int *s; { return(1); } int write(f, b, l) char *b; { return(l); } char *calloc(n,s) unsigned n, s; { static char c[1]; return(c); } char *malloc(n) unsigned n; {static char c; return(&c);} char *realloc(p, n) char *p; unsigned n; { static char c; return(&c);} free(p) char *p; {;} fclose(f) FILE *f; {return(0);} fflush(f) FILE *f; {return(0);} char *fgets( s, l, f ) char *s; FILE *f; { return(s); } FILE *fopen(s,m) char *s, *m; { return(stdin); } FILE *freopen(s, m, f) char *s, *m; FILE *f; { return(stdin); } FILE *fdopen(fd, m) char *m; { return(stdin);} /* VARARGS */ fprintf( f, s ) FILE *f; char *s; {;} fputs(s,f) char *s; FILE *f; {;} fread( p, s, n, f ) char *p; FILE *f; {return(1);} /* VARARGS */ fscanf( f, s ) FILE *f; char *s; {return(1);} int fwrite( p, s, n, f ) char *p; FILE *f; {return(0);} intss(){return(1); } /* VARARGS */ printf( s ) char *s; {;} rewind(f) FILE *f; {;} long ftell(f) FILE *f; { return(0L); } fseek(f, o, p) FILE *f; long o; { return(0); } /* VARARGS */ scanf( f ) char *f; {return(1); } setbuf( f, b ) FILE *f; char *b; {;} /* VARARGS */ char *sprintf( s, f ) char *s, *f; { return(s);} /* VARARGS */ sscanf( s, f ) char *s, *f; { return(1); } ungetc( c, f ) FILE *f; { return(c); } char *ctime(c) time_t *c;{ return(""); } struct tm *localtime(c) time_t *c; { return localtime(c); } struct tm *gmtime(c) time_t *c; { return gmtime(c); } char *asctime(t) struct tm *t; { return(""); } abort() {} int abs(i) int i; { return(i); } double atof(s) char *s; { return(1.); } char *crypt(k,s) char *k, *s; { return(""); } setkey(k) char *k; {} encrypt(s, i) char *s; {} char *ecvt(v, n, d, s) double v; int *d, *s; { return(""); } char *fcvt(v, n, d, s) double v; int *d, *s; { return(((""); } char *gcvt(v, n, b) double v; char *b; { return(""); } monitor(l, h, b, s, n) int (*l)(), (*h)(); short *b; {} perror(s) char *s; {} #include setjmp(e) jmp_buf e; { return(0); } sleep(i) unsigned i; {} struct _iobuf _iob[_NFILE]; char _ctype_[]; atof(s) char *s; { return(1.); } char *crypt(k,s) char *k, *s; { return(""); } setkey(k) char *k; {} encrypt(s, i) char *s; {} char *ecvt(v, n, d, s) double v; int *d, *s; { return(""); } char *fcvt(v, n, d, s) double v; int *d, *s; { returnlib/lint/llib-lc.ln 644 0 33 13102 2552601254 7436 Sllib-lcerrnoM $alarm[ alarm[ bbrkc brkc $chdiri chdiri $chmodo chmodo $chownw chownw$closeclose$creatcreat$dupdup$execl$execvR$exit$forkfork$fstatfstat$getgidgetgid$getegidgetegid$getpidgetpid$getuidgetuid$geteuidgeteuid$gtty`gtty$killkill$linklink%lseeklseek $mknod mknod!bmktemp!mktemp"$mount"mount#$nice#nice$$open $open %$pause&$pipe&pipe'$profil($ptrace&(ptrace&)$read-)read-*bsbrk4*sbrk4+$setgid9+setgid9,$setuid@,setuid@-dsignal1-signal1.$stat.stat/bstrcatI0$strcmpP0strcmpP1bstrcpyW2$strlen^2strlen^3$stty`e3sttye4%tellj4tellj5$systemo5systemo6$timev6timev7$unlink}7unlink}8$wait8wait9$write9write:bcalloc:calloc;bmalloc;malloc<brealloc<realloc=$free>$fclose >fclose?$fflush ?fflush@bfgets @fgetsAh fopenhA fopenhBh freopen uB freopenuCh fdopennC fdopennE$fprintf F$fputs G$fread GfreadI$fscanf IfscanfJ$fwrite JfwriteK$intssKintssM$printfN$rewind O%ftell }Oftell}P$fseek PfseekR$scanfRscanfS$setbuf UbsprintfUsprintfW$sscanf Wsscanf X$ungetc XungetcYbctimeYctimeZhlocaltime Zhlocaltime Zlocaltime [hgmtime *[hgmtime*[gmtime*\basctime1\asctime1]$abort9^$abs?^abs?_'atofC_atofC`bcryptH`cryptHa$setkeyPb$encryptWcbecvt_cecvt_dbfcvtddfcvtdebgcvtiegcvtif$monitorng$perrorxi$setjmpisetjmpj$sleepk8 _iobcl2_ctype_C8 _iobcZhlocaltime [hgmtime_cecvt_dbfcvtddfcvtdebgcvtiegcvtif$monitorng$perrorxi$setjmpisetjmpj$sleepk8 _iobcl2_ctype_C8lib/lint/llib-lcurses 644 0 33 5146 2440702324 10075 /* LINTLIBRARY */ # include "curses.h" box(win,vert,hor) WINDOW *win; int vert, hor; {} delwin(win) WINDOW *win; {} endwin() {} gettmode() {} WINDOW *initscr() { AL = AL; AM = AM; BC = BC; BS = BS; BT = BT; CA = CA; CD = CD; CE = CE; CL = CL; CM = CM; DA = DA; DB = DB; DC = DC; DL = DL; DM = DM; DO = DO; ED = ED; EO = EO; EI = EI; GT = GT; HO = HO; HZ = HZ; IC = IC; IN = IN; IM = IM; IP = IP; LL = LL; MA = MA; MI = MI; NC = NC; ND = ND; OS = OS; PC = PC; SE = SE; SF = SF; SO = SO; SR = SR; TA = TA; TE = TE; TI = TI; UC = UC; UE = UE; UL = UL; UP = UP; US = US; VB = VB; VE = VE; VS = VS; XN = XN; NONL = NONL; UPPERCASE = UPPERCASE; normtty = normtty; pfast = pfast; _tty = _tty; My_term = My_term; _echoit = _echoit; _rawmode = _rawmode; LINES = LINES; COLS = COLS; _tty_ch = _tty_ch; _res_flg = _res_flg; stdscr = stdscr; curscr = curscr; _echoit = _echoit; _rawmode = _rawmode; _tty_ch = _tty_ch; return (WINDOW *) 0; } char * longname(bp, def) char *bp, *def; { return bp; } mvcur(ly,lx,y,x) int ly, lx, y, x; { } /* VARARGS3 */ mvprintw(y,x,fmt) int y, x; char *fmt; { return 0; } /* VARARGS3 */ mvscanw(y,x,fmt) int y, x; char *fmt; { return 0; } /* VARARGS4 */ mvwprintw(win,y,x,fmt) WINDOW *win; int y, x; char *fmt; { return 0; } /* VARARGS4 */ mvwscanw(win,y,x,fmt) WINDOW *win; int y, x; char *fmt; { return 0; } WINDOW *newwin(Nl, Nc, by, bx) int Nl, Nc, by, bx; { return (WINDOW *) 0; } overlay(win1, win2) WINDOW *win1, *win2; { } overwrite(win1, win2) WINDOW *win1, *win2; { } /* VARARGS1 */ printw(fmt) char *fmt; { return 0; } /* VARARGS1 */ scanw(fmt) char *fmt; { return 0; } scroll(win) WINDOW *win; { return 0; } setterm(type) char *type; { return 0; } WINDOW *subwin(o, Nl, Nc, by, bx) WINDOW *o; int Nl, Nc, by, bx; { return o; } waddch(win,ch) WINDOW *win; char ch; { return 0; } waddstr(win,str) WINDOW *win; char *str; { return 0; } wclear(win) WINDOW *win; { return 0; } wclrtobot(win) WINDOW *win; { } wclrtoeol(win) WINDOW *win; { return 0; } wdeleteln(win) WINDOW *win; { return 0; } werase(win) WINDOW *win; { } wgetch(win) WINDOW *win; { return '0'; } wgetstr(win,str) WINDOW *win; char *str; { return 0; } winsertln(win) WINDOW *win; { return 0; } wmove(win,y,x) WINDOW *win; int y, x; { return 0; } /* VARARGS2 */ wprintw(win,fmt) WINDOW *win; char *fmt; { return 0; } wrefresh(win) WINDOW *win; { return 0; } /* VARARGS2 */ wscanw(win,fmt) WINDOW *win; char *fmt; { return 0; } /* These really return char *'s but this wi((ll do. */ int wstandout(win) WINDOW *win; { return 0; } int wstandend(win) WINDOW *win; { return 0; } ) WINDOW *win; { return '0'; } wgetstr(win,str) WINDOW *win; char *str; { return 0; } winsertln(win) WINDOW *win; { return 0; } wmove(win,y,x) WINDOW *win; int y, x; { return 0; } /* VARARGS2 */ wprintw(win,fmt) WINDOW *win; char *fmt; { return 0; } wrefresh(win) WINDOW *win; { return 0; } /* VARARGS2 */ wscanw(win,fmt) WINDOW *win; char *fmt; { return 0; } /* These really return char *'s but this wilib/lint/llib-port.ln 644 0 33 4143 2532112360 10002 llib-port$exit%lseeklseekbmktempmktempdsignalsignalbstrcat$strcmpstrcmp bstrcpy $strlen strlen %tell tell %time time bcalloc callocbmallocmallocbrealloreallo$free$fclosefclose$fflushfflushbfgetsfgetshfopenfopenhfreopefreopehfdopenfdopen$fprint$fputs$freadfread$fscanffscanf$fwritefwrite$intssintss $printf!$rewind#$scanf#scanf$$setbuf&bsprint&sprint($sscanf(sscanf)$ungetc)ungetc*$wdleng*wdleng+8_iob,2_ctype8_iob $printf!$rewind#$scanf#scanf$$setbuf&bsprint&sprint($sscanf(sscanf)$ungetc)ungetc*$wdlenglib/lint/llib-port 644 0 33 3050 2532112360 7366 /* LINTLIBRARY */ #include exit(s) {;} long lseek(f, o, d) long o; { return(0); } char *mktemp(p) char *p; { return(p);} int (*signal(c, f))() int (*f)(); { return(f); } char *strcat(a, b) char *a, *b; { ; } int strcmp(a, b) char *a, *b; { return(1); } char *strcpy(a, b) char *a, *b; { ; } int strlen(s) char *s; { return(1); } long tell(f) { return((long)0); } long time(t) long *t; { return(0);} char *calloc(n,s) unsigned n, s; { static char c[1]; return(c); } char *malloc(n) unsigned n; {static char c; return(&c);} char *realloc(p, n) char *p; unsigned n; { static char c; return(&c);} free(p) char *p; {;} fclose(f) FILE *f; {return(0);} fflush(f) FILE *f; {return(0);} char *fgets( s, l, f ) char *s; FILE *f; { return(s); } FILE *fopen(s,m) char *s, *m; { return(stdin); } FILE *freopen(s, m, f) char *s, *m; FILE *f; { return(stdin); } FILE *fdopen(fd, m) char *m; { return(stdin);} /* VARARGS */ fprintf( f, s ) FILE *f; char *s; {;} fputs(s,f) char *s; FILE *f; {;} fread( p, s, n, f ) char *p; FILE *f; {return(1);} /* VARARGS */ fscanf( f, s ) FILE *f; char *s; {return(1);} int fwrite( p, s, n, f ) char *p; FILE *f; {return(0);} intss(){return(1); } /* VARARGS */ printf( s ) char *s; {;} rewind(f) FILE *f; {;} /* VARARGS */ scanf( f ) char *f; {return(1); } setbuf( f, b ) FILE *f; char *b; {;} /* VARARGS */ char *sprintf( s, f ) char *s, *f; { return(s);} /* VARARGS */ sscanf( s, f ) char *s, *f; { return(1); } ungetc( c, f ) FILE *f; { return(c); } wdleng(){return(0); } struct _iobuf _iob[_NFILE]; char _ctype_[129]; fscanf( f, s ) FILE *f; char *s; {return(1);} int fwrite( p, s, n, f ) char *p; FILE *f; {return(0);} intss(){return(1); } /* VARARGS */ printf( s ) char *s; {;} rewind(f) FILE *f; {;} /* VARARGS */ scanf( f ) char *f; {return(1); } setbuf( f, b ) FILE *f; char *b; {;} /* VARARGS */ char *sprintf( s, f ) char *s, *f; { return(s);} /* VARARGS */ sscanf( s, f ) char *s, *f; { return(1); } ungetc( c, f ) FILE *f; { return(c); } wdleng(){return(0); } struct lib/lint/llib-lcurses.l 644 0 33 10577 2501377330 10356 curses.hK__void__ llib-lcursessp wp "_putchar _putchar $_sprintw( _sprintw($_sscans>_sscans>$boxF$delwinS$endwinZ$fgotoa$gettmodeghinitscrinitscrblongnamelongname$mvcurw$mvprintwmvprintw$mvscanwmvscanw$mvwinmvwin$mvwprintwmvwprintw$mvwscanwmvwscanw hnewwin newwin!$overlay"$overwrite#$plod#plod$$plodput&$printw&printw($putpad)$scanw)scanw*$scroll*scroll+$setterm+setterm,hsubwin,subwin-$touchwin1.$tstp:/$waddch?/waddch?0$waddstrF0waddstrF1$wclearR1wclearR2$wclrtobotY3$wclrtoeolc4$wdeletelnm5$werasew6$wgetch~6wgetch~7$wgetstr7wgetstr8$winsertln9$wmove9wmove;$wprintw;wprintw=$wrefresh=wrefresh>$wscanw>wscanw?bwstandend?wstandend@bwstandout@wstandoutA$zapCAMgCBSjCCAmCDApCDBsCEOvCGTyCHZ|CINCMICMSCNCCOSCULCXNDNONLDUPPERCASEDnormtty D_pfastDMy_termxD_echoitD_rawmodeE_endwinHALHBCHBTHCDHCEHCLHCMHDCH((DLHDMHDOHEDIEI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ted channel %d finished /dev/nullw/usr/adm/dnacctaCan't make accouting fileCan't open master mpx nodeCan't make minor mpx nodeCan't attach to treepseudo-device %s assigned channel %x phase error: Writing data from chan %x on behalf of chan %x %s dialed %s at %s Dialer returns %c %s Unable to locate dialer, chan = %x open succeeded did not hang Line in use @(#)dnd.c 4.4 (Berkeley) 1/20/81/dev/cua0/dev/ttya2/dev/cul0M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/etc/passwdrr,,,(7lib/me/ 775 0 33 0 2510247110 5107 lib/me/acm.me 644 0 33 1234 2426637024 6272 .nr _0 \n(c. .\" @(#)acm.me 2.1 8/18/80 .\" This version has had comments stripped; an unstripped version is available. .de ac .ll 8.9i .nr $s 0.5i .if !\\n($T \ . po 1.0i .ie "\\$2"*" \ \{\ . nr hm 0.375i . nr tm 1.125i . pl 14.25i . nr bm 1.5i . de $h .. . tl ''%'' ... . rm $f .\} .el \ \{\ . nr hm 0 . nr tm 0 . pl 15i . nr bm 3i . nr fm 0.9i . de $f .. . ti 0 \h'|0.5i'\\\\n%\h'|1.25i'\\$2\h'|3i'\\$1 . br ... . rm $h .\} .bp .rs .sp 0.75i .rm ac .. .if t .tm Line \n(c. -- macro .ac will not work in TROFF -- request ignored. .if t .rm ac .de +c .if \\n(?A \ \{\ . nr ch 0 1 . pn 1 . ep . af % 1 . bp .\} .nr ?A 0 .sp 1i .if \\n(.$ \ . $c "\\$1" .. .nr c. \n(_0 ($T \ . po 1.0i .ie "\\$2"*" \ \{\ . nr hm 0.375i . nr tm 1.125i . pl 14.25i . nr bm 1.5i . de $h .. . tl ''%'' ... . rm $f .\} .el \ \{\ . nr hm 0 . nr tm 0 . pl 15i . nr bm 3i . nr fm 0.9i . de $f .. . ti 0 \h'|0.5i'\\\\n%\h'|1.25i'\\$2\h'|3i'\\$1 . br ... . rm $h .\} .bp .rs .sp 0.75i .rm ac .. .if t .tm Line \n(c. -- macro .ac will not work in TROFF lib/me/chars.me 644 0 33 2702 2403551365 6631 .nr _0 \n(c. .\" @(#)chars.me 2.2 8/29/80 .\" This version has had comments stripped; an unstripped version is available. .if n \ \{\ . ds #[ \f1 . ds #] \fP . ds #h 0 . ds #v 0.8m . ds #f 0.3m .\} .if t \ \{\ . ds #[ \& . ds #] \& . ds #h ((1u-(\\\\n(.fu%2u))*0.13m) . ds #v 0.6m . ds #f 0 .\} .ds ' \k_\h'-(\\n(.wu*8/10-\*(#h)'\*(#[\(aa\h'|\\n_u'\*(#] .ds ` \k_\h'-(\\n(.wu*7/10-\*(#h)'\*(#[\(ga\h'|\\n_u'\*(#] .ds : \k_\h'-(\\n(.wu*8/10-\*(#h+0.1m+\*(#f)'\v'-\*(#v'\*(#[\z.\h'0.2m+\*(#f'.\h'|\\n_u'\v'\*(#v'\*(#] .ds ^ \k_\h'-(\\n(.wu-\*(#h-0.05m)'\*(#[^\h'|\\n_u'\*(#] .ds ~ \k_\h'-(\\n(.wu-\*(#h-0.05m)'\*(#[~\h'|\\n_u'\*(#] .ds , \k_\h'-(\\n(.wu)'\*(#[,\h'|\\n_u'\*(#] .ds v \k_\h'-(\\n(.wu*9/10-\*(#h)'\v'-\*(#v'\*(#[\s-4v\s0\v'\*(#v'\h'|\\n_u'\*(#] .ds o \k_\h'-(\\n(.wu+\w'\(de'u-\*(#h)/2u'\v'-0.4n'\*(#[\z\(de\v'0.4n'\h'|\\n_u'\*(#] .ds qe \*(#[\v'0.5m'\z\(em\v'-0.65m'\z\(em\v'-0.65m'\z\(em\v'0.8m'\h'0.3m'|\h'-0.3m'\*(#] .ds qa \*(#[\h'-0.24m'\z\e\h'0.48m'\z\(sl\h'-0.24m'\v'-0.15m'\(em\v'0.15m'\*(#] .if t \ \{\ . ds qe \s-2\v'0.45m'\z\(em\v'-0.625m'\z\(em\v'-0.625m'\(em\v'0.8m'\s0\h'-0.1m'\v'-0.05m'\(br\v'0.05m'\h'0.1m' . ds qa \z\e\h'0.35m'\z\(sl\h'-0.33m'\v'-0.3m'\s-4\(em\s0\v'0.3m'\h'0.15m' .\} .if \n($T \ \{\ . ds ' \*(#[\h'-1'\(aa\*(#] . ds ` \*(#[\h'-1'\(ga\*(#] . ds : \& . ds ^ \*(#[\h'-1'^\*(#] . ds ~ \*(#[\h'-1'~\*(#] . ds , \*(#[\h'-1',\*(#] . ds v \& . ds o \& . ds qe EXISTS . ds qa FORALL .\} .rm #[ .rm #] .rm #h .rm #v .rm #f .nr c. \n(_0 0.48m'\z\(sl\h'-0.24m'\v'-0.15m'\(em\v'0.15m'\*(#] .if t \ \{\lib/me/deltext.me 644 0 33 416 2400260056 7151 .nr _0 \n(c. .\" @(#)deltext.me 2.1 8/18/80 .\" This version has had comments stripped; an unstripped version is available. .de (d .am |d )d .sp \\n(bsu .. .de )d .if \\n# \ . nr $d +1 .ds # [\\n($d]\k# .rr # .. .de pd .|d .rm |d .nr $d 1 1 .ds # [1]\k# .. .nr c. \n(_0 \& . ds ^ \*(#[\h'-1'^\*(#] . ds ~ \*(#[\h'-1'~\*(#] . ds , \*(#[\h'-1',\*(#] . ds v \& . ds o \& . ds qe EXISTS . ds qa FORALL .\} .rm #[ .rm #] .rm /( ,( 5h /\@,\D"lib/me/eqn.me 644 0 33 1612 2400260060 6275 .nr _0 \n(c. .\" @(#)eqn.me 2.1 8/18/80 .\" This version has had comments stripped; an unstripped version is available. .de EQ .ec .if !\\n(?e \ \{\ . if "\\n(.z"|e" .tm Line \\n(c. -- Nested .EQ request . @D 1 "\\$1" "\\$2" . @C 2 . di |e .\} .ls 1 .in 0 .nf .. .de EN .br .ie "\\$1"C" \ \{\ . nr ?e 1 . sp \\n(esu .\} .el \ \{\ . nr ?e 0 . di . if \\n(dn \ . @q . rm |e . rm 10 . rm 11 . rm 12 . rm 13 . rm 14 . rm 15 . rm 16 . rm 17 . rm 18 . rm 19 . rm 20 . rm 21 . rm 22 . rm 23 . ev .\} .. .de @q .nr _Q \\n(dnu .ev .sp \\n(esu .@C 2 .ie \\n(_d=1 \ . in (\\n(.lu+\\n($iu-\\n(dlu)/2u .el .ie \\n(_d=2 \ . in \\n($iu .el .ie \\n(_d=3 \ . in \\n(biu+\\n($iu .el .if \\n(_d=4 \ . in 0 .if !"\\n(.z"" \!.ne \\n(_Qu .ne \\n(_Qu+\n(.Vu .mk _q .if !"\\*(|p"" \ \{\ . rs . sp (\\n(_Qu-\\n(.vu)/2u . tl """\\*(|p" . rt \\n(_qu .\} .|e .sp |\\n(_qu+\\n(_Qu .sp \\n(esu+\\n(.Lv-1v .rr _q .rr _Q .. .nr c. \n(_0 12 . rm 13 . rm 14 . rm 15 . rm 16 . rm 17 . rm 18 . rm 19 . rm 20 . rm 21 . rm 22 . rm 23 . ev .\} .. .de @q .nr _Q \((lib/me/float.me 644 0 33 1367 2400260061 6627 .nr _0 \n(c. .\" @(#)float.me 2.1 8/18/80 .\" This version has had comments stripped; an unstripped version is available. .de (z .@D 4 \\$1 \\$2 .@( .nr ?T 0 .. .de )z .sp \\n(zsu .@) .rr _0 .if !\\n(?b \ . nr dn +(\\n(ppu*\\n($ru)/2u+\\n(zsu .nr dl -\n(.H .ie ((\\n(dn+\n(.V)>=\\n(.t):(\\n(?a):((\\n(dl>\\n($l)&(\\n($c>1)) \ \{\ . nr ?a 1 . if (\\n(dl>\\n($l)&(\\n($m>1) \ . nr ?w 1 . ds |x |t .\} .el \ \{\ . nr ?b 1 . if (\\n(dl>\\n($l)&(\\n($m>1) \ . nr ?W 1 . nr _b +\\n(dnu . ch @f -\\n(_bu . ds |x |b .\} .da \\*(|x .nf .ls 1 .nr ?k 1 \!.if \\\\n(nl>(\\\\n(tm+2v) .ne \\n(dnu-\\n(zsu .eo .cc @ @|k @cc .ec .nr ?k 0 .rm |k .da .in 0 .ls 1 .xl \\n($lu .ev .. .de @k .ev 1 .nf .ls 1 .in 0 .sp \\n(zsu .\\$1 .ec .br .rm \\$1 .ev .nr ?T 0 .. .nr c. \n(_0 dl -\n(.H .ie ((\\n(dn+\n(.V)>=\\n(.t):(\\n(?a):((\\n(dl>\\n($l)&(\\n($c>1)) \ \{\ . nr ?a 1 . if (\\n(dl>\\n($l)&(\\n($m>1) \ . nr ?w 1 . ds |x |t .\} .el \ \{\ . nr ?b 1 . if (\\n(dl>\\n($l)&(\\n($m>1) \ . nr ?W 1 . nr _b +\\n(dnu . ch @f -\\n(_bu . ds |x |b .\lib/me/footnote.me 644 0 33 2041 2413540005 7350 .nr _0 \n(c. .\" @(#)footnote.me 2.4 9/23/80 .\" This version has had comments stripped; an unstripped version is available. .de (f .ec .if "\\n(.z"|f" .tm Line \\n(c. -- Illegal footnote nesting .ie "\\n(.z"" \ \{\ . nr _D \\n(dn . nr _0 1v+\\n(nlu . ev 2 . da |f . in 0 . xl \\n($lu-\\n(fuu . @F \\n(ff . sz \\n(fpu . vs \\n(.su*\\n($Ru . if !\\n(?f \ \{\ . nr _b +2u*\n(.Vu . $s . \} . br . if \\n(.p-\\n(_b-\\n(_0-\\n(.h-1v-\\n(fs<0 \ \{\ . da\" . bc . if !\\n(?f \ . rm |f . da |f . in 0 . xl \\n($lu-\\n(fuu . @F \\n(ff . sz \\n(fpu . vs \\n(.su*\\n($Ru . if !\\n(?f \ . $s . br . \} . rr _0 . sp \\n(fsu . nr ?f 1 . fi . if !"\\$1"_" \ . ti \\n(fiu .\} .el \ \{\ . ev 2 \!.(f \\$1 .\} .. .de )f .ie "\\n(.z"|f" \ \{\ . if \\n* \ . nr $f +1 . ds * \\*[\\n($f\\*]\k* . rr * . in 0 . da . ev . if \\n(_w<\\n(dl \ . nr _w \\n(dl . nr _b +\\n(dn . ch @f -\\n(_bu . if \\n(.p-\\n(_b<=\\n(nl \ . ch @f \\n(nlu+\n(.Vu . nr dn _D . rr _D .\} .el \ \{\ . br \!.)f . ev .\} .. .if \n(ff<=0 \ . nr ff 1 .if \n(fp<=0 \ . nr fp 8 .nr c. \n(_0 n(fpu . vs \\n(.su*\\n($Ru . if !\\n(?f \ . $s . br . \} . rr _0 . sp \\n(fsu . nr ?f 1 . fi . if !"\\$1"_" \ . ti \\n(fiu .\} .el \ \{\ . ev 2 \!.(f \\$1 .\} .. .de )f .ie "\\n(.z"|f" \ \{\ . if \\n* \ . nr $f +1 . ds * \\*[\\n($f\\*]\k* . rr * . in 0 . da . ev . if \\n(_w<\\n(dl \ . nr _w \\n(dl . nr _b +\\n(dn . ch @f -\\n(_bu . if \\n(.p-\\n(_b<=\\n(nl \ . ch @f \\n(nlu+\n(.Vu . nr dn _D . rr _D .\} .el \ \{\ . br \!.)f . ev .\} .. .if \n(ff<=0 \ . nr ff 1 .if \lib/me/index.me 644 0 33 1420 2445266074 6642 .nr _0 \n(c. .\" @(#)index.me 2.6 12/10/80 .\" This version has had comments stripped; an unstripped version is available. .de (x .ie !"\\n(.z"" \ \{\ . ev 2 \!\\!.(x \\$1 .\} .el \ \{\ . ds |X x . if \\n(.$ \ . ds |X \\$1 . am %\\*(|X )x . sp \\n(xsu .\} .. .de )x .ie "\\n(.z"" \ \{\ . ds |x \\n% . if \\n(.$ \ . ds |x \\$1 . if "\\*(|x"_" \ . ig .. . am %\\*(|X .. . if \w"\\$2">(\\n(.l-\\n(.i-\\n(.k) \ . ti +\\n(xuu \\\\a\\\\t\\$2\\*(|x ... . rm |x . rm |X .\} .el \ \{\ \!\\!.)x \\$1 \\$2 . br . ev .\} .. .de xp .br .@C 2 .ls 1 .vs \\n(.su*\\n($Ru .fi .ds |X x .if \\n(.$ \ . ds |X \\$1 .xl -(\\n(xuu+\w'...'u) .di |x .%\\*(|X .br .di .rm %\\*(|X .xl \\n($lu .rm |X .ev .nf .in 0 .ta \\n(.lu-\\n(xuuR \\n(.luR .|x .fi .in .rm |x .. .if \n(xu<=0 \ . nr xu 0.5i .nr c. \n(_0 \\n(.z"" \ \{\ . ds |x \\n% . if \\n(.$ \ . ds |x \\$1 . if "\\*(|x"_" \ . ig .. . am %\\*(|X .. . if \w"\\$2">(\\n(.l-\\n(.i-\\n(.k) \ . ti +\\n(xuu \\\\a\\\\t\\$2\\*(|x ... . rm |x . rm |X .\} .el \ \{\ \!\\!.)x \\$1 \\$2 . br . ev .\}lib/me/local.me 644 0 33 671 2400260066 6576 .nr _0 \n(c. .\" this file may contain local macros, which are initialized with .\" the ".lo" request. All macros and number registers in this file .\" should be named ".*X", where X is any letter (upper or lower case) .\" or digit, to avoid naming conflicts. .\" .\" @(#)local.me 2.1 8/18/80 .\" This version has had comments stripped; an unstripped version is available. . \" *** insert new definitions before this line *** .nr c. \n(_0 ,( 5h /\@,\D"lib/me/null.me 644 0 33 162 2400260067 6452 .\" @(#)null.me 2.1 8/18/80 .\" This version has had comments stripped; an unstripped version is available. .cc . and number registers in this file .\" should be named ".*X", where X is any letter (upper or lower case) .\" or digit, to avoid naming conflicts. .\" .\" @(#)local.me 2.1 8/18/80 .\" This version has had comments stripped; an unstripped version is available. . \" *** insert new definitions before this l/( ,( 5h /\@,\D"lib/me/revisions 644 0 33 11037 2445266075 7202 2.9 10 Dec 80 -- More stuff to make indices inside keeps work correctly. 2.8 10 Nov 80 -- Had .)c do a .br to insure that the final line is forced out. 2.7 24 Sep 80 -- Fixed bug in 2.6 2.6 23 Sep 80 -- Fixed problem introduced by 2.2 which occured in footnotes and index entries in filled keeps 2.5 29 Aug 80 -- Changed umlaut to not be so tricky -- it seems to backfire. 2.4 25 Aug 80 -- Fixed bug in indices caused by 2.2. 2.3 20 Aug 80 -- Fixed bug in footnotes caused by 2.2. -- Changed temp file names that macros that do dynamic loading rename themselves to. For example, if you say '.TS ... .(f' when both of them have been used for the first time, the @T macro got used twice. 2.2 18 Aug 80 -- Suspended footnote & index processing until final output (so that they will work properly in keeps). 2.1 18 Aug 80 -- Release 2. No changes. Mod 28 18 Aug 80 -- If \nv is set on entry, handle .po differently (for vtroff). -- Allow ".nr fi 0". Mod 27 30 Jun 80 -- Put in a cludge to try to make multi-columned output work with wide floating keeps. Moves all wide keeps to the top of the next real page. Mod 26 9 Nov 79 -- Fixed footnote bug that caused the first line of footnotes that were broken across a page to be indented. Mod 25 1 Oct 79 -- Fixed footnote bug that caused footnotes invoked at the top of pages to come out in bold font. -- Fixed equation bug that caused equations at the top of page to be improperly centered. Mod 24 27 Sep 79 -- Changed delimiter in all \w's to " from ', to allow for apostrophes in labels. -- Increased footnote fudge factor. -- Changed \x factor in \*[ & \*< to be one half previous value. Mod 23 24 Aug 79 -- Changed .ip to start new line if the tag is too long for the space provided. Mod 22 11 Jul 79 -- Changed .ac to handle new paper (with second parameter == "*"). Mod 21 24 Apr 79 -- Changed \*[ and \*< to use \x -- to avoid line overlap. Mod 20 6 Apr 79 -- Changed 12-pitch DTC terminals to still space 1/6 inch (instead of 1/8 inch), unless the 'x' register is non-zero -- do-able with the -rx1 option on the nroff command line. Mod 19 28 Mar 79 -- Had .ep do a .rs, to avoid occasional problems (like with .+c (again). -- Added the 'X' register: if non-zero on startup on a 12-pitch terminal, it outputs 6 LPI instead of 8 LPI. Mod 18 26 Mar 79 -- Had .+c reset indent, to solve problems of prelim material after a .ip (as with references) Mod 17 19 Mar 79 -- Fixed a bug in .++ which caused it to renumber pages incorrectly, th((e result of nroff starting a new page immediately upon reaching the end of the previous page (damn!). Mod 16 8 Mar 79 -- Fixed a bug in .++ which caused it to change page number formats before forcing out the page. -- Changed tmac.e so that extra '.so's to the package will next to 'null.me'. -- Changed .sh so that a title of "_" will cause section depth change side-effects only (base indent will remain the same, and no output will occur). Mod 15a 7 Mar 79 -- Fixed a bug in Mod 15 which caused .ip's to fail. Mod 15 2 Mar 79 -- Changed .@p to do paragraph indents normally in keeps, which will override the indent parameter in keeps with paragraph forms in them (use .ba to fix this). Mod 14 23 Feb 79 -- Fixed .ip so it would hyphenate correctly. Mod 13 16 Feb 79 -- Added .rs before eqn title output to fix vertical centering problem. Mod 12 15 Feb 79 -- Changed NROFF bold font to be regular .ul (.cu is a pain). -- Changed .sh to output regular spaces instead of unpaddable spaces. -- Fixed bug in .1c with bad line length (didn't reset \n($l). Mod 11 13 Feb 79 -- Added hook to .$c to call .$C (for index entries or whatever). Mod 10 12 Feb 79 -- Had .xp print in current environment and not reset to single spacing, to allow more control over output format. Mod 9 26 Dec 78 -- Fixed yet another problem with equation spacing. Mod 8 18 Dec 78 -- Fixed .@q to solve a problem with \n(dn getting lost on equations at top of page. Mod 7 11 Dec 78 -- Had .@q (equation output) move to end of equation after equation output (eqn doesn't seem to space quite right). Mod 6 27 Nov 78 -- Fixed the umlaut on DTC output to be prettier. Mod 5 5 Nov 78 -- Fixed a bug with the second parameter to .ip. Mod 4 2 Nov 78 -- Added .uh command (unnumbered heading). -- Changed .$p and .sh accordingly. Mod 3 2 Oct 78 -- Fixed .ne command in .$p (print section headings). Mod 2 25 Sep 78 -- Changed .np to use () instead of []. Mod 1 12 Sep 78 -- Fixed footnote fudge factor (curse NROFF!!) -- Put "needs" on .(z, .)z. Mod 0 11 Sep 78 output (eqn doesn't seem to space quite right). Mod 6 27 Nov 78 -- Fixed the umlaut on DTC output to be prettier. Mod 5 5 Nov 78 -- Fixed a bug with the second parameter to .ip. Mod 4 2 Nov 78 -- Added .uh command (unnumbered heading). -- Changed .$p and .sh accordingly. Mod 3 2 Oct 78 -- Fixed .ne command in .$p (print section headings). Mod 2 25 Sep 78 -- Changed .np to use () instead of []. Mod 1 12 Sep 78 -- Fixed footnote fudge factor (curse NROFF!!) -- Put "needs"lib/me/sh.me 644 0 33 2721 2401200323 6123 .nr _0 \n(c. .\" @(#)sh.me 2.1 8/18/80 .\" This version has had comments stripped; an unstripped version is available. .de sh .if (\\n(si>0)&(\\n(si<1n) \ . nr si \\n(sin .ce 0 .@d "\\$1" +1 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 .if !"\\$2"_" \ \{\ . ds |x \&\\$2 . $p "\\*(|x" "\\*($n" \\n($0 . $0 "\\*(|x" "\\*($n" \\n($0 . rm |x .\} .nr $p 0 1 .. .de @d .if !""\\$1" \ . nr $0 \\$1 .if \\n($0&(\\n(.$>1) \ . nr $\\n($0 \\$2 .ds $n \&\" .ie \\n($0>=1 \ \{\ . if \\n($1=0 \ . nr $1 1 . if (\\n(.$>=3) .if !"\\$3"-" \ . nr $1 \\$3 . as $n \\n($1 .\} .el \ . nr $1 0 .ie \\n($0>=2 \ \{\ . if \\n($2=0 \ . nr $2 1 . if (\\n(.$>=4) .if !"\\$4"-" \ . nr $2 \\$4 . as $n .\\n($2 .\} .el \ . nr $2 0 .ie \\n($0>=3 \ \{\ . if \\n($3=0 \ . nr $3 1 . if (\\n(.$>=5) .if !"\\$5"-" \ . nr $3 \\$5 . as $n .\\n($3 .\} .el \ . nr $3 0 .ie \\n($0>=4 \ \{\ . if \\n($4=0 \ . nr $4 1 . if (\\n(.$>=6) .if !"\\$6"-" \ . nr $4 \\$6 . as $n .\\n($4 .\} .el \ . nr $4 0 .ie \\n($0>=5 \ \{\ . if \\n($5=0 \ . nr $5 1 . if (\\n(.$>=7) .if !"\\$7"-" \ . nr $5 \\$7 . as $n .\\n($5 .\} .el \ . nr $5 0 .ie \\n($0>=6 \ \{\ . if \\n($6=0 \ . nr $6 1 . if (\\n(.$>=8) .if !"\\$8"-" \ . nr $6 \\$8 . as $n .\\n($6 .\} .el \ . nr $6 0 .. .de sx .ce 0 .ul 0 .nr _0 \\n($0-1 .if \\n(.$ .nr _0 +1 .if \\n(.$ .nr _0 \\$1 .@d \\n(_0 .rr _0 .$p "" "" \\n($0 .nr $p 0 1 .. .de uh .$p "\\$1" .$0 "\\$1" .. .if \n(sf<=0 \ . nr sf 8 .if \n(sp<=0 \ . nr sp 10 .if \n(ss<=0 \ . nr ss 12p .if \n(si<=0 \ . nr si 0 .nr c. \n(_0 n($5=0 \ . nr $5 1 . if (\\n(.$>=7) .if !"\\$7lib/me/src/ 775 0 33 0 2510247110 5676 lib/me/src/acm.me 444 0 33 1164 2426636772 7072 .nr _0 \n(c. .\" @(#)acm.me 2.1 8/18/80 .\" %beginstrip% .de ac .ll 8.9i .nr $s 0.5i .if !\\n($T \ . po 1.0i .ie "\\$2"*" \ \{\ . nr hm 0.375i . nr tm 1.125i . pl 14.25i . nr bm 1.5i . de $h .. . tl ''%'' ... . rm $f .\} .el \ \{\ . nr hm 0 . nr tm 0 . pl 15i . nr bm 3i . nr fm 0.9i . de $f .. . ti 0 \h'|0.5i'\\\\n%\h'|1.25i'\\$2\h'|3i'\\$1 . br ... . rm $h .\} .bp .rs .sp 0.75i .rm ac .. .if t .tm Line \n(c. -- macro .ac will not work in TROFF -- request ignored. .if t .rm ac .de +c \" *** begin chapter .if \\n(?A \ \{\ . nr ch 0 1 . pn 1 . ep . af % 1 . bp .\} .nr ?A 0 .sp 1i .if \\n(.$ \ . $c "\\$1" .. .nr c. \n(_0 $2"*" \ \{\ . nr hm 0.375i . nr tm 1.125i . pl 14.25i . nr bm 1.5i . de $h .. . tl ''%'' ... . rm $f .\} .el \ \{\ . nr hm 0 . nr tm 0 . pl 15i . nr bm 3i . nr fm 0.9i . de $f .. . ti 0 \h'|0.5i'\\\\n%\h'|1.25i'\\$2\h'|3i'\\$1 . br ... . rm $h .\} .bp .rs .sp 0.75i .rm ac .. .if t .tm Line \n(c. -- macro .ac will not work in TROFF -- request ignored. .if t .rm ac .de +c \" *** begin chapter lib/me/src/chars.me 444 0 33 3154 2426636314 7423 .nr _0 \n(c. .\" @(#)chars.me 2.2 8/29/80 .\" %beginstrip% .\" *** special characters *** .\" this file uses temp strings of the form #x. .if n \ \{\ . ds #[ \f1 . ds #] \fP . ds #h 0 . ds #v 0.8m . ds #f 0.3m .\} .if t \ \{\ . ds #[ \& . ds #] \& . ds #h ((1u-(\\\\n(.fu%2u))*0.13m) . ds #v 0.6m . ds #f 0 .\} .\" \" accents .ds ' \k_\h'-(\\n(.wu*8/10-\*(#h)'\*(#[\(aa\h'|\\n_u'\*(#] .ds ` \k_\h'-(\\n(.wu*7/10-\*(#h)'\*(#[\(ga\h'|\\n_u'\*(#] .\" \" umlaut .ds : \k_\h'-(\\n(.wu*8/10-\*(#h+0.1m+\*(#f)'\v'-\*(#v'\*(#[\z.\h'0.2m+\*(#f'.\h'|\\n_u'\v'\*(#v'\*(#] .\" \" circumflex and tilde .ds ^ \k_\h'-(\\n(.wu-\*(#h-0.05m)'\*(#[^\h'|\\n_u'\*(#] .ds ~ \k_\h'-(\\n(.wu-\*(#h-0.05m)'\*(#[~\h'|\\n_u'\*(#] .\" \" cedilla and czech .ds , \k_\h'-(\\n(.wu)'\*(#[,\h'|\\n_u'\*(#] .ds v \k_\h'-(\\n(.wu*9/10-\*(#h)'\v'-\*(#v'\*(#[\s-4v\s0\v'\*(#v'\h'|\\n_u'\*(#] .\" \" Norwegian A or angstrom .ds o \k_\h'-(\\n(.wu+\w'\(de'u-\*(#h)/2u'\v'-0.4n'\*(#[\z\(de\v'0.4n'\h'|\\n_u'\*(#] .\" \" there exists, for all .ds qe \*(#[\v'0.5m'\z\(em\v'-0.65m'\z\(em\v'-0.65m'\z\(em\v'0.8m'\h'0.3m'|\h'-0.3m'\*(#] .ds qa \*(#[\h'-0.24m'\z\e\h'0.48m'\z\(sl\h'-0.24m'\v'-0.15m'\(em\v'0.15m'\*(#] .if t \ \{\ . ds qe \s-2\v'0.45m'\z\(em\v'-0.625m'\z\(em\v'-0.625m'\(em\v'0.8m'\s0\h'-0.1m'\v'-0.05m'\(br\v'0.05m'\h'0.1m' . ds qa \z\e\h'0.35m'\z\(sl\h'-0.33m'\v'-0.3m'\s-4\(em\s0\v'0.3m'\h'0.15m' .\} .if \n($T \ \{\ . ds ' \*(#[\h'-1'\(aa\*(#] . ds ` \*(#[\h'-1'\(ga\*(#] . ds : \& . ds ^ \*(#[\h'-1'^\*(#] . ds ~ \*(#[\h'-1'~\*(#] . ds , \*(#[\h'-1',\*(#] . ds v \& . ds o \& . ds qe EXISTS . ds qa FORALL .\} .rm #[ .rm #] .rm #h .rm #v .rm #f .nr c. \n(_0 0.48m'\z\(sl\h'-0.24m'\v'-0.15m'\(em\v'0.15m'\*(#] .if t \ \{\ . ds qe \s-2\v'0.45m'\z\(em\v'-0.625m'\z\(em\v'-0.625m'\(em\v'0.8m'\s0\h'-0.1m'\v'-0.05m'\(br\v'0.05m'\h'0.1m' . ds qa \z\e\h'0.35m'\z\(sl\h'-0.33m'\v'-0.3m'\s-4\(em\s0\v'0.3m'\h'0.15m' .\} .if \n($T \ \{\ . ds ' \*(#[\h'-1'\(aa\*(#] . ds ` \*(#[\h'-1'\(ga\*(#] . ds : \& . ds ^ \*(#[\h'-1'^\*(#] . ds ~ \*(#[\h'-1'~\*(#] . ds , \*(#[\h'-1',lib/me/src/deltext.me 444 0 33 441 2426636315 7751 .nr _0 \n(c. .\" @(#)deltext.me 2.1 8/18/80 .\" %beginstrip% .de (d \" *** begin delayed text .am |d )d .sp \\n(bsu .. .de )d \" *** end delayed text .if \\n# \ . nr $d +1 .ds # [\\n($d]\k# .rr # .. .de pd \" *** print delayed text .|d .rm |d .nr $d 1 1 .ds # [1]\k# .. .nr c. \n(_0 \z\e\h'0.35m'\z\(sl\h'-0.33m'\v'-0.3m'\s-4\(em\s0\v'0.3m'\h'0.15m' .\} .if \n($T \ \{\ . ds ' \*(#[\h'-1'\(aa\*(#] . ds ` \*(#[\h'/,5h /,"((lib/me/src/eqn.me 444 0 33 2114 2426636315 7102 .nr _0 \n(c. .\" @(#)eqn.me 2.1 8/18/80 .\" %beginstrip% .de EQ \" *** equation start .ec .if !\\n(?e \ \{\ . if "\\n(.z"|e" .tm Line \\n(c. -- Nested .EQ request . @D 1 "\\$1" "\\$2" . @C 2 . di |e .\} .ls 1 .in 0 .nf .. .de EN \" *** equation end .br .ie "\\$1"C" \ \{\ . nr ?e 1 . sp \\n(esu .\} .el \ \{\ . nr ?e 0 . di . if \\n(dn \ . @q \" actual equation output . rm |e . rm 10 . rm 11 . rm 12 . rm 13 . rm 14 . rm 15 . rm 16 . rm 17 . rm 18 . rm 19 . rm 20 . rm 21 . rm 22 . rm 23 . ev .\} .. .de @q \" --- equation output .nr _Q \\n(dnu .ev .sp \\n(esu \" output rest of preceeding text .@C 2 \" .ev 2 may be jumbled from header .ie \\n(_d=1 \ . in (\\n(.lu+\\n($iu-\\n(dlu)/2u .el .ie \\n(_d=2 \ . in \\n($iu .el .ie \\n(_d=3 \ . in \\n(biu+\\n($iu .el .if \\n(_d=4 \ . in 0 .if !"\\n(.z"" \!.ne \\n(_Qu .ne \\n(_Qu+\n(.Vu \" keep it on one page .mk _q .if \n@>1 .tm --@e: _Q=\\n(_Q _q=\\n(_q nl=\\n(nl |p=\\*(|p .if !"\\*(|p"" \ \{\ . rs . sp (\\n(_Qu-\\n(.vu)/2u . tl """\\*(|p" . rt \\n(_qu .\} .|e .sp |\\n(_qu+\\n(_Qu .sp \\n(esu+\\n(.Lv-1v .rr _q .rr _Q .. .nr c. \n(_0 f preceeding text .@C 2 \" .ev 2 may be jumbled from header .ie \\n(_d=1 \ . in (\\n(.lu+\\n($iu-\\n(dlu)/2u .el .ie \\n(_d=2 \ . in \\n($iu .el .ie \\n(_d=3 \ . in \\n(biu+\\n($iu .el .if \\n(_d=4 \ . in 0 .if !"\\n(.z"" \!.ne \\n(_Qu .ne \\n(_Qu+\n(.Vu \" keep it on one page .mk _q .if \n@>1 .tm --@e: _Q=\\n(_Q _q=\\n(_q nl=\\n(nl |p=\\*(|p .if !"\\*(|p"" \ \{\ . rs . sp (\\n(_Qu-\\n(.vu)/2u . tl """\\*(|p" . rt \\n(_qu .\} .|lib/me/src/float.me 444 0 33 1716 2426636315 7433 .nr _0 \n(c. .\" @(#)float.me 2.1 8/18/80 .\" %beginstrip% .de (z \" *** begin floating keep .@D 4 \\$1 \\$2 .@( .nr ?T 0 .. .de )z \" *** end floating keep .sp \\n(zsu .@) .rr _0 .if !\\n(?b \ . nr dn +(\\n(ppu*\\n($ru)/2u+\\n(zsu .nr dl -\n(.H \" fudge factor necessary to make it work .ie ((\\n(dn+\n(.V)>=\\n(.t):(\\n(?a):((\\n(dl>\\n($l)&(\\n($c>1)) \ \{\ . nr ?a 1 . if (\\n(dl>\\n($l)&(\\n($m>1) \ . nr ?w 1 \" mark wider than one column (top) . ds |x |t .\} .el \ \{\ . nr ?b 1 . if (\\n(dl>\\n($l)&(\\n($m>1) \ . nr ?W 1 \" mark wider than one column (bottom) . nr _b +\\n(dnu . ch @f -\\n(_bu . ds |x |b .\} .da \\*(|x \" copy to save macro .nf .ls 1 .nr ?k 1 \!.if \\\\n(nl>(\\\\n(tm+2v) .ne \\n(dnu-\\n(zsu .eo .cc @ @|k \" and the body @cc .ec .nr ?k 0 .rm |k \" remove the temp macro .da .in 0 .ls 1 .xl \\n($lu .ev .. .de @k \" --- output floating keep .ev 1 .nf .ls 1 .in 0 .sp \\n(zsu .\\$1 .ec .br .rm \\$1 .ev .nr ?T 0 .. .nr c. \n(_0 s |x |t .\} .el \ \{\ . nr ?b 1 . if (\\n(dl>\\n($lib/me/src/footnote.me 444 0 33 2430 2426636315 10155 .nr _0 \n(c. .\" @(#)footnote.me 2.4 9/23/80 .\" %beginstrip% .de (f \" *** begin footnote .ec .if "\\n(.z"|f" .tm Line \\n(c. -- Illegal footnote nesting .ie "\\n(.z"" \ \{\ . nr _D \\n(dn . nr _0 1v+\\n(nlu . ev 2 . da |f . in 0 . xl \\n($lu-\\n(fuu . @F \\n(ff . sz \\n(fpu . vs \\n(.su*\\n($Ru . if !\\n(?f \ \{\ . nr _b +2u*\n(.Vu \" fudge factor . $s . \} . br . if \\n(.p-\\n(_b-\\n(_0-\\n(.h-1v-\\n(fs<0 \ \{\ . da\" \" won't fit on page at all . bc . if !\\n(?f \ . rm |f . da |f .\" next five lines could be dropped if headers had their own environment . in 0 \" reset everything from .bc . xl \\n($lu-\\n(fuu . @F \\n(ff . sz \\n(fpu . vs \\n(.su*\\n($Ru . if !\\n(?f \ . $s . br . \} . rr _0 . sp \\n(fsu . nr ?f 1 . fi . if !"\\$1"_" \ . ti \\n(fiu . if \n@>2 .tm << (f $f=\\n($f .\} .el \ \{\ . ev 2 \!.(f \\$1 .\} .. .de )f \" *** end footnote .ie "\\n(.z"|f" \ \{\ . if \\n* \ . nr $f +1 . ds * \\*[\\n($f\\*]\k* . rr * . in 0 . da . ev . if \\n(_w<\\n(dl \ . nr _w \\n(dl \" compute maximum fn width . nr _b +\\n(dn . ch @f -\\n(_bu . if \\n(.p-\\n(_b<=\\n(nl \ . ch @f \\n(nlu+\n(.Vu . nr dn _D . rr _D .\} .el \ \{\ . br \!.)f . ev .\} .. .if \n(ff<=0 \ . nr ff 1 \" footnote font: Times Roman .if \n(fp<=0 \ . nr fp 8 \" footnote pointsize .nr c. \n(_0 >2 .tm << (f $f=\\n($f .\} .el \ \{\ . ev 2 \!.(f \\$1 .\} .. .de )f \" *** end footnote .ie "\\n(.z"|f" \ \{\ . if \\n* \ . nr $f +1 . ds * \\*[\\n($f\\*]\k* . rr * . in 0 . da . ev . if \\n(_w<\\n(dl \ . nr _w \\n(dl \" computlib/me/src/index.me 444 0 33 1673 2445266074 7441 .nr _0 \n(c. .\" @(#)index.me 2.6 12/10/80 .\" %beginstrip% .de (x \" *** begin index entry .\" please note these cases MUST be in this order .ie !"\\n(.z"" \ \{\ . ev 2 \" if in a diversion, save & process later \!\\!.(x \\$1 .\} .el \ \{\ . ds |X x . if \\n(.$ \ . ds |X \\$1 . am %\\*(|X )x . sp \\n(xsu .\} .. .de )x \" *** end index entry .ie "\\n(.z"" \ \{\ . ds |x \\n% . if \\n(.$ \ . ds |x \\$1 . if "\\*(|x"_" \ . ig .. . am %\\*(|X .. . if \w"\\$2">(\\n(.l-\\n(.i-\\n(.k) \ . ti +\\n(xuu \\\\a\\\\t\\$2\\*(|x ... . rm |x . rm |X .\} .el \ \{\ \!\\!.)x \\$1 \\$2 . br \" if in a diversion, save & process later . ev .\} .. .de xp \" *** print the index .br .@C 2 .ls 1 .vs \\n(.su*\\n($Ru .fi .ds |X x .if \\n(.$ \ . ds |X \\$1 .xl -(\\n(xuu+\w'...'u) .di |x .%\\*(|X .br .di .rm %\\*(|X .xl \\n($lu .rm |X .ev .nf .in 0 .ta \\n(.lu-\\n(xuuR \\n(.luR .|x .fi .in .rm |x .. .if \n(xu<=0 \ . nr xu 0.5i \" index undent .nr c. \n(_0 %\\*(|X .. . if \w"\\$2">(\\n(.l-\\n(.i-\\n(.k) \ . ti +\\n(xuu \\\lib/me/src/install 744 0 33 1126 2426636320 7366 # if ($#argv < 1) then echo 'Usage: install <-me file list>' exit endif echo stripping and installing $* foreach i ($*) echo ${i}: ed $i << 'EOF' 1a %beginstrip% . g/%beginstrip%/d i .\" This version has had comments stripped; an unstripped version is available. . +,$g/[. ]\\".*/s/// g/[ ][ ]*$/s/// g/^$/d g/\\n@/d w _mac_temp_ q 'EOF' if ($i == tmac.e) then if (-d /usr/lib/tmac) then cp _mac_temp_ /usr/lib/tmac/tmac.e else cp _mac_temp_ /usr/lib/tmac.e endif else cp _mac_temp_ /usr/lib/me/$i endif rm _mac_temp_ end cp revisions /usr/lib/me/revisions echo "Done" exit ng and installing $* foreach i ($*) echo ${i}: ed $i << 'EOF' 1a %beginstrip% . g/%beginstrip%/d i .\" This version has had comments stripped; an unstripped version is available. . +,$g/[. ]\\".*/s/// g/[ ][ ]*$/s/// g/^$/d g/\\n@/d w _mac_temp_ q 'EOF' if ($i == tmac.e) then if (-d /usr/lib/tmac) then cp _mac_temp_ /usr/lib/tmac/tmac.e else cp _mac_temp_ /usr/lib/tmac.e endif else cp _mac_temp_ /usr/lilib/me/src/install.csh 755 0 33 1003 2426636320 10136 # if ($#argv < 1) then echo 'Usage: install <-me file list>' exit endif echo stripping and installing $* foreach i ($*) echo ${1}: ed $i << 'EOF' 1a %beginstrip% . g/%beginstrip%/d i .\" This version has had comments stripped; an unstripped version is available. . +,$g/[. ]\\".*/s/// g/[ ][ ]*$/s/// g/^$/d g/\\n@/d w _mac_temp_ q 'EOF' if ($i == tmac.e) then cp _mac_temp_ /usr/lib/tmac.e else cp _mac_temp_ /usr/lib/me/$i endif rm _mac_temp_ end cp revisions /usr/lib/me/revisions echo "Done" exit f ($#argv < 1) then echo 'Usage: install <-me file list>' exit endif echo stripping and installing $* foreach i ($*) echo ${1}: ed $i << 'EOF' 1a %beginstrip% . g/%beginstrip%/d i .\" This version has had comments stripped; an unstripped version is available. . +,$g/[. ]\\".*/s/// g/[ ][ ]*$/s/// g/^$/d g/\\n@/d w _mac_temp_ q 'EOF' if ($i == tmac.e) then cp _mac_temp_ /usr/lib/tmac.e else cp _mac_temp_ /usr/lib/me/$i endif rm _mac_temp_ end cp revisions /usr/lib/me/revisions echo "Done" ex((lib/me/src/local.me 444 0 33 572 2426636316 7400 .nr _0 \n(c. .\" this file may contain local macros, which are initialized with .\" the ".lo" request. All macros and number registers in this file .\" should be named ".*X", where X is any letter (upper or lower case) .\" or digit, to avoid naming conflicts. .\" .\" @(#)local.me 2.1 8/18/80 .\" %beginstrip% . \" *** insert new definitions before this line *** .nr c. \n(_0 temp_ /usr/lib/tmac.e else cp _mac_temp/,5h /,"lib/me/src/null.me 444 0 33 310 2426636316 7246 .\" @(#)null.me 2.1 8/18/80 .\" %beginstrip% .\" This file should be null -- it is called when tmac.e is sourced .\" for the second... time. Of course, you could give an error .\" message..... .cc . pper or lower case) .\" or digit, to avoid naming conflicts. .\" .\" @(#)local.me 2.1 8/18/80 .\" %beginstrip% . \" *** insert new definitions before this line *** .nr c. \n(_0 temp_ /usr/lib/tmac.e else cp _mac_temp/,5$h /,"lib/me/src/revisions 644 0 33 10605 2426636320 7762 2.7 24 Sep 80 -- Fixed bug in 2.6 2.6 23 Sep 80 -- Fixed problem introduced by 2.2 which occured in footnotes and index entries in filled keeps 2.5 29 Aug 80 -- Changed umlaut to not be so tricky -- it seems to backfire. 2.4 25 Aug 80 -- Fixed bug in indices caused by 2.2. 2.3 20 Aug 80 -- Fixed bug in footnotes caused by 2.2. -- Changed temp file names that macros that do dynamic loading rename themselves to. For example, if you say '.TS ... .(f' when both of them have been used for the first time, the @T macro got used twice. 2.2 18 Aug 80 -- Suspended footnote & index processing until final output (so that they will work properly in keeps). 2.1 18 Aug 80 -- Release 2. No changes. Mod 28 18 Aug 80 -- If \nv is set on entry, handle .po differently (for vtroff). -- Allow ".nr fi 0". Mod 27 30 Jun 80 -- Put in a cludge to try to make multi-columned output work with wide floating keeps. Moves all wide keeps to the top of the next real page. Mod 26 9 Nov 79 -- Fixed footnote bug that caused the first line of footnotes that were broken across a page to be indented. Mod 25 1 Oct 79 -- Fixed footnote bug that caused footnotes invoked at the top of pages to come out in bold font. -- Fixed equation bug that caused equations at the top of page to be improperly centered. Mod 24 27 Sep 79 -- Changed delimiter in all \w's to " from ', to allow for apostrophes in labels. -- Increased footnote fudge factor. -- Changed \x factor in \*[ & \*< to be one half previous value. Mod 23 24 Aug 79 -- Changed .ip to start new line if the tag is too long for the space provided. Mod 22 11 Jul 79 -- Changed .ac to handle new paper (with second parameter == "*"). Mod 21 24 Apr 79 -- Changed \*[ and \*< to use \x -- to avoid line overlap. Mod 20 6 Apr 79 -- Changed 12-pitch DTC terminals to still space 1/6 inch (instead of 1/8 inch), unless the 'x' register is non-zero -- do-able with the -rx1 option on the nroff command line. Mod 19 28 Mar 79 -- Had .ep do a .rs, to avoid occasional problems (like with .+c (again). -- Added the 'X' register: if non-zero on startup on a 12-pitch terminal, it outputs 6 LPI instead of 8 LPI. Mod 18 26 Mar 79 -- Had .+c reset indent, to solve problems of prelim material after a .ip (as with references) Mod 17 19 Mar 79 -- Fixed a bug in .++ which caused it to renumber pages incorrectly, the result of nroff starting a new page immediately upon reaching the end of the previous page (damn!). Mod 16 8 Mar 79 -- Fixed a bug in .++ which caused it to change page number formats before forcing out the page. -- Changed tmac.e so that extra '.so's to the package will next to 'null.me'. -- Changed .sh so that a title of "_" will cause section depth change side-effects only (base indent will remain the same, and no output will occur). Mod 15a 7 Mar 79 -- Fixed a bug in Mod 15 which caused .ip's to fail. Mod 15 2 Mar 79 -- Changed .@p to do paragraph indents normally in keeps, which will override the indent parameter in keeps with paragraph forms in them (use .ba to fix this). Mod 14 23 Feb 79 -- Fixed .ip so it would hyphenate correctly. Mod 13 16 Feb 79 -- Added .rs before eqn title output to fix vertical centering problem. Mod 12 15 Feb 79 -- Changed NROFF bold font to be regular .ul (.cu is a pain). -- Changed .sh to output regular spaces instead of unpaddable spaces. -- Fixed bug in .1c with bad line length (didn't reset \n($l). Mod 11 13 Feb 79 -- Added hook to .$c to call .$C (for index entries or whatever). Mod 10 12 Feb 79 -- Had .xp print in current environment and not reset to single spacing, to allow more control over output format. Mod 9 26 Dec 78 -- Fixed yet another problem with equation spacing. Mod 8 18 Dec 78 -- Fixed .@q to solve a problem with \n(dn getting lost on equations at top of page. Mod 7 11 Dec 78 -- Had .@q (equation output) move to end of equation after equation output (eqn doesn't seem to space quite right). Mod 6 27 Nov 78 -- Fixed the umlaut on DTC output to be prettier. Mod 5 5 Nov 78 -- Fixed a bug with the second parameter to .ip. Mod 4 2 Nov 78 -- Added .uh command (unnumbered heading). -- Changed .$p and .sh accordingly. Mod 3 2 Oct 78 -- Fixed .ne command in .$p (print section headings). Mod 2 25 Sep 78 -- Changed .np to use () instead of []. Mod 1 12 Sep 78 -- Fixed footnote fudge factor (curse NROFF!!) -- Put "needs" on .(z, .)z. Mod 0 11 Sep 78 output (eqn doesn't seem to space quite right). Mod 6 27 Nov 78 -- Fixed the umlaut on DTC output to be prettier. Mod 5 lib/me/src/sh.me 444 0 33 3257 2426636316 6743 .nr _0 \n(c. .\" @(#)sh.me 2.1 8/18/80 .\" %beginstrip% .de sh \" *** section heading .if (\\n(si>0)&(\\n(si<1n) \ . nr si \\n(sin .ce 0 .@d "\\$1" +1 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 .if !"\\$2"_" \ \{\ . ds |x \&\\$2 . $p "\\*(|x" "\\*($n" \\n($0 . $0 "\\*(|x" "\\*($n" \\n($0 . rm |x .\} .nr $p 0 1 \" reset .np count .. .de @d \" --- change section depth .if !""\\$1" \ . nr $0 \\$1 .if \\n($0&(\\n(.$>1) \ . nr $\\n($0 \\$2 .ds $n \&\" .ie \\n($0>=1 \ \{\ . if \\n($1=0 \ . nr $1 1 . if (\\n(.$>=3) .if !"\\$3"-" \ . nr $1 \\$3 . as $n \\n($1 .\} .el \ . nr $1 0 .ie \\n($0>=2 \ \{\ . if \\n($2=0 \ . nr $2 1 . if (\\n(.$>=4) .if !"\\$4"-" \ . nr $2 \\$4 . as $n .\\n($2 .\} .el \ . nr $2 0 .ie \\n($0>=3 \ \{\ . if \\n($3=0 \ . nr $3 1 . if (\\n(.$>=5) .if !"\\$5"-" \ . nr $3 \\$5 . as $n .\\n($3 .\} .el \ . nr $3 0 .ie \\n($0>=4 \ \{\ . if \\n($4=0 \ . nr $4 1 . if (\\n(.$>=6) .if !"\\$6"-" \ . nr $4 \\$6 . as $n .\\n($4 .\} .el \ . nr $4 0 .ie \\n($0>=5 \ \{\ . if \\n($5=0 \ . nr $5 1 . if (\\n(.$>=7) .if !"\\$7"-" \ . nr $5 \\$7 . as $n .\\n($5 .\} .el \ . nr $5 0 .ie \\n($0>=6 \ \{\ . if \\n($6=0 \ . nr $6 1 . if (\\n(.$>=8) .if !"\\$8"-" \ . nr $6 \\$8 . as $n .\\n($6 .\} .el \ . nr $6 0 .. .de sx \" *** heading up, no increment (2.1.1 -> 2.1) .ce 0 .ul 0 .nr _0 \\n($0-1 .if \\n(.$ .nr _0 +1 .if \\n(.$ .nr _0 \\$1 .@d \\n(_0 .rr _0 .$p "" "" \\n($0 .nr $p 0 1 \" reset .np count .. .de uh \" *** unnumbered section heading .$p "\\$1" .$0 "\\$1" .. .if \n(sf<=0 \ . nr sf 8 \" section font -- Times Bold .if \n(sp<=0 \ . nr sp 10 \" section title pointsize .if \n(ss<=0 \ . nr ss 12p \" section prespacing .if \n(si<=0 \ . nr si 0 \" section indent .nr c. \n(_0 ($6 .\} .el \ . nr $6 0 .. .de sx \" *** heading up, no increment (2.1.1 -> 2.1) .ce 0 .ul 0 .nr _0 \\n($0-1 .if \\n(.$ .nr _0 +1 .if \\n(.$ .nr _0 \\$1 .@d \\n(_0 .rr _0 .$p "" "" \\n($0 .nr $p 0 1 \" reset .np count .. .de uh \" *** unnumbered section heading .$p "\\$1" .$0 "\\$1" .. .if \n(sf<=0 \ . nr sf 8 \" section font -lib/me/src/tbl.me 444 0 33 2006 2426636317 7102 ((.nr _0 \n(c. .\" @(#)tbl.me 2.1 8/18/80 .\" %beginstrip% .de TS \" *** table start .sp \\n(bsu .@C 1 .if "\\$1"H" \ \{\ . di |h \" save header part . nr ?T 1 .\} .ls 1 .ch @f -(\\n(_bu+1v) \" set pseudo-trap for bottom line .. .de TH \" *** end header part of table .nr T. 0 .T# 0 .di .nr _i \\n(.i .in 0 .|h \" put in the initial header .in \\n(_iu .rr _i .mk #T .. .de TE \" *** table end .nr ?T 0 .ch @f -\\n(_bu \" reset pseudo-trap .ev .sp \\n(bsu+\\n(.Lv-1v .re .rr 31 .rr 32 .rr 33 .rr 34 .rr 35 .rr 36 .rr 37 .rr 38 .rr 39 .rr 40 .rr 41 .rr 42 .rr 43 .rr 44 .rr 45 .rr 46 .rr 47 .rr 48 .rr 49 .rr 50 .rr 51 .rr 52 .rr 53 .rr 54 .rr 55 .rr 56 .rr 57 .rr 58 .rr 59 .rr 60 .rr 61 .rr 62 .rr 63 .rr 64 .rr 65 .rr 66 .rr 67 .rr 68 .rr 69 .rr 70 .rr 71 .rr 72 .rr 73 .rr 74 .rr 75 .rr 76 .rr 77 .rr 78 .rr 79 .rr 80 .rr 81 .rr 82 .rr 83 .rr 84 .rr 85 .rr 86 .rr 87 .rr 88 .rr 89 .rr 90 .rr 91 .rr 92 .rr 93 .rr 94 .rr 95 .rr 96 .rr 97 .rr 98 .rr 99 .rr #I .rr #T .rr #a .rr ## .rr #- .rr #^ .rr T. .. .nr c. \n(_0 rr 36 .rr 37 .rr 38 .rr 39 .rr 40 .rr 41 .rr 42 .rr 43 .rr 44 .rr 45 .rr 46 .rr 47 .rr 48 .rr 49 .rr 50 .rr 51 .rr 52 .rr 53 .rr 54 .rr 55 .rr 56 .rr 57 .rr 58 .rr 59 .rr 60 .rr 61 .rr 62 .rr 63 .rr 64 .rr 65 .rr 66 .rr 67 .rr 68 .rr 69 .rr 70 .rr 71 .rr 72 .rr 73 .rr 74 .rr 75 .rr 76 .rr 77 .rr 78 .rr 79 .rr 80 .rr 81 .rr 82 .rr 83 .rr 84 .rr 85 .rr 86 .rr 87 .rr 88 .rr 89 .rr 90 .rr 91 .rr 92 .rr 93 .rr 94 .rr 95 .rr 96 .rr 97 .rr 98 .rr 99 .rr #I .rr #T .rr #a .rr ## .rr #- .rr #^ .rr T. .. .nr c. lib/me/src/test.accent 644 0 33 104 2426636320 10105 .sc .sp 4 .b e\\*'migre .sp 4 .b emigre\\*` .sp 4 .b e\\*'migre\\*` .rr 45 .rr 46 .rr 47 .rr 48 .rr 49 .rr 50 .rr 51 .rr 52 .rr 53 .rr 54 .rr 55 .rr 56 .rr 57 .rr 58 .rr 59 .rr 60 .rr 61 .rr 62 .rr 63 .rr 64 .rr 65 .rr 66 .rr 67 .rr 68 .rr 69 .rr 70 .rr 71 .rr 72 .rr 73 .rr 74 .rr 75 .rr 76 .rr 77 .rr 78 .rr 79 .rr 80 .rr 81 .rr 82 .rr 83 .rr 84 .rr 85 .rr 86 .rr 87 .rr 88 .rr 89 .rr 90 .rr 91 .rr 92 .rr 93 .rr 94 .r/,5dh /,"lib/me/src/test.umlaut 644 0 33 465 2426636321 10172 .sc .lp .ec $ umlaut is: $*: .ec .sp \w"umlau\*:t" .sp .XX "umlau\*:t" null .sp .de XX null .. .XX "umlau\\\\*:t" .br .XX "umlau\\*:t" .br .XX "umlau\*:t" .sp .de XX .ec ^ $1 = ^$1 .br $2 = ^$2 .ec .. .XX "umlau\*:t" .sp .de XX $1 = \\$1 .br $2 = \\$2 .. .XX "umlau\*:t" .sp .i "umlau\*:t" .sp .b "umlau\*:t" 79 .rr 80 .rr 81 .rr 82 .rr 83 .rr 84 .rr 85 .rr 86 .rr 87 .rr 88 .rr 89 .rr 90 .rr 91 .rr 92 .rr 93 .rr 94 .r/,5th /,"lib/me/src/thesis.me 444 0 33 1007 2426636317 7620 .nr _0 \n(c. .\" Setup for thesis. .\" This file should be modified to keep up with the standard .\" for a doctoral thesis at Berkeley. Other macros which may .\" be useful for a thesis are defined here. .\" @(#)thesis.me 2.1 8/18/80 .\" %beginstrip% .nr tf 1 \" set titles in Roman .he '''%' .if n .if \n(_o \ . po 1.5i .if t .po 1.125i \" + .5 inch (off 8i paper roll) = 1.5i .ll 5.75i \" allow 1/4 inch fudge .if n .if 1n=0.1i \ . ll 5.8i \" make it even character amount .m1 1i .nr ?t 1 .ls 2 .nr c. \n(_0 \n(c. .\" Setup for thesis. .\" This file should be modified to keep up with the standard .\" for a doctoral thesis at Berkeley. Other macros which may .\" be useful for a thesis are defined here. .\" @(#)thesis.me 2.1 8/18/80 .\" %beginstrip% .nr tf 1 \" set titles in Roman .he '''%' .if n .if \n(_o \ . po 1.5i .if t .po 1.125i \" + .5 inch (off 8i paper roll) = 1.5i .ll 5.75i \" allow 1/4 inch fudge .if n .if 1n=0.1i \ . ll 5.8i \" make it even character amount .m1 1i .nr ?t 1 .ls 2 .nr c.lib/me/src/tmac.e 444 0 33 45275 2445266071 7124 .nr _0 \n(.c .\"********************************************************************** .\"* * .\"* ****** - M E N R O F F / T R O F F M A C R O S ****** * .\"* * .\"* Produced for your edification and enjoyment by: * .\"* Eric Allman * .\"* Electronics Research Laboratory * .\"* U.C. Berkeley. * .\"* * .\"* VERSION 2.9 First Release: 11 Sept 1978 * .\"* See file \*(||/revisions for revision history * .\"* * .\"* Documentation is available. * .\"* * .\"********************************************************************** .\" .\" @(#)tmac.e 2.9 12/10/80 .\" %beginstrip% .\" .\" Code on .de commands: .\" *** a user interface macro. .\" &&& a user interface macro which is redefined .\" when used to be the real thing. .\" $$$ a macro which may be redefined by the user .\" to provide variant functions. .\" --- an internal macro. .\" .if !\n(.V .tm You are using the wrong version of NROFF/TROFF!! .if !\n(.V .tm This macro package works only on the version seven .if !\n(.V .tm release of NROFF and TROFF. .if !\n(.V .ex .if \n(pf \ . nx \*(||/null.me .\" *** INTERNAL GP MACROS *** .de @C \" --- change ev's, taking info with us .nr _S \\n(.s .nr _V \\n(.v .nr _F \\n(.f .nr _I \\n(.i .ev \\$1 .ps \\n(_Su .vs \\n(_Vu .ft \\n(_F 'in \\n(_Iu .xl \\n($lu .lt \\n($lu .rr _S .rr _V .rr _F .rr _I .ls 1 'ce 0 .. .de @D \" --- determine display type (Indent, Left, Center) .ds |p "\\$3 .nr _d \\$1 .ie "\\$2"C" \ . nr _d 1 .el .ie "\\$2"L" \ . nr _d 2 .el .ie "\\$2"I" \ . nr _d 3 .el .ie "\\$2"M" \ . nr _d 4 .el \ . ds |p "\\$2 .. .de @z \" --- end macro .if !"\\n(.z"" \ \{\ . tm Line \\n(c. -- Unclosed block, footnote, or other diversion (\\n(.z) . di . ex .\} .if \\n(?a \ . bp \" force out final table .rm bp .rm @b \" don't start another page .if t \ . wh -1p @m .br .. .de @I \" --- initialize processor .rm th .rm ac .rm lo .rm sc .rm @I .. .\" *** STANDARD HEADERS AND FOOTERS *** .de he \" *** define header .ie !\\n(.$ \ \{\ . rm |4 . rm |5 .\} .el \ \{\ . ds |4 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . ds |5 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .\} .. .de eh \" *** define even header .ie !\\n(.$ \ . rm |4 .el \ . ds |4 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. .de oh \" *** define odd header .ie !\\n(.$ \ . rm |5 .el \ . ds |5 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. .de fo \" *** define footer .ie !\\n(.$ \ \{\ . rm |6 . rm |7 .\} .el \ \{\ . ds |6 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . ds |7 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .\} .. .de ef \" *** define even foot .ie !\\n(.$ \ . rm |6 .el \ . ds |6 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. .de of \" *** define odd footer .ie !\\n(.$ \ . rm |7 .el \ . ds |7 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. .de ep \" *** end page (must always be followed by a .bp) .if \\n(nl>0 \ \{\ . wh 0 . rs . @b .\} .. .\" *** INTERNAL HEADER AND FOOTER MACROS *** .de @h \" --- header .if \n@>0 .tm >> @h %=\\n% ?a=\\n(?a ?b=\\n(?b ?w=\\n(?w .if (\\n(.i+\\n(.o)>=\\n(.l \ . tm Line \\n(c. -- Offset + indent exceeds line length .if t .if (\\n(.l+\\n(.o)>7.75i \ . tm Line \\n(c. -- Offset + line length exceeds paper width .\" initialize a pile of junk .nr ?h \\n(?H \" transfer "next page" to "this page" .rr ?H .nr ?c \\n(?C .rr ?C .rn |4 |0 .rn |5 |1 .rn |6 |2 .rn |7 |3 .nr _w 0 \" reset max footnote width .nr ?W 0 \" no wide floats this page (yet) .nr ?I 1 .\" begin actual header stuff .ev 2 .rs .if t .@m \" output cut mark .if \\n(hm>0 \ . sp |\\n(hmu \" move to header position .if \\n($T=2 \\!. .@t $h \" output header title .if \\n(tm<=0 \ . nr tm \n(.Vu .sp |\\n(tmu \" move to top of text .ev .mk _k \" for columned output .if \\n(?n .nm 1 \" restore line numbering if n1 mode .nr $c 1 \" set first column .if \n@>4 .tm -- @h >> .ns nl=\\n(nl %=\\n% _k=\\n(_k tm=\\n(tm .ie \\n(?s \ \{\ . rr ?s . rs ' @b .\} .el \ . @n \" begin the column .if \n@>1 .tm << @h .. .de @m \" --- output cut mark .@O 0 .lt 7.5i .tl '\(rn''\(rn' .@O .lt .. .de @n \" --- new column or page .if \n@>3 .tm >> @n nl=\\n(nl %=\\n% ?f=\\n(?f ?o=\\n(?o .if \\n(bm<=0 \ . nr bm \\n(.Vu .if (\\n(_w<=\\n($l)&(\\n(?W=0) \ \{\ . nr _b (\\n(ppu*\\n($ru)/2u \" compute fudge factor (must be < 1P) . if \\n(_bu>((\\n(bmu-\\n(fmu-(\\n(tpu*\\n($ru))/2u) \ . nr _b (\\n(ppu*\\n($ru)-\n(.Vu . nr _b +\\n(bmu .\} .nr _B \\n(_bu .ch @f .wh -\\n(_bu @f .nr ?f 0 \" reset footnote flag .if \\n(?o \ \{\ . (f _ \" reprocess footnotes which run off page . nf . |o ((. fi . )f . rm |o .\} .nr ?o 0 .if \\n(?T \ \{\ . nr _i \\n(.i . in \\n($iu . |h \" output the table header . in \\n(_iu . rr _i . mk #T \" for tbl commands . ns .\} .if (\\n(?a)&((\\n($c<2):(\\n(?w=0)) \ \{\ . nr ?a 0 \" output floating keep . @k |t . if \\n(?w \ . mk _k \" don't overstrike wide keeps . nr ?w 0 .\} .os .$H \" special column header macro .ns .. .de @f \" --- footer .if \n@>0 .tm >> @f %=\\n% nl=\\n(nl ?a=\\n(?a ?b=\\n(?b .ec .if \\n(?T \ \{\ . nr T. 1 \" for tbl commands (to output bottom line) . T# 1 \" output the sides and bottom lines . br .\} .ev 2 .ce 0 .if \\n(?b \ \{\ . nr ?b 0 . @k |b \" output bottom of page tables .\} .if \\n(?f \ . @o \" output footnote if present .ie \\n($c<\\n($m \ . @c \" handle new column .el \ . @e \" new page .ev .if \n@>2 .tm << @f .. .de @o \" --- output footnote .nf .ls 1 .in 0 .wh -\\n(_Bu @r .|f .fi .if \\n(?o \ . di \" just in case triggered @r . if \\n(dn=0 \ \{\ . rm |o . nr ?o 0 . \} . nr dn \\n(_D . rr _D .\} .rm |f .ch @r .. .de @c \" --- new column .if \n@>2 .tm >> @c %=\\n% .rs .sp |\\n(_ku .@O +\\n($lu+\\n($su .nr $c +1 .@n .. .de @e \" --- end page .if \n@>2 .tm >> @e .@O \\n(_ou .rs .sp |\\n(.pu-\\n(fmu-(\\n(tpu*\\n($ru) \" move to footer position .@t $f \" output footer title .nr ?h 0 .bp .. .de @t \" --- output header or footer title .if !\\n(?h \ \{\ . sz \\n(tp \" set header/footer type fonts, etc. . @F \\n(tf . lt \\n(_Lu \" make title span entire page . nf . \\$1 . br .\} .. .de $h \" $$$ print header .rm |z .if !\\n(?c \ \{\ . if e .ds |z "\\*(|0 . if o .ds |z "\\*(|1 .\} .if !\(ts\\*(|z\(ts\(ts \ ' tl \\*(|z .rm |z .. .de $f \" $$$ print footer .rm |z .if \\n(?c \ \{\ . if e .ds |z "\\*(|0 . if o .ds |z "\\*(|1 .\} .if \(ts\\*(|z\(ts\(ts \ \{\ . if e .ds |z "\\*(|2 . if o .ds |z "\\*(|3 .\} .if !\(ts\\*(|z\(ts\(ts \ ' tl \\*(|z .rm |z .. .de @r \" --- reprocess overflow footnotes .if \n@>3 .tm >> @r .z=\\n(.z ?f=\\n(?f ?a=\\n(?a ?b=\\n(?b _b=\\n(_b .di |o \" save overflow footnote .nr ?o 1 .nr _D \\n(dn .ns .. .\" *** COMMANDS WITH VARIANT DEFINITIONS *** .rn bp @b \" --- begin page .de bp \" *** begin new page (overrides columns) .nr $c \\n($m \" force new page, not new column .ie \\n(nl>0 \ . @b \\$1 .el \ \{\ . if \\n(.$>0 \ . pn \\$1 . if \\n(?I \ . @h \" 'spring' the header trap .\} .br .wh 0 @h \" reset header .. .rn ll xl \" *** special line length (local) .de ll \" *** line length (global to environments) .xl \\$1 .lt \\$1 .nr $l \\n(.l .if (\\n($m<=1):(\\n($l>\\n(_L) \ . nr _L \\n(.l .. .rn po @O \" --- local page offset .de po \" *** page offset .@O \\$1 .nr _o \\n(.o .. .\" *** MISCELLANEOUS ROFF COMMANDS *** .de hx \" *** suppress headers and footers next page .nr ?H 1 .. .de ix \" *** indent, no break 'in \\$1 .. .de bl \" *** contiguous blank lines .br .ne \\$1 .rs .sp \\$1 .. .de n1 \" *** line numbering 1 .nm 1 .xl -\w'0000'u .nr ?n 1 .. .de n2 \" *** line numbering 2 .nm \\$1 .ie \\n(.$ \ . xl -\w'0000'u .el \ . xl \\n($lu .. .de pa \" *** new page .bp \\$1 .. .de ro \" *** roman page numbers .af % i .. .de ar \" *** arabic page numbers .af % 1 .. .de m1 \" *** position one space .nr _0 \\n(hmu .nr hm \\$1v .nr tm +\\n(hmu-\\n(_0u .rr _0 .. .de m2 \" *** position two space .nr tm \\n(hmu+\\n(tpp+\\$1v .. .de m3 \" *** position three space .nr bm \\n(fmu+\\n(tpp+\\$1v .. .de m4 \" *** position four space .nr _0 \\n(fmu .nr fm \\$1v .nr bm +\\n(fmu-\\n(_0u .. .de sk \" *** leave a blank page (next page) .if \\n(.$>0 \ . tm Line \\n(c. -- I cannot skip multiple pages .nr ?s 1 .. .\" *** MISCELLANEOUS USER SUPPORT COMMANDS *** .de re \" *** reset tabs (TROFF defines 15 stops default) .ta 0.5i +0.5i +0.5i +0.5i +0.5i +0.5i +0.5i +0.5i +0.5i +0.5i +0.5i +0.5i +0.5i +0.5i +0.5i .. .if t .ig .de re \" *** reset tabs (NROFF version) .ta 0.8i +0.8i +0.8i +0.8i +0.8i +0.8i +0.8i +0.8i +0.8i +0.8i +0.8i +0.8i +0.8i +0.8i +0.8i .. .de ba \" *** set base indent .ie \\n(.$ \ . nr $i \\$1n .el \ . nr $i \\n(siu*\\n($0u .. .de hl \" *** draw horizontal line .br \l'\\n(.lu-\\n(.iu' .sp .. .\" *** PARAGRAPHING *** .de pp \" *** paragraph .lp \\n(piu .. .de lp \" *** left aligned paragraph .@p .if \\n(.$ \ . ti +\\$1 .nr $p 0 1 .. .de ip \" *** indented paragraph w/ optional tag .if (\\n(ii>0)&(\\n(ii<1n) \ . nr ii \\n(iin .nr _0 \\n(ii .if \\n(.$>1 \ . nr _0 \\$2n .@p \\n(_0u .if \\w"\\$1" \ \{\ . ti -\\n(_0u . ie \\w"\\$1">=\\n(_0 \ \{\ \&\\$1 . br . \} . el \&\\$1\h'|\\n(_0u'\c .\} .rr _0 .. .de np \" *** numbered paragraph .nr $p +1 .ip (\\n($p) .. .de @p \" --- initialize for paragraph .@I \" initialize macro processor .if "\\n(.z"|e" .tm Line \\n(c. -- Unmatched continued equation .in \\n($iu+\\n(pou .if \\n(.$ \ . in +\\$1n .ce 0 .fi .@F \\n(pf .sz \\n(ppu .sp \\n(psu .ne \\n(.Lv+\\n(.Vu .ns .. .\" *** SECTION HEADINGS *** .de sh \" &&& section heading .rn sh @T .so \\*(||/sh.me .sh "\\$1" "\\$2" \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 .rm @T .. .de $p \" $$$ print section heading .if (\\n(si>0)&(\\n(.$>2) \ . nr $i \\$3*\\n(si .in \\n($iu .ie !"\\$1\\$2"" \ \{\ . sp \\n(ssu \" one of them is non-null . ne \\n(.Lv+\\n(.Vu+\\n(psu+(\\n(spu*\\n($ru*\\n(.Lu) . ie \\n(.$>2 \ . ti -(\\n(siu-\\n(sou) . el \ . ti +\\n(sou . @F \\n(sf . sz \\n(spu . if \\$3>0 \ . $\\$3 . if \w"\\$2">0 \\$2. . if \w"\\$1">0 \\$1\f1\ \ \" .\} .el \ . sp \\n(psu .@F \\n(pf .sz \\n(ppu .. .de uh \" *** unnumbered section heading .rn uh @T .so \\*(||/sh.me .uh "\\$1" .rm @T .. .\" *** COLUMNNED OUTPUT *** .de 2c \" *** double columned output .br .if \\n($m>1 \ . 1c \" revert to 1c if already 2c .nr $c 1 .nr $m 2 .if \\n(.$>1 \ . nr $m \\$2 .if \\n(.$>0 \ . nr $s \\$1n \" param 1: column seperation .nr $l (\\n(.l-((\\n($m-1)*\\n($s))/\\n($m .xl \\n($lu .mk _k .ns .. .de 1c \" *** single columned output .br .nr $c 1 .nr $m 1 .ll \\n(_Lu \" return to normal output .sp |\\n(.hu .@O \\n(_ou .. .de bc \" *** begin column .sp 24i .. .\" *** FLOATING TABLES AND NONFLOATING BLOCKS *** .de (z \" &&& begin floating keep .rn (z @V .so \\*(||/float.me .(z \\$1 \\$2 .rm @V .. .de )z \" &&& end floating keep .tm Line \\n(c. -- unmatched .)z .. .de (t \" XXX temp ref to (z .(z \\$1 \\$2 .. .de )t \" XXX temp ref to )t .)z \\$1 \\$2 .. .de (b \" *** begin block .br .@D 3 \\$1 \\$2 .sp \\n(bsu .@( .. .de )b \" *** end block .br .@) .if (\\n(bt=0):(\\n(.t<\\n(bt) \ . ne \\n(dnu \" make it all on one page .ls 1 .nf .|k .ec .fi .in 0 .xl \\n($lu .ev .rm |k .sp \\n(bsu+\\n(.Lv-1v .. .de @( \" --- begin keep .if !"\\n(.z"" .tm Line \\n(c. -- Illegal nested keep \\n(.z .@M .di |k \!'rs .. .de @M \" --- set modes for display .nr ?k 1 .@C 1 .@F \\n(df .vs \\n(.su*\\n($Ru .nf .if "\\*(|p"F" \ . fi \" set fill mode if "F" parameter .if \\n(_d=4 \ . in 0 .if \\n(_d=3 \ \{\ . in +\\n(biu . xl -\\n(biu .\} .if \\n(_d=1 \ . ce 10000 .. .de @) \" --- end keep .br .if !"\\n(.z"|k" .tm Line \\n(c. -- Close of a keep which has never been opened .nr ?k 0 .di .in 0 .ce 0 .. .de (c \" *** begin block centered text .if "\\n(.z"|c" .tm Line \\n(c. -- Nested .(c requests .di |c .. .de )c \" *** end block centered text .if !"\\n(.z"|c" .tm Line \\n(c. -- Unmatched .)c .br \" force out final line .di .if \n@>4 .tm >> .)c .l=\\n(.l .i=\\n(.i $i=\\n($i dl=\\n(dl .ev 1 .ls 1 .in (\\n(.lu-\\n(.iu-\\n(dlu)/2u .if \n@>4 .tm -- .)c << .in .l=\\n(.l .i=\\n(.i dl=\\n(dl .nf .|c .ec .in .ls .ev .rm |c .. .\" *** BLOCK QUOTES (OR WHATEVER) AND LISTS *** .de (q \" *** begin block quote .br .@C 1 .fi .sp \\n(qsu .in +\\n(qiu .xl -\\n(qiu .sz \\n(qp .. .de )q \" *** end block quote .br .ev .sp \\n(qsu+\\n(.Lv-1v .nr ?k 0 .. .de (l \" *** begin list .br .sp \\n(bsu .@D 3 \\$1 \\$2 .@M .. .de )l \" *** end list .br .ev .sp \\n(bsu+\\n(.Lv-1v .nr ?k 0 .. .\" *** PREPROCESSOR SUPPORT *** .de EQ \" &&& begin equation .rn EQ @T .so \\*(||/eqn.me .EQ \\$1 \\$2 .rm @T .. .de TS \" &&& begin table .rn TS @W .so \\*(||/tbl.me .TS \\$1 \\$2 .rm @W .. .\" *** FONT AIDS *** .de sz \" *** set point size and vertical spacing .ps \\$1 .vs \\n(.su*\\n($ru \" default vs at pointsize + 20% .bd S B \\n(.su/3u .. .de r \" *** enter roman font .nr _F \\n(.f .ul 0 .ft 1 .if \\n(.$ \&\\$1\f\\n(_F\\$2 .rr _F .. .de i \" *** enter italic .nr _F \\n(.f .ul 0 .ft 2 .if \\n(.$ \&\\$1\f\\n(_F\\$2 .rr _F .. .de b \" *** enter boldface (underline in NROFF) .nr _F \\n(.f .ul 0 .ie t \ . ft 3 .el \ . ul 10000 .if \\n(.$ \&\\$1\f\\n(_F\\$2 .if \\n(.$ \ . ul 0 .rr _F .. .de rb \" *** enter real boldface (not underlined in NROFF) .nr _F \\n(.f .ul 0 .ft 3 .if \\n(.$ \&\\$1\f\\n(_F\\$2 .rr _F .. .de u \" *** enter underlined word \&\\$1\l'|0\(ul'\\$2 .. .de q \" *** enter quoted word \&\\*(lq\\$1\\*(rq\\$2 .. .de bi \" *** enter word in bold italics .ft 2 .ie t \&\k~\\$1\h'|\\n~u+(\\n(.su/3u)'\\$1\fP\\$2 .el \&\\$1\fP\\$2 .. .de bx \" *** enter boxed word .ie \\n($T \&\f2\\$1\fP\\$2 .el \k~\(br\|\\$1\|\(br\l'|\\n~u\(rn'\l'|\\n~u\(ul'\^\\$2 .. .de @F \" --- change font (8 -> underlined, 0 -> no change) .nr ~ \\$1 .if \\n~>0 \ \{\ . ul 0 . ie \\n~>4 \ \{\ . if n .ul 10000 . if t .ft 3 . \} . el \ . ft \\n~ .\} .rr ~ .. .\" *** FOOTNOTING *** .de (f \" &&& begin footnote .rn (f @U .so \\*(||/footnote.me .(f \\$1 \\$2 .rm @U .. .de )f \" &&& end footnote .tm Line \\n(c. -- unmatched .)f .. .de $s \" $$$ footnote separator \l'2i' .if n \ . sp 0.3 .. .\" *** DELAYED TEXT *** .de (d \" &&& begin delayed text .rn (d @U .so \\*(||/deltext.me .(d \\$1 \\$2 .rm @U .. .de )d \" &&& end delayed text .tm Line \\n(c. -- unmatched .)d .. .\" *** INDEXES (TABLE OF CONTENTS) *** .de (x \" &&& begin index .rn (x @U .so \\*(||/index.me .(x \\$1 \\$2 .rm @U .. .de )x \" &&& end index entry .tm Line \\n(c. -- unmatched .)x .. .\" *** STUFF FOR "STANDARD" PAPERS *** .de th \" *** set "thesis" mode .so \\*(||/thesis.me .rm th .. .de +c \" *** begin chapter .ep \" force out footnotes .if \\n(?o:\\n(?a \ \{\ . bp \" force out a table or more footnote . rs . ep .\} .nr ?C 1 .nr $f 1 1 .ds * \\*[1\\*]\k* .if \\n(?R \ . pn 1 .bp .in \\n($iu \" reset the indent .rs .ie \\n(.$ \ ((. $c "\\$1" .el \ . sp 3 .. .de ++ \" *** declare chapter type .nr _0 0 .if "\\$1"C" \ . nr _0 1 \" chapter .if "\\$1"RC" \ . nr _0 11 \" renumbered chapter .if "\\$1"A" \ . nr _0 2 \" appendix .if "\\$1"RA" \ . nr _0 12 \" renumbered appendix .if "\\$1"P" \ . nr _0 3 \" preliminary material .if "\\$1"B" \ . nr _0 4 \" bibliographic material .if "\\$1"AB" \ . nr _0 5 \" abstract .if \\n(_0=0 \ . tm Line \\n(c. -- Bad mode to .++ .nr ?R 0 .if \\n(_0>10 \ .\{ . nr ?R 1 . nr _0 -10 .\} .nr ch 0 1 .if (\\n(_0=3):(\\n(_0=5) \ . pn 1 \" must do before .ep .ep \" end page for correct page number types .if \\n(_0=1 \ \{\ . af ch 1 . af % 1 .\} .if \\n(_0=2 \ \{\ . af ch A . af % 1 .\} .if \\n(_0=3 \ . af % i .if \\n(_0=4 \ . af % 1 .if \\n(_0=5 \ . af % 1 .if \\n(.$>1 \ . he \\$2 .if !\\n(_0=\\n(_M .if \\n(_M=3 \ . pn 1 .nr _M \\n(_0 .rr _0 .. .de $c \" $$$ print chapter title .sz 12 .ft B .ce 1000 .if \\n(_M<3 \ . nr ch +1 .ie \\n(_M=1 CHAPTER\ \ \\n(ch .el .if \\n(_M=2 APPENDIX\ \ \\n(ch .if \w"\\$1" .sp 3-\\n(.L .if \w"\\$1" \\$1 .if (\\n(_M<3):(\w"\\$1") \ . sp 4-\\n(.L .ce 0 .ft .sz .ie \\n(_M=1 \ . $C Chapter \\n(ch "\\$1" .el .if \\n(_M=2 \ . $C Appendix \\n(ch "\\$1" .. .de tp \" *** title page .hx .bp .br .rs .pn \\n% .. .de ac \" *** setup for ACM photo-ready paper .rn ac @T .so \\*(||/acm.me .ac "\\$1" "\\$2" .rm @T .. .de lo \" *** pull in the set of local macros .\" all these macros should be named "*X", where X is any letter .so \\*(||/local.me .rm lo .. .\" *** DATES *** .if \n(mo=1 .ds mo January .if \n(mo=2 .ds mo February .if \n(mo=3 .ds mo March .if \n(mo=4 .ds mo April .if \n(mo=5 .ds mo May .if \n(mo=6 .ds mo June .if \n(mo=7 .ds mo July .if \n(mo=8 .ds mo August .if \n(mo=9 .ds mo September .if \n(mo=10 .ds mo October .if \n(mo=11 .ds mo November .if \n(mo=12 .ds mo December .if \n(dw=1 .ds dw Sunday .if \n(dw=2 .ds dw Monday .if \n(dw=3 .ds dw Tuesday .if \n(dw=4 .ds dw Wednesday .if \n(dw=5 .ds dw Thursday .if \n(dw=6 .ds dw Friday .if \n(dw=7 .ds dw Saturday .ds td \*(mo \n(dy, 19\n(yr .\" *** PARAMETRIC INITIALIZATIONS *** .if (1m<0.1i)&(\nx!=0) \ . vs 9p \" for 12-pitch DTC terminals .rr x .nr $r \n(.v/\n(.s \" ratio of vs to ps for .sz request .nr $R \n($r \" ratio for displays & footnotes .nr hm 4v \" header margin .nr tm 7v \" top margin .nr bm 6v \" bottom margin .nr fm 3v \" footer margin .nr tf 3 \" title font: (real) Times Bold .nr tp 10 \" title point size .hy 14 .nr bi 4n \" indent for blocks .nr pi 5n \" indent for paragraphs .nr pf 1 \" normal text font .nr pp 10 \" normal text point size .nr qi 4n \" indent for quotes .nr qp -1 \" down one point .nr ii 5n \" indent for .ip's and .np's .nr $m 1 \" max number of columns .nr $s 4n \" column separation .ds || /usr/lib/me .if \n@>0 .ds || . .bd S B 3 .\" *** OTHER INITIALIZATION *** .ds [ \u\x'-0.25v' .ds ] \d .ds < \d\x'0.25v' .ds > \u .ds - -- .if t \ \{\ . ds [ \v'-0.4m'\x'-0.2m'\s-3 . ds ] \s0\v'0.4m' . ds < \v'0.4m'\x'0.2m'\s-3 . ds > \s0\v'-0.4m' . ds - \- . nr fi 0.3i .\} .if n \ \{\ . nr fi 3n .\} .nr _o \n(.o .if n .po 1i .if \n(.V=1v \ . nr $T 2 .if \n(.T=0 \ . nr $T 1 .if t \ \{\ . nr $T 0 . po -0.5i \" make ugly line on LHS .\} .if \nv \ . po 1i \" for vtroff .if \n($T \ \{\ . if \n($T=1 \ . po 0 . ds [ [ . ds ] ] . ds < < . ds > > .\} .nr ps 0.5v \" paragraph pre/post spacing .if \n($T \ . nr ps 1v .if t .nr ps 0.35v .nr bs \n(ps \" block pre/post spacing .nr qs \n(ps \" quote pre/post spacing .nr zs 1v \" float-block pre/postspacing .nr xs 0.2v \" index prespacing .nr fs 0.2v \" footnote prespacing .if \n($T \ . nr fs 0 .if n .nr es 1v \" equation pre/postspacing .if t .nr es 0.5v .wh 0 @h \" set header .nr $l \n(.lu \" line length .nr _L \n(.lu \" line length of page .nr $c 1 \" current column number .nr $f 1 1 \" footnote number .ds * \*[1\*]\k*\" \" footnote "name" .nr $d 1 1 \" delayed text number .ds # [1]\k#\" \" delayed text "name" .nr _M 1 \" chapter mode is chapter .ds lq \&"\" \" left quote .ds rq \&"\" \" right quote .if t \ . ds lq `` .if t \ . ds rq '' .em @z .\" *** FOREIGN LETTERS AND SPECIAL CHARACTERS *** .de sc \" *** define special characters .so \\*(||/chars.me .rm sc .. .ll 6.0i .lt 6.0i ength .nr _L \n(.lu \" line length of page .nr $c 1 \" current column number .nr $f 1 1 \" footnote number .ds * \*[1\*]\k*\" \" footnote "name" .nr $d 1 1 \" delayed text number .ds # [1]\k#\" \" delayed text "name" .nr _M 1 \" chapter mode is chapter .ds lq \&"\" \" left quote .ds rq \&"\" \" right quotlib/me/tbl.me 644 0 33 1612 2400260073 6277 .nr _0 \n(c. .\" @(#)tbl.me 2.1 8/18/80 .\" This version has had comments stripped; an unstripped version is available. .de TS .sp \\n(bsu .@C 1 .if "\\$1"H" \ \{\ . di |h . nr ?T 1 .\} .ls 1 .ch @f -(\\n(_bu+1v) .. .de TH .nr T. 0 .T# 0 .di .nr _i \\n(.i .in 0 .|h .in \\n(_iu .rr _i .mk #T .. .de TE .nr ?T 0 .ch @f -\\n(_bu .ev .sp \\n(bsu+\\n(.Lv-1v .re .rr 31 .rr 32 .rr 33 .rr 34 .rr 35 .rr 36 .rr 37 .rr 38 .rr 39 .rr 40 .rr 41 .rr 42 .rr 43 .rr 44 .rr 45 .rr 46 .rr 47 .rr 48 .rr 49 .rr 50 .rr 51 .rr 52 .rr 53 .rr 54 .rr 55 .rr 56 .rr 57 .rr 58 .rr 59 .rr 60 .rr 61 .rr 62 .rr 63 .rr 64 .rr 65 .rr 66 .rr 67 .rr 68 .rr 69 .rr 70 .rr 71 .rr 72 .rr 73 .rr 74 .rr 75 .rr 76 .rr 77 .rr 78 .rr 79 .rr 80 .rr 81 .rr 82 .rr 83 .rr 84 .rr 85 .rr 86 .rr 87 .rr 88 .rr 89 .rr 90 .rr 91 .rr 92 .rr 93 .rr 94 .rr 95 .rr 96 .rr 97 .rr 98 .rr 99 .rr #I .rr #T .rr #a .rr ## .rr #- .rr #^ .rr T. .. .nr c. \n(_0 rr 36 .rr 37 .rr 38 .rr 39 .rr 40 .rr 41 .rr 42 .rr 43 .rr 44 .rr 45 .rr 46 .rr 47 .rr 48 .rr 49 .rr 50 .rr 51 .rr 52 lib/me/thesis.me 644 0 33 707 2400260074 7002 .nr _0 \n(c. .\" Setup for thesis. .\" This file should be modified to keep up with the standard .\" for a doctoral thesis at Berkeley. Other macros which may .\" be useful for a thesis are defined here. .\" @(#)thesis.me 2.1 8/18/80 .\" This version has had comments stripped; an unstripped version is available. .nr tf 1 .he '''%' .if n .if \n(_o \ . po 1.5i .if t .po 1.125i .ll 5.75i .if n .if 1n=0.1i \ . ll 5.8i .m1 1i .nr ?t 1 .ls 2 .nr c. \n(_0 Th /\@,\D"lib/refer/ 775 0 33 0 2532141151 5613 lib/refer/inv 755 0 33 36000 2532141135 6441 0^Юn PPՀPpPP/ P(`^2ԭԭ͜͠d/"P /P/PP`ЬPРP`-1ЬPРPPPaP,,],,,5i,,,,K,c,,,,,V׬ЬP~Pԭ͜(ЬPݠ;(PЬPݠ.w ЬPРPu ЬPР͠׬1oѬ ЬPРP.PPp(p  (pͨ'p'z.p'm. '`.ͨ'S.'\P=.Yխ1f͈͌͌͐̈́ P̀1̈́&&͈P(ݏN--1 &͈&-`---D-`---ݏR--o1| &̀(ݏT--<1I %͈%--6 P~%ЭP̈́A- PP(ݏ]-^-0 f%ԭխ1b-  PtqPD-͸n((;-͸ PP͸ - --pc PݭݭPݭx$ԭխ ,P,PPͨ Pխխ, PPdݭݭݭ/ݭP͘/#͠ ͠P%ݭ#խ1x(P|xP̀M,+|̀(ݏzr,H,6/C #xRݏ{o,E,/ #(`F,DDխjP0,ͤͤ,DDwͤ͸`+DbDK+v P+pa P+ L P͔hdݭݭݭݭݭQ"#խ͸#ͤ#͔͘͜ha+ ^ԭԭԭݬ 2P1c ݬ լ1ݭ +9PPݬ ݭ*Pݬ Pݬ=׼ Ь PРQ֠ a ݬ \P`  լ*$1n*D*a,n!~P5ݭP@ǬPQĬQQP~*ݬ1P@ V  BPP+ݭǬPQĬQQP~)ݬ׼ЬPРQ֠aP ݬPP  PPPݬݏP1ѭPPPݬ @P֬׬ ^ԭЭPЬ@֭  ֬야֬  ЭP ^լ (ݬ ߭ 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[ZZZjPPj ^Ь[ [[PPݬNPZ((Z[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP]@j ~\S^\ PЬPЬPЬRRQ{RPPR PRPPЭRBQPPbPbլQP]P/crp/tmp/crp/tmp/usr/tmpCan't read input %sIndex.ia.ib.ic.idjunk%diAssertion failed: file %s, line %d inv1.c/bin/sortsort-T-o/usr/bin/sortsort-T-oAssertion failed: file %s, line %d inv1.cAssertion failed: file %s, line %d inv1.c/dev/nullwwAssertion failed: file %s, line %d inv1.crjunk%djwCan't get scratch file %srawwpfork %o pwait %o status %d Assertion failed: file %s, line %d inv1.cAssertion failed: file %s, line %d inv1.csort -T %s %s -o %sjunk%dkmv %s %ssort -T %s -m %s %s -o %srww%ld key occurrences, %d hashes, %d docs ;%ld,%dAssertion failed: file %s, line %d inv2.c%04d %06ld %04d %06ld No old pointersChanging hash value to old %d %04d %06ld Assertion failed: file %s, line %d inv6.cAssertion failed: file %s, line %d inv6.c%d %ldError:   AAAAAABBBBBB /bin/shsh-c995=lib/refer/hunt 755 0 33 50000 2552601266 6627 D|^Юn PPՀPpPPC P=h^@ЬPРP`-1ЬPРPPPl11^PT^1'PF41 PC1׬׬ЬPР@ЬPРP~PCCЬPРP~P+C׬ЬPРJ׬ЬPРqJѠ>РB׬1a׬ЬPРFJ1K׬ЬPݠ6#PB1,D1#ЬP~#PxB1 ~B1PP1PgPa11Pi1(1Ps1. Pr11Po11Pt1/1ЬPݠEP߭<A߭*[;P1j߭[|<߭8n<8_<߭Q<A߭%<A8<A<}A;\A'Z:{Z:rZ:AA߭"PLZP߭%A;A8R"PZA:"PZ@YP8@:Y/ P@@!PN@Y"Y$zY,@$@PP?PP,YPa$PͼP(ݏ5@ @aE 9LPeFP(ݏ!@?!E}9X'F#PPPPP F1`DeX>PFfA,>@D,X P.AK1P*T?E9PP@D09PPE͸fݸ+E TEݸEE>(ݏhE@ Ch3͸͸m@ >,AW= =PPPDdPPP1^Ь֭ / ׭ѭ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XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYjP ~P  BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[I1xݏ{PZZ  YYX ZYYXZYZ~(PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP [ [[[  Ь[Z = 8[ePZ~Y((PZ ݫ ԫ kZP{ Ь[ЬZkPkPzQQPPP^߭ݬxPPPЬ[ЬZ[Y[YPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6HЬ[ѬP ѫѫk֫k׫ЫP`P P.h_d_~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZb [d_PTYPƏPxP;bPZx(PZPPZx~@PZZZPZPxPZPPjjd_1xYP[PZkk[P Ь[[ZZZqjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j8 ~\S^\ P ЬPЬPЬRRQ{RPPR PRPPЭRBQPPbPbլQPP.ia.ib.ic.idrNo files %srrIndex incomplete %srAssertion failed: file %s, line %d hunt1.cAssertion failed: file %s, line %d hunt1.c /Assertion failed: file %s, line %d hunt2.citem %s hash %d hfreq %d Assertion failed: file %s, line %d hunt2.cAssertion failed: file %s, line %d hunt2.cAssertion failed: file %s, line %d hunt2.cAssertion failed: file %s, line %d hunt2.cAssertion failed: file %s, line %d hunt2.cAssertion failed: file %s, line %d hunt2.cAssertion failed: file %s, line %d hunt3.c%s%s/%s%s/%s fgrep-r-n-i%ld,%dLK%ld,%ldrrAssertion failed: file %s, line %d hunt7.cAssertion failed: file %s, line %d hunt7.cWarning: index predates file '%s' /usr/lib/refer/mkey %s >%s.ig.ig.ig.igrMissing expected file %sdelivCan't run %sCan't get space for machinesbad fgrep call wordlist too large .ig/tmp/rj%dgfgrepCan't read fgrep index %sCan't write fgrep output %srcan't read fgrep output %sError:   AAAAAABBBBBB /bin/shsh-c\Y\YJ|_lib/refer/mkey 755 0 33 22000 2532141150 6602 '^Юn PPՀPpPP P$^,Ѭ1ЬPРP`-ЬPРPPPc3**Q**]*k********H׬ЬPР׬DЬPР,ЬPР:ЬP~PPЬP~PYЬP~P1h1_,~,P$0($ݏ0PW00P(P0k}Ѭ_B_jѭ8ЭP@ݭHP(Pݭݭ(֭^$$$$$$#1ݬ P#1##### #Gݬq#{##-)P" `1k )1YX#O#=#7#6#.#6ݬ׼ЬPРQ֠aP ݬz PP")P `} ݬ8^ݬ PP:PѭѬ .ݬXmPЬP`P@ЬP`1đ9ѭݬJPP,^40,Pݬݏ8P18; P,8%8.94,#4lP8ݬ,06 8 0P!1k0ݬݬ1ЬP`0PPЬ[[k[k kЬPGPЬQA`6PЬQA`&!P P1 1  ݬ P1 @#ao e ݬP;ݬJ)P ` $  Ь  ݬ^PP@ԭFݭ@(P:@9@*@P@`֭ѭXݭ^ݬWǏPQďQQPЭP@0լ Ь@0PЭP@0ݬPPP^ԭ#ŭPPQxQQQQxQPPP֬խЭPέPVݬݬC62P+ ` #"^ЬP֬`ЬP֬ЭQ`PQPQPխPPЬ[kPP[P[kP^ݬݬPĬݬsP[P[Z~PYԊY[PݬЬ[ЬZ!jЪP֪X``P ZX6 PYXYP^ռԼЬP Dμ[[ЬP ՠ PQá[ЬP~`PPЭPЬP P[ݬ \~ݬЬP PPЬ[ZYk94 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ݬxPP`P`P@Βݬ晴oxtԭxPﶾP`P`P@xPP`Px`P8P.xPPxQsQaQaQA﹓QxQQQ`Pѭ`(ݭݬE`߼s֭1m qvԭyﺼ~sݭݬ`~ݭݬ`i~gQZs֭xPP`P`Pѭ@1gxPxP`PՠݬxPaP`PݠK^ԭ$׼ЬPРQ֠ a ݬ o֭ѭ^PЬЭPЬЭP^լ ݬЬ ЭPРЭPՠݬЭQPЬPլЬPՠ ݠݬլPЬPՠмP^ԭЬ ֭ЭPРխЭP^ЬݽxtЭPРխﲺqլqqլkxPӻP`P`P@xP︻P`Px`P8P.xPPxQQaQaQA֐QxQQQ`PѬ`F qqxPNPxQBQaQaQA֏QxQQQ`Pլ/ﹹppլxPP`P`PѬ@#}pwpxPPxQﴺQaQaQìAHQQxQQQ`PxPP`P`լ ЬP@PѬ P poxPDP QxQQQ`P^xP$P`P`ѭ2ѭ,ѭ&ѭ ѭooxPٹP`PxPŹP`P`.xPﱹP`P`@Io:oxPP`PxPoP`P`.xP[P`P`nnxP-P`PxPP`P`BxPP`P`.xPP`P`ڐnznxPøP`PxPﯸP`P`.xPP`P`+4n%nxPnPQxQQQ`P ^K9dx~3܆P"﯆ЭЬP@戴x~ xQQPaԭЭPxηQϷQxPPaP`֭ѭx﬷PﭷP`PЬ`ЬP@uxPP`P`P@ЌxkPlP`Px`P8P4xLPMPx=Q>QaQaQAQxQQQ`PЬ`P^ԭ)ЬPЭQЬRQSA`CbЬPЭQA`QP֭ѭ 8ݬH^ԭЭP@ݬPЭP֭ѭ P^ԭЬPЭQA`P֭ЬPЭQЬRQSA`CbPЬPP >hv0 9PPAZ둬a葬z~P~PPP(/ PP^ԭЬPЭQЬRQSA`Cb֭ѭ ݬ ݬݬЬPЬ QA`^լPԭ֭ЬPЭQA`QP ^ݬPݬPPPP~9Pݬݭvݬo~vЭP^BPִ`\PصǵB若Pוּq`P^ݬPP~PP'PЬЭЬAխw全iiݭݭPн׭ЭPРѭխWbki\iЭPѬAѬZ PЬP^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ЭP@PP ЭP@ѭѭP֭ѭ1'LtsP1խP^xBw~P﷬x,w~P𤋮xw~Pԭ/xP{P`xPpP`xPeP`֭ѭv^ԭnxP;P`VxP"P`A燎\_xPP`ﵢYۣ֭ѭHvx;v~︫=﫫x v~參"xv~y^լ.7Y(YuuPPխЭԭ9xPP`<ѭu2PxuPQpuQQP֭xPP`ѭJucxP飯PЬ`ЭP^ݬPxPPP`xPtP`xPcP`ԼxPNP`xP>PЬ`^ݬP1xPP`C~~~LbXݬ~WǡxP←PнЬЭխЭxPP`xPP`ѭ1S ^ݬPxPPSP`xPBP`ݬ1լ3xP"PнսݬxPPP`ЭxPP`xPԨP`լ&ݬHxPPﶨPxQ直Q`aݬ"xQQPaլ ݬ^ݬPxPP]P`xPRP`xP<P`ﴠﮠ猪易xr~$P)bjPP. sPPٟӟޟ؟ϟԟ֟ݟߟޟ￟ﶟǟ゚pja[^PP^>*$#ԭ߭߭qP都JPQA`^PP#PpP@.xP`pP@xP`PP& P[PSspP@wP`;[pP@wP`2PS_oP@JwP`P1dPЭQA` "PЭQA` ϞPЭQA` ゙PЭQ~A`֭ѭP" P ٤פP ĤƤﵤPﬤ瘝ݬѬ ЬPPP{P ^ЬP@q%Ѭ@qmyQQݬݬPլ ݬPԭLЭP@PݭPЭP@ݭݭPЭP@֭ѭЬP@oFլ  xPP`Pﭜ؛PxQlQaQPЭPݬլ ݬݬ$^Y Px~Px~Pԭ$yPЭQA`~gPЭQ A`֭ѭP PPխݭ`լѬЭP`ЭQPaЭP`խЭPPЭQPЭPԠݭݭPPPPխЭPPЭQPaЭP`ЬPP222222+832Ku%22222լѬݭPЭխݭP լ խլx~ݭx~ݭk1,wNլwNЬPP222222_W2gwo22222O9SfwhNլ1PPPP1Ѭ6jݭݭݬPD>40ݭݭݬP լ19ݭ;.PݭP_1ݭP1ݭݭ!PPPחPPݭP𧻓PݭPHݭ P71S2RլMPP@IPֽP PPP1ݭݭPլPPPլPPPPլ^PݭPﻖP|PݭP~ݭP1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ZjxYP[PZPxYP[PP[1[Zk[[ZZB [ PBYPƏPxPgBbPZxTBPZPPZxDB~@PZZZ!BBPZP BxBPZPPjjA A1xYP[PAZAAAkAAk[P Ь[[ZZZAjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@@jl0~\S^\_Q0PH0CЬ30PЬPЬRRQ{RPPR PRPPP98Pxdebug1wbuild: structure: output: ,alloc out of space total space alloc'ed = %D %d more bytes requested failed assertion in routine chfree: p : alloc out of spacespace = %D %d more bytes requested routine beginning on line %d: error %s %s %s struct error: [  468:<>@BDFHJ$(,048<@DHLPmultiple input files - using first one: no input filercan't open input file:invalid switch:invalid switch:%diaemhptcsdbnprgraph(): %d %s:%d failed assertion in routine prgraph: UNDEFINED <= ARC(v,i) && ARC(v,i) < nodenum %d %s: %d { } %d, ŸȟΟ՟ܟfailed assertion in routine arc: DEFINED(v) failed assertion in routine arc: 0 <= i && i < ARCNUM(v) failed assertion in routine lchild: DEFINED(v) failed assertion in routine lchild: 0 <= i && i < childper[NTYPE(v)] failed assertion in routine vxpart: (NTYPE(v) == type) && (0 <= j) && (j < nonarcs[type] - FIXED) failed assertion in routine expres: ty == COMPVX || ty == ASGOVX || ty == ASVX || ty == SWCHVX || ty == ICASVX failed assertion in routine negpart: NTYPE(v) == IFVX || NTYPE(v) == ACASVX failed assertion in routine predic: NTYPE(v) == IFVX || NTYPE(v) == ACASVX failed assertion in routine level: NTYPE(v) == GOVX || NTYPE(v) == BRKVX || NTYPE(v) == NXTVX failed assertion in routine stlfmt: NTYPE(v) == STLNVX || NTYPE(v) == FMTVX STLNVXIFVXDOVXIOVXFMTVXCOMPVXASVXASGOVXLOOPVXWHIVXUNTVXITERVXTHENVXSTOPVXRETVXDUMVXGOVXBRKVXNXTVXSWCHVXACASVXICASVXstring too long to be copied at given address: %s%sfailed assertion in routine addum: ls failed assertion in routine addum: !ls ^~ ,Vlabel without code - ignored:line shorter than 5 charactersline unexpectedly longin disk seekdec.rat: unbuf size exceededin syntax: line %d: label beginning %D too long %s treating line as straight line code in parsing: assigned goto must have list of labelserror: symbol '%c' should not occur as %d'th symbol of: %s parsing parsing line %d in parsing:line %d of file, parser in invalid statetreating it as straight line code in syntax:between lines %d and %d of file symbol '%c' does not match entries for state %d treating it as straight line code in syntax; label used but does not appear as statement label:%D failed assertion in routine hash: x >= 0L hash table overflow - too many labelsin syntax: attempt to redefine value of label %D between lines %d and %d line %d; bufcount: %d failed assertion in routine makenode: arcsper[type] < 0 || arcnum == arcsper[type] illegal do range, between lines %d and %d in parsing: do loops nested deeper than allowed > 0 == 0 < 0 < 0 == 0line %d: if() returnstopcontinueuncond. gotocomp. gotoass. goto, labslabel assignmentsimple statementarith ifdo format stIOVX statement entry statement %s %d $&*,.248;=AJMQSUWY[]_acfilrtvxz|~  $*/37<@DGIKMOQSUWY[]_acdeg_____idgarwclsepfb_o_t_o___(____,_(__,)_____,)_,____fn_(_()_=garpws___,__,_o_n_t_i_n_u_e__o__u_____=__(),__s_s_i_g_n____t_o___e_at_ld_f_uo_n_c_t_i_o_n_t_e_g_e_r_o_mn_p_l_e_x_b_l_e_p_r_e_c_i_s_i_o_n_o_g_i_c_a_l_tu_o_p_b_r_o_t_i_n_e_e_t_u_r_n_n_dt__r_y_r_m_a_t_(_r_i_t_e_(_(___,_(),__e,)_nr)_d)_=)__,)_r)_=)_ru_i_n_t_n_c_h_l_o_c_k_d_a_t_a____oooLoozoH{ooo|oooLo}oo-ooooooooooooooo=oo>?@ooooooooLooooLoooooooooooooooooooooooooooooooooooooooo^oooooooooooo,ooooooooooXoooooooo>MFoKoooIoooJooo((oLoooLooooooooo!&/p?QWf3  :&/pW "#E#$$%%%%%%'()*+,,-..01c2u34k56789;<=>2@ABCD2FGHIJKLMNOP2RSTUV2XZY[\]^_`bcdeghijlmnoqrstwwvvwwwxyxwz}w{w|w|xw~w|wuunode %d unreachable : unreachable statements - will be ignoredfailed assertion in routine addloop: NTYPE(adj) == LOOPVX failed assertion in routine addloop: NTYPE(ARC(v,j)) == ITERVX failed assertion in routine getdom: ntoaft[ls->elt] < i failed assertion in routine comdom: u != UNDEFINED && v != UNDEFINED failed assertion in routine loomem: NTYPE(y) == ITERVX gethead: getinarc: getdom: gettree: failed assertion in routine gettree: ARC(from,ELSE) == v failed assertion in routine gettree: 0 < ARCNUM(v) failed assertion in routine gettree: DEFINED(head[dom[v]]) failed assertion in routine gettree: DEFINED(head[u]) failed assertion in routine gettree: NTYPE(u) == ITERVX failed assertion in routine fixflow: i < ARCNUM(v) failed assertion in routine fixflow: DEFINED(z) failed assertion in routine fixloop: DEFINED(ARC(v,0)) failed assertion in routine fixloop: DEFINED(ARC(v,0)) failed assertion in routine getwh: NTYPE(v) == LOOPVX failed assertion in routine getwh: DEFINED(vchild) failed assertion in routine getwh: NTYPE(vchild) == ITERVX failed assertion in routine getun: NTYPE(v) == LOOPVX failed assertion in routine getun: DEFINED(vchild) failed assertion in routine getswitch: !DEFINED(RSIB(temp)) getreach: getflow: getthen: getloop: getbranch: failed assertion in routine mkthen: !DEFINED(w) || (DEFINED(tc) && BRANCHTYPE(NTYPE(tc)) ) failed assertion in routine mkthen: IFTHEN(v) failed assertion in routine negate: NTYPE(v) == IFVX failed assertion in routine compound: DEFINED(NXT(w)) #&%sndbrace: outrat: %sEND %s#following unreferenced format statement commented out %s#failed assertion in routine outrat: tabfirst %sgo to %d%s %sstop %sreturn failed assertion in routine outrat: LEVEL(v) == 1 %sbreak %sbreak %d%s failed assertion in routine outrat: LEVEL(v) == 1 %snext %snext %d%s %sgoto %s%s,%s(%d%s,%s)%s,%s%s %sassign %d%s to %s%s %sIF%sELSE failed assertion in routine outrat: DEFINED(w) failed assertion in routine outrat: DEFINED(NXT(v)) %scontinue %sDO %s%sREPEAT%sUNTILfailed assertion in routine outrat: DEFINED(ARC(v,0)) %s %sWHILEfailed assertion in routine outrat: DEFINED(ARC(v,0)) failed assertion in routine outrat: DEFINED(LPRED(ARC(v,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ݫ1kݫPݏ:ݫkݫPTݏdPTЫT1kݏk!kݫ+kݫ-kݫ*kݫ/kݫݏ^1skݫݏ|1ekݫ&1[kݫ>1Qkݫ<1GkݫݏD19kݫݏ41+kݫݏ51kݫݏ61kS1ݏ71ݏ91SP@S-)W!S2<@SH: 6xW tS'cW:ݏ,k)ݏ,118ݏ}1Qkݏ7o8 `U18 Gkݏ88k'1^Z&PЬ ЭPЬ ЬݬP~.&ЭQPݬP~ЭPݠݬЭPլ&ЬPݠЬPݠ ݬЬPݠ0'ݬ&'^լPԭЭPѼ@7ѭlѭfЬPѰ-\7ЬPР PݠP@ЬPР РPЬQР ݭnЬPРРPЬQРݭNլ1Ѽ!ЬPРP.ݭ>ѭ1ЭP@7ЬPݠ=&ЭP@73P~$ЬQPЭP@6P~ЬPݠЭP@6_Ѽ& Ѽ|0ЬPݠЬQPЬPݠ ЬQP ЬPѼ396ЬPݠVP!6}P~ЬPݠb61Ѽ3f]6ЬPݠPNЬPݠ1%>6,P~#ЬQP.6 P~ЬPݠ6Gݬ!6 Pd#ЬQP5P~ЬPݠ51Ѽ! ЬЬPРݭBݬ1ЬPݠFЬQP1^լݼPPCfѼPPPPG5(cfмPP>118P+11P&11P!XݭЬPݠjЬPݠݼ eݭЬPݠ Bխ4)e-ЬPݠݼseݭЬPݠݭЬPݠЬPݠݼ>eЬPݠM4(geЬPݠ *4(Bd1EP*1P/1xP-1P<1f1P41W&P| P^1P1 1P;1NP511PD11ݬݬЬPP>/]P,AP*)3P&P! PPPPPPPPPPP+P/P-P<P4!P| P^PP6 P51zPD1n^ԭ)ЬPЭQЬRQSA`CbЬPЭQA`QP֭ѭ ݬ~|2b ^ԭЬPЭQA`P֭ЬPЭQЬRQSA`CbP^լPԭ֭ЬPЭQA`QP^PPЭPP+qMau)00000DT\dlt| 0DC,IݭF1i 1sW P1r1bVU߭qFLU xPP~PЭ׭0ЭQЭRPBaЭPЭQA`" ֭ЭP"@֭ЭPЭQ"A`ЭRA`b֭ЭP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ying, output line %d, on input: \t \n $end %c malloc out of spacestruct bug: assertion 'token[i] != ' ' || tlen == 1' invalid in routine accumstruct bug: assertion 'bufind + tlen < xxmaxchars' invalid in routine accum error in beautifying, output line %d: %s %s %s nesting too deep, stack overflowstack exhausted, can't be popped as requestedyacc stack overflowsyntax error case default:switchend : ifelsewhilerepeat untildo=,, {} &|<>D465|&546>D<8H;H>HAHDHGHIHLH0.false..true..true..true..false..false..false.!!!(())string %s too long to be copied by str_copy at address %d ||&&>=<=!=>==<_ _*)***%*******************()*!&%#'$ "       !  %#"  C`EbFcGd12349:=5V58X786 ;<4U 7W:Y;Z<[=\He)D *E$@,I "'B(C*F,J+G-K ">.LB_Da +HIf  Jg KhLi " MjNk/M # "/0/N "/ORkQkUm "/PVn/Q/RWoYpQl $ $ $ $ $ $ $ $ $ $ & & & & & & & & & &OkZq[r\s_t au gviw jkOkkxlkny "pzq{ "r|s} / " u~w 'yz{ ( ) *~ + , - .?????????? 0 0&&&&&&&&&&&&&&&&&&&&0S0S0T0T0T0T0T0T0T0T0T0T&A&AA]A]A^A^A^A^A^A^A^A^A^A^STSTSTSTSTSTSTSTSTST]^]^]^]^]^]^]^]^]^]^tJIV|JdH|JlHJxHTGHDGHJHFHlNHJHNHOHJHJ|VHJHJHJHJHJHJIJIJIJIP IJ(I4Q0I|J8I|JHI|JLVJPI\JXVXI|J`I|JpVJhIJ|V|JpIQxIJJJJ,KJJKDLWIR|JI|JI|JIJJ|JIJJ|JIJ4KJLK|JI|JHWI|JItSKJ\KJJJ,LdMdKMtKKKDXdM|JYdLKS|JYIlMMM|JIMMTNDNT|J`ZIDO|JI4M|JI|JI|JI|JJ|JJlO|JJMMOtM|JJtN|J J$OON$O|J(JN|J0JLP|J8JlO4OO|J@J|JHJP|JPJdO|JXJ|J`J|JhJ|JpJUV "'(+(+(0000000000(aaaddaahaaaaaaaaaaaaaaaaaao %d>>=<<===!=!||&&bad switch yylook %dRATFOR beautifying; input backed up too far during lex: RATFOR beautifying; lex call of nunput with wrong char: RATFOR beautifying; buffer xxbuf too small for token beginning: ((  AAAAAABBBBBB ttP`ylib/tabset/ 775 0 33 0 2553122350 5775 lib/tabset/beehive 644 0 33 244 2111515674 7377                                                                                 3122350< a900000005775 /0 C. /\@,\D"lib/tabset/std 644 0 33 207 2234742353 6563 3 1 1 1 1 1 1 1 1 1 1 1 1 1               3122350< a900000005775 //( ,( 5h /\@,\D"lib/tabset/vt100 644 0 33 237 2306104206 6633  H H H H H H H H H H H H H H H H   3122350< a900000005775 //( ,( 5h /\@,\D"lib/tabset/teleray 644 0 33 71 2267055760 7422 GY9(FY90FY98FY9@FY9HFY9PFY9XFY9`FY9hF H H H H H H H H H H H   3122350< a900000005775 //( ,( 5h /\@,\D"lib/tabset/xerox1720 644 0 33 244 2224225415 7443 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3122350< a900000005775 //( ,( 5ĉh /\@,\D"lib/tabset/diablo 644 0 33 130 2404473605 7216  9 2 1 1 1 !1 )1 11 91 A1 I1 Q1 Y1 a1 i1 q1 y1 9 1 1 1 1 1 1 1 1 3122350< a900000005775 //( ,( 5ԉh /\@,\D"lib/tabset/3101 644 0 33 135 2405012363 6344 H 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 3122350< a900000005775 //( ,( 5h /\@,\D"lib/tabset/stdcrt 644 0 33 137 2454271227 7277 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3122350< a900000005775 //( ,( 5h /\@,\D"((lib/tabset/aa 600 0 33 151 2553122350 6331  1 1 1 1 1 1 1 1 1  1 1 1 1 1 1 3122350< a900000005775 //( ,( 5h /\@,\D"lib/term/ 775 0 33 0 2532147124 5465 lib/term/tab300 755 0 33 7233 2532146730 6476 ` (  !$'*-0369<?BEHKNQTWZ]`cfilorux{~ "&),/258<@DINQTWZ]`cfils| )49@COX[^er}   #(+.147:=@CFILORUX[   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-o+[]-_-fiflffffiffl''`_/ c(B|)/o<<-c,<n|O-ik\ġ''u,(/c,c`o-""o|o~t~~vo/x/-‚''uu|-Â`/--\O=/\[][]->--Yo[][]-‚'`O¡-->_<_=_-=~=/-><-|^=x/+_Uooo```\--/-,|'`'`+rOcO|c/**|O|||||||||||$(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|_t  $(,048<@DHLPTX\`lib/term/tab300S 755 0 33 7237 2532146740 6626 d (  !$'*-0369<?BEHKNQTWZ]`cfilorux{~  #(,/258;>BFJOTWZ]`cfilory $/:?FIU^adkx!&).147:=@CFILORUX[^a Hh  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-o+[]-_-fiflffffiffl''`_/ c(B|)/o<<-c,<n|O-ik\ġ''u,(/c,c`o-""o|o~t~~vo/x/-‚''uu|-Â`/--\O=/\[][]->--Yo[][]-‚'`O¡-->_<_=_-=~=/-><-|^=x/+_Uooo```\--/-,|'`'`+rOcO|c/**|O|||||||||||$(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`((dhlptx|_t  $(,048<@DHLPTX\`lib/term/tab300X 755 0 33 7233 2532146750 6630 ` (  !$'*-0369<?BEHKNQTWZ]`cfilorux{~ "&),/258<@DINQTWZ]`cfils| )49@COX[^er}   #(+.147:=@CFILORUX[   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-o+[]-_-fiflffffiffl''`_/ c(B|)/o<<-c,<n|O-ik\ġ''u,(/c,c`o-""o|o~t~~vo/x/-‚''uu|-Â`/--\O=/\[][]->--Yo[][]-‚'`O¡-->_<_=_-=~=/-><-|^=x/+_Uooo```\--/-,|'`'`+rOcO|c/**|O|||||||||||$(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|_t  $(,048<@DHLPTX\`lib/term/tab300s 755 0 33 7237 2532146762 6672 d (  !$'*-0369<?BEHKNQTWZ]`cfilorux{~  #(,/258;>BFJOTWZ]`cfilory $/:?FIU^adkx!&).147:=@CFILORUX[^a Hh  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-o+[]-_-fiflffffiffl''`_/ c(B|)/o<<-c,<n|O-ik\ġ''u,(/c,c`o-""o|o~t~~vo/x/-‚''uu|-Â`/--\O=/\[][]->--Yo[][]-‚'`O¡-->_<_=_-=~=/-><-|^=x/+_Uooo```\--/-,|'`'`+rOcO|c/**|O|||||||||||$(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|_t  $(,048<@DHLPTX\`lib/term/tab37 755 0 33 7033 2532146773 6432 (( (  "%(+.147:=@CFILORUX[^adgjmpsvy|  !$',169=AEJORUX[^adgjmrw| $),18=AEJMPSV[^adgjmqv{ 897 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-o+[]-_1/41/23/4-fiflffffiffl''`_/ AB\DSQNOikLM@XoJKYIvUxVCGWTEPRYFHZ>_<_=_-=~9~8=/-><-|^=x/+_Uoo][_^+8r98c9|c/**|O|||||||||||$(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|_t  $(,048<@DHLPTX\`dhlptx|lib/term/tab450 755 0 33 7243 2532147013 6500 h (  !$'*-0369<?BEHKNQTWZ]`cfilorux{~  #&+/258;>AEIMRWZ]`cfiloru|   '2=BILXadgn{$),147:=@CFILORUX[^ad44 DU 34  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-o+[]-_-fiflffffiffl''`_/ c(B|)/o<<-c,<n|O-ik\ġ''u,(/c,c`o-""o|o~t~~vo/x/-‚''uu|-Â`/--\O=/\[][]->--Yo[][]-‚'`O¡-->_<_=_-=~=/-><-|^=x/+_Uooo```\--/-,|'`'`+rOcO|c/**|O|||||||||||$(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|_t  $(,048<@DHLPTX\lib/term/tab450-12 755 0 33 7253 2532147003 6720 p (  !$'*-0369<?BEHKNQTWZ]`cfilorux{~  #&),158;>ADGKOSX]`cfilorux{&-8CHOR^gjmt "%*/27:=@CFILORUX[^adgj((4 4 DU 34  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-o+[]-_-fiflffffiffl''`_/ c(B|)/o<<-c,<n|O-ik\ġ''u,(/c,c`o-""o|o~t~~vo/x/-‚''uu|-Â`/--\O=/\[][]->--Yo[][]-‚'`O¡-->_<_=_-=~=/-><-|^=x/+_Uooo```\--/-,|'`'`+rOcO|c/**|O|||||||||||$(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|_t  $(,048<@DHLPTXlib/term/tab450X 755 0 33 7243 2532147023 6631 h (  !$'*-0369<?BEHKNQTWZ]`cfilorux{~  #&+/258;>AEIMRWZ]`cfiloru|   '2=BILXadgn{$),147:=@CFILORUX[^ad44 DU 34  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-o+[]-_-fiflffffiffl''`_/ c(B|)/o<<-c,<n|O-ik\ġ''u,(/c,c`o-""o|o~t~~vo/x/-‚''uu|-Â`/--\O=/\[][]->--Yo[][]-‚'`O¡-->_<_=_-=~=/-><-|^=x/+_Uooo```\--/-,|'`'`+rOcO|c/**|O|||||||||||$(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|_t  $(,048<@DHLPTX\lib/term/tabtn300 755 0 33 6647 2532147045 7050 l ((  "%(+.147:=@CFILORUX[^adgjmpsvy|  !$'*-159>CFILORUX[^acegikmoqtwy{}  !&+.369<?BEHKNQTWZ]`cf  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-o+[]-_-fiflffffiffl''`_/ ikovxY>_<_=_-=~=/-><-|^=x/+_Uoo+rOcO|c/**|O|||||||||||$(,048<@DHLPTX\`dhlptx|((  $(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|_tlib/term/tab450-12-8 755 0 33 7257 2532147034 7075 t    !$'*-0369<?BEHKNQTWZ]`cfilorux{~  #&),/27;>ADGJMQUY^cfilorux{~  ,3>INUXdmpsz"%(+058=@CFILORUX[^adgjmp4 4  DU 34  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-o+[]-_-fiflffffiffl''`_/ c(B|)/o<<-c,<n|O-ik\ġ''u,(/c,c`o-""o|o~t~~vo/x/-‚''uu|-Â`/--\O=/\[][]->--Yo[][]-‚'`O¡-->_<_=_-=~=/-><-|^=x/+_Uooo```\--/-,|'`'`+rOcO|c/**|O|||||||||||$(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|_t  $(,048<@DHLPTXlib/term/tabcrt 644 0 33 3214 2111461370 6745 l((  "%(+.147:=@CFILORUX[^adgjmpsvy|  !$'*-159>CFILORUX[^acegikmoqtwy{}  !&+.369<?BEHKNQTWZ]`cf  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-o+[]-_-fiflffffiffl''`_/ ikovxY>_<_=_-=~=/-><-|^=x/+_Uoo+rOcO|c/**|O|||||||||||JKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-o+[]-_-fiflffffiffl''`_/ ikovxY>_<_=_-=~=/-><-lib/term/tabdtc 755 0 33 15352 2111461367 6766 d F(  !$'*-0369<?BEHKNQTWZ]`cfilorux{~  #(,/258;>BFJOTWZ]`cfilory $/:?FIU^adkx!&).147:=@CFILORUX[^a(( Hh  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-o+[]-_-fiflffffiffl''`_/ c(B|)/o<<-c,<n|O-ik\ġ''u,(/c,c`o-""o|o~t~~vo/x/-‚''uu|-Â`/--\O=/\[][]->--Yo[][]-‚'`O¡-->_<_=_-=~=/-><-|^=x/+_Uooo```\--/-,|'`'`+rOcO|c/**|O|||||||||||$(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|_tL12L13L14L15L16L17L18L19L20L21L22L23L24L25L26L27L28L29 L30 L31L32L33L34L35L36L37!L38$L39'L40*L41-L420L433L446L459L46<L47?L48BL49EL50HL51KL52NL53QL54TL55WL56ZL57]L58`L59cL60fL61iL62lL63oL64rL65uL66xL67{L68~L69L70L71L72L73L74L75L76L77L78L79L80L81L82L83L84L85L86L87L88L89L90L91L92L93L94L95L96L97L98L99L100L101L102L103L104L105L106L107L108L109L110L111L112L113L114L115 L116L117L118L119L120L121L122 L123#L124(L125,L126/L1272L1285L1298L130;L131>L132BL133FL134JL135OL136TL137WL138ZL139]L140`L141cL142fL143iL144lL145oL146rL147yL148L149L150L151L152L153L154L155L156L157L158L159L160L161L162L163L164L165L166 L167L168L169L170$L171/L172:L173?L174FL175IL176UL177^L178aL179dL180kL181xL182L183L184L185L186L187L188L189L190L191L192L193L194L195L196L197L198L199L200L201L202L203L204L205L206L207L208L209L210L211L212L213L214L215L216!L217&L218)L219.L2201L2214L2227L223:L224=L225@L226CL227FL228IL229LL230OL231RL232UL233XL234[L235^L236aL205L206L207L208L209L210L211L212L213L214L215L216!L217&L218)L219.L2201L2214L222lib/term/tablpr 644 0 33 3214 2111461370 11750 1lib/term/tabcrtlib/term/tabx1700 755 0 33 7237 2532147055 6760 d (  #&),/258;>ADGJMPSVY\_behknqtwz}  "'+.147:=AEINSVY\_behknqx #.9>EHT]`cjw %(-0369<?BEHKNQTWZ]` DU 34  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-o+[]-_-fiflffffiffl''`_/ c(B|)/o<<-c,<n|O-ik\ġ''u,(/c,c`o-""o|o~t~~vo/x/-‚''uu|-Â`/--\O=/\[][]->--Yo[][]-‚'`O¡-->_<_=_-=~=/-><-|^=x/+_Uooo```\--/-,|'`'`+rOcO|c/**|O|||||||||||$(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`((dhlptx|  $(,048<@DHLPTX\`dhlptx|_t  $(,048<@DHLPTX\`lib/term/tabipsi12 644 0 33 2616 2120644606 7276 ~(   "%(+.147:=@CFILORUX[^adgjmpsvy|  !$'*-0369<AEHKNQTW[_chmpsvy| "'*6=HSX_bnwz}),/25:?BGJMPSVY\_behknqtwz4 4 DU 34  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-o+[]-_-fiflffffiffl''`_/ c(B|)/o<<-c,<n|O-ik\ġ''u,(/c,c`o-""o|o~t~~vo/x/-‚''uu|-Â`/--\O=/\[][]->--Yo[][]-‚'`O¡-->_<_=_-=~=/-><-|^=x/+_Uooo```\--/-,|'`'`+rOcO|c/**|O|||||||||||_/ c(B|)/o<<-c,<n|O-ik\ġ''u,(/c,clib/term/tabipsi 644 0 33 2610 2120644605 7124 x(  "%(+.147:=@CFILORUX[^adgjmpsvy|  !$'*-036;?BEHKNQUY]bgjmpsvy|!$07BMRY\hqtw~ #&),/49<ADGJMPSVY\_behknqt44 DU 34  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-o+[]-_-fiflffffiffl''`_/ c(B|)/o<<-c,<n|O-ik\ġ''u,(/c,c`o-""o|o~t~~vo/x/-‚''uu|-Â`/--\O=/\[][]->--Yo[][]-‚'`O¡-->_<_=_-=~=/-><-|^=x/+_Uooo```\--/-,|'`'`+rOcO|c/**|O|||||||||||_/ c(B|)/o<<-c,<n|O-ik\ġ''u,(/c,c`lib/tmac/ 775 0 33 0 2551543375 5453 lib/tmac/tmac.an 644 0 33 300 2114604551 6740 .de th .if t .so /usr/lib/tmac/tmac.an6t .if n .so /usr/lib/tmac/tmac.an6n .t1 "\\$1" "\\$2" "\\$3" .. .de TH .rn TH xx .so /usr/lib/tmac/tmac.an.new .TH "\\$1" "\\$2" "\\$3" "\\$4" .rm xx .. =00000005453><-|^=x/+_Uooo```\--/-,|'`'`+rOcO|c/**|O|||||||||||_  c /0 C. /\@,\D"lib/tmac/tmac.s 644 0 33 55303 2334447232 6666 .nr TN 0 .\" RT - reset everything to normal state .de RT .if !\\n(1T .BG .if !\\n(IK .if !\\n(IF .if !\\n(IX .if !\\n(BE .di .ce 0 .ul 0 .if \\n(NX<=1 .if \\n(AJ=0 .ll \\n(LLu .if \\n(IF=0 \{\ . ps \\n(PS . if \\n(VS>=40 .vs \\n(VSu . if \\n(VS<=39 .vs \\n(VSp\} .if \\n(IP .in -\\n(I\\n(IRu .if \\n(IP=0 .nr I0 \\n(PIu .if \\n(IP .nr IP -1 .if \\n(QP \{\ . ll +\\n(QIu . in -\\n(QIu . nr QP -1\} .ft 1 .bd 1 .ta 5n 10n 15n 20n 25n 30n 35n 40n 45n 50n 55n 60n 65n 70n 75n 80n .fi .. . \"IZ - initialization .de IZ .if \\n(FM=0 .nr FM 1i .nr YY -\\n(FMu .nr XX 0 1 .nr IP 0 .nr PI 5n .nr QI 5n .nr I0 \\n(PIu .nr PS 10 .nr VS 12 .if !\\n(PD .if n .nr PD 1v .if !\\n(PD .if t .nr PD 0.3v .nr ML 3v .ps \\n(PS .if \\n(VS>40 .vs \\n(VSu .if \\n(VS<=39 .vs \\n(VSp .nr IR 0 .nr TB 0 .nr SJ \\n(.j .nr LL 6i .ll \\n(LLu .nr LT \\n(.l .lt \\n(LTu .ev 1 .nr FL \\n(LLu*11u/12u .ll \\n(FLu .ps 8 .vs 10p .ev .if \\*(CH .ds CH "\(hy \\\\n(PN \(hy .if n .ds CF "\\*(DY .wh 0 NP .wh -\\n(FMu FO .ch FO 16i .wh -\\n(FMu FX .ch FO -\\n(FMu .wh -\\n(FMu/2u BT .. .de TM .if \\n(IM=0 .if \\n(MN=0 .pn 0 .so /usr/lib/tmac/tmac.scover .if \\n(IM=0 .if \\n(MN=0 .rm IM .if \\n(IM=0 .if \\n(MN=0 .rm MF .if \\n(IM=0 .if \\n(MN=0 .rm MR .if \\n(.T=0 .pi /usr/bin/col .nr ST 1 .ds QF MEMORANDUM FOR FILE .br .ds MN \\$1 .if !"\\$1"" .nr MM 1 .if !"\\$2"" .nr MC 1 .if !"\\$3"" .nr MG 1 .nr TN 1 .if \\n(.$-1 .ds CA \\$2 .if \\n(.$-2 .ds CC \\$3 .rm RP .rm S0 .rm S2 .rm AX .. . \" IM - internal memorandum .de IM .nr IM 1 .TM "\\$1" "\\$2" "\\$3" .rm QF .RA .rm RA .rm RP .rm MF .rm MR .. . \" MF - memorandum for file. .de MF .nr MN 1 .TM "\\$1" "\\$2" "\\$3" .rm MR .rm IM .RA .rm RA .rm RP .rm TM .. . \" MR - memo for record .de MR .nr MN 2 .TM "\\$1" "\\$2" "\\$3" .ds QF MEMORANDUM FOR RECORD .rm MF .RA .rm RA .rm RP .rm IM .rm TM .. .de EG .nr MN 3 .TM "\\$1" "\\$2" "\\$3" .ds QF ENGINEER'S NOTES .rm MF .rm RP .rm IM .RA .rm RA .rm TM .. .de OK .br .di .di OD .. .de RP .nr ST 2 .pn 0 .rm SG .rm CS .rm TM .rm QF .rm IM .rm MR .rm MF .rm EG .br .. .de TR \" Comp. Sci. Tech Rept series. .nr ST 3 .pn 0 .ds MN \\$1 .rm SG .rm CS .rm TM .rm QF .rm IM .rm MR .rm MF .rm EG .br .. . \"TL - title and initialization .de TL .br .nr TV 1 .if \\n(IM>0 .rm CS .if \\n(MN>0 .rm CS .ME .rm ME .di WT .nr SJ \\n(.j .na .fi .ll 5.0i .if n .if \\n(TN .ll 30 .if t .if \\n(TN .ll 3.5i .ft 3 .ps 10 .if !\\n(TN .ps 12 .if !\\n(TN .rm CS .hy 0 .. .de TX .rs .sp .5i .ce 1000 .if n .ul 1000 .ps 12 .ft 3 .vs 15p .ne 4 .hy 0 .WT .hy 14 .ce 0 .ul 0 .. . \" AU - author(s) .de AU .nr AV 1 .ad \\n(SJ .br .di .br .nf .nr NA +1 .ds R\\n(NA \\$1 .ds E\\n(NA \\$2 .di A\\n(NA .ll \\n(LLu .if \\n(TN=0 .if t .ft 2 .if \\n(TN=0 .if n .ft 1 .if \\n(TN>0 .ft 3 .if \\n(TN .if n .ll 16 .if \\n(TN .if t .ll 1.4i .ps 10 .. .de AX .ft 1 .rs .ce 1000 .if n .ul 0 .ps 10 .vs 12p .if n .sp 2 .if t .sp .A1 .if n .sp .if t .sp 0.5 .ns .I1 .if \\n(NA-1 .if n .sp 2 .if \\n(NA-1 .if t .sp .A2 .if \\n(NA-1 .if n .sp .if \\n(NA-1 .if t .sp 0.5 .ns .I2 .if \\n(NA-2 .if t .sp .if \\n(NA-2 .if n .sp 2 .A3 .if \\n(NA((-2 .if t .sp 0.5 .if \\n(NA-2 .if n .sp .ns .I3 .if \\n(NA-3 .if t .sp .if \\n(NA-3 .if n .sp 2 .A4 .if \\n(NA-3 .if t .sp 0.5 .if \\n(NA-3 .if n .sp .ns .I4 .if \\n(NA-4 .if t .sp .if \\n(NA-4 .if n .sp 2 .A5 .if \\n(NA-4 .if n .sp .if \\n(NA-4 .if t .sp 0.5 .ns .I5 .if \\n(NA-5 .if t .sp .if \\n(NA-5 .if n .sp 2 .A6 .if \\n(NA-5 .if n .sp .if \\n(NA-5 .if t .sp 0.5 .ns .I6 .if \\n(NA-6 .if t .sp .if \\n(NA-6 .if n .sp 2 .A7 .if \\n(NA-6 .if n .sp .if \\n(NA-6 .if t .sp 0.5 .ns .I7 .if \\n(NA-7 .if t .sp .if \\n(NA-7 .if n .sp 2 .A8 .if \\n(NA-7 .if n .sp .if \\n(NA-7 .if t .sp 0.5 .ns .I8 .if \\n(NA-8 .if t .sp .if \\n(NA-8 .if n .sp 2 .A9 .if \\n(NA-8 .if n .sp .if \\n(NA-8 .if t .sp 0.5 .ns .I9 .. . \"AI - authors institution .de AI .br .ft 1 .di .di I\\n(NA .nf .. . \"AB - begin an abstract .de AB .br .di .ul 0 .ce 0 .nr 1T 1 .nr IK 1 .nr KI 1 .di WB .rs .nr AJ 1 .ce 1 .ft 2 .if n .ul .ll \\n(LLu .if \\n(.$=0 ABSTRACT .if \\n(.$>0 .if !"\\$1"-" .if !"\\$1"no" \\$1 .if \\n(.$=0 .sp .if \\n(.$>0 .if !"\\$1"-" .if !"\\$1"no" .sp .hy 14 .ul 0 .ce 0 .fi .ft 1 .nr OJ \\n(.i .in +\\n(.lu/12u .ll -\\n(.lu/12u .br .ps \\n(PS .if \\n(VS>40 .vs \\n(VSu .if \\n(VS<=39 .vs \\n(VSp .ti +\\n(PIu .. . \"AE - end of an abstract .de AE .br .di .ll \\n(LLu .ps \\n(PS .if \\n(VS>40 .vs \\n(VSu .if \\n(VS<=39 .vs \\n(VSp .nr 1T 0 .nr IK 0 .in \\n(OJu .nr AJ 0 .di .ce 0 .if \\n(ST=2 .SY .if \\n(ST<3 .rm SY .. . \"S2 - release paper style . \"SY - cover sheet of released paper .de SY .ll \\n(LLu .ns .if \\n(TV .TX .if \\n(AV .AX .rs .ce 0 .nf .sp 3 .ls 1 .WB .ls .sp 3v \\*(DY .sp |9i .if \\n(FP>0 .FA .FG .if \\n(GA=1 .nr GA 2 .fi .. . \"S2 - first text page, released paper format .de S2 .ce 0 .br .SY .rm SY .bp 1 .if \\n(TV .TX .if \\n(AV .AX .rs .ce 0 .ft 1 .ad \\n(SJ .. . \"S0- mike lesk conserve paper style .de S0 .ce 0 .br .ll \\n(LLu .if \\n(TV+\\n(AV>0 .ns .if \\n(TV .TX .if \\n(AV .AX .if \\n(TV+\\n(AV>0 .rs .ce 0 .if \\n(TV>0 .sp 2 .ls 1 .if \\n(FP>0 \{\ . FJ . nf . FG . fi . FK . nr FP 0\} .nf .WB .ls .fi .ad \\n(SJ .. . \"S3 - CSTR style .de S3 .rs .sp |2.25i .ce 1000 .I1 .if \\n(NA>1 .sp .5 .if \\n(NA>1 .I2 .if \\n(NA>2 .sp .5 .if \\n(NA>2 .I3 .if \\n(NA>3 .sp .5 .if \\n(NA>3 .I4 .if \\n(NA>4 .sp .5 .if \\n(NA>4 .I5 .if \\n(NA>5 .sp .5 .if \\n(NA>5 .I6 .if \\n(NA>6 .sp .5 .if \\n(NA>6 .I7 .if \\n(NA>7 .sp .5 .if \\n(NA>7 .I8 .if \\n(NA>8 .sp .5 .if \\n(NA>8 .I9 .sp |4i . \"check how long title is: can space extra .25 inch if short .di EZ .WT .di .if \\n(dn<1.5v .if \\n(NA=1 .sp .25i .ft 1 Computing Science Technical Report No. \\*(MN .sp .if t .ft 3 .if n .ul 100 .ps 12 .vs 15p .hy 0 .WT .hy 14 .ft 1 .if n .ul 0 .ps 10 .vs 12p .sp .ft 1 .A1 .A2 .A3 .A4 .A5 .A6 .A7 .A8 .A9 .ce 0 .sp |8.5i .ce 0 \\*(DY .bp 0 .ft 1 .S2 .. . \"SG - signature .de SG .br .KS .in +2u*\\n(.lu/3u .sp 2 .A1 .if \\n(NA-1 .sp 2 .A2 .if \\n(NA-2 .sp 2 .A3 .if \\n(NA-3 .sp 2 .A4 .if \\n(NA-4 .sp 2 .A5 .if \\n(NA>5 .sp 2 .A6 .if \\n(NA>6 .sp 2 .A7 .if \\n(NA>7 .sp 2 .A8 .if \\n(NA>8 .sp 2 .A9 .in .nf .sp -1 .if \\n(.$>=1 \\$1 .if \\n(.$>=2 \\$2 .if \\n(.$>=3 \\$3 .if \\n(.$>=4 \\$4 .if \\n(.$>=5 \\$5 .if \\n(.$>=6 \\$6 .if \\n(.$>=7 \\$7 .if \\n(.$>=8 \\$8 .if \\n(.$>=9 \\$9 .fi .br .KE .. . \"Tables. TS - table start, TE - table end .de TS .br .if !\\n(1T .RT .ul 0 .ti \\n(.iu .if t .sp 0.5 .if n .sp .if \\$1H .TQ .nr IX 1 .. .de TQ .di TT .nr IT 1 .. .de TH .if \\n(.d>0.5v .nr T. 0 .if \\n(.d>0.5v .T# 0 .di .nr TQ \\n(.i .nr HT 1 .in 0 .TT .in \\n(TQu .mk #T .. .de TE .nr IX 0 .if \\n(IT>0 .if \\n(HT=0 .di .if \\n(IT>0 .if \\n(HT=0 .nr EF \\n(.u .if \\n(IT>0 .if \\n(HT=0 .nf .if \\n(IT>0 .if \\n(HT=0 .TT .if \\n(IT>0 .if \\n(HT=0 .if \\n(EF>0 .fi .nr IT 0 .nr HT 0 .if n .sp 1 .if t .sp 0.5 .rm a+ b+ c+ d+ e+ f+ g+ h+ i+ j+ k+ l+ n+ m+ .rr 32 33 34 35 36 37 38 40 79 80 81 82 .rr a| b| c| d| e| f| g| h| i| j| k| l| m| .rr a- b- c- d- e- f- g- h- i- j- k- l- m- .. . \"DS - display. If .DS C, center; L, left-adjust; I, indent. .de DS .XD .KS .nf .\\$1D \\$2 \\$1 .ft 1 .ps \\n(PS .if \\n(VS>40 .vs \\n(VSu .if \\n(VS<=39 .vs \\n(VSp .. .de D .ID \\$1 .. .de CD .ce 1000 .. .de ID .if t .in +0.5i .if n .in +8 .if \\n(.$ .if !"\\$1"I" .in \\n(OIu .if \\n(.$ .if !"\\$1"I" .in +\\$1n .. .de LD .. .de XD .nf .nr OI \\n(.i .if t .sp 0.5 .if n .sp 1 .. .de BD \" block display: save everything, then center it. .nr BD 1 .nf .di DD .. . \"DE - display end .de DE .ce 0 .if \\n(BD>0 .DF .nr BD 0 .KE .in \\n(OIu .if t .sp 0.5 .if n .sp 1 .fi .. .de DF \" finish a block display to be recentered. .di .if \\n(dl>\\n(BD .nr BD \\n(dl .if \\n(BD<\\n(.l .in (\\n(.lu-\\n(BDu)/2u .nr EI \\n(.l-\\n(.i .ta \\n(EIuR .DD .in \\n(OIu .. . \"KS keep - for keep release features. As in IFM .de KS .nr KN \\n(.u .if \\n(IK=0 .if \\n(IF=0 .KQ .nr IK +1 .. . \"KQ - real keep processor .de KQ .br .nr KI \\n(.i .ev 2 .br .in \\n(KIu .ps \\n(PS .if \\n(VS>40 .vs \\n(VSu .if \\n(VS<=39 .vs \\n(VSp .ll \\n(LLu .lt \\n(LTu .if \\n(NX>1 .ll \\n(CWu .if \\n(NX>1 .lt \\n(CWu .di KK .nr TB 0 .. . \"KF - floating keep .de KF .nr KN \\n(.u .if !\\n(IK .FQ .nr IK +1 .. . \"FQ real floating keep processor .de FQ .nr KI \\n(.i .ev 2 .br .in \\n(KIu .ps \\n(PS .if \\n(VS>40 .vs \\n(VSu .if \\n(VS<=39 .vs \\n(VSp .ll \\n(LLu .lt \\n(LTu .if \\n(NX>1 .ll \\n(CWu .if \\n(NX>1 .lt \\n(CWu .di KK .nr TB 1 .. . \"KE release - everything between keep and release is together .de KE .if \\n(IK .if !\\n(IK-1 .if \\n(IF=0 .RQ .if \\n(IK .nr IK -1 .. . \"RQ real release .de RQ .br .di .nr NF 0 .if \\n(dn-\\n(.t .nr NF 1 .if \\n(TC .nr NF 1 .if \\n(NF .if !\\n(TB .sp 200 .if !\\n(NF .if \\n(TB .nr TB 0 .nf .rs .nr TC 5 .in 0 .ls 1 .if \\n(TB=0 .ev .if \\n(TB=0 .br .if \\n(TB=0 .ev 2 .if \\n(TB=0 .KK .ls .ce 0 .if \\n(TB=0 .rm KK .if \\n(TB .da KJ .if \\n(TB \!.KD \\n(dn .if \\n(TB .KK .if \\n(TB .di .nr TC \\n(TB .if \\n(KN .fi .in .ev .. .de EQ \"equation, breakout and display .nr EF \\n(.u .rm EE .nr LE 1 \" 1 is center .ds EL \\$1 .if "\\$1"L" .ds EL \\$2 .if "\\$1"L" .nr LE 0 .if "\\$1"C" .ds EL \\$2 .if "\\$1"I" .nr LE 0 .if "\\$1"I" .ds EE \\h'|10n' .if "\\$1"I" .if !"\\$3"" .ds EE \\h'\\$3' .if "\\$1"I" .ds EL \\$2 .if \\n(YE>0 .nf .di EZ .. .de EN \" end of a displayed equation .br .di .rm EZ .nr ZN \\n(dn .if \\n(ZN>0 .if \\n(YE=0 .LP .if \\n(ZN=0 .if !"\\*(EL"" .nr ZN 1 .if "\\n(.z"" .if \\n(ZN>0 .if !\\n(nl=\\n(PE .if t .sp .5 .if "\\n(.z"" .if \\n(ZN>0 .if !\\n(nl=\\n(PE .if n .sp 1 .if !"\\n(.z"" .if \\n(ZN>0 .if !\\n(.d=\\n(PE .if t .sp .5 .if !"\\n(.z"" .if \\n(ZN>0 .if !\\n(.d=\\n(PE .if n .sp 1 .pc .if \\n(BD>0 .nr LE 0 \" can't mean centering in this case. .if \\n(MK>0 .if \\n(LE=1 .ds EE \\h'|10n' .if \\n(MK>0 .nr LE 0 \" don't center if mark/lineup .lt \\n(.lu .if \\n(EP=0 .if \\n(ZN>0 .if \\n(LE>0 .tl \(ts\(ts\\*(10\(ts\\*(EL\(ts .if \\n(EP=0 .if \\n(ZN>0 .if \\n(LE=0 .if \\n(BD=0 .tl \(ts\\*(EE\\*(10\(ts\(ts\\*(EL\(ts .if \\n(EP=0 .if \\n(ZN>0 .if \\n(LE=0 .if \\n(BD>0 .if \\n(BD<\\w\(ts\\*(10\(ts .nr BD \\w\(ts\\*(10\(ts .if \\n(EP=0 .if \\n(ZN>0 .if \\n(LE=0 .if \\n(BD>0 \!\\*(10\\t\\*(EL .if \\n(EP>0 .if \\n(ZN>0 .if \\n(LE>0 .tl \(ts\\*(EL\(ts\\*(10\(ts\(ts .if \\n(EP>0 .if \\n(ZN>0 .if \\n(LE=0 .if \\n(BD=0 .tl \(ts\\*(EL\\*(EE\\*(10\(ts\(ts\(ts .if \\n(EP>0 .if \\n(ZN>0 .if \\n(LE=0 .if \\n(BD>0 .if \\n(BD<\\w\(ts\\*(10\(ts .nr BD \\w\(ts\\*(10\(ts .if \\n(EP>0 .if \\n(ZN>0 .if \\n(LE=0 .if \\n(BD>0 \!\\h'-\\\\n(.iu'\\*(EL\\h'|0'\\*(10 .\".di EZ \" GCOS patch .\"\\*(10 \" GCOS patch .\".br \" GCOS patch .\".di \" GCOS patch .\".rm EZ \" GCOS patch .lt \\n(LLu .pc % .if \\n(YE>0 .if \\n(EF>0 .fi .rm EL 10 11 12 13 14 15 16 17 18 19 20 21 22 23 .rr 10 11 12 13 14 15 16 17 18 19 20 21 22 23 .if \\n(ZN>0 .if t .sp .5 .if \\n(ZN>0 .if n .sp .if "\\n(.z"" .nr PE \\n(nl .if !"\\n(.z"" .nr PE \\n(.d .. .de ME .nr SJ \\n(.j .if \\n(LL>0 .nr LT \\n(LL .nr YE 1 .if \\n(PO=0 .nr PO \\n(.o .. . \"EM end up macro - process left over keep-release .de EM .br .if \\n(TB=0 .if t .wh -1p CM .if \\n(TB \&\c .if \\n(TB 'bp .if \\n(TB .NP .if \\n(TB .ch CM 160 .. . \"NP new page .de NP .if \\n(FM+\\n(HM>=\\n(.p .tm Margins bigger than page length. .if \\n(FM+\\n(HM>=\\n(.p .ab .if \\n(FM+\\n(HM>=\\n(.p .ex .nr PX \\n(.s .nr PF \\n(.f .if t .CM .if \\n(HM=0 .nr HM 1i 'sp \\n(HMu/2u .lt \\n(LTu .ps \\n(PS .ft 1 .if \\n(PO>0 .po \\n(POu .PT .ps \\n(PX .ft \\n(PF 'sp |\\n(HMu .nr XX 0 1 .nr YY 0-\\n(FMu .ch FO 16i .ch FX 17i .ch FO -\\n(FMu .ch FX \\n(.pu-\\n(FMu .if \\n(MF .FV .nr MF 0 .mk .os .ev 1 .if \\n(TD=0 .if \\n(TC<5 .XK .nr TC 0 .ns .ev .nr TQ \\n(.i .nr TK \\n(.u .if \\n(IT>0 \{\ . in 0 . nf . TT . in \\n(TQu . if \\n(TK .fi\ \} .mk #T .if t .if \\n(.o+\\n(LL>7.75i .tm Offset + line length exceeds 7.75 inches, too wide .. .de XK .nr TD 1 .nf .ls 1 .in 0 .rn KJ KL .KL .rm KL .if "\\n(.z"KJ" .di .nr TB 0 .if "\\n(.z"KJ" .nr TB 1 .br .in .ls .fi .nr TD 0 .. .de KD .nr KM 0 .if "\\n(.z"KJ" .nr KM 1 \" KM is 1 if in a rediversion of keeps .if \\n(KM>0 \!.KD \\$1 .if \\n(KM=0 .if \\n(.t<\\$1 .di KJ .. .de PT .lt \\n(LLu .pc % .nr PN \\n% .if \\n%-1 .tl '\\*(LH'\\*(CH'\\*(RH' .lt \\n(.lu .. . \"FO - footer of page .de FO .rn FO FZ .if \\n(K1>0 .tm This memo has a multi-page cover sheet. You are .if \\n(K1>0 .tm rebuked in the name of the Committee on Technical Memoranda. .if \\n(IT>0 .nr T. 1 .if \\n(IT>0 .if \\n(FC=0 .T# 1 .if \\n(IT>0 .br .nr FC +1 .if \\n(NX<2 .nr WF 0 .nr dn 0 .if \\n(FC<=1 .if \\n(XX .XF .rn FZ FO .nr MF 0 .if \\n(dn .nr MF 1 .if !\\n(WF .nr YY 0-\\n(FMu .if !\\n(WF .ch FO \\n(YYu .if !\\n(dn .nr WF 0 .if \\n(FC<=1 .if \\n(XX=0 .if \\n(NX>1 .RC .if \\n(FC<=1 .if \\n(XX=0 .if \\n(NX<1 'bp .nr FC -1 .if \\n(ML>0 .ne \\n(MLu .. . \"2C - begin double column .de 2C .MC \" default MC is double column .. .de MC \" multiple columns- arg is line length .nr L1 \\n(LL*7/15 .if \\n(.$>0 .nr L1 \\$1n .nr GW 0-1 .if \\n(.$>1 .nr GW \\$1n .nr NQ \\n(LL/\\n(L1 .if \\n(NQ<1 .nr NQ 1 .if \\n(NQ>2 .if (\\n(LL%\\n(L1)=0 .nr NQ -1 .if \\n(1T=0 \{\ . BG . if n .sp 4 . if t .sp 2\} .if \\n(NX=0 .nr NX 1 .if !\\n(NX=\\n(NQ \{\ . RT . if \\n(NX>1 .bp . mk . nr NC 1 . po \\n(POu\} .if \\n(NQ>1 .hy 12 .nr NX \\n(NQ .nr CW \\n(L1 .ll \\n(CWu .nr FL \\n(CWu*11u/12u .if \\n(NX>1 .nr GW (\\n(LL-(\\n(NX*\\n(CW))/(\\n(NX-1) .nr RO \\n(CW+((\\n(GW .ns .. .de RC .if \\n(NC>=\\n(NX .C2 .if \\n(NC<\\n(NX .C1 .nr NC \\n(ND .. .de C1 .rt .po +\\n(ROu .nr ND \\n(NC+1 .nr XX 0 1 .if \\n(MF .FV .ch FX \\n(.pu-\\n(FMu .ev 1 .if \\n(TB .XK .nr TC 0 .ev .nr TQ \\n(.i .if \\n(IT>0 .in 0 .if \\n(IT>0 .TT .if \\n(IT>0 .in \\n(TQu .mk #T .ns .. .ch FO \\n(YYu .de C2 .po \\n(POu 'bp .nr ND 1 .. . \"1C - return to single column format .de 1C .MC \\n(LLu .hy 14 .. . \".de R3 . \".pl 102 . \".nr LT \\n(.l . \".. .de MH Bell Laboratories Murray Hill, New Jersey 07974 .. .de PY Bell Laboratories Piscataway, New Jersey 08854 .. .de BT .nr PX \\n(.s .nr PF \\n(.f .ft 1 .ps \\n(PS 'lt \\n(LTu .po \\n(POu .if \\n%>0 .tl '\\*(LF'\\*(CF'\\*(RF' .ft \\n(PF .ps \\n(PX .. . \"PP - paragraph .de PP .RT .ne 1.1 .if \\n(1T .sp \\n(PDu .ti +\\n(PIu .. . \"SH - (unnumbered) section heading .de SH .ti \\n(.iu .RT .if \\n(1T .sp 1 .if !\\n(1T .BG .RT .ne 4 .ft 3 .if n .ul 1000 .. . \"NH - numbered heading .de NH .RT .if \\n(1T .sp 1 .if !\\n(1T .BG .RT .ne 4 .ft 3 .if n .ul 1000 .nr NS \\$1 .if !\\n(.$ .nr NS 1 .if !\\n(NS .nr NS 1 .nr H\\n(NS +1 .if !\\n(NS-4 .nr H5 0 .if !\\n(NS-3 .nr H4 0 .if !\\n(NS-2 .nr H3 0 .if !\\n(NS-1 .nr H2 0 .if !\\$1 .if \\n(.$ .nr H1 1 .ds SN \\n(H1. .ti \\n(.iu .if \\n(NS-1 .as SN \\n(H2. .if \\n(NS-2 .as SN \\n(H3. .if \\n(NS-3 .as SN \\n(H4. .if \\n(NS-4 .as SN \\n(H5. \\*(SN .. . \"BG - begin, execute at first PP .de BG .br .ME .rm ME .di .ce 0 .nr KI 0 .hy 14 .nr 1T 1 .S\\n(ST .rm S0 .rm S1 .rm S2 .rm S3 .rm OD .rm OK .rm TX .rm AX .rm WT .rm CS .rm TM .rm IM .rm MF .rm MR .rm RP .rm I1 .rm I2 .rm I3 .rm I4 .rm I5 .rm CB .rm E1 .rm E2 .de TL .ft 3 .sp .if n .ul 100 .ce 100 .LG \\.. .de AU .ft 2 .if n .ul 0 .ce 100 .sp .NL \\.. .de AI .ft 1 .ce 100 .if n .ul 0 .if n .sp .if t .sp .5 .NL \\.. .RA .rm RA .rn FJ FS .rn FK FE .nf .ev 1 .ps \\n(PS-2 .vs \\n(.s+2p .ev .if \\n(KG=0 .nr FP 0 .if \\n(GA>1 .if \\n(KG=0 .nr GA 0 \" next UNIX must be flagged. .nr KG 0 .if \\n(FP>0 .FS .if \\n(FP>0 .FG .if \\n(FP>0 .FE .br .if \\n(TV>0 .if n .sp 2 .if \\n(TV>0 .if t .sp 1 .fi .ll \\n(LLu .. .de RA \"redefine abstract macros .de AB .br .if !\\n(1T .BG .ce 1 .sp 1 .if \\n(.$=0 ABSTRACT .if \\n(.$>0 .if !"\\$1"-" .if !"\\$1"no" \\$1 .if \\n(.$=0 .sp .if \\n(.$>0 .if !"\\$1"-" .if !"\\$1"no" .sp .sp 1 .nr AJ 1 .in +\\n(.lu/12u .ll -\\n(.lu/12u .RT \\.. .de AE .nr AJ 0 .br .in 0 .ll \\n(LLu .if \\n(VS>40 .vs \\n(VSu .if \\n(VS<=39 .vs \\n(VSp \\.. .. . \"IP - indented paragraph .de IP .RT .if !\\n(IP .nr IP +1 .sp \\n(PDu .ne 3v .if \\n(.$-1 .nr I\\n(IR \\$2n .in +\\n(I\\n(IRu .nr TY \\n(TZ-\\n(.i .ta \\n(I\\n(IRu \\n(TYuR .if \\n(.$>0 \{\ .ti -\\n(I\\n(IRu \&\\$1\t\c\} .. . \"LP - left aligned (block) paragraph .de LP .ti \\n(.iu .RT .if \\n(1T .sp \\n(PDu .ne 1.1 .. .de QP .ti \\n(.iu .RT .if \\n(1T .sp \\n(PDu .ne 1.1 .nr QP 1 .in +\\n(QIu .ll -\\n(QIu .ti \\n(.iu .. . \"IE - synonym for .LP .de IE .LP .. . \"LB - label paragraph .de LB .in +\\n(I\\n(IRu .ta \\n(I\\n(IRu .if \\n(.$ .ti -\\n(I\\n(IRu .if \\n(.$ \&\\$1\t\c .. .de XP .RT .if !\\n(IP .nr IP +1 .sp \\n(PDu .ne 3 .if \\n(.$-2 .nr I\\n(IR \\$3n .in +\\n(I\\n(IRu .ta \\n(I\\n(IRu/2u \\n(I\\n(IRu .ti -\\n(I\\n(IRu \0\\$1\t\\$2\t\c .. . \"RS - prepare for double indenting .de RS .nr IS \\n(IP .RT .nr IP \\n(IS .if \\n(IP>0 .in +\\n(I\\n(IRu .nr IR +1 .nr I\\n(IR \\n(PIu .in +\\n(I\\n(IRu .nr TY \\n(TZ-\\n(.i .ta \\n(TYuR .. . \"RE - retreat to the left .de RE .nr IS \\n(IP .RT .nr IP \\n(IS .nr IR -1 .if \\n(IP<=0 .in -\\n(I\\n(IRu .. .de TC .nr TZ \\n(.lu .if \\n(.$ .nr TZ \\$1n .ta \\n(TZuR .. .de TD .LP .nr TZ 0 .. . \"CM - cut mark .de CM .po 0 .lt 7.6i .ft 1 .ps 10 .vs 4p .tl '--''--' .po .vs .lt .ps .ft .. . \"B - bold font .de B .nr PQ \\n(.f .if t .ft 3 .if "\\$1"" .if n .ul 1000 .if !"\\$1"" .if n .ul 1 .if t .if !"\\$1"" \&\\$1\\f\\n(PQ\\$2 .if n .if \\n(.$=1 \&\\$1 .if n .if \\n(.$>1 \&\\$1\\c .if n .if \\n(.$>1 \\&\\$2 .. . \"R - Roman font .de R .if n .ul 0 .ft 1 .. . \"I - italic font .de I .nr PQ \\n(.f .if t .ft 2 .if "\\$1"" .if n .ul 1000 .if !"\\$1"" .if n .ul 1 .if t .if !"\\$1"" \&\\$1\\f\\n(PQ\\$2 .if n .if \\n(.$=1 \&\\$1 .if n .if \\n(.$>1 \&\\$1\\c .if n .if \\n(.$>1 \\&\\$2 .. . \"TA - tabs set in ens or chars .de TA .ta \\$1n \\$2n \\$3n \\$4n \\$5n \\$6n \\$7n \\$8n \\$9n .. . \"SM - make smaller size .de SM .ps -2 .. . \"LG - make larger size .de LG .ps +2 .. . \"NL - return to normal size .de NL .ps \\n(PS .. . \"DA - force date; ND - no date or new date. .de DA .if \\n(.$ .ds DY \\$1 \\$2 \\$3 \\$4 .ds CF \\*(DY .. .de ND .ds DY \\$1 \\$2 \\$3 \\$4 .rm CF .. .if \n(mo-0 .ds MO January .if \n(mo-1 .ds MO February .if \n(mo-2 .ds MO March .if \n(mo-3 .ds MO April .if \n(mo-4 .ds MO May .if \n(mo-5 .ds MO June .if \n(mo-6 .ds MO July .if \n(mo-7 .ds MO August .if \n(mo-8 .ds MO September .if \n(mo-9 .ds MO October .if \n(mo-10 .ds MO November .if \n(mo-11 .ds MO December .if \n(dw-0 .ds DW Sunday .if \n(dw-1 .ds DW Monday .if \n(dw-2 .ds DW Tuesday .if \n(dw-3 .ds DW Wednesday .if \n(dw-4 .ds DW Thursday .if \n(dw-5 .ds DW Friday .if \n(dw-6 .ds DW Saturday .ds DY \*(MO \n(dy, 19\n(yr .IZ .rm IZ .rm MO .de FN .FS .. . \"FS - begin footnote .de FJ 'ce 0 .ev1 .ll \\n(FLu .da FF .br .if \\n(IF>0 .tm Footnote within footnote-illegal. .nr IF 1 .if !\\n+(XX-1 .FA .. . \"FE - footnote end .de FK .br .in 0 .nr IF 0 .di .ev .if !\\n(XX-1 .nr dn +\\n(.v .nr YY -\\n(dn .if \\n(NX=0 .nr WF 1 .if \\n(dl>\\n(CW .nr WF 1 .if (\\n(nl+\\n(.v)<=(\\n(.p+\\n(YY) .ch FO \\n(YYu .if (\\n(nl+\\n(.v)>(\\n(.p+\\n(YY) .if \\n(nl>(\\n(HM+1.5v) .ch FO \\n(nlu+\\n(.vu .if (\\n(nl+\\n(.v)>(\\n(.p+\\n(YY) .if \\n(nl+\\n(FM+1v>\\n(.p .ch FX \\n(.pu-\\n(FMu+2v .if (\\n(nl+\\n(.v)>(\\n(.p+\\n(YY) .if \\n(nl<=(\\n(HM+1.5v) .ch FO \\n(HMu+(4u*\\n(.vu) .. .\" First page footer. .de FS .ev1 .br .ll \\n(FLu .da FG .. .de FE .br .di .nr FP \\n(dn .if \\n(1T=0 .nr KG 1 \"not in abstract repeat next page. .if "\\n(.z"OD" .nr KG 0 \" if in OK, don't repeat. .ev .. .de FA .if n __________________________ .if t \l'1i' .br .. .de FV .FS .nf .ls 1 .FY .ls .fi .FE .. .de FX .if \\n(XX>0 .di FY .if \\n(XX>0 .ns .. .de XF .if \\n(nlu+1v>(\\n(.pu-\\n(FMu) .ch FX \\n(nlu+1.9v .ev1 .nf .ls 1 .FF .rm FF .nr XX 0 1 .br .ls .di .fi .ev .. .de FL .ev1 .nr FL \\$1n .ll \\$1 .ev .. .de HO Bell Laboratories Holmdel, New Jersey 07733 .. .de WH Bell Laboratories Whippany, New Jersey 07981 .. .de IH Bell Laboratories Naperville, Illinois 60540 .. .de UL \" underline argument, don't italicize .if t \\$1\l'|0\(ul'\\$2 .if n .I \\$1 \\$2 .. .em EM . \" ACCENTS say \*'e or \*`e to get e acute or e grave .ds ' \h'\w'e'u*4/10'\z\(aa\h'-\w'e'u*4/10' .ds ` \h'\w'e'u*4/10'\z\(ga\h'-\w'e'u*4/10' . \" UMLAUT \*:u, etc. .ds : \v'-0.6m'\h'(1u-(\\n(.fu%2u))*0.13m+0.06m'\z.\h'0.2m'\z.\h'-((1u-(\\n(.fu%2u))*0.13m+0.26m)'\v'0.6m' . \" TILDE and CIRCUMFLEX .ds ^ \\k:\h'-\\n(.fu+1u/2u*2u+\\n(.fu-1u*0.13m+0.06m'\z^\h'|\\n:u' .ds ~ \\k:\h'-\\n(.fu+1u/2u*2u+\\n(.fu-1u*0.13m+0.06m'\z~\h'|\\n:u' . \" czech v symbol .ds C \\k:\\h'+\\w'e'u/4u'\\v'-0.6m'\\s6v\\s0\\v'0.6m'\\h'|\\n:u' .ds v \\k:\\h'+\\w'e'u/4u'\\v'-0.6m'\\s6v\\s0\\v'0.6m'\\h'|\\n:u' . \" cedilla .ds , \\k:\\h'\\w'c'u*0.4u'\\z,\\h'|\\n:u' .de [] .][ \\$1 .. .de ][ .if \\$1>5 .tm Bad arg to [] .[\\$1 .. .if n .ds [. [ .if t .ds [. \s-2\v'-.4m'\f1 .if n .ds .] ] .if t .ds .] \v'.4m'\s+2\fP .if n .ds [o "" .if n .ds [c "" .if t .ds [o `` .if t .ds [c '' .de [5 \" tm style .FS .IP "\\*([F.\0" \\*([A, \\f2\\*([T\\f1, .ie \\n(TN \\*([M. .el Bell Laboratories internal memorandum (\\*([D). .RT .FE .. .de [0 \" other .FS .IP "\\*([F.\0" .if !"\\*([A"" \\*([A, .if !"\\*([T"" \\f2\\*([T\\f1\c .if !"\\*([T"" .if !"\\*([O"" ,\ .ie !"\\*([O"" \\*([O .el .if !"\\*([T"" \&. .if !"\\*([D"" \\*([D. .RT .FE .. .de [1 \" journal article .FS .IP "\\*([F.\0" \\*([A, .if !"\\*([T"" \\*([o\\*([T,\\*([c .if "\\*([V"" \\f2\\*([J\\f1, .if !"\\*([V"" \\f2\\*([J\\f1 .if !"\\*([V"" \{.if n Vol.\& \\f3\\*([V\\f1\c\} .if !"\\*([N"" (\\*([N)\c .if !"\\*([P"" \{\ .ie \\n([P>0 \ pp.\& .el \ p.\& \\*([P\} .if !"\\*([I"" .if "\\*([R"" \\*([I, (\\*([D). .if !"\\*([O"" \\*([O .RT .FE .. .de [2 \" book .FS .IP "\\*([F.\0" \\*([A, \\f2\\*([T,\\f1 \\*([I\c .if !"\\*([C"" , \\*([C\c (\\*([D). .if !"\\*([G"" Gov't. ordering no. \\*([G .if !"\\*([O"" \\*([O .RT .FE .. .de [4 \" report .FS .IP "\\*([F.\0" \\*([A, \\*([o\\*([T,\\*([c \\*([R\c .if !"\\*([G"" \& (\\*([G)\c .if !"\\*([I"" , \\*([I\c .if !"\\*([C"" , \\*([C\c (\\*([D). .if !"\\*([O"" \\*([O .RT .FE .. .de [3 \" article in book .FS .IP "\\*([F.\0" \\*([A, \\*([o\\*([T,\\*([c .if !"\\*([P"" pp. \\*([P in \\f2\\*([B\\f1, \c .if !"\\*([E"" ed. \\*([E,\c .if !"\\*([I"" \\*([I\c .if !"\\*([C"" , \\*([C\c (\\*([D). .if !"\\*([O"" \\*([O .RT .FE .. .de [< .]< .. .de ]< .SH References .LP .rm FS FE .. .de [> .]> .. .de ]> .sp .. .de [- .]- .. .de ]- .rm [V [P [A [T [N [C [B [O [R [I [E [D .. .de UX .ie \\n(GA>0 \\$2\s-2UNIX\s0\\$1 .el \{\ .if n \\$2UNIX\\$1* .if t \\$2\s-2UNIX\\s0\\$1\\f1\(dg\\fP .FS .if n *UNIX .if t \(dgUNIX .ie \\$3=1 is a Footnote of Bell Laboratories. .el is a Trademark of Bell Laboratories. .FE .nr GA 1\} .. .de US the .UX operating system .. .de QS .br .in +\\n(QIu .ll -\\n(QIu .LP .. .de QE .br .ll +\\n(QIu .in -\\n(QIu .LP .. .de B1 \" begin boxed stuff .br .di BB .nr BC 0 .if "\\$1"C" .nr BC 1 .nr BE 1 .. .de B2 \" end boxed stuff .br .nr BI 1n .if \\n(.$>0 .nr BI \\$1n .di .nr BE 0 .nr BW \\n(dl .nr BH \\n(dn .ne \\n(BHu+\\n(.Vu .nr BQ \\n(.j .nf .ti 0 .if \\n(BC>0 .in +(\\n(.lu-\\n(BWu)/2u .in +\\n(BIu .BB .in -\\n(BIu .nr BW +2*\\n(BI .sp -1 \l'\\n(BWu\(ul'\L'-\\n(BHu'\l'|0\(ul'\h'|0'\L'\\n(BHu' .if \\n(BC>0 .in -(\\n(.lu-\\n(BWu)/2u .if \\n(BQ .fi .br .. .de AT .nf .sp .ne 2 Attached: .. .de CT .nf .sp .ne 2 .ie \\n(.$ Copy to \\$1: .el Copy to: .. .de BX .if t \(br\|\\$1\|\(br\l'|0\(rn'\l'|0\(ul' .if n \(br\\kA\|\\$1\|\\kB\(br\v'-1v'\h'|\\nBu'\l'|\\nAu'\v'1v'\l'|\\nAu' .. nr BE 0 .nr BW \\n(dl .nr BH \\n(dn .ne \\n(BHu+\\n(.Vu .nr BQ \\n(.j .nf .ti 0 .if \\n(BC>0 .in +(\\n(.lu-\\n(BWu)/2u .in +\\n(BIu .BB .in -\\n(BIu .nr BW +2*\\n(BI .sp -1 \l'\\n(BWu\(ul'\L'-\\n(BHu'\l'|0\(ul'\h'|0'\L'\\n(BHu' .if \\n(BC>0 .in -(\\n(.lu-\\n(BWu)/2u .if \\n(BQ .fi .br .. .de AT .nf .sp .ne 2 Attache((lib/tmac/tmac.srefs 644 0 33 4070 2256427611 7523 .\" REFER macros .... citations .de [] .][ \\$1 .. .de ][ .if \\$1>5 .tm Bad arg to [] .[\\$1 .. .if n .ds [. [ .if t .ds [. \s-2\v'-.4m'\f1 .if n .ds .] ] .if t .ds .] \v'.4m'\s+2\fP .if n .ds [o "" .if n .ds [c "" .if t .ds [o `` .if t .ds [c '' .\" the next lines deal with the problem of .[1] or [1]. .\" refer will write "linexxx\*(<.[1]\*(>. .\" and either "<." or ">." should produce the .; .\" similarly for , .if n .ds >. . .if t .ds <. . .if n .ds >, , .if t .ds <, , .de [5 \" tm style .FS .IP "\\*([F.\0" \\*([A, \\f2\\*([T\\f1, .ie \\n(TN \\*([M. .el Bell Laboratories internal memorandum (\\*([D). .RT .FE .. .de [0 \" other .FS .IP "\\*([F.\0" .if !"\\*([A"" \\*([A, .if !"\\*([T"" \\f2\\*([T\\f1\c .if !"\\*([T"" .if !"\\*([O"" ,\ .ie !"\\*([O"" \\*([O .el .if !"\\*([T"" \&. .if !"\\*([D"" \\*([D. .RT .FE .. .de [1 \" journal article .FS .IP "\\*([F.\0" \\*([A, .if !"\\*([T"" \\*([o\\*([T,\\*([c .if !"\\*([V"" .if t \\f2\\*([J\\f1 .if "\\*([V"" .if t \\f2\\*([J\\f1, .if n \\f2\\*([J\\f1, .el \\f2\\*([J\\f1, .if !"\\*([V"" \{.if n Vol.\& \\f3\\*([V\\f1\c .if n ,\} .if !"\\*([N"" (\\*([N)\c .if !"\\*([P"" \{\ .ie \\n([P>0 \ pp.\& .el \ p.\& \\*([P\} .if !"\\*([I"" .if "\\*([R"" \\*([I, (\\*([D). .if !"\\*([O"" \\*([O .RT .FE .. .de [2 \" book .FS .IP "\\*([F.\0" \\*([A, \\f2\\*([T,\\f1 \\*([I\c .if !"\\*([C"" , \\*([C\c (\\*([D). .if !"\\*([G"" Gov't. ordering no. \\*([G .if !"\\*([O"" \\*([O .RT .FE .. .de [4 \" report .FS .IP "\\*([F.\0" \\*([A, \\*([o\\*([T,\\*([c \\*([R\c .if !"\\*([G"" \& (\\*([G)\c .if !"\\*([I"" , \\*([I\c .if !"\\*([C"" , \\*([C\c (\\*([D). .if !"\\*([O"" \\*([O .RT .FE .. .de [3 \" article in book .FS .IP "\\*([F.\0" \\*([A, \\*([o\\*([T,\\*([c .if !"\\*([P"" pp. \\*([P in \\f2\\*([B\\f1, \c .if !"\\*([E"" ed. \\*([E, \c .if !"\\*([I"" \\*([I\c .if !"\\*([C"" , \\*([C\c (\\*([D). .if !"\\*([O"" \\*([O .RT .FE .. .de ]< .[< .. .de [< .SH References .LP .rm FS FE .. .de [> .]> .. .de ]> .sp .. .de ]- .[- .. .de [- .rm [V [P [A [T .rm [N [C [B [O .rm [R [I [E [D .. .de ]] this is never executed and just uses up an end-of-file bug. .. \\*([D). .if !"\\*([O"" \\*([O .RT .FE .. .de [3 \" article in book .FS .IP "\\*([F.\0" \\*([A, \\*([o\\*([T,\\*([c .if !"\\*([P"" pp. \\*([P in \\f2\\*([B\\f1, \c .if !"\\*([E"" ed. \\*([E, \c .if !"\\*([I"" \\*([I\c .if !"\\*([C"" , \\*([C\c (\\*([D). .if !"\\*([O"" \\*([O .RT .FE .. .de ]< .[< .. .de [< .SH References .LP .rm FS FE .. .de [> .]> .. .de ]> .sp .. .de ]- .[- .. .de [- .rm [V [P [A [T .rm [N [C [B [O .rm [R [I [E [D .. .de ]] this islib/tmac/tmac.skeep 644 0 33 2246 2256427622 7515 . \"KS keep - for keep release features. As in IFM .de ]K .nr KN \\n(.u .if \\n(IK=0 .if \\n(IF=0 .KQ .nr IK +1 .. . \"KQ - real keep processor .de KQ .br .nr KI \\n(.i .ev 2 .br .in \\n(KIu .ps \\n(PS .if \\n(VS>40 .vs \\n(VSu .if \\n(VS<=39 .vs \\n(VSp .ll \\n(LLu .lt \\n(LTu .if \\n(NX>1 .ll \\n(CWu .if \\n(NX>1 .lt \\n(CWu .di KK .nr TB 0 .. . \"KF - floating keep .de ]J .nr KN \\n(.u .if !\\n(IK .FQ .nr IK +1 .. . \"FQ real floating keep processor .de FQ .nr KI \\n(.i .ev 2 .br .in \\n(KIu .ps \\n(PS .if \\n(VS>40 .vs \\n(VSu .if \\n(VS<=39 .vs \\n(VSp .ll \\n(LLu .lt \\n(LTu .if \\n(NX>1 .ll \\n(CWu .if \\n(NX>1 .lt \\n(CWu .di KK .nr TB 1 .. . \"KE release - everything between keep and release is together .de KE .if \\n(IK .if !\\n(IK-1 .if \\n(IF=0 .RQ .if \\n(IK .nr IK -1 .. . \"RQ real release .de RQ .br .di .nr NF 0 .if \\n(dn-\\n(.t .nr NF 1 .if \\n(TC .nr NF 1 .if \\n(NF .if !\\n(TB .sp 200 .if !\\n(NF .if \\n(TB .nr TB 0 .nf .rs .nr TC 5 .in 0 .ls 1 .if \\n(TB=0 .ev .if \\n(TB=0 .br .if \\n(TB=0 .ev 2 .if \\n(TB=0 .KK .ls .ce 0 .if \\n(TB=0 .rm KK .if \\n(TB .da KJ .if \\n(TB \!.KD \\n(dn .if \\n(TB .KK .if \\n(TB .di .nr TC \\n(TB .if \\n(KN .fi .in .ev .. ything between keep and release is together .de KE .if \\n(IK .if !\\n(IK-1 .if \\n(IF=0 .RQ .if \\n(IK .nr IK -1 .. . \"RQ real release .de RQ .br .di .nr NF 0 .if \\n(dn-\\n(.t .nr NF 1 .if \\n(TC .nr NF 1 .if \\n(NF .if !\\n(TB .sp 200 .if !\\n(NF .if \\n(TB .nr TB 0 .nf .rs .nr TC 5 .in 0 .ls 1 .if \\n(TB=0 .ev .if \\n(TB=0 .br .if \\n(TB=0lib/tmac/tmac.sdisp 644 0 33 1451 2256427631 7525 . \"DS - display. If .DS C, center; L, left-adjust; I, indent. .de DS .KS .nf .\\$1D \\$2 \\$1 .ft 1 .ps \\n(PS .if \\n(VS>40 .vs \\n(VSu .if \\n(VS<=39 .vs \\n(VSp .. .de D .ID \\$1 .. .de CD .XD .ce 1000 .. .de ID .XD .if t .in +0.5i .if n .in +8 .if \\n(.$ .if !"\\$1"I" .if !"\\$1"" .in \\n(OIu .if \\n(.$ .if !"\\$1"I" .if !"\\$1"" .in +\\$1n .. .de LD .XD .. .de XD .nf .nr OI \\n(.i .if t .sp 0.5 .if n .sp 1 .. .de BD \" block display: save everything, then center it. .XD .nr BD 1 .nf .in \\n(OIu .di DD .. . \"DE - display end .de DE .ce 0 .if \\n(BD>0 .DF .nr BD 0 .in \\n(OIu .KE .if t .sp 0.5 .if n .sp 1 .fi .. .de DF \" finish a block display to be recentered. .di .if \\n(dl>\\n(BD .nr BD \\n(dl .if \\n(BD<\\n(.l .in (\\n(.lu-\\n(BDu)/2u .nr EI \\n(.l-\\n(.i .ta \\n(EIuR .DD .in \\n(OIu .. Iu .if \\n(.$ .if !"\\$1"I" .if !"\\$1"" .in +\\$1n .. .de LD .XD .. .de XD .nf .nr OI \\n(.i .if t .sp 0.5 .if n .sp 1 .. .de BD \" block display: save everything, then center it. .XD .nr BD 1 .nf .in \\n(OIu .di Dlib/tmac/tmac.an6n 644 0 33 1062 2111515604 7227 .nr in 5 .de i0 .in \n(in .. .de lp .i0 .ta \\$2 .in \\$1 .ti -\\$2 .. .de s1 .sp 1 .ne 4 .. .de s2 .sp 1 .. .de s3 .sp 1 .. .de fo .ev 1 .sp 1 .tl ''- % -'' .bp .ev .. .de t1 .de x1 'sp 2 'tl '\\$1(\\$2)'\\$3'\\$1(\\$2)' 'sp 1 \\.. .wh -6 fo .wh 0 x1 .in \n(in .. .de sh .s1 .ne 5 .ti 0 \\$1 .br .. .rn bd Bd .de bd .tr __ .ul \\$1 .. .de bn .tr __ .ul \\$1 \c .. .rn it il .de it .tr __ .ul .li \\$1 .. .de dt .ta 8 16 24 32 40 48 56 64 .. .ds b \(*b .ds G \(*G .ds a ' .ds - - .ds _ _ .ds v | .ds ' ' .ds p \(*p .ds r .ds g ` .ds X X .ds u u .ds > -> .ds | in \\$1 .ti -\\$2 .. .de s1 .sp 1 .ne 4 .. .de s2 .sp 1 .. .de s3 .sp 1 .. .de fo .ev 1 .sp 1 .tl ''- % -'' .bp .ev .. .de t1 .de x1 'sp 2 'tl '\\$1(\\$2)'\\$3'\\$1(\\$2)' 'sp 1 \\.. .wh -6 fo .wh 0 x1 .in \n(in .. .de sh .s1 .ne 5 .ti 0 \\$1 .br .. .rn bd Bd .de bd .tr __ .ul \\$1 .. .de bn .tr __ .ul \\$1 \c .. .rn it il .de it .tr __ .ul .li \\$1 .. .de dt .ta 8 16 24 32 40 48 56 64 .. .ds b \(*b .ds G \(*G .ds a ' .ds - - .ds _ _ .ds v | .ds ' ' .ds p \lib/tmac/tmac.an6t 644 0 33 1450 2111515604 7236 .nr in .5i .de CM .po 0 .tl '-' .po .. .de EM .wh -1p CM .. .em EM .de i0 .in \n(inu .. .de lp .tc  .tr  .i0 .ta \\$2/2u .in \\$1/2u .ti -\\$2/2u .. .de s1 .sp .10i .ne 2 .. .de s2 .sp .07i .. .de s3 .sp .07i .ne 2 .. .de fo .ev 1 .ft R .ps 10 .sp .50i .tl ''- % -'' .ft .ps .bp .ev .. .de t1 .de x1 .CM 'ft R 'ps 10 'sp .50i 'tl '\\$1\|(\|\\$2\|)'\\$3'\\$1\|(\|\\$2\|)' 'ft 'ps 'sp .50i \\.. .wh -1i fo .wh 0 x1 .ft R .ps 10 .vs 11p .in \n(inu .. .wh 0 x1 .de sh .s1 .ft B .ps 8 .ti 0 \\$1 .ft .ps .br .. .rn it il .de it 'ft I 'li \\$1 'ft .. .rn bd Bd .de bd 'ft B \\$1 'ft R .. .de bn 'ft B \\$1 \\fR\\ .. .ds b \(*b .ds _ \(ul .ds - \- .ds a \(aa .ds v \(vb .ds p \(*p .ds r \(rg .ds g \(ga .ds | \| .ds X \(mu .ds u \(*m .ds G \(*G .ds > \(-> .de dt .ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 6i .. .lg de x1 .CM 'ft R 'ps 10 'sp .50i 'tl '\\$1\|(\|\\$2\|)'\\$3'\\$1\|(\|\\$2\|)' 'ft 'ps 'sp .50i \\.. .wh -1i fo .wh 0 x1 .ft R .ps 10 .vs 11p .in \n(inu .. .wh 0 x1 .de sh .s1 .ft B .ps 8 .ti 0 \\$1 .ft .ps .br .. .rn lib/tmac/tmac.e 644 0 33 27323 2445266067 6661 ((.nr _0 \n(.c .\"********************************************************************** .\"* * .\"* ****** - M E N R O F F / T R O F F M A C R O S ****** * .\"* * .\"* Produced for your edification and enjoyment by: * .\"* Eric Allman * .\"* Electronics Research Laboratory * .\"* U.C. Berkeley. * .\"* * .\"* VERSION 2.9 First Release: 11 Sept 1978 * .\"* See file \*(||/revisions for revision history * .\"* * .\"* Documentation is available. * .\"* * .\"********************************************************************** .\" .\" @(#)tmac.e 2.9 12/10/80 .\" This version has had comments stripped; an unstripped version is available. .if !\n(.V .tm You are using the wrong version of NROFF/TROFF!! .if !\n(.V .tm This macro package works only on the version seven .if !\n(.V .tm release of NROFF and TROFF. .if !\n(.V .ex .if \n(pf \ . nx \*(||/null.me .de @C .nr _S \\n(.s .nr _V \\n(.v .nr _F \\n(.f .nr _I \\n(.i .ev \\$1 .ps \\n(_Su .vs \\n(_Vu .ft \\n(_F 'in \\n(_Iu .xl \\n($lu .lt \\n($lu .rr _S .rr _V .rr _F .rr _I .ls 1 'ce 0 .. .de @D .ds |p "\\$3 .nr _d \\$1 .ie "\\$2"C" \ . nr _d 1 .el .ie "\\$2"L" \ . nr _d 2 .el .ie "\\$2"I" \ . nr _d 3 .el .ie "\\$2"M" \ . nr _d 4 .el \ . ds |p "\\$2 .. .de @z .if !"\\n(.z"" \ \{\ . tm Line \\n(c. -- Unclosed block, footnote, or other diversion (\\n(.z) . di . ex .\} .if \\n(?a \ . bp .rm bp .rm @b .if t \ . wh -1p @m .br .. .de @I .rm th .rm ac .rm lo .rm sc .rm @I .. .de he .ie !\\n(.$ \ \{\ . rm |4 . rm |5 .\} .el \ \{\ . ds |4 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . ds |5 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .\} .. .de eh .ie !\\n(.$ \ . rm |4 .el \ . ds |4 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. .de oh .ie !\\n(.$ \ . rm |5 .el \ . ds |5 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. .de fo .ie !\\n(.$ \ \{\ . rm |6 . rm |7 .\} .el \ \{\ . ds |6 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . ds |7 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .\} .. .de ef .ie !\\n(.$ \ . rm |6 .el \ . ds |6 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. .de of .ie !\\n(.$ \ . rm |7 .el \ . ds |7 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. .de ep .if \\n(nl>0 \ \{\ . wh 0 . rs . @b .\} .. .de @h .if (\\n(.i+\\n(.o)>=\\n(.l \ . tm Line \\n(c. -- Offset + indent exceeds line length .if t .if (\\n(.l+\\n(.o)>7.75i \ . tm Line \\n(c. -- Offset + line length exceeds paper width .nr ?h \\n(?H .rr ?H .nr ?c \\n(?C .rr ?C .rn |4 |0 .rn |5 |1 .rn |6 |2 .rn |7 |3 .nr _w 0 .nr ?W 0 .nr ?I 1 .ev 2 .rs .if t .@m .if \\n(hm>0 \ . sp |\\n(hmu .if \\n($T=2 \\!. .@t $h .if \\n(tm<=0 \ . nr tm \n(.Vu .sp |\\n(tmu .ev .mk _k .if \\n(?n .nm 1 .nr $c 1 .ie \\n(?s \ \{\ . rr ?s . rs ' @b .\} .el \ . @n .. .de @m .@O 0 .lt 7.5i .tl '\(rn''\(rn' .@O .lt .. .de @n .if \\n(bm<=0 \ . nr bm \\n(.Vu .if (\\n(_w<=\\n($l)&(\\n(?W=0) \ \{\ . nr _b (\\n(ppu*\\n($ru)/2u . if \\n(_bu>((\\n(bmu-\\n(fmu-(\\n(tpu*\\n($ru))/2u) \ . nr _b (\\n(ppu*\\n($ru)-\n(.Vu . nr _b +\\n(bmu .\} .nr _B \\n(_bu .ch @f .wh -\\n(_bu @f .nr ?f 0 .if \\n(?o \ \{\ . (f _ . nf . |o . fi . )f . rm |o .\} .nr ?o 0 .if \\n(?T \ \{\ . nr _i \\n(.i . in \\n($iu . |h . in \\n(_iu . rr _i . mk #T . ns .\} .if (\\n(?a)&((\\n($c<2):(\\n(?w=0)) \ \{\ . nr ?a 0 . @k |t . if \\n(?w \ . mk _k . nr ?w 0 .\} .os .$H .ns .. .de @f .ec .if \\n(?T \ \{\ . nr T. 1 . T# 1 . br .\} .ev 2 .ce 0 .if \\n(?b \ \{\ . nr ?b 0 . @k |b .\} .if \\n(?f \ . @o .ie \\n($c<\\n($m \ . @c .el \ . @e .ev .. .de @o .nf .ls 1 .in 0 .wh -\\n(_Bu @r .|f .fi .if \\n(?o \ . di . if \\n(dn=0 \ \{\ . rm |o . nr ?o 0 . \} . nr dn \\n(_D . rr _D .\} .rm |f .ch @r .. .de @c .rs .sp |\\n(_ku .@O +\\n($lu+\\n($su .nr $c +1 .@n .. .de @e .@O \\n(_ou .rs .sp |\\n(.pu-\\n(fmu-(\\n(tpu*\\n($ru) .@t $f .nr ?h 0 .bp .. .de @t .if !\\n(?h \ \{\ . sz \\n(tp . @F \\n(tf . lt \\n(_Lu . nf . \\$1 . br .\} .. .de $h .rm |z .if !\\n(?c \ \{\ . if e .ds |z "\\*(|0 . if o .ds |z "\\*(|1 .\} .if !\(ts\\*(|z\(ts\(ts \ ' tl \\*(|z .rm |z .. .de $f .rm |z .if \\n(?c \ \{\ . if e .ds |z "\\*(|0 . if o .ds |z "\\*(|1 .\} .if \(ts\\*(|z\(ts\(ts \ \{\ . if e .ds |z "\\*(|2 . if o .ds |z "\\*(|3 .\} .if !\(ts\\*(|z\(ts\(ts \ ' tl \\*(|z .rm |z .. .de @r .di |o .nr ?o 1 .nr _D \\n(dn .ns .. .rn bp @b .de bp .nr $c \\n($m .ie \\n(nl>0 \ . @b \\$1 .el \ \{\ . if \\n(.$>0 \ . pn \\$1 . if \\n(?I \ . @h .\} .br .wh 0 @h .. .rn ll xl .de ll .xl \\$1 .lt \\$1 .nr $l \\n(.l .if (\\n($m<=1):(\\n($l>\\n(_L) \ . nr _L \\n(.l .. .rn po @O .de po .@O \\$1 .nr _o \\n(.o .. .de hx .nr ?H 1 .. .de ix 'in \\$1 .. .de bl .br .ne \\$1 .rs .sp \\$1 .. .de n1 .nm 1 .xl -\w'0000'u .nr ?n 1 .. .de n2 .nm \\$1 .ie \\n(.$ \ . xl -\w'0000'u .el \ . xl \\n($lu .. .de pa .bp \\$1 .. .de ro .af % i .. .de ar .af % 1 .. .de m1 .nr _0 \\n(hmu .nr hm \\$1v .nr tm +\\n(hmu-\\n(_0u .rr _0 .. .de m2 .nr tm \\n(hmu+\\n(tpp+\\$1v .. .de m3 .nr bm \\n(fmu+\\n(tpp+\\$1v .. .de m4 .nr _0 \\n(fmu .nr fm \\$1v .nr bm +\\n(fmu-\\n(_0u .. .de sk .if \\n(.$>0 \ . tm Line \\n(c. -- I cannot skip multiple pages .nr ?s 1 .. .de re .ta 0.5i +0.5i +0.5i +0.5i +0.5i +0.5i +0.5i +0.5i +0.5i +0.5i +0.5i +0.5i +0.5i +0.5i +0.5i .. .if t .ig .de re .ta 0.8i +0.8i +0.8i +0.8i +0.8i +0.8i +0.8i +0.8i +0.8i +0.8i +0.8i +0.8i +0.8i +0.8i +0.8i .. .de ba .ie \\n(.$ \ . nr $i \\$1n .el \ . nr $i \\n(siu*\\n($0u .. .de hl .br \l'\\n(.lu-\\n(.iu' .sp .. .de pp .lp \\n(piu .. .de lp .@p .if \\n(.$ \ . ti +\\$1 .nr $p 0 1 .. .de ip .if (\\n(ii>0)&(\\n(ii<1n) \ . nr ii \\n(iin .nr _0 \\n(ii .if \\n(.$>1 \ . nr _0 \\$2n .@p \\n(_0u .if \\w"\\$1" \ \{\ . ti -\\n(_0u . ie \\w"\\$1">=\\n(_0 \ \{\ \&\\$1 . br . \} . el \&\\$1\h'|\\n(_0u'\c .\} .rr _0 .. .de np .nr $p +1 .ip (\\n($p) .. .de @p .@I .if "\\n(.z"|e" .tm Line \\n(c. -- Unmatched continued equation .in \\n($iu+\\n(pou .if \\n(.$ \ . in +\\$1n .ce 0 .fi .@F \\n(pf .sz \\n(ppu .sp \\n(psu .ne \\n(.Lv+\\n(.Vu .ns .. .de sh .rn sh @T .so \\*(||/sh.me .sh "\\$1" "\\$2" \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 .rm @T .. .de $p .if (\\n(si>0)&(\\n(.$>2) \ . nr $i \\$3*\\n(si .in \\n($iu .ie !"\\$1\\$2"" \ \{\ . sp \\n(ssu . ne \\n(.Lv+\\n(.Vu+\\n(psu+(\\n(spu*\\n($ru*\\n(.Lu) . ie \\n(.$>2 \ . ti -(\\n(siu-\\n(sou) . el \ . ti +\\n(sou . @F \\n(sf . sz \\n(spu . if \\$3>0 \ . $\\$3 . if \w"\\$2">0 \\$2. . if \w"\\$1">0 \\$1\f1\ \ \" .\} .el \ . sp \\n(psu .@F \\n(pf .sz \\n(ppu .. .de uh .rn uh @T .so \\*(||/sh.me .uh "\\$1" .rm @T .. .de 2c .br .if \\n($m>1 \ . 1c .nr $c 1 .nr $m 2 .if \\n(.$>1 \ . nr $m \\$2 .if \\n(.$>0 \ . nr $s \\$1n .nr $l (\\n(.l-((\\n($m-1)*\\n($s))/\\n($m .xl \\n($lu .mk _k .ns .. .de 1c .br .nr $c 1 .nr $m 1 .ll \\n(_Lu .sp |\\n(.hu .@O \\n(_ou .. .de bc .sp 24i .. .de (z .rn (z @V .so \\*(||/float.me .(z \\$1 \\$2 .rm @V .. .de )z .tm Line \\n(c. -- unmatched .)z .. .de (t .(z \\$1 \\$2 .. .de )t .)z \\$1 \\$2 .. .de (b .br .@D 3 \\$1 \\$2 .sp \\n(bsu .@( .. .de )b .br .@) .if (\\n(bt=0):(\\n(.t<\\n(bt) \ . ne \\n(dnu .ls 1 .nf .|k .ec .fi .in 0 .xl \\n($lu .ev .rm |k .sp \\n(bsu+\\n(.Lv-1v .. .de @( .if !"\\n(.z"" .tm Line \\n(c. -- Illegal nested keep \\n(.z .@M .di |k \!'rs .. .de @M .nr ?k 1 .@C 1 .@F \\n(df .vs \\n(.su*\\n($Ru .nf .if "\\*(|p"F" \ . fi .if \\n(_d=4 \ . in 0 .if \\n(_d=3 \ \{\ . in +\\n(biu . xl -\\n(biu .\} .if \\n(_d=1 \ . ce 10000 .. .de @) .br .if !"\\n(.z"|k" .tm Line \\n(c. -- Close of a keep which has never been opened .nr ?k 0 .di .in 0 .ce 0 .. .de (c .if "\\n(.z"|c" .tm Line \\n(c. -- Nested .(c requests .di |c .. .de )c .if !"\\n(.z"|c" .tm Line \\n(c. -- Unmatched .)c .br .di .ev 1 .ls 1 .in (\\n(.lu-\\n(.iu-\\n(dlu)/2u .nf .|c .ec .in .ls .ev .rm |c .. .de (q .br .@C 1 .fi .sp \\n(qsu .in +\\n(qiu .xl -\\n(qiu .sz \\n(qp .. .de )q .br .ev .sp \\n(qsu+\\n(.Lv-1v .nr ?k 0 .. .de (l .br .sp \\n(bsu .@D 3 \\$1 \\$2 .@M .. .de )l .br .ev .sp \\n(bsu+\\n(.Lv-1v .nr ?k 0 .. .de EQ .rn EQ @T .so \\*(||/eqn.me .EQ \\$1 \\$2 .rm @T .. .de TS .rn TS @W .so \\*(||/tbl.me .TS \\$1 \\$2 .rm @W .. .de sz .ps \\$1 .vs \\n(.su*\\n($ru .bd S B \\n(.su/3u .. .de r .nr _F \\n(.f .ul 0 .ft 1 .if \\n(.$ \&\\$1\f\\n(_F\\$2 .rr _F .. .de i .nr _F \\n(.f .ul 0 .ft 2 .if \\n(.$ \&\\$1\f\\n(_F\\$2 .rr _F .. .de b .nr _F \\n(.f .ul 0 .ie t \ . ft 3 .el \ . ul 10000 .if \\n(.$ \&\\$1\f\\n(_F\\$2 .if \\n(.$ \ . ul 0 .rr _F .. .de rb .nr _F \\n(.f .ul 0 .ft 3 .if \\n(.$ \&\\$1\f\\n(_F\\$2 .rr _F .. .de u \&\\$1\l'|0\(ul'\\$2 .. .de q \&\\*(lq\\$1\\*(rq\\$2 .. .de bi .ft 2 .ie t \&\k~\\$1\h'|\\n~u+(\\n(.su/3u)'\\$1\fP\\$2 .el \&\\$1\fP\\$2 .. .de bx .ie \\n($T \&\f2\\$1\fP\\$2 .el \k~\(br\|\\$1\|\(br\l'|\\n~u\(rn'\l'|\\n~u\(ul'\^\\$2 .. .de @F .nr ~ \\$1 .if \\n~>0 \ \{\ . ul 0 . ie \\n~>4 \ \{\ . if n .ul 10000 . if t .ft 3 . \} . el \ . ft \\n~ .\} .rr ~ .. .de (f .rn (f @U .so \\*(||/footnote.me .(f \\$1 \\$2 .rm @U .. .de )f .tm Line \\n(c. -- unmatched .)f .. .de $s \l'2i' .if n \ . sp 0.3 .. .de (d .rn (d @U .so \\*(||/deltext.me .(d \\$1 \\$2 .rm @U .. .de )d .tm Line \\n(c. -- unmatched .)d .. .de (x .rn (x @U .so \\*(||/index.me .(x \\$1 \\$2 .rm @U .. .de )x .tm Line \\n(c. -- unmatched .)x .. .de th .so \\*(||/thesis.me .rm th .. .de +c .ep .if \\n(?o:\\n(?a \ \{\ . bp . rs . ep .\} .nr ?C 1 .nr $f 1 1 .ds * \\*[1\\*]\k* .if \\n(?R \ . pn 1 .bp .in \\n($iu .rs .ie \\n(.$ \ . $c "\\$1" .el \ . sp 3 .. .de ++ .nr _0 0 .if "\\$1"C" \ . nr _0 1 .if "\\$1"RC" \ . nr _0 11 .if "\\$1"A" \ . nr _0 2 .if "\\$1"RA" \ . nr _0 12 .if "\\$1"P" \ . nr _0 3 .if "\\$1"B" \ . nr _0 4 .if "\\$1"AB" \ . nr _0 5 .if \\n(_0=0 \ . tm Line \\n(c. -- Bad mode to .++ .nr ?R 0 .if \\n(_0>10 \ .\{ . nr ?R 1 . nr _0 -10 .\} .nr ch 0 1 .if (\\n(_0=3):(\\n(_0=5) \ . pn 1 .ep .if \\n(_0=1 \ \{\ . af ch 1 . af % 1 .\} .if \\n(_0=2 \ \{\ . af ch A . af % 1 .\} .if \\n(_0=3 \ . af % i .if \\n(_0=4 \ . af % 1 .if \\n(_0=5 \ . af % 1 .if \\n(.$>1 \ . he \\$2 .if !\\n(_0=\\n(_M .if \\n(_M=3 \ . pn 1 .nr _M \\n(_0 .rr _0 .. .de $c .sz 12 .ft B .ce 1000 .if \\n(_M<3 \ . nr ch +1 .ie \\n(_M=1 CHAPTER\ \ \\n(ch .el .if \\n(_M=2 APPENDIX\ \ \\n(ch .if \w"\\$1" .sp 3-\\n(.L .if \w"\\$1" \\$1 .if (\\n(_M<3):(\w"\\$1") \ . sp 4-\\n(.L .ce 0 .ft .sz .ie \\n(_M=1 \ . $C Chapter \\n(ch "\\$1" .el .if \\n(_M=2 \ . $C Appendix \\n(ch "\\$1" .. .de tp .hx .bp .br .((rs .pn \\n% .. .de ac .rn ac @T .so \\*(||/acm.me .ac "\\$1" "\\$2" .rm @T .. .de lo .so \\*(||/local.me .rm lo .. .if \n(mo=1 .ds mo January .if \n(mo=2 .ds mo February .if \n(mo=3 .ds mo March .if \n(mo=4 .ds mo April .if \n(mo=5 .ds mo May .if \n(mo=6 .ds mo June .if \n(mo=7 .ds mo July .if \n(mo=8 .ds mo August .if \n(mo=9 .ds mo September .if \n(mo=10 .ds mo October .if \n(mo=11 .ds mo November .if \n(mo=12 .ds mo December .if \n(dw=1 .ds dw Sunday .if \n(dw=2 .ds dw Monday .if \n(dw=3 .ds dw Tuesday .if \n(dw=4 .ds dw Wednesday .if \n(dw=5 .ds dw Thursday .if \n(dw=6 .ds dw Friday .if \n(dw=7 .ds dw Saturday .ds td \*(mo \n(dy, 19\n(yr .if (1m<0.1i)&(\nx!=0) \ . vs 9p .rr x .nr $r \n(.v/\n(.s .nr $R \n($r .nr hm 4v .nr tm 7v .nr bm 6v .nr fm 3v .nr tf 3 .nr tp 10 .hy 14 .nr bi 4n .nr pi 5n .nr pf 1 .nr pp 10 .nr qi 4n .nr qp -1 .nr ii 5n .nr $m 1 .nr $s 4n .ds || /usr/lib/me .bd S B 3 .ds [ \u\x'-0.25v' .ds ] \d .ds < \d\x'0.25v' .ds > \u .ds - -- .if t \ \{\ . ds [ \v'-0.4m'\x'-0.2m'\s-3 . ds ] \s0\v'0.4m' . ds < \v'0.4m'\x'0.2m'\s-3 . ds > \s0\v'-0.4m' . ds - \- . nr fi 0.3i .\} .if n \ \{\ . nr fi 3n .\} .nr _o \n(.o .if n .po 1i .if \n(.V=1v \ . nr $T 2 .if \n(.T=0 \ . nr $T 1 .if t \ \{\ . nr $T 0 . po -0.5i .\} .if \nv \ . po 1i .if \n($T \ \{\ . if \n($T=1 \ . po 0 . ds [ [ . ds ] ] . ds < < . ds > > .\} .nr ps 0.5v .if \n($T \ . nr ps 1v .if t .nr ps 0.35v .nr bs \n(ps .nr qs \n(ps .nr zs 1v .nr xs 0.2v .nr fs 0.2v .if \n($T \ . nr fs 0 .if n .nr es 1v .if t .nr es 0.5v .wh 0 @h .nr $l \n(.lu .nr _L \n(.lu .nr $c 1 .nr $f 1 1 .ds * \*[1\*]\k*\" .nr $d 1 1 .ds # [1]\k#\" .nr _M 1 .ds lq \&"\" .ds rq \&"\" .if t \ . ds lq `` .if t \ . ds rq '' .em @z .de sc .so \\*(||/chars.me .rm sc .. .ll 6.0i .lt 6.0i .5i .\} .if \nv \ . po 1i .if \n($T \ \{\ . if \n($T=1 \ . po 0 . ds [ [ . ds ] ] . ds < < . ds > > .\} .nr ps 0.5v .if \n($T \ . nr ps 1v .if t .nr ps 0.35v .nr bs \n(ps .nr qs \n(ps .nr zs 1v .nr xs 0.2v .nr fs 0.2v .if \n($T \ . nr fs 0 .if n .nr es 1v .if t .nr es 0.5v .wh 0 @h .nr $l \n(.lu .nrlib/tmac/tmac.r 644 0 33 2354 2111515623 6634 .de HD .ps 10 .ft 1 .if t .tl '\(rn''' .if t 'sp \\n(m1-1 .if n 'sp \\n(m1 .if e .1e .if o .1o .ps .ft 'sp \\n(m2 .if \\n(:n .nm 1 1 2 .ns .. .wh 0 HD .de FT 'sp \\n(m3 .ps 10 .ft 1 .if e .2e .if o .2o .ps .ft 'bp .. .wh -1i FT .de m1 .nr m1 \\$1 .. .de m2 .nr m2 \\$1 .. .de m3 .nr m3 \\$1 .ch FT -\\n(m3-\\n(m4 .. .de m4 .nr m4 \\$1 .ch FT -\\n(m3-\\n(m4 .. .m1 3 .m2 2 .m3 2 .m4 3 .de he .de 1e .tl \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 \\.. .de 1o .tl \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 \\.. .. .de fo .de 2e .tl \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 \\.. .de 2o .tl \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 \\.. .. .de eh .de 1e .tl \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 \\.. .. .de oh .de 1o .tl \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 \\.. .. .de ef .de 2e .tl \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 \\.. .. .de of .de 2o .tl \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 \\.. .. .he '''' .fo '''' .de bl .rs .sp \\$1 .. .de n1 .n2 \\$1 .nr :n 0 .if \\n(.$ .nr :n 1 .. .de n2 .if \\n(.$ .if \\$1=0 .nm .if \\n(.$ .if !\\$1=0 .nm \\$1 1 2 .if !\\n(.$ .nm 1 1 2 .. .rn ds :d .de ds .if \\n(.$ .:d \\$1 "\\$2\\$3\\$4\\$5\\$6\\$7\\$8\\$9 .if !\\n(.$ .ls 2 .. .de ss .ls 1 .. .de EQ .nf .sp .. .de EN .sp .fi .. \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 \\.. .. .de ef .de 2e .tl \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 \\.. .. .de of .de 2o .tl \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 \\.. .. .he '''' .fo '''' .de bl .rs .sp \\$1 .. .de n1 .n2 \\$1 .nr :n 0 .if \\n(.$ .nr :n 1 .. .dlib/tmac/tmac.scover 644 0 33 10313 2256427600 7715 . \"OK - "other keywords" for cover sheet. .de OK .br .di .di OD .nf .ft 3 .. . \"CS - spew out cover sheet .de CS .br .if \\n(AJ>0 .tm Abstract not finished, AE assumed. .if \\n(AJ>0 .AE .di .if t .po 0.5i .ft 2 .nr IB \\n(.b .ft P .nr K1 1 .if t .sp |.4i .if t .lg .ll 7.0i .vs 12p .nf .if t \h'7n'\s24\(bs\s12\f3 Bell Laboratories \s16\f1Cover Sheet for Technical Memorandum .if n Bell Laboratories Cover Sheet for Technical Memorandum .if t .sp .5v .if n .sp .if t \s6\l'7i' .fi .ps 9 .ft 2 .if t .sp 2p .if \\n(.$<=6 The information contained herein is for the use of employees of Bell Laboratories and is not for publication. (See GEI 13.9-3)\p .if \\n(.$>6 Warning: studying this document may cause drowsiness. Do not read before driving or operating machinery. (See GEI 13.9-3)\p .ft 1 .nf .if \\n(IB>0 .bd 2 \\n(IB .if t \s6\l'7i' .if t .sp .5v .if n .sp .if t .ll 4.0i .if n .ll 30 .if t .po 1.0i .ps 9 .if t .ta 0.5i 4.5i 4.9i .if n .ta 9 39 46 .mk Title- \f3\s10 .rt .if t .in 0.5i .if n .in 10 .hy 0 .WT .hy 14 .br .rt .ll \\n(LLu .if t .in 4.5i .if n .in 40 .nf \s9\f1Date- \s10\f3 .rt .if t .in 4.9i .if n .in 47 \\*(DY .sp .if t .ti 4.5i .if n .ti 40 .mk \s9\f1TM- \f3\s10 .br .rt .CZ \\*(MN .in 0 .sp |\\n(.hu+1v .mk \s9\f1Other Keywords- \f3 .rt .if t .in 1.1i .if n .in 20 .OD .in 0 .if t .sp .7i .if n .sp 3 .ps 9 .if t .ta 1.8i 3.3i 4.3i .if n .ta 19 34 44 .ft 1 .mk .fi .ll 6.7i .in 4.6i .ti 0 .nr SJ \\n(.j .na Author Location Extension Charging Case- \s10\f3\\*(CA .ps 10 .ti 4.3i \f1\s9Filing Case- \s10\f3\\*(CC .nf .in 0 .ad \\n(SJ .rt .sp 1 .CB 1 .if \\n(NA-1 .CB 2 .if \\n(NA-2 .CB 3 .if \\n(NA-3 .CB 4 .if \\n(NA-4 .CB 5 .if \\n(NA-5 .CB 6 .if \\n(NA-6 .CB 7 .if \\n(NA-7 .CB 8 .if \\n(NA-8 .CB 9 .ft 1 .rm OK OD R1 E1 R2 E2 R3 E3 R4 E4 AB AE .ds K1 \\$1 .ds K2 \\$2 .ds K3 \\$3 .ds K4 \\$4 .ds K5 \\$5 .ds K6 \\$6 .wh 9.8i CG .ch FO 16i .if t .sp .4i .if n .sp 2 .ls 1 .pn 2 .WB .rm WB .ls .br .if 9.7i-\\n(nlu-\\n(FPu-1v>0 .sp 9.7i-\\n(nlu-\\n(FPu-1v .if \\n(FP>0 .FA .FG .nr K1 0 .if \\n(GA=1 .nr GA 2 .if \\n(VS>40 .vs \\n(VSu .if \\n(VS<=39 .vs \\n(VSp .bp 1 .rm CG .if t .po \\n(POu .. . \" CG - write bottom box on cover sheet .de CG .if t .po 0.5i .vs 12p .ch FO 12i .ch FX 12i .if t .ll 7i .br .if t \l'7i' .if t .ta 1.4i 2.8i 4.2i .if n .ta 14 29 44 .if t .sp 8p .if n .sp Pages Text \\*(K1 Other \\*(K2 Total \\*(K3 .if t .sp 8p .if n .sp .if t .po .5i .if t No. Figures \\*(K4 No. Tables \\*(K5 No. Refs. \\*(K6 \b'|||||\ \ ' .if n No. Figures \\*(K4 No. Tables \\*(K5 No. Refs. \\*(K6 .br .if t .po .5i .if t \l'7i' .ps 7 .br .if n .sp .rm K1 .rm K2 .rm K3 .rm K4 .rm K5 .rm K6 .if t .po .5i .if t .tl 'E-1932-U (6-73)'SEE REVERSE SIDE FOR DISTRIBUTION LIST'' .if n .tl 'E-1932-U (6-73) SEE REVERSE SIDE FOR DISTRIBUTION LIST''' .if t .po 0.5i .ll \\n(LLu .ps 10 .ch CG 12i .if \\n(K1>0 .bp .. . \"CB - help with cover sheet .de CB .br .mk .A\\$1 .rt \& \\*(R\\$1 \\*(E\\$1 .br .. .de CZ .br .if !"\\$1"" \\$1 .br .if !"\\$2"" \\$2 .br .if !"\\$3"" \\$3 .br .if !"\\$4"" \\$4 .br .if !"\\$5"" \\$5 .br .if !"\\$6"" \\$6 .br .if !"\\$7"" \\$7 .br .if !"\\$8"" \\$8 .br .if !"\\$9"" \\$9 .. . \"S1 - tm style .de S1 .br .if t .ta 4.75i .if n .ta 46 .ll 80 .ps 36 .br .if t .vs .35i .if t \t\(bs .br .if n .sp 24p .ps 12 .br .ft 3 \tBell Laboratories .ft 1 .nr SJ \\n(.j .na .br .ps 8 .vs 12p .sp 2v .mk .ll .ll 4.0i Subject: .ft 3 .br .rt .if n .in +9 .if t .in +\w'Subject: 'u .ps .nf .hy 0 .WT .hy 14 .ft 1 .fi .in 0 .if \\n(MC>0 \\s8Case- \\*(CA\\s10 .if \\n(MG>0 --\s8 File- \\*(CC\\s10 .br .rt .if n .ll 70 .if t .ll 6.5i .if t .in 5.10i .if n .in 52 .ps 8 .ti -6n .ta 6n date:\t\\s\\n(PS\\f3\\*(DY .sp .ft 1 .ps 8 .mk .ti -6n from: .ps .br .rt .nf .ft 3 .A1 .if \\n(NA>1 .A2 .if \\n(NA>2 .A3 .if \\n(NA>3 .A4 .if \\n(NA>4 .A5 .if \\n(NA>5 .A6 .if \\n(NA>6 .A7 .if \\n(NA>7 .A8 .if \\n(NA>8 .A9 .ft 1 .sp .mk .ps 8 .ti -6n .ft 1 .if \\n(IM=0 .if \\n(MM .if "\\*(MQ"" \{\ .if \\n(MN=0 .ds MQ TM: .if \\n(MN=1 .ds MQ MF: .if \\n(MN=2 .ds MQ MR: .if \\n(MN=3 .ds MQ EN:\} \\*(MQ .br .ti \\n(.iu .rt .ps .ft 3 .hy 0 .ll 20i .if t .ll 7.75i-\\n(.ou .fi .na .if \\n(MM .CZ \\*(MN .hy 14 .nf .ft 1 .ll \\n(LLu .in .sp |\\n(.hu .if \\n(IM=0 .sp .ad \\n(SJ .ce .ft 2 .if \\n(IM=0 \\*(QF .ft 1 .ce 0 .if \\n(IM=0 .sp .fi .. A>3 .A4 .if \\n(NA>4 .A5 .if \\n(NA>5 .A6 .if \\n(NA>6 .A7 .if \\n(NA>7 .A8 .if \\n(NA>8 .A9 .ft 1 .sp .mk .ps 8 .ti -6n .ft 1 .if \\n(IM=0 .if \\n(MM .if "\\*(MQ"" \{\ .if \\n(MN=0 .ds MQ TM: .if \\n(MN=1 .ds MQ MF: .if \\n(MN=2 .ds MQ MR: .if \\n(MN=3 .ds MQ EN:\} \\*(MQ .br .ti \\n(.iu .rt .ps .ft 3 .hy 0lib/tmac/tmac.vgrind 755 0 33 1245 2512700137 7666 'ss 23 'ds _ \d\(mi\u 'ps 9p 'vs 10p 'ds - \(mi 'ds /* \\h'\\w' 'u-\\w'/'u'/* 'bd B 3 'bd S B 3 'nr cm 0 'nf 'wh 0 he 'de he 'ev 2 'tl '\-\-''\-\-' 'ft 1 'sp .35i 'tl '\s14\f3\\*(=F\fP\s0'\\*(=H'\f3\s14\\*(=F\fP\s0' 'sp .25i 'ft 1 \f2\s12\h'\\n(.lu-\w'\\*(=f'u'\\*(=f\fP\s0\h'|0u' .sp .05i 'ev 'ds =G \\*(=F .. 'wh -1i fo 'de fo 'ev 2 'sp .35i 'tl '\f2\\*(=M''Page % of \\*(=G\fP' 'bp 'ev 'ft 1 'if \\n(cm=1 'ft 2 .. 'de () 'pn 1 .. 'de +C 'nr cm 1 'ft 2 'ds +K 'ds -K .. 'de -C 'nr cm 0 'ft 1 'ds +K \f3 'ds -K ((\fP .. '+C '-C 'am +C 'ne 3 .. 'de FN \f2\s14\h'\\n(.lu-\w'\\$1'u'\\$1\fP\s0\h'|0u'\c .if \\nx .tm \\$1 \\*(=F \\n% 'ds =f \&...\\$1 .. 'de -F 'rm =f .. 'ft 1 'lg 0 l '\s14\f3\\*(=F\fP\s0'\\*(=H'\f3\s14\\*(=F\fP\s0' 'sp .25i 'ft 1 \f2\s12\h'\\n(.lu-\w'\\*(=f'u'\\*(=f\fP\s0\h'|0u' .sp .05i 'ev 'ds =G \\*(=F .. 'wh -1i fo 'de fo 'ev 2 'sp .35i 'tl '\f2\\*(=M''Page % of \\*(=G\fP' 'bp 'ev 'ft 1 'if \\n(cm=1 'ft 2 .. 'de () 'pn 1 .. 'de +C 'nr cm 1 'ft 2 'ds +K 'ds -K .. 'de -C 'nr cm 0 'ft 1 'ds +K \f3 'ds -K lib/tmac/tmac.an.new 644 0 33 10205 2420510770 7574 ' # month name .if "\nd"0" .nr m \n(mo-1 .if "\nm"0" .ds ]m January .if "\nm"1" .ds ]m February .if "\nm"2" .ds ]m March .if "\nm"3" .ds ]m April .if "\nm"4" .ds ]m May .if "\nm"5" .ds ]m June .if "\nm"6" .ds ]m July .if "\nm"7" .ds ]m August .if "\nm"8" .ds ]m September .if "\nm"9" .ds ]m October .if "\nm"10" .ds ]m November .if "\nm"11" .ds ]m December ' # set the date .if n \{.nr m \nm+1 . ie \nd .ds ]W Modified \nm/\nd/\ny . el .ds ]W Printed \n(mo/\n(dy/\n(yr\} .if t \{.ie \nd .ds ]W \*(]m \nd, 19\ny . el .ds ]W \*(]m \n(dy, 19\n(yr\} .if t .tr *\(** .ie n \{\ . ds lq \&"\" . ds rq \&"\" .\} .el \{\ . ds rq '' . ds lq `` .\} .de UC .if t \{\ . ie "\\$1"" .ds ]W 3rd Berkeley Distribution . el .ds ]W \\$1th Berkeley Distribution .\} .. ' # reset the basic page layout .de }E .}f .in \\n()Ru+\\n(INu .ll \\n(LLu .. ' # default tabs .de DT 'ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i .. ' # set type font and size .de }f .ps 10 .ft 1 .. ' # handle the head of the page .de }H .ev 1 .}C 'sp .5i .ft 1 .ps 10 .tl @\\*(]H@\\*(]D@\\*(]H@ 'sp .5i .ev .ns .. ' # handle the foot of the page .de }F .ev 1 .ft 1 .ps 10 'sp .5i .tl @\\*(]W@\\*(]L@%@ 'bp .ev .. ' # the cut mark .if n .ig .de }C .po .1i .tl '-' .po .. ' # the final cut mark .de }M .}N .wh -1p }C .ll \\n(LLu .. ' # no runout unless there was a .TH .de }K .}N .pl 1 .ll \\n(LLu .. .em }K ' # set title and heading .de TH .PD .DT .if n .nr IN .5i .if t .nr IN .5i .nr LL \\n(.l .ds ]H \\$1\|(\|\\$2\|) .ds ]D UNIX Programmer's Manual .wh 0 }H .if t .wh -1i }F .if n .wh -1.167i }F .em }M .if \\n(nl .bp 1 .ds ]L \\$3 .}E .DT .nr )I .5i .nr )R 0 .if n .na .mk ka .if !'\\n(ka'-1' .bp .if t .ds ]W 7th Edition .. ' # section heading .de SH .}X 0 .nr )E 2 \&\\$1 \|\\$2 \|\\$3 \|\\$4 \|\\$5 \|\\$6 .. ' # sub section heading .de SS .}X \\n()Ru+\\n(INu \&\\$1 \|\\$2 \|\\$3 \|\\$4 \|\\$5 \|\\$6 .br .. ' # subroutine for section heading .de }X .}E .ti \\$1 .sp \\n()Pu .ne 2 .nr )R 0 .fi .it 1 }N .SM .B .. ' # end of SH (cf }X above and }N below) .de }2 .nr )E 0 .}E .nr )I .5i .ns .. ' # italic .de I .ft 2 .it 1 }N .if !"\\$1"" \&\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 .. ' # bold .de B .ft 3 .it 1 }N .if !"\\$1"" \&\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 .. ' # small .de SM .ps 9 .it 1 }N .if !"\\$1"" \&\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 .. ' # combinations of Roman, italic, bold .de RI .}S 1 2 \& "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" .. .de VS 'if '\\$1'4' .mc \s12\(br\s0 .. .de VE 'mc .. .de RB .}S 1 3 \& "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" .. .de IR .}S 2 1 \& "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" .. .de IB .}S 2 3 \& "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" .. .de BR .}S 3 1 \& "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" .. .de BI .}S 3 2 \& "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" .. ' # make special case of shift out of italic .de }S .ds ]F .if "\\$1"2" .if !"\\$5"" .ds ]F\^ .ie !"\\$4"" .}S \\$2 \\$1 "\\$3\f\\$1\\$4\\*(]F" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9" .el \\$3 .}f .. ' # paragraph .de LP .PP .. .de PP .sp \\n()Pu .ne 2 .}E .nr )I .5i .ns .. ' # paragraph distance .de PD .if t .nr )P .4v .if n .nr )P 1v .if !"\\$1"" .nr )P \\$1v .. ' # hanging indent .de HP .sp \\n()Pu .ne 2 .if !"\\$1"" .nr )I \\$1n .ll \\n(LLu .in \\n()Ru+\\n(INu+\\n()Iu .ti \\n()Ru+\\n(INu .}f .. ' # indented paragraph .de IP .TP \\$2 \&\\$1 .. ' # hanging label .de TP .if !"\\$1"" .nr )I \\$1n .sp \\n()Pu .in \\n()Ru .nr )E 1 .ns .it 1 }N .di ]B .. ' # end of TP (cf }N below) .de }1 .ds ]X \&\\*(]B\\ .nr )E 0 .if !"\\$1"" .nr )I \\$1n .}f .ll \\n(LLu .in \\n()Ru+\\n(INu+\\n()Iu .ti \\n(INu .ie !\\n()Iu+\\n()Ru-\w@\\*(]X@u-3p \{\\*(]X .br\} .el \\*(]X\h@|\\n()Iu+\\n()Ru@\c .}f .. ' # handle end of 1-line features .de }N .if \\n()E .br .di .if "\\n()E"0" .}f .if "\\n()E"1" .}1 .if "\\n()E"2" .}2 .nr )E 0 .. ' # increase relative indent .de RS .nr ]\\n+()p \\n()I .nr )\\n()p \\n()R .ie !"\\$1"" .nr )R +\\$1n .el .nr )R +\\n()I .nr )I .5i .}E .. ' # decrease relative indent .de RE .if !"\\$1"" \{.ie "\\$1"0" .nr )p 1 1 . el .nr )p \\$1 1\} .ds ]i \\*(]I\\n()p .ds ]r \\*(]R\\n()p .nr )I \\*(]i .nr )R \\*(]r .if \\n()p .nr )p -1 .}E .. .nr )p 0 1 .ds ]I \\\\n(] .ds ]R \\\\n() .bd S 3 3 .if t .ds R \(rg .if n .ds R (Reg.) .ds S \s10 .hy 14 r .di .if "\\n()E"0" .}f .if "\\n()E"1" .}1 .if "\\n()E"2" .}2 .nr )E 0 .. ' # increase relative indent .de RS .nr ]\\n+()p \\n()I .nr )\\n()p \\n()R .ie !"\\$1"" .nr )R +\\$1n .el .nr )R +\\n()I .nr )I .5i .}E .. ' # decrease relative indent .de RE .if !"\\$1"" \{.ie "\\$1"0" .nr )p 1 1 . el .nr )p \\$1 1\} .ds ]i \\*(]I\\n()p .ds ]r \\*(]R\\n()p .nr )I \\*(]i .nr )R \\*(]r lib/tmac/tmac.vcat 644 0 33 46 2311037510 7260 .fp 1 R .fp 2 I .fp 3 B .fp 4 S .lg 2 .ds ]I \\\\n(] .ds ]R \\\\n() .bd S 3 3 .if t .ds R \(rg .if n .ds R (Reg.) .ds S \s10 .hy 14 r .di .if "\\n()E"0" .}f .if "\\n()E"1" .}1 .if "\\n()E"2" .}2 .nr )E 0 .. ' # increase relative indent .de RS .nr ]\\n+()p \\n()I .nr )\\n()p \\n()R .ie !"\\$1"" .nr )R +\\$1n .el .nr )R +\\n()I .nr )I .5i .}E .. ' # decrease relative indent .de RE .if !"\\$1"" \{.ie "\\$1"0" .nr )p 1 /( ,( 5܉ /\@,\D"lib/tmac/tmac.a 664 0 33 16725 2551543375 6661 .\" ********** dictionary ********** .\" B0 size of wide figure just diverted .\" B1 size of figure at top full wdith .\" B2 if figure at full width bottom .\" B3 name of full width top figure for next page .\" B4 full width bottom figure .\" B5 wide top figure size scheduled for this page .\" B6 true if a wide figure being diverted .\" B8 if at EM end up macro stage .\" B9 if at page bottom .\" BM width bottom margin .\" BX full width top figure, this page .\" CE end caption. .\" CP store caption. .\" CS begin caption; center if 1 line, else paragraph. .\" CW column width .\" D1 amount of text left column .\" D2 amount of text right column .\" D3 arithmetic scratch, typically whether went past page footer .\" D9 scratch, remembers length of diverted keep .\" DN name of current diversion trap .\" DO default page offset .\" EE string to be prefixed to an equation to indent it two spaces if wanted .\" EL equation label .\" EZ rathole to throw equations down .\" F0 argument to GS specifying quadrant .\" F1 biggest space available in left column .\" F2 biggest space available in right column .\" F5 position of top of 2 2col section .\" F6 argument to BS specifying top/bottom .\" G0 (1) count authors .\" (2) size of just entered figure .\" G1 size figure top left next page .\" G2 size figure top right next page .\" G3 size left bottom figure .\" G4 size right bottom figure .\" G5 true if next top narrow figure goes to right side (next page) .\" G6 true if next bottom narrow figure goes to right side .\" G7 (1) amount space before bottom wide figure to sit on baseline .\" (2) flag for doubled up narrow figures into a wide one .\" G8 true if figure has been placed .\" G9 if at page top .\" GD buffer where narrow figure is placed .\" GJ figure top left next page .\" GK figure top right next page .\" GL content left bottom figure .\" GM content right bottom figure .\" GP left half of a figure pair .\" GQ right half of a figure pair .\" H0 section numbers for numbered headings .\" H1 size of figure at top left this page .\" H2 size of figure top right this page .\" HJ figure at top left this page .\" HK figure at top right this page .\" HS true if just at a section heading .\" IK true if inside a KS/KE .\" L1 shortest legal amount of two column material .\" L2 amount of 2 column stuff expected .\" L4 amount being diverted .\" L5 amount of text diverted in double-column hunt .\" L6 zero if right column, true if too short to split up .\" L7 minimum length of a split column .\" LC position of left column bottom .\" LE computation of column lengths \" LE should be F3 .\" LE true if equations are labeled .\" LH left running head .\" LL line length .\" LS general looseness parameter .\" MX expand month name .\" NB number of columns possible .\" NC number of columns being set .\" ND have been in double column before, not first break to it. .\" NU issue number .\" P1 (1) height left col .\" (2) amount to pad total .\" P2 height right column .\" P3 am((ount of extra space at a 1C-2C transition .\" P4 temporary in filling columns calcuations .\" PS standard point size .\" Q1 number of places to pad .\" Q2 number padding points right column .\" RO position of right column (offset for) .\" S1 position of space in column .\" S2 size of space .\" T1 true if top figure position forced by GS arg .\" T2 true if bottom figure position forced by GS arg .\" TB true if there is to be a turnover bar here. .\" TP true if still at document title (turnover bar decision) .\" TQ position at top of page .\" TT >0 if figure, etc. doesn't fit this page .\" TT right running head (title) .\" TW table width (set by TBL) .\" VN volume number .\" VS standard vertical spacing .\" GW gutter width .\" X1 diversion to hold left column .\" X2 diversion to hold right column .\" XI value of indent to be restored after abstract .\" XQ register in which padding points are counted .\" XR true (1) if past the very first paragraph .\" XX diversion to hold input text in preparation for formatting .\" YE past very top: avoids a break in the EQ/EN macro before startup. .\" ZN size of equation .\" mo month name .\" y place of footer trap .\" .\" .\" ********** environments ********* .\" 0 normal .\" 1 figures .\" 2 while columns are arranged .\" .\" .\" ********** macros ********** .\" for user which invoke .\" TL,AU,AI,AB,AE IZ, EA, AX, AY .\" EQ, EN @L, @C, @I .\" TS,TE .\" SP, PP FI, NX, RT .\" 2C 2D, 2S, C4, C3, LA .\" 1C 1D, 1E, 1S, C6, C7 .\" ST, LS CL .\" SL .\" GS, GE GA,GB,GG,GU,GV,GW,GX,GY,GZ,GN,GO,C8,MR,BR .\" BS,BE BA,BB,BC,BD .\" KS,KE KU,KT .\" CS,CE CP .\" SH,NH .\" B, I, R .\" UL .\" ne NE .\" EM, NP, FO, CM .\" .nr B9 1 .\" ----------------------------- .de RT \" reset params to normal state .ce 0 .ul 0 .ti 0 .if \\n(IP .in -\\n(IQn .if \\n(IP .nr IP -1 .ft 1 .if \\n(AJ=0 .ps \\n(PS .if \\n(AJ=0 .vs \\n(VSp .fi .. .\" ----------------------------- .de IZ \"initialization .MX .rm MX .if !\\n(BM .nr BM 1.13i .nr y 0-\\n(BM .if \\n(DO=0 .nr DO .4i .wh 0 NP .po \\n(DOu .nr IP 0 .if !\\n(PS .nr PS 9 .if !\\n(L1 .nr L1 1.5i \"minimum amount of double column .if !\\n(VS .nr VS 11 .ps \\n(PS .vs \\n(VSp .if !\\n(PI .nr PI 2n .if !\\n(PD .nr PD 0 .if !\\n(CW .nr CW 3.1i .if !\\n(GW .nr GW 0.4i .nr RO \\n(CWu+\\n(GWu .nr YE 1 .nr LL \\n(RO+\\n(CW .ll \\n(LLu .lt \\n(LLu .nr NC 1 .nr NB 1 .wh \\nyu FO .. .\" ----------------------------- .de EQ \"equation, breakout and display .nr EF \\n(.u .rm EE .nr LE 1 \" 1 is center .ds EL \\$1 .if "\\$1"L" .ds EL \\$2 .if "\\$1"L" .nr LE 0 .if "\\$1"C" .ds EL \\$2 .if "\\$1"I" .nr LE 0 .if "\\$1"I" .ds EE \\h'4n' .if "\\$1"I" .if !"\\$3"" .ds EE \\h'\\$3' .if "\\$1"I" .ds EL \\$2 .if \\n(YE>0 .nf .di EZ .. .\" ----------------------------- .de EN \" end of a displayed equation .if !"\\n(.z"EZ" .tm EN not preceded by EQ, disaster follows. .br .ce 0 .di .rm EZ .nr ZN 1 .if "\\*(10"" .nr ZN 0 .if \\n(ZN=0 .if !"\\*(EL"" .nr ZN 1 .lt \\n(.lu .br .if \\n(ZN>0 .if !\\n(.d=\\n(PE .SP 0.5 .pc .if \\n(BD>0 .nr LE 0 \" can't mean centering in this case. .if \\n(ZN>0 .if \\n(LE>0 .tl \(ts\(ts\\*(10\(ts\\*(EL\(ts .if \\n(ZN>0 .if \\n(LE=0 .if \\n(BD=0 .tl \(ts\\*(EE\\*(10\(ts\(ts\\*(EL\(ts .if \\n(ZN>0 .if \\n(LE=0 .if \\n(BD>0 \!\\*(10\\\\t\\*(EL .if \\n(ZN>0 .if \\n(LE=0 .if \\n(BD>0 .if \\n(BD<\\w'\\*(10' .nr BD \\w'\\*(10' .lt \\n(LLu .pc % .br .if \\n(YE>0 .if \\n(EF>0 .fi .rm EL .if \\n(ZN>0 .SP 0.5 .nr PE \\n(.d .. .\" ----------------------------- .de TL \"title of document .IZ .rm IZ .br .if \\n(XR>0 .EA .ll \\n(LLu .ft 3 .ps 11 .if \\n(PS=9 .nr y -3v .ce 1000 .nr TP 1 .nr G0 0 .bd 1 3 .bd 2 3 .if !"xx\\n(.z"xx" \!.bd 1 3 .if !"xx\\n(.z"xx" \!.bd 2 3 .. .\" ----------------------------- .de AU \"author(s) name(s) .ft 1 .br .bd 1 .bd 2 .if !"xx\\n(.z"xx" \!.bd 1 .if !"xx\\n(.z"xx" \!.bd 2 .if !\\n(G0 .sp .if \\n(G0 .sp .5 .if \\n(G0 and .if \\n(G0 .sp .5 .nr G0 +1 .ps \\n(PS .. .\" ----------------------------- .de AI \"authors institution .ft 2 .ps \\n(PS-1 .. .\" ----------------------------- .de AB \"abstract start .ce 0 .ll \\n(LLu .fi .ft 1 .sp .nr XI \\n(.i .nr AJ 1 .in +\\n(.lu/8u .ll -\\n(.lu/8u .nr PS -1 .ps \\n(PS .nr VS -1 .vs \\n(VSp .ti +2n .. .\" ----------------------------- .de AE \"abstract end .ll \\n(LLu .in \\n(XIu .ce 0 .nr PS +1 .ps \\n(PS .nr VS +1 .vs \\n(VSp .nr AJ 0 .if !\\n(.d=\\n(nl .AX .if \\n(PS=9 .sp 2 .nr XR 0 .nr ND 0 .2C .. .\" No default table macro now. .\" . ----------------------------- .\" .de TS \"table start -1 .. .\" ----------------------------- .dlib/tmac/tmac.cp 664 0 33 4127 2551543375 7014 .nr PS 9 .nr VS 11 .ps \\n(PS .vs \\n(VS .nr DO .4i .po \n(DOu .nr CW 3.3i .nr WG 0.25i .rm PF .nr CP 1 .nr NT 1 \" no turnover bar .nr PQ \n(PS .nr BM 1i .de MX \" expand month name .if \\n(mo-0 .ds mo J\\\\s-2ANUARY\s0 .if \\n(mo-1 .ds mo F\\\\s-2EBRUARY\\\\s0 .if \\n(mo-2 .ds mo M\\\\s-2ARCH\\\\s0 .if \\n(mo-3 .ds mo A\\\\s-2PRIL\\\\s0 .if \\n(mo-4 .ds mo M\\\\s-2AY\\\\s0 .if \\n(mo-5 .ds mo J\\\\s-2UNE\\\\s0 .if \\n(mo-6 .ds mo J\\\\s-2ULY\\\\s0 .if \\n(mo-7 .ds mo A\\\\s-2UGUST\\\\s0 .if \\n(mo-8 .ds mo S\\\\s-2EPTEMBER\\\\s0 .if \\n(mo-9 .ds mo O\\\\s-2CTOBER\\\\s0 .if \\n(mo-10 .ds mo N\\\\s-2OVEMBER\\\\s0 .if \\n(mo-11 .ds mo D\\\\s-2ECEMBER\\\\s0 .. .if \nM=1 .so /usr/mel/aip/countrev .if \nM=2 .so /usr/mel/aip/findbig .if \nM=0 .so /usr/lib/tmac/tmac.a .br .af % 1 .CM .sp 1i .IZ .rm IZ .de FS .nr FP 3 .if \\n(.d*2>\\n(L4 .nr FP 4 .if \\n(NC=1 .nr FP 2 .GS \\n(FP .br \l'2i' .br .af % 1 .. .de FE .GE .. .ad .de AE \"abstract end .ll \\n(LLu .in \\n(XIu .ce 0 .if !\\n(.d=\\n(nl .AX .nr AJ 0 .nr XR 0 .nr ND 0 .sp 1 .. .de AB \"abstract start .ce 0 .ll \\n(LLu .fi .ft 1 .sp .nr XI \\n(.i .in +\\n(.lu/8u .nr AJ 1 .ll -\\n(.lu/8u .ti +2n .nr XR 1 .. .de MH Bell Laboratories Murray Hill, New Jersey 07974 .. .de RT \" reset params to normal state .ce 0 .ul 0 .ti 0 .bd 1 .if !"\\n(.z"" \!.bd 1 .if \\n(IP .in -\\n(IQn .if \\n(IP .nr IP -1 .ft 1 .if \\n(AJ=0 .ps \\n(PS .if \\n(AJ=0 .vs \\n(VSp .RZ .fi .. .de SH \" (unnumbered) section heading .RT .ne 3 .SP 1 .ft 3 .ce 1000 .nr XR 1 .nr HS 1 .. .de B .nr PQ \\n(.f .if t .ft 3 .if "\\$1"" .if n .ul 1000 .if !"\\$1"" .if n .ul 1 .if t .if !"\\$1"" \\$1\\f\\n(PQ\\$2 .if n .if \\n(.$=1 \\$1 .if n .if \\n(.$>1 \\$1\\c .if n .if \\n(.$>1 \\&\\$2 .. .de I .nr PQ \\n(.f .if t .ft 2 .if "\\$1"" .if n .ul 1000 .if !"\\$1"" .if n .ul 1 .if t .if !"\\$1"" \\$1\\f\\n(PQ\\$2 .if n .if \\n(.$=1 \\$1 .if n .if \\n(.$>1 \\$1\\c .if n .if \\n(.$>1 \\&\\$2 .. .so /usr/lib/tmac/tmac.srefs .rm CS CE .de UX .ie \\n(GA>0 \s-2UNIX\s0\\$1 .el \{\ .if n UNIX\\$1* .if t UNIX\\$1\\f1\(dg\\fP .FS .if n *UNIX .if t \(dgUNIX is a Trademark of Bell Laboratories .FE .nr GA 1\} .. \\$1\\f\\n(PQ\\$2 .if n .if \\n(.$=1 \\$1 .if n .if \\n(.$>1 \\$1\\c .if n .if \\n(.$>1 \\&\\$2 .. .de I .nr PQ \\n(.f .if t .ft 2 .if "\\$1"" .if n .ul 1000 .if !"\\$1"" .if n .ul 1 .if t .if !"\\$1"" \\$1\\f\\n(PQ\\$2 .if n .if \\n(.$=1 \\$1 .if n .if \\n(.$>1 \\$1\\c .if n .if \\n(.$>1 \\&\\$2 .. .so /usr/lib/tmac/tmac.srefs .rm CS CE .de UX .ie \\n(GA>0 \s-2UNIX\s0\\$1 .el \{\ .if n UNIX\\$1* .if t UNIX\\$1\\f1\(dg\\flib/uucp/ 755 0 33 0 2550211766 5474 lib/uucp/.XQTDIR/ 777 102 33 0 2510247123 6624 lib/uucp/uuxqt 4755 102 33 53670 2536652152 7021 H ((^Юn PPՀPpPPG Pl@Ψ^ʹSaSWSg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dfp != NULLCAN'T OPEN %sexit status %d/dev/nullwAERROR - (%s) fp != NULLOPEN %sS %s %s %s - %s 0666 rAERROR - (%s) xfp != NULLCAN'T OPEN %s%srAERROR - (%s) pdir != NULLGTXFILE CAN'T OPEN %sfile - %s r%s %sr%s%s%s/%s/usr/lib/uucp/.XQTDIRr%s%s%s/%s/usr/lib/uucp/.XQTDIRAERROR - (%s) ret == 0LINK RET-%duuxqt cmd (%s) status (%s)%s!%s/usr/lib/uucp/usr/spool/uucp/usr/lib/uucp/L.sys/usr/lib/uucp/L.sys.cr/usr/lib/uucp/L-devices/usr/lib/uucp/L-dialcodesrmailrnewsvprwfsendfgetuusendcpr/full %s w/usr/spool/uucppublic/mkdir %s;chmod 0777 %smkdir - %s %c.%.7s%c%.4sfile - %s LCK.SEQLAERROR - (%s) n < SLOCKTRIESCAN NOT GET %sLCK.SEQL/usr/lib/uucp/SEQFr%4d/usr/lib/uucp/SEQFwAERROR - (%s) fp != NULLCAN NOT OPEN %s/usr/lib/uucp/SEQF/usr/lib/uucp/SEQF/usr/lib/uucp/SEQFw/usr/lib/uucp/SEQF%s%04dLCK.SEQL/dev/null/dev/nullshio - %s AERROR - (%s) f == 0BAD OPEN fileno %dAERROR - (%s) f == 1BAD OPEN fileno %d/bin/shsh-cstatus %d @(#)ulockf 2.3LTMP.%dAERROR - (%s) i < MAXLOCKSTOO MANY LOCKS %dAERROR - (%s) p != NULLCAN NOT ALLOCATE FOR %s%s.%sLCK.%s.%sLCK./dev/null/dev/null/dev/null-s%.7s/usr/lib/uucp/uucicoUUCICO-r1/dev/null/dev/null/dev/null/usr/lib/uucp/uuxqtUUXQT/dev/null/dev/null/dev/null%s -r %suucp/bin/shsh-cuuclean deleted file %s mail %sw%s@(#)logent 2.1/usr/spool/uucp/LCK.LOG/usr/spool/uucp/LOGFILEa/usr/spool/uuc((p/LCK.LOG/usr/spool/uucp/LCK.LOG%s/LOG.%05d.%1d/usr/spool/uucpw%s %s (%d/%d-%d:%d-%d) %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`{ULVEPNHѬ<_JޤaݬRȤuaݏHԬ1ݬ)-IP5ݏH) P1ݏH P161ݏH P1Ѭ OP$tﲀ;t@P;(p@PyݏX P11tm<tIJP.9ݏXA P1tU1Z(tsP1﷙ԚP"sݏC P1$14^x~(TKݬQ}P1xT~ނ߭,hEЬP`NDxPт𧻓XTݬ~ᅡ߭gǂ߭IPwݬ輸\ TPw~7Swݬ}S?ݬ~A|0^լYY A0.~jUP4PP44P@{00ݬݬ 8f8ݬi-8^ݬ ݬ8f8ݬ6-^Fx{Gq{Ѭ1ݏPPtPKݏUPIPAWvb5iRPJݏUMPPPݏP$PݏUP‘NvPu1n^-z~ݬ1PPP^yЬЭP֭`ЬP^yqfЭPРyР yРРРРPPt~"bQPtǘ~6P^ݬ ߭ed߭-PPݬ0P߭ip߭ݬ:,PݬcP ݬp,^3t@0CPPPPs aP,ݬ PPPЭPs܀ O,PPPsĀﴀOݭ,ݭ PPPЭP֬ЬP^P]sQPP?S>^ Or?ENݏ1 ݭ^P߭ݭs=PP< NݭڑNݏZЭؽЭPЭܠЭPЭݭEPЭQP ЭԭѭЏ?|)NߔcNݏѭ;3MMݏݭݏݭOP1ЭPԠݭkѭT?fQ￐lMNqQ戀SMݏ&=&qOPP?3eMpLLݏj1ݭeP߭ݭz;PP ~@֭ѭ<~~Lݭ~Ϗ|LݏOЭؽЭPЭܠЭԭѭ̏?~~9L倫~s Lݏѭ;~z~CK~.KݏݭݏݭMP1Խݭi1^^ݬ}MPx P@fЭPѭ WݬݽiP#ЭPݠ0PÏTPPP ݬЭPݠiPݬU0PЭPՠPnЬPݠ}8JnЬP`}JЬPݠ}*P ݬ ݬ^ЬPРޭЭ ֭֭̽ИP@甽ۑս߭ݽhP1ЭPРݭݭ|߭]ԭѭXm߭|HIݬ߭>PmP|Iѭȏ ЭP1[֭^ԭݭЬPݠ ݠPP9|n|>@m|f|PIPxP@\ЭPݠS|߭\߭hPyPЭPݠ.֭1[ЭPݠ|߭\|ݬ|߭p\l߭{H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DP="[UP^ݬ P PЭPݠݬ o@ݽݬb@P^ݬ P PЭPݠݬ 1@ЭPРPЬP֬P^ݬ3Pѭ ׭ЭP`/֭ЭP^ЬP֬`ЬP֬` PPP^լZլ Z fCݬ ZbyP1c>c>>ݬ>PPݏݬ "PPPݬz}XPPݬP^ԭЭP@h ֭ѭBXѭ ЭP@Tg֭ѭW ^߭ݬ;PPѭPݬP ݬ4<P^ݏ$ݬPPB\~ݭ?ݭ:ݬ ݬP ݬ;Pݬ;P^ԭ>ЭP@ ݬݬ}P"ԭЭP@ ;֭ѭP֭ЭP@ P ^ݬgV[V߭z.߭l ^ݬHVPZ jkr kaݬ  +   ZP*ЬRPQbPD=\~ݬl;=PPЬ`Ь `Ŭ PP~ݬ^`YìPPPYxY~ݭPPYЭЬ[YZ+Yݭ[ݭ[t`PPhY[[]ZYݭKZYݭ[YЭ[/Zݭ%`PP[Z[pYZYZZ[>ìPíQPQݬY~Э1ݭݬY1[YݭZ2YЭZ14 ^_Ь[ЬZkj׭^m_Ь[ЬZЬ Ykij׭Ь::ŏmNA+:P90PP:P^Ь[ЬZԭլ05Ьj ЪP֪`P ZPYY׭֭ѭ ЭP^Ь[ЬZԭլ.3ЬYj ЪP֪` Z~Y ֭ѭ ЭPЬ[[~ kЫ0   \~ݬ=:J \~ݬݬ5^Ь[A[[ԭ֭ \~ݬ߭^Ь[Ь Zԭԭ1)ЬPРQ֠aP1LYY%1/ԭY* ZZYԭ PYP0PYI8խ20uYlԭ蘋YYhY[ [P[I8 YYP߭ݬݭݭYݭPխ֭խVխЭPP׼ЬPРQ֠aP ݬPP P P P ݬPYYPPJP P P P%1׼1ݬ%PPYP14ݬPlЭP^ѬcѬs Ѭ[#ݬݬݬ ݬլмPPPԭԭԭѬe Ѭf YѬoY ѬxYޭ[ԭԭ׼ЬPРQ֠aP ݬNPZP Z Z Z-.֭Z׼ЬPРQ֠aP ݬPZ׬ 1Z+׬ ׼1ݬ1Za ZfZA1ZF֭YxY xPPPPxZJW60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P=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj&~P // BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[t1xݏoPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkY((Z~PY PP@%[ [[[j& Ь[Z = 8[ePZ~-PZ ݫ ԫ kZP{ Ь[ЬZkPkPzQQP^ݬPP߭ݬPLVboAERROR - (%s) ret == 0BAD UID ret %d%.7sunknown flag %s AUDITwAUDITheremsg-%s,%.7ssys-%s LCKCBCALLBACK Role %d CALLBACKREQUIREDCALL BACKBADSEQPREVIOUSBADSEQOKBAD SEQHANDSHAKE FAILEDBADSEQSYSTEM STATUSCAN NOT CALL%c.%.7schkNO WORK    call to %s LOCKEDFAILEDSUCCEEDED%.7s -Q%d %smsg-%s BAD SEQHANDSHAKE FAILEDOKHANDSHAKE FAILED Rmtname %s, my Role %s, MASTERSLAVESpool - %s Ifn - %d, Ofn - %d, Loginuser - %s startupFAILEDSTARTUPstartupOKTALKINGret from cntrl - %d conversation completeOKconversation completeFAILEDCONVERSATIONOOOOOsend OO %d,OOOOO Ifn - %d, ret ioctl - %d tty.flags %o,tty.ispeed %d, tty.ospeed %d, ret ioctl - %d     exit code %d SIGNAL %dCAUGHTAERROR - (%s) ret >= 0RETURN FROM STTY %d/usr/lib/uucp/usr/spool/uucp/usr/lib/uucp/L.sys/usr/lib/uucp/L.sys.cr/usr/lib/uucp/L-devices/usr/lib/uucp/L-dialcodesBAD SYSTEMWRONG TIMESYSTEM LOCKEDNO DEVICEDIAL FAILEDLOGIN FAILEDBAD SEQUENCE@(#)cntrl 2.7gM0OzNPO 4ARG COUNT - %d %s %s %s %s %s %sAERROR - (%s) strlen(User) <= 10User - %s %s %s %s %sREQUESTUser - %s DENIEDACCESSaccess deniedrrCAN'T READ DATAFAILEDcan't accessDENIEDACCESSaccess denied%s/TM.%05d.%03dwCAN'T CREATE TMFAILEDwrktype - %c, fileno - %d PROCESS: msg - %s %s RQSTCMPT:REQUESTED%s HUP:YAERROR - (%s) role == MASTERrole - %dchkYNNNXUUCP DENIED%s %sY%s SNDFILE:REQUESTAERROR - (%s) role == MASTERrole - %dAERROR - (%s) role == MASTERrole - %dAERROR - (%s) role == SLAVErole - %dAERROR - (%s) i > 4ARG COUNT - %d %s %s %s %sREQUESTEDmsg - %s W_FILE2 - %s N2DENIEDPERMISSION/AERROR - (%s) strlen(User) <= 10User - %s chkpth ok Rmtname - %s %s/TM.%05d.%03dwN4CAN'T OPENDENIEDYN5YFAILEDSUCCEEDEDCOPY%omode - %o %s RCVFILE:REQUESTAERROR - (%s) role == MASTERrole - %dAERROR - (%s) role == MASTERrole - %d/N5YFAILEDSUCCEEDEDCOPYN6Y%omode - %o AERROR - (%s) role == SLAVErole - %dREQUESTEDAERROR - (%s) i > 3ARG COUNT - %d msg - %s W_FILE1 - %s /AERROR - (%s) strlen(User) <= 10User - %s N2DENIEDPERMISSIONchkpth ok Rmtname - %s rN2CAN'T OPENDENIEDAERROR - (%s) ret != -1STAT FAILED %s%s %oYrmesg - '%c' got %s FAILexpected '%c' got FAILBAD READgot %s expected '%c' got %.25sBAD READgot %.25s wmesg '%c'%.25s copy succeededfile %s, system %s %s file %s on %s %s Nprotocol %s Protocol %s Proto started %c Proto start-fail %c %s/%s//usr/spool/uucppublicCOPY FAILED (reason not given by remote)local access to file deniedremote access to path/file deniedsystem error - bad uucp command generatedremote system can't create temp filecan't copy to file/directory - file left in PUBDIR/user/filecan't copy to file/directory - file left in PUBDIR/user/file@(#)conn 2.1,  % gdial %s calledfinds %s calledgetto %s calledlogin %s calledrAERROR - (%s) fn != NULLCAN'T OPEN %sAERROR - (%s) nr == 4BAD LINE %sAERROR - (%s) lb < Devbuff + MAXDCHTOO LONG %sAERROR - (%s) pd < Devs + MAXDEVTOO MANY DEVICES %dAERROR - (%s) pd > DevsBAD FILE %srAERROR - (%s) fn != NULLCAN'T OPEN %sAERROR - (%s) nr == 2BAD LINE %sAERROR - (%s) lc < Codebuff + MAXCCHTOO LONG %sAERROR - (%s) pc < Dialcodes + MAXCODEMANY DEVICES %dcall: no. %s for sys %s ACU%s%sDial %s dcr returned as %d AVAILABLE DEVICENONO AVAILABLE DEVICE %s /dev/%s/dev/%s%s%s-<dc - %s, acu - %s DN write %s timeoutDIALUP DN writeTIMEOUTACU write %s errorDIALUP ACU writeFAILEDACU write ok%s dcf is %d Line open %s failedDIALUP LINE openFAILEDForked %d Wait got %d Status %o DEVICENOT AVAILABLE/dev/%srWrong time to call %s WRONG TIME TO CALLSlaveSlave only, no call to %s tried NO CALL FROM SLAVEAERROR - (%s) nf > 4TOO FEW LOG FIELDS %dwanted %s got %s ?thatLOGINFAILEDAERROR - (%s) speed >= 0BAD SPEED %dSpeed: want %d use %o ps %d AERROR - (%s) ret >= 0RETURN FROM STTY %d""kr - %d lost line kr - %d, fn - %d LOGINLOST LINE%cBREAK%1d%s,%d EOT    AERROR - (%s) nw == nsBAD WRITE $s ioctl ret %d ioctl ret %d AERROR - (%s) ret > 0BAD WRITE genbrk %d@AERROR - (%s) ret > 0BAD WRITE genbrk %dsent BREAK nulls - %d SuMoTuWeThFrSaWkAny%d-%d @not cntl %o alloc change not implemented srj not implemented r short %d want %d rcount = %d xcount = %d  @tries = %d rec h->cntl %o bad header %o,h->ccntl %o state - %o bad header %o bp NULL %s AERROR - (%s) ret != -1PKGETPKT CAN't READ %dsend %o AERROR - (%s) ret == HDRSIZPKXSTART ret %dAERROR - (%s) ret == pk->p_rsize + HDRSIZPKXSTART ret %dalarm %d AERROR - (%s) ret > 0PKCGET READ %dgen err at %o, (%o), pkon - %d Ofn - %d sent data %D bytes %D secs%s received data %D bytes %D secs%s uuclean deleted file %s mail %sw%sr/full %s w/usr/spool/uucppublic/mkdir %s;chmod 0777 %smkdir - %s %c.%.7s%c%.4sfile - %s LCK.SEQLAERROR - (%s) n < SLOCKTRIESCAN NOT GET %sLCK.SEQL/usr/lib/uucp/SEQFr%4d/usr/lib/uucp/SEQFwAERROR - (%s) fp != NULLCAN NOT OPEN %s/usr/lib/uucp/SEQF/usr/lib/uucp/SEQF/usr/lib/uucp/SEQFw/usr/lib/uucp/SEQF%s%04dLCK.SEQL/dev/null/dev/nullshio - %s AERROR - (%s) f == 0BAD OPEN fileno %dAERROR - (%s) f == 1BAD OPEN fileno %d/bin/shsh-cstatus %d @(#)ulockf 2.3LTMP.%dAERROR - (%s) i < MAXLOCKSTOO MANY LOCKS %dAERROR - (%s) p != NULLCAN NOT ALLOCATE FOR %s%s.%sLCK.%s.%sLCK./dev/null/dev/null/dev/null-s%.7s/usr/lib/uucp/uucicoUUCICO-r1/dev/null/dev/null/dev/null/usr/lib/uucp/uuxqtUUXQT/dev/null/dev/null/dev/null%s -r %suucp/bin/shsh-c@(#)anlwrk 2.1rget%s/%sgetr@(#)chkpth 2.2AERROR - (%s) ret == 0INIT USERFILE %d..//usr/lib/uucp/USERFILErcAERROR - (%s) ret == 0INIT USERFILE %drAERROR - (%s) fp != NULLBAD DIRECTRY %s /usr/spool/uucp/LCK.SQCAN'T LOCK/usr/spool/uucp/LCK.SQcan't lock %s /usr/spool/uucp/LCK.SQ/usr/lib/uucp/SQFILEr/usr/lib/uucp/SQTMPw/usr/lib/uucp/SQTMP%s%d%s %d %d/%d-%d:%d /usr/spool/uucp/LCK.SQ/usr/lib/uucp/SQTMP/usr/lib/uucp/SQTMP/usr/spool/uucp/LCK.SQ/usr/lib/uucp/SQFILE/usr/lib/uucp/SQTMP/usr/lib/uucp/SQFILE/usr/lib/uucp/SQTMP/usr/spool/uucp/LCK.SQ/usr/lib/uucp/SQTMP/usr/spool/uucp/LCK.SQimsg %s>%c%s <%c@(#)logent 2.1/usr/spool/uucp/LCK.LOG/usr/spool/uucp/LOGFILEa/usr/spool/uucp/LCK.LOG/usr/spool/uucp/LCK.LOG%s/LOG.%05d.%1d/usr/spool/uucpw%s %s (%d/%d-%d:%d-%d) %s (%s) /usr/spool/uucp/SYSLOGa%s %s (%d/%d-%d:%d) %s %s/%s.%.7sSTSTr%dwAERROR - (%s) fp != NULLSYSTAT OPEN FAIL %s%d %d %D %s %s %s/%s.%.7sSTST%s/%s.%.7sSTSTr%d%d%DCALL IN PROGRESS %s MAX RECALLSNO CALLMAX RECALL COUNT %d RETRY TIME NOT REACHEDNO CALLRETRY TIME (%d) NOT REACHED ucbarpaM:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/etc/passwdrr/bin/shsh-c  AAAAAABBBBBB /dev/  AAAAAABBBBBB ((lib/uucp/uuclean 4755 102 33 21250 2536652161 11462 1bin/uucleanlib/uucp/L.sys 600 102 33 25 2536652163 6510 research Any ACU 300 /dev/  AAAAAABBBBBB /( ,( 58܉ /\@,\D"lib/uucp/USERFILE 600 102 33 14 2536652164 6715 uucp, / , / ACU 300 /dev/  AAAAAABBBBBB /( ,( 5X܉ /\@,\D"lib/uucp/SEQF 666 102 33 4 2552547711 6227 1046, / , / ACU 300 /dev/  AAAAAABBBBBB /( ,( 5h܉ /\@,\D"lib/uucp/LOGFILE 600 102 33 0 2367556271 6537 lib/libnew.a 755 0 33 44752 2552606132 6263 ! __.SYMDEF 363531359 0 27 100664 7990 ` zzz0&0&0& ,-v.%v../7/@0H0Q,2Y,2b3j3u3}33338888888f<P=:>:> :>:>:>$:>.:>9BABJDRD]DeDnDxDDtHtH_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_del_step_arc_quad_abs_box_circle_closevt_closepl_dot_erase_lbl_mv_lbl_umv_label_line_linemod_move_openvt_openpl_point_scale_space_obotx_oboty_botx_boty_scalex_scaley_scaleflag_oloy_ohiy_ohix_oextra_cont_putch_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_xargc_xargv_main__sigfdie__sigidie__sigqdie__sigindie__sigtdie__sigdie_s_rnge_abort__getarg__iargc__getenv__signal__s_stop_s_paus_system__pow_ci_pow_dd_pow_di_pow_hh_pow_ii_pow_ri_pow_zi_pow_zz_c_abs_c_cos_c_div_c_exp_c_log_c_sin_c_sqrt_z_abs_z_cos_z_div_z_exp_z_log_z_sin_z_sqrt_r_abs_r_acos_r_asin_r_atan_r_atn2_r_cnjg_r_cos_r_cosh_r_dim_r_exp_r_imag_r_int_r_lg10_r_log_r_mod_r_nint_r_sign_r_sin_r_sinh_r_sqrt_r_tan_r_tanh_srand__rand__d_abs_d_acos_d_asin_d_atan_d_atn2_d_cnjg_d_cos_d_cosh_d_dim_d_exp_d_imag_d_int_d_lg10_d_log_d_mod_d_nint_d_prod_d_sign_d_sin_d_sinh_d_sqrt_d_tan_d_tanh_i_abs_i_dim_i_dnnt_i_indx_i_len_i_mod_i_nint_i_sign_h_abs_h_dim_h_dnnt_h_indx_h_len_h_mod_h_nint_h_sign_l_ge_l_gt_l_le_l_lt_hl_ge_hl_gt_hl_le_hl_lt_ef1asc__ef1cmc__s_cat_s_cmp_s_copy_cabs_tanh_sinh_cosh_f_back_s_rdfe_c_dfe_y_getc_y_err_y_rsk_s_wdfe_y_putc_y_rev_e_rdfe_e_wdfe_s_rdue_c_due_s_wdue_e_rdue_e_wdue_icptr_icend_svic_icnum_icpos_z_getc_z_putc_z_rnew_s_rsfi_c_si_y_ierr_s_wsfi_z_wnew_e_rsfi_e_wsfi_f_inqu_setcilist_setolist_stcllist_setalist_f_rew_s_rsfe_x_getc_x_endp_xrd_SL_x_rev_rd_ed_rd_I_rd_L_rd_A_rd_AW_rd_F_rd_ned_rd_POS_rd_H_recloc_s_rsue_c_sue_s_wsue_e_wsue_e_rsue_reclen_do_us_do_uio_do_ud_s_wsfe_x_putc_xw_end_xw_rev_x_wSL_pr_put_e_rsfe_c_sfe_e_wsfe_syl_parenlvl_pc_revloc_pars_f_f_s_op_gen_f_list_i_tem_ne_d_e_d_gt_num_ap_end_cnt_ret_cp_rp_workdone_nonl_en_fio_do_fio_type_f_fmt_bg_s_wsle_t_putc_l_write_e_wsle_lwrt_I_lwrt_L_lwrt_A_lwrt_F_lwrt_C_lioproc_ltab_l_comma_l_first_t_getc_e_rsle_lquit_lcount_ltype_lchar_lx_ly_l_read_l_R_l_C_l_L_l_CHAR_rd_int_s_rsle_c_le_do_lio_f_open_isdev_fk_open_f_clos_f_exit_flush__g_char_b_char_inode_mvgbt_f_end_t_runc_mv_cur_w_ed_wrt_I_wrt_IM_wrt_L_wrt_A_wrt_AW_wrt_E_wrt_G_wrt_F_w_ned_wrt_AP_wrt_H_units_init_elist_reading_cplus_cblank_fmtbuf_external_doed_doned_doend_donewrec_dorevert_sequential_formatted_getn_putn_cf_curunit_recpos_cursor_scale_F_err_fatal_f_init_canseek_nowreading_nowwriting_icvt_dfe_rdfe_wdfe_s_rdfe_c_dfe_y_getc_y_tab_y_rnew_s_wdfe_y_putc_y_wnew_e_rdfe_e_wdfe_y_rend_y_wend_due_s_rdue_c_due_s_wdue_e_rdue_e_wdue_z_getc_z_putc_z_wnew_z_ungetc_s_rsfi_z_rnew_z_tab_c_si_s_wsfi_s_rdfi_c_di_s_wdfi_c_fi_e_rsfi_e_wsfi_e_rdfi_e_wdfi_c_li_s_rsli_s_wsli_e_rsli_e_wsli_iiorec__iiopos__recloc_rsue_sue_s_rsue_c_sue_s_wsue_e_wsue_e_rsue_s_rsfe_c_sfe_x_getc_x_rnew_x_tab_e_rsfe_new_s_wsfe_pr_put_x_putc_x_wend_x_wnew_e_wsfe_lrd_lchar_lx_ly_ltype_ltab_s_rsle_l_read_t_getc_e_rsle_t_sep_l_R_l_C_l_L_l_CHAR_lr_comm_get_repet_rd_int_s_wsle_t_putc_l_write_e_wsle_lwrt_I_lwrt_F_lwrt_D_lwrt_C_lwrt_DC_lwrt_L_lwrt_A_chk_len_lwrt_0_cnt_ret_cp_rp_dfio_en_fio_do_fio_type_f_fmt_bg_eor_uio_do_us_due_err_do_uio_do_ud_c_le_do_lio_rd_ed_rd_mvcur_rd_I_rd_L_rd_AW_rd_F_rd_ned_rd_POS_rd_H_w_ed_wr_mvcur_wrt_IM_wrt_L_wrt_AW_wrt_E_wrt_G_wrt_F_w_ned_wrt_AP_wrt_H_syl_parenlvl_pc_revloc_pars_f_f_s_op_gen_f_list_i_tem_ne_d_e_d_gt_num_ap_end__digit_icvt_bksp_f_back_f_rew_f_open_isdev_fk_open_f_clos_f_exit_flush__endf_f_end_t_runc_f_inqu_allocs_allocp_alloct_allocx_malloc_free_calloc_realloc_tmplate_fortfile_units_reading_external_sequential_formatted_fmtbuf_icptr_icend_fmtptr_doed_doned_doend_donewrec_dorevert_dotab_lioproc_getn_putn_ungetn_svic_cf_curunit_lunit_lfname_recpos_recnum_reclen_cursor_scale_radix_signit_tab_cplus_cblank_elist_errflag_endflag_lquit_l_first_leof_lcount_line_len_fatal_prnt_fmt_prnt_ext_prnt_int_ffpu((tc_f_init_ini_std_canseek_finode_nowreading_nowwriting_g_char_b_char_inode_last_char_f_errlist_f_nerr_sccs_id_init66__no_66__box_wclear_initscr_endwin_mvprintw_mvwprintw_mvscanw_mvwscanw_mvwin_newwin_subwin_overlay_overwrite_printw__sprintw_wprintw_scanw__sscans_wscanw__win_wrefresh_touchwin_werase_wclrtobot_wclrtoeol__win_mvcur_fgoto_plod__putchar_plodput_putpad_ospeed_gettmode_setterm_zap_getcap_longname_delwin_winsertln_wdeleteln_scroll_wgetstr_wgetch_waddstr_waddch_wmove__echoit__rawmode_My_term__endwin_ttytype_Def_term__tty_ch_LINES_COLS__res_flg_stdscr_curscr__tty_AM_BS_CA_DA_DB_EO_GT_HZ_IN_MI_MS_NC_OS_UL_XN_NONL_UPPERCASE_normtty__pfast_AL_BC_BT_CD_CE_CL_CM_DC_DL_DM_DO_ED_EI_HO_IC_IM_IP_LL_MA_ND_SE_SF_SO_SR_TA_TE_TI_UC_UE_UP_US_VB_VE_VS_PC__unctrl_wstandout_wstandend_tstp_winsch_wdelch_getwd_prexit_cat_getwd_prexit_cat_killpg_killpg_setpgrp_getpgrp_setpgrp_getpgrp_sigsys_sigpeel_sigsys_sigpeel_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_wait3_wait3_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_sigsys_sigpeel_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_sigsys_sigpeel_allprint_printable_sprint_main_yyreject_yyracc_yyless_yywrap_allprint_printable_sprint_main_yyreject_yyracc_yyless_yywrap_errno_asin_acos_atan_atan2_hypot_cabs_errno_jn_yn_errno_j0_y0_errno_j1_y1_errno_pow_errno_signgam_gamma_errno_log_log10_cos_sin_errno_sqrt_errno_tan_tanh_sinh_cosh_errno_erf_erfc_errno_exp_floor_ceil_pow_rpow_gcd_invert_msqrt_mdiv_m_div_m_dsb_m_trq_m_in_m_out_sdiv_s_div_min_omin_mout_omout_fmout_fmin_mult_m_mult_tradd_m_add_madd_msub_m_sub_move_xfree_xalloc_dummy_fatal_mcan_itom_mcmp_getwd_prexit_cat_getwd_prexit_cat_killpg_killpg_setpgrp_getpgrp_setpgrp_getpgrp_sigsys_sigpeel_sigsys_sigpeel_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_wait3_wait3_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_sigsys_sigpeel_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_sigsys_sigpeelgetwd.o 363529204 0 27 100664 1657 ` LtX ^/֬Ь02<1Pt YC^F8S1dOP e?T.P /\ QA`[PKK`ݬPݬ/...getwd: cannot open .. ..getwd: read error in .. getwd: read error in .. getwd: can't change back # )1>E LT[agn t{     (/ 6<BI O_lry   0 > G  L!(,28(@GNT[` dhpw}_name_file_off_d_dd_dir_getwdL19_stat_open_prexit_fstat_chdir_read_close_catL57L71_strlen_write_exit getwd.o 363529204 0 27 100664 1657 ` LtX ^/֬Ь02<1Pt YC^F8S1dOP e?T.P /\ QA`[PKK`ݬPݬ/...getwd: cannot open .. ..getwd: read error in .. getwd: read error in .. getwd: can't change back # )1>E LT[agn t{     (/ 6<BI O_lry   0 > G  L!(,28(@GNT[` dhpw}_name_file_off_d_dd_dir_getwdL19_stat_open_prexit_fstat_chdir_read_close_catL57L71_strlen_write_exit killpg.o 363529206 0 27 100664 140 ` 0ά%P  %  kill_killpgcerrornoerrorkillpg.o 363529206 0 27 100664 140 ` 0ά%P  %  kill_killpgcerrornoerrorsetpgrp.o 363529206 0 27 100664 227 ` 0H'ݏݬ' ) ' % -!3setpgrp_setpgrp_getpgrpcerrornoerrorgpgrp setpgrp.o 363529206 0 27 100664 227 ` 0H'ݏݬ' ) ' % -!3setpgrp_setpgrp_getpgrpcerrornoerrorgpgrp signal.o 363529207 0 27 100664 314 ` @x0ЬPЬQQɏPQ0 # 0# +4;!@*E/JSIGDORTIsignal_sigsyscerrornoerror_sigpeelRETOFFunw1unw2unw3signal.o 363529207 0 27 100664 314 ` @x0ЬPЬQQɏPQ0 # 0# +4;!@*E/JSIGDORTIsignal_sigsyscerrornoerror_sigpeelRETOFFunw1unw2unw3sigset.o 363529213 0 27 100664 1061 ` Ь[ЬZ[[  PKYZKZZZZ Z9ZZ[PZZ ZZZYKYPЬ[ЬZ[[  lPKYZK ZZ ZZZ[7PZZ ZZZYKSYPЬ[[ [Ь[[  K~ɏ[~Ь[[  K P~[Pݬz Ь[KZljK~[M !*BKW r    % -= R[ fp   8")4<zDHQU _cBmqx| _cactions_setflg_signalL17_errno__sigcatch_sigsys_sigsetL27_sigholdL35_sigpauseL41_sigrelseL47_sigignoreL53L57_sigpeel sigset.o 363529213 0 27 100664 1061 ` Ь[ЬZ[[  PKYZKZZZZ Z9ZZ[PZZ ZZZYKYPЬ[ЬZ[[  lPKYZK ZZ ZZZ[7PZZ ZZZYKSYPЬ[[ [Ь[[  K~ɏ[~Ь[[  K P~[Pݬz Ь[KZljK~[M !*BKW r    % -= R[ fp   8")4<zDHQU _cBmqx| _cactions_setflg_signalL17_errno__sigcatch_sigsys_sigsetL27_sigholdL35_sigpauseL41_sigrelseL47_sigignoreL53L57_sigpeel wait3.o 363529214 0 27 100664 173 `  <ЬPЬ QլQ   )wait3_wait3cerrornoerrornostatus wait3.o 363529214 0 27 100664 173 `  <ЬPЬ QլQ  (( )wait3_wait3cerrornoerrornostatus sigset.o 363529213 0 27 100664 1061 ` Ь[ЬZ[[  PKYZKZZZZ Z9ZZ[PZZ ZZZYKYPЬ[ЬZ[[  lPKYZK ZZ ZZZ[7PZZ ZZZYKSYPЬ[[ [Ь[[  K~ɏ[~Ь[[  K P~[Pݬz Ь[KZljK~[M !*BKW r    % -= R[ fp   8")4<zDHQU _cBmqx| _cactions_setflg_signalL17_errno__sigcatch_sigsys_sigsetL27_sigholdL35_sigpauseL41_sigrelseL47_sigignoreL53L57_sigpeel signal.o 363529207 0 27 100664 314 ` @x0ЬPЬQQɏPQ0 # 0# +4;!@*E/JSIGDORTIsignal_sigsyscerrornoerror_sigpeelRETOFFunw1unw2unw3sigset.o 363529213 0 27 100664 1061 ` Ь[ЬZ[[  PKYZKZZZZ Z9ZZ[PZZ ZZZYKYPЬ[ЬZ[[  lPKYZK ZZ ZZZ[7PZZ ZZZYKSYPЬ[[ [Ь[[  K~ɏ[~Ь[[  K P~[Pݬz Ь[KZljK~[M !*BKW r    % -= R[ fp   8")4<zDHQU _cBmqx| _cactions_setflg_signalL17_errno__sigcatch_sigsys_sigsetL27_sigholdL35_sigpauseL41_sigrelseL47_sigignoreL53L57_sigpeel signal.o 363529207 0 27 100664 314 ` @x0ЬPЬQQɏPQ0 # 0# +4;!@*E/JSIGDORTIsignal_sigsyscerrornoerror_sigpeelRETOFFunw1unw2unw3_cactions_setflg_siglib/getNAME 755 0 33 20000 2532107417 5760 ^Юn PPՀPpPP P׬ϿЬP`ϠP׬=ЬP`׬լe^tݬPݬa6ϢݏP.THtɑhcݏϬP.SHsɑhUc1ЬZ*j.)P`~njҕjZYi.YiP(` (6j#Z϶Pϱ`Ϥϟ~jϏύPψ)` {)pnPi ` \ D4ݏ}P $. SHߑsh ϖχЬ[[k{ kЬ[Ь Z+PPPXZkw+ݏݬPYX1YY kalXPPPݬ.PY<3ݏݬPYXYYݬPYY)YXPPPݬPYYPjYX kr  ZPЬ [ЬY׬&k ЫP֫`P [PZZZ Z YPЬP@ ,[4|P@X[ݬPZZݬ[P[&@Phr "4@Raq #2>QError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large\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ݏ 5/;ݬݬ *ݬ ݏݏqݏmݏݬݬ7,ս)ЭPРսݭݽнP`^1QzP1=ЭP1PP1"ݏݏNݏ1QQ1ݏݏO((ݏ1ݏݏYݏw1ƫ﹫ﳫP`P/++PРQ֠aPʏP +NPP hPPPPPP9PsE:PkQsA`_!PRQA`ݏݏNݏ&[0* ժΪȪPQ A`1p1|ݏݏYݏ-$1`GP>P9PZI P1 F1ݏݏYݏ41ݏݏYݏ;1 <PPPQA`.PQA` 數PQA`ݏݏYݏBݏUݏI(O18 RPQA`.OݏݏYݏM1 ݏݏYݏT1 ݏݏYݏ[1 PQA`.NݏݏYݏbV1 ݏݏYݏi:1v ݏݏYݏp1Z ݏݏYݏw1> ݏݏYݏ~1" <PnQA`.MݏݏNݏ1 ݏݏGݏ1 ݏݏGݏw1 ݏݏGݏ[1 ݏݏGݏ?1{ ݏݏPݏ#1_ ݏݏPݏ1C bIWݏݏNݏ$3(PZQA` , )ݏ,ݏݏUݏİwL1 ݏݏNݏȰT1 ݏݏYݏϰ81t ݏݏYݏְ1X ݏݏYݏݰ1< ݏݏYݏ1 ݏݏYݏ1 ݏݏPݏ1 P4QA`3- إѥ˥ݏݏPݏTݏUݏAfK1v ݏݏYݏ1Z ݏݏJݏ 1> ݏݏJݏ1" ݏݏYݏ1 ݏݏYݏ 1ݏݏJݏ'1JݏݏNݏ.o11ݏݏXݏ5<1xPQA`1G pe`PQA`1ݏݏDݏ<11ݏݏJPݏC1ݏݏVzPݏOw1ݏݏbQPݏ[N1ݏݏm(Pݏf%1aݏݏxPݏq18ݏݏPݏ{1ݏP {HH)HHݏUݏHݏݏ`ݏUݏ>1]HWHPPSHPQA`y19H_PQA`P1PݏN}PPݏ!1_ݏV]PPݏ<1?ݏD=PPݏ1PQA`oݏݏNݏd1ݏJPPݏ`1PQA`P|ݏJPPݏ\}ݏJPPݏ=^ݏNzPPݏ?ݏN[PPݏ Pa1xPePo1PQA`iݏNPPݏݏJPPݏ 1˿PP{uS}$uP^QkRd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]+z))*Z))b^`'t)d'u))12)3) e 565555555555foHRqsst55555555555555555555555555wzRZ`555555555555555555555555557 : : : : : : : : : :s}565555555555}5555555555555555555555555555555555555555555555555555 @C.} A A A A A A A A A AD_EEEEEEEEEEGH-{IJKc~LLLLLLLLLL,kb-kyhh,k,w-k,ky-k0k.k1k-|0mm3k0k.k1k0k.k1k3kkk3k1ckk3w_`kkMMMMMMMMMMMMMMMMMMNMMMMMMMPcbbQRhSSSSSSSSSSxxm{|TTTTTTTTTTTTTTTTTTTTTTTTTTUUUUUUUUUUUUUUUUUUUUUUUUUU"9vkx"9{{vvk||vk"5"6"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"9"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5"5#f#g#h#i#i#i#i#i#i#i#i#i#i#j#j#j#j#j#j#j#j#j#j#j#j#j#j#j#j#j#j#j#j#j#j#j#j#j#j#k#k#k#k#k#k#k#k#k#k#k#k#k#l#k#k#k#k#k#k#k#k#k#k#k#k%f%g%i%i%i%i%i%i%i%i%i%iu%j%j%j%j%j%j%j%j%j%j%j%j%j%j%j%j%j%j%j%j%j%j%j%j%j%j%n%k%k%k%k%k%k%o%k%k%p%k%k%l%k%k%k%k%k%k%k%k%k%k%k%k2kuku2kuk2kuk625556555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555566666666666666666666666666666666666666666666666666666666666666((@@@@@@@@@@EEEEEEEEEEEEEEEEEEEEEEIIIIIIIIIIJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJlEJMJMJMJMJMJMJMJMJMJMJMJMJMJMJMJMJMJMJMJMJMJMJMJMJMJMKKMMMMMMMMMMMnkrknkKrknklkrknKrlklkKKKKKKKKKKKMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMQ6QSQSQSQSQSQSQS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PB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYjH~P ,, BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[xX1xݏPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[  Ь[Z = 8[ePZ~9PZ ݫ  ԫ kZP{P^߭ݬ4PPPݬݏ tݬݬݏtݬ62.\y2Xy22222~*PY2[2k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZN2 [XyP@2YPƏPxP'2bPZx2PZPPZx2~@PZZZ11PZP1x1PZPPjj1Xy11xYP[P1Z111k}1v1k[P Ь[[ZZZ]1jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP0@j~\S^\_PCЬPЬPЬRRQ{RPPR PRPPP 0PhXxXZ_AQ@Bp q=@{#J9?Gr%d) %3.0f%% (%d) longest sent %d wds at sent %d; shortest sent %d wds at sent %d sentence types: simple %3.0f%% (%d) complex %3.0f%% (%d) compound %3.0f%% (%d) compound-complex %3.0f%% (%d) word usage: verb types as %% of total verbs tobe %3.0f%% (%d) aux %3.0f%% (%d) inf %3.0f%% (%d) passives as %% of non-inf verbs %3.0f%% (%d) types as %% of total prep %3.1f%% (%d) conj %3.1f%% (%d) adv %3.1f%% (%d) noun %3.1f%% (%d) adj %3.1f%% (%d) pron %3.1f%% (%d) nominalizations %3.0f %% (%d) sentence beginnings: subject opener: noun (%d) pron (%d) pos (%d) adj (%d) art (%d) tot %3.0f%% prep %3.0f%% (%d) adv %3.0f%% (%d) verb %3.0f%% (%d) sub_conj %3.0f%% (%d) conj %3.0f%% (%d) expletives %3.0f%% (%d) unknown flag to part %s got a %c on %s WWWWWX XXX'X3X=XBXZX[XAQ@Bp q=nounverbinterjadjadvconjpospronartprepauxbesubcj%s %s %s . %s %s %s sentence length: %d SIMPLE COMPOUND COMPLEX COMPOUND-COMPLEX :expletive::passive: readability %4.2f : begins with %s nounverbinterjectionadjectiveadverbconjunctionpossessivepronounarticleprepositionauxiliarytobesubordinate conjunctionexpletive@u@uYpylib/yaccpar 755 0 33 6435 2532152602 6156 # # define YYFLAG -1000 # define YYERROR goto yyerrlab # define YYACCEPT return(0) # define YYABORT return(1) /* parser for yacc output */ #ifdef YYDEBUG int yydebug = 0; /* 1 for debugging */ #endif YYSTYPE yyv[YYMAXDEPTH]; /* where the values are stored */ int yychar = -1; /* current input token number */ int yynerrs = 0; /* number of errors */ short yyerrflag = 0; /* error recovery flag */ yyparse() { short yys[YYMAXDEPTH]; short yyj, yym; register YYSTYPE *yypvt; register short yystate, *yyps, yyn; register YYSTYPE *yypv; register short *yyxi; yystate = 0; yychar = -1; yynerrs = 0; yyerrflag = 0; yyps= &yys[-1]; yypv= &yyv[-1]; yystack: /* put a state and value onto the stack */ #ifdef YYDEBUG if( yydebug ) printf( "state %d, char 0%o\n", yystate, yychar ); #endif if( ++yyps> &yys[YYMAXDEPTH] ) { yyerror( "yacc stack overflow" ); return(1); } *yyps = yystate; ++yypv; *yypv = yyval; yynewstate: yyn = yypact[yystate]; if( yyn<= YYFLAG ) goto yydefault; /* simple state */ if( yychar<0 ) if( (yychar=yylex())<0 ) yychar=0; if( (yyn += yychar)<0 || yyn >= YYLAST ) goto yydefault; if( yychk[ yyn=yyact[ yyn ] ] == yychar ){ /* valid shift */ yychar = -1; yyval = yylval; yystate = yyn; if( yyerrflag > 0 ) --yyerrflag; goto yystack; } yydefault: /* default state action */ if( (yyn=yydef[yystate]) == -2 ) { if( yychar<0 ) if( (yychar=yylex())<0 ) yychar = 0; /* look through exception table */ for( yyxi=yyexca; (*yyxi!= (-1)) || (yyxi[1]!=yystate) ; yyxi += 2 ) ; /* VOID */ while( *(yyxi+=2) >= 0 ){ if( *yyxi == yychar ) break; } if( (yyn = yyxi[1]) < 0 ) return(0); /* accept */ } if( yyn == 0 ){ /* error */ /* error ... attempt to resume parsing */ switch( yyerrflag ){ case 0: /* brand new error */ yyerror( "syntax error" ); yyerrlab: ++yynerrs; case 1: case 2: /* incompletely recovered error ... try again */ yyerrflag = 3; /* find a state where "error" is a legal shift action */ while ( yyps >= yys ) { yyn = yypact[*yyps] + YYERRCODE; if( yyn>= 0 && yyn < YYLAST && yychk[yyact[yyn]] == YYERRCODE ){ yystate = yyact[yyn]; /* simulate a shift of "error" */ goto yystack; } yyn = yypact[*yyps]; /* the current yyps has no shift onn "error", pop stack */ #ifdef YYDEBUG if( yydebug ) printf( "error recovery pops state %d, uncovers %d\n", *yyps, yyps[-1] ); #endif --yyps; --yypv; } /* there is no state on the stack with an error(( shift ... abort */ yyabort: return(1); case 3: /* no shift yet; clobber input char */ #ifdef YYDEBUG if( yydebug ) printf( "error recovery discards char %d\n", yychar ); #endif if( yychar == 0 ) goto yyabort; /* don't discard EOF, quit */ yychar = -1; goto yynewstate; /* try again in the same state */ } } /* reduction by production yyn */ #ifdef YYDEBUG if( yydebug ) printf("reduce %d\n",yyn); #endif yyps -= yyr2[yyn]; yypvt = yypv; yypv -= yyr2[yyn]; yyval = yypv[1]; yym=yyn; /* consult goto table to find next state */ yyn = yyr1[yyn]; yyj = yypgo[yyn] + *yyps + 1; if( yyj>=YYLAST || yychk[ yystate = yyact[yyj] ] != -yyn ) yystate = yyact[yypgo[yyn]]; switch(yym){ $A } goto yystack; /* stack new state and value */ } ewstate; /* try again in the same state */ } } /* reduction by production yyn */ #ifdef YYDEBUG if( yydebug ) printf("reduce %d\n",yyn); #endif yyps -= yyr2[yyn]; yypvt = yypv; yypv -= yyr2[yyn]; yyval = ylib/dprog 755 0 33 22000 2532076674 5667 P^Юn PPՀPpPP PhPnY7 JЬP`P`-?ЬP`PPPd&PfkЬc׬\׬Q3j\ PIPVd 8w ~( PP"TsjЬųլ/G  P׬ݼPP1^լ4ݬTP%ݬ7Y[[&ZԭЭYaޭP[P[P[P&ޭP[P~[PY$ݏ[PYY[ޭP[P[jkwЪZj1ժ[ZY.1]1[W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Z֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[|1xݏPZZ  YYX ZYYXZYZ~(PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[F Ь[Z = 8[ePZ~9PZ ݫ ԫ kZP{(P^߭ݬDPPPݬݏ tݬݬݏtݬ6ԥ.<ƥ8ᆬ︥ﻥ贈ﬥ~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZV [8PHYPƏPxP/bPZxPZPPZx ~@PZZZPZPդx֤PZPPjj¦81xYP[PZk~k[P Ь[[ZZZejPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPţ@j ~\S^\_PCЬPЬPЬRRQ{RPPR PRPPPPdiction: unknown flag /usr/lib/dict.drdiction: can't open default dictionary rdiction: can't open %s number of sentences %ld number of hits %ld diction: can't open %s rcan't open %s wordlist too large  AAAAAABBBBBB $$((Plib/deroff 755 0 33 52000 2552600270 10026 1bin/derofflib/dict.d 755 0 33 20116 2532076720 5717 ing behavior ability to a great deal of majority of number of a tendency to abovementioned absolutely complete absolutely essential accordingly activate actual added increments adequate enough advent afford an opportunity accomplished aggregate all of all throughout along the line analyzation and or and etc another additional any and all of the opinion that of the same opinion arrive at a as a matter of fact as a method of as a consequence of as of now as of this date as good or better than as is the case as per as regards as related to as to assistance assuming that at a later date at about at above at all times at an early date at an earlier date at below at the present at the time when at this point in time at this time at which time at your earliest convenience awful in back of basic fundamentals basically be cognizant of being that being as brief in duration bring to a conclusion but that but what by means of by the use of capability carry out center portion center around center about check into check on check up on circle around close proximity collaborate together collect together combine together consolidate together couple together come to an end commence common accord compensation completely eliminated completely full concerning comprise conduct an investigation of conjecture connect up consensus of opinion consequent result construct contemplate continue to remain continue on count up could of debate about decide on definitely deleterious effect demean demonstrate depreciate in value deserving of desirable benefits desirous of different than discontinue disutility divide up doubt but duly noted due to during the time that during the course of each and every early beginnings effectuate elucidate emotional feelings empty out enclosed herein enclosed herewith end result end up endeavor enter in enthused entirely complete equally as good essentially eventuate every now and then exactly identical experiencing difficulty fabricate face up to facilitate facts and figures fast in action fearful of fearful that few in number fewer in number file away final completion final ending final outcome final result finalize find it interesting to know first and foremost first of all first beginnings first initiated firstly follow after following after for the purpose of for the reason that reason to believe for the simple reason that for this reason for your information from the point of view of full and complete generally agreed rise to an indication of an order of magnitude authorization gratuitous greatly minimize got to good and a particular preference for a preference for reference to this head up help but in the production of hopeful if and when if at all possible it stands to reason impact implement important essentials importantly in a large measure in a position to in a satisfactory manner in accordance in advance of in agreement with in all cases in behalf of in between in behind in case in close proximity in conflict with in conjunction with in connection with in large measure in many cases in most cases in my opinion in order to in rare cases in some cases in reference to in regard to in regards to in relation with in relation to in respect to with respect to in short supply in terms of in the amount of in the case of in the course of in the event in the form of in the field of in the instance of in the interim in the last analysis in the matter of in the near future in the neighborhood of in the not too distant future in the proximity of in the range of in the same way as described in the shape of in the vicinity of in this case in view of in violation of inasmuch as indicate indicative of initialize initiate injurious to inquire inside of institute a intents and purposes intermingle the necessity of irregardless is defined as is used to is when is where it is incumbent apparent that it was noted that if not un not be un ~ not under ~ not until ~ not unique joint cooperation joint partnership just exactly kind of know about in size last but not least liable later on leaving out of consideration link up literally lose out on a lot of lots of main essentials make a make adjustments to make an make application to make contact with make mention of make out a list of make the acquaintance of make the adjustment manner maximum possible meaningful meet up with melt down melt up methodology might of must of minimize as far as possible miss out on modification more preferable most unique mutual cooperation the nature necessary requisite necessitate need for needless to say nice not in a position to not of a high order of accuracy notwithstanding of considerable magnitude of that minor importance off of on a few occasions on account of on behalf of on the basis of on the grounds that on the occasion the order of on the part of one of the open up operates to correct outside of over with overall past history perceptive of perform permits the reduction of personalize pertaining to physical size plan ahead plan for the future plan in advance plan on present a conclusion present a report presently prior to prioritize proceed to procure productive of prolong the duration protrude out from provided that pursuant to put to use in range all the way from reason is because reason why recur again reduce down refer back reflective of regretful reinitiate relative to repeat again representative of resultant effect resume again retreat back return again return back revert back seal off situation seems apparent send a communication short space of time should of single unit so as to sort of spell out still continue still remain subsequent substantially in agreement succeed in sufficient suggestive of superior than surrounding circumstances take appropriate take cognizance of take into consideration termed as terminate termination the case that the fact in fact the foregoing the foreseeable future the fullest possible extent the only difference being that the point that the authors the author the truth is there are not many little doubt that through the medium of through the use of throughout the entire time interval to summarize the above total effect of all this totality transpire true facts try and ultimate under a separate cover under date of under separate cover under the necessity to underlying purpose undertake a study uniformly consistent unique until such time as up to this time upshot utilize very complete very very unique vital ~ in which ~ into which ~ from which ~ of which ~ on which ~ for which ~ to which ~ through which ~ without which ~ which ~ at which ~ about which ~ by which ~ on which ~ after which ~ upon which ~ with which ~ between which ~ under which ~ over which wish to thank whether or not which ~likewise ~otherwise ~clockwise wise with a view to with reference to with regard to exception of with the object of with the result that clear that doubtful that evident that of interest rather interesting suggested that worth pointing out may be that within the realm of possibility without further delay worth while would of in no case in the possession of in possession of viable alternative quite upon rather fairly relatively comparatively anticipate approximately as already stated as can be seen from reveal sophisticated in excess of from the standpoint of employ as shown in clear that doubtful that evident that of interest rather interesting suggested that worth pointing out may be that within the realm of possibility without further delay worth while would of in no case in the possession of in possession of viable alternative quite upon rather fairly relatively comparatively anticipate approximately as already stated as can be seen from reveal ((lib/explain.d 755 0 33 33613 2532076723 6445 exhibit filing behavior file which "that" when clause is restrictive in accordance with your request as you requested very in the field of in a great deal of much a large number of many a majority of most the great majority of most a number of several, many, some abovementioned the, this, that, those, these absolutely complete complete absolutely essential essential accordingly so accounted for by the fact that due to, caused by, because activate start, begin actual experience experience actually really actual facts facts add the point that add that added increments increments adequate enough adequate advent coming, arrival afford an opportunity allow, permit after this is accomplished then aggregate total all of all all throughout throughout along the line of like along the lines of like along the same line like an example of this is the fact that thus an order of magnitude 10 times analyzation analysis and/or AVOID and etc etc another additional another answer is in the affirmative answer is yes anticipate expect any and all any, all are of the opinion that think that, believe that are of the same opinion agree arrive at a decision decide arrive at an approximation estimate as a matter of fact in fact or OMIT as a method of for as a consequence of because as is the case as happens as of this date today as good or better than as good as or better than good and very as long as when, if as of now now as shown in X X shows that as per AVOID as regards about as related to for, about as soon as when as to about, on as to whether whether the question as to whether whether assist help assistance help give assistance to help assuming that if at a later date later at about at at above, at below above, below at all times always at an early date soon, shortly at an earlier date previously at the present moment in time now at the present time currently, now at the time when when at this point in time now at this time now at which time when at your earliest convenience soon in back of behind in behind behind based on the fact that because basic fundamentals fundamentals be cognizant of aware, know, notice being that as, because, since being as as, become, since brief in duration brief, quick, fast bring to a conclusion conclude, end, finish but that that but what that by means of with, by by the use of by carry out experiments experiment center portion center center around center on center about center on check into, check up on, check on check circle around circle collaborate together collaborate collect together collect combine together combine come to an end end commence begin common accord accord compensation pay completely eliminated eliminated completely full full concerning about conclude end conduct an investigation of investigate conjecture guess connect together connect connect up connect consensus of opinion consensus consequent result result consequently so consolidate together consolidate construct build contemplate plan continue to remain remain continue on continue cooperate together cooperate count up count could of could have couple together couple debate about debate definitely decide on decide, select demean degrade, denigrate (unless behave without regard to value) demonstrate show, prove depreciate in value depreciate deserving of deserve desirable benefits benefits desirous of want, desire despite the fact that although, though different than only to introduce a clause discontinue stop distant from from disutility uselessness divide up divide due to because, owing to due to the fact that because duly noted noted during the time that while during the course of during, while each and every each early beginnings beginnings effectuate cause elucidate explain emotional feelings emotions, feelings empty out empty enclosed herein enclosed enclosed herewith enclosed encounter meet end result result end up end endeavor try enter in, enter into enter enthused show enthusiasm entirely complete complete equally as good as good as, equally good essentially awfully very eventuate happen every now and then now and then exactly identical identical except in a small number of cases usually exhibit a tendency to tend to experiencing difficulty having trouble fabricate make, build face up to face facilitate ease, simplify, help facts and figures facts fast in action fast fearful of fear fearful that fear few in number few fewer in number fewer file away file final completion completion final ending ending final outcome outcome final result result final upshot upshot finalize complete, finish, end find it interesting to know AVOID rather interesting interesting first and foremost first first of all first first beginnings beginnings first initiated initiated firstly first follow after follow following after following, after for the purpose of for, to for the reason that because, since there is reason to believe I think for the simple reason that because, since for this reason so for your information formalize REWRITE forward send from the point of view of for full and complete full, complete generally agreed agreed give an indication of indicate give rise to cause indicate show, suggest give authorization authorize gratuitous gratuitous only for unearned or unwarranted greatly minimize minimize has a deleterious effect damages, harms, injures has got to has to have a need for need referred to as called a preference for prefer have a particular preference for prefer have got to have to has the capability can having reference to this for, about head up head cannot help but cannot help in the production of to produce hopeful of hope hopeful that hope hopefully avoid--usually a misplaced modifier if and when if, when if at all possible if possible impact A MORE PRECISE WORD implement carry out important essentials essentials importantly REWRITE in a large measure largely in a position to can in accordance with by in advance of before in agreement with agree with in all cases always in a number of cases some in a satisfactory manner satisfactorily in a very real sense in a sense or OMIT in behalf of for in between between in case if in no case never in close proximity near in conflict with oppose or contradict in conjunction with with in connection with about, concerning in large measure largely in many cases often in most cases usually in my opinion I think in order to to in rare cases rarely in some cases sometimes in reference to, with reference to concerning, about in regard to about or another simple preposition in regards to as regards in relation with with in relation to toward, to in respect to about with respect to about in short supply scarce in terms of about in the amount of for in the case of for, by, in, if in the course of while, during in the event of if in the event that if in the form of as in the instance of for in the interim meanwhile in the last analysis in the light of the fact that because in the majority of instances (or cases) usually, generally in the matter of about in the near future soon in the possession of has, have in possession of has, have in the neighborhood of about in the not too distant future soon in the proximity of near, nearly, about in the range of between in the same way as described in the same way, as described in the shape of usually unnecessary in the vicinity of near in this case here in view of the above therefore in view of because, since in view of the fact that since, as, because in view of the foregoing circumstances therefore in violation of violate inasmuch as since, for, as initial first initialize start initiate begin, start injurious to harm, damage inquire ask inside of inside institute begin institute a change change institute an improvement improve intents and purposes intents intermingle mingle involve the necessity of require irregardless regardless is defined as is is indicative of indicates is suggestive of suggests is used to control controls is used to provide provides is when is when (only to denote time - not in definitions) is where is where (only to denote place - not in definitions) it is incumbent on me I must it is often the case that often it stands to reason it was noted that if if it is apparent that apparently it is believed that I think it is clear that clearly it is doubtful that possibly it is evident that it is of interest to note that it may be that I think it is suggested that I think it is worth pointing out that note that had the ability to could needless to say it would not be unreasonable to assume I(we) think, assume join together join joint cooperation cooperation joint partnership partnership just exactly just, exactly kind of somewhat, rather know about know large in size large last but not least AVOID later on later leaving out of consideration disregarding liable likely link up link literally lose out on lose main essentials essentials in a precise manner precisely make a calibration calibrate might of might have must of must have make a purchase buy make a study of study make adjustments to adjust make an approximation of approximate make an examination of examine with the exception of except make an exception of except make application to apply make contact with see, meet make mention of mention make out a list of list make the acquaintance of meet make the adjustment adjust maximum possible maximum meaningful significant or REWRITE meet up with meet melt down melt melt up melt merge together merge methodology method mingle together mingle minimize as far as possible minimize miss out on miss mix together mix modification change more preferable preferable most unique unique mutual cooperation cooperation necessary requisite requisite ((necessitate require, need nice A MORE EXACT WORD not in a position to cannot not of a high order of accuracy inaccurate notwithstanding the fact that although of considerable magnitude big, large, great overall general, complete of that of which of the order of magnitude of about of very minor importance unimportant off of off on a few occasions occasionally on account of because on account of the fact that because on behalf of for on the grounds that since, because, as on the occasion of on, when on the order of about, nearly on the basis of by, from, because on the part of by one of the one, a open up open operates to correct corrects optimum best outside of outside, besides, except over with over past history history perceptive of perceive perform do perform a measurement measure perform the measurement measure permits the reduction of reduces personalize REWRITE pertaining to about, on physical size size plan ahead plan plan for the future plan plan in advance plan plan on plan present a conclusion conclude present a report report presently now (presently means "very soon") prior to before reveal show sufficient number of enough prioritize rank proceed to analyze analyze procure get productive of produce prolong the duration prolong protrude out from protrude provided that if pursuant to our agreement as we agreed pursuant to under put to use in (building, measuring, etc) build, measure, etc. range all the way from range from reason is because reason is that or because reason why reason recur again recur reduce down reduce refer back refer reflective of reflect regretful regrettable reinitiate start again relative to about repeat again repeat repeat the same (noun) repeat the (noun) representative of represents resultant effect effect resume again resume retreat back retreat return again return return back return revert back revert seal off seal should of should have situation REWRITE seems apparent seems, is apparent send a communication to notify short space of time sort time single unit unit small in size small so as to to sort of somewhat, rather spell out explain state the point that state that still continue continue still remain remain stress the point that stress that subsequent next sufficient enough subsequent to later, after substantially in agreement agree succeed in doing do, accomplish superior than superior to surrounding circumstances circumstances take appropriate action act appropriately take appropriate measures act take cognizance of note, notice take into consideration consider termed as termed terminate end, stop termination end the fact is AVOID the authors we, I the foregoing the, this, that, these, those the foreseeable future soon the fullest possible extent most, completely or fully (or OMIT) the only difference being that except that whether or not whether the truth is there are not many who few there is very little doubt that doubtless, no doubt through the medium of through through the use of by, with throughout the entire throughout, in the entire time interval interval to loan to lend to summarize the above in summary total effect of all this the effect of all this, total effect totality total (adj) usually makes a more concise construction transpire happen, occur true facts facts try and try to ultimate last ultimate end end under a separate cover separately under date of on under separate cover separately under the necessity to have to underlying purpose purpose undertake a study of study uniformly consistent consistent unique uncommon until such time as until up to about up to, about, approximately up to this time before utilize use very complete complete very unique unique, uncommon vital important we wish to thank we thank with a view to to with regard to about, regarding with the object of to (plus infinitive) with the result that so that with this in mind, it is clear that therefore within the realm of possibility possible, possibly without further delay now, immediately worth while worth while only for actions, not approval would of would have basically a lot of many lots of many the nature in fact wise AVOID WORDS THAT END IN "wise" viable alternative alternative rather quite fairly relatively comparatively AVOID UNLESS REALLY COMPARING anticipate expect approximately about as already stated as can be seen from X X shows employ use from the standpoint of according to in a considerable number of cases often in excess of more than, above upon on y now, immediately worth while worth while only for actions, not approval would of would have basically a lot of malib/diffh 755 0 33 20000 2532077127 5624  ^Юn PPՀPpPPP$ЬP@Z@iYZ QZYŏxPPxZQQP`PZY Ϥ#Y ϘЬP@.P PŏxPPxYQQP`[?ݏ2ŏxQQxYRRQPaa[P1A-ϨЬP@ݏ[P[ ЬP@ώ[P ЬP@PPZ[=ŏxPPx[QQP`Z[PŏxQQxPPPQa)[Z[PЬQPA)PPAπЬPZ@ Ь[ЬZ^ЬPPP-+׬ЬP``P`ЬPPPbѬ ? ϩЬPݠݠϚPϧЬPݠݠφPϗGխmݭݭPϒP*{P!@LϳEϨ62ϧP'#ϔPխխխխݏ@ݏ&խݏݏ@ ^Э1ѭ1϶~*PPݏ@ݏ@[FZ[όPZP~PtPZP~PPZZ[~~[[A~ϱPP[[EZ"PZP~ώP[ PZP~{PπPZ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\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj0~P .. BЫZ֫ZPѫPѬ ZPPXPZ~((PYZkn 1mЫZ3[1xݏPZZ  YYX ZYYXZYZ~(PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[ Ь[Z = 8[ePZ~9PZ ݫ ԫ kZP{(P^߭ݬDPPPݬݏ tݬݬݏtݬ64.L4L44444~*PY4[4k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZJ4 [LP<4YPƏPxP#4bPZx4PZPPZx4~@PZZZ33PZP3x3PZPPjj3L31xYP[P3Z333ky3r3k[P Ь[[ZZZY3jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP2@j~\S^\_PCЬPЬPЬRRQ{RPPR PRPPP *Pdiff3: arg count rdiff3: can't open %s rdiff3: too many changes %d,%d=%d,%d %d,%d=%d,%d 123====%s %d: %da %d,%dc %s%sdiff3: logic error . HHLlib/libtermlib.a 755 0 33 33020 2552606164 7117 ! __.SYMDEF 363531385 0 27 100664 10112 ` `&'&'&'&'&'&'&z0&z0&z0'4 '4'4'_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_del_step_arc_quad_abs_box_circle_closevt_closepl_dot_erase_lbl_mv_lbl_umv_label_line_linemod_move_openvt_openpl_point_scale_space_obotx_oboty_botx_boty_scalex_scaley_scaleflag_oloy_ohiy_ohix_oextra_cont_putch_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_xargc_xargv_main__sigfdie__sigidie__sigqdie__sigindie__sigtdie__sigdie_s_rnge_abort__getarg__iargc__getenv__signal__s_stop_s_paus_system__pow_ci_pow_dd_pow_di_pow_hh_pow_ii_pow_ri_pow_zi_pow_zz_c_abs_c_cos_c_div_c_exp_c_log_c_sin_c_sqrt_z_abs_z_cos_z_div_z_exp_z_log_z_sin_z_sqrt_r_abs_r_acos_r_asin_r_atan_r_atn2_r_cnjg_r_cos_r_cosh_r_dim_r_exp_r_imag_r_int_r_lg10_r_log_r_mod_r_nint_r_sign_r_sin_r_sinh_r_sqrt_r_tan_r_tanh_srand__rand__d_abs_d_acos_d_asin_d_atan_d_atn2_d_cnjg_d_cos_d_cosh_d_dim_d_exp_d_imag_d_int_d_lg10_d_log_d_mod_d_nint_d_prod_d_sign_d_sin_d_sinh_d_sqrt_d_tan_d_tanh_i_abs_i_dim_i_dnnt_i_indx_i_len_i_mod_i_nint_i_sign_h_abs_h_dim_h_dnnt_h_indx_h_len_h_mod_h_nint_h_sign_l_ge_l_gt_l_le_l_lt_hl_ge_hl_gt_hl_le_hl_lt_ef1asc__ef1cmc__s_cat_s_cmp_s_copy_cabs_tanh_sinh_cosh_f_back_s_rdfe_c_dfe_y_getc_y_err_y_rsk_s_wdfe_y_putc_y_rev_e_rdfe_e_wdfe_s_rdue_c_due_s_wdue_e_rdue_e_wdue_icptr_icend_svic_icnum_icpos_z_getc_z_putc_z_rnew_s_rsfi_c_si_y_ierr_s_wsfi_z_wnew_e_rsfi_e_wsfi_f_inqu_setcilist_setolist_stcllist_setalist_f_rew_s_rsfe_x_getc_x_endp_xrd_SL_x_rev_rd_ed_rd_I_rd_L_rd_A_rd_AW_rd_F_rd_ned_rd_POS_rd_H_recloc_s_rsue_c_sue_s_wsue_e_wsue_e_rsue_reclen_do_us_do_uio_do_ud_s_wsfe_x_putc_xw_end_xw_rev_x_wSL_pr_put_e_rsfe_c_sfe_e_wsfe_syl_parenlvl_pc_revloc_pars_f_f_s_op_gen_f_list_i_tem_ne_d_e_d_gt_num_ap_end_cnt_ret_cp_rp_workdone_nonl_en_fio_do_fio_type_f_fmt_bg_s_wsle_t_putc_l_write_e_wsle_lwrt_I_lwrt_L_lwrt_A_lwrt_F_lwrt_C_lioproc_ltab_l_comma_l_first_t_getc_e_rsle_lquit_lcount_ltype_lchar_lx_ly_l_read_l_R_l_C_l_L_l_CHAR_rd_int_s_rsle_c_le_do_lio_f_open_isdev_fk_open_f_clos_f_exit_flush__g_char_b_char_inode_mvgbt_f_end_t_runc_mv_cur_w_ed_wrt_I_wrt_IM_wrt_L_wrt_A_wrt_AW_wrt_E_wrt_G_wrt_F_w_ned_wrt_AP_wrt_H_units_init_elist_reading_cplus_cblank_fmtbuf_external_doed_doned_doend_donewrec_dorevert_sequential_formatted_getn_putn_cf_curunit_recpos_cursor_scale_F_err_fatal_f_init_canseek_nowreading_nowwriting_icvt_dfe_rdfe_wdfe_s_rdfe_c_dfe_y_getc_y_tab_y_rnew_s_wdfe_y_putc_y_wnew_e_rdfe_e_wdfe_y_rend_y_wend_due_s_rdue_c_due_s_wdue_e_rdue_e_wdue_z_getc_z_putc_z_wnew_z_ungetc_s_rsfi_z_rnew_z_tab_c_si_s_wsfi_s_rdfi_c_di_s_wdfi_c_fi_e_rsfi_e_wsfi_e_rdfi_e_wdfi_c_li_s_rsli_s_wsli_e_rsli_e_wsli_iiorec__iiopos__recloc_rsue_sue_s_rsue_c_sue_s_wsue_e_wsue_e_rsue_s_rsfe_c_sfe_x_getc_x_rnew_x_tab_e_rsfe_new_s_wsfe_pr_put_x_putc_x_wend_x_wnew_e_wsfe_lrd_lchar_lx_ly_ltype_ltab_s_rsle_l_read_t_getc_e_rsle_t_sep_l_R_l_C_l_L_l_CHAR_lr_comm_get_repet_rd_int_s_wsle_t_putc_l_write_e_wsle_lwrt_I_lwrt_F_lwrt_D_lwrt_C_lwrt_DC_lwrt_L_lwrt_A_chk_len_lwrt_0_cnt_ret_cp_rp_dfio_en_fio_do_fio_type_f_fmt_bg_eor_uio_do_us_due_err_do_uio_do_ud_c_le_do_lio_rd_ed_rd_mvcur_rd_I_rd_L_rd_AW_rd_F_rd_ned_rd_POS_rd_H_w_ed_wr_mvcur_wrt_IM_wrt_L_wrt_AW_wrt_E_wrt_G_wrt_F_w_ned_wrt_AP_wrt_H_syl_parenlvl_pc_revloc_pars_f_f_s_op_gen_f_list_i_tem_ne_d_e_d_gt_num_ap_end__digit_icvt_bksp_f_back_f_rew_f_open_isdev_fk_open_f_clos_f_exit_flush__endf_f_end_t_runc_f_inqu_allocs_allocp_alloct_allocx_malloc_free_calloc_realloc_tmplate_fortfile_units_reading_external_sequential_formatted_fmtbuf_icptr_icend_fmtptr_doed_doned_doend_donewrec_dorevert_dotab_lioproc_getn_putn_ungetn_svic_cf_curunit_lunit_lfname_recpos_recnum_reclen_cursor_scale_radix_signit_tab_cplus_cblank_elist_errflag_endflag_lquit_l_first_leof_lcount_line_len_fatal_prnt_fmt_prnt_ext_prnt_int_ffputc_f_init_ini_std_canseek_finode_nowreading_nowwriting_g_char_b_char_inode_last_char_f_errlist_f_nerr_sccs_id_init66__no_66__box_wclear_initscr_endwin_mvprintw_mvwprintw_mvscanw_mvwscanw_mvwin_newwin_subwin_overlay_overwrite_printw__sprintw_wprintw_scanw__sscans_wscanw__win_wrefresh_touchwin_werase_wclrtobot_wclrtoeol__win_mvcur_fgoto_plod__putchar_plodput_putpad_ospeed_gettmode_setterm_zap_getcap_longname_delwin_winsertln_wdeleteln_scroll_wgetstr_wgetch_waddstr_waddch_wmove__echoit__rawmode_My_term__endwin_ttytype_Def_term__tty_ch_LINES_COLS__res_flg_stdscr_curscr__tty_AM_BS_CA_DA_DB_EO_GT_HZ_IN_MI_MS_NC_OS_UL_XN_NONL_UPPERCASE_normtty__pfast_AL_BC_BT_CD_CE_CL_CM_DC_DL_DM_DO_ED_EI_HO_IC_IM_IP_LL_MA_ND_SE_SF_SO_SR_TA_TE_TI_UC_UE_UP_US_VB_VE_VS_PC__unctrl_wstandout_wstandend_tstp_winsch_wdelch_getwd_prexit_cat_getwd_prexit_cat_killpg_killpg_setpgrp_getpgrp_setpgrp_getpgrp_sigsys_sigpeel_sigsys_sigpeel_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_wait3_wait3_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_sigsys_sigpeel_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_sigsys_sigpeel_allprint_printable_sprint_main_yyreject_yyracc_yyless_yywrap_allprint_printable_sprint_main_yyreject_yyracc_yyless_yywrap_errno_asin_acos_atan_atan2_hypot_cabs_errno_jn_yn_errno_j0_y0_errno_j1_y1_errno_pow_errno_signgam_gamma_errno_log_log10_cos_sin_errno_sqrt_errno_tan_tanh_sinh_cosh_errno_erf_erfc_errno_exp_floor_ceil_pow_rpow_gcd_invert_msqrt_mdiv_m_div_m_dsb_m_trq_m_in_m_out_sdiv_((s_div_min_omin_mout_omout_fmout_fmin_mult_m_mult_tradd_m_add_madd_msub_m_sub_move_xfree_xalloc_dummy_fatal_mcan_itom_mcmp_getwd_prexit_cat_getwd_prexit_cat_killpg_killpg_setpgrp_getpgrp_setpgrp_getpgrp_sigsys_sigpeel_sigsys_sigpeel_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_wait3_wait3_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_sigsys_sigpeel_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_sigsys_sigpeel_errno_acos_asin_atan_atan2satan_cbrt_errno_pow_exp_exp10_log_log10_sin_cos_sinh_cosh_sqrtdsqrt_r5_tan_tanh_ACTFILE_ADDT_ARGV_ASRT_BUFF__cntbl_CARD_CHR_CLCK__mask_CTTOT__pd_date_DATE_DEFNAME_DISPOSE_EXPO_FCALL_FLUSH_FNIL_FRTN_FSAV_GET_GOTO_HALT_IN_INCT_LINO_LLIMIT_LN_MAX_MULT_NAM_NARGCHK_NEW_NEWZ_NIL_PACK_PAGE_PRED_PUT_RANDOM_RANG4_READ4_READ8_READC_READE_READLN_RELEQ_RELNE_RELSGE_RELSGT_RELSLE_RELSLT_RELTGE_RELTGT_RELTLE_RELTLT_REMOVE_RESET_REWRITE_ROUND_RSNG4_SCLCK_SEED_SQRT_STLIM_SUBSC_SUBSCZ_SUBT_SUCC_TEOF_TEOLN_TIME_TRUNC_UNIT_UNPACK_WRITEC_WRITEF_WRITES_WRITLN_ERROR_GETNAME_IOSYNC_PCEXIT_PCLOSE__disply__argc__argv__stlim__stcnt__seed__minptr__maxptr__entry__filefre__fchain_input__actfile_output__err__inwin__outwin__errwin_PCSTART_PFLUSH_PMFLUSH_RAND_SETRACE_UNSYNC_UNWIND_APPEND_CATCHERR_SEEK_TELL_arc_box_circle_closevt_closepl_cont_dot_erase_label_line_linemod_move_openvt_openpl_point_putsi_space_b_blknos_iob_lseek_getc_read_write_openfirst_open__stop_close_exit_trap_devsw_b_blknos_iob_devread_devwrite_devopen_devclose_nullsys_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_hp_type_hp6_off_rm3_off_rm5_off_rm80_off_hp7_off_hptypes_hpst_hpopen_hpstrategy_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_httypes_htopen_htstrategy_htclose_htquiet_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_mbastart_mbainit_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_ubastd_up_gottype_up_type_up_off_fj_off_upst_upopen_upstrategy_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_ubasetup_ubafree_printf_prf_putchar_printn_getchar_gets_mtpr_mfpr_bcopy_cpu_mbaddr_mbaact_umaddr_ubaddr_ubaddr780_umaddr780_mbaddr780_ubaddr750_umaddr750_mbaddr750_ubaddr7ZZ_umaddr7ZZ_configure_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_rkstd_rk_off_rkopen_rkwait_rkstrategy_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_tmstd_tmopen_tmstrategy_tmclose_tmquiet_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_tsstd_ctsbuf_ts_uba_tsaddr_ts_tsopen_tsstrategy_tsclose_tgetent_tnchktc_tnamatch_tgetnum_tgetflag_tgetstr_UP_BC_tgoto_ospeed_PC_tputs_tgetent_tnchktc_tnamatch_tgetnum_tgetflag_tgetstr_UP_BC_tgoto_ospeed_PC_tputstermcap.o 363531114 0 27 100664 2170 ` LDx^YXЬ/P[]kYk/DPPPݬP[ݬ[PePPЬ[YX*ݏ8PX(PYIZYZ [*\#[P[P/bkݬ&P1,Z1p ^{PP[{:[j{P[ktcP[~߭WޭZj:ZZj  ߭$PZZj:Z[QQP$[PPP@jZ~[1K Zj#EPjkZ[kkj| j:jPjj: j|Zj‘j:ZЬ[Ь[k:[kk:[[PYYPYiPЬP`iߑّi@i#Y Zi0Z[ Z[P0PP[iP@[P[[hP[kPЬP`kڕkk:Pk@d[[$P[kPЬP`kڑk@k=[ݬ[^Ь[мZoXYPPY&YUY:XYPP\P^;Y4XhI%0YxYYP0PPY׭ kP@YYм[Z[PTERMCAPTERM/etc/termcap/etc/termcapTermcap entry too long Bad termcap entry Infinite tc= loop Termcap entry too long E^^\\::n r t bf   4; P ` gp}   "1 GPW ]nx    "< EP# 0:t~  0  !)19>BHNU\Lf jr vz,p_tbuf_hopcount_tgetentL19_getenv_strcmp_strcpy_tnchktc_open_read_close_write_tnamatchL54_strlenL74L89_tskip_tgetnumL97__ctype__tgetflagL112_tgetstrL123L134_tdecodetgoto.o 363531119 0 27 100664 867 ` D`h^Ь<[ԭЬ Yխ16H1P%11̏`̏` 1Ь PPYЭP֭YQ`PQPPPY֭ЭP֭`Z1[rPP+PPY֭YY Y Y Iխ=<խ0 (PhPPPiYY Y11֬֬ Y1WZZP֭PD1YPxPPPYPPPPY1,P.1Y1P211:P>1P3N1PB YPxPP YQ QQYQQPY1Pi1q1PdY 3Yd ǏdYP0PPǏdYPďdPPY YP0PP YP PPYP0PPíխ1IЬP1FZ%1Z1Y13Pn11dPr1POOPS "      ; L\'/_UP_BC_tgotoL18L19L14_strcpy_strcat tputs.o 363531124 0 27 100664 441 ` HHЬ[Z[kP@ ZPQPQ0QZkP@ Zk.'[kP@ kP0PPZ[kP@k*[ĬZ~ kZ{ s2iP2@!YYPPZYZ N~ ZZ5MS7)  . D ]       $-_tmspc10_ospeed_PC_tputsL16__ctype_ _strcat tputs.o 363531124 0 27 100664 441 ` HHЬ[Z[kP@ ZPQPQ0QZkP@ Zk.'[kP@ kP0PPZ[kP@k*[ĬZ~ kZ{ s2iP2@!YYPPZYZ N~ ZZ5MS7)  . D ]       $-_tmspc10_ospeed_PC_tputlib/libsa.a 644 0 33 57572 2732200631 6070 ! __.SYMDEF 392757662 0 27 100644 2870 ` z z z z z z #z *z 5z ;z Bz Iz Oz U&\&_&g&l&u&&&&|||||||||||| ||##&#.#3#8#@#H#P#X#a#j#s#|######R*R*R*R*R*R*R*R*R*R*R*R* R*//!/&/+/3/;/C/K/U/^d2ad2id2nd2sd2{d2d2d2d2d2d2d2T7T7T7T7T7T7T7T7T7T7T7T7 T7<<$<)<.<6<><F<N<U<]<i<r<{FA~FAFAFAFAFAFAFAFAFAFAFAFAFAFAFAHHHHH HHH%H-H9HBHJHRHXH`Hl`Oo`Ow`O|`O`O`O`O`O`O`O$R$R$R$R$R$R$R$R$R$R$R$R$R$R$R"$R)$R5Y=YBYKYSY\Yb^h^n^v_b_blknos_iob_lseek_getc_read_write_openfirst_open__stop_close_exit_trap_devsw_b_blknos_iob_devread_devwrite_devopen_devclose_nullsys_cpu_mbaddr_mbaact_umaddr_ubaddr_ubaddr780_umaddr780_mbaddr780_ubaddr750_umaddr750_mbaddr750_ubaddr7ZZ_umaddr7ZZ_configure_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_hp_type_hp6_off_rm3_off_rm5_off_rm80_off_hp7_off_hptypes_hpst_hpopen_hpstrategy_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_httypes_htopen_htstrategy_htclose_htquiet_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_mbastart_mbainit_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_mttypes_mtopen_mtstrategy_mtclose_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_rkstd_rk_off_rkopen_rkwait_rkstrategy_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_tmstd_tmopen_tmstrategy_tmclose_tmquiet_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_tsstd_ctsbuf_ts_uba_tsaddr_ts_tsopen_tsstrategy_tsclose_b_blknos_((iob_cpu_mbaddr_mbaact_umaddr_ubaddr_ubastd_up_gottype_up_type_up_off_fj_off_upst_upopen_upstrategy_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_ubasetup_ubafree_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_udastd_cudbuf_udaddr_uda_ud_ubaddr_uda_off_udopen_udcmd_udstrategy_printf_prf_putchar_printn_getchar_gets_mtpr_mfpr_bcopysys.o 379706837 0 27 100664 3696 ` 0( Ь[ԫ`PPPPXPd2lp[h[p[ZPPQxQQQPQxQPPZj Ъ Z~[~ ^Ь[kj]rX[k/[ZjZj/jjݬ[gP8ݬP0jZ[[Pݬ<~kЭP^Ь[Ь[Yլ 1eѬ ЬZJЭPԭ xѬ ­׭խխ ݬ1jí P@ݬ1Q֭ѭЭP@\CxPXPdx P@Ah2l[0x P@$ЭPЭ@x P@ έPxPPPZJ1|ݬ1 ^Ь[լ1[Y<PʏPP@ 10 12ԭd֭ѭ@>ЭP֭P[pPPXPdp[h2l[Mp[ZԭZ~ݬPPPPAPgP11xPP`PxPP`P֭vxHcXMԭ9.ԭЭԭѭ1Oԭ/xP P`PxPP`P֭ѭխ Џ[[`       @ ` `    = G V in ty           !)44D?TJdUl`tkv_cpu_mbaddr_mbaact_umaddr_ubaddr_ubaddr780_umaddr780_mbaddr780_ubaddr750_umaddr750_mbaddr750_ubaddr7ZZ_umaddr7ZZ_configureL26_mfpr_badlochp.o 379706898 0 27 100664 1664 ` ,0^Ь[ЫTZxZPxPPP`PZQxQQQPxT~J>ЭPˏXW2G'PPXWGhWJJP P@YիXѫX ЫXP@ ;AЫXP2@P2QQPPX^Ь[ЫTЫdxPxPP P`PQxQQQPPЭQA`P P@pЭPӏ@ ЭP2$ЭPЭQ2PPQЭP2PPQRPRRQЭPЭQ2aQQPЭQ2aQQPRQRRPЭPЭ(xPPЭQPݬ[HЭPӏӏ@@ЭPˏ~HЭPˏ~ݭݭݭPЫlP&vd62M2R%s1 JTJ2" 7H `7X/8/h82 @vxunknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF < C]lt{   $    (08@I8RH[Xdhnxw_devsw_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_hp_type_hp6_off_rm3_off_rm5_off_rm80_off_hp7_off_hptypes_hpst_hpopenL30_mbainit__stop_hpstrategyL46_mbastart_printfht.o 379706922 0 27 100664 1381 ` ^Ь[xTPxPPP`PˏTQxQQQPYԭЭPˏQ2@PPQ֭ЭP@xT~ i[JЫXZ(l[5PЏXX[ZPZPЬ[[^Ь[xTPxPPP`PˏTQxQQQPWY2ZW gZ$ΫlѬ gPѬѬݬ[gWЧXЧX gXX gPˏ~ˏX~t]Y KPY[1@Y &2PlP Ь[ЫZZ()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry  H\dk x  G W{     (08@IQU\eqz~ _devsw_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_httypes_htopenL23__stop_mbainit_htstrategy_htcloseL43L47_htquiet_mbastart_printfL68 mba.o 379706937 0 27 100664 563 ` ( ^Ь[xTPxPPP`xTPxPPP`PˏTQxQQQPZЫhP PˏhlPP PЭ ɏ֭ЭPΫlPЭQPЭPЭ Ѭ19xP5P`[xPPPP"PxPP *      (08@J NW(([_devsw_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_mbastartL22_mbainitL31 mt.o 379706966 0 27 100664 1204 ` h^Ь[xTPxPPP`PˏTQxQQQPYԭЭPˏQ2@PPQ֭ЭP@xT~2@DXXӏD[2ЫXZl[ZPZPЬ[[Ь[xTPxPPP`PˏTQxQQQPWZѬѬ0Ыlԧݬ[ˏYYX2VV.ΫlPxPPȬPP0ˏYЧˏ,XXPPS$SS$$$$$$$$$$$gˏ~zS2@DVVӏDPx*Pˏ~MZ Z1Z ZЫlPAnot a tape mt hard error: er=%b mt error: er=%b mt: unrecovered error mt: recovered by retry  H\dk x  "       (08@IQU\eqz~_devsw_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_mttypes_mtopenL23__stop_mbainit_mtstrategy_mtcloseL43L47_mbastart_printfrk.o 379706998 0 27 100664 1385 `  Ь[xTPxPPP QQ`ZЫXP@ իXѫX ЫXP2@PŏBPX Z ^Ь[xTPxPPwP jQQ`Zԭ[[PЫdTǏBPPPPPPPPPQQQPQQjZjZ2PxPP2QPQQxlPPPPxPʏPɏPѬjZ2 PPݭ[2jPPX2 ~2~2~2~2~xUjZ5ѭ 4P֭1խ ЫlPЬ[k rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry  +AH Sj  _s      (08@GOW [bjpv z_devsw_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_rkstd_rk_off_rkopenL24__stop_rkwait_rkstrategyL33_ubasetup_ubafree_printfL53 tm.o 379707021 0 27 100664 1040 ` lp Ь[[1ЫXZԫl[ZPZPЬ[[^Ь[xTPxPPP QQ`WЫTYXWxYZ[yPΫlPPѬZP)ѬZPѬ  ZPPPɬZPPP<ݭ[Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error  &/5 = B J R Y ` fl   ! 2 ;Ubi t            `kr ~    (08@HpPX]hqy }| _devsw_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_udastd_cudbuf_udaddr_uda_ud_ubaddr_uda_off_udopenL29_ubasetup_udcmd__stopL51_udstrategyL62_printf_ubafreeprf.o 379707206 0 27 100664 1347 ` \~ݬ^Ь[ЬZXXXX%1DPba1PO1PD ZY YYYjFjYWWWPxPY((PPX XWЊYjЭP֭`~YԭY<TЭP֭`W >?1yWPxPPPPPYP)խ ,XX X֭鑽 ֭jЭP֭`X1!XPX11Pd1Pc1 1PlXXPPo11Pu1Ps1|1Px11 ^Ѭ լ-Gάޭ[ݬݬ@ ݬݬPP֘{~ ޭP[PЬ[20uY"PY["PZ"[~#[  Z"x kP!^P[[  [[j[P Ь[*P#DP@ZP +PЬ[ 4PZZPP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Z [YZXѬ /kjkP PjQQP[Z[YZX,j Z[ZZX kj[[Y k kP PPЬ[ЬZ[ZP[YiYiZi[PP[kЬ[PЬ[ЬZUUYUU PY[ZiYPЬ[ЬZYj jIYY[IPЬ[ЬZYj jIYY[萏_IYIPЬ[ЬZYj jj_ jIYZY[IPЬ[ЬZ[PXXY[YPݬݬ@P~ ^Ь[ЬZԭP0P QQP[P[PЭP#[ P PPP0PP{ [P ^Ь[ѬZ ZޭZkdePkPP[ЬP׬Pj߭=^Ь[ԭYkkPPIYYЭPvSPQnSQQP IYYxPϬP5ѭZ~߭PZPѭЭPРZ5S/SPRQPQݏn.V PZЭPZЭjZ~߭>լP([ѫ[P [[  ݏsﵝЬ#Pk   RRPݬdP[W ݬPY   PPVp! ݬPN[P^ԭޭ[ ֬ѭ ޭP[P֪ݭ߭PЭPѭﲪ着頻ݏxܜ߭xPnPaPԠ WPԠMPԠCP 6P. ݬP[1PZj[PPZPݬ.P Ь[kkZjZj_PjkWPk^Ь[ЬZ[>PPY[P[PЭPѬЬPЬPѬЬPЬPѬЬPЬP^ݬݬPPѬѬЭP^լPPPPPPԭ֭xЭP^_OWOHЭHOBOݬ ݬݬhPP[[P^ݬgPݬ[PݬOPݬ CP PPݬݬ^ݬPݬ Pݬ PPPݬݬ?^ݬPݬ PPPݬݬݬ PuPݬݬݬݬ(P[kЬ Ь$[P Ь[[K4PZZP!Ь[kPkPPPPPݫݫ Ь[իkPPPPPxPӏ8P Ь[kPPPPPݫ  Ь[ZjPP[ ÏdIZPZjP^ݬݬ߭j9߭Kݬ>4K3'^ݬݬ߭9߭$^ݬݬ߭8߭ݬϣţMeKf3Ԣݬ^լ/ݬ~P"߭~8߭ݬ 88^ݬ߭F8ݬ߭8588DݬJ2J1pQB^ݬݬ߭7߭^ݬݬ߭7߭x4^ݬݬ ݬ߭7߭Nݬݬݬݬwݬݬeݬݬ]^~ݬH߭7߭ݬIݬQIP@@II@IIݬ8PJIPIIݬݬ﫼PﰩPCݬݬPݬƦPݬﺦPYP^P Ь[[PZxPӏPZP Ь[xPӏP9[UPZP@|HݣPݪ ׻P ZPp~xP PPPP֣^Ь[k(PP ݫPݫ PP^Ь[k(PP ݫPݫ PիЫPxP P ЫPРPk իЫP#P ^Ь[kk~%( PZjѭPЭPPݫPPP ЭPP::,,VV21CP1JЫPѠ10 Fx?P@1PePmvЭPЭQ2aQPQfЭPPЫPЭQРPQPQH~ݫЫPݠP.ЭP2[JZPЭPq ЭPѫѭ1|cЭPЭPP P-P3:ЫPЭQ~ݫЭP~ЭPp ЭPЫѭ 1ЭP@E3$ݪﺜ/#ЭPP&&@J<F&y~ F1ݫݭu#1ԭѭ1ЭPp@~ݭ: #֭ЫPݠݫ1ݫ "1 ^ԭ׬ 0ЭP@֭֬ѭ߭ݬH+ЭP@֭ѭ߭ݬ(+^լݬP; WD15!+P{m2)#D71PP~ݏl ! լ[ѬUEPݬ̒3メRݭ PNP裸+^p :*Pﱚ,P iOJ(ݭsP,P Fݬݏ2ݏݏA Ь[[P[ZZZ  ݑ[﨡+[ݬݏmݬ%mЬ[[%dKݬݏJݬ# ^ЬPxP PIݬ ݬݬ ^PP 1w((~4xЬPЭPPR--%ݬPuAЭP@ȏЬPݠݬ;ЬPݠ PЬPQQQPP&YLN....aaNNݭ'Z1ЬPxPӏP ݬ1ݬ1ݬ1ЬPР PxPӏPЬPРPxPӏPݬP51zЬP 1P1aЬPР PxPӏPЬPРPxPӏP ݬ 1(ЬPР P 1ݬk1 ݬB1ЬPР PxPӏ PaЬPPPTЬPРPxP PBЬPРPݠdP*ЬPЬPݠPݭﰚЬQPݬ1yЬPxPӏP1ЬPxPӏPЬPР PxPӏPԭ߭ЬPݠ PPЬP~֛PЬP~ݭ1Fݬ1^ЬPPP WWWWWW**W**********ЬPQA~ﲍЬPݠ ?ЬPՠ ݠ,ЬPP@[ݭЬPՠ ݠݬ8ЬPЬPР ЭP쑼#ЬPQQ1GݬЬPQQxP0P xP0PxPӏ PxPӏPѭZѭTЭPQQ1zР P1mЭPݠ 3ݏh$ݏh1ѭ A;ЭPQQ,PTЬQP ݬ*ݭ1ݬ6ЭЭ1ԭЬPР ?ЭPݠ~|PݭP,P˯PlЭݭխ1O1qЬPР PxP0P1ЬPРPxP0PЬPPPЬPРPqﺊЬPРPЬPРPԠ1sݬPݬĘPPѬPѬPPPݏl^ЬPPP%ЬPРPxP PЬPРPРѭ ﹊(ЬPР ЭPݭPԭݭǘPݭﻘPѭ֭ݭݭxѭݭPݭeݭffiP֭ݭ[PݭOP4xѭtݭ/Pݭ#P­Pݭ P﫭PLݭݭ#ݭխ ݭݬ֭ݭݭ1h֭ݭݭ1U͂P[ּݬ[{P`[P^Ь[kk~"Hԭ߭ݫ PZ߭ݫPYYPZ}PxPӏP ֭YPZyPݭY[03ZP^ԭ߭ݬP: ݭ ^Ь[PkPP@P1PSk~5Sѭ ѭ1ּ[ xPӏP1[P[1[Pּ289PZݫ ZPZ 1hxPӏP1nּPZ[ZﭕP1ѭ ּ[!~PZݬݫ PݬݫPЭPP1PP1P1P0P1P1WZGЭZԭݭ6ݭ1&ݭPPPZ:PݭOP`PZ9PݭPݭPݭ$PZPTѭݭݭѭѭݭ1sݭPݭPݭ1`ѭ1xP PݬݭcPݭSPݭPPZ1PݭHPݭ_xP PݬݭPݭPݭP!PZPQݭPݭMP1ѭݭPݭPɨPݭwPݭkP令PPZJPݭ7PݭUPfPݭ>PݭPCP1xP PݬݭPݭmPݭPPZP0ݭ8PݭP1hݭPZtPЭPxPӏP ݭy!խ ݭ>p~P1 ݭ1 ^Ь[kk~xԭ߭ݫ PZ߭ݫPYYPZPݭPYPZPݭΦPѭPPPﵦPPﶓPIݭ! ZL-YC-[:- ^Ь[kPPP#P1:k~﵂[DּPP ?00~i91[PZ1[vPՍP h{PZݫP[Z Pݪ1Э1/*ЫPxP PЫPѠЫ PxPӏ P 論MP zPZ[ZP1P 1^ԭ߭ݬP 1 ^Ь[kk~T,ԭЫ ЫЭPQQ Pݭ1ЭPPP1ЭPРPxP PЭPРPѠxЭPPPkЭPРPxP PYЭPРPѠK߭ݭP*߭ݭPݭ : ,ݭݭpPݭi ݫ]1M ^Ь[kk~3ԭЫ ЫЭPPP1ЭPРPxP PЭPРPѠЭPPPЭPРPxP PmЭPРPѠ_߭ݭP߭ݭPP@M} [)ݭw /ݭݭ`xP ﻊP[ ^Ь[ЬZԭZPPBwPݭ0wPԭ߭߭ݭݭZBݭJPPݭݭ[~ >Pݭ1 ^Ь[ЬZЬ YkIPP >ݬݬYZݫ ݬݬYZݫݫU[(1мPּPZPx~PЭPݠ ЭQP YʋPx~\PЭPݠ RЭQP ݫPݭxݬ[PcPݭW^Ь[k ի  [1yЭP@{PPPի  ݫ PP߭gPխݭ4P옫PP ^iiiiii1~!}1iխ2ݭ ݭ"1Rխ խ~ 517լլ~ խݭխ ݭխխ~~xլݭ g1PɭP~ ~zխ ݭ=խݭ>~խ~ լ1dլ ݭ ~1~ ?~~1]խ1ݭݭ[V~լ1%1ݭլPPP["1լ ݭݫ1L{61 ^ЬPPPPЬPP@lyЬPЬPݠ~ PѬ3~ЭP`PPP(ݬ vЭP`+3ݭլ PPPլ  ݬ Cݭ 0^Ь[ЭP@xԭPPPPPԭիЫPРݫa$ԭЭ1խ-֭~ЫPxP P1ݫ rP1ЭPРZjZPPZЭPZ ݪ{PPݭXPнխ1kѭ 1fyxPӏPݭZrP֭ԭխPЭPPݫ խ?ԭݭ܆Poѭ !ݫ P ݭ8Э1ЭPРZj+խ  խ  PPPZ 1xPӏP Zj  ZYjTխ ZDݪݭ[qPZP Pݭݭ#խԭ ݭ8'нխ1"խ ߭Э*ЭPݠPݭ8нխ߭ݭխFPHPP[!ЭP ^Ь[kk~w(PP PPPЫ PРݫ o![f!ݭ,pPݭpPݭ΄Pݭ„PaPPݭ龍PݭPݭ9P.PP/PЭPݠݭ^PCнU֭ЭPݠݭ:Pս$֭ݭPݭP ݭRнխݭݭݭ/mݭ%m߭/ЬP@Ktլ  ݬ;^ԭм[PxP PkkPP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PPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~QPYj_~P gg BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[S1xݏPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP|^[ [[[_ Ь[Z = 8[ePZ~9PZ ݫs ԫ kZP{P^߭ݬ\PPPP@Ь[ЬZ[YYPݬݏ tݬݬݏtݬ6Ь[ѬP ѫѫk֫k׫ЫP`Py.oxoxxxxx~*PYx[xk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZx [oPtxYPƏPxP[xbPZxHxPZPPZx8x~@PZZZxxPZPxxxPZPPjjwow1xYP[PwZwwwkwwk[P Ь[[ZZZwjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPv@j(\~\S^\_ \P\CЬ[PЬPЬRRQ{RPPR PRPPPubPH-O%d: too many register variablesinvalid flag -N%cTable size too smallinvalid flag -I%c invalid flag %c arg count %d%s: Bad parse, return code %d missing END statementwcannot open intermediate file %swriting errorfloating exception during constant evaluationvax cannot recover from floating exception @(#) FORTRAN 77 PASS 1, VERSION 2.10, 16 AUGUST 1980 SS .data 0.textMAIN_ characters out of order in implicit:%c-%c#NMJ N:MXJN[\]^_`NNNN  VW~8/ rb w Bt@ABhm@ABHdfv-uIKJMLNf+p@ABHGFEDfIKJMLN@ABHGFIKJMLNcvuf'&fa]e~^_`@ABkjci23n"6l:1<k#?(j,P*5iRS?gTO\Uy?zPsmtYZ=>nop  fu??}P?x?q?rffgh????!)?Qes;f}l??????????[@ABHyPOQ?eeeeNM?LKJ?;0/, o???w?v|{.q e$29s70Z4C6$@ABHGFEDQIKJMLN[f_`abc@ABHGIKJMLNd%@ABHGFEDIKJMLN@ABHGFEDIKJMLNX0@ABHGFEDIKJMLNff@ABHGFEDIKJMLN]^ f 7-HT<EY%A.)CGB"! V#(&89:15*W?'D+X=S \Q@3UI>FRfx{|}ffffff4f7-T<Y.Vf89:1WX=SQ3U>zRfHEACGB?D@IF^q|,-_|86|6||||| ||||->|4.-||->)||ww.  |O , |>>-||<,+Y###xpo  ((|>b|.a|W`Aw#YZYKIG@_|=c>;||@Ug,#_cJ|y+W_c*"SNL:987543 .,*R)"('F _ &^/ $*'+   !#)(%  6666666777777;3 44!!888888888888  111122<<==>>I55??JKMLLNN,,,,BBOODDP#FFRQQSS**TT@@UXVWWYY AAZC%%%&&&&&&&&&&&&&& $$$$''++//////.000(())))))))9999999\[[[[[[[[[[[]^^^^EE"--:GH_``````````````ahhhcjjjeebbkklllllldfggi %<E,(B+9!$#'*5)270@1-./:D4?"6H C>I;A&38,NNNNNNNSUSFRJRTJ PQJRNJJJNJJLJJKRJZJJJRTRSTUNJNJRKRJSNJSSJGKNRSTYXWVU[]\_^`KKNRTKNNNNKNKNNKNLKRKMNKKNKJNKKNNNNKNRSNJ KNQNFKJMRKLKNKKKKKKNN  !"$%&(9Mz-./012345678s{'XZ[@,s  d?dCEGLb`q<BDFKpo   d9f_IOtYA\=m 9+>Hcuwy|}): *egilkJNPRTVWr]^nhQUavx~; jlSTyacc stack overflowsyntax errorstatement cannot be reachedlabel already that of a formatunclassifiable statementlabel %s already definedthere is a branch to label %s from outside blocknamed BLOCKDATAmisplaced entry statement () argument listname declared as argument after usealtenate return argumentSAVE statementSAVE statementPARAMETER statementDOUBLE COMPLEX statementCHARACTER statementAUTOMATIC statementSTATIC statementlength specification *nlength must be a positive integer constantlength specification *(*)INTRINSIC statementequivalencestoo few initializerscan only save static variablescannot make %s parameterinconsistent storage classestoo many dimensionstoo many dimensionsIMPLICIT statementimplicit item must be single lettercannot be a namelist namedeclaration among executables.EQV. operator.NEQV. operatorconcatenation operator //substring operator :substring operator :hex constantoctal constantbinary constantconcatenation operator //no backward DO loopstoo many alternate returnscomputed GOTO list too longkl(J)K=L,N+P-Q*R/S$O:M$V $W$Z$ $ #$['$`+$\/$^3$]7$_;$XA$YF$M$W$a$k$p$z$$$$$$ $"$$$$#$&$'$%$($)$*$+%,%-%2%$%3,%56%4>%6F%7O%HT%8Y%9c%:i%;o%<w%=}%>%?%@%A%B%C%D%E%F%H%Iincludes nested too deepr%s/%sr/usr/include/%srCannot open file %simpossible lexstate %dillegal continuation card ignorednondigit in statement number fieldunbalanced quotes; closing quote supplied%dH too bigunbalanced parentheses, statement skippedNot a Fortran 66 keyword: %sfunctionname %s too long, truncated to %dbad bit identifierinvalid binary characterand.or.not.true.false.eq.ne.lt.le.gt.ge.neqv.eqv.assignautomaticbackspaceblockdatacallcharacterclosecommoncomplexcontinuedatadimensiondoubleprecisiondoublecomplexelseifelseendfileendifendentryequivalenceexternalformatfunctiongotoimplicitincludeinquireintrinsicintegerlogicalnamelistnoneopenparameterpauseprintprogrampunchreadrealreturnrewindsavestaticstopsubroutinethenundefinedwritemissing end statementDO loop or BLOCK IF not closedmissing statement number %sMAIN__MAIN_ %sMAINBLOCK DATA %s: L%dMAIN_MAIN_invalid entry nameexternal name already used entry %s: L%dretvalnoncharacter entry of character functionmismatched character entry lengthscharacter entry of noncharacter function.data 1local variable %s never usedadjustable dimension on non-argumentadjustable leng on nonargument.data 2%s: may not appear in namelist%s: common alignmentadjustable array in common_BLNK__ incompatible lengths for common block %sautomatic variable of nonconstant lengthmktmpnadjustable length_BLNK_%s cannot be a common block nameincompatible common declarationincompatible storage declarationsincompatible type declarationslengtypeincompatible type-length combinationincompatible use of intrinsic functioninvalid intrinsic declarationunknown intrinsic functioninvalid external declarationinvalid external declarationonly variables may be arraysonly last bound may be asterisk1-dim subscript in EQUIVALENCEnonconstant subscript in equivalence adjustable in equivalencebad storage class in equivalenceinconsistent equivalencebad alignment forced by equivalenceattempt to extend common %s backwardinconsistent common usageeqvcommon%s %05ld %05ld %dinvalid repetition count in DATA statementnon-constant initializertoo many initializersbad impldoblock 0%orpllist emptyattempt to initialize adjustable arrayinitialization of string of nonconstant lengthnonconstant implied DO parameternon-character datum initialized with character stringincompatible types in initialization %d %d setdata @42;2B2I2P2@@invalid complex constantmkconvcpexprfrexprfixtypefunction invocation of subroutinefixexprleft side of assignment must be variablec_divz_divaddr of addrDummy procedure not declared EXTERNAL. Code may be wrong.invalid class code %d for functionno substring of function callattempt to use untyped functionrecursive callmkfunct: impossible recursionmkfunct: impossible vprocclass %dattempt to use untyped statement functiondisagreement of argument types in statement function callstatement function definition and argument list differsubstring of noncharacter %smore than %d subscriptssubscripts on scalar variablewrong number of subscripts on %ss_rngesubscript on variable %s out of rangemkaddr. vtype=%d, vclass=%d mkaddrno qualifiers on parameter name %sused as variableadjustable automatic arrayattempt to use undefined variableattempted division by zeromkexprnonarithmetic operand of arithmetic operatornonarithmetic operand of negationNOT of nonlogicalnonlogical operand of logical operatorillegal comparisonorder comparison of complex datacomparison of nonarithmetic dataconcatenation of nonchar dataimpossible conversioncktypefoldconsnegopconspowerinteger ** negative power inline mod of nonintegersgn(nonconstant)conssgninteger**negativepow_hhpow_ddpow_zzcomplex division by zeropow_iipow_ripow_dipow_cipow_zielseif out of placeelse out of placeendif out of placeloops or if-then-elsescontrol stack emptyassignment to a non-variablestatement function amid executablesredeclaration of statement functionnon-variable argument in statement function definitionpause/stop argument must be constantpause/stop argument must be integer or strings_stops_pausnested loops with variable %sbad type on do variablebad type on DO pa((rametertoo few DO parameterstoo many DO parameterszero DO incrementDO range never executednoninteger assign variableinvalid type of arithmetic if expressionRETURN statement in main or block dataalternate return in nonsubroutineassigned goto variable must be integerintrealdblecmplxdcmplxifixidintfloatdfloatsnglichariacharchar achar maxmax0amax0max1amax1dmax1and$or#xor%not&lshiftrshift'minmin0amin0min1amin1dmin1aintdintanintdnintnintidnintabsiabs dabs cabs zabs modamoddmodsignisigndsigndimidimddimdprodlenindeximagaimagdimag conjg!dconjg"sqrt#dsqrt$csqrt%zsqrt&exp'dexp(cexp)zexp*log+alog+dlog,clog-zlog.log10/alog10/dlog100sin1dsin2csin3zsin4cos5dcos6ccos7zcos8tan9dtan:asin;dasin<acos=dacos>atan?datan@atan2Adatan2BsinhCdsinhDcoshEdcoshFtanhGdtanhHlgeIlgtKlleMlltOepbaseepprecepeminepemax eptiny ephugeepmrspfpexpnQfpabspUfprrspWfpfracYfpmake[fpscal]r_intd_intr_nintd_ninth_ninti_ninth_dnnti_dnntr_absh_absi_absd_absc_absz_absh_modi_modr_modd_modr_signh_signi_signd_signr_dimh_dimi_dimd_dimd_prod h_len i_len h_indx i_indxr_imagd_imagr_cnjgd_cnjgr_sqrtd_sqrtc_sqrtz_sqrtr_expd_expc_expz_expr_logd_logc_logz_logr_lg10d_lg10r_sind_sinc_sinz_sinr_cosd_cosc_cosz_cosr_tand_tanr_asind_asinr_acosd_acosr_atan d_atan r_atn2 d_atn2 r_sinh d_sinh r_cosh d_cosh r_tanh d_tanh hl_ge l_ge hl_gt l_gt hl_le l_le hl_lt l_lthr_expnir_expnhd_expnid_expnr_abspd_abspr_rrspd_rrspr_fracd_fracr_maked_maker_scald_scal     sqrtexplogsincostanasinacosatanatan2sinhcoshtanhimpossible intrinsic constantgeneric functionintrcall: bad intrgroup %dbad number of arguments to intrinsic %sbad argument type to intrinsic %sintraddr: %s is not intrinsiccannot pass %s as actualintraddr: impossible f1=%d HHHHHHHHHH I IIII!I(I.I3I>IEIOI[Iunlabeled format statementbad format numberbad end= clausebad err= clauseiostat must be an integer variablef_backf_rewf_endimpossible iostmt %dinvalid control %s for statementunknown iocontrol %sillegal positional iocontrolillegal * iocontroliocontrol %s repeatedno I/O list allowed in NAMELIST read/writeattempt to i/o array of unknown sizenon-left side in READ listdo_liodo_fiodo_uioattempt to use internal unit array of unknown sizebad unit specifierbad REC= clausebad format descriptorunformatted internal I/O not alloweddirect list-directed I/O not alloweddirect namelist I/O not alloweduflnbad unit in openbad file in openbad reclf_openf_closbad unit in close statementinquire by unit or by file, not bothmust inquire by unit or by filef_inqubad unit in I/O motion statementnon-character control clauseimpossible inquire parameter %sunitfmterrendiostatrecreclfilestatusaccessformblankexistopenednumbernamednamesequentialdirectformattedunformattednextrec0123456789abcdeftoo many digits in floating constantnamesstatement numbersillegal branch to inner block, statement %smay not branch to a formatillegal label %sexternal symbolsimproper use of builtin %sout of memoryWarning on line %d of %s: %s Error on line %d of %s: %s Declaration error for %s: %sDeclaration error %sExecution error %sCompiler error line %d of %s: %s Impossible %s %d in routine %sopcodetagstorage classtypeToo many %s. Try the -N%c optionFortran 77 feature used: %sF77 compiler extension used: %s < PQLSPURQTFF: h@>;MBimpossible element in concatenationputconstputconstTmTo .globl _%s_%s: .word LWM%d jmp L%dfseek failedfseek failed 2non-logical expression in IF statementcomputed goto index must be integerputxputxputopputpower: bad callputcxeqputcx1putcx1putcxcmpputch1: bad character conversionputch1putch1putcheqs_copyputchcmps_cmps_catattempt to take address of a registerputaddradjustable character functionputmnmx  84$ .stab L%d: .space 4 movab L%d,r0 jsb mcount subl2 $LF%d,sp ret movl %d(ap),%d(fp)L%d: %s %ld .word.long .long L%ld .long 0x%X .long 0x%X,0x%X .long 0 .long %s+%ld .align %d casel r0,$1,$%dL%d: .word L%d-L%d tstl r0 tstd r0 jlss L%d jeql L%d jbr L%d_%sv.%dL%dq.%dmemname .lcomm %s,%ld .globl _%s .comm _%s,%ld .align 1_%s: .word LWM%d_MAIN__: .word LWM%d_%s: .word LWM%d addl3 $%d,fp,ap movl $%d,(ap) subl2 r0,%d(ap) subl2 $%ld,%d(ap) subl2 r0,%d(ap) jmp L%d .set LWM%d,0x%x .stabd 0%o,0,0%o 0%o,0,0%o,%s 0.byte 0%o,0%o %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1'8"5.*2$                                                                                                                                     Llib/lpf 755 0 33 30000 2552601063 5320  ^Юn PPՀPpPP P P*(K r***P~*P~L( rѬ1ЬPРP`-vЬPРPbgЬPРI*Ѭ:ЬPРP`--ЬPРPmЬPݠ*A)(Ѭ1 TP())})P~( 2)P z)  d)[)Nd P;s] P()$)M)w PsP'׬(Ѭ1 ЬPݠb PwЬPݠ^& ׬q'([pd'$[[_[d(L\(T(BG(ݏ0(P)(Pr(P(P\'[ K&KS'[[ZsP1P 1P 1P 1P 1P 1P_1Y 2[)Kd&_&_K&YKI&Z[[ZPРQ֠aP * PYP1VPB'[[PP[[Z[[K% _K[&M&YK%Z[s1mZZJ%P[1Q[1L^*լx%[&YYլ\j&b&PРQ֠ aO& @&8&PРQ֠ a%& *&&PРQ֠ a% %P  h ^%%PРQ֠ a% /ЬZZZZZZZZZZu% ZZZZZZZZZP% ZZZZZZZZZ+% ZZZZZZZZZ% oZZZZZZZZZ$ JZZZZZZZZZ$ %ԭ$$PРQ֠ a$  ֭ѭ ԭp$ЬPЬPP[1k 1k}d:$kP PxPPL"PЭQA`cέPxPPP*$#PРQ֠Xa8#ݏX###PРQ֠ a# K׭խ[k1N##PРQ֠ a# ֭ѭ1ԭc#[#PРQ֠ aH# ֭ѭW*#߭1߭P#p2"]ԭ""PРQ֠ a" X֭ѭ ZZZZZZZZZ" ZZZZZZZZZt" ZZZZZZZZZO" ZZZZZZZZZ*" ZZZZZZZZZ" n![ x^ԭ!+Ь[$k ЫP֫^`[ݏ^?$ 9PP111 11k ЫP֫^`[ݏ^@kЫP֫``P [~ݬ P5^߭2P?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj~P  BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[(1xݏPZZ  YYX ZYYXZYZ~(PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PPp[ [[[ Ь[Z = 8[ePZ~9PZ ݫ ԫ kZP{(P^߭ݬDPPPݬݏ tݬݬݏtݬ6(.77 ~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [7PYPƏPxPbPZxpPZPPZx`~@PZZZ=6PZP)x*PZPPjj71xYP[PZkk[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@jt ~\S^\_Y PP CЬ; PЬPЬRRQ{RPPR PRPPP%P("( /dev/lpwCan't open printer %d rCan't find %s Printer IO error /usr/adm/lpacct/usr/adm/lpaccta%4d %s Printer IO error %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s @(#)lpf.c 4.5 (Berkeley) 81/06/10$$~$$~$$>A@>A>ab#C8DH00IFF9    I**I~ @$BBBBBB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B<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj ~P SK BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[*1xݏPZZ  YYX ZYYXZYZ~DPY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[ Ь[Z = 8[ePZ~9PZ ݫ7 ԫ kZP{DP^߭ݬ`PPPЬ[ЬZ[Y[YPݬݏ tݬݬݏtݬ6.~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [PxYPƏPxP_bPZxLPZPPZx<~@PZZZPZPxPZPPjj1xYP[PZkk[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j~\S^\_P|CЬgPЬPЬRRQ{RPPR PRPPPAP')AEQkou' '''!'+'1'04'5'8'?'C'0F'G'K'0M'N'Q'U'V'\'`'a'g'm'n'o'@v'''^'''j'''j'''''''''''''''''''''j'( ((((((^((#(&('(^*(1(5(;(<(@(^H(N(O(S(T(^X(`(e(^l(r(s(y(((^(((^(((r(((r(((^((((((((((()b)) )b)))) )%)j))0)5):);)A)F)N)T)Y)Z)`)e)i)m)u)x)})))))))))))))))))))))))))* **rispell: cannot initialize hash table w%s%s .. =%.*s ssen-y+iness+nessssel-y+i+less+lessse+s-y+ies+ess'+'ss+secn-t+ceycn-cy+tytilbytilib-le+ilityelbaif-y+iableelba-e+able+ableyti-e+ity+ityylb-e+yyl-y+ily+lylaci+allatnem+allanoi+altnem+mentgni-e+ing+ingretare+r-y+ier+erde+d-y+ied+edcitsi+iccihparg-y+ictse+st-y+iest+estcirtem-y+icyrtem-ry+ercigol-y+ictsigol-y+isttsi-e+ist+istmsi-e+ism+istnoitacif-y+icationnoitazi-e+ationrota-e+ornoit-e+ion+ionnaino+ianna+nevit-e+ive+iveezi-e+ize+izepihs+shipdooh-y+hood+hoodekil+likeantibiodiselectroenforehyperintrainterisokilomagnetometamicromillimismonomultinonoutoverphotopolyprepseudoresemistereosubsuperther((moultraunderun  AAAAAABBBBBB +,doresemistereosubsupertherlib/eign 755 0 33 1302 2550316541 5446 the of and to a in that is was he for it with as his on be at by i this had not are but from or have an they which one you were her all she there would their we him been has when who will more no if out so said what up its about into than them can only other new some could time these two may then do first any my now such like our over man me even most made after also did many before must through back years where much your way well down should because each just those people mr how too little state good very make world still own see men work long get here between both life being under never day same another know while last might us great old year off come since against go came right used take three o if out so said what up its about into than them can only other new some could time these two may then do first any my now such like our over man me even most made after also did many before must through back years where much your way well down should because each just those people mr how too little state good very lib/makewhatis 755 0 33 1003 2532124062 6652 rm -f /tmp/whatis /tmp/whatis$$ cd /usr/man for i in man1 man2 man3 man4 man5 man6 man7 man8 do cd $i /usr/lib/getNAME *.* cd .. done >/tmp/whatis ed - /tmp/whatis <<\! g/\\-/s//-/ g/\\\*-/s//-/ g/ VAX-11/s/// 1,$s/.TH [^ ]* \([^ ]*\).* \([^-]*\)/\2(\1) / g/ /s// /g w /tmp/whatis2 q ! /usr/ucb/expand -24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100 /tmp/whatis2 | sort >/tmp/whatis$$ /usr/ucb/unexpand -a /tmp/whatis$$ > /usr/lib/whatis chmod 644 /usr/lib/whatis rm -f /tmp/whatis /tmp/whatis$$ -f /tmp/whatis /tmp/whatis$$ cd /usr/man for i in man1 man2 man3 man4 man5 man6 man7 man8 do cd $i /usr/lib/getNAME *.* cd .. done >/tmp/whatis ed - /tmp/whatis <<\! g/\\-/s//-/ g/\\\*-/s//-/ g/ VAX-11/s/// 1,$s/.TH [^ ]* \([^ ]*\).* \([^-]*\)/\2(\1) / g/ /s// /g w /tmp/whatis2 q ! /usr/ucb/expand -24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100 /tmp/whatis2 | sort >/tmp/whatis$$ /usr/ucb/unexpand -a /tmp/whatis$$ > /usr/lib/whatis chmod 644 /usr/lib/whatis rm -f /tmp/whatis /tmp/whatislib/libplot.a 755 0 33 33154 2552606147 6450 ! __.SYMDEF 363531372 0 27 100664 8794 ` R!"W!"$\!L%d!&m!&v!'|!(!n*!t+!F-!.!z0!1!1!f2!3! 5!_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_del_step_arc_quad_abs_box_circle_closevt_closepl_dot_erase_lbl_mv_lbl_umv_label_line_linemod_move_openvt_openpl_point_scale_space_obotx_oboty_botx_boty_scalex_scaley_scaleflag_oloy_ohiy_ohix_oextra_cont_putch_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_xargc_xargv_main__sigfdie__sigidie__sigqdie__sigindie__sigtdie__sigdie_s_rnge_abort__getarg__iargc__getenv__signal__s_stop_s_paus_system__pow_ci_pow_dd_pow_di_pow_hh_pow_ii_pow_ri_pow_zi_pow_zz_c_abs_c_cos_c_div_c_exp_c_log_c_sin_c_sqrt_z_abs_z_cos_z_div_z_exp_z_log_z_sin_z_sqrt_r_abs_r_acos_r_asin_r_atan_r_atn2_r_cnjg_r_cos_r_cosh_r_dim_r_exp_r_imag_r_int_r_lg10_r_log_r_mod_r_nint_r_sign_r_sin_r_sinh_r_sqrt_r_tan_r_tanh_srand__rand__d_abs_d_acos_d_asin_d_atan_d_atn2_d_cnjg_d_cos_d_cosh_d_dim_d_exp_d_imag_d_int_d_lg10_d_log_d_mod_d_nint_d_prod_d_sign_d_sin_d_sinh_d_sqrt_d_tan_d_tanh_i_abs_i_dim_i_dnnt_i_indx_i_len_i_mod_i_nint_i_sign_h_abs_h_dim_h_dnnt_h_indx_h_len_h_mod_h_nint_h_sign_l_ge_l_gt_l_le_l_lt_hl_ge_hl_gt_hl_le_hl_lt_ef1asc__ef1cmc__s_cat_s_cmp_s_copy_cabs_tanh_sinh_cosh_f_back_s_rdfe_c_dfe_y_getc_y_err_y_rsk_s_wdfe_y_putc_y_rev_e_rdfe_e_wdfe_s_rdue_c_due_s_wdue_e_rdue_e_wdue_icptr_icend_svic_icnum_icpos_z_getc_z_putc_z_rnew_s_rsfi_c_si_y_ierr_s_wsfi_z_wnew_e_rsfi_e_wsfi_f_inqu_setcilist_setolist_stcllist_setalist_f_rew_s_rsfe_x_getc_x_endp_xrd_SL_x_rev_rd_ed_rd_I_rd_L_rd_A_rd_AW_rd_F_rd_ned_rd_POS_rd_H_recloc_s_rsue_c_sue_s_wsue_e_wsue_e_rsue_reclen_do_us_do_uio_do_ud_s_wsfe_x_putc_xw_end_xw_rev_x_wSL_pr_put_e_rsfe_c_sfe_e_wsfe_syl_parenlvl_pc_revloc_pars_f_f_s_op_gen_f_list_i_tem_ne_d_e_d_gt_num_ap_end_cnt_ret_cp_rp_workdone_nonl_en_fio_do_fio_type_f_fmt_bg_s_wsle_t_putc_l_write_e_wsle_lwrt_I_lwrt_L_lwrt_A_lwrt_F_lwrt_C_lioproc_ltab_l_comma_l_first_t_getc_e_rsle_lquit_lcount_ltype_lchar_lx_ly_l_read_l_R_l_C_l_L_l_CHAR_rd_int_s_rsle_c_le_do_lio_f_open_isdev_fk_open_f_clos_f_exit_flush__g_char_b_char_inode_mvgbt_f_end_t_runc_mv_cur_w_ed_wrt_I_wrt_IM_wrt_L_wrt_A_wrt_AW_wrt_E_wrt_G_wrt_F_w_ned_wrt_AP_wrt_H_units_init_elist_reading_cplus_cblank_fmtbuf_external_doed_doned_doend_donewrec_dorevert_sequential_formatted_getn_putn_cf_curunit_recpos_cursor_scale_F_err_fatal_f_init_canseek_nowreading_nowwriting_icvt_dfe_rdfe_wdfe_s_rdfe_c_dfe_y_getc_y_tab_y_rnew_s_wdfe_y_putc_y_wnew_e_rdfe_e_wdfe_y_rend_y_wend_due_s_rdue_c_due_s_wdue_e_rdue_e_wdue_z_getc_z_putc_z_wnew_z_ungetc_s_rsfi_z_rnew_z_tab_c_si_s_wsfi_s_rdfi_c_di_s_wdfi_c_fi_e_rsfi_e_wsfi_e_rdfi_e_wdfi_c_li_s_rsli_s_wsli_e_rsli_e_wsli_iiorec__iiopos__recloc_rsue_sue_s_rsue_c_sue_s_wsue_e_wsue_e_rsue_s_rsfe_c_sfe_x_getc_x_rnew_x_tab_e_rsfe_new_s_wsfe_pr_put_x_putc_x_wend_x_wnew_e_wsfe_lrd_lchar_lx_ly_ltype_ltab_s_rsle_l_read_t_getc_e_rsle_t_sep_l_R_l_C_l_L_l_CHAR_lr_comm_get_repet_rd_int_s_wsle_t_putc_l_write_e_wsle_lwrt_I_lwrt_F_lwrt_D_lwrt_C_lwrt_DC_lwrt_L_lwrt_A_chk_len_lwrt_0_cnt_ret_cp_rp_dfio_en_fio_do_fio_type_f_fmt_bg_eor_uio_do_us_due_err_do_uio_do_ud_c_le_do_lio_rd_ed_rd_mvcur_rd_I_rd_L_rd_AW_rd_F_rd_ned_rd_POS_rd_H_w_ed_wr_mvcur_wrt_IM_wrt_L_wrt_AW_wrt_E_wrt_G_wrt_F_w_ned_wrt_AP_wrt_H_syl_parenlvl_pc_revloc_pars_f_f_s_op_gen_f_list_i_tem_ne_d_e_d_gt_num_ap_end__digit_icvt_bksp_f_back_f_rew_f_open_isdev_fk_open_f_clos_f_exit_flush__endf_f_end_t_runc_f_inqu_allocs_allocp_alloct_allocx_malloc_free_calloc_realloc_tmplate_fortfile_units_reading_external_sequential_formatted_fmtbuf_icptr_icend_fmtptr_doed_doned_doend_donewrec_dorevert_dotab_lioproc_getn_putn_ungetn_svic_cf_curunit_lunit_lfname_recpos_recnum_reclen_cursor_scale_radix_signit_tab_cplus_cblank_elist_errflag_endflag_lquit_l_first_leof_lcount_line_len_fatal_prnt_fmt_prnt_ext_prnt_int_ffputc_f_init_ini_std_canseek_finode_nowreading_nowwriting_g_char_b_char_inode_last_char_f_errlist_f_nerr_sccs_id_init66__no_66__box_wclear_initscr_endwin_mvprintw_mvwprintw_mvscanw_mvwscanw_mvwin_newwin_subwin_overlay_overwrite_printw__sprintw_wprintw_scanw__sscans_wscanw__win_wrefresh_touchwin_werase_wclrtobot_wclrtoeol__win_mvcur_fgoto_plod__putchar_plodput_putpad_ospeed_gettmode_setterm_zap_getcap_longname_delwin_winsertln_wdeleteln_scroll_wgetstr_wgetch_waddstr_waddch_wmove__echoit__rawmode_My_term__endwin_ttytype_Def_term__tty_ch_LINES_COLS__res_flg_stdscr_curscr__tty_AM_BS_CA_DA_DB_EO_GT_HZ_IN_MI_MS_NC_OS_UL_XN_NONL_UPPERCASE_normtty__pfast_AL_BC_BT_CD_CE_CL_CM_D((C_DL_DM_DO_ED_EI_HO_IC_IM_IP_LL_MA_ND_SE_SF_SO_SR_TA_TE_TI_UC_UE_UP_US_VB_VE_VS_PC__unctrl_wstandout_wstandend_tstp_winsch_wdelch_getwd_prexit_cat_getwd_prexit_cat_killpg_killpg_setpgrp_getpgrp_setpgrp_getpgrp_sigsys_sigpeel_sigsys_sigpeel_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_wait3_wait3_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_sigsys_sigpeel_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_sigsys_sigpeel_allprint_printable_sprint_main_yyreject_yyracc_yyless_yywrap_allprint_printable_sprint_main_yyreject_yyracc_yyless_yywrap_errno_asin_acos_atan_atan2_hypot_cabs_errno_jn_yn_errno_j0_y0_errno_j1_y1_errno_pow_errno_signgam_gamma_errno_log_log10_cos_sin_errno_sqrt_errno_tan_tanh_sinh_cosh_errno_erf_erfc_errno_exp_floor_ceil_pow_rpow_gcd_invert_msqrt_mdiv_m_div_m_dsb_m_trq_m_in_m_out_sdiv_s_div_min_omin_mout_omout_fmout_fmin_mult_m_mult_tradd_m_add_madd_msub_m_sub_move_xfree_xalloc_dummy_fatal_mcan_itom_mcmp_getwd_prexit_cat_getwd_prexit_cat_killpg_killpg_setpgrp_getpgrp_setpgrp_getpgrp_sigsys_sigpeel_sigsys_sigpeel_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_wait3_wait3_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_sigsys_sigpeel_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_sigsys_sigpeel_errno_acos_asin_atan_atan2satan_cbrt_errno_pow_exp_exp10_log_log10_sin_cos_sinh_cosh_sqrtdsqrt_r5_tan_tanh_ACTFILE_ADDT_ARGV_ASRT_BUFF__cntbl_CARD_CHR_CLCK__mask_CTTOT__pd_date_DATE_DEFNAME_DISPOSE_EXPO_FCALL_FLUSH_FNIL_FRTN_FSAV_GET_GOTO_HALT_IN_INCT_LINO_LLIMIT_LN_MAX_MULT_NAM_NARGCHK_NEW_NEWZ_NIL_PACK_PAGE_PRED_PUT_RANDOM_RANG4_READ4_READ8_READC_READE_READLN_RELEQ_RELNE_RELSGE_RELSGT_RELSLE_RELSLT_RELTGE_RELTGT_RELTLE_RELTLT_REMOVE_RESET_REWRITE_ROUND_RSNG4_SCLCK_SEED_SQRT_STLIM_SUBSC_SUBSCZ_SUBT_SUCC_TEOF_TEOLN_TIME_TRUNC_UNIT_UNPACK_WRITEC_WRITEF_WRITES_WRITLN_ERROR_GETNAME_IOSYNC_PCEXIT_PCLOSE__disply__argc__argv__stlim__stcnt__seed__minptr__maxptr__entry__filefre__fchain_input__actfile_output__err__inwin__outwin__errwin_PCSTART_PFLUSH_PMFLUSH_RAND_SETRACE_UNSYNC_UNWIND_APPEND_CATCHERR_SEEK_TELL_arc_box_circle_closevt_closepl_cont_dot_erase_label_line_linemod_move_openvt_openpl_point_putsi_spacearc.o 363530812 0 27 100664 327 ` p<XPa`ݏaݬݬݬ ݬݬݬ    , 6 @ J T ^ h   #_arcL18__iob__flsbuf_putsi box.o 363530815 0 27 100664 237 ` T00ݬݬݬݬݬݬ ݬݬ ݬݬݬݬ    % 2 ? L   _boxL12_move_cont circle.o 363530817 0 27 100664 274 ` P<@Pc`ݏcݬݬݬ     , 6 @ J  &_circleL18__iob__flsbuf_putsiclose.o 363530820 0 27 100664 212 `  H      (,_closevtL18__iob_fflush_closeplL24cont.o 363530822 0 27 100664 256 ` H<8Pn`ݏnݬݬ    , 6 @  $_contL18__iob__flsbuf_putsidot.o 363530825 0 27 100664 331 ` |<P^Pd`ݏdݬݬݬ ݬԭЭP@֭ѭ   " / 9 C M W k   #_dotL18__iob__flsbuf_putsi erase.o 363530828 0 27 100664 202 ` 40(Pe``Pݏe   " /  _eraseL18__iob__flsbuflabel.o 363530832 0 27 100664 406 ` 0x^Pt`ݏtԭ;ЭP֭Q@a ЭP֭@~ЬPЭQA`P ``Pm T   " / A H U \ o       _labelL18__iob__flsbufline.o 363530834 0 27 100664 292 ` \<HPl`ݏlݬݬݬ ݬ    , 6 @ J T  $_lineL18__iob__flsbuf_putsilinmod.o 363530837 0 27 100664 408 ` 0x^Pf`ݏfԭ;ЭP֭Q@a ЭP֭@~ЬPЭQA`P ``Pm T   " / A H U \ o        _linemodL18__iob__flsbufmove.o 363530840 0 27 100664 256 ` H<8Pm`ݏmݬݬ    , 6 @  $_moveL18__iob__flsbuf_putsiopen.o 363530842 0 27 100664 116 ` 0 _openvtL12_openplL17point.o 363530845 0 27 100664 257 ` H<8Pp`ݏpݬݬ    , 6 @  %_pointL18__iob__flsbuf_putsi putsi.o 363530847 0 27 100664 298 ` l0PPQPa~xPPPQPaxPP~   " - 3 D K V f  _putsiL18__iob__flsbufspace.o 363530850 0 27 100664 293 ` \<HPs`ݏsݬݬݬ ݬ    , 6 @ J T  %_spaceL18__iob__flsbuf_putsi    " - 3 D K V f  _putsiL18__iob__flsbufspace.o 363530850 0 27 100664 293 ` \<HPs`ݏsݬݬݬ ݬ    , 6 @ Jlib/lib4014.a 755 0 33 16570 2552606046 6063 ! __.SYMDEF 363531307 0 27 100664 1224 `      f  R R    !'/7^>6ELSZ`fnv_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_del_step_arc_quad_abs_box_circle_closevt_closepl_dot_erase_lbl_mv_lbl_umv_label_line_linemod_move_openvt_openpl_point_scale_space_obotx_oboty_botx_boty_scalex_scaley_scaleflag_oloy_ohiy_ohix_oextra_cont_putcharc.o 363530867 0 27 100664 1309 `  Ь^ì PnPPvPìPnPPvPEԭPVPPEЭRVRR`RPvPV̭p~pPg5PPjP ѭ ݭЬ ЭЬЭݭݭ((`Ѭ  Ѭԭݬݬ ݬݬ|PݬݬݬݬePì~Pì~yPxѭѭyѭ Py1PPxѭѭ 4*ìPnPPvPEЭPVPPVRcPRp~npPnPdPnR`RPjPѬѬ*ѬѬѬѬѬ*Ѭ#ѭѭݭݭЭЭѭܭ1ѭЭPP 1ѭѭѭ 6,ìPnPPvPEԭPVPPVRcPRp~ppPnPdPnR`RPjPѬѬ*ѬѬѬѬѬ$ѬѭݭݭЭЭѭܭ1 ѭЭPP  1ѭѭѬ  Ѭ!PѬ ѬPPѬPլάPЬPAQ [o{ Xb  V`    "(F.|39=A_del_stepL13_arcL18_sqrt_move_quad_abs_contL79L88 box.o 363530870 0 27 100664 237 ` T00ݬݬݬݬݬݬ ݬݬ ݬݬݬݬ    % 2 ? L   _boxL12_move_cont circle.o 363530872 0 27 100664 133 ` $$ݬ ~ݬ ~ݬݬ  _circleL12_arc close.o 363530875 0 27 100664 267 ` 4T0   ! ' .  &/3_closevtL18_putch__iob_fflush_closeplL25 dot.o 363530877 0 27 100664 73 `   _dotL12 erase.o 363530880 0 27 100664 303 ` @`8^     ! ( / 8  "*07_eraseL16_putch_ohiy_ohix_oextra_oloy_sleep label.o 363530883 0 27 100664 287 ` L(<( [ Z[K4Z[ Z[KZ[ Z[KZ HHHHHHJJJJJJJJJJ DDDDDDEEEEEEEEEE  $ : CL ` '_lbl_mv_lbl_umv_labelL14_putch line.o 363530885 0 27 100664 154 `  0ݬݬݬݬ     _lineL12_move_contlinemod.o 363530887 0 27 100664 224 ` t$^ЬP`PPd:Pl*PsЬP1ca~dЬPdݐbې`  L  _linemodL12_putchmove.o 363530890 0 27 100664 151 ` 0ݬݬ   _moveL12_putch_cont open.o 363530892 0 27 100664 116 ` 0 _openvtL12_openplL17point.o 363530895 0 27 100664 155 `  0ݬݬݬݬ    _pointL12_move_cont scale.o 363530897 0 27 100664 362 ` l0<HPPcPiPu!dDdDfDfDgBPvPg:PvP"A\("A\(HDHD@@$,4<FN V^ e  *_scaleL15_scalex_scaley_scaleflagspace.o 363530900 0 27 100664 432 ` h lXv`v]nPvPnPvPì PnPPgP1RvRìPnPPgP!RvRCFCF    * 0 CK [c  ")4<D_spaceL19_botx_boty_obotx_oboty_scaleflag_scalex_scaleysubr.o 363530904 0 27 100664 1140 ` (^nPVRcRPRVPdRPVR`PRjRnPVRcRPRVPdRPVR`PRjRxPPPPPPˏP^~hPN~TPP Pѭ, ~ЭѭHѭ ɏ`~Эɏ`~ ~ЭNѭ*ɏ`~\ɏ`~LЭѭɏ`~(Эjɏ@~ЭP׭PjfP_``PLݬ2@@  2=G  ",>NV`rz      &.9?EKSY]bims|_obotx_oboty_botx_boty_scalex_scaley_scaleflag_oloy_ohiy_ohix_oextra_contL29_abs_putchL44__iob__flsbuf",>NV`rzlib/lib300.a 755 0 33 17632 2552606042 5771 ! __.SYMDEF 363531303 0 27 100664 746 ` . ff$)07=DJ SfY_ekqw  )4;BHOTZ_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_yscarc.o 363530916 0 27 100664 73 `   _arcL12 box.o 363530919 0 27 100664 237 ` T00ݬݬݬݬݬݬ ݬݬ ݬݬݬݬ    % 2 ? L   _boxL12_move_cont circle.o 363530921 0 27 100664 76 `  _circleL12close.o 363530924 0 27 100664 235 ` $T      $,3_closevtL18_closeplL23__iob_fflush_reset dot.o 363530926 0 27 100664 73 `   _dotL12 erase.o 363530929 0 27 100664 149 ` $$^ԭ ֭nPqPC  _eraseL29_spew label.o 363530932 0 27 100664 163 ` (0^ݭЬP֬`    _labelL29_xnow_spew line.o 363530938 0 27 100664 1241 ` (ݬPPݬ PPݬPPݬPPAݬPPݬPxPpj^ݬݬPݬݬ ݬݬ=pP~3fIPjPì PnPPvPìPnPPvPVPqP' VPqP  խv v nPVRfPRvRnPVRfPRvRԭ׭1nPVRdPRnP`PRnPbPRjRsݭiP ~XЭP׭PnPVRdPRnP`PRn5PbPRjR%ݭP ~ ЭP׭P.SA   & 2 ; G P Yf o {    '/X y           &-^37=CGNU[cjpy_lineL29_ysc_yconv_xsc_xconv_iline_contL39_ynow_xnowL43_movep_dist2_sqrt_inplot_abval_spew_outplot linmod.o 363530940 0 27(( 100664 77 `  _linemodL12 move.o 363530942 0 27 100664 253 ` 4T(ݬPPݬPP   & /  &-_moveL12_ysc_yconv_xsc_xconv_movep open.o 363530946 0 27 100664 985 ` P,(V^PdPgPoRjRV=PdrPgPbRjRjV(Pd]PjPPPRGAA@@FpCF@CpC     # ) / 6 < E L Q X ^emu {   "*19AJRX^elt|_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openplL29_printf_gtty_reset_signal_openvtL44 point.o 363530948 0 27 100664 168 `  0ݬݬ .    _pointL12_move_labelspace.o 363530952 0 27 100664 427 ` dxPvdvanPvPnPvPì PnPPV'RfPRvRìPnPPVRfPRvRFF    * 9D S^ d h#)07?G_deltx_delty_spaceL31_botx_boty_obotx_oboty_scalex_scaley subr.o 363530959 0 27 100664 2268 ` T (լЬPάPPPP8+"}wqjѬ )jfP_`P7A=P6``P#ݬ ݏݏK^ì PnPPvPìPnPPvPEPVPPERVRR`RP^ммЭ^Ѭ Ѭ}sPѬP ]WPnPPfPjP@ nPdPjPPPݭP ݭЭP׭P~P ݭiЭP׭P!PnPPfPjP  nPdPjPPPݭuP ݭЭP׭PT~JP ݭЭP׭PЬЬ^nPVRcRPRVPdRPVR`PRjRЭP^nPVRcRPRVPdRPVR`PRjRЭPAABB ' : F L S \irx               u" # " " " " "  " +=C# OZ# r}# # " # & ' ( -+ 8, B-  "+.26>BFJPV\bbkou} Vl"  _abvalL35_xconvL40_xscale_xoffset_yconvL45_yscale_inplotL50_PTTY_OUTF_stty_spew_outplotL57__iob_fflush_ITTYL62__flsbuf_tobotleftL69_move_resetL75_exit_dist2L81_swapL86_movepL91_xnow_ynow_xscL114_obotx_scalex_botx_yscL119_oboty_scaley_boty Vllib/lib300s.a 755 0 33 20220 2552606044 6141 ! __.SYMDEF 363531305 0 27 100664 1092 ` Z_d8lu~n@ 8 8 8 F                 # + 3 ; BIPW^eltz_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_yscarc.o 363530971 0 27 100664 73 `   _arcL12 box.o 363530973 0 27 100664 237 ` T00ݬݬݬݬݬݬ ݬݬ ݬݬݬݬ    % 2 ? L   _boxL12_move_cont circle.o 363530975 0 27 100664 76 `  _circleL12close.o 363530978 0 27 100664 235 ` $T      $,3_closevtL18_closeplL23__iob_fflush_reset dot.o 363530981 0 27 100664 73 `   _dotL12 erase.o 363530984 0 27 100664 149 ` $$^ԭ ֭nPqPC  _eraseL29_spew label.o 363530987 0 27 100664 187 ` 00^j#PPݭЬP֬`A    _labelL29_xnow_spew line.o 363530992 0 27 100664 1233 ` (ݬPPݬ PPݬPPݬPPAݬPPݬPxPpj^ݬݬPݬݬ ݬݬ=pP~3fIPjPì PnPPvPìPnPPvPVPqP'PPPP0PVQqQQQQPPխvvnPVRfPRvRnPVRfPRvR~ԭ׭1nPVRdPRnP`PRnqPbPRjRPPPP[P~QPnPVRdPRnP`PRn5PbPRjRPPPPP~PPxPPPQQP~eA   & 2 ; G P Yf o {    .6_ j          &-^37=CGNU[cipy_lineL29_ysc_yconv_xsc_xconv_iline_contL39_ynow_xnowL43_movep_dist2_sqrt_inplot_spew_abval_outplot linmod.o 363530994 0 27 100664 77 `  _linemodL12 move.o 363530997 0 27 100664 253 ` 4T(ݬPPݬPP   & /  &-_moveL12_ysc_yconv_xsc_xconv_movep open.o 363531001 0 27 100664 985 ` P,(V^PdPgPoRjRV=PdrPgPbRjRjV(Pd]PjPPPRGAA@@FpCF@CpC     # ) / 6 < E L Q X ^emu {   "*19AJRX^el((t|_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openplL29_printf_gtty_reset_signal_openvtL44 point.o 363531004 0 27 100664 168 `  0ݬݬ .    _pointL29_move_labelspace.o 363531008 0 27 100664 427 ` dxPvdvanPvPnPvPì PnPPV'RfPRvRìPnPPVRfPRvRFF    * 9D S^ d h#)07?G_deltx_delty_spaceL31_botx_boty_obotx_oboty_scalex_scaley subr.o 363531015 0 27 100664 2152 ` (xլЬPάPPPPVݏPI=4+"v_YSLRNPG``P4ݬݏݏg^ì PnPPvPìPnPPvPEPVPPERVRR`RP^ммЭ,^ }sխPPPP4PխQQQPݭBPݭ4PPѭЭPЭPPPIPPט@խ8խܘ~í蘏x/ݭЭP׭Pѭ2ѭí蘏GPPט~IЭP׭PDPPPP@ԭѭ 8ѭ'ݭݭݭЭP׭PխխݭxPPɭP~ЬЬN^nPVRcRPRVPdRPVR`PRjRЭP^nPVRcRPRVPdRPVR`PRjRЭP ' : F L S \iu~           c" m# y" # 0i " # -& 8' B( _+ j, t-  "+.26>BFJPV\bnkou}F\"T  _abvalL35_xconvL40_xscale_xoffset_yconvL45_yscale_inplotL50_PTTY_OUTF_stty_spew_outplotL57__iob_fflush_ITTYL62__flsbuf_tobotleftL68_move_resetL74_exit_dist2L80_swapL85_movepL90_xnow_ynow_xscL111_obotx_scalex_botx_yscL116_oboty_scaley_botyF\"T  _abvalL35_xconvL40_xscale_xoffset_yconvL45_yscale_inplotL50_PTTY_OUTF_stty_spew_outplotL57__iob_fflush_ITTYL62__flsbuflib/lib450.a 755 0 33 21472 2552606051 5774 ! __.SYMDEF 363531310 0 27 100664 1652 ` x>h  p P P P f** ****'*.*6*>*G*O*U*[*b*i*q*y**z^$$$$$$$$$$$$$_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_del_step_arc_quad_abs_box_circle_closevt_closepl_dot_erase_lbl_mv_lbl_umv_label_line_linemod_move_openvt_openpl_point_scale_space_obotx_oboty_botx_boty_scalex_scaley_scaleflag_oloy_ohiy_ohix_oextra_cont_putch_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_yscarc.o 363531028 0 27 100664 73 `   _arcL12 box.o 363531030 0 27 100664 237 ` T00ݬݬݬݬݬݬ ݬݬ ݬݬݬݬ    % 2 ? L   _boxL12_move_cont circle.o 363531032 0 27 100664 76 `  _circleL12close.o 363531035 0 27 100664 235 ` $T      $,3_closevtL18_closeplL23__iob_fflush_reset dot.o 363531037 0 27 100664 73 `   _dotL12 erase.o 363531041 0 27 100664 149 ` $$^ԭ ֭nPqPC  _eraseL29_spew label.o 363531044 0 27 100664 163 ` (0^ݭЬP֬`    _labelL29_xnow_spew line.o 363531049 0 27 100664 1241 ` (ݬPPݬ PPݬPPݬPPAݬPPݬPxPpj^ݬݬPݬݬ ݬݬ=pP~3fIPjPì PnPPvPìPnPPvPVPqP' VPqP  խv v nPVRfPRvRnPVRfPRvRԭ׭1nPVRdPRnP`PRnPbPRjRsݭiP ~XЭP׭PnPVRdPRnP`PRn5PbPRjR%ݭP ~ ЭP׭P.SA   & 2 ; G P Yf o {    '/X y           &-^37=CGNU[cjpy_lineL29_ysc_yconv_xsc_xconv_iline_contL39_ynow_xnowL43_movep_dist2_sqrt_inplot_abval_spew_outplot linmod.o 363531051 0 27 100664 77 `  _linemodL12 move.o 363531054 0 27 100664 253 ` 4T(ݬPPݬPP   & /  &-_moveL12_ysc_yconv_xsc_xconv_movep open.o 363531057 0 27 100664 1043 ` P8(V[Pd|PgPlRjRtV:PdoPgP_RjRWV%PdZPjPPP?5AA@@FpCF@CpC     # ) / 6 < E L Q X ^ d k qx    "*19AJRX^elt|_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openplL29_printf_gtty_reset_signal_stty_openvtL45 point.o 363531060 0 27 100664 168 `  0ݬݬ . ((   _pointL12_move_labelspace.o 363531063 0 27 100664 393 ` ` `PvXvUnPvPnPvPì PnPPgP2RvRìPnPPgP"RvRFF    * :B RZ  ")19_spaceL29_botx_boty_obotx_oboty_scalex_scaley subr.o 363531070 0 27 100664 2266 ` X (լЬPάPPPP-3$4Ѭ -P}`nU [WPP``P=ݬ#ݏݏ P^ì PnPPvPìPnPPvPEPVPPERVRR`RP^ммЭ^Ѭ ѬyoPѬP YSPnPPfPjP< nPdPjPPPݭP ݭyЭP׭P~P ݭGЭP׭PPnPPfPjP  nPdPjPPP{ݭqP ݭЭP׭PP~FP} ݭЭP׭PuЬЬ ^nPVRcRPRVPdRPVR`PRjRЭP^nPVRcRPRVPdRPVR`PRjRЭPAABB ' : IR_hn u                  y" # " " " " " " #/AG# S^# v# # " # & ' ( 1+ <, F-  "+.26>BFJzPXY]ckox$Zp& "_abvalL35_xconvL40_xscale_xoffset_yconvL45_yscale_inplotL50_spew_outplotL56__iob_fflushL61__flsbuf_tobotleftL68_move_resetL74_signal_ITTY_OUTF_stty_exit_dist2L82_swapL87_movepL92_xnow_ynow_xscL115_obotx_scalex_botx_yscL120_oboty_scaley_boty$Zp& lib/libI66.a 775 0 33 126 2552606030 5760  a_init66__yes_66__inplotL50_spew_outplotL56__iob_fflushL61__flsbuf_tobotleftL68_move_resetL74_signal_ITTY_OUTF_stty_exit_dist2L82_swapL87_movepL92_xnow_ynow_xscL115_obotx_scalex_botx_yscL120_oboty_scaley_boty$Zp/pT,pT5pĊ /,"lib/libF77.a 644 0 33 72400 2552606057 6027 ! __.SYMDEF 363531315 0 27 100664 3150 ` 0 0 0 0 0 0 &0 10 ;0 D(LT*]2enwbDJ!(""#$R%%&r((**,-/081L3 3(567%8, :4<;<CR=K=S>[2?c?j^@r@yA8BBCTDDEFGbHII:JJJKrLMM LNN|O P(P/VQ6Q>rREHSMTTT[UcVkWsWztXYYLZZr[[\]F^^_v``abbccnd ~e&ffg#kEkNdlW m^menmospyrr_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_del_step_arc_quad_abs_box_circle_closevt_closepl_dot_erase_lbl_mv_lbl_umv_label_line_linemod_move_openvt_openpl_point_scale_space_obotx_oboty_botx_boty_scalex_scaley_scaleflag_oloy_ohiy_ohix_oextra_cont_putch_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_xargc_xargv_main__sigfdie__sigidie__sigqdie__sigindie__sigtdie__sigdie_s_rnge_abort__getarg__iargc__getenv__signal__s_stop_s_paus_system__pow_ci_pow_dd_pow_di_pow_hh_pow_ii_pow_ri_pow_zi_pow_zz_c_abs_c_cos_c_div_c_exp_c_log_c_sin_c_sqrt_z_abs_z_cos_z_div_z_exp_z_log_z_sin_z_sqrt_r_abs_r_acos_r_asin_r_atan_r_atn2_r_cnjg_r_cos_r_cosh_r_dim_r_exp_r_imag_r_int_r_lg10_r_log_r_mod_r_nint_r_sign_r_sin_r_sinh_r_sqrt_r_tan_r_tanh_srand__rand__d_abs_d_acos_d_asin_d_atan_d_atn2_d_cnjg_d_cos_d_cosh_d_dim_d_exp_d_imag_d_int_d_lg10_d_log_d_mod_d_nint_d_prod_d_sign_d_sin_d_sinh_d_sqrt_d_tan_d_tanh_i_abs_i_dim_i_dnnt_i_indx_i_len_i_mod_i_nint_i_sign_h_abs_h_dim_h_dnnt_h_indx_h_len_h_mod_h_nint_h_sign_l_ge_l_gt_l_le_l_lt_hl_ge_hl_gt_hl_le_hl_lt_ef1asc__ef1cmc__s_cat_s_cmp_s_copy_cabs_tanh_sinh_coshVersion.o 363526953 0 27 100664 98 ` , @(#)LIBF77 VERSION 2.01 11 AUGUST 1980  _junkmain.o 363526972 0 27 100775 1468 ` \H0XЬЬxP P |yrլѬ ԬЬP@J7%Ь[[լ )<MdvIOT TrapQuit signalInterruptKilled%s unknown floating exceptioninteger overflowinteger divide by zerofloating overflowfloating/decimal divide by zerofloating underflowdecimal overflowsubscript out of rangefloating overflowfloating divide by zerofloating underflow   #, 2; I OX f lu |    " ) / 6 F M V   $(% 8~3"*K4>IS[cket.zL_xargc_xargv_main__sigfdie_signal__sigidie__sigqdie__sigindie__sigtdie_f_init_MAIN___f_exit__sigdie__iob_fflush_fprintf_abort_exits_rnge.o 363526987 0 27 100775 661 ` lHݬ[ _?Ь P֬ Q`aЬ P֬ `~[[~[ ?ЬP֬Q`ayЬP֬`~H[[U.' Subscript out of range on file line %d, procedure . Attempt to access the %ld-th element of variable .    # 2 9 D U gm t          u .f$.5_s_rnge__iob_fprintf__flsbuf__cleanup_abort abort_((.o 363526999 0 27 100775 244 ` $ <(Fortran abort routine called      q .%,_abort___iob_fprintf__cleanup_abortgetarg_.o 363527012 0 27 100775 203 ` P$Ь[ռѼxPP`Z$ZY jYY  YY   (S %8_getarg__xargc_xargv iargc_.o 363527021 0 27 100775 95 `  P + %_iargc__xargc getenv_.o 363527030 0 27 100775 182 ` `X YЬZ ZZYj ZYЈ[)ЬZZYܑ=׬֬k  ֬P  r_getenv__environsignal_.o 363527043 0 27 100775 101 ` ݼݼ  1 _signal__signal s_stop.o 363527053 0 27 100775 422 ` Hh^լmx ԭ;ЬP֬Q`aЬP֬`~֭ѭ$ySTOP statement executed   $ 3 : E V fl s z   .f$,2_s_stop__iob_fprintf__flsbuf_f_exit_exits_paus.o 363527063 0 27 100775 1226 ` p^լGԭ;ЬP֬Q`aЬP֬`~֭ѭ9~{P1&a[WPP`P A:Pg\+'P `P  Po,P`P P Y4P$|iPAUSE statement executed To resume execution, type go. Any other input will terminate job. STOP To resume execution, execute a kill -%d %d command Execution resumes after PAUSE.    $ 3 : E V fl s y                  " -3 : A J S ]c j py    [ .f$3,5=CpKSZ_s_paus__iob_fprintf__flsbuf_isatty__filbuf_f_exit_exit_getpid_signal_pausesystem_.o 363527077 0 27 100775 161 ` L^Ь[PѬЬQ2QQPYZkZYjE  _system__system pow_ci.o 363527088 0 27 100775 136 ` 4 ^VЬPVݬ ߭߭vЬPv  +_pow_ci_pow_zipow_dd.o 363527103 0 27 100775 101 ` p~p~    _pow_dd_pow pow_di.o 363527116 0 27 100775 192 ` X ^pMpмխ%q:pPέg.ddx@@"6 _pow_dipow_hh.o 363527132 0 27 100775 140 ` T ^702P2PQPQQ2P2QPQQ2PxPPP2P _pow_hhpow_ii.o 363527143 0 27 100775 112 ` 8 ^ммխĭĭxЭP  _pow_iipow_ri.o 363527157 0 27 100775 192 ` X ^pMVмխ%q:pPέg.ddx@@"6 _pow_ripow_zi.o 363527166 0 27 100775 315 `  ^м pЬPpխխέݬݬ߭pЬPp5ePЬReRcRPePЬReR`RPЬRpPpx%ePeRcRPePdPp@A : + _pow_zi_z_div pow_zz.o 363527182 0 27 100775 377 ` T0(^ЬPp~p~pP~pPp~ЬPp~pPЬ Pee PcP~pPe Ь PePaPp~pPePp~kpPePPЬRpP  5 V |  < %#(-_pow_zz_cabs_log_atan2_exp_cos_sin c_abs.o 363527190 0 27 100775 105 ` ЬPV~V~  %_c_abs_cabs c_cos.o 363527204 0 27 100775 249 ` \< ^ЬPV~pPV~dPvPV~rPЬPV~pPePPЬRvP  2 E  t!_c_cos_cosh_cos_sin_sinh c_div.o 363527216 0 27 100775 434 ` (0 ^V qrЬ PVqrqvqЬ PG PVPЬ PeR`RVPeRPVPdPЬRVR`PRfRvRЬPVPdPVRcRPRfRЬPvR^Ь PG PVPeP`hPV RePRЬPVPdPVR`PRfRvRЬPVRdRVPbRPfPЬRvP@@&<E c _c_div_abortc_exp.o 363527231 0 27 100775 214 ` T0^V~pPЬPV~pPePPvPЬPV~pPePPЬRvP   ;  _c_exp_exp_cos_sinc_log.o 363527241 0 27 100775 197 ` @0V~ЬPV~ЬRvPЬPV~V~pP~vP , 6  %_c_log_atan2_cabs_log c_sin.o 363527251 0 27 100775 245 ` X< ^ЬPV~pPV~dPvPЬPV~pPV~dPЬRvP  6 E  t!_c_sin_cosh_sin_sinh_cos c_sqrt.o 363527267 0 27 100775 472 ` @$X^ЬPV~V~pPqPЬPvP1VPqP9VP`PeP~vPЬPGPVPPfPЬRvPbVPcPe{~gЬRvPЬPVPqPdЬPVPrPRЬPvRЬPЬQGRVRRf@RvR@A@A +@QY p  %_c_sqrt_cabs_sqrtz_abs.o 363527277 0 27 100775 105 ` ЬPp~p~  %_z_abs_cabs z_cos.o 363527292 0 27 100775 249 ` \< ^ЬPp~pPp~ePp~rPЬPp~pPePPЬRpP  0 C  t!_z_cos_cosh_cos_sin_sinh z_div.o 363527308 0 27 100775 382 ` (0 ^p qrЬ PpqrqSqЬ Pg eR`ReRePЬR`PgPЬPePbPBЬ Pg eP`ZPeP ЬPePaPRgRЬPeRcRPfPЬRpP@@&<E \ _z_div_abortz_exp.o 363527320 0 27 100775 210 ` P0^p~pPЬPp~pPePЬPp~pPePPЬRpP   8 0 _z_exp_exp_cos_sinz_log.o 363527334 0 27 100775 197 ` @0p~ЬPp~ЬRpPЬPp~p~pP~pP , 6 1 %_z_log_atan2_cabs_log z_sin.o 363527345 0 27 100775 241 ` T< ^ЬPp~pPp~ePЬPp~pPp~dPЬRpP  4 C H t!_z_sin_cosh_sin_sinh_cos z_sqrt.o 363527357 0 27 100775 440 ` @$X^ЬPp~p~pPqPЬPpp1q4aPeP~pPЬPgPfxPЬRpPLcef~rЬRpPЬPЬQgRgJRЬPqCrPpP@A@A +=LT h  %_z_sqrt_cabs_sqrtr_abs.o 363527371 0 27 100775 99 `  VPqPVPVPrPP w _r_abs r_acos.o 363527379 0 27 100775 98 ` V~   7_r_acos_acosr_asin.o 363527387 0 27 100775 98 ` V~   f_r_asin_asinr_atan.o ((363527399 0 27 100775 98 ` V~   Z_r_atan_atanr_atn2.o 363527410 0 27 100775 103 ` V~V~   _r_atn2_atan2 r_cnjg.o 363527425 0 27 100775 84 `  PЬPVPrPRЬPvR _r_cnjgr_cos.o 363527434 0 27 100775 96 ` V~   _r_cos_cosr_cosh.o 363527443 0 27 100775 98 ` V~   t_r_cosh_coshr_dim.o 363527457 0 27 100775 99 `  Q CPVPPpP _r_dim r_exp.o 363527469 0 27 100775 96 ` V~   _r_exp_expr_imag.o 363527478 0 27 100775 68 `  ЬPVP _r_imagr_int.o 363527493 0 27 100775 162 ` 8^VPqP( V~VPrP~rPPpP  )  p_r_int_floorr_lg10.o 363527502 0 27 100775 129 `  ^V~pPePP?[7r(  h _r_lg10_log r_log.o 363527514 0 27 100775 96 ` V~   _r_log_logr_mod.o 363527524 0 27 100775 186 ` P^GPVPPpPqP7pP~pPr~rPpVPdPVRcPRP! 2  p_r_mod_floorr_nint.o 363527535 0 27 100775 207 ` D(^VPqP4VPa0P~VPcP"~rPPpP@@ ! .6 > p_r_nint_floor r_sign.o 363527549 0 27 100775 152 ` @ ^VPqP0VPVPrPPvPVPqPVPVPrPP *R _r_signr_sin.o 363527558 0 27 100775 96 ` V~   _r_sin_sinr_sinh.o 363527564 0 27 100775 98 ` V~  Z _r_sinh_sinhr_sqrt.o 363527574 0 27 100775 98 ` V~   _r_sqrt_sqrtr_tan.o 363527587 0 27 100775 96 ` V~   _r_tan_tanr_tanh.o 363527600 0 27 100775 98 ` V~  B _r_tanh_tanhrand_.o 363527610 0 27 100775 194 ` @$ м6ݏŏmNA!P90PPPPnP~*9   x_srand__rand__ldexpd_abs.o 363527618 0 27 100775 95 `  qpPrP _d_abs d_acos.o 363527625 0 27 100775 98 ` p~   7_d_acos_acosd_asin.o 363527634 0 27 100775 98 ` p~  . f_d_asin_asind_atan.o 363527647 0 27 100775 98 ` p~  " Z_d_atan_atand_atn2.o 363527654 0 27 100775 103 ` p~p~   _d_atn2_atan2 d_cnjg.o 363527664 0 27 100775 80 `  pЬPrRЬPpR% _d_cnjgd_cos.o 363527676 0 27 100775 96 ` p~   _d_cos_cosd_cosh.o 363527683 0 27 100775 98 ` p~  < t_d_cosh_coshd_dim.o 363527690 0 27 100775 99 `  qcPpP _d_dim d_exp.o 363527700 0 27 100775 96 ` p~   _d_exp_expd_imag.o 363527709 0 27 100775 68 `  ЬPpP? _d_imagd_int.o 363527716 0 27 100775 154 ` 0^q# p~r~rPPpP  #  p_d_int_floord_lg10.o 363527724 0 27 100775 129 `  ^p~pPePP?[7r(   _d_lg10_log d_log.o 363527735 0 27 100775 96 ` p~   _d_log_logd_mod.o 363527745 0 27 100775 178 ` H^gPpPqP2pP~pPr~rPpePcPP /  p_d_mod_floord_nint.o 363527759 0 27 100775 199 ` <(^q/a/~c#~rPPpP@@  %- ~ p_d_nint_floor d_prod.o 363527772 0 27 100775 68 `  EPVPP _d_prodd_sign.o 363527787 0 27 100775 136 ` 0 ^q#pPrPpPqrP ! _d_signd_sin.o 363527794 0 27 100775 96 ` p~   _d_sin_sind_sinh.o 363527804 0 27 100775 98 ` p~   _d_sinh_sinhd_sqrt.o 363527811 0 27 100775 98 ` p~   _d_sqrt_sqrtd_tan.o 363527816 0 27 100775 96 ` p~   _d_tan_tand_tanh.o 363527821 0 27 100775 98 ` p~   _d_tanh_tanhi_abs.o 363527830 0 27 100775 75 `  ռмPμP _i_abs i_dim.o 363527835 0 27 100775 75 `  ѼüPP _i_dim i_dnnt.o 363527839 0 27 100775 199 ` <(^q/a/~c#~rPPpPjPP@@  %-  p_i_dnnt_floor i_indx.o 363527845 0 27 100775 144 ` X ^ì PPԭЭP֭ЭQ֭`a֭ѭЬѭPP _i_indxi_len.o 363527854 0 27 100775 63 `  ЬP _i_len i_mod.o 363527863 0 27 100775 75 `  ǼPļPPP" _i_mod i_nint.o 363527879 0 27 100775 211 ` H(^VPqP8VPa4P~VPcP&~rPPpPjPP@@ ! .6  p_i_nint_floor i_sign.o 363527889 0 27 100775 92 ` $ ^ռмPμPPռέP2 _i_signh_abs.o 363527899 0 27 100775 75 `  2P2PPP _h_abs h_dim.o 363527905 0 27 100775 87 `  2PЬQ2aQQPP2PP _h_dim h_dnnt.o 363527909 0 27 100775 199 ` <(^q/a/~c#~rPPpPjPP@@  %-  p_h_dnnt_floor h_indx.o 363527917 0 27 100775 144 ` X ^ì PPԭЭP֭ЭQ֭`a֭ѭЬѭP2PPP _h_indxh_len.o 363527931 0 27 100775 63 `  2P _h_len h_mod.o 363527943 0 27 100775 83 `  2PЬQ2aQQPRQRRPR2RP _h_mod h_nint.o 363527953 0 27 100775 211 ` H(^VPqP8VPa4P~VPcP&~rPPpPjPP@@ ! .6  p_h_nint_floor h_sign.o 363527959 0 27 100775 108 ` 4 ^2P2PPPP2P((2PPP2PP _h_signl_ge.o 363527963 0 27 100775 117 ` $ݬݬ ݬݬPPP a _l_ge_s_cmp l_gt.o 363527967 0 27 100775 117 ` $ݬݬ ݬݬPPP p _l_gt_s_cmp l_le.o 363527981 0 27 100775 117 ` $ݬݬ ݬݬPPP k _l_le_s_cmp l_lt.o 363527987 0 27 100775 117 ` $ݬݬ ݬݬPPP z _l_lt_s_cmp hl_ge.o 363527998 0 27 100775 118 ` $ݬݬ ݬݬPPP2PP 3 _hl_ge_s_cmphl_gt.o 363528005 0 27 100775 118 ` $ݬݬ ݬݬPPP2PP B _hl_gt_s_cmphl_le.o 363528010 0 27 100775 118 ` $ݬݬ ݬݬPPP2PP = _hl_le_s_cmphl_lt.o 363528020 0 27 100775 118 ` $ݬݬ ݬݬPPP2PP L _hl_lt_s_cmpef1asc_.o 363528028 0 27 100775 113 ` ݼPP~ݬ ݬ ] '_ef1asc__s_copy ef1cmc_.o 363528032 0 27 100775 108 ` ݼݼݬ ݬ U _ef1cmc__s_cmps_cat.o 363528041 0 27 100775 147 ` \ ^мԭ֭֭֬ѭ/ЬЭP@ @ ­ЭP@ ֬ _s_cat s_cmp.o 363528058 0 27 100775 163 ` l Ь[ЬZ [YZXѬ (ZX8kj [ZkjkP PjQQP[Z[YZXj Z[[Y k kP PP _s_cmp s_copy.o 363528064 0 27 100775 148 ` \ ^ PPѬ Ѭ;֬֬PP ֬֬Ѭ  ֬Ѭ' _s_copycabs.o 363528080 0 27 100775 248 ` x ^qkrq dr q pp p a PqPpPg ePa+P~pPePpP@ Yb % _cabs_sqrttanh.o 363528093 0 27 100775 262 ` \ $0^pQqO rpJqHpPp~pPp~pPePfP@B(: I  t_tanh_sinh_coshsinh.o 363529156 0 27 100775 705 ` 8$ ^[q`r[[qV"p~gKP[pPrPq:/r~pPp~cPn[PdPfPeeP`PdP`PdP`PePaPdP`PdP`PfPn[PdP^qrqp~fPr~pPp~`Pf}P%yگ\.0k4aѶoqB;%ymGt -ϭBA@ABAA + 1JW f y  % / t_sinh_exp_cosh P`PePaPdP`PdP`PfPn[PdP^qrqp~fPr~pPp~`Pf}P%yگ\.0k4aѶoqB;%ymGt -ϭBA@ABlib/libI77.a 644 0 33 155524 2552606066 6063 ! __.SYMDEF 363531323 0 27 100664 4940 ` %%%%% , , , , ,# ,+ ,3 ,; ,C ,I ,Q ,Y ,a ,i ,q 7y V= V= V= V= ? $A $A $A $A $A H H H H H H H H H dW dW dW# dW+ dW3 dW; _C _J _R _Y ca ci cq cy c c Nl Nl Nl n n n n n n n n n n n n n n n n n n n n# n+ n3 n; C K T \ d l t |    | |& |/ 7 ? G VO VW V^ Ve l t |     $ . 8 D O U [ _ h p x  6 _arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_del_step_arc_quad_abs_box_circle_closevt_closepl_dot_erase_lbl_mv_lbl_umv_label_line_linemod_move_openvt_openpl_point_scale_space_obotx_oboty_botx_boty_scalex_scaley_scaleflag_oloy_ohiy_ohix_oextra_cont_putch_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_xargc_xargv_main__sigfdie__sigidie__sigqdie__sigindie__sigtdie__sigdie_s_rnge_abort__getarg__iargc__getenv__signal__s_stop_s_paus_system__pow_ci_pow_dd_pow_di_pow_hh_pow_ii_pow_ri_pow_zi_pow_zz_c_abs_c_cos_c_div_c_exp_c_log_c_sin_c_sqrt_z_abs_z_cos_z_div_z_exp_z_log_z_sin_z_sqrt_r_abs_r_acos_r_asin_r_atan_r_atn2_r_cnjg_r_cos_r_cosh_r_dim_r_exp_r_imag_r_int_r_lg10_r_log_r_mod_r_nint_r_sign_r_sin_r_sinh_r_sqrt_r_tan_r_tanh_srand__rand__d_abs_d_acos_d_asin_d_atan_d_atn2_d_cnjg_d_cos_d_cosh_d_dim_d_exp_d_imag_d_int_d_lg10_d_log_d_mod_d_nint_d_prod_d_sign_d_sin_d_sinh_d_sqrt_d_tan_d_tanh_i_abs_i_dim_i_dnnt_i_indx_i_len_i_mod_i_nint_i_sign_h_abs_h_dim_h_dnnt_h_indx_h_len_h_mod_h_nint_h_sign_l_ge_l_gt_l_le_l_lt_hl_ge_hl_gt_hl_le_hl_lt_ef1asc__ef1cmc__s_cat_s_cmp_s_copy_cabs_tanh_sinh_cosh_f_back_s_rdfe_c_dfe_y_getc_y_err_y_rsk_s_wdfe_y_putc_y_rev_e_rdfe_e_wdfe_s_rdue_c_due_s_wdue_e_rdue_e_wdue_icptr_icend_svic_icnum_icpos_z_getc_z_putc_z_rnew_s_rsfi_c_si_y_ierr_s_wsfi_z_wnew_e_rsfi_e_wsfi_f_inqu_setcilist_setolist_stcllist_setalist_f_rew_s_rsfe_x_getc_x_endp_xrd_SL_x_rev_rd_ed_rd_I_rd_L_rd_A_rd_AW_rd_F_rd_ned_rd_POS_rd_H_recloc_s_rsue_c_sue_s_wsue_e_wsue_e_rsue_reclen_do_us_do_uio_do_ud_s_wsfe_x_putc_xw_end_xw_rev_x_wSL_pr_put_e_rsfe_c_sfe_e_wsfe_syl_parenlvl_pc_revloc_pars_f_f_s_op_gen_f_list_i_tem_ne_d_e_d_gt_num_ap_end_cnt_ret_cp_rp_workdone_nonl_en_fio_do_fio_type_f_fmt_bg_s_wsle_t_putc_l_write_e_wsle_lwrt_I_lwrt_L_lwrt_A_lwrt_F_lwrt_C_lioproc_ltab_l_comma_l_first_t_getc_e_rsle_lquit_lcount_ltype_lchar_lx_ly_l_read_l_R_l_C_l_L_l_CHAR_rd_int_s_rsle_c_le_do_lio_f_open_isdev_fk_open_f_clos_f_exit_flush__g_char_b_char_inode_mvgbt_f_end_t_runc_mv_cur_w_ed_wrt_I_wrt_IM_wrt_L_wrt_A_wrt_AW_wrt_E_wrt_G_wrt_F_w_ned_wrt_AP_wrt_H_units_init_elist_reading_cplus_cblank_fmtbuf_external_doed_doned_doend_donewrec_dorevert_sequential_formatted_getn_putn_cf_curunit_recpos_cursor_scale_F_err_fatal_f_init_canseek_nowreading_nowwriting_icvtbackspace.o 363528116 0 27 100664 986 ` (x4^ЬPѠՠ'ռ eݏeePЬP,P@ЭPՠ'ռ jݏjjPս'ռ rqݏr\rPЭPѠ LԠ Dݽ>PЭPǠ QĠ QQ׭ЭPƠ Ġ ݭݽPЭPՠ$PݭЭPՠ ՠ1ݏݽݽ߭έPP~ ݭݽݽí~߭}PPޭPЭQA` QPíP~1H׭խխ1Bխ%ռ 5_ݏ Pݭݽ ݽPPѭ 1Mԭ1K((backspacebackspacebackspacebackspace %2 G _ gt       : K j       %,3;GN_f_backL31_errno_fatal_units_ftell_fseek_t_runc_nowreading_freaddfe.o 363528142 0 27 100664 3503 ` 8^ݬPPՠ$ Pj}wpP'ռ d_WݏdJdP>P^/&ݬP Pՠ$ POP'ռ dݏddPyPmPaPVOIDЬ<60+% ЬPѠՠ'ռ e ݏeePЬP,P@=ЬPݠP'ռ hݏhhPPՠ'ռ flݏfWfPLPՠ ռ]ЬPР -%PЬQQQ ~ PԠ PPՠ Ѡ Ѡ  P֠ PQP ^Pՠ P}PРQ֠aP jcPP&UOPѠ FѠ ЭP P/P #P  !PP Ѡ /PРQ֠aPݬ nݏnsnPfPѠ  Y PLPE  80& nHݏnnPstartiostartwrtstartchkdfedfedfereadingddoutdfe  ( . = CH N S Y ^ di o t z                # ). 4 9 ?D J Q b jw  " " & ' ' ( ) * * + + ,    "- ' - A. R Zg r w/ }      / 0   * %/ -/ 9/ @2 F* L* S g w/ / / 2 *  * /   )      * $ +* ;/ C/ X/ b5 j) t |  *  *  * )    %.7C`KQX^fmt~ &0;BJQY`imty_s_rdfeL57_init_f_init_c_dfe_reading_curunit_nowreading_y_getc_getn_rd_ed_doed_rd_ned_doned_y_err_donewrec_dorevert_y_rsk_doend_fmtbuf_pars_f_errno_fatal_fmt_bg_s_wdfeL75_nowwriting_y_putc_putn_w_ed_w_ned_y_rev_e_rdfeL88_en_fio_e_wdfeL94L98_sequential_external_formatted_elist_recpos_scale_cursor_units_fk_open_cf_fseekL120__filbufL129L140__flsbufL150L157 due.o 363528162 0 27 100664 1715 ` $P^ݬ[PPՠ$ PP^ݬ%PPՠ$ PPЬPѠՠ'ռ eiݏeTePIC>83,ЬP,P@Ь =ЬPݠP'ռ hdݏhhPPՠ'ռ f*ݏffPPՠ ռm'ռ r^ݏrIrPЬPP3Qš P~' PԠ P PѠ  PP ~Qǡ PRġ RRPR 7ݏPostartioduecduecduecduesyserr   . AN T c n w              - 8 = C V ^k v             % + 2 8 N X `m { j )56=AMQW_fmxv_s_rdueL31_c_due_reading_curunit_nowreading_s_wdueL40_nowwritingL47_init_f_init_errno_fatal_formatted_sequential_recpos_external_units_elist_fk_open_cf_fseek_e_rdueL77_ftell_e_wdueL87 iio.o 363528172 0 27 100664 2794 ` ,XX,Pՠ ^ݏPPQPP nݏnxnPje*] nSnPݏn;3P,&QPPPQġPPP^ݬP~zsP^ݬSPTNIC>3("PЬPР P'ռ dݏddPЬytnPРePQšPVPPP A;5P.(QP^P^PPЭPPQP  n;ݏnnPendfilerecendinwriterecendstartintiio    &3 = D J W ^ e o w            # ) 9G M R X ] ch ns y ~            ! ! "  "/ ;# B$ H$ M% S& Y' _' d( j( o) w }              - ! - !  # 2 9 ? M S ^1 h p}  &.29@HLTX.`djszZ$+38@EMUZ_f_icptr_icend_svic_icnum_icpos_z_getcL59_errno_fatal_z_putcL73_z_rnewL87_s_rsfiL92_c_si_reading_rd_ed_doed_rd_ned_doned_getn_y_ierr_donewrec_dorevert_doend_s_wsfiL99_w_ed_w_ned_putn_z_wnewL104_fmtbuf_pars_f_fmt_bg_formatted_sequential_external_scale_cplus_cblankL114_e_rsfiL121_en_fio_e_wsfiL127L134_elistinquire.o 363528197 0 27 100664 1393 ` TT^ЬPՠeЬPݠ ݠPԭԭѭU,P,P,P@֭ԭЬPѠՠ,P@mԭЬPՠ&խ խխ ЬPЬP԰ЬPՠ#խ խP խսPЬQPЬPՠÏP,PЬQPЬPՠ$խխЭPՠ ЬPЬP԰ЬPՠ 7խ ݠ$ݠ խ!ЭPՠЬPݠ$ݠ ЭPݠЬPՠ(<խ7ս2ЭPՠ ЬPݠ,ݠ(ЬPݠ,ݠ(<ЬPՠ0<խխЭPՠЬPݠ4ݠ0ЬPݠ4ݠ0ЬPՠ8<խխЭPՠЬPݠ<ݠ8pЬPݠ<ݠ8bЬPՠ@<խЭPՠЬPݠDݠ@7խЬPݠDݠ@*mЬPՠHݠLݠHQЬPՠP<խխЭPՠЬPݠTݠPЬPݠTݠP ЬPՠXխ ЭPЬQР XЬPՠ\*խ%ЭPՠ ݽЭQơ PPЬQP\ЬPՠ`<խ7ЭPՠ.ՠЬPݠdݠ`dЬPݠdݠ`WyPdirectsequentialyesnoyesnoformattedunformattedyesyesunknownzeroblank% 0 L \ j   {   1CJ q   , j|  &.5_f_inquL31_g_char_inode_units_b_char_ftell lib.o 363528224 0 27 100664 385 ` lЬPЬЬPЬ ЬPЬЬЬPЬЬ ЬPЬЬPЬ ݬ ((ЬQP ЬPЬЬPЬЬPЬЬPЬ ЬЬPЬЬPЬ ЬPЬЬ K ,!)|37AE_setcilistL31_setolistL36_strlen_stcllistL42_setalistL47 rewind.o 363528246 0 27 100664 468 ` `P^ЬPѠՠ'ռ eݏeePЬP,P@սPЭPՠ'ռ jHݏjjPЭPՠ$Piݭ_ݽUЭPԠ rewindrewind %2 G g o|     $08@_f_rewL31_errno_fatal_units_nowreading_t_runc_rewindrsfe.o 363528256 0 27 100664 1911 ` 8^ݬPЬЬPР ,P@}xrkP'ռ dZݏdEdP5/*$0 7&PРՠ$ PP^Pՠ :PРQ֠aP PP  PytP^ePՠ PUMPРQ֠aP :3PP#ѭ ݭ ЭPѭ P P  PPstartio   ( / 6 = E K Q V \ h t y                ! " (# 7 C K ^ e% }       %   '    #/ %.:EOV^fmu|0* "+/7;?_s_rsfeL54_init_f_init_c_sfe_reading_sequential_formatted_external_elist_recpos_cursor_scale_fmtbuf_units_curunit_cf_pars_f_errno_fatal_x_getc_getn_rd_ed_doed_rd_ned_doned_fmt_bg_x_endp_doend_xrd_SL_donewrec_x_rev_dorevert_cblank_cplus_nowreadingL71__filbufL79_ungetcL88L92 rdfmt.o 363528287 0 27 100664 3663 ` H^PЭPbP* nkݏnnPPՠ1|uoмPPW44W444444444444-ݼ> ݬ ЬPݠݬT1P jݏjjPЬPݠݬ<ݬ ݬ}-ݬ ЬPݠݬݬ ЬPݠݠݬHPP1eP 1ePSMPмPP d\;Jdt"ݼ3 ЬPݠЬPݠݠЬPPЬPPPЬP ^Ь[ԭԭԭѭ1PЭPP2<fP,JP  

1;ѭ-ѭ9ѭ0 PP0P'ѭ ѭ  ѭ,"ѭ ѭ+ѭ 昏sPխԭ fk֭ѭ ԭ f\֭ѭ`խԭѭ$f>֭ԭ d4֭ѭխrխ4k f׭խQ d֭խѬvpP^ԭ'Pѭ ЭP PP֭֬ѭP^Ѭ VԭPЭP֭ì PѭPԭ!PP  PP֭֬ѭ Pԭ!~PP  PP֭֬ѭԭ ֭֬ì PѭP^ԭ'/Pѭ  PЭPP֭֬ѭP^֬P ЬPPѭ  PЭPP B@C B B@C B B B B B B Bfmtfmtrd_ed, unexpected code: %d %s rd_ned, unexpected code: %d %s   ! ) 1 6 ? I Q^ i z      !. HWm        , : E S y       * :H X  7E\i     !8^p   ( N ~  '  %,3:CGNV\elZrTx~_rd_edL48_getn_cursor_recpos_elist_errno_fatal_curunit_cf_fseek_fmtbuf__iob_fprintf_abort_rd_I_rd_L_rd_A_rd_AW_rd_F_clearerr_rd_nedL96_rd_POS_rd_H_donewrecL114_cblankL154L168_scaleL251L259L279L287 sue.o 363528308 0 27 100664 2064 `  X^ݬ0PPՠ$ PPzP 4P ЬPՠ vZݏaPWPռ E@*2+%PP^ ݬPPPՠ$ PPPЬPѠՠ'ռ eݏeePsmhbЬP,P@RMЬE?=ЬPݠ+P'ռ rݏrrPPՠ4ռ g  ռݏggPPՠP^}Pqkd^TMݭB;P.)PP~Pstartstartstartiosuesuesue  ( . 4 C I S Z e q          " ( / 6 @ G h p}                (5B M a k r x               &N-6>GSW_fmt~Z_recloc_s_rsueL33_init_f_init_c_sue_reading_recpos_curunit_nowreading_cf_reclen_fread_errno_fatal_clearerr_s_wsueL55_nowwriting_ftell_fseekL64_sequential_external_formatted_units_elist_fk_open_e_wsueL86_fwrite_e_rsueL92uio.o 363528325 0 27 100664 1004 ` l]Ŭ PP* n0ݏnnPݼݬ ݬPŬ PPݼݬ ݬvlݬ ݬݬZݬ ݬݬŬ PP93P, 0Ѡ * n~ݏnnP@ݼݬ ݬP: 9Pݼݬ ݬPeof/uioeof/uioeof/uio    & 0 8E P ` p v         " . 7 ?H R b   (/6=AHPX\hos|_reclen_do_usL32_reading_recpos_elist_errno_fatal_cf_fread_fwrite_do_uioL45_sequential_do_udL51_curunitwsfe.o 363528338 0 27 100664 2105 ` x (^ݬPЬЬPР ,P@~xsmfP'ռ dUݏd@dPi0*%T_"PРՠ$ PPPРQ֠aaPݬѬ <y1nPРQ֠aZPРQ֠ aaPmIѬ0((/' ?Ѭ1@PРQ֠ a 1yݬ P P Pstartio   ' . 5 < D J P U [ a m y ~               ! "  # -$ 8 > F ] g& p }          & + 1 7 D O Z, e k, q,  %.:EOV^fls{4@V$"&/l7;?CGQ_s_wsfeL54_init_f_init_c_sfe_reading_sequential_formatted_external_elist_recpos_cursor_nonl_scale_fmtbuf_units_curunit_cf_pars_f_errno_fatal_x_putc_putn_w_ed_doed_w_ned_doned_xw_end_doend_xw_rev_dorevert_x_wSL_donewrec_fmt_bg_cplus_cblank_nowwritingL71__flsbuf_pr_putL77L89L93L98_workdone sfe.o 363528352 0 27 100664 617 ` p^P^ЬPѠՠ'ռ eݏeePЬP,P@ս=ЬPݠP'ռ rsWݏr^rPЭPՠ'ռ fC+ݏf.fPPstartiosfesfe  5 =J _ x       '+29@IQU_e_rsfeL32_en_fio_fmtbuf_c_sfeL38_errno_fatal_units_fk_open_e_wsfeL57 fmt.o 363528409 0 27 100664 5103 `  XdݬPPP֬ ЬP֬`(PPPЬݬPݬP֬ ЬP֬ ݬRPP ֬,֬Ǒ) \֬ЬP ^)ЬP߭ݬSPЭP߭ݬIP߭ݬxPݭPPݭݬ ^ԭPP911ZP111 P'1J1P"1=1P10P֬ЬP!֬ЬP`zZ ЬPsS֬ЬPp쑠Pݭ1x1m֬߭ݬRPPPHRPP'PX4Ph7Pp Px1 խέݭ1ݭ1~ݭ j1ݬ RݬhP11ЬPlL ֬ЬPr쑠R߭~hP׬ݭ11Z1EP$1W16P/1 P-11!P011P51P3P21P411P71P61P81}1PpbPS1(PB1 P:11PP1M1PX15PT11wPb11hPt1Ps11KPx11<^ԭԭЬ߭ݬ#PݭP֬PA.T}}os}-}}+}}}}}}}}}}}}}}}}}}}T}}os}-}}+}}1ЭP߭ݬ|Pխё.֬߭ݬ]PԭE'e ݭݭѭPPPP1֬߭ݬPݭݭݭѭP߭ݬPխ1^ݭ 1K߭ݬPխ15ݭ1"֬ 0+9%߭ݬPխ1ݭ11߭ݬPPխ1.֬߭ݬ.Pԭݭݭ1߭ݬPխ{.֬߭ݬPԭݭݭI߭ݬPխ6. ݭ֬߭ݬPݭݭ խ1ЬP^xP@, }?jcЬЭPЬЭPЬ ЭPЬ =P6 ^ԭԭ0( PQQP0P֭֬ 9խЭЬP^߭ ^ԭѭ1$xPPP`P BBbBBBBBBB-6-@OXBBBBBBBBBB#Rݽ-c<6 d,'ݏddPݭP֭ 1/1*P@լP@ݬ ݬݭP0 {tnPխ1f^Pՠ QWݏ<PЭP.(QРA1.ЭP QРA1P@1P@1 ЭPРլ1PP1լ11p1g1w]1mЭPРN1^E1U;1K0*% PPЬPPEIMUUQY@@YUUUUU@@@@@@@YYYYYYYYYYЬPPPPP PP^֬n ddP֬ЬP`Xݏd9format too complicated: %s unknown code in do_fio: %d %s do_fiofmtfmtbad string     &V ] j z  )?Pdzv`/ LkDx0Eb j r       /I P ^   $ % & '        &  4 ( ;  C  J  Z ) f $ n % s % {  % & % $ %  &              "  +  0  6  ?  E  J  V  d  p *  + + , - - 0 0            $ %  &  '+804Z<DHOSY^fjz rw|((4  $, 49AFK_syl_parenlvl_pc_revloc_pars_fL52_f_sL57_op_gen_f_listL69_i_temL85_ne_d_e_d_gt_numL95_ap_endL164L208_fmtbuf__iob_fprintf_abortL216_cnt_ret_cp_rp_workdone_nonl_en_fioL232_do_fioL237_type_f_elist_errno_fatal_doned_doend_doed_dorevert_cplus_scale_cblank_fmt_bgL286_cursorL290L321 lio.o 363528429 0 27 100664 2147 ` L,^ݬP=2Pՠ$ PP  P|vnPРQ֠aaPWݬM^ݬ߭4߭*$PPP  ޭPPЭP֭`~lPPP Jݬ\~^PPP  ԭЬP֬`~֭ѭqCq9 IPPP 0* \~3PPP y \~PPP B 3(*p~=,p ~)) ^ԭѭ1ЬPP#*CJ\qݏG2мݭ ֭Vpp~ЬVVЬppp~p~ݬ ݼݬ ݬP@ B %ldunknown type in lio   ' . 5 ;@ FK Q ` ou           .4 D S fl u      ! # 6< ENYbmv% %4C $-7B|JP|YbkwhJ _s_wsleL51_init_f_init_c_le_reading_external_formatted_t_putc_putn_l_write_lioproc_curunit_nowwriting_e_wsleL62_recposL66_cf__flsbuf_lwrt_IL72_sprintf_strlen_lwrt_LL84_wrt_L_lwrt_AL91_lwrt_FL100_scale_wrt_F_wrt_E_lwrt_CL113L118_fatal lread.o 363528495 0 27 100664 7039 `  p^Pՠ PPРQ֠aP PPЭPP P ^Pՠ PPP P^ԭѭWPLPՠ ,@Pՠ 37 ݏP1 ;3ݭ11PPzP P P,P/PЬPP$$3B=ZP0ЭPPPrP*1P(( Pՠ1 1P 9P  PЬPP)6@JTo6 ֭1j}PPjpvfp\ЬvMvAЬp2p&ݬ ݬ1p^ԭԭp pppԭЭȭЭ̭P߭PPPPP*"Ppp& ߭PPխ`PP.p jDP;߭ PխP@( o! PЭQA`PQԭp խjխ1խqz  rԭ*Q߭qPfM ֭ѭܭ`ԭ d9 ֭nPqPԭ f' ֭nPrRqPRխr0p(1Q^ԭԭp PP-9ѭ+ԭ.ݭ֭ePnR`RPcPP@Pխrpq|ЭPЭP^o1id]PP(gMF@4-&P@3P P,1P==EP1P * pݏppP PݏphP_YP M=y,PP*PP(1 PPP@P&P@P)11P@P 1x1f^kP`YPPPЭQA`1 El u        # +1 8 > F f n           & 1 ;Sb k z    ) >T ] gs    )7AM T ] t      "     ! (" 6 B L Ta l u          ! ' -3 :" AMY dnz       "    # . 7 ?L V ` gw      !  *  5 C N U _ o  x  ~   "             % & '  1  <  F  N ^ }        0 X  _ ' f  x   * +  - . /     0  2 -  5 B  M 3 S 3 X 4 `  p 5 u  {  6             %-1:>GdOSZbiptx<    &. 4=GR^cksz _lioproc_ltab_l_comma_l_first_t_getcL55_curunit_cf__filbuf_e_rsleL64_lquit_lcount_ltype_lchar_lx_ly_l_readL78_elist_errno_fatal_ungetc_l_R_l_C_l_L_l_CHAR_clearerr_b_charL155_rd_intL193__ctype_L208_fscanfL252L284_free_malloc_realloc_s_rsleL327_init_f_init_c_le_reading_external_formatted_nowreadingL337_fmtbuf_recpos_scale_units_fk_open_do_lioL356 open.o 363528535 0 27 100664 2270 ` H,^ЬPѠՠ'ռ eݏeePЬP,P@ս10ЬPЭQР ЬPՠ  PPb ЭPЭPԠЬPՠVЭPՠ ^ЭPԠЬPՠ%PPn1cPo Ps1ЬPՠBռ%k.ЬPPPfЭPݏkkPЬPݠ ݠЭPԠ(ЬPՠ1PPoPռ gxrPQݏq]qPЭPݠFЭPԠ P'PPUռ1wPP ЭP$+PLPЭPԠ$ݽЭQPЭQPP2ռlռ1l1hݏlelPЬPՠЭPՠ ݽDPЭP(.(P~ЭQPЭPՠ1ռ1{q1ЭPԠ(ЬPՠռ11ЬPݠ ݠP1yݏP|1\ЬPՠ+ЬPՠ 1 PPbPPЭQP1ЬPݠ ݠ0%ЭQPЬPРмP1J0^ݬ ߭Ь ޭ߭PԭѬ PPPѬ PPPѬPPPԭ߭i$^߭ݬVPPP\`PЬPՠՠpЬPՠ$ PppPlݼUݼ`P`PP߭PhP``hh`lh߭{`ljh_PdP1d\ЬPݠp-ЬPݠp dd* ooPݏolp15hh 1)UDendfiletmp.FXXXXXXw/bin/cpcp/usr/bin/cpcpno cp endfileendfile %2 G jx      * S          ", 7D Q \ s{!(4<@GNV^elt|_ax_f_endL34_errno_fatal_units_nowreading_t_runcL48_ftell_fseek_strcpy_mktemp_fopen_fread_fwrite_fflush_fork_execl__iob_fprintf_exit_wait_fclose_unlinkwrtfmt.o 363528653 0 27 100664 4732 `   _P* ns ݏnnPPՠ~Pu jk( ݏjVjPGP<мPPW44n444444444444ݼ  ݬ ЬPݠݬHݬ ЬPݠݠݬݬ ЬPݠݬݬ ݬݬ ЬPݠݬݬ ЬPݠ ݠݠݬݬ ЬPݠ ݠݠݬrݬ ЬPݠݠݬ,мPP j;x\jCݼ ЬPPPPЬP ЬPЬPݠЬPݠݠN^Ь[Ѭ 2Ѭ м[߭߭ݭDPíխ.׭խԭѭ`*֭ԭ ֭ѭխ-  +ԭЭP֭`~֭ѭP^Ѭ2Ѭм ߭߭ݭPխqԭPP PP:ԭ *@֭ѭլ  ԭ !֭ѭPխѭ íPì PíPԭ ֭ѭխ-  +ԭ 0֭í PѭPԭЭP֭`~֭ѭ1k^vPkЬ ~S֭֭ЭP`P^Ь!PЬP׬PЭP֭`~P^Ѭ 2Ѭ мԭ ֭PѭPխݏtݏfPЬP֬`~ЬP׬PP ׬ `Ѭ ЬP֬`~FЬP׬PP^-֬ ߭߭ݬ ѬVPpPpP~Pխ PѬPԭ *֭ѭPԭ ֭ PPPѭPխ-  +_ά PuPR.iԭ 0[֭RPѭPԭB PѭP1ЭP֭`~%֭b P PTԭЭP֭`~֭ѭ.ԭ PѭP?ЭP֭`~֭.ԭЭP֭`~֭ѭ VPqP zԭѭdѭ ݏeRխ-Dέ +4Ѭ ѭd(ǏdP0P~ǏdPďdPPѬ P0P~ P PPP0P~1 ^pKѬVPpPpPqP.rPq(ݬݬݬ ݬݬ<ԭkqYaլݬí ~í~ݬ?Pԭ %֭ѭЭЭP֭dѭ 1o ^ѬVPpPpP?ԭѭ*dh֭ԭ f^֭PѭP߭߭ݬ p~PέPP ԭխh PխЭQQQPPԭ *0֭ѭPԭ ֭ѭխ-  +ԭЭP֭`~֭ѭ.ԭѭ 50֭έPѭP ЭP֭`~0֭ѭ 1W@> B B Bleft offfmtw_ed, unexpected code: %d %s w_ned, unexpected code: %d %s     % * 3 = ER ] k q x ~        6Ngu    & 1 < L Z j|     " 8 |     / : H m   < d }   ( )  , G j u {( (   ( (  ( (  (  '( A O e z(      . =E( bp(  ( # ( + ( 8 ( @ R ] ( x ,    !  4  I  r   &-4;DHOUYagpw~Jl6 ~ "(_mv_curL50_putn_cursor_recpos_elist_errno_fatal_curunit_cf_fseek_w_edL70_fmtbuf__iob_fprintf_abort_wrt_I_wrt_IM_wrt_L_wrt_A_wrt_AW_wrt_E_wrt_G_wrt_F_w_nedL103_donewrec_wrt_AP_wrt_HL121_icvt_cplusL144L176L188L195L208L214L222_scale_ecvtL266L285_fcvterr.o 363528674 0 27 100664 2896 ` Ѭdլ ݬQѬuݬݬ,լݬݬÏdP@ݬPՠ P wPРPPÏeP,P~tMG P6PPG  PPP PPP PPP qPpPPH^ЭQPЭPЭP$+G?NЭQPЭPЭPԠ$##ЭQPЭPЭP$ ^߭ЬP~ЬP~PPP^ЬPԠ$ݼPݼЬPݠPPݭݼlP^ݼYPЬP$ݼ=ЬPݠ6PPݭݼP  9Tj(;U%s: illegal error number %d %s: end of file %d %s: %s apparent state: unit %d named %s last format: %s lately %s %s %s %s IO readingwritingsequentialdirectformattedunformattedexternalinternalraerror in formatillegal unit numberformatted io not allowedunformatted io not alloweddirect io not allowedsequential io not allowedcan't backspace filenull file namecan't stat fileunit not connectedoff end of recordtruncation failed in endfileincomprehensible list inputout of free spaceunit not connectedread unexpected characterblank logical input field /BT]c j p |            '0 8AJP W ^ e r x         )" =# ^& ky' ( & ' (   $(,048<@p !(08BHOV`jvj L$+4;GL_units_init_elist_reading_cplus_cblank_fmtbuf_external_doed_doned_doend_donewrec_dorevert_sequential_formatted_getn_putn_cf_curunit_recpos_cursor_scale_F_err_fatalL59_perror__iob_fprintf__cleanup_abort_f_initL90_canseekL95_fstat_isatty_nowreadingL103_ftell_freopen_fseek_nowwritingL111fmtlib.o 363528683 0 27 100664 226 ` l$ Ь[լ6Լ  ά Zլ;[P[PPP0PPJ3[ZլԼ 0$PZ ZmP5PVd l _icvtL16L12_sequential_formatted_getn_putn_cf_curunit_recpos_cursor_scale_F_err_fatalL59_perror__iob_fprintf__cleanup_abort_f_initL90_canseekL95_fstat_isatty_nolib/libI77uc.a 755 0 33 217032 2552606101 6375 ((! __.SYMDEF 363531333 0 27 100664 7176 ` P L L L L L L L L L LL LLL#L+/0/8/?/G/O/Wb6_b6gb6ob6yb6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6 b6JJ J%J-J4J<JDJL:TT:T[:Tc:Tk:Tr:Tz:T:T:T:T:T:T:Txfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxf"xf*<2<:<C<K<S<[<c<k<t<|<<<DDDDDDDDDJ JJJ!J(J.J6J>JDJT\ckryFF ""+3;CIPX`hpx)09?EMSW`gow '/*8*A*I*U*a*i*q*x*z_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_del_step_arc_quad_abs_box_circle_closevt_closepl_dot_erase_lbl_mv_lbl_umv_label_line_linemod_move_openvt_openpl_point_scale_space_obotx_oboty_botx_boty_scalex_scaley_scaleflag_oloy_ohiy_ohix_oextra_cont_putch_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_xargc_xargv_main__sigfdie__sigidie__sigqdie__sigindie__sigtdie__sigdie_s_rnge_abort__getarg__iargc__getenv__signal__s_stop_s_paus_system__pow_ci_pow_dd_pow_di_pow_hh_pow_ii_pow_ri_pow_zi_pow_zz_c_abs_c_cos_c_div_c_exp_c_log_c_sin_c_sqrt_z_abs_z_cos_z_div_z_exp_z_log_z_sin_z_sqrt_r_abs_r_acos_r_asin_r_atan_r_atn2_r_cnjg_r_cos_r_cosh_r_dim_r_exp_r_imag_r_int_r_lg10_r_log_r_mod_r_nint_r_sign_r_sin_r_sinh_r_sqrt_r_tan_r_tanh_srand__rand__d_abs_d_acos_d_asin_d_atan_d_atn2_d_cnjg_d_cos_d_cosh_d_dim_d_exp_d_imag_d_int_d_lg10_d_log_d_mod_d_nint_d_prod_d_sign_d_sin_d_sinh_d_sqrt_d_tan_d_tanh_i_abs_i_dim_i_dnnt_i_indx_i_len_i_mod_i_nint_i_sign_h_abs_h_dim_h_dnnt_h_indx_h_len_h_mod_h_nint_h_sign_l_ge_l_gt_l_le_l_lt_hl_ge_hl_gt_hl_le_hl_lt_ef1asc__ef1cmc__s_cat_s_cmp_s_copy_cabs_tanh_sinh_cosh_f_back_s_rdfe_c_dfe_y_getc_y_err_y_rsk_s_wdfe_y_putc_y_rev_e_rdfe_e_wdfe_s_rdue_c_due_s_wdue_e_rdue_e_wdue_icptr_icend_svic_icnum_icpos_z_getc_z_putc_z_rnew_s_rsfi_c_si_y_ierr_s_wsfi_z_wnew_e_rsfi_e_wsfi_f_inqu_setcilist_setolist_stcllist_setalist_f_rew_s_rsfe_x_getc_x_endp_xrd_SL_x_rev_rd_ed_rd_I_rd_L_rd_A_rd_AW_rd_F_rd_ned_rd_POS_rd_H_recloc_s_rsue_c_sue_s_wsue_e_wsue_e_rsue_reclen_do_us_do_uio_do_ud_s_wsfe_x_putc_xw_end_xw_rev_x_wSL_pr_put_e_rsfe_c_sfe_e_wsfe_syl_parenlvl_pc_revloc_pars_f_f_s_op_gen_f_list_i_tem_ne_d_e_d_gt_num_ap_end_cnt_ret_cp_rp_workdone_nonl_en_fio_do_fio_type_f_fmt_bg_s_wsle_t_putc_l_write_e_wsle_lwrt_I_lwrt_L_lwrt_A_lwrt_F_lwrt_C_lioproc_ltab_l_comma_l_first_t_getc_e_rsle_lquit_lcount_ltype_lchar_lx_ly_l_read_l_R_l_C_l_L_l_CHAR_rd_int_s_rsle_c_le_do_lio_f_open_isdev_fk_open_f_clos_f_exit_flush__g_char_b_char_inode_mvgbt_f_end_t_runc_mv_cur_w_ed_wrt_I_wrt_IM_wrt_L_wrt_A_wrt_AW_wrt_E_wrt_G_wrt_F_w_ned_wrt_AP_wrt_H_units_init_elist_reading_cplus_cblank_fmtbuf_external_doed_doned_doend_donewrec_dorevert_sequential_formatted_getn_putn_cf_curunit_recpos_cursor_scale_F_err_fatal_f_init_canseek_nowreading_nowwriting_icvt_dfe_rdfe_wdfe_s_rdfe_c_dfe_y_getc_y_tab_y_rnew_s_wdfe_y_putc_y_wnew_e_rdfe_e_wdfe_y_rend_y_wend_due_s_rdue_c_due_s_wdue_e_rdue_e_wdue_z_getc_z_putc_z_wnew_z_ungetc_s_rsfi_z_rnew_z_tab_c_si_s_wsfi_s_rdfi_c_di_s_wdfi_c_fi_e_rsfi_e_wsfi_e_rdfi_e_wdfi_c_li_s_rsli_s_wsli_e_rsli_e_wsli_iiorec__iiopos__recloc_rsue_sue_s_rsue_c_sue_s_wsue_e_wsue_e_rsue_s_rsfe_c_sfe_x_getc_x_rnew_x_tab_e_rsfe_new_s_wsfe_pr_put_x_putc_x_wend_x_wnew_e_wsfe_lrd_lchar_lx_ly_ltype_ltab_s_rsle_l_read_t_getc_e_rsle_t_sep_l_R_l_C_l_L_l_CHAR_lr_comm_get_repet_rd_int_s_wsle_t_putc_l_write_e_wsle_lwrt_I_lwrt_F_lwrt_D_lwrt_C_lwrt_DC_lwrt_L_lwrt_A_chk_len_lwrt_0_cnt_ret_cp_rp_dfio_en_fio_do_fio_type_f_fmt_bg_eor_uio_do_us_due_err_do_uio_do_ud_c_le_do_lio_rd_ed_rd_mvcur_rd_I_rd_L_rd_AW_rd_F_rd_ned_rd_POS_rd_H_w_ed_wr_mvcur_wrt_IM_wrt_L_wrt_AW_wrt_E_wrt_G_wrt_F_w_ned_wrt_AP_wrt_H_syl_parenlvl_pc_revloc_pars_f_f_s_op_gen_f_list_i_tem_ne_d_e_d_gt_num_ap_end__digit_icvt_bksp_f_back_f_rew_f_open_isdev_fk_open_f_clos_f_exit_flush__endf_f_end_t_runc_f_inqu_allocs_allocp_alloct_allocx_malloc_free_calloc_realloc_tmplate_fortfile_units_reading_external_sequential_formatted_fmtbuf_icptr_icend_fmtptr_doed_doned_doend_donewrec_dorevert_dotab_lioproc_getn_putn_ungetn_svic_cf_curunit_lunit_lfname_recpos_recnum_reclen_cursor_scale_radix_signit_tab_cplus_cblank_elist_errflag_endflag_lquit_l_first_leof_lcount_line_len_fatal_prnt_fmt_prnt_ext_prnt_int_ffputc_f_init_ini_std_canseek_finode_nowreading_nowwriting_g_char_b_char_inode_last_char_f_errlist_f_nerr_sccs_id_init66__no_66_dfe.o 363528717 0 27 100775 4752 ` $^ݬPPՠ$ PRsyrP+hd^XP8ݏdC83-'!  ЬPР Р+ePݏe,P@~x;pݬbP!V PM)ݭ;50)#PРՠ& f1UݏfPՠՠ & h1ݏhЬPP ~P}wP^iPՠ PYPѠ LPE?QP }2*PРQ֠aP PPЭPP P P PPѠ EPQP +n}wP[ݏnb\TPРQ֠a@ݬ6P^'PѠ .1PPPߘkP PQíPF­ݭPzPl mP`[UPN +Dn:4Pݏn PPѠ : ~PPѠ q1~ysn c]PV LF@;50PPmdferead dfewrite dfe ! 0 6; A F L Q W\ bg m r x }                 " (- 38 > C I N T [ e o u }  " " $ % % & ' ( ) ) * * + + , - .   &/ .0 40 =0 E O U ]j q0 y1 ~  0 2     3 (  '      $ . 7D Q4 Y `4 i3 p5 v 6 7   * *  3 3 3 8 3    % + 39 @ N [* b* h u   (( 3 3 3 9  , 3 : , ) * * ") (, -* 6* ;) C M, V) [* c, n3 u5 {, ,  , *  *     , 3 5 , ,  4 4 &3 -5 3, 9, >) D) I* T a) f* p* u) |3 5 ) *   * 4 , , ) ) *  K&-6BJtPW\]eBl sPzCK0:_ sWYJkP '2<DRK;Sc[bjqy caeUbf|F_dfe_rdfe_wdfe_s_rdfe_reading_c_dfe_curunit_nowreading_y_getc_getn_rd_ed_doed_rd_ned_doned_y_tab_dotab_y_rnew_donewrec_doend_dorevert_fmtbuf_pars_f_errflag_errno_fatal_fmt_bg_s_wdfe_nowwriting_y_putc_putn_w_ed_w_ned_y_wnew_e_rdfe_en_fio_e_wdfe_sequential_formatted_external_lfname_elist_reclen_recpos_scale_cursor_radix_signit_endflag_lunit_units_fk_open_cf_recnum_fseek_cblank_cplus__filbuf__flsbuf_ftell_y_rend_y_wenddue.o 363528726 0 27 100775 1805 ` P^ݬ`PPՠ$ PP^ݬ)PPԠ Pՠ$ PP^}wqkf`ZUNFЬP:Р2,#+e Pݏe,P@;ݬP! P9ݭPР~ՠ&s gi1UݏgSMPՠՠ &< h21ݏhЬPP Qš P~P~PP^ԭPѠ Q G PP~P߭PwPdue ! 0 ? KX b q                ( 6 B K S] c h o u ~            . ; G T [ e s ~  ix!*68>WJRRYdp:xc_  ce$[_due_s_rdue_reading_c_due_curunit_nowreading_s_wdue_nowwriting_lfname_elist_formatted_sequential_reclen_recpos_external_errflag_endflag_lunit_errno_fatal_units_fk_open_cf_fseek_due_err_e_rdue_e_wdue_fwrite iio.o 363528739 0 27 100775 5170 `  Hp PPQPP Pm PQPsmPdnZQKPSݏn6/)5ݏPQPPPQP+kPݏkzuoj_YTxI>ݬ*$\ oYݬ[|ݬfhb]WRG<1+&ݬЬPР PP ЬЬPPQšPPQPyslP+bdXRPgݏd=6P)#ЬPРPЬPŠPЬQPQPQġPPP)zPPrlg \VPOE?:4/)P^  PkPGíP<­PP& P~xP^jP`Z3,&!Ь PPЬPРPQšPPQPPsysmݬ#ZOIDЬPР8P&PtPPiioiioilioifioint list io    $ + 1 > E R W fm t z            # 0 8 B H P] e q w |                    )3 9 > D I OT Z_ ej p u {            # $ % & & ' !( '( ,) 3* :+ A, I O- U- Z p x  # .     / 0 1  0 1 1  $.1 41 ; I O( U( Z- `- e p- u } -  -     ( ( - -  1 -   - (   -  #( . 4- 9 A( G( N( [ h( m s( x ~( ( 3 # # $ $ 0 % ,    1 ' ' & ! 0 6 > I O [ a9 f: lq w|; < = >   @ : A # #  - 1   f c"(.yN6l>_GN U^hlpy\Btc*K00P5O.w &a-U5=DKSRZ:b;jr~b'VdOL`O!*_z_getc_icptr_icend_recpos_leof_svic_z_putc_z_wnew_errflag_errno_fatal_endflag_z_ungetc_s_rsfi_reading_rd_ed_doed_rd_ned_doned_getn_z_rnew_donewrec_doend_dorevert_z_tab_dotab_c_si_s_wsfi_w_ed_w_ned_putn_s_rdfi_c_di_s_wdfi_c_fi_fmtbuf_formatted_external_cplus_cblank_cursor_scale_radix_signit_elist_reclen_pars_f_fmt_bg_sequential_recnum_e_rsfi_en_fio_e_wsfi_e_rdfi_e_wdfi_c_li_s_rsli_l_read_lioproc_ungetn_l_first_lcount_lquit_s_wsli_l_write_line_len_e_rsli_e_wsli_iiorec__iiopos_sue.o 363528748 0 27 100775 2350 ` \^ݬ$PPՠ$ PPPP BP  ytnPݏYSLF81^%ݬUP Pՠ$ PPPԠ P^ЬPРyp+he^XPݏeC,~70~%read sfesfesfesfesfewrite sfe ! 0 6; A F L Q W\ b g m r x}                & + 9 I Q d k          ! ! "  # $  % & && /& 7 A G O\ c& k' u & (      $  #      '4 : @ E) K) P V [ b* i+ o x, ~-   /   1 1  3  4      ! ', 2 9 C M S [h o          7         + 6 > S ]7 k p x }        8      8      01 6 = G P _ h9 v {    8 1      8 1  %129t?F\LTB[#c0jtK~dP:_ ;cA&R-6 =cDMT[cUkarzW9v&KrfeL_s_rsfe_reading_c_sfe_curunit_nowreading_x_getc_getn_rd_ed_doed_rd_ned_doned_x_rnew_doend_dorevert_donewrec_x_tab_dotab_fmtbuf_pars_f_errflag_errno_fatal_fmt_bg_cf__filbuf_reclen_recpos_cursor_ungetc_e_rsfe_en_fio_new_formatted_sequential_external_lfname_elist_endflag_lunit_units_fk_open_scale_radix_signit_cblank_cplus_s_wsfe_nowwriting_pr_put_putn_x_putc_w_ed_w_ned_x_wend_x_wnew__flsbuf_fseek_ungetn_e_wsfe lread.o 363528797 0 27 100775 6280 ` 4 L^ݬP7PР ՠ$ PP^Pՠ PqiPРQ֠aP VOPPЭPP5p&!PPP@/P)1j8ݏp1$^PPPPP. PЭPPFMPTPf;Pt?prY1PЭQA`Q Q11zpH'wXPЭQA`HPЭQA`ݭp1/ѭPpPݏpP@1:1^`PPPdP@PRPЭQA`tPЭQA`QQ ѭ1P ݭ  ݏPP+qPݏqԭ1P@1PЭQA`ѭ ѭ֭ѭ֭i~/(P!P1\@ݏqPPѭ fЭP\@PQPQ1W1(ѭ1iѭ1ݭ1(wPQPQ֭ѭ1P1PݭF1^4P@a!Pѭ/ݭP.PЭQA`P@t #  B B B B@C@list iolist iolist iolist iolist iono (no )logical not T or Flist read  " ( .3 9> D I O X ^ l {            , 4 = C KX ^ i p |           )< DL T^ g r     "     $ + 1 Q Y j w        #      $ * 3 9 J V] h rz       / 9E(( O ` g w          %1Rl       # :Tbp            * 1 @N\ l        )  3  9  A N  U  \  h |               ' + ( 2  <  D  N  T  \ i  v     )       /  l  v             $ +  4 P-8 %-6#<`ELdTO]1tetkAsL{ _ L8&t  BB!)y/77@_lrd_lchar_lx_ly_ltype_ltab_s_rsle_reading_c_le_l_first_lquit_l_read_lioproc_t_getc_getn_ungetc_ungetn_curunit_leof_lcount_nowreading_cf__filbuf_clearerr_e_rsle_endflag_errno_fatal_errflag_t_sep_l_R_l_C_l_L_l_CHAR_external_b_char_lr_comm_get_repet_rd_int_free_malloc_realloclwrite.o 363528820 0 27 100775 4300 ` <8^ݬP@PPԠ Pՠ$ PP xPРQ֠ad~YP^ HPP,^ԭѭ1ЬPP.5f nݏwn0d[2мݭPIPЕЭPV~QPP#ݭ ֭1Pp~PPaQ1~ЬPحPحV~V~PP1t 16Ьpԭpԭp~p~P1HP1P1&1ݼP1P1"11ݬ ݬP1P`11L1yP^ݬ߭,߭"P)P$ޭ蕽PЭP֭`~PЭP^P\~^~PЭP P PԭЬP֬`~vP֭ѭP^qvq?qrPpPqPuqsrPpPqPhP PPPPѭ Uq:rPpPvPVPf.PvP׭VPqPݭ ߭z~߭l^q$pq?qrPpPqPqrPpPqPPPPPPѭKqrPpPpP f׭qmݭ߭~߭~^q;?q9rPpPqP.q,rPpPqP!P Pq ?q r Rp RqR q r Rp RqRQ QQPP~PЭP P P(Pp~,P,Pp ~ P)_PP^qe?qcrPpPqPXqVrPpPqPKPPq A?q ?r Rp RqR4q 2r Rp RqR'QQQPP~PЭP P P(yPp~P,YPp ~P)9PP^*PPЭP֭`~PЭP^PP PPtJ$>@ BW >@ BtJ$>tJ$>W >W >list iolist iolist iolist iolist iolist iolist iounknown type in lwrite %ld 0.  % +0 8 > H N ] n v |   , 6 < IY ak |     - 8A Pc nw      4 G[ j  " .J]p x  !  &>K^ f p ~! +? N ] n}   &9Qe t      ! ,  #d#)2O;ENTW`chlfu}_ :F$~x w_s_wsle_reading_c_le_t_putc_putn_l_write_lioproc_line_len_curunit_leof_nowwriting_recpos_cf__flsbuf_e_wsle_errflag_lwrt_I_endflag_errno_lwrt_F_fatal_lwrt_D_lwrt_C_lwrt_DC_lwrt_L_lwrt_A_sprintf_strlen_chk_len_wrt_L_lwrt_0_scale_wrt_F_wrt_Edofio.o 363528831 0 27 100775 2304 ` (D,^߭^мxPPP`P"FF\FaFFFFFF55FFFFFFFFFF&r1de_PݬݭPPP!@Y`ݭ.(1G6 PP"ݭPЭ1uլP@խݬ ݬݭPP1ݭP@x ׭1g1}\V M1nݏd5ЭP+QРA!1  1=ݏdЭPQРA1P@1P@1լ2 P1P~11vp11hխ1pZTOЭPРCK Q a mt          ' 7 CJQ a l x            5c&:._7> EINPhY[a'iu&|_eor_uio_do_us_reading_recpos_reclen_errflag_errno_fatal_cf_fread_due_err_fwrite_do_uio_sequential_do_ud_curunit_endflag_clearerrdolio.o 363528852 0 27 100775 1373 `  ^ЬPР+eP|ݏeo,hP@`[U;Mݬ?P!3 P*"ݭ ((PРPPPՠ& f1ݏfPՠ & iy1pݏicPݼݬݬ ݬKext list io     % * 05 = I Q W ` h r x            ! ' - 5 ; G Q Z g m y     # R$.:B_KT [b icpycUaO_c_le_lfname_elist_formatted_external_sequential_fmtbuf_errflag_endflag_lunit_errno_fatal_units_curunit_fk_open_cf_cursor_recpos_scale_cblank_cplus_do_lio_lioproc rdfmt.o 363528871 0 27 100775 3207 ` (h@^PЭPмPPD44D444444444444dPݬ ЬPݠݬPPsP gP\1sPЬPݠݬZЬPЬ ݬ ЬPݠݬݬ ЬPݠݠݬмPP QI(7QtdPЬPݠЬPݠݠNЬPѼPPPPЬPՠ}PPr%ЬPxP`QxQQQTQQPKDЬP 6^) PPPP^ԭԭԭѭ1PѭAѭZ PЭPPP 1P gP+4P,P-RP0eP9`0PPPPtYlPP֭1yѭz:ÏWPPP?$ҕ/'ѭas PխέѬ ЭP ^ԭѭlPѭAѭZ PЭPPPt"ѭ ѭԭ֭ѭfѭ,ѭtYSPЭP0^pepԭЭЭЭܭЭحЭԭԭѭ1֭PЭPѭAѭZ PЭPPP ѭ+ѭ-ѭ9"ѭ0ePnR`RPcP1wѭe4ѭd*ѭ.$nѭ  d1Dѭ,LЬѭ.ѭ1ѭeѭdѭ+ѭ-֭P1 ѭ 1sPѭAѭZ PЭPPP94P0/ePnR`RPcPѭ d֭1Nѭ,0Ьѭ-ѭ1֭_P1Yѭ 11ѭAѭZ PЭPPP-P9P0 PP0P ѭ  1|ѭ,ѭ ѭ+ѭ 1խԭ f(֭ѭ ԭ f֭ѭ`խԭѭ$f֭ԭ d֭ѭխrխ4X f׭խ> d֭խѬvpP^Ѭ Sԭ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ݭ8AZ P PPP֬PPa (..o.ЭЬP߭ݬ;Pխ1.֬߭ݬPԭAZ P PPPe.4֬߭ݬPe5d("edݬݭݭݭݭЬP߭ݬdPխPݭ͑ ֬0)9#߭ݬ*PխPݭ ݬ߭ݬPխ1t.֬߭ݬPԭݬݭݭ1>߭ݬPխ1,.֬߭ݬP ݬݭݭݭ1^xP@,ЬݏdЬЭPЬЭPЬ ЭPЬ P^ԭԭ֬ $09 PQQP0P֬09Б խЭЬP^֬Ь:7ݏd'֬ЬP`format too complexbad string     &S \ c p    =Sdz :  +nJl     < C   " :'6,4V<D3$KxQtVH^f m_syl_parenlvl_pc_revloc_pars_f_f_s_fmtptr_op_gen_f_list_i_tem_ne_d_e_d_gt_num_ap_end_fatal fmtlib.o 363528926 0 27 100775 777 ` ($0^ЏլԼ Э0P1լPPP PPPPPռ 1άPPP1íxPPҭPPcPZPPPNQEQQQQP4P+QQPQQPP PPPPP,Լ լ1mPPPPPP@Yí [4PPPPPP@)KK[լ[ [PP0123456789abcdefghijklmnopqrstuvwxyz!'/ J S c             . ;@M V kqw  !__digit_icvt_signit_radix backspace.o 363528935 0 27 100775 1113 ` ^ЬPР+ePiݏe,P@ս:|oP!c PZݭHЭPР<ՠ Ԡ Pݽ'PЭPՠ& j1RݏjЭPՠ$~ݭЭPՠ eǠ QĠ QQЭPЭPР PPݭ-ݏݽݽ߭έPP~ݽm16ЭPՠѭ ݽQ1ݽDP 1backspace    ( . 7 ? I O Wd k s           $ j {    d R!+_4 ;B IcPY|`heoNv~8_bksp_f_back_lfname_elist_external_errflag_lunit_errno_fatal_units_fk_open_ftell_t_runc_fseek_fread_rewind_last_char rewind.o 363528945 0 27 100775 814 ` $^ЬPР+ePݏe,P@ս:|oP!c PZ}ݭHЭPР<ՠ&1 j'1qPݏjЭPԠ ЭPՠ$~ݭPݽPrewindrewindrewind    ( . 7 ? I O Wd k s             R$ +_4; BcIRZb_f_rew_lfname_elist_external_lunit_errflag_errno_fatal_units_fk_open_t_runc_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TݠP6ЬPՠXխ ЭPЬQР XЬPՠ\*խ%ЭPՠ ݽЭQơ PPЬQP\ЬPՠ`1CխЭPՠЬPݠdݠ`ЭPՠ PPP1inquiredirectsequentialyesnoyesnoprintformattedunformattedunknownyesnounknownnoyesunknownzeroblank    $ C N }             j  3 Zc~  . KTbz   GPZ  R ",f4;cBI PX|__f_inqu_elist_lfname_lunit_external_g_char_inode_units_errno_fatal_b_char_ftell dballoc.o 363529019 0 27 100775 1077 `  ^~P[2ннЭP`x[PPѭPx[PPP1Эѭѭ ѭݏwm[PˏPxz~>PPPЭJCPѭP5x>PPPн 1x[PPѭнP^ЬЬPP^Ŭ~~P ^Ь[[PPݬ[PZZ[ZP[Z~7PYYY нЭP׭PZ[xYPZPP[xYPZP[PP@jdballoc  pz   '/4<Cb~    $($,1 8>yPDkpL7U_allocs_allocp_alloct_allocx_mallocudiv_fatal_sbrk_free_calloc_realloc err.o 363529034 0 27 100775 4844 ` $^߭լݬݬCzլ_ѬUЬP@Pݬ2.dPѬP5ÏdP@ݬݬs#ѬdݬݬuNHx@Q8PP P(P0.WP^ 1PP P PPP PPPg dPcPP:g@:>2 ݬ Pՠ ^)PPXP6ЭP׭P;Pѭ leP ֭uݏ|Hԭ?8PPPPAݭ֭ѭ( ^[   P PPЭP֭`~!ѭݏ|!ѭ%ЭP֭`~hPѭP{ R^_8Ѭd+(#ѭЭPPP `FF"PPP8ѭݏ|֭׭խ Ѭ  Ѭݬݏ^ȅ@ݬݬPb9/&2 ~' %s: [%d] end of file %s: [%d] %s %s: [%d] %s %s: [%d] unknown error number stderrstdinstdoutlogical unit %d, named '%s' lately: %s %s %s %s IO readingwritingsequentialdirectformattedlistunformattedexternalinternalpart of last data: part of last string: part of last format: tmp.FXXXXXXfort.%d- %4. A/ LY0 p1 |2 3 2 3          !'2 .3 4$ ? GP Xa ir{  2 3       7 8 9 '-2 43 : A: T [; l2 r y<  > 2 ?  < 2 2 ? 2 3  % 2 <2 MU ]2 j? t |2  2 ? 2 3       2 6> F2 S? d2 m? ? ? 2 A 2 A B 2 A  c'1=HPfW ^f\lBs0zKPOtL ca: bUR%_.7>`GMU_ fnx.,>:|ir8V(_tmplate_fortfile_units_reading_external_sequential_formatted_fmtbuf_icptr_icend_fmtptr_doed_doned_doend_donewrec_dorevert_dotab_lioproc_getn_putn_ungetn_svic_cf_curunit_lunit_lfname_recpos_recnum_reclen_cursor_scale_radix_signit_tab_cplus_cblank_elist_errflag_endflag_lquit_l_first_leof_lcount_line_len_fatal_flush__sys_nerr_sys_errlist_f_nerr_f_errlist__iob_fprintf_prnt_fmt_prnt_ext_prnt_int_f_exit__cleanup_abort_ftell_rewind_fgetc_ffputc_last_char_fputc_f_init_ini_std_init66_util.o 363529044 0 27 100775 1152 ` l^,P@ЬЭPԠݬmЭQPЭPѬ PPЭQP$ЭPԠ ЭQР (լPPЭQPЭPСЭPԠ ݬrЭQP ^߭ЬP~SPЬP~;PPP^ЬPԠ$ݼPݼwЬPݠݭݼ^ЬP$ݼPݼ6ЬPݠݭݼ^PP PP  ׭׭ѭЭP ׭׭ѭ^ԭѭ ֭֬֬  ֬ЭP֭P  ^߭ݬP[E^}n^}nP)խ^}n^}nP ޭP}`ԭ[[k}`խխޭPޭP2Q}`a(PݭrPPP^ݬ}`[$^}n^}nPޭP}`[[d}`խխޭPQ}`aPݬPP1rޭPzxqPPhbPPXRMHmP7V[ݏ$x ~ ݏ^PPxPPPYǏPx PPPZǏ[[Fݏrx [~_XݏLF?[`xYPPPJ*QPQ1_P^PPxPPPZǏPx PPP[ǏYxZPKQPQQKx Y~ݏ~xq Ь[ЬZZ ^Ь[լSЬP2kQPQG2ZPPP2@kZP2@kPPPZQ2@kPPQޭPQ}`aPԭԭЬ[[ì[P[PЬZЬ Y zPyQQP[^PPxPҭPPPɭPʭ^ԭԭ[3KYZYP@P@xYYZZ[[ЭPЬ[լ~ЬP2kQPQrPP2@kZ2Yլ P2@kY2kP2@kXYZZYJIJZXZYZZP2@kPYPZQPAkZZP2kQPQk2kPP@kgЬ[2Zk2kP2@kZ¬ Z2kPPPPYZYP2kPPZ@kY IJZYY k2kPPЬ[2ZYYP2@kPPZ#YP2@kZYYP2kQPQ2kPPPPZPݏݬm=951-)%! 11r4G(f3YC!d&Yo;VVu7{ʉ0- T;/> [2/a1<=`fvK_zlG6$C w$M670)Yn!N6V1p&83)]H+ܝ<5;71g$+#) n0%a3 $ 2nV01}D9R7N:#68W)9:{2}x|~L'\/qö.pag.dircannot open database %s items not in pairs entry too big split not paired bad delitem bad block    # * 2 9 @ L S Z a j q w}             & / 5 ? E J O V` u~    ( /MY `h ox               2IQ X` gy              5D KS Zg n    /<Yw  3 :R\h               /  " '3 8 D P X |     /        # + S _ k r ~   I  U   Y `  g <     <   !)17=GPT\djry ,f ~  l   !, 5 :?B H MRW] ejo t y ~, l _bitno_maxbno_blkno_hmask_pagbuf_dirbuf_dirf_pagf_dbrdonly_dbminitL28_strcpy_strcat_open_printf_fstat_forderL44_calchash_getbit_fetchL66L53_dbm_access_makdatum_cmpdatum_deleteL68_delitem_lseek_write_storeL82_additem_clrbuf_setbit_firstkeyL112L108_firsthash_nextkeyL125L113_hashincL138L126L139_read_chkblkL151L159L165L179L172L180_hitab_hltabL192L201L211_abortL226L235l _bitno_maxbno_blkno_hmask_pagbuf_dirbuf_dirf_pagf_dbrdonly_dbminitL28_strcpy_strcat_open_printf_fstat_forderL44_calchash_getbit_fetchL66L53_dbm_access_makdatum_cmpdatum_deleteL68_delitem_lseek_write_storeL82_additem_clrbuf_setbit_firstkeyL112L108_firsthash_nextkeyL125L113_hashincL138L126L139_read_chkblkL151L159L165L179lib/libg.a 755 0 33 177 2552606034 5652  $    __dbargs__dbsubc__dbsubn_bitno_maxbno_blkno_hmask_pagbuf_dirbuf_dirf_pagf_dbrdonly_dbminitL28_strcpy_strcat_open_printf_fstat_forderL44_calchash_getbit_fetchL66L53_dbm_access_makdatum_cmpdatum_deleteL68_delitem_lseek_write_storeL82_additem_clrbuf_setbit_firstkeyL112/pT,pT5Ċ /,"((lib/libjobs.a 755 0 33 44752 2552606132 10676 1lib/libnew.alib/libln.a 755 0 33 22202 2552606117 6070 ! __.SYMDEF 363531348 0 27 100664 6750 ` @t" #_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_del_step_arc_quad_abs_box_circle_closevt_closepl_dot_erase_lbl_mv_lbl_umv_label_line_linemod_move_openvt_openpl_point_scale_space_obotx_oboty_botx_boty_scalex_scaley_scaleflag_oloy_ohiy_ohix_oextra_cont_putch_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_xargc_xargv_main__sigfdie__sigidie__sigqdie__sigindie__sigtdie__sigdie_s_rnge_abort__getarg__iargc__getenv__signal__s_stop_s_paus_system__pow_ci_pow_dd_pow_di_pow_hh_pow_ii_pow_ri_pow_zi_pow_zz_c_abs_c_cos_c_div_c_exp_c_log_c_sin_c_sqrt_z_abs_z_cos_z_div_z_exp_z_log_z_sin_z_sqrt_r_abs_r_acos_r_asin_r_atan_r_atn2_r_cnjg_r_cos_r_cosh_r_dim_r_exp_r_imag_r_int_r_lg10_r_log_r_mod_r_nint_r_sign_r_sin_r_sinh_r_sqrt_r_tan_r_tanh_srand__rand__d_abs_d_acos_d_asin_d_atan_d_atn2_d_cnjg_d_cos_d_cosh_d_dim_d_exp_d_imag_d_int_d_lg10_d_log_d_mod_d_nint_d_prod_d_sign_d_sin_d_sinh_d_sqrt_d_tan_d_tanh_i_abs_i_dim_i_dnnt_i_indx_i_len_i_mod_i_nint_i_sign_h_abs_h_dim_h_dnnt_h_indx_h_len_h_mod_h_nint_h_sign_l_ge_l_gt_l_le_l_lt_hl_ge_hl_gt_hl_le_hl_lt_ef1asc__ef1cmc__s_cat_s_cmp_s_copy_cabs_tanh_sinh_cosh_f_back_s_rdfe_c_dfe_y_getc_y_err_y_rsk_s_wdfe_y_putc_y_rev_e_rdfe_e_wdfe_s_rdue_c_due_s_wdue_e_rdue_e_wdue_icptr_icend_svic_icnum_icpos_z_getc_z_putc_z_rnew_s_rsfi_c_si_y_ierr_s_wsfi_z_wnew_e_rsfi_e_wsfi_f_inqu_setcilist_setolist_stcllist_setalist_f_rew_s_rsfe_x_getc_x_endp_xrd_SL_x_rev_rd_ed_rd_I_rd_L_rd_A_rd_AW_rd_F_rd_ned_rd_POS_rd_H_recloc_s_rsue_c_sue_s_wsue_e_wsue_e_rsue_reclen_do_us_do_uio_do_ud_s_wsfe_x_putc_xw_end_xw_rev_x_wSL_pr_put_e_rsfe_c_sfe_e_wsfe_syl_parenlvl_pc_revloc_pars_f_f_s_op_gen_f_list_i_tem_ne_d_e_d_gt_num_ap_end_cnt_ret_cp_rp_workdone_nonl_en_fio_do_fio_type_f_fmt_bg_s_wsle_t_putc_l_write_e_wsle_lwrt_I_lwrt_L_lwrt_A_lwrt_F_lwrt_C_lioproc_ltab_l_comma_l_first_t_getc_e_rsle_lquit_lcount_ltype_lchar_lx_ly_l_read_l_R_l_C_l_L_l_CHAR_rd_int_s_rsle_c_le_do_lio_f_open_isdev_fk_open_f_clos_f_exit_flush__g_char_b_char_inode_mvgbt_f_end_t_runc_mv_cur_w_ed_wrt_I_wrt_IM_wrt_L_wrt_A_wrt_AW_wrt_E_wrt_G_wrt_F_w_ned_wrt_AP_wrt_H_units_init_elist_reading_cplus_cblank_fmtbuf_external_doed_doned_doend_donewrec_dorevert_sequential_formatted_getn_putn_cf_curunit_recpos_cursor_scale_F_err_fatal_f_init_canseek_nowreading_nowwriting_icvt_dfe_rdfe_wdfe_s_rdfe_c_dfe_y_getc_y_tab_y_rnew_s_wdfe_y_putc_y_wnew_e_rdfe_e_wdfe_y_rend_y_wend_due_s_rdue_c_due_s_wdue_e_rdue_e_wdue_z_getc_z_putc_z_wnew_z_ungetc_s_rsfi_z_rnew_z_tab_c_si_s_wsfi_s_rdfi_c_di_s_wdfi_c_fi_e_rsfi_e_wsfi_e_rdfi_e_wdfi_c_li_s_rsli_s_wsli_e_rsli_e_wsli_iiorec__iiopos__recloc_rsue_sue_s_rsue_c_sue_s_wsue_e_wsue_e_rsue_s_rsfe_c_sfe_x_getc_x_rnew_x_tab_e_rsfe_new_s_wsfe_pr_put_x_putc_x_wend_x_wnew_e_wsfe_lrd_lchar_lx_ly_ltype_ltab_s_rsle_l_read_t_getc_e_rsle_t_sep_l_R_l_C_l_L_l_CHAR_lr_comm_get_repet_rd_int_s_wsle_t_putc_l_write_e_wsle_lwrt_I_lwrt_F_lwrt_D_lwrt_C_lwrt_DC_lwrt_L_lwrt_A_chk_len_lwrt_0_cnt_ret_cp_rp_dfio_en_fio_do_fio_type_f_fmt_bg_eor_uio_do_us_due_err_do_uio_do_ud_c_le_do_lio_rd_ed_rd_mvcur_rd_I_rd_L_rd_AW_rd_F_rd_ned_rd_POS_rd_H_w_ed_wr_mvcur_wrt_IM_wrt_L_wrt_AW_wrt_E_wrt_G_wrt_F_w_ned_wrt_AP_wrt_H_syl_parenlvl_pc_revloc_pars_f_f_s_op_gen_f_list_i_tem_ne_d_e_d_gt_num_ap_end__digit_icvt_bksp_f_back_f_rew_f_open_isdev_fk_open_f_clos_f_exit_flush__endf_f_end_t_runc_f_inqu_allocs_allocp_alloct_allocx_malloc_free_calloc_realloc_tmplate_fortfile_units_reading_external_sequential_formatted_fmtbuf_icptr_icend_fmtptr_doed_doned_doend_donewrec_dorevert_dotab_lioproc_getn_putn_ungetn_svic_cf_curunit_lunit_lfname_recpos_recnum_reclen_cursor_scale_radix_signit_tab_cplus_cblank_elist_errflag_endflag_lquit_l_first_leof_lcount_line_len_fatal_prnt_fmt_prnt_ext_prnt_int_ffputc_f_init_ini_std_canseek_finode_nowreading_nowwriting_g_char_b_char_inode_last_char_f_errlist_f_nerr_sccs_id_init66__no_66__box_wclear_initscr_endwin_mvprintw_mvwprintw_mvscanw_mvwscanw_mvwin_newwin_subwin_overlay_overwrite_printw__sprintw_wprintw_scanw__sscans_wscanw__win_wrefresh_touchwin_werase_wclrtobot_wclrtoeol__win_mvcur_fgoto_plod__putchar_plodput_putpad_ospeed_gettmode_setterm_zap_getcap_longname_delwin_winsertln_wdeleteln_scroll_wgetstr_wgetch_waddstr_waddch_wmove__echoit__rawmode_My_term__endwin_ttytype_Def_term__tty_ch_LINES_COLS__res_flg_stdscr_curscr__tty_AM_BS_CA_DA_DB_EO_GT_HZ_IN_MI_MS_NC_OS_UL_XN_NONL_UPPERCASE_normtty__pfast_AL_BC_BT_CD_CE_CL_CM_DC_DL_DM_DO_ED_EI_HO_IC_IM_IP_LL_MA_ND_SE_SF_SO_SR_TA_TE_TI_UC_UE_UP_US_VB_VE_VS_PC__unctrl_wstandout_wstandend_tstp_winsch_wdelch_getwd_prexit_cat_getwd_prexit_cat_killpg_killpg_setpgrp_getpgrp_setpgrp_getpgrp_sigsys_sigpeel_sigsys_sigpeel_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_wait3_wait3_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_sigsys_sigpeel_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_sigsys_sigpeel_allprint_printable_sprint_main_yyreject_yyracc_yyless_yywrap_allprint_printable_sprint_main_yyreject_yyracc_yyless_yywrapallprint.o 363529236 0 27 100664 566 ` lxPPRP EP +P KP~PE~{vPРQ֠aaPn~cЬP֬`~KѬ ѬPP\n\t\b\b\%-3o .4 ; BH O W_go w   $-6>BF_allprintL18_printable_yyout_fprintf__flsbuf_sprintL41L47main.o 363529240 0 27 100664 143 ` 0   _mainL18_yylex_exit reject.o 363529247 0 27 100664 1111 ` p&QRPBapPP iPPQA`~zP@rldPР[SKPC`"2P+P"P PЬQA`2J=P@~ά~PݠPPQA`PQA`ЬP    & , 1 9 A I P X c j v |                  # + 3 = H S Z c i p #+2:AKT\hrv_yyrejectL21_yyinput_yytext_yyleng_yylsp_yyolsp_yyfnd_yylstate_yyunput_yyracc_yyprevious_yyoutputL44_yyextra_yyback yyless.o 363529250 0 27 100664 325 ` `HH [լѬ ZЬZ {~[ZkZ{ÏZPP   ! 4 B K Q Z    )5_yylessL12_yyleng_yytext_yyunput_yyprevious yywrap.o (( 363529254 0 27 100664 80 ` P _yywrapL12 363529250 0 27 100664 325 ` `HH [լѬ ZЬZ {~[ZkZ{ÏZPP   ! 4 B K Q Z    )5_yylessL12_yyleng_yytext_yyunput_yyprevious yywrap.o lib/libl.a 755 0 33 22074 2552606114 5716 ! __.SYMDEF 363531345 0 27 100664 6680 ` @\\\."#_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_del_step_arc_quad_abs_box_circle_closevt_closepl_dot_erase_lbl_mv_lbl_umv_label_line_linemod_move_openvt_openpl_point_scale_space_obotx_oboty_botx_boty_scalex_scaley_scaleflag_oloy_ohiy_ohix_oextra_cont_putch_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_xargc_xargv_main__sigfdie__sigidie__sigqdie__sigindie__sigtdie__sigdie_s_rnge_abort__getarg__iargc__getenv__signal__s_stop_s_paus_system__pow_ci_pow_dd_pow_di_pow_hh_pow_ii_pow_ri_pow_zi_pow_zz_c_abs_c_cos_c_div_c_exp_c_log_c_sin_c_sqrt_z_abs_z_cos_z_div_z_exp_z_log_z_sin_z_sqrt_r_abs_r_acos_r_asin_r_atan_r_atn2_r_cnjg_r_cos_r_cosh_r_dim_r_exp_r_imag_r_int_r_lg10_r_log_r_mod_r_nint_r_sign_r_sin_r_sinh_r_sqrt_r_tan_r_tanh_srand__rand__d_abs_d_acos_d_asin_d_atan_d_atn2_d_cnjg_d_cos_d_cosh_d_dim_d_exp_d_imag_d_int_d_lg10_d_log_d_mod_d_nint_d_prod_d_sign_d_sin_d_sinh_d_sqrt_d_tan_d_tanh_i_abs_i_dim_i_dnnt_i_indx_i_len_i_mod_i_nint_i_sign_h_abs_h_dim_h_dnnt_h_indx_h_len_h_mod_h_nint_h_sign_l_ge_l_gt_l_le_l_lt_hl_ge_hl_gt_hl_le_hl_lt_ef1asc__ef1cmc__s_cat_s_cmp_s_copy_cabs_tanh_sinh_cosh_f_back_s_rdfe_c_dfe_y_getc_y_err_y_rsk_s_wdfe_y_putc_y_rev_e_rdfe_e_wdfe_s_rdue_c_due_s_wdue_e_rdue_e_wdue_icptr_icend_svic_icnum_icpos_z_getc_z_putc_z_rnew_s_rsfi_c_si_y_ierr_s_wsfi_z_wnew_e_rsfi_e_wsfi_f_inqu_setcilist_setolist_stcllist_setalist_f_rew_s_rsfe_x_getc_x_endp_xrd_SL_x_rev_rd_ed_rd_I_rd_L_rd_A_rd_AW_rd_F_rd_ned_rd_POS_rd_H_recloc_s_rsue_c_sue_s_wsue_e_wsue_e_rsue_reclen_do_us_do_uio_do_ud_s_wsfe_x_putc_xw_end_xw_rev_x_wSL_pr_put_e_rsfe_c_sfe_e_wsfe_syl_parenlvl_pc_revloc_pars_f_f_s_op_gen_f_list_i_tem_ne_d_e_d_gt_num_ap_end_cnt_ret_cp_rp_workdone_nonl_en_fio_do_fio_type_f_fmt_bg_s_wsle_t_putc_l_write_e_wsle_lwrt_I_lwrt_L_lwrt_A_lwrt_F_lwrt_C_lioproc_ltab_l_comma_l_first_t_getc_e_rsle_lquit_lcount_ltype_lchar_lx_ly_l_read_l_R_l_C_l_L_l_CHAR_rd_int_s_rsle_c_le_do_lio_f_open_isdev_fk_open_f_clos_f_exit_flush__g_char_b_char_inode_mvgbt_f_end_t_runc_mv_cur_w_ed_wrt_I_wrt_IM_wrt_L_wrt_A_wrt_AW_wrt_E_wrt_G_wrt_F_w_ned_wrt_AP_wrt_H_units_init_elist_reading_cplus_cblank_fmtbuf_external_doed_doned_doend_donewrec_dorevert_sequential_formatted_getn_putn_cf_curunit_recpos_cursor_scale_F_err_fatal_f_init_canseek_nowreading_nowwriting_icvt_dfe_rdfe_wdfe_s_rdfe_c_dfe_y_getc_y_tab_y_rnew_s_wdfe_y_putc_y_wnew_e_rdfe_e_wdfe_y_rend_y_wend_due_s_rdue_c_due_s_wdue_e_rdue_e_wdue_z_getc_z_putc_z_wnew_z_ungetc_s_rsfi_z_rnew_z_tab_c_si_s_wsfi_s_rdfi_c_di_s_wdfi_c_fi_e_rsfi_e_wsfi_e_rdfi_e_wdfi_c_li_s_rsli_s_wsli_e_rsli_e_wsli_iiorec__iiopos__recloc_rsue_sue_s_rsue_c_sue_s_wsue_e_wsue_e_rsue_s_rsfe_c_sfe_x_getc_x_rnew_x_tab_e_rsfe_new_s_wsfe_pr_put_x_putc_x_wend_x_wnew_e_wsfe_lrd_lchar_lx_ly_ltype_ltab_s_rsle_l_read_t_getc_e_rsle_t_sep_l_R_l_C_l_L_l_CHAR_lr_comm_get_repet_rd_int_s_wsle_t_putc_l_write_e_wsle_lwrt_I_lwrt_F_lwrt_D_lwrt_C_lwrt_DC_lwrt_L_lwrt_A_chk_len_lwrt_0_cnt_ret_cp_rp_dfio_en_fio_do_fio_type_f_fmt_bg_eor_uio_do_us_due_err_do_uio_do_ud_c_le_do_lio_rd_ed_rd_mvcur_rd_I_rd_L_rd_AW_rd_F_rd_ned_rd_POS_rd_H_w_ed_wr_mvcur_wrt_IM_wrt_L_wrt_AW_wrt_E_wrt_G_wrt_F_w_ned_wrt_AP_wrt_H_syl_parenlvl_pc_revloc_pars_f_f_s_op_gen_f_list_i_tem_ne_d_e_d_gt_num_ap_end__digit_icvt_bksp_f_back_f_rew_f_open_isdev_fk_open_f_clos_f_exit_flush__endf_f_end_t_runc_f_inqu_allocs_allocp_alloct_allocx_malloc_free_calloc_realloc_tmplate_fortfile_units_reading_external_sequential_formatted_fmtbuf_icptr_icend_fmtptr_doed_doned_doend_donewrec_dorevert_dotab_lioproc_getn_putn_ungetn_svic_cf_curunit_lunit_lfname_recpos_recnum_reclen_cursor_scale_radix_signit_tab_cplus_cblank_elist_errflag_endflag_lquit_l_first_leof_lcount_line_len_fatal_prnt_fmt_prnt_ext_prnt_int_ffputc_f_init_ini_std_canseek_finode_nowreading_nowwriting_g_char_b_char_inode_last_char_f_errlist_f_nerr_sccs_id_init66__no_66__box_wclear_initscr_endwin_mvprintw_mvwprintw_mvscanw_mvwscanw_mvwin_newwin_subwin_overlay_overwrite_printw__sprintw_wprintw_scanw__sscans_wscanw__win_wrefresh_touchwin_werase_wclrtobot_wclrtoeol__win_mvcur_fgoto_plod__putchar_plodput_putpad_ospeed_gettmode_setterm_zap_getcap_longname_delwin_winsertln_wdeleteln_scroll_wgetstr_wgetch_waddstr_waddch_wmove__echoit__rawmode_My_term__endwin_ttytype_Def_term__tty_ch_LINES_COLS__res_flg_stdscr_curscr__tty_AM_BS_CA_DA_DB_EO_GT_HZ_IN_MI_MS_NC_OS_UL_XN_NONL_UPPERCASE_normtty__pfast_AL_BC_BT_CD_CE_CL_CM_DC_DL_DM_DO_ED_EI_HO_IC_IM_IP_LL_MA_ND_SE_SF_SO_SR_TA_TE_TI_UC_UE_UP_US_VB_VE_VS_PC__unctrl_wstandout_wstandend_tstp_winsch_wdelch_getwd_prexit_cat_getwd_prexit_cat_killpg_killpg_setpgrp_getpgrp_setpgrp_getpgrp_sigsys_sigpeel_sigsys_sigpeel_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_wait3_wait3_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_sigsys_sigpeel_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_sigsys_sigpeel_allprint_printable_sprint_main_yyreject_yyracc_yyless_yywrapallprint.o 363529236 0 27 100664 566 ` lxPPRP EP +P KP~PE~{vPРQ֠aaPn~cЬP֬`~KѬ ѬPP\n\t\b\b\%-3o .4 ; BH O W_go w   $-6>BF_allprintL18_printable_yyout_fprintf__flsbuf_sprintL41L47main.o 363529240 0 27 100664 143 ` 0   _mainL18_yylex_exit reject.o 363529247 0 27 100664 1111 ` p&QRPBapPP iPPQA`~zP@rldPР[SKPC`"2P+P"P PЬQA`2J=P@~ά~PݠPPQA`PQA`ЬP    & , 1 9 A I P X c j v |                  # + 3 = H S Z c i p #+2:AKT\hrv_yyrejectL21_yyinput_yytext_yyleng_yylsp_yyolsp_yyfnd_yylstate_yyunput_yyracc_yyprevious_yyoutputL44_yyextra_yyback yyless.o 363529250 0 27 100664 325 ` `HH [լѬ ZЬZ {~[ZkZ{ÏZPP   ! 4 B K Q Z    )5_yylessL12_yyleng_yytext_yyunput_yyprevious yywrap.o 363529254 0 27 100664 80 ` ((P _yywrapL12 363529250 0 27 100664 325 ` `HH [լѬ ZЬZ {~[ZkZ{ÏZPP   ! 4 B K Q Z    )5_yylessL12_yyleng_yytext_yyunput_yyprevious yywrap.o 363529254 0 27 100664 80 ` lib/libm.a 644 0 33 57436 2552606123 5726 ! __.SYMDEF 363531352 0 27 100664 7246 ` @#)</<6$=$CF&JF&NF&RZ*YZ*]Z*a2h2l2p;w;|===RCRCRCFFJJ0M0MP@R@RUUUpZpZ]]_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_del_step_arc_quad_abs_box_circle_closevt_closepl_dot_erase_lbl_mv_lbl_umv_label_line_linemod_move_openvt_openpl_point_scale_space_obotx_oboty_botx_boty_scalex_scaley_scaleflag_oloy_ohiy_ohix_oextra_cont_putch_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_xargc_xargv_main__sigfdie__sigidie__sigqdie__sigindie__sigtdie__sigdie_s_rnge_abort__getarg__iargc__getenv__signal__s_stop_s_paus_system__pow_ci_pow_dd_pow_di_pow_hh_pow_ii_pow_ri_pow_zi_pow_zz_c_abs_c_cos_c_div_c_exp_c_log_c_sin_c_sqrt_z_abs_z_cos_z_div_z_exp_z_log_z_sin_z_sqrt_r_abs_r_acos_r_asin_r_atan_r_atn2_r_cnjg_r_cos_r_cosh_r_dim_r_exp_r_imag_r_int_r_lg10_r_log_r_mod_r_nint_r_sign_r_sin_r_sinh_r_sqrt_r_tan_r_tanh_srand__rand__d_abs_d_acos_d_asin_d_atan_d_atn2_d_cnjg_d_cos_d_cosh_d_dim_d_exp_d_imag_d_int_d_lg10_d_log_d_mod_d_nint_d_prod_d_sign_d_sin_d_sinh_d_sqrt_d_tan_d_tanh_i_abs_i_dim_i_dnnt_i_indx_i_len_i_mod_i_nint_i_sign_h_abs_h_dim_h_dnnt_h_indx_h_len_h_mod_h_nint_h_sign_l_ge_l_gt_l_le_l_lt_hl_ge_hl_gt_hl_le_hl_lt_ef1asc__ef1cmc__s_cat_s_cmp_s_copy_cabs_tanh_sinh_cosh_f_back_s_rdfe_c_dfe_y_getc_y_err_y_rsk_s_wdfe_y_putc_y_rev_e_rdfe_e_wdfe_s_rdue_c_due_s_wdue_e_rdue_e_wdue_icptr_icend_svic_icnum_icpos_z_getc_z_putc_z_rnew_s_rsfi_c_si_y_ierr_s_wsfi_z_wnew_e_rsfi_e_wsfi_f_inqu_setcilist_setolist_stcllist_setalist_f_rew_s_rsfe_x_getc_x_endp_xrd_SL_x_rev_rd_ed_rd_I_rd_L_rd_A_rd_AW_rd_F_rd_ned_rd_POS_rd_H_recloc_s_rsue_c_sue_s_wsue_e_wsue_e_rsue_reclen_do_us_do_uio_do_ud_s_wsfe_x_putc_xw_end_xw_rev_x_wSL_pr_put_e_rsfe_c_sfe_e_wsfe_syl_parenlvl_pc_revloc_pars_f_f_s_op_gen_f_list_i_tem_ne_d_e_d_gt_num_ap_end_cnt_ret_cp_rp_workdone_nonl_en_fio_do_fio_type_f_fmt_bg_s_wsle_t_putc_l_write_e_wsle_lwrt_I_lwrt_L_lwrt_A_lwrt_F_lwrt_C_lioproc_ltab_l_comma_l_first_t_getc_e_rsle_lquit_lcount_ltype_lchar_lx_ly_l_read_l_R_l_C_l_L_l_CHAR_rd_int_s_rsle_c_le_do_lio_f_open_isdev_fk_open_f_clos_f_exit_flush__g_char_b_char_inode_mvgbt_f_end_t_runc_mv_cur_w_ed_wrt_I_wrt_IM_wrt_L_wrt_A_wrt_AW_wrt_E_wrt_G_wrt_F_w_ned_wrt_AP_wrt_H_units_init_elist_reading_cplus_cblank_fmtbuf_external_doed_doned_doend_donewrec_dorevert_sequential_formatted_getn_putn_cf_curunit_recpos_cursor_scale_F_err_fatal_f_init_canseek_nowreading_nowwriting_icvt_dfe_rdfe_wdfe_s_rdfe_c_dfe_y_getc_y_tab_y_rnew_s_wdfe_y_putc_y_wnew_e_rdfe_e_wdfe_y_rend_y_wend_due_s_rdue_c_due_s_wdue_e_rdue_e_wdue_z_getc_z_putc_z_wnew_z_ungetc_s_rsfi_z_rnew_z_tab_c_si_s_wsfi_s_rdfi_c_di_s_wdfi_c_fi_e_rsfi_e_wsfi_e_rdfi_e_wdfi_c_li_s_rsli_s_wsli_e_rsli_e_wsli_iiorec__iiopos__recloc_rsue_sue_s_rsue_c_sue_s_wsue_e_wsue_e_rsue_s_rsfe_c_sfe_x_getc_x_rnew_x_tab_e_rsfe_new_s_wsfe_pr_put_x_putc_x_wend_x_wnew_e_wsfe_lrd_lchar_lx_ly_ltype_ltab_s_rsle_l_read_t_getc_e_rsle_t_sep_l_R_l_C_l_L_l_CHAR_lr_comm_get_repet_rd_int_s_wsle_t_putc_l_write_e_wsle_lwrt_I_lwrt_F_lwrt_D_lwrt_C_lwrt_DC_lwrt_L_lwrt_A_chk_len_lwrt_0_cnt_ret_cp_rp_dfio_en_fio_do_fio_type_f_fmt_bg_eor_uio_do_us_due_err_do_uio_do_ud_c_le_do_lio_rd_ed_rd_mvcur_rd_I_rd_L_rd_AW_rd_F_rd_ned_rd_POS_rd_H_w_ed_wr_mvcur_wrt_IM_wrt_L_wrt_AW_wrt_E_wrt_G_wrt_F_w_ned_wrt_AP_wrt_H_syl_parenlvl_pc_revloc_pars_f_f_s_op_gen_f_list_i_tem_ne_d_e_d_gt_num_ap_end__digit_icvt_bksp_f_back_f_rew_f_open_isdev_fk_open_f_clos_f_exit_flush__endf_f_end_t_runc_f_inqu_allocs_allocp_alloct_allocx_malloc_free_calloc_realloc_tmplate_fortfile_units_reading_external_sequential_formatted_fmtbuf_icptr_icend_fmtptr_doed_doned_doend_donewrec_dorevert_dotab_lioproc_getn_putn_ungetn_svic_cf_curunit_lunit_lfname_recpos_recnum_reclen_cursor_scale_radix_signit_tab_cplus_cblank_elist_errflag_endflag_lquit_l_first_leof_lcount_line_len_fatal_prnt_fmt_prnt_ext_prnt_int_ffputc_f_init_ini_std_canseek_finode_nowreading_nowwriting_g_char_b_char_inode_last_char_f_errlist_f_nerr_sccs_id_init66__no_66__box_wclear_initscr_endwin_mvprintw_mvwprintw_mvscanw_mvwscanw_mvwin_newwin_subwin_overlay_overwrite_printw__sprintw_wprintw_scanw__sscans_wscanw__win_wrefresh_touchwin_werase_wclrtobot_wclrtoeol__win_mvcur_fgoto_plod__putchar_plodput_putpad_ospeed_gettmode_setterm_zap_getcap_longname_delwin_winsertln_wdeleteln_scroll_wgetstr_wgetch_waddstr_waddch_wmove__echoit__rawmode_My_term__endwin_ttytype_Def_term__tty_ch_LINES_COLS__res_flg_stdscr_curscr__tty_AM_BS_CA_DA_DB_EO_GT_HZ_IN_MI_MS_NC_OS_UL_XN_NONL_UPPERCASE_normtty__pfast_AL_BC_BT_CD_CE_CL_CM_DC_DL_DM_DO_ED_EI_HO_IC_IM_IP_LL_MA_ND_SE_SF_SO_SR_TA_TE_TI_UC_UE_UP_US_VB_VE_VS_PC__unctrl_wstandout_wstandend_tstp_winsch_wdelch_getwd_prexit_cat_getwd_prexit_cat_killpg_killpg_setpgrp_getpgrp_setpgrp_getpgrp_sigsys_sigpeel_sigsys_sigpeel_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_wait3_wait3_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_sigsys_sigpeel_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_sigsys_sigpeel_allprint_printable_sprint_main_yyreject_yyracc_yyless_yywrap_allprint_printable_sprint_main_yyreject_yyracc_yyless_yywrap_errno_asin_acos_atan_atan2_hypot_cabs_errno_jn_yn_errno_j0_y0_errno_j1_y1_errno_pow_errno_signgam_gamma_errno_log_log10_cos_sin_errno_sqrt_errno_tan_tanh_sinh_cosh_errno_erf_erfc_errno_exp_floor_ceilasin.o 363529269 0 27 100664 621 ` X`^pq rpq!pPePcP~pPqgP~pPcP]g~xpPeP^qs qq!LpjPp~9pPcPP@!h@@@3@333333@(1 7FN Zh s   !'-1_errno_pio2_asinL16_sqrt_atan_acosL32 atan.o 363529276 0 27 100664 1329 ` (q& p~r~rPP^a PqPqpPrPq Nq%rPg P~apPaOJPbPg ~?r1Rb*R`RPqg ~rPg P~rPP^q p~NqgS~3pPcPPc@Pa?RgRP~ `P^eeP`PdP`PdP`PdPaPaPdP`~PdP`{PdP`xPdP`uPfPePAy1?ϒy@!hI@!hB:IvDv6T1E r OER `EM2 fkCӴLE\QEYWF\*~`EM2 f@@@=EMWas} %39PWbmx "&*.26:> B(FLPW(((^bfj@q_sq2p1_sq2m1_pio2_pio4_p4_p3_p2_p1_p0_q4_q3_q2_q1_q0_atanL26_satan_atan2L34L47L57_xatan hypot.o 363529280 0 27 100664 351 ` (<8^qwrq pr q pp p q SpSPf ePaHP~pPeP Pp ~p~@ =EXa } p_hypotL13_sqrt_cabsL27 jn.o 363529286 0 27 100664 983 `  Xl4^լ άrլ p~Ѭ p~qpPnPqP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)A$` sX\nRı=XsSûHS-QªqOQoi=HJ SOE0s@[^2Lڄ)vJ8a{Żs[^2,cC 6EMU`@H:՞xHLhHkAWWG|QEL_ CA?/u-JM)JVWJ%FY[2ItB.bH:rWE؀@ʞvCRe {p>7X`i-Ƈ̂. CYYSOZ'7nܜXP0$˾)Ug;99;d SE `! [R\h?][aX\{ToEOɌVJ EW@B@AB@A@CB*05G V bj r{   *05G V bj r{ "*2L\pv~ $((,p048<P@DHLTY^dhlpu_errno_pzero_qzero_tpi_pio4_p1_q1_p2_q2_p3_q3_p4_q4_j1L54_asympt_cos_sin_sqrt_y1L71L87_log pow.o 363529307 0 27 100664 390 ` (<P^qWqq _pPj nPqP Hr~pPeP ~pPrPpPp~pPeP ~!wp%P %A Q m }  _errno_powL15_log_expgamma.o 363529316 0 27 100664 1421 ` L jq p~q p~p~pP~^ePgPRpRЭPeRaR@h׭խp~gpPc!PdPbP`(PgR`RP^re~&pPqP!pPqrp~!pPePPdPgP~rPP ^qa~fPq"c~pPczPdPc|pzpz["ePaKfPePaKP[[gPk@?%CIA!h>%6` _gP; {a[;E}ֻ<%Ȱq#ǹ-qG?A@+>OYi  !,7H PX`hp x$(,0590@ EIMS_twoopi_p0_p1_p2_p3_p4_q0_q1_q2_q3_cosL22_sinus_sinL30L34_modf sqrt.o 363529337 0 27 100664 532 ` X0h^qq!pP߭p~pP d׭q d׭aPeP d<ѭ<f<ѭխPxPPnPPdPέPPxPPnPPf((PԭgP`PeP]pP@AA@@OO@  "2 >KWdlv _errno_sqrtL14_frexptan.o 363529343 0 27 100664 897 ` 40^ԭpnql rpgd߭p~pPjPxPPPPPeeP`PdP`PdP`PdP`PePeP`PdP`PdP`PfPѭ_qK"!q2pPc1^rcr1EpPgeP@NnDL0ւEyV+x > >0yf9 j6F̍ـX(@@@@@ !)9 kr}  ' 4<DLT"\&d*l.t27;A_errno_invpi_p0_p1_p2_p3_p4_q0_q1_q2_tanL51_modf tanh.o 363529346 0 27 100664 278 ` \ 00^pQqO rpJqHpPp~pPp~pPePfP@B(: I  _tanhL14_sinh_coshsinh.o 363529350 0 27 100664 849 ` 8 ^[q`r[[qV"p~gKP[pPrPq:/r~pPp~cPn[PdPfPeeP`PdP`PdP`PePaPdP`PdP`PfPn[PdP^qrqp~fPr~pPp~`Pf}P%yگ\.0k4aѶoqB;%ymGt -ϭBA@ABAA + 1JW f y  % /8@ HPX`h &*/59_p0_p1_p2_p3_q0_q1_q2_sinhL20_exp_coshL34 erf.o 363529355 0 27 100664 1125 ` `p(^qQ rqFaep?p?'ЭPeRaR@ eRaR@5׭խnPdPdPdPfPq nPdPp~pPnPcRdRP^1qr~pPcPPqpPpp'ЭPeRaR@eRaR@׭խrPeP~dPfP@nj۝HyF`_HnH __.SYMDEF 363531356 0 27 100664 7420 ` @ @2 2 #%@'+@'2@'9@'@-F-M-S-Z-_-e-k-r-y-4448888>>>>>>>>_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_del_step_arc_quad_abs_box_circle_closevt_closepl_dot_erase_lbl_mv_lbl_umv_label_line_linemod_move_openvt_openpl_point_scale_space_obotx_oboty_botx_boty_scalex_scaley_scaleflag_oloy_ohiy_ohix_oextra_cont_putch_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_xargc_xargv_main__sigfdie__sigidie__sigqdie__sigindie__sigtdie__sigdie_s_rnge_abort__getarg__iargc__getenv__signal__s_stop_s_paus_system__pow_ci_pow_dd_pow_di_pow_hh_pow_ii_pow_ri_pow_zi_pow_zz_c_abs_c_cos_c_div_c_exp_c_log_c_sin_c_sqrt_z_abs_z_cos_z_div_z_exp_z_log_z_sin_z_sqrt_r_abs_r_acos_r_asin_r_atan_r_atn2_r_cnjg_r_cos_r_cosh_r_dim_r_exp_r_imag_r_int_r_lg10_r_log_r_mod_r_nint_r_sign_r_sin_r_sinh_r_sqrt_r_tan_r_tanh_srand__rand__d_abs_d_acos_d_asin_d_atan_d_atn2_d_cnjg_d_cos_d_cosh_d_dim_d_exp_d_imag_d_int_d_lg10_d_log_d_mod_d_nint_d_prod_d_sign_d_sin_d_sinh_d_sqrt_d_tan_d_tanh_i_abs_i_dim_i_dnnt_i_indx_i_len_i_mod_i_nint_i_sign_h_abs_h_dim_h_dnnt_h_indx_h_len_h_mod_h_nint_h_sign_l_ge_l_gt_l_le_l_lt_hl_ge_hl_gt_hl_le_hl_lt_ef1asc__ef1cmc__s_cat_s_cmp_s_copy_cabs_tanh_sinh_cosh_f_back_s_rdfe_c_dfe_y_getc_y_err_y_rsk_s_wdfe_y_putc_y_rev_e_rdfe_e_wdfe_s_rdue_c_due_s_wdue_e_rdue_e_wdue_icptr_icend_svic_icnum_icpos_z_getc_z_putc_z_rnew_s_rsfi_c_si_y_ierr_s_wsfi_z_wnew_e_rsfi_e_wsfi_f_inqu_setcilist_setolist_stcllist_setalist_f_rew_s_rsfe_x_getc_x_endp_xrd_SL_x_rev_rd_ed_rd_I_rd_L_rd_A_rd_AW_rd_F_rd_ned_rd_POS_rd_H_recloc_s_rsue_c_sue_s_wsue_e_wsue_e_rsue_reclen_do_us_do_uio_do_ud_s_wsfe_x_putc_xw_end_xw_rev_x_wSL_pr_put_e_rsfe_c_sfe_e_wsfe_syl_parenlvl_pc_revloc_pars_f_f_s_op_gen_f_list_i_tem_ne_d_e_d_gt_num_ap_end_cnt_ret_cp_rp_workdone_nonl_en_fio_do_fio_type_f_fmt_bg_s_wsle_t_putc_l_write_e_wsle_lwrt_I_lwrt_L_lwrt_A_lwrt_F_lwrt_C_lioproc_ltab_l_comma_l_first_t_getc_e_rsle_lquit_lcount_ltype_lchar_lx_ly_l_read_l_R_l_C_l_L_l_CHAR_rd_int_s_rsle_c_le_do_lio_f_open_isdev_fk_open_f_clos_f_exit_flush__g_char_b_char_inode_mvgbt_f_end_t_runc_mv_cur_w_ed_wrt_I_wrt_IM_wrt_L_wrt_A_wrt_AW_wrt_E_wrt_G_wrt_F_w_ned_wrt_AP_wrt_H_units_init_elist_reading_cplus_cblank_fmtbuf_external_doed_doned_doend_donewrec_dorevert_sequential_formatted_getn_putn_cf_curunit_recpos_cursor_scale_F_err_fatal_f_init_canseek_nowreading_nowwriting_icvt_dfe_rdfe_wdfe_s_rdfe_c_dfe_y_getc_y_tab_y_rnew_s_wdfe_y_putc_y_wnew_e_rdfe_e_wdfe_y_rend_y_wend_due_s_rdue_c_due_s_wdue_e_rdue_e_wdue_z_getc_z_putc_z_wnew_z_ungetc_s_rsfi_z_rnew_z_tab_c_si_s_wsfi_s_rdfi_c_di_s_wdfi_c_fi_e_rsfi_e_wsfi_e_rdfi_e_wdfi_c_li_s_rsli_s_wsli_e_rsli_e_wsli_iiorec__iiopos__recloc_rsue_sue_s_rsue_c_sue_s_wsue_e_wsue_e_rsue_s_rsfe_c_sfe_x_getc_x_rnew_x_tab_e_rsfe_new_s_wsfe_pr_put_x_putc_x_wend_x_wnew_e_wsfe_lrd_lchar_lx_ly_ltype_ltab_s_rsle_l_read_t_getc_e_rsle_t_sep_l_R_l_C_l_L_l_CHAR_lr_comm_get_repet_rd_int_s_wsle_t_putc_l_write_e_wsle_lwrt_I_lwrt_F_lwrt_D_lwrt_C_lwrt_DC_lwrt_L_lwrt_A_chk_len_lwrt_0_cnt_ret_cp_((rp_dfio_en_fio_do_fio_type_f_fmt_bg_eor_uio_do_us_due_err_do_uio_do_ud_c_le_do_lio_rd_ed_rd_mvcur_rd_I_rd_L_rd_AW_rd_F_rd_ned_rd_POS_rd_H_w_ed_wr_mvcur_wrt_IM_wrt_L_wrt_AW_wrt_E_wrt_G_wrt_F_w_ned_wrt_AP_wrt_H_syl_parenlvl_pc_revloc_pars_f_f_s_op_gen_f_list_i_tem_ne_d_e_d_gt_num_ap_end__digit_icvt_bksp_f_back_f_rew_f_open_isdev_fk_open_f_clos_f_exit_flush__endf_f_end_t_runc_f_inqu_allocs_allocp_alloct_allocx_malloc_free_calloc_realloc_tmplate_fortfile_units_reading_external_sequential_formatted_fmtbuf_icptr_icend_fmtptr_doed_doned_doend_donewrec_dorevert_dotab_lioproc_getn_putn_ungetn_svic_cf_curunit_lunit_lfname_recpos_recnum_reclen_cursor_scale_radix_signit_tab_cplus_cblank_elist_errflag_endflag_lquit_l_first_leof_lcount_line_len_fatal_prnt_fmt_prnt_ext_prnt_int_ffputc_f_init_ini_std_canseek_finode_nowreading_nowwriting_g_char_b_char_inode_last_char_f_errlist_f_nerr_sccs_id_init66__no_66__box_wclear_initscr_endwin_mvprintw_mvwprintw_mvscanw_mvwscanw_mvwin_newwin_subwin_overlay_overwrite_printw__sprintw_wprintw_scanw__sscans_wscanw__win_wrefresh_touchwin_werase_wclrtobot_wclrtoeol__win_mvcur_fgoto_plod__putchar_plodput_putpad_ospeed_gettmode_setterm_zap_getcap_longname_delwin_winsertln_wdeleteln_scroll_wgetstr_wgetch_waddstr_waddch_wmove__echoit__rawmode_My_term__endwin_ttytype_Def_term__tty_ch_LINES_COLS__res_flg_stdscr_curscr__tty_AM_BS_CA_DA_DB_EO_GT_HZ_IN_MI_MS_NC_OS_UL_XN_NONL_UPPERCASE_normtty__pfast_AL_BC_BT_CD_CE_CL_CM_DC_DL_DM_DO_ED_EI_HO_IC_IM_IP_LL_MA_ND_SE_SF_SO_SR_TA_TE_TI_UC_UE_UP_US_VB_VE_VS_PC__unctrl_wstandout_wstandend_tstp_winsch_wdelch_getwd_prexit_cat_getwd_prexit_cat_killpg_killpg_setpgrp_getpgrp_setpgrp_getpgrp_sigsys_sigpeel_sigsys_sigpeel_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_wait3_wait3_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_sigsys_sigpeel_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_sigsys_sigpeel_allprint_printable_sprint_main_yyreject_yyracc_yyless_yywrap_allprint_printable_sprint_main_yyreject_yyracc_yyless_yywrap_errno_asin_acos_atan_atan2_hypot_cabs_errno_jn_yn_errno_j0_y0_errno_j1_y1_errno_pow_errno_signgam_gamma_errno_log_log10_cos_sin_errno_sqrt_errno_tan_tanh_sinh_cosh_errno_erf_erfc_errno_exp_floor_ceil_pow_rpow_gcd_invert_msqrt_mdiv_m_div_m_dsb_m_trq_m_in_m_out_sdiv_s_div_min_omin_mout_omout_fmout_fmin_mult_m_mult_tradd_m_add_madd_msub_m_sub_move_xfree_xalloc_dummy_fatal_mcan_itom_mcmppow.o 363529389 0 27 100664 694 ` l`^ԭЭݬKЬQPЬPԭyíPPЬQPPP2`ԭ߭ݬݬݬ߭ݬ ߭xPPP#߭ݬݬgݬ߭ݬ ߭T֭ѭ֭ѭ߭7߭-^PżPPoݭPԭ ЭP@֭ѭP@ݬ ݬ ߭߭ݬ߭߭powrpowrpow2 & e x        = PZ d   "(.2_powL14_xfree_xalloc_mult_mdiv_rpowL30gcd.o 363529395 0 27 100664 886 `  ^ԭЭЭЭ߭ݬ߭ݬխ6ݬ ߭߭߭߭߭߭߭߭߭߭߭t߭߭4^ԭԭЭЭЭЭЭ@P߭ݬ+߭ݬj߭߭߭߭ ֭߭߭߭߭߭߭߭߭߭߭߭߭߭߭խݬ ߭ݬ ݬ ݬ߭߭x߭n߭d߭Z߭P  - ? I S ] g {         - : G \ p z         (,4:@F_gcdL14_move_xfree_mdiv_invertL24_xalloc_mult_madd_msubmsqrt.o 363529400 0 27 100664 799 ` x^ԭЭЭռ [ռ ԼԼ PPPPPPP PP PP'ݭPԭ ЭP@֭ѭPPPPPPP@ P@ݬGݬ =߭߭߭ݬ*߭ ߭߭߭߭߭߭߭߭P߭߭߭߭߭ݬ߭߭߭߭ݬ ߭ݬ߭м Pmsqrt: neg argmsqrt  \f         & 5 B R b l  %+17=CIO_msqrtL14_fatal_xalloc_xfree_mdiv_madd_sdiv_mcmp_move_mult_msub mdiv.o 363529409 0 27 100664 1541 ` ,^ЬPРЬPРм έм έέݬ ݬݬݬ ߭߭7ѭ μ μPP^Ьԭԭ9ЭP2@ PĭPPPЭQ2AQQPPЭQPAx֭ѭЭP2@PPPЭQPAxPPԭԭ7ЭPPQ2@ P2AQQPPԭPЭQPA֭ѭP^Ѭ 2x PPǬPx PPŭQQPxPPŭQQPЭP<^ԭЭЭЭռ<=ѼZ<'ЬQPЬPݠݬ ЬPРP2`~ݬЬPРP`ЬPݠԼѼQԼ мݼЬQPԭ$ЭPЬQPPPЭQЬRQQQ`a֭ѭԼޭޭмPЬQPPP2`PPPPP߭߭ݬE߭߭ݬ5P2@P2@3íмPP~PíмeЭPP2@~ЭPP2@~ЭP2@~ݭݭ PxPP~ݭݭݭ&P׭ЭP@׭խЭЭЭ߭}߭߭2~߭iЭЬPЭЬ PЭؠíмPPP@׭ЭԼ խ ݭ#խ ߭߭ mdiv divide by zerom_div1m_div2m_div3B L _    5?    4R      |#'B.26=EKQW]_mdivL14_xfree_m_div_m_dsbL24_m_trqL38L48_fatal_xalloc_sdiv_free_mult_mcan mout.o 363529423 0 27 100664 1816 ` t$^ݬޭޭԭޭܭ׼ Ь PРQ֠aP ݬ PP1ЭPP 2P -P P-5P\3׼  Ь P֠ݬ pĭ߭_Pέѭ0?ѭ990PPݬ߭߭0ݬ߭ݬ ߭ݬ1= ݭĭP^м έխtݬ ЭaݭPԭЭPЬQPPPЭQ`A֭ѭ~yPPPP[k[խ@ѭ-k[[~ݬ <ݭ2խ ݭ#ԭԭխ(߭߭ݬ߭ 2P0PPk[֭ѭ խ k1~^мЬPРլ έάխ έέݬ߭ݬ߭(ݬ Ь PЭŭ 2PĭPP^ԭмݭWP<ЭPЬQPPPxQ2`PQPǬPЭQPAǬPĬPP׭խP@׭Э Ь PЭխ ݭ ݬݬ ݬݬݬ ݬ{ݬ ݬ]0 m_out%s s_div  H        ,6 BL     `j  " , 8B NX dn z $*06> EIRZbhnry}(>Tj_m_inL20_xfree__filbuf_mult_madd_move__iob_ungetc_m_outL42_fprintf_xalloc_malloc_free_sdivL66_s_divL73_minL84_ominL89_moutL94_omoutL99_fmoutL104_fminL109mult.o 363529433 0 27 100664 978 ` l@^ЬPРЬPРԭռ μέмռ μέмѭ ߭߭߭ ߭߭߭6ݬ խέ Э ռ  ݭj Ь PЭ^~FЬ QPԭԭuЭPЬQPPP2`íPЬQPPPЭQ2`PPQݭ֭߭߭PѭPPЭQЬ RQQQPax֭ѭ}ԭԭЭPЬQPPP2`íPЬQPPPЭQ2`PPQݭ߭߭ ֭PѭPPЭQЬ RQQQPax֭ѭ1ԭüPPԭüPPPCЭPЬQPPP2`íPЬQPPPЭQ2`PPQݭ߭߭j֭ѭPЭQЬ RQQQPax֭PѭP1oPЬ QPPP`PPPP  ЬP2PPЬPPЬQPּm_multhr   * #'/6:_multL14_m_mult_xfree_freeL31_xalloc_traddL57madd.o 363529454 0 27 100664 1431 ` $ ^~PԭԭԭЭP@֭ѭ1ЭPЬQPPP2`PPЭQЬRQQQ2aQQPPЭQPAЭPЬQPPP2`PPPЭQPA ԭЭP@((ѭѭЭP@ м Ь PЭռ  ݭ^мЬPРмЬPРԭխ9խ$ѭ߭߭߭U߭߭߭έ߭߭߭3խ έέ߭߭߭wέ߭߭߭ݬ XЬ PЭŭPP ^ޭVݼ"Ь QPԭԭԭЭPЬ QPPP`֭ѭ1ЭPЬQPPP2`PPЭQЬRQQQ2aQQPPЭQЬ RQQQPaЭPЬQPPP2`PPPЭQЬ RQQQPaԭЭPЬ QPPP`֭ѭխ8ԭЭPЬ QPPP`֭ѭм ݬ ߭ݬ  -ЭPЬ QPPP`խPέPPP ׭խЬ Pݠ^ммЬPРЬPРԭխ[խ?ѭ߭߭߭5[έέ߭߭߭5έ߭߭߭:խέ߭߭߭Ѭ  խݬѬ  խݬݬ Ь PЭŭPP m_addm_sub  C  9    #'>-4;?C_m_addL14_xalloc_free_maddL34_msub_xfree_m_subL49L74 util.o 363529464 0 27 100664 1226 ` , ^ݬммέPPխݭ=ЬQPԭ$ЭPЬQPPPЭQЬRQQQ`a֭ѭ^xPP~uPPPݬ|kDN7.'ռЬPݠԼ^мխέPPЭPЬQPPP`׭խѭխ ݬռЭέPP^PլRЭQPЭP'ЭQPάPЭQPЭPլԽ ^ѼüPԭ߭ݬݬЭ߭ЭPmovemp: no free space%s itomitom1itom2 +5    Den  vr$(,4;?ENV]dhntx^~_moveL21_xfree_xalloc_dummyL33L37_malloc_fatalL44__iob_fprintf_fflush_sleep_abortL53_free_mcanL60_itomL73_mcmpL83_msub Denlib/units 644 0 33 20714 2406261603 5711 / dimensions m *a* kg *b* sec *c* coul *d* candela *e* dollar *f* radian *g* bit *h* erlang *i* degC *j* / constants fuzz 1 pi 3.14159265358979323846 c 2.997925+8 m/sec fuzz g 9.80665 m/sec2 au 1.49597871+11 m fuzz mole 6.022169+23 fuzz e 1.6021917-19 coul fuzz energy c2 force g mercury 1.33322+5 kg/m2-sec2 hg mercury / dimensionless degree 1|180 pi-radian circle 2 pi-radian turn 2 pi-radian grade .9 degree arcdeg 1 degree arcmin 1|60 arcdeg ccs 1|36 erlang arcsec 1|60 arcmin steradian radian2 sphere 4 pi-steradian sr steradian / Time second sec s sec minute 60 sec min minute hour 60 min hr hour day 24 hr da day week 7 day year 365.24219879 day fuzz yr year month 1|12 year ms millisec us microsec / Mass gram millikg gm gram mg milligram metricton kilokg / Avoirdupois lb .45359237 kg lbf lb g ounce 1|16 lb oz ounce dram 1|16 oz dr dram grain 1|7000 lb gr grain shortton 2000 lb ton shortton longton 2240 lb / Apothecary scruple 20 grain apdram 60 grain apounce 480 grain appound 5760 grain / Length meter m cm centimeter mm millimeter km kilometer nm nanometer micron micrometer angstrom decinanometer inch 2.54 cm in inch foot 12 in feet foot ft foot yard 3 ft yd yard rod 5.5 yd rd rod mile 5280 ft mi mile british 1200|3937 m/ft nmile 1852m acre 4840 yd2 cc cm3 liter kilocc ml milliliter / US Liquid gallon 231 in3 imperial 1.20095 gal gallon quart 1|4 gal qt quart pint 1|2 qt pt pint floz 1|16 pt fldr 1|8 floz / US Dry dry 268.8025 in3/gallon fuzz peck 8 dry-quart pk peck bushel 4 peck bu bushel / British brgallon 277.420 in3 fuzz brquart 1|4 brgallon brpint 1|2 brquart brfloz 1|20 brpint brpeck 554.84 in3 fuzz brbushel 4 brpeck / Energy Work newton kg-m/sec2 nt newton joule nt-m cal 4.1868 joule / Electrical coulomb coul ampere coul/sec amp ampere watt joule/sec volt watt/amp ohm volt/amp mho /ohm farad coul/volt henry sec2/farad weber volt-sec / Light cd candela lumen cd sr lux cd sr/m2 / Money / epoch June 16, 1980 Linns Stamp News / (Wall Stree Journal; Manfra, Tordella and Brookes, Inc.) $ dollar argentinapeso .0056 $ australiadollar 1.1460 $ austriaschilling .0793 $ bahamsdollar 1.0300 $ belgiumfranc .0352 $ belizedollar .5500 $ bermudadollar 1.0300 $ brazilcruzeiro .0201 $ canadadollar .8628 $ chilepeso .0303 $ chinayuan .6780 $ chinadollar .0278 $ colombiapeso .0218 $ cypruspound 2.8500 $ denmarkkrone .1814 $ dominicanrepublicpeso 1.0000 $ eastcarribeandollar .3900 $ equadorsucre .0375 $ egyptpound 2.1910 $ fijidollar 1.3000 $ finlandmarkka .2747 $ francefranc .2422 $ germanymark .5647 $ germanmark germanymark greatbritainpound 2.2970 $ britainpound greatbritainpound greecedrachma .0233 $ honduraslempira .5200 $ hongkongdollar .2040 $ icelandpound .0034 $ indiarupee .1285 $ indonesiarupiah .0016 $ / iranrial ?????? iraqdinar 3.40000 $ irelandpound 2.0860 $ israelshekel .0219 $ italylira .0012 $ jamaicadollar .5950 $ japanyen .0045 $ koreawon .0017 $ lebanonpound .2939 $ malaysiadollar .4635 $ mexicopeso .0439 $ netherlandsguilder .5140 $ newzealanddollar .9870 $ nigerianaira 1.6000 $ norwaykrone .2057 $ pakistanrupee .1015 $ paraguayguarani .0081 $ perusol .0037 $ phillippinespeso .1360 $ polandzloty .0300 $ portugalescudo .0204 $ saudiarabiariyal .3003 $ singaporedollar .4684 $ southafricarand 1.2825 $ southkoreawon koreawon spainpeseta .0143 $ sudanpound 2.1000 $ swedenkrona .2391 $ switzerlandfranc .6064 $ tanzaniashilling .1400 $ thailandbhat .0500 $ trinidaddollar .4300 $ turkeylira .0204 $ uruguaynewpeso .1158 $ ussrruble 1.5600 $ russiaruble ussrruble venezuelabolivar .2329 $ yugoslaviadinar .0600 $ zairezaire 1.2300 $ zambiakwacha 1.3600 $ mark germanymark bolivar venezuelabolivar peseta spainpeseta rand southafricarand escudo portugalescudo sol perusol guilder netherlandsguilder peso mexicopeso yen japanyen lira italylira dinar iraqdinar rupee indiarupee drachma greecedrachma franc francefranc markka finlandmarkka sucre equadorsucre pound britainpound poundsterling britainpound cruzeiro brazilcruzeiro ruble ussrruble / rial iranrial / PDP-11 baud bit/sec byte 8 bit word 2 byte block 512 byte K 1024 word tc 578 block rktrack 12 block rkcylinder 2 rktrack rk 203 rkcylinder rptrack 10 block rpcylinder 20 rptracks rp 406 rpcylinder rftrack 8 block rfshoe 8 rftrack rfdisk 16 rfshoe rf 2 rfdisk / Trivia % 1|100 admiraltyknot 6080 ft/hr apostilb cd/pi-m2 are 1+2 m2 arpentcan 27.52 mi arpentlin 191.835 ft astronomicalunit au atmosphere 1.01325+5 nt/m2 atm atmosphere atomicmassunit 1.66044-27 kg fuzz amu atomicmassunit bag 94 lb bakersdozen 13 bar 1+5 nt/m2 barie 1-1 nt/m2 barleycorn 1|3 in barn 1-28 m2 barrel 42 gal barye 1-1 nt/m2 bev 1+9 e-volt biot 10 amp blondel cd/pi-m2 boardfoot 144 in3 bolt 40 yd bottommeasure 1|40 in britishthermalunit 1.05506+3 joule fuzz btu britishthermalunit refrigeration 12000 btu/ton-hour buck dollar cable 720 ft caliber 1-2 in calorie cal carat 205 mg cent centidollar cental 100 lb centesimalminute 1-2 grade centesimalsecond 1-4 grade century 100 year cfs ft3/sec chain 66 ft circularinch 1|4 pi-in2 circularmil 1-6|4 pi-in2 clusec 1-8 mm-hg m3/s coomb 4 bu cord 128 ft3 cordfoot cord crith 9.06-2 gm cubit 18 in cup 1|2 pt curie 3.7+10 /sec dalton amu decade 10 yr dipotre /m displacementton 35 ft3 doppelzentner 100 kg dozen 12 drop .03 cm3 dyne cm-gm/sec2 electronvolt e-volt ell 45 in engineerschain 100 ft engineerslink 100|100 ft equivalentfootcandle lumen/pi-ft2 equivalentlux lumen/pi-m2 equivalentphot cd/pi-cm2 erg cm2-gm/sec2 ev e-volt faraday 9.652+4 coul fathom 6 ft fermi 1-15 m fifth 4|5 qt fin 5 dollar finger 7|8 in firkin 9 gal footcandle lumen/ft2 footlambert cd/pi-ft2 fortnight 14 da franklin 3.33564-10 coul frigorie kilocal furlong 220 yd galileo 1-2 m/sec2 gamma 1-9 weber/m2 gauss 1-4 weber/m2 geodeticfoot british-ft geographicalmile 1852 m gilbert 7.95775-1 amp gill 1|4 pt gross 144 gunterschain 22 yd hand 4 in hectare 1+4 m2 hefnercandle .92 cd hertz /sec hogshead 2 barrel hd hogshead homestead 1|4 mi2 horsepower 550 ft-lb-g/sec hp horsepower hyl gm force sec2/m hz /sec imaginarycubicfoot 1.4 ft3 jeroboam 4|5 gal karat 1|24 kcal kilocal kcalorie kilocal kev 1+3 e-volt key kg khz 1+3 /sec kilderkin 18 gal knot nmile/hr lambert cd/pi-cm2 langley cal/cm2 last 80 bu league 3 mi lightyear c-yr line 1|12 in link 66|100 ft longhundredweight 112 lb longquarter 28 lb lusec 1-6 mm-hg m3/s mach 331.46 m/sec magnum 2 qt marineleague 3 nmile maxwell 1-8 weber metriccarat 200 mg mev 1+6 e-volt mgd megagal/day mh millihenry mhz 1+6 /sec mil 1-2 in millenium 1000 year minersinch 1.5 ft3/min(( minim 1|60 fldr mo month mpg mile/gal mph mile/hr nail 1|16 yd nauticalmile nmile nit cd/m2 noggin 1|8 qt nox 1-3 lux ns nanosec oersted 2.5+2 pi-amp/m oe oersted pace 36 in palm 3 in parasang 3.5 mi parsec au-radian/arcsec pascal nt/m2 pc parsec pennyweight 1|20 oz percent % perch rd pf picofarad phot lumen/cm2 pica 1|6 in pieze 1+3 nt/m2 pipe 4 barrel point 1|72 in poise gm/cm-sec pole rd poundal ft-lb/sec2 pdl poundal proof 1|200 psi lb-g/in2 quarter 9 in quartersection 1|4 mi2 quintal 100 kg quire 25 rad 100 erg/gm ream 500 registerton 100 ft3 rehoboam 156 floz rhe 10 m2/nt-sec rontgen 2.58-4 curie/kg rood 1.21+3 yd rope 20 ft rutherford 1+6 /sec rydberg 1.36054+1 ev sabin 1 ft2 sack 3 bu seam 8 bu section mi2 shippington 40 ft3 shorthundredweight 100 lb shortquarter 25 lb siemens /ohm sigma microsec skein 120 yd skot 1-3 apostilb slug lb-g-sec2/ft span 9 in spat 4 pi sr spindle 14400 yd square 100 ft2 stere m3 sthene 1+3 nt stilb cd/cm2 stoke 1-4 m2/sec stone 14 lb strike 2 bu surveyfoot british-ft surveyorschain 66 ft surveyorslink 66|100 ft tablespoon 4 fldr teaspoon 4|3 fldr tesla weber/m2 therm 1+5 btu thermie 1+6 cal timberfoot ft3 tnt 4.6+6 m2/sec2 tonne 1+6 gm torr mm hg township 36 mi2 tun 8 barrel water .22491|2.54 kg/m2-sec2 wey 40 bu weymass 252 lb Xunit 1.00202-13m k 1.38047-16 erg/degC span 9 in spat 4 pi sr spindle 14400 yd squarlib/w2006 444 0 33 610510 2111460266 5341 10th 1st 2nd 3rd 4th 5th 6th 7th 8th 9th a A&P a's Aaron ABA Ababa aback abalone abandon abase abash abate abbas abbe abbey abbot Abbott abbreviate abc abdicate abdomen abdominal abduct Abe abed Abel Abelian Abelson Aberdeen Abernathy aberrant aberrate abet abetted abetting abeyance abeyant abhorred abhorrent abide Abidjan Abigail abject ablate ablaze able ablution Abner abnormal Abo aboard abode abolish abolition abominable abominate aboriginal aborigine aborning abort abound about above aboveboard aboveground abovementioned abrade Abraham Abram Abramson abrasion abrasive abreact abreast abridge abridgment abroad abrogate abrupt abscess abscissa abscissae absence absent absentee absenteeism absentia absentminded absinthe absolute absolution absolve absorb absorbent absorption absorptive abstain abstention abstinent abstract abstractor abstruse absurd abuilding abundant abusable abuse abusive abut abutted abutting abysmal abyss Abyssinia AC academia academic academician academy Acadia acanthus Acapulco accede accelerate accelerometer accent accentual accentuate accept acceptant acceptor access accessible accession accessory accident accidental accipiter acclaim acclamation acclimate acclimatize accolade accommodate accompaniment accompanist accompany accomplice accomplish accord accordant accordion accost account accountant accouter Accra accredit accreditate accretion accrual accrue acculturate accumulate accuracy accurate accusation accusative accuse accustom ace acetate acetic acetone acetylene ache achieve Achilles aching achromatic acid acidic acidulous Ackerman Ackley acknowledge acknowledgeable ACM acme acolyte acorn acoustic acquaint acquaintance acquiesce acquiescent acquire acquisition acquisitive acquit acquittal acquitting acre acreage acrid acrobacy acrobat acrobatic acronym acropolis across acrylate acrylic act Actaeon actinic actinide actinium actinolite actinometer activate activation activism Acton actor actress Acts actual actuarial actuate acuity acumen acute acyclic ad Ada adage adagio Adair Adam adamant Adams Adamson adapt adaptation adaptive add added addend addenda addendum addict Addis Addison addition additional additive addle address addressee Addressograph adduce Adelaide Adele Adelia Aden adenoma adept adequacy adequate adhere adherent adhesion adhesive adiabatic adieu adipic Adirondack adjacent adject adjectival adjoin adjoint adjourn adjudge adjudicate adjunct adjust adjutant Adkins Adler administer administrable administrate administratrix admiral admiralty admiration admire admissible admission admit admittance admitted admitting admix admixture admonish admonition ado adobe adolescent Adolph Adolphus Adonis adopt adoption adoptive adore adorn adrenal adrenaline Adrian Adriatic Adrienne adrift adroit adsorb adsorbate adsorption adsorptive adulate adult adulterate adulterous adultery adulthood advance advantage advantageous advent adventitious adventure adventurous adverb adverbial adversary adverse advert advertise advice advisable advise advisee advisor advisory advocacy advocate Aegean aegis Aeneas Aeneid aeolian Aeolus aerate aerial Aerobacter aerobic aerodynamic aerogene aeronautic aerosol aerospace Aeschylus aesthete aesthetic afar affable affair affect affectate affectionate afferent affiance affidavit affiliate affine affinity affirm affirmation affirmative affix afflict affluence affluent afford afforest afforestation affront Afghan Afghanistan aficionado afield afire aflame afloat afoot aforementioned aforesaid aforethought afraid afresh Africa afro aft aftereffect afterglow afterimage afterlife aftermath afternoon afterthought afterward again against Agamemnon agate Agatha agave age Agee agenda agent agglomerate agglutinate agglutinin aggravate aggregate aggression aggressive aggressor aggrieve aghast agile aging agitate agleam Agnes Agnew agnomen agnostic ago agone agony agouti agrarian agree agreeable agreed agreeing Agricola agricultural agriculture agrimony ague Agway ah ahead ahem Ahmadabad ahoy aid Aida aide Aides Aiken ail ailanthus aile aileron aim ain't Ainu air airborne aircraft airdrop airedale Aires airfare airfield airflow airframe airlift airline airlock airmail airman airmass airmen airpark airplane airport airspeed airstrip airtight airway airy aisle Aitken ajar Ajax Akers akin Akron ala Alabama Alabamian alabaster alacrity alai Alameda Alamo alan alarm Alaska alb alba albacore Albania Albanian Albany albatross albeit Alberich Albert Alberta Alberto Albrecht Albright album albumin Albuquerque Alcestis alchemy Alcmena Alcoa alcohol alcoholic alcoholism Alcott alcove Aldebaran aldehyde Alden alder alderman aldermen Aldrich aldrin ale Alec Aleck aleph alert alewife Alex Alexander Alexandra Alexandre Alexandria Alexei Alexis alfalfa alfonso Alfred Alfredo alfresco alga algae algaecide algal algebra algebraic Algenib Alger Algeria Algerian Algiers alginate Algol Algonquin algorithm algorithmic Alhambra alia alias alibi Alice Alicia alien alienate alight align alike alimony aliphatic aliquot Alison Alistair alive alizarin alkali alkaline alkaloid all Allah allay allegate allege Allegheny allegiant allegoric allegory Allegra allegro allele allemand Allen Allentown allergic allergy alleviate alley alleyway alliance allied alligator Allis Allison alliterate allocable allocate allot allotropic allotted allotting allow allowance alloy allspice Allstate allude allure allusion allusive alluvial alluvium ally allyl Allyn alma Almaden almagest almanac almighty almond almost aloe aloft aloha alone along alongside aloof aloud alp alpenstock Alpert alpha alphabet alphabetic alphanumeric Alpheratz Alphonse alpine Alps already Alsatian also Alsop Altair altar alter alterate altercate alterman altern alternate althea although altimeter altitude alto altogether Alton altruism altruist alum alumina aluminate alumna alumnae alumni alumnus alundum Alva Alvarez alveolar alveoli alveolus Alvin alway alyssum am AMA Amadeus amalgam amalgamate amanita amanuensis amaranth Amarillo amass amateur amateurish amatory amaze Amazon ambassador amber ambiance ambidextrous ambient ambiguity ambiguous ambition ambitious ambivalent amble ambling ambrose ambrosia ambrosial ambulant ambulatory ambuscade ambush Amelia ameliorate amen amend amende Amerada America American Americana Americanism americium Ames amethyst amethystine Amherst ami amicable amid amide amidst amigo amino aminobenzoic amiss amity Amman Ammerman ammeter ammo ammonia ammoniac ammonium ammunition Amoco amoeba amoebae amok among amongst amoral amorphous amort Amos amount amperage ampere ampersand Ampex amphetamine amphibian amphibious amphibole amphibology ample amplifier amplify amplitude amply amputate amra Amsterdam Amtrak amulet amuse amy amygdaloid an ana Anabaptist Anabel anachronism anachronistic anaconda anaerobic anaglyph anagram Anaheim analeptic analgesic analogous analogue analogy analyses analysis analyst analytic anamorphic anaplasmosis anarch anarchic anarchy anastigmat anastigmatic anastomosis anastomotic anathema Anatole anatomic anatomy ancestor ancestral ancestry anchor anchorage anchorite anchoritism anchovy ancient ancillary and Andean Andersen Anderson Andes andesine andesite Andorra Andover Andre Andrea Andrei Andrew Andrews Andromache Andromeda Andy anecdotal anecdote anemone anent anew angel Angela Angeles angelfish angelic Angelica Angelina Angeline Angelo anger Angie angiosperm angle Angles Anglican Anglicanism angling Anglo Anglophobia Angola Angora angry angst angstrom anguish angular Angus anharmonic Anheuser anhydride anhydrite anhydrous ani aniline animadversion animadvert animal animate animism animosity anion anionic anise aniseikonic anisotropic anisotropy Anita Ankara ankle Ann Anna annal Annale Annalen Annapolis Anne anneal annex Annie annihilate anniversary annotate announce annoy annoyance annual annuity annul annular annuli annulled annulling annulus annum annunciate anode anodic anomalous anomaly anomie anonymity anonymous anorexia anorthic anorthite anorthosite another Anselm Anselmo ANSI answer ant antacid Antaeus antagonism antagonist antagonistic Antarctica Antares ante anteater antebellum antecedent antedate a((ntelope antenna antennae anterior anthem anther anthology Anthony anthracite anthracnose anthropogenic anthropology anthropomorphic anti antic anticipate anticipatory Antietam antigen Antigone antigorite antimony Antioch antipasto antipathy antiperspirant antiphonal antipodes antiquarian antiquary antiquated antique antiquity antisemitic antisemitism antithetic antler Antoine Antoinette Anton Antonio Antony anus anvil anxiety anxious any anybody anybody'd anyhow anyone anyplace anything anyway anywhere aorta apache apart apartheid apathetic apathy apatite ape aperiodic aperture apex aphasia aphasic aphelion aphid aphorism Aphrodite apices apiece aplomb apocalypse apocalyptic Apocrypha apocryphal apogee Apollo Apollonian apologetic apologia apology apostate apostle apostolic apostrophe apothecary apothegm apotheosis Appalachia appall appanage apparatus apparel apparent apparition appeal appear appearance appeasable appease appellant appellate append appendage appendices appendix appertain appetite Appian applaud applause apple Appleby applejack Appleton appliance applicable applicant applicate applied applique apply appoint appointe appointee apport apposite apposition appraisal appraise appreciable appreciate apprehend apprehension apprehensive apprentice apprise approach approbation appropriable appropriate approval approve approximable approximant approximate apricot April apron apropos apse apt aptitude aqua aquarium Aquarius aquatic aqueduct aqueous Aquila Aquinas Arab arabesque Arabia Arabic Araby Arachne arachnid arbiter arbitrage arbitrary arbitrate arboreal arboretum arbutus arc arcade Arcadia arcana arcane arccos arccosine arch archae archaic archaism archangel archbishop archdiocese archenemy Archer archery archetype archetypical archfool Archibald Archimedes arching archipelago architect architectonic architectural architecture archival archive arcing arcsin arcsine arctan arctangent arctic Arcturus Arden ardency ardent arduous are area areaway areawide aren't arena arenaceous Arequipa Ares Argentina argillaceous Argive argo argon Argonaut Argonne argot argue argument argumentation argumentative Argus arhat Ariadne Arianism arid Aries arise arisen aristocracy aristocrat aristocratic Aristotelean Aristotelian Aristotle arithmetic Arizona ark Arkansan Arkansas Arlen Arlene Arlington arm armada armadillo Armageddon armament Armata armature armchair Armco Armenian armful armhole armillaria armistice armload armoire Armonk Armour armpit Armstrong army Arnold aroma aromatic arose around arousal arouse ARPA arpeggio arrack Arragon arraign arrange arrangeable array arrear arrest Arrhenius arrival arrive arrogant arrogate arrow arrowhead arrowroot arroyo arsenal arsenate arsenic arsenide arsine arson art Artemis artemisia arterial arteriole arteriolosclerosis arteriosclerosis artery artful arthritis Arthur artichoke article articulate articulatory Artie artifact artifice artificial artillery artisan artistry Arturo artwork arty Aruba arum aryl as asbestos ascend ascendant ascension ascent ascertain ascetic asceticism ascomycetes ascribe ascription aseptic ash ashame ashen Asher Asheville Ashland Ashley ashman ashmen Ashmolean ashore ashtray ashy Asia Asiatic aside Asilomar asinine ask askance askew asleep asocial asparagus aspect aspen asperity aspersion asphalt aspheric asphyxiate aspidistra aspirant aspirate aspire aspirin asplenium ass assai assail assailant Assam assassin assassinate assault assay assemblage assemble assent assert assess assessor asset assiduity assiduous assign assignation assignee assimilable assimilate assist assistant associable associate associative assonant assort assuage assume assumption assurance assure Assyria Assyriology Astarte astatine aster asteria asterisk asteroid asteroidal asthma astigmat astigmatic astigmatism ASTM astonish Astor Astoria astound astraddle astral astray astride astringent astronaut astronautic astronomer astronomic astronomy astrophysical astrophysics astute Asuncion asunder asylum asymmetric asymmetry asymptote asymptotic asynchronous asynchrony at AT&T Atalanta atavism atavistic Atchison ate Athabascan atheist Athena Athenian Athens athlete athletic athwart Atkins Atkinson Atlanta atlantes atlantic Atlantica Atlantis atlas atmosphere atmospheric atom atomic atonal atone atop Atreus atrocious atrocity atrophic atrophy Atropos attach attache attack attain attainder attempt attend attendant attendee attention attentive attenuate attest attestation attic Attica attire attitude attorney attract attribute attribution attributive attrition attune Atwater Atwood atypic Auberge Aubrey auburn auction auctioneer audacious audacity audible audience audio audiotape audiovisual audit audition auditor auditorium auditory Audrey Audubon Auerbach Aug Augean auger augite augment augmentation augur august Augusta Augustan Augustine Augustus auk aunt auntie aura aural Aurelius aureomycin auric Auriga aurora Auschwitz auspices auspicious austere Austin Australia Australis australite Austria authentic authenticate author authoritarian authoritative autism autistic auto autobiography autoclave autocollimate autocorrelate autocracy autocrat autocratic autograph automat automata automate automatic automaton automobile automotive autonomic autonomous autonomy autopsy autosuggestible autotransformer autumn autumnal auxiliary avail avalanche avarice avaricious Ave avenge Aventine avenue aver average averred averring averse aversion avert avertive Avery Avesta aviary aviate aviatrix avid avionic Avis Aviv avocado avocate avocet Avogadro avoid avoidance Avon avow await awake awaken award aware awash away awe awesome awful awhile awkward awl awn awoke awry ax axe axes axial axiology axiom axiomatic axis axisymmetric axle axon aye Ayers Aylesbury azalea Azerbaijan azimuth azimuthal Aztec Aztecan azure b b's babbitt babble Babcock babe Babel baboon baby babyhood Babylon Babylonian babysat babysit babysitting baccarat Bacchus Bach bachelor bacilli bacillus back backboard backbone backdrop backfill background backhand backlash backlog backorder backpack backplane backplate backside backspace backstage backstitch backstop backtrack backup backward backwater backwood backyard bacon bacteria bacterial bacterium bad bade Baden badge badinage badland badminton Baffin baffle bag bagatelle baggage bagging baggy Baghdad Bagley bagpipe bah Bahama Bahrein bail Bailey bailiff Baird bait bake Bakelite Bakersfield bakery Bakhtiari baklava Baku balance Balboa balcony bald baldpate Baldwin baldy bale baleen baleful Balfour Bali Balinese balk Balkan balky ball ballad Ballard ballast balled ballerina ballet balletomane ballfield balloon ballot ballroom ballyhoo balm balmy balsa balsam Baltic Baltimore Baltimorean balustrade Balzac bam Bamako Bamberger Bambi bamboo ban banal banana Banbury band bandage bandgap bandit bandpass bandstand bandstop bandwagon bandwidth bandy bane baneberry baneful bang bangkok Bangladesh bangle Bangor Bangui banish banister banjo bank bankrupt bankruptcy Banks banning banquet banshee bantam banter Bantu Bantus baptism baptismal Baptist Baptiste baptistery bar barb Barbados Barbara barbarian barbaric barbarism barbarous barbecue barbell barber barberry barbital barbiturate Barbour barbudo Barcelona Barclay bard bare barefaced barefoot barfly bargain barge baritone barium bark barkeep barley Barlow barn Barnabas barnacle Barnard Barnes Barnet Barnett Barney Barnhard barnstorm barnyard barometer barometric baron baroness baronet baronial barony baroque Barr barrack barracuda barrage barre barrel barren Barrett barrette barricade barrier barring Barrington barrow Barry Barrymore Barstow bartend bartender barter Barth Bartholomew Bartlett Bartok Barton barycentric basal base baseball baseband baseboard Basel baseline baseman basemen baseplate bash bashaw bashful basic basidiomycetes basil basilar basilisk basin basis bask basket basketball basophilic bass Bassett bassi bassinet basso basswood bastard baste bastion bat Batavia batch Batchelder bate bateau Bateman bater Bates bath bathe bathos bathrobe bathroom bathtub Bathurst batik baton Bator batt battalion Battelle batten battery battle battlefield battlefront battleground batwing bauble baud Baudelaire Bauer Bauhaus Bausch bauxite Bavaria bawd bawdy bawl Baxter bay bayberry Bayda bayed Bayesian Baylor bayonet Bayonne bayou Bayport Bayreuth bazaar be beach beachhead beacon bead beadle beady beak beam bean bear bearberry beard Beardsley bearish beast beat beaten beater beatific beatify beatitude beatnik Beatrice beau Beaujolais Beaumont Beauregard beauteous beautiful beautify beauty beaux beaver bebop becalm became because Bechtel beck Becker becket Beckman beckon Becky become bed bedazzle bedbug bedding bedfast Bedford bedim bedimmed bedimming bedlam bedpost bedraggle bedridden bedrock bedroom bedside bedspread bedspring bedstraw bedtime bee Beebe beebread beech Beecham beechwood beef beefsteak beefy beehive been beep beer beet Beethoven beetle befall befallen befell befit befitting befog befogging before beforehand befoul befuddle beg began beget begetting beggar beggary begging begin beginner beginning begonia begotten begrudge beguile begun behalf behave behavioral behead beheld behind behold beige being Beirut bel Bela belate belch Belfast belfry Belgian Belgium Belgrade belie belief believe belittle bell Bella belladonna Bellamy Bellatrix bellboy belle bellflower bellhop bellicose belligerent Bellingham Bellini bellman bellmen bellow bellum bellwether belly bellyache bellyfull Belmont Beloit belong belove below Belshazzar belt Beltsville belvedere belvidere belying BEMA bemadden beman bemoan bemuse Ben bench benchmark bend Bender Bendix beneath Benedict Benedictine benediction benefactor benefice beneficent beneficial beneficiary benefit Benelux benevolent Bengal Bengali benight benign Benjamin Bennett Bennington Benny Benson bent Bentham benthic Bentley Benton Benz Benzedrine benzene Beowulf beplaster bequeath bequest berate Berea bereave bereft Berenices beret berg bergamot Bergen Bergland Berglund Bergman Bergson Bergstrom beribbon beriberi Berkeley berkelium Berkowitz Berkshire Berlin Berlioz Berlitz Berman Bermuda Bern Bernadine Bernard Bernardino Bern((ardo berne Bernet Bernhard Bernice Bernie Berniece Bernini Bernoulli Bernstein Berra berry berserk Bert berth Bertha Bertie Bertram Bertrand Berwick beryl beryllium beseech beset besetting beside besiege besmirch besotted bespeak bespectacled bespoke Bess Bessel Bessemer Bessie best bestial bestir bestirring bestow bestowal bestseller bestselling bestubble bet beta betatron betel Betelgeuse beth bethel Bethesda Bethlehem bethought betide betoken betony betray betrayal betrayer betroth betrothal Betsey Betsy Bette betting bettor Betty between betwixt bevel beverage Beverly bevy bewail beware bewhisker bewilder bewitch bey beyond bezel bhoy Bhutan bianco bias biaxial bib bibb Bible biblical bibliography bibliophile bicameral bicarbonate bicep biceps bichromate bicker biconcave biconnected bicycle bid biddable bidding biddy bide bidiagonal bidirectional bien biennial biennium bifocal bifurcate big Bigelow Biggs bigot bigotry biharmonic bijouterie bikini bilateral bilayer bile bilge bilharziasis bilinear bilingual bilk bill billboard billet billiard Billie Billiken Billings billion billionth billow billy Biltmore bimetallic bimetallism Bimini bimodal bimolecular bimonthly bin binary binaural bind bindery bindle bindweed bing binge Bingham Binghamton bingle Bini binocular binomial binuclear biochemic biochemist biochemistry biograph biography biology biomass biomedical biometric Biometrika biometry biophysic biophysical biophysicist biopsy bioscience biosphere biostatistic biosynthesize biota biotic biotite bipartisan bipartite biplane bipolar biracial birch bird birdbath birdie birdlike birdseed birdwatch birefringent Birgit Birmingham birth birthday birthplace birthright biscuit bisect bishop bishopric Bismarck Bismark bismuth bison bisque Bissau bistable bistate bit bitch bite bitt bitten bittern bitternut bitterroot bittersweet bitumen bituminous bitwise bivalve bivariate bivouac biz bizarre Bizet blab blabbing black blackball blackberry blackbird blackboard blackbody Blackburn blacken Blackfeet blackjack blackmail Blackman blackout blacksmith Blackstone Blackwell bladder bladdernut bladderwort blade Blaine Blair Blake blame blameworthy blanc blanch Blanchard Blanche bland blank blanket blare blaspheme blasphemous blasphemy blast blat blatant blather blatting Blatz blaze blazon bleach bleak bleary bleat bled bleed Bleeker blemish blend Blenheim bless blest blew blight blimp blind blindfold blink Blinn blip bliss blissful blister blithe blitz blizzard bloat blob bloc Bloch block blockade blockage blockhouse blocky bloke Blomberg Blomquist blond blonde blood bloodbath bloodhound bloodroot bloodshed bloodshot bloodstain bloodstone bloodstream bloody bloom Bloomfield Bloomington bloop blossom blot blotch blotting blouse blow blowfish blown blowup blubber bludgeon blue blueback blueberry bluebill bluebird bluebonnet bluebook bluebush bluefish bluegill bluegrass bluejacket blueprint bluestocking bluet bluff bluish Blum Blumenthal blunder blunt blur blurring blurry blurt blush bluster blustery blutwurst Blythe BMW boa boar board boardinghouse boast boastful boat boathouse boatload boatman boatmen boatswain boatyard bob Bobbie bobbin bobbing bobble bobby bobcat bobolink Boca bock bode bodhisattva bodice bodied Bodleian body bodybuilder bodybuilding bodyguard Boeing Boeotian bog bogey bogeymen bogging boggle boggy Bogota bogus bogy Bohemia Bohr boil Bois Boise boisterous bold boldface bole boletus bolivar Bolivia bolo Bologna bolometer Bolshevik Bolshevism Bolshevist Bolshoi bolster bolt Bolton Boltzmann bomb bombard bombast bombastic Bombay bombproof bon bona bonanza Bonaparte Bonaventure bond bondage bondsman bondsmen bone bonfire bong bongo Boniface bonito Bonn bonnet Bonneville Bonnie bonus bony bonze boo booby boogie book bookbind bookcase bookend bookie bookish bookkeep booklet bookplate bookseller bookshelf bookshelves bookstore booky boolean boom boomerang boon Boone boor boorish boost boot Bootes booth bootleg bootlegger bootlegging bootstrap bootstrapping booty booze bop bopping borate borax Bordeaux bordello Borden border borderland borderline bore Borealis Boreas boredom Borg boric Boris born borne Borneo boron borosilicate borough Borroughs borrow Bosch Bose bosom boson boss Boston Bostonian Boswell botanic botanist botany botch botfly both bothersome Botswana bottle bottleneck bottom bottommost botulin botulism Boucher bouffant bough bought boulder boulevard bounce bouncy bound boundary bounty bouquet bourbon bourgeois bourgeoisie bourn boustrophedon bout boutique bovine bow Bowditch Bowdoin bowel Bowen bowfin bowie bowl bowline bowman bowmen bowstring box boxcar boxwood boxy boy boyar Boyce boycott Boyd boyhood boyish Boyle Boylston BP brace bracelet bracken bracket brackish bract brad Bradbury Bradford Bradley Bradshaw Brady brae brag Bragg bragging Brahmaputra Brahms Brahmsian braid Braille brain Brainard brainstorm brainwash brainy brake brakeman bramble bran branch brand Brandeis Brandenburg brandish Brandon Brandt brandy brandywine Braniff brant brash Brasilia brass brassiere brassy bratwurst Braun bravado brave bravery bravo bravura brawl bray brazen brazier Brazil Brazilian Brazzaville breach bread breadboard breadfruit breadroot breadth break breakage breakaway breakdown breakfast breakoff breakpoint breakthrough breakup breakwater bream breast breastplate breastwork breath breathe breathtaking breathy breccia bred breech breeches breed breeze breezy Bremen bremsstrahlung Brenda Brendan Brennan Brenner Brent Brest brethren Breton Brett breve brevet brevity brew brewery Brewster Brian briar bribe bribery Brice brick brickbat bricklayer bricklaying bridal bride bridegroom bridesmaid bridge bridgeable bridgehead Bridgeport Bridget Bridgetown Bridgewater bridgework bridle brief briefcase brig brigade brigadier brigantine Briggs Brigham bright brighten Brighton brilliant Brillouin brim brimful brimming brimstone Brindisi brindle brine bring brink brinkmanship briny Brisbane brisk bristle Bristol Britain Britannic Britannica britches British Briton Brittany Britten brittle broach broad broadcast broaden broadloom broadside Broadway brocade broccoli brochure Brock brockle Broglie broil broke broken brokerage Bromfield bromide bromine Bromley bronchi bronchial bronchiolar bronchiole bronchitis bronchus bronco Bronx bronze bronzy brood broody brook Brooke Brookhaven Brookline Brooklyn brookside broom broomcorn broth brothel brother brotherhood brought brouhaha brow browbeaten brown Browne Brownell Brownian brownie brownish browse Bruce brucellosis Bruckner Bruegel bruise bruit Brumidi brunch brunette Brunhilde Bruno Brunswick brunt brush brushfire brushlike brushwork brushy brusque Brussels brutal brute Bryan Bryant Bryce Bryn bryophyta bryophyte bryozoa BSTJ BTL bub bubble Buchanan Bucharest Buchenwald Buchwald buck buckaroo buckboard bucket bucketfull buckeye buckhorn buckle Buckley Bucknell buckshot buckskin buckthorn buckwheat bucolic bud Budapest Budd Buddha Buddhism Buddhist budding buddy budge budget budgetary Budweiser Buena Buenos buff buffalo buffet bufflehead buffoon bug bugaboo bugeyed bugging buggy bugle Buick build buildup built builtin Bujumbura bulb bulblet Bulgaria bulge bulk bulkhead bulky bull bulldog bulldoze bullet bulletin bullfinch bullfrog bullhead bullhide bullish bullock bullseye bullwhack bully bullyboy bulrush bulwark bum bumble bumblebee bumming bump bumptious bun bunch Bundestag bundle bundy bungalow bungle bunk bunkmate bunny Bunsen bunt Bunyan buoy buoyant burbank Burch burden burdensome burdock bureau bureaucracy bureaucrat bureaucratic buret burette burg burgeon burgess burgher burglar burglarproof burglary Burgundian Burgundy burial buried Burke burl burlap burlesque burley Burlington burly Burma Burmese burn Burnett Burnham burnish Burnside burnt burp Burr burro Burroughs burrow bursitis burst bursty Burt Burton Burtt Burundi bury bus busboy Busch bush bushel bushmaster Bushnell bushwhack bushy business businessman businessmen buss bust bustard bustle busy but butadiene butane butch butchery butene buteo butler butt butte butterball buttercup butterfat Butterfield butterfly buttermilk butternut buttery buttock button buttonhole buttonweed buttress Buttrick butyl butyrate buxom Buxtehude Buxton buy buyer buzz Buzzard buzzer buzzing buzzword buzzy by bye Byers bygone bylaw byline bypass bypath byproduct Byrd Byrne byroad Byron Byronic bystander byte byway byword Byzantine Byzantium c c's cab cabal cabana cabaret cabbage cabdriver cabin cabinet cabinetmake cabinetry cable Cabot cacao cachalot cache cackle CACM cacophonist cacophony cacti cactus cadaver cadaverous caddis caddy cadent cadenza cadet Cadillac cadmium cadre Cady Caesar cafe cafeteria cage cagey Cahill cahoot caiman Cain Caine cairn Cairo cajole cake Cal Calais calamitous calamity calamus calcareous calcify calcite calcium calculable calculate calculi calculus Calcutta Calder caldera Caldwell Caleb calendar calendrical calf calfskin Calgary Calhoun caliber calibrate calibre calico California californium caliper caliph caliphate calisthenic Calkins call calla Callaghan Callahan caller calligraph calligraphy calliope Callisto callous callus calm caloric calorie calorimeter calorimetric calorimetry Calumet calumniate calumny Calvary calve Calvert Calvin Calvinist calypso cam camaraderie camber Cambodia cambric Cambridge Camden came camel camelback camellia camelopard Camelot cameo camera cameraman cameramen Cameron Cameroun camilla Camille Camino camouflage camp campaign campanile Campbell campfire campground campion campsite campus can can't Canaan Canada Canadian canal canary Canaveral Canberra cancel cancellate cancer cancerous candela candelabra candid candidacy candidate Candide candle candlelight candlestick candlewick candy cane Canfield canine Canis canister canker cankerworm canna cannabis cannel cannery cannibal canning cannister cannon cannonball cannot canny canoe Canoga canon canonic canopy cant cantaloupe canteen Canterbury canterelle canticle cantilever cantle canto canton Cantonese cantor canvas canvasback canvass canyon cap capacious capacitance capacitate capacitive capacitor capacity cape capella caper Capetown capillary Capistrano(( capita capital capitol Capitoline capitulate capo capping caprice capricious Capricorn capstan capstone capsule captain captaincy caption captious captivate captive captor capture Caputo capybara car carabao Caracas caramel caravan caraway carbide carbine carbohydrate Carboloy carbon carbonaceous carbonate Carbondale Carbone carbonic carbonyl carborundum carboxy carboy carbuncle carcass carcinogen carcinogenic carcinoma card cardamom cardboard cardiac cardinal cardiology cardiovascular care careen career carefree careful caress caret caretaker careworn Carey Cargill cargo cargoes Carib Caribbean caribou caricature Carl Carla Carleton Carlin Carlisle Carlo carload Carlson Carlton Carlyle Carmela Carmen Carmichael carmine carnage carnal carnation carne Carnegie carney carnival carob carol Carolina Caroline Carolingian Carolinian Carolyn carouse carp Carpathia carpenter carpentry carpet carport Carr carrageen Carrara carrel carriage Carrie carrion Carroll carrot Carruthers carry carryover Carson cart carte cartel Cartesian Carthage cartilage cartographer cartographic cartography carton cartoon cartridge cartwheel Caruso carve carven Casanova casbah cascade cascara case casebook casein casework Casey cash cashew cashier cashmere casino cask casket Cassandra casserole cassette Cassiopeia Cassius cassock cast castanet caste casteth castigate Castillo castle castor Castro casual casualty cat cataclysmic Catalina catalogue catalpa catalysis catalyst catalytic catapult cataract catastrophe catastrophic catatonia catatonic catawba catbird catch catchup catchword catchy catechism categoric category catenate cater caterpillar catfish catharsis cathedral Catherine Catherwood catheter cathode cathodic catholic Catholicism Cathy cation cationic catkin catlike catnip Catskill catsup cattail cattle cattleman cattlemen Caucasian Caucasus Cauchy caucus caught cauliflower caulk causal causate cause caustic caution cautionary cautious cavalcade cavalier cavalry cave caveat caveman cavemen Cavendish cavern cavernous caviar cavil cavilling Caviness cavort caw cayenne Cayley Cayuga CBS CDC cease Cecil Cecilia Cecropia cedar cede cedilla Cedric ceil celandine Celanese Celebes celebrant celebrate celebrity celerity celery celesta celestial Celia cell cellar cellophane cellular cellulose Celsius Celtic cement cemetery Cenozoic censor censorial censure census cent centaur centenary centennial centerline centerpiece centigrade centipede central centrex centric centrifugal centrifugate centrifuge centrist centroid centum century Cepheus ceramic ceramium Cerberus cereal cerebellum cerebral cerebrate ceremonial ceremonious ceremony Ceres cereus cerise cerium CERN certain certainty certificate certified certify certiorari certitude cerulean Cervantes Cesare cesium cessation cession Cessna cetera Cetus Ceylon Cezanne Chablis Chad Chadwick chafe chaff chagrin chain chair chairlady chairman chairmen chairperson chairwoman chairwomen chaise chalcedony chalcocite chalice chalk chalkline chalky challenge Chalmers chamber chamberlain chambermaid Chambers chameleon chamfer chamois chamomile champ champagne Champaign champion Champlain chance chancel chancellor chancery chancy chandelier chandler Chang change changeable changeover channel chanson chant chantey Chantilly chantry Chao chaos chaotic chap chaparral chapel chaperon chaperone chaplain Chaplin Chapman chapping chapter char character characteristic charcoal chard charge chargeable chariot charisma charismatic charitable charity Charles Charleston Charley Charlie Charlotte Charlottesville charm Charon charring chart Charta Chartres chartreuse chartroom Charybdis chase chasm chassis chaste chastise chastity chat chateau chateaux Chatham Chattanooga chattel chatting chatty Chaucer chauffeur Chauncey Chautauqua chaw cheap cheat cheater check checkbook checkerberry checkerboard checklist checkout checkpoint checksum checksummed checksumming checkup cheek cheekbone cheeky cheer cheerful cheerleader cheery cheese cheesecloth cheesy cheetah chef chelate chemic chemise chemisorb chemisorption chemist chemistry Chen Cheney chenille cherish Cherokee cherry chert cherub cherubim Chesapeake Cheshire chess chest Chester Chesterton chestnut chevalier Chevrolet chevron chevy chew Cheyenne chi Chiang chianti chic Chicago Chicagoan chicanery Chicano chick chickadee chicken chickweed chicory chide chief chiefdom chieftain chiffon chigger chignon chilblain child childbirth childhood childish childlike children Chile chili chill chilly chime chimera chimeric Chimique chimney chimpanzee chin china Chinaman Chinamen Chinatown chinch chinchilla chine Chinese chink chinning Chinook chinquapin chip chipboard chipmunk Chippendale chipping chiropractor chirp chisel Chisholm chit chiton chivalrous chivalry chive chlorate chlordane chloride chlorine chloroform chlorophyll chloroplatinate chock chocolate Choctaw choice choir choirmaster choke chokeberry cholera cholesterol cholinesterase chomp choose choosy chop Chopin chopping choppy choral chorale chord chordal chordata chordate chore choreograph choreography chorine chortle chorus chose chosen Chou chow chowder Chris Christ christen Christendom Christensen Christenson Christian Christiana Christianson Christie Christina Christine Christlike Christmas Christoffel Christopher Christy chromate chromatic chromatogram chromatograph chromatography chrome chromic chromium chromosphere chronic chronicle chronograph chronography chronology chrysanthemum Chrysler chrysolite chub chubby chuck chuckle chuckwalla chuff chug chugging chum chumming chummy chump Chungking chunk chunky church churchgoer churchgoing Churchill Churchillian churchman churchmen churchwoman churchwomen churchyard churn chute chutney CIA cicada Cicero Ciceronian cider cigar cigarette cilia ciliate cimcumvention cinch Cincinnati cinder Cinderella cinema cinematic Cinerama cinnabar cinnamon cinquefoil cipher circa Circe circle circlet circuit circuitous circuitry circulant circular circulate circulatory circumcircle circumcise circumcision circumference circumferential circumflex circumlocution circumpolar circumscribe circumscription circumspect circumsphere circumstance circumstantial circumvent circumvention circus cirmcumferential cistern citadel citation cite citizen citizenry citrate citric Citroen citron citrus city cityscape citywide civet civic civil civilian clad cladding cladophora claim claimant Claire clairvoyant clam clamber clamming clammy clamp clamshell clan clandestine clang clank clannish clap clapboard Clapeyron clapping Clara Clare Claremont Clarence Clarendon claret clarify clarinet clarity Clark Clarke clash clasp class classic classification classificatory classify classmate classroom classy clatter clattery Claude Claudia Claudio Claus clause Clausen Clausius claustrophobia claustrophobic claw clay Clayton clean cleanse cleanup clear clearance clearheaded Clearwater cleat cleavage cleave cleft clement Clemson clench clergy clergyman clergymen cleric clerk Cleveland clever cliche click client clientele cliff cliffhang Clifford Clifton climactic climate climatic climatology climax climb clime clinch cling clinging clinic clinician clink Clint Clinton Clio clip clipboard clipping clique Clive cloak cloakroom clobber clock clockwatcher clockwise clockwork clod cloddish clog clogging cloister clomp clone clonic close closet closeup closure clot cloth clothbound clothe clothesbrush clotheshorse clothesline clothesman clothesmen clothier Clotho clotting cloture cloud cloudburst cloudy clout clove clown cloy club clubbing clubhouse clubroom cluck clue clump clumsy clung cluster clutch clutter Clyde Clytemnestra coach coachman coachmen coachwork coadjutor coagulable coagulate coal coalesce coalescent coalition coarse coarsen coast coastal coastline coat Coates coattail coauthor coax coaxial cobalt Cobb cobble cobblestone Cobol cobra cobweb coca cocaine coccidiosis cochineal cochlea Cochran Cochrane cock cockatoo cockcrow cockeye cockle cocklebur cockleshell cockpit cockroach cocksure cocktail cocky coco cocoa coconut cocoon cod coda Coddington coddle code codebreak codeposit codetermine codeword codfish codicil codify codpiece Cody coed coeditor coeducation coefficient coequal coerce coercible coercion coercive coexist coexistent coextensive cofactor coffee coffeecup coffeepot coffer Coffey coffin Coffman cog cogent cogitate cognac cognate cognition cognitive cognizable cognizant Cohen cohere coherent cohesion cohesive Cohn cohort cohosh coiffure coil coin coinage coincide coincident coincidental coke col cola colander colatitude Colby cold Cole Coleman Coleridge Colette coleus Colgate colicky coliform coliseum collaborate collage collagen collapse collapsible collar collarbone collard collate collateral colleague collect collectible collector college collegian collegiate collet collide collie Collier collimate collinear Collins collision collocation colloidal colloquia colloquial colloquium colloquy collude collusion Cologne Colombia Colombo colon colonel colonial colonist colonnade colony Colorado colorate coloratura colorimeter colorimetry colossal Colosseum colossi colossus colt coltish coltsfoot Columbia columbine Columbus column columnar colza coma Comanche comatose comb combat combatant combatted combinate combinator combinatorial combinatoric combine combustible combustion come comeback comedian comedy comet cometary cometh comfort comic Cominform comma command commandant commandeer commando commemorate commend commendation commendatory commensurable commensurate comment commentary commentator commerce commercial commingle commiserate commissariat commissary commission commit committable committal committed committee committeeman committeemen committeewoman committeewomen committing commodious commodity commodore common commonality commonplace commonweal commonwealth commotion communal commune communicable communicant communicate communion communique commutate commute compact Compagnie companion companionway company comparative comparator compare comparison compartment compass compassion compassionate compatible compatriot compel compellable compelled compelling compendia compendium compensable compensate compensatory co((mpete competent competition competitive competitor compilation compile complacent complain complainant complaint complaisant complement complementarity complementary complementation complete completion complex complexion compliant complicate complicity compliment complimentary compline comply component componentry comport compose composite composition compositor compost composure compote compound comprehend comprehensible comprehension comprehensive compress compressible compression compressive compressor comprise compromise Compton comptroller compulsion compulsive compulsory computation compute comrade con Conakry Conant concatenate concave conceal concede conceit conceive concentrate concentric concept conception conceptual concern concert concerti concertina concertmaster concerto concession concessionaire conch concierge conciliate conciliatory concise concision conclave conclude conclusion conclusive concoct concomitant concord concordant concourse concrete concretion concubine concur concurred concurrent concurring concussion condemn condemnate condemnatory condensate condense condensible condescend condescension condiment condition condolence condone conduce conducive conduct conductance conductive conductor conduit cone coneflower Conestoga coney confabulate confect confectionery confederacy confederate confer conferee conference conferrable conferred conferring confess confession confessor confidant confidante confide confident confidential configuration configure confine confirm confirmation confirmatory confiscable confiscate confiscatory conflagrate conflict confluent confocal conform conformal conformance conformation confound confrere confront confrontation Confucian Confucianism Confucius confuse confusion confute congeal congener congenial congenital congest congestion congestive conglomerate Congo Congolese congratulate congratulatory congregate congress congressional congressman congressmen congresswoman congresswomen congruent conic conifer coniferous conjectural conjecture conjoin conjoint conjugal conjugate conjunct conjuncture conjure Conklin Conley conn Connally connect Connecticut connector Conner Connie connivance connive connoisseur Connors connotation connotative connote connubial conquer conqueror conquest conquistador Conrad Conrail consanguine consanguineous conscience conscientious conscionable conscious conscript conscription consecrate consecutive consensus consent consequent consequential conservation conservatism conservative conservator conservatory conserve consider considerate consign consignee consignor consist consistent consolation console consolidate consonant consonantal consort consortium conspicuous conspiracy conspirator conspiratorial conspire Constance constant Constantine Constantinople constellate consternate constituent constitute constitution constrain constraint constrict constrictor construct constructible constructor construe consul consular consulate consult consultant consultation consultative consume consummate consumption consumptive contact contagion contagious contain contaminant contaminate contemplate contemporaneous contemporary contempt contemptible contemptuous contend content contention contentious contest contestant context contextual contiguity contiguous continent continental contingent continua continual continuant continuation continue continued continuity continuo continuous continuum contort contour contraband contrabass contraception contraceptive contract contractor contractual contradict contradictory contradistinct contradistinguish contralateral contralto contraption contrariety contrary contrast contravariant contravene contravention contretemps contribute contribution contributor contributory contrite contrition contrivance contrive control controllable controlled controller controlling controversial controversy controvertible contumacy contusion conundrum Convair convalesce convalescent convect convene convenient convent convention converge convergent conversant conversation converse conversion convert convertible convex convey conveyance conveyor convict convince convivial convocate convoke convolute convolution convolve convoy convulse convulsion convulsive Conway cony coo cook cookbook Cooke cookery cookie cooky cool coolant Cooley coolheaded Coolidge coon coop cooperate coordinate Coors coot cop cope Copeland Copenhagen Copernican Copernicus copious coplanar copolymer copperas Copperfield copperhead coppery copra coprinus copter copy copybook copyright copywriter coquette coquina coral coralberry coralline corbel Corbett Corcoran cord cordage cordial cordite cordon corduroy core Corey coriander Corinth Corinthian Coriolanus cork corkscrew cormorant corn cornbread cornea Cornelia Cornelius Cornell cornerstone cornet cornfield cornflower cornish cornmeal cornstarch cornucopia Cornwall corny corollary corona Coronado coronary coronate coroner coronet coroutine Corp corpora corporal corporate corporeal corps corpse corpsman corpsmen corpulent corpus corpuscular corral corralled correct corrector correlate correspond correspondent corridor corrigenda corrigendum corrigible corroborate corroboree corrode corrodible corrosion corrosive corrugate corrupt corruptible corruption corsage cortege cortex cortical Cortland corundum coruscate corvette Corvus cos cosec coset Cosgrove cosh cosine cosmetic cosmic cosmology cosmopolitan cosmos cosponsor Cossack cost Costello costume cosy cot cotangent cotillion cotman cotoneaster cotta cottage cotton cottonmouth cottonseed cottonwood cottony Cottrell cotty couch cougar cough could couldn't coulomb Coulter council councilman councilmen councilwoman councilwomen counsel counselor count countenance counteract counterargument counterattack counterbalance counterclockwise counterexample counterfeit counterflow counterintuitive counterman countermen counterpart counterpoint counterpoise counterproductive counterproposal countersink countersunk countervail countrify country countryman countrymen countryside countrywide county countywide coup coupe couple coupon courage courageous courier course court courteous courtesan courtesy courthouse courtier Courtney courtroom courtyard cousin couturier covalent covariant covariate covary cove coven covenant Coventry cover coverage coverall coverlet covert covet covetous cow Cowan coward cowardice cowbell cowbird cowboy cowhand cowherd cowhide cowl cowlick cowman cowmen coworker cowpea cowpoke cowpony cowpox cowpunch cowry cowslip cox coxcomb coy coyote coypu cozen cozier cozy CPA crab crabapple crabbing crack crackle crackpot cradle craft craftsman craftsmen craftspeople craftsperson crafty crag craggy Craig cram Cramer cramming cramp cranberry Crandall crane cranelike Cranford crania cranium crank crankcase crankshaft cranky cranny Cranston crap crappie crash crass crate crater cravat crave craven craw Crawford crawl crawlspace crayfish crayon craze crazy creak creaky cream creamery creamy crease create creating creature creche credent credential credenza credible credit creditor credo credulity credulous creed creedal creek creekside creep creepy cremate crematory Creole Creon creosote crepe crept crescendo crescent cress crest crestfallen Crestview Cretaceous Cretan Crete cretin cretinous crevice crew crewcut crewel crewman crewmen crib cribbing cricket cried crime Crimea criminal crimp crimson cringe crinkle cripple crises crisis crisp Crispin criss crisscross criteria criterion critic critique critter croak crochet crock crockery Crockett crocodile crocodilian crocus croft Croix Cromwell Cromwellian crone crony crook croon crop cropping Crosby cross crossarm crossbar crossbill crosscut crosshatch crossover crosspoint crossroad crosstalk crosswalk crossway crosswise crosswort crotch crotchety crouch croupier crow crowbait crowberry crowd crowfoot Crowley crown croydon CRT crucial crucible crucifix crucifixion crucify crud cruddy crude cruel cruelty Cruickshank cruise crumb crumble crummy crump crumple crunch crupper crusade crush Crusoe crust crutch crux cry cryogenic cryostat crypt cryptanalysis cryptanalyst cryptanalytic cryptic cryptogram cryptographer cryptography crystal crystalline crystallite crystallographer crystallography cub Cuba cubbyhole cube cubic cuckoo cucumber cud cuddle cuddly cudgel cue cuff cufflink cuisine Culbertson culinary cull culminate culpa culpable culprit cult cultivable cultivate cultural culture Culver culvert Cumberland cumbersome cumin Cummings Cummins cumulate cumulus Cunard cunning Cunningham CUNY cup cupboard cupful Cupid cupidity cupping cupric cuprous cur curate curb curbside curd curdle cure curfew curia curie curio curiosity curious curium curl curlew curlicue Curran currant current curricula curricular curriculum curry curse cursive cursor cursory curt curtail curtain Curtis curtsey curvaceous curvature curve curvilinear Cushing cushion Cushman cusp Custer custodial custodian custody custom customary customhouse cut cutaneous cutback cute cutlass cutler cutlet cutoff cutout cutover cutthroat cutting cuttlebone cuttlefish cutworm Cyanamid cyanate cyanic cyanide cybernetics cycad Cyclades cycle cyclic cyclist cyclone cyclopean Cyclops cyclorama cyclotron Cygnus cylinder cylindric cynic Cynthia cypress Cyprian Cypriot Cyprus Cyril Cyrus cyst cytochemistry cytolysis cytoplasm czar czarina Czechoslovakia Czerniak d d'art d'etat d'oeuvre d's dab dabbing dabble Dacca dachshund dactyl dactylic dad Dadaism Dadaist daddy Dade Daedalus daffodil daffy dagger Dahl dahlia Dahomey Dailey Daimler dainty dairy Dairylea dairyman dairymen dais daisy Dakar Dakota dale Daley Dallas dally Dalton Daly Dalzell dam damage Damascus damask dame damming damn damnation Damon damp dampen damsel Dan Dana Danbury dance dandelion dandy Dane dang danger dangerous dangle Daniel Danielson Danish dank Danny Dante Danube Danubian Danzig Daphne dapper dapple Dar dare Darius dark darken darkle Darlene darling darn Darrell dart Dartmouth Darwin Darwinian dash dashboard dastard data database date dateline dater Datsun datum daub Daugherty daughter daunt dauphin dauphine Dave davenport David Davidson Davies Davis Davison davit Davy dawn Dawson day daybed daybreak daydream daylight daytime Da((yton Daytona daze dazzle DC De deacon deaconess deactivate dead deaden deadhead deadline deadlock deadwood deaf deafen deal deallocate dealt dean Deane Deanna dear Dearborn dearie dearth death deathbed deathward debacle debar debarring debase debate debater debauch debauchery Debbie Debby debenture debilitate debility debit debonair Deborah Debra debrief debris debt debtor debug debugged debugger debugging debunk Debussy debut debutante Dec decade decadent decal decant decathlon Decatur decay Decca decease decedent deceit deceitful deceive decelerate December decennial decent deception deceptive decertify decibel decide deciduous decile decimal decipher decision decisional decisive deck Decker declaim declamation declamatory declaration declarative declarator declaratory declare declassify declination decline declivity decode decolletage decollimate decompile decomposable decompose decomposition decompress decompression decontrol decontrolled decontrolling deconvolution deconvolve decor decorate decorous decorticate decorum decouple decrease decree decreeing decrement decry decrypt decryption dedicate deduce deducible deduct deductible Dee deed deem deep deepen deer Deere deerskin deerstalker deface default defeat defecate defect defend defendant defensible defensive defer deferent deferrable deferred deferring defiant deficient deficit define definite definition definitive deflate deflater deflect deflector defocus deforest deforestation deform deformation defraud defray defrost deft defunct defy degas degassing degeneracy degenerate degradation degrade degrease degree degum degumming dehumidify dehydrate deify deign deity deja deject Del Delaney Delano Delaware delay delectable delectate delegable delegate delete deleterious deletion Delhi Delia deliberate delicacy delicate delicatessen delicious delicti delight delightful Delilah delimit delimitation delineament delineate delinquent deliquesce deliquescent delirious delirium deliver deliverance delivery dell Della Delmarva delouse Delphi Delphic delphine delphinium Delphinus delta deltoid delude deluge delusion delusive deluxe delve demagnify demagogue demand demarcate demark demean demented demerit demigod demijohn demiscible demise demit demitted demitting democracy democrat democratic demodulate demography demolish demolition demon demoniac demonic demonstrable demonstrate demote demountable Dempsey demultiplex demur demure demurred demurrer demurring demythologize den denature Deneb Denebola deniable denial denigrate denizen Denmark Dennis Denny denominate denotation denotative denote denouement denounce dense densitometer densitometric densitometry dent dental dentistry Denton denture denudation denude denumerable denunciate Denver deny deodorant deoxyribonucleic depart department departure depend dependent depict deplete depletion deplore deploy deport deportation deportee depose deposit depositary deposition depositor depository depot deprave deprecate deprecatory depreciable depreciate depress depressant depressed depressible depressing depression depressive depressor deprivation deprive depth deputation depute deputy derail derange derate derby Derbyshire dereference deregulate Derek derelict deride derision derisive derivate derive derogate derogatory derrick derriere dervish Des descant Descartes descend descendant descendent descent describe description descriptive descriptor desecrate desecrater desegregate desert deserve desiderata desideratum design designate desire desirous desist desk Desmond desolate desolater desorption despair desperado desperate despicable despise despite despoil despond despondent despot despotic dessert dessicate destabilize destinate destine destiny destitute destroy destruct destructor desuetude desultory desynchronize detach detail detain detect detector detent detente detention deter detergent deteriorate determinant determinate determine deterred deterrent deterring detest detestation detonable detonate detour detract detractor detriment Detroit deuce deus deuterate deuterium devastate develop deviant deviate device devil devilish devious devise devisee devoid devolve Devon Devonshire devote devotee devotion devour devout dew dewar dewdrop Dewey Dewitt dewy dexter dexterity dextrous dey Dhabi dharma diabase diabetes diabetic diabolic diachronic diacritical diadem diagnosable diagnose diagnoses diagnosis diagnostic diagnostician diagonal diagram diagrammatic dial dialect dialectic dialogue dialysis diamagnetic diamegnetism diameter diametric diamond Diana Diane Dianne diaper diaphanous diaphragm diary diathermy diathesis diatom diatomaceous diatomic diatonic dibble dice dichloride dichondra dichotomy dick dickcissel dickens Dickerson dickey Dickinson Dickson dicotyledon dicta dictate dictatorial diction dictionary dictum did didactic diddle didn't Dido die Diebold died Diego diehard dieldrin dielectric diem diesel diet dietary dietetic diethylstilbestrol dietician Dietrich diety Dietz differ different differentiable differential differentiate difficult difficulty diffident diffract diffractometer diffuse diffusible diffusion diffusive difluoride dig digest digestible digestion digestive digging digit digital digitalis dignify dignitary dignity digram digress digression dihedral dilapidate dilatation dilate dilation dilatory dilemma dilettante diligent dill Dillon dilogarithm diluent dilute dilution dim dime dimension dimethyl diminish diminution diminutive dimming dimple din Dinah dine ding dinghy dingo dingy dinnertime dinnerware dinosaur dint diocesan diocese diode Dionysian Dionysus Diophantine diopter diorama diorite dioxide dip diphthong diploma diplomacy diplomat diplomatic dipole dipping Dirac dire direct director directorate directory directrices directrix dirge Dirichlet dirt dirty Dis disambiguate disastrous disburse disc discern discernible disciple disciplinary discipline discoid discomfit discordant discovery discreet discrepant discrete discretion discretionary discriminable discriminant discriminate discriminatory discus discuss discussant discussion disdain disdainful disembowel disgruntle disgustful dish dishevel dishwasher dishwater disjunct disk dismal dismissal Disney Disneyland disparage disparate dispel dispelled dispelling dispensary dispensate dispense dispersal disperse dispersible dispersion dispersive disposable disposal disputant dispute disquietude disquisition disrupt disruption disruptive dissemble disseminate dissension dissertation dissident dissipate dissociable dissociate dissonant dissuade distaff distal distant distillate distillery distinct distinguish distort distortion distraught distribution distributive distributor district disturb disturbance disulfide disyllable ditch dither ditto ditty diurnal diva divalent divan dive diverge divergent diverse diversify diversion diversionary divert divest divestiture divide dividend divination divine divisible division divisional divisive divisor divorce divorcee divulge Dixie dixieland Dixon dizzy Djakarta DNA Dnieper do Dobbin Dobbs doberman dobson docile dock docket dockside dockyard doctor doctoral doctorate doctrinaire doctrinal doctrine document documentary documentation DOD Dodd dodecahedra dodecahedral dodecahedron dodge Dodson doe doesn't doff dog dogbane dogberry Doge dogfish dogging doggone doghouse dogleg dogma dogmatic dogmatism dogtooth dogtrot dogwood Doherty Dolan dolce doldrum dole doleful doll dollar dolly dolomite dolomitic Dolores dolphin dolt doltish domain dome Domenico Domesday domestic domicile dominant dominate domineer Domingo Dominic Dominican Dominick dominion Dominique domino don don't Donahue Donald Donaldson donate done Doneck donkey Donna Donnelly Donner donning donnybrook donor Donovan doodle Dooley Doolittle doom doomsday door doorbell doorkeep doorkeeper doorknob doorman doormen doorstep doorway dopant dope Doppler Dora Dorado Dorcas Dorchester Doreen Doria Doric Doris dormant dormitory Dorothea Dorothy Dorset dosage dose dosimeter dossier Dostoevsky dot dote dotting double Doubleday doubleheader doublet doubleton doubloon doubt doubtful douce Doug dough Dougherty doughnut Douglas Douglass dour douse dove dovekie dovetail Dow dowager dowel dowitcher Dowling down downbeat downcast downdraft Downey downfall downgrade downhill Downing downplay downpour downright Downs downside downslope downspout downstairs downstream downtown downtrend downtrodden downturn downward downwind dowry Doyle doze dozen Dr drab Draco draft draftee draftsman draftsmen draftsperson drafty drag dragging dragnet dragon dragonfly dragonhead dragoon drain drainage drake dram drama dramatic dramatist dramaturgy drank drape drapery drastic draw drawback drawbridge drawl drawn dread dreadful dreadnought dream dreamboat dreamlike dreamt dreamy dreary dredge dreg drench dress dressmake dressy drew Drexel Dreyfuss drib dribble dried drier drift drill drink drip dripping drippy Driscoll drive driven driveway drizzle drizzly droll dromedary drone drool droop droopy drop drophead droplet dropout dropping drosophila dross drought drove drown drowse drowsy drub drubbing drudge drudgery drug drugging drugstore druid drum drumhead drumlin drumming Drummond drunk drunkard drunken Drury dry dryad Dryden du dual dualism Duane dub Dubhe dubious dubitable Dublin ducat duchess duck duckling duct ductile ductwork dud Dudley due duel duet duff duffel Duffy dug Dugan dugout duke dulcet dull dully dulse Duluth duly Duma dumb dumbbell dummy dump Dumpty dumpy dun Dunbar Duncan dunce dune Dunedin dung dungeon Dunham dunk Dunkirk Dunlap Dunlop Dunn duopolist duopoly dupe duplex duplicable duplicate duplicity DuPont durable Durango duration Durer duress Durham during Durkee Durkin Durrell Durward Dusenberg Dusenbury dusk dusky Dusseldorf dust dustbin dusty Dutch dutchess Dutchman Dutchmen dutiable dutiful Dutton duty dwarf dwarves dwell dwelt Dwight dwindle Dwyer dyad dyadic dye dyer dying Dyke Dylan dynamic dynamism dynamite dynamo dynast dynastic dynasty dyne dysentery dyspeptic dysplasia dysprosium dystrophy e e'er e's each Eagan eager eagle ear eardrum earl earmark earn earnest earphone earring earsplitting earth earthen earthenware earthmen earthmover earthmoving earthquake earthworm earth((y earwig ease easel east eastbound eastern easternmost Eastland Eastman eastward Eastwood easy easygoing eat eaten eater Eaton eave eavesdrop eavesdropping ebb Eben ebony ebullient eccentric Eccles ecclesiastic echelon echinoderm echo echoes eclat eclectic eclipse ecliptic eclogue Ecole ecology econometric Econometrica economic economist economy ecosystem ecstasy ecstatic Ecuador ecumenic ecumenist Ed Eddie eddy edelweiss edematous Eden Edgar edge Edgerton edgewise edging edgy edible edict edifice edify Edinburgh Edison edit Edith edition editor editorial Edmonds Edmondson Edmonton Edmund Edna EDT educable educate Edward Edwardian Edwards Edwin Edwina eel eelgrass EEOC eerie eerily efface effaceable effect effectual effectuate effeminate efferent effete efficacious efficacy efficient Effie effloresce efflorescent effluent effluvia effluvium effort effusive eft egalitarian Egan egg egghead eggplant eggshell ego egocentric egotism egotist egregious egress egret Egypt Egyptian eh Ehrlich eider eidetic eigenfunction eigenstate eigenvalue eigenvector eight eighteen eighteenth eightfold eighth eightieth eighty Eileen Einstein Einsteinian einsteinium Eire Eisenhower Eisner either ejaculate eject ejector eke Ekstrom Ektachrome el elaborate Elaine elan elapse elastic elastomer elate Elba elbow elder eldest Eldon Eleanor Eleazar elect elector electoral electorate Electra electress electret electric electrician electrify electro electrocardiogram electrocardiograph electrode electroencephalogram electroencephalograph electroencephalography electrolysis electrolyte electrolytic electron electronic electrophoresis electrophorus elegant elegiac elegy element elementary Elena elephant elephantine elevate eleven eleventh elfin Elgin Eli elicit elide eligible Elijah eliminate Elinor Eliot Elisabeth Elisha elision elite Elizabeth Elizabethan elk Elkhart ell Ella Ellen Elliott ellipse ellipsis ellipsoid ellipsoidal ellipsometer ellipsometry elliptic Ellis Ellison Ellsworth Ellwood elm Elmer Elmhurst Elmira Elmsford Eloise elongate elope eloquent else Elsevier elsewhere Elsie Elsinore Elton eluate elucidate elude elusive elute elution elves Ely Elysee elysian em emaciate emanate emancipate Emanuel emasculate embalm embank embarcadero embargo embargoes embark embarrass embassy embattle embed embedded embedder embedding embellish ember embezzle emblematic embodiment embody embolden emboss embouchure embower embrace embraceable embrittle embroider embroidery embroil embryo embryonic emcee emendable emerald emerge emergent emeritus Emerson Emery emigrant emigrate Emil Emile Emilio Emily eminent emirate emissary emission emissivity emit emittance emitted emitter emitting emma Emmanuel Emmett emolument Emory emotion emotional empathy emperor emphases emphasis emphatic emphysema emphysematous empire empiric emplace employ employed employee employer employing emporium empower empress empty emulate emulsify emulsion en enact enamel encamp encapsulate encase encephalitis enchain enchant enchantress encipher encircle enclave enclose enclosure encode encomia encomium encompass encore encounter encourage encroach encrust encrypt encryption encumber encumbrance encyclical encyclopedic end endanger endear endgame Endicott endogamous endogamy endogenous endorse endosperm endothelial endothermic endow endpoint endurance endure enemy energetic energy enervate enfant enfeeble Enfield enforce enforceable enforcible enfranchise Eng engage Engel engender engine engineer England Englander Engle Englewood English Englishman Englishmen engrave engross engulf enhance Enid enigma enigmatic enjoin enjoinder enjoy enlarge enlargeable enlighten enlist enliven enmesh enmity Enoch enormity enormous Enos enough enquire enquiry enrage enrapture enrich Enrico enroll enrollee ensconce ensemble enshroud ensign enslave ensnare enstatite ensue ensure entail entangle entendre enter enterprise entertain enthalpy enthrall enthrone enthusiasm enthusiast enthusiastic entice entire entirety entitle entity entomb entomology entourage entrain entrance entranceway entrant entrap entrapping entreat entreaty entree entrench entrepreneur entrepreneurial entropy entrust entry entwine enumerable enumerate enunciable enunciate envelop envelope envenom enviable envious environ envisage envision envoy envy enzymatic enzyme enzymology Eocene eohippus eosine EPA epaulet ephemeral ephemerides ephemeris Ephesian Ephesus Ephraim epic epicure Epicurean epicycle epicyclic epidemic epidemiology epidermic epidermis epigenetic epigram epigrammatic epigraph epileptic epilogue Epiphany epiphyseal epiphysis episcopal Episcopalian episcopate episode epistemology epistle epistolatory epitaph epitaxial epitaxy epithelial epithelium epithet epitome epoch epoxy epsilon Epsom Epstein equable equal equanimity equate equatorial equestrian equidistant equilateral equilibrate equilibria equilibrium equine equinoctial equinox equip equipoise equipotent equipped equipping equitable equitation equity equivalent equivocal era eradicable eradicate erasable erase Erasmus Erastus erasure Erato Eratosthenes erbium ERDA ere erect erg ergodic Eric Erich Erickson Ericsson Erie Erlenmeyer Ernest Ernestine Ernie Ernst erode erodible Eros erosible erosion erosive erotic erotica err errancy errand errant errantry errata erratic erratum Errol erroneous error ersatz Erskine erudite erudition erupt eruption Ervin Erwin escadrille escalate escapade escape escapee escheat eschew escort escritoire escrow escutcheon Eskimo Esmark esophagi esoteric especial espionage esplanade Esposito espousal espouse esprit esquire essay Essen essence essential Essex EST establish estate esteem Estella ester Estes Esther estimable estimate estop estoppal estrange estuarine estuary et eta etc etch eternal eternity Ethan ethane ethanol Ethel ether ethereal ethic Ethiopia ethnic ethnography ethnology ethology ethos ethyl ethylene etiology etiquette Etruscan etude etymology eucalyptus Eucharist Euclid Euclidean eucre Eugene Eugenia eugenic Euler Eulerian eulogy Eumenides Eunice euphemism euphemist euphorbia euphoria euphoric Euphrates Eurasia eureka Euridyce Euripides Europa Europe European europium Eurydice eutectic Euterpe euthanasia Eva evacuate evade evaluable evaluate evanescent evangel evangelic Evans Evanston Evansville evaporate evasion evasive eve Evelyn even evenhanded evensong event eventful eventide eventual eventuate Eveready Everett Everglades evergreen Everhart everlasting every everybody everyday everyman everyone everything everywhere evict evident evidential evil evildoer evince evocable evocate evoke evolution evolutionary evolve evzone ewe Ewing exacerbate exact exaggerate exalt exaltation exam examination examine example exasperate exasperater excavate exceed excel excelled excellent excelling excelsior except exception exceptional excerpt excess excessive exchange exchangeable exchequer excisable excise excision excitation excitatory excite exciton exclaim exclamation exclamatory exclude exclusion exclusionary exclusive excommunicate excoriate excrescent excresence excrete excretion excretory excruciate exculpatory excursion excursus excusable excuse execrable execrate execute execution executive executor executrix exegesis exegete exemplar exemplary exemplify exempt exemption exercisable exercise exert Exeter exhale exhaust exhaustible exhaustion exhaustive exhibit exhibition exhibitor exhilarate exhort exhortation exhumation exhume exigent exile exist existent existential exit exodus exogamous exogamy exogenous exonerate exorbitant exorcise exorcism exorcist exoskeleton exothermic exotic exotica expand expanse expansible expansion expansive expatiate expect expectant expectation expectorant expectorate expedient expedite expedition expeditious expel expellable expelled expelling expend expenditure expense expensive experience experiential experiment experimentation expert expertise expiable expiate expiration expire explain explanation explanatory expletive explicable explicate explicit explode exploit exploitation exploration exploratory explore explosion explosive exponent exponential exponentiate export exportation expose exposit exposition expositor expository exposure expound express expressible expression expressive expressway expropriate expulsion expunge expurgate exquisite extant extemporaneous extempore extend extendible extensible extension extensive extensor extent extenuate exterior exterminate external extinct extinguish extirpate extol extolled extoller extolling extort extra extracellular extract extractor extraditable extralegal extramarital extraneous extraordinary extrapolate extraterrestrial extravagant extravaganza extrema extremal extreme extremum extricable extricate extrinsic extroversion extrovert extrude extrusion extrusive exuberant exudation exude exult exultant exultation Exxon eye eyeball eyebright eyebrow eyed eyeful eyeglass eyelash eyelet eyelid eyepiece eyesight eyewitness Ezekiel Ezra f f's FAA Faber Fabian fable fabric fabricate fabulous facade face faceplate facet facetious facial facile facilitate facsimile fact factious facto factor factorial factory factual faculty fad fade fadeout faery Fafnir fag Fahey Fahrenheit fail failsoft failure fain faint fair Fairchild Fairfax Fairfield fairgoer Fairport fairway fairy faith faithful fake falcon falconry fall fallacious fallacy fallen fallible falloff fallout fallow Falmouth false falsehood falsify Falstaff falter fame familial familiar familiarly familism family famine famous fan fanatic fanciful fancy fanfare fanfold fang fangled fanning Fanny fanout fantasia fantasist fantastic fantasy fantod far farad Faraday Farber farce farcical fare farewell farfetched Fargo farina Farkas Farley farm farmhouse Farmington farmland Farnsworth faro Farrell farsighted farther farthest fascicle fasciculate fascinate fascism fascist fashion fast fasten fastidious fat fatal fate fateful father fathom fatigue Fatima fatten fatty fatuous faucet Faulkner fault faulty faun fauna Faust Faustian Faustus fawn fay Fayette Fayetteville faze FBI FCC FDA Fe fealty fear fearful fearsome feasible feast feat feather featherbed featherbedding featherbrain feathertop featherweight feathery feature Feb febrile ((February fecund fed Fedders federal federate Fedora fee feeble feed feedback feel Feeney feet feign feint Feldman feldspar Felice Felicia felicitous felicity feline Felix fell fellow felon felonious felony felsite felt female feminine feminism feminist femur fence fencepost fend fennel Fenton fenugreek Ferber Ferdinand Ferguson Fermat ferment fermentation Fermi fermion fermium fern Fernando fernery ferocious ferocity Ferrer ferret ferric ferris ferrite ferroelectric ferromagnet ferromagnetic ferromagnetism ferrous ferruginous ferrule ferry fertile fervent fescue fest festival festive fetal fetch fete fetid fetish fetter fettle fetus feud feudal feudatory fever feverish few fiance fiancee fiasco fiat fib fibbing fiberboard Fiberglas Fibonacci fibrin fibrosis fibrous fiche fickle fiction fictitious fictive fiddle fiddlestick fide fidelity fidget fiducial fief fiefdom field Fields fieldstone fieldwork fiend fiendish fierce fiery fiesta fife FIFO fifteen fifteenth fifth fiftieth fifty fig figaro fight figural figurate figure figurine filament filamentary filbert filch file filet filial filibuster filigree Filipino fill filled filler fillet fillip filly film filmdom filmmake filmstrip filmy filter filth filthy filtrate fin final finale finance financial financier finch find fine finesse finessed finessing finger fingernail fingerprint fingertip finial finicky finish finite fink Finland Finley Finn Finnegan Finnish finny fir fire firearm fireboat firebreak firebug firecracker firefly firehouse firelight fireman firemen fireplace firepower fireproof fireside Firestone firewall firewood firework firm first firsthand fiscal Fischbein Fischer fish fisherman fishermen fishery fishmonger fishpond fishy Fisk Fiske fissile fission fissure fist fisticuff fit Fitch Fitchburg fitful fitting Fitzgerald Fitzpatrick Fitzroy five fivefold fix fixate fixture Fizeau fizzle fjord flabbergast flack flag flagellate flageolet flagging Flagler flagpole flagrant Flagstaff flagstone flail flair flak flake flaky flam flamboyant flame flamingo flammable Flanagan Flanders flange flank flannel flap flapping flare flash flashback flashlight flashy flask flat flatbed flathead flatiron flatland flatten flattery flatulent flatus flatworm flaunt flautist flaw flax flaxen flaxseed flea fleabane fleawort fleck fled fledge fledgling flee fleece fleeing fleet Fleming flemish flesh fleshy fletch Fletcher flew flex flexible flexural flexure flick flier flight flimsy flinch fling flint flintlock flinty flip flipflop flippant flipping flirt flirtation flirtatious flit flitting Flo float floc flocculate flock floe flog flogging flood floodgate floodlight floodlit floor floorboard flop flopping floppy flora floral Florence Florentine florican florid Florida Floridian florin florist flotation flotilla flounce flounder flour flourish floury flout flow flowchart flowerpot flowery flown Floyd flu flub flubbing fluctuate flue fluency fluent fluff fluffy fluid fluke flung fluoresce fluorescein fluorescent fluoridate fluoride fluorine fluorite fluorocarbon fluorspar flurry flush fluster flute flutter flux fly flycatcher flyer Flynn flyway FM FMC foal foam foamflower foamy fob fobbing focal foci focus focussed fodder foe fog fogging foggy fogy foible foil foist fold foldout Foley foliage foliate folio folk folklore folksong folksy follicle follicular follow followeth folly Fomalhaut fond fondle fondly font Fontaine Fontainebleau food foodstuff fool foolhardy foolish foolproof foot footage football footbridge Foote footfall foothill footman footmen footnote footpad footpath footprint footstep footstool footwear footwork fop foppish for forage foray forbade forbear forbearance Forbes forbid forbidden forbidding forbore forborne force forceful forcible ford Fordham fore foreign forensic forest forestry forever forfeit forfeiture forfend forgave forge forgery forget forgetful forgettable forgetting forgive forgiven forgot forgotten fork forklift forlorn form formal formaldehyde formant format formate formatting formic Formica formidable Formosa formula formulae formulaic formulate Forrest forsake forsaken forsook forswear Forsythe fort forte Fortescue forth forthcome forthright forthwith fortieth fortify fortin fortiori fortitude fortnight Fortran fortress fortunate fortune forty forum forward Foss fossil fossiliferous foster fosterite fought foul foulmouth found foundation foundling foundry fount fountain fountainhead four fourfold Fourier foursome foursquare fourteen fourteenth fourth fovea fowl fox foxglove Foxhall foxhole foxhound foxtail foxy foyer FPC fraction fractionate fractious fracture fragile fragment fragmentary fragmentation fragrant frail frailty frambesia frame framework franc franca France Frances franchise Francis Franciscan Francisco francium franco frangipani frank Frankfort Frankfurt frankfurter franklin frantic Franz Fraser fraternal fraternity Frau fraud fraudulent fraught fray frayed Frazier frazzle freak freakish freckle Fred Freddie Freddy Frederic Frederick Fredericks Fredericksburg Fredericton Fredholm Fredrickson free freeboot freed Freedman freedmen freedom freehand freehold freeing freeman freemen Freeport freer freest freestone freethink Freetown freeway freewheel freeze freight French Frenchman Frenchmen frenetic frenzy freon frequent fresco frescoes fresh freshen freshman freshmen freshwater Fresnel Fresno fret fretting Freud Freudian Frey Freya friable friar fricative Frick friction frictional Friday fried Friedman friend frieze frigate Frigga fright frighten frightful frigid Frigidaire frill frilly fringe frisky fritillary fritter Fritz frivolity frivolous frizzle fro frock frog frolic from front frontage frontal frontier frontiersman frontiersmen frost frostbite frostbitten frosty froth frothy frown frowzy froze frozen Fruehauf frugal fruit fruitful fruition frustrate frustrater frustum fry Frye FTC Fuchs Fuchsia fudge fuel fugal fugitive fugue Fuji Fujitsu fulcrum fulfill full fullback Fullerton fully fulminate fulsome Fulton fum fumble fume fumigant fumigate fun function functionary functor fund fundamental funeral funereal fungal fungi fungible fungicide fungoid fungus funk funnel funny fur furbish furious furl furlong furlough Furman furnace furnish furniture furrier furring furrow furry further furthermore furthermost furthest furtive fury furze fuse fuselage fusible fusiform fusillade fusion fuss fussy fusty futile future fuzz fuzzy g g's gab gabardine gabbing gabble gabbro Gaberones gable Gabon Gabriel Gabrielle gad gadding gadfly gadget gadgetry gadolinium gadwall Gaelic gaff gaffe gag gage gagging gaggle gagwriter gaiety Gail gaillardia gain Gaines Gainesville gainful gait Gaithersburg gal gala galactic Galapagos Galatea Galatia galaxy Galbreath gale Galen galena galenite Galilee gall Gallagher gallant gallantry gallberry gallery galley gallinule gallium gallivant gallon gallonage gallop Galloway gallows gallstone Gallup gallus Galois Galt galvanic galvanism galvanometer Galveston Galway gam Gambia gambit gamble gambol game gamecock gamin gamma gamut gander gang Ganges gangland gangling ganglion gangplank gangster gangway gannet Gannett gantlet gantry Ganymede GAO gap gape gar garage garb garbage garble Garcia garden gardenia Gardner Garfield gargantuan gargle Garibaldi garish garland garlic garner garnet Garrett garrison Garrisonian garrulous Garry garter Garth Garvey Gary gas Gascony gaseous gash gasify gasket gaslight gasoline gasp Gaspee gassing gassy Gaston gastrointestinal gastronome gastronomy gate Gates gateway gather Gatlinburg gator gauche gaucherie gaudy gauge gaugeable Gauguin Gaul gauleiter Gaulle gaunt gauntlet gaur gauss Gaussian gauze gave gavel Gavin gavotte gawk gawky gay Gaylord gaze gazelle gazette GE gear gecko gee geese Gegenschein Geiger Geigy geisha gel gelable gelatin gelatine gelatinous geld gem Gemini gemlike Gemma gender gene genealogy genera general generate generic generosity generous Genesco genesis genetic Geneva Genevieve genial genie genii genius Genoa genotype genre gent genteel gentian gentile gentility gentle gentleman gentlemen gentry genuine genus geocentric geochemical geochemistry geochronology geodesic geodesy geodetic geoduck Geoffrey geographer geography geology geometer geometric geometrician geometry geophysical geophysics geopolitic George Georgetown Georgia Gerald Geraldine geranium Gerard Gerber gerbil Gerhard Gerhardt geriatric germ German germane Germanic germanium Germantown Germany germicidal germicide germinal germinate Gerry Gershwin Gertrude gerund gerundial gerundive gestalt Gestapo gesticulate gesture get getaway getting Getty Gettysburg geyser Ghana ghastly Ghent gherkin ghetto ghost ghostlike ghostly ghoul ghoulish Giacomo giant giantess gibberish gibbet gibbon Gibbons gibbous Gibbs gibby gibe giblet Gibraltar Gibson giddap giddy Gideon Gifford gift gig gigacycle gigahertz gigantic gigavolt gigawatt gigging giggle Gil gila gilbert Gilbertson Gilchrist gild Gilead Giles gill Gillespie Gillette Gilligan Gilmore gilt gimbal Gimbel gimpy gin Gina ginger gingham gingko ginkgo ginmill Ginn ginning Gino Ginsberg Ginsburg ginseng Giovanni giraffe gird girdle girl girlie girlish girth gist Giuliano Giuseppe give giveaway given giveth glacial glaciate glacier glacis glad gladden gladdy glade gladiator gladiolus Gladstone Gladys glamor glamorous glamour glance gland glandular glare Glasgow glass glassine glassware glasswort glassy Glaswegian glaucoma glaucous glaze gleam glean Gleason glee gleeful glen Glenda Glendale Glenn glib Glidden glide glimmer glimpse glint glissade glisten glitch glitter gloat glob global globe globular globule globulin glom glomerular gloom gloomy Gloria Gloriana glorify glorious glory gloss glossary glossed glossolalia glossy glottal glottis Gloucester glove glow glue glued gluey gluing glum glut glutamic glutinous glutting glutton glyceride glycerin glycerinate glycerine glycerol glycol glyph GM GMT gnarl gnash gnat gnaw gneiss gnome gnomon gnomonic gnostic GNP gnu go Goa goad goal goat gob gobble gobbledygook goblet god Goddard goddess godfather Godfrey godhead godkin godlike godmother godparent godsend godson Godwin godwit goer goes Goethe Goff gog goggle Gogh gogo gold Goldberg go((lden goldeneye goldenrod goldenseal goldfinch goldfish Goldman goldsmith Goldstein Goldstine Goldwater Goleta golf Goliath golly gondola gone gong Gonzales Gonzalez goober good Goode Goodman Goodrich goodwill Goodwin goody Goodyear goof goofy goose gooseberry GOP gopher Gordian Gordon gore Goren gorge gorgeous gorgon Gorham gorilla Gorky gorse Gorton gory gosh goshawk gosling gospel gossamer gossip got Gotham Gothic gotten Gottfried gouge Gould gourd gourmet gout govern governance governess governor gown GPO grab grabbing grace graceful gracious grackle grad gradate grade gradient gradual graduate Grady Graff graft graham grail grain grammar grammarian grammatic granary grand grandchild grandchildren granddaughter grandeur grandfather grandiloquent grandiose grandma grandmother grandnephew grandniece grandpa grandparent grandson grandstand granite granitic granny granola grant grantee grantor granular granulate granule Granville grape grapefruit grapevine graph grapheme graphic graphite grapple grasp grass grassland grassy grata grate grateful grater gratify gratis gratitude gratuitous gratuity grave gravel graven Graves gravestone graveyard gravid gravitate gravy gray graybeard Grayson graywacke graze grease greasy great greatcoat greater grebe Grecian Greece greed greedy Greek green Greenbelt Greenberg Greenblatt Greenbriar Greene greenery Greenfield greengrocer greenhouse greenish Greenland Greensboro greensward greenware Greenwich greenwood Greer greet Greg gregarious Gregg Gregory grenade Grendel Grenoble Gresham Greta Gretchen grew grey greyhound greylag grid griddle gridiron grief grievance grieve grievous griffin Griffith grill grille grilled grillwork grim grimace Grimaldi grime Grimes Grimm grin grind grindstone grinning grip gripe grippe gripping grisly grist gristmill Griswold grit gritty grizzle grizzly groan groat grocer grocery groggy groin grommet groom groove grope grosbeak gross Grosset Grossman Grosvenor grotesque Groton ground groundsel groundskeep groundwork group grout grove grovel Grover grow growl grown grownup growth grub grubbing grubby grudge gruesome gruff grumble Grumman grunt gryphon GSA Guam guanidine guano guarantee guaranteeing guaranty guard guardhouse Guardia guardian Guatemala gubernatorial Guenther guerdon guernsey guerrilla guess guesswork guest guffaw Guggenheim Guiana guidance guide guidebook guideline guidepost guiding guignol guild guildhall guile Guilford guillemot guilt guilty guinea guise guitar gules gulf gull Gullah gullet gullible gully gulp gum gumbo gumming gummy gumption gumshoe gun Gunderson gunfight gunfire gunflint gunk gunky gunman gunmen gunnery gunning gunny gunplay gunpowder gunshot gunsling Gunther gurgle Gurkha guru Gus gush gusset gust Gustafson Gustav Gustave Gustavus gusto gusty gut Gutenberg Guthrie gutsy gutting guttural guy Guyana guzzle Gwen Gwyn gym gymnasium gymnast gymnastic gymnosperm gyp gypping gypsite gypsum gypsy gyrate gyrfalcon gyro gyrocompass gyroscope h h's ha Haag Haas habeas haberdashery Haberman Habib habit habitant habitat habitation habitual habituate hacienda hack hackberry Hackett hackle hackmatack hackney hackneyed hacksaw had Hadamard Haddad haddock Hades Hadley hadn't Hadrian hadron hafnium Hagen Hager haggard haggle Hagstrom Hague Hahn Haifa haiku hail hailstone hailstorm Haines hair haircut hairdo hairpin hairy Haiti Haitian Hal halcyon hale Haley half halfback halfhearted halfway halibut halide Halifax halite hall hallelujah Halley hallmark hallow Halloween hallucinate hallway halma halo halocarbon halogen Halsey Halstead halt halvah halve Halverson ham Hamal Hamburg hamburger Hamilton Hamiltonian hamlet Hamlin hammerhead hamming hammock Hammond hamper Hampshire Hampton hamster Han Hancock hand handbag handbook handclasp handcuff Handel handful handgun handhold handicap handicapped handicapper handicapping handicraft handicraftsman handicraftsmen handiwork handkerchief handle handleable handlebar handline handmade handmaiden handout handset handshake handsome handspike handstand handwrite handwritten handy handyman handymen Haney Hanford hang hangable hangar hangman hangmen hangout hangover hank Hankel Hanley Hanlon Hanna Hannah Hannibal Hanoi Hanover Hanoverian Hans Hansel Hansen hansom Hanson Hanukkah hap haphazard happen happenstance happy harangue harass Harbin harbinger Harcourt hard hardbake hardboard hardboiled harden hardhat Hardin Harding hardscrabble hardtack hardtop hardware hardwood hardworking hardy hare harelip harem hark Harlan Harlem Harley harm harmful Harmon harmonic harmonious harmony harness Harold harp harpsichord Harpy Harriet Harriman Harrington Harris Harrisburg Harrison harrow harry harsh harshen hart Hartford Hartley Hartman Harvard harvest harvestman Harvey hash hashish hasn't hasp hassle hast haste hasten Hastings hasty hat hatch hatchet hatchway hate hateful hater Hatfield hath Hathaway hatred Hatteras Hattie Haugen haughty haul haulage haunch haunt Havana have haven haven't Havilland havoc haw Hawaii Hawaiian hawk Hawkins Hawley hawthorn Hawthorne hay Hayden Haydn Hayes hayfield Haynes Hays haystack hayward hazard hazardous haze hazel hazelnut hazy he he'd he'll head headache headboard headdress headland headlight headline headmaster headphone headquarter headroom headset headsman headsmen headstand headstone headwall headwater headway heady heal Healey health healthful healthy Healy heap hear heard hearken hearsay hearse Hearst heart heartbeat heartbreak hearten heartfelt hearth hearty heat heater heath heathen heathenish Heathkit heave heaven heavenward heavy heavyweight Hebe hebephrenic Hebraic Hebrew Hecate hecatomb heck heckle Heckman hectic hector Hecuba hedge hedgehog hedonism hedonist heed heel heft hefty Hegelian hegemony Heidelberg heigh height heighten Heine Heinz heir heiress Heisenberg held Helen Helena Helene helical helicopter heliocentric heliotrope helium helix hell hellbender hellebore Hellenic hellfire hellgrammite hellish hello helm helmet Helmholtz helmsman helmsmen Helmut help helpful helpmate Helsinki Helvetica hem hematite Hemingway hemisphere hemispheric hemlock hemming hemoglobin hemolytic hemorrhage hemorrhoid hemosiderin hemp Hempstead hen henbane hence henceforth henchman henchmen Henderson Hendrick Hendricks Hendrickson henequen Henley Henning henpeck Henri Henrietta henry hepatica hepatitis Hepburn heptane her Hera Heraclitus herald herb Herbert Herculean Hercules herd herdsman here hereabout hereafter hereby hereditary heredity Hereford herein hereinabove hereinafter hereinbelow hereof heresy heretic hereto heretofore hereunder hereunto herewith heritable heritage Herkimer Herman hermeneutic Hermes hermetic Hermite hermitian Hermosa hero Herodotus heroes heroic heroin heroine heroism heron herpes herpetology Herr herring herringbone Herschel herself Hershel Hershey hertz Hertzog hesitant hesitate hesitater Hesperus Hess Hessian Hester heterodyne heterogamous heterogeneity heterogeneous heterosexual heterostructure heterozygous Hetman Hettie Hetty Heublein heuristic Heusen Heuser hew Hewett Hewitt Hewlett hewn hex hexachloride hexadecimal hexafluoride hexagon hexagonal hexameter hexane hey heyday hi Hiatt Hiawatha hibachi Hibbard hibernate Hibernia hick Hickey Hickman hickory Hicks hid hidalgo hidden hide hideaway hideous hideout hierarchal hierarchic hierarchy hieratic hieroglyphic Hieronymus hifalutin Higgins high highball highboy highest highfalutin highhanded highland highlight highroad hightail highway highwayman highwaymen hijack hike hilarious hilarity Hilbert Hildebrand hill hillbilly Hillcrest Hillel hillman hillmen hillside hilltop hilly hilt Hilton hilum him Himalaya himself hind hindmost hindrance hindsight Hindu Hinduism Hines hinge Hinman hint hinterland hip hipping hippo hippodrome hippopotamus hippy hipster Hiram hire hireling Hiroshi Hiroshima Hirsch his hiss histochemic histochemistry histogram histology historian historic historiography history histrionic hit Hitachi hitch Hitchcock hither hitherto Hitler hitting hive ho hoagie Hoagland hoagy hoar hoard hoarfrost hoarse hob Hobart Hobbes hobble Hobbs hobby hobbyhorse hobo Hoboken hoc hock hockey hodge hodgepodge Hodges Hodgkin hoe Hoff Hoffman hog hogan hogging hoi Hokan Holbrook Holcomb hold holden holdover holdup hole holeable holiday Holland Hollandaise holler Hollerith Hollingsworth Hollister hollow Holloway hollowware holly hollyhock Hollywood Holm Holman Holmdel Holmes holmium holocaust Holocene hologram holography Holst Holstein holster holt Holyoke holystone homage home homebound homebuilder homebuilding homecoming homeland homemade homemake homeomorph homeomorphic homeopath homeowner Homeric homesick homestead homeward homework homicidal homicide homily homo homogenate homogeneity homogeneous homologous homologue homology homomorphic homomorphism homonym homosexual homotopy homozygous Honda hondo Honduras hone honest honesty honey honeybee honeycomb honeydew honeymoon honeysuckle Honeywell hong honk Honolulu honorarium honorary honoree Honshu hooch hood hoodlum hoof hoofmark hook hookup hookworm hooligan hoop hoopla hoosegow Hoosier hoot Hoover hooves hop hope hopeful Hopkins Hopkinsian hopping hopple hopscotch Horace Horatio horde horehound horizon horizontal hormone horn hornbeam hornblende Hornblower hornet hornmouth horntail hornwort horny horology horoscope Horowitz horrendous horrible horrid horrify horror horse horseback horsedom horseflesh horsefly horsehair horselike horseman horsemen horseplay horsepower horseshoe horsetail horsewoman horsewomen horticulture Horton Horus hose hosiery hospice hospitable hospital host hostage hostelry hostess hostile hostler hot hotbed hotbox hotel hotelman hothead hothouse hotrod Houdaille Houdini hough Houghton hound hour hourglass house houseboat housebreak housebroken housefly household housekeep housewife housewives housework Houston hove hovel hover how Howard howdy Howe Howell however howl howsoever howsomever hoy hoyden hoydenish Hoyt Hrothgar hub Hubbard Hubbell hubbub hubby Huber Hubert huck huckleberry huckster huddle Hudson hue hued huff Huffman hug huge hugging Huggins Hugh Hughes Hugo huh hulk hull hum human humane humanitarian humble Humboldt humerus humid hum((idify humidistat humiliate humility Hummel humming hummingbird hummock humorous hump humpback Humphrey humpty humus Hun hunch hundred hundredfold hundredth hung Hungarian Hungary hungry hunk hunt Hunter Huntington Huntley Huntsville Hurd hurdle hurl hurley Huron hurrah hurray hurricane hurry Hurst hurt hurtle hurty Hurwitz husband husbandman husbandmen husbandry hush husky hustle Huston hut hutch Hutchins Hutchinson Hutchison Huxley Huxtable huzzah hyacinth Hyades hyaline Hyannis hybrid Hyde hydra hydrangea hydrant hydrate hydraulic hydride hydro hydrocarbon hydrochemistry hydrochloric hydrochloride hydrodynamic hydroelectric hydrofluoric hydrogen hydrogenate hydrology hydrolysis hydrometer hydrophilic hydrophobia hydrophobic hydrosphere hydrostatic hydrothermal hydrous hydroxide hydroxy hydroxyl hydroxylate hyena hygiene hygrometer hygroscopic hying hymen hymn hymnal hyperbola hyperbolic hyperboloid hyperboloidal hypertensive hyphen hyphenate hypnosis hypnotic hypoactive hypocrisy hypocrite hypocritic hypocycloid hypodermic hypophyseal hypotenuse hypothalamic hypothalamus hypotheses hypothesis hypothetic hypothyroid hysterectomy hysteresis hysteria hysteric hysteron i I'd I'll I'm i's I've iambic Iberia ibex ibid ibis IBM Ibn Icarus ICC ice iceberg icebox iceland Icelandic ichneumon icicle icing icon iconoclasm iconoclast icosahedra icosahedral icosahedron icy Ida Idaho idea ideal ideate idempotent identical identify identity ideology idiocy idiom idiomatic idiosyncrasy idiosyncratic idiot idiotic idle idol idolatry idyll idyllic IEEE if iffy Ifni igloo igneous ignite ignition ignoble ignominious ignoramus ignorant ignore ii iii Ike ileum iliac Iliad ill illegal illegible illegitimacy illegitimate illicit illimitable Illinois illiteracy illiterate illogic illume illuminate illumine illusion illusionary illusive illusory illustrate illustrious Ilona Ilyushin image imagery imaginary imaginate imagine imbalance imbecile imbibe Imbrium imbroglio imbrue imbue imitable imitate immaculate immanent immaterial immature immeasurable immediacy immediate immemorial immense immerse immersion immigrant immigrate imminent immobile immobility immoderate immodest immodesty immoral immortal immovable immune immunization immunoelectrophoresis immutable imp impact impair impale impalpable impart impartation impartial impassable impasse impassion impassive impatient impeach impeccable impedance impede impediment impel impelled impeller impelling impend impenetrable imperate imperceivable imperceptible imperfect imperial imperil imperious imperishable impermeable impermissible impersonal impersonate impertinent imperturbable impervious impetuous impetus impiety impinge impious impish implacable implant implantation implausible implement implementation implementer implementor implicant implicate implicit implore impolite impolitic imponderable import important importation importunate importune impose imposition impossible impost imposture impotent impound impoverish impracticable impractical imprecate imprecise impregnable impregnate impresario impress impressible impression impressive imprimatur imprint imprison improbable impromptu improper impropriety improve improvident improvisate improvise imprudent impudent impugn impulse impulsive impunity impure imputation impute in inability inaccessible inaccuracy inaccurate inaction inactivate inactive inadequacy inadequate inadmissible inadvertent inadvisable inalienable inalterable inane inanimate inappeasable inapplicable inappreciable inapproachable inappropriate inapt inaptitude inarticulate inasmuch inattention inattentive inaudible inaugural inaugurate inauspicious inboard inborn inbred inbreed Inc Inca incalculable incandescent incant incantation incapable incapacitate incapacity incarcerate incarnate incautious incendiary incense incentive inception inceptor incessant incest incestuous inch incident incidental incinerate incipient incise incisive incite inclement inclination incline inclose include inclusion inclusive incoherent incombustible income incommensurable incommensurate incommunicable incommutable incomparable incompatible incompetent incomplete incompletion incomprehensible incomprehension incompressible incomputable inconceivable inconclusive incondensable incongruity incongruous inconsequential inconsiderable inconsiderate inconsistent inconsolable inconspicuous inconstant incontestable incontrollable incontrovertible inconvenient inconvertible incorporable incorporate incorrect incorrigible incorruptible increasable increase incredible incredulity incredulous increment incriminate incubate incubi incubus inculcate inculpable incumbent incur incurred incurrer incurring incursion indebted indecent indecipherable indecision indecisive indecomposable indeed indefatigable indefensible indefinable indefinite indelible indelicate indemnity indent indentation indenture independent indescribable indestructible indeterminable indeterminacy indeterminate index India Indian Indiana Indianapolis indicant indicate indices indict Indies indifferent indigene indigenous indigent indigestible indigestion indignant indignation indignity indigo Indira indirect indiscernible indiscoverable indiscreet indiscretion indiscriminate indispensable indispose indisposition indisputable indissoluble indistinct indistinguishable indium individual individualism individuate indivisible Indochina indoctrinate indolent indomitable Indonesia Indonesian indoor indorse indubitable induce inducible induct inductance inductee inductor indulge indulgent industrial industrialism industrious industry indwell indy ineducable ineffable ineffective ineffectual inefficacy inefficient inelastic inelegant ineligible ineluctable inept inequality inequitable inequity inequivalent ineradicable inert inertance inertia inertial inescapable inestimable inevitable inexact inexcusable inexhaustible inexorable inexpedient inexpensive inexperience inexpert inexpiable inexplainable inexplicable inexplicit inexpressible inextinguishable inextricable infallible infamous infamy infancy infant infantile infantry infantryman infantrymen infarct infatuate infeasible infect infectious infelicitous infelicity infer inference inferential inferior infernal inferno inferred inferring infertile infest infestation infidel infield infighting infiltrate infima infimum infinite infinitesimal infinitive infinitude infinitum infinity infirm infirmary infix inflame inflammable inflammation inflammatory inflate inflater inflect inflexible inflict inflow influence influent influential influenza influx inform informal informant Informatica information informative infra infract infrared infrastructure infrequent infringe infuriate infuse infusible infusion ingather ingenious ingenuity ingenuous Ingersoll ingest ingestible ingestion inglorious ingot Ingram ingrate ingratiate ingratitude ingredient ingrown inhabit inhabitant inhabitation inhalation inhale inharmonious inhere inherent inherit inheritance inheritor inhibit inhibition inhibitor inhibitory inholding inhomogeneity inhomogeneous inhospitable inhuman inhumane inimical inimitable iniquitous iniquity initial initiate inject injudicious Injun injunct injure injurious injury injustice ink inkling inlaid inland inlay inlet Inman inmate inn innards innate inner innermost inning innocent innovate innuendo innumerable inoculate inoperable inoperative inopportune inordinate inorganic input inquest inquire inquiry inquisition inquisitive inquisitor inroad insane insatiable inscribe inscription inscrutable insect insecticide insecure inseminate insensible insensitive inseparable insert inset inshore inside insidious insight insightful insignia insignificant insincere insinuate insipid insist insistent insofar insolent insoluble insolvable insolvent insomnia insomniac insouciant inspect inspector inspiration inspire instable install installation instalment instance instant instantaneous instead instep instigate instill instillation instinct instinctual institute institution instruct instructor instrument instrumentation insubordinate insubstantial insufferable insufficient insular insulate insulin insult insuperable insupportable insuppressible insurance insure insurgent insurmountable insurrect intact intake intangible integer integrable integral integrand integrate integrity integument intellect intellectual intelligent intelligentsia intelligible intemperance intemperate intend intendant intense intensify intensive intent intention inter intercalate intercept interception interceptor intercom interdict interest interfere interference interferometer interferometric interferometry interim interior interject interlude intermediary intermit intermittent intern internal internescine Interpol interpolate interpolatory interpret interpretation interpretive interregnum interrogate interrogatory interrupt interruptible interruption intersect intersperse interstice interstitial interval intervene intervenor intervention interviewee intestate intestine intimacy intimal intimate intimater intimidate into intolerable intolerant intonate intone intoxicant intoxicate intracity intractable intradepartment intramural intramuscular intranasal intransigent intransitive intraoffice intrastate intravenous intrepid intricacy intricate intrigue intrinsic introduce introduction introductory introit introject introspect introversion introvert intrude intrusion intrusive intuitable intuition intuitive inundate inure invade invalid invalidate invaluable invariable invariant invasion invasive invective inveigh inveigle invent invention inventive inventor inventory Inverness inverse inversion invert invertebrate invertible invest investigate investigatory investor inveterate inviable invidious invigorate invincible inviolable inviolate invisible invitation invite invitee invocate invoice invoke involuntary involute involution involutorial involve invulnerable inward Io iodate iodide iodinate iodine ion ionic ionosphere ionospheric iota Iowa ipecac ipsilateral ipso IQ IR Ira Iran Iraq irate ire Ireland Irene iridium iris Irish Irishman Irishmen irk irksome Irma iron ironic ironside ironstone ironwood irony Iroquois irradiate irrational Irrawaddy irreclaimable ((irreconcilable irrecoverable irredeemable irredentism irredentist irreducible irrefutable irregular irrelevancy irrelevant irremediable irremovable irreparable irreplaceable irrepressible irreproachable irreproducible irresistible irresolute irresolution irresolvable irrespective irresponsible irretrievable irreverent irreversible irrevocable irrigate irritable irritant irritate irruption IRS Irvin Irvine Irving Irwin is Isaac Isaacson Isabel Isabella Isaiah isentropic Isfahan Ising isinglass Isis Islam Islamabad Islamic island isle isn't isochronal isochronous isocline isolate Isolde isomer isomorph isomorphic isopleth isotherm isothermal isotope isotopic isotropic isotropy Israel Israeli Israelite issuance issuant issue Istanbul it IT&T it'd it'll Italian italic Italy itch item iterate Ithaca itinerant itinerary Ito itself ITT iv Ivan Ivanhoe Iverson ivory ivy ix Izvestia j j's jab jabbing Jablonsky jack jackanapes jackass jackboot jackdaw jacket Jackie jackknife Jackman jackpot Jackson Jacksonian Jacksonville Jacky JACM Jacob Jacobean Jacobi Jacobian Jacobite Jacobs Jacobsen Jacobson Jacobus Jacqueline Jacques jade Jaeger jag jagging jaguar jail Jakarta jake jalopy jam Jamaica jamboree James Jamestown jamming Jan Jane Janeiro Janet jangle Janice janissary janitor janitorial Janos Jansenist January Janus Japan Japanese jar jargon jarring Jarvin Jason jasper jaundice jaunty Java javelin jaw jawbone jay jazz jazzy jealous jealousy jean Jeannie Jed jeep Jeff Jefferson Jeffersonian Jeffrey Jehovah jejune jejunum jelly jellyfish Jenkins Jennie Jennifer Jennings jenny Jensen jeopard jeopardy Jeremiah Jeremy Jeres Jericho jerk jerky Jeroboam Jerome jerry jersey Jerusalem jess Jesse Jessica Jessie jest Jesuit Jesus jet jetliner jetting jettison Jew jewel Jewell jewelry Jewett Jewish jibe jiffy jig jigging jiggle jigsaw Jill jilt Jim Jimenez Jimmie jimmy jingle jinx jitter jitterbug jittery jive Jo Joan Joanna Joanne Joaquin job jobbing jobholder jock jockey jockstrap jocose jocular jocund Joe Joel joey jog jogging joggle Johann Johannes Johannesburg Johansen Johanson John Johnny Johns Johnsen Johnson Johnston Johnstown join joint joke Joliet Jolla jolly jolt Jon Jonas Jonathan Jones jonquil Jordan Jorge Jorgensen Jorgenson Jose Josef Joseph Josephine Josephson Josephus Joshua Josiah joss jostle jot jotting joule jounce journal journalese journey journeyman journeymen joust Jovanovich Jove jovial Jovian jowl jowly joy Joyce joyful joyous joyride joystick Jr Juan Juanita jubilant jubilate Judaism Judas Judd Jude judge judicable judicatory judicature judicial judiciary judicious Judith judo Judson Judy jug jugate jugging juggle juice juicy juju jujube juke Jukes julep Jules Julia Julie Juliet Julio Julius July jumble jumbo jump jumpy junco junction junctor juncture June Juneau jungle junior juniper junk junkerdom junketeer junky Juno junta Jupiter Jura jure juridic jurisdiction jurisprudent jurisprudential juror jury just justice justiciable justify Justine Justinian jut jute Jutish jutting juvenile juxtapose juxtaposition k k's Kabuki Kabul Kaddish Kafka Kafkaesque Kahn kaiser Kajar Kalamazoo kale kaleidescope kaleidoscope kalmia Kalmuk Kamchatka kamikaze Kampala Kane kangaroo Kankakee Kansas Kant kaolin kaolinite Kaplan kapok kappa Karachi Karamazov karate Karen Karl Karol Karp karyatid Kaskaskia Kate Katharine Katherine Kathleen Kathy Katie Katmandu Katowice Katz Kauffman Kaufman kava Kay kayo kazoo Keaton Keats keddah keel keelson keen Keenan keep keeshond keg Keith Keller Kelley Kellogg kelly kelp Kelsey Kelvin Kemp ken Kendall Kennan Kennecott Kennedy kennel Kenneth Kenney kenning keno Kensington Kent Kenton Kentucky Kenya Kenyon Kepler kept kerchief Kermit kern kernel kerosene Kerr kerry kerygma Kessler kestrel ketch ketchup ketone ketosis Kettering kettle Kevin key keyboard keyed Keyes keyhole Keynes Keynesian keynote keypunch keys keystone keyword khaki khan Khartoum Khmer Khrushchev kibbutzim kibitz kick kickback kickoff kid Kidde kiddie kidding kidnap kidnapping kidney Kieffer Kiev Kiewit Kigali Kikuyu Kilgore kill killdeer killjoy kilobit kilobuck kilobyte kilogauss kilohertz kilohm kilojoule kiloton kilovolt kilowatt kiloword Kim Kimball Kimberly kimono kin kind kindergarten kindle kindred kinematic kinesic kinesthesis kinetic king kingbird kingdom kingfisher kinglet kingpin Kingsbury Kingsley Kingston kink kinky Kinney Kinshasha kiosk Kiowa Kipling Kirby Kirchner Kirchoff kirk Kirkland Kirkpatrick Kirov kiss kissing kit Kitakyushu kitchen kitchenette kite kitten kittenish kittle kitty kiva kivu Kiwanis Klan Klaus klaxon kleenex Klein Kline Klux klystron knack Knapp knapsack Knauer knead knee kneecap kneel knelt knew knick Knickerbocker knife knifelike knight Knightsbridge knit knitting knives knob knobby knock knockdown knockout knoll knot Knott knotting knotty know knoweth knowhow knowledge knowledgeable Knowles Knowlton known Knox Knoxville knuckle knuckleball Knudsen Knudson knurl Knutsen Knutson koala Koch Kochab Kodachrome kodak Kodiak Koenig Koenigsberg kohlrabi koinonia kola kolkhoz kombu Kong Koppers Koran Korea kosher Kowalewski Kowalski kraft Krakatoa Krakow Kramer Krause kraut Kremlin Kresge Krieger Krishna Kristin Kronecker Krueger Kruger Kruse krypton Ku kudo kudzu Kuhn kulak kumquat Kurd Kurt Kuwait kwashiorkor Kyle Kyoto l l'oeil l's la lab Laban label labile laboratory laborious labour Labrador labradorite labyrinth lac lace lacerate Lacerta lacewing Lachesis lack lackadaisic lackey lacquer lacrosse lactate lacuna lacunae lacustrine lacy lad laden ladle lady ladyfern ladylike Lafayette lag lager lagging lagoon Lagos Lagrange Lagrangian Laguerre Lahore laid Laidlaw lain lair laissez laity lake Lakehurst lakeside lam Lamar lamb lambda lambert lame lamellar lament lamentation laminate lamming lamp lampblack lamplight lampoon lamprey Lana Lancashire Lancaster lance land landau landfill landhold Landis landlord landmark landowner landscape landslide lane Lang Lange Langley Langmuir language languid languish Lanka lanky Lansing lantern lanthanide lanthanum Lao Laocoon Laos Laotian lap lapel lapelled lapidary Laplace lappet lapping lapse Laramie larceny larch lard Laredo Lares large largemouth largesse lariat lark Larkin larkspur Larry Lars Larsen Larson larva larvae larval laryngeal larynges larynx lascar lascivious lase lash lass lasso last latch late latent later latera lateral Lateran laterite latest latex lath lathe Lathrop Latin Latinate latitude latitudinal latitudinary Latrobe latter lattice latus laud laudanum laudatory Lauderdale Laue laugh laughingstock Laughlin laughter launch launder laundry laura laureate laurel Lauren Laurence Laurent Laurentian Laurie Lausanne lava lavabo lavatory lavender lavish Lavoisier law lawbreaker lawbreaking lawful lawgiver lawgiving lawmake lawman lawmen lawn Lawrence lawrencium Lawson lawsuit lawyer lax laxative lay layette layman laymen layoff layout Layton layup Lazarus laze lazy lazybones lea leach leachate lead leaden leadeth leadsman leadsmen leaf leaflet leafy league leak leakage leaky lean Leander leap leapfrog leapt Lear learn lease leasehold leash least leather leatherback leatherneck leatherwork leathery leave leaven Leavenworth Lebanese Lebanon lebensraum Lebesgue lecher lechery lectionary lecture led ledge lee leech Leeds leek leer leery leeward leeway left leftmost leftover leftward lefty leg legacy legal legate legatee legato legend legendary Legendre legerdemain legging leggy leghorn legible legion legislate legislature legitimacy legitimate legume leguminous Lehigh Lehman Leigh Leighton Leila leisure leitmotif leitmotiv Leland lemma lemming lemon lemonade Lemuel Len Lena lend length lengthen lengthwise lengthy lenient Lenin Leningrad Leninism Leninist Lennox Lenny lens lent Lenten lenticular lentil Leo Leon Leona Leonard Leonardo Leone Leonid leonine leopard Leopold leper lepidolite leprosy Leroy Lesbian lesion Leslie Lesotho less lessee lessen lesson lessor lest Lester let lethal lethargy Lethe Letitia letterhead letterman lettermen letting lettuce leukemia levee level lever leverage Levi Levin Levine Levis levitate Leviticus Levitt levity levy lew lewd lewis lexical lexicography lexicon Lexington Leyden liable liaison liar libation libel libelous liberal liberate Liberia libertarian libertine liberty libidinous libido librarian library librate librettist libretto Libreville Libya lice licensable licensee licensor licentious lichen lick licorice lid lidding lie Liechtenstein lied lien lieu lieutenant life lifeblood lifeboat lifeguard lifelike lifelong lifespan lifestyle lifetime LIFO lift ligament ligand ligature Ligget Liggett light lighten lightface lighthearted lighthouse lightning lightproof lightweight lignite lignum like liken likewise Lila lilac Lilian Lillian Lilliputian Lilly lilt lily Lima limb limbic limbo lime limelight Limerick limestone limit limitate limousine limp limpet limpid limpkin Lin Lincoln Lind Linda Lindberg Lindbergh linden Lindholm Lindquist Lindsay Lindsey Lindstrom line lineage lineal linear linebacker lineman linemen linen lineup linger lingerie lingo lingua lingual linguist liniment link linkage linoleum Linotype linseed lint Linus lion Lionel lioness lip lipid Lippincott Lipschitz Lipscomb lipstick Lipton liquefaction liquefy liqueur liquid liquidate liquor Lisa Lisbon Lise lisle lisp Lissajous list listen lit litany literacy literal literary literate literature lithe lithic lithium lithograph lithography lithology lithosphere lithospheric litigant litigate litigious litmus litterbug little littleneck Littleton Litton littoral liturgic liturgy live Livermore Liverpool liverwort livery livestock liveth livid Livingston livre Liz lizard Lizzie Lloyd lo load loaf loam loamy loan loath loathe loathsome loaves lob lobar lobby lobe loblolly lobo lobscouse lobster lobular lobule local locale locate loci lock Locke Lockhart Lockheed Lockian locknut lockout locksmith lockup Lockwood locomote locomotion locomotive locomotor locomotory locoweed locus locust locutor lodestone lodge lodgepole Lodowick Loeb loess loft lofty log Logan logarithm logarithmic loge loggerhead logging logic logistic logjam loin loincloth Loire Lois loiter Loki Lola loll lollip((op lolly Lomb Lombard Lombardy Lome London lone lonesome long longevity Longfellow longhand longhorn longish longitude longitudinal longleg longstanding longtime longue look lookout lookup loom Loomis loon loop loophole loose looseleaf loosen loosestrife loot lop lope Lopez lopping lopseed lopsided loquacious loquacity lord lore Lorelei Loren Lorinda Lorraine Los losable lose loss lossy lost lot lotion Lotte lottery Lottie lotus Lou loud loudspeaker loudspeaking Louis Louisa Louise Louisiana Louisville lounge Lounsbury Lourdes louse lousewort lousy louver Louvre love lovebird Lovelace Loveland lovelorn low lowboy lowdown Lowe Lowell lower lowland Lowry loy loyal loyalty lozenge LSI LTV Lubbock Lubell lubricant lubricate lubricious lubricity Lucas Lucerne Lucia Lucian lucid Lucifer Lucille Lucius luck lucky lucrative lucre Lucretia Lucretius lucy ludicrous Ludlow Ludwig Lufthansa Luftwaffe lug luge luger luggage lugging Luis luke lukemia lukewarm lull lullaby lulu lumbar lumber lumberman lumbermen lumen luminance luminary luminescent luminosity luminous lummox lump lumpish Lumpur lumpy lunacy lunar lunary lunate lunatic lunch luncheon lunchroom lunchtime Lund Lundberg Lundquist lung lunge lupine Lura lurch lure lurid lurk Lusaka luscious lush lust lustful lustrous lusty lutanist lute lutetium Luther Lutheran Lutz lux luxe Luxembourg luxuriant luxuriate luxurious luxury Luzon lycopodium Lydia lye lying Lykes Lyle Lyman lymph lymphocyte lymphoma lynch Lynchburg Lynn lynx Lyon Lyons Lyra lyric lyricism lysergic m m's ma Mabel Mac macabre macaque MacArthur Macassar Macbeth MacDonald mace Macedon Macedonia MacGregor Mach Machiavelli machination machine machinelike machinery machismo macho macintosh mack MacKenzie mackerel Mackey Mackinac Mackinaw mackintosh MacMillan Macon macro macromolecule macrophage macroscopic mad Madagascar madam Madame madcap madden madding Maddox made Madeira Madeleine Madeline madhouse Madison madman madmen Madonna Madras Madrid madrigal Madsen madstone Mae Maelstrom maestro magazine Magdalene magenta Maggie maggot maggoty magi magic magician magisterial magistrate magna magnanimity magnanimous magnate magnesia magnesite magnesium magnet magnetic magnetite magneto magnetron magnificent magnify magnitude magnolia magnum Magnuson Magog magpie Magruder Mahayana Mahayanist mahogany Mahoney maid maiden maidenhair maidservant Maier mail mailbox mailman mailmen maim main Maine mainland mainline mainstream maintain maintenance maitre majestic majesty major make makeshift makeup Malabar maladapt maladaptive maladjust maladroit malady Malagasy malaise malaprop malaria malarial Malawi Malay Malaysia Malcolm malconduct malcontent Malden maldistribute Maldive male maledict malevolent malfeasant malformation malformed malfunction Mali malice malicious malign malignant mall mallard malleable mallet Mallory mallow malnourished malnutrition malocclusion Malone Maloney malposed malpractice Malraux malt Malta Maltese Malton maltreat mambo mamma mammal mammalian mammoth man mana manage manageable managerial Managua Manama manatee Manchester mandamus mandarin mandate mandatory mandrake mandrel mandrill mane maneuver Manfred manganese mange mangel mangle Manhattan manhole manhood mania maniac maniacal manic manifest manifestation manifold manikin Manila manipulable manipulate Manitoba mankind Manley Mann manna mannequin mannerism manning manometer manometric manor manpower Mans manse manservant Mansfield mansion manslaughter mantel mantic mantis mantissa mantle mantlepiece mantrap manual Manuel manufacture manumission manumit manumitted manure manuscript Manville many manzanita Mao Maori map maple mapping mar marathon maraud marble Marc Marceau Marcel Marcello march Marcia Marco Marcus Marcy Mardi mare Margaret margarine Margery margin marginal marginalia Margo Marguerite maria Marie Marietta marigold marijuana Marilyn marimba Marin marina marinade marinate marine Marino Mario Marion marionette marital maritime Marjorie Marjory mark market marketeer marketplace marketwise Markham Markov Markovian Marks marksman marksmen Marlboro Marlborough Marlene marlin Marlowe marmalade marmot maroon marque marquee marquess Marquette marquis marriage marriageable married Marrietta marring Marriott marrow marrowbone marry Mars Marseilles marsh Marsha marshal Marshall marshland marshmallow mart marten Martha martial Martian martin Martinez martingale martini Martinique Martinson Marty martyr martyrdom marvel marvelous Marvin Marx Mary Maryland mascara masculine maser Maseru mash mask mason Masonic Masonite masonry masque masquerade mass Massachusetts massacre massage masseur Massey massif massive mast masterful mastermind masterpiece mastery mastic mastiff mastodon mat match matchbook matchmake mate Mateo mater material materiel maternal maternity math mathematic mathematician Mathematik Mathews Mathewson Mathias Mathieu Matilda matinal matinee matins Matisse matriarch matriarchal matrices matriculate matrimonial matrimony matrix matroid matron Matson matte Matthew Matthews matting mattock mattress Mattson maturate mature maudlin maul Maureen Maurice Maurine Mauritania Mauritius mausoleum mauve maverick Mavis maw mawkish Mawr Max maxim maxima maximal Maximilian maximum Maxine maxwell Maxwellian may Maya mayapple maybe Mayer Mayfair Mayflower mayhem Maynard Mayo mayonnaise mayor mayoral mayst Mazda maze mazurka MBA Mbabane McAdams McAllister McBride McCabe McCall McCann McCarthy McCarty McCauley McClain McClellan McClure McCluskey McConnel McConnell McCormick McCoy McCracken McCullough McDaniel McDermott McDonald McDonnell McDougall McDowell McElroy McFadden McFarland McGee McGill McGinnis McGovern McGowan McGrath McGraw McGregor McGuire McHugh McIntosh McIntyre McKay McKee McKenna McKenzie McKeon McKesson McKinley McKinney McKnight McLaughlin McLean McLeod McMahon McMillan McMullen McNally McNaughton McNeil McPherson me mead meadow meadowland meadowsweet meager meal mealtime mealy mean meander meaningful meant meantime meanwhile measle measure meat meaty Mecca mechanic mechanism mechanist mecum medal medallion meddle Medea media medial median mediate medic medicate Medici medicinal medicine medico mediocre mediocrity meditate Mediterranean medium medley Medusa meek meet meetinghouse Meg megabit megabyte megahertz megalomania megalomaniac megaton megavolt megawatt megaword megohm Meier Meistersinger Mekong Mel melamine melancholy Melanesia melange Melanie melanin melanoma Melbourne Melcher meld melee Melinda meliorate Melissa Mellon mellow melodic melodious melodrama melodramatic melody melon Melpomene melt Melville Melvin member membrane memento memo memoir memorabilia memorable memoranda memorandum memorial memory Memphis men menace menagerie menarche mend mendacious mendacity mendelevium Mendelssohn Menelaus menfolk menhaden menial Menlo Mennonite menstruate mensurable mensuration mental mention mentor menu Menzies Mephistopheles mercantile Mercator Mercedes mercenary mercer merchandise merchant merciful mercilessly Merck mercurial mercuric mercury mercy mere Meredith meretricious merganser merge meridian meridional meringue merit meritorious Merle merlin mermaid Merriam Merrill Merrimack merriment Merritt merry merrymake Mervin mesa mescal mescaline mesenteric mesh mesmeric meson Mesozoic mesquite mess message messenger Messiah messieurs Messrs messy met metabole metabolic metabolism metabolite metal metallic metalliferous metallography metalloid metallurgic metallurgy metalwork metamorphic metamorphism metamorphose metamorphosis metaphor metaphoric Metcalf mete meteor meteoric meteorite meteoritic meteorology meter methacrylate methane method methodic Methodism Methodist methodology Methuen Methuselah methyl methylene meticulous metier metric metro metronome metropolis metropolitan mettle mettlesome Metzler mew Mexican Mexico Meyer Meyers mezzo mi Miami miasma miasmal mica mice Michael Michaelangelo Michelangelo Michelin Michelson michigan Mickelson Mickey Micky micro microbial microcosm micrography microjoule micron Micronesia microscopy mid Midas midband midday middle Middlebury middleman middlemen Middlesex Middleton Middletown middleweight midge midget midland midmorn midnight midpoint midrange midscale midsection midshipman midshipmen midspan midst midstream midway midweek Midwest Midwestern midwife midwives mien miff mig might mightn't mighty mignon migrant migrate migratory Miguel mike mila Milan milch mild mildew Mildred mile mileage Miles milestone milieu militant militarism militarist military militate militia militiamen milk milkweed milky mill Millard millenarian millenia millennia millennium miller millet milliammeter milliampere Millie millihenry millijoule Millikan millinery million millionaire millionth millipede millisecond millivolt millivoltmeter milliwatt Mills millstone milord milt Milton Miltonic Milwaukee mimeograph mimesis mimetic Mimi mimic mimicked mimicking minaret mince mincemeat mind Mindanao mindful mine minefield mineral mineralogy Minerva minesweeper mingle mini miniature minicomputer minim minima minimal minimax minimum minion ministerial ministry mink Minneapolis Minnesota Minnie minnow Minoan minor Minos minot Minsky minstrel minstrelsy mint minuend minuet minus minuscule minute minuteman minutemen minutiae Miocene Mira miracle miraculous mirage Miranda mire Mirfak Miriam mirror mirth misanthrope misanthropic miscegenation miscellaneous miscellany mischievous miscreant miser misery misnomer misogynist misogyny mispronunciation miss misshapen missile mission missionary Mississippi Mississippian missive Missoula Missouri Missy mist mistletoe mistress misty MIT Mitchell mite miterwort mitigate mitral mitre mitt mitten mix mixture mixup Mizar mnemonic moan moat mob mobbing mobcap Mobil mobile mobility mobster moccasin mock mockernut mockery mockingbird mockup modal mode model modem moderate modern modest Modesto modesty modicum modify modish modular modulate module moduli modulo modulus Moe Moen Mogadiscio Mohammedan Mohawk Mohr moiety Moines moire Moiseyev moist moisten moisture molal molar molasses mold moldboard mole molecular molecule molehill molest Moliere Moline Moll Mollie mollify mollusk Molly mollycoddle Moloch molt m((olten Moluccas molybdate molybdenite molybdenum moment momenta momentary momentous momentum mommy Mona Monaco monad monadic monarch monarchic monarchy monastery monastic monaural Monday monel monetarism monetary money moneymake moneywort Mongolia mongoose Monica monies monitor monitory monk monkey monkeyflower monkish Monmouth Monoceros monochromatic monochromator monocotyledon monocular monogamous monogamy monolith monologist monologue monomer monomeric monomial Monongahela monopoly monotonous monoxide Monroe Monrovia Monsanto monsieur monsoon monster monstrosity monstrous Mont montage Montague Montana Montclair monte Montenegrin Monterey Monteverdi Montevideo Montgomery month Monticello Montmartre Montpelier Montrachet Montreal Monty monument moo mood moody moon Mooney moonlight moonlike moonlit moor Moore Moorish moose moot mop mopping moraine moral morale Moran morass moratorium Moravia morbid more morel Moreland moreover Moresby Morgan morgen morgue Moriarty moribund Morley Mormon morn Moroccan Morocco moron morose morpheme morphemic morphine morphology morphophonemic Morrill morris Morrison Morrissey Morristown morrow Morse morsel mort mortal mortar mortem mortgage mortgagee mortgagor mortician mortify mortise Morton mosaic Moscow Moser Moses Moslem mosque mosquito moss mossy most mot motel motet moth mother motherhood motherland motif motion motivate motive motley motor motorcycle Motorola mottle motto mould Moulton mound mount mountain mountaineer mountainous mountainside mourn mournful mouse moustache mousy mouth mouthful mouthpiece Mouton move movie mow Moyer Mozart MPH Mr Mrs Ms mu much mucilage muck mucosa mucus mud Mudd mudding muddle muddlehead muddy mudguard mudsling Mueller muezzin muff muffin muffle mug mugging muggy mugho Muir Mukden mulatto mulberry mulch mulct mule mulish mull mullah mullein Mullen mulligan mulligatawny mullion multi multinomial multiple multiplex multiplexor multipliable multiplicand multiplication multiplicative multiplicity multiply multitude multitudinous mum mumble Mumford mummy munch Muncie mundane mung Munich municipal munificent munition Munson muon Muong mural murder murderous muriatic Muriel murk murky murmur Murphy Murray murre Muscat muscle Muscovite Muscovy muscular musculature muse museum mush mushroom mushy music musicale musician musicology musk Muskegon muskellunge musket muskmelon muskox muskoxen muskrat muslim muslin mussel must mustache mustachio mustang mustard mustn't musty mutandis mutant mutate mutatis mute mutilate mutineer mutiny mutt mutter mutton mutual mutuel Muzak Muzo muzzle my Mycenae Mycenaean mycobacteria mycology myel myeline myeloid Myers mylar mynah Mynheer myocardial myocardium myofibril myopia myopic myosin Myra myriad Myron myrrh myrtle myself mysterious mystery mystic mystify mystique myth mythic mythology n n's NAACP nab nabbing Nabisco Nadine nadir nag Nagasaki nagging Nagoya Nagy naiad nail Nair Nairobi naive naivete naked name nameable nameplate namesake Nan Nancy Nanette Nanking nanosecond Nantucket Naomi nap napkin Naples Napoleon Napoleonic napping Narbonne narcissist narcissus narcosis narcotic Narragansett narrate narrow nary NASA nasal nascent Nash Nashua Nashville Nassau nasturtium nasty Nat natal Natalie Natchez Nathan Nathaniel nation nationhood nationwide native NATO natty natural nature naturopath naughty nausea nauseate nauseum nautical nautilus Navajo naval nave navel navigable navigate navy nay Nazarene Nazareth Nazi Nazism NBC NBS NC NCAA NCR ND Ndjamena ne Neal Neanderthal Neapolitan near nearby nearest nearsighted neat neater neath Nebraska nebula nebulae nebular nebulous necessary necessitate necessity neck necklace neckline necktie necromancer necromancy necromantic necropsy necrosis necrotic nectar nectareous nectary Ned nee need needful needham needle needlepoint needn't needy Neff negate neglect negligee negligent negligible negotiable negotiate Negro Negroes Negroid Nehru Neil neither Nell Nellie Nelsen Nelson nemesis neoclassic neodymium neolithic neologism neon neonatal neonate neophyte neoprene Nepal nepenthe nephew Neptune neptunium nereid Nero nerve nervous Ness nest nestle Nestor net nether Netherlands netherworld netting nettle nettlesome network Neumann neural neuralgia neurasthenic neuritis neuroanatomic neuroanatomy neuroanotomy neurology neuromuscular neuron neuronal neuropathology neurophysiology neuropsychiatric neuroses neurosis neurotic neuter neutral neutrino neutron Neva Nevada neve nevertheless Nevins new Newark Newbold newborn Newcastle newcomer newel Newell newfound Newfoundland newlywed Newman Newport newsboy newscast newsletter newsman newsmen newspaper newspaperman newspapermen newsreel newsstand Newsweek newt newton Newtonian next Nguyen NH Niagara Niamey nib nibble Nibelung nibs Nicaragua nice nicety niche Nicholas Nicholls Nichols Nicholson nichrome nick nickel nickname Nicodemus Nicosia nicotine niece Nielsen Nielson Nietzsche Niger Nigeria niggardly nigger niggle nigh night nightcap nightclub nightdress nightfall nightgown nighthawk nightingale nightmare nightmarish nightshirt nighttime NIH nihilism nihilist Nikko Nikolai nil Nile nilpotent nimble nimbus NIMH Nina nine ninebark ninefold nineteen nineteenth ninetieth ninety Nineveh ninth Niobe niobium nip nipping nipple Nippon nirvana nit nitpick nitrate nitric nitride nitrite nitrogen nitrogenous nitroglycerine nitrous nitty Nixon NJ NM no NOAA Noah nob Nobel nobelium noble nobleman noblemen noblesse nobody nobody'd nocturnal nocturne nod nodal nodding node nodular nodule Noel noise noisemake noisy Nolan Noll nolo nomenclature nominal nominate nominee non nonce nonchalant nondescript none nonetheless nonogenarian nonsensic noodle nook noon noontime noose nor Nordhoff Nordstrom Noreen Norfolk norm Norma normal normalcy Norman Normandy normative Norris north Northampton northbound northeast northeastern northerly northern northernmost northland Northrop Northrup Northumberland northward northwest northwestern Norton Norwalk Norway Norwegian Norwich nose nosebag nosebleed nostalgia nostalgic Nostradamus Nostrand nostril not notarize notary notate notch note notebook noteworthy nothing notice noticeable notify notion notoriety notorious Nottingham notwithstanding Nouakchott noun nourish nouveau Nov nova Novak novel novelty November novice novitiate novo Novosibirsk now nowaday nowhere nowise noxious nozzle NRC NSF NTIS nu nuance Nubia nubile nucleant nuclear nucleate nuclei nucleic nucleoli nucleolus nucleotide nucleus nuclide nude nudge nugatory nugget nuisance null nullify numb numerable numeral numerate numeric Numerische numerology numerous numinous numismatic numismatist nun nuptial nurse nursery nurture nut nutate nutcrack nuthatch nutmeg nutria nutrient nutrition nutritious nutritive nutshell nutting nuzzle NY NYC nylon nymph nymphomania nymphomaniac Nyquist NYU o O'Brien o'clock O'Connell O'Connor O'Dell O'Donnell O'Dwyer o'er O'Hare O'Leary o's O'Shea O'Sullivan oaf oak oaken Oakland Oakley oakwood oar oases oasis oat oath oatmeal obduracy obdurate obedient obeisant obelisk Oberlin obese obey obfuscate obfuscatory obituary object objectify objectivity objector objet obligate obligatory oblige oblique obliterate oblivion oblivious oblong obnoxious oboe oboist obscene obscure obsequious obsequy observant observation observatory observe obsess obsession obsessive obsidian obsolescent obsolete obstacle obstinacy obstinate obstruct obtain obtrude obtrusive obverse obviate obvious ocarina occasion occident occidental occipital occlude occlusion occlusive occult occultate occupant occupation occupy occur occurred occurrent occurring ocean Oceania oceanic oceanography oceanside ocelot Oct octagon octagonal octahedra octahedral octahedron octal octane octave Octavia octennial octet octile octillion October octogenarian octopus octoroon ocular odd ode Odessa Odin odious odium odometer odorous Odysseus Odyssey Oedipal Oedipus oersted of off offal offbeat Offenbach offend offensive offer offertory offhand office officeholder officemate official officialdom officiate officio officious offing offload offsaddle offset offsetting offshoot offshore offspring offstage oft often oftentimes Ogden ogle ogre ogress oh Ohio ohm ohmic ohmmeter oil oilcloth oilman oilmen oilseed oily oint OK Okay Okinawa Oklahoma Olaf old olden Oldenburg Oldsmobile oldster oldy oleander olefin oleomargarine Olga oligarchic oligarchy oligoclase oligopoly Olin olive Oliver Olivetti Olivia olivine Olsen Olson Olympia Olympic Omaha Oman omega omelet omen omicron ominous omission omit omitted omitting omnibus omnipotent omnipresent omniscient on once oncology oncoming one Oneida onerous oneself onetime oneupmanship ongoing onion onlooker onlooking only Onondaga onrush onrushing onset onslaught Ontario onto ontogeny ontology onus onward onyx oodles ooze opacity opal opalescent opaque OPEC Opel open opera operable operand operant operate operatic operetta Ophiucus opiate opinion opinionate opium opossum Oppenheimer opponent opportune opposable oppose opposite opposition oppress oppression oppressive oppressor opprobrium opt opthalmic opthalmologic opthalmology optic optima optimal optimism optimist optimistic optimum option optoacoustic optoisolate optometric optometrist optometry opulent opus or oracle oral orange orangeroot orangutan orate oratoric oratorio oratory orb orbit orbital orchard orchestra orchestral orchestrate orchid orchis ordain ordeal order orderly ordinal ordinance ordinary ordinate ordnance ore oregano Oregon Oresteia Orestes organ organdy organic organismic organometallic orgasm orgiastic orgy orient oriental orifice origin original originate Orin Orinoco oriole Orion Orkney Orlando Orleans ornament ornamentation ornate ornately ornery orographic orography Orono orphan orphanage Orpheus Orphic Orr Ortega orthant orthicon orthoclase orthodontic orthodontist orthodox orthodoxy orthogonal orthography orthonormal orthopedic orthophosphate orthorhombic Orville Orwell Orwellian Osaka Osborn Osborne Oscar oscillate oscillatory oscilloscope Osgood Oshkosh osier Osiris Oslo osmium osmosis osmotic osprey osseous ossify ostensible ostentatious osteology osteopath osteopathic osteopathy osteoporosi((s ostracism ostracod Ostrander ostrich Oswald Othello other otherwise otherworld otherworldly Otis Ott Ottawa otter Otto Ottoman Ouagadougou ouch ought oughtn't ounce our ourselves oust out outermost outlandish outlawry outrageous ouzel ouzo ova oval ovary ovate oven ovenbird over overhang overt overture Ovid oviform ow owe Owens owing owl owly own ox oxalate oxalic oxcart oxen oxeye Oxford oxidant oxidate oxide Oxnard oxygen oxygenate oyster Ozark ozone p p's pa Pablo Pabst pace pacemake pacesetting pacific pacifism pacifist pacify pack package Packard packet pact pad padding paddle paddock paddy padlock padre paean pagan page pageant pageantry paginate pagoda paid pail pain Paine painful painstaking paint paintbrush pair pairwise Pakistan Pakistani pal palace palate Palatine palazzi palazzo pale Paleolithic Paleozoic Palermo Palestine palette palfrey palindrome palindromic palisade pall palladia Palladian palladium pallet palliate pallid palm palmate palmetto Palmolive Palmyra Palo Palomar palpable palsy Pam Pamela pampa pamper pamphlet pan panacea panama pancake Pancho panda Pandanus pandemic pandemonium pander Pandora pane panel pang panic panicked panicky panicle panjandrum panning panoply panorama panoramic pansy pant pantheism pantheist pantheon panther pantomime pantomimic pantry panty Paoli pap papa papal papaw paper paperback paperweight paperwork papery papillary papoose Pappas pappy paprika Papua papyri papyrus par parabola parabolic paraboloid paraboloidal parachute parade paradigm paradigmatic paradise paradox paradoxic paraffin paragon paragonite paragraph Paraguay parakeet paralinguistic parallax parallel parallelepiped paralysis paramagnet paramagnetic parameter parametric paramilitary paramount Paramus paranoia paranoiac paranoid paranormal parapet paraphernalia paraphrase parapsychology parasite parasitic parasol parasympathetic paratroop paraxial parboil parcel parch pardon pare paregoric parent parentage parental parentheses parenthesis parenthetic parenthood Pareto pariah parimutuel Paris parish parishioner Parisian park Parke Parkinson parkish parkland parklike Parks parkway parlance parlay parley parliament parliamentarian parliamentary parochial parody parole parolee parquet Parr Parrish parrot parrotlike parry parse Parsifal parsimonious parsimony parsley parsnip parson parsonage Parsons part partake Parthenon partial participant participate participle particle particular particulate partisan partition partner partook partridge party parvenu Pasadena Pascal paschal pasha Paso pass passage passageway Passaic passband passe passenger passer passerby passion passionate passivate passive Passover passport password past paste pasteboard pastel pasteup Pasteur pastiche pastime pastor pastoral pastry pasture pasty pat Patagonia patch patchwork patchy pate patent patentee pater paternal paternoster Paterson path pathetic pathogen pathogenesis pathogenic pathology pathos pathway patient patina patio patriarch patriarchal patriarchy Patrice Patricia patrician Patrick patrimonial patrimony patriot patriotic patristic patrol patrolled patrolling patrolman patrolmen patron patronage patroness Patsy pattern Patterson Patti patting Patton patty paucity Paul Paula Paulette Pauli Pauline Paulo Paulsen Paulson Paulus paunch paunchy pauper pause pavanne pave pavilion Pavlov paw pawn pawnshop Pawtucket pax pay paycheck payday paymaster Payne payoff payroll Paz PBS pea Peabody peace peaceable peaceful peacemake peacetime peach Peachtree peacock peafowl peak peaky peal Peale peanut pear Pearce pearl pearlstone Pearson peasant peasanthood Pease peat pebble pecan peccary peck Pecos pectoral pectoralis peculate peculiar pecuniary pedagogic pedagogue pedagogy pedal pedant pedantic pedantry peddle pedestal pedestrian pediatric pediatrician pedigree pediment Pedro pee peed peek peel peep peephole peepy peer peg Pegasus pegboard pegging Peggy pejorative Peking Pelham pelican pellagra pellet pelt peltry pelvic pelvis Pembroke pemmican pen penal penalty penance penates pence penchant pencil pend pendant pendulum Penelope penetrable penetrate penguin Penh penicillin peninsula penitent penitential penitentiary penman penmen Penn penna pennant penning Pennsylvania penny pennyroyal Penrose Pensacola pension pensive pent pentagon pentagonal pentane Pentecost pentecostal penthouse penultimate penumbra penurious penury peony people Peoria pep peppergrass peppermint pepperoni peppery pepping peppy Pepsi PepsiCo peptide per perceive percent percentage percentile percept perceptible perception perceptive perceptual perch perchance perchlorate Percival percolate percussion percussive Percy perdition peremptory perennial Perez perfect perfectible perfidious perfidy perforate perforce perform performance perfume perfumery perfunctory perfusion Pergamon perhaps Periclean Pericles peridotite perihelion peril Perilla perilous perimeter period periodic peripatetic peripheral periphery periphrastic periscope perish peritectic periwinkle perjure perjury perk Perkins perky Perle permalloy permanent permeable permeate Permian permissible permission permissive permit permitted permitting permutation permute pernicious peroxide perpendicular perpetrate perpetual perpetuate perpetuity perplex perquisite Perry persecute persecution persecutory Perseus perseverance persevere Pershing Persia Persian persiflage persimmon persist persistent person persona personage personal personify personnel perspective perspicacious perspicous perspicuity perspicuous perspiration perspire persuade persuasion persuasive pert pertain Perth pertinacious pertinent perturb perturbate Peru perusal peruse Peruvian pervade pervasion pervasive perverse perversion pervert pessimal pessimism pessimist pessimum pest peste pesticide pestilent pestilential pestle pet petal Pete Peter Peters Petersburg Petersen Peterson petit petite petition petrel petri petrify petrochemical petroglyph petrol petroleum petrology petticoat petting petty petulant petunia Peugeot pew pewee pewter pfennig Pfizer phagocyte phalanger phalanx phalarope phantasy phantom pharmaceutic pharmacist pharmacology pharmacopoeia pharmacy phase PhD pheasant Phelps phenol phenolic phenomena phenomenal phenomenology phenomenon phenotype phenyl phi Phil Philadelphia philanthrope philanthropic philanthropy philharmonic Philip Philippine Philistine Phillips philodendron philology philosoph philosophic philosophy Phipps phloem phlox phobic phoebe Phoenicia phoenix phon phone phoneme phonemic phonetic phonic phonograph phonology phonon phony phosgene phosphate phosphide phosphine phosphor phosphoresce phosphorescent phosphoric phosphorus photo photogenic photography photolysis photolytic photometric photometry photon phrase phrasemake phraseology phthalate phycomycetes phyla Phyllis phylogeny physic physician Physik physiochemical physiognomy physiology physiotherapist physiotherapy physique phytoplankton pi pianissimo pianist piano piazza pica Picasso picayune Piccadilly piccolo pick pickaxe pickerel Pickering picket Pickett Pickford pickle Pickman pickoff pickup picky picnic picnicked picnicker picnicking picofarad picojoule picosecond pictorial picture picturesque piddle pidgin pie piece piecemeal piecewise Piedmont pier pierce Pierre Pierson pietism piety piezoelectric pig pigeon pigeonberry pigeonfoot pigeonhole pigging piggish piggy pigment pigmentation pigpen pigroot pigskin pigtail pike Pilate pile pilewort pilfer pilferage pilgrim pilgrimage pill pillage pillar pillory pillow Pillsbury pilot pimp pimple pin pinafore pinball pinch pincushion pine pineapple Pinehurst ping pinhead pinhole pinion pink pinkie pinkish pinnacle pinnate pinning pinochle pinpoint pinscher Pinsky pint pintail pinto pinwheel pinxter pion pioneer pious pip pipe pipeline Piper pipette pipsissewa piquant pique piracy Piraeus pirate pirogue pirouette Piscataway Pisces piss pistachio pistol pistole piston pit pitch pitchblende pitchfork pitchstone piteous pitfall pith pithy pitiable pitiful pitilessly pitman Pitney Pitt pitting Pittsburgh Pittsfield Pittston pituitary pity Pius pivot pivotal pixel pixy pizza pizzicato placate placater place placeable placebo placeholder placenta placental placid plagiarism plagiarist plagioclase plague plagued plaguey plaid plain Plainfield plaintiff plaintive plan planar Planck plane planeload planet planetaria planetarium planetary planetesimal planetoid plank plankton planning planoconcave planoconvex plant plantain plantation plaque plasm plasma plasmon plaster plastic plastisol plastron plat plate plateau platelet platen platform platinize platinum platitude platitudinous Plato platonic Platonism Platonist platoon Platte platting plausible play playa playback playboy playful playground playhouse playmate playoff playroom playtime playwright playwriting plaza plea plead pleasant please pleasure pleat plebeian plebian pledge Pleiades Pleistocene plenary plenipotentiary plenitude plentiful plenty plenum plethora pleura pleural Plexiglas pliable pliancy pliant pliers plight Pliny Pliocene plod plodding plop plopping plot plotting plover plow plowman plowshare pluck plucky plug pluggable plugging plum plumage plumb plumbago plumbate plume plummet plump plunder plunge plunk plural plus plush plushy Plutarch Pluto plutonium ply Plymouth plyscore plywood PM pneumatic pneumonia Po poach pocket pocketbook pocketful Pocono pod podge podia podium Poe poem poesy poet poetic poetry pogo pogrom poi poignant Poincare poinsettia point poise poison poisonous Poisson poke pokerface pol Poland polar polarimeter polarimetry Polaris polariscope polariton polarogram polarograph polarography Polaroid polaron pole polecat polemic police policeman policemen policy polio polis polish Politburo polite politic politician politicking politico polity Polk polka poll Pollard pollcadot pollen pollock polloi pollutant pollute pollution Pollux polo polonaise polonium polopony polygon polygonal polygynous polyhedra polyhedral polyhedron Polyhymnia polymer polymerase polymeric polymorph polymorphic polynomial Polyphemus polyphony polypropylene polytechnic polytope polytypy pomade pomegranate Pomona pomp pompadour pompano Pompeii pompey pompon pomposity pompous Ponce P((onchartrain poncho pond ponder ponderous pong pont Pontiac pontiff pontific pontificate pony pooch poodle pooh pool Poole poop poor pop pope popish poplar poplin popping poppy populace popular populate populous porcelain porch porcine porcupine pore pork pornographer pornography porosity porous porphyry porpoise porridge port portage portal Porte portend portent portentous porterhouse portfolio Portia portico portland portmanteau Porto portrait portraiture portray portrayal Portsmouth Portugal Portuguese portulaca pose Poseidon poseur posey posh posit position positive positron posse posseman possemen possess possession possessive possessor possible possum post postage postal postcard postcondition postdoctoral posterior posteriori posterity postfix postgraduate posthumous postlude postman postmark postmaster postmen postmortem postmultiply postoperative postorder postpone postprocess postprocessor postscript postulate posture postwar posy pot potable potash potassium potato potatoes potbelly potboil potent potentate potential potentiometer pothole potion potlatch Potomac potpourri pottery potting Potts pouch Poughkeepsie poultice poultry pounce pound pour pout poverty pow powder powderpuff powdery Powell power powerful Powers Poynting ppm practicable practical practice practise practitioner Prado pragmatic pragmatism pragmatist Prague prairie praise praiseworthy pram prance prank praseodymium Pratt Pravda pray prayer prayerful preach preachy preamble Precambrian precarious precaution precautionary precede precedent precept precess precession precinct precious precipice precipitable precipitate precipitous precise precision preclude precocious precocity precursor predatory predecessor predicament predicate predict predictor predilect predispose predisposition predominant predominate preeminent preempt preemption preemptive preemptor preen prefab prefabricate preface prefatory prefect prefecture prefer preference preferential preferred preferring prefix pregnant prehistoric prejudice prejudicial preliminary prelude premature premeditate premier premiere premise premium premonition premonitory Prentice preoccupy prep preparation preparative preparatory prepare preponderant preponderate preposition preposterous prepping prerequisite prerogative presage Presbyterian Prescott prescribe prescript prescription prescriptive presence present presentation presentational preservation preserve preside president presidential press pressure prestidigitate prestige prestigious presto Preston presume presumed presuming presumption presumptive presumptuous presuppose presupposition pretend pretense pretension pretentious pretext Pretoria pretty prevail prevalent prevent prevention preventive preview previous prexy prey Priam price prick prickle pride priest Priestley prig priggish prim prima primacy primal primary primate prime primeval primitive primitivism primp primrose prince princess Princeton principal Principia principle print printmake printout prior priori priory Priscilla prism prismatic prison prissy pristine Pritchard privacy private privet privilege privy prize prizewinning pro probabilist probate probe probity problem problematic procaine procedural procedure proceed process procession processor proclaim proclamation proclivity procrastinate procreate procrustean Procrustes Procter proctor procure Procyon prod prodding prodigal prodigious prodigy produce producible product productivity Prof profane profess profession professional professor professorial proffer proficient profile profit profligate profound profundity profuse profusion progenitor progeny prognosis prognosticate programmable programmed programmer programming progress progression progressive prohibit prohibition prohibitive prohibitory project projectile projector Prokofieff prolate proletariat proliferate prolific prolix prologue prolong prolongate prolusion promenade Promethean Prometheus promethium prominent promiscuous promise promote promotion prompt promptitude promulgate prone prong pronoun pronounce pronounceable pronto pronunciation proof proofread prop propaganda propagandist propagate propane propel propellant propelled propeller propelling propensity proper property prophecy prophesy prophet prophetic propionate propitiate propitious proponent proportion proportionate propos proposal propose proposition propping proprietary proprietor propriety proprioception proprioceptive propulsion propyl propylene prorate prorogue prosaic proscenium proscribe proscription prose prosecute prosecution prosecutor Proserpine prosodic prosody prosopopoeia prospect prospector prospectus prosper prosperous prostate prosthetic prostitute prostitution prostrate protactinium protagonist protean protease protect protector protectorate protege protein proteolysis proteolytic protest protestant protestation prothonotary protocol proton protoplasm protoplasmic prototype prototypic Protozoa protozoan protract protrude protrusion protrusive protuberant proud Proust prove proven provenance proverb proverbial provide provident providential province provincial provision provisional proviso provocateur provocation provocative provoke provost prow prowess prowl proximal proximate proximity proxy prudent prudential prune prurient Prussia pry psalm psalter pseudo psi psych psyche psychiatric psychiatrist psychiatry psychic psycho psychoacoustic psychoanalysis psychoanalyst psychoanalytic psychobiology psychology psychometric psychometry psychopath psychopathic psychophysic psychophysical psychophysics psychophysiology psychopomp psychoses psychosis psychosomatic psychotherapeutic psychotherapist psychotherapy psychotic psyllium PTA ptarmigan Ptolemaic Ptolemy pub puberty pubescent public publication publish Puccini puck puckish pudding puddingstone puddle puddly pueblo puerile Puerto puff puffball puffed puffery puffin puffy pug Pugh puissant puke Pulaski Pulitzer pull pulley Pullman pullover pulmonary pulp pulpit pulsar pulsate pulse pulverable puma pumice pummel pump pumpkin pumpkinseed pun punch punctual punctuate puncture pundit punditry pungent Punic punish punitive punk punky punning punster punt puny pup pupal pupate pupil puppet puppeteer puppy puppyish Purcell purchasable purchase Purdue pure purgation purgative purgatory purge purify Purina Puritan puritanic purl purloin purple purport purpose purposeful purposive purr purse purslane pursuant pursue pursuer pursuit purvey purveyor purview pus Pusan Pusey push pushbutton pussy pussycat put putative Putnam putt putty puzzle PVC Pygmalion pygmy Pyhrric pyknotic Pyle Pyongyang pyracanth pyramid pyramidal pyre Pyrex pyridine pyrite pyroelectric pyrolyse pyrolysis pyrometer pyrometry pyrophosphate pyrotechnic pyroxene pyroxenite Pythagoras Pythagorean python q q's Qatar QED qua quack quackery quad quadrangle quadrangular quadrant quadratic quadrature quadrennial quadric quadriceps quadrilateral quadrille quadrillion quadripartite quadrivium quadruple quadrupole quaff quagmire quahog quail quaint quake Quakeress qualified qualify qualitative quality qualm quandary quanta Quantico quantify quantile quantitative quantity quantum quarantine quark quarrel quarrelsome quarry quarryman quarrymen quart quarterback quartermaster quartet quartic quartile quartz quartzite quasar quash quasi quasiparticle quaternary quatrain quaver quay queasy Quebec queen queer quell quench querulous query quest question questionnaire quetzal queue Quezon quibble quick quicken quickie quicklime quicksand quicksilver quickstep quiescent quiet quietus quill quillwort quilt quince quinine Quinn quint quintet quintic quintillion quintus quip quipping Quirinal quirk quirky quirt quit quite Quito quitting quiver Quixote quixotic quiz quizzical quo quod quonset quorum quota quotation quote quotient r R&D r's rabat rabbet rabbi rabbit rabble rabid rabies Rabin raccoon race racetrack raceway Rachel Rachmaninoff racial rack racket racketeer rackety racy radar Radcliffe radial radian radiant radiate radical radices radii radio radioactive radioastronomy radiocarbon radiochemical radiochemistry radiography radiology radiometer radiometric radiometry radiophysics radiosonde radiosterilize radiotherapy radish radium radius radix radon Rae Rafael Rafferty raffia raffish raft rag rage ragging ragout ragweed raid rail railbird railhead raillery railroad railway rain rainbow raincoat raindrop rainfall rainstorm rainy raise raisin raj rajah rake rakish Raleigh rally Ralph Ralston ram Ramada Raman ramble ramify ramming Ramo ramp rampage rampant rampart ramrod Ramsey ran ranch rancho rancid rancorous Rand Randall Randolph random randy rang range rangeland Rangoon rangy Ranier rank Rankin rankle ransack ransom rant Raoul rap rapacious rape Raphael rapid rapier rapping rapport rapprochement rapt rapture rare rarefy Raritan rarity rasa rascal rash Rasmussen rasp raspberry raster Rastus rat rata rate rater rather ratify ratio ratiocinate rationale rattail rattle rattlesnake raucous ravage rave ravel raven ravenous ravine ravish raw rawboned rawhide Rawlinson ray Rayleigh Raymond Raytheon raze razor razorback RCA re reach reactant reactionary read readout ready Reagan reagent real realisable realm realtor realty ream reap rear reason reave reb Rebecca rebel rebelled rebelling rebellion rebellious rebuke rebut rebuttal rebutted rebutting recalcitrant recant recappable recede receipt receive recent receptacle reception receptive receptor recess recession recessive recherche Recife recipe recipient reciprocal reciprocate reciprocity recital recitative reck reckon reclamation recline recluse recompense reconcile recondite reconnaissance record recoup recourse recovery recriminate recruit rectangle rectangular rectifier rectify rectilinear rectitude rector rectory recumbent recuperate recur recurred recurrent recurring recursion recursive recusant recuse red redact redactor redbird redbud redcoat redden reddish redeem redemption redemptive redhead Redmond redneck redound redpoll redshank redstart Redstone redtop reduce reducible reduct redundant redwood reed reedbuck reedy reef reek reel Reese reeve Reeves refectory refer referee refereeing referenda referendum referent referential referral referred referring re((finery reflect reflectance reflector reflexive reforestation reformatory refract refractometer refractory refrain refrigerate refuge refugee refusal refutation refute regal regale regalia regard regatta regent regime regimen regiment regimentation Regina Reginald region regional Regis registrable registrant registrar registration registry regress regression regret regretful regrettable regretted regretting regular regulate regulatory Regulus rehabilitate rehearsal rehearse Reich Reid reign Reilly reimbursable reimburse rein reindeer reinforce Reinhold reinstate reject rejoice rejoinder relate relax relaxation relay releasable relevant reliable reliant relic relict relief relieve religion religiosity religious relinquish reliquary relish reluctant remainder reman remand remark Rembrandt remediable remedial remedy remember remembrance Remington reminisce reminiscent remiss remission remit remittance remitted remitting remnant remonstrate remorse remorseful remote removal remunerate Remus Rena renaissance renal Renault rend render rendezvous rendition renegotiable renewal Renoir renounce renovate renown Rensselaer rent rental renunciate rep repairman repairmen reparation repartee repeal repeat repeater repel repelled repellent repelling repent repentant repertoire repertory repetition repetitious repetitive replaceable replenish replete replica replicate report reportorial repository reprehensible representative repression repressive reprieve reprimand reprisal reprise reproach reptile reptilian republic republican repudiate repugnant repulsion repulsive reputation repute request require requisite requisition requited reredos rescind rescue resemblant resemble resent resentful reserpine reservation reserve reservoir reside resident residential residual residuary residue residuum resign resignation resilient resin resinlike resiny resist resistant resistible resistive resistor resolute resolution resolve resonant resonate resorcinol resort resourceful respect respectful respiration respirator respiratory respire respite resplendent respond respondent response responsible responsive rest restaurant restaurateur restful restitution restive restoration restorative restrain restraint restrict restroom result resultant resume resuming resumption resurgent resurrect resuscitate ret retail retain retaliate retaliatory retard retardant retardation retch retention retentive reticent reticulate reticulum retina retinal retinue retire retiree retort retract retribution retrieval retrieve retroactive retrofit retrofitting retrograde retrogress retrogressive retrorocket retrospect retrovision return Reub Reuben Reuters reveal revel revelation revelatory revelry revenge revenue rever reverberate revere reverend reverent reverie reversal reverse reversible reversion revert revertive revery revet revile revisable revisal revise revision revisionary revival revive revocable revoke revolt revolution revolutionary revolve revulsion revved revving reward Rex Reykjavik Reynolds rhapsodic rhapsody Rhea Rhenish rhenium rheology rheostat rhesus rhetoric rhetorician rheum rheumatic rheumatism Rhine rhinestone rhino rhinoceros rho Rhoda Rhode Rhodes Rhodesia rhodium rhododendron rhodolite rhodonite rhombi rhombic rhombus rhubarb rhyme rhythm rhythmic rib ribald ribbing ribbon riboflavin ribonucleic Rica rice rich Richard Richards Richardson Richfield Richmond Richter rick rickets Rickettsia rickety rickshaw Rico ricochet rid riddance ridden ridding riddle ride ridge ridgepole Ridgway ridicule ridiculous Riemann riffle rifle rifleman riflemen rift rig Rigel rigging Riggs right righteous rightful rightmost rightward rigid rigorous Riley rill rilly rim rime rimming rimy Rinehart ring ringlet ringside rink rinse Rio Riordan riot riotous rip riparian ripe ripen Ripley ripoff ripping ripple rise risen risible risk risky Ritchie rite Ritter ritual Ritz rival rivalry riven river riverbank riverfront riverine riverside rivet Riviera rivulet Riyadh roach road roadbed roadblock roadhouse roadside roadster roadway roam roar roast rob robbery robbin robbing Robbins robe Robert Roberta Roberto Roberts Robertson robin Robinson robot robotics robust Rochester rock rockabye rockaway rockbound Rockefeller rocket Rockford Rockies Rockland rocklike Rockwell rocky rococo rod rode rodent rodeo Rodgers Rodney Rodriguez roe roebuck Roentgen Roger Rogers rogue roil roister Roland role roll rollback rollick Rollins Roman romance Romano romantic Rome Romeo romp Romulus Ron Ronald rondo Ronnie rood roof rooftop rooftree rook rookie rooky room roomful roommate roomy Roosevelt Rooseveltian roost root rope Rosa Rosalie rosary rose rosebud rosebush Roseland rosemary Rosen Rosenberg Rosenblum Rosenthal Rosenzweig rosette Ross roster rostrum rosy rot Rotarian rotary rotate ROTC rotenone Roth rotogravure rotor rototill rotten rotting rotund rotunda rouge rough roughcast roughen roughish roughneck roughshod roulette round roundabout roundhead roundhouse roundoff roundtable roundup roundworm rouse Rousseau roustabout rout route routine rove row rowboat rowdy Rowe Rowena Rowland Rowley Roy royal royalty Royce RPM RSVP Ruanda rub rubbery rubbing rubbish rubble rubdown Rube Ruben rubicund rubidium rubric ruby ruckus rudder ruddy rude rudiment rudimentary Rudolf Rudolph Rudy Rudyard rue rueful ruffian ruffle rufous Rufus rug ruin ruinous rule rum Rumania rumble rumen Rumford ruminant rummage rummy rump rumple rumpus run runabout runaway rundown rune rung Runge runic runneth running Runnymede runoff runt runty runway Runyon rupee rupture rural ruse rush Rushmore rusk Russ Russell russet Russia Russo russula rust rustic rustle rustproof rusty rut rutabaga Rutgers Ruth ruthenium Rutherford ruthless rutile Rutland Rutledge rutting rutty Rwanda Ryan Rydberg Ryder rye s s's sa sabbath sabbatical Sabina Sabine sable sabotage sabra sac sachem sack sacral sacrament Sacramento sacred sacrifice sacrificial sacrilege sacrilegious sacrosanct sad sadden saddle saddlebag Sadie sadism sadist Sadler safari safe safeguard safekeeping safety saffron sag saga sagacious sagacity sage sagebrush sagging Saginaw sagittal Sagittarius sago saguaro Sahara said Saigon sail sailboat sailfish sailor saint sainthood sake Sal Salaam salacious salad salamander salami salaried salary sale Salem Salerno salesgirl Salesian saleslady salesman salesmen salesperson salient Salina saline Salisbury Salish saliva salivary salivate Salk Salle sallow sally salmon salmonberry salon saloon saloonkeep salsify salt saltbush saltwater salty salubrious salutary salutation salute Salvador salvage salvageable salvation Salvatore salve salvo Sam samarium samba same Sammy Samoa samovar sample Sampson Samson Samuel Samuelson San Sana sanatoria sanatorium Sanborn Sanchez Sancho sanctify sanctimonious sanction sanctity sanctuary sand sandal sandalwood sandbag sandblast Sandburg sanderling Sanders Sanderson sandhill Sandia sandman sandpaper sandpile sandpiper Sandra sandstone Sandusky sandwich sandy sane Sanford sang sangaree sanguinary sanguine sanguineous Sanhedrin sanicle sanitarium sanitary sanitate sank sans Santa Santayana Santiago Santo Sao sap sapiens sapient sapling saponify sapphire sapping sappy sapsucker Sara Saracen Sarah Saran Sarasota Saratoga sarcasm sarcastic sarcoma sardine sardonic Sargent sari sarsaparilla sarsparilla sash sashay Saskatchewan sassafras sat satan satanic satellite satiable satiate satiety satin satire satiric satisfaction satisfactory satisfy saturable saturate saturater Saturday Saturn Saturnalia saturnine satyr sauce saucepan saucy Saud Saudi sauerkraut Saul Sault Saunders sausage saute sauterne savage savagery Savannah savant save Saviour Savonarola savoy Savoyard savvy saw sawbelly sawdust sawfish sawfly sawmill sawtimber sawtooth sawyer sax saxifrage Saxon Saxony saxophone say SC scab scabbard scabious scabrous scaffold Scala scalar scald scale scallop scalp scamp scan scandal scandalous Scandinavia scandium scanning scant scanty scapegoat scapula scapular scar Scarborough scarce scare scarecrow scarf scarface scarify scarlet Scarsdale scarves scary scat scathe scatterbrain scattergun scatting scaup scavenge scenario scene scenery scenic scent sceptic Schaefer Schafer Schantz schedule schelling schema schemata schematic scheme Schenectady scherzo Schiller schism schist schizoid schizomycetes schizophrenia schizophrenic Schlesinger schlieren Schlitz Schloss Schmidt Schmitt Schnabel schnapps Schneider Schoenberg Schofield scholar scholastic school schoolbook schoolboy schoolgirl schoolgirlish schoolhouse schoolmarm schoolmaster schoolmate schoolroom schoolteacher schoolwork schooner Schottky Schroeder Schroedinger Schubert Schultz Schulz Schumacher Schumann Schuster Schuyler Schuylkill Schwab Schwartz Schweitzer sciatica science scientific scientist scimitar scintillate scion scissor sclerosis sclerotic SCM scoff scold scoop scoot scope scopic scops scorch score scoreboard scorecard scoria scorn scornful Scorpio scorpion Scot scotch Scotia Scotland Scotsman Scotsmen Scott Scottish Scottsdale Scotty scoundrel scour scourge scout scowl scrabble scraggly scram scramble scramming Scranton scrap scrapbook scrape scrapping scratch scratchy scrawl scrawny scream screech screechy screed screen screenplay screw screwball screwbean screwdriver screwworm scribble scribe Scribners scrim scrimmage Scripps script scription scriptural scripture scriven scroll scrooge scrounge scrub scrubbing scrumptious scruple scrupulosity scrupulous scrutable scrutiny scuba scud scudding scuff scuffle scull sculpin sculpt sculptor sculptural sculpture scum scurrilous scurry scurvy scuttle scutum Scylla scythe Scythia SD sea seaboard seacoast seafare seafood Seagram seagull seahorse seal sealant seam seaman seamen seamy Sean seance seaport seaquake sear search searchlight Sears seashore seaside season seasonal seat seater Seattle seaward seaweed Sebastian sec secant secede secession seclude seclusion second secondary secondhand secrecy secret secretarial secretariat secretary secrete secretion secretive sect sectarian section sector secular secure sedan sedate sedentary seder sedge sediment sedimentary sedimentation sedition seditious seduce seduction seductive s((edulous see seeable seed seedbed seedling seedy seeing seek seem seen seep seepage seersucker seethe segment segmentation Segovia segregant segregate Segundo Seidel seismic seismograph seismography seismology seize seizure seldom select selectman selectmen selector Selectric Selena selenate selenite selenium self selfish Selfridge Selkirk sell seller sellout Selma seltzer selves Selwyn semantic semaphore semblance semester semi seminal seminar seminarian seminary Seminole Semiramis Semite Semitic semper sen senate senatorial send Seneca Senegal senile senior senor Senora senorita sensate sense sensible sensitive sensor sensory sensual sensuous sent sentence sentential sentient sentiment sentinel sentry Seoul sepal separable separate sepia Sepoy sept septa septate September septennial septic septillion septuagenarian septum sepuchral sepulchral sequel sequent sequential sequester sequestration sequin sequitur Sequoia sera seraglio serape seraphim serenade serendipitous serene serge sergeant Sergei serial seriatim series serif serious sermon serology Serpens serpent serpentine serum servant serve service serviceable serviceberry serviceman servicemen serviette servile servitor servo servomechanism sesame session set setback Seth Seton setscrew setting settle setup seven sevenfold seventeen seventeenth seventh seventieth seventy sever several severalfold severalty severe Severn Seville sew sewage Seward sewerage sewn sex Sextans sextet sextillion sexton sextuple sextuplet sexual sexy Seymour sforzando shabby shack shackle shad shadbush shade shadflower shadow shadowy shady Shafer Shaffer shaft shag shagbark shagging shaggy shah shake shakeable shakedown shaken Shakespeare Shakespearean Shakespearian shako shaky shale shall shallot shallow shalom sham shamble shame shameface shameful shampoo shamrock shan't Shanghai shank Shannon Shantung shanty shape Shapiro shard share sharecrop shareholder Shari shark Sharon sharp Sharpe sharpen sharpshoot Shasta shatter shatterproof Shattuck shave shaven shaw shawl Shawnee shay she she'd she'll Shea sheaf shear Shearer sheath sheathe sheave shed shedding Shedir Sheehan sheen sheep sheepskin sheer sheet Sheffield sheik Sheila Shelby Sheldon shelf shell Shelley shelter Shelton shelve Shenandoah shenanigan Shepard shepherd Sheppard Sheraton sherbet Sheridan sheriff Sherlock Sherman Sherrill sherry Sherwin Sherwood shibboleth shied shield Shields shift shifty shill Shiloh shim shimming shimmy shin shinbone shine shingle Shinto shiny ship shipboard shipbuild shipbuilding shiplap Shipley shipman shipmate shipmen shipping shipshape shipwreck shipyard shire shirk Shirley shirt shirtmake shish shitepoke shiv shiver shivery shoal shock Shockley shod shoddy shoe shoehorn shoelace shoemake shoestring shoji shone shoo shoofly shook shoot shop shopkeep shopping shopworn shore shoreline short shortage shortcoming shortcut shorten shortfall shorthand shortish shortsighted shortstop shot shotbush shotgun should shoulder shouldn't shout shove shovel show showboat showcase showdown showman showmen shown showpiece showplace showroom showy shrank shrapnel shred shredding Shreveport shrew shrewd shrewish shriek shrift shrike shrill shrilly shrimp shrine shrink shrinkage shrive shrivel shroud shrove shrub shrubbery shrug shrugging shrunk shrunken Shu shuck shudder shuddery shuffle shuffleboard Shulman shun shunning shunt shut shutdown shutoff shutout shutting shuttle shuttlecock shy Shylock sial SIAM Siamese Sian sib Siberia sibilant Sibley sibling sibyl sic Sicilian Sicily sick sicken sickish sickle sicklewort sickroom side sidearm sideband sideboard sidecar sidelight sideline sidelong sideman sidemen sidereal siderite sidesaddle sideshow sidestep sidestepping sidetrack sidewalk sidewall sideway sidewinder sidewise sidle Sidney siege Siegel Siegfried Sieglinda Siegmund Siemens sienna sierra siesta sieve sift sigh sight sightsee sightseeing sightseer sigma Sigmund sign signal signature signboard signet significant signify Signor Signora signpost Sikorsky silage silane Silas silent silhouette silica silicate siliceous silicic silicide silicon silicone silk silken silkworm silky sill silly silo silt siltation siltstone silty silver Silverman silversmith silverware silvery sima similar simile similitude simmer Simmons Simon Simons Simonson simper simple simplectic simpleminded simpleton simplex simplicity simplify simplistic simply Simpson Sims simulate simulcast simultaneity simultaneous sin Sinai since sincere Sinclair sine sinew sinewy sinful sing singable Singapore singe single singlehanded singlet singleton singsong singular sinh sinister sinistral sink sinkhole sinning sinter sinuous sinus sinusoid sinusoidal Sioux sip sipping sir sire siren Sirius sis sisal siskin sister Sistine Sisyphean Sisyphus sit site sitting situ situate situs siva six sixfold sixgun sixteen sixteenth sixth sixtieth sixty size sizzle skat skate skater skeet skeletal skeleton skeptic sketch sketchbook sketchpad sketchy skew ski skid skidding skiddy skied skiff skill skillet skillful skim skimming skimp skimpy skin skindive skinning skinny skip skipjack skipping Skippy skirmish skirt skit skittle skulk skull skullcap skullduggery skunk sky Skye skyhook skyjack skylark skylight skyline skyrocket skyscrape skyward skywave skyway slab slack slacken sladang slag slain slake slam slamming slander slanderous slang slant slap slapping slapstick slash slat slate slater slatting slaughter slaughterhouse Slav slave slavery Slavic slavish slay sled sledding sledge sledgehammer sleek sleep sleepwalk sleepy sleet sleety sleeve sleigh sleight slender slept sleuth slew slice slick slid slide slight slim slime slimy sling slingshot slip slippage slippery slipping slit slither slitting sliver slivery Sloan Sloane slob Slocum sloe slog slogan sloganeer slogging sloop slop slope slopping sloppy slosh slot sloth slothful slouch slough sloven slow slowdown sludge slug slugging sluggish sluice slum slumber slumming slump slung slur slurp slurring slurry sly smack small smaller Smalley smallish smallpox smalltime smart smash smattering smear smell smelt smile smirk smith smithereens Smithfield Smithson Smithsonian smithy smitten smog smoke smokehouse smokescreen smokestack smoky smolder smooch smooth smoothbore smother Smucker smudge smudgy smug smuggle smut smutty Smyrna Smythe snack snafu snag snagging snail snake snakebird snakelike snakeroot snap snapback snapdragon snapping snappish snappy snapshot snare snark snarl snatch snazzy sneak sneaky sneer sneeze snell snick Snider sniff sniffle sniffly snifter snigger snip snipe snippet snippy snivel snob snobbery snobbish snook snoop snoopy snore snorkel snort snotty snout snow snowball snowfall snowflake snowstorm snowy snub snubbing snuff snuffer snuffle snuffly snug snuggle snuggly snyaptic Snyder so soak soap soapstone soapsud soapy soar sob sobbing sober sobriety sobriquet soccer sociable social societal Societe society socioeconomic sociology sociometric sociometry sock socket sockeye Socrates Socratic sod soda sodden sodding sodium sofa soffit Sofia soft softball soften software softwood soggy soignee soil soiree sojourn Sol solace solar sold solder soldier soldiery sole solecism solemn solemnity solenoid solicit solicitation solicitor solicitous solicitude solid solidarity solidify soliloquy solipsism solitary solitude solo Solomon Solon solstice soluble solute solution solvate solve solvent soma somal Somali somatic somber sombre some somebody somebody'll someday somehow someone someone'll someplace Somers somersault Somerset Somerville something sometime somewhat somewhere sommelier Sommerfeld somnolent son sonar sonata song songbag songbook songful sonic sonnet sonny Sonoma Sonora sonority sonorous Sony soon soot sooth soothe soothsay soothsayer sop sophia Sophie sophism sophisticate sophistry Sophoclean Sophocles sophomore sophomoric sopping soprano sora sorb sorcery sordid sore Sorensen Sorenson sorghum sorority sorption sorrel sorrow sorrowful sorry sort sortie sou souffle sought soul soulful sound soundproof soup sour sourberry source sourdough sourwood Sousa soutane south Southampton southbound southeast southeastern southern southernmost Southey southland southpaw southward southwest southwestern souvenir sovereign sovereignty soviet sovkhoz sow sowbelly sown soy soya soybean spa space spacecraft spacesuit spacious spade spaghetti Spain spalding span spandrel spangle Spaniard spaniel Spanish spanning spar spare sparge spark sparkle Sparkman sparky sparling sparring sparrow sparse Sparta Spartan spasm spastic spat spate spatial spatlum spatterdock spatula Spaulding spavin spawn spay spayed speak speakeasy spear spearhead spearmint spec special specie species specific specify specimen specious speck speckle spectacle spectacular spectator Spector spectra spectral spectrogram spectrograph spectrography spectrometer spectrometric spectrometry spectrophotometer spectrophotometric spectrophotometry spectroscope spectroscopic spectroscopy spectrum specular speculate sped speech speed speedboat speedometer speedup speedwell speedy spell spellbound Spencer Spencerian spend spent sperm spermatophyte Sperry spew sphagnum sphalerite sphere spheric spheroid spheroidal spherule sphinx Spica spice spicebush spicy spider spiderwort spidery Spiegel spigot spike spikenard spiky spill spilt spin spinach spinal spindle spine spinnaker spinneret spinning spinodal spinoff spinster spiny spiral spire spirit spiritual Spiro spit spite spiteful spitfire spitting spittle spitz splash splashy splat splay splayed spleen spleenwort splendid splenetic splice spline splint splintery split splitting splotch splotchy splurge splutter spoil spoilage Spokane spoke spoken spokesman spokesmen sponge spongy sponsor spontaneity spontaneous spoof spook spooky spool spoon spoonful sporadic spore sport sportsman sportsmen sportswear sportswriter sportswriting sporty spot spotlight spotting spotty spouse spout Sprague sprain sprang sprawl spray spread spree sprig sprightly spring springboard springe Springfield springtail springtime springy sprinkle sprint sprite sprocket Sproul sprout spruce sprue sprung spud spume spumoni spun spunk spur spurge spurious sp((urn spurring spurt sputnik sputter spy spyglass squabble squad squadron squalid squall squamous squander square squash squashberry squashy squat squatting squaw squawbush squawk squawroot squeak squeaky squeal squeamish squeegee squeeze squelch Squibb squid squill squint squire squirehood squirm squirmy squirrel squirt squishy Sri SST St St. stab stabbing stabile stable stableman stablemen staccato stack Stacy stadia stadium staff Stafford stag stage stagecoach stagnant stagnate stagy Stahl staid stain stair staircase stairway stairwell stake stalactite stale stalemate Staley Stalin stalk stall stallion stalwart stamen Stamford stamina staminate stammer stamp stampede Stan stance stanch stanchion stand standard standby standeth Standish standoff standpoint standstill Stanford Stanhope stank Stanley stannic stannous Stanton stanza staph staphylococcus staple Stapleton star starboard starch starchy stardom stare starfish stargaze stark Starkey starlet starlight starling Starr starring start startle startup starvation starve stash stasis state Staten stater stateroom statesman statesmanlike statesmen statewide static stationarity stationary stationery stationmaster statistician Statler stator statuary statue statuette stature status statute statutory Stauffer staunch Staunton stave stay stayed stead steadfast steady steak steal stealth stealthy steam steamboat steamy Stearns steed steel Steele steelmake steely Steen steep steepen steeple steeplebush steer steeve Stefan stein Steinberg Steiner stella stellar stem stemming stench stencil stenographer stenography stenotype step stepchild Stephanie stephanotis Stephen Stephens Stephenson stepmother steppe stepping steprelation stepson stepwise steradian stereo stereography stereoscopy sterile sterling stern sternal Sterno sternum steroid stethoscope Stetson Steuben Steve stevedore Steven Stevens Stevenson stew steward stewardess Stewart stick stickle stickleback stickpin sticktight sticky stiff stiffen stifle stigma stigmata stile stiletto still stillbirth stillwater stilt stimulant stimulate stimulatory stimuli stimulus sting stingy stink stinkpot stinky stint stipend stipple stipulate stir Stirling stirring stirrup stitch stochastic stock stockade stockbroker stockholder Stockholm stockpile stockroom Stockton stocky stodgy stoic stoichiometric stoichiometry stoke Stokes stole stolen stolid stomach stomp stone stonecrop Stonehenge stonewall stoneware stonewort stony stood stooge stool stoop stop stopband stopcock stopgap stopover stoppage stopping stopwatch storage store storehouse storekeep storeroom Storey stork storm stormbound stormy story storyboard storyteller stout stove stow stowage strabismic strabismus straddle strafe straggle straight straightaway straighten straightforward straightway strain strait strand strange strangle strangulate strap strapping strata stratagem strategic strategist strategy Stratford stratify stratosphere stratospheric Stratton stratum Strauss straw strawberry strawflower stray streak stream streamline streamside street streetcar strength strengthen strenuous streptococcus stress stressful stretch strewn striate stricken Strickland strict stricture stride strife strike strikebreak string stringent stringy strip stripe stripping striptease strive striven strobe stroboscopic strode stroke stroll Strom Stromberg strong stronghold strongroom strontium strop strophe stropping strove struck structural structure struggle strum strumming strung strut strutting strychnine Stuart stub stubbing stubble stubborn stubby stucco stuck stud studding Studebaker student studio studious study stuff stuffy stultify stumble stump stumpage stumpy stun stung stunk stunning stunt stupefy stupendous stupid stupor Sturbridge sturdy sturgeon Sturm stutter Stuttgart Stuyvesant Stygian style styli stylish stylites stylus stymie styrene Styrofoam Styx suave sub subbing subject subjectivity sublimate subliminal submersible submit submittal submitted submitting subpoena subrogation subservient subsidiary subsidy subsist subsistent substantial substantiate substantive substituent substitute substitution substitutionary substrate subsume subsumed subsuming subterfuge subterranean subtle subtlety subtly subtrahend suburb suburbia subversive subvert succeed success successful succession successive successor succinct succubus succumb such suck suckling suction sud Sudan Sudanese sudden suds sue suey Suez suffer suffice sufficient suffix suffocate Suffolk suffrage suffragette suffuse sugar suggest suggestible suggestion suggestive suicidal suicide suit suitcase suite suitor sulfa sulfate sulfide sulfite sulfonamide sulfur sulfuric sulfurous sulk sulky sullen Sullivan sully sulphur sultan sultry sum sumac Sumatra Sumerian summand summarily summary summate Summers summertime summing summit summitry summon Sumner sumptuous Sumter sun sunbeam sunbonnet sunburn sunburnt Sunday sunder sundew sundial sundown sundry sunfish sunflower sung sunk sunken sunlight sunlit sunning sunny Sunnyvale sunrise sunset sunshade sunshine sunshiny sunspot suntan suntanned suntanning SUNY sup super superannuate superb superbly supercilious superficial superfluity superfluous superintendent superior superlative superlunary supernatant superposable supersede superstition superstitious supervene supervisory supine supping supplant supple supplementary supplicate supply support supposable suppose supposition suppress suppressible suppression suppressor supra supranational supremacy supreme surcease surcharge sure surety surf surface surfactant surfeit surge surgeon surgery surgical surmise surmount surname surpass surplus surprise surreal surrender surreptitious surrey surrogate surround surtax surtout surveillant survey surveyor survival survive survivor Sus Susan Susanne susceptible sushi Susie suspect suspend suspense suspension suspensor suspicion suspicious Sussex sustain sustenance Sutherland Sutton suture Suzanne suzerain suzerainty Suzuki svelte swab swabbing swabby swag Swahili swain swallow swallowtail swam swami swamp swampy swan swank swanky swanlike Swanson swap swapping swarm swart Swarthmore Swarthout swarthy swastika swat swatch swath swathe swatting sway Swaziland swear sweat sweatband sweater sweatshirt sweaty Swede Sweden Swedish Sweeney sweep sweepstake sweet sweetheart sweetish swell swelt swelter Swenson swept swerve swift swig swigging swim swimming swimsuit swindle swine swing swingable swingy swipe swirl swirly swish swishy swiss switch switchblade switchboard switchgear switchman Switzer Switzerland swivel swizzle swollen swoop sword swordfish swordplay swordtail swore sworn swum swung sybarite Sybil sycamore sycophant sycophantic Sydney syenite Sykes syllabic syllabify syllable syllogism syllogistic sylvan Sylvania Sylvester Sylvia symbiosis symbiotic symbol symbolic symmetric symmetry sympathetic sympathy symphonic symphony symposia symposium symptom symptomatic synagogue synapse synapses synaptic synchronism synchronous synchrony synchrotron syncopate syndic syndicate syndrome synergism synergistic synergy synod synonym synonymous synonymy synopses synopsis synoptic syntactic syntax synthesis synthetic Syracuse Syria syringa syringe syrinx syrup syrupy system systematic systemic systemization systemwide t t's tab tabbing tabernacle table tableau tableaux tablecloth tableland tablespoon tablespoonful tablet tabloid taboo tabu tabula tabular tabulate tachinid tachometer tacit Tacitus tack tackle tacky Tacoma tact tactful tactic tactile tactual tad tadpole taffeta taffy taft tag tagging Tahiti Tahoe tail tailgate tailor taint Taipei Taiwan take taken takeoff takeover talc talcum tale talent talisman talismanic talk talkative talkie talky tall Tallahassee tallow tally tallyho Talmud talon talus tam tamale tamarack tamarind tambourine tame Tammany tamp Tampa tampon tan tanager Tanaka Tananarive tandem tang tangent tangential tangerine tangible tangle tango tangy tanh tank tannin tanning tansy tantalum Tantalus tantamount tantrum Tanya Tanzania tao Taoist Taos tap tapa tape taper tapestry tapeworm tapir tapis tappa tappet tapping tar tara tarantara tarantula Tarbell tardy target tariff tarnish tarpaper tarpaulin tarpon tarring tarry Tarrytown tart tartar Tartary Tarzan task taskmaster Tasmania Tass tassel taste tasteful tasting tasty tat tate tater tatting tattle tattler tattletale tattoo tatty tau taught taunt Taurus taut tautology tavern taverna tawdry tawny tax taxation taxi taxicab taxied taxonomy taxpayer taxpaying Taylor tea teacart teach teacup teahouse teakettle teakwood teal team teammate teamster teamwork teapot tear teardrop tearful tease teasel teaspoon teaspoonful teat tech technetium technic technician technique technology tectonic tecum ted tedding Teddy tedious tedium tee teeing teem teen teenage teensy teet teeth teethe teetotal Teflon Tegucigalpa Teheran Tehran tektite Tektronix telecommunicate teleconference Teledyne Telefunken telegram telegraph telegraphy telekinesis telemeter telemetric telemetry teleology teleost telepathic telepathy telephone telephonic telephony telephotography teleprinter teleprocessing teleprompter telescope telescopic teletype teletypesetting teletypewrite televise television Telex tell teller tellurium temerity temper tempera temperance temperate temperature tempest tempestuous template temple Templeton tempo temporal temporary tempt temptation temptress ten tenable tenacious tenacity tenant tend tendency tenderfoot tenderloin tendon tenebrous tenement tenet tenfold Tenneco Tennessee Tenney tennis Tennyson tenon tenor tense tensile tension tensional tensor tenspot tent tentacle tentative tenth tenuous tenure tepee tepid teratogenic teratology terbium tercel Teresa term terminable terminal terminate termini terminology terminus termite tern ternary Terpsichore terpsichorean Terra terrace terrain terramycin terrapin Terre terrestrial terrible terrier terrific terrify territorial territory terror terry terse tertiary Tess tessellate test testament testamentary testate testes testicle testicular testify testimonial testimony testy tetanus tete tether tetrachloride tetrafluouride tetragonal tetrahedra tetrahedral tetrahedron tetravalent Teutonic Texaco Texan Texas text t((extbook textile Textron textual textural texture Thai Thailand Thalia thallium thallophyte than thank thankful thanksgiving that that'd that'll thatch thaw Thayer the Thea theatric Thebes thee theft their Thelma them thematic theme themselves then thence thenceforth theocracy Theodore Theodosian theologian theology theorem theoretic theoretician theorist theory therapeutic therapist therapy there there'd there'll thereabouts thereafter thereat thereby therefor therefore therefrom therein thereof thereon Theresa thereto theretofore thereunder thereupon therewith thermal thermionic thermistor thermo thermocouple thermodynamic thermoelastic thermoelectric Thermofax thermometer thermometric thermometry thermomigrate thermonuclear thermopile thermoplastic thermopower thermosetting thermostable thermostat thermostatic thesaurus these theses Theseus thesis thespian theta Thetis they they'd they'll they're they've thiamin thick thicken thicket thickish thief thieves thieving thigh thimble Thimbu thin thine thing think thinning thinnish thiocyanate thiouracil third thirst thirsty thirteen thirteenth thirtieth thirty this this'll thistle thistledown thither Thomas Thomistic Thompson Thomson thong Thor Thoreau thoriate thorium thorn Thornton thorny thorough thoroughbred thoroughfare thoroughgoing Thorpe Thorstein those thou though thought thoughtful thousand thousandth thrash thread threadbare threat threaten three threefold threesome thresh threshold threw thrice thrift thrifty thrill thrips thrive throat throaty throb throbbing throes thrombosis throne throng throttle through throughout throughput throw throwback thrown thrum thrumming thrush thrust Thruway Thuban thud thudding thug thuggee Thule thulium thumb thumbnail thump thunder thunderclap thunderflower thunderous thunderstorm Thurman Thursday thus thwack thwart thy thyratron thyroglobulin thyroid thyroidal thyronine thyrotoxic thyroxine ti Tiber tibet Tibetan tibia tic tick ticket tickle ticklish tid tidal tidbit tide tideland tidewater tidings tidy tie tied Tientsin tier Tiffany tift tiger tight tighten tigress Tigris til tilde tile till tilt tilth Tim timber timberland timbre time timeout timepiece timeshare timetable timeworn Timex timid Timon timothy tin tincture tinder tine tinfoil tinge tingle tinker tinkle tinning tinsel tint tintype tiny Tioga tip tipoff Tipperary tipping tipple tippy tipsy tiptoe tirade Tirana tire tiresome tissue tit Titan titanate titanic titanium tithe titian titillate title titmouse titrate titular Titus TNT to toad toady toast tobacco Tobago toccata today today'll Todd toddle toe toenail toffee tofu tog together togging toggle Togo togs toil toilet toilsome tokamak token Tokyo told Toledo tolerable tolerant tolerate toll tollgate tollhouse Tolstoy toluene Tom tomato tomatoes tomb tomblike tombstone tome Tomlinson Tommie tommy tomography tomorrow Tompkins ton tonal tone tong tongue Toni tonic tonight tonk tonnage tonsil tonsillitis tony too toodle took tool toolkit toolmake toolsmith toot tooth toothbrush toothpaste tootle top topaz topcoat Topeka topgallant topic topmost topnotch topocentric topography topology topping topple topsoil Topsy tor torah torch tore tori torn tornado toroid toroidal Toronto torpedo torpid torpor torque torr Torrance torrent torrid torsion torso tort tortoise tortoiseshell tortuous torture torus tory Toshiba toss tot total totalitarian tote totem totemic touch touchdown touchstone touchy tough tour tournament tousle tout tow toward towboat towel tower towhead towhee town townhouse Townsend townsman townsmen toxic toxicology toxin toy Toyota trace traceable tracery trachea track trackage tract tractor Tracy trade trademark tradeoff tradesman tradesmen tradition traffic trafficked trafficking trag tragedian tragedy tragic tragicomic trail trailside train trainee trainman trainmen traipse trait traitor traitorous trajectory tram trammel tramp trample tramway trance tranquil tranquillity transact transalpine transatlantic transceiver transcend transcendent transcendental transconductance transcontinental transcribe transcript transcription transducer transduction transect transept transfer transferee transference transferor transferral transferred transferring transfix transform transformation transfusable transfuse transfusion transgress transgression transgressor transient transistor transit Transite transition transitive transitory translate transliterate translucent transmissible transmission transmit transmittable transmittal transmittance transmitted transmitter transmitting transmutation transmute transoceanic transom transpacific transparent transpiration transpire transplant transplantation transport transportation transposable transpose transposition transship transshipping transversal transverse transvestite trap trapezium trapezoid trapezoidal trapping trash trashy Trastevere trauma traumatic travail travel travelogue traversable traversal traverse travertine travesty Travis trawl tray treacherous treachery tread treadle treadmill treason treasonous treasure treasury treat treatise treaty treble tree treelike treetop trefoil trek trekking trellis tremble tremendous tremor tremulous trench trenchant trencherman trenchermen trend trendy Trenton trepidation trespass tress trestle Trevelyan triable triad trial triangle triangular triangulate Triangulum Trianon triatomic tribal tribe tribesman tribesmen tribulate tribunal tribune tributary tribute Trichinella trichloroacetic trichloroethane trichrome trick trickery trickle trickster tricky trident tridiagonal tried triennial trifle trifluouride trig trigonal trigonometric trigonometry trigram trill trillion trilobite trilogy trim trimer trimester trimming Trinidad trinitarian trinity trinket trio triode trioxide trip tripartite tripe triphenylphosphine triple triplet Triplett triplex triplicate tripod tripoli tripping triptych trisodium Tristan tristate trisyllable trite tritium triton triumph triumphal triumphant triune trivalent trivia trivial trivium trod trodden troglodyte troika Trojan troll trolley trollop trombone trompe troop trophic trophy tropic tropopause troposphere tropospheric trot trotting trouble troubleshoot troublesome trough trounce troupe trouser trout Troutman troy truancy truant truce truck truculent trudge Trudy true truism truly Truman Trumbull trump trumpery trumpet truncate trundle trunk truss trust trustee trustful trustworthy truth truthful TRW try trypsin tsar tsarina tsunami TTL TTY tub tuba tube tuberculin tuberculosis tubular tubule tuck Tucson Tudor Tuesday tuff tuft tug tugging tuition Tulane tularemia tulip tulle Tulsa tum tumble tumbrel tumult tumultuous tun tuna tundra tune tuneful tung tungstate tungsten tunic Tunis Tunisia tunnel tupelo turban turbinate turbine turbofan turbojet turbulent turf Turin Turing turk turkey Turkish turmoil turn turnabout turnaround turnery turnip turnkey turnoff turnout turnover turnpike turnstone turntable turpentine turpitude turquoise turret turtle turtleback turtleneck turvy Tuscaloosa Tuscan Tuscany Tuscarora tusk Tuskegee tussle tutelage tutor tutorial Tuttle tutu tuxedo TV TVA TWA twaddle twain tweak tweed tweedy tweeze twelfth twelve twentieth twenty twice twiddle twig twigging twilight twill twin twine twinge twinkle twinning twirl twirly twist twisty twit twitch twitchy twitting two twofold Twombly twosome TWX Tyburn tycoon tying Tyler type typeface typescript typeset typesetter typesetting typewrite typewritten typhoid Typhon typhoon typhus typic typify typo typographer typography typology tyrannic tyrannicide tyranny tyrant tyrosine Tyson u u's ubiquitous ubiquity UCLA Uganda ugh ugly UK Ukrainian Ulan ulcer ulcerate Ullman Ulster ulterior ultimate ultimatum ultra ultracentrifuge ultraconservative ultrafast ultramarine ultramodern ultrashort ultrasonic ultrasound ultrastructure ultraviolet Ulysses umber umbilical umbilici umbilicus umbra umbrage umbrella umpire UN unanimity unanimous unary unbeknownst unbidden unchristian uncle uncouth unction under underclassman underclassmen underling undulate UNESCO uniaxial unicorn unidimensional unidirectional uniform unify unilateral unimodal uninominal union uniplex unipolar uniprocessor unique Uniroyal unison unit unitarian unitary unite unity Univac univalent univariate universal universe Unix unkempt unruly until unwieldy up upbeat upbraid upbring upcome update updraft upend upgrade upheaval upheld uphill uphold upholster upholstery upkeep upland uplift upon upper upperclassman upperclassmen uppercut uppermost upraise upright uprise upriver uproar uproarious uproot upset upsetting upshot upside upsilon upslope upstair upstand upstate upstater upstream upsurge upswing uptake Upton uptown uptrend upturn upward upwind urania uranium Uranus uranyl urban Urbana urbane urbanite urchin urea uremia urethane urethra urge urgency urgent urging urinal urinary urine Uris urn Ursa Ursula Ursuline Uruguay us USA usable USAF usage USC USC&GS USDA use useful USGS usher USIA USN USPS USSR usual usurer usurious usurp usurpation usury Utah utensil uterine Utica utile utilitarian utility utmost utopia utopian utter utterance uttermost v v's vacant vacate vacationland vaccinate vaccine vacillate vacua vacuo vacuolate vacuole vacuous vacuum vade Vaduz vagabond vagary vagina vaginal vagrant vague Vail vain vainglorious vale valedictorian valedictory valent valentine Valerie Valery valet valeur Valhalla valiant valid validate Valkyrie Valletta valley Valois valuate value valve vamp vampire van vanadium Vance Vancouver vandal Vandenberg Vanderbilt Vanderpoel vanguard vanilla vanish vanity vanquish vantage variable variac Varian variant variate variegate variety various varistor Varitype varnish vary vascular vase vassal vast vat Vatican vaudeville Vaudois Vaughan Vaughn vault veal vector vectorial Veda vee veer veery Vega vegetable vegetarian vegetate vehement vehicle vehicular veil vein Velasquez veldt Vella vellum velocity velours velvet velvety venal vend vendetta vendible vendor veneer venerable venerate venereal Venetian Veneto Venezuela vengeance vengeful venial Venice venison venom venomous vent ventilate ventricle venture venturesome venturi Venus Venusian Vera veracious veracity ve((randa verandah verb verbal verbatim verbena verbiage verbose verbosity verdant Verde Verdi verdict verge veridic verify verisimilitude veritable verity Verlag vermeil vermiculite vermilion vermin Vermont vermouth Verna vernacular vernal Verne vernier Vernon Verona Veronica versa Versailles versatile verse version versus vertebra vertebrae vertebral vertebrate vertex vertical vertices vertigo verve very vesicular vesper vessel vest vestal vestibule vestige vestigial vestry vet vetch veteran veterinarian veterinary veto vetting vex vexation vexatious vi via viaduct vial vibrant vibrate vibrato viburnum vicar vicarious vice vicelike viceroy Vichy vicinal vicinity vicious vicissitude Vicksburg Vicky victim victor Victoria Victorian victorious victory victrola victual Vida video videotape vie Vienna Viennese Vientiane Viet Vietnam Vietnamese view viewpoint vigil vigilant vigilante vigilantism vignette vigorous vii viii Viking vile vilify villa village villain villainous villein Vincent vindicate vindictive vine vinegar vineyard Vinson vintage vintner vinyl viola violate violent violet violin Virgil virgin virginal Virginia Virginian Virgo virgule virile virtual virtue virtuosi virtuosity virtuoso virtuous virulent virus vis visa visage viscera visceral viscoelastic viscometer viscosity viscount viscous vise viselike Vishnu visible Visigoth vision visionary visit visitation visitor visor vista visual vita vitae vital vitamin vitiate Vito vitreous vitrify vitriol vitriolic vitro viva vivace vivacious vivacity Vivaldi Vivian vivid vivify vivo vixen viz Vladimir Vladivostok vocable vocabularian vocabulary vocal vocalic vocate vociferous Vogel vogue voice voiceband void volatile volcanic volcanism volcano volition Volkswagen volley volleyball Volstead volt Volta voltage voltaic Voltaire Volterra voltmeter voluble volume volumetric voluminous voluntary volunteer voluptuous Volvo vomit von voodoo voracious voracity vortex vortices vorticity Voss votary vote votive vouch vouchsafe Vought vow vowel voyage Vreeland Vulcan vulgar vulnerable vulpine vulture vulturelike vying w w's Waals Wabash WAC wack wacke wacky Waco wad waddle wade wadi Wadsworth wafer waffle wag wage wagging waggle Wagner wagoneer wah Wahl wail wainscot Wainwright waist waistcoat waistline wait Waite waitress waive wake Wakefield wakeful waken wakerobin wakeup Walcott Walden Waldo Waldorf Waldron wale Walgreen walk walkie walkout walkover walkway wall wallaby Wallace wallboard Waller wallet Wallis wallop wallow wallpaper Walls wally walnut Walpole walrus Walsh Walt Walter Walters Waltham Walton waltz wan wand wander wane Wang wangle want wanton wapato wapiti Wappinger war warble ward warden wardrobe wardroom ware warehouse warehouseman warfare warhead Waring warlike warm warmhearted warmish warmonger warmth warmup warn warp warrant warranty warren warring warrior Warsaw wart wartime warty Warwick wary was wash washbasin washboard washbowl Washburn Washington washout washy wasn't wasp waspish Wasserman wast wastage waste wastebasket wasteful wasteland wastewater wastrel watch watchband watchdog watchful watchmake watchman watchmen watchword water Waterbury watercourse waterfall waterfront Watergate Waterhouse waterline Waterloo Waterman watermelon waterproof Waters watershed waterside Watertown waterway watery Watkins Watson watt wattage wattle Watts wave waveform wavefront waveguide wavelength wavenumber wavy wax waxen waxwork waxy way waybill waylaid waylay Wayne wayside wayward we we'd we'll we're we've weak weaken weal wealth wealthy wean weapon weaponry wear wearied wearisome weary weasel weather weatherbeaten weatherproof weatherstrip weatherstripping weave web Webb webbing weber Webster WECo wed wedding wedge wedlock Wednesday wee weed weedy week weekday weekend Weeks weep Wehr Wei Weierstrass weigh weight weighty Weinberg Weinstein weir weird Weiss Welch welcome weld Weldon welfare well wellbeing Weller Welles Wellesley wellington Wells welsh welt Wendell Wendy went wept were weren't Werner wert Werther Wesley Wesleyan west westbound Westchester westerly western westernmost Westfield Westinghouse Westminster Weston westward wet wetland wetting Weyerhauser whack whale Whalen wham whamming wharf Wharton wharves what what'd what're whatever Whatley whatnot whatsoever wheat Wheatstone whee wheedle wheel wheelbase wheelchair wheelhouse wheeze wheezy Whelan whelk Wheller whelm whelp when whence whenever where where'd where're whereabout whereas whereby wherefore wherein whereof whereon wheresoever whereupon wherever wherewith whet whether whetting which whichever whiff whig while whim whimper whimsey whimsic whine whinny whip whiplash Whippany whippet whipping Whipple whipsaw whir whirl whirligig whirlpool whirlwind whirring whisk whisper whistle whistleable whit Whitaker Whitcomb white whiteface Whitehall whitehead Whitehorse whiten whitetail whitewash whither Whitlock Whitman Whitney Whittaker Whittier whiz whizzing who who'd who'll whoa whoever whole wholehearted wholesale wholesome wholly whom whomsoever whoop whoosh whop whopping whore whose whosoever whup why Wichita wick wicket wide widen widespread widgeon widget widow widowhood width widthwise wield wiener Wier wife wig wigging Wiggins wiggle wiggly wigmake Wilbur Wilcox wild wildcat wildcatter wilderness wildfire wildlife wile Wiley Wilfred wilful Wilhelm Wilhelmina Wilkes Wilkins Wilkinson will Willa Willard willful William Williams Williamsburg Williamson Willie Willis Willoughby willow willowy Wills Wilma Wilmington Wilshire Wilson Wilsonian wilt wily win wince winch Winchester wind windbag windbreak windfall windmill window windowpane windowsill windshield Windsor windstorm windup windward windy wine winemake winemaster winery wineskin Winfield wing wingback wingman wingmen wingspan wingtip Winifred wink winkle Winnetka Winnie winning Winnipeg Winnipesaukee winnow wino Winslow winsome Winston winter Winters wintertime Winthrop wintry winy wipe wire wireman wiremen wiry Wisconsin wisdom wise wiseacre wisecrack wisenheimer wish wishbone wishful wishy wisp wispy wistful wit witch witchcraft with withal withdraw withdrawal withdrawn withdrew withe wither withheld withhold within without withstand withstood withy witness Witt witting witty wive wizard wobble woe woebegone woeful wok woke Wolcott wold wolf Wolfe Wolff Wolfgang wolfish wolve woman womanhood womb women won won't wonder wonderful wonderland wondrous Wong wont woo wood Woodard Woodbury woodcarver woodcock woodcut wooden woodgrain woodhen woodland Woodlawn woodlot woodpeck woodrow woodruff Woods woodshed woodside woodward woodwind woodwork woody woodyard wool woolen woolgather Woolworth Wooster wop Worcester word Wordsworth wordy wore work workbench workday workhorse workload workman workmanlike workmen workout workpiece worksheet workshop workspace worktable world worldwide worm wormy worn worrisome worry worse worsen worship worshipful worst worth Worthington worthwhile worthy Wotan would wouldn't wound wove woven wow wrack wraith wrangle wrap wrapping wrapup wrath wrathful wreak wreath wreathe wreck wreckage wrench wrest wrestle wretch wriggle wright Wrigley wring wrinkle wrist wristband wristwatch writ write writeup writhe written wrong wrongdoer wrongdoing wrongful Wronskian wrote wrought wry Wu Wuhan Wyandotte Wyatt Wyeth Wylie Wyman Wyner wynn Wyoming x x's Xavier xenon xenophobia xerography Xerox Xerxes xi xylem xylene xylophone y y's yacht yachtsman yachtsmen yah yak Yakima Yale Yalta yam Yamaha yang yank Yankee Yankton Yaounde yap yapping Yaqui yard yardage yardstick Yarmouth yarmulke yarn yarrow Yates yaw yawl yawn ye yea Yeager yeah year yearbook yearn yeast yeasty Yeats yell yellow yellowish Yellowknife yelp Yemen yen yeoman yeomanry yeshiva yesterday yesteryear yet Yiddish yield yin yip yipping YMCA yodel Yoder yoga yogi yoke yokel Yokohama Yokuts yolk yon yond Yonkers yore York Yorktown Yosemite Yost you you'd you'll you're you've young youngish youngster Youngstown your yourself yourselves youth youthful yow Ypsilanti ytterbium yttrium Yucatan yucca Yugoslav Yugoslavia yuh Yuki Yukon yule Yves Yvette YWCA z z's Zachary zag zagging Zaire Zambia Zan Zanzibar zap zapping zeal Zealand zealot zealous zebra Zeiss Zellerbach Zen zenith zero zeroes zeroth zest zesty zeta Zeus Ziegler zig zigging zigzag zigzagging zilch Zimmerman zinc zing Zion Zionism zip zipping zircon zirconium zloty zodiac zodiacal Zoe Zomba zombie zone zoo zoology zoom Zoroaster Zoroastrian zounds Zurich your yourself yourselves youth youthful yow Ypsilanti ytterbium yttrium Yucatan yucca Yugoslav Yugoslavia yuh Yuki Yukon yule Yves Yvette YWCA z z's Zachary zag zagging Zaire Zambia Zalib/libnm.a 644 0 33 33214 2552606136 6074 ! __.SYMDEF 363531363 0 27 100664 7886 ` \ !!! %&&r(r(~+~+--//R1 R12"5_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_del_step_arc_quad_abs_box_circle_closevt_closepl_dot_erase_lbl_mv_lbl_umv_((label_line_linemod_move_openvt_openpl_point_scale_space_obotx_oboty_botx_boty_scalex_scaley_scaleflag_oloy_ohiy_ohix_oextra_cont_putch_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_xargc_xargv_main__sigfdie__sigidie__sigqdie__sigindie__sigtdie__sigdie_s_rnge_abort__getarg__iargc__getenv__signal__s_stop_s_paus_system__pow_ci_pow_dd_pow_di_pow_hh_pow_ii_pow_ri_pow_zi_pow_zz_c_abs_c_cos_c_div_c_exp_c_log_c_sin_c_sqrt_z_abs_z_cos_z_div_z_exp_z_log_z_sin_z_sqrt_r_abs_r_acos_r_asin_r_atan_r_atn2_r_cnjg_r_cos_r_cosh_r_dim_r_exp_r_imag_r_int_r_lg10_r_log_r_mod_r_nint_r_sign_r_sin_r_sinh_r_sqrt_r_tan_r_tanh_srand__rand__d_abs_d_acos_d_asin_d_atan_d_atn2_d_cnjg_d_cos_d_cosh_d_dim_d_exp_d_imag_d_int_d_lg10_d_log_d_mod_d_nint_d_prod_d_sign_d_sin_d_sinh_d_sqrt_d_tan_d_tanh_i_abs_i_dim_i_dnnt_i_indx_i_len_i_mod_i_nint_i_sign_h_abs_h_dim_h_dnnt_h_indx_h_len_h_mod_h_nint_h_sign_l_ge_l_gt_l_le_l_lt_hl_ge_hl_gt_hl_le_hl_lt_ef1asc__ef1cmc__s_cat_s_cmp_s_copy_cabs_tanh_sinh_cosh_f_back_s_rdfe_c_dfe_y_getc_y_err_y_rsk_s_wdfe_y_putc_y_rev_e_rdfe_e_wdfe_s_rdue_c_due_s_wdue_e_rdue_e_wdue_icptr_icend_svic_icnum_icpos_z_getc_z_putc_z_rnew_s_rsfi_c_si_y_ierr_s_wsfi_z_wnew_e_rsfi_e_wsfi_f_inqu_setcilist_setolist_stcllist_setalist_f_rew_s_rsfe_x_getc_x_endp_xrd_SL_x_rev_rd_ed_rd_I_rd_L_rd_A_rd_AW_rd_F_rd_ned_rd_POS_rd_H_recloc_s_rsue_c_sue_s_wsue_e_wsue_e_rsue_reclen_do_us_do_uio_do_ud_s_wsfe_x_putc_xw_end_xw_rev_x_wSL_pr_put_e_rsfe_c_sfe_e_wsfe_syl_parenlvl_pc_revloc_pars_f_f_s_op_gen_f_list_i_tem_ne_d_e_d_gt_num_ap_end_cnt_ret_cp_rp_workdone_nonl_en_fio_do_fio_type_f_fmt_bg_s_wsle_t_putc_l_write_e_wsle_lwrt_I_lwrt_L_lwrt_A_lwrt_F_lwrt_C_lioproc_ltab_l_comma_l_first_t_getc_e_rsle_lquit_lcount_ltype_lchar_lx_ly_l_read_l_R_l_C_l_L_l_CHAR_rd_int_s_rsle_c_le_do_lio_f_open_isdev_fk_open_f_clos_f_exit_flush__g_char_b_char_inode_mvgbt_f_end_t_runc_mv_cur_w_ed_wrt_I_wrt_IM_wrt_L_wrt_A_wrt_AW_wrt_E_wrt_G_wrt_F_w_ned_wrt_AP_wrt_H_units_init_elist_reading_cplus_cblank_fmtbuf_external_doed_doned_doend_donewrec_dorevert_sequential_formatted_getn_putn_cf_curunit_recpos_cursor_scale_F_err_fatal_f_init_canseek_nowreading_nowwriting_icvt_dfe_rdfe_wdfe_s_rdfe_c_dfe_y_getc_y_tab_y_rnew_s_wdfe_y_putc_y_wnew_e_rdfe_e_wdfe_y_rend_y_wend_due_s_rdue_c_due_s_wdue_e_rdue_e_wdue_z_getc_z_putc_z_wnew_z_ungetc_s_rsfi_z_rnew_z_tab_c_si_s_wsfi_s_rdfi_c_di_s_wdfi_c_fi_e_rsfi_e_wsfi_e_rdfi_e_wdfi_c_li_s_rsli_s_wsli_e_rsli_e_wsli_iiorec__iiopos__recloc_rsue_sue_s_rsue_c_sue_s_wsue_e_wsue_e_rsue_s_rsfe_c_sfe_x_getc_x_rnew_x_tab_e_rsfe_new_s_wsfe_pr_put_x_putc_x_wend_x_wnew_e_wsfe_lrd_lchar_lx_ly_ltype_ltab_s_rsle_l_read_t_getc_e_rsle_t_sep_l_R_l_C_l_L_l_CHAR_lr_comm_get_repet_rd_int_s_wsle_t_putc_l_write_e_wsle_lwrt_I_lwrt_F_lwrt_D_lwrt_C_lwrt_DC_lwrt_L_lwrt_A_chk_len_lwrt_0_cnt_ret_cp_rp_dfio_en_fio_do_fio_type_f_fmt_bg_eor_uio_do_us_due_err_do_uio_do_ud_c_le_do_lio_rd_ed_rd_mvcur_rd_I_rd_L_rd_AW_rd_F_rd_ned_rd_POS_rd_H_w_ed_wr_mvcur_wrt_IM_wrt_L_wrt_AW_wrt_E_wrt_G_wrt_F_w_ned_wrt_AP_wrt_H_syl_parenlvl_pc_revloc_pars_f_f_s_op_gen_f_list_i_tem_ne_d_e_d_gt_num_ap_end__digit_icvt_bksp_f_back_f_rew_f_open_isdev_fk_open_f_clos_f_exit_flush__endf_f_end_t_runc_f_inqu_allocs_allocp_alloct_allocx_malloc_free_calloc_realloc_tmplate_fortfile_units_reading_external_sequential_formatted_fmtbuf_icptr_icend_fmtptr_doed_doned_doend_donewrec_dorevert_dotab_lioproc_getn_putn_ungetn_svic_cf_curunit_lunit_lfname_recpos_recnum_reclen_cursor_scale_radix_signit_tab_cplus_cblank_elist_errflag_endflag_lquit_l_first_leof_lcount_line_len_fatal_prnt_fmt_prnt_ext_prnt_int_ffputc_f_init_ini_std_canseek_finode_nowreading_nowwriting_g_char_b_char_inode_last_char_f_errlist_f_nerr_sccs_id_init66__no_66__box_wclear_initscr_endwin_mvprintw_mvwprintw_mvscanw_mvwscanw_mvwin_newwin_subwin_overlay_overwrite_printw__sprintw_wprintw_scanw__sscans_wscanw__win_wrefresh_touchwin_werase_wclrtobot_wclrtoeol__win_mvcur_fgoto_plod__putchar_plodput_putpad_ospeed_gettmode_setterm_zap_getcap_longname_delwin_winsertln_wdeleteln_scroll_wgetstr_wgetch_waddstr_waddch_wmove__echoit__rawmode_My_term__endwin_ttytype_Def_term__tty_ch_LINES_COLS__res_flg_stdscr_curscr__tty_AM_BS_CA_DA_DB_EO_GT_HZ_IN_MI_MS_NC_OS_UL_XN_NONL_UPPERCASE_normtty__pfast_AL_BC_BT_CD_CE_CL_CM_DC_DL_DM_DO_ED_EI_HO_IC_IM_IP_LL_MA_ND_SE_SF_SO_SR_TA_TE_TI_UC_UE_UP_US_VB_VE_VS_PC__unctrl_wstandout_wstandend_tstp_winsch_wdelch_getwd_prexit_cat_getwd_prexit_cat_killpg_killpg_setpgrp_getpgrp_setpgrp_getpgrp_sigsys_sigpeel_sigsys_sigpeel_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_wait3_wait3_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_sigsys_sigpeel_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_sigsys_sigpeel_allprint_printable_sprint_main_yyreject_yyracc_yyless_yywrap_allprint_printable_sprint_main_yyreject_yyracc_yyless_yywrap_errno_asin_acos_atan_atan2_hypot_cabs_errno_jn_yn_errno_j0_y0_errno_j1_y1_errno_pow_errno_signgam_gamma_errno_log_log10_cos_sin_errno_sqrt_errno_tan_tanh_sinh_cosh_errno_erf_erfc_errno_exp_floor_ceil_pow_rpow_gcd_invert_msqrt_mdiv_m_div_m_dsb_m_trq_m_in_m_out_sdiv_s_div_min_omin_mout_omout_fmout_fmin_mult_m_mult_tradd_m_add_madd_msub_m_sub_move_xfree_xalloc_dummy_fatal_mcan_itom_mcmp_getwd_prexit_cat_getwd_prexit_cat_killpg_killpg_setpgrp_getpgrp_setpgrp_getpgrp_sigsys_sigpeel_sigsys_sigpeel_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_wait3_wait3_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_sigsys_sigpeel_signal__sigcatch_sigset_sighold_sigpause_sigrelse_sigignore_sigsys_sigpeel_errno_acos_asin_atan_atan2satan_cbrt_errno_pow_exp_exp10_log_log10_sin_cos_sinh_cosh_sqrtdsqrt_r5_tan_tanhacos.o 363529480 0 27 100664 269 ` @ <0^q; q9!p2Pp~pPcPP@!h@  "/ : @!_errno_pio2_acosL16_asin asin.o 363529481 0 27 100664 354 ` X(pVrVVqV !|PeVVPcP~qVfVPcPP gPVPsrPP@!h % 3 :G  !" %(A+X0K3Q6_asin_errno_sqrtsatanEDOMa1a2a3pio2a4a5atan.o 363529482 0 27 100664 746 ` xPpP rPP`rPPZpPp RaPRTqPTsPrPpPsRfRP 'bPrPPcPPfRP rPPrPPqP-qPgPPcPPaPRbPfRP`qPpPXePPVuVdPXuV-gPXP"?D{Av#OP#C"+C|]2CU*j 6@xBJh{CW*TsCL~Sz2CU*j 6I@!h@!hAy2?ϒyIA!h-5HVp| m;3 %\(N+4.d1,7y:@$FINTZ_atan_atan2a1satanb1b2pio2b3b4pib5sq2m1c1xatansq2p1c2pio4pcoefqcoefcbrt.o 363529482 0 27 100664 340 ` x0H SpT hrTTЏSTVTW{VVWVVSVUT^ePPRgRTRcRPRd,RbRPePPRgRTRcRPRdRbRPdGPV P|P?@EkW@/)q@?v:tn@?G6H^i tx!$_cbrtrangeretzpcoefthirdhcpow.o 363529486 0 27 100664 390 ` (<P^qWqq _pPj nPqP Hr~pPeP ~pPrPpPp~pPeP ~!wp%P %A Q m }  _errno_powL15_log_expexp.o 363529487 0 27 100664 720 ` dXePpPpPqPrPqP"pPtPZVsP`VZbVeVVXuX,dPVuX9cVPR`VPfRPdaPPRRZZP=B.pBԝ`E=sM@iD(/zCF:|+eVuCVufGbqhIgN5%L%dD!X]1 I䔶Txة3OLX2) %U` l"*7.M2?6E:J>DtJ_sin_cosrangenegargtwoopitwoopixbseqdaqdbqdcqddpcoefqcoefsinh.o 363529490 0 27 100664 286 ` X0<pVqVqVeVVPuP4dVPpV~gPRbRPdPp~gPR`RPdP3,;WjS87OL0P: +8=v*?ϰ@ . G  >(X"_sinh_cosh_expexpfrmpcoefsqrt.o 363529491 0 27 100664 301 ` H<pPpPTZ0yex =EyV+L0ւ@ـX(F̍@NnD)Dju  +\3 9#S&>)b.K16O9?E_tanc1fopifopixa0a1a2a3a4b1rtanb2funyb3pcoefqcoef tanh.o 363529493 0 27 100664 301 ` X0TZpVZZVqV*pPZPpV~pPXgX~qVeVVPuPdVPdPcnXPanXRfRPZP3,;WjS87OL0P: +8=v*?ϰ@$ < HXL!_tanh_expt1t2t3pcoeft4 >)b.K16O9?E_tanc1fopifopixa0a1a2a3a4b1rtanb2funyb3pcoefqcoef tanh.o 363529493 0 27 100664 301 ` X0TZpVZZVqV*pPZPpV~pPXgX~qVeVVPuPdVPdPcnXPanXRfRPZP3,;WjS87OL0P: +8=v*?ϰ@lib/libpc.a 644 0 33 77136 2552607234 6077 ! __.SYMDEF 363531937 0 27 100664 1738 `  V  ! ) / 4:AHRXajrpw~ pR !N"#V$Z%~&v'$(D)*j,-.&0p1234 68:<'t=.$>5>=?E<@M@UA]TBeCmCuD}F2HIJKLLM>NO~P~Q(RnSTVVWXZ[ ]^:`a(6f0Th8pj@lIlPlWl_lglnlwlllllllllllqhsZtvv$wx Dyyz%4|+B}2_ACTFILE_ADDT_ARGV_ASRT_BUFF__cntbl_CARD_CHR_CLCK__mask_CTTOT__pd_date_DATE_DEFNAME_DISPOSE_EXPO_FCALL_FLUSH_FNIL_FRTN_FSAV_GET_GOTO_HALT_IN_INCT_LINO_LLIMIT_LN_MAX_MULT_NAM_NEW_NEWZ_NIL_PACK_PAGE_PRED_PUT_RANDOM_RANG4_READ4_READ8_READC_READE_READLN_RELEQ_RELNE_RELSGE_RELSGT_RELSLE_RELSLT_RELTGE_RELTGT_RELTLE_RELTLT_REMOVE_RESET_REWRITE_ROUND_RSNG4_SCLCK_SEED_SQRT_STLIM_SUBSC_SUBSCZ_SUBT_SUCC_TEOF_TEOLN_TIME_TRUNC_UNIT_UNPACK_WRITEC_WRITEF_WRITES_WRITLN_ERROR_GETNAME_IOSYNC_PCEXIT_PCLOSE__disply__argc__argv__stlim__stcnt__seed__minptr__maxptr__filefre__fchain_input__actfile_output__err__inwin__outwin__errwin_PCSTART_PERROR_PFLUSH_PMFLUSH_RAND_SETRACE_UNSYNC_UNWIND_blkclr_blkcpy_APPEND_SEEK_TELLACTFILE.o 363499633 201 31 100755 97 `   ЬPР P@(#)ACTFILE.c 1.1 10/29/80 _ACTFILE ADDT.o 363499636 201 31 100755 110 `   Ь[Ь ZЬYЬXɊXЬP@(#)ADDT.c 1.2 3/7/81F _ADDTARGV.o 363499648 201 31 100755 287 ` P@0 Ь[Ь YѬݬKxPP`ZY j YPYP@(#)ARGV.c 1.3 6/10/81Argument to argv of %D is out of range    ,  _ARGV__argc_ERROR__argv ASRT.o 363499652 201 31 100755 201 ` (@լݬ*0@(#)ASRT.c 1.2 6/10/81Assertion failed: %s Assertion failed  " _ASRT_ERROR BUFF.o 363499658 201 31 100755 267 ` D<(^լݭPѬݭP@(#)BUFF.c 1.2 3/7/81  . 6 =   #+_BUFF_output_ACTFILE__sobuf_setbuf CARD.o 363499674 201 31 100755 398 ` $Ь[ЬYZP@&PPZYZP@(#)CARD.c 1.2 3/7/81*< V__cntbl_CARDCHR.o 363499682 201 31 100755 192 ` (@լ Ѭݬ&P@(#)CHR.c 1.3 6/10/81Argument to chr of %D is out of range   _CHR_ERRORCLCK.o 363499690 201 31 100755 129 ` ^߭2PP@(#)CLCK.c 1.2 3/7/81  k _CLCK_times CTTOT.o 363499714 201 31 100755 781 ` d$8(^Ь[\ZЬЬ PxPPxPP[P[YԉYԭ1íѭzzíѭѭ1xxЭP@Wѭ P@WЭPW@kPxPP[PPxPP[PY ȏiYYѭP@yPЭQPAk֭ѭج1$ԭ[X8íѭ z1#PxPPxQAhRPRRAh֭ѭج[P@(#)CTTOT.c 1.4 6/10/81Range upper bound of %D out of set bounds Range lower bound of %D out of set bounds Value of %D out of set bounds PZa 4| __mask_CTTOT_ERROR DATE.o 363499719 201 31 100755 229 ` 8$0^Ь[߭߭PY[Z'XP@ih@(#)DATE.c 1.1 10/29/80     %MPcW!__pd_date_DATE_time_ctime DEFNAME.o 363499725 201 31 100755 150 ` $Ь[ݬݬ ݬ[P[@(#)DEFNAME.c 1.2 3/7/81 E _DEFNAME_GETNAMEDISPOSE.o 363499736 201 31 100755 372 ` d@<H Ь[ЬZkZkPP kTkkZZkPPZk@(#)DISPOSE.c 1.3 6/10/81Pointer value out of legal range   (/ 9 @ I T ]  0&y,_DISPOSE__maxptr__minptr_ERROR_freeEXPO.o 363499740 201 31 100755 266 ` d($ ^qoPp~h߭ݏe߭PZ[ [PQPQ0Q[j-[P[P@(#)EXPO.c 1.2 3/7/81%.1e " 2  Fv_EXPO_sprintf_indexFCALL.o 363499746 201 31 100755 212 ` <$ Ь[[PxQQP~x~[~x~@(#)FCALL.c 1.4 6/8/81 ! ' 7  /_FCALL__disply_blkcpyFLUSH.o 363499751 201 31 100755 264 ` <80 Ь[ <P@[2 ݫ @(#)FLUSH.c 1.2 6/10/81Reference to an inactive file  % 5  L$_FLUSH__actfile_ER((ROR_fflushFNIL.o 363499757 201 31 100755 323 ` L\0(Ь[ <P@[B ݫV [kP@(#)FNIL.c 1.3 6/10/81Reference to an inactive file %s: Reference to an inactive file  )0 D  3#_FNIL__actfile_ERROR_IOSYNC FRTN.o 363499762 201 31 100755 183 ` 0$Ь[ЫP[QxPPPQ^}anx~@(#)FRTN.c 1.5 6/8/81 )  /_FRTN__disply_blkcpy FSAV.o 363499769 201 31 100755 179 ` ,$Ь [ЬkЬ[~x~[P@(#)FSAV.c 1.3 4/1/81 !  /_FSAV__disply_blkcpy GET.o 363499779 201 31 100755 288 ` <h$ Ь[ݫ@ ݫ`[@(#)GET.c 1.2 6/10/81%s: Attempt to read, but open for writing %s: Tried to read past end of file " ,  3_GET_ERROR_IOSYNCGOTO.o 363499780 201 31 100755 330 ` $PмЭm\/\`Rݭ}Active frame not found in non-local goto " *4>P[b  /_GOTO__disply_ERRORHALT.o 363499785 201 31 100755 259 ` (0<(+@(#)HALT.c 1.3 6/10/81Call to procedure halt    !  J.'_HALT_PFLUSH__iob_fputs_PCEXIT IN.o 363499790 201 31 100755 128 ` 8 ì[[ PЬPx[Q[RxRRRRA`PRPP@(#)IN.c 1.2 3/7/81\_ININCT.o 363499797 201 31 100755 138 ` < Ь[\ZYZYY[[PY[YY P@(#)INCT.c 1.2 3/7/81 _INCTLINO.o 363499806 201 31 100755 261 ` ,@0(PPP$@(#)LINO.c 1.2 6/10/81Statement count limit of %D exceeded    #  6I!_LINO__stcnt__stlim_ERROR LLIMIT.o 363499818 201 31 100755 199 ` 48Ь[լЏЬѫݫ(@(#)LLIMIT.c 1.3 6/10/81%s: Line limit exceeded $+  _LLIMIT_ERROR LN.o 363499824 201 31 100755 232 ` ,D$ q:p~6p~@(#)LN.c 1.4 6/10/81Non-positive argument of %e to ln  % b_LN_ERROR_logMAX.o 363499830 201 31 100755 188 ` ,8Ь[[4¬[[ [PЬ P@(#)MAX.c 1.4 6/10/81Non-positive format width: %D   _MAX_ERRORMULT.o 363499835 201 31 100755 114 ` $ Ь[Ь ZЬYЬXҊPPXЬP@(#)MULT.c 1.2 3/7/81 _MULTNAM.o 363499840 201 31 100755 228 ` <P Ь[ЬZ[ [P2jQPQݬ2ZP2KjQQP@(#)NAM.c 1.3 6/10/81Enumerated type value of %D is out of range on output %  _NAM_ERRORNEW.o 363499845 201 31 100755 326 ` \,<8^ݬPPUЭѭЭPP PP@(#)NEW.c 1.3 6/10/81Ran out of memory  " 0 : G V  0!*_NEW_malloc_ERROR__minptr__maxptrNEWZ.o 363499850 201 31 100755 359 ` `,H@^ݬP[\[[[[ѭЭ[ݬ@(#)NEWZ.c 1.3 6/10/81Ran out of memory   + 4 B L X  0"+3_NEWZ_malloc_ERROR__minptr__maxptr_blkclr NIL.o 363499855 201 31 100755 250 ` ,<0 Ѭ Ѭ&ЬP@(#)NIL.c 1.2 6/10/81Pointer value out of legal range   !  0"_NIL__maxptr__minptr_ERRORPACK.o 363499859 201 31 100755 217 ` H8^Ь Zìѭݬ>ŬPP[[PPY[Y@(#)PACK.c 1.3 6/10/81i = %D: Bad i to pack(a,i,z) %  _PACK_ERROR PAGE.o 363499869 201 31 100755 308 ` DX0(Ь[ݫHݫ Ы P ݫN@(#)PAGE.c 1.2 6/10/81%s: Attempt to write, but open for reading Could not write to  $ 6=  ` _PAGE_ERROR_fputc_PERRORPRED.o 363499876 201 31 100755 269 ` @d ѬI׬ѬѬ ݬUЬP@(#)PRED.c 1.4 6/10/81Cannot take pred of first element of a range Value of %D is out of range  -4  _PRED_ERROR PUT.o 363499884 201 31 100755 312 ` HX0(Ь[ݫLݫ ݫ kЫ P ݫM@(#)PUT.c 1.3 6/10/81%s: Attempt to write, but open for reading Could not write to  ) ;B 6 [` _PUT_ERROR_fwrite_PERRORRANDOM.o 363499893 201 31 100755 193 ` $ $ PnPPfP@(#)RANDOM.c 1.3 3/7/81O    _RANDOM__seed_RAND RANG4.o 363499902 201 31 100755 186 ` (8ѬѬ ݬ'ЬP@(#)RANG4.c 1.3 6/10/81Value of %D is out of range   _RANG4_ERRORREAD4.o 363499912 201 31 100755 426 ` p08^Ь['ݫqݫ ݫ[߭lݫ PPPªЭP@(#)READ4.c 1.5 6/10/81%s: Attempt to read, but open for writing %ld%s: Tried to read past end of file %s: Bad data found on integer read )0 : CM  x"_READ4_ERROR_UNSYNC_fscanfREAD8.o 363499923 201 31 100755 422 ` p08 ^Ь['ݫqݫ ݫ[߭lݫ PPPªpP@(#)READ8.c 1.4 6/10/81%s: Attempt to read, but open for writing %lf%s: Tried to read past end of file %s: Bad data found on real read )0 : CM  x"_READ8_ERROR_UNSYNC_fscanfREADC.o 363499933 201 31 100755 294 ` @h$ ^Ь[ݫA ݫa[P@(#)READC.c 1.2 6/10/81%s: Attempt to read, but open for writing %s: Tried to read past end of file % /  3_READC_ERROR_IOSYNCREADE.o 363499947 201 31 100755 621 ` <@^Ь[ݫ ݫ/[߭ݫ PPP`YILYYЬZ2WP2jQQP2X2jPXPXXYݭ߭Y\P2PWPXW߭1_@(#)READE.c 1.5 6/10/81%s: Attempt to read, but open for writing %*[ ]%74[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]%s: Tried to read past end of file Unknown name "%s" found on enumerated type read & 0 9C   x")_READE_ERROR_UNSYNC_fscanf_RELEQ READLN.o 363499953 201 31 100755 140 ` Ь[[@(#)READLN.c 1.4 6/10/81   3_READLN_IOSYNCRELEQ.o 363499960 201 31 100755 115 ` $ Ь[Ь ZЬYYYPP@(#)RELEQ.c 1.2 3/7/81 _RELEQ RELNE.o 363499968 201 31 100755 115 ` $ Ь[Ь ZЬYYYPP@(#)RELNE.c 1.2 3/7/81 _RELNE RELSGE.o 363499974 201 31 100755 120 ` ( Ь[Ь ZЬYYY{zPP@(#)RELSGE.c 1.2 3/7/81W _RELSGERELSGT.o 363499979 201 31 100755 120 ` ( Ь[Ь ZЬYYY{zPP@(#)RELSGT.c 1.2 3/7/81f _RELSGTRELSLE.o 363499985 201 31 100755 120 ` ( Ь[Ь ZЬYYY{zPP@(#)RELSLE.c 1.2 3/7/81a _RELSLERELSLT.o 363499992 201 31 100755 120 ` ( Ь[Ь ZЬYYY{zPP@(#)RELSLT.c 1.2 3/7/81p _RELSLTRELTGE.o 363499999 201 31 100755 116 ` $ ((Ь[Ь ZxYˋPPYP@(#)RELTGE.c 1.2 3/7/81[ _RELTGERELTGT.o 363500007 201 31 100755 132 ` 4 Ь[Ь ZxYPYkjPˊPYˋPP@(#)RELTGT.c 1.2 3/7/81j _RELTGTRELTLE.o 363500013 201 31 100755 116 ` $ Ь[Ь ZxYˊPPYP@(#)RELTLE.c 1.2 3/7/81e _RELTLERELTLT.o 363500019 201 31 100755 132 ` 4 Ь[Ь ZxYPYjkPˋPYˊPP@(#)RELTLT.c 1.2 3/7/81t _RELTLTREMOVE.o 363500027 201 31 100755 347 ` xH0( ^ЬZ[[ZK [P[@ [Lݬ_[Z[ KK[[ZK߭P߭?@(#)REMOVE.c 1.3 6/10/81%s: File name too long Could not remove 18 \ ip m u`#_REMOVE_ERROR_unlink_PERROR RESET.o 363500038 201 31 100755 473 ` <THЬ[լ:[1$,ݫ Pݫݬݬ ݬ[P[q$[~P ի ݫLp[~ݫ [@(#)RESET.c 1.4 6/10/81Could not reset rCould not open  # 07 S \g   e`!*t19_RESET_input_fseek_PERROR_GETNAME_fopen_setbuf REWRITE.o 363500049 201 31 100755 333 ` d0<0Ь[ݬݬ ݬ[P[_$[~P ի ݫD!p[~ݫ @(#)REWRITE.c 1.3 6/10/81wCould not create  ( :A ^  t`%-_REWRITE_GETNAME_fopen_PERROR_setbuf ROUND.o 363500055 201 31 100755 163 ` $0 q2 a2PjPPc-P@(#)ROUND.c 1.3 3/7/81@@p _ROUND RSNG4.o 363500063 201 31 100755 182 ` $8լѬݬ%ЬP@(#)RSNG4.c 1.3 6/10/81Value of %D is out of range  V _RSNG4_ERRORSCLCK.o 363500070 201 31 100755 130 ` ^߭2PP@(#)SCLCK.c 1.2 3/7/81   _SCLCK_timesSEED.o 363500092 201 31 100755 141 ` ^ЬЭP@(#)SEED.c 1.5 3/7/81   _SEED__seed SQRT.o 363500107 201 31 100755 235 ` ,D$ q:p~6p~@(#)SQRT.c 1.3 6/10/81Negative argument of %e to sqrt  % & _SQRT_ERROR_sqrt STLIM.o 363500129 201 31 100755 262 ` ,@0(,Ь@(#)STLIM.c 1.2 6/10/81Statement count limit of %D exceeded    $  6I"_STLIM__stcnt_ERROR__stlimSUBSC.o 363500150 201 31 100755 194 ` (@ѬѬ ݬ'ЬP@(#)SUBSC.c 1.3 6/10/81Subscript value of %D is out of range  m _SUBSC_ERRORSUBSCZ.o 363500163 201 31 100755 195 ` $DլѬݬ)ЬP@(#)SUBSCZ.c 1.3 6/10/81Subscript value of %D is out of range   _SUBSCZ_ERROR SUBT.o 363500171 201 31 100755 110 `   Ь[Ь ZЬYЬXˊXЬP@(#)SUBT.c 1.2 3/7/81 _SUBTSUCC.o 363500179 201 31 100755 265 ` <d Ѭ EѬ ݬTЬP@(#)SUCC.c 1.4 6/10/81Cannot take succ of last element of a range Value of %D is out of range  )0  _SUCC_ERROR TEOF.o 363500193 201 31 100755 271 ` D80 Ь[ <P@[:P[P@(#)TEOF.c 1.3 6/10/81Reference to an inactive file  % 7  3#_TEOF__actfile_ERROR_IOSYNC TEOLN.o 363500209 201 31 100755 268 ` @80 Ь[ <P@[6[PP@(#)TEOLN.c 1.3 6/10/81Reference to an inactive file  % / . 3$_TEOLN__actfile_ERROR_IOSYNCTIME.o 363500218 201 31 100755 191 ` <$^Ь[߭߭PY[Z YPPY XXX@(#)TIME.c 1.1 10/29/80   W_TIME_time_ctime TRUNC.o 363500227 201 31 100755 87 `  jP@(#)TRUNC.c 1.2 3/7/81 _TRUNC UNIT.o 363500233 201 31 100755 283 ` @\$ Ь[ <P@[6 ݫJ[P@(#)UNIT.c 1.2 6/10/81Reference to an inactive file %s: Reference to an inactive file  )0  _UNIT__actfile_ERROR UNPACK.o 363500236 201 31 100755 223 ` H<^Ь ZìѭݬBŬPP[[PPY[Y@(#)UNPACK.c 1.3 6/10/81i = %D: Bad i to unpack(z,a,i) %  _UNPACK_ERROR WRITEC.o 363500243 201 31 100755 318 ` H\0(Ь[ݫPݬ ~Ы P ݫT@(#)WRITEC.c 1.4 6/10/81%s: Attempt to write, but open for reading Could not write to  & 8?  `"_WRITEC_ERROR_fputc_PERRORWRITEF.o 363500253 201 31 100755 336 ` X\0(Ь[ݫ`ݬ$ݬ ݬݬݬݬݬ ݬЫ P ݫS@(#)WRITEF.c 1.4 6/10/81%s: Attempt to write, but open for reading Could not write to  7 IP  `$_WRITEF_ERROR_fprintf_PERRORWRITES.o 363500262 201 31 100755 323 ` L\0(Ь[ݫTݬݬݬ ݬЫ P ݫS@(#)WRITES.c 1.4 6/10/81%s: Attempt to write, but open for reading Could not write to  + =D  [`#_WRITES_ERROR_fwrite_PERROR WRITLN.o 363500267 201 31 100755 370 ` Xx00Ь[ݫ` ݫ֫ѫݫ Ы P ݫj@(#)WRITLN.c 1.2 6/10/81%s: Attempt to write, but open for reading %s: Line limit exceeded Could not write to " 9 KR ( `"_WRITLN_ERROR_fputc_PERRORERROR.o 363500272 201 31 100755 370 ` X8HH ѬݬBЬPݬ ݬݬ@(#)ERROR.c 1.8 6/10/81Label of %D not found in case     *0 7 K R  J. S)2_ERROR_PFLUSH__iob_fputc_SETRACE_fprintfGETNAME.o 363500292 201 31 100755 1042 ` d ΀^Ь[Ь  <P@[1լ Ь ԫ ԫЏp[k̀P[P Џ[ yP@qPeP[@\V^ЭЭPРЭPѫPЭP[ynի iݫ  ݫ ݫ Ы P ݫ$լݫPݫլ:$[PP<PaP~$[~r$[ZJJ ZZZL ݬn1\ZZ JJ$ZZJ$@(#)GETNAME.c 1.6 6/10/81%s: Close failed Could not remove #tmp.%c%d%s: File name too long  m s }          " 7 DK k   U!j*L2:BIuQ`YpaFj_GETNAME__actfile__filefre__fchain_fflush_setbuf_fclose_ERROR_unlink_PERROR_getpid_sprintfIOSYNC.o 363500300 201 31 100755 482 ` $(^Ь[ݫ ݫ ݫ ݫ kЫ P ݫЫ P <  kPPk֭ѭ   @(#)IOSYNC.c 1.5 6/10/81%s: Attempt to read, but open for writing %s: Tried to read past end of file %s: Tried to read past end of file % U g3 N_IOSYNC_ERROR_freadPCEXIT.o 363500304 201 31 100755 480 ` h``X^ݏ:߭nfNp~m>ݬ@(#)PCEXIT.c 1.1 10/29/80pC %1ld %s %04.2f seconds cpu time. statements executed in   ' 2>D JP W a  J6(($+.1:@_PCEXIT_PCLOSE_PFLUSH__stcnt_times__iob_fprintf_exitPCLOSE.o 363500311 201 31 100755 534 ` @lX[1ѫ1ի i@ݫ ݫ ݫ Ы P ݫhݫPݫV}<P@qЫ[[1r[o@(#)PCLOSE.c 1.4 6/10/81%s: Close failed Could not remove  , 8 B T[ k x    jL%-4u<`DN_PCLOSE__fchain_fflush_setbuf_fclose_ERROR_unlink_PERROR__actfilePCSTART.o 363500316 201 31 100755 1263 ` $x^ԽѭH@(#)PCSTART.c 1.5 6/10/81 HH(T(a astandard inputstandard outputMessage fileD$ 0 4<    / I@#6D+H20L;PDUTNjXWH^hp4(v~b.__disply__argc__argv__stlim__stcnt__seed__minptr__maxptr__filefre__fchain_input__actfile_output__err__inwin__outwin__errwin__iob_PCSTART PERROR.o 363500321 201 31 100755 317 ` <T8 ݬݬP@(#)PERROR.c 1.1 6/10/81    ! + 5 ` J.!S*19_PERROR_PFLUSH__iob_fputc_SETRACE_fputs_perror PFLUSH.o 363500329 201 31 100755 181 ` ($[ ݫ Ы[[@(#)PFLUSH.c 1.1 10/29/80  J jL_PFLUSH__fchain_fflush PMFLUSH.o 363500336 201 31 100755 386 ` x0H@Ь P2` ~Ь PЬЬ PЬ n_P['[~ݬ  [ 1@(#)PMFLUSH.c 1.3 3/7/81pmon.outwpmon.out +18 P ^ jq  t["*2_PMFLUSH_time_fopen_fwrite_fclose_perrorRAND.o 363500338 201 31 100755 78 `  zmNAP{PQP _RANDSETRACE.o 363500339 201 31 100755 69 `  Э PS _SETRACE UNSYNC.o 363500344 201 31 100755 299 ` @l$ Ь[ݫH ݫhݫ ~@(#)UNSYNC.c 1.3 6/10/81%s: Attempt to read, but open for writing %s: Tried to read past end of file " :  A_UNSYNC_ERROR_ungetc UNWIND.o 363500348 201 31 100755 124 ` ݼ@(#)UNWIND.c 1.2 3/7/81  _UNWIND_PCLOSEblkclr.o 363500353 201 31 100755 104 `  Ь[ЬZZPZP@(#)blkclr.c 1.1 3/7/81 _blkclrblkcpy.o 363500357 201 31 100755 140 ` < Ь[Ь ZЬYY[PPZYPYPYZY[{zYPYP@(#)blkcpy.c 1.1 3/7/81 _blkcpyAPPEND.o 363500371 201 31 100755 328 ` `0<0Ь[[P[^$[~P ի ݫC!p[~ݫ @(#)APPEND.c 1.2 6/10/81aCould not open  % 7> [  t`$,_APPEND_GETNAME_fopen_PERROR_setbufSEEK.o 363500376 201 31 100755 209 ` 4($Ь[ݼݫ Pݫ!@(#)SEEK.c 1.3 6/17/81Could not seek  '.  e`_SEEK_fseek_PERROR TELL.o 363500381 201 31 100755 224 ` L$ ^Ь[Ϋ ~ݫ ݫ PޭP%Q`aP@(#)TELL.c 1.3 6/17/81 - ;E e|_TELL_fseek_ftell0755 209 ` 4($Ь[ݼݫ Pݫ!@(#)SEEK.c 1.3 6/17/81Could not seek  '.  e`_SEEK_fseek_PERROR TELL.o 363500381 201 31 100755 224 ` L$ ^Ь[Ϋ ~ݫ ݫ PޭP%Q`aP@(#)TELL.c 1.3 6/17/81lib/tags 644 0 33 35104 2305371177 5512 ASSERT /usr/src/libc/gen/malloc.c ?^#define ASSERT(p) if(!(p))botch("p");else$? CTRL /usr/src/lib/libtermlib/tgoto.c ?^#define CTRL(c) ('c' & 037)$? Mmain /usr/src/lib/libln/main.c ?^main(){$? Mtc1 /usr/src/lib/libtermlib/tc1.c ?^main(argc, argv) char **argv; {$? Mtc2 /usr/src/lib/libtermlib/tc2.c ?^main(argc, argv) char **argv; {$? _cleanup /usr/src/libc/stdio/flsbuf.c ?^_cleanup()$? _cleanup /usr/src/lib/libNS/flsbuf.c ?^_cleanup()$? _doscan /usr/src/libc/stdio/doscan.c ?^_doscan(iop, fmt, argp)$? _error /usr/src/libc/stdio/error.c ?^_error(s)$? _filbuf /usr/src/libc/stdio/filbuf.c ?^_filbuf(iop)$? _filbuf /usr/src/lib/libNS/filbuf.c ?^_filbuf(iop)$? _flsbuf /usr/src/libc/stdio/flsbuf.c ?^_flsbuf(c, iop)$? _flsbuf /usr/src/lib/libNS/flsbuf.c ?^_flsbuf(c, iop)$? _getccl /usr/src/libc/stdio/doscan.c ?^_getccl(s)$? _innum /usr/src/libc/stdio/doscan.c ?^_innum(ptr, type, len, size, iop, eofptr)$? _instr /usr/src/libc/stdio/doscan.c ?^_instr(ptr, type, len, iop, eofptr)$? _strout /usr/src/libc/stdio/strout.c ?^_strout(count, string, adjust, file, fillch)$? acos /usr/src/lib/libm/asin.c ?^acos(arg) double arg; {$? acos /usr/src/lib/libnm/acos.c ?^acos(arg) double arg; {$? additem /usr/src/lib/libdbm/dbm.c ?^additem(buf, item)$? allock /usr/src/libc/gen/malloc.c ?^allock()$? allprint /usr/src/lib/libln/allprint.c ?^allprint(c)$? asctime /usr/src/libc/gen/ctime.c ?^asctime(t)$? asin /usr/src/lib/libm/asin.c ?^asin(arg) double arg; {$? asym /usr/src/lib/libm/gamma.c ?^asym(arg)$? asympt /usr/src/lib/libm/j0.c ?^asympt(arg) double arg;{$? asympt /usr/src/lib/libm/j1.c ?^asympt(arg) double arg;{$? atan /usr/src/lib/libm/atan.c ?^atan(arg)$? atan2 /usr/src/lib/libm/atan.c ?^atan2(arg1,arg2)$? atoi /usr/src/libc/gen/atoi.c ?^atoi(ap)$? atol /usr/src/libc/gen/atol.c ?^atol(p)$? attach /usr/src/libc/gen/mpx.c ?^attach(sub,gp)$? botch /usr/src/libc/gen/malloc.c ?^botch(s)$? cabs /usr/src/lib/libm/hypot.c ?^cabs(arg)$? calchash /usr/src/lib/libdbm/dbm.c ?^calchash(item)$? calloc /usr/src/libc/gen/calloc.c ?^calloc(num, size)$? ceil /usr/src/lib/libm/floor.c ?^ceil(d)$? cfree /usr/src/libc/gen/calloc.c ?^cfree(p, num, size)$? chan /usr/src/libc/gen/mpx.c ?^chan(gr)$? chkblk /usr/src/lib/libdbm/dbm.c ?^chkblk(buf)$? ckill /usr/src/libc/gen/mpx.c ?^ckill(index,gp,sig)$? clearbusy /usr/src/libc/gen/malloc.c ?^#define clearbusy(p) (union store *)((INT)(p)&~BUS? clearerr /usr/src/libc/stdio/clrerr.c ?^clearerr(iop)$? clrbuf /usr/src/lib/libdbm/dbm.c ?^clrbuf(cp, n)$? cmpdatum /usr/src/lib/libdbm/dbm.c ?^cmpdatum(d1, d2)$? connect /usr/src/libc/gen/mpx.c ?^connect(fd,ch,side)$? cos /usr/src/lib/libm/sin.c ?^cos(arg)$? cosh /usr/src/lib/libm/sinh.c ?^cosh(arg)$? crypt /usr/src/libc/gen/crypt.c ?^crypt(pw,salt)$? ct_numb /usr/src/libc/gen/ctime.c ?^ct_numb(cp, n)$? ctime /usr/src/libc/gen/ctime.c ?^ctime(t)$? cvt /usr/src/libc/gen/ecvt.c ?^cvt(arg, ndigits, decpt, sign, eflag)$? dbm_access /usr/src/lib/libdbm/dbm.c ?^dbm_access(hash)$? dbminit /usr/src/lib/libdbm/dbm.c ?^dbminit(file)$? debug /usr/src/libc/gen/mpx.c ?^debug(var,val)$? delete /usr/src/lib/libdbm/dbm.c ?^delete(key)$? delitem /usr/src/lib/libdbm/dbm.c ?^delitem(buf, n)$? detach /usr/src/libc/gen/mpx.c ?^detach(sub,gp)$? dummy /usr/src/lib/libmp/util.c ?^dummy(){}$? dysize /usr/src/libc/gen/ctime.c ?^dysize(y)$? ecvt /usr/src/libc/gen/ecvt.c ?^ecvt(arg, ndigits, decpt, sign)$? encrypt /usr/src/libc/gen/crypt.c ?^encrypt(block, edflag)$? endgrent /usr/src/libc/stdio/getgrent.c ?^endgrent()$? endpwent /usr/src/libc/stdio/getpwent.c ?^endpwent()$? erf /usr/src/lib/libm/erf.c ?^erf(arg) double arg;{$? erfc /usr/src/lib/libm/erf.c ?^erfc(arg) double arg;{$? execat /usr/src/libc/gen/execvp.c ?^execat(s1, s2, si)$? execlp /usr/src/libc/gen/execvp.c ?^execlp(name, argv)$? execvp /usr/src/libc/gen/execvp.c ?^execvp(name, argv)$? exp /usr/src/lib/libm/exp.c ?^exp(arg)$? extract /usr/src/libc/gen/mpx.c ?^extract(sub,ch,side)$? fabs /usr/src/lib/libm/fabs.c ?^fabs(arg)$? fatal /usr/src/lib/libmp/util.c ?^fatal(s) char *s;$? fclose /usr/src/libc/stdio/flsbuf.c ?^fclose(iop)$? fclose /usr/src/l((ib/libNS/flsbuf.c ?^fclose(iop)$? fcvt /usr/src/libc/gen/ecvt.c ?^fcvt(arg, ndigits, decpt, sign)$? fdopen /usr/src/libc/stdio/fdopen.c ?^fdopen(fd, mode)$? fetch /usr/src/lib/libdbm/dbm.c ?^fetch(key)$? fflush /usr/src/libc/stdio/flsbuf.c ?^fflush(iop)$? fflush /usr/src/lib/libNS/flsbuf.c ?^fflush(iop)$? fgetc /usr/src/libc/stdio/fgetc.c ?^fgetc(fp)$? fgets /usr/src/libc/stdio/fgets.c ?^fgets(s, n, iop)$? firsthash /usr/src/lib/libdbm/dbm.c ?^firsthash(hash)$? firstkey /usr/src/lib/libdbm/dbm.c ?^firstkey()$? floor /usr/src/lib/libm/floor.c ?^floor(d)$? fmin /usr/src/lib/libmp/mout.c ?^fmin(a,f) MINT *a; FILE *f;$? fmout /usr/src/lib/libmp/mout.c ?^fmout(a,f) MINT *a; FILE *f;$? fopen /usr/src/libc/stdio/fopen.c ?^fopen(file, mode)$? fopen /usr/src/lib/libNS/fopen.c ?^struct _iobuf *fopen(file, mode)$? forder /usr/src/lib/libdbm/dbm.c ?^forder(key)$? fprintf /usr/src/libc/stdio/fprintf.c ?^fprintf(iop, fmt, args)$? fputc /usr/src/libc/stdio/fputc.c ?^fputc(c, fp)$? fputs /usr/src/libc/stdio/fputs.c ?^fputs(s, iop)$? fread /usr/src/libc/stdio/rdwr.c ?^fread(ptr, size, count, iop)$? free /usr/src/libc/gen/malloc.c ?^free(ap)$? freopen /usr/src/libc/stdio/freopen.c ?^freopen(file, mode, iop)$? freopen /usr/src/lib/libNS/freopen.c ?^struct _iobuf *freopen(file, mode, iop)$? frexp /usr/src/libc/gen/frexp.c ?^frexp(x,i)$? fscanf /usr/src/libc/stdio/scanf.c ?^fscanf(iop, fmt, args)$? fseek /usr/src/libc/stdio/fseek.c ?^fseek(iop, offset, ptrname)$? fseek /usr/src/lib/libNS/fseek.c ?^long fseek(iop, offset, ptrname)$? ftell /usr/src/libc/stdio/ftell.c ?^long ftell(iop)$? ftell /usr/src/lib/libNS/ftell.c ?^long ftell(iop)$? fwrite /usr/src/libc/stdio/rdwr.c ?^fwrite(ptr, size, count, iop)$? gamma /usr/src/lib/libm/gamma.c ?^gamma(arg)$? gcd /usr/src/lib/libmp/gcd.c ?^gcd(a,b,c) MINT *a,*b,*c;$? gcvt /usr/src/libc/stdio/gcvt.c ?^gcvt(number, ndigit, buf)$? getbit /usr/src/lib/libdbm/dbm.c ?^getbit()$? getchar /usr/src/libc/stdio/getchar.c ?^getchar()$? getenv /usr/src/libc/gen/getenv.c ?^getenv(name)$? getgrent /usr/src/libc/stdio/getgrent.c ?^getgrent()$? getgrgid /usr/src/libc/stdio/getgrgid.c ?^getgrgid(gid)$? getgrnam /usr/src/libc/stdio/getgrnam.c ?^getgrnam(name)$? getlogin /usr/src/libc/gen/getlogin.c ?^getlogin()$? getpass /usr/src/libc/stdio/getpass.c ?^getpass(prompt)$? getpw /usr/src/libc/stdio/getpw.c ?^getpw(uid, buf)$? getpwent /usr/src/libc/stdio/getpwent.c ?^getpwent()$? getpwnam /usr/src/libc/stdio/getpwnam.c ?^getpwnam(name)$? getpwuid /usr/src/libc/stdio/getpwuid.c ?^getpwuid(uid)$? gets /usr/src/libc/stdio/gets.c ?^gets(s)$? getsh /usr/src/lib/libNS/getw.c ?^short getsh(iop)$? getttys /usr/src/libc/gen/ttyslot.c ?^getttys(f)$? getw /usr/src/libc/stdio/getw.c ?^getw(iop)$? getw /usr/src/lib/libNS/getw.c ?^getw(iop)$? gmtime /usr/src/libc/gen/ctime.c ?^gmtime(tim)$? grskip /usr/src/libc/stdio/getgrent.c ?^grskip(p,c)$? gtty /usr/src/libc/gen/stty.c ?^gtty(fd, ap)$? hashinc /usr/src/lib/libdbm/dbm.c ?^hashinc(hash)$? hypot /usr/src/lib/libm/hypot.c ?^hypot(a,b)$? index /usr/src/libc/gen/index.c ?^index(sp, c)$? intss /usr/src/libc/stdio/intss.c ?^? invert /usr/src/lib/libmp/gcd.c ?^invert(a, b, c) MINT *a, *b, *c;$? isatty /usr/src/libc/gen/isatty.c ?^isatty(f)$? itom /usr/src/lib/libmp/util.c ?^MINT *itom(n)$? j0 /usr/src/lib/libm/j0.c ?^j0(arg) double arg;{$? j1 /usr/src/lib/libm/j1.c ?^j1(arg) double arg;{$? jn /usr/src/lib/libm/jn.c ?^jn(n,x) int n; double x;{$? join /usr/src/libc/gen/mpx.c ?^join(fd,ch)$? l3tol /usr/src/libc/gen/l3tol.c ?^$? ldexp /usr/src/libc/gen/ldexp.c ?^ldexp(fr,exp) double fr; int exp;{$? localtime /usr/src/libc/gen/ctime.c ?^localtime(tim)$? log /usr/src/lib/libm/log.c ?^log(arg)$? log10 /usr/src/lib/libm/log.c ?^log10(arg)$? ltol3 /usr/src/libc/gen/ltol3.c ?^? m_add /usr/src/lib/libmp/madd.c ?^m_add(a,b,c) struct mint *a,*b,*c;$? m_div /usr/src/lib/libmp/mdiv.c ?^m_div(a,b,q,r) MINT *a,*b,*q,*r;$? m_dsb /usr/src/lib/libmp/mdiv.c ?^m_dsb(q,n,a,b) short *a,*b;$? m_in /usr/src/lib/libmp/mout.c ?^m_in(a,b,f) MINT *a; FILE *f;$? m_mult /usr/src/lib/libmp/mult.c ?^m_mult(a,b,c) struct mint *a,*b,*c;$? m_out /usr/src/lib/libmp/mout.c ?^m_out(a,b,f) MINT *a; FILE *f;$? m_sub /usr/src/lib/libmp/madd.c ?^m_sub(a,b,c) struct mint *a,*b,*c;$? m_trq /usr/src/lib/libmp/mdiv.c ?^m_trq(v1,v2,u1,u2,u3)$? madd /usr/src/lib/libmp/madd.c ?^madd(a,b,c) struct mint *a,*b,*c;$? makdatum /usr/src/lib/libdbm/dbm.c ?^makdatum(buf, n)$? malloc /usr/src/libc/gen/malloc.c ?^malloc(nbytes)$? mcan /usr/src/lib/libmp/util.c ?^mcan(a) MINT *a;$? mcmp /usr/src/lib/libmp/util.c ?^mcmp(a,b) MINT *a,*b;$? mdiv /usr/src/lib/libmp/mdiv.c ?^mdiv(a,b,q,r) MINT *a,*b,*q,*r;$? min /usr/src/lib/libmp/mout.c ?^min(a) MINT *a;$? mktemp /usr/src/libc/gen/mktemp.c ?^mktemp(as)$? modf /usr/src/libc/gen/modf.c ?^modf(arg,ent)$? monitor /usr/src/libc/gen/mon.c ?^f(bufsiz < o)$? mout /usr/src/lib/libmp/mout.c ?^mout(a) MINT *a;$? move /usr/src/lib/libmp/util.c ?^move(a,b) MINT *a,*b;$? mpx /usr/src/libc/gen/mpx.c ?^mpx(name,mode)$? msqrt /usr/src/lib/libmp/msqrt.c ?^msqrt(a,b,r) MINT *a,*b,*r;$? msub /usr/src/lib/libmp/madd.c ?^msub(a,b,c) struct mint *a,*b,*c;$? mult /usr/src/lib/libmp/mult.c ?^mult(a,b,c) struct mint *a,*b,*c;$? neg /usr/src/lib/libm/gamma.c ?^neg(arg)$? nextkey /usr/src/lib/libdbm/dbm.c ?^nextkey(key)$? nlist /usr/src/libc/gen/nlist.c ?^nlist(name, list)$? npgrp /usr/src/libc/gen/mpx.c ?^npgrp(ch, gfd, pid)$? nvmatch /usr/src/libc/gen/getenv.c ?^nvmatch(s1, s2)$? omin /usr/src/lib/libmp/mout.c ?^omin(a) MINT *a;$? omout /usr/src/lib/libmp/mout.c ?^omout(a) MINT *a;$? pclose /usr/src/libc/stdio/popen.c ?^pclose(ptr)$? perror /usr/src/libc/gen/perror.c ?^perror(s)$? popen /usr/src/libc/stdio/popen.c ?^popen(cmd,mode)$? pos /usr/src/lib/libm/gamma.c ?^pos(arg)$? pow /usr/src/lib/libm/pow.c ?^pow(arg1,arg2)$? pow /usr/src/lib/libmp/pow.c ?^pow(a,b,c,d) MINT *a,*b,*c,*d;$? printable /usr/src/lib/libln/allprint.c ?^printable(c)$? printf /usr/src/libc/stdio/printf.c ?^printf(fmt, args)$? putchar /usr/src/libc/stdio/putchar.c ?^putchar(c)$? puts /usr/src/libc/stdio/puts.c ?^puts(s)$? putsh /usr/src/lib/libNS/putw.c ?^short putsh(i, iop)$? putw /usr/src/libc/stdio/putw.c ?^putw(w, iop)$? putw /usr/src/lib/libNS/putw.c ?^putw(i, iop)$? pwskip /usr/src/libc/stdio/getpwent.c ?^pwskip(p)$? qs1 /usr/src/libc/gen/qsort.c ?^static qs1(a, l)$? qsexc /usr/src/libc/gen/qsort.c ?^static qsexc(i, j)$? qsort /usr/src/libc/gen/qsort.c ?^qsort(a, n, es, fc)$? qstexc /usr/src/libc/gen/qsort.c ?^static qstexc(i, j, k)$? rand /usr/src/libc/gen/rand.c ?^rand()$? realloc /usr/src/libc/gen/malloc.c ?^realloc(p, nbytes)$? rewind /usr/src/libc/stdio/rew.c ?^rewind(iop)$? rin /usr/src/libc/gen/rin.c ?^rin()$? rindex /usr/src/libc/gen/rindex.c ?^rindex(sp, c)$? rpow /usr/src/lib/libmp/pow.c ?^rpow(a,n,b) MINT *a,*b;$? s_div /usr/src/lib/libmp/mout.c ?^s_div(a,n,q,r) MINT *a,*q; short *r;$? satan /usr/src/lib/libm/atan.c ?^satan(arg)$? scanf /usr/src/libc/stdio/scanf.c ?^scanf(fmt, args)$? sdiv /usr/src/lib/libmp/mout.c ?^sdiv(a,n,q,r) MINT *a,*q; short *r;$? setbit /usr/src/lib/libdbm/dbm.c ?^setbit()$? setbuf /usr/src/libc/stdio/setbuf.c ?^setbuf(iop, buf)$? setbusy /usr/src/libc/gen/malloc.c ?^#define setbusy(p) (union store *)((INT)(p)|BUSY)$? setgrent /usr/src/libc/stdio/getgrent.c ?^setgrent()$? setkey /usr/src/libc/gen/crypt.c ?^setkey(key)$? setpwent /usr/src/libc/stdio/getpwent.c ?^setpwent()$? sin /usr/src/lib/libm/sin.c ?^sin(arg)$? sinh /usr/src/lib/libm/sinh.c ?^sinh(arg)$? sinus /usr/src/lib/libm/sin.c ?^sinus(arg, quad)$? sleep /usr/src/libc/gen/sleep.c ?^sleep(n)$? sleepx /usr/src/libc/gen/sleep.c ?^sleepx()$? sprint /usr/src/lib/libln/allprint.c ?^sprint(s)$? sprintf /usr/src/libc/stdio/sprintf.c ?^char *sprintf(str, fmt, args)$? sqrt /usr/src/lib/libm/sqrt.c ?^sqrt(arg)$? srand /usr/src/libc/gen/rand.c ?^srand(x)$? sscanf /usr/src/libc/stdio/scanf.c ?^sscanf(str, fmt, args)$? store /usr/src/lib/libdbm/dbm.c ?^store(key, dat)$? strcat /usr/src/libc/gen/strcat.c ?^strcat(s1, s2)$? strcatn /usr/src/libc/gen/strcatn.c ?^strcatn(s1, s2, n)$? strcmp /usr/src/libc/gen/strcmp.c ?^strcmp(s1, s2)$? strcmpn /usr/src/libc/gen/strcmpn.c ?^strcmpn(s1, s2, n)$? strcpy /usr/src/libc/gen/strcpy.c ?^strcpy(s1, s2)$? strcpyn /usr/src/libc/gen/strcpyn.c ?^strcpyn(s1, s2, n)$? strlen /usr/src/libc/gen/strlen.c ?^strlen(s)$? strncat /usr/src/libc/gen/strncat.c ?^strncat(s1, s2, n)$? strncmp /usr/src/libc/gen/strncmp.c ?^strncmp(s1, s2, n)$? strncpy /usr/src/libc/gen/strncpy.c ?^strncpy(s1, s2, n)$? stty /usr/src/libc/gen/stty.c ?^stty(fd, ap)$? sunday /usr/src/libc/gen/ctime.c ?^sunday(t, d)$? swab /usr/src/libc/gen/swab.c ?^swab(pf, pt, n)$? system /usr/src/libc/stdio/system.c ?^system(s)$? tan /usr/src/lib/libm/tan.c ?^tan(arg)$? tanh /usr/src/lib/libm/tanh.c ?^tanh(arg)$? tdecode /usr/src/lib/libtermlib/termcap.c ?^tdecode(str, area)$? tell /usr/src/libc/gen/tell.c ?^long tell(f)$? testbusy /usr/src/libc/gen/malloc.c ?^#define testbusy(p) ((INT)(p)&BUSY)$? tgetent /usr/src/lib/libtermlib/termcap.c ?^tgetent(bp, name)$? tgetflag /usr/src/lib/libtermlib/termcap.c ?^tgetflag(id)$? tgetnum /usr/src/lib/libtermlib/termcap.c ?^tgetnum(id)$? tgetstr /usr/src/lib/libtermlib/termcap.c ?^tgetstr(id, area)$? tgoto /usr/src/lib/libtermlib/tgoto.c ?^tgoto(CM, destcol, destline)$? timezone /usr/src/libc/gen/timezone.c ?^char *timezone(zone, dst)$? tmpnam /usr/src/libc/stdio/tmpnam.c ?^? tnamatch /usr/src/lib/libtermlib/termcap.c ?^tnamatch(np)$? tnchktc /usr/src/lib/libtermlib/termcap.c ?^tnchktc()$? tputs /usr/src/lib/libtermlib/tputs.c ?^tputs(cp, affcnt, outc)$? tradd /usr/src/lib/libmp/mult.c ?^tradd(a,b,c) long c; int *a; union g {long xx; str? tskip /usr/src/lib/libtermlib/termcap.c ?^tskip(bp)$? tst /usr/src/libc/stdio/popen.c ?^#define tst(a,b) (*mode == 'r'? ttyname /usr/src/libc/gen/ttyname.c ?^ttyname(f)$? ttyslot /usr/src/libc/gen/ttyslot.c ?^ttyslot()$? ungetc /usr/src/libc/stdio/ungetc.c ?^ungetc(c, iop)$? valloc /usr/src/libc/gen/valloc.c ?^valloc(i)$? wdleng /usr/src/libc/stdio/stuff.c ?^wdleng()$? xalloc /usr/src/lib/libmp/((util.c ?^short *xalloc(nint,s) char *s;$? xatan /usr/src/lib/libm/atan.c ?^xatan(arg)$? xfree /usr/src/lib/libmp/util.c ?^xfree(c) MINT *c;$? y0 /usr/src/lib/libm/j0.c ?^y0(arg) double arg;{$? y1 /usr/src/lib/libm/j1.c ?^y1(arg) double arg;{$? yn /usr/src/lib/libm/jn.c ?^yn(n,x) int n; double x;{$? yyless /usr/src/lib/libln/yyless.c ?^? yyracc /usr/src/lib/libln/reject.c ?^yyracc(m)$? yyreject /usr/src/lib/libln/reject.c ?^yyreject ()$? yywrap /usr/src/lib/libln/yywrap.c ?^? an.c ?^xatan(arg)$? xfree /usr/src/lib/libmp/util.c ?^xfree(c) MINT *c;$? y0 /usr/src/lib/libm/j0.c ?^y0(arg) double arg;{$? y1 /usr/src/lib/libm/j1.c ?^y1(arg) double arg;{$? yn /usr/src/lib/libm/jn.c ?^yn(n,x) int n; double x;{$? yyless /usr/src/lib/libln/yyless.c ?^? yyracc /usr/src/lib/libln/reject.c ?^yyracc(m)$? yyreject /usr/src/lib/libln/reject.c ?^yyreject ()$? yywrap /usr/src/lib/llib/libtermcap.a 755 0 33 33020 2552606164 12230 1lib/libtermlib.alib/pc0 755 0 33 356234 2553177744 5304 <hPD^Юn PPՀPpPP;HP07^ԭԭC[8[9խ ֭0[ӏpխ u֭xP[PЬP֬`[ЭP δ^ЬPݠ PݬaPЬPݠOPЬPX΀P~Pݠ2o~ЬP~ЬPݠݬ:ԭѬ 1ЬPݠӋPЭPPЬPݠPPխ5ЬPݠݭPݭܘ~ЭPݠ2ﵥ~ЬPPPPP KP~Py;:1ݼݏBPЭܭЬPݠ%P1iЬP~ݼ2/ݬP1P~Pݠ2~KݬPݬ~PݬmPxPP PPPxPPPݬGPxPP PPPPP~ 8ݬP[1bլ1PP1P KP1P1 9f1 ЭP`A)ݼkݏ^ԭ1ԭ1ЬPРЬPݠBPZZ1ݼkݏݫP ddd|dd|||ݫЬPݠXPZU8ݫDPrC8Z1P_ݏhNݫЬPݠGXPZ677ݫݫЬPݠXPZݫZ1ЬPݠݫZ` Pݼkݏ1ݫP1ݫzPݫ`Pݫ8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EE, ݏ]5ݏ^ݏ\ݏ_ ^ݬKP[Pݬ9PZ[PP N KKTY?[Z19xZP+P`x[P+P`ݏ? [ZPZZZ礼լ ݬ JPP[v[ݏ( ݏU ݏ&H G1Z1IݬPݬ P1Vݏ^ 1Z1 ݬzPݬzP1ݏZ11[ZݏѬx[P]*P`ݏU 1dЬPPP1x[P1*P`ݏ ^Ь[լ*ﰹюլЬPРЬPPPP * ѬЬPՠЬPЬ PPݏ]լЬPРЬPPPP =* ѬЬPՠݠ8fЬPݠb8EݏF6^ЬЬЬPˏ`ԭq)k`PÏP[[[[??[ЬPʏ`ЬP`нxխέPPPPxPʏPx[QQPPЬPЭ`ЬPЭ^Լ Ь PԠЬ PԠЬ P ԭլ1ЬPРY1ݏgv^0PP p)ЬPРIb)ݬpPݏЬ ЬPݠuz2{PPxPPP Ь PԠ Ь PР PЬPР[1tЫ[k@Ы[ƌ[FPZﰌZ(ZP ݏ1(ZPZPݏ1m(Z5PRuB/PP i(}ЬPРX(ݬTP1ЬPРY&ЪY1ЩYY>PЬ Y/y25PPxPPP Ь PԠ 22P2 QQPWV Լ ЬPШЬPРX1:Ш[k@1pЬ Pՠ 1ݫWPZnPqP nPqPխ1Ь PԠ ݫYZP ݏ.Ь Pՠ 1ݫ(WP0ZnPq-P nPq Pխ1Ь PԠ ݫYZ*P ݏUШWЬPРWЭЬ P֠1jɑ~ݏԼ 1>Ь PԠ ݫ\DPZݫIDj~ݏqԼ 1cЬ PԠ ݫDPZ1e1CЬ Pՠ 1["VP*ZnPq'P nPqP խEЬ PԠ [YZ(P ݏSШVЬPРVЭЬ P֠1jǐ~ݏԼ Ь PԠ [\CPZ/WWXШXըVЬPWЬPVռ 1 Ь P 1 ά^ЬPՠ 1мPݠ9vޭP2;QxQQQxQQQPޭԽѭЬPР[1QЫZj@1ݪTj܏ݪTjʏѭ1ЭP2QQPxPЭP2QQQPPЭP2QQPxPЭP2QQQPPЭP@#ѭP@#ЭPȭ@ޭPQxQQQPޭPQxQQQ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O1iz1s1 1ݫݫy8P1իPݫx`PP71ի Pݫ T`PPݫ71ݫݫxݫݫݫ y1}ݫݫqxݏ,1<ݫݫݫݫݫ Q1Eݫ((ݫݏ,1ݫ ݫݫݫ7Pݫ <1ݫݫݏ,1ݫ1ݫ1ݫY1ݫݫ ݫݫݫPo111ݫ 71y1yݫ ݫ6P1ݫݫ6Pݫݫ ݫݫ6Pz1yݫݫ ݫݫ6PЫ1ݫ12ݫ 1Pݫ1:ݫݫݫ ݫ#ݫݏIݫ$ݫ Pݫ%1?ݫݫ&14ݫ6Pݫ'1 ݫ ݫݫ(1ݫݫ 5Pݫ)ݫ ݫ*1ݫ ݫ+1ݫݫ5P0ի 1+1ݫݫ5PݏPݏ,1ݫ ݫv5PݫݏO1fݫ^5Pݫݫ.1ݫE5Pݫݫݫݫ.5Pݫ/1"ЫZЪYiK JiЫ1|ݫ1ЫY1mЩZj=A5P155"5 Ɛeק+55ݏ,) TP4Kj1ݏ-1ݫ ݫ^4Pݫ01Rݫݫݫ իPݫR`PPݫ31#ݫj441ݫ  4Pݫݫݫ3Pݫ1PZի 1U1ݫ3Pݫݫ6fP'ի1"1ݫݫ3Pݫ71ݫݫݫ81wݫݫl3Pݫ 91`ݫݫݫݫ:1ݫݫݫݫ;1ݫT`ݫ<1=ݫݫݫ=1aݫݫݫݫݏJ1Lݫ ݫ>1 hݏ1-17ݫݫݫ1IݏF-1ݫ ݫЫPѠЫ PЫPРPPݫ1ݫЫPݠ1ݫЫPݠ1ݫ ݫЫPѠݫ ݫЫPѠ1ݫ1`ݫ!1VݫݏH1Hݫ"1>ݫ !2Pݫ51ݫ1ݫ2P?1 ݫ ݫݏ@1ݫ11ЫPݠ 1ЫQP 18ݫ 1PݏC,Pݫ 1PݏCPЫPݠ =1ݫ 1ݫ 1ݏEݏEݫ ݫݏF1(ݫݫݫ11v1v l1l b1b X1X N1N D1D:1:010&1&11111ݫ0ݏL1zЬPP>qP'PP:PPݬ  PPPP PP Ь[ЬZZPP EPEP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PPxP­PPЬ0ooPРQ֠ao~]֭׭)zoroPРQ֠a`o]KݬսI׭スpI什WH^ݬnHݬ TPQxQQQP,nnPРQ֠an]֭ѭΕT^ݬ'bHݬSPQxQQQP6H֭ѭHݬͼ\ݬݬﭼݬݬ}լάPЬPP0ݬ־Skܾ;ݬԾ)ݬ þľݬ^ݬݏ茶ݬά~ݬݏz~ݬvqݬݏaYnV>ݬN,ݬ ݬݏ6:ݬ2ݬݏݬ ݬ ݬݏ`ݬnݬݏؽVjݬݏý1Fݬݏﳽ ^ѬUѬ "լ ά PЬ PP0ݬ&Ѭ'լ ά PЬ PP0ݬݬݬݬMUݬ $ZWlլάPЬPPݏD9%^0ݬ1 !/|P)ݬ!ݏdݭݭ^0ݬѼc{{Pɼ@ݬ.ݏﯼݭﰼݭլάPЬPP0ݬcլάPЬPP0ݬWլάPЬPP0ݬK[^Ѭ   լ  ά P ѬЬ PPݭ0ݬ$\^ЬPݠfP[M'ЬPР E2~ݭ[!ӘP@Xkkݏe>ЬPݠ (ԭЭY֭ЩYYˏXs_kݏ=XPP1 1 &P11%P11U%P1 15%P1"%ɽ=խ ݏB=խ9RݏH`2~ѭݏݏ6ЭPݠhPPЭP 1P{+Pݏ<ԭXc﮺ݏH2~l=ݏ2~\1:խ1 ЭPРYiFwݠP_P ЭPРխ1ЭP ݏ2N~ݏЭPРЭPРЭPݠ/gݏF:2~h9ЭPР׭1=ݏ2~ U(ݏ2~3:"2d~1ԭԭDЭPРY1iFЩZYZZ1ZPPP'PiF1Hѩ 0O1(P1֭j1ѩ X1թ ݩ ﻋP%F<(Pj萏fЭPP"PHxPPYP`ݏB91t#s[xPYP`ݏy9թݩ$P1խ խݏj?912 (խ խs[ݏ 9ѭ1ۏOۏ((XݏխݏݭPtݭPpݭPlݭPhݭPxPPPlPPxPP PdݭPxPPPtPPxPP P`ݭvPxPPPhPPPdPP\oݭFPxPPPpPPP`PPxPPP\P~6ݭcݭPtݭPxPPPtP~ݏFݭP ݭ$P&<&&&<(ݏ81A 掠ݭ3-ݭЭPݠvPPЭPݠݭݭ+PݭP$Pݭ2PݭPݭPݏbG27~ݏݏ2~L16 ݭ,ݭP:ۏOۏXTsXݏ6ѭѭxPUP`ݏ=1BѭѭЭPP7\)7xPUP`ݏ1ۏf1ЭPP %9bhh ԭЭPP/"""" """""ﻳ5ۏc1h 1ݏoݏ2~Z8+1xխ1^ۏD 'ۏXۏO  d41#wVes}Vݏ[x4s1e1׭ѭѭ萏e1׭ѭ11Z˅\!PP8쐏c1pԭ֭ЭP֭`1DݭPsЭխѭ­1ݏZtݏݏ2ͽ~ݏFn1R0ݏdݏ2~ZP81p~Ui~ݭK߭fBZ~=D~ݭݭ1߭>B2~ݭ$~ݭ~߭ B#{ ݏݏ2ﯼ~ݏXݏ2|~ݏF8Tݏݏݏ2~iݏFޭPP~@PޭPP~81Fѭթ  ѭ12ﭻPxPP8P}`xѕP~ЭPݠ2t~ݩڄP:說ݏЭP~ЭPݠ2~kCTѭѭVݏݩPPխ1.(ݭPݭPݏ1aЭPP1MP1@8#$8ݏFթ 1;8ݏЭP~ЭPݠ2~:xﻔ8uv8YݏFJ8?1Aޭݏ(ݩ ̂PP11ݭ88ݏF;1Z41V81 -ݭPݭPݏ1ZٲGI8,-8ݏF8ЭPPUU%1Z1Z|PjݭPݏh1 MݏZ3PPbgP"߭<߭J8-18ݏF2A~ᄎѭ1g1hݏZqP1ЭP~ЭPݠ2ж~ݭݏS_ЭP~ЭPݠ2~ݭ>!x5  Эݭ88ݏݏ2ߵ~-ݏF8uݏFf2卑~%ЭPРխ16ˏPPP0Pխݏ*խ ݏ*ѭ ݏ;*h5ﵩݏݏ2~Bwݏ eݏqݏ2~ݏF68+ݏF2^~۷1ԭ塀խ1ЭPݠ}PP ЭPРխ1ЭP ЭPРЭPРݏ2ճ~#{ݏ~ЭPݠTݏFM:B2~ЭPР׭1ݏ2U~(ݏ2+~y֧2:2~zKP@խ1ЭPРY1riAkݏ\&(1WYSPxPѭ1ЭPݠݭݭPݏ'1YPPݭPݭݭPtݭPpݭPlݭPhݭzPxPPPlPPxPP PdݭTPxPPPtPPxPP P`ݭ.PxPPPhPPPdPP\?ݭPxPPPpPPP`PPxPPP\P~խݭ7RRݏFݭPݭPݭiPݭOPݭ'Pݏb~2n~Bݏݏ25~ݏF1ݭP 1AݭݭP:1tݭPPP@+XxP)EP`ݏ1YTNPݭVPvݭXPPG.8ݭ PPxPPP QQQQP~ݏ2(~vXdݭ^P&߭4߭8w8Fs(Fݏ#$ݭݏF[ݭUP ݭgݭP:(2j~ЭPР1mJ1B?17ѫoѭ ݏ m#ݏݏ2ҭ~ ݏFs2ﵭ~2խ ݏ,#ѭ kݏG1Lݏ2o~ݏЭPݠbNPPЭP P`Pkݏ`"ݏF:2~m>X PPPݏ~ݏ2~ݏF1խѭ kݏ1D﹦ѭsCݏ!X PPPЭPݠ@MPPЭP P>Pkݏ1ѭNЭPРYݩSuPYYPYPkݏ1YWPXԭ88ݭ88ݭPPЭPݠP81խ kݏ?1X UPC MPJPPݏXPPPЭPݠKPPЭP PPkݏa1sЭPРЭPР1mЭP1ݏ1ЭPݠP kݏ1 ЭPݠDfЭPР PݠP{Pݏ ЭPРЭPnPqP%ЭPР խխ ݏT1ЭPРЭPРխ1ЭPՠ1Bݏ1ѭ1X PݞPPݏ'ЭPݠqJPPݭ PݭގP 1ݭX Pkݏ1խ ݏ1&iݏݏH2Ѩ~N0ѭ ݏ1ݏ]ЭPݠqPPݭ Pݭ Pݏ1ЭPРYݩ_IPPݭ PݭX Pݏ18ݭ1ѭ ݏN1aݏЭPݠ:qPP4ݭ P1ݭ Pݏm1Tѭ ݏ1ݏ+ЭPݠpPPݭ P11ݭi Pݏ1ѭ ݏ18ݏЭPݠ HPPݭK Pݭ Pݏ>1ЭPРYݩ"pPP.ݭ P1Tݭ Pݏ1<ѭ ݏv1ݏ2P~ۛݏЭPݠCGPPݭ Pݭ< Pݏ1ݏF:2ӥ~P! V1Sݏe T0ݏ;ݏ2_~ݏF1ѭ ݏ1]ݏҚЭYЩЩYЩЩYЩKѭ ݏ1漢ݏЭYЩЩYЩЩYЩݭnPPXPPPݭEPPЭPPPݭݏ188XPPPݭMEPYݭTPݭݏ, 1թ ЭPՠЭPѩP#PݭݏX 18YuPЭPݠcPЭPР Щ YЭPՠ թ  ݭݏ 1QխYЭPPQáPPéPPѭݭݭݭݏ ­ЭPРݭ8ݭ8ݭ8ݭ1kݏ 1P11P1]P11P1@1P1,P1P151mP1&1^P1P11AP112P1=P1 P11P11P1!1P19P11P114^ЬPݠy?PPD (ЬPР x>2p~ ݭݭݽݏdЬPݠ sPԭЭZ֭ЪZZЭPˏY[sn8ݽݏzfY11P4ѭ1ݽݏ ݭ1d𥳐ݽݏխݭݏ<ݏHUPgPP1xխSݏݏFBPYPPխKޭޭܭAԭЭ漢ЭPݠ4iP[[1iѭ1ݽݏ1YPP11Pf1P11QPH1K1P11X1[nPݽݏ14131v2P.PP1_9[P)ݏЭPݠ,hP[[`P1|ݏh@1jޔ[P[Pݏ#1ﲔݏЭPݠgP[1 Y P~PPz[P1iݏЭPݠGgP[1>[xP -1X[Pݽݏu1m[EPﱢݭ1[|P[Pݽݏ11Y ﻓP︓PPݏЭPݠpfP[ݫ8ݫ8oݏF;ЭPݠQP[QYPPP#[P1I[PЭPݠ?QP[1lƒ[7P[FPݏW1>?ݏЭPݠFeP[ݏFpЭPݠ eP[PB[P[((Pݏ1ݏ#ЭPݠdP[[P8ݏFP[uP[0Pݏ1ݏЭPݠ;P[ݏF1 [Pݏ15Nݽݏ P1PЭPݠcP[ː[P1%[P[XPݏ1P1PN[ P1ЭPݠLcP[;iϝPP1FP1KP11P1䀘1ZP1`P1%!P1|14hP11P1ﺏ[-P1[9Pݏ,1P11P1N.P1RN[xP1Fݽݏ1BP1$ՎՎ[P1@ݭݏ-ЭPݠaP[[PݏhݏFﳜPP11P1x[P1Ptݭ rPݭИ~ЭPݠ2ﬗ~ЭPݠLP[ݭ:;ݭЭP~ЭPݠ2g~ﵿݭЭP~ЭPݠ2C~ݭ ݭ;ЭPP1s[%P1[1PݽݏO1^2,ЬPʖ螺ݠKPP[ݭPݭPݏ ԭ)ЭPРЭխЭPРРխ1ݭPkjpP~ЭPݠ2 ~[ЬPݠJ:ݏl2ӕ~P!GPPЬPР ЭPР ЭPРeЭPРխ ~&PPݏ .:FЭQPFPԭЬPР 1^֭ЭPЭPР1>ЭPOFPЭP1`1P1ЭPݠխ1ݭPݏJ ^nPqؖP nPq˖Pݏ 5֭jﰖP QQPa PP2P PPЭܠЭPР1QݭEc;ЭPݠ eaխ1PPm2P@ cݭЭPРխ1Э-ЭPݠ Eݏ\KЭP~ЭPݠ2h~ﶻ8 ݏF2@~v ݭ ~ԭ ȭ.ЭPPQ` QPݠQPݠݏ-Z PPѭPխݭ%D PPЭQá `PQPQѭݭݭF"ѭݭݭe ݭݭvݭCЭP2ﰔQPQa ^CP PPЬQá `~ЬPݠ % ,ݭhCЬPР ׭1 PPѭ`\ PPݠو̈жĈݭﻈﮈ勇֭RЬPݠyjݭ|oR֭ѭ16ЬPݠgݬ~ЬPݠ^լ Rݬ$=ЬPݠ +ЬPݠӵݬѬ  PPAP PP`ՇݭӇs PPݠ‡X~~ݬ(ݭ驪2í ~ PP~ݬ^׭; PP`va PPݠVʹЬPݠBﯴѼPѼPP0^լ1ݬPЬP`A1ݠ-P[[[1k2#АЬPР ZZ-P  ޭЬPР 옏DРޭZЬPݠݭݬZ[\PiPPcP Pd[ìPíQPQݬY~Э1ݭݬY1[YݭZ2YЭZ14 ^kЬ[ЬZkj׭^EЬ[ЬZЬ Ykij׭^Ь[ЬZԭլ05Ьj ЪP֪`P ZPYY׭֭ѭ ЭP^Ь[ЬZԭլ.3ЬYj ЪP֪` Z~ Y ֭ѭ ЭPPSЬRUT TTT +T-TST|PT04T9/Q yPVyPPVPWQ0TTPQUSUTǑT.SVTeTE[TT+T-STT0T9V FfV>FVSVVVUUЏUUdЏdU}PP1RU#Q yPPRyPVVPWQRU=;Q yPPRyP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ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j0g~\S^\wgP g[ЬfPЬPЬRRQ{RPPR PRPPլQPP@(#)ato.c 1.2 3/8/81@(#)call.c 1.17 6/12/81call class_RANG4_RSNG4dicall_FRTNvarvaluefunctionprocedureSNARKplist@(#)case.c 1.3 3/8/81@(#)clas.c 1.4 6/1/81 ====%=-=1=8=>=F=K=S=X=<clas2classbcidtwhereisfilerecordarrayscalarpointersetstringSNARKBooleancharintegerreal"nil"@(#)const.c 1.4 9/4/80idgconstgconst2id@(#)conv.c 1.2 3/8/81convert# call rangecheckprecheckpostcheck@(#)cset.c 1.6 3/20/81empty settrbcsiiintsett .data .align 2 .long 0x%x,0x%x .text%s%dL@(#)error.c 1.3 3/18/81ESnark (%s) line=%d, yyline=%d Snark in pi ... %c - %c %d - @(#)fdec.c 1.20 6/1/81func var %dIn %s %s: @(#)fend.c 1.9 6/8/81 .text .align 1 .globl _main_main: .word 0 calls $0,_PCSTART movl 4(ap),__argc movl 8(ap),__argv calls $0,_program calls $0,_PCEXIT .text .align 1 .globl _program_program:program .text .align 1 .globl %s%s__ .globl %s%s: .word %s%dL moval %s%dL,r0 jsb mcount .data .align 2 .long 0 .text moval %s,%d(%s)_UNWINDfp moval %s+%d,%d(%s)__displyfp movq %s+%d,%d(%s)__displyfp movq %s,%s+%dap__disply_blkclr_BUFFinputoutput_DEFNAME_PMFLUSH__pcpcounts_PCLOSE__disply%s%dL .data .lcomm %s,%d .text movq %d(%s),%s+%dfp__disply ret .set %s%dL, 0x%x subl2 $LF%d,sp%s%s:__ .word %s%dL_FCALL .data .comm __pcpcount,%d .text_%s_%ssextname@(#)fhdr.c 1.3 6/1/81funchdrfunchdr2@(#)flvalue.c 1.11 6/8/81functionprocedure_FSAV%s__@(#)forop.c 1.9 6/1/81bcis_RANG4_RSNG4_LINO__stcnt_RANG4_RSNG4@(#)func.c 1.7 3/8/81@(#)gen.c 1.2 3/8/81@(#)hash.c 1.2 11/24/80DDD-DDDDDD$D D D D DDDDDDDDDDDDEEEE %E!)E#.E 1E%6E& NSTAND <%d> [%d] VARNT=[%d] TAG=[%d] VTOREC=[%d]NEXTERN NLOCAL NPARAM NGLOBAL NREGVAR No entries truefalseTRUEFALSEminintmaxintmincharmaxcharbelltabbooleancharintegerreal_nilBooleanintsetalfatextinputoutputabsarctancardchrclockcoseofeolneosexpexpolnoddordpredroundsinsqrsqrtsucctruncundefinedargcrandomseedwallclocksysclockdatedisposeflushgetgetseghaltlinelimitmessagenewpackpageputputsegreadreadlnremoveresetrewritetimeunpackwritewritelnargvnullstlimitvariableundefinedconstanttypevariablearraypointer or filerecordfieldprocedurefunctionvariablevariablepointerfilesetsubrangelabelwithptrscalarstringprogramimpropervariantformal procedureformal functionSNARKBADUSECONSTTYPEVARARRAYPTRFILERECORDFIELDPROCFUNCFVARREFPTRFILETSETRANGELABELWITHPTRSCALSTRPROGIMPROPERVARNTFPROCFFUNC ***@(#)proc.c 1.9 6/4/81@(#)put.c 1.14 3/26/81pSSSSSSSSSTT TTTT"T(T.T5T_A_D_H_L_P_T_X_\_`_e_j_m_r_u_x_{____________________________________dpdppdppdppdppdppdppdppdppdppdppdppdppdpdppdppnppdpdppppn"ppn"pppppppppddpppppdpdpppnpnpnpnppnppnpnpnpppnpppnppnppnpnpn"pn"pn"pnppnppnppnppnpppnpppn"npppnpdpppn"ppppppppn"ppdppnpppnpppnpsnnnnnnppnppxunary -moddiv/*+-=<><><=>=notandor:=unary +in@(#)treen.c 1.1 8/27/80@(#)yycopy.c 1.1 8/27/80@(#)pas.y 1.4 3/18/81 0@00               00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" $ # & % ( ) * 0, "0#0- 0. ? 6 7 ^0; < 4 = 2 : 9 8 > ^0E 0F 0H G 00I J 0K 0L 0H M 0N O        R %0 0T U T0? 6 7 ^0; < 4 = 2 : ^09 8 > ^0W X `0Y 000000000c0\ e a j c _ ` b ] ^ g i k n n r t p0u w x v 0y z {  }   }   0 00  +0  H 0V0U0\ e a j c _ ` b ] ^ g i k b0 U  r0x0y0z0{0|0}0 0000000000000000000000000000000000 \ e a j c _ ` b ] ^ g i k 00 00000  U  k0  \ e a j c _ ` b ] ^ g i k  00 .0/0 203040500 80 :0 <0     I000 00   0  ,0H  _0 0 0d0 ]0 }  ]00 0!000000000000 t0 u0~0 !0!!00 ! 0n  !!! 000!!000010090;0!H  }   }  !!!K0K0!F0H !0000!0*0$0 H !R H %0R H %00a0\ e a j c _ ` b ] ^ g i k 000&!'!%!W0Y0(!)!60   s0 v0w0000+! 00\ e a j c _ ` b ] ^ g i k f00g0 h0 .!  /! 0!l0o0 q000=0>03!2!C0@0A0B0E0 I0H06!-0&00 ;!0 }  ]0Z0e0\000 0? 6 7 ^0^0; < 4 = 2 : ^09 8 > ^0 0C!G0E!F!0J0'0(0)00X070[0i0j0m0D0 }  Q0M! 0?0O!L0L0N!N0(!P!Q!0 }  Q0P0S!O0 V!I0O!M0M0N!W!S0R0/012G\qruz34O4RU4X[\_filo~~o~~44I44Lijkpqx4   #&)*~-238;<ABef444}~4444678=>?@ABCDoI~Zknyz~44 =\{~4~~o +HZKLORSTU4VWXYZ[\~]^mp^ !! """###%&&&&'''$$$$$$$$$$$$$$$$$$$*++++++++++++++++++3344--555555;;;;;<<77)).......////00000022,,=6:89(1((++P '-SR6Z:p/ !E|K%(>ENQGLM7 8CH!"Q!9":~%K3D5FLSU4QTINRJ1VW *)?.@/A0B01%=3;q57[9o=s]^ghitvy   $-1;Gl@1@6@8m:@;@W@@@@@)@.@/@0@dfh,AByCzD#$< #)+-/1357K_acekqsw})+-/1359;=ACGIMQbeginrecordbegincase@(#)yycosts.c 1.2 3/8/81;,:=*+/-|&()[]<>~^Insert Delete Rep(ID) Symbol %4d %4d %4d %s%s @(#)yyerror.c 1.2 3/8/81^--- @(#)yyget.c 1.1 8/27/80 includer@(#)yyid.c 1.3 3/8/81@(#)yylex.c 1.2 3/8/81unyylex@(#)yymain.c 1.2 3/8/81No lines in file@(#)yyoptions.c 1.1 8/27/80@(#)yypanic.c 1.2 3/8/81@(#)yyparse.c 1.2 3/8/81yyparse@(#)yyprint.c 1.2 3/8/81case-labelend-of-fileillegal charactererroridentifierreal numbernumbercharacterstring'..''x''x''x''x'keyword @(#)yyput.c 1.2 3/8/81r %6d %s %s: @(#)yyrecover.c 1.2 3/8/81dddddddddStates %d %d ... [Idfail]Input %s%s | %s%s Try Replace %s identifier with %s identifier cost=%d Cost %2d Replace %s identifier with %s identifier Unique symbol %s%s Trying state %d Try Delete %s%s cost=%d Cost %2d Delete %s%s Try Insert %s%s cost=%d Cost %2d Freebie %s%s Cost %2d Insert %s%s Try Replace %s%s with %s%s cost=%d Cost %2d Replace %s%s with %s%s Stack %d | %d, Input %s%s TIP OVFLO Shift to state %d YyEactr objects: have %s id, want %s id Reduce, length %d, new state %d Accept Error loccor@(#)yyseman.c 1.1 8/27/80@(#)yytree.c 1.1 8/27/80@(#)p2put.c 1.9 6/1/815ܕݕ$%067@EFKLT\elmnopqrstuvwxyz{|}~ƖΖՖ֖ $).38>DJPYcntzǗϗؗP2FTEXT | %3d | 0 putprintfP2FLBRAC | %3d | %d %d P2FRBRAC | 0 | %d P2FEOF P2FEXPR | %3d | %d [putleaf]P2ICON | %3d | 0x%x %d P2NAME | %3d | 0x%x %d P2REG | %3d | 0x%x putRV regvar_%sputRV no nameputLV regvar_%sputLV no name__disply__disply .data .align 2 .double 0d%.20e .text%s%dL .data .byte 0%o,0%o .byte 0%o,0%o .byte 0 .text%s%dLp2type intp2type%s (%d) | 0 | 0x%x %s (%d) | 0 | 0x%x %d %d "%s\0" %s%s\0 L jbr %s%d# PUT CALLED!: arg1 = %d arg2 = 0%oP2UNDEFINEDP2NAMEP2STRINGP2ICONP2FCONP2PLUSP2MINUSP2NEGP2MULP2INDIRECTP2ANDP2ADDROFP2ORP2ERP2QUESTP2COLONP2ANDANDP2ORORP2LISTOPP2ASSIGNP2COMOPP2DIVP2MODP2LSP2RSP2DOTP2STREFP2CALLP2UNARYCALLP2FORTCALLP2UNARYFORTCALLP2NOTP2COMPLP2INCRP2DECRP2EQP2NEP2LEP2LTP2GEP2GTP2ULEP2ULTP2UGEP2UGTP2SETBITP2TESTBITP2RESETBITP2ARSP2REGP2OREGP2CCODESP2FREEP2STASGP2STARGP2STCALLP2UNARYSTCALLP2FLDP2SCONVP2PCONVP2PMCONVP2PVCONVP2FORCEP2CBRANCHP2INITP2CAST@(#)stab.c 1.6 3/24/81 .stabs "%s",0x%x,0,0x%x,0x%x .stabs "%s",0x%x,0,0x%x,0 .stabs "%s",0x%x,0,0,0x%x .stabs "%s",0x%x,0,0x%x,0x%x .stabs "%s",0x%x,0,0,0x%x .stabs "%s",0x%x,0,0x%x,0x%x .stabs "%s",0x%x,0,0,0x%x .stabs "%s",0x%x,0,0x%x,0x%x .stabs "%s",0x%x,0,0,0x%x .stabd 0x%x,0,0x%x .stabd 0x%x,0,0x%x .stabs "%s",0x%x,0,0x%x,0x%x .stabs "%s",0x%x,0,0x%x,0x%x .stabs "%s",0x%x,0,0x%x,%s .stabd 0x%x,0,0x%x .stabs "%s",0x%x,0,0x%x,0 .stabs "%s",0x%x,0,0,%s%dLL%s%dLL: .stabs "%s",0x%x,0,0x%x,0 .stabs "%s",0x%x,0,0,%s%dLL%s%dLL: .stabs "%s",0x%x,0,0x%x,0x%x .stabs "%s",0x%x,0,0x%x,0x%x .stabs "%s",0x%x,0,0x%x,0x%x .stabs "%s",0x%x,0,0x%x,0x%x@(#)pcproc.c 1.6 6/1/81_PFLUSH_FLUSH_PFLUSH__err_UNIT_output_outputii_FNIL_RANG4_RSGN4_PUTfmt1fmt2_WRITEC_fputc_ACTFILE%%%c%%%1D%c%%*%c%%%1D.%1D%c%%%1D.*%c%%*.%1D%c%%*.*%c_WRITEF_ACTFILE_fprintf_ACTFILE_MAX_MAXi_MAX_MAXid_NAM%s%dL_WRITES_fwrite_ACTFILE_WRITLN_fputc_ACTFILE_UNIT_input_inputbsci_RANG4_RSNG4_FNIL_input_GETbsci_RANG4_RSNG4_READC_READ4_READ8_READE%s%dLbcsi_READLN_UNIT_GET_PUT_RESET_REWRITE_DISPOSE_NEWZ_NEW_DATE_TIME_HALT_ARGVi_STLIMi_REMOVE_LLIMITi_UNIT_PAGE_fputc_ACTFILE_PACKpack(a,i,z)_UNPACKunpack(z,a,i)proc case@(#)pcfunc.c 1.6 6/1/81__argc_CLCK_SCLCK_time_exp_sin_cos_atan_LN_log_SQRT_sqrt_RANDOMidiid_EXPOiidi_SEEDd_ROUND_TRUNCd_fabsi_absdibcisdbcsi_SUCC_PREDbcsii_CHRt_CARD_TEOLN_TEOFfunc1@(#)pccaseop.c 1.7 6/1/81bcsi_ERROR casel %s,$%d,$%dr0 .word %s%dL-%s%dL .word %s%dL-%s%dL jbr L%d cmpl %s,$%dr0 jeql L%d jbr L%d cmpl %s,$%dr0 jgtr L%d jeql L%dL%d: cmpl %s,$%dr0 jeql L%d jbr L%d@(#)pclval.c 1.4 6/1/81lval2nilfnil_NIL_FNILFri Jul 10 17:13:18 1981M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDecUnknown error: #))P: r<< <(L /<7L ><FD N`=Vp]=el=t|>X4?"h? 2DB7pB:B@B@ C@$CPB\E dEE0F%E-H7E?HFFQ@FYM^Gf d h Pl n p |G z<     q ( A0  p( - ԩ2G:GB hةI}[O V 10^ A4f 8n py N T         i      F<  K0!2'L 1(9oȁCJj<Q<6X_Rf~1pNy 0FQ\F #fX.D7  |. 1 <  & ! ( 0 8/ AWD K`!S^ ZD bdUipVp|r dEʏn Pp NX nX F,# r) . 7 sl= @pD PL 4S [ d ' l $u (x sH| d d@` h D M QF QXFXM LpQYX7&Y` YhYr~Zz[`2\YcYY Z$ZJUbSK\enDw00_w@ H ,+G#ޤL"7 XH)܍-:6? DbXMhT D]ܳf {0n Lw EP| B*`f e#zҶ # # # #UH #(e<"N)^ 6)*2n;_DM S#U ($^ V0$f (p$m x$r q<%v @% (D% H% L% P% X%q |t% x%\08"r' *32;a@'B6LMjV]f<(o?jz ,~Pt :~z..," |%L64$:[R)y+T,l,, 47 %6$ ),72788?L:E79N P:Sy:Xcrt0.oato.o_sccsidcall.o_sccsidcase.o_sccsidclas.o_sccsidconst.o_sccsidconv.o_sccsidcset.o_sccsiderror.o_sccsidfdec.o_sccsidfend.o_sccsidfhdr.o_sccsidflvalue.o_sccsidforop.o_sccsidfunc.o_sccsidgen.o_sccsidhash.o_sccsidlab.o_sccsidlookup.o_sccsidlval.o_sccsidstklval.o_sccsidmain.o_copyright_sccsidnl.o_sccsidproc.o_sccsidput.o_sccsidrec.o_sccsidrval.o_sccsidstkrval.o_sccsidstat.o_sccsidstring.o_sccsidsubr.o_sccsidtmps.o_sccsidtree.o_sccsidtype.o_sccsidvar.o_sccsidTRdata.o_sccsidtreen.o_sccsidyycopy.o_sccsidy.tab.o_sccsidyycosts.o_sccsidyyerror.o_sccsidyyget.o_sccsidyyid.o_sccsidyylex.o_sccsidyymain.o_sccsid_magichdryyoptions.o_sccsidyypanic.o_sccsidyyparse.o_sccsidyyprint.o_sccsidyyput.o_sccsidyyrecover.o_sccsid_ntokyyseman.o_sccsidyytree.o_sccsidp2put.o_sccsidstab.o_sccsidpcproc.o_sccsidpcfunc.o_sccsidpccaseop.o_sccsidpclval.o_sccsidVersion.oabort.octime.ofork.ofprintf.ofopen.ocreat.ofseek.operror.oerrlst.oprintf.oputw.oqsort.ordwr.oatof.ofilbuf.oldexp.ostrlen.oexecl.oexecv.oexecve.osignal.olseek.otime.osprintf.odoprnt.oflsbuf.oexit.odata.oclose.oisatty.oopen.oread.ostat.ostty.oioctl.ounlink.omalloc.osbrk.oudiv.owait.owrite.ocerror.o_exitstart_main_environ_fulltrace_errtrace_testtrace_yyunique_opts_optstk_monflg_profflag_Recovery_Eholdnl_Enocascade_eflg_errpfx_cgenflg_syneflg_efil_ofil_obuf_Enoline_nlp_disptab_clnames_bn_cbn_line_display_frtn_sizes_dfiles_con_set_MAXINT_MININT_gocnt_cnts_parts_divchk_divflg_errcnt_forechain_withlist_intset_input_output_program_progseen_level_gotos_noreach_lc_pflist_pflstc_pfcnt_filename_tvec_ftnno_pcstream_a8tol_error_rtlocs_enclosing_call_classify_p2type_tmpalloc_putRV_putop_width_panic_align_sextname_putleaf_plist_lvalue_rvalue_isa_precheck_postcheck_compat_cerror_lwidth_putstrop_flvalue_fcompat_rvlist_putLV_putdot_linenum_parnam_clnxxxx_nl_text_scalar_isnta_nameof_nowexp_whereis_constbeg_level1_const_gconst_defnl_enter_stabgconst_constend_lookup_classes_atof_bytes_savestr_isconst_convert_put_rangechk_putprintf_conv_precset_mask_setran_constval_postcset_getlab_putlab_sprintf_ibuf_ibp_charbuf_bufp_token_yyprtd_yycol_yyline_yyseqid_yysavc_yylinpt_Y_OY_Ps_yyval_N_lastkey_yykey_yyResume_dquote_errout_yyidhave_yyidwant_yyshifts_yyOshifts_yytshifts_printf_abort_Perror_pexit_geterr_yyoutline_yysetfile_pchr_bodycnts_funcfwd_funcext_stabefunc_funcbody_roundup_leven_segend_nerror_pnumcnt_pnums_Fp_yySsync_funcend_cntstat_stabfunc_stablbrac_putjbr_putlbracket_inccnt_strcmp_stabparam_stablvar_lookup1_strlen_putCONG_statlist_stabrbrac_savmask_putrbracket_dumpnl_nlfree_inpflist_opop_funchdr_opush_yyretrieve_getcnt_params_gtype_fparams_forop_putline_statement_putcnt_htab_inithash_hash_calloc_yerror_label_stabglabel_gotoop_labeled_flagwas_reclook_pclvalue_lptr_arycod_aryconst_stklval_piusage_pixusage_pcusage_usageis_errfile_pcname_howfile_fork_execl_wait_togopt_yycosts_dotted_open_perror_close_fopen_stabsource_signal_onintr_yymain_ugh__iob__flsbuf_getline_yyflush_write_unlink_puteof_lseek_read_header_gettime_myctime_version_ntab_nlact_in_consts_in_types_in_rclasses_in_ranges_in_ctypes_in_vars_in_funcs_in_procs_in_fops_in_pops_initnl_hdefnl_VARIABLE_snark_ctext_stars_free_nloff_malloc_nlcopy_obufp_otext_listnames_getnext_lenstr_patch_P0_tyrec_tyrec1_fields_variants_deffld_defvnt_stabfield_uniqv_reccompline_nssetline_relts_relss_relops_mathop_setop_opnames_pcfunccod_putCON8_nocomp_stkrval_ifop_ungoto_tmpfree_pcproc_asgnop_whilop_repop_pccaseop_withop_asrtop_stabline_asgnop1_strings_strng_strngp_strcpy_esavestr_stat_ctime_fprintf_copy_any_ttab_tract_space_spacep_trspace_inittree_tree_tralloc_trfree_yylacnt_bottled_copystr_typebeg_type_stabgtype_typeend_foredecl_tyscal_tyrang_tyary_norange_varbeg_var_dotalign_stabgvar_varend_even_trdesc_tree1_tree2_tree3_tree4_tree5_OYcopy((_yypv_yyactr_yyact_yypact_yyr1_yyr2_yygo_yypgo_fixlist_yyPerror_brerror_newlist_addlist_setuptyrec_yylex_setupvar_setupfield_yyEactr_identis_inscost_repcost_delcost_nullsem_yysyms_yydocost_charname_yysync_readch_incs_inclev_yyLinpt__filbuf_uninclud_includ_setuflg_skipbl_printed_stabinclude_fclose_yyidok_yybadref_yybaduse_ud_yyidok1_yyisvar_Yla_unyylex_yyset_options_yyparse_oldpos_yystate_yyv_yys_yyrecover_yyunexeof_yyexeof_bounce_tokname_lastname_lastid_hadsome_holdbl_yyoutfl_yyprline_yygetunit_yygetfile_yygetline_fseek_fread_yyprintf_graphic_yyputfn_insmult_repmult_delmult_yytips_yytipct_yytipv_yCcnt_YC0_YC_yyTshifts_cact_ccost_cchar_cflag_ACtok_correct_trystate_yCpv_yyredfail_loccor_puttext_str4len_p2word_p2string_p2name_typerecur_addtype_p2opnames_putw_printjbr_rdxxxx_casecmp_qsort_directsw_binarysw_itesw_bsrecur_nilfnil_localtime_asctime_ftime_gmtime_dysizecerror__doprnt__lastbuf_creat_errno_fflush_sys_nerr_sys_errlistudiv_fwrite_ldexp_execv_execve_time_isatty__sobuf__cleanup__sibuf_gtty_stty_ioctl_sbrk_realloc_end_brktipct_yytipv_yCcnt_YC0_YC_yyTshifts_cact_ccost_cchar_cflag_ACtok_correct_trystate_yCpv_yyredfail_loccor_puttext_str4len_p2word_p2string_p2name_typerecur_addtype_p2opnames_putw_printjbr_rdxxxx_casecmp_qsort_directsw_binarysw_itesw_bsrecur_nilfnil_localtime_asctime_ftime_gmtime_dysizecerror__doprnt__lastbuf_creat_lib/how_pc 444 0 33 1024 2552607173 6005 @(#)how_pc 1.1 (Berkeley) 3/2/81 To translate a program using pc, place the source in a file whose name ends in the characters ".p", e.g. "prog.p". The command pc prog.p will translate the program, leaving an executable program in the file a.out in the current directory. This code can be executed by typing a.out The complete command line syntax for pc is pc [ option ] [ -i file ... ] name.p ... The command "man pc" will give information as to the options of pc. Refer to the Berkeley Pascal User's Manual for more details. eley) 3/2/81 To translate a program using pc, place the source in a file whose name ends in the characters ".p", e.g. "prog.p". The command pc prog.p will translate the program, leaving an executable program in the file a.out in the current directory. This code can be executed by typing a.out The complete command line syntax for pc is pc [ option ] [ -i file ... ] name.p ... The command "man pc" will give information as to the options of pc. Refer to the Berkeley Pascal User's Manualib/pc2 755 0 33 16100 2552607172 5237  ^Юn PPՀPpPP  P1Ѭݏݏ ЬPݠ-Ѭݏݏ ЬPݠϛ [[ qVkXPPVhh xVVǏeVPďePPVxVP@PPZkXPPPjxPPZZZ[j[ݏݏÏ]PPρP1#:Ï]PPϵPWWWWPÏ]PPYi Yݏ YpPݏÏ]PPYVYXPPVhh xVVǏeVPďePPVxVP@PPZYXPPPj`ݭYݺP1W gݏÏ]PP\ݏjPݠK3xPPZZZݏÏ]PP1^1Ь[ЬZ!jЪP֪X``P ZXPYXYPЬ[Ь Z+PPPXZkw+ݏݬ7PYX1YYHkalXPPPݬVPY<3ݏݬPYXYYݬPYY)YXPPPݬPYYPjYX kr  ZPЬ [ЬY׬&k ЫP֫`P [LPZZZ Z YPЬPЬ[k[PPPЬ[  P ݏyP ի ߘP@ [  P2PPݫ~PkЫk!k    k1WP֫Ь[ЬZЬ YY kPYP kPzQQPL^Ь[    PPYYX1XX߭~PYj~P g_ BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[1xݏPZZ  YYX ZYYXZYZ~(PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PPT[ [[[~ Ь[Z = 8[ePZ~9PZ ݫ ԫ kZP{(P^߭ݬDPPPݬݏ tݬݬݏtݬ64.!&!  ~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [!PYPƏPxPbPZx|PZPPZxl~@PZZZIBPZP5x6PZPPjj!1xYP[PZkk[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP%@jX~\S^\_=P4CЬPЬPЬRRQ{RPPR PRPPPuP@(#)pc2.c 1.10 6/8/81  l v oznw/9Ze*AJrwcalls $1,_ACTFILE movl (sp)+,r1 movl 12(r1),r0 1,_fgetc sobgeq *(sp),1f calls $1,__filbuf jbr 2f 1: addl3 $4,(sp)+,r1 movzbl *(r1),r0 incl (r1) 2: 2,_fputc sobgeq *4(sp),1f calls $2,__flsbuf jbr 2f 1: popr $0x3 movb r0,*4(r1) incl 4(r1) 2: 3,_blkcpy popr $0xb pushl r0 jbr 2f 1: subl2 r0,(sp) movc3 r0,(r1),(r3) 2: movzwl $65535,r0 cmpl (sp),r0 jgtr 1b movl (sp)+,r0 movc3 r0,(r1),(r3) 2,_blkclr movl 4(sp),r3 jbr 2f 1: subl2 r0,(sp) movc5 $0,(r3),$0,r0,(r3) 2: movzwl $65535,r0 cmpl (sp),r0 jgtr 1b popr $0x3 movc5 $0,(r3),$0,r0,(r3) 3,_LOCC popr $0x30 movl (sp)+,r1 1: movzwl $65535,r0 cmpl r5,r0 jleq 1f subl2 r0,r5 locc r4,r0,(r1) jeql 1b addl2 r5,r0 jbr 2f 1: locc r4,r5,(r1) 2: 2,_ROUND cvtrdl (sp)+,r0 2,_TRUNC cvtdl (sp)+,r0 1,_FCALL movl (sp),r0 ashl $3,4(r0),r1 movc3 r1,__disply+8,8(r0)[r1] movl (sp)+,r0 ashl $3,4(r0),r1 movc3 r1,8(r0),__disply+8 1,_FRTN movl (sp)+,r0 ashl $3,4(r0),r1 movc3 r1,8(r0)[r1],__disply+8 3,_FSAV movl 8(sp),r0 movl (sp)+,(r0) movl (sp)+,4(r0) ashl $3,4(r0),r1 movc3 r1,__disply+8,8(r0) movl (sp)+,r03,_RELEQ popr $0xb movl r0,r4 1: movzwl $65535,r0 cmpl r4,r0 jleq 3f subl2 r0,r4 cmpc3 r0,(r1),(r3) jeql 1b 2: clrl r0 jbr 4f 3: cmpc3 r4,(r1),(r3) jneq 2b incl r0 4: 3,_RELNE popr $0xb movl r0,r4 1: movzwl $65535,r0 cmpl r4,r0 jleq 3f subl2 r0,r4 cmpc3 r0,(r1),(r3) jeql 1b 2: movl $1,r0 jbr 4f 3: cmpc3 r4,(r1),(r3) jneq 2b 4: 3,_RELSLT popr $0xb movl r0,r4 jbr 2f 1: subl2 r0,r4 cmpc3 r0,(r1),(r3) jneq 3f 2: movzwl $65535,r0 cmpl r4,r0 jgtr 1b cmpc3 r4,(r1),(r3) 3: jlss 4f clrl r0 jbr 5f 4: movl $1,r0 5: 3,_RELSLE popr $0xb movl r0,r4 jbr 2f 1: subl2 r0,r4 cmpc3 r0,(r1),(r3) jneq 3f 2: movzwl $65535,r0 cmpl r4,r0 jgtr 1b cmpc3 r4,(r1),(r3) 3: jleq 4f clrl r0 jbr 5f 4: movl $1,r0 5: 3,_RELSGT popr $0xb movl r0,r4 jbr 2f 1: subl2 r0,r4 cmpc3 r0,(r1),(r3) jneq 3f 2: movzwl $65535,r0 cmpl r4,r0 jgtr 1b cmpc3 r4,(r1),(r3) 3: jgtr 4f clrl r0 jbr 5f 4: movl $1,r0 5: 3,_RELSGE popr $0xb movl r0,r4 jbr 2f 1: subl2 r0,r4 cmpc3 r0,(r1),(r3) jneq 3f 2: movzwl $65535,r0 cmpl r4,r0 jgtr 1b cmpc3 r4,(r1),(r3) 3: jgeq 4f clrl r0 jbr 5f 4: movl $1,r0 5: 4,_ADDT popr $0x17 movl r0,r3 1: bisl3 (r1)+,(r2)+,(r3)+ sobgtr r4,1b 4,_SUBT p((opr $0x17 movl r0,r3 1: bicl3 (r2)+,(r1)+,(r3)+ sobgtr r4,1b 4,_MULT popr $0x17 movl r0,r3 1: mcoml (r1)+,r5 bicl3 r5,(r2)+,(r3)+ sobgtr r4,1b 4,_IN popr $0x1e clrl r0 subl2 r2,r1 cmpl r1,r3 jgtru 1f jbc r1,(r4),1f incl r0 1: 8"4,_MULT popr $0x17 movl r0,r3 1: mcoml (r1)+,r5 bicl3 r5,(r2)+,(r3)+ sobgtr r4,1b 4,_IN popr $0x1e clrl r0 subl2 r2,r1 cmpl r1,r3 jgtru 1f jbc r1,(r4),1f incl r0 1: lib/pc2.0strings 644 0 33 30703 2552607176 7015 8 or 9 in octal number Number too large for this implementation Not enough arguments to %s Expression given (variable required) for var parameter %s of %s Parameter type not identical to type of var parameter %s of %s Expression type clashed with type of value parameter %s of %s Too many arguments to %s %s %s declared on line %d has more arguments than %s %s declared on line %d %s parameter %s of %s declared on line %d is not identical with %s parameter %s of %s declared on line %d Type of %s parameter %s of %s declared on line %d is not identical to type of %s parameter %s of %s declared on line %d %s %s declared on line %d has fewer arguments than Case selectors cannot be %ss Ran out of memory (case) Case label type clashed with case selector expression type Case label out of range Multiply defined label in case, lines %d and %d Oct/hex allowed only on writeln/write calls Width expressions allowed only in writeln/write calls Constant declarations should precede type, var and routine declarations All constants should be declared in one const part %s is a %s, not a constant as required Constant too large for this implementation %s constants cannot be signed Type clash: real is incompatible with integer This resulted because you used '/' which always returns real rather than 'div' which divides integers and returns integers Type clash: non-identical scalar types Type clash: unequal length strings Type clash: files not allowed in this context Type clash: non-identical %s types Type clash: %ss with file components not allowed in this context Type clash: %s is incompatible with %s Constant set involved in non set context Set default type "intset" is not a set Sets may not have 'real' elements Set elements must be scalars, not %ss Range upper bound of %D out of set bounds Upper bound of element type clashed with set type in constant set Range lower bound of %D out of set bounds Lower bound of element type clashed with set type in constant set Value of %D out of set bounds Element type clashed with set type in constant set External procedures and functions are not standard External procedures and functions can only be declared at the outermost level. Procedures or functions cannot be declared external. Too many levels of function/procedure nesting Separately compiled routine segments are not standard. %s undefined on line%s %s improperly used on line%s Unresolved forward declaration of %s %s No assignment to the function variable Missing program statement and program body Missing program statement File %s listed in program statement but not declared File %s listed in program statement but declared as a %s File %s listed in program statement but defined as %s The file output must appear in the program statement file list Input is used but not defined in the program statement %s %s is neither used nor set %s %s is never used %s %s is used but never set label %s was declared but not defined Function type should be given only in forward declaration Procedures do not have types, only functions do Function type must be specified Function type can be specified only by using a type identifier Functions should not return %ss Procedure/function nesting too deep Types must be specified for arguments Procedures cannot have types Types for arguments can be specified only by using type identifiers Files cannot be passed by value Files cannot be a component of %ss passed by value Each function argument must be declared separately Each procedure argument must be declared separately Expression given, %s required for %s parameter %s Formal %s %s cannot be qualified %s %s cannot be qualified Built-in %s %s cannot be passed as a parameter Variable given, %s required for %s parameter %s For variable %s must be unqualified For variable %s cannot be an element of a record For variable %s must be declared in the block in which it is used For variable %s cannot be %ss Can't modify the for variable %s in the range of the loop Type of initial expression clashed with index type in 'for' statement Type of limit expression clashed with index type in 'for' statement %s is not a function %s is a nonstandard function %s takes no arguments %s takes either zero or one argument %s takes exactly one argument %s's argument must be integer or real, not %s seed's argument must be an integer, not %s %s's argument must be a real, not %s %s's argument must be an integer or real, not %s ord's argument must be of scalar type or a pointer, not %s %s is forbidden for reals %s's argument must be of scalar type, not %s odd's argument must be an integer, not %s chr's argument must be an integer, not %s Argument to card must be a set, not %s Argument to eoln must be a text file, not %s Argument to eof must be file, not %s %s is an unimplemented 6000-3.4 extension Ran out of memory (hash) Ran out of hash tables Label declarations should precede const, type, var and routine declarations All labels should be declared in one label part Goto %s is into a structured statement Label %s not defined in correct block Label %s redefined Goto %s from line %d is into a structured statement %s is undefined Variable required %s %s found where variable required ^ allowed only on files and pointers, not on %ss %s is a %s, not a function Illegal function qualificiation Pascal uses [] for subscripting, not () Subscripting allowed only on arrays, not on %ss . allowed only on records, not on %ss %s is not a field in this record Error occurred on qualification of %s Too few subscripts (%d given, %d required) Subscript value of %D is out of range Array index type incompatible with declared index type Error occurred on index number %d Too many subscripts (%d given, %d required) Ran out of memory (defnl) Ran out of name list tables Pre-defined files input and output must not be redefined %s is already defined in this block Can't call %s, its %s not a procedure %s is a nonstandard procedure null takes no arguments flush takes at most one argument flush's argument must be a file, not %s Writing %ss with two write widths is non-standard Cannot write %ss with two write widths Negative widths are not allowed Zero widths are non-standard Oct/hex allowed only on text files Write widths allowed only on text files Type mismatch in write to non-text file Oct and hex are non-standard Can't write %ss with oct/hex Writing scalars to text files is non-standard Can't write %ss to a text file Second write width must be integer, not %s First write width must be integer, not %s Write requires an argument Message requires an argument Can't 'writeln' a non text file Arguments to %s must be variables, not expressions Type mismatch in read from non-text file Can't read %ss from a text file Reading scalars from text files is non-standard Can't 'readln' a non text file read requires an argument %s expects one argument Argument to %s must be a file, not %s %s expects one or two arguments Two argument forms of reset and rewrite are non-standard First argument to %s must be a file, not %s Second argument to %s must be a string, not %s %s expects at least one argument (First) argument to %s must be a pointer, not %s Record required when specifying variant tags Too many tag fields Second and successive arguments to %s must be constants Specified tag constant type clashed with variant case selector type No variant case label value equals specified constant value Argument to %s must be a alfa, not %s halt takes no arguments argv takes two arguments argv's first argument must be an integer, not %s argv's second argument must be a string, not %s stlimit requires one argument stlimit's argument must be an integer, not %s remove expects one argument remove's argument must be a string, not %s linelimit expects two arguments linelimit's second argument must be an integer, not %s linelimit's first argument must be a text file, not %s page expects one argument Argument to page must be a text file, not %s pack expects three arguments unpack expects three arguments %s requires a to be an unpacked array, not %s %s requires z to be a packed array, not %s %s requires a and z to be arrays of the same type %s requires a and z to be single dimension arrays %s cannot have more elements in a (%d) than in z (%d) %s is an unimplemented 6400 extension Tag fields cannot be %ss %s is a duplicate field name in this record Variant label type incompatible with selector type Duplicate variant case label in record %s is a constant and cannot be qualified Constant string too lon((g Can't qualify a function result value Type names (e.g. %s) allowed only in declarations Procedure %s found where expression required Operand of %s must be integer or real, not %s not must operate on a Boolean, not %s Left operand of %s must be Boolean, not %s Right operand of %s must be Boolean, not %s Left operand of / must be integer or real, not %s Right operand of / must be integer or real, not %s Set types of operands of %s must be identical Left operand of %s must be integer, real or set, not %s Right operand of %s must be integer, real or set, not %s Cannot mix sets with integers and reals as operands of %s Left operand of %s must be integer, not %s Right operand of %s must be integer, not %s %s comparison on sets is non-standard %s not allowed on records - only allow = and <> %s not allowed on pointers - only allow = and <> Strings not same length in %s comparison %ss and %ss cannot be compared - operator was %s %s types must be identical in comparisons - operator was %s Right operand of 'in' must be a set, not %s Index type clashed with set component type for 'in' record comparison is non-standard %ss may not participate in comparisons Unreachable statement Variable in with statement refers to %s, not to a record Type of expression clashed with type of variable in assignment Type of expression in if statement must be Boolean, not %s Type of expression in while statement must be Boolean, not %s Until expression type must be Boolean, not %s, in repeat statement Assert statement is non-standard Assert expression must be Boolean, not %ss Ran out of memory (string) Ran out of memory (tralloc) Ran out of tree tables Type declarations should precede var and routine declarations All types should be declared in one type part %s is a %s, not a type as required Files cannot be members of files Set of real is not allowed Set type must be range or scalar, not %s Implementation restriction: sets must be indexed by 16 bit quantities Storage requirement of %s exceeds the implementation limit of %D by %D bytes Can't mix %ss and %ss in subranges Scalar types must be identical in subranges Range lower bound exceeds upper bound Subrange of real is not allowed Subrange bounds must be Boolean, character, integer or scalar, not %s Index type for arrays cannot be real Array index type is a %s, not a range or scalar as required Value of dimension specifier too large or small for this implementation Files cannot be members of dynamic structures Variable declarations should precede routine declarations All variables should be declared in one var part Malformed program statement Malformed declaration Malformed const declaration Malformed type declaration Malformed var declaration Malformed record declaration Deleted ';' before keyword else Malformed statement in case Malformed statement Missing/malformed expression Too many syntax errors - QUIT End matched %s on line %d Inserted keyword end matching %s on line %d Input line too long - QUIT Include syntax error - expected ' or " not found - QUIT Missing closing %c for include file name - QUIT Garbage after filename in include Include filename must end in .i or .h Absurdly deep include nesting - QUIT Ran out of memory (include) Octal constants are non-standard Digits required after decimal point Digits required in exponent Character/string delimiter is ' Unmatched %c for string Null string not allowed Digits required before decimal point { in a { ... } comment Comment does not terminate - QUIT (* in a (* ... *) comment Illegal character Declaration found when statement expected Expected keyword begin after declarations, before statements Parsing resumes Parse stack overflow Unrecoverable syntax error - QUIT Point of error Undefined identifier Improper %s identifier Deleted %s%s Replaced %s%s with a %s%s Inserted %s%s Expected %s%s Undefined %s Replaced %s id with a %s id End-of-file expected - QUIT Unexpected end-of-file - QUIT ... } comment Comment does not terminate - QUIT (* in a (*lib/how_pi 444 0 33 1124 2552607173 6014 @(#)how_pi 1.1 (Berkeley) 3/2/81 To translate a program using pi, place the source in a file whose name ends in the characters ".p", i.e. "prog.p". The command pi prog.p will translate the program into interpreter code which will be left in the file "obj" in the current directory. This code can be executed by typing obj or px The program "pix" can be used for load and go Pascal. The complete command line syntax for pi is pi [ -blnpstuw ] [ -i file ... ] name.p The command "man pi" will give information as to the options of pi. Refer to the UNIX Pascal User's Manual for more details. n a file whose name ends in the characters ".p", i.e. "prog.p". The command pi prog.p will translate the program into interpreter code which will be left in the file "obj" in the current directory. This code can be executed by typing obj or px The program "pix" can be used for load and go Pascal. The complete command line syntax for pi is pi [ -blnpstuw ] [ -i file ... ] name.p The command "man pi" will give informatiolib/how_pix 444 0 33 1577 2552607173 6220 @(#)how_pix 1.1 (Berkeley) 3/2/81 To translate and execute a program with pix, place the source in a file whose name ends in the characters ".p", i.e. "prog.p". The command pix prog.p will translate the program into interpreter code which will be then be executed If there are compilation errors `E', then execution will be suppressed. To create a permanent "obj" file which you can interpret, use "pi". Type "pi" for basic information on pi. The complete command line syntax for pix is pix [ -blnpstuw ] [ -i file ... ] name.p [ arg ... ] Here the trailing arguments are passed to your Pascal program. This command is equivalent to pi [ -blnpstuw ] [ -i file ... ] name.p and then px scratch [ arg ... ] where scratch is a temporary file which is then removed. The command "man pi" will give information as to the options of pix. Refer to the UNIX Pascal User's Manual for more details. n interpret, use "pi". Type "pi" for basic information on pi. The complete command line syntax for pix is pix [ -blnpstuw ] [ -lib/pc3 755 0 33 24114 2552607173 5245  ^Юn PPՀPpPP P(^ м߭׬^ЬPݠ* PPЬPݠϹ߭мP~ЬPЭԠݼ ߭_ PP  ЬPݠυѭe ЬPݠυύ߭Ϡ PЬP ݬPSݬTѭ"ѭѭ ЬPݠC1Gݼς ЬPЭ̠ ݬ ݼϛ4^Ь[k ߭ϙ PP ݫѭ܏ѭ܏ ѭ܏ ѭ܏ 2P PPPPP Pݭk ݭPP ݫϫ ݭϴPZݭϤek ݭZ PkPP  ݫϊ1@k߭ϻ PP ݫϊ1ݭPYݭϔk~Y~{ PPݫϋԭE PZP` PZPY`P QZQPa PZPm`[ PZP~!֭ѭ̭ZZϨYYϝЬP0ݼυP[ի1ЬP2PP pu<<1ϼЬPРϩ ϧЬPРԫԫύώk2~ePЬPݠpϤ[^[]k P ЬPѫ kݠϧϛ2PP 49ZZݫݻݼЬPݠϟ_[[ЬPѫ kݠ_9ЬP ? 9   ЬPѫ ϞիϗЬPРЬP1cѫwm ^ݬ'PPPǏPQďQQPD[[(ݏP[ ς[[PxQQPZ[YXj+kPHkIPjЭjPԠjPjPѺxXPPZZYZXXЫ[1`^ϡ$ݏϰPϋP g {s llЭP ZЬ[ xZPkQQPZ[kZP^ݬPP((ǏPQďQQP [[(ݏϞP[ R[[PxQQPZ[YXj+kPVkݬPMPjݬjtjPݬjPxXPPZZYZXXЫ[1R^Ь[[ZgZ8ZZP2PPYYWP>P YL}Y,$ZZЭP<^ЬPݠ ݼϔݼ<߭PZZ<Pޭ[k{ ߭PYYYݼϓYPЬQP Pϊϊݬ ݬݬݬݬݬ ݬlϲ_϶լϊE ^߭ݬPݬ~ώЭPPP  &,28>DJPPQPWP^P^PaP`PcPfPjPvP ^Ь[ԭZk96 PQPQ0QZ[[kPP P P+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~P   BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[#1xݏPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP [ [[[B  Ь[Z = 8[ePZ~YPZ ݫs ԫ kZP{ Ь[ЬZkPkPzQQP`PPP^߭ݬlPPP PЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6.l,h,~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [h,PYPƏPxPkbPZxXPZPPZxH~@PZZZ%PZPxPZPPjjh,1xYP[PZkk[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j~\S^\_PCЬPЬPЬRRQ{RPPR PRPPPMP@(#)pc3.c 1.6 9/9/80pcrcannot open: %scannot read header: %sold archive: %s! bad format: %serror reading struct exec: %sno name list: %sno room for %d nlistsno string table (old format .o?)no string table (old format .o?)no room for %d bytes of stringserror reading string table: %s%s, line %d: %s %s must be declared in included file%s is out of date with %s%s is out of date with %s%s, line %d: %s already defined (%s, line %d).ran out of memory (entersymbol)ran out of memory (symbolalloc)ran out of memory (enterstring)no room for %d characters%s: %s: cannot opensource fileinclude filelabelconstanttypevariablefunctionprocedureexternal functionexternal procedureunknown symbolT(T(D$,string)no room for %d characters%s: %s: cannot opensource fileinclude filelabelconstanttypevariablefunctionprocedureexternal functionexternal procedureunknown symbolT(T(lib/how_pxp 444 0 33 553 2552607173 6200 @(#)how_pxp 1.1 (Berkeley) 3/2/81 To profile a program do pxp -z name.p after a translation specifying this option to pi and an execution, i.e.: pi -z name.p px or pix -z name.p To use pxp to reformat a program you can use the command: pxp name.p >newname.p The complete format for using pxp is pxp [ -acdefjntuw_ ] [ -23456789 ] [ -z [ name ... ] ] name.p /pT,pT5Ċ /,"lib/px_header 644 0 33 2000 2552607173 6462 (`,^Юn PPՀPpPP PF^Ь[ЬZ[jY YPIj@YY[[P@PYY ϱϥYQ<2W Y1YYYP2PPXXWWXYYv"ρϚ)ρ=%Ь[[YZZZ[ϖݬ8QP@)g*XЬRPQbP^ԭլ((ݏP|PݭݭVխѭ¬ Э!Pݬ$+ЬP}V}X}Z}Э`PЬPЬQ}V}X}Z}\Ё^PPXݬݬ;20$PPeP@(#)px_header.c 1.2 3/6/81Too many arguments. -Try again. /usr/ucb/pxPx not found. lib/Mail.help 644 0 33 1575 2532150245 6343 Mail Commands t type messages n goto and type next message e edit messages f give head lines of messages d delete messages s file append messages to file u undelete messages r reply to messages pre make messages go back to /usr/mail m mail to specific users q quit, saving unresolved messages in mbox x quit, do not remove system mailbox h print out active message headers ! shell escape c [directory] chdir to directory or home if none given A consists of integers, ranges of same, or user names separated by spaces. If omitted, Mail uses the last message typed. A consists of user names or distribution names separated by spaces. Distribution names are defined in .sendrc in your home directory. t> mail to specific users q quit, saving unresolved messages in mbox x quit, do not remove system mailbox h print out aclib/Mail.help.~ 644 0 33 1220 2532150245 6602 ----------------------------------------------------------- The following ~ escapes are defined: ~~ Quote a single tilde ~c users Add users to cc list ~d Read in dead.letter ~e Edit the message buffer ~h Prompt for to list, subject and cc list ~r file Read a file into the message buffer ~p Print the message buffer ~m messages Read in messages, right shifted by a tab ~s subject Set subject ~t users Add users to to list ~v Invoke display editor on message ~w file Write message onto file. ~? Print this message ~!command Invoke the shell ~|command Pipe the message through the command ----------------------------------------------------------- cc list ~d Read in dead.letter ~e Edit the message buffer ~h Prompt for to list, subject and cc list ~r file Read a file into the message buffer ~p Print the message buffer ~m messages Read in messages, right shifted by a tab ~s subject Set subject ~t users Add users to to list ~v Invoke display editor on message ~w file Write message onto file. ~? Print thilib/more.help 644 0 33 2116 2423004433 6407 Most commands optionally preceded by integer argument k. Defaults in brackets. Star (*) indicates argument becomes new default. ------------------------------------------------------------------------------- Display next k lines of text [current screen size] z Display next k lines of text [current screen size]* Display next k lines of text [1]* d or ctrl-D Scroll k lines [current scroll size, initially 11]* q or Q or Exit from more s Skip forward k lines of text [1] f Skip forward k screenfuls of text [1] ' Go to place where previous search started = Display current line number / Search for kth occurrence of regular expression [1] n Search for kth occurrence of last r.e [1] ! or :! Execute in a subshell v Start up /usr/ucb/vi at current line h Display this message ctrl-L Redraw screen :n Go to kth next file [1] :p Go to kth previous file [1] :f Display current file name and line number . Repeat previous command ------------------------------------------------------------------------------- started = Display current line number / Search for kth occurrence of regular expression [1] n Search for kth occurrence of last r.e [1] ! or :! Execute in a subshell v Start up /usr/ucb/vi at current line h Display this message ctrl-L Redraw screen :n Go to kth next file [1] :p Go to kth previous file [1] :f Display current file name and line number . Repeat previous command --lib/pi2.0strings 644 0 33 30703 2552607174 7021 8 or 9 in octal number Number too large for this implementation Not enough arguments to %s Expression given (variable required) for var parameter %s of %s Parameter type not identical to type of var parameter %s of %s Expression type clashed with type of value parameter %s of %s Too many arguments to %s %s %s declared on line %d has more arguments than %s %s declared on line %d %s parameter %s of %s declared on line %d is not identical with %s parameter %s of %s declared on line %d Type of %s parameter %s of %s declared on line %d is not identical to type of %s parameter %s of %s declared on line %d %s %s declared on line %d has fewer arguments than Case selectors cannot be %ss Ran out of memory (case) Case label type clashed with case selector expression type Case label out of range Multiply defined label in case, lines %d and %d Oct/hex allowed only on writeln/write calls Width expressions allowed only in writeln/write calls Constant declarations should precede type, var and routine declarations All constants should be declared in one const part %s is a %s, not a constant as required Constant too large for this implementation %s constants cannot be signed Type clash: real is incompatible with integer This resulted because you used '/' which always returns real rather than 'div' which divides integers and returns integers Type clash: non-identical scalar types Type clash: unequal length strings Type clash: files not allowed in this context Type clash: non-identical %s types Type clash: %ss with file components not allowed in this context Type clash: %s is incompatible with %s Constant set involved in non set context Set default type "intset" is not a set Sets may not have 'real' elements Set elements must be scalars, not %ss Range upper bound of %D out of set bounds Upper bound of element type clashed with set type in constant set Range lower bound of %D out of set bounds Lower bound of element type clashed with set type in constant set Value of %D out of set bounds Element type clashed with set type in constant set External procedures and functions are not standard External procedures and functions can only be declared at the outermost level. Procedures or functions cannot be declared external. Too many levels of function/procedure nesting Separately compiled routine segments are not standard. %s undefined on line%s %s improperly used on line%s Unresolved forward declaration of %s %s No assignment to the function variable Missing program statement and program body Missing program statement File %s listed in program statement but not declared File %s listed in program statement but declared as a %s File %s listed in program statement but defined as %s The file output must appear in the program statement file list Input is used but not defined in the program statement %s %s is neither used nor set %s %s is never used %s %s is used but never set label %s was declared but not defined Function type should be given only in forward declaration Procedures do not have types, only functions do Function type must be specified Function type can be specified only by using a type identifier Functions should not return %ss Procedure/function nesting too deep Types must be specified for arguments Procedures cannot have types Types for arguments can be specified only by using type identifiers Files cannot be passed by value Files cannot be a component of %ss passed by value Each function argument must be declared separately Each procedure argument must be declared separately Expression given, %s required for %s parameter %s Formal %s %s cannot be qualified %s %s cannot be qualified Built-in %s %s cannot be passed as a parameter Variable given, %s required for %s parameter %s For variable %s must be unqualified For variable %s cannot be an element of a record For variable %s must be declared in the block in which it is used For variable %s cannot be %ss Can't modify the for variable %s in the range of the loop Type of initial expression clashed with ((index type in 'for' statement Type of limit expression clashed with index type in 'for' statement %s is not a function %s is a nonstandard function %s takes no arguments %s takes either zero or one argument %s takes exactly one argument %s's argument must be integer or real, not %s seed's argument must be an integer, not %s %s's argument must be a real, not %s %s's argument must be an integer or real, not %s ord's argument must be of scalar type or a pointer, not %s %s is forbidden for reals %s's argument must be of scalar type, not %s odd's argument must be an integer, not %s chr's argument must be an integer, not %s Argument to card must be a set, not %s Argument to eoln must be a text file, not %s Argument to eof must be file, not %s %s is an unimplemented 6000-3.4 extension Ran out of memory (hash) Ran out of hash tables Label declarations should precede const, type, var and routine declarations All labels should be declared in one label part Goto %s is into a structured statement Label %s not defined in correct block Label %s redefined Goto %s from line %d is into a structured statement %s is undefined Variable required %s %s found where variable required ^ allowed only on files and pointers, not on %ss %s is a %s, not a function Illegal function qualificiation Pascal uses [] for subscripting, not () Subscripting allowed only on arrays, not on %ss . allowed only on records, not on %ss %s is not a field in this record Error occurred on qualification of %s Too few subscripts (%d given, %d required) Subscript value of %D is out of range Array index type incompatible with declared index type Error occurred on index number %d Too many subscripts (%d given, %d required) Ran out of memory (defnl) Ran out of name list tables Pre-defined files input and output must not be redefined %s is already defined in this block Can't call %s, its %s not a procedure %s is a nonstandard procedure null takes no arguments flush takes at most one argument flush's argument must be a file, not %s Writing %ss with two write widths is non-standard Cannot write %ss with two write widths Negative widths are not allowed Zero widths are non-standard Oct/hex allowed only on text files Write widths allowed only on text files Type mismatch in write to non-text file Oct and hex are non-standard Can't write %ss with oct/hex Writing scalars to text files is non-standard Can't write %ss to a text file Second write width must be integer, not %s First write width must be integer, not %s Write requires an argument Message requires an argument Can't 'writeln' a non text file Arguments to %s must be variables, not expressions Type mismatch in read from non-text file Can't read %ss from a text file Reading scalars from text files is non-standard Can't 'readln' a non text file read requires an argument %s expects one argument Argument to %s must be a file, not %s %s expects one or two arguments Two argument forms of reset and rewrite are non-standard First argument to %s must be a file, not %s Second argument to %s must be a string, not %s %s expects at least one argument (First) argument to %s must be a pointer, not %s Record required when specifying variant tags Too many tag fields Second and successive arguments to %s must be constants Specified tag constant type clashed with variant case selector type No variant case label value equals specified constant value Argument to %s must be a alfa, not %s halt takes no arguments argv takes two arguments argv's first argument must be an integer, not %s argv's second argument must be a string, not %s stlimit requires one argument stlimit's argument must be an integer, not %s remove expects one argument remove's argument must be a string, not %s linelimit expects two arguments linelimit's second argument must be an integer, not %s linelimit's first argument must be a text file, not %s page expects one argument Argument to page must be a text file, not %s pack expects three arguments unpack expects three arguments %s requires a to be an unpacked array, not %s %s requires z to be a packed array, not %s %s requires a and z to be arrays of the same type %s requires a and z to be single dimension arrays %s cannot have more elements in a (%d) than in z (%d) %s is an unimplemented 6400 extension Tag fields cannot be %ss %s is a duplicate field name in this record Variant label type incompatible with selector type Duplicate variant case label in record %s is a constant and cannot be qualified Constant string too long Can't qualify a function result value Type names (e.g. %s) allowed only in declarations Procedure %s found where expression required Operand of %s must be integer or real, not %s not must operate on a Boolean, not %s Left operand of %s must be Boolean, not %s Right operand of %s must be Boolean, not %s Left operand of / must be integer or real, not %s Right operand of / must be integer or real, not %s Set types of operands of %s must be identical Left operand of %s must be integer, real or set, not %s Right operand of %s must be integer, real or set, not %s Cannot mix sets with integers and reals as operands of %s Left operand of %s must be integer, not %s Right operand of %s must be integer, not %s %s comparison on sets is non-standard %s not allowed on records - only allow = and <> %s not allowed on pointers - only allow = and <> Strings not same length in %s comparison %ss and %ss cannot be compared - operator was %s %s types must be identical in comparisons - operator was %s Right operand of 'in' must be a set, not %s Index type clashed with set component type for 'in' record comparison is non-standard %ss may not participate in comparisons Unreachable statement Variable in with statement refers to %s, not to a record Type of expression clashed with type of variable in assignment Type of expression in if statement must be Boolean, not %s Type of expression in while statement must be Boolean, not %s Until expression type must be Boolean, not %s, in repeat statement Assert statement is non-standard Assert expression must be Boolean, not %ss Ran out of memory (string) Ran out of memory (tralloc) Ran out of tree tables Type declarations should precede var and routine declarations All types should be declared in one type part %s is a %s, not a type as required Files cannot be members of files Set of real is not allowed Set type must be range or scalar, not %s Implementation restriction: sets must be indexed by 16 bit quantities Storage requirement of %s exceeds the implementation limit of %D by %D bytes Can't mix %ss and %ss in subranges Scalar types must be identical in subranges Range lower bound exceeds upper bound Subrange of real is not allowed Subrange bounds must be Boolean, character, integer or scalar, not %s Index type for arrays cannot be real Array index type is a %s, not a range or scalar as required Value of dimension specifier too large or small for this implementation Files cannot be members of dynamic structures Variable declarations should precede routine declarations All variables should be declared in one var part Malformed program statement Malformed declaration Malformed const declaration Malformed type declaration Malformed var declaration Malformed record declaration Deleted ';' before keyword else Malformed statement in case Malformed statement Missing/malformed expression Too many syntax errors - QUIT End matched %s on line %d Inserted keyword end matching %s on line %d Input line too long - QUIT Include syntax error - expected ' or " not found - QUIT Missing closing %c for include file name - QUIT Garbage after filename in include Include filename must end in .i or .h Absurdly deep include nesting - QUIT Ran out of memory (include) Octal constants are non-standard Digits required after decimal point Digits required in exponent Character/string delimiter is ' Unmatched %c for string Null string not allowed Digits required before decimal point { in a { ... } comment Comment does not terminate - QUIT (* in a (* ... *) comment Illegal character Declaration found when statement expected Expected keyword begin after declarations, before statements Parsing resumes Parse stack overflow Unrecoverable syntax error - QUIT Point of error Undefined identifier Improper %s identifier Deleted %s%s Replaced %s%s with a %s%s Inserted %s%s Expected %s%s Undefined %s Replaced %s id with a %s id End-of-file expected - QUIT Unexpected end-of-file - QUIT ... } comment Comment does not terminate - QUIT (* in a (*lib/libcurses.a 755 0 33 104646 2552606106 7016 ! __.SYMDEF 363531339 0 27 100664 7064 ` 6:"$$2&2&'(( x-J/!0)030<`2C`2L`2T$4Z$4dBn4CvXDEFFFFFFF&Z&Z&Z&Z&Zghiklbn"4o*r3Xs;uB@vK@vU@v^@vg@vp@vz@v@v@v@v@v@v@v@v@v@v@v@v@v@v@v@v@v@v@v@v@v@v@v@v@v@v@v@v@v@v@v"@v&@v*@v.@v2@v6@v:@v>@vB@vF@vJ@vN@vR@vV@vZ@v^@vb@vf@vj@vn@vr@vv@vz@v~@v@v@v@v@v@v@vL{((_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_deltx_delty_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_del_step_arc_quad_abs_box_circle_closevt_closepl_dot_erase_lbl_mv_lbl_umv_label_line_linemod_move_openvt_openpl_point_scale_space_obotx_oboty_botx_boty_scalex_scaley_scaleflag_oloy_ohiy_ohix_oextra_cont_putch_arc_box_circle_closevt_closepl_dot_erase_label_line_iline_cont_linemod_move_xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx_boty_obotx_oboty_scalex_scaley_openpl_openvt_point_space_abval_xconv_yconv_inplot_spew_outplot_tobotleft_reset_dist2_swap_movep_xsc_ysc_xargc_xargv_main__sigfdie__sigidie__sigqdie__sigindie__sigtdie__sigdie_s_rnge_abort__getarg__iargc__getenv__signal__s_stop_s_paus_system__pow_ci_pow_dd_pow_di_pow_hh_pow_ii_pow_ri_pow_zi_pow_zz_c_abs_c_cos_c_div_c_exp_c_log_c_sin_c_sqrt_z_abs_z_cos_z_div_z_exp_z_log_z_sin_z_sqrt_r_abs_r_acos_r_asin_r_atan_r_atn2_r_cnjg_r_cos_r_cosh_r_dim_r_exp_r_imag_r_int_r_lg10_r_log_r_mod_r_nint_r_sign_r_sin_r_sinh_r_sqrt_r_tan_r_tanh_srand__rand__d_abs_d_acos_d_asin_d_atan_d_atn2_d_cnjg_d_cos_d_cosh_d_dim_d_exp_d_imag_d_int_d_lg10_d_log_d_mod_d_nint_d_prod_d_sign_d_sin_d_sinh_d_sqrt_d_tan_d_tanh_i_abs_i_dim_i_dnnt_i_indx_i_len_i_mod_i_nint_i_sign_h_abs_h_dim_h_dnnt_h_indx_h_len_h_mod_h_nint_h_sign_l_ge_l_gt_l_le_l_lt_hl_ge_hl_gt_hl_le_hl_lt_ef1asc__ef1cmc__s_cat_s_cmp_s_copy_cabs_tanh_sinh_cosh_f_back_s_rdfe_c_dfe_y_getc_y_err_y_rsk_s_wdfe_y_putc_y_rev_e_rdfe_e_wdfe_s_rdue_c_due_s_wdue_e_rdue_e_wdue_icptr_icend_svic_icnum_icpos_z_getc_z_putc_z_rnew_s_rsfi_c_si_y_ierr_s_wsfi_z_wnew_e_rsfi_e_wsfi_f_inqu_setcilist_setolist_stcllist_setalist_f_rew_s_rsfe_x_getc_x_endp_xrd_SL_x_rev_rd_ed_rd_I_rd_L_rd_A_rd_AW_rd_F_rd_ned_rd_POS_rd_H_recloc_s_rsue_c_sue_s_wsue_e_wsue_e_rsue_reclen_do_us_do_uio_do_ud_s_wsfe_x_putc_xw_end_xw_rev_x_wSL_pr_put_e_rsfe_c_sfe_e_wsfe_syl_parenlvl_pc_revloc_pars_f_f_s_op_gen_f_list_i_tem_ne_d_e_d_gt_num_ap_end_cnt_ret_cp_rp_workdone_nonl_en_fio_do_fio_type_f_fmt_bg_s_wsle_t_putc_l_write_e_wsle_lwrt_I_lwrt_L_lwrt_A_lwrt_F_lwrt_C_lioproc_ltab_l_comma_l_first_t_getc_e_rsle_lquit_lcount_ltype_lchar_lx_ly_l_read_l_R_l_C_l_L_l_CHAR_rd_int_s_rsle_c_le_do_lio_f_open_isdev_fk_open_f_clos_f_exit_flush__g_char_b_char_inode_mvgbt_f_end_t_runc_mv_cur_w_ed_wrt_I_wrt_IM_wrt_L_wrt_A_wrt_AW_wrt_E_wrt_G_wrt_F_w_ned_wrt_AP_wrt_H_units_init_elist_reading_cplus_cblank_fmtbuf_external_doed_doned_doend_donewrec_dorevert_sequential_formatted_getn_putn_cf_curunit_recpos_cursor_scale_F_err_fatal_f_init_canseek_nowreading_nowwriting_icvt_dfe_rdfe_wdfe_s_rdfe_c_dfe_y_getc_y_tab_y_rnew_s_wdfe_y_putc_y_wnew_e_rdfe_e_wdfe_y_rend_y_wend_due_s_rdue_c_due_s_wdue_e_rdue_e_wdue_z_getc_z_putc_z_wnew_z_ungetc_s_rsfi_z_rnew_z_tab_c_si_s_wsfi_s_rdfi_c_di_s_wdfi_c_fi_e_rsfi_e_wsfi_e_rdfi_e_wdfi_c_li_s_rsli_s_wsli_e_rsli_e_wsli_iiorec__iiopos__recloc_rsue_sue_s_rsue_c_sue_s_wsue_e_wsue_e_rsue_s_rsfe_c_sfe_x_getc_x_rnew_x_tab_e_rsfe_new_s_wsfe_pr_put_x_putc_x_wend_x_wnew_e_wsfe_lrd_lchar_lx_ly_ltype_ltab_s_rsle_l_read_t_getc_e_rsle_t_sep_l_R_l_C_l_L_l_CHAR_lr_comm_get_repet_rd_int_s_wsle_t_putc_l_write_e_wsle_lwrt_I_lwrt_F_lwrt_D_lwrt_C_lwrt_DC_lwrt_L_lwrt_A_chk_len_lwrt_0_cnt_ret_cp_rp_dfio_en_fio_do_fio_type_f_fmt_bg_eor_uio_do_us_due_err_do_uio_do_ud_c_le_do_lio_rd_ed_rd_mvcur_rd_I_rd_L_rd_AW_rd_F_rd_ned_rd_POS_rd_H_w_ed_wr_mvcur_wrt_IM_wrt_L_wrt_AW_wrt_E_wrt_G_wrt_F_w_ned_wrt_AP_wrt_H_syl_parenlvl_pc_revloc_pars_f_f_s_op_gen_f_list_i_tem_ne_d_e_d_gt_num_ap_end__digit_icvt_bksp_f_back_f_rew_f_open_isdev_fk_open_f_clos_f_exit_flush__endf_f_end_t_runc_f_inqu_allocs_allocp_alloct_allocx_malloc_free_calloc_realloc_tmplate_fortfile_units_reading_external_sequential_formatted_fmtbuf_icptr_icend_fmtptr_doed_doned_doend_donewrec_dorevert_dotab_lioproc_getn_putn_ungetn_svic_cf_curunit_lunit_lfname_recpos_recnum_reclen_cursor_scale_radix_signit_tab_cplus_cblank_elist_errflag_endflag_lquit_l_first_leof_lcount_line_len_fatal_prnt_fmt_prnt_ext_prnt_int_ffputc_f_init_ini_std_canseek_finode_nowreading_nowwriting_g_char_b_char_inode_last_char_f_errlist_f_nerr_sccs_id_init66__no_66__box_wclear_initscr_endwin_mvprintw_mvwprintw_mvscanw_mvwscanw_mvwin_newwin_subwin_overlay_overwrite_printw__sprintw_wprintw_scanw__sscans_wscanw__win_wrefresh_touchwin_werase_wclrtobot_wclrtoeol__win_mvcur_fgoto_plod__putchar_plodput_putpad_ospeed_gettmode_setterm_zap_getcap_longname_delwin_winsertln_wdeleteln_scroll_wgetstr_wgetch_waddstr_waddch_wmove__echoit__rawmode_My_term__endwin_ttytype_Def_term__tty_ch_LINES_COLS__res_flg_stdscr_curscr__tty_AM_BS_CA_DA_DB_EO_GT_HZ_IN_MI_MS_NC_OS_UL_XN_NONL_UPPERCASE_normtty__pfast_AL_BC_BT_CD_CE_CL_CM_DC_DL_DM_DO_ED_EI_HO_IC_IM_IP_LL_MA_ND_SE_SF_SO_SR_TA_TE_TI_UC_UE_UP_US_VB_VE_VS_PC__unctrl_wstandout_wstandend_tstp_winsch_wdelchbox.o 363529069 0 27 100664 219 ` x$Ь[2X2PPYЫP`WIVZ JfJfJgZZXXZZJPH`JQH`aYZ镫  HfHfffHgHgg[q   _boxL90_touchwin clear.o 363529074 0 27 100664 262 ` <H0Ь[[[P    % /   *2_wclearL92_curscr_stdscr_wrefresh_weraseinitscr.o 363529080 0 27 100664 968 ` 8P+P[[[xr jcYSLPEP:P/ '  PTERM   ! '. 9 D K Q Y ` f n u {                  "+5=GPZ^eiow_initscrL93_My_term_isatty__tty_ch_gettmode_getenv_Def_term_setterm__putchar_TI_tputs_VS_tstp_signal_curscr_delwin_COLS_LINES_newwin_stdscrendwin.o 363529086 0 27 100664 561 ` 4P !P z     " * 1 7 ? F L T ` h o u   )/9=DHPT]_endwinL92__res_flg__tty__tty_ch_stty__putchar_VE_tputs_TE_curscr_SE__endwin mvprintw.o 363529092 0 27 100664 334 ` pT0 Ь[ЬZZ[P\~ݬ PЬ[ЬZЬ YYZ[P\~ݬ[P  ) 0 Q f  !+:6:_mvprintwL92_stdscr_wmove__sprintw_mvwprintwL99mvscanw.o 363529098 0 27 100664 331 ` pT0 Ь[ЬZZ[P\~ݬ PЬ[ЬZЬ YYZ[P\~ݬ[P  ) 0 Q f    ):37_mvscanwL92_stdscr_wmove__sscanw_mvwscanwL99 mvwin.o 363529105 0 27 100664 226 ` H<Ь[ЬZЬ Y2PZPP2PYPPPZY [P ( >  &_mvwinL92_LINES_COLS_touchwinnewwin.o 363529118 0 27 100664 1123 ` ^Ь XЬWЬVЬVXVխ WWXݭVFP[HYrԭЭP@֭ѭYݫݫݫ|[sPݭdPIIZ IPZPYYV[P ^Ь[ЬXЬWЬVЬ XP2QPQ'WP2 QPQVXP2QPQWP2QPQPV2P2QQPXPVխ2P2 QQPWPWXݭV:PY2PXP2 PWPZЭP@J֭ZZV YPЬ YЬXЬWЬV _PZ1hWLP Z=1KW/PZ ݪW PZݪݪjWVPPPWVYX [KKK[[WVXPP* XWyY WYPPd ZP * <Y l(( v    H          " + r    &-5=BGO_newwinL93_LINES_COLS_makenew_cfree_calloc_subwinL111L122_malloc overlay.o 363529127 0 27 100664 405 ` < ^Ь[ЬZ2P2PP챫2P2PP豫 2 P2 PP䱫2P2PPЭP2QQPЭP2 QQPЭP2QQPЭP2 QQPPЭVTFX2 PPWFYY1iP@>#W2PVP~Z)P i~ZWXYVV    !)_overlayL91__ctype__wmove_waddch overwrite.o 363529134 0 27 100664 262 ` 0^Ь[ЬZ2P2PPV2P2PPW2P2QQPPX3X~ZPYHPI`~ZYYWXXVT n "_overwriteL90_wmove_waddchprintw.o 363529140 0 27 100664 407 ` x0\~ݬ \~ݬݬ^B2߭ݬ ݬ׭ ЭP֭` ߭ݬ  'P l z  ,"+/4=FO_printwL92_stdscr__sprintw_wprintwL98L102__doprnt__flsbuf_waddstr scanw.o 363529147 0 27 100664 391 ` tx0\~ݬ \~ݬݬ^AޭЭ߭ݬPP߭Pݬ ݬ߭  'J [ o  , (,1:BK_scanwL92_stdscr__sscans_wscanwL98L102_wgetstr_strlen__doscan refresh.o 363529440 0 27 100664 3621 ` T h ^Ь[0P[[PPPP}P dPkXPIC2=P6QP2PPwPo [C)P `  ,2P@2P~[PP2P@͕h]WP -#~pkm\kS2P2 QQP~2kP2QQP~2C~28~2kP2QQPP2P2 QQPQPZZP ^Ь[2P@2PP2QQPP2P@ Y,2P2QQPxPPAQP`P2QQP2 QQPY2P@P2QQPZ6o.2P2QQQ@X 2PX@Xh 2P@XW9 X1X12P2 QQP~2~2~2~2P2 QQPP1<1:X12PPWj 2PVQxPPPFQQ`Xh  XPXPY2P%QxPPP`XP2 QQPV PWVPPtVP2QPQhP !P 2P2 QQPP2PPV1 XyljPʏPgQ2 QʏQPQKjPP#IA:4P #!&P 1 2PP2QQP12 Pʏ}PP)!P 9!jiiPjPQPa*jii~skj~O[F  3,2P2kQQPPw2 P2QQPPiP U1oP;"jPjPQPa+j~j~EjPP>P`v]WOHZji12P2 QQP2QQPG2P2 QQPPu,ji1G"ZWYji屭 1P 1    " ( 0 7 = C HN Wat         ' . 9 B HP W u   ( 9 J X^ e   '/ NU] ew      % - 4 : F N U g          / 7 ? F L X` w ~         0 7 B S [ g m |         * 2 : A G \` dT$ (-6@DKOW[cmqwn_ly_lx_curwin__win_wrefreshL96L124__endwin__putchar_VS_tputs_TI_curscr_CL_werase_touchwin_CA__iob__flsbuf_makech_mvcur_fflush_CE_COLS_strlen_SE_SO_MS_scroll_UC touchwin.o 363529445 0 27 100664 114 ` (Ь[2Y2PPPXZ JXJZZY_touchwinL92erase.o 363529452 0 27 100664 232 ` ^Ь[Z{JWWP2QQPXWYi YVѭWY iYYXѭ52JPP JJJVP2JQQP JVPPJZZP2QPQ1vkk _weraseL92clrtobot.o 363529460 0 27 100664 243 ` ^Ь[2V2kZJP2QQPXVJYi YWѭJY iYYXѭ52JPP JJJWP2JQQP JWPPJVZZP2QPQ1rkk_wclrtobotL92 clrtoeol.o 363529469 0 27 100664 223 ` ^Ь[2kX2WHP2QQPYWHPPVVZj ZVѭHZ jZZYѭ52HPP HHHVP2HQQP HVPPH_wclrtoeolL92 cr_put.o 363529494 0 27 100664 4933 ` HЬFЬ BЬ.Ь*PP1PPPPQQQPPP1PpPZZPZPQRQQPC^fIEP> `/ )P ` ZZ!PP#PPPPPP1ZwPPfY`XsY9JFP? `0 ZOPZPH; #& P[[PjP ][glhPa``PN~3^{r\XYW1O"BP:QxQQQ.QQP[![ G PQQPZZPxPPPPPZDZ6PP[!e]ZZ[[ZYYYYZ[PPZ(VPGKCP;PYY[PPPZ'"PxPPPPQQP[[Zog aR L[PZP|6'.&  I?=@tPYb 1|TyLA&@9ЕXjWgmP 1JMPP21 [ PPxP[[PP1[|l{Qkd 7[.(B;{-dgWZ11P D1P(Q2PPQxQPQP`PR2 QQRB`PʏPQ2 QʏQPQ.P`;|~a(Y/IB y11vj/P``P~Ь[c[%/ 6? DLRY a jq x       #* 1; CKR W^ eqy ~             %*06< C L W `msx~        +27@HS `lx}      )1 8 >E JP Yemz!  "   (("  # # ' 2;AL! T ^f m u}    $ $ % 07>LTYi q y $ $       2 @^% u }    & &       ( /* 5@ H LPT(X17>C*JOUY_hpw{\  _outcol_outline_destcol_destline_plodcnt__win_mvcurL100_fgotoL105_COLS_AM__iob__flsbuf__pfast_LINES_CA_UP_CM_tgoto_strlen_plod__putchar_tputsL131L136_plodflg_HO_GT_BS_BC_plodput_LL_NONL_NC_BT_TA_curscr_NDL202_putpadL209_fflush cr_tty.o 363529506 0 27 100664 3400 ` 0`pP2P 2PPPz uPPPa^PPPK ^Ь[k[Z[%PZo _P 00$P P 2Pf_`OSMD P`PPP'h[PZPPRZ}[ZЋQPaZjGZYZЉQPaZj~ݬjxxxx|dumb:licoambseohzinmimsncosulxnalbcbtcdceclcmdcdldmdoedeihoicimipllmandpcsesfsosrtatetiucueupusvbvsve7 8 9 7 "8 )9 /7 4: :7 @8 G; Q: V7 \7 ag7 l: s7 < 7 = 7 > A B C D C C C #C -C 3E ;BD IE OE ZE bE rE x} G H  H I J K B !M 4;BKN ^$ f, n, s$ y* ~" N         $ ( , 0 4 8 < @ D H L P T X \ ` d h l p t x! |" # $ % & ' ( ) * + , - . /   $(,048=DHLPTX\`dhlptx|LPTP (.9=CL QZbirx }_sflags_AM_BS_EO_HZ_IN_MI_MS_NC_OS_UL_XN_xPC_sstrs_AL_BC_BT_CD_CE_CL_CM_DC_DL_DM_DO_ED_EI_HO_IC_IM_IP_LL_MA_ND_SE_SF_SO_SR_TA_TE_TI_UC_UE_UP_US_VB_VS_VE_tspace_aoftspace_destcol_destline_ospeed_gettmodeL100__tty__tty_ch_gtty__res_flg_stty_UPPERCASE_GT_NONL_settermL109_tgetent_strcpy_LINES_tgetnum_COLS_zap_tgoto_CA_PC_longname_ttytypeL134_tgetflag_tgetstr_getcapL149longname.o 363529511 0 27 100664 262 ` p0(^Ь[ЬZ k: k|[kk|9[[Y i: i|Yiii[$iPZ HO Ycj p_longnameL16L12_strcpydelwin.o 363529519 0 27 100664 183 ` D$ Ь[ #ZJJZZP2QPQݫ[ 3 <   _delwinL92_cfree insertln.o 363529529 0 27 100664 398 ` H(Ь[2PP@Z2kP@2PP2kQPA2PPYYP@II2PPPIYYP2kQPQZP2QQPX ZXZP2QQP2kQPA{P2kQQP4kP@P^QA` [I[@kPP      *2_winsertlnL92_LINES_COLS_wrefresh_scrolldeleteln.o 363529538 0 27 100664 179 ` hЬ[2kP@Z2kYYP@II2PPPIYYP2QPQZP2QQPX ZXZP2QQP2QQPA_wdeletelnL92 scroll.o 363529547 0 27 100664 395 ` T@Ь[PЫP`XY YP@IY2PPYPXZ XZP2QPQ2PPX@k[4P ` {u[gPV ^ f m x     '-7_scrollL92_curscr__iob__flsbuf_NONL_touchwin getstr.o 363529555 0 27 100664 149 ` 0$ Ь[ЬZj Z[PjjjPjP   _wgetstrL92_wgetch getch.o 363529565 0 27 100664 798 ` $^Ь[  kP:2 PPP`P xqPgF2 P2QQP~2P2kQQP~HAP~3,~[6   PPPP( 0 9 @ F N T Z a j r y           #)1:@FOW^f_wgetchL92__echoit__rawmode__tty__pfast__tty_ch_stty__iob__filbuf_curscr_wmove_waddchaddstr.o 363529574 0 27 100664 141 ` ($ Ь[ЬZj~[PPP   _waddstrL92_waddch addch.o 363529585 0 27 100664 499 ` 0H(Ь[2Z2kYYP2QPQZP2QPQYZPPP@  PPPIPJ`fI7ZIIIOZPPPZPX [nPZZXPZP2IQPQZIZP2IQPQZIIPJ`ZZP2QPQ,ZYYP2QPQ16[[YZYk[ZZ     "-3_waddchL92_wrefresh_scroll_wclrtoeol_NONL move.o 363529593 0 27 100664 123 ` 4Ь[ЬZЬ YYP2QPQ ZP2QPQPYZkP _wmoveL92 curses.o 363529601 0 27 100664 1232 ` ($ unknown   ) 2<ELR\dlrvz~  $(,048<@DHLPTX\__echoit__rawmode_My_term__endwin_ttytype_Def_term__tty_ch_LINES_COLS__res_flg_stdscr_curscr__tty_AM_BS_CA_DA_DB_EO_GT_HZ_IN_MI_MS_NC_OS_UL_XN_NONL_UPPERCASE_normtty__pfast_AL_BC_BT_CD_CE_CL_CM_DC_DL_DM_DO_ED_EI_HO_IC_IM_IP_LL_MA_ND_SE_SF_SO_SR_TA_TE_TI_UC_UE_UP_US_VB_VE_VS_PCunctrl.o 363529610 0 27 100664 1885 ` $   !$'*-0369<?((BEHKNQTWZ]`bdfhjlnprtvxz|~  ^@^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^[^\^]^~^_ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~^?  $(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx| __unctrl standout.o 363529619 0 27 100664 354 ` pTPЬ[ P  PPЬ[ P  PP   ( 1 @ H X ` i 8&*._wstandoutL92_SO_UC_wstandendL98_SEtstp.o 363529627 0 27 100664 581 ` ^(~~ޭP(`}   % , 2 9 D JS _ e k r x   !(06>DLU[cm_tstpL93__tty_LINES_COLS_mvcur_endwin__iob_fflush_kill_signal__tty_ch_stty_curscr_wrefresh insch.o 363529637 0 27 100664 371 ` H(Ь[2kP@P2QQPX2kP2QQQ@ZZYijYZZXj2PP2kQPA2kP@ 2kP@ 2kP@P2kQQP4P@PsQA` [^[UkPPl |     '/_winschL92_LINES_COLS_wrefresh_scroll delch.o 363529645 0 27 100664 180 ` lЬ[2kP2QQQ@X2kP@P2QQPPYYZZX j2PP2kQPA2kP@ 2kP@ 2kP@P _wdelchL92PA2kP@ 2kP@ 2kP@P2kQQP4P@PsQA` [lib/Mail.rc 644 0 33 24 2424007432 5742 set append dot save Pl |     '/_winschL92_LINES_COLS_wrefresh_scroll delch.o 363529645 0 27 100664 180 ` lЬ[2kP2QQQ@X2kP@P2QQPPYYZZX j2PP2kQPA2kP@ 2kP@ 2kP@P _wdelchL9/pT,pT5Ċ /,"lib/crontab 644 0 33 1060 2424007432 6146 30 4 * * * /etc/sa -s > /dev/null 0 4 * * * calendar - 15 4 * * * find /usr/preserve -mtime +7 -a -exec rm -f {} \; 20 4 * * * find /usr/msgs -mtime +21 -a ! -perm 444 -a ! -name bounds -a -exec rm -f {} \; 30 4 * * * /usr/lib/uucp/cleanlog 40 4 * * * find / -name '#*' -atime +3 -exec rm -f {} \; 0,15,30,45 * * * * /usr/lib/atrun 0,10,20,30,40,50 * * * * /etc/dmesg - >>/usr/adm/messages 1,11,21,31,41,51 * * * * (echo -n ' '; date; echo ) >/dev/console 0 0 * * * su daemon < /usr/local/lib/uucp.daily 0 5,12,18 * * * su daemon < /usr/local/lib/uucp.6hours ndar - 15 4 * * * find /usr/preserve -mtime +7 -a -exec rm -f {} \; 20 4 * * * find /usr/msgs -mtime +21 -a ! -perm 444 -a ! -name bounds -a -exec rm -f {} \; 30 4 * * * /usr/lib/uucp/cleanlog 40 4 * * * find / -name '#*' -atime +3 -exec rm -f {} \; 0,15,30,45 * * * * /usr/lib/atrun 0,10,20,30,40,50 * * * * /etc/dmesg - >>/usr/adm/messages 1,11,21,31,41,51 * * * * (echo -n ' '; date; echo ) >/dev/console 0 0 * * * su daemon < /usr/local/lib/uucp.daily 0 5,12,lib/whatis 644 0 33 47003 2512736236 6055 a.out (5) - assembler and link editor output aardvark (6) - yet another exploration game abort (3) - generate a fault abs (3) - integer absolute value ac (8) - login accounting access (2) - determine accessibility of file acct (2) - turn accounting on or off acct (5) - execution accounting file adb (1) - debugger adduser (8) - procedure for adding new users adventure (6) - an exploration game alarm (2) - schedule signal after specified time aliases (5) - aliases file for delivermail aliens (6) - The alien invaders attack the earth analyze (8) - Virtual UNIX postmortem crash analyzer apl (1) - an apl interpreter apropos (1) - locate commands by keyword lookup ar (1) - archive and library maintainer ar (5) - archive (library) file format arcv (8) - convert archives to new format arff, flcopy (8) - archiver and copier for floppy arithmetic (6) - provide drill in number facts as (1) - assembler ascii (7) - map of ASCII character set assert (3X) - program verification at (1) - execute commands at a later time atof, atoi, atol (3) - convert ASCII to numbers awk (1) - pattern scanning and processing language backgammon (6) - the game banner (6) - print large banner on printer basename (1) - strip filename affixes bc (1) - arbitrary-precision arithmetic language bcd (6) - convert to antique media biff (1) - be notified if mail arrives and who it is from bk (4) - line discipline for machine-machine communication boggle (6) - play the game of boggle brk, sbrk, break (2) - change core allocation cal (1) - print calendar calendar (1) - reminder service call (1C) - ring a telephone cat (1) - catenate and print catman (8) - create the cat files for the manual cb (1) - C program beautifier cc (1) - C compiler cd (1) - change working directory chase (6) - Try to escape to killer robots chdir (2) - change current working directory checknr (1) - check nroff/troff files chess (6) - the game of chess chfn (1) - change full name of user ching, fortune (6) - the book of changes and other cookies chmod (1) - change mode chmod (2) - change mode of file chown (2) - change owner and group of a file chown, chgrp (8) - change owner or group chsh (1) - change default login shell cifplot (1) - CIF interpreter and plotter clear (1) - clear terminal screen close (2) - close a file clri (8) - clear i-node cmp (1) - compare two files col (1) - filter reverse line feeds colcrt (1) - filter nroff output for CRT previewing colrm (1) - remove columns from a file comm (1) - select or reject lines common to two sorted files compact, uncompact, ccat (1) - compress and uncompress files, and cat them config (8) - Build system configuration files cons (4) - console interface core (5) - format of memory image file cp (1) - copy crash (8) - what happens when the system crashes creat (2) - create a new file cribbage (6) - the card game cribbage cron (8) - clock daemon crypt (1) - encode/decode crypt, setkey, encrypt (3) - DES encryption csh (1) - a shell (command interpreter) with C-like syntax ct (4) - phototypesetter interface ctags (1) - create a tags file ctime, localtime, gmtime, asctime, timezone (3) - convert date and time to ASCII cu (1C) - call UNIX curses (3) - screen functions with ``optimal'' cursor motion date (1) - print and set the date dbminit, fetch, store, delete, firstkey, nextkey (3X) - data base subroutines dc (1) - desk calculator dcheck (8) - file system directory consistency check dd (1) - convert and copy a file delivermail (8) - delive((r mail to arbitrary people deroff (1) - remove nroff, troff, tbl and eqn constructs df (1) - disk free dh/dm (4) - DH-11/DM-11 communications multiplexer diction,explain (1) - print wordy sentences; thesaurus for diction diction,explain (1) - print wordy sentences; thesaurus for diction diff (1) - differential file and directory comparator diff3 (1) - 3-way differential file comparison dir (5) - format of directories dmesg (8) - collect system diagnostic messages to form error log drum (4) - paging device du (1) - summarize disk usage dump (8) - incremental file system dump dump, ddate (5) - incremental dump format dumpdir (8) - print the names of files on a dump tape dup, dup2 (2) - duplicate an open file descriptor dz (4) - DZ-11 communications multiplexer echo (1) - echo arguments ecvt, fcvt, gcvt (3) - output conversion ed (1) - text editor efl (1) - Extended Fortran Language end, etext, edata (3) - last locations in program environ (5) - user environment eqn, neqn, checkeq (1) - typeset mathematics eqnchar (7) - special character definitions for eqn error (1) - analyze and disperse compiler error messages ex, edit (1) - text editor execl, execv, execle, execve, execlp, execvp, exec, exece, environ (2) - execute a file exit (2) - terminate process exp, log, log10, pow, sqrt (3M) - exponential, logarithm, power, square root expand, unexpand (1) - expand tabs to spaces, and vice versa expr (1) - evaluate arguments as an expression eyacc (1) - modified yacc allowing much improved error recovery f77 (1) - Fortran 77 compiler fabs, floor, ceil (3M) - absolute value, floor, ceiling functions fclose, fflush (3S) - close or flush a stream feof, ferror, clearerr, fileno (3S) - stream status inquiries file (1) - determine file type filsys, flblk, ino (5) - format of file system volume find (1) - find files finger (1) - user information lookup program fish (6) - play ``Go Fish'' fl (4) - floppy interface fmt (1) - simple text formatter fold (1) - fold long lines for finite width output device fopen, freopen, fdopen (3S) - open a stream fork (2) - spawn new process format (8) - how to format disks fortune (6) - print a random, hopefully interesting, adage fread, fwrite (3S) - buffered binary input/output frexp, ldexp, modf (3) - split into mantissa and exponent from (1) - who is my mail from? fsck (8) - file system consistency check and interactive repair fseek, ftell, rewind (3S) - reposition a stream fstab (5) - static information about the filesystems gamma (3M) - log gamma function getarg, iargc (3F) - command arguments to Fortran getc, getchar, fgetc, getw (3S) - get character or word from stream getenv (3) - value for environment name getfsent, getfsspec, getfsfile, setfsent, endfsent (3) - get file system descriptor file entry getgrent, getgrgid, getgrnam, setgrent, endgrent (3) - get group file entry getlogin (3) - get login name getpass (3) - read a password getpid (2) - get process identification getpw (3) - get name from uid getpwent, getpwuid, getpwnam, setpwent, endpwent (3) - get password file entry gets (1) - get a string from standard input gets, fgets (3S) - get a string from a stream getty (8) - set terminal mode getuid, getgid, geteuid, getegid (2) - get user and group identity graph (1G) - draw a graph greek (7) - graphics for extended TTY-37 type-box grep, egrep, fgrep (1) - search a file for a pattern group (5) - group file halt (8) - stop the processor hangman (6) - Computer version of the game hangman head (1) - give first few lines hier (7) - file system hierarchy hk (4) - RK6-11/RK07 moving head disk hp (4) - RP06, RM03, RM05, RM80 moving-head disk ht (4) - TM-03/TE-16,TU-45,TU-77 MASSBUS magtape interface hypot, cabs (3M) - Euclidean distance icheck (8) - file system storage consistency check init (8) - process control initialization intro (1) - introduction to commands intro (3) - introduction to library functions intro (4) - introduction to special files intro, errno (2) - introduction to system calls and error numbers ioctl, stty, gtty (2) - control device iostat (1) - report I/O statistics isalpha, isupper, islower, isdigit, isalnum, isspace, ispunct, isprint, iscntrl, isascii (3) - character classification j0, j1, jn, y0, y1, yn (3M) - bessel functions jobs (3J) - summary of job control facilities join (1) - relational database operator kill (1) - terminate a process with extreme prejudice kill (2) - send signal to a process killpg (2J) - send signal to a process or a process group l3tol, ltol3 (3) - convert between 3-byte integers and long integers last (1) - indicate last logins of users and teletypes lastcomm (1) - show last commands executed in reverse order ld (1) - link editor learn (1) - computer aided instruction about UNIX leave (1) - remind you when you have to leave lex (1) - generator of lexical analysis programs link (2) - link to a file lint (1) - a C program verifier lisp (1) - lisp interpreter liszt (1) - compile a Franz Lisp program ln (1) - make links lock (1) - reserve a terminal login (1) - sign on look (1) - find lines in a sorted list lorder (1) - find ordering relation for an object library lp (4) - line printer lpr, lprm, lpq, print (1) - line printer spooler ls (1) - list contents of directory lseek, tell (2) - move read/write pointer lxref (1) - lisp cross reference program m4 (1) - macro processor mail (1) - send and receive mail mail (1) - send or receive mail among users mail (4) - pseudo-device for mail notification make (1) - maintain program groups makekey (8) - generate encryption key malloc, free, realloc, calloc (3) - main memory allocator man (1) - find manual information by keywords; print out the manual man (7) - macros to typeset manual me (7) - macros for formatting papers mem, kmem (4) - main memory mesg (1) - permit or deny messages mille (6) - play Mille Bournes mkdir (1) - make a directory mkfs (8) - construct a file system mklost+found (8) - make a lost+found directory for fsck mknod (2) - make a directory or a special file mknod (8) - build special file mkstr (1) - create an error message file by massaging C source mktemp (3) - make a unique file name monitor (3) - prepare execution profile monop (6) - Monopoly game more, page (1) - file perusal filter for crt viewing mount, umount (2) - mount or remove file system mount, umount (8) - mount and dismount file system mpx (2) - create and manipulate multiplexed files mpxio (5) - multiplexed i/o ms (7) - macros for formatting manuscripts msgs (1) - system messages and junk mail program mt (1) - Magnetic tape manipulating program mt (4) - UNIX magtape interface mtab (5) - mounted file system table mv (1) - move or rename files ncheck (8) - generate names from i-numbers net (1) - execute a command on a remote machine netcp (1) - remote copy of files through the net netlog (1) - print the last few lines of the network log file netlogin (1) - provide login name and password for a remote machine netlpr (1) - use a remote lineprinter through the net netmail (1) - read mail on a remote machine over the network netq (1) - print contents of network queue netrm (1) - remove a command from the network queue nettroff (1) - troff to the phototypesetter over the network newaliases (1) - rebuild the data base for the mail aliases file newcsh (1) - description of new csh features (over oldcsh) newgrp (1) - log in to a new group newtty (4) - summary of the ``new'' tty driver nice (2) - set program priority nice, nohup (1) - run a command at low priority (\fIsh\fR only) nlist (3) - get entries from name list nm (1) - print name list null (4) - data sink num (1) - number lines number (6) - convert Arabic numerals to English od (1) - octal dump old (8) - directory of old programs open (2) - open for reading or writing passwd (1) - change login password passwd (5) - password file pause (2) - stop until signal pc (1) - Pascal compiler perror, sys_errlist, sys_nerr (3) - system error messages pi (1) - Pascal interpreter code translator pipe (2) - create an interprocess channel pix (1) - Pascal interpreter and executor plot (1G) - graphics filters plot (5) - graphics interface plot: openpl et al. (3X) - graphics interface popen, pclose (3S) - initiate I/O to/from a process pr (1) - print file print (1) - pr to the line printer printenv (1) - print out the environment printf, fprintf, sprintf (3S) - formatted output conversion prmail (1) - print out mail in the post office prof (1) - display profile data profil (2) - execution time profile ps (1) - process status pstat (8) - print system facts pti (1) - phototypesetter interpreter ptrace (2) - process trace ptx (1) - permuted index putc, putchar, fputc, putw (3S) - put character or word on a stream puts, fputs (3S) - put a string on a stream pwd (1) - working directory name px (1) - Pascal interpreter pxp (1) - Pascal execution profiler pxref (1) - Pascal cross-reference program qsort (3) - quicker sort quiz (6) - test your knowledge quot (8) - summarize file system ownership rand, srand (3) - random number generator ranlib (1) - convert archives to random libraries ratfor (1) - rational Fortran dialect rc (8) - command script for auto-reboot and daemons re_comp, re_exec (3) - regular expression handler read (2) - read from file reboot (2V) - reboot system or halt processor reboot (8) - UNIX bootstrapping procedures refer, lookbib (1) - find and insert literature references in documents renice (8) - alter priority of running process by changing nice reset (1) - reset the teletype bits to a sensible state restor (8) - incremental file system restore rev (1) - reverse lines of a file rewind (1) - rewind tape drive rm, rmdir (1) - remove (unlink) files rogue (6) - Exploring The Dungeons of Doom rv (4) - Racal/Vadic ACU interface sa, accton (8) - system accounting savecore (8) - Save a core dump of the operating system scanf, fscanf, sscanf (3S) - formatted input conversion script (1) - make typescript of terminal session sdb (1) - symbolic debugger sed (1) - stream(( editor see (1) - see what a file has in it setbuf (3S) - assign buffering to a stream setjmp, longjmp (3) - non-local goto setpgrp, getpgrp (2J) - set/get process group setuid, setgid (2) - set user and group ID sh, for, case, if, while, \fB:\fP, \fB.\fP, break, continue, cd, eval, exec, exit, export, login, newgrp, read, readonly, set, shift, times, trap, umask, wait (1) - command language shutdown (8) - close down the system at a given time signal (2) - catch or ignore signals sigset, signal, sighold, sigignore, sigrelse, sigpause (3) - manage signals sigsys (2J) - catch or ignore signals sin, cos, tan, asin, acos, atan, atan2 (3M) - trigonometric functions sinh, cosh, tanh (3M) - hyperbolic functions size (1) - size of an object file sleep (1) - suspend execution for an interval sleep (3) - suspend execution for interval snake, snscore (6) - display chase game soelim (1) - eliminate \&.so's from nroff input sort (1) - sort or merge files spell, spellin, spellout (1) - find spelling errors spline (1G) - interpolate smooth curve split (1) - split a file into pieces stab (5) - symbol table types stat, fstat (2) - get file status stdio (3S) - standard buffered input/output package sticky (8) - executable files with persistent text stime (2) - set time strcat, strncat, strcmp, strncmp, strcpy, strncpy, strlen, index, rindex (3) - string operations strings (1) - find the printable strings in a object, or other binary, file strip (1) - remove symbols and relocation bits struct (1) - structure Fortran programs stty (1) - set terminal options style (1) - analyze surface characteristics of a document su (1) - substitute user id temporarily sum (1) - sum and count blocks in a file swab (3) - swap bytes swapon (8) - specify additional device for paging and swapping symorder (1) - rearrange name list sync (2) - update super-block sync (8) - update the super block syscall (2) - indirect system call system (3) - issue a shell command tabs (1) - set terminal tabs tail (1) - deliver the last part of a file tar (1) - tape archiver tbl (1) - format tables for nroff or troff tc (1) - photypesetter simulator tee (1) - pipe fitting termcap (5) - terminal capability data base terminals (7) - conventional names test (1) - condition command tgetent, tgetnum, tgetflag, tgetstr, tgoto, tputs (3) - terminal independent operation routines time (1) - time a command time, ftime (2) - get date and time times (2) - get process times tk (1) - paginator for the Tektronix 4014 tm (4) - TM-11/TE-10 magtape interface touch (1) - update date last modified of a file tp (1) - manipulate tape archive tp (5) - DEC/mag tape formats tr (1) - translate characters trek (6) - trekkie game trman (1) - translate version 6 manual macros to version 7 macros troff, nroff (1) - text formatting and typesetting true, false (1) - provide truth values ts (4) - TS-11 magtape interface tset (1) - set terminal modes tsort (1) - topological sort tty (1) - get terminal name tty (4) - general terminal interface ttyname, isatty, ttyslot (3) - find name of a terminal ttys (5) - terminal initialization data ttytype (5) - data base of terminal types by port types (5) - primitive system data types ul (1) - do underlining umask (2) - set file creation mode mask ungetc (3S) - push character back into input stream uniq (1) - report repeated lines in a file units (1) - conversion program unlink (2) - remove directory entry up (4) - unibus storage module controller/drives update (8) - periodically update the super block uptime (1) - show how long system has been up users (1) - compact list of users who are on the system utime (2) - set file times utmp, wtmp (5) - login records uuclean (1C) - uucp spool directory clean-up uucp, uulog (1C) - unix to unix copy uudiff (1C) - directory comparison between machines uuencode (5) - format of an encoded uuencode file uuencode,uudecode (1C) - encode/decode a binary file for tranmission via mail uusend (1C) - send a file to a remote host uux (1C) - unix to unix command execution va (4) - Benson-Varian interface vadvise (2V) - give advice to paging system valloc (3) - aligned memory allocator varargs (3) - variable argument list vfont (5) - font formats for the Benson-Varian or Versatec vfontinfo (1) - inspect and print out information about unix fonts vfork (2V) - spawn new process in a virtual memory efficient way vgrind (1) - grind nice listings of programs vhangup (2V) - virtually ``hangup'' the current control terminal vi (1) - screen oriented (visual) display editor based on ex vipw (8) - edit the password file with vi vlimit (2V) - control maximum system resource consumption vmstat (1) - report virtual memory statistics vp (4) - Versatec interface vpac (8) - print raster printer/ploter accounting information vpr, vprm, vpq, vprint (1) - raster printer/plotter spooler vread (2V) - read virtually vswapon (2V) - add a swap device for interleaved paging/swapping vtimes (2V) - get information about resource utilization vtroff (1) - troff to a raster plotter vwrite (2V) - write (virtually) to file w (1) - who is on and what they are doing wait (1) - await completion of process wait (2) - wait for process to terminate wait3 (2J) - wait for process to terminate wall (1) - write to all users wc (1) - word count what (1) - show what versions of object modules were used to construct a file whatis (1) - describe what a command is whereis (1) - locate source, binary, and or manual for program which (1) - locate a program file including aliases and paths (\fIcsh\fR only) who (1) - who is on the system whoami (1) - print effective current user id worm (6) - Play the growing worm game write (1) - write to another user write (2) - write on a file wtmp (5) - user login history wump (6) - the game of hunt-the-wumpus xsend, xget, enroll (1) - secret mail xstr (1) - extract strings from C programs to implement shared strings yacc (1) - yet another compiler-compiler yes (1) - be repetitively affirmative zork (6) - the game of dungeon aliases and paths (\fIcsh\fR only) who (1) - who is on the system whoami (1) - print effective current user id worm (6) - Play the growing worm game write (1) - write to another user write (2) - write on a file wtmp (5) - user login history wump (6) - the game of hunt-the-wumpus xsend, xget, enroll (1) - secret mail xstr (1) - extract strings from C programs to implement shared strings yacc (1) - yet another compiler-compiler yes (1) - be repetitively affirmative zork (6) - the game of dungelib/lib.b 644 0 33 4370 2420542370 5514 scale = 20 define e(x){ auto a, b, c, d, e, g, w, y t = scale scale = t + .434*x + 1 w = 0 if(x<0){ x = -x w = 1 } y = 0 while(x>2){ x = x/2 y = y + 1 } a=1 b=1 c=b d=1 e=1 for(a=1;1==1;a++){ b=b*x c=c*a+b d=d*a g = c/d if(g == e){ g = g/1 while(y--){ g = g*g } scale = t if(w==1) return(1/g) return(g/1) } e=g } } define l(x){ auto a, b, c, d, e, f, g, u, s, t if(x <=0) return(1-10^scale) t = scale f=1 scale = scale + scale(x) - length(x) + 1 s=scale while(x > 2){ s = s + (length(x)-scale(x))/2 + 1 if(s>0) scale = s x = sqrt(x) f=f*2 } while(x < .5){ s = s + (length(x)-scale(x))/2 + 1 if(s>0) scale = s x = sqrt(x) f=f*2 } scale = t + length(f) - scale(f) + 1 u = (x-1)/(x+1) scale = scale + 1.1*length(t) - 1.1*scale(t) s = u*u b = 2*f c = b d = 1 e = 1 for(a=3;1==1;a=a+2){ b=b*s c=c*a+d*b d=d*a g=c/d if(g==e){ scale = t return(u*c/d) } e=g } } define s(x){ auto a, b, c, s, t, y, p, n, i t = scale y = x/.7853 s = t + length(y) - scale(y) if(s=0) n = (x/(2*p)+1)/2 if(x<0) n = (x/(2*p)-1)/2 x = x - 4*n*p if(n%2!=0) x = -x scale = t + length(1.2*t) - scale(1.2*t) y = -x*x a = x b = 1 s = x for(i=3; 1==1; i=i+2){ a = a*y b = b*i*(i-1) c = a/b if(c==0){scale=t; return(s/1)} s = s+c } } define c(x){ auto t t = scale scale = scale+1 x = s(x+2*a(1)) scale = t return(x/1) } define a(x){ auto a, b, c, d, e, f, g, s, t if(x==0) return(0) if(x==1) if(scale<52) return(.7853981633974483096156608458198757210492923498437764/1) t = scale f=1 while(x > .5){ scale = scale + 1 x= -(1-sqrt(1.+x*x))/x f=f*2 } while(x < -.5){ scale = scale + 1 x = -(1-sqrt(1.+x*x))/x f=f*2 } s = -x*x b = f c = f d = 1 e = 1 for(a=3;1==1;a=a+2){ b=b*s c=c*a+d*b d=d*a g=c/d if(g==e){ scale = t return(x*c/d) } e=g } } define j(n,x){ auto a,b,c,d,e,g,i,s,k,t t = scale k = 1.36*x + 1.16*t - n k = length(k) - scale(k) if(k>0) scale = scale + k s= -x*x/4 if(n<0){ n= -n x= -x } a=1 c=1 for(i=1;i<=n;i++){ a=a*x c = c*2*i } b=a d=1 e=1 for(i=1;1;i++){ a=a*s b=b*i*(n+i) + a c=c*i*(n+i) g=b/c if(g==e){ scale = t return(g/1) } e=g } } +x*x))/x f=f*2 } s = -x*x b = f c = f d = 1 e = 1 for(a=3;1==1;a=a+2){ b=b*s c=c*a+d*b d=d*a g=c/d if(g==e){ scale = t return(x*c/d) } e=g } } define j(n,x){ auto a,b,c,d,e,g,i,s,k,t t = scale k = 1.36*x + 1.16*t - n k = length(klib/aliases.dir 644 0 33 0 2501557563 6640 ((lib/aliases.pag 644 0 33 2000 2501557564 6714 *jcB:(  {soie_Y-' v:fatemanfatemanjekulp@mit-mcjekcroft@sri-unixcroftv:dmudmuv:alonsoalonsotoy,arnoldroguej:kalash,r:toy,r:hickman,r:arnold,y:charlesquestv:jkfjfkv:jkfjkfv:lauralaura""rnews""feldman-testcsvax:markmarkeric,IngVAX:ericericarnoldfortunev:presottopresottocsvax:schmidtschmidty:trouble,roubletroublei:msgs,v:msgs,y:msgs,j:msgs,msgscsmsgsa:msgs,b:msgs,c:msgs,d:msgs,e:msgs,f:msgs,i:msgs,j:msgs,m:msgs,o:msgs,t:msgs,msgs,s:msgs,v:msgs,x:msgs,y:msgs,z:msgsallmsgs""msgslib/aliases 644 0 33 2337 2552546515 6163 # # 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 delivermail. # # Alias for mailer daemon MAILER-DAEMON:root # Aliases to handle mail to msgs and news msgs: "|/usr/ucb/msgs -s" bsd-bugs: root bsd-ideas: root wnj:ucbvax!wnj mct:ucbvax!toy ozalp:ucbvax!ozalp schmidt:ucbvax!schmidt sklower:ucbvax!sklower aps:decvax!aps shannon:decvax!shannon tbl:vax135!tbl jfr:vax135!jfr dmr:research!dmr ken:research!ken mark:ucbvax!mark ### The rest of the aliases are for illustration only ### allmsgs:a:msgs,b:msgs,c:msgs,d:msgs,e:msgs,f:msgs,i:msgs,j:msgs,m:msgs,o:msgs,t:msgs,msgs,s:msgs,v:msgs,x:msgs,y:msgs,z:msgs csmsgs:i:msgs,v:msgs,y:msgs,j:msgs,msgs trouble:y:trouble,\trouble schmidt:csvax:schmidt presotto:v:presotto fortune:arnold eric:eric,IngVAX:eric mark:csvax:mark feldman-test: "|/ra/csr/feldman/=mailer/qmail" rnews:"|/usr/local/uurec" laura:v:laura jkf:v:jkf jfk:v:jkf quest:j:kalash,r:toy,r:hickman,r:arnold,y:charles rogue:toy,arnold alonso:v:alonso dmu:v:dmu croft:croft@sri-unix jek:jekulp@mit-mc fateman:v:fateman sgs,e:msgs,f:msgs,i:msgs,j:msgs,m:msgs,o:msgs,t:msgs,msgs,s:msgs,v:msgs,x:msgs,y:msgs,z:msgs csmsgs:i:msgs,v:msgs,y:msgs,j:msgs,msgs trouble:y:trouble,\trouble schmidt:csvax:schmidt presotto:v:presotto fortune:arnold eric:eric,IngVAX:eric mark:csvax:mark feldman-test: "|/ra/csr/feldman/=mlib/ex3.6recover 4755 0 33 44144 2532104536 7033 (p]T^Юn PPՀPpPP' P"%PR.P >P>P> >=*..DH2>HPP.HѬ7ЬPՠ.v'ЬPݠY"PK' 3"ѬC'ЬPݠ-"ЬPݠS P[[''({{ 'P'PP(tSxmS~$P&Z12JSPx P~2:~+S xSP2PPYY<2:~!PY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device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid ((argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large@)Ь>tЬ :tŬ PP~ݬ^tYìPPPYxY~ݭ6PPYЭЬ[YZ+Yݭ[ݭ[sPPhY[[]ZYݭKZYݭ[YЭ[/ZݭisPP[Z[pYZYZZ[>ìPíQPQݬY~Э1ݭݬY1[YݭZ2YЭZ14 ^rЬ[ЬZkj׭^rЬ[ЬZЬ Ykij׭^Ь[ЬZԭլ05Ьj ЪP֪`P ZoPYY׭֭ѭ ЭP^Ь[ЬZԭլ.3ЬYj ЪP֪` Z~ Y ֭ѭ ЭPЬ[  P ݏ P ի ߘP@q [*f Sb  P2PPݫ~ PkЫk!k    k1WP֫Ь[ի ݫB Ь Ыk Ь[ZZZP@ ЬQPa#  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~mPYj~P __ BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[*1xݏ;PZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~0PY PPx[ [[[ Ь[Z = 8[ePZ~YPZ ݫ ԫ kZP{ Ь[ЬZkPkPzQQP|PlP^߭ݬxPPP<,Ь[ЬZ[Y[YPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6 PDe.\6eX.e(e+eee~*PYe[ ek$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZd [XPdYPƏPxPdbPZxdPZPPZx|d~@PZZZYdRdPZPEdxFdPZPPjj/dX#d1xYP[PdZ dddkcck[P Ь[[ZZZcjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP5c@j~\S^\_PCЬPЬPЬRRQ{RPPR PRPPP9ZP4)/usr/preserve-r-r Wrong number of arguments to exrecover [Dated: %s, newest of %d saved]] Not enough core for lines rNo files saved. On %s at saved %d lines of file "%s" File not foundr/LOST [Lost line(s): %d-%d [Lost line(s): %d-%d] Tmp file too large System error %d@(#)exrecover.c 6.1 10/18/80M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDecUnknown error: #D+p r<( ' /O 9~DBTJtR[djryfXyT$hxf y# # #,#<#L#l#|###!# ## $&78&-|&4&<&E#KQ~<Wr(` L+i c.q .{ M. . R. r. . . . ;. . c. "$/ $3 d(3 ,3 B.3 03 43 83 <3 @3 B3! D3( F3/ H38 L3A l3I t3R t7Y ex7_ f|7e }7l Z7u 7~ 7 ; ; < <  < < < < 2$< L< P< R< 6T< X< \< `< b<  d< /< <$ <- =5 T=< =E =J yX>Q z\>X `>] d>b h>g l>p $p>x t>~ 2x> |> > > > -> U> ]> > IA D <D BH H H eH H H  H H 7H$ H- BH5 H< HD )HK JHR (LZ Pa Td d\l d]w Jh]{ Cl] Tp] Ft] Gx] N|] O] ] H] P] Q] S] K] X] 8] 9] :] ;] <] =] >] ?] @] A] [] R] \] ^] V] W] Z] _] d] e] g] `] ]]  ] c^ h^ i^ q ^! t^% f^) j^- m^1 v ^5 k$^9 n(^= {,^A L0^E l2^I D4^M E6^Q w8^U U:^Y b<^] s>^a o@^e uB^i xD^m F^q H^u }J^y rL^} ~N^ zP^ R^ T^ V^ X^ Z^ \^ ^^ P`^ b^ d^ f^ )h^ Yp^ Jx^ ^ ^ ^ ^ ^ '^ 5^$ Z^, 0^4 ^< dD jM qpT p^ xf hxq x{ px qx( x &|8& #S!#pW .* h|# u##tT$ +l#1;,#8D@prGNN"V3F]`d |l ܀v ~B4#2&_ C [ r <#=  ~ H. {   *#0&7? B KR ZObkItD+~.t$TX|&X\  $L*"yx%x3L# " ##8% p e& crt0.oexrecover.o_sccsidchdir.octime.ofprintf.ogetuid.ofopen.ocreat.operror.oerrlst.odup.oqsort.ordwr.ofilbuf.osetbuf.ostrlen.olseek.otime.odoprnt.o((flsbuf.oexit.odata.ostrcmp.oclose.ofstat.oisatty.oopen.oread.ostrcat.ostrcpy.ostty.oioctl.ounlink.omalloc.osbrk.oudiv.owrite.ocerror.o_exitstart_main_environ_options_aiflag_anymarks_chng_Command_defwind_dirtcnt_dosusp_edited_endcore_endline_fendcore_file_genbuf_hush_globp_holdcm_inappend_inglobal_initev_inopen_input_intty_io_lastc_laste_lastmac_lasttag_linebp_linebuf_listf_loc1_loc2_names_notecnt_numberf_obuf_oprompt_ospeed_otchng_peekc_pkill_pfast_pid_ppid_resetlab_rpid_ruptible_seenprompt_shudclob_status_tchng_tfile_vcatch_vreslab_writing_xchng_altfile_direct_shell_ttytype_uxb_addr1_addr2_dol_dot_one_truedol_unddol_zero_undkind_unddel_undap1_undap2_undadot_xflag_xtflag_kflag_perm_tperm_key_crbuf_Outchar_Pline_Putchar_oldhup_oldquit_hitin2_ichang2_ichanged_iblock_iblock2_ninbuf_nleft_oblock_tline_ibuff_ibuff2_obuff_H_tspace_aoftspace_AL_BC_BT_CD_CE_CL_CM_xCR_DC_DL_DM_DO_ED_EI_F0_F1_F2_F3_F4_F5_F6_F7_F8_F9_HO_IC_IM_IP_KD_KE_KH_KL_KR_KS_KU_LL_ND_xNL_PC_SE_SF_SO_SR_TA_TE_TI_UP_VB_VE_VS_AM_BS_CA_DA_DB_EO_GT_HC_HZ_IN_MI_NC_NS_OS_UL_XB_XN_XT_XX_NONL_UPPERCASE_LINES_COLUMNS_OCOLUMNS_outcol_outline_destcol_destline_tty_ottyc_nttyc_olttyc_nlttyc_normf_normtty_WBOT_WECHO_costCM_costSR_costAL_arrows_immacs_abbrevs_ldisc_mapspace_msnext_maphopcnt_anyabbrs_ttynbuf_ttymesg_mydir_nb_vercnt_sbrk_strcmp_listfiles_error_strcpy_findtmp_ctime__iob_fprintf_lseek_read_perror_scrapbad_putfile_unlink_gtty_fopen_chdir_open_close_getuid_enter_fread_fclose_qucmp_qsort_bestnb_besttime_bestfd_searchdir_setbuf_strcat_yeah_dup_write_preserve_cntch_cntln_cntodd_cntnull_fstat_clrstats_getline_wrerror_syserror_getblock_blkio_errno_sys_nerr_sys_errlistcerror_localtime_asctime_ftime_gmtime_dysize__doprnt_geteuid__lastbuf_creat_strlen_dup2udiv__filbuf_fwrite__flsbuf_malloc_fflush_free_time_isatty__sobuf__cleanup__sibuf_stty_ioctl_realloc_end_brkunlink_gtty_fopen_chdir_open_close_getuid_enter_fread_fclose_qucmp_qsort_bestnb_besttime_bestfd_searchdir_setbuf_strcat_yeah_dup_write_preserve_cntch_cntln_cntodd_cntnull_fstat_clrstats_getline_wrerror_syserror_getblock_blkio_errno_sys_nerr_sys_errlistcerror_localtime_asctime_ftime_gmtime_dysize__doprnt_geteuid__lastbuf_creat_strlen_dup2udiv__filbuf_fwrite__flib/ex3.6preserve 4755 0 33 33105 2532104537 7215  0^Юn PPՀPpPP P0^ѬP #P"zP%x~P[_pJGBE;x4/߭߭PЭPЭPЭP`߭ݬmP^ݬ'PPݽC" :P[[F ЬP`7լ  CPOPP[M[)լ  PPPݬh[Z[Kݬ[9([*[ PPݬ \~ݬ ЬP PP Ь[PZѪ[:ZPP  Ь[k:[kk[PfPhP]ݏ-P[[1[P[[1[xP[[P1[\P[[jP111[/P[[1[P[[t1[ P[[e1k [kk01PЬ[ZYk94 ZPQPQ0QZY[[kPP P P+P-k0YZPZPЬ [ЬY׬&k ЫP֫`P [PZZZ Z YPЬPQPЬ[XXPX 鑫+PPPYkw+ݏݬPZY1ZZ5kalYPPPݬCPZ<#3ݏݬ}PZYZZݬPZZ)ZYPPPݬPZZ1hZY kr  XP$ [1#$#P@X[ݬPZZݬ|[P[X   , 6 P b t   % 5 D U i }   Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large^߭PPrЭPЭPP[rЭPЭPPZ'PYR[rPPPZZݬQ@Y1kYKh+ZWݬ[^ЬP[P 1PX#PWPY߭PZPK* ZZXWYЭP@)W Ь[ZZPZ jkr kaݬi +   ZP*ЬRPQbP^Ь[ЬZԭլ05Ьj ЪP֪`P ZPYY׭֭ѭ ЭP^Ь[ЬZԭլ.3ЬYj ЪP֪` Z~ Y ֭ѭ ЭPЬ[[ ~rkЫ0   Ь[  P ݏ P ի ߘP@R) [4#   P2PPݫ~ PkЫk!k    k1WP֫Ь[ի ݫ Ь Ыk Ь[ZZZPݬݬݬ;0QP^BЬ2߭ \~ݬ׭ ЭP֭` ߭rЬP  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  t((UPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~}PYj ~P  BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[D#1xݏPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~@PY PP|[ [[[  Ь[Z = 8[ePZ~9PZ ݫS ԫ kZP{P^߭ݬlPPP|l\PЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6 P.88ux~*PYa[fk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ" [8PYPƏPxPbPZxPZPPZx~@PZZZPZPxPZPPjj81xYP[PlZe]`kQJk[P Ь[[ZZZ1jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@jH~\S^\-P$ЬPЬPЬRRQ{RPPR PRPPЭRBQPT PbPbլQP PP"/usr/preserve/Exaa`XXXXXNOT super user /tmp/tmp.r/tmpBuffer format error LOSTBuffer read errorCan't find a name mail %swA copy of an editor buffer of yours was saved when %s. the system went downthe editor was killedNo name was associated with this buffer so it has been named "LOST". A copy of an editor buffer of your file "%s" was saved when %s. the system went downthe editor was killedThis buffer can be retrieved using the "recover" command of the editor. An easy way to do this is to give the command "ex -r %s". This works for "edit" and "vi" also. @(#)expreserve.c 6.1 10/18/80/etc/passwdrrUnknown error: #/bin/shsh-c  AAAAAABBBBBB 00t$8 r< ($04:~XEPqWqD_hpxL (   fy$ 4@P `pf'f$0y,78>8FHOhVx]dm!t|7(l,~<r  |$ 8J.4#4 tN&UN0;87h=PDxJ!RYba.hup,$w p`$"XFp( A ~>+Dq t$) ,0":L GM?TX Zz ah p@x~ [nf$LVyh4e3H , 0l(7  8Ucrt0.oexpreserve.o_sccsidchdir.ochown.ofprintf.ogetpwuid.ogetpwent.oatoi.ofgets.ogetuid.ofopen.ocreat.operror.oerrlst.opopen.odup.ofdopen.opipe.ordwr.orew.octype_.ofilbuf.osetbuf.ostrlen.o_exit.oexecl.oexecv.oexecve.osignal.olseek.ogetpid.osprintf.odoprnt.oflsbuf.oexit.odata.oclose.oisatty.oopen.oread.ostat.ostrcpy.ostty.oioctl.ounlink.omalloc.osbrk.oudiv.ovfork.owait.owrite.ocerror.o_exitstart_main_environ_H_pattern_copyout_getuid__iob_fprintf_chdir_perror_fopen_stat_fread_mkdigits_close_open_lseek_read_strcpy_write_mknext_creat_unlink_chown_notify_getpid_strlen__ctype__getpwuid_sprintf_popen_setbuf_pclosecerror__doprnt_setpwent_getpwent_endpwent_rewind_fclose_fgets_atoi__filbuf_geteuid__lastbuf_errno_sys_nerr_sys_errlist_pipe_vfork_dup2_execl__exit_fdopen_signal_wait_dup_fwrite__flsbuf_fflush_malloc_free_execv_execve_getppid_isatty__sobuf__cleanup__sibuf_gtty_stty_ioctludiv_sbrk_realloc_end_brkpen_stat_fread_mkdigits_close_open_lseek_read_strcpy_write_mknext_creat_unlink_chown_notify_getpid_strlen__ctype__getpwuid_sprintf_popen_setbuf_pclosecerror__doprnt_setpwent_getpwent_endpwent_rewind_fclose_fgets_atoi__filbuf_geteuid__lastbuf_errno_sys_nerr_sys_errlist_pipe_vfork_dup2_execl__exit_fdopen_signal_wait_dup_fwrite__flsbuf_fflush_malloc_free_execv_execve_getppid_isatty__sobulib/opx_header 644 0 33 2000 2500654333 6632 (p,^Юn PPՀPpPP PH^Ь[ЬZ[jY YPIj@YY[[P@PYY ϙϧYR<2W Y1YYYP2PPXXWWXYYw"πϙπL Ь[[YZZZ[ϔݬ6QP@)g*XЬRPQbP^ԭլݏP|PݭݭVխѭ¬ Э!Pݬ4+ЬP}V}X}Z}Э`PЬPЬQ}V}X}Z}\Ё^PPXݬݬ;20$PPuPpToo many arguments. -Try again. /usr/ucb/opxPx not found. @(#)px_header.c 1.1 (Berkeley) 3/2/81lost+found/ 775 0 33 0 2546723556 6056 man/ 775 0 33 0 2512730710 4520 man/man0/ 775 0 33 0 2527171633 5364 ((man/man0/bfile 644 0 33 15 2512730450 6377 +-\*,`():;/ ACU 300 < < a902527171633/< a900000005364  AAAAAABBBBBB   /0 C. /\@,\D"man/man0/changes 644 0 33 104171 2512730450 7036 .de IR \fI\\$1\fR\\$2\\fR\\fR .. .TL Changes in the VAX system in the Fourth Berkeley Distribution, November, 1980 .AU Bill Joy .AB This document describes briefly the changes in the Berkeley system for the VAX between the distribution of January 1980 (known as 3BSD) and this, the fourth distribution, of November 1980. It attempts to be summarize, without going into great detail, the changes which have been made, and is intended to be used by someone who is familiar with the system to quickly re-acclimate themselves to the new system. .AE .SH .ce .LG Major changes .SM .sp .PP .IP \s+1\(bu\s0 4 There is a new format for \fB.o\fR files and also a new archive format. Old \fB.o\fR files must be discarded and the programs compiled from the source again. Old archives can be converted to the new format with .IR arcv (8), but if they contain old \fB.o\fR files they have to be completely recreated. New libraries for the loader \fBmust\fR have a table of contents, see .IR ranlib (1). .IP \s+1\(bu\s0 The C compiler and associated programs now take arbitrary length names, not chopping them off at length 7 or 8. Other changes in C are described under .B cc below. .IP \s+1\(bu\s0 There is a new version of the C shell, which supports ``job control'' and which uses a new tty driver. See .IR newcsh (1) and .IR newtty (1) for details. Programming considerations for the new system mechanisms involved are described in .IR jobs (3). Users of the older .B csh can use .B oldcsh until they have time to learn the new features. .IP \s+1\(bu\s0 The standard output (in the standard i/o library) is now line buffered by default when the output is a terminal. So that essentially all programs may work without change in the presence of this extra buffering, a partial output line is flushed whenever the library goes to the system to read from the standard input. .IP \s+1\(bu\s0 A number of performance enhancements have been made. Under normal timesharing loads, the system time has been decreased about 10%. The changes to the standard i/o library and improvements to the character handling routines to terminals have reduced greatly the cost of terminal i/o. The new version of the loader and the addition of table of contents to loader archives have speeded up loading of large programs by about a factor of 3. Improvements to the system data structures have decreased the time required for most system calls, increasing the amount of time available to user programs. .IP \s+1\(bu\s0 A bug has been fixed in the C optimizer which caused incorrect code to be generated for the random number generator. A consequence of this is that the .B rand function in this version of the system produces different sequences. Fallout from this is the fact that the secret-mail facility encryption scheme is subtly changed by this bug fix. All users should re-enroll in secretmail using .B enroll; messages sent before re-enrolling can be read using .B /usr/old/bin/xget. .bp .SH .LG .ce Section 1 .SM .sp .PP This is a brief summary of the changes which have been made in section 1 of the manual. In general, a number of system maintenance commands have been moved to section 8 of the manual as they are of little interest to the average user. In addition, to reduce the bulk of the manual, a number of very-closely related commands have been merged together onto a single manual page; thus \fBccat\fR, \fBcompact\fR and \fBuncompact\fR, which had three separate pages in the last edition of the manual, now have only one, and the line printer commands \fBlpr\fB, \fBlpq\fR and \fBlprm\fR have been placed on a single page. .de BP .IP \fB\\$1\\fR 11n .. .BP ac Now appears in section 8. .BP adb Now correctly initializes the maps when debugging the system. Control characters are now printed using the \fB^x\fR convention when the \fBC\fR output format is used. The increment for dot in the \fBp\fR format is now (correctly) 4. A previously undocumented command is \fB$?\fR, giving the output of \fB$r\fR, preceded by the process id and signal stopping the process. The bug which cause the running process to always stop at location 2 when first run has been fixed. .BP analyze Now appears in section 8. .BP ar Now creates a new archive format, in which the critical information is stored in ASCII, and thus portable between the VAX, PDP\-11, and other machines. See .IR old (8) for information on dealing with the old format. The program .IR arcv (8) converts old (binary format) archives to new format, in place. Beware, however: the format of \fB\.o\fR files has changed, so archives of object files must be recompiled (see \fBcc\fR below). .BP ar11 Is now in .B /usr/old/bin see .IR old (8). .BP arff Is now .IR arff (8). .BP as A new option \fB\-R\fR causes the assembler to make data segments read-only and shared; this replaces the cumbersome ``:rofix'' script used in the previous distribution. For very large assemblies there is an option \fB\-J\fR which causes the assembler to use four-byte jumps to avoid ``Branch too far diagnostics.'' Local labels have been added to the assembler defined by ``\fIn\fR:'' and referenced as ``\fIn\fRf'' or ``\fIn\fRb''; see the assembler manual in volume 2c for details. All tables in the assembler have been made extensible so that there should be no problems with assembling enormous files. The assembler has also been sped up by 25-40%. .BP at A number of security problems with the .I at command have been fixed. .BP biff Is a new command which can enable immediate notification when mail arrives; if you give the command ``biff y'' then the first few lines of each piece of mail sent to you is printed on your terminal. This is a (different flavor) replacement for the MAIL variable of .B sh or the mail variable of .B csh. .BP cat New options \fB\-n\fR numbers lines; \fB\-s\fR crushes out multiple blank lines, replacing \fBssp\fR; \fB\-v\fR prints control characters in the \fB^x\fR format. The commands .IR num (1) and .IR see (1) now just invoke .I cat. .BP cc A newer version of the C compiler supports more strongly typed structures. Field names need not appear in only one structure; rather the compiler insists on correct typing of pointers accessing structures in contexts where this would cause ambiguity, and producing a warning in other cases when the pointer does not have the correct type to access the field name. .IP A new type \fBvoid\fR may be used in a declaration or a cast to indicate that there is no result, or that a value is to be discarded. .IP The compiler has been changed to accept arbitrary-length names. For maximum portability it is better to limit names to 8 characters, 7 characters for externals, but this is no longer required. The longer names bring a new \fB\.o\fR format, incorporating a string table, and consequently a large number of programs are changed. The critical ones exist in ``old'' versions to ease conversion pains. .IP A number of bugs in the compiler have been fixed. To avoid remaining bugs in the code generator, the declaration of \fBregister char\fR and \fBregister short\fR variables are currently being compiled as though the word \fBregister\fR were not present. (This does \fBnot\fR affect pointer variables.) This blindness is allowed in the semantics of the language, and is not as bad as it might seem at first. It is sufficiently difficult to maintain the semantics of C in operating on such quantities that the code is often better when they are not placed in registers. This applies to \fBunsigned char\fR and \fBunsigned short\fR variables also. .BP cd The .I cd command, in .IR csh is now affected by a .I cdpath variable which works similarly to the command search .I path variable; see .IR csh (1). .BP checknr A new command which checks macro bracketing structure in .I nroff or .I troff input. .BP chgrp Has been moved to section 8. .BP chown Has been moved to section 8. .BP cifplot Produces raster plots from CIF for integrated circuit designers. .BP clri Has been moved to section 8. .BP colrm Has had several bugs fixed. .BP cp It, along with .I mv now take .B \-i flags which cause them to ask before overwriting an existing file; thus .B cp can be usefully \fIalias\fR\|ed to ``cp \fB\-i\fR'' when using .IR csh (1) to provide a safer environment. .BP csh Has had a number of changes; most importantly, the shell now supports ``job control'', allowing arbitration of a terminal between several active groups of processes. See .IR newcsh (1) for a short description of new .I csh features. Users of .I csh automatically use the new teletype driver summarized in .IR newtty (4). (An old version of .B csh, corresponding to that of the Third Distribution remains(( available as .B oldcsh to ease conversion to the new shell.) .BP ctags Now recognizes FORTRAN and Pascal routine definitions. .BP cu Is now functional on VADIC dial-out hardware with the necessary software to record outgoing calls; see .IR rv (4). .BP cxref Is now the .B \-x option to .B ctags. .BP date The internal date representation (maintained in the hardware) has been changed to be more compatible with the standard DEC system VMS, although VMS still poses problems (see \s-2BUGS\s0 in .IR date (1)). .BP dcheck Is now in section 8. .BP dd Options have been added to do blocking and unblocking of tapes without converting to and from EBCDIC. .BP ddate Is obsoleted by the new .B dump program, which lives in section 8. .BP df The output format is greatly improved. It is now also possible to say ``df directory'' to get \fIdf\fR to report the free space available on the file system containing \fIdirectory\fR. .BP diction Is a new program which finds bad or wordy diction. .BP diff Has new options to give lines of context and to create a merged conditional file with ``#ifdef'' controls in it. The command .I diffdir has been subsumed into .I diff and an option has been added to perform recursive directory differences. .BP diffdir Is now part of .I diff. .BP dmesg Is now in section 8. .BP dump Is now in section 8. .BP dumpdir Is now in section 8. .BP echo The echo builtin to .B csh now is the same as the standard version 7 echo. The special character sequences ``\ec'' and ``\en'' no longer have their special meaning; instead the .B \-n option is accepted. .BP ef\&l Is a new FORTRAN preprocessor, providing C-like features. .BP error Is a new program which consumes error message output from language and other processors, analyzes them and (optionally) places appropriate diagnostics back into source files near the point of error. .BP ex A number of bug fixes and a few new features are available. See the incremental change report in volume 2c or read the file .I /usr/news/ex. .BP expand Now has a companion .I unexpand command, reversing its effect. .BP f\&lcopy Is now in section 8. .BP from Now takes a .B \-s option, printing only headers from the sender who is the next argument. .BP gets Is obsolete; use ``$<'' of .IR csh (1) or .I read of .IR sh (1) instead. .BP grep The .B \-i option now works with .I fgrep; several subtle bugs have been fixed in its algorithm. .BP iostat Now has a single output format which includes character i/o rates, seeks and transfers per second on each disk. .BP kill Is now built-in to .IR csh and take job names ``%...'' as arguments. This eliminates much of the need to know process id's when using .I kill. It also takes symbolic as well as numeric signal names; do ``kill \-l'' (lower case letter l as in lark) to see a list. .BP ld Has been speeded up substantially; several new options have been added providing incremental loading (\fB\-A\fR), primitive load maps (\fB\-M\fR) and symbol def/use tracing (\fB\-y\fR). The loader now supports archives with table of contents, and expects all archives it encounters to have them (or it complains); see .IR ranlib (1). .BP lisp The lisp interpreter has begun to support new ``string'' and ``hunk'' data types. A user must now type vertical bars to delimit atoms with embedded white space, as double quotes (") now delimit strings. The interpreter has benefitted from in-line expansion of frequently called small routines, and will interpret list structure 20% more quickly than before. A perusal of the index to the lisp manual in Volume 2c will show more new functions which Franz has in common with \s-2MACLISP\s0. .BP liszt The quality of the code produced by .I liszt is substantially better than the previous version; .I liszt also now provides macros for UCI lisp compatibility as well as Maclisp compatibility, and a facility for constructing a cross-reference with .IR lxref (1). .BP ln Now subsumes .I lnall when given multiple arguments. .BP ls Has new options \fB\-R\fR for a directory-recursive version, \fB\-F\fR to highlight directories and executable files, and now indicates .IR mpx (2) files in long format outputs with first output character \fBm\fR. .BP lxref Is a new lisp cross referencing program. .BP mail All mail is now forwarded through the facilities of .IR delivermail (8) using the mail aliases data bases in the file .I /usr/lib/aliases whose format is described in .IR aliases (5). Gateways to UUCP, ARPA and Berknet machines are provided, with normal naming conventions, i.e.: ``name@site'' for the ARPANET, ``machine!name'' for UUCP, and ``machine:name'' for the Berknet. Personal distribution lists created and placed in the file .I \&.mailrc are now expanded in sent mail so that the recipient can reply to members of personal aliases. Systemwide aliases contained in the ``aliases'' file are applied to .I all incoming mail; this allows correct functioning when reply is made to a mailing list, which was not expanded to its constituents when the mail was first sent. .BP make Now understands about Pascal files, running .IR pc using the options PCFLAGS. A number of limitations have been removed to allow very large programs to be controlled. .BP makewhatis .br Has been replaced by .IR catman (8). .BP man Now interfaces with a preformatted version of the manual; this allows the manual to be presented much more quickly. The preformatted manual is maintained automatically; when pages are changed and then requested they are reformatted. The .IR catman (8) command can be used to reformat all manual pages whose preformatted sections are out of date. .BP mkfs Is now in section 8. .BP mknod Is now in section 8. .BP more Has been improved, providing more commands and has also been changed to be more (sic) similar to .IR ex (1). A new interface .I page is like .I more, but clears the screen before presenting each pageful. .BP mount Is now in section 8. .BP msgs Now provides options for saving messages in files and responding to messages. There is also an option (\fB\-p\fR) to arrange that long messages be piped through .IR more (1). .BP ncheck Is now in section 8. .BP newaliases Rebuilds the random access version of the mail forwarding database. After you edit the file /usr/lib/aliases which contains the forwarding information, you must run .B newaliases. .BP nm No longer prints symbols destined for .IR sdb (1) by default. Instead, when the .B \-a option is given, they are printed symbolically (rather than in octal as before.) .BP pc Is a new Pascal compiler, which allows separate compilation and mixing of Pascal code with routines written in C and FORTRAN. It is possible to use .IR sdb (1) with Pascal routines, and all standard language features, including procedure and function parameters are implemented. .BP pi Has had some options changed so that they are similar to \fIpc\fR\|'s options (since the latter is constrained by the demands of compatibility with .IR cc (1) and .IR ld (1)). .BP pr Now has an option \fB\-f\fR to use form-feeds in the output rather than multiple blank lines to eject pages. This can be used for greater top-of-form alignment reliability on unreliable printers or to reduce bulk of the output. .BP prof Now suppresses routines which were never called and which accumulated no time. An option to sort the output by number of calls has been provided. .I Prof can also combine the statistics from a number of saved monitor data files in a single output report, producing a new summary data file. .BP ps The formats for .B ps have been improved to include more information about job state in all output formats, and cpu and memory consumption by jobs (in the \fBu\fR and \fBv\fR output formats.) .BP pwd Is superseded for .IR csh (1) users by .I dirs, which is built-in and significantly faster. .BP ranlib Is used to create loader table-of-contents for loader archives. The loader insists that such table-of-contents exist or it complains, as loading is very slow without these indices. .BP renice Is now in section 8. .BP restor Is now in section 8. .BP sdb Now knows about Pascal as well as C and FORTRAN 77. .BP spice Is no longer part of this distribution, and must be obtained separately. .BP stty Now has options to control the features of the new tty driver, summarized in .IR newtty (4) and fully described in .IR tty (4). In particular, it is often desirable, when using the new driver with .IR csh (1) to place the command ``stty crt'' in the .I \&.login file to cause control characters to echo legibly and intelligent erasing of characters from the screen to take place except at very low speed. .BP style Is a new command, which analzes the style in which a paper is written. .BP sync Is now in section 8. .BP tail Now has a .B \-f option which follows a file as it grows, replacing .B tra, and a .B \-r option, which prints out the last part of a file backwards, line by line. .BP tar Now normally saves and (optionally) restores modes of directories. It also uses the raw tape drive by default, so the file option is not normally needed. .BP tp Has been fixed to work with the tape drive as it should. .BP tra Has been deleted; use ``tail \-f'' instead. .BP tset Has a more general scheme for mapping non-hardwired terminals to types. The command used in startup files to set the terminal type can now be simpler; see .IR tset (1) for details. .BP ul Subsumes the old ``iul'' command as the option \fB\-i\fR. .BP units Currency tables have been updated. .BP uuencode Along with .I uudecode provide the ability to mail binary files through .I uucp or other mail facilities. .BP vmstat The format has been changed to include statistics on the rate of system calls, context switches and device interrupts. The format also includes information about page-cache hits (pages of programs which recently exited which were found lying in the free list.) See .IR vmstat (8) for more details. .BP vpac Is now in section 8. .BP wc Now will estimate transmission times over communications networks. .BP yes A new command, which is excessively obsequious. .SH .LG .ce Section 2. .SM .sp .PP The important changes to section 2 define the mechanisms needed to support the job control facilities of .IR csh (2) defining new sy((stem calls .B getpgrp, .B killpg, .B setpgrp and providing a version of the .B signal system call interface with clean semantics; this is described in .IR sigsys (2). For a general introduction to the new job control facilities from a programming standpoint see .IR jobs (3). .PP The system calls in section 2 have been identified as to origin: those in section 2V are peculiar to the VAX Virtual Memory version of the system. Some of these (e.g. .B vread and .B vwrite which are likely to change soon are so marked.) Calls resulting from the job control facilities are in subsection 2J. .BP getpgrp Is a new system call, which returns the process group of a specified process. .BP ioctl There is a new .I ioctl call FIONREAD which returns the number of characters immediately available from any readable file descriptor, most usefully terminals. .BP killpg Kills all processes in a process group .BP reboot Is used to halt the processor or initiate automatic reboots. .BP setpgrp Changes the process group of a specified process. .BP sigsys There are more signals, needed by the new job control and limit facilities. This is the new signal interface, which can be setup to handle signals reliably, blocking them off when they occur so that they can't happen again before they can be reset and also allowing them to be blocked, but not lost if they occur (protecting critical sections.) .BP vadvise Allows processes with very abnormal paging behavior to advise the system so that it can have a better chance of dealing with their virtual memory needs. .BP vhangup Is used to simulate hangups on hard-wired ports and to prevent other users processes from scribbling on a terminal after they log off. .BP vlimit Is used to provide the resource limiting .I limit facility of .IR csh (1) which allows the amount of CPU time or memory used by any process to be controlled, as well as the maximum size of a file created, maximum size of a core file created, etc. .BP vswapon Is used to inform the system that it should use the interleaved portions of the paging area, since at boot it normally uses only that portion of the paging area adjacent to the root file system. .BP vtimes Provides additional virtual memory information as well as the traditional information provided by .B times. .BP wait3 Provides options which allow return of .B vtimes like information about the virtual memory utilization of terminated processes as well as allowing one to determine if any children have changed state without blocking if none have. .SH .LG .ce Section 3 .SM .sp .PP The major change to the standardly available library routines is in the standard i/o library handling of the standard output. The standard output is now line buffered by default when it is directed to a terminal. In order that old programs which do terminal i/o continue to work (in almost every case) without change, the standard i/o library flushes a partial line in the standard output buffer whenever a read is made from the standard input. .BP curses Is a new library of routines to do terminal independent cursor motions. This is a higher level set of routines based on the low level .IR termcap (3). .BP dbm Has been changed to use 1024 byte blocks internally. If you have old data files and recompile a program which uses .B dbm on them, you must recreate the files in the new format. .BP getfsent Is a new package of routines for locating entries in the file system information file, .B /etc/fstab. .BP jobs Is a descriptive page on use of the new job control facilities. .BP malloc Hasn't been changed yet (unfortunately), but we have discovered that it has extremely poor behavior if used to allocate a large number of blocks in a large virtual address space, as it tends to page fault on a large number of pages whenever you allocate more storage when the free list is nearly empty. Very large applications should write their own free storage management routines based on .IR sbrk (2) until a new version of .B malloc is ready. .BP nlist The namelist has been changed to embed a string table. The definition of the namelist in .B now includes a \fBunion\fR construction which the C compiler will not let you initialize. Thus if you wish to use .B nlist you should use .B instead of .B as it doesn't include a \fBunion\fR construction and initializations of \fBstruct nlist\fR objects are thus possible. .BP rand Generates different sequences, due to a bug fix in the C optimizer (i.e. the old routine was flaked out due to the bug.) .BP regex Is a new library routine which allows compilation and execution of .BR ed -like regular expressions. .BP stdio Has been changed to have line buffered standard output to terminals by default (as described above). .BP sigset Is the user-level interface to the new signal facilities, providing reliable and convenient handling of signals. .BP string The routines \fBstrcatn\fR \fBstrcpyn\fR and \fBstrcmpn\fR are now decreed to be spelled \fBstrncat\fR, \fBstrncpy\fR and \fBstrncmp\fR in the official version (to be compatible, e.g., with PDP-11 UNIX), but both versions still exist (temporarily). .BP termcap Is the new name for the previously misnamed \fBtermlib\fR library. .SH .LG .ce Section 4 .SM .sp .PP The system now supports additional i/o disciplines and devices: .BP bk A ``line discipline'' which allows efficient, high-speed, input for uploading of programs and networking over asynchronous communications lines. .BP dh Abel DMAX-11 dh emulators. .BP hp Includes RM-05 support (including the SI MASSBUS disks). .BP lp A driver for a standard lineprinter interface. .BP rv Racal/vadic call units (via user-software simulation of a dn-11). .BP tm Support for UNIBUS TM/11 tape drives (e.g. Kennedy transport on a Emulex controller.) .BP tty Includes a new tty driver which is standard for users of .IR csh (1) providing additional functionality. .BP up A driver for a EMULEX SC-11 or SC-21 UNIBUS disk controller with storage module (e.g. Ampex 9300) disk drives. .BP va A varian raster plotter. .SH .LG .ce Section 5 .SM .sp .PP The changes impacting most users are the new archive and object file formats. The new object file format requires recompilation of all \fB\&.o\fR files, as the new format includes a string table for names while the old table had only fixed space for 8 character names. The new archive format is portable, and can be easily converted to using .IR arcv (8). .BP a.out Now includes a string table. New macros are provided for dealing with executable files, and the names of the headers and the include files have been changed. You should read this section if you have programs which work with the bits in these files. .BP acct The system now maintains all the information fields in this file. .BP aliases This file gives forwarding information for mail. The .B delivermail utility, which is invoked by the mail handlers, uses this information to forward mail and to implement distribution groups. The program .B newaliases must be run whenever this file is edited, since the .B delivermail program actually uses a binary version of this file. .BP ar Now uses a portable format. Old formats may be converted using .IR arcv (8), although converting old loader archives is pointless, since the \fB.o\fR files must be regenerated anyways. .BP core The maximum size of a core file can now be limited with .I limit of .IR csh (1) or by calling the system call .B vlimit. .BP environ Has acquired a USER variable with the login name of the user. .BP fstab Is a new data structure, kept in the file .B /etc/fstab; it greatly simplifies the system startup script .B /etc/rc, the interface of the dump program, and is a central figure in the automatic reboot procedure. It is possible to reconfigure the disk drives simply by changing this data base. No file system dependent commands need appear in .B /etc/rc. .BP stab Describes the symbol table entries for the symbolic debugger which appear in \fBa.out\fR files. .BP termcap Has been changed to describe even more terminals and functions. .BP ttytype The standard naming for terminals in this file is now to give long names; thus dialups should be described as ``dialup'', not as ``sd'' like before. .BP vfont There are now rotated versions of all the fonts for use on output devices which run 11 by 8.5 inch (sideways) paper. The Hershey fonts have been extensively edited to fix problems and fill in missing and mangled characters. .SH .LG .ce Section 6 .SM .sp .PP There are a number of new games, including the popular ZORK game as well as more mindless and more popular games, such as \fBsnake\fR, and human-humiliating games such as \fBboggle\fR. .BP aardvark Is one of several dungeon-exploration games. .BP boggle Is an implementation of the Parker-Brothers game, in which you and the computer look for words and you are humiliated by the computer. .BP chess Is the PDP-11 chess program running in compatibility mode. .BP cribbage Is a respectably good cribbage player. .BP fish Plays \*(lqGo Fish\*(rq. .BP fortune Has been refreshed with new and interesting quotations and fancy-pants options. .BP mille Is an implementation of the French card game, Mille-Bourne. .BP monop Is the game of monopoly. .BP mpu Is another exploration game. .BP snake Is a mindless game in which the computer chases you around the screen and, usually, ends up eating you. .BP zork Is the classic successor to adventure for die-hard explorers. .br .ne 10 .SH .LG .ce Section 7 .SM .sp .BP hier Has been updated to reflect changes in this distribution. .SH .LG .ce Section 8 .SM .NL .sp .PP There is a major organizational change in section 8: the maintenance commands have been moved here from what was section 1m (which no longer exists) and have also (almost all) been moved into the directory .B /etc. .PP The procedures for system reboot have been substantially changed. The system now has provisions for automatic reboot and file system repair after a crash. The system has been changed so that the disks are kept more consistent, so that the repair program can easily tell whether the inconsistencies it finds are simple and reasonable to fix. If it finds unexpected inconsistencies, then the automatic reboot(( will fail and the new .I fsck interactive repair program can be run. .BP adduser There is now a shell procedure .B vipw which locks the password file for editing, so that you can't get messed up by people changing their password while you are adding users. .BP arcv Converts to the new archive format (as discussed previously.) .BP bproc Is defunct; see .B reboot which replaces it. .BP catman Is a new command, which creates the preformatted version of the on-line manual from the nroff source for the manual pages. It also creates the data base for .IR whatis (1) .B /usr/lib/whatis, replacing .B makewhatis. .BP crash At the point of a system crash, the system now will automatically reboot itself if the auto-reboot switch on the machine is set, print the registers and the top few locations of the stack, and will then normally ``preen'' the file systems and come up multiple user again. The system does not (yet) automatically dump core to disk when a crash occurs, so the procedures described in .B crash are still used to take a crash dump; in order to get one, you have to be running with auto-reboot disabled when the crash occurs. Note that you must now use \fBdd\fR to copy crash tapes, as the tapes are blocked ``bs=20b''. .BP cron Now runs the executed commands as .B root; before it ran them as .B daemon which kept a number of reasonable .B crontab entries from working properly. .BP dcheck Is obsoleted, in all normal usage, by .IR fsck (8). .BP delivermail .br Is a new daemon which acts as a postman and routes mail destined for foreign networks. It also interprets distribution, forwarding and alias lists from the file .B /usr/lib/aliases, which replaces the function only partially performed previously in .B /usr/lib/Mail.rc. .BP dump The dump program now is much more robust. It restarts after bad tapes are encountered, and will keep a selected group of operators informed about what it is doing. A .B dumpdates file which is kept in ASCII replaces the old binary format .B ddates file, making it easy to edit. .B Dump uses the new .B fstab file system table which records the desired frequency of dumps, and a new option \fBw\fR will tell the operators what needs to be dumped. .BP flcopy Has a new option \fB\-h\fR to start halfway through, writing a disk from an existing .B floppy file without reading the disk. .BP fsck Is a new, intelligent, interactive file system check program. It is normally run automatically at reboot with the option \fB\-p\fR to preen all the file systems and fix normal minor incomplete operations. If any unexpected problems arise, the automatic reboot will fail and .B fsck should be run manually. There is a document explaining the use of .B fsck and all the errors which can occur in standard UNIX systems. Most errors are prohibited from happening in this version of the system unless there is hardware or software failure; .B fsck was designed with adversity in mind to deal with these exceptional cases and is very easy to use to fix up addled file systems. .BP getty Is the new name for the old \fBgetty.vm\fR. .BP halt Halts the processor cleanly when no reboot is desired, regardless of the setting of the auto-reboot switch on the machine. .BP icheck Is largely replaced by .B fsck. .BP init Now understands how to initiate an automatic reboot. When passed appropriate information as parameter at boot time, it will immediately run .B /etc/rc with parameter .B autoboot, causing it to run a disk check. If .B /etc/rc exits with a non-zero exit status, the reboot we be considered a failure, and a single user shell is given to the console as before. The form of .B /etc/rc is such that interrupting the automatic reboot also yields a single-user shell on the console. .B Init has also been fixed so that ``kill 1'' attempting to bring the system down single user will not hang irretrievably if some processes refuse to die because of hardware or software malfunction. Instead, .B init gives a single user shell and a warning that something is amiss. .BP mkfs It is critical that all newly created file systems have .B lost+found directories as created by... .BP mklost+found .br Which creates empty directories into which .B fsck places detached files which it reconnects. .BP mount Now takes an option \fB\-a\fR to mount all normally mounted file systems as specified in .B /etc/fstab. .BP ncheck Is obsoleted in normal usage by .B fsck. .BP old Is a front for a number of old commands dealing with old formats for \fB.o\fR files and archives. These commands are kept in .B /usr/old and its subdirectories and can be used to keep your sanity until you have time to convert your programs to the new formats. .BP reboot Describes the new reboot procedures, based largely on the automatic reboot facility. Also describes the cold-start and emergency-start procedures (which came from the old .B bproc manual page.) .BP sticky The system has been changed so that text pages of processes which have exited are retained in the free page pool in core (at least for a while), so that they will not have to be read from the disk again if they are needed quickly. This tends to make heavily used commands behave much as .B sticky was intended to make them behave on swap based systems. .BP swapon The system supports paging interleaved across disks and controllers, but bootstraps running only on one disk. This command makes the additional pieces of the paging area available. .BP umount Now takes a \fB\-a\fR option, to attempt to unmount all file systems mentioned in .B fstab. .BP vipw Is a new script which lock the password file while editing it. If the password file is being changed (e.g. by the .IR passwd (1) command), then .B vipw complains, and avoid the race condition. ased systems. .BP swapon The system supports paging interleaved across disks and controllers, but bootstraps running only on one disk. This command makes the additional pieces of the paging area available. .BP umount Now takes a \fB\-a\fR option, to attempt to unmount all file systems mentioned in .B fstab. .BP vipw Is a new script which lock the password file while editing it. If the paman/man0/changes.4-81 644 0 33 100226 2662075266 7440 .de IR \fI\\$1\fR\\$2\\fR\\fR .. .TL Bug fixes and changes in 4.1bsd .sp November 19, 1981 .AU Bill Joy .AI Computer Systems Research Group .AB This document describes briefly the changes in the Berkeley system for the VAX between the fourth distribution of November 1980 (known originally as 4BSD, and hereinafter referred to as 4.0bsd) and this, its revision of April 1981. It attempts to summarize, without going into great detail, the changes which have been made. .AE .SH .ce .LG Notable improvements .SM .sp .IP \s+1\(bu\s0 Performance of the system under heavy paging load has been substantially improved by correcting a problem with placement of pre-paged pages. The system now pre-pages more data, greatly benefitting processes which have locality in their behavior. System degradation due to pre-paging has been reduced (even though more pre-paging is done), by placing the pre-paged pages at the bottom of the free-list, rather than in the systems global clock replacement loop. .IP \s+1\(bu\s0 Processes which serially reference large amounts of virtual memory may now declare themselves to be sequential (see .IR vadvise (2)), causing the paging algorithm to be adjusted to be more appropriate for such behavior.* .FS * It is hoped that future versions of the system will detect strongly sequential behavior and adapt themselves accordingly, so this call may no longer be necessary. .FE Processes which are known to need only a small amount of memory, but which tend to accumulate large amounts of memory due to strange page referencing patterns may declare a soft limit on the amount of memory to be used, see .IR vlimit (2) or do ``limit memoryuse \fIn\fR\|k'' in .IR csh (1). If the system needs memory, and there are processes which are over their declared limits, the system tends to take pages from these processes first. By saying that these limits are soft, we mean that on a system where physical memory is not scarce, processes with limits can exceed the limits. .IP \s+1\(bu\s0 The system is now compiled from a description of the local machine which includes information about available devices and the maximum number of users to be supported on the system. It is no longer necessary to adjust an armful of constants to re-size the system; time-sharing systems with typical loads will be parameterized from a single ``maxusers'' constant. The system also adjusts the parameters of the paging subsystem based on available memory; it is no longer necessary to adjust these for machines with very small or very large amounts of available memory. .IP \s+1\(bu\s0 The system now handles multiple uba's and mba's and mixing of devices on mba's. A number of new devices are supported: RK07's and TS-11's which come in the standard 11/750 packages, UNIBUS TM-11 and TU45 tape emulators (e.g. the EMULEX TC-11 with a KENNEDY 9300 transport, and System Industries Model 9700). Line printer and C/A/T phototypesetter drivers are included in the system, and modem control for the DH-11 using the DM-11 has been integrated and tested. The new RM80 and RA80 Winchester drives from DEC are supported. The 11/750 console cassettes are supported in a limited manner. A single distribution system boots on all supported hardware configurations by determining the available devices and selecting a root device at boot time. .IP \s+1\(bu\s0 The \fItar\fR program has been changed to allow update of magnetic tape archives, adding to the end of the existing tape archive. This uses tape control facilities newly added in this version of the system, but the created tapes are(( readable on all versions of UNIX. Since blocked tapes are inherently more efficient and fully functional, \fItar\fR now creates blocked tapes by default. .IP \s+1\(bu\s0 Shell scripts are now potentially executable. A file which begins with the characters ``#!'' followed by some amount of white space and the name of an interpreter is executed directly by the system. The standard version 7 shell, /bin/sh, has been changed to recognize a # as a comment character. It is desirable that users change existing shell script so that the first line of each shell script begins with ``#!'' and the name of the proper shell to execute. .IP \s+1\(bu\s0 Two new documents have been added to Volume 2c: a manual for the crt screen package \fB\-lcurses\fR, and a document describing the \fBrogue\fR game. .br .ne 10 .LP .LP .ce .LG .B "Major bug fixes" .SM .sp .IP \s+1\(bu\s0 A number of bugs have been fixed in the FORTRAN compiler F77; these caused some block data routines and main programs to fail to compile. Other bugs related to use of the symbolic debugger with FORTRAN have been fixed (see \fBf77\fR in ``Section 1'' below.) .IP \s+1\(bu\s0 A bug which caused the C compiler to complain ``expression too complicated'' when an expression contained an embedded structure assignment has been fixed. .IP \s+1\(bu\s0 A kernel bug which caused approximately 1/8'th of data collected during program profiling to be lost has been corrected. .IP \s+1\(bu\s0 A very confusing bug in the \fItset\fR manual page has been corrected: in the example where it uses the \fIsetenv\fR command it should rather use the \fIset\fR command: ``set noglob; eval ...''. The alternate form does not work on a number of terminals. .IP \s+1\(bu\s0 Due to an inconsistency between the 11/780 and the 11/750 in the interpretation of the \fBmovtuc\fR instruction, all binaries from the third distribution tape (of January 1980) and the fourth distribution tape (of November 1980) will NOT run correctly on the 11/750. The 4.1bsd distribution tape includes a new version of the standard i/o library which avoids use of this troublesome instruction, and it is recommended that all programs be recompiled from scratch to use this new library to eliminate non-portable UNIX binaries as soon as possible. .IP The problem is that when there appears to be a chance that the operands to \fBmovtuc\fR will overlap, but they in fact do not (because the pattern string to printf is terminated by a null), the 11/750 does not execute the \fBmovtuc\fR as though a shorter string length were specified which did not imply potential overlap. Thus this instruction which is in the inner loop of \fIprintf\fR on the 4bsd tape, and which works fine on an 11/780, malfunctions on an 11/750 causing strange and awful behavior. .IP \s+1\(bu\s0 4 (The following change is applicable to systems bootstrapped from the 4.1bsd release tape; systems upgraded from 4.0bsd may or may not include this change.) The standard i/o library has been made more compatible with the PDP-11 version 7 system and now supports concurrent read and write access to files (see .IR fopen (3s) for details). This caused a change in an internal data structure which is visible to compiled programs through the macros in , and thus necessitates discarding of old \fB.o\fR files and recompilation. Note that this standard i/o library now replaces the old \fB\-lNS\fR library which was in 3bsd but was deleted from 4bsd pending the inclusion of read-write capability in stdio. .SH .LG .ce Section 1 .SM .sp .PP .de BP .IP \fB\\$1\\fR 11n .. .BP adb A bug which prevented programs loaded with the \fB\-N\fR loader option from having breakpoints set on them has been fixed. A bug which prevented backtraces of programs which are stopped at interrupt level (after a signal) has been fixed by teaching adb how to step across the interrupt stack frame. The system now makes available, and the $? command in adb interprets, more precise codes when SIGILL and SIGFPE exceptions occur. Thus if you divide by zero, you can find out that this was what caused a floating point exception. A bug which prevented format repetition counts (e.g. the 10 in ``0/10X'') from working has been fixed. A bug related to adb has been fixed that prevented any sensible traceback after a FORTRAN-77 runtime error which trapped an exception or fault (e.g. a floating point divide by 0). A bug which caused the maps to be set improperly when debugging the kernel on a crash dump has been fixed. .IP New commands have been added to adb to facilitate writing adb procedures stored in files: see the descriptions of $<<, the register <9, and the # operator in the revised adb manual page. .BP awk Has moved from /usr/bin to /bin because it is needed during bootstrap procedures. .BP bc Now takes the new C syntax operators: ``op='' as well as (for history's sake) the old syntax ``=op''. .BP /bin/mail Has been changed so that it makes the program ``biff'' work. Previously the program that notified the daemon was /usr/net/bin/v6mail, which actually is the program which writes mail files here at Berkeley. .BP calendar Several bugs have been fixed in the internals of the calendar program. In addition it is now possible to have a calendar entry consisting of merely a date (with no month specified) and have this entry occur each month. .BP cc A bug has been fixed in the C optimizer which caused strange things to happen when long variable names were used. The size of the internal ``dimension'' table has been increased to allow more structure fields to be declared. A problem which caused the compiler to print ``expression causes compiler loop'' when structure assignment was embedded in an expression context has been fixed. A bug in the code generator tables which affected certain FORTRAN constructs has also been fixed. A bug in comparison of characters to moderate sized constants has been fixed. .BP checknr Understands \fB\-mm\fR. .BP csh A cosmetic bug which prevented the distributed source from compiling has been fixed. A bug which caused argument lists including the strings ``{'' or ``{}'' to sometimes fail saying ``No match'' has been fixed. A bug which caused a strange state to result when a command of the form ``(a; b; c)'' was stopped from the keyboard has been fixed. The shell has been fixed so that it prefers to make stopped jobs the new current jobs after the current job has terminated. The construct ``${TERM}'' no longer yields an extra ``}'' when the variable expanded is from the environment. .IP Previously undocumented was the shell variable \fIhistchars\fR; it can be set to two characters, and the first is then a replacement for the normal \fB!\fR history character and the second for the \fB^\fR quick history substitution character. Thus after ``set histchars=,;'' the command ``,,'' repeats the previous command, as ``!!'' would normally have done. .BP ctags Now takes an option .B \-v to produce output suitable for input to .IR vgrind (1). .BP cu Now honors uucp's locking protocol for the dialout lines. Several bugs relating to internal buffer overruns have been fixed. An option \fB\-b\fR has been added which causes the BREAK key to generate breaks (by turning input null characters into breaks sent over the line). .BP delivermail .br Some bugs which caused strange loops when aliases were self-referential have been fixed. .BP diff Some bugs related to directory diffs when the .B \-h option was used have been fixed; previously the .B \-h option was non-functional. .BP dump An obnoxious bug in the dump program where it would wrongly suggest that further dump tapes were needed after a multi-tape dump had already completed has been fixed. The dump program no longer attempts to time tape rewinds itself, but uses a mechanism which does not depend on the speed of the tape drive to determine when a rewind is complete. .BP error Has been taught about the error message formats of the PDP-11 C compiler. .BP expand A internal error check which was incorrect has been fixed. .BP f77 Has had a bug fixed which caused some block data subroutines and main programs to not compile (the sympton was a diagnostic of the form ``Undefined: LWM%d''. A number of minor bugs which combined to make sdb function poorly with f77 have been fixed. The result of these bugs were that if file names were longer than 6 characters sdb could not read the symbol table of the resulting FORTRAN binary. .IP An i/o library bug which caused numbers of the form ``-1.2'' to convert improperly in list-directed input (reading as ``-0.8'', taking the mantissa as positive) has been fixed. .BP ld If you are using the \fB\-r\fR flag and there remain undefined symbols you no longer get a spurious error return. Now respects modes of existing files and your file-creation mask more. .BP lisp The functions +, /, -, *, 1+, 1- now expect fixnum arguments, for interpreted functons as well as compiled ones. The source for the VMS and UNIX versions of lisp have been combined and synchronized. The construction of very large integers has been altered to use regular dotted pairs in a non-standard way, so that fewer garbage collections will occur. (It is no longer safe to use ``car'' and ``cdr'' to disect large integers). Mixed-mode arithmetic has been made faster. There is a new compiler option (liszt -r) which allows you to create .B small lisp application programs (with a mechanism other than ``dumplisp'', which tends to create very large binaries). When the result of such a compilation is executed directly, it execs /usr/ucb/lisp and then fast loads the file you asked to be executed. A new flag $ldprint has been added to control the printing of fasl/load messages. New functions (purecopy), (getdata), (putdata), and (removeaddress) have been added. A number of minor bugs have been fixed. .BP lpr Has been modified to work on both DECWRITER type devices at 1200 baud masquerading as printers and also on real line printers. The queueing algorithm has been made first-come-first-serve (replacing the old random job first algorithm), and a line printer driver is now available in the standard distributed system. .BP ls A bug has been fixed which caused essentially random numbers to be p((rinted for the size of special files. The size now prints as 0. .BP make A spelling error has been fixed which had the variable EC initialized to f77 rather than FC=f77. .BP man A bug which caused it to core dump when reformatting a manual page whose source macros were inaccessible has been fixed. .BP mt Is a new command which provides easy access to operations such as forward and backward spacing of files and records on magnetic tape. .BP mv Has been changed to have a option ``\fB\-\fR'' which means that all the following arguments are file names. A bug has been fixed which caused strange behaviour when the \fB\-i\fR option was used on directories. A bug which prevented renaming of subdirectories to which you had no write access has been fixed. .BP oldcsh Which was non-functional due to a change in an internal library interface which it had taken advantage of has been fixed to work. .BP od New options \fBO\fR, \fBX\fR, and \fBD\fR print 32 bit integers in octal hex and decimal format; an option \fBw\fR has been added to cause 132 column output rather than the default 80 column oriented output. .BP pc/pi Structured types may now exceed 65k bytes in size, but in that case may not be passed by value nor assigned by simple assignment. Structured types are properly returned from recursive functions. Minor bugs in passing function parameters have been fixed, and there still exist some more minor bugs here. Runtime tests can be now be enabled or disabled on a per routine basis. Runtime checks are now done properly on builtin functions. Warnings (or standards violations) are now produced for extensions to the language. Some inconsistencies in dealing with running out of memory have been fixed. A number of bugs in the symbol table produced for the symbolic debugger have been fixed. .IP Some bugs are known: invoking a formal routine from inside a formal invocation of the same routine will mess up. In pc only: linking seperately compiled modules from other than the current directory only works if you give full path names (or the same relative paths) for the compilation and the linking. .IP Some changes are planned soon: for-loop variables and with pointers will be allocated to registers. The formal routine syntax is currently as in Jensen and Wirth, but will soon be changed to the the syntax of the proposed standards, in which parameters to formals must be given. It is planned that \fBpc\fR will soon do compile time constant folding. .BP pmerge Is a new program which can convert large Pascal programs back into a single file, eliminating the header files and separate source files normally used for separate compilation. .BP prof A bug which caused prof to loop when a file-static function was profiled has been fixed. A bug in the kernel which caused the results of prof to be inaccurate has also been fixed. .BP ps Has been changed to work with the new kernel and is no longer dependent on system sizing; thus it is no longer necessary to recompile ps when the system tables are made larger. A bug in the \fBs\fR option which caused the computed stack size to be a constant 512 bytes too large has been fixed. The ``STAT'' field now shows ``>'' in the second position for programs which are using more memory than their \fImemoryuse\fR limit (see .IR vlimit (2)). It also shows ``S'' in the fourth position for processes which have declared themselves to be strongly sequential (see .IR vadvise (2)). Under the \fBv\fR option, the SWRSS field has been replaced by a new field ``LIM'' which shows the limit on \fImemoryuse\fR if there is a limit, or ``xx'' if there is not. .BP px Is now written in C, is much more portable, and shares the runtime library used by the compiler. It is, unfortunately, somewhat slower now. .BP ranlib No longer considers it a fatal error that an archive member defines no symbols. .BP reset Has been changed to invoke the command .RS .IP .B "tset \-Q \-I" .RE .IP so that all terminal modes will be reset. .BP rm Now has a .B \- option to indicate that all the following parameters are to be treated as file names. It can be used when file names begin with ``\fB\-''. .BP rmdir Now works correctly when arguments end in one or more ``/'' characters. .BP sdb Has been fixed to be able to deal with ``interrupt-stack-frames'', so that it is possible to set breakpoints on and get backtraces from routines called while a signal is being processed. Now handles binaries which are mode 0407 (resulting from ``ld \-N'') properly. .BP sh Has been changed so that ``#'' begins a comment. Shell scripts to be executed by /bin/sh should begin ``#! /bin/sh'' on the first line. .BP tar Now defaults to blocked tape and can update blocked tapes (finally!). When reading tape tar defaults to the raw tape and figures out what is going on with blocksize so it need not be specified. Thus the only commands which should be needed are the simple ``tar t'', ``tar c'', ``tar u'' and ``tar x''. .BP uusend Now uses the \fB\-r\fR option of \fIuux\fR to prevent presenting extreme load to the connected system. .BP vmstat Has been changed so that the system's device names are printed for the disks rather than D0, D1, D2, D3. The old format output of the .B \-i option is no longer available. .IP The fields related to paging activity are now all given in pages (of 1024 bytes). In particular, the fields ``pi'' and ``po'' which previously showed the number of pagein and pageout events now show pages, and ``sr'' which previously gave the clock scan rate in revolutions-per-minute now gives the scan rate in pages scanned per second. To provide the extra space needed to present this information, the swap in/out information, which was only marginally interesting, is no longer printed. .BP w Has been modified so that it no longer needs to be recompiled when the kernel tables change in size. .BP wall Now checks that the message is not too long for its internal buffer, rather than just overrunning the buffer. It handles running out of processes by pausing, so it is possible to use it when there are more than 25 users logged in and you are not the super-user. It also gives the machine name you are on in the broadcast messages. .BP who ``Who am I'' now prints your machine and login name (the first word of its output) in a format suitable for use with uucp. .BP write Now checks that you do not have write permission disabled and doesn't let you write to someone if they can't write back. .SH .LG .ce Section 2. .SM .sp .BP intro Now correctly reflects that argument lists may be upto 10240 characters long. .BP exec Has been changed so that if a file being executed begins with the magic characters #!, the rest of the line is understood to be the name of an interpreter for the executed file. Previously (and in fact still) the shell did much of this job; it automatically executed itself on a text file with executable mode when the text file's name was typed as a command. Putting the facility into the system gives the following benefits. .RS .IP 1) It makes shell scripts more like real executable files, because they can be the subject of 'exec.' .IP 2) If you do a 'ps' while such a command is running, its real name appears instead of 'sh'. Likewise, accounting is done on the basis of the real name. .IP 3) Shell scripts can be set-user-ID. .IP 4) It is simpler to have alternate shells available; e.g. if you like the Berkeley \fIcsh\fR there is no question about which shell is to interpret a file. .IP 5) It will allow other interpreters to fit in more smoothly. .RE .IP To take advantage of this wonderful opportunity, put .DS #! /bin/sh .DE .IP at the left margin of the first line of your shell scripts. Blanks after ! are OK. Use a complete pathname (no search is done). At the moment the whole line is restricted to 32 characters. A single argument may be specified for the interpreter, thus: .DS #! /bin/csh \-f .DE .IP is very useful, avoiding reading \fI.cshrc\fR which is often not wanted. .BP kill Has been changed so that when broadcasting signals universally the signal being broadcast is not sent to the broadcaster. This is used by the .IR halt (8), .IR shutdown (8), and .IR reboot (8) commands. .BP reboot Has been changed to reflect the now more limited number of option flags available to the system call due to the nature of the console interface on the VAX 11/750. .BP sigsys Reflects the fact that the system now passes in to a signal handler an indication of what exception really happened when a SIGFPE or SIGILL is generated. The call interface at the point of a signal handler call is now specified. .PP .SH .LG .ce Section 3 .SM .sp .PP .BP curses A large number of bug fixes have been incorporated, and the documentation has been greatly improved. The library is now much more solid than that originally distributed. .BP fopen Reflects the new open options which allow simultaneous read-write to files; these extensions are being incorporated to bring compatibility with the standard version 7 PDP-11 UNIX and to replace the (now defunct) \fB\-lNS\fR. .BP printf A bug in the documentation which incorrectly stated that a %c format would not put out a null character has been fixed. .SH .LG .ce Section 4 .SM .sp .PP The system now supports a number of new devices and has capability for detecting the device's presence and interrupt vectors at boot time. The system also has capability to do device location at boot time so that a system description as supplied to .IR config (8) can take advantage of available hardware redundancy. .PP Each configurable device driver in this section now includes a SYNOPSIS giving sample lines to be included in a system configuration. Drivers also indicate the error messages which they produce and describe each error. .PP .BP ct A driver for a C/A/T phototypesetter interface. .BP dh Now includes handling of dm-11 modem control hardware. Optional flags to the configuration program can also be given to supply sofware carrier easily for lines where wiring is inadequate. .BP dn A driver for the DEC DN-11 and Able Quadracall autodialer interfaces. .BP hp Includes rm80 support. .BP lp Drives standard line printers, and has been improved to cut the interrupt load by a factor of 20. .BP ((mt A driver for the DEC TU78 tape drive on the MASSBUS. .BP mtio Describes the standard tape drive interface, which now includes .B ioctl operations for raw magtape allowing such standard operations as forward and backward spacing over files and records, writing of end-of-file marks, rewinds, rewinding and offlining, and sensing of tape status. These operations are used by the .IR mt (1) program which can be used to easily manipulate tape files, and by the .IR tar (1) program to allow updates to blocked tapes. .BP ra A driver for the new DEC UDA50 disk controller with RA80 Winchester drives. .BP tm Supports the UNIBUS TM/11 emulating tape controllers (e.g. EMULEX TC-11 with a KENNEDY 9300 drive). .BP ts Supports the UNIBUS TS/11 tape drive and transport. .BP tty Now provides an LDECCTLQ option which causes ^S and ^Q to function as necessary for the VT100 to work properly. .BP tu The 11/750 TU58 console cassette interface. .BP up A driver for an EMULEX SC-11 or SC-21 UNIBUS disk controller with storage module (e.g. Ampex 9300) disk drives. . \".BP ut . \"A driver for UNIBUS/TU45 emulating tape controllers . \"(e.g. System Industries . \"Model 9700). .BP va A varian raster plotter. .SH .LG .ce Section 5 .SM .sp .ce No changes. .SH .LG .ce Section 6 .SM .sp .PP .BP chase Is a game where robots try to eat you. .BP hangman Is now screen oriented. .BP rain Drops keep falling on my head. .BP rogue Is a new and very popular screen-oriented game, see .IR rogue (6) or ``A Guide to the Dungeons of Doom.'' .BP worm Is a game where you see how long you can get the worm to grow. .BP worms Is an amusement where the worms chase each other around the screen. .SH .LG .ce Section 7 .SM .sp .ce No changes. .SH .LG .ce Section 8 .SM .NL .PP Major changes affecting system operations include: .IP * The system is configured from a single per-cpu specification file which includes all locally relevant information: desired devices, size of the maximum user load, timezone information, etc. The system determines at boot time the size of the file system buffer cache based on the amount of physical memory available and sizes the system data structures based on the specification of the maximum number of active users; it is no longer necessary to juggle an armful of constants to enlarge the system. The sizes of system tables are no longer compiled into programs such as .B ps and .B w. .IP * System error log information is saved across system crashes provided no power failure occurs, as the error log is kept in-core in the last 1024 bytes of memory. .\"Error messages to the console are in a new standard format, reminiscent .\"of Dave Presotto's speech pattern... they begin with a word, a laugh .\"encoded as `:' and go on wittily from there to speak the truth. Error messages to the console are in a standard format, of the form: .RS device: message .RE .IP Messages have error registers decoded as bits, so that they are readable, and no-longer refer to devices by their major/minor device numbers, rather using device names. Error messages about file system problems (device full, out of inodes, etc) are referred to with the mounted file system name, and a message is sent directly to a user if his/her process writes to a file system when it is full. All error diagnostics printed by drivers are documented in section 4 of the manual. .IP * DEC standard bad block forwarding is supported on all DEC disks except the RP06; the code which implements this can be easily moved into the drivers for the UNIBUS storage module disks; this is planned. .IP * Core dumps are saved after system crashes automatically as the system writes a core image to a portion of the swap area from which it is recovered after reboot. The system then transfers these core images to a specified UNIX directory, saving also the version of the system associated with the crash. The system also maintains an error log .B /usr/adm/shutdownlog which records all system crashes and reboots with the information about the causes. .sp .PP .BP analyze Now has an option .B \-u to print page numbers of the u. areas. A bug which prevented the distributed .B analyze from working has been fixed. .BP bad144 Is a new program which prints out the DEC-standard bad block information for a disk, or puts it back if it gets clobbered. The name of the program comes from the fact that the program deals with ``DEC standard 144'' format. .BP badsect Creates a file in a file system which contains a specified disk sector of that file system. This is a primitive way of dealing with bad sectors, but works on drivers which don't (yet) have bad block forwarding according to the standard. .BP getty No longer prints ``Virtual'' in front of the system identification, since there are no swap systems in sight anymore. .BP halt Now properly shuts down the system; see \fBreboot\fR below for details. .BP icheck Now properly sets the \fItfree\fR field in the super-block. .BP init Now interacts with \fBhalt\fR, \fBreboot\fR and \fBshutdown\fR to bring about orderly system shutdowns. No longer writes entries in the /usr/adm/wtmp accounting file when a \fIgetty\fR process dies without a user logging in on a terminal. Prints a warning message (on the console) if a terminal exists, is enabled, but the open returns an error, and waits for terminal to be openable, checking each minute, to prevent thrashing in this case. .BP last Now distinguishes between system shutdowns and system crashes. .BP lastcomm A bug causing a core dump if user id's not present in the password file were encountered has been fixed. .BP login Now interacts with the shutdown command to forbid logins (except by the super-user) in the last 5 minutes before a shutdown (detected by the presence of the file /etc/nologin, which also contains a message about why the system is shutting down which is presented to the rejected users.) Implements a notion of ``secure terminals''; if the file /etc/securetty exists, then it should contain a list of the secure terminals where root is allowed to login. If this file does not exist, then root can log in anywhere, as before. If a user tries to login but can't get to their home directory they are left in the root directory and warned, so that they have some chance to send mail about or fix the problem themselves. If a file \fI.hushlogin\fR exists in a users home directory the the message of the day and other such information designed for human users will not be printed at login time. This is specifically designed for the user \fIuucp\fR which is another computer and just ignores such stuff anyways. Finally a bug has been fixed which cause \fBlogin\fR to core dump if there were tabs in the file /etc/ttytype. .BP mkfs Now works properly when given a \fIproto\fR argument; previously it complained because it didn't know that the format of the file /usr/mdec/uboot had been changed. .BP pstat Has new flags \fB\-m\fR and \fB\-g\fR which interpret the multiplexor data structures. .BP reboot Now shuts the system down cleanly, stopping all system activity before initiating the reboot procedure. Normally, however, the new .B shutdown command is used to take the system down, notifying the users of the impending downtime. The options .B \-s and .B \-a options to reboot are no longer available, as it will not be possible to provide them on all VAX cpu's due to the way the console interface works. Instead, you can halt the processor using .B halt which puts the system into a tight loop, and then perform the desired reboot sequence manually at the console. This works on both 11/750 and 11/780 processors. .BP renice Has been modified for the new kernel and is no longer dependent on system configuration parameters; it no longer needs to be recompiled when system table sizes change. .BP restor Now properly handles the case where dump files are contained in dump tapes; previously the end of the embedded dump would confuse \fBrestor\fR and cause the rest of the dump tape to be inaccessible. .BP sa Now correctly handles an arbitrary number of commands and users. Two new options have been added \fB\-v\fR and \fB\-f\fR giving it a googol+2 options. See .IR sa (8) for details. .BP savecore Is a new program which runs after a reboot to check to see if the system had crashed and, if it had, to save any core image which was successfully written to the paging area. See .IR savecore (8) for a full description. .BP shutdown Is a new command which shuts the system down at a specified time. It broadcasts messages to users warning them as the downtime approaches, records the reason for the reboot in a log file, and cooperates with init in a clean shutdown (e.g. during the last 5 minutes of system operation, users attempting to log in are told that the system is going down and the reason for the shutdown but not allowed to log in.) successfully written to the paging area. See .IR savecore (8) for a full description. .BP shutdown Is a new command which shuts the system down at a specified time. It broadcasts messages to users warning them as the downtime approaches, records the reason for the reboot in a log file, and cooperates with init in a clean shutdown (e.g. during the last 5 minutman/man0/comm.sed 644 0 33 70 2512730451 7025 :x N /\( [^ ]*\)\n.*\1$/{ s/\n.*// bx } P s/.*\n// bx old that the system is going down and the reason for the shutdown but not allowed to log in.) successfully written to the paging area. See .IR savecore (8) for a full description. .BP shutdown Is a new command which shuts the system down at a specified time. It broadcasts messages to users warning them as the downtime approaches, records the reason for the rebo/( ,( 5Ċ /\@,\D"((man/man0/copyr 644 0 33 552 2512730451 6501 ...fp 3 G .ll 4.8i .in .75i .hy 0 .vs 12p -- .sp |8i Copyright 1979, Bell Telephone Laboratories, Incorporated. Holders of a UNIX\v'-4p'\s-2\fGTM\fP\s0\v'4p'/32V software license are permitted to copy this document, or any portion of it, as necessary for licensed use of the software, provided this copyright notice and statement of permission are included. .bp s the downtime approaches, records the reason for the rebo/( ,( 5 Ċ /\@,\D"man/man0/cshcmd 644 0 33 4125 2512730451 6626 csh(1) alias: shell macros. csh(1) bg: place job in background. csh(1) break: exit while/foreach loop. csh(1) breaksw: exit from switch. csh(1) case: selector in switch. csh(1) cd: change directory. csh(1) chdir: change directory. csh(1) continue: cycle in loop. csh(1) default: catchall clause in switch. csh(1) echo: echo arguments. csh(1) else: alternative commands. csh(1) end: terminate loop. csh(1) endif: terminate conditional. csh(1) endsw: terminate switch. csh(1) eval: re-evaluate shell data. csh(1) exec: overlay shell with specified command. csh(1) exit: leave shell. csh(1) fg: bring job into foreground. csh(1) foreach: loop over list of names. csh(1) glob: filename expand argument list. csh(1) goto: command transfer. csh(1) hashstat: print command hashing statistics. csh(1) history: print history event list. csh(1) if: conditional statement. csh(1) jobs: print current job list. csh(1) kill: kill jobs and processes. csh(1) limit: alter per-process resource limitations. csh(1) login: login new user. csh(1) logout: end session. csh(1) nice: run low priority process. csh(1) nohup: run command immune to hangups. csh(1) notify: request immediate notification. csh(1) onintr: process interrupts in command scripts. csh(1) popd: pop shell directory stack. csh(1) pushd: push shell directory stack. csh(1) rehash: recompute command hash table. csh(1) repeat: execute command repeatedly. csh(1) set: change value of shell variable. csh(1) setenv: set variable in environment. csh(1) shift: manipulate argument list. csh(1) source: read commands from file. csh(1) stop: halt a job or process. csh(1) suspend: suspend a shell, resuming its superior. csh(1) switch: multi-way command branch. csh(1) time: time command. csh(1) umask: change or display file creation mask. csh(1) unalias: remove aliases. csh(1) unhash: discard command hash table. csh(1) unlimit: remove resource limitiations. csh(1) unsetenv: remove environment variables. csh(1) unset: discard shell variables. csh(1) wait: wait for background processes to complete. csh(1) while: repeat commands conditionally. csh(1) @: arithmetic on shell variables. d: suspend a shell, resuming its superior. csh(1) switch: multi-way command branch. csh(1) time: time command. csh(1) umask: change or display file creation mask. csh(1) unalias: remove aliases. csh(1) unhash: discard command hash table. csh(1) unlimit: remove resource limitiations. csh(1) unsetenv: remove environment variables. csh(1) unset: discard shell variables. csh(1) wait: wait for background processes to complete. cman/man0/cshwhatis 644 0 33 3705 2512730452 7366 .TH CSH 1 csh \- alias: shell macros. .TH CSH 1 csh \- break: exit while/foreach loop. .TH CSH 1 csh \- breaksw: exit from switch. .TH CSH 1 csh \- case: selector in switch. .TH CSH 1 csh \- cd: change directory. .TH CSH 1 csh \- chdir: change directory. .TH CSH 1 csh \- continue: cycle in loop. .TH CSH 1 csh \- default: catchall clause in switch. .TH CSH 1 csh \- echo: echo arguments. .TH CSH 1 csh \- else: alternative commands. .TH CSH 1 csh \- end: terminate loop. .TH CSH 1 csh \- endif: terminate conditional. .TH CSH 1 csh \- endsw: terminate switch. .TH CSH 1 csh \- exec: overlay shell with specified command. .TH CSH 1 csh \- exit: leave shell. .TH CSH 1 csh \- foreach: loop over list of names. .TH CSH 1 csh \- glob: filename expand argument list. .TH CSH 1 csh \- goto: command transfer. .TH CSH 1 csh \- hashstat: print command hashing statistics. .TH CSH 1 csh \- history: print history event list. .TH CSH 1 csh \- if: conditional statement. .TH CSH 1 csh \- login: login new user. .TH CSH 1 csh \- logout: end session. .TH CSH 1 csh \- nice: run low priority process. .TH CSH 1 csh \- nohup: run command immune to hangups. .TH CSH 1 csh \- onintr: process interrupts in command scripts. .TH CSH 1 csh \- rehash: recompute command hash table. .TH CSH 1 csh \- repeat: execute command repeatedly. .TH CSH 1 csh \- set: change value of shell variable. .TH CSH 1 csh \- setenv: set variable in environment. .TH CSH 1 csh \- shift: manipulate argument list. .TH CSH 1 csh \- source: read commands from file. .TH CSH 1 csh \- switch: multi-way command branch. .TH CSH 1 csh \- time: time command. .TH CSH 1 csh \- umask: change or display file creation mask. .TH CSH 1 csh \- unalias: remove aliases. .TH CSH 1 csh \- unhash: discard command hash table. .TH CSH 1 csh \- unset: discard shell variables. .TH CSH 1 csh \- wait: wait for background processes to complete. .TH CSH 1 csh \- while: repeat commands conditionally. .TH CSH 1 csh \- @: arithmetic on shell variables. CSH 1 csh \- source: read commands from file. .TH CSH 1 cshman/man0/ignore 644 0 33 622 2512730452 6627 10 11 16 201 3 4014 77 a after al al all allow among an and another back between bits dialect do et extreme facts feeds fitting for from general get head in integer integers interval into intro is knowledge large last later local long low map o of off on or other out package part periodically pieces prejudice problem service simple special system tac the this to toe turn two until way with yet your .TH CSH 1 csh \- @/( ,( 5PĊ /\@,\D"man/man0/intro 644 0 33 66322 2512730452 6550 .af PN i .pn 5 .de IR \fI\\$1\^\fR\\$2 .. .de RI \fR\\$1\fI\\$2\^\fR\\$3 .. .TL INTRODUCTION TO VOLUME 1 .LP This volume gives descriptions of the publicly available features of the .UX \s-2/32V\s0 system, as extended to provide a virtual memory environment and other enhancements at U. C. Berkeley. It does not attempt to provide perspective or tutorial information upon the .UX operating system, its facilities, or its implementation. Various documents on those topics are contained in Volume 2. In particular, for an overview see `The .UX Time-Sharing System' by Ritchie and Thompson; for a tutorial see `\s8UNIX\s10 for Beginners' by Kernighan, and for an guide to the new features of this virtual version, see `Getting started with Berkeley Software for \s8UNIX\s10 on the \s8VAX\s10' in volume 2c. .LP Within the area it surveys, this volume attempts to be timely, complete and concise. Where the latter two objectives conflict, the obvious is often left unsaid in favor of brevity. It is intended that each program be described as it is, not as it should be. Inevitably, this means that various sections will soon be out of date. .LP The volume is divided into eight sections: .DS 1. Commands 2. System calls 3. Subroutines 4. Special files 5. File formats and conventions 6. Games 7. Macro packages and language conventions 8. Maintenance commands and procedures .DE Commands are programs intended to be invoked directly by the user, in contradistinction to subroutines, which are intended to be called by the user's programs. Commands generally reside in directory .I /bin (for .IR bin \|ary programs). Some programs also reside in .I /\|usr/\|bin, .R or in .I /\|usr/\|ucb, .R to save space in .I /bin. These directories are searched automatically by the command interpreters. .LP System calls are entries into the .UX supervisor. The system call interface is identical to a C language procedure call; the equivalent C procedures are described in Section 2. .LP An assortment of subroutines is available; they are described in section 3.(( The primary libraries in which they are kept are described in .IR intro (3). The functions are described in terms of C, but most will work with Fortran as well. .LP The special files section 4 discusses the characteristics of each system `file' that actually refers to an I/O device. The names in this section refer to the DEC device names for the hardware, instead of the names of the special files themselves. .LP The file formats and conventions section 5 documents the structure of particular kinds of files; for example, the form of the output of the loader and assembler is given. Excluded are files used by only one command, for example the assembler's intermediate files. .LP Games have been relegated to section 6 to keep them from contaminating the more staid information of section 1. .LP Section 7 is a miscellaneous collection of information necessary to writing in various specialized languages: character codes, macro packages for typesetting, etc. .LP The maintenance section 8 discusses commands and procedures not intended for use by the ordinary user. The commands and files described here are almost all kept in the directory .I /etc. .LP Each section consists of a number of independent entries of a page or so each. The name of the entry is in the upper corners of its pages, together with the section number, and sometimes a letter characteristic of a subcategory, e.g. graphics is 1G, and the math library is 3M. Entries within each section are alphabetized. The page numbers of each entry start at 1; it is infeasible to number consecutively the pages of a document like this that is republished in many variant forms. .LP All entries are based on a common format, not all of whose subsections will always appear. .RS .LP The .I name subsection lists the exact names of the commands and subroutines covered under the entry and gives a very short description of their purpose. .LP The .IR synopsis "" summarizes the use of the program being described. A few conventions are used, particularly in the Commands subsection: .LP .RS .B Boldface words are considered literals, and are typed just as they appear. .LP Square brackets [ ] around an argument indicate that the argument is optional. When an argument is given as `name', it always refers to a file name. .LP Ellipses `.\|.\|.' are used to show that the previous argument-prototype may be repeated. .LP A final convention is used by the commands themselves. An argument beginning with a minus sign `\-' is often taken to mean some sort of option-specifying argument even if it appears in a position where a file name could appear. Therefore, it is unwise to have files whose names begin with `\-'. .LP .RE The .IR description "" subsection discusses in detail the subject at hand. .LP The .IR files "" subsection gives the names of files which are built into the program. .LP A .I see also .R subsection gives pointers to related information. .LP A .I diagnostics subsection discusses the diagnostic indications which may be produced. Messages which are intended to be self-explanatory are not listed. .LP The .IR bugs "" subsection gives known bugs and sometimes deficiencies. Occasionally also the suggested fix is described. .LP In section 2 an .I assembler subsection carries the PDP-11 assembly-language system interface. .LP .RE At the beginning of the volume is a table of contents, organized by section and alphabetically within each section. There is also a permuted index derived from the table of contents. Within each index entry, the title of the writeup to which it refers is followed by the appropriate section number in parentheses. This fact is important because there is considerable name duplication among the sections, arising principally from commands which exist only to exercise a particular system call. .SH HOW TO GET STARTED .LP This section sketches the basic information you need to get started on .UX how to log in and log out, how to communicate through your terminal, and how to run a program. See `\c .UX for Beginners' in Volume 2 for a more complete introduction to the system. .LP .I Logging in.\ \ .R You must call .UX from an appropriate terminal. Most any ASCII terminal capable of full duplex operation and generating the entire character set can be used. You must also have a valid user name, which may be obtained, together with necessary telephone numbers, from the system administration. After a data connection is established, the login procedure depends on what kind of terminal you are using. .I .I .R .R .LP .I 300-baud terminals:\ \ .R Such terminals include the GE Terminet 300, and most display terminals run with popular modems. These terminals generally have a speed switch which should be set at `300' (or `30' for 30 characters per second) and a half/full duplex switch which should be set at full-duplex. (This switch will often have to be changed since many other systems require half-duplex). When a connection is established, the system types `login:'; you type your user name, followed by the `return' key. If you have a password, the system asks for it and turns off the printer on the terminal so the password will not appear. After you have logged in, the `return', `new line', or `linefeed' keys will give exactly the same results. .LP .I 1200- and 150-baud terminals:\ \ .R If there is a half/full duplex switch, set it at full-duplex. When you have established a data connection, the system types out a few garbage characters (the `login:' message at the wrong speed). Depress the `break' (or `interrupt') key; this is a speed-independent signal to .UX that a different speed terminal is in use. The system then will type `login:,' this time at another speed. Continue depressing the break key until `login:' appears in clear, then respond with your user name. From the TTY 37 terminal, and any other which has the `newline' function (combined carriage return and linefeed), terminate each line you type with the `new line' key, otherwise use the `return' key. .LP .I Hard-wired terminals.\ \ .R Hard-wired terminals usually begin at the right speed, up to 9600 baud; otherwise the preceding instructions apply. .LP For all these terminals, it is important that you type your name in lower-case if possible; if you type upper-case letters, .UX will assume that your terminal cannot generate lower-case letters and will translate all subsequent upper-case letters to lower case. .LP The evidence that you have successfully logged in is that a shell program will type a prompt (`$' or `%') to you. (The shells are described below under `How to run a program.') .LP For more information, consult .IR tset (1), and .IR stty (1), which tell how to adjust terminal behavior, .IR getty (8), which discusses the login sequence in more detail, and .IR tty (4), which discusses terminal I/O. .LP .I Logging out.\ \ .R There are three ways to log out: .IP By typing an end-of-file indication (EOT character, control-d) to the Shell. The Shell will terminate and the `login: ' message will appear again. .IP You can log in directly as another user by giving a .IR login (1) command. .IP If worse comes to worse, you can simply hang up the phone; but beware \- some machines may lack the necessary hardware to detect that the phone has been hung up. Ask your system administrator if this is a problem on your machine. .LP .I How to communicate through your terminal.\ \ .R When you type characters, a gnome deep in the system gathers your characters and saves them in a secret place. The characters will not be given to a program until you type a return (or newline), as described above in .I Logging in. .R .LP .UX terminal I/O is full-duplex. It has full read-ahead, which means that you can type at any time, even while a program is typing at you. Of course, if you type during output, the printed output will have the input characters interspersed. However, whatever you type will be saved up and interpreted in correct sequence. There is a limit to the amount of read-ahead, but it is generous and not likely to be exceeded unless the system is in trouble. When the read-ahead limit is exceeded, the system throws away all the saved characters (or beeps, if your prompt was a %). .LP The character `@' in typed input kills all the preceding characters in the line, so typing mistakes can be repaired on a single line. Also, the character `#' erases the last character typed. (Most users prefer to use a backspace rather than `#', and many prefer control-U instead of `@'; .IR tset (1) or .IR stty (1) can be used to arrange this.) Successive uses of `#' erase characters back to, but not beyond, the beginning of the line. `@' and `#' can be transmitted to a program by preceding them with `\\'. (So, to erase `\\', you need two `#'s). .LP The `break' or `interrupt' key causes an .I interrupt signal, .R as does the \s8ASCII\s10 `delete' (or `rubout') character, which is not passed to programs. This signal generally causes whatever program you are running to terminate. It is typically used to stop a long printout that you don't want. However, programs can arrange either to ignore this signal altogether, or to be notified when it happens (instead of being terminated). The editor, for example, catches interrupts and stops what it is doing, instead of terminating, so that an interrupt can be used to halt an editor printout without losing the file being edited. Many users change this interrupt character to be ^C (control-C) using \fIstty\fR(1). .LP It is also possible to suspend output temporarily using ^S (control-s) and later resume output with ^Q. In a newer terminal driver, it is possible to cause output to be thrown away without interrupting the program by typing ^O; see .IR newtty (4). .LP The .IR quit "" signal is generated by typing the \s8ASCII\s10 FS character. (FS appears many places on different terminals, most commonly as control-\e or control-\^|\^.) It not only causes a running program to terminate but also generates a file with the core image of the terminated process. Quit is useful for debugging. .LP Besides adapting to the speed of the terminal, .UX tries to be intelligent about whether you have a terminal with the newline function or whether it mus((t be simulated with carriage-return and line-feed. In the latter case, all input carriage returns are turned to newline characters (the standard line delimiter) and both a carriage return and a line feed are echoed to the terminal. If you get into the wrong mode, the .IR reset (1) command will rescue you. .LP Tab characters are used freely in .UX source programs. If your terminal does not have the tab function, you can arrange to have them turned into spaces during output, and echoed as spaces during input. The system assumes that tabs are set every eight columns. Again, the .IR tset (1) or .IR stty (1) command will set or reset this mode. .IR Tset (1) can be used to set the tab stops automatically when necessary. .LP .I How to run a program; the shells.\ \ .R When you have successfully logged in, a program called a shell is listening to your terminal. The shell reads typed-in lines, splits them up into a command name and arguments, and executes the command. A command is simply an executable program. The Shell looks in several system directories to find the command. You can also place commands in your own directory and have the shell find them there. There is nothing special about system-provided commands except that they are kept in a directory where the shell can find them. .LP The command name is always the first word on an input line; it and its arguments are separated from one another by spaces. .LP When a program terminates, the shell will ordinarily regain control and type a prompt at you to indicate that it is ready for another command. .LP The shells have many other capabilities, which are described in detail in sections .IR sh (1) and .IR csh (1). If the shell prompts you with `$', then it is an instance of .IR sh (1) the standard Bell-labs provided shell. If it prompts with `%' then it is an instance of .IR csh (1) a shell written at Berkeley. The shells are different for all but the most simple terminal usage. Most users at Berkeley choose .IR csh (1) because of the .I history mechanism and the .I alias feature, which greatly enhance its power when used interactively. .I Csh also supports the job-control facilities new to this release of the system. See .IR newcsh (1) or the Csh introduction in volume 2C for details. .LP You can change from one shell to the other by using the .I chsh (1) command, which takes effect at your next login. .LP .I The current directory.\ \ .R .UX has a file system arranged in a hierarchy of directories. When the system administrator gave you a user name, he also created a directory for you (ordinarily with the same name as your user name). When you log in, any file name you type is by default in this directory. Since you are the owner of this directory, you have full permission to read, write, alter, or destroy its contents. Permissions to have your will with other directories and files will have been granted or denied to you by their owners. As a matter of observed fact, few .UX users protect their files from perusal by other users. .LP To change the current directory (but not the set of permissions you were endowed with at login) use .IR cd (1). .LP .I Path names.\ \ .R To refer to files not in the current directory, you must use a path name. Full path names begin with `/', the name of the root directory of the whole file system. After the slash comes the name of each directory containing the next sub-directory (followed by a `/') until finally the file name is reached. For example, .I /\^usr/\^lem/\^filex .R refers to the file .I filex .R in the directory .I lem; lem .R is itself a subdirectory of .I usr; usr .R springs directly from the root directory. .LP If your current directory has subdirectories, the path names of files therein begin with the name of the subdirectory with no prefixed `/'. .LP A path name may be used anywhere a file name is required. .LP Important commands which modify the contents of files are .IR cp (1), .IR mv (1), and .IR rm (1), which respectively copy, move (i.e. rename) and remove files. To find out the status of files or directories, use .IR ls (1). See .IR mkdir (1) for making directories and .I rmdir .R (in .IR rm (1)) for destroying them. .LP For a fuller discussion of the file system, see `The .UX Time-Sharing System,' by Ken Thompson and Dennis Ritchie. It may also be useful to glance through section 2 of this manual, which discusses system calls, even if you don't intend to deal with the system at that level. .LP .I Writing a program.\ \ .R To enter the text of a source program into a .UX file, use the editor .IR ex (1) or its display editing alias .IR vi (1). (The old standard editor .IR ed (1) is also available.) The principal languages in .UX are provided by the C compiler .IR cc (1), the Fortran compiler .IR f77 (1), the Pascal compiler .IR pc (1), and interpreter .IR pi (1) and .IR px (1), the Lisp system .IR lisp (1), and the APL system .IR apl (1). After the program text has been entered through the editor and written on a file, you can give the file to the appropriate language processor as an argument. The output of the language processor will be left on a file in the current directory named `a.out'. (If the output is precious, use .I mv to move it to a less exposed name soon.)\ .LP When you have finally gone through this entire process without provoking any diagnostics, the resulting program can be run by giving its name to the shell in response to the shell (`$' or `%') prompt. .LP Your programs can receive arguments from the command line just as system programs do, see .IR exec (2). .LP .I Text processing.\ \ .R Almost all text is entered through the editor .IR ex (1) (often entered via .IR vi (1)). The commands most often used to write text on a terminal are: .I cat, pr, more .R and .I nroff, all in section 1. .LP The .I cat command simply dumps \s8ASCII\s10 text on the terminal, with no processing at all. The .IR pr "" command paginates the text, supplies headings, and has a facility for multi-column output. .I Nroff .R is an elaborate text formatting program. Used naked, it requires careful forethought, but for ordinary documents it has been tamed; see .IR me (7) and .IR ms (7). .I .LP .I Troff prepares documents for a Graphics Systems phototypesetter or a Versatec Plotter; it is very similar to .I nroff, and often works from exactly the same source text. It was used to produce this manual. .LP .IR Script (1) lets you keep a record of your session in a file, which can then be printed, mailed, etc. It provides the advantages of a hard-copy terminal even when using a display terminal. .LP .IR More (1) is useful for preventing the output of a command from zipping off the top of your screen. It is also well suited to perusing files. .LP .I Status inquiries.\ \ .R Various commands exist to provide you with useful information. .IR w (1) prints a list of users presently logged in, and what they are doing. .IR date (1) prints the current time and date. .IR ls (1) will list the files in your directory or give summary information about particular files. .LP .I Surprises.\ \ .R Certain commands provide inter-user communication. Even if you do not plan to use them, it would be well to learn something about them, because someone else may aim them at you. .LP To communicate with another user currently logged in, .IR write (1) is used; .IR mail (1) will leave a message whose presence will be announced to another user when he next logs in. The write-ups in the manual also suggest how to respond to the two commands if you are a target. .LP If you use .IR csh (1) the key ^Z (control-Z) will cause jobs to ``stop''. If this happens before you learn about it, you can simply continue by saying ``fg'' (for foreground) to bring the job back. .PP When you log in, a message-of-the-day may greet you before the first prompt. .SH CONVERTING FROM THE 6TH EDITION .LP There follows a catalogue of significant, mostly incompatible, changes that will affect old users converting from the sixth edition on a PDP-11. No attempt is made to list all new facilities, or even all minor, but easily spotted changes, just the bare essentials without which it will be almost impossible to do anything. .LP .I Addressing files.\ \ .R Byte addresses in files are now long (32-bit) integers. Accordingly .I seek has been replaced by .IR lseek (2). Every program that contains a .I seek must be modified. .I Stat and .IR fstat (2) have been affected similarly, since file lengths are now 32- rather than 24-bit quantities. .LP .I Assembly language.\ \ .R This language is dead. Necromancy will be severely punnished. .LP .I Stty and .I gtty.\ \ .R These system calls have been extensively altered, see .IR ioctl (2) and .IR tty (4). .LP .I C language, lint.\ \ .R The syntax for initialization requires an equal sign = before an initializer, and brackets { } around compound initial values; arrays and structures are now initialized honestly. Assignment operators such as =+ and =\- are now written in the reverse order: +=, \-=. This removes the possibility of ambiguity in constructs such as x=\-2, y=*p, and a=/*b. You will also certainly want to learn about .DS long integers type definitions casts (for type conversion) unions (for more honest storage sharing) #include (which searches in standard places) .DE .LP The program .IR lint (1) checks for obsolete syntax and does strong type checking of C programs, singly or in groups that are expected to be loaded together. It is indispensable for conversion work. .LP .I Fortran.\ \ The old .I fc is replaced by .I f77, a true compiler for Fortran 77, compatible with C. There are substantial changes in the language; see `A Portable Fortran 77 Compiler' in Volume 2. .LP .I Stream editor.\ \ .R The program .IR sed (1) is adapted to massive, repetitive editing jobs of the sort encountered in converting to the new system. It is well worth learning. .LP .I Standard I/O.\ \ .R The old .I fopen, getc, putc .R complex and the old .I \-lp package are both dead, and even .I getchar has changed. All have been replaced by the clean, highly efficient, .IR stdio (3) package. The first things to know are that .IR getchar (3) returns the integer EOF (\-1) (w((hich is not a possible byte value) on end of file, that 518-byte buffers are out, and that there is a defined FILE data type. .LP .I Make.\ \ The program .IR make (1) handles the recompilation and loading of software in an orderly way from a `makefile' recipe given for each piece of software. It remakes only as much as the modification dates of the input files show is necessary. The makefiles will guide you in building your new system. .LP .I Shell, chdir.\ \ .R F. L. Bauer once said Algol 68 is the Everest that must be climbed by every computer scientist because it is there. So it is with the shell for .UX users. Everything beyond simple command invocation from a terminal is different. Even .I chdir is now spelled .I cd. If you wish to use .I sh (as opposed to .IR csh ) then you will want to study .IR sh (1) long and hard. .LP .I "C shell" .\ \ .IR Csh (1), developed at Berkeley, has features comparible to .IR sh . It includes a history mechanism that saves you from retyping all or part of previous commands, as well as an efficient aliasing (macro) mechanism. The job control facilities of the system, which make the system much more pleasant to use, are currently available only with .I csh. See .IR newcsh (1) for a description. These features make .I csh pleasant to use interactively. .I Csh programs have a syntax reminiscent of .I C, while .I sh command programs have a syntax reminiscent of \s-2ALGOL\s0-68. .LP .I Debugging.\ \ .IR Sdb (1) is a far more capable replacement for the debugger .I cdb, and debugs C and Fortran at the source level. For machine language debugging, .I adb replaces .I db. The first-time user should be especially careful about distinguishing / and ? in .I adb commands, and watching to make sure that the .I x whose value he asked for is the real .I x, and not just some absolute location equal to the stack offset of some automatic .I x. You can always use the `true' name, .I _x, to pin down a C external variable. .LP .I Dsw. This little-known, but indispensable facility has been taken over by .I rm \-ri. .LP .I Boot procedures.\ \ .R Needless to say, these are all different. See section 8 of this volume, and the other documentation you should have received with your tape. .SH CONVERTING FROM THE DECEMBER, 1979 BERKELEY DISTRIBUTION .PP There have been a number of significant changes and improvements in the system. This list just gives the bare essentials: .LP .I C language changes.\ \ .R The C compiler now accepts and checks essentially arbitrary length identifiers and preprocessor names. There is a new type available in type casts: \fBvoid\fR which signifies that a value is to be ignored. It is useful in keeping lint happy about values which are not used (especially values returned from procedures). Finally, the language has been changed so that field names need not be unique to structures; on the other hand, the compiler insists that you be more honest about types involved in pointer constructs or it will warn you. .LP .I Object file format.\ \ .R The object file format has been changed to include a string table, so that language compilers may have names longer than 8 characters in their resulting \fIa.out\fR files. Old \fI.o\fR files must be recreated. \fIA.out\fR files will still run on both this and the December 1979 version of the system; only the symbol tables are incompatible. .LP .I Archive format and table of contents.\ \ .R The archive format has been changed to one which is portable between the VAX and other machines (e.g. the PDP-11). Old \s-2VAX\s0 archives should be converted with .IR arcv (8); loader archives should just be recreated since the object files are also obsolete. Loader archives should have table-of-contents added by .IR ranlib (1); if they dont the loader will gripe when they are used. See also .IR old (8). .LP .I New tty driver, job control facilities and csh.\ \ .R Hand in hand are new job control facilities, a new tty driver and a new version of the C shell which supports and uses all of this. See .IR newtty (4) and .IR newcsh (1) for a quick introduction. You should use .I oldcsh until you learn about the new facilities. .LP .I Pascal compiler.\ \ .R There is a true Pascal compiler, .IR pc (1) which allows separate compilation as well as mixing in of FORTRAN and C code. .LP .I Error analyzer.\ \ .R There is an error analyzer program .IR error (1), which takes a set of error message and merges them back into the source files at the point of error. It can be used interactively to avoid inserting errors which are uninteresting. This program eliminates once and for all making lists of errors on small scraps of paper. .LP .I Mail forwarding.\ \ .R The system now provides mail forwarding and distribution facilities. Group and aliases are defined in the file .I /usr/lib/aliases see .IR aliases (5). If you change this file you will have to rerun .IR newaliases (1). For any particular system a table in the source of the .I delivermail postman program may have to be changed so that it knows about the gateways on the local machine. .LP .I System bootstrap procedures.\ \ .R These are totally changed; the system performs automatic reboots and preens the disks automatically at reboot. You should reread the appropriate pages in section 8 if you deal with system reboots. usr/lib/aliases see .IR aliases (5). If you change this file you will have to rerun .IR newaliases (1). For any particular system a table in the source of the .I delivermail postman program may have to be changed so that it knows about the gateways on the local machine. .LP .I System bootstrap proceduman/man0/m1.sed 644 0 33 1720 2512730452 6453 :x s/``/`/g s/''/'/g s/\\\*-/\\-/g s/\\\*a/\\'/g s/\\\*g/\\`/g s/\\\*_/_/g s/\\\*v/\\(bv/g s/\\\*X/\\(mu/g s/\\\*>/\\(->/g s/\\\*b/\\(*b/g s/\\\*p/\\(*p/g s/\\\*G/\\(*G/g s/\\\*r/\\*R/g s/\\\*u/\\(*m/g /^\.li/{ N p d } s/^\.dt/.DT/ s/^\.th/.TH/ s/^\.sh/.SH/ s/^\.it/.I/ s/^\.bd/.B/ s/^\.Bd/.bd/ /^\.lp/{ s/.lp/.br\ .ns\ .Lp/ P D } /^\.s[123]/{ N /\n\.i0/s/.*/.PP/ /\n\.lp/s/.*\n// /s[123]/{ s//DP/ P D } } /^\.i0/{ N /\.s[123]/s/.*/.PP/ s/.i0.*\n// } s/^\.Lp/.lp/ /^\.lp/{ / *0 *$/{ s/// s/lp *+/IP "" / p d } s/ *+/ / s/ *[^ ]* *$// N / /!{ s/lp/HP/ } s/^.lp/.TP/ s/ /\ / P D } /^\.I *[^ ]*$/{ N s/^.I\(.*\)\n\(([IVX][ALMIVXSZ]*)[^ ]*\) */.IR \1 \2\ / s/\n$// P D } s/ \(([IVX][ALMIVXSZ]*)\)/\1/g /^\\f/{ s/\\f/@/g s/@P/@R/g s/^@\(.\)\([^@\n]*\)@\(.\)\([^@\n]*\)@\1\([^\n]*\)/.\1\3 "\2" "\4" "\5"/ s/^@\(.\)\([^@\n]*\)@\(.\)\([^\n]*\)/.\1\3 "\2" "\4"/ s/^@\(.\)\([^\n]*\)/.\1 "\2"/ s/@R"$/"/ s/@R"\n/"\ / s/@/\\f/g } P D \n// } s/^\.Lp/.lp/ /^\.lp/{ / *0 *$/{ s/// man/man0/m2.sed 644 0 33 665 2512730452 6443 /^[^.].*\\f/{ s/\\f/@/g s/@P/@R/g s/ @\(.\)\([^@]*\)@R\([^ @]*\) */\ .\1R "\2" "\3"\ / s/ @\(.\)\([^@]*\)@R\([^ @]*\) *$/\ .\1R "\2" "\3"/ s/@\(.\) \([^@]*\)@R\([^ @]*\) */\ .\1R "\2" "\3"\ / s/@\(.\) \([^@]*\)@R\([^ @]*\) *$/\ .\1R "\2" "\3"/ s/@/\\f/g } /^\.[TH]P/,/^\.PP/s/^\.DP/.IP/ s/^\.DP/.PP/ /^\.[BIR][BIR]/s/[ ]*""$// /^\.\([BIR]\)[BIR][^"]*"[^"]*"$/s/.\(.\)./.\1 / :x /^\.[^"]*"[^" ][^" ]*"/{ s/"// s/// bx } P D ,( 5Ċ /\@,\D"man/man0/makefile 644 0 33 43 2512730452 7076 all: clean: rm -f toc? tocx? ptxx s/ @\(.\)\([^@]*\)@R\([^ @]*\) */\ .\1R "\2" "\3"\ / s/ @\(.\)\([^@]*\)@R\([^ @]*\) *$/\ .\1R "\2" "\3"/ s/@\(.\) \([^@]*\)@R\([^ @]*\) */\ .\1R "\2" "\3"\ / s/@\(.\) \([^@]*\)@R\([^ @]*\) *$/\ .\1R "\2" "\3"/ s/@/\\f/g } /^\.[TH]P/,/^\.PP/s/^\.DP/.IP/ s/^\.DP/.PP/ /^\.[BIR][BIR]/s/[ ]*""$// /^\.\([BIR]\)[BIR][^"]*"[^"]*"$/s/.\(.\)./.\1 / :x /^\.[^"]*"[^" ][^" ]*"/{ s/"///( ,( 5Ċ /\@,\D"man/man0/pref 644 0 33 14354 2574152173 6355 .nr PS 9 .nr VS 11 .vs 11p .ps 9p .af PN i .TL PREFACE .LP This update to the fourth distribution of November 1980 provides support for the VAX 11/750 and for the full interconnect architecture of the VAX 11/780. Robert Elz of the University of Melbourne contributed greatly to this distribution especially in the boot-time system configuration code; Bill Shannon of DEC supplied us with the implementation of DEC standard bad block handing. The research group at Bell Laboratories and DEC Merrimack provided us(( with access to 11/750's in order to debug its support. .LP Other individuals too numerous to mention provided us with bug reports, fixes and other enhancements which are reflected in the system. We are ever grateful to the UNIX user community for encouragement and support. .LP The financial support of the Defense Advanced Research Projects Agency in support of this work is gratefully acknowledged. .sp 1 .in 4i .nf W. N. Joy R. S. Fabry K. Sklower .fi .in 0 .sp 2 .ce \fIPreface to the Fourth Berkeley distribution\fP .sp 1 .pn 4 .nr PN 3 This manual reflects the Berkeley system mid-October, 1980. A large amount of tuning has been done in the system since the last release; we hope this provides as noticeable an improvement for you as it did for us. This release finds the system in transition; a number of facilities have been added in experimental versions (job control, resource limits) and the implementation of others is imminent (shared-segments, higher performance from the file system, etc.). Applications which use facilities that are in transition should be aware that some of the system calls and library routines will change in the near future. We have tried to be conscientious and make it very clear where this is likely. .LP A new group has been formed at Berkeley, to assume responsibility for the future development and support of a version of UNIX on the VAX. The group has received funding from the Defense Advanced Research Projects Agency (DARPA) to supply a standard version of the system to DARPA contractors. The same version of the system will be made available to other licensees of UNIX on the VAX for a duplication charge. We gratefully acknowledge the support of this contract. .LP We wish to acknowledge the contribution of a number of individuals to the the system. .LP We would especially like to thank Jim Kulp of IIASA, Laxenburg Austria and his colleagues, who first put job control facilities into UNIX; Eric Allman, Robert Henry, Peter Kessler and Kirk McKusick, who contributed major new pieces of software; Mark Horton, who contributed to the improvement of facilities and substantially improved the quality of our bit-mapped fonts, our hardware support staff: Bob Kridle, Anita Hirsch, Len Edmondson and Fred Archibald, who helped us to debug a number of new peripherals; Ken Arnold who did much of the leg-work in getting this version of the manual prepared, and did the final editing of sections 2-6, some special individuals within Bell Laboratories: Greg Chesson, Stuart Feldman, Dick Haight, Howard Katseff, Brian Kernighan, Tom London, John Reiser, Dennis Ritchie, Ken Thompson, and Peter Weinberger who helped out by answering questions; our excellent local DEC field service people, Kevin Althaus and Frank Chargois who kept our machine running virtually all the time, and fixed it quickly when things broke; and, Mike Accetta of Carnegie-Mellon University, Robert Elz of the University of Melbourne, George Goble of Purdue University, and David Kashtan of the Stanford Research Institute for their technical advice and support. .bp Special thanks to Bill Munson of DEC who helped by augmenting our computing facility and to Eric Allman for carefully proofreading the ``last'' draft of the manual and finding the bugs which we knew were there but couldn't see. .LP We dedicate this to the memory of David Sakrison, late chairman of our department, who gave his support to the establishment of our VAX computing facility, and to our department as a whole. .sp 1 .in 4i .nf W. N. Joy \*:O. Babao\*~glu R. S. Fabry K. Sklower .fi .in 0 .sp 2 .ce \fIPreface to the Third Berkeley distribution\fP .sp 1 This manual reflects the state of the Berkeley system, December 1979. We would like to thank all the people at Berkeley who have contributed to the system, and particularly thank Prof. Richard Fateman for creating and administrating a hospitable environment, Mark Horton who helped prepare this manual, and Eric Allman, Bob Kridle, Juan Porcar and Richard Tuck for their contributions to the kernel. .LP The cooperation of Bell Laboratories in providing us with an early version of \s-2UNIX\s0/32V is greatly appreciated. We would especially like to thank Dr. Charles Roberts of Bell Laboratories for helping us obtain this release, and acknowledge T. B. London, J. F. Reiser, K. Thompson, D. M. Ritchie, G. Chesson and H. P. Katseff for their advice and support. .sp 1 .in 4i W. N. Joy .br \u\*:\dO. Babao\*~glu .in 0 .ne 10 .sp 2 .ce \fIPreface to the UNIX/32V distribution\fP .sp 1 The .UX operating system for the VAX*-11 .FS *VAX and PDP are Trademarks of Digital Equipment Corporation. .FE provides substantially the same facilities as the \s-2UNIX\s0 system for the PDP*-11. .LP We acknowledge the work of many who came before us, and particularly thank G. K. Swanson, W. M. Cardoza, D. K. Sharma, and J. F. Jarvis for assistance with the implementation for the VAX-11/780. .sp 1 .in 4i T. B. London .br J. F. Reiser .in 0 .sp 2 .ce \fIPreface to the Seventh Edition\fP .sp 1 .LP Although this Seventh Edition no longer bears their byline, Ken Thompson and Dennis Ritchie remain the fathers and preceptors of the \s-2UNIX\s0 time-sharing system. Many of the improvements here described bear their mark. Among many, many other people who have contributed to the further flowering of \s-2UNIX\s0, we wish especially to acknowledge the contributions of A. V. Aho, S. R. Bourne, L. L. Cherry, G. L. Chesson, S. I. Feldman, C. B. Haley, R. C. Haight, S. C. Johnson, M. E. Lesk, T. L. Lyon, L. E. McMahon, R. Morris, R. Muha, D. A. Nowitz, L. Wehr, and P. J. Weinberger. We appreciate also the effective advice and criticism of T. A. Dolotta, A. G. Fraser, J. F. Maranzano, and J. R. Mashey; and we remember the important work of the late Joseph F. Ossanna. .sp 1 .in 4i B. W. Kernighan .br M. D. McIlroy .in 0 we wish especially to acknowledge the contributions of A. V. Aho, S. R. Bourne, L. L. Cherry, G. L. Chesson, S. I. Feldman, C. B. Haley, R. C. Haight, S. C. Johnson, M. E. Lesk, T. L. Lyon, L. E. McMahon, R. Morris, R. Muha, D. A. Nowitz, L. Wehr, and P. J. Weinberger. We apman/man0/ptx.in 644 0 33 1603 2512730453 6605 .if t .pn 22\"PERMUTED INDEX .if n .pn 23 .tr ~ .ll 6.5i .lt 6.7i .po .5i .ds ET\" .de HD .po 0 .lt 7.4i .tl '\(rn\(rn''\(rn\(rn' .lt .po 'sp 18p .if e .tl '\\*(ET''' .if o .tl '''\\*(ET' 'sp 18p .ns .. .de FO 'sp 18p .af % i .if e .tl '\s9\\*(Dt'- % -'\\*(Ed\s0' .if o .tl '\s9\\*(Ed'- % -'\\*(Dt\s0' 'bp .. .wh 0 HD .wh -60p FO .if \n(nl .bp .br .ds ET \s9\f2Permuted \|Index\fP\s0 .ds Ed Fourth Berkeley Distribution .ds Dt November \|1980 .ce \f3PERMUTED \|INDEX\fP .sp 1v .ps 8 .vs 9p .nf .cs 3 36 .\" backup from slotput 1, slot, 2 .de xx .ds s1\" .if \w\\$2 .ds s1 ~~\" .ds s2 ~~~\" .ds s3\" .if \w\\$4 .ds s3 ~~\" .ds s4 ~~\" .ds s5 ~~\" .ds y \\*(s4\f3\fP\\*(s5 .ta 6i-\w\\*(s5u \h"3i-\w\\$1\\*(s1\\$2\\*(s2u"\\$1\\*(s1\\$2\\*(s2\\$3\\*(s3\\$4\\*y\\$5 .. .so ptxx .cs 3 .if n .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n 80n .if t .ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i Ed Fourth Berkeley Distribution .ds Dt November \|1980 .ce \f3PERMUTED \|INDEX\fP .sp 1v .ps 8 .vs 9p .nf .cs 3 36 .\" backuman/man0/ptxmac 644 0 33 374 2512730453 6645 .de xx .if !""\\$1" \\$1\fI\a\fR\\$2\t\\$3\fI\a\fR\t\\$5 .if !""\\$4" \t\\$2\t\\$3\fI\a\fR\\$4\t\\$5 .if ""\\$1\\$4" \t\\$2\t\\$3\fI\a\fR\t\\$5 .. .cs I 30 .TL PERMUTED INDEX .LP .SM .nr VS 9 .vs \n(VSp .nf .ta 2.7iR 2.85iL 5.65iR 6.5iR .af PN i .pn 9 y\\$5 .. .so ptxx .cs 3 .if n .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n 80n .if t .ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i Ed Fourth Berkeley Distribution /( ,( 5Ċ /\@,\D"man/man0/title 644 0 33 513 2512730456 6470 .tl '--''--' .ps20 .sp 4.25i .ft B .ce UNIX PROGRAMMER'S MANUAL .ps10 .sp |5i .ft I .ce Seventh Edition .ce Virtual VAX\-11 Version .sp |5.75i .ce November, 1980 .sp |9.2i .ft R .ce Computer Science Division .ce Department of Electrical Engineering and Computer Science .ce University of California .ce Berkeley, California 94720 .ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i Ed Fourth Berkeley Distribution /( ,( 5ЋĊ /\@,\D"man/man0/toc.in 644 0 33 1706 2512730456 6566 ((.if t .pn 13\"TABLE OF CONTENTS .if n .pn 15 .tr ~ .ll 6.5i .lt 6.5i .po .5i .ds ET\" .de HD .po 0 .lt 7.4i .tl '\(rn\(rn''\(rn\(rn' .lt .po 'sp 18p .if e .tl '\\*(ET''' .if o .tl '''\\*(ET' 'sp 18p .ns .. .de FO 'sp 18p .af % i .if e .tl '\s9\\*(Dt'- % -'\\*(Ed\s0' .if o .tl '\s9\\*(Ed'- % -'\\*(Dt\s0' 'bp .. .wh 0 HD .wh -60p FO .if \n(nl .bp .br .ds ET \s9\f2Table \|of \|Contents\fP\s0 .ds Ed Fourth Berkeley Distribution .ds Dt November \|1980 .ce \f3TABLE \|OF \|CONTENTS\fP .nr x .5i .in +\nxu .nf .ta \n(.lu-\nxuR .de xx \\$1\f3 \a \fP\\$2 .. .nr a 0 1 .de t .sp 1v .ne .5i .cs 3 .ti -.5i .ss 18 \f3\s9\\n+a. \\$1\s0\fP .ss 12 .if t .sp .5v .cs 3 36 .so toc\\na .. .t "Commands and Application Programs" .t "System Calls" .t "Subroutines" .t "Special Files" .t "File Formats" .t "Games" .t "Miscellaneous" .t "System Maintenance" .in -.5i .cs 3 .if n .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n 80n .if t .ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i \f3TABLE \|OF \|CONTENTS\fP .nr x .5i .in +\nxu .nf .ta \man/man0/toc1 644 0 33 20777 2527226231 6270 .xx "intro" "introduction to commands" .xx "adb" "debugger" .xx "apl" "an apl interpreter" .xx "apropos" "locate commands by keyword lookup" .xx "ar" "archive and library maintainer" .xx "as" "assembler" .xx "at" "execute commands at a later time" .xx "awk" "pattern scanning and processing language" .xx "basename" "strip filename affixes" .xx "bc" "arbitrary-precision arithmetic language" .xx "biff" "be notified if mail arrives and who it is from" .xx "binmail" "send or receive mail among users" .xx "cal" "print calendar" .xx "calendar" "reminder service" .xx "call" "ring a telephone" .xx "cat" "catenate and print" .xx "cb" "C program beautifier" .xx "cc" "C compiler" .xx "cd" "change working directory" .xx "checknr" "check nroff/troff files" .xx "chfn" "change full name of user" .xx "chmod" "change mode" .xx "chsh" "change default login shell" .xx "cifplot" "CIF interpreter and plotter" .xx "clear" "clear terminal screen" .xx "cmp" "compare two files" .xx "col" "filter reverse line feeds" .xx "colcrt" "filter nroff output for CRT previewing" .xx "colrm" "remove columns from a file" .xx "comm" "select or reject lines common to two sorted files" .xx "compact" "compress and uncompress files, and cat them" .xx "cp" "copy" .xx "crypt" "encode/decode" .xx "csh" "a shell (command interpreter) with C-like syntax" .xx "ctags" "create a tags file" .xx "cu" "call UNIX" .xx "date" "print and set the date" .xx "dc" "desk calculator" .xx "dd" "convert and copy a file" .xx "deroff" "remove nroff, troff, tbl and eqn constructs" .xx "df" "disk free" .xx "diction" "print wordy sentences; thesaurus for diction" .xx "diff" "differential file and directory comparator" .xx "diff3" "3-way differential file comparison" .xx "du" "summarize disk usage" .xx "echo" "echo arguments" .xx "ed" "text editor" .xx "efl" "Extended Fortran Language" .xx "eqn" "typeset mathematics" .xx "error" "analyze and disperse compiler error messages" .xx "ex" "text editor" .xx "expand" "expand tabs to spaces, and vice versa" .xx "explain" "print wordy sentences; thesaurus for diction" .xx "expr" "evaluate arguments as an expression" .xx "eyacc" "modified yacc allowing much improved error recovery" .xx "f77" "Fortran 77 compiler" .xx "file" "determine file type" .xx "find" "find files" .xx "finger" "user information lookup program" .xx "fmt" "simple text formatter" .xx "fold" "fold long lines for finite width output device" .xx "from" "who is my mail from?" .xx "gets" "get a string from standard input" .xx "graph" "draw a graph" .xx "grep" "search a file for a pattern" .xx "head" "give first few lines" .xx "iostat" "report I/O statistics" .xx "join" "relational database operator" .xx "kill" "terminate a process with extreme prejudice" .xx "last" "indicate last logins of users and teletypes" .xx "lastcomm" "show last commands executed in reverse order" .xx "ld" "link editor" .xx "learn" "computer aided instruction about UNIX" .xx "leave" "remind you when you have to leave" .xx "lex" "generator of lexical analysis programs" .xx "lint" "a C program verifier" .xx "lisp" "lisp interpreter" .xx "liszt" "compile a Franz Lisp program" .xx "ln" "make links" .xx "lock" "reserve a terminal" .xx "login" "sign on" .xx "look" "find lines in a sorted list" .xx "lorder" "find ordering relation for an object library" .xx "lpr" "line printer spooler" .xx "ls" "list contents of directory" .xx "lxref" "lisp cross reference program" .xx "m4" "macro processor" .xx "mail" "send and receive mail" .xx "make" "maintain program groups" .xx "man" "find manual information by keywords; print out the manual" .xx "mesg" "permit or deny messages" .xx "mkdir" "make a directory" .xx "mkstr" "create an error message file by massaging C source" .xx "more" "file perusal filter for crt viewing" .xx "msgs" "system messages and junk mail program" .xx "mt" "Magnetic tape manipulating program" .xx "mv" "move or rename files" .xx "net" "execute a command on a remote machine" .xx "netcp" "remote copy of files through the net" .xx "netlog" "print the last few lines of the network log file" .xx "netlogin" "provide login name and password for a remote machine" .xx "netlpr" "use a remote lineprinter through the net" .xx "netmail" "read mail on a remote machine over the network" .xx "netq" "print contents of network queue" .xx "netrm" "remove a command from the network queue" .xx "nettroff" "troff to the phototypesetter over the network" .xx "newaliases" "rebuild the data base for the mail aliases file" .xx "newcsh" "description of new csh features (over oldcsh)" .xx "newgrp" "log in to a new group" .xx "nice" "run a command at low priority (\fIsh\fR only)" .xx "nm" "print name list" .xx "num" "number lines" .xx "od" "octal dump" .xx "passwd" "change login password" .xx "pc" "Pascal compiler" .xx "pi" "Pascal interpreter code translator" .xx "pix" "Pascal interpreter and executor" .xx "plot" "graphics filters" .xx "pmerge" "pascal file merger" .xx "pr" "print file" .xx "print" "pr to the line printer" .xx "printenv" "print out the environment" .xx "prmail" "print out mail in the post office" .xx "prof" "display profile data" .xx "ps" "process status" .xx "pti" "phototypesetter interpreter" .xx "ptx" "permuted index" .xx "pwd" "working directory name" .xx "px" "Pascal interpreter" .xx "pxp" "Pascal execution profiler" .xx "pxref" "Pascal cross-reference program" .xx "ranlib" "convert archives to random libraries" .xx "ratfor" "rational Fortran dialect" .xx "refer" "find and insert literature references in documents" .xx "reset" "reset the teletype bits to a sensible state" .xx "rev" "reverse lines of a file" .xx "rewind" "rewind tape drive" .xx "rm" "remove (unlink) files" .xx "script" "make typescript of terminal session" .xx "sdb" "symbolic debugger" .xx "sed" "stream editor" .xx "see" "see what a file has in it" .xx "sh" "command language" .xx "size" "size of an object file" .xx "sleep" "suspend execution for an interval" .xx "soelim" "eliminate \&.so's from nroff input" .xx "sort" "sort or merge files" .xx "spell" "find spelling errors" .xx "spline" "interpolate smooth curve" .xx "split" "split a file into pieces" .xx "strings" "find the printable strings in a object, or other binary, file" .xx "strip" "remove symbols and relocation bits" .xx "struct" "structure Fortran programs" .xx "stty" "set terminal options" .xx "style" "analyze surface characteristics of a document" .xx "su" "substitute user id temporarily" .xx "sum" "sum and count blocks in a file" .xx "symorder" "rearrange name list" .xx "tabs" "set terminal tabs" .xx "tail" "deliver the last part of a file" .xx "tar" "tape archiver" .xx "tbl" "format tables for nroff or troff" .xx "tc" "photypesetter simulator" .xx "tee" "pipe fitting" .xx "test" "condition command" .xx "time" "time a command" .xx "tk" "paginator for the Tektronix 4014" .xx "touch" "update date last modified of a file" .xx "tp" "manipulate tape archive" .xx "tr" "translate characters" .xx "trman" "translate version 6 manual macros to version 7 macros" .xx "troff" "text formatting and typesetting" .xx "true" "provide truth values" .xx "tset" "set terminal modes" .xx "tsort" "topological sort" .xx "tty" "get terminal name" .xx "ul" "do underlining" .xx "uniq" "report repeated lines in a file" .xx "units" "conversion program" .xx "uptime" "show how long system has been up" .xx "users" "compact list of users who are on the system" .xx "uuclean" "uucp spool directory clean-up" .xx "uucp" "unix to unix copy" .xx "uudiff" "directory comparison between machines" .xx "uuencode" "encode/decode a binary file for tranmission via mail" .xx "uusend" "send a file to a remote host" .xx "uux" "unix to unix command execution" .xx "vfontinfo" "inspect and print out information about unix fonts" .xx "vgrind" "grind nice listings of programs" .xx "vi" "screen oriented (visual) display editor based on ex" .xx "vmstat" "report virtual memory statistics" .xx "vpr" "raster printer/plotter spooler" .xx "vtroff" "troff to a raster plotter" .xx "w" "who is on and what they are doing" .xx "wait" "await completion of process" .xx "wall" "write to all users" .xx "wc" "word count" .xx "what" "show what versions of object modules were used to construct a file" .xx "whatis" "describe what a command is" .xx "whereis" "locate source, binary, and or manual for program" .xx "which" "locate a program file including aliases and paths (\fIcsh\fR only)" .xx "who" "who is on the system" .xx "whoami" "print effective current user id" .xx "write" "write to another user" .xx "xsend" "secret mail" .xx "xstr" "extract strings from C programs to implement shared strings" .xx "yacc" "yet another compiler-compiler" .xx "yes" "be repetitively affirmative" u((man/man0/toc2 644 0 33 4326 2527226231 6241 .xx "intro" "introduction to system calls and error numbers" .xx "access" "determine accessibility of file" .xx "acct" "turn accounting on or off" .xx "alarm" "schedule signal after specified time" .xx "brk" "change core allocation" .xx "chdir" "change current working directory" .xx "chmod" "change mode of file" .xx "chown" "change owner and group of a file" .xx "close" "close a file" .xx "creat" "create a new file" .xx "dup" "duplicate an open file descriptor" .xx "exec" "execute a file" .xx "exit" "terminate process" .xx "fork" "spawn new process" .xx "getpid" "get process identification" .xx "getuid" "get user and group identity" .xx "ioctl" "control device" .xx "kill" "send signal to a process" .xx "killpg" "send signal to a process or a process group" .xx "link" "link to a file" .xx "lseek" "move read/write pointer" .xx "mknod" "make a directory or a special file" .xx "mount" "mount or remove file system" .xx "mpx" "create and manipulate multiplexed files" .xx "nice" "set program priority" .xx "open" "open for reading or writing" .xx "pause" "stop until signal" .xx "pipe" "create an interprocess channel" .xx "profil" "execution time profile" .xx "ptrace" "process trace" .xx "read" "read from file" .xx "reboot" "reboot system or halt processor" .xx "setpgrp" "set/get process group" .xx "setuid" "set user and group ID" .xx "signal" "catch or ignore signals" .xx "sigsys" "catch or ignore signals" .xx "stat" "get file status" .xx "stime" "set time" .xx "sync" "update super-block" .xx "syscall" "indirect system call" .xx "time" "get date and time" .xx "times" "get process times" .xx "umask" "set file creation mode mask" .xx "unlink" "remove directory entry" .xx "utime" "set file times" .xx "vadvise" "give advice to paging system" .xx "vfork" "spawn new process in a virtual memory efficient way" .xx "vhangup" "virtually ``hangup'' the current control terminal" .xx "vlimit" "control maximum system resource consumption" .xx "vread" "read virtually" .xx "vswapon" "add a swap device for interleaved paging/swapping" .xx "vtimes" "get information about resource utilization" .xx "vwrite" "write (virtually) to file" .xx "wait" "wait for process to terminate" .xx "wait3" "wait for process to terminate" .xx "write" "write on a file" g system" .xx "vfork" "spawn new process in a virtual memory efficient way" .xx "vhangup" "virtually ``hangup'' the current control terminal" .xx "vlimit" "control maximum system resource consumption" .xx "vread" "read virtually" .xx "vswapon" "add a swap device for interleaved paging/swapping" .xman/man0/toc3 644 0 33 4774 2527226232 6252 .xx "intro" "introduction to library functions" .xx "abort" "generate a fault" .xx "abs" "integer absolute value" .xx "assert" "program verification" .xx "atof" "convert ASCII to numbers" .xx "crypt" "DES encryption" .xx "ctime" "convert date and time to ASCII" .xx "ctype" "character classification" .xx "curses" "screen functions with ``optimal'' cursor motion" .xx "dbm" "data base subroutines" .xx "ecvt" "output conversion" .xx "end" "last locations in program" .xx "exp" "exponential, logarithm, power, square root" .xx "fclose" "close or flush a stream" .xx "ferror" "stream status inquiries" .xx "floor" "absolute value, floor, ceiling functions" .xx "fopen" "open a stream" .xx "fread" "buffered binary input/output" .xx "frexp" "split into mantissa and exponent" .xx "fseek" "reposition a stream" .xx "gamma" "log gamma function" .xx "getarg" "command arguments to Fortran" .xx "getc" "get character or word from stream" .xx "getenv" "value for environment name" .xx "getfsent" "get file system descriptor file entry" .xx "getgrent" "get group file entry" .xx "getlogin" "get login name" .xx "getpass" "read a password" .xx "getpw" "get name from uid" .xx "getpwent" "get password file entry" .xx "gets" "get a string from a stream" .xx "hypot" "Euclidean distance" .xx "j0" "bessel functions" .xx "jobs" "summary of job control facilities" .xx "l3tol" "convert between 3-byte integers and long integers" .xx "malloc" "main memory allocator" .xx "mktemp" "make a unique file name" .xx "monitor" "prepare execution profile" .xx "nlist" "get entries from name list" .xx "perror" "system error messages" .xx "plot" "graphics interface" .xx "popen" "initiate I/O to/from a process" .xx "printf" "formatted output conversion" .xx "putc" "put character or word on a stream" .xx "puts" "put a string on a stream" .xx "qsort" "quicker sort" .xx "rand" "random number generator" .xx "regex" "regular expression handler" .xx "scanf" "formatted input conversion" .xx "setbuf" "assign buffering to a stream" .xx "setjmp" "non-local goto" .xx "sigset" "manage signals" .xx "sin" "trigonometric functions" .xx "sinh" "hyperbolic functions" .xx "sleep" "suspend execution for interval" .xx "stdio" "standard buffered input/output package" .xx "string" "string operations" .xx "swab" "swap bytes" .xx "system" "issue a shell command" .xx "termcap" "terminal independent operation routines" .xx "ttyname" "find name of a terminal" .xx "ungetc" "push character back into input stream" .xx "valloc" "aligned memory allocator" .xx "varargs" "variable argument list" set"man/man0/toc4 644 0 33 2010 2527226232 6230 .xx "intro" "introduction to special files" .xx "autoconf" "diagnostics from autoconfiguartion code" .xx "bk" "line discipline for machine-machine communication" .xx "cons" "VAX-11 console interface" .xx "ct" "phototypesetter interface" .xx "dh" "DH-11/DM-11 communications multiplexer" .xx "drum" "paging device" .xx "dz" "DZ-11 communications multiplexer" .xx "fl" "floppy interface" .xx "hk" "RK6-11/RK06 and RK07 moving head disk" .xx "hp" "RP06, RM03, RM05, RM80, RP07 MASSBUS moving-head disk" .xx "ht" "TM-03/TE-16,TU-45,TU-77 MASSBUS magtape interface" .xx "lp" "line printer" .xx "mail" "pseudo-device for mail notification" .xx "mem" "main memory" .xx "mt" "UNIX magtape interface" .xx "newtty" "summary of the ``new'' tty driver" .xx "null" "data sink" .xx "rv" "Racal/Vadic ACU interface" .xx "tm" "TM-11/TE-10 magtape interface" .xx "ts" "TS-11 magtape interface" .xx "tty" "general terminal interface" .xx "up" "unibus storage module controller/drives" .xx "va" "Benson-Varian interface" .xx "vp" "Versatec interface" 6,TU-45,TU-77 MASSBUS magtape interface" .xx "lp" "line printer" .xx "mail" "pseudo-device for mail notification" .xx "mem" "main memory" .xx "mt" "UNIX magtape interface" .xx "newtty" "summary of the ``new'' tty driver" .xx "null" "data sink" .xx "rv" "Racal/Vadic ACU interface" .xx "tm" "TM-11/TE-10 magtape interface" .xx "ts" "TS-11 magtape interface" .xx "tty" "general terminal interface" .xx "up" "unibus storage module controller/drives" .xx "va" "Benson-Varian interface" .xx "vp" "Versatec intman/man0/toc5 644 0 33 1735 2527226232 6246 .xx "a.out" "assembler and link editor output" .xx "acct" "execution accounting file" .xx "aliases" "aliases file for delivermail" .xx "ar" "archive (library) file format" .xx "core" "format of memory image file" .xx "dir" "format of directories" .xx "dump" "incremental dump format" .xx "environ" "user environment" .xx "filsys" "format of file system volume" .xx "fstab" "static information about the filesystems" .xx "group" "group file" .xx "mpxio" "multiplexed i/o" .xx "mtab" "mounted file system table" .xx "passwd" "password file" .xx "plot" "graphics interface" .xx "stab" "symbol table types" .xx "termcap" "terminal capability data base" .xx "tp" "DEC/mag tape formats" .xx "ttys" "terminal initialization data" .xx "ttytype" "data base of terminal types by port" .xx "types" "primitive system data types" .xx "utmp" "login records" .xx "uuencode" "format of an encoded uuencode file" .xx "vfont" "font formats for the Benson-Varian or Versatec" .xx "wtmp" "user login history" tab" "mounted file system table" .xman/man0/toc6 644 0 33 2167 2527226232 6247 ((.xx "aardvark" "yet another exploration game" .xx "adventure" "an exploration game" .xx "aliens" "The alien invaders attack the earth" .xx "arithmetic" "provide drill in number facts" .xx "backgammon" "the game" .xx "banner" "print large banner on printer" .xx "bcd" "convert to antique media" .xx "boggle" "play the game of boggle" .xx "chase" "Try to escape to killer robots" .xx "chess" "the game of chess" .xx "ching" "the book of changes and other cookies" .xx "cribbage" "the card game cribbage" .xx "doctor" "interact with a psychoanalyst" .xx "fish" "play ``Go Fish''" .xx "fortune" "print a random, hopefully interesting, adage" .xx "hangman" "Computer version of the game hangman" .xx "mille" "play Mille Bournes" .xx "monop" "Monopoly game" .xx "number" "convert Arabic numerals to English" .xx "quiz" "test your knowledge" .xx "rain" "animated raindrops display" .xx "rogue" "Exploring The Dungeons of Doom" .xx "snake" "display chase game" .xx "trek" "trekkie game" .xx "worm" "Play the growing worm game" .xx "worms" "animate worms on a display terminal" .xx "wump" "the game of hunt-the-wumpus" .xx "zork" "the game of dungeon" adage" .xx "hangman" "Computer version of the game hangman" .xx "mille" "play Mille Bournes" .xx "monop" "Monopoly game" .xx "number" "convert Arabic numerals to English" .xx "quiz" "test your knowledge" .xx "rain" "animated raindrops display" .xx "rogue" "Exploring The Dungeons of Doom" .xx "snake" "display chase game" .xx "trek" "trekkie game" .xx "worm" "Play the growing worm game" .xx "man/man0/toc7 644 0 33 520 2527226233 6220 .xx "ascii" "map of ASCII character set" .xx "eqnchar" "special character definitions for eqn" .xx "greek" "graphics for extended TTY-37 type-box" .xx "hier" "file system hierarchy" .xx "man" "macros to typeset manual" .xx "me" "macros for formatting papers" .xx "ms" "macros for formatting manuscripts" .xx "term" "conventional names" nimated raindrops display" .xx "rogue" "Exploring The Dungeons of Doom" .xx "snake" /( ,( 5`Ċ /\@,\D"man/man0/toc8 644 0 33 4146 2527226233 6251 .xx "ac" "login accounting" .xx "adduser" "procedure for adding new users" .xx "analyze" "Virtual UNIX postmortem crash analyzer" .xx "arcv" "convert archives to new format" .xx "arff" "archiver and copier for floppy" .xx "bad144" "read/write dec standard 144 bad sector information" .xx "badsect" "create files to contain bad sectors" .xx "catman" "create the cat files for the manual" .xx "chown" "change owner or group" .xx "clri" "clear i-node" .xx "config" "Build system configuration files" .xx "crash" "what happens when the system crashes" .xx "cron" "clock daemon" .xx "dcheck" "file system directory consistency check" .xx "delivermail" "deliver mail to arbitrary people" .xx "dmesg" "collect system diagnostic messages to form error log" .xx "dump" "incremental file system dump" .xx "dumpdir" "print the names of files on a dump tape" .xx "format" "how to format disks" .xx "fsck" "file system consistency check and interactive repair" .xx "getty" "set terminal mode" .xx "halt" "stop the processor" .xx "icheck" "file system storage consistency check" .xx "init" "process control initialization" .xx "makekey" "generate encryption key" .xx "mkfs" "construct a file system" .xx "mklost+found" "make a lost+found directory for fsck" .xx "mknod" "build special file" .xx "mount" "mount and dismount file system" .xx "ncheck" "generate names from i-numbers" .xx "old" "directory of old programs" .xx "pstat" "print system facts" .xx "quot" "summarize file system ownership" .xx "rc" "command script for auto-reboot and daemons" .xx "reboot" "UNIX bootstrapping procedures" .xx "renice" "alter priority of running process by changing nice" .xx "restor" "incremental file system restore" .xx "sa" "system accounting" .xx "savecore" "save a core dump of the operating system" .xx "shutdown" "close down the system at a given time" .xx "sticky" "executable files with persistent text" .xx "swapon" "specify additional device for paging and swapping" .xx "sync" "update the super block" .xx "update" "periodically update the super block" .xx "vipw" "edit the password file with vi" .xx "vpac" "print raster printer/ploter accounting information" ing nice" .xx "restor" "incremental file system restore" .xx "sa" "system accounting" .xx "savecore" "save a core dump of the operating system" .xx "shutdown" "close down the system at a given time" .xx "sticky" "executable files with persistent text" .xx "swapon" "specify additional device for paging and swapping" .xx "sync" "update the super block" .xx "update" "periodically update the super block" .xx "vman/man0/trman 644 0 33 145 2512730461 6465 sed -n -f /usr/man/man0/m1.sed $1\ |sed -n -f /usr/man/man0/m2.sed \ |sed -f /usr/man/man0/trref.sed ing nice" .xx "restor" "incremental file system restore" .xx "sa" "system accounting" .xx "savecore" "save a core dump of the operating system" .xx "shutdown" "close down the system at a given time" .xx "sticky" "executable files with persistent text" .xx "swapon" "specify additional device for paging and swapping" ./( ,( 5Ċ /\@,\D"man/man0/trref.sed 644 0 33 1201 2512730461 7252 /^\.TH/{ s/ I / 1 / s/ IL / 1 local / s/ IC / 1C / s/ ICL / 1C local / s/ ID / 1D / s/ IG / 1G / s/ IGL / 1G local / s/ IM / 1M / s/ II / 2 / s/ III / 3Z / s/ IIIA / 3A / s/ IIIF / 3F / s/ IIIS / 3S / s/ IIIZ / 3Z / s/ IV / 4 / s/ IVH / 9 / s/ IVT / 7 / s/ V / 5 / s/ VI / 1 / s/ VII / 3 / s/ VIII / 8 / /local/{ s/// s/$/ local/ } } s/(I)/(1)/g s/(IC)/(1)/g s/(ID)/(1)/g s/(IG)/(1)/g s/(IM)/(1)/g s/(II)/(2)/g s/(III)/(3)/g s/(IIIA)/(3)/g s/(IIIF)/(3)/g s/(IIIS)/(3)/g s/(IIIZ)/(3)/g s/(IV)/(4)/g s/(IVH)/(9)/g s/(IVT)/(7)/g s/(V)/(5)/g s/(VI)/(1)/g s/(VII)/(3)/g s/(VIII)/(8)/g /SEE/,/SH/s/ *(/(/g ${ /BUG/d } M / 1M / s/ II / 2 / s/ III / 3Z / s/ IIIA / 3A / s/ IIIF / 3F / s/ IIIS / 3S / s/ IIIZ / 3Z / s/ IV / 4 / s/ IVH / 9 / s/ IVT / 7 / s/ V / 5 / s/ VI / 1 / s/ VII / 3 / s/ VIII / 8 / /local/{ s/// s/$/ local/ } } s/(I)/(1)/g s/(IC)/(1)/g s/(ID)/(1)/g s/(IG)/(1)/g s/(IM)/(1)/g s/(II)/(2)/g s/(III)/(3)/g s/(IIIA)/(3)/g s/(IIIF)/(3)/g s/(IIIS)/(3)/g s/(IIIZ)/(3)/g man/man0/xx 644 0 33 155 2512730462 6005 .TH NAME SECTION local .SH NAME .SH SYNOPSIS .SH DESCRIPTION .SH FILES .SH SEE ALSO .SH DIAGNOSTICS .SH BUGS *(/(/g ${ /BUG/d } M / 1M / s/ II / 2 / s/ III / 3Z / s/ IIIA / 3A / s/ IIIF / 3F / s/ IIIS / 3S / s/ IIIZ / 3Z / s/ IV / 4 / s/ IVH / 9 / s/ IVT / 7 / s/ V / 5 / s/ VI / 1 / s/ VII / 3 / s/ VIII / 8 / /local/{ s/// s/$/ local/ } } s/(I)/(1)/g s/(IC)/(1)/g s/(ID)/(1)/g s/(IG)/(1)/g s/(IM)/(/( ,( 5 Ċ /\@,\D"man/man1/ 775 0 33 0 2527170236 5363 man/man1/adb.1 644 0 33 37571 2512730465 6313 ((.TH ADB 1 4/1/81 .UC 4 .SH NAME adb \- debugger .SH SYNOPSIS .B adb [\fB\-w\fR] [ objfil [ corfil ] ] .ds TW \v'.25m'\s+2~\s-2\v'-.25m' .ds ST \v'.25m'*\v'-.25m' .ds IM \v'.1m'=\v'-.1m'\s-2\h'-.1m'>\h'.1m'\s+2 .ds LE \(<= .ds LT \s-2<\s+2 .ds GT \s-2>\s+2 .SH DESCRIPTION .I Adb is a general purpose debugging program. It may be used to examine files and to provide a controlled environment for the execution of UNIX programs. .PP .I Objfil is normally an executable program file, preferably containing a symbol table; if not then the symbolic features of .I adb cannot be used although the file can still be examined. The default for .I objfil is .B a.out. .I Corfil is assumed to be a core image file produced after executing .IR objfil ; the default for .I corfil is .B core. .PP Requests to .I adb are read from the standard input and responses are to the standard output. If the .B \-w flag is present then both .I objfil and .I corfil are created if necessary and opened for reading and writing so that files can be modified using .IR adb . .I Adb ignores QUIT; INTERRUPT causes return to the next .I adb command. .PP In general requests to .I adb are of the form .PP .if n .ti 16 .if t .ti 1.6i [\|\fIaddress\fR\|] [\|, .IR count \|] [\|\fIcommand\fR\|] [\|;\|] .PP If .I address is present then .I dot is set to .IR address . Initially .I dot is set to 0. For most commands .I count specifies how many times the command will be executed. The default .I count is 1. .I Address and .I count are expressions. .PP The interpretation of an address depends on the context it is used in. If a subprocess is being debugged then addresses are interpreted in the usual way in the address space of the subprocess. If the operating system is being debugged either post-mortem or using the special file .B /dev/kmem to interactive examine and/or modify memory the maps are set to map the kernel virtual addresses which start at 0x80000000. For further details of address mapping see .SM ADDRESSES. .SH EXPRESSIONS .TP 7.2n .B . The value of .IR dot . .TP 7.2n + The value of .I dot incremented by the current increment. .TP 7.2n ^ The value of .I dot decremented by the current increment. .TP 7.2n " The last .I address typed. .TP 7.2n .I integer A number. The prefixes 0o and 0O (\*(lqzero oh\*(rq) force interpretation in octal radix; the prefixes 0t and 0T force interpretation in decimal radix; the prefixes 0x and 0X force interpretation in hexadecimal radix. Thus 0o20 = 0t16 = 0x10 = sixteen. If no prefix appears, then the .I default\ radix is used; see the $d command. The default radix is initially hexadecimal. The hexadecimal digits are 0123456789abcdefABCDEF with the obvious values. Note that a hexadecimal number whose most significant digit would otherwise be an alphabetic character must have a 0x (or 0X) prefix (or a leading zero if the default radix is hexadecimal). .TP 7.2n .IB integer . fraction A 32 bit floating point number. .TP 7.2n .I \'cccc\|\' The ASCII value of up to 4 characters. \\ may be used to escape a \'. .TP 7.2n .I \*(LT name The value of .IR name , which is either a variable name or a register name. .I Adb maintains a number of variables (see .SM VARIABLES\*S) named by single letters or digits. If .I name is a register name then the value of the register is obtained from the system header in .IR corfil . The register names are those printed by the $r command. .TP 7.2n .I symbol A .I symbol is a sequence of upper or lower case letters, underscores or digits, not starting with a digit. .BR \\ " may be used to escape other characters." The value of the .I symbol is taken from the symbol table in .IR objfil . An initial \_ or \*(TW will be prepended to .I symbol if needed. .TP .I _ symbol In C, the `true name' of an external symbol begins with _. It may be necessary to utter this name to disinguish it from internal or hidden variables of a program. .TP 7.2n .IB routine . name The address of the variable .I name in the specified C routine. Both .I routine and .I name are .IR symbols . If .I name is omitted the value is the address of the most recently activated C stack frame corresponding to .IR routine . (This form is currently broken on the VAX; local variables can be examined only with .IR sdb (1).) .TP 7.2n .RI ( exp \|) The value of the expression .IR exp . .LP .SM .B "Monadic\ operators" .TP 7.2n .RI \*(ST exp The contents of the location addressed by .I exp in .IR corfil . .TP 7.2n .RI @ exp The contents of the location addressed by .I exp in .IR objfil . .TP 7.2n .RI \- exp Integer negation. .TP 7.2n .RI \*(TW exp Bitwise complement. .TP 7.2n .RI # exp Logical negation. .LP .B "Dyadic\ operators" are left associative and are less binding than monadic operators. .TP 7.2n .IR e1 + e2 Integer addition. .TP 7.2n .IR e1 \- e2 Integer subtraction. .TP 7.2n .IR e1 \*(ST e2 Integer multiplication. .TP 7.2n .IR e1 % e2 Integer division. .TP 7.2n .IR e1 & e2 Bitwise conjunction. .TP 7.2n .IR e1 \(bv e2 Bitwise disjunction. .TP 7.2n .IR e1 # e2 .I E1 rounded up to the next multiple of .IR e2 . .DT .SH COMMANDS Most commands consist of a verb followed by a modifier or list of modifiers. The following verbs are available. (The commands `?' and `/' may be followed by `\*(ST'; see .SM ADDRESSES for further details.) .TP .5i .RI ? f Locations starting at .I address in .I objfil are printed according to the format .IR f . .I dot is incremented by the sum of the increments for each format letter (q.v.). .TP .RI / f Locations starting at .I address in .I corfil are printed according to the format .I f and .I dot is incremented as for `?'. .TP .RI = f The value of .I address itself is printed in the styles indicated by the format .IR f . (For .B i format `?' is printed for the parts of the instruction that reference subsequent words.) .PP A .I format consists of one or more characters that specify a style of printing. Each format character may be preceded by a decimal integer that is a repeat count for the format character. While stepping through a format .I dot is incremented by the amount given for each format letter. If no format is given then the last format is used. The format letters available are as follows. .ta 2.5n .5i .RS .TP .BR o " 2" Print 2 bytes in octal. All octal numbers output by .I adb are preceded by 0. .br .ns .TP .BR O " 4" Print 4 bytes in octal. .br .ns .TP .BR q " 2" Print in signed octal. .br .ns .TP .BR Q " 4" Print long signed octal. .br .ns .TP .BR d " 2" Print in decimal. .br .ns .TP .BR D " 4" Print long decimal. .br .ns .TP .BR x " 2" Print 2 bytes in hexadecimal. .br .ns .TP .BR X " 4" Print 4 bytes in hexadecimal. .br .ns .TP .BR u " 2" Print as an unsigned decimal number. .br .ns .TP .BR U " 4" Print long unsigned decimal. .br .ns .TP .BR f " 4" Print the 32 bit value as a floating point number. .br .ns .TP .BR F " 8" Print double floating point. .br .ns .TP .BR b " 1" Print the addressed byte in octal. .br .ns .TP .BR c " 1" Print the addressed character. .br .ns .TP .BR C " 1" Print the addressed character using the standard escape convention where control characters are printed as ^X and the delete character is printed as ^?. .br .ns .TP .BI s " n" Print the addressed characters until a zero character is reached. .br .ns .TP .BI S " n" Print a string using the ^\fIX\fR escape convention (see \fBC\fR above). .I n is the length of the string including its zero terminator. .br .ns .TP .BR Y " 4" Print 4 bytes in date format (see .IR ctime (3)). .br .ns .TP .BR i " n" Print as VAX instructions. .I n is the number of bytes occupied by the instruction. This style of printing causes variables 1 and 2 to be set to the offset parts of the source and destination respectively. .br .ns .TP .BR a " 0" Print the value of .I dot in symbolic form. Symbols are checked to ensure that they have an appropriate type as indicated below. .LP / local or global data symbol .br ? local or global text symbol .br = local or global absolute symbol .TP .BR p " 4" Print the addressed value in symbolic form using the same rules for symbol lookup as .BR a . .br .ns .TP .BR t " 0" When preceded by an integer tabs to the next appropriate tab stop. For example, .B 8t moves to the next 8-space tab stop. .br .ns .TP .BR r " 0" Print a space. .br .ns .TP .BR n " 0" Print a newline. .br .ns .tr '" .TP .BR '...' " 0" Print the enclosed string. .br .tr '' .br .ns .TP .B ^ .I Dot is decremented by the current increment. Nothing is printed. .br .ns .TP + .I Dot is incremented by 1. Nothing is printed. .br .ns .TP \- .I Dot is decremented by 1. Nothing is printed. .RE .TP newline Repeat the previous command with a .I count of 1. .TP .RB [ ?/ ] l "\fI value mask\fR" Words starting at .I dot are masked with .I mask and compared with .I value until a match is found. If .B L is used then the match is for 4 bytes at a time instead of 2. If no match is found then .I dot is unchanged; otherwise .I dot is set to the matched location. If .I mask is omitted then \-1 is used. .TP .RB [ ?/ ] w "\fI value ...\fR" Write the 2-byte .I value into the addressed location. If the command is .BR W , write 4 bytes. Odd addresses are not allowed when writing to the subprocess address space. .TP [\fB?/\fR]\fBm\fI b1 e1 f1\fR[\fB?/\fR] .br New values for .RI ( b1,\ e1,\ f1 ) are recorded. If less than three expressions are given then the remaining map parameters are left unchanged. If the `?' or `/' is followed by `\*(ST' then the second segment (\fIb2\fR\|,\|\fIe2\fR\|,\|\fIf2\fR) of the mapping is changed. If the list is terminated by `?' or `/' then the file (\fIobjfil\fR or .I corfil respectively) is used for subsequent requests. (So that, for example, `/m?' will cause `/' to refer to .IR objfil .) .TP .BI \*(GT name .I Dot is assigned to the variable or register named. .TP .B ! A shell is called to read the rest of the line following `!'. .TP .RI $ modifier Miscellaneous commands. The available .I modifiers are: .RS .TP .BI < f Read commands from the file .IR f . If this command is executed in a file, further commands in the file are not seen. If .I f is omitted, the current input stream is terminated. If a .I count is given, and is zero, the command will be ignored. The value o((f the count will be placed in variable .I 9 before the first command in .I f is executed. .br .ns .TP .BI << f Similar to .B < except it can be used in a file of commands without causing the file to be closed. Variable .I 9 is saved during the execution of this command, and restored when it completes. There is a (small) finite limit to the number of .B << files that can be open at once. .br .ns .TP .BI > f Append output to the file .IR f , which is created if it does not exist. If .I f is omitted, output is returned to the terminal. .br .ns .TP .B ? Print process id, the signal which caused stoppage or termination, as well as the registers as \fB$r\fR. This is the default if \fImodifier\fR is omitted. .br .ns .TP .B r Print the general registers and the instruction addressed by .BR pc . .I Dot is set to \fBpc\fR. .br .ns .TP .B b Print all breakpoints and their associated counts and commands. .br .ns .TP .B c C stack backtrace. If .I address is given then it is taken as the address of the current frame (instead of .BR r5 ). If .B C is used then the names and (16 bit) values of all automatic and static variables are printed for each active function. If .I count is given then only the first .I count frames are printed. .br .ns .TP .B d Set the default radix to .I address and report the new value. Note that .I address is interpreted in the (old) current radix. Thus \*(lq10$d\*(rq never changes the default radix. To make decimal the default radix, use \*(lq0t10$d\*(rq. .br .ns .TP .B e The names and values of external variables are printed. .br .ns .TP .B w Set the page width for output to .I address (default 80). .br .ns .TP .B s Set the limit for symbol matches to .I address (default 255). .br .ns .TP .B o All integers input are regarded as octal. .br .ns .TP .B d Reset integer input as described in .SM EXPRESSIONS. .br .ns .TP .B q Exit from .IR adb . .br .ns .TP .B v Print all non zero variables in octal. .br .ns .TP .B m Print the address map. .RE .TP .BI : modifier Manage a subprocess. Available modifiers are: .RS .TP .BI b c Set breakpoint at .IR address . The breakpoint is executed .IR count \-1 times before causing a stop. Each time the breakpoint is encountered the command .I c is executed. If this command is omitted or sets .I dot to zero then the breakpoint causes a stop. .TP .B d Delete breakpoint at .IR address . .TP .B r Run .I objfil as a subprocess. If .I address is given explicitly then the program is entered at this point; otherwise the program is entered at its standard entry point. .I count specifies how many breakpoints are to be ignored before stopping. Arguments to the subprocess may be supplied on the same line as the command. An argument starting with < or > causes the standard input or output to be established for the command. All signals are turned on on entry to the subprocess. .TP .BI c s The subprocess is continued with signal .I s c .I s, see .IR signal (2). If .I address is given then the subprocess is continued at this address. If no signal is specified then the signal that caused the subprocess to stop is sent. Breakpoint skipping is the same as for .BR r . .TP .BI s s As for .B c except that the subprocess is single stepped .I count times. If there is no current subprocess then .I objfil is run as a subprocess as for .BR r . In this case no signal can be sent; the remainder of the line is treated as arguments to the subprocess. .TP .B k The current subprocess, if any, is terminated. .RE .SH VARIABLES .I Adb provides a number of variables. Named variables are set initially by .I adb but are not used subsequently. Numbered variables are reserved for communication as follows. .TP 0 The last value printed. .br .ns .TP 1 The last offset part of an instruction source. .br .ns .TP 2 The previous value of variable 1. .br .ns .TP 9 The count on the last $< or $<< command. .PP On entry the following are set from the system header in the .IR corfil . If .I corfil does not appear to be a .B core file then these values are set from .IR objfil . .TP b The base address of the data segment. .br .ns .TP d The data segment size. .br .ns .TP e The entry point. .br .ns .TP m The `magic' number (0407, 0410 or 0413). .br .ns .TP s The stack segment size. .br .ns .TP t The text segment size. .SH ADDRESSES The address in a file associated with a written address is determined by a mapping associated with that file. Each mapping is represented by two triples .RI ( "b1, e1, f1" ) and .RI ( "b2, e2, f2" ) and the .I file address corresponding to a written .I address is calculated as follows. .PP .if t .ti 1.5i .if n .ti 8 .IR b1 \*(LE address < e1 \*(IM .IR "file address" = address + f1\-b1, otherwise, .PP .if t .ti 1.5i .if n .ti 8 .IR b2 \*(LE address < e2 \*(IM .IR "file address" = address + f2\-b2, .PP otherwise, the requested .I address is not legal. In some cases (e.g. for programs with separated I and D space) the two segments for a file may overlap. If a .B ? or .B / is followed by an .B \*(ST then only the second triple is used. .PP The initial setting of both mappings is suitable for normal .B a.out and .B core files. If either file is not of the kind expected then, for that file, .I b1 is set to 0, .I e1 is set to the maximum file size and .I f1 is set to 0; in this way the whole file can be examined with no address translation. .PP So that .I adb may be used on large files all appropriate values are kept as signed 32 bit integers. .SH FILES a.out .br core .SH SEE\ ALSO sdb(1), ptrace(2), a.out(5), core(5) .SH DIAGNOSTICS `Adb' when there is no current command or format. Comments about inaccessible files, syntax errors, abnormal termination of commands, etc. Exit status is 0, unless last command failed or returned nonzero status. .SH BUGS Local variable addresses and names are recorded in the .I a.out file in a format known only to .IR sdb (1). .PP Use of # for the unary logical negation operator is peculiar. .PP There doesn't seem to be any way to clear all breakpoints. sdb(1), ptrace(2), a.out(5), core(5) .SH DIAGNOSTICS `Adb' when there is no current command or format. Comments about inaccessible filman/man1/apl.1 644 0 33 12153 2512730465 6326 .TH APL 1 8/26/80 .UC 4 .SH NAME apl \- an apl interpreter .SH SYNOPSIS .B apl .SH DESCRIPTION .I Apl is an APL interpreter. All of the operators are exactly as in apl\e360. Overstrikes are often required, and they work (use ctrl-h). .PP Function definition is not what you would expect. Functions are loaded from files. The first line of the file is the function header, as you would expect it but with no del. The rest of the file is the lines of the function. Lines are numbered, but there are no square brackets with line numbers. If you say )READ FILE it will load the function in that file. If you say )EX FILE it will put you in the editor to change that file. Upon exit, it will read the file in as though by )READ. .PP All of the usual operators are available, including domino. Also available are monadic encode and epsilon. .LP The following .I apl system commands are available. .TP )ASCII .br changes terminal to accept and print ASCII characters and operators; this is the default. If you are stuck in APL mode on an ASCII terminal, `"' is `)' and lowercase letters map to uppercase. .TP )APL .br changes terminal to accept and print APL characters. Erase is set to \(*W and kill is set to \(*a. .TP )DIGITS n .br sets the number of digits displayed to n, from 1 to 19. .TP )FUZZ n .br sets the fuzz to n. .TP )ORIGIN n .br sets the origin to n, which should be 1 or 0. .TP )WIDTH n .br sets .IR apl \&'s idea of your terminal's carriage width. .TP )ERASE n .br gets rid of function or variable named n. .TP )SAVE n .br saves all variables and functions (workspace) in file named n. Workspaces are sensitive to changes in .I apl. .TP )LOAD n .br gets the workspace in file n (which must have been )SAVE'd.) .TP )COPY n .br like )LOAD but variables and functions are not erased. Things in the loaded file take precedence over stuff already in. .TP )CLEAR .br clears the workspace. .TP )DROP n .br deletes file n in your directory, which need not be saved from .I apl. .TP )CONTINUE .br exits and saves workspace in file .I continue which is loaded next time you run .I apl. .TP )OFF .br exits .I apl. .TP )READ n .br reads in a function from file \fIn\fR. The first line is the header, with no del's. The full APL\360 header is accepted. All other lines in the file are lines in the function. Lines are implicitly numbered, and transfers are as usual. There are no labels. .TP )EDIT n .br runs the editor .IR ed (1) on file \fIn\fR, and then )READ's the file when you leave the editor. .TP )EX n .br runs the editor .IR ex (1) on file \fIn\fR, and then )READ's the file when you leave the editor. .TP )VI n .br runs the editor .IR vi (1) on file \fIn\fR, and then )READ's the file when you leave the editor. .TP )LIB .br lists out all of the files in the current directory. .TP )FNS .br lists out all current functions. .TP )VARS .br lists out all current variables. .TP )DEBUG .br toggles a debugging switch, which can produce vast amounts of hopelessly cryptic output. .SH FILES apl_ws \- temporary workspace file .br continue \- continue workspace .SH AUTHORS Ken Thompson, Ross Harvey, Douglas Lanam .SH BUGS This program has not been extensively used or tested. .bp .SH ASCII CHAR MNEMONICS .nf .ta 0.5i 1.0i 3.0i 3.5i 4.0i & \(*L and # \(mu times \- \- minus + \(pl add < < less than > > greater than = = equal to , , comma % \(di divide * * exponential (power) ! ! factorial and combinations ? ? deal .le \(<= less than or equal .ge \(>= greater than or equal .ne \(!= not equal .om \(*W omega (not used) .ep \(*e epsilon .rh \(*r(( shape (rho) .nt \(no not (also \'~\') .tk \(ua take (also \'^\') .dr \(da drop .it \(*i iota .ci \(ci circular function .al \(*a alpha (not used) .cl \(lc maximum (ceiling) .fl \(lf minimum (floor) .dl \(*D del (not used) .de \(gr upside down del .jt \(de small circle (null) .qd \(sq quad .ss \(sb right U (not used) .sc \(sp left U (not used) .si \(ca Down U .su \(cu U (not used) .[^ \(gr upside-down del .bv \o'\(lf\(rf' decode (base) .rp \o'\(lc\(rc' encode (rep) .br \(or residue (mod) .sp \(<- assignment (also '_') .go \(-> goto .or V or .nn \o'\(*L~' nand .nr \o'v~' nor .lg \o'*\(ci' log .rv \o'\(ci\(or' reversal .tr \o'\(ci\e' transpose .rb reverse bar .cb \o',-' comma bar ( not used) .sb \o'/-' slash bar .bb \o'\e-' blackslash bar .gu \o'\(*D\(or' grade up .gd \o'\(gr\(or' grade down .qq \o'\(sq\(fm' quote quad .dm \o'\(sq:' domino .lm \o'\(ca\(de' lamp .ib \o'\(rc\(lc\(lf\(rf' I-beam .ex execute (not used) .fr format(not used) .di diamond (not used) .ot out (not used) .ld \o'\(*D~' locked del (not used) ._a A alias for \'A\' ._b B alias for \'B\' ._c C alias for \'C\' ._d D alias for \'D\' ._e E alias for \'E\' ._f F alias for \'F\' ._g G alias for \'G\' ._h H alias for \'H\' ._i I alias for \'I\' ._j J alias for \'J\' ._k K alias for \'K\' ._l L alias for \'L\' ._m M alias for \'M\' ._n N alias for \'N\' ._o O alias for \'O\' ._p P alias for \'P\' ._q Q alias for \'Q\' ._r R alias for \'R\' ._s S alias for \'S\' ._t T alias for \'T\' ._u U alias for \'U\' ._v V alias for \'V\' ._w W alias for \'W\' ._x X alias for \'X\' ._y Y alias for \'Y\' ._z Z alias for \'Z\' .fi as for \'D\' ._e E alias for \'E\' ._f F alias for \'F\' ._g G alias for \'G\' ._h H alias for \'H\' ._i I alias for \'I\' ._j J alias for \'J\' ._k K alias for \'K\' ._l L alias for \'L\' ._m M alias for \'M\' ._n N alias for \'N\' ._o O alias for \'O\' ._p P alias for \'P\' ._q Q alias for \'Q\' ._r R alias for \'R\' ._s S alias for \'S\' ._t T alias for \'T\' ._u U alias for \'U\' ._v V aliman/man1/apropos.1 644 0 33 1533 2512730465 7215 .TH APROPOS 1 2/24/79 .UC 4 .SH NAME apropos \- locate commands by keyword lookup .SH SYNOPSIS .B apropos keyword ... .SH DESCRIPTION .I Apropos shows which manual sections contain instances of any of the given keywords in their title. Each word is considered separately and case of letters is ignored. Words which are part of other words are considered thus looking for compile will hit all instances of `compiler' also. Try .IP apropos password .PP and .IP apropos editor .PP If the line starts `name(section) ...' you can do `man section name' to get the documentation for it. Try `apropos format' and then `man 3s printf' to get the manual on the subroutine .I printf. .PP .I Apropos is actually just the .B \-k option to the .IR man (2) command. .SH FILES .DT /usr/lib/whatis data base .SH "SEE ALSO" man(1), whatis(1), catman(8) .SH AUTHOR William Joy idered thus looking for compile will hit all instances of `compiler' also. Try .IP apropos password .PP and .IP apropos editor .PP If the line starts `name(section) man/man1/ar.1 644 0 33 5536 2512730465 6143 .TH AR 1 .UC 4 .SH NAME ar \- archive and library maintainer .SH SYNOPSIS .B ar key [ posname ] afile name ... .SH DESCRIPTION .I Ar maintains groups of files combined into a single archive file. Its main use is to create and update library files as used by the loader. It can be used, though, for any similar purpose. .B N.B: This version of .I ar uses a ASCII-format archive which is portable among the various machines running \s-2UNIX\s0. Programs for dealing with older formats are available: see .IR old (8). .PP .I Key is one character from the set .B drqtpmx, optionally concatenated with one or more of .B vuaibcl. .I Afile is the archive file. The .I names are constituent files in the archive file. The meanings of the .I key characters are: .TP .B d Delete the named files from the archive file. .TP .B r Replace the named files in the archive file. If the optional character .B u is used with .B r, then only those files with modified dates later than the archive files are replaced. If an optional positioning character from the set .B abi is used, then the .I posname argument must be present and specifies that new files are to be placed after .RB ( a ) or before .RB ( b or .BR i ) .IR posname . Otherwise new files are placed at the end. .TP .B q Quickly append the named files to the end of the archive file. Optional positioning characters are invalid. The command does not check whether the added members are already in the archive. Useful only to avoid quadratic behavior when creating a large archive piece-by-piece. .TP .B t Print a table of contents of the archive file. If no names are given, all files in the archive are tabled. If names are given, only those files are tabled. .TP .B p Print the named files in the archive. .TP .B m Move the named files to the end of the archive. If a positioning character is present, then the .I posname argument must be present and, as in .B r, specifies where the files are to be moved. .TP .B x Extract the named files. If no names are given, all files in the archive are extracted. In neither case does .B x alter the archive file. .TP .B v Verbose. Under the verbose option, .I ar gives a file-by-file description of the making of a new archive file from the old archive and the constituent files. When used with .B t, it gives a long listing of all information about the files. When used with .BR p , it precedes each file with a name. .TP .B c Create. Normally .I ar will create .I afile when it needs to. The create option suppresses the normal message that is produced when .I afile is created. .TP .B l Local. Normally .I ar places its temporary files in the directory /tmp. This option causes them to be placed in the local directory. .SH FILES /tmp/v* temporaries .SH "SEE ALSO" lorder(1), ld(1), ranlib(1), ar(5), arcv(8), old(8) .SH BUGS If the same file is mentioned twice in an argument list, it may be put in the archive twice. a name. .TP .B c Create. Normally .I ar will create .I afile when it needs to. The create option suppresses the normal message that is produced when .I afile is man/man1/as.1 644 0 33 3461 2512730465 6137 .TH AS 1 VAX-11 .UC 4 .SH NAME as \- assembler .SH SYNOPSIS .B as [ .B \-d124 ] [ .B \-L ] [ .B \-W ] [ .B \-V ] [ .B \-J ] [ .B \-R ] [ .B \-t directory ] [ .B \-o objfile ] [ name ... ] .SH DESCRIPTION .I As assembles the named files, or the standard input if no file name is specified. The available flags are: .TP .B \-d Specifies the number of bytes to be assembled for offsets which involve forward or external references, and which have sizes unspecified in the assembly language. The default is .B \-d4. .TP .B \-L Save defined labels beginning with a `L', which are normally discarded to save space in the resultant symbol table. The compilers generate such temporary labels. .TP .B \-V Use virtual memory for intermediate storage, rather than a temporary file. .TP .B \-W Do not complain about errors. .TP .B \-J Use long branches to resolve jumps when byte-displacement branches are insufficient. This must be used when a compiler-generated assembly contains branches of more than 32k bytes. .TP .B \-R Make initialized data segments read-only, by concatenating them to the text segments. This obviates the need to run editor scripts on assembly code to make initialized data read-only and shared. .TP .B \-t Specifies a directory to receive the temporary file, other than the default /tmp. .PP All undefined symbols in the assembly are treated as global. .PP The output of the assembly is left on the file .I objfile; if that is omitted, .I a.out is used. .SH FILES .ta 1.5i /tmp/as\(** default temporary file .br a.out default resultant object file .SH "SEE ALSO" ld(1), nm(1), adb(1), sdb(1), a.out(5) .br Auxiliary documentation .I Assembler Reference Manual. .SH AUTHORS John F. Reiser .br Robert R. Henry .SH BUGS .B \-J should be eliminated; the assembler should automatically choose among byte, word and long branches. in the assembly are treated as global. .PP The output of the assembly is left on the file .I objfile; if that is omitted, .I a.out is used. .SH FILES .ta 1.5i /tmp/as\(** default temporary file .br a.out dman/man1/at.1 644 0 33 3562 2531446135 6141 ((.TH AT 1 .UC 4 .SH NAME at \- execute commands at a later time .SH SYNOPSIS .B at time [ day ] [ file ] .SH DESCRIPTION .I At squirrels away a copy of the named .I file (standard input default) to be used as input to .IR sh (1) (or .IR csh (1) if you normally use it) at a specified later time. A .I cd command to the current directory is inserted at the beginning, followed by assignments to all environment variables (excepting the variable TERM, which is useless in this context.) When the script is run, it uses the user and group ID of the creator of the copy file. .PP The .I time is 1 to 4 digits, with an optional following `A', `P', `N' or `M' for AM, PM, noon or midnight. One and two digit numbers are taken to be hours, three and four digits to be hours and minutes. If no letters follow the digits, a 24 hour clock time is understood. .PP The optional .I day is either (1) a month name followed by a day number, or (2) a day of the week; if the word `week' follows invocation is moved seven days further off. Names of months and days may be recognizably truncated. Examples of legitimate commands are .IP at 8am jan 24 .br at 1530 fr week .PP .I At programs are executed by periodic execution of the command .I /usr/lib/atrun from .IR cron (8). The granularity of .I at depends upon how often .I atrun is executed. .PP Standard output or error output is lost unless redirected. .SH FILES .ta 2i /usr/lib/atrun executor (run by .IR cron (8)). .sp in /usr/spool/at: .ta .5i 2i .br \& yy.ddd.hhhh.* activity for year yy, day dd, hour hhhh. .br \& lasttimedone last \fIhhhh\fR .br \& past activities in progress .SH "SEE ALSO" calendar(1), pwd(1), sleep(1), cron(8) .SH DIAGNOSTICS Complains about various syntax errors and times out of range. .SH BUGS Due to the granularity of the execution of .I /usr/lib/atrun, there may be bugs in scheduling things almost exactly 24 hours into the future. H FILES .ta 2i /usr/lib/atrun executor (run by .IR cron (8)). .sp in /usr/spool/at: .ta .5i 2i .br \& yy.ddd.hhhh.* activity for year yy, dayman/man1/awk.1 644 0 33 12562 2512730466 6341 .TH AWK 1 .SH NAME awk \- pattern scanning and processing language .SH SYNOPSIS .B awk [ .BI \-F c ] [ prog ] [ file ] ... .SH DESCRIPTION .I Awk scans each input .I file for lines that match any of a set of patterns specified in .IR prog . With each pattern in .I prog there can be an associated action that will be performed when a line of a .I file matches the pattern. The set of patterns may appear literally as .I prog, or in a file specified as .B \-f .IR file . .PP Files are read in order; if there are no files, the standard input is read. The file name `\-' means the standard input. Each line is matched against the pattern portion of every pattern-action statement; the associated action is performed for each matched pattern. .PP An input line is made up of fields separated by white space. (This default can be changed by using FS, .IR "vide infra" ".)" The fields are denoted $1, $2, ... ; $0 refers to the entire line. .PP .PP A pattern-action statement has the form .PP pattern { action } .PP A missing { action } means print the line; a missing pattern always matches. .PP An action is a sequence of statements. A statement can be one of the following: .PP .nf if ( conditional ) statement [ else statement ] while ( conditional ) statement for ( expression ; conditional ; expression ) statement break continue { [ statement ] ... } variable = expression print [ expression-list ] [ >expression ] printf format [ , expression-list ] [ >expression ] next # skip remaining patterns on this input line exit # skip the rest of the input .fi .PP Statements are terminated by semicolons, newlines or right braces. An empty expression-list stands for the whole line. Expressions take on string or numeric values as appropriate, and are built using the operators +, \-, *, /, %, and concatenation (indicated by a blank). The C operators ++, \-\-, +=, \-=, *=, /=, and %= are also available in expressions. Variables may be scalars, array elements (denoted x[i]) or fields. Variables are initialized to the null string. Array subscripts may be any string, not necessarily numeric; this allows for a form of associative memory. String constants are quoted "...". .PP The .I print statement prints its arguments on the standard output (or on a file if .I >file is present), separated by the current output field separator, and terminated by the output record separator. The .I printf statement formats its expression list according to the format (see .IR printf (3)). .PP The built-in function .I length returns the length of its argument taken as a string, or of the whole line if no argument. There are also built-in functions .I exp, .I log, .I sqrt, and .IR int . The last truncates its argument to an integer. .IR substr(s,\ m,\ n) returns the .IR n -character substring of .I s that begins at position .IR m . The function .IR sprintf(fmt,\ expr,\ expr,\ ...) formats the expressions according to the .IR printf (3) format given by .I fmt and returns the resulting string. .PP Patterns are arbitrary Boolean combinations (!, \(or\(or, &&, and parentheses) of regular expressions and relational expressions. Regular expressions must be surrounded by slashes and are as in .IR egrep . Isolated regular expressions in a pattern apply to the entire line. Regular expressions may also occur in relational expressions. .PP A pattern may consist of two patterns separated by a comma; in this case, the action is performed for all lines between an occurrence of the first pattern and the next occurrence of the second. .PP .nf A relational expression is one of the following: .PP .nf expression matchop regular-expression expression relop expression .PP .fi where a relop is any of the six relational operators in C, and a matchop is either ~ (for contains) or !~ (for does not contain). A conditional is an arithmetic expression, a relational expression, or a Boolean combination of these. .PP The special patterns BEGIN and END may be used to capture control before the first input line is read and after the last. BEGIN must be the first pattern, END the last. .PP A single character .I c may be used to separate the fields by starting the program with .PP BEGIN { FS = "c" } .PP or by using the .BI \-F c option. .PP Other variable names with special meanings include NF, the number of fields in the current record; NR, the ordinal number of the current record; FILENAME, the name of the current input file; OFS, the output field separator (default blank); ORS, the output record separator (default newline); and OFMT, the output format for numbers (default "%.6g"). .PP .SH EXAMPLES .PP Print lines longer than 72 characters: .PP .nf length > 72 .fi .PP Print first two fields in opposite order: .PP .nf { print $2, $1 } .fi .PP Add up first column, print sum and average: .PP .nf { s += $1 } END { print "sum is", s, " average is", s/NR } .fi .PP Print fields in reverse order: .PP .nf { for (i = NF; i > 0; \-\-i) print $i } .fi .PP Print all lines between start/stop pairs: .PP .nf /start/, /stop/ .fi .PP Print all lines whose first field is different from previous one: .PP .nf $1 != prev { print; prev = $1 } .fi .SH SEE ALSO .PP lex(1), sed(1) .br A. V. Aho, B. W. Kernighan, P. J. Weinberger, .I Awk \- a pattern scanning and processing language .SH BUGS There are no explicit conversions between numbers and strings. To force an expression to be treated as a number add 0 to it; to force it to be treated as a string concatenate "" to it. nt all lines between start/stop pairs: .PP .nf /start/, /stop/ .fi .PP Print all lines whose first field is different from previous one: .PP man/man1/basename.1 644 0 33 1070 2512730466 7302 .TH BASENAME 1 .SH NAME basename \- strip filename affixes .SH SYNOPSIS .B basename string [ suffix ] .SH DESCRIPTION .I Basename deletes any prefix ending in `/' and the .I suffix, if present in .I string, from .I string, and prints the result on the standard output. It is normally used inside substitution marks \`\ \` in shell procedures. .PP This shell procedure invoked with the argument .I /usr/src/cmd/cat.c compiles the named file and moves the output to .I cat in the current directory: .IP "" 15n cc $1 .br mv a.out \`basename $1 .c\` .SH "SEE ALSO" sh(1) xes .SH SYNOPSIS .B basename string [ suffix ] .SH DESCRIPTION .I Basename deletes any prefix ending in `/' and the .I suffix, if present in .I string, from .I string, and prints the result on the standard output. It is normally used inside substitution marks \`\ \` in shell procedures. .PP This shell procedure invoked with the argument .I /usr/src/cmd/cat.c compiles the named file and moves the output to .I cat in the current directory: .IP "" 15n cc man/man1/bc.1 644 0 33 6204 2512730466 6117 ((.TH BC 1 4/1/81 .SH NAME bc \- arbitrary-precision arithmetic language .SH SYNOPSIS .B bc [ .B \-c ] [ .B \-l ] [ file ... ] .SH DESCRIPTION .I Bc is an interactive processor for a language which resembles C but provides unlimited precision arithmetic. It takes input from any files given, then reads the standard input. The .B \-l argument stands for the name of an arbitrary precision math library. The syntax for .I bc programs is as follows; L means letter a-z, E means expression, S means statement. .HP 6 Comments .br are enclosed in /* and */. .HP 6 Names .br simple variables: L .br array elements: L [ E ] .br The words `ibase', `obase', and `scale' .HP 6 Other operands .br arbitrarily long numbers with optional sign and decimal point. .br ( E ) .br sqrt ( E ) .br length ( E ) number of significant decimal digits .br scale ( E ) number of digits right of decimal point .br L ( E , ... , E ) .HP 6 Operators .br + \- * / % ^ (% is remainder; ^ is power) .br ++ \-\- (prefix and postfix; apply to names) .br == <= >= != < > .br = += \-= *= /= %= ^= .br .HP 6 Statements .br E .br { S ; ... ; S } .br if ( E ) S .br while ( E ) S .br for ( E ; E ; E ) S .br null statement .br break .br quit .HP 6 Function definitions .br define L ( L ,..., L ) { .br auto L, ... , L .br S; ... S .br return ( E ) .br } .HP 6 Functions in .B \-l math library .br s(x) sine .br c(x) cosine .br e(x) exponential .br l(x) log .br a(x) arctangent .br j(n,x) Bessel function .PP .DT All function arguments are passed by value. .PP The value of a statement that is an expression is printed unless the main operator is an assignment. Either semicolons or newlines may separate statements. Assignment to .I scale influences the number of digits to be retained on arithmetic operations in the manner of .IR dc (1). Assignments to .I ibase or .I obase set the input and output number radix respectively. .PP The same letter may be used as an array, a function, and a simple variable simultaneously. All variables are global to the program. `Auto' variables are pushed down during function calls. When using arrays as function arguments or defining them as automatic variables empty square brackets must follow the array name. .PP For example .PP .nf scale = 20 define e(x){ auto a, b, c, i, s a = 1 b = 1 s = 1 for(i=1; 1==1; i++){ a = a*x b = b*i c = a/b if(c == 0) return(s) s = s+c } } .PP .fi defines a function to compute an approximate value of the exponential function and .PP .nf for(i=1; i<=10; i++) e(i) .fi .PP prints approximate values of the exponential function of the first ten integers. .PP .I Bc is actually a preprocessor for .IR dc (1), which it invokes automatically, unless the .B \-c (compile only) option is present. In this case the .I dc input is sent to the standard output instead. .SH FILES .ta \w'/usr/lib/lib.b 'u /usr/lib/lib.b mathematical library .br dc(1) desk calculator proper .SH "SEE ALSO" dc(1) .br L. L. Cherry and R. Morris, .I BC \- An arbitrary precision desk-calculator language .SH BUGS No &&, \(or\|\(or, or ! operators. .br .I For statement must have all three E's. .br .I Quit is interpreted when read, not when executed. h it invokes automatically, unless the .B \-c (compile only) option is present. In this case the .I dc input is sent to the standard output instead. .SH FILES .ta \w'/usr/lib/lib.b 'u /usr/lib/lib.b mathematical library .br dc(1) desk calculator proper .SH "SEE ALSO" dc(1) .br L. L. Cherry and R. Morris, .I BC \- An arbitrary precision desk-calculator language .SH BUGS No &&, \man/man1/biff.1 644 0 33 1417 2512730467 6443 .TH BIFF 1 .UC 4 .SH NAME biff \- be notified if mail arrives and who it is from .SH SYNOPSIS .B biff [ .B yn ] .SH DESCRIPTION .I Biff informs the system whether you want to be notified when mail arrives during the current terminal session. The command .IP .B "biff y" .LP enables notification; the command .IP .B "biff n" .LP disables it. When mail notification is enabled, the header and first few lines of the message will be printed on your screen whenever mail arrives. A ``biff y'' command is often included in the file .I \&.login or .I \&.profile to be executed at each login. .PP .I Biff operates asynchronously. For synchronous notification use the MAIL variable of .IR sh (1) or the .I mail variable of .IR csh (1). .SH SEE ALSO csh(1), sh(1), mail(1), mail (4) .SH BUGS LP enables notification; the command .IP .B "biff n" .LP disables it. When mail notification is enabled, the header and first few lines of the message will be printed on your screen whenever mail arrives. A ``biff y'' command is often includman/man1/binmail.1 644 0 33 5115 2512730467 7147 .TH BINMAIL 1 11/16/79 .SH NAME mail \- send or receive mail among users .SH SYNOPSIS .B /bin/mail [ .B + ] [ .B \-i ] [ person ] ... .br .B /bin/mail .B "[ + ]" [ .B \-i ] .B \-f file .LP .SH DESCRIPTION Note: This is one of two mailers with the name .I mail. The default .I mail command is described in .IR mail (1), and its binary is in the directory .I /usr/ucb. .PP .I Mail with no argument prints a user's mail, message-by-message, in last-in, first-out order; the optional argument .B + causes first-in, first-out order. For each message, it reads a line from the standard input to direct disposition of the message. .TP newline Go on to next message. .TP d Delete message and go on to the next. .TP p Print message again. .TP \- Go back to previous message. .TP .RI "s [" " file " "] ..." Save the message in the named .I files (`mbox' default). .TP .RI "w [" " file " "] ..." Save the message, without a header, in the named .I files (`mbox' default). .TP .RI "m [" " person " "] ..." Mail the message to the named .I persons (yourself is default). .TP EOT (control-D) Put unexamined mail back in the mailbox and stop. .TP q Same as EOT. .TP .RI ! command Escape to the Shell to do .IR command . .TP * Print a command summary. .PP .PP An interrupt normally causes termination of the command; the mail file is unchanged. The optional argument .B \(mii causes .I mail to continue after interrupts. .PP When .I persons are named, .I mail takes the standard input up to an end-of-file (or a line with just `.') and adds it to each .I person's `mail' file. The message is preceded by the sender's name and a postmark. Lines that look like postmarks are prepended with `>'. A .I person is usually a user name recognized by .IR login (1). To denote a recipient on a remote system, prefix .I person by the system name and exclamation mark (see .IR uucp (1)). .PP The .B \-f option causes the named file, e.g. `mbox', to be printed as if it were the mail file. .PP When a user logs in he is informed of the presence of mail. .SH FILES .ta \w'/usr/spool/mail/*.lock 'u /etc/passwd to identify sender and locate persons .br .li /usr/spool/mail/* incoming mail for user * .br mbox saved mail .br /tmp/ma* temp file .br /usr/spool/mail/*.lock lock for mail directory .br dead.letter unmailable text .br .SH "SEE ALSO" mail(1), write(1), uucp(1), uux(1), xsend(1), delivermail(8) .SH BUGS Race conditions sometimes result in a failure to remove a lock file. .PP Normally anybody can read your mail, unless it is sent by .IR xsend (1). An installation can overcome this by making .I mail a set-user-id command that owns the mail directory. li /usr/spool/mail/* incoming mail for user * .br mbox saved mail .br /tmp/ma* temp file .br /usr/spool/mail/*.lock lock for mail directory .br dead.letter unmailable text .br .SH "SEE ALSO" mail(1), write(1), uucp(1), uux(1), xsend(1), delivermail(8) .SH BUGS Race conditions sometimes result in a failure to remove a lock file. .PP Normally anybody can read your mail, unless it is sent by .IR xsend (1). An installation can overcomman/man1/cal.1 644 0 33 1055 2512730467 6272 .TH CAL 1 .SH NAME cal \- print calendar .SH SYNOPSIS .B cal [ month ] year .SH DESCRIPTION .I Cal prints a calendar for the specified year. If a month is also specified, a calendar just for that month is printed. .I Year can be between 1 and 9999. The .I month is a number between 1 and 12. The calendar produced is that for England and her colonies. .PP Try September 1752. .SH BUGS The year is always considered to start in January even though this is historically naive. .br Beware that `cal 78' refers to the early Christian era, not the 20th century. SYNOPSIS .B cal [ month ] year .SH DESCRIPTION .I Cal prints a calendar for the specified year. If a month is also specified, a calendar just for that month is printed. .I Year can be between 1 and 9999. The .I month is a number between 1 and 12. The calendar produced is that for England and her colonies. .PP Try September 1752. .SH BUGS The year is always considered to start in January even though this is historically naive. .br Beware that `cal 78' refers to th((man/man1/calendar.1 644 0 33 2110 2512730467 7275 .TH CALENDAR 1 4/1/81 .SH NAME calendar \- reminder service .SH SYNOPSIS .B calendar [ \- ] .SH DESCRIPTION .I Calendar consults the file `calendar' in the current directory and prints out lines that contain today's or tomorrow's date anywhere in the line. Most reasonable month-day dates such as `Dec. 7,' `december 7,' `12/7,' etc., are recognized, but not `7 December' or `7/12'. If you give just a date, i.e. ``1'', that day in any month will do. On weekends `tomorrow' extends through Monday. .PP When an argument is present, .I calendar does its job for every user who has a file `calendar' in his login directory and sends him any positive results by .IR mail (1). Normally this is done daily in the wee hours under control of .IR cron (8). .SH FILES calendar .br /usr/lib/calendar to figure out today's and tomorrow's dates .br /etc/passwd .br /tmp/cal* .br egrep, sed, mail subprocesses .SH "SEE ALSO" at(1), cron(8), mail(1) .SH BUGS Your calendar must be public information for you to get reminder service. .br .I Calendar's extended idea of `tomorrow' doesn't account for holidays. ile `calendar' in his login directory and sends him any positive results by .IR mail (1). Normally this is done daily in the wee hours under control of .IR cron (8). .SH FILES calendar .br /usr/lib/calendar to figure out today's and tomorrow's dates .br /etc/passwd .br /tmp/cal* .br egrep, sed, mail subprocesses .SH "SEE ALSO" at(1), cron(8), mail(1) .SH BUGS Your calendar must be public information for you to get reminder service. .br man/man1/call.1c 644 0 33 612 2512730467 6567 .TH CALL 1C .SH NAME call \- ring a telephone .SH SYNOPSIS .B call phonenumber .SH DESCRIPTION .I Call places an outgoing call to the specified .IR phonenumber . Nothing special happens when the called party answers. .I Phonenumber may have any number of digits; a `+' sign may be used to specify a point at which to wait for a second dial tone. .SH FILES /dev/dn0 .SH "SEE ALSO" cu(1), dn(5) ALSO" at(1), cron(8), mai/( ,( 5Ċ /\@,\D"man/man1/cat.1 644 0 33 3035 2512730467 6302 .TH CAT 1 .UC 4 .SH NAME cat \- catenate and print .SH SYNOPSIS .B cat [ .B \-u ] [ .B \-n ] [ .B \-s ] [ .B \-v ] file ... .br .SH DESCRIPTION .I Cat reads each .I file in sequence and writes it on the standard output. Thus .PP .ti+15n cat file .PP prints the file, and .PP .ti+15n cat file1 file2 >file3 .PP concatenates the first two files and places the result on the third. .PP If no input file is given, or if the argument `\-' is encountered, .I cat reads from the standard input file. Output is buffered in 1024-byte blocks unless the standard output is a terminal, in which case it is line buffered. The .B \-u option causes the output to be completely unbuffered. .PP The option .B \-n causes the output lines to be numbered sequentially from 1. Giving .B \-b with .B \-n causes numbers to be omitted from blank lines. .PP The option .B \-s causes the output to be single spaced by crushing out multiple adjacent empty lines. .PP The option .B \-v causes non-printing characters to be printed in a visible way. Control characters print like ^X for control-x; the delete character (octal 0177) prints as ^?. Non-ascii characters (with the high bit set) are printed as M- (for meta) followed by the character of the low 7 bits. A .B \-e option may be given with .B \-v and causes the ends of lines to be followed by the character `$'; the .B \-t option with .B \-v causes tabs to be printed as ^I. .PP .SH "SEE ALSO" cp(1), ex(1), more(1), pr(1), tail(1) .SH BUGS Beware of `cat a b >a' and `cat a b >b', which destroy the input files before reading them. X for control-x; the delete character (octal 0177) prints as ^?. Non-ascii characters (with the high bit set) are printed as M- (for meta) followed by the character of the low 7 bits. A .B \-e option may be given with .B \-v and causes the ends of lines to be followed by the character `$'; the .B \-t option with .B \-v causes tabs to be printed as ^I. .PP .SH "SEE ALSO" cp(1), ex(1), more(1), pr(1), tail(1) .SH BUGS Beware of `cat a b >a' and `cat a b >b', which destroy the inpuman/man1/cb.1 644 0 33 366 2512730467 6103 .TH CB 1 .SH NAME cb \- C program beautifier .SH SYNOPSIS .B cb .SH DESCRIPTION .I Cb places a copy of the C program from the standard input on the standard output with spacing and indentation that displays the structure of the program. .SH BUGS .B \-v and causes the ends of lines to be followed by the character `$'; the .B \-t option with .B \-v causes tabs to be printed as ^I. .PP .SH "SEE ALSO" cp(1), ex(1), more/( ,( 5ЋĊ /\@,\D"man/man1/cc.1 644 0 33 10601 2512730467 6135 .TH CC 1 4/1/81 .UC 4 .SH NAME cc \- C compiler .SH SYNOPSIS .B cc [ option ] ... file ... .SH DESCRIPTION .I Cc is the UNIX C compiler. .B N.B.: .I cc has been recently modified to accept arbitrary length identifiers and to produce a new object file format; see .IR old (8) for information on dealing with old format programs. .PP .I Cc accepts several types of arguments: .PP Arguments whose names end with `.c' are taken to be C source programs; they are compiled, and each object program is left on the file whose name is that of the source with `.o' substituted for `.c'. The `.o' file is normally deleted, however, if a single C program is compiled and loaded all at one go. .PP In the same way, arguments whose names end with `.s' are taken to be assembly source programs and are assembled, producing a `.o' file. .PP The following options are interpreted by .IR cc . See .IR ld (1) for load-time options. .TP 8 .B \-c Suppress the loading phase of the compilation, and force an object file to be produced even if only one program is compiled. .TP .B \-g Have the compiler produce additional symbol table information for .IR sdb (1). Also pass the .B \-lg flag to .IR ld (1). .TP .B \-w Suppress warning diagnostics. .TP .B \-p Arrange for the compiler to produce code which counts the number of times each routine is called; also, if loading takes place, replace the standard startup routine by one which automatically calls .IR monitor (3) at the start and arranges to write out a .I mon.out file at normal termination of execution of the object program. An execution profile can then be generated by use of .IR prof (1). .TP .SM .B \-O Invoke an object-code improver. .TP .SM .B \-R Passed on to .I as, making initialized variables shared and read-only. .TP .SM .B \-S Compile the named C programs, and leave the assembler-language output on corresponding files suffixed `.s'. .TP .SM .B \-E Run only the macro preprocessor on the named C programs, and send the result to the standard output. .TP .SM .B \-C prevent the macro preprocessor from eliding comments. .TP .BI \-o " output" Name the final output file .IR output . If this option is used the file `a.out' will be left undisturbed. .TP .SM .BI \-D name=def .br .ns .TP .SM .BI \-D \*Sname Define the .I name to the preprocessor, as if by `#define'. If no definition is given, the name is defined as "1". .TP .SM .BI \-U \*Sname Remove any initial definition of .IR name . .TP .SM .BI \-I \*Sdir `#include' files whose names do not begin with `/' are always sought first in the directory of the .I file argument, then in directories named in .B \-I options, then in directories on a standard list. .TP .SM .BI \-B \*Sstring Find substitute compiler passes in the files named .I string with the suffixes cpp, ccom and c2. If .I string is empty, use a standard backup version. .TP .BR \-t [ p012 ] Find only the designated compiler passes in the files whose names are constructed by a .B \-B option. In the absence of a .B \-B option, the .I string is taken to be `/usr/c/'. .PP Other arguments are t((aken to be either loader option arguments, or C-compatible object programs, typically produced by an earlier .I cc run, or perhaps libraries of C-compatible routines. These programs, together with the results of any compilations specified, are loaded (in the order given) to produce an executable program with name .B a.out. .SH FILES .ta \w'/usr/c/occom 'u file.c input file .br file.o object file .br a.out loaded output .br /tmp/ctm? temporary .br /lib/cpp preprocessor .br /lib/ccom compiler .br /usr/c/occom backup compiler .br /usr/c/ocpp backup preprocessor .br /lib/c2 optional optimizer .br /lib/crt0.o runtime startoff .br /lib/mcrt0.o startoff for profiling .br /lib/libc.a standard library, see (3) .br /usr/include standard directory for `#include' files .SH "SEE ALSO" B. W. Kernighan and D. M. Ritchie, .I The C Programming Language, Prentice-Hall, 1978 .br B. W. Kernighan, .I Programming in C\(ema tutorial .br D. M. Ritchie, .I C Reference Manual .br monitor(3), prof(1), adb(1), ld(1), sdb(1), old(8) .SH DIAGNOSTICS The diagnostics produced by C itself are intended to be self-explanatory. Occasional messages may be produced by the assembler or loader. .SH BUGS The compiler currently ignores advice to put \fBchar\fR, \fBunsigned char\fR, \fBshort\fR or \fBunsigned short\fR variables in registers. It previously produced poor, and in some cases incorrect, code for such declarations. gramming in C\(ema tutorial .br D. M. Ritchie, .I C Reference Manual .br monitor(3), prof(1), adb(1), ld(1), sdb(1), old(8) .SHman/man1/ccat.1 664 0 33 34 2512730470 6375 .so /usr/man/man1/compact.1 produced by C itself are intended to be self-explanatory. Occasional messages may be produced by the assembler or loader. .SH BUGS The compiler currently ignores advice to put \fBchar\fR, \fBunsigned char\fR, \fBshort\fR or \fBunsigned short\fR variables in registers. It previously produced poor, and in some cases incorrect, code for such declarations. gramming in C\(ema tutorial .br D. /( ,( 5Ċ /\@,\D"man/man1/cd.1 644 0 33 1243 2512730470 6112 .TH CD 1 .UC 4 .SH NAME cd \- change working directory .SH SYNOPSIS .B cd directory .SH DESCRIPTION .I Directory becomes the new working directory. The process must have execute (search) permission in .IR directory . .PP Because a new process is created to execute each command, .I cd would be ineffective if it were written as a normal command. It is therefore recognized and executed by the shells. In .IR csh (1) you may specify a list of directories in which .I directory is to be sought as a subdirectory if it is not a subdirectory of the current directory; see the description of the .I cdpath variable in .IR csh (1). .SH "SEE ALSO" csh(1), sh(1), pwd(1), chdir(2) st have execute (search) permission in .IR directory . .PP Because a new process is created to execute each command, .I cd would be ineffective if it were written as a normal command. It is therefore recognized and executed by the shells. In .IR csh (1) you may specify a list of directories in which .I directory is to be sought as a subdirectory man/man1/checknr.1 644 0 33 4234 2512730470 7144 .TH CHECKNR 1 4/5/80 .UC 4 .SH NAME checknr \- check nroff/troff files .SH SYNOPSIS .B checknr [ .B \-s ] [ .B \-f ] [ .BR \-a ".x1.y1.x2.y2. ... .xn.yn" ] [ .BR \-c ".x1.x2.x3 ... .xn" ] \fIfile\fP ... .SH DESCRIPTION .I Checknr checks a list of .IR nroff (1) or .IR troff (1) input files for certain kinds of errors involving mismatched opening and closing delimiters and unknown commands. Delimeters checked are: .IP (1) Font changes using \efx ... \efP. .IP (2) Size changes using \esx ... \es0. .IP (3) Macros that come in open ... close forms, for example, the .TS and .TE macros which must always come in pairs. .PP .I Checknr knows about the .IR ms (7) and .IR me (7) macro packages. .PP Additional pairs of macros can be added to the list using the .B \-a option. This must be followed by groups of six characters, each group defining a pair of macros. The six characters are a period, the first macro name, another period, and the second macro name. For example, to define a pair .BS and .ES, use \-\fBa\fP.BS.ES .PP The .B \-c option defines commands which would otherwise be complained about as undefined. .PP The .B \-f option requests .I checknr to ignore \ef font changes. .PP The .B \-s option requests .I checknr to ignore \es size changes. .PP .I Checknr is intended to be used on documents that are prepared with .I checknr in mind, much the same as .I lint. It expects a certain document writing style for \ef and \es commands, in that each \efx must be terminated with \efP and each \esx must be terminated with \es0. While it will work to directly go into the next font or explicitly specify the original font or point size, and many existing documents actually do this, such a practice will produce complaints from .I checknr. Since it is probably better to use the \efP and \es0 forms anyway, you should think of this as a contribution to your document preparation style. .SH SEE\ ALSO nroff(1), troff(1), ms(7), me(7), checkeqn(1) .SH DIAGNOSTICS Complaints about unmatched delimiters. .br Complaints about unrecognized commands. .br Various complaints about the syntax of commands. .SH AUTHOR Mark Horton .SH BUGS There is no way to define a 1 character macro name using .B \-a such a practice will produce complaints from .I checknr. Since it is probably better to use the \efP and \es0 forms anyway, you should think of this as a contribution to your document preparation style. .SH SEE\ ALSO nroff(1), troff(1), ms(7), me(7), checkeqn(1) .SH DIAGNOSTICS Complaints about unmatched delimiters. .br Complaints about unrecognized comman/man1/chfn.1 644 0 33 3016 2512730470 6442 .TH CHFN 1 deprecated .UC 4 .SH NAME chfn \- change full name of user .SH SYNOPSIS .B chfn name string .SH DESCRIPTION .I Chfn is a command similar to .IR passwd (1) except that it is used to change the gcos field of the password file rather than the password entry. Note that the string specified will replace the entire gecos field of the specified user. If (as on the UCB system) this field contains information in addition to the user's full name, this information must be included in string or it will be deleted. Hence chfn can be used to fix phone numbers, offices, etc. .PP An example use of this command would be .PP .DT chfn mark \'& Horton,508E,7686,5240633\' .PP Note that the string must in general be quoted to shield blanks and special characters from the shell. The field should consist of the users name, followed by their office number, followed by the last 4 digits of their office extension and finally their home phone number. Any of these can be omitted. At UCB, offices can be given as ``508E'' for 508 Evans, and ``187MC'' for 187M Cory. There should be no spaces in the entry except for those in your name. .PP It is a good idea to run .IR finger (1) on the user before and after .I chfn to make sure you have formatted the data correctly. .SH SEE\ ALSO finger(1), passwd(5), chsh(1), passwd(1) .SH AUTHOR Mark Horton .SH BUGS The encoding of the office and extension information is installation dependent. .PP A new user-information data base is in the works which will supplant this program; .I chfn's days are numbered. ``187MC'' for 187M Cory. There should be no spaces in the entry except for those in your name. .PP It is a good idea to run .IR finger (1) on the user before and after .I chfn to make sure you have formatted the data correctly. .SH SEE\ ALSO finger(1), passwd(5), chsh(1), passwd(1) .SH AUTHOR Mark Horton .SH BUGS The encoding of the office and extension information is installation dependent. .PP A new user-information data base is in the works which will supplant this program; .I chfn's days man/man1/chmod.1 644 0 33 3675 2512730470 6631 ((.TH CHMOD 1 .SH NAME chmod \- change mode .SH SYNOPSIS .B chmod mode file ... .SH DESCRIPTION The mode of each named file is changed according to .I mode, which may be absolute or symbolic. An absolute .I mode is an octal number constructed from the OR of the following modes: .TP 10 4000 set user ID on execution .br .br .ns .TP 10 2000 set group ID on execution .br .br .ns .TP 10 1000 sticky bit, see .IR chmod (2) .br .br .ns .TP 10 0400 read by owner .br .br .ns .TP 10 0200 write by owner .br .br .ns .TP 10 0100 execute (search in directory) by owner .br .br .ns .TP 10 0070 read, write, execute (search) by group .br .br .ns .TP 10 0007 read, write, execute (search) by others .PP A symbolic .I mode has the form: .IP .RI [ who ] .I op permission .RI [ "op permission" "] ..." .PP The .I who part is a combination of the letters .B u (for user's permissions), .B g (group) and .B o (other). The letter .B a stands for .B ugo. If .I who is omitted, the default is .I a but the setting of the file creation mask (see umask(2)) is taken into account. .PP .I Op can be .B + to add .I permission to the file's mode, .B \- to take away .I permission and .B = to assign .I permission absolutely (all other bits will be reset). .PP .I Permission is any combination of the letters .B r (read), .B w (write), .B x (execute), .B s (set owner or group id) and .B t (save text \- sticky). Letters .BR u, .B g or .B o indicate that .I permission is to be taken from the current mode. Omitting .I permission is only useful with .B = to take away all permissions. .PP The first example denies write permission to others, the second makes a file executable: .IP chmod o\-w file .br chmod +x file .PP Multiple symbolic modes separated by commas may be given. Operations are performed in the order specified. The letter .B s is only useful with .B u or .B g. .PP Only the owner of a file (or the super-user) may change its mode. .SH "SEE ALSO" ls(1), chmod(2), stat(2), umask(2), chown(8) rrent mode. Omitting .I permission is only useful with .B = to takeman/man1/chsh.1 644 0 33 1104 2512730470 6445 .TH CHSH 1 .UC 4 .SH NAME chsh \- change default login shell .SH SYNOPSIS .B chsh name [ shell ] .SH DESCRIPTION .I Chsh is a command similar to .IR passwd (1) except that it is used to change the login shell field of the password file rather than the password entry. If no .I shell is specified then the shell reverts to the default login shell .I /bin/sh. Otherwise only .I /bin/csh or .I /bin/oldcsh can be specified as the shell unless you are the super-user. .PP An example use of this command would be .PP .DT chsh bill /bin/csh .SH SEE\ ALSO csh(1), passwd(1), passwd(5) OPSIS .B chsh name [ shell ] .SH DESCRIPTION .I Chsh is a command similar to .IR passwd (1) except that it is used to change the login shell field of the password file rather than the password entry. If no .I shell is specified then the shell reverts to the default login shell .I /bin/sh. Otherwise only .I /bin/csh or .I /bin/oldcsh can be specified as the shell unless you are the super-user. .PP An example use of this command would be .PPman/man1/cifplot.1 644 0 33 25050 2512730471 7207 .TH CIFPLOT 1 10/21/80 .UC 4 .SH NAME cifplot \- CIF interpreter and plotter .SH SYNOPSIS .B cifplot [ .I options ] file1.cif [ file2.cif ... ] .SH DESCRIPTION .I Cifplot takes a description in Cal-Tech Intermediate Form (CIF) and produces a plot. CIF is a low-level graphics language suitable for describing integrated circuit layouts. Although CIF can be used for other graphics applications, for ease of discussion it will be assumed that CIF is used to describe integrated circuit designs. .I Cifplot interprets any legal CIF 2.0 description including symbol renaming and Delete Definition commands. In addition, a number of local extensions have been added to CIF, including text on plots and include files. These are discussed later. Care has been taken to avoid any arbitrary restrictions on the CIF programs that can be plotted. .PP To get a plot call .I cifplot with the name of the CIF file to be plotted. If the CIF description is divided among several files call .I cifplot with the names of all files to be used. .I Cifplot reads the CIF description from the files in the order that they appear on the command line. Therefore the CIF .I End command should be only in the last file since .I cifplot ignores everything after the .I End command. After reading the CIF description but before plotting, .I cifplot will print a estimate of the size of the plot and then ask if it should continue to produce a plot. Type .B y to proceed and .B n to abort. A typical run might look as follows: .PP .in +0.5i % .B cifplot lib.cif sorter.cif .br Window -5700 174000 -76500 168900 .br Scale: 1 micron is 0.004075 inches .br The plot will be 0.610833 feet .br Do you want a plot? .B y .PP After typing .B y .I cifplot will produce a plot on the Benson-Varian plotter. .PP .I Cifplot recognizes several command line options. These can be used to change the size and scale of the plot, change default plot options, and to select the output device. Several options may be selected. A dash(-) must precede each option specifier. The following is a list of options that may be included on the command line: .TP \fB\-w\fI xmin xmax ymin ymax .RB ( window ) The -w options specifies the window; by default the window is set to be large enough to contain the entire plot. The windowing commands lets you plot just a small section of your chip, enabling you to see it in better detail. .I Xmin, xmax, ymin, and .I ymax should be specified in CIF coordinates. .TP \fB\-s\fI float .RB ( scale ) The -s option sets the scale of the plot. By default the scale is set so that the window will fill the whole page. .I Float is a floating point number specifying the number of inches which represents 1 micron. A recommended size is 0.02. .TP .BI \-l " layer_list" .RB ( layer ) Normally all layers are plotted. The -l option specifies which layers NOT to plot. The .I layer_list consists of the layer names separated by commas, no spaces. There are two reserved names: .B text and .BR bbox . Including the layer name .B text in the list suppresses the plotting of text; .B bbox suppresses the bounding box around symbols. .TP .BI \-d " n" .RB ( depth ) This option lets you limit the amount of detail plotted in a hierarchically designed chip. It will only instanciate the plot down .I n levels of calls. Sometimes too much detail can hide important features in a circuit. .TP .BI \-g " n" .RB ( grid ) Draw a grid over the plot with spacing every .I n CIF units. .TP .B \-f .RB ( fuzzy ) Don't print the border outlines around the merged features on each layer. .TP .B \-h .RB ( half ) Plot at half normal resolution. .I (Not yet implemented.) .TP .B \-e .RB ( extensions ) Accept only standard CIF. User extensions produce warnings. .TP .B \-I .RB ( non-Interactive ) Do not ask for confirmation. Always plot. .TP .B \-L .RB ( List ) Produce a listing of the CIF file on standard output as it is parsed. Not recommended unless debugging hand-coded CIF since CIF code can be rather long. .TP .BI \-a " n" .RB ( approximate ) Approximate a roundflash with an .IR n -sided polygon. By default .I n equals 8. (I.e. roundflashes are approximated by octagons.) If .I n equals 0 then output circles for roundflashes. (It is best not to use full circles since they significantly slow down plotting.) .I (Full circles not yet implemented.) .TP \fB\-b\fI "text" .RB ( banner ) Print the text at the top of the plot. .TP .B \-C .RB ( Comments ) Treat comments as though they were spaces. Sometimes CIF files created at other universities will have several errors due to syntactically incorrect comments. (I.e. the comments may appear in the middle of a CIF command or the comment does not end with a semi-colon.) Of course, CIF files should not have any errors and these comment related errors must be fixed before transmitting the file for fabrication. But many times fixing these errors seems to be more trouble than it is worth, especially if you just want to get a plot. This option is useful in getting rid of many of these comment related syntax errors. .TP .B \-r .RB ( rotate ) Rotate the plot 90 degrees. .TP .B \-V .RB ( Varian ) Send output to the varian. (This is the default option.) .TP .B \-W .RB ( Wide ) Send output directly to the versatec. .TP .B \-S .RB ( Spool ) Store the output in a temporary file then dump the output quickly onto the Versatec. Makes nice crisp plots; also takes up a lot of disk space. .TP .BI \-T " n" .RB ( Terminal ) Send output byte stream to standard output. Useful for setting up pipes. .I N is the number of bytes per line that the plotting device expects. .I (Not yet implemented.) .TP .B \-H .RB ( HP2648 ) Send output to HP2648A terminal. This requires that .I cifplot is running in the foreground on an HP2648 and that there is a scratch tape in the left tape drive of the terminal. .I (Not yet fully implemented.) .TP .BI \-X " basename" .RB ( eXtractor ) From the CIF file create a circuit description suitable for switch level simulation. It creates two files: .IB basename .sim which contains the circuit description, and .IB basename .node which contains the node numbers and their location used in t((he circuit description. .IP When this option is invoked no plot is made. Therefore it is advisable not to use any of the other options that deal only with plotting. However, the .IR window , .IR layer , and .I approximate options are still appropriate. To get a plot of the circuit with the node numbers call .I cifplot again, without the .B \-X option, and include .IB basename .nodes in the list of CIF files to be plotted. (This file must appear in the list of files before the file with the CIF End command.) .I (Not yet fully implemented.) .TP .BI \-P " pattern_file" .RB ( Pattern ) The -P option lets you specify your own layers and stipple patterns. .I Pattern_file may contain an arbitrary number of layer descriptors. A layer descriptor is the layer name in double quotes, followed by 8 integers. Each integer specifies 32 bits where ones are black and zeroes are white. Thus the 8 integers specify a 32 by 8 bit stipple pattern. The integers may be in decimal, octal, or hex. Hex numbers start with '0x'; octal numbers start with '0'. The CIF syntax requires that layer names be made up of only uppercase letters and digits, and not longer than four characters. The following is example of a layer description for poly-silicon: .RS .TP "NP" 0x08080808 0x04040404 0x02020202 0x01010101 .RS 0x80808080 0x40404040 0x20202020 0x10101010 .RE .RE .TP .BI \-F " font_file" .RB ( Font ) The -F option indicates which font you want for your text. The file must be in the directory '/usr/lib/vfont'. The default font is Roman 6 point. Obviously, this option is only useful if you have text on your plot. .TP .BI \-O " filename" .RB ( Output ) After parsing the CIF files, store an equivalent but easy to parse CIF description in the specified file. This option removes the include and array commands (see next section) and replaces them with equivalent standard CIF statements. The resulting file is suitable for transmission to other facilities for fabrication. .PP In the definition of CIF provisions were made for local extensions. All extension commands begin with a number. Part of the purpose of these extensions is to test what features would be suitable to include as part of the standard language. But it is important to realize that these extensions are not standard CIF and that many programs interpreting CIF do not recognize them. If you use these extensions it is advisable to create another CIF file using the .B -O options described above before submitting your circuit for fabrication. The following is a list of extensions recognized by .IR cifplot . .TP .BI 0I " filename" ; .RB ( Include ) Read from the specified file as though it appeared in place of this command. Include files can be nested up to 6 deep. .TP \fB0A\fI s m n dx dy \fB; .RB ( Array ) Repeat symbol .I s m times with .I dx spacing in the x-direction and .I n times with .I dy spacing in the y-direction. .I s, m, and .I n are unsigned integers. .I dx and .I dy are signed integers in CIF units. .TP .BI 1 " message" ; .RB ( Print ) Print out the message on standard output when it is read. .TP \fB2\fI "text" transform \fB; .TP \fB2C\fI "text" transform \fB; .RB ( "Text on Plot" ) .I Text is placed on the plot at the position specified by the transformation. The allowed transformations are the same as the those allowed for the Call command. The transformation affects only the point at which the beginning of the text is to appear. The text is always plotted horizontally, thus the mirror and rotate transformations are not really of much use. Normally text is placed above and to the right of the reference point. The .B 2C command centers the text about the reference point. .TP .BI 9 " name" ; .RB ( "Name symbol" ) .I name is associated with the current symbol. .TP .BI 94 " name x y" ; .TP .BI 94 " name x y layer" ; .RB ( "Name point" ) .I name is associated with the point .RI ( x, .IR y ). Any mask geometry crossing this point is also associated with .IR name . If .I layer is present then just geometry crossing the point on that layer is associated with .IR name . For plotting this command is similar to text on plot. When doing circuit extraction this command is used to give an explicit name to a node. .I Name must not have any spaces in it, and it should not be a number. .SH FILES /usr/lib/vdump .br /usr/lib/vfont/* .br /usr/lib/vpd .br /usr/tmp/cif* .SH ALSO SEE .I A Guide to LSI Implementation by Hon and Se\*'quin, Second Edition (Xerox PARC, 1980) for a description of CIF. .br .I Introduction to VLSI Systems by Mead and Conway (Addison-Wesley, 1980) .SH AUTHOR Dan Fitzpatrick .SH BUGS Output should be spooled. lot. When doing circuit extraction this command is used to give an explicit name to a node. .I Name must not have any spaces in it, and it should not be a number. .SH FILES /usr/lib/vdump .br /usr/lib/vfont/* .br /usr/lib/vpd .br /usr/tmp/cif* .SH ALSO SEE .I A Guide to LSI Implementation by Hon and Se\*'quin, Second Edition (Xerox PARC, 1980) for a description of CIF. .br .I Introduction to VLSI Systems by Mead and Conway (Addison-Wesley, 1980) .SH AUTHOR Dan Fitzpatman/man1/clear.1 644 0 33 512 2512730471 6571 .TH CLEAR 1 2/24/79 .UC .SH NAME clear \- clear terminal screen .SH SYNOPSIS .B clear .SH DESCRIPTION .I Clear clears your screen if this is possible. It looks in the environment for the terminal type and then in .I /etc/termcap to figure out how to clear the screen. .SH FILES /etc/termcap terminal capability data base .SH BUGS by Hon and Se\*'quin, Second Edition (Xerox PARC, 1980) for a description of CIF. .br .I I/( ,( 5`Ċ /\@,\D"man/man1/cmp.1 644 0 33 1407 2512730471 6306 .TH CMP 1 .SH NAME cmp \- compare two files .SH SYNOPSIS .B cmp [ .B \-l ] [ .B \-s ] file1 file2 .SH DESCRIPTION The two files are compared. (If .I file1 is `\-', the standard input is used.) Under default options, .I cmp makes no comment if the files are the same; if they differ, it announces the byte and line number at which the difference occurred. If one file is an initial subsequence of the other, that fact is noted. .PP Options: .TP 6 .B \-l Print the byte number (decimal) and the differing bytes (octal) for each difference. .TP 6 .B \-s Print nothing for differing files; return codes only. .dt .SH "SEE ALSO" diff(1), comm(1) .SH DIAGNOSTICS Exit code 0 is returned for identical files, 1 for different files, and 2 for an inaccessible or missing argument. ame; if they differ, it announces the byte and line number at which the difference occurred. If one file is an initial subsequence of the other, that fact is noted. .PP Options: .TP 6 .B \-l Print the byte number (decimal) and the differing bytes (man/man1/col.1 644 0 33 4005 2512730471 6301 .TH COL 1 .SH NAME col \- filter reverse line feeds .SH SYNOPSIS .B col [\|\-bfx\|] .SH DESCRIPTION .I Col reads the standard input and writes the standard output. It performs the line overlays implied by reverse line feeds (ESC-7 in ASCII) and by forward and reverse half line feeds (ESC-9 and ESC-8). .I Col is particularly useful for filtering multicolumn output made with the `.rt' command of .I nroff and output resulting from use of the .IR tbl (1) preprocessor. .PP Although .I col accepts half line motions in its input, it normally does not emit them on output. Instead, text that would appear between lines is moved to the next lower full line boundary. This treatment can be suppressed by the .B \-f (fine) option; in this case the output from .I col may contain forward half line feeds (ESC-9), but will still never contain either kind of reverse line motion. .PP If the .B \-b option is given, .I col assumes that the output device in use is not capable of backspacing. In this case, if several characters are to appear in the same place, only the last one read will be taken. .PP The control characters SO (ASCII code 017), and SI (016) are assumed to start and end text in an alternate character set. The character set (primary or alternate) associated with each printing character read is remembered; on output, SO and SI characters are generated where necessary to maintain the correct treatment of each character. .PP .I Col normally converts white space to tabs to shorten printing time. If the .B \-x option is given, this conversion is suppressed. .PP All control characters are removed from the input except space, backspace, tab, return, newline, ESC (033) followed by one of 7, 8, 9, SI, SO, and VT (013). This last character is an alternate form of full reverse line feed, for compatibility with some other hardware conventions. All other non-printing characters are ignored. .SH "SEE ALSO" troff(1), tbl(1), greek(1) .SH BUGS Can't back up more than 128 lines. .br No more than 800 characters, including backspaces, on a l((ine. s conversion is suppressed. .PP All control characters are removed from the input except space, backspace, tab, return, newline, ESC (033) followed by one of 7, 8, 9, SI, SO, and VT (013). This last character is an alternate form of full reverse line feed, for compatibility with some other hardware conventions. All other non-printing characters are ignored. .SH "SEE ALSO" troff(1), tbl(1), greek(1) .SH BUGS Can't back up more than 128 lines. .br No more than 800 characters, including backspaces, on a lman/man1/colcrt.1 644 0 33 3156 2512730471 7020 .TH COLCRT 1 2/24/79 .UC .SH NAME colcrt \- filter nroff output for CRT previewing .SH SYNOPSIS .B colcrt [ .B \- ] [ .B \-2 ] [ file ... ] .SH DESCRIPTION .I Colcrt provides virtual half-line and reverse line feed sequences for terminals without such capability, and on which overstriking is destructive. Half-line characters and underlining (changed to dashing `\-') are placed on new lines in between the normal output lines. .PP The optional .B \- suppresses all underlining. It is especially useful for previewing .I allboxed tables from .IR tbl (1). .PP The option .B \-2 causes all half-lines to be printed, effectively double spacing the output. Normally, a minimal space output format is used which will suppress empty lines. The program never suppresses two consecutive empty lines, however. The .B \-2 option is useful for sending output to the line printer when the output contains superscripts and subscripts which would otherwise be invisible. .PP A typical use of .I colcrt would be .PP .DT tbl exum2.n | nroff \-ms | colcrt \- | more .SH "SEE ALSO" nroff/troff(1), col(1), more(1), ul(1) .SH AUTHOR William Joy .SH BUGS Should fold underlines onto blanks even with the `\fB\-\fR' option so that a true underline character would show; if we did this, however, .I colcrt wouldn't get rid of .I cu'd underlining completely. .PP Can't back up more than 102 lines. .PP General overstriking is lost; as a special case `|' overstruck with `\-' or underline becomes `+'. .PP Lines are trimmed to 132 characters. .PP Some provision should be made for processing superscripts and subscripts in documents which are already double-spaced. BUGS Should fold underlines onto blanks even with the `\fB\-\fR' option so that a true underline character would show; if we did this, however, .I colcrt wouldn't get rid of .I cu'd underlining completely. .PP Can't back up more than 102 lines. .PP General overstriking is lost; as a special case `|' overstruck with `\-' or underline becomes `+'. .PP Lines are trimmed to 132 characters. .PP Some provman/man1/colrm.1 664 0 33 1054 2512730471 6643 .TH COLRM 1 .UC 4 .SH NAME colrm \- remove columns from a file .SH SYNOPSIS .B colrm [ startcol [ endcol ] ] .SH DESCRIPTION .I Colrm removes selected columns from a file. Input is taken from standard input. Output is sent to standard output. .PP If called with one parameter the columns of each line will be removed starting with the specified column. If called with two parameters the columns from the first column to the last column will be removed. .PP Column numbering starts with column 1. .SH SEE\ ALSO expand(1) .SH AUTHOR Jeff Schriebman .SH BUGS olumns from a file .SH SYNOPSIS .B colrm [ startcol [ endcol ] ] .SH DESCRIPTION .I Colrm removes selected columns from a file. Input is taken from standard input. Output is sent to standard output. .PP If called with one parameter the columns of each line will be removed starting with the specified column. If called with two parameters the columns from the first column to the last column will be removed. .PP Column numbering starts with column 1. .SH SEE\ ALSO exman/man1/comm.1 644 0 33 1244 2512730471 6461 .TH COMM 1 .SH NAME comm \- select or reject lines common to two sorted files .SH SYNOPSIS .B comm [ .B \- [ .B 123 ] ] file1 file2 .SH DESCRIPTION .I Comm reads .I file1 and .I file2, which should be ordered in ASCII collating sequence, and produces a three column output: lines only in .I file1; lines only in .I file2; and lines in both files. The filename `\-' means the standard input. .PP Flags 1, 2, or 3 suppress printing of the corresponding column. Thus .B comm .B \-12 prints only the lines common to the two files; .B comm .B \-23 prints only lines in the first file but not in the second; .B comm .B \-123 is a no-op. .PP .SH "SEE ALSO" cmp(1), diff(1), uniq(1) I file1 and .I file2, which should be ordered in ASCII collating sequence, and produces a three column output: lines only in .I file1; lines only in .I file2; and lines in both files. The filename `\-' means the standard input. .PP Flags 1, 2, or 3 suppress printing of the corresponding column. Thus .B comm .B \-12 prints only the lines common toman/man1/compact.1 644 0 33 4044 2512730471 7155 .TH COMPACT 1 .UC 4 .SH NAME compact, uncompact, ccat \- compress and uncompress files, and cat them .SH SYNOPSIS .B compact [ name ... ] .br .B uncompact [ name ... ] .br .B ccat [ file ... ] .SH DESCRIPTION .I Compact compresses the named files using an adaptive Huffman code. If no file names are given, then the standard input is compacted to the standard output. .I Compact operates as an on-line algorithm. Each time a byte is read, it is encoded immediately according to the current prefix code. This code is an optimal Huffman code for the set of frequencies seen so far. It is unnecessary to prepend a decoding tree to the compressed file since the encoder and the decoder start in the same state and stay synchronized. Furthermore, .I compact and .I uncompact can operate as filters. In particular, .sp ... | compact | uncompact | ... .br .sp operates as a (very slow) no-op. .PP When an argument .I file is given, it is compacted and the resulting file is placed in .I file.C; .I file is unlinked. The first two bytes of the compacted file code the fact that the file is compacted. This code is used to prohibit recompaction. .PP The amount of compression to be expected depends on the type of file being compressed. Typical values of compression are: Text (38%), Pascal Source (43%), C Source (36%) and Binary (19%). These values are the percentages of file bytes reduced. .PP .I Uncompact restores the original file from a file compressed by .I compact. If no file names are given, then the standard input is uncompacted to the standard output. .PP .I Ccat cats the original file from a file compressed by .I compact, without uncompressing the file. .SH RESTRICTION The last segment of the filename must contain fewer than thirteen characters to allow space for the appended '.C'. .SH FILES .ta 1i *.C compacted file created by compact, removed by uncompact .SH "SEE ALSO" Gallager, Robert G., "Variations on a Theme of Huffman", .I "I.E.E.E. Transactions on Information Theory," vol. IT-24, no. 6, November 1978, pp. 668 - 674. .SH AUTHOR Colin L. Mc Master .SH BUGS cats the original file from a file compressed by .I compact, without uncompressing the file. .SH RESTRICTION The last segment of the filename must contain fewer than thirteen characters to allow space for the appended '.C'. .SH FILES .ta 1i *.C compacted file created by compact, removed by uncompact .SH "SEE ALSO" Gallager, Robert G., "Variations on a Theme of Huffman", .I "I.E.E.E. Transactions on Information Theory," vol. IT-24, no. 6, November 1978, pp. 668 - 674. .SHman/man1/cp.1 644 0 33 1345 2512730472 6133 .TH CP 1 .UC 4 .SH NAME cp \- copy .SH SYNOPSIS .B cp [ .B \-i ] file1 file2 .PP .B cp [ .B \-i ] file ... directory .SH DESCRIPTION .I File1 is copied onto .IR file2 . The mode and owner of .I file2 are preserved if it already existed; the mode of the source file is used otherwise. .PP In the second form, one or more .I files are copied into the .I directory with their original file-names. .PP .I Cp refuses to copy a file onto itself. .PP If the .B \-i option is specified, .I cp will prompt the user w((ith the name of the file whenever the copy will cause an old file to be overwritten. An answer of 'y' will cause .I cp to continue. Any other answer will prevent it from overwriting the file. .SH "SEE ALSO" cat(1), pr(1), mv(1) y existed; the mode of the source file is used otherwise. .PP In the second form, one or more .I files are copied into the .I directory with their original file-names. .PP .I Cp refuses to copy a file onto itself. .PP If the .B \-i option is specified, .I cp will prompt the user wman/man1/crypt.1 644 0 33 4444 2512730472 6675 .TH CRYPT 1 .SH NAME crypt \- encode/decode .SH SYNOPSIS .B crypt [ password ] .SH DESCRIPTION .I Crypt reads from the standard input and writes on the standard output. The .I password is a key that selects a particular transformation. If no .I password is given, .I crypt demands a key from the terminal and turns off printing while the key is being typed in. .I Crypt encrypts and decrypts with the same key: .PP crypt key cypher .br crypt key ' `(' `)' form separate words. If doubled in `&&', `|\|\||', `<<' or `>>' these pairs form single words. These parser metacharacters may be made part of other words, or prevented their special meaning, by preceding them with `\e'. A newline preceded by a `\e' is equivalent to a blank. .PP In addition strings enclosed in matched pairs of quotations, `\*(aa', `\*(ga' or `"', form parts of a word; metacharacters in these strings, including blanks and tabs, do not form separate words. These quotations have semantics to be described subsequently. Within pairs of `\'' or `"' characters a newline preceded by a `\e' gives a true newline character. .PP When the shell's input is not a terminal, the character `#' introduces a comment which continues to the end of the input line. It is prevented this special meaning when preceded by `\e' and in quotations using `\`', `\'', and `"'. .sh "Commands" A simple command is a sequence of words, the first of which specifies the command to be executed. A simple command or a sequence of simple commands separated by `|' characters forms a pipeline. The output of each command in a pipeline is connected to the input of the next. Sequences of pipelines may be separated by `;', and are then executed sequentially. A sequence of pipelines may be executed without immediately waiting for it to terminate by following it with an `&'. .PP Any of the above may be placed in `(' `)' to form a simple command (which may be a component of a pipeline, etc.) It is also possible to separate pipelines with `|\|\||' or `&&' indicating, as in the C language, that the second is to be executed only if the first fails or succeeds respectively. (See .I Expressions.) .sh "Jobs" The shell associates a \fIjob\fR with each pipeline. It keeps a table of current jobs, printed by the \fIjobs\fR command, and assigns them small integer numbers. When a job is started asynchronously with `&', the shell prints a line which looks like: .PP .DT [1] 1234 .PP indicating that the jobs which was started asynchronously was job number 1 and had one (top-level) process, whose process id was 1234. .PP If you are running a job and wish to do something else you may hit the key \fB^Z\fR (control-Z) which sends a STOP signal to the current job. The shell will then normally indicate that the job has been `Stopped', and print another prompt. You can then manipulate the state of this job, putting it in the background with the \fIbg\fR command, or run some other commands and then eventually bring the job back into the foreground with the foreground command \fIfg\fR. A \fB^Z\fR takes effect immediately and is like an interrupt in that pending output and unread input are discarded when it is typed. There is another special key \fB^Y\fR which does not generate a STOP signal until a program attempts to .IR read (2) it. This can usefully be typed ahead when you have prepared some commands for a job which you wish to stop after it has read them. .PP A job being run in the background will stop if it tries to read from the terminal. Background jobs are normally allowed to produce output, but this can be disabled by giving the command ``stty tostop''. If you set this tty option, then background jobs will stop when they try to produce output like they do when they try to read input. .PP There are several ways to refer to jobs in the shell. The character `%' introduces a job name. If you wish to refer to job number 1, you can name it as `%1'. Just naming a job brings it to the foreground; thus `%1' is a synonym for `fg %1', bringing job 1 back into the foreground. Similarly saying `%1 &' resumes job 1 in the background. Jobs can also be named by prefixes of the string typed in to start them, if these prefixes are unambiguous, thus `%ex' would normally restart a suspended .IR ex (1) job, if there were only one suspended job whose name began with the string `ex'. It is also possible to say `%?string' which specifies a job whose text contains .I string, if there is only one such job. .PP The shell maintains a notion of the current and previous jobs. In output pertaining to jobs, the current job is marked with a `+' and the previous job with a `\-'. The abbreviatio((n `%+' refers to the current job and `%\-' refers to the previous job. For close analogy with the syntax of the .I history mechanism (described below), `%%' is also a synonym for the current job. .sh "Status reporting" This shell learns immediately whenever a process changes state. It normally informs you whenever a job becomes blocked so that no further progress is possible, but only just before it prints a prompt. This is done so that it does not otherwise disturb your work. If, however, you set the shell variable .I notify, the shell will notify you immediately of changes of status in background jobs. There is also a shell command .I notify which marks a single process so that its status changes will be immediately reported. By default .I notify marks the current process; simply say `notify' after starting a background job to mark it. .PP When you try to leave the shell while jobs are stopped, you will be warned that `You have stopped jobs.' You may use the \fIjobs\fR command to see what they are. If you do this or immediately try to exit again, the shell will not warn you a second time, and the suspended jobs will be terminated. .sh Substitutions We now describe the various transformations the shell performs on the input in the order in which they occur. .sh "History substitutions" History substitutions place words from previous command input as portions of new commands, making it easy to repeat commands, repeat arguments of a previous command in the current command, or fix spelling mistakes in the previous command with little typing and a high degree of confidence. History substitutions begin with the character `!' and may begin .B anywhere in the input stream (with the proviso that they .B "do not" nest.) This `!' may be preceded by an `\e' to prevent its special meaning; for convenience, a `!' is passed unchanged when it is followed by a blank, tab, newline, `=' or `('. (History substitutions also occur when an input line begins with `\*(ua'. This special abbreviation will be described later.) Any input line which contains history substitution is echoed on the terminal before it is executed as it could have been typed without history substitution. .PP Commands input from the terminal which consist of one or more words are saved on the history list. The history substitutions reintroduce sequences of words from these saved commands into the input stream. The size of which is controlled by the .I history variable; the previous command is always retained, regardless of its value. Commands are numbered sequentially from 1. .PP For definiteness, consider the following output from the .I history command: .PP .DT .br \09 write michael .br 10 ex write.c .br 11 cat oldwrite.c .br 12 diff *write.c .PP The commands are shown with their event numbers. It is not usually necessary to use event numbers, but the current event number can be made part of the .I prompt by placing an `!' in the prompt string. .PP With the current event 13 we can refer to previous events by event number `!11', relatively as in `!\-2' (referring to the same event), by a prefix of a command word as in `!d' for event 12 or `!wri' for event 9, or by a string contained in a word in the command as in `!?mic?' also referring to event 9. These forms, without further modification, simply reintroduce the words of the specified events, each separated by a single blank. As a special case `!!' refers to the previous command; thus `!!' alone is essentially a .I redo. .PP To select words from an event we can follow the event specification by a `:' and a designator for the desired words. The words of a input line are numbered from 0, the first (usually command) word being 0, the second word (first argument) being 1, etc. The basic word designators are: .PP .DT .nf 0 first (command) word \fIn\fR \fIn\fR\|'th argument \*(ua first argument, i.e. `1' $ last argument % word matched by (immediately preceding) ?\fIs\fR\|? search \fIx\fR\|\-\fIy\fR range of words \-\fIy\fR abbreviates `0\-\fIy\fR\|' * abbreviates `\*(ua\-$', or nothing if only 1 word in event \fIx\fR\|* abbreviates `\fIx\fR\|\-$' \fIx\fR\|\- like `\fIx\fR\|*' but omitting word `$' .fi .PP The `:' separating the event specification from the word designator can be omitted if the argument selector begins with a `\*(ua', `$', `*' `\-' or `%'. After the optional word designator can be placed a sequence of modifiers, each preceded by a `:'. The following modifiers are defined: .ta .5i 1.2i .PP .nf h Remove a trailing pathname component, leaving the head. r Remove a trailing `.xxx' component, leaving the root name. e Remove all but the extension `.xxx' part. s/\fIl\fR\|/\fIr\fR\|/ Substitute \fIl\fR for \fIr\fR t Remove all leading pathname components, leaving the tail. & Repeat the previous substitution. g Apply the change globally, prefixing the above, e.g. `g&'. p Print the new command but do not execute it. q Quote the substituted words, preventing further substitutions. x Like q, but break into words at blanks, tabs and newlines. .fi .PP Unless preceded by a `g' the modification is applied only to the first modifiable word. With substitutions, it is an error for no word to be applicable. .PP The left hand side of substitutions are not regular expressions in the sense of the editors, but rather strings. Any character may be used as the delimiter in place of `/'; a `\e' quotes the delimiter into the .IR l "" and .IR r "" strings. The character `&' in the right hand side is replaced by the text from the left. A `\e' quotes `&' also. A null .IR l "" uses the previous string either from a .IR l "" or from a contextual scan string .IR s "" in `!?\fIs\fR\|?'. The trailing delimiter in the substitution may be omitted if a newline follows immediately as may the trailing `?' in a contextual scan. .PP A history reference may be given without an event specification, e.g. `!$'. In this case the reference is to the previous command unless a previous history reference occurred on the same line in which case this form repeats the previous reference. Thus `!?foo?\*(ua !$' gives the first and last arguments from the command matching `?foo?'. .PP A special abbreviation of a history reference occurs when the first non-blank character of an input line is a `\*(ua'. This is equivalent to `!:s\*(ua' providing a convenient shorthand for substitutions on the text of the previous line. Thus `\*(ualb\*(ualib' fixes the spelling of `lib' in the previous command. Finally, a history substitution may be surrounded with `{' and `}' if necessary to insulate it from the characters which follow. Thus, after `ls \-ld ~paul' we might do `!{l}a' to do `ls \-ld ~paula', while `!la' would look for a command starting `la'. .PP .if n .ul \fBQuotations\ with\ \'\ and\ "\fR .PP The quotation of strings by `\'' and `"' can be used to prevent all or some of the remaining substitutions. Strings enclosed in `\'' are prevented any further interpretation. Strings enclosed in `"' are yet variable and command expanded as described below. .PP In both cases the resulting text becomes (all or part of) a single word; only in one special case (see .I "Command Substitition" below) does a `"' quoted string yield parts of more than one word; `\'' quoted strings never do. .sh "Alias substitution" The shell maintains a list of aliases which can be established, displayed and modified by the .I alias and .I unalias commands. After a command line is scanned, it is parsed into distinct commands and the first word of each command, left-to-right, is checked to see if it has an alias. If it does, then the text which is the alias for that command is reread with the history mechanism available as though that command were the previous input line. The resulting words replace the command and argument list. If no reference is made to the history list, then the argument list is left unchanged. .PP Thus if the alias for `ls' is `ls \-l' the command `ls /usr' would map to `ls \-l /usr', the argument list here being undisturbed. Similarly if the alias for `lookup' was `grep !\*(ua /etc/passwd' then `lookup bill' would map to `grep bill /etc/passwd'. .PP If an alias is found, the word transformation of the input text is performed and the aliasing process begins again on the reformed input line. Looping is prevented if the first word of the new text is the same as the old by flagging it to prevent further aliasing. Other loops are detected and cause an error. .PP Note that the mechanism allows aliases to introduce parser metasyntax. Thus we can `alias print \'pr \e!* \||\| lpr\'' to make a command which .I pr's its arguments to the line printer. .sh "Variable substitution" The shell maintains a set of variables, each of which has as value a list of zero or more words. Some of these variables are set by the shell or referred to by it. For instance, the .I argv variable is an image of the shell's argument list, and words of this variable's value are referred to in special ways. .PP The values of variables may be displayed and changed by using the .I set and .I unset commands. Of the variables referred to by the shell a number are toggles; the shell does not care what their value is, only whether they are set or not. For instance, the .I verbose variable is a toggle which causes command input to be echoed. The setting of this variable results from the .B \-v command line option. .PP Other operations treat variables numerically. The `@' command permits numeric calculations to be performed and the result assigned to a variable. Variable values are, however, always represented as (zero or more) strings. For the purposes of numeric operations, the null string is considered to be zero, and the second and subsequent words of multiword values are ignored. .PP After the input line is aliased and parsed, and before each command is executed, variable substitution is performed keyed by `$' characters. This expansion can be prevented by preceding the `$' with a `\e' except within `"'s where it .B always occurs, and within `\''s where it .B never occurs. Strings quoted by `\*(ga' are interpreted later (see .I "Command substitution" below) so `$' substitution does not occur there until later, i((f at all. A `$' is passed unchanged if followed by a blank, tab, or end-of-line. .PP Input/output redirections are recognized before variable expansion, and are variable expanded separately. Otherwise, the command name and entire argument list are expanded together. It is thus possible for the first (command) word to this point to generate more than one word, the first of which becomes the command name, and the rest of which become arguments. .PP Unless enclosed in `"' or given the `:q' modifier the results of variable substitution may eventually be command and filename substituted. Within `"' a variable whose value consists of multiple words expands to a (portion of) a single word, with the words of the variables value separated by blanks. When the `:q' modifier is applied to a substitution the variable will expand to multiple words with each word separated by a blank and quoted to prevent later command or filename substitution. .PP The following metasequences are provided for introducing variable values into the shell input. Except as noted, it is an error to reference a variable which is not set. .HP 5 $name .br .ns .HP 5 ${name} .br Are replaced by the words of the value of variable .I name, each separated by a blank. Braces insulate .I name from following characters which would otherwise be part of it. Shell variables have names consisting of up to 20 letters and digits starting with a letter. The underscore character is considered a letter. .br If .I name is not a shell variable, but is set in the environment, then that value is returned (but \fB:\fR modifiers and the other forms given below are not available in this case). .HP 5 $name[selector] .br .ns .HP 5 ${name[selector]} .br May be used to select only some of the words from the value of .I name. The selector is subjected to `$' substitution and may consist of a single number or two numbers separated by a `\-'. The first word of a variables value is numbered `1'. If the first number of a range is omitted it defaults to `1'. If the last member of a range is omitted it defaults to `$#name'. The selector `*' selects all words. It is not an error for a range to be empty if the second argument is omitted or in range. .HP 5 $#name .br .ns .HP 5 ${#name} .br Gives the number of words in the variable. This is useful for later use in a `[selector]'. .HP 5 $0 .br Substitutes the name of the file from which command input is being read. An error occurs if the name is not known. .HP 5 $number .br .ns .HP 5 ${number} .br Equivalent to `$argv[number]'. .HP 5 $* .br Equivalent to `$argv[*]'. .PP The modifiers `:h', `:t', `:r', `:q' and `:x' may be applied to the substitutions above as may `:gh', `:gt' and `:gr'. If braces `{' '}' appear in the command form then the modifiers must appear within the braces. .B "The current implementation allows only one `:' modifier on each `$' expansion." .PP The following substitutions may not be modified with `:' modifiers. .HP 5 $?name .br .ns .HP 5 ${?name} .br Substitutes the string `1' if name is set, `0' if it is not. .HP 5 $?0 .br Substitutes `1' if the current input filename is know, `0' if it is not. .HP 5 $$ .br Substitute the (decimal) process number of the (parent) shell. .HP 5 $< .br Substitutes a line from the standard input, with no further interpretation thereafter. It can be used to read from the keyboard in a shell script. .sh "Command and filename substitution" The remaining substitutions, command and filename substitution, are applied selectively to the arguments of builtin commands. This means that portions of expressions which are not evaluated are not subjected to these expansions. For commands which are not internal to the shell, the command name is substituted separately from the argument list. This occurs very late, after input-output redirection is performed, and in a child of the main shell. .sh "Command substitution" Command substitution is indicated by a command enclosed in `\*(ga'. The output from such a command is normally broken into separate words at blanks, tabs and newlines, with null words being discarded, this text then replacing the original string. Within `"'s, only newlines force new words; blanks and tabs are preserved. .PP In any case, the single final newline does not force a new word. Note that it is thus possible for a command substitution to yield only part of a word, even if the command outputs a complete line. .sh "Filename substitution" If a word contains any of the characters `*', `?', `[' or `{' or begins with the character `~', then that word is a candidate for filename substitution, also known as `globbing'. This word is then regarded as a pattern, and replaced with an alphabetically sorted list of file names which match the pattern. In a list of words specifying filename substitution it is an error for no pattern to match an existing file name, but it is not required for each pattern to match. Only the metacharacters `*', `?' and `[' imply pattern matching, the characters `~' and `{' being more akin to abbreviations. .PP In matching filenames, the character `.' at the beginning of a filename or immediately following a `/', as well as the character `/' must be matched explicitly. The character `*' matches any string of characters, including the null string. The character `?' matches any single character. The sequence `[...]' matches any one of the characters enclosed. Within `[...]', a pair of characters separated by `\-' matches any character lexically between the two. .PP The character `~' at the beginning of a filename is used to refer to home directories. Standing alone, i.e. `~' it expands to the invokers home directory as reflected in the value of the variable .I home. When followed by a name consisting of letters, digits and `\-' characters the shell searches for a user with that name and substitutes their home directory; thus `~ken' might expand to `/usr/ken' and `~ken/chmach' to `/usr/ken/chmach'. If the character `~' is followed by a character other than a letter or `/' or appears not at the beginning of a word, it is left undisturbed. .PP The metanotation `a{b,c,d}e' is a shorthand for `abe ace ade'. Left to right order is preserved, with results of matches being sorted separately at a low level to preserve this order. This construct may be nested. Thus `~source/s1/{oldls,ls}.c' expands to `/usr/source/s1/oldls.c /usr/source/s1/ls.c' whether or not these files exist without any chance of error if the home directory for `source' is `/usr/source'. Similarly `../{memo,*box}' might expand to `../memo ../box ../mbox'. (Note that `memo' was not sorted with the results of matching `*box'.) As a special case `{', `}' and `{}' are passed undisturbed. .sh Input/output The standard input and standard output of a command may be redirected with the following syntax: .HP 5 < name .br Open file .I name (which is first variable, command and filename expanded) as the standard input. .HP 5 << word .br Read the shell input up to a line which is identical to .I word. .I Word is not subjected to variable, filename or command substitution, and each input line is compared to .I word before any substitutions are done on this input line. Unless a quoting `\e', `"', `\*(aa' or `\*(ga' appears in .I word variable and command substitution is performed on the intervening lines, allowing `\e' to quote `$', `\e' and `\*(ga'. Commands which are substituted have all blanks, tabs, and newlines preserved, except for the final newline which is dropped. The resultant text is placed in an anonymous temporary file which is given to the command as standard input. .HP 5 > name .br .ns .HP 5 >! name .br .ns .HP 5 >& name .br .ns .HP 5 >&! name .br The file .I name is used as standard output. If the file does not exist then it is created; if the file exists, its is truncated, its previous contents being lost. .IP If the variable .I noclobber is set, then the file must not exist or be a character special file (e.g. a terminal or `/dev/null') or an error results. This helps prevent accidental destruction of files. In this case the `!' forms can be used and suppress this check. .IP The forms involving `&' route the diagnostic output into the specified file as well as the standard output. .I Name is expanded in the same way as `<' input filenames are. .HP 5 >> name .br .ns .HP 5 >>& name .br .ns .HP 5 >>! name .br .ns .HP 5 >>&! name .br Uses file .I name as standard output like `>' but places output at the end of the file. If the variable .I noclobber is set, then it is an error for the file not to exist unless one of the `!' forms is given. Otherwise similar to `>'. .PP A command receives the environment in which the shell was invoked as modified by the input-output parameters and the presence of the command in a pipeline. Thus, unlike some previous shells, commands run from a file of shell commands have no access to the text of the commands by default; rather they receive the original standard input of the shell. The `<<' mechanism should be used to present inline data. This permits shell command scripts to function as components of pipelines and allows the shell to block read its input. Note that the default standard input for a command run detached is .B not modified to be the empty file `/dev/null'; rather the standard input remains as the original standard input of the shell. If this is a terminal and if the process attempts to read from the terminal, then the process will block and the user will be notified (see .B Jobs above.) .PP Diagnostic output may be directed through a pipe with the standard output. Simply use the form `|\|&' rather than just `|'. .sh Expressions A number of the builtin commands (to be described subsequently) take expressions, in which the operators are similar to those of C, with the same precedence. These expressions appear in the .I @, .I exit, .I if, and .I while commands. The following operators are available: .DT .PP |\|\|| && | \*(ua & == != =~ !~ <= >= < > << >> + \- * / % ! ~ ( ) .PP Here the precedence increases to the right, `==' `!=' `=~' and `!~', `<=' `>=' `<' and `>', `<<' and `>>', `+' and `\-', `*' `/' and `%' being, in groups, at the same level. The `==' `!=' `=~' and `!~((' operators compare their arguments as strings; all others operate on numbers. The operators `=~' and `!~' are like `!=' and `==' except that the right hand side is a .I pattern (containing, e.g. `*'s, `?'s and instances of `[...]') against which the left hand operand is matched. This reduces the need for use of the .I switch statement in shell scripts when all that is really needed is pattern matching. .PP Strings which begin with `0' are considered octal numbers. Null or missing arguments are considered `0'. The result of all expressions are strings, which represent decimal numbers. It is important to note that no two components of an expression can appear in the same word; except when adjacent to components of expressions which are syntactically significant to the parser (`&' `|' `<' `>' `(' `)') they should be surrounded by spaces. .PP Also available in expressions as primitive operands are command executions enclosed in `{' and `}' and file enquiries of the form `\-\fIl\fR name' where .I l is one of: .PP .DT .nf r read access w write access x execute access e existence o ownership z zero size f plain file d directory .fi .PP The specified name is command and filename expanded and then tested to see if it has the specified relationship to the real user. If the file does not exist or is inaccessible then all enquiries return false, i.e. `0'. Command executions succeed, returning true, i.e. `1', if the command exits with status 0, otherwise they fail, returning false, i.e. `0'. If more detailed status information is required then the command should be executed outside of an expression and the variable .I status examined. .sh "Control flow" The shell contains a number of commands which can be used to regulate the flow of control in command files (shell scripts) and (in limited but useful ways) from terminal input. These commands all operate by forcing the shell to reread or skip in its input and, due to the implementation, restrict the placement of some of the commands. .PP The .I foreach, .I switch, and .I while statements, as well as the .I if\-then\-else form of the .I if statement require that the major keywords appear in a single simple command on an input line as shown below. .PP If the shell's input is not seekable, the shell buffers up input whenever a loop is being read and performs seeks in this internal buffer to accomplish the rereading implied by the loop. (To the extent that this allows, backward goto's will succeed on non-seekable inputs.) .sh "Builtin commands" Builtin commands are executed within the shell. If a builtin command occurs as any component of a pipeline except the last then it is executed in a subshell. .HP 5 .B alias .br .ns .HP 5 .BR alias " name" .br .ns .HP 5 .BR alias " name wordlist" .br The first form prints all aliases. The second form prints the alias for name. The final form assigns the specified .I wordlist as the alias of .I name; .I wordlist is command and filename substituted. .I Name is not allowed to be .I alias or .I unalias. .HP 5 .B alloc .br Shows the amount of dynamic core in use, broken down into used and free core, and address of the last location in the heap. With an argument shows each used and free block on the internal dynamic memory chain indicating its address, size, and whether it is used or free. This is a debugging command and may not work in production versions of the shell; it requires a modified version of the system memory allocator. .HP 5 .B bg .br .ns .HP 5 \fBbg\ %\fRjob\ ... .br Puts the current or specified jobs into the background, continuing them if they were stopped. .HP 5 .B break .br Causes execution to resume after the .I end of the nearest enclosing .I foreach or .I while. The remaining commands on the current line are executed. Multi-level breaks are thus possible by writing them all on one line. .HP 5 .B breaksw .br Causes a break from a .I switch, resuming after the .I endsw. .HP 5 .BR case " label:" .br A label in a .I switch statement as discussed below. .HP 5 .B cd .br .ns .HP 5 .BR cd " name" .br .ns .HP 5 .B chdir .br .ns .HP 5 .BR chdir " name" .br Change the shells working directory to directory .I name. If no argument is given then change to the home directory of the user. .br If .I name is not found as a subdirectory of the current directory (and does not begin with `/', `./' or `../'), then each component of the variable .I cdpath is checked to see if it has a subdirectory .I name. Finally, if all else fails but .I name is a shell variable whose value begins with `/', then this is tried to see if it is a directory. .HP 5 .B continue .br Continue execution of the nearest enclosing .I while or .I foreach. The rest of the commands on the current line are executed. .HP 5 .B default: .br Labels the default case in a .I switch statement. The default should come after all .I case labels. .HP 5 .BR "dirs" .br Prints the directory stack; the top of the stack is at the left, the first directory in the stack being the current directory. .HP 5 .BR echo " wordlist" .br .ns .HP 5 .BR "echo \-n" " wordlist" .br The specified words are written to the shells standard output, separated by spaces, and terminated with a newline unless the .B \-n option is specified. .HP 5 .B else .br .ns .HP 5 .B end .br .ns .HP 5 .B endif .br .ns .HP 5 .B endsw .br See the description of the .I foreach, .I if, .I switch, and .I while statements below. .HP 5 .BR eval " arg ..." .br (As in .IR sh (1).) The arguments are read as input to the shell and the resulting command(s) executed. This is usually used to execute commands generated as the result of command or variable substitution, since parsing occurs before these substitutions. See .IR tset (1) for an example of using .I eval. .HP 5 .BR exec " command" .br The specified command is executed in place of the current shell. .HP 5 .B exit .br .ns .HP 5 .BR exit (expr) .br The shell exits either with the value of the .I status variable (first form) or with the value of the specified .I expr (second form). .HP 5 .B fg .br .ns .HP 5 \fBfg\ %\fRjob\ ... .br Brings the current or specified jobs into the foreground, continuing them if they were stopped. .HP 5 .BR foreach " name (wordlist)" .br .ns .HP 5 \ ... .br .ns .HP 5 .B end .br The variable .I name is successively set to each member of .I wordlist and the sequence of commands between this command and the matching .I end are executed. (Both .I foreach and .I end must appear alone on separate lines.) .IP The builtin command .I continue may be used to continue the loop prematurely and the builtin command .I break to terminate it prematurely. When this command is read from the terminal, the loop is read up once prompting with `?' before any statements in the loop are executed. If you make a mistake typing in a loop at the terminal you can rub it out. .HP 5 .BR glob " wordlist" .br Like .I echo but no `\e' escapes are recognized and words are delimited by null characters in the output. Useful for programs which wish to use the shell to filename expand a list of words. .HP 5 .BR goto " word" .br The specified .I word is filename and command expanded to yield a string of the form `label'. The shell rewinds its input as much as possible and searches for a line of the form `label:' possibly preceded by blanks or tabs. Execution continues after the specified line. .HP 5 .BR hashstat .br Print a statistics line indicating how effective the internal hash table has been at locating commands (and avoiding .I exec's). An .I exec is attempted for each component of the .I path where the hash function indicates a possible hit, and in each component which does not begin with a `/'. .HP 5 .B history .br .ns .HP 5 .BI history " n" .br .ns .HP 5 .BI "history \-r" " n" .br Displays the history event list; if \fIn\fR is given only the .I n most recent events are printed. The .B \-r option reverses the order of printout to be most recent first rather than oldest first. .HP 5 .BR if " (expr) command" .br If the specified expression evaluates true, then the single .I command with arguments is executed. Variable substitution on .IR command "" happens early, at the same time it does for the rest of the .I if command. .I Command must be a simple command, not a pipeline, a command list, or a parenthesized command list. Input/output redirection occurs even if .I expr is false, when command is .B not executed (this is a bug). .HP 5 .BR if " (expr) " "then" .br .ns .HP 5 \ ... .br .ns .HP 5 .BR else " " "if\fR (expr2) \fBthen" .br .ns .HP 5 \ ... .br .ns .HP 5 .B else .br .ns .HP 5 \ ... .br .ns .HP 5 .B endif .br If the specified .IR expr "" is true then the commands to the first .I else are executed; else if .IR expr2 "" is true then the commands to the second else are executed, etc. Any number of .I else-if pairs are possible; only one .I endif is needed. The .I else part is likewise optional. (The words .I else and .I endif must appear at the beginning of input lines; the .I if must appear alone on its input line or after an .I else.) .HP 5 .B jobs .br .ns .HP 5 .B "jobs \-l" .br Lists the active jobs; given the .B \-l options lists process id's in addition to the normal information. .HP 5 \fBkill %\fRjob .br .ns .HP 5 \fBkill\ \-\fRsig\ \fB%\fRjob\ ... .br .ns .HP 5 \fBkill\fR\ pid .br .ns .HP 5 \fBkill\ \-\fRsig\ pid\ ... .br .ns .HP 5 \fBkill\ \-l\fR .br Sends either the TERM (terminate) signal or the specified signal to the specified jobs or processes. Signals are either given by number or by names (as given in .I /usr/include/signal.h, stripped of the prefix ``SIG''). The signal names are listed by ``kill \-l''. There is no default, saying just `kill' does not send a signal to the current job. If the signal being sent is TERM (terminate) or HUP (hangup), then the job or process will be sent a CONT (continue) signal as well. .HP \fBlimit\fR .br .ns .HP 5 \fBlimit\fR \fIresource\fR .br .ns .HP 5 \fBlimit\fR \fIresource\fR \fImaximum-use\fR .br Limits the consumption by the current process and each process it creates to not individually exceed \fImaximum-use\fR on the specified \fIresource\fR. If no \fImaximum-use\fR is given, then the current limit is printed; if no \fIreso((urce\fR is given, then all limitations are given. .IP Resources controllable currently include \fIcputime\fR (the maximum number of cpu-seconds to be used by each process), \fIfilesize\fR (the largest single file which can be created), \fIdatasize\fR (the maximum growth of the data+stack region via .IR sbrk (2) beyond the end of the program text), \fIstacksize\fR (the maximum size of the automatically-extended stack region), and \fIcoredumpsize\fR (the size of the largest core dump that will be created). .IP The \fImaximum-use\fR may be given as a (floating point or integer) number followed by a scale factor. For all limits other than \fIcputime\fR the default scale is `k' or `kilobytes' (1024 bytes); a scale factor of `m' or `megabytes' may also be used. For .I cputime the default scaling is `seconds', while `m' for minutes or `h' for hours, or a time of the form `mm:ss' giving minutes and seconds may be used. .IP For both \fIresource\fR names and scale factors, unambiguous prefixes of the names suffice. .HP 5 .B login .br Terminate a login shell, replacing it with an instance of .B /bin/login. This is one way to log off, included for compatibility with .IR sh (1). .HP 5 .B logout .br Terminate a login shell. Especially useful if .I ignoreeof is set. .HP 5 .B newgrp .br Changes the group identification of the caller; for details see .IR newgrp (1). A new shell is executed by .I newgrp so that the shell state is lost. .HP 5 .B nice .br .ns .HP 5 .BR nice " \+number" .br .ns .HP 5 .BR nice " command" .br .ns .HP 5 .BR nice " \+number command" .br The first form sets the .I nice for this shell to 4. The second form sets the .I nice to the given number. The final two forms run command at priority 4 and .I number respectively. The super-user may specify negative niceness by using `nice \-number ...'. Command is always executed in a sub-shell, and the restrictions place on commands in simple .I if statements apply. .HP 5 .B nohup .br .ns .HP 5 .BR "nohup" " command" .br The first form can be used in shell scripts to cause hangups to be ignored for the remainder of the script. The second form causes the specified command to be run with hangups ignored. All processes detached with `&' are effectively .I nohup'ed. .HP 5 .B notify .br .ns .HP 5 \fBnotify\ %\fRjob\ ... .br Causes the shell to notify the user asynchronously when the status of the current or specified jobs changes; normally notification is presented before a prompt. This is automatic if the shell variable .I notify is set. .HP 5 .B onintr .br .ns .HP 5 .BR onintr " \-" .br .ns .HP 5 .BR onintr " label" .br Control the action of the shell on interrupts. The first form restores the default action of the shell on interrupts which is to terminate shell scripts or to return to the terminal command input level. The second form `onintr \-' causes all interrupts to be ignored. The final form causes the shell to execute a `goto label' when an interrupt is received or a child process terminates because it was interrupted. .IP In any case, if the shell is running detached and interrupts are being ignored, all forms of .I onintr have no meaning and interrupts continue to be ignored by the shell and all invoked commands. .HP 5 .BR "popd" .br .ns .HP 5 .BR "popd" " +n" .br Pops the directory stack, returning to the new top directory. With a argument `+\fIn\fR' discards the \fIn\fR\|th entry in the stack. The elements of the directory stack are numbered from 0 starting at the top. .HP 5 .BR "pushd" .br .ns .HP 5 .BR "pushd" " name" .br .ns .HP 5 .BR "pushd" " +n" .br With no arguments, .I pushd exchanges the top two elements of the directory stack. Given a .I name argument, .I pushd changes to the new directory (ala .I cd) and pushes the old current working directory (as in .I csw) onto the directory stack. With a numeric argument, rotates the \fIn\fR\|th argument of the directory stack around to be the top element and changes to it. The members of the directory stack are numbered from the top starting at 0. .HP 5 .BR rehash .br Causes the internal hash table of the contents of the directories in the .I path variable to be recomputed. This is needed if new commands are added to directories in the .I path while you are logged in. This should only be necessary if you add commands to one of your own directories, or if a systems programmer changes the contents of one of the system directories. .HP 5 .BR repeat " count command" .br The specified .I command which is subject to the same restrictions as the .I command in the one line .I if statement above, is executed .I count times. I/O redirections occur exactly once, even if .I count is 0. .HP 5 .B set .br .ns .HP 5 .BR set " name" .br .ns .HP 5 .BR set " name=word" .br .ns .HP 5 .BR set " name[index]=word" .br .ns .HP 5 .BR set " name=(wordlist)" .br The first form of the command shows the value of all shell variables. Variables which have other than a single word as value print as a parenthesized word list. The second form sets .I name to the null string. The third form sets .I name to the single .I word. The fourth form sets the .I index'th component of name to word; this component must already exist. The final form sets .I name to the list of words in .I wordlist. In all cases the value is command and filename expanded. .IP These arguments may be repeated to set multiple values in a single set command. Note however, that variable expansion happens for all arguments before any setting occurs. .HP 5 .BR setenv " name value" .br Sets the value of environment variable .I name to be .I value, a single string. The most commonly used environment variable USER, TERM, and PATH are automatically imported to and exported from the .I csh variables .I user, .I term, and .I path; there is no need to use .I setenv for these. .HP 5 .B shift .br .ns .HP 5 .BR shift " variable" .br The members of .I argv are shifted to the left, discarding .I argv[1]. It is an error for .I argv not to be set or to have less than one word as value. The second form performs the same function on the specified variable. .HP 5 .BR source " name" .br The shell reads commands from .I name. .I Source commands may be nested; if they are nested too deeply the shell may run out of file descriptors. An error in a .I source at any level terminates all nested .I source commands. Input during .I source commands is .B never placed on the history list. .HP 5 .B stop .br .ns .HP 5 \fBstop\ %\fRjob\ ... .br Stops the current or specified job which is executing in the background. .HP 5 .B suspend .br .ns Causes the shell to stop in its tracks, much as if it had been sent a stop signal with \fB^Z\fR. This is most often used to stop shells started by .IR su (1). .HP 5 .BR switch " (string)" .br .ns .HP 5 .BR case " str1:" .br .ns .HP 5 \ ... .br .ns .HP 5 \ .B breaksw .br .ns .HP 5 \&... .br .ns .HP 5 .B default: .br .ns .HP 5 \ ... .br .ns .HP 5 \ .B breaksw .br .ns .HP 5 .B endsw .br Each case label is successively matched, against the specified .I string which is first command and filename expanded. The file metacharacters `*', `?' and `[...]' may be used in the case labels, which are variable expanded. If none of the labels match before a `default' label is found, then the execution begins after the default label. Each case label and the default label must appear at the beginning of a line. The command .I breaksw causes execution to continue after the .I endsw. Otherwise control may fall through case labels and default labels as in C. If no label matches and there is no default, execution continues after the .I endsw. .HP 5 .B time .br .ns .HP 5 .BR time " command" .br With no argument, a summary of time used by this shell and its children is printed. If arguments are given the specified simple command is timed and a time summary as described under the .I time variable is printed. If necessary, an extra shell is created to print the time statistic when the command completes. .HP 5 .B umask .br .ns .HP 5 .BR umask " value" .br The file creation mask is displayed (first form) or set to the specified value (second form). The mask is given in octal. Common values for the mask are 002 giving all access to the group and read and execute access to others or 022 giving all access except no write access for users in the group or others. .HP 5 .BR unalias " pattern" .br All aliases whose names match the specified pattern are discarded. Thus all aliases are removed by `unalias *'. It is not an error for nothing to be .I unaliased. .HP 5 .BR unhash .br Use of the internal hash table to speed location of executed programs is disabled. .HP 5 \fBunlimit\fR \fIresource\fR .br .ns .HP 5 \fBunlimit\fR .br Removes the limitation on \fIresource\fR. If no \fIresource\fR is specified, then all \fIresource\fR limitations are removed. .HP 5 .BR unset " pattern" .br All variables whose names match the specified pattern are removed. Thus all variables are removed by `unset *'; this has noticeably distasteful side-effects. It is not an error for nothing to be .I unset. .HP 5 .BR unsetenv " pattern" .br Removes all variables whose name match the specified pattern from the environment. See also the .I setenv command above and .IR printenv (1). .HP 5 .B wait .br All background jobs are waited for. It the shell is interactive, then an interrupt can disrupt the wait, at which time the shell prints names and job numbers of all jobs known to be outstanding. .HP 5 .BR while " (expr)" .br .ns .HP 5 \ ... .br .ns .HP 5 .B end .br While the specified expression evaluates non-zero, the commands between the .I while and the matching end are evaluated. .I Break and .I continue may be used to terminate or continue the loop prematurely. (The .I while and .I end must appear alone on their input lines.) Prompting occurs here the first time through the loop as for the .I foreach statement if the input is a terminal. .HP 5 \fB%\fRjob .br Brings the specified job into the foreground. .HP 5 \fB%\fRjob \fB&\fR .br Continues the specified job in the background. .HP 5 .B "@" .br .ns .HP 5 .BR "@" " name = expr" .br .ns .HP 5 .BR "@" " name[index] = expr" .br The first form prints the values of all the shell variab((les. The second form sets the specified .I name to the value of .I expr. If the expression contains `<', `>', `&' or `|' then at least this part of the expression must be placed within `(' `)'. The third form assigns the value of .I expr to the .I index'th argument of .I name. Both .I name and its .I index'th component must already exist. .IP The operators `*=', `+=', etc are available as in C. The space separating the name from the assignment operator is optional. Spaces are, however, mandatory in separating components of .I expr which would otherwise be single words. .IP Special postfix `++' and `\-\-' operators increment and decrement .I name respectively, i.e. `@ i++'. .sh "Pre-defined and environment variables" The following variables have special meaning to the shell. Of these, .I argv, .I cwd, .I home, .I path, .I prompt, .I shell and .I status are always set by the shell. Except for .I cwd and .I status this setting occurs only at initialization; these variables will not then be modified unless this is done explicitly by the user. .PP This shell copies the environment variable USER into the variable .I user, TERM into .I term, and HOME into .I home, and copies these back into the environment whenever the normal shell variables are reset. The environment variable PATH is likewise handled; it is not necessary to worry about its setting other than in the file .I \&.cshrc as inferior .I csh processes will import the definition of .I path from the environment, and re-export it if you then change it. (It could be set once in the .I \&.login except that commands through .IR net (1) would not see the definition.) .TP 15 .B argv \c Set to the arguments to the shell, it is from this variable that positional parameters are substituted, i.e. `$1' is replaced by `$argv[1]', etc. .TP 15 .B cdpath \c Gives a list of alternate directories searched to find subdirectories in .I chdir commands. .TP 15 .B cwd The full pathname of the current directory. .TP 15 .B echo \c Set when the .B \-x command line option is given. Causes each command and its arguments to be echoed just before it is executed. For non-builtin commands all expansions occur before echoing. Builtin commands are echoed before command and filename substitution, since these substitutions are then done selectively. .TP 15 .B histchars \c Can be given a string value to change the characters used in history substitution. The first character of its value is used as the history substitution character, replacing the default character !. The second character of its value replaces the character \(ua in quick substitutions. .TP 15 .B history \c Can be given a numeric value to control the size of the history list. Any command which has been referenced in this many events will not be discarded. Too large values of .I history may run the shell out of memory. The last executed command is always saved on the history list. .TP 15 .B home \c The home directory of the invoker, initialized from the environment. The filename expansion of `\fB~\fR' refers to this variable. .TP 15 .B ignoreeof \c If set the shell ignores end-of-file from input devices which are terminals. This prevents shells from accidentally being killed by control-D's. .TP 15 .B mail \c The files where the shell checks for mail. This is done after each command completion which will result in a prompt, if a specified interval has elapsed. The shell says `You have new mail.' if the file exists with an access time not greater than its modify time. .IP If the first word of the value of .I mail is numeric it specifies a different mail checking interval, in seconds, than the default, which is 10 minutes. .IP If multiple mail files are specified, then the shell says `New mail in .IR name ' when there is mail in the file .I name. .TP 15 .B noclobber \c As described in the section on .I Input/output, restrictions are placed on output redirection to insure that files are not accidentally destroyed, and that `>>' redirections refer to existing files. .TP 15 .B noglob \c If set, filename expansion is inhibited. This is most useful in shell scripts which are not dealing with filenames, or after a list of filenames has been obtained and further expansions are not desirable. .TP 15 .B nonomatch \c If set, it is not an error for a filename expansion to not match any existing files; rather the primitive pattern is returned. It is still an error for the primitive pattern to be malformed, i.e. `echo [' still gives an error. .TP 15 .B notify \c If set, the shell notifies asynchronously of job completions. The default is to rather present job completions just before printing a prompt. .TP 15 .B path \c Each word of the path variable specifies a directory in which commands are to be sought for execution. A null word specifies the current directory. If there is no .I path variable then only full path names will execute. The usual search path is `.', `/bin' and `/usr/bin', but this may vary from system to system. For the super-user the default search path is `/etc', `/bin' and `/usr/bin'. A shell which is given neither the .B \-c nor the .B \-t option will normally hash the contents of the directories in the .I path variable after reading .I \&.cshrc, and each time the .I path variable is reset. If new commands are added to these directories while the shell is active, it may be necessary to give the .I rehash or the commands may not be found. .TP 15 .B prompt \c The string which is printed before each command is read from an interactive terminal input. If a `!' appears in the string it will be replaced by the current event number unless a preceding `\e' is given. Default is `% ', or `# ' for the super-user. .TP 15 .B shell \c The file in which the shell resides. This is used in forking shells to interpret files which have execute bits set, but which are not executable by the system. (See the description of .I "Non-builtin Command Execution" below.) Initialized to the (system-dependent) home of the shell. .TP 15 .B status \c The status returned by the last command. If it terminated abnormally, then 0200 is added to the status. Builtin commands which fail return exit status `1', all other builtin commands set status `0'. .TP 15 .B time \c Controls automatic timing of commands. If set, then any command which takes more than this many cpu seconds will cause a line giving user, system, and real times and a utilization percentage which is the ratio of user plus system times to real time to be printed when it terminates. .TP 15 .B verbose \c Set by the .B \-v command line option, causes the words of each command to be printed after history substitution. .sh "Non-builtin command execution" When a command to be executed is found to not be a builtin command the shell attempts to execute the command via .IR exec (2). Each word in the variable .I path names a directory from which the shell will attempt to execute the command. If it is given neither a .B \-c nor a .B \-t option, the shell will hash the names in these directories into an internal table so that it will only try an .I exec in a directory if there is a possibility that the command resides there. This greatly speeds command location when a large number of directories are present in the search path. If this mechanism has been turned off (via .I unhash), or if the shell was given a .B \-c or .B \-t argument, and in any case for each directory component of .I path which does not begin with a `/', the shell concatenates with the given command name to form a path name of a file which it then attempts to execute. .PP Parenthesized commands are always executed in a subshell. Thus `(cd ; pwd) ; pwd' prints the .I home directory; leaving you where you were (printing this after the home directory), while `cd ; pwd' leaves you in the .I home directory. Parenthesized commands are most often used to prevent .I chdir from affecting the current shell. .PP If the file has execute permissions but is not an executable binary to the system, then it is assumed to be a file containing shell commands an a new shell is spawned to read it. .PP If there is an .I alias for .I shell then the words of the alias will be prepended to the argument list to form the shell command. The first word of the .I alias should be the full path name of the shell (e.g. `$shell'). Note that this is a special, late occurring, case of .I alias substitution, and only allows words to be prepended to the argument list without modification. .sh "Argument list processing" If argument 0 to the shell is `\-' then this is a login shell. The flag arguments are interpreted as follows: .TP 5 .B \-c \c Commands are read from the (single) following argument which must be present. Any remaining arguments are placed in .I argv. .TP 5 .B \-e \c The shell exits if any invoked command terminates abnormally or yields a non-zero exit status. .TP 5 .B \-f \c The shell will start faster, because it will neither search for nor execute commands from the file `\&.cshrc' in the invokers home directory. .TP 5 .B \-i \c The shell is interactive and prompts for its top-level input, even if it appears to not be a terminal. Shells are interactive without this option if their inputs and outputs are terminals. .TP 5 .B \-n \c Commands are parsed, but not executed. This may aid in syntactic checking of shell scripts. .TP 5 .B \-s \c Command input is taken from the standard input. .TP 5 .B \-t \c A single line of input is read and executed. A `\e' may be used to escape the newline at the end of this line and continue onto another line. .TP 5 .B \-v \c Causes the .I verbose variable to be set, with the effect that command input is echoed after history substitution. .TP 5 .B \-x \c Causes the .I echo variable to be set, so that commands are echoed immediately before execution. .TP 5 .B \-V \c Causes the .I verbose variable to be set even before `\&.cshrc' is executed. .TP 5 .B \-X \c Is to .B \-x as .B \-V is to .B \-v. .PP After processing of flag arguments if arguments remain but none of the .B \-c, .B \-i, .B \-s, or .B \-t options was given the first argument is taken as the name of a file of commands to be executed. The shell opens this file, and saves its name for possible res((ubstitution by `$0'. Since many systems use either the standard version 6 or version 7 shells whose shell scripts are not compatible with this shell, the shell will execute such a `standard' shell if the first character of a script is not a `#', i.e. if the script does not start with a comment. Remaining arguments initialize the variable .I argv. .sh "Signal handling" The shell normally ignores .I quit signals. Jobs running detached (either by `&' or the \fIbg\fR or \fB%... &\fR commands) are immune to signals generated from the keyboard, including hangups. Other signals have the values which the shell inherited from its parent. The shells handling of interrupts and terminate signals in shell scripts can be controlled by .I onintr. Login shells catch the .I terminate signal; otherwise this signal is passed on to children from the state in the shell's parent. In no case are interrupts allowed when a login shell is reading the file `\&.logout'. .SH AUTHOR William Joy. Job control and directory stack features first implemented by J.E. Kulp of I.I.A.S.A, Laxenburg, Austria, with different syntax than that used now. .SH FILES .ta 1.75i .nf ~/.cshrc Read at beginning of execution by each shell. ~/.login Read by login shell, after `.cshrc' at login. ~/.logout Read by login shell, at logout. /bin/sh Standard shell, for shell scripts not starting with a `#'. /tmp/sh* Temporary file for `<<'. /etc/passwd Source of home directories for `~name'. .fi .SH LIMITATIONS Words can be no longer than 1024 characters. The system limits argument lists to 10240 characters. The number of arguments to a command which involves filename expansion is limited to 1/6'th the number of characters allowed in an argument list. Command substitutions may substitute no more characters than are allowed in an argument list. To detect looping, the shell restricts the number of .I alias substititutions on a single line to 20. .SH "SEE ALSO" sh(1), newcsh(1), access(2), exec(2), fork(2), killpg(2), pipe(2), sigsys(2), umask(2), vlimit(2), wait(2), jobs(3), sigset(3), tty(4), a.out(5), environ(5), `An introduction to the C shell' .SH BUGS When a command is restarted from a stop, the shell prints the directory it started in if this is different from the current directory; this can be misleading (i.e. wrong) as the job may have changed directories internally. .PP Shell builtin functions are not stoppable/restartable. Command sequences of the form `a ; b ; c' are also not handled gracefully when stopping is attempted. If you suspend `b', the shell will then immediately execute `c'. This is especially noticeable if this expansion results from an .I alias. It suffices to place the sequence of commands in ()'s to force it to a subshell, i.e. `( a ; b ; c )'. .PP Control over tty output after processes are started is primitive; perhaps this will inspire someone to work on a good virtual terminal interface. In a virtual terminal interface much more interesting things could be done with output control. .PP Alias substitution is most often used to clumsily simulate shell procedures; shell procedures should be provided rather than aliases. .PP Commands within loops, prompted for by `?', are not placed in the .I history list. Control structure should be parsed rather than being recognized as built-in commands. This would allow control commands to be placed anywhere, to be combined with `|', and to be used with `&' and `;' metasyntax. .PP It should be possible to use the `:' modifiers on the output of command substitutions. All and more than one `:' modifier should be allowed on `$' substitutions. dures should be provided rather than aliases. .PP Commands within loops, prompted for by `?', are not placed in the .I history list. Control structure should be parsed rather than being recognized as built-in commands. This would allow control commands to be placed anywhere, to be combined with `|', and to be used with `&' and `;' metasyntax. .PP It should be possible to use the `:' modifiers on the output of command substitutions. All and more than one `:' modifier should be aman/man1/ctags.1 644 0 33 5366 2512730473 6642 .TH CTAGS 1 4/1/81 .UC 4 .SH NAME ctags \- create a tags file .SH SYNOPSIS .B ctags [ .B \-u ] [ .B \-v ] [ .B \-w ] [ .B \-x ] name ... .SH DESCRIPTION .I Ctags makes a tags file for .IR ex (1) from the specified C, Pascal and Fortran sources. A tags file gives the locations of specified objects (in this case functions) in a group of files. Each line of the tags file contains the function name, the file in which it is defined, and a scanning pattern used to find the function definition. These are given in separate fields on the line, separated by blanks or tabs. Using the .I tags file, .I ex can quickly find these function definitions. .PP If the .B \-x flag is given, .I ctags produces a list of function names, the line number and file name on which each is defined, as well as the text of that line and prints this on the standard output. This is a simple index which can be printed out as an off-line readable function index. .PP If the .B \-v flag is given, an index of the form expected by .IR vgrind (1) is produced on the standard output. This listing contains the function name, file name, and page number (assuming 64 line pages). Since the output will be sorted into lexicographic order, it may be desired to run the output through .BR "sort \-f" . Sample use: .nf ctags \-v files | sort \-f > index vgrind \-x index .fi .PP Files whose name ends in .B \.c or .B \.h are assumed to be C source files and are searched for C routine and macro definitions. Others are first examined to see if they contain any Pascal or Fortran routine definitions; if not, they are processed again looking for C definitions. .PP Other options are: .TP 5 .B \-w suppressing warning diagnostics. .TP 5 .B \-u causing the specified files to be .I updated in tags, that is, all references to them are deleted, and the new values are appended to the file. (Beware: this option is implemented in a way which is rather slow; it is usually faster to simply rebuild the .I tags file.) .PP The tag .I main is treated specially in C programs. The tag formed is created by prepending .I M to the name of the file, with a trailing .c removed, if any, and leading pathname components also removed. This makes use of .I ctags practical in directories with more than one program. .SH FILES .DT tags output tags file .SH SEE ALSO ex(1), vi(1) .SH AUTHOR Ken Arnold; FORTRAN added by Jim Kleckner; Bill Joy added Pascal and .B \-x, replacing .I cxref. .SH BUGS Recognition of \fBfunctions\fR, \fBsubroutines\fR and \fBprocedures\fR for FORTRAN and Pascal is done is a very simpleminded way. No attempt is made to deal with block structure; if you have two Pascal procedures in different blocks with the same name you lose. .PP The method of deciding whether to look for C or Pascal and FORTRAN functions is a hack. tput tags file .SH SEE ALSO ex(1), vi(1) .SH AUTHOR Ken Arnold; FORTRAN added by Jim Kleckner; Bill Joy added Pascal and .B \-x, replacing .I cxref. .SH BUGS Recognition of \fBfunctions\fR, \fBsubroutines\fR and \fBprocedures\fR for FORTRAN and Pascal is done is a vman/man1/cu.1c 644 0 33 7306 2512730473 6307 .TH CU 1C 4/1/81 .UC 4 .SH NAME cu \- call UNIX .SH SYNOPSIS .B cu telno [ .B \-t ] [ .BI \- n [ .B \-s speed ] [ .B \-a acu ] [ .B \-l line ] [ .B \-b ] .SH DESCRIPTION .I Cu calls up another UNIX system, a terminal, or possibly a non-UNIX system. It manages an interactive conversation with possible transfers of text files. .I Telno is the telephone number, with minus signs at appropriate places for delays. The .BR \-t "" flag is used to dial out to a terminal. .I Speed gives the transmission speed (110, 134, 150, 300, 1200); 300 is the default value. .PP The .B \-a and .B \-l values may be used to specify pathnames for the ACU and communications line devices. They can be used to override the following built-in choices: .PP .BR \-a " /dev/cua0" .BR \-l " /dev/cul0" .PP The .BI \- n option, where .I n is a single digit, changes the last character of the ACU and communications line to .IR n . It is an abbreviation for .BI "\-a /dev/cua" n " \-l /dev/cul" n . .PP After making the connection, .I cu runs as two processes: the .I send process reads the standard input and passes most of it to the remote system; the .I receive process reads from the remote system and passes most data to the standard output. Lines beginning with `~' have special meanings. .PP The .I send process interprets the following: .TP 18 ~\|\fB.\| terminate the conversation. .br .ns .TP 18 ~EOT terminate the conversation .TP 18 ~[>][:]file .br zero or more lines to be written to file .br \&~> .PP In any case, output is diverted (or appended, if `>>' used) to the file. If `:' is used, the diversion is .I silent, i.e., it is written only to the file. If `:' is omitted, output is written both to the file and to the standard output. The trailing `~>' terminates the diversion. .PP The use of .B ~%put requires .I stty and .I cat on the remote side. It also requires that the current erase and kill characters on the remote system be identical to the current ones on the local system. Backslashes are inserted at appropriate places. .PP The use of .B ~%take requires the existence of .I echo and .I tee on the remote system. Also, .B "stty tabs" mode is required on the remote system if tabs are to be copied without expansion. .PP Finally, the .BR \-b flag specifies that nulls are to be turned into breaks. This allows the break key (and also control-shift-@) to send a break. .SH FILES /dev/cua0 .br /dev/cul0 .br /dev/null .br /usr/spool/uucp/LCK..cu[al][0-7] .SH "SEE ALSO" rv(4), tty(4) .SH DIAGNOSTICS Exit code is zero for normal exit, nonzero (various values) otherwise. .SH BUGS Only .IR mail (1) uses syntax anything like the syntax of .I cu. bs" mode is required on the remote system if tabs are to be copied without expansion. .PP Finally, the .BR \-b flag specifies that nulls are to be turned into breaks. This allows the break key (and also control-shift-@) to send a break. .SH FILES /dev/cua0 .br /dev/cul0 .br /dev/null .br /usr/spool/uucp/LCK..cu[aman/man1/cxref.1 664 0 33 104 2512730473 6613 .pl 1 The ``cxref'' command is obsolete. Use ``ctags -x'' instead. ro for normal exit, nonzero (various values) otherwise. .SH BUGS Only .IR mail (1) uses syntax anything like the syntax of .I cu. bs" mode is required on the remote system if tabs are to be copied without expansion. .PP Finally, the .BR \-b flag specifies that nulls are to be turned into breaks. This allows the break key (and also control-shift-@) to/( ,( 5 Ċ /\@,\D"man/man1/date.1 644 0 33 2300 2512730473 6437 .TH DATE 1 VAX/11 .UC 4 .SH NAME date \- print and set the date .SH SYNOPSIS .B date .RB "[ yymmddhhmm [ " . "ss ] ]" .SH DESCRIPTION If no argument is given, the current date and time are printed. If an argument is given, the current date is set. .I yy is the last two digits of the year; the first .I mm is the month number; .I dd is the day number in the month; .I hh is the hour number (24 hour system); the second .I mm is the minute number; .BI . ss is optional and is the seconds. For example: .IP date 10080045 .PP sets the date to Oct 8, 12:45 AM. The year, month and day may be omitted, the current values being the defaults. The system operates in GMT. .I Date takes care of the conversion to and from local standard and daylight time. .SH FILES /usr/adm/wtmp to record time-setting .SH SEE ALSO utmp(5) .SH DIAGNOSTICS `No permission' if you aren't the super-user and you try to change the date; `bad conversion' if the date set is syntactically incorrect. .SH BUGS The system attempts to keep the date in a format closely compatible with VMS. VMS, however, uses local time (rather than GMT) and does not understand daylight savings time. Thus if you use both UNIX and VMS, VMS will be running on GMT. and from local standard and daylight time. .SH FILES /usr/adm/wtmp to record time-setting .SH SEE ALSO utmp(5) .SH DIAGNOSTICS `No permission' if you aren't the super-user and you try to change the date; `bad conversion' if the date set is syntactically incorrect. .SH BUGS The system attempts to keep the date in a formman/man1/dc.1 644 0 33 10215 2512730473 6134 .TH DC 1 .SH NAME dc \- desk calculator .SH SYNOPSIS .B dc [ file ] .SH DESCRIPTION .I Dc is an arbitrary precision arithmetic package. Ordinarily it operates on decimal integers, but one may specify an input base, output base, and a number of fractional digits to be maintained. The overall structure of .I dc is a stacking (reverse Polish) calculator. If an argument is given, input is taken from that file until its end, then from the standard input. The following constructions are recognized: .HP 6 number .br The value of the number is pushed on the stack. A number is an unbroken string of the digits 0-9. It may be preceded by an underscore _ to input a negative number. Numbers may contain decimal points. .HP 6 + \- / * % ^ .br The top two values on the stack are added (+), subtracted (\-), multiplied (*), divided (/), remaindered (%), or exponentiated (^). The two entries are popped off the stack; the result is pushed on the stack in their place. Any fractional part of an exponent is ignored. .TP .BI s x The top of the stack is popped and stored into a register named .I x, where .I x may be any character. If the .B s is capitalized, .I x is treated as a stack and the value is pushed on it. .TP .BI l x The value in register .I x is pushed on the stack. The register .I x is not altered. All registers start with zero value. If the .B l is capitalized, register .I x is treated as a stack and its top value is popped onto the main stack. .TP .B d The top value on the stack is duplicated. .TP .B p The top value on the stack is printed. The top value remains unchanged. .B P interprets the top of the stack as an ascii string, removes it, and prints it. .TP .B f All values on the stack and in registers are printed. .TP .B q exits the program. If executing a string, the recursion level is popped by two. If .B q is capitalized, the top value on the stack is popped and the string execution level is popped by that value. .TP .B x treats the top element of the stack as a character string and executes it as a string of dc commands. .TP .B X replaces the number on the top of the stack with its scale factor. .TP .B "[ ... ]" puts the bracketed ascii string onto the top of the stack. .HP 6 .I "x =x" .br The top two elements of the stack are popped and compared. Register .I x is executed if they obey the stated relation. .TP .B v replaces the top element on the stack by its square root. Any existing fractional part of the argument is taken into account, but otherwise the scale factor is ignored. .TP .B ! interprets the rest of the line as a UNIX command. .TP .B c All values on the stack are popped. .TP .B i The top value on the stack is popped and used as the number radix for further input. .B I pushes the input base on the top of the stack. .TP .B o The top value on the stack is popped and used as the number radix for further output. .TP .SM .B O pushes the output base on the top of the stack. .TP .B k the top of the stack is popped, and that value is used as a non-negative scale factor: the appropriate number of places are printed on output, and maintained during multiplication, division, and exponentiation. The interaction of scale factor, input base, and output base will be reasonable if all are changed together. .TP .B z The stack level is pushed onto the stack. .TP .SM .B Z replaces the number on the top of the stack with its length. .TP .B ? A line of input is taken from the input source (usually the terminal) and executed. .TP .B "; :" are used by .I bc for array operations. .PP An example which prints the first ten values of n! is .nf .PP .in +3 [la1+dsa*pla10>y]sy .br 0sa1 .br lyx .fi .SH "SEE ALSO" bc(1), which is a preprocessor for .I dc providing infix notation and a C-like syntax which implements functions and reasonable control structures for programs. .SH DIAGNOSTICS `x is unimplemented' where x is an octal number. .br `stack empty' for not enough elements on the stack to do what was asked. .br `Out of space' when the free list is exhausted (too many digits). .br `Out of headers' for too many numbers being kept around. .br `Out of pushdown' for too many items on the stack. .br `Nesting Depth' for too many levels of nested execution. dc providing infix notation and a C-like syntax which implements functions and reasonable control structures for programs. .SH DIAGNOSTICS `x is unimplemented' where x is an octal number. .br `stack empty' for not enough elements on the stack to do what was asked. .br `Out of space' when the free list is exhausted (too many digits). .br `Out of headers' for too many nu((man/man1/dd.1 644 0 33 6277 2512730474 6133 .TH DD 1 .UC 4 .SH NAME dd \- convert and copy a file .SH SYNOPSIS .B dd [option=value] ... .SH DESCRIPTION .I Dd copies the specified input file to the specified output with possible conversions. The standard input and output are used by default. The input and output block size may be specified to take advantage of raw physical I/O. .PP .br .ns .TP 15 .I option .I values .br .ns .TP if= input file name; standard input is default .br .ns .TP of= output file name; standard output is default .br .ns .TP .RI ibs= n input block size .I n bytes (default 512) .br .ns .TP .RI obs= n output block size (default 512) .br .ns .TP .RI bs= n set both input and output block size, superseding .I ibs and .I obs; also, if no conversion is specified, it is particularly efficient since no copy need be done .br .ns .TP .RI cbs= n conversion buffer size .br .ns .TP .RI skip= n skip .IR n "" input records before starting copy .br .ns .TP .RI files= n skip .I n input files before starting copy .br .ns .TP .RI seek= n seek .I n records from beginning of output file before copying .br .ns .TP count=\fIn\fR copy only .IR n "" input records .br .ns .TP conv=ascii .ds h \h'\w'conv='u' convert EBCDIC to ASCII .br .ns .IP \*hebcdic convert ASCII to EBCDIC .br .ns .IP \*hibm slightly different map of ASCII to EBCDIC .br .ns .IP \*hblock convert variable length records to fixed length .br .ns .IP \*hunblock convert fixed length records to variable length .br .ns .IP \*hlcase map alphabetics to lower case .br .ns .IP \*hucase map alphabetics to upper case .br .ns .IP \*hswab swap every pair of bytes .br .ns .IP \*hnoerror do not stop processing on an error .br .ns .IP \*hsync pad every input record to .I ibs .br .ns .IP "\*h... , ..." several comma-separated conversions .PP .fi Where sizes are specified, a number of bytes is expected. A number may end with .B "k, b" or .B w to specify multiplication by 1024, 512, or 2 respectively; a pair of numbers may be separated by .B x to indicate a product. .PP .I Cbs is used only if .I ascii, .I unblock, .I ebcdic, .I ibm, or .I block conversion is specified. In the first two cases, .I cbs characters are placed into the conversion buffer, any specified character mapping is done, trailing blanks trimmed and new-line added before sending the line to the output. In the latter three cases, characters are read into the conversion buffer, and blanks added to make up an output record of size .IR cbs . .PP After completion, .I dd reports the number of whole and partial input and output blocks. .PP For example, to read an EBCDIC tape blocked ten 80-byte EBCDIC card images per record into the ASCII file .I x: .IP .nf dd if=/dev/rmt0 of=x ibs=800 cbs=80 conv=ascii,lcase .fi .PP Note the use of raw magtape. .I Dd is especially suited to I/O on the raw physical devices because it allows reading and writing in arbitrary record sizes. .SH "SEE ALSO" cp(1), tr(1) .SH DIAGNOSTICS f+p records in(out): numbers of full and partial records read(written) .SH BUGS The ASCII/EBCDIC conversion tables are taken from the 256 character standard in the CACM Nov, 1968. The `ibm' conversion, while less blessed as a standard, corresponds better to certain IBM print train conventions. There is no universal solution. raw magtape. .I Dd is especially suited to I/O on the raw physical devices because it allows reading and writing in arbitrary record sizes. .SH "SEE ALSO" cp(1), tr(1) .SH DIAGNOSTICS f+p records in(out): numbers of full and partial records read(written) .SH BUGS The ASCII/EBCDIC conversion tables are taken from the 25man/man1/deroff.1 644 0 33 2172 2512730474 6777 .TH DEROFF 1 .SH NAME deroff \- remove nroff, troff, tbl and eqn constructs .SH SYNOPSIS .B deroff [ .B \-w ] file ... .SH DESCRIPTION .I Deroff reads each file in sequence and removes all .I nroff and .I troff command lines, backslash constructions, macro definitions, .I eqn constructs (between `.EQ' and `.EN' lines or between delimiters), and table descriptions and writes the remainder on the standard output. .I Deroff follows chains of included files (`.so' and `.nx' commands); if a file has already been included, a `.so' is ignored and a `.nx' terminates execution. If no input file is given, .I deroff reads from the standard input file. .PP If the .B \-w flag is given, the output is a word list, one `word' (string of letters, digits, and apostrophes, beginning with a letter; apostrophes are removed) per line, and all other characters ignored. Otherwise, the output follows the original, with the deletions mentioned above. .SH "SEE ALSO" troff(1), eqn(1), tbl(1) .SH BUGS .I Deroff is not a complete .I troff interpreter, so it can be confused by subtle constructs. Most errors result in too much rather than too little output. dard input file. .PP If the .B \-w flag is given, the output is a word list, one `word' (string of letters, digits, and apostrophes, beginning with a letter; apostrophes are removed) per line, and all other characters ignored. Otherwise, the output follows the original, with the deletions mentioned above. .SH "SEE ALSO" troff(1), eqn(1), tbl(1) .SH BUGS .I Deroff is not a complete .I troman/man1/df.1 644 0 33 1646 2512730475 6131 .TH DF 1 .UC 4 .SH NAME df \- disk free .SH SYNOPSIS .B df [ .B \-i ] [ .B \-l ] [ filesystem ... ] [ file ... ] .SH DESCRIPTION .I Df prints out the number of free blocks available on the specified .I filesystem, e.g. ``/dev/rp0a'', or on the filesystem in which the specified .I file, e.g. ``$HOME'', is contained. If no file system is specified, the free space on all of the normally mounted file systems is printed. .PP The reported numbers are in file system block units; currently each filesystem block is 1024 bytes long, twice the size of the blocks reported by .IR du (1) or .IR ls (1) with the .B \-s option. .PP Other options are: .TP .B \-i Report also the number of inodes which are used and free. .TP .B \-l examines also the free list, double checking that the summary number in the filesystem superblock is correct. .SH FILES /etc/fstab list of normally mounted filesystems .SH "SEE ALSO" fstab(5), icheck(8), quot(8) P The reported numbers are in file system block units; currently each filesystem block is man/man1/diction.1 644 0 33 2107 2512730475 7162 .TH DICTION 1 .SH NAME diction,explain \- print wordy sentences; thesaurus for diction .SH SYNOPSIS .B diction [ .B \-ml ] [ .B \-mm ] [ .B \-n ] [ .B \-f pfile ] file ... .br .B explain .LP .SH DESCRIPTION .I Diction finds all sentences in a document that contain phrases from a data base of bad or wordy diction. Each phrase is bracketed with [ ]. Because .I diction runs .I deroff before looking at the text, formatting header files should be included as part of the input. The default macro package .B \-ms may be overridden with the flag .B \-mm. The flag .B \-ml which causes .B deroff to skip lists, should be used if the document contains many lists of non-sentences. The user may supply her/his own pattern file to be used in addition to the default file with .B \-f .I pfile. If the flag .B \-n is also supplied the default file will be suppressed. .PP .I Explain is an interactive thesaurus for the phrases found by diction. .SH "SEE ALSO" deroff(1) .SH BUGS Use of non-standard formatting macros may cause incorrect sentence breaks. In particular, .I diction doesn't grok .B \-me. .B deroff to skip lists, should be used if the document contains many lists of non-sentences. The user may supply her/his own pattern file to be used in addition to the default file with .B \-f .I pfile. If the flag .B \-n is also supplied the default file will be suppressed. .PP .I Explain is an interactive thesaurus for the phrases found by diction. .SH "SEE ALSO" deroff(1) .SH BUGS Use of non-standard formatting macros may cause incoman/man1/diff.1 644 0 33 11723 2531446135 6463 ((.TH DIFF 1 .UC 4 .SH NAME diff \- differential file and directory comparator .SH SYNOPSIS .B diff [ .B \-l ] [ .B \-r ] [ .B \-s ] [ \fB\-cefh\fR ] [ .B \-b ] dir1 dir2 .br .B diff [ \fB\-cefh ] [ \fB\-b\fR ] file1 file2 .br .B diff [ .BI \-D string ] [ .B \-b ] file1 file2 .SH DESCRIPTION If both arguments are directories, .I diff sorts the contents of the directories by name, and then runs the regular file .I diff algorithm (described below) on text files which are different. Binary files which differ, common subdirectories, and files which appear in only one directory are listed. Options when comparing directories are: .TP .B \-l long output format; each text file .I diff is piped through .IR pr (1) to paginate it, other differences are remembered and summarized after all text file differences are reported. .TP .B \-r causes application of .I diff recursively to common subdirectories encountered. .TP .B \-s causes .I diff to report files which are the same, which are otherwise not mentioned. .TP .B \-Sname starts a directory .I diff in the middle beginning with file .I name. .PP When run on regular files, and when comparing text files which differ during directory comparison, .I diff tells what lines must be changed in the files to bring them into agreement. Except in rare circumstances, .I diff finds a smallest sufficient set of file differences. If neither .I file1 nor .I file2 is a directory, then either may be given as `\-', in which case the standard input is used. If .I file1 is a directory, then a file in that directory whose file-name is the same as the file-name of .I file2 is used (and vice versa). .PP There are several options for output format; the default output format contains lines of these forms: .IP "" 5 .I n1 a .I n3,n4 .br .I n1,n2 d .I n3 .br .I n1,n2 c .I n3,n4 .PP These lines resemble .I ed commands to convert .I file1 into .IR file2 . The numbers after the letters pertain to .IR file2 . In fact, by exchanging `a' for `d' and reading backward one may ascertain equally how to convert .I file2 into .IR file1 . As in .I ed, identical pairs where .I n1 = .I n2 or .I n3 = .I n4 are abbreviated as a single number. .PP Following each of these lines come all the lines that are affected in the first file flagged by `<', then all the lines that are affected in the second file flagged by `>'. .PP Except for .B \-b, which may be given with any of the others, the following options are mutually exclusive: .TP 9 .B \-e producing a script of .I "a, c" and .I d commands for the editor .I ed, which will recreate .I file2 from .IR file1 . In connection with .BR \-e , the following shell program may help maintain multiple versions of a file. Only an ancestral file ($1) and a chain of version-to-version .I ed scripts ($2,$3,...) made by .I diff need be on hand. A `latest version' appears on the standard output. .IP \ \ \ \ \ \ \ \ (shift; cat $*; echo \'1,$p\') \(bv ed \- $1 .IP Extra commands are added to the output when comparing directories with .B \-e, so that the result is a .IR sh (1) script for converting text files which are common to the two directories from their state in .I dir1 to their state in .I dir2. .TP 9 .B \-f produces a script similar to that of .B \-e, not useful with .I ed, and in the opposite order. .TP 9 .B \-c produces a diff with lines of context. The default is to present 3 lines of context and may be changed, e.g to 10, by .BR \-c10 \&. With .B \-c the output format is modified slightly: the output beginning with identification of the files involved and their creation dates and then each change is separated by a line with a dozen *'s. The lines removed from .I file1 are marked with `\(mi'; those added to .I file2 are marked `+'. Lines which are changed from one file to the other are marked in both files with `!'. .TP 9 .B \-h does a fast, half-hearted job. It works only when changed stretches are short and well separated, but does work on files of unlimited length. .TP .B \-Dstring causes .I diff to create a merged version of .I file1 and .I file2 on the standard output, with C preprocessor controls included so that a compilation of the result without defining \fIstring\fR is equivalent to compiling .I file1, while defining .I string will yield .I file2. .TP .B \-b causes trailing blanks (spaces and tabs) to be ignored, and other strings of blanks to compare equal. .SH FILES /tmp/d????? .br /usr/lib/diffh for .B \-h .br /usr/bin/pr .SH "SEE ALSO" cmp(1), cc(1), comm(1), ed(1), diff3(1) .SH DIAGNOSTICS Exit status is 0 for no differences, 1 for some, 2 for trouble. .SH BUGS Editing scripts produced under the .BR \-e " or" .BR \-f " option are naive about" creating lines consisting of a single `\fB.\fR'. .PP When comparing directories with the .B \-b option specified, .I diff first compares the files ala .I cmp, and then decides to run the .I diff algorithm if they are not equal. This may cause a small amount of spurious output if the files then turn out to be identical because the only differences are insignificant blank string differences. 1 for some, 2 for trouble. .SH BUGS Editing sman/man1/diff3.1 644 0 33 3025 2512730475 6524 .TH DIFF3 1 .SH NAME diff3 \- 3-way differential file comparison .SH SYNOPSIS .B diff3 [ .B \-ex3 ] file1 file2 file3 .SH DESCRIPTION .I Diff3 compares three versions of a file, and publishes disagreeing ranges of text flagged with these codes: .TP 16 ==== all three files differ .TP 16 ====1 .IR file1 " is different" .TP 16 ====2 .IR file2 " is different" .TP 16 ====3 .IR file3 " is different" .PP The type of change suffered in converting a given range of a given file to some other is indicated in one of these ways: .TP 16 .IB f " : " n1 " a" Text is to be appended after line number .I n1 in file .I f, where .I f = 1, 2, or 3. .TP 16 .IB f " : " n1 " , " n2 " c" Text is to be changed in the range line .I n1 to line .IR n2 . If .I n1 = .I n2, the range may be abbreviated to .IR n1 . .PP The original contents of the range follows immediately after a .B c indication. When the contents of two files are identical, the contents of the lower-numbered file is suppressed. .PP Under the .B \-e option, .I diff3 publishes a script for the editor .I ed that will incorporate into .I file1 all changes between .I file2 and .I file3, .IR i.e . the changes that normally would be flagged ==== and ====3. Option .B \-x (\fB\-3\fR) produces a script to incorporate only changes flagged ==== (====3). The following command will apply the resulting script to `file1'. .PP .ti 16n (cat script; echo \'1,$p\') \(bv ed \- file1 .SH FILES /tmp/d3????? .br /usr/lib/diff3 .SH "SEE ALSO" diff(1) .SH BUGS Text lines that consist of a single `.' will defeat .B \-e. editor .I ed that will incorporate into .I file1 all changes between .I file2 and .I file3, .IR i.e . the changes that normally would be flagged ==== and ====3. Option .B \-x (\fB\-3\fR) produces a script to incorporate only changes flagged ==== (====3). The following command will apply the resulting script to `file1'. .PP .ti 16n (cat script; echo \'1,$p\') \(bv ed \- file1 .SH FILES /tmp/d3????? .br /usr/lib/diff3 .SH "SEE ALSO" diff(1) .SH BUGS Text lines that consist of a single `.'man/man1/diffdir.1 644 0 33 373 2512730476 7124 .pl 1 The ``diffdir'' command is obsolete, as it has been incorporated into ``diff'' by specifying ``diff dir1 dir2''. Note, however, that the ``\-h'' option of ``diffdir'' is now the ``\-l'' option in ``diff'', as diff already had a ``\-h'' option. es flagged ==== (====3). The following command will apply the resulting script to `file1'. .PP .ti 16n (cat script; echo \'1,$p\') \(bv ed \- file1 .SH FILES /tmp/d3????/( ,( 5Ċ /\@,\D"man/man1/diffh.1 664 0 33 31 2512730476 6546 .so /usr/man/man1/diff.1 mand is obsolete, as it has been incorporated into ``diff'' by specifying ``diff dir1 dir2''. Note, however, that the ``\-h'' option of ``diffdir'' is now the ``\-l'' option in ``diff'', as diff already had a ``\-h'' option. es flagged ==== (====3). The following command will apply the resulting script to `file1'. .PP .ti 16n (cat script; echo \'1,$p\') \(bv ed \- file1 .SH FILES /tmp/d3????/( ,( 5Ċ /\@,\D"man/man1/du.1 644 0 33 1420 2531446134 6133 ((.TH DU 1 .SH NAME du \- summarize disk usage .SH SYNOPSIS .B du [ .B \-s ] [ .B \-a ] [ name ... ] .SH DESCRIPTION .I Du gives the number of blocks contained in all files and (recursively) directories within each specified directory or file .IR name . If .I name is missing, `\fB.\fR' is used. .PP The optional argument .B \-s causes only the grand total to be given. The optional argument .B \-a causes an entry to be generated for each file. Absence of either causes an entry to be generated for each directory only. .PP A file which has two links to it is only counted once. .SH "SEE ALSO" df(1), quot(8) .SH BUGS Non-directories given as arguments (not under .B \-a option) are not listed. .br If there are too many distinct linked files, .I du counts the excess files multiply. ng, `\fB.\fR' is used. .PP The optional argument .B \-s causes only the grand total to be given. The optional argument .B \-a causes an entry to be generated for each file. Absence of either causes an entry to be generated for each directorman/man1/echo.1 644 0 33 672 2512730476 6435 .TH ECHO 1 .SH NAME echo \- echo arguments .SH SYNOPSIS .B echo [ .B \-n ] [ arg ] ... .SH DESCRIPTION .I Echo writes its arguments separated by blanks and terminated by a newline on the standard output. If the flag .B \-n is used, no newline is added to the output. .PP .I Echo is useful for producing diagnostics in shell programs and for writing constant data on pipes. To send diagnostics to the standard error file, do `echo ... 1>&2'. ,( 5Ċ /\@,\D"man/man1/ed.1 644 0 33 43043 2512730476 6146 .TH ED 1 9/14/79 .UC .if t .ds q \(aa .if n .ds q ' .SH NAME ed \- text editor .SH SYNOPSIS .B ed [ .B \- ] [ .BR \-p [prompt] ] [ .B \-u ] [ .B \-x ] [ name ] .SH DESCRIPTION .I Ed is the standard text editor. .PP If a .I name argument is given, .I ed simulates an .I e command (see below)\| on the named file; that is to say, the file is read into .I ed's buffer so that it can be edited. If .B \-p is present, .I ed prompts for commands with `* ' (or .I prompt if given.) If .B \-u is present, all lower case text in the buffer is converted to upper case. If .B \-x is present, an .I x command is simulated first to handle an encrypted file. The optional .B \- suppresses the printing of explanatory output and should be used when the standard input is an editor script. .PP .I Ed operates on a copy of any file it is editing; changes made in the copy have no effect on the file until a .IR w "" (write)\| command is given. The copy of the text being edited resides in a temporary file called the .IR buffer . .PP Commands to .I ed have a simple and regular structure: zero or more .I addresses followed by a single character .I command, possibly followed by parameters to the command. These addresses specify one or more lines in the buffer. Missing addresses are supplied by default. .PP In general, only one command may appear on a line. Certain commands allow the addition of text to the buffer. While .I ed is accepting text, it is said to be in .I "input mode." In this mode, no commands are recognized; all input is merely collected. Input mode is left by typing a period `\fB.\fR' alone at the beginning of a line. .PP .I Ed supports a limited form of .I "regular expression" notation. A regular expression specifies a set of strings of characters. A member of this set of strings is said to be .I matched by the regular expression. In the following specification for regular expressions the word `character' means any character but newline. .IP 1. Any character except a special character matches itself. Special characters are the regular expression delimiter plus .RB \e\|[\| . and sometimes ^\|*\|$. .IP 2. A .B . matches any character. .IP 3. A \e followed by any character except a digit or (\|) matches that character. .IP 4. A nonempty string .I s bracketed .RI [ \|s\| ] (or .RI [^ s\| ]) matches any character in (or not in) .I s. In .I s, \e has no special meaning, and ] may only appear as the first letter. A substring .I a\-b, with .I a and .I b in ascending ASCII order, stands for the inclusive range of ASCII characters. .IP 5. A regular expression of form 1-4 followed by * matches a sequence of 0 or more matches of the regular expression. .IP 6. A regular expression, .I x, of form 1-8, bracketed .RI \e( \|x\| \e) matches what .I x matches. .IP 7. A \e followed by a digit .I n matches a copy of the string that the bracketed regular expression beginning with the .IR n th \e( matched. .IP 8. A regular expression of form 1-8, .I x, followed by a regular expression of form 1-7, .I y matches a match for .I x followed by a match for .I y, with the .I x match being as long as possible while still permitting a .I y match. .IP 9. A regular expression of form 1-8 preceded by ^ (or followed by $), is constrained to matches that begin at the left (or end at the right) end of a line. .IP 10. A regular expression of form 1-9 picks out the longest among the leftmost matches in a line. .IP 11. An empty regular expression stands for a copy of the last regular expression encountered. .PP Regular expressions are used in addresses to specify lines and in one command (see .I s below)\| to specify a portion of a line which is to be replaced. If it is desired to use one of the regular expression metacharacters as an ordinary character, that character may be preceded by `\e'. This also applies to the character bounding the regular expression (often `/')\| and to `\e' itself. .PP To understand addressing in .I ed it is necessary to know that at any time there is a .I "current line." Generally speaking, the current line is the last line affected by a command; however, the exact effect on the current line is discussed under the description of the command. Addresses are constructed as follows. .TP 1. The character `\fB.\fR' addresses the current line. .TP 2. The character `$' addresses the last line of the buffer. .TP 3. A decimal number .I n addresses the .IR n -th line of the buffer. .TP 4. `\(fm\fIx\fR' addresses the line marked with the name .IR x , which must be a lower-case letter. Lines are marked with the .I k command described below. .TP 5. A regular expression enclosed in slashes `/' addresses the line found by searching forward from the current line and stopping at the first line containing a string that matches the regular expression. If necessary the search wraps around to the beginning of the buffer. .TP 6. A regular expression enclosed in queries `?' addresses the line found by searching backward from the current line and stopping at the first line containing a string that matches the regular expression. If necessary the search wraps around to the end of the buffer. .TP 7. An address followed by a plus sign `+' or a minus sign `\-' followed by a decimal number specifies that address plus (resp. minus)\| the indicated number of lines. The plus sign may be omitted. .TP 8. If an address begins with `+' or `\-' the addition or subtraction is taken with respect to the current line; e.g. `\-5' is understood to mean `\fB.\fR\-5'. .TP 9. If an address ends with `+' or `\-', then 1 is added (resp. subtracted). As a consequence of this rule and rule 8, the address `\-' refers to the line before the current line. Moreover, trailing `+' and `\-' characters have cumulative effect, so `\-\-' refers to the current line less 2. .TP 10. To maintain compatibility with earlier versions of the editor, the character `^' in addresses is equivalent to `\-'. .PP Commands may require zero, one, or two addresses. Commands which require no addresses regard the presence of an address as an error. Commands which accept one or two addresses assume default addresses when insufficient are given. If more addresses are given than such a command requires, the last one or two (depending on what is accepted)\| are used. .PP Addresses are separated from each other typically by a comma `\fB,\fR'. They may also be separated by a semicolon `\fB;\fR'. In this case the current line `\fB.\fR' is set to the previous address before the next address is interpreted. This feature can be used to determine the starting line for forward and backward searches (`/', `?')\|. The second address of any two-address sequence must correspond to a line following the line corresponding to the first address. The special form `%' is an abbreviation for the address pair `1,$'. .PP In the following list of .I ed commands, the default addresses are shown in parentheses. The parentheses are not part of the address, but are used to show that the given addresses are the default. .PP As mentioned, it is generally illegal for more than one command to appear on a line. However, most commands may be suffixed by `p' or by `l', in which case the current line is either printed or listed respectively in the way discussed below. Commands may also be suffixed by `n', meaning the output of the command is to be line numbered. These suffixes may be combined in any order. .TP 5 .RB (\| .\| )\|a .br .ns .TP 5 .br .ns .TP 5 .B . .br The append command reads the given text and appends it after the addressed line. `\fB.\fR' is left on the last line input, if there were any, otherwise at the addressed line. Address `0' is legal for this(( command; text is placed at the beginning of the buffer. .TP 5 .RB (\| .\| ,\ .\| )\|c .br .ns .TP 5 .br .ns .TP 5 .B . .br The change command deletes the addressed lines, then accepts input text which replaces these lines. `\fB.\fR' is left at the last line input; if there were none, it is left at the line preceding the deleted lines. .TP 5 .RB (\| .\| ,\ .\| )\|d The delete command deletes the addressed lines from the buffer. The line originally after the last line deleted becomes the current line; if the lines deleted were originally at the end, the new last line becomes the current line. .TP 5 e filename The edit command causes the entire contents of the buffer to be deleted, and then the named file to be read in. `\fB.\fR' is set to the last line of the buffer. The number of characters read is typed. `filename' is remembered for possible use as a default file name in a subsequent .I r or .I w command. If `filename' is missing, the remembered name is used. .TP 5 E filename This command is the same as .I e, except that no diagnostic results when no .I w has been given since the last buffer alteration. .TP 5 f filename The filename command prints the currently remembered file name. If `filename' is given, the currently remembered file name is changed to `filename'. .TP 5 (1,$)\|g/regular expression/command list In the global command, the first step is to mark every line which matches the given regular expression. Then for every such line, the given command list is executed with `\fB.\fR' initially set to that line. A single command or the first of multiple commands appears on the same line with the global command. All lines of a multi-line list except the last line must be ended with `\e'. .I A, .I i, and .I c commands and associated input are permitted; the `\fB.\fR' terminating input mode may be omitted if it would be on the last line of the command list. The commands .I g and .I v are not permitted in the command list. .TP 5 .RB (\| .\| )\|i .ns .TP 5 .br .ns .TP 5 .B . .br This command inserts the given text before the addressed line. `\fB.\fR' is left at the last line input, or, if there were none, at the line before the addressed line. This command differs from the .I a command only in the placement of the text. .TP 5 .RB (\| .\| ,\ . +1)\|j This command joins the addressed lines into a single line; intermediate newlines simply disappear. `\fB.\fR' is left at the resulting line. .TP 5 ( \fB. \fR)\|k\fIx\fR The mark command marks the addressed line with name .I x, which must be a lower-case letter. The address form `\(fm\fIx\fR' then addresses this line. .ne 2.5 .TP 5 .RB (\| .\| ,\ .\| )\|l The list command prints the addressed lines in an unambiguous way: non-graphic characters are printed in two-digit octal, and long lines are folded. The .I l command may be placed on the same line after any non-i/o command. .TP 5 .RB (\| .\| ,\ .\| )\|m\fIa The move command repositions the addressed lines after the line addressed by .IR a . The last of the moved lines becomes the current line. .TP 5 .RB (\| .\| ,\ .\| )\|n The number command prints the addressed lines with line numbers and a tab at the left. .TP 5 .RB (\| .\| ,\ .\| )\|p The print command prints the addressed lines. `\fB.\fR' is left at the last line printed. The .I p command may be placed on the same line after any non-i/o command. .TP .RB (\| .\| ,\ .\| )\|P This command is a synonym for .I p. .TP 5 q The quit command causes .I ed to exit. No automatic write of a file is done. .TP 5 Q This command is the same as .I q, except that no diagnostic results when no .I w has been given since the last buffer alteration. .TP 5 ($)\|r filename The read command reads in the given file after the addressed line. If no file name is given, the remembered file name, if any, is used (see .I e and .I f commands)\|. The file name is remembered if there was no remembered file name already. Address `0' is legal for .I r and causes the file to be read at the beginning of the buffer. If the read is successful, the number of characters read is typed. `\fB.\fR' is left at the last line read in from the file. .TP 5 (\| \fB.\fR\|, \fB.\fR\|)\|s/regular expression/replacement/ or, .br .ns .TP 5 (\| \fB.\fR\|, \fB.\fR\|)\|s/regular expression/replacement/g The substitute command searches each addressed line for an occurrence of the specified regular expression. On each line in which a match is found, all matched strings are replaced by the replacement specified, if the global replacement indicator `g' appears after the command. If the global indicator does not appear, only the first occurrence of the matched string is replaced. It is an error for the substitution to fail on all addressed lines. Any punctuation character may be used instead of `/' to delimit the regular expression and the replacement. `\fB.\fR' is left at the last line substituted. .IP An ampersand `&' appearing in the replacement is replaced by the string matching the regular expression. The special meaning of `&' in this context may be suppressed by preceding it by `\e'. The characters .I `\|\en' where .I n is a digit, are replaced by the text matched by the .IR n -th regular subexpression enclosed between `\e(' and `\e)'. When nested, parenthesized subexpressions are present, .I n is determined by counting occurrences of `\e(' starting from the left. .IP Lines may be split by substituting new-line characters into them. The new-line in the replacement string must be escaped by preceding it by `\e'. .IP One or two trailing delimiters may be omitted, implying the `p' suffix. The special form `s' followed by .I no delimiters repeats the most recent substitute command on the addressed lines. The `s' may be followed by the letters .B r (use the most recent regular expression for the left hand side, instead of the most recent left hand side of a substitute command), .B p (complement the setting of the .I p suffix from the previous substitution), or .B g (complement the setting of the .I g suffix). These letters may be combined in any order. .TP 5 .RB (\| .\| ,\ .\| )\|t\|\fIa This command acts just like the .I m command, except that a copy of the addressed lines is placed after address .I a (which may be 0). `\fB.\fR' is left on the last line of the copy. .TP 5 .RB (\| .\| ,\ .\| )\|u The undo command restores the buffer to it's state before the most recent buffer modifying command. The current line is also restored. Buffer modifying commands are .I a, c, d, g, i, k, m, r, s, t, and .I v. For purposes of undo, .I g and .I v are considered to be a single buffer modifying command. Undo is its own inverse. .IP When .I ed runs out of memory (at about 8000 lines on any 16 bit mini-computer such as the PDP-11) This full undo is not possible, and .I u can only undo the effect of the most recent substitute on the current line. This restricted undo also applies to editor scripts when .I ed is invoked with the .B - option. .TP 5 (1, $)\|v/regular expression/command list This command is the same as the global command .I g except that the command list is executed .I g with `\fB.\fR' initially set to every line .I except those matching the regular expression. .TP 5 (1, $)\|w filename .br The write command writes the addressed lines onto the given file. If the file does not exist, it is created. The file name is remembered if there was no remembered file name already. If no file name is given, the remembered file name, if any, is used (see .I e and .I f commands)\|. `\fB.\fR' is unchanged. If the command is successful, the number of characters written is printed. .TP (1, $)\|W filename This command is the same as .I w, except that the addressed lines are appended to the file. .TP 5 (1, $)\|wq filename This command is the same as .I w except that afterwards a .I q command is done, exiting the editor after the file is written. .TP 5 x A key string is demanded from the standard input. Later .I r, e and .I w commands will encrypt and decrypt the text with this key by the algorithm of .IR crypt (1). An explicitly empty key turns off encryption. .RB (\| .\| +1)\|z or, .br .ns .TP 5 .RB (\| .\| +1)\|z\fIn This command scrolls through the buffer starting at the addressed line. 22 (or .I n, if given) lines are printed. The last line printed becomes the current line. The value .I n is sticky, in that it becomes the default for future .I z commands. .TP 5 ($)\|= The line number of the addressed line is typed. `\fB.\fR' is unchanged by this command. .TP 5 ! The remainder of the line after the `!' is sent to .IR sh (1) to be interpreted as a command. .RB ` . ' is unchanged. .TP 5 .RB (\| . +1,\| . +1)\| An address alone on a line causes the addressed line to be printed. A blank line alone is equivalent to `.+1p'; it is useful for stepping through text. If two addresses are present with no intervening semicolon, .I ed prints the range of lines. If they are separated by a semicolon, the second line is printed. .PP If an interrupt signal (ASCII DEL)\| is sent, .I ed prints `?interrupted' and returns to its command level. .PP Some size limitations: 512 characters per line, 256 characters per global command list, 64 characters per file name, and, on mini computers, 128K characters in the temporary file. The limit on the number of lines depends on the amount of core: each line takes 2 words. .PP When reading a file, .I ed discards ASCII NUL characters and all characters after the last newline. It refuses to read files containing non-ASCII characters. .SH FILES /tmp/e* .br edhup: work is saved here if terminal hangs up .SH "SEE ALSO" B. W. Kernighan, .I A Tutorial Introduction to the ED Text Editor .br B. W. Kernighan, .I Advanced editing on UNIX .br sed(1), crypt(1) .SH DIAGNOSTICS `?name' for inaccessible file; `?self-explanitory message' for other errors. .PP To protect against throwing away valuable work, a .I q or .I e command is considered to be in error, unless a .I w has occurred since the last buffer change. A second .I q or .I e will be obeyed regardless. .SH BUGS The .I l command mishandles DEL. .br The .I undo command causes marks to be lost on affected lines. .br The .I x command, .B -x option, and special treat((ment of hangups only work on UNIX. crypt(1) .SH DIAGNOSTICS `?name' for inaccessible file; `?self-explanitory message' for other errors. .PP To protect against throwing away valuable work, a .I q or .I e command is considered to be in error, unless a .I w has occurred since the last buffer change. A second .I q or .I e will be obeyed regardless. .SH BUGS The .I l command mishandles DEL. .br The .I undo command causes marks to be lost on affected lines. .br The .I x command, .B -x option, and special treatman/man1/edit.1 644 0 33 27 2512730476 6416 .so /usr/man/man1/ex.1 rk on UNIX. crypt(1) .SH DIAGNOSTICS `?name' for inaccessible file; `?self-explanitory message' for other errors. .PP To protect against throwing away valuable work, a .I q or .I e command is considered to be in error, unless a .I w has occurred since the last buffer change. A second .I q or .I e will be obeyed regardless. .SH BUGS The .I l command mishandles DEL. .br The .I undo command caus/( ,( 5Ċ /\@,\D"man/man1/efl.1 444 0 33 3047 2512730477 6303 .TH EFL 1 .SH NAME efl \- Extended Fortran Language .SH SYNOPSIS .B efl [ option ... ] [ filename ... ] .SH DESCRIPTION .I Efl compiles a program written in the EFL language into clean Fortran. .I Efl provides the same control flow constructs as does Ratfor (1), which are essentially identical to those in C: .TP statement grouping with braces; decision-making with if, if-else, and switch-case; while, for, Fortran do, repeat, and repeat...until loops; multi-level break and next. In addition, EFL has C-like data structures, and more uniform and convenient input/output syntax, generic functions. EFL also provides some syntactic sugar to make programs easier to read and write: .TP free form input: multiple statements/line; automatic continuation statement label names (not just numbers), .TP comments: # this is a comment .TP translation of relationals: >, >=, etc., become .GT., .GE., etc. .TP return (expression) returns expression to caller from function .TP define: define name replacement .TP include: include filename .PP .fi The Efl command option .B \-w suppresses warning messages. The option .B \-C causes comments to be copied through to the Fortran output (default); .B \-# prevents comments from being copied through. If a command argument contains an embedded equal sign, that argument is treated as if it had appeared in an .B option statement at the beginning of the program. .I Efl is best used with .IR f77 (1). .SH "SEE ALSO" f77(1), ratfor(1). .br S. I. Feldman, .IR "The Programming Language EFL", Bell Labs Computing Science Technical Report #78. \-w suppresses warning messages. The option .B \-C causes comments to be copied through to the Fortran output (default); .B \-# prevents comments from being copied through. If a command argument contains an embedded equal sign, that argument is treated as if it had appeared in an .B option statement at the beginning of the program. .I Efl is best used with .IR f77 (1). .SH "SEE ALSO" f77(1), ratfor(1). .br S. I. Feldman, .IR "The Programming Language EFL", Bell Labs Cman/man1/egrep.1 664 0 33 31 2512730477 6571 .so /usr/man/man1/grep.1 l Report #78. \-w suppresses warning messages. The option .B \-C causes comments to be copied through to the Fortran output (default); .B \-# prevents comments from being copied through. If a command argument contains an embedded equal sign, that argument is treated as if it had appeared in an .B option statement at the beginning of the program. .I Efl is best used with .IR f77 (1). .SH "SEE/( ,( 5 Ċ /\@,\D"man/man1/enroll.1 664 0 33 32 2512730477 6763 .so /usr/man/man1/xsend.1 Report #78. \-w suppresses warning messages. The option .B \-C causes comments to be copied through to the Fortran output (default); .B \-# prevents comments from being copied through. If a command argument contains an embedded equal sign, that argument is treated as if it had appeared in an .B option statement at the beginning of the program. .I Efl is best used with .IR f77 (1). .SH "SEE/( ,( 50Ċ /\@,\D"man/man1/eqn.1 644 0 33 12344 2512730477 6342 .EQ delim $$ .EN .TH EQN 1 .SH NAME eqn, neqn, checkeq \- typeset mathematics .SH SYNOPSIS .B eqn [ .BR \-d xy ] [ .BR \-p n ] [ .BR \-s n ] [ .BR \-f n ] [ file ] ... .br .B checkeq [ file ] ... .SH DESCRIPTION .I Eqn is a troff(1) preprocessor for typesetting mathematics on a Graphic Systems phototypesetter, .I neqn on terminals. Usage is almost always .PP eqn file ... | troff .br neqn file ... | nroff .PP If no files are specified, these programs reads from the standard input. A line beginning with `.EQ' marks the start of an equation; the end of an equation is marked by a line beginning with `.EN'. Neither of these lines is altered, so they may be defined in macro packages to get centering, numbering, etc. It is also possible to set two characters as `delimiters'; subsequent text between delimiters is also treated as .ul eqn input. Delimiters may be set to characters .I x and .I y with the command-line argument .BI \-d xy or (more commonly) with `delim .IR xy ' between .EQ and .EN. The left and right delimiters may be identical. Delimiters are turned off by `delim off'. All text that is neither between delimiters nor between .EQ and .EN is passed through untouched. .PP The program .I checkeq reports missing or unbalanced delimiters and .EQ/.EN pairs. .PP Tokens within .I eqn are separated by spaces, tabs, newlines, braces, double quotes, tildes or circumflexes. Braces {} are used for grouping; generally speaking, anywhere a single character like .I x could appear, a complicated construction enclosed in braces may be used instead. Tilde ~ represents a full space in the output, circumflex ^ half as much. .PP .vs 13p Subscripts and superscripts are produced with the keywords .B sub and .B sup. Thus .I "x sub i" makes $x sub i$, .I "a sub i sup 2" produces $a sub i sup 2$, and .I "e sup {x sup 2 + y sup 2}" gives $e sup {x sup 2 + y sup 2}$. .PP Fractions are made with .BR over : .I "a over b" yields $a over b$. .PP .B sqrt makes square roots: .I "1 over sqrt {ax sup 2 +bx+c}" results in $1 over sqrt {ax sup 2 +bx+c}$ . .PP The keywords .B from and .B to introduce lower and upper limits on arbitrary things: $lim from {n-> inf} sum from 0 to n x sub i$ is made with .I "lim from {n\-> inf } sum from 0 to n x sub i." .PP Left and right brackets, braces, etc., of the right height are made with .B left and .B right: .I "left [ x sup 2 + y sup 2 over alpha right ] ~=~1" produces $left [ x sup 2 + y sup 2 over alpha right ] ~=~1$. The .B right clause is optional. Legal characters after .B left and .B right are braces, brackets, bars, .B c and .B f for ceiling and floor, and "" for nothing at all (useful for a right-side-only bracket). .PP Vertical piles of things are made with .BR pile , .BR lpile , .BR cpile , and .BR rpile : .I "pile {a above b above c}" produces $pile {a above b above c}$. There can be an arbitrary number of elements in a pile. .B lpile left-justifies, .B pile and .B cpile center, with different vertical spacing, and .B rpile right justifies. .PP Matrices are made with .BR matrix : .I "matrix { lcol { x sub i above y sub 2 } ccol { 1 above 2 } }" produces $matrix { lcol { x sub i above y sub 2 } ccol { 1 above 2 } }$. In addition, there is .B rcol for a right-justified column. .PP .vs 12p Diacritical marks are made with .BR dot , .BR dotdot , .BR hat , .BR tilde , .BR bar , .BR vec , .BR dyad , and .BR under : .I "x dot = f(t) bar" is $x dot = f(t) bar$, .I "y dotdot bar ~=~ n under" is $y dotdot bar ~=~ n under$, and .I "x vec ~=~ y dyad" is $x vec ~=~ y dyad$. .PP Sizes and font can be changed w((ith .B size .I n or .B size .BI \(+- n, .BR roman , .BR italic , .BR bold , and .BR font .I n. Size and fonts can be changed globally in a document by .B gsize .I n and .B gfont .IR n , or by the command-line arguments .BI \-s n and .BI \-f n. .PP Normally subscripts and superscripts are reduced by 3 point sizes from the previous size; this may be changed by the command-line argument .BI \-p n. .PP Successive display arguments can be lined up. Place .B mark before the desired lineup point in the first equation; place .B lineup at the place that is to line up vertically in subsequent equations. .PP Shorthands may be defined or existing keywords redefined with .BI define : .I "define thing % replacement %" defines a new token called .I thing which will be replaced by .I replacement whenever it appears thereafter. The .I % may be any character that does not occur in .I replacement. .PP Keywords like .I sum .EQ ( sum ) .EN .I int .EQ ( int ) .EN .I inf .EQ ( inf ) .EN and shorthands like >= .EQ (>=) .EN \-> .EQ (->), .EN and != .EQ ( != ) .EN are recognized. Greek letters are spelled out in the desired case, as in .I alpha or .I GAMMA. Mathematical words like sin, cos, log are made Roman automatically. .IR Troff (1) four-character escapes like \e(bs (\(bs) can be used anywhere. Strings enclosed in double quotes "..." are passed through untouched; this permits keywords to be entered as text, and can be used to communicate with .I troff when all else fails. .SH "SEE ALSO" .PP troff(1), tbl(1), ms(7), eqnchar(7) .br B. W. Kernighan and L. L. Cherry, .ul Typesetting Mathematics\(emUser's Guide .br J. F. Ossanna, .ul NROFF/TROFF User's Manual .SH BUGS .PP To embolden digits, parens, etc., it is necessary to quote them, as in `bold "12.3"'. apes like \e(bs (\(bs) can be used anywhere. Strings enclosed in double quotes "..." are passed through untouched; this permits keywords to be entered as text, and can be used to communicate with .I troff when all else fails. .SH "SEE ALSO" .PP troff(1), tbl(1), ms(7), eqnchar(7) .bman/man1/error.1 644 0 33 17231 2512730477 6710 .TH ERROR 1 .UC 4 .SH NAME error \- analyze and disperse compiler error messages .SH SYNOPSIS .B error [ .B \-n ] [ .B \-s ] [ .B \-q ] [ .B \-v ] [ .B \-t suffixlist ] [ .B \-I ignorefile ] [ name ] .SH DESCRIPTION .I Error analyzes and optionally disperses the diagnostic error messages produced by a number of compilers and language processors to the source file and line where the errors occurred. It can replace the painful, traditional methods of scribbling abbreviations of errors on paper, and permits error messages and source code to be viewed simultaneously without machinations of multiple windows in a screen editor. .PP .I Error looks at the error messages, either from the specified file \fIname\fR or from the standard input, and attempts to determine which language processor produced each error message, determines the source file and line number to which the error message refers, determines if the error message is to be ignored or not, and inserts the (possibly slightly modified) error message into the source file as a comment on the line preceeding to which the line the error message refers. Error messages which can't be categorized by language processor or content are not inserted into any file, but are sent to the standard output. .I Error touches source files only after all input has been read. By specifying the .B \-q query option, the user is asked to confirm any potentially dangerous (such as touching a file) or verbose action. Otherwise .I error proceeds on its merry business. If the .B \-t touch option and associated suffix list is given, .I error will restrict itself to touch only those files with suffices in the suffix list. Error also can be asked (by specifying .B \-v) to invoke .IR vi (1) on the files in which error messages were inserted; this obviates the need to remember the names of the files with errors. .PP .I Error is intended to be run with its standard input connected via a pipe to the error message source. Some language processors put error messages on their standard error file; others put their messages on the standard output. Hence, both error sources should be piped together into .I error. For example, when using the \fIcsh\fP syntax, .IP make \-s lint |\|& error \-q \-v .LP will analyze all the error messages produced by whatever programs .I make runs when making lint. .PP .I Error knows about the error messages produced by: .I make, .I cc, .I cpp, .I ccom, .I as, .I ld, .I lint, .I pi, .I pc and .I f77. .I Error knows a standard format for error messages produced by the language processors, so is sensitive to changes in these formats. For all languages except .I Pascal, error messages are restricted to be on one line. Some error messages refer to more than one line in more than one files; .I error will duplicate the error message and insert it at all of the places referenced. .PP .I Error will do one of six things with error messages. .TP 10 .I synchronize Some language processors produce short errors describing which file it is processing. .I Error uses these to determine the file name for languages that don't include the file name in each error message. These synchronization messages are consumed entirely by .I error. .TP 10 .I discard Error messages from .I lint that refer to one of the two .I lint libraries, .I /usr/lib/llib-lc and .I /usr/lib/llib-port are discarded, to prevent accidently touching these libraries. Again, these error messages are consumed entirely by .I error. .TP 10 .I nullify Error messages from .I lint can be nullified if they refer to a specific function, which is known to generate diagnostics which are not interesting. Nullified error messages are not inserted into the source file, but are written to the standard output. The names of functions to ignore are taken from either the file named .I .errorrc in the users's home directory, or from the file named by the .B \-I option. If the file does not exist, no error messages are nullified. If the file does exist, there must be one function name per line. .TP 10 .I not file specific Error messages that can't be intuited are grouped together, and written to the standard output before any files are touched. They will not be inserted into any source file. .TP 10 .I file specific Error message that refer to a specific file, but to no specific line, are written to the standard output when that file is touched. .TP 10 .I true errors Error messages that can be intuited are candidates for insertion into the file to which they refer. .PP Only true error messages are candidates for inserting into the file they refer to. Other error messages are consumed entirely by .I error or are written to the standard output. .I Error inserts the error messages into the source file on the line preceeding the line the language processor found in error. Each error message is turned into a one line comment for the language, and is internally flagged with the string ``###'' at the beginning of the error, and ``%%%'' at the end of the error. This makes pattern searching for errors easier with an editor, and allows the messages to be easily removed. In addition, each error message contains the source line number for the line the message refers to. A reasonably formatted source program can be recompiled with the error messages still in it, without having the error messages themselves cause future errors. For poorly formatted source programs in free format languages, such as C or Pascal, it is possible to insert a comment into another comment, which can wreak havoc with a future compilation. To avoid this, format the source program so there are no language statements on the same line as the end of a comment. .PP Options available with .I error are: .TP 5 .B \-n Do .I not touch any files; all error messages are sent to the standard output. .TP 5 .B \-q The user is .I queried whether s/he wants to touch the file. A ``y'' or ``n'' to the question is necessary to continue. Absence of the .B \-q option implies that all referenced files (except those refering to discarded error messages) are to be touched. .TP 5 .B \-v After all files have been touched, overlay the visual editor .I vi with it set up to edit all files touched, and positioned in the first touched file at the first error. If .I vi can't be found, try .I ex or .I ed from standard places. .TP 5 .B \-t Take the following argument as a suffix list. Files whose suffices do not appear in the suffix list are not touched. The suffix list is dot seperated, and ``*'' wildcards work. Thus the suffix list: .IP \& ".c.y.foo*.h" .IP allows .I error to touch files ending with ``.c'', ``.y'', ``.foo*'' and ``.y''. .TP 5 .B \-s Print out .I statistics regarding the error categorization. Not too useful. .PP .I Error catches interrupt and terminate signals, and if in the insertion phase, will orderly terminate what it is doing. .SH AUTHOR Robert Henry .SH FILES .ta 2i ~/.errorrc function names to ignore for \fIlint\fP error messages .br /dev/tty user's teletype .SH BUGS .PP Opens the teletype directly to do user querying. .PP Source files with links make a new copy of the file with only one link to it. .PP Changing a language processor's format of error messages may cause .I error to not understand the error message. .PP .I Error, since it is purely mechanical, will not filter out subsequent errors caused by `floodgating' initiated by one syntactically trivial error. Humans are still much better at discarding these related errors. .PP Pascal error messages belong after the lines affected (error puts them before). The alignment of the `\||\|' marking the point of error is also disturbed by .I error. .PP .I Er((ror was designed for work on CRT's at reasonably high speed. It is less pleasant on slow speed terminals, and has never been used on hardcopy terminals. cal, will not filter out subsequent errors caused by `floodgating' initiated by one syntactically trivial error. Humans are still much better at discarding these related errors. .PP Pascal error messages belong after the lines affected (error puts them before). The alignment of the `\||\|' marking the point of error is also disturbed by .I error. .PP .I Erman/man1/ex.1 644 0 33 6055 2512730477 6155 .TH EX 1 8/26/80 .UC 4 .SH NAME ex, edit \- text editor .SH SYNOPSIS .B ex [ .B \- ] [ .B \-v ] [ .B \-t tag ] [ .B \-r ] [ \fB\+\fIcommand\fR ] [ .B \-l ] name ... .br .B edit [ ex options ] .SH DESCRIPTION .I Ex is the root of a family of editors: .I edit, .I ex and .I vi. .I Ex is a superset of .I ed, with the most notable extension being a display editing facility. Display based editing is the focus of .I vi. .PP If you have not used .I ed, or are a casual user, you will find that the editor .I edit is convenient for you. It avoids some of the complexities of .I ex used mostly by systems programmers and persons very familiar with .I ed. .PP If you have a \s-2CRT\s0 terminal, you may wish to use a display based editor; in this case see .IR vi (1), which is a command which focuses on the display editing portion of .I ex. .SH DOCUMENTATION The document .I "Edit: A tutorial" provides a comprehensive introduction to .I edit assuming no previous knowledge of computers or the \s-2UNIX\s0 system. .PP The .I "Ex Reference Manual \- Version 3.5" is a comprehensive and complete manual for the command mode features of .I ex, but you cannot learn to use the editor by reading it. For an introduction to more advanced forms of editing using the command mode of .I ex see the editing documents written by Brian Kernighan for the editor .I ed; the material in the introductory and advanced documents works also with .I ex. .PP .I "An Introduction to Display Editing with Vi" introduces the display editor .I vi and provides reference material on .I vi. All of these documents can be found in volume 2c of the Programmer's Manual. In addition, the .I "Vi Quick Reference" card summarizes the commands of .I vi in a useful, functional way, and is useful with the .I Introduction. .SH FILES .DT /usr/lib/ex?.?strings error messages .br /usr/lib/ex?.?recover recover command .br /usr/lib/ex?.?preserve preserve command .br /etc/termcap describes capabilities of terminals .br ~/.exrc editor startup file .br /tmp/Ex\fInnnnn\fR editor temporary .br /tmp/Rx\fInnnnn\fR named buffer temporary .br /usr/preserve preservation directory .SH SEE ALSO awk(1), ed(1), grep(1), sed(1), grep(1), vi(1), termcap(5), environ(5) .SH AUTHOR Originally written by William Joy .br Mark Horton has maintained the editor since version 2.7, adding macros, support for many unusual terminals, and other features such as word abbreviation mode. .SH BUGS The .I undo command causes all marks to be lost on lines changed and then restored if the marked lines were changed. .PP .I Undo never clears the buffer modified condition. .PP The .I z command prints a number of logical rather than physical lines. More than a screen full of output may result if long lines are present. .PP File input/output errors don't print a name if the command line \fB`\-'\fR option is used. .PP There is no easy way to do a single scan ignoring case. .PP The editor does not warn if text is placed in named buffers and not used before exiting the editor. .PP Null characters are discarded in input files, and cannot appear in resultant files. ified condition. .PP The .I z command prints a number of logical rather than physical lines. More than a screen full of output may result if long lines are present. .PP File input/output errors don't print a name if the command line \fB`\-'\fR option is used. .PP There is no easy way to do a single scan ignoring case. .PP The editor does not warn if text is placed in named buffers and not used before exiting the editor. .PP Null characters are discarded in input man/man1/expand.1 644 0 33 2144 2512730477 7013 .TH EXPAND 1 .UC 4 .SH NAME expand, unexpand \- expand tabs to spaces, and vice versa .SH SYNOPSIS .B expand [ \-tabstop ] [ \-tab1,tab2,...,tabn ] [ file ... ] .br .B unexpand [ .B \-a ] [ file ... ] .SH DESCRIPTION .I Expand processes the named files or the standard input writing the standard output with tabs changed into blanks. Backspace characters are preserved into the output and decrement the column count for tab calculations. .I Expand is useful for pre-processing character files (before sorting, looking at specific columns, etc.) that contain tabs. .PP If a single .I tabstop argument is given then tabs are set .I tabstop spaces apart instead of the default 8. If multiple tabstops are given then the tabs are set at those specific columns. .PP .I Unexpand puts tabs back into the data from the standard input or the named files and writes the result on the standard output. By default only leading blanks and tabs are reconverted to maximal strings of tabs. If the .B \-a option is given, then tabs are inserted whenever they would compress the resultant file by replacing two or more characters. .SH BUGS n tabs are set .I tabstop spaces apart instead of the default 8. If multiple tabstops are given then the tabs are set at those specific columns. .PP .I Unexpand puts tabs back into the data from the standard input or the named files and writes the result on the standard output. By default only leading blanks and tabs are reconverted to maximal strings of tabs. If the .B \-a option is given, then tabs are insman/man1/explain.1 644 0 33 2107 2512730500 7156 .TH DICTION 1 .SH NAME diction,explain \- print wordy sentences; thesaurus for diction .SH SYNOPSIS .B diction [ .B \-ml ] [ .B \-mm ] [ .B \-n ] [ .B \-f pfile ] file ... .br .B explain .LP .SH DESCRIPTION .I Diction finds all sentences in a document that contain phrases from a data base of bad or wordy diction. Each phrase is bracketed with [ ]. Because .I diction runs .I deroff before looking at the text, formatting header files should be included as part of the input. The default macro package .B \-ms may be overridden with the flag .B \-mm. The flag .B \-ml which causes .B deroff to skip lists, should be used if the document contains many lists of non-sentences. The user may supply her/his own pattern file to be used in addition to the default file with .B \-f .I pfile. If the flag .B \-n is also supplied the default file will be suppressed. .PP .I Explain is an interactive thesaurus for the phrases found by diction. .SH "SEE ALSO" deroff(1) .SH BUGS Use of non-standard formatting macros may cause incorrect sentence breaks. In particular, .I diction doesn't grok .B \-me. .B deroff to skip lists, should be used if the document contains many lists of non-sentences. The user may supply her/his own pattern file to be used in addition to the default file with .B \-f .I pfile. If the flag .B \-n is also supplied the default file will be suppressed. .PP .I Explain is an interactive thesaurus for the phrases found by diction. .SH "SEE ALSO" deroff(1) .SH BUGS Use of non-standard formatting macros may cause incoman/man1/expr.1 644 0 33 3736 2512730500 6505 .TH EXPR 1 .SH NAME expr \- evaluate arguments as an expression .SH SYNOPSIS .B expr arg .B .\|.\|. .SH DESCRIPTION The arguments are taken as an expression. After evaluation, the result is written on the standard output. Each token of the expression is a separate argument. .PP The operators and keywords are listed below. The list is in order of increasing precedence, with equal precedence operators grouped. .TP .I expr | expr yields the first .I expr if it is neither null nor `0', otherwise yields the second .I expr. .TP .I expr & expr yields the first .I expr if neither .I expr is null or `0', otherwise yields `0'. .TP .I expr relop expr where .I relop is one of < <= = != >= >, yields `1' if the indicated comparison is true, `0' if false. The comparison is numeric if both .I expr are integers, otherwise lexicographic. .TP .IR expr " + " expr .br .ns .TP .IR expr " \- " expr .br addition or subtraction of the arguments. .TP .IR expr " * " expr .br .ns .TP .IR expr " / " expr .br .ns .TP .IR expr " % " expr ((.br multiplication, division, or remainder of the arguments. .TP .IR expr " : " expr The matching operator compares the string first argument with the regular expression second argument; regular expression syntax is the same as that of .IR ed (1). The \fB\\(\|.\|.\|.\|\\)\fP pattern symbols can be used to select a portion of the first argument. Otherwise, the matching operator yields the number of characters matched (`0' on failure). .TP .RI ( " expr " ) parentheses for grouping. .PP Examples: .PP To add 1 to the Shell variable .IR a : .IP a=\`expr $a + 1\` .PP To find the filename part (least significant part) of the pathname stored in variable .I a, which may or may not contain `/': .IP expr $a : \'.*/\e(\^.*\e)\' \'\^|\' $a .LP Note the quoted Shell metacharacters. .SH "SEE ALSO" sh(1), test(1) .SH DIAGNOSTICS .I Expr returns the following exit codes: .PP 0 if the expression is neither null nor `0', .br 1 if the expression is null or `0', .br 2 for invalid expressions. uping. .PP Examples: .PP To add 1 man/man1/eyacc.1 644 0 33 1722 2512730501 6605 .TH EYACC 1 .UC 4 .SH NAME eyacc \- modified yacc allowing much improved error recovery .SH SYNOPSIS .B eyacc [ .B \-v ] [ grammar ] .SH DESCRIPTION .I Eyacc is an old version of .IR yacc (1), which produces tables used by the Pascal system and its error recovery routines. .I Eyacc fully enumerates test actions in its parser when an error token is in the look-ahead set. This prevents the parser from making undesirable reductions when an error occurs before the error is detected. The table format is different in .I eyacc than it was in the old .I yacc, as minor changes had been made for efficiency reasons. .SH "SEE ALSO" yacc(1) .br ``Practical LR Error Recovery'' by Susan L. Graham, Charles B. Haley and W. N. Joy; SIGPLAN Conference on Compiler Construction, August 1979. .SH AUTHOR S. C. Johnson .PP .I Eyacc modifications by Charles Haley and William Joy. .SH BUGS .I Pc and its error recovery routines should be made into a library of routines for the new .I yacc. rror is detected. The table format is differenman/man1/f77.1 644 0 33 6621 2527170235 6137 .TH F77 1 4/1/81 .UC 4 .SH NAME f77 \- Fortran 77 compiler .SH SYNOPSIS .B f77 [ option ] ... file ... .SH DESCRIPTION .I F77 is the UNIX Fortran 77 compiler. It accepts several types of arguments: .PP Arguments whose names end with `.f' are taken to be Fortran 77 source programs; they are compiled, and each object program is left on the file in the current directory whose name is that of the source with `.o' substituted for '.f'. .PP Arguments whose names end with `.r' or `.e' are taken to be Ratfor or EFL source programs, respectively; these are first transformed by the appropriate preprocessor, then compiled by f77. .PP In the same way, arguments whose names end with `.c' or `.s' are taken to be C or assembly source programs and are compiled or assembled, producing a `.o' file. .PP The following options have the same meaning as in .IR cc (1). See .IR ld (1) for load-time options. .TP .B \-c Suppress loading and produce `.o' files for each source file. .TP .B \-g Have the compiler produce additional symbol table information for .IR sdb (1). Also pass the .B \-lg flag to .IR ld (1). .TP .BR \-w Suppress all warning messages. If the option is `\-w66', only Fortran 66 compatibility warnings are suppressed. .TP .B \-p Prepare object files for profiling, see .IR prof (1). .TP .SM .TP .B \-O Invoke an object-code optimizer. .TP .SM .B \-S Compile the named programs, and leave the assembler-language output on corresponding files suffixed `.s'. (No `.o' is created.). .TP .BR \-o " output" Name the final output file .I output instead of `a.out'. .PP The following options are peculiar to .IR f77 . .TP .SM .BR \-onetrip Compile DO loops that are performed at least once if reached. (Fortran 77 DO loops are not performed at all if the upper limit is smaller than the lower limit.) .TP .BR \-u Make the default type of a variable `undefined' rather than using the default Fortran rules. .TP .BR \-C Compile code to check that subscripts are within declared array bounds. .TP .BR \-F Apply EFL and Ratfor preprocessor to relevant files, put the result in the file with the suffix changed to `.f', but do not compile. .TP .BR \-m Apply the M4 preprocessor to each `.r' or `.e' file before transforming it with the Ratfor or EFL preprocessor. .TP .TP .BI \-E x Use the string .I x as an EFL option in processing `.e' files. .TP .BI \-R x Use the string .I x as a Ratfor option in processing `.r' files. .PP Other arguments are taken to be either loader option arguments, or F77-compatible object programs, typically produced by an earlier run, or perhaps libraries of F77-compatible routines. These programs, together with the results of any compilations specified, are loaded (in the order given) to produce an executable program with name `a.out'. .SH FILES .nf .ta \w'/usr/lib/libF77.a 'u file.[fresc] input file file.o object file a.out loaded output ./fort[pid].? temporary /usr/lib/f77pass1 compiler /lib/f1 pass 2 /lib/c2 optional optimizer /usr/lib/libF77.a intrinsic function library /usr/lib/libI77.a Fortran I/O library /lib/libc.a C library, see section 3 .fi .SH "SEE ALSO" S. I. Feldman, P. J. Weinberger, .I A Portable Fortran 77 Compiler .br prof(1), cc(1), ld(1), efl(1), ratfor(1) .SH DIAGNOSTICS The diagnostics produced by .I f77 itself are intended to be self-explanatory. Occasional messages may be produced by the loader. .SH BUGS The Fortran 66 subset of the language has been exercised extensively; the newer features have not. imizer /usr/lib/libF77.a intrinsic function library /usr/lib/libI77.a Fortran I/O library /lib/libc.a C libraryman/man1/false.1 664 0 33 31 2512730502 6546 .so /usr/man/man1/true.1 SEE ALSO" S. I. Feldman, P. J. Weinberger, .I A Portable Fortran 77 Compiler .br prof(1), cc(1), ld(1), efl(1), ratfor(1) .SH DIAGNOSTICS The diagnostics produced by .I f77 itself are intended to be self-explanatory. Occasional messages may be produced by the loader. .SH BUGS The Fortran 66 subset of the language has been exercised extensively; the newer features have not. imizer /usr/lib/lib/( ,( 5Ċ /\@,\D"man/man1/fgrep.1 664 0 33 31 2512730502 6557 .so /usr/man/man1/grep.1 SEE ALSO" S. I. Feldman, P. J. Weinberger, .I A Portable Fortran 77 Compiler .br prof(1), cc(1), ld(1), efl(1), ratfor(1) .SH DIAGNOSTICS The diagnostics produced by .I f77 itself are intended to be self-explanatory. Occasional messages may be produced by the loader. .SH BUGS The Fortran 66 subset of the language has been exercised extensively; the newer features have not. imizer /usr/lib/lib/( ,( 5ЎĊ /\@,\D"man/man1/file.1 644 0 33 647 2512730502 6426 .TH FILE 1 .SH NAME file \- determine file type .SH SYNOPSIS .B file file ... .SH DESCRIPTION .I File performs a series of tests on each argument in an attempt to classify it. If an argument appears to be ascii, .I file examines the first 512 bytes and tries to guess its language. .SH BUGS It often makes mistakes. In particular it often suggests that command files are C programs. .PP Does not recognize Pascal or LISP. /( ,( 5Ċ /\@,\D"man/man1/find.1 644 0 33 5657 2512730502 6455 ((.TH FIND 1 .SH NAME find \- find files .SH SYNOPSIS .B find pathname-list expression .SH DESCRIPTION .I Find recursively descends the directory hierarchy for each pathname in the .I pathname-list (i.e., one or more pathnames) seeking files that match a boolean .I expression written in the primaries given below. In the descriptions, the argument .I n is used as a decimal integer where .I +n means more than .I n, .I \-n means less than .I n and .I n means exactly .IR n . .TP 10n .BR \-name " filename" True if the .I filename argument matches the current file name. Normal Shell argument syntax may be used if escaped (watch out for `[', `?' and `*'). .TP .BR \-perm " onum" True if the file permission flags exactly match the octal number .I onum (see .IR chmod (1)). If .I onum is prefixed by a minus sign, more flag bits (017777, see .IR stat (2)) become significant and the flags are compared: .IR (flags&onum)==onum . .TP .BR \-type " c" True if the type of the file is .I c, where .I c is .B "b, c, d" or .B f for block special file, character special file, directory or plain file. .TP .BR \-links " n" True if the file has .I n links. .TP .BR \-user " uname" True if the file belongs to the user .I uname (login name or numeric user ID). .TP .BR \-group " gname" True if the file belongs to group .I gname (group name or numeric group ID). .TP .BR \-size " n" True if the file is .I n blocks long (512 bytes per block). .TP .BR \-inum " n" True if the file has inode number .I n. .TP .BR \-atime " n" True if the file has been accessed in .I n days. .TP .BR \-mtime " n" True if the file has been modified in .I n days. .TP .BR \-exec " command" True if the executed command returns a zero value as exit status. The end of the command must be punctuated by an escaped semicolon. A command argument `{}' is replaced by the current pathname. .TP .BR \-ok " command" Like .B \-exec except that the generated command is written on the standard output, then the standard input is read and the command executed only upon response .BR y . .TP .B \-print Always true; causes the current pathname to be printed. .TP .BR \-newer " file" True if the current file has been modified more recently than the argument .I file. .PP The primaries may be combined using the following operators (in order of decreasing precedence): .TP 4 1) A parenthesized group of primaries and operators (parentheses are special to the Shell and must be escaped). .TP 4 2) The negation of a primary (`!' is the unary .I not operator). .TP 4 3) Concatenation of primaries (the .I and operation is implied by the juxtaposition of two primaries). .TP 4 4) Alternation of primaries .RB "(`" \-o "' is the" .I or operator). .SH EXAMPLE To remove all files named `a.out' or `*.o' that have not been accessed for a week: .IP "" .2i find / \\( \-name a.out \-o \-name '*.o' \\) \-atime +7 \-exec rm {} \\; .SH FILES /etc/passwd .br /etc/group .SH "SEE ALSO" sh(1), test(1), filsys(5) .SH BUGS The syntax is painful. ry (`!' is the unary .I not operator). .TP 4 3) Concatenation of primaries (the .man/man1/finger.1 644 0 33 3452 2512730502 6776 .TH FINGER 1 .UC 4 .SH NAME finger \- user information lookup program .SH SYNOPSIS .B finger [ options ] name ... .SH DESCRIPTION By default .I finger lists the login name, full name, terminal name and write status (as a '*' before the terminal name if write permission is denied), idle time, login time, and office location and phone number (if they are known) for each current UNIX user. (Idle time is minutes if it is a single integer, hours and minutes if a ':' is present, or days and hours if a 'd' is present.) .PP A longer format also exists and is used by .I finger whenever a list of peoples names is given. (Account names as well as first and last names of users are accepted.) This format is multi-line, and includes all the information described above as well as the user's home directory and login shell, any plan which the person has placed in the file .I \&.plan in their home directory, and the project on which they are working from the file .I \&.project also in the home directory. .PP .I Finger options include: .TP .B \-m Match arguments only on user name. .TP .B \-l Force long output format. .TP .B \-p Suppress printing of the .I \&.plan files .TP .B \-s Force short output format. .SH FILES .ta 2i /etc/utmp who file .br /etc/passwd for users names, offices, ... .br /usr/adm/lastlog last login times .br ~/.plan plans .br ~/.project projects .SH "SEE ALSO" w(1), who(1) .SH AUTHOR Earl T. Cohen .SH BUGS Only the first line of the .I .project file is printed. .PP The encoding of the gcos field is UCB dependent \- it knows that an office `197MC' is `197M Cory Hall', and that `529BE' is `529B Evans Hall'. .PP A user information data base is in the works and will radically alter the way the information that .I finger uses is stored. Finger will require extensive modification when this is implemented. times .br ~/.plan plans .br ~/.project projects .SH "SEE ALSO" w(1), who(1) .SH AUTHOR Earl T. Cohen .SH BUGS Only the first line of the .I .project file is printed. .PP The encoding of the gcos field is UCB dependman/man1/fmt.1 644 0 33 1621 2512730502 6306 .TH FMT 1 2/24/79 .UC .SH NAME fmt \- simple text formatter .SH SYNOPSIS .B fmt [ name ... ] .SH DESCRIPTION .I Fmt is a simple text formatter which reads the concatenation of input files (or standard input if none are given) and produces on standard output a version of its input with lines as close to 72 characters long as possible. The spacing at the beginning of the input lines is preserved in the output, as are blank lines and interword spacing. .PP .I Fmt is meant to format mail messages prior to sending, but may also be useful for other simple tasks. For instance, within visual mode of the .I ex editor (e.g. .IR vi ) the command .br !}fmt .br will reformat a paragraph, evening the lines. .SH "SEE ALSO" nroff(1), mail(1) .SH AUTHOR Kurt Shoens .SH BUGS The program was designed to be simple and fast \- for more complex operations, the standard text processors are likely to be more appropriate. the output, as are blank lines and interword spacing. .PP .I Fmt is meant to format mail messages prior to sendman/man1/fold.1 644 0 33 1103 2512730502 6437 .TH FOLD 1 2/24/79 .UC .SH NAME fold \- fold long lines for finite width output device .SH SYNOPSIS .B fold [ \-width ] [ file ... ] .SH DESCRIPTION .I Fold is a filter which will fold the contents of the specified files, or the standard input if no files are specified, breaking the lines to have maximum width .I width. The default for .I width is 80. .I Width should be a multiple of 8 if tabs are present, or the tabs should be expanded using .IR expand (1) before coming to .I fold. .SH SEE\ ALSO expand(1) .SH BUGS If underlining is present it may be messed up by folding. width output device .SH SYNOPSIS .B fold [ \-width ] [ file ... ] .SH DESCRIPTION .I Fold is a filter which will fold the contents of the specified files, or the standard input if no files are specified, breaking the lines to have maximum width .I width. The default for .I width is 80. .I Width should be a multiple of 8 if tabs are present, or the tabs should be expanded using .IR expand (1) before coming to .I fold. .SH SEE\ ALSO expand(1) man/man1/from.1 644 0 33 710 2512730502 6441 .TH FROM 1 .UC 4 .SH NAME from \- who is my mail from? .SH SYNOPSIS .B from [ .B \-s sender ] [ user ] .SH DESCRIPTION .I From prints out the mail header lines in your mailbox file to show you who your mail is from. If .I user is specified, then \fIuser\fP's mailbox is examined instead of your own. If the -s option is given, then only headers for mail sent by .I sender are printed. .SH FILES /usr/spool/mail/* .SH "SEE ALSO" biff(1), mail(1), prmail(1) 0Ċ /\@,\D"man/man1/gets.1 644 0 33 2034 2512730503 6462 ((.TH GETS 1 deprecated .UC 4 .SH NAME gets \- get a string from standard input .SH SYNOPSIS .B gets [ default ] .SH DESCRIPTION .B N.B.: This command was introduced for use in \fI.login\fR scripts when the facilities of the .IR tset (1) command were not totally adequate in setting the terminal type. This is no longer true, and .I gets should no longer be needed. To boot, a construct ``$<'' is available in .IR csh (1) now which has the functionality of .IR gets: .IP \fBset a=$<\fR .br \fBif ($a == '') set a=default .LP replaces .IP \fBset a=`gets default`\fR .LP Users of .IR sh (1) should use its .I read command rather than .I gets. .PP .I Gets can be used with .IR csh (1) to read a string from the standard input. If a .I default is given it is used if just return is typed, or if an error occurs. The resultant string (either the default or as read from the standard input is written to the standard output. If no .I default is given and an error occurs, .I gets exits with exit status 1. .SH "SEE ALSO" csh (1) .SH BUGS .I Gets is obsolete. set a=`gets default`\fR .LP Users of .IR sh (1) should use its .I read command rather than .I gets. .PP .I Gets can be used with .IR csh (1) to read a string from the standard input. If a .I default is given it is used if just return is typed, or if an error occurs. The resultant string (either the default or as read from the standard input is written to the standard output. If no .I default is given and an error occurs, .I gets exits with exit status 1. .SH "SEE ALSO" csh (1) .Sman/man1/graph.1g 644 0 33 4657 2512730503 7005 .TH GRAPH 1G .SH NAME graph \- draw a graph .SH SYNOPSIS .B graph [ option ] ... .SH DESCRIPTION .I Graph with no options takes pairs of numbers from the standard input as abscissas and ordinates of a graph. Successive points are connected by straight lines. The graph is encoded on the standard output for display by the .IR plot (1) filters. .PP If the coordinates of a point are followed by a nonnumeric string, that string is printed as a label beginning on the point. Labels may be surrounded with quotes "...", in which case they may be empty or contain blanks and numbers; labels never contain newlines. .PP The following options are recognized, each as a separate argument. .TP .B \-a Supply abscissas automatically (they are missing from the input); spacing is given by the next argument (default 1). A second optional argument is the starting point for automatic abscissas (default 0 or lower limit given by .BR \-x ). .TP .B \-b Break (disconnect) the graph after each label in the input. .TP .B \-c Character string given by next argument is default label for each point. .TP .B \-g Next argument is grid style, 0 no grid, 1 frame with ticks, 2 full grid (default). .TP .B \-l Next argument is label for graph. .TP .B \-m Next argument is mode (style) of connecting lines: 0 disconnected, 1 connected (default). Some devices give distinguishable line styles for other small integers. .TP .B \-s Save screen, don't erase before plotting. .TP \fB\-x\fR [ \fBl\fR ] If .B l is present, x axis is logarithmic. Next 1 (or 2) arguments are lower (and upper) .IR x "" limits. Third argument, if present, is grid spacing on .I x axis. Normally these quantities are determined automatically. .TP \fB\-y\fR [ \fBl\fR ] Similarly for .IR y . .TP .B \-h Next argument is fraction of space for height. .TP .B \-w Similarly for width. .TP .B \-r Next argument is fraction of space to move right before plotting. .TP .B \-u Similarly to move up before plotting. .TP .B \-t Transpose horizontal and vertical axes. (Option .B \-x now applies to the vertical axis.) .PP A legend indicating grid range is produced with a grid unless the .B \-s option is present. .PP If a specified lower limit exceeds the upper limit, the axis is reversed. .SH "SEE ALSO" spline(1), plot(1) .SH BUGS .I Graph stores all points internally and drops those for which there isn't room. .br Segments that run out of bounds are dropped, not windowed. .br Logarithmic axes may not be reversed. ting. .TP .B \-t Transpose horizontal and vertical axes. (Option .B \-x now applman/man1/grep.1 644 0 33 7477 2512730503 6475 .TH GREP 1 8/11/80 .UC 4 .SH NAME grep, egrep, fgrep \- search a file for a pattern .SH SYNOPSIS .B grep [ option ] ... expression [ file ] ... .LP .B egrep [ option ] ... [ expression ] [ file ] ... .PP .B fgrep [ option ] ... [ strings ] [ file ] .SH DESCRIPTION Commands of the .I grep family search the input .I files (standard input default) for lines matching a pattern. Normally, each line found is copied to the standard output. .I Grep patterns are limited regular expressions in the style of .IR ex (1); it uses a compact nondeterministic algorithm. .I Egrep patterns are full regular expressions; it uses a fast deterministic algorithm that sometimes needs exponential space. .I Fgrep patterns are fixed strings; it is fast and compact. The following options are recognized. .TP .B \-v All lines but those matching are printed. .TP .B \-x (Exact) only lines matched in their entirety are printed .RI ( fgrep only). .TP .B \-c Only a count of matching lines is printed. .TP .B \-l The names of files with matching lines are listed (once) separated by newlines. .TP .B \-n Each line is preceded by its relative line number in the file. .TP .B \-b Each line is preceded by the block number on which it was found. This is sometimes useful in locating disk block numbers by context. .TP .B \-i The case of letters is ignored in making comparisons. (E.g. upper and lower case are considered identical.) (\fIgrep\fR\| and \fIfgrep\fR only) .TP .B \-s Silent mode. Nothing is printed (except error messages). This is useful for checking the error status. .TP .B \-w The expression is searched for as a word (as if surrounded by `\e<' and `\e>', see .IR ex (1).) (\fIgrep\fR\| only) .TP .BI \-e " expression" Same as a simple .I expression argument, but useful when the .I expression begins with a \-. .TP .BI \-f " file" The regular expression .RI ( egrep ) or string list .RI ( fgrep ) is taken from the .I file. .PP In all cases the file name is shown if there is more than one input file. Care should be taken when using the characters $ * [ ^ | ( ) and \\ in the .I expression as they are also meaningful to the Shell. It is safest to enclose the entire .I expression argument in single quotes \' \'. .PP .I Fgrep searches for lines that contain one of the (newline-separated) .I strings. .PP .I Egrep accepts extended regular expressions. In the following description `character' excludes newline: .IP A \e followed by a single character other than newline matches that character. .IP The character ^ ($) matches the beginning (end) of a line. .IP A .B . matches any character. .IP A single character not otherwise endowed with special meaning matches that character. .IP A string enclosed in brackets [\|] matches any single character from the string. Ranges of ASCII character codes may be abbreviated as in `a\-z0\-9'. A ] may occur only as the first character of the string. A literal \- must be placed where it can't be mistaken as a range indicator. .IP A regular expression followed by * (+, ?) matches a sequence of 0 or more (1 or more, 0 or 1) matches of the regular expression. .IP Two regular expressions concatenated match a match of the first followed by a match of the second. .IP Two regular expressions separated by | or newline match either a match for the first or a match for the second. .IP A regular expression enclosed in parentheses matches a match for the regular expression. .LP The order of precedence of operators at the same parenthesis level is [\|] then *+? then concatenation then | and newline. .SH "SEE ALSO" ex(1), sed(1), sh(1) .SH DIAGNOSTICS Exit status is 0 if any matches are found, 1 if none, 2 for syntax errors or inaccessible files. .SH BUGS Ideally there should be only one .I grep, but we don't know a single algorithm that spans a wide enough range of space-time tradeoffs. .PP Lines are limited to 256 characters; longer lines are truncated. he regular expression. .LP The order of precedence of operators at the same parenthesis level is [\|] then *+? then concatenation then | and newline. .SH "SEE ALSO" ex(1), sed(1), sh(1) .SH DIAman/man1/head.1 664 0 33 445 2512730503 6407 .TH HEAD 1 2/24/79 .UC .SH NAME head \- give first few lines .SH SYNOPSIS .B head [ .BR \- count ] [ file ... ] .SH DESCRIPTION This filter gives the first .I count lines of each of the specified files, or of the standard input. If .I count is omitted it defaults to 10. .SH SEE\ ALSO tail(1) nger lines are truncated. he regular expression. .LP The order of precedence of operators at the same parenthesis level is [\|]/( ,( 5pĊ /\@,\D"((man/man1/intro.1 644 0 33 3227 2512730503 6660 .TH INTRO 1 .UC 4 .SH NAME intro \- introduction to commands .SH DESCRIPTION This section describes publicly accessible commands in alphabetic order. Certain distinctions of purpose are made in the headings: .TP (1) Commands of general utility. .TP (1C) Commands for communication with other systems. .TP (1G) Commands used primarily for graphics and computer-aided design. .PP N.B.: Commands related to system maintenance, which appeared in section 1, distinguished by (1M), in previous versions of the manual have been moved to section 8, as they are of little interest to most users. .PP The word `VAX-11' at the foot of a page means that some or all of the description applies only to the implementation for the Digital Equipment Corporation VAX-11. Pages added or changed between the distribution of UNIX/32V and the Berkeley Distribution indicate `3rd Berkeley Distribution' or `4th Berkeley Distribution' at the lower left, as appropriate. .SH SEE ALSO Section (6) for computer games, section (8) for system maintenance commands. .PP .I How to get started, in the Introduction. .SH DIAGNOSTICS Upon termination each command returns two bytes of status, one supplied by the system giving the cause for termination, and (in the case of `normal' termination) one supplied by the program, see .I wait and .IR exit (2). The former byte is 0 for normal termination, the latter is customarily 0 for successful execution, nonzero to indicate troubles such as erroneous parameters, bad or inaccessible data, or other inability to cope with the task at hand. It is called variously `exit code', `exit status' or `return code', and is described only where special conventions are involved. y the system giving the cause for termination, and (in the case of `normal' termination) one supplied by the program, see .I wait and .IR exit (2). The former byte is 0 for normal termination, the latter is customarily 0 for successful execution, nonzero to indicate troubles such as erroneous parameters, bad or inaccessible data, or other inability to cope wiman/man1/iostat.1 644 0 33 2326 2512730503 7027 .TH IOSTAT 1 .UC 4 .SH NAME iostat \- report I/O statistics .SH SYNOPSIS .B iostat [ interval [ count ] ] .SH DESCRIPTION .I Iostat iteratively reports the number of characters read and written to terminals, and, for each disk, the number of seeks and transfers per second, and the milliseconds per average seek. It also gives the percentage of time the system has spent in user mode, in user mode running low priority (niced) processes, in system mode, and idling. .PP To compute this information, for each disk, seeks and data transfer completions and number of words transferred are counted; for terminals collectively, the number of input and output characters are counted. Also, each sixtieth of a second, the state of each disk is examined and a tally is made if the disk is active. From these numbers and given the transfer rates of the devices it is possible to determine average seek times for each device. .PP The optional .I interval argument causes .I iostat to report once each .I interval seconds. The first report is for all time since a reboot and each subsequent report is for the last interval only. .PP The optional .I count argument restricts the number of reports. .SH FILES /dev/kmem /vmunix .SH SEE ALSO vmstat(1) ch disk is examined and a tally is made if the disk is active. From these numbers and given the transfer rates of the devices it is possible to determine average seek times for each device. .PP The optional .I interval argument causes .I iostat to report once each .I interval seconds. The first reman/man1/iul.1 664 0 33 260 2512730503 6272 .pl 1 The ``iul'' command is obsolete. Use the ``-i'' (indicate) option to the ``ul'' command instead. Thus ``nroff -ms foo | iul'' is replaced by ``nroff -ms foo | ul -i''. v/kmem /vmunix .SH SEE ALSO vmstat(1) ch disk is examined and a tally is made if the disk is active. From these numbers and given the transfer rates of the devices it is possible to determine average seek times for each device. .PP The optional/( ,( 5Ċ /\@,\D"man/man1/join.1 644 0 33 3357 2512730503 6470 .TH JOIN 1 .SH NAME join \- relational database operator .SH SYNOPSIS .B join [ options ] file1 file2 .SH DESCRIPTION .I Join forms, on the standard output, a join of the two relations specified by the lines of .I file1 and .IR file2 . If .I file1 is `\-', the standard input is used. .PP .I File1 and .I file2 must be sorted in increasing ASCII collating sequence on the fields on which they are to be joined, normally the first in each line. .PP There is one line in the output for each pair of lines in .I file1 and .I file2 that have identical join fields. The output line normally consists of the common field, then the rest of the line from .IR file1 , then the rest of the line from .IR file2 . .PP Fields are normally separated by blank, tab or newline. In this case, multiple separators count as one, and leading separators are discarded. .PP These options are recognized: .TP .BI \-a n In addition to the normal output, produce a line for each unpairable line in file .IR n , where .I n is 1 or 2. .TP .BI \-e \ s Replace empty output fields by string .IR s . .TP .BI \-j n\ m Join on the .IR m th field of file .IR n . If .I n is missing, use the .IR m th field in each file. .TP .BI \-o \ list Each output line comprises the fields specifed in .IR list , each element of which has the form .IR n . m , where .I n is a file number and .I m is a field number. .PP .TP .BI \-t c Use character .I c as a separator (tab character). Every appearance of .I c in a line is significant. .SH "SEE ALSO" sort(1), comm(1), awk(1) .SH BUGS With default field separation, the collating sequence is that of .IR sort\ \-b ; with .BR \-t , the sequence is that of a plain sort. .PP The conventions of .I join, sort, comm, uniq, look and .IR awk (1) are wildly incongruous. .IR list , each element of which has the form .IR n . m , where .I n is a file number and .I m is a field number. .PP .TP .BI \-t c Use character .I c as a separator (tab character). Every appearance of .I c in a line is significant. .SH "SEE ALSO" sort(1), comm(1), awk(1)man/man1/kill.1 644 0 33 3331 2512730504 6455 .TH KILL 1 .UC 4 .SH NAME kill \- terminate a process with extreme prejudice .SH SYNOPSIS .B kill [ .BR \- sig ] processid ... .br .B kill .B \-l .SH DESCRIPTION .I Kill sends the TERM (terminate, 15) signal to the specified processes. If a signal name or number preceded by `\-' is given as first argument, that signal is sent instead of terminate (see .IR signal (2)). The signal names are listed by `kill \-l', and are as given in .I /usr/include/signal.h, stripped of the common SIG prefix. .PP The terminate signal will kill processes that do not catch the signal; `kill \-9 ...' is a sure kill, as the KILL (9) signal cannot be caught. By convention, if process number 0 is specified, all members in the process group (i.e. processes resulting from the current login) are signaled (but beware: this works only if you use .IR sh (1); not if you use .IR csh (1).) The killed processes must belong to the current user unless he is the super-user. .PP To shut the system down and bring it up single user the super-user may send the initialization process a TERM (terminate) signal by `kill 1'; see .IR init (8). To force .I init to close and open terminals according to what is currently in /etc/ttys use `kill \-HUP 1' (sending a hangup, signal 1). .PP The process number of an asynchronous process started with `&' is reported by the shell. Process numbers can also be found by using .I Kill is a built-in to .IR csh (1); it allows job specifiers ``%...'' so process id's are not as often used as .I kill arguments. See .IR csh (((1) for details. .SH "SEE ALSO" csh(1), ps(1), kill(2), signal(2) .SH BUGS An option to kill process groups ala .IR killpg (2) should be provided; a replacement for ``kill 0'' for .IR csh (1) users should be provided. p, signal 1). .PP The process number of an asynchronous process started with `&' is reported by the shell. Process numbers can also be found by using .I Kill is a built-in to .IR csh (1); it allows job specifiers ``%...'' so process id's are not as often used as .I kill arguments. See .IR csh (man/man1/last.1 644 0 33 3153 2531446134 6473 .TH LAST 1 4/1/81 .UC 4 .SH NAME last \- indicate last logins of users and teletypes .SH SYNOPSIS .B last [ name ... ] [ tty ... ] .SH DESCRIPTION .I Last will look back in the .I wtmp file which records all logins and logouts for information about a user, a teletype or any group of users and teletypes. Arguments specify names of users or teletypes of interest. Names of teletypes may be given fully or abbreviated. For example `last 0' is the same as `last tty0'. If multiple arguments are given, the information which applies to any of the arguments is printed. For example `last root console' would list all of "root's" sessions as well as all sessions on the console terminal. .I Last will print the sessions of the specified users and teletypes, most recent first, indicating the times at which the session began, the duration of the session, and the teletype which the session took place on. If the session is still continuing or was cut short by a reboot, .I last so indicates. .PP The pseudo-user .B reboot logs in at reboots of the system, thus .DT .PP last reboot .PP will give an indication of mean time between reboot. .PP .I Last with no arguments prints a record of all logins and logouts, in reverse order. .PP If .I last is interrupted, it indicates how far the search has progressed in .I wtmp. If interrupted with a quit signal (generated by a control-\e) .I last indicates how far the search has progressed so far, and the search continues. .SH FILES /usr/adm/wtmp login data base .br /usr/adm/shutdownlog which records shutdowns and reasons for same .SH SEE\ ALSO wtmp(5), ac(8), lastcomm(1) .SH AUTHOR Howard Katseff ot. .PP .I Last with no arguments prints a record of all logins and logouts, in reverse order. .PP If .I last is interrupted, it indicates how far the search has progressed in .I wtmp. If interrupted with a quit signal (generated by a control-\e) .I last indicates how far the search has progressed so far, and the search continues. .SH FILES /usr/adm/wtmp login data base .br /usr/adm/shutdownlog which man/man1/lastcomm.1 644 0 33 2005 2512730504 7336 .TH LASTCOMM 1 10/27/79 .UC .SH NAME lastcomm \- show last commands executed in reverse order .SH SYNOPSIS .B lastcomm [ command name ] ... [user name] ... .SH DESCRIPTION .PP .I Lastcomm gives information on previously executed commands. .I Lastcomm with no arguments prints information about all the commands recorded during the current accounting file's lifetime. If called with arguments, only those accounting entries whose command name or user name matches one of the arguments are printed. So, for example, .br lastcomm a.out .br would produce a listing of all the executions of commands named a.out, and .br lastcomm root .br would produce a listing of all the commands executed by user root. .LP .PP For each process entry, the following are printed. .br The name of the user who ran the process. .br The command name under which the process was called. .br The amount of cpu time used by the process (in seconds). .br The time the process exited. .br .LP .SH "AUTHOR" Len Edmondson .SH "SEE ALSO" last (1) .br lastcomm a.out .br would produce a listing of all the executions of commands named a.out, and .br lastcomm root .br would produce a listing of all the commands executed by user root. .LP .PP For each process entry, the following are printed. .br The name of the user who ran the process. .br The command name under which the process was called. .br The amount of cpu time used by the process (in seconds). .br The time the process exited. .br .LP .SH "AUTHOR" Len Edmondson .SH "SEE ALSO" last (1)man/man1/ld.1 644 0 33 14260 2512730504 6144 .TH LD 1 VAX-11 .UC 4 .SH NAME ld \- link editor .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 \-A This option specifies incremental loading, i.e. linking is to be done in a manner so that the resulting object may be read into an already executing program. The next argument is the name of a file whose symbol table will be taken as a basis on which to define additional symbols. Only newly linked material will be entered into the text and data portions of .BR a.out, but the new symbol table will reflect every symbol defined before and after the incremental load. This argument must appear before any other object file in the argument list. The .B \-T option may be used as well, and will be taken to mean that the newly linked segment will commence at the corresponding address (which must be a multiple of 1024). The default value is the old value of _end. .TP .B \-D Take the next argument as a hexadecimal 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 x This option is an abbreviation for the library name .RI `/lib/lib x .a', where .I x is a string. If that does not exist, .I ld tries .RI `/usr/lib/lib x .a' A library is searched when its name is encountered, so the placement of a .B \-l is significant. .TP .B \-M produce a primitive load map, listing the names of the files which will be loaded. .TP .B \-N Do not make the text portion read only or sharable. (Use "magic number" 0407.) .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 1024 byte boundary following the end of the text. .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. .TP .B \-S `Strip' the output by removing all symbols except locals and globals. .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 \-T The next argument is a hexadecimal number which sets the text segment origin. The default origin is 0. .TP .B \-t ("trace") Print the name of each file as it is processed. .TP .B \-u Take the following argume((nt 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 \-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. .TP \fB\-y\fIsym\fR Indicate each file in which .I sym appears, its type and whether the file defines or references it. Many such options may be given to trace many symbols. (It is usually necessary to begin .I sym with an `_', as external C, FORTRAN and Pascal variables begin with underscores.) .TP .B \-z Arrange for the process to be loaded on demand from the resulting executable file (413 format) rather than preloaded. This is the default. Results in a 1024 byte header on the output file followed by a text and data segment each of which have size a multiple of 1024 bytes (being padded out with nulls in the file if necessary). With this format the first few BSS segment symbols may actually appear (from the output of .IR size (2)) to live in the data segment; this to avoid wasting the space resulting from data segment size roundup. .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" as(1), ar(1), cc(1), ranlib(1) .SH BUGS There is no way to force data to be page aligned. in the file if necessary). With this format the first few BSS segment symbols may actually appear (from the output of .IR size (2)) to live in the data segment; this to avoid wasting the space resulting from data segment size roundup. .SH FILES .ta \w'/usr/local/lib/lib*.a\ \ 'u /lib/lib*.a libraries .br /usr/lib/lib*.a more librarieman/man1/learn.1 644 0 33 2705 2512730504 6627 .TH LEARN 1 .SH NAME learn \- computer aided instruction about UNIX .SH SYNOPSIS .B learn [ .BR \- directory ] [ subject [ lesson [ speed ] ] ] .SH DESCRIPTION .I Learn gives CAI courses and practice in the use of UNIX. To get started simply type `learn'. The program will ask questions to find out what you want to do. The questions may be bypassed by naming a .I subject, and the last .I lesson number that .I learn told you in the previous session. You may also include a .I speed number that was given with the lesson number (but without the parentheses that .I learn places around the speed number). If .I lesson is `\-', .I learn prompts for each lesson; this is useful for debugging. .PP The .I subjects presently handled are .sp .nf editor eqn files macros morefiles C .fi .PP The special command `bye' terminates a .I learn session. .PP The .BI \- directory option allows one to exercise a script in a nonstandard place. .SH FILES /usr/learn and all dependent directories and files .SH BUGS The main strength of .I learn, that it asks the student to use the real UNIX, also makes possible baffling mistakes. It is helpful, especially for nonprogrammers, to have a UNIX initiate near at hand during the first sessions. .PP Occasionally lessons are incorrect, sometimes because the local version of a command operates in a non-standard way. Such lessons may be skipped, but it takes some sophistication to recognize the situation. ce. .SH FILES /usr/learn and all dependent directories and man/man1/leave.1 644 0 33 1751 2512730504 6622 .TH LEAVE 1 .UC .SH NAME leave \- remind you when you have to leave .SH SYNOPSIS .B leave [ hhmm ] .SH DESCRIPTION .I Leave waits until the specified time, then reminds you that you have to leave. You are reminded 5 minutes and 1 minute before the actual time, at the time, and every minute thereafter. When you log off, .I leave exits just before it would have printed the next message. .PP The time of day is in the form hhmm where hh is a time in hours (on a 12 or 24 hour clock). All times are converted to a 12 hour clock, and assumed to be in the next 12 hours. .PP If no argument is given, .I leave prompts with "When do you have to leave?". A reply of newline causes .I leave to exit, otherwise the reply is assumed to be a time. This form is suitable for inclusion in a .I .login or .I .profile. .PP Leave ignores interrupts, quits, and terminates. To get rid of it you should either log off or use ``kill \-9'' giving its process id. .SH SEE ALSO calendar(1) .SH AUTHOR Mark Horton .SH BUGS imes are converted to aman/man1/lex.1 644 0 33 2461 2512730504 6315 .TH LEX 1 .SH NAME lex \- generator of lexical analysis programs .SH SYNOPSIS .B lex [ .B \-tvfn ] [ file ] ... .SH DESCRIPTION .I Lex generates programs to be used in simple lexical analyis of text. The input .I files (standard input default) contain regular expressions to be searched for, and actions written in C to be executed when expressions are found. .PP A C source program, `lex.yy.c' is generated, to be compiled thus: .IP cc lex.yy.c \-ll .LP This program, when run, copies unrecognized portions of the input to the output, and executes the associated C action for each regular expression that is recognized. .PP The following .I lex program converts upper case to lower, removes blanks at the end of lines, and replaces multiple blanks by single blanks. .IP "" .nf .ta \w'[A\-Z] 'u %% [A\-Z] putchar(yytext[0]+\'a\'\-\'A\'); [ ]+$ [ ]+ putchar(\' \'); .fi .PP The options have the following meanings. .TP .B \-t Place the result on the standard output instead of in file `lex.yy.c'. .TP .B \-v Print a one-line summary of statistics of the generated analyzer. .TP .B \-n Opposite of .BR \-v ; .B \-n is default. .TP .B \-f `Faster' compilation: don't bother to pack the resulting tables; limited to small programs. .SH "SEE ALSO" yacc(1), sed(1) .br M. E. Lesk and E. Schmidt, .I LEX \- Lexical Analyzer Generator text[0]+\'a\'\-\'A\'); [ ]+$ [ ]+ putchar(\' \'); .fi .PP The options have the following meanings. .TP .B \-t Place the result on the standard output instead of in file `lex.yy.c'. .TP .B \-v Print a one-linman/man1/lint.1 644 0 33 6130 2512730505 6471 .TH LINT 1 .UC 4 .SH NAME lint \- a C program verifier .SH SYNOPSIS .B lint [ .B \-abchnpuvx ] file ... .SH DESCRIPTION .I Lint attempts to detect features of the C program .I files which are likely to be bugs, or non-portable, or wasteful. It also checks the type usage of the program more strictly than the compilers. Among the things which are currently found are unreachable statements, loops not entered at the top, automatic variables declared and not used, and logical expressions whose value is constant. Moreover, the usage of functions is checked to find functions which return values in some places and not in others, functions called with varying numbers of arguments, and functions whose values are not used. .PP By default, it is assumed that all the .I files are to be loaded together; they are checked for mutual compatibility. Function definitions for certain libraries are available to .IR lint ; these libraries are referred to by a conventional name, such as `\-lm', in the style of .IR ld (1). .PP Any number of the options in the following list may be used. The .SM .BR \-D "\*S," .SM .BR \-U "\*S," and .SM .B \-I options of .IR cc (1) are also recognized as separate arguments. .TP .B p Attempt to check portability to the .I IBM and .I GCOS dialects of C. .TP .B h Apply a number of heuristic tests to attempt to intuit bugs, improve style, and reduce waste. .TP .B b Report .I break statements that cannot be reached. (This is not the default because, unfortunately, most .I lex and many .I yacc outputs produce dozens of such comments.) .TP .B v Suppress complaints about unused arguments in functions. .TP .B x Report variables referred to by extern declarations, but never used. .TP .B a Report assignments of long values to int variables. .TP .B c Complain about casts which have questionable portability. .TP .B u Do not complain about functions and variables used and not defined, or defined and not used (this is suitable for running .I lint on a subset of files out of a larger program). .TP .B n Do not check comp((atibility against the standard library. .PP .IR Exit (2) and other functions which do not return are not understood; this causes various lies. .PP Certain conventional comments in the C source will change the behavior of .IR lint : .TP /*NOTREACHED*/ at appropriate points stops comments about unreachable code. .TP .RI /*VARARGS n */ suppresses the usual checking for variable numbers of arguments in the following function declaration. The data types of the first .I n arguments are checked; a missing .I n is taken to be 0. .TP /*NOSTRICT*/ shuts off strict type checking in the next expression. .TP /*ARGSUSED*/ turns on the .B \-v option for the next function. .TP /*LINTLIBRARY*/ at the beginning of a file shuts off complaints about unused functions in this file. .SH FILES .ta \w'/usr/lib/llib-port 'u /usr/lib/lint/lint[12] programs .br /usr/lib/lint/llib-lc declarations for standard functions .br /usr/lib/lint/llib-port declarations for portable functions .SH SEE ALSO cc(1) .br S. C. Johnson, .I Lint, a C Program Checker .SH BUGS There are some things you just .B can't get lint to shut up about. TP /*ARGSUSED*/ turns on the .B \-v option for the next function. .TP /*LINTLIBRARY*/ at the beginning of a file shuts off complaints about unused functions in this file. .SH FILES .ta \w'/usr/lib/llib-port 'u /usr/lib/lint/lint[12] programs .br /usr/lib/lint/llib-lc declarations for standard functions .br /usr/lib/lint/llib-port declarations for portable functions .SH SEE ALSO cc(1) .br S. C. Johnson, .I Lint, a C Progman/man1/lisp.1 664 0 33 3037 2512730505 6477 .TH LISP 1 10/1/80 .UC 4 .SH NAME lisp \- lisp interpreter .SH SYNOPSIS .B lisp .SH DESCRIPTION .I Lisp is a lisp interpreter for a dialect which closely resembles MIT's M\s-2ACLISP\s0. This lisp, known as F\s-2RANZ\s0\ L\s-2ISP\s0, features an I/O facility which allows the user to change the input and output syntax, add macro characters, and maintain compatibility with upper-case only lisp systems; infinite precision integer arithmetic, and an error facility which allows the user to trap system errors in many different ways. Interpreted functions may be mixed with code compiled by .IR liszt (1) and both may be debugged using the ``Joseph Lister'' trace package. A .I lisp containing compiled and interpreted code may be dumped into a file for later use. .LP There are too many functions to list here; one should refer to the manuals listed below. .SH AUTHORS An early version was written by Jeff Levinsky, Mike Curry, and John Breedlove. Keith Sklower wrote and is maintaining the current version, with the assistance of John Foderaro. The garbage collector was implemented by Bill Rowan. .SH FILES .ta 2.4i /usr/lib/lisp/auxfns0.l common functions .br /usr/lib/lisp/auxfns1.l less common functions .br /usr/lib/lisp/trace.l Joseph Lister trace package .br /usr/lib/lisp/toplevel.l top level read-eval-print loop .SH SEE ALSO liszt(1), lxref(1) .br `F\s-2RANZ\s0\ L\s-2ISP\s0 Manual, Version 1' by John K. Foderaro .br M\s-2ACLISP\s0 Manual .SH "BUGS" The error system is in a state of flux and not all error messages are as informative as they could be. ge collector was implemented by Bill Rowan. .SH FILES .ta 2.4i /usr/lib/lisp/auxfns0.l common functions .br /usr/lib/lisp/auxfns1.l less common functions .br /usr/lib/lisp/trace.l Joseph Lister trace package .br /usr/lib/lisp/toplevel.l top level read-eval-print loop .SH SEE ALSO liszt(1), lxref(1) .br `F\s-2RANZ\s0\ L\s-2ISP\s0 Manual, Version 1' by John K. Foderaro .br M\s-2ACLISP\s0 Manual .SH "BUGS" The error system is in a state of flux and not all error messages are asman/man1/liszt.1 664 0 33 5245 2531446136 6705 .TH LISZT 1 10/1/80 .UC 4 .SH NAME liszt \- compile a Franz Lisp program .SH SYNOPSIS .B liszt [ .B \-mpqruwxCQST ] [ .B \-o objfile ] [ name ] .SH DESCRIPTION .I Liszt takes a file whose names ends in `.l' and compiles the F\s-2RANZ\s0 L\s-2ISP\s0 code there leaving an object program on the file whose name is that of the source with `.o' substituted for `.l'. .PP The following options are interpreted by .I liszt. .TP .B \-m Compile a M\s-2ACLISP\s0 file, by changing the readtable to conform to \s-2MACLISP\s0 syntax and including a macro-defined compatibility package. .TP .B \-o Put the object code in the specified file, rather than the default `.o' file. .TP .B \-p places profiling code at the beginning of each non-local function. If the lisp system is also created with profiling in it, this allows function calling frequency to be determined (see .IR prof (1).) .TP .B \-q Only print warning and error messages. Compilation statistics and notes on correct but unusual constructs will not be printed. .TP .B \-r place bootstrap code at the beginning of the object file, which when the object file is executed will cause a lisp system to be invoked and the object file fasl'ed in. .TP .B \-u Compile a UCI-lispfile, by changing the readtable to conform to UCI-Lisp syntax and including a macro-defined compatibility package. .TP .B \-w Suppress warning diagnostics. .TP .B \-x Create a lisp cross reference file with the same name as the source file but with `.x' appended. The program .IR lxref (1) reads this file and creates a human readable cross reference listing. .TP .B \-C put comments in the assembler output of the compiler. Useful for debugging the compiler. .TP .B -Q Print compilation statistics and warn of strange constructs. This is the default. .TP .B \-S Compile the named program and leave the assembler-language output on the corresponding file suffixed `.s'. This will also prevent the assembler language file from being assembled. .TP .B \-T send the assembler output to standard output. .PP If no source file is specified, then the compiler will run interactively. You will find yourself talking to the .IR lisp (1) top-level command interpreter. You can compile a file by using the function .I liszt (an nlambda) with the same arguments as you use on the command line. For example to compile `foo', a M\s-2ACLISP\s0 file, you would use: .IP (liszt \-m foo) .PP Note that .I liszt supplies the ``.l'' extension for you. .SH FILES .ta 2.4i .nf /usr/lib/lisp/machacks.l M\s-2ACLISP\s0 compatibility package /usr/lib/lisp/syscall.l macro definitions of Unix system calls /usr/lib/lisp/ucifnc.l UCI Lisp compatibility package .fi .SH AUTHOR John Foderaro .SH SEE ALSO lisp(1), lxref(1) using the function .I liszt (an nlambda) with the same arguments as you use on the command line. For example to compile `foo', a M\s-2ACLISP\s0 file, you would use: .IP (liszt \-m foo) .PP Note that .I liszt supplies the ``.l'' extension for you. .SH FILES .ta 2.4i .nf /usr/lib/lisp/machacks.l M\s-2ACLISP\s0 compatibility package /usr/lib/lispman/man1/ln.1 644 0 33 2113 2512730505 6131 .TH LN 1 11/16/79 .UC 4 .SH NAME ln \- make links .SH SYNOPSIS .B ln name1 [ name2 ] .br .B ln name ... directory .SH DESCRIPTION A link is a directory entry referring to a file; the same file (together with its size, all its protection information, etc.) may have several links to it. There is no way to distinguish a link to a file from its original directory entry; any changes in the file are effective independently of the name by which the file is known. .PP Given one or two arguments, .I ln creates a link to an existing file .IR name1 . If .I name2 is given, the link has that name; .I name2 may also be a directory in which to place the link; otherwise it is placed in the current directory. If only the directory is specified, the link will be made with its name the same as the last component of .IR name1 . .PP Given more than two arguments, .I ln makes links to all the named files in the named directory. The links made will have the same name as the files being linked to. .PP It is forbidden to link to a directory or to link across file systems. .SH "SEE ALSO" rm(1), cp(1), mv(1) ame; .I name2 may also be a directory in which to place the link; otherwise it is placed in the current directory. If only the directory is specified, the link will be made with its name the same as the last component of .IR name1 . .PP Given more than two arguments, .I ln makes links to all the named files in the named directory. The links made will have the same name as the files being linked to. .PP It is forbidden to link to a diman/man1/lock.1 644 0 33 646 2512730505 6441 ((.TH LOCK 1 2/24/79 .UC .SH NAME lock \- reserve a terminal .SH SYNOPSIS .B lock .SH DESCRIPTION .I Lock requests a password from the user, then prints "LOCKED" on the terminal and refuses to relinquish the terminal until the password is repeated. If the user forgets the password, he has no other recourse but to login elsewhere and kill the lock process. .SH AUTHOR Kurt Shoens .SH BUGS Should timeout after 15 minutes. /( ,( 5pĊ /\@,\D"man/man1/login.1 644 0 33 4424 2512730505 6637 .TH LOGIN 1 4/1/81 .UC 4 .SH NAME login \- sign on .SH SYNOPSIS .B login [ username ] .SH DESCRIPTION The .I login command is used when a user initially signs on, or it may be used at any time to change from one user to another. The latter case is the one summarized above and described here. See \*(lqHow to Get Started\*(rq for how to dial up initially. .PP If .I login is invoked without an argument, it asks for a user name, and, if appropriate, a password. Echoing is turned off (if possible) during the typing of the password, so it will not appear on the written record of the session. .PP After a successful login, accounting files are updated and the user is informed of the existence of mail, and the message of the day is printed, as is the time he last logged in (unless he has a \*(lq.hushlogin\*(rq file in his home directory \- this is mostly used to make life easier for non-human users, such as .IR uucp ). .PP .I Login initializes the user and group IDs and the working directory, then executes a command interpreter (usually .IR sh (1)) according to specifications found in a password file. Argument 0 of the command interpreter is \*(lq\-sh\*(rq, or more generally the name of the command interpreter with a leading dash (\*(lq\-\*(rq) prepended. .PP Login also initializes the environment .IR environ (5) with information specifying home directory, command interpreter, terminal type (if available) and user name. .PP If the file /etc/nologin exists .I login prints its contents on the user's terminal and exits. This is used by .IR shutdown (8) to stop users logging in when the system is about to go down. .PP Login is recognized by .IR sh (1) and .IR csh (1) and executed directly (without forking). .SH FILES .ta \w'/usr/spool/mail/*\ \ 'u /etc/utmp accounting .br /usr/adm/wtmp accounting .br /usr/spool/mail/* mail .br /etc/motd message-of-the-day .br /etc/passwd password file .br /etc/nologin stops logins .br \&.hushlogin makes login quieter .br /etc/securetty lists ttys that root may log in on .SH "SEE ALSO" init(8), newgrp(1), getty(8), mail(1), passwd(1), passwd(5), environ(5), shutdown(8) .SH DIAGNOSTICS \*(lqLogin incorrect,\*(rq if the name or the password is bad. .br \*(lqNo Shell\*(rq, \*(lqcannot open password file\*(rq, \*(lqno directory\*(rq: consult a programming counselor. ing .br /usr/spool/mail/* mail .br /etc/motd message-of-the-day .br /etc/passwd password file .br /etc/nologin stops logins .br \&.hushlogin makes login quieter .br /etc/securetty lists ttys that root may log in on .SH "SEE ALSO" init(8man/man1/look.1 644 0 33 1151 2512730505 6465 .TH LOOK 1 .SH NAME look \- find lines in a sorted list .SH SYNOPSIS .B look [ .B \-df ] string [ file ] .SH DESCRIPTION .I Look consults a sorted .I file and prints all lines that begin with .IR string . It uses binary search. .PP The options .B d and .B f affect comparisons as in .IR sort (1): .TP 4 .B d `Dictionary' order: only letters, digits, tabs and blanks participate in comparisons. .TP 4 .B f Fold. Upper case letters compare equal to lower case. .PP If no .I file is specified, .I /usr/dict/words is assumed with collating sequence .B \-df. .SH FILES /usr/dict/words .SH "SEE ALSO" sort(1), grep(1) .SH DESCRIPTION .I Look consults a sorted .I file and prints all lines that begin with .IR string . It uses binary search. .PP The options .B d and .B f affect comparisons as in .IR sort (1): .TP 4 .B d `Dictionary' order: only letters, digits, tabs and blanks participate in comparisons. .TP 4 .B f Fold. Upper case letters compare equal to lower case. .PP If no .I file is specified, .I /usr/dict/worman/man1/lookbib.1 664 0 33 32 2512730505 7101 .so /usr/man/man1/refer.1 ng sequence .B \-df. .SH FILES /usr/dict/words .SH "SEE ALSO" sort(1), grep(1) .SH DESCRIPTION .I Look consults a sorted .I file and prints all lines that begin with .IR string . It uses binary search. .PP The options .B d and .B f affect comparisons as in .IR sort (1): .TP 4 .B d `Dictionary' order: only letters, digits, tabs and blanks participate in comparisons. .TP 4 .B f Fold. Uppe/( ,( 5Ċ /\@,\D"man/man1/lorder.1 644 0 33 1712 2512730505 7013 .TH LORDER 1 .UC 4 .SH NAME lorder \- find ordering relation for an object library .SH SYNOPSIS .B lorder file ... .SH DESCRIPTION The input is one or more object or library archive (see .IR ar (1)) .I files. The standard output is a list of pairs of object file names, meaning that the first file of the pair refers to external identifiers defined in the second. The output may be processed by .IR tsort (1) to find an ordering of a library suitable for one-pass access by .IR ld (1). .PP This brash one-liner intends to build a new library from existing `.o' files. .IP ar cr library \`\|lorder *.o | tsort\` .PP The need for lorder may be vitiated by use of .IR ranlib (1), which converts an ordered archive into a randomly accessed library. .SH FILES *symref, *symdef .br nm(1), sed(1), sort(1), join(1) .SH "SEE ALSO" tsort(1), ld(1), ar(1), ranlib(1) .SH BUGS The names of object files, in and out of libraries, must end with `.o'; nonsense results otherwise. ne-pass access by .IR ld (1). .PP This brash one-lineman/man1/lpq.1 664 0 33 30 2512730506 6253 .so /usr/man/man1/lpr.1 library from existing `.o' files. .IP ar cr library \`\|lorder *.o | tsort\` .PP The need for lorder may be vitiated by use of .IR ranlib (1), which converts an ordered archive into a randomly accessed library. .SH FILES *symref, *symdef .br nm(1), sed(1), sort(1), join(1) .SH "SEE ALSO" tsort(1), ld(1), ar(1), ranlib(1) .SH BUGS The names of object files, in and out of libraries, must end w/( ,( 5Ċ /\@,\D"man/man1/lpr.1 644 0 33 2322 2512730506 6320 .TH LPR 1 4/1/81 .UC 4 .SH NAME lpr, lprm, lpq, print \- line printer spooler .SH SYNOPSIS .B lpr [ .B \-m ] [ name ... ] .br .B lprm [ id ... ] [ filename ... ] [ owner ... ] .br .B lpq .br .B print file ... .SH DESCRIPTION .I Lpr causes the named files to be queued for printing. If no files are named, the standard input is read. The option .B \-m causes notification via .IR mail (1) to be sent when the job completes. .PP .I Lprm removes an entry from the line printer queue. The id, filename or owner should be that reported by .I lpq. All appropriate files will be removed. The id of each file removed from the queue will be printed. .PP .I Lpq prints the line printer queue. Each entry in the queue is printed showing the owner of the queue entry, an identification number, the size of the entry in characters, and the file which is to be printed. The .I id is useful for removing a specific entry from the printer queue using .IR lprm (1). .PP .I Print .I pr's a copy of each named file on the line printer. It is ((a one line shell script: .PP .DT pr $* | lpr .SH FILES .ta 2i /usr/spool/lpd/* spool area .br /usr/lib/lpd printer daemon .br /usr/lib/lpf filter to handle banners and underlining .SH SEE\ ALSO pr(1) .SH BUGS wing the owner of the queue entry, an identification number, the size of the entry in characters, and the file which is to be printed. The .I id is useful for removing a specific entry from the printer queue using .IR lprm (1). .PP .I Print .I pr's a copy of each named file on the line printer. It is man/man1/lprm.1 664 0 33 30 2512730506 6431 .so /usr/man/man1/lpr.1 .PP .DT pr $* | lpr .SH FILES .ta 2i /usr/spool/lpd/* spool area .br /usr/lib/lpd printer daemon .br /usr/lib/lpf filter to handle banners and underlining .SH SEE\ ALSO pr(1) .SH BUGS wing the owner of the queue entry, an identification number, the size of the entry in characters, and the file which is to be printed. The .I id is useful for removing a specific entry from the printer queue us/( ,( 5Ċ /\@,\D"man/man1/ls.1 664 0 33 13210 2512730506 6161 .TH LS 1 8/26/80 .UC .SH NAME ls \- list contents of directory .SH SYNOPSIS .B ls [ .B \-abcdfgilmqrstux1CFR ] name ... .br .B l [ \fIls\fR options ] name ... .ig .br .B lf [ \fIls\fR options ] name ... .br .B lx [ \fIls\fR options ] name ... .. .SH DESCRIPTION For each directory argument, .I ls lists the contents of the directory; for each file argument, .I ls repeats its name and any other information requested. The output is sorted alphabetically by default. When no argument is given, the current directory is listed. When several arguments are given, the arguments are first sorted appropriately, but file arguments appear before directories and their contents. .PP There are three major listing formats. The format chosen depends on whether the output is going to a teletype, and may also be controlled by option flags. The default format for a teletype is to list the contents of directories in multi-column format, with the entries sorted down the columns. (Files which are not the contents of a directory being interpreted are always sorted across the page rather than down the page in columns. This is because the individual file names may be arbitrarily long.) If the standard output is not a teletype, the default format is to list one entry per line. Finally, there is a stream output format in which files are listed across the page, separated by `,' characters. The .B \-m flag enables this format; when invoked as .I l this format is also used. .PP There are an unbelievable number of options: .TP .B \-l List in long format, giving mode, number of links, owner, size in bytes, and time of last modification for each file. (See below.) If the file is a special file the size field will instead contain the major and minor device numbers. .TP .B \-t Sort by time modified (latest first) instead of by name, as is normal. .TP .B \-a List all entries; usually .RB ` . ' and .RB ` .. ' are suppressed. .TP .B \-s Give size in blocks, including indirect blocks, for each entry. .TP .B \-d If argument is a directory, list only its name, not its contents (mostly used with .B \-l to get status on directory). .TP .B \-r Reverse the order of sort to get reverse alphabetic or oldest first as appropriate. .TP .B \-u Use time of last access instead of last modification for sorting .RB ( \-t ) or printing .RB ( \-l ). .TP .B \-c Use time of file creation for sorting or printing. .TP .B \-i Print i-number in first column of the report for each file listed. .TP .B \-f Force each argument to be interpreted as a directory and list the name found in each slot. This option turns off .B "\-l, \-t, \-s," and .B \-r, and turns on .B \-a; the order is the order in which entries appear in the directory. .TP .B \-g Give group ID instead of owner ID in long listing. .TP .B \-m force stream output format .TP .B \-1 force one entry per line output format, e.g. to a teletype .TP .B \-C force multi-column output, e.g. to a file or a pipe .TP .B \-q force printing of non-graphic characters in file names as the character `?'; this normally happens only if the output device is a teletype .TP .B \-b force printing of non-graphic characters to be in the \eddd notation, in octal. .TP .B \-x force columnar printing to be sorted across rather than down the page; this is the default if the last character of the name the program is invoked with is an `x'. .TP .B \-F cause directories to be marked with a trailing `/' and executable files to be marked with a trailing `*'; this is the default if the last character of the name the program is invoked with is a `f'. .TP .B \-R recursively list subdirectories encountered. .PP The mode printed under the .B \-l option contains 11 characters which are interpreted as follows: the first character is .TP 3 .B d if the entry is a directory; .br .ns .TP 3 .B b if the entry is a block-type special file; .br .ns .TP 3 .B c if the entry is a character-type special file; .br .ns .TP 3 .B m if the entry is a multiplexor-type character special file; .br .ns .TP 3 .B \- if the entry is a plain file. .PP The next 9 characters are interpreted as three sets of three bits each. The first set refers to owner permissions; the next to permissions to others in the same user-group; and the last to all others. Within each set the three characters indicate permission respectively to read, to write, or to execute the file as a program. For a directory, `execute' permission is interpreted to mean permission to search the directory for a specified file. The permissions are indicated as follows: .TP 3 .B r if the file is readable; .br .ns .TP 3 .B w if the file is writable; .br .ns .TP 3 .B x if the file is executable; .br .ns .TP 3 .B \- if the indicated permission is not granted. .PP The group-execute permission character is given as .B s if the file has set-group-ID mode; likewise the user-execute permission character is given as .B s if the file has set-user-ID mode. .PP The last character of the mode (normally `x' or `\-') is .B t if the 1000 bit of the mode is on. See .IR chmod (1) for the meaning of this mode. .PP When the sizes of the files in a directory are listed, a total count of blocks, including indirect blocks is printed. .SH FILES /etc/passwd to get user ID's for `ls \-l'. .br /etc/group to get group ID's for `ls \-g'. .SH BUGS Newline and tab are considered printing characters in file names. .PP The output device is assumed to be 80 columns wide. .PP The option setting based on whether the output is a teletype is undesirable as ``ls\ \-s'' is much different than ``ls\ \-s\ |\ lpr''. On the other hand, not doing this setting would make old shell scripts which used .I ls almost certain losers. .PP Column widths choices are poor for terminals which can tab. ID's for `ls \-l'. .br /etc/group to get group ID's for `ls \-g'. .SH BUGS Newline and tab are considered printing characters in file names. .PP The output device is assumed to be 80 columns wide. .PP The option setting based on whether the output is a teletype is undesirable as ``ls\ \-s'' is much different than ``ls\ \-s\ |\ lpr''. On the other hand, not doing this settiman/man1/lxref.1 664 0 33 1511 2512730507 6645 .TH LXREF 1 9/24/80 .UC 4 .SH NAME lxref \- lisp cross reference program .SH SYNOPSIS .B lxref [ .B \-N ] file ... .SH DESCRIPTION .I Lxref reads cross reference file(s) written by the lisp compiler .I liszt and prints a cross reference listing on the standard output. .I Liszt will create a cross reference file during compilation when it is given the \-x switch. Cross reference files usually end in `.x' and consequently .I lxref will append a `.x' to the file names given if necessary. The one option to .I lxref is a decimal integer, N, which sets the .I ignorelevel. If a function is called more than .I ignorelevel times, the cross reference listing will just print the number of calls instead of listing each one of them. The default for .I ignorelevel is 50. .SH AUTHOR John Foderaro .SH SEE ALSO lisp(1), liszt(1) .SH BUGS ion when it is given the \-x switch. Cross reference files usually end in `.x' and consequently .I lxref will append a `.x' to the file names given if necessary. The one option to .man/man1/m4.1 644 0 33 11350 2512730507 6065 ((.TH M4 1 .SH NAME m4 \- macro processor .SH SYNOPSIS .B m4 [ files ] .SH DESCRIPTION .I M4 is a macro processor intended as a front end for Ratfor, C, and other languages. Each of the argument files is processed in order; if there are no arguments, or if an argument is `\-', the standard input is read. The processed text is written on the standard output. .PP Macro calls have the form .PP name(arg1,arg2, . . . , argn) .br .PP The `(' must immediately follow the name of the macro. If a defined macro name is not followed by a `(', it is deemed to have no arguments. Leading unquoted blanks, tabs, and newlines are ignored while collecting arguments. Potential macro names consist of alphabetic letters, digits, and underscore `\_', where the first character is not a digit. .PP Left and right single quotes (\`\|\') are used to quote strings. The value of a quoted string is the string stripped of the quotes. .PP When a macro name is recognized, its arguments are collected by searching for a matching right parenthesis. Macro evaluation proceeds normally during the collection of the arguments, and any commas or right parentheses which happen to turn up within the value of a nested call are as effective as those in the original input text. After argument collection, the value of the macro is pushed back onto the input stream and rescanned. .PP .I M4 makes available the following built-in macros. They may be redefined, but once this is done the original meaning is lost. Their values are null unless otherwise stated. .TP 10 define The second argument is installed as the value of the macro whose name is the first argument. Each occurrence of $\fIn\fR in the replacement text, where .I n is a digit, is replaced by the .IR n -th argument. Argument 0 is the name of the macro; missing arguments are replaced by the null string. .TP undefine removes the definition of the macro named in its argument. .TP ifdef If the first argument is defined, the value is the second argument, otherwise the third. If there is no third argument, the value is null. The word .I unix is predefined on UNIX versions of .IR m4 . .TP changequote Change quote characters to the first and second arguments. .I Changequote without arguments restores the original values (i.e., \`\|\'). .TP divert .I M4 maintains 10 output streams, numbered 0-9. The final output is the concatenation of the streams in numerical order; initially stream 0 is the current stream. The .I divert macro changes the current output stream to its (digit-string) argument. Output diverted to a stream other than 0 through 9 is discarded. .TP undivert causes immediate output of text from diversions named as arguments, or all diversions if no argument. Text may be undiverted into another diversion. Undiverting discards the diverted text. .TP divnum returns the value of the current output stream. .TP dnl reads and discards characters up to and including the next newline. .TP ifelse has three or more arguments. If the first argument is the same string as the second, then the value is the third argument. If not, and if there are more than four arguments, the process is repeated with arguments 4, 5, 6 and 7. Otherwise, the value is either the fourth string, or, if it is not present, null. .TP incr returns the value of its argument incremented by 1. The value of the argument is calculated by interpreting an initial digit-string as a decimal number. .TP eval evaluates its argument as an arithmetic expression, using 32-bit arithmetic. Operators include +, \-, \(**, /, %, ^ (exponentiation); relationals; parentheses. .TP len returns the number of characters in its argument. .TP index returns the position in its first argument where the second argument begins (zero origin), or \-1 if the second argument does not occur. .TP substr returns a substring of its first argument. The second argument is a zero origin number selecting the first character; the third argument indicates the length of the substring. A missing third argument is taken to be large enough to extend to the end of the first string. .TP translit transliterates the characters in its first argument from the set given by the second argument to the set given by the third. No abbreviations are permitted. .TP include returns the contents of the file named in the argument. .TP sinclude is identical to .I include, except that it says nothing if the file is inaccessible. .TP syscmd executes the UNIX command given in the first argument. No value is returned. .TP maketemp fills in a string of XXXXX in its argument with the current process id. .TP errprint prints its argument on the diagnostic output file. .TP dumpdef prints current names and definitions, for the named items, or for all if no arguments are given. .dt .SH "SEE ALSO" B. W. Kernighan and D. M. Ritchie, .I The M4 Macro Processor is identical to .I include, except that it says nothing if the file is inaccessible. .TP syscmd executes the UNIX command given in the first argument. No value is returned. .TP maketemp fills in a string of XXXXX in its argument with the current process id. .TP errprint prints iman/man1/mail.1 644 0 33 35246 2512730507 6501 .TH MAIL 1 .UC 4 .SH NAME mail \- send and receive mail .SH SYNOPSIS .B mail [ .B \-f [ name ] ] [ people ... ] .SH INTRODUCTION .I Mail is a intelligent mail processing system, which has a command syntax reminiscent of .I ed with lines replaced by messages. .PP .I "Sending mail.\ " To send a message to one or more other people, .I mail can be invoked with arguments which are the names of people to send to. You are then expected to type in your message, followed by an \s-2EOT\s0 (control\-D) at the beginning of a line. The section below, labeled .I "Replying to or originating mail," describes some features of .I mail available to help you compose your letter. .PP .I "Reading mail.\ " In normal usage, .I mail is given no arguments and checks your mail out of the post office, then printing out a one line header of each message there. The current message is initially the first message (numbered 1) and can be printed using the .B print command (which can be abbreviated \fBp\fR). You can move among the messages much as you move between lines in .I ed, with the commands `+' and `\-' moving backwards and forwards, and simple numbers typing the addressed message. .PP .I "Disposing of mail.\ " After examining a message you can .B delete (\fBd\fR) the message or .B reply (\fBr\fR) to it. Deletion causes the .I mail program to forget about the message. This is not irreversible, the message can be .B undeleted (\fBu\fR) by giving its number, or the .I mail session can be aborted by giving the .B exit (\fBx\fR) command. Deleted messages will, however, usually disappear never to be seen again. .PP .I "Specifying messages.\ " Commands such as .B print and .B delete often can be given a list of message numbers as argument to apply to a number of messages at once. Thus ``delete 1 2'' deletes messages 1 and 2, while ``delete 1\-5'' deletes messages 1 through 5. The special name ``*'' addresses all messages, and ``$'' addresses the last message; thus the command .B top which prints the first few lines of a message could be used in ``top *'' to print the first few lines of all messages. .PP .I "Replying to or originating mail.\ " You can use the .B reply command to set up a response to a message, sending it back to the person who it was from. Text you then type in, up to an end-of-file (or a line consisting only of a ``.'') defines the contents of the message. While you are composing a message, .I mail treats lines beginning with the character `~' specially. For instance, typing ``~m'' (alone on a line) will place a copy of the current message into the response right shifting it by a tabstop. Other escapes will set up subject fields, add and delete recipients to the message and allow you to escape to an editor to revise the message or to a shell to run some commands. (These options will be given in the summary below.) .PP .I "Ending a mail processing session.\ " You can end a .I mail session with the .B quit (\fBq\fR) command. Messages which have been examined go to your .I mbox file unless they have been deleted in which case they are discarded. Unexamined messages go back to the post office. The .B \-f option causes .I mail to read in the contents of your .I mbox (or the specified file) for processing; when you .B quit .I mail writes undeleted messages back to this file. .PP .I "Personal and systemwide distribution lists.\ " It is also possible to create a personal distribution lists so that, for instance, you can send mail to ``cohorts'' and have it go to a group of people. Such lists can be defined by placing a line like .IP alias cohorts bill ozalp sklower jkf mark cory:kridle .PP in the file \&.mailrc in your home directory. The current list of such aliases can be displayed by the .B alias .B (a) command in .I mail. System wide distribution lists can be created by editing /usr/lib/aliases, see .IR aliases (5) and .IR delivermail (8); these are kept in a slightly different syntax. In mail you send, personal aliases will be expanded in mail sent to others so that they will be able to \fBreply\fR to the recipients. System wide \fIaliases\fR are not expanded when the mail is sent, but any reply returned to the machine will have the system wide alias expanded as all mail goes through .I delivermail. If you edit /usr/lib/aliases, you must run the program .IR newaliases (1). .PP .I "Network mail (ARPA, UUCP, Berknet)\ " Mail to sites on the ARPA network and sites within Bell laboratories can be sent using ``name@site'' for ARPA-net sites or ``machine!user'' for Bell labs sites, provided appropriate gateways are known to the system. (Be sure(( to escape the ! in Bell sites when giving it on a .I csh command line by preceding it with an \e. Machines on an instance of the Berkeley network are addressed as ``machine:user'', e.g. ``csvax:bill''. When addressed from the arpa-net, ``csvax:bill'' is known as ``csvax.bill@berkeley''. .PP .I Mail has a number of options which can be .B set in the .I \&.mailrc file to alter its behavior; thus ``set askcc'' enables the ``askcc'' feature. (These options are summarized below.) .SH SUMMARY (Adapted from the `Mail Reference Manual') Each command is typed on a line by itself, and may take arguments following the command word. The command need not be typed in its entirety \- the first command which matches the typed prefix is used. For the commands which take message lists as arguments, if no message list is given, then the next message forward which satisfies the command's requirements is used. If there are no messages forward of the current message, the search proceeds backwards, and if there are no good messages at all, .I mail types ``No applicable messages'' and aborts the command. .TP 12n .B \- Goes to the previous message and prints it out. If given a numeric argument .I n , goes to the .I n th previous message and prints it. .TP .B ? Prints a brief summary of commands. .TP .B ! Executes the \s-2UNIX\s0 shell command which follows. .TP .B alias (\fBa\fR) With no arguments, prints out all currently-defined aliases. With one argument, prints out that alias. With more than one argument, adds the users named in the second and later arguments to the alias named in the first argument. .TP .B chdir (\fBc\fR) Changes the user's working directory to that specified, if given. If no directory is given, then changes to the user's login directory. .TP .B delete (\fBd\fR) Takes a list of messages as argument and marks them all as deleted. Deleted messages will not be saved in .I mbox , nor will they be available for most other commands. .TP .B dp (also \fBdt\fR) Deletes the current message and prints the next message. If there is no next message, .I mail says ``at EOF.'' .TP .B edit (\fBe\fR) Takes a list of messages and points the text editor at each one in turn. On return from the editor, the message is read back in. .TP .B exit (\fBex\fR or \fBx\fR) Effects an immediate return to the Shell without modifying the user's system mailbox, his .I mbox file, or his edit file in .B \-f . .TP .B from (\fBf\fR) Takes a list of messages and prints their message headers. .TP .B headers (\fBh\fR) Lists the current range of headers, which is an 18 message group. If a ``+'' argument is given, then the next 18 message group is printed, and if a ``\-'' argument is given, the previous 18 message group is printed. .TP .B help A synonym for ? .TP .B hold (\fBho\fR, also \fBpreserve\fR) Takes a message list and marks each message therein to be saved in the user's system mailbox instead of in .I mbox. Does not override the .B delete command. .TP .B mail (\fBm\fR) Takes as argument login names and distribution group names and sends mail to those people. .TP .B next (\fBn\fR like \fB+\fR or CR) Goes to the next message in sequence and types it. With an argument list, types the next matching message. .TP .B preserve A synonym for .B hold. .TP .B print (\fBp\fR) Takes a message list and types out each message on the user's terminal. .TP .B quit (\fBq\fR) Terminates the session, saving all undeleted, unsaved messages in the user's .I mbox file in his login directory, preserving all messages marked with .B hold or .B preserve or never referenced in his system mailbox, and removing all other messages from his system mailbox. If new mail has arrived during the session, the message ``You have new mail'' is given. If given while editing a mailbox file with the .B \-f flag, then the edit file is rewritten. A return to the Shell is effected, unless the rewrite of edit file fails, in which case the user can escape with the .B exit command. .TP .B reply (\fBr\fR) Takes a message list and sends mail to each message author just like the .B mail command. The default message must not be deleted. .TP .B respond A synonym for .B reply . .TP .B save (\fBs\fR) Takes a message list and a filename and appends each message in turn to the end of the file. The filename in quotes, followed by the line count and character count is echoed on the user's terminal. .TP .B set (\fBse\fR) With no arguments, prints all variable values. Otherwise, sets option. Arguments are of the form ``option=value'' or ``option.'' .TP .B shell (\fBsh\fR) Invokes an interactive version of the shell. .TP .B size Takes a message list and prints out the size in characters of each message. .TP .B top Takes a message list and prints the top few lines of each. The number of lines printed is controlled by the variable .B toplines and defaults to five. .TP .B type (\fBt\fR) A synonym for .B print . .TP .B unalias Takes a list of names defined by .B alias commands and discards the remembered groups of users. The group names no longer have any significance. .TP .B undelete (\fBu\fR) Takes a message list and marks each one as .I not being deleted. .TP .B unset Takes a list of option names and discards their remembered values; the inverse of .B set . .TP .B visual (\fBv\fR) Takes a message list and invokes the display editor on each message. .TP .B write (\fBw\fR) A synonym for .B save . .TP .B xit (\fBx\fR) A synonym for .B exit . .PP Here is a summary of the tilde escapes, which are used when composing messages to perform special functions. Tilde escapes are only recognized at the beginning of lines. The name ``tilde\ escape'' is somewhat of a misnomer since the actual escape character can be set by the option .B escape. .TP 12n \fB~!\fRcommand Execute the indicated shell command, then return to the message. .TP \fB~c\fR name ... Add the given names to the list of carbon copy recipients. .TP .B ~d Read the file ``dead.letter'' from your home directory into the message. .TP .B ~e Invoke the text editor on the message collected so far. After the editing session is finished, you may continue appending text to the message. .TP .B ~h Edit the message header fields by typing each one in turn and allowing the user to append text to the end or modify the field by using the current terminal erase and kill characters. .TP \fB~m\fR messages Read the named messages into the message being sent, shifted right one tab. If no messages are specified, read the current message. .TP .B ~p Print out the message collected so far, prefaced by the message header fields. .TP .B ~q Abort the message being sent, copying the message to ``dead.letter'' in your home directory if .B save is set. .TP \fB~r\fR filename Read the named file into the message. .TP \fB~s\fR string Cause the named string to become the current subject field. .TP \fB~t\fR name ... Add the given names to the direct recipient list. .TP .B ~v Invoke an alternate editor (defined by the VISUAL option) on the message collected so far. Usually, the alternate editor will be a screen editor. After you quit the editor, you may resume appending text to the end of your message. .TP \fB~w\fR filename Write the message onto the named file. .TP \fB~\||\|\fRcommand Pipe the message through the command as a filter. If the command gives no output or terminates abnormally, retain the original text of the message. The command .IR fmt (1) is often used as .I command to rejustify the message. .TP \fB~~\fRstring Insert the string of text in the message prefaced by a single ~. If you have changed the escape character, then you should double that character in order to send it. .PP Options are controlled via the .B set and .B unset commands. Options may be either binary, in which case it is only significant to see whether they are set or not, or string, in which case the actual value is of interest. The binary options include the following: .TP 15n .B append Causes messages saved in .I mbox to be appended to the end rather than prepended. (This is set in /usr/lib/Mail.rc on version 7 systems.) .TP .B ask Causes .I mail to prompt you for the subject of each message you send. If you respond with simply a newline, no subject field will be sent. .TP .B askcc Causes you to be prompted for additional carbon copy recipients at the end of each message. Responding with a newline indicates your satisfaction with the current list. .TP .B autoprint Causes the .B delete command to behave like .B dp \- thus, after deleting a message, the next one will be typed automatically. .TP .B ignore Causes interrupt signals from your terminal to be ignored and echoed as @'s. .TP .B metoo Usually, when a group is expanded that contains the sender, the sender is removed from the expansion. Setting this option causes the sender to be included in the group. .TP .B quiet Suppresses the printing of the version when first invoked. .TP .B save Causes the message collected prior to a interrupt to be saved on the file ``dead.letter'' in your home directory on receipt of two interrupts (or after a \fB~q\fR.) .PP The following options have string values: .TP 15n EDITOR Pathname of the text editor to use in the .B edit command and ~e escape. If not defined, then a default editor is used. .TP SHELL Pathname of the shell to use in the .B ! command and the ~! escape. A default shell is used if this option is not defined. .TP VISUAL Pathname of the text editor to use in the .B visual command and ~v escape. .TP .B escape If defined, the first character of this option gives the character to use in the place of ~ to denote escapes. .TP .B record If defined, gives the pathname of the file used to record all outgoing mail. If not defined, then outgoing mail is not so saved. .TP .B toplines If defined, gives the number of lines of a message to be printed out with the .B top command; normally, the first five lines are printed. .SH FILES .if n .ta 2.5i .if t .ta 1.8i /usr/spool/mail/* post office .br ~/mbox your old mail .br ~/.mailrc file giving initial mail commands .br /tmp/R# temporary for editor escape .br /usr/lib/Mail.help* help files .br /usr/lib/Mail.rc system initialization file .br /bin/mail to do actual mailing .br ((/etc/delivermail postman .SH "SEE ALSO" binmail(1), fmt(1), newaliases(1), aliases(5), delivermail(8) .br `The Mail Reference Manual' .SH AUTHOR Kurt Shoens .SH BUGS mally, the first five lines are printed. .SH FILES .if n .ta 2.5i .if t .ta 1.8i /usr/spool/mail/* post office .br ~/mbox your old mail .br ~/.mailrc file giving initial mail commands .br /tmp/R# temporary for editor escape .br /usr/lib/Mail.help* help files .br /usr/lib/Mail.rc system initialization file .br /bin/mail to do actual mailing .br man/man1/make.1 644 0 33 11756 2512730507 6474 .TH MAKE 1 .UC 4 .SH NAME make \- maintain program groups .SH SYNOPSIS .B make [ .B \-f makefile ] [ option ] ... file ... .SH DESCRIPTION .I Make executes commands in .I makefile to update one or more target .IR names . .I Name is typically a program. If no .B \-f option is present, `makefile' and `Makefile' are tried in order. If .I makefile is `\-', the standard input is taken. More than one .B \-f option may appear .PP .I Make updates a target if it depends on prerequisite files that have been modified since the target was last modified, or if the target does not exist. .PP .I Makefile contains a sequence of entries that specify dependencies. The first line of an entry is a blank-separated list of targets, then a colon, then a list of prerequisite files. Text following a semicolon, and all following lines that begin with a tab, are shell commands to be executed to update the target. If a name appears on the left of more than one `colon' line, then it depends on all of the names on the right of the colon on those lines, but only one command sequence may be specified for it. If a name appears on a line with a double colon .B "::" then the command sequence following that line is performed only if the name is out of date with respect to the names to the right of the double colon, and is not affected by other double colon lines on which that name may appear. .PP Two special forms of a name are recognized. A name like .I a(b) means the file named .I b stored in the archive named .I a. A name like .I a((b)) means the file stored in archive .I a containing the entry point .I b. .PP Sharp and newline surround comments. .PP The following makefile says that `pgm' depends on two files `a.o' and `b.o', and that they in turn depend on `.c' files and a common file `incl'. .RS .HP .PD 0 .nf pgm: a.o b.o cc a.o b.o \-lm \-o pgm .HP a.o: incl a.c cc \-c a.c .HP b.o: incl b.c cc \-c b.c .fi .RE .PD .PP .I Makefile entries of the form .PP .IP string1 = string2 .PP are macro definitions. Subsequent appearances of .I $(string1) are replaced by .IR string2 . If .I string1 is a single character, the parentheses are optional. .PP .I Make infers prerequisites for files for which .I makefile gives no construction commands. For example, a `.c' file may be inferred as prerequisite for a `.o' file and be compiled to produce the `.o' file. Thus the preceding example can be done more briefly: .RS .HP .PD 0 .nf pgm: a.o b.o cc a.o b.o \-lm \-o pgm .HP a.o b.o: incl .fi .RE .PD .PP Prerequisites are inferred according to selected suffixes listed as the `prerequisites' for the special name `.SUFFIXES'; multiple lists accumulate; an empty list clears what came before. Order is significant; the first possible name for which both a file and a rule as described in the next paragraph exist is inferred. The default list is .IP \&.SUFFIXES: .out .o .c .e .r .f .y .l .s .p .PP The rule to create a file with suffix .I s2 that depends on a similarly named file with suffix .I s1 is specified as an entry for the `target' .IR s1s2 . In such an entry, the special macro $* stands for the target name with suffix deleted, $@ for the full target name, $< for the complete list of prerequisites, and $? for the list of prerequisites that are out of date. For example, a rule for making optimized `.o' files from `.c' files is .IP \&.c.o: ; cc \-c \-O \-o $@ $*.c .PP Certain macros are used by the default inference rules to communicate optional arguments to any resulting compilations. In particular, `CFLAGS' is used for .IR cc (1) options, `FFLAGS' for .IR f77 (1) options, `PFLAGS' for .IR pc (1) options, and `LFLAGS' and `YFLAGS' for .I lex and .IR yacc (1) options. .PP Command lines are executed one at a time, each by its own shell. A line is printed when it is executed unless the special target `.SILENT' is in .I makefile, or the first character of the command is `@'. .PP Commands returning nonzero status (see .IR intro (1)) cause .I make to terminate unless the special target `.IGNORE' is in .I makefile or the command begins with . .PP Interrupt and quit cause the target to be deleted unless the target depends on the special name `.PRECIOUS'. .PP Other options: .TP .B \-i Equivalent to the special entry `.IGNORE:'. .TP .B \-k When a command returns nonzero status, abandon work on the current entry, but continue on branches that do not depend on the current entry. .TP .B \-n Trace and print, but do not execute the commands needed to update the targets. .TP .B \-t Touch, i.e. update the modified date of targets, without executing any commands. .TP .B \-r Equivalent to an initial special entry `.SUFFIXES:' with no list. .TP .B \-s Equivalent to the special entry `.SILENT:'. .SH FILES makefile, Makefile .br .SH "SEE ALSO" sh(1), touch(1), f77(1), pc(1) .br S. I. Feldman .I Make \- A Program for Maintaining Computer Programs .SH BUGS Some commands return nonzero status inappropriately. Use .B \-i to overcome the difficulty. .br Commands that are directly executed by the shell, notably .IR cd (1), are ineffectual across newlines in .I make. ands. .TP .B \-r Eman/man1/man.1 644 0 33 4271 2512730507 6304 .TH MAN 1 .UC 4 .SH NAME man \- find manual information by keywords; print out the manual .SH SYNOPSIS .br .B man .B \-k keyword ... .br .B man .B \-f file ... .br .B man [ .B \- ] [ .B \-t ] [ section ] title ... .SH DESCRIPTION .I Man is a program which gives information from the programmers manual. It can be asked form one line descriptions of commands specified by name, or for all commands whose description contains any of a set of keywords. It can also provide on-line access to the sections of the printed manual. .PP When given the option .B \-k and a set of keywords, .I man prints out a one line synopsis of each manual sections whose listing in the table of contents contains that keyword. .PP When given the option .B \-f and a list of file names, \fIman\fR attempts to locate manual sections related to those files, printing out the table of contents lines for those sections. .PP When neither .B \-k nor .B \-f is specified, .I man formats a specified set of manual pages. If a section specifier is given .I man looks in the that section of the manual for the given .I titles. .I Section is an arabic section number, i.e. 3, which may be followed by a single letter classifier, i.e. 1g indicating a graphics program in section 1. If .I section is omitted, .I man searches all sections of the manual, giving preference to commands over subroutines in system libraries, and printing the first section it finds, if any. .PP If the standard output is a teletype, or if the flag .B \- is given, then .I man pipes its output through .IR cat (1) with the option .B \-s to crush out useless blank lines, .IR ul (1) to create proper underlines for different terminals, and through .IR more (1) to stop after each page on the screen. Hit a space to continue, a control-D to scroll 11 more lines when the output stops. .PP The .B \-t flag causes .I man to arrange for the specified section to be .I troff'ed to a suitable raster output device; see .IR vtroff (1). .SH FILES /usr/man/man?/* .br /usr/man/cat?/* .SH SEE\ ALSO more(1), ul(1), whereis(1), catman(8) .SH BUGS The manual is supposed to be reproducible either on the phototypesetter or on a typewriter. However, on a typewriter some information is necessarily lost. page on the screen. Hit a space to continue, a control-D to scroll 11 more lines when the output stops. .PP The .B \-t flag causes .I man to arrange for the specified section to be .I troff'ed to a suitable raster output device; see .IR vtroff (1). .SH FILES /usr/man/man?/* .br /usr/man/cat?/* .SH SEE\ ALSO more(1), ul(1), wman/man1/mesg.1 644 0 33 740 2512730510 6433 .TH MESG 1 .SH NAME mesg \- permit or deny messages .SH SYNOPSIS .B mesg [ .B n ] [ .B y ] .SH DESCRIPTION .I Mesg with argument .B n forbids messages via .IR write (1) by revoking non-user write permission on the user's terminal. .I Mesg with argument .B y reinstates permission. All by itself, .I mesg reports the current state without changing it. .SH FILES /dev/tty* .SH "SEE ALSO" write(1) .SH DIAGNOSTICS Exit status is 0 if messages are receivable, 1 if not, 2 on error. \@,\D"((man/man1/mkdir.1 644 0 33 764 2512730510 6614 .TH MKDIR 1 .SH NAME mkdir \- make a directory .SH SYNOPSIS .B mkdir dirname ... .SH DESCRIPTION .I Mkdir creates specified directories in mode 777. Standard entries, .RB ` . ', for the directory itself, and .lg 0 .BR ` .. ' .lg 1 for its parent, are made automatically. .PP .I Mkdir requires write permission in the parent directory. .SH "SEE ALSO" rm(1) .SH DIAGNOSTICS .I Mkdir returns exit code 0 if all directories were successfully made. Otherwise it prints a diagnostic and returns nonzero. \D"man/man1/mkstr.1 644 0 33 4254 2512730510 6664 .TH MKSTR 1 2/24/79 .UC .SH NAME mkstr \- create an error message file by massaging C source .SH SYNOPSIS .B mkstr [ .B \- ] messagefile prefix file ... .SH DESCRIPTION .I Mkstr is used to create files of error messages. Its use can make programs with large numbers of error diagnostics much smaller, and reduce system overhead in running the program as the error messages do not have to be constantly swapped in and out. .PP .I Mkstr will process each of the specified .I files, placing a massaged version of the input file in a file whose name consists of the specified .I prefix and the original name. A typical usage of .I mkstr would be .DT .PP mkstr pistrings xx *.c .PP This command would cause all the error messages from the C source files in the current directory to be placed in the file .I pistrings and processed copies of the source for these files to be placed in files whose names are prefixed with .I xx. .PP To process the error messages in the source to the message file .I mkstr keys on the string \%`error("' in the input stream. Each time it occurs, the C string starting at the `"' is placed in the message file followed by a null character and a new-line character; the null character terminates the message so it can be easily used when retrieved, the new-line character makes it possible to sensibly .I cat the error message file to see its contents. The massaged copy of the input file then contains a .I lseek pointer into the file which can be used to retrieve the message, i.e.: .IP .DT .nf \fBchar\fR efilname[] = "/usr/lib/pi_strings"; \fBint\fR efil = -1; .sp error(a1, a2, a3, a4) { \fBchar\fR buf[256]; \fBif\fR (efil < 0) { efil = open(efilname, 0); \fBif\fR (efil < 0) { oops: perror(efilname); exit(1); } } \fBif\fR (lseek(efil, (long) a1, 0) |\|| read(efil, buf, 256) <= 0) \fBgoto\fR oops; printf(buf, a2, a3, a4); } .fi .PP The optional .B \- causes the error messages to be placed at the end of the specified message file for recompiling part of a large .IR mkstr \|ed program. .SH SEE\ ALSO lseek(2), xstr(1) .SH AUTHORS William Joy and Charles Haley ...SH BUGS ...All the arguments except the name of the file to be processed could be made unnecessary. il < 0) { oops: perror(efilname); exit(1); } } \fBif\fR (lseek(efil, (long) a1, 0) |\|| read(efil, buf, 256) <= 0) \fBgoto\fR oops; printf(buf, a2, a3, a4); } .fi .PP The optional .B \- causes the error messages to be placed at the end of the specified message file for recompiling part of a large .IR mkstr \|ed program. .SH Sman/man1/more.1 644 0 33 17675 2527170241 6526 .TH MORE 1 04/27/81 .UC 4 .SH NAME more, page \- file perusal filter for crt viewing .SH SYNOPSIS .B more [ .B \-cdflsu ] [ .B \-\fIn\fP ] [ .B +\fIlinenumber\fP ] [ .B +/\fIpattern\fP ] [ name ... ] .LP .B page .I "more options" .SH DESCRIPTION .I More is a filter which allows examination of a continuous text one screenful at a time on a soft-copy terminal. It normally pauses after each screenful, printing --More-- at the bottom of the screen. If the user then types a carriage return, one more line is displayed. If the user hits a space, another screenful is displayed. Other possibilites are enumerated later. .PP The command line options are: .TP .I \-n An integer which is the size (in lines) of the window which .I more will use instead of the default. .TP .B \-c .I More will draw each page by beginning at the top of the screen and erasing each line just before it draws on it. This avoids scrolling the screen, making it easier to read while .I more is writing. This option will be ignored if the terminal does not have the ability to clear to the end of a line. .TP .B \-d .I More will prompt the user with the message "Hit space to continue, Rubout to abort" at the end of each screenful. This is useful if .I more is being used as a filter in some setting, such as a class, where many users may be unsophisticated. .TP .B \-f This causes .I more to count logical, rather than screen lines. That is, long lines are not folded. This option is recommended if .I nroff output is being piped through .I ul, since the latter may generate escape sequences. These escape sequences contain characters which would ordinarily occupy screen postions, but which do not print when they are sent to the terminal as part of an escape sequence. Thus .I more may think that lines are longer than they actually are, and fold lines erroneously. .TP .B \-l Do not treat ^L (form feed) specially. If this option is not given, .I more will pause after any line that contains a ^L, as if the end of a screenful had been reached. Also, if a file begins with a form feed, the screen will be cleared before the file is printed. .TP .B \-s Squeeze multiple blank lines from the output, producing only one blank line. Especially helpful when viewing .I nroff output, this option maximizes the useful information present on the screen. .TP .B \-u Normally, .I more will handle underlining such as produced by .I nroff in a manner appropriate to the particular terminal: if the terminal can perform underlining or has a stand-out mode, .I more will output appropriate escape sequences to enable underlining or stand-out mode for underlined information in the source file. The .I \-u option suppresses this processing. .TP .B +\fIlinenumber\fP Start up at \fIlinenumber\fP. .TP .B +/\fIpattern\fP Start up two lines before the line containing the regular expression \fIpattern\fP. .PP If the program is invoked as .I page, then the screen is cleared before each screenful is printed (but only if a full screenful is being printed), and .I k \- 1 rather than .I k \- 2 lines are printed in each screenful, where .I k is the number of lines the terminal can display. .PP .I More looks in the file .I /etc/termcap to determine terminal characteristics, and to determine the default window size. On a terminal capable of displaying 24 lines, the default window size is 22 lines. .PP .I More looks in the environment variable .I MORE to pre-set any flags desired. For example, if you prefer to view files using the .I \-c mode of operation, the .I csh command .I "setenv MORE -c" or the .I sh command sequence .I "MORE='-c' ; export MORE" would cause all invocations of .I more , including invocations by programs such as .I man and .I msgs , to use this mode. Normally, the user will place the command sequence which sets up the .I MORE environment variable in the .I .cshrc or .I .profile file. .PP If .I more is reading from a file, rather than a pipe, then a percentage is displayed along with the --More-- prompt. This gives the fraction of the file (in characters, not lines) that has been read so far. .PP Other sequences which may be typed when .I more pauses, and their effects, are as follows (\fIi\fP is an optional integer argument, defaulting to 1) : .PP .IP \fIi\|\fP display .I i more lines, (or another screenful if no argument is given) .PP .IP ^D display 11 more lines (a ``scroll''). If .I i is given, then the scroll size is set to \fIi\|\fP. .PP .IP d same as ^D (control-D) .PP .IP \fIi\|\fPz same as typing a space except that \fIi\|\fP, if present, becomes the new window size. .PP .IP \fIi\|\fPs skip \fIi\|\fP lines and print a screenful of lines .PP .IP \fIi\|\fPf skip \fIi\fP screenfuls and print a screenful of lines .PP .IP "q or Q" Exit from .I more. .PP .IP = Display the current line number. .PP .IP v Start up the editor .I vi at the current line. .PP .IP h Help command; give a description of all the .I more commands. .PP .IP \fIi\|\fP/expr search for the \fIi\|\fP-th occurrence of the regular expression \fIexpr.\fP If there are less than \fIi\fP occurrences of \fIexpr\|\fP, and the input is a file (rather than a pipe), then the position in the file remains unchanged. Otherwise, a screenful is displayed, starting two lines before the place where the expression was found. The user's erase and kill characters may be used to edit the regular expression. Erasing back past the first column cancels the search command. .PP .IP \fIi\|\fPn search for the \fIi\|\fP-th occurrence of the last regular expression entered. .PP .IP ' (single quote) Go to the point from which the last search started.(( If no search has been performed in the current file, this command goes back to the beginning of the file. .PP .IP !command invoke a shell with \fIcommand\|\fP. The characters `%' and `!' in "command" are replaced with the current file name and the previous shell command respectively. If there is no current file name, `%' is not expanded. The sequences "\\%" and "\\!" are replaced by "%" and "!" respectively. .PP .IP \fIi\|\fP:n skip to the \fIi\|\fP-th next file given in the command line (skips to last file if n doesn't make sense) .PP .IP \fIi\|\fP:p skip to the \fIi\|\fP-th previous file given in the command line. If this command is given in the middle of printing out a file, then .I more goes back to the beginning of the file. If \fIi\fP doesn't make sense, .I more skips back to the first file. If .I more is not reading from a file, the bell is rung and nothing else happens. .PP .IP :f display the current file name and line number. .PP .IP ":q or :Q" exit from .I more (same as q or Q). .PP .IP . (dot) repeat the previous command. .PP The commands take effect immediately, i.e., it is not necessary to type a carriage return. Up to the time when the command character itself is given, the user may hit the line kill character to cancel the numerical argument being formed. In addition, the user may hit the erase character to redisplay the --More--(xx%) message. .PP At any time when output is being sent to the terminal, the user can hit the quit key (normally control\-\\). .I More will stop sending output, and will display the usual --More-- prompt. The user may then enter one of the above commands in the normal manner. Unfortunately, some output is lost when this is done, due to the fact that any characters waiting in the terminal's output queue are flushed when the quit signal occurs. .PP The terminal is set to .I noecho mode by this program so that the output can be continuous. What you type will thus not show on your terminal, except for the / and ! commands. .PP If the standard output is not a teletype, then .I more acts just like .I cat, except that a header is printed before each file (if there is more than one). .PP .DT A sample usage of .I more in previewing .I nroff output would be .PP nroff \-ms +2 doc.n | more -s .SH AUTHOR Eric Shienbrood, minor revisions by John Foderaro and Geoffrey Peck .SH FILES .DT /etc/termcap Terminal data base .br /usr/lib/more.help Help file .SH "SEE ALSO" csh(1), man(1), msgs(1), script(1), sh(1), environ(5) and ! commands. .PP If the standard output is not a teletype, then man/man1/msgs.1 664 0 33 6421 2512730511 6476 .TH MSGS 1 .UC 4 .SH NAME msgs \- system messages and junk mail program .SH SYNOPSIS .B msgs [ .B \-fhlpq ] [ number ] [ \-number ] .SH DESCRIPTION .I Msgs is used to read system messages. These messages are sent by mailing to the login `msgs' and should be short pieces of information which are suitable to be read once by most users of the system. .PP .I Msgs is normally invoked each time you login, by placing it in the file .I \&.login .I (\&.profile if you use .IR /bin/sh ). It will then prompt you with the source and subject of each new message. If there is no subject line, the first few non-blank lines of the message will be displayed. If there is more to the message, you will be told how long it is and asked whether you wish to see the rest of the message. The possible responses are: .TP 7 .B y type the rest of the message .TP 7 RETURN synonym for y. .TP 7 .B n skip this message and go on to the next message. .TP 7 .B \- redisplay the last message. .TP 7 .B q drops you out of .I msgs; the next time you run the program it will pick up where you left off. .TP 7 .B s append the current message to the file ``Messages'' in the current directory; `s\-' will save the previously displayed message. A `s' or `s\-' may be followed by a space and a filename to receive the message replacing the default ``Messages''. .TP 7 .B m or `m\-' causes a copy of the specified message to be placed in a temporary mailbox and .IR mail (1) to be invoked on that mailbox. Both `m' and `s' accept a numeric argument in place of the `\-'. .PP .I Msgs keeps track of the next message you will see by a number in the file .I \&.msgsrc in your home directory. In the directory .I /usr/msgs it keeps a set of files whose names are the (sequential) numbers of the messages they represent. The file .I /usr/msgs/bounds shows the low and high number of the messages in the directory so that .I msgs can quickly determine if there are no messages for you. If the contents of .I bounds is incorrect it can be fixed by removing it; .I msgs will make a new .I bounds file the next time it is run. .PP Options to msgs include: .TP 7 .B \-f which causes it not to say ``No new messages.''. This is useful in your .I \&.login file since this is often the case here. .TP 7 .B \-q Queries whether there are messages, printing ``There are new messages.'' if there are. The command ``msgs \-q'' is often used in login scripts. .TP 7 .B \-h causes .I msgs to print the first part of messages only. .TP 7 .B \-l option causes only locally originated messages to be reported. .TP 7 \fInum\fR A message number can be given on the command line, causing .I msgs to start at the specified message rather than at the next message indicated by your .I \&.msgsrc file. Thus .IP "" 7 msgs \-h 1 .IP "" 7 prints the first part of all messages. .TP 7 .I "\-number" will cause .I msgs to start .I number messages back from the one indicated by your .I \&.msgsrc file, useful for reviews of recent messages. .TP 7 .B \-p causes long messages to be piped through .IR more (1). .PP Within .I msgs you can also go to any specific message by typing its number when .I msgs requests input as to what to do. .SH FILES .ta 2i /usr/msgs/* database .br ~/.msgsrc number of next message to be presented .SH AUTHORS William Joy .br David Wasley .SH SEE ALSO mail(1), more(1) .SH BUGS ber" will cause .I msgs to start .I number messages back from the one indicated by your .I \&.msgsrc file, useful for reviews of recent messages. .TP 7 .B \-p causes long messages to be piped through .IR more (1). .PP Within .I msgs you cman/man1/mt.1 664 0 33 1337 2574152176 6163 .TH MT 1 5/11/81 .UC 4 .SH NAME mt \- magnetic tape manipulating program .SH SYNOPSIS .B mt [ .B \-t .I tapename ] .I command [ .I count ] .SH DESCRIPTION .PP .I Mt is used to give commands to the tape drive. If a tape name is not specified, /dev/rmt12 is used. If a count is not specified, 1 is assumed. .PP Here are the commands: .in +.5i .BR eof " write" .I count end-of-file marks .br .BR fsf " space forward" .I count files .br .BR fsr " space forward" .I count records .br .BR bsf " space backward" .I count files .br .BR bsr " space backward" .I count records .br .BR rew " rewind tape" .br .BR offl " rewind tape and go offline: .in -.5i .SH FILES .DT /dev/rmt* Raw magnetic tape interface .SH SEE ALSO mt(4), dd(1) .SH BUGS e is not specified, /dev/rmt12 is used. If a count is not specified, 1 is assumed. .PP Here are the commands: .in +.5i .BR eof " write" .I count end-of-file marks .br .BR fsf " space forward" .I count files .br .BR fsr " space forward" .I count records .br .BR bsf " space backward" .I coman/man1/mv.1 644 0 33 2767 2512730511 6156 .TH MV 1 4/1/81 .UC 4 .SH NAME mv \- move or rename files .SH SYNOPSIS .B mv [ .B \-i ] [ .B \-f ] [ .B \- ] file1 file2 .PP .B mv [ .B \-i ] [ .B \-f ] [ .B \- ] file ... directory .SH DESCRIPTION .I Mv moves (changes the name of) .I file1 to .IR file2 . .PP If .I file2 already exists, it is removed before .I file1 is moved. If .I file2 has a mode which forbids writing, .I mv prints the mode (see .IR chmod (2)) and reads the standard input to obtain a line; if the line begins with .B y, the move takes place; if not, .I mv exits. .PP In the second form, one or more .I files are moved to the .I directory with their original file-names. .PP .I Mv refuses to move a file onto itself. .PP Options: .TP .B \-i stands for interactive mode. Whenever a move is to supercede an existing file, the user is prompted by the name of the file followed by a question mark. If he answers with a line starting with 'y', the move continues. Any other reply prevents the move from occurring. .TP .B \-f stands for force. This option overrides any mode restrictions or the \-i switch. .TP .B \- means interpret all the following arguments to .I mv as file names. This allows file names starting with minus. .SH "SEE ALSO" cp(1), ln(1) .SH BUGS If .I file1 and .I file2 lie on different file systems, .I mv must copy the file and delete the original. In this case the owner name becomes that of the copying process and any linking relationship with other files is lost. .PP Directories may only be moved within the same parent directory. option ov((man/man1/neqn.1 664 0 33 30 2512730511 6414 .so /usr/man/man1/eqn.1 tions or the \-i switch. .TP .B \- means interpret all the following arguments to .I mv as file names. This allows file names starting with minus. .SH "SEE ALSO" cp(1), ln(1) .SH BUGS If .I file1 and .I file2 lie on different file systems, .I mv must copy the file and delete the original. In this case the owner name becomes that of the copying process and any linking relationship with other /( ,( 5Ċ /\@,\D"man/man1/net.1 644 0 33 6010 2512730511 6303 .TH NET 1 2/6/80 .UC 4 .ds s 1 .ds o 1 .SH NAME net \- execute a command on a remote machine .SH SYNOPSIS .B net [ .B \-m machine ] [ .B \-l login ] [ .B \-p password ] [ .B \-r respfile ] [ .B \- ] [ .B \-f ] [ .B \-n ] [ .B \-q ] command .SH DESCRIPTION The .I net command sends the specified .I command (which should be enclosed in quotes) over the network to the specified (or default) remote machine. The network will notify the user when the command has been executed and will return to him any output or error indication by `writing' (see .IR write (\*o)) to the terminal if he is still logged in, or `mailing' (see .IR mail (\*o)) otherwise. .PP There are a number of options, which must precede the command. Options may be specified on the command line, preceding the command, or in a file ``.netrc'' in the user's login directory. The ``.netrc'' file is not described here. The .B \-m option specifies the desired remote machine. If a remote machine is not specified, the default one is used. The machine name may be a one letter abbreviation or a full name; upper\- and lower\-case distinctions are ignored. If the standard output and standard error files are to be saved, the .B \-r option returns to the originating user a file .I (respfile) containing the standard output and error files when the command was executed on the remote machine. If this option is used, no message is written back. The presence of a non-zero length .I respfile indicates completion. The .B \-q option suppresses all acknowledgements unless an error occurs, there is output from the command, or the exit code of .I command is non-zero. .PP If the .B \-l and .B \-p options are not specified, and the login name and password are not in the ``.netrc'' file, a remote login name and password is prompted for on the terminal; the .B \-f flag forces login name and password prompting. A single .B \- indicates that the standard input from the local machine is to be taken and transmitted to the remote machine, where it will be the standard input for .I command. The .B \-n flag forces all acknowledgment and output messages to be mailed rather than written on the terminal. Options do not need to be separated by spaces, i.e. either ``\-m C'' or ``\-mC'' is accepted. There are also other options intended to be used by higher level application programs and shell scripts only; they will not be described here. .PP The net command prepares a file to be sent to the remote machine and queues it in the `network queue.' .I Netq (\*s) gives information about the queues. .SH AUTHOR Eric Schmidt .SH FILES .ta 2.5i /usr/spool/berknet/logfile logfile with information about net activity .br /usr/spool/berknet/plogfile? log file including packet transmission statistics .br /usr/spool/berknet/netstat? statistics file .br /usr/net/network.map local network names and topology .SH BUGS .B \-q should be the default. .SH "SEE ALSO" netrm(\*s), netq(\*s), netlog(\*s), netcp(\*s), netlpr(\*s), netmail(\*s), netlogin(\*s), mail(\*o) .br ``An Introduction to the Berkeley Network", by Eric Schmidt Eric Schmidt .SH FILES .ta 2.5i /usr/spool/berknet/logfile logfile with information about net activity .br /usr/spool/berknet/plogfile? log file including packet transmission statistics .br /usr/spool/berknet/netstat? statistics file .br /usr/net/network.map local network names and topology .SH BUGS .B \-q should be the default. .SH "SEE ALSO" netrm(\*s), netq(\*s), netlog(\*s), netcp(\*s), netlpr(\*s), netmail(\*s), netlogin(\*s), mail(\*o) .br ``An Introduction to the Berkeley Network", by Eric man/man1/netcp.1 644 0 33 3373 2512730512 6640 .TH NETCP 1 2/6/80 .UC 4 .ds s 1 .ds o 1 .SH NAME netcp \- remote copy of files through the net .SH SYNOPSIS .B netcp [ .B \-l login ] [ .B \-p password ] [ .B \-f ] [ .B \-n ] [ .B \-q ] fromfile tofile .SH DESCRIPTION .I Netcp copies files between machines and is similar to .IR cp (\*o). At least one of .I fromfile and .I tofile must be remote. The .B \-l, .B \-p, .B \-f, .B \-q, and .B \-n behave exactly as in .IR net (\*s). .PP .I Fromfile and .I tofile follow these conventions: .TP 4 1. A simple filename is assumed to be local and from the current directory. .TP 4 2. A filename preceded by a machine designator (see below) is a reference to a file on the specified remote machine. If a full pathname is not given, it is assumed to be from the login directory. .PP Examples: .IP " grades.p" 20 file in the current directory on local machine .IP " C:junk" 20 file in your login directory on C .IP " /usr/lib/pq" 20 file on local machine .IP " C:comp/c2.c" 20 file in a subdirectory on C machine .PP When files are being ``fetched'', that is, the .I fromfile is remote and the .I tofile is local, the .I tofile is created zero-length mode 600. For security reasons, when the ``fetched'' file's contents arrive at the local machine, the file must still be zero-length and mode 0600. No confirmation is sent to the user that the file has been ``fetched''; a non-zero file length indicates completion. .PP .I Netcp executes the .IR net (\*s) command. .SH "SEE ALSO" net(\*s), netrm(\*s), netq(\*s), netlog(\*s), netlpr(\*s), netmail(\*s), netlogin(\*s), cp(\*o), mail(\*o) .SH AUTHOR Eric Schmidt .SH BUGS The second filename may not be defaulted to a directory name as in .IR cp (\*o), it must be given explicitly. .br The file mode may or may not be set correctly. e zero-length and mode 0600. No confirmation is sent to the user that the file has been ``fetched''; a non-zero file length indicates completion. .PP .I Netcp executes the .IR net (\*s) command. .SH "SEE ALSO" net(\*s), netrm(\*s), netq(\*s), netlog(\*s), netlman/man1/netlog.1 644 0 33 656 2512730512 7000 .TH NETLOG 1 2/6/80 .UC 4 .ds s 1 .ds o 1 .SH NAME netlog \- print the last few lines of the network log file .SH SYNOPSIS .B netlog [ \-lines ] .SH DESCRIPTION .I Netlog prints the last few lines of the network log file indicating recent network activity. .SH FILES .ta 2.5i /usr/spool/berknet/logfile the log .SH SEE ALSO net(\*s), netrm(\*s), netq(\*s), netcp(\*s), netlpr(\*s), netmail(\*s), netlogin(\*s), mail(\*o) .SH BUGS  ,( 5Ċ /\@,\D"man/man1/netlogin.1 644 0 33 3350 2512730512 7341 .TH NETLOGIN 1 2/6/80 .UC 4 .ds s 1 .ds o 1 .SH NAME netlogin \- provide login name and password for a remote machine .SH SYNOPSIS .B netlogin .B \-m machine [ .B \-l login ] .SH DESCRIPTION The .I netlogin command sets the login name and password for the specified .I machine in a rather unusual way. The user should type (to the C shell) .IP setenv\ MACH\fImachine\fR\ \(ganetlogin\ \-m\ \fImachine\fR\(ga .LP or (to the default Version 7 ``Bourne'' shell) .IP MACH\fImachine\fR=\(ganetlogin\ \-m\ \fImachine\fR\(ga; export MACH\fImachine\fR .PP to his login shell. (Note the back-quotes). For example, .IP setenv\ MACHA\ `netlogin\ \-m\ A` .PP will prompt the user for his login name and password on the A machine and .IP setenv\ MACHA\ `netlogin\ \-m\ A \-l\ myname` .PP will prompt the user for the password to account `A:myname'. .PP The .IR net (\*s) command will read the environment looking for environment variables beginning with ``MACH'' and followed by a valid machine name on the local network. If found it w((ill use that information rather than prompt the user every time he executes a network command. This environment information is ignored if login names and passwords are specified on the command line of network commands using the .B \-l and .B \-p options or in the .I \&.netrc file. .PP This procedure for specifying passwords is somewhat safer than putting the remote passwords in the .I \&.netrc file. The passwords in the environment are encrypted and the environment information is useless after the user logs out. Use the .IR printenv (\*o) command to see the encrypted password. .SH AUTHOR Eric Schmidt .SH "SEE ALSO" net(\*s), netrm(\*s), netq(\*s), netlog(\*s), netcp(\*s), netlpr(\*s), netmail(\*s), printenv(\*o), csh(\*o) .SH BUGS \-l and .B \-p options or in the .I \&.netrc file. .PP This procedure for specifying passwords is somewhat safer than putting the remote passwords in the .I \&.netrc file. The passwords in the environment are encrypted and the environment information is useless after the user loman/man1/netlpr.1 644 0 33 2301 2512730512 7021 .TH NETLPR 1 2/6/80 .UC 4 .ds s 1 .ds o 1 .SH NAME netlpr \- use a remote lineprinter through the net .SH SYNOPSIS .B netlpr [ .B \-m machine ] [ .B \-l login ] [ .B \-p password ] [ .B \-f ] [ .B \-q ] [ .B \-n ] [ .B \-c command ] [ name1 ... namen ] .SH DESCRIPTION .I Netlpr sends the named files, (or the standard input if none are named), to a remote lineprinter; the .B \-m option forces the files to be printed on the specified machine. (If not specified, the default machine is used.) The .B \-l, .B \-p, .B \-f, .B \-q, and .B \-n options behave exactly as in .IR net (\*s). If the .B \-c option is specified, the .I command is used in place of `lpr'. This allows the use of different lineprinters on the remote machine. See the file .I `/usr/net/network.map' for a list of available commands. Any other options are passed through to .IR lpr (\*o) on the remote machine. Copies of the files are not made on the remote machine. .PP .I Netlpr executes the .IR net (\*s) command. .SH FILES .ta 2.5i /usr/net/network.map lists the allowed local printer names .SH "SEE ALSO" net(\*s), netrm(\*s), netq(\*s), netlog(\*s), netcp(\*s), netmail(\*s), netlogin(\*s), mail(\*o), lpr(\*o) .SH AUTHOR Eric Schmidt rinters on the remote machine. See the file .I `/usr/net/network.map' for a list of available commands. Any other options are passed through to .IR lpr (\*o) on the remote machine. Copies of the files are not made on the remote machine. .PP .I Netlpr executes the .IR net (\*s) command. .SH FILES .ta 2.5i /usr/net/netwman/man1/netmail.1 644 0 33 3047 2512730512 7156 .TH NETMAIL 1 2/6/80 .UC 4 .ds s 1 .ds o 1 .SH NAME netmail \- read mail on a remote machine over the network .SH SYNOPSIS .B netmail [ .B \-l username ] [ .B \-p password ] [ .B \-c ] [ .B \-q ] [ .B \-n ] [ .B \-f ] [ machine:username ] .SH DESCRIPTION Mail is checked and/or read on the specified .I machine. If the machine specification is omitted, the default machine is used. The command has two distinct modes depending on whether the .B \-c option is specified. .PP If .B \-c is specified, the presence of mail is checked on the remote machine. No password is required so it can be put in C shell `.netrc' file. A message is written or mailed back (see .IR net (\*s)) if there is or is not any unread mail. .PP If the .B \-c option is not specified, mail is read and mailed back to the user. A password is required. Mail is also appended to the remote file .I `mbox' as a precaution. .PP The .B \-q option suppresses the message sent back if there is no mail. The options .B \-l, .B \-p, .B \-f, and .B \-n behave exactly as in .IR net (\*s). (The login name can be specified either with the .B \-l option or by `machine:username'.) .PP .I Netmail executes the .IR net (\*s) command. .PP Examples: .IP " netmail\ \-c\ X:uname" 30 checks if there is mail for `uname' on the X machine, no password required. .IP " netmail\ X:uname" 30 reads mail for `uname' on the X machine, mails it back, password is required. .SH AUTHOR Eric Schmidt .SH "SEE ALSO" net(\*s), netrm(\*s), netq(\*s), netlog(\*s), netcp(\*s), netlpr(\*s), netlogin(\*s), mail(\*o) .SH BUGS ogin name can be specified either with the .B \-l option or by `machine:username'.) .PP .I Netmail executes the .IR net (\*s) command. .PP Examples: .IP " netmail\ \-c\ X:uname" 30 checks if there is mail for `uname' on the X machine, no password required. .IP " netmail\ X:uname" 30 reads mail for `uname' on the X machine, mails it back, password is required. .SH AUTHOR Eric Schmidt .SH "SEE ALSO" net(\*s), netrm(\*s), netq(\*s), netlog(\*s), netcp(\*s), netlpr(\man/man1/netq.1 644 0 33 2656 2512730513 6502 .TH NETQ 1 2/6/80 .UC 4 .ds s 1 .ds o 1 .SH NAME netq \- print contents of network queue .SH SYNOPSIS .B netq [ .B \-a ] [ machine ] .SH DESCRIPTION .I Netq lists the contents of the network queue, one request per line, for each directly-connected machine. For each request, it shows the login name and machine of the originator, the destination machine and login name, and the length (in bytes) of the request (this will be larger than any files transferred (e.g. by .I netcp), because of header information). Also described are the queue filename which may be used as an argument to .IR netrm (\*s), the time entered the queue, and the command being sent. .PP .I Netq summarizes requests by other users. If the .B \-a option is specified, requests from all users are listed. .PP If a .I machine is specified, only the queue for that directly-connected machine is listed. .PP The requests are listed in the order they will be sent; the queue for each machine is totally independent from the other machine's queues. .SH AUTHOR Eric Schmidt .SH FILES .ta 2.5i /usr/spool/berknet/send? the directories where the queues are .br /usr/spool/berknet/logfile the log .SH "SEE ALSO" net(\*s), netrm(\*s), netlog(\*s), netcp(\*s), netlpr(\*s), netmail(\*s), netlogin(\*s), mail(\*o) .SH BUGS .I Netq should also list files in net queues on intermediate machines. .br The commands are sent shortest-job first. There is no way to delay a shorter, earlier request. e for each machine is totally independent from the other machine's queues. .SH AUTman/man1/netrm.1 644 0 33 1633 2512730513 6652 .TH NETRM 1 2/6/80 .UC 4 .ds s 1 .ds o 1 .SH NAME netrm \- remove a command from the network queue .SH SYNOPSIS .B netrm [ .B \- ] [ name1 ... namen ] .SH DESCRIPTION .I Netrm removes files from the network queue which have been queued for transmission to remote machines (but not yet sent). The .I names specified are the filenames reported by the .IR netq (\*s) command. The .B \- option indicates that all files owned by the person logged in are to be removed. .PP Only the owner of the file or super-user can .I netrm the file. .SH AUTHOR Eric Schmidt .SH FILES .ta 2.5i /usr/spool/berknet/send? the directories where the queues are .SH BUGS Files on network queues on intermediate machines cannot be removed. .br There should be a .B \-m flag to use with .B \- to remove all your requests to one particular machine. .SH "SEE ALSO" net(\*s), netq(\*s), netcp(\*s), netlpr(\*s), netmail(\*s), netlogin(\*s), mail(\*o) les owned by the person logged in are to be removed. .PP Only the owner of the file or super-user canman/man1/nettroff.1 644 0 33 2260 2512730513 7351 .TH NETTROFF 1 2/6/80 .UC 4 .SH NAME nettroff \- troff to the phototypesetter over the network .SH SYNOPSIS .B nettroff troff arguments .SH DESCRIPTION .I Nettroff runs .IR troff (1) and sends the output over the network to the machine at the Computer Center with the phototypesetter (currently the ``A'' machine.) It will prompt you for an account name and password on the A machine unless you have provided these in your .I \&.netrc file. The .I troff .B \-s option is unnecessary and not permitted. .LP .I Net((troff jobs are limited to 15 feet of typesetter output. It is also a good idea to limit the size of the individual files sent, as the network uses a shortest-job-first scheduling algorithm. Jobs of 25000 characters or less are preferable; in no case will the network accept jobs longer than 100000 characters. .SH SEE ALSO vtroff(1), net(1), troff(1) .SH BUGS There is no way to specify special font mounts on the A machine. .br The .B \-l and .B \-p options of the .IR net (1) command may not be specified. .br This command is not supported by the Computer Center. .br If on a Computer Center machine (B, C, D, or E) use the .I troff command (see .IR troff (1)) for more information. ng algorithm. Jobs of 25000 characters or less are preferable; in no case will the network accept jobs longer than 100000 characters. .SH SEE ALSO vtroff(1), net(1), troff(1) .SH BUGS There is no way to specify special font mounts on the A machine. .br The .B \-l and .B \-p options of the .IR net (1) command may not be specified. .man/man1/newaliases.1 644 0 33 565 2512730513 7643 .TH NEWALIASES 1 .UC 4 .SH NAME newaliases \- rebuild the data base for the mail aliases file .SH SYNOPSIS .B newaliases .SH DESCRIPTION .I Newalises rebuilds the random access data base for the mail aliases file /usr/lib/aliases. It must be run each time /usr/lib/aliases is changed in order for the change to take effect. .SH SEE ALSO aliases(5), delivermail(8) .SH BUGS ay to specify special font mounts on the A mach/( ,( 5`Ċ /\@,\D"man/man1/newcsh.1 644 0 33 26344 2512730514 7043 .TH NEWCSH 1 .UC 4 .bd S 3 .SH NAME newcsh \- description of new csh features (over oldcsh) .SH SYNOPSIS .B csh \fIcsh-options\fR .SH SUMMARY This is a summary of features new in .IR csh (1) in this version of the system; an older version of .I csh is available as .I oldcsh. This newer .I csh has some new process control primitives and a few other new features. Users of .I csh must (and automatically) use the new terminal driver (summarized in .IR newtty(4) and completely described with the old in .IR tty (4)) which allows generation of some new interrupt signals from the keyboard which tell jobs to stop, and arbitrates access to the terminal; on CRT's the command ``stty crt'' is normally placed in the .I .login file to be executed at login, to set other useful modes of this terminal driver. .PP .B "Jobs." .PP The most important new feature in this shell is the control of .I jobs. A job is associated with each pipeline, where a pipeline is either a simple command like ``date'', or a pipeline like ``who | wc''. The shell keeps a table of current jobs, and assigns them small integer numbers. When you start a job in the background, the shell prints a line which looks like: .PP \ \ \ \ [1] 1234 .PP this indicating that the job which was started asynchronously with ``&'' is job number 1 and has one (top-level) process, whose process id is 1234. The set of current jobs is listed by the .I jobs command. .PP If you are running a job and wish to do something else you may hit the key ^Z (control-Z) which sends a .I stop signal to the current job. The shell will then normally indicate that the job has been ``Stopped'', and print another prompt. You can then put the job in the background with the command ``bg'', or run some other commands and then return the job to the foreground with ``fg''. A ^Z takes effect immediately and is like an interrupt in that pending output and unread input are discarded when it is typed. There is another special key ^Y which does not generate a stop signal until a program attempts to .IR read (2) it. This can usefully be typed ahead when you have prepared some commands for a job which you wish to stop after it has read them. .PP A job being run in the background will stop if it tries to read from the terminal. Background jobs are normally allowed to produce output, but this can be disabled by doing ``stty tostop''. If you set this tty option, then background jobs will stop when they try to produce output like they do when they try to read input. .PP There are several ways to refer to jobs in the shell. The character ``%'' introduces a job name. If you wish to refer to job number 1, you can name it as ``%1''. Just naming a job brings it to the foreground; thus ``%1'' is a synonym for ``fg %1'', bringing job 1 back into the foreground. Similarly saying ``%1 &'' resumes job 1 in the background. Jobs can also be named by prefixes of the string typed in to start them, if these prefixes are unambiguous, thus ``%ex'' would normally restart a suspended .IR ex (1) job, if there were only one suspended job whose name began with the string ``ex''. It is also possible to say ``%?string'' which specifies a job whose text contains .I string, if there is only one such job. .PP The shell also maintains a notion of the current and previous jobs. In output pertaining to jobs, the current job is marked with a ``+'' and the previous job with a ``\-''. The abbreviation ``%+'' refers to the current job and ``%\-'' refers to the previous job. For close analogy with the .I history mechanism, ``%%'' is also a synonym for the current job. .PP .B "Status reporting." .PP This shell learns immediately whenever a process changes state. It normally informs you whenever a job becomes blocked so that no further progress is possible, but only just before it prints a prompt. This is done so that it does not otherwise disturb your work. If, however, you set the shell variable .I notify, the shell will notify you immediately of changes of status in background jobs. There is also a shell command .I notify which marks a single process so that its status changes will be immediately reported. By default .I notify marks the current process; simply say ``notify'' after starting a background job to mark it. .PP When you try to leave the shell while jobs are stopped, you will be warned that ``You have stopped jobs.'' You may use the ``jobs'' command to see what they are. If you do this or immediately try to exit again, the shell will not warn you a second time, and the suspended jobs will be unmercifully terminated. .PP .B "New builtin commands." .HP 5 .B bg .br .ns .HP 5 \fBbg\ %\fRjob\ ... .br Puts the current or specified jobs into the background, continuing them if they were stopped. .HP 5 .B fg .br .ns .HP 5 \fBfg\ %\fRjob\ ... .br Brings the current or specified jobs into the foreground, continuing them if they were stopped. .HP 5 .B jobs .br .ns .HP 5 .B "jobs \-l" .br Lists the active jobs; given the .B \-l options lists process id's in addition to the normal information. .HP 5 \fBkill %\fRjob .br .ns .HP 5 \fBkill\ \-\fRsig\ \fB%\fRjob\ ... .br .ns .HP 5 \fBkill\fR\ pid .br .ns .HP 5 \fBkill\ \-\fRsig\ pid\ ... .br .ns .HP 5 \fBkill\ \-l\fR .br Sends either the TERM (terminate) signal or the specified signal to the specified jobs or processes. Signals are either given by number or by names (as given in .I /usr/include/signal.h, stripped of the prefix ``SIG''). The signal names are listed by ``kill \-l''. There is no default, saying just `kill' does not send a signal to the current job. If the signal being sent is TERM (terminate) or HUP (hangup), then the job or process will be sent a CONT (continue) signal as well. .HP 5 .B notify .br .ns .HP 5 \fBnotify\ %\fRjob\ ... .br Causes the shell to notify the user asynchronously when the status of the current or specified jobs changes; normally notification is presented before a prompt. All jobs are marked ``notify'' if the shell variable ``notify'' is set. .HP 5 \fBstop\ %\fRjob\ ... .br Stops the specified job which is executing in the background. .HP 5 \fB%\fRjob .br Brings the specified job into the foreground. .HP 5 \fB%\fRjob \fB&\fR .br Continues the specified job in the background. .br .ne 5 .PP .B "Process limitations." .PP The shell provides access to an experimental facility for limiting the consumption by a single process of system resources. The following commands control this facility: .HP 5 \fBlimit\fR \fIresource\fR \fImaximum-use\fR .HP 5 \fBlimit\fR \fIresource\fR .br .ns .HP \fBlimit\fR .br Limits the consumption by the current process and each process it creates to not individually exceed \fImaximum-use\fR on the specified \fIresource\fR. If no \fImaximum-use\fR is given, then the current limit is printed; if no \fIresource\fR is given, then all limitations are given. .IP Resources controllable currently include \fIcputime\fR (the maximum number of cpu-seconds to be used by each process), \fIfilesize\fR (the largest single file which can be created), \fIdatasize\fR (the maximum growth of the data+stack region via .IR sbrk (2) beyond the end of the program text), \fIstacksize\fR (the maximum size of the automatically-extended stack region), and \fIcoredumpsize\fR (the size of the largest core dump that will be created). .IP The \fImaximum-use\fR may be given as a (floating point or integer) number followed by a scale factor. For all limits other than \fIcputime\fR the default scale is ``k'' or ``kilobytes'' (1024 bytes); a scale factor of ``m'' or ``megabytes'' may also be used. For cputime the default scaling is ``seconds'', while ``m'' for minutes or ``h'' for hours, or ((a time of the form ``mm:ss'' giving minutes and seconds may be used. .IP For both \fIresource\fR names and scale factors, unambiguous prefixes of the names suffice. .HP 5 \fBunlimit\fR \fIresource\fR .br .ns .HP 5 \fBunlimit\fR .br Removes the limitation on \fIresource\fR. If no \fIresource\fR is specified, then all \fIresource\fR limitations are removed. .ne 5 .PP .B "Directory stack." .PP This shell now keeps track of the current directory (which is kept in the variable .I cwd) and also maintains a stack of directories, which is printed by the command .I dirs. You can change to a new directory and push down the old directory stack by using the command .I pushd which is otherwise like the .I chdir command, changing to its argument. You can pop the directory stack by saying .I popd. Saying .I pushd with no arguments exchanges the top two elements of the directory stack. The elements of the directory stack are numbered from 1 starting at the top. Saying .I pushd with a argument ``+\fIn\fR'' rotates the directory stack to make that entry in the stack be at the top and changes to it. Giving .I popd a ``+\fIn\fR'' argument eliminates that argument from the directory stack. .PP .B "Miscellaneous." .PP This shell imports the environment variable USER into the variable .I user, TERM into .I term, and HOME into .I home, and exports these back into the environment whenever the normal shell variables are reset. The environment variable PATH is likewise handled; it is not necessary to worry about its setting other than in the file .I \&.cshrc as inferior .I csh processes will import the definition of .I path from the environment, and re-export it if you then change it. (It could be set once in the .I \&.login except that commands over the Berknet would not see the definition.) .PP There are new commands .I eval, which is like the eval of the Bourne shell .IR sh (1), and useful with .IR tset (1), and .I suspend which stops a shell (as though a ^Z had stopped it; since shells normally ignore ^Z signals, this command is necessary.) .PP There is a new variable .I cdpath; if set, then each directory in .I cdpath will be searched for a directory named in a .I chdir command if there is no such subdirectory of the current directory. .PP An .I unsetenv command removing environment variables has been added. .PP There is a new ``:'' modifier ``:e'', which yields the extension portion of a filename. Thus if ``$a'' is ``file.c'', ``$a:e'' is ``c''. .PP There are two new operators in shell expressions ``!~'' and ``=~'' which are like the string operations ``!='' and ``=='' except that the right hand side is a .I pattern (containing, e.g. ``*''s, ``?''s and instances of ``[...]'') against which the left hand operand is matched. This reduces the need for use of the .I switch statement in shell scripts when all that is really needed is pattern matching. .PP The form ``$<'' is new, and is replaced by a line from the standard input, with no further interpretation thereafter. It may therefore be used to read from the keyboard in a shell script. .SH "SEE ALSO" csh(1), killpg(2), sigsys(2), signal(2), jobs(3), sigset(3), tty(4) .SH BUGS Command sequences of the form ``a ; b ; c'' are not handled gracefully when stopping is attempted. If you suspend ``b'', the shell will then immediately execute ``c''. This is especially noticeable if this expansion results from an .I alias. It suffices to place the sequence of commands in ()'s to force it to a subshell, i.e. ``( a ; b ; c )'', but see the next bug. .PP Shell builtin functions are not stoppable/restartable. .PP Control over output is primitive; perhaps this will inspire someone to work on a good virtual terminal interface. In a virtual terminal interface much more interesting things could be done with output control. ill then immediately execute ``c''. This is especially noticeable if this expansion results from an .I alias. It suffices to place the sequence of commands in ()'s to force it to a subshell, i.e. ``( a ; b ; c )'', but see the next bug. .PP Shell builtin functions are not stoppable/man/man1/newgrp.1 644 0 33 1133 2512730514 7023 .TH NEWGRP 1 .SH NAME newgrp \- log in to a new group .SH SYNOPSIS .B newgrp group .SH DESCRIPTION .I Newgrp changes the group identification of its caller, analogously to .IR login (1). The same person remains logged in, and the current directory is unchanged, but calculations of access permissions to files are performed with respect to the new group ID. .PP A password is demanded if the group has a password and the user himself does not. .PP .I Newgrp is known to the shell, which executes it directly without a fork. .SH FILES /etc/group, /etc/passwd .SH "SEE ALSO" login(1), group(5) .SH BUGS CRIPTION .I Newgrp changes the group identification of its caller, analogously to .IR login (1). The same person remains logged in, and the current directory is unchanged, but calculations of access permissions to files are performed with respect to the new group ID. .PP A password is demanded if the group has a password and the user himself does not. .PP .I Newgrp is known to the shell, which executes it directly wiman/man1/nice.1 644 0 33 3136 2512730514 6444 .TH NICE 1 .UC 4 .SH NAME nice, nohup \- run a command at low priority (\fIsh\fR only) .SH SYNOPSIS .B nice [ .BI \- number ] command [ arguments ] .PP .B nohup command [ arguments ] .SH DESCRIPTION .I Nice executes .I command with low scheduling priority. If the .I number argument is present, the priority is incremented (higher numbers mean lower priorities) by that amount up to a limit of 20. The default .I number is 10. .PP The super-user may run commands with priority higher than normal by using a negative priority, e.g. `\-\-10'. .PP .I Nohup executes .I command immune to hangup and terminate signals from the controlling terminal. The priority is incremented by 5. .I Nohup should be invoked from the shell with `&' in order to prevent it from responding to interrupts by or stealing the input from the next person who logs in on the same terminal. The syntax of nice is also different. .SH FILES nohup.out standard output and standard error file under .I nohup .SH "SEE ALSO" csh(1), nice(2), renice(8) .SH DIAGNOSTICS .I Nice returns the exit status of the subject command. .SH BUGS .I Nice and .I nohup are particular to .IR sh (1). If you use .IR csh (1), then commands executed with ``&'' are automatically immune to hangup signals while in the background. There is a builtin command .I nohup which provides immunity from terminate, but it does not redirect output to .I nohup.out. .PP .I Nice is built into .IR csh (1) with a slightly different syntax than described here. The form ``nice +10'' nices to positive nice, and ``nice \-10'' can be used by the super-user to give a process more of the processor. up are particular to .IR sh (1). If you use .IR csh (1), then commands executed with ``&'' are automatically immune to hangup signals while in the background. There is a builtin command .I nohup which provides immunity from terminate, but it does not redirect output to .I nohup.out. .PP .I Nice is built into .IR csh (1) with a slightly different syntax than described here. The form ``nice +10'' nices to positive nman/man1/nm.1 644 0 33 2424 2512730514 6137 .TH NM 1 .UC 4 .SH NAME nm \- print name list .SH SYNOPSIS .B nm [ .B \-agnopru ] [ file ... ] .SH DESCRIPTION .I Nm prints the name list (symbol table) of each object .I file in the argument list. If an argument is an archive, a listing for each object file in the archive will be produced. If no .I file is given, the symbols in `a.out' are listed. .PP Each symbol name is preceded by its value (blanks if undefined) and one of the letters .SM .B U (undefined), .SM .B A (absolute), .SM .B T (text segment symbol), .SM .B D (data segment symbol), .SM .B B (bss segment symbol), .SM .B C (common symbol), .SM .B f file name, or .B \- for sdb symbol table entries (see .B \-a below). If the symbol is local (non-external) the type letter is in lower case. The output is sorted alphabetically. .PP Options are: .TP .B \-a Include all symbols in candidates for printing; normally symbols destined for .IR sdb (1) are excluded. .TP .B \-g Print only global (external) symbols. .TP .B \-n Sort numerically rather than alphabetically. .TP .B \-o Prepend file or archive element name to each output line rather than only once. .TP .B \-p Don't sort; print in symbol-table order. .TP .B \-r Sort in reverse order. .TP .B \-u Print only undefined symbols. .SH SEE ALSO ar(1), ar(5), a.out(5), stab(5) cally. .PP Options are: .TP .B \-a Include all symbols in candidates for printing; normally symbols destined for .IR sdb (1) are excluded. .TP .B \-g Print only global (external) symbols. .TP .B \-n Sort numerically rather than alphabe((man/man1/nroff.1 664 0 33 32 2512730514 6572 .so /usr/man/man1/troff.1 nd file or archive element name to each output line rather than only once. .TP .B \-p Don't sort; print in symbol-table order. .TP .B \-r Sort in reverse order. .TP .B \-u Print only undefined symbols. .SH SEE ALSO ar(1), ar(5), a.out(5), stab(5) cally. .PP Options are: .TP .B \-a Include all symbols in candidates for printing; normally symbols destined for .IR sdb (1) are excluded. .TP ./( ,( 5Ċ /\@,\D"man/man1/num.1 644 0 33 671 2512730514 6306 .TH NUM 1 .UC 4 .SH NAME num \- number lines .SH SYNOPSIS .B num [ file ... ] .SH DESCRIPTION The lines in the specified files, or the standard input, are copied to the standard output preceded by line numbers. Tabs remain aligned in the output as the lines are printed preceded by the number blank padded to six digits and then 2 spaces. .PP .I Num is actually just the .B \-n option of the .IR cat (1) command. .SH SEE\ ALSO cat(1), pr(1) C (7/\@,\D"man/man1/od.1 644 0 33 2733 2527170233 6134 .TH OD 1 4/1/81 .UC 4 .SH NAME od \- octal dump .SH SYNOPSIS .B od [ .B \-abcdoxDOXw ] [ file ] [ [ .B + ]offset[ .BR ". " "][" \fBb\fR ] ] .SH DESCRIPTION .I Od dumps .I file in one or more formats as selected by the first argument. If the first argument is missing, .B \-o is default. The meanings of the format argument characters are: .TP 3 .B b Interpret bytes in octal. .TP 3 .B c Interpret bytes in ASCII. Certain non-graphic characters appear as C escapes: null=\e0, backspace=\eb, formfeed=\ef, newline=\en, return=\er, tab=\et; others appear as 3-digit octal numbers. .TP 3 .B d Interpret shorts (16 bit words) in decimal. .TP 3 .B o Interpret shorts (16 bit words) in octal. .TP 3 .B w Produce wide (132 column) output. .TP 3 .B x Interpret shorts (16 bit words) in hex. .TP 3 .B D Interpret longs (32 bit words) in decimal. .TP 3 .B O Interpret longs (32 bit words) in octal. .TP 3 .B X Interpret longs (32 bit words) in hex. .PP The .I file argument specifies which file is to be dumped. If no file argument is specified, the standard input is used. .PP The offset argument specifies the offset in the file where dumping is to commence. This argument is normally interpreted as octal bytes. If `\fB.\fR' is appended, the offset is interpreted in decimal. If `\fBb\fR' is appended, the offset is interpreted in blocks of 512 bytes. If the file argument is omitted, the offset argument must be preceded .RB ` + '. .PP Dumping continues until end-of-file. .SH "SEE ALSO" adb(1) h file is to be dumped. If no file arman/man1/page.1 644 0 33 31 2512730515 6372 .so /usr/man/man1/more.1 standard input is used. .PP The offset argument specifies the offset in the file where dumping is to commence. This argument is normally interpreted as octal bytes. If `\fB.\fR' is appended, the offset is interpreted in decimal. If `\fBb\fR' is appended, the offset is interpreted in blocks of 512 bytes. If the file argument is omitted, the offset argument must be preceded .RB ` + '. .PP Dump/( ,( 5Ċ /\@,\D"man/man1/passwd.1 644 0 33 1714 2512730515 7030 .TH PASSWD 1 .UC 4 .SH NAME passwd \- change login password .SH SYNOPSIS .B passwd [ name ] .SH DESCRIPTION This command changes (or installs) a password associated with the user .IR name (your own name by default). .PP The program prompts for the old password and then for the new one. The caller must supply both. The new password must be typed twice, to forestall mistakes. .PP New passwords must be at least four characters long if they use a sufficiently rich alphabet and at least six characters long if monocase. These rules are relaxed if you are insistent enough. .PP Only the owner of the name or the super-user may change a password; the owner must prove he knows the old password. .SH FILES /etc/passwd .SH "SEE ALSO" login(1), passwd(5), crypt(3) .br Robert Morris and Ken Thompson, .I UNIX password security .SH BUGS The password file information should be kept in a different data structure allowing indexed access; .IR dbm (3) would probably be suitable. rich alphabet and at least six characters long if mman/man1/pc.1 664 0 33 11642 2512730515 6154 .TH PC 1 .UC 4 .SH NAME pc \- Pascal compiler .SH SYNOPSIS .B pc [ option ] [ .B \-i name ... ] name ... .SH DESCRIPTION .I Pc is a Pascal compiler. If given an argument file ending with .BR .p , it will compile the file and load it into an executable file called, by default, .IR a.out . .PP A program may be separated into more than one .B .p file. .I Pc will compile a number of argument .B .p files into object files (with the extension .B .o in place of .BR .p ). Object files may then be loaded into an executable .I a.out file. Exactly one object file must supply a .B program statement to successfully create an executable a.out file. The rest of the files must consist only of declarations which logically nest within the program. References to objects shared between separately compiled files are allowed if the objects are declared in .BR include d header files, whose names must end with .BR .h . Header files may only be included at the outermost level, and thus declare only globally available objects. To allow .BR function s and .BR procedure s to be declared, an .B external directive has been added, whose use is similar to the .B forward directive but restricted to appear only in .B .h files. .B Function and .B procedure bodies may not appear in .B .h files. A binding phase of the compiler checks that declarations are used consistently, to enforce the type checking rules of Pascal. .PP Object files created by other language processors may be loaded together with object files created by .IR pc . The .BR function s and .BR procedure s they define must have been declared in .B .h files included by all the .B .p files which call those routines. Calling conventions are as in C, with .B var parameters passed by address. .PP See the Berkeley Pascal User's Manual for details. .PP The following options have the same meaning as in .IR cc (1) and .IR f77 (1). See .IR ld (1) for load-time options. .TP 6 .B \-c Suppress loading and produce `.o' file(s) from source file(s). .TP 6 .B \-g Have the compiler produce additional symbol table information for .IR sdb (1). .TP 6 .BR \-w Suppress warning messages. .TP 6 .B \-p Prepare object files for profiling, see .IR prof (1). .TP 6 .SM .B \-O Invoke an object-code improver. .TP 6 .SM .B \-S Compile the named program, and leave the assembler-language output on the corresponding file suffixed `.s'. (No `.o' is created.). .TP 6 .BR \-o " output" Name the final output file .I output instead of .I a.out. .PP The following options are peculiar to .IR pc . .TP 6 .B \-C Compile code to perform runtime checks, verify .B assert statements, and initialize all variables to zero as in .IR pi . .TP 6 .B \-b Block buffer the file .I output. .TP 6 .B \-i Produce a listing for the specified procedures, functions and .B include files. .TP 6 .B \-l Make a program listing during translation. .TP 6 .B \-s Accept standard Pascal only; non-standard constructs cause warning diagnostics. .TP 6 .B \-z Allow execution profiling with .I pxp by generating statement counters, and arranging for the cre((ation of the profile data file .I pmon.out when the resulting object is executed. .PP Other arguments are taken to be loader option arguments, perhaps libraries of .IR pc compatible routines. Certain flags can also be controlled in comments within the program as described in the .I "Berkeley Pascal User's Manual." .SH FILES .ta 2.5i file.p pascal source files .br /usr/lib/pc0 compiler .br /lib/f1 code generator .br /usr/lib/pc2 runtime integrator (inline expander) .br /lib/c2 peephole optimizer .br /usr/lib/pc3 separate compilation consistency checker .br /usr/lib/pc2.0strings text of the error messages .br /usr/lib/how_pc basic usage explanation .br /usr/lib/libpc.a intrinsic functions and I/O library .br /usr/lib/libm.a math library .br /lib/libc.a standard library, see \fIintro\fP(3) .SH "SEE ALSO" Berkeley Pascal User's Manual .br pi(1), pxp(1), pxref(1), sdb(1) .SH DIAGNOSTICS For a basic explanation do .IP .B pc .PP See .IR pi (1). for an explanation of the error message format. Internal errors cause messages containing the word SNARK. .SH AUTHORS Charles B. Haley, William N. Joy, and Ken Thompson .br Retargetted to the second pass of the portable .IR C compiler by Peter Kessler .br Runtime library and inline optimizer by M. Kirk McKusick .br Separate compilation consistency checking by Louise Madrid .SH BUGS The keyword .B packed is recognized but has no effect. .PP The binder is not as strict as described here, with regard to the rules about external declarations only in `.h' files and including `.h' files only at the outermost level. It will be made to perform these checks in its next incarnation, so users are warned not to be sloppy. .PP The .B \-z flag doesn't work for separately compiled files. .PP Because the .B \-s option is usurped by the compiler, it is not possible to pass the strip option to the loader. Thus programs which are to be stripped, must be run through .IR strip (1) after they are compiled. , with regard to the rules about external declarations only in `.h' files and including `.h' fman/man1/pi.1 644 0 33 6535 2512730516 6146 .TH PI 1 4/8/79 .UC .SH NAME pi \- Pascal interpreter code translator .SH SYNOPSIS .B pi [ .B option ] [ .B \-i name ... ] name.p .SH DESCRIPTION .I Pi translates the program in the file .I name.p leaving interpreter code in the file .I obj in the current directory. The interpreter code can be executed using .I px. .I Pix performs the functions of .I pi and .I px for `load and go' Pascal. .PP The following flags are interpreted by .I pi; the associated options can also be controlled in comments within the program as described in the .I "Berkeley Pascal User's Manual." .TP 6 .B \-b Block buffer the file .I output. .TP 6 .B \-i Enable the listing for any specified procedures and functions and while processing any specified .B include files. .TP 6 .B \-l Make a program listing during translation. .TP 6 .B \-n Begin each listed .B include file on a new page with a banner line. .TP 6 .B \-p Suppress the post-mortem control flow backtrace if an error occurs; suppress statement limit counting. .TP 6 .B \-s Accept standard Pascal only; non-standard constructs cause warning diagnostics. .TP 6 .B \-t Suppress runtime tests of subrange variables and treat .B assert statements as comments. .TP 6 .B \-u Card image mode; only the first 72 characters of input lines are used. .TP 6 .B \-w Suppress warning diagnostics. .TP 6 .B \-z Allow execution profiling with .I pxp by generating statement counters, and arranging for the creation of the profile data file .I pmon.out when the resulting object is executed. .dt .SH FILES file.p input file .br file.i \fBinclude\fR file(s) .br /usr/lib/pi2.0strings text of the error messages .br .nf /usr/lib/how_pi* basic usage explanation .fi obj interpreter code output .SH "SEE ALSO" Berkeley Pascal User's Manual .br pix(1), px(1), pxp(1), pxref(1) .SH DIAGNOSTICS For a basic explanation do .IP .B pi .PP In the diagnostic output of the translator, lines containing syntax errors are listed with a flag indicating the point of error. Diagnostic messages indicate the action which the recovery mechanism took in order to be able to continue parsing. Some diagnostics indicate only that the input is `malformed.' This occurs if the recovery can find no simple correction to make the input syntactically valid. .LP Semantic error diagnostics indicate a line in the source text near the point of error. Some errors evoke more than one diagnostic to help pinpoint the error; the follow-up messages begin with an ellipsis `...'. .LP .ne 8 The first character of each error message indicates its class: .LP .ta 1ic 2.i E Fatal error; no code will be generated. .br e Non-fatal error. .br w Warning \- a potential problem. .br s Non-standard Pascal construct warning. .LP If a severe error occurs which inhibits further processing, the translator will give a diagnostic and then `QUIT'. .SH AUTHORS Charles B. Haley, William N. Joy, and Ken Thompson .br Ported to VAX-11 by Peter Kessler .SH BUGS The keyword .B packed is recognized but has no effect. .PP For clarity, semantic errors should be flagged at an appropriate place in the source text, and multiple instances of the `same' semantic error should be summarized at the end of a .B procedure or .B function rather than evoking many diagnostics. .PP When .B include files are present, diagnostics relating to the last procedure in one file may appear after the beginning of the listing of the next. ompson .br Ported to VAX-11 by Peter Kessler .SH BUGS The keyword .B packed is recognized but has no effect. .PP For clarity, semantic errors should be flagged at man/man1/pix.1 644 0 33 1634 2512730516 6331 .TH PIX 1 4/8/79 .UC .SH NAME pix \- Pascal interpreter and executor .SH SYNOPSIS .B pix [ .B \-blnpstuwz ] [ .B \-i name ... ] name.p [ argument ... ] .SH DESCRIPTION .I Pix is a `load and go' version of Pascal which combines the functions of the interpreter code translator .I pi and the executor .IR px . It uses .I pi to translate the program in the file .I name.p and, if there were no fatal errors during translation, causes the resulting interpreter code to be executed by .I px with the specified arguments. A temporary file is used for the object code; the file .I obj is neither created nor destroyed. .SH FILES .ta 2i /usr/bin/pi Pascal translator .br /usr/bin/px Pascal executor .br /tmp/pix????? temporary .br /usr/lib/how_pix basic explanation .SH SEE\ ALSO Berkeley Pascal User's Manual .br pi(1), px(1) .SH DIAGNOSTICS For a basic explanation do .PP .DT .B pix .SH AUTHORS Susan L. Graham and William N. Joy ranslation, causes the resulting interpreter code to be executed by .I px with the specified argumenman/man1/plot.1g 644 0 33 2171 2512730516 6653 .TH PLOT 1G .SH NAME plot \- graphics filters .SH SYNOPSIS .B plot [ .BR \-T terminal [ raster ] ] .SH DESCRIPTION These commands read plotting instructions (see .IR plot (5)) from the standard input, and in general produce plotting instructions suitable for a particular .I terminal on the standard output. .PP If no .I terminal type is specified, the environment parameter $TERM (see .IR environ (5)) is used. Known .I terminals are: .TP 4014 Tektronix 4014 storage scope. .TP 450 DASI Hyterm 450 terminal (Diablo mechanism). .TP 300 DASI 300 or GSI terminal (Diablo mechanism). .TP 300S DASI 300S terminal (Diablo mechanism). .TP ver Versatec D1200A printer-plotter. This version of .I plot places a scan-converted image in `/usr/tmp/raster' and sends the result directly to the plotter device rather than to the standard output. The optional argument causes a previously scan-converted file .I raster to be sent to the plotter. .SH FILES /usr/bin/tek .br /usr/bin/t450 .br /usr/bin/t300 .br /usr/bin/t300s .br /usr/bin/vplot .br /usr/tmp/raster .SH "SEE ALSO" plot(3), plot(5) .SH BUGS There is no lockout protection for /usr/tmp/raster. P ver Versatec D1200A printer-plotter. This version of .I plot places a scan-converted image in `/usr/tmp/raster' and sends the result directly to the plotter device rather than to the standard output. The optional argument causes a previously scan-converted file .I raster to be sent to the plotter. .SH FILES /usr/bin/tek .br /usr/bin/t450 .br /usr/bin/t300 .br /usr/bin/t300s .br /usr/binman/man1/pr.1 644 0 33 2740 2512730517 6152 ((.TH PR 1 .UC 4 .SH NAME pr \- print file .SH SYNOPSIS .B pr [ option ] ... [ file ] ... .SH DESCRIPTION .I Pr produces a printed listing of one or more .I files. The output is separated into pages headed by a date, the name of the file or a specified header, and the page number. If there are no file arguments, .I pr prints its standard input. .PP Options apply to all following files but may be reset between files: .TP .BI \- n Produce .IR n -column output. .TP .BI + n Begin printing with page .I n. .TP .B \-h Take the next argument as a page header. .TP .BI \-w n For purposes of multi-column output, take the width of the page to be .I n characters instead of the default 72. .TP .BI \-f Use formfeeds instead of newlines to separate pages. A formfeed is assumed to use up two blank lines at the top of a page. (Thus this option does not affect the effective page length.) .TP .BI \-l n Take the length of the page to be .I n lines instead of the default 66. .TP .B \-t Do not print the 5-line header or the 5-line trailer normally supplied for each page. .TP .BI \-s c Separate columns by the single character .I c instead of by the appropriate amount of white space. A missing .I c is taken to be a tab. .TP .B \-m Print all .I files simultaneously, each in one column, .PP Inter-terminal messages via .IR write (1) are forbidden during a .IR pr . .SH FILES /dev/tty? to suspend messages. .SH "SEE ALSO" cat(1) .SH DIAGNOSTICS There are no diagnostics when .I pr is printing on a terminal. t the 5-line header or the 5-linman/man1/print.1 664 0 33 400 2512730517 6636 .TH PRINT 1 2/24/79 .UC .SH NAME print \- pr to the line printer .SH SYNOPSIS .B print file ... .SH DESCRIPTION .I Print .I pr's a copy of each named file on the line printer. It is a one line shell script: .PP .DT pr $* | lpr .SH SEE\ ALSO lpr(1), pr(1) mn, .PP Inter-terminal messages via .IR write (1) are forbidden during a .IR pr . .SH FILES /dev/tty? to suspend messages. .SH "SEE ALSO" cat(1) .SH DIAGNOSTICS The/( ,( 5PĊ /\@,\D"man/man1/printenv.1 644 0 33 656 2512730517 7362 .TH PRINTENV 1 2/24/79 .UC .SH NAME printenv \- print out the environment .SH SYNOPSIS .B printenv [ name ] .SH DESCRIPTION .I Printenv prints out the values of the variables in the environment. If a .I name is specified, only its value is printed. .PP If a .I name is specified and it is not defined in the environment, .I printenv returns exit status 1, else it returns status 0. .SH SEE ALSO sh(1), environ(5), csh(1) .SH BUGS  ,( 5`Ċ /\@,\D"man/man1/prmail.1 664 0 33 541 2512730517 6774 .TH PRMAIL 1 2/24/79 .UC 4 .SH NAME prmail \- print out mail in the post office .SH SYNOPSIS .B prmail [ user ... ] .SH DESCRIPTION .I Prmail prints the mail which waits for you, or the specified user, in the post office. The mail is not disturbed. .SH FILES .DT /usr/spool/mail/* post office .SH SEE ALSO biff(1), mail(1), from(1), binmail(1) .SH BUGS 1, else it returns status 0. .SH SEE ALSO sh(1), environ(5), csh(1)/( ,( 5pĊ /\@,\D"man/man1/prof.1 644 0 33 4067 2512730520 6475 .TH PROF 1 .UC 4 .SH NAME prof \- display profile data .SH SYNOPSIS .B prof [ .B \-a ] [ .B \-l ] [ .B \-n ] [ .B \-z ] [ .B \-s ] [ .B \-v [ .BI \- "low\fR [ \fB\-\fIhigh\fR ]" ] ] [ a.out [ mon.out ... ] ] .SH DESCRIPTION .I Prof interprets the file produced by the .I monitor subroutine. Under default modes, the symbol table in the named object file .I (a.out default) is read and correlated with the profile file .I (mon.out default). For each external symbol, the percentage of time spent executing between that symbol and the next is printed (in decreasing order), together with the number of times that routine was called and the number of milliseconds per call. If more than one profile file is specified, the output represents the sum of the profiles. .PP In order for the number of calls to a routine to be tallied, the .B \-p option of .I cc, .I f77 or .I pc must have been given when the file containing the routine was compiled. This option also arranges for the profile file to be produced automatically. .PP Options are: .TP .B \-a all symbols are reported rather than just external symbols. .TP .B \-l the output is sorted by symbol value. .TP .B \-n the output is sorted by number of calls .TP .B \-s a summary profile file is produced in .I mon.sum. This is really only useful when more than one profile file is specified. .TP .B \-v all printing is suppressed and a graphic version of the profile is produced on the standard output for display by the .IR plot (1) filters. When plotting, the numbers .I low and .I high, by default 0 and 100, may be given to cause a selected percentage of the profile to be plotted with accordingly higher resolution. .TP .B \-z routines which have zero usage (as indicated by call counts and accumulated time) are nevertheless printed in the output. .SH FILES .ta \w'mon.out 'u mon.out for profile .br a.out for namelist .br mon.sum for summary profile .SH "SEE ALSO" monitor(3), profil(2), cc(1), plot(1) .SH BUGS Beware of quantization errors. .PP Is confused by .I f77 which puts the entry points at the bottom of subroutines and functions. lected percentage of the profile to be plotted with accordingly higher resolution. .TP .B \-z routines which have zero usage (as indicated by call counts and accumulated time) are nevertheless printed in the output. .SH FILES .ta \w'mon.out 'u mon.out for profile .br a.out for namelist .br mon.sum for summary profile .SH "SEE ALSO" monitor(3), profil(2), cc(1), plot(1) .SH BUGS Beware of quantization errors. .PP Is confused by .I f77 which puts the enman/man1/ps.1 644 0 33 17114 2527170237 6177 .TH PS 1 .UC 4 .SH NAME ps \- process status .SH SYNOPSIS .B ps [ .B acegklstuvwx# ] .SH DESCRIPTION .I Ps prints information about processes. Normally, only your processes are candidates to be printed by .I ps; specifying .B a causes other users processes to be candidates to be printed; specifying .B x includes processes without control terminals in the candidate pool. .PP All output formats include, for each process, the process id PID, control terminal of the process TT, cpu time used by the process TIME (this includes both user and system time), the state STAT of the process, and an indication of the COMMAND which is running. The state is given by a sequence of four letters, e.g. ``RWNA''. The first letter indicates the runnability of the process: R for runnable processes, T for stopped processes, P for processes in page wait, D for those in disk (or other short term) waits, S for those sleeping for less than about 20 seconds, and I for idle (sleeping longer than about 20 seconds) processes. The second letter indicates whether a process is swapped out, showing W if it is, or a blank if it is loaded (in-core); a process which has specified a soft limit on memory requirements and which is exceeding that limit shows >; such a process is (necessarily) not swapped. The third letter indicates whether a process is running with altered CPU scheduling priority (nice); if the processes priority is reduced, a N is shown, if the process priority has been artificially raised then a `<' is shown; process running without special treatment have just a blank. The final letter indicates any special treatment of the process for virtual memory replacement; the letters correspond to options to the .IR vadvise (2) call; currently the possibilities are A standing for VA_ANOM, S for VA_SEQL and blank for VA_NORM; an A typically represents a .IR lisp (1) in garbage collection, S is typical of large image processing programs which are using virtual memory to sequentially address voluminous data. .PP Here are the options: .TP 5 .B a a((sks for information about all processes with terminals (ordinarily only one's own processes are displayed). .TP 5 .B c prints the command name, as stored internally in the system for purposes of accounting, rather than the command arguments, which are kept in the process' address space. This is more reliable, if less informative, since the process is free to destroy the latter information. .TP 5 .B e Asks for the environment to be printed as well as the arguments to the command. .TP 5 .B g Asks for all processes. Without this option, .I ps only prints ``interesting'' processes. Processes are deemed to be uninteresting if they are process group leaders. This normally eliminates top-level command interpreters and processes waiting for users to login on free terminals. .TP 5 .B k causes the file .I /vmcore is used in place of .IR /dev/kmem " and " /dev/mem. This is used for postmortem system debugging. .TP 5 .B l asks for a long listing, with fields PPID, CP, PRI, NI, ADDR, SIZE, RSS and WCHAN as described below. .TP 5 .B s Adds the size SSIZ of the kernel stack of each process (for use by system maintainers) to the basic output format. .TP 5 \fBt\fIx\fR restricts output to processes whose controlling tty is \fIx\fR (which should be specified as printed by .I ps, e.g. .I t3 for tty3, .I tco for console, .I td0 for ttyd0, .I t? for processes with no tty, etc). This option must be the last one given. .TP 5 .B u A user oriented output is produced. This includes fields USER, %CPU, NICE, SIZE, and RSS as described below. .TP 5 .B v A version of the output containing virtual memory statistics is output. This includes fields RE, SL, PAGEIN, SIZE, RSS, LIM, TSIZ, TRS, %CPU and %MEM, described below. .TP 5 .B w Use a wide output format (132 columns rather than 80); if repeated, e.g. ww, use arbitrarily wide output. This information is used to decide how much of long commands to print. .TP 5 .B x asks even about processes with no terminal. .TP 5 .B # A process number may be given, (indicated here by #), in which case the output is restricted to that process. This option must also be last. .PP A second argument tells .I ps where to look for .I core if the .B k option is given, instead of /vmcore. A third argument is the name of a swap file to use instead of the default /dev/drum. If a fourth argument is given, it is taken to be the file containing the system's namelist. Otherwise, /vmunix is used. .PP Fields which are not common to all output formats: .PD 0 .IP USER 10 name of the owner of the process .IP %CPU 10 cpu utilization of the process; this is a decaying average over up to a minute of previous (real) time. Since the time base over which this is computed varies (since processes may be very young) it is possible for the sum of all %CPU fields to exceed 100%. .IP NICE 10 (or NI) process scheduling increment (see .IR nice (2)) .IP SIZE 10 virtual size of the process (in 1024 byte units) .IP RSS 10 real memory (resident set) size of the process (in 1024 byte units) .IP LIM 10 soft limit on memory used, specified via a call to .IR vlimit (2); if no limit has been specified then shown as \fIxx\fR .IP TSIZ 10 size of text (shared program) image .IP TRS 10 size of resident (real memory) set of text .IP %MEM 10 percentage of real memory used by this process. .IP RE 10 residency time of the process (seconds in core) .IP SL 10 sleep time of the process (seconds blocked) .IP PAGEIN 10 number of disk i/o's resulting from references by the process to pages not loaded in core. .IP UID 10 numerical user-id of process owner .IP PPID 10 numerical id of parent of process .IP CP 10 short-term cpu utilization factor (used in scheduling) .IP PRI 10 process priority (non-positive when in non-interruptible wait) .IP ADDR 10 swap address of the process .IP WCHAN 10 event on which process is waiting (an address in the system), with the initial part of the address trimmed off e.g. 80004000 prints as 4000. .sp .IP F 10 flags associated with process as in /usr/include/sys/proc.h: .br .PP .sp .nf .ta 6n 18n 26n SLOAD 000001 in core SSYS 000002 swapper or pager process SLOCK 000004 process being swapped out SSWAP 000008 save area flag STRC 000010 process is being traced SWTED 000020 another tracing flag SULOCK 000040 user settable lock in core SPAGE 000080 process in page wait state SKEEP 000100 another flag to prevent swap out SDLYU 000200 delayed unlock of pages SWEXIT 000400 working on exiting SPHYSIO 000800 doing physical i/o (bio.c) SVFORK 001000 process resulted from vfork() SVFDONE 002000 another vfork flag SNOVM 004000 no vm, parent in a vfork() SPAGI 008000 init data space on demand, from inode SANOM 010000 system detected anomalous vm behavior SUANOM 020000 user warned of anomalous vm behavior STIMO 040000 timing out during sleep SDETACH 080000 detached inherited by init SNUSIG 100000 using new signal mechanism .fi .PD .PP A process that has exited and has a parent, but has not yet been waited for by the parent is marked ; a process which is blocked trying to exit is marked ; .I Ps makes an educated guess as to the file name and arguments given when the process was created by examining memory or the swap area. The method is inherently somewhat unreliable and in any event a process is entitled to destroy this information, so the names cannot be counted on too much. .SH FILES .ta \w'/usr/sys/core 'u /vmunix system namelist .br /dev/kmem kernel memory .br /dev/drum swap device .br /vmcore core file .br /dev searched to find swap device and tty names .SH "SEE ALSO" kill(1), w(1) .SH BUGS Things can change while .I ps is running; the picture it gives is only a close approximation to reality. memory or the swap area. The method is inherently somewhat unreliable and in any event a process is entitled to destroy this information, so the names cannot be counted on too much. .SH FILES .ta \w'/usr/sys/core 'u /vmunix system namelist .br /dev/kmem kernel memory .br /dev/drum swap device .br /vmcore core file .br /dev searched to find swap device and tty names .SH "SEE ALSO" kill(1), w(1) .SH BUGS Things can change while .I psman/man1/pti.1 644 0 33 1050 2512730521 6311 .TH PTI 1 2/24/79 .UC .SH NAME pti \- phototypesetter interpreter .SH SYNOPSIS .B pti [ file ... ] .SH DESCRIPTION .I Pti shows the commands in a stream from the standard output of .IR troff (1) using .I troff's .B \-t option, interpreting them as they would act on the typesetter. Horizontal motions shows as counts in internal units and are marked with `<' and `>' indicating left and right motion. Vertical space is called .I lead and is also indicated. .SH SEE ALSO troff(1) .SH BUGS Too cryptic for normal users, who should use ``troff \-a ...''. ototypesetter interpreter .SH SYNOPSIS .B pti [ file ... ] .SH DESCRIPTION .I Pti shows the commands in a stream from the standard output of .IR troff (1) using .I troff's .B \-t option, interpreting them as they would act on the typesetter. Horizontal motions shows as counts in internal units and are marked with `<' and `>' indicating left and right motion. Vertical space is called .I lead and is also indicated. .SH SEE ALSO troff(1) .SH BUGS Too cryptic for normal uman/man1/ptx.1 644 0 33 4530 2512730521 6336 .TH PTX 1 .SH NAME ptx \- permuted index .SH SYNOPSIS .B ptx [ option ] ... [ input [ output ] ] .SH DESCRIPTION .I Ptx generates a permuted index to file .I input on file .I output (standard input and output default). It has three phases: the first does the permutation, generating one line for each keyword in an input line. The keyword is rotated to the front. The permuted file is then sorted. Finally, the sorted lines are rotated so the keyword comes at the middle of the page. .I Ptx produces output in the form: .br .IP \&.xx "tail" "before keyword" "keyword and after" "head" .LP where .xx may be an .I nroff or .IR troff (1) macro for user-defined formatting. The .I before keyword and .I keyword and after fields incorporate as much of the line as will fit around the keyword when it is printed at the middle of the page. .I Tail and .I head, at least one of which is an empty string "", are wrapped-around pieces small enough to fit in the unused space at the opposite end of the line. When original text must be discarded, `/' marks the spot. .PP The following options can be applied: .TP .BR \-f Fold upper and lower case letters for sorting. .TP .BR \-t Prepare the output for the phototypesetter; the default line length is 100 characters. .TP .BI \-w " n" Use the next argument, .I n, as the width of the output line. The default line length is 72 characters. .TP .BI \-g " n" Use the next argument, .I n, as the number of characters to allow for each gap among the four parts of the line as finally printed. The default gap is 3 characters. .TP .BR \-o " only" Use as keywords only the words given in the \fIonly\fR file. .TP .BR \-i " ignore" Do not use as keywords any words given in the .I ignore file. If the \fB\-i\fR and \fB\-o\fR options are missing, use /usr/lib/eign as the .I ignore file. .TP .BR \-b " break" Use the characters in the .I break file to separate words. In any case, tab, newline, and space characters are always used as break characters. .TP .BR \-r Take any leading nonblank characters of each in((put line to be a reference identifier (as to a page or chapter) separate from the text of the line. Attach that identifier as a 5th field on each output line. .PP The index for this manual was generated using .I ptx. .SH FILES /bin/sort .br /usr/lib/eign .SH BUGS Line length counts do not account for overstriking or proportional spacing. .br file to separate words. In any case, tab, newline, and space characters are always used as break characters. .TP .BR \-r Take any leading nonblank characters of each inman/man1/pwd.1 644 0 33 622 2512730521 6273 .TH PWD 1 .UC 4 .SH NAME pwd \- working directory name .SH SYNOPSIS .B pwd .SH DESCRIPTION .I Pwd prints the pathname of the working (current) directory. .SH "SEE ALSO" cd(1), csh(1) .SH BUGS In .IR csh (1) the command .I dirs is always faster (although it can give a different answer in the rare case that the current directory or a containing directory was moved after the shell descended into it). ce characters are /( ,( 5Ċ /\@,\D"man/man1/px.1 644 0 33 3444 2512730521 6155 .TH PX 1 4/8/79 .UC .SH NAME px \- Pascal interpreter .SH SYNOPSIS .B px [ obj [ argument ... ] ] .SH DESCRIPTION .I Px interprets the abstract machine code generated by .I pi. The first argument is the file to be interpreted, and defaults to .IR obj \|; remaining arguments are available to the Pascal program using the built-ins .I argv and .I argc. .I Px is also invoked by .I pix when running `load and go'. .PP If the program terminates abnormally an error message and a control flow backtrace are printed. The number of statements executed and total execution time are printed after normal termination. The .B p option of .I pi suppresses all of this except the message indicating the cause of abnormal termination. .SH FILES .DT obj default object file .br pmon.out profile data file .SH "SEE ALSO" Berkeley Pascal User's Manual .br pi(1), pix(1) .SH DIAGNOSTICS Most run-time error messages are self-explanatory. Some of the more unusual ones are: .HP 6 Reference to an inactive file .br A file other than .I input or .I output was used before a call to .I reset or .I rewrite. .HP 6 Statement count limit exceeded .br The limit of 500,000 executed statements (which prevents excessive looping or recursion) has been exceeded. .HP 6 Bad data found on integer read .br .ns .HP 6 Bad data found on real read .br Usually, non-numeric input was found for a number. For reals, Pascal requires digits before and after the decimal point so that numbers like `.1' or `21.' evoke the second diagnostic. .HP 6 panic: .I "Some message" .br Indicates a internal inconsistency detected in .I px probably due to a Pascal system bug. .SH AUTHORS Charles B. Haley, William Joy, and Ken Thompson .br VAX-11 version by Kirk McKusick .SH BUGS Post-mortem traceback is not limited; infinite recursion leads to almost infinite traceback. .br Usually, non-numeric input was found for a number. For reals, Pascal requires digits before and after the decimal point so that numbers like `.1' or `21.' evoke the second diagnostic. .HP 6 panic: .I "Some message" man/man1/pxp.1 644 0 33 5506 2512730522 6337 .TH PXP 1 4/8/79 .UC .SH NAME pxp \- Pascal execution profiler .SH SYNOPSIS .B pxp [ .B \-acdefjnstuw_ ] [ .B \-23456789 ] [ .B \-z [ name ... ] ] name.p .SH DESCRIPTION .I Pxp can be used to obtain execution profiles of Pascal programs or as a pretty-printer. To produce an execution profile all that is necessary is to translate the program specifying the .B z option to .I pi or .I pix, to execute the program, and to then issue the command .DT .PP \fBpxp \-z\fR name.p .PP A reformatted listing is output if none of the .BR c , .BR t , or .B z options are specified; thus .PP \fBpxp\fR old.p > new.p .PP places a pretty-printed version of the program in `old.p' in the file `new.p'. .PP The use of the following options of .I pxp is discussed in sections 2.6, 5.4, 5.5 and 5.10 of the .IR "Berkeley Pascal User's Manual" "." .TP 6 .B \-a Print the bodies of all procedures and functions in the profile; even those which were never executed. .TP 6 .B \-c Extract profile data from the file .IR core . .TP 6 .B \-d Include declaration parts in a profile. .TP 6 .B \-e Eliminate .B include directives when reformatting a file; the .B include is replaced by the reformatted contents of the specified file. .TP 6 .B \-f Fully parenthesize expressions. .TP 6 .B \-j Left justify all procedures and functions. .TP 6 .B \-n Eject a new page as each file is included; in profiles, print a blank line at the top of the page. .TP 6 .B \-s Strip comments from the input text. .TP 6 .B \-t Print a table summarizing .B procedure and .B function call counts. .TP 6 .B \-u Card image mode; only the first 72 characters of input lines are used. .TP 6 .B \-w Suppress warning diagnostics. .TP 6 .B \-z Generate an execution profile. If no .IR name \|s, are given the profile is of the entire program. If a list of names is given, then only any specified .BR procedure s or .BR function s and the contents of any specified .B include files will appear in the profile. .TP 6 .B \-\_ Underline keywords. .TP 6 .BI \- d With .I d a digit, 2 \(<= .IR d "" \(<= 9, causes .I pxp to use .IR d "" spaces as the basic indenting unit. The default is 4. .SH FILES .DT name.p input file .br name.i include file(s) .br pmon.out profile data .br core profile data source with .B \-c .br /usr/lib/how_pxp information on basic usage .br .ne 8 .SH "SEE ALSO" Berkeley Pascal User's Manual .br pi(1), px(1) .ne 5 .SH DIAGNOSTICS For a basic explanation do .IP .DT .B pxp .PP Error diagnostics include `No profile data in file' with the .B c option if the .B z option was not enabled to .I pi; `Not a Pascal system core file' if the core is not from a .I px execution; `Program and count data do not correspond' if the program was changed after compilation, before profiling; or if the wrong program is specified. .SH AUTHOR William Joy .SH BUGS Does not place multiple statements per line. er's Manual .br pi(1), px(1) .ne 5 .SH DIAGNOSTICS For a basic explanation do .IP .DT .B pxp .PP Error diagnostics include `No profile data in file' with the .B c option if the .B z optiman/man1/pxref.1 644 0 33 1200 2512730522 6637 .TH PXREF 1 4/8/79 .UC .SH NAME pxref \- Pascal cross-reference program .SH SYNOPSIS .B pxref [ .BR \- "" ] name .SH DESCRIPTION .I Pxref makes a line numbered listing and a cross-reference of identifier usage for the program in .I name. The optional `\fB\-\fR' argument suppresses the listing. The keywords .B goto and .B label are treated as identifiers for the purpose of the cross-reference. .B Include directives are not processed, but cause the placement of an entry indexed by `#include' in the cross-reference. .SH "SEE ALSO" Berkeley Pascal User's Manual .SH AUTHOR Niklaus Wirth .SH BUGS Identifiers are trimmed to 10 characters. .I Pxref makes a line numbered listing and a cross-reference of identifier usage for the program in .I name. The optional `\fB\-\fR' argument suppresses the listing. The keywords .B goto and .B label are treated as identifiers for the purpose of the cross-reference. .B Include directives are not processed, but cause the placement of an entry indexed by `#include' in the cross-refeman/man1/ranlib.1 644 0 33 1437 2512730522 6776 .TH RANLIB 1 .SH NAME ranlib \- convert archives to random libraries .SH SYNOPSIS .B ranlib archive ... .SH DESCRIPTION .I Ranlib converts each .I archive to a form which can be loaded more rapidly by the loader, by adding a table of contents named .B _\^_.SYMDEF to the beginning of the archive. It uses .IR ar (1) to reconstruct the archive, so that sufficient temporary file space must be available in the file system containing the current directory. .SH SEE ALSO ld(1), ar(1), lorder(1) .SH BUGS Because gen((eration of a library by .I ar and randomization by .I ranlib are separate, phase errors are possible. The loader .I ld warns when the modification date of a library is more recent than the creation of its dictionary; but this means you get the warning even if you only copy the library. archive. It uses .IR ar (1) to reconstruct the archive, so that sufficient temporary file space must be available in the file system containing the current directory. .SH SEE ALSO ld(1), ar(1), lorder(1) .SH BUGS Because genman/man1/ratfor.1 644 0 33 2265 2512730523 7025 .TH RATFOR 1 .SH NAME ratfor \- rational Fortran dialect .SH SYNOPSIS .B ratfor [ option ... ] [ filename ... ] .SH DESCRIPTION .I Ratfor converts a rational dialect of Fortran into ordinary irrational Fortran. .I Ratfor provides control flow constructs essentially identical to those in C: .TP statement grouping: .nf { statement; statement; statement } .TP decision-making: if (condition) statement [ else statement ] .br switch (integer value) { case integer: statement ... [ default: ] statement } .TP loops: while (condition) statement for (expression; condition; expression) statement do limits statement repeat statement [ until (condition) ] break next .LP and some syntactic sugar to make programs easier to read and write: .TP free form input: multiple statements/line; automatic continuation .TP comments: # this is a comment .TP translation of relationals: >, >=, etc., become .GT., .GE., etc. .TP return (expression) returns expression to caller from function .TP define: define name replacement .TP include: include filename .PP .fi .I Ratfor is best used with .IR f77 (1). .SH "SEE ALSO" efl(1), f77(1) .br B. W. Kernighan and P. J. Plauger, .IR "Software Tools" , Addison-Wesley, 1976. to make programs easier to read and write: .TP free form input: multiple statements/line; automatic continuation .TP comments: # this is a comment .TP translation of relationals: >, >=, etc., become .GT., .GE., etc. .TP return (expression) returns expression to caller from function .TP define: define name replacement .TP include:man/man1/refer.1 644 0 33 6476 2512730525 6645 .TH REFER 1 4/1/81 .SH NAME refer, lookbib \- find and insert literature references in documents .SH SYNOPSIS .B refer [ option ] ... .PP .B lookbib [ file ] ... .SH DESCRIPTION .I Lookbib accepts keywords from the standard input and searches a bibliographic data base for references that contain those keywords anywhere in title, author, journal name, etc. Matching references are printed on the standard output. Blank lines are taken as delimiters between queries. .PP .I Refer is a preprocessor for .I nroff or .IR troff (1) that finds and formats references. The input files (standard input default) are copied to the standard output, except for lines between .[ and .] command lines, which are assumed to contain keywords as for .I lookbib, and are replaced by information from the bibliographic data base. The user may avoid the search, override fields from it, or add new fields. The reference data, from whatever source, are assigned to a set of .I troff strings. Macro packages such as .IR ms (7) print the finished reference text from these strings. A flag is placed in the text at the point of reference; by default the references are indicated by numbers. .br .sp The following options are available: .TP 6 .BI \-a r Reverse the first .I r author names (Jones, J. A. instead of J. A. Jones). If .I r is omitted all author names are reversed. .ns .TP .B \-b Bare mode: do not put any flags in text (neither numbers nor labels). .ns .TP .BI \-c string Capitalize (with C\s-2APS\s0 S\s-2MALL\s+2 C\s-2APS\s0) the fields whose key-letters are in .IR string . .ns .TP .B \-e Instead of leaving the references where encountered, accumulate them until a sequence of the form .nf .[ $LIST$ .] .fi is encountered, and then write out all references collected so far. Collapse references to the same source. .ns .TP .BI \-k x Instead of numbering references, use labels as specified in a reference data line beginning .I %x; by default .I x is .B L. .ns .TP .BI \-l m , n Instead of numbering references, use labels made from the senior author's last name and the year of publication. Only the first .I m letters of the last name and the last .I n digits of the date are used. If either .I m or .BI , n is omitted the entire name or date respectively is used. .ns .TP .B \-p Take the next argument as a file of references to be searched. The default file is searched last. .ns .TP .B \-n Do not search the default file. .ns .TP .BI \-s keys Sort references by fields whose key-letters are in the .I keys string; permute reference numbers in text accordingly. Implies .BR \-e . The key-letters in .I keys may be followed by a number to indicate how many such fields are used, with .B + taken as a very large number. The default is .B AD which sorts on the senior author and then date; to sort, for example, on all authors and then title use .BR -sA+T . .PP .\"To use your own references, put them in the format .\"described in .\".IR pubindex (1) .\"They can be searched .\"more rapidly by running .\".IR pubindex (1) .\"on them before using .\".I refer; .\"failure to index results in a linear search. .PP When .I refer is used with .I eqn, .I neqn or .I tbl, .I refer should be first, to minimize the volume of data passed through pipes. .SH FILES .ta 1.5i /usr/dict/papers directory of default publication lists and indexes .br /usr/lib/refer directory of programs .SH SEE ALSO ur own references, put them in the format .\"described in .\".IR pubindex (1) .\"They can be searched .\"more rapidly by running .\".IR pubindex (1) .\"on them before using .\".I refer; .\"failuman/man1/reset.1 644 0 33 1670 2512730526 6654 .TH RESET 1 .UC 4 .SH NAME reset \- reset the teletype bits to a sensible state .SH SYNOPSIS .B reset .SH DESCRIPTION .I Reset sets the terminal to cooked mode, turns off cbreak and raw modes, turns on nl, and restores special characters that are undefined to their default values. .PP This is most useful after a program dies leaving a terminal in a funny state; you have to type ``reset'' to get it to work then to the shell, as often doesn't work; often none of this will echo. .PP It isn't a bad idea to follow .I reset with .IR tset (1) .SH SEE ALSO stty(1), tset(1) .SH BUGS Doesn't set tabs properly; it can't intuit personal choices for interrupt and line kill characters, so it leaves these the old UNIX standards ^? (delete) for interrupt and @ for line kill. .PP It could well be argued that the shell should be responsible for insuring that the terminal remains in a sane state; this would eliminate the need for this program. CR> often doesn't work; often none of this will echo. .PP It isn't a badman/man1/rev.1 644 0 33 402 2512730526 6276 .TH REV 1 .SH NAME rev \- reverse lines of a file .SH SYNOPSIS .B rev [ file ] ... .SH DESCRIPTION .I Rev copies the named files to the standard output, reversing the order of characters in every line. If no file is specified, the standard input is copied. r line kill. .PP It could well be argued that the shell should be responsible for insuring that the terminal remains in a sane state; this would eliminate the nee/( ,( 5@Ċ /\@,\D"man/man1/rewind.1 644 0 33 656 2527170235 7006 .TH REWIND 1 4/20/81 .UC 4 .SH NAME rewind \- rewind tape drive .SH SYNOPSIS .B rewind [ tape ] .SH DESCRIPTION .I Rewind rewinds the tape drive, if a tape is mounted on it. This is done by opening and closing the tape drive, using a file name that will rewind when the file is closed. If an argument is given that is taken as the name of the tape drive rather than the default /dev/mt0. .SH AUTHOR Mark Horton .SH FILES /dev/mt0  ,( 5PĊ /\@,\D"((man/man1/rm.1 644 0 33 3061 2512730526 6144 .TH RM 1 4/1/81 .UC 4 .SH NAME rm, rmdir \- remove (unlink) files .SH SYNOPSIS .B rm [ .B \-f ] [ .B \-r ] [ .B \-i ] [ .B \- ] file ... .PP .B rmdir dir ... .PP .SH DESCRIPTION .I Rm removes the entries for one or more files from a directory. If an entry was the last link to the file, the file is destroyed. Removal of a file requires write permission in its directory, but neither read nor write permission on the file itself. .PP If a file has no write permission and the standard input is a terminal, its permissions are printed and a line is read from the standard input. If that line begins with `y' the file is deleted, otherwise the file remains. No questions are asked and no errors are reported when the .B \-f (force) option is given. .PP If a designated file is a directory, an error comment is printed unless the optional argument .B \-r has been used. In that case, .I rm recursively deletes the entire contents of the specified directory, and the directory itself. .PP If the .B \-i (interactive) option is in effect, .I rm asks whether to delete each file, and, under .BR \-r , whether to examine each directory. .PP The null option .B \- indicates that all the arguments following it are to be treated as file names. This allows the specification of file names starting with a minus. .PP .I Rmdir removes entries for the named directories, which must be empty. .SH "SEE ALSO" unlink(2) .SH DIAGNOSTICS Generally self-explanatory. It is forbidden to remove the file `..' merely to avoid the antisocial consequences of inadvertently doing something like `rm \-r .*'. , and, under .BR \-r , whether to examine each directory. .PP The null option .B \- indicates that all the arguments following it are to be treated as file names. This allows the specification of file names starting with a minus. .PP .I Rmdir removes entries for the named directories, which must be empty. .SH "SEE ALSO" unlink(2) .SH DIAGNOSTICS Generally self-explanatory. It is forbidden to remove the file `..' merely to avoid the antisocial consequences ofman/man1/rmdir.1 664 0 33 27 2512730526 6604 .so /usr/man/man1/rm.1 mething like `rm \-r .*'. , and, under .BR \-r , whether to examine each directory. .PP The null option .B \- indicates that all the arguments following it are to be treated as file names. This allows the specification of file names starting with a minus. .PP .I Rmdir removes entries for the named directories, which must be empty. .SH "SEE ALSO" unlink(2) .SH DIAGNOSTICS Generally self-explana/( ,( 5pĊ /\@,\D"man/man1/script.1 644 0 33 3467 2512730527 7045 .TH SCRIPT 1 .UC 4 .SH NAME script \- make typescript of terminal session .SH SYNOPSIS .B script [ .B \-a ] [ .B \-q ] [ .B \-S shell ] [ file ] .SH DESCRIPTION .I Script makes a typescript of everything printed on your terminal. The typescript is saved in a file, and can be sent to the line printer later with .I lpr. If a file name is given, the typescript is saved there. If not, the typescript is saved in the file .I typescript. .PP To exit script, type control D. This sends an end of file to all processes you have started up, and causes script to exit. For this reason, control D behaves as though you had typed an infinite number of control D's. .PP This program is useful when using a crt and a hard-copy record of the dialog is desired, as for a student handing in a program that was developed on a crt when hard-copy terminals are in short supply. .PP .B \-S lets you specify the shell to use. The default depends on the system: If the variable SHELL is set in the environment, it is used if possible. .PP The .B \-q flag asks for ``quiet mode'', where the ``script started'' and ``script done'' messages are turned off. The .B \-a flag causes script to append to the typescript file instead of creating a new file. .SH AUTHOR Mark Horton .SH BUGS Since UNIX has no way to write an end-of-file down a pipe without closing the pipe, there is no way to simulate a single control D without ending script. .PP The new shell has its standard input coming from a pipe rather than a tty, so stty will not work, and neither will ttyname. In particular, this means that screen editors such as .IR vi (1) and the job control facilities of .IR csh (1) are inoperative. .PP When the user interrupts a printing process, .I script attempts to flush the output backed up in the pipe for better response. Usually the next prompt also gets flushed. g the pipe, there is no way to simulate a single control D without ending script. .PP The new shell has its standard input coming from a pipe rather than a tty, so stty will not work, and neither will man/man1/sdb.1 644 0 33 24047 2512730527 6326 .TH SDB 1 9/9/80 .UC 4 .SH NAME sdb \- symbolic debugger .SH SYNOPSIS .B sdb [ objfil [ corfil [ directory ] ] ] .SH DESCRIPTION .I Sdb is a symbolic debugger which can be used with C, PASCAL, and F77 programs. It may be used to examine their files and to provide a controlled environment for their execution. .PP .I Objfil is an executable program file which has been compiled with the \-g (debug) option. The default for .I objfil is .B a.out. .I Corfil is assumed to be a core image file produced after executing .IR objfil ; the default for .I corfil is .B core. The core file need not be present. .PP It is useful to know that at any time there is a .I "current line" and .I "current file." If .I corfil exists then they are initially set to the line and file containing the source statement at which the process terminated or stopped. Otherwise, they are set to the first line in main. The current line and file may be changed with the source file examination commands. .PP Names of variables are written just as they are in C, PASCAL, or F77. Variables local to a procedure may be accessed using the form `procedure:variable'. If no procedure name is given, the procedure containing the current line is used by default. It is also possible to refer to structure members as `variable.member', pointers to structure members as `variable\(mi>member' and array elements as `variable[number]'. Combinations of these forms may also be used. .PP It is also possible to specify a variable by its address. All forms of integer constants which are valid in C may be used, so that addresses may be input in decimal, octal or hexadecimal. .PP Line numbers in the source program are referred to as `filename:number' or `procedure:number'. In either case the number is relative to the beginning of the file. If no procedure or file name is given, the current file is used by default. If no number is given, the first line of the named procedure or file is used. .sp 1 .PP The commands for examining data in the program are: .TP 5 .B t Print a stack trace of the terminated or stopped program. .TP 5 .B T Print the top line of the stack trace. .TP 5 variable/\fIlm\fP Print the value of variable according to length .I l and format .I m. If .I l and .I m are omitted, sdb chooses a length and format suitable for the variable's type as declared in the program. The length specifiers are: .RS .TP .BI b one byte .br .ns .TP .BI h two bytes (half word) .br .ns .TP .BI l four bytes (long word) .br .ns .TP number string length for formats .B s and .B a .RE .TP 5 \ Legal values for .I m are: .RS .TP .BI c character .br .ns .TP .BI d decimal .br .ns .TP .BI u decimal, unsigned .br .ns .TP .BI o octal .br .ns .TP .BI x hexadecimal .br .ns .TP .BI f 32 bit single precision floating point .br .ns .TP .BI g 64 bit double precision floating point .br .ns .TP .BI s Assume variable is a string pointer and print characters until a null is reached. .br .ns .TP .BI a Print characters starting at the variable's address until a null is reached. .br .ns .TP .BI p pointer to procedure .RE .TP 5 \ The length specifiers are only effective with the formats \fBd\fP, \fBu\fP, \fBo\fP and \fBx\fP. If one of these formats is specified and .I l is omitted, the length defaults to the word length of the host machine; 4 for the DEC VAX/11-780. The last variable may be redisplayed with the command `./'. .sp The sh(1) metacharacters .B * and .B ? may be used within procedure and variable names, providing a limited form of pattern matching. If no procedure name is given, both variables local to ((the current procedure and global (common for F77) variables are matched, while if a procedure name is specified then only variables local to that procedure and matched. To match only global variables (or blank common for F77), the form `:pattern' is used. The name of a common block may be specified instead of a procedure name for F77 programs. .RE .TP 5 variable\fB=\fP\fIlm\fP .br .ns .TP 5 linenumber\fB=\fP\fIlm\fP .br .ns .TP 5 number\fB=\fP\fIlm\fP Print the address of the variable or line number or the value of the number in the specified format. If no format is given, then `lx' is used. The last variant of this command provides a convenient way to convert between decimal, octal and hexadecimal. .TP 5 variable\fB!\fPvalue Set the variable to the given value. The value may be a number, character constant or a variable. If the variable is of type float or double, the value may also be a floating constant. .sp 1 .PP The commands for examining source files are .TP 5 \fBe\fP procedure .br .ns .TP 5 \fBe\fP filename.c Set the current file to the file containing the named procedure or the named filename. Set the current line to the first line in the named procedure or file. All source files are assumed to be in .I directory. The default for .I directory is the working directory. If no procedure or file name is given, the current procedure and file names are reported. .TP 5 \fB/\fPregular expression\fB/\fP Search forward from the current line for a line containing a string matching the regular expression as in ed(1). The trailing `/' may be elided. .TP 5 \fB?\fPregular expression\fB?\fP Search backward from the current line for a line containing a string matching the regular expression as in ed(1). The trailing `?' may be elided. .TP 5 .B p Print the current line. .TP 5 .B z Print the current line followed by the next 9 lines. Set the current line to the last line printed. .TP 5 .B control-D Scroll. Print the next 10 lines. Set the current line to the last line printed. .TP 5 .B w Window. Print the 10 lines around the current line. .TP 5 number Set the current line to the given line number. Print the new current line. .TP 5 \fIcount\fB +\fR Advance the current line by \fIcount\fP lines. Print the new current line. .TP 5 \fIcount\fB \(mi\fR Retreat the current line by \fIcount\fP lines. Print the new current line. .sp 1 .PP The commands for controlling the execution of the source program are: .TP 5 \fIcount\fB r \fIargs\fR .br .ns .TP 5 \fIcount\fB R Run the program with the given arguments. The \fBr\fP command with no arguments reuses the previous arguments to the program while the \fBR\fP command runs the program with no arguments. An argument beginning with `<' or `>' causes redirection for the standard input or output respectively. If \fIcount\fP is given, it specifies the number of breakpoints to be ignored. .TP 5 \fIlinenumber\fB c\fI count\fR .br .ns .TP 5 \fIlinenumber\fB C\fI count\fR Continue after a breakpoint or interrupt. If \fIcount\fP is given, it specifies the number of breakpoints to be ignored. \fBC\fP continues with the signal which caused the program to stop and \fBc\fP ignores it. .sp 0.5 If a linenumber is specified then a temporary breakpoint is placed at the line and execution is continued. The breakpoint is deleted when the command finishes. .TP 5 \fIcount\fB s\fR Single step. Run the program through \fIcount\fP lines. If no count is given then the program is run for one line. .TP 5 \fIcount\fB S\fR Single step, but step through subroutine calls. .TP 5 .B k Kill the debugged program. .TP 5 procedure\fB(\fParg1,arg2,...\fB)\fP .br .ns .TP 5 procedure\fB(\fParg1,arg2,...\fB)/\fP\fIm\fP Execute the named procedure with the given arguments. Arguments can be integer, character or string constants or names of variables accessible from the current procedure. The second form causes the value returned by the procedure to be printed according to format \fIm\fP. If no format is given, it defaults to `d'. .TP 5 \fIlinenumber\fB b\fR \fIcommands\fR Set a breakpoint at the given line. If a procedure name without a line number is given (e.g. `proc:'), a breakpoint is placed at the first line in the procedure even if it was not compiled with the debug flag. If no \fIlinenumber\fP is given, a breakpoint is placed at the current line. .sp 0.5 If no .I commands are given then execution stops just before the breakpoint and control is returned to sdb. Otherwise the .I commands are executed when the breakpoint is encountered and execution continues. Multiple commands are specified by separating them with semicolons. .TP 5 \fIlinenumber\fB d\fR Delete a breakpoint at the given line. If no \fIlinenumber\fP is given then the breakpoints are deleted interactively: Each breakpoint location is printed and a line is read from the standard input. If the line begins with a `y' or `d' then the breakpoint is deleted. .TP 5 .B B Print a list of the currently active breakpoints. .TP 5 .B D Delete all breakpoints. .TP 5 l Print the last executed line. .TP 5 \fIlinenumber\fB a\fR Announce. If \fIlinenumber\fR is of the form `proc:number', the command effectively does a `linenumber b l'. If \fIlinenumber\fR is of the form `proc:', the command effectively does a `proc: b T'. .sp 1 .PP Miscellaneous commands. .TP 5 \fB! \fIcommand\fR The command is interpreted by sh(1). .TP 5 .B newline If the previous command printed a source line then advance the current line by 1 line and print the new current line. If the previous command displayed a core location then display the next core location. .TP 5 \fB"\fI string\fR Print the given string. .TP 5 .B q Exit the debugger. .sp 1 .PP The following commands also exist and are intended only for debugging the debugger. .TP 5 .B V Print the version number. .TP 5 .B X Print a list of procedures and files being debugged. .TP 5 .B Y Toggle debug output. .SH FILES a.out .br core .SH SEE\ ALSO adb(1) .SH DIAGNOSTICS Error reports are either identical to those of adb(1) or are self-explanatory. .SH BUGS If a procedure is called when the program is .I not stopped at a breakpoint (such as when a core image is being debugged), all variables are initialized before the procedure is started. This makes it impossible to use a procedure which formats data from a core image. .PP Arrays must be of one dimension and of zero origin to be correctly addressed by sdb. .PP The default type for printing F77 parameters is incorrect. Their address is printed instead of their value. .PP Tracebacks containing F77 subprograms with multiple entry points may print too many arguments in the wrong order, but their values are correct. .PP Sdb understands Pascal, but not its types. before the procedure is started. This makes it impossible to use a procedure which formats data from a core image. .PP Arrays must be of one dimension and of zero origin to be correctly addressed by sdb. .PP The default type for printing F77 parameters is incorrect. Their address is printed instead of their value. .PP Tracebacks containing F77 subprograms with multiple entry points may print too many arguments in the wrong order, but their values are correct. .PP Sdb man/man1/sed.1 644 0 33 13302 2512730530 6313 .TH SED 1 .SH NAME sed \- stream editor .SH SYNOPSIS .B sed [ .B \-n ] [ .B \-e script ] [ .B \-f sfile ] [ file ] ... .SH DESCRIPTION .I Sed copies the named .I files (standard input default) to the standard output, edited according to a script of commands. The .B \-f option causes the script to be taken from file .IR sfile ; these options accumulate. If there is just one .B \-e option and no .BR \-f 's, the flag .B \-e may be omitted. The .B \-n option suppresses the default output. .PP A script consists of editing commands, one per line, of the following form: .IP [address [, address] ] function [arguments] .PP In normal operation .I sed cyclically copies a line of input into a .I pattern space (unless there is something left after a `D' command), applies in sequence all commands whose .I addresses select that pattern space, and at the end of the script copies the pattern space to the standard output (except under .BR \-n ) and deletes the pattern space. .PP An .I address is either a decimal number that counts input lines cumulatively across files, a `$' that addresses the last line of input, or a context address, `/regular expression/', in the style of .IR ed (1) modified thus: .IP The escape sequence `\en' matches a newline embedded in the pattern space. .PP A command line with no addresses selects every pattern space. .PP A command line with one address selects each pattern space that matches the address. .PP A command line with two addresses selects the inclusive range from the first pattern space that matches the first address through the next pattern space that matches the second. (If the second address is a number less than or equal to the line number first selected, only one line is selected.) Thereafter the process is repeated, looking again for the first address. .PP Editing commands can be applied only to non-selected pattern spaces by use of the negation function `!' (below). .PP In the following list of functions the maximum number of permissible addresses for each function is indicated in parentheses. .PP An argument denoted .I text consists of one or more lines, all but the last of which end with `\e' to hide the newline. Backslashes in text are treated like backslashes in the replacement string of an `s' command, and may be used to protect initial blanks and tabs against the stripping that is done on every script line. .PP An argument denoted .I rfile or .I wfile must terminate the command line and must be preceded by exactly one blank. Each .I wfile is created before processing begins. There ((can be at most 10 distinct .I wfile arguments. .TP (1)\|a\e .br .ns .TP .I text .br Append. Place .I text on the output before reading the next input line. .TP .RI (2)\|b " label" Branch to the `:' command bearing the .IR label . If .I label is empty, branch to the end of the script. .TP (2)\|c\e .br .ns .TP .I text .br Change. Delete the pattern space. With 0 or 1 address or at the end of a 2-address range, place .I text on the output. Start the next cycle. .TP (2)\|d Delete the pattern space. Start the next cycle. .TP (2)\|D Delete the initial segment of the pattern space through the first newline. Start the next cycle. .TP (2)\|g Replace the contents of the pattern space by the contents of the hold space. .TP (2)\|G Append the contents of the hold space to the pattern space. .TP (2)\|h Replace the contents of the hold space by the contents of the pattern space. .TP (2)\|H Append the contents of the pattern space to the hold space. .TP (1)\|i\e .br .ns .TP .I text .br Insert. Place .I text on the standard output. .TP (2)\|n Copy the pattern space to the standard output. Replace the pattern space with the next line of input. .TP (2)\|N Append the next line of input to the pattern space with an embedded newline. (The current line number changes.) .TP (2)\|p Print. Copy the pattern space to the standard output. .TP (2)\|P Copy the initial segment of the pattern space through the first newline to the standard output. .TP (1)\|q Quit. Branch to the end of the script. Do not start a new cycle. .TP .RI (2)\|r " rfile" Read the contents of .IR rfile . Place them on the output before reading the next input line. .TP .RI (2)\|s /regular\ expression/replacement/flags Substitute the .I replacement string for instances of the .I regular expression in the pattern space. Any character may be used instead of `/'. For a fuller description see .IR ed (1). .I Flags is zero or more of .RS .TP g Global. Substitute for all nonoverlapping instances of the .I regular expression rather than just the first one. .TP p Print the pattern space if a replacement was made. .TP .RI w " wfile" Write. Append the pattern space to .I wfile if a replacement was made. .RE .TP .RI (2)\|t " label" Test. Branch to the `:' command bearing the .I label if any substitutions have been made since the most recent reading of an input line or execution of a `t'. If .I label is empty, branch to the end of the script. .TP .RI (2)\|w " wfile" Write. Append the pattern space to .IR wfile . .TP .RI (2)\|x Exchange the contents of the pattern and hold spaces. .TP .RI (2)\|y /string1/string2/ Transform. Replace all occurrences of characters in .I string1 with the corresponding character in .I string2. The lengths of .I string1 and .I string2 must be equal. .TP .RI (2)! " function" Don't. Apply the .I function (or group, if .I function is `{') only to lines .I not selected by the address(es). .TP .RI (0)\|: " label" This command does nothing; it bears a .I label for `b' and `t' commands to branch to. .TP (1)\|= Place the current line number on the standard output as a line. .TP (2)\|{ Execute the following commands through a matching `}' only when the pattern space is selected. .TP (0)\| An empty command is ignored. .SH SEE ALSO ed(1), grep(1), awk(1), lex(1) .TP .RI (2)! " function" Don't. Apply the .I function (or group, if .I function is `{') only to lines .I not selected by the address(es). .TP .RI (0)\|: " label" This command does nothing; it bears a .I label for `b' and `t' commands to branch to. .TP (1)\|= Place the current line number on the standard output as a lman/man1/see.1 644 0 33 645 2512730530 6262 .TH SEE 1 2/24/79 .UC .SH NAME see \- see what a file has in it .SH SYNOPSIS .B see [ name ... ] .SH DESCRIPTION .I See prints a file which contains non-printing characters in a readable format. Control characters print in the ^\fIx\fR notation, with delete printed as ^?. .PP See is actually just the .B \-v option to .I cat; there are other options, see .IR cat (1). .SH "SEE ALSO" cat(1), ex(1) .SH AUTHOR William Joy /( ,( 5Ċ /\@,\D"man/man1/sh.1 644 0 33 45551 2574145546 6204 .TH SH 1 .SH NAME sh, for, case, if, while, \fB:\fP, \fB.\fP, break, continue, cd, eval, exec, exit, export, login, newgrp, read, readonly, set, shift, times, trap, umask, wait \- command language .SH SYNOPSIS .B sh [ .B \-ceiknrstuvx ] [ arg ] ... .ds OK [\| .ds CK \|] .ds LT \s-2<\s0 .ds GT \s-2>\s0 .ds LE \s-2<\s0 .ds ST * .SH DESCRIPTION .I Sh is a command programming language that executes commands read from a terminal or a file. See .B invocation for the meaning of arguments to the shell. .PP .B Commands. .br A .I simple-command is a sequence of non blank .I words separated by blanks (a blank is a .B tab or a .BR space ). A word that begins with a # introduces a comment; that word and the rest of the line is ignored. .PP The first word of a simple-command specifies the name of the command to be executed. Except as specified below the remaining words are passed as arguments to the invoked command. The command name is passed as argument 0 (see .IR exec (2)). The .I value of a simple-command is its exit status if it terminates normally or 200+\fIstatus\fP if it terminates abnormally (see .IR signal (2) for a list of status values). .LP A .I pipeline is a sequence of one or more .I commands separated by .B \(or. The standard output of each command but the last is connected by a .IR pipe (2) to the standard input of the next command. Each command is run as a separate process; the shell waits for the last command to terminate. .LP A .I list is a sequence of one or more .I pipelines separated by .BR ; , .BR & , .B && or .B \(or\|\(or and optionally terminated by .B ; or .BR & . .B ; and .B & have equal precedence which is lower than that of .B && and .BR \(or\|\(or , .B && and .B \(or\|\(or also have equal precedence. A semicolon causes sequential execution; an ampersand causes the preceding .I pipeline to be executed without waiting for it to finish. The symbol .B && .RB ( \(or\|\(or ) causes the .I list following to be executed only if the preceding .I pipeline returns a zero (non zero) value. Newlines may appear in a .I list, instead of semicolons, to delimit commands. .LP A .I command is either a simple-command or one of the following. The value returned by a command is that of the last simple-command executed in the command. .TP \fBfor \fIname\fR \*(OK\fBin \fIword\fR ...\*(CK \fBdo \fIlist \fBdone\fR Each time a .B for command is executed .I name is set to the next word in the .B for word list If .BI in \ word \&... is omitted then .B in "$@" is assumed. Execution ends when there are no more words in the list. .TP \fBcase \fIword \fBin\fR \*(OK\fIpattern \fR\*(OK \fB\(or \fIpattern \fR\*(CK ... \fB) \fIlist \fB;;\fR\*(CK ... \fBesac\fR A .B case command executes the .I list associated with the first pattern that matches .I word. The form of the patterns is the same as that used for file name generation. .TP \fBif \fIlist \fBthen \fIlist\fR \*(OK\fBelif \fIlist \fBthen \fIlist\fR\*(CK ... \*(OK\fBelse \fIlist\fR\*(CK \fBfi\fR The .I list following .B if is executed and if it returns zero the .I list following .B then is executed. Otherwise, the .I list following .B elif is executed and if its value is zero the .I list following .B then is executed. Failing that the .B else .I list is executed. .TP \fBwhile \fIlist\fR \*(OK\fBdo \fIlist\fR\*(CK \fBdone\fR A .B while command repeatedly executes the .B while .I list and if its value is zero executes the .B do .I list; otherwise the loop terminates. The value returned by a .B while command is that of the last executed command in the .B do .I list. .B until may be used in place of .B while to negate the loop termination test. .TP .BI ( " list " ) Execute .I list in a subshell. .TP .BI { " list " } .I list is simply executed. .LP The following words are only recognized as the first word of a command and when not quoted. .IP .B if then else elif fi case in esac for while until do done { } .PP .B Command substitution. .br The standard output from a command enclosed in a pair of grave accents .RB ( \`\|\` ) may be used as part or all of a word; trailing newlines are removed. .PP .B Parameter substitution. .br The character .B $ is used to introduce substitutable parameters. Positional parameters may be assigned values by .BR set . Variables may be set by writing .IP .IB name = value [ .IB name = value ] ... .TP $\fB\|{\fIparameter\fB\|}\fR A .I parameter is a sequence of letters, digits or underscores (a .IR name ), a digit, or any of the characters .B * @ # ? \- $ !\|. The value, if any, of the parameter is substituted. The braces are required only when .I parameter is followed by a letter, digit, or underscore that is not to be interpreted as part of its name. If .I parameter is a digit then it is a positional parameter. If .I parameter is .BR * " or" " @" then all the positional parameters, starting with .SM .BR $1 , are substituted separated by spaces. .SM .B $0 is set from argument zero when the shell is invoked. .TP $\fB\|{\fIparameter\|\-word\|\fB}\fR If .I parameter is set then substitute its value; otherwise substitute .I word. .TP $\fB\|{\fIparameter\|\(eq\|word\|\fB}\f((R If .I parameter is not set then set it to .I word; the value of the parameter is then substituted. Positional parameters may not be assigned to in this way. .TP $\fB\|{\fIparameter\|?\|word\|\fB}\fR If .I parameter is set then substitute its value; otherwise, print .I word and exit from the shell. If .I word is omitted then a standard message is printed. .TP $\fB\|{\fIparameter\|\(plword\|\fB}\fR If .I parameter is set then substitute .I word; otherwise substitute nothing. .LP In the above .I word is not evaluated unless it is to be used as the substituted string. (So that, for example, echo ${d\-\`pwd\`} will only execute .I pwd if .I d is unset.) .LP The following .I parameters are automatically set by the shell. .RS .TP .B # The number of positional parameters in decimal. .PD 0 .TP .B \- Options supplied to the shell on invocation or by .BR set . .TP .B ? The value returned by the last executed command in decimal. .TP .B $ The process number of this shell. .TP .B ! The process number of the last background command invoked. .PD .RE .LP The following .I parameters are used but not set by the shell. .RS .TP .B .SM HOME The default argument (home directory) for the .B cd command. .PD 0 .TP .B .SM PATH The search path for commands (see .BR execution ). .TP .B .SM MAIL If this variable is set to the name of a mail file then the shell informs the user of the arrival of mail in the specified file. .SM .TP .B PS1 Primary prompt string, by default `$ '. .TP .SM .B PS2 Secondary prompt string, by default `> '. .TP .SM .B IFS Internal field separators, normally .BR space , .BR tab , and .BR newline . .PD .RE .PP .B Blank interpretation. .br After parameter and command substitution, any results of substitution are scanned for internal field separator characters (those found in .SM .BR $IFS \*S) and split into distinct arguments where such characters are found. Explicit null arguments ("" or \'\') are retained. Implicit null arguments (those resulting from .I parameters that have no values) are removed. .PP .B File name generation. .br Following substitution, each command word is scanned for the characters .BR * , .B ? and .B \*(OK. If one of these characters appears then the word is regarded as a pattern. The word is replaced with alphabetically sorted file names that match the pattern. If no file name is found that matches the pattern then the word is left unchanged. The character .B . at the start of a file name or immediately following a .BR / , and the character .BR / , must be matched explicitly. .TP .B \*(ST Matches any string, including the null string. .PD 0 .TP .B ? Matches any single character. .TP .B \*(OK...\*(CK Matches any one of the characters enclosed. A pair of characters separated by .B \- matches any character lexically between the pair. .PD .PP .B Quoting. .br The following characters have a special meaning to the shell and cause termination of a word unless quoted. .LP \fB; & ( ) \(or \*(LT \*(GT newline space tab\fP .LP A character may be .I quoted by preceding it with a .B \\\|. .B \\\\newline is ignored. All characters enclosed between a pair of quote marks (\fB\'\|\'\fP), except a single quote, are quoted. Inside double quotes (\fB"\|"\fP) parameter and command substitution occurs and .B \\ quotes the characters .B \\ \` " and .BR $ \|. .LP .B "$*" is equivalent to .SM .B "$1 $2 ..." whereas .br .B "$@" is equivalent to .SM .B "$1" "$2" ... . .PP .B Prompting. .br When used interactively, the shell prompts with the value of .SM PS1 before reading a command. If at any time a newline is typed and further input is needed to complete a command then the secondary prompt .RB ( \s-2$PS2\s0 ) is issued. .PP .B Input output. .br Before a command is executed its input and output may be redirected using a special notation interpreted by the shell. The following may appear anywhere in a simple-command or may precede or follow a .I command and are not passed on to the invoked command. Substitution occurs before .I word or .I digit is used. .TP \*(LT\fI\|word\fP Use file .I word as standard input (file descriptor 0). .PD .TP \*(GT\fI\|word\fP Use file .I word as standard output (file descriptor 1). If the file does not exist then it is created; otherwise it is truncated to zero length. .TP \*(GT\*(GT\fI\|word\fP Use file .I word as standard output. If the file exists then output is appended (by seeking to the end); otherwise the file is created. .TP \*(LT\*(LT\fI\|word\fP The shell input is read up to a line the same as .IR word , or end of file. The resulting document becomes the standard input. If any character of .I word is quoted then no interpretation is placed upon the characters of the document; otherwise, parameter and command substitution occurs, .B \\newline is ignored, and .B \\ is used to quote the characters .B \\ $ \` and the first character of .I word. .TP \*(LT\|&\|\fIdigit\fP The standard input is duplicated from file descriptor .I digit; see .IR dup (2). Similarly for the standard output using \*(GT\|. .TP \*(LT\|&\|\- The standard input is closed. Similarly for the standard output using \*(GT\|. .PD .LP If one of the above is preceded by a digit then the file descriptor created is that specified by the digit (instead of the default 0 or 1). For example, .LP \&... 2\*(GT&1 .LP creates file descriptor 2 to be a duplicate of file descriptor 1. .LP If a command is followed by .B & then the default standard input for the command is the empty file (/dev/null). Otherwise, the environment for the execution of a command contains the file descriptors of the invoking shell as modified by input output specifications. .PP .B Environment. .br The environment is a list of name-value pairs that is passed to an executed program in the same way as a normal argument list; see .IR exec (2) and .IR environ (5). The shell interacts with the environment in several ways. On invocation, the shell scans the environment and creates a .I parameter for each name found, giving it the corresponding value. Executed commands inherit the same environment. If the user modifies the values of these .I parameters or creates new ones, none of these affects the environment unless the .B export command is used to bind the shell's .I parameter to the environment. The environment seen by any executed command is thus composed of any unmodified name-value pairs originally inherited by the shell, plus any modifications or additions, all of which must be noted in .B export commands. .LP The environment for any .I simple-command may be augmented by prefixing it with one or more assignments to .I parameters. Thus these two lines are equivalent .IP TERM=450 cmd args .br (export TERM; TERM=450; cmd args) .LP If the .B \-k flag is set, .I all keyword arguments are placed in the environment, even if the occur after the command name. The following prints `a=b c' and `c': .nf echo a=b c set \-k echo a=b c .fi .PP .B Signals. .br The INTERRUPT and QUIT signals for an invoked command are ignored if the command is followed by .BR & ; otherwise signals have the values inherited by the shell from its parent. (But see also .BR trap. ) .PP .B Execution. .br Each time a command is executed the above substitutions are carried out. Except for the `special commands' listed below a new process is created and an attempt is made to execute the command via an .IR exec (2). .LP The shell parameter .B .SM $PATH defines the search path for the directory containing the command. Each alternative directory name is separated by a colon .RB ( : ). The default path is .BR :/bin:/usr/bin . If the command name contains a / then the search path is not used. Otherwise, each directory in the path is searched for an executable file. If the file has execute permission but is not an .I a.out file, it is assumed to be a file containing shell commands. A subshell (i.e., a separate process) is spawned to read it. A parenthesized command is also executed in a subshell. .PP .B Special commands. .br The following commands are executed in the shell process and except where specified no input output redirection is permitted for such commands. .TP .B : No effect; the command does nothing. .PD 0 .TP .BI . \ file Read and execute commands from .I file and return. The search path .B .SM $PATH is used to find the directory containing .IR file . .TP \fBbreak\fR \*(OK\fIn\fR\*(CK Exit from the enclosing .B for or .B while loop, if any. If .I n is specified then break .I n levels. .TP \fBcontinue\fR \*(OK\fIn\fR\*(CK Resume the next iteration of the enclosing .B for or .B while loop. If .I n is specified then resume at the .IR n -th enclosing loop. .TP \fBcd\fR \*(OK\fIarg\fR\*(CK Change the current directory to .I arg. The shell parameter .B .SM $HOME is the default .IR arg . .TP \fBeval\fR \*(OK\fIarg \fR...\*(CK The arguments are read as input to the shell and the resulting command(s) executed. .TP \fBexec\fR \*(OK\fIarg \fR...\*(CK The command specified by the arguments is executed in place of this shell without creating a new process. Input output arguments may appear and if no other arguments are given cause the shell input output to be modified. .TP \fBexit\fR \*(OK\fIn\fR\*(CK Causes a non interactive shell to exit with the exit status specified by .I n. If .I n is omitted then the exit status is that of the last command executed. (An end of file will also exit from the shell.) .TP \fBexport\fR \*(OK\fIname\fR ...\*(CK The given names are marked for automatic export to the .I environment of subsequently-executed commands. If no arguments are given then a list of exportable names is printed. .TP \fBlogin\fR \*(OK\fIarg\fR ...\*(CK Equivalent to `exec login arg ...'. .TP \fBnewgrp\fR \*(OK\fIarg \fR...\*(CK Equivalent to `exec newgrp arg ...'. .TP .BI read \ name\ ... One line is read from the standard input; successive words of the input are assigned to the variables .I name in order, with leftover words to the last variable. The return code is 0 unless the end-of-file is encountered. .TP \fBreadonly\fR \*(OK\fIname \fR...\*(CK The given names are marked readonly and the values of the these names may not be changed by subsequent assignment. If no arguments are given then a list of all readonly ((names is printed. .TP \fBset\fR \*(OK\fB\-eknptuvx\fR \*(OK\fIarg \fR...\*(CK\*(CK .RS .PD 0 .TP 3m .B \-e If non interactive then exit immediately if a command fails. .TP .B \-k All keyword arguments are placed in the environment for a command, not just those that precede the command name. .TP .B \-n Read commands but do not execute them. .TP .B \-t Exit after reading and executing one command. .TP .B \-u Treat unset variables as an error when substituting. .TP .B \-v Print shell input lines as they are read. .TP .B \-x Print commands and their arguments as they are executed. .TP .B \- Turn off the .B \-x and .B \-v options. .PD .LP These flags can also be used upon invocation of the shell. The current set of flags may be found in .BR $\- . .LP Remaining arguments are positional parameters and are assigned, in order, to .SM .BR $1 , .SM .BR $2 , etc. If no arguments are given then the values of all names are printed. .RE .TP .B shift The positional parameters from .SM .BR $2 ... are renamed .SM .BR $1 ... .TP .B times Print the accumulated user and system times for processes run from the shell. .TP \fBtrap\fR \*(OK\fIarg\fR\*(CK \*(OK\fIn\fR\*(CK ... .I Arg is a command to be read and executed when the shell receives signal(s) .I n. (Note that .I arg is scanned once when the trap is set and once when the trap is taken.) Trap commands are executed in order of signal number. If .I arg is absent then all trap(s) .I n are reset to their original values. If .I arg is the null string then this signal is ignored by the shell and by invoked commands. If .I n is 0 then the command .I arg is executed on exit from the shell, otherwise upon receipt of signal .I n as numbered in .IR signal (2). .I Trap with no arguments prints a list of commands associated with each signal number. .TP \fBumask \fR[ \fInnn\fR ] The user file creation mask is set to the octal value .I nnn (see .IR umask (2)). If .I nnn is omitted, the current value of the mask is printed. .TP \fBwait\fP \*(OK\fIn\fP\*(CK Wait for the specified process and report its termination status. If .I n is not given then all currently active child processes are waited for. The return code from this command is that of the process waited for. .PD .LP .PP .B Invocation. .br If the first character of argument zero is .BR \- , commands are read from .BR \s-2$HOME\s0/.\|profile , if such a file exists. Commands are then read as described below. The following flags are interpreted by the shell when it is invoked. .PD 0 .TP 11n .BI \-c \ string If the .B \-c flag is present then commands are read from .I string\|. .TP 11n .B \-s If the .B \-s flag is present or if no arguments remain then commands are read from the standard input. Shell output is written to file descriptor 2. .TP 11n .B \-i If the .B \-i flag is present or if the shell input and output are attached to a terminal (as told by .IR gtty ) then this shell is .I interactive. In this case the terminate signal SIGTERM (see .IR signal (2)) is ignored (so that `kill 0' does not kill an interactive shell) and the interrupt signal SIGINT is caught and ignored (so that .B wait is interruptable). In all cases SIGQUIT is ignored by the shell. .PD .LP The remaining flags and arguments are described under the .B set command. .SH FILES .RB $HOME/ . \^profile .br /tmp/sh* .br /dev/null .SH SEE ALSO csh(1), test(1), exec(2), .SH DIAGNOSTICS Errors detected by the shell, such as syntax errors cause the shell to return a non zero exit status. If the shell is being used non interactively then execution of the shell file is abandoned. Otherwise, the shell returns the exit status of the last command executed (see also .BR exit ). .SH BUGS IF \*(LT\*(LT is used to provide standard input to an asynchronous process invoked by &, the shell gets mixed up about naming the input document. A garbage file /tmp/sh* is created, and the shell complains about not being able to find the file by another name. ors cause the shell to return a non zero exit status. If the shell is being used non interactively then execution of the shell file is abandoned. Otherman/man1/size.1 644 0 33 514 2512730532 6455 .TH SIZE 1 VAX-11 .SH NAME size \- size of an object file .SH SYNOPSIS .B size [ object ... ] .SH DESCRIPTION .I Size prints the (decimal) number of bytes required by the text, data, and bss portions, and their sum in hex and decimal, of each object-file argument. If no file is specified, .B a.out is used. .SH "SEE ALSO" a.out(5) nd the file by another name. ors cause the shell to return a non zero exit status. If th/( ,( 5ЌĊ /\@,\D"man/man1/sleep.1 644 0 33 711 2512730533 6613 .TH SLEEP 1 .SH NAME sleep \- suspend execution for an interval .SH SYNOPSIS .B sleep time .SH DESCRIPTION .I Sleep suspends execution for .I time seconds. It is used to execute a command after a certain amount of time as in: .PP (sleep 105; command)& .PP or to execute a command every so often, as in: .PP while true .br do .br command .br sleep 37 .br done .SH "SEE ALSO" alarm(2), sleep(3) .SH BUGS .I Time must be less than 2147483647 seconds. Ċ /\@,\D"man/man1/soelim.1 644 0 33 1630 2512730533 7014 .TH SOELIM 1 2/24/79 .UC .SH NAME soelim \- eliminate \&.so's from nroff input .SH SYNOPSIS .B soelim [ file ... ] .SH DESCRIPTION .I Soelim reads the specified files or the standard input and performs the textual inclusion implied by the .I nroff directives of the form .PP .DT \&.so somefile .PP when they appear at the beginning of input lines. This is useful since programs such as .I tbl do not normally do this; it allows the placement of individual tables in separate files to be run as a part of a large document. .PP Note that inclusion can be suppressed by using `\'' instead of `\.', i.e. .PP .DT \'so /usr/lib/tmac.s .PP A sample usage of .I soelim would be .PP soelim exum?.n | tbl | nroff \-ms | col | lpr .SH SEE\ ALSO colcrt(1), more(1) .SH AUTHOR William Joy .SH BUGS The format of the source commands must involve no strangeness \- exactly one blank must precede and no blanks follow the file name. y do this; it allows the placement of individual tables in separate files to be run as a part of a largeman/man1/sort.1 644 0 33 7265 2512730534 6526 .TH SORT 1 .SH NAME sort \- sort or merge files .SH SYNOPSIS .B sort [ .if t \fB\-mubdf\&inrt\fIx\fR .if n -mubdfinrt_________x ] [ \fB+\fIpos1 \fR [ \fB\-\fIpos2 \fR] ] ... [ .B \-o name ] [ .B \-T directory ] [ name ] ... .SH DESCRIPTION .I Sort sorts lines of all the named files together and writes the result on the standard output. The name `\-' means the standard input. If no input files are named, the standard input is sorted. .PP The default sort key is an entire line. Default ordering is lexicographic by bytes in machine collating sequence. The ordering is affected globally by the following options, one or more of which may appear. .TP 5 .B b Ignore leading blanks (spaces and tabs) in field comparisons. .TP 5 .B d `Dictionary' order: only letters, digits and blanks are significant in comparisons. .TP 5 .B f Fold upper case letters onto lower case. .TP 5 .B i Ignore characters outside the ASCII range 040-0176 in nonnumeric comparisons. .TP 5 .B n An initial numeric string, consisting of optional blanks, optional minus sign, and zero or more digits with optional decimal point, is sorted by arithmetic value. Option .B n implies option .B b. .TP 5 .B r Reverse the sense of comparisons. .TP 5 .BI t x `Tab character' separating fields is .IR x . .PP The notation .BI + "pos1 " "\-\fIpos2" restricts a sort key to a field beginning at .I pos1 and ending just before .IR pos2 . .I Pos1 and .I pos2 each have the form .IB m . n\fR, optionally followed by one or more of the flags .B bdf\&inr, where .I m tells a number of fields to skip from the beginning of the line and .I n tells a number of characters to skip further. If any flags are present they override all the global ordering options for this key. If the .B b option is in effect .I n is counted from the first nonblank in the field; .B b is attached independently to .IR pos2 . A missing \&\fB.\fIn\fR means .0; a missing .BI \- pos2 means the end of the line. Under the .BI \-t x option, fields are strings separated by .IR x ; otherwise fields are(( nonempty nonblank strings separated by blanks. .PP When there are multiple sort keys, later keys are compared only after all earlier keys compare equal. Lines that otherwise compare equal are ordered with all bytes significant. .PP These option arguments are also understood: .TP 5 .B c Check that the input file is sorted according to the ordering rules; give no output unless the file is out of sort. .TP 5 .B m Merge only, the input files are already sorted. .TP 5 .B o The next argument is the name of an output file to use instead of the standard output. This file may be the same as one of the inputs. .TP 5 .B T The next argument is the name of a directory in which temporary files should be made. .TP 5 .B u Suppress all but one in each set of equal lines. Ignored bytes and bytes outside keys do not participate in this comparison. .PP .B Examples. Print in alphabetical order all the unique spellings in a list of words. Capitalized words differ from uncapitalized. .PP .ti +8 sort \-u +0f +0 list .PP Print the password file .RI ( passwd (5)) sorted by user id number (the 3rd colon-separated field). .PP .ti +8 sort \-t: +2n /etc/passwd .PP Print the first instance of each month in an already sorted file of (month day) entries. The options .B \-um with just one input file make the choice of a unique representative from a set of equal lines predictable. .PP .ti +8 sort \-um +0 \-1 dates .SH FILES /usr/tmp/stm*, /tmp/* first and second tries for temporary files .SH "SEE ALSO" uniq(1), comm(1), rev(1), join(1) .SH DIAGNOSTICS Comments and exits with nonzero status for various trouble conditions and for disorder discovered under option .BR \-c . .SH BUGS Very long lines are silently truncated. eady sorted file of (month day) entries. The options .B \-um with just one input file make the choice of a unique representative from a set of equal lines predictable. .PP .ti +8 sort \-um +0 \-1 dates .SH FILES /usr/tmp/stm*, /tmp/* first and second tries for temporary files .SH "SEE ALSO" uniq(1), comm(1), rev(1), join(1) .SH Dman/man1/spell.1 644 0 33 4722 2512730534 6651 .TH SPELL 1 .SH NAME spell, spellin, spellout \- find spelling errors .SH SYNOPSIS .B spell [ option ] ... [ file ] ... .PP .B spellin [ list ] .PP .B spellout [ .B \-d ] list .SH DESCRIPTION .I Spell collects words from the named documents, and looks them up in a spelling list. Words that neither occur among nor are derivable (by applying certain inflections, prefixes or suffixes) from words in the spelling list are printed on the standard output. If no files are named, words are collected from the standard input. .PP .I Spell ignores most .I troff, .I tbl and .IR eqn (1) constructions. .PP Under the .B \-v option, all words not literally in the spelling list are printed, and plausible derivations from spelling list words are indicated. .PP Under the .B \-b option, British spelling is checked. Besides preferring .ft I centre, colour, speciality, travelled, .ft R etc., this option insists upon .I -ise in words like .I standardise, Fowler and the OED to the contrary notwithstanding. .PP Under the .B \-x option, every plausible stem is printed with `=' for each word. .PP The spelling list is based on many sources, and while more haphazard than an ordinary dictionary, is also more effective in respect to proper names and popular technical words. Coverage of the specialized vocabularies of biology, medicine and chemistry is light. .PP Pertinent auxiliary files may be specified by name arguments, indicated below with their default settings. Copies of all output are accumulated in the history file. The stop list filters out misspellings (e.g. thier=thy\-y+ier) that would otherwise pass. .PP Two routines help maintain the hash lists used by .I spell. Both expect a list of words, one per line, from the standard input. .I Spellin adds the words on the standard input to the preexisting .I list and places a new list on the standard output. If no .I list is specified, the new list is created from scratch. .I Spellout looks up each word in the standard input and prints on the standard output those that are missing from (or present on, with option .BR \-d ) the hash list. .SH FILES D=/usr/dict/hlist[ab]: hashed spelling lists, American & British .br S=/usr/dict/hstop: hashed stop list .br H=/usr/dict/spellhist: history file .br /usr/lib/spell .br deroff(1), sort(1), tee(1), sed(1) .SH BUGS The spelling list's coverage is uneven; new installations will probably wish to monitor the output for several months to gather local additions. .br British spelling was done by an American. standard output those that are missing from (man/man1/spline.1g 644 0 33 6447 2512730534 7201 .TH SPLINE 1G .SH NAME spline \- interpolate smooth curve .SH SYNOPSIS .B spline [ option ] ... .SH DESCRIPTION .I Spline takes pairs of numbers from the standard input as abcissas and ordinates of a function. It produces a similar set, which is approximately equally spaced and includes the input set, on the standard output. The cubic spline output (R. W. Hamming, .ft I Numerical Methods for Scientists and Engineers, .ft R 2nd ed., 349ff) has two continuous derivatives, and sufficiently many points to look smooth when plotted, for example by .IR graph (1). .PP The following options are recognized, each as a separate argument. .TP 5 .B \-a Supply abscissas automatically (they are missing from the input); spacing is given by the next argument, or is assumed to be 1 if next argument is not a number. .TP 5 .B \-k The constant .IR k "" used in the boundary value computation .IP .if n .ig .ti +1.5i .ds ' \h'-\w'\(fm\(fm'u' .EQ .nr 99 \n(.s .nr 98 \n(.f 'ps 10 .ft I .ds 11 "y\(fm\(fm .nr 11 \w'\*(11' .ds 12 "\*' .nr 12 \w'\*(12' 'ps 8 .ds 13 "\fR0\fP .nr 13 \w'\*(13' .as 12 \v'18u'\s8\*(13\|\s10\v'-18u' 'ps 10 .nr 12 \n(12+\n(13+\w'\s8\|' .as 11 "\*(12 .nr 11 \w'\*(11' .ds 12 "\|\| .nr 12 \w'\*(12' .as 11 "\*(12 .nr 11 \w'\*(11' .ds 12 "\|=\| .nr 12 \w'\*(12' .as 11 "\*(12 .nr 11 \w'\*(11' .ds 12 "\|\| .nr 12 \w'\*(12' .as 11 "\*(12 .nr 11 \w'\*(11' .ds 12 "ky\(fm\(fm .nr 12 \w'\*(12' .as 11 "\*(12 .nr 11 \w'\*(11' .ds 12 "\*' .nr 12 \w'\*(12' 'ps 8 .ds 13 "\fR1\fP .nr 13 \w'\*(13' .as 12 \v'18u'\s8\*(13\|\s10\v'-18u' 'ps 10 .nr 12 \n(12+\n(13+\w'\s8\|' .as 11 "\*(12 .nr 11 \w'\*(11' .ds 12 ", .nr 12 \w'\*(12' .as 11 "\*(12 .nr 11 \w'\*(11' .ds 12 "\|\| .nr 12 \w'\*(12' .as 11 "\*(12 .nr 11 \w'\*(11' .ds 12 "\|\| .nr 12 \w'\*(12' .as 11 "\*(12 .nr 11 \w'\*(11' .ds 12 "\|\| .nr 12 \w'\*(12' .as 11 "\*(12 .nr 11 \w'\*(11' .ds 12 "y\(fm\(fm .nr 12 \w'\*(12' .as 11 "\*(12 .nr 11 \w'\*(11' .ds 12 "\*' .nr 12 \w'\*(12' 'ps 8 .ds 13 "n .nr 13 \w'\*(13' .as 12 \v'18u'\s8\*(13\|\s10\v'-18u' 'ps 10 .nr 12 \n(12+\n(13+\w'\s8\|' .as 11 "\*(12 .nr 11 \w'\*(11' .ds 12 "\|\| .nr 12 \w'\*(12' .as 11 "\*(12 .nr 11 \w'\*(11' .ds 12 "\|=\| .nr 12 \w'\*(12' .as 11 "\*(12 .nr 11 \w'\*(11' .ds 12 "\|\| .nr 12 \w'\*(12' .as 11 "\*(12 .nr 11 \w'\*(11' .ds 12 "ky\(fm\(fm .nr 12 \w'\*(12' .as 11 "\*(12 .nr 11 \w'\*(11' .ds 12 "\*' .nr 12 \w'\*(12' 'ps 8 .ds 13 "n\|\(mi\|\fR1\fP .nr 13 \w'\*(13' .as 12 \v'18u'\s8\*(13\|\s10\v'-18u' 'ps 10 .nr 12 \n(12+\n(13+\w'\s8\|' .as 11 "\*(12 .nr 11 \w'\*(11' .ds 11 \x'0'\fI\*(11\s\n(99\f\n(98 .ne 78u \*(11 'ps \n(99 .ft \n(98 .EN .. .if t .ig .ce (2nd deriv. at end) = k*(2nd deriv. next to end) .. .IP .br is set by the next argument. By default .IR k "" = 0. .TP 5 .B \-n Space output points so that approximately .I n intervals occur between the lower and upper .I x limits. (Default .I n = 100.) .TP 5 .B \-p Make output periodic, i.e. match derivatives at ends. First and last input values should normally agree. .TP 5 .B \-x Next 1 (or 2) arguments are lower (and upper) .I x limits. Normally these limits are calculated from the data. Automatic abcissas start at lower limit (default 0). .SH "SEE ALSO" graph(1) .SH DIAGNOSTICS When data is not strictly monotone in .I x, .I spline reproduces the input without interpolating extra points. .SH BUGS A limit of 1000 input points is enforced silently. ) .TP 5 .B \-p Make output periodic, i.e. match derivatives at ends. First and last input values should normally agree. .TP 5 .B \-x Next 1 (or 2) arguments are lower (and upper) .I x limits. Normally these limitsman/man1/split.1 644 0 33 760 2512730534 6643 .TH SPLIT 1 .SH NAME split \- split a file into pieces .SH SYNOPSIS .B split [ .B \-\fIn ] [ file [ name ] ] .SH DESCRIPTION .I Split reads .I file and writes it in .IR n -line pieces (default 1000), as many as necessary, onto a set of output files. The name of the first output file is .I name with .B aa appended, and so on lexicographically. If no output name is given, .B x is default. .PP If no input file is given, or if .B \- is given in its stead, then the standard input file is used. ,\D"((man/man1/ssp.1 644 0 33 272 2512730535 6314 .pl 1 The ``ssp'' command is obsolete. Use the ``-s'' (single space) option to the ``cat'' command instead. Thus ``nroff -ms foo.n | ssp'' is replaced by ``nroff -ms foo.n | cat -s''. default 1000), as many as necessary, onto a set of output files. The name of the first output file is .I name with .B aa appended, and so on lexicographically. If no output name is given, .B x is default. .PP If no input file is give/( ,( 5@Ċ /\@,\D"man/man1/strings.1 644 0 33 1463 2512730535 7223 .TH STRINGS 1 2/24/79 .UC .SH NAME strings \- find the printable strings in a object, or other binary, file .SH SYNOPSIS .B strings [ .B \- ] [ .B \-o ] [ \fB\-\fInumber\fR ] file ... .SH DESCRIPTION .I Strings looks for ascii strings in a binary file. A string is any sequence of 4 or more printing characters ending with a newline or a null. Unless the .B \- flag is given, .I strings only looks in the initialized data space of object files. If the .B \-o flag is given, then each string is preceded by its offset in the file (in octal). If the \fB\-\fInumber\fR flag is given then number is used as the minimum string length rather than 4. .PP .I Strings is useful for identifying random object files and many other things. .SH "SEE ALSO" od(1) .SH BUGS The algorithm for identifying strings is extremely primitive ers ending with a newline or a null. Unless the .B \- flag is given, .I strings only looks in the initialized data space of object files. If the .B \-o flag is given, then each string is preceded by its ofman/man1/strip.1 644 0 33 655 2512730535 6655 .TH STRIP 1 .SH NAME strip \- remove symbols and relocation bits .SH SYNOPSIS .B strip name ... .SH DESCRIPTION .I Strip removes the symbol table and relocation bits ordinarily attached to the output of the assembler and loader. This is useful to save space after a program has been debugged. .PP The effect of .I strip is the same as use of the .B \-s option of .IR ld . .SH FILES /tmp/stm? temporary file .SH "SEE ALSO" ld(1)  ,( 5`Ċ /\@,\D"man/man1/struct.1 644 0 33 4663 2512730535 7063 .TH STRUCT 1 .SH NAME struct \- structure Fortran programs .SH SYNOPSIS .B struct [ option ] ... file .SH DESCRIPTION .LP .I Struct translates the Fortran program specified by .I file (standard input default) into a Ratfor program. Wherever possible, Ratfor control constructs replace the original Fortran. Statement numbers appear only where still necessary. Cosmetic changes are made, including changing Hollerith strings into quoted strings and relational operators into symbols (.e.g. ".GT." into ">"). The output is appropriately indented. .PP The following options may occur in any order. .TP .B \-s Input is accepted in standard format, i.e. comments are specified by a c, C, or * in column 1, and continuation lines are specified by a nonzero, nonblank character in column 6. Normally input is in the form accepted by .IR f77 (1) .TP .B \-i Do not turn computed goto statements into switches. (Ratfor does not turn switches back into computed goto statements.) .TP .B \-a Turn sequences of else ifs into a non-Ratfor switch of the form .IP .nf .ta 5 7 switch { case pred1: code case pred2: code case pred3: code default: code } .fi .DT .IP The case predicates are tested in order; the code appropriate to only one case is executed. This generalized form of switch statement does not occur in Ratfor. .TP .B \-b Generate goto's instead of multilevel break statements. .TP .B \-n Generate goto's instead of multilevel next statements. .TP .BI \-t n Make the nonzero integer .I n the lowest valued label in the output program (default 10). .TP .BI \-c n Increment successive labels in the output program by the nonzero integer .I n (default 1). .TP .BI \-e n If .I n is 0 (default), place code within a loop only if it can lead to an iteration of the loop. If .I n is nonzero, admit a small code segments to a loop if otherwise the loop would have exits to several places including the segment, and the segment can be reached only from the loop. `Small' is close to, but not equal to, the number of statements in the code segment. Values of n under 10 are suggested. .SH FILES /tmp/struct* .br /usr/lib/struct/* .SH SEE ALSO f77(1) .SH BUGS Struct knows Fortran 66 syntax, but not full Fortran 77. .br If an input Fortran program contains identifiers which are reserved words in Ratfor, the structured version of the program will not be a valid Ratfor program. .br The labels generated cannot go above 32767. .br If you get a goto without a target, try .B \-e . ll' is close to, but not equal to, the number of statements in the code segmeman/man1/stty.1 644 0 33 17756 2531446136 6573 .TH STTY 1 5/11/81 .UC 4 .SH NAME stty \- set terminal options .SH SYNOPSIS .B stty [ option ... ] .SH DESCRIPTION .I Stty sets certain I/O options on the current output terminal, 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. With the argument ``all'', all normally used option settings are reported. With the argument ``everything'', everything .I stty knows about is printed. The option strings are selected from the following set: .TP 10 .B even allow even parity input .br .ns .TP 10 .B \-even disallow even parity input .br .ns .TP 10 .B odd allow odd parity input .br .ns .TP 10 .B \-odd disallow odd parity input .br .ns .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 .br .ns .TP 10 .B cooked same as `\-raw' .br .ns .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 .br .ns .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 .br .ns .TP 10 .B echo echo back every character typed .br .ns .TP 10 .B \-echo do not echo characters .br .ns .TP 10 .B lcase map upper case to lower case .br .ns .TP 10 .B \-lcase do not map case .br .ns .TP 10 .B tandem enable 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 flow control .br .ns .TP 10 .B \-tabs replace tabs by spaces when printing .br .ns .TP 10 .B tabs preserve tabs .br .ns .TP 10 .B ek set erase and kill characters to # and @ .br .ns .PP For the following commands which take a character argument \fIc\fR, you may also specify \fIc\fR as the ``u'' or ``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 extra wakeup causing(( character. .br .ns .TP 10 .B cr0 cr1 cr2 cr3 .br select style of delay for carriage return (see .IR ioctl (2)) .br .ns .TP 10 .B nl0 nl1 nl2 nl3 .br select style of delay for linefeed .br .ns .TP 10 .B tab0 tab1 tab2 tab3 .br select style of delay for tab .br .ns .TP 10 .B ff0 ff1 select style of delay for form feed .br .ns .TP 10 .B bs0 bs1 select style of delay for backspace .br .TP 10 .B tty33 set all modes suitable for the Teletype Corporation Model 33 terminal. .br .ns .TP 10 .B tty37 set all modes suitable for the Teletype Corporation Model 37 terminal. .br .ns .TP 10 .B vt05 set all modes suitable for Digital Equipment Corp. VT05 terminal .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 tn300 set all modes suitable for a General Electric TermiNet 300 .br .ns .TP 10 .B ti700 set all modes suitable for Texas Instruments 700 series terminal .br .ns .TP 10 .B tek set all modes suitable for Tektronix 4014 terminal .br .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). .PP A teletype driver which supports the job control processing of .IR csh (1) as introduced in .IR newcsh (1) and more functionality that the basic driver is introduced in .IR newtty (4) and 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.) .br .ns .TP 10 .B crtbs Echo backspaces on erase characters. .br .ns .TP 10 .B prterase For printing terminal echo erased characters backwards within ``\e'' and ``/''. .br .ns .TP 10 .B crterase Wipe out erased characters with ``backspace-space-backspace.'' .br .ns .TP 10 .B \-crterase Leave erased characters visible; just backspace. .br .ns .TP 10 .B crtkill Wipe out input on like kill ala .B crterase. .br .ns .TP 10 .B \-crtkill Just echo line kill character and a newline on line kill. .br .ns .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. .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.) .br .ns .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. .br .ns .TP 10 .B tilde Convert ``~'' to ``\`'' on output (for Hazeltine terminals). .br .ns .TP 10 .B \-tilde Leave poor ``~'' alone. .br .ns .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. .br .ns .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. .br .ns .TP 10 .B intrup Send a signal (SIGTINT) to the terminal control process group whenever an input record (line in cooked mode, character in cbreak or raw mode) is available for reading. .br .ns .TP 10 .B \-intrup Don't send input available interrupts. .br .ns .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. .br .ns .TP 10 .B litout Send output characters without any processing. .br .ns .TP 10 .B \-litout Do normal output processing, inserting delays, etc. .br .ns .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. .br .ns .TP 10 .B etxack Diablo style etx/ack handshaking (not implemented). .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.) .SH "SEE ALSO" ioctl(2), tabs(1), tset(1), newtty(4), tty(4) .BI dsusp \ c\fR man/man1/style.1 644 0 33 2506 2512730536 6672 .TH STYLE 1 .SH NAME style \- analyze surface characteristics of a document .SH SYNOPSIS .B style [ .B \-ml ] [ .B \-mm ] [ .B \-a ] [ .B \-e ] [ .B \-l num ] [ .B \-r num ] [ .B \-p ] [ .B \-P ] file ... .LP .SH DESCRIPTION .I Style analyzes the surface characteristics of the writing style of a document. It reports on readability, sentence length and structure, word length and usage, verb type, and sentence openers. Because .I style runs .I deroff before looking at the text, formatting header files should be included as part of the input. The default macro package .B \-ms may be overridden with the flag .B \-mm. The flag .BR \-ml , which causes .B deroff to skip lists, should be used if the document contains many lists of non-sentences. The other options are used to locate sentences with certain characteristics. .TP .B \-a print all sentences with their length and readability index. .TP .B \-e print all sentences that begin with an expletive. .TP .B \-p print all sentences that contain a passive verb. .TP .BI \-l num print all sentences longer than .IR num . .TP .BI \-r num print all sentences whose readability index is greater than .IR num . .TP .B \-P print parts of speech of the words in the document. .SH "SEE ALSO" deroff(1), diction(1) .SH BUGS Use of non-standard formatting macros may cause incorrect sentence breaks. a print all sentences with their length and readability index. .TP .B \-e print all sentences that begin with an expletive. .TP .B \-p print all sentences that contain a passive verb. .Tman/man1/su.1 644 0 33 1477 2512730536 6167 .TH SU 1 11/16/79 .UC .SH NAME su \- substitute user id temporarily .SH SYNOPSIS .B su [ userid ] .SH DESCRIPTION .I Su demands the password of the specified .I userid, and if it is given, changes to that .I userid and invokes the Shell .IR sh (1) without changing the current directory. The user environment is unchanged except for HOME and SHELL, which are taken from the password file for the user being substituted (see .IR environ (5)). The new user ID stays in force until the Shell exits. .PP If no .I userid is specified, `root' is assumed. To remind the super-user of his responsibilities, the Shell substitutes `#' for its usual prompt. .SH "SEE ALSO" sh(1) .SH BUGS Local administrative rules cause restrictions to be placed on who can .I su to `root', even with the root password. These rules vary from site to site. ged except for HOME and SHELL, which are taken from the password file for the user being substituted (see .IR environ (5)). The new user ID stays in force until the Shell exits. .PP If no .I uman/man1/sum.1 644 0 33 703 2512730537 6314 .TH SUM 1 .SH NAME sum \- sum and count blocks in a file .SH SYNOPSIS .B sum file .SH DESCRIPTION .I Sum calculates and prints a 16-bit checksum for the named file, and also prints the number of blocks in the file. It is typically used to look for bad spots, or to validate a file communicated over some transmission line. .SH "SEE ALSO" wc(1) .SH DIAGNOSTICS `Read error' is indistinuishable from end of file on most devices; check the block count. 5Ċ /\@,\D"man/man1/symorder.1 644 0 33 1147 2512730537 7377 ((.TH SYMORDER 1 10/20/79 .UC .SH NAME symorder \- rearrange name list .SH SYNOPSIS .B symorder orderlist symbolfile .SH DESCRIPTION .I Orderlist is a file containing symbols to be found in symbolfile, 1 symbol per line. .PP .I Symbolfile is updated in place to put the requested symbols first in the symbol table, in the order specified. This is done by swapping the old symbols in the required spots with the new ones. If all of the order symbols are not found, an error is generated. .PP This program was specifically designed to cut down on the overhead of getting symbols from /vmunix. .SH "SEE ALSO" nlist(3) symbolfile .SH DESCRIPTION .I Orderlist is a file containing symbols to be found in symbolfile, 1 symbol per line. .PP .I Symbolfile is updated in place to put the requested symbols first in the symbol table, in the order specified. This is done by swapping the old symbols in the required spots with the new ones. If all of the order symbols are not found, an error is generated. .PP This program was specman/man1/tabs.1 644 0 33 667 2531446133 6447 .TH TABS 1 .SH NAME tabs \- set terminal tabs .SH SYNOPSIS .B tabs [ .B \-n ] [ terminal ] .SH DESCRIPTION .I Tabs sets the tabs on a variety of terminals. Various terminal names given in .IR term (7) are recognized; the default is, however, suitable for most 300 baud terminals. If the .B \-n flag is present then the left margin is not indented as is normal. .SH SEE ALSO stty(1), term(7) .SH BUGS It's much better to use .IR tset (1). ,( 5ЍĊ /\@,\D"man/man1/tail.1 644 0 33 2104 2512730537 6456 .TH TAIL 1 .UC 4 .SH NAME tail \- deliver the last part of a file .SH SYNOPSIS .B tail .if t [ \(+-number[\fBlbc\fR][\fBfr\fR] ] .if n +_number[lbc___][r_f_] [ file ] .SH DESCRIPTION .I Tail copies the named file to the standard output beginning at a designated place. If no file is named, the standard input is used. .PP Copying begins at distance .I +number from the beginning, or .I \-number from the end of the input. .I Number is counted in units of lines, blocks or characters, according to the appended option .B l, .B b or .B c. When no units are specified, counting is by lines. .PP Specifying .B r causes tail to print lines from the end of the file in reverse order. The default for .B r is to print the entire file this way. Specifying .B f causes .I tail to not quit at end of file, but rather wait and try to read repeatedly in hopes that the file will grow. .SH "SEE ALSO" dd(1) .SH BUGS Tails relative to the end of the file are treasured up in a buffer, and thus are limited in length. .PP Various kinds of anomalous behavior may happen with character special files. g is by lines. .PP Specifying .B r causes tail to print lines from the end of the file in reverse order. The default for .B r is to print the entire file this way. Specifying .B f causes .I tail to not quit at end of file, but rather wait and try to read repeatedly in hopes that the file will grow. .SH "SEE ALSO" dd(1) .SH BUGS Tails relative to the end of the file are treasured up in a buffer, and thus are limited in length. .PP Various kman/man1/tar.1 644 0 33 10265 2527170235 6341 .TH TAR 1 4/1/81 .UC 4 .SH NAME tar \- tape archiver .SH SYNOPSIS .B tar [ key ] [ name ... ] .SH DESCRIPTION .PP .I Tar saves and restores files on magtape. Its actions are controlled by the .I key argument. The .I key is a string of characters containing at most one function letter and possibly one or more function modifiers. Other arguments to the command are file or directory names specifying which files are to be dumped or restored. In all cases, appearance of a directory name refers to the files and (recursively) subdirectories of that directory. .PP The function portion of the key is specified by one of the following letters: .TP 8 .B r The named files are written on the end of the tape. The .B c function implies this. .TP 8 .B x The named files are extracted from the tape. If the named file matches a directory whose contents had been written onto the tape, this directory is (recursively) extracted. The owner, modification time, and mode are restored (if possible). If no file argument is given, the entire content of the tape is extracted. Note that if multiple entries specifying the same file are on the tape, the last one overwrites all earlier. .TP 8 .B t The names of the specified files are listed each time they occur on the tape. If no file argument is given, all of the names on the tape are listed. .TP 8 .B u The named files are added to the tape if either they are not already there or have been modified since last put on the tape. .TP 8 .B c Create a new tape; writing begins on the beginning of the tape instead of after the last file. This command implies .B r. .TP 8 .B o On output, tar normally places information specifying owner and modes of directories in the archive. Former versions of tar, when encountering this information will give error message of the form .br "/: cannot create". .br This option will suppress the directory information. .TP 8 .B p This option says to restore files to their original modes, ignoring the present umask(2). Setuid and sticky information will also be restored to the super-user. .PP The following characters may be used in addition to the letter which selects the function desired. .TP 10 .B 0,...,7 This modifier selects an alternate drive on which the tape is mounted. (The default is drive 0 at 1600 bpi, which is normally /dev/rmt8.) .TP 10 .B v Normally .I tar does its work silently. The .B v (verbose) option causes it to type the name of each file it treats preceded by the function letter. With the .B t function, .B v gives more information about the tape entries than just the name. .TP 10 .B w causes .I tar to print the action to be taken followed by file name, then wait for user confirmation. If a word beginning with `y' is given, the action is performed. Any other input means don't do it. .TP 10 .B f causes .I tar to use the next argument as the name of the archive instead of /dev/rmt?. If the name of the file is `\-', tar writes to standard output or reads from standard input, whichever is appropriate. Thus, .I tar can be used as the head or tail of a filter chain .I Tar can also be used to move hierarchies with the command .ce 1 cd fromdir; tar cf - . | (cd todir; tar xf -) .TP 10 .B b causes .I tar to use the next argument as the blocking factor for tape records. The default is 20 (the maximum). This option should only be used with raw magnetic tape archives (See .B f above). The block size is determined automatically when reading tapes (key letters `x' and `t'). .TP 10 .B l tells .I tar to complain if it cannot resolve all of the links to the files dumped. If this is not specified, no error messages are printed. .TP 10 .B m tells .I tar to not restore the modification times. The mod time will be the time of extraction. .PP Previous restrictions dealing with .IR tar 's inability to properly handle blocked archives have been lifted. .PP .SH FILES /dev/rmt? .br /tmp/tar* .SH DIAGNOSTICS Complaints about bad key characters and tape read/write errors. .br Complaints if enough memory is not available to hold the link tables. .SH BUGS There is no way to ask for the .IR n -th occurrence of a file. .br Tape errors are handled ungracefully. .br The .B u option can be slow. .br The current limit on file name length is 100 characters. P Previous restrictions dealing with .IR tar 's inability to properly handle blocked archives have been lifted. .PP .SH FILES /dev/rmt? .br /tmp/tar* .SH DIAGNOSTICS Complaints about bad key characters and tape read/write errors. .br Complaints if enough memory is not available to hold the link tables. .SH BUGS There is no way toman/man1/tbl.1 644 0 33 11122 2512730537 6326 .TH TBL 1 .SH NAME tbl \- format tables for nroff or troff .SH SYNOPSIS .B tbl [ files ] ... .SH DESCRIPTION .I Tbl is a preprocessor for formatting tables for .I nroff or .IR troff (1). The input files are copied to the standard output, except for lines between .TS and .TE command lines, which are assumed to describe tables and reformatted. Details are given in the reference manual. .PP As an example, letting \\t represent a tab (which should be typed as a genuine tab) the input .IP "" \&.TS .nf c s s c c(( s c c c l n n. Household Population Town\\tHouseholds \\tNumber\\tSize Bedminster\\t789\\t3.26 Bernards Twp.\\t3087\\t3.74 Bernardsville\\t2018\\t3.30 Bound Brook\\t3425\\t3.04 Branchburg\\t1644\\t3.49 Bridgewater\\t7897\\t3.81 Far Hills\\t240\\t3.19 \&.TE .LP .fi yields .ne 10 .IP " " .TS .nr 35 \n(.u .nf .nr 79 0n .nr 80 \n(79 .nr 40 \n(79 .nr 38 \n(79+\w!Town! .if \n(80<\n(38 .nr 80 \n(38 .nr 38 \n(79+\w!! .if \n(80<\n(38 .nr 80 \n(38 .nr 38 \n(79+\w!Bedminster! .if \n(80<\n(38 .nr 80 \n(38 .nr 38 \n(79+\w!Bernards Twp.! .if \n(80<\n(38 .nr 80 \n(38 .nr 38 \n(79+\w!Bernardsville! .if \n(80<\n(38 .nr 80 \n(38 .nr 38 \n(79+\w!Bound Brook! .if \n(80<\n(38 .nr 80 \n(38 .nr 38 \n(79+\w!Branchburg! .if \n(80<\n(38 .nr 80 \n(38 .nr 38 \n(79+\w!Bridgewater! .if \n(80<\n(38 .nr 80 \n(38 .nr 38 \n(79+\w!Far Hills! .if \n(80<\n(38 .nr 80 \n(38 .nr 81 \n(80 .nr 41 \n(80 .nr 38 \n(80+\w!Number! .if \n(81<\n(38 .nr 81 \n(38 .nr 31 0 .nr 32 0 .nr 38 \w!789! .if \n(31<\n(38 .nr 31 \n(38 .nr 38 \w!! .if \n(32<\n(38 .nr 32 \n(38 .nr 38 \w!3087! .if \n(31<\n(38 .nr 31 \n(38 .nr 38 \w!! .if \n(32<\n(38 .nr 32 \n(38 .nr 38 \w!2018! .if \n(31<\n(38 .nr 31 \n(38 .nr 38 \w!! .if \n(32<\n(38 .nr 32 \n(38 .nr 38 \w!3425! .if \n(31<\n(38 .nr 31 \n(38 .nr 38 \w!! .if \n(32<\n(38 .nr 32 \n(38 .nr 38 \w!1644! .if \n(31<\n(38 .nr 31 \n(38 .nr 38 \w!! .if \n(32<\n(38 .nr 32 \n(38 .nr 38 \w!7897! .if \n(31<\n(38 .nr 31 \n(38 .nr 38 \w!! .if \n(32<\n(38 .nr 32 \n(38 .nr 38 \w!240! .if \n(31<\n(38 .nr 31 \n(38 .nr 38 \w!! .if \n(32<\n(38 .nr 32 \n(38 .nr 61 \n(80+\n(31 .nr 38 \n(61+\n(32 .if \n(38>\n(81 .nr 81 \n(38 .if \n(38<\n(81 .nr 61 +(\n(81-\n(38)/2 .nr 82 \n(81 .nr 42 \n(81 .nr 38 \n(81+\w!Size! .if \n(82<\n(38 .nr 82 \n(38 .nr 31 0 .nr 32 0 .nr 38 \w!3! .if \n(31<\n(38 .nr 31 \n(38 .nr 38 \w!.26! .if \n(32<\n(38 .nr 32 \n(38 .nr 38 \w!3! .if \n(31<\n(38 .nr 31 \n(38 .nr 38 \w!.74! .if \n(32<\n(38 .nr 32 \n(38 .nr 38 \w!3! .if \n(31<\n(38 .nr 31 \n(38 .nr 38 \w!.30! .if \n(32<\n(38 .nr 32 \n(38 .nr 38 \w!3! .if \n(31<\n(38 .nr 31 \n(38 .nr 38 \w!.04! .if \n(32<\n(38 .nr 32 \n(38 .nr 38 \w!3! .if \n(31<\n(38 .nr 31 \n(38 .nr 38 \w!.49! .if \n(32<\n(38 .nr 32 \n(38 .nr 38 \w!3! .if \n(31<\n(38 .nr 31 \n(38 .nr 38 \w!.81! .if \n(32<\n(38 .nr 32 \n(38 .nr 38 \w!3! .if \n(31<\n(38 .nr 31 \n(38 .nr 38 \w!.19! .if \n(32<\n(38 .nr 32 \n(38 .nr 62 \n(81+\n(31 .nr 38 \n(62+\n(32 .if \n(38>\n(82 .nr 82 \n(38 .if \n(38<\n(82 .nr 62 +(\n(82-\n(38)/2 .nr 38 \n(79+\w!Household Population!-\n(82 .if \n(38>0 .nr 38 \n(38/2 .if \n(38<0 .nr 38 0 .nr 61 +1*\n(38 .nr 81 +1*\n(38 .nr 41 +1*\n(38 .nr 62 +2*\n(38 .nr 82 +2*\n(38 .nr 42 +2*\n(38 .nr 38 \n(80+\w!Households!-\n(82 .if \n(38>0 .nr 38 \n(38/1 .if \n(38<0 .nr 38 0 .nr 62 +1*\n(38 .nr 82 +1*\n(38 .nr 42 +1*\n(38 .nr 38 1n .nr 41 +3*\n(38 .nr 81 +3*\n(38 .nr 61 +3*\n(38 .if n .if \n(61%24>0 .nr 61 +12u .nr 42 +6*\n(38 .nr 82 +6*\n(38 .nr 62 +6*\n(38 .if n .if \n(62%24>0 .nr 62 +12u .nr TW \n(82 .fc ! : .ta \n(82u \&!:Household Population:! .ta \n(80u \n(82u \&\h'|\n(40u'!:Town:!\h'|\n(41u'!:Households:! .ta \n(80u \n(81u \n(82u \&\h'|\n(40u'!::!\h'|\n(41u'!:Number:!\h'|\n(42u'!:Size:! .ta \n(80u \n(61u \n(62u \n(82u \&\h'|\n(40u'!Bedminster:!\h'|\n(41u'!:789!\h'|\n(42u'!:3!!.26:! .ta \n(80u \n(61u \n(62u \n(82u \&\h'|\n(40u'!Bernards Twp.:!\h'|\n(41u'!:3087!\h'|\n(42u'!:3!!.74:! .ta \n(80u \n(61u \n(62u \n(82u \&\h'|\n(40u'!Bernardsville:!\h'|\n(41u'!:2018!\h'|\n(42u'!:3!!.30:! .ta \n(80u \n(61u \n(62u \n(82u \&\h'|\n(40u'!Bound Brook:!\h'|\n(41u'!:3425!\h'|\n(42u'!:3!!.04:! .ta \n(80u \n(61u \n(62u \n(82u \&\h'|\n(40u'!Branchburg:!\h'|\n(41u'!:1644!\h'|\n(42u'!:3!!.49:! .ta \n(80u \n(61u \n(62u \n(82u \&\h'|\n(40u'!Bridgewater:!\h'|\n(41u'!:7897!\h'|\n(42u'!:3!!.81:! .ta \n(80u \n(61u \n(62u \n(82u \&\h'|\n(40u'!Far Hills:!\h'|\n(41u'!:240!\h'|\n(42u'!:3!!.19:! .fc .mk ## .nr ## -1v .if \n(35>0 .fi .TE .fi .PP If no arguments are given, .I tbl reads the standard input, so it may be used as a filter. When it is used with .I eqn or .I neqn the .I tbl command should be first, to minimize the volume of data passed through pipes. .SH SEE ALSO troff(1), eqn(1) .br M. E. Lesk, .I TBL. 0u \n(61u \n(62u \n(82u \&\h'|\n(40u'!Bridgewater:!\h'|\n(41u'!:7897!\h'|\n(42u'!:3!!.81:! .ta \n(80u \n(61u \n(62u \n(82u \&\h'|\n(40u'!Far Hills:!\h'|\n(41u'!:240!\h'|\n(42u'!:3!!.19:! .fc .mk ## .nr ## -1v .if \n(35>0 .fi .TE .fi .PP If no arguments are given, .I tbl reads the standard input, so it may be used as a filter. When it is used with .I eqn or .I neqn the .I tbl command should be first, to minimize the volume ofman/man1/tc.1 644 0 33 2715 2512730540 6135 .TH TC 1 .SH NAME tc \- photypesetter simulator .SH SYNOPSIS .B tc [ .B \-t ] [ .B \-s\c N ] [ .B \-p\c L ] [ file ] .SH DESCRIPTION .I Tc interprets its input (standard input default) as device codes for a Graphic Systems phototypesetter (cat). The standard output of .I tc is intended for a Tektronix 4015 (a 4014 teminal with ASCII and APL character sets). The sixteen typesetter sizes are mapped into the 4014's four sizes; the entire TROFF character set is drawn using the 4014's character generator, using overstruck combinations where necessary. Typical usage: .IP "" 15 troff \-t file | tc .PP At the end of each page .I tc waits for a newline (empty line) from the keyboard before continuing on to the next page. In this wait state, the command .B e will suppress the screen erase before the next page; .B s\c N will cause the next N pages to be skipped; and .B !\c line will send line to the shell. .PP The command line options are: .TP .B \-t Don't wait between pages; for directing output into a file. .TP .BR \-s N Skip the first N pages. .TP .BR \-p L Set page length to L. L may include the scale factors .B p (points), .B i (inches), .B c (centimeters), and .B P (picas); default is picas. .TP .BI \(fm\- l\ w \(fm Multiply the default aspect ratio, 1.5, of a displayed page by .I l/w. .SH "SEE ALSO" troff(1), plot(1) .SH BUGS Font distinctions are lost. .br .I tc's character set is limited to ASCII in just one size. .br The aspect ratio option is unbelievable. n pages; for directing output into a file. .TP .BRman/man1/tee.1 644 0 33 516 2512730540 6261 .TH TEE 1 .SH NAME tee \- pipe fitting .SH SYNOPSIS .B tee [ .B \-i ] [ .B \-a ] [ file ] ... .SH DESCRIPTION .I Tee transcribes the standard input to the standard output and makes copies in the .I files. Option .B \-i ignores interrupts; option .B \-a causes the output to be appended to the .I files rather than overwriting them. nctions are lost. .br .I tc's character set is limited to ASCII in just one size. .br /( ,( 5 Ċ /\@,\D"man/man1/test.1 644 0 33 3436 2512730540 6507 .TH TEST 1 .SH NAME test \- condition command .SH SYNOPSIS .B test expr .SH DESCRIPTION .I test evaluates the expression .IR expr , and if its value is true then returns zero exit status; otherwise, a non zero exit status is returned. .I test returns a non zero exit if there are no arguments. .PP The following primitives are used to construct .IR expr . .TP 9n .BR \-r " file" true if the file exists and is readable. .TP .BR \-w " file" true if the file exists and is writable. .TP .BR \-f " file" true if the file exists and is not a directory. .TP .BR \-d " file" true if the file exists exists and is a directory. .TP .BR \-s " file" true if the file exists and has a size greater than zero. .TP .BR \-t " [ fildes ]" true if the open file whose file descriptor number is .I fildes (1 by default) is associated with a terminal device. .TP .BR \-z " s1" true if the length of string .I s1 is zero. .TP .BR \-n " s1" true if the length of the string .I s1 is nonzero. .TP .RB s1 " = " s2 true if the strings .I s1 and .I s2 are equal. .TP .RB s1 " != " s2 true if the strings .I s1 and .I s2 are not equal. .TP s1 true if .I s1 is not the null string. .TP .RB n1 " \-eq " n2 true if the integers .I n1 and .I n2 are algebraically equal. Any of the comparisons .BR \-ne , .BR \-gt , .BR \-ge , .BR \-lt , or .BR \-le may be used in place of .BR \-eq . .PP These primaries may be combined with the following operators: .TP .B ! unary negation operator .TP .B \-a binary .I and operator .TP .B \-o binary .I or operator .TP .BR "( " "expr" " )" parentheses for grouping. .PP .B \-a has higher precedence than .B \-o. Notice that all the operators and flags are separate arguments to .IR test . Notice also that parentheses are meaningful to the Shell and must be escaped. .SH "SEE ALSO" sh(1), find(1) BR \-lt , or .BR \-le may be used in place of .BR \-eq . .PP These primaries may be combined with the following operators: .TP .B ! unary negation operator .TP .B \-a binary .I and operator .TP .B \-o binary .I or operat((man/man1/time.1 644 0 33 1631 2512730540 6461 .TH TIME 1 .UC 4 .SH NAME time \- time a command .SH SYNOPSIS .B time command .SH DESCRIPTION The given command is executed; after it is complete, .I time prints the elapsed time during the command, the time spent in the system, and the time spent in execution of the command. Times are reported in seconds. .PP On a PDP-11, the execution time can depend on what kind of memory the program happens to land in; the user time in MOS is often half what it is in core. .PP The times are printed on the diagnostic output stream. .PP .I Time is built in to .I csh(1), using a different output format. .SH BUGS Elapsed time is accurate to the second, while the CPU times are measured to the 60th second. Thus the sum of the CPU times can be up to a second larger than the elapsed time. .PP .I Time is a built-in command to .IR csh (1), with a much different syntax. This command is available as ``/bin/time'' to .I csh users. ; the user time in MOS is often half what it is in core. .PP The times are printed on the diagnostic ouman/man1/tk.1 644 0 33 1745 2512730540 6147 .TH TK 1 .SH NAME tk \- paginator for the Tektronix 4014 .SH SYNOPSIS .B tk [ .B \-t ] [ .B \-\c .I N ] [ .B \-p\c .I L ] [ file ] .SH DESCRIPTION The output of .I tk is intended for a Tektronix 4014 terminal. .I Tk arranges for 66 lines to fit on the screen, divides the screen into .I N columns, and contributes an eight space page offset in the (default) single-column case. Tabs, spaces, and backspaces are collected and plotted when necessary. Teletype Model 37 half- and reverse-line sequences are interpreted and plotted. At the end of each page .I tk waits for a newline (empty line) from the keyboard before continuing on to the next page. In this wait state, the command .BI ! command will send the .I command to the shell. .PP The command line options are: .TP .B \-t Don't wait between pages; for directing output into a file. .PP .TP .BI \- N Divide the screen into \fIN\fR columns and wait after the last column. .TP .BI \-p L Set page length to \fIL\fR lines. .SH SEE ALSO pr(1) se-line sequences are interman/man1/touch.1 644 0 33 604 2512730540 6624 .TH TOUCH 1 .SH NAME touch \- update date last modified of a file .SH SYNOPSIS .B touch [ .B \-c ] file ... .SH DESCRIPTION .I Touch attempts to set the modified date of each .I file. This is done by reading a character from the file and writing it back. .PP If a .I file does not exist, an attempt will be made to create it unless the .B \-c option is specified. .SH SEE\ ALSO utime(2) d wait after the last column. .T/( ,( 5`Ċ /\@,\D"man/man1/tp.1 644 0 33 7202 2512730540 6146 .TH TP 1 deprecated .SH NAME tp \- manipulate tape archive .SH SYNOPSIS .B tp [ key ] [ name ... ] .SH DESCRIPTION .PP .I Tp saves and restores files on DECtape or magtape. Its actions are controlled by the .I key argument. The key is a string of characters containing at most one function letter and possibly one or more function modifiers. Other arguments to the command are file or directory names specifying which files are to be dumped, restored, or listed. In all cases, appearance of a directory name refers to the files and (recursively) subdirectories of that directory. .PP The function portion of the key is specified by one of the following letters: .TP 8 .B r The named files are written on the tape. If files with the same names already exist, they are replaced. `Same' is determined by string comparison, so `./abc' can never be the same as `/usr/dmr/abc' even if `/usr/dmr' is the current directory. If no file argument is given, `\fB.\fR' is the default. .TP 8 .B u updates the tape. .B u is like .B r, but a file is replaced only if its modification date is later than the date stored on the tape; that is to say, if it has changed since it was dumped. .B u is the default command if none is given. .TP 8 .B d deletes the named files from the tape. At least one name argument must be given. This function is not permitted on magtapes. .TP 8 .B x extracts the named files from the tape to the file system. The owner and mode are restored. If no file argument is given, the entire contents of the tape are extracted. .TP 8 .B t lists the names of the specified files. If no file argument is given, the entire contents of the tape is listed. .PP The following characters may be used in addition to the letter which selects the function desired. .TP 10 .B m Specifies magtape as opposed to DECtape. .TP 10 .B 0,...,7 This modifier selects the drive on which the tape is mounted. For DECtape, .B x is default; for magtape `0' is the default. .TP 10 .B v Normally .I tp does its work silently. The .B v (verbose) option causes it to type the name of each file it treats preceded by the function letter. With the .B t function, .B v gives more information about the tape entries than just the name. .TP 10 .B c means a fresh dump is being created; the tape directory is cleared before beginning. Usable only with .B r and .B u. This option is assumed with magtape since it is impossible to selectively overwrite magtape. .TP 10 .B i Errors reading and writing the tape are noted, but no action is taken. Normally, errors cause a return to the command level. .TP 10 .B f Use the first named file, rather than a tape, as the archive. This option currently acts like .BR m ; .I i.e. .BR r implies .BR c , and neither .BR d nor .BR u are permitted. .TP 10 .B w causes .I tp to pause before treating each file, type the indicative letter and the file name (as with .BR v ) and await the user's response. Response .B y means `yes', so the file is treated. Null response means `no', and the file does not take part in whatever is being done. Response .B x means `exit'; the .I tp command terminates immediately. In the .B x function, files previously asked about have been extracted already. With .B "r, u," and .B d no change has been made to the tape. .PP .SH FILES /dev/tap? .br /dev/rmt? .SH SEE ALSO ar(1), tar(1) .SH DIAGNOSTICS Several; the non-obvious one is `Phase error', which means the file changed after it was selected for dumping but before it was dumped. .SH BUGS A single file with several links to it is treated like several files. .PP Binary-coded control information makes magnetic tapes written by .I tp difficult to carry to other machines; .IR tar (1) avoids the problem. already. With .B "r, u," and .B d no change has been made to the tape. .PP .SH FILES /dev/tap? .br /dev/rmt? .SH SEE ALSO ar(1), tar(1) .SH DIAGNOSTICS Several; the non-obvious one is `Phase error', which means the file changed after it was selected for dumping but before it was dumped. .SH BUGS A single file with several links to it is treated like several files. .PP Binary-codeman/man1/tr.1 644 0 33 2755 2512730540 6160 .TH TR 1 .SH NAME tr \- translate characters .SH SYNOPSIS .B tr [ .B \-cds ] [ string1 [ string2 ] ] .SH DESCRIPTION .I Tr copies the standard input to the standard output with substitution or deletion of selected characters. Input characters found in .I string1 are mapped into the corresponding characters of .IR string2 . When .I string2 is short it is padded to the length of .I string1 by duplicating its last character. Any combination of the options .B \-cds may be used: .B \-c complements the set of characters in .I string1 with respect to the universe of characters whose ASCII codes are 01 through 0377 octal; .B \-d deletes all input characters in .I string1; .B \-s squeezes all strings of repeated output characters that are in .I string2 to single characters. .PP In either string the notation .IB a \- b means a range of characters from .I a to .I b in increasing ASCII order. The character `\e' followed by 1, 2 or 3 octal digits stands for the character whose ASCII code is given by those digits. A ((`\e' followed by any other character stands for that character. .PP The following example creates a list of all the words in `file1' one per line in `file2', where a word is taken to be a maximal string of alphabetics. The second string is quoted to protect `\e' from the Shell. 012 is the ASCII code for newline. .IP tr \-cs A\-Za\-z \'\e012\' file2 .SH "SEE ALSO" ed(1), ascii(7), expand(1) .SH BUGS Won't handle ASCII NUL in .I string1 or .I string2; always deletes NUL from input. by those digits. A man/man1/tra.1 644 0 33 374 2512730541 6275 .pl 1 The ``tra'' command is obsolete. Use the ``f'' (file) keyletter to the ``tail'' command instead. Thus ``tra errs'' is similar to ``tail -f errs'', and you can now say, e.g. ``tail -10f errs'' to start the watch with the current last 10 lines. otect `\e' from the Shell. 012 is the ASCII code for newline. .IP tr \-cs A\-Za\-z \'\e012\' file2 .SH "SEE ALSO" ed(1), ascii(7), expand(1) .SH BUGS Won't hand/( ,( 5Ċ /\@,\D"man/man1/trman.1 644 0 33 762 2512730541 6631 .TH TRMAN 1 2/24/79 .UC .SH NAME trman \- translate version 6 manual macros to version 7 macros .SH SYNOPSIS .B trman [ file ] .SH DESCRIPTION .I Trman reads the input file, which should be nroff/troff input and attempts to translate the version 6 manual sections therein to version 7 format. It is largely successful, but seems to have trouble with indented paragraphs and complicated font control. You should expect to have to fix up long sections by hand somewhat. .SH SEE ALSO man(7) .SH BUGS ,\D"man/man1/troff.1 644 0 33 7304 2512730541 6647 .TH TROFF 1 .SH NAME troff, nroff \- text formatting and typesetting .SH SYNOPSIS .B troff [ option ] ... [ file ] ... .PP .B nroff [ option ] ... [ file ] ... .SH DESCRIPTION .I Troff formats text in the named .I files for printing on a Graphic Systems C/A/T phototypesetter; .I nroff for typewriter-like devices. Their capabilities are described in the .I Nroff/Troff user's manual. .PP If no .I file argument is present, the standard input is read. An argument consisting of a single minus .RB ( \- ) is taken to be a file name corresponding to the standard input. The options, which may appear in any order so long as they appear before the files, are: .TP "\w'\f3\-m\f1name 'u" .BI \-o list Print only pages whose page numbers appear in the comma-separated .I list of numbers and ranges. A range .IB N \- M means pages .I N through .IR M ; an initial .I \-N means from the beginning to page .IR N ; and a final .IR N \- means from .I N to the end. .TP .BI \-n N Number first generated page .IR N . .TP .BI \-s N Stop every .I N pages. .I Nroff will halt prior to every .I N pages (default .IR N =1) to allow paper loading or changing, and will resume upon receipt of a newline. .I Troff will stop the phototypesetter every .I N pages, produce a trailer to allow changing cassettes, and resume when the typesetter's start button is pressed. .TP .BI \-m name Prepend the macro file .BI /usr/lib/tmac/tmac. name to the input .IR files . .TP .BI \-r aN Set register .I a (one-character) to .IR N . .TP .B \-i Read standard input after the input files are exhausted. .TP .B \-q Invoke the simultaneous input-output mode of the .B rd request. .HP .bd I 3 .I Nroff only .br .bd I .TP .BI \-T name Prepare output for specified terminal. Known .I names are .B 37 for the (default) Teletype Corporation Model 37 terminal, .B tn300 for the GE TermiNet\ 300 (or any terminal without half-line capability), .B 300S for the \s-1DASI\s+1-300S, .B 300 for the \s-1DASI\s+1-300, and .B 450 for the \s-1DASI\s+1-450 (Diablo Hyterm). .TP .B \-e Produce equally-spaced words in adjusted lines, using full terminal resolution. .TP .B \-h Use output tabs during horizontal spacing to speed output and reduce output character count. Tab settings are assumed to be every 8 nominal character widths. .HP .bd I 3 .I Troff only .br .bd I .TP .B \-t Direct output to the standard output instead of the phototypesetter. .TP .B \-f Refrain from feeding out paper and stopping phototypesetter at the end of the run. .TP .B \-w Wait until phototypesetter is available, if currently busy. .TP .B \-b Report whether the phototypesetter is busy or available. No text processing is done. .TP .B \-a Send a printable ASCII approximation of the results to the standard output. .TP .BR \-p N Print all characters in point size .I N while retaining all prescribed spacings and motions, to reduce phototypesetter elasped time. .TP .B \-g Prepare output for a GCOS phototypesetter and direct it to the standard output (see .IR gcat (1)). .PP If the file .I /usr/adm/tracct is writable, .I troff keeps phototypesetter accounting records there. The integrity of that file may be secured by making .I troff a `set user-id' program. .SH FILES .ta \w'/usr/lib/tmac/tmac.* 'u /usr/lib/suftab suffix hyphenation tables .br /tmp/ta* temporary file .br /usr/lib/tmac/tmac.* standard macro files .br /usr/lib/term/* terminal driving tables for .I nroff .br /usr/lib/font/* font width tables for .I troff .br /dev/cat phototypesetter .br /usr/adm/tracct accounting statistics for /dev/cat .SH "SEE ALSO" J. F. Ossanna, .I Nroff/Troff user's manual .br B. W. Kernighan, .I A TROFF Tutorial .br vtroff(1), eqn(1), tbl(1), pti(1), ms(7), me(7), man(7), soelim(1) .br col(1), tk(1) .RI ( nroff only) .br tc(1) .RI ( troff only) ion tables .br /tmp/ta* temporary file .br /usr/lib/tmac/tmac.* standard macro files .br /usr/lib/term/* terminal driving tables for .I nroff .br /usr/lib/font/* font width tables for .I troff .br /dev/cat phototypesetter .br /usr/adm/tracct accounting statistics for /dev/cat .SH "SEE ALSO" J. F. Ossanna, .I Nroff/man/man1/true.1 644 0 33 564 2512730541 6467 .TH TRUE 1 .SH NAME true, false \- provide truth values .SH SYNOPSIS .B true .PP .B false .SH DESCRIPTION .I True does nothing, successfully. .I False does nothing, unsuccessfully. They are typically used in input to .IR sh (1) such as: .PP while true .br do .br command .br done .SH "SEE ALSO" sh(1) .SH DIAGNOSTICS .I True has exit status zero, .I false nonzero. les for .I troff .br /dev/cat phototypesetter .b/( ,( 5Ċ /\@,\D"man/man1/tset.1 644 0 33 12144 2512730542 6525 .TH TSET 1 4/1/81 .UC 4 .SH NAME tset \- set terminal modes .SH SYNOPSIS .B tset [ options ] [ .B \-m [\fIident\fP][\fItest .IR baudrate ]:\fItype \&... ] [ type ] .SH DESCRIPTION .I Tset causes terminal dependent processing such as setting erase and kill characters, setting or resetting delays, and the like. It first determines the .I type of terminal involved, names for which are specified by the .I /etc/termcap data base, and then does necessary initializations and mode settings. In the case where no argument types are specified, .I tset simply reads the terminal type out of the environment variable TERM and re-initializes the terminal. The rest of this manual concerns itself with type initialization, done typically once at login, and options used at initialization time to determine the terminal type and set up terminal modes. .PP When used in a startup script .I \&.profile (for .IR sh (1) users) or .I \&.login (for .IR csh (1) users) it is desirable to give information about the types of terminal usually used on terminals which are not hardwired. These ports are initially identified as being .I dialup or .I plugboard or .I arpanet etc. To specify what terminal type is usually used on these ports .B \-m is followed by the appropriate port type identifier, an optional baud-rate specification, and the terminal type to be used if the mapping conditions are satisfied. If more than one mapping is specified, the first applicable mapping prevails. A missing type identifier matches all identifiers. .PP Baud rates a((re specified as with .IR stty (1), and are compared with the speed of the diagnostic output (which is almost always the control terminal). The baud rate test may be any combination of: .B >, .B =, .B <, .B @, and .B !; .B @ is a synonym for .B = and .B ! inverts the sense of the test. To avoid problems with metacharacters, it is best to place the entire argument to .B \-m within ``\''' characters; users of .IR csh (1) must also put a ``\e'' before any ``!'' used here. .PP Thus .IP tset \-m \'dialup>300:adm3a\' \-m dialup:dw2 \-m \'plugboard:?adm3a\' .LP causes the terminal type to be set to an .I adm3a if the port in use is a dialup at a speed greater than 300 baud; to a .I dw2 if the port is (otherwise) a dialup (i.e. at 300 baud or less). If the .I type above begins with a question mark, the user is asked if s/he really wants that type. A null response means to use that type; otherwise, another type can be entered which will be used instead. Thus, in this case, the user will be queried on a plugboard port as to whether they are using an .I adm3a. For other ports the port type will be taken from the /etc/ttytype file or a final, default .I type option may be given on the command line not preceded by a .B \-m. .PP It is often desirable to return the terminal type, as specified by the .B \-m options, and information about the terminal to a shell's environment. This can be done using the .B \-s option; using the Bourne shell, .IR sh (1): .IP eval \`tset \-s \fIoptions...\fR\` .LP or using the C shell, .IR csh (1): .IP set noglob; eval \`tset \-s \fIoptions...\fR\` .PP These commands cause .I tset to generate as output a sequence of shell commands which place the variables TERM and TERMCAP in the environment; see .IR environ (5). .PP Once the terminal type is known, .I tset engages in terminal mode setting. This normally involves sending an initialization sequence to the terminal and setting the single character erase (and optionally the line-kill (full line erase)) characters. .PP On terminals that can backspace but not overstrike (such as a \s-2CRT\s0), and when the erase character is the default erase character (`#' on standard systems), the erase character is changed to a Control-H (backspace). .PP The options are: .TP .B \-e set the erase character to be the named character .I c on all terminals, the default being the backspace character on the terminal, usually ^H. .TP .B \-k is similar to .B \-e but for the line kill character rather than the erase character; .I c defaults to ^X (for purely historical reasons); ^U is the preferred setting. No kill processing is done if .B \-k is not specified. .TP .B \-I supresses outputting terminal initialization strings. .TP .B \-Q supresses printing the ``Erase set to'' and ``Kill set to'' messages. .TP .B \-S Outputs the strings to be assigned to TERM and TERMCAP in the environment rather than commands for a shell. .SH FILES .DT /etc/ttytype terminal id to type map database .br /etc/termcap terminal capability database .SH SEE\ ALSO csh(1), setenv(1), sh(1), stty(1), environ(5), ttytype(5), termcap(5) .SH AUTHOR Eric Allman .SH BUGS Should be merged with .IR stty (1). .SH NOTES For compatibility with earlier versions of .I tset a number of flags are accepted whose use is discouraged: .TP 10 \fB\-d\fR type equivalent to .B \-m dialup:type .TP 10 \fB\-p\fR type equivalent to .B \-m plugboard:type .TP 10 \fB\-a\fR type equivalent to .B \-m arpanet:type .TP 10 \fB\-E\fR c Sets the erase character to .I c only if the terminal can backspace. .TP 10 \fB\-\fR prints the terminal type on the standard output .TP 10 \fB\-r\fR prints the terminal type on the diagnostic output. (1). .SH NOTES For compatibility with earlier versions of .I tset a number of flags are accepted whose use is discouraged: .TP 10 \fB\-d\fR type equivalent to .B \-m dialup:type .TP 10 \fB\-p\fR type equivalent to .B \-m plugboard:type .TP 10 \fB\-a\fR type equivalent to .B \-m arpanet:type .TP 10 \fB\-E\fR c Sets the erase character to .I c only if the terminal can backspace. .TP 10 \fB\-\fR prints the termiman/man1/tsort.1 644 0 33 1304 2512730542 6675 .TH TSORT 1 .SH NAME tsort \- topological sort .SH SYNOPSIS .B tsort [ file ] .SH DESCRIPTION .I Tsort produces on the standard output a totally ordered list of items consistent with a partial ordering of items mentioned in the input .IR file . If no .I file is specified, the standard input is understood. .PP The input consists of pairs of items (nonempty strings) separated by blanks. Pairs of different items indicate ordering. Pairs of identical items indicate presence, but not ordering. .SH "SEE ALSO" lorder(1) .SH DIAGNOSTICS Odd data: there is an odd number of fields in the input file. .SH BUGS Uses a quadratic algorithm; not worth fixing for the typical use of ordering a library archive file. dering of items mentioned in the input .IR file . If no .I file is specified, the standard input is understood. .PP The input consists of pairs of items (nonempty strings) separated by blanks. Pairs of different items indicate ordering. Pairs of identical items indicate presence, but not ordering. .SH "SEE ALSO" loman/man1/tty.1 644 0 33 316 2512730542 6324 .TH TTY 1 .SH NAME tty \- get terminal name .SH SYNOPSIS .B tty .SH DESCRIPTION .I Tty prints the pathname of the user's terminal. .SH DIAGNOSTICS `not a tty' if the standard input file is not a terminal. items mentioned in the input .IR file . If no .I file is specified, the standard input is understood. .PP The input consists of pairs of items (nonempty strings) separated by blanks. Pairs of different items indica/( ,( 5Ċ /\@,\D"man/man1/ul.1 644 0 33 2540 2512730542 6145 .TH UL 1 .UC 4 .SH NAME ul \- do underlining .SH SYNOPSIS .B ul [ .B \-i ] [ .B \-t .I terminal ] [ .I name \&... ] .SH DESCRIPTION .I Ul reads the named files (or standard input if none are given) and translates occurances of underscores to the sequence which indicates underlining for the terminal in use, as specified by the environment variable TERM. The .B \-t option overrides the terminal kind specified in the environment. The file .I /etc/termcap is read to determine the appropriate sequences for underlining. If the terminal is incapable of underlining, but is capable of a standout mode then that is used instead. If the terminal can overstrike, or handles underlining automatically, .I ul degenerates to .IR cat (1). If the terminal cannot underline, underlining is ignored. .PP The .B \-i option causes .I ul to indicate underlining onto by a separate line containing appropriate dashes `\-'; this is useful when you want to look at the underlining which is present in an .I nroff output stream on a crt-terminal. .SH "SEE ALSO" man(1), nroff(1), colcrt(1) .SH AUTHOR Mark Horton wrote .IR ul . The .B \-i option was originally a option of the editor .IR ex (1), then an .I iul command. .SH BUGS .I Nroff usually outputs a series of backspaces and underlines intermixed with the text to indicate underlining. No attempt is made to optimize the backward motion. e line containing appropriate dashes `\-'; this is useful when you want to look at the underlining which is present in an .I nroff output stream on a crt-terminman/man1/uncompact.1 664 0 33 34 2512730542 7454 .so /usr/man/man1/compact.1 roff(1), colcrt(1) .SH AUTHOR Mark Horton wrote .IR ul . The .B \-i option was originally a option of the editor .IR ex (1), then an .I iul command. .SH BUGS .I Nroff usually outputs a series of backspaces and underlines intermixed with the text to indicate underlining. No attempt is made to optimize the backward motion. e line containing appropriate dashes `\-'; this is useful when you w/( ,( 5Ċ /\@,\D"man/man1/uniq.1 644 0 33 2400 2512730542 6474 ((.TH UNIQ 1 .SH NAME uniq \- report repeated lines in a file .SH SYNOPSIS .B uniq [ .B \-udc [ .BR + n ] [ .BR \- n ] ] [ input [ output ] ] .SH DESCRIPTION .I Uniq reads the input file comparing adjacent lines. In the normal case, the second and succeeding copies of repeated lines are removed; the remainder is written on the output file. Note that repeated lines must be adjacent in order to be found; see .IR sort (1). If the .B \-u flag is used, just the lines that are not repeated in the original file are output. The .B \-d option specifies that one copy of just the repeated lines is to be written. The normal mode output is the union of the .B \-u and .B \-d mode outputs. .PP The .B \-c option supersedes .B \-u and .B \-d and generates an output report in default style but with each line preceded by a count of the number of times it occurred. .PP The .I n arguments specify skipping an initial portion of each line in the comparison: .TP 8 .BI \- n The first .IR n fields together with any blanks before each are ignored. A field is defined as a string of non-space, non-tab characters separated by tabs and spaces from its neighbors. .TP 8 .BI + n The first .IR n characters are ignored. Fields are skipped before characters. .PP .SH "SEE ALSO" sort(1), comm(1) default style but with each line preceded by a count of the number of times it occurred. .PP The .I n arguments specify skipping an initial portion of each line in the comparison: .TP 8 .BI \- n The first .IR n fields together with any blanks before eachman/man1/units.1 644 0 33 3044 2512730542 6667 .if n .ds / / .if t .ds / \z/\h'\w'*'u' .TH UNITS 1 .SH NAME units \- conversion program .SH SYNOPSIS .B units .SH DESCRIPTION .I Units converts quantities expressed in various standard scales to their equivalents in other scales. It works interactively in this fashion: .PP .I " You have:" inch .br .I " You want:" cm .br .I " * 2.54000e+00 .br .I " \*/ 3.93701e\-01 .PP A quantity is specified as a multiplicative combination of units optionally preceded by a numeric multiplier. Powers are indicated by suffixed positive integers, division by the usual sign: .PP .I " You have:" 15 pounds force/in2 .br .I " You want:" atm .br .I " * 1.02069e+00" .br .I " \*/ 9.79730e\-01" .PP .I Units only does multiplicative scale changes. Thus it can convert Kelvin to Rankine, but not Centigrade to Fahrenheit. Most familiar units, abbreviations, and metric prefixes are recognized, together with a generous leavening of exotica and a few constants of nature including: .PP .nf pi ratio of circumference to diameter c speed of light e charge on an electron g acceleration of gravity force same as g mole Avogadro's number water pressure head per unit height of water au astronomical unit .PP .fi `Pound' is a unit of mass. Compound names are run together, e.g. `lightyear'. British units that differ from their US counterparts are prefixed thus: `brgallon'. Currency is denoted `belgiumfranc', `britainpound', ... .PP For a complete list of units, `cat /usr/lib/units'. .SH FILES /usr/lib/units .SH BUGS Don't base your financial plans on the currency conversions. acceleration of gravity force same as g mole Avogadro's number water pressure head per unit height of water au astronomical unit .PP .fi `Pound' is a unit of mass. Compound names are run together, e.g. `lightyear'. British units that differ from their US counterparts are prefixed thus: `brgallon'. Currency is denoted `belgiumfranc', `britainpound', ... .PP For a complete list of units, `cat /usr/lib/units'. .SH FILES /usr/lib/units .SH BUGS Don't base your financialman/man1/uptime.1 664 0 33 602 2512730542 7007 .TH UPTIME 1 11/13/79 .UC .SH NAME uptime \- show how long system has been up .SH SYNOPSIS .B uptime .SH DESCRIPTION Uptime prints the current time, the length of time the system has been up, and the average number of jobs in the run queue over the last 1, 5 and 15 minutes. It is, essentially, the first line of a .I w (1) command. .SH FILES /vmunix system name list .SH SEE ALSO w(1) ound', ... .PP For a complete list/( ,( 5@Ċ /\@,\D"man/man1/users.1 664 0 33 423 2512730542 6646 .TH USERS 1 .UC .SH NAME users \- compact list of users who are on the system .SH SYNOPSIS .B users .SH DESCRIPTION .I Users lists the login names of the users currently on the system in a compact, one-line format. .SH FILES /etc/utmp .SH SEE ALSO finger(1), who(1) .SH BUGS It is, essentially, the first line of a .I w (1) command. .SH FILES /vmunix system name list .SH SEE ALSO w(1) ound', ... .PP For a complete list/( ,( 5PĊ /\@,\D"man/man1/uuclean.1c 664 0 33 1655 2512730543 7335 .TH UUCLEAN 1C .SH NAME uuclean \- uucp spool directory clean-up .SH SYNOPSIS .B uuclean [ option ] ... .SH DESCRIPTION .I Uuclean will scan the spool directory for files with the specified prefix and delete all those which are older than the specified number of hours. .PP The following options are available. .TP 8 .BI \-p pre Scan for files with .I pre as the file prefix. Up to 10 .B \-p arguments may be specified. A .B \-p without any .I pre following will cause all files older than the specified time to be deleted. .TP .BI \-n time Files whose age is more than .I time hours will be deleted if the prefix test is satisfied. (default time is 72 hours) .TP 8 .B \-m Send mail to the owner of the file when it is deleted. .PP This program will typically be started by .IR cron (8). .SH FILES .TP 22 /usr/lib/uucp directory with commands used by uuclean internally .TP /usr/lib/uucp/spool spool directory .SH SEE ALSO uucp(1C), uux(1C) without any .I pre following will cause all files older than the specified time to man/man1/uucp.1c 644 0 33 5267 2512730543 6656 .TH UUCP 1C .SH NAME uucp, uulog \- unix to unix copy .SH SYNOPSIS .B uucp [ option ] ... source-file ... destination-file .PP .B uulog [ option ] ... .SH DESCRIPTION .I Uucp copies files named by the source-file arguments to the destination-file argument. A file name may be a path name on your machine, or may have the form .IP system-name!pathname .LP where `system-name' is taken from a list of system names which .I uucp knows about. Shell metacharacters ?*[] appearing in the pathname part will be expanded on the appropriate system. .PP Pathnames may be one of .IP (1) a full pathname; .IP (2) a pathname preceded by .IR ~user ; where .I user is a userid on the specified system and is replaced by that user's login directory; .IP (3) anything else is prefixed by the current directory. .PP If the result is an erroneous pathname for the remote system the copy will fail. If the destination-file is a directory, the last part of the source-file name is used. .ig If a simple .I ~user destination is inaccessible to .I uucp, data is copied to a spool directory and the user is notified by .IR mail (1). .. .PP .I Uucp preserves execute permissions across the transmission and gives 0666 read and write permissions (see .IR chmod (2)). .PP The following options are interpreted by .IR uucp . .TP .B \-d Make all necessary directories for the file copy. .TP .B \-c Use the source file when copying out rather than copying the file to the spool directory. .TP .B \-m Send mail to the requester when the copy is complete. .PP .I Uulog maintains a summary log of .I uucp and .IR uux (1) transactions in the file `/usr/spool/uucp/LOGFILE' by gathering information from partial log files named `/usr/spool/uucp/LOG.*.?'. It removes the partial log files. .PP The options cause .I uulog to print logging information: .TP .BI \-s sys Print information about work involving system .I sys. .TP .BI \-u user Print information about work done for the specified .I user. .SH FILES /usr/spool/uucp - spool directory .br /usr/lib/uucp/* - other data(( and program files .SH SEE ALSO uux(1), mail(1) .br D. A. Nowitz, .I Uucp Implementation Description .SH WARNING The domain of remotely accessible files can (and for obvious security reasons, usually should) be severely restricted. You will very likely not be able to fetch files by pathname; ask a responsible person on the remote system to send them to you. For the same reasons you will probably not be able to send files to arbitrary pathnames. .SH BUGS .br All files received by .I uucp will be owned by uucp. .br The \-m option will only work sending files or receiving a single file. (Receiving multiple files specified by special shell characters ?*[] will not activate the \-m option.) reasons, usually should) be severely restricted. You will very likely not be able to fetch files by pathname; ask a responsible person on the remote system to send them to you. For the same reasons you will probably not be able to send files to arbitrary pathnames. .SH BUGS .br All files received by .I uucp will be owned by uucman/man1/uudiff.1c 644 0 33 3510 2512730543 7151 .TH UUDIFF 1C .SH NAME uudiff \- directory comparison between machines .SH SYNOPSIS .B uudiff [ \-d ] local-name remote-name .SH DESCRIPTION .I Uudiff compares the files in the directory .I local-name and the directory .I remote-name, (where .I remote-name may be of the form .I system-name!directory-name and .I system-name is a .I uucp Unix name). It reports (via mail) which files are added, deleted, or changed, and provides a .I diff(1) of altered printable files. .PP If a part of .I remote-name is omitted (either the system or the directory) the corresponding part of .I local-name is used. If .I local-name is a file, rather than a directory, .I remote-name is also assumed to be a file and the program degenerates into .IR diff(1) . .PP The option .B \-d does not diff altered files; only the summary by file names is prepared. .SH FILES Lots. Files zz[abcdeglmn]????? are used for scratch space; files brought back from the remote machine for .I diffing are stored (and left around) as .I name.????? and the final report is left in .I uudiff.????? (the exact name is reported by mail). .SH "SEE ALSO" diff(1), uucp(1) .SH DIAGNOSTICS Almost none. Anything more serious than misspelling .I local-name causes unpredictable and obscure results. .SH BUGS In addition to the standard .I uucp requirements a hook is needed at the remote system, and at present is only installed on the systems "research" and "inter". .br This program is written in shell and should be translated to C so it could give diagnostics. .br Even if "remote-system" is the local system, uudiff is subject to delays in uucp traffic. .br It should probably write the standard output, instead of insisting on going into the background. .br Since checksums are used there is a probability of 1 in 2**32 of missing differences between files. .br The ~userid syntax is not recognized. , and at present is only installed on the systems "research" and "inter". .br This program is written in shell and should be translated to C so it could give diagnostics. .br Even if "man/man1/uuencode.1c 644 0 33 3445 2512730543 7505 .TH UUENCODE 1C 6/1/80 .UC 4 .SH NAME uuencode,uudecode \- encode/decode a binary file for tranmission via mail .SH SYNOPSIS .B uuencode [ source ] remotedest | .B mail sys1!sys2!..!decode .br .B uudecode [ file ] .SH DESCRIPTION .I Uuencode and .I uudecode are used to send a binary file via uucp (or other) mail. This combination can be used over indirect mail links even when .I uusend(1) is not available. .PP .I Uuencode takes the named source file (default standard input) and produces an encoded version on the standard output. The encoding uses only printing ASCII characters, and includes the mode of the file and the .I remotedest for recreation on the remote system. .PP .I Uudecode reads an encoded file, strips off any leading and trailing lines added by mailers, and recreates the original file with the specified mode and name. .PP The intent is that all mail to the user ``decode'' should be filtered through the uudecode program. This way the file is created automatically without human intervention. This is possible on the uucp network by either using .I delivermail or by making .I rmail be a link to .I Mail instead of .I mail. In each case, an alias must be created in a master file to get the automatic invocation of uudecode. .PP If these facilities are not available, the file can be sent to a user on the remote machine who can uudecode it manually. .PP The encode file has an ordinary text form and can be edited by any text editor to change the mode or remote name. .SH SEE\ ALSO uuencode(5), uusend(1), uucp(1), uux(1), mail(1) .SH AUTHOR Mark Horton .SH BUGS The file is expanded by 35% (3 bytes become 4 plus control information) causing it to take longer to transmit. .PP The user on the remote system who is invoking .I uudecode (often .I uucp) must have write permission on the specified file. a user on the remote machine who can uudecode it manually. .PP The encode file has an ordinary text form and can be edited by any text editor to change the mode or remote name. .SH SEE\ ALSO uuencode(5), uusend(1), uucman/man1/uulog.1c 664 0 33 31 2512730544 6760 .so /usr/man/man1/uucp.1 AUTHOR Mark Horton .SH BUGS The file is expanded by 35% (3 bytes become 4 plus control information) causing it to take longer to transmit. .PP The user on the remote system who is invoking .I uudecode (often .I uucp) must have write permission on the specified file. a user on the remote machine who can uudecode it manually. .PP The encode file has an ordinary text form and can be edited by /( ,( 5Ċ /\@,\D"man/man1/uuname.1c 664 0 33 32 2551201453 7113 .so /usr/man/man1/uucp.1c AUTHOR Mark Horton .SH BUGS The file is expanded by 35% (3 bytes become 4 plus control information) causing it to take longer to transmit. .PP The user on the remote system who is invoking .I uudecode (often .I uucp) must have write permission on the specified file. a user on the remote machine who can uudecode it manually. .PP The encode file has an ordinary text form and can be edited by /( ,( 5Ċ /\@,\D"man/man1/uusend.1c 644 0 33 2363 2512730544 7200 .TH UUSEND 1C 6/1/80 .UC 4 .SH NAME uusend \- send a file to a remote host .SH SYNOPSIS .B uusend [ .B \-m mode ] sourcefile sys1!sys2!..!remotefile .SH DESCRIPTION .I Uusend sends a file to a given location on a remote system. The system need not be directly connected to the local system, but a chain of .I uucp(1) links needs to connect the two systems. .PP If the .B \-m option is specified, the mode of the file on the remote end will be taken from the octal number given. Otherwise, the mode of the input file will be used. .PP The sourcefile can be ``\-'', meaning to use the standard input. Both of these options are primarily intended for internal use of uusend. .PP The remotefile can include the ~userid syntax. .SH DIAGNOSTICS If anything goes wrong any further away than the first system down the line, you will never hear about it. .SH SEE\ ALSO uux(1), uucp(1), uuencode(1) .SH AUTHOR Mark Horton .SH BUGS This command shouldn't exist, since .I uucp should handle it. .PP All systems along the line must have the .I uusend command available and allow remote execution of it. .PP Some uucp systems have a bug where binary files cannot be the input to a uux command. If this bug exists in any system along the line, the file will show up severly munged. wrong any further away than the first system down the line, you will never hear about it. .SH SEE\ ALSO uux(1), uucp(1), uuencode(1) .SH AUTHOR Mark Horton .SH BUGS This command shouldn't exist, since .I uucp should handle it. .PP All systems along the line must have ((man/man1/uux.1c 644 0 33 3767 2531446133 6526 .TH UUX 1C .SH NAME uux \- unix to unix command execution .SH SYNOPSIS .B uux [ .B \- ] command-string .SH DESCRIPTION .I Uux will gather 0 or more files from various systems, execute a command on a specified system and send standard output to a file on a specified system. .PP The command-string is made up of one or more arguments that look like a shell command line, except that the command and file names may be prefixed by system-name!. A null system-name is interpreted as the local system. .PP File names may be one of .IP (1) a full pathname; .IP (2) a pathname preceded by .IR ~xxx ; where .I xxx is a userid on the specified system and is replaced by that user's login directory; .br .IP (3) anything else is prefixed by the current directory. .PP The `\-' option will cause the standard input to the .I uux command to be the standard input to the command-string. .PP For example, the command .IP uux "!diff usg!/usr/dan/f1 pwba!/a4/dan/f1 > !fi.diff" .PP will get the f1 files from the usg and pwba machines, execute a .I diff command and put the results in f1.diff in the local directory. .PP Any special shell characters such as <>;| should be quoted either by quoting the entire command-string, or quoting the special characters as individual arguments. .SH FILES /usr/uucp/spool - spool directory .br /usr/uucp/* - other data and programs .SH SEE ALSO uucp(1) .br D. A. Nowitz, .I Uucp Implementation Description .SH WARNING An installation may, and for security reasons generally will, limit the list of commands executable on behalf of an incoming request from .I uux. Typically, a restricted site will permit little other than the receipt of mail via .I uux. .SH BUGS Only the first command of a shell pipeline may have a system-name!. All other commands are executed on the system of the first command. .br The use of the shell metacharacter .B * will probably not do what you want it to do. .br The shell tokens << and >> are not implemented. .br There is no notification of denial of execution on the remote machine. s executaman/man1/vfontinfo.1 664 0 33 1773 2512730544 7550 .TH VFONTINFO 1 4/11/80 1 .UC 4 .SH NAME vfontinfo \- inspect and print out information about unix fonts .SH SYNOPSIS .br .B vfontinfo [ .B \-v ] fontname [ characters ] .SH DESCRIPTION .I Vfontinfo allows you to examine a font in the unix format. It prints out all the information in the font header and information about every non-null (width > 0) glyph. This can be used to make sure the font is consistent with the format. .PP The .I fontname argument is the name of the font you wish to inspect. It writes to standard output. If it can't find the file in your working directory, it looks in .B /usr/lib/vfont (the place most of the fonts are kept). .PP The .IR characters , if given, specify certain characters to show. If omitted, the entire font is shown. .PP If the .B \-v (verbose) flag is used, the bits of the glyph itself are shown as an array of X's and spaces, in addition to the header information. .SH "SEE ALSO" vpr(1), vfont(5) .br The Berkeley Font Catalog .SH AUTHORS Mark Horton .br Andy Hertzfeld tes tman/man1/vgrind.1 644 0 33 5465 2531446137 7034 .TH VGRIND 1 4/1/81 .UC 4 .SH NAME vgrind \- grind nice listings of programs .SH SYNOPSIS .B vgrind [ .B \-t ] [ .B \-n ] [ .B \-x ] [ .B \-W ] [ .B \-c ] [ .B \-m ] [ .B \-p ] [ .B \-i ] [ .B \-sn ] [ .B \-h header ] name ... .SH DESCRIPTION .I Vgrind formats the C, MODEL, or PASCAL programs which are arguments in a nice style using .I troff (1). Comments are placed in italics, keywords in bold face, and the name of the current function is listed down the margin of each page as it is encountered. .PP The .B \-W option sends the output to a 4 page wide raster plotter; normally, the output is printed on a narrow plotter. .PP The .B \-c, .B \-m, .B \-p, and .B \-i options select C, MODEL, PASCAL or ISP respectively as the language of the input files. The .B \-c switch is the default and need not be specified. .PP Font size may be specified using the .B \-s switch. The argument .B n is the point size (same as the argument of a .ps troff command). .PP The .B \-h option specifies a header to be placed at the top of each page. If the program is not source, but should be framed like the output of .I vgrind, the .B \-n option should be specified. .PP The .B \-t option is analogous to the .B \-t option of .IR troff (1) placing typesetter codes on the standard output. .PP To create an index, it is only necessary to create an empty file .I index in the current directory. As you run .I vgrind, the index will be automatically kept up to date. The index of function definitions can then be run off via giving .I vgrind the .B \-x option and the file .I index as argument. .SH FILES .ta 2i index file where source for index is created .br /usr/lib/tmac/tmac.vgrind macro package .br /usr/lib/vfontedpr preprocessor .SH AUTHOR William Joy .SH SEE ALSO vtroff(1) .SH BUGS Vfontedpr assumes that a certain programming style is followed: .PP For .B C - functions begin with the name of the function in column one, and lines defining functions end with a ). The function name is followed immediately by a ``('' with no intervening space. .PP For .B PASCAL - function names need to appear on the same line as the keywords .I function and .I procedure. The keyword .I end at the beginning of a line is interpreted as the end of the current function. .PP For .B MODEL - function names need to appear on the same line as the keywords .I is .I beginproc. .PP If these conventions are not followed, the indexing and marginal function name comment mechanisms will fail. .sp More generally, arbitrary formatting styles for programs mostly look bad. The use of spaces to align source code fails miserably; if you plan to .I vgrind your program you should use tabs. This is somewhat inevitable since the font used by .I vgrind is variable width. .PP Should be able to be used as a preprocessor .PP The mechanism of ctags in recognizing functions should be used here. oc. .PP If these conventions are not followed, the indexing and marginal function name comment mechanisms will fail. .sp More generally, arbitrary formatting styles for programs mostly look bad. The use man/man1/vi.1 644 0 33 3400 2512730545 6142 .TH VI 1 12/2/79 .UC .SH NAME vi \- screen oriented (visual) display editor based on ex .SH SYNOPSIS .B vi [ .B \-t tag ] [ .B \-r ] [ \fB+\fR\fIcommand\fR ] [ .B \-l ] [ \fB\-w\fIn\fR ] name ... .SH DESCRIPTION .I Vi (visual) is a display oriented text editor based on .IR ex (1). .I Ex and .I vi run the same code; it is possible to get to the command mode of .I ex from within .I vi and vice-versa. .PP The .I "Vi Quick Reference" card and the .I "Introduction to Display Editing with Vi" provide full details on using .I vi. .SH FILES See .IR ex (1). .SH SEE ALSO ex (1), edit (1), ``Vi Quick Reference'' card, ``An Introduction to Display Editing with Vi''. .SH AUTHOR William Joy .br Mark Horton added macros to \fIvisual\fR mode and is maintaining version 3 .SH BUGS Software tabs using \fB^T\fR work only immediately after the .I autoindent. .PP Left and right shifts on intelligent terminals don't make use of insert and delete character operations in the terminal. .PP The .I wrapmargin option can be fooled since it looks at output columns when blanks are typed. If a long word passes through the margin and onto the next line without a break, then the line won't be broken. .PP Insert/delete within a line can be slow if tabs are present on intelligent terminals, since the terminals need help in doing this correctly. .PP Saving text on deletes in the named buffers is somewhat inefficient. .PP The .I source command does not work when executed as \fB:source\fR; there is no way to use the \fB:append\fR, \fB:change\fR, and \fB:insert\fR commands, since it is not possible to give more than one line of input to a \fB:\fR escape. To use these on a \fB:global\fR you must \fBQ\fR to \fIex\fR command mode, execute them, and then reenter the screen editor with .I vi or .I open. ce the terminals need help in doing this correctly. .PP Saving text on deletes in the named buffers is somewhat inefficient. .PP The .I source command does not work when executed as \fB:source\fR; there is no way to use the \fB:append\fR, \fB:change\fR, an((man/man1/vmstat.1 644 0 33 5760 2527170237 7057 .TH VMSTAT 1 4/26/81 .de s1 .if n .sp .if t .sp .1i .. .de t1 .if n .ta 5n .if t .ta 1i .. .UC 4 .SH NAME vmstat \- report virtual memory statistics .SH SYNOPSIS .B vmstat [ .B \-fs ] [ interval [ count ] ] .SH DESCRIPTION .I Vmstat delves into the system and normally reports certain statistics kept about process, virtual memory, disk, trap and cpu activity. If given a .B \-f argument, it instead reports on the number of .I forks and .I vforks since system startup and the number of pages of virtual memory involved in each kind of fork. If given a .B \-s argument, it instead prints the contents of the .I sum structure, giving the total number of several kinds of paging related events which have occurred since boot. .PP If none of these options are given, .I vmstat will report in a (usually) iterative fashion on the virtual memory activity in the system. In this case, the optional .I interval argument causes .I vmstat to report once each .I interval seconds; ``vmstat 5'' will print what the system is doing every five seconds; this is a good choice of printing interval since this is how often some of the statistics are sampled in the system; others vary every second, running the output for a while will make it apparent which are recomputed every second. If a .I count is given, the statistics are repeated .I count times. The format fields are: .PP Procs: information about numbers of processes in various states. .s1 .t1 .nf r in run queue b blocked for resources (i/o, paging, etc.) w runnable or short sleeper (< 20 secs) but swapped .fi .s1 Memory: information about the usage of virtual and real memory. Virtual pages are considered active if they belong to processes which are running or have run in the last 20 seconds. A ``page'' here is 1024 bytes. .s1 .t1 .nf avm active virtual pages fre size of the free list .fi .s1 Page: information about page faults and paging activity. These are averaged each five seconds, and given in units per second. .s1 .t1 .nf re page reclaims (simulating reference bits) pi pages paged in po pages paged out fr pages freed per second de anticipated short term memory shortfall sr pages scanned by clock algorithm, per-second .fi .s1 up/hp/rk: Disk operations per second (this field is system dependent). Typically paging will be split across several of the available drives. The number under each of these is the unit number. .s1 Faults: trap/interrupt rate averages per second over last 5 seconds. .s1 .t1 .nf in (non clock) device interrupts per second sy system calls per second cs cpu context switch rate (switches/sec) .fi .s1 Cpu: breakdown of percentage usage of CPU time .s1 .nf us user time for normal and low priority processes sy system time id cpu idle .SH FILES /dev/kmem, /vmunix .SH SEE ALSO The sections starting with ``Interpreting system activity'' in .I "Setting up 4.1bsd" by W. Joy. .SH AUTHORS William Joy and Ozalp Babaoglu .SH BUGS There should be a screen oriented program which combines .I vmstat and .IR ps (1) in real time as well as reporting on other system activity. pu context switcman/man1/vpq.1 664 0 33 30 2512730545 6270 .so /usr/man/man1/vpr.1 i .s1 Cpu: breakdown of percentage usage of CPU time .s1 .nf us user time for normal and low priority processes sy system time id cpu idle .SH FILES /dev/kmem, /vmunix .SH SEE ALSO The sections starting with ``Interpreting system activity'' in .I "Setting up 4.1bsd" by W. Joy. .SH AUTHORS William Joy and Ozalp Babaoglu .SH BUGS There should be a screen oriented program which combines .I vmstat/( ,( 5 Ċ /\@,\D"man/man1/vpr.1 644 0 33 11053 2512730545 6356 .TH VPR 1 2/21/80 .UC 4 .SH NAME vpr, vprm, vpq, vprint \- raster printer/plotter spooler .SH SYNOPSIS .B vpr [ .B \-W ] [ .B \-l ] [ .B \-v ] [ .B \-t [ .B \-1234 font ] ] [ .B \-w ] [ \fB\-w\fIwidth\fR ] [ .B \-m ] [ name ... ] .br .B vprm [ id ... ] [ filename ... ] [ owner ... ] .br .B vpq .br .B vprint [ .B \-W ] file ... .SH DESCRIPTION .I Vpr causes the named files to be queued for printing or typeset simulation on one of the available raster printer/plotters. If no files are named, the standard input is read. By default the input is assumed to be line printer-like text. For very wide plotters, the input is run through the filter .I /usr/lib/sidebyside giving it an argument of .B \-w106 which arranges it four pages adjacent with 90 column lines (the rest is for the left margin). Since there are 8 lines per inch in the default printer font, .I vpr thus produces 86 lines per page (the top and bottom lines are left blank). .PP The following options are available: .TP 15 .B \-l Print the input in a more literal manner. Page breaks are not inserted, and most control characters (except format effectors: \\n, \\f, etc.) are printed (many control characters print special graphics not in the ASCII character set.) Tab and underline processing is still done. If this option is not given, control characters which are not format effectors are ignored, and page breaks are inserted after an appropriate number of lines have been printed on a page. .TP 15 .B \-W Queues files for printing on a wide output device, if available. Normally, files are queued for printing on a narrow output device. .TP 15 .B \-1234 Specifies a font to be mounted on font position \fIi\fR. The daemon will construct a \fI.railmag\fR file referencing \fI/usr/lib/vfont/name.size\fR. .TP 15 .B \-m Report by .IR mail (1) when printing is complete. .TP .B \-w (Applicable only to wide output devices.) Do not run the input through sidebyside. Such processing has been done already, or full (440 character) printer width is desired. .TP \fB\-w\fIwidth\fR Use width .I width rather than 90 for .I sidebyside. .TP .B \-v Use the filter .I /usr/lib/vrast to convert the vectors to raster. The named files must be a parameter and vector file (in that order) created by .IR versaplot (3x) routines. .TP .B \-t Use the filter .I /usr/lib/vcat to typeset the input on the printer/plotter. The input must have been generated by .IR troff (1) run with the .B \-t option. .B "This is not normally run directly" to wide output devices, since it is wasteful to run only one page across. The program .IR vtroff (1) is normally used and arranges, using .IR vsort (1) for printing to occur four pages across, conserving paper. .PP .I Vprm removes entries from the raster device queues. The id, filename or owner should be that reported by .I vpq. All apropriate files will be removed. Both queues are always searched. The id of each file removed from the queue will be printed. .PP .I Vpq prints the queues. Each entry in the queue is printed showing the owner of the queue entry, an identification number, the size of the entry in characters, and the file which is to be printed. The .I id is useful for removing a specific entry from the printer queue using .I vprm .PP .I Vprint is a shell script which .I pr's a copy of each named file on one of the electrostatic printer/plotters. The files are normally printed on a narrow device; .B \-W option causes them to be printed on a wide device. .SH FILES .ta 2i /usr/spool/v?d/* device spool areas .br /usr/lib/v?d daemons .br /usr/lib/vpd Versatec daemon .br /usr/lib/vpf filter for printer simulation .br /usr/lib/*vcat filter for typeset simulation .br /usr/lib/vrast filter for versaplot .br /usr/lib/sidebyside filter for wide output .SH "SEE ALSO" troff(1), vfont(5), vp(4), pti(1), vtroff(1), versaplot(3x) .SH BUGS You can't run bit maps in a queued fashion to the plotters. This is because the volume of the data (more than 1 Megabyte per vertical foot) is unwieldy. Instead you must follow the instructions in .IR vp (4) and run your program when the plotter is idle, or run it in the background and have it wait for the device to become idle. .PP Queued jobs print in directory (seemingly random) order. The plotters are fast enough that this is not a real problem. .PP The 1's (one's) and l's (lower-case el's) in a Benson-Varian's standard character set look very similar; caution is advised. .PP .I Vprm should have options allowing just one of the queues to be searched. .PP A versatec's hardware character set is rather ugly. .I Vprint should use one of the constant width fonts to produce prettier listings. e it wait for the device to become idle. .PP Queued jobs print in directory (seemingly random) order. The plotters are fast enough that this is not a real problem. .PP The 1's (one's) and l's (lower-case el's) in a Benson-Varian's standard character set look very similar; caution is advised. .PP .I Vprm should have options allowing just one of the queues to be searched. .PP A versatec's hardware character set is rather ugly. .I Vprint should use one of the constant((man/man1/vprint.1 664 0 33 30 2512730545 7004 .so /usr/man/man1/vpr.1 prettier listings. e it wait for the device to become idle. .PP Queued jobs print in directory (seemingly random) order. The plotters are fast enough that this is not a real problem. .PP The 1's (one's) and l's (lower-case el's) in a Benson-Varian's standard character set look very similar; caution is advised. .PP .I Vprm should have options allowing just one of the queues to be searched. .PP /( ,( 5@Ċ /\@,\D"man/man1/vprm.1 664 0 33 30 2512730545 6446 .so /usr/man/man1/vpr.1 prettier listings. e it wait for the device to become idle. .PP Queued jobs print in directory (seemingly random) order. The plotters are fast enough that this is not a real problem. .PP The 1's (one's) and l's (lower-case el's) in a Benson-Varian's standard character set look very similar; caution is advised. .PP .I Vprm should have options allowing just one of the queues to be searched. .PP /( ,( 5PĊ /\@,\D"man/man1/vtroff.1 644 0 33 4055 2527170234 7040 .TH VTROFF 1 8/28/80 .UC 4 .SH NAME vtroff \- troff to a raster plotter .SH SYNOPSIS .B vtroff [ .B \-w ] [ \fB\-F\fR majorfont ] [ \fB\-123\fR minorfont ] [ \fB\-l\fIlength\fR ] [ .B \-x ] troff arguments .SH DESCRIPTION .I Vtroff runs .IR troff (1) sending its output through various programs to produce typeset output on a raster plotter such as a Benson-Varian or or a Versatec. The .B \-W option specifies that a wide output device be used; the default is to use a narrow device. The .B \-l (lower case l) option causes the output to be split onto successive pages every .I length inches rather than the default 11''. .PP The default font is a Hershey font. If some other font is desired you can give a .B \-F argument and then the font name. This will place normal, italic and bold versions of the font on positions 1, 2, and 3. To place a font only on a single position, you can give an argument of the form .B \-\fIn\fR and the minor font name. A \fB.r\fR will be added to the minor font name if needed. Thus ``vtroff \-ms paper'' will set a paper in the Hershey font, while ``vtroff \-F nonie \-ms paper'' will set the paper in the (sans serif) nonie font. The .B \-x option asks for exact simulation of photo-typesetter output. (I.e. using the width tables for the C.A.T. photo-typesetter) .SH FILES .ta 2i /usr/lib/tmac/tmac.vcat default font mounts and bug fixes .br /usr/lib/fontinfo/* fixes for other fonts .br /usr/lib/vfont directory containing fonts .SH SEE ALSO troff(1), nettroff(1), vfont(5), vpr(1) .SH BUGS Since some macro packages work correctly only if the fonts named R, I, B, and S are mounted, and since the Versatec fonts have different widths for individual characters than the fonts found on the typesetter, the following dodge was necessary: If you don't use the ``.fp'' troff directive then you get the widths of the standard typesetter fonts suitable for shipping the output of troff over the network to the computer center A machine for phototypesetting. If, however, you remount the R, I, B and S fonts, then you get the width tables for the Versatec. f the fonts named R, I, B, and S are mounted, and since the Versatec fonts have different widths for individual characters than the fonts found on the typesetter, the following dodge was necessary: If you don't use the ``.fp'' troff directive then you get the widths of the standard typesetter fonts suitable for shipping the output of troff over the network to the computer center A machine for phototypesetting. If, however, you remount the R, I, B and S fonts, theman/man1/w.1 664 0 33 4474 2512730546 6011 .TH W 1 8/15/80 .UC 4 .SH NAME w \- who is on and what they are doing .SH SYNOPSIS .B w [ .B \-h ] [ .B \-s ] [ user ] .SH DESCRIPTION .I W prints a summary of the current activity on the system, including what each user is doing. The heading line shows the current time of day, how long the system has been up, the number of users logged into the system, and the load averages. The load average numbers give the number of jobs in the run queue averaged over 1, 5 and 15 minutes. .PP The fields output are: the users login name, the name of the tty the user is on, the time of day the user logged on, the number of minutes since the user last typed anything, the CPU time used by all processes and their children on that terminal, the CPU time used by the currently active processes, the name and arguments of the current process. .PP The .B \-h flag suppresses the heading. The .B \-s flag asks for a short form of output. In the short form, the tty is abbreviated, the login time and cpu times are left off, as are the arguments to commands. .B \-l gives the long output, which is the default. .PP If a .I user name is included, the output will be restricted to that user. .SH FILES .ta 1i /etc/utmp .br /dev/kmem .br /dev/drum .SH "SEE ALSO" who(1), finger(1), ps(1) .SH AUTHOR Mark Horton .SH BUGS The notion of the ``current process'' is muddy. The current algorithm is ``the highest numbered process on the terminal that is not ignoring interrupts, or, if there is none, the highest numbered process on the terminal''. This fails, for example, in critical sections of programs like the shell and editor, or when faulty programs running in the background fork and fail to ignore interrupts. (In cases where no process can be found, .I w prints ``\-''.) .PP The CPU time is only an estimate, in particular, if someone leaves a background process running after logging out, the person currently on that terminal is ``charged'' with the time. .PP Background processes are not shown, even though they account for much of the load on the system. .PP Sometimes processes, typically those in the background, are printed with null or garbaged arguments. In these cases, the name of the command is printed in parentheses. .PP W does not know about the new conventions for detection of background jobs. It will sometimes find a background job instead of the right one. nning after logging out, the person currently on that terminal is ``charged'' with the time. .PP Background processes are not shown, even though they account for much of the load on the system. .Pman/man1/wait.1 644 0 33 1011 2512730546 6465 .TH WAIT 1 .SH NAME wait \- await completion of process .SH SYNOPSIS .B wait .SH DESCRIPTION Wait until all processes started with .B & have completed, and report on abnormal terminations. .PP Because the .IR wait (2) system call must be executed in the parent process, the Shell itself executes .I wait, without creating a new process. .SH "SEE ALSO" sh(1) .SH BUGS Not all the processes of a 3- or more-stage pipeline are children of the Shell, and thus can't be waited for. (This bug does not apply to .IR csh (1).) 1 .SH NAME wait \- await completion of process .SH SYNOPSIS .B wait .SH DESCRIPTION Wait until all processes started with .B & have completed, and report on abnormal terminations. .PP Because the .IR wait (2) system call must be executed in the parent process, the Shell itself executes .I wait, without creating a new process. .SH "SEE ALSO" sh(1) .SH BUGS Not all the processes of a 3- or more-stage pipeline are children of the Shell, and thus can't be waited for. (This bug does not apply to .IR cman/man1/wall.1 644 0 33 730 2512730546 6447 ((.TH WALL 1 .UC 4 .SH NAME wall \- write to all users .SH SYNOPSIS .B wall .SH DESCRIPTION .I Wall reads its standard input until an end-of-file. It then sends this message, preceded by `Broadcast Message ...', to all logged in users. .PP The sender should be super-user to override any protections the users may have invoked. .SH FILES /dev/tty? .br /etc/utmp .SH "SEE ALSO" mesg(1), write(1) .SH DIAGNOSTICS `Cannot send to ...' when the open on a user's tty file fails. /\@,\D"man/man1/wc.1 644 0 33 2526 2512730546 6146 .TH WC 1 .UC 4 .SH NAME wc \- word count .SH SYNOPSIS .B wc [ .B \-lwcpt ] [ .BI \-b baud ] [ .BI \-s pagesize ] [ .B \-u ] [ .B \-v ] [ name ... ] .SH DESCRIPTION .I Wc counts lines, words and characters, and optionally pages and the print time, in the named files, or in the standard input if no name appears. A word is a maximal string of characters delimited by spaces, tabs or newlines. .PP If an argument beginning with one of ``lwcpt'' is present, the specified counts (lines, words, characters, pages, or time) are selected by the letters .BR l , .BR w , .BR c , .BR p , or .BR t . The default is .B \-lwc unless .B \-v is specified. .PP The .B \-b option asks that the time be figured at the specified baud rate instead of the default 300 baud. .PP The .B \-s option specifies that pages are .I pagesize lines long instead of the default 66. .PP The .B \-u options asks that the time printed be based on uucp transmission time, about 90% as fast as normal. .PP The .B \-v option asks for a verbose output format, with headers and including pages and time by default. .SH BUGS The times given do not take into account variable factors such as system load; delays due to tab expansion or tty driver delays, which can be a factor with cu; or uucp delays such as mail headers, auxillary protocol files, or the time taken to initially connect to another site. P The .B \-u options asks that the time printed be based on uucp transmission time, about 90% as fast as normal. .PP The .B \-v option asks for a verbose output format, wman/man1/what.1 644 0 33 1066 2512730546 6476 .TH WHAT 1 .UC 4 .SH NAME what \- show what versions of object modules were used to construct a file .SH SYNOPSIS .B what name ... .SH DESCRIPTION .I What reads each file and searches for sequences of the form ``@(#)'' as inserted by the source code control system. It then prints the remainder of the string after this marker, up to a null character, newline, double quote, or ``>'' character. .SH BUGS As SCCS is not licensed with UNIX/32V, this is a rewrite of the .I what command which is part of SCCS, and may not behave exactly the same as that command does. f object modules were used to construct a file .SH SYNOPSIS .B what name ... .SH DESCRIPTION .I What reads each file and searches for sequences of the form ``@(#)'' as inserted by the source code control system. It then prints the remainder of the string after this marker, up to a null character, newline, double quote, or ``>'' character. .SH BUGS As SCCS is not licensed with UNIX/32V, this is a rewrite of the .I what command which is part of SCCS, and man/man1/whatis.1 664 0 33 1161 2512730546 7030 .TH WHATIS 1 .UC 4 .SH NAME whatis \- describe what a command is .SH SYNOPSIS .B whatis command ... .SH DESCRIPTION .I Whatis looks up a given command and gives the header line from the manual section. You can then run the .IR man (1) command to get more information. If the line starts `name(section) ...' you can do `man section name' to get the documentation for it. Try `whatis ed' and then you should do `man 1 ed' to get the manual. .PP .I Whatis is actually just the .B \-f option to the .IR man (1) command. .SH FILES .DT /usr/lib/whatis Data base .SH "SEE ALSO" apropos(1), man(1), catman(8) .SH AUTHOR William Joy ON .I Whatis looks up a given command and gives the header line from the manual section. You can then run the .IR man (1) command to get more information. If the line starts `name(section) ...' you can do `man section name' to get the documentation for it. Try `whatis ed' and then you should do `man 1 ed' to get the manual. .PP .I Whatis is actually just the .B \-f option to the .IR man (1) commman/man1/whereis.1 644 0 33 3234 2512730546 7200 .TH WHEREIS 1 2/24/79 .UC .SH NAME whereis \- locate source, binary, and or manual for program .SH SYNOPSIS .B whereis [ .B \-sbm ] [ .B \-u ] [ .B \-SBM dir ... .B \-f ] name ... .SH DESCRIPTION .I Whereis locates source/binary and manuals sections for specified files. The supplied names are first stripped of leading pathname components and any (single) trailing extension of the form ``.ext'', e.g. ``.c''. Prefixes of ``s.'' resulting from use of source code control are also dealt with. .I Whereis then attempts to locate the desired program in a list of standard places. If any of the .B \-b, .B \-s or .B \-m flags are given then .I whereis searches only for binaries, sources or manual sections respectively (or any two thereof). The .B \-u flag may be used to search for unusual entries. A file is said to be unusual if it does not have one entry of each requested type. Thus ``whereis -m -u *'' asks for those files in the current directory which have no documentation. .sp Finally, the .B \-B .B \-M and .B \-S flags may be used to change or otherwise limit the places where .I whereis searches. The .B \-f file flags is used to terminate the last such directory list and signal the start of file names. .SH EXAMPLE The following finds all the files in /usr/bin which are not documented in /usr/man/man1 with source in /usr/src/cmd: .IP cd /usr/ucb .br whereis \-u \-M /usr/man/man1 \-S /usr/src/cmd \-f * .SH FILES /usr/src/* .br /usr/{doc,man}/* .br /lib, /etc, /usr/{lib,bin,ucb,old,new,local} .SH AUTHOR William Joy .SH BUGS Since the program uses .IR chdir (2) to run faster, pathnames given with the .B \-M .B \-S and .B \-B must be full; i.e. they must begin with a ``/''. and signal the start of file names. .SH EXAMPLE The following finds all the files in /usr/bin which are not documented in /usr/man/man1 with source in /usr/src/cmd: .IP cd /usr/ucb .br whereis \-u \-M /usr/man/man1 \-S /usr/src/cmd \-f * .SH FILES /usr/src/* .br /usr/{doc,man}/* .br /lib, /etc, /usr/{lib,bin,ucb,old,new,local} .SH AUTHOR William Joy .SH man/man1/which.1 664 0 33 1505 2512730547 6636 .TH WHICH 1 10/10/79 .UC .SH NAME which \- locate a program file including aliases and paths (\fIcsh\fR only) .SH SYNOPSIS .B which [ name ] ... .SH DESCRIPTION .I Which takes a list of names and looks for the files which would be executed had these names been given as commands. Each argument is expanded if it is aliased, and searched for along the user's path. Both aliases and path are taken from the user's \&.cshrc file. .SH FILES .ta 1i ~/\&.cshrc source of aliases and path values .SH DIAGNOSTICS A diagnostic is given for names which are aliased to more than a single word, or if an executable file with the argument name was not found in the path. .SH BUGS Only aliases and paths from ~/\&.cshrc are used, importing from the current environment is not attempted. Must be executed by a csh, since only csh's know about aliases. nd searched for along the user's path. Both aliases and path are taken from the user's \&.cshrc file. .SH FILES .ta 1i ~/\&.cshrc source of aliases and path values .SH DIAGNOSTICS A diagnman/man1/who.1 644 0 33 1756 2512730547 6337 ((.TH WHO 1 .SH NAME who \- who is on the system .SH SYNOPSIS .B who [ who-file ] [ .B "am I" ] .SH DESCRIPTION .I Who, without an argument, lists the login name, terminal name, and login time for each current UNIX user. .PP Without an argument, .I who examines the /etc/utmp file to obtain its information. If a file is given, that file is examined. Typically the given file will be /usr/adm/wtmp, which contains a record of all the logins since it was created. Then .I who lists logins, logouts, and crashes since the creation of the wtmp file. Each login is listed with user name, terminal name (with `/dev/' suppressed), and date and time. When an argument is given, logouts produce a similar line without a user name. Reboots produce a line with `x' in the place of the device name, and a fossil time indicative of when the system went down. .PP With two arguments, as in `who am I' (and also `who are you'), .I who tells who you are logged in as. .SH FILES /etc/utmp .SH "SEE ALSO" getuid(2), utmp(5) s, and crashes sinman/man1/whoami.1 664 0 33 443 2512730547 7000 .TH WHOAMI 1 2/24/79 .UC .SH NAME whoami \- print effective current user id .SH SYNOPSIS .B whoami .SH DESCRIPTION .I Whoami prints who you are. It works even if you are su'd, while `who am i' does not since it uses /etc/utmp. .SH FILES .DT /etc/passwd Name data base .SH "SEE ALSO" who (1) e indicative of when the system went down. .PP With two arguments, as in `who am I' (and also `who are you'), .I who tells who yo/( ,( 5Ċ /\@,\D"man/man1/write.1 644 0 33 2666 2512730547 6675 .TH WRITE 1 .SH NAME write \- write to another user .SH SYNOPSIS .B write user [ ttyname ] .SH DESCRIPTION .I Write copies lines from your terminal to that of another user. When first called, it sends the message .PP Message from yourname yourttyname... .PP The recipient of the message should write back at this point. Communication continues until an end of file is read from the terminal or an interrupt is sent. At that point .I write writes `EOT' on the other terminal and exits. .PP If you want to write to a user who is logged in more than once, the .I ttyname argument may be used to indicate the appropriate terminal name. .PP Permission to write may be denied or granted by use of the .I mesg command. At the outset writing is allowed. Certain commands, in particular .I nroff and .IR pr (1) disallow messages in order to prevent messy output. .PP If the character `!' is found at the beginning of a line, .I write calls the shell to execute the rest of the line as a command. .PP The following protocol is suggested for using .IR write : when you first write to another user, wait for him to write back before starting to send. Each party should end each message with a distinctive signal\(em\fB(o)\fR for `over' is conventional\(emthat the other may reply. .B (oo) for `over and out' is suggested when conversation is about to be terminated. .SH FILES /etc/utmp to find user .br /bin/sh to execute `!' .SH "SEE ALSO" mesg(1), who(1), mail(1) execute the rest of the line as a command. .PP The following protocol is man/man1/xget.1 664 0 33 32 2512730547 6435 .so /usr/man/man1/xsend.1 ite : when you first write to another user, wait for him to write back before starting to send. Each party should end each message with a distinctive signal\(em\fB(o)\fR for `over' is conventional\(emthat the other may reply. .B (oo) for `over and out' is suggested when conversation is about to be terminated. .SH FILES /etc/utmp to find user .br /bin/sh to execute `!' .SH "SEE ALSO" mesg(1)/( ,( 5 Ċ /\@,\D"man/man1/xsend.1 644 0 33 1754 2512730547 6661 .TH XSEND 1 .SH NAME xsend, xget, enroll \- secret mail .SH SYNOPSIS .B xsend person .br .B xget .br .B enroll .SH DESCRIPTION These commands implement a secure communication channel; it is like .IR mail (1), but no one can read the messages except the intended recipient. The method embodies a public-key cryptosystem using knapsacks. .PP To receive messages, use .IR enroll ; it asks you for a password that you must subsequently quote in order to receive secret mail. .PP To receive secret mail, use .IR xget . It asks for your password, then gives you the messages. .PP To send secret mail, use .IR xsend in the same manner as the ordinary mail command. (However, it will accept only one target). A message announcing the receipt of secret mail is also sent by ordinary mail. .SH FILES /usr/spool/secretmail/*.key: keys /usr/spool/secretmail/*.[0-9]: messages .SH SEE ALSO mail (1) .SH BUGS It should be integrated with ordinary mail. The announcement of secret mail makes traffic analysis possible. mail, use .IR xget man/man1/xstr.1 644 0 33 4732 2512730547 6537 .TH XSTR 1 2/24/79 .UC .SH NAME xstr \- extract strings from C programs to implement shared strings .SH SYNOPSIS .B xstr [ .B \-c ] [ .B \- ] [ file ] .SH DESCRIPTION .I Xstr maintains a file .I strings into which strings in component parts of a large program are hashed. These strings are replaced with references to this common area. This serves to implement shared constant strings, most useful if they are also read-only. .PP The command .PP .DT \fBxstr \-c\fR name .PP will extract the strings from the C source in name, replacing string references by expressions of the form (&xstr[number]) for some number. An appropriate declaration of .I xstr is prepended to the file. The resulting C text is placed in the file .I x.c, to then be compiled. The strings from this file are placed in the .I strings data base if they are not there already. Repeated strings and strings which are suffices of existing strings do not cause changes to the data base. .PP After all components of a large program have been compiled a file .I xs.c declaring the common .I xstr space can be created by a command of the form .PP .DT \fBxstr\fR .PP This .I xs.c file should then be compiled and loaded with the rest of the program. If possible, the array can be made read-only (shared) saving space and swap overhead. .PP .I Xstr can also be used on a single file. A command .PP .DT \fBxstr\fR name .PP creates files .I x.c and .I xs.c as before, without using or affecting any .I strings file in the same directory. .PP It may be useful to run .I xstr after the C preprocessor if any macro definitions yield strings or if there is conditional code which contains strings which may not, in fact, be needed. .I Xstr reads from its standard input when the argument `\-' is given. An appropriate command sequence for running .I xstr after the C preprocessor is: .PP .nf .DT \fBcc \-E\fR name.c | \fBxstr \-c\fR \- \fBcc \-c\fR x.c \fBmv\fR x.o name.o .fi .PP .I Xstr does not touch the file .I strings unless new items are added, thus .I make can avoid remaking .I xs.o unless truly necessary. .SH FILES .DT strings Data base of strings .br x.c Massaged C source .br xs.c C source for definition of array `xstr' .br /tmp/xs* Temp file when `xstr name' doesn't touch .I strings .SH "SEE ALSO" mkstr(1) .SH AUTHOR William Joy .SH BUGS If a string is a suffix of another string in the data base, but the shorter string is seen first by .I xstr both strings will be placed in the data base, when just placing the longer one there will do. ed, thus .I make can avoid remaking .Iman/man1/yacc.1 644 0 33 3521 2531446133 6445 ((.TH YACC 1 .SH NAME yacc \- yet another compiler-compiler .SH SYNOPSIS .B yacc [ .B \-vd ] grammar .SH DESCRIPTION .I Yacc converts a context-free grammar into a set of tables for a simple automaton which executes an LR(1) parsing algorithm. The grammar may be ambiguous; specified precedence rules are used to break ambiguities. .PP The output file, .IR y.tab.c , must be compiled by the C compiler to produce a program .IR yyparse . This program must be loaded with the lexical analyzer program, .IR yylex , as well as .I main and .IR yyerror , an error handling routine. These routines must be supplied by the user; .IR Lex (1) is useful for creating lexical analyzers usable by .IR yacc . .PP If the .B \-v flag is given, the file .I y.output is prepared, which contains a description of the parsing tables and a report on conflicts generated by ambiguities in the grammar. .PP If the \-\fBd\fR flag is used, the file .I y.tab.h is generated with the .I define statements that associate the .I yacc\c -assigned `token codes' with the user-declared `token names'. This allows source files other than .I y.tab.c to access the token codes. .SH FILES .ta \w'yacc.tmp, yacc.acts 'u y.output .br y.tab.c .br y.tab.h defines for token names .br yacc.tmp, yacc.acts temporary files .br /usr/lib/yaccpar parser prototype for C programs .SH "SEE ALSO" .IR lex (1) .br .I "LR Parsing" by A. V. Aho and S. C. Johnson, Computing Surveys, June, 1974. .br .I "YACC \- Yet Another Compiler Compiler" by S. C. Johnson. .SH DIAGNOSTICS The number of reduce-reduce and shift-reduce conflicts is reported on the standard output; a more detailed report is found in the .I y.output file. Similarly, if some rules are not reachable from the start symbol, this is also reported. .SH BUGS Because file names are fixed, at most one .I yacc process can be active in a given directory at a time. r .I "LR Parsing" by A. V. Aho and S. C. Johnson, Computing Surveys, June, 1974. .br .I "YACC \- Yet Another Compiler Compiler" by S. C. Johnson. .SH DIAGNOSTICS The number ofman/man1/yes.1 664 0 33 374 2512730550 6311 .TH YES 1 .UC 4 .SH NAME yes \- be repetitively affirmative .SH SYNOPSIS .B yes [ .B expletive ] .SH DESCRIPTION .B Yes repeatedly outputs \*(lqy\*(rq, or if .B expletive is given, that is output repeatedly. Termination is by rubout. .SH BUGS Boring. are fixed, at most one .I yacc process can be active in a given directory at a time. r .I "LR Parsing" by A. V. Aho and S. C. Johnson, Computing Surveys, June, 1974. .b/( ,( 5`Ċ /\@,\D"man/man1/pmerge.1 644 0 33 1444 2527170236 7012 .TH PMERGE 1 VAX-11 .UC 4 .SH NAME pmerge \- pascal file merger .SH SYNOPSIS .B pmerge name.p ... .SH DESCRIPTION .I Pmerge assembles the named Pascal files into a single standard Pascal program. The resulting program is listed on the standard output. It is intended to be used to merge a collection of separately compiled modules so that they can be run through .B pi , or exported to other sites. .SH FILES .ta 1.5i /usr/tmp/MG\(** default temporary files .br .SH "SEE ALSO" pc(1), pi(1), .br Auxiliary documentation .I Berkeley Pascal User's Manual. .SH AUTHOR M. Kirk McKusick .SH BUGS Very minimal error checking is done, so incorrect programs will produce unpredictable results. Block comments should be placed after the keyword to which they refer or they are likely to end up in bizarre places. lection of separately compiled modules so that they can be run through .B pi , or exported to other sites. .SH FILES .ta 1.5i /usr/tmp/MG\(** default temporary files .br .SH "SEE ALSO" pc(1), pi(1), .br Auxiliary documeman/man2/ 775 0 33 0 2512730571 5362 man/man2/access.2 644 0 33 2226 2512730553 6773 .TH ACCESS 2 .SH NAME access \- determine accessibility of file .SH SYNOPSIS .nf .B access(name, mode) .B char *name; .fi .SH DESCRIPTION .I Access checks the given file .I name for accessibility according to .I mode, which is 4 (read), 2 (write) or 1 (execute) or a combination thereof. Specifying mode 0 tests whether the directories leading to the file can be searched and the file exists. .PP An appropriate error indication is returned if .I name cannot be found or if any of the desired access modes would not be granted. On disallowed accesses \-1 is returned and the error code is in .IR errno . 0 is returned from successful tests. .PP The user and group IDs with respect to which permission is checked are the real UID and GID of the process, so this call is useful to set-UID programs. .PP Notice that it is only access bits that are checked. A directory may be announced as writable by .I access, but an attempt to open it for writing will fail (although files may be created there); a file may look executable, but .I exec will fail unless it is in proper format. .PP .SH SEE ALSO stat(2) .SH "ASSEMBLER (PDP-11)" (access = 33.) .br .B sys access; name; mode oup IDs with respect to which permission is checked are the real UID and GID of the process, so this call is useful to set-UID programs. .PP Notice that it is only access bits that are checked. A directory may be announced as writable by .I access, but an attempt to open it for writing will fail (although files may be created there); a file may look executableman/man2/acct.2 644 0 33 1615 2512730554 6446 .TH ACCT 2 .SH NAME acct \- turn accounting on or off .SH SYNOPSIS .nf .B acct(file) .B char *file; .fi .SH DESCRIPTION The system is prepared to write a record in an accounting .I file for each process as it terminates. This call, with a null-terminated string naming an existing file as argument, turns on accounting; records for each terminating process are appended to .IR file . An argument of 0 causes accounting to be turned off. .PP The accounting file format is given in .IR acct (5). .SH "SEE ALSO" acct(5), sa(8) .SH DIAGNOSTICS On error \-1 is returned. The file must exist and the call may be exercised only by the super-user. It is erroneous to try to turn on accounting when it is already on. .SH BUGS No accounting is produced for programs running when a crash occurs. In particular nonterminating programs are never accounted for. .SH "ASSEMBLER (PDP-11)" (acct = 51.) .br .B sys acct; file of 0 causes accounting to be turned off. .PP The accounting file format is given in .IR acct (5). .SH "SEE ALSO" acman/man2/alarm.2 644 0 33 1735 2512730554 6633 .TH ALARM 2 .SH NAME alarm \- schedule signal after specified time .SH SYNOPSIS .nf .B alarm(seconds) .B unsigned seconds; .fi .SH DESCRIPTION .I Alarm causes signal SIGALRM, see .IR signal (2), to be sent to the invoking process in a number of seconds given by the argument. Unless caught or ignored, the signal terminates the process. .PP Alarm requests are not stacked; successive calls reset the alarm clock. If the argument is 0, any alarm request is canceled. Because the clock has a 1-second resolution, the signal may occur up to one second early; because of scheduling delays, resumption of execution of when the signal is caught may be delayed an arbitrary amount. The longest specifiable delay time is 2147483647 seconds. .PP The return value is the amount of time previously remaining in the alarm clock. .SH "SEE ALSO" pause(2), signal(2), sigsys(2), sigset(3), sleep(3) .SH "ASSEMBLER (PDP-11)" (alarm = 27.) .br (seconds in r0) .br .B sys alarm .br (previous amount in r0) e clock has a 1-second resolution, ((man/man2/brk.2 644 0 33 3306 2512730554 6311 .TH BRK 2 .UC 4 .SH NAME brk, sbrk, break \- change core allocation .SH SYNOPSIS .B char *brk(addr) .PP .B char *sbrk(incr) .SH DESCRIPTION .I Brk sets the system's idea of the lowest location not used by the program (called the break) to .I addr (rounded up to the next multiple of 64 bytes on the PDP11, 256 bytes on the Interdata 8/32, and 1024 bytes on a VAX-11). Locations not less than .I addr and below the stack pointer are not in the address space and will thus cause a memory violation if accessed. .PP In the alternate function .I sbrk, .I incr more bytes are added to the program's data space and a pointer to the start of the new area is returned. .PP When a program begins execution via .I exec the break is set at the highest location defined by the program and data storage areas. Ordinarily, therefore, only programs with growing data areas need to use .IR break . .PP The .IR vlimit (2) system call may be used to determine the maximum permissible size of the .I data region; it will not be possible to set the break beyond \*(lqetext + vlimit(LIM_DATA, \-1).\*(rq (See .IR end (3) for the definition of .IR etext .) .SH "SEE ALSO" exec(2), vlimit(2), malloc(3), end(3) .SH DIAGNOSTICS Zero is returned if the .I brk could be set; \-1 if the program requests more memory than the system limit or if too many segmentation registers would be required to implement the break. .I Sbrk returns \-1 if the break could not be set. .SH BUGS Setting the break in the range 0177701 to 0177777 (on the PDP11) is the same as setting it to zero. .SH "ASSEMBLER (PDP-11)" (break = 17.) .br .B sys break; addr .PP .I Break performs the function of .IR brk . The name of the routine differs from that in C for historical reasons. if the .I brk could be set; \-1 if the program requests more memory than the system limit or if too many segmentation registers would be required to implement the break. .I Sbrk returns \-1 if the break could not be set. .SH BUGS Setting the break in the range 0177701 to 0177777 (on the PDP11) is the same as setman/man2/chdir.2 644 0 33 1074 2512730554 6624 .TH CHDIR 2 .SH NAME chdir \- change current working directory .SH SYNOPSIS .nf .B chdir(dirname) .B char *dirname; .fi .SH DESCRIPTION .I Dirname is the address of the pathname of a directory, terminated by a null byte. .I Chdir causes this directory to become the current working directory, the starting point for path names not beginning with `/'. .SH "SEE ALSO" cd(1) .SH DIAGNOSTICS Zero is returned if the directory is changed; \-1 is returned if the given name is not that of a directory or is not searchable. .SH ASSEMBLER (chdir = 12.) .br .B sys chdir; dirname ory .SH SYNOPSIS .nf .B chdir(dirname) .B char *dirname; .fi .SH DESCRIPTION .I Dirname is the address of the pathname of a directory, terminated by a null byte. .I Chdir causes this directory to become the current working directory, the starting point for path names not beginning with `/'. .SH "SEE ALSO" cd(1) .SH DIAGNOSTICS Zero is returned if the directory is changed; \-1 is returned if the given name is not that of a directory or is not searchman/man2/chmod.2 644 0 33 3076 2531446172 6632 .TH CHMOD 2 .UC 4 .SH NAME chmod \- change mode of file .SH SYNOPSIS .nf .B chmod(name, mode) .B char *name; .fi .SH DESCRIPTION The file whose name is given as the null-terminated string pointed to by .I name has its mode changed to .IR mode . Modes are constructed by .IR or ing together some combination of the following: .PP .RS 04000 set user ID on execution 02000 set group ID on execution 01000 save text image after execution 00400 read by owner 00200 write by owner 00100 execute (search on directory) by owner 00070 read, write, execute (search) by group 00007 read, write, execute (search) by others .RE .PP If an executable file is set up for sharing (this is the default) then mode 1000 prevents the system from abandoning the swap-space image of the program-text portion of the file when its last user terminates. Ability to set this bit is restricted to the super-user since swap space is consumed by the images. See .IR sticky (8). .PP Only the owner of a file (or the super-user) may change the mode. Only the super-user can set the 1000 mode. .PP On some systems, writing or changing the owner of a file turns off the set-user-id bit. This makes the system somewhat more secure by protecting set-user-id files from remaining set-user-id if they are modified, at the expense of a degree of compatibility. .SH "SEE ALSO" chmod(1) .SH DIAGNOSTIC Zero is returned if the mode is changed; \-1 is returned if .I name cannot be found or if the current user is neither the owner of the file nor the super-user. .SH "ASSEMBLER (PDP-11)" (chmod = 15.) .br .B sys chmod; name; mode ems, writing or changing the owner of a file turns off the set-user-id bit. This makes the system somewhat more secure by protecting set-user-id files from remaining set-user-id if they are modified, at the expense of a degree of compatibility. .SH "SEE ALSO" chmod(1) .SH DIAGNOSTIC Zero is returned if the mode is changed; \-1 is returned if .I name cannot be found or if the current user is neither the owner of the file nor the super-user. .SH "Aman/man2/chown.2 644 0 33 1445 2512730555 6654 .TH CHOWN 2 .UC 4 .SH NAME chown \- change owner and group of a file .SH SYNOPSIS .nf .B chown(name, owner, group) .B char *name; .fi .SH DESCRIPTION The file whose name is given by the null-terminated string pointed to by .I name has its .I owner and .I group changed as specified. Only the super-user may execute this call, because if users were able to give files away, they could defeat the (nonexistent) file-space accounting procedures. .PP On some systems, .I chown clears the set-user-id bit on the file to prevent accidental creation of set-user-id programs owned by the super-user. .SH "SEE ALSO" chown(1), passwd(5) .SH DIAGNOSTICS Zero is returned if the owner is changed; \-1 is returned on illegal owner changes. .SH "ASSEMBLER (PDP-11)" (chown = 16.) .br .B sys chown; name; owner; group super-user may execute this call, because if users were able to give files away, they could defeat the (nonexistent) file-space accounting procedures. .PP On some systems, .I chown clears the set-user-id bit on the filman/man2/close.2 644 0 33 1706 2512730555 6643 .TH CLOSE 2 .UC 4 .SH NAME close \- close a file .SH SYNOPSIS .B close(fildes) .SH DESCRIPTION Given a file descriptor such as returned from an .I open, .I creat, .I dup or .IR pipe (2) call, .I close closes the associated file. A close of all files is automatic on .I exit, but since there is a limit on the number of open files per process, .I close is necessary for programs which deal with many files. .PP Files are closed upon termination of a process, and certain high-numbered file descriptors are closed by .IR exec (2), and it is possible to arrange for others to be closed (see FIOCLEX in .IR ioctl (2)). .SH "SEE ALSO" creat(2), open(2), pipe(2), exec(2), ioctl(2) .SH DIAGNOSTICS Zero is returned if a file is closed; \-1 is returned for an unknown file descriptor. .SH "ASSEMBLER (PDP-11)" (close = 6.) .br (file descriptor in r0) .br .B sys close .PP .SH BUGS A file cannot be closed while there are pages which have been .I vread but not referenced. ess, and certain high-numbered file descriptors are closedman/man2/creat.2 644 0 33 2755 2512730555 6641 ((.TH CREAT 2 .SH NAME creat \- create a new file .SH SYNOPSIS .nf .B creat(name, mode) .B char *name; .fi .SH DESCRIPTION .I Creat creates a new file or prepares to rewrite an existing file called .I name, given as the address of a null-terminated string. If the file did not exist, it is given mode .IR mode , as modified by the process's mode mask (see .IR umask (2)). Also see .IR chmod (2) for the construction of the .I mode argument. .PP If the file did exist, its mode and owner remain unchanged but it is truncated to 0 length. .PP The file is also opened for writing, and its file descriptor is returned. .PP The .I mode given is arbitrary; it need not allow writing. This feature is used by programs which deal with temporary files of fixed names. The creation is done with a mode that forbids writing. Then if a second instance of the program attempts a .I creat, an error is returned and the program knows that the name is unusable for the moment. .SH "SEE ALSO" write(2), close(2), chmod(2), umask (2) .SH DIAGNOSTICS The value \-1 is returned if: a needed directory is not searchable; the file does not exist and the directory in which it is to be created is not writable; the file does exist and is unwritable; the file is a directory; there are already too many files open. .SH "ASSEMBLER (PDP-11)" (creat = 8.) .br .B sys creat; name; mode .br (file descriptor in r0) .SH BUGS A file cannot be truncated while any process has pages set up by a .I vread on that file which have not been referenced. , umask (2) .SH DIAman/man2/dup.2 644 0 33 2257 2512730555 6330 .TH DUP 2 .SH NAME dup, dup2 \- duplicate an open file descriptor .SH SYNOPSIS .nf .B dup(fildes) .B int fildes; .PP .B dup2(fildes, fildes2) .B int fildes, fildes2; .fi .SH DESCRIPTION Given a file descriptor returned from an .I open, .I pipe, or .I creat call, .I dup allocates another file descriptor synonymous with the original. The new file descriptor is returned. .PP In the second form of the call, .I fildes is a file descriptor referring to an open file, and .I fildes2 is a non-negative integer less than the maximum value allowed for file descriptors (approximately 19). .I Dup2 causes .I fildes2 to refer to the same file as .I fildes. If .I fildes2 already referred to an open file, it is closed first. .SH "SEE ALSO" creat(2), open(2), close(2), pipe(2) .SH DIAGNOSTICS The value \-1 is returned if: the given file descriptor is invalid; there are already too many open files. .SH "ASSEMBLER (PDP-11)" (dup = 41.) .br (file descriptor in r0) .br (new file descriptor in r1) .br .B sys dup .br (file descriptor in r0) .PP The .I dup2 entry is implemented by adding 0100 to .I fildes. .SH BUGS Dup2 fails if .I fildes2 was .I vread from and some of the pages have not been referenced. open file, it is closed first. .SH "SEE ALSO" creat(2), open(2), close(2), pipe(2) .SH DIAGNOSTICS The value \-1 is returned if: the given file descriptor is invalid; there are already too many open files. .SH "ASSEMBLER (PDP-11)" (dup = 41.) .br (file descriptor in r0) .br (new file descriptor in r1) .br .B sys dup .br (file descriptoman/man2/exec.2 644 0 33 14727 2531446171 6510 .TH EXEC 2 4/1/81 .UC 4 .SH NAME execl, execv, execle, execve, execlp, execvp, exec, exece, environ \- execute a file .SH SYNOPSIS .nf .B execl(name, arg0, arg1, ..., argn, 0) .B char *name, *arg0, *arg1, ..., *argn; .PP .B execv(name, argv) .B char *name, *argv[]; .PP .B "execle(name, arg0, arg1, ..., argn, 0, envp)" .B "char *name, *arg0, *arg1, ..., *argn, *envp[];" .PP .B execve(name, argv, envp) .B char *name, *argv[], *envp[]; .PP .B extern char **environ; .fi .SH DESCRIPTION .I Exec in all its forms overlays the calling process with the named file, then transfers to the entry point of the core image of the file. There can be no return from a successful exec; the calling core image is lost. .PP Files remain open across .I exec unless explicit arrangement has been made; see .IR ioctl (2). Ignored/held signals remain ignored/held across these calls, but signals that are caught (see .IR signal (2)) are reset to their default values. .PP Each user has a .I real user ID and group ID and an .I effective user ID and group ID. The real ID identifies the person using the system; the effective ID determines his access privileges. .I Exec changes the effective user and group ID to the owner of the executed file if the file has the `set-user-ID' or `set-group-ID' modes. The real user ID is not affected. .PP The .I name argument is a pointer to the name of the file to be executed. The pointers .IR arg [ 0 ], .IR arg [ 1 "] ..." address null-terminated strings. Conventionally .IR arg [ 0 ] is the name of the file. .PP From C, two interfaces are available. .I execl is useful when a known file with known arguments is being called; the arguments to .I execl are the character strings constituting the file and the arguments; the first argument is conventionally the same as the file name (or its last component). A 0 argument must end the argument list. .PP The .I execv version is useful when the number of arguments is unknown in advance; the arguments to .I execv are the name of the file to be executed and a vector of strings containing the arguments. The last argument string must be followed by a 0 pointer. .PP When a C program is executed, it is called as follows: .PP .nf main(argc, argv, envp) int argc; char **argv, **envp; .fi .PP where .IR argc "" is the argument count and .IR argv "" is an array of character pointers to the arguments themselves. As indicated, .IR argc "" is conventionally at least one and the first member of the array points to a string containing the name of the file. .PP .I Argv is directly usable in another .I execv because .IR argv [ argc ] is 0. .PP .I Envp is a pointer to an array of strings that constitute the .I environment of the process. Each string consists of a name, an \*(lq=\*(rq, and a null-terminated value. The array of pointers is terminated by a null pointer. The shell .IR sh (1) passes an environment entry for each global shell variable defined when the program is called. See .IR environ (5) for some conventionally used names. The C run-time start-off routine places a copy of .I envp in the global cell .I environ, which is used by .IR execv \ and \ execl to pass the environment to any subprograms executed by the current program. The .I exec routines use lower-level routines as follows to pass an environment explicitly: .RS .nf execve(file, argv, environ); execle(file, arg0, arg1, . . . , argn, 0, environ); .fi .RE .PP .I Execlp and .I execvp are called with the same arguments as .I execl and .I execv, but duplicate the shell's actions in searching for an executable file in a list of directories. The directory list is obtained from the environment. .PP To aid execution of command files of various programs, if the first two characters of the executable file are '#!' then .I exec attempts to read a pathname from the executable file and use that program as the command files command interpreter. For example, the following command file sequence would be used to begin a .I csh script: .RS .nf #! /bin/csh # This shell script computes the checksum on /dev/foobar # ... .fi .RE A single parameter may be passed the interpreter, specified after the name of the interpreter; its length and the length of the name of the interpreter combined must not exceed 32 characters. The space (or tab) following the '#!' is mandatory, and the pathname must be explicit (no paths are searched). .SH FILES .ta \w'/bin/sh 'u /bin/sh shell, invoked if command file found by .I execlp or .I execvp .SH "SEE ALSO" fork(2), environ(5), csh(1) .SH DIAGNOSTICS If the file cannot be found, if it is not executable, if it does not start with a valid magic number (see .IR a.out (5)), if maximum memory is exceeded, or if the arguments require too much space, a return constitutes the diagnostic; the return value is \-1. Even for the super-user, at least one of the execute-permission bits must be set for a file to be executed. .SH BUGS If .I execvp is called to execute a file that turns out to be a shell command file, and if it is impossible to execute the shell, the values of .I argv[0] and .I argv[\-1] will be modified before return. .SH "ASSEMBLER (PDP-11)" .DT (exec = 11.) .br .B sys exec; name; argv .PP (exece = 59.) .br .B sys exece; name; argv; envp .PP Plain .I exec is obsoleted by .I exece, but remains for historical reasons. .PP When the called file starts execution on the PDP11, the stack pointer points to a word containing the number of arguments. Just above this number is a list of pointers to the argument strings, followed by a null pointer, followed by the pointers to the environment strings and then another null pointer. The strings themselves follow; a 0 word is left at the very top of memory. .PP sp\(-> nargs .br arg0 .br ... .br argn .br 0 .br env0 .br ... .br envm .br 0 .PP arg0: .br ... .br env0: .br 0 .PP On the Interdata 8/32, the stack begins at a conventional place (currently 0xD0000) and grows upwards. After .I exec, the layout of data on the stack is as follows. .PP .nf int 0 arg0: byte ... ... argp0: int arg0 ... int 0 envp0: int env0 ... int 0 %2\(-> space 40 int nargs in((t argp0 int envp0 %3\(-> .fi .PP This arrangement happens to conform well to C calling conventions. .PP On a VAX-11, the stack begins at .lg 0 0x7ffff000 .lg 1 and grows towards lower numbered addresses. After .IR exec , the layout of data on the stack is as follows. .PP .nf .ta \w' arg0: 'u ap \(-> fp \(-> sp \(-> .long nargs .long arg0 ... .long argn .long 0 .long env0 ... .long envn .long 0 arg0: .byte "arg0\e0" ... envn: .byte "envn\e0" .long 0 .. int 0 %2\(-> space 40 int nargs inman/man2/exit.2 644 0 33 1424 2512730556 6505 .TH EXIT 2 .UC 4 .SH NAME exit \- terminate process .SH SYNOPSIS .nf .B exit(status) .B int status; .PP .B _exit(status) .B int status; .fi .SH DESCRIPTION .I Exit is the normal means of terminating a process. .I Exit closes all the process's files and notifies the parent process if it is executing a .IR wait . The low-order 8 bits of .I status are available to the parent process. .PP This call can never return. .PP The C function .I exit may cause cleanup actions before the final `sys exit'. The function .I _exit circumvents all cleanup, and should be used to terminate a child process after a .IR fork (2) or .IR vfork (2) to avoid flushing buffered output twice. .SH "SEE ALSO" fork(2), vfork(2), wait(2) .SH "ASSEMBLER (PDP-11)" (exit = 1.) .br (status in r0) .br .B sys exit ocess if it is executing a .IR wait . The low-order 8 bits of .I status are available to the parent process. .PP This call can never return. .PP The C function .I exit may cause cleanup actions before the final `sys exit'. The functionman/man2/fork.2 644 0 33 2646 2512730556 6504 .TH FORK 2 .UC .SH NAME fork \- spawn new process .SH SYNOPSIS .B fork() .SH DESCRIPTION .I Fork and .IR vfork (2) are the only ways new processes are created. With .I fork , the new process's core image is a copy of that of the caller of .IR fork . The only distinction is the fact that the value returned in the old (parent) process contains the process ID of the new (child) process, while the value returned in the child is 0. Process ID's range from 1 to 30,000. This process ID is used by .IR wait (2). .PP Files open before the fork are shared, and have a common read-write pointer. In particular, this is the way that standard input and output files are passed and also how pipes are set up. .PP .I Vfork is the most efficient way of creating a new process when the fork is to be followed shortly by an exec, but is not suitable when the fork is not to be followed by an exec. .SH "SEE ALSO" wait(2), exec(2), vfork(2) .SH DIAGNOSTICS Returns \-1 and fails to create a process if: there is inadequate swap space, the user is not super-user and has too many processes, or the system's process table is full. Only the super-user can take the last process-table slot. .SH "ASSEMBLER (PDP-11)" (fork = 2.) .br .B sys fork .br (new process return) .br (old process return, new process ID in r0) .PP The return locations in the old and new process differ by one word. The C-bit is set in the old process if a new process could not be created. AGNOSTICS Returns \-1 and fails to create a process if: there is inadequate swap space, thman/man2/getpgrp.2j 644 0 33 35 2512730556 7313 .so /usr/man/man2/setpgrp.2j has too many processes, or the system's process table is full. Only the super-user can take the last process-table slot. .SH "ASSEMBLER (PDP-11)" (fork = 2.) .br .B sys fork .br (new process return) .br (old process return, new process ID in r0) .PP The return locations in the old and new process differ by one word. The C-bit is set in the old process if a new process could not be created/( ,( 5Ċ /\@,\D"man/man2/getpid.2 644 0 33 503 2512730556 6765 .TH GETPID 2 .SH NAME getpid \- get process identification .SH SYNOPSIS .B getpid() .SH DESCRIPTION .I Getpid returns the process ID of the current process. Most often it is used to generate uniquely-named temporary files. .SH "SEE ALSO" mktemp(3) .SH "ASSEMBLER (PDP-11)" (getpid = 20.) .br .B sys getpid .br (pid in r0) ess differ by one word. The C-bit is set in the old process if a new process could not be created/( ,( 5Ċ /\@,\D"man/man2/getuid.2 644 0 33 1477 2512730556 7025 .TH GETUID 2 .SH NAME getuid, getgid, geteuid, getegid \- get user and group identity .SH SYNOPSIS .B getuid() .PP .B geteuid() .PP .B getgid() .PP .B getegid() .SH DESCRIPTION .I Getuid returns the real user ID of the current process, .I geteuid the effective user ID. The real user ID identifies the person who is logged in, in contradistinction to the effective user ID, which determines his access permission at the moment. It is thus useful to programs which operate using the `set user ID' mode, to find out who invoked them. .PP .I Getgid returns the real group ID, .I getegid the effective group ID. .SH "SEE ALSO" setuid(2) .SH "ASSEMBLER (PDP-11)" (getuid = 24.) .br .B sys getuid .br (real user ID in r0, effective user ID in r1) .PP (getgid = 47.) .br .B sys getgid .br (real group ID in r0, effective group ID in r1) gged in, in contradistinction to the effective user ID, which determines his access permission at the moment. It is thus useful to programs which operate using the `set user ID' mode, to find oman/man2/indir.2 644 0 33 34 2512730556 6575 .so /usr/man/man2/syscall.2 Getgid returns the real group ID, .I getegid the effective group ID. .SH "SEE ALSO" setuid(2) .SH "ASSEMBLER (PDP-11)" (getuid = 24.) .br .B sys getuid .br (real user ID in r0, effective user ID in r1) .PP (getgid = 47.) .br .B sys getgid .br (real group ID in r0, effective group ID in r1) gged in, in contradistinction to the effective user ID, which determines his access permission at the/( ,( 5Ċ /\@,\D"man/man2/intro.2 644 0 33 21475 2512730556 6717 .TH INTRO 2 4/1/81 .UC 4 .de en .HP \\$1 \\$2 \\$3 .br .. .SH NAME intro, errno \- introduction to system calls and error numbers .SH SYNOPSIS .B #include .SH DESCRIPTION Section 2 of this manual describes all the entries into the system. Distinctions as to the status of the entries are made in the headings: .IP (2) System call entries which are standard in Version 7 UNIX systems. .IP (2J) System call entries added in support of the job control mechanisms of .IR csh (1). These system calls are not available in standard Version 7 UNIX systems, and should be used only when necessary; to prevent inexplicit use they are contained in the \fIjobs\fR library which must be specifically requested with the .B \-ljobs loader option. The use of conditional compilation is recommented when possible so that programs which use these features will gracefully degrade on systems which lack job control. .IP (2V) System calls added for the Virtual Memory version of UNIX distributed by Berkeley. Some of these calls a((re likely to be replaced by new facilities in future versions; in cases where this is imminent, this is indicated in the individual manual pages. .PP An error condition is indicated by an otherwise impossible returned value. Almost always this is \(mi1; the individual sections specify the details. An error number is also made available in the external variable .IR errno . .I Errno is not cleared on successful calls, so it should be tested only after an error has occurred. .PP There is a table of messages associated with each error, and a routine for printing the message; See .IR perror (3). The possible error numbers are not recited with each writeup in section 2, since many errors are possible for most of the calls. Here is a list of the error numbers, their names as defined in , and the messages available using .IR perror . .en 0 \h'\w'EIO'u' "Error 0 Unused. .en 1 EPERM "Not owner Typically this error indicates an attempt to modify a file in some way forbidden except to its owner or super-user. It is also returned for attempts by ordinary users to do things allowed only to the super-user. .en 2 ENOENT "No such file or directory This error occurs when a file name is specified and the file should exist but doesn't, or when one of the directories in a path name does not exist. .en 3 ESRCH "No such process The process whose number was given to .I signal and .I ptrace does not exist, or is already dead. .en 4 EINTR "Interrupted system call An asynchronous signal (such as interrupt or quit), which the user has elected to catch, occurred during a system call. If execution is resumed after processing the signal, it will appear as if the interrupted system call returned this error condition. .en 5 EIO "I/O error Some physical I/O error occurred during a .I read or .IR write . This error may in some cases occur on a call following the one to which it actually applies. .en 6 ENXIO "No such device or address I/O on a special file refers to a subdevice which does not exist, or beyond the limits of the device. It may also occur when, for example, a tape drive is not dialed in or no disk pack is loaded on a drive. .en 7 E2BIG "Arg list too long An argument list longer than 10240 bytes is presented to .IR exec . .en 8 ENOEXEC "Exec format error A request is made to execute a file which, although it has the appropriate permissions, does not start with a valid magic number, see .IR a.out (5). .en 9 EBADF "Bad file number Either a file descriptor refers to no open file, or a read (resp. write) request is made to a file which is open only for writing (resp. reading). .en 10 ECHILD "No children .I Wait and the process has no living or unwaited-for children. .en 11 EAGAIN "No more processes In a .I fork, the system's process table is full or the user is not allowed to create any more processes. .en 12 ENOMEM "Not enough core During an .I exec or .I break, a program asks for more core than the system is able to supply. This is not a temporary condition; the maximum core size is a system parameter. The error may also occur if the arrangement of text, data, and stack segments requires too many segmentation registers. .en 13 EACCES "Permission denied An attempt was made to access a file in a way forbidden by the protection system. .en 14 EFAULT "Bad address The system encountered a hardware fault in attempting to access the arguments of a system call. .en 15 ENOTBLK "Block device required A plain file was mentioned where a block device was required, e.g. in .IR mount . .en 16 EBUSY "Mount device busy An attempt to mount a device that was already mounted or an attempt was made to dismount a device on which there is an active file directory. (open file, current directory, mounted-on file, active text segment). .en 17 EEXIST "File exists An existing file was mentioned in an inappropriate context, e.g. .IR link . .en 18 EXDEV "Cross-device link A link to a file on another device was attempted. .en 19 ENODEV "No such device An attempt was made to apply an inappropriate system call to a device; e.g. read a write-only device. .en 20 ENOTDIR "Not a directory A non-directory was specified where a directory is required, for example in a path name or as an argument to .IR chdir . .en 21 EISDIR "Is a directory An attempt to write on a directory. .en 22 EINVAL "Invalid argument Some invalid argument: dismounting a non-mounted device, mentioning an unknown signal in .I signal, reading or writing a file for which .I seek has generated a negative pointer. Also set by math functions, see .IR intro (3). .en 23 ENFILE "File table overflow The system's table of open files is full, and temporarily no more .I opens can be accepted. .en 24 EMFILE "Too many open files Customary configuration limit is 20 per process. .en 25 ENOTTY "Not a typewriter The file mentioned in .I stty or .I gtty is not a terminal or one of the other devices to which these calls apply. .en 26 ETXTBSY "Text file busy An attempt to execute a pure-procedure program which is currently open for writing (or reading!). Also an attempt to open for writing a pure-procedure program that is being executed. .en 27 EFBIG "File too large The size of a file exceeded the maximum (about .if t 10\u\s-29\s+2\d .if n 1.0E9 bytes). .en 28 ENOSPC "No space left on device During a .I write to an ordinary file, there is no free space left on the device. .en 29 ESPIPE "Illegal seek An .I lseek was issued to a pipe. This error should also be issued for other non-seekable devices. .en 30 EROFS "Read-only file system An attempt to modify a file or directory was made on a device mounted read-only. .en 31 EMLINK "Too many links An attempt to make more than 32767 links to a file. .en 32 EPIPE "Broken pipe A write on a pipe for which there is no process to read the data. This condition normally generates a signal; the error is returned if the signal is ignored. .en 33 EDOM "Math argument The argument of a function in the math package (3M) is out of the domain of the function. .en 34 ERANGE "Result too large The value of a function in the math package (3M) is unrepresentable within machine precision. .SH SEE ALSO intro(3) .SH "ASSEMBLER (PDP-11)" .B as /usr/include/sys.s file ... .PP The PDP11 assembly language interface is given for each system call. The assembler symbols are defined in `/usr/include/sys.s'. .PP Return values appear in registers r0 and r1; it is unwise to count on these registers being preserved when no value is expected. An erroneous call is always indicated by turning on the c-bit of the condition codes. The error number is returned in r0. The presence of an error is most easily tested by the instructions .I bes and .I bec (`branch on error set (or clear)'). These are synonyms for the .I bcs and .I bcc instructions. .PP On the Interdata 8/32, the system call arguments correspond well to the arguments of the C routines. The sequence is: .IP .nf la %2,errno l %0,&callno svc 0,args .fi .PP Thus register 2 points to a word into which the error number will be stored as needed; it is cleared if no error occurs. Register 0 contains the system call number; the nomenclature is identical to that on the PDP11. The argument of the .I svc is the address of the arguments, laid out in storage as in the C calling sequence. The return value is in register 2 (possibly 3 also, as in .IR pipe ) and is \-1 in case of error. The overflow bit in the program status word is also set when errors occur. .PP On the VAX-11 a system call follows exactly the same conventions as a C procedure. Namely, register .B ap points to a long word containing the number of arguments, and the arguments follow in successive long words. Values are returned in registers .B r0 and .BR r1 . An error is indicated by setting the C (carry) bit in the processor status word; the error number is placed in .BR r0 . .SH BUGS The message \*(lqMount device busy\*(rq is reported when a terminal is inaccessible because the \*(lqexclusive use\*(rq bit is set; this is confusing. xactly the same conventions as a C procedure. Namely, register .B ap points to a long word containing the number of arguments, and the arguments follow in successive long words. Values are retuman/man2/ioctl.2 644 0 33 4612 2512730556 6650 .TH IOCTL 2 .UC 4 .SH NAME ioctl, stty, gtty \- control device .SH SYNOPSIS .nf .B #include .PP .B ioctl(fildes, request, argp) .B struct sgttyb *argp; .PP .B stty(fildes, argp) .B struct sgttyb *argp; .PP .B gtty(fildes, argp) .B struct sgttyb *argp; .fi .SH DESCRIPTION .I Ioctl performs a variety of functions on character special files (devices). The writeups of various devices in section 4 discuss how .I ioctl applies to them. .PP For certain status setting and status inquiries about terminal devices, the functions .I stty and .I gtty are equivalent to .RS .B ioctl(fildes, TIOCSETP, argp) .br .B ioctl(fildes, TIOCGETP, argp) .RE .LP respectively; see .IR tty (4). .PP The following two standard calls, however, apply to any open file: .PP .RS .B ioctl(fildes, FIOCLEX, NULL); .br .B ioctl(fildes, FIONCLEX, NULL); .RE .LP The first causes the file to be closed automatically during a successful .I exec operation; the second reverses the effect of the first. .PP The following call is peculiar to the Berkeley implementation, and also applies to any open file: .PP .RS .B ioctl(fildes, FIONREAD, &count) .RE .LP returning, in the longword .I count the number of characters available for reading from .I fildes. .SH "SEE ALSO" stty(1), tty(4), exec(2) .SH DIAGNOSTICS Zero is returned if the call was successful; \-1 if the file descriptor does not refer to the kind of file for which it was intended, or if .I request attempts to modify the state of a terminal when .I fildes is not writeable. .PP .I Ioctl calls w((hich attempt to modify the state of a process control terminal while a process is not in the process group of the control terminal will cause a SIGTTOU signal to be sent to the process' process group. Such .IR ioctl s are allowed, however, if SIGTTOU is being held, ignored, if the process is an orphan which has been inherited by .IR init , or is the child in an incomplete .I vfork (see .IR jobs (3)) .SH BUGS Strictly speaking, since .I ioctl may be extended in different ways to devices with different properties, .I argp should have an open-ended declaration like .IP .B union { struct sgttyb .RB ... ; \&... .B } *argp; .PP The important thing is that the size is fixed by `struct sgttyb'. .SH "ASSEMBLER (PDP-11)" (ioctl = 54.) .br .B sys ioctl; fildes; request; argp .PP (stty = 31.) .br (file descriptor in r0) .br .B stty; argp .PP (gtty = 32.) .br (file descriptor in r0) .br .B sys gtty; argp obs (3)) .SH BUGS Strictly speaking, since .I ioctl may be extended in different ways to devices with different propeman/man2/kill.2 644 0 33 2416 2531446173 6471 .TH KILL 2 5/11/81 .UC 4 .SH NAME kill \- send signal to a process .SH SYNOPSIS .B kill(pid, sig) .SH DESCRIPTION .I Kill sends the signal .I sig to the process specified by the process number .I pid. See .IR sigsys (2) for a list of signals. .PP The sending and receiving processes must have the same effective user ID, otherwise this call is restricted to the super-user. (A single exception is the signal SIGCONT which may be sent as described in .IR killpg (2), although it is usually sent using .I killpg rather than .IR kill ). .PP If the process number is 0, the signal is sent to all other processes in the sender's process group; see .IR tty (4) and also .IR killpg (2). .PP If the process number is \-1, and the user is the super-user, the signal is broadcast universally except to processes 0, 1, 2, the scheduler initialization, and pageout processes, and the process sending the signal. .PP Processes may send signals to themselves. .SH "SEE ALSO" sigsys(2), signal(2), kill(1), killpg(2), init(8) .SH DIAGNOSTICS Zero is returned if the process is killed; \-1 is returned if the process does not have the same effective user ID and the user is not super-user, or if the process does not exist. .SH "ASSEMBLER (PDP-11)" (kill = 37.) .br (process number in r0) .br .B sys kill; sig except to processes 0, 1, 2, the scheduler initialization, and pageout processes, and the process sending the signal. .PP Processes may send signals to themselves. .SH "SEE ALSO" sigsys(2), signal(2), kill(1), killpg(2), init(8) .SH DIAGNOSTIman/man2/killpg.2j 644 0 33 3214 2512730557 7170 .TH KILLPG 2J .UC 4 .SH NAME killpg \- send signal to a process or a process group .SH SYNOPSIS .B killpg(pgrp, sig) .PP .B cc ... \-ljobs .SH DESCRIPTION .I Killpg sends the signal .I sig to the specified process group. See .IR sigsys (2) for a list of signals; see .IR jobs (3) for an explanation of process groups. .PP The sending process and members of the process group must have the same effective user ID, otherwise this call is restricted to the super-user. As a single special case the continue signal SIGCONT may be sent to any process which is a descendant of the current process. This allows a command interpreter such as .IR csh (1) to restart set-user-id processes stopped from the keyboard with a stop signal. .PP The calls .IP .B "killpg(0, sig)" .LP and .IP .B "kill(0, sig) .LP have identical effects, sending the signal to all members of the invoker's process group (including the process itself). It is preferable to use the call involving .I kill in this case, as it is portable to other UNIX systems. .SH "SEE ALSO" jobs(3), kill(2), sigsys(2), signal(2), csh(1), kill(1) .SH DIAGNOSTICS Zero is returned if the processes are sent the signals; \-1 is returned if any process in the process group cannot be sent the signal, or if there are no members in the process group. .SH BUGS The job control facilities are not available in standard version 7 UNIX. These facilities are still under development and may change in future releases of the system as better inter-process communication facilities and support for virtual terminals become available. The options and specifications of this system call and even the call itself are thus subject to change. s; \-1 is returned if any process in the process group cannot be sent the signal, or if there are no members in the process group. .SH BUGS The job control facilities are not available in standard version 7 UNIX. These facilities are still under development and may change in future releases of the system as better inter-process communication facilities and support for vman/man2/link.2 644 0 33 1402 2512730557 6466 .TH LINK 2 .UC 4 .SH NAME link \- link to a file .SH SYNOPSIS .nf .B link(name1, name2) .B char *name1, *name2; .fi .SH DESCRIPTION A link to .I name1 is created; the link has the name .IR name2 . Either name may be an arbitrary path name. .SH "SEE ALSO" ln(1), unlink(2) .SH DIAGNOSTICS Zero is returned when a link is made; \-1 is returned when .I name1 cannot be found; when .I name2 already exists; when the directory of .I name2 cannot be written; when an attempt is made to link to a directory by a user other than the super-user; when an attempt is made to link to a file on another file system; when a file has too many links. .PP On some systems the super-user may link to non-ordinary files. .SH "ASSEMBLER (PDP-11)" (link = 9.) .br .B sys link; name1; name2 (1), unlink(2) .SH DIAGNOSTICS Zero is returned when a link is made; \-1 is returned when .I name1 cannot be found; when .I name2 already exists; when the directory of .I name2 cannot be written; when an attempt is made to link to a directory by a user oman/man2/lseek.2 644 0 33 2402 2512730557 6635 .TH LSEEK 2 .SH NAME lseek, tell \- move read/write pointer .SH SYNOPSIS .nf .B long lseek(fildes, offset, whence) .B long offset; .PP .B long tell(fildes) .fi .SH DESCRIPTION The file descriptor refers to a file open for reading or writing. The read (resp. write) pointer for the file is set as follows: .IP If .I whence is 0, the pointer is set to .I offset bytes. .IP If .I whence is 1, the pointer is set to its current location plus .IR offset . .IP If .I whence is 2, the pointer is set to the size of the file plus .IR offset . .PP The returned value is the resulting pointer location. .PP The obsolete function .IR tell ( fildes ) is identical to .IR lseek ( "fildes, 0L, 1" ). .PP Seeking far beyond the end of a file, then writing, creates a gap or `hole', which occupies no physical space and reads as zeros. .SH "SEE ALSO" open(2), creat(2), fseek(3) .SH DIAGNOSTICS \-1 is returned for an undefined file descriptor, seek on a pipe, or seek to a position before the beginning of file. .SH BUGS .I Lseek is a no-op on character special files. .SH "ASSEMBLER (PDP-11)" (lseek = 19.) .br (file descriptor in r0) .br .B sys lseek; offset1; offset2; whence .PP .I Offset1 and .I offset2 are the high and low words of .IR offset ; r0 and r1 contain the pointer upon return. ich occupies no physical space and reads as zeros. .SH "SEE ALSO" open(2), creat(2), fseek(3) .SH DIAGNOSTICS \-1 is returned for an undefined file descriptor, seek on a pipe, or seek to a position before the beginning of file. .SH BUGS .I Lseek is a no-man/man2/mknod.2 644 0 33 1644 2512730557 6651 .TH MKNOD 2 .SH NAME mknod \- make a directory or a special file .SH SYNOPSIS .nf .B mknod(name, mode, addr) .B char *name; .nf .SH DESCRIPTION .I Mknod creates a new file whose name is the null-terminated string pointed to by .IR name . The mode of the new file (including directory and special file bits) is initialized from .IR mode . (The protection part of the mode is modified by the process's mode mask; see .IR umask (2)). The first block pointer of the i-node is initialized from .IR addr . For ordinar((y files and directories .I addr is normally zero. In the case of a special file, .I addr specifies which special file. .PP .I Mknod may be invoked only by the super-user. .SH "SEE ALSO" mkdir(1), mknod(1), filsys(5) .SH DIAGNOSTICS Zero is returned if the file has been made; \-1 if the file already exists or if the user is not the super-user. .SH "ASSEMBLER (PDP-11)" (mknod = 14.) .br .B sys mknod; name; mode; addr umask (2)). The first block pointer of the i-node is initialized from .IR addr . For ordinarman/man2/mount.2 644 0 33 3725 2512730557 6705 .TH MOUNT 2 .SH NAME mount, umount \- mount or remove file system .SH SYNOPSIS .nf .B mount(special, name, rwflag) .B char *special, *name; .PP .B umount(special) .B char *special; .fi .SH DESCRIPTION .I Mount announces to the system that a removable file system has been mounted on the block-structured special file .I special; from now on, references to file .I name will refer to the root file on the newly mounted file system. .I Special and .I name are pointers to null-terminated strings containing the appropriate path names. .PP .I Name must exist already. .I Name must be a directory (unless the root of the mounted file system is not a directory). Its old contents are inaccessible while the file system is mounted. .PP The .I rwflag argument determines whether the file system can be written on; if it is 0 writing is allowed, if non-zero no writing is done. Physically write-protected and magnetic tape file systems must be mounted read-only or errors will occur when access times are updated, whether or not any explicit write is attempted. .PP .I Umount announces to the system that the .I special file is no longer to contain a removable file system. The associated file reverts to its ordinary interpretation. .SH "SEE ALSO" mount(8) .SH DIAGNOSTICS .I Mount returns 0 if the action occurred; \-1 if .I special is inaccessible or not an appropriate file; if .I name does not exist; if .I special is already mounted; if .I name is in use; or if there are already too many file systems mounted. .PP .I Umount returns 0 if the action occurred; \-1 if if the special file is inaccessible or does not have a mounted file system, or if there are active files in the mounted file system. .SH BUGS If a file containing holes (unallocated blocks) is read, even on a file system mounted read-only, the system will attempt to fill in the holes by writing on the device. .SH "ASSEMBLER (PDP-11)" (mount = 21.) .br .B sys mount; special; name; rwflag .PP (umount = 22.) .br .B sys umount; special systems mounted. .PP .I Umount returns 0 iman/man2/mpx.2 644 0 33 24617 2512730560 6364 .TH MPX 2 .UC 4 .SH NAME mpx \- create and manipulate multiplexed files .SH SYNOPSIS .nf .B mpx(name, access) .B char *name; .PP .B join(fd, xd) .PP .B chan(xd) .PP .B extract(i, xd) .PP .B attach(i, xd) .PP .B detach(i, xd) .PP .B connect(fd, cd, end) .PP .B npgrp(i, xd, pgrp) .PP .B ckill(i, xd, signal) .PP .B #include .B mpxcall(cmd, vec) .B int *vec; .fi .SH DESCRIPTION .PP .B mpxcall(cmd, vec) is the system call shared by the library routines described below. .I Cmd selects a command using values defined in .IR . .I Vec is the address of a structure containing the arguments for the command. .PP .B mpx(name, access) .PP .I Mpx creates and opens the file .I name with access permission .I access (see .IR creat (2)) and returns a file descriptor available for reading and writing. A \-1 is returned if the file cannot be created, if .I name already exists, or if the file table or other operating system data structures are full. The file descriptor is required for use with other routines. .PP If .I name is 0, a file descriptor is returned as described but no entry is created in the file system. .PP Once created an mpx file may be opened (see .IR open (2)) by any process. This provides a form of interprocess communication whereby a process B can `call' process A by opening an mpx file created by A. To B, the file is ordinary with one exception: the .I connect primitive could be applied to it. Otherwise the functions described below are used only in process A and descendants that inherit the open mpx file. .PP When a process opens an mpx file, the owner of the file receives a control message when the file is next read. The method for `answering' this kind of call involves using .I attach and .I detach as described in more detail below. .PP Once B has opened A's mpx file it is said to have a .I channel to A. A channel is a pair of data streams: in this case, one from B to A and the other from A to B. Several processes may open the same mpx file yielding multiple channels within the one mpx file. By accessing the appropriate channel, A can communicate with B and any others. When A reads (see .IR read (2)) from the mpx file data written to A by the other processes appears in A's buffer using a record format described in .IR mpxio (5). When A writes (see .IR write (2)) on its mpx file the data must be formatted in a similar way. .PP The following commands are used to manipulate mpx files and channels. .IP .IR join \- adds a new channel on an mpx file to an open file F. I/O on the new channel is I/O on F. .br .IR chan \- creates a new channel. .br .IR extract \- file descriptor maintenance. .br .IR connect \- similar to join except that the open file F is connected to an existing channel. .br .I attach and .IR detach \- used with call protocol. .br .IR npgrp \- manipulates process group numbers so that a channel can act as a control terminal (see .IR tty (4)). .br .IR ckill \- send signal (see .IR signal (2)) to process group through channel. .PP A maximum of 15 channels may be connected to an mpx file. They are numbered 0 through 14. .I Join may be used to make one mpx file appear as a channel on another mpx file. A hierarchy or tree of mpx files may be set up in this way. In this case one of the mpx files must be the root of a tree where the other mpx files are interior nodes. The maximum depth of such a tree is 4. .PP An .I index is a 16-bit value that denotes a location in an mpx tree other than the root: the path through mpx `nodes' from the root to the location is expressed as a sequence of 4-bit nibbles. The branch taken at the root is represented by the low-order 4-bits of an index. Each succeeding branch is specified by the next higher-order nibble. If the length of a path to be expressed is less than 4, then the illegal channel number, 15, must be used to terminate the sequence. This is not strictly necessary for the simple case of a tree consisting of only a root node: its channels can be expressed by the numbers 0 through 14. An index .I i and file descriptor .I xd for the root of an mpx tree are required as arguments to most of the commands described below. Indices also serve as channel identifiers in the record formats given in .IR mpxio (5). Since \-1 is not a valid index, it can be returned as a error indication by subroutines that normally return indices. .PP The operating system informs the process managing an mpx file of changes in the status of channels attached to the file by generating messages that are read along with data from the channels. The form and content of these messages is described in .IR mpxio (5). .PP .B join(fd, xd) establishes a connection (channel) between an mpx file and another object. .I Fd is an open file descriptor for a character device or an mpx file and .I xd is the file descriptor of an mpx file. .I Join returns the index for the new channel if the operation succeeds and \-1 if it does not. .PP Following join, .I fd may still be used in any system call that would have been meaningful before the join operation. Thus a process can read and write directly to .I fd as well as access it via .I xd. If the number of channels required for a tree of mpx files exceeds the number of open files permitted a process by the operating system, some of the file descriptors can be released using the standard .IR close (2) call. Following a close on an active file descriptor for a channel or internal mpx node, that object may still be accessed through the root of the tree. .PP .B chan(xd) allocates a channel and connects one end of it to the mpx file represented by file descriptor .I xd. .I Chan returns the index of the new channel or a \-1 indicating failure. The .I extract primitive can be used to get a non-multiplexed file descriptor for the free end of a channel created by .I chan. .PP Both .I chan and .I join operate on the mpx file specified by .IR xd . File descriptors for interior nodes of an mpx tree must be preserved or reconstructed with .I extract for use with .I join or .IR chan . For the remaining commands described here, .I xd denotes the file descriptor for the root of an mpx tree. .PP .B extract(i, xd) returns a file descriptor for the object with index .I i on the mpx tree with root file descriptor .I xd. A \-1 is returned by extract if a file descriptor is not available or if the arguments do not refer to an existing channel and mpx file. .PP .B attach(i, xd) .br .BR "detach(i, xd)" . If a process A has created an mpx file represented by file descriptor .I xd, then a process B can open (see .IR open (2)) the mpx file. The purpose is to establish a channel between(( A and B through the mpx file. .I Attach and .I Detach are used by A to respond to such opens. .PP An open request by B fails immediately if a new channel cannot be allocated on the mpx file, if the mpx file does not exist, or if it does exist but there is no process (A) with a multiplexed file descriptor for the mpx file (i.e. .I xd as returned by .IR mpx (2)). Otherwise a channel with index number .I i is allocated. The next time A reads on file descriptor .IR xd , the WATCH control message (see .IR mpxio (5)) will be delivered on channel .I i. A responds to this message with .I attach or .I detach. The former causes the open to complete and return a file descriptor to B. The latter deallocates channel .I i and causes the open to fail. .PP One mpx file may be placed in `listener' mode. This is done by writing .I "ioctl(xd, MXLSTN, 0)" where .I xd is an mpx file descriptor and MXLSTN is defined in .IR /usr/include/sgtty.h . The semantics of listener mode are that all file names discovered by .IR open (2) to have the syntax .I "system!pathname" (see .IR uucp (1)) are treated as opens on the mpx file. The operating system sends the listener process an OPEN message (see .IR mpxio (5)) which includes the file name being opened. .I Attach and .I detach then apply as described above. .PP .I Detach has two other uses: it closes and releases the resources of any active channel it is applied to, and should be used to respond to a CLOSE message (see .IR mpxio (5)) on a channel so the channel may be reused. .PP .BR "connect(fd, cd, end)" . .I Fd is a character file descriptor and .I cd is a file descriptor for a channel, such as might be obtained via .I "extract( chan(xd), xd)" or by .IR open (2) followed by .I attach. .I Connect splices the two streams together. If .I end is negative, only the output of .I fd is spliced to the input of .I cd. If .I end is positive, the output of .I cd is spliced to the input of .I fd. If .I end is zero, then both splices are made. .PP .BR "npgrp(i, xd, pgrp)" . If .I xd is negative .I npgrp applies to the process executing it, otherwise .I i and .I xd are interpreted as a channel index and mpx file descriptor and .I npgrp is applied to the process on the non-multiplexed end of the channel. If .I pgrp is zero, the process group number of the indicated process is set to the process number of that process, otherwise the value of .I pgrp is used as the process group number. .PP .I Npgrp normally returns the new process group number. If .I i and .I xd specify a nonexistent channel, .I npgrp returns \-1. .PP .B ckill(i, xd, signal) sends the specified signal (see .IR signal (2)) through the channel specified by .I i and .I xd. If the channel is connected to anything other than a process, .I ckill is a null operation. If there is a process at the other end of the channel, the process group will be interrupted (see .IR signal (2), .IR kill (2)). .I Ckill normally returns .I signal. If .I ch and .I xd specify a nonexistent channel, .I ckill returns \-1. .SH FILES /usr/include/sys/mx.h .br /usr/include/sgtty.h .SH "SEE ALSO" mpxio(5) .SH BUGS .PP Mpx files are an experimental part of the operating system more subject to change and prone to bugs than other parts. .PP Maintenance programs, e.g. .IR icheck (1), diagnose mpx files as an illegal mode. .PP Channels may only be connected to objects in the operating system that are accessible through the line discipline mechanism. .PP Higher performance line disciplines are needed. .PP The maximum tree depth restriction is not really checked. .PP A non-destructive .I disconnect primitive (inverse of .IR connect ) is not provided. .PP A non-blocking flow control strategy based on messages defined in .IR mpxio (5) should not be attempted by novices; the enabling .I ioctl command should be protected. .PP The .I join operation could be subsumed by .I connect. A mechanism is needed for moving a channel from one location in an mpx tree to another. r performance line disciplines are needed. .PP The maximum tree depth restriction is not really checked. .PP A noman/man2/nice.2 644 0 33 1647 2531446172 6460 .TH NICE 2 .SH NAME nice \- set program priority .SH SYNOPSIS .B nice(incr) .SH DESCRIPTION The scheduling priority of the process is augmented by .IR incr . Positive priorities get less service than normal. Priority 10 is recommended to users who wish to execute long-running programs without flak from the administration. .PP Negative increments are ignored except on behalf of the super-user. The priority is limited to the range \-20 (most urgent) to 20 (least). .PP The priority of a process is passed to a child process by .IR fork (2). For a privileged process to return to normal priority from an unknown state, .I nice should be called successively with arguments \-40 (goes to priority \-20 because of truncation), 20 (to get to 0), then 0 (to maintain compatibility with previous versions of this call). .SH "SEE ALSO" nice(1), fork(2), renice(8) .SH "ASSEMBLER (PDP-11)" (nice = 34.) .br (priority in r0) .br .B sys nice o the range \-20 (most urgent) to 20 (least). .PP The priority of a process is passed to man/man2/open.2 644 0 33 2136 2512730561 6472 .TH OPEN 2 .UC 4 .SH NAME open \- open for reading or writing .SH SYNOPSIS .nf .B open(name, mode) .B char *name; .fi .SH DESCRIPTION .I Open opens the file .I name for reading (if .I mode is 0), writing (if .I mode is 1) or for both reading and writing (if .I mode is 2). .I Name is the address of a string of ASCII characters representing a path name, terminated by a null character. .PP The file is positioned at the beginning (byte 0). The returned file descriptor must be used for subsequent calls for other input-output functions on the file. .SH "SEE ALSO" creat(2), read(2), write(2), dup(2), close(2) .SH DIAGNOSTICS The value \-1 is returned if the file does not exist, if one of the necessary directories does not exist or is unreadable, if the file is not readable (resp. writable), or if too many files are open. .SH "ASSEMBLER (PDP-11)" (open = 5.) .br .B sys open; name; mode .br (file descriptor in r0) .SH BUGS It should be possible to optionally open files for writing with exclusive use, and to optionally call .I open without the possibility of hanging waiting for carrier on communication lines. e(2) .SH DIAGNOSTICS The value \-1 is returned if the file does not exist, if one of the necessary directories does not exist or is unreadable, if the file is not readable (resp. writable), or if too many files are open. .SH "ASSEMBLER (PDP-11)" (open = 5.) .br .B sys open; name; mode .br (file descriptor in r0) .SH BUGS It should be possible to optionally open files for writing with exclusive use, and to optionallman/man2/pause.2 644 0 33 710 2512730561 6622 .TH PAUSE 2 .UC 4 .SH NAME pause \- stop until signal .SH SYNOPSIS .B pause() .SH DESCRIPTION .I Pause never returns normally. It is used to give up control while waiting for a signal from .IR kill (2) or .IR alarm (2). Upon termination of a signal handler started during a .I pause, the .I pause call will return. .SH SEE ALSO kill(1), kill(2), alarm(2), sigsys(2), signal(2), sigset(3), setjmp(3) .SH "ASSEMBLER (PDP-11)" (pause = 29.) .br .B sys pause Ċ /\@,\D"man/man2/pipe.2 644 0 33 2511 2512730562 6464 .TH PIPE 2 .SH NAME pipe \- create an interprocess channel .SH SYNOPSIS .nf .B pipe(fildes) .B int fildes[2]; .fi .SH DESCRIPTION The .I pipe system call creates an I/O mechanism called a pipe. The file descriptors returned can be used in read and write operations. When the pipe is written using the descriptor .IR fildes [1] up to 4096 bytes of data are buffered before the writing process is suspended. A read using the descriptor .IR fildes [0] will pick up the data. .PP It is assumed that after the pipe has been set up, two (or more) cooperating processes (created by subsequent .I fork calls) will pass data through the pipe with .I read and .I write calls. .PP The Shell has a syntax to set up a linear array of processes connected by pipes. .PP Read calls on an empty pipe (no buffered data) with only one end (all write file descriptors closed) returns an end-of-file. .SH "SEE ALSO" sh(1), read(2), write(2), fork(2) .SH DIAGNOSTICS The function value zero is returned if the pipe was created; \-1 if too many f((iles are already open. A signal is generated if a write on a pipe with only one end is attempted. .SH BUGS Should more than 4096 bytes be necessary in any pipe among a loop of processes, deadlock will occur. .SH "ASSEMBLER (PDP-11)" (pipe = 42.) .br .B sys pipe .br (read file descriptor in r0) .br (write file descriptor in r1) riptors closed) returns an end-of-file. .SH "SEE ALSO" sh(1), read(2), write(2), fork(2) .SH DIAGNOSTICS The function value zero is returned if the pipe was created; \-1 if too many fman/man2/profil.2 644 0 33 2624 2512730562 7027 .TH PROFIL 2 .UC 4 .SH NAME profil \- execution time profile .SH SYNOPSIS .nf .B profil(buff, bufsiz, offset, scale) .B char *buff; .B int bufsiz, offset, scale; .fi .SH DESCRIPTION .I Buff points to an area of core whose length (in bytes) is given by .IR bufsiz . After this call, the user's program counter (pc) is examined each clock tick (60th second); .I offset is subtracted from it, and the result multiplied by .IR scale . If the resulting number corresponds to a word inside .I buff, that word is incremented. .PP The scale is interpreted as an unsigned, fixed-point fraction with binary point at the left: 0177777(8) gives a 1-1 mapping of pc's to words in .I buff; 077777(8) maps each pair of instruction words together. 02(8) maps all instructions onto the beginning of .I buff (producing a non-interrupting core clock). .PP Profiling is turned off by giving a .I scale of 0 or 1. It is rendered ineffective by giving a .I bufsiz of 0. Profiling is turned off when an .I exec is executed, but remains on in child and parent both after a .IR fork . Profiling may be turned off if an update in .I buff would cause a memory fault. .SH "SEE ALSO" monitor(3), prof(1) .SH "ASSEMBLER (PDP-11)" (profil = 44.) .br .B sys profil; buff; bufsiz; offset; scale .SH BUGS Profiling does not work for interpreters; if a signal were given to a process when its cpu-time clock ticked then profiling interpreters would be possible. tive by giving a .I bufsiz of 0. Profiling is turned off when an .I exec is executed, but remains on in chilman/man2/ptrace.2 644 0 33 12332 2512730562 7027 .TH PTRACE 2 .UC 4 .SH NAME ptrace \- process trace .SH SYNOPSIS .nf .B #include .PP .B ptrace(request, pid, addr, data) .B int *addr; .fi .SH DESCRIPTION .I Ptrace provides a means by which a parent process may control the execution of a child process, and examine and change its core image. Its primary use is for the implementation of breakpoint debugging. There are four arguments whose interpretation depends on a .I request argument. Generally, .I pid is the process ID of the traced process, which must be a child (no more distant descendant) of the tracing process. A process being traced behaves normally until it encounters some signal whether internally generated like `illegal instruction' or externally generated like `interrupt.' See .IR signal (2) for the list. Then the traced process enters a stopped state and its parent is notified via .IR wait (2). When the child is in the stopped state, its core image can be examined and modified using .IR ptrace . If desired, another .I ptrace request can then cause the child either to terminate or to continue, possibly ignoring the signal. .PP The value of the .I request argument determines the precise action of the call: .TP 4 0 This request is the only one used by the child process; it declares that the process is to be traced by its parent. All the other arguments are ignored. Peculiar results will ensue if the parent does not expect to trace the child. .TP 4 1,2 The word in the child process's address space at .I addr is returned. If I and D space are separated, request 1 indicates I space, 2 D space. .I Addr must be even. The child must be stopped. The input .I data is ignored. .TP 4 3 The word of the system's per-process data area corresponding to .I addr is returned. .I Addr must be even and less than 512. This space contains the registers and other information about the process; its layout corresponds to the .I user structure in the system. .TP 4 4,5 The given .I data is written at the word in the process's address space corresponding to .I addr, which must be even. No useful value is returned. If I and D space are separated, request 4 indicates I space, 5 D space. Attempts to write in pure procedure fail if another process is executing the same file. .TP 4 6 The process's system data is written, as it is read with request 3. Only a few locations can be written in this way: the general registers, the floating point status and registers, and certain bits of the processor status word. .TP 4 7 The .I data argument is taken as a signal number and the child's execution continues at location .I addr as if it had incurred that signal. Normally the signal number will be either 0 to indicate that the signal that caused the stop should be ignored, or that value fetched out of the process's image indicating which signal caused the stop. If .I addr is (int *)1 then execution continues from where it stopped. .TP 4 8 The traced process terminates. .TP 4 9 Execution continues as in request 7; however, as soon as possible after execution of at least one instruction, execution stops again. The signal number from the stop is SIGTRAP. (On the PDP-11 and VAX-11 the T-bit is used and just one instruction is executed; on the Interdata the stop does not take place until a store instruction is executed.) This is part of the mechanism for implementing breakpoints. .PP As indicated, these calls (except for request 0) can be used only when the subject process has stopped. The .I wait call is used to determine when a process stops; in such a case the `termination' status returned by .I wait has the value 0177 to indicate stoppage rather than genuine termination. .PP To forestall possible fraud, .I ptrace inhibits the set-user-id facility on subsequent .IR exec (2) calls. If a traced process calls .I exec, it will stop before executing the first instruction of the new image showing signal SIGTRAP. .PP On the Interdata 8/32, `word' means a 32-bit word and `even' means 0 mod 4. On a VAX-11, `word' also means a 32-bit integer, but the `even' restriction does not apply. .SH "SEE ALSO" wait(2), signal(2), adb(1) .SH DIAGNOSTICS The value \-1 is returned if .I request is invalid, .I pid is not a traceable process, .I addr is out of bounds, or .I data specifies an illegal signal number. .SH BUGS .I Ptrace is unique and arcane; it should be replaced with a special file which can be opened and read and written. The control functions could then be implemented with .IR ioctl (2) calls on this file. This would be simpler to understand and have much higher performance. .PP On the Interdata 8/32, `as soon as possible' (request 7) means `as soon as a store instruction has been executed.' .PP The request 0 call should be able to specify signals which are to be treated normally and not cause a stop. In this way, for example, programs with simulated floating point (which use `illegal instruction' signals at a very high rate) could be efficiently debugged. .PP The error indication, \-1, is a legitimate function value; .I errno, see .IR intro (2), can be used to disambiguate. .PP It should be possible to stop a process on occurrence of a system call; in this way a completely controlled environment could be provided. .SH ASSEMBLER (ptrace = 26.) .br (data in r0) .br .B sys ptrace; pid; addr; request .br (value in r0) for example, programs with simulated floating point (which use `illegal instruction' signals at a very high rate) could be efficiently debugged. .PP The error indication, \-1, is a legitimate function value; .I errno, see .IR intro (2), can be used to disambiguate. .PP It should be possible tman/man2/read.2 644 0 33 3367 2512730562 6454 .TH READ 2 .UC 4 .SH NAME read \- read from file .SH SYNOPSIS .nf .B read(fildes, buffer, nbytes) .B char *buffer; .fi .SH DESCRIPTION A file descriptor is a word returned from a successful .I "open, creat, dup," or .I pipe call. .I Buffer is the location of .I nbytes contiguous bytes into which the input will be placed. It is not guaranteed that all .I nbytes bytes will be read; for example if the file refers to a typewriter at most one line will be returned. In any event the number of characters read is returned. .PP If the returned value is 0, then end-of-file has been reached. .PP Unless the reader is ignoring or holding SIGTTIN signals, reads from the control typewriter while not in its process group cause a SIGTTIN signal to be sent to the reader's process group; in the former case an end-of-file is returned. .PP .SH "SEE ALSO" open(2), creat(2), dup(2), pipe(2), vread(2) .SH DIAGNOSTICS As mentioned, 0 is returned when the end of the file has been reached. If the read was otherwise unsuccessful the re((turn value is \-1. Many conditions can generate an error: physical I/O errors, bad buffer address, preposterous .I nbytes, file descriptor not that of an input file. .SH "ASSEMBLER (PDP-11)" (read = 3.) .br (file descriptor in r0) .br .B sys read; buffer; nbytes .br (byte count in r0) .SH BUGS It should be possible to call .I read and have it return immediately without blocking if there is no input available. As a single special case, this is currently done on control terminals when the reading process has requested SIGTINT signals when input arrives (see .IR tty (4)). .PP Processes which have been orphaned by their parents and have been inherited by .IR init (8) never receive SIGTTIN signals. Instead .I read returns with an end-of-file indication. buffer; nbytes .br (byte count in r0) .SH BUGS It should be possible to call .I read and have it return immediately without blocking if there is no input available. As a single special case, this is currently done on control terminals when the reading process has man/man2/reboot.2v 644 0 33 4715 2512730563 7220 .TH REBOOT 2V 4/1/81 .UC 4 .SH NAME reboot \- reboot system or halt processor .SH SYNOPSIS .nf .B #include .PP .B reboot(howto) .B int howto; .fi .SH DESCRIPTION .I Reboot is used to cause a system reboot, and is invoked automatically in the event of unrecoverable system failures. .I Howto is a mask of options passed to the bootstrap program. The system call interface permits only RB_HALT or RB_AUTOBOOT to be passed to the reboot program; the other flags are used in scripts stored on the console storage media, or used in manual bootstrap procedures. When none of these options (e.g. RB_AUTOBOOT) is given, the system is rebooted from file \*(lqvmunix\*(rq in the root file system of unit 0 of a disk chosen in a processor specific way: on the 11/780 it is specified by a line in the DEFBOO.CMD script on the console floppy; on the 11/750 it is determined by the setting of the front panel switch which picks the bootstrap device. .\"On the 11/730 it is determined by a file on the console casette. An automatic consistency check of the disks is then normally performed. .PP The bits of .I howto are: .TP RB_HALT the processor is simply halted; no reboot takes place. This should be used with caution. .TP RB_ASKNAME Interpreted by the bootstrap program itself, causing it to inquire as to what file should be booted. Normally, the system is booted from the file \*(lqxx(0,0)vmunix\*(rq without asking, where .I xx is determined by a code in register .I r10 (which is known as .I devtype) at entry to the bootstrap program. The code corresponds to the major device number of the root file system, i.e. \*(lqmajor(rootdev)\*(rq. Currently, the following values of .I devtype are understood: .RS .br .ns .IP .nf 0 hp rm03/rm05/rm80/rp06 massbus disk 1 -- unused 2 up unibus disks (emulex sc21 w/ cdc/ampex/fujitsu drives) 3 rk rk07 unibus disks .fi .RE .IP Thus if .I r10 contained a 2, the system .RS .IP .B up(0,0)vmunix. .RE .IP would be booted. This switch not available from the system call interface. .TP RB_SINGLE Normally, the reboot procedure involves an automatic disk consistency check and then multi-user operations. This prevents the consistency check, rather simply booting the system with a single-user shell on the console, from the file system specified by .I r10. This switch is interpreted by the .IR init (8) program in the newly booted system. This switch is not available from the system call interface. .SH "SEE ALSO" crash(8), halt(8), init(8), reboot(8) .SH BUGS om the system call interface. .TP RB_SINGLE Normallman/man2/setpgrp.2j 644 0 33 2672 2512730563 7376 .TH SETPGRP 2J .UC 4 .SH NAME setpgrp, getpgrp \- set/get process group .SH SYNOPSIS .B int getpgrp(pid) .PP .B setpgrp(pid, pgrp) .PP .B cc ... \-ljobs .SH DESCRIPTION The process group of the specified process is returned by .I getpgrp. .I Setpgrp sets the process group of the specified process .I pid to the specified .I pgrp. If .I pid is zero, then the call applies to the current process. .PP If the invoker is not the super-user, then the affected process must have the same effective user-id as the invoker or be a descendant of the invoking process. .PP This call is used by .IR csh (1) to create process groups in implementing job control. The TIOCGPGRP and TIOCSPGRP calls described in .IR tty (4) are used to get/set the process group of the control terminal. .PP See .IR jobs(3) for a general discussion of job control. .SH "SEE ALSO" jobs(3), getuid(2), tty(4) .SH BUGS The job control facilities are not available in standard version 7 UNIX. These facilities are still under development and may change in future releases of the system as better inter-process communication facilities and support for virtual terminals become available. The options and specifications of these system calls and even the calls themselves are thus subject to change. .PP A system call .I setpgrp has been implemented in other versions of UNIX which are not widely used outside of Bell Laboratories; these implementations have, in general, slightly different semantics. IX. These facilities are still under development and may change in futman/man2/setuid.2 644 0 33 1116 2512730563 7025 .TH SETUID 2 .SH NAME setuid, setgid \- set user and group ID .SH SYNOPSIS .B setuid(uid) .PP .B setgid(gid) .SH DESCRIPTION The user ID (group ID) of the current process is set to the argument. Both the effective and the real ID are set. These calls are only permitted to the super-user or if the argument is the real or effective ID. .SH "SEE ALSO" getuid(2) .SH DIAGNOSTICS Zero is returned if the user (group) ID is set; \-1 is returned otherwise. .SH "ASSEMBLER (PDP-11)" (setuid = 23.) .br (user ID in r0) .br .B sys setuid .PP (setgid = 46.) .br (group ID in r0) .br .B sys setgid setuid(uid) .PP .B setgid(gid) .SH DESCRIPTION The user ID (group ID) of the current process is set to the argument. Both the effective and the real ID are set. These calls are only permitted to the super-user or if the argument is the real or effective ID. .SH "SEE ALSO" getuid(2) .SH DIAGNOSTICS Zero is returned if the user (group) ID is set; \-1 is returned otherwise. .SH "ASSEMBLER (PDP-11)" (setuid = 23.) .br (user ID in r0)man/man2/signal.2 664 0 33 10350 2512730564 7030 .TH SIGNAL 2 .UC 4 .SH NAME signal \- catch or ignore signals .SH SYNOPSIS .nf .B #include .PP .B (*signal(sig, func))() .B void (*func)(); .fi .SH DESCRIPTION .IR N.B. : The system currently supports two signal implementations. The one described here is standard in version 7 UNIX systems, and is retained for backward compatabililty. The one described in .IR sigsys (2) as supplemented by .IR sigset (3) provides for the needs of the job control mechanisms used by .IR csh (1), and corrects the bugs in this older implementation of signals, allowing programs which process interrupts to be written reliably. .PP A signal is generated by some abnormal event, initiated either by user at a terminal (quit, interrupt), by a program error (bus error, etc.), or by request of another program (kill). Normally all signals cause termination of the receiving process, but a .I signal call allows them either to be ignored or to cause an interrupt to a specified location. Here is the list of signals with names as in the include file. .LP .nf .ta \w'SIGMMMM 'u +\w'15* 'u SIGHUP 1 hangup SIGINT 2 interrupt SIGQUIT 3* quit SIGILL 4* illegal instruction (not reset when caught) SIGTRAP 5* trace trap (not reset when caught) SIGIOT 6* IOT instruction SIGEMT 7* EMT instruction SIGFPE 8* floating point exception SIGKILL 9 kill (cannot be caught or ignored) SIGBUS 10* bus error SIGSEGV 11* segmentation violation SIGSYS 12* bad argument to system call SIGPIPE 13 write on a pipe with no one to read it SIGALRM 14 alarm clock SIGTERM 15 software termination signal 16 unassigned .fi .IR N.B. : There are actually more signals; see .IR sigsys (2); the signals listed here are those of standard version 7. .PP The starred signals in the list above cause a core image if not caught or ignored. .PP If .I func is SIG_DFL, the default action for signal .I sig is reinstated; this default is termination, sometimes with a core image. If .I func is SIG_IGN the signal is ignored. Otherwise when the signal occurs .I func will be called with the sign((al number as argument. A return from the function will continue the process at the point it was interrupted. .PP Except as indicated, a signal is reset to SIG_DFL after being caught. Thus if it is desired to catch every such signal, the catching routine must issue another .I signal call. .PP If, when using this (older) signal interface, a caught signal occurs during certain system calls, the call terminates prematurely. In particular this can occur during an .IR ioctl , .IR read , or .IR write (2) on a slow device (like a terminal; but not a file); and during .I pause or .IR wait (2). When such a signal occurs, the saved user status is arranged in such a way that when return from the signal-catching takes place, it will appear that the system call returned an error status. The user's program may then, if it wishes, re-execute the call. .PP The value of .I signal is the previous (or initial) value of .I func for the particular signal. .PP After a .IR fork (2) the child inherits all signals. .IR Exec (2) resets all caught signals to default action. .PP If a process is using the mechanisms of .IR sigsys (2) and .IR sigset (3) then many of these calls are automatically restarted (See .IR sigsys (2) and .IR jobs (3) for details). .SH "SEE ALSO" sigsys(2), kill(1), kill(2), ptrace(2), setjmp(3), sigset(3) .SH DIAGNOSTICS The value (int)\-1 is returned if the given signal is out of range. .SH BUGS The traps should be distinguishable by extra arguments to the signal handler, and all hardware supplied parameters should be made available to the signal routine. .PP If a repeated signal arrives before the last one can be reset, there is no chance to catch it (however this is .B not true if you use .IR sigsys (2) and .IR sigset (3)). .PP The type specification of the routine and its .I func argument are problematical. .SH "ASSEMBLER (PDP-11)" (signal = 48.) .br .B sys signal; sig; label .br (old label in r0) .PP If .I label is 0, default action is reinstated. If .I label is 1, the signal is ignored. Any other even .I label specifies an address in the process where an interrupt is simulated. An RTI or RTT instruction will return from the interrupt. .SH "NOTES (VAX-11)" See .IR sigsys (2) for information on how hardware faults are mapped into signals. ecification of the routine and its .I func argument are problematical. .SH "ASSEMBLER (PDP-11)" (signal = 48.) .br .B sys signal; sig; label .br (old label in r0) .PP If .I label is 0, default action is reinstated. If .I label is 1, the signal is ignored. Any other even .I labelman/man2/sigsys.2j 664 0 33 22210 2513541311 7233 .TH SIGSYS 2J 4/1/81 .UC 4 .ie t .ds d \(dg .el .ds d \z'|+' .ie t .ds b \(bu .el .ds b @ .SH NAME sigsys \- catch or ignore signals .SH SYNOPSIS .nf .B #include .PP .B (*sigsys(sig, func))() .B void (*func)(); .PP .B cc ... \-ljobs .fi .SH DESCRIPTION .IR N.B. : The system currently supports two signal implementations. The one described in .IR signal (2) is standard in version 7 UNIX systems, and retained for backward compatibility as it is different in a number of ways. The one described here (with the interface in .IR sigset (3)) provides for the needs of the job control mechanisms (see .IR jobs (3)) used by .IR csh (1), and corrects the bugs in the standard implementation of signals, allowing programs which process interrupts to be written reliably. .PP The routine .I sigsys is not normally called directly; rather the routines of .IR sigset (3) should be used. These routines are kept in the ``jobs'' library, accessible by giving the loader option .B \-ljobs. The features described here are less portable then those of .IR signal (2) and should not be used in programs which are to be moved to other versions of UNIX. .PP A signal is generated by some abnormal event, initiated by a user at a terminal (quit, interrupt, stop), by a program error (bus error, etc.), by request of another program (kill), or when a process is stopped because it wishes to access its control terminal while in the background (see .IR tty (4)). Signals are optionally generated when a process resumes after being stopped, when the status of child processes changes, or when input is ready at the control terminal. Most signals cause termination of the receiving process if no action is taken; some signals instead cause the process receiving them to be stopped, or are simply discarded if the process has not requested otherwise. Except for the SIGKILL and SIGSTOP signals which cannot be blocked, the .I sigsys call allows signals either to be ignored, held until a later time (protecting critical sections in the process), or to cause an interrupt to a specified location. Here is the list of all signals with names as in the include file. .LP .nf .ta \w'SIGMMMM 'u +\w'15* 'u SIGHUP 1 hangup SIGINT 2 interrupt SIGQUIT 3* quit SIGILL 4* illegal instruction (not reset when caught) SIGTRAP 5* trace trap (not reset when caught) SIGIOT 6* IOT instruction SIGEMT 7* EMT instruction SIGFPE 8* floating point exception SIGKILL 9 kill (cannot be caught, held or ignored) SIGBUS 10* bus error SIGSEGV 11* segmentation violation SIGSYS 12* bad argument to system call SIGPIPE 13 write on a pipe with no one to read it SIGALRM 14 alarm clock SIGTERM 15 software termination signal 16 unassigned SIGSTOP 17\*d stop (cannot be caught, held or ignored) SIGTSTP 18\*d stop signal generated from keyboard SIGCONT 19\*b continue after stop SIGCHLD 20\*b child status has changed SIGTTIN 21\*d background read attempted from control terminal SIGTTOU 22\*d background write attempted to control terminal SIGTINT 23\*b input record is available at control terminal SIGXCPU 24 cpu time limit exceeded (see \fIvlimit\fR(2)) SIGXFSZ 25 file size limit exceeded (see \fIvlimit\fR(2)) .fi .PP The starred signals in the list above cause a core image if not caught, held or ignored. .PP If .I func is SIG_DFL, the default action for signal .I sig is reinstated; this default is termination (with a core image for starred signals) except for signals marked with \*b or \*d. Signals marked with \*b are discarded if the action is SIG_DFL; signals marked with \*d cause the process to stop. If .I func is SIG_HOLD the signal is remembered if it occurs, but not presented to the process; it may be presented later if the process changes the action for the signal. If .I func is SIG_IGN the signal is subsequently ignored, and pending instances of the signal are discarded (i.e. if the action was previously SIG_HOLD.) Otherwise when the signal occurs .I func will be called. .PP A return from the function will continue the process at the point it was interrupted. Except as indicated, a signal, set with .I sigsys, is reset to SIG_DFL after being caught. However by specifying DEFERSIG(func) as the last argument to .I sigsys, one causes the action to be set to SIG_HOLD before the interrupt is taken, so that recursive instances of the signal cannot occur during handling of the signal. .PP When a caught signal occurs during certain system calls, the call terminates prematurely. In particular this can occur during a .I read or .IR write (2) on a slow device (like a terminal; but not a file) and during a .I pause or .IR wait (2). When a signal occurs during one of these calls, the saved user status is arranged in such a way that, when return from the signal-catching takes place, it will appear that the system call returned an error status. The user's program may then, if it wishes, re-execute the call. .I Read and .I write calls which have done no I/O, .IR ioctl s blocked with SIGTTOU, and .I wait3 calls are restarted. .PP The value of .I sigsys is the previous (or initial) value of .I func for the particular signal. .PP The system provides two other functions by oring bits into the signal number: SIGDOPAUSE causes the process to .I pause after changing the signal action. It can be used to atomically re-enable a held signal which was being processed and wait for another instance of the signal. SIGDORTI causes the system to simulate an .I rei instruction clearing the mark the system placed on the stack at the point of interrupt before checking for further signals to be presented due to the specified change in signal actions. This allows a signal package such as .IR sigset (3) to dismiss from interrupts cleanly removing the old state from the stack before another instance of the interrupt is presented. .PP After a .IR fork (2) or .IR vfork (2) the child inherits all signals. .IR Exec (2) resets all caught signals to default action; held signals remain held and ignored signals remain ignored. .SH "SEE ALSO" kill(1), ptrace(2), kill(2), jobs(3), sigset(3), setjmp(3), tty(4) .SH DIAGNOSTICS The value BADSIG is returned if the given signal is out of range. .SH BUGS The job control facilities are not available in standard version 7 UNIX. These facilities are still under development and may change in future releases of the system as better inter-process communication facilities and support for virtual terminals become available. The options and specifications of this facility and the system calls supporting it are thus subject to change. .PP Since only one signal action can be changed at a time, it is not possible to get the effect of SIGDOPAUSE for more than one signal at a time. .PP The traps (listed below) should be distinguishable by extra arguments to the signal handler, and all hardware supplied parameters should be made available to the signal routine. .SH "ASSEMBLER (PDP-11)" (signal = 48.) .br .B sys signal; sig; label .br (old label in r0) .PP If .I label is 0, default action is reinstated. If .I label is 1, the signal is ignored. If .I label is 3, the signal is held. Any other even .I label specifies an address in the ((process where an interrupt is simulated. If label is otherwise odd, the signal is sent to the function whose address is the label with the low bit cleared with the action set to SIG_HOLD. (Thus DEFERSIG is indicated by the low bit of a signal catch address. An RTI or RTT instruction will return from the interrupt.) .SH "NOTES (VAX-11)" The handler routine can be declared: .PP handler(signo, param, xx, pc, psl) .PP Here .I signo is the signal name, into which the hardware faults and traps are mapped as defined below. Param is the parameter which is either a constant as given below or, for compatibility mode faults, the code provided by the hardware. Compatibility mode faults are distinguished from the other SIGILL traps by having PSL_CM set in the psl. .PP The routine is actually called with only 3 parameters specified in the \fIcalls\fR or \fIcallg\fR instruction. After return from the signal handler the \fIpc\fR and \fIpsl\fR are popped off of the stack with an \fIrei\fR, so they act as ``value-result'' parameters unlike normal C value parameters. .PP The following defines the mapping of hardware traps to signals and codes. All of these symbols are defined in : .LP .ta \w' Floating/decimal divide by zero 'u +\w'15* 'u +8n .nf Hardware condition Signal Code Arithmetic traps: Integer overflow SIGFPE FPE_INTOVF_TRAP Integer division by zero SIGFPE FPE_INTDIV_TRAP Floating overflow trap SIGFPE FPE_FLTOVF_TRAP Floating/decimal division by zero SIGFPE FPE_FLTDIV_TRAP Floating underflow trap SIGFPE FPE_FLTUND_TRAP Decimal overflow trap SIGFPE FPE_DECOVF_TRAP Subscript-range SIGFPE FPE_SUBRNG_TRAP Floating overflow fault SIGFPE FPE_FLTOVF_FAULT Floating divide by zero fault SIGFPE FPE_FLTDIV_FAULT Floating underflow fault SIGFPE FPE_FLTUND_FAULT Length access control SIGSEGV Protection violation SIGBUS Reserved instruction SIGILL ILL_RESAD_FAULT Customer-reserved instr. SIGEMT Reserved operand SIGILL ILL_PRIVIN_FAULT Reserved addressing SIGILL ILL_RESOP_FAULT Trace pending SIGTRAP Bpt instruction SIGTRAP Compatibility-mode SIGILL hardware supplied code Chme SIGSEGV Chms SIGSEGV Chmu SIGSEGV .fi loating overflow fault SIGFPE FPE_FLTOVF_FAULT Floating divide by zero fault SIGFPE FPE_FLTDIV_FAULT Floating underflow fault SIGFPE FPE_FLTUND_FAULT Length access control SIGSEGV Protection violation SIGBUS Reserved instruction SIGILL ILL_RESAD_FAULT Customer-reserved instr. SIGEMT Reserved operand SIGILL ILL_PRIVIN_FAULT Reserved addressing SIGILL ILL_RESOP_FAULT Trman/man2/stat.2 644 0 33 3765 2531446171 6517 .TH STAT 2 .SH NAME stat, fstat \- get file status .SH SYNOPSIS .nf .B #include .B #include .PP .B stat(name, buf) .B char *name; .B struct stat *buf; .PP .B fstat(fildes, buf) .B struct stat *buf; .fi .SH DESCRIPTION .I Stat obtains detailed information about a named file. .I Fstat obtains the same information about an open file known by the file descriptor from a successful .I open, creat, dup or .IR pipe (2) call. .PP .I Name points to a null-terminated string naming a file; .I buf is the address of a buffer into which information is placed concerning the file. It is unnecessary to have any permissions at all with respect to the file, but all directories leading to the file must be searchable. The layout of the structure pointed to by buf as defined in .I is given below. .I St_mode is encoded according to the `#define' statements. .PP .nf .ta 5m 10m 15m 20m 25m 30m 35m 40m 45m 50m 55m 60m .so /usr/include/sys/stat.h .fi .DT .PP The mode bits 0000070 and 0000007 encode group and others permissions (see .IR chmod (2)). The defined types, .I ino_t, off_t, time_t, name various width integer values; .I dev_t encodes major and minor device numbers; their exact definitions are in the include file (see .IR types (5)). .PP When .I fildes is associated with a pipe, .I fstat reports an ordinary file with an i-node number, restricted permissions, and a not necessarily meaningful length. .PP .I st_atime is the file was last read. For reasons of efficiency, it is not set when a directory is searched, although this would be more logical. .I st_mtime is the time the file was last written or created. It is not set by changes of owner, group, link count, or mode. .I st_ctime is set both both by writing and changing the i-node. .SH "SEE ALSO" ls(1), filsys(5) .SH DIAGNOSTICS Zero is returned if a status is available; \-1 if the file cannot be found. .SH ASSEMBLER .nf (stat = 18.) .B sys stat; name; buf .PP (fstat = 28.) (file descriptor in r0) .B sys fstat; buf .fi t is not seman/man2/stime.2 644 0 33 744 2512730564 6640 .TH STIME 2 .SH NAME stime \- set time .SH SYNOPSIS .nf .B stime(tp) .B long *tp; .fi .SH DESCRIPTION .I Stime sets the system's idea of the time and date. Time, pointed to by .I tp, is measured in seconds from 0000 GMT Jan 1, 1970. Only the super-user may use this call. .SH "SEE ALSO" date(1), time(2), ctime(3) .SH DIAGNOSTICS Zero is returned if the time was set; \-1 if user is not the super-user. .SH "ASSEMBLER (PDP-11)" (stime = 25.) .br (time in r0-r1) .br .B sys stime .PP @,\D"man/man2/stty.2 644 0 33 32 2512730565 6471 .so /usr/man/man2/ioctl.2 e \- set time .SH SYNOPSIS .nf .B stime(tp) .B long *tp; .fi .SH DESCRIPTION .I Stime sets the system's idea of the time and date. Time, pointed to by .I tp, is measured in seconds from 0000 GMT Jan 1, 1970. Only the super-user may use this call. .SH "SEE ALSO" date(1), time(2), ctime(3) .SH DIAGNOSTICS Zero is returned if the time was set; \-1 if user is not the super-user. .SH "ASSEMBLER (/( ,( 5`Ċ /\@,\D"man/man2/sync.2 644 0 33 1070 2512730565 6505 .TH SYNC 2 .SH NAME sync \- update super-block .SH SYNOPSIS .B sync() .SH DESCRIPTION .I Sync causes all information in core memory that should be on disk to be written out. This includes modified super blocks, modified i-nodes, and delayed block I/O. .PP It should be used by programs which examine a file system, for example .I "icheck, df," etc. It is mandatory before a boot. .SH "SEE ALSO" sync(1), update(8) .SH BUGS The writing, although scheduled, is not necessarily complete upon return from .IR sync . .SH "ASSEMBLER (PDP-11)" (sync = 36.) .br .B sys sync PSIS .B sync() .SH DESCRIPTION .I Sync causes all information in core memory that should be on disk to be written out. This includes modified super blocks, modified i-nodes, and delayed block I/O. .PP It should be used by programs which examine a file system, for example .I "icheck, df," etc. It is mandatory before a boot. .SH "SEE ALSO" sync(1), update(8) .SH BUGS The writing, although scheduled, is not necessarily complete upon return from .IR sync man/man2/syscall.2 664 0 33 2344 2512730565 7212 .TH SYSCALL 2 .SH NAME syscall \- indirect system call .SH SYNOPSIS .nf .BR "syscall(number, r0, r1, arg ...)" \ \ (PDP-11) .BR "syscall(number, arg, ...)" \ \ (VAX-11) .fi .SH DESCRIPTION .I Syscall performs the system call whose assembly language interface has the specified .I number, register arguments .I r0 and .I r1 (on the PDP-11, regardless of whether the entry point really uses them) and further arguments .IR arg . .PP The r0 value of the system call is returned. .SH DIAGNOSTICS When the C-bit is set, .I syscall returns \-1 and sets the external variable .I errno (see .IR intro (2)). .SH BUGS There is no way to simulate system calls such as .IR pipe (2), which return values in register r1. .SH "ASSEMBLER (PDP-11)" (indir = 0.) .br .B sys indir; call .PP The system call at the location .I call is executed. Execution resumes after the .I indir call. .PP On the PDP-11, the main purpose of .I indir is to allow a program to store arguments in system calls and execute them out of line in the data segm((ent. This preserves the purity of the text segment. .PP If .I indir is executed indirectly, it is a no-op. If the instruction at the indirect location is not a system call, .I indir returns error code EINVAL; see .IR intro (2). ndir = 0.) .br .B sys indir; call .PP The system call at the location .I call is executed. Execution resumes after the .I indir call. .PP On the PDP-11, the main purpose of .I indir is to allow a program to store arguments in system calls and execute them out of line in the data segmman/man2/time.2 644 0 33 2070 2512730565 6470 .TH TIME 2 .SH NAME time, ftime \- get date and time .SH SYNOPSIS .nf .B long time(0) .PP .B long time(tloc) .B long *tloc; .PP .B #include .B #include .B ftime(tp) .B struct timeb *tp; .fi .SH DESCRIPTION .I Time returns the time since 00:00:00 GMT, Jan. 1, 1970, measured in seconds. .PP If .I tloc is nonnull, the return value is also stored in the place to which .I tloc points. .PP The .I ftime entry fills in a structure pointed to by its argument, as defined by .IR : .PP .ta .5i +\w'unsigned 'u .nf .so /usr/include/sys/timeb.h .fi .PP The structure contains the time since the epoch in seconds, up to 1000 milliseconds of more-precise interval, the local time zone (measured in minutes of time westward from Greenwich), and a flag that, if nonzero, indicates that Daylight Saving time applies locally during the appropriate part of the year. .SH "SEE ALSO" date(1), stime(2), ctime(3) .SH "ASSEMBLER (PDP-11)" (ftime = 35.) .br .B sys ftime; bufptr .PP (time = 13.; obsolete call) .br .B sys time .br (time since 1970 in r0-r1) ys/timeb.h .fi .PP The structure contains the time since the epoch in seconds, up to 1000 milliseconds of more-precise interval, the local time zone (measured in minutes of time westward from Greenwich), and a flag that, if nonzero, indicates that Daylight Saving time applies locally during the appropriate part of the year. .SH "SEE ALSO" date(1), stime(2), ctime(3) .SH "ASSEMBLER (PDP-11)" (ftime = 35.) .br .B sys ftime; bufptr .PP (time = 13.; obsoleman/man2/times.2 644 0 33 1270 2512730565 6654 .TH TIMES 2 .SH NAME times \- get process times .SH SYNOPSIS .nf .B "#include .B "#include .PP .B times(buffer) .B struct tms *buffer; .fi .SH DESCRIPTION .I Times returns time-accounting information for the current process and for the terminated child processes of the current process. All times are in 1/HZ seconds, where HZ is either 50 or 60 depending on your locality. .PP This is the structure returned by .IR times : .PP .nf .so /usr/include/sys/times.h .PP .fi The children times are the sum of the children's process times and their children's times. .SH "SEE ALSO" time(1), time(2), vtimes(2) .SH "ASSEMBLER (PDP-11)" (times = 43.) .br .B sys times; buffer .I Times returns time-accounting information for the current process and for the terminated child processes of the current process. All times are in 1/HZ seconds, where HZ is either 50 or 60 depending on your locality. .PP This is the structure returned by .IR times : .PP .nf .so /usr/include/sys/times.h .PP .fi The children tman/man2/umask.2 644 0 33 1372 2512730566 6657 .TH UMASK 2 .UC 4 .SH NAME umask \- set file creation mode mask .SH SYNOPSIS .B umask(complmode) .SH DESCRIPTION .I Umask sets a mask used whenever a file is created by .IR creat (2) or .IR mknod (2): the actual mode (see .IR chmod (2)) of the newly-created file is the logical .B and of the given mode and the complement of the argument. Only the low-order 9 bits of the mask (the protection bits) participate. In other words, the mask shows the bits to be turned off when files are created. .PP The previous value of the mask is returned by the call. The value is initially 022 (write access for owner only). The mask is inherited by child processes. .SH SEE ALSO creat(2), mknod(2), chmod(2) .SH "ASSEMBLER (PDP-11)" (umask = 60.) .br .B sys umask; complmode created file is the logical .B and of the given mode and the complement of the argument. Only the low-order 9 bits of the mask (the protection bits) participate. In other words, the mask shows the bits to be turned off when files are created. .PP The previous vaman/man2/unlink.2 644 0 33 1633 2512730566 7037 .TH UNLINK 2 .SH NAME unlink \- remove directory entry .SH SYNOPSIS .nf .B unlink(name) .B char *name; .fi .SH DESCRIPTION .I Name points to a null-terminated string. .I Unlink removes the entry for the file pointed to by .I name from its directory. If this entry was the last link to the file, the contents of the file are freed and the file is destroyed. If, however, the file was open in any process, the actual destruction is delayed until it is closed, even though the directory entry has disappeared. .SH "SEE ALSO" rm(1), link(2) .SH DIAGNOSTICS Zero is normally returned; \-1 indicates that the file does not exist, that its directory cannot be written, or that the file contains pure procedure text that is currently in use. Write permission is not required on the file itself. It is also illegal to unlink a directory (except for the super-user). .SH "ASSEMBLER (PDP-11)" (unlink = 10.) .br .B sys unlink; name tual destruction is delayed until it is closed, even though the directory entry has disappeared. .SH man/man2/utime.2 644 0 33 1033 2512730566 6654 .TH UTIME 2 .SH NAME utime \- set file times .SH SYNOPSIS .nf .B #include .PP .B utime(file, timep) .B char *file; .B time_t timep[2]; .fi .SH DESCRIPTION The .I utime call uses the `accessed' and `updated' times in that order from the .I timep vector to set the corresponding recorded times for .I file. .PP The caller must be the owner of the file or the super-user. The `inode-changed' time of the file is set to the current time. .SH SEE ALSO stat (2) .SH "ASSEMBLER (PDP-11)" (utime = 30.) .br .B sys utime; file; timep \- set file times .SH SYNOPSIS .nf .B #include .PP .B utime(file, timep) .B char *file; .B time_t timep[2]; .fi .SH DESCRIPTION The .I utime call uses the `accessed' and `updated' times in that order from the .I timep vector to set the corresponding recorded times for .I file. .PP The caller must be the owner of the file or the super-user. The `inode-changed' time of the file is set to the current time. .SH SEE ALSO stat (2) .SH "ASSEMBLER (PDP-11)" (utime = 30.) .brman/man2/vadvise.2v 644 0 33 3024 2512730566 7362 .TH VADVISE 2V .UC 4 .SH NAME vadvise \- give advice to paging system .SH SYNOPSIS .B vadvise(param) .SH DESCRIPTION .I Vadvise is used to inform the system that process paging behavior merits special consideration. Parameters to .I vadvise are defined in the file .B . Currently, two calls to .I vadvise are implemented: .PP The call .IP .B "vadvise(VA_ANOM);" .LP advises that the paging behavior is not likely to be well handled by the system's default algorithm, since reference information collected over macroscopic intervals (e.g. 10-20 seconds) will not serve to indicate future page references. The system in this case will choose to replace pages with little emphasis placed on recent usage, and more emphasis on referenceless circular behavior. It is \fIessential\fR that processes which have very random paging behavior (such as LISP during garbage collection of very large address spaces) call .I vadvise, as otherwise the system has great difficulty dealing with their page-consumptive demands. ((.PP The call .IP .B "vadvise(VA_NORM);" .LP restores default paging replacement behavior after a call to .IP .B "vadvise(VA_ANOM);" .SH BUGS This call is peculiar to this version of UNIX. The options and specifications of this system call and even the call itself are expected to change. It is expected to be extended with additional facilities in future versions of the system. In particular it is expected that this call will be particular to a segment, and that other behaviors such as sequential behavior will be specifiable. "vadvise(VA_NORM);" .LP restores default paging replacement behavior after a call to .IP .B "vadvise(VA_ANOM);" .SH BUGS This call is peculiar to this version of UNIX. The options and specifications of this system call and even the call itself are expected to change. It is expected to be extended with additional facilities in future versions of the system. In particular it is expected that this call will be particular to a segment, and that other behaviors such as sequential behavior wman/man2/vfork.2v 644 0 33 4064 2531446172 7053 .TH VFORK 2V .UC 4 .SH NAME vfork \- spawn new process in a virtual memory efficient way .SH SYNOPSIS .B vfork() .SH DESCRIPTION .I Vfork can be used to create new processes without fully copying the address space of the old process, which is horrendously inefficient in a paged environment. It is useful when the purpose of .IR fork (2) would have been to create a new system context for an .I exec. .I Vfork differs from .I fork in that the child borrows the parent's memory and thread of control until a call to .IR exec (2) or an exit (either by a call to .IR exit (2) or abnormally.) The parent process is suspended while the child is using its resources. .PP .I Vfork returns 0 in the child's context and (later) the pid of the child in the parent's context. .PP .I Vfork can normally be used just like .I fork. It does not work, however, to return while running in the childs context from the procedure which called .I vfork since the eventual return from .I vfork would then return to a no longer existent stack frame. Be careful, also, to call .I _exit rather than .I exit if you can't .I exec, since .I exit will flush and close standard I/O channels, and thereby mess up the parent processes standard I/O data structures. (Even with .I fork it is wrong to call .I exit since buffered data would then be flushed twice.) .PP Similarly when using the new signal mechanism of .IR sigset (3) mechanism be sure to call .I sigsys rather than .IR signal (2). .SH SEE ALSO fork(2), exec(2), sigsys(2), wait(2), .SH DIAGNOSTICS Same as for .IR fork . .SH BUGS This system call may be unnecessary if the system sharing mechanisms allow .I fork to be implemented more efficiently; users should not depend on the memory sharing semantics of .I vfork as it could, in that case, be made synonymous to .I fork. .PP To avoid a possible deadlock situation, processes which are children in the middle of a .I vfork are never sent SIGTTOU or SIGTTIN signals; rather, output or .IR ioctl s are allowed and input attempts result in an end-of-file indication. .PP This call is peculiar to this version of UNIX. necessary if the system sharing mechanisms allow .I fork to be implemented more efficiently; users should not depend on the memory sharing semantics of .I vfork as it could, in that case, be made synonymous to .I fork. .PP To avoid a possible deadlock situation, processes which are children in the middle of a .I vfork are never sent SIGTTOU or SIGTTIN signals; rather, output or .IR ioctl s are allowed and input attempts result in an end-of-file indication.man/man2/vhangup.2v 644 0 33 1700 2512730567 7371 .TH VHANGUP 2V .UC 4 .SH NAME vhangup \- virtually ``hangup'' the current control terminal .SH SYNOPSIS .B vhangup() .SH DESCRIPTION .I Vhangup is used by the initialization process .IR init (8) to arrange that users are given \*(lqclean\*(rq' terminals at login, by revoking access of the previous users' processes to the terminal. To effect this, .I vhangup searches the system tables for references to the control terminal of the invoking process, revoking access permissions on each instance of the terminal which it finds. Further attempts to access the terminal by the affected processes will yield i/o errors (EBADF). Finally, a hangup signal (SIGHUP) is sent to the process group of the control terminal. .SH SEE ALSO init (8) .SH BUGS Access to the control terminal via .B /dev/tty is still possible. .PP This call is peculiar to this version of UNIX. The options and specifications of this system call and even the call itself are subject to change. s, revoking access permissions on each instance of the terminal man/man2/vlimit.2v 644 0 33 5044 2527170274 7231 .TH VLIMIT 2V .UC 4 .SH NAME vlimit \- control maximum system resource consumption .SH SYNOPSIS .B "#include " .PP .B vlimit(resource, value) .SH DESCRIPTION Limits the consumption by the current process and each process it creates to not individually exceed .I value on the specified .I resource. If .I value is specified as \-1, then the current limit is returned and the limit is unchanged. The resources which are currently controllable are: .TP 15 .B LIM_NORAISE A pseudo-limit; if set non-zero then the limits may not be raised. Only the super-user may remove the \fInoraise\fR restriction. .TP 15 .B LIM_CPU the maximum number of cpu-seconds to be used by each process .TP 15 .B LIM_FSIZE the largest single file which can be created .TP 15 .B LIM_DATA the maximum growth of the data+stack region via .IR sbrk (2) beyond the end of the program text .TP 15 .B LIM_STACK the maximum size of the automatically-extended stack region .TP 15 .B LIM_CORE the size of the largest core dump that will be created. .TP 15 .B LIM_MAXRSS a soft limit for the amount of physical memory (in bytes) to be given to the program. If memory is tight, the system will prefer to take memory from processes which are exceeding their declared LIM_MAXRSS. .PP Because this information is stored in the per-process information this system call must be executed directly by the shell if it is to affect all future processes created by the shell; .I limit is thus a built-in command to .IR csh (1). .PP The system refuses to extend the data or stack space when the limits would be exceeded in the normal way; a .I break call fails if the data space limit is reached, or the process is killed when the stack limit is reached (since the stack cannot be extended, there is no way to send a signal!). .PP A file i/o operation which would create a file which is too large will cause a signal SIGXFSZ to be generated, this normally terminates the process, but may be caught. When the cpu time limit is exceeded, a signal SIGXCPU is sent to the offending process; to allow it time to process the signal it is given 5 seconds grace by raising the cpu time limit. .SH SEE ALSO csh(1) .SH BUGS If LIM_NORAISE is set, then no grace should be given when the cpu time limit is exceeded. .PP There should be .I limit and .I unlimit commands in .IR sh (1) as well as in .IR csh. .PP This call is peculiar to this version of UNIX. The options and specifications of this system call and even the call itself are subject to change. It may be extended or replaced by other facilities in future versions of the system. signal it is given 5 seconds grace by raising the cpu time limit. .SH SEE ALSO csh(1) .SH BUGS If LIM_NORAISE is set, then no grace should be given when the cpu time limit is exceeded. .PP There should be .I limit and .I unlimit commands in .IR sh (1) as well as in .IR csh. .PP This call is peculiar to this version of UNIX. The options and specifications of this system call and even the call itself are subject to change. It may be extended or replaced by other facilitieman/man2/vread.2v 644 0 33 5766 2512730567 7042 .TH VREAD 2V deprecated .UC 4 .SH NAME vread \- read virtually .SH SYNOPSIS .nf .B vread(fildes, buffer, nbytes) .B char *buffer; .fi .SH DESCRIPTION .B N.B.: This call is likely to be replaced by more general virtual memory facilities in the near future. .PP A file descriptor is a word returned from a successful .I open, .I creat, .I dup or .I pipe call. .I Buffer is the location of .I nbytes contiguous bytes into which the input will be placed. It is not guaranteed that all .I nbytes will be read (see .IR(( read (2)). In particular, if the returned value is 0, then end-of-file has been reached. .PP Unlike .IR read (2), .I vread does not necessarily or immediately fetch the data requested from .I fildes, but merely insures that the data will be fetched from the file descriptor .I "sometime before" the first reference to the data, at the system's discretion. Thus .I vread allows the system, among other possibilities, to choose to read data on demand, with whatever granularity is allowed by the memory management hardware, or to just read it in immediately as with .I read. A companion .IR vwrite (2) call may be used with .I vread to provide an efficient mechanism for updating large files. The behavior of .I vread if other processes are writing to .I fildes is not defined. .PP Both the address of .I buffer and the current offset in .I fildes (as told by .IR tell (2)) must be aligned to a multiple of VALSIZ (defined in .B ). The library routine .IR valloc (3) allocates properly aligned blocks from the free list. .PP Note for non-virtual systems: the .I vread system call can be simulated (exactly, if less efficiently) by .I read. If the unit on which a .I vread is done is not capable of supporting efficient demand initialization (e.g. a terminal or a pipe), then the system may choose to treat a call to .I vread as if it were a call to .I read at its discretion. .SH SEE ALSO read(2), write(2), vwrite (2), valloc(3) .SH DIAGNOSTICS A 0 is returned at end-of-file. If the read was otherwise unsuccessful, a -1 is returned. Physical I/O errors, non-aligned or bad buffer addresses, preposterous .I nbytes, file descriptor not that of an input file, and file offset not properly aligned can all generate errors. .SH BUGS You can't .I close a file descriptor which you have .I vread from while there are still pages in the file which haven't been fetched by the system into your address space. In no case can a file descriptor which had such pages at the point of a .I vfork be closed during the .I vfork. .PP The system refuses to truncate a file to which any process has a pending .I vread. .PP There is no primitive inverting .I vread to release the binding .I vread sets up so that the file may be closed. This can be only be done, clumsily, by reading another (plain) file onto the buffer area, or pulling the break back with .IR break (2) to completely release the pages. .PP This call is peculiar to this version of UNIX. It will be superseded by more general virtual memory facilities in future versions of the system. ystem refuman/man2/vswapon.2v 644 0 33 1202 2512730570 7405 .TH VSWAPON 2V .UC 4 .SH NAME vswapon \- add a swap device for interleaved paging/swapping .SH SYNOPSIS .nf .B vswapon(name) .B char *name; .fi .SH DESCRIPTION .I Vswapon makes the argument block device available to the system for allocation for paging and swapping. The number of blocks to be made available, as well as the names of all potentially available devices are known to the system, and are present in the system configuration file (e.g. /usr/src/sys/conf/confhp.c). .SH "SEE ALSO" swapon(8) .SH BUGS There is no way to stop swapping on a disk so that the pack may be dismounted. .PP This call is peculiar to this version of UNIX. ar *name; .fi .SH DESCRIPTION .I Vswapon makes the argument block device available to the system for allocation for paging and swapping. The number of blocks to be made available, as well as the names of all potentially available devices are known to the system, and are present in the system configuration file (e.g. /usr/src/sys/conf/confhp.c). .SH "SEE ALSO" swapon(8) .SH BUGS man/man2/vtimes.2v 664 0 33 5044 2512730570 7231 .TH VTIMES 2V .UC 4 .SH NAME vtimes \- get information about resource utilization .SH SYNOPSIS .nf .B "vtimes(par_vm, ch_vm)" .B "struct vtimes *par_vm, *ch_vm;" .fi .SH DESCRIPTION .I Vtimes returns accounting information for the current process and for the terminated child processes of the current process. Either .I par_vm or .I ch_vm or both may be 0, in which case only the information for the pointers which are non-zero is returned. .PP After the call, each buffer contains information as defined by the contents of the include file .I /usr/include/sys/vtimes.h: .LP .nf struct vtimes { int vm_utime; /* user time (*HZ) */ int vm_stime; /* system time (*HZ) */ /* divide next two by utime+stime to get averages */ unsigned vm_idsrss; /* integral of d+s rss */ unsigned vm_ixrss; /* integral of text rss */ int vm_maxrss; /* maximum rss */ int vm_majflt; /* major page faults */ int vm_minflt; /* minor page faults */ int vm_nswap; /* number of swaps */ int vm_inblk; /* block reads */ int vm_oublk; /* block writes */ }; .fi .PP The .I vm_utime and .I vm_stime fields give the user and system time respectively in 60ths of a second (or 50ths if that is the frequency of wall current in your locality.) The .I vm_idrss and .I vm_ixrss measure memory usage. They are computed by integrating the number of memory pages in use each over cpu time. They are reported as though computed discretely, adding the current memory usage (in 512 byte pages) each time the clock ticks. If a process used 5 core pages over 1 cpu-second for its data and stack, then .I vm_idsrss would have the value 5*60, where .I vm_utime+vm_stime would be the 60. .I Vm_idsrss integrates data and stack segment usage, while .I vm_ixrss integrates text segment usage. .I Vm_maxrss reports the maximum instantaneous sum of the text+data+stack core-resident page count. .PP The .I vm_majflt field gives the number of page faults which resulted in disk activity; the .I vm_minflt field gives the number of page faults incurred in simulation of reference bits; .I vm_nswap is the number of swaps which occurred. The number of file system input/output events are reported in .I vm_inblk and .I vm_oublk These numbers account only for real i/o; data supplied by the caching mechanism is charged only to the first process to read or write the data. .SH SEE ALSO time(2), wait3(2) .SH BUGS This call is peculiar to this version of UNIX. The options and specifications of this system call are subject to change. It may be extended to include additional information in future versions of the system. ber of swaps which occurred. The number of file system input/output events are reported in .I vm_inblk and .I vm_oublk These numbers account only for real i/o; data supplied by the caching mechanism is charged only to the first process to read or write the data. .SH SEE ALSO time(2), wait3(2) .SH BUGS This call is peculiar to this version of UNIX. The options and specifications of this system call are subject to change. It may be extended to include additional informatioman/man2/vwrite.2v 644 0 33 2140 2512730570 7232 .TH VWRITE 2V deprecated .UC 4 .SH NAME vwrite \- write (virtually) to file .SH SYNOPSIS .nf .B vwrite(filedes, buffer, nbytes) .B char *buffer; .fi .SH DESCRIPTION .B N.B.: This call is likely to be replaced by more general virtual memory facilities in the near future. .PP The .I vwrite system call is used in conjunction with .I vread to perform efficient updating of large files. After a call to .I vread and updating of the data in the buffer which was given to .I vread, a .I vwrite of the same buffer to the same .I filedes at the same offset in the file will cause data which has been modified since it was .I vread from (or .I vwritten to) the file to be returned to the file. .SH SEE ALSO vread(2) .SH DIAGNOSTICS Returns \-1 on error: bad descriptor, buffer address, count or alignment as well as on physical I/O errors. .SH BUGS The result of .I vwrite is defined only when no other .I vread's have occurred on .I buffer since the one matching the .I vwrite. .PP This call is peculiar to this version of UNIX. It will be superseded by more general virtual memory facilities in future versions of the system. it was .I vread from (or .I vwritten to) the file to be returned to the file. .SH SEE ALSO vread(2) .SH DIAGNOSTICS Returns \-1 on error: bad descriptor, buffer address, count or alignment as well as on physical I/O errors. .SH BUGS The result of .I vwrite is defined only when no other .I vread's have occurred on .I buffer since the one matching the .I vwrite. .PP This call is peculiar to this version of UNIX. Itman/man2/wait.2 644 0 33 3246 2512730571 6501 ((.TH WAIT 2 .SH NAME wait \- wait for process to terminate .SH SYNOPSIS .nf .B wait(status) .B int *status; .fi .PP .B wait(0) .SH DESCRIPTION .I Wait causes its caller to delay until a signal is received or one of its child processes terminates. If any child has died since the last .I wait, return is immediate; if there are no children, return is immediate with the error bit set (resp. with a value of \-1 returned). The normal return yields the process ID of the terminated child. In the case of several children several .I wait calls are needed to learn of all the deaths. .PP If .RI (int) status is nonzero, the high byte of the word pointed to receives the low byte of the argument of .I exit when the child terminated. The low byte receives the termination status of the process. See .IR signal (2) for a list of termination statuses (signals); 0 status indicates normal termination. A special status (0177) is returned for a stopped process which has not terminated and can be restarted. See .IR ptrace (2). If the 0200 bit of the termination status is set, a core image of the process was produced by the system. .PP If the parent process terminates without waiting on its children, the initialization process (process ID = 1) inherits the children. .PP There is another entry .IR wait3 (2) which is provides additional options needed by the shell .IR csh (1) to do job control. .SH "SEE ALSO" wait3(2), exit(2), fork(2), signal(2) .SH DIAGNOSTICS Returns \-1 if there are no children not previously waited for. .SH "ASSEMBLER (PDP-11)" (wait = 7.) .br .B sys wait .br (process ID in r0) .br (status in r1) .PP The high byte of the status is the low byte of r0 in the child at termination. en, the initialization process (process ID = 1) inherits the children. .PP There is another entry .IR wait3 (2) which is provides additional options needed by the shell .IR csh (1) to do job control. .SH "SEE ALSO" wait3(2), exit(2), fork(2), signal(2) .SH DIAGNOSTICS Returns \-1 if there are no children not previously waited for. .SH "ASSEMBLEman/man2/wait3.2j 644 0 33 3532 2512730571 6734 .TH WAIT3 2J .UC 4 .SH NAME wait3 \- wait for process to terminate .SH SYNOPSIS .nf .B "#include " .B "#include " .PP .B wait3(status, options, vtimep) .B union wait status; .B int options; .B struct vtimes *vtimep; .PP .B cc ... \-ljobs .fi .SH DESCRIPTION The .I status and .I option words are described by definitions and macros in the file ; the union and its bitfield definitions and associated macros given there provide convenient and mnemonic access to the word of status returned by a .I wait3 call. See this file for more information. .PP There are two .I options, which may be combined by .IR or ing them together. The first is WNOHANG which causes the .I wait3 to not hang if there are no processes which wish to report status, rather returning a pid of 0 in this case as the result of the .I wait3. The second option is WUNTRACED which causes .I wait3 to return information when children of the current process which are stopped but not traced (with .IR ptrace (2)) because they received a SIGTTIN, SIGTTOU, SIGTSTP or SIGSTOP signal. See .IR sigsys (2)) for a description of these signals. .PP The .I vtimep pointer is an optional structure where a .I vtimes structure is returned describing the resources used by the terminated process and all its children. This may be given as \*(lq0\*(rq if the information is not desired. Currently this information is not available for stopped processes. .SH "SEE ALSO" wait(2), exit(2), fork(2), sigsys(2) .SH DIAGNOSTICS Returns \-1 if there are no children not previously waited for, or 0 if the WNOHANG option is given and there are no stopped or exited children. .SH BUGS This call is peculiar to this version of UNIX. The options and specifications of this system call and even the call itself are subject to change. It may be replaced by other facilities in future versions of the system. . Currently this information is not available for stopped processes. .SH "SEE ALSO" wait(2), exit(2), fork(2), sigsys(2) .SH DIAGNOSTICS Returns \-1 if there are no man/man2/write.2 644 0 33 3404 2512730571 6663 .TH WRITE 2 .UC 4 .SH NAME write \- write on a file .SH SYNOPSIS .nf .B write(fildes, buffer, nbytes) .B char *buffer; .fi .SH DESCRIPTION A file descriptor is a word returned from a successful .I open, .I creat, .I dup, or .IR pipe (2) call. .PP .I Buffer is the address of .I nbytes contiguous bytes which are written on the output file. The number of characters actually written is returned. It should be regarded as an error if this is not the same as requested. .PP Writes which are multiples of 1024 characters long and begin on a 1024-byte boundary in the file are more efficient than any others. .PP .IR Write s to the control terminal by a process which is not in the process group of the termainl and which is not ignoring or holding SIGTTOU signals cause the writer's process group to receive a SIGTTOU signal (See .IR jobs (3) and the description of the LTOSTOP option in .IR tty (4) for details). .PP On some systems .I write clears the set-user-id bit on a file. This prevents penetration of system security by a user who \*(lqcaptures\*(rq a writeable set-user-id file owned by the super-user. .SH "SEE ALSO" creat(2), open(2), pipe(2) .SH DIAGNOSTICS Returns \-1 on error: bad descriptor, buffer address, or count; physical I/O errors. .SH "ASSEMBLER (PDP-11)" (write = 4.) .br (file descriptor in r0) .br .B sys write; buffer; nbytes .br (byte count in r0) .SH BUGS It would be nice to be able to call write and have the call return with an error indication if there was no buffer space for the written data, rather than blocking the process. .PP Processes which have been orphaned by their parents and have been inherited by .IR init (8) never receive SIGTTOU signals. Output by such a process is permitted even when they are not in the process group of the control terminal. = 4.) .br (file descriptor in r0) .br .B sys write; buffer; nbytes .br (byte count in r0) .SH BUGS It would be nice to be able to call write and have the call return with an error indication if there was no buffer space for the written data, rather tman/man3/ 775 0 33 0 2512730610 5355 man/man3/abort.3 644 0 33 526 2512730574 6627 .TH ABORT 3 .SH NAME abort \- generate a fault .SH DESCRIPTION .I Abort executes an instruction which is illegal in user mode. This causes a signal that normally terminates the process with a core dump, which may be used for debugging. .SH SEE ALSO adb(1), signal(2), exit(2) .SH DIAGNOSTICS Usually `IOT trap \- core dumped' from the shell. nt in r0) .SH BUGS It would be nice to be able to call te and h /0 C. /\@,\D"man/man3/abs.3 644 0 33 411 2512730574 6256 .TH ABS 3 .SH NAME abs \- integer absolute value .SH SYNOPSIS .nf .B abs(i) .B int i; .fi .SH DESCRIPTION .I Abs returns the absolute value of its integer operand. .SH SEE ALSO floor(3) for .I fabs .SH BUGS You get what the hardware gives on the smallest integer. ), exit(2) .SH DIAGNOSTICS Usually `IOT trap \- core dumped' from the shell. nt in r0) .SH BUGS It would be nice to be able to call te and h //( ,( 5Ċ /\@,\D"man/man3/assert.3x 644 0 33 1117 2512730574 7226 ((.TH ASSERT 3X .SH NAME assert \- program verification .SH SYNOPSIS .B #include .PP .B assert(expression) .SH DESCRIPTION .PP .I Assert is a macro that indicates .I expression is expected to be true at this point in the program. It causes an .IR exit (2) with a diagnostic comment on the standard output when .I expression is false (0). Compiling with the .IR cc (1) option .SM .B \-DNDEBUG effectively deletes .I assert from the program. .SH DIAGNOSTICS `Assertion failed: file .I f line .I n.' .I F is the source file and .I n the source line number of the .I assert statement. .PP .B assert(expression) .SH DESCRIPTION .PP .I Assert is a macro that indicates .I expression is expected to be true at this point in the program. It causes an .IR exit (2) with a diagnostic comment on the standard output when .I expression is false (0). Compiling with the .IR cc (1) option .SM .B \-DNDEBUG effectively deletes .I assert from the program. .SH DIAGNOSTICS `Assertion failed: file .I f line .I n.' .I F man/man3/atof.3 644 0 33 1427 2512730574 6472 .TH ATOF 3 .SH NAME atof, atoi, atol \- convert ASCII to numbers .SH SYNOPSIS .nf .B double atof(nptr) .B char *nptr; .PP .B atoi(nptr) .B char *nptr; .PP .B long atol(nptr) .B char *nptr; .fi .SH DESCRIPTION These functions convert a string pointed to by .I nptr to floating, integer, and long integer representation respectively. The first unrecognized character ends the string. .PP .I Atof recognizes an optional string of tabs and spaces, then an optional sign, then a string of digits optionally containing a decimal point, then an optional `e' or `E' followed by an optionally signed integer. .PP .I Atoi and .I atol recognize an optional string of tabs and spaces, then an optional sign, then a string of digits. .SH SEE ALSO scanf(3) .SH BUGS There are no provisions for overflow. nteger, and long integer representation respectively. The first unrecognized character ends the string. .PP .I Atof recognizes an optional string of tabs and spaces, then an optional sign, then a string of digits optionally containinman/man3/crypt.3 644 0 33 3310 2512730575 6674 .TH CRYPT 3 .SH NAME crypt, setkey, encrypt \- DES encryption .SH SYNOPSIS .nf .B char *crypt(key, salt) .B char *key, *salt; .PP .B setkey(key) .B char *key; .PP .B encrypt(block, edflag) .B char *block; .fi .SH DESCRIPTION .I Crypt is the password encryption routine. It is based on the NBS Data Encryption Standard, with variations intended (among other things) to frustrate use of hardware implementations of the DES for key search. .PP The first argument to .I crypt is a user's typed password. The second is a 2-character string chosen from the set [a-zA-Z0-9./]. The .I salt string is used to perturb the DES algorithm in one of 4096 different ways, after which the password is used as the key to encrypt repeatedly a constant string. The returned value points to the encrypted password, in the same alphabet as the salt. The first two characters are the salt itself. .PP The other entries provide (rather primitive) access to the actual DES algorithm. The argument of .I setkey is a character array of length 64 containing only the characters with numerical value 0 and 1. If this string is divided into groups of 8, the low-order bit in each group is ignored, leading to a 56-bit key which is set into the machine. .PP The argument to the .I encrypt entry is likewise a character array of length 64 containing 0's and 1's. The argument array is modified in place to a similar array representing the bits of the argument after having been subjected to the DES algorithm using the key set by .I setkey. If .I edflag is 0, the argument is encrypted; if non-zero, it is decrypted. .SH "SEE ALSO" passwd(1), passwd(5), login(1), getpass(3) .SH BUGS The return value points to static data whose content is overwritten by each call. .PP The argument to the .I encrypt entry is likewise a character array of length 64 containing 0's and 1's. The argument array is modified in place to a similar array representing the bits of the argument after having been subjected to the DES algorithm using the key set by .I setkey. If .I edflag is 0, the arman/man3/ctime.3 664 0 33 4170 2512730575 6643 .TH CTIME 3 .SH NAME ctime, localtime, gmtime, asctime, timezone \- convert date and time to ASCII .SH SYNOPSIS .nf .B char *ctime(clock) .B long *clock; .PP .B #include .PP .B struct tm *localtime(clock) .B long *clock; .PP .B struct tm *gmtime(clock) .B long *clock; .PP .B char *asctime(tm) .B struct tm *tm; .PP .B char *timezone(zone, dst) .fi .SH DESCRIPTION .I Ctime converts a time pointed to by .I clock such as returned by .IR time (2) into ASCII and returns a pointer to a 26-character string in the following form. All the fields have constant width. .PP Sun Sep 16 01:03:52 1973\\n\\0 .PP .I Localtime and .I gmtime return pointers to structures containing the broken-down time. .I Localtime corrects for the time zone and possible daylight savings time; .I gmtime converts directly to GMT, which is the time UNIX uses. .I Asctime converts a broken-down time to ASCII and returns a pointer to a 26-character string. .PP The structure declaration from the include file is: .RS .PP .nf .so /usr/include/time.h .fi .RE .PP These quantities give the time on a 24-hour clock, day of month (1-31), month of year (0-11), day of week (Sunday = 0), year \- 1900, day of year (0-365), and a flag that is nonzero if daylight saving time is in effect. .PP When local time is called for, the program consults the system to determine the time zone and whether the standard U.S.A. daylight saving time adjustment is appropriate. The program knows about the peculiarities of this conversion in 1974 and 1975; if necessary, a table for these years can be extended. .PP .I Timezone returns the name of the time zone associated with its first argument, which is measured in minutes westward from Greenwich. If the second argument is 0, the standard name is used, otherwise the Daylight Saving version. If the required name does not appear in a table built into the routine, the difference from GMT is produced; e.g. in Afghanistan .I timezone(-(60*4+30), 0) is appropriate because it is 4:30 ahead of GMT and the string .B GMT+4:30 is produced. .SH "SEE ALSO" time(2) .SH BUGS The return values point to static data whose content is overwritten by each call. ment, which is measured in minutes westward from Greenwich. If the second argument is 0, the standard name is used, otherwise the Daylight Saving version. If the required name does not appear in a table built into the routine, the difference from GMT is produced; e.g. in Afghanistan .I timezone(-(60*4+30), 0) is appropriate because it is 4:30 ahead of GMT and the string .B GMT+4:30 is prodman/man3/ctype.3 644 0 33 2161 2512730575 6662 .TH CTYPE 3 .SH NAME isalpha, isupper, islower, isdigit, isalnum, isspace, ispunct, isprint, iscntrl, isascii \- character classification .SH SYNOPSIS .B #include .PP .B isalpha(c) .PP .B . . . .SH DESCRIPTION These macros classify ASCII-coded integer values by table lookup. Each is a predicate returning nonzero for true, zero for false. .I Isascii is defined on all integer values; the rest are defined only where .I isascii is true and on the single non-ASCII value EOF (see .IR stdio (3)). .TP 15n .I isalpha .I c is a letter .TP .I isupper .I c is an upper case letter .TP .I islower .I c is a lower case letter .TP .I isdigit .I c is a digit .TP .I isalnum .I c is an alphanumeric character .TP .I isspace .I c is a space, tab, carriage return, newline, or formfeed .TP .I ispunct .I c is a punctuation character (neither control nor alphanumeric) .TP .I isprint .I c is a printing character, code 040(8) (space) through 0176 (tilde) .TP .I iscntrl .I c is a delete character (0177) or ordinary control character (less than 040). .TP .I isascii .I c is an ASCII character, code less than 0200 .SH "SEE ALSO" ascii(7) etter .TP .I isdigit .I c is a digit .TP .I isalnum .I c is an alphanumeric character .TP .I isspace .I c is a space, tab, carriage return, newline, or formfeed .TP .I ispunct .I c is a punctuation character (neither control nor alphanumeric) .TP .I isprint .I c is a printing character, code 040(8) (space) through 0176 (tilde) .TP .I iscntrl .I c is a delete character (0177) or ordinary control c((man/man3/curses.3 644 0 33 6350 2531446245 7045 .TH CURSES 3 .UC 4 .SH NAME curses \- screen functions with ``optimal'' cursor motion .SH SYNOPSIS .B cc [ flags ] files .B \-lcurses \-ltermcap [ libraries ] .SH DESCRIPTION These routines give the user a method of updating screens with reasonable optimization. They keep an image of the current screen, and the user sets up an image of a new one. Then the .I refresh() tells the routines to make the current screen look like the new one. In order to initialize the routines, the routine .I initscr() must be called before any of the other routines that deal with windows and screens are used. The routine .I endwin() should be called before exiting. .SH SEE ALSO .I "Screen Updating and Cursor Movement Optimization: A Library Package," Ken Arnold, .br stty(2), setenv(3), termcap(5) .SH AUTHOR Ken Arnold .SH FUNCTIONS .nf .ds w \fIwin\fR .ds s \fIstdscr\fR .ta 3i addch(ch) add a character to \*s addstr(str) add a string to \*s box(win,vert,hor) draw a box around a window crmode() set cbreak mode clear() clear \*s clearok(scr,boolf) set clear flag for \fIscr\fR clrtobot() clear to bottom on \*s clrtoeol() clear to end of line on \*s delch() delete a character deleteln() delete a line delwin(win) delete \*w echo() set echo mode endwin() end window modes erase() erase \*s getch() get a char through \*s getcap(name) get terminal capability \fIname\fR getstr(str) get a string through \*s gettmode() get tty modes getyx(win,y,x) get (y,x) co-ordinates inch() get char at current (y,x) co-ordinates initscr() initialize screens insch(c) insert a char insertln() insert a line leaveok(win,boolf) set leave flag for \*w longname(termbuf,name) get long name from \fItermbuf\fR move(y,x) move to (y,x) on \*s mvcur(lasty,lastx,newy,newx) actually move cursor newwin(lines,cols,begin_y,begin_x)\ create a new window nl() set newline mapping nocrmode() unset cbreak mode noecho() unset echo mode nonl() unset newline mapping noraw() unset raw mode overlay(win1,win2) overlay win1 on win2 overwrite(win1,win2) overwrite win1 on top of win2 printw(fmt,arg1,arg2,...) printf on \*s raw() set raw mode refresh() make current screen look like \*s resetty() reset tty flags to stored value savetty() stored current tty flags scanw(fmt,arg1,arg2,...) scanf through \*s scroll(win) scroll \*w one line scrollok(win,boolf) set scroll flag setterm(name) set term variables for name standend() end standout mode standout() start standout mode subwin(win,lines,cols,begin_y,begin_x)\ create a subwindow touchwin(win) \*(lqchange\*(rq all of \*w unctrl(ch) printable version of \fIch\fR waddch(win,ch) add char to \*w waddstr(win,str) add string to \*w wclear(win) clear \*w wclrtobot(win) clear to bottom of \*w wclrtoeol(win) clear to end of line on \*w wdelch(win,c) delete char from \*w wdeleteln(win) delete line from \*w werase(win) erase \*w wgetch(win) get a char through \*w wgetstr(win,str) get a string through \*w winch(win) get char at current (y,x) in \*w winsch(win,c) insert char into \*w winsertln(win) insert line into \*w wmove(win,y,x) set current (y,x) co-ordinates on \*w wprintw(win,fmt,arg1,arg2,...)\ printf on \*w wrefresh(win) make screen look like \*w wscanw(win,fmt,arg1,arg2,...)\ scanf through \*w wstandend(win) end standout mode on \*w wstandout(win) start standout mode on \*w win) delete line from \*w werase(win) erase \*w wgetch(win) get a char through \*w wgetstr(win,str) get a string through \*w winch(win) get char at current (y,x) in \*w winsch(win,c) insert char into \*w winsertln(win) insert line into \*w wmove(win,y,x) set current (y,x) co-ordiman/man3/dbm.3x 644 0 33 5555 2512730576 6503 .TH DBM 3X .UC 4 .SH NAME dbminit, fetch, store, delete, firstkey, nextkey \- data base subroutines .SH SYNOPSIS .nf .PP .B typedef struct { .B " char *dptr;" .B " int dsize;" .B } datum; .PP .B dbminit(file) .B char *file; .PP .B datum fetch(key) .B datum key; .PP .B store(key, content) .B datum key, content; .PP .B delete(key) .B datum key; .PP .B datum firstkey() .PP .B datum nextkey(key) .B datum key; .SH DESCRIPTION These functions maintain key/content pairs in a data base. The functions will handle very large (a billion blocks) databases and will access a keyed item in one or two file system accesses. The functions are obtained with the loader option .BR \-ldbm . .PP .IR Key s and .IR content s are described by the .I datum typedef. A .I datum specifies a string of .I dsize bytes pointed to by .I dptr. Arbitrary binary data, as well as normal ASCII strings, are allowed. The data base is stored in two files. One file is a directory containing a bit map and has `.dir' as its suffix. The second file contains all data and has `.pag' as its suffix. .PP Before a database can be accessed, it must be opened by .I dbminit. At the time of this call, the files .IB file .dir and .IB file .pag must exist. (An empty database is created by creating zero-length `.dir' and `.pag' files.) .PP Once open, the data stored under a key is accessed by .I fetch and data is placed under a key by .IR store . A key (and its associated contents) is deleted by .IR delete . A linear pass through all keys in a database may be made, in an (apparently) random order, by use of .I firstkey and .IR nextkey . .I Firstkey will return the first key in the database. With any key .I nextkey will return the next key in the database. This code will traverse the data base: .IP .B for (key = firstkey(); key.dptr != NULL; key = nextkey(key)) .SH DIAGNOSTICS All functions that return an .I int indicate errors with negative values. A zero return indicates ok. Routines that return a .I datum indicate errors with a null (0) .I dptr. .SH BUGS The `.pag' file will contain holes so that its apparent size is about four times its actual content. Older UNIX systems may create real file blocks for these holes when touched. These files cannot be copied by normal means (cp, cat, tp, tar, ar) without filling in the holes. .PP .I Dptr pointers returned by these subroutines point into static storage that is changed by subsequent calls. .PP The sum of the sizes of a key/content pair must not exceed the internal block size (currently 1024 bytes). Moreover all key/content pairs that hash together must fit on a single block. .I Store will return an error in the event that a disk block fills with inseparable data. .PP .I Delete does not physically reclaim file space, although it does make it available for reuse. .PP The order of keys presented by .I firstkey and .I nextkey depends on a hashing function, not on anything interesting. ent calls. .PP The sum of the sizes of a key/content pair must not exceed the internal block size (currently 1024 bytes). Moreover all key/content man/man3/ecvt.3 644 0 33 2466 2512730576 6510 .TH ECVT 3 .SH NAME ecvt, fcvt, gcvt \- output conversion .SH SYNOPSIS .nf .B char *ecvt(value, ndigit, decpt, sign) .B double value; .B int ndigit, *decpt, *sign; .PP .B char *fcvt(value, ndigit, decpt, sign) .B double value; .B int ndigit, *decpt, *sign; .PP .B char *gcvt(value, ndigit, buf) .B double value; .B char *buf; .fi .SH DESCRIPTION .I Ecvt converts the .I value to a null-terminated string of .I ndigit ASCII digits and returns a pointer thereto. The position of the decimal point relative to the beginning of the string is stored indirectly through .IR decpt "" (negative means to the left of the returned digits). If the sign of the result is negative, the word pointed to by .IR sign "" is non-zero, otherwise it is zero. The low-order digit is rounded. .PP .IR Fcvt " is identical to " "ecvt\fR, except that the correct digit" has been rounded for Fortran F-format output of the number of digits specified by .IR \(*_ndigits . .PP .I Gcvt converts the .I value to a null-terminated ASCII string in .I buf and returns a pointer to .I buf. It attempts to produce .I ndigit significant digits in Fortran F format if possible, otherwise E format, ready for printing. Trailing zeros may be suppressed. .SH "SEE ALSO" printf(3) .SH BUGS The return values point to static data whose content is overwritten by each call. that the correct digit" has been rounded for Fortran F-format output of the number of digits specified by .IR \(*_ndigits . .PP .I Gcvt converts the .I value to a null-terminated ASCII string in .I bufman/man3/end.3 644 0 33 1346 2512730576 6311 ((.TH END 3 .SH NAME end, etext, edata \- last locations in program .SH SYNOPSIS .nf .B extern end; .B extern etext; .B extern edata; .fi .SH DESCRIPTION These names refer neither to routines nor to locations with interesting contents. The address of .I etext is the first address above the program text, .I edata above the initialized data region, and .I end above the uninitialized data region. .PP When execution begins, the program break coincides with .I end, but it is reset by the routines .IR brk (2), .IR malloc (3), standard input/output .RI ( stdio (3)), the profile .RB ( \-p ) option of .IR cc (1), etc. The current value of the program break is reliably returned by `sbrk(0)', see .IR brk (2). .SH "SEE ALSO" brk(2), malloc(3) nts. The address of .I etext is the first address above the program text, .I edata above the initialized data region, and .I end above the uninitialized data region. .PP When execution begins, the program break coincides with .I end, but it is reset by the routines .IR brk (2), .IRman/man3/exp.3m 644 0 33 1743 2512730576 6515 .TH EXP 3M .SH NAME exp, log, log10, pow, sqrt \- exponential, logarithm, power, square root .SH SYNOPSIS .nf .B #include .PP .B double exp(x) .B double x; .PP .B double log(x) .B double x; .PP .B double log10(x) .B double x; .PP .B double pow(x, y) .B double x, y; .PP .B double sqrt(x) .B double x; .fi .SH DESCRIPTION .I Exp returns the exponential function of .I x. .PP .I Log returns the natural logarithm of .IR x ; .I log10 returns the base 10 logarithm. .PP .I Pow returns .I x\u\s8y\s10\d. .PP .I Sqrt returns the square root of .I x. .SH SEE ALSO hypot(3), sinh(3), intro(2) .SH DIAGNOSTICS .I Exp and .I pow return a huge value when the correct value would overflow; .I errno is set to ERANGE. .I Pow returns 0 and sets .I errno to EDOM when the second argument is negative and non-integral and when both arguments are 0. .PP .I Log returns 0 when .I x is zero or negative; .I errno is set to EDOM. .PP .I Sqrt returns 0 when .I x is negative; .I errno is set to EDOM. w returns .I x\u\s8y\s10\d. man/man3/fclose.3s 644 0 33 1403 2512730577 7174 .TH FCLOSE 3S .SH NAME fclose, fflush \- close or flush a stream .SH SYNOPSIS .B #include .PP .B fclose(stream) .br .SM .B FILE .B *stream; .PP .B fflush(stream) .br .SM .B FILE .B *stream; .SH DESCRIPTION .I Fclose causes any buffers for the named .I stream to be emptied, and the file to be closed. Buffers allocated by the standard input/output system are freed. .PP .I Fclose is performed automatically upon calling .IR exit (2). .PP .I Fflush causes any buffered data for the named output .I stream to be written to that file. The stream remains open. .SH "SEE ALSO" close(2), fopen(3), setbuf(3) .SH DIAGNOSTICS These routines return .SM .B EOF if .I stream is not associated with an output file, or if buffered data cannot be transferred to that file. .I stream to be emptied, and the file to be closed. Buffers allocated by the standard input/output system are freed. .PP .I Fclose is performed automatically upon calling .IR exit (2). .PP .I Fflush causes any buffered data for the named output .I strman/man3/ferror.3s 644 0 33 1604 2512730577 7223 .TH FERROR 3S .SH NAME feof, ferror, clearerr, fileno \- stream status inquiries .SH SYNOPSIS .B #include .PP .B feof(stream) .br .SM .B FILE .B *stream; .PP .B ferror(stream) .br .SM .B FILE .B *stream .PP .B clearerr(stream) .br .SM .B FILE .B *stream .PP .B fileno(stream) .br .SM .B FILE .B *stream; .SH DESCRIPTION .I Feof returns non-zero when end of file is read on the named input .I stream, otherwise zero. .PP .I Ferror returns non-zero when an error has occurred reading or writing the named .I stream, otherwise zero. Unless cleared by .I clearerr, the error indication lasts until the stream is closed. .PP .I Clrerr resets the error indication on the named .I stream. .PP .I Fileno returns the integer file descriptor associated with the .I stream, see .IR open (2). .PP These functions are implemented as macros; they cannot be redeclared. .SH "SEE ALSO" fopen(3), open(2) named input .I stream, otherwise zero. .PP .I Ferror returns non-zero when an error has occurred reading or writing the nameman/man3/floor.3m 644 0 33 700 2512730577 7013 .TH FLOOR 3M .SH NAME fabs, floor, ceil \- absolute value, floor, ceiling functions .SH SYNOPSIS .nf .B #include .PP .B double floor(x) .B double x; .PP .B double ceil(x) .B double x; .PP .B double fabs(x) .B double x; .nf .SH DESCRIPTION .I Fabs returns the absolute value .RI | \|x\| |. .PP .I Floor returns the largest integer not greater than .IR x . .PP .I Ceil returns the smallest integer not less than .IR x . .SH SEE ALSO abs(3) 5Ċ /\@,\D"man/man3/fopen.3s 644 0 33 3660 2513541243 7026 .TH FOPEN 3S 4/1/81 .UC 4 .SH NAME fopen, freopen, fdopen \- open a stream .SH SYNOPSIS .B #include .PP .SM .B FILE .B *fopen(filename, type) .br .B char *filename, *type; .PP .SM .B FILE .B *freopen(filename, type, stream) .br .B char *filename, *type; .br .SM .B FILE .B *stream; .PP .SM .B FILE .B *fdopen(fildes, type) .br .B char *type; .SH DESCRIPTION .I Fopen opens the file named by .I filename and associates a stream with it. .I Fopen returns a pointer to be used to identify the stream in subsequent operations. .PP .I Type is a character string having one of the following values: .TP 5 "r" open for reading .ns .TP 5 "w" create for writing .ns .TP 5 "a" append: open for writing at end of file, or create for writing .PP In addition, each .I type may be followed by a '+' to have the file opened for reading and writing. "r+" positions the stream at the beginning of the file, "w+" creates or truncates it, and "a+" positions it at the end. Both reads and writes may be used on read/write streams, with the limitation that an .I fseek, rewind, or reading an end-of-file must be used between a read and a write or vice-versa. .PP .I Freopen substitutes the named file in place of the open .IR stream . It returns the original value of .IR stream . The original stream is closed. .PP .I Freopen is typically used to attach the preopened constant names, .B stdin, stdout, stderr, to specified files. .PP .I Fdopen associates a stream with a file descriptor obtained from .I open, dup, creat, or .IR pipe (2). The .I type of the stream must agree with the mode of the open file. .SH "SEE ALSO" open(2), fclose(3) .SH DIAGNOSTICS .I Fopen and .I freopen return the pointer .SM .B NULL if .I filename cannot be accessed. .SH BUGS .I Fdopen is not portable to systems other than UNIX. .PP The read/write .I types do not exist on all systems. Those systems without read/write modes will probably treat the .I type as if the '+' was not present. m with a file descriptor obtained from .I open, dup, creat, or .IR pipe (2). Theman/man3/fread.3s 644 0 33 1724 2512730577 7010 .TH FREAD 3S .UC 4 .SH NAME fread, fwrite \- buffered binary input/output .SH SYNOPSIS .B #include .PP .B fread(ptr, sizeof(*ptr), nitems, stream) .br .SM .B FILE .B *stream; .PP .B fwrite(ptr, sizeof(*ptr), nitems, stream) .br .SM .B FILE .B *stream; .SH DESCRIPTION .I Fread reads, into a block beginning at .I ptr, .I nitems of data of the type of .I *ptr from the named input .IR stream . It returns the number of items actually read. .PP If .I stream is .B stdin and the standard output is line b((uffered, then any partial output line will be flushed before any call to .IR read (2) to satisfy the .I fread. .PP .I Fwrite appends at most .I nitems of data of the type of .I *ptr beginning at .I ptr to the named output .IR stream . It returns the number of items actually written. .SH "SEE ALSO" read(2), write(2), fopen(3), getc(3), putc(3), gets(3), puts(3), printf(3), scanf(3) .SH DIAGNOSTICS .I Fread and .I fwrite return 0 upon end of file or error. .SH BUGS s .B stdin and the standard output is line bman/man3/frexp.3 644 0 33 1235 2512730577 6665 .TH FREXP 3 .SH NAME frexp, ldexp, modf \- split into mantissa and exponent .SH SYNOPSIS .nf .B double frexp(value, eptr) .B double value; .B int *eptr; .PP .B double ldexp(value, exp) .B double value; .PP .B double modf(value, iptr) .B double value, *iptr; .SH DESCRIPTION .I Frexp returns the mantissa of a double .I value as a double quantity, .I x, of magnitude less than 1 and stores an integer .I n such that .I value = \fIx\fP\|\(**\|2\u\fIn\fP\d indirectly through .I eptr. .PP .I Ldexp returns the quantity \fIvalue\|\(**\|2\u\fIexp\fP\d. .PP .I Modf returns the positive fractional part of .I value and stores the integer part indirectly through .I iptr. .B double ldexp(value, exp) .B double value; .PP .B double modf(value, iptr) .B double value, *iptr; .SH DESCRIPTION .I Frexp returns the mantissa of a double .I value as a double quantity, .I x, of magnitude less than 1 and stores an integer .I n such that .I value = \fIx\fP\|\(**\|2\u\fIn\fP\d indirectly through .I eptr. .PP .I Ldexp returns the quman/man3/fseek.3s 644 0 33 2000 2512730600 6773 .TH FSEEK 3S .SH NAME fseek, ftell, rewind \- reposition a stream .SH SYNOPSIS .B #include .PP .B fseek(stream, offset, ptrname) .br .SM .B FILE .B *stream; .br .B long offset; .PP .B long ftell(stream) .br .SM .B FILE .B *stream; .PP .B rewind(stream) .SH DESCRIPTION .I Fseek sets the position of the next input or output operation on the .IR stream . The new position is at the signed distance .I offset bytes from the beginning, the current position, or the end of the file, according as .I ptrname has the value 0, 1, or 2. .PP .I Fseek undoes any effects of .IR ungetc (3). .PP .I Ftell returns the current value of the offset relative to the beginning of the file associated with the named .IR stream . It is measured in bytes on UNIX; on some other systems it is a magic cookie, and the only foolproof way to obtain an .I offset for .IR fseek . .PP .I Rewind(stream) is equivalent to .I "fseek(stream, 0L, 0)." .SH "SEE ALSO" lseek(2), fopen(3) .SH DIAGNOSTICS .I Fseek returns \-1 for improper seeks. man/man3/gamma.3m 644 0 33 1063 2512730600 6762 .TH GAMMA 3M .SH NAME gamma \- log gamma function .SH SYNOPSIS .nf .B #include .PP .B double gamma(x) .B double x; .fi .SH DESCRIPTION .I Gamma returns ln \||\|\(*G(\||\|\fIx\fR\||\|)\||\|. The sign of \(*G(\||\|\fIx\fR\||\|) is returned in the external integer .IR signgam . The following C program might be used to calculate \(*G: .PP .nf y = gamma(x); if (y > 88.0) error(); y = exp(y); if(signgam) y = \-y; .fi .SH DIAGNOSTICS A huge value is returned for negative integer arguments. .SH BUGS There should be a positive indication of error. .SH SYNOPSIS .nf .B #include .PP .B double gamma(x) .B double x; .fi .SH DESCRIPTION .I Gamma returns ln \||\|\(*G(\||\|\fIx\fR\||\|)\||\|. The sign of \(*G(\||\|\fIx\fR\||\|) is returned in the external integer .IR signgam . The following C program might be used to calculate \(*G: .PP .nf y = gamma(x); if (y > 88.0) error(); y = exp(y); if(signgam) y = \-y; .fi .SH DIAGNOSTICS A huge value is returned for negative integer arguments. .SH BUman/man3/getarg.3f 644 0 33 1354 2512730600 7145 .TH GETARG 3F .SH NAME getarg, iargc \- command arguments to Fortran .SH SYNOPSIS .nf .B subroutine getarg( argno, string ) .B integer argno .B character *(*) string .PP .B iargc() .fi .SH DESCRIPTION These procedures permit Fortran programs to access the command arguments. The integer function .B iargc returns the number of command arguments. The subroutine .B getarg stores the nth command argument in its second argument. The string is truncated or padded with blanks, in accord with the rules of Fortran character assignment. .PP The command go arg1 argument2 .br will return 2 as the value of .B iargc. If \fBs\fR is declared character\(**4, then call getarg(2, s) .br will put \*(lqargu\*(rq in \fBs\fR. .SH "SEE ALSO" exec(2) grams to access the command arguments. The integer function .B iargc returns the number of command arguments. The subroutine .B getarg stores the nth command argument in its second argument. The string is truncated or padded with blanks, in accord with the rules of Fortran chman/man3/getc.3s 644 0 33 2666 2512730600 6642 .TH GETC 3S .SH NAME getc, getchar, fgetc, getw \- get character or word from stream .SH SYNOPSIS .B #include .PP .B int getc(stream) .br .SM .B FILE .B *stream; .PP .B int getchar() .PP .B int fgetc(stream) .br .SM .B FILE .B *stream; .PP .B int getw(stream) .br .SM .B FILE .B *stream; .SH DESCRIPTION .I Getc returns the next character from the named input .IR stream . .PP .I Getchar() is identical to .IR getc(stdin) . .PP .I Fgetc behaves like .I getc, but is a genuine function, not a macro; it may be used to save object text. .PP .I Getw returns the next word (32-bit integer on a VAX-11) from the named input .IR stream . It returns the constant .SM .B EOF upon end of file or error, but since that is a good integer value, .I feof and .IR ferror (3) should be used to check the success of .IR getw . .I Getw assumes no special alignment in the file. .SH "SEE ALSO" fopen(3), putc(3), gets(3), scanf(3), fread(3), ungetc(3) .SH DIAGNOSTICS These functions return the integer constant .SM .B EOF at end of file or upon read error. .PP A stop with message, `Reading bad file', means an attempt has been made to read from a stream that has not been opened for reading by .IR fopen . .SH BUGS The end-of-file return from .I getchar is incompatible with that in UNIX editions 1-6. .PP Because it is implemented as a macro, .I getc treats a .I stream argument with side effects incorrectly. In particular, `getc(*f++);' doesn't work sensibly. SH DIAGNOSTICS These functions return the integer constant .SM .B EOF at eman/man3/getenv.3 644 0 33 527 2512730600 6777 .TH GETENV 3 .SH NAME getenv \- value for environment name .SH SYNOPSIS .nf .B char *getenv(name) .B char *name; .fi .SH DESCRIPTION .I Getenv .a searches the environment list (see .IR environ (5)) for a string of the form .IB name = value and returns .I value if such a string is present, otherwise 0 (NULL). .SH SEE ALSO environ(5), exec(2) am argument with side effects incorrectly. In particular, `getc(*f++);' doesn/( ,( 5@Ċ /\@,\D"man/man3/getfsent.3 644 0 33 2466 2512730601 7353 ((.TH GETFSENT 3 .UC 4 .SH NAME getfsent, getfsspec, getfsfile, setfsent, endfsent \- get file system descriptor file entry .SH SYNOPSIS .nf .B #include .PP .B struct fstab *getfsent() .PP .B struct fstab *getfsspec(name) .B char *name; .PP .B struct fstab *getfsfile(name) .B char *name; .PP .B int setfsend() .PP .B int endfsent() .fi .SH DESCRIPTION .I Getfsent, .I getfsspec and .I getfsfile each return a pointer to an object with the following structure containing the broken-out fields of a line in the file system description file, .I /usr/include/fstab.h. .RS .PP .nf #define FSNMLG 16 struct fstab{ char fs_spec[FSNMLG]; char fs_file[FSNMLG]; char fs_type[3]; int fs_freq; int fs_passno; }; .ft R .ad .fi .RE .PP The fields have meanings described in .IR fstab (5). .PP .I Getfsent reads the next line of the file, opening the file if necessary. .PP .I Setfsent opens and rewinds the file. .PP .I Endfsent closes the file. .PP .I Getfsspec and .I getfsfile sequentially search from the beginning of the file until a matching special file name or file system file name is found, or until EOF is encountered. .SH FILES /etc/fstab .SH "SEE ALSO" fstab(5) .SH DIAGNOSTICS Null pointer (0) returned on EOF or error. .SH BUGS All information is contained in a static area so it must be copied if it is to be saved. line of the file, opening the file if necessary. .PP .I Setfsent opens and rewinds the file. .PP .I Endfsent closes the file. .PP .I Getfsspec and .I getfsfile sequentially search from the beginning of man/man3/getgrent.3 644 0 33 3004 2512730601 7340 .TH GETGRENT 3 .SH NAME getgrent, getgrgid, getgrnam, setgrent, endgrent \- get group file entry .SH SYNOPSIS .nf .B #include .PP .B struct group *getgrent() .PP .B struct group *getgrgid(gid) .B int gid; .PP .B struct group *getgrnam(name) .B char *name; .PP .B setgrent() .PP .B endgrent() .fi .SH DESCRIPTION .I Getgrent, .I getgrgid and .I getgrnam each return pointers to an object with the following structure containing the broken-out fields of a line in the group file. .RS .PP .nf .so /usr/include/grp.h .fi .RE .PP The members of this structure are: .TP \w'gr_passwd'u+2n gr_name The name of the group. .br .ns .TP \w'gr_passwd'u+2n gr_passwd The encrypted password of the group. .br .ns .TP \w'gr_passwd'u+2n gr_gid The numerical group-ID. .br .ns .TP \w'gr_passwd'u+2n gr_mem Null-terminated vector of pointers to the individual member names. .PP .I Getgrent simply reads the next line while .I getgrgid and .I getgrnam search until a matching .I gid or .I name is found (or until EOF is encountered). Each routine picks up where the others leave off so successive calls may be used to search the entire file. .PP A call to .I setgrent has the effect of rewinding the group file to allow repeated searches. .I Endgrent may be called to close the group file when processing is complete. .SH FILES /etc/group .SH "SEE ALSO" getlogin(3), getpwent(3), group(5) .SH DIAGNOSTICS A null pointer (0) is returned on EOF or error. .SH BUGS All information is contained in a static area so it must be copied if it is to be saved. routine picks up where the others leave off so successive calls may be used to search the entire file. .PP A call to .I setgrent has the effect of rewinding the group file to allow repeated searches. .I Endgrent may be called to close the group file when processing is complete. .SH FILES /etc/group .SH "SEE ALSO" getlogin(3), getpwent(3), group(5) .SH DIAGNOSTICS A null pointer (0) is returned on EOF or error. .SH BUGS All information is contained in a static area so it must be copied if it is to be savman/man3/getlogin.3 644 0 33 1364 2512730601 7340 .TH GETLOGIN 3 .SH NAME getlogin \- get login name .SH SYNOPSIS .B char *getlogin() .SH DESCRIPTION .I Getlogin returns a pointer to the login name as found in .IR /etc/utmp . It may be used in conjunction with .I getpwnam to locate the correct password file entry when the same userid is shared by several login names. .PP If .I getlogin is called within a process that is not attached to a typewriter, it returns NULL. The correct procedure for determining the login name is to first call .I getlogin and if it fails, to call .IR getpwuid . .SH FILES /etc/utmp .SH "SEE ALSO" getpwent(3), getgrent(3), utmp(5) .SH DIAGNOSTICS Returns NULL (0) if name not found. .SH BUGS The return values point to static data whose content is overwritten by each call. t password file entry when the same userid is shared by several login names. .PP If .I getlogin is called within a process that is not attached to a typewriter, it returns NULL. The correct procedure for determining the login name is to first call .I getlogin and if iman/man3/getpass.3 644 0 33 1023 2512730601 7166 .TH GETPASS 3 .SH NAME getpass \- read a password .SH SYNOPSIS .nf .B char *getpass(prompt) .B char *prompt; .fi .SH DESCRIPTION .I Getpass reads a password from the file .IR /dev/tty , or if that cannot be opened, from the standard input, after prompting with the null-terminated string .I prompt and disabling echoing. A pointer is returned to a null-terminated string of at most 8 characters. .SH FILES /dev/tty .SH "SEE ALSO" crypt(3) .SH BUGS The return value points to static data whose content is overwritten by each call. NAME getpass \- read a password .SH SYNOPSIS .nf .B char *getpass(prompt) .B char *prompt; .fi .SH DESCRIPTION .I Getpass reads a password from the file .IR /dev/tty , or if that cannot be opened, from the standard input, after prompting with the null-terminated string .I prompt and disabling echoing. A pointer is returned to a null-terminated string of at most 8 characters. .SH FILES /dev/tty .SH "SEE ALSO" crypt(3) .SH BUGS The return value points to static data whose content is overwriman/man3/getpw.3 644 0 33 660 2512730601 6634 .TH GETPW 3 deprecated .SH NAME getpw \- get name from uid .SH SYNOPSIS .nf .B getpw(uid, buf) .B char *buf; .fi .SH DESCRIPTION .I Getpw searches the password file for the (numerical) .IR uid ", and fills in " "buf" with the corresponding line; it returns non-zero if .IR uid "" could not be found. The line is null-terminated. .SH FILES /etc/passwd .SH "SEE ALSO" getpwent(3), passwd(5) .SH DIAGNOSTICS Non-zero return on error. ,( 5Ċ /\@,\D"man/man3/getpwent.3 644 0 33 2206 2512730602 7362 .TH GETPWENT 3 .SH NAME getpwent, getpwuid, getpwnam, setpwent, endpwent \- get password file entry .SH SYNOPSIS .nf .B #include .PP .B struct passwd *getpwent() .PP .B struct passwd *getpwuid(uid) .B int uid; .PP .B struct passwd *getpwnam(name) .B char *name; .PP .B int setpwent() .PP .B int endpwent() .fi .SH DESCRIPTION .I Getpwent, .I getpwuid and .I getpwnam each return a pointer to an object with the following structure containing the broken-out fields of a line in the password file. .RS .PP .nf .so /usr/include/pwd.h .ft R .ad .fi .RE .PP The fields .I pw_quota and .I pw_comment are unused; the others have meanings described in .IR passwd (5). .PP .I Getpwent reads the next line (opening the file if necessary); .I setpwent rewinds the file; .I endpwent closes it. .PP .I Getpwuid and .I getpwnam search from the beginning until a matching .I uid or .I name is found (or until EOF is encountered). .SH FILES /etc/passwd .SH "SEE ALSO" getlogin(3), getgrent(3), passwd(5) .SH DIAGNOSTICS Null pointer (0) returned on EOF or error. .SH BUGS All information is contained in a static area so it must be copied if it is to be saved. .br bed in .IR passwd (5). .PP .I Getpwent reads the next line (opening the file if necessary); .I setpwent rewinds the file; .I endpwent closes it. .PP .I Getpwuid and .I getpwnam search from the beginning until a matching .I uid or .I name is found (or until EOF is encountered). .SH FILES /etc/passwd .SH "SEE ALSO" getlogin(3), getgrent(3), passwd(5) .SH DIAGNOSTICS Null pointe((man/man3/gets.3s 644 0 33 1651 2512730602 6655 .TH GETS 3S .SH NAME gets, fgets \- get a string from a stream .SH SYNOPSIS .B #include .PP .B char *gets(s) .br .B char *s; .PP .B char *fgets(s, n, stream) .br .B char *s; .br .SM .B FILE .B *stream; .SH DESCRIPTION .I Gets reads a string into .I s from the standard input stream .B stdin. The string is terminated by a newline character, which is replaced in .I s by a null character. .I Gets returns its argument. .PP .I Fgets reads .IR n \-1 characters, or up to a newline character, whichever comes first, from the .I stream into the string .IR s . The last character read into .I s is followed by a null character. .I Fgets returns its first argument. .SH "SEE ALSO" puts(3), getc(3), scanf(3), fread(3), ferror(3) .SH DIAGNOSTICS .I Gets and .I fgets return the constant pointer .SM .B NULL upon end of file or error. .SH BUGS .I Gets deletes a newline, .I fgets keeps it, all in the name of backward compatibility. nt. .PP .I Fgets reads .IR n \-1 characters, or up to a newline character, whichever cman/man3/hypot.3m 644 0 33 533 2512730602 7026 .TH HYPOT 3M .SH NAME hypot, cabs \- Euclidean distance .SH SYNOPSIS .nf .B #include .PP .B double hypot(x, y) .B double x, y; .PP .B double cabs(z) .B struct { double x, y;} z; .fi .SH DESCRIPTION .I Hypot and .I cabs return .PP .IP sqrt(x*x + y*y), .LP taking precautions against unwarranted overflows. .SH SEE ALSO exp(3) for .I sqrt etes a newline, .I fgets keeps it, all in the name of backward compatibil/( ,( 5Ċ /\@,\D"man/man3/intro.3 644 0 33 4647 2512730602 6673 .TH INTRO 3 .UC 4 .SH NAME intro \- introduction to library functions .SH SYNOPSIS .B #include .PP .B #include .SH DESCRIPTION This section describes functions that may be found in various libraries, other than those functions that directly invoke UNIX system primitives, which are described in section 2. Functions are divided into various libraries distinguished by the section number at the top of the page: .TP 6n (3) These functions, together with those of section 2 and those marked (3S), constitute library .I libc, which is automatically loaded by the C compiler .IR cc (1) and the Fortran compiler .IR f77 (1). The link editor .IR ld (1) searches this library under the `\-lc' option. Declarations for some of these functions may be obtained from include files indicated on the appropriate pages. .TP (3J) These functions are part of the job control facilities, contained in the library .RB \*(lq \-ljobs .\*(rq The job control facilities are outlined in .IR jobs (3). .TP (3M) These functions constitute the math library, .I libm. They are automatically loaded as needed by the Fortran compiler .IR f77 (1). The link editor searches this library under the `\-lm' option. Declarations for these functions may be obtained from the include file . .TP (3S) These functions constitute the `standard I/O package', see .IR stdio (3). These functions are in the library .I libc already mentioned. Declarations for these functions may be obtained from the include file . .TP (3X) Various specialized libraries have not been given distinctive captions. Files in which such libraries are found are named on appropriate pages. .SH FILES .nf /lib/libc.a /lib/libm.a, /usr/lib/libm.a (one or the other) /usr/lib/libjobs.a .fi .SH SEE ALSO stdio(3), nm(1), ld(1), cc(1), f77(1), intro(2) .SH DIAGNOSTICS Functions in the math library (3M) may return conventional values when the function is undefined for the given arguments or when the value is not representable. In these cases the external variable .I errno (see .IR intro (2)) is set to the value EDOM or ERANGE. The values of EDOM and ERANGE are defined in the include file .I . .SH "ASSEMBLER (PDP-11)" In assembly language these functions may be accessed by simulating the C calling sequence. For example, .IR ecvt (3) might be called this way: .IP "" .globl _ecvt .nf setd mov $sign,\-(sp) mov $decpt,\-(sp) mov ndigit,\-(sp) movf value,\-(sp) jsr pc,_ecvt add $14.,sp .fi when the value is not representable. In these cases the external variable .I errno (see man/man3/j0.3m 644 0 33 1055 2512730602 6214 .TH J0 3M .SH NAME j0, j1, jn, y0, y1, yn \- bessel functions .SH SYNOPSIS .nf .B #include .PP .B double j0(x) .B double x; .PP .B double j1(x) .B double x; .PP .B double jn(n, x) .B double x; .PP .B double y0(x) .B double x; .PP .B double y1(x) .B double x; .PP .B double yn(n, x) .B double x; .fi .SH DESCRIPTION These functions calculate Bessel functions of the first and second kinds for real arguments and integer orders. .SH DIAGNOSTICS Negative arguments cause .I y0, y1, and .I yn to return a huge negative value and set .I errno to EDOM. bessel functions .SH SYNOPSIS .nf .B #include .PP .B double j0(x) .B double x; .PP .B double j1(x) .B double x; .PP .B double jn(n, x) .B double x; .PP .B double y0(x) .B double x; .PP .B double y1(x) .B double x; .PP .B double yn(n, x) .B double x; .fi .SH DESCRIPTION These functions calculate Bessel functions of the first and second kinds for real arguments and integer orders. .SH DIAGNOSTICS Negative arguments cause .I y0, y1, and .I yn to return a hman/man3/jobs.3j 644 0 33 27776 2512730603 6700 .TH JOBS 3J .UC 4 .SH NAME jobs \- summary of job control facilities .SH SYNOPSIS .nf .B #include .B #include .B #include .B #include .PP .B int fildes, signo; .B short pid, pgrp; .B union wait status; .B struct vtimes vt; .PP .B ioctl(fildes, TIOCSPGRP, &pgrp) .B ioctl(fildes, TIOCGPGRP, &pgrp) .PP .B setpgrp(pid, pgrp) .B getpgrp(pid) .B killpg(pgrp, signo) .PP .B sigset(signo, action) .B sighold(signo) .B sigrelse(signo) .B sigpause(signo) .B sigsys(signo, action) .PP .B wait3(&status, options, &vt) .PP .B cc ... \-ljobs .fi .SH DESCRIPTION The facilities described here are used to support the job control implemented in .IR csh (1), and may be used in other programs to provide similar facilities. Because these facilities are not standard in UNIX and because the signal mechanisms are also slightly different, the associated routines are not in the standard C library, but rather in the \fB\-ljobs\fR library. .PP For descriptions of the individual routines see the various sections listed in \s-2SEE ALSO\s0 below. This section attempt only to place these facilities in context, not to explain the semantics of the individual calls. .PP .B "Terminal arbitration mechanisms." .PP The job control mechanism works by associating with each process a number called a .I "process group"; related processes (e.g. in a pipeline) are given the same process group. The system assigns a single process group number to each terminal. Processes running on a terminal are given read access to that terminal only if they are in the same process group as that terminal. .PP Thus a command interpreter may start several jobs running in different process groups and arbitrate access to the terminal by controlling which, if any, of these processes is in the same process group as the terminal. When a process which is not in the process group of the terminal tries to read from the terminal, all members of the process group of the process receive a SIGTTIN signal, which normally then causes them to stop until they are continued with a SIGCONT signal. (See .IR sigsys (2) for a description of these signals; .IR tty (4) for a description of process groups.) .PP If a process which is not in the process group of the terminal attempts to change the terminals mode, the process group of that process is sent a SIGTTOU signal, causing the process group to stop. A similar mechanism is (optionally) available for output, causing processes to block with SIGTTOU when they attempt to write to the terminal while not in ((its process group; this is controlled by the LTOSTOP bit in the tty mode word, enabled by \*(lqstty tostop\*(rq and disabled (the default) by \*(lqstty \-tostop.\*(rq (The LTOSTOP bit is described in .IR tty (4)). .LP .B "How the shell manipulates process groups." .PP A shell which is interactive first establishes its own process group and a process group for the terminal; this prevents other processes from being inadvertantly stopped while the terminal is under its control. The shell then assigns each job it creates a distinct process group. When a job is to be run in the foreground, the shell gives the terminal to the process group of the job using the TIOCSPGRP ioctl (See .IR ioctl (2) and .IR tty (4)). When a job stops or completes, the shell reclaims the terminal by resetting the terminals process group to that of the shell using TIOCSPGRP again. .PP Shells which are running shell scripts or running non-interactively do not manipulate process groups of jobs they create. Instead, they leave the process group of sub-processes and the terminal unchanged. This assures that if any sub-process they create blocks for terminal i/o, the shell and all its sub-processes will be blocked (since they are a single process group). The first interactive parent of the non-interactive shell can then be used to deal with the stoppage. .PP Processes which are orphans (whose parents have exited), and descendants of these processes are protected by the system from stopping, since there can be no interactive parent. Rather than blocking, reads from the control terminal return end-of-file and writes to the control terminal are permitted (i.e. LTOSTOP has no effect for these processes.) Similarly processes which ignore or hold the SIGTTIN or SIGTTOU signal are not sent these signals when accessing their control terminal; if they are not in the process group of the control terminal reads simply return end-of-file. Output and mode setting are also allowed. .PP Before a shell .I suspends itself, it places itself back in the process group in which it was created, and then sends this original group a stopping signal, stopping the shell and any other intermediate processes back to an interactive parent. The shell also restores the process group of the terminal when it finishes, as the process which then resumes would not necessarily be in control of the terminal otherwise. .PP .B "Naive processes." .PP A process which does not alter the state of the terminal, and which does no job control can invoke subprocesses normally without worry. If such a process issues a .IR system (3) call and this command is then stopped, both of the processes will stop together. Thus simple processes need not worry about job control, even if they have \*(lqshell escapes\*(rq or invoke other processes. .PP .B "Processes which modify the terminal state." .PP When first setting the terminal into an unusual mode, the process should check, with the stopping signals held, that it is in the foreground. It should then change the state of the terminal, and set the catches for SIGTTIN, SIGTTOU and SIGTSTP. The following is a sample of the code that will be needed, assuming that unit 2 is known to be a terminal. .PP .nf .ft B short tpgrp; \&... retry: sigset(SIGTSTP, SIG_HOLD); sigset(SIGTTIN, SIG_HOLD); sigset(SIGTTOU, SIG_HOLD); if (ioctl(2, TIOCGPGRP, &tpgrp) != 0) goto nottty; if (tpgrp != getpgrp(0)) { /* not in foreground */ sigset(SIGTTOU, SIG_DFL); kill(0, SIGTTOU); /* job stops here waiting for SIGCONT */ goto retry; } \fI\&...save old terminal modes and set new modes\&...\fB sigset(SIGTTIN, onstop); sigset(SIGTTOU, onstop); sigset(SIGTSTP, onstop); .ft R .fi .PP It is necessary to ignore SIGTSTP in this code because otherwise our process could be moved from the foreground to the background in the middle of checking if it is in the foreground. The process holds all the stopping signals in this critical section so no other process in our process group can mess us up by blocking us on one of these signals in the middle of our check. (This code assumes that the command interpreter will not move a process from foreground to background without stopping it; if it did we would have no way of making the check correctly.) .PP The routine which handles the signal should clear the catch for the stop signal and .IR kill (2) the processes in its process group with the same signal. The statement after this .I kill will be executed when the process is later continued with SIGCONT. .PP Thus the code for the catch routine might look like: .PP .ft B .nf \&... sigset(SIGTSTP, onstop); sigset(SIGTTIN, onstop); sigset(SIGTTOU, onstop); \&... onstop(signo) int signo; { \fI... restore old terminal state ...\fB sigset(signo, SIG_DFL); kill(0, signo); /* stop here until continued */ sigset(signo, onstop); \fI... restore our special terminal state ...\fB } .fi .ft R .PP This routine can also be used to simulate a stop signal. .PP If a process does not need to save and restore state when it is stopped, but wishes to be notified when it is continued after a stop it can catch the SIGCONT signal; the SIGCONT handler will be run when the process is continued. .PP Processes which lock data bases such as the password file should ignore SIGTTIN, SIGTTOU, and SIGTSTP signals while the data bases are being manipulated. While a process is ignoring SIGTTIN signals, reads which would normally have hung will return end-of-file; writes which would normally have caused SIGTTOU signals are instead permitted while SIGTTOU is ignored. .PP .B "Interrupt-level process handling." .PP Using the mechanisms of .IR sigset (3) it is possible to handle process state changes as they occur by providing an interrupt-handling routine for the SIGCHLD signal which occurs whenever the status of a child process changes. A signal handler for this signal is established by: .PP .RS .B "sigset(SIGCHLD, onchild);" .RE .LP The shell or other process would then await a change in child status with code of the form: .PP .nf .ft B recheck: sighold(SIGCHLD); /* start critical section */ if (\fIno children to process\fB) { sigpause(SIGCHLD); /* release SIGCHLD and pause */ goto recheck; } sigrelse(SIGCHLD); /* end critical region */ /* now have a child to process */ .fi .ft R .PP Here we are using .IR sighold to temporarily block the SIGCHLD signal during the checking of the data structures telling us whether we have a child to process. If we didn't block the signal we would have a race condition since the signal might corrupt our decision by arriving shortly after we had finished checking the condition but before we paused. .PP If we need to wait for something to happen, we call .I sigpause which automically releases the hold on the SIGCHLD signal and waits for a signal to occur by starting a .IR pause (2). Otherwise we simply release the SIGCHLD signal and process the child. .I Sigpause is similar to the PDP-11 .I wait instruction, which returns the priority of the processor to the base level and idles waiting for an interrupt. .PP It is important to note that the long-standing bug in the signal mechanism which would have lost a SIGCHLD signal which occurred while the signal was blocked has been fixed. This is because .I sighold uses the SIG_HOLD signal set of .IR sigsys (2) to prevent the signal action from being taken without losing the signal if it occurs. Similarly, a signal action set with .I sigset has the signal held while the action routine is running, much as a the interrupt priority of the processor is raised when a device interrupt is taken. .PP In this interrupt driven style of termination processing it is necessary that the .I wait calls used to retrieve status in the SIGCHLD signal handler not block. This is because a single invocation of the SIGCHLD handler may indicate an arbitrary number of process status changes: signals are not queued. This is similar to the case in a disk driver where several drives on a single controller may report status at once, while there is only one interrupt taken. It is even possible for no children to be ready to report status when the SIGCHLD handler is invoked, if the signal was posted while the SIGCHLD handler was active, and the child was noticed due to a SIGCHLD initially sent for another process. This causes no problem, since the handler will be called whenever there is work to do; the handler just has to collect all information by calling .I wait3 until it says no more information is available. Further status changes are guaranteed to be reflected in another SIGCHLD handler call. .PP .B Restarting system calls. .PP In older versions of UNIX \*(lqslow\*(rq system calls were interrupted when signals occurred, returning EINTR. The new signal mechanism .IR sigset (3) normally restarts such calls rather than interrupting them. To summarize: .I pause and .I wait return error EINTR (as before), .I ioctl and .I wait3 restart, and .I read and .I write restart unless some data was read or written in which case they return indicating how much data was read or written. In programs which use the older .IR signal (2) mechanisms, all of these calls return EINTR if a signal occurs during the call. .SH SEE ALSO csh(1), ioctl(2), killpg(2), setpgrp(2), sigsys(2), wait3(2), signal(3), tty(4) .SH BUGS The job control facilities are not available in standard version 7 UNIX. These facilities are still under development and may change in future releases of the system as better inter-process communication facilities and support for virtual terminals become available. The options and specifications of these system calls and even the calls themselves are thus subject to change. siman/man3/l3tol.3 644 0 33 1144 2512730603 6563 ((.TH L3TOL 3 .SH NAME l3tol, ltol3 \- convert between 3-byte integers and long integers .SH SYNOPSIS .nf .B l3tol(lp, cp, n) .B long *lp; .B char *cp; .PP .B ltol3(cp, lp, n) .B char *cp; .B long *lp; .fi .SH DESCRIPTION .I L3tol converts a list of .I n three-byte integers packed into a character string pointed to by .I cp into a list of long integers pointed to by .IR lp . .PP .I Ltol3 performs the reverse conversion from long integers .RI ( lp ) to three-byte integers .RI ( cp ). .PP These functions are useful for file-system maintenance where the i-numbers are three bytes long. .SH SEE ALSO filsys(5) .nf .B l3tol(lp, cp, n) .B long *lp; .B char *cp; .PP .B ltol3(cp, lp, n) .B char *cp; .B long *lp; .fi .SH DESCRIPTION .I L3tol converts a list of .I n three-byte integers packed into a character string pointed to by .I cp into a list of long integers pointed to by .IR lp . .PP .I Ltol3 performs the reverse conversion from long integers .RI ( lp ) to three-byte integers .RI ( cp ). .PP These functions are man/man3/malloc.3 644 0 33 5024 2512730603 6776 .TH MALLOC 3 .UC 4 .SH NAME malloc, free, realloc, calloc \- main memory allocator .SH SYNOPSIS .nf .B char *malloc(size) .B unsigned size; .PP .B free(ptr) .B char *ptr; .PP .B char *realloc(ptr, size) .B char *ptr; .B unsigned size; .PP .B char *calloc(nelem, elsize) .B unsigned nelem, elsize; .fi .SH DESCRIPTION .I Malloc and .I free provide a simple general-purpose memory allocation package. .I Malloc returns a pointer to a block of at least .I size bytes beginning on a word boundary. .PP The argument to .I free is a pointer to a block previously allocated by .IR malloc ; this space is made available for further allocation, but its contents are left undisturbed. .PP Needless to say, grave disorder will result if the space assigned by .I malloc is overrun or if some random number is handed to .IR free . .PP .I Malloc allocates the first big enough contiguous reach of free space found in a circular search from the last block allocated or freed, coalescing adjacent free blocks as it searches. It calls .I sbrk (see .IR break (2)) to get more memory from the system when there is no suitable space already free. .PP .I Realloc changes the size of the block pointed to by .I ptr to .I size bytes and returns a pointer to the (possibly moved) block. The contents will be unchanged up to the lesser of the new and old sizes. .PP .I Realloc also works if .I ptr points to a block freed since the last call of .I malloc, realloc or .IR calloc ; thus sequences of .I free, malloc and .I realloc can exploit the search strategy of .I malloc to do storage compaction. .PP .I Calloc allocates space for an array of .I nelem elements of size .I elsize. The space is initialized to zeros. .PP Each of the allocation routines returns a pointer to space suitably aligned (after possible pointer coercion) for storage of any type of object. .SH DIAGNOSTICS .I Malloc, realloc and .I calloc return a null pointer (0) if there is no available memory or if the arena has been detectably corrupted by storing outside the bounds of a block. .I Malloc may be recompiled to check the arena very stringently on every transaction; see the source code. .SH BUGS When .I realloc returns 0, the block pointed to by .I ptr may be destroyed. .PP The current incarnation of the allocator is unsuitable for direct use in a large virtual environment where many small blocks are to be kept, since it keeps all allocated and freed blocks on a single circular list. Just before more memory is allocated, all allocated and freed blocks are referenced; this can cause a huge number of page faults. o check the arena very stringently on every transaction; see the source code. .SH BUGS When .I realloc returns 0, the block pointed to by .I ptr may be destroyed. .PP The current incarnation of the allocator is unsuitable for direct use in a large virtual environment where many small blocks are to be kept, since it keeps all allocated and freed blocks on a single circular list. Just before more memory is allocated, all allocated and freed blocks are referenced; this can cause a huge numman/man3/mktemp.3 644 0 33 614 2512730603 7004 .TH MKTEMP 3 .SH NAME mktemp \- make a unique file name .SH SYNOPSIS .nf .B char *mktemp(template) .B char *template; .fi .SH DESCRIPTION .I Mktemp replaces .I template by a unique file name, and returns the address of the template. The template should look like a file name with six trailing X's, which will be replaced with the current process id and a unique letter. .SH "SEE ALSO" getpid(2) ist. Just before more m/( ,( 5 Ċ /\@,\D"man/man3/monitor.3 644 0 33 3070 2512730603 7215 .TH MONITOR 3 .SH NAME monitor \- prepare execution profile .SH SYNOPSIS .nf .B monitor(lowpc, highpc, buffer, bufsize, nfunc) .B int (*lowpc)(), (*highpc)(); .B short buffer[]; .fi .SH DESCRIPTION An executable program created by `cc \-p' automatically includes calls for .I monitor with default parameters; .I monitor needn't be called explicitly except to gain fine control over profiling. .PP .I Monitor is an interface to .IR profil (2). .I Lowpc and .I highpc are the addresses of two functions; .I buffer is the address of a (user supplied) array of .I bufsize short integers. .I Monitor arranges to record a histogram of periodically sampled values of the program counter, and of counts of calls of certain functions, in the buffer. The lowest address sampled is that of .I lowpc and the highest is just below .IR highpc . At most .I nfunc call counts can be kept; only calls of functions compiled with the profiling option .B \-p of .IR cc (1) are recorded. For the results to be significant, especially where there are small, heavily used routines, it is suggested that the buffer be no more than a few times smaller than the range of locations sampled. .PP To profile the entire program, it is sufficient to use .PP .nf extern etext(); . . . monitor((int) 2, etext, buf, bufsize, nfunc); .fi .PP .I Etext lies just above all the program text, see .IR end (3). .PP To stop execution monitoring and write the results on the file .I mon.out, use .PP monitor(0); .LP then .IR prof (1) can be used to examine the results. .SH FILES mon.out .SH "SEE ALSO" prof(1), profil(2), cc(1) the buffer be no more than a few times smaller than the range of locations sampled. .PP To profile the entire program, it is sufficient to use .PP .nf extern etext(); . . . monitor((int) 2, etext, buf, bufsize, nfunc); .fi .PP .I Etext lies just above all the program text, see .IR end (3). .PP To stop execution monitoring and write the results on the file .I mon.out, use .PP monitor(0); .LP then .IR prof (1) can be used to examine the results. .SHman/man3/nlist.3 644 0 33 2226 2512730603 6661 .TH NLIST 3 .UC 4 .SH NAME nlist \- get entries from name list .SH SYNOPSIS .nf .B #include .B nlist(filename, nl) .B char *filename; .B struct nlist nl[]; .fi .SH DESCRIPTION .I Nlist examines the name list in the given executable output file and selectively extracts a list of values. The name list consists of an array of structures containing names, types and values. The list is terminated with a null name. Each name is looked up in the name list of the file. If the name is found, the type and value of the name are inserted in the next two fields. If the name is not found, both entries are set to 0. See .IR a.out (5) for the structure declaration. .PP This subroutine is useful for examining the system name list kept in the file .BR /vmunix . In this way programs can obtain system addresses that are up to date. .SH "SEE ALSO" a.out(5) .SH DIAGNOSTICS All type entries are set to 0 if the file cannot be found or if it is not a valid namelist. .SH BUGS On other versions of UNIX you must include rather than ; this is unfortunate, but .I can't be used on the VAX because it contains a .B union which can't be initialized. ation. .PP This subroutine is useful for examining the system name list kept in the file .BR /vmunix . In this way programs can obtain system addresses that are up to date. .SH "SEE ALSO" a.out(5) .SH DIAGNOSTICS All type entries are set to 0 if the file cannot be found or if it is not a valid namelist. .SH BUGS On other versions of UNIX you must include .PP .SM .B FILE .B *popen(command, type) .br .B char *command, *type; .PP .B pclose(stream) .br .SM .B FILE .B *stream; .SH DESCRIPTION The arguments to .I popen are pointers to null-terminated strings containing respectively a shell command line and an I/O mode, either "r" for reading or "w" for writing. It creates a pipe between the calling process and the command to be executed. The value returned is a stream pointer that can be used (as appropriate) to write to the standard input of the command or read from its standard output. .PP A stream opened by .I popen should be closed by .I pclose, which waits for the associated process to terminate and returns the exit status of the command. .PP Because open files are shared, a type "r" command may be used as an input filter, and a type "w" as an output filter. .SH "SEE ALSO" pipe(2), fopen(3), fclose(3), system(3), wait(2) .SH DIAGNOSTICS .I Popen returns a null pointer if files or processes cannot be created, or the Shell cannot be accessed. .PP .I Pclose returns \-1 if .I stream is not associated with a `popened' command. .SH BUGS Buffered reading before opening an input filter may leave the standard input of that filter mispositioned. Similar problems with an output filter may be forestalled by careful buffer flushing, e.g. with .I fflush, see .IR fclose (3). SH "SEE ALSO" pipe(2), fopen(3), fclose(3), system(3), wait(2) .SH DIAGNOSTICS .I Popen returns aman/man3/printf.3s 644 0 33 10462 2570046416 7244 .TH PRINTF 3S 4/1/81 .SH NAME printf, fprintf, sprintf \- formatted output conversion .SH SYNOPSIS .B #include .PP .B printf(format .RB [ , arg ] ... .B ) .br .B char *format; .PP .B fprintf(stream, format .RB [ , arg ] ... .B ) .br .SM .B FILE .B *stream; .br .B char *format; .PP .B sprintf(s, format .RB [ , arg ] ... .B ) .br .B char *s, format; .SH DESCRIPTION .I Printf places output on the standard output stream .IR stdout . .I Fprintf places output on the named output .IR stream . .I Sprintf places `output' in the string .I s, followed by the character `\\0'. .PP Each of these functions converts, formats, and prints its arguments after the first under control of the first argument. The first argument is a character string which contains two types of objects: plain characters, which are simply copied to the output stream, and conversion specifications, each of which causes conversion and printing of the next successive .I arg .IR printf . .PP Each conversion specification is introduced by the character .BR % . Following the .BR % , there may be .TP \- an optional minus sign `\-' which specifies .I "left adjustment" of the converted value in the indicated field; .TP \- an optional digit string specifying a .I "field width;" if the converted value has fewer characters than the field width it will be blank-padded on the left (or right, if the left-adjustment indicator has been given) to make up the field width; if the field width begins with a zero, zero-padding will be done instead of blank-padding; .TP \- an optional period .RB ` . ' which serves to separate the field width from the next digit string; .TP \- an optional digit string specifying a .I precision which specifies the number of digits to appear after the decimal point, for e- and f-conversion, or the maximum number of characters to be printed from a string; .TP \- the character .B l specifying that a following .BR d , .BR o , .BR x , or .B u corresponds to a long integer .I arg. (A capitalized conversion code accomplishes the same thing.) .TP \- a character which indicates the type of conversion to be applied. .PP A field width or precision may be `*' instead of a digit string. In this case an integer .I arg supplies the field width or precision. .PP The conversion characters and their meanings are .TP .B dox The integer .I arg is converted to decimal, octal, or hexadecimal notation respectively. .TP .B f The float or double .I arg is converted to decimal notation in the style `[\fB\-\fR]ddd.ddd' where the number of d's after the decimal point is equal to the precision specification for the argument. If the precision is missing, 6 digits are given; if the precision is explicitly 0, no digits and no decimal point are printed. .TP .B e The float or double .I arg is converted in the style `[\fB\-\fR]d\fB.\fRddd\fBe\fR\(+-dd' where there is one digit before the decimal point and the number after is equal to the precision specification for the argument; when the precision is missing, 6 digits are produced. .TP .B g The float or double .I arg is printed in style .BR d , in style .BR f , or in style .BR e , whichever gives full precision in minimum space. .TP .B c The character .I arg is printed. .TP .B s .I Arg is taken to be a string (character pointer) and characters from the string are printed until a null character or until the number of characters indicated by the precision specification is reached; however if the precision is 0 or missing all characters up to a null are printed. .TP .B u The unsigned integer .I arg is converted to decimal and pr((inted (the result will be in the range 0 through MAXUINT, where MAXUINT equals 4294967295 on a VAX-11 and 65535 on a PDP-11). .TP .B % Print a `%'; no argument is converted. .PP In no case does a non-existent or small field width cause truncation of a field; padding takes place only if the specified field width exceeds the actual width. Characters generated by .I printf are printed by .IR putc (3). .PP .B Examples .br To print a date and time in the form `Sunday, July 3, 10:02', where .I weekday and .I month are pointers to null-terminated strings: .RS .HP .nh printf("%s, %s %d, %02d:%02d", weekday, month, day, hour, min); .RE .hy .PP To print .if n pi .if t \(*p to 5 decimals: .IP printf("pi = %.5f", 4*atan(1.0)); .SH "SEE ALSO" putc(3), scanf(3), ecvt(3) .SH BUGS Very wide fields (>128 characters) fail. width exceeds the actual width. Characters generated by .I printf are printed by .IR putc (3). .PP .B Examples .br To print a date and time in the form `Sunday, July 3, 10:02', where .I weekday and .I monman/man3/putc.3s 644 0 33 3505 2512730604 6670 .TH PUTC 3S .SH NAME putc, putchar, fputc, putw \- put character or word on a stream .SH SYNOPSIS .B #include .PP .B int putc(c, stream) .br .B char c; .br .SM .B FILE .B *stream; .PP .B putchar(c) .PP .B fputc(c, stream) .br .SM .B FILE .B *stream; .PP .B putw(w, stream) .br .SM .B FILE .B *stream; .SH DESCRIPTION .I Putc appends the character .I c to the named output .IR stream . It returns the character written. .PP .I Putchar(c) is defined as .I "putc(c, stdout)." .PP .I Fputc behaves like .I putc, but is a genuine function rather than a macro. It may be used to save on object text. .PP .I Putw appends word (i.e. .BR int ) .I w to the output .IR stream . It returns the word written. .I Putw neither assumes nor causes special alignment in the file. .PP The standard stream .I stdout is normally buffered if and only if the output does not refer to a terminal; this default may be changed by .IR setbuf (3). The standard stream .I stderr is by default unbuffered unconditionally, but use of .I freopen (see .IR fopen (3)) will cause it to become buffered; .IR setbuf , again, will set the state to whatever is desired. When an output stream is unbuffered information appears on the destination file or terminal as soon as written; when it is buffered many characters are saved up and written as a block. .I Fflush (see .IR fclose (3)) may be used to force the block out early. .SH "SEE ALSO" fopen(3), fclose(3), getc(3), puts(3), printf(3), fread(3) .SH DIAGNOSTICS These functions return the constant .SM .B EOF upon error. Since this is a good integer, .IR ferror (3) should be used to detect .I putw errors. .SH BUGS Because it is implemented as a macro, .I putc treats a .I stream argument with side effects improperly. In particular `putc(c, *f++);' doesn't work sensibly. .PP Errors can occur long after the call to .I putc. fclose (3)) may be used to force the block out early. .SH "SEE ALSO" fopen(3), fclose(3), getc(3), puts(3), printf(3), fread(3) .SH DIAGNOSTICS These functions return the constant .SM .Bman/man3/puts.3s 644 0 33 1226 2512730604 6706 .TH PUTS 3S .SH NAME puts, fputs \- put a string on a stream .SH SYNOPSIS .B #include .PP .B puts(s) .br .B char *s; .PP .B fputs(s, stream) .br .B char *s; .br .SM .B FILE .B *stream; .SH DESCRIPTION .I Puts copies the null-terminated string .I s to the standard output stream .I stdout and appends a newline character. .PP .I Fputs copies the null-terminated string .I s to the named output .IR stream . .PP Neither routine copies the terminal null character. .SH "SEE ALSO" fopen(3), gets(3), putc(3), printf(3), ferror(3) .br fread(3) for .I fwrite .SH BUGS .I Puts appends a newline, .I fputs does not, all in the name of backward compatibility. ) .br .B char *s; .br .SM .B FILE .B *stream; .SH DESCRIPTION .I Puts copies the null-terminated string .I s to the standard output stream .I stdout and appends a newline character. .PP .I Fputs copies the null-terminated string .I s to the named output .IR stream . .PP Neither routine copies the terminal null character. .SH "SEE ALSO" fopen(3), gets(3), putc(man/man3/qsort.3 644 0 33 1252 2512730604 6677 .TH QSORT 3 .SH NAME qsort \- quicker sort .SH SYNOPSIS .nf .B qsort(base, nel, width, compar) .B char *base; .B int (*compar)(); .fi .SH DESCRIPTION .I Qsort is an implementation of the quicker-sort algorithm. The first argument is a pointer to the base of the data; the second is the number of elements; the third is the width of an element in bytes; the last is the name of the comparison routine to be called with two arguments which are pointers to the elements being compared. The routine must return an integer less than, equal to, or greater than 0 according as the first argument is to be considered less than, equal to, or greater than the second. .SH "SEE ALSO" sort(1) ementation of the quicker-sort algorithm. The first argument is a pointer to the base of the data; the second is the number of elements; the third is the width of an element in bytes; the last is the name of the comparison routine to be called with two arguments which are pointers to the elements being compared. The routine must return an iman/man3/rand.3 644 0 33 757 2512730604 6444 .TH RAND 3 VAX-11 .SH NAME rand, srand \- random number generator .SH SYNOPSIS .nf .B srand(seed) .B int seed; .PP .B rand() .fi .SH DESCRIPTION .I Rand uses a multiplicative congruential random number generator with period 2\u\s732\s0\d to return successive pseudo-random numbers in the range from 0 to 2\u\s731\s10\d\-1. .PP The generator is reinitialized by calling .I srand with 1 as argument. It can be set to a random starting point by calling .I srand with whatever you like as argument. ,\D"man/man3/regex.3 644 0 33 2563 2512730604 6647 .TH REGEX 3 2/29/80 .UC .SH NAME re_comp, re_exec \- regular expression handler .SH SYNOPSIS .nf .B char *re_comp(s) .B char *s; .PP .B re_exec(s) .B char *s; .fi .SH DESCRIPTION .I Re_comp compiles a string into an internal form suitable for pattern matching. .I Re_exec checks the argument string against the last string passed to .I re_comp. .PP .I Re_comp returns 0 if the string .I s was compiled successfully; otherwise a string containing an error message is returned. If .I re_comp is passed 0 or a null string, it returns without changing the currently compiled regular expression. .PP .I Re_exec returns 1 if the string .I s matches the last compiled regular expression, 0 if the string .I s failed to match the last compiled regular expression, and -1 if the compiled regular expression was invalid (indicating an internal error). .PP The strings passed to both .I re_comp and .I re_exec may have trailing or embedded newline characters; they are terminated by nulls. The regular expressions recognized are described in the manual entry for .I ed (1), given the above difference. .SH "SEE ALSO" ed(1), ex(1) .SH DIAGNOSTICS .I Re_exec returns -1 for an internal error. .PP .I Re_comp returns one of the following strings if an error occurs: "No previous regular expression", "Regular expression too long", "unmatched \e(", "missing ]", "too many \e(\e) pairs", "unmatched \e)". comp and .I re_exec may have trailing or embedded newline characters; they are terminated by nulls. The regular expressions recognized are dman/man3/scanf.3s 644 0 33 12752 2512730605 7034 ((.TH SCANF 3S .SH NAME scanf, fscanf, sscanf \- formatted input conversion .SH SYNOPSIS .B #include .PP .B scanf(format [ , pointer ] . . . .B ) .br .B char *format; .PP .B fscanf(stream, format [ , pointer ] . . . .B ) .br .SM .B FILE .B *stream; .br .B char *format; .PP .B sscanf(s, format [ , pointer ] . . . .B ) .br .B char *s, *format; .SH DESCRIPTION .I Scanf reads from the standard input stream .IR stdin . .I Fscanf reads from the named input .IR stream . .I Sscanf reads from the character string .IR s . Each function reads characters, interprets them according to a format, and stores the results in its arguments. Each expects as arguments a control string .I format, described below, and a set of .I pointer arguments indicating where the converted input should be stored. .PP The control string usually contains conversion specifications, which are used to direct interpretation of input sequences. The control string may contain: .TP 4 1. Blanks, tabs or newlines, which match optional white space in the input. .TP 4 2. An ordinary character (not %) which must match the next character of the input stream. .TP 4 3. Conversion specifications, consisting of the character .BR % , an optional assignment suppressing character .BR * , an optional numerical maximum field width, and a conversion character. .PP A conversion specification directs the conversion of the next input field; the result is placed in the variable pointed to by the corresponding argument, unless assignment suppression was indicated by .BR * . An input field is defined as a string of non-space characters; it extends to the next inappropriate character or until the field width, if specified, is exhausted. .PP The conversion character indicates the interpretation of the input field; the corresponding pointer argument must usually be of a restricted type. The following conversion characters are legal: .TP 4 .B % a single `%' is expected in the input at this point; no assignment is done. .TP 4 .B d a decimal integer is expected; the corresponding argument should be an integer pointer. .TP 4 .B o an octal integer is expected; the corresponding argument should be a integer pointer. .TP 4 .B x a hexadecimal integer is expected; the corresponding argument should be an integer pointer. .ti -0.2i .TP 4 .B s a character string is expected; the corresponding argument should be a character pointer pointing to an array of characters large enough to accept the string and a terminating `\e0', which will be added. The input field is terminated by a space character or a newline. .TP 4 .B c a character is expected; the corresponding argument should be a character pointer. The normal skip over space characters is suppressed in this case; to read the next non-space character, try `%1s'. If a field width is given, the corresponding argument should refer to a character array, and the indicated number of characters is read. .TP 4 \z\fBe\v'1'f\v'-1'\fR a floating point number is expected; the next field is converted accordingly and stored through the corresponding argument, which should be a pointer to a .IR float . The input format for floating point numbers is an optionally signed string of digits possibly containing a decimal point, followed by an optional exponent field consisting of an E or e followed by an optionally signed integer. .TP 4 .B [ indicates a string not to be delimited by space characters. The left bracket is followed by a set of characters and a right bracket; the characters between the brackets define a set of characters making up the string. If the first character is not circumflex (\|^\|), the input field is all characters until the first character not in the set between the brackets; if the first character after the left bracket is ^, the input field is all characters until the first character which is in the remaining set of characters between the brackets. The corresponding argument must point to a character array. .PP The conversion characters .BR d , .B o and .B x may be capitalized or preceeded by .B l to indicate that a pointer to .B long rather than to .B int is in the argument list. Similarly, the conversion characters .B e or .B f may be capitalized or preceded by .B l to indicate a pointer to .B double rather than to .BR float . The conversion characters .BR d , .B o and .B x may be preceeded by .B h to indicate a pointer to .B short rather than to .BR int . .PP The .I scanf functions return the number of successfully matched and assigned input items. This can be used to decide how many input items were found. The constant .SM .B EOF is returned upon end of input; note that this is different from 0, which means that no conversion was done; if conversion was intended, it was frustrated by an inappropriate character in the input. .PP For example, the call .IP "" 10 int i; float x; char name[50]; .br scanf("%d%f%s", &i, &x, name); .PP with the input line .IP 25 54.32E\(mi1 thompson .PP will assign to .I i the value 25, .I x the value 5.432, and .I name will contain .IR `thompson\e0' . Or, .IP int i; float x; char name[50]; .br scanf("%2d%f%*d%[1234567890]", &i, &x, name); .PP with input .IP 56789 0123 56a72 .PP will assign 56 to .I i, 789.0 to .I x, skip `0123', and place the string `56\e0' in .IR name . The next call to .I getchar will return `a'. .SH "SEE ALSO" atof(3), getc(3), printf(3) .SH DIAGNOSTICS The .I scanf functions return .SM .B EOF on end of input, and a short count for missing or illegal data items. .SH BUGS The success of literal matches and suppressed assignments is not directly determinable. har name[50]; .br scanman/man3/setbuf.3s 644 0 33 2120 2512730605 7176 .TH SETBUF 3S .UC 4 .SH NAME setbuf \- assign buffering to a stream .SH SYNOPSIS .B #include .PP .B setbuf(stream, buf) .br .SM .B FILE .B *stream; .br .B char *buf; .SH DESCRIPTION .I Setbuf is used after a stream has been opened but before it is read or written. It causes the character array .I buf to be used instead of an automatically allocated buffer. If .I buf is the constant pointer .SM .B NULL, input/output will be completely unbuffered. .PP A manifest constant .SM .B BUFSIZ tells how big an array is needed: .IP .B char buf[BUFSIZ]; .PP A buffer is normally obtained from .IR malloc (3) upon the first .I getc or .IR putc (3) on the file, except that the standard output is line buffered when directed to a terminal. Other output streams directed to terminals, and the standard error stream .I stderr are normally not buffered. If the standard output is line buffered, then it is flushed each time data is read from the standard input by .IR read (2). .SH "SEE ALSO" fopen(3), getc(3), putc(3), malloc(3) .SH BUGS The standard error stream should be line buffered by default. from .IR malloc (3) upon the first .I getc or .IR putc (3) on the file, except that the standard output is line buffered when directed to a terminal. Other output streams directed to terminals, and the standard error stream .I stderr are normally not buffered. If the standard output is line buffered, then it is flushed each time data is read from the standard input by .IR read (2). .SH "SEE ALSO" fopen(3), getc(3), putc(3), mman/man3/setjmp.3 644 0 33 1435 2512730605 7035 .TH SETJMP 3 .SH NAME setjmp, longjmp \- non-local goto .SH SYNOPSIS .nf .B #include .PP .B setjmp(env) .B jmp_buf env; .PP .B longjmp(env, val) .B jmp_buf env; .fi .SH DESCRIPTION These routines are useful for dealing with errors and interrupts encountered in a low-level subroutine of a program. .PP .I Setjmp saves its stack environment in .I env for later use by .I longjmp. It returns value 0. .PP .I Longjmp restores the environment saved by the last call of .IR setjmp . It then returns in such a way that execution continues as if the call of .I setjmp had just returned the value .I val to the function that invoked .I setjmp, which must not itself have returned in the interim. All accessible data have values as of the time .I longjmp was called. .SH "SEE ALSO" signal(2) subroutine of a program. .PP .I Setjmp saves its stack environment in .I env for later use by .I longjmp. It returns value 0. .PP .I Longjmp restores the environment saved by the last call of .IR setjmp . It then returns in suman/man3/signal.3 664 0 33 33 2512730605 6743 .so /usr/man/man3/sigset.3 tinues as if the call of .I setjmp had just returned the value .I val to the function that invoked .I setjmp, which must not itself have returned in the interim. All accessible data have values as of the time .I longjmp was called. .SH "SEE ALSO" signal(2) subroutine of a program. .PP .I Setjmp saves its stack environment in .I env for later use by .I longjmp. It returns value 0. .PP .I L/( ,( 5Ċ /\@,\D"((man/man3/sigset.3 644 0 33 6157 2512730605 7037 .TH SIGSET 3 .UC 4 .SH NAME sigset, signal, sighold, sigignore, sigrelse, sigpause \- manage signals .SH SYNOPSIS .nf .B #include .B void action(); .B int sig; .PP .B sigset(sig, action) .B signal(sig, action) .PP .B sighold(sig) .B sigignore(sig) .B sigrelse(sig) .PP .B sigpause(sig) .PP .fi .B cc ... \-ljobs .nf .SH DESCRIPTION This is a package of signal management functions to manage the signals as described in .IR sigsys (2). These functions are available only in this version of UNIX, and should not be used when the mechanisms of .IR signal (2) would suffice, as they would then impair portability. These functions are contained in the \fIjobs\fR library, obtained by specifying the loader option \fB\-ljobs\fR. .PP .I Sigset is used to provide a default signal handler for signal .I sig. This function is remembered across subsequent calls to the other functions, and need not be specified again. After .I sigset instances of .I sig will cause an interrupt to be taken at .I func, with the signal then held so that recursive trapping due to the signal will not occur. During normal return from .I func, the routines arrange for the signal action to be restored so that subsequent signals will also trap to .I func. If a non-local exit is to be taken, then .I sigrelse must be called to un-hold the signal action, restoring the original catch. .I Func may also be specified as SIG_DFL, SIG_IGN or SIG_HOLD, as described in .IR sigsys (2). The value specified on the previous call to .I sigset is returned; if .I sigset has never been called, then the default action inherited from the system is returned. .PP .I Signal is like .I sigset, but the signal will not be held when the action routine is called; rather it will have reverted to SIG_DFL. This is generally unsafe, but is included for backwards compatibility to the old signal mechanism. It should not be used. .PP .I Sighold and .I sigrelse may be used to block off .I sig in a piece of code where it cannot be tolerated. After .I sigrelse the catch initially set with .I sigset will be restored. .PP .I Sigignore can be used to temporarily set the action for .I sig to ignore the signal. If the signal had been held before the call to .I sigignore, any pending instance of the signal will be discarded. .PP .I Sigpause may be used by a routine which wishes to check for some condition produced at interrupt level by the .I sig signal, and then to pause waiting for the condition to arise with the catch of the signal enabled. In correct usage it must be preceded by an instance of .I sighold to block the signal. .I Sigpause is like .I pause in that it will return after .I any signal is processed. The usual thing to do then is to reenable the hold with .I sighold, check the condition again, and .I sigpause again if the condition has not arisen. .SH "SEE ALSO" sigsys(2), signal(2), jobs(3), tty(4) .SH BUGS .I Sighold and .I sigrelse do not nest; the first .I sigrelse restores the default catch. .PP These functions store information in data space. You thus .B must call .IR sigsys (2) rather than any of .I sigset or .I signal after a .IR vfork (2) in the child which is to then .IR exec (2). processed. The usual thing to do then is to reenable the hold with .I sighold, check the condition again, and .I sigpause again if the condition has not arisen. .SH "SEE ALSO" sigsys(2), signal(2), jobs(3), tty(4) .SH BUGS .I Sighold and .I sigrelse do not nest; the first .I sigrelse restores the default catch. .PP These functions store information in data space. You thus .B must call .IR sigsys (man/man3/sin.3m 644 0 33 2125 2512730605 6476 .TH SIN 3M .SH NAME sin, cos, tan, asin, acos, atan, atan2 \- trigonometric functions .SH SYNOPSIS .nf .B #include .PP .B double sin(x) .B double x; .PP .B double cos(x) .B double x; .PP .B double asin(x) .B double x; .PP .B double acos(x) .B double x; .PP .B double atan(x) .B double x; .PP .B double atan2(x, y) .B double x, y; .fi .SH DESCRIPTION .I Sin, cos and .I tan return trigonometric functions of radian arguments. The magnitude of the argument should be checked by the caller to make sure the result is meaningful. .PP .I Asin returns the arc sin in the range \-\(*p/2 to \(*p/2. .PP .I Acos returns the arc cosine in the range 0 to \(*p. .PP .I Atan returns the arc tangent of .I x in the range \-\(*p/2 to \(*p/2. .PP .I Atan2 returns the arc tangent of .I x/y in the range \-\(*p to \(*p. .SH DIAGNOSTICS Arguments of magnitude greater than 1 cause .I asin and .I acos to return value 0; .I errno is set to EDOM. The value of .I tan at its singular points is a huge number, and .I errno is set to ERANGE. .SH BUGS The value of .I tan for arguments greater than about 2**31 is garbage. /2. .PP .I Acos returns the arc cosine in the range 0 to \(*p. .PP .I Atan returns the arc tangent of .I x in the range \-\(*p/2 to \(*p/2. .PP .I Atan2 returns the arc tangent of .I x/y in the range \-\(*p to \(*p. .SH DIAGNOSTICS Arguments of magnitude greater than 1 cause .I asin and .I acos to return value 0; .I errno is set to EDOM. The value of .I tan at its singular points is a huge number, and .I errno is set to ERAman/man3/sinh.3m 644 0 33 627 2512730606 6634 .TH SINH 3M .SH NAME sinh, cosh, tanh \- hyperbolic functions .SH SYNOPSIS .nf .B #include .PP .B double sinh(x) .PP .B double cosh(x) .B double x; .PP .B double tanh(x) .B double x; .fi .SH DESCRIPTION These functions compute the designated hyperbolic functions for real arguments. .SH DIAGNOSTICS .I Sinh and .I cosh return a huge value of appropriate sign when the correct value would overflow. o is set to E/( ,( 5@Ċ /\@,\D"man/man3/sleep.3 644 0 33 1424 2512730606 6642 .TH SLEEP 3 .SH NAME sleep \- suspend execution for interval .SH SYNOPSIS .nf .B sleep(seconds) .B unsigned seconds; .fi .SH DESCRIPTION The current process is suspended from execution for the number of seconds specified by the argument. The actual suspension time may be up to 1 second less than that requested, because scheduled wakeups occur at fixed 1-second intervals, and an arbitrary amount longer because of other activity in the system. .PP The routine is implemented by setting an alarm clock signal and pausing until it occurs. The previous state of this signal is saved and restored. If the sleep time exceeds the time to the alarm signal, the process sleeps only until the signal would have occurred, and the signal is sent 1 second later. .SH "SEE ALSO" alarm(2), pause(2) to 1 second less than that requested, because scheduled wakeups occur at fixed 1-second intervals, and an arbitrary amount longer because of other activity in the system. .PP The routine is implemented by setting an alarm clock signal aman/man3/stdio.3s 644 0 33 5243 2512730606 7042 .TH STDIO 3S .UC 4 .SH NAME stdio \- standard buffered input/output package .SH SYNOPSIS .B #include .PP .SM .B FILE .B *stdin; .br .SM .B FILE .B *stdout; .br .SM .B FILE .B *stderr; .SH DESCRIPTION The functions described in Sections 3S constitute an efficient user-level buffering scheme. The in-line macros .I getc and .IR putc (3) handle characters quickly. The higher level routines .I "gets, fgets, scanf, fscanf, fread," .I "puts, fputs, printf, fprintf, fwrite" all use .I getc and .I putc; they can be freely intermixed. .PP A file with associated buffering is called a .I stream, and is declared to be a pointer to a defined type .SM .B FILE. .IR Fopen (3) creates certain descriptive data for a stream and returns a pointer to designate the stream in all further transactions. There are three normally open streams with constant pointers declared in the include file and associated with the standard open files: .TP 10n .BR stdin standard input file .br .ns .TP .B stdout standard output file .br .n((s .TP .BR stderr standard error file .PP A constant `pointer' .SM .B NULL (0) designates no stream at all. .PP An integer constant .SM .B EOF (\-1) is returned upon end of file or error by integer functions that deal with streams. .PP Any routine that uses the standard input/output package must include the header file of pertinent macro definitions. The functions and constants mentioned in sections labeled 3S are declared in the include file and need no further declaration. The constants, and the following `functions' are implemented as macros; redeclaration of these names is perilous: .I getc, .I getchar, .I putc, .I putchar, .I feof, .I ferror, .IR fileno . .SH "SEE ALSO" open(2), close(2), read(2), write(2) .SH DIAGNOSTICS The value .SM .B EOF is returned uniformly to indicate that a .SM .B FILE pointer has not been initialized with .I fopen, input (output) has been attempted on an output (input) stream, or a .SM .B FILE pointer designates corrupt or otherwise unintelligible .SM .B FILE data. .PP For purposes of efficiency, this implementation of the standard library has been changed to line buffer output to a terminal by default and attempts to do this transparently by flushing the output whenever a .IR read (2) from the standard input is necessary. This is almost always transparent, but may cause confusion or malfunctioning of programs which use standard i/o routines but use .IR read (2) themselves to read from the standard input. .PP In cases where a large amount of computation is done after printing part of a line on an output terminal, it is necessary to .IR fflush (3) the standard output before going off and computing so that the output will appear. ansparently by flushing the output whenever a .IR read (2) from the standard input is necessary. This is almost always transparent, but may cause confusion or malfunctioning of programs which use standard i/o routines but use .IR read (2) themselves to read from the standard input. .PP In cases where a large amount of computation is done after pman/man3/string.3 644 0 33 3237 2512730606 7044 .TH STRING 3 .SH NAME strcat, strncat, strcmp, strncmp, strcpy, strncpy, strlen, index, rindex \- string operations .SH SYNOPSIS .nf .B char *strcat(s1, s2) .B char *s1, *s2; .PP .B char *strncat(s1, s2, n) .B char *s1, *s2; .PP .B strcmp(s1, s2) .B char *s1, *s2; .PP .B strncmp(s1, s2, n) .B char *s1, *s2; .PP .B char *strcpy(s1, s2) .B char *s1, *s2; .PP .B char *strncpy(s1, s2, n) .B char *s1, *s2; .PP .B strlen(s) .B char *s; .PP .B char *index(s, c) .B char *s, c; .PP .B char *rindex(s, c) .B char *s, c; .fi .SH DESCRIPTION These functions operate on null-terminated strings. They do not check for overflow of any receiving string. .PP .I Strcat appends a copy of string .I s2 to the end of string .IR s1 . .I Strncat copies at most .I n characters. Both return a pointer to the null-terminated result. .PP .I Strcmp compares its arguments and returns an integer greater than, equal to, or less than 0, according as .I s1 is lexicographically greater than, equal to, or less than .IR s2 . .I Strncmp makes the same comparison but looks at at most .I n characters. .PP .I Strcpy copies string .I s2 to .I s1, stopping after the null character has been moved. .I Strncpy copies exactly .I n characters, truncating or null-padding .I s2; the target may not be null-terminated if the length of .I s2 is .I n or more. Both return .IR s1 . .PP .I Strlen returns the number of non-null characters in .IR s . .PP .I Index .RI ( rindex ) returns a pointer to the first (last) occurrence of character .I c in string .I s, or zero if .I c does not occur in the string. .SH BUGS .I Strcmp uses native character comparison, which is signed on PDP11's and VAX-11's, unsigned on other machines. pies exactly .I n characters, truncating or null-padding .I s2; the target may not be null-terminated if the length of .I s2 is .I n or more. Both return .IR s1 . .PP .I Strlen returns the number of non-null characters in .IR s . .PP .I Index .RI ( rindex ) returns a pointer to the first (last) occurrence of character .I c in string .I s, or zero if man/man3/swab.3 644 0 33 541 2512730606 6445 .TH SWAB 3 .SH NAME swab \- swap bytes .SH SYNOPSIS .nf .B swab(from, to, nbytes) .B char *from, *to; .fi .SH DESCRIPTION .I Swab copies .I nbytes bytes pointed to by .I from to the position pointed to by .I to, exchanging adjacent even and odd bytes. It is useful for carrying binary data between PDP11's and other machines. .I Nbytes should be even. r of non-null characters in .IR s . .PP .I Index .RI ( rindex ) ret/( ,( 5Ċ /\@,\D"man/man3/system.3 644 0 33 725 2512730606 7041 .TH SYSTEM 3 .SH NAME system \- issue a shell command .SH SYNOPSIS .nf .B system(string) .B char *string; .fi .SH DESCRIPTION .I System causes the .I string to be given to .IR sh (1) as input as if the string had been typed as a command at a terminal. The current process waits until the shell has completed, then returns the exit status of the shell. .SH "SEE ALSO" popen(3), exec(2), wait(2) .SH DIAGNOSTICS Exit status 127 indicates the shell couldn't be executed. /\@,\D"man/man3/termcap.3 644 0 33 6522 2512730607 7172 .TH TERMCAP 3 .UC 4 .SH NAME tgetent, tgetnum, tgetflag, tgetstr, tgoto, tputs \- terminal independent operation routines .SH SYNOPSIS .nf .B char PC; .B char *BC; .B char *UP; .B short ospeed; .PP .B tgetent(bp, name) .B char *bp, *name; .PP .B tgetnum(id) .B char *id; .PP .B tgetflag(id) .B char *id; .PP .B char * .B tgetstr(id, area) .B char *id, **area; .PP .B char * .B tgoto(cm, destcol, destline) .B char *cm; .PP .B tputs(cp, affcnt, outc) .B register char *cp; .B int affcnt; .B int (*outc)(); .fi .SH DESCRIPTION These functions extract and use capabilities from the terminal capability data base .IR termcap (5). These are low level routines; see .IR curses (3) for a higher level package. .PP .I Tgetent extracts the entry for terminal .I name into the buffer at .I bp. .I Bp should be a character buffer of size 1024 and must be retained through all subsequent calls to .I tgetnum, .I tgetflag, and .I tgetstr. .I Tgetent returns \-1 if it cannot open the .I termcap file, 0 if the terminal name given does not have an entry, and 1 if all goes well. It will look in the environment for a TERMCAP variable. If found, and the value does not begin with a slash, and the terminal type .B name is the same as the environment string TERM, the TERMCAP string is used instead of reading the termcap file. If it does begin with a slash, the string is used as a path name rather than .I /etc/termcap. This can speed up entry into programs that call .IR tgetent , as well as to help debug new terminal descriptions or to make one for your terminal if you can't write the file .I /etc/termcap. .PP .I Tgetnum gets the numeric value of capability .I id, returning \-1 if is not given for the terminal. .I Tgetflag returns 1 if the specified capability is present in the terminal's entry, 0 if it is not. .I Tgetstr gets the string value of capability .I id, placing it in the buffer at .I area, advancing the .I area pointer. It decodes the abbreviations for this field described in .IR termcap (5), except for cursor addressing and padding information. .PP .I Tgoto returns a cursor addressing string decoded from .I cm to go to column .I destcol in line .I destline. It uses the external variables .B UP (from the \fBup\fR capability) and .B BC (if \fBbc\fR is given rather than \fBbs\fR) if necessary to avoid placing \fB\en\fR, \fB^D\fR or \fB^@\fR in the returned string. (Programs which call tgoto should be sure to turn off the XTABS bit(s), since tgoto may now output a tab. Note that programs using termcap should in general turn off XTABS anyway since some terminals use control I for other functions, such as nondestructive space.) If a \fB%\fR sequence is given which is not understood, then .I tgoto returns \*(lqOOPS\*(rq. .PP .I Tputs decodes the leading padding information of the string .I cp; .I affcnt gives the number of lines affected by the operation, or 1 if this is not applicable, .I outc is a routine which is called with each character in turn. The external variable .I ospeed should contain the output speed of the terminal as encoded by .I s((tty (2). The external variable .B PC should contain a pad character to be used (from the \fBpc\fR capability) if a null (\fB^@\fR) is inappropriate. .SH FILES .ta \w'/usr/lib/libtermcap.a 'u /usr/lib/libtermcap.a \-ltermcap library .br /etc/termcap data base .DT .SH SEE ALSO ex(1), curses(3), termcap(5) .SH AUTHOR William Joy .SH BUGS plicable, .I outc is a routine which is called with each character in turn. The external variable .I ospeed should contain the output speed of the terminal as encoded by .I sman/man3/termlib.3 644 0 33 117 2512730607 7147 .pl 1 The ``termlib'' library is now named ``termcap''. See ``man 3 termcap''. (from the \fBpc\fR capability) if a null (\fB^@\fR) is inappropriate. .SH FILES .ta \w'/usr/lib/libtermcap.a 'u /usr/lib/libtermcap.a \-ltermcap library .br /etc/termcap data base .DT .SH SEE ALSO ex(1), curses(3), termcap(5) .SH AUTHOR William Joy .SH BUGS plicable, .I outc is a routine which is called with each character in turn. The ex/( ,( 5Ċ /\@,\D"man/man3/ttyname.3 644 0 33 1574 2512730607 7222 .TH TTYNAME 3 .SH NAME ttyname, isatty, ttyslot \- find name of a terminal .SH SYNOPSIS .B char *ttyname(fildes) .PP .B isatty(fildes) .PP .B ttyslot() .SH DESCRIPTION .I Ttyname returns a pointer to the null-terminated path name of the terminal device associated with file descriptor .IR fildes . .PP .I Isatty returns 1 if .I fildes is associated with a terminal device, 0 otherwise. .PP .I Ttyslot returns the number of the entry in the .IR ttys (5) file for the control terminal of the current process. .SH FILES /dev/\(** .br /etc/ttys .SH SEE ALSO ioctl(2), ttys(5) .SH DIAGNOSTICS .I Ttyname returns a null pointer (0) if .I fildes does not describe a terminal device in directory `/dev'. .PP .I Ttyslot returns 0 if `/etc/ttys' is inaccessible or if it cannot determine the control terminal. .SH BUGS The return value points to static data whose content is overwritten by each call. rwise. .PP .I Ttyslot returns the number of the entry in the .IR ttys (5) file for the control terminal of the current process. .SH man/man3/ungetc.3s 644 0 33 1263 2512730607 7204 .TH UNGETC 3S .SH NAME ungetc \- push character back into input stream .SH SYNOPSIS .B #include .PP .B ungetc(c, stream) .br .SM .B FILE .B *stream; .SH DESCRIPTION .I Ungetc pushes the character .I c back on an input stream. That character will be returned by the next .I getc call on that stream. .I Ungetc returns .IR c . .PP One character of pushback is guaranteed provided something has been read from the stream and the stream is actually buffered. Attempts to push EOF are rejected. .PP .IR Fseek (3) erases all memory of pushed back characters. .SH "SEE ALSO" getc(3), setbuf(3), fseek(3) .SH DIAGNOSTICS .I Ungetc returns .SM .B EOF if it can't push a character back. Ungetc pushes the character .I c back on an input stream. That character will be returned by the next .I getc call on that stream. .I Ungetc returns .IR c . .PP One character of pushback is guaranteed provided something has been read from the stream and the stream is actually buffered. Attempts to push EOF are rejected. .PP .IR man/man3/valloc.3 644 0 33 1131 2512730610 7000 .UC .TH VALLOC 3 .SH NAME valloc \- aligned memory allocator .SH SYNOPSIS .nf .B char *valloc(size) .B unsigned size; .fi .SH DESCRIPTION .I Valloc allocates .I size bytes aligned on a boundary adequate for .IR vread (2)). It is implemented by calling .IR malloc (3) with a slightly larger request, saving the true beginning of the block allocated, and returning a properly aligned pointer. .SH DIAGNOSTICS .I Valloc returns a null pointer (0) if there is no available memory or if the arena has been detectably corrupted by storing outside the bounds of a block. .SH BUGS .I Vfree isn't implemented. lloc(size) .B unsigned size; .fi .SH DESCRIPTION .I Valloc allocates .I size bytes aligned on a boundary adequate for .IR vread (2)). It is implemented by calling .IR malloc (3) with a slightly larger request, saving the true beginning of the block allocated, and returning a properly aligned pointer. .SH DIAGNOSTICS .I Valloc returns a null pointer (0) if there is no available memory or if the arena has been detectably man/man3/varargs.3 644 0 33 4006 2512730610 7171 .TH VARARGS 3 .SH NAME varargs \- variable argument list .SH SYNOPSIS .nf #include \fIfunction\fR(\fBva_alist\fR) \fBva_dcl va_list \fIpvar\fR; \fBva_start\fR(\fIpvar\fR); f = \fBva_arg\fR(\fIpvar\fR, \fItype\fR); \fBva_end\fR(\fIpvar\fR); .fi .SH DESCRIPTION This set of macros allows portable procedures that accept variable argument lists to be written. Routines which have variable argument lists (such as .IR printf(3)) that do not use varargs are inherently nonportable, since different machines use different argument passing conventions. .PP .B va_alist is used in a function header to declare a variable argument list. .PP .B va_dcl is a declaration for \fBva_alist\fP. Note that there is no semicolon after .B va_dcl. .PP .B va_list is a type which can be used for the variable .I pvar, which is used to traverse the list. One such variable must always be declared. .PP .B va_start .RI (pvar) is called to initialize .I pvar to the beginning of the list. .PP .B va_arg .RI ( pvar , type ) will return the next argument in the list pointed to by .IR pvar . .I Type is the type the argument is expected to be. Different types can be mixed, but it is up to the routine to know what type of argument is expected, since it cannot be determined at runtime. .PP .B va_end .RI ( pvar ) is used to finish up. .PP Multiple traversals, each bracketted by .B va_start \&.. .B va_end, are possible. .SH EXAMPLE .nf \fB#include\fP execl(\fBva_alist\fP) \fBva_dcl\fP { \fBva_list\fP ap; \fBchar\fP *file; \fBchar\fP *args[100]; \fBint\fP argno = 0; \fBva_start\fP(ap); file = \fBva_arg(ap, \fBchar\fP *); \fBwhile\fP (args[argno++] = \fBva_arg\fP(ap, \fBchar\fP *)) \fB;\fP \fBva_end\fP(ap); \fBreturn\fP execv(file, args); } .fi .SH BUGS It is up to the calling routine to determine how many arguments there are, since it is not possible to determine this from the stack frame. For example, .I execl passes a 0 to signal the end of the list. .I Printf can tell how many arguments are there by the format. \fP *args[100]; \fBint\fP argno = 0; \fBva_start\fP(ap); file = \fBva_arg(ap, \fBchar\fP *); \fBwhile\fP (args[argno++] = \fBva_arg\fP(ap, \fBchar\fP *)) \fB;\fP \fBva_end\fP(ap); \fBreturn\fP execv(file, args); } .fi .SH BUGS It is up to the calling routine to determine how many arguments there are, since it is not possible to determine this from the stack frame. For example, .I execl passes a 0 to signal the end of the list. .I Printf can tell how many arguments are there by the foman/man4/ 775 0 33 0 2662074457 5376 man/man4/bk.4 644 0 33 6165 2662074614 6145 ((.TH BK 4 5/11/81 .UC 4 .SH NAME bk \- line discipline for machine-machine communication .SH SYNOPSIS pseudo-device bk .SH DESCRIPTION This line discipline provides a replacement for the old and new tty drivers described in .IR tty (4) when high speed output to and especially input from another machine is to be transmitted over a asynchronous communications line. The discipline was designed for use by the Berkeley network .IR net (1). It may be suitable for uploading of data from microprocessors into the system. If you are going to send data over asynchronous communications lines at high speed into the system, you must use this discipline, as the system otherwise may detect high input data rates on terminal lines and disables the lines; in any case the processing of such data when normal terminal mechanisms are involved saturates the system. .PP The line discipline is enabled by a sequence: .PP .nf .ft B #include int ldisc = NETLDISC, fildes; ... ioctl(fildes, TIOCSETD, &ldisc); .fi .ft R .PP A typical application program then reads a sequence of lines from the terminal port, checking header and sequencing information on each line and acknowledging receipt of each line to the sender, who then transmits another line of data. Typically several hundred bytes of data and a smaller amount of control information will be received on each handshake. .PP The old standard teletype discipline can be restored by doing: .PP .nf .ft B ldisc = OTTYDISC; ioctl(fildes, TIOCSETD, &ldisc); .fi .ft R .PP While in networked mode, normal teletype output functions take place. Thus, if an 8 bit output data path is desired, it is necessary to prepare the output line by putting it into RAW mode using .IR ioctl (2). This must be done .B before changing the discipline with TIOCSETD, as most .IR ioctl (2) calls are disabled while in network line-discipline mode. .PP When in network mode, input processing is very limited to reduce overhead. Currently the input path is only 7 bits wide, with newline the only recognized character, terminating an input record. Each input record must be read and acknowledged before the next input is read as the system refuses to accept any new data when there is a record in the buffer. The buffer is limited in length, but the system guarantees to always be willing to accept input resulting in 512 data characters and then the terminating newline. .PP User level programs should provide sequencing and checksums on the information to guarantee accurate data transfer. .SH "SEE ALSO" tty(4) .SH DIAGNOSTICS None. .SH BUGS The Purdue uploading line discipline, which provides 8 bits and uses timeout's to terminate uploading should be incorporated into the standard system, as it is much more suitable for microprocessor connections. .PP Inclusion of this line discipline causes the system to use the input silos on dz's and dh's. This causes problems with some terminals, which require ^S/^Q handshaking to operate but have inadequate buffering to tolerate even a small number of characters transmitted after they send a ^S. In particular this problem existed on early VT100's (where, however, an ECO exists to fix this problem.) ing should be incorporated into the standard system, as it is much more suitable for microprocessor connections. .PP Inclusion of this line discipline causes the system to use the input silos on dz's and dh's. This causes problems with some terminals, which require ^S/^Q handshaking to operate but have inadequate buffering to tolerate even a small number of characters transmitted after they man/man4/cons.4 664 0 33 2456 2512730613 6504 .TH CONS 4 4/1/81 .UC 4 .SH NAME cons \- VAX-11 console interface .SH DESCRIPTION The console is available to the processor through the console registers. It acts like a normal terminal, except that when the local functions are not disabled, control-P puts the console in local console mode (where the prompt is ``>>>''). The operation of the console in this mode varies slightly per-processor. .PP On an 11/780 you can return to the conversational mode using the command ``se t p'' if the processor is still running or ``continue'' if it is halted. The latter command may be abbreviated ``c''. If you hit the break key on the console, then the console will go into ODT (console debugger mode). Hit a ``P'' (upper-case letter p) to get out of this mode. .PP On an 11/750 ..or an 11/730 the processor is halted whenever the console is not in conversational mode, and typing ``C'' returns to conversational mode. When in console mode on an 11/750 which has a remote diagnosis module, a ^D will put you in remote diagnosis mode, where the prompt will be ``RDM>''. The command ``ret'' will return from remote diagnosis mode to local console mode. .PP With the above proviso's the console works like any other UNIX terminal. .SH FILES /dev/console .SH "SEE ALSO" tty(4), reboot(8) .br VAX Hardware Handbook .SH DIAGNOSTICS None. enever the console is not in conversational mode, and typing ``C'' returns to conversational mode. When in console mode on an 11/750 which has a remote diagnosis module, a ^D will put you in remote diagnosis moman/man4/ct.4 644 0 33 1047 2531446275 6152 .TH CT 4 5/10/81 .UC 4 .SH NAME ct \- phototypesetter interface .SH SYNOPSIS device ct0 at uba0 csr 0167760 vector ctintr .SH DESCRIPTION This provides the interfact to a Graphic Systems C/A/T phototypesetter. Bytes written on the file specify font, size, and other control information as well as the characters to be flashed. The coding will not be described here. .PP Only one process may have this file open at a time. It is write-only. .SH FILES /dev/cat .SH "SEE ALSO" troff(1) .br Phototypesetter interface specification .SH DIAGNOSTICS None. hototypesetter interface .SH SYNOPSIS device ct0 at uba0 csr 0167760 vector ctintr .SH DESCRIPTION This provides the interfact to a Graphic Systems C/A/T phototypesetter. Bytes written on the file specify font, size, and other control information as well as the characters to be flashed. The coding will not be described here. .PP Only one process may have this file open at a time. It is write-only. .SH FILES /dev/cat .SH "SEE ALSO" troff(1) .br Phototypesetter interfaman/man4/dh.4 644 0 33 4025 2662074614 6135 .TH DH 4 4/1/81 .UC 4 .SH NAME dh, dm \- DH-11/DM-11 communications multiplexer .SH SYNOPSIS device dh0 at uba0 csr 0160020 vector dhrint dhxint .br device dm0 at uba0 csr 0170500 vector dmintr .SH DESCRIPTION A dh-11 provides 16 communication lines; dm-11's may be optionally paired with dh-11's to provide modem control for the lines. .PP Each line attached to the DH-11 communications multiplexer behaves as described in .IR tty (4). Input and output for each line may independently be set to run at any of 16 speeds; see .IR tty (4) for the encoding. .PP Bit .I i of flags may be specified for a dh to say that a line is not properly connected, and that the line should be treated as hard-wired with carrier always present. Thus specifying ``flags 0x0004'' in the specification of dh0 would cause line ttyh2 to be treated in this way. .PP If the Berknet line driver .IR bk (4) is included in the system, then the dh driver will use its input silos and poll for input at each clock tick (normally 1/50'th or 1/60'th of a second) rather than taking an interrupt on each input character. .SH FILES /dev/tty[hi][0-9a-f] .br /dev/ttyd[0-9a-f] .SH "SEE ALSO" tty(4) .SH DIAGNOSTICS \fBdh%d: NXM\fR. No response from UNIBUS on a dma transfer within a timeout period. This is often followed by a UNIBUS adapter error. This occurs most frequently when the UNIBUS is heavily loaded and when devices which hog the bus (such as rk07's) are present. It is not serious. .PP \fBdh%d: silo overflow\fR. The 64 character input silo overflowed before it could be serviced. This can happen if a hard error occurs when the CPU is running with elevated priority, as the system will then print a message on the console with interrupts disabled. If the Berknet .IR net (1) is running on a .I dh line at high speed (e.g. 9600 baud), there is only 1/15th of a second of buffering capacity in the silo, and overrun is possible. This may cause a few input characters to be lost to users and a network packet is likely to be corrupted, but the network will recover. It is not serious. viced. This can happen if a hard error occurs when the CPU is running with elevated priority, as the system will then print a message on the console with interrupts disabled. If the Berknet .IR net (1) is running on a .I dh line at high speed (e.g. 9600 baud), there is only 1/15th of a second of buffering capacity in the silo, and overrun is possible. This may cause a few input characters to be lost to users and a network packet is likely to be corrupted, but the network will recover((man/man4/drum.4 644 0 33 1064 2531446275 6512 .TH DRUM 4 5/11/81 .UC 4 .SH NAME drum \- paging device .SH DESCRIPTION This file refers to the paging device in use by the system. This may actually be a subdevice of one of the disk drivers, but in a system with paging interleaved across multiple disk drives it provides an indirect driver for the multiple drives. .SH FILES /dev/drum .SH BUGS Reads from the drum are not allowed across the interleaving boundaries. Since these only occur every .BR . 5Mbytes or so, and since the system never allocates blocks across the boundary, this is usually not a problem. ice .SH DESCRIPTION This file refers to the paging device in use by the system. This may actually be a subdevice of one of the disk drivers, but in a system with paging interleaved across multiple disk drives it provides an indirect driver for the multiple drives. .SH FILES /dev/drum .SH BUGS Reads from the drum are not allowed across the interleaving boundaries. Since these only occur every .BR . 5Mbytes or so, and since the system never allocates blocks man/man4/dz.4 644 0 33 3044 2574152206 6153 .TH DZ 4 9/1/81 .UC 4 .SH NAME dz \- DZ-11 communications multiplexer .SH SYNOPSIS device dz0 at uba0 csr 0160100 vector dzrint dzxint .SH DESCRIPTION A dz-11 provides 8 communication lines with partial modem control, adequate for UNIX dialup use. Each line attached to the DZ-11 communications multiplexer behaves as described in .IR tty (4) and may be set to run at any of 16 speeds; see .IR tty (4) for the encoding. .PP Bit .I i of flags may be specified for a dz to say that a line is not properly connected, and that the line should be treated as hard-wired with carrier always present. Thus specifying ``flags 0x04'' in the specification of dz0 would cause line tty02 to be treated in this way. .PP The dz driver normally uses its input silos and polls for input at each clock tick (1/60'th of a second) rather than taking an interrupt on each input character. .SH FILES /dev/tty[0-9][0-9] .br /dev/ttyd[0-9a-f] dialups .SH "SEE ALSO" tty(4) .SH DIAGNOSTICS .PP \fBdz%d: silo overflow\fR. The 64 character input silo overflowed before it could be serviced. This can happen if a hard error occurs when the CPU is running with elevated priority, as the system will then print a message on the console with interrupts disabled. If the Berknet .IR net (1) is running on a .I dz line at high speed (e.g. 9600 baud), there is only 1/15th of a second of buffering capacity in the silo, and overrun is possible. This may cause a few input characters to be lost to users and a network packet is likely to be corrupted, but the network will recover. It is not serious. viced. This can happen if a hard error occurs when the CPU is running with elevated priority, as the system will then print a message on the console with interrupts disabled. If the Berknet .IR net (1) is running on a .I dz line at high speed (e.g. 9600 baud), there is only 1/15th of a second of buffering capacity in the silo, and overrun is possible. This may cause a few input characters to be lost to users and a network packet is likely to be corrupted, but the netwoman/man4/fl.4 664 0 33 1312 2531446276 6143 .TH FL 4 5/11/81 .UC 4 .SH NAME fl \- floppy interface .SH DESCRIPTION .PP This is a simple interface to the D.E.C. RX01 floppy disk unit, which is part of the console LSI-11 subsytem for VAX-11/780's. Access is given to the entire floppy consisting of 77 tracks of 26 sectors of 128 bytes. .PP All i/o is raw; the seek addresses in raw transfers should be a multiple of 128 bytes and a multiple of 128 bytes should be transferred, as in other ``raw'' disk interfaces. .SH FILES /dev/floppy .SH SEE ALSO arff(8) .SH DIAGNOSTICS None. .SH BUGS Multiple console floppies are not supported. .PP If a write is given with a count not a multiple of 128 bytes then the trailing portion of the last sector will be zeroed. Access is given to the entire floppy consisting of 77 tracks of 26 sectors of 128 bytes. .PP All i/o is raw; the seek addresses in raw transfers should be a multiple of 128 bytes and a multiple of 128 bytes should be transferred, as in other ``raw'' disk interfaces. .SH FILES /dev/floppy .SH SEE ALSO arff(8) man/man4/hk.4 644 0 33 10424 2531446276 6166 .TH HK 4 5/11/81 .UC 4 .SH NAME hk \- RK6-11/RK06 and RK07 moving head disk .SH SYNOPSIS controller hk0 at uba? csr 0177440 vector rkintr .br disk rk0 at hk0 drive 0 .br disk rk1 at hk0 drive 1 .SH DESCRIPTION Files with minor device numbers 0 through 7 refer to various portions of drive 0; minor devices 8 through 15 refer to drive 1, etc. The standard device names begin with ``hk'' followed by the drive number and then a letter a-h for partitions 0-7 respectively. The character ? stands here for a drive number in the range 0-7. .PP The origin and size of the pseudo-disks on each drive are as follows: .PP .nf .ta .5i +\w'000000 'u +\w'000000 'u +\w'000000 'u RK07 partitions: disk start length cyl hk?a 0 15884 0-240 hk?b 15906 10032 241-392 hk?c 0 53790 0-814 hk?g 26004 27786 393-813 .PP .nf RK06 partitions disk start length cyl hk?a 0 15884 0-240 hk?b 15906 11154 241-409 hk?c 0 27126 0-410 .DT .fi .PP On a dual RK-07 system partition hk?a is used for the root for one drive and partition hk?g for the /usr file system. If large jobs are to be run using hk?b on both drives as swap area provides a 10Mbyte paging area. Otherwise partition hk?c on the other drive is used as a single large file system. .PP The block files access the disk via the system's normal buffering mechanism and may be read and written without regard to physical disk records. There is also a `raw' interface which provides for direct transmission between the disk and the user's read or write buffer. A single read or write call results in exactly one I/O operation and therefore raw I/O is considerably more efficient when many words are transmitted. The names of the raw files conventionally begin with an extra `r.' .PP In raw I/O counts should be a multiple of 512 bytes (a disk sector). Likewise .I seek calls should specify a multiple of 512 bytes. .SH FILES /dev/hk[0-7][a-h] block files .br /dev/rhk[0-7][a-h] raw files .SH SEE ALSO hp(4), up(4) .SH DIAGNOSTICS \fBrk%d%c: hard error sn%d cs2=%b ds=%b er=%b\fR. An unrecoverable error occured during transfer of the specified sector of the specified disk partition. The contents of the cs2, ds and er registers are printed in octal and symbolically with bits decoded. The error was either unrecoverable, or a large number of retry attempts (including offset positioning and drive recalibration) could not recover the error. .PP \fBrk%d: write locked\fR. The write protect switch was set on the drive when a write was attempted. The write operation is not recoverable. .PP \fBrk%d: not ready\fR. The drive was spun down or off line when it was accessed. The i/o operation is not recoverable. .PP \fBrk%d: not ready (came back!)\fR. The drive was not ready, but after printing the message about being not ready (which takes a fraction of a second) was ready. The operation is recovered if no further errors occur. .PP \fBrk%d%c: soft ecc sn%d\fR. A recoverable ECC error occurred on the specified sector of the specified disk partition. This happens normally a few times a week. If it happens more frequently than this the sectors where the errors are occuring should be checked to see if certain cylinders on the pack, spots on the carriage of the drive or heads are indicated. .PP \fBhk%d: lost interrupt\fR. A timer watching the controller detected no interrupt for an extended period while an operation was outstanding. This indicates a hardware or software failure. There is currently a hardware/software problem with spinning down drives while they are being accessed which causes this error to occur. The error causes a UNIBUS reset, and retry of the pending operations. If the controller continues to lose interrupts, this error will recur a few seconds later. .SH BUGS In raw I/O .I read and .IR write (2) truncate file offsets to 512-byte block boundaries, and .I write scribbles on the tail of incomplete blocks. Thus, in programs that are likely to access raw devices, .I read, write and .IR lseek (2) should always deal in 512-byte multiples. .PP DEC-standard error logging should be supported. .PP A progr((am to analyze the logged error information (even in its present reduced form) is needed. .PP The partition tables for the file systems should be read off of each pack, as they are never quite what any single installation would prefer, and this would make packs more portable. ibbles on the tail of incomplete blocks. Thus, in programs that are likely to access raw devices, .I read, write and .IR lseek (2) should always deal in 512-byte multiples. .PP DEC-standard error logging should be supported. .PP A progrman/man4/hp.4 644 0 33 11272 2527203002 6154 .TH HP 4 5/10/81 .UC 4 .SH NAME hp \- RP06, RM03, RM05, RM80, RP07 MASSBUS moving-head disk .SH SYNOPSIS disk hp0 at mba0 drive 0 .SH DESCRIPTION Files with minor device numbers 0 through 7 refer to various portions of drive 0; minor devices 8 through 15 refer to drive 1, etc. The standard device names begin with ``hp'' followed by the drive number and then a letter a-h for partitions 0-7 respectively. The character ? stands here for a drive number in the range 0-7. .PP The origin and size of the pseudo-disks on each drive are as follows: .PP .nf .ta .5i +\w'000000 'u +\w'000000 'u +\w'000000 'u +\w'000000 'u RP06 partitions disk start length cyls hp?a 0 15884 0-37 hp?b 15884 33440 38-117 hp?c 0 340670 0-814 hp?g 49324 291280 118-814 .PP .nf RM03 partitions disk start length cyls hp?a 0 15884 0-99 hp?b 16000 33440 100-309 hp?c 0 131680 0-822 hp?g 49600 81984 310-822 .PP .nf RM05 partitions disk start length cyls hp?a 0 15884 0-26 hp?b 16416 33440 27-81 hp?c 0 500384 0-822 hp?d 341696 15884 562-588 hp?e 358112 55936 589-680 hp?f 414048 86240 681-822 hp?g 341696 158592 562-822 hp?h 49856 291346 82-561 .PP .nf RM80 partitions disk start length cyls hp?a 0 15884 0-36 hp?b 16058 33440 37-114 hp?c 0 242606 0-558 hp?g 49910 82080 115-304 hp?h 132370 110143 305-558 .PP .nf RP07 partitions disk start length cyls hp?a 0 15884 0-9 hp?b 16000 64000 10-49 hp?c 0 1008000 0-629 hp?d 528000 15884 330-339 hp?e 544000 258000 340-499 hp?f 800000 207850 500-629 hp?g 528000 479850 330-629 hp?h 80000 448000 50-329 .fi .DT .PP It is unwise for all of these files to be present in one installation, since there is overlap in addresses and protection becomes a sticky matter. The hp?a partition is normally used for the root file system, the hp?b partition as a paging area, and the hp?c partition for pack-pack copying (it maps the entire disk). On rp06's and rm03's the hp?g partition maps the rest of the pack. On rm80's, rm05's and rp07's, both hp?g and hp?h are used to map the remaining cylinders. .PP The block files access the disk via the system's normal buffering mechanism and may be read and written without regard to physical disk records. There is also a `raw' interface which provides for direct transmission between the disk and the user's read or write buffer. A single read or write call results in exactly one I/O operation and therefore raw I/O is considerably more efficient when many words are transmitted. The names of the raw files conventionally begin with an extra `r.' .PP In raw I/O counts should be a multiple of 512 bytes (a disk sector). Likewise .I seek calls should specify a multiple of 512 bytes. .SH FILES .ta 2i /dev/hp[0-7][a-h] block files .br /dev/rhp[0-7][a-h] raw files .SH SEE ALSO hk(4), up(4) .SH DIAGNOSTICS \fBhp%d%c: hard error sn%d mbsr=%b er1=%b er2=%b\fR. An unrecoverable error occured during transfer of the specified sector of the specified disk partition. The MASSBUS status register is printed in hexadecimal and with the error bits decoded if any error bits other than MBEXC and DTABT are set. In any case the contents of the two error registers are also printed in octal and symbolically with bits decoded. (Note that er2 is what old rp06 manuals would call er3; the terminology is that of the rm disks). The error was either unrecoverable, or a large number of retry attempts (including offset positioning and drive recalibration) could not recover the error. .PP \fBhp%d: write locked\fR. The write protect switch was set on the drive when a write was attempted. The write operation is not recoverable. .PP \fBhp%d: not ready\fR. The drive was spun down or off line when it was accessed. The i/o operation is not recoverable. .PP \fBhp%d%c: soft ecc sn%d\fR. A recoverable ECC error occurred on the specified sector of the specified disk partition. This happens normally a few times a week. If it happens more frequently than this the sectors where the errors are occuring should be checked to see if certain cylinders on the pack, spots on the carriage of the drive or heads are indicated. .SH BUGS In raw I/O .I read and .IR write (2) truncate file offsets to 512-byte block boundaries, and .I write scribbles on the tail of incomplete blocks. Thus, in programs that are likely to access raw devices, .I read, write and .IR lseek (2) should always deal in 512-byte multiples. .PP DEC-standard error logging should be supported. .PP Bad block forwarding is not yet supported on RP06's. .PP A program to analyze the logged error information (even in its present reduced form) is needed. .PP The partition tables for the file systems should be read off of each pack, as they are never quite what any single installation would prefer, and this would make packs more portable. s that are likely to access raw devices, .I read, write and .IR lseek (2) should always deal in 512-byte multiples. .PP DEC-standard error logging should be supported. .PP Bad block forwarding is not yet supported on RP06's. .PP A program to analyze the logged error information (even in its present reduced form) is needed. .man/man4/ht.4 644 0 33 3252 2662074615 6157 .TH HT 4 4/1/81 .UC 4 .SH NAME ht \- TM-03/TE-16,TU-45,TU-77 MASSBUS magtape interface .SH SYNOPSIS formatter ht0 at mba? drive ? .br tape tu0 at ht0 slave 0 .SH DESCRIPTION The tm-03/transport combination provides a standard tape drive interface as described in .IR mt (4). All drives provide both 800 and 1600 bpi; the TE-16 runs at 45 ips, the TU-45 at 75 ips, while the TU-77 runs at 125 ips and autoloads tapes. .SH "SEE ALSO" mt(1), tar(1), tp(1), mtop(4), mt(4), tm(4), ts(4) .SH DIAGNOSTICS \fBtu%d: no write ring\fR. An attempt was made to write on the tape drive when no write ring was present; this message is written on the terminal of the user who tried to access the tape. .PP \fBtu%d: not online\fR. An attempt was made to access the tape while it was offline; this message is written on the terminal of the user who tried to access the tape. .PP \fBtu%d: can't switch density in mid-tape\fR. An attempt was made to write on a tape at a different density than is already recorded on the tape. This message is written on the terminal of the user who tried to switch the density. .PP \fBtu%d: hard error bn%d mbsr=%b er=%b ds=%b\fR. A tape error occurred at block \fIbn\fR; the ht error register and drive status register are printed in octal with the bits symbolically decoded. Any error is fatal on non-raw tape; when possible the driver will have retried the operation which failed several times before reporting the error. .SH BUGS If any non-data error is encountered on non-raw tape, it refuses to do anything more until closed. .PP The system should remember which controlling terminal has the tape drive open and write error messages to that terminal rather than on the console. e ht error register and drive status register are printed in octal with the bits symbolically decoded. Any error is fatal on non-raw tape; when possible the driver will have retried the operation which failed several times before reporting the error. .SH BUGS If any non-data error is encountered on non-raw tape, it refuses to do anything mman/man4/intro.4 664 0 33 777 2512730614 6662 .TH INTRO 4 4/1/81 .UC 4 .SH NAME intro \- introduction to special files .SH DESCRIPTION This section describes the special files and related driver functions available on the system. In this section the SYNOPSIS section gives a sample specification of the related drivers for use in a system description to the .IR config (8) program. The DIAGNOSTICS section lists messages which may appear on the console and in the system error log /usr/adm/messages due to errors in device operation. .SH SEE ALSO config(8) man/man4/kmem.4 644 0 33 30 2512730614 6414 ((.so /usr/man/man4/mem.4 .SH NAME intro \- introduction to special files .SH DESCRIPTION This section describes the special files and related driver functions available on the system. In this section the SYNOPSIS section gives a sample specification of the related drivers for use in a system description to the .IR config (8) program. The DIAGNOSTICS section lists messages which may appear on the console and in the sy/( ,( 5Ċ /\@,\D"man/man4/lp.4 644 0 33 2376 2512730614 6155 .TH LP 4 4/1/81 .UC 4 .SH NAME lp \- line printer .SH SYNOPSIS device lp0 at uba0 csr 0177514 vector lpintr .SH DESCRIPTION .I Lp provides the interface to any of the standard DEC line printers. When it is opened or closed, a suitable number of page ejects is generated. Bytes written are printed. .PP The unit number of the printer is specified by the minor device after removing the low 3 bits, which act as per-device parameters. Currently only the lowest of the low three bits is interpreted: if it is set, the device is treated as having a 64-character set, rather than a full 96-character set. In the resulting half-ASCII mode, lower case letters are turned into upper case and certain characters are escaped according to the following table: .PP .br .ns .TP 10 { \o"-(" .br .ns .TP 10 } \o"-)" .br .ns .TP 10 \` \o"-\'" .br .ns .TP 10 | \o"\-!" .br .ns .TP 10 ~ \o"\-^" .. .PP The driver correctly interprets carriage returns, backspaces, tabs, and form feeds. Lines longer than 132 characters are truncated (This is a parameter in the driver). .SH FILES /dev/lp .SH "SEE ALSO" lpr(1) .SH DIAGNOSTICS None. .SH BUGS Although the driver supports multiple printers this has never been tried. In any case user-level software support for multiple printers is not available. 0 { \o"-(" .br .ns .TP 10 } \o"-)" .br .ns .TP 10 \` \o"-\'" .br .ns .TP 10 | \o"\-!" .br .ns .TP 10 ~ \o"\-^" .. .PP The driver correctly interprets carriage returns, backspaces, tabs, and form feeds. Lines longer than 132 characters are truncated (This is man/man4/mail.4 644 0 33 673 2512730614 6442 .TH MAIL 4 .UC 4 .SH NAME mail \- pseudo-device for mail notification .SH DESCRIPTION The file .B /dev/mail is a multiplexor file maintained by the mail notification daemon. When a piece of mail is delivered the mail delivery process writes information on this file and the mail notification daemon .B /etc/comsat notifies a user of the arrival of the mail if the user desires to be notified. .SH SEE ALSO biff(1) .SH FILES /dev/mail .SH BUGS ,( 5Ċ /\@,\D"man/man4/mem.4 644 0 33 2143 2513541225 6307 .TH MEM 4 .UC 4 .SH NAME mem, kmem \- main memory .SH DESCRIPTION .lg .I Mem is a special file that is an image of the main memory of the computer. It may be used, for example, to examine (and even to patch) the system. .PP Byte addresses in .I mem are interpreted as physical memory addresses. References to non-existent locations cause errors to be returned. .PP Examining and patching device registers is likely to lead to unexpected results when read-only or write-only bits are present. .PP The file .I kmem is the same as .I mem except that kernel virtual memory rather than physical memory is accessed. .PP On PDP11's, the I/O page begins at location 0160000 of .I kmem and per-process data for the current process begins at 0140000. On VAX 11/780 the I/O space begins at physical address 20000000(16); on an 11/750 I/O space addresses are of the form fxxxxx(16); on all VAX'en per-process data f\&or the current process is at virtual 7f\&f\&f\&f\&000(16). .SH FILES /dev/mem, /dev/kmem .SH BUGS On PDP11's and VAX's, memory files are accessed one byte at a time, an inappropiate method for some device registers. .PP On PDP11's, the I/O page begins at location 0160000 of .I kmem and per-process data for the current process begins at 0140000. On VAX 11/780 the I/O space begins at physical address 20000000(16); on an 11/750 I/O space addresses are of the form fxxxxx(16); on all VAX'en per-process data f\&or the current process is at virtual 7f\&f\&f\&f\&000(16). .SH FILES /dev/mem, /dev/kmem .SH BUGS On PDP11's and VAX'man/man4/mt.4 664 0 33 3300 2662074453 6160 .TH MT 4 10/8/81 .UC 4 .SH NAME mt \- TM-78/TU-78 MASSBUS magtape interface .SH SYNOPSIS formatter mt0 at mba? drive ? .br tape mu0 at mt0 slave 0 .SH DESCRIPTION The tm-78/transport combination provides a standard tape drive interface as described in .IR mtop (4). The TU78 provides both 1600 and 6250 bpi, runs at 125 ips, and autoloads tapes. .SH "SEE ALSO" mt(1), tar(1), tp(1), mtop(4), ht(4), tm(4), ts(4) .SH DIAGNOSTICS \fBmu%d: no write ring\fR. An attempt was made to write on the tape drive when no write ring was present; this message is written on the terminal of the user who tried to access the tape. .PP \fBmu%d: not online\fR. An attempt was made to access the tape while it was offline; this message is written on the terminal of the user who tried to access the tape. .PP \fBmu%d: can't switch density in mid-tape\fR. An attempt was made to write on a tape at a different density than is already recorded on the tape. This message is written on the terminal of the user who tried to switch the density. .PP \fBmu%d: hard error bn%d mbsr=%b er=%o ds=%b\fR. A tape error occurred at block \fIbn\fR; the mt error register and drive status register are printed in octal with the drive status bits symbolically decoded. Any error is fatal on non-raw tape; when possible the driver will have retried the operation which failed several times before reporting the error. .PP \fBmu%d: blank tape\fR. An attempt was made to read or space a blank tape. .SH BUGS If any non-data error is encountered on non-raw tape, it refuses to do anything more until closed. .PP The system should remember which controlling terminal has the tape drive open and write error messages to that terminal rather than on the console. symbolically decoded. Any error is fatal on non-raw tape; when possible the driver will have retried the operation which failed several times before reporting the error. .PP \fBmu%d: blank tape\fR. An attempt was made to read or space a blank tape. .SH BUGS If any non-data error is encountered on non-raw tape, it reman/man4/newtty.4 644 0 33 6317 2512730615 7074 .TH NEWTTY 4 4/1/81 .UC 4 .SH NAME newtty \- summary of the ``new'' tty driver .SH USAGE .B "stty new" .PP .B "stty new crt" .SH DESCRIPTION This is a summary of the new tty driver, described completely, with the old terminal driver, in .IR tty (4). The new driver is largely compatible with the old but provides additional functionality for job control. .LP .B "CRTs and printing terminals." .LP The new terminal driver acts differently on CRTs and on printing terminals. On CRTs at speeds of 1200 baud or greater it normally erases input characters physically with backspace-space-backspace when they are erased logically; at speed under 1200 baud this is often unreasonably slow, so the cursor is normally merely moved to the left. This is the behavior when you say \*(lqstty new crt\*(rq; to have the tty driver always erase the characters say \*(lqstty new crt crterase crtkill\*(rq, to have the characters remain even at 1200 baud or greater say \*(lqstty new crt \-crterase \-crtkill\*(rq. .LP On printing terminals the command \*(lqstty new prterase\*(rq should be given. Logically erased characters are then echoed printed backwards between a `\e' and an `/' character. .LP Other terminal modes are possible, but less commonly used; see .IR tty (4) and .IR stty (1) for details. .LP .B "Input editing and output control." .PP When preparing input the character # (normally changed to ^H using .IR stty (1)) erases the last input character, \&^W the last input word, and the character @ (often changed to ^U) erases the entire ((current input line. A ^R character causes the pending input to be retyped. Lines are terminated by a return or a newline; a ^D at the beginning of a line generates an end-of-file. .PP Control characters echo as ^x when typed, for some x; the delete character is represented as ^?. .PP The character ^V may be typed before .I any character so that it may be entered without its special effect. For backwards compatibility with the old tty driver the character `\e' prevents the special meaning of the character and line erase characters, much as ^V does. .LP Output is suspended when a ^S character is typed and resumed when a ^Q character is type. Output is discarded after a ^O character is typed until another ^O is type, more input arrives, or the condition is cleared by a program (such as the shell just before it prints a prompt.) .PP .B "Signals." .PP A non-interactive program is interrupted by a ^? (delete); this character is often reset to ^C using .IR stty (1). A quit ^\e character causes programs to terminate like ^? does, but also causes a \fIcore\fR image file to be created which can then be examined with a debugger. This is often used to stop runaway processes. Interactive programs often catch interrupts and return to their command loop; only the most well debugged programs catch quits. .PP Programs may be stopped by hitting ^Z, which returns control to the shell. They may then be resumed using the job control mechanisms of the shell, i.e. the .I fg (foreground) command. The character ^Y is like ^Z but takes effect when read rather then when typed; it is much less frequently used. .PP See .IR tty (4) for a more complete description of the new terminal driver. .SH "SEE ALSO" csh(1), newcsh(1), stty(1), tty(4) d return to their command loop; only the most well debugged programs catch quits. .PP Programs may be stopped by hitting ^Z, which returns control to the shell. They may then be resumed using the job control mechanisms of the shell, i.e. the .I fg (foreground) command. The character ^Y is like ^Z but takman/man4/null.4 644 0 33 271 2512730615 6465 .TH NULL 4 .SH NAME null \- data sink .SH DESCRIPTION Data written on a null special file is discarded. .PP Reads from a null special file always return 0 bytes. .SH FILES /dev/null h(1), stty(1), tty(4) d return to their command loop; only the most well debugged programs catch quits. .PP Programs may be stopped by hitting ^Z, which returns control to the shell. They may then be resumed using the job control mecha/( ,( 5Ċ /\@,\D"man/man4/rv.4 644 0 33 2652 2512730615 6167 .TH RV 4 .SH NAME rv \- Racal/Vadic ACU interface .SH DESCRIPTION The racal/vadic ACU interface is provided by the files .I /dev/cua[01] which is a multiplexed file, and by the daemon .I dnd which monitors the file, simulating a standard DN dialer. To place an outgoing call one forks a sub-process trying to open .I /dev/cul? and then opens the corresponding file .I /dev/cua? file and writes a number on it. The daemon translates the call to proper format for the Racal/Vadic interface, and monitors the progress of the call recording accounting information for later use. .PP The codes for the phone numbers are the same as in the DN interface: .TP 0-9 dial 0-9 .br .ns .TP .B : dial * .br .ns .TP .B ; dial # .br .ns .TP \- delay for second dial tone .br .ns .TP < end-of-number .PP The entire telephone number must be presented in a single .I write system call. .PP It is require that an end-of-number code be given. .DT .SH FILES /dev/cua0 virtual dialer for 300 baud dialout .br /dev/cua1 virtual dialer for 1200 baud dialout .br /dev/cul0 the terminal which is connected to the 300 baud dialout .br /dev/cul1 the terminal which is connected to the 1200 baud dialout .br /usr/adm/dnacct Accounting records for sucessfully completed calls. .SH "SEE ALSO" cu(1), uucp(1) .SH BUGS Locking problems. .PP The multiplexor seems to have rare-case bugs which occasinally crash the system taking trap type 9's, usually in the .I sdata system routine. dev/cua0 virtual dialer for 300 baud dialout .br /dev/cua1 virtual dialer for 1200 bauman/man4/tm.4 664 0 33 4063 2662074456 6172 .TH TM 4 5/10/81 .UC 4 .SH NAME tm \- TM-11/TE-10 magtape interface .SH SYNOPSIS controller tm0 at uba? csr 0172520 vector tmintr .br tape te0 at tm0 drive 0 .SH DESCRIPTION The tm-11/te-10 combination provides a standard tape drive interface as described in .IR mt (4). Hardware implementing this on the VAX is typified by the Emulex TC-11 controller operating with a Kennedy model 9300 tape transport, providing 800 and 1600 bpi operation at 125 ips. .SH "SEE ALSO" mt(1), tar(1), tp(1), ht(4), mt(4), ts(4) .SH DIAGNOSTICS \fBte%d: no write ring\fR. An attempt was made to write on the tape drive when no write ring was present; this message is written on the terminal of the user who tried to access the tape. .PP \fBte%d: not online\fR. An attempt was made to access the tape while it was offline; this message is written on the terminal of the user who tried to access the tape. .PP \fBte%d: can't switch density in mid-tape\fR. An attempt was made to write on a tape at a different density than is already recorded on the tape. This message is written on the terminal of the user who tried to switch the density. .PP \fBte%d: hard error bn%d er=%b\fR. A tape error occurred at block \fIbn\fR; the tm error register is printed in octal with the bits symbolically decoded. Any error is fatal on non-raw tape; when possible the driver will have retried the operation which failed several times before reporting the error. .PP \fBte%d: lost interrupt\fR. A tape operation did not complete within a reasonable time, most likely because the tape was taken off-line during rewind or lost vacuum. The controller should, but does not, give an interrupt in these cases. The device will be made available again after this message, but any current open reference to the device will return an error as the operation in progress aborts. .SH BUGS If any non-data error is encountered on non-raw tape, it refuses to do anything more until closed. .PP The system should remember which controlling terminal has the tape drive open and write error messages to that terminal rather than on the console. or lost vacuum. The controller should, but does not, give an interrupt in these cases. The device will be made available again after this message, but any current open reference to the device will return an error as the operation in progress aborts. .SH BUGS If any non-data error is encountered on non-raw tape, it refuses to do anything more until closed. .PP The system should remember which controlling terminal has the tape drive open and write error mesman/man4/ts.4 664 0 33 2761 2662074456 6203 .TH TS 4 5/10/81 .UC 4 .SH NAME ts \- TS-11 magtape interface .SH SYNOPSIS controller zs0 at uba? csr 0172520 vector tsintr .br tape ts0 at zs0 drive 0 .SH DESCRIPTION The ts-11 combination provides a standard tape drive interface as described in .IR mt (4). The ts-11 operates only at 1600 bpi, and only one transport is possible per controller. .SH "SEE ALSO" mt(1), tar(1), tp(1), ht(4), mt(4), tm(4), ut(4) .SH DIAGNOSTICS \fBts%d: no write ring\fR. An attempt was made to write on the tape drive when no write ring was present; this message is written on the terminal of the user who tried to access the tape. .PP \fBts%d: not online\fR. An attempt was made to access the tape while it was offline; this message is written on the terminal of the user who tried to access the tape. .PP \fBts%d: hard error bn%d xs0=%b\fR. A hard error occurred on the tape at block \fIbn\fR; status register 0 is printed in octal and symbolically decoded as bits. .SH BUGS If any non-data error is encountered on non-raw tape, it refuses to do anything more until closed. .PP The device lives at the same address as a tm-11 .IR tm (4); as it is very difficult to get this device to interrupt, a generic system assumes that a ts is present whenever no tm-11 exists but the csr responds and a ts-11 is configured. This does no harm as long as a non-existant ts-11 is not accessed. .PP The system should remember which controlling terminal has the tape drive open and write error messages to that terminal rather than on the console. w tape, it refu((man/man4/tty.4 664 0 33 70376 2527170451 6414 .de Ul .ie t \\$1\l'|0\(ul' .el \fI\\$1\fP .. .TH TTY 4 .UC 4 .SH NAME tty \- general terminal interface .SH DESCRIPTION This section describes both a particular special file .B /dev/tty and the terminal drivers used for conversational computing. .LP .B Line disciplines. .PP The system provides different .I "line disciplines" for controlling communications lines. In this version of the system there are three disciplines available: .IP "old" 8 The old (standard) terminal driver. This is used when using the standard shell .IR sh (1) and for compatibility with other standard version 7 UNIX systems. .IP "new" A newer terminal driver, with features for job control; this must be used when using .IR csh (1). See .IR newtty (1) for a short user-level summary. .IP "net" A line discipline used for networking and loading data into the system over communications lines. It allows high speed input at very low overhead, and is described in .IR bk (4). .LP Line discipline switching is accomplished with the TIOCSETD .I ioctl: .IP .B "int ldisc = LDISC; ioctl(filedes, TIOCSETD, &ldisc);" .LP where LDISC is OTTYDISC for the standard tty driver, NTTYDISC for the new driver and NETLDISC for the networking discipline. The standard (currently old) tty driver is discipline 0 by convention. The current line discipline can be obtained with the TIOCGETD ioctl. Pending input is discarded when the line discipline is changed. .PP All of the low-speed asynchronous communications ports can use any of the available line disciplines, no matter what hardware is involved. The remainder of this section discusses the \*(lqold\*(rq and \*(lqnew\*(rq disciplines. .LP .B "The control terminal." .LP When a terminal file is opened, it causes the process to wait until a connection is established. In practice, user programs seldom open these files; they are opened by .IR init (8) and become a user's standard input and output file. .PP If a process which has no control terminal opens a terminal file, then that terminal file becomes the control terminal for that process. The control terminal is thereafter inherited by a child process during a .IR fork (2), even if the control terminal is closed. .LP The file .B /dev/tty is, in each process, a synonym for a .I "control terminal" associated with that process. It is useful for programs that wish to be sure of writing messages on the terminal no matter how output has been redirected. It can also be used for programs that demand a file name for output, when typed output is desired and it is tiresome to find out which terminal is currently in use. .LP .B "Process groups." .LP As described more completely in .IR jobs (3), command processors such as .IR csh (1) can arbitrate the terminal between different .I jobs by placing related jobs in a single process group and associating this process group with the terminal. A terminals associated process group may be set using the TIOCSPGRP .IR ioctl (2): .IP \fBioctl(fildes, TIOCSPGRP, &pgrp)\fR .LP or examined using TIOCGPGRP rather than TIOCSPGRP, returning the current process group in .I pgrp. The new terminal driver aids in this arbitration by restricting access to the terminal by processes which are not in the current process group; see .B "Job access control" below. .LP .B "Modes." .PP The terminal drivers have three major modes, characterized by the amount of processing on the input and output characters: .IP cooked 10 The normal mode. In this mode lines of input are collected and input editing is done. The edited line is made available when it is completed by a newline or when an EOT (control-D, hereafter ^D) is entered. A carriage return is usually made synonymous with newline in this mode, and replaced with a newline whenever it is typed. All driver functions (input editing, interrupt generation, output processing such as delay generation and tab expansion, etc.) are available in this mode. .IP CBREAK 10 This mode eliminates the character, word, and line editing input facilities, making the input character available to the user program as it is typed. Flow control, literal-next and interrupt processing are still done in this mode. Output processing is done. .IP RAW 10 This mode eliminates all input processing and makes all input characters available as they are typed; no output processing is done either. .PP The style of input processing can also be very different when, in the new terminal driver, a process asks for notification via a SIGTTIN .IR signal (2) when input is ready to be read from the control terminal. In this case a .IR read (2) from the control terminal will never block, but rather return an error indication (EIO) if there is no input available. .LP .B "Input editing." .LP A UNIX terminal ordinarily operates in full-duplex mode. Characters may be typed at any time, even while output is occurring, and are only lost when the system's character input buffers become completely choked, which is rare, or when the user has accumulated the maximum allowed number of input characters that have not yet been read by some program. Currently this limit is 256 characters. In the old terminal driver all the saved characters are thrown away when the limit is reached, without notice; the new driver simply refuses to accept any further input, and rings the terminal bell. .PP Input characters are normally accepted in either even or odd parity with the parity bit being stripped off before the character is given to the program. By clearing either the EVEN or ODD bit in the flags word it is possible to have input characters with that parity discarded (see the \fBSummary\fR below.) .PP In all of the line disciplines, it is possible to simulate terminal input using the TIOCSTI ioctl, which takes, as its third argument, the address of a character. The system pretends that this character was typed on the argument terminal, which must be the control terminal except for the super-user (this call is not in standard version 7 UNIX).. .PP Input characters are normally echoed by putting them in an output queue as they arrive. This may be disabled by clearing the ECHO bit in the flags word using the .IR stty (2) call or the TIOCSETN or TIOCSETP ioctls (see the \fBSummary\fR below). .PP In cooked mode, terminal input is processed in units of lines. A program attempting to read will normally be suspended until an entire line has been received (but see the description of SIGTTIN in \fBModes\fR above and FIONREAD in \fBSummary\fR below.) No matter how many characters are requested in the read call, at most one line will be returned. It is not, however, necessary to read a whole line at once; any number of characters may be requested in a read, even one, without losing information. .PP During input, line editing is normally done, with the character `#' logically erasing the last character typed and the character `@' logically erasing the entire current input line. These are often reset on crt's, with ^H replacing #, and ^U replacing @. These characters never erase beyond the beginning of the current input line or an ^D. These characters may be entered literally by preceding them with `\e\|'; in the old teletype driver both the `\e\|' and the character entered literally will appear on the screen; in the new driver the `\e\|' will normally disappear. .PP The drivers normally treat either a carriage return or a newline character as terminating an input line, replacing the return with a newline and echoing a return and a line feed. If the CRMOD bit is cleared in the local mode word then the processing for carriage return is disabled, and it is simply echoed as a return, and does not terminate cooked mode input. .PP In the new driver there is a literal-next character ^V which can be typed in both cooked and CBREAK mode preceding .B any character to prevent its special meaning. This is to be preferred to the use of `\e\|' escaping erase and kill characters, but `\e\|' is (at least temporarily) retained with its old function in the new driver for historical reasons. .PP The new terminal driver also provides two other editing characters in normal mode. The word-erase character, normally ^W, erases the preceding word, but not any spaces before it. For the purposes of ^W, a word is defined as a sequence of non-blank characters, with tabs counted as blanks. Finally, the reprint character, normally ^R, retypes the pending input beginning on a new line. Retyping occurs automagically in cooked mode if characters which would normally be erased from the screen are fouled by program output. .LP .B "Input echoing and redisplay" .LP In the old terminal driver, nothing special occurs when an erase character is typed; the erase character is simply echoed. When a kill character is typed it is echoed followed by a new-line (even if the character is not killing the line, because it was preceded by a `\e\|'!.) .PP The new terminal driver has several modes for handling the echoing of terminal input, controlled by bits in a local mode word. .LP .I "Hardcopy terminals." When a hardcopy terminal is in use, the LPRTERA bit is normally set in the local mode word. Characters which are logically erased are then printed out backwards preceded by `\e\|' and followed by `/' in this mode. .LP .I "Crt terminals." When a crt terminal is in use, the LCRTBS bit is normally set in the local mode word. The terminal driver then echoes the proper number of erase characters when input is erased; in the normal case where the erase character is a ^H this causes the cursor of the terminal to back up to where it was before the logically erased character was typed. If the input has become fouled due to interspersed asynchronous output, the input is a((utomagically retyped. .LP .I "Erasing characters from a crt." When a crt terminal is in use, the LCRTERA bit may be set to cause input to be erased from the screen with a \*(lqbackspace-space-backspace\*(rq sequence when character or word deleting sequences are used. A LCRTKIL bit may be set as well, causing the input to be erased in this manner on line kill sequences as well. .LP .I "Echoing of control characters." If the LCTLECH bit is set in the local state word, then non-printing (control) characters are normally echoed as ^X (for some X) rather than being echoed unmodified; delete is echoed as ^?. .LP The normal modes for using the new terminal driver on crt terminals are speed dependent. At speeds less than 1200 baud, the LCRTERA and LCRTKILL processing is painfully slow, so .IR stty (1) normally just sets LCRTBS and LCTLECH; at speeds of 1200 baud or greater all of these bits are normally set. .IR Stty (1) summarizes these option settings and the use of the new terminal driver as \*(lqnewcrt.\*(rq .LP .B "Output processing." .PP When one or more characters are written, they are actually transmitted to the terminal as soon as previously-written characters have finished typing. (As noted above, input characters are normally echoed by putting them in the output queue as they arrive.) When a process produces characters more rapidly than they can be typed, it will be suspended when its output queue exceeds some limit. When the queue has drained down to some threshold the program is resumed. Even parity is normally generated on output. The EOT character is not transmitted in cooked mode to prevent terminals that respond to it from hanging up; programs using raw or cbreak mode should be careful. .PP The terminal drivers provide necessary processing for cooked and CBREAK mode output including delay generation for certain special characters and parity generation. Delays are available after backspaces ^H, form feeds ^L, carriage returns ^M, tabs ^I and newlines ^J. The driver will also optionally expand tabs into spaces, where the tab stops are assumed to be set every eight columns. These functions are controlled by bits in the tty flags word; see \fBSummary\fR below. .PP The terminal drivers provide for mapping between upper and lower case on terminals lacking lower case, and for other special processing on deficient terminals. .PP Finally, in the new terminal driver, there is a output flush character, normally ^O, which sets the LFLUSHO bit in the local mode word, causing subsequent output to be flushed until it is cleared by a program or more input is typed. This character has effect in both cooked and CBREAK modes and causes pending input to be retyped if there is any pending input. Ioctls to flush the characters in the input and output queues TIOCFLUSH, and to return the number of character still in the output queue TIOCOUTQ are also available. .LP .B "Upper case terminals and Hazeltines" .PP If the LCASE bit is set in the tty flags, then all upper-case letters are mapped into the corresponding lower-case letter. The upper-case letter may be generated by preceding it by `\\'. If the new terminal driver is being used, then upper case letters are preceded by a `\e\|' when output. In addition, the following escape sequences can be generated on output and accepted on input: .PP .nf for \` | ~ { } use \e\|\' \e\|! \e\|^ \e\|( \e\|) .fi .PP To deal with Hazeltine terminals, which do not understand that ~ has been made into an ASCII character, the LTILDE bit may be set in the local mode word when using the new terminal driver; in this case the character ~ will be replaced with the character \` on output. .LP .B "Flow control." .PP There are two characters (the stop character, normally ^S, and the start character, normally ^Q) which cause output to be suspended and resumed respectively. Extra stop characters typed when output is already stopped have no effect, unless the start and stop characters are made the same, in which case output resumes. .PP A bit in the flags word may be set to put the terminal into TANDEM mode. In this mode the system produces a stop character (default ^S) when the input queue is in danger of overflowing, and a start character (default ^Q) when the input has drained sufficiently. This mode is useful when the terminal is actually another machine that obeys the conventions. .LP .B "Line control and breaks." .LP There are several .I ioctl calls available to control the state of the terminal line. The TIOCSBRK ioctl will set the break bit in the hardware interface causing a break condition to exist; this can be cleared (usually after a delay with .IR sleep (3)) by TIOCCBRK. Break conditions in the input are reflected as a null character in RAW mode or as the interrupt character in cooked or CBREAK mode. The TIOCCDTR ioctl will clear the data terminal ready condition; it can be set again by TIOCSDTR. .PP When the carrier signal from the dataset drops (usually because the user has hung up his terminal) a SIGHUP hangup signal is sent to the processes in the distinguished process group of the terminal; this usually causes them to terminate (the SIGHUP can be suppressed by setting the LNOHANG bit in the local state word of the driver.) Access to the terminal by other processes is then normally revoked, so any further reads will fail, and programs that read a terminal and test for end-of-file on their input will terminate appropriately. .PP When using an ACU it is possible to ask that the phone line be hung up on the last close with the TIOCHPCL ioctl; this is normally done on the outgoing line. .LP .B "Interrupt characters." .PP There are several characters that generate interrupts in cooked and CBREAK mode; all are sent the processes in the control group of the terminal, as if a TIOCGPGRP ioctl were done to get the process group and then a .IR killpg (2) system call were done, except that these characters also flush pending input and output when typed at a terminal (\fI\z'a\`'la\fR TIOCFLUSH). The characters shown here are the defaults; the field names in the structures (given below) are also shown. The characters may be changed, although this is not often done. .IP ^? \fBt_intrc\fR (Delete) generates a SIGINTR signal. This is the normal way to stop a process which is no longer interesting, or to regain control in an interactive program. .IP ^\e \fBt_quitc\fR (FS) generates a SIGQUIT signal. This is used to cause a program to terminate and produce a core image, if possible, in the file .B core in the current directory. .IP ^Z \fBt_suspc\fR (EM) generates a SIGTSTP signal, which is used to suspend the current process group. .IP ^Y \fBt_dstopc\fR (SUB) generates a SIGTSTP signal as ^Z does, but the signal is sent when a program attempts to read the ^Y, rather than when it is typed. .LP .B "Job access control." .PP When using the new terminal driver, if a process which is not in the distinguished process group of its control terminal attempts to read from that terminal its process group is sent a SIGTTIN signal, which normally causes the members of that process group to stop. If, however, the process is ignoring or holding SIGTTIN signal is an orphan .IR "" ( i.e. its parent has exited and it has been inherited by the .IR init (8) process, or if it is a process in the middle of process creation using .IR vfork (2)), it is instead returned an end-of-file. Under older UNIX systems these processes would typically have had their input files reset to .B /dev/null, so this is a compatible change. .PP When using the new terminal driver with the LTOSTOP bit set in the local modes, a process is prohibited from writing on its control terminal if it is not in the distinguished process group for that terminal. Processes which are holding or ignoring SIGTTOU signals, which are orphans, or which are in the middle of a .IR vfork (2) are excepted and allowed to produce output. .LP .B "Summary of modes." .LP Unfortunately, due to the evolution of the terminal driver, there are 4 different structures which contain various portions of the driver data. The first of these (\fBsgttyb\fR) contains that part of the information largely common between version 6 and version 7 UNIX systems. The second contains additional control characters added in version 7. The third is a word of local state peculiar to the new terminal driver, and the fourth is another structure of special characters added for the new driver. In the future a single structure may be made available to programs which need to access all this information; most programs need not concern themselves with all this state. .LP .Ul "Basic modes: sgtty." .PP The basic .IR ioctl s use the structure defined in .IR : .PP .ta .5i 1i .nf .ft 3 struct sgttyb { char sg_ispeed; char sg_ospeed; char sg_erase; char sg_kill; short sg_flags; }; .ft R .fi .PP The .I sg_ispeed and .I sg_ospeed fields describe the input and output speeds of the device according to the following table, which corresponds to the DEC DH-11 interface. If other hardware is used, impossible speed changes are ignored. Symbolic values in the table are as defined in .IR . .PP .nf .ta \w'B9600 'u +5n B0 0 (hang up dataphone) B50 1 50 baud B75 2 75 baud B110 3 110 baud B134 4 134.5 baud B150 5 150 baud B200 6 200 baud B300 7 300 baud B600 8 600 baud B1200 9 1200 baud B1800 10 1800 baud B2400 11 2400 baud B4800 12 4800 baud B9600 13 9600 baud EXTA 14 External A EXTB 15 External B .fi .DT .PP In the current configuration, only 110, 150, 300 and 1200 baud are really supported on dial-up lines. Code conversion and line control required for IBM 2741's (134.5 baud) must be implemented by the user's program. The half-duplex line discipline required for the 202 dataset (1200 baud) is not supplied; full-duplex 212 datasets work fine. .PP The .I sg_erase and .I sg_kill fields of the argument structure specify the erase and kill characters respectively. (Defaults are # and @.) .PP The .I sg_flags field of the argument structure contains several bits that determine the system's treatment of the terminal: .PP .ta \w'ALLDELAY 'u +\w'0100000 'u .nf ALLDELAY 0177400 Delay algorithm selection BSDELAY 0100000 Select backspac((e delays (not implemented): BS0 0 BS1 0100000 VTDELAY 0040000 Select form-feed and vertical-tab delays: FF0 0 FF1 0100000 CRDELAY 0030000 Select carriage-return delays: CR0 0 CR1 0010000 CR2 0020000 CR3 0030000 TBDELAY 0006000 Select tab delays: TAB0 0 TAB1 0001000 TAB2 0004000 XTABS 0006000 NLDELAY 0001400 Select new-line delays: NL0 0 NL1 0000400 NL2 0001000 NL3 0001400 EVENP 0000200 Even parity allowed on input (most terminals) ODDP 0000100 Odd parity allowed on input RAW 0000040 Raw mode: wake up on all characters, 8-bit interface CRMOD 0000020 Map CR into LF; echo LF or CR as CR-LF ECHO 0000010 Echo (full duplex) LCASE 0000004 Map upper case to lower on input CBREAK 0000002 Return each character as soon as typed TANDEM 0000001 Automatic flow control .DT .fi .PP The delay bits specify how long transmission stops to allow for mechanical or other movement when certain characters are sent to the terminal. In all cases a value of 0 indicates no delay. .PP Backspace delays are currently ignored but might be used for Terminet 300's. .PP If a form-feed/vertical tab delay is specified, it lasts for about 2 seconds. .PP Carriage-return delay type 1 lasts about .08 seconds and is suitable for the Terminet 300. Delay type 2 lasts about .16 seconds and is suitable for the VT05 and the TI 700. Delay type 3 is suitable for the concept-100 and pads lines to be at least 9 characters at 9600 baud. .PP New-line delay type 1 is dependent on the current column and is tuned for Teletype model 37's. Type 2 is useful for the VT05 and is about .10 seconds. Type 3 is unimplemented and is 0. .PP Tab delay type 1 is dependent on the amount of movement and is tuned to the Teletype model 37. Type 3, called XTABS, is not a delay at all but causes tabs to be replaced by the appropriate number of spaces on output. .PP Input characters with the wrong parity, as determined by bits 200 and 100, are ignored in cooked and CBREAK mode. .PP RAW disables all processing save output flushing with LFLUSHO; full 8 bits of input are given as soon as it is available; all 8 bits are passed on output. A break condition in the input is reported as a null character. If the input queue overflows in raw mode it is discarded; this applies to both new and old drivers. .PP CRMOD causes input carriage returns to be turned into new-lines; input of either CR or LF causes LF-CR both to be echoed (for terminals with a new-line function). .PP CBREAK is a sort of half-cooked (rare?) mode. Programs can read each character as soon as typed, instead of waiting for a full line; all processing is done except the input editing: character and word erase and line kill, input reprint, and the special treatment of \e or EOT are disabled. .PP TANDEM mode causes the system to produce a stop character (default ^S) whenever the input queue is in danger of overflowing, and a start character (default ^Q) when the input queue has drained sufficiently. It is useful for flow control when the `terminal' is really another computer which understands the conventions. .LP .Ul "Basic ioctls" .PP In addition to the TIOCSETD and TIOCGETD disciplines discussed in \fBLine disciplines\fR above, a large number of other .IR ioctl (2) calls apply to terminals, and have the general form: .PP .B #include .PP .B ioctl(fildes, code, arg) .br .B struct sgttyb *arg; .PP The applicable codes are: .IP TIOCGETP 15 Fetch the basic parameters associated with the terminal, and store in the pointed-to \fIsgttyb\fR structure. .IP TIOCSETP Set the parameters according to the pointed-to \fIsgttyb\fR structure. The interface delays until output is quiescent, then throws away any unread characters, before changing the modes. .IP TIOCSETN Set the parameters like TIOCSETP but do not delay or flush input. Input is not preserved, however, when changing to or from RAW. .PP With the following codes the .I arg is ignored. .IP TIOCEXCL 15 Set \*(lqexclusive-use\*(rq mode: no further opens are permitted until the file has been closed. .IP TIOCNXCL Turn off \*(lqexclusive-use\*(rq mode. .IP TIOCHPCL When the file is closed for the last time, hang up the terminal. This is useful when the line is associated with an ACU used to place outgoing calls. .IP TIOCFLUSH All characters waiting in input or output queues are flushed. .LP The remaining calls are not available in vanilla version 7 UNIX. In cases where arguments are required, they are described; \fIarg\fR should otherwise be given as 0. .IP TIOCSTI 15 the argument is the address of a character which the system pretends was typed on the terminal. .IP TIOCSBRK 15 the break bit is set in the terminal. .IP TIOCCBRK the break bit is cleared. .IP TIOCSDTR data terminal ready is set. .IP TIOCCDTR data terminal ready is cleared. .IP TIOCGPGRP arg is the address of a word into which is placed the process group number of the control terminal. .IP TIOCSPGRP arg is a word (typically a process id) which becomes the process group for the control terminal. .IP FIONREAD returns in the long integer whose address is arg the number of immediately readable characters from the argument unit. This works for files, pipes, and terminals, but not (yet) for multiplexed channels. .LP .Ul Tchars .PP The second structure associated with each terminal specifies characters that are special in both the old and new terminal interfaces: The following structure is defined in .IR , which is automatically included in .IR : .PP .nf .ft 3 .ta .5i 1i 2i struct tchars { char t_intrc; /* interrupt */ char t_quitc; /* quit */ char t_startc; /* start output */ char t_stopc; /* stop output */ char t_eofc; /* end-of-file */ char t_brkc; /* input delimiter (like nl) */ }; .DT .fi .ft R .PP The default values for these characters are ^?, ^\e\|, ^Q, ^S, ^D, and \-1. A character value of \-1 eliminates the effect of that character. The .I t_brkc character, by default \-1, acts like a new-line in that it terminates a `line,' is echoed, and is passed to the program. The `stop' and `start' characters may be the same, to produce a toggle effect. It is probably counterproductive to make other special characters (including erase and kill) identical. The applicable ioctl calls are: .IP TIOCGETC 12 Get the special characters and put them in the specified structure. .IP TIOCSETC 12 Set the special characters to those given in the structure. .LP .Ul "Local mode" .PP The third structure associated with each terminal is a local mode word; except for the LNOHANG bit, this word is interpreted only when the new driver is in use. The bits of the local mode word are: .sp .nf LCRTBS 000001 Backspace on erase rather than echoing erase LPRTERA 000002 Printing terminal erase mode LCRTERA 000004 Erase character echoes as backspace-space-backspace LTILDE 000010 Convert ~ to \` on output (for Hazeltine terminals) LMDMBUF 000020 Stop/start output when carrier drops LLITOUT 000040 Suppress output translations LTOSTOP 000100 Send SIGTTOU for background output LFLUSHO 000200 Output is being flushed LNOHANG 000400 Don't send hangup when carrier drops LETXACK 001000 Diablo style buffer hacking (unimplemented) LCRTKIL 002000 BS-space-BS erase entire line on line kill LINTRUP 004000 Generate interrupt SIGTINT when input ready to read LCTLECH 010000 Echo input control chars as ^X, delete as ^? LPENDIN 020000 Retype pending input at next read or input character LDECCTQ 040000 Only ^Q restarts output after ^S, like DEC systems .fi .sp The applicable .I ioctl functions are: .IP TIOCLBIS 15 arg is the address of a mask which is the bits to be set in the local mode word. .IP TIOCLBIC arg is the address of a mask of bits to be cleared in the local mode word. .IP TIOCLSET arg is the address of a mask to be placed in the local mode word. .IP TIOCLGET arg is the address of a word into which the current mask is placed. .LP .Ul "Local special chars" .PP The final structure associated with each terminal is the .I ltchars structure which defines interrupt characters for the new terminal driver. Its structure is: .nf .sp .ta .5i 1i 2i .ft B struct ltchars { char t_suspc; /* stop process signal */ char t_dstopc; /* delayed stop process signal */ char t_rprntc; /* reprint line */ char t_flushc; /* flush output (toggles) */ char t_werasec; /* word erase */ char t_lnextc; /* literal next character */ }; .ft R .fi .sp The default values for these characters are ^Z, ^Y, ^R, ^O, ^W, and ^V. A value of \-1 disables the character. .PP The applicable \fIioctl\fR functions are: .IP TIOCSLTC 12 args is the address of a .I ltchars structure which defines the new local special characters. .IP TIOCGLTC 12 args is the address of a .I ltchars structure into which is placed the current set of local special characters. .SH FILES /dev/tty .br /dev/tty* .br /dev/console .SH SEE ALSO csh(1), stty(1), ioctl(2), signal(2), sigsys(2), stty(2), getty(8), init(8), newtty(4) .SH BUGS Half-duplex terminals are not supported. -1 disables the character. .PP The applicable \fIioctl\fR functions are: .IP TIOCSLTC 12 args is the address of a .I ltchars structure which defines the new local special characters. .IP TIOCGLTC 12 args is the address of a .I ltchars structure into which iman/man4/up.4 664 0 33 12206 2527203003 6172 .TH UP 4 5/10/81 .UC 4 .SH NAME up \- unibus storage module controller/drives .SH SYNOPSIS controller sc0 at uba? csr 0176700 vector upintr .br disk up0 at sc0 drive 0 .SH DESCRIPTION This is a generic UNIBUS storage module disk driver. It is specifically designed to work with the Emulex SC-21 controller and Ampex or CDC 300M or Fujitsu 160M drives. It can be easily adapted to other drives and controllers (although bootstrapping will not necessarily be directly possible.) .PP Files with minor device number((s 0 through 7 refer to various portions of drive 0; minor devices 8 through 15 refer to drive 1, etc. The standard device names begin with ``up'' followed by the drive number and then a letter a-h for partitions 0-7 respectively. The character ? stands here for a drive number in the range 0-7. .PP The origin and size of the pseudo-disks on each drive are as follows: .PP .nf .ta .5i +\w'000000 'u +\w'000000 'u +\w'000000 'u AMPEX/CDC 300M drive partitions: disk start length cyl up?a 0 15884 0-26 up?b 16416 33440 27-81 up?c 0 495520 0-814 up?d 341696 15884 562-588 up?e 358112 55936 589-680 up?f 414048 81472 681-814 up?g 341696 153824 562-814 up?h 49856 291346 82-561 .PP FUJITSU 160M drive partitions: disk start length cyl up?a 0 15884 0-49 up?b 16000 33440 50-154 up?c 0 263360 0-822 up?h 49600 213760 155-822 .DT .fi .PP It is unwise for all of these files to be present in one installation, since there is overlap in addresses and protection becomes a sticky matter. The up?a partition is normally used for the root file system, the up?b partition as a paging area, and the up?c partition for pack-pack copying (it maps the entire disk). On 160M drives the up?h partition maps the rest of the pack. On 300M drives both up?g and up?h are used to map the remaining cylinders. .PP The block files access the disk via the system's normal buffering mechanism and may be read and written without regard to physical disk records. There is also a `raw' interface which provides for direct transmission between the disk and the user's read or write buffer. A single read or write call results in exactly one I/O operation and therefore raw I/O is considerably more efficient when many words are transmitted. The names of the raw files conventionally begin with an extra `r.' .PP In raw I/O counts should be a multiple of 512 bytes (a disk sector). Likewise .I seek calls should specify a multiple of 512 bytes. .SH FILES /dev/up[0-7][a-h] block files .br /dev/rup[0-7][a-h] raw files .SH SEE ALSO hk(4), hp(4) .SH DIAGNOSTICS \fBup%d%c: hard error sn%d cs2=%b er1=%b er2=%b\fR. An unrecoverable error occured during transfer of the specified sector of the specified disk partition. The contents of the cs2, er1 and er2 registers are printed in octal and symbolically with bits decoded. The error was either unrecoverable, or a large number of retry attempts (including offset positioning and drive recalibration) could not recover the error. .PP \fBup%d: write locked\fR. The write protect switch was set on the drive when a write was attempted. The write operation is not recoverable. .PP \fBup%d: not ready\fR. The drive was spun down or off line when it was accessed. The i/o operation is not recoverable. .PP \fBup%d: not ready (came back!)\fR. The drive was not ready, but after printing the message about being not ready (which takes a fraction of a second) was ready. The operation is recovered if no further errors occur. .PP \fBup%d%c: soft ecc sn%d\fR. A recoverable ECC error occurred on the specified sector of the specified disk partition. This happens normally a few times a week. If it happens more frequently than this the sectors where the errors are occuring should be checked to see if certain cylinders on the pack, spots on the carriage of the drive or heads are indicated. .PP \fBsc%d: lost interrupt\fR. A timer watching the controller detecting no interrupt for an extended period while an operation was outstanding. This indicates a hardware or software failure. There is currently a hardware/software problem with spinning down drives while they are being accessed which causes this error to occur. The error causes a UNIBUS reset, and retry of the pending operations. If the controller continues to lose interrupts, this error will recur a few seconds later. .SH BUGS In raw I/O .I read and .IR write (2) truncate file offsets to 512-byte block boundaries, and .I write scribbles on the tail of incomplete blocks. Thus, in programs that are likely to access raw devices, .I read, write and .IR lseek (2) should always deal in 512-byte multiples. .PP DEC-standard error logging and bad block forwarding should be supported; the code to do this could be easily incorporated from the .IR hp (4) driver. All that would be needed then would be a stand-alone formatting program to detect the bad sectors, format the disk so that the sectors were marked bad and initialize the bad sector files. .PP A program to analyze the logged error information (even in its present reduced form) is needed. .PP The partition tables for the file systems should be read off of each pack, as they are never quite what any single installation would prefer, and this would make packs more portable. porated from the .IR hp (4) driver. All that would be needed then would be a stand-alone formatting program to detect the bad sectors, format the disk so that the sectors were marked bad and initialize the bad sector files. .PP A program to analyze the logged error information (even in its present reduced form) is needed. .PP The partition tables for the file systems should man/man4/va.4 644 0 33 7032 2512730617 6145 .TH VA 4 4/1/81 .UC 4 .SH NAME va \- Benson-Varian interface .SH SYNOPSIS device va0 at uba? csr 0164000 vector vaintr .SH DESCRIPTION The Benson-Varian printer/plotter in normally used with the programs .IR vpr (1), .IR vprint (1) or .IR vtroff (1). This description is designed for those who wish to drive the Benson-Varian directly. .PP The Benson-Varian at Berkeley uses 11\*(rq by 8\*(rq fan-fold paper. It will print 132 characters per line in print mode and 2112 dots per line in plot mode. .PP In print mode, the Benson-Varian uses a modified ASCII character set. Most control characters print various non-ASCII graphics such as daggers, sigmas, copyright symbols, etc. Only LF and FF are used as format effectors. LF acts as a newline, advancing to the beginning of the next line, and FF advances to the top of the next page. .PP In plot mode, the Benson-Varian prints one raster line at a time. An entire raster line of bits (2112 bits = 264 bytes) is sent, and then the Benson-Varian advances to the next raster line. .PP .B Note: The Benson-Varian must be sent an even number of bytes. If an odd number is sent, the last byte will be lost. Nulls can be used in print mode to pad to an even number of bytes. .PP To use the Benson-Varian yourself, you must realize that you cannot open the device, .I /dev/va0 if there is a daemon active. You can see if there is a daemon active by doing a .IR ps (1), or by looking in the directory .I /usr/spool/vad. If there is a file .I lock there, then there is probably a daemon .IR /usr/lib/vad running. If not, you should remove the .I lock. .PP In any case, when your program tries to open the device .I /dev/va0 you may get one of two errors. The first of these ENXIO indicates that the Benson-Varian is already in use. Your program can then .IR sleep (2) and try again in a while, or give up. The second is EIO and indicates that the Benson-Varian is offline. .PP To set the Benson-Varian into plot mode, ``#include '' and use the following .IR ioctl (2) call .IP ioctl(fileno(va), VSETSTATE, plotmd); .PP where .B plotmd is defined to be .IP \fBint\fR plotmd[] = { VPLOT, 0, 0 }; .PP and .I va is the result of a call to .I fopen on stdio. When you finish using the Benson-Varian in plot mode you should advance to a new page by sending it a FF after putting it back into print mode, i.e. by .PP 'nf \fBint\fR prtmd[] = { VPRINT, 0, 0 }; \&... fflush(va); ioctl(fileno(va), VSETSTATE, prtmd); write(fileno(va), "\ef\e0", 2); .fi .PP .IR N.B. : If you use the standard I/O library with the Benson-Varian you .B must do .IP setbuf(vp, vpbuf); .PP where .I vpbuf is declared .IP \fBchar\fR vpbuf[BUFSIZ]; .PP otherwise the standard I/O library, thinking that the Benson-Varian is a terminal (since it is a character special file) will not adequately buffer the data you are sending to the Benson-Varian. This will cause it to run .B extremely slowly and tend to grind the system to a halt. .SH FILES /dev/va0 .br /usr/include/sys/vcmd.h .SH SEE ALSO vfont(5), vpr(1), vtroff(1), vp(4) .SH DIAGNOSTICS \fBva%d: npr timeout\fR. The device was not able to get data from the UNIBUS within the timeout period, most likely because some other device was hogging the bus. (But see BUGS below). .SH BUGS The 1's (one's) and l's (lower-case el's) in the Benson-Varian's standard character set look very similar; caution is advised. .PP The interface hardware is rumored to have problems which can play havoc with the UNIBUS. We have intermittent minor problems on the UNIBUS where our va lives, but haven't ever been able to pin them down completely. evice was not able to get data from the UNIBUS within the timeout period, most likely because some other device was hogging the bus. (But see BUGS below). .SH BUGS The 1's (one's) and l's (lower-case el's) in the Benson-Varian's standard character set look very similar; caution is advised. .PP The interface hardware is rumored to have problems which can play havoc with the UNIBUS. We have intermittent minor problems on the UNIBUS where our va lives, but haven't ever been able to man/man4/vp.4 644 0 33 5677 2531446276 6207 ((.TH VP 4 5/10/81 .UC 4 .SH NAME vp \- Versatec interface .SH SYNOPSIS device vp0 at uba? csr 0177510 vector vpintr vpintr .SH DESCRIPTION The Versatec printer/plotter is normally used with the programs .IR vpr (1), .IR vprint (1) or .IR vtroff (1). This description is designed for those who wish to drive the Versatec directly. .PP The Versatec at Berkeley is 36\*(rq wide, and has 440 characters per line and 7040 dots per line in plot mode (this is actually slightly less than 36\*(rq of dots.) The paper used is continuous roll paper, and comes in 500' rolls. .PP To use the Versatec yourself, you must realize that you cannot open the device, .I /dev/vp0 if there is a daemon active. You can see if there is a daemon active by doing a .IR ps (1), or by looking in the directory .I /usr/spool/vpd. If there is a file .I lock there, then there is probably a daemon .IR /usr/lib/vpd running. If not, you should remove the .I lock. .PP In any case, when your program tries to open the device .I /dev/vp0 you may get one of two errors. The first of these ENXIO indicates that the Versatec is already in use. Your program can then .IR sleep (2) and try again in a while, or give up. The second is EIO and indicates that the Versatec is offline. .PP To set the Versatec into plot mode you should include and use the .IR ioctl (2) call .IP ioctl(fileno(vp), VSETSTATE, plotmd); .PP where .B plotmd is defined to be .IP \fBint\fR plotmd[] = { VPLOT, 0, 0 }; .PP and .I vp is the result of a call to .I fopen on stdio. When you finish using the Versatec in plot mode you should eject paper by sending it a EOT after putting it back into print mode, i.e. by .PP 'nf \fBint\fR prtmd[] = { VPRINT, 0, 0 }; \&... fflush(vp); ioctl(fileno(vp), VSETSTATE, prtmd); write(fileno(vp), "\e04", 1); .fi .PP .IR N.B. : If you use the standard I/O library with the Versatec you .B must do .IP setbuf(vp, vpbuf); .PP where .I vpbuf is declared .IP \fBchar\fR vpbuf[BUFSIZ]; .PP otherwise the standard I/O library, thinking that the Versatec is a terminal (since it is a character special file) will not adequately buffer the data you are sending to the Versatec. This will cause it to run .B extremely slowly and tends to grind the system to a halt. .SH FILES /dev/vp0 .SH SEE ALSO vfont(5), vpr(1), vtroff(1), va(4) .SH DIAGNOSTICS None. .SH BUGS The configuration part of the driver assumes that the device is setup to vector print mode through 0174 and plot mode through 0200. Since the driver doesn't care whether the device considers the interrupt to be a print or a plot interrupt, it would be preferable to have these be the same. This since the configuration program can't be sure at boot time which vector interrupted and where the interrupt vectors actually are. For the time being, since our versatec is vectored as described above, we specify that it has two interrupt vectors and are careful to detect an interrupt through 0200 at boot time and (manually) pretend the interrupt came through 0174. esn't care whether the device considers the interrupt to be a priman/man4/autoconf.4 664 0 33 10432 2662074452 7401 .TH AUTOCONF 4 10/8/81 .UC 4 .SH NAME autoconf \- diagnostics from autoconfiguration code .SH DESCRIPTION When UNIX bootstraps it probes the innards of the machine it is running on and locates controllers, drives, and other devices, printing out what it finds on the console. This procedure is driven by a system configuration table which is processed by .IR config (8) and compiled into each kernel. .PP Devices in NEXUS slots are normally noted, thus memory controllers, UNIBUS and MASSBUS adaptors. Devices which are not supported which are found in NEXUS slots are noted also. .PP MASSBUS devices are located by a very deterministic procedure since MASSBUS space is completely probable very easily. If devices exist which are not configured they will be silently ignored; if devices exist of unsupported type they will be noted. .PP UNIBUS devices are located by probing to see if their control-status registers respond. If not, they are silently ignored. If the control status register responds but the device cannot be made to interrupt, a diagnostic warning will be printed on the console and the device will not be available to the system. (A command .IR attach (8) is planned to cause the device to be attached irregardless of its failure to interrupt, after the system is bootstrapped, for irksome devices. This is not in as of this writing, however.) .PP A generic system may be built which picks its root device at boot time as the ``best'' available device (MASSBUS disks are better than SMD UNIBUS disks are better than RK07's; the device must be drive 0 to be considered.) If such a system is booted with the RB_ASKNAME option of (see .IR reboot (2V)), then the name of the root device is read from the console terminal at boot time, and any available device may be used. .SH SEE ALSO config(8) .SH DIAGNOSTICS \fBcpu type %d not configured\fR. You tried to boot UNIX on a cpu type which it doesn't (or at least this compiled version of UNIX doesn't) understand. .PP \fBmba%d at tr%d\fR. A MASSBUS adapter was found in tr%d (the NEXUS slot number). UNIX will call it mba%d. .PP \fB%d mba's not configured\fR. More MASSBUS adapters were found on the machine than were declared in the machine configuration; the excess MASSBUS adapters will not be accessible. .PP \fBuba%d at tr%d\fR. A UNIBUS adapter was found in tr%d (the NEXUS slot number). UNIX will call it uba%d. .PP \fBdr32 unsupported (at tr %d)\fR. A DR32 interface was found in a NEXUS, for which UNIX does not have a driver. .PP \fBmcr%d at tr%d\fR. A memory controller was found in tr%d (the NEXUS slot number). UNIX will call it mcr%d. .PP \fB5 mcr's unsupported\fR. UNIX supports only 4 memory controllers per cpu. .PP \fBmpm unsupported (at tr%d)\fR. Multi-port memory is unsupported in the sense that UNIX does not know how to poll it for ECC errors. .PP \fB%s%d at mba%d drive %d\fR. A tape formatter or a disk was found on the MASSBUS; for disks %s%d will look like ``hp0'', for tape formatters like ``ht1'' or ``mt1''. The drive number comes from the unit plug on the drive or in the TM formatter (\fBnot\fR on the tape drive; see below). .PP \fB%s%d at %s%d slave %d\fR. (For MASSBUS devices). Which would look like ``tu0 at ht0 slave 0'' or ``mu0 at mt0 slave 0'', where \fBtu0\fR or \fBmu0\fR is the name for the tape device and \fBht0\fR or \fBmt0\fR is the name for the formatter. A tape slave was found on the tape formatter at the indicated drive number (on the front of the tape drive). UNIX will call the device, e.g., \fBtu0\fR or \fBmu0\fR. .PP \fB%s%d at uba%d csr %o vec %o ipl %x\fR. The device %s%d, e.g. dz0 was found on uba%d at control-status register address %o and with device vector %o. The device interrupted at priority level %x. .PP \fB%s%d at uba%d csr %o zero vector\fR. The device did not present a valid interrupt vector, rather presented 0 (a passive release condition) to the adapter. .PP \fB%s%d at uba%d csr %o didn't interrupt\fR. The device did not interrupt, likely because it is broken, hung, or not the kind of device it is advertised to be. .PP \fB%s%d at %s%d slave %d\fR. (For UNIBUS devices). Which would look like ``up0 at sc0 slave 0'', where \fBup0\fR is the name of a disk drive and \fBsc0\fR is the name of the controller. Analogous to MASSBUS case. .SH BUGS Should write .IR attach (8) and system call it needs to work. resented 0 (a passive release condition) to the adapter. .PP \fB%s%d at uba%d csr %o didn't interrupt\fR. The device did not interrupt, likely because it is broken, hung, or not the kind of device it is advertised to be. .PP \fB%man/man4/dn.4 664 331 33 4274 2662074453 6223 .TH DN 4 12/2/81 .UC 4 .SH NAME dn \- dn-11 automatic calling unit interface .SH SYNOPSIS device dn0 at uba0 csr 0175200 vector dnintr .SH DESCRIPTION A dn-11 is a controller for an automatic calling unit (ACU). With a dn-11, a call unit, and a modem a computer may dial a telephone number and establish a data link. Hardware supporting this interface includes the DEC DN11 and Able Quadracall controllers working with either Bell 801 or Racal/Vadic 801 or 811 call units. .PP A dn-11 interface can control as many as four call units. In normal operation a data link is established by opening the file associated with a call unit, sending the desired phone number in a single .IR write (2) operation, then opening the terminal line attached to the appropriate outgoing modem. If the phone call was successful and the remote host presented a carrier signal, the open on the terminal line should be successful. At this point the call unit should be closed and a link has been established. This sequence is normally performed for the user by one of .IR cu (1), .IR uucp (1), or .IR dnd (8). .PP Each controller/call unit pair has different programming characteristics which impact the programmer; the dn-11 interface presents a .I "raw interface" rather than imbed local dependencies in the device driver. For example, the Racal/Vadic 811 call unit is multiplexed, providing the user with the ability to place phones calls on as many as 64 separate phone lines from a single interface. This multiplexing is carried out based on the ((first two digits of the phone number presented by the user (the first digit selects the modem's rack and modem type, while the second digit selects the specific modem in the rack). .PP The legal dn-11 dial codes are: \fB0-9\fP, \fB*\fP (\fB:\fP is a synonym), \fB#\fP (\fB;\fP is a synonym), \fB=\fP (\fBw\fP is a synonym), and \fB\-\fP. A phone number may optionally be terminated with a \fB<\fP or \fBe\fP. Phone numbers may be no more than 40 characters long. .PP By convention /dev/cu[al]0 are connected to a 300 baud interface, while /dev/cu[al]1 provides a 1200 baud interface. .SH FILES .DT /dev/cua[0-9] ACU interfaces .br /dev/cul[0-9] associated outgoing terminal line .SH "SEE ALSO" rv(4) legal dn-11 dial codes are: \fB0-9\fP, \fB*\fP (\fB:\fP is a synonym), \fB#\fP (\fB;\fP is a synonym), \fB=\fP (\fBw\fP is a synonym), and \fB\-\fP. A phone number may optionally be terminated with a \fB<\fP or \fBe\fP. Phone numbers may be no more than 40 characters long. .PP By convention /dev/cu[al]0 are connected to aman/man4/mtop.4 664 331 33 7454 2662074454 6605 .TH MTOP 4 10/8/81 .UC 4 .SH NAME mt \- UNIX magtape interface .SH DESCRIPTION The files .I "mt0, ..., mt15" refer to the UNIX magtape drives, which may be on the MASSBUS using the TM03 or TM78 formatters .IR ht (4) or .IR mt (4), or on the UNIBUS using either the TM11, TS11, or TU45 formatters .IR tm (4), .IR ts (4) or .IR ut (4). The following description applies to any of the transport/controller pairs. The files .I "mt0, ..., mt7" are low density, and .I "mt8, ..., mt15" are high density. On the TM03 and TM11 low density is 800bpi and high density is 1600bpi. On the TM78 low density is 1600bpi and high density is 6250bpi. On the TS11 both low and high density are 1600bpi. The files .I "mt0, ..., mt3" and .I "mt8, ..., mt11" are rewound when closed; the others are not. When a file open for writing is closed, two end-of-files are written. If the tape is not to be rewound it is positioned with the head between the two tapemarks. .PP A standard tape consists of a series of 1024 byte records terminated by an end-of-file. To the extent possible, the system makes it possible, if inefficient, to treat the tape like any other file. Seeks have their usual meaning and it is possible to read or write a byte at a time. Writing in very small units is inadvisable, however, because it tends to create monstrous record gaps. .PP The .I mt files discussed above are useful when it is desired to access the tape in a way compatible with ordinary files. When foreign tapes are to be dealt with, and especially when long records are to be read or written, the `raw' interface is appropriate. The associated files are named .I "rmt0, ..., rmt15," but the same minor-device considerations as for the regular files still apply. A number of other ioctl operations are available on raw magnetic tape. The following definitions are from : .PP .nf /* * Structures and definitions for mag tape io control commands */ /* mag tape io control commands */ #define MTIOCTOP (('m'<<8)|1) /* do a mag tape op */ #define MTIOCGET (('m'<<8)|2) /* get mag tape status */ /* structure for MTIOCTOP - mag tape op command */ struct mtop { short mt_op; /* operations defined below */ daddr_t mt_count; /* how many of them */ }; /* operations */ #define MTWEOF 0 /* write an end-of-file record */ #define MTFSF 1 /* forward space file */ #define MTBSF 2 /* backward space file */ #define MTFSR 3 /* forward space record */ #define MTBSR 4 /* backward space record */ #define MTREW 5 /* rewind */ #define MTOFFL 6 /* rewind and put the drive offline */ #define MTNOP 7 /* no operation, sets status only */ /* structure for MTIOCGET - mag tape get status command */ struct mtget { short mt_type; /* type of magtape device */ /* the following two registers are grossly device dependent */ short mt_dsreg; /* ``drive status'' register */ short mt_erreg; /* ``error'' register */ /* end device-dependent registers */ short mt_resid; /* residual count */ /* the following two are not yet implemented */ daddr_t mt_fileno; /* file number of current position */ daddr_t mt_blkno; /* block number of current position */ /* end not yet implemented */ }; /* * Constants for mt_type byte */ #define MT_ISTS 01 #define MT_ISHT 02 #define MT_ISTM 03 #define MT_ISMT 04 #define MT_ISUT 05 .fi .ft R .PP Each .I read or .I write call reads or writes the next record on the tape. In the write case the record has the same length as the buffer given. During a read, the record size is passed back as the number of bytes read, provided it is no greater than the buffer size; if the record is long, an error is indicated. In raw tape I/O seeks are ignored. A zero byte count is returned when a tape mark is read, but another read will fetch the first record of the new tape file. .SH FILES /dev/mt?, /dev/rmt? .SH "SEE ALSO" mt(1), tar(1), tp(1), ht(4), mt(4), tm(4), ts(4) .SH BUGS n the tape. In the write case the record has the same length as the buffer given. During a read, the record size is passed back as the number of bytes read, provided it is no greater than the buffer size; if the man/man4/ra.4 664 331 33 10571 2662074455 6243 .TH RA 4 10/8/81 .UC 4 .SH NAME ra \- UDA50/RA80 Unibus disk controller and drives .SH SYNOPSIS controller uda0 at uba? csr 0177550 vector udintr .br disk ra0 at uda0 drive 0 .SH DESCRIPTION The UDA50 is an intelligent disk controller for the UNIBUS. It supports the RA80 124MB disk drive. .PP Files with minor device numbers 0 through 7 refer to various portions of drive 0; minor devices 8 through 15 refer to drive 1, etc. The standard device names begin with ``ra'' followed by the drive number and then a letter a-h for partitions 0-7 respectively. The character ? stands here for a drive number in the range 0-7. .PP The origin and size of the pseudo-disks on each drive are as follows: .PP .nf .ta .5i +\w'000000 'u +\w'000000 'u RA80 124M drive partitions: disk start length ra?a 0 15884 ra?b 15884 33440 ra?c 0 237298 ra?d 0 0 ra?e 0 0 ra?f 0 0 ra?g 49324 82080 ra?h 131404 105994 .DT .fi .PP It is unwise for all of these files to be present in one installation, since there is overlap in addresses and protection becomes a sticky matter. The ra?a partition is normally used for the root file system, the ra?b partition as a paging area, and the ra?c partition for pack-pack copying (it maps the entire disk). Both ra?g and ra?h are used to map the remaining cylinders. .PP The block files access the disk via the system's normal buffering mechanism and may be read and written without regard to physical disk records. There is also a `raw' interface which provides for direct transmission between the disk and the user's read or write buffer. A single read or write call results in exactly one I/O operation and therefore raw I/O is considerably more efficient when many words are transmitted. The names of the raw files conventionally begin with an extra `r.' .PP In raw I/O counts should be a multiple of 512 bytes (a disk sector). Likewise .I seek calls should specify a multiple of 512 bytes. .SH FILES /dev/ra[0-7][a-h] block files .br /dev/rra[0-7][a-h] raw files .SH SEE ALSO hk(4), hp(4), up(4) .SH DIAGNOSTICS \fBra%d%c: hard error sn%d udasa %o, state %d\fR. .br \fBra%d%c: hard error sn%d status %o\fR. An unrecoverable error occured during transfer of the specified sector of the specified disk partition. The contents of the udasa register are printed in octal and symbolically with bits decoded. The internal state is also printed. In the second form, the MSCP status is printed. The error was either unrecoverable, or a large number of retry attempts (including offset positioning and drive recalibration) could not recover the error. .PP \fBra%d%c: hard error sn%d OFFLINE\fR. The drive was spun down or off line when it was accessed. The i/o operation is not recoverable. .PP \fBuda%d: random interrupt ignored\fR. The UDA received an interrupt before it was initialized. .PP \fBuda%d: fatal error (%o)\fR. A fatal error was noticed in the UDA interrupt routine. The contents of udasa are printed. The controller will be reinitialized. .PP \fBuda%d: [soft|hard] error, controller error, event 0%o\fR. .br \fBuda%d: [soft|hard] error, host memory access error, event 0%o, addr 0%o\fR. .br \fBuda%d: [soft|hard] error, disk transfer error, unit %d, grp %d, cyl %d, sec %d, trk %d, lbn %d, retry %d, level %d\fR. .br \fBuda%d: [soft|hard] error, SDI error, unit %d, event 0%o, cyl %d\fR. .br \fBuda%d: [soft|hard] error, small disk error, unit %d, event 0%o, cyl %d\fR. .br \fBuda%d: [soft|hard] error, unknown error, unit %d, format 0%o, event 0%o\fR. .br See the driver and the UDA and MSCP manuals. .SH BUGS In raw I/O .I read and .IR write (2) truncate file offsets to 512-byte block boundaries, and .I write scribbles on the tail of incomplete blocks. Thus, in programs that are likely to access raw devices, .I read, write and .IR lseek (2) should always deal in 512-byte multiples. .PP A program to analyze the logged error information (even in its present reduced form) is needed. Error messages should be more consistent. .PP The partition tables for the file systems should be read off of each pack, as they are never quite what any s((ingle installation would prefer, and this would make packs more portable. .PP Dumps to the swap area on system crashes are not implemented. .PP Booting via block zero is not (and will not be) supported. The ``boot'' program must be loaded from the console storage device. .PP Although the device supports unit numbers up to 255, the driver only supports unit numbers up to 7. d be more consistent. .PP The partition tables for the file systems should be read off of each pack, as they are never quite what any sman/man4/tu.4 664 331 33 1400 2662074457 6242 .TH TU 4 10/8/81 .UC 4 .SH NAME tu \- console TU58 interface .SH DESCRIPTION .PP This is a simple interface to the TU58 cassette tape unit, which is part of the console subsytem for VAX-11/750's. Access is given to the entire tape consisting of 1024 blocks of 512 bytes. .PP The TU58 behaves like a disk but has only a block interface (no raw). The cassette is commonly accessed via the .IR arff (8) command, using the `m' flag. .SH FILES /dev/floppy .SH SEE ALSO arff(8) .SH DIAGNOSTICS Lots, mostly cryptic. Read the driver. .SH BUGS The driver is very unreliable due to the nature of the TU58 interface. The TU58 should be used only when the system is in single-user mode, since it is often necessary to reboot the system to unhang the process accessing the TU58. of 512 bytes. .PP The TU58 behaves like a disk but has only a block interface (no raw). The cassette is commonly accessed via the .IR arff (8) command, using the `m' flag. .SH FILES /dev/floppy .SH SEE ALSO arff(8) .SH DIAGNOSTICS Lots, mostly cryptic. Rman/man5/ 775 0 33 0 2512730634 5365 man/man5/a.out.5 644 0 33 17333 2512730621 6607 .TH A.OUT 5 VAX/11 .UC 4 .SH NAME a.out \- assembler and link editor output .SH SYNOPSIS .B #include .SH DESCRIPTION .I A.out is the output file of the assembler .IR as (1) and the link editor .IR ld (1). Both programs make .I a.out executable if there were no errors and no unresolved external references. Layout information as given in the include file for the VAX-11 is: .nf .ta \w'#define 'u +\w'unsigned 'u +\w'a_dirsize 'u +4n .PP /* .ti +\w'/'u * Header prepended to each a.out file. .ti +\w'/'u */ struct exec { long a_magic; /* magic number */ unsigned a_text; /* size of text segment */ unsigned a_data; /* size of initialized data */ unsigned a_bss; /* size of uninitialized data */ unsigned a_syms; /* size of symbol table */ unsigned a_entry; /* entry point */ unsigned a_trsize; /* size of text relocation */ unsigned a_drsize; /* size of data relocation */ }; #define OMAGIC 0407 /* old impure format */ #define NMAGIC 0410 /* read-only text */ #define ZMAGIC 0413 /* demand load format */ /* .ti +\w'/'u * Macros which take exec structures as arguments and tell whether .ti +\w'/'u * the file has a reasonable magic number or offsets to text\||\|symbols\||\|strings. .ti +\w'/'u */ #define N_BADMAG(x) \e (((x).a_magic)!=OMAGIC && ((x).a_magic)!=NMAGIC && ((x).a_magic)!=ZMAGIC) #define N_TXTOFF(x) \e ((x).a_magic==ZMAGIC ? 1024 : sizeof (struct exec)) #define N_SYMOFF(x) \e (N_TXTOFF(x) + (x).a_text+(x).a_data + (x).a_trsize+(x).a_drsize) #define N_STROFF(x) \e (N_SYMOFF(x) + (x).a_syms) .DT .fi .PP The file has five sections: a header, the program text and data, relocation information, a symbol table and a string table (in that order). The last three may be omitted if the program was loaded with the `\-s' option of .I ld or if the symbols and relocation have been removed by .IR strip (1). .PP In the header the sizes of each section are given in bytes. The size of the header is not included in any of the other sizes. .PP When an .I a.out file is executed, three logical segments are set up: the text segment, the data segment (with uninitialized data, which starts off as all 0, following initialized), and a stack. The text segment begins at 0 in the core image; the header is not loaded. If the magic number in the header is OMAGIC (0407), it indicates that the text segment is not to be write-protected and shared, so the data segment is immediately contiguous with the text segment. This is the oldest kind of executable program and is rarely used. If the magic number is NMAGIC (0410) or ZMAGIC (0413), the data segment begins at the first 0 mod 1024 byte boundary following the text segment, and the text segment is not writable by the program; if other processes are executing the same file, they will share the text segment. For ZMAGIC format, the text segment begins at a 0 mod 1024 byte boundary in the .I a.out file, the remaining bytes after the header in the first block are reserved and should be zero. In this case the text and data sizes must both be multiples of 1024 bytes, and the pages of the file will be brought into the running image as needed, and not pre-loaded as with the other formats. This is especially suitable for very large programs and is the default format produced by .IR ld (1). .PP The stack will occupy the highest possible locations in the core image: growing downwards from .lg 0 0x7ffff000. .lg 1 The stack is automatically extended as required. The data segment is only extended as requested by .IR break (2). .PP After the header in the file follow the text, data, text relocation data relocation, symbol table and string table in that order. The text begins at the byte 1024 in the file for ZMAGIC format or just after the header for the other formats. The N_TXTOFF macro returns this absolute file position when given the name of an exec structure as argument. The data segment is contiguous with the text and immediately followed by the text relocation and then the data relocation information. The symbol table follows all this; its position is computed by the N_SYMOFF macro. Finally, the string table immediately follows the symbol table at a position which can be gotten easily using N_STROFF. The first 4 bytes of the string table are not used for string storage, but rather contain the size of the string table; this size INCLUDES the 4 bytes, the minimum string table size is thus 4. .PP The layout of a symbol table entry and the principal flag values that distinguish symbol types are given in the include file as follows: .PP .nf .ta \w'#define 'u +\w'char'u-1u +\w'unsigned 'u+1u +\w'*n_name 'u /* .ti +\w'/'u * Format of a symbol table entry. .ti +\w'/'u */ struct nlist { union { char *n_name; /* for use when in-core */ long n_strx; /* index into file string table */ } n_un; unsigned char n_type; /* type flag, i.e. N_TEXT etc; see below */ char n_other; short n_desc; /* see */ unsigned n_value; /* value of this symbol (or sdb offset) */ }; #define n_hash n_desc /* used internally by ld */ /* .ti +\w'/'u * Simple values for n_type. .ti +\w'/'u */ #define N_UNDF 0x0 /* undefined */ #define N_ABS 0x2 /* absolute */ #define N_TEXT 0x4 /* text */ #define N_DATA 0x6 /* data */ #define N_BSS 0x8 /* bss */ #define N_COMM 0x12 /* common (internal to ld) */ #define N_FN 0x1f /* file name symbol */ #define N_EXT 01 /* external bit, or'ed in */ #define N_TYPE 0x1e /* mask for all the type bits */ /* .ti +\w'/'u * Other permanent symbol table entries have some of the N_STAB bits set. .ti +\w'/'u * These are given in .ti +\w'/'u */ #define N_STAB 0xe0 /* if any of these bits set, don't discard */ /* .ti +\w'/'u * Format for namelist values. .ti +\w'/'u */ #define N_FORMAT "%08x" .fi .DT .PP In the .I a.out file a symbol's n_un.n_strx field gives an index into the string table. A n_strx value of 0 indicates that no name is associated with a particular symbol table entry. The field n_un.n_name can be used to refer to the symbol name only if the program sets this up using n_strx and appropriate data from the string table. .PP If a symbol's type is undefined external, and the value field is non-zero, the symbol is interpreted by the loader .I ld as the name of a common region whose size is indicated by the value of the symbol. .PP The value of a byte in the text or data which is not a portion of a reference to an undefined external symbol is exactly that value which will appear in memory when the file is executed. If a byte in the text or data involves a reference to an undefined external symbol, as indicated by the relocation information, then the value stored in the file is an offset from the associated external symbol. When the file is processed by the link editor and the external symbol becomes defined, the value of the symbol will be added to the bytes in the file. .PP If relocation information is present, it amounts to eight bytes per relocatable datum as in the following structure: .PP .nf .ta \w'#define 'u +\w'unsigned 'u +\w'r_symbolnum:24, 'u +4n /* .ti +\w'/'u * Format of a relocation datum. .ti +\w'/'u */ struct relocation_info { int r_address; /* address which(( is relocated */ unsigned r_symbolnum:24, /* local symbol ordinal */ r_pcrel:1, /* was relocated pc relative already */ r_length:2, /* 0=byte, 1=word, 2=long */ r_extern:1, /* does not include value of sym referenced */ :4; /* nothing, yet */ }; .fi .DT .PP There is no relocation information if a_trsize+a_drsize==0. If r_extern is 0, then r_symbolnum is actually a n_type for the relocation (i.e. N_TEXT meaning relative to segment text origin.) .fi .SH "SEE ALSO" adb(1), as(1), ld(1), nm(1), sdb(1), stab(5), strip(1) .SH BUGS Not having the size of the string table in the header is a loss, but expanding the header size would have meant stripped executable file incompatibility, and we couldn't hack this just now. enced */ :4; /* nothing, yet */ }; .fi .DT .PP There is no relocation information if a_trsize+a_drsize==0. If r_extern is 0, then r_symbolnum is actually a n_type for the relocation (i.e. N_TEXT meaning relative to segment text origin.) .fi .SH "SEE ALSO" adb(1), as(1), ld(1), nm(1), sdb(1)man/man5/acct.5 644 0 33 1236 2512730621 6446 .TH ACCT 5 .SH NAME acct \- execution accounting file .SH SYNOPSIS .B #include .SH DESCRIPTION .IR Acct (2) causes entries to be made into an accounting file for each process that terminates. The accounting file is a sequence of entries whose layout, as defined by the include file is: .PP .nf .ta \w'typedef 'u +\w'comp_t 'u +\w'ac_comm[10]; 'u .so /usr/include/sys/acct.h .fi .PP If the process does an .IR exec (2), the first 10 characters of the filename appear in .I ac_comm. The accounting flag contains bits indicating whether .IR exec (2) was ever accomplished, and whether the process ever had super-user privileges. .SH SEE ALSO acct(2), sa(1) ounting file for each process that terminates. The accounting file is a sequence of entries whose layout, as defined by the include file is: .PP .nf .ta \w'typedef 'u +\w'comp_t 'u +\w'ac_comm[10]; 'u .so /usr/include/sys/acct.h .fi .PP If the process does an .IR exec (2), the first 10 characters of the filename appear in .I ac_comm. The accounting man/man5/aliases.5 644 0 33 2271 2512730622 7156 .TH ALIASES 5 .UC 4 .SH NAME aliases \- aliases file for delivermail .SH SYNOPSIS .B /usr/lib/aliases .SH DESCRIPTION This file describes user id aliases that will be used by .I /etc/delivermail. It is formatted as a series of lines of the form .in +0.5i name:addr1,addr2,...addrn .in The .I name is the name to alias, and the .I addri are the addresses to send the message to. Lines beginning with white space are continuation lines. Lines beginning with `\|#\|' are comments. .PP Aliasing occurs only on local names. Loops can not occur, since no message will be sent to any person more than once. .PP This is only the raw data file; the actual aliasing information is placed into a binary format in the files /usr/lib/aliases.dir and /usr/lib/aliases.pag using the program .IR newaliases (5). A .I newaliases command should be executed each time the aliases file is changed for the change to take effect. .SH SEE\ ALSO newaliases(1), dbm(3), delivermail(8) .SH BUGS Because of restrictions in .IR dbm (3) a single alias cannot contain more than about 1000 bytes of information. You can get longer aliases by ``chaining''; i.e. make the last name in the alias by a dummy name which is a continuation alias. t in the files /usr/lib/aliases.dir and /usr/lib/aliases.pag using the program .IR newaliases (5). A .I newaliases command should be executed each time the aliases file is changed for the change to take effect. .SH SEE\ ALSO newaliases(1), dbm(3), delivermail(8) .SH BUGS Because of restrictions in .IR dbm (3) a single alias cman/man5/ar.5 644 0 33 3026 2512730622 6136 .TH AR 5 .UC 4 .SH NAME ar \- archive (library) file format .SH SYNOPSIS .B #include .SH DESCRIPTION .IR N.B. : This archive format is new to this distribution. See .IR old (8) and .IR arcv (1) for programs to deal with the old format. .PP The archive command .I ar is used to combine several files into one. Archives are used mainly as libraries to be searched by the link-editor .I ld. .PP A file produced by .I ar has a magic string at the start, followed by the constituent files, each preceded by a file header. The magic number and header layout as described in the include file are: .RS .PP .nf .ta \w'#define 'u +\w'SARMAG 'u .ec % .so /usr/include/ar.h .ec \ .fi .RE .LP The name is a blank-padded string. The .I ar_fmag field contains ARFMAG to help verify the presence of a header. The other fields are left-adjusted, blank-padded numbers. They are decimal except for .IR ar_mode , which is octal. The date is the modification date of the file at the time of its insertion into the archive. .PP Each file begins on a even (0 mod 2) boundary; a new-line is inserted between files if necessary. Nevertheless the size given reflects the actual size of the file exclusive of padding. .PP There is no provision for empty areas in an archive file. .PP The encoding of the header is portable across machines. If an archive contains printable files, the archive itself is printable. .SH "SEE ALSO" ar(1), ld(1), nm(1) .SH BUGS File names lose trailing blanks. Most software dealing with archives takes even an included blank as a name terminator. d 2) boundary; a new-line is inserted between files if necessary. Nevertheless the size given reflects the actual size of the file exclusive of padding. .PP There is no provision for empty areas in an archive file. .PP The encoding of the header is portable across machines. If an archive contains printable files, the archive itself is printable. .SH "SEE ALSO" ar(1), ld(1), nm(1) .SH BUGS File names lose trailing blanks. Most software dealing with archives takes even an included blank man/man5/core.5 644 0 33 2017 2512730623 6464 .TH CORE 5 .UC 4 .SH NAME core \- format of memory image file .SH DESCRIPTION UNIX writes out a memory image of a terminated process when any of various errors occur. See .IR signal (2) for the list of reasons; the most common are memory violations, illegal instructions, bus errors, and user-generated quit signals. The memory image is called `core' and is written in the process's working directory (provided it can be; normal access controls apply). .PP The maximum size of a .I core file is limited by .IR vlimit (2) . Files which would be larger than the limit are not created. .PP The core file consists of the \fIu.\fR area, which currently consists of 6 pages, beginning with a \fIuser\fR structure as given in /usr/include/sys/user.h. The kernel stack grows from the end of this 6 page region. The remainder of the core file consists first of the data pages and then the stack pages of the process image. .PP In general the debugger .IR adb (1) is sufficient to deal with core images. .SH "SEE ALSO" adb(1), signal(2), vlimit(2) es which would be larger than the limit are not created. .PP The core file consists of the \fIu.\fR area, which currently consists of 6 pages, beginning with a \fIuser\fR structure as given in /usr/include/sys/user.h. The kernel stack grows from the end of this 6 page region. The remainder of the core file consists first of the data pages and then the stack pages of the process image. .PP In general the debugger .IR adb (1) is sufficient to deal with core images. .SH "SEE ALSO" adb(1), signalman/man5/dir.5 644 0 33 1614 2512730623 6314 .TH DIR 5 .SH NAME dir \- format of directories .SH SYNOPSIS .B #include .br .B #include .SH DESCRIPTION A directory behaves exactly like an ordinary file, save that no user may write into a directory. The fact that a file is a directory is indicated by a bit in the flag word of its i-node entry; see .IR filsys (5). The structure of a directory entry as given in the include file is: .RS .ta 8n +10n .PP .nf #ifndef DIRSIZ #define DIRSIZ 14 #endif struct direct { ino_t d_ino; char(( d_name[DIRSIZ]; }; .fi .RE .PP By convention, the first two entries in each directory are for `\fB.\fR' and `\fB..\fR'. The first is an entry for the directory itself. The second is for the parent directory. The meaning of `\fB..\fR' is modified for the root directory of the master file system .RB (\*(lq / \*(rq), where `\fB..\fR' has the same meaning as `\fB.\fR'. .SH "SEE ALSO" filsys(5) include file is: .RS .ta 8n +10n .PP .nf #ifndef DIRSIZ #define DIRSIZ 14 #endif struct direct { ino_t d_ino; charman/man5/dump.5 644 0 33 7551 2512730623 6511 .TH DUMP 5 .UC 4 .SH NAME dump, ddate \- incremental dump format .SH SYNOPSIS .B #include .br .B #include .br .B #include .SH DESCRIPTION Tapes used by .I dump and .IR restor (1) contain: .nf .IP "" a header record two groups of bit map records a group of records describing directories a group of records describing files .fi .PP The format of the header record and of the first record of each description as given in the include file .I is: .PP .nf #define NTREC 10 #define MLEN 16 #define MSIZ 4096 #define TS_TAPE 1 #define TS_INODE 2 #define TS_BITS 3 #define TS_ADDR 4 #define TS_END 5 #define TS_CLRI 6 #define MAGIC (int) 60011 #define CHECKSUM (int) 84446 struct spcl { int c_type; time_t c_date; time_t c_ddate; int c_volume; daddr_t c_tapea; ino_t c_inumber; int c_magic; int c_checksum; struct dinode c_dinode; int c_count; char c_addr[BSIZE]; } spcl; struct idates { char id_name[16]; char id_incno; time_t id_ddate; }; #define DUMPOUTFMT "%-16s %c %s" /* for printf */ /* name, incno, ctime(date) */ #define DUMPINFMT "%16s %c %[^\en]\en" /* inverse for scanf */ .fi .PP .I NTREC is the number of 1024 byte records in a physical tape block. .I MLEN is the number of bits in a bit map word. .I MSIZ is the number of bit map words. .PP The .I TS_ entries are used in the .I c_type field to indicate what sort of header this is. The types and their meanings are as follows: .TP 13 TS_TAPE Tape volume label .PD 0 .TP TS_INODE A file or directory follows. The .I c_dinode field is a copy of the disk inode and contains bits telling what sort of file this is. .TP TS_BITS A bit map follows. This bit map has a one bit for each inode that was dumped. .TP TS_ADDR A subrecord of a file description. See .I c_addr below. .TP TS_END End of tape record. .TP TS_CLRI A bit map follows. This bit map contains a zero bit for all inodes that were empty on the file system when dumped. .TP MAGIC All header records have this number in .I c_magic. .TP CHECKSUM Header records checksum to this value. .PD .PP The fields of the header structure are as follows: .TP 13 c_type The type of the header. .PD 0 .TP c_date The date the dump was taken. .TP c_ddate The date the file system was dumped from. .TP c_volume The current volume number of the dump. .TP c_tapea The current number of this (1024-byte) record. .TP c_inumber The number of the inode being dumped if this is of type .I TS_INODE. .TP c_magic This contains the value .I MAGIC above, truncated as needed. .TP c_checksum This contains whatever value is needed to make the record sum to .I CHECKSUM. .TP c_dinode This is a copy of the inode as it appears on the file system; see .IR filsys (5). .TP c_count The count of characters in .I c_addr. .TP c_addr An array of characters describing the blocks of the dumped file. A character is zero if the block associated with that character was not present on the file system, otherwise the character is non-zero. If the block was not present on the file system, no block was dumped; the block will be restored as a hole in the file. If there is not sufficient space in this record to describe all of the blocks in a file, .I TS_ADDR records will be scattered through the file, each one picking up where the last left off. .PD .PP Each volume except the last ends with a tapemark (read as an end of file). The last volume ends with a .I TS_END record and then the tapemark. .PP The structure .I idates describes an entry of the file .I /etc/ddate where dump history is kept. The fields of the structure are: .TP \w'TS_INODE\ 'u id_name The dumped filesystem is .RI `/dev/ id_nam'. .PD 0 .TP id_incno The level number of the dump tape; see .IR dump (1). .TP id_ddate The date of the incremental dump in system format see .IR types (5). .PD .SH FILES /etc/ddate .SH "SEE ALSO" dump(8), dumpdir(8), restor(8), filsys(5), types(5) volume ends with a .I TS_END record and then the tapemark. .PP The structure .I idates describes an entry of the file .I /etc/ddate where dump history man/man5/environ.5 644 0 33 3246 2512730624 7222 .TH ENVIRON 5 .UC 4 .SH NAME environ \- user environment .SH SYNOPSIS .B extern char **environ; .SH DESCRIPTION An array of strings called the `environment' is made available by .IR exec (2) when a process begins. By convention these strings have the form .RI ` name = value '. The following names are used by various commands: .TP "\w'TERMCAP 'u" PATH The sequence of directory prefixes that .I sh, time, .IR nice (1), etc., apply in searching for a file known by an incomplete path name. The prefixes are separated by `:'. .IR Login (1) sets PATH=:/usr/ucb:/bin:/usr/bin. .TP HOME A user's login directory, set by .IR login (1) from the password file .IR passwd (5). .TP TERM The kind of terminal for which output is to be prepared. This information is used by commands, such as .I nroff or .IR plot (1), which may exploit special terminal capabilities. See .I /etc/termcap .RI ( termcap (5)) for a list of terminal types. .TP SHELL The file name of the users login shell. .TP TERMCAP The string describing the terminal in TERM, or the name of the termcap file, see .IR termcap (5), termlib (3). .TP EXINIT A startup list of commands read by .IR ex (1), .IR edit (1), and .IR vi (1). .TP USER The login name of the user. .PP Further names may be placed in the environment by the .I export command and `name=value' arguments in .IR sh (1), or by the .I setenv command if you use .IR csh (1). Arguments may also be placed in the environment at the point of an .IR exec (2). It is unwise to conflict with certain .IR sh (1) variables that are frequently exported by `.profile' files: MAIL, PS1, PS2, IFS. .SH SEE ALSO csh(1), ex(1), login(1), sh(1), exec(2), system(3), termlib(3), termcap(5), term(7) USER The login name of the user. .PP Further names may be placed in the environment by the .I export command and `name=value' arguments in .IR sh (1), or by the .I setenv command if you use .IR csh (1). Arguments may also be placed in the environment at the point of an .IR exec (2). It is unwise to conflict with certain .IR sh (1) variables thman/man5/filsys.5 644 0 33 14752 2512730624 7077 .TH FILSYS 5 .UC 4 .SH NAME filsys, flblk, ino \- format of file system volume .SH SYNOPSIS .B #include .br .B #include .br .B #include .br .B #include .SH DESCRIPTION Every file system storage volume (e.g. RF disk, RK disk, RP disk, DECtape reel) has a common format for certain vital information. Every such volume is divided into a certain number of 1024-byte blocks. Block 0 is unused and is available to contain a bootstrap program, pack label, or other information. .PP Block 1 is the .I "super block." The layout of the super block as defined by the include file .I is: .PP .nf .ta \w'struct 'u +\w'daddr_t 'u +\w's_inode[NICINOD]; 'u .so /usr/include/sys/filsys.h .fi .PP .I S_isize is the address of the first block after the i-list, which starts just after the super-block, in block 2. Thus the i-list is .IR s_isize \-2 blocks long. .I S_fsize is the address of the first block not potentially available for allocation to a file. These numbers are used by the system to check for bad block addresses; if an `impossible' block address is allocated from the free list or is freed, a diagnostic is written on the on-line console. Moreover, the free array is cleared, so as to prevent further allocation from a presumably corrupted free list. .PP The free list for each volume is maintained as follows. The .I s_free array contains, in .I "s_free[1], ... , s_free[s_nfree\-1]," up to NICFREE free block numbers. NICFREE is a configuration constant. .I S_free[0] is the block address of the head of a chain of blocks constituting the free list. The layout of each block of the free chain as defined in the include file .I is: .PP .nf .so /usr/include/sys/fblk.h .fi .PP The fields .I df_nfree and .I df_free in a free block are used exactly like .I s_nfree and .I s_free in the super block. To allocate a block: decrement .I s_nfree, and the new block number is .I s_free[s_nfree]. If the new block address is 0, there are no blocks left, so give an error. I((f .I s_nfree became 0, read the new block into .I s_nfree and .I s_free. To free a block, check if .I s_nfree is NICFREE; if so, copy .I s_nfree and the .I s_free array into it, write it out, and set .I s_nfree to 0. In any event set .I s_free[s_nfree] to the freed block's address and increment .I s_nfree. .PP .I S_ninode is the number of free i-numbers in the .I s_inode array. To allocate an i-node: if .I s_ninode is greater than 0, decrement it and return .I s_inode[s_ninode]. If it was 0, read the i-list and place the numbers of all free inodes (up to NICINOD) into the .I s_inode array, then try again. To free an i-node, provided .I s_ninode is less than NICINODE, place its number into .I s_inode[s_ninode] and increment .I s_ninode. If .I s_ninode is already NICINODE, don't bother to enter the freed i-node into any table. This list of i-nodes is only to speed up the allocation process; the information as to whether the inode is really free or not is maintained in the inode itself. .PP The fields .I s_lasti and .I s_nbehind are used to avoid searching the inode list from the beginning each time the system runs out of inodes. .I S_lasti gives the base of the block of inodes last searched on the filesystem when inodes ran out, and .I s_nbehind gives the number of inodes, whose numbers were less than .I s_lasti when they were freed with .I s_ninode already NICINODE. Thus .I s_ninode is the number of free inodes before .I s_lasti. The system will search forward for free inodes from .I s_lasti for more inodes unless .I s_nbehind is sufficiently large, in which case it will search the file system inode list from the beginning. This mechanism serves to avoid n**2 behavior in allocating inodes. .PP .I S_flock and .I s_ilock are flags maintained in the core copy of the file system while it is mounted and their values on disk are immaterial. The value of .I s_fmod on disk is likewise immaterial; it is used as a flag to indicate that the super-block has changed and should be copied to the disk during the next periodic update of file system information. .I S_ronly is a write-protection indicator; its disk value is also immaterial. .PP .I S_time is the last time the super-block of the file system was changed. During a reboot, .I s_time of the super-block for the root file system is used to set the system's idea of the time. .PP The fields .I s_tfree, s_tinode, s_fname and .I s_fpack are not currently maintained. .PP I-numbers begin at 1, and the storage for i-nodes begins in block 2. .tr | I-nodes are 64 bytes long, so 16 of them fit into a block. I-node 2 is reserved for the root directory of the file system, but no other i-number has a built-in meaning. Each i-node represents one file. The format of an i-node as given in the include file .I is: .PP .nf .ta \w'#define 'u +\w'time_t 'u +\w'di_addr[40]; 'u .so /usr/include/sys/ino.h .fi .PP .I Di_mode tells the kind of file; it is encoded identically to the .I st_mode field of .IR stat (2). .I Di_nlink is the number of directory entries (links) that refer to this i-node. .I Di_uid and .I di_gid are the owner's user and group IDs. .I Size is the number of bytes in the file. .I Di_atime and .I di_mtime are the times of last access and modification of the file contents (read, write or create) (see .IR times (2)); .I Di_ctime records the time of last modification to the inode or to the file, and is used to determine whether it should be dumped. .PP Special files are recognized by their modes and not by i-number. A block-type special file is one which can potentially be mounted as a file system; a character-type special file cannot, though it is not necessarily character-oriented. For special files, the .I di_addr field is occupied by the device code (see .IR types (5)). The device codes of block and character special files overlap. .PP Disk addresses of plain files and directories are kept in the array .I di_addr packed into 3 bytes each. The first 10 addresses specify device blocks directly. The last 3 addresses are singly, doubly, and triply indirect and point to blocks of 256 block pointers. Pointers in indirect blocks have the type .I daddr_t (see .IR types (5)). .PP For block .I b in a file to exist, it is not necessary that all blocks less than .I b exist. A zero block number either in the address words of the i-node or in an indirect block indicates that the corresponding block has never been allocated. Such a missing block reads as if it contained all zero words. .SH "SEE ALSO" fsck(8), icheck(8), dcheck(8), dir(5), mount(8), stat(2), types(5) ct and point to blocksman/man5/fstab.5 644 0 33 5664 2512730625 6650 .TH FSTAB 5 .UC 4 .SH NAME fstab \- static information about the filesystems .SH SYNOPSIS .B #include .SH DESCRIPTION The file .I /etc/fstab contains descriptive information about the various file systems. .I /etc/fstab is only .I read by programs, and not written; it is the duty of the system administrator to properly create and maintain this file. .PP These programs use .I /etc/fstab: .I dump, .I mount, .I umount, .I swapon, .I fsck and .I df. The order of records in .I /etc/fstab is important, for both .I fsck, .I mount, and .I umount sequentially iterate through .I /etc/fstab doing their thing. .PP The special file name is the .B block special file name, and not the character special file name. If a program needs the character special file name, the program must create it by appending a ``r'' after the last ``/'' in the special file name. .PP If .I fs_type is ``rw'' or ``ro'' then the file system whose name is given in the .I fs_file field is normally mounted read-write or read-only on the specified special file. The .I fs_freq field is used for these file systems by the .IR dump (8) command to determine which file systems need to be dumped. The .I fs_passno field is used by the .IR fsck (8) program to determine the order in which file system checks are done at reboot time. The root file system should be specified with a .I fs_passno of 1, and other file systems should have larger numbers. File systems within a drive should have distinct numbers, but file systems on different drives can be checked on the same pass to utilize parallelism available in the hardware. .PP If .I fs_type is ``sw'' then the special file is made avaiable as a piece of swap space by the .IR swapon (8) command at the end of the system reboot procedure. The fields other than .I fs_spec and .I fs_type are not used in this case. .PP .I Fs_type may be specified as ``xx'' to cause an entry to be ignored. This is useful to show disk partitions which are currently not used but will be used later. .sp 1 .nf .ta \w'#define 'u +\w'FSTABARG(p) 'u \w'#define 'u+\w'char\ \ 'u+\w'fs_spec[FSNMLG]; 'u #define FSTAB "/etc/fstab" #define FSNMLG 16 #define FSTABFMT "%16s:%16s:%2s:%d:%d\en" #define FSTABARG(p) (p)\->fs_spec, (p)\->fs_file, \e (p)\->fs_type, &(p)\->fs_freq, &(p)\->fs_passno #define FSTABNARGS 5 #define FSTAB_RW "rw" /* read write device */ #define FSTAB_RO "ro" /* read only device */ #define FSTAB_SW "sw" /* swap device */ #define FSTAB_XX "xx" /* ignore totally */ .ta \w'#define 'u +\w'char\ \ 'u +\w'fs_spec[FSNMLG]; 'u struct fstab { char fs_spec[FSNMLG]; /* block special device name */ char fs_file[FSNMLG]; /* file system path prefix */ char fs_type[3]; /* rw,ro,sw or xx */ int fs_freq; /* dump frequency, in days */ int fs_passno; /* pass number on parallel dump */ }; .fi .PP The proper way to read records from .I /etc/fstab is to use the routines getfsent(), getfsspec() or getfsfile(). .SH FILES /etc/fstab .SH SEE ALSO getfsent(3) /* ignore totally */ .ta \w'#define 'u +\w'char\ \ 'u +\w'fs_spec[FSNMLG]man/man5/group.5 644 0 33 1414 2512730625 6672 .TH GROUP 5 .SH NAME group \- group file .SH DESCRIPTION .I Group contains for each group the following information: .HP 10 group name .br .ns .HP 10 encrypted password .br .ns .HP 10 numerical group ID .br .ns .HP 10 a comma separated list of all users allowed in the group .PP This is an ASCII file. The fields are separated by colons; Each group is separated from the next by a new-line. If the password field is null, no password is demanded. .PP This file resides in directory /etc. Because of the encrypted passwords, it can and does have general read permission and can be used, for example, to map numerical group ID's to names. .SH FILES /etc/group .SH "SEE ALSO" newgrp(1), crypt(3), passwd(1), passwd(5) .SH BUGS The .IR passwd (1) command won't change the passwords. e group .PP This is an ASCII file. The fields are separated by colons; Each group is separated from the next by a new-line. If the password field is null, no password is demanded. .PP This file resides in directory /etc. Because of the encrypteman/man5/mpxio.5 644 0 33 10113 2512730625 6706 ((.TH MPXIO 5 .UC 4 .SH NAME mpxio \- multiplexed i/o .SH SYNOPSIS .B #include .PP .B #include .SH DESCRIPTION Data transfers on mpx files (see .IR mpx (2)) are multiplexed by imposing a record structure on the io stream. Each record represents data from/to a particular channel or a control or status message associated with a particular channel. .PP The prototypical data record read from an mpx file is as follows .PP .in +.5i .nf struct input_record { short index; short count; short ccount; char data[]; }; .PP .fi where .I index identifies the channel, and .I count specifies the number of characters in .I data. If .I count is zero, .I ccount gives the size of .I data, and the record is a control or status message. Although .I count or .I ccount might be odd, the operating system aligns records on short (i.e. 16\-bit) boundaries by skipping bytes when necessary. .PP Data written to an mpx file must be formatted as an array of record structures defined as follows .PP .in +.5i .nf struct output_record { short index; short count; short ccount; char *data; }; .fi .PP where the data portion of the record is referred to indirectly and the other cells have the same interpretation as in .I input_record. .PP The control messages listed below may be read from a multiplexed file descriptor. They are presented as two 16-bit integers: the first number is the message code (defined in .IR ), the second is an optional parameter meaningful only with M_WATCH, M_BLK, and M_SIG. .PP .TP "\w'M_WATCH 'u" M_WATCH a process `wants to attach' on this channel. The second parameter is the 16-bit user-id of the process that executed the open. .TP M_CLOSE the channel is closed. This message is generated when the last file descriptor referencing a channel is closed. The .I detach command (see .IR mpx (2) should be used in response to this message. .TP M_EOT indicates logical end of file on a channel. If the channel is joined to a typewriter, EOT (control-d) will cause the M_EOT message under the conditions specified in .IR tty (4) for end of file. If the channel is attached to a process, M_EOT will be generated whenever the process writes zero bytes on the channel. .TP M_BLK if non-blocking mode has been enabled on an mpx file descriptor .I xd by executing .IR "ioctl(xd, MXNBLK, 0)" , write operations on the file are truncated in the kernel when internal queues become full. This is done on a per-channel basis: the parameter is a count of the number of characters not transferred to the channel on which M_BLK is received. .TP M_UBLK is generated for a channel after M_BLK when the internal queues have drained below a threshold. .TP M_SIG is generated instead of a normal asynchronous signal on channels that are joined to typewriters. The parameter is the signal number. .PP Two other messages may be generated by the kernel. As with other messages, the first 16-bit quantity is the message code. .br .TP "\w'M_IOCTL 'u" M_OPEN is generated in conjunction with `listener' mode (see .IR mpx (2)). The uid of the calling process follows the message code as with M_WATCH. This is followed by a null-terminated string which is the name of the file being opened. .TP M_IOCTL is generated for a channel connected to a process when that process executes the .I "ioctl(fd, cmd, &vec)" call on the channel file descriptor. The M_IOCTL code is followed by the .I cmd argument given to .I ioctl followed by the contents of the structure .I vec. It is assumed, not needing a better compromise at this time, that the length of .I vec is determined by .I "sizeof (struct sgttyb)" as declared in .IR . .in -1i .PP Two control messages are understood by the operating system. M_EOT may be sent through an mpx file to a channel. It is equivalent to propagating a zero-length record through the channel; i.e. the channel is allowed to drain and the process or device at the other end receives a zero-length transfer before data starts flowing through the channel again. M_IOANS can also be sent through a channel to reply to a M_IOCTL. The format is identical to that received from M_IOCTL. .SH SEE ALSO mpx(2) .h> . .in -1i .PP Two control messages are understood by the operating system. M_EOT may be sent through an mpx file to a channel. It is equivalent to propagating a zero-length record through the channel; i.e. the channel is allowed to drain and the process or device at the other end receives a zero-length transfer before data starts flowing through the channel again. M_IOANS can also be sent through a channel to reply to a M_IOCTL. man/man5/mtab.5 644 0 33 1274 2512730626 6466 .TH MTAB 5 .SH NAME mtab \- mounted file system table .SH DESCRIPTION .I Mtab resides in directory .I /etc and contains a table of devices mounted by the .I mount command. .I Umount removes entries. .PP Each entry is 64 bytes long; the first 32 are the null-padded name of the place where the special file is mounted; the second 32 are the null-padded name of the special file. The special file has all its directories stripped away; that is, everything through the last `/' is thrown away. .PP This table is present only so people can look at it. It does not matter to .I mount if there are duplicated entries nor to .I umount if a name cannot be found. .SH FILES /etc/mtab .SH "SEE ALSO" mount(8) es entries. .PP Each entry is 64 bytes long; the first 32 are the null-padded name of the place where the special file is mounted; the second 32 are the null-padded name of the special file. The special file has all its directories stripped away; that is, everything through the last `/' is thrown away. .PP This table is prman/man5/passwd.5 644 0 33 2665 2512730626 7051 .TH PASSWD 5 .UC .SH NAME passwd \- password file .SH DESCRIPTION .I Passwd contains for each user the following information: .HP 10 name (login name, contains no upper case) .br .ns .HP 10 encrypted password .br .ns .HP 10 numerical user ID .br .ns .HP 10 numerical group ID .br .ns .HP 10 user's real name, office, extension, home phone. .br .ns .HP 10 initial working directory .br .ns .HP 10 program to use as Shell .PP The name may contain `&', meaning insert the login name. This information is set by the .IR chfn (1) command and used by the .IR finger (1) command. .PP This is an ASCII file. Each field within each user's entry is separated from the next by a colon. Each user is separated from the next by a new-line. If the password field is null, no password is demanded; if the Shell field is null, then .I /bin/sh is used. .PP This file resides in directory /etc. Because of the encrypted passwords, it can and does have general read permission and can be used, for example, to map numerical user ID's to names. .PP Appropriate precautions must be taken to lock the file against changes if it is to be edited with a text editor; .IR vipw (8) does the necessary locking. .SH FILES /etc/passwd .SH "SEE ALSO" getpwent(3), login(1), crypt(3), passwd(1), group(5), chfn(1), finger(1), vipw(8), adduser(8) .SH BUGS A binary indexed file format should be available for fast access. .PP User information (name, office, etc.) should be stored elsewhere. permission and can be used, for example, to map numerical user ID's to nameman/man5/plot.5 644 0 33 5142 2512730627 6520 .TH PLOT 5 .SH NAME plot \- graphics interface .SH DESCRIPTION Files of this format are produced by routines described in .IR plot (3), and are interpreted for various devices by commands described in .IR plot (1). A graphics file is a stream of plotting instructions. Each instruction consists of an ASCII letter usually followed by bytes of binary information. The instructions are executed in order. A point is designated by four bytes representing the x and y values; each value is a signed integer. The last designated point in an .B "l, m, n," or .B p instruction becomes the `current point' for the next instruction. .PP Each of the following descriptions begins with the name of the corresponding routine in .IR plot (3). .TP 3 .B m move: The next four bytes give a new current point. .TP 3 .B n cont: Draw a line from the current point to the point given by the next four bytes. See .IR plot (1). .TP 3 .B p point: Plot the point given by the next four bytes. .TP 3 .B l line: Draw a line from the point given by the next four bytes to the point given by the following four bytes. .TP 3 .B t label: Place the following ASCII string so that its first character falls on the current point. The string is terminated by a newline. .TP 3 .B a arc: The first four bytes give the center, the next four give the starting point, and the last four give the end point of a circular arc. The least significant coordinate of the end point is used only to determine the quadrant. The arc is drawn counter-clockwise. .TP 3 .B c c((ircle: The first four bytes give the center of the circle, the next two the radius. .TP 3 .B e erase: Start another frame of output. .TP 3 .B f linemod: Take the following string, up to a newline, as the style for drawing further lines. The styles are `dotted,' `solid,' `longdashed,' `shortdashed,' and `dotdashed.' Effective only in .I plot 4014 and .I plot ver. .TP 3 .B s space: The next four bytes give the lower left corner of the plotting area; the following four give the upper right corner. The plot will be magnified or reduced to fit the device as closely as possible. .IP Space settings that exactly fill the plotting area with unity scaling appear below for devices supported by the filters of .IR plot (1). The upper limit is just outside the plotting area. In every case the plotting area is taken to be square; points outside may be displayable on devices whose face isn't square. .RS .TP 10n 4014 space(0, 0, 3120, 3120); .br .ns .TP ver space(0, 0, 2048, 2048); .br .ns .TP 300, 300s space(0, 0, 4096, 4096); .br .ns .TP 450 space(0, 0, 4096, 4096); .RE .SH "SEE ALSO" plot(1), plot(3), graph(1) actly fill the plotting area with unity scaling appear below for devices supported by the filters of .IR plot (1). The upper limit is just outside the plotting area. In every case the plotting area is taken to be square; points outside may be displayable on devices whose face isn't square. .RS .TP 10n 4014 space(0, 0, 3120, 3120); .br .ns .TP ver space(0, 0, 2048, 2048); .br .ns .TP 300, 300s space(0, 0, 409man/man5/stab.5 644 0 33 12741 2512730627 6516 .TH STAB 5 .UC 4 .SH NAME stab \- symbol table types .SH SYNOPSIS .B "#include " .SH DESCRIPTION .I Stab.h defines some values of the n_type field of the symbol table of a.out files. These are the types for permanent symbols (i.e. not local labels, etc.) used by the debugger .IR sdb (1) and the Berkeley Pascal compiler .IR pc (1). Symbol table entries can be produced by the .I .stabs assembler directive. This allows one to specify a double-quote delimited name, a symbol type, one char and one short of information about the symbol, and an unsigned long (usually an address). To avoid having to produce an explicit label for the address field, the .I .stabd directive can be used to implicitly address the current location. If no name is needed, symbol table entries can be generated using the .I .stabn directive. The loader promises to preserve the order of symbol table entries produced by .I .stab directives. As described in a.out(5), an element of the symbol table consists of the following structure: .PP .nf /* .ti +\w'/'u * Format of a symbol table entry. .ti +\w'/'u */ .ta \w'#define\ 'u +\w'unsigned 'u +\w'char\ \ 'u +\w'n_name;\ \ 'u struct nlist { union { char *n_name; /* for use when in-core */ long n_strx; /* index into file string table */ } n_un; unsigned char n_type; /* type flag */ char n_other; /* unused */ short n_desc; /* see struct desc, below */ unsigned n_value; /* address or offset or line */ }; .fi .DT .PP The low bits of the n_type field are used to place a symbol into at most one segment, according to the following masks, defined in .BR . A symbol can be in none of these segments by having none of these segment bits set. .PP .nf /* .ti +\w'/'u * Simple values for n_type. .ti +\w'/'u */ .ta \w'#define\ 'u +\w'N_FNAME\ 'u +\w'0x0\ \ \ 'u #define N_UNDF 0x0 /* undefined */ #define N_ABS 0x2 /* absolute */ #define N_TEXT 0x4 /* text */ #define N_DATA 0x6 /* data */ #define N_BSS 0x8 /* bss */ #define N_EXT 01 /* external bit, or'ed in */ .DT .fi .PP The n_value field of a symbol is relocated by the linker, .IR ld (5) as an address within the appropriate segment. N_value fields of symbols not in any segment are unchanged by the linker. In addition, the linker will discard certain symbols, according to rules of its own, unless the n_type field has one of the following bits set: .PP .nf /* .ti +\w'/'u * Other permanent symbol table entries have some of the N_STAB bits set. .ti +\w'/'u * These are given in .ti +\w'/'u */ .ta \w'#define\ 'u +\w'N_FNAME\ 'u +\w'0x0\ \ \ 'u #define N_STAB 0xe0 /* if any of these bits set, don't discard */ .DT .fi .PP This allows up to 112 (7 \(** 16) symbol types, split between the various segments. Some of these have already been claimed. The symbolic debugger, .IR sdb (1), uses the following n_type values: .PP .nf .ta \w'#define\ 'u +\w'N_FNAME\ 'u +\w'0x0\ \ \ 'u #define N_GSYM 0x20 /* global symbol: name,,0,type,0 */ #define N_FNAME 0x22 /* procedure name (f77 kludge): name,,0 */ #define N_FUN 0x24 /* procedure: name,,0,linenumber,address */ #define N_STSYM 0x26 /* static symbol: name,,0,type,address */ #define N_LCSYM 0x28 /* .lcomm symbol: name,,0,type,address */ #define N_RSYM 0x40 /* register sym: name,,0,type,register */ #define N_SLINE 0x44 /* src line: 0,,0,linenumber,address */ #define N_SSYM 0x60 /* structure elt: name,,0,type,struct_offset */ #define N_SO 0x64 /* source file name: name,,0,0,address */ #define N_LSYM 0x80 /* local sym: name,,0,type,offset */ #define N_SOL 0x84 /* #included file name: name,,0,0,address */ #define N_PSYM 0xa0 /* parameter: name,,0,type,offset */ #define N_ENTRY 0xa4 /* alternate entry: name,linenumber,address */ #define N_LBRAC 0xc0 /* left bracket: 0,,0,nesting level,address */ #define N_RBRAC 0xe0 /* right bracket: 0,,0,nesting level,address */ #define N_BCOMM 0xe2 /* begin common: name,, */ #define N_ECOMM 0xe4 /* end common: name,, */ #define N_ECOML 0xe8 /* end common (local name): ,,address */ #define N_LENG 0xfe /* second stab entry with length information */ .fi .PP where the comments give the .I sdb conventional use for .IR .stab s and the n_name, n_other, n_desc, and n_value fields of the given n_type. .I Sdb uses the n_desc field to hold a type specifier in the form used by the Portable C Compiler, .IR cc (1), in which a base type is qualified in the following structure: .PP .nf .ta \w'#define\ 'u +\w'short\ \ 'u struct desc { short q6:2, q5:2, q4:2, q3:2, q2:2, q1:2, basic:4; }; .DT .fi .PP There are four qualifications, with q1 the most significant and q6 the least significant: .nf 0 none 1 pointer 2 function 3 array .fi The sixteen basic types are assigned as follows: .nf 0 undefined 1 function argument 2 character 3 short 4 int 5 long 6 float 7 double 8 structure 9 union 10 enumeration 11 member of enumeration 12 unsigned character 13 unsigned short 14 unsigned int 15 unsigned long .fi .PP The Berkeley Pascal compiler, .IR pc (1), uses the following n_type value: .PP .nf #define N_PC 0x30 /* global pascal symbol: name,,0,subtype,line */ .fi .PP and uses the following subtypes to do type checking across separately compiled files: .nf 1 source file name 2 included file name 3 global label 4 global constant 5 global type 6 global variable 7 global function 8 global procedure 9 external function 10 external procedure .fi .SH "SEE ALSO" as(1), ld(1), sdb(1), a.out(5) .SH BUGS .PP .IR Sdb (1) assumes that a symbol of type N_GSYM with name .I name is located at address .IR _\|name . .PP More basic types are needed. e,,0,subtype,line */ .fi .PP anman/man5/termcap.5 664 0 33 61166 2512730632 7223 .tr || .TH TERMCAP 5 5/10/80 5 .UC 4 .SH NAME termcap \- terminal capability data base .SH SYNOPSIS /etc/termcap .SH DESCRIPTION .I Termcap is a data base describing terminals, used, .IR e.g. , by .IR vi (1) and .IR curses (3). Terminals are described in .I termcap by giving a set of capabilities which they have, and by describing how operations are performed. Padding requirements and initialization sequences are included in .I termcap. .PP Entries in .I termcap consist of a number of `:' separated fields. The first entry for each terminal gives the names which are known for the terminal, separated by `|' characters. The first name is always 2 characters long and is used by older version 6 systems which store the terminal type in a 16 bit word in a systemwide data base. The second name given is the most common abbreviation for the terminal, and the last name given should be a long name fully identifying the terminal. The second name should contain no blanks; the last name may well contain blanks for readability. .SH CAPABILITIES .nf (P) indicates padding may be specified (P*) indicates that padding may be based on no. lines affected .ta \w'k0-k9 'u +\w'Type 'u +\w'Pad? 'u \fBName Type Pad? Description\fR ae str (P) End alternate character set al str (P*) Add new blank line am bool Terminal has automatic margins as str (P) Start alternate character set bc str Backspace if not \fB^H\fR bs bool Terminal can backspace with \fB^H\fR bt str (P) Back tab bw bool Backspace wraps from column 0 to last column CC str Command character in prototype if terminal settable cd str (P*) Clear to end of display ce str (P) Clear to end of line ch str (P) Like cm but horizontal motion only, line stays same cl str (P*) Clear screen cm str (P) Cursor motion co num Number of columns in a line cr str (P*) Carriage return, (default \fB^M\fR) cs str (P) Change scrolling region (vt100), like cm cv str (P) Like ch but vertical only. da bool Display may be retained above dB num Number of millisec of bs delay needed db bool Displ((ay may be retained below dC num Number of millisec of cr delay needed dc str (P*) Delete character dF num Number of millisec of ff delay needed dl str (P*) Delete line dm str Delete mode (enter) dN num Number of millisec of nl delay needed do str Down one line dT num Number of millisec of tab delay needed ed str End delete mode ei str End insert mode; give \*(lq:ei=:\*(rq if \fBic\fR eo str Can erase overstrikes with a blank ff str (P*) Hardcopy terminal page eject (default \fB^L\fR) hc bool Hardcopy terminal hd str Half-line down (forward 1/2 linefeed) ho str Home cursor (if no \fBcm\fR) hu str Half-line up (reverse 1/2 linefeed) hz str Hazeltine; can't print ~'s ic str (P) Insert character if str Name of file containing \fBis\fR im bool Insert mode (enter); give \*(lq:im=:\*(rq if \fBic\fR in bool Insert mode distinguishes nulls on display ip str (P*) Insert pad after character inserted is str Terminal initialization string k0-k9 str Sent by \*(lqother\*(rq function keys 0-9 kb str Sent by backspace key kd str Sent by terminal down arrow key ke str Out of \*(lqkeypad transmit\*(rq mode kh str Sent by home key kl str Sent by terminal left arrow key kn num Number of \*(lqother\*(rq keys ko str Termcap entries for other non-function keys kr str Sent by terminal right arrow key ks str Put terminal in \*(lqkeypad transmit\*(rq mode ku str Sent by terminal up arrow key l0-l9 str Labels on \*(lqother\*(rq function keys li num Number of lines on screen or page ll str Last line, first column (if no \fBcm\fR) ma str Arrow key map, used by vi version 2 only mi bool Safe to move while in insert mode ml str Memory lock on above cursor. ms bool Safe to move while in standout and underline mode mu str Memory unlock (turn off memory lock). nc bool No correctly working carriage return (DM2500,H2000) nd str Non-destructive space (cursor right) nl str (P*) Newline character (default \fB\en\fR) ns bool Terminal is a \s-2CRT\s+2 but doesn't scroll. os bool Terminal overstrikes pc str Pad character (rather than null) pt bool Has hardware tabs (may need to be set with \fBis\fR) se str End stand out mode sf str (P) Scroll forwards sg num Number of blank chars left by so or se so str Begin stand out mode sr str (P) Scroll reverse (backwards) ta str (P) Tab (other than \fB^I\fR or with padding) tc str Entry of similar terminal - must be last te str String to end programs that use \fBcm\fP ti str String to begin programs that use \fBcm\fR uc str Underscore one char and move past it ue str End underscore mode ug num Number of blank chars left by us or ue ul bool Terminal underlines even though it doesn't overstrike up str Upline (cursor up) us str Start underscore mode vb str Visible bell (may not move cursor) ve str Sequence to end open/visual mode vs str Sequence to start open/visual mode xb bool Beehive (f1=escape, f2=ctrl C) xn bool A newline is ignored after a wrap (Concept) xr bool Return acts like \fBce\fP \er \en (Delta Data) xs bool Standout not erased by writing over it (HP 264?) xt bool Tabs are destructive, magic so char (Teleray 1061) .fi .PP .B A Sample Entry .PP The following entry, which describes the Concept\-100, is among the more complex entries in the .I termcap file as of this writing. (This particular concept entry is outdated, and is used as an example only.) .PP .nf c1\||\|c100\||\|concept100:is=\eEU\eEf\eE7\eE5\eE8\eEl\eENH\eEK\eE\e200\eEo&\e200:\e :al=3*\eE^R:am:bs:cd=16*\eE^C:ce=16\eE^S:cl=2*^L:cm=\eEa%+ %+ :co#80:\e :dc=16\eE^A:dl=3*\eE^B:ei=\eE\e200:eo:im=\eE^P:in:ip=16*:li#24:mi:nd=\eE=:\e :se=\eEd\eEe:so=\eED\eEE:ta=8\et:ul:up=\eE;:vb=\eEk\eEK:xn: .fi .PP Entries may continue onto multiple lines by giving a \e as the last character of a line, and that empty fields may be included for readability (here between the last field on a line and the first field on the next). Capabilities in .I termcap are of three types: Boolean capabilities which indicate that the terminal has some particular feature, numeric capabilities giving the size of the terminal or the size of particular delays, and string capabilities, which give a sequence which can be used to perform particular terminal operations. .PP .B Types of Capabilities .PP All capabilities have two letter codes. For instance, the fact that the Concept has \*(lqautomatic margins\*(rq (i.e. an automatic return and linefeed when the end of a line is reached) is indicated by the capability \fBam\fR. Hence the description of the Concept includes \fBam\fR. Numeric capabilities are followed by the character `#' and then the value. Thus \fBco\fR which indicates the number of columns the terminal has gives the value `80' for the Concept. .PP Finally, string valued capabilities, such as \fBce\fR (clear to end of line sequence) are given by the two character code, an `=', and then a string ending at the next following `:'. A delay in milliseconds may appear after the `=' in such a capability, and padding characters are supplied by the editor after the remainder of the string is sent to provide this delay. The delay can be either a integer, e.g. `20', or an integer followed by an `*', i.e. `3*'. A `*' indicates that the padding required is proportional to the number of lines affected by the operation, and the amount given is the per-affected-unit padding required. When a `*' is specified, it is sometimes useful to give a delay of the form `3.5' specify a delay per unit to tenths of milliseconds. .PP A number of escape sequences are provided in the string valued capabilities for easy encoding of characters there. A \fB\eE\fR maps to an \s-2ESCAPE\s0 character, \fB^x\fR maps to a control-x for any appropriate x, and the sequences \fB\en \er \et \eb \ef\fR give a newline, return, tab, backspace and formfeed. Finally, characters may be given as three octal digits after a \fB\e\fR, and the characters \fB^\fR and \fB\e\fR may be given as \fB\e^\fR and \fB\e\e\fR. If it is necessary to place a \fB:\fR in a capability it must be escaped in octal as \fB\e072\fR. If it is necessary to place a null character in a string capability it must be encoded as \fB\e200\fR. The routines which deal with .I termcap use C strings, and strip the high bits of the output very late so that a \fB\e200\fR comes out as a \fB\e000\fR would. .br .ne 5 .PP .B Preparing Descriptions .PP We now outline how to prepare descriptions of terminals. The most effective way to prepare a terminal description is by imitating the description of a similar terminal in .I termcap and to build up a description gradually, using partial descriptions with .I ex to check that they are correct. Be aware that a very unusual terminal may expose deficiencies in the ability of the .I termcap file to describe it or bugs in .I ex. To easily test a new terminal description you can set the environment variable TERMCAP to a pathname of a file containing the description you are working on and the editor will look there rather than in .I /etc/termcap. TERMCAP can also be set to the termcap entry itself to avoid reading the file when starting up the editor. (This only works on version 7 systems.) .PP .B Basic capabilities .PP The number of columns on each line for the terminal is given by the \fBco\fR numeric capability. If the terminal is a \s-2CRT\s0, then the number of lines on the screen is given by the \fBli\fR capability. If the terminal wraps around to the beginning of the next line when it reaches the right margin, then it should have the \fBam\fR capability. If the terminal can clear its screen, then this is given by the \fBcl\fR string capability. If the terminal can backspace, then it should have the \fBbs\fR capability, unless a backspace is accomplished by a character other than \fB^H\fR (ugh) in which case you should give this character as the \fBbc\fR string capability. If it overstrikes (rather than clearing a position when a character is struck over) then it should have the \fBos\fR capability. .PP A very important point here is that the local cursor motions encoded in .I termcap are undefined at the left and top edges of a \s-2CRT\s0 terminal. The editor will never attempt to backspace around the left edge, nor will it attempt to go up locally off the top. The editor assumes that feeding off the bottom of the screen will cause the screen to scroll up, and the \fBam\fR capability tells whether the cursor sticks at the right edge of the screen. If the terminal has switch selectable automatic margins, the .I termcap file usually assumes that this is on, i.e. \fBam\fR. .PP These capabilities suffice to describe hardcopy and \*(lqglass-tty\*(rq terminals. Thus the model 33 teletype is described as .PP .DT t3\||\|33\||\|tty33:co#72:os .PP while the Lear Siegler \s-2ADM\-3\s0 is described as .PP .DT cl\||\|adm3|3|lsi adm3:am:bs:cl=^Z:li#24:co#80 .PP .B Cursor addressing .PP Cursor addressing in the terminal is described by a \fBcm\fR string capability, with .IR printf (3s) like escapes \fB%x\fR in it. These substitute to encodings of the current line or column position, while other characters are passed through unchanged. If the \fBcm\fR string is thought of as being a function, then its arguments are the line and then the column to which motion is desired, and the \fB%\fR encodings have the following meanings: .PP .DT .nf %d as in \fIprintf\fR, 0 origin %2 like %2d %3 like %3d %. like %c %+x adds \fIx\fR to value, then %. %>xy if value > x adds y, no output. %r reverses order of line and column, no output %i increments line/column (for 1 origin) %% gives a single % %n exclusive or row and column with 0140 (DM2500) %B BCD (16*(x/10)) + (x%10), no output. %D Reverse coding (x-2*(x%16)), no output. (Delta Data). .fi .PP Consider the HP2645, which, to get to row 3 and column 12, needs to be sent \eE&a12c03Y padded for 6 milliseconds. Note that the order of the rows and columns is inverted here, and that the row and column are printed as two digits. Thus its \fBcm\fR capability is \*(lqcm=6\eE&%r%2c%2Y\*(rq. The Microterm \s-2ACT-IV\s0 needs the current row and column sent preceded by a \fB^T\fR, with the row and column simply encoded in binary, \*(lqcm((=^T%.%.\*(rq. Terminals which use \*(lq%.\*(rq need to be able to backspace the cursor (\fBbs\fR or \fBbc\fR), and to move the cursor up one line on the screen (\fBup\fR introduced below). This is necessary because it is not always safe to transmit \fB\et\fR, \fB\en\fR \fB^D\fR and \fB\er\fR, as the system may change or discard them. .PP A final example is the \s-2LSI ADM\s0-3a, which uses row and column offset by a blank character, thus \*(lqcm=\eE=%+ %+ \*(rq. .PP .B Cursor motions .PP If the terminal can move the cursor one position to the right, leaving the character at the current position unchanged, then this sequence should be given as \fBnd\fR (non-destructive space). If it can move the cursor up a line on the screen in the same column, this should be given as \fBup\fR. If the terminal has no cursor addressing capability, but can home the cursor (to very upper left corner of screen) then this can be given as \fBho\fR; similarly a fast way of getting to the lower left hand corner can be given as \fBll\fR; this may involve going up with \fBup\fR from the home position, but the editor will never do this itself (unless \fBll\fR does) because it makes no assumption about the effect of moving up from the home position. .PP .B Area clears .PP If the terminal can clear from the current position to the end of the line, leaving the cursor where it is, this should be given as \fBce\fR. If the terminal can clear from the current position to the end of the display, then this should be given as \fBcd\fR. The editor only uses \fBcd\fR from the first column of a line. .PP .B Insert/delete line .PP If the terminal can open a new blank line before the line where the cursor is, this should be given as \fBal\fR; this is done only from the first position of a line. The cursor must then appear on the newly blank line. If the terminal can delete the line which the cursor is on, then this should be given as \fBdl\fR; this is done only from the first position on the line to be deleted. If the terminal can scroll the screen backwards, then this can be given as \fBsb\fR, but just \fBal\fR suffices. If the terminal can retain display memory above then the \fBda\fR capability should be given; if display memory can be retained below then \fBdb\fR should be given. These let the editor understand that deleting a line on the screen may bring non-blank lines up from below or that scrolling back with \fBsb\fR may bring down non-blank lines. .PP .B Insert/delete character .PP There are two basic kinds of intelligent terminals with respect to insert/delete character which can be described using .I termcap. The most common insert/delete character operations affect only the characters on the current line and shift characters off the end of the line rigidly. Other terminals, such as the Concept 100 and the Perkin Elmer Owl, make a distinction between typed and untyped blanks on the screen, shifting upon an insert or delete only to an untyped blank on the screen which is either eliminated, or expanded to two untyped blanks. You can find out which kind of terminal you have by clearing the screen and then typing text separated by cursor motions. Type \*(lqabc\ \ \ \ def\*(rq using local cursor motions (not spaces) between the \*(lqabc\*(rq and the \*(lqdef\*(rq. Then position the cursor before the \*(lqabc\*(rq and put the terminal in insert mode. If typing characters causes the rest of the line to shift rigidly and characters to fall off the end, then your terminal does not distinguish between blanks and untyped positions. If the \*(lqabc\*(rq shifts over to the \*(lqdef\*(rq which then move together around the end of the current line and onto the next as you insert, you have the second type of terminal, and should give the capability \fBin\fR, which stands for \*(lqinsert null\*(rq. If your terminal does something different and unusual then you may have to modify the editor to get it to use the insert mode your terminal defines. We have seen no terminals which have an insert mode not not falling into one of these two classes. .PP The editor can handle both terminals which have an insert mode, and terminals which send a simple sequence to open a blank position on the current line. Give as \fBim\fR the sequence to get into insert mode, or give it an empty value if your terminal uses a sequence to insert a blank position. Give as \fBei\fR the sequence to leave insert mode (give this, with an empty value also if you gave \fBim\fR so). Now give as \fBic\fR any sequence needed to be sent just before sending the character to be inserted. Most terminals with a true insert mode will not give \fBic\fR, terminals which send a sequence to open a screen position should give it here. (Insert mode is preferable to the sequence to open a position on the screen if your terminal has both.) If post insert padding is needed, give this as a number of milliseconds in \fBip\fR (a string option). Any other sequence which may need to be sent after an insert of a single character may also be given in \fBip\fR. .PP It is occasionally necessary to move around while in insert mode to delete characters on the same line (e.g. if there is a tab after the insertion position). If your terminal allows motion while in insert mode you can give the capability \fBmi\fR to speed up inserting in this case. Omitting \fBmi\fR will affect only speed. Some terminals (notably Datamedia's) must not have \fBmi\fR because of the way their insert mode works. .PP Finally, you can specify delete mode by giving \fBdm\fR and \fBed\fR to enter and exit delete mode, and \fBdc\fR to delete a single character while in delete mode. .PP .B "Highlighting, underlining, and visible bells" .PP If your terminal has sequences to enter and exit standout mode these can be given as \fBso\fR and \fBse\fR respectively. If there are several flavors of standout mode (such as inverse video, blinking, or underlining \- half bright is not usually an acceptable \*(lqstandout\*(rq mode unless the terminal is in inverse video mode constantly) the preferred mode is inverse video by itself. If the code to change into or out of standout mode leaves one or even two blank spaces on the screen, as the TVI 912 and Teleray 1061 do, then \fBug\fR should be given to tell how many spaces are left. .PP Codes to begin underlining and end underlining can be given as \fBus\fR and \fBue\fR respectively. If the terminal has a code to underline the current character and move the cursor one space to the right, such as the Microterm Mime, this can be given as \fBuc\fR. (If the underline code does not move the cursor to the right, give the code followed by a nondestructive space.) .PP Many terminals, such as the HP 2621, automatically leave standout mode when they move to a new line or the cursor is addressed. Programs using standout mode should exit standout mode before moving the cursor or sending a newline. .PP If the terminal has a way of flashing the screen to indicate an error quietly (a bell replacement) then this can be given as \fBvb\fR; it must not move the cursor. If the terminal should be placed in a different mode during open and visual modes of .I ex, this can be given as \fBvs\fR and \fBve\fR, sent at the start and end of these modes respectively. These can be used to change, e.g., from a underline to a block cursor and back. .PP If the terminal needs to be in a special mode when running a program that addresses the cursor, the codes to enter and exit this mode can be given as \fBti\fR and \fBte\fR. This arises, for example, from terminals like the Concept with more than one page of memory. If the terminal has only memory relative cursor addressing and not screen relative cursor addressing, a one screen-sized window must be fixed into the terminal for cursor addressing to work properly. .PP If your terminal correctly generates underlined characters (with no special codes needed) even though it does not overstrike, then you should give the capability \fBul\fR. If overstrikes are erasable with a blank, then this should be indicated by giving \fBeo\fR. .PP .B Keypad .PP If the terminal has a keypad that transmits codes when the keys are pressed, this information can be given. Note that it is not possible to handle terminals where the keypad only works in local (this applies, for example, to the unshifted HP 2621 keys). If the keypad can be set to transmit or not transmit, give these codes as \fBks\fR and \fBke\fR. Otherwise the keypad is assumed to always transmit. The codes sent by the left arrow, right arrow, up arrow, down arrow, and home keys can be given as \fBkl, kr, ku, kd, \fRand\fB kh\fR respectively. If there are function keys such as f0, f1, ..., f9, the codes they send can be given as \fBk0, k1, ..., k9\fR. If these keys have labels other than the default f0 through f9, the labels can be given as \fBl0, l1, ..., l9\fR. If there are other keys that transmit the same code as the terminal expects for the corresponding function, such as clear screen, the \fItermcap\fP 2 letter codes can be given in the \fBko\fR capability, for example, \*(lq:ko=cl,ll,sf,sb:\*(rq, which says that the terminal has clear, home down, scroll down, and scroll up keys that transmit the same thing as the cl, ll, sf, and sb entries. .PP The .B ma entry is also used to indicate arrow keys on terminals which have single character arrow keys. It is obsolete but still in use in version 2 of vi, which must be run on some minicomputers due to memory limitations. This field is redundant with .BR "kl, kr, ku, kd, " and " kh" . It consists of groups of two characters. In each group, the first character is what an arrow key sends, the second character is the corresponding vi command. These commands are .B h for .BR kl , .B j for .BR kd , .B k for .BR ku , .B l for .BR kr , and .B H for .BR kh . For example, the mime would be .B ":ma=^Kj^Zk^Xl:" indicating arrow keys left (^H), down (^K), up (^Z), and right (^X). (There is no home key on the mime.) .PP .B Miscellaneous .PP If the terminal requires other than a null (zero) character as a pad, then this can be given as \fBpc\fR. .PP If tabs on the terminal require padding, or if the terminal uses a character other than \fB^((I\fR to tab, then this can be given as \fBta\fR. .PP Hazeltine terminals, which don't allow `~' characters to be printed should indicate \fBhz\fR. Datamedia terminals, which echo carriage-return linefeed for carriage return and then ignore a following linefeed should indicate \fBnc\fR. Early Concept terminals, which ignore a linefeed immediately after an \fBam\fR wrap, should indicate \fBxn\fR. If an erase-eol is required to get rid of standout (instead of merely writing on top of it), \fBxs\fP should be given. Teleray terminals, where tabs turn all characters moved over to blanks, should indicate \fBxt\fR. Other specific terminal problems may be corrected by adding more capabilities of the form \fBx\fIx\fR. .PP Other capabilities include \fBis\fR, an initialization string for the terminal, and \fBif\fR, the name of a file containing long initialization strings. These strings are expected to properly clear and then set the tabs on the terminal, if the terminal has settable tabs. If both are given, \fBis\fR will be printed before \fBif\fR. This is useful where \fBif\fR is .I /usr/lib/tabset/std but \fBis\fR clears the tabs first. .PP .B Similar Terminals .PP If there are two very similar terminals, one can be defined as being just like the other with certain exceptions. The string capability \fBtc\fR can be given with the name of the similar terminal. This capability must be \fIlast\fP and the combined length of the two entries must not exceed 1024. Since .I termlib routines search the entry from left to right, and since the tc capability is replaced by the corresponding entry, the capabilities given at the left override the ones in the similar terminal. A capability can be cancelled with \fBxx@\fR where xx is the capability. For example, the entry .PP hn\||\|2621nl:ks@:ke@:tc=2621: .PP defines a 2621nl that does not have the \fBks\fR or \fBke\fR capabilities, and hence does not turn on the function key labels when in visual mode. This is useful for different modes for a terminal, or for different user preferences. .SH FILES .DT /etc/termcap file containing terminal descriptions .SH SEE ALSO ex(1), curses(3), termcap(3), tset(1), vi(1), ul(1), more(1) .SH AUTHOR William Joy .br Mark Horton added underlining and keypad support .SH BUGS .I Ex allows only 256 characters for string capabilities, and the routines in .I termcap(3) do not check for overflow of this buffer. The total length of a single entry (excluding only escaped newlines) may not exceed 1024. .PP The .BR ma , .BR vs , and .B ve entries are specific to the .I vi program. .PP Not all programs support all entries. There are entries that are not supported by any program. , vi(1), ul(1), more(1) .SH AUTHOR William Joy .br Mark Horton added underlining and keypad support .SH BUGS .I Ex allows only 256 characters for string capabilities, and the routines in .I termcap(3) do not check for overflow of this buffer. The total length of a single entry (excluding only escaped newlines) may not exceed 1024. .PP The .BR ma , .BR vs , and .B ve entries are specific to man/man5/tp.5 644 0 33 3021 2512730632 6153 .TH TP 5 .SH NAME tp \- DEC/mag tape formats .SH DESCRIPTION .I Tp dumps files to and extracts files from DECtape and magtape. The formats of these tapes are the same except that magtapes have larger directories. .PP Block zero contains a copy of a stand-alone bootstrap program. See .IR reboot (8). .PP Blocks 1 through 24 for DECtape (1 through 62 for magtape) contain a directory of the tape. There are 192 (resp. 496) entries in the directory; 8 entries per block; 64 bytes per entry. Each entry has the following format: .nf .IP "" .ta 8n +\w'unsigned short 'u struct { char pathname[32]; unsigned short mode; char uid; char gid; char unused1; char size[3]; long modtime; unsigned short tapeaddr; char unused2[16]; unsigned short checksum; }; .fi .DT .PP The path name entry is the path name of the file when put on the tape. If the pathname starts with a zero word, the entry is empty. It is at most 32 bytes long and ends in a null byte. Mode, uid, gid, size and time modified are the same as described under i-nodes (see file system .IR filsys (5)). The tape address is the tape block number of the start of the contents of the file. Every file starts on a block boundary. The file occupies (size+511)/512 blocks of continuous tape. The checksum entry has a value such that the sum of the 32 words of the directory entry is zero. .PP Blocks above 25 (resp. 63) are available for file storage. .PP A fake entry has a size of zero. .SH "SEE ALSO" filsys(5), tp(1) .SH BUGS The .I pathname, uid, gid, and .I size fields are too small. file system .IR filsys (5)). The tape address is the tape block number of the start of the contents of the file. Every file starts on a block boundary. The file occupies (size+511)/512 blocks of continuous tape. The checksum entry has a value such that the sum of the 32 words of the directory entry is zero. .PP Blocks above 25 (resp. 63) are available for file storage. .PP A fake entry has a size of zero. .SH "SEE ALSO" filsys(5), tp(1) .SH BUGS The .I pathname, uid, gid, and .I size fieldman/man5/ttys.5 644 0 33 1673 2512730632 6546 .TH TTYS 5 .SH NAME ttys \- terminal initialization data .SH DESCRIPTION The .I ttys file is read by the .I init program and specifies which terminal special files are to have a process created for them which will allow people to log in. It contains one line per special file. .PP The first character of a line is either `0' or `1'; the former causes the line to be ignored, the latter causes it to be effective. The second character is used as an argument to .IR getty (8), which performs such tasks as baud-rate recognition, reading the login name, and calling .I login. For normal lines, the character is `0'; other characters can be used, for example, with hard-wired terminals where speed recognition is unnecessary or which have special characteristics. .RI ( Getty will have to be fixed in such cases.) The remainder of the line is the terminal's entry in the device directory, /dev. .SH FILES /etc/ttys .SH "SEE ALSO" init(8), getty(8), login(1) as an argument to .IR getty (8), which performs such tasks as baud-raman/man5/ttytype.5 644 0 33 1142 2512730632 7254 .TH TTYTYPE 5 10/25/79 5 .UC 4 .SH NAME ttytype \- data base of terminal types by port .SH SYNOPSIS /etc/ttytype .SH DESCRIPTION .I Ttytype is a database containing, for each tty port on the system, the kind of terminal that is attached to it. There is one line per port, containing the terminal kind (as a name listed in termcap (5)), a space, and the name of the tty, minus /dev/. .PP This information is read by .IR tset (1) and by .IR login (1) to initialize the TERM variable at login time. .SH "SEE ALSO" tset(1), login(1) .SH BUGS Some lines are merely known as \*(lqdialup\*(rq or \*(lqplugboard\*(rq. S /etc/ttytype .SH DESCRIPTION .I Ttytype is a database containing, for each tty port on the system, the kind of terminal that is attached to it. There is one line per port, containing the terminal kind (as a name listed in termcap (5)), a space, and the name of the tty, minus /dev/. .PP This information is read by .IR tset (1) and by .IR login (1) to initialize the TERM variable at login time. .SH "SEE ALSO" tman/man5/types.5 644 0 33 1500 2512730632 6674 .TH TYPES 5 .UC 4 .SH NAME types \- primitive system data types .SH SYNOPSIS .B #include .SH DESCRIPTION The data types defined in the include file are used in UNIX system code; some data of these types are accessible to user code: .PP .nf .ta \w'typedef\ \ 'u +\w'minor(x)\ \ 'u +\w' short\ \ 'u .so /usr/include/sys/types.h .fi .PP The form .I daddr_t is used for disk addresses except in an i-node on disk, see .IR filsys (5). Times are encoded in seconds since 00:00:00 GMT, January 1, 1970. The major and minor parts of a device code specify kind and unit number of a device and are installation-dependent. Offsets are measured in bytes from the beginning of a file. The .I label_t variables are used to save the processor state while another process is running. .SH SEE ALSO filsys(5), time(2), lseek(2), adb(1) include/sys/types.h .fi .PP The form .I daddr_t is used for disk addresses except in an i-node on disk, see .IR filsys (5). Times are encoded in seconds since 00:00:00 GMT, January 1, 1970. Th((man/man5/utmp.5 644 0 33 2305 2512730633 6522 .TH UTMP 5 .UC 4 .SH NAME utmp, wtmp \- login records .SH SYNOPSIS .B #include .SH DESCRIPTION The .I utmp file allows one to discover information about who is currently using UNIX. The file is a sequence of entries with the following structure declared in the include file: .RS .PP .nf .so /usr/include/utmp.h .fi .RE .PP This structure gives the name of the special file associated with the user's terminal, the user's login name, and the time of the login in the form of .IR time (2). .PP The .I wtmp file records all logins and logouts. Its format is exactly like .I utmp except that a null user name indicates a logout on the associated terminal. Furthermore, the terminal name `~' indicates that the system was rebooted at the indicated time; the adjacent pair of entries with terminal names `\^|\^' and `}' indicate the system-maintained time just before and just after a .I date command has changed the system's idea of the time. .PP .I Wtmp is maintained by .IR login (1) and .IR init (8). Neither of these programs creates the file, so if it is removed record-keeping is turned off. It is summarized by .IR ac (8). .SH FILES /etc/utmp .br /usr/adm/wtmp .SH "SEE ALSO" login(1), init(8), who(1), ac(8) at the system was rebooted at the indicated time; the adjacent pair of entries with terminal names `\^|\^' and `}' indicate the system-maintained time just before and just after a .I date command has changed the system's idea of the time. .PP .I Wtmp is maintained by .IR login (1) and .IR init (8). Neither of thesman/man5/uuencode.5 664 0 33 3210 2512730633 7342 .TH UUENCODE 5 6/1/80 .UC 4 .SH NAME uuencode \- format of an encoded uuencode file .SH DESCRIPTION Files output by .I uuencode(1) consist of a header line, followed by a number of body lines, and a trailer line. .I Uudecode(1) will ignore any lines preceding the header or following the trailer. Lines preceding a header must not, of course, look like a header. .PP The header line is distinguished by having the first 6 characters \*(lqbegin\ \*(rq. The word .I begin is followed by a mode (in octal), and a string which names the remote file. A space separates the three items in the header line. .PP The body consists of a number of lines, each at most 62 characters long (including the trailing newline). These consist of a character count, followed by encoded characters, followed by a newline. The character count is a single printing character, and represents an integer, the number of bytes the rest of the line represents. Such integers are always in the range from 0 to 63 and can be determined by subtracting the character space (octal 40) from the character. .PP Groups of 3 bytes are stored in 4 characters, 6 bits per character. All are offset by a space to make the characters printing. The last line may be shorter than the normal 45 bytes. If the size is not a multiple of 3, this fact can be determined by the value of the count on the last line. Extra garbage will be included to make the character count a multiple of 4. The body is terminated by a line with a count of zero. This line consists of one ASCII space. .PP The trailer line consists of \*(lqend\*(rq on a line by itself. .SH SEE\ ALSO uuencode(1), uudecode(1), uusend(1), uucp(1), mail(1) y a space to make the characters printing. The last line may be shorter than the normal 45 bytes. If the size is not a multiple of 3, this fact can be determined by the value of the count on the last line. Extra garbage will be included to make the character count a multiple of 4. The body is terminated by a line with a count of zero. This line consists of one ASCII space. man/man5/vfont.5 644 0 33 3452 2512730633 6675 .TH VFONT 5 2/26/79 5 .UC .SH NAME vfont \- font formats for the Benson-Varian or Versatec .SH SYNOPSIS .B /usr/lib/vfont/\(** .SH DESCRIPTION The fonts for the printer/plotters have the following format. Each file contains a header, an array of 256 character description structures, and then the bit maps for the characters themselves. The header has the following format: .in +5 .nf .sp .ta 8n +\w'unsigned short 'u struct header { short magic; unsigned short size; short maxx; short maxy; short xtnd; } header; .fi .in -5 .PP The .I magic number is 0436 (octal). The .I maxx, .I maxy, and .I xtnd fields are not used at the current time. .I Maxx and .I maxy are intended to be the maximum horizontal and vertical size of any glyph in the font, in raster lines. The .I size is the size of the bit maps for the characters in bytes. Before the maps for the characters is an array of 256 structures for each of the possible characters in the font. Each element of the array has the form: .in +5 .nf .sp .ta 8n +\w'unsigned short 'u struct dispatch { unsigned short addr; short nbytes; char up; char down; char left; char right; short width; }; .fi .in -5 .PP The .I nbytes field is nonzero for characters which actually exist. For such characters, the .I addr field is an offset into the rest of the file where the data for that character begins. There are .I up+down rows of data for each character, each of which has .I left+right bits, rounded up to a number of bytes. The .I width field is not used by vcat, although it is used by .IR vwidth (1) to make width tables for .IR troff . It represents the logical width of the glyph, in raster lines, and shows where the base point of the next glyph would be. .SH FILES /usr/lib/vfont/\(** .SH SEE ALSO troff(1), pti(1), vpr(1), vtroff(1), vwidth(1), vfontinfo(1), fed(1) e the data for that character begins. There are .I up+down rows of data for each character, each of which has .I left+right bits, rounded up to a number of bytes. The .I width field is not used by vcat, although itman/man5/wtmp.5 644 0 33 1421 2512730634 6523 .TH WTMP 5 .tr || .SH NAME wtmp \- user login history .SH DESCRIPTION This file records all logins and logouts. Its format is exactly like .IR utmp (5) except that a null user name indicates a logout on the associated typewriter. Furthermore, the typewriter name `~' indicates that the system was rebooted at the indicated time; the adjacent pair of entries with typewriter names `|' and `}' indicate the system-maintained time just before and just after a .I date command has changed the system's idea of the time. .PP .I Wtmp is maintained by .IR login (1) and .IR init (8). Neither of these programs creates the file, so if it is removed record-keeping is turned off. It is summarized by .IR ac (1). .SH FILES /usr/adm/wtmp .SH "SEE ALSO" utmp(5), login(1), init(8), ac(1), who(1) ates that the system was rebooted at the indicated time; the adjacent pair of entries with typewriter names `|' and `}' indicate the system-maintained time just before and just after a .I date command has changed the system's idea of the tman/man6/ 775 0 33 0 2527170522 5366 man/man6/aardvark.6 664 0 33 1010 2512730636 7327 .TH AARDVARK 6 .UC 4 .SH NAME aardvark \- yet another exploration game .SH SYNOPSIS .B /usr/games/aardvark .SH DESCRIPTION Aardvark is yet another computer fantasy simulation game of the adventure/zork genre. This one is written in DDL (Dungeon Definition Language) and is intended primarily as an example of how to write a dungeon in DDL. .SH FILES .ta \w'/usr/games/lib/aardvark'u /usr/games/lib/ddlrun ddl interpreter .br /usr/games/lib/aardvark internal form of aardvark dungeon .SH AUTHOR Mike Urban, UCLA .((SH BUGS VARK 6 .UC 4 .SH NAME aardvark \- yet another exploration game .SH SYNOPSIS .B /usr/games/aardvark .SH DESCRIPTION Aardvark is yet another computer fantasy simulation game of the adventure/zork genre. This one is written in DDL (Dungeon Definition Language) and is intended primarily as an example of how to write a dungeon in DDL. .SH FILES .ta \w'/usr/games/lib/aardvark'u /usr/games/lib/ddlrun ddl interpreter .br /usr/games/lib/aardvark internal form of aardvark dungeon .SH AUTHOR Mike Urban, UCLA .man/man6/adventure.6 644 0 33 1050 2527172401 7527 .TH ADVENTURE 6 .SH NAME adventure \- an exploration game .SH SYNOPSIS .B /usr/games/adventure .SH DESCRIPTION The object of the game is to locate and explore Colossal Cave, find the treasures hidden there, and bring them back to the building with you. The program is self-describing to a point, but part of the game is to discover its rules. .PP To terminate a game, type `quit'; to save a game for later resumption, type `suspend'. .SH BUGS .PP Saving a game creates a large executable file instead of just the information needed to resume the game. exploration game .SH SYNOPSIS .B /usr/games/adventure .SH DESCRIPTION The object of the game is to locate and explore Colossal Cave, find the treasures hidden there, and bring them back to the building with you. The program is self-describing to a point, but part of the game is to discover its rules. .PP To terminate a game, type `quit'; to save a game for later resumption, type `suspend'. .SH BUGS .PP Saving a game creates a large executable file instead of just theman/man6/aliens.6 664 0 33 616 2512730636 7002 .TH ALIENS 6 4/2/81 .UC 4 .SH NAME aliens \- The alien invaders attack the earth .SH SYNIOPSIS .B /usr/games/aliens .SH DESCRIPTION .PP This is a UNIX version of Space Invaders. The program is pretty much self documenting. .SH FILES /usr/games/lib/aliens.log Score file .SH BUGS The program is a CPU hog. It needs to be re-written. It doesn't do well on terminals that run slower than 9600 baud. r later resumption, ty/( ,( 5Ċ /\@,\D"man/man6/arithmetic.6 644 0 33 3167 2512730637 7703 .TH ARITHMETIC 6 .SH NAME arithmetic \- provide drill in number facts .SH SYNOPSIS .B /usr/games/arithmetic [ .B +\-x/ ] [ range ] .SH DESCRIPTION .I Arithmetic types out simple arithmetic problems, and waits for an answer to be typed in. If the answer is correct, it types back \*(lqRight!\*(rq, and a new problem. If the answer is wrong, it replies \*(lqWhat?\*(rq, and waits for another answer. Every twenty problems, it publishes statistics on correctness and the time required to answer. .PP To quit the program, type an interrupt (delete). .PP The first optional argument determines the kind of problem to be generated; .B +\-x/ respectively cause addition, subtraction, multiplication, and division problems to be generated. One or more characters can be given; if more than one is given, the different types of problems will be mixed in random order; default is .B +\- .PP .I Range is a decimal number; all addends, subtrahends, differences, multiplicands, divisors, and quotients will be less than or equal to the value of .IR range . Default .I range is 10. .PP At the start, all numbers less than or equal to .I range are equally likely to appear. If the respondent makes a mistake, the numbers in the problem which was missed become more likely to reappear. .PP As a matter of educational philosophy, the program will not give correct answers, since the learner should, in principle, be able to calculate them. Thus the program is intended to provide drill for someone just past the first learning stage, not to teach number facts .I de .IR novo . For almost all users, the relevant statistic should be time per problem, not percent correct. ikely to appear. If the respondent makes a mistake, the numbers in the problem which was missed become more likely to reappear. .PP As a matter of educational philosophy, the program will not give correct answers, since the learner should, in principle, be able to calculate them. Thus the program is intended to provide drill for someone just past the first learning stage, not to teach numbeman/man6/backgammon.6 644 0 33 266 2512730637 7626 .TH BACKGAMMON 6 .SH NAME backgammon \- the game .SH SYNOPSIS .B /usr/games/backgammon .SH DESCRIPTION This program does what you expect. It will ask whether you need instructions. in the problem which was missed become more likely to reappear. .PP As a matter of educational philosophy, the program will not give correct answers, since the learner should, in principle, be able to calculate them. Thus the program is /( ,( 5 Ċ /\@,\D"man/man6/banner.6 644 0 33 2037 2512730637 7012 .TH BANNER 6 .UC .SH NAME banner \- print large banner on printer .SH SYNOPSIS .B /usr/games/banner [ .BI \-w n ] message ... .SH DESCRIPTION .I Banner prints a large, high quality banner on the standard output. If the message is omitted, it prompts for and reads one line of its standard input. If .B \-w is given, the output is scrunched down from a width of 132 to .I n , suitable for a narrow terminal. If .I n is omitted, it defaults to 80. .PP The output should be printed on a hard-copy device, up to 132 columns wide, with no breaks between the pages. The volume is enough that you want a printer or a fast hardcopy terminal, but if you are patient, a decwriter or other 300 baud terminal will do. .SH BUGS Several ASCII characters are not defined, notably <, >, [, ], \\, ^, _, {, }, |, and ~. Also, the characters ", ', and & are funny looking (but in a useful way.) .PP The .B \-w option is implemented by skipping some rows and columns. The smaller it gets, the grainier the output. Sometimes it runs letters together. .SH AUTHOR Mark Horton tween the pages. The volume is enough that you want a printer or a fast hardcopy terminal, but if you are patient, a decwriter or other 300 baud terminal will do. .SH BUGS Several ASCII characters are not defined, notably <, >, [, ], \\, ^, _, {, }, |, and ~. Also, the characters ", ', and & are funny looking (but in a useful way.) .PP The .B \-w option is implemented by skipping some rows and columns. The smaller it gets, the grainier the output. Sometimes it runs letters toman/man6/bcd.6 644 0 33 305 2512730637 6251 .TH BCD 6 .SH NAME bcd \- convert to antique media .SH SYNOPSIS .B /usr/games/bcd text .SH DESCRIPTION .I Bcd converts the literal .I text into a form familiar to old-timers. .SH "SEE ALSO" dd(1) BUGS Several ASCII characters are not defined, notably <, >, [, ], \\, ^, _, {, }, |, and ~. Also, the characters ", ', and & are funny looking (but in a useful way.) .PP The .B \-w option is implemented by skipping some /( ,( 5@Ċ /\@,\D"man/man6/boggle.6 644 0 33 3366 2512730640 7004 ((.TH BOGGLE 6 .UC 4 .SH NAME boggle \- play the game of boggle .SH SYNOPSIS .B /usr/games/boggle [ .B + ] [ .B ++ ] .SH DESCRIPTION This program is intended for people wishing to sharpen their skills at Boggle (TM Parker Bros.). If you invoke the program with 4 arguments of 4 letters each, .RI ( e.g. .RB \*(lq "boggle appl epie moth erhd" \*(rq) the program forms the obvious Boggle grid and lists all the words from .B /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 .BR /usr/dict/words . .PP The object of Boggle 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. .PP 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. .PP Advanced players may wish to invoke the program with 1 or 2 +'s as the first argument. The first + removes the restriction that positions 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. ny 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. .PP Advanced players may wish to inman/man6/chase.6 664 0 33 1164 2512730640 6624 .TH CHASE 6 4/1/81 .UC 4 .SH NAME chase \- Try to escape to killer robots .SH SYNOPSIS .B /usr/games/chase [ .I nrobots ] [ .I nfences ] .SH DESCRIPTION .PP The object of the game chase is to move around inside of the box on the screen without getting eaten by the robots chasing and without running into anything. .PP If a robot runs into another robot while chasing you, they crash and leave a junk heap. If a robot runs into a fence, it is destroyed. .PP If you can survive until all the robots are destroyed, you have won! .PP If you do not specify either .I nrobots or .I nfences, chase will prompt you for them. .SH BUGS ots ] [ .I nfences ] .SH DESCRIPTION .PP The object of the game chase is to move around inside of the box on the screen without getting eaten by the robots chasing and without running into anything. .PP If a robot runs into another robot while chasing you, they crash and leave a junk heap. If a robot runs into a fence, it is destroyed. .PP If you can survive until all the robots are destroyedman/man6/chess.6 644 0 33 1334 2512730640 6643 .TH CHESS 6 .SH NAME chess \- the game of chess .SH SYNOPSIS .B /usr/games/chess .SH DESCRIPTION .I Chess is a computer program that plays class D chess. Moves may be given either in standard (descriptive) notation or in algebraic notation. The symbol `+' is used to specify check; `o-o' and `o-o-o' specify castling. To play black, type `first'; to print the board, type an empty line. .PP Each move is echoed in the appropriate notation followed by the program's reply. .SH FILES /usr/lib/book opening `book' .SH DIAGNOSTICS The most cryptic diagnostic is `eh?' which means that the input was syntactically incorrect. .SH WARNING Over-use of this program will cause it to go away. .SH BUGS Pawns may be promoted only to queens. n algebraic notation. The symbol `+' is used to specify check; `o-o' and `o-o-o' specify castling. To play black, type `first'; to print the board, type an empty line. .PP Each move is echoed in the appropriate notation followed by the program's reply. .SH FILES /usr/lib/book opening `book'man/man6/ching.6 644 0 33 5160 2512730640 6627 .TH CHING 6 .SH NAME ching, fortune \- the book of changes and other cookies .SH SYNOPSIS .B /usr/games/ching [ hexagram ] .PP .B /usr/games/fortune .SH DESCRIPTION The .I "I Ching" or .I "Book of Changes" is an ancient Chinese oracle that has been in use for centuries as a source of wisdom and advice. .PP The text of the .I oracle (as it is sometimes known) consists of sixty-four .I hexagrams, each symbolized by a particular arrangement of six straight (\-\-\-) and broken (\-\ \-) lines. These lines have values ranging from six through nine, with the even values indicating the broken lines. .PP Each hexagram consists of two major sections. The .B Judgement relates specifically to the matter at hand (E.g., \*(lqIt furthers one to have somewhere to go.\*(rq) while the .B Image describes the general attributes of the hexagram and how they apply to one's own life (\*(lqThus the superior man makes himself strong and untiring.\*(rq). .PP When any of the lines have the values six or nine, they are moving lines; for each there is an appended judgement which becomes significant. Furthermore, the moving lines are inherently unstable and change into their opposites; a second hexagram (and thus an additional judgement) is formed. .PP Normally, one consults the oracle by fixing the desired question firmly in mind and then casting a set of changes (lines) using yarrow\-stalks or tossed coins. The resulting hexagram will be the answer to the question. .PP Using an algorithm suggested by S. C. Johnson, the Unix .IR oracle " simply reads" a question from the standard input (up to an EOF) and hashes the individual characters in combination with the time of day, process id and any other magic numbers which happen to be lying around the system. The resulting value is used as the seed of a random number generator which drives a simulated coin\-toss divination. The answer is then piped through .BR nroff " for formatting" and will appear on the standard output. .PP For those who wish to remain steadfast in the old traditions, the oracle will also accept the results of a personal divination using, for example, coins. To do this, cast the change and then type the resulting line values as an argument. .PP The impatient modern may prefer to settle for Chinese cookies; try .I fortune. .SH "SEE ALSO" It furthers one to see the great man. .SH DIAGNOSTICS The great prince issues commands, .br Founds states, vests families with fiefs. .br Inferior people should not be employed. .SH BUGS Waiting in the mud .br Brings about the arrival of the enemy. .PP If one is not extremely careful, .br Somebody may come up from behind and strike him. .br Misfortune. ge and then type the resulting line values as an argument. .PP The impatient modern may prefer to settle for Chinese cookies; try .I fortune. .SH "SEE ALSO" It furthers one to see the great man. .SH DIAGNOSTICS The great prince issues commands, .br Founds states, vests families with fiefs. .br Inferior people should not be employed. .SH BUGS Waiting in the mud .br Brings about the arrival of the eman/man6/cribbage.6 644 0 33 7607 2512730641 7306 .TH CRIBBAGE 6 .UC 4 .SH NAME cribbage \- the card game cribbage .SH SYNOPSIS .B /usr/games/cribbage [ -[r][e][q] ] name ... .SH DESCRIPTION .I Cribbage plays the card game cribbage, with the program playing one hand and the user the other. The program will initially ask the user if the rules of the game are needed -- if so, it will print out the appropriate section from .I According to Hoyle with .I more (I). .PP .I Cribbage options include: .TP .B \-e When the player makes a mistakes scoring his hand or crib, provide an explanation of the correct score. (This is especially useful for beginning players.) .TP .B \-q Print a shorter form of all messages -- this is only recommended for users who have played the game without specifying this option. .TP .B \-r Instead of asking the player to cut the deck, the program will randomly cut the deck. .PP .I Cribbage first asks the player whether he wishes to play a short game (\*(lqonce around\*(rq, to 61) or a long game (\*(lqtwice around\*(rq, to 121). A response ((of `s' will result in a short game, any other response will play a long game. .PP At the start of the first game, the program asks the player to cut the deck to determine who gets the first crib. The user should respond with a number between 0 and 51, indicating how many cards down the deck is to be cut. The player who cuts the lower ranked card gets the first crib. If more than one game is played, the loser of the previous game gets the first crib in the current game. .PP For each hand, the program first prints the player's hand, whose crib it is, and then asks the player to discard two cards into the crib. The cards are prompted for one per line, and are typed as explained below. .PP After discarding, the program cuts the deck (if it is the player's crib) or asks the player to cut the deck (if it's its crib); in the later case, the appropriate response is a number from 0 to 39 indicating how far down the remaining 40 cards are to be cut. .PP After cutting the deck, play starts with the non-dealer (the person who doesn't have the crib) leading the first card. Play continues, as per cribbage, until all cards are exhausted. The program keeps track of the scoring of all points and the total of the cards on the table. .PP After play, the hands are scored. The program requests the player to score his hand (and the crib, if it is his) by printing out the appropriate cards (and the cut card enclosed in brackets). Play continues until one player reaches the game limit (61 or 121). .PP A carriage return when a numeric input is expected is equivalent to typing the lowest legal value; when cutting the deck this is equivalent to choosing the top card. .PP Cards are specified as rank followed by suit. The ranks may be specified as one of: `a', `2', `3', `4', `5', `6', `7', `8', `9', `t', `j', `q', and `k', or alternatively, one of: \*(lqace\*(rq, \*(lqtwo\*(rq, \*(lqthree\*(rq, \*(lqfour\*(rq, \*(lqfive\*(rq, \*(lqsix\*(rq, \*(lqseven\*(rq, \*(lqeight\*(rq, \*(lqnine\*(rq, \*(lqten\*(rq, \*(lqjack\*(rq, \*(lqqueen\*(rq, and \*(lqking\*(rq. Suits may be specified as: `s', `h', `d', and `c', or alternatively as: \*(lqspades\*(rq, \*(lqhearts\*(rq, \*(lqdiamonds\*(rq, and \*(lqclubs\*(rq. A card may be specified as: \*(lq \*(rq , or: \*(lq of \*(rq . If the single letter rank and suit designations are used, the space separating the suit and rank may be left out. Also, if only one card of the desired rank is playable, typing the rank is sufficient. For example, if your hand was \*(lq2H, 4D, 5C, 6H, JC, KD\*(rq and it was desired to discard the king of diamonds, any of the following could be typed: \*(lqk\*(rq, \*(lqking\*(rq, \*(lqkd\*(rq, \*(lqk d\*(rq, \*(lqk of d\*(rq, \*(lqking d\*(rq, \*(lqking of d\*(rq, \*(lqk diamonds\*(rq, \*(lqk of diamonds\*(rq, \*(lqking diamonds\*(rq, or \*(lqking of diamonds\*(rq. .SH FILES .ta 2i /usr/games/cribbage .SH AUTHOR Earl T. Cohen .SH BUGS e card of the desired rank is playable, typing the rank is sufficient. For example, if your hand was \*(lq2H, 4D, 5C, 6H,man/man6/fish.6 664 0 33 2321 2512730641 6467 .TH FISH 6 .UC 4 .SH NAME fish \- play ``Go Fish'' .SH SYNOPSIS .B /usr/games/fish .SH DESCRIPTION .I Fish plays the game of \*(lqGo Fish\*(rq, 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. .PP 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. lt 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. .PP To play the computer, simply make guesses by typing a, 2, 3, 4, 5, 6, 7, 8, 9, 10, j, q, man/man6/fortune.6 664 0 33 2001 2512730641 7213 .TH FORTUNE 6 .SH NAME fortune \- print a random, hopefully interesting, adage .SH SYNOPSIS .B fortune [ .B \- ] [ .B \-wslao ] ..[ file ] .SH DESCRIPTION .I Fortune with no arguments prints out a random adage. The flags mean: .sp .TP 5 .B \-w Waits before termination for an amount of time calculated from the number of characters in the message. This is useful if it is executed as part of the logout procedure to guarantee that the message can be read before the screen is cleared. .TP 5 .B \-s Short messages only. .TP 5 .B \-l Long messages only. .TP .B \-o Choose from an alternate list of adages, often used for portentially offensive ones. .TP .B \-a Choose from either list of adages. .PP ..The user may specify a file of adages. ..This file must be created by strfile(6), ..and be given by the user as ...it file. ..Only one such file may be named, ..subsequent ones are ignored. .sp Mail suggestions for new fortunes to "fortune". .SH FILES /usr/lib/fortunes.dat .SH AUTHOR Ken Arnold ...SH SEE\ ALSO ..strfile(6) only. .TP 5 .B \-l Long messages only. .TP .B \-o Choose from an alternate list of adages, often used for portentially offensive ones. .TP .B \-a Choose from either list of adages. .PP ..The user may specify a file of adages. ..This file must be created by strfile(6), ..and be given by the user as ...it file. ..Only one such file may be named, ..subsequent ones are ignored. .sp Mail suggestions for new fortunes to "fortune". .SH FILES /usr/lib/fortunes.dat .SH AUTHOR Ken Arnold ...SH SEE\ ALSO ..strfile(6)man/man6/hangman.6 644 0 33 772 2513541257 7141 .TH HANGMAN 6 .SH NAME hangman \- Computer version of the game hangman .SH SYNOPSIS .B /usr/games/hangman .SH DESCRIPTION In .I hangman, the computer picks a word from the on-line word list and you must try to guess it. The computer keeps track of which letters have been guessed and how many wrong guesses you have made on the screen in a graphic fashion. .SH FILES /usr/dict/words On-line word list .SH AUTHOR Modified for terminal graphics from the original source from BTL by Michael Toy. .SH BUGS "man/man6/mille.6 664 0 33 24022 2512730642 6663 .TH MILLE 6 .UC 4 .SH NAME mille \- play Mille Bournes .SH SYNOPSIS .B /usr/games/mille [ file ] .SH DESCRIPTION .I Mille plays a two-handed game reminiscent of the Parker Brother's game of Mille Bournes with you. The rules are described below. If a file name is given on the command line, the game saved in that file is started. .PP When a game is started up, the bottom of the score window will contain a list of commands. They are: .IP P Pick a card from the deck. This card is placed in the `P' slot in your hand. .IP D Discard a card from your hand. To indicate which card, type the number of the card in the hand (or \*(lqP\*(rq for the just-picked card) followed by a or . The is required to allow recovery from typos which can be very expensive, like discarding safeties. .IP U Use a card. The card is again indicated by its number, followed by a or . .IP O Toggle ordering the hand. By default off, if turned on it will sort the cards in your hand appropriately. This is not recommended for the impatient on slow terminals. .IP Q Quit the game. This will ask for confirmation, just to be sure. Hitting (or ) is equivalent. .IP S Save the game in a file. If the game was started from a file, you will be given an opportunity to save it on the same file. If you don't wish to, or you did not start from a file, you will be asked for the file name. If you type a without a name, the save will be terminated and the game resumed. .IP R Redraw the screen(( from scratch. The command ^L (control `L') will also work. .IP W Toggle window type. This switches the score window between the startup window (with all the command names) and the end-of-game window. Using the end-of-game window saves time by eliminating the switch at the end of the game to show the final score. Recommended for hackers and other miscreants. .PP If you make a mistake, an error message will be printed on the last line of the score window, and a bell will beep. .PP At the end of each hand or game, you will be asked if you wish to play another. If not, it will ask you if you want to save the game. If you do, and the save is unsuccessful, play will be resumed as if you had said you wanted to play another hand/game. This allows you to use the .RB \*(lq S \*(rq command to reattempt the save. .SH AUTHOR Ken Arnold .br (The game itself is a product of Parker Brothers, Inc.) .SH "SEE ALSO" curses(3), .I "Screen Updating and Cursor Movement Optimization:" .IR "A Library Package" , Ken Arnold .SH CARDS .PP Here is some useful information. The number in parentheses after the card name is the number of that card in the deck: .sp .nf .ne 10 .ta \w'Speed Limit (3)'u+3n \w'Speed Limit (3)'u+\w'End of Limit (6)'u+6n Hazard Repair Safety .sp Out of Gas (2) Gasoline (6) Extra Tank (1) Flat Tire (2) Spare Tire (6) Puncture Proof (1) Accident (2) Repairs (6) Driving Ace (1) Stop (4) Go (14) Right of Way (1) Speed Limit (3) End of Limit (6) .sp .ce 25 \- (10), 50 \- (10), 75 \- (10), 100 \- (12), 200 \- (4) .sp .fi .DT .SH RULES .PP .BR Object : The point of game is to get a total of 5000 points in several hands. Each hand is a race to put down exactly 700 miles before your opponent does. Beyond the points gained by putting down milestones, there are several other ways of making points. .PP .BR Overview : The game is played with a deck of 101 cards. .I Distance cards represent a number of miles traveled. They come in denominations of 25, 50, 75, 100, and 200. When one is played, it adds that many miles to the player's trip so far this hand. .I Hazard cards are used to prevent your opponent from putting down Distance cards. They can only be played if your opponent has a .I Go card on top of the Battle pile. The cards are .IR "Out of Gas" , .IR "Accident" , .IR "Flat Tire" , .IR "Speed Limit" , and .IR "Stop" . .I Remedy cards fix problems caused by Hazard cards played on you by your opponent. The cards are .IR "Gasoline" , .IR "Repairs" , .IR "Spare Tire" , .IR "End of Limit" , and .IR "Go" . .I Safety cards prevent your opponent from putting specific Hazard cards on you in the first place. They are .IR "Extra Tank" , .IR "Driving Ace" , .IR "Puncture Proof" , and .IR "Right of Way" , and there are only one of each in the deck. .PP .BR "Board Layout" : The board is split into several areas. From top to bottom, they are: .B "SAFETY AREA" (unlabeled): This is where the safeties will be placed as they are played. .BR HAND : These are the cards in your hand. .BR BATTLE : This is the Battle pile. All the Hazard and Remedy Cards are played here, except the .I "Speed Limit" and .I "End of Limit" cards. Only the top card is displayed, as it is the only effective one. .BR SPEED : The Speed pile. The .I "Speed Limit" and .I "End of Limit" cards are played here to control the speed at which the player is allowed to put down miles. .BR MILEAGE : Miles are placed here. The total of the numbers shown here is the distance traveled so far. .PP .BR Play : The first pick alternates between the two players. Each turn usually starts with a pick from the deck. The player then plays a card, or if this is not possible or desirable, discards one. Normally, a play or discard of a single card constitutes a turn. If the card played is a safety, however, the same player takes another turn immediately. .PP This repeats until one of the players reaches 700 points or the deck runs out. If someone reaces 700, they have the option of going for an .IR Extension , which means that the play continues until someone reaches 1000 miles. .PP .BR "Hazard and Remedy Cards" : Hazard Cards are played on your opponent's Battle and Speed piles. Remedy Cards are used for undoing the effects of your opponent's nastyness. .PP .RB "\ \ \ \ " Go (Green Light) must be the top card on your Battle pile for you to play any mileage, unless you have played the .I "Right of Way" card (see below). .br .RB "\ \ \ \ " Stop is played on your opponent's .I Go card to prevent them from playing mileage until they play a .I Go card. .br .RB "\ \ \ \ " "Speed Limit" is played on your opponent's Speed pile. Until they play an .I "End of Limit" they can only play 25 or 50 mile cards, presuming their .I Go card allows them to do even that. .br .RB "\ \ \ \ " "End of Limit" is played on your Speed pile to nullify a .I "Speed Limit" played by your opponent. .br .RB "\ \ \ \ " "Out of Gas" is played on your opponent's .I Go card. They must then play a .I Gasoline card, and then a .I Go card before they can play any more mileage. .br .RB "\ \ \ \ " "Flat Tire" is played on your opponent's .I Go card. They must then play a .I "Spare Tire" card, and then a .I Go card before they can play any more mileage. .br .RB "\ \ \ \ " "Accident" is played on your opponent's .I Go card. They must then play a .I Repairs card, and then a .I Go card before they can play any more mileage. .br .PP .BR "Safety Cards" : Safety cards prevent your opponent from playing the corresponding Hazard cards on you for the rest of the hand. It cancels an attack in progress, and .IR "always entitles the player to an extra turn" . .br .RB "\ \ \ \ " "Right of Way" prevents your opponent from playing both .I Stop and .I "Speed Limit" cards on you. It also acts as a permanent .I Go card for the rest of the hand, so you can play mileage as long as there is not a Hazard card on top of your Battle pile. In this case only, your opponent can play Hazard cards directly on a Remedy card besides a Go card. .br .RB "\ \ \ \ " "Extra Tank" When played, your opponent cannot play an .I "Out of Gas" on your Battle Pile. .br .RB "\ \ \ \ " "Puncture Proof" When played, your opponent cannot play a .I "Flat Tire" on your Battle Pile. .br .RB "\ \ \ \ " "Driving Ace" When played, your opponent cannot play an .I Accident on your Battle Pile. .PP .BR "Distance Cards" : Distance cards are played when you have a .I Go card on your Battle pile, or a Right of Way in your Safety area and are not stopped by a Hazard Card. They can be played in any combination that totals exactly 700 miles, except that .IR "you cannot play more than two 200 mile cards in one hand" . A hand ends whenever one player gets exactly 700 miles or the deck runs out. In that case, play continues until neither someone reaches 700, or neither player can use any cards in their hand. If the trip is completed after the deck runs out, this is called .IR "Delayed Action" . .PP .BR "Coup Fourr\o'\(aae'" : This is a French fencing term for a counter-thrust move as part of a parry to an opponents attack. In Mille Bournes, it is used as follows: If an opponent plays a Hazard card, and you have the corresponding Safety in your hand, you play it immediately, even .I before you draw. This immediately removes the Hazard card from your Battle pile, and protects you from that card for the rest of the game. This gives you more points (see \*(lqScoring\*(rq below). .PP .BR Scoring : Scores are totaled at the end of each hand, whether or not anyone completed the trip. The terms used in the Score window have the following meanings: .br .RB "\ \ \ \ " "Milestones Played" : Each player scores as many miles as they played before the trip ended. .br .RB "\ \ \ \ " "Each Safety" : 100 points for each safety in the Safety area. .br .RB "\ \ \ \ " "All 4 Safeties" : 300 points if all four safeties are played. .br .RB "\ \ \ \ " "Each Coup Four\o'\(aae'" : 300 points for each Coup Four\o'\(aae' accomplished. .PP The following bonus scores can apply only to the winning player. .br .RB "\ \ \ \ " "Trip Completed" : 400 points bonus for completing the trip to 700 or 1000. .br .RB "\ \ \ \ " "Safe Trip" : 300 points bonus for completing the trip without using any 200 mile cards. .br .RB "\ \ \ \ " "Delayed Action" : 300 points bonus for finishing after the deck was exhausted. .br .RB "\ \ \ \ " "Extension" : 200 points bonus for completing a 1000 mile trip. .br .RB "\ \ \ \ " "Shut-Out" : 500 points bonus for completing the trip before your opponent played any mileage cards. .PP Running totals are also kept for the current score for each player for the hand .RB ( "Hand Total" ), the game .RB ( "Overall Total" ), and number of games won .RB ( Games ). hout using any 200 mile cards. .br .RB "\ \ \ \ " "Delayed Action" : 300 points bonus for finishing after the deck was exhausted. .br .RB "\ \ \ \ " "Extension" : 200 points bonus for completing a 1000 mile trip. .br .RB "\ \ \ \ " "Shut-Out" : 500 points bonus for completing the trip before your opponent played any mileage cards. .PP Running totals are also kept for the current score for each player for the hand .RB ( "Hand Total" ), the game .RB ( "Overall Total" ), and number of games wman/man6/monop.6 644 0 33 11207 2512730642 6710 .de Sc \" start command list macro .ie n .PD 0 .el .PD 0.5 .sp .. .de Cm \" define command macro .TP 10 .ie t .BR "\\$1" : .el .IR "\\$1" : .. .de Ec \" end command macro .PD 1 .. .TH MONOP 6 .UC 4 .SH NAME monop \- Monopoly game .SH SYNOPSIS .B /usr/games/monop [ file ] .SH DESCRIPTION .I Monop is reminiscent of the Parker Brother's game Monopoly, and monitors a game between 1 to 9 users. It is assumed that the rules of Monopoly are known. The game follows the standard rules, with the exception that, if(( a property would go up for auction and there are only two solvent players, no auction is held and the property remains unowned. .PP The game, in effect, lends the player money, so it is possible to buy something which you cannot afford. However, as soon as a person goes into debt, he must \*(lqfix the problem\*(rq, .IR i.e. , make himself solvent, before play can continue. If this is not possible, the player's property reverts to his debtee, either a player or the bank. A player can resign at any time to any person or the bank, which puts the property back on the board, unowned. .PP Any time that the response to a question is a .IR string , e.g., a name, place or person, you can type `?' to get a list of valid answers. It is not possible to input a negative number, nor is it ever necessary. .Sc .IR "A Summary of Commands" : .Cm quit quit game: This allows you to quit the game. It asks you if you're sure. .Cm print print board: This prints out the current board. The columns have the following meanings (column headings are the same for the .BR where , .BR "own holdings" , and .B holdings commands): .PP .RS 10 .TP "\w'Name\ \ 'u" Name The first ten characters of the name of the square .TP Own The \fInumber\fR of the owner of the property. .TP Price The cost of the property (if any) .TP Mg This field has a `*' in it if the property is mortgaged .TP # If the property is a Utility or Railroad, this is the number of such owned by the owner. If the property is land, this is the number of houses on it. .TP Rent Current rent on the property. If it is not owned, there is no rent. .RE .Cm where where players are: Tells you where all the players are. A `*' indicates the current player. .Cm "own\ holdings" List your own holdings, .IR i.e. , money, get-out-of-jail-free cards, and property. .Cm holdings holdings list: Look at anyone's holdings. It will ask you whose holdings you wish to look at. When you are finished, type \*(lqdone\*(rq. .Cm shell shell escape: Escape to a shell. When the shell dies, the program continues where you left off. .Cm mortgage mortgage property: Sets up a list of mortgageable property, and asks which you wish to mortgage. .Cm unmortgage unmortgage property: Unmortgage mortgaged property. .Cm buy buy houses: Sets up a list of monopolies on which you can buy houses. If there is more than one, it asks you which you want to buy for. It then asks you how many for each piece of property, giving the current amount in parentheses after the property name. If you build in an unbalanced manner (a disparity of more than one house within the same monopoly), it asks you to re-input things. .Cm sell sell houses: Sets up a list of monopolies from which you can sell houses. it operates in an analogous manner to .I buy .Cm card card for jail: Use a get-out-of-jail-free card to get out of jail. If you're not in jail, or you don't have one, it tells you so. .Cm pay pay for jail: Pay $50 to get out of jail, from whence you are put on Just Visiting. Difficult to do if you're not there. .Cm trade This allows you to trade with another player. It asks you whom you wish to trade with, and then asks you what each wishes to give up. You can get a summary at the end, and, in all cases, it asks for confirmation of the trade before doing it. .Cm resign Resign to another player or the bank. If you resign to the bank, all property reverts to its virgin state, and get-out-of-jail free cards revert to the deck. .Cm save save game: Save the current game in a file for later play. You can continue play after saving, either by adding the file in which you saved the game after the .I monop command, or by using the .I restore command (see below). It will ask you which file you wish to save it in, and, if the file exists, confirm that you wish to overwrite it. .Cm restore restore game: Read in a previously saved game from a file. It leaves the file intact. .Cm roll Roll the dice and move forward to your new location. If you simply hit the key instead of a command, it is the same as typing .IR roll . .Ec .SH AUTHOR Ken Arnold .SH FILES /usr/games/lib/cards.pck Chance and Community Chest cards .SH BUGS No command can be given an argument instead of a response to a query. wish to save it in, and, if the file exists, confirm that you wish to overwrite it. .Cm restore restore game: Read in a previously saved game from a file. It leaves the file intact. .Cm roll Roll the dice and move forward to your new location. If you simply hit the key instead of a command, it is the same as typing .IR roll . .Ec .SH AUTHOR Ken Arnold .SH FILES /uman/man6/number.6 644 0 33 534 2512730642 7011 .TH NUMBER 6 .SH NAME number \- convert Arabic numerals to English .SH SYNOPSIS .B /usr/games/number .SH DESCRIPTION .I Number copies the standard input to the standard output, changing each decimal number to a fully spelled out version. Punctuation is added to make the output sound well when played through .IR speak (1). .SH "SEE ALSO" speak(1) forward to your new location. If you simply hit the key inst/( ,( 5Ċ /\@,\D"man/man6/quiz.6 644 0 33 3147 2512730642 6534 .TH QUIZ 6 .SH NAME quiz \- test your knowledge .SH SYNOPSIS .B /usr/games/quiz [ .B \-i file ] [ .B \-t ] [ category1 category2 ] .SH DESCRIPTION .I Quiz gives associative knowledge tests on various subjects. It asks items chosen from .I category1 and expects answers from .IR category2 . If no categories are specified, .I quiz gives instructions and lists the available categories. .PP .I Quiz tells a correct answer whenever you type a bare newline. At the end of input, upon interrupt, or when questions run out, .I quiz reports a score and terminates. .PP The .B \-t flag specifies `tutorial' mode, where missed questions are repeated later, and material is gradually introduced as you learn. .PP The .B \-i flag causes the named file to be substituted for the default index file. The lines of these files have the syntax: .IP "" 4 .nf .ta \w'alternate 'u line = category newline \(bv category `:' line category = alternate \(bv category `|' alternate alternate = empty \(bv alternate primary primary = character \(bv `[' category `]' \(bv option option = `{' category `}' .PP .fi The first category on each line of an index file names an information file. The remaining categories specify the order and contents of the data in each line of the information file. Information files have the same syntax. Backslash `\\' is used as with .IR sh (1) to quote syntactically significant characters or to insert transparent newlines into a line. When either a question or its answer is empty, .I quiz will refrain from asking it. .SH FILES /usr/games/quiz.k/* .SH BUGS The construct `a|ab' doesn't work in an information file. Use `a{b}'. index file names an information file. The remaining categories specify the order and contents of the data in each line of the information file. Information files have the same syntax. Backslash `\\' is used as with .IR sh (1) to quote syntactically significant characters or to insert transparent newlines into a line. When either a question or its answer is empty, .I quiz will refrain from asking it. .SH FIman/man6/rogue.6 664 0 33 3106 2512730643 6663 .TH ROGUE 6 4/1/81 .UC 4 .SH NAME rogue \- Exploring The Dungeons of Doom .SH SYNOPSIS .B rogue [ .I save_file ] .SH DESCRIPTION .PP .I Rogue is a computer fantasy game with a new twist. It is crt oriented and the object of the game is to survive the attacks of various monsters and get a lot of gold, rather than the puzzle solving orientation of most computer fantasy games. .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, they 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 (by some miracle) manage to win, .I rogue will give you alist of the top-ten scorers. The scoring is based entirely upon how much gold you get. There is a 10% penalty for getting yourself killed. .PP For more detailed directions, read the document .I "A Guide to the Dungeons of Doom." .SH FILES .DT /usr/games/lib/rogue_roll Score file .br ~/rogue.sav Default save file .SH SEE ALSO Michael C. Toy, .I "A guide to the Dungeons of Doom" .SH BUGS .PP Probably infinite. Currently known bugs are: Sometimes you are still hungry even after you eat food and sometimes you get a monster o((n the screen in reverse video which may or may not cause a core dump. There is a 10% penalty for getting yourself killed. .PP For more detailed directions, read the document .I "A Guide to the Dungeons of Doom." .SH FILES .DT /usr/games/lib/rogue_roll Score file .br ~/rogue.sav Default save file .SH SEE ALSO Michael C. Toy, .I "A guide to the Dungeons of Doom" .SH BUGS .PP Probably infinite. Currently known bugs are: Sometimes you are still hungry even after you eat food and sometimes you get a monster oman/man6/snake.6 664 0 33 5155 2512730643 6651 .TH SNAKE 6 .UC 4 .SH NAME snake, snscore \- display chase game .SH SYNOPSIS .B /usr/games/snake [ .BI \-w n ] [ .BI \-l n ] .br .B /usr/games/snscore .SH DESCRIPTION Snake is a display-based game which must be played on a CRT terminal from among those supported by vi(1). The object of the game is to make as much money as possible without getting eaten by the snake. The .B \-l and .B \-w options allow you to specify the length and width of the field. By default the entire screen (except for the last column) is used. .PP You are represented on the screen by an I. The snake is 6 squares long and is represented by S's. The money is $, and an exit is #. Your score is posted in the upper left hand corner. .PP You can move around using the same conventions as vi(1), the h, j, k, and l keys work, as do the arrow keys. Other possibilities include: .IP sefc These keys are like hjkl but form a directed pad around the d key. .IP HJKL These keys move you all the way in the indicated direction to the same row or column as the money. This does .I not let you jump away from the snake, but rather saves you from having to type a key repeatedly. The snake still gets all his turns. .IP SEFC Likewise for the upper case versions on the left. .IP ATPB These keys move you to the four edges of the screen. Their position on the keyboard is the mnemonic, e.g. P is at the far right of the keyboard. .IP x This lets you quit the game at any time. .IP p Points in a direction you might want to go. .IP w Space warp to get out of tight squeezes, at a price. .IP ! Shell escape .IP ^Z Suspend the snake game, on systems which support it. Otherwise an interactive shell is started up. .PP To earn money, move to the same square the money is on. A new $ will appear when you earn the current one. As you get richer, the snake gets hungrier. To leave the game, move to the exit (#). .PP A record is kept of the personal best score of each player. Scores are only counted if you leave at the exit, getting eaten by the snake is worth nothing. .PP As in pinball, matching the last digit of your score to the number which appears after the game is worth a bonus. .PP To see who wastes time playing snake, run .I /usr/games/snscore . .SH FILES .nf .ta \w'/usr/games/lib/snakerawscores 'u /usr/games/lib/snakerawscores database of personal bests /usr/games/lib/snake.log log of games played /usr/games/busy program to determine if system too busy .DT .fi .SH BUGS .PP When playing on a small screen, it's hard to tell when you hit the edge of the screen. .PP The scoring function takes into account the size of the screen. A perfect function to do this equitably has not been devised. ee who wastes time playing snake, run .I /usr/games/snscore . .SH FILES .nf .ta \w'/usr/games/lib/snakerawscores 'u /usr/games/lib/snakerawscores database of personal bests /usr/games/lib/snake.log log of games played /usr/games/busy program to determine if system too busy .DT .fi .SH BUGS .PP When playing on a small screen, it's hard to tell when you hit the edge of the screen. .PP The scoring functman/man6/trek.6 664 0 33 3244 2531446307 6514 .TH TREK 6 .UC 4 .SH NAME trek \- trekkie game .SH SYNOPSIS .B /usr/games/trek [ [ .B \-a ] file ] .SH DESCRIPTION .I Trek is a game of space glory and war. Below is a summary of commands. For complete documentation, see .IR Trek by Eric Allman. .PP If a filename is given, a log of the game is written onto that file. If the .B \-a flag is given before the filename, that file is appended to, not truncated. .PP The game will ask you what length game you would like. Valid responses are \*(lqshort\*(rq, \*(lqmedium\*(rq, and \*(lqlong\*(rq. You may also type \*(lqrestart\*(rq, which restarts a previously saved game. You will then be prompted for the skill, to which you must respond \*(lqnovice\*(rq, \*(lqfair\*(rq, \*(lqgood\*(rq, \*(lqexpert\*(rq, \*(lqcommadore\*(rq, or \*(lqimpossible\*(rq. You should normally start out with a novice and work up. .PP In general, throughout the game, if you forget what is appropriate the game will tell you what it expects if you just type in a question mark. .SH AUTHOR Eric Allman .SH "SEE ALSO" /usr/doc/trek .SH "COMMAND SUMMARY" .ie t .ds f \fB .el .ds f \fI .ta 3i .nf \*fabandon\fR \*fca\fRpture \*fcl\fRoak \*fu\fRp/\*fd\fRown \*fc\fRomputer request; ... \*fda\fRmages \*fdestruct\fR \*fdo\fRck \*fhelp\fR \*fi\fRmpulse course distance \*fl\fRrscan \*fm\fRove course distance \*fp\fRhasers \*fa\fRutomatic amount \*fp\fRhasers \*fm\fRanual amt1 course1 spread1 ... \*ft\fRorpedo course [\*fy\fRes] angle/\*fn\fRo \*fram\fR course distance \*fr\fRest time \*fshell\fR \*fsh\fRields \*fu\fRp/\*fd\fRown \*fs\fRrscan [\*fy\fRes/\*fn\fRo] \*fst\fRatus \*fterminate\fR \*fy\fRes/\*fn\fRo \*fu\fRndock \*fv\fRisual course \*fw\fRarp warp_factor .fi .DT mputer request; ... \*fda\fRmages \*fdestruct\fR \*fdo\fRck \*fhelp\fR \*fi\fRmpulse course distance \*fl\fRrscan \*fm\fRove course distance \*fp\fRhasers \*fa\fRutomatic amount \*fp\fRhasers \*fm\fRanual amt1 course1 spread1 ... \*ft\fRorpedo course [\*fy\fRes] angle/\*fn\fRo \*fram\fR course distance \*fr\fRest time \*fshell\fR \*fsh\fRields \*man/man6/worm.6 664 0 33 2131 2512730644 6524 .TH WORM 6 4/2/81 .SH NAME worm \- Play the growing worm game .SH SYNOPSIS .B worm [ .I size ] .SH DESCRIPTION .PP In .I worm, you are a little worm, your body is the "o"'s on the screen and your head is the "@". You move with the hjkl keys (as in the game snake). If you don't press any keys, you continue in the direction you last moved. The upper case HJKL keys move you as if you had pressed several (9 for HL and 5 for JK) of the corrosponding lower case key (unless you run into a digit, then it stops). .PP On the screen you will see a digit, if your worm eats the digit is will grow longer, the actual amount longer depends on which digit it was that you ate. The object of the game is to see how long you can make the worm grow. .PP The game ends when the worm runs into either the sides of the screen, or itself. The current score (how much the worm has grown) is kept in the upper left corner of the screen. .PP The optional argument, if present, is the initial length of the worm. .SH BUGS If the initial length of the worm is set to less than one or more than 75, various strange things happen. the actual amount longer depends on which digit it was that you ate. The object of the game is to see how long you can make the worm grow. .PP The game ends when the worm runs into either the sides of the screen, or itself. The current score (how much the worm has grown) is kept in the upper left corner of the screen. .PP The optional argument, if present, is the initial length of the worm. .SH BUGS If the initial leman/man6/wump.6 644 0 33 1351 2512730644 6531 .TH WUMP 6 .SH NAME wump \- the game of hunt-the-wumpus .SH SYNOPSIS .B /usr/games/wump .SH DESCRIPTION .I Wump plays the game of `Hunt the Wumpus.' A Wumpus is a creature that lives in a cave with several rooms connected by tunnels. You wander among the rooms, trying to shoot the Wumpus with an arrow, meanwhile avoiding being eaten by the Wumpus and falling into Bottomless Pits. There are also Super Bats which are likely to pick you up and drop you in some random room. .PP The program asks various questions which you answer one per line; it will give a more detailed description if you want. .PP This program is based on one described in .I "People's Computer Company," .I 2, 2 (November 1973). .SH BUGS It will never replace Space War. . You wander among the rooms, trying to shoot the Wumpus with an arrow, meanwhile avoiding being eaten by the Wumpus and falling into Bottomless Pits. There are also Super Bats which are likely to pick you up and drop you in some random room. .PP The program asks various questio((man/man6/zork.6 664 0 33 2043 2512730644 6527 .TH ZORK 6 .UC 4 .SH NAME zork \- the game of dungeon .SH SYNOPSIS .B /usr/games/zork .SH DESCRIPTION .I Dungeon is a computer fantasy simulation based on Adventure and on Dungeons & Dragons, originally written by Lebling, Blank, and Anderson of MIT. In it you explore a dungeon made up of various rooms, caves, rivers, and so on. The object of the game is to collect as much treasure as possible and stow it safely in the trophy case (and, of course, to stay alive.) .PP Figuring out the rules is part of the game, but if you are stuck, you should start off with \*(lqopen mailbox\*(rq, \*(lqtake leaflet\*(rq, and then \*(lqread leaflet\*(rq. Additional useful commands that are not documented include: .PP quit (to end the game) .PP !cmd (the usual shell escape convention) .PP > (to save a game) .PP < (to restore a game) .SH FILES /usr/games/lib/d* .SH BUGS We don't have the source, only a pdp-11 binary that has been severely munged to get it to work on V7 Unix. (The original binary was for RSX-11, which was patched for V6, and then patched for V7.) d start off with \*(lqopen mailbox\*(rq, \*(lqtake leaflet\*(rq, and then \*(lqread leaflet\*(rq. Additional useful commands that are not documented include: .PP quit (to end the game) .PP !cmd (the usual shell escape convention) .PP > (to save a game) .PP < (to restore a game) .SH FILES /usr/games/lib/d* .SH BUGS We don't have the source, only a pdp-11 binary that has been severely munged to get it to work on V7 Unix. (The original binary was for RSX-11, which was patchedman/man6/rain.6 664 0 33 665 2527172065 6466 .TH RAIN 6 .SH NAME rain \- animated raindrops display .SH SYNOPSIS rain .SH DESCRIPTION .PP .ad b .IR Rain 's display is modeled after the VAX/VMS program of the same name. The terminal has to be set for 9600 baud to obtain the proper effect. .PP As with all programs that use .IR termcap , the TERM environment variable must be set (and exported) to the type of the terminal being used. .SH FILES /etc/termcap .SH AUTHOR Eric P. Scott ,( 5pĊ /\@,\D"man/man6/worms.6 664 0 33 2637 2527172066 6726 .TH WORMS 6 .SH NAME worms \- animate worms on a display terminal .SH SYNOPSIS .B worms [ .B -field ] [ .B -length # ] [ .B -number # ] [ .B -trail ] .SH DESCRIPTION .ad b Brian Horn (cithep!bdh) showed me a .I TOPS-20 program on the DEC-2136 machine called .IR WORM , and suggested that I write a similar program that would run under .IR Unix . I did, and no apologies. .PP .B -field makes a "field" for the worm(s) to eat; .B -trail causes each worm to leave a trail behind it. You can figure out the rest by yourself. .SH FILES /etc/termcap .SH AUTHOR Eric P. Scott .SH SEE ALSO .IR Snails , by Karl Heuer .SH DIAGNOSTICS Invalid length .br Value not in range 2 <= length <= 1024 .sp Invalid number of worms .br Value not in range 1 <= number <= 40 .sp TERM: parameter not set .br The .B TERM environment variable is not defined. Do .sp \fBTERM=\fRterminal type .br \fBexport TERM\fR .sp Unknown terminal type .br Your terminal type (as determined from the .B TERM environment variable) is not defined in .BR /etc/termcap . .sp Terminal not capable of cursor motion .br Your terminal is too stupid to run this program. .sp Out of memory .br This should never happen on a VAX. .SH BUGS The lower-right-hand character position will not be updated properly on a terminal that wraps at the right margin. .PP Terminal initialization is not performed. .PP There should be an option to have the worms eat .I Pink Floyd lyrics. br Your terminal type (as determined from the .B TERM environment variable) is not defined in .Bman/man6/doctor.6 644 0 33 1312 2527170522 7027 .TH DOCTOR 6 .UC 4 .SH NAME doctor \- interact with a psychoanalyst .SH SYNOPSIS .B /usr/games/doctor .SH DESCRIPTION .I Doctor is a lisp-language version of the legendary ELIZA program of Joseph Weizenbaum. This script "simulates" a Rogerian psychoanalyst. Type in lower case, and when you get tired or bored, type your interrupt character (either control-C or Rubout). Remember to type two carriage returns when you want it to answer. .PP In order to run this you must have a Franz Lisp system in /usr/ucb/lisp. .SH AUTHORS Adapted for Lisp by Jon L White, moved to Franz by John Foderaro, from an original script by Joseph Weizenbaum. .SH BUG It shows how impressed people were willing to be way back then. nbaum. This script "simulates" a Rogerian psychoanalyst. Type in lower case, and when you get tired or bored, type your interrupt character (either control-C or Rubout). Remember to type two carriage returns when you want it to answer. .PP In order to run this you must have a Franz Lisp system in /usr/ucb/man/man7/ 775 0 33 0 2512730651 5366 man/man7/ascii.7 644 0 33 4473 2512730646 6645 .TH ASCII 7 .SH NAME ascii \- map of ASCII character set .SH SYNOPSIS .B cat /usr/pub/ascii .SH DESCRIPTION .I Ascii is a map of the ASCII character set, to be printed as needed. It contains: .nf .cs R 20 |000 nul|001 soh|002 stx|003 etx|004 eot|005 enq|006 ack|007 bel| |010 bs |011 ht |012 nl |013 vt |014 np |015 cr |016 so |017 si | |020 dle|021 dc1|022 dc2|023 dc3|024 dc4|025 nak|026 syn|027 etb| |030 can|031 em |032 sub|033 esc|034 fs |035 gs |036 rs |037 us | |040 sp |041 ! |042 " |043 # |044 $ |045 % |046 & |047 \' | |050 ( |051 ) |052 * |053 + |054 , |055 \- |056 . |057 / | |060 0 |061 1 |062 2 |063 3 |064 4 |065 5 |066 6 |067 7 | |070 8 |071 9 |072 : |073 ; |074 < |075 = |076 > |077 ? | |100 @ |101 A |102 B |103 C |104 D |105 E |106 F |107 G | |110 H |111 I |112 J |113 K |114 L |115 M |116 N |117 O | |120 P |121 Q |122 R |123 S |124 T |125 U |126 V |127 W | |130 X |131 Y |132 Z |133 [ |134 \\ |135 ] |136 ^ |137 _ | |140 \` |141 a |142 b |143 c |144 d |145 e |146 f |147 g | |150 h |151 i |152 j |153 k |154 l |155 m |156 n |157 o | |160 p |161 q |162 r |163 s |164 t |165 u |166 v |167 w | |170 x |171 y |172 z |173 { |174 | |175 } |176 ~ |177 del| | 00 nul| 01 soh| 02 stx| 03 etx| 04 eot| 05 enq| 06 ack| 07 bel| | 08 bs | 09 ht | 0a nl | 0b vt | 0c np | 0d cr | 0e so | 0f si | | 10 dle| 11 dc1| 12 dc2| 13 dc3| 14 dc4| 15 nak| 16 syn| 17 etb| | 18 can| 19 em | 1a sub| 1b esc| 1c fs | 1d gs | 1e rs | 1f us | | 20 sp | 21 ! | 22 " | 23 # | 24 $ | 25 % | 26 & | 27 \' | | 28 ( | 29 ) | 2a * | 2b + | 2c , | 2d \- | 2e . | 2f / | | 30 0 | 31 1 | 32 2 | 33 3 | 34 4 | 35 5 | 36 6 | 37 7 | | 38 8 | 39 9 | 3a : | 3b ; | 3c < | 3d = | 3e > | 3f ? | | 40 @ | 41 A | 42 B | 43 C | 44 D | 45 E | 46 F | 47 G | | 48 H | 49 I | 4a J | 4b K | 4c L | 4d M | 4e N | 4f O | | 50 P | 51 Q | 52 R | 53 S | 54 T | 55 U | 56 V | 57 W | | 58 X | 59 Y | 5a Z | 5b [ | 5c \\ | 5d ] | 5e ^ | 5f _ | | 60 \` | 61 a | 62 b | 63 c | 64 d | 65 e | 66 f | 67 g | | 68 h | 69 i | 6a j | 6b k | 6c l | 6d m | 6e n | 6f o | | 70 p | 71 q | 72 r | 73 s | 74 t | 75 u | 76 v | 77 w | | 78 x | 79 y | 7a z | 7b { | 7c | | 7d } | 7e ~ | 7f del| .fi .cs R .SH FILES /usr/pub/ascii F | 47 G | | 48 H | 49 I | 4a J | 4b K | 4c L | 4d M | 4e N | 4f O | | 50 P | 51 Q | 52 R | 53 S | 54 T | 55 U | 56 V | 57 W | | 58 X | 59 Y | 5a Z | 5b [ | 5c \\ | 5d ] | 5((man/man7/eqnchar.7 644 0 33 10447 2512730647 7215 .EQ tdefine ciplus % "\o'\(pl\(ci'" % ndefine ciplus % O+ % tdefine citimes % "\o'\(mu\(ci'" % ndefine citimes % Ox % tdefine =wig % "\(eq\h'-\w'\(eq'u-\w'\s-2\(ap'u/2u'\v'-.4m'\s-2\z\(ap\(ap\s+2\v'.4m'\h'\w'\(eq'u-\w'\s-2\(ap'u/2u'" % ndefine =wig % ="~" % tdefine bigstar % "\o'\(pl\(mu'" % ndefine bigstar % X|- % tdefine =dot % "\z\(eq\v'-.6m'\h'.2m'\s+2.\s-2\v'.6m'\h'.1m'" % ndefine =dot % = dot % tdefine orsign % "\s-2\v'-.15m'\z\e\e\h'-.05m'\z\(sl\(sl\v'.15m'\s+2" % ndefine orsign % \e/ % tdefine andsign % "\s-2\v'-.15m'\z\(sl\(sl\h'-.05m'\z\e\e\v'.15m'\s+2" % ndefine andsign % /\e % tdefine =del % "\v'.3m'\z=\v'-.6m'\h'.3m'\s-1\(*D\s+1\v'.3m'" % ndefine =del % = to DELTA % tdefine oppA % "\s-2\v'-.15m'\z\e\e\h'-.05m'\z\(sl\(sl\v'-.15m'\h'-.75m'\z-\z-\h'.2m'\z-\z-\v'.3m'\h'.4m'\s+2" % ndefine oppA % V- % tdefine oppE %"\s-3\v'.2m'\z\(em\v'-.5m'\z\(em\v'-.5m'\z\(em\v'.55m'\h'.9m'\z\(br\z\(br\v'.25m'\s+3" % ndefine oppE % E/ % tdefine incl % "\s-1\z\(or\h'-.1m'\v'-.45m'\z\(em\v'.7m'\z\(em\v'.2m'\(em\v'-.45m'\s+1" % ndefine incl % C_ % tdefine nomem % "\o'\(mo\(sl'" % ndefine nomem % C-/ % tdefine angstrom % "\fR\zA\v'-.3m'\h'.2m'\(de\v'.3m'\fP\h'.2m'" % ndefine angstrom % A to o % tdefine star %{ roman "\v'.5m'\s+3*\s-3\v'-.5m'"}% ndefine star % * % tdefine || % \(or\(or % tdefine wig % "\z>\v'.4m'\(ap\v'-.4m'" % ndefine >wig %{ > from "~" }% tdefine langle % "\s-3\b'\(sl\e'\s0" % ndefine langle %<% tdefine rangle % "\s-3\b'\e\(sl'\s0" % ndefine rangle %>% tdefine hbar % "\zh\v'-.6m'\h'.05m'\(ru\v'.6m'" % ndefine hbar % h\u-\d % ndefine ppd % _| % tdefine ppd % "\o'\(ru\s-2\(or\s+2'" % tdefine <-> % "\o'\(<-\(->'" % ndefine <-> % "<-->" % tdefine <=> % "\s-2\z<\v'.05m'\h'.2m'\z=\h'.55m'=\h'-.6m'\v'-.05m'>\s+2" % ndefine <=> % "<=>" % tdefine |< % "\o'<\(or'" % ndefine |< % <| % tdefine |> % "\o'>\(or'" % ndefine |> % |> % tdefine ang % "\v'-.15m'\z\s-2\(sl\s+2\v'.15m'\(ru" % ndefine ang % /_ % tdefine rang % "\z\(or\h'.15m'\(ru" % ndefine rang % L % tdefine 3dot % "\v'-.8m'\z.\v'.5m'\z.\v'.5m'.\v'-.2m'" % ndefine 3dot % .\u.\u.\d\d % tdefine thf % ".\v'-.5m'.\v'.5m'." % ndefine thf % ..\u.\d % tdefine quarter % roman \(14 % ndefine quarter % 1/4 % tdefine 3quarter % roman \(34 % ndefine 3quarter % 3/4 % tdefine degree % \(de % ndefine degree % nothing sup o % tdefine square % \(sq % ndefine square % [] % tdefine circle % \(ci % ndefine circle % O % tdefine blot % "\fB\(sq\fP" % ndefine blot % HIX % tdefine bullet % \(bu % ndefine bullet % oxe % tdefine -wig % "\(~=" % ndefine -wig % - to "~" % tdefine wig % \(ap % ndefine wig % "~" % tdefine prop % \(pt % ndefine prop % oc % tdefine empty % \(es % ndefine empty % O/ % tdefine member % \(mo % ndefine member % C- % tdefine cup % \(cu % ndefine cup % U % define cap % \(ca % define subset % \(sb % define supset % \(sp % define !subset % \(ib % define !supset % \(ip % .EN .TH EQNCHAR 7 .UC .SH NAME eqnchar \- special character definitions for eqn .SH SYNOPSIS .B eqn /usr/pub/eqnchar [ files ] .B \(bv troff [ options ] .PP .B neqn /usr/pub/eqnchar [ files ] .B \(bv nroff [ options ] .SH DESCRIPTION .I Eqnchar contains .I troff and .I nroff character definitions for constructing characters that are not available on the Graphic Systems typesetter. These definitions are primarily intended for use with .I eqn and .IR neqn . It contains definitions for the following characters .PP .nf .ta \w'angstrom 'u \n(.lu/3u +\w'angstrom 'u \n(.lu*2u/3u +\w'angstrom 'u .EQ "ciplus" ciplus "|\||" || "square" square .EN .EQ "citimes" citimes "langle" langle "circle" circle .EN .EQ "wig" wig "rangle" rangle "blot" blot .EN .EQ "-wig" -wig "hbar" hbar "bullet" bullet .EN .EQ ">wig" >wig "ppd" ppd "prop" prop .EN .EQ "" <-> "empty" empty .EN .EQ "=wig" =wig "<=>" <=> "member" member .EN .EQ "star" star "|\|<" |< "nomem" nomem .EN .EQ "bigstar" bigstar "|\|>" |> "cup" cup .EN .EQ "=dot" =dot "ang" ang "cap" cap .EN .EQ "orsign" orsign "rang" rang "incl" incl .EN .EQ "andsign" andsign "3dot" 3dot "subset" subset .EN .EQ "=del" =del "thf" thf "supset" supset .EN .EQ "oppA" oppA "quarter" quarter "!subset" !subset .EN .EQ "oppE" oppE "3quarter" 3quarter "!supset" !supset .EN .EQ "angstrom" angstrom "degree" degree .EN .SH FILES /usr/pub/eqnchar .SH SEE ALSO troff(1), eqn(1) member" member .EN .EQ "star" star "|\|<" |< "nomem" nomem .EN .EQ "bigstar" bigstar "|\|>" |> "cup" cup .EN .EQ "=dot" =dot "ang" ang "cap" cap .EN .EQ "orsign" orsign "rang" rang "incl" incl .EN .EQ "andsign" andsigman/man7/greek.7 644 0 33 1737 2512730647 6653 .TH GREEK 7 .SH NAME greek \- graphics for extended TTY-37 type-box .SH SYNOPSIS .B "cat /usr/pub/greek" [ \(bv .BR "greek \-T" terminal ] .SH DESCRIPTION .I Greek gives the mapping from ascii to the `shift out' graphics in effect between SO and SI on model 37 Teletypes with a 128-character type-box. These are the default greek characters produced by .I nroff. The filters of .IR greek (1) attempt to print them on various other terminals. The file contains: .PP .nf .if n .ta 9 +3 +6 +9 +3 +6 +9 +3 +6 .if t .ta 1i +.3i +.75i +1i +.3i +.75i +1i +.3i alpha \(*a A beta \(*b B gamma \(*g \\ GAMMA \(*G G delta \(*d D DELTA \(*D W epsilon \(*e S zeta \(*z Q eta \(*y N THETA \(*H T theta \(*h O lambda \(*l L LAMBDA \(*L E mu \(*m M nu \(*n @ xi \(*c X pi \(*p J PI \(*P P rho \(*r K sigma \(*s Y SIGMA \(*S R tau \(*t I phi \(*f U PHI \(*F F psi \(*q V PSI \(*Q H omega \(*w C OMEGA \(*W Z nabla \(gr [ not \(no _ partial \(pd ] integral \(is ^ .fi .SH "SEE ALSO" greek(1) .br troff(1) ta 9 +3 +6 +9 +3 +6 +9 +3 +6 .if man/man7/hier.7 644 0 33 16444 2531446317 6525 .TH HIER 7 .UC 4 .SH NAME hier \- file system hierarchy .SH DESCRIPTION The following outline gives a quick tour through a representative directory hierarchy. .na .nh .IP / root .PD 0 .IP /vmunix the kernel binary (UNIX itself) .IP /lost+found directory for connecting detached files for .IR fsck (5) .IP /dev/ devices (4) .RS .IP console main console, .IR tty (4) .IP tty* terminals, .IR tty (4) .IP rp* disks, .IR hp (4) .IP rrp* raw disks, .IR hp (4) .IP up* UNIBUS disks .IR up (4) .IP ... .RE .IP /bin/ utility programs, cf /usr/bin/ (1) .RS .IP as assembler .IP cc C compiler executive, cf /lib/ccom, /lib/cpp, /lib/c2 .IP csh C shell .IP ... .RE .IP /lib/ object libraries and other stuff, cf /usr/lib/ .RS .IP libc.a system calls, standard I/O, etc. (2,3,3S) .IP ... .IP ccom C compiler proper .IP cpp C preprocessor .IP c2 C code improver .IP ... .RE .IP /etc/ essential data and maintenance utilities; sect (8) .RS .IP dump dump program .IR dump (8) .IP passwd password file, .IR passwd (5) .IP group group file, .IR group (5) .IP motd message of the day, .IR login (1) .IP termcap description of terminal capabilities, .IR termcap (5) .IP ttytype table of what kind of terminal is on each port, .IR ttytype (5) .IP mtab mounted file table, .IR mtab (5) .IP dumpdates dump history, .IR dump (8) .IP fstab file system configurtion table .IR fstab (5) .IP ttys properties of terminals, .IR ttys (5) .IP getty part of .IR login , .IR getty (8) .IP init the parent of all processes, .IR init.vm (8) .IP rc shell program to bring the system up .IP cron the clock daemon, .IR cron (8) .IP mount .IR mount (8) .IP wall .IR wall (8) .IP ... .RE .IP /tmp/ temporary files, usually on a fast device, cf /usr/tmp/ .RS .IP e* used by .IR ed (1) .IP ctm* used by .IR cc (1) .IP ... .RE .IP /usr/ general-pupose directory, usually a mounted file system .RS .IP adm/ administrative information .RS .IP wtmp login history, .IR utmp (5) .IP messages hardware error messages .IP tracct phototypesetter accounting, .IR troff (1) .IP lpacct line printer accounting .IR lpr (1) .IP "vaacct, vpacct" varian and versatec accounting .IR vpr (1), .IR vtroff (1), .IR vpac (1) .RE .RE .IP /usr\t/bin .RS utility programs, to keep /bin/ small .IP tmp/ temporaries, to keep /tmp/ small .RS .IP stm* used by .IR sort (1) .IP raster used by .IR plot (1) .RE .IP dict/ word lists, etc. .RS .IP words principal word list, used by .IR look (1) .IP spellhist history file for .IR spell (1) .RE .IP games/ .RS .IP hangman .IP lib/ library of stuff for the games .RS .IP quiz.k/ what .IR quiz (6) knows .RS .IP index category index .IP africa countries and capitals .IP ... .RE .IP ... .RE .IP ... .RE .IP include/ standard #include files .RS .IP a.out.h object file layout, .IR a.out (5) .IP stdio.h standard I/O, .IR stdio (3) .IP math.h (3M) .IP ... .IP sys/ system-defined layouts, cf /usr/sys/h .RE .IP lib/ object libraries and stuff, to keep /lib/ small .RS .IP atrun scheduler for .IR at (1) .IP lint/ utility files for lint .RS .IP lint[12] subprocesses for .IR lint (1) .IP llib-lc dummy(( declarations for /lib/libc.a, used by .IR lint (1) .IP llib-lm dummy declarations for /lib/libc.m .IP ... .RE .IP struct/ passes of .IR struct (1) .IP ... .IP tmac/ macros for .IR troff (1) .RS .IP tmac.an macros for .IR man (7) .IP tmac.s macros for .IR ms (7) .IP ... .RE .IP font/ fonts for .IR troff (1) .RS .IP ftR Times Roman .IP ftB Times Bold .IP ... .RE .IP uucp/ programs and data for .IR uucp (1) .RS .IP L.sys remote system names and numbers .IP uucico the real copy program .IP ... .RE .IP units conversion tables for .IR units (1) .IP eign list of English words to be ignored by .IR ptx (1) .RE .RE .br .ne 5 .IP /usr/\tman/ .RS volume 1 of this manual, .IR man (1) .RS .IP man0/ general .RS .IP intro introduction to volume 1, .IR ms (7) format .IP xx template for manual page .RE .IP man1/ chapter 1 .RS .IP as.1 .IP mount.1m .IP ... .RE .IP ... .IP cat1/ preformatted pages for section 1 .IP ... .RE .IP msgs/ messages, cf .IR msgs (1) .RS .IP bounds highest and lowest message .RE .IP new/ binaries of new versions of programs .IP preserve/ editor temporaries preserved here after crashes/hangups .IP public/ binaries of user programs - write permission to everyone .IP spool/ delayed execution files .RS .IP at/ used by .IR at (1) .IP lpd/ used by .IR lpr (1) .RS .IP lock present when line printer is active .IP cf* copy of file to be printed, if necessary .IP df* daemon control file, .IR lpd (8) .IP tf* transient control file, while .I lpr is working .RE .IP uucp/ work files and staging area for .IR uucp (1) .RS .IP LOGFILE summary log .IP LOG.* log file for one transaction .RE .IP mail/ mailboxes for .IR mail (1) .RS .TP .I name mail file for user .I name .TP .IR name .lock lock file while .I name is receiving mail .RE .IP secretmail/ like .IR mail / .IP uucp/ work files and staging area for .IR uucp (1) .RS .IP LOGFILE summary log .IP LOG.* log file for one transaction .RE .RE .TP .I wd initial working directory of a user, typically .I wd is the user's login name .RS .TP .BR . profile set environment for .IR sh (1), .IR environ (5) .TP .BR . project what you are doing (used by ( .IR finger (1) ) .TP .BR . cshrc startup file for .IR csh (1) .TP .BR . exrc startup file for .IR ex (1) .TP .BR . plan what your short-term plans are (used by .IR finger (1) ) .TP .BR . netrc startup file for .IR net (1) .TP .BR . msgsrc startup file for .IR msgs (1) .TP .BR . mailrc startup file for .IR mail (1) .IP calendar user's datebook for .IR calendar (1) .RE .IP doc/ papers, mostly in volume 2 of this manual, typically in .IR ms (7) format .RS .IP as/ assembler manual .IP c C manual .IP ... .RE .RE .RE .IP /usr/\tsrc/ .RS .IP source programs for utilities, etc. .RS .IP cmd/ source of commands .RS .IP as/ assembler .IP ar.c source for .IR ar (1) .IP ... .IP troff/ source for .I nroff and .IR troff (1) .RS .IP font/ source for font tables, /usr/lib/font/ .RS .IP ftR.c Roman .IP ... .RE .IP term/ terminal characteristics tables, /usr/lib/term/ .RS .IP tab300.c DASI 300 .IP ... .RE .IP ... .RE .RE .IP games/ source for /usr/games .IP libc/ source for functions in /lib/libc.a .RS .IP crt/ C runtime support .IP csu/ startup and wrapup routines needed with every C program .RS .IP crt0.s regular startup .IP mcrt0.s modified startup for .I cc \-p .RE .IP sys/ system calls (2) .RS .IP access.s .IP alarm.s .IP ... .RE .IP stdio/ standard I/O functions (3S) .RS .IP fgets.c .IP fopen.c .IP ... .RE .IP gen/ other functions in (3) .RS .IP abs.c .IP ... .RE .RE .IP local/ source which isn't normally distributed .IP new/ source for new versions of commands and library routines .IP old/ source for old versions of commands and library routines .IP sys/ system source .RS .IP h/ header (include) files .RS .IP acct.h .IR acct (5) .IP stat.h .IR stat (2) .IP ... .RE .IP sys/ system source proper .RS .IP main.c .IP pipe.c .IP sysent.c system entry points .RE .RE .RE .IP ucb/ binaries of programs developed at UCB .RS .IP ... .IP edit editor for beginners .IP ex command editor for experienced users .IP ... .IP mail mail reading/sending subsystem .IP man on line documentation .IP ... .IP pi Pascal translator .IP px Pascal interpreter .IP ... .IP vi visual editor .RE .RE .ad .SH SEE ALSO ls(1), apropos(1), whatis(1), whereis(1), finger(1), which (1), ncheck(8), find(1), grep(1) .SH BUGS The position of files is subject to change without notice. em entry points .RE .RE .RE .IP ucb/ binaries of programs developed at UCB .RS .IP ... .IP edit editor for beginners .IP ex command editor for experienced users .IP ... .IP mail mail reading/sending subsystem .IP man on man/man7/man.7 644 0 33 6105 2512730650 6315 .TH MAN 7 .SH NAME man \- macros to typeset manual .SH SYNOPSIS .B nroff \-man\ file ... .PP .B troff \-man\ file ... .SH DESCRIPTION These macros are used to lay out pages of this manual. A skeleton page may be found in the file /usr/man/man0/xx. .PP Any text argument .I t may be zero to six words. Quotes may be used to include blanks in a `word'. If .I text is empty, the special treatment is applied to the next input line with text to be printed. In this way .BR . I may be used to italicize a whole line, or .BR . SM followed by .BR . B to make small bold letters. .PP A prevailing indent distance is remembered between successive indented paragraphs, and is reset to default value upon reaching a non-indented paragraph. Default units for indents .I i are ens. .PP Type font and size are reset to default values before each paragraph, and after processing font and size setting macros. .PP These strings are predefined by .BR \-man : .IP \e*R .if t `\*R', `(Reg)' in .if t .I nroff. .if n `(Reg)', trademark symbol in .if n .I troff. .IP \e*S Change to default type size. .SH FILES /usr/lib/tmac/tmac.an .br /usr/man/man0/xx .SH SEE ALSO troff(1), man(1) .SH BUGS Relative indents don't nest. .SH REQUESTS .ta \w'.TH n c x 'u +\w'Cause 'u +\w'Argument\ 'u .di xx \ka .br .di .in \nau .ti0 Request Cause If no Explanation .ti0 Break Argument .ti0 .li .B \fIt\fR no \fIt\fR=n.t.l.* Text .I t is bold. .ti0 .li .BI \fIt\fR no \fIt\fR=n.t.l. Join words of .I t alternating bold and italic. .ti0 .li .BR \fIt\fR no \fIt\fR=n.t.l. Join words of .I t alternating bold and Roman. .ti0 .li .DT no .5i 1i... Restore default tabs. .ti0 .li .HP \fIi\fR yes \fIi\fR=p.i.* Set prevailing indent to .I i. Begin paragraph with hanging indent. .ti0 .li .I \fIt\fR no \fIt\fR=n.t.l. Text .I t is italic. .ti0 .li .IB \fIt\fR no \fIt\fR=n.t.l. Join words of .I t alternating italic and bold. .ti0 .li .IP \fIx i\fR yes \fIx\fR="" Same as .TP with tag .I x. .ti0 .li .IR \fIt\fR no \fIt\fR=n.t.l. Join words of .I t alternating italic and Roman. .ti0 .li .LP yes - Same as .PP. .ti0 .li .PD \fId\fR no \fId\fR=.4v Interparagraph distance is .I d. .ti0 .li .PP yes - Begin paragraph. Set prevailing indent to .5i. .ti0 .li .RE yes - End of relative indent. Set prevailing indent to amount of starting .RS. .ti0 .li .RB \fIt\fR no \fIt\fR=n.t.l. Join words of .I t alternating Roman and bold. .ti0 .li .RI \fIt\fR no \fIt\fR=n.t.l. Join words of .I t alternating Roman and italic. .ti0 .li .RS \fIi\fR yes \fIi\fR=p.i. Start relative indent, move left margin in distance .I i. Set prevailing indent to .5i for nested indents. .ti0 .li .SH \fIt\fR yes \fIt\fR=n.t.l. Subhead. .ti0 .li .SM \fIt\fR no \fIt\fR=n.t.l. Text .I t is small. .ti0 .li .TH \fIn c x\fR yes - Begin page named .I n of chapter .IR c; .I x is extra commentary, e.g. `local', for page foot. Set prevailing indent and tabs to .5i. .ti0 .li .TP \fIi\fR yes \fIi\fR=p.i. Set prevailing indent to .I i. Begin indented paragraph with hanging tag given by next text line. If tag doesn't fit, place it on separate line. .PP .ti0 * n.t.l. = next text line; p.i. = prevailing indent .li .SH \fIt\fR yes \fIt\fR=n.t.l. Subhead. .ti0 .li .SM \fIt\fR no \fIt\fR=n.t.l. Text .I t is small. .ti0 .li .TH \fIn c x\fR yes - Begin page named .I n of chapter .IR c; .I x is extra commentary, e.g. `local', for page foot. Set prevailing indent and tabs to .5i. .ti0 .li .TP \fIi\fR yes \fIi\fR=p.i. Set prevailing indent to .I i. Begin indented paragraph with hanging tag given by next text line. If tag doesn't fit, place it on separatman/man7/me.7 644 0 33 12312 2512730651 6161 .hc % .TH ME 7 11/16/79 .UC .SH NAME me \- macros for formatting papers .SH SYNOPSIS .B "nroff \-me" [ options ] file ... .br .B "troff \-me" [ options ] file ... .SH DESCRIPTION This package of .I nroff and .I troff macro definitions provides a canned formatting facility for tech%nical papers in various formats. When producing 2-column output on a terminal, filter the output through .IR col (1). .PP The macro requests are defined below. Many .I nroff and .I troff requests are unsafe in conjunction with this package, however these requests may be used with impunity after the first .pp: .nf .IP .ta \w'.sz +n 'u \&.bp begin new page \&.br break output line here \&.sp n insert n spacing lines \&.ls n (line spacing) n=1 single, n=2 double space \&.na no alignment of right margin \&.ce n center next n lines \&.ul n underline next n lines \&.sz +n add n to point size .fi .PP Output of the .I eqn, .I neqn, .I refer, and .IR tbl (1) preprocessors for equations and tables is acceptable as input. .SH FILES /usr/l((ib/tmac/tmac.e .br /usr/lib/me/* .SH "SEE ALSO" eqn(1), troff(1), refer(1), tbl(1) .br \-me Reference Manual, Eric P. Allman .br Writing Papers with Nroff Using \-me .tr &. .SH REQUESTS In the following list, \*(lqinitialization\*(rq refers to the first .pp, .lp, .ip, .np, .sh, or .uh macro. This list is incomplete; see .I "The \-me Reference Manual" for interesting details. .PP .ta \w'.eh \'x\'y\'z\' 'u +\w'Initial 'u +\w'Cause 'u .br .di x \ka .br .di .in \nau .ti0 Request Initial Cause Explanation .ti0 Value Break .br .in \nau .ti0 \&.(c - yes Begin centered block .ti0 \&.(d - no Begin delayed text .ti0 \&.(f - no Begin footnote .ti0 \&.(l - yes Begin list .ti0 \&.(q - yes Begin major quote .ti0 \&.(x \fIx\fR - no Begin indexed item in index .I x .ti0 \&.(z - no Begin floating keep .ti0 \&.)c - yes End centered block .ti0 \&.)d - yes End delayed text .ti0 \&.)f - yes End footnote .ti0 \&.)l - yes End list .ti0 \&.)q - yes End major quote .ti0 \&.)x - yes End index item .ti0 \&.)z - yes End floating keep .ti 0 \&.++ \fIm H\fR - no Define paper section. .I m defines the part of the paper, and can be .B C (chapter), .B A (appendix), .B P (preliminary, e.g., abstract, table of contents, etc.), .B B (bibliography), .B RC (chapters renumbered from page one each chapter), or .B RA (appendix renumbered from page one). .ti 0 \&.+c \fIT\fR - yes Begin chapter (or appendix, etc., as set by .++). .I T is the chapter title. .ti0 \&.1c 1 yes One column format on a new page. .ti0 \&.2c 1 yes Two column format. .ti0 \&.EN - yes Space after equation produced by .I eqn or .IR neqn . .ti0 \&.EQ \fIx y\fR - yes Precede equation; break out and add space. Equation number is .IR y . The optional argument \fIx\fR may be .I I to indent equation (default), .I L to left-adjust the equation, or .I C to center the equation. .ti0 \&.TE - yes End table. .ti0 \&.TH - yes End heading section of table. .ti0 \&.TS \fIx\fR - yes Begin table; if \fIx\fR is .I H table has repeated heading. .ti 0 \&.ac \fIA N\fR - no Set up for ACM style output. .I A is the Author's name(s), .I N is the total number of pages. Must be given before the first initialization. .ti0 \&.b \fIx\fR no no Print .I x in boldface; if no argument switch to boldface. .ti 0 \&.ba \fI+n\fR 0 yes Augments the base indent by .I n. This indent is used to set the indent on regular text (like paragraphs). .ti0 \&.bc no yes Begin new column .ti0 \&.bi \fIx\fR no no Print .I x in bold italics (nofill only) .ti0 \&.bx \fIx\fR no no Print \fIx\fR in a box (nofill only). .ti 0 \&.ef \fI\'x\'y\'z\'\fR \'\'\'\' no Set even footer to x y z .ti 0 \&.eh \fI\'x\'y\'z\'\fR \'\'\'\' no Set even header to x y z .ti 0 \&.fo \fI\'x\'y\'z\'\fR \'\'\'\' no Set footer to x y z .ti 0 \&.hx - no Supress headers and footers on next page. .ti0 \&.he \fI\'x\'y\'z\'\fR \'\'\'\' no Set header to x y z .ti0 \&.hl - yes Draw a horizontal line .ti0 \&.i \fIx\fR no no Italicize .I x; if .I x missing, italic text follows. .ti0 \&.ip \fIx y\fR no yes Start indented paragraph, with hanging tag .IR x . Indentation is .I y ens (default 5). .ti0 \&.lp yes yes Start left-blocked paragraph. .ti 0 \&.lo - no Read in a file of local macros of the form .BI \&.* x. Must be given before initialization. .ti0 \&.np 1 yes Start numbered paragraph. .ti 0 \&.of \fI\'x\'y\'z\'\fR \'\'\'\' no Set odd footer to x y z .ti 0 \&.oh \fI\'x\'y\'z\'\fR \'\'\'\' no Set odd header to x y z .ti 0 \&.pd - yes Print delayed text. .ti0 \&.pp no yes Begin paragraph. First line indented. .ti0 \&.r yes no Roman text follows. .ti 0 \&.re - no Reset tabs to default values. .ti 0 \&.sc no no Read in a file of special characters and diacritical marks. Must be given before initialization. .ti0 \&.sh \fIn x\fR - yes Section head follows, font automatically bold. .I n is level of section, .I x is title of section. .ti 0 \&.sk no no Leave the next page blank. Only one page is remembered ahead. .ti 0 \&.sz \fI+n\fR 10p no Augment the point size by .I n points. .ti 0 \&.th no no Produce the paper in thesis format. Must be given before initialization. .ti 0 \&.tp no yes Begin title page. .ti0 \&.u \fIx\fR - no Underline argument (even in \fItroff\fR). (Nofill only). .ti0 \&.uh - yes Like .sh but unnumbered. .ti0 \&.xp \fIx\fR - no Print index .I x. automatically bold. .I n is level of section, .I x is title of section. .ti 0 \&.sk no no Leave the next page blank. Only one page is remembered ahead. .ti 0 \&.sz \fI+n\fR 10p no Augment the point size by .I n points. .ti 0 \&.th no no Produce the paper in thesis format. Must be given before initialization.man/man7/ms.7 644 0 33 14240 2512730651 6201 .hc % .TH MS 7 .SH NAME ms \- macros for formatting manuscripts .SH SYNOPSIS .B "nroff \-ms" [ options ] file ... .br .B "troff \-ms" [ options ] file ... .SH DESCRIPTION This package of .I nroff and .I troff macro definitions provides a canned formatting .li facility for tech%nical papers in various formats. When producing 2-column output on a terminal, filter the output through .IR col (1). .PP The macro requests are defined below. Many .I nroff and .I troff requests are unsafe in conjunction with this package, however these requests may be used with impunity after the first .PP: .IP .ta \w'.sp n 'u .li .bp begin new page .nf .li .br break output line here .li .sp n insert n spacing lines .li .ls n (line spacing) n=1 single, n=2 double space .li .na no alignment of right margin .fi .PP Output of the .I eqn, .I neqn, .I refer, and .IR tbl (1) preprocessors for equations and tables is acceptable as input. .SH FILES /usr/lib/tmac/tmac.s .SH "SEE ALSO" eqn(1), troff(1), refer(1), tbl(1) .tr &. .SH REQUESTS .ta \w'..ND \fIdate\fR 'u +\w'Initial 'u +\w'Cause 'u .br .di x \ka .br .di .in \nau .ti0 Request Initial Cause Explanation .ti0 Value Break .br .in \nau .ti0 .li .1C yes yes One column format on a new page. .ti0 .li .2C no yes Two column format. .ti0 .li .AB no yes Begin abstract. .ti0 .li .AE - yes End abstract. .ti0 .li .AI no yes Author's institution follows. Suppressed in TM. .ti0 .li .AT no yes Print `Attached' and turn off line filling. .ti0 .li .AU \fIx y\fR no yes Author's name follows. .IR x " is location and " "y\fR is" extension, ignored except in TM. .ti0 .li .B \fIx\fR no no Print \fIx\fR in boldface; if no argument switch to boldface. .ti 0 .li .B1 no yes Begin text to be enclosed in a box. .ti0 .li .B2 no yes End text to be boxed & print it. .ti0 .li .BT date no Bottom title, automatically invoked at foot of page. May be redefined. .ti0 .li .BX \fIx\fR no no Print \fIx\fR in a box. .ti0 .li .CS \fIx...\fR - yes Cover sheet info if TM format, suppressed otherwise. Arguments are number of text pages, other pages, total pages, figures, tables, references. .ti0 .li .CT no yes Print `Copies to' and enter no-fill mode. .ti0 .li .DA \fIx\fR nroff no `Date line' at bottom of page is .IR x . Default is today. .ti0 .li .DE - yes End displayed text. Implies .KE. .ti0 .li .DS \fIx\fR no yes Start of displayed text, to appear verbatim line-by-line. .IR x "=I for indented display (default)," .IR x "=L for left-justified on the page," .IR x "=C for centered," .IR x "=B for make left-justified block, then center whole block." Implies .KS. .ti0 .li .EG no - Print document in BTL format for `Engineer's Notes.' Must be first. .ti0 .li .EN - yes Space after equation produced by .I eqn or .IR neqn . .ti0 .li .EQ \fIx y\fR - yes Precede equation; break out and add space. Equation number is .IR y . The optional argument \fIx\fR may be .I I to indent equation (default), .I L to left-adjust the equation, or .I C to center the equation. .ti0 .li .FE - yes End footnote. .ti0 .li .FS no no Start footnote. The note will be moved to the bottom of the page. .ti0 .li .HO - no `Bell Laboratories, Holmdel, New Jersey 07733'. .ti0 .li .I \fIx\fR no no Italicize \fIx\fR; if \fIx\fR missing, italic text follows. .ti0 .li .IH no no `Bell Laboratories, Naperville, Illinois 60540' .ti0 .li .IM no no Print document in BTL format for an internal memorandum. Must be first. .ti0 .li .IP \fIx y\fR no yes Start indented paragraph, with hanging tag .IR x . Indentation is .IR y "" ens (default 5). .ti0 .li .KE - yes End keep. Put kept text on next page if not enough room. .ti0 .li .KF no yes Start floating keep. If the kept text must be moved to the next page, float later text back to this page. .ti0 .li .KS no yes Start keeping following text. .ti0 .li .LG no no Make letters larger. .ti0 .li .LP yes yes Start left-blocked paragraph. .ti0 .li .MF - - Print document in BTL format for `Memorandum for File.' Must be first. .ti0 .li .MH - no `Bell Laboratories, Murray Hill, New Jersey 07974'. .ti0 .li .MR - - Print document in BTL format for `Memorandum for Record.' Must be first. .ti0 .li .ND \fIdate\fR troff no Use date supplied (if any) only in special BTL format positions; omit from page footer. .ti0 .li .NH \fIn\fR - yes Same as .SH, with section number supplied automatically. Numbers are multilevel, like 1.2.3, where .IR n "" tells what level is wanted (default is 1). .ti0 .li .NL yes no Make letters normal size. .ti0 .li .OK - yes `Other keywords' for TM cover sheet follow. .ti0 .li .PP no yes Begin paragraph. First line indented. .ti0 .li .PT pg # - Page title, automatically invoked at top of page. May be redefined. .ti0 .li .PY - no `Bell Laboratories, Piscataway, New Jersey 08854' .ti0 .li .QE - yes End quoted (indented and shorter) material. .ti0 .li .QP - yes Begin single paragraph which is indented and shorter. .ti0 .li .QS - yes Begin quoted (indented and shorter) material. .ti0 .li .R yes no Roman text follows. .ti0 .li .RE - yes End relative indent level. .ti0 .li .RP no - Cover sheet and first page for released paper. Must prec((ede other requests. .ti0 .li .RS - yes Start level of relative indentation. Following .IP's are measured from current indentation. .ti0 .li .SG \fIx\fR no yes Insert signature(s) of author(s), ignored except in TM. .IR x " is the reference line (initials of author and typist)." .ti0 .li .SH - yes Section head follows, font automatically bold. .ti0 .li .SM no no Make letters smaller. .ti0 .li .TA \fIx\fR... 5... no Set tabs in ens. Default is 5 10 15 ... .ti0 .li .TE - yes End table. .ti0 .li .TH - yes End heading section of table. .ti0 .li .TL no yes Title follows. .ti0 .li .TM \fIx\fR... no - Print document in BTL technical memorandum format. Arguments are TM number, (quoted list of) case number(s), and file number. Must precede other requests. .ti0 .li .TR \fIx\fR - - Print in BTL technical report format; report number is \fIx\fR. Must be first. .ti0 .li .TS \fIx\fR - yes Begin table; if \fIx\fR is .I H table has repeated heading. .ti0 .li .UL \fIx\fR - no Underline argument (even in troff). .ti0 .li .UX - no `UNIX'; first time used, add footnote `UNIX is a trademark of Bell Laboratories.' .ti0 .li .WH - no `Bell Laboratories, Whippany, New Jersey 07981'. .tr && ber, (quoted list of) case number(s), and file number. Must precede other requests. .ti0 .li .TR \fIx\fR - - Print in BTL technical report format; report number is \fIx\fR. Must be first. .ti0 .li .TS \fIx\fR - yes Begin table; if \fIx\fR is .I H table has repeated heading. .ti0 .li .UL \fIx\fR - no Underline argument (even in troff). .ti0 .li .UX -man/man7/term.7 644 0 33 2443 2512730652 6514 .TH TERM 7 .SH NAME terminals \- conventional names .SH DESCRIPTION These names are used by certain commands and are maintained as part of the shell environment (see .IR sh (1), environ (5)). .LP .nf .ta \w'450\-12\-8 'u adm3a Lear Seigler Adm-3a 2621 Hewlett-Packard HP262? series terminals hp Hewlett-Packard HP264? series terminals c100 Human Designed Systems Concept 100 h19 Heathkit H19 mime Microterm mime in enhanced ACT IV mode 1620 DIABLO 1620 (and others using HyType II) 300 DASI/DTC/GSI 300 (and others using HyType I) 33 TELETYPE\*R Model 33 37 TELETYPE Model 37 43 TELETYPE Model 43 735 Texas Instruments TI735 (and TI725) 745 Texas Instruments TI745 dumb terminals with no special features 4014 Tektronix 4014 vt52 Digital Equipment Corp. VT52 .fi .PP The list goes on and on. Consult /etc/termcap (see .IR termcap (5)) for an up-to-date and locally correct list. .PP Commands whose behavior may depend on the terminal either consult TERM in the environment, or accept arguments of the form .BR \-Tterm, where .I term is one of the names given above. .SH SEE ALSO stty(1), tabs(1), plot(1), sh(1), environ(5) ex(1), clear(1), more(1), ul(1), tset(1), termcap(5), termlib(3), ttytype(5) .br troff(1) for .I nroff .SH BUGS The programs that ought to adhere to this nomenclature do so only fitfully. /etc/termcap (see .IR termcap (5)) for an up-to-date and locally correct list. .PP Commands whose behavior may depend on the terminal either consult TERM in the environment, or accept arguments of the form .BR \-Tterm, whman/man8/ 775 0 33 0 2527172352 5373 man/man8/ac.8 644 0 33 2111 2512730654 6124 .TH AC 8 .UC 4 .SH NAME ac \- login accounting .SH SYNOPSIS .B /etc/ac [ .B \-w wtmp ] [ .B \-p ] [ .B \-d ] [ people ] ... .SH DESCRIPTION .I Ac produces a printout giving connect time for each user who has logged in during the life of the current .I wtmp file. A total is also produced. .B \-w is used to specify an alternate .IR wtmp "" file. .B \-p prints individual totals; without this option, only totals are printed. .B \-d causes a printout for each midnight to midnight period. Any .I people will limit the printout to only the specified login names. If no .IR wtmp "" file is given, .I /usr/adm/wtmp is used. .PP The accounting file .I /usr/adm/wtmp is maintained by .I init and .I login. Neither of these programs creates the file, so if it does not exist no connect-time accounting is done. To start accounting, it should be created with length 0. On the other hand if the file is left undisturbed it will grow without bound, so periodically any information desired should be collected and the file truncated. .SH FILES /usr/adm/wtmp .SH "SEE ALSO" init(8), sa(8), login(1), utmp(5). s given, .I /usr/adm/wtmp is used. .PP The accounting file .I /usr/adm/wtmp is maintained by .I init and .I login. Neither of these programs creates the file, so if it does not exist no connect-time accounting is done. To start accounting, it should be created with length 0. On the other hand if the file is left undisturbed it will grow without bound, so periodically any information desired should be collected and the file truncated. .man/man8/accton.8 664 0 33 27 2512730654 6756 .so /usr/man/man8/sa.8 .SH "SEE ALSO" init(8), sa(8), login(1), utmp(5). s given, .I /usr/adm/wtmp is used. .PP The accounting file .I /usr/adm/wtmp is maintained by .I init and .I login. Neither of these programs creates the file, so if it does not exist no connect-time accounting is done. To start accounting, it should be created with length 0. On the other hand if the file is left undisturbed it will grow without /( ,( 5Ċ /\@,\D"man/man8/adduser.8 644 0 33 6507 2512730655 7206 .TH ADDUSER 8 .UC 4 .SH NAME adduser \- procedure for adding new users .SH DESCRIPTION A new user must choose a login name, which must not already appear in .I /etc/passwd. An account can be added by editing a line into the passwd file; this must be done with the password file locked e.g. by using .IR vipw (8). .PP A new user is given a group and user id. User id's should be distinct across a system, since they are used to control access to files. Typically, users working on similar projects will be put in the same group. Thus at UCB we have groups for system staff, faculty, graduate students, and a few special groups for large projects. System staff is group \*(lq10\*(rq for historical reasons, and the super-user is in this group. .PP A skeletal account for a new user \*(lqernie\*(rq would look like: .IP ernie::235:20:& Kovacs,508E,7925,6428202:/mnt/grad/ernie:/bin/csh .PP The first field is the login name \*(lqernie\*(rq. The next field is the encrypted password which is not given and must be initialized using .IR passwd (1). The next two fields are the user and group id's. Traditionally, users in group 20 are graduate students and have account names with numbers in the 200's. The next field gives information about ernie's real name, office and office phone and home phone. This information is used by the .IR finger (1) program. From this information we can tell that ernie's real name is \*(lqErnie Kovacs\*(rq (the & here serves to repeat \*(lqernie\*(rq with appropriate capitalization), that his office is 508 Evans Hall, his extension is x2-7925, and this his home phone number is 642-8202. You can modify the .IR finger (1) program if necessary to allow different information to be encoded in this field. The UCB version of finger knows several things particular to Berkeley \- that phone extensions start \*(lq2\-\*(rq, that offices ending in \*(lqE\*(rq are in Evans Hall and that offices ending in \*(lqC\*(rq are in Cory Hall. .PP The final two fields give a login directory and a login shell name. Traditionally, user files live on a file system which has the machines single letter .IR net (1) address as the first of two characters. Thus on the Berkeley CS Department VAX, whose Berknet address is ``csvax'' abbreviated ``v'' the user file systems are mounted on ``/va'', ``/vb'', etc. On each such filesystem there are subdirectories there for each group of users, i.e.: \*(lq/va/staff\*(rq and \*(lq/vb/prof\*(rq. This is not strictly necessary but keeps the number of files in the top level directories reasonably sm((all. .PP The login shell will default to \*(lq/bin/sh\*(rq if none is given. Most users at Berkeley choose \*(lq/bin/csh\*(rq so this is usually specified here. .PP It is useful to give new users some help in getting started, supplying them with a few skeletal files such as .I \&.profile if they use \*(lq/bin/sh\*(rq, or .I \&.cshrc and .I \&.login if they use \*(lq/bin/csh\*(rq. The directory \*(lq/usr/skel\*(rq contains skeletal definitions of such files. New users should be given copies of these files which, for instance, arrange to use .IR tset (1) automatically at each login. .SH FILES .ta 2i /etc/passwd password file .br /usr/skel skeletal login directory .SH SEE ALSO passwd(1), finger(1), chsh(1), chfn(1), passwd(5), vipw(8) .SH BUGS User information should be stored in its own data base separate from the password file. &.cshrc and .I \&.login if they use \*(lq/bin/csh\*(rq. The directory \*(lq/usr/skel\*(rq contains skeletal definitions of such files. New users should be given copies of these files whman/man8/analyze.8 644 0 33 6343 2512730655 7220 .lg 0 .TH ANALYZE 8 .UC 4 .SH NAME analyze \- Virtual UNIX postmortem crash analyzer .SH SYNOPSIS .B /etc/analyze [ .B \-s swapfile ] [ .B \-f ] [ .B \-m ] [ .B \-d ] [ .B \-D ] [ .B \-v ] corefile [ system ] .SH DESCRIPTION .I Analyze is the post-mortem analyzer for the state of the paging system. In order to use .I analyze you must arrange to get a image of the memory (and possibly the paging area) of the system after it crashes (see .IR crash (8)). .PP The .I analyze program reads the relevant system data structures from the core image file and indexing information from .B /vmunix (or the specified file). to determine the state of the paging subsystem at the point of crash. It looks at each process in the system, and the resources each is using in an attempt to determine inconsistencies in the paging system state. Normally, the output consists of a sequence of lines showing each active process, its state (whether swapped in or not), its .I p0br, and the number and location of its page table pages. Any pages which are locked while raw i/o is in progress, or which are locked because they are .I intransit are also printed. (Intransit text pages often diagnose as duplicated; you will have to weed these out by hand.) .PP The program checks that any pages in core which are marked as not modified are, in fact, identical to the swap space copies. It also checks for non-overlap of the swap space, and that the core map entries correspond to the page tables. The state of the free list is also checked. .PP Options to .I analyze: .TP .B \-D causes the diskmap for each process to be printed. .TP .B \-d causes the (sorted) paging area usage to be printed. .TP .B \-f which causes the free list to be dumped. .TP .B \-m causes the entire coremap state to be dumped. .TP .B \-v (long unused) which causes a hugely verbose output format to be used. .PP In general, the output from this program can be confused by processes which were forking, swapping, or exiting or happened to be in unusual states when the crash occurred. You should examine the flags fields of relevant processes in the output of a .IR pstat (8) to weed out such processes. .PP It is possible to look at the core dump with .I adb if you do .IP adb /vmunix /vmcore .br .lg 0 /m 80000000 #ffffffff .LP which fixes the map of .I vmcore so that symbols in data space will work. Note that the debugger is looking at the physical memory at the point of crash; you will have to determine which pages of physical memory virtual pages are in if you wish to look at them. If .I analyze says that a processes page tables are in page 218 (hex of course), then you can look at them by looking at address 0x80043000 in the dump, i.e. \*(lq80043000,80/X\*(rq will print the page of page tables. .SH FILES /vmunix default system namelist .SH SEE ALSO ps(1), crash(8), pstat(8) .SH AUTHORS Ozalp Babaoglu and William Joy .SH DIAGNOSTICS Various diagnostics about overlaps in swap mappings, missing swap mappings, page table entries inconsistent with the core map, incore pages which are marked clean but differ from disk-image copies, pages which are locked or intransit, and inconsistencies in the free list. .PP It would be nice if this program analyzed the system in general, rather than just the paging system in particular. fault system namelist .SH SEE ALSO ps(1), crash(8), pstat(8) .SH AUTHORS Ozalp Babaoglu and William Joy .SH DIAGNOSTICS Various diagnostics about overlaps in swap mappings, missing swap mappings, page table entries inconsistent with the core map, incore pages which are marked clean buman/man8/arcv.8 664 0 33 1004 2512730655 6477 .TH ARCV 8 .UC 4 .SH NAME arcv \- convert archives to new format .SH SYNOPSIS .B /etc/arcv file ... .SH DESCRIPTION .I Arcv converts archive files (see .IR ar (1), .IR ar (5)) from 32v and Third Berkeley editions to a new portable format. The conversion is done in place, and the command refuses to alter a file not in old archive format. .PP Old archives are marked with a magic number of 0177545 at the start; new archives have a first line ``!''. .SH FILES /tmp/v*, temporary copy .SH SEE ALSO ar(1), ar(5) ARCV 8 .UC 4 .SH NAME arcv \- convert archives to new format .SH SYNOPSIS .B /etc/arcv file ... .SH DESCRIPTION .I Arcv converts archive files (see .IR ar (1), .IR ar (5)) from 32v and Third Berkeley editions to a new portable format. The conversion is done in place, and the command refuses to alter a file not in old archive format. .PP Old archives are marked with a magic number of 0177545 at the start; new archives have a first line ``!''. .SH FILES /tmp/v*, temporary copy .SH SEE ALSO ar(1), arman/man8/arff.8 644 0 33 5317 2512730655 6473 .TH ARFF 8 .UC 4 .SH NAME arff, flcopy \- archiver and copier for floppy .SH SYNOPSIS .B /etc/arff [ key ] [ name ... ] .br .B /etc/flcopy [ .B \-h ] [ \fB\-t\fIn\fR ] .SH DESCRIPTION .I Arff saves and restores files on the console floppy disk. Its actions are controlled by the .I key argument. The .I key is a string of characters containing at most one function letter and possibly one or more function modifiers. Other arguments to the command are file names specifying which files are to be dumped or restored. .PP Files names have restrictions, because of radix50 considerations. They must be in the form 1-6 alphanumerics followed by "." followed by 0-3 alphanumerics. Case distinctions are lost. Only the trailing component of a pathname is used. .PP The function portion of the key is specified by one of the following letters: .TP 8 .B r The named files are replaced where found on the floppy, or added taking up the minimal possible portion of the first empty spot on the floppy. .TP 8 .B x The named files are extracted from the floppy. .TP 8 .B d The named files are deleted from the floppy. Arff will combine contiguous deleted files into one empty entry in the rt-11 directory. .TP 8 .B t The names of the specified files are listed each time they occur on the floppy. If no file argument is given, all of the names on the floppy are listed. .PP The following characters may be used in addition to the letter which selects the function desired. .TP 10 .B v Normally .I arff does its work silently. The .B v (verbose) option causes it to type the name of each file it treats preceded by the function letter. With the .B t function, .B v gives more information about the floppy entries than just the name. .TP 10 .B f causes .I arff to use the next argument as the name of the archive instead of /dev/floppy. .TP 10 .B m causes .I arff not to use the mapping algorithm employed in interleaving sectors around a floppy disk. In conjunction with the .B f option it may be used for extracting files from rt11 formatted cartridge disks, for example. .PP .I Flcopy copies the console floppy disk (opened as `/dev/floppy') to a file created in the current directory, named \*(lqfloppy\*(rq, then prints the message \*(lqChange Floppy, hit return when done\*(rq. Then .I flcopy copies the local file back out to the floppy disk. .PP The .B \-h option to .I flcopy causes it to open a file named \*(lqfloppy\*(rq in the current directory and copy it to .I /dev/floppy; the .B \-t option causes only the first .I n tracks to participate in a copy. .SH FILES /dev/floppy .br floppy (in current directory) .SH AUTHORS Keith Sklower, Richard Tuck .SH BUGS Floppy errors are handled ungracefully; .I Arff does not handle multi-segment rt11 directories. hit return when done\*(rq. Then .I flcopy copies the local file back out to the floppy disk. .PP The .B \-h option to .I flcopy causes it to open a file named \*(lqfloppy\*(rq in the current directory and copy it to .I /dev/floppy; the .B \-t option causes only the first .I n tracks to participate in a ((man/man8/catman.8 644 0 33 2165 2512730655 7016 .TH CATMAN 8 .UC 4 .SH NAME catman \- create the cat files for the manual .SH SYNOPSIS .B /etc/catman [ .B \-p ] [ .B \-n ] [ .B \-w ] [ sections ] .SH DESCRIPTION .I Catman creates the preformatted versions of the on-line manual from the nroff input files. Each manual page is examined and those whose preformatted versions are missing or out of date are recreated. If any changes are made, .I catman will recreate the .B /usr/lib/whatis database. .PP If there is one parameter not starting with a `\-', it is take to be a list of manual sections to look in. For example .IP .B catman 123 .LP will cause the updating to only happen to manual sections 1, 2, and 3. .PP Options: .TP .B \-n prevents creations of .BR /usr/lib/whatis . .TP .B \-p prints what would be done instead of doing it. .TP .B \-w causes only the .B /usr/lib/whatis database to be created. No manual reformatting is done. .SH FILES .ta 2i /usr/man/man?/*.* raw (nroff input) manual sections .br /usr/man/cat?/*.* preformatted manual pages .br /usr/lib/makewhatis commands to make whatis database .DT .SH "SEE ALSO" man(1) .SH BUGS Acts oddly on nights with full moons. pen to manual sections 1, 2, and 3. .PP Options: .TP .B \-n prevents creations of .BR /usr/lib/whatis . .TP .B \-p prints what would be done instead of doing it. .TP .B \-w causes only the .B /usr/lib/whatis database to be created. No manual reformatting is done. .SH FILES .ta 2i /usr/man/man?/*.* raw (nroff input) manual sections .br /usr/man/cat?/*.* preformatted manual pages .br /usr/lib/man/man8/chgrp.8 664 0 33 32 2512730656 6610 .so /usr/man/man8/chown.8 e whatis database .DT .SH "SEE ALSO" man(1) .SH BUGS Acts oddly on nights with full moons. pen to manual sections 1, 2, and 3. .PP Options: .TP .B \-n prevents creations of .BR /usr/lib/whatis . .TP .B \-p prints what would be done instead of doing it. .TP .B \-w causes only the .B /usr/lib/whatis database to be created. No manual reformatting is done. .SH FILES .ta 2i /usr/man/man?/*.* raw/( ,( 5PĊ /\@,\D"man/man8/chown.8 644 0 33 1202 2512730656 6661 .TH CHOWN 8 .UC 4 .SH NAME chown, chgrp \- change owner or group .SH SYNOPSIS .B /etc/chown owner file ... .PP .B /etc/chgrp group file ... .SH DESCRIPTION .I Chown changes the owner of the .I files to .IR owner . The owner may be either a decimal UID or a login name found in the password file. .PP .I Chgrp changes the group-ID of the .I files to .IR group . The group may be either a decimal GID or a group name found in the group-ID file. .PP Only the super-user can change owner or group, in order to simplify as yet unimplemented accounting procedures. .SH FILES /etc/passwd .br /etc/group .SH "SEE ALSO" chown(2), passwd(5), group(5) p file ... .SH DESCRIPTION .I Chown changes the owner of the .I files to .IR owner . The owner may be either a decimal UID or a login name found in the password file. .PP .I Chgrp changes the group-ID of the .I files to .IR group . The group may be either a decimal GID or a group name found in the group-ID file. .PP Only the super-user can change owner or group, in order to simplman/man8/clri.8 644 0 33 2146 2512730657 6505 .TH CLRI 8 .UC 4 .SH NAME clri \- clear i-node .SH SYNOPSIS .B /etc/clri filesystem i-number ... .SH DESCRIPTION .B N.B.: .I Clri is obsoleted for normal file system repair work by .IR fsck (8). .PP .I Clri writes zeros on the i-nodes with the decimal .I i-numbers on the .I filesystem. After .I clri, any blocks in the affected file will show up as `missing' in an .IR icheck (1) of the .I filesystem. .PP Read and write permission is required on the specified file system device. The i-node becomes allocatable. .PP The primary purpose of this routine is to remove a file which for some reason appears in no directory. If it is used to zap an i-node which does appear in a directory, care should be taken to track down the entry and remove it. Otherwise, when the i-node is reallocated to some new file, the old entry will still point to that file. At that point removing the old entry will destroy the new file. The new entry will again point to an unallocated i-node, so the whole cycle is likely to be repeated again and again. .SH "SEE ALSO" icheck(8) .SH BUGS If the file is open, .I clri is likely to be ineffective. ectory. If it is used to zap an i-node which does appear in a directory, care should be taken to track down the entry and remove it. Otherwise, when the i-node is reallocated to some new file, the old entry will still point to that file. At that point removing the old entry will destroy the new file. The new entry will again point to an unallocated i-node, so the whole cycle is likely to be repeated again aman/man8/config.8 644 0 33 15605 2531446340 7037 .TH CONFIG 8 4/1/81 .UC 4 .SH NAME config \- Build system configuration files .SH SYNOPSIS .B /etc/config .I config_file .SH DESCRIPTION .PP .I Config builds a set of system configuration files from a short file which describes the sort of system that is being configured. It also takes as input a file which tells .I config what files are needed to generate a system. .PP .I Config should be run from the .B conf subdirectory of the system source (usually /sys/conf or /usr/src/sys/conf). .I Config assumes that there is already a directory .I "../config_file" created and it places all its output files in there. The output of .I config consists of a number files: .B ioconf.c which contains a description of what i/o devices are attached to the system, .B ubglue.s which is a set of interrupt service routines for devices attached to the UNIBUS, .B makefile for building the system and a set of header files which contain the number of various devices that will be compiled into the system. .PP After running .I config, it is necessary to run "make depend" in the directory where the new makefile was created. .I Config reminds you of this when it completes. .PP If you get any other error messages from .I config, you should fix the problems in your configuration file and try again. If you try to compile a system that had configuration errors, you will meet with failure. .SH "CONFIG FILE FORMAT" .PP In the following descriptions, a number can be a decimal integer, a whole octal number or a whole hexadecimal number. Hex and octal are specified to .I config in the same way they are specified to the C compiler, a number starting with "0x" is a hex number and a number starting with just a "0" is an octal number. When specifying the timezone, you may also use floating point numbers. .PP Comments are specified in a config file with the character "#". All characters from a "#" to the end of a line are ignored. .PP Lines beginning with tabs are considered continuations of the previous line. .PP Lines of the config file can be one of several types. First there are lines which describe general things about your system. Here is a list of the possibilities. .HP 5 \fBcpu\fR\fI\ "type"\fR .br This system is to run on the cpu type specified. More than one cpu type can appear in the config file. Legal types are .B VAX780, VAX750, and .B VAX7ZZ. .HP 5 .BI options " optlist" .br Compile the listed options into the system. Options in this list are seperated by commas. There is a list of options that you may specify in the generic makefile. A line of the form "options FUNNY,HAHA" yields \-DFUNNY \-DHAHA to the C compiler. .HP 5 .BI timezone " number" [ .B dst ] .br Specifies the timezone you are in. This is measured in the number of hours west of GMT you are. 5 is EST, 8 is PST. If you specify .B dst, the system will operate under daylight savings time. .HP 5 .BI ident " name" .br This system is to be known as .I name. This is usually a cute name like ERNIE (short for Ernie Co-Vax) or VAXWELL (for Vaxwell Smart). .HP 5 .BI maxusers " number((" .br The maximum expected number of simultaneously active user on this system is .I number. This number is used to size several system data structures. .HP 5 .BI config " device sysname" .br Generate a system which runs with its root on .I device and call it .I sysname. There may be more than one .I config specification in a config file. .PP The second type of line in the config file describes what devices your system has and what they are connected to (e.g. I have a DZ-11 on UNIBUS Adapter 0). These lines have the following format. .br .I " dev_type dev_name " .B at .I "con_dev more_info" .PP .I Dev_type is either .B master, .B tape, .B disk, .B controller .B device, or .B pseudo-device. A master is a MASSBUS tape controller. A controller is a disk controller, a UNIBUS tape controller, an mba (MASSBUS) or a uba (UNIBUS). A device is usually something which connects to the uba, like a DZ-11 or a DR-11. Disk and tape should be self-explanatory. A pseudo-device is something which should be conditionally loaded, but is not really a device. Current examples are the bk line discipline, the pseudo-tty driver and various network subsystems. If you load a subsystem you will probably find it convenient to enable conditionaly code using a .B options specification. .PP The .I dev_name is the name of the device you are specifying. If it is not a pseudo-device, you must give a number afterwards (e.g. dz0, dz1, hp0). .PP .I Con_dev is what the device you are specifying is connected to. If you have a disk on MASSBUS adapter zero then the proper .I con_dev is .B mba0. For MASSBUS and UNIBUS adapters, you must give .B nexus? as the .I con_dev. .PP The .I more_info field is a sequence of the following: .HP 5 .BI csr " addr" .br Specifies the csr for a device. Must be given for UNIBUS tape and disk controllers and all devices connected to the UNIBUS. Make certain that you put a leading zero on the address so that it will be interpreted as an octal number. .HP 5 .BI drive " number" .br For a disk or UNIBUS tape, specifies which drive this is. .HP 5 .BI slave " number" .br For a MASSBUS tape, specifies which tape slave it is. .HP 5 .BI flags " number" .br These flags are passed to the device driver at system initialization time. .HP 5 .BI vector " addr [ addr ]" .br For devices which interrupt on the UNIBUS, specifies the interrupt service routine. .PP The easiest way to understand config files it to look at a working one and modify it to suit your system. Here is a short sample configuration file for a system with an RM03, a TU45, a DZ-11 and a DH-11. .nf .ta .5i 1.6i 2.2i 4.5i # # Sample configuration file # cpu VAX780 ident SAMPLE hz 60 timezone 8 dst maxusers 24 config hp vmunix config rk rkvmunix controller mba0 at nexus ? controller uba0 at nexus ? disk hp0 at mba0 drive 0 master ht0 at mba1 drive 0 tape tu0 at ht0 slave 0 pseudo-device pty pseudo-device bk controller hk0 at uba0 csr 0177440 vector rkintr disk rk0 at hk0 drive 0 disk rk1 at hk0 drive 1 device dh1 at uba0 csr 0160040 vector dhrint dhxint device dz0 at uba0 csr 0160100 flags 0xc0 vector dzrint dzxint .fi .dt .PP A .B ? may be substituted for a number in two places and the system will figure out what to fill in for the .B ? when it boots. You can put question marks on a .I con_dev (e.g. at mba?) or on a drive number (e.g. drive ?). This allows redundancy as a single system can be built which will reboot on different hardware configurations. .SH FILES /sys/conf/makefile Generic makefile .br /sys/conf/files List of files system is built from .SH SEE ALSO The SYNOPSIS portion of each device in section 4. .SH AUTHOR Michael Toy .SH BUGS The line numbers reported in error messages are usually off by one. .PP Should describe the format of the ``files'' file here; you can probably figure it out for yourself in the meantime. .PP No exhaustive testing of responses to all the weird input semantic errors possible has been done. hardware configurations. .SH FILES /sys/conf/makefile Generic makefile .br /sys/conf/files List of files system is built fman/man8/crash.8 644 0 33 11375 2574152215 6674 .TH CRASH 8 9/1/81 .UC 4 .SH NAME crash \- what happens when the system crashes .SH DESCRIPTION This section explains what happens when the system crashes and how you can analyze crash dumps. .PP When the system crashes voluntarily it prints a message of the form .IP panic: why i gave up the ghost .LP on the console, takes a dump on a mass storage peripheral, and then invokes an automatic reboot procedure as described in .IR reboot (8). (If auto-reboot is disabled on the front panel of the machine the system will simply halt at this point.) Unless some unexpected inconsistency is encountered in the state of the file systems due to hardware or software failure the system will then resume multi-user operations. .PP The system has a large number of internal consistency checks; if one of these fails, then it will panic with a very short message indicating which one failed. .PP The most common cause of system failures is hardware failure, which can reflect itself in different ways. Here are the messages which you are likely to encounter, with some hints as to causes. Left unstated in all cases is the possibility that hardware or software error produced the message in some unexpected way. .TP IO err in push .ns .TP hard IO err in swap The system encountered an error trying to write to the paging device or an error in reading critical information from a disk drive. You should fix your disk if it is broken or unreliable. .TP timeout table overflow .ns This really shouldn't be a panic, but until we fix up the data structure involved, running out of entries causes a crash. If this happens, you should make the timeout table bigger. .TP KSP not valid .ns .TP SBI fault .ns .TP CHM? in kernel These indicate either a serious bug in the system or, more often, a glitch or failing hardware. If SBI faults recur, check out the hardware or call field service. If the other faults recur, there is likely a bug somewhere in the system, although these can be caused by a flakey processor. Run processor microdiagnostics. .TP machine check %x: \fIdescription\fR .ns .TP \0\0\0\fImachine dependent machine-check information\fR .ns We should describe machine checks, and will someday. For now, ask someone who knows (like your friendly field service people). .TP trap type %d, code=%d, pc=%x A unexpected trap has occurred within the system; the trap types are: .PP .nf 0 reserved addressing fault 1 privileged instruction fault 2 reserved operand fault 3 bpt instruction fault 4 xfc instruction fault 5 system call trap 6 arithmetic trap 7 ast delivery trap 8 segmentation fault 9 protection fault 10 trace trap 11 compatibility mode fault 12 page fault 13 page table fault .fi .PP The favorite trap type in system crashes is trap type 9, indicating a wild reference. The code is the referenced address, and the pc at the time of the fault is printed. These problems tend to be easy to track down if they are kernel bugs since the processor stops cold, but random flakiness seems to cause this sometimes, e.g. we have trapped with code 80000800 three times in six months as an instruction fetch went across this page boundary in the kernel but have been unable to find any reason for this to have happened. .TP init died The system initialization process has exited. This is bad news, as no new users will then be able to log in. Rebooting is the only fix, so the system just does it right away. .PP That completes the list of panic types you are likely to see. .PP When the system crashes it write (or at least attempts to write) a image of the current memory into the back end of the primary swap area. After the system is rebooted, the program .IR savecore (8) runs and preserves a copy of this core image and the current system in a specified directory for later perusal. See .IR savecore (8) for details. .PP To analyze a dump you should begin by running .I "ps \-alxk" to print the process table at the time of the crash. Use .IR adb (1) to examine .IR /vmcore . The location .I _rpb+0t508 is the bottom of a stack onto which were pushed the stack pointer .BR sp , .B PCBB (containing the physical address of a .IR u_area ), .BR MAPEN , .BR IPL , and registers .BR r13 \- r0 (in that order). .BR r13 (fp) is the system frame pointer and the stack is used in standard .B calls format. Use .IR adb (1) to get a reverse calling order. In most cases this procedure will give an idea of what is wrong. A more complete discussion of system debugging is impossible here. See, however, .IR analyze (8) for some more hints. .SH "SEE ALSO" analyze(8), reboot(8) .br .I "VAX 11/780 System Maintenance Guide" for more information about machine checks. .SH BUGS There should be a better program than .IR analyze (8) available which prints out more of the system state symbolically after a crash to lessen the tedious tasks involved in crash analysis. rder. In most cases this procedure will give an idea of what is wrong. A more complete discussion of system debugging is impossible here. See, however, .IR analyze (8) for some more hints. .SH "SEE ALSO" analyze(8), reboot(8) .br .I "VAX 11/780 System Maintenman/man8/cron.8 644 0 33 2356 2512730660 6512 ((.TH CRON 8 .SH NAME cron \- clock daemon .SH SYNOPSIS .B /etc/cron .SH DESCRIPTION .I Cron executes commands at specified dates and times according to the instructions in the file /usr/lib/crontab. Since .I cron never exits, it should only be executed once. This is best done by running .I cron from the initialization process through the file /etc/rc; see .IR init (8). .PP Crontab consists of lines of six fields each. The fields are separated by spaces or tabs. The first five are integer patterns to specify the minute (0-59), hour (0-23), day of the month (1-31), month of the year (1-12), and day of the week (1-7 with 1=Monday). Each of these patterns may contain a number in the range above; two numbers separated by a minus meaning a range inclusive; a list of numbers separated by commas meaning any of the numbers; or an asterisk meaning all legal values. The sixth field is a string that is executed by the Shell at the specified times. A percent character in this field is translated to a new-line character. Only the first line (up to a % or end of line) of the command field is executed by the Shell. The other lines are made available to the command as standard input. .PP Crontab is examined by .I cron every minute. .SH FILES /usr/lib/crontab inclusive; a list of numbers separated by commas meaning any of the numbers; or an asterisk meaning all legal values. The sixth field is a string that is executed by the Shell at the specified times. A percent character in this field is translated to a new-line character. Oman/man8/dcheck.8 644 0 33 3232 2512730661 6765 .TH DCHECK 8 .UC 4 .SH NAME dcheck \- file system directory consistency check .SH SYNOPSIS .B /etc/dcheck [ .B \-i numbers ] [ filesystem ] .SH DESCRIPTION .B N.B.: .I Dcheck is obsoleted for normal consistency checking by .IR fsck (8). .PP .I Dcheck reads the directories in a file system and compares the link-count in each i-node with the number of directory entries by which it is referenced. If the file system is not specified, a set of default file systems is checked. .PP The .B \-i flag is followed by a list of i-numbers; when one of those i-numbers turns up in a directory, the number, the i-number of the directory, and the name of the entry are reported. .PP The program is fastest if the raw version of the special file is used, since the i-list is read in large chunks. .SH FILES Default file systems vary with installation. .SH "SEE ALSO" fsck(8), icheck(8), filsys(5), clri(8), ncheck(8) .SH DIAGNOSTICS When a file turns up for which the link-count and the number of directory entries disagree, the relevant facts are reported. Allocated files which have 0 link-count and no entries are also listed. The only dangerous situation occurs when there are more entries than links; if entries are removed, so the link-count drops to 0, the remaining entries point to thin air. They should be removed. When there are more links than entries, or there is an allocated file with neither links nor entries, some disk space may be lost but the situation will not degenerate. .SH BUGS Since .I dcheck is inherently two-pass in nature, extraneous diagnostics may be produced if applied to active file systems. .PP .I Dcheck is obsoleted by .I fsck and remains for historical reasons. ries than links; if entries are removed, so the link-count drops to 0, the remaining entries point to thin air. They should be removed. When there are more links than entries, or there is an allocated file with neither links nor entries, some disk space may be lost but the situation will not degenerate. .SH BUGS Since .I dcheck is inherently two-pass in naman/man8/delivermail.8 644 0 33 12373 2512730661 10067 .TH DELIVERMAIL 8 .UC 4 .SH NAME delivermail \- deliver mail to arbitrary people .SH SYNOPSIS .B /etc/delivermail [ .BR \- [ fr ] .I address ] [ .B \-a ] [ .BI \-e x ] [ .B \-n ] [ .B \-m ] [ .B \-s ] [ .B \-i ] [ .B \-h .I N ] address ... .SH DESCRIPTION .I Delivermail delivers a letter to one or more people, routing the letter over whatever networks are necessary. .I Delivermail will do inter-net forwarding as necessary to deliver the mail to the correct place. .PP .I Delivermail is not intended as a user interface routine; it is expected that other programs will provide user-friendly front ends, and .I delivermail will be used only to deliver pre-formatted messages. .PP .I Delivermail reads its standard input up to a control-D or a line with a single dot and sends a copy of the letter found there to all of the addresses listed. If the .B \-i flag is given, single dots are ignored. It determines the network to use based on the syntax of the addresses. Addresses containing the character `@' or the word \*(lqat\*(rq are sent to the .SM ARPANET; addresses containing `!' are sent to the .SM UUCP net, and addresses containing `:' or `.' are sent to the Berkeley network. Other addresses are assumed to be local. .PP Local addresses are looked up in a file constructed by .IR newaliases (1) from the data file .I /usr/lib/aliases and aliased appropriately. Aliasing can be prevented by preceding the address with a backslash or using the .B \-n flag. Normally the sender is not included in any alias expansions, e.g., if `john' sends to `group', and `group' includes `john' in the expansion, then the letter will not be delivered to `john'. The .B \-m flag disables this suppression. .PP .I Delivermail computes the person sending the mail by looking at your login name. The \*(lqfrom\*(rq person can be explicitly specified by using the .B \-f flag; or, if the .B \-a flag is given, delivermail looks in the body of the message for a \*(lqFrom:\*(rq or \*(lqSender:\*(rq field in .SM ARPANET format. The .B \-f and .B \-a flags can be used only by the special users .I root and .I network, or if the person you are trying to become is the same as the person you are. The .B \-r flag is entirely equivalent to the .B \-f flag; it is provided for ease of interface only. .PP The .BI \-e x flag controls the disposition of error output, as follows: .TP 3n .B e Print errors on the standard output, and echo a copy of the message when done. It is assumed that a network server will return the message back to the user. .TP .B m Mail errors back to the user. .TP .B p Print errors on the standard output. .TP .B q Throw errors away; only exit status is returned. .TP .B w Write errors back to the user's terminal, but only if the user is still logged in and write permission is enabled; otherwise errors are mailed back. .LP If the error is not mailed back, and if the mail originated on the machine where the error occurred, the letter is appended to the file .I dead.letter in the sender's home directory. .PP If the first character of the user name is a vertical bar, the rest of the user name is used as the name of a program to pipe the mail to. It may be necessary to quote the name of the user to keep .I delivermail from suppressing the blanks from between arguments. .PP The message is normally edited to eliminate \*(lqFrom\*(rq lines that might confuse other mailers. In particular, \*(lqFrom\*(rq lines in the header are deleted, and \*(lqFrom\*(rq lines in the body are prepended by `>'. The .B \-s flag saves \*(lqFrom\*(rq lines in the header. .PP The .B \-h flag gives a \*(lqhop-count\*(rq, i.e., a measure of how many times this message has been processed by .I delivermail (presumably on different machines). Each time .I delivermail processes a message, it increases the hop-count by one; if it exceeds 30 .I delivermail assumes that an alias loop has occurred and it aborts the message. The hop-count defaults to zero. .PP .I Delivermail returns an exit status describing what it did. The codes are defined in .ta 3n +\w'EX_UNAVAILABLE'u+3n .de XX .ti \n(.iu .. .in +\w'EX_UNAVAILABLE'u+6n .XX EX_OK Successful completion on all addresses. .XX EX_NOUSER User name not recognized. .XX EX_UNAVAILABLE Catchall meaning necessary resources were not available. .XX EX_SYNTAX Syntax error in address. .XX EX_SOFTWARE Internal software error, including bad arguments. .XX EX_OSERR Temporary operating system error, such as \*(lqcannot fork\*(rq. .XX EX_NOHOST Host name not recognized. .SH FILES .if t .ta 2i .if n .ta 3i /usr/lib/aliases raw data for alias names .br /usr/lib/aliases.dir data base of alias names .br /usr/lib/aliases.pag .br /bin/mail to deliver uucp mail .br /usr/net/bin/v6mail to deliver local mail .br /usr/net/bin/sendmail to deliver Berknet mail .br /usr/lib/mailers/arpa to deliver ARPANET mail .br /tmp/mail* temp file .br /tmp/xscript* saved transcript .SH SEE\ ALSO biff(1), binmail(1), mail(1), newaliases(1), aliases(5) .SH BUGS .I Delivermail sends one copy of the letter to each user; it should send one copy of the letter to each host and distribute to multiple users there whenever possible. .PP .I Delivermail assumes the addresses can be represented as one word. This is incorrect according to the .SM ARPANET mail protocol RFC 733 (NIC 41952), but is consistent with the real world. RPANET mail .br /tmp/mail* temp file .br /tmp/xscript* saved transcript .SH SEE\ ALSO biff(1), binmail(1), mail(1), newaliases(1), aliases(5) .SH BUGS .I Delivermail sends one copy of the letter to each user; it should send one copy of the letter to each host a((man/man8/dmesg.8 644 0 33 2205 2512730662 6643 .TH DMESG 8 .UC 4 .SH NAME dmesg \- collect system diagnostic messages to form error log .SH SYNOPSIS .B /etc/dmesg [ \- ] .SH DESCRIPTION .I Dmesg looks in a system buffer for recently printed diagnostic messages and prints them on the standard output. The messages are those printed by the system when device (hardware) errors occur and (occasionally) when system tables overflow non-fatally. If the .B \- flag is given, then .I dmesg computes (incrementally) the new messages since the last time it was run and places these on the standard output. This is typically used with .IR cron (8) to produce the error log .I /usr/adm/messages by running the command .IP /etc/dmesg \- >> /usr/adm/messages .LP every 10 minutes. .SH FILES .ta 2i /usr/adm/messages error log (conventional location) .br /usr/adm/msgbuf scratch file for memory of \- option .SH BUGS The system error message buffer is of small finite size. As .I dmesg is run only every few minutes, not all error messages are guaranteed to be logged. This can be construed as a blessing rather than a curse. .PP Error diagnostics generated immediately before a system crash will never get logged. ing the command .IP /etc/dmesg \- >> /usr/adm/messages .LP every 10 minutes. .SH FILES .ta 2i /usr/adm/messages error log (conventional location) .br /usr/adm/msgbuf scratch file for memory of \- option .SH BUGS The system error message buffer is of small finite size. As .I dmesg is run only every few minutes, not all error messages are guaranteed to be logged. This can be cman/man8/dump.8 644 0 33 13037 2531446340 6534 .TH DUMP 8 .UC 4 .SH NAME dump \- incremental file system dump .SH SYNOPSIS .B /etc/dump [ key [ .I argument \&... ] filesystem ] .SH DESCRIPTION .I Dump copies to magnetic tape all files changed after a certain date in the .I filesystem. The .I key specifies the date and other options about the dump. .I Key consists of characters from the set .B 0123456789fuJsdWn. .TP 5 .B 0\-9 This number is the `dump level'. All files modified since the last date stored in the file .I /etc/dumpdates for the same filesystem at lesser levels will be dumped. If no date is determined by the level, the beginning of time is assumed; thus the option .B 0 causes the entire filesystem to be dumped. .TP 5 .B f Place the dump on the next .I argument file instead of the tape. .TP 5 .B u If the dump completes successfully, write the date of the beginning of the dump on file .I /etc/dumpdates. This file records a separate date for each filesystem and each dump level. The format of .I /etc/dumpdates is readable by people, consisting of one free format record per line: filesystem name, increment level and .I ctime(3) format dump date. .I /etc/dumpdates may be edited to change any of the fields, if necessary. Note that .I /etc/dumpdates is in a format different from that which previous versions of .I dump maintained in .I /etc/ddate, although the information content is identical. .TP 5 .B J This option is intended to be invoked only when the old format .I /etc/ddate files are updated to the new format .I /etc/dumpdates format. The effect of this option is to convert between the old, obsolete format and to the new format. If the .B J option is invoked, all other options are ignored, and .I dump terminates immediately. .TP 5 .B s The size of the dump tape is specified in feet. The number of feet is taken from the next .I argument. When the specified size is reached, .I dump will wait for reels to be changed. The default tape size is 2300 feet. .TP 5 .B d The density of the tape, expressed in BPI, is taken from the next .I argument. This is used in calculating the amount of tape used per reel. The default is 1600. .TP 5 .B W .I Dump tells the operator what file systems need to be dumped. This information is gleaned from the files .I /etc/dumpdates and .I /etc/fstab. The .B W option causes .I dump to print out, for each file system in .I /etc/dumpdates the most recent dump date and level, and highlights those file systems that should be dumped. If the .B W option is set, all other options are ignored, and .I dump exits immediately. .TP 5 .B w Is like W, but prints only those filesystems which need to be dumped. .TP 5 .B n Whenever .I dump requires operator attention, notify by means similar to a .I wall(1) all of the operators in the group \*(lqoperator\*(rq. .PP If no arguments are given, the .I key is assumed to be .B 9u and a default file system is dumped to the default tape. .PP .I Dump requires operator intervention on these conditions: end of tape, end of dump, tape write error, tape open error or disk read error (if there are more than a threshold of 32). In addition to alerting all operators implied by the .B n key, .I dump interacts with the operator on .I dump's control terminal at times when .I dump can no longer proceed, or if something is grossly wrong. All questions .I dump poses .B must be answered by typing \*(lqyes\*(rq or \*(lqno\*(rq, appropriately. .PP Since making a dump involves a lot of time and effort for full dumps, .I dump checkpoints itself at the start of each tape volume. If writing that volume fails for some reason, .I dump will, with operator permission, restart itself from the checkpoint after the old tape has been rewound and removed, and a new tape has been mounted. .PP .I Dump tells the operator what is going on at periodic intervals, including usually low estimates of the number of blocks to write, the number of tapes it will take, the time to completion, and the time to the tape change. The output is verbose, so that others know that the terminal controlling .I dump is busy, and will be for some time. .PP Now a short suggestion on how to perform dumps. Start with a full level 0 dump .PP dump 0un .PP Next, dumps of active file systems are taken on a daily basis, using a modified Tower of Hanoi algorithm, with this sequence of dump levels: .ce 1 3 2 5 4 7 6 9 8 9 9 ... For the daily dumps, a set of 10 tapes per dumped file system is used on a cyclical basis. Each week, a level 1 dump is taken, and the daily Hanoi sequence repeats with 3. For weekly dumps, a set of 5 tapes per dumped file system is used, also on a cyclical basis. Each month, a level 0 dump is taken on a set of fresh tapes that is saved forever. .SH FILES .nf .ta \w'/etc/dumpdates\ \ 'u /dev/rrp1g default filesystem to dump from /dev/rmt8 default tape unit to dump to /etc/ddate old format dump date record (obsolete after \fB\-J\fR option) /etc/dumpdates new format dump date record /etc/fstab Dump table: file systems and frequency /etc/group to find group \fIoperator\fP .fi .DT .br .SH "SEE ALSO" restor(1), dump(5), dumpdir(1), fstab(5) .SH DIAGNOSTICS Many, and verbose. .SH BUGS .PP Sizes are based on 1600 BPI blocked tape; the raw magtape device has to be used to approach these densities. Fewer than 32 read errors on the filesystem are ignored. Each reel requires a new process, so parent processes for reels already written just hang around until the entire tape is written. .PP It would be nice if .I dump knew about the dump sequence, kept track of the tapes scribbled on, told the operator which tape to mount when, and provided more assistance for the operator running .I restor. S .PP Sizes are based on 1600 BPI blocked tape; the raw magtape device has to be used to approach these densities. Fewer than 32 read errors on the filesystem are ignored. Each reel requires a new process, so parent processes for reels already written just hang around until the entire tape is written. .PP It would be nice if .I dump knew about the dump sequence, kept track of the tapes scribbled on, told the operator which tape to mount when, and provided more assistance for tman/man8/dumpdir.8 644 0 33 1411 2512730662 7206 .TH DUMPDIR 8 .UC 4 .SH NAME dumpdir \- print the names of files on a dump tape .SH SYNOPSIS .B /etc/dumpdir [ .B f filename ] .SH DESCRIPTION .I Dumpdir is used to read magtapes dumped with the .I dump command and list the names and inode numbers of all the files and directories on the tape. .PP The .B f option causes .I filename as the name of the tape instead of the default. .SH FILES default tape unit varies with installation .br rst* .SH "SEE ALSO" dump(1), restor(1) .SH DIAGNOSTICS If the dump extends over more than one tape, it may ask you to change tapes. Reply with a new-line when the next tape has been mounted. .SH BUGS There is redundant information on the tape that could be used in case of tape reading problems. Unfortunately, .I dumpdir doesn't use it. and directories on the tape. .PP The .B f option causes .I filename as the name of the tape instead of the default. .SH FILES default tape unit varies with installation .br rst* .SH "SEE ALSO" dump(1), restor(1) .SH DIAGNOSTICS If the dump extend((man/man8/flcopy.8 664 0 33 31 2512730662 6775 .so /usr/man/man8/arff.8 , it may ask you to change tapes. Reply with a new-line when the next tape has been mounted. .SH BUGS There is redundant information on the tape that could be used in case of tape reading problems. Unfortunately, .I dumpdir doesn't use it. and directories on the tape. .PP The .B f option causes .I filename as the name of the tape instead of the default. .SH FILES default tape unit varies wit/( ,( 5Ċ /\@,\D"man/man8/format.8 664 0 33 3734 2527170647 7055 .TH FORMAT 8 4/26/81 .UC 4 .SH NAME format \- how to format disks .SH DESCRIPTION .PP Warning: These instructions are for people with 11/780 CPU's. We don't know how to do this for 11/750 cpus (yet at least), you'll have to figure it out yourself; if you do call us and tell us how. .PP The formatting procedures are different for each type of disk. Listed here are the formatting procedures for RK07's, RP0X, RM0X and Emulex Unibus Disks. .PP You should shut down UNIX and halt the machine to do any disk formatting. Make certain you put in the pack you want formatted. It is also a good idea to spin down or write protect the disks you don't want to format, just in case. .PP .B Formatting a RK07. Load the floppy labled, "RX11 VAX DSK LD DEV #1" in the floppy disk drive, and type the following commands: .nf >>>BOOT DIAGNOSTIC SUPERVISOR. ZZ-ESSAA-X5.0-119 23-JAN-1980 12:44:40.03 DS>ATTACH DW780 SBI DW0 3 5 DS>ATTACH RK07 DW0 DMA0 DS>SELECT DMA0 DS>LOAD EVRAC DS>START/SEC:PACKINIT .fi .PP .B Formatting a RP0X. Follow the above procedures except that the ATTACH and SELECT lines should read. .nf DS>ATTACH RH780 SBI RH0 8 5 DS>ATTACH RP0X RH0 DBA0 (RP0X is, e.g. RP06) DS>SELECT DBA0 .fi .PP This is for drive 0 on mba0; use 9 instead of 8 for mba1, etc. .PP .B Formatting a RM0X. Follow the above procedures except that the ATTACH and SELECT lines should read. .nf DS>ATTACH RH780 SBI RH0 8 5 DS>ATTACH RM0X RH0 DRA0 DS>SELECT DRA0 .fi .PP .B Formatting an Emulex Unibus Disk. Type these commands on the console: .nf >>>SET REL:2013FDC0 >>>SET DEF WORD >>>SET DEF OCT >>>SET DEF PHYS >>>U >>>I >>>D/P 10 0 >>>D/P 0 21 >>>D/P 36 177777 >>>D/P 0 77 (figure out when it is done) >>>SET REL:0 >>>SET DEF LONG >>>SET DEF HEX .fi .PP Once a disk is formatted, you'll still have to build file systems on it with mkfs(8) before you can use it with UNIX. .PP Don't forget to put your UNIX console floppy back in the floppy disk drive. .SH SEE ALSO bad144(8), badsect(8), mkfs(8) isk. Type these commands on the consman/man8/fsck.8 664 0 33 15441 2531446341 6521 .de us \\$1\l'|0\(ul' .. .TH FSCK 8 .UC 4 .SH NAME fsck \- file system consistency check and interactive repair .SH SYNOPSIS .B /etc/fsck .B \-p [ filesystem ... ] .br .B /etc/fsck [ .B \-y ] [ .B \-n ] [ .BR \-s X ] [ .BR \-S X ] [ .B \-t filename ] [ filesystem ] ... .SH DESCRIPTION The first form of .I fsck preens a standard set of filesystems or the specified file systems. It is normally used in the script .B /etc/rc during automatic reboot. In this case .I fsck reads the table .B /etc/fstab to determine which file systems to check. It uses the information there to inspect groups of disks in parallel taking maximum advantage of i/o overlap to check the file systems as quickly as possible. Normally, the root file system will be checked on pass 1, other ``root'' (``a'' partition) file systems on pass 2, other small file systems on separate passes (e.g. the ``d'' file systems on pass 3 and the ``e'' file systems on pass 4), and finally the large user file systems on the last pass, e.g. pass 5. A pass number of 0 in fstab causes a disk to not be checked; similarly partitions which are not shown as to be mounted ``rw'' or ``ro'' are not checked. .PP The system takes care that only a restricted class of innocuous inconsistencies can happen unless hardware or software failures intervene. These are limited to the following: .IP Unreferenced inodes .ns .IP Link counts in inodes too large .ns .IP Missing blocks in the free list .ns .IP Blocks in the free list also in files .ns .IP Counts in the super-block wrong .PP These are the only inconsistencies which .I fsck with the .B \-p option will correct; if it encounters other inconsistencies, it exits with an abnormal return status and an automatic reboot will then fail. For each corrected inconsistency one or more lines will be printed identifying the file system on which the correction will take place, and the nature of the correction. After successfully correcting a file system, .I fsck will print the number of files on that file system and the number of used and free blocks. .PP Without the .B \-p option, .I fsck audits and interactively repairs inconsistent conditions for file systems. If the file system is inconsistent the operator is prompted for concurrence before each correction is attempted. It should be noted that a number of the corrective actions which are not fixable under the .B \-p option will result in some loss of data. The amount and severity of data lost may be determined from the diagnostic output. The default action for each consistency correction is to wait for the operator to respond \fByes\fP or \fBno\fP. If the operator does not have write permission .I fsck will default to a .BR "\-n " action. .PP .I Fsck has more consistency checks than its predecessors .IR "check, dcheck, fcheck, " "and" " icheck" combined. .PP The following flags are interpreted by .I fsck. .TP 6 .B \-y Assume a yes response to all questions asked by .I fsck; this should be used with great caution as this is a free license to continue after essentially unlimited trouble has been encountered. .TP 6 .B \-n Assume a no response to all questions asked by .I fsck; do not open the file system for writing. .TP 6 .BR \-s \fIX Ignore the actual free list and (unconditionally) reconstruct a new one by rewriting the super-block of the file system. The file system should be unmounted while this is done; if this is not possible, care should be taken that the system is quiescent and that it is rebooted immediately afterwards. This precaution is necessary so that the old, bad, in-core copy of the superblock will not continue to be used, or written on the file system. .IP The .BR \-s \fIX option allows for creating an optimal free-list organization. The following forms of .I X are supported for the following devices: .sp .nf \-s3 (RP03) \-s4 (RP04, RP05, RP06) \-sBlocks-per-cylinder\fB:\fRBlocks-to-skip (for anything else) .fi .IP "" 6 If .I X is not given, the values used when the filesystem was created are used. If these values were not specified, then the value .I 400:9 is used. .TP 6 .BR \-S \fIX Conditionally reconstruct the free list. This option is like .BR \-s \fIX above except that the free list is rebuilt only if there were no discrepancies discovered in the file system. Using .B \-S will force a no response to all questions asked by .I fsck. This option is useful for forcing free list reorganization on uncontaminated file systems. .TP 6 .B \-t If .I fsck cannot obtain enough memory to keep its tables, it uses a scratch file. If the \f3\-t\fP option is specified, the file named in the next argument is used as the scratch file, if needed. Without the .BR "\-t " flag, .I fsck will prompt the operator for the name of the scratch file. The file chosen should not be on the filesystem being checked, and if it is not a special file or did not already exist, it is removed when .I fsck completes. .PP If no filesystems are given to .I fsck then a default list of file systems is read from the file .BR /etc/fstab . .PP .ne 10 Inconsistencies checked are as follows: .TP 6 1. Blocks claimed by more than one inode or the free list. .br .br .ns .TP 6 2. Blocks claimed by an inode or the free list outside the range of the file system. .br .br .ns .TP 6 3. Incorrect link counts. .br .br .ns .TP 6 4. Size checks: .br .ns .IP "" 12 Directory size not 16-byte aligned. .br .br .ns .TP 6 5. Bad inode format. .br .br .ns .TP 6 6. Blocks not accounted for anywhere. .br .br .ns .TP 6 7. Directory checks: .br .br .ns .IP "" 12 File pointing to unallocated inode. .br Inode number out of range. .br .br .ns .TP 6 8. Super Block checks: .br .br .ns .IP "" 12 More than 65536 inodes. .br More blocks for inodes than there are in the file system. .br .br .ns .TP 6 9. Bad free block list format. .br .br .ns .TP 6 10. Total free block and/or free inode count incorrect. .PP Orphaned files and directories (allocated but unreferenced) are, with the operator's concurrence, reconnected by placing them in the .B lost+found directory. The name assigned is the inode number. The only restriction is that the directory .B lost((+found must preexist in the root of the filesystem being checked and must have empty slots in which entries can be made. This is accomplished by making .BR lost+found , copying a number of files to the directory, and then removing them (before .I fsck is executed). .PP Checking the raw device is almost always faster. .SH FILES .br .ns .TP 21 /etc/fstab contains default list of file systems to check. .SH DIAGNOSTICS The diagnostics produced by .I fsck are intended to be self-explanatory. .SH "SEE ALSO" fstab(5), fs(5), crash(8), reboot(8) .SH BUGS Inode numbers for .BR . "" and .BR .. "" in each directory should be checked for validity. .PP \f3\-g\fP and \f3\-b\fP options from .I check should be available in .I fsck. .PP There should be some way to start a \fBfsck \-p\fR at pass \fIn\fR. evice is almost always faster. .SH FILES .br .ns .TP 21 /etc/fstab contains default list of file systems to check. .SH DIAGNOSTICS The diagnostics produced by .I fsck are intended to be self-explanatory. .SH "SEE ALSO" fstman/man8/getty.8 644 0 33 3300 2512730664 6677 .TH GETTY 8 .UC 4 .SH NAME getty \- set terminal mode .SH SYNOPSIS .B /etc/getty [ char ] .SH DESCRIPTION .I Getty is invoked by .IR init (8) immediately after a terminal is opened, following the making of a connection. While reading the name .I getty attempts to adapt the system to the speed and type of terminal being used. .PP .I Init calls .I getty with an argument specified by the .I ttys file entry for the terminal line. Arguments other than `0' can be used to make .I getty treat the line specially. Normally, it sets the speed of the interface to 300 baud, specifies that raw mode is to be used (break on every character), that echo is to be suppressed, and either parity allowed. It types a banner identifying the system (from /usr/include/ident.h and the `login:' message. Then the user's name is read, a character at a time. If a null character is received, it is assumed to be the result of the user pushing the `break' (`interrupt') key. The speed is then changed to 1200 baud and the `login:' is typed again; a second `break' changes the speed to 150 baud and the `login:' is typed again. Successive `break' characters cycle through the speeds 300, 1200, and 150 baud. .PP The user's name is terminated by a new-line or carriage-return character. The latter results in the system being set to treat carriage returns appropriately (see .IR stty (2)). .PP The user's name is scanned to see if it contains any lower-case alphabetic characters; if not, and if the name is nonempty, the system is told to map any future upper-case characters into the corresponding lower-case characters. .PP Finally, login is called with the user's name as argument. .SH "SEE ALSO" init(8), login(1), stty(2), ttys(5) .SH BUGS minated by a new-line or carriage-return character. The latter results in the system being set to treat carriage returns appropriately (see .IR stty (2)). .PP The user's name is scanned to see if it contains any lower-case alphabetic characters; if not, and if the name is nonempty, the system is told to map any futureman/man8/halt.8 644 0 33 1242 2531446341 6473 .TH HALT 8 5/11/81 .UC 4 .SH NAME halt \- stop the processor .SH SYNOPSIS .B /etc/halt [ .B \-n ] [ .B \-q ] [ .B \-y ] .SH DESCRIPTION .I Halt writes out sandbagged information to the disks and then stops the processor. The machine does not reboot, even if the auto-reboot switch is set on the console. .PP The .B \-n option prevents the sync before stopping. The .B \-q option causes a quick halt, no graceful shutdown is attempted. The .B \-y option is needed if you are trying to halt the system from a dialup. .SH SEE ALSO reboot(8), shutdown(8) .SH BUGS It is very difficult to halt a VAX, as the machine wants to then reboot itself. A rather tight loop suffices. ged information to the disks and then stops the processor. The machine does not reboot, even if the auto-reboot switch is set on the console. .PP The .B \-n option prevents the sync before stopping. The .B \-q option causes a quick halt, no graceful shutdown is attempted. The .B \-y option is needed if you are trying to halt the system from a diman/man8/icheck.8 644 0 33 5460 2512730664 7002 .TH ICHECK 8 .UC 4 .SH NAME icheck \- file system storage consistency check .SH SYNOPSIS .B /etc/icheck [ .B \-s ] [ .B \-b numbers ] [ filesystem ] .SH DESCRIPTION .B N.B.: .I Icheck is obsoleted for normal consistency checking by .IR fsck (8). .PP .I Icheck examines a file system, builds a bit map of used blocks, and compares this bit map against the free list maintained on the file system. If the file system is not specified, a set of default file systems is checked. The normal output of .I icheck includes a report of .IP "" The total number of files and the numbers of regular, directory, block special and character special files. .IP "" The total number of blocks in use and the numbers of single-, double-, and triple-indirect blocks and directory blocks. .IP "" The number of free blocks. .IP "" The number of blocks missing; i.e. not in any file nor in the free list. .PP The .B \-s option causes .I icheck to ignore the actual free list and reconstruct a new one by rewriting the super-block of the file system. The file system should be dismounted while this is done; if this is not possible (for example if the root file system has to be salvaged) care should be taken that the system is quiescent and that it is rebooted immediately afterwards so that the old, bad in-core copy of the super-block will not continue to be used. Notice also that the words in the super-block which indicate the size of the free list and of the i-list are believed. If the super-block has been curdled these words will have to be patched. The .B \-s option causes the normal output reports to be suppressed. .PP Following the .B \-b option is a list of block numbers; whenever any of the named blocks turns up in a file, a diagnostic is produced. .PP .I Icheck is faster if the raw version of the special file is used, since it reads the i-list many blocks at a time. .SH FILES Default file systems vary with installation. .SH "SEE ALSO" fsck(8), dcheck(8), ncheck(8), filsys(5), clri(8) .SH DIAGNOSTICS For duplicate blocks and bad blocks (which lie outside the file system) .I icheck announces the difficulty, the i-number, and the kind of block involved. If a read error is encountered, the block number of the bad block is printed and .I icheck considers it to contain 0. `Bad freeblock' means that a block number outside the available space was encountered in the free list. `\fIn\fR dups in free' means that .IR n "" blocks were found in the free list which duplicate blocks either in some file or in the earlier part of the free list. .SH BUGS Since .I icheck is inherently two-pass in nature, extraneous diagnostics may be produced if applied to active file systems. .PP It believes even preposterous super-blocks and consequently can get core images. .PP The system should be fixed so that the reboot after fixing the root file system is not necessary. encountered in the free list. `\fIn\fR dups in free' means that .IR n "" blocks were found in the free list which duplicate blocks either in some file or in the earlier part of the free list. .SH BUGS Since .man/man8/init.8 644 0 33 11135 2527170647 6540 .TH INIT 8 4/1/81 .UC 4 .SH NAME init \- process control initialization .SH SYNOPSIS .B /etc/init .SH DESCRIPTION .I Init is invoked inside UNIX as the last step in the boot procedure. It normally then runs the automatic reboot sequence as described in .IR reboot (8), and if this succeeds, begins multi-user operation. If the reboot fails, it commences single user operation by giving the super-user a shell on the console. It is possible to pass parameters from the boot program to .I init so that single user operation is commenced immediately. When such single user operation is terminated by killing the single-user shell (i.e. by hitting ^D), .I init runs .I /etc/rc without the reboot parameter. This command file performs housekeeping operations such as removing temporary files, mounting file systems, and starting daemons. .PP In multi-user operation, .I init's role is to create a process for each terminal port on which a user may log in. To begin such operations, it reads the file .I /etc/ttys and forks seve((ral times to create a process for each terminal specified in the file. Each of these processes opens the appropriate terminal for reading and writing. These channels thus receive file descriptors 0, 1 and 2, the standard input and output and the diagnostic output. Opening the terminal will usually involve a delay, since the .IR open "" is not completed until someone is dialed up and carrier established on the channel. If a terminal exists but an error occurs when trying to open the terminal .I init complains by writing a message to the system console; the message is repeated every 10 minutes for each such terminal until the terminal is shut off in /etc/ttys and init notified (by a hangup, as described below), or the terminal becomes accessible (init checks again every minute). After an open succeeds, .I /etc/getty is called with argument as specified by the second character of the .I ttys file line. .I Getty reads the user's name and invokes .I login to log in the user and execute the Shell. .PP Ultimately the Shell will terminate because of an end-of-file either typed explicitly or generated as a result of hanging up. The main path of .IR init , which has been waiting for such an event, wakes up and removes the appropriate entry from the file .IR utmp , which records current users, and makes an entry in .IR /usr/adm/wtmp , which maintains a history of logins and logouts. The .I wtmp entry is made only if a user logged in successfully on the line. Then the appropriate terminal is reopened and .I getty is reinvoked. .PP .I Init catches the .I hangup signal (signal SIGHUP) and interprets it to mean that the file .I /etc/ttys should be read again. The Shell process on each line which used to be active in .I ttys but is no longer there is terminated; a new process is created for each added line; lines unchanged in the file are undisturbed. Thus it is possible to drop or add phone lines without rebooting the system by changing the .I ttys file and sending a .I hangup signal to the .I init process: use `kill \-HUP 1.' .PP .I Init will terminate multi-user operations and resume single-user mode if sent a terminate (TERM) signal, i.e. ``kill \-TERM 1''. If there are processes outstanding which are deadlocked (due to hardware or software failure), .I init will not wait for them all to die (which might take forever), but will time out after 30 seconds and print a warning message. .PP .I Init will cease creating new .IR getty 's and allow the system to slowly die away, if it is sent a terminal stop (TSTP) signal, i.e. ``kill \-TSTP 1''. A later hangup will resume full multi-user operations, or a terminate will initiate a single user shell. This hook is used by .IR reboot (8) and .IR halt (8). .PP .I Init's role is so critical that if it dies, the system will reboot itself automatically. If, at bootstrap time, the .I init process cannot be located, the system will loop in user mode at location 0x13. .SH DIAGNOSTICS \fBinit: \fR\fItty\fR\|\fB: cannot open\fR. A terminal which is turned on in the \fIrc\fR file cannot be opened, likely because the requisite lines are either not configured into the system or the associated device was not attached during boot-time system configuration. .LP \fBWARNING: Something is hung (wont die); ps axl advised\fR. A process is hung and could not be killed when the system was shutting down. This is usually caused by a process which is stuck in a device driver due to a persistent device error condition. .SH FILES /dev/console, /dev/tty?, /etc/utmp, /usr/adm/wtmp, /etc/ttys, /etc/rc .SH "SEE ALSO" login(1), kill(1), sh(1), ttys(5), crash(8), getty(8), rc(8), reboot(8), halt(8), shutdown(8) ed device was not attached during boot-time system configuration. .LP \fBWARNING: Something is hung (wont die); ps axl advised\fR. A process is hung and could not be killed when the system was shutting down. This is usually caused by a process which is stuck in a device driver due to a persistent device error condition. .SH FILES /dev/console, /dev/tty?, /etc/utmp, /usr/adm/wtmp, /etc/ttys, /etc/rc .SH "SEE ALSO" lman/man8/makekey.8 644 0 33 2651 2512730665 7202 .TH MAKEKEY 8 .SH NAME makekey \- generate encryption key .SH SYNOPSIS .B /usr/lib/makekey .SH DESCRIPTION .I Makekey improves the usefulness of encryption schemes depending on a key by increasing the amount of time required to search the key space. It reads 10 bytes from its standard input, and writes 13 bytes on its standard output. The output depends on the input in a way intended to be difficult to compute (i.e. to require a substantial fraction of a second). .PP The first eight input bytes (the .IR "input key" ) can be arbitrary ASCII characters. The last two (the .IR salt ) are best chosen from the set of digits, upper- and lower-case letters, and `.' and `/'. The salt characters are repeated as the first two characters of the output. The remaining 11 output characters are chosen from the same set as the salt and constitute the .I "output key." .PP The transformation performed is essentially the following: the salt is used to select one of 4096 cryptographic machines all based on the National Bureau of Standards DES algorithm, but modified in 4096 different ways. Using the input key as key, a constant string is fed into the machine and recirculated a number of times. The 64 bits that come out are distributed into the 66 useful key bits in the result. .PP .I Makekey is intended for programs that perform encryption (e.g. .I ed and .IR crypt (1)). Usually its input and output will be pipes. .SH SEE ALSO crypt(1), ed(1) is used to select one of 4096 cryptographic machines all based on the National Bureau man/man8/mkfs.8 644 0 33 6451 2531446341 6512 .TH MKFS 8 5/10/81 .UC 4 .SH NAME mkfs \- construct a file system .SH SYNOPSIS .B /etc/mkfs special size [ m n ] .br .B /etc/mkfs special proto .SH DESCRIPTION .I Mkfs constructs a file system by writing on the special file .I special. In the first form of the command a numeric size is given and .I mkfs builds a file system with a single empty directory on it. The number of i-nodes is calculated as a function of the filesystem size. (No boot program is initialized in this form of .I mkfs.) .PP .B N.B.: All filesystems should have a .I lost+found directory for .IR fsck (8); this should be created for each file system by running .IR mklost+found (8) in the root directory of a newly created file system, after the file system is first mounted. .PP In bootstrapping, the second form of .I mkfs is sometimes used. In this form, the file system is constructed according to the directions found in the prototype file .I proto. The prototype file contains tokens separated by spaces or new lines. The first token is the name of a file to be copied onto sector zero as the bootstrap program. The second token is a number specifying the size of the created file system. Typically it will be the number of blocks on the device, perhaps diminished by space for swapping. The next token is the number of i-nodes in the i-list. The next set of tokens comprise the specification for the root file. File specifications consist of tokens giving the mode, the user-id, the group id, and the initial contents of the file. The syntax of the contents field depends on the mode. .PP The mode token for a file is a 6 character string. The first character specifies the type of the file. (The characters .B \-bcd specify regular, block special, character special and directory files respectively.) The second character of the type is either .B u or .B \- to specify set-user-id mode or not. The third is .B g or .B \- for the set-group-id mode. The rest of the mode is a three digit octal number giving the owner, group, and other read, write, execute permissions, see .IR chmod (1). .PP Two decimal number tokens come after the mode; they specify the user and group ID's of the owner of the file. .PP If the file is a regular file, the next token is a pathname whence the contents and size are copied. .PP If the file is a block or character special file, two decimal number tokens follow which give the major and minor device numbers. .PP If the file is a directory, .I mkfs makes the entries .BR . "" and .B .. and then reads a list of names and (recursively) file specifications for the entries in the directory. The scan is terminated with the token .BR $ . .PP A sample prototype specification follows: .PP .nf .in +5 /usr/mdec/uboot 4872 55 d\-\-777 3 1 usr d\-\-777 3 1 sh \-\-\-755 3 1 /bin/sh ken d\-\-755 6 1 $ b0 b\-\-644 3 1 0 0 c0 c\-\-644 3 1 0 0 $ $ .in -5 .fi .PP The arguments m and n specify the interleave factor. M should always be 3 and you should use the following table to choose n. as follows. .nf .ta .5i 2.5i RM03 80 RM05 304 RM80 217 RP06 209 RP07 800 SI/CDC 9766 304 RK07 33 EMULEX/AMPEX 300M 304 EMULEX/FUJITSU 160M 160 .fi .dt .SH "SEE ALSO" filsys(5), dir(5), fsck(8), mklost+found(8) .SH BUGS There should be some way to specify links. .PP There should be some way to specify bad blocks. .PP Should make .I lost+found automatically. $ .in -5 .fi .PP The arguments m and n specify the interleave factor. M should always be 3 and you should use the following table to choose n. as follows. .nf .ta .5i 2.5i RM03 80 RM05 304 RM80 217 RP06 209 RP((man/man8/mklost+found.8 644 0 33 746 2512730667 10161 .TH MKLOST+FOUND 8 .UC 4 .SH NAME mklost+found \- make a lost+found directory for fsck .SH SYNOPSIS .B /etc/mklost+found .SH DESCRIPTION A directory .I lost+found is created in the current directory and a number of empty files are created therein and then removed so that there will be empty slots for .IR fsck (8). This command should be run immediately after first mounting a newly created file system. .SH SEE\ ALSO fsck(8), mkfs(8) .SH BUGS Should be done automatically by .I mkfs. ,\D"man/man8/mknod.8 644 0 33 1150 2512730667 6657 .TH MKNOD 8 .UC 4 .SH NAME mknod \- build special file .SH SYNOPSIS .B /etc/mknod name [ .B c ] [ .B b ] major minor .SH DESCRIPTION .I Mknod makes a special file. The first argument is the .I name of the entry. The second is .B b if the special file is block-type (disks, tape) or .B c if it is character-type (other devices). The last two arguments are numbers specifying the .I major device type and the .I minor device (e.g. unit, drive, or line number). .PP The assignment of major device numbers is specific to each system. They have to be dug out of the system source file .I conf.c. .SH "SEE ALSO" mknod(2) ] major minor .SH DESCRIPTION .I Mknod makes a special file. The first argument is the .I name of the entry. The second is .B b if the special file is block-type (disks, tape) or .B c if it is character-type (other devices). The last two arguments are numbers specifying the .I major device type and the .I minor device (e.g. unit, drive, or line number). .PP The assignment of major device numbers is specifman/man8/mount.8 644 0 33 3104 2512730667 6712 .TH MOUNT 8 .UC 4 .SH NAME mount, umount \- mount and dismount file system .SH SYNOPSIS .B /etc/mount [ special name [ .B \-r ] ] .PP .B /etc/mount .B \-a .PP .B /etc/umount special .PP .B /etc/umount .B \-a .SH DESCRIPTION .I Mount announces to the system that a removable file system is present on the device .I special. The file .I name must exist already; it must be a directory (unless the root of the mounted file system is not a directory). It becomes the name of the newly mounted root. The optional argument .B \-r indicates that the file system is to be mounted read-only. .PP .I Umount announces to the system that the removable file system previously mounted on device .I special is to be removed. .PP If the .B \-a option is present for either .I mount or .I umount, all of the file systems described in .I /etc/fstab are attempted to be mounted or unmounted. In this case, .I special and .I name are taken from .I /etc/fstab. The .I special file name from .I /etc/fstab is the block special name. .PP These commands maintain a table of mounted devices in .I /etc/mtab. If invoked without an argument, .I mount prints the table. .PP Physically write-protected and magnetic tape file systems must be mounted read-only or errors will occur when access times are updated, whether or not any explicit write is attempted. .SH FILES /etc/mtab mount table .br /etc/fstab file system table .SH "SEE ALSO" mount(2), mtab(5), fstab(5) .SH BUGS Mounting file systems full of garbage will crash the system. .br Mounting a root directory on a non-directory makes some apparently good pathnames invalid. ed without an argument, .I mount prints the table. .PP Physically write-protected and magnetic tape file systems must be mounted read-only or errors will occur when access times are updated, whether or not any explicit write is attempted. .SH FILES /etc/mtab mount table .br /etc/fstab file system table .SH "SEE ALSO" mount(2), mtab(5), fstab(5) .SH BUGS Mounting file systems full of garbage will crash the system. .br Mounting a root directoman/man8/ncheck.8 644 0 33 2137 2512730670 7002 .TH NCHECK 8 .UC 4 .SH NAME ncheck \- generate names from i-numbers .SH SYNOPSIS .B /etc/ncheck [ .B \-i numbers ] [ .B \-a ] [ .B \-s ] [ filesystem ] .SH DESCRIPTION .B N.B.: For most normal file system maintenance, the function of .I ncheck is subsumed by .IR fsck (8). .PP .I Ncheck with no argument generates a pathname vs. i-number list of all files on a set of default file systems. Names of directory files are followed by `/\fB.\fR'. The .B \-i option reduces the report to only those files whose i-numbers follow. The .B \-a option allows printing of the names .RB ` . ' and .RB ` .. ', which are ordinarily suppressed. suppressed. The .B \-s option reduces the report to special files and files with set-user-ID mode; it is intended to discover concealed violations of security policy. .PP A file system may be specified. .PP The report is in no useful order, and probably should be sorted. .SH "SEE ALSO" sort(1), dcheck(8), fsck(8), icheck(8) .SH DIAGNOSTICS When the filesystem structure is improper, `??' denotes the `parent' of a parentless file and a pathname beginning with `...' denotes a loop. are ordinarily suppressed. suppressed. The .B \-s option reduces the report to special files and files with set-user-ID mode; it is intended to discover concealed violations of security policy. .PP A file system may be specified. .PP The report is in no useful order, and probably should be sorted. .SH "SEE ALSO" sort(1), dcheck(8), fsck(8), icheck(8) .SH DIAGNOSTICS When the filesystem structure is improper, `??'man/man8/old.8 664 0 33 2410 2531446341 6321 .TH OLD 8 .UC 4 .SH NAME old \- directory of old programs .SH SYNOPSIS .B /usr/old/bin .br .B /usr/old/include .br .B /usr/old/lib .sp .B /usr/old/cc \-I/usr/old/include \&... .SH DESCRIPTION After the 3rd Berkeley Distribution, the formats for binary and archive files were changed. The binaries were modified to allow arbitrary length symbols, which required adding a string table at the end of the symbol table, and having symbol table entries point into the names in that table. The archive was modified to be a portable format, using strings instead of binary numbers, to avoid problems of different sizes of integers on different machines. These changes are incompatible with older formats. .PP .B /usr/old is the root of a hierarchy of binaries, include files, and libraries in the old binary and archive formats. They contain a complete set of programs and files necessary for people who need to deal with the original \s-2UNIX\s+2 formats. .PP In order to create new binaries in the old format, one must include the right header files. For example, to create a program called \*(lqfoo\*(rq which uses the old math library in the old format, say .br .IP .B /usr/old/cc \-I/usr/old/include [ .I flags ] foo.c .B \-lm .SH "SEE ALSO" arcv(8), ar(1), cc(1), a.out(5), ar(5) .SH BUGS aries in the old binary and archive formats. They contain a complete set of programs and files necessary for people who need to deal with the original \s-2UNIX\s+2 formats. .PP In order to create new binaries in the old format, one must include theman/man8/pstat.8 644 0 33 15446 2527170653 6736 .TH PSTAT 8 4/1/81 .UC 4 .SH NAME pstat \- print system facts .SH SYNOPSIS .B /etc/pstat [ .B \-aixptufT ] [ suboptions ] [ file ] .SH DESCRIPTION .I Pstat interprets the contents of certain system tables. If .I file is given, the tables are sought there, otherwise in .I /dev/kmem. The required namelist is taken from .I /vmunix. Options are .TP \w'WCHAN\ 'u .B \-a Under .BR \-p , describe all process slots rather than just active ones. .TP .B \-i Print the inode table with the these headings: .IP LOC The co((re location of this table entry. .PD 0 .IP FLAGS Miscellaneous state variables encoded thus: .RS .IP L locked .IP U update time .IR (filsys (5)) must be corrected .IP A access time must be corrected .IP M file system is mounted here .IP W wanted by another process (L flag is on) .IP T contains a text file .IP C changed time must be corrected .RE .IP CNT Number of open file table entries for this inode. .IP DEV Major and minor device number of file system in which this inode resides. .IP INO I-number within the device. .IP MODE Mode bits, see .IR chmod (2). .IP NLK Number of links to this inode. .IP UID User ID of owner. .IP SIZ/DEV Number of bytes in an ordinary file, or major and minor device of special file. .PD .TP .B \-x Print the text table with these headings: .IP LOC The core location of this table entry. .PD 0 .IP FLAGS Miscellaneous state variables encoded thus: .RS .IP T .IR ptrace (2) in effect .IP W text not yet written on swap device .IP L loading in progress .IP K locked .IP w wanted (L flag is on) .IP P resulted from demand-page-from-inode exec format (see .IR exec (2)) .RE .PD .IP DADDR Disk address in swap, measured in multiples of 512 bytes. .IP CADDR Head of a linked list of loaded processes using this text segment. .IP SIZE Size of text segment, measured in multiples of 512 bytes. .IP IPTR Core location of corresponding inode. .IP CNT Number of processes using this text segment. .IP CCNT Number of processes in core using this text segment. .PD .TP .B \-p Print process table for active processes with these headings: .IP LOC The core location of this table entry. .PD 0 .IP S Run state encoded thus: .RS .IP 0 no process .IP 1 waiting for some event .IP 3 runnable .IP 4 being created .IP 5 being terminated .IP 6 stopped under trace .RE .IP F Miscellaneous state variables, or-ed together (hexadecimal): .RS .IP 000001 9n loaded .IP 000002 the scheduler process .IP 000004 locked for swap out .IP 000008 swapped out .IP 000010 traced .IP 000020 used in tracing .IP 000040 locked in by .IR lock (2). .IP 000080 in page-wait .IP 000100 prevented from swapping during .IR fork (2) .IP 000200 gathering pages for raw i/o .IP 000400 exiting .IP 001000 process resulted from a .IR vfork (2) which is not yet complete .IP 002000 another flag for .IR vfork (2) .IP 004000 process has no virtual memory, as it is a parent in the context of .IR vfork (2) .IP 008000 process is demand paging data pages from its text inode. .IP 010000 process has advised of anomalous behavior with .IR vadvise (2). .IP 020000 process has advised of sequential behavior with .IR vadvise (2). .IP 040000 process is in a sleep which will timeout. .IP 080000 a parent of this process has exited and this process is now considered detached. .IP 100000 process used some new signal primitives, i.e. .IR sigset (3); more system calls will restart. .IP 200000 process is owed a profiling tick. .RE .IP POIP number of pages currently being pushed out from this process. .IP PRI Scheduling priority, see .IR nice (2). .IP SIGNAL Signals received (signals 1-32 coded in bits 0-31), .IP UID Real user ID. .IP SLP Amount of time process has been blocked. .IP TIM Time resident in seconds; times over 127 coded as 127. .IP CPU Weighted integral of CPU time, for scheduler. .IP NI Nice level, see .IR nice (2). .IP PGRP Process number of root of process group (the opener of the controlling terminal). .IP PID The process ID number. .IP PPID The process ID of parent process. .IP ADDR If in core, the page frame number of the first page of the `u-area' of the process. If swapped out, the position in the swap area measured in multiples of 512 bytes. .IP RSS Resident set size \- the number of physical page frames allocated to this process. .IP SRSS RSS at last swap (0 if never swapped). .IP SIZE Virtual size of process image (data+stack) in multiples of 512 bytes. .IP WCHAN Wait channel number of a waiting process. .IP LINK Link pointer in list of runnable processes. .IP TEXTP If text is pure, pointer to location of text table entry. .IP CLKT Countdown for .IR alarm (2) measured in seconds. .PD .TP .B \-t Print table for terminals with these headings: .IP RAW Number of characters in raw input queue. .PD 0 .IP CAN Number of characters in canonicalized input queue. .IP OUT Number of characters in putput queue. .IP MODE See .IR tty (4). .IP ADDR Physical device address. .IP DEL Number of delimiters (newlines) in canonicalized input queue. .IP COL Calculated column position of terminal. .IP STATE Miscellaneous state variables encoded thus: .RS .IP W waiting for open to complete .IP O open .IP S has special (output) start routine .IP C carrier is on .IP B busy doing output .IP A process is awaiting output .IP X open for exclusive use .IP H hangup on close .RE .IP PGRP Process group for which this is controlling terminal. .IP DISC Line discipline; blank is old tty OTTYDISC or ``new tty'' for NTTYDISC or ``net'' for NETLDISC (see .IR bk (4)). .PD .TP .B \-u print information about a user process; the next argument is its address as given by .IR ps (1). The process must be in main memory, or the file used can be a core image and the address 0. .TP .B \-f Print the open file table with these headings: .IP LOC The core location of this table entry. .PD 0 .IP FLG Miscellaneous state variables encoded thus: .RS .IP R open for reading .IP W open for writing .IP P pipe .RE .IP CNT Number of processes that know this open file. .IP INO The location of the inode table entry for this file. .IP OFFS The file offset, see .IR lseek (2). .PD .PP .B \-s print information about swap space usage: the number of (1k byte) pages used and free is given as well as the number of used pages which belong to text images. .PP .B \-T prints the number of used and free slots in the several system tables and is useful for checking to see how full system tables have become if the system is under heavy load. .B \-m and .B \-g flags print the multiplexor tables. These tables are rather difficult to explain. The potential explorer should examine the multiplexor code in the system. .SH FILES .ta \w'/dev/kmem 'u /vmunix namelist .br /dev/kmem default source of tables .SH SEE ALSO ps(1), stat(2), filsys(5) .br K. Thompson, .I UNIX Implementation .SH BUGS It would be very useful if the system recorded \*(lqmaximum occupancy\*(rq on the tables reported by .B \-T; even more useful if these tables were dynamically allocated. d .B \-g flags print the multiplexor tables. These tables are rather difficult to explain. The potential explorer should examine the multiplexor code in the system. .SH FILES .ta \w'/dev/kmem 'u /vmunix namelist .brman/man8/quot.8 644 0 33 1552 2512730672 6541 .TH QUOT 8 .UC 4 .SH NAME quot \- summarize file system ownership .SH SYNOPSIS .B /etc/quot [ option ] ... [ filesystem ] .SH DESCRIPTION .I Quot prints the number of blocks in the named .I filesystem currently owned by each user. If no .I filesystem is named, a default name is assumed. The following options are available: .TP .B \-n Cause the pipeline .B "ncheck filesystem | sort +0n | quot \-n filesystem to produce a list of all files and their owners. .TP .B \-c Print three columns giving file size in blocks, number of files of that size, and cumulative total of blocks in that size or smaller file. .TP .B \-f Print count of number of files as well as space owned by each user. .SH FILES Default file system varies with system. .br /etc/passwd to get user names .SH "SEE ALSO" ls(1), du(1) .SH BUGS Holes in files are counted as if they actually occupied space. check filesystem | sort +0n | quot \-n filesystem to produce a list of all files and their owners. .TP .B \-c Print three columns giving file size in man/man8/rc.8 644 0 33 1533 2574142404 6152 .TH RC 8 .UC 4 .SH NAME rc \- command script for auto-reboot and daemons .SH SYNOPSIS .B /etc/rc .SH DESCRIPTION .I Rc is the command script which controls the automatic reboot .PP When an automatic reboot is in progress, .I rc is invoked with the argument .I autoboot and runs a .I fsck with option .B \-p to ``preen'' all the disks of minor inconsistencies resulting from the last system shutdown and to check for serious inconsistencies caused by hardware or software failure. If this auto-check and repair succeeds, then the second part of .I rc is run. .PP The second part of .I rc, which is run after a auto-reboot succeeds and also if .I rc is invoked when a single user shell terminates (see .IR init (8)), starts all the daemons on the system, preserves editor files and clears the scratch directory .B /tmp. .SH SEE ALSO init(8), reboot(8) .SH BUGS nsistencies resulting from the last system shutdown and to check for serious inconsistencies caused by hardware or software failure. If this auto-check and repair suman/man8/reboot.8 644 0 33 11400 2527170650 7054 ((.TH REBOOT 8 5/10/81 .UC 4 .SH NAME reboot \- UNIX bootstrapping procedures .SH SYNOPSIS .B /etc/reboot [ .B \-n ] [ .B \-q ] .SH DESCRIPTION .PP UNIX is started by placing it in memory at location zero and transferring to zero. Since the system is not reenterable, it is necessary to read it in from disk or tape each time it is to be bootstrapped. .PP .B Rebooting a running system. When a UNIX is running and a reboot is desired, .IR shutdown (8) is normally used. If there are no users then .B /etc/reboot can be used. Reboot causes the disks to be synced, and then a multi-user reboot (as described below) is initiated. This causes a system to be booted and an automatic disk check to be performed. If all this succeeds without incident, the system is then brought up for many users. .PP Options to reboot are: .TP .B \-n option avoids the sync. It can be used if a disk or the processor is on fire. (It is no longer necessary to reboot after rebuilding the root file system.) .TP .B \-q reboots quickly and ungracefully, without shutting down running processes first. .PP .B "Power fail and crash recovery." Normally, the system will reboot itself at power-up or after crashes. Provided the auto-restart is enabled on the machine front panel, an automatic consistency check of the file systems will be performed then and unless this fails the system will resume multi-user operations. .PP .B Cold starts. These are processor type dependent. On an 11/780, there are two floppy files for each disk controller, both of which cause boots from unit 0 of the root file system of a controller located on mba0 or uba0. One gives a single user shell, while the other invokes the multi-user automatic reboot. Thus these files are HPS and HPM for the single and multi-user boot from MASSBUS RP06/RM03/RM05 disks, UPS and UPM for UNIBUS storage module controller and disks such as the EMULEX SC-21 and AMPEX 9300 pair, or HKS and HKM for RK07 disks. .PP Giving the command .IP >>>BOOT HPM .LP Would boot the system from (e.g.) an RP06 and run the automatic consistency check as described in .IR fsck (8). (Note that it may be necessary to type control-P to gain the attention of the LSI-11 before getting the >>> prompt.) The command .IP >>>BOOT ANY .LP invokes a version of the boot program in a way which allows you to specify any system as the system to be booted. It reads from the console a device specification (see below) followed immediately by a pathname. .PP On an 11/750, the reset button will boot from the device selected by the front panel boot device switch. In systems with RK07's, position B normally selects the RK07 for boot. This will boot multi-user. To boot from RK07 with boot flags you may specify .IP >>>B/\fIn\fR DMA0 .LP where, giving a \fIn\fR of 1 causes the boot program to ask for the name of the system to be bootstrapped, giving a \fIn\fR of 2 causes the boot program to come up single user, and a \fIn\fR of 3 causes both of these actions to occur. .PP The 11/750 boot procedure uses the boot roms to load block 0 off of the specified device. The /usr/mdec directory contains a number of bootstrap programs for the various disks which should be placed in a new pack via .IP cp /usr/mdec/\fIxx\fRboot /dev/\fIxx\fR?a .PP whenever a new bootable pack is to be created. .PP On both processors, the .I boot program finds the corresponding file on the given device, loads that file into memory location zero, and starts the program at the entry address specified in the program header (after clearing off the high bit of the specified entry address.) Normal line editing characters can be used in specifying the pathname. .PP If you have an rp06, rm05 or rm03 disk and wish to boot off of a file system which starts at cylinder 0 of unit 0, you can type \*(lqhp(0,0)vmunix\*(rq to the boot prompt; \*(lqup(0,0)vmunix\*(rq would specify a UNIBUS ampex 9300 drive, ``rk(0,0)vmunix'' would specify a RK-07 disk drive. .PP A device specification has the following form: .IP device(unit, minor) .PP where .I device is the type of the device to be searched, .I unit is 8* the mba or uba number plus the unit number of the device, and .I minor is the minor device index. The following list of supported devices may vary from installation to installation: .ta 5 10 .nf hp RP06, RM03, RM05, RP07 or RM80 on MASSBUS up storage module drive on UNIBUS ht TE16,TU45,TU77 on MASSBUS hk RK07 on UNIBUS tm TM11 emulation tape drives on UNIBUS ts TS11 on UNIBUS .fi .PP For tapes, the minor device number gives a file offset. .PP In an emergency, the bootstrap methods described in the paper ``Setting up the Fourth Berkeley Software Tape'' can be used to boot from a distribution tape. .SH FILES .ta \w'/usr/mdec/mboot 'u /vmunix system code .br /boot system bootstrap .SH "SEE ALSO" crash(8), fsck(8), init(8), rc(8), shutdown(8), halt(8) odule drive on UNIBUS ht TE16,TU45,TU77 on MASSBUS hk RK07 on UNIBUS tm TM11 emulation tape drives on UNIBUS ts TS11 on UNIBUS .fi .PP For tapes, the minor device number gives a file offset. .PP In an emergency, the bootstrap methods described in the pman/man8/renice.8 644 0 33 1440 2512730674 7014 .TH RENICE 8 .UC 4 .SH NAME renice \- alter priority of running process by changing nice .SH SYNOPSIS .B /etc/renice pid [ priority ] .SH DESCRIPTION .I Renice can be used by the super-user to alter the priority of a running process. By default, the nice of the process is made \*(lq19\*(rq which means that it will run only when nothing else in the system wants to. This can be used to nail long running processes which are interfering with interactive work. .PP .I Renice can be given a second argument to choose a nice other than the default. Negative nices can be used to make things go very fast. .SH FILES /vmunix .br /dev/kmem .SH SEE ALSO nice(1) .SH BUGS If you make the nice very negative, then the process cannot be interrupted. To regain control you must put the nice back (e.g. to 0.) (rq which means that it will run only when nothing else in the system wants to. This can be used to nail long running processes which are interfering with interactive work. .PP .I Renice can be given a second argument to chman/man8/restor.8 644 0 33 5746 2512730674 7102 .TH RESTOR 8 .UC 4 .SH NAME restor \- incremental file system restore .SH SYNOPSIS .B /etc/restor key [ argument ... ] .SH DESCRIPTION .I Restor is used to read magtapes dumped with the .I dump command. The .I key specifies what is to be done. .I Key is one of the characters .B rRxt optionally combined with .BR f . .TP .B f Use the first .I argument as the name of the tape instead of the default. .TP .B r or R The tape is read and loaded into the file system specified in .I argument. This should not be done lightly (see below). If the key is .B R .I restor asks which tape of a multi volume set to start on. This allows restor to be interrupted and then restarted (an .I icheck \-s must be done before restart). .TP .B x Each file on the tape named by an .I argument is extracted. The file extracted is placed in a file with a numeric name supplied by .I restor (actually the inode number). In order to keep the amount of tape read to a minimum, the following procedure is recommended: .IP Mount volume 1 of the set of dump tapes. .IP Type the .I restor command. .IP .I Restor will announce whether or not it found the files, give the number it will name the file, and rewind the tape. .IP It then asks you to `mount the desired tape volume'. Type the number of the volume you choose. On a multivolume dump the recommended procedure is to mount the last through the first volume in that order. .I Restor checks to see if any of the files requested are on the mounted tape (or a later tape, thus the reverse order) and doesn't read through the tape if no files are. If you are working with a single volume dump or the number of files being restored is large, respond to the query with `1' and .I restor will read the tapes in sequential order. .IP If you have a hierarchy to restore you can use .IR dumpdir (8) to produce the list of names and a shell script to move the resulting files to their homes. .TP .B t Print the date the tape was written and the date the filesystem was dumped from. .PP The .B r option should only be used to restore a complete dump tape onto a clear file system or to restore an incremental dump tape onto this. Thus .PP /etc/mkfs /dev/rrp0g 145673 .br restor r /dev/rrp0g .PP is a typical sequence to restore a complete dump. Another .I restor can be done to get an incremental dump in on top of this. .PP A .I dump followed by a .I mkfs and a .I restor is used to change the size of a file system. .SH FILES default tape unit varies with installation .br rst* .SH "SEE ALSO" dump(8), mkfs(8), dumpdir(8) .SH DIAGNOSTICS There are various diagnostics involved with reading the tape and writing the disk. There are also diagnostics if the i-list or the free list of the file system is not large enough to hold the dump. .PP If the dump extends over more than one tape, it may ask you to change tapes. Reply with a new-line when the next tape has been mounted. .SH BUGS There is redundant information on the tape that could be used in case of tape reading problems. Unfortunately, .I restor doesn't use it. dumpdir(8) .SH DIAGNOSTIC((man/man8/sa.8 644 0 33 6173 2512730675 6163 .TH SA 8 4/20/80 .UC 4 .SH NAME sa, accton \- system accounting .SH SYNOPSIS .B /etc/sa [ .B \-abcdDfijkKlnrstuv ] [ file ] .PP .B /etc/accton [ file ] .SH DESCRIPTION With an argument naming an existing .I file, .I accton causes system accounting information for every process executed to be placed at the end of the file. If no argument is given, accounting is turned off. .PP .I Sa reports on, cleans up, and generally maintains accounting files. .PP .I Sa is able to condense the information in .I /usr/adm/acct into a summary file .I /usr/adm/savacct which contains a count of the number of times each command was called and the time resources consumed. This condensation is desirable because on a large system .I /usr/adm/acct can grow by 100 blocks per day. The summary file is normally read before the accounting file, so the reports include all available information. .PP If a file name is given as the last argument, that file will be treated as the accounting file; .I /usr/adm/acct is the default. .PP Output fields are labelled: \*(lqcpu\*(rq for the sum of user+system time (in minutes), \*(lqre\*(rq for real time (also in minutes), \*(lqk\*(rq for cpu-time averaged core usage (in 1k units), \*(lqavio\*(rq for average number of i/o operations per execution. With options fields labelled \*(lqtio\*(rq for total i/o operations, \*(lqk*sec\*(rq for cpu storage integral (kilo-core seconds), \*(lqu\*(rq and \*(lqs\*(rq for user and system cpu time alone (both in minutes) will sometimes appear. .PP There are near a googol of options: .PP .TP a Place all command names containing unprintable characters and those used only once under the name `***other.' .TP b Sort output by sum of user and system time divided by number of calls. Default sort is by sum of user and system times. .TP c Besides total user, system, and real time for each command print percentage of total time over all commands. .TP d Sort by average number of disk i/o operations. .TP D Print and sort by total number of disk i/o operations. .TP f Force no interactive threshold compression with \-v flag. .TP i Don't read in summary file. .TP j Instead of total minutes time for each category, give seconds per call. .TP k Sort by cpu-time average memory usage. .TP K Print and sort by cpu-storage integral. .TP l Separate system and user time; normally they are combined. .TP m Print number of processes and number of CPU minutes for each user. .TP n Sort by number of calls. .TP r Reverse order of sort. .TP s Merge accounting file into summary file .I /usr/adm/savacct when done. .TP t For each command report ratio of real time to the sum of user and system times. .TP u Superseding all other flags, print for each command in the accounting file the user ID and command name. .TP v Followed by a number .I n, types the name of each command used .I n times or fewer. Await a reply from the terminal; if it begins with `y', add the command to the category `**junk**.' This is used to strip out garbage. .dt .SH FILES .ta 2i /usr/adm/acct raw accounting .br /usr/adm/savacct summary .br /usr/adm/usracct per-user summary .SH "SEE ALSO" ac(8), acct(2) .SH BUGS The number of options to this program is absurd. lags, print for each command in the accounting file the user ID and command name. .TP v Followed by a number .I n, types the name of each command used .I n times or fewer. Await a reply from the terminal; if it begins with `y', add the command to the category `**junk**.' This is used to strip out garbage. .dt .SH FILES .ta 2i /usr/adm/acct raw accounting .br /usr/adm/savacct summary .brman/man8/savecore.8 664 0 33 2432 2531446355 7363 .TH SAVECORE 8 4/28/81 .UC 4 .SH NAME savecore \- save a core dump of the operating system .SH SYNOPSIS .B savecore .I dirname .SH DESCRIPTION .PP .I Savecore is meant to be called at the end of the /etc/rc file. Its function is to save the core dump of the system (assuming one was made) and to write a reboot message in the shutdown log. .PP Savecore checks the core dump to be certain it corresponds with the current running unix. If it does it saves the core image in the file .IR dirname /vmcore.n and it's brother, the namelist, .IR dirname /vmunix.n The trailing ".n" in the pathnames is replaced by a number which grows every time .I savecore is run in that directory. .PP Before savecore writes out a core image, it reads a number from the file .IR dirname /minfree. If there are fewer free blocks on the filesystem which contains .I dirname than the number obtained from the minfree file, the core dump is not done. If the minfree file does not exist, savecore always writes out the core file (assuming that a core dump was taken). .PP .I Savecore also writes a reboot message in the shut down log. If the system crashed as a result of a panic, .I savecore records the panic string in the shut down log too. .SH FILES .DT /usr/adm/shutdownlog Shut down log .br /vmunix Current UNIX .SH BUGS er free blocks on the filesystem which contains .I dirname than the number obtained from the minfree file, the core dump is not done. If the minfree file does not exist, savecore always writes out the core file (assuming that a coman/man8/shutdown.8 644 0 33 4204 2527170652 7423 .TH SHUTDOWN 8 4/1/81 .UC 4 .SH NAME shutdown \- close down the system at a given time .SH SYNOPSIS .B /etc/shutdown [ .B \-k ] [ .B \-r ] [ .B \-h ] time [ warning-message ... ] .SH DESCRIPTION .I Shutdown provides an automated shutdown procedure which a super-user can use to notify users nicely when the system is shutting down, saving them from system administrators, hackers, and gurus, who would otherwise not bother with niceties. .LP .I Time is the time at which .I shutdown will bring the system down and may take two formats: .BR + number and .RB hour : min. The first form brings the system down in .I number minutes and the second brings the system down at the time of day indicated (as a 24\-hour clock). .PP At intervals which get closer together as apocalypse approaches, warning messages are displayed at the terminals of all users on the system. Five minutes before shutdown, or immediately if shutdown is in less than 5 minutes, logins are disabled by creating /etc/nologin and writing a message there. If this file exists when a user logs in, .IR login (1) prints its contents and exits. The file is removed just before .I shutdown exits. .PP At shutdown time a message is written in the file /usr/adm/shutdownlog, containing the time of shutdown, who ran shutdown and the reason. Then a terminate signal is sent at .I init to bring the system down to single-user state. Alternatively, if .B -r, .B -h, or .B -k was used, then .I shutdown will exec .IR reboot (8), .IR halt (8), or avoid shutting the system down (respectively). (If it isn't obvious, .B \-k is to make people .I think the system is going down!) .PP The time of the shutdown and the warning message are placed in /etc/nologin and should be used to inform the users about when the system will be back up and why it is going down (or anything else). .SH FILES .DT /etc/nologin tells login not to let anyone log in .br /usr/adm/shutdownlog log file for succesful shutdowns. .SH "SEE ALSO" login(1), reboot(8) .SH BUGS Only allows you to kill the system between now and 23:59 if you use the absolute time for shutdown. .PP Times to shutdown are not nice and round, i.e. ``shutdown in 18 seconds''. warning message are placed in /etc/nologin and should be used to inform the users about when the system will be back up and why it is going down (or anything else). .SH FILES .DT /etc/nologin tells login not to let anyone log in .br /usr/adm/shutdownlog log file for succesful shutdowns. .SH "SEE ALSO" login(1), reboot(8) .SH BUGS Only allows you to kill the system between now man/man8/sticky.8 644 0 33 2532 2512730676 7062 .TH STICKY 8 .UC 4 .SH NAME sticky \- executable files with persistent text .SH DESCRIPTION While the `sticky bit', mode 01000 (see .IR chmod (2)), is set on a sharable executable file, the text of that file will not be removed from the system swap area. Thus the file does not have to be fetched from the file system upon each execution. As long as a copy remains in the swap area, the original text cannot be overwritten in the file system, nor can the file be deleted. (Directory entries can be removed so lon((g as one link remains.) .PP Sharable files are made by the .B \-n and .B \-z options of .IR ld (1). .PP To replace a sticky file that has been used do: (1) Clear the sticky bit with .IR chmod (1). (2) Execute the old program to flush the swapped copy. This can be done safely even if others are using it. (3) Overwrite the sticky file. If the file is being executed by any process, writing will be prevented; it suffices to simply remove the file and then rewrite it, being careful to reset the owner and mode with .I chmod and .IR chown (2). (4) Set the sticky bit again. .PP Only the super-user can set the sticky bit. .SH BUGS Are self-evident. .PP Is largely unnecessary on the VAX; matters only for large programs that will page heavily to start, since text pages are normally cached incore as long as possible after all instances of a text image exit. e is being executed by any process, writing will be prevented; it suffices to simply remove the file and then rewrite it, being careful to reset the owner and mode wiman/man8/swapon.8 644 0 33 2177 2512730676 7070 .TH SWAPON 8 .UC 4 .SH NAME swapon \- specify additional device for paging and swapping .SH SYNOPSIS .B "/etc/swapon" .B \-a .br .B "/etc/swapon" name ... .SH DESCRIPTION .I Swapon is used to specify additional devices on which paging and swapping are to take place. The system begins by swapping and paging on only a single device so that only one disk is required at bootstrap time. Calls to .I swapon normally occur in the system multi-user initialization file .I /etc/rc making all swap devices available, so that the paging and swapping activity is interleaved across several devices. .PP Normally, the .B \-a argument is given, causing all devices marked as ``sw'' swap devices in .B /etc/fstab to be made available. .PP The second form gives individual block devices as given in the system swap configuration table. The call makes only this space available to the system for swap allocation. .SH SEE ALSO swapon(2), init(8) .SH FILES .DT /dev/[ru][pk]?b normal paging devices .SH BUGS There is no way to stop paging and swapping on a device. It is therefore not possible to make use of devices which may be dismounted during system operation. ng all devices marked as ``sw'' swap devices in .B /etc/fstab to be made available. .PP The second form gives individual block devices as given in the system swap configuration table. The call makes only this space available to the system for swap allocation. .SH SEE ALSO swapon(2), init(8) .SH FILES .DT /dev/[ru][pk]?b normal paging devices .SH BUGS There is no way to stop paging man/man8/sync.8 644 0 33 637 2512730676 6514 .TH SYNC 8 .UC 4 .SH NAME sync \- update the super block .SH SYNOPSIS .B sync .SH DESCRIPTION .I Sync executes the .I sync system primitive. .I Sync can be called to insure all disk writes have been completed before the processor is halted in a way not suitably done by .IR reboot (8) or .IR halt (8). .PP See .IR sync (2) for details on the system primitive. .SH "SEE ALSO" sync(2), halt(8), reboot(8), update(8) t(8) /( ,( 5Ċ /\@,\D"man/man8/update.8 644 0 33 1451 2512730676 7035 .TH UPDATE 8 .SH NAME update \- periodically update the super block .SH SYNOPSIS .B /etc/update .SH DESCRIPTION .I Update is a program that executes the .IR sync (2) primitive every 30 seconds. This insures that the file system is fairly up to date in case of a crash. This command should not be executed directly, but should be executed out of the initialization shell command file. .SH "SEE ALSO" sync(2), sync(1), init(8) .SH BUGS With .I update running, if the CPU is halted just as the .I sync is executed, a file system can be damaged. This is partially due to DEC hardware that writes zeros when NPR requests fail. A fix would be to have .IR sync (1) temporarily increment the system time by at least 30 seconds to trigger the execution of .I update. This would give 30 seconds grace to halt the CPU. executed directly, but should be executed out of the initialization shell command file. .SH "SEE ALSO" sync(2), sync(1), init(8) .SH BUGS With .I update running, if the CPU is halted just as the .I sync is executed,man/man8/vipw.8 644 0 33 1140 2512730676 6533 .TH VIPW 8 .UC 4 .SH NAME vipw \- edit the password file with vi .SH SYNOPSIS .B vipw .SH DESCRIPTION .I Vipw edits the password file while setting the appropriate locks, and does any necessary processing after the password file is unlocked. If the password file is already being edited, then you will be told to try again later .SH SEE ALSO chfn(1), chsh(1), passwd(1), passwd(5), adduser(8) .SH FILES /etc/vipw.lock .SH BUGS .I Vipw does not remove the vipw.lock file; this is not a bug, but people tend to think it is. .PP No one deals with left-over /etc/ptmp (the real lock) files after a system crash. PTION .I Vipw edits the password file while setting the appropriate locks, and does any necessary processing after the password file is unlocked. If the password file is already being edited, then you will be told to try again later .SH SEE ALSO chfn(1), chsh(1), passwd(1), passwd(5), adduser(8) .SH FILES /etc/vipw.lock .SH BUGS .I Vipw does not remove the vipw.lock file; this is not a bug, but people tend to thiman/man8/vpac.8 644 0 33 2515 2512730677 6507 .TH VPAC 8 2/21/80 .UC 4 .SH NAME vpac \- print raster printer/ploter accounting information .SH SYNOPSIS .B /etc/vpac [ .B \-W ] [ .B \-s ] [ .B \-r ] [ .B \-t ] [ name ... ] .SH DESCRIPTION .I Vpac reads the raster printer/plotter accounting files, accumulating the number of pages (for narrow fan-fold devices) or feet (for wide, roll paper devices) of paper consumed by each user, and printing out how much each user consumed in pages or feet and dollars (billed at 2 cents / page or 8 cents / foot). If any .I names are specified, then statistics are only printed for those users; usually, statistics are printed for every user who has used any paper. .PP The .B \-W flag causes accounting to be done for a wide roll paper device. The default is to do accounting for a narrow, fan-fold device. The .B \-t flag causes the output to be sorted by feet of paper; usually the output is sorted alphabetically by name. The .B \-r flag reverses the sorting order. The .B \-s flag causes the accounting information to be summarized on the summary accounting file; this summarization is necessary since on a busy system, the accounting file can grow by several lines per day. .SH FILES .ta 2i /usr/adm/v?acct raw accounting files .br /usr/adm/v?_sum summary accounting files .SH BUGS The relationship between the computed price and reality is as yet unknown. ed by feet of paper; usually the output is sorted alphabetically by name. The .B \-r flag reverses the sorting order. The .B \-s flag causes the accounting information to be summman/man8/badsect.8 664 0 33 5045 2527170652 7163 .TH BADSECT 8 4/10/81 .UC 4 .SH NAME badsect \- create files to contain bad sectors .SH SYNOPSIS .B /etc/badsect sector ... .SH DESCRIPTION .I Badsect makes a file to contain a bad sector. Normally, bad sectors are made inaccessible by the standard formatter, which provides a forwarding table for bad sectors to the driver; see .IR bad144 (8) for details. If a driver supports the bad blocking standard it is much preferable to use that method to isolate bad blocks, since the bad block forwarding makes the pa((ck appear perfect, and such packs can then be copied with .IR dd (8). The technique used by this program is also less general than bad block forwarding, as .I badsect can't make amends for bad blocks in the i-list of file systems or in swap areas. .PP Adding a sector which is suddenly bad to the bad sector table currently requires the running of the standard DEC formatter, as UNIX does not supply formatters. Thus to deal with a newly bad block or on disks where the drivers do not support the bad-blocking standard .I badsect may be used to good effect. .PP .I Badsect is used on a quiet file system in the following way: First mount the file system, and change to its root directory. Make a directory BAD there and change into it. Run badsect giving as argument all the bad sectors you wish to add. (The sector numbers should be relative to the beginning of the file system, but this is not hard to do as the system reports relative sector numbers in its console error messages.) Then change back to the root directory, unmount the file system and run .IR fsck (8) on the file system. The bad sectors should show up in two files or in the bad sector files and the free list. Have .I fsck remove files containing the offending bad sectors, but .B "do not" have it remove the BAD/\fInnnnn\fR files. This will leave the bad sectors in only the BAD files. .PP .I Badsect works by giving the specified sector numbers in a .IR mknod (2) system call, creating a regular file whose first block address is the block containing bad sector and whose name is the bad sector number. The file has 0 length, but the check programs will still consider it to contain the block containing the sector. This has the pleasant effect that the sector is completely inaccessible to the containing file system since it is not available by accessing the file. .PP .SH SEE ALSO bad144(8), fsck (8) .SH BUGS If both sectors which comprise a (1024 byte) disk block are bad, you should specify only one of them to .I badsect, as the blocks in the bad sector files actually cover both (bad) disk sectors. number. The file has 0 length, but the check programs will still consider it to contain the block containing the sector. This has the pleasant effect that the sector is completely inaccessible to the containing file system since it is not available by accessing the file. .PP .SH SEE ALSO bad144(8), fsck (8) .SH BUGS If both sectors which comprise a (1024 byte) disk block are bad, you should specify only one of them to .I badsect, as the blocks in the bad sector files actman/man8/bad144.8 664 0 33 6236 2527170651 6537 .TH BAD144 8 .UC 4 .SH NAME bad144 \- read/write dec standard 144 bad sector information .SH SYNOPSIS .B bad144 disktype disk [ sno [ bad ... ] ] .SH DESCRIPTION .I Bad144 can be used to inspect the information stored on a disk that is used by the disk drivers to implement bad sector forwarding. The format of the information is specified by DEC standard 144, as follows. .PP The bad sector information is located in the first 5 even numbered sectors of the last track of the disk pack. There are five identical copies of the information, described by the dkbad structure. .PP Replacement sectors are allocated starting with the first sector before the bad sector information and working backwards towards the beginning of the disk. A maximum of 126 bad sectors are supported. The position of the bad sector in the bad sector table determines which replacement sector it corresponds to. .PP The bad sector information and replacement sectors are conventionally only accessable through the ``c'' file system partition of the disk. If that partition is used for a file system, the user is responsible for making sure that it does not overlap the bad sector information or any replacement sectors. .PP The bad sector structure is as follows: .PP .ta .75i 1.5i 3.5i .nf struct dkbad { long bt_csn; /* cartridge serial number */ u_short bt_mbz; /* unused; should be 0 */ u_short bt_flag; /* -1 => alignment cartridge */ struct bt_bad { u_short bt_cyl; /* cylinder number of bad sector */ u_short bt_trksec; /* track and sector number */ } bt_bad[126]; }; .fi .PP Unused slots in the bt_bad array are filled with all bits set, a putatively illegal value. .PP .I Bad144 is invoked by giving a device type (e.g. rk07, rm03, rm05, etc.), and a device name (e.g. hk0, hp1, etc.). It reads the first sector of the last track of the corresponding disk and prints out the bad sector information. It may also be invoked giving a serial number for the pack and a list of bad sectors, and will then write the supplied information onto the same location. Note, however, that .I bad144 does not arrange for the specified sectors to be marked bad in this case. This option should only be used to restore known bad sector information which was destroyed. .PP New bad sectors can be added by running the standard DEC formatter in section ``bad''. .SH SEE ALSO badsect (8), format (8) .SH BUGS It should be possible to both format disks on-line under UNIX and to change the bad sector information, marking new bad sectors, without running a standalone program. .PP The bootstrap drivers used to boot the system do not understand bad sectors, handle ECC errors, or the special SSE (skip sector) errors of RM80 type disks. This means that none of these errors can occur when reading the file /vmunix to boot. When a disk drive is used to load the bootstrap code (the alternative would be that the bootstrap would be loaded from the console media), sector 0 of the disk drive and the file /boot in the root file system of that drive must also not have any of these errors in it. .PP The drivers which write a system core image on disk after a crash do not handle errors; thus the crash dump area must be free of errors and bad sectors. his means that none of these errors can occur when reading the file /vmunix to boot. When a disk drive is used to load the bootstrap code (the alternative would be that the bootstrap would be loaded from the console media), sector 0 of the disk drive and the file /boot in the root file system of that drive must also not have any of these errors in it.man/break 644 0 33 6 2512730707 5534  ; : n8/bad144.8d.8|PݭݭVխѭ¬ Э!Pݬ4< < a9Ь02512730710< Ga9ЬQ00000004520Ё^PPXݬݬ;20$PPuPpToo many arguments. -Try again. /usr/ucb/opxPx not found @(#)px_hT//pT,pT5pĊ /,"man/tocrc 755 0 33 2416 2512730710 5646 tmp=/tmp/toc$$ troff=vtroff trap "rm $tmp ; exit" 2 3 15 if [ $# -eq 2 ] then : create toc input file for one section only ( cd man$1 ; /usr/lib/getNAME -t *.* | sed \ -e 's/.s-1//g' \ -e 's/.s0//g' \ -e 's/.s+1//g' \ -e 's/ *.- */: /' \ -e 's/$/./' \ -e 's/.TH.* //' \ > ../man0/tocx$1 ) else case $1 in all ) : tocx files for all sections and everything else for x in 1 2 3 4 5 6 7 8 do ./$0 $x $x done ./$0 t ;; t ) : permuted index and toc files if [ ! -f man0/tocx1 ] then echo "tocx? files missing; must run tocrc all first" exit fi sed \ -e 's/(1c)/(1C)/' \ -e 's/(1m)/(1M)/' \ -e 's/(1g)/(1G)/' \ -e 's/(3c)/(3C)/' \ -e 's/(3m)/(3M)/' \ -e 's/(3s)/(3S)/' \ -e '/"\."/d' \ man0/tocx? man0/cshcmd \ > /tmp/cattoc ptx -r -t -b break -f -w 108 -i man0/ignore \ /tmp/cattoc man0/ptxx for x in 1 2 3 4 5 6 7 8 do < man0/tocx$x grep '^intro' >$tmp sed \ -e '2,${' \ -e '/^intro/d' \ -e '}' \ -e 's/ .*://' \ -e 's/.$//' \ -e 's/([^)]*) /" "/' \ -e 's/.*/.xx "&"/' \ -e '/""/d' \ $tmp man0/tocx$x \ >man0/toc$x done ;; tr ) cd man0; $troff ptx.in ; cd .. cd man0 ; $troff toc.in ; cd .. ;; * ) ./$0 $1 $1 ;; esac fi exit ? man0/cshcmd \ > /tmp/cattoc ptx -r -t -b break -f -w 108 -i man0/ignore \ /tmp/cattoc man0/ptxx for x in 1 2 3 4 5 6 7 8 do < man0/tocx$x grep '^intro' >$tmp sed \ -e '2,${' \ -e '/^intro/d' \ -e '}' \ mdec/ 775 0 33 0 2662343530 4663 ((mdec/tmboot 644 0 33 1000 2662343526 6171 Џ]]^P(T`m0T=P0TQ0P PTQYݔYЏ0V0]U)Yed/@U1<,<&V%VV1VW 05WPP]\Ue1r PѭVԭlɏ PNȏDk P֭ PP!PPPP  P P"RRPPP#RRkRRRmdec/mboot 644 0 33 1000 2662343525 6004 ď[[Z[Џ]]^P(^`mЏ$ k0T=P0TQ0P PTQYΔYЏ0V0]U)Yed/@U1<,<&V%VV1VW 05WPP]\Ue1cPѭVԭkЫRRЏɏPԪ 9kЫRRЫRR ԫkP֭ PP!PPPP  P P"RRPPP#mdec/uboot 644 0 33 1000 2662343525 6014 U[Џ^V(fn)>PPPxPQRQRScYЏ$PP<QP< QP< QP<Q"P< 2QQDxQQQHşHDLЏVP@0ef+0ЏWg)fPPPxPQRQRbYRQRbZPiЏ@KLPP  PPU[Џ^V(fnPPPD PHЏVP@0ff+0ЏWg)fPPPxPQRQRbYRQRbZPi  PPP  PPPU[Џ^V(fnЏVP@0ff+0ЏWg)f1-,7 HP{-ݬ%PJݬX2 -PPP,-ݬ--x- e-!---B-ݏE\$|)PYY*Yӏ|x|P[[1Q08#ݬK-K0 1%P`+X+*-JP4%-I PP%-S+ -ݬ%--߭߭+Z[߭ݬݏݏݬ*.$ݬPݬ,X/ ݬݬ ݬݬ $^߭ݬ(%P0+ݬ,/  ݬ;0P,ݬPZѬ ݬݬ ݬѬ ݏݬ=,ݬWP[ ݬxZ[KP[!Z!ЭP,^߭ݬR$P@;ݬ+:.  +)$U/P)$+q)PݏX)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ܒX^Ь[    PPYYX1XX߭~}PYj~P wo BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[81xݏ3PZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~@PY PP [ [[[  Ь[Z = 8[ePZ~PZ ݫ ԫ kZP{P[P[P[P/[PZ[ZZ PXYX/P[Y[ZuPX\YPXO[[ݬP1yk  kP[G[ Ь[Zk[ZZP Ь[ЬZkPkPzQQP^ݬPP߭ݬP>9/etc/ttys/dev/ Hrr/Unknown error: # new/ 775 0 33 0 2510247366 4546 news/ 775 0 33 0 2527226406 4731 news/2621 644 0 33 1763 2423021214 5321 How to fix the configuration straps on your HP 2621. (1) get the "default labels" (config ...) on the bottom of the screen. If they aren't already there, hit the labels key (the blank light one on the right) to get them. (2) go into config mode by hitting "config". (To hit a label such as config, you must hold down shift and hit the corresponding key of the 8 at the top of the keyboard. In this case it's shift home, that is shift the key pointing up to the left.) You will get a row of options at the top, and a row of labels starting "exit" at the bottom. (3) Set the straps to bcGHxZ and the handshake to etX. (The capitalization is what counts, not the letter.) Use the left and right arrow keys (unshifted) to move the cursor to a thing to change, and use either next or previous (these are shifted) to toggle the thing to the other state. (4) Leave config mode by hitting exit. (5) If you want rid of the labels, do a tset or hit control shift labels. l get a rnews/ex 644 0 33 134553 2423021217 5412 Version 3.5 -- August 20, 1980 The provisions for changing the window size with a numeric prefix argument to certain visual commands have been deleted. The correct way to change the window size is to use the z command, for example z5 to change the window to 5 lines. The code to handle the -x (encryption) option has been made conditionally compiled, so that ex can run on an an 11/34 (!) with overlays. Since this code calls getpass, stdio was being pulled in even without VMUNIX being defined. ((The savings from not defining CRYPT are about 4K of text and 4.5K of bss. Bill Joy put in a buffering scheme under the VMUNIX flag so that up to 64K of file is edited in-core until you make enough changes to force a temp file sync. This makes entry into the editor much faster, but also makes vi much bigger. The source to ex is now sccs'ed. An undocumented "feature" which caused the ^^ command to return to the previous tag, if in the current file, instead of the previous file, has been removed. A bug which prevented ex from compiling on systems with the new tty driver but no process control (such as Cory) was fixed. Version 3.4 -- June 24, 1980 The visual page motion commands ^F and ^B now treat any preceding counts as number of pages to move, instead of changes to the window size. That is, 2^F moves forward 2 pages. A :vi command from visual mode is now treated the same as a :edit or :ex command. The meaning of the vi command from ex command mode is not affected. Provisions to handle the new process stopping features of the Berkeley TTY driver have been added. A new command, "stop", takes you out of the editor cleanly and efficiently, returning you to the shell. Resuming the editor puts you back in command or visual mode, as appropriate. If autowrite is set and there are outstanding changes, a write is done first unless you say "stop!". From visual mode, the command ^Z is the same as :stop. Note that if you have an arrow key that sends ^Z the stop function will take priority over the arrow function. If you have your "susp" character set to something besides ^Z, that key will be honored as well. A read only mode now lets you guarantee you won't clobber your file by accident. You can set the on/off option "readonly" (ro) and writes will fail unless you use an ! after the write. Commands such as x, ZZ, and autowrite, and in general anything that writes is affected. This option is turned on if you invoke ex with the -R flag. A new link called "view" has been created. View is just like vi but it sets readonly. The encryption code from the v7 editor is now part of ex. You invoke ex with the -x option and it will ask for a key, as ed. The ed "x" command (to enter encryption mode from within the editor) is not available. The editor now adopts the convention that a null string in the environment is the same as not being set. This applies to TERM, TERMCAP, and EXINIT. A word abbreviation mode is now available. You can define abbreviations with the abbreviate command :abbr foo find outer otter which maps "foo" to "find outer otter". Abbreviations can be turned off with the "unabbreviate" command. The syntax of these commands is identical to the map and unmap commands, except that the ! forms do not exist. Abbreviations are considered when in visual input mode only, and only affect whole words typed in, using the conservative definition. (Thus "foobar" will not be mapped as it would using map!) Abbreviate and unabbreviate can be abbreviated to "ab" and "una", respectively. The editor now supports certain terminals that use strings other then \r and \n for return and linefeed by implementing the cr and nl termcap options. (Thanks to UCLA for these enhancements). The termcap attribute ns is now checked for, and ex refuses to go into visual mode on such a terminal unless it has sf. Terminals that can cursor address but cannot go up a line now work in visual. If you change your start and stop characters to something other than the default ^S and ^Q, vi now turns them off. This causes people who change them to escape not to lose so badly. The quit character is once again turned off so that datamedias which send ^\ for the right arrow key work. The ~ command now repeats correctly with ".". If you type in an unmatched ) or } in showmatch mode, the editor will now beep to warn you about your mistake. The ) or } is still accepted. The way macros are undone has been improved considerably. The number of changes inside the macro is counted, and just before the second change the state before the macro is recreated internally and saved to allow the macro to be undoable as a unit. Hence, if the macro makes only one change the particular change is undone (which will probably not redraw the screen). If no changes are made (for example, the arrow keys) the previous thing that could be undone is not clobbered. The undomacro option has been deleted since it is no longer needed. Editor scripts can now contain comments. Begin the comments with " (double quote). Comments can be on their own line or come at the end of command lines. The comment continues to the end of the line. The 3rd version of the USG tty driver is now supported, making it possible on USG systems to interrupt redrawing the screen and to not flush output when interruptable commands take place. The rewind command has been added to the list of commands that the autowrite option knows about. The wrapmargin option is now usable. The way it works has been completely revamped. Now if you go past the margin (even in the middle of a word) the entire word is erased and rewritten on the next line. This changes the semantics of the number given to wrapmargin. 0 still means off. Any other number is still a distance from the right edge of the screen, but this location is now the right edge of the area where wraps can take place, instead of the left edge. Wrapmargin now behaves much like fill/nojustify mode in nroff. A bug on the USG system where hanging up the phone causes more than one SIGHUP to be sent has been compensated for. A bug which caused the :sh command not to send the vs and ti sequences when you returned has been fixed. A bug which caused a file that bombed out in the middle of an edit command to be considered modified has been fixed. A bug which caused the screen to be wrong after undoing a :move command has been fixed. A bug which messed up the buffer and the screen after undoing a :join command has been fixed. The source file ex_io.c has been split into ex_io.c and ex_unix.c to avoid a problem where many C compilers overflowed the symbol table. A bug which prevented turning off your prompt in your .exrc has been fixed. Some of the code internal to the editor has been rearranged and some comments added. The bug fix to the USG tty driver to output a null character as padding at 1200 baud has been improved to output a DEL at 1200 baud or above. Terminals with small screens (less than 20 columns or less than 5 lines) should now work. A bug which prevented you from entering the character DEL into the buffer if you changed your interrupt character to something else besides DEL has been fixed. A bug which caused the current line to be clobbered when you did a /, ?, or : command which mapped an input macro successfully has been fixed. If you map o to O and O to o and have remap set, the editor now catches the infinite loop. A put command after a macro now beeps instead of putting a copy of the whole buffer. (Note that the arrow keys on terminals are considered macros.) A bug which caused things like d) and d} to miss the last character when they should have deleted to the end of the buffer has been fixed. A bug which caused the last character to be lost when you read in a file with no newline at the end of the last line has been fixed. A bug that caused garbage to be in the buffer if the temp file overflowed has been fixed. (This only affected non-VMUNIX systems since the temp file cannot overflow on VMUNIX.) When a macro or global is undone, you no longer get picked up and dropped on line 1. The character | can now be escaped with \| in file names. A bug which prevented the confirm option to a substitution that was inside a source command has been fixed. A bug which caused the editor to not work if the tab stop size did not divide the screen width has been fixed. A bug on HP terminals that caused the screen to be messed up if you scrolled up something that began the same way as the echo line has been fixed. A macro bug which sometimes caused the next character after an escape to be ignored on an HP terminal has been fixed. A bug which caused unmap of strings with length 2 to fail has been fixed. A bug which left vi confused if you invoked a macro containing a quit to command mode and then did an undo has been fixed. An old ed bug which caused globals to fail when they did a substitute on the next line has been fixed. The % operator will now find matching square brackets the same way it does parentheses and braces. It will not display them in showmatch mode, however, and will not use a ] to match all ('s. Code has been added to handle the Beehive Superbee terminal, using f1 for escape and f2 for control C. The default value of the option shell is now taken from the environment variable SHELL, if present. Version 3.3 -- February 2, 1980 The default window sizes have been changed. At 300 baud the window is now 8 lines (was 1/2 the screen size). At 1200 baud the window is now 16 lines (was 2/3 the screen size, which was usually also 16 for a typical 24 line CRT). At 9600 baud the window is still the full screen size. Any baud rate less than 1200 behaves like 300, any over 1200 like 9600. A new command mode command "x" (for "xit") has been added. This is the same as wq but will not bother to write if there have been no changes to the file. The command letter was chosen for convenience and compatibilty with hed. The command "ZZ" from vi is the same as ":x". This is the recommended way to leave the editor. Z must be typed twice since this is two easy to type by accident and has such severe effects if unintentional. The options w300, w1200, and w9600 can be set. They are synonyms for "window", but only apply at 300, 1200, or 9600 baud, resp. Thus you can specify you want a 12 line window at 300 baud and a 23 line window at 1200 baud with :set w300=12 w1200=23 It is now possible to say :set window=5 and get the e((ffect the next time the screen is redrawn from scratch. (^L and Hit return to continue don't start from scratch.) This is sort of pointless, since both 5: and z5 do the same thing with better results. The editor no longer uses nondestructive space, except when in insert mode. It instead prints the character it would be moving over. This is a real win on terminals that use an escape sequence to nd space. It is now possible from visual to string several search expressions together separated by semicolons the same as command mode. For example, you can say /foo/;/bar from visual and it will move to the first "bar" after the next "foo". This also works within one line. The option "mapinput" is dead. It has been replaced by a much more powerful mechanism: :map! (e.g. put an ! after the map). Map and unmap commands with ! apply only to input, others apply only to command mode. The new option "timeout" (default on) causes macros to time out after one second. Turn it off and they will wait forever. By using map! and setting notimeout, it is possible to get the effect of emacs abbreviation mode. Sanity checking is turned off for map when ! is present. This is a crude facility and does not take into account things like the abbreviation being part of a longer word. It also does not echo until it is satisfied. The new option "remap" (default on) causes the editor to attempt to map the result of a macro mapping again until the mapping fails. This makes it possible, say, to map q to # and #1 to something else and get q1 mapped to something else. Turning it off makes it possible to map ^L to l and map ^R to ^L without having ^R map to l. The new option "undomacro" (default on) makes it possible to undo macros as a unit. Leaving it off causes macros not to be treated specially. Macros with zero or one change work better with noum, with two or more changes better with um. This option may go away if it becomes unnecessary. The new (string) valued option "tags" allows you to specify a list of tag files, similar to the "path" variable of csh. The files are separated by spaces (which are entered preceded by a backslash) and are searched left to right. The default value is "tags /usr/lib/tags", which has the same effect as before. It is recommended that "tags" always be the first entry. On Ernie, /usr/lib/tags contains entries for the system defined library procedures from section 3 of the manual. ^R is now the same as ^L on terminals where the right arrow key sends ^L (The tvi and the adm 31). Looking for a tag now uses binary search. The "q" command from visual no longer works at all. You must use "Q" to get to ex command mode. A minor incompatibility with the v7 ed has been fixed. Previously, to do a global substitute with an escaped newline in the rhs, you had to put two \'s in ex and one in ed. Ex now accepts the single form as well as the double form. For example, instead of g/foo/s//foo\\ bar/g (which still works), you can now type, as in ed, g/foo/s//foo\ bar/g This means that the following ex command, which used to "work": g/foo/s//foo bar\ .+1,/mumble/d won't work anymore unless you put the trailing / on the substitution. This usage is pretty obscure anyway. Several bugs relating to undoing macros have been fixed. A bug which caused the command "g/pattern" to print an error message if "pattern" occurred on the last line has been fixed. If you reply ":" to "Hit return to continue", you will again be asked "Hit return to continue" after the next command finishes. Limits have been raised so that an Ann Arbor terminal can be used, and long tags can now be accomodated. The maximum length of a string valued option has been raised from 32 to 64, for the benefit of the "tags" option. It is now possible to search for an escape or delete using f, F, t, T, ;, and ,. These characters must be quoted with ^V. The option "ttytype" is now in correct alphabetical order. A bug that caused HP terminals to mess up in insert mode when inserting before a tab which follows 7 or fewer characters at the beginning of a line (such as a tags file) has been fixed. It is now possible to include control D in your EXINIT or .exrc. A bug which caused the screen to mess up when a glob (such as xx*) doesn't match anything has been fixed. The editor now checks for extra junk after a /r.e./ from visual (other than the allowed z command) and beeps if any is found. Previously it was just ignored. A bug that caused j and k (up and down) to behave strangely after an insertion has been fixed. A bug which causes term to be displayed incorrectly and which caused a crash when changing terminal type when there happened to be several |'s and a long string in genbuf has been fixed. This bug was introduced in ex 2.9. The patch for echo lines longer than 80 characters has been repaired to do "Hit return to continue" after such lines and print the entire output. A bug that caused a messed up screen after a :sh command from open mode has been fixed. A bug which caused a tag request for a nonexistant tag to leave the editor in nomagic mode has been fixed. A bug which caused strange behavior if there is no default file name when an autowrite save is attempted has been fixed. A bug which caused the cursor to go to the wrong position when ^^D or 0^D is entered from column 2 in autoindent mode on terminals that can backspace has been fixed. Version 3.2 -- January 4, 1980 A bug that caused nomagic to be set if an error happened within a tag command has been fixed. A bug that caused put commands to beep after a macro containing an error has been fixed. The mapinput option has been placed in alphabetical order. A bug that caused undo to undo more than one macro invocation on the same line has been fixed. On non VM/UNIX systems, the screen size has been increased to allow a 40 X 80 Ann Arbor to be used. Version 3.2 -- December 28, 1980 Several limits have been increased for VM/UNIX. Longer lines, more characters of file names, longer regular expressions, etc. Huge files can now be edited directly. Larger terminals (up to 66 lines) can be used. An internal change has been made for VM/UNIX that causes error messages to be stored directly instead of in a disk file. This should cause faster response to errors. Version 3.1.1 -- December 13, 1979 A bug that caused nested macros not to be undoable has been fixed. A bug that caused pounding on the escape key on terminals with arrow keys that send escape sequences to cause undo to screw up has been fixed. It is now acknowledged that macros cannot contain the put command. This is due to the implementation of put - previously a put inside a macro dumped a copy of the buffer instead of the desired text and left the editor in a very strange state. Now such a put just beeps. Version 3.1 -- November 1, 1979 Versions from 3.1 up are too large to fit on pdp-11's. (Special overlay software is expected to be available soon for v7 pdp-11 Unix that will make it fit.) Version 2.9 is 3.1 with only the bug fixes and very few of the enhancements. 2.9 will fit on a pdp-11. Version 2.10 will come out and may correspond to 3.2. (It turned out to correspond to 3.3) For compatibility with ed: 's' may be used as a command and means '&'. If you set the option "edcompatible" (abbr "ed") the presense or abscence of g and c suffices is remembered and can be toggled by repeating the suffices. The suffix "r" makes the substitution into "~" instead of "&". A new command line option -w sets the value of window before starting ex. Hence: 'vi -w5 file' makes a quick change to a file easier at 300 baud. Arrow keys on terminals that send more than 1 character now work. Home up keys are supported as are the four directions. Ex no longer looks at the ma= entry in termcap, but uses the ku, kd, kl, kr, and kh entries. (Note that the HP 2621 will turn on function key labels, and even then you have to hold shift down. To avoid turning on the labels, and to give up the function keys, use terminal type 2621nl instead of 2621.) A parameterless macro facility is included from visual. Briefly, there are two flavors of macros: a) Put the macro body in a buffer register, say x. Then type @x to invoke it. @ may be followed by another @ to repeat the last macro. This allows macros up to 512 chars. b) Use the map command from command mode (typically in the .exrc file) as follows: map lhs rhs where lhs will be mapped to rhs. There are restrictions: lhs's should be 1-keystroke (either 1 char or 1 function key) since they must be entered within 1 second. lhs no longer than 10 chars, rhs no longer than 100. To get " ", "\t", "|", or "\n" into lhs or rhs, escape them with ctrl V. (It may be necessary to escape the ctrl V with ctrl V if the map command is given from visual mode.) For 1 shot macros it is best to put the macro in a buffer register and map a key to '@r', since this will allow the macro to be edited. Macros can be deleted with unmap lhs The boolean option "mapinput" (mi) will, if on, cause macros to be mapped in input mode as well as command mode (in visual only). For example, you can define ctrl T to be four spaces with :map ^V^T_^V^V____ :set mi where underlines represent spaces and the ctrl V's are necessary to get ctrl chars and spaces past various levels, and make ^T be a software tab that even works in the middle of a line. If the lhs of a macro is "#0" through "#9", this maps the particular function key instead of the 2 char # sequence, if the terminal has function keys. This only works if termcap has function key entries for the particular terminal. For terminals without function keys, the sequence #x means function key x, as typed. As a special case, on terminals without function keys, the #x sequence need not be typed within one second. The character # can be changed by using a macro in the usual way: map ^V^I # to use tab, for example. (This won't affect the ma((p command, which still uses #, but just the invocation from visual mode.) The undo command will undo an entire macro call as a unit. New commands in visual: ^Y and ^E. These glitch the screen up and down 1 line, respectively. They can be given counts, controlling the number of lines the screen is glitched. They differ from ^U and ^D in that the cursor stays over the same line in the buffer it was over before rather than staying in the same place on the screen. (^Y on a dumb terminal with a full screen will redraw the screen moving the cursor up a few lines.) If you're looking for mnemonic value in the names, try this: Y is right next to U and E is right next to D. More new commands in visual: '&' is a synonym for ':&'. '~' changes the case of the letter under the cursor and moves to the next character. Ex looks in your environment for EXINIT. If it finds it, that is used instead of looking for your .exrc. This should make entry into ex faster, along with the termlib feature of looking for a termcap entry in TERMCAP. Version 2.13 -- September 23, 1980 The provisions for changing the window size with a numeric prefix argument to certain visual commands have been deleted. The correct way to change the window size is to use the z command, for example z5 to change the window to 5 lines. An undocumented "feature" which caused the ^^ command to return to the previous tag, if in the current file, instead of the previous file, has been removed. Version 2.12 -- July 23, 1980 A change was made to the sys_errlist array in ex_subr.c so that Berkeley V7 quotas will produce the right error message. A couple of minor bug fixes were made to get the editor to compile on version 6. The option to use 1K BUFSIZ has been deleted, since it is no longer used on our 1K system. Version 2.11 -- June 24, 1980 The visual page motion commands ^F and ^B now treat any preceding counts as number of pages to move, instead of changes to the window size. That is, 2^F moves forward 2 pages. A :vi command from visual mode is now treated the same as a :edit or :ex command. The meaning of the vi command from ex command mode is not affected. A read only mode now lets you guarantee you won't clobber your file by accident. You can set the on/off option "readonly" (ro) and writes will fail unless you use an ! after the write. Commands such as x, ZZ, and autowrite, and in general anything that writes is affected. This option is turned on if you invoke ex with the -R flag. A new link called "view" has been created. View is just like vi but it sets readonly. The editor now supports certain terminals that use strings other then \r and \n for return and linefeed by implementing the cr and nl termcap options. (Thanks to UCLA for these enhancements). The termcap attribute ns is now checked for, and ex refuses to go into visual mode on such a terminal unless it has sf. If you change your start and stop characters to something other than the default ^S and ^Q, vi now turns them off. This causes people who change them to escape not to lose so badly. The quit character is once again turned off so that datamedias which send ^\ for the right arrow key work. If you type in an unmatched ) or } in showmatch mode, the editor will now beep to warn you about your mistake. The ) or } is still accepted. Editor scripts can now contain comments. Begin the comments with " (double quote). Comments can be on their own line or come at the end of command lines. The comment continues to the end of the line. The 3rd version of the USG tty driver is now supported, making it possible on USG systems to interrupt redrawing the screen and to not flush output when interruptable commands take place. The rewind command has been added to the list of commands that the autowrite option knows about. A bug on the USG system where hanging up the phone causes more than one SIGHUP to be sent has been compensated for. A bug which caused a file that bombed out in the middle of an edit command to be considered modified has been fixed. The source file ex_io.c has been split into ex_io.c and ex_unix.c to avoid a problem where many C compilers overflowed the symbol table. A bug which prevented turning off your prompt in your .exrc has been fixed. Some of the code internal to the editor has been rearranged and some comments added. The bug fix to the USG tty driver to output a null character as padding at 1200 baud has been improved to output a DEL at 1200 baud or above. Terminals with small screens (less than 20 columns or less than 5 lines) should now work. A bug which prevented you from entering the character DEL into the buffer if you changed your interrupt character to something else besides DEL has been fixed. A bug which caused things like d) and d} to miss the last character when they should have deleted to the end of the buffer has been fixed. A bug which caused the last character to be lost when you read in a file with no newline at the end of the last line has been fixed. A bug that caused garbage to be in the buffer if the temp file overflowed has been fixed. The character | can now be escaped with \| in file names. A bug which caused the editor to not work if the tab stop size did not divide the screen width has been fixed. A bug on HP terminals that caused the screen to be messed up if you scrolled up something that began the same way as the echo line has been fixed. An old ed bug which caused globals to fail when they did a substitute on the next line has been fixed. The % operator will now find matching square brackets the same way it does parentheses and braces. It will not display them in showmatch mode, however, and will not use a ] to match all ('s. Ex looks in your environment for EXINIT. If it finds it, that is used instead of looking for your .exrc. This should make entry into ex faster, along with the termlib feature of looking for a termcap entry in TERMCAP. Internally, it is possible to turn off about a dozen different options when compiling the editor to make it fit in 64K. See the makefile for a list of options. Version 2.10 -- February 2, 1980 (Corresponds to 3.3) The default window sizes have been changed. At 300 baud the window is now 8 lines (was 1/2 the screen size). At 1200 baud the window is now 16 lines (was 2/3 the screen size, which was usually also 16 for a typical 24 line CRT). At 9600 baud the window is still the full screen size. Any baud rate less than 1200 behaves like 300, any over 1200 like 9600. A new command mode command "x" (for "xit") has been added. This is the same as wq but will not bother to write if there have been no changes to the file. The command letter was chosen for convenience and compatibilty with hed. The command "ZZ" from vi is the same as ":x". This is the recommended way to leave the editor. Z must be typed twice since this is two easy to type by accident and has such severe effects if unintentional. The options w300, w1200, and w9600 can be set. They are synonyms for "window", but only apply at 300, 1200, or 9600 baud, resp. Thus you can specify you want a 12 line window at 300 baud and a 23 line window at 1200 baud with :set w300=12 w1200=23 The "q" command from visual no longer works at all. You must use "Q" to get to ex command mode. The editor no longer uses nondestructive space, except when in insert mode. It instead prints the character it would be moving over. This is a real win on terminals that use an escape sequence to nd space. A minor incompatibility with the v7 ed has been fixed. Previously, to do a global substitute with an escaped newline in the rhs, you had to put two \'s in ex and one in ed. Ex now accepts the single form as well as the double form. For example, instead of g/foo/s//foo\\ bar/g (which still works), you can now type, as in ed, g/foo/s//foo\ bar/g This means that the following ex command, which used to "work": g/foo/s//foo bar\ .+1,/mumble/d won't work anymore unless you put the trailing / on the substitution. This usage is pretty obscure anyway. A bug which caused the command "g/pattern" to print an error message if "pattern" occurred on the last line has been fixed. Limits have been raised so that an Ann Arbor terminal can be used, and long tags can now be accomodated. A bug that caused HP terminals to mess up in insert mode when inserting before a tab which follows 7 or fewer characters at the beginning of a line (such as a tags file) has been fixed. A bug which causes term to be displayed incorrectly and which caused a crash when changing terminal type when there happened to be several |'s and a long string in genbuf has been fixed. This bug was introduced in ex 2.9. The patch for echo lines longer than 80 characters has been repaired to do "Hit return to continue" after such lines and print the entire output. A bug that caused a messed up screen after a :sh command from open mode has been fixed. A bug which caused a tag request for a nonexistant tag to leave the editor in nomagic mode has been fixed. A bug which caused strange behavior if there is no default file name when an autowrite save is attempted has been fixed. A bug which caused the cursor to go to the wrong position when ^^D or 0^D is entered from column 2 in autoindent mode on terminals that can backspace has been fixed. In order to get 2.10 to fit on a v7 pdp-11, the following features have been deleted: The MASTERTAGS feature (undocumented use of /usr/lib/tags as an alternate tag file) Checking that a file being read in is an ascii file. Turning off ^Q/^S on a v7 system. Version 2.9 -- November 1, 1979 The meanings of semicolon and newline, broken in 2.8, have been fixed. Newline with two arguments still prints the range, unless a semicolon was present, in which case only the last line is printed. Semicolon otherwise behaves as in ed (and ex 2.7). For compatibility with ed: '%' is an abbreviation for '1,$'. The default starting line for 'z' is '.+1' instead of '.'. ((If 'z' is followed by a number, this number is remembered (by setting the scroll option). The + options to the command line invocation and to the edit command now also work for the next command. In addition, the text after the + is no longer limited to a line number or / or ? search string, but can be any single command. (It cannot contain spaces except on command line invocation, and then must be quoted to make the shell happy.) The only special case is where + is used by itself - this is the same as +$. The way window sizes and scrolling commands are based on the options window and scroll has been rearranged. All command mode scrolling commands (z and ctrl D) are based on scroll: ^D moves scroll lines, z moves scroll*2 lines. Everything in visual (^D, ^U, ^F, ^B, z, window sizes in general) are based on the window option. The defaults are arranged so that everything seems as before, but on hardcopy terminals at 300 baud the default for scroll is 11 instead of 6. Whether ex prompts for commands now depends on the setting of the prompt variable, so inside script you can say 'set prompt' and get ex to prompt. Tags are now searched for in nomagic mode instead of the funny mode where magic characters were impossible to get. Paragraphs and sections with one letter names (such as those used by PWB/MM) now work - use a space (escaped by a backslash) for the second letter. Default paragraphs and sections are included for both MM and MS. (Thanks to adb for this) A bug involving 16 bit arithmetic on a vax for the yank command has been fixed. The text of the mailed message from expreserve has been improved slightly. The editor now always turns off the XTABS stty bit when in visual mode, making terminals that do special things with ^I work. The editor now knows about terminals with destructive tabs, like the teleray 1061, having the xt option. A bug that caused going past column 80 on terminals with insert line but not insert char (like the mime, h1500, or i100) to mess up the screen has been fixed. A bug on 2621's that causes lines longer than 80 chars long with embedded tabs to mess up when a tab was inserted has been fixed. A bug that caused the wrong line to suddenly appear under very rare circumstances involving small window sizes and long lines where a search left the cursor on the top line of the screen has been fixed. The bug that caused inverse video to sometimes be scrolled up into the file from an error message has been fixed. The join command has been fixed, so that '3,3j' no longer joins lines 3 and 4. ('3j' still does.) Thus, '/a/;/b/-j' works right even if b is found on the line after a. ex -v now finds your .exrc. In related changes, the default in vi is now magic and nobeautify. If your buffer is empty, ex won't refuse to do an edit, quit, or tag command because you haven't done a write. A bug causing visual undo not to work after '1,$!cat' has been fixed. Ex now decides for itself whether to use CBREAK or TIOCSETN by whether they are defined in . This eliminates much of the #ifdef USG or V6 lines. One USG line remains due to a bug in the USG tty driver at 1200 baud. Note that this will mess up if you use libretro because has CBREAK and TIOCSETN defined. Take these out of sgtty.h to fix this. Termcap options TI and TE have been added. These strings are respectively output at the beginning and end of the editing session. Values for the set command may now include `\ ' for space and control characters. Changes have been made to /etc/termcap (several new fields have been added) and to termlib (it now looks for TERMCAP in the environment and treats it as a termcap entry if the name of the terminal mentioned is the same as TERM and the entry doesn't start with a slash. If it starts with a slash it is treated as a filename, as before. Termcap also checks the 512 byte entry limit and skips lines beginning with # as comments. It is possible to define one terminal as being similar to another one with a few differences without making two copies of the description.) New termcap fields: ti terminal initialization string. This should be sent out at the beginning of any program that addresses the cursor. te Like te but at end of the program. (Thanks to adb for these two fields) us Start underlining. ue End underlining. uc Underline one character & move over it. hc (bool) terminal is hardcopy ns (bool) terminal doesn't scroll (tektronix) ff (bool) hardcopy knows ^L means formfeed. pt (bool) hardware tabs, maybe set by is xt (bool) destructive tabs (teleray 1061) ku sequence sent by keypad "up" arrow kd "down" arrow kl "left" arrow kr "right" arrow kh "home" arrow ks sequence to make keypad send these codes ke sequence to make keypad not send these codes. k0-k9 sequences sent by up to 10 "other" keys l0-l9 labels on k0-k9. If omitted, default = "f0" - "f9". ko additional keys on keypad, in terms of their termcap entry. For example, if "home down" and "clear" are present and send the same codes as ll and cl, use :ko=cl,ll: tc This entry is a list of differences from the named entry. THIS MUST BE THE LAST FIELD. Example: hp2621 with no ks or ke (e.g. null string): hn|hp2621nl:ks@:ke@:tc=hp2621: The @ cancels the string even if it is defined later. Version 2.8 -- July 18, 1979 It is now possible to backspace over the first character (:, /, or ?) on the echo line from visual. The effect is as though delete were hit except the bell isn't rung. The trailing slash in global commands is now optional. g/pat means g/pat/p (This change, as well as the corresponding changes to the substitute command and r.e. address are also in the latest version of ed.) The j, k, and l keys now move the cursor down, up, and right, respectively, in visual mode, as they used to do (and still do on 3a's). This is to avoid the creeping of these keys into the map descriptions of terminals and to compensate for the lack of arrow keys on terminals like HP's. Two arguments given to a newline command now print the range of lines instead of just the last line (as though 'p' were appended). To make forms like /foo/;/bar/ still work, the ; operator sets the dot as before but then forgets everything to the left of the ;. The + option invoked from the shell or the edit command has two new forms: +/pat and +?pat These cause the initial line to be chosen by a search for the pattern pat. Note that if any special characters are in the argument (such as ^, $, and even ?) it must be quoted. Two new options are added: autowrite (aw) and hardtabs (ht). Autowrite is a toggle, off by default. When on, if you have unsaved changes before a context switching command, a write is done automatically. The commands that may write are !, next, and tag. Note that there is an equivalent way to do the command with autowrite set without the write in each case: shell, tag!, and edit do not write. Hardtabs is a numeric option,, set to 8 by default. Changing this to, say, 4, tells ex that either your system expands tabs to every 4 spaces, or your terminal has hardware tabs set every 4 spaces. A bug that caused strange behaviour when an echo line contained more than 79 characters (from a long : command or one or more long filenames) has been patched by not printing any such characters past column 79. Handling of systems with nonstandard locations of files (where the maintainer of ex is not a superuser and cannot create files with names like /usr/lib/ex2.0strings or /etc/termcap) has been improved. If the file can't be found as is, it is tried in the current directory. If that fails, ex tries to run without it. (Previously it bombed immediately if the error message file wasn't in /usr/lib.) Shell commands containing ! or % characters are no longer echoed when in hush mode (as in 'ex -' from a shell file.) Version 2.7 -- June 10, 1979 An inefficiency introduced in version 2.3, which increased the amount of time spent preparing output by approximately 30 percent has been corrected. A bug which caused ``wrapmargin'' to work as though all hardcopy terminals were 160 columns wide has been corrected. A bug which caused the display to become confused after the display of a long line at the bottom of the screen was suppressed (being replaced temporarily by an @) has been fixed. Previously, under some circumstances (e.g. after a put created the situation), scrolling up of the following text would cause the display of this long line to be skipped, so that the @ line would remain and the line itself would not be displayed. Version 2.6 -- June 2, 1979 A bug which prevented the first field separator in a tags file from beginning with a blank has been fixed; if the separator was a blank previously, the tag would not be found in the tags file. A bug which caused the display to be messed up after a ``:'' escape which created long lines has been fixed. Previously a substitute command which changed the last few lines on the screen to be very long would leave the screen messed up. A bug in display after 2 successive ``undo'' commands has been fixed. Previously if you opened new lines on the display, and then did 2 successive undo commands, the display would be messed up after the second undo if your terminal had insert/delete line. A bug on intelligent terminals which caused unnecessary delete character commands to be sent has been fixed. This occurred when you did not have ``autoindent'' set, and opened a new line below an existing line with tabs. The change operations in open mode on hardcopy terminals has been fixed. Previously there were several bugs in cursor placement when the change extended to just before a tab character. Several bugs in the handling of tabs in insert mode on intelligent terminals have been fixed. Previously, tabs would often expand incorrectly, leaving the wrong amount of white space, when an insert occurred just before a tab. A bug has been fixed which caused the editor to skip processing of the ``.exrc'' file when the te((rminal type set in the environment was unknown. The editor now processes ``.exrc'' in this case. [[A number of formatting changes have been made to the editor code to eliminate unreasonably long lines. In addition, the code from the Murray Hill and USG sites has been merged in conditionally, so that all sites can compile from the same source.]] Version 2.5 -- May 28, 1979 A bug which caused the VE sequence not to be sent when exiting the editor via :q or :wq from visual has been fixed. A bug which caused the command r^Q to be weird when it was repeated has been fixed. The $ command now sets the column for future cursor motions to effective infinity. Thus a `$' followed by up/down cursor motions moves at the right margin of each line. [[Internal: a bug in conditional compilation without the LISP features has been fixed.]] Several bugs relating to insert mode and intelligent terminals have been fixed: A bug which caused inserts on HP/DATAMEDIA like terminals to act strangely when the material was inserted immediately before a tab has been fixed. A bug which caused the insertion of full tabs to not appear to insert as many spaces as required (under strange circumstances) has been fixed. A bug which caused inserts on terminals with insert/delete line but no insert/delete character to act strangely if the insert caused a line to overflow has been fixed. The ``expreserve'' program has been improved; you now will get mail if a file is saved for you as a result of your phone being hung up accidentally. Version 2.4 -- May 19, 1979 A bug during inserts on intelligent terminals which occasionally caused double ``~~'' characters on the last few lines of the display rather than just single `~' characters has been fixed. The w W b B e and E operations in visual now wrap around line boundaries. Thus a sequence of enough w commands will get to any word below the current position in the file, and b's will back up to any place before. Thus these are more like the sentence operations ( and ). You still can't back around line boundaries duing inserts however. Version 2.3 -- May 13, 1979 The P command to ex is now a synonym for p, so that 1,$P works, if you don't let up on the shift key soon enough. The / and ? operations within visual and open now hit later (or earlier resp) occurrences of the same string on the same line. This makes scans using / and ? much more useful. You can move to the right on the current line by typing /pref where `pref' is a prefix of the word you wish to move to, and delete to a following string `str' by doing d/str if it is on the same or succeeding line. Previously the command d/pat/ deleted lines through the next line containing `pat'; it now deletes text up to the next instance of `pat'. To delete to the next line containing `pat', do d/pat/0 which is short for d/pat/+0 In general if you use an offset after the scanning pattern, whole lines will always be affected. Several bugs relating to the setting of the previous context mark `` have been fixed, including one which caused operations such as d`` or c`` to occasionally dump core. In particular, the operations ( ) { } [[ ]] and % now set the previous context mark correctly, and the mark is set even if the motion by these operations lands in the same line. More optimization is now done on output cursor motions. This is particularly much better on HP terminals which have ridiculously long cursor addressing sequences. A new capability has been added to the termcap file to aid this: ``bt'' (backtab). Thanks to Chuck Haley for the new code to implement this. A bug has been fixed on intelligent terminals which caused part of the screen to be accidentally erased during insertions. This occurred only on the first line on the screen, when it became longer than one displayed line and only if a part of the screen (at the top) was currently not in use. A bug has been fixed which caused the command ``dp'' to be interpreted as ``delete to register p''. This normally went unnoticed since the ``autoprint'' option would cause the effect which the ``p'' was forcing. Version 2.2 -- May 6, 1979 "d)" now deletes a line if the current line is a sentence rather than leaving an empty line. The command :s/str now deletes str if it can find it; previously it was an error. The editor now handles multiple ":" escapes correctly; previously the screen would not be redrawn necessitating a ^L to fix it if you gave a `:!command' to ``[Hit return to continue]''. Recursive calls to visual from within open or visual are no longer permitted. Previously ``:vi'' from within open mode would eventually leave the editor in a strange state. The %age in the status line is now correctly printed on 11's; Previously internal 16-bit overflows often caused it to be incorrect. The editor now ignores a ":" in front of commands. Thus you can say ``:read foo'' within ex. A bug which caused commands involving ]] to not be repeatable has been fixed. Previously ``d]]'' followed by ``.'' caused an error. "ayw now works correctly. Previously this silently did nothing. Several bugs in "recover" and "ex -r" have been fixed. Thanks to Andy Koenig for the fixes. In input mode in open and visual ^V (like tenex) is now equivalent to ^Q (which is reminiscent of ITS) superquoting the next character. A later version of the UNIX tty driver will implement the standard for ^S ^Q handshaking and make ^Q unusable. There are several typos on page 3 of the ``edit'' manual section: s/move "a/delete a/ s/"a move ./put a/ /move to copy/s//delete to yank/ Version 2.1 -- April 5, 1979 Invoking ex via ex -l now sets "lisp" and "showmatch". This is suitable for invocations from within Franz Lisp. If you don't like "showmatch", you can still use "ex -l", just put the command set noshowmatch in your .exrc file. of the UNIX tty driver will implement the standard for ^S ^Q handshaking and make ^Q unusable. There are several typos on page 3 of the ``edit'' mnews/net 644 0 33 31565 2423021220 5535 *** Tuesday February 12, 1980 (Revised )New Version of the network *** A new version of the Berkeley network has been installed on this machine. It is a considerable rewrite and involves some incompatible changes. The user commands execute faster and include the following features: Netq command: The netq command now lists the "From" and "To" machines. The option to list the queue to only one machine now works, e.g. "netq C" works. Netmail command: The netmail command now mails the remote mail back to you, instead of a file "mbox.Mach". There are two new options: -c turns netmail into a "mail check", e.g. netmail -c ingres:schmidt checks to see if I have mail on the ingres machine. It can be put in .login files and requires no password. If mail is present, a message is sent back. If there isn't any mail, no message whatsoever is sent back. Without the -c option, the netmail command mails the mail on the remote machine to you. As a safety precaution it appends your mail to your mbox on the remote machine before deleting it. If there is no mail, the netmail command will send back a message to that effect. use the -q option to suppress this: netmail -c -q i:schmidt Sending mail: Mail sent to users on other machines will "quiet"-- unless there is an error no confirmation will be sent back. The ridiculous "Mail sent successfully" message has been eliminated. New options to net, netmail, netlpr, and netcp: -q makes it a "quiet" command-- unless there is output from the program or the return code is non-zero, no confirmation will be sent back (sending mail automatically uses -q). -n has been changed (in an incompatible way) to mean if you send back a confirmation mail it to me, don't write to me. -n is equivalent to "mesg n" but less anti-social. When the net command(s) prompt you for a login name and password they now indicate a machine: Name (C:schmidt): as well. Type either the user name or a carriage return as before. Responses: Now indicate accounts by "mach:username" instead of "username on the mach machine". When messages are written to the terminal, the time they appear is added, e.g. "From so-and-so at 23:59..." The return code (see -q above) is printed "R: num", in the header line. A return code of 0 is considered successful. Beware: many commands on Version 6 UNIX systems return garbage as a return code. Extra returns are added so users running the "vi" command will get meaningful answers. Netlpr: Take a new option -c to specify the printer command to execute: netlpr -m Cory -c epr file1 ... fileN will send file* to the printer in 508H Evans instead of the printer in Cory. (The default command remains "lpr"). The netlpr command, when executed between Computer Center machines, now sets the ownership of net queue files correctly so that "netrm" will remove them and they are listed by the "netq" command. Netlog: The format of the netlog has been altered slightly. *** netlogin command Tue Feb 12 13:41:51 1980 To: msgs /usr/news/net Subject: New way to specify your password to the network. There have been security problems with remote passwords in files, so I have implemented a new network command to put encrypted passwords into the V7 environment (i.e. only on Version 7 UNIX systems). Type setenv MACHmch `netlogin -m mch -l username` (note the back-primes to the C shell) where mch and username are the machine and login name for which you are setting the password,e.g. setenv MACHA `netlogin -m A -l schmidt` will prompt me for a password for my account o((n the A machine. The password is put in the environment, type printenv to see the encrypted form. The password is useless after logout. This is more secure than .netrc file passwords, but see me if you want to know its limitations. *** Monday February 11, 1980 The Image machine added to the network ** The network now looks like: IngVAX------Ing70 A B | | | | | | CSVAX------Cory-------C--------D-------SRC | | | | Image-----ESVAX E *** Wednesday December 5, 1979 Machine(s) added to the network*** The network now looks like: Ing70---------CSVAX A B | | | | | | | | | | | | IngVAX Cory-------------C---------------D | | | | | | E SRC The one-letter codes are: a A b B c C d D e E i Ing70 j IngVAX s SRC v CSVAX y Cory *** Wednesday April 18, 1979 Network Released *** The Berkeley UNIX network is hereby officially released. The network connects the A, C, D, E, SRC, Cory and VAX machines on the Berkeley campus. Users may copy files from one machine to another, send and read mail on other machines, use lineprinters on other machines, and execute any UNIX command directly. Even if a user has only one account on one machine, the ability to send remote mail may be very useful to him. Documentation will be available from the Computer Center Library on the 2nd floor, Evans hall. The package includes a tutorial introduction and Programmer's Manual sections for the commands. *** Tuesday April 17, 1979 SRC machine *** The Survey Research Center (SRC) PDP-11/34 was added to the network. The machine is denoted "SRC" or "S". The new net topology is: A | | | Cory-------------C---------------D | | | | | | | | | VAX E SRC *** Monday April 2, 1979 Command Location *** 1. The net commands are now in /usr/bin on Cory and the CC machines, and in /usr/new on VAX. This is their final destination for quite some time. Please remove /usr/net/bin from your search paths. 2. If you have a password in the ".netrc" file, the "net" command requires the netrc file be unreadable by users other than the owner of the file. To accomplish this, type chmod 600 .netrc in your login dirctory. *** Wednesday Mar. 14, 1979 Name and netq changes *** 1. The rcp, rlpr, and readmail commands are now the netcp, netlpr, and netmail commands. The old names will be maintained for a few weeks. 2. Netq now summarizes jobs which aren't yours. The format is still being adjusted, but if you want all the queue- type "netq -a". The '-f' option has disappeared (it wasn't faster). The time entered the queue is printed automatically. 3. The netlog (/usr/net/logfile) prints the wait time for jobs being sent. 4. The "FileName" entry in netq has changed- it is three letters shorter, and is called "Code". "netrm" takes this "Code" as an argument to net remove. *** Sunday Feb. 25, 1979 Net changes *** Sometime soon the following changes will occur. They will first occur on the VAX, and if they work, and when time permits, will be moved to the over net machines: 1. Shortest Job First- Files are now sent first come first served. The network will use non-preemptive shortest job first scheduling. This means the shortest job remaining to be sent per-directly connected machine will be chosen, and you may no longer rely on the submission order of the commands. The easiest way around this is to separate commands by semi-colons or send shell scripts. In any case, the netq command will indicate the order to be sent. 2. Netq command: The netq command now groups the commands for each directly connected machine together, separated by "---". 3. Comp. Center: The commands in /usr/net/bin are now also in /usr/new on the Comp. Center machines, and the ones in /usr/net/bin will be removed shortly. Thus all net commands are now found in /usr/new on any of the six machines. 4. The documentation in the file /usr/net/netdoc and the manual sections is being improved. *** Sunday Feb. 25, 1979 Protect your passwords *** Passwords may be specified in the .netrc file. The file should be mode 0600: chmod 0600 .netrc However, a super-user can still read this file. Unless absolutely necessary, you should not put passwords in the .netrc file, since an illicit super-user can discover all your passwords on other machines. If you decide to put them in, you must be prepared to change your passwords on all net machines when there is a security breach on any one. The easiest way to avoid this problem is to not put passwords in any files anywhere! *** Monday Feb. 19th 1979 *** The E machine will be added to the network tomorrow, Tuesday. Until then, requests will be queued on the C machine. It is connected to the C machine at 1200 baud, and is accesible from all other machines. The network now looks like: A | | | Cory------------C---------D | | | | | | Vax E *** Wednesday Feb. 14th 1979 *** The net from Vax to Cory is back up. *** Saturday Feb. 10th *** I have restarted the net from Cory to C, making the A, C, and D machines accessible from Cory. The problems of last week are still present, and use of the Cory-C connection is STRICTLY WITHOUT ANY GUARANTEE. If the connection fails because of overloading, and the net backs up on C and Cory as it did last week, the files simply will be removed. Hopefully, the few minor tuning chages will help. Vax-Cory is still down. *** Friday Feb. 9th *** The network on Cory and VAX is back down. There appear to be two problems-- 1) The hardware link between Cory and VAX simply does not work. 2) The "C" machine has been so overloaded that characters simply do not get through even at 1200 baud. The first problem has been reported. The second problem has no easy solution. I would estimate middle of next week for solution of the first problem. *** Monday Jan. 29 1979 *** The network from VAX to Cory, A, C, and D is back up. The connection between the Cory machine and the VAX is now a direct link. All machines are accessible from the VAX. The net looks something like: D / / VAX --- Cory --- C \ \ A This new version of the network assures the local machines are more secure from break-ins over the network by 15-year old people. This version of the network is unchanged externally, except that 1. netq has an option "-f" (think fast) which prints out the net queue entries without opening the files, and must be faster than the way it is done normally. It also prints the time the queue was entered. 2. The default machine for Cory is now the VAX. 3. On the Comp. Center machines, users whose login shells are /bin/csh will not have their home directory set properly. Thus the .login and .cshrc files will not be read. Likewise csh scripts in the background will not get the user's .netrc file on these machines. It is not clear whose fault this is though it is clear that Bill Joy really screwed up royally by writing csh. If we only had /bin/sh then there would never be home directories and I wouldn't have to worry about such inane things. [ -wnj ] The "E" machine will be on the network shortly. *** Sometime in December 1978 *** A new version of the network has been installed. It is in /usr/new on Cory and VAX, and /usr/net/bin on the Comp. Center machines. It will soon be officially supported. The documentation in the network manual sections (man NEW * on Cory and VAX, man NET * on Comp. Center) and the tutorial in /usr/net/netdoc are more or less up-to-date. The major differences are: 1) Various bug fixes, most notably the @m@ file bug is fixed. 2) Various performance improvements: the network should run faster and put less load on the machine. 3) The network configuration looks like this: D / / VAX --- Cory --- C \ \ A The default machine for Cory is C, C is A, VAX is Cory, A is C and D is C. (Note changes.) All the links run at 1200 baud. No special precautions need be taken to send to/use the VAX. In a little while the E machine will be added to the net. 4) In general, the net command only prompts for a login name or password when no default is given. Also there is a new flag "-f" (and a new keyword in the .netrc file "force") which when present will always force prompting of user name and password. 5) The netq command now lists all traffic through the local machine, including "response" files. It is much faster. 6) It is still not possible to remove files submitted by rlpr between Comp. Center machines from the net queue using netrm. 7) Only one message will come back from the remote machine. If a response file is specified, no message will come back. The message is now labeled with the command it came from, and the time it was entered. 8) The mail commands on the Comp. Center machines have not been changed to use remote machine names- you must use "sendmail" instead of "mail" for the time being. 9) The "rrm" command has been removed. 10) The "rcp" command is able to copy files from a remote machine to another remote machine. 11) Note that the Version 6 archive and Version 7 archive formats are completely different. Please send comments to "schmidt" on the VAX machine. eled with the command it came from, and the time it was entered. 8) The mail commands on the Comp. Center machines have not been changed told/ 775 0 33 0 2510247401 4521 ((old/bin/ 775 0 33 0 2510247376 5304 old/bin/adb 755 0 33 100654 2423022073 6075 `t, !^Юn PPՀPpPPwPpݬ ݬݬHݬݬ3ݬݬP[7ݬݬPP ^լPPPլ Pj PP PPPݬݬ2~2~dPt GP&PPRЭPԭѬ: vݬ \~mP1X 2P2ރPPݬ2P~[P0߭2~o\~2~HrP1n 1X1LЬ[2ZZ PWPPYZݩikIP9ݩݩ k6Pé P#Z <PPPGPiPPkPѬ Ѭ PP$^%լ PЬ Poﭏ]P,!PlsodPP 4w7v+32~PlV vvPP1P!1P$1P/5P:1P=wP>1P?rS1Э1nP*1فuP2QQPPru=Pcu˴PPPL1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P|*Pa d&*PP oF:(}wx4:R(jkլ 2{~P{.1s2~c(1s2~ccݬ{0H{cݬw{Hݭlc(1pݭ^c둭C ~ ~C'"{1<~/cX(㚭~!cݭcݭczz>nOPzS ~ ~&-ݬ zAPPPírzPPPpzЭ`z1ݭb1ݭb1ݭ~b1ݭxb1ݭqb1ݭkb1ݭdb1ݭݬ P &1ݭCb1ݭuPvvuvuv u2vuv+uv$u)IPuPvuIHPYuVHA88( @@8, @ @8p 8P 9 94 @@ 99} 9. @@ @9/ @@ @&9 +92999< @9 E9K9Q9d W9e ]9D c9E i9 o9 u9% @ @ @z9 9 99u @9U @9 9  @9  @9@9E9D9B9C9?A9 9 99@99 99 9* @@:; @: : :+ @@:!:':b -:c 3:B 9:C ?: E: K:" @ @Q:# @ @ @W: ]: c:j:o:s t:S y: ~: :(::: : : : ::::::::::::::::;; ;;;;$;);0;6;=;D;K;Q;X;^;d;j;m;r;w;~;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<<< < <<<<<<<"<&<)<,</<2<6<=<C<J<O<V<\<c<g<m<r<x<|<<<<<<<<<<<<<<<<<<<<<<<<<<<<<== =====$=)=.=3=8===B=G=L=Q=V=[=`=f=l=r=u=acbbacbdacbfacblacbwadawiaddb2addb3addd2addd3addf2addf3addl2addl3addp4addp6addw2addw3adwcaobleqaoblssashlashpashqbbcbbccbbccibbcsbbsbbscbbssbbssibccbcsbeqlbeqlubgeqbgequbgtrbgtrubicb2bicb3bicl2bicl3bicpswbicw2bicw3bisb2bisb3bisl2bisl3bispswbisw2bisw3bitbbitlbitwblbsblbcbleqblequblssblssubneqbnequbptbrbbrwbsbbbsbwbvcbvscallgcallscasebcaselcasewchmechmkchmschmuclrbclrdclrfclrlclrqclrwcmpbcmpc3cmpc5cmpdcmpfcmplcmpp3cmpp4cmpvcmpwcmpzvcrccvtbdcvtbfcvtblcvtbwcvtdbcvtdfcvtdlcvtdwcvtfbcvtfdcvtflcvtfwcvtlbcvtldcvtlfcvtlpcvtlwcvtplcvttpcvtptcvtpscvtrdlcvtrflcvtspcvtwbcvtwdcvtwfcvtwldecbdecldecwdivb2divb3divd2divd3divf2divf3divl2divl3divpdivw2divw3editpcedivemoddemodfemulextvextzvffcffshaltincbinclincwindexinsqueinsvjmpjsbldpctxloccmatchcmcombmcomlmcomwmfprmnegbmnegdmnegfmneglmnegwmovabmovadmovafmovalmovaqmovawmovbmovc3movc5movdmovfmovlmovpmovpslmovqmovtcmovtucmovwmovzblmovzbwmovzwlmtprmulb2mulb3muld2muld3mulf2mulf3mull2mull3mulpmulw2mulw3noppolydpolyfpoprproberprobewpushabpushadpushafpushalpushaqpushawpushlpushrreiremqueretrotlrsbsbwcscancskpcsobgeqsobgtrspancsubb2subb3subd2subd3subf2subf3subl2subl3subp4subp6subw2subw3svpctxtstbtstdtstftstltstwxfcxorb2xorb3xorl2xorl3xorw2xorw3escdesceescfindirexitforkreadwriteopenclosewaitcreatlinkunlinkexecchdirtimemknodchmodchownbreakstatseekgetpidmountumountsetuidgetuidstimeptracealarmfstatpause30sttygttyaccessnicesleepsynckillcswsetpgrptellduppipetimesprofiltiusetgidgetgidsignal495051525354555657585960616263r0r1r2r3r4r5r6r7r8r9r10r11apfpsppc0.50.56250.6250.68750.750.81250.8750.93751.01.1251.251.3751.51.6251.751.8752.02.252.52.753.03.253.53.754.04.55.05.56.06.57.07.58.09.010.011.012.013.014.015.016.018.020.022.024.026.028.030.032.036.040.044.048.052.056.060.064.072.080.088.096.0104.0112.0120.0%r%RЬ[ЬZ[Yj [YPP^Ь[2P^G==PP 1UU2P@UP  * ֭ﵭ ֭֭Ï̓<P2QQP ֭Ï̓~^U2l<~x5JUa<1  R<L<Ï̓A<PP .<Ï̓<P<̓ ^Ь\Э1~1%쑽- l֭r߭=Pꑽ.֭߭&PޭYЭнЭP2PPPԭ瘭P֭PD40jhjjjjjjj4jBj0jjJ$jjjjjjjjjTjhjjjjjjjjajj~1]1|2P1y ~2~1:DDD12ݏݭ氭DD~Dl12a:~~2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\OmPd3ЬOP((լQPmPЬPЬRRQ{RPPR PRPPЬPЬRRQ{RPRPPPRRP@(#)access.c 2.2not in write mode@(#)command.c 2.4zX"= "^i=:%16t=%8t:%16tadb @(#)expr.c 2.5@(#)format.c 2.4 %.8s:%16tx%16m%T%M:%16t%16t%-8u%-16U%-8o%-8r%-8r%-16R%-8x%-16X%-24Y%-8q%-16Q%-8o%-16O%-8d%-16D%-16.9f%-32.18FSHELL/bin/shsh-c!@%c@(#)input.c 2.2 @(#)main.c 2.2-w%s adb @(#)opset.c 2.3%s%8t[%s]%s(%s)-(%s)(%s)+(%s)$%s$%r %R: %f@(#)output.c 2.3̓%+.16e%s%X%D @(#)pcs.c 2.3%d: killedbreakpoint%16tstopped at%16t@(#)print.c 2.9}\}X}T}P}}}} } } } } } } ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~'~1~6~J~T~X~\~o~v~~~~~~~~~~~must have 2 <= radix <= 16radix=%d base tenvariables = %Q ? map/ mappcs id = %d no process %.8s(?%R) from %X %8t%.8s:%10t? %R %.8s:%12t%R %8O:%8t%-8o,%-8o,%-8o ? %8t%8t"%24targs:%8t%8t%obreakpoints count%8tbkpt%24tcommand %-8.8d%24t%s%12t`%s' -b1 = %-16Re1 = %-16Rf1 = %-16R b2 = %-16Re2 = %-16Rf2 = %-16R%s%6t%R %16t:%16tp1lrp1brp0lrp0brkspespssppslpcuspfpapr11r10r9r8r7r6r5r4r3r2r1r0hangupinterruptquitillegal instructiontrace/BPTIOTEMTfloating exceptionkilledbus errormemory faultbad system callbroken pipealarm callterminated@(#)runpcs.c 2.7%s: running %s: cannot execute %s: cannot open %s: cannot create cannot set breakpoint: - core dumped@(#)setup.c 2.5%s %s , object = %o, core = %o -cannot open `%s' a.outcore@(#)sym.c 2.4%.8s+%R%R%.8s+%RM:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDecUnknown error: T\f́ށ .@Lbtт (@Mcr~#Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large̢̢ ̦pace left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArold/bin/ar 755 0 33 30000 2423022074 5715  ^Юn PPՀPpPP Pd [!KPKϰϿ[KϤѬЬPРZРZj1jPPaKKK`0000K00KxK0r~U0lKK0fj~. Ϻ&ϤZjP@'ϡϥϕՕ(''''('(ЬPݠ P'׬ѬЬPРϺ' PϬ'ϩ'}''ϓ'mω%?O'PϹ<'2qϮ%ϘЬ'$1/'A'Zy%Ϥݏc ?'7'YS & PP[&ψ&ϝ& [dݏrϭ ݏ&[1PPzP)ϧ"ݏd^ ݏϔ&qPMPݏc0 p&!P1K18&ep$ϛ ݏcݏ,& %UϮPL/C% P Ϛ%~% P[ݏxϞ[%ϵ[4EPyP1Ϧ*p%ύ% ϰ#ϋ%hPI%>PݏϵPC P%%ݏP, Pϕ %P)%P6L9#d # ݏmϰ$$\PϜPݏcϿ$oPFϜ?r$ gPX$Ϯp$kP ݏl$IP $$ϣn"ϙ XI[K [K$$ [Zx[P#P`#Hx[PϿ#P`ݏqϣϒPZϿ#H!" ##ZϺ##[[|#^ Pt#ݏPσ PZ#!Px#Pϐ!ϻ zV#P^ #P-#PP߭#P ѭe"Ϧ$!O P^ϵ"τP"wσ"ϟ"ϋ  ݏψ"ϧ Pv"EPϨ"f"cϲ  Ϝ?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T3RBcHݭRP֭S}TTP/PacTeR}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R^tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[ PPYYX1XX߭ ~ PYm ~P  EЫZЫP֫`ZPѫPѬ ZPPXPZ ~PYZkn 1jЫZ3[x'1uݏ PZZ  YYX ZYYXZYZ ~6PY2kZXY 1ЬPЬ[ PʏPP@ЫZ:ZY3Z P2PPkYZ ~PY PP@ [ [[[j  Ь[Z < 7[cPZ ~YPZ ݫW ԫ kZP{ Ь[ЬZkPkPzQQPPP^߭ݬDPPPݬݏ tݬݬݏtݬ6 xP0 .(" (     PPY [ k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ  [(P YPƏPxP ^PZx PZPPPZxm ~9PZZZJ C PZP6 x7 PZPPjj ( 1xYP[P Z  k  k[P Ь[[ZZZ jPPj ^Ь[ [[PPݬRPZZ[ZP[ZPPYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP- @j( ~\S^\7 P ЬPP P`#h#p#|##er-w-s@x- r-w-sx-r-w-tx-, < L d t ar: bad option `%c' vXXXXXv1XXXXXv2XXXXXar: one of [%s] must be specified ar: only one of [%s] allowed ar: cannot open %s ar: %s cannot create <%s> ar: cannot create third temp %s ar: abi not allowed with q ar: %s cannot open ar: cannot create temp file ar: %s not in archive format ar: creating %s ar: cannot create %s ar: %s not in archive format usage: ar [%s][%s] archive files ... ar: %s does not exist ar: %s not found ar: %s cannot open ar: creating %s ar: cannot create %s ar: cannot create second temp ar: phase error on %s %c - %s %3d/%1d%7D %-12.12s %-4.4s ar write errormrxtdpquvnbail/tmp/vXXXXX/tmp/v1XXXXX/tmp/v2XXXXXM:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/Unknown error: % %*%D%T%l%v%%%%%%%%&&&&8&D&V&e&u&&&&&&&&''''6'B'U'#Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large11(5old/bin/ar11 755 0 33 30000 2423022074 6057  ^Юn PPՀPpPP P [!KNPϋKϰ;[KϤѬ5ЬPРZРZj1jPPaKKK`0000K000xK0r0U0lKK0fj~" N&aZjP@e'ϵϧϑρەϟ'ϒ'ύ'ψ'('ЬPݠt Pϗ'׬Ѭ[ЬPРw' Pi'f':''P'ώωϞ%ϱ f@ 'ϋPL&Rrb%u *Ь&|P1&&Y)%< 1&&Q% ݏc^&&WYϲώ& KP P[i&&% [ݏr ݏz&[XϓPKϬP)" ݏdϼݏ*&ϳJPϫPݏcώ&SPyϺr%a$ ݏcXݏ%OCϋ% HP F%~ύ%x P[ݏx[ψ%[ϡPP1,* %=%ϰ X#χ;%[P$϶PݏbPϖR P$ݏPϼ P%ϻ$ZP$P6m" ϩ vݏm(Ϩ$Ϙ$!ϸPuPݏco$ϻPF"?"$ P$& $Pό ݏ$ϥ<P] P#ݏP P0Ͼ#eP#PϨ! ϴϺ# P3^o#Pϑ#PP߭π#Pe>#]ς!ϕ JPTTbϣ ,#rH![ ݏd" "" "" "ݬ Z[)x[Pϐ"P`x[Pσ"P` Z[[n"ZP [Lx[PV"P`l":x[PF"P`ݏaPZF"v ωZ2[["[K; [K/"\ݏ!P"P!} #!χ [!!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  YYX ZYYXZYZ ~6PY2kZXY 1ЬPЬ[ PʏPP@ЫZ:ZY3Z P2PPkYZ ~PY PPX [ [[[  Ь[Z < 7[cPZ ~YPZ ݫW ԫ kZP{ Ь[ЬZkPkPzQQPPP^߭ݬDPPPݬݏ tݬݬݏtݬ6 xPH .D(: @(2 , /  PPY [ k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ  [@(P YPƏPxP ^PZx PZPPPZx ~9PZZZb [ PZPN xO PZPPjj8 @(, 1xYP[P Z  k  k[P Ь[[ZZZ jPPj ^Ь[ [[PPݬRPZZ[ZP[ZPPYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPE @j@ ~\S^\7% P Ь PP P###er-w-s@x- r-w-sx-r-w-tx- 0 @ X h x ar11: bad option `%c' ar11: one of [%s] must be specified ar11: only one of [%s] allowed ar11: %s does not exist ar11: cannot open %s ar11: %s cannot create <%s> /tmp/v2XXXXXar11: cannot create third temp %s /tmp/vXXXXXar11: cannot create temp file ar11: %s not in PDP-11 archive format usage: ar11 [%s][%s] archive files ... ar11: %s does not exist ar11: %s not found ar11: %s cannot open ar11: cannot create %s /tmp/v1XXXXXar11: cannot create second temp ar11: phase error on %s %c - %s %3d/%1d%7D %-12.12s %-4.4s ar write errormrxtdpuvnbaiM:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/Unknown error: $$$$$% %$%6%H%X%d%v%%%%%%%%% &&)&=&Q&b&q&&&&&&&&#Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large//<(3old/bin/as 755 0 33 122000 2423022076 5742 ((^Юn PPՀPpPP؇e3PHwE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ZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R^tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[ PPYYX1XX߭ ~PYm4~P ﰬ館 EЫZЫP֫`ZPѫPѬ ZPPXPZ ~oPYZkn 1jЫZ3[1uݏPZZ  YYX ZYYXZYZ ~PY2kZXY 1ЬPЬ[ PʏPP@ЫZ:ZY3Z P2PPkYZ ~PY PP[ [[[ Ь[Z < 7[cPZ ~9PZ ݫ' ԫ kZP{P^߭ݬDPPPݬݏ tݬݬݏtݬ6 xP.PPY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZr [PdYPƏPxPK^PZx8PZPPPZx%~9PZZZPZPxPZPPjj1xYP[PZkk[P Ь[[ZZZ}jPPj ^Ь[ [[PPݬRPZZ[ZP[ZPPYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j~\S^\7PЬPP٧P03544444444524454444444444444444445H9:,1F8-L+DI=6A7777777777CB;4<4466666666666666666666666666J4K@6>666666666666666666666666664E4G4@@     ,@, @  *@* H 2Unexpected end of file writing the interpass tmp fileRan out of memory for -V allocated temporary file.Unexpected end of file writing the interpass tmp fileUnexpected end of file while reading the interpass tmp fileInternal error: bad skip constructionIllegal character mapped: %d, char read:(octal) %oLocal labels are 0-9L%d%dName expected for a labelNAME expected"%s" is not followed by a ':' for a label definition (is the operator spelled correctly?)%.8s redefined%.8s redefined: PHASE ERRORUnrecognized instruction or directiveSTRING expectedNAME expectedCM expectedIllegal set?NAME expectedCM expectedIllegal lsymNAME expectedillegal location counterwcannot create temp %swcannot create temp %sCOLON expectedWidth not absoluteExpression crosses field boundaryIllegal relocation in fieldSpace size not absoluteIllegal expression to set originBackwards 'org'.stabCM expectedInvalid type in %sCM expectedCM expectedCM expected.stabdInvalid type in .stabdCM expectedCM expected.stabn.stabsSTRING expectedCM expectedNAME expectedCM expectedcomm size not absoluteRedefinition of %.8sexpression expectedLP expectedregister expectedRP expectedregister expectedexpression, '(' or '$' expectedregister expectedRP expectedregister expectedRP expectedregister expectedRB expectedCM expectedMore than 6 argumentsfloating number expectedIllegal registerAssembler: "%s", line %d: Divide checkDivide check (modulo)Internal error: unknown operatorRelocation errorright parenthesis expectedBad expression syntaxReference to undefined local label %dbL%d%da.outUnknown flag: %c-d[124] only-o what???More than 32 file names/tmp/asXXXXXwBad pass 1 temporary file for writing %srCan't open source file %s Reference to undefined local label %dfrBad pass 2 temporary file for reading %swCannot create %s/tmp/aaatXXXXX/tmp/abatXXXXXwBad temp file for writing extra text segments %srcannot reopen temprcannot reopen tempCaution: absolute origins. Ran out of MemoryINTERNAL ERROR: overfilled symbol table indirection tableINTERNAL ERROR: installed %d syms, should have installed %dSymbol table overflowPadding errorUndefined referenceINTERNAL ERROR: Wrote %d symbols, wanted to write %d symbols jxxx destination not a labelIllegal `align' argumentIntersegment jxxx @Too few argumentsToo many argumentsarg %d, branch displacement must be an expressionarg %d, addressing a registerarg %d, modifying a constantarg %d, PC used as indexarg %d, indexing the register filearg %d, indexing a constantarg %d, indexing with modified registerBranch too farBranch too far/115((old/bin/cc 755 0 33 21430 2423022076 5711 ^Юn PPՀPpPP PD4^@@DDTTXXP`PP1PP@P`-ZPP@PPPc11PP11IPD141 PB11P21PP@ݭD PHPcPs}+DXPЭ@'dX\ 7ݏoݭ Pݭ2)] P1TPЭ@)dT ݭ Po@1**1PPPP@5"/"J P;PcPo"P \1Fk*1=f*14Q*1+0*1"C*)*PP@PP 4  PP@17 *** ))1PP@P{1mD1rPP@ޭPѭPy 1Cx)[ PP@X)R)P`B)1=) PP@))P`)1(PP@i( 1PC1&1 PI1PE1Y1PO1&1PU1PS11PW11Po1,Pf1CPd1P1Pg11{Pt1Pp11^P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1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R^tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[ PPYYX1XX߭ ~JPYm~P  EЫZЫP֫`ZPѫPѬ ZPPXPZ ~PYZkn 1jЫZ3["1uݏPZZ  YYX ZYYXZYZ ~vPY2kZXY 1ЬPЬ[ PʏPP@ЫZ:ZY3Z P2PPkYZ ~ PY PP|[ [[[ Ь[Z < 7[cPZ ~9PZ ݫK ԫ kZP{tP^߭ݬhPPPDЬ[ЬZ[Y[YPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6 Px.#j#b\_MPPPYA[Fk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [#PYPƏPxP^PZxPZPPPZx~9PZZZPZP~xPZPPjjh#\1xYP[PIZB:=k.'k[P Ь[[ZZZ jPPj ^Ь[ [[PPݬRPZZ[ZP[ZPPYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPu@jp~\S^\UPLgЬ7PЭRBQP PbPbլQP P$$/usr/old/lib/ccom/usr/old/lib/c2/usr/old/lib/cppp"Would overwrite %s(Warning): -P option obsolete -f overwrites earlier option/lib/f12/lib/crt2.o/lib/crt20.oToo many DIUC options-t overwrites earlier option012p-B overwrites earlier option/usr/c/oToo many source filesToo many object/library files012p/usr/c/ccomc2cpp/lib/fmcrt0.o/lib/fcrt0.o/usr/old/lib/mcrt0.o/tmp/ctm%05.5dar%s: cpp-ccom-XP-Xg-Wc2as-o/usr/old/bin/asld-X-o-lg-l2/usr/old/lib/libc.a-l/usr/old/bin/ldCan't find %s Try again Fatal error in %s no space for file names/usr/old/lib/crt0.o00#4usr/old/bin/asld-X-o-lg-l2/usr/old/lib/libc.a-l/usr/old/bin/ldCan't find %s Try again Fatal error in %s no space for file names/usr/old/lib/crt0.o00old/bin/f77 755 0 33 31054 2423022077 5733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WPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R^tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[ PPYYX1XX߭ ~:PYml~P  EЫZЫP֫`ZPѫPѬ ZPPXPZ ~PYZkn 1jЫZ3[21uݏ!PZZ  YYX ZYYXZYZ ~fPY2kZXY 1ЬPЬ[ PʏPP@ЫZ:ZY3Z P2PPkYZ ~PY PP [ [[[* Ь[Z < 7[cPZ ~YPZ ݫo ԫ kZP{ Ь[ЬZkPkPzQQPDP^߭ݬlPPPPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6 P . 4 4 PPY [ k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZb  [4PT ((YPƏPxP; ^PZx( PZPPPZx ~9PZZZ  PZP x PZPPjj 4 1xYP[P Z  k  k[P Ь[[ZZZm jPPj ^Ь[ [[PPݬRPZZ[ZP[ZPPYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP @j ~\S^\O P 3Ь PլQPi PP111112111111222--csystem=unix -x,"-@-T--X-u_MAIN__bad option -T%cinvalid flag 6%c qxscninvalid flag -N%c onetripinvalid flag -I%c %s %s >%sefl %s %s >%sratfor %s %s >%s%s: cc -c %s-o%s %s %s %s %s %s Error. No assembly. compiler error. PASS2.%s <%s >%s%s %s %s/usr/old/lib/c2mv %s %scat %s %s >%s ASM.cat %s >>%s%s -o %s %sassembler error -oLOAD.%s couldn't load %s %s /usr/bin/rawCannot load %sNo shell!%s: too largebad wait codeTermination code %drError: Cannot read file %s writing errorxsadSopzAfort%d.%scannot open intermediate file %sout of memoryCompiler error in file %s: %s Error in file %s: %s sort %s >%scall sort status = %dra.data 2%s: overlapping initializationsbad intermediate file formatbad intermediate file formatinitialization out of bounds FORTRAN 77 DRIVER, VERSION 2.00, 7 JANUARY 1980 -lF77-lI77-lm-lc/usr/lib/f77pass1/usr/old/lib/f1/usr/old/bin/as/usr/old/bin/ld/usr/old/lib/crt0.o/usr/old/lib/mcrt0.om4/bin/sha.out.byte 0%o,0%o %s .space %ld %s:  AAAAAABBBBBB @8@84@<%s:  AAAAAABBBBBB @8@8old/bin/ld 755 0 33 37064 2423022100 5721 48Ј^Юn PPՀPpPP;!P4 Ь[2kZkZݬ ݬݬ( Ь[ZExZZk9 k0kP0P*kfka kPWPkFkA kP7PPZ[kZPݬ ݬݬ*(^;4f;4];4T;4K;4.;"k4PP~ ;$;}3^ЬP`;p3P"(PJ(Ѭ ,3X&6PۮPܮޮ[1-6h:&_ЈYi-1ZJi1JiPPA9#tttttttttttttt"ttt}tttttttttttttttt`tttgtt:1f[9Ј9Z1@[9݈bPJieﮭ[9E9p݈#P[9J93ؾ8݈!1@[9ԭխh4Pട Pխݬ[NݭV h[X1[!9݈bPDP 9jЭ*1[8K 84݈P1GZJi-JiZY~GJio1!}1xv1 qW17171T1O1&1E1Y[[1ݬݬ /^w2 ݏ2PP8 X 6[1ЈY}Y7"i-1Z11PAmv1PTV1PDhP/PРQ֠a,[X ݈[ZJi\JiPPl1sZ-JiZY~9PHPePu PoPvYY [[1-4P@[Ьk̩ϩPPPi5Ь hd `$\(X,T0PLH4P@r[dЫ4ЫЫЫ ЫЫ Ы$ܺЫ(غЫ,ԺЫ0кxPPPZYY2 P@YZZ֨^Ь[[P#MX -)ݭPE PP .mg>59$" 9~r9̹,P331K5ﮟ$PݭP PP ݬ#&"=363P %4l4C ~PЬ22P^2ԭ1 P@_8PtнЭPe P@/84 PA PAP PA֭凌PѭP֭ѭ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Q`aЭP׭PZ[xYPZPP[xYPZP[PP @j ~\S^\7 P Ь PPyP@(#)ld.c 1.10 78/12/07 15:34:58Premature EOF__.SYMDEF\@b@c@d@e@l.outa.out%s: Bad output fileBad 'use' or 'entry'-H: arg missing-H: too late, some text already loaded-A: arg missing-A: Only one fundament file allowed-v: arg missing-D: arg missing-D: too small-T: arg missing-T: too late, some text already loadedbad flagMemory overflow%s: fast load buffer too smallout of date (warning)load1 called on %s because of %s _end_data_etext_edata_endUndefined: %.8s %.8s: Multiply defined (internal)wcannot create output/tmp/ldaaXXXXX/tmp/ldbaXXXXX/tmp/ldcaXXXXX/tmp/lddaXXXXXEntry point not in textwCannot create temp fileinternal error: symbol not foundLocal symbol overflow%.8s: Multiply defined!-r; see JFRDisplacement overflowa.outl.outa.outa.outrcannot recopy outputloader error; odd offsetNo pages/usr/old/local/lib/libxxxxxxxxxxxxxxx-la/usr/old/lib/libxxxxxxxxxxxxxxxcannot openSymbol table overflowMemory overflowld:%s(%.14s): %s Local symbol botchBad magic numbertsize=%X dsize=%X Text/data size oddBad formatl.out/Aemory overflowld:%s(%.14s): %s Local symbol botchBad magic numbertsize=%X dsize=%X Text/data size oddBad formatl.out/old/bin/lint 755 0 33 771 2423022100 6223 ((L=/usr/old/lib/lint T=/usr/tmp/lint.$$ PATH=/bin:/usr/bin O="-C -Dlint" X= P=unix LL=/usr/old/lib trap "rm -f $T; exit" 1 2 15 for A in $* do case $A in -*n*) P= ;; -*p*) P=port ;; esac case $A in *.ln) cat $A >>$T ;; -l*) cat $LL/llib$A.ln >>$T ;; -[IDOU]*) O="$O $A" ;; -X) LL=/usr/scj/lint L=/usr/scj/lint/lpass ;; -*) X="$X$A" ;; *) (/lib/cpp $O $A | ${L}1 $X >>$T)2>&1 esac done case $P in unix) cat $LL/llib-lc.ln >>$T ;; port) cat $LL/llib-port.ln >>$T ;; esac ${L}2 $T $X rm -f $T "old/bin/ln 755 0 33 20000 2423022101 5712 ^Юn PPՀPpPP P l^ԭxt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ln: %s is a directory %s/%slnUnknown error: ,<T^x ,>M]l}*=#Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large old/bin/lorder 755 0 33 635 2423022101 6544 trap "rm -f $$sym?ef; exit" 0 1 2 13 15 case $# in 0) echo usage: lorder file ... exit ;; 1) case $1 in *.o) set $1 $1 esac esac /usr/old/bin/nm -g $* | sed ' /^$/d /:$/{ /\.o:/!d s/:// h s/.*/& &/ p d } /[TD] /{ s/.* // G s/\n/ / w '$$symdef' d } s/.* // G s/\n/ / w '$$symref' d ' sort $$symdef -o $$symdef sort $$symref -o $$symref join $$symref $$symdef | sed 's/[^ ]* *//' /( ,( 5X /\@,\D"((old/bin/nm 755 0 33 22000 2423022102 5716 ^Юn PPՀPpPP Px^׬1ЬPРP`-ЬPРPnмP`PPgB<[UNHЬP~fnϥ#ϜϞϔ9 ϏϑּмP`׬լЬP,Ь16ݼ# @1#ЬP`NPρP|PNEe1Ov@!ѭ ݼϱԭ" y1~ sh ]Ϸ R18ϩ1hϛϐ υz o ݼ1b[PjPiPF  ; ݭCj(OPZ#PмPP{ϲ1v[i߭[ϣOխ }[PxP~ݭPPݼτ$[ϴޭPx[QQ(`a[ZJ0[ݭ48ѭ"0&(PмPP8Z1xZPPYӏY11. ݼϚPмPP~xZPP ~xZPP ~xZPP~xZPP~xZPPݠ ϣ;1ˏYPP'P9P:P;PìPíQPQݬY~Э1ݭݬY1[YݭZ/YЭZ14^Ь[ЬZkYjY׭^Ь[ЬZЬ Ykij׭^Ь[ЬZԭլ05Ьj ЪP֪`P ZoPYY׭֭ѭ ЭP^Ь[ЬZԭլ16ЬYjЪP֪``P Z~ Y ֭ѭ ЭPЬ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QnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R^tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[ PPYYX1XX߭ ~RPYjP ~P ii BЫZ֫ZPѫPѬ ZPPXPZ ~PYZkn 1mЫZ3[1xݏPZZ  YYX ZYYXZYZ ~PY2kZXY 1ЬPЬ[ PʏPP@ЫZ:ZY3Z P2PPkYZ ~PY PP[ [[[  Ь[Z < 7[gPZ ~9PZ ݫ+ ԫ kZP}P^߭ݬDPPPTDݬݏ tݬݬݏtݬ6 P .PL~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [LPYPƏPxPgbPZxTPZPPZxD~@PZZZ!PZP xPZPPjjL1xYP[PZkk[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j~\S^\PЬPЬPЬRRQ{RPPR PRPPЭRBQPdPbPbլQPedP__.SYMDEFrranlib: cannot open %s not archive: %s ranlib: %s-- no name list wcan't create temporary /usr/old/bin/ar rlb %s %s %s /usr/old/bin/ar rl %s %s can't execute %s symbol table overflow can't reopen %s /bin/shsh-cH <!)p3 ;DB KU _h p x        `   ( 8d!) 08,AGM~<Sr\ ha f j n s X{  x| || o| |.ptNDe8k[F Fz u(|"+4: @ GN;U^Lf~ oHy.  |f8?z     , 3 |y  d7( -2crt0.oexitranlib.ofseek.oftell.ofprintf.ofopen.ordwr.ofilbuf.ostrncmp.ostrncpy.osystem.o_exit.oexecl.oexecv.oexecve.ocreat.osignal.olseek.otime.osprintf.odoprnt.oflsbuf.oexit.odata.oclose.oisatty.oopen.oread.ostty.oioctl.ounlink.omalloc.osbrk.oudiv.ovfork.owait.owrite.ocerror.o_exitstart_main_environ_arp_exp_fi_fo_off_oldoff_tab_tnum_new_tempnm_firstname_offdelta__iob_fprintf_fopen_fread_fseek_nextel_fcloseudiv_fixsize_fwrite_sprintf_stash_system_fixdate_unlink_ftell_strncmp_strncpy_open_time_lseek_write_close__filbuf_fflush__doprnt__lastbuf_creat_errno__flsbuf_malloc_read_vfork_execl__exit_signal_wait_execv_execvecerror_ftime_isatty__sobuf__cleanup_free__sibuf_gtty_stty_ioctl_sbrk_realloc_end_brkite.ocerror.o_exitstart_main_environ_arp_exp_fi_fo_off_oldoff_tab_tnum_new_tempnm_firstname_offdelta__iob_fprintf_fopen_fread_fseek_nextel_fcloseudiv_fixsize_fwrite_sprintf_stash_system_fixdate_unlink_ftell_strncmp_strncpy_open_time_lseek_write_close__filbuf_fflush__doprnt__lastbuf_creat_errno__flsbuf_malloc_read_vfork_execl__exit_signal_wait_execv_execvecerror_ftime_isatty__sobuf__old/bin/sdb 755 0 33 135414 2423022106 6116 (('^Юn PPՀPpPPا%(P ݬ ݬ P[~pxPPPP[[P^ݬP[~OpxPPPPP~-pxPP˭ P˭[QQP[[ݬh^ЬP@[~oxPPPPP~oxPP˭ P˭[QQP[ЬP[@ݬ ݬݬݬݬ ^ 2~ݬݬ ݬݬլPPPլ Py1 PP PPPݬݬ2C~2~OP&!Pݬݬ2~2~. :*P*PPﵹЭPԭݬ \~iP1B 2չP2יּPPݬ2P~*nP-߭2~\~2~P 1v1jЬ[2ZZ RP)PPYZݩikIP9ݩݩ k6Pé P#Z N)P-)PPɸPiPPkPѬ Ѭ PPݬݬP[l[PݬݬPP լ ~Ь ZZ1TЬPՠJݏ PPЬQPPЬP ֟ЬQPԼЬPՠPЬPՠZ PЬPРQ֠a֬ЬPנּZά Ь Z1ռ1ЬP P[ЬQQPQ)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y11CP!1V1wP-1 P+11bP/11WPD1(PB1 P?110PC11!PM171PV1,PS1sPR11PT11PY1PX1(1Pa1"1Pp1fPg1[,Pd1Pc11sPe1z1dPl1Pk11GPm118Pt15,Pr1Pq11 Ps1|1Px1SPw11Pz1$1PPPpPwPz.kﵙ[G [ X+c[j7E.ɗ^P)P 1 4 ,}~ЬZ[jk ~PPqpmɘݬJ<[[[&Pݬmk fd_[[@5+[['PБk  ^[ [[Vݏmҗ[Pwﵗ߭,P ߭i d[ԆWI4цKl9[P``P~SzP Ь[|זY[YYZmᅱAZZ[[ﮖ[Z ZZY[PPPPPPHYy^Pԭ @֭ѭ 8ЭP^Pԭ֭((ѭЭP^聾GPԭylユ ֭ѭЭP ^2ZЬ[Џ|Џu jnn#ݫ%GP'Z2ZZ[ZرZЫaZЫX&Z$Ы Y i/~xZ-߭zPizЭ﨟߭׉HzP#﷉שּWiKACLPFzoPPnnPʑn܃ P PGyPPݏhPت}nO,mj whm&yZ]Ix< J(h֐5hcDP#P؝~D~g<ggD:g7-tgĐz1-ݬm"/gklCﴜkbad modifierno breakpoint setno processtext address not founddata address not foundtoo many breakpointswait error: process disappeared!process terminatedtry againbkpt: command too longbad core magic numberX-_-i-n------------hangupinterruptquitillegal instructiontrace/BPTIOTEMTfloating exceptionkilledbus errormemory faultbad system callbroken pipealarm callterminated kPZЬ[[ Zx0PPk ZxPZ{X[akЬP8[Ï4[P PQPA [k ^Ь [kPPѠX[~;|deAЬ=[[ K>P@Yi BdYZ1S2PЏ@e ,1jjPxPPPP#ݬ̦P@Pﲦ1i1ѭ+ѭ %ݭݭ>XPޭxP@2PxPPPP2PP .C:XOA81gݽ:c1$ݽ~1A-@ݽ~1,*+ѭB%$ 12jPxPP PP1qݽ~1*ݬPPPP2PЭ@ɤѭB K2P2QPA~ݭ2P@vP1ZѭB11J*BԭݬPhPڤݬѤPEP﷤191.*ݬPPxݬoPPUݬLsPP2ݬ)PPP12P2@_jPP jPP2P@| 2~|`Z2PQPQ1[[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 ~PYZkn 1jЫZ3[1uݏPZZ  YYX ZYYXZYZ ~RPY2kZXY 1ЬPЬ[ PʏPP@ЫZ:ZY3Z P2PPkYZ ~PY PP[ [[[ Ь[Z < 7[cPZ ~9PZ ݫ' ԫ kZP{PP^߭ݬTPPP Pݬݏ tݬݬݏtݬ6.PPYu[zk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ6 [P(YPƏPxP^PZxPZPPPZx~9PZZZPZPxPZPPjj1xYP[P}Zvnqkb[k[P Ь[[ZZZAjPPj ^Ь[ [[PPݬRPZZ[ZP[ZPPYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j~\S^\PgЬkPЭRBQP.PbPbլQPa.PЬPЬRRQ{RPPR PRPPЬPЬRRQ{RPRPPPRRPaccess(mode=%d,adr=%d,space=%d,value=%d) with pid %d ptrace(%d,%d,%d,%d) = %d with error=%d /?Too many numbers"+-=!/BCDMQRSTXabcdegklmpqrstwxzVXY"+-=!/BCDMQRSTXabcdegklmpqrstwxzVXYToo many procedure calls"+-=!/BCDMQRSTXabcdegklmpqrstwxzVXYabcd"+-=!/BCDMQRSTXabcdegklmpqrstwxzVXY+-?MacersToo many variable names.?formaddr(%o, %d) Bad class in formaddr: 0%oStackreg error: frameStackreg error: contentsUnexpected null variable name*->.[->.[->.[_BLNK_%s not an active procedure %.8s:%s not found %s not found ddchddldfgddddbuhuuludsPTR %d; FTN %d; ARY %d; DESC %s xpPTR %d; FTN %d; ARY %d; SIZE %d; STSIZE %d <%c> No breakpoints set ? No breakpoints set 0x%x ()%s__dbsubc%.7s(%.8s(%d%.8s=,) @ 0x%x [%s:%d] %sInvalid command (1)Unexpected null command ? map/ mapl T Bad arguments%.8s() in "%s" Can't find %s %.8s() in "%s" "%s" 0x%x/ 0x%x/ calling dopcsexiting dopcsCannot set temporary breakpointcalling dopcsexiting dopcsBreakpoint at Not stopped at breakpointBad addressBreakpoint at Procedure killed Cannot set breakpoint b Non existent breakpointAll breakpoints deletedstopped with value %d iUnknown addressxxUnknown variable.-Bad line number%s: No lines in file No lines in file%d: Not that many lines in fileNo lines in file-w`%s' does not exist Warning: `%s' newer than `%s' /usr/btl/katseff/sdblog/XXXXXXSdb restarted *Error; try again cmd %c: %s:%s args-%s;re-%s;integ-%d scallf-%d;reflg-%d colonflag-%d;ncolonflag-%d Illegal floating constant@(#)opset.c 2.40x%04.4x%s [%s]%s(%s)(%s)+$%s$%d %d: %c%s%s%s+acbbr00.5%r%Rp1lr%d: killed%x*%.8s:%.8s%.8s:%.8s%s->%s Not with a register variable->.[%.7sddot=%d extstart = %d firstdata = %d %s offs %d @ %d flag %d addr 0x%x %8.8s addr 0x%x; offs %d; sfptr %d; line %d entrypoint dispx(addr=%d,desc=%s,class=%d,type=%d,size=%d,subflg=%d,space=%d) Illegal descriptor: %c Bad register var %d %s0x0%.13g%s:%d%s/ = ^%c^?%c%s `%s' -b1 = 0x%-16xe1 = 0x%-16xf1 = 0x%-x b2 = 0x%-16xe2 = 0x%-16xf2 = 0x%-x %4.4s/ %4.4s/ dUnknown register variable0x%x (): :  @No matchRE error RE botch  continue %x %d BPT code; '%s'%o'%o'%dReturning from runpcs Entering endpcs with pid=%d About to doexec pid=%d About to open symfil = %s %s: cannot execute %d %s exbkpt: %d <> <> %s: cannot open %s: cannot create <> About to exect(%s, %d, %d) %s, Returned from exectcannot set breakpoint: %s:%d @ %d Waiting for pid %d Ending wait w = %d; pid = %d; stat = %o; - core dumpedPC = %d, dbsubn = %d _dbsubn_dbsubnX^%s -cannot open `%s' a.outcore%s .[->hex conversion errorUnknown variable: %s -%d0x%x%-12d0x%-12x%.7s%.8s:%d+ &(@`sdbBad N_SO entry (1)Bad N_SO entry (2)Warning: `%s' not found Warning: `%s' newer than `%s' sdbWarning: `%s' not compiled with -g Bad file array*slookup(%s,%d) *globallookup(%s,%d) No core image 0x%x in %.8s:%.7s: address 0x%x %.8s: address %d MAIN_mainBad N_SO entry (1)Bad N_SO entry (2)getaddr() computed offset %d extaddr computed %d and addr %d Bad common blockMap `?' or `/' must be specifiedVersion 2.6 - February 1, 1980Breakpoint at Cannot find %s _dbargsProgram not loaded with -lgUnterminated string constantToo many string constantsUnexpected character %c _dbsubcInternal error - cannot find _dbsubcBreakpoint at Too many argumentsmain%s %s %s %s cCsS_dbsubndProcedure returned normally Bad command: %cUnknown error: (@JdvƸظ *9IXi}ع )#Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large/bin/shsh-c deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large/bin/shsh-cold/bin/symorder 755 0 33 22000 2423022106 7154 <^Юn PPՀPpPP PX^ԭԭѬϝϕЬPݠmPY ϾtЬPݠ`x[VF  FFkV[֭Y߭PYsЬPݠPY `ЬPݠϣЬPݠ"P 8KЬPݠoY XP ϠЬPݠ;όV FϏX VFσF|ЬPݠ[S`\XtpPPX XXWXYϗhխ18ѭY߭XP ϋrЬPݠϖWԭѭVxPxQQPFF`1VxPxQQPՠ xPxQQP xPXPPVPYY߭ϽP χVݭ߭ݭFP W~ݭ߭ݭP ϳYhWY]֭1֭1 ѭFí~ϏGV)xPxVQQPՠ xPxVQQP~tVV ^ЬP ЬP 1Ѭ nՠi dмZЬլ  ~ PPZPPZZ)ѭZ#ЬPPQáPѭPQP­P[[ݬ [~ЬP ~PԼ[M׼ЬP֠P`P7ݬ+ЬP "P ݬ ݬЬP ~WPѭPPݬ \~ݬЬP PPЬ [ЬY׬&k ЫP֫`P [,PZZZ Z YPЬPЬ[YYPY kwݏݬvRka@ݬ PZݏݬDPZZZPݬ PZZiZ kr  YPh $[xP@[ݬPZZݬ[P[((\~ݬPP^Ь[ЬZԭլ05Ьj Ъ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PP}@jx~\S^\7]PTЬ?PP)P Usage: symorder orderlist file rCan't open rCan't open Can't update Can't read Bad Header on %s Short file Read err on 2nd sym write1write2%d Syms not found: %.8s Unknown error: px (:J\h~&5D\i#Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too largeφ HݏJϷHϦ5ϾJPP ?P!NPd1Pn(PqPs?Pw6֭1]5uK`88J4bJx,r>1eJϗ"DJ =J S>2Jω7)J֭P@EG֭P@5Gݭ+PЭPЭQA`>ݭPϦIPݭ1ϘIϘIϏIL4ςIC41Ϗ4üP^Ͼ==PYIo=r[4#IoJ6Ϗ=bJϝ6Q'II IP @H0߭3JH!P1Ld&LPЭ@ώJLHP L#=ϕ3<K\Jϣ^ݬHϿЬP 1ϭHυHϥHόϜHψHtHϐH ѭЭPyHQxPPP`׼PЬQ֡QPaݬ~Ϟ12PxPPP׼PЬQ֡QPaݬ~g1֭1~^ ݬG) ЬP֬`߭iPCϡ4Ϛ4ݭ;ݭ3<<o*< <`*y2 ϏGݭ788 zGݭϒ4P ;ρE<=2^ԭ GìPíQPQݬY~Э1ݭݬY1[YݭZ/YЭZ14^m%Ь[ЬZkYjY׭^I%Ь[ЬZЬ Ykij׭Ь%ŏmNA%P90P%P^Ь[ЬZԭլ05Ьj ЪP֪`P ZCPYY׭֭ѭ ЭP^Ь[ЬZԭլ16ЬYjЪP֪``P Z~Y ֭ѭ ЭPЬ[[ ~ kЫ0 \~ݬq%J \~ݬݬ5^Ь[A[[ԭ֭ \~ݬ߭^Ь[Ь Zԭԭ1+ЬP֠P`P1MYY%10ԭY* ZZYԭ PYP0PYI#խ20uYlԭ蘋YYhY[ [ P[I# YYP߭ݬݭݭY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Pr1TPP*1CP1(null)XPZPЌRR:PbQURQpPPoPxPdHPu1[~RS T RSTSVQЌPRSPQAVRe;0Tn n8 n;  ~Z0nݭQUUYPPZPPPQU1ilPP n4 n  n錪  nPUP^QZ1Z1ZZZZ IiY>IY HhX>HXZ1VXZZ1KЌXЌ\Ќ[10ZXXWWVWWWWPPnW3PWPP#VWP֭WP-WxWP@(RnVЭPPX'(AcխXVVVV()cXP%VVX8Wn 1GDeB+B+D.@0RVQPVPQ'խQRVPЎPR QPVPRPQQPRQPRPc0XZXXPPnX.PXPP֭XPP/XxXP@ZlxXPSPQXWQPQ`WWѭ+WPP!PЭWXWPPXWn4WníWX1XWPPXWn4WnWX(nVXP08Xn ׭n8ne QZ+Q; ?a1AZ11pUorUU((UR>B€R R RZqPURRRRR dUR R8tPTUPUP  tpUPUP  PpPT~/SRRRRTRdcPSTRgPPRRT BCG@M [u+pЬZЬ[ЬY1Y~ZiЩP֩``P Yݬr֬ լ  & */ #ifndef makedev # include #endif struct psout { dev_t o_ttyd; /* u_ttyd */ int o_flag; /* p_flag */ short o_pid; /* p_pid */ char o_tty[2]; /* 1st 2 chars of tty name with 'tty' stripped, if present */ char o_stat; /* p_stat */ short o_uid; /* p_uid */ char o_uname[9]; /* login name of process owner */ short o_ppid; /* p_ppid */ char o_cpu; /* p_cpu */ float o_pctcpu; /* ??? */ char o_pri; /* p_pri */ char o_nice; /* p_nice */ short o_addr0; /* p_addr[0] */ short o_size; /* p_size */ caddr_t o_wchan; /* p_wchan */ time_t o_utime; /* u_utime */ time_t o_stime; /* u_stime */ time_t o_cutime; /* u_cutime */ time_t o_cstime; /* u_cstime */ short int o_pgrp; /* p_pgrp */ size_t o_dsize; /* p_dsize */ size_t o_ssize; /* p_ssize */ size_t o_rssize; /* p_rssize */ char o_time; /* p_time */ char o_slptime; /* p_slptime */ unsigned o_stksize; /* computed - size of stack */ int o_minorflt; /* u_minorflt */ int o_majorflt; /* u_majorflt */ short o_aveflt; /* p_aveflt */ char *o_text; /* p_textp */ size_t o_swrss; /* p_swrss */ size_t o_xsize; /* xp_size from text.h */ short o_xrssize; /* xp_rssize from text.h */ short o_xswrss; /* xp_swrss */ short o_xccount; /* xp_ccount */ int o_sigs; /* sum of SIGINT & SIGQUIT, if == 2 proc is ignoring both.*/ char o_comm[15]; /* u_comm */ char o_args[64]; /* best guess at args to process */ }; omputed - size of stack */ int o_minorflt; /* u_minorflt */ int o_majorflt; /* u_majorflt */ short o_aveflt; /* p_aveflt */ char *o_text; /* p_textp */ size_t o_swrss; /* p_swrss */ size_t o_xsize; /* xp_size from text.h */ short o_xrssize; /* xp_rssize from text.h */ short o_xswrss; /* xp_swrss */ short o_xccount; /* xp_ccount */ int o_sigs; /* sum of SIGINT & SIGQUIT, if == 2 proc is ignoring both.*/ char o_comm[15]; /* u_comm */ cold/include/symbol.h 644 0 33 160 2423022122 7654 ((/* * Structure of a symbol table entry */ struct symbol { char sy_name[8]; char sy_type; int sy_value; }; */ int o_majorflt; /* u_majorflt */ short o_aveflt; /* p_aveflt */ char *o_text; /* p_textp */ size_t o_swrss; /* p_swrss */ size_t o_xsize; /* xp_size from text.h */ short o_xrssize; /* xp_rssize from text.h */ short o_xswrss; /* xp_swrss */ short o_xccount; /* xp_ccount */ int o_sigs; /* sum of/( ,( 58 /\@,\D"old/include/unctrl.h 644 0 33 117 2423022123 7661 # include # define unctrl(ch) (_unctrl[ch]) extern char *_unctrl[]; char sy_type; int sy_value; }; */ int o_majorflt; /* u_majorflt */ short o_aveflt; /* p_aveflt */ char *o_text; /* p_textp */ size_t o_swrss; /* p_swrss */ size_t o_xsize; /* xp_size from text.h */ short o_xrssize; /* xp_rssize from text.h */ short o_xswrss; /* xp_swrss */ short o_xccount; /* xp_ccount */ int o_sigs; /* sum of/( ,( 5H /\@,\D"old/lib/ 775 0 33 0 2510247416 5275 old/lib/c2 755 0 33 56000 2423022473 5630 P\^Юn PPՀPpPPOmPLI ZЬ[[[[rWPPpW5ݏKPݏPݏT)=I9W1WZ[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bisb2qbisb3bisl2sbisl3bisw2rbisw3bitbbitlbitwblbsblbcbleqblequblssblssu bneqbnequbrbbrwbvcbvscallg calls caseb"casel"casew"clrb clrd clrf clrl clrq clrw cmpbcmpdcmpfcmplcmpwcvtbdQcvtbfAcvtbl1cvtbw!cvtdbcvtdfEcvtdl5cvtdw%cvtfbcvtfdTcvtfl4cvtfw$cvtlbcvtldScvtlfCcvtlw#cvtrdl5cvtrfl4cvtwbcvtwdRcvtwfBcvtwl2decb decl decw divb2qdivb3divd2udivd3divf2tdivf3divl2sdivl3divw2rdivw3extvextzvincb incl incw insvjmpmcombmcomlmcomwmnegbmnegdmnegfmneglmnegwmovab0movad0movaf0moval0movaq0movaw0movb movd movf movl movq movw movzbl)1movzbw)!movzwl)2mulb2qmulb3muld2umuld3mulf2tmulf3mull2smull3mulw2rmulw3pushab1pushad1pushaf1pushal1pushaq1pushaw1pushlret!sobgeq+sobgtr,subb2qsubb3subd2usubd3subf2tsubf3subl2ssubl3subw2rsubw3tstbtstdtstftstltstwxorb2qxorb3xorl2sxorl3xorw2rxorw3movc34.globl.text$.data%.bss&.align'.word*.long2.set3.end(rsb5jsb6mfpr7mtpr8prober9probew:adawiaddp4addp6adwcashpbicpswbispswbptbsbbbsbwchmechmkchmschmucmpc3cmpc5cmpp3cmpp4cmpvcmpzvcrccvtlpcvtplcvttpcvtptcvtpscvtspdivpeditpcedivemoddemodfemulffcffshaltindexinsqueldpctxloccmatchcmovc5movpmovpslmovtcmovtucmulpnoppolydpolyfpoprpushrreiremquerotlsbwcscancskpcspancsubp4subp6svpctxxfcescdesceescfZ,Q,PЬ[Ь ZZ kwݏݬEka3ݬs PYݏݬfPYY~ݬ@ PYYPY kr  ZPݬ \~ݬЬP PPP\~ݬPPЬ[ P ݏ P ի ߘ P@ Ы[S 8  P2PPݫ ~= Pkkk  k1aЫP֫`PЬ[ի ݫ Ь Ыk ^BЬ2߭ \~ݬ׭ЭP֭``P ߭?ЬP  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T3RBcHݭRP֭S}TTP/PacTeR}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R^tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[ PPYYX1XX߭ ~PYmL ~P  EЫZЫP֫`ZPѫPѬ ZPPXPZ ~_PYZkn 1jЫZ3[T1uݏPZZ  YYX ZYYXZYZ ~PY2kZXY 1ЬPЬ[ PʏPP@ЫZ:ZY3Z P2PPkYZ ~PY PP [ [[[  Ь[Z < 7[cPZ ~9PZ ݫ ԫ kZP{P^߭ݬDPPPݬݏ tݬݬݏtݬ6x .8U 4U PPY [ k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ  [4UP YPƏPxPs ^PZx` PZPPPZxM ~9PZZZ* # PZP x PZPPjj 4U 1xYP[P Z  k  k[P Ь[[ZZZ jPPj ^Ь[ [[PPݬRPZZ[ZP[ZPPYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP @j ~\S^\7PЬPPP@(#)c20.c 1.32 79/09/15 10:41:03@  ' ` 5 @B.long (Optimizer: out of space rC2: can't find %s wC2: can't create %s %d iterations %d jumps to jumps %d inst. after jumps %d jumps to .+1 %d redundant labels %d cross-jumps %d code motions %d branches reversed %d redundant moves %d simplified addresses %d loops inverted %d redundant jumps %d common seqs before jmp's %d skips over jumps %d sob's added %d redundant tst's %d jump on bit %d field operations %dK core ? %s %s %s%c.text L%d:%s:%s %s%cL%d mova%c L%d,%s bwlq.long L%d L%d: .word L%d-L%d @(#)c21.c 1.74 80/04/07 22:18:11  %d: %s - c2: zero divide fp(fp),fp(fp)mcount%d: %d%d %s - $0$0-(sp)-(sp)%s,%s$%d,$%d,%s,%s$1$0  AAAAAABBBBBB `X`X0U\kold/lib/ccom 755 0 33 252000 2423022476 6266  D^Юn PPՀPpPP P@!"-%L^?M ;AGIK_H \/2Z')BC@EF<=S]1367:[NR abeDJ>ZVX`+049#(* [Z8 dgszTW5cfhijmnoptuvwyY|qrxl{}~kݬ ݬݬ!Z2222#22*922G>vv..222:2h2222222222FW2& o 2222 # 0 H  X l 2>2    1  EEEEEEEEQh 2p5:R`o]v1K4,)T2iP2@ PP2PX,X%2XP2@P@2XP2@Z1`2iP2@ XYWPYP1Z1Ymm1!mPPPkݫDPM%kPP@m/1m qSa,1~m1Nup1a]m1{aBma1f4ma1XPAm1;PA1$kPݠЫPݠDBЫQPa1kl1kPݠЫPݠBЫQkPݠЫPݠЫPݠAЫQPaл1ݫZ/1mk-PAA1{ݏP.PA1[kk-1Ikzݫݫk#-1kݏ((.P@F1ݫkk01k kePPk9GPBPkAP"F}1tHkkݫzAP"1Ы @1Qkkݫm ek k@Kkɏ@k~ݫݫAPH"?1  ݫݏkjz=k M1~ݫݏHݫ6ի ~ݫݫkЫ$?1i;j ݫPݏH1ݫXP@j1P x1k01ikݫ?PkP.!kPݠ21kݫ?Pa>1iBPkݫ?P 1kj7=61xkW71l:1bO1R:1Hik iihhEP`@P`/1hhh(he E3}rk1ݫe1wѫݫ-l1YV k V lVU PH1UkU ݫYPݫݏLjGPݏm[GP`dUkuUpkkUի ݫ&dݫRjP{3 PQ1Ь[[ [~  Z PKg P ^ԭB uP^[1SKZj- ZjX1KP`-1/ЭP֭PPѭ1j1P1|Pe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Qeլ 12ݏIݬ լ1P1լÏP[P@9м[Ь  ЬPѰ1РPՠЬPРP[PPP 111111w1[YQPPPPP[ЬPаP@  ЬPݠc ЬPݠSݏIݬ[= ЬPݠ/ݏIݬ ЬPݠЬPЬ ݬլ ݏIݬ +ݬQ5լ  #Ь PPZZݏЬPݠݬ ݬЬPݠ լ  Zs#aլ Q#ЬPPZݏZЬPݠݬ ݬЬPݠլݬݬ ЬPݠЬPݠaݬ ݬЬPݠrլ  "Ь PPYլ "ЬPPX"PZPݏЬPݠ'YXЬPРPݠZ~"ݬ ݬЬPРPݠլ XX"լ  YJ"ЬPa1ЬPѠ1Ѡՠլ1ݏIݬլ 1ݏIݬ P1~PPP1P1s1PP1PL11PQ11PV1&PT PS1\PU11MPX1 PW13PY1l1$vpPP  e8м yVѬЬP׬P YnVмP@וݬCSVмPPdP_P^?P_MPb]PcTPdKPfBhV1ЬPРP@ؗ:ԗUݬ(ЬPݠﶗUЬPݠ𧻓U益UЬPݠ9}UЬPѠ 1_ wwRUЬPˏP@F\1UЬPݠ KU^Ь[k 1EЫѽ^ЭPРРYPX1ѽѽЭPРWРVѽfW( PYJ[XPV PZ1ZYW[7PW PZZYV[^ V PYѽ ѽ1fg^ݦ PqЦѽέЧYVPPXh ѽhWXXݭYݫ"P_kYЭZJZݭ6ݬ\7ݬL7_~{益KSݬݬiS^PPPP PPxP8l'Sխ%ѭ@ ݭS ݭXRYRÚj[_kVݫ;RЬPPB%PDPFPL PW ~}R[kЬP@ݑܖ3ЬPРPP  $ PPPP ЬPР[ЬPРZ[[PPZZQQPQPPЬPРPP bZRRJ<bZRRЬPˏPP<4 3Q  Ѐ^Ь[ЬPPAYG44444B444444ᅱ|2ݏIpPZPݫh1[M$xPH=rPZ<ݬݫk+߭߭[ݏR[#PXkPˏ@PPk !YѨѨPPPݏL[#PYh11=ը-ȔPY$ﶔOY2 ը(ѨOYΨ1Rը#ѨPѨP PШPPըGѨ?P@ѨP1Ѩ P"ѨPѨ PШPPi^11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 ZT,sp ZSZSZS movl AR,A1 pushl AR ZS movl (sp)+,AR extv $H,$S,AR,A1 extzv $H,$S,AR,A1 extv $H,$S,AR,-(sp) extzv $H,$S,AR,-(sp) cmpl AL,AR ZP cmpw AL,AR ZP cmpb AL,AR ZP cmpw AL,AR ZP cmpb AL,AR ZP cmpd AL,AR ZP cvtfd AR,A1 cmpd AL,A1 ZP cmpf AL,AR ZP movl $1,A1 ZN calls ZC,CL calls ZC,(AL) calls ZC,*AL calls ZC,*AL extzv AR,ZU,AL,AL subl3 AR,$32,A1 extzv AR,A1,AL,AL subl3 AR,$32,A1 extzv AR,A1,AL,AL extzv AR,ZU,AL,A1 ashl AR,AL,AL ashl AR,AL,AL ZB AR,A1 ashl A1,AL,AL ashl AR,AL,A1 ashl AR,AL,A1 ZB AR,A1 ashl A1,AL,A1 ZE ZE ZE ZE ZD ZD ZD ZD ZA insv AR,$H,$S,AL extv $H,$S,AR,AL extzv $H,$S,AR,AL HELP HELP HELP movd AR,A1 movZF AR,A1 ZA ZA tstZR AR pushl AR cvtZRl AR,-(sp) movzZRl AR,-(sp) movd AR,-(sp) cvtfd AR,-(sp) mnegZL AL,A1 mcomZL AL,A1 cvtZLl AL,A1 mcoml A1,A1 bitl ZZ,AL bitw ZZ,AL bitb ZZ,AL bicl2 AR,AL OL2 AR,AL OL2 AR,AL OL3 AR,AL,A1 divl3 AR,AL,A1 mull2 AR,A1 subl2 A1,AL divl3 AR,AL,A1 mull2 AR,A1 subl3 A1,AL,A1 incZL AL incZL AL incZL AL cvtZLl AL,AL incZL AL movzZLl AL,AL decZL AL decZL AL decZL AL cvtZLl AL,AL decZL AL movzZLl AL,AL incZL AL incZL AL cvtZLl AL,AL incZL AL movzZLl AL,AL decZL AL decZL AL cvtZLl AL,AL decZL AL movzZLl AL,AL OL2 AR,AL OL2 AR,AL OW2 AR,AL OW2 AR,AL OB2 AR,AL OB2 AR,AL OW2 AR,AL cvtZLl AL,AL OW2 AR,AL movzZLl AL,AL OB2 A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RQSTVYWXSTLVYWXPNOVYWXRQPNORQSTRQSTVYWXPSNTOvwy{RQ|}~szuxvSwy{|}~szuxvwy{|}szuxnRKHk}*}r(\>zG.pGGGGGm:P}*}!GGaT.G!GGGGG5G($_:'GGGlGGMGGGm5UGG G &GG/jGGGG|dtGGF9 [R} {x/v$)us:olkfe d\ZVOH ##%%&&&"""( ))++ ,,..'/' 000233111115566**--447!!89:$$$$$$$$$$$$$$$$$;;;<  "!#19 2!449826326:2!373338374 0298:4778 :46 223258599::::::::8332 8395)*$%9&+,-(/.57363599999522229573'+399972233933399bad bdtydimension table overflowwhiles, fors, etc. too deeply nestednon-constant case expressioncase not in switchswitch table overflowduplicate default in switchdefault not inside switchswitch table overflowduplicate case in switch, %dyacc stack overflowsyntax errorfunction level error$%dFAKEstructure typed union member must be namedfield outside of structureillegal field sizefield outside of structurezero or negative subscriptfunction declaration in bad contextold-fashioned initialization: use =nesting too deepillegal breakillegal continuestatement not reachedvoid function %s cannot return valueloop not entered at toploop not entered at toploop not entered at topprecedence confusion possible: parenthesize!old-fashioned assignment operator& before array or function: ignoredstructure reference must be addressableundeclared initializer name %.8s\dt#z##################FIELD[%d]SNULLAUTOEXTERNSTATICREGISTEREXTDEFLABELULABELMOSPARAMSTNAMEMOUUNAMETYPEDEFFORTRANENAMEMOEUFORTRANUSTATIC$_((0  "'`(2)3{4}5[6]7* ?:+ - /<%>&|^! L~M,88;9. D< S>U= ::((()((/(*((.),))')1)-)#)+)%0)&3)7)<)$C)L)(S)Z)0a)g)n) v))))+)PCC/364r1 vax uts3.0Release: %s rwccom:can't open %s abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_01234567890123456789abcdefABCDEF  01234567abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789  unexpected EOFnewline in string or char constantnon-null byte ignored in string initializerempty character constanttoo many characters in character constantunexpected EOFillegal character: %03o (octal)illegal hex constantnewline in BCD constantBCD constant exceeds 6 charactersgcos BCD constant illegalambiguous assignment: assignment op taken=<%c illegal=>%c illegalyylex error, character %03o (octal)out of switch in yylexbad asm constructionbad AR_?? action0,0,LL%d LL%d: asmautobreakcharcasecontinuedoubledefaultdoexternelseenumforfloatfortrangotoifintlongreturnregisterswitchstructsizeofshortstatictypedefunsignedunionvoidwhiledefid calltyreducedefid( %.8s (%d), , %s, (%d,%d) ), level %d modified to , %s previous def'n: , %s, (%d,%d) ), level %d declared argument %.8s is missing previous class: %s redeclaration of: %sredeclaration of %.8s new entry made void type for %s dimoff, sizoff, offset: %d, %d, %d parameter stack overflowbcsave errorparameter reset errorswitch errordclargs() %s (%d) dclstruct( %.8s ), szindex = %d ??gummy structure memberillegal zero sized structure member: %.8szero sized structure dimtab[%d,%d,%d] = %d,%d,%d member %.8s(%d) redeclaration of formal parameter, %.8scompiler takes alignment of functioncompiler takes size of functionunknown sizeinitialization alignment errorinoff errorbeginit(), curid = %d instk((%d, %o,%d,%d, %d) no automatic aggregate initializationinsane structure member listendinit(), inoff = %d too many initializersempty array declarationbad scalar initializationcannot initialize extern or union} expecteddoinit(%o) illegal initializationillegal {irbrace(): paramno = %d on entry too many local variablesStructure too largetoo many local variablesillegal field typefield too bigzero size fieldstructure too largestructure too largenidcl errorillegal type combinationtymerge: arg 1Null dimensionarray of functions is illegalfunction returns illegal typea function is declared as an argumentfunction illegal in structure or unionfunction has illegal storage classillegal use of fieldillegal classillegal classillegal classillegal register declarationillegal classillegal classfortran declaration must apply to functionfortran function has wrong typeillegal class: %dSymbol table full nonunique entry for %s from %d to %d lookup( %s, %d ), stwart=%d, instruct=%d symbol table fullsymbol table full%.8s undefinedremoving %8s from stab[ %d], flags %o level %d symbol table full%.8s redefinition hides earlier one %d hidden in %d unhide uncovered %d from %d unhide failsbuildtree( %s, %o, %o ) constant argument to NOTconstant in conditional contextdivision by 0.illegal lhs of assignment operator%.8s undefinedmember of structure or union requiredmember %.8s==%.8s? illegal member use: %.8snonunique name demands struct/union or struct/union pointerstruct/union or struct/union pointer requiredundefined structure or unionillegal member use: %.8sillegal indirectionunacceptable operand of &assignment of different structurestype clash in conditionalillegal functionillegal functionother code %dchkstr( %.8s(%d), %d ) undefined structure or uniongummy structureillegal member use: perhaps %.8s.%.8s?division by 0division by 0illegal comparison of enumsenumeration type clash, operator %sillegal combination of pointer and integer, op %sillegal structure pointer combinationillegal array size combinationillegal pointer combinationpointer requiredillegal oconvert: %dillegal pointer subtractionillegal types in :void type illegal in expressiontymatch(%o): %o %s %o => %o constant expectedconstant too big for cross-compileroperands of %s have incompatible typessizeof returns 0 %o) %s, %ld, %d, , %d, %d statement not reachedL%dPQTURSXYVW& error   cvtblcvtwlmovlmovlmovfmovd movzbl movzwlmovlmovl ret jbr L%d .align %d .text .data .data 1 .data 2 .stab illegal location counterL%d: .data .align 2 L%d: .space %d .text movab L%d,r1 movab L%d,r0 .set .R%d,0x%x .align 1 .word .R%d jbr L%d L%d: movab L%d,r0 jsb mcount .data .align 2 L%d: .long 0 .text %s %d(ap),r%d bad argumentbad argument .globl %s %s: " .ascii "\%c\%o" .ascii "%c" .space %d illegal field type%s, line %d: movl casel r0,$%ld,$%ld L%d: .word L%d-L%d L%d: L%d: cmpl r0,$%ld jeql L%d cmpl r0,$%d jeql L%d jbr L%d jgtr L%d jgtr L%d L%d: bad conversionincode: field > int .long 0x%x %s 0%c%.20e .double.float .long 0x%x .comm %s,%ld 0,%d,%d 0,%d,%d 0,%d,0 0,%d,L%d 0,%d,%s 0,%d,%d 0,%d,%d No .stab for %.8s .stabn .stabs "%.8s", 0%o, .stabd 0%o,0,0%o 1,0,%d 0,0,LL%d LL%d: 0,%d,_%.7s t<y<<<<<<<<<<<<<<QPUTSRYXWVbad option: %cstore called on: SZEROSONESMONESPECIAL+%d|order( %o, ) order( %o, ), cookie , rewrite %s no table entry for op %sillegal initializationexpression causes compiler loop: try simplifying %o) %s %s size=%d align=%d, , NOPREFMUSTDO PREF %s, SU= %d SANYSAREGSTAREGSBREGSTBREGSCCSNAMESCONSFLDSOREGSTARNMSTARREGINTEMPFORARGSWADD,A 0A 4A=8AB=B?B%s, line %d: # line %d, file %s L%d: subl2 $%ld,sp movab -%ld(sp),sp jbr L%d %s%cno hoptab for %sdflwbzzzcode- bad typel clrl %s clr mnegmoval ,cvtmovzlcvt ,cvtl ,movmovzcvtcvt ,movlcvtl->%d<-$%d %sincdec %saddsub2 ,->%d<-dfl->%d<-$%ld$%d$%dSTASG badSTASG-rstructure size <0=0 or >65535 movb movw movl movq movc3 $%d,, illegal zzzcode %s %s,%s movfmovdmovlillegal makeor2 shumul:op=%d,lop=%d,rop=%d prname=%s,plty=%d, prlval=%D $%ld%sillegal conputinsputupput$%s*-(%s)+[%s]bad arg temp%ld(ap)(%s)*%s(%s)%s-+illegal address%ld%.8s%.8s+%ld jbr L%d bad conditional branch: %saddress of OREG takenaddsubmuldivbisxorbicaddsubmuldivbisxorbicr0r1r2r3r4r5r6r7r8r9r10r11apfpsppc jeql L%d jneq L%d jleq L%d jlss L%d jgeq L%d jgtr L%d jlequ L%d jlssu L%d jgequ L%d jgtru L%d udivuremudivurem'rallo( %o, %d ) bad setstrillegal setasopL%d: stuck starg !@A @tshape( %o, %o), op = %d ttype( %o, %o ) bad setrew%d%d%d%ldbad getlr: %cCCCDDstack overflowusable asked about nontemp registerrfree( %s ), size %d register overfreedillegal freeregister overfreedrbusy( %s ), size %d illegal register pair freedRLEFTRRIGHTRESC1RESC2RESC3RNULLRNOP|reclaim( %o, , ) illegal reclaimcannot reclaimfaulty register movepotential register overwritepotential register overwriteregister allocation errorNAMESTRING^REG_OREGICONFCON`CCODES U- U*U&HUCALLKUFCALLL!M~lFORCEnINIThSCONViPCONV+h+=i!-( -=)! * *= )&h&=i ?:&&||8,;,OP:= </ =/=)>%?%= @<<A<<= 0B>>C>>= 0|h|=i ^h^=i N++ O-- E->FCALLIFCALLP==Q!=R<=S<T>U>YUGTXUGEWULTVULE]A>>!TYPE6[mCBRANCHgFLDjPMCONVkPVCONV$RETURN oCAST %GOTObSTASG cSTARGdSTCALLfUSTCALLcJiJnJsJyJ}JJJJJJJJJJJJJ too many errorscannot recover from earlier errors: goodbye! compiler error: warning: out of tree space; simplify expressionwasted space: %ofreeing blank tree!undeffargcharshortintlongfloatdoublestrtyuniontyenumtymoetyucharushortunsignedulong??PTR FTN ARY %s  AAAAAABBBBBB SS((LWold/lib/cpp 755 0 33 44000 2423022477 6107 8 d^Юn PPՀPpPP77P2(P@鶴@3==&B[[Bl<YЩP֩`iY~Y0[VB[IB ^Ь[6B[PP!BZ&BYZP BP <AZA[AZPP𤋮ZAZAY[Z[P﹫@1飼P@YAZPY@ZtAr1fQ@bAR1X@A?A9A1P@@ë@yϬPﴫ@שׂ;𤋮PЭ@CPЭ@ﻫ[Z )Z@jUM[PSݏ@:0PX1'8&1)[`@ﻬH0:g0P@k~:@7磌C1B^Ь[m:1PDQ@a[PP?`PP|PN,lNl,BF1[P[[>[iP[1[Α>[[>[BP[ޑ=[[s>[$P[⑋=[[N>1t[P[[[2>[P[ P@19[>r[>[P[P8H8PРQ֠/a58/+[[=[=/**%j=[PP[FP[/1&[[v=]8P@Ԩ"G77PРQ֠ a,7 6+=[)=[P[P@?*1y [[<[<[PP[<[P[%77PРQ֠*a 7**66PРQ֠/a6/w*[[q<[f</*1D1y[O<[D<*1C[[.<1T[P[*֧1[ <j1Y [1\%[[;:[P[.[vP[ xP@ [[;[P@2>1EP@?F 515#[[N;[?;1F[P[ؘP@=[[;1=[P[11YI=4[[:1[:o:1:[1IF;1ZJG=J.;蘋YI2=I;ӘZJ=J;}YI=1rI:eZJ<J:PYI<I:;P@<[[:13[:[ZJ:1P@<[[91[P[Ь[[9[9[P[9P@@;[PЬ[g7;4 $jdP@Z1[P[B9E9?9[P"@d3ZX3R33 P(+3%3ǢPZ@ƢÏ8YY[[YY8PZ@x8ZÏp8YZh8Y[[YyzY8YD8Z (3V :8ZXX18X.8XX[P ^Ь[[@P[Z8P7`<Z[7[7[P[7  [je7>7[777P"$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bad include syntaxUnreasonable include nestingno space/Can't find include file %stoo much definingillegal macro name%s: missing )bad formal: %stoo many formals: %s%s redefinedIf-less endifIf-less elseundefined control 1%s: %d: too many defines%s: macro recursion%d"%s"%s: actuals too long_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890123456789. "'/\ "'\* .too many -D options, ignoring %stoo many -U options, ignoring %sexcessive -I file (%s) ignoredunknown flag %sNo source file %swCan't create %sextraneous name %s/usr/includedefineundefincludeelseendififdefifndefiflineunixvax__LINE____FILE__command line@@AAA AAA   A||&&>><<>=<=!===bt n f r \\+-*/%<>&^|?:!~(),defined\ Illegal character %c in preprocessor ifIllegal number %syacc stack overflowsyntax errorddBdold/lib/crt0.o 755 0 33 310 2423022477 6366 ((<P^Юn PPՀPpPPP$+ 4 exit_exitstart_main_environBd/( ,( 5 /\@,\D"old/lib/f1 755 0 33 130320 2423022500 5637 ,^Юn PPՀPpPP;iP{ݬAo-o"oP `kjP-ݬnPڒPݬ&k ^﹒լ(㮝ݬݬ0oP j Ь[1[  je[~nP[ jx[PPZZ ZJ~Z)АZ~nPZ ]j ^iPݕݬݬPjխ,m洛1ЭP@P`- ֭ѭѭPЭP@1P%1<1P11P1 l1?PP&[PP[PP [ \1%jPZj[ԪPx[PӏPQ1liPZj[Ԫx[PӏPԪ%iPZ_j[[0PZ~1[~13x[PӏPRݏI[~d1P`Ԫ1j~gx1P1&iPZ[j[jPˏ@sPPPP1P`ysP`GP_11{P^hPZ^j[[ݪݪԪԪ 2 Z |gP[} [~[~[~|Zj[PP1C[x[PӏP[~|vp }|zf2| P|>HZ|Z^hZeZ Z#g1P1 [~P{7j1P1*{P1k0P1v{e[[[1V[P1 mP PPbP XPPxPMO1;P1\x[PӏP11Y[1KZj-1Zj1jPPW!VDDDDDDDDDDDhDDDDDD`DDqDDzj~{dZjZL{1{g{1r}1iU1`{1W~1N~1Ez1%YP Ь[[?P[[ZJZZЬ[kZˏJ祐YYPY ݫZPPPP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ь [1Wk1kPPAa+44|4F44444b|4444kbbPbk`[bk~WJV[k~ݬe([k VS@Vx}׭xtkMЭPҭPP41iЬPݠoVݼ[k~^&1H[k~ݬРݭ:V1j[k~ݬ_P31[k~ݬDP31[k~ݬ)P 41[k~ݬP31ЬPP1,P2'P3"PL*PRFPU;1PxPPPмPˏ@fPPЬPЬPРPмPˏ@ufPPЬPЬPРPi@Di@#Di@3Dh$  4Dh$_05Dh$0DDh$0aDh$qDh$Dh$Dh$DnLDnDnD%D%Dc Db @Db@Db@Db@ EgO %Eg 8Eg OLEg bE LLyE E E E E   E  E E`EH FHFH@+FH:FC#LIFC#L]FC#LLFB&LFA#LFA#LFA#LF@&L F@&L G@&L GN/GO4GNL9GOL>GNCGOHGNLMGOLRG:#WG:L\G:#LOoG:#LG   G^ G^G G0 G G G LG G G  H H $,)HM$8HM$GH LLcH LpH L}H#LLH#  H&  H&   H?'  H>  H#L I# #I# .I# GI #L aI # lI # wI # I&LLI&LI&LI&LLI&LI&L J#LL&J#L2J#>J#LJJ#VJ#LbJ#nJ#J#J#J&LJ&LL J#  J#J#   K' $K&  JK&  VK& eK&  ~K& K @ KN@NKO@NK:@:Kb@bKg@gK @K K@LK;@;Kn@nK@ K @K @KaaaaaaaaK cvtZLl AL,A1 movzZLl AL,A1 cvtZLd AL,A1 movzZLl AL,A1 cvtld A1,A1 cvtZLZF AL,A1 movzZRl AL,A1 movzZRl AL,A1 cvtZRl AL,A1 cvtZRl AL,A1 .long CL .word CL .byte CL jbr CL jmp (AL) ZS subl2 ZT,sp ZSZSZS movl AR,A1 pushl AR ZS movl (sp)+,AR extv $H,$S,AR,A1 extzv $H,$S,AR,A1 extv $H,$S,AR,-(sp) extzv $H,$S,AR,-(sp) cmpl AL,AR ZP cmpw AL,AR ZP cmpb AL,AR ZP cmpw AL,AR ZP cmpb AL,AR ZP cmpd AL,AR ZP cvtfd AR,A1 cmpd AL,A1 ZP cmpf AL,AR ZP movl $1,A1 ZN calls ZC,CL calls ZC,(AL) calls ZC,*AL calls ZC,*AL extzv AR,ZU,AL,AL subl3 AR,$32,A1 extzv AR,A1,AL,AL subl3 AR,$32,A1 extzv AR,A1,AL,AL extzv AR,ZU,AL,A1 ashl AR,AL,AL ashl AR,AL,AL ZB AR,A1 ashl A1,AL,AL ashl AR,AL,A1 ashl AR,AL,A1 ZB AR,A1 ashl A1,AL,A1 ZE ZE ZE ZE ZD ZD ZD ZD ZA insv AR,$H,$S,AL extv $H,$S,AR,AL extzv $H,$S,AR,AL HELP HELP HELP movd AR,A1 movZF AR,A1 ZA ZA tstZR AR pushl AR cvtZRl AR,-(sp) movzZRl AR((,-(sp) movd AR,-(sp) cvtfd AR,-(sp) mnegZL AL,A1 mcomZL AL,A1 cvtZLl AL,A1 mcoml A1,A1 bitl ZZ,AL bitw ZZ,AL bitb ZZ,AL bicl2 AR,AL OL2 AR,AL OL2 AR,AL OL3 AR,AL,A1 divl3 AR,AL,A1 mull2 AR,A1 subl2 A1,AL divl3 AR,AL,A1 mull2 AR,A1 subl3 A1,AL,A1 incZL AL incZL AL incZL AL cvtZLl AL,AL incZL AL movzZLl AL,AL decZL AL decZL AL decZL AL cvtZLl AL,AL decZL AL movzZLl AL,AL incZL AL incZL AL cvtZLl AL,AL incZL AL movzZLl AL,AL decZL AL decZL AL cvtZLl AL,AL decZL AL movzZLl AL,AL OL2 AR,AL OL2 AR,AL OW2 AR,AL OW2 AR,AL OB2 AR,AL OB2 AR,AL OW2 AR,AL cvtZLl AL,AL OW2 AR,AL movzZLl AL,AL OB2 AR,AL cvtZLl AL,AL OB2 AR,AL movzZLl AL,AL OL2 AR,AL OL3 AR,AL,A1 OD2 AR,AL OF2 AR,AL cvtfd AR,A1 OD2 A1,AL cvtfd AL,A1 OD2 AR,A1 cvtdf A1,AL OD2 AR,AL OD3 AR,AL,A1 cvtfd AL,A1 OD2 AR,A1 cvtfd AR,A1 OD3 A1,AL,A1 OF3 AR,AL,A1 cvtfd A1,A1 help; I'm in trouble Ь[Ь[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ZPxYP[PP[1[Zk[[ZZ [xPtYPƏPxP[^PZxHPZPPPZx5~9PZZZ PZPxPZPPjjx1xYP[PZkk[P Ь[[ZZZjPPj ^Ь[ [[PPݬRPZZ[ZP[ZPPYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j~\S^\7PЬPP1PL%d: : intermediate file read errorrcannot open intermediate file %sintermediate file read errorlccopy asked to copy too muchintermediate file read erroroutput file errorop=%d, val = %d, rest = 0%o null opcode ignored switch not yet doneexpression depth exceededexpression poorly formedillegal leaf node: %d  (/6QPUTSRYXWVbad option: %cstore called on: SZEROSONESMONESPECIAL+%d|order( %o, ) order( %o, ), cookie , rewrite %s no table entry for op %sillegal initializationexpression causes compiler loop: try simplifying %o) %s %s size=%d align=%d, , NOPREFMUSTDO PREF %s, SU= %d SANYSAREGSTAREGSBREGSTBREGSCCSNAMESCONSFLDSOREGSTARNMSTARREGINTEMPFORARGSWADD stack overflowusable asked about nontemp registerrfree( %s ), size %d register overfreedillegal freeregister overfreedrbusy( %s ), size %d illegal register pair freedRLEFTRRIGHTRESC1RESC2RESC3RNULLRNOP|reclaim( %o, , ) illegal reclaimcannot reclaimfaulty register movepotential register overwritepotential register overwriteregister allocation error !@A @tshape( %o, %o), op = %d ttype( %o, %o ) bad setrew%d%d%d%ldbad getlr: %c'rallo( %o, %d ) bad setstrillegal setasopL%d: stuck starg = $( ,<048<@ADGJMPSVY\_cgjmp  s~ً͋<>=?%s, line %d: # line %d, file %s .set .F%d,%ld %s%cno hoptab for %sdflwbzzzcode- bad typel clrl %s clr mnegmoval ,cvtmovzlcvt ,cvtl ,movmovzcvtcvt ,movlcvtl->%d<-$%d %sincdec %saddsub2 ,->%d<-dfl->%d<-$%ld$%d$%dSTASG badSTASG-rstructure size <0=0 or >65535 movb movw movl movq movc3 $%d,, illegal zzzcode %s %s,%s movfmovdmovlillegal makeor2 shumul:op=%d,lop=%d,rop=%d prname=%s,plty=%d, prlval=%D $%ld%sillegal conputinsputupput$%s*-(%s)+[%s]bad arg temp%ld(ap)(%s)*%s(%s)%s-+illegal address%ld%.8s%.8s+%ld jbr L%d bad conditional branch: %saddress of OREG takenaddsubmuldivbisxorbicaddsubmuldivbisxorbicr0r1r2r3r4r5r6r7r8r9r10r11apfpsppc jeql L%d jneq L%d jleq L%d jlss L%d jgeq L%d jgtr L%d jlequ L%d jlssu L%d jgequ L%d jgtru L%d udivuremudivuremNAMESTRING^REG_OREGICONFCON`CCODES U- U*U&HUCALLKUFCALLL!M~lFORCEnINIThSCONViPCONV+h+=i!-( -=)! * *= )&h&=i ?:&&||8,;,OP:= </ =/=)>%?%= @<<A<<= 0B>>C>>= 0|h|=i ^h^=i N++ O-- E->FCALLIFCALLP==Q!=R<=S<T>U>YUGTXUGEWULTVULE]A>>!TYPE6[mCBRANCHgFLDjPMCONVkPVCONV$RETURN oCAST %GOTObSTASG cSTARGdSTCALLfUSTCALLƑ̑ӑّ too many errorscannot recover from earlier errors: goodbye! compiler error: warning: out of tree space; simplify expressionwasted space: %ofreeing blank tree!undeffargcharshortintlongfloatdoublestrtyuniontyenumtymoetyucharushortunsignedulong??PTR FTN ARY %s,,t,#crt0.oexitfort.o<.R1.R2.R3.R4.R5.R6 .R7 freader.|.R1.R2 .R3.R4.R5.R6.R7.R8.R9.R10.R11.R12.R13.R14.R15.R16fallo.ol.R1.R2.R3.R4.R5.R6.R7.R8 .R9.R10.R11 .R12.R13.R14.R15fmatch.o`)_mamaskЅ.R1 .R2.R3.R4.R5 .R6ftable.o<1forder.oK.R1.R2.R3 .R4 .R5.R6.R7.R8.R9.R10.R11((.R12.R13.R14.R15.R16.R17 flocal2.U.R1.R2.R3.R4.R5.R6 .R7.R8.R9.R10.R11.R12.R13.R14 .R15.R16.R17.R18.R19.R20.R21 .R22.R23.R24.R25.R26.R27.R28.R29.R30.R31.R32.R33 .R34.R35.R36.R37.R38 .R39fcomm2.o|k.R1.R2.R3.R4.R5.R6.R7.R8.R9.R10.R11 .R12.R13fprintf.o.R1fopen.o@o.R1creat.oocreatnoerroroprintf.op.R1rdwr.o(p.R1.R2filbuf.op.R1lseek.oqlseeknoerrorqdoprnt.oqflsbuf.ohy.R1.R2.R3.R4 exit.o{exitdata.o{close.o{closenoerror{isatty.o{.R1open.o|opennoerror|read.o|readnoerror |strcpy.o$|.R1stty.o<|.R1.R2ioctl.oh|ioctl6noerrort|malloc.ox|_allocsx_allocp_alloct_allocx.R1.R2 .R3sbrk.o~breakndnoerr1~noerr2~write.o~writenoerror~cerror.o~_exit({start_mainji_environ%_label<_printfEp_tlabeluP_lrd 8_lccopy# _lreadj_fread`(p_cerrorhk_lopen)_fopen@o__iob4_lcread]_fstack _fsp _offsz _fwritezp_mainp2<_caloff4|k_p2init|_tinitl_nerrorsL_fprintfWo_baseoffD_tmpoff _maxtreg _ftnno u_maxoff &_maxtempH_setregsn__talloc+l_cbgen0h_uerrork_dope _rbusyj#_xdebug8_lineno '\_filenam'Ё_lflag `_lineidV_edebugz4_eprint`_fwalk4m_myreadeLk_nrecur Id_delay_reclaimz$_allchk4)_tcheckJm_eobl2 $V_node l_udebug,<_vdebugk@_stotree l_stocook gp_deltree t_deli `_allo0pl_odebug_rdebugk<_radebugJ_tdebug,_sdebug(_Wflag_mkdopeKpn_setrew,_delay1f_delay2hj_codgen@ _ncopy((_autoincL_deltestK_tcopyz(_cnames*L_canonH_store_order _prcook _callfla _fregs _rcount:_rallobO_match-_tshape`)_nextcooh_opst _cbranch_getlab6T_deflab`FT_tfreem_offstarP_gencall6g_genscalJ"g_setincrAQ_setstrUR_setasop+tS_setasgR_setbinQ_lastchah_stoasg;K_markcal`_constor _stoarg7_mkadrsvL_negrel_rnamesL_adrputd_tprint"n_oreg2_base__tlenV_offset]`_makeor2s>a_sztyq__notoffL_walkf.n_sucompL_resc _busy _maxa 4_mina 8_maxb <_minb @_rstatuso_allo_freeregB_freetem_callreg__usable _shareitP!_ushare#!_getlr0_recl20L"_rfree"_rwprint$_respref1̇_rtyflgX0_rmove>__fldsz xD_fldshf H_shtemp%b_flshapeb_shumulc_ttype>+_rwtable L_opptr T_table<1_shltypeJb_expand1.__flsbufiy_zzzcode{W_adrconHd_hopcodeLpV_conput%$d_insputld_upput!d_maxargsZ_canaddrJ b_crslabA_genargs ZT_argsize=XU_whereU_ioptabqԆ_mixtype.W_prtype>pW_aconf_gc_numb H_rewfld__werrorfl_ccbrancK_optim2h_addroreMZi_opfunc$_hardops(zi_zappostPj_fixprej_strcpyD$|_ftlab1 _ftlab2 _lastfre : _tfree1gm_indope__doprntr__lastbut_creato_open8|_errno 5$_lseekqcerrorN~__filbufp_mallockx|_fflushz_read |_write-~_isatty{{__sobuf y,__cleanuL{_fclosefp{_close{_free}__sibuf ,_gttyR|_stty<|_ioctl h|_sbrk1~_realloc}_end G,#_brkw~_strcpyD$|_ftlab1 _ftlab2 _lastfre : _tfree1gm_indope__doprntr__lastbut_creato_open8|_errno 5$_lseekqcerrorN~__filbufp_mallockx|_fflushz_read |_write-~_isatty{{old/lib/lib2648.a 644 0 33 63524 2423022501 6633 ebeep.o: P  __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace_beep.R1_escseq_outcharbitcopy.o: |,0PxPPŬ P[[Z[PPYyzZ_trace_bitcopy.R1cleara.o:  ` HJ   __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace_cleara.R1_sync_escseq_outstrdrawbox.o : @xp8լ  ݬݬݬPP~PP~PP~PP~ݬݬݬ    4 O c p __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace_drawbox.R1_setset_setclea_move_drawnewmat.o: 4px^PxPPŬP( ݬݬݭݭPPxݬݬݭhЭPnewmat: rows=%d, cols=%d newmat: malloc(%d) =%x  '- 4 ; A LR Y c m w}   _trace_newmat.R1_fprintf_abort_malloc_zermatprintg.o:   ^ѭP`P PPF PS@plPe`P VOPP  P ;ݭ 0ݭ&ѭ&p4d5u0C   & ,3 < B I O W ^ i p          __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace_printg.R1_togvid_sync_escseq_outstr_outchar__iob_fflush__filbuf_ungetcrawchar.o: LH(^18Ï~Ï~~P}wr,jd_YsKDP93/P(`P P˜P~P.%s from queue, front=%d, back=%d reset pushback to null rawchar '%s'     $ / 7 ? E M R Y ^ j rx                 __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx((__supy_trace_rawchar.R1_sync_escseq__iob_fflush_rdchar_fprintf__filbufreadline.o:  ^ݏ ݬЬZP}`P ngP[[PP2P  P P8Dݭݭ7խ+ZZ[~1z[[~ìZPP 1Rline too long   , 3 : A L S ] g n t |           __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace_readlin.R1 _areacle_setset_zoomout_curon_movecur_texton_outstr__iob_fflush__filbuf_textoff_curoff_outchar_errorerror.o;: h0ݬ _error.R1_messagemessage.o^HU @ݏdݬ __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace_message.R1_dispmsgdispmsg.oRU <^PP~ ~ݬݬ ݬ ݬݬխ {tЭleݭݭXխL     < C J W ^ d l v      __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace_dispmsg.R1_zoomout_areacle_setset_curon_movecur_texton_QUIET_outstr_textoff_curoffmovecurs.o: 0``H^Ѭ Ѭݬݬ߭߭ЬЬ%d,%do  ", 5 ? H P X __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace_movecur.R1_sprintf_escseq_outstrsetmat.o: L<@ լլѬѬ .%ݬݬ ݬݬݬݬ PxPPĬPxQQP[PPPxPZլ KPZPKPZPPKsetmat range error: (%d, %d) <- %d in a (%d, %d) matrix %x  6< C _trace_setmat.R1 _fprintftexton.o: lp((ݏa   ' 0 = C I P V [ a f __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace_texton.R1_sync_escseq_textoff.R2_outchar_motionttyinit.o: lPPݏt~ݏt~(PP2wtmcݏ td~OIݏtJ~5.% ݏ t~wqݏtr~]TERMhp2648    % + 7 ? E Q Y ` e l r z              ! " # !& (' /( 6) ?* F+ LS, Y `- f k q }     __ttyb__otch__ntch__normf__on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace_ttyinit.R1_getenv_strcmp__iob_ioctl_gdefaul_zoomn_zoomon_kon_rboff_curoff_clearg_gon_aoff_done.R2_goff_koff_aon_sync_escseq_lowleft_printf_fflushagoto.o: 8p(^ݬݬ߭߭*dE&a%dr%dCF  ! *1 __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace_agoto.R1_sprintf_outstr_lowleft&.R2aon.o: @0ݏeݏf   % . ; __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace_aon.R1_sync_escseq_outchar_aoff .R2clearg.o: 0` bPaPP   * __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace_clearg.R1_sync_escseq_outcharcuron.o : P`Pݏkݏl   $ + 4 > G T Z __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace_curon.R1_sync_escseq_outchar_curoff0.R2gdefault.oN: Pr  __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace_gdefaul.R1_escseq_outstrgon.oT: @0ݏcݏd   % . ; __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace_gon.R1_sync_escseq_outchar_goff .R2kon.o\: 4 p0&s1A&s0A  ! '. __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace_kon.R1_escseq_outstr_koff.R2rbon.o: 0H8ݏmݏn   " - 6 C __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace((_rbon.R1_setset_sync_escseq_outchar_rboff(.R2update.o6U 8L(^%ݬݬݬݬ ݬݬ߭߭߭߭ݬݬ ݬ߭߭߭߭ݬݬ ݬѭЭPЭPPѭЭPЭPPѭЭPЭPPѭЭPЭPPݬݬ ݬj#ݬݬ ݬZ Э[a[ݬݬ ݬPI[ZZݬݬ ݬPZZ PP~ݭݬ PZP~Z[[[1 P[PP[ݬݬ ݬ}P1oЭZZZ[ݬݬ ݬVPZ[ݬݬ ݬ P bl u   __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace_areacle.R1_fprintf_setclea_sync_sprintf_escseq_outstrdumpmat.o): tP` ^ݬݬ ݬݬ߭߭߭߭ݬݬ ݬݭݭݭݭЭ[[o[{ЭZZ8Z[ݬݬ ݬ]PXP.PPB;Zw(![_ dumpmat %s, m=%x, rows=%d, cols=%d r1=%d, r2=%d, c1=%d, c2=%d %2d %c  " ) E W] d tz         _trace_dumpmat.R1 _fprintf_minmax_matemptyrow.o2: D0^ PxPPĬPP PxPPPѭЭP֭`PP_trace_emptyro.R1line.od: lppPݬݬ ݬݬѬ Ѭ~ݬݬݬݬݬ line((%d, %d), (%d, %d)),  % - 7 H O \ i __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace_line.R1_fprintf_move_sync_drawdraw.o: <TpHݬݬݬݬЬЬdraw(%d,%d)    & / < D L __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace_draw.R1_fprintf_sync_escseq_motionminmax.o{:  `0^߭߭߭߭ݬ ݬݬݭݭݭݭЬYЬ WVVXЭ[[iЭZZZZ[ݬ ݬݬP@Y[YP[PPYX[XP[PPXWZWPZPPWVZVPZPPVZ[XY VVXXWWYYXWVaminmax returns %d, %d, %d, %d  # 7= D w _trace_minmax.R1_aminmax_fprintf_mataminmax.o: 0^ PxPYЬXYVԭЭW[]ZRY[PPJ`CX[XP[PPXW[WP[PPWVZVPZPPVѭZЭPZPPZZY[[WXЭWWVVXXWxVxPPP_trace_aminmax.R1mat.om: H0Ь[ЬZ PxPPĬP[PxZQA`PPYZPPPxPPPPPYPP_trace_mat.R1move.o: 4@0ݬݬЬЬ move(%d, %d),    ' / __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace_move.R1_fprintfset.o: Dp(  P PP P PP   * < __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace_setxor.R1_setclea .R2_setset&.R3video.o: @D8PPP3a1b0 0 719 359e   ( 1 7> __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace_vidnorm.R1_vidinv .R2_togvid.R3_escseq_outstrzermat.o: t$0  PxPPŬP[[PPZzZ_trace_zermat.R1 zoomon.o: 4p ݏgݏh  ! . __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace_zoomon.R1_escseq_outchar_zoomoff.R2zoomout.o!: d 0 _zoomout.R1_zoomnzoomn.o: 0` P0P~ݏi   * __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace_zoomn.R1_sync_escseq_outcharsync.o: ` )ݏa7PP P P ݏaw3m12   ! . 4 : A G L W ] b h   __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace_sync.R1_escseq_outchar_motionescseq.oE: PpѬPP (DDSЬPP ET\dѬݏsЬݏZyzvr*dT*d*p*m*dS  & , O W e mt | __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace_escseq.R1_outchar_outstrmotion.o: |@X ^ѭ<ѭ6ѭ,ѭ&ݏjP P~PFݏiP P~P P~rP P~aP P~PЬHЬ@  B S h y    __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace_motion.R1_outcharoutstr.o: @ЬP֬`~ __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pu((shba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace_outstr.R1_outcharoutchar.o 5U <4 ~PP``P~ 1-~ypisoPh`Y@J3-1&P`P1P`8Ï~Ï~~P1rP1kzle_1[%sENQ .. push back %s, front=%d, back=%d, ACK    & , 5 ; C J Y d j v ~                     % * 1 6 B JP W ] h o     __on2648__video__actsmo__supsmo__escmod__cursor__outcou__pushba__pb_fro__pb_bac__penx__peny__curx__cury__supx__supy_trace_outchar.R1_rdchar_fprintf_QUIET__iob__flsbuf_fflush__filbufrdchar.o: 08PP'P PPP@ P^PPP@PP P̏@PP[[k [P+ =I bhn_rdchar.R1__ctype___cury__supx__supy_trace_outchar.R1_rdchar_fprintf_QUIET__iob__flsbufold/lib/lib300.a 755 0 33 15750 2423022501 6533 e__.SYMDEFS L_arcp_box_circle_closevt<_closepl<_dot0_erase_label@_line_iline_cont_linemod _move( _xnow4 _ynow4 _OUTF4 _ITTY4 _PTTY4 _HEIGHT4 _WIDTH4 _OFFSET4 _xscale4 _xoffset4 _yscale4 _botx4 _boty4 _obotx4 _oboty4 _scalex4 _scaley4 _openpl4 _openvt4 _point_deltx_delty_space_abvalL_xconvL_yconvL_inplotL_spewL_outplotL_tobotleL_resetL_dist2L_swapL_movepL_xscL_yscLarc.o/ D _arc.R1box.o4 T@0ݬݬݬݬݬݬ ݬݬ ݬݬݬݬ    % 2 ? L _box.R1_move_contcircle.o9 D _circle.R1close.o> $p    _closevt.R1_closepl .R2__iob_fflush_resetdot.oC D _dot.R1erase.oI $0^ԭ ֭nPqPC _erase.R1_spewlabel.oO (@^ݭЬP֬`   _label.R1_xnow_spewline.oW (0ݬPPݬ PPݬPPݬPPAݬPPݬPxPpj^ݬݬPݬݬ ݬݬ=pP~3f-PjPPPì PnPPvPìPnPPvPQ  Q  խvvnPVRfPRvRnPVRfPRvRԭ׭1nPVRdPRnP`PRnPbPRjRPPPtPkP ~ZЭP׭PnPVRdPRnP`PRn7PbPRjRPPP%PP ~ ЭP׭P.QA   & 2 ; G P Yf o {     $,U v          _line.R1_ysc_yconv_xsc_xconv_iline_cont^.R2_ynow_xnow.R3_movep_dist2_sqrt_inplot_abval_spew_outplotlinmod.o[ D _linemod.R1move.o` 4p(ݬPPݬPP   & / _move.R1_ysc_yconv_xsc_xconv_movepopen.oe P,(VPdPgPPjPPPV~PdPgPPjPPPdVfPdPjPPPLAAA@@FpCF@CpC     # ) / 6 < E L Q X ^emx ~  _xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx _boty_obotx_oboty_scalex_scaley _openpl.R1_printf_gtty_reset_signal_openvt.R2point.ol  @ݬݬ.   _point.R1_move_labelspace.oq dPvvnPvPnPvPì PnPPVRfPRvRìPnPPVRfPRvRFF    * 9D S^ _deltx_delty_space.R1_botx_boty_obotx_oboty_scalex_scaleysubr.o{ |\ լЬPάPPPP8+"}wqjѬ ,jfP_``PM4>:P3``P ݬݏݏG^ì PnPPvPìPnPPvPEPVPPERVRR`RP^ммЭ^Ѭ ѬyoPѬP YSPnPPfGPjPPP9 nPd)PjPPPݭ P ݭЭP׭P~P ݭbЭP׭PPnPPfPjPPP  nPdPjPPPuݭkP ݭЭP׭PJ~@Pw ݭЭP׭PyЬЬ^nPVRcRPRVPdRPVR`PRjRPP^nPVRcRPRVPdRPVR`PRjRPPAABB ' : F L S \irx               y" # " " " " " " &2DJ# Vd# |# # " # & ' ( 5+ @, J- _abval.R1_xconv.R2_xscale_xoffset_yconv..R3_yscale_inplotB.R4_PTTY_OUTF_stty_spew_outplotb.R5__iob_fflush_ITTY.R6__flsbuf_tobotle.R7_move_reset.R8_exit_dist2$.R9_swapZ.R10_movepp.R11_xnow_ynow_xsc.R12_obotx_scalex_botx_ysc*.R13_oboty_scaley_boty_spew_outplotold/lib/lib300s.a 755 0 33 15564 2423022502 6722 ((e__.SYMDEFS L_arcp_box_circle_closevt<_closepl<_dot0_erase_label@_line_iline_cont_linemod _move4 _xnow@ _ynow@ _OUTF@ _ITTY@ _PTTY@ _HEIGHT@ _WIDTH@ _OFFSET@ _xscale@ _xoffset@ _yscale@ _botx@ _boty@ _obotx@ _oboty@ _scalex@ _scaley@ _openpl@ _openvt@ _point_deltx_delty_space_abvalX_xconvX_yconvX_inplotX_spewX_outplotX_tobotleX_resetX_dist2X_swapX_movepX_xscX_yscXarc.o D _arc.R1box.o T@0ݬݬݬݬݬݬ ݬݬ ݬݬݬݬ    % 2 ? L _box.R1_move_contcircle.o D _circle.R1close.o $p    _closevt.R1_closepl .R2__iob_fflush_resetdot.o D _dot.R1erase.o $0^ԭ ֭nPqPC _erase.R1_spewlabel.o 0@^jPPݭЬP֬`A   _label.R1_xnow_spewline.o (0ݬPPݬ PPݬPPݬPPAݬPPݬPxPpj^ݬݬPݬݬ ݬݬ=pP~3f-PjPPPì PnPPvPìPnPPvPQ PPxPP0PQQQQPPխvvnPVRfPRvRnPVRfPRvR~ԭ׭1nPVRdPRnP`PRnsPbPRjRPPPPP^~SPnPVRdPRnP`PRn7PbPRjRPPPPP"~PPxPPPQQP~eA   & 2 ; G P Yf o {    ,4] h         _line.R1_ysc_yconv_xsc_xconv_iline_cont^.R2_ynow_xnow.R3_movep_dist2_sqrt_inplot_spew_abval_outplotlinmod.o D _linemod.R1move.oĀ 4p(ݬPPݬPP   & / _move.R1_ysc_yconv_xsc_xconv_movepopen.ò P,(VPdPgPPjPPPV~PdPgPPjPPPdVfPdPjPPPLAAA@@FpCF@CpC     # ) / 6 < E L Q X ^emx ~  _xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx _boty_obotx_oboty_scalex_scaley _openpl.R1_printf_gtty_reset_signal_openvt.R2point.oԀ  @ݬݬ.   _point.R1_move_labelspace.oـ dPvvnPvPnPvPì PnPPVRfPRvRìPnPPVRfPRvRFF    * 9D S^ _deltx_delty_space.R1_botx_boty_obotx_oboty_scalex_scaleysubr.o xլЬPάPPPPVݏPI=4+"v_YSLRNPG``P4ݬݏݏg^ì PnPPvPìPnPPvPEPVPPERVRR`RP^ммЭ,^ }sխPPxPP4PխQQQPݭAPݭ3PPѭЭPЭPPPIPPט@խ8խܘ~í蘏x/ݭЭP׭Pѭ1ѭí蘏GPPטP~IЭP׭PDPPPP@ԭѭ 8ѭ'ݭݭݭЭP׭PխխݭxPPɭP~ЬЬN^nPVRcRPRVPdRPVR`PRjRPP^nPVRcRPRVPdRPVR`PRjRPP ' : F L S \iu~           c" m# y" # 1i " # -& 8' B( ]+ h, r- _abval.R1_xconv.R2_xscale_xoffset_yconv..R3_yscale_inplotB.R4_PTTY_OUTF_stty_spew_outplotn.R5__iob_fflush_ITTY.R6__flsbuf_tobotle.R7_move_reset.R8_exit_dist2.R9_swapF.R10_movep\.R11_xnow_ynow_xsc".R12_obotx_scalex_botx_yscR.R13_oboty_scaley_boty_spew_outplotn.R5__iob_fflush_ITTY.R6__flsbuf_tobotleold/lib/lib4014.a 755 0 33 13604 2423022502 6616 e__.SYMDEF S _del_step_arc_quad_abs_box_circle_closevt_closepl_dot _erase _lbl_mvH _lbl_umvH _labelH _linet _linemod$ _move_openvt_openpl_pointL_scale_spacep_obotx _oboty _botx _boty _scalex _scaley _scalefl _oloy _ohiy _ohix _oextra _cont _putch arc.o  Ь^ì PnPPvPìPnPPvPEԭPVPPEЭRVRR`RPvPVPp~pPgPPjPPPP ѭ ݭ}Ь ЭЬЭݭݭ\Ѭ  Ѭԭݬݬ ݬݬ~PݬݬݬݬgPì~Pì~{Pxѭѭyѭ Py1PPxѭѭ ìPnPPvPEPPPVPPVRcPRp~lpPnPdPnR`RPjPPPѬѬP*ѬѬѬѬѬ*Ѭ#ѭѭݭݭЭЭѭܭ1ѭЭPP 1ѭѭѭ ìPnPPvPEPPPVPPVRcPRp~npPnPdPnR`RPjPPPѬѬ*ѬѬѬѬѬ$ѬѭݭݭЭЭѭܭ1ѭЭPP  1ѭѭѬ  Ѭ!PѬ ѬPPѬPլάPЬPAP Zs \f  Zd  _del_step.R1_arc .R2_sqrt_move_quadL_abs_cont.R3.R4box.o T@0ݬݬݬݬݬݬ ݬݬ ݬݬݬݬ    % 2 ? L _box.R1_move_contcircle.o |$0ݬ ~ݬ ~ݬݬ _circle.R1_arcclose.o 4p0   ! ' . _closevt.R1_putch__iob_fflush_closepl.R2dot.o D _dot((.R1erase.o @8^     ! ( / 8 _erase.R1_putch_ohiy_ohix_oextra_oloy_sleeplabel.o L(P( [ Z[KZ[ Z[KZ[ Z[KZ HHHHHHJJJJJJJJJJ DDDDDDEEEEEEEEEE  $ : C_lbl_mv_lbl_umv_label.R1 _putchline.o  @ݬݬݬݬ    _line.R1_move_contlinemod.o t0^ЬP`PPd:Pl*PsЬP1ca~dЬPdݐbې`  L _linemod.R1_putchmove.o @ݬݬ  _move.R1_putch_contopen.o h@_openvt.R1_openpl.R2point.o  @ݬݬݬݬ   _point.R1_move_contscale.o  Tl0PHPPcPiPu!ddffgPvPgPvP"A\("A\(HDHD@@$,4<FN V^ e _scale.R1_scalex_scaley_scaleflspace.o h XvvnPvPnPvPì PnPPgPPvPìPnPPgPPvPCFCF    * 0 CK [c _space.R1_botx_boty_obotx_oboty_scalefl_scalex_scaleysubr.o D( ^nPVRcRPRVPdRPVR`PRjRPPnPVRcRPRVPdRPVR`PRjRPPPPxPPPPPPPˏP~eP{~QPP PѭY ~ЭCѭ?Hѭ9ɏ`~Эɏ`~ ~ЭNѭ*ɏ`~]ɏ`~MЭѭɏ`~)Эɏ@~ЭP׭PfbP[``PHݬ.@@  5@J  %/AQYcu}     _obotx_oboty_botx_boty _scalex_scaley_scalefl_oloy_ohiy_ohix _oextra$_cont.R1_abs_putch.R2__iob__flsbufJ  %/old/lib/lib450.a 755 0 33 15754 2423022502 6546 e__.SYMDEFS 4_arcX_box_circle_closevt$_closepl$_dot_erase|_label(_line_iline_cont_linemod _move _xnow _ynow _OUTF _ITTY _PTTY _HEIGHT _WIDTH _OFFSET _xscale _xoffset _yscale _botx _boty _obotx _oboty _scalex _scaley _openpl _openvt _point_space_abvalT_xconvT_yconvT_inplotT_spewT_outplotT_tobotleT_resetT_dist2T_swapT_movepT_xscT_yscTarc.o D _arc.R1box.o T@0ݬݬݬݬݬݬ ݬݬ ݬݬݬݬ    % 2 ? L _box.R1_move_contcircle.o D _circle.R1close.o  $p    _closevt.R1_closepl .R2__iob_fflush_resetdot.o D _dot.R1erase.o $0^ԭ ֭nPqPC _erase.R1_spewlabel.o& (@^ݭЬP֬`   _label.R1_xnow_spewline.o5 (0ݬPPݬ PPݬPPݬPPAݬPPݬPxPpj^ݬݬPݬݬ ݬݬ=pP~3f-PjPPPì PnPPvPìPnPPvPQ  Q  խvvnPVRfPRvRnPVRfPRvRԭ׭1nPVRdPRnP`PRnPbPRjRPPPtPkP ~ZЭP׭PnPVRdPRnP`PRn7PbPRjRPPP%PP ~ ЭP׭P.QA   & 2 ; G P Yf o {     $,U v          _line.R1_ysc_yconv_xsc_xconv_iline_cont^.R2_ynow_xnow.R3_movep_dist2_sqrt_inplot_abval_spew_outplotlinmod.o< D _linemod.R1move.oB 4p(ݬPPݬPP   & / _move.R1_ysc_yconv_xsc_xconv_movepopen.oH P,(VPdPgPPjPPPqVkPdPgPPjPPPQVSPdPjPPP9/AA@@FpCF@CpC     # ) / 6 < E L Q X ^ d k qx   _xnow_ynow_OUTF_ITTY_PTTY_HEIGHT_WIDTH_OFFSET_xscale_xoffset_yscale_botx _boty_obotx_oboty_scalex_scaley _openpl.R1_printf_gtty_reset_signal_stty_openvt.R2point.oM  @ݬݬ.   _point.R1_move_labelspace.oR p` PvvnPvPnPvPì PnPPgPPvPìPnPPgPPvPFF    * :B RZ _space.R1_botx_boty_obotx_oboty_scalex_scaleysubr.oa x` լЬPάPPPP-3$4Ѭ 0P}``PkR XTPM``P:ݬ ݏݏ L^ì PnPPvPìPnPPvPEPVPPERVRR`RP^ммЭ^Ѭ ѬukPѬP UOPnPPfCPjPPP5 nPd%PjPPPݭP ݭrЭP׭P~P ݭ@ЭP׭P PnPPfPjPPP  nPdPjPPPqݭgP ݭЭP׭PF~_d_mod?_d_nint?_d_prod@_d_sign A_d_sinA_d_sinh$B_d_sqrtB_d_tanC_d_tanhC_i_absD_i_dimhD_i_dnntD_i_indxE_i_lenPF_i_modF_i_nint G_i_signG_h_absdH_h_dimH_h_dnnt8I_h_indxJ_h_lenJ_h_modK_h_nintK_h_signdL_l_geL_l_gtpM_l_leM_l_ltN_l_geO_l_gtO_l_le,P_l_ltP_ef1asc_DQ_ef1cmc_Q_s_catHR_s_cmpR_s_copyS_cabs\T_tanhlU_sinhV_coshVmain.o\ d4@ЬЬx{xP gP Vyrf1gddbЬ[B-լ Floating ExceptionIOT TrapQuit signalInterruptKilled%s    #, 2; I OX f lu |          ! , _xargcm_xargv_main_signal_f_init_MAIN__?_f_exit__iob_fflush_fprintfW_abort_exit(s_rnge.o\ xl`ݬ[ _?Ь P֬ Q`aЬ P֬ `~[[~[ ?ЬP֬Q`ayЬP֬`~H[[U.' Subscript out of range on file line %d, procedure . Attempt to access the %ld-th element of variable .    # 2 9 D U gm t          _s_rnge__iob_fprintfW__flsbufh__cleanu_abortabort_.o\ $ P(Fortran abort routine called      _abort_F__iob_fprintfW__cleanu_abortgetarg_.o\ P0Ь[ռѼxPP`ZZY jYY  YY   (_getarg__xargcm_xargviargc_.o\ T P _iargc__xargcmgetenv_.o\ ` X YЬZ ZZYj ZYЈ[)ЬZZYܑ=׬֬k  ֬P _getenv_4_environ%signal_.o\ h ^ммݭݭ _signal__signals_stop.o\ `h^լm ԭ;ЬP֬Q`aЬP֬`~֭ѭySTOP statement executed   $ 3 : E V fl s z  _s_stopu__iob_fprintfW__flsbufh_f_exit_exit(s_paus.o\ p^լGԭ;ЬP֬Q`aЬP֬`~֭ѭ~{P1a[WPP`P A:Pg\+'P `P  Po,P`P P Y/4P$|iPAUSE statement executed To resume execution, type go. Any other input will terminate job. STOP To resume execution, execute a kill -%d %d command Execution resumes after PAUSE.    $ 3 : E V fl s y                  " -3 : A J S ]c j py    _s_paus__iob_fprintfW__flsbufh_isatty{__filbuf_f_exit_exit(_getpidD_signal_pausesystem_.o] L ^Ь[PѬЬQ2QQPYZkZYjE _system__system8pow_ci.o] |4  ^VЬPVݬ ߭߭vЬPv _pow_ci_pow_zikpow_dd.o] \ p~p~  _pow_dd _powpow_di.o%] X^ppмխ%qpPέgddx@@"6_pow_dipow_hh.o.] T^702P2PQPQQ2P2QPQQ2PxPPP2P_pow_hh!pow_ii.o5] h8 ^ммխĭĭxЭP_pow_ii'pow_ri.o=] X^pVмխ%qpPέgddx@@"6_pow_riKpow_zi.oH] , ^м pЬPpխխέݬ߭pЬPp5ePЬReRcRPePЬReR`RPЬRpPpx%ePeRcRPejPdPp@A 7 _pow_zik_z_div)pow_zz.oR] hp0(^ЬPp~p~pP~pPp~ЬPp~pPЬ Pee PcP~pPe Ь PePaPp~pPePp~kpPePPЬRpP  5 V |  _pow_zz_cabs_log_atan2_expG_cos_sinxc_abs.oZ] ` ЬPV~V~ _c_absD_cabsc_cos.od] \P ^ЬPV~pPV~dPvPV~rPЬPV~pPePPЬRvP  2 E _c_cos_cosh_cos_sinx_sinhic_div.oq] ( 0 ^V qrЬ PVqrqyqЬ PG PVPPpPЬ PeR`RVPeRPVPdPЬRVR`PRfRvRЬPVPdPVRcRPRfRЬPvR_Ь PG PVPPpPePPP`TPV RePRЬPVPdPVR`PRfRvRЬPVRdRVPbRPfPЬRvP@@&<E f_c_div_abortc_exp.oy] T@^V~pPЬPV~pPePPvPЬPV~pPePPЬRvP   ; _c_exp(_expG_cos_sinxc_log.o] @@V~ЬPV~ЬRvPЬPV~V~pP~vP , 6 _c_log,_atan2_cab((s_logc_sin.o] XP ^ЬPV~pPV~dPvPЬPV~pPV~dPЬRvP  6 E _c_sin_cosh_sinx_sinhi_cosc_sqrt.o] @0X^ЬPV~V~pPqPЬPvP1VPqP8VPP`PeP~vPЬPGPVPPfPЬRvPbVPcPe~hЬRvPЬPVPqPЬPVPrPRЬPvRЬPЬQGRVRRf]RvR@A@A +@PX o _c_sqrt_cabs_sqrt z_abs.o] ` ЬPp~p~ _z_abs_cabsz_cos.o] \P ^ЬPp~pPp~ePp~rPЬPp~pPePPЬRpP  0 C _z_cos=_cosh_cos_sinx_sinhiz_div.o] t( 0 ^p qrЬ PpqrqSqЬ Pg eR`ReRePЬR`PgPЬPePbPBЬ Pg eP`~PeP ЬPePaPRgRЬPeRcRPfPЬRpP@@&<E \_z_div)_abortz_exp.o] P@^p~pPЬPp~pPePЬPp~pPePPЬRpP   8 _z_exp_expG_cos_sinxz_log.o] @@p~ЬPp~ЬRpPЬPp~p~pP~pP , 6 _z_log_atan2_cabs_logz_sin.o] TP ^ЬPp~pPp~ePЬPp~pPp~dPЬRpP  4 C _z_sin_cosh_sinx_sinhi_cosz_sqrt.o] @0X^ЬPp~p~pPqPЬPpp1q4aPeP~pPЬPgPfPЬRpPHce~rЬRpPЬPqpRЬPЬQgRg|R@A@A +=LT h _z_sqrt1_cabs_sqrt r_abs.o^ \VPqPVPPVPrPP _r_absr_acos.o^ X V~  _r_acos_acos/r_asin.o^ X V~  _r_asin_asinXr_atan.o$^ X V~  _r_atan_atanr_atn2.o6^ \ V~V~  _r_atn2_atan2r_cnjg.o?^ LPЬPVPrPRЬPvR_r_cnjgr_cos.oK^ X V~  _r_cos=_cosr_cosh.o[^ X V~  _r_cosh _coshr_dim.ob^ \Q CPVPPpP_r_dimr_exp.oi^ X V~  _r_exp_expGr_imag.ot^ < ЬPVP_r_imagr_int.o}^ 4 ^VPqP VP~VPrP~rPPpP  ( _r_int_floorr_lg10.o^ x  ^V~pPePP?[7r(  _r_lg104_logr_log.o^ X V~  _r_log_logr_mod.o^ P ^GPVPPpPqPpP~pPr~rPpVPdPVRcPRP! 2 _r_mod_floorr_nint.o^ D (^VPqPVPPaP~VPcP~rPPpP@@   -5 _r_nint_floorr_sign.o^ @^VPqPVPP VPrPRpRPvPVPqPVPVPrPP ,_r_signr_sin.o^ X V~  _r_sin_sinxr_sinh.o^ X V~  _r_sinh_sinhir_sqrt.o^ X V~  _r_sqrt1_sqrt r_tan.o^ X V~  _r_tan_tanr_tanh.o^ X V~  _r_tanh_tanhd_abs.o_ XqpPrP_d_absd_acos.o_ X p~  _d_acosb_acos/d_asin.o_ X p~  _d_asin_asinXd_atan.o+_ X p~  _d_atan_atand_atn2.o6_ \ p~p~  _d_atn2d_atan2d_cnjg.o@_ DpЬPЬPpR_d_cnjgd_cos.oI_ X p~  _d_cos _cosd_cosh.oS_ X p~  _d_cosh_coshd_dim.o__ \qcPpP_d_dimd_exp.oh_ X p~  _d_exph_expGd_imag.or_ < ЬPpP_d_imagd_int.o|_ 0 ^q p~r~rPPpP  # _d_inth_floord_lg10.o_ x  ^p~pPePP?[7r(  _d_lg10_logd_log.o_ X p~  _d_logl_logd_mod.o_ L ^gPpPqPpP~pPr~rPRpRpRePcPP / _d_modp_floord_nint.o_ < (^qa~c~rPPpP@@  %- _d_nint`_floord_prod.o_ < EPVPP_d_prodd_sign.o_ 0^qpPrPpPqrP !_d_signd_sin.o_ X p~  _d_sin_sinxd_sinh.o_ X p~  _d_sinh_sinhid_sqrt.o_ X p~  _d_sqrt_sqrt d_tan.o_ X p~  _d_tan_tand_tanh.o_ X p~  _d_tanhh_tanhi_abs.o_ DռмPμP_i_absi_dim.o_ DѼüPP_i_dimi_dnnt.o` < (^qa~c~rPPpPjPP@@  %- _i_dnnt(_floori_indx.o` X^ì PPԭЭP֭ЭQ֭`a֭ѭЬѭPP_i_indxXi_len.o` 8ЬP_i_lenxi_mod.o` DǼPļPPP_i_modi_nint.o'` D (^VPqPVPPaP~VPcP~rPPpPjPP@@   -5 _i_nint_floori_sign.o.` T$^ռмPμPPռέP_i_signh_abs.o6` D2P2PPP_h_absh_dim.o?` P 2PЬQ2aQQPP2PP_h_dimh_dnnt.oJ` < (^qa~c~rPPpPjPP@@  %- _h_dnnt((_floorh_indx.o[` X^ì PPԭЭP֭ЭQ֭`a֭ѭЬѭP2PPP_h_indxh_len.od` 82P_h_len8h_mod.om` L2PЬQ2aQQPRQRRPR2RP_h_modph_nint.ot` D (^VPqPVPPaP~VPcP~rPPpPjPP@@   -5 _h_nint`_floorh_sign.o{` `0^2P2PPPP2PP2PPP2PP_h_signl_ge.o` l$ ݬݬ ݬݬPPP _l_ge0_s_cmpal_gt.o` l$ ݬݬ ݬݬPPP _l_gt_s_cmpal_le.o` l$ ݬݬ ݬݬPPP _l_le_s_cmpal_lt.o` l$ ݬݬ ݬݬPPP _l_lt_s_cmpahl_ge.o` l$ ݬݬ ݬݬPPP2PP _l_ge0_s_cmpahl_gt.o` l$ ݬݬ ݬݬPPP2PP _l_gt_s_cmpahl_le.o` l$ ݬݬ ݬݬPPP2PP _l_le_s_cmpahl_lt.o` l$ ݬݬ ݬݬPPP2PP _l_lt_s_cmpaef1asc_.o` d ݼPP~ݬ ݬ _ef1asc__s_copycef1cmc_.o` ` ݼݼݬ ݬ _ef1cmc__s_cmpas_cat.o` \^мԭ֭֭֬ѭ/ЬЭP@ @ ­ЭP@ ֬_s_cats_cmp.o` lЬ[ЬZ [YZXѬ (ZX8kj [ZkjkP PjQQP[Z[YZXj Z[[Y k kP PP_s_cmpas_copy.o` \^ PPѬ Ѭ;֬֬PP ֬֬Ѭ  ֬Ѭ_s_copyccabs.o` x ^qrq r q pp p a PqPpPg ePaP~pPePpP@ Yb _cabs_sqrt tanh.oa \ 00^pq rpqpPp~pPp~pPePfP@B(: I _tanh_sinhi_coshsinh.oa 80 ^[q(r[[q"p~gP[pPrPq/r~pPp~cPn[PdPfPeeP`{PdP`hPdP`UPePaxPdP`cPdP`PPfPn[PdP^qurqnp~fcPr~pPp~`PfEP%yگ\.0k4aѶoqB;%ymGt -ϭBA@ABAA + 1JW f y  % /_sinhi_expG_coshP`hPdP`UPePaxPdP`cPdP`PPfPn[PdP^qurqnp~fcPr~pPp~`PfEPold/lib/libI77.a 644 0 33 144564 2423022504 6625 e__.SYMDEF> d_f_back_s_rdfe\ _c_dfe\ _y_getc\ _y_err\ _y_rsk\ _s_wdfe\ _y_putc\ _y_rev\ _e_rdfe\ _e_wdfe\ _s_rduex_c_duex_s_wduex_e_rduex_e_wduex_icptr_icend_svic_icnum_icpos_z_getc_z_putc_z_rnew_s_rsfi_c_si_y_ierr_s_wsfi_z_wnew_e_rsfi_e_wsfi_f_inquX*_setcili/_setolis/_stcllis/_setalis/_f_rewX1_s_rsfe,3_x_getc,3_x_endp,3_xrd_SL,3_x_rev,3_rd_ed0:_rd_I0:_rd_L0:_rd_A0:_rd_AW0:_rd_F0:_rd_ned0:_rd_POS0:_rd_H0:_recloc@H_s_rsue@H_c_sue@H_s_wsue@H_e_wsue@H_e_rsue@H_reclenO_do_usO_do_uioO_do_udO_s_wsfeS_x_putcS_xw_endS_xw_revS_x_wSLS_pr_putS_e_rsfe`[_c_sfe`[_e_wsfe`[_syl]_parenlv]_pc]_revloc]_pars_f]_f_s]_op_gen]_f_list]_i_tem]_ne_d]_e_d]_gt_num]_ap_end]_cnt]_ret]_cp]_rp]_workdon]_en_fio]_do_fio]_type_f]_fmt_bg]_s_wsleLp_t_putcLp_l_writeLp_e_wsleLp_lwrt_ILp_lwrt_LLp_lwrt_ALp_lwrt_FLp_lwrt_CLp_lioprocPx_ltabPx_l_commaPx_l_firstPx_t_getcPx_e_rslePx_lquitPx_lcountPx_ltypePx_lcharPx_lxPx_lyPx_l_readPx_l_RPx_l_CPx_l_LPx_l_CHARPx_rd_intPx_s_rslePx_c_lePx_do_lioPx_f_openL_isdevL_fk_openL_f_clos_f_exit_flush__g_charx_b_charx_inodex_mvgbtx_curdirx_dcatx_fullpatx_f_end_t_runc_mv_cur_w_ed_wrt_I_wrt_IM_wrt_L_wrt_A_wrt_AW_wrt_E_wrt_G_wrt_F_w_ned_wrt_AP_wrt_H_units_init_elist_reading_cplus_cblank_fmtbuf_externa_doed_doned_doend_donewre_dorever_sequent_formatt_getn_putn_cf_curunit_recpos_cursor_scale_F_err_fatal_f_init_canseek_nowread_nowwrit_icvtxbackspace.ob (4^ЬPѠ ՠ'ռ eݏeePЬP,P@ЭPՠ'ռ jݏjjPս'ռ rq}ݏr\rPЭPѠ LԠ Dݽ>PЭPǠ QĠ QQ׭ЭPƠ Ġ ݭݽPЭPՠ$PݭЭPՠ ՠ1ݏݽݽ߭έPP~ ݭݽݽí~߭}PPޭPЭQA` QPíP~1H׭խխ1Bխ%ռ 5Kݏ Pݭݽ ݽPPѭ 1Mԭ1Kbackspacebackspacebackspacebackspace %2 G _ gt       : K j      _f_back.R1_errno_fatal_units_ftell_fseek_t_runc_nowread_freaddfe.ob  8^ݬPPՠ$ Pv{unP'ռ d]UݏdHdPP7  *" n:ݏnnPstartiostartwrtstartchkdfedfedfereadingddoutdfe  * 0 ? EJ P U [ ` fk q v |              " ' -2 8 = CH N U f n{  " " & ' ' ( ) * * + + ,   &- + 1 H. Y an y ~/       / 0   * -/ 5/ A/ H2 N* T* [ o / / / 2 *  * /   )     ! ,* 2 9* I/ Q/ f/ p5 x)    *  *  * )   _s_rdfe((.R1_init_f_init_c_dfe_reading_curunit_nowread_y_getch_getn_rd_ed_doed_rd_ned_doned_y_err_donewre_dorever_y_rsk _doend_fmtbuf_pars_f_errno_fatal_fmt_bg_s_wdfe.R2_nowwrit_y_putc(_putn_w_ed_w_ned_y_rev_e_rdfe.R3_en_fio_e_wdfe.R4.R5_sequent_externa_formatt_elist_recpos_scale_cursor_units_fk_open_cf_fseek.R6__filbuf.R7.R8__flsbuf.R9.R10due.ob T$^ݬ]PPՠ$ PP^ݬ%PPՠ$ PPЬPѠ ՠ'ռ ee]ݏePePE?:4/(ЬP,P@Ь @ЬPݠݬP'ռ hݏhhPPՠ'ռ fݏffPPՠ ռf'ռ rWeݏrBrPЬPP,Qš P~ PԠ PPѠ  PP ~Qǡ PRġ RRPR ݏPostartioduecduecduecduesyserr  ! 0 ER X g r {              '4 ? D J ] er }            $ + 1 8 > T ^ fs _s_rdue.R1_c_duen_reading_curunit_nowread_s_wdue8.R2_nowwrit.R3_init_f_init_errno_fatal_formatt_sequent_recpos_externa_units_elist_fk_open_cf_fseek_e_rdue.R4_ftell_e_wdue|.R5iio.ob L , X,Pՠ ݏPPQPP nݏnxnPje*] nSnPWݏn;3P,&QPPPQġPPP^ݬP~zsP^ݬSPTNIC>3("PЬPР P'ռ dݏddPЬytnPРePQšPVPPP A;5P.(QP^P^PPЭPPQP  nݏnnPendfilerecendinwriterecendstartintiio    &3 = D J W ^ e o w            # ) 9G M R X ] ch ns y ~            ! ! "  "/ ;# B$ H$ M% S& Y' _' d( j( o) w }              - ! - !  # 2 9 ? M S ^1 h p} _icptr_icend_svic_icnum_icpos_z_getc.R1_errno_fatal_z_putc.R2_z_rnew.R3_s_rsfi..R4_c_si_reading_rd_ed_doed_rd_ned_doned_getn_y_ierrZ_donewre_dorever_doend_s_wsfi.R5_w_ed_w_ned_putn_z_wnew.R6_fmtbuf_pars_f_fmt_bg_formatt_sequent_externa_scale_cplus_cblank.R7_e_rsfi.R8_en_fio_e_wsfi.R9.R10_elistinquire.oc `Tp^ЬPՠeЬPݠ ݠPԭԭѭ \,P,P,P@֭ԭЬPѠ ՠ,P@iԭԭЬPՠ&խ խխ ЬPЬP԰ЬPՠ#խ խP խսPЬQPЬPՠÏP,PЬQPЬPՠ$խխЭPՠ ЬPЬP԰ЬPՠ 7խ ݠ$ݠ խ!ЭPՠЬPݠ$ݠ ЭPݠzЬPՠ(<խ7ս2ЭPՠ ЬPݠ,ݠ(NЬPݠ,ݠ(C5ЬPՠ0<խխЭPՠЬPݠ4ݠ0ЬPݠ4ݠ0 ЬPՠ8<խխЭPՠЬPݠ<ݠ8ЬPݠ<ݠ8ЬPՠ@<խЭPՠЬPݠDݠ@խЬPݠDݠ@fЬPՠHݠLݠHJЬPՠP<խխЭPՠЬPݠTݠPXЬPݠTݠPJЬPՠXխ ЭPЬQР XЬPՠ\*խ%ЭPՠ ݽЭQơ PPЬQP\ЬPՠ`<խ7ЭPՠ.ՠЬPݠdݠ`ЬPݠdݠ`rPdirectsequentialyesnoyesnoformattedunformattedyesyesunknownzeroblank% 0 L \ j       8JQ x   3 q _f_inqu.R1_g_char_inode_units_b_char_ftelllib.o-c `ЬPЬЬPЬ ЬPЬЬЬPЬЬ ЬPЬЬPЬ ݬ ЬQP ЬPЬЬPЬЬPЬЬPЬ ЬЬPЬЬPЬ ЬPЬЬ K _setcili.R1_setolis,.R2_strlen_stcllis|.R3_setalis.R4rewind.oGc P^ЬPѠ ՠ'ռ eݏeePЬP,P@սPЭPՠ'ռ jݏjjPЭPՠ$Piݭ_ݽUЭPԠ rewindrewind %2 G g o|    _f_rew.R1_errno_fatal_units_nowread_t_runc_rewindrsfe.oxc <^ݬPЬЬPР ,P@{vpiP'ռ dXPݏdCdP3-("4 7*PРՠ$ PP^Pՠ :PРQ֠aP PP  P}wrP^cPՠ PSKPРQ֠aP 81PP"P ݭЭPѭ P P PPstartio   * 1 8 ? G M S X ^ j v {                ! " *# 9 E M ` g%        %   '    )5_s_rsfe.R1_init_f_init_c_sfe_reading_sequent_formatt_externa_elist_recpos_cursor_scale_fmtbuf_units_curunit_cf_pars_f_errno_fatal_x_getc_getn_rd_ed_doed_rd_ned_doned_fmt_bg_x_endp$_doend_xrd_SL2_donewre_x_rev0_dorever_cblank_cplus_nowread.R2__filbuf.R3_ungetc.R4.R5rdfmt.oc H0^PЭPbP* n# ݏnnPPՠ1|uoмPPW44W444444444444-ݼ > ݬ ЬPݠݬT1P jW ݏjjPЬPݠݬ<ݬ ݬ}-ݬ ЬPݠݬݬ ЬPݠݠݬHPP1eP 1ePSMPмPP d\;Jdt"ݼ 3 ЬPݠЬPݠݠЬPPЬPPPЬP ^Ь[ԭԭԭѭ1PЭPP2<fP,JP  

1;ѭ-ѭ9ѭ0 PP0P'ѭ ѭ  ѭ,"ѭ ѭ+ѭ 昏sPխԭ f#֭ѭ ԭ f֭ѭ`խԭѭ$f֭ԭ d֭ѭխrխ4k f׭խQ d֭խѬvpP^ԭ'Pѭ ЭP PP֭֬ѭP^Ѭ VԭPЭP֭ì PѭPԭ!PP  PP֭֬ѭ Pԭ!~PP  PP֭֬ѭԭ ֭֬ì PѭP^ԭ'/Pѭ  PЭPP֭֬ѭP^֬P ЬPPѭ  PЭPP B@C B B@C B B B B B B Bfmtfmtrd_ed, unexpected code: %d %s rd_ned, unexpected code: %d %s   ! ) 1 6 ? I Q^ i z      !. HWm        , : E S y       * :H X  7E\i     !8^p   ( N ~  ' _rd_ed.R1_getn_cursor_recpos_elist_errno_fatal_curunit_cf_fseek_fmtbuf__iob_fprintf_abort_rd_IZ_rd_LT_rd_A_rd_AW_rd_F_clearer_rd_ned.R2_rd_POS_rd_H_donewre.R3_cblank.R4.R5_scale.R6.R7.R8.R9sue.oc  X^ݬ2PPՠ$ PPzP 4P ЬPՠ tlݏ_PUNռ C><0)#PP^ ݬPPPՠ$ PPPЬPѠ ՠ'ռ eݏe{ePoid^ЬP,P@NIЬA;@ЬPݠݬ$P'ռ rݏrrPPՠ4ռ g  ռݏggPPՠP^|uPic\VLEݭ:3P&!PP~Pstartstartstartiosuesuesue  * 0 6 E K U \ g s           & , 3 : D K l t               ' /<I T i s z               _recloc_s_rsue.R1_init_f_init_c_sueR_reading_recpos_curunit_nowread_cf_reclen_fread_errno_fatal_clearer_s_wsue.R2_nowwrit_ftell_fseek.R3_sequent_externa_formatt_units_elist_fk_open_e_wsueb.R4_fwrite_e_rsue.R5uio.oc l]Ŭ PP* nݏnnPݼݬ ݬPŬ PPݼݬ ݬvlݬ ݬݬZݬ ݬݬŬ PP93P, 0Ѡ * nݏnnP@ݼݬ ݬP: Pݼݬ ݬPeof/uioeof/uioeof/uio    & 0 8E P ` p v         " . 7 ?H R b _reclen_do_us.R1_reading_recpos_elist_errno_fatal_cf_fread_fwrite_do_uio.R2_sequent_do_ud.R3_curunitwsfe.od pl ^ݬPЬЬPР ,P@|wqjP'ռ dYUݏdDdPi4.)#TW"PРՠ$ PPPРQ֠aaPݬѬ <}1rPРQ֠a^PРQ֠ aaPmHI?Ѭ03+ ?Ѭ1@PРQ֠ a 1yݬ P P Pstartio   ) 0 7 > F L R W ] i u z               !  " )# 4 : B Y c% l y          % ' - 3 C N+ Y _+ e+ _s_wsfe.R1_init_f_init_c_sfe_reading_sequent_formatt_externa_elist_recpos_cursor_scale_fmtbuf_units_curunit_cf_pars_f_errno_fatal_x_putc0_putn_w_ed_doed_w_ned_doned_xw_end<_doend_xw_revJ_dorever_x_wSL _donewre_fmt_bg_cplus_cblank_nowwrit.R2__flsbuf_pr_puth.R3.R4.R5.R6_workdonsfe.o!d Hp^P^ЬPѠ ՠ'ռ eݏeePЬP,P@ս@ЬPݠݬP'ռ rppݏr[rPЭPՠ'ռ f@Dݏf+fPPstartiosfesfe  5 =J _ {     _e_rsfe.R1_en_fio_fmtbuf_c_sfe.R2_errno_fatal_units_fk_open_e_wsfe.R3fmt.ovd d X ݬPPP֬ ЬP֬`(PPPЬݬPݬP֬ ЬP֬ ݬRPP ֬,֬Ǒ) ֬ЬP ^)ЬP߭ݬSPЭP߭ݬP߭ݬPݭPPݭݬ ^ԭPP811P211P-11P"1 1P1P֬ЬP`z֬ЬPЬPs֬ЬPpݭ֬߭ݬPPPH@Ph7Pp Px1@խέݭ1Vݭ1J~ݭ 16ݬ ݬP1ЬPl ֬ЬPr߭~P׬ݭ11m1XP'1|1|P01 P/11gP111\P61P4P31CP5118P711-Pp$P:1 P911 Pb11Pt1Ps1#1Px1<1^ԭԭЬ߭ݬPݭWP֬Pa 66/X3666661ЭP߭ݬvPխё.֬߭ݬWPԭE ݭݭѭPPPP1֬߭ݬPݭݭݭѭP߭ݬPխ1^ݭ 1K߭ݬPխ15ݭ1"֬ 0+9%߭ݬPխ1ݭ11߭ݬQPխ1.֬߭ݬ/Pԭݭݭ1߭ݬPխ{.֬߭ݬPԭݭݭI߭ݬPխ6. ݭ֬߭ݬPݭݭ խ1ЬP^xvP@nf, YSmF?ЬЭPЬЭPЬ ЭPЬ P ^ԭԭ0( PQQP0P֭֬ 9խЭЬP^߭ ^ԭѭ1xPPP`Pl,,O,r,,,,,,#2;DݽWU.( dQݏd ((dPݬݭP֭ 1B1=P@լP@ݬ ݬݭP0 }xjc]Pխ1fMPՠ @~ݏ+PЭPQРA 1.ЭPQРA1P@1P@1ЭPРլ1P{P1լ11`1V1wЭPРG1h>1_41U(" PPЬPPEIMUUQY@@YUUUUU@@@@@@@YYYYYYYYYYЬPPPPP PP^֬fd\(֬ЬP`ݏd2dPformat too complicated: %s unknown code in do_fio: %d %s do_fiofmtfmtbad string     &V ] j z  )?PdzU#Y v'g)Sh         Sm t    # $ % &   & / 7 E' L T [ k( w# $ $ $ % $ # $ %            $  *  3  <  A  G  P  V  [  g  u  ) * * + , , / /             # $  % _syl_parenlv_pc_revloc_pars_f.R1_f_s8.R2_op_gen~_f_list.R3_i_tem.R4_ne_d_e_d_gt_num.R5_ap_end .R6.R7_fmtbuf__iob_fprintf_abort.R8_cnt(_ret(_cp_rp_workdon_en_fio@.R9_do_fioX.R10_type_f _elist_errno_fatal_doned_doend_doed_dorever_cplus_scale_cblank_fmt_bg .R11_cursor.R12.R13lio.od H,`^ݬP=.Pՠ$ PP  PztlPРQ֠aaPUݬK^ݬL߭2߭("PPP  ޭPPЭP֭`~lPPP J\~^PPP  ԭЬP֬`~֭ѭq`Cq\9 KPPP 2, \~3PPP } \~PPP F 7(.p~=,p ~)) ^ԭѭ1ЬPP#*CJ\qkݏI2мݭ ֭Vpp~ЬVVЬppp~p~ݼݬ ݬP@ B %ldunknown type in lio   ) 0 7 =B HM S b qw           06 C Q dj s      ! ! 4: CLW`kt% #/>_s_wsle.R1_init_f_init_c_le_reading_externa_formatt_t_putc~_putn_l_writez_lioproc_curunit_nowwrit_e_wslej.R2_recpos.R3_cf__flsbuf_lwrt_I.R4_sprintf_strlen_lwrt_L.R5_wrt_L_lwrt_AH.R6_lwrt_F.R7_scale_wrt_F_wrt_E_lwrt_C.R8.R9_fatallread.od ( p^Pՠ PPРQ֠aP PPP P ^Pՠ PPP P^ԭѭWPLPՠ ,@Pՠ 3ݏP1 ;3ݭ11PPzP P P,P/PЬPP$$3B=^P0ЭPPP~P*1P Pՠ11P 9P PЬPP)6CMWr6 ֭1j}PPjpPPvcpYЬvJv>Ьp/p#ݬ ݬ 1m<^ԭԭp{ pppԭЭȭЭ̭P߭PPPPP*"Ppp ߭YPխ]PP.%p pPjPPP;ݭ1߭ PխP@ r PЭQA`SQԭpx խjPPխ1խqU  rԭ*Q߭pPf( ֭ѭܭ`ԭ d ֭nPqPԭ f ֭nPrRqPRխr#p1G^ԭԭp PP-9ѭ+ԭ.ݭ֭e PnR`RPc PP@PխrpqX ЭPЭP^c1iXQPP(gA:4` (!P@ P P,1P= E P1P * p ݏppP {P ݏd\PSMP A] 1U  PP*PP(1PPP@P P@P)1 1P@wP 1x1f^_PTMPDPЭQA`10Q'!c PP*nP * p% ݏppP  ݏPݭPP. yPЭPPFSPTPfAPtEp+B;4-P@"AP6p PЭQA`PЭQA` Qݭ1o11^PPPЭQA`bQxrf_XPP*:I p?ݏp*pPݭPP'P"X  ݭPP1`qiPЭQA`PЭQA`Q  ѭsݭi1`11ݏq?qPԭEѭ SѭI֭ѭ#=ѭ LЭP\׭׭֭ѭO֭PQPQѭ,ѭPPQPQ5֭ѭݭPPPPxݭn֭1^YPݬZP6/(! Pՠ$ PP`ЬPѠ ՠ'ռ e?ݏeePЬЬP,P@~ys@ЬPݠݬ\P'ռ fKݏf6fP+& Pՠ'ռ g ݏggPPݼݬݬ ݬ@ B B B B@C@list inlist inlist in%dcomplex formatlreadno starlread%lfno comma%lfno )%dno starlreadlogical%dno starno quoteno spacelist iostlerliolio   2 9 M Y k {          " , 5 > El u        # +1 8 > F f n           ) 4 >Ve n }    6 Ka j t   ( 5CMY ` i       "    ! '- 4" B N X `m x          $ - 3 9? F" MYe pz       "    "/ : C KX b l s     #  -  6  A O Z a k {     "              % , & 3 (( =  H  R  Z j         < d  k ' r    * +  - . /      0   2 ;  C P  [ 3 a 3 f 4 n  ~ 5   6          ! _lioproc_ltab_l_comma_l_first_t_getc.R1_curunit_cf__filbuf_e_rsled.R2_lquit_lcount_ltype_lchar_lx_ly_l_read.R3_elist_errno_fatal_ungetc_l_R_l_C_l_L_l_CHARH _clearer_b_char.R4_rd_int.R5__ctype_.R6_fscanf.R7.R8_free_malloc_realloc_s_rsle .R9_init_f_init_c_le _reading_externa_formatt_nowread.R10_fmtbuf_recpos_scale_units_fk_open_do_lio .R11open.od D^ЬPѠ ՠ'ռ eݏeePЬP,P@ս17ЬPЭQР ЬPՠ  PPb ЭPЭPԠЬPՠVЭPՠ ^ЭPԠЬPՠ%PPn1ePo Ps1ЬPՠBռ%k.ЬPPPfЭPݏkkPЬPݠ ݠЭPԠ(ЬPPPo1Pռ }wP~ݏqbqPЭPݠKЭPԠ P'G$PPUռ1w"PP ЭP$+PQPЭPԠ$ݽЭQPЭQPP2ռlռ1g1ݏlelPЬPՠЭPՠ ݽDPЭP(V(P~ЭQPЭPՠ1ռ1t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P?ЭP֭`~֭.ԭЭP֭`~֭ѭ VPqP zԭѭdѭ ݏeRխ-Dέ +4Ѭ ѭd(ǏdP0P~ǏdPďdPPѬ P0P~ P PPP0P~1 ^pѬVPpPpPqPrPqݬݬݬ ݬݬ<ԭkqYaլݬí ~í~ݬ?Pԭ %֭ѭЭЭP֭d%ѭ 1o ^ѬVPpPpP?ԭѭ*d֭ԭ f֭PѭP߭߭ݬ p~PέPP ԭխh PխЭQQQPPԭ *0֭ѭPԭ ֭ѭխ-  +ԭЭP֭`~֭ѭ((.ԭѭ 50֭έPѭP ЭP֭`~0֭ѭ 1W@> B B Bleft offfmtw_ed, unexpected code: %d %s w_ned, unexpected code: %d %s     % * 3 = ER ] k q x ~        6Ngu    & 1 < L Z j|     " 8 |     / : H m   < d }   ( )  , G j u {( (   ( (  ( (  (  '( A O e z(      . =E( bp(  ( # ( + ( 8 ( @ R ] ( x ,    !  4  I  r  _mv_cur.R1_putn_cursor_recpos_elist_errno_fatal_curunit_cf_fseek_w_ed.R2_fmtbuf__iob_fprintf_abort_wrt_I_wrt_IMJ_wrt_L_wrt_Al_wrt_AW_wrt_E_wrt_G6_wrt_F _w_ned.R3_donewre_wrt_AP~_wrt_H.R4_icvt_cplus.R5.R6.R7.R8.R9.R10.R11_scale_ecvt.R12.R13_fcvterr.oe Ѭdլ ݬQѬuݬݬ,լݬݬÏdP@ݬPՠ P wPРPPÏeP,P~tMG P6PPG  PPP PPP PPP PPPd^ЭQPЭPЭP$+G?NЭQPЭPЭPԠ$##ЭQPЭPЭP$ ^߭ЬP ~ЬP ~PPP^ЬPԠ$ݼPݼЬPݠݭݼt^ݼcPЬP$ݼcЬPݠ@ݭݼ1(<Up2DWq%s: illegal error number %d %s: end of file %d %s: %s apparent state: unit %d named %s last format: %s lately %s %s %s %s IO readingwritingsequentialdirectformattedunformattedexternalinternalraerror in formatillegal unit numberformatted io not allowedunformatted io not alloweddirect io not allowedsequential io not allowedcan't backspace filenull file namecan't stat fileunit not connectedoff end of recordtruncation failed in endfileincomprehensible list inputout of free spaceunit not connectedread unexpected characterblank logical input field /BT]c j p |            '0 8AJP W ^ e r x         )" =# ^& ky' ( & ' (   $(,048<@_units_init_elist_reading_cplus_cblank_fmtbuf_externa_doed_doned_doend_donewre_dorever_sequent_formatt_getn_putn_cf_curunit_recpos_cursor_scale_F_err_fatal.R1_perror__iob_fprintf__cleanu_abort_f_initj.R2_canseek.R3_fstat_isatty_nowreadL.R4_ftell_freopen_fseek_nowwrit.R5fmtlib.oe l Ь[լ6Լ  ά Zլ;[P[PPP0PPJ[ZլԼ 0PZ ZP5PVd_icvt.R1 _fprintf__cleanu_abort_f_initj.R2_canseek.R3_fstat_isattyold/lib/libNS.a 644 0 33 51624 2423022505 6552 e__.SYMDEF.S _clearer<_fgetc_fputc$_fputs_freopend_fseekD_ftell_gcvt _getchar _getgrgi _getgrna| _setgren` _endgren` _getgren` _getpass_fprintf_getpwh_getpwna$_getpwui_setpwen_endpwen_getpwen_fgetsd$_fopen%_gets0'_getsh(_getw(_intss4)_popen)_pclose)_fdopen$-_printf._putchar._puts/_putw0_putsh0_fread2_fwrite2_rewind3_scanfx4_fscanfx4_sscanfx4__sctab5__doscan5__getccl5__innum5__instr5__filbuf=_setbuf?_yyportl@_wdleng@_systemA_tmpnamB_sprintfC__doprntPD__strouthJ__flsbufK_fflushK__cleanuK_fcloseK__sibufP__sobufP__iobP__lastbuP__errorQ_ungetcSclrerr.oZ < Ь[0 _clearerTfgetc.oe l$ ׼ЬP֠P`P ݬ _fgetc__filbuffputc.on |4 ЬP ׼ЬP֠P``P ݬݬ. _fputce__flsbufhfputs.op < Ь[ЬZ& jЪP֪X``P ZXPYXYP+ _fputs__flsbufhfreopen.or `@^Ь[Ь ZZԭg _ PPԭ  ^խYݏݬPY 1YYhPrPw [kkPPaݭݬ[PY5խ ,ݏݬ=PYY1ݭݬ$PYYPխ YY ZP K b      _freopen_fclosef_creat_close_open8_lseekfseek.os @P0Ь[ [ݬ ݬ ~ [YѬ  kZ Z ZZYݬ Z~ ~PZkЫYk ЫP֫`P [}ZPslfseek  ! U   _fseek_fflush_lseek__filbuf__errorhftell.ou L0 ^Ь[kk   ~PPЭP2QQPP«Pftell  ) _ftell__errorh_tell)gcvt.ov T  ^߭߭ݬ p~P[ЬZխ- Y Ik0 ׬ YYխ ì PPխYѭO׭.YYY eխ έ-+ P0PP P PPP0PPNխk0 .֭0խYY Y. YѬ 0Ь P֬ P..ZjЬP _gcvt_ecvtXgetchar.ox ,0(P`P     % _getcharD__iob__filbufgetgrgid.o| ,@ Ь[PZѪ[ZP   " _getgrgi@_setgrenA_getgrenA_endgren0getgrnam.o} 4P Ь[PZ[jPZP    + _getgrnaF_setgrenA_getgrenA_strcmp&_endgren0getgrent.oy D P  Ь[ЬZ kPPZ[kk[P 0 tmPrPgݏ_HP[[P:[P[[?:[nP[PP%':[EP[ [7Z[,[ P[kjP/etc/group((rr  (/ 8@G Mz    .=_setgrenA_fopen_rewind_endgren04_fclosef_getgrenAv_fgets_atoigetpass.o  ^ P  ݭP߭ЭP ~2߭ЭP ~ݬz[Z4[Z׽ЭP֠P`P ݭBPZP ÔkIL%߭ЭP ~ݭѭ ݭP/dev/ttyr    0 ; Q l u |        _getpassf_fopen__iob_setbuf_signal_gtty_stty_fprintfW__filbuf_fcloseffprintf.om l$ ݬ \~ݬЬP PP _fprintfW__doprntgetpw.o @`PPЬY ZZP֠P`P PZP ÔЬY[[ZZ:Z ZZ:Z0Z9 [PZP0P[[1yP/etc/passwdr  &29 QYmt _getpw_fopen_rewind__filbufgetpwnam.o 0P P[kݬP[P   ( _getpwna_setpwen_getpwen_strcmp&_endpwen=getpwuid.o ,@ Ь[PZѪ[ZP   " _getpwui_setpwen_getpwen_endpwen=getpwent.o |l@0,P Ь[k:[kk[PzsP|PqݏiNP[[Z[P[[K[xP[[P3[\P[[P[/P[[[P[[[ P[[k [kkP/etc/passwdrr  (/ 8@G Mt|     )2<EOd_setpwen_fopen_rewind_endpwen=4_fclosef_getpwenp_fgets_atoifgets.og L Ь [ЬY׬&k ЫP֫`P [PZZZ Z YPЬP$ _fgets__filbuffopen.ok 0`H ^Ь[YY@PY 딩 ԭԭG ?  1PrPwkPP+Pa [k PPԭ  -խ(ݏݬRPZ XZTZ>:ݭݬ-PZ5խ ,ݏݬPZZݭݬPZZ1խ ZZ YP         " _fopen__iob_creat_close_open8_lseekgets.o T0( ЬZ[2[P`P P[P [ ZPЬP   + 2 _gets__iob__filbufgetw.o 0 ^Ь[k ЫP֫`P [PZ Pk ЫP֫`P [xPZP2PP ^Ь[[PZ P[xPZP C dy_getsh__filbuf_getwVintss.o d PxPP _intss _ttynpopen.o L\`^߭PPrЭPЭPP[rЭPЭPPZPYR[rPPPZZݬmdY1kYKPZGݬ[;^ЬP [P$PX PWPY߭PZPK ZZXWYЭP/bin/shsh-c  A O h q |     : E P _popen)_pipe_vfork_close_dup2_execl__exit_fdopen_pclose_fclosef_signal_waityfdopen.od T@ Ь[ZZPZ j kr kaݬ ZP  E _fdopen__iob__lastbu_lseekprintf.o (0\~ݬPP   _printfE__iob__doprntputchar.o <00Ь[P[``P[     - 6 _putchar5__iob__flsbufhputs.o (x0` Ь[3PZ``PZZ݈P ``P    ! ' . 7 D J R Y g p _puts__iob__flsbufhputw.o  00 Ь[ЬZ jЪP֪[``P Z[ jx[[ЪP֪[``PZx[[[ jx[[ЪP֪[``PZx[[[y jx[[ЪP֪[``PZx[[[L Ь[ЬZ jЪP֪[``P Z[ jx[PЪQ֪PaZx[~) V     _putw__flsbufh_putshrdwr.o @^Ь[ЬZԭլ05Ьj ЪP֪`P ZPYY׭֭ѭ ЭP^Ь[ЬZԭլ6;ЬY jЪP֪``P Z~oY ֭ѭ ЭP1  _fread`__filbuf_fwriteR__flsbufhrew.o ,0Ь[[ ~kЫ0    _rewind_fflush_lseekscanf.o `P \~ݬ \~ݬݬ^Ь[A[[ԭ֭ \~ݬ߭   ' [ _scanf__iob__doscan<_fscanf_sscanfE,doscan.oa ^Ь[Ь Zԭԭ1+ЬP֠P`P1MYY%10ԭY* ZZYԭ PYP0PYIխ20uYlԭ蘋YYhY[ [ P[IP YYP߭ݬݭݭYݭPխ֭խWխЭPP׼ЬP֠P`P ݬPP P P P ݬPYYPPJP P P P%1׼1ݬPPYP13ݬPjЭP^ѬcѬs Ѭ[#ݬݬݬ ݬլмPPPԭԭԭѬe Ѭf YѬoY ѬxYޭ[ԭԭ׼ЬP֠P`P ݬPZP Z Z Z-/֭Z׼ЬP֠P`P ݬvPZ׬ 1Z+׬ ׼1ݬS1Za ZfZA1ZF֭YxY xPPxPxZJ0ZZaZf WZ7ZZЭZY 1խ֭Z׼1LЬP֠P`PPZ׬ J1]Y1.Z.Ze ZETխOY JխEխ@֭Z׼ЬP֠P`P ݬ-PZZ+1nZ-Z0Z9խέZݬZԼլ ޭP[PPxPȬPPPZ((Z&&&&&&&&&&&&&**=P߭мRvPb߭мRpPbмP`мPЭ`^Ь[ЬZԼ[XѬcѬ 0u ԭѬsj ЪP֪`P ZPYҭQ@PQP YѬcԭIѬ[?9ҭPIQPQ1[Y׬ %j ЪP֪`P ZPYYYլ  ZYvԼ[[XѬcPPЬ[Yk^Y[ZY J0J&Z☋ZZPP]Y JJZ[[Pd   = q  I    r   e x  6a  __sctab__doscan<__ctype___getccl__innum__filbuf_ungetc__instr_atoffilbuf.oh <`H ^Ь[  PݏP ի ߘ P@  b ] X)2PP~ ~Pp ëZZݫ ~TPZP Ы P2PPݫ ~Pkkkk  k1ЫP֫`PReading bad file Seek error in filbuf  , K{    __filbuf__errorh_mallock_lseek_write-_readsetbuf.o |4 Ь[ի ݫ Ь Ыk _setbuf_freestuff.o L P_yyportl_wdlengsystem.o `X ^P+ݬݏP[PZ߭PP Pѭ[qZfЭP/bin/shsh-c %, 9 D R _   _system8_vfork_execl__exit_signal_waitytmpnam.o 00(PPPݬЬPtemp.%d.%d  & _tmpnam_getpidD_sprintfHsprintf.o P0^BЬ2߭ \~ݬ׭ЭP֭``P ߭ЬP" F _sprintfH__doprnt__flsbufhdoprnt.o_ 0 ^Ь[Ь Ь\[PZY Y%ZZݭPP[QQ~Y!cdefg+l-.o0123456789abcdef^U|YPPQPA2QM..._ekvvvvvvvvvPPs1PxzPu1Pr1TPP*1CP1(null)XPZPЌRR:PbQURQpPPoPxPdHPu1[~RS T RSTSVQЌPRSPQAVRe;0Tn n8 n;  ~Z0nݭQUUYPPZPPPQUV1ilPP n4 n  n錪  nPUP^QZ1Z1ZZZZ IiY>IY HhX>HXZ1VXZZ1KЌXЌ\Ќ[10ZXXWWVWWWWPPnW3PWPP#VWP֭WP-WxWP@(RnVЭPPX'(AcխXVVVV()cXP%VVX8Wn 1GDeB+B+D.@0RVQPVPQ'խQRVPЎPR QPVPRPQQPRQPRPc0XZXXPPnX.PXPP֭XPP/XxXP@ZlxXPSPQXWQPQ`WWѭ+WPP!PЭWXWPPXWn4WníWX1XWPPXWn4WnWX(nVXP08Xn ׭n8ne QZ+Q; ?a1AZ11pUorUUUR>B€R R RZqPURRRRR dUR R8tPTUPUP  tpUPUP  PpPT~/SRRRRTRdcPSTRgPPRRT BCG@M [u+p@ yTs |z"__doprnt__stroutsstrout.o $ ЬZЬ[ЬY6Y~Z iЩP֩``P Yݬ֬ լ Fk-Ѭ0Ȉ iЩP֩``PЩP֩``P iY~oZ( iЩP֩``P YݬE׬ լ  ?   __strouts__flsbufhflsbuf.o P80^Ь[ ;,~P   ߭ ~PZk1ЫY([ݏyPYY ZnYZg, (2PP~ ~CP B2ZY ~ PZ ݏY ~P 2kYZ PЬPЬ[ PʏPPfЫZ`ZYY TZk,2PP~ ~P YZ ~lPY T[ [[[>Ь[ #[K ~ ݫ ԫ kPwriting Seek error in flsbuf Seek error in fflush   ' ; C _ t     i sz      __flsbuf.R1__error__iob_isatty__sobuf_write_malloc_lseek_read_fflush&.R2__cleanu.R3_fclose__lastbu.R4_close_freedata.o] D@@  @__sibuf__sobufx__iob__lastbu@error.oc HP0Ь[PP ݏ[P[ݏ~  ) 6 C __errorh__exit_strlenJ_write-_exit(ungetc.o p@Ь[ѬP ѫѫk֫k׫ЫP`P_ungetc@  @__sibuf__sobufx__iob__lastbu@error.oold/lib/liba.a 644 0 33 376 2423022505 6410 e__.SYMDEFp _srand<_rand<rand.ozq ,@Ьŏ?P PPP#_srand_rand xxx+ranx(ungetc.o p@Ь[ѬP ѫѫk֫k׫ЫP`P_ungetc@/( ,( 5 /\@,\D"old/lib/libc.a 755 0 33 171160 2423022507 6477 e__.SYMDEFp _vlimit _vadvise _abortD _abs _fabs _acctT _alloca _atolX_calloc_cfree_chdir_chmod_chown4_chroot_chrtabd_clearer_setkey _encrypt _crypt _ctime(_localti(_asctime(_gmtime(_dysize(__error/_execle0_execlph1_execvph1_fgetc`4_fork4_fputc5_fputsL6_freopen6_frexp`8_fseek9_ftellp;_gcvtP<_ecvt=_fcvt=_getcharA_getcswB_getenvB_getgidC_getegidC_getgrgihD_getgrnaA@>A>ab#C8DH00IFF9    I**I~ @$BBBBBB$8D @@|~ D8 $D~|@@XdB$AAAA>"AAA#   @ @  @$BA@@@@@@A>~AAAAAAAA~~@@@x@@@@@@@|@@@@@>A@@OAAAA>AAAA~AAAAADD8ABDHPpHDBA@@@@@@@@@AcUIAAAAAAAaQIECAAAA>AAAAAAAA>~AAA~@@@@@>AAAAAAYE>~AAA~DBAAA>A@@>A>AAAAAAAAA>AAAAAAA"AAAAIIUcAAAA""AAAA" @@@ 88" <>BB>@@@@|BBBB|BBBB>BBBB>B>@@@@|BBBBB(@@@@FHPpHFvIIIII@|BBBBBBBBB>\b@@@@>@<B<~ BBBBB=AAA"IIIII6B$$BBBB" @~ ~   *~~~~~~~~~~_chrtabclrerr.o  L Ь[0 _clearer.R1crypt.o   8^[ЬPKnQQA`KЬPKsQQA`K[[YHZJJZZJJZYYPK'QPQZJ(P0[Q0 Q@DJaJ$P0[Q0 QZQ@%Z[[1Y^ZЬPJ QQA`J @ZԭլíЭZJ J ZZJ P0Q0 Q@ PJaQQPPJ 0ZZZ[K PxZQ QK RxRRK SxSSSRK SxSSSRK SxSSSRKx SxSSSRRQxPP@aYxZ[YPPK0 YPPK$ YPPK xYPPPPK ZZ1PZJr P@ PJ QQPPJ ZZJ Jc Z֭ѭ1ZJJ [Jb J< [JT ZZJP@ J@Z^[K B[[1[@.ZZPPPxPYPPPPK Z[Z[֬Yk [K[ B[[KJ K 0[[ЬP֬`YYKp YZYY9Y.YZZPxPYPP;[PZP@[PZP[QZQ@A[PZP@ZZ[[[ 3[[YZxYY[PZP@ PPYZ.YY9YYZYYK [[ K  P:2*" <4,$ >6.&@80( 91)! ;3+# =5-% ?7/'(08@ '/7?&.6>%- 5=$, 4<#+ 3;"* 2:!) 1991)! :2*" ;3+# <4,$?7/'>6.&=5-%      )4%/7(3-!0,1'8"5.*2$                                                                                                                                     %1ALR^dou$*7CK[lw"*6CIbjpx0ax~ _IP_FP@_PC1_C_PC1_D_shifts_PC2_C_PC2_D_C_D _KS0 _setkey.R1_E0 _e` _S _P_L_R_tempL_f_preS0_encrypt.R2_crypt.R3ctime.o   ݬ P5^߭2P.R6.R7error.o  H`((0Ь[PP ݏ[P[ݏ~  ) 6 C __error.R1__exit_strlen_write_exitexecle.o  ` lP@lݬ _execle_execveexecvp.o  ` x\~ݬx^ZYP/ݬP PЭPP[|ݬ[P[}Ph[Y ~uP||̀xxxxPPQ@A||.'ZZZݬ|PPPP P 1WY1WЬ[ЬZЬ Y k: k-kѬ Y/jik[[PP/bin/shPATH:/bin:/usr/binsh  ' 3A Ke~  _shell_execlp.R1_execvp.R2.R3_getenv_index_execat_errno_execv_sleepfgetc.o  |$0׼ЬP֠P`P ݬ _fgetc.R1__filbuffork.o  PQP fork_forkforkok cerrorparentfputc.o  ,0׼ЬP֠P``P ݬݬ% _fputc.R1__flsbuffputs.o  80Ь[ЬZ!jЪP֪X``P ZXPYXYP& _fputs.R1__flsbuffreopen.o  D`0Ь[Ь ZZkwݏݬEka3ݬPYݏݬPYYݬPYYPY kr  ZP % 9 N ^ l _freopen.R1_fclose_creat_open_lseekfrexp.o  (x8 8^ԭԭq rqq0fqdqЭ խrpP@@A@@A",8DR\_frexp.R1fseek.o  P( ^ЬP ЬP 1Ѭ nՠi dмZЬլ  ~PPZPPZZ)ѭZ#ЬPPQáPѭPQP­P[[ݬ [~ЬP ~[PԼ[M׼ЬP֠P`P7ݬ0+ЬP "Pݬ ݬЬP ~PѭPPA     _fseek.R1 _lseek__filbuf_fflushftell.o  h0^ռԼЬP ?μ[[ЬPՠ PQá[ЬP ~PPЭPЬP P[C _ftell.R1_lseekgcvt.o  d 0^߭߭ݬ p~P[ЬZխ- Y Ik0 ׬ YYխ ì PPխYѭO׭.YYY eխ έ-+ P0PP P PPP0PPNխk0 .֭0խYY Y. YѬ 0Ь P֬ P..ZjЬP _gcvt.R1_ecvtecvt.o  pݬݬݬ p~ݬݬݬ p~^լ Ԭ Ѭ ON [ԼZq r߭p~pPYqRY1߭g~RpPaPPdPjPP0PPy[qYP.q p[ePpPqP Yլ[Y[YPZY/ZP&dK߭p~pPjP0PPYPYZi)y%0iY1iּլZ0jZi9֔j1x B=(\ B B@ B.W`y  %-3AIY px_ecvt.R1_cvt4_fcvt.R2.R3_modfgetchar.o  ,@(P`P     % _getchar.R1__iob__filbufgetcsw.o  H &getcsw&_getcswgetenv.o  LPЬ[Zj7݊[ PYYP Ь[ЬZk =ZPk=P _getenv.R1.R2 _environ_nvmatch&getgid.o  `0//QPgetgid/_getgid_getegidgetgrgid.o  ,P Ь[PZѪ[ZP   " _getgrgi.R1 _setgren_getgren_endgrengetgrnam.o  4` Ь[PZ[jPZP    + _getgrna.R1 _setgren_getgren_strcmp_endgrengetgrent.o  < D  P  Ь[ЬZ kPPZ[kk[P 0 tmPrPgݏ_HP[[P:[P[[?:[nP[PP%':[EP[ [7Z[,[ P[kjP/etc/grouprr  (/ 8@G Mz    .=_GROUP_grf _line_group_gr_mem$_setgren.R1_fopen_rewind_endgren4.R2.R3 _fclose_grskipR_getgrenv.R4 _fgets_atoigetlogin.o  p PP[PPZ[~ZZPZ Y yP/etc/utmp  0 8A O V\j_UTMP_ubuf _getlogi.R1_ttyslot_open_lseek_read_closegetpass.o   ^ P  ݭP߭ЭP ~2߭ЭP ~ݬz[Z4[Z׽ЭP֠P`P ݭBPZP ÔkIL%߭ЭP ~ݭѭ ݭP/dev/ttyr    0 ; Q l u |        _getpass.R1 _fopen__iob_setbuf_signal_gtty_stty_fprintf__filbuf_fclosefprintf.o  |$0ݬ \~ݬЬP PP _fprintf.R1__doprntgetpw.o  P`PPЬY ZZP֠P`P PZP ÔЬY[[ZZ:Z ZZ:Z0Z9 [PZP0P[[1yP/etc/passwdr  &29 QYmt _getpw.R1_fopen_rewind__filbufgetpwnam.o  0` P[kݬP[P   ( _getpwna.R1_setpwen_getpwen_strcmp_endpwengetpwuid.o  ,P Ь[PZѪ[ZP   " _getpwui.R1(( _setpwen_getpwen_endpwengetpwent.o  l@ 0,P Ь[k:[kk[PzsP|PqݏiNP[[Z[P[[K[xP[[P3[\P[[P[/P[[[P[[[ P[[k [kkP/etc/passwdrr  (/ 8@G Mt|     )2<EOd_PASSWD_EMPTY _pwf_line_passwd_setpwen.R1_fopen_rewind_endpwen4.R2.R3_fclose_pwskipR_getpwenp.R4_fgets_atoiatoi.o  L ^ЬY[ԭYi i i-֭i9 [PQPQ0Q[i0խ[[[P_atoi.R1fgets.o  L0Ь [ЬY׬&k ЫP֫`P [PZZZ Z YPЬP$ _fgets.R1__filbuffopen.o  @Ь[YYPY kwݏݬRka@ݬPZݏݬPZZZݬrPZZiZ kr  YP  6 J U h |  _fopen.R1__iob__lastbu_creat_open_errno_lseekgets.o  T@( ЬZ[2[P`P P[P [ ZPЬP   + 2 _gets.R1 __iob__filbufgetuid.o  `0QPgetuid_getuid_geteuidgetw.o  @0^Ь[ޭYZk ЫP֫`P [PZ PЭP' _getw.R1__filbufindex.o  \ Ь[ZkZ[PP_index.R1 intss.o  t0PxPP _intss.R1_ttynitol.o  DxPˏQQP_itolkill.o  x@%P kill%_killcerrornoerror l3tol.o  d$ ЬZЬY[ [[ _l3tol.R1link.o  x@ P link _linkcerrornoerror locv.o  $0^ n8 n; QPD_locvedpatstrltod.o  P nPj _ltod_dtolltoi.o  8ЬP_ltoiltol3.o  d$ ЬZЬY[ Y[[ _ltol3.R1makdir.o  x@P mknod_makdircerrornoerror mcount.o   P`QaQnQ`   mcountcountbasinitincrreturnmdate.o  x@P mdate_mdatecerrornoerror mknod.o  x@P mknod_mknodcerrornoerror mktemp.o  l@PZЬ[[ ZP PPZP0PPk Z{X[aYYzPYkYݬPЬP/ EX _mktemp.R1_getpid_accessaccess.o  x@! access!_accessnoerror cerrormodf.o  X tRPnR cP _modfiovflmon.o  `XլDݏP[[[Ь ЬЬ PЬ`Ь PЬЬ PЬxP P[[ PP [ìPxP[Ѭ[nPn[RfRPdYPjPPP[<[[ݬݬݬ 1Hmon.out % .4= F OW _monitor.R1_profil_creat_write_closecreat.o  x@ creat_creatnoerror cerrormount.o  x@P mount_mountcerrornoerror mpx.o" h|`Xլ% ЬЬЬЬЬЬЬЬ riЬfЬbPGЬDЬ@.%Ь"ЬЬЬ ЬЬЬ  ЬЬЬ  ' 8>G RZ`i t|    # .6>DM X`hnw _vec_mpx.R1_mpxcall_chan2.R2_joinL.R3_connectn.R4_attach.R5_detach.R6_extract.R7_debug.R8_npgrp(.R9_ckillR.R10mpxcall.o  x@8 mpxcall8_mpxcallcerrornoerror nargs.o  8P_nargsnexect.o  d 0; _exectcerrorexecve;nice.o  x@"P nice"_nicecerrornoerror nlist.o  pHΘ^Ь[ԭ ԫ [֭kݬPYP ߭YV F VFF YܭPP ݭYlЭXXO2@WX@XWW͘YDWX͘ZWЬ[+VFkFjVЪ ׭Y P[kZ ( ? JW`k    _a_magic_nlist.R1_open_read_close_lseekperror.o  |ph [P@[ݬPZZݬ[P[Unknown error:     + > FO X e mv _errno_sys_ner_sys_err_perror.R1 _strlen_writeerrlst.o  8 ,<HZj| !5FUd|#Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too l((argeResult too large  $(,048<@DHLPTX\`dhlptx|_sys_err_sys_nerpopen.o  |\`^߭PPrЭPЭPP[rЭPЭPPZPYR[rPPPZZݬmdY1kYKPZGݬ[;^ЬP [P$PX PWPY߭PZPK ZZXWYЭP/bin/shsh-c  A O h q |    : E P _popen_p_popen.R1_pipe_vfork_close_dup2_execl__exit_fdopen_pclose.R2_fclose_signal_waitdup.o  P@) dup)_dup _dup2cerrornoerrorfdopen.o  TP Ь[ZZPZ j kr kaݬ ZP  E _fdopen.R1 __iob__lastbu_lseekpipe.o  @*ЬRPQbP pipe*_pipecerrornoerror printf.o  (@\~ݬPP   _printf.R1__iob__doprntprof.o  H ,prof,_profilptrace.o  P  ptrace_ptracecerror_errnonoerrorputchar.o  4@(Ь[P[``P[   % . _putchar.R1__iob__flsbufputs.o  h@P Ь[+PZ``PZZP ``P     & / : B I W ` _puts.R1 __iob__flsbufputw.o  @0Ь[\ZYЫP֫``Pk[~Y PP) _putw.R1__flsbufqsort.o  xЬЬ Ŭ PP~ݬ^YìPPPYxYPPPYPЭЬ[YZ+Yݭ[ݭ[yPPhY[[]ZYݭKZYݭ[YЭ[/Zݭ*PP[Z[oYZYZZ[>ìPíQPQݬY~Э1ݭݬY1[YݭZ/YЭZ14^Ь[ЬZkYjY׭^uЬ[ЬZЬ Ykij׭#/u!6Qg_qscmp_qses_qsort.R1.R2.R3.R4_qs1(_qsexc`_qstexcrand.o  ,PЬŏmNAP90PP"_randx_srand.R1_rand .R2rdwr.o  4`^Ь[ЬZԭլ05Ьj ЪP֪`P ZPYY׭֭ѭ ЭP^Ь[ЬZԭլ16ЬYjЪP֪``P Z~tY ֭ѭ ЭP1  _fread.R1__filbuf_fwriteR.R2__flsbufregex.oh  xH^Ь[Yԭԭޭ[k i^? Pk^  [ Y ԭ PZ#ޭPѭPԭ P PZ*YZPP$FP*)P.P[=P\1Z11խ쑽摽 1gk 1]ZZ^ZZԭ PZ-<7ZZ]-֭APPZPPPiY֭Y 1Z֭Y ZZ]1ЭP1ZZ(2ѭ gԭ PЭP֭`ЭP֭P1Z)+ޭPѭP,ԭP ׭ЭP`1WZ11Z:1ZP^Ь[ZYII Y Z[Gj)YkPPYZ[*PЭPPZ[ P㕋 ^Ь[ЬZPPp*910AE[E7=~&&&&&PkP~ZaPjPPZ~ZGP1aP[@1{P[@1mЭP@1[PP1ЭPPQA@PP[1,ЭP@1E[YPQAz@[[ݭP[Y1Z[PЭP­[[Y4[YjZ([YPPP~ZMPjPPZ[Z[rP[Y1IЬ[ЬZKYYKPPЬ[ZPYY ZЬ Pլ PPP Regular expression too longNo previous regular expressionunmatched \(missing ]too many \(\) pairsunmatched \) )8BIQZqz Rd",9Vs/?TZp-;L_expbuf_braslis _braelis$ _circfH _re_comp.R1_re_exec.R2.R3_advance_cclassH_backref .R4.R5reset.o  D(0P}V}X}Z}Э`PЬPQ}V}X}Z}\Ё^*_setexit_reset"setsavrew.o  ,@Ь[[ ~kЫ0    _rewind.R1_fflush_lseekrin.o   `X^pY[P`P PZZZ-YZ.[ZP [[ePnZR`RPcPYrY fzYY[jPP[[P B@C B  " - 4 G b r_rin.R1__iob__filbuf_exit_isdigitscanf.o  ` \~ݬ \~ݬݬ^Ь[A[[ԭ֭ \~ݬ߭   ' [ _scanf.R1__iob__doscan_fscanf.R2_sscanf,.R3doscan.o  \^Ь[Ь Zԭԭ1+ЬP֠P`P1MYY%10ԭY* ZZYԭ PYP0PYIխ20uYlԭ蘋YYhY[ [ P[IP YYP߭ݬݭݭYݭPխ֭խWխЭPP׼ЬP֠P`P ݬPP P P P ݬPYYPPJP P P P%1׼1ݬPPYP13ݬPjЭP^ѬcѬs Ѭ[#ݬݬݬ ݬլмPPPԭԭԭѬe Ѭf YѬoY ѬxYޭ[ԭԭ׼ЬP֠P`P ݬPZP Z Z Z-/֭Z׼ЬP֠P`P ݬvPZ׬ 1Z+׬ ׼1ݬS1Za ZfZA1ZF֭YxY xPPxPxZJ0ZZaZf WZ7ZZЭZY 1խ֭Z׼1LЬP֠P`PPZ׬ J1]Y1.Z.Ze ZETխOY JխEխ@֭Z׼ЬP֠P`P ݬ-PZZ+1nZ-Z0Z9խέZݬZԼլ ޭP[PPxPȬPPPZZ&&&&&&&&&&&&&**=P߭мRvPb߭мRpPbмP`мPЭ`^Ь[ЬZԼ[XѬcѬ 0u ԭѬsj ЪP֪`P ZPYҭQ@PQP YѬcԭIѬ[?9ҭPIQPQ1[Y׬ %j ЪP֪`P ZPYYYլ  ZYvԼ[[XѬcPPЬ[Yk^Y[ZY J0J&Z☋ZZPP]Y JJZ[[Pd   = q  I    r   e x  6a  __sctab__doscan.R1__ctype___getccl__innum__filbuf_ungetc.R2__instr_atof.R3.R4((atof.o   PSЬRUT TTT +T-TST|PT04T9/Q yPVyPPVPWQ0TTPQUSUTǑT.SVTeTE[TT+T-STT0T9V FfV>FVSVVVUUЏUUdЏdU}PP1RU#Q yPPRyPVVPWQRU=;Q yPPRyPPRQQVW{VQWPVW{ VPVPPVPRUQyPPRyPPPPnPVnQPdP`VPSrPPRpP~zk! msignesigndecpttwo31_atofsk0sk1$cs11cs24ad06ad4oad1bad2dad3jad5xex1ex7ex2ex3ex4ex5ex6exitsd0su0su1cm0Osd2%sd1sd3)sd4Icm1Zcm2z_ldexpctype_.o    AAAAAABBBBBB __ctype_filbuf.o-4 `8Ь[ P ݏP ի ߘ P@ Ы[  P2PPݫ ~uPkkk  k1aЫP֫`P =Q Z a h  __filbuf.R1_malloc__iob_fflush_readldexp.o  @pPPR RR RP|PpPrPP"(8 erange"_errnohuge_ldexpld1!under"over&err5setbuf.o-4 40Ь[ի ݫ Ь Ыk _setbuf.R1_freesetgid.o  x@.P setgid._setgidcerrornoerror setuid.o  x@P setuid_setuidcerrornoerror sleep.o  (X^ԭլݏPPݭݭխѭ¬ Э!Pݬyle !( 8 B en |   _jmp_sleep.R1.R2_alarm_setjmp_signal_sleepx_pause_longjmpalarm.o  l @alarm_alarmpause_pausesetjmp.o  D ЬP}V}X}Z}Э`PЬPЬQ}V}X}Z}\Ё^PP_setjmp_longjmpstime.o  |@мP  stime_stimecerrornoerrorstrcatn.o  h( Ь[ЬZЬ Y[X[Y{XP_strcatn.R1strcmpn.o  p0 Ь[ЬZЬ YY kPYP kPzQQP_strcmpn.R1strcpyn.o  l, Ь[ЬZ[XY YY  YXP_strcpyn.R1strlen.o  T Ь[ZZZP_strlen.R1 strncat.o  h( Ь[ЬZЬ Y[X[Y{XP_strncat.R1strncmp.o  p0 Ь[ЬZЬ YY kPYP kPzQQP_strncmp.R1strncpy.o  l, Ь[ЬZ[XY YY  YXP_strncpy.R1strout.o  0 ЬZЬ[ЬY1Y~ZiЩP֩``P Yݬ֬ լ ?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T3RBcHݭRP֭S}TTP/PacTeR}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R^tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX *<S#"_((__doprntf__flsbufhflsbuf.ov_ ^Ь[ PPYYX1XX߭ ~PYm~P  EЫZЫP֫`ZPѫPѬ ZPPXPZ ~cPYZkn 1jЫZ3[1uݏ1PZZ  YYX ZYYXZYZ ~PY2kZXY 1ЬPЬ[ PʏPP@ЫZ:ZY3Z P2PPkYZ ~PY PPt[ [[[^ Ь[Z < 7[cPZ ~-PZ ݫ ԫ kZP. 9 A P X     m     __flsbuf.R1_write__iob_isatty__sobuf_malloc_fflush(.R2__cleanu.R3_fclose__lastbu.R4 _close_freeexit.o  d 0 exit_exit__cleanucleanup.o  4__cleanudata.o  D@@  @__sibuf__sobuf__iob__lastbu@ttyslot.o  <,pP[P[P[P/[PZ[ZZPXYX/P[Y[ZPX|YPXop[[ݬUP1yk  kNP[,[/etc/ttys  # 6 JQ as  _ttys_ttyslot.R1.R2_ttyname_rindex_open_getttys_strcmp_close_readrindex.o  \ Ь[ZYkZ[YYP_rindex.R1strcmp.o  ` Ь[ЬZkPkPzQQP_strcmp.R1 ttyname.o  D(x^ݬPP߭ݬPPZxHPZPPPZx5~PZZZ PZPxPZPPjj1xYP[PZkk[P Ь[[ZZZjPPj ^Ь[ [[PPݬRPZZ[ZP[ZPPYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j $)/4CJ    ',;BJOV]w_allocs_allocp_alloct _allocx_malloc.R1_sbrk_freeh.R2 _realloc.R3sbrk.o  D0~\S^\PЬP (5 = break_sbrk_endcerrorndnoerr1_brk-noerr29vfork.o  4ЭRBQPPbPb$ vforkB_vforkherevforkokverror!child-parent/_errnovread.o  x@C  vreadC_vreadcerrornoerrorvwrite.o  x@D  vwriteD_vwritecerrornoerrorwait.o  PլQ wait_waitcerrornoerror nostatusvtimes.ooO H kvtimesk_vtimesvwait.oٍO PGլQ  vwaitG_vwaitcerrornoerrornostatuswrite.o  x@ write_writecerrornoerror cerror.o  T PP cerror_errnoudiv.oP%Z (PЬPЬRRQ{RPPR PRPPudivdivnodivretn&one#urem.oQ%Z (PЬPЬRRQ{RPRPPPRRPuremdivnodivnzeroretn&vhangup.o"u 8L_vhangup_PP cerror_errnoudiv.oP%Z (PЬPЬRRQ{RPPR PRPPudivdivnodivretn&one#urem.oQ%Z (PЬPЬRRQ{RPRPPPRRPuremdivnodivnzeroold/lib/libcurses.a 644 0 33 172714 2423022511 7557 e__.SYMDEF[NK__tspaceL__aoftspL_ALL_AML_BCL_BSL_BTL_CAL_CDL_CEL_CLL_CML_DAL_DBL_DCL_DLL_DML_DOL_EDL_EOL_EIL_GTL_HOL_HZL_ICL_INL_IML_IPL_LLL_MAL_MIL_NCL_NDL_OSL_PCL_SEL_SFL_SOL_SRL_TA((L_TEL_TIL_ULL_UPL_VBL_VEL_VSL_XNL_NONLL_UPPERCAL_normttyL_pfastL_outfL__ttyL_stdscrL_curscrL_boxL__tspaceP__aoftspP_ALP_AMP_BCP_BSP_BTP_CAP_CDP_CEP_CLP_CMP_DAP_DBP_DCP_DLP_DMP_DOP_EDP_EOP_EIP_GTP_HOP_HZP_ICP_INP_IMP_IPP_LLP_MAP_MIP_NCP_NDP_OSP_PCP_SEP_SFP_SOP_SRP_TAP_TEP_TIP_ULP_UPP_VBP_VEP_VSP_XNP_NONLP_UPPERCAP_normttyP_pfastP_outfP__ttyP_stdscrP_curscrP_wclearP__tspaceU__aoftspU_ALU_AMU_BCU_BSU_BTU_CAU_CDU_CEU_CLU_CMU_DAU_DBU_DCU_DLU_DMU_DOU_EDU_EOU_EIU_GTU_HOU_HZU_ICU_INU_IMU_IPU_LLU_MAU_MIU_NCU_NDU_OSU_PCU_SEU_SFU_SOU_SRU_TAU_TEU_TIU_ULU_UPU_VBU_VEU_VSU_XNU_NONLU_UPPERCAU_normttyU_pfastU_outfU__ttyU_stdscrU_curscrU_initscrU__tspace([__aoftsp([_AL([_AM([_BC([_BS([_BT([_CA([_CD([_CE([_CL([_CM([_DA([_DB([_DC([_DL([_DM([_DO([_ED([_EO([_EI([_GT([_HO([_HZ([_IC([_IN([_IM([_IP([_LL([_MA([_MI([_NC([_ND([_OS([_PC([_SE([_SF([_SO([_SR([_TA([_TE([_TI([_UL([_UP([_VB([_VE([_VS([_XN([_NONL([_UPPERCA([_normtty([_pfast([_outf([__tty([_stdscr([_curscr([_endwin([__tspace`__aoftsp`_AL`_AM`_BC`_BS`_BT`_CA`_CD`_CE`_CL`_CM`_DA`_DB`_DC`_DL`_DM`_DO`_ED`_EO`_EI`_GT`_HO`_HZ`_IC`_IN`_IM`_IP`_LL`_MA`_MI`_NC`_ND`_OS`_PC`_SE`_SF`_SO`_SR`_TA`_TE`_TI`_UL`_UP`_VB`_VE`_VS`_XN`_NONL`_UPPERCA`_normtty`_pfast`_outf`__tty`_stdscr`_curscr`_mvprint`_mvwprin`__tspacePe__aoftspPe_ALPe_AMPe_BCPe_BSPe_BTPe_CAPe_CDPe_CEPe_CLPe_CMPe_DAPe_DBPe_DCPe_DLPe_DMPe_DOPe_EDPe_EOPe_EIPe_GTPe_HOPe_HZPe_ICPe_INPe_IMPe_IPPe_LLPe_MAPe_MIPe_NCPe_NDPe_OSPe_PCPe_SEPe_SFPe_SOPe_SRPe_TAPe_TEPe_TIPe_ULPe_UPPe_VBPe_VEPe_VSPe_XNPe_NONLPe_UPPERCAPe_normttyPe_pfastPe_outfPe__ttyPe_stdscrPe_curscrPe_mvscanwPe_mvwscanPe__tspacej__aoftspj_ALj_AMj_BCj_BSj_BTj_CAj_CDj_CEj_CLj_CMj_DAj_DBj_DCj_DLj_DMj_DOj_EDj_EOj_EIj_GTj_HOj_HZj_ICj_INj_IMj_IPj_LLj_MAj_MIj_NCj_NDj_OSj_PCj_SEj_SFj_SOj_SRj_TAj_TEj_TIj_ULj_UPj_VBj_VEj_VSj_XNj_NONLj_UPPERCAj_normttyj_pfastj_outfj__ttyj_stdscrj_curscrj_newwinj__tspace`o__aoftsp`o_AL`o_AM`o_BC`o_BS`o_BT`o_CA`o_CD`o_CE`o_CL`o_CM`o_DA`o_DB`o_DC`o_DL`o_DM`o_DO`o_ED`o_EO`o_EI`o_GT`o_HO`o_HZ`o_IC`o_IN`o_IM`o_IP`o_LL`o_MA`o_MI`o_NC`o_ND`o_OS`o_PC`o_SE`o_SF`o_SO`o_SR`o_TA`o_TE`o_TI`o_UL`o_UP`o_VB`o_VE`o_VS`o_XN`o_NONL`o_UPPERCA`o_normtty`o_pfast`o_outf`o__tty`o_stdscr`o_curscr`o_overlay`o__tspace0t__aoftsp0t_AL0t_AM0t_BC0t_BS0t_BT0t_CA0t_CD0t_CE0t_CL0t_CM0t_DA0t_DB0t_DC0t_DL0t_DM0t_DO0t_ED0t_EO0t_EI0t_GT0t_HO0t_HZ0t_IC0t_IN0t_IM0t_IP0t_LL0t_MA0t_MI0t_NC0t_ND0t_OS0t_PC0t_SE0t_SF0t_SO0t_SR0t_TA0t_TE0t_TI0t_UL0t_UP0t_VB0t_VE0t_VS0t_XN0t_NONL0t_UPPERCA0t_normtty0t_pfast0t_outf0t__tty0t_stdscr0t_curscr0t_overwri0t__tspacex__aoftspx_ALx_AMx_BCx_BSx_BTx_CAx_CDx_CEx_CLx_CMx_DAx_DBx_DCx_DLx_DMx_DOx_EDx_EOx_EIx_GTx_HOx_HZx_ICx_INx_IMx_IPx_LLx_MAx_MIx_NCx_NDx_OSx_PCx_SEx_SFx_SOx_SRx_TAx_TEx_TIx_ULx_UPx_VBx_VEx_VSx_XNx_NONLx_UPPERCAx_normttyx_pfastx_outfx__ttyx_stdscrx_curscrx_printwx__sprintx_wprintwx__tspace}__aoftsp}_AL}_AM}_BC}_BS}_BT}_CA}_CD}_CE}_CL}_CM}_DA}_DB}_DC}_DL}_DM}_DO}_ED}_EO}_EI}_GT}_HO}_HZ}_IC}_IN}_IM}_IP}_LL}_MA}_MI}_NC}_ND}_OS}_PC}_SE}_SF}_SO}_SR}_TA}_TE}_TI}_UL}_UP}_VB}_VE}_VS}_XN}_NONL}_UPPERCA}_normtty}_pfast}_outf}__tty}_stdscr}_curscr}_scanw}__sscans}_wscanw}__tspace܂__aoftsp܂_AL܂_AM܂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_NONLt_UPPERCAt_normttyt_pfastt_outft__ttyt_stdscrt_curscrt_winsertt__tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr_wdelete__tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr_scroll__tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr_wgetstr__tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr_wgetch__tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr_waddstr__tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr_waddch__tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr_wmove__tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr__echoit__rawmod_My_term_ttytype_Def_ter__tty_ch_LINES_COLS__res_fl__unctrlhbox.oWN^[ ZЬP22PPЬPРP`ЭPЬQxPPP`YZIIIYY׭YY,ЬPxYQQP`PЭQ[A`ЬRxYSSRbRA`bYЬP(ЭPЭQ A`ЭRA`bЭPЭQbA`ЭRA`b__tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr_box.R1clear.o XNL<0Ь[[[ P 7 6 6 %: /; __tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL((_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr_wclear.R1_wrefres_weraseinitscr.o@XNP1P$P[[ PPzP p haWQJPCTERM: ; < != '.> =? D@ J7 R7 YA cB iC pD w7 7 6 6 A B C D 6 __tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr_initscr.R1_My_term_isatty__tty_ch_gettmod_getenv_Def_ter_setterm_delwin_COLS_LINES_newwinendwin.oYXNH6[)P`~k6[)P`~hk: 5 5 ; < "- *- 3= := E= L= V> `( h( q= x= = = > __tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr_endwin.R1__res_fl__tty_ch_stty__iob__flsbufmvprintw.omXNp0 Ь[ЬZZ[P\~ݬ PЬ[ЬZЬ YYZ[P\~ݬ[P6 : )6 0; Q: f; __tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr_mvprint.R1 _wmove__sprint_mvwprin:.R2mvscanw.oXNp0 Ь[ЬZZ[P\~ݬ PЬ[ЬZЬ YYZ[P\~ݬ[P6 : )6 0; Q: f; __tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr_mvscanw.R1 _wmove__sscanw_mvwscan:.R2newwin.oXN0H^Ь[PYjլ ìݬP@[ ì [ZX[PJ)ԭЭP@֭ѭZY}PJ ֭[JPѭPZZiѬH[?PPP [  YP: "; 0: B< R: m= = ; < __tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr_newwin.R1_calloc_LINES_COLS_cfreeoverlay.oXN ^Ь[ЬZ2P2PPV2P2PPW2P2QQP2 P2 QQPPXJY?HPI`~P$Y~X~Z{P ~ZjYYWXXVj: ; < __tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr_overlay.R1_isspace_wmove_waddchoverwrite.oXNt^Ь[ЬZ2P2PPV2P2PPW2P2QQPPX3X~ZPYHPI`~ZYYWXXVT: n; __tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr_overwri.R1_wmove_waddchprintw.oXN0Ь[\~[ Ь[ЬZ \~Z[^Ь[ЬZЬ YB2߭YZ׭ ЭP֭` ߭~[q6 /b> ~? @ __tspace__aoftsp_AL_AM((_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr_printw.R1__sprint4_wprintw.R2 .R3__doprnt__flsbuf_waddstrscanw.oYN0Ь[\~[ Ь[ЬZ \~Z[^Ь[ЬZЬ YAޭЭ߭[PP߭PYZ߭|6 /]> n? @ __tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr_scanw.R1__sscans4_wscanw.R2 .R3_wgetstr_strlen__doscanrefresh.oYN  P$^Ь[2ЭV2 ЭP  1P 'խ1խ2PP2PPwF7ЭP֭Q`a|uЭP֭`~TݴI2CP '7 /7 B7 W7 o; : ? 7 ? 7 7 Y7 _7 s7 @    < < < < .=  < < < < = ? 7 ? < < < < = '7 E; M p < < < < = @ 7 7 < A __tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr_wrefres.R1_LINES_COLS__iob__flsbuf_werase_scroll_mvcur_fflushtouchwin.oYN__tspace__aoftsp_AL_AM_BC_B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ZDZ6sPP[!g__RZZ[[ZNAYYYYZ:[PPZ(S KCPPYY[PPPZ'!PPPPQQP[[yZrj fiaU QTL[PZP7:6*."& I 8tPYb 1T|knbeAU}C60W"1, 1[-P[``P[~ Ь[w[2[Z)|Pu`f_~Ej%/B 6?B DLRYB aB jqB xB B B  3 C C C C D C C C C D #*E 1;E CKRE W^E eqyE ~E 3  C C C C D 3 E   + %*06< CF L WG `msx~J C C C C D   *16?GR _jv{   J  E '/ 6J <CE HN Wbjw~0 3        $G /8>I0 Q3 [c jJ rz + J   ' ' "J -4;IQVfB n v ~' ' J  J     J "(:BJC RC YC gC qD ~C Q C C C C D __tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr_outcol_outline_destcol_destlin _plodcnt_mvcur.R1_fgoto*.R2.R3_COLS__iob__flsbuf_LINES_tgoto_strlen_plod__putcha_tputs.R4_plodflg_plodput2.R5_putpadv.R6 _fflushmytty.o~ZN  @XPP2 P F2PPPq lPPPXUPPPB^Ь[k[Z[PZPP00PZP`O| P`PPP_YT[GP?8ZP+6#Y).P'`~i6Y)P`~iPoZ[ZЋQPaZjbZYvZmЉQPaZj(xxxx|dumb:liambseohzinmincosulxnalbcbtcdceclcmdcdldmdoedeihoicimipllmandpcsesfsosrtatetiupvbvsve5 @ A 5 "@ )A /5 4B =5 C5 I@ PC ZB _5 e5 jp5 uB |5 1 5  5 0 F G H I I I )I /J :J @ E LRX^ eL q w  "   M N G ) ) O O O O P . . O 'O 2O 9O CP T[eR x S        ! * $/ , 0 4 8 < @ D H L P T X \ ` d h l p t x |# $ % & ' ( ) + , . - __tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr_sflags_xPC(_sstrs,_destcol_destlin_ospeed_gettmod.R1__tty_ch_gtty__res_fl_stty_setterm.R2_tgetent_strcpy_tgetnum_LINES_COLS_zapP_tgoto_longnam_ttytype__iob__flsbuf.R3_tgetfla_tgetstrlongname.oZNH Ь[ЬZ k: k|[kk|[[Y i: i|Yii[PZP_longnam.R1delwin.oZN(@ Ь[ZJJZZP2QPQݫ[: /: 8: __tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr_delwin.R1 _cfreeinsertln.oZNP^Ь[2kP@Z2PPY YP@IYYP2kQPQZP2QQP ZP__tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr_winsert.R1deleteln.oZNX^Ь[2kP@Z2kY YP@((IYYP2QPQZP2QQP Z2PPZ@P__tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr_wdelete.R1scroll.oZN8^Ь[PЫP`Y YP@IY2PPYPЭZ íZP2QPQ2PPЭ@k[4P ` tnP]7 e: m: t: : ; 0 __tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr_scroll.R1__iob__flsbufgetstr.oZN, Ь[ЬZ[Pjj ZjjPP: __tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr_wgetstr.R1 _wgetchgetch.o[N Ь[Z kP.& ZZZP`P PY}42~2k~ngPY~ZSY~[GZ @60*#YP: '; 05 7; =5 C< J= U> ]> d> o> v? : 7 @ 7 A A 5 ; 5 < = __tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr_wgetch.R1__echoit__rawmod__tty_ch_stty__iob__filbuf_wmove_waddchaddstr.o([N( Ь[ЬZj~[PPP: __tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr_waddstr.R1 _waddchaddch.oB[NЬ[2Z2kYZP2QPQ YP2QPQPPPY IPJ`ZZP2QPQ*ZYYP2QPQ[[YZYkPZZPPPZPPXZ [VP1tXZIP2QQPWZIXXW ZZo: x; __tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr_waddch.R1_wrefres_scrollmove.oY[N4Ь[ЬZЬ YYP2QPQ ZP2QPQPYZkP__tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr_wmove.R1curses.ok[NPun __tspace__aoftsp_AL_AM_BC_BS_BT_CA_CD_CE_CL_CM_DA_DB_DC_DL_DM_DO_ED_EO_EI_GT_HO_HZ_IC_IN_IM_IP_LL_MA_MI_NC_ND_OS_PC_SE_SF_SO_SR_TA_TE_TI_UL_UP_VB_VE_VS_XN_NONL_UPPERCA_normtty_pfast_outf__tty_stdscr_curscr__echoit__rawmod_My_term_ttytype _Def_ter __tty_ch_LINES_COLS__res_flunctrl.o[ND  #&),/258;>ADGJMPSVY\^`bdfhjlnprtvxz|~  ^`^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^{^|^}^~^? !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ (( $(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|__unctrl old/lib/libdbm.a 755 0 33 13164 2423022512 6772  0 ^ݬU Pݬ! PPݬ mP߭`YxPPLP^^}n;P+x"PPPP PP^^}nP[[}`խ?ޭP Q}`a P[~}`խ s^}n^}nP[^^}nEPB[[,M}`խP^}n^}nPQ[D[5x ~ݏP[1t^^}nP[[}`խ7^}n^}nPW[O[@^}n,P[&PPPn [1r^} nP['x ~ݏݏ[1^}np[p[a}`խ Dx ;~4-ݏ! PPx P~ݏI11^}n[[}`խ1R^}nQQQQP1[gQ}`a]P^^}nEPP>[E^}n^}nP)խ^}n^}nP ޭP}`ԭ[[}`խխޭPޭPQ}`aPݭjPPP^ݬw}`[$^}n^}nPޭP}`[[;\}`խխޭP4Q}`a*PݬPP1rޭPxPPPPmP[ݏx ~xݏlf_YLg^;6P*PPPYǏPďPPZǏ[[Fݏx [~ݏ[xYPPPJQPQ1]P^|to"aPPPVZNǏPďPP[ǏYxZPK#QPQQKx Y~ ݏ Ь[ЬZZ ^Ь[լSЬP2kQPQG2ZPPP2@kZP2@kPPPZQ2@kPPQޭPQ}`aPԭԭЬ[[ì[P[PЬZЬ Y zPyQQP[^-PP!xPҭPPPɭPʭ^ԭԭ[3KYZYP@P@9xYYZZ[[ЭPЬ[լ1ЬP2kQPQuPP2@kZ2Yլ P2@kY2kPP2@kXYZZYJIJZXZYZZP2@kPYPZQPAkZZP2kQPQk2kPP@k Ь[2Zk 2kPP2@kZ¬ Z2kPPxPYZYP2kPPZ@kY IJZYY k2kPPЬ[2ZYYP2@kPPZ$YP2@kZYYP2kQPQ2kPPxPPZPAe^ݏݬd=951-)%! 11r4G(f3YC!d&Yo;VVu7{ʉ0- T;/> [2/a1<=`fvK_zlG6$C w$M670)Yn!N6V1p&83)]H+ܝ<5;71g$+#) n0%a3 $ 2nV01}D9R7N:#68W)9:{2}x|~L'\/qö.pag.dircannot open database %s items not in pairs entry too big split not paired bad delitem bad block    $ , 3 : C J PV ] e l s y              )2< CV`l s    $ + 2 > D K ir|      " )4 ; B N T [ m               '<D KS Zt{  &DNZk}    " ( 2 8 = B IS Xf mv }    *         !- 4 @ F M* Tb {              y  $ 3   6  6 _bitno_maxbno_blkno_hmask_pagbuf_dirbuf_dirf_pagf_dbminit.R1_strcpy_strcat_open_printf_fstat_forder.R2_calchas _getbit_fetch.R3_dbm_acc _makdatu(_cmpdatu_delete.R4_delitemT _lseek_write_storeX.R5_additem _clrbuf_setbitt_firstke.R6_firsthar_nextkey.R7_hashinc.R8.R9_read_chkblkN .R10.R11.R12 .R13 .R14_hitab0 _hltabp .R15.R16.R17_abort.R18.R19.R4_delitemT _lseek_write_storeX.R5_additem _clrbuf_setbitt_firstke.R6_firsthar_nextkey.R7_hashinc.R8.R9_read_chkblkN .R10.R11.R12 .R13 .R14_hitabold/lib/libg.a 755 0 33 154 2423022512 6411  0  __dbargs__dbsubc__dbsubn .R4_delitemT _lseek_write_storeX.R5_additem _clrbuf_setbitt_firstke.R6_firsthar_nextkey.R7_hashinc.R8.R9_read_chkblkN /( ,( 5، /\@,\D"old/lib/libl.a 755 0 33 4474 2423022512 6447 e__.SYMDEFBS `_allprin_printab_sprint_main_yyrejec\_yyracc\_yyless_yywrapallprint.or xPPRP EP +P KP~PE~P֠P``Pm~bЬP֬`~KѬ ѬPP\n\t\b\b\%-3o .4 ; BH O W_go w   _allprin.R1_printab_yyout_fprintf__flsbuf_sprint.R2.R3main.or @  _main.R1_yylex_exitreject.or p&QRPBapPP iP((PQA`~zP@rldPР[SKPC`"2P+P"P PЬQA`2J=P@~ά~PݠPPQA`PQA`ЬP    & , 1 9 A I P X c j v |                  # + 3 = H S Z c i p _yyrejec.R1_yyinput_yytext_yyleng_yylsp_yyolsp_yyfnd_yylstat_yyunput_yyracc_yyprevi_yyoutpu.R2_yyextra_yybackyyless.or (``H [լѬ ZЬZ {~[ZkZ{ÏZPP   ! 4 B K Q Z _yyless.R1 _yyleng_yytext_yyunput_yypreviyywrap.or H P_yywrap.R1_yyprevi_yyoutpu.R2_yyextra_yybackyyless.or (``H [լѬ ZЬZ {~old/lib/libln.a 755 0 33 4474 2423022512 6625 e__.SYMDEFBS `_allprin_printab_sprint_main_yyrejec\_yyracc\_yyless_yywrapallprint.or xPPRP EP +P KP~PE~P֠P``Pm~bЬP֬`~KѬ ѬPP\n\t\b\b\%-3o .4 ; BH O W_go w   _allprin.R1_printab_yyout_fprintf__flsbuf_sprint.R2.R3main.or @  _main.R1_yylex_exitreject.or p&QRPBapPP iPPQA`~zP@rldPР[SKPC`"2P+P"P PЬQA`2J=P@~ά~PݠPPQA`PQA`ЬP    & , 1 9 A I P X c j v |                  # + 3 = H S Z c i p _yyrejec.R1_yyinput_yytext_yyleng_yylsp_yyolsp_yyfnd_yylstat_yyunput_yyracc_yyprevi_yyoutpu.R2_yyextra_yybackyyless.or (``H [լѬ ZЬZ {~[ZkZ{ÏZPP   ! 4 B K Q Z _yyless.R1 _yyleng_yytext_yyunput_yypreviyywrap.or H P_yywrap.R1_yyprevi_yyoutpu.R2_yyextra_yybackyyless.or (``H [լѬ ZЬZ {~old/lib/libm.a 755 0 33 40114 2423022513 6460 easin.o_ \X^pq rpq!pPePcP~pPqgP~pPcPg~xpPeP^q q!LpPp~9pPcP.P@!h@@@3@333323@(1 7FN Zh s  _errno_pio2_asin.R1_sqrt_atan_acos.R2atan.o `(qf p~r~rPP^a PqPq7pPrPq %Sq#%rPg P~epPaPbPg ~CpPrmPbfP`Pqg ~rPg P~rPP^q p~Rqg~7pPcPPc|Pa{RgRP~ pPaPP^eeP`PdP`PdP`PdPaPaPdP`PdP`PdP`PdP`PfPePAy1?ϑy@!hI@!hB:IvDv6T1E r OER `EM2 fkCӴKE\QEYWF\*}`EM2 f@@@=EMWas}  )7AX_ju_sq2p1_sq2m1_pio2_pio4_p4 _p3(_p20_p18_p0@_q4H_q3P_q2X_q1`_q0h_atan.R1_satan_atan2(.R2.R3.R4_xatanHhypot.o T(P8^qrq r q pp p q pPf ePaP~pPeP Pp ~p~@ =EXa }_hypot.R1_sqrt_cabsp.R2jn.o X4^լ άrլ p~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~pPp~`PfEP%zگ\.0l4aѶoqB;%zmGt-ϭBA@ABAA + 1JW f y  % /_p0_p1_p2_p3_q0 _q1(_q20_sinh.R1_exp_cosh.R2erf.o X`p(^q rqaepp'ЭPeQaQ@eQaQ@׭խnPdPdPdPfPq nPdPp~pPnPczRdRP^1qir~pPcPYPqWpWPpWpW'ЭPeQaQ@MeQaQ@׭խrPeP~dPfP@nf۝HyF`_HoH.R3.R4_fatal_xalloc_sdiv_free_mult_mcanmout.os $^ݬޭޭԭޭܭ׼ Ь P֠P`P ݬ PP1P :P 5P P-=P\<׼ Ь P֠P`Pݬ fĭ߭UPέ1wѭ0?ѭ990PPݬ߭߭%ݬ߭ݬ߭ݬ12ݭĭP^м έխݬ ЭݭPԭЭPЬQxPPPЭQ`A֭ѭ~nPPPP[k[խ@ѭ-k[[~Dݬ 1ݭ'խ ݭԭԭխ$߭߭ݬ߭2P0PPk[ խ k^мЬPРլ έάխ έέݬ߭ݬ߭(ݬ Ь PЭŭ 2PĭPP^ԭмhݭQP=ЭPЬQxPPPxQ2`PQPǬPЭQPAǬPĬPP׭խP@׭Э Ь PЭխ ݭ ݬݬ ݬݬݬ ݬݬ ݬW0 m_out%s s_div  I        6@ LV     fp  ) 2 >H T^ jt _m_in.R1_xfree__filbuf_mult_madd_move__iob_ungetc_m_out.R2_fprintf_xalloc_malloc_free_sdiv".R3_s_div.R4_min..R5_ominD.R6_moutZ.R7_omoutp.R8_fmout.R9_fmin.R10msqrt.os x^ԭЭЭռ ռ ԼԼ PPPPPP PP PPݭPԭ ЭP֭@ѭPPPPPP@ P@ݬGݬ =߭߭߭ݬ*߭ ߭߭߭߭߭߭߭߭P߭߭߭߭߭ݬ߭߭߭߭ݬ ߭ݬ߭м Pmsqrt: neg argmsqrt  \f         & 5 B R b l _msqrt.R1_fatal_xalloc_xfree_mdiv_madd_sdiv_mcmp_move_mult_msubmult.os @^ЬPРЬPРԭռ μέмռ μέмѭ ߭߭߭ ߭߭߭6ݬ խέ Э ռ  ݭj Ь PЭ^S~FЬ QPԭԭxЭPЬQxPPP2`íPЬQxPPPЭQ2`PPQݭ֭߭߭PѭPPЭQЬ RxQQQPax֭ѭ1ԭԭЭPЬQxPPP2`íPЬQxPPPЭQ2`PPQݭ֭߭߭PѭPPЭQЬ RxQQQPax֭ѭ1ԭüPPԭüPPEЭPЬQxPPP2`íPЬQxPPPЭQ2`PPQݭ߭߭l֭ѭPЭQЬ RxQQQPax֭PѭP1mPЬ QxPPP`   PP  ЬP2PPЬPPЬQPּm_multhr   4_mult.R1_m_mult_xfree_free.R2_xalloc_tradd.R3pow.ows p^ԭЭݬЬQPЬPԭzíPPЬQxPPP2`ԭ߭ݬݬݬ߭ݬ ߭xPPP#߭ݬݬfݬ߭ݬ ߭S֭ѭ֭ѭ1|߭3((߭)^PżPPݭPԭ ЭP@֭ѭP@ݬ ݬ ߭߭ݬ߭߭powrpowrpow2 & f y       A T^ h _pow.R1_xfree_xalloc_mult_mdiv_rpow.R2util.os ,^ݬммέխݭ@ЬQPԭ&ЭPЬQxPPPЭQЬRxQQQ`a֭ѭ^xPP~uPPkPݬhkDN7.'ռЬPݠԼ^мխέЭPЬQxPPP`׭խѭխ ݬռЭέ^PլRЭQPЭP'ЭQPάPЭQPЭPլԽ ^ѼüPԭ߭ݬݬЭ߭ЭPmovemp: no free space%s itomitom1itom2 (2    Baj} _move.R1_xfree_xallocv_dummyr.R2.R3_malloc_fatal.R4__iob_fprintf_fflush_sleep_abort.R5_free_mcan.R6_itomZ.R7_mcmp.R8_msub   Baj} _move.R1_xfree_xallocv_dummyr.R2.R3_malloc_fatal.R4__iob_fprintf_fflush_sleep_abort.R5_freeold/lib/libnm.a 644 0 33 12554 2423022514 6643 eacos.o^ D P0^q q!pPp~nPPpPcPP@!h@  "/ =_errno_pio2_acos.R1_asinasin.o^ XX(pVrVVqV !|PeVVPcP~qVfVPcPP gPVPsrPP@!h % 3 :G _asin_errno_sqrtsatanEDOM!a1 a2a3Apio2a4Ka5Qatan.o^ x0PpP rPP`rPPZpPp RaPRTqPTsPr'PpPsRfRP 'b$PrPPcPPfRP rPPrPPqP-qPgPPcPPaPRbPfRP`PpPXePPVuVLdPXuVigPXP"?D{Av#OP#C"+C|]2CU*j 5@xBJh{CW*UsCL~Sz2CU*j 6I@!h@!hAy2?ϒyIA!h-5HVp|_atan_atan2a1satanmb1;b23pio2Xb3\b4Npipb5dsq2m1hc1yxatansq2p1`c2pio4Ppcoefqcoef(cbrt.o^ Hx0` SpT hrTTЏSTVTW{VVWVVSVUTePPRgRTRcRPRdRbRPePPRgRTRcRPRdRbRPdGPV P|P?@EkW@/)q@?u:tn@?G6H^i_cbrtrangeretztpcoef thirdhcpow.o^ |(PP^qYqq apPj PPnPPqP Hr~pPeP ~pPrPpPp~pPeP ~}!upP %C S o  _errno_pow.R1_log_expexp.o^ d0Pe>PpPpPqPrPqP "pPtPZVsP`VZbVeVVXuXdPVuXcVPR`VPfRPdPPRRZZP=B.pBԝ`E=sM@iD(/zCF:|+eVuCVufGbqhIgN5%L%dD!X]1 I䔶Txة3OLX2) %U`_sin_cosrangenegargtwoopitwoopixXbse7qdaMqdb?qdcEqddJpcoef0qcoefsinh.o^ X0PpVqVqVeVVPuPdVPpV~gPRbRPdPp~gPR`RPdP3,;WjS87OL0P: +8=v*?а@ . G _sinh_cosh>_expexpfrm(pcoefsqrt.o^ (\$ppT Џb|PTVTVW{VVW@VUTgPTR`RPdPgPTR`RPdGPVPj@KDhCɦ@R|j?O?3d@ 7OEDOMb_sqrt_errnorangeretzpcoefhctan.o^ $\(ZpPZrPPt8;PRVʏRR1(cVVZ" pPgPPZPcVVZZPeVVXuXdPVuXgPVPf0yex >EyV+L0ւ@ـX(F̍@NnD)Dju_tanc1fopiPfopixXa0+a1\a23a39a4Sb1>rtanbb2Kfunyb3Opcoefqcoef0tanh.o^ (X0pZpVZZVqV*pPZPpV~pPXgX~qVeVVPuPdVPdPcnXPanXRfRPZP3,;WjS87OL0P: +8=v*?а@$ <_tanh_expt1t2t3Hpcoeft4L+a1\a23a39a4Sb1>rtanbb2Kfunyb3old/lib/libplot.a 755 0 33 11104 2423022514 7200 e__.SYMDEFSS _arc_boxH_circleL_closevtp_closeplp_contP_dot`_erase_label_lineH _linemod| _move( _openvt8_openpl8_point_putsi_spacearc.o^ 8pPXPa``Pݏaݬݬݬ ݬݬݬ   " / 9 C M W a k _arc.R1__iob__flsbuf_putsibox.ob T@0ݬݬݬݬݬݬ ݬݬ ݬݬݬݬ    % 2 ? L _box.R1_move_contcircle.og TP@Pc``Pݏcݬݬݬ    " / 9 C M _circle.R1__iob__flsbuf_putsiclose.on  `     _closevt.R1__iob_fflush_closepl.R2cont.ov HP8Pn``Pݏnݬݬ   " / ((9 C _cont.R1__iob__flsbuf_putsidot.o| @PP^Pd``Pݏdݬݬݬ ݬԭЭP@֭ѭ   % 2 < F P Z n _dot.R1__iob__flsbuf_putsierase.o 4@(Pe``Pݏe   " / _erase.R1__iob__flsbuflabel.o @x^Pt``Pݏtԭ>ЭP֭Q@aaP ЭP֭@~ЬPЭQA`Py ``Pg N   % 2 D K [ b u      _label.R1__iob__flsbufline.o \PHPl``Pݏlݬݬݬ ݬ   " / 9 C M W _line.R1__iob__flsbuf_putsilinmod.o @x^Pf``Pݏfԭ>ЭP֭Q@aaP ЭP֭@~ЬPЭQA`Py ``Pg N   % 2 D K [ b u      _linemod.R1__iob__flsbufmove.o HP8Pm``Pݏmݬݬ   " / 9 C _move.R1__iob__flsbuf_putsiopen.o h@_openvt.R1_openpl.R2point.o HP8Pp``Pݏpݬݬ   " / 9 C _point.R1__iob__flsbuf_putsiputsi.o p@PPQPaPPxPPPQPaxPPPP   " / 5 F M X j _putsi.R1__iob__flsbufspace.o \PHPs``Pݏsݬݬݬ ݬ   " / 9 C M W _space.R1__iob__flsbuf_putsixPPPQPaxPPPP   " / 5 F M X j _putsi.R1__iob__flsbufspace.o \PHPs``Pݏsݬݬݬ ݬ   " / 9 C M W _spaceold/lib/libtermlib.a 755 0 33 7054 2423022514 7651 e__.SYMDEFu _tgetent_tnchktc_tnamatc_tgetnum_tgetfla_tgetstr_UP _BC _tgoto _ospeedh _PCh _tputsh termcap.oyu ,Lx^YXЬP[]kYk/DPPPݬP[ݬ[PePPЬ[YX*ݏ8PX(PYIZYZ [*\#[P[P/kݬ&P1,Z1p ^PP[{:[{P[ktcP[~߭WޭZj:ZZj A ߭$PZZj:Z[QQP$V[PPP@jZ~[1K Zj#EPjkZ[kkj| j:jPjj: j|Zj‘j:ZЬ[Ь[k:[kk:[[P4YYPYiPЬP`iߑّi@i#Y Zi0Z[ Z[P0PP[iP@[P[[hP[kPЬP`kڕkk:Pk@[[$P[kPЬP`kڑk@k=[ݬ[^Ь[мZoXYPPY&YUY:XYPP\P^;Y4XhI%0YxYYP0PPY׭ kP@YYм[Z[PTERMCAPTERM/etc/termcap/etc/termcapTermcap entry too long Bad termcap entry Infinite tc= loop Termcap entry too long E^^\\::n r t bf   4; P ` gp}   "1 GPW ]nx    "< EP# 0:t~  0 _tbuf_hopcoun_tgetent.R1_getenv_strcmp_strcpy_tnchktc>_open_read_close_write_tnamatcL.R2 _strlen.R3 .R4_tskip_tgetnum.R5__ctype__tgetfla,.R6_tgetstrp.R7.R8_tdecodetgoto.ou H<$`h^Ь[ԭЬ Yխ1H1P%11̏`̏` 1Ь PPYЭP֭YQ`PQPPPY֭ЭP֭`Z1[rlPP+PPY֭Y YY IխB<խ5 -PEPPP" YY Y11֬֬ Y1\ZZP֭PD1YPPPYPxPPPY11P.1^1P211?P>1P3N1PB YPxPP YQ QQYQQPY1Pi1q1PdY 3Yd ǏdYP0PPǏdYPďdPPY YP0PP YP PPYP0PPíխ1NЬP1KZ%1Z1^13Pn11dPr1POOPS "      6_UP_BC_tgoto.R1_strcpy_strcattputs.ou `HЬ[Z[kP@ ZPQPQ0QZkP@ Zk.'[kP@ kP0PPZ[kP@k*[ĬZ~ kZ{ s2iP2@aYYPPZYZ N~ ZZ5MS7)  . D ]     _tmspc10_ospeed_PC_tput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x[խ[PxPЭPZݏu]ݬݬb4vb! ݏcG]2"$abݬݬ ݬݬ Hb5bpݏw\ӛ®aݬ ݬݬאַaﴛa^k aѭk^ѭkPSPPPѽaP̏ѭP^ﯕ2Wkѽaݭyѭ,Ѽa ݬլޚ0a^Ь[PݭݬݫЫ[Э ԭЭ߭߭ݬ [kPˏ@PPЫ[Э  Ь[kPˏ@ɎZZ ݬݫZ ݬݫ[[kPЫ @[PkQPA6[k'nAp9ЬPPPPQQPˏPPˏPP 0_ˏPP0ЬP@ﯘ_0^լѬ̙ Ѭ ЬPР P@`[ﵙIݭ[̙=_ЬPݠ ЬPݠ ݠݬyP神_ݬݬЬPРݭݬ PЫ 3l}^ݭݬPh^a^ݭ`ݭ2~2~ ~PDa^ѭ  Kխ ѭ1.4ѭ.ЬPP&&&&&&&[ i V]խ[SЭ 2'ث(eѬ Ѭ  Ѭ1(wtݏgZݭP1~[ݭ15ѭ172ЬPРЭ/ЭPЭQ@A֭֭xPPQQP0BˏPP0ЭP@ЭP@ﳪЭPЭQ@A1ѭ ѭ ѭ  ЬP2QQ Ѭ  Ѭ Ѭy ݭPg\"~[P7ݭЬPP$$!l$l6K>Ѭ Ѭ1 ePxPP@icս1P@ P@ P@&[P@ЭP֭ؑ`1]ЭPP+%k+kkkkkkkk+kk+%1Fխѭѭ- ˏPP Эbѭѭѭ ݫUѭѭѭѭ ˏPP Э)bѭ1[PѬ 1[1Rѭ1PѫPݭ21_ѭ ˏPP Эaѭ2P@ѭѭЭP֭ԕ`Ё[D߭P[1DѬ>Ѭ8Ѭ2Ѭѭ&[!PЬPЭP@[1[ѬˏPP Э`PP P P  ЬP  PPЬP1ЬPPCTTpp"""""~ݫ2~2~YM`[ ˏPP Э0`  ѬݫS  [Ѭ 151,1__U_7b12_'b1$b ϓXaPЬ@_a串Ms|vﱾ﫾菉DV$ bta Zk [ﺼ ?a^2^^PP*a3!'2 a W[1K^Z{ZP@YR(ZYՒVݩȒVѩ)ݏar7PXZ Xj`Yy[[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ѫѫk֫k׫ЫP`Pt>.f>^>X>[>I>L>PPY=>[B>k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ= [P=YPƏPxP=^PZx=PZPPPZx=~9PZZZ==PZPz=x{=PZPPjjd=X=1xYP[PE=Z>=6=9=k*=#=k[P Ь[[ZZZ =jPPj ^Ь[ [[PPݬRPZZ[ZP[ZPPYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPq<@jl<~\S^\7Q<PH<Ь3<PPy%P(( 298R9R8Q9QO8U9UP 4.,"4&$m!"#1 !"#1)!"#1]YWXPNO d37`\6.RQbn;SKT0nB8YWX#P pN$)O k-eRQ[SJTn(*^ gc_`*)+$#FMrG&o'IAf00_11&E!'0D1 2!l59 H@,+a4 $%'& YWX/ P6NOy _-<3q4RQu9SCT"nv wyv{wm|y}ji~szux2szux=,fvZw7:y5vwhty?{a>|%}u~szuxU  vwy{1|}t~szuxvwy{/|}t~szuxvwvyw.{y|t}(~szuxsuxvwy{|t}~szuxvwyv{w|y}~szuxt"uxtvwy{|}~szuxvwy{|}~szuxtvwvyw{y|{}t~szuxszuxvwy{|}t~szuxvwy{|}~szuxtVYWXPNOVYWXPNORQRQSTVYWXPSNTOVYWXPNORQRQSTVYWXPSNTOVYWXPNORQRQSTVYWXPSNTOVYWXPNORQRQSTVYWXPSNTOVYWXPNORQvwy{RQ}STszux STVYWXPNOVYWXPNORQ RQSTVYWXSTLVYWXPNOVYWXRQPNORQSTRQSTVYWXPSNTOvwy{RQ|}~szuxvSwy{|}~szuxvwy{|}szuxnRKHk}*}r(\>zG.pGGGGGm:P}*}!GGaT.G!GGGGG5G($_:'GGGlGGMGGGm5UGG G &GG/jGGGG|dtGGF9 [R} {x/v$)us:olkfe d\ZVOH ##%%&&&"""( ))++ ,,..'/' 000233111115566**--447!!89:$$$$$$$$$$$$$$$$$;;;<  "!#19 2!449826326:2!373338374 0298:4778 :46 223258599::::::::8332 8395)*$%9&+,-(/.57363599999522229573'+399972233933399!"-%L^?M ;AGIK_H \/2Z')BC@EF<=S]1367:[NR abeDJ>ZVX`+049#(* [Z8 dgszTW5cfhijmnoptuvwyY|qrxl{}~kbad bdtydimension table overflowwhiles, fors, etc. too deeply nestednon-constant case expressioncase not in switchswitch table overflowduplicate default in switchdefault not inside switchswitch table overflowduplicate case in switch, %dyacc stack overflowsyntax errorfunction level error$%dFAKEstructure typed union member must be namedfield outside of structureillegal field sizefield outside of structurezero or negative subscriptfunction declaration in bad contextold-fashioned initialization: use =nesting too deepillegal breakillegal continuestatement not reachedvoid function %s cannot return valueloop not entered at toploop not entered at toploop not entered at topprecedence confusion possible: parenthesize!old-fashioned assignment operator& before array or function: ignoredstructure reference must be addressableundeclared initializer name %.8s$ $+/5=EKOXFIELD[%d]SNULLAUTOEXTERNSTATICREGISTEREXTDEFLABELULABELMOSPARAMSTNAMEMOUUNAMETYPEDEFFORTRANENAMEMOEUFORTRANUSTATIC$_0  "'`(2)3{4}5[6]7* ?:+ - /<%>&|^! L~M,88;9. D< S>U= ::\`e)kp/u*~.,'1-%&$(0  +PCC/364r1 vax uts3.0Release: %s rwccom:can't open %s abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_01234567890123456789abcdefABCDEF  01234567abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789  unexpected EOFnewline in string or char constantnon-null byte ignored in string initializerempty character constanttoo many characters in character constantunexpected EOFVARARGSLINTLIBRARYARGSUSEDNOTREACHEDillegal character: %03o (octal)illegal hex constantnewline in BCD constantBCD constant exceeds 6 charactersgcos BCD constant illegalambiguous assignment: assignment op taken=<%c illegal=>%c illegalyylex error, character %03o (octal)out of switch in yylexbad asm constructionbad AR_?? actionasmautobreakcharcasecontinuedoubledefaultdoexternelseenumforfloatfortrangotoifintlongreturnregisterswitchstructsizeofshortstatictypedefunsignedunionvoidwhileNAMESTRING^REG_OREGICONFCON`CCODES U- U*U&HUCALLKUFCALLL!M~lFORCEnINIThSCONViPCONV+h+=i!-( -=)! * *= )&h&=i ?:&&||8,;,OP:= </ =/=)>%?%= @<<A<<= 0B>>C>>= 0|h|=i ^h^=i N++ O-- E->FCALLIFCALLP==Q!=R<=S<T>U>YUGTXUGEWULTVULE]A>>!TYPE6[mCBRANCHgFLDjPMCONVkPVCONV$RETURN oCAST %GOTObSTASG cSTARGdSTCALLfUSTCALL$*, too many errorscannot recover from earlier errors: goodbye! compiler error: warning: out of tree space; simplify expressionwasted space: %ofreeing blank tree!undeffargcharshortintlongfloatdoublestrtyunionty((enumtymoetyucharushortunsignedulong??PTR FTN ARY %sdefid calltyreducedefid( %.8s (%d), , %s, (%d,%d) ), level %d modified to , %s previous def'n: , %s, (%d,%d) ), level %d declared argument %.8s is missing previous class: %s redeclaration of: %sredeclaration of %.8s new entry made void type for %s dimoff, sizoff, offset: %d, %d, %d parameter stack overflowbcsave errorparameter reset errorswitch errordclargs() %s (%d) dclstruct( %.8s ), szindex = %d ??gummy structure memberillegal zero sized structure member: %.8szero sized structure dimtab[%d,%d,%d] = %d,%d,%d member %.8s(%d) redeclaration of formal parameter, %.8scompiler takes alignment of functioncompiler takes size of functionunknown sizeinitialization alignment errorinoff errorbeginit(), curid = %d instk((%d, %o,%d,%d, %d) no automatic aggregate initializationinsane structure member listendinit(), inoff = %d too many initializersempty array declarationbad scalar initializationcannot initialize extern or union} expecteddoinit(%o) illegal initializationillegal {irbrace(): paramno = %d on entry too many local variablesStructure too largeillegal field typefield too bigzero size fieldstructure too largestructure too largenidcl errorillegal type combinationtymerge: arg 1Null dimensionarray of functions is illegalfunction returns illegal typea function is declared as an argumentfunction illegal in structure or unionfunction has illegal storage classillegal use of fieldillegal classillegal classillegal classillegal register declarationillegal classillegal classfortran keyword nonportablefortran declaration must apply to functionfortran function has wrong typeillegal class: %dSymbol table full nonunique entry for %s from %d to %d lookup( %s, %d ), stwart=%d, instruct=%d symbol table fullsymbol table full%.8s undefinedremoving %8s from stab[ %d], flags %o level %d symbol table full%.8s redefinition hides earlier one %d hidden in %d unhide uncovered %d from %d unhide failsbuildtree( %s, %o, %o ) constant argument to NOTconstant in conditional contextdivision by 0.illegal lhs of assignment operator%.8s undefinedmember of structure or union requiredmember %.8s==%.8s? illegal member use: %.8snonunique name demands struct/union or struct/union pointerstruct/union or struct/union pointer requiredundefined structure or unionillegal member use: %.8sillegal indirectionunacceptable operand of &assignment of different structurestype clash in conditionalillegal functionillegal functionother code %dchkstr( %.8s(%d), %d ) undefined structure or uniongummy structureillegal member use: perhaps %.8s.%.8s?division by 0division by 0illegal comparison of enumsenumeration type clash, operator %sillegal combination of pointer and integer, op %sillegal structure pointer combinationillegal array size combinationillegal pointer combinationpointer requiredillegal oconvert: %dillegal pointer subtractionillegal types in :void type illegal in expressiontymatch(%o): %o %s %o => %o constant expectedconstant too big for cross-compileroperands of %s have incompatible typessizeof returns 0 %o) %s, %Ld, %d, , %d, %d statement not reachedPQTURSXYVW& error @  @ null effectstruct/union %.8s never definedstatic variable %.8s unusedlint's little mind is blownno line number for %.8sdeclare the VARARGS arguments you want checked!nonportable character comparisoncomparison of unsigned with negative constantunsigned comparison with 0?degenerate unsigned comparison%.8s may be used before set%.8s evaluation order undefinedfunction %.8s has return(e); and return;argument %.8s unused in function %.8s%.8s unused in function %.8s%.8s set but not used in function %.8sstructure %.8s never definedandable errorcan't take & of %.8slong assignment may lose accuracyassignment to long may sign-extend incorrectlypossible pointer alignment problemquestionable conversion of function pointerbad conversionillegal initializationfilename too long%s(%d): nonportable field typeillegal field typeoption %c now default: see `man 6 lint'illegal option: %cprecision lost in assignment to (possibly sign-extended) fieldprecision lost in field assignment???  AAAAAABBBBBB crt0.oexitcgram.o<_fake_fakenam.R1.R2.R3.R4.R5.R6.R7.R8.R9.R10xdefs.o@_ccnames.R1scan.ot.R1 .R2.R3.R4.R5.R6.R7.R8.R9comm1.o,.R1.R2.R3.R4.R5.R6.R7.R8.R9.R10.R11 .R12.R13pftn.o40.R1.R2.R3.R4.R5 .R6.R7.R8.R9.R10.R11.R12.R13.R14.R15.R16.R17.R18.R19.R20.R21.R22.R23.R24.R25.R26.R27.R28 .R29.R30 .R31.R32.R33.R34.R35 .R36.R37 .R38.R39 .R40 .R41trees.odX.R1.R2.R3.R4 .R5.R6 .R7.R8.R9.R10.R11.R12 .R13.R14.R15.R16.R17.R18.R19.R20.R21.R22.R23 .R24.R25optim.ou.R1.R2.R3.R4lint.oz.R1.R2.R3 .R4.R5 .R6.R7.R8.R9 .R10.R11.R12.R13.R14.R15.R16.R17.R18.R19.R20.R21.R22.R23.R24.R25.R26.R27.R28.R29.R30.R31.R32.R33.R34 .R35freopen..R1fprintf..R1creat.ȍcreatnoerror؏printf.o܏.R1rdwr.o.R1.R2atof.omsignesigndecpttwo31sk0sk1̐cs1ِcs2ܐad0ސad4ad1 ad2 ad3ad5 ex1.ex7ex2>ex3Aex4_ex5fex6yexit.sd0su0su1cm0sd2͑sd1Ǒsd3ёsd4cm1cm2"ctype_.o0filbuf.o0.R1ldexp.oerange"huge<ld1underover errstrncmp.$.R1strncpy.T.R1lseek.olseeknoerrorsprintf..R1doprnt.oܓflsbuf.oh.R1.R2.R3.R4 exit.oexitdata.o strcmp.o .R1 close.o@closenoerrorLisatty.oP.R1open.opopennoerror|read.oreadnoerrorstty.o.R1.R2ioctl.oioctl6noerrorȞungetc.o̞.R1malloc.o _allocs_allocp_alloct_allocx.R1.R2 .R3sbrk.o,breakndnoerr1Inoerr2ewrite.opwritenoerror|cerror.o_exit(start_main_environ%_yylval F_yyval _mkty<_blocklp_bdtyV_cerrorh -_bconGzj_dstash_curdim _dimtab _savebc_psavbc|_asavbc f$_brklab _contlab ]_flostat _swx _resetbcT_addcase_optime6v_uerror,_swp X((_swtab _deflab`Š_tfree._adddef8>_swstartf_swendY_yyexca_yyactr_yypactX_yypgonȰ_yyr1qD_yyr2y_yychk4_yydefz_yyv )l_yycharR_yynerrs_yyerrflZ_yyparsep_yyerrorr>_yylexB^_curclas _blevel $_tymerge-N_defid40_reached _retstat g_ftnend7_types. N_dclstru\;_rstruct9_instruc N_stwart _bstruct':_moedefYR:_strucof _sprintfH_lookupEjT_werror~-_stab _fallocpK_ftnarg>_beginitA_nidclM_uclassQ_doinit$F_endinit>E_irbraceHJ_ilbraceI_clearstrU_autooff 0_regvar 4_dclargs8_ecomppbu_branchT_buildtrcdX_brkflag1d_retlabsx_curftn 8_idname <_lineno (@_iconsp_hflagp_doszof*t_notlvaloj_lastcon 1D_ctypeM_dcon xL_getstrUD_ftitle_ititle_ftnno uT_paramst \_paramno _argoff _minrvar G_inoff !_xdebugh_strflg (ę_node ̙_cflagl_pflagt_scnamesb@_asm_esc`_yytext _lxgcp _mainp1:t_lxmask _caloff4,_offsz __iobD_proflg G _bdebug_tdebug$_edebugz(_ddebug:@_idebugzD_gdebug _fprintfW_freopen_lxinit_tinit-_mkdopeK/_SZCHARo_SZINT_SZFLOAT( _SZDOUBL2_SZLONGT_SZSHORT_yyaccpt>_nerrorsL_ejobcod{_lxenter5_lxmoreC _lxdoped_lxcp __filbuf0_ungetc̞_lxmatch ?_lxtitleJ+_lxstrp_putbyte;E_bycode Ɗ_lxcom_strcmp& _vaflagP_libflagL_argflagH_vflag @_lxrdopel_lxres}(__ctype__isitfloH_lastfre :_whereb_Wflag _talloc+._tcheckb._tfree1g._walkfF/_fwalk4._dope $_opst _indope$_tprint"/_printfE܏_instack _pstk a _fixtypeSP_fixclasQ_ALSTRUCj<_psave7_oallocJ_mknonuntS_hide@"W_efcode_ALINT$_defalig_bfcoden}_talign b?_tsizeH@_fldalԊ_ALPOINT8_ALCHAR _ALFLOAT7(_ALDOUBLA,_ALLONGd0_ALSHORT 4_SZPOINT_inforce4@_zecodel_vfdaligA_ibseenH_iclass _ilocctrL_instkB_defnam(_gotscalH_cinit"_upoffavJ_fldty|Њ_noinitU_commdecM_eprintrt_tyreduc_O_cisregʊ_relookSdU_aocodeH_unhideW_movesta&V_convalDd_opact!$q_pconver=*l_chkpunZf_convert k_tymatchn_ptmatch(m_oconverxl_clocal\_chkstrtc_strefh_maketyep_strargsb_offcon_bpsizej_psizej_econverk_moditypCs_prtdconu_ecode{_oflagN_fortargXu_revrel_andable_nncon `z_ispow2.z_xflagD_aflagT_lnames _lnp y_contxz_lprt)b_outdef _astype|_fsave_fwriteV_ctargs~_lpta~_lmergeOH_fldcon`_exnameh_strip_strncmp$_strncpyT_atof_fclosei_creat̏_open8p_lseek__doprntBcerrorI_fread`__flsbufh_ldexp_mallock _fflush<_read_errno 5_write-p_isatty{P__sobuf x__cleanu__lastbu_close@_freet__sibuf _gtty_stty_ioctl _sbrk0,_realloc_end H_brkwY_strip_strncmp$_strncpyT_atof_fclosei_creat̏_open8p_lseek__doprntBcerrorI_fread`__flsbufh_ldexp_mallock _fflush<_read_errno 5_write-p_isatty{P__sobuf x__cleanu__lastbu_close@_freet__sibuf old/lib/lint2 755 0 33 30600 2423022517 6351 \X ^Юn PPՀPpPP P1P@P`-zP@[^Pp&PuDPx?Ph{-v$qkPPXdX׬Ѭ1wѬЬPݠ* P(;m %Wx ݏ P#[eP[ի ['ݬP rwr^ PPr2r[[[[[+[2[[p ҬP2YpE PYP(YYYYZ  թ pY2  o  | nPPn^ݬЬPӏc 1bUpUpO$P3ݬЬP+ppЬP pЬP$[ЬPРBx[P@RnݭVP[~ݬdݬZ[ЭPР[P2oQPQЬP# 8o /P~oPݬݬЬP "KoPݬЬPӏ .o#ѠoPnݬЬP bnZѠnPРˏPP =ЭPPPPQQPPPP ݬ%6ݬ,R#ЬPѠ pnˏPP 2`n~dnP@^ЬPݠ P@^ ݬZZ[ЬPР$YYѠ ݬ2P[ЬPˏPP ;ЬPР PP1P1P 1P@~P`uPl`;[Z3ЬPݠ P@#^ݬx[PPxZQQP`ˏYPP :Y;PZZ[Z(PPݬˏYPPЬP P^yЭPՠ  P(ѭ^ЬPՠ 12l lPQ}`a~l2vlPPPЬQPЬP@$ЬPUlЬPԠ$ЬP2DlЬPDl ЬPMԭP2`ЭQPxPrPЭQСQ}`a֭ЭP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1ЬPЬ[ PʏPP@ЫZ:ZY3Z P2PPkYZ ~PY PP[ [[[  Ь[Z < 7[cPZ ~9PZ ݫ ԫ kZP{P^߭ݬDPPPݬݏ tݬݬݏtݬ6x.  PPY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [ PtYPƏPxP[^PZxHPZPPPZx5~9PZZZ PZPxPZPPjj 1xYP[PZkk[P Ь[[ZZZjPPj ^Ь[ [[PPݬRPZZ[ZP[ZPPYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j~\S^\7PЬPPbP 3z~ @@rcannot open intermediate filemore than %d args?more than %d filespass 2 error:(file %.*s) too many names definedtoo many types needed%.8s: variable # of args.%.8s, arg. %d used inconsistently%.8s value used inconsistently%.8s multiply declared%.8s value declared inconsistently%.8s function value type must be declared before use %.*s(%d) :: %.*s(%d) main%.8s returns value which is %s ignored sometimesalways%.8s value is used, but none returned %sLDILIBLDCLDXLRVLUVLUELUMUSEDVUSEDEUSEDRVALVARARGS%.8s (), use= , line %d, nargs=%d %.8s used( %.*s(%d) ), but not defined %.8s defined( %.*s(%d) ), but never used %.8s declared( %.*s(%d) ), but never used or defined XxXx \|crt0.oexitlpass2.o<.R1.R2.R3.R4.R5.R6.R7.R8.R9.R10.R11.R12.R13 .R14.R15freopen. .R1fprintf. .R1creat.o creatnoerror printf.o .R1rdwr.o .R1.R2rew.o .R1filbuf.o .R1strncmp. .R1strncpy. .R1lseek.o lseeknoerror doprnt.o flsbuf.oh,.R1.R2.R3.R4 exit.o,exitdata.o8close.o8closenoerrorDisatty.oH.R1open.ohopennoerrortread.oxreadnoerrorstty.o.R1.R2ioctl.oioctl6noerrormalloc.o_allocs _allocp _alloct _allocx .R1.R2 .R3sbrk.obreaknd noerr1noerr2write.o(writenoerror4cerror.o8_exit(,start_main<_environ%_stab _tary q_fnm d_tfree r_ffree r_atyp r_r 8t_hflag_pflag_xflag _uflag_ddddd(_cfno Pt__iob_freopen _errorI_mloopQH_rewind _cleanupb\_chkcompF_findX_setuseG_lread~_setfno_fread` _strncmp _strncpy _fprintfW _tget9_printfE _viceveru_chktype_messa_lastoneV_pstX _ptbYB __flsbufh,_fclosef_creat _open8h_lseek __doprntZcerrorI8__filbuf _fwriteV _fflushT_mallock_readx_write-(_isatty{H__sobuf xXt__cleanu__lastbu _close8_free,__sibuf Xx_gtty_stty_ioctl _sbrk0_reallocH_end G\|_brkw_errno 5X|_messa_lastoneV_pstX _ptbYB __flsbufh,_fclosef_creat _open8hold/lib/llib-lc 755 0 33 7403 2423022517 6624 /* LINTLIBRARY */ #include #include #include #include #include #include int errno; int alarm(s) unsigned s; { return(s); } char *brk(a) char *a; { return(a); } int chdir(s) char *s; { return(0); } int chmod(s, m) char *s; { return(0); } int chown(s, u, g) char *s; { return(0); } int close(f) { return(0); } int creat(s, m) char *s; { return(0); } int dup(f) { return(f); } /* VARARGS */ execl(f, a) char *f, *a; {;} execv(s, v) char *s, *v[]; {;} exit(s) {;} int fork() { return(0); } int fstat(f, b) struct stat *b; { return(0); } int getgid() { return(1); } int getegid() { return(1); } int getpid() { return(1); } int getuid() { return(1); } int geteuid() { return(1); } int gtty(f, b) struct sgttyb *b; { return(0); } int kill(p, s) { return(0); } int link(a, b) char *a, *b; { return(0); } long lseek(f, o, d) long o; { return(0); } int mknod(n, m, a) char *n; { return(0); } char *mktemp(p) char *p; { return(p);} int mount(s, n, f) char *s, *n; { return(0); } int nice(p) { return(0); } int open(f, m) char *f; { return(0); } pause() {;} int pipe(f) int f[2]; { return(0); } profil(b, s, o, i) char *b; {;} int ptrace(r, p, a, d) { return(0); } int read(f, b, l) char *b; { return(l); } char *sbrk(i) { return((char *)0); } int setgid(g) { return(0); } int setuid(u) { return(0); } int signal(c, f) int f; { return(f); } int stat(s, b) char *s; struct stat *b; { return(0); } char *strcat(a, b) char *a, *b; { ; } int strcmp(a, b) char *a, *b; { return(1); } char *strcpy(a, b) char *a, *b; { ; } int strlen(s) char *s; { return(1); } int stty(f, b) struct sgttyb *b; { return(0); } long tell(f) { return((long)0); } int system(s) char *s; { return(0); } time_t time(t) time_t *t; { return( 0 );} int unlink(s) char *s; { return(0); } int wait(s) int *s; { return(1); } int write(f, b, l) char *b; { return(l); } char *calloc(n,s) unsigned n, s; { static char c[1]; return(c); } char *malloc(n) unsigned n; {static char c; return(&c);} char *realloc(p, n) char *p; u((nsigned n; { static char c; return(&c);} free(p) char *p; {;} fclose(f) FILE *f; {return(0);} fflush(f) FILE *f; {return(0);} char *fgets( s, l, f ) char *s; FILE *f; { return(s); } FILE *fopen(s,m) char *s, *m; { return(stdin); } FILE *freopen(s, m, f) char *s, *m; FILE *f; { return(stdin); } FILE *fdopen(fd, m) char *m; { return(stdin);} /* VARARGS */ fprintf( f, s ) FILE *f; char *s; {;} fputs(s,f) char *s; FILE *f; {;} fread( p, s, n, f ) char *p; FILE *f; {return(1);} /* VARARGS */ fscanf( f, s ) FILE *f; char *s; {return(1);} int fwrite( p, s, n, f ) char *p; FILE *f; {return(0);} intss(){return(1); } /* VARARGS */ printf( s ) char *s; {;} rewind(f) FILE *f; {;} long ftell(f) FILE *f; { return(0L); } fseek(f, o, p) FILE *f; long o; { return(0); } /* VARARGS */ scanf( f ) char *f; {return(1); } setbuf( f, b ) FILE *f; char *b; {;} /* VARARGS */ char *sprintf( s, f ) char *s, *f; { return(s);} /* VARARGS */ sscanf( s, f ) char *s, *f; { return(1); } ungetc( c, f ) FILE *f; { return(c); } char *ctime(c) time_t *c;{ return(""); } struct tm *localtime(c) time_t *c; { return localtime(c); } struct tm *gmtime(c) time_t *c; { return gmtime(c); } char *asctime(t) struct tm *t; { return(""); } abort() {} int abs(i) int i; { return(i); } double atof(s) char *s; { return(1.); } char *crypt(k,s) char *k, *s; { return(""); } setkey(k) char *k; {} encrypt(s, i) char *s; {} char *ecvt(v, n, d, s) double v; int *d, *s; { return(""); } char *fcvt(v, n, d, s) double v; int *d, *s; { return(""); } char *gcvt(v, n, b) double v; char *b; { return(""); } monitor(l, h, b, s, n) int (*l)(), (*h)(); short *b; {} perror(s) char *s; {} #include setjmp(e) jmp_buf e; { return(0); } sleep(i) unsigned i; {} struct _iobuf _iob[_NFILE]; char _ctype_[]; atof(s) char *s; { return(1.); } char *crypt(k,s) char *k, *s; { return(""); } setkey(k) char *k; {} encrypt(s, i) char *s; {} char *ecvt(v, n, d, s) double v; int *d, *s; { return(""); } char *fcvt(v, n, d, s) double v; int *d, *s; { return(""); } chold/lib/llib-lc.ln 644 0 33 12270 2423022517 7247 llib-lcerrnoalarm $alarm brk bbrk chdir $chdir chmod $chmod chown $chown close$closecreat$creatdup$dupexecl$execv$Rexit$fork$forkfstat$fstatgetgid$getgidgetegid$getegidgetpid$getpidgetuid$getuidgeteuid$geteuidgtty$`gttykill$killlink$linklseek%lseekmknod $mknod mktemp!bmktemp!mount"$mount"nice#$nice#open$$open$pause%$pipe&$pipe&profil'$ptrace($ptrace(read)$read)sbrk*bsbrk*setgid+$setgid+setuid,$setuid,signal-dsignal-stat.$stat.strcat/bstrcmp0$strcmp0strcpy1bstrlen2$strlen2stty3$`stty3tell4%tell4system5$system5time6%time6unlink7$unlink7wait8$wait8write9$write9calloc:bcalloc:malloc;bmalloc;realloc<brealloc<free=$fclose>$fclose>fflush?$fflush?fgets@bfgets@fopenAhfopenAfreopenBhfreopenBfdopenChfdopenCfprintfE$fputsF$freadG$freadGfscanfI$fscanfIfwriteJ$fwriteJintssK$intssKprintfM$rewindN$ftellO%ftellOfseekP$fseekPscanfR$scanfRsetbufS$sprintfUbsprintfUsscanfW$sscanfWungetcX$ungetcXctimeYbctimeYlocaltimZh localtimZhlocaltimZgmtime[h gmtime[hgmtime[asctime\basctime\abort]$abs^$abs^atof_'atof_crypt`bcrypt`setkeya$encryptb$ecvtcbecvtcfcvtdbfcvtdgcvtebgcvtemonitorf$perrorg$setjmpi$setjmpisleepj$_iobk8_ctype_l2_iobC8gmtime[hlocaltimZhecvtcfcvtdbfcvtdgcvtebgcvtemonitorf$perrorg$setjmpi$old/lib/llib-port 755 0 33 3050 2423022517 7204 /* LINTLIBRARY */ #include exit(s) {;} long lseek(f, o, d) long o; { return(0); } char *mktemp(p) char *p; { return(p);} int (*signal(c, f))() int (*f)(); { return(f); } char *strcat(a, b) char *a, *b; { ; } int strcmp(a, b) char *a, *b; { return(1); } char *strcpy(a, b) char *a, *b; { ; } int strlen(s) char *s; { return(1); } long tell(f) { return((long)0); } long time(t) long *t; { return(0);} char *calloc(n,s) unsigned n, s; { static char c[1]; return(c); } char *malloc(n) unsigned n; {static char c; return(&c);} char *realloc(p, n) char *p; unsigned n; { static char c; return(&c);} free(p) char *p; {;} fclose(f) FILE *f; {return(0);} fflush(f) FILE *f; {return(0);} char *fgets( s, l, f ) char *s; FILE *f; { return(s); } FILE *fopen(s,m) char *s, *m; { return(stdin); } FILE *freopen(s, m, f) char *s, *m; FILE *f; { return(stdin); } FILE *fdopen(fd, m) char *m; { return(stdin);} /* VARARGS */ fprintf( f, s ) FILE *f; char *s; {;} fputs(s,f) char *s; FILE *f; {;} fread( p, s, n, f ) char *p; FILE *f; {return(1);} /* VARARGS */ fscanf( f, s ) FILE *f; char *s; {return(1);} int fwrite( p, s, n, f ) char *p; FILE *f; {return(0);} intss(){return(1); } /* VARARGS */ printf( s ) char *s; {;} rewind(f) FILE *f; {;} /* VARARGS */ scanf( f ) char *f; {return(1); } setbuf( f, b ) FILE *f; char *b; {;} /* VARARGS */ char *sprintf( s, f ) char *s, *f; { return(s);} /* VARARGS */ sscanf( s, f ) char *s, *f; { return(1); } ungetc( c, f ) FILE *f; { return(c); } wdleng(){return(0); } struct ((_iobuf _iob[_NFILE]; char _ctype_[129]; fscanf( f, s ) FILE *f; char *s; {return(1);} int fwrite( p, s, n, f ) char *p; FILE *f; {return(0);} intss(){return(1); } /* VARARGS */ printf( s ) char *s; {;} rewind(f) FILE *f; {;} /* VARARGS */ scanf( f ) char *f; {return(1); } setbuf( f, b ) FILE *f; char *b; {;} /* VARARGS */ char *sprintf( s, f ) char *s, *f; { return(s);} /* VARARGS */ sscanf( s, f ) char *s, *f; { return(1); } ungetc( c, f ) FILE *f; { return(c); } wdleng(){return(0); } struct old/lib/llib-port.ln 644 0 33 3700 2423022517 7613 llib-portexit$lseek%lseekmktempbmktempsignaldsignalstrcatbstrcmp$strcmpstrcpy bstrlen $strlen tell %tell time %time calloc bcalloc mallocbmallocreallobreallofree$fclose$fclosefflush$fflushfgetsbfgetsfopenhfopenfreopehfreopefdopenhfdopenfprint$fputs$fread$freadfscanf$fscanffwrite$fwriteintss$intssprintf $rewind!$scanf#$scanf#setbuf$$sprint&bsprint&sscanf($sscanf(ungetc)$ungetc)wdleng*$wdleng*_iob+8_ctype,2_iob8$intssprintf $old/lib/mcrt0.o 755 0 33 1170 2423022520 6555 $p^Юn PPՀPpPPÏQQQQQQl Qݏ,QQP-P P<|PobYPNo space for monitor buffer $*/ S f l ry    exitcbufs,start_monitor_sbrk_main_exit_IEH3exi_etext_environ__cleanucountbaseprolnospaceemsgem1!_writeP-P P<|PobYPNo space for monitor buffer $*/ S f l ry    exitcbufs,start_monitor_sbrk_main_exit_IEH3exi_etext_environpreserve/ 775 0 33 0 2510247416 5604 pub/ 775 0 33 0 2510247420 4532 pub/ascii 644 0 33 4102 2051124652 5626 |000 nul|001 soh|002 stx|003 etx|004 eot|005 enq|006 ack|007 bel| |010 bs |011 ht |012 nl |013 vt |014 np |015 cr |016 so |017 si | |020 dle|021 dc1|022 dc2|023 dc3|024 dc4|025 nak|026 syn|027 etb| |030 can|031 em |032 sub|033 esc|034 fs |035 gs |036 rs |037 us | |040 sp |041 ! |042 " |043 # |044 $ |045 % |046 & |047 ' | |050 ( |051 ) |052 * |053 + |054 , |055 - |056 . |057 / | |060 0 |061 1 |062 2 |063 3 |064 4 |065 5 |066 6 |067 7 | |070 8 |071 9 |072 : |073 ; |074 < |075 = |076 > |077 ? | |100 @ |101 A |102 B |103 C |104 D |105 E |106 F |107 G | |110 H |111 I |112 J |113 K |114 L |115 M |116 N |117 O | |120 P |121 Q |122 R |123 S |124 T |125 U |126 V |127 W | |130 X |131 Y |132 Z |133 [ |134 \ |135 ] |136 ^ |137 _ | |140 ` |141 a |142 b |143 c |144 d |145 e |146 f |147 g | |150 h |151 i |152 j |153 k |154 l |155 m |156 n |157 o | |160 p |161 q |162 r |163 s |164 t |165 u |166 v |167 w | |170 x |171 y |172 z |173 { |174 | |175 } |176 ~ |177 del| | 00 nul| 01 soh| 02 stx| 03 etx| 04 eot| 05 enq| 06 ack| 07 bel| | 08 bs | 09 ht | 0a nl | 0b vt | 0c np | 0d cr | 0e so | 0f si | | 10 dle| 11 dc1| 12 dc2| 13 dc3| 14 dc4| 15 nak| 16 syn| 17 etb| | 18 can| 19 em | 1a sub| 1b esc| 1c fs | 1d gs | 1e rs | 1f us | | 20 sp | 21 ! | 22 " | 23 # | 24 $ | 25 % | 26 & | 27 ' | | 28 ( | 29 ) | 2a * | 2b + | 2c , | 2d - | 2e . | 2f / | | 30 0 | 31 1 | 32 2 | 33 3 | 34 4 | 35 5 | 36 6 | 37 7 | | 38 8 | 39 9 | 3a : | 3b ; | 3c < | 3d = | 3e > | 3f ? | | 40 @ | 41 A | 42 B | 43 C | 44 D | 45 E | 46 F | 47 G | | 48 H | 49 I | 4a J | 4b K | 4c L | 4d M | 4e N | 4f O | | 50 P | 51 Q | 52 R | 53 S | 54 T | 55 U | 56 V | 57 W | | 58 X | 59 Y | 5a Z | 5b [ | 5c \ | 5d ] | 5e ^ | 5f _ | | 60 ` | 61 a | 62 b | 63 c | 64 d | 65 e | 66 f | 67 g | | 68 h | 69 i | 6a j | 6b k | 6c l | 6d m | 6e n | 6f o | | 70 p | 71 q | 72 r | 73 s | 74 t | 75 u | 76 v | 77 w | | 78 x | 79 y | 7a z | 7b { | 7c | | 7d } | 7e ~ | 7f del| | 42 B | 43 C | 44 D | 45 E | 46 F | 47 G | | 48 H | 49 I | 4a J | 4b K | 4c L | 4d M | 4e N | 4f O | | 50 P | 51 Q | 52 R | 53 S | 54 T | 55 U | 56 V | 57 W | | 58 X | 59 Y | 5a Z | 5b [ | 5c \ | 5d ] | 5e ^ | 5f _ | | 60 ` | 61 a | 62 b | 63 c | 64 d | 65 e | 66 f | 67 g | | 68 h | 69 i | 6a j | 6b k | 6c l | 6d m | 6e n | 6f o | | 70 p | 71 q | 72 r | 73 s | 74 t | 75 u | 76 v | 77 w | pub/eqnchar 644 0 33 5631 2061271273 6172 .EQ tdefine ciplus % "\o'\(pl\(ci'" % ndefine ciplus % O+ % tdefine citimes % "\o'\(mu\(ci'" % ndefine citimes % Ox % tdefine =wig % "\(eq\h'-\w'\(eq'u-\w'\s-2\(ap'u/2u'\v'-.4m'\s-2\z\(ap\(ap\s+2\v'.4m'\h'\w'\(eq'u-\w'\s-2\(ap'u/2u'" % ndefine =wig % ="~" % tdefine bigstar % "\o'\(pl\(mu'" % ndefine bigstar % X|- % tdefine =dot % "\z\(eq\v'-.6m'\h'.2m'\s+2.\s-2\v'.6m'\h'.1m'" % ndefine =dot % = dot % tdefine orsign % "\s-2\v'-.15m'\z\e\e\h'-.05m'\z\(sl\(sl\v'.15m'\s+2" % ndefine orsign % \e/ % tdefine andsign % "\s-2\v'-.15m'\z\(sl\(sl\h'-.05m'\z\e\e\v'.15m'\s+2" % ndefine andsign % /\e % tdefine =del % "\v'.3m'\z=\v'-.6m'\h'.3m'\s-1\(*D\s+1\v'.3m'" % ndefine =del % = to DELTA % tdefine oppA % "\s-2\v'-.15m'\z\e\e\h'-.05m'\z\(sl\(sl\v'-.15m'\h'-.75m'\z-\z-\h'.2m'\z-\z-\v'.3m'\h'.4m'\s+2" % ndefine oppA % V- % tdefine oppE %"\s-3\v'.2m'\z\(em\v'-.5m'\z\(em\v'-.5m'\z\(em\v'.55m'\h'.9m'\z\(br\z\(br\v'.25m'\s+3" % ndefine oppE % E/ % tdefine incl % "\s-1\z\(or\h'-.1m'\v'-.45m'\z\(em\v'.7m'\z\(em\v'.2m'\(em((\v'-.45m'\s+1" % ndefine incl % C_ % tdefine nomem % "\o'\(mo\(sl'" % ndefine nomem % C-/ % tdefine angstrom % "\fR\zA\v'-.3m'\h'.2m'\(de\v'.3m'\fP\h'.2m'" % ndefine angstrom % A to o % tdefine star %{ roman "\v'.5m'\s+3*\s-3\v'-.5m'"}% ndefine star % * % tdefine || % \(or\(or % tdefine wig % "\z>\v'.4m'\(ap\v'-.4m'" % ndefine >wig %{ > from "~" }% tdefine langle % "\s-3\b'\(sl\e'\s0" % ndefine langle %<% tdefine rangle % "\s-3\b'\e\(sl'\s0" % ndefine rangle %>% tdefine hbar % "\zh\v'-.6m'\h'.05m'\(ru\v'.6m'" % ndefine hbar % h\u-\d % ndefine ppd % _| % tdefine ppd % "\o'\(ru\s-2\(or\s+2'" % tdefine <-> % "\o'\(<-\(->'" % ndefine <-> % "<-->" % tdefine <=> % "\s-2\z<\v'.05m'\h'.2m'\z=\h'.55m'=\h'-.6m'\v'-.05m'>\s+2" % ndefine <=> % "<=>" % tdefine |< % "\o'<\(or'" % ndefine |< % <| % tdefine |> % "\o'>\(or'" % ndefine |> % |> % tdefine ang % "\v'-.15m'\z\s-2\(sl\s+2\v'.15m'\(ru" % ndefine ang % /_ % tdefine rang % "\z\(or\h'.15m'\(ru" % ndefine rang % L % tdefine 3dot % "\v'-.8m'\z.\v'.5m'\z.\v'.5m'.\v'-.2m'" % ndefine 3dot % .\u.\u.\d\d % tdefine thf % ".\v'-.5m'.\v'.5m'." % ndefine thf % ..\u.\d % tdefine quarter % roman \(14 % ndefine quarter % 1/4 % tdefine 3quarter % roman \(34 % ndefine 3quarter % 3/4 % tdefine degree % \(de % ndefine degree % nothing sup o % tdefine square % \(sq % ndefine square % [] % tdefine circle % \(ci % ndefine circle % O % tdefine blot % "\fB\(sq\fP" % ndefine blot % HIX % tdefine bullet % \(bu % ndefine bullet % oxe % tdefine -wig % "\(~=" % ndefine -wig % - to "~" % tdefine wig % \(ap % ndefine wig % "~" % tdefine prop % \(pt % ndefine prop % oc % tdefine empty % \(es % ndefine empty % O/ % tdefine member % \(mo % ndefine member % C- % tdefine cup % \(cu % ndefine cup % U % define cap % \(ca % define subset % \(sb % define supset % \(sp % define !subset % \(ib % define !supset % \(ip % .EN \(ci % ndefine circle % O % tdefine blot % "\fB\(sq\fP" % ndefine blot % HIX % tdefine bullet % \(bu pub/greek 644 0 33 733 2061271347 5626 alpha A A | beta B B | gamma \ \ GAMMA G G | delta D D | DELTA W W epsilon S S | zeta Q Q | eta N N THETA T T | theta O O | lambda L L LAMBDA E E | mu M M | nu @ @ xi X X | pi J J | PI P P rho K K | sigma Y Y | SIGMA R R tau I I | phi U U | PHI F F psi V V | PSI H H | omega C C OMEGA Z Z | nabla [ [ | not _ _ partial ] ] | integral ^ ^ /,"pub/kbd 644 0 33 364 2051124652 5264 <[1234567890-_]^\ >qwertyuiop@ asdfghjkl;: zxcvbnm,./ <[1234567890-_]^\ > @ ;: ,./ <{!"#$%&'() =_}~| >QWERTYUIOP` ASDFGHJKL+* ZXCVBNM,.? <{ !"#$%&'() =_} ~ | >QWERTYUIOP` ASDFGHJKL+* ZXCVBNM,.? i J J | PI P P rho K K | sigma Y Y | SIGMA R R tau I I | phi U U | PHI F F psi V V | PSI H H | omega C C OMEGA Z Z | nabla /pT,pT5 /,"pub/marg8 644 0 33 13 2051124652 5511 1 90-_]^\ >qwertyuiop@ asdfghjkl;: zxcvbnm,./ <[1234567890-_]^\ > @ ;: ,./ <{!"#$%&'() =_}~| >QWERTYUIOP` ASDFGHJKL+* ZXCVBNM,.? <{ !"#$%&'() =_} ~ | >QWERTYUIOP` ASDFGHJKL+* ZXCVBNM,.? i J J | PI P P rho K K | sigma Y Y | SIGMA R R tau I I | phi U U | PHI F F psi V V | PSI H H | omega C C OMEGA Z Z | nabla /pT,pT5 /,"pub/tabclr 644 0 33 3 2051124653 5722 2 1 90-_]^\ >qwertyuiop@ asdfghjkl;: zxcvbnm,./ <[1234567890-_]^\ > @ ;: ,./ <{!"#$%&'() =_}~| >QWERTYUIOP` ASDFGHJKL+* ZXCVBNM,.? <{ !"#$%&'() =_} ~ | >QWERTYUIOP` ASDFGHJKL+* ZXCVBNM,.? i J J | PI P P rho K K | sigma Y Y | SIGMA R R tau I I | phi U U | PHI F F psi V V | PSI H H | omega C C OMEGA Z Z | nabla /pT,pT5 /,"pub/tabs 644 0 33 322 2051124653 5450 1 1 1 1 1 1 1 1 1 1 1 012345670123456701234567012345670123456701234567012345670123456701234567012345670 x x x x x x x x x x x x FGHJKL+* ZXCVBNM,.? i J J | PI P P rho K K | sigma Y Y | SIGMA R R tau I I | phi U U | PHI F F psi V V | PSI H H | omega C C OMEGA Z Z | nabla /pT,pT5( /,"pub/tabs4 644 0 33 466 2051124653 5545 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 01230123012301230123012301230123012301230123012301230123012301230123012301230123012301230123012301230 x x x x x x x x x x x x x x x x x x x x x x x x x xx R tau I I | phi U U | PHI F F psi V V | PSI H H | omega C C OMEGA Z Z | nabla /pT,pT58 /,"public/ 775 0 33 0 2510247421 5223 skel/ 775 0 33 0 2510247431 4704 skel/.login 644 0 33 440 2424005266 6060 set path=(/usr/new /usr/ucb /bin /usr/bin /usr/local /usr/games .) setenv EXINIT 'se ai shell=/bin/csh terse nowarn sm' set ignoreeof time=15 alias ts \ 'set noglob ; eval `tset -s -m dialup:c100rv4pna -m plugboard:?hp2621nl \!*`'; alias . logout ts; stty intr ^C kill ^U; biff y uptime x x x x x x x x x xx R tau I I | phi U U | PHI F F psi V V | PSI H H | omega C C A Z ZT/x dDC. /,"((skel/.cshrc 644 0 33 264 2424005254 6053 set history=20 set cdpath=(/usr/src/new /usr/src/sys /usr/src/cmd /usr/man) alias cd 'set old=$cwd; chdir \!*' alias back 'set back=$old; set old=$cwd; cd $back; unset back; dirs' s -m dialup:c100rv4pna -m plugboard:?hp2621nl \!*`'; alias . logout ts; stty intr ^C kill ^U; biff y uptime x x x x x x x x x xx R tau I I | phi U U | PHI F F psi V V | PSI H H | omega C C A Z ZT//pT,pT5؋ /,"skel/.exrc 644 0 33 43 2257356160 5676 set ai shell=/bin/csh terse nowarn /new /usr/src/sys /usr/src/cmd /usr/man) alias cd 'set old=$cwd; chdir \!*' alias back 'set back=$old; set old=$cwd; cd $back; unset back; dirs' s -m dialup:c100rv4pna -m plugboard:?hp2621nl \!*`'; alias . logout ts; stty intr ^C kill ^U; biff y uptime x x x x x x x x x xx R tau I I | phi U U | PHI F F psi V V | PSI H H | omega C C A Z ZT//pT,pT5 /,"skel/READ_ME 644 0 33 271 2264353754 6002 Sample .cshrc, .exrc and .login files are given here. The other files are (systemwide) samples of files for /etc (group, passwd, rc, ttys, ttytype, ttywhere) and /usr/lib (Mail.rc) &c. dialup:c100rv4pna -m plugboard:?hp2621nl \!*`'; alias . logout ts; stty intr ^C kill ^U; biff y uptime x x x x x x x x x xx R tau I I | phi U U | PHI F F psi V V | PSI H H | omega C C A Z ZT//pT,pT5 /,"skel/.project 664 0 33 35 2424005322 6371 Hacking UNIX for its sake... in files are given here. The other files are (systemwide) samples of files for /etc (group, passwd, rc, ttys, ttytype, ttywhere) and /usr/lib (Mail.rc) &c. dialup:c100rv4pna -m plugboard:?hp2621nl \!*`'; alias . logout ts; stty intr ^C kill ^U; biff y uptime x x x x x x x x x xx R tau I I | phi U U | PHI F F psi V V | PSI H H | omega C C A Z ZT//pT,pT5 /,"skel/usr/ 775 0 33 0 2510247427 5522 skel/usr/adm/ 775 0 33 0 2510247426 6262 skel/usr/adm/messages 644 0 33 0 2352750530 10004 skel/usr/adm/lastlog 644 0 33 0 2356306334 7645 skel/usr/adm/msgbuf 644 0 33 0 2264352765 7472 skel/usr/adm/savacct 644 0 33 0 2264352775 7634 skel/usr/adm/usracct 644 0 33 0 2264353005 7637 skel/usr/adm/wtmp 644 0 33 0 2264353012 7160 skel/usr/adm/acct 644 0 33 0 2264353015 7106 skel/usr/adm/dnacct 644 0 33 0 2424005475 7432 skel/usr/adm/dndbug 644 0 33 0 2424005501 7427 skel/usr/adm/va_sum 644 0 33 0 2424005526 7465 ((skel/usr/adm/vaacct 666 0 33 0 2424005531 7434 skel/usr/adm/vpacct 666 0 33 0 2424005535 7457 skel/usr/lib/ 775 0 33 0 2512731445 6270 skel/usr/lib/Mail.rc 644 0 33 24 2424007421 7507 set append dot save .if t \ . ds rq '' .em @z .\" *** FOREIGN LETTERS AND SPECIAL CHARACTERS *** .de sc \" *** define special char< < a9s.me02512731445ll 6.0< a9th .00000006270 \" line length of page .nr $c 1 \" current column number .nr $f 1 1 \" footnote number .ds * \*[1\*]\k*\" \" footnote "name" .nr $d 1 1 \" delayed text number .ds # [1]\k#\" \" ayed tex/ C. /,"skel/usr/lib/crontab 644 0 33 1060 2424007422 7714 30 4 * * * /etc/sa -s > /dev/null 0 4 * * * calendar - 15 4 * * * find /usr/preserve -mtime +7 -a -exec rm -f {} \; 20 4 * * * find /usr/msgs -mtime +21 -a ! -perm 444 -a ! -name bounds -a -exec rm -f {} \; 30 4 * * * /usr/lib/uucp/cleanlog 40 4 * * * find / -name '#*' -atime +3 -exec rm -f {} \; 0,15,30,45 * * * * /usr/lib/atrun 0,10,20,30,40,50 * * * * /etc/dmesg - >>/usr/adm/messages 1,11,21,31,41,51 * * * * (echo -n ' '; date; echo ) >/dev/console 0 0 * * * su daemon < /usr/local/lib/uucp.daily 0 5,12,18 * * * su daemon < /usr/local/lib/uucp.6hours ndar - 15 4 * * * find /usr/preserve -mtime +7 -a -exec rm -f {} \; 20 4 * * * find /usr/msgs -mtime +21 -a ! -perm 444 -a ! -name bounds -a -exec rm -f {} \; 30 4 * * * /usr/lib/uucp/cleanlog 40 4 * * * find / -name '#*' -atime +3 -exec rm -f {} \; 0,15,30,45 * * * * /usr/lib/atrun 0,10,20,30,40,50 * * * * /etc/dmesg - >>/usr/adm/messages 1,11,21,31,41,51 * * * * (echo -n ' '; date; echo ) >/dev/console 0 0 * * * su daemon < /usr/local/lib/uucp.daily 0 5,12,skel/usr/lib/aliases 644 0 33 2262 2512731677 7730 # # 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 delivermail. # # Aliases to handle mail to msgs and news msgs: "|/usr/ucb/msgs -s" bsd-bugs: root bsd-ideas: root wnj:ucbvax!wnj mct:ucbvax!toy ozalp:ucbvax!ozalp schmidt:ucbvax!schmidt sklower:ucbvax!sklower aps:decvax!aps shannon:decvax!shannon tbl:vax135!tbl jfr:vax135!jfr dmr:research!dmr ken:research!ken mark:ucbvax!mark ### The rest of the aliases are for illustration only ### allmsgs:a:msgs,b:msgs,c:msgs,d:msgs,e:msgs,f:msgs,i:msgs,j:msgs,m:msgs,o:msgs,t:msgs,msgs,s:msgs,v:msgs,x:msgs,y:msgs,z:msgs csmsgs:i:msgs,v:msgs,y:msgs,j:msgs,msgs trouble:y:trouble,\trouble schmidt:csvax:schmidt presotto:v:presotto fortune:arnold eric:eric,IngVAX:eric mark:csvax:mark feldman-test: "|/ra/csr/feldman/=mailer/qmail" rnews:"|/usr/local/uurec" laura:v:laura jkf:v:jkf jfk:v:jkf quest:j:kalash,r:toy,r:hickman,r:arnold,y:charles rogue:toy,arnold alonso:v:alonso dmu:v:dmu croft:croft@sri-unix jek:jekulp@mit-mc fateman:v:fateman sgs,e:msgs,f:msgs,i:msgs,j:msgs,m:msgs,o:msgs,t:msgs,msgs,s:msgs,v:msgs,x:msgs,y:msgs,z:msgs csmsgs:i:msgs,v:msgs,y:msgs,j:msgs,msgs trouble:y:trouble,\trouble schmidt:csvax:schmidt presotto:v:presotto fortune:arnold eric:eric,IngVAX:eric mark:csvax:mark feldman-test: "|/ra/csr/feldman/=mailer/qmail" rnews:"|/usr/local/uurec" laura:skel/usr/spool/ 775 0 33 0 2510247431 6651 skel/usr/spool/uucppublic/ 775 0 33 0 2510247430 11023 skel/usr/spool/uucppublic/dummy 644 0 33 0 2264353255 12103 skel/usr/spool/uucppublic/.plan 644 0 33 101 2264353521 12016 I copy files between UNIX systems and plan to continue to do so. < < Ea902510247430< na900000011023 |//|,|5؋ /,"skel/usr/spool/secretmail/ 775 0 33 0 2510247431 11001 skel/usr/spool/secretmail/notice 644 0 33 37 2435351327 12236 Subj: Secret mail has arrived. ms and plan to continue to do so. < < Ea902510247431< na900000011001 |/ lC. /,"((skel/etc/ 775 0 33 0 2527226460 5466 skel/etc/dumpdates 644 0 33 0 2512731356 7367 skel/etc/group 644 0 33 124 2512731356 6604 daemon:*:1:daemon staff:*:10:bill,sklower,mark operator:*:28:bill,sklower,mark,root em1!_writeP-P P< < a902527226460o< a9Y00000005466No space for monitor buffer $*/ S f l ry    exitcbufs,star  //( ,( 5؋ /\@,\D"skel/etc/passwd 644 0 33 1633 2512731357 7000 root::0:10:Ernie Co-vax,508JE,0204:/:/bin/csh daemon:*:1:1:The devil himself:/: sklower:8PYh/dUBQT9Ss:2:10:Keith &,524E,4972,8416222:/usr/sklower:/bin/csh schmidt:FH83PFo4z55cU:7:10:Eric &,473E,4951,8491755:/usr/schmidt:/bin/csh wnj:p4H8s/ulDMb7w:8:10:Bill Joy,457E,4948,4155244510:/usr/wnj:/bin/csh tbl:cBWEbG59spEmM:10:10:Tom London,2019492006:/usr/tbl: jfr:1VYjUQK34CHUg:11:10:JFReiser:/usr/jfr: mark:Pb1AmSpsVPG0Y:12:10:& Horton,529bE,4948,5240633:/usr/mark:/bin/csh mct:FZs71TtXqfnKQ:13:10:Michael C. Toy,461E,7780,4478243:/usr/mct:/bin/csh ozalp:m5syt3.lB5LAE:40:10:& Babaoglu,543E,9955,5484321:/usr/ozalp:/bin/csh dmr:gfVwhuAMF0Trw:42:10:Dennis Ritchie:/usr/dmr: shannon:2hxVRsZVW1oHg:48:10:Bill Shannon:/usr/shannon:/bin/csh aps:HqHepvZSyBs0Q:26:10:Armando Stettner:/usr/aps:/bin/csh ken:sq5UDrPlKj1nA:52:10:& Thompson:/usr/ken: uucp:P0CHBwE/mB51k:66:10:UNIX-to-UNIX Copy:/usr/spool/uucppublic:/usr/lib/uucp/uucico sVPG0Y:12:10:& Horton,529bE,4948,5240633:/usr/mark:/bin/csh mct:FZs71TtXqfnKQ:13:10:Michael C. Toy,46skel/etc/rc 644 0 33 3147 2512731357 6105 HOME=/; export HOME if [ $1x = autobootx ] then echo Automatic reboot in progress... >/dev/console date >/dev/console /etc/fsck -p >/dev/console case $? in 0) date >/dev/console ;; 4) /etc/reboot -n ;; 8) echo "Automatic reboot failed... help!" >/dev/console exit 1 ;; 12) echo "Reboot interrupted" >/dev/console exit 1 ;; *) echo "Unknown error in reboot" > /dev/console exit 1 ;; esac else date >/dev/console fi rm -f /etc/nologin : should fix up the password lock file here if present cp /dev/null /etc/mtab chmod 666 /etc/motd /etc/swapon -a >/dev/console /etc/mount -a >/dev/console echo preserving editor files >/dev/console (cd /tmp; /usr/lib/ex3.6preserve -a) echo clearing /tmp >/dev/console (cd /tmp; rm -f *) echo -n starting daemons: >/dev/console /etc/update; echo -n ' update' >/dev/console /etc/cron; echo -n ' cron' >/dev/console /etc/accton /usr/adm/acct; echo -n ' accounting' >/dev/console if [ -d /usr/net/bin ]; then sh /usr/net/bin/start & echo -n ' network' >/dev/console fi /etc/comsat; echo -n ' mail' >/dev/console if [ -f /dev/cul0 ]; then /usr/lib/dnd > /usr/adm/dndbug echo -n ' dialer' >/dev/console fi cd /usr/spool rm -f uucp/LCK.* if [ -f /dev/lp ]; then rm -f lpd/lock; /usr/lib/lpd; echo -n ' printer' >/dev/console fi if [ -f /dev/vpd ]; then rm -f vpd/lock; /usr/lib/vpd; echo -n ' versatec' >/dev/console fi if [ -f /dev/vad ]; then rm -f vad/lock; /usr/lib/vad; echo -n ' varian' >/dev/console fi echo '.' >/dev/console date >/dev/console /etc/savecore /ra/sys_crash 2>&1 > /dev/console exit 0 [ -f /dev/cul0 ]; then /usr/lib/dnd > /usr/adm/dndbug echo -n ' dialer' >/dev/console fi cd /usr/spool rm -f uucp/LCK.* if [ -f /dev/lp ]; then rm -f lpd/lock; /usr/lib/lpd; echo -n ' printer' >/dev/console fi if [ -f /dev/vpd ]; then rm -f vpd/lock; /usr/lib/vpd; echo -n ' versatec' >/dev/console fi if [ -f /dev/vad ]; then rm -f vad/lock; /usr/lib/vad; echo -n ' varian' >/dev/console fi echskel/etc/ttys 644 0 33 112 2512731357 6451 14console 12tty00 12tty01 12tty02 12tty03 12tty04 12tty05 12tty06 12tty07 h 2>&1 > /dev/console exit 0 [ -f /dev/cul0 ]; then /usr/lib/dnd > /usr/adm/dndbug echo -n ' dialer' >/dev/console fi cd /usr/spool rm -f uucp/LCK.* if [ -f /dev/lp ]; then rm -f lpd/lock; /usr/lib/lpd; echo -n ' printer' >/dev/console fi if [ -f /dev/vpd ]; then rm -f vpd/lock; /usr/lib/vpd; echo -n ' versatec' >/dev/console fi if [ -f/( ,( 5 /\@,\D"skel/etc/ttytype 644 0 33 153 2512731360 7167 dw console vt100 tty00 vt100 tty01 vt100 tty02 vt100 tty03 vt100 tty04 vt100 tty05 vt100 tty06 vt100 tty07 /dev/cul0 ]; then /usr/lib/dnd > /usr/adm/dndbug echo -n ' dialer' >/dev/console fi cd /usr/spool rm -f uucp/LCK.* if [ -f /dev/lp ]; then rm -f lpd/lock; /usr/lib/lpd; echo -n ' printer' >/dev/console fi if [ -f /dev/vpd ]; then rm -f vpd/lock; /usr/lib/vpd; echo -n ' versatec' >/dev/console fi if [ -f/( ,( 5 /\@,\D"skel/etc/ttywhere 644 0 33 540 2512731360 7320 tty where what serial baud device who --- ----- ---- ------ ---- ------ --- 0 570 Evans patch select DZ 0 1 570 Evans patch select DZ 1 2 570 Evans patch select DZ 2 3 570 Evans patch select DZ 3 4 570 Evans patch select DZ 4 5 187M Cory adm3a 9600 DZ 5 Bob Kridle's office 6 570 Evans patch select DZ 6 7 570 Evans patch select DZ 7 vpd/lock; /usr/lib/vpd; echo -n ' versatec' >/dev/console fi if [ -f/( ,( 5( /\@,\D"skel/etc/motd 644 0 33 75 2512731356 6400 Welcome to Berkeley Vax/UNIX (beta-4bsd revised april 1981) ---- ------ --- 0 570 Evans patch select DZ 0 1 570 Evans patch select DZ 1 2 570 Evans patch select DZ 2 3 570 Evans patch select DZ 3 4 570 Evans patch select DZ 4 5 187M Cory adm3a 9600 DZ 5 Bob Kridle's office 6 570 Evans patch select DZ 6 7 570 Evans patch select DZ 7 vpd/lock; /usr/lib/vpd; echo -n ' versatec' >/dev/console fi if [ -f/( ,( 58 /\@,\D"((skel/etc/fstab.rk07 664 0 33 205 2512731374 7333 /dev/hk0a:/:rw:1:1 /dev/hk0g:/usr:rw:1:3 /dev/hk1a:/mnt:rw:1:2 /dev/hk1g:/usr/src:rw:1:3 /dev/hk1a:/tmp:xx:1:2 /dev/hk1g:/mnt:xx:1:3 ct DZ 1 2 570 Evans patch select DZ 2 3 570 Evans patch select DZ 3 4 570 Evans patch select DZ 4 5 187M Cory adm3a 9600 DZ 5 Bob Kridle's office 6 570 Evans patch select DZ 6 7 570 Evans patch select DZ 7 vpd/lock; /usr/lib/vpd; echo -n ' versatec' >/dev/console fi if [ -f/( ,( 5H /\@,\D"skel/etc/utmp 644 0 33 214 2512731360 6430 consoleroot>tty03wnjtty04j1 2 570 Evans patch select DZ 2 3 570 Evans patch select DZ 3 4 570 Evans patch select DZ 4 5 187M Cory adm3a 9600 DZ 5 Bob Kridle's office 6 570 Evans patch select DZ 6 7 570 Evans patch select DZ 7 vpd/lock; /usr/lib/vpd; echo -n ' versatec' >/dev/console fi if [ -f/( ,( 5X /\@,\D"skel/etc/mtab 644 0 33 400 2512731357 6371 /usrhp0h/4bsdhp0d/4bsd/usrhp0f/mnthp1g 9600 DZ 5 Bob Kridle's office 6 570 Evans patch select DZ 6 7 570 Evans patch select DZ 7 vpd/lock; /usr/lib/vpd; echo -n ' versatec' >/dev/console fi if [ -f/( ,( 5h /\@,\D"skel/etc/fstab.rm03 664 0 33 51 2512731374 7310 /dev/hp0a:/:rw:1:1 /dev/hp0g:/usr:rw:1:2 /4bsdhp0d/4bsd/usrhp0f/mnthp1g 9600 DZ 5 Bob Kridle's office 6 570 Evans patch select DZ 6 7 570 Evans patch select DZ 7 vpd/lock; /usr/lib/vpd; echo -n ' versatec' >/dev/console fi if [ -f/( ,( 5x /\@,\D"skel/etc/fstab.rm05 664 0 33 51 2512731374 7312 /dev/hp0a:/:rw:1:1 /dev/hp0h:/usr:rw:1:2 /4bsdhp0d/4bsd/usrhp0f/mnthp1g 9600 DZ 5 Bob Kridle's office 6 570 Evans patch select DZ 6 7 570 Evans patch select DZ 7 vpd/lock; /usr/lib/vpd; echo -n ' versatec' >/dev/console fi if [ -f/( ,( 5 /\@,\D"skel/etc/fstab.rm80 664 0 33 51 2512731374 7315 /dev/hp0a:/:rw:1:1 /dev/hp0g:/usr:rw:1:2 /4bsdhp0d/4bsd/usrhp0f/mnthp1g 9600 DZ 5 Bob Kridle's office 6 570 Evans patch select DZ 6 7 570 Evans patch select DZ 7 vpd/lock; /usr/lib/vpd; echo -n ' versatec' >/dev/console fi if [ -f/( ,( 5 /\@,\D"skel/etc/fstab.rp06 664 0 33 51 2514727123 7315 /dev/hp0a:/:rw:1:1 /dev/hp0g:/usr:rw:1:2 /4bsdhp0d/4bsd/usrhp0f/mnthp1g 9600 DZ 5 Bob Kridle's office 6 570 Evans patch select DZ 6 7 570 Evans patch select DZ 7 vpd/lock; /usr/lib/vpd; echo -n ' versatec' >/dev/console fi if [ -f/( ,( 5 /\@,\D"skel/etc/fstab.up160m 664 0 33 77 2512731375 7570 /dev/up0a:/:rw:1:1 /dev/up0g:/usr:rw:1:2 /dev/up0h:/mnt:rw:1:3 /4bsdhp0d/4bsd/usrhp0f/mnthp1g 9600 DZ 5 Bob Kridle's office 6 570 Evans patch select DZ 6 7 570 Evans patch select DZ 7 vpd/lock; /usr/lib/vpd; echo -n ' versatec' >/dev/console fi if [ -f/( ,( 5 /\@,\D"skel/etc/fstab.up300m 664 0 33 77 2512731375 7564 /dev/up0a:/:rw:1:1 /dev/up0h:/usr:rw:1:2 /dev/up0g:/mnt:rw:1:3 /4bsdhp0d/4bsd/usrhp0f/mnthp1g 9600 DZ 5 Bob Kridle's office 6 570 Evans patch select DZ 6 7 570 Evans patch select DZ 7 vpd/lock; /usr/lib/vpd; echo -n ' versatec' >/dev/console fi if [ -f/( ,( 5Ȍ /\@,\D"skel/etc/fstab.rp07 664 0 33 51 2527226460 7320 /dev/hp0a:/:rw:1:1 /dev/hp0g:/usr:rw:1:2 /dev/up0g:/mnt:rw:1:3 /4bsdhp0d/4bsd/usrhp0f/mnthp1g 9600 DZ 5 Bob Kridle's office 6 570 Evans patch select DZ 6 7 570 Evans patch select DZ 7 vpd/lock; /usr/lib/vpd; echo -n ' versatec' >/dev/console fi if [ -f/( ,( 5، /\@,\D"((spool/ 775 0 33 0 2510247441 5103 spool/at/ 755 0 33 0 2510247436 5511 spool/at/past/ 755 0 33 0 2510247435 6457 spool/at/lasttimedone 664 0 33 5 2506764764 10143 2315 /at/past/1:1 /dev/hp0g:/usr:rw:1:2 /dev/up0g:/mnt:rw:1:3 /4bsdhp0d/4bsd/< < a902510247436< a9/mnt00000005511hp1g 9600 DZ 5 Bob Kridle's office 6 570 Evans patch select DZ 6 7 570 Evans patch select DZ 7 vpd/lock; /usr/lib/vpd; echo -n ' versatec' v/consol //( ,( 5؋ /\@,\D"spool/berknet/ 775 0 33 0 2510247436 6541 spool/berknet/rcv/ 775 0 33 0 2510247436 7333 spool/berknet/sendi/ 775 0 33 0 2510247436 7643 spool/lpd/ 777 0 33 0 2552503675 5676 spool/mail/ 777 0 33 0 2552547731 6042 spool/secretmail/ 777 0 33 0 2510247437 7242 spool/secretmail/notice 644 0 33 37 2432123516 10461 Subj: Secret mail has arrived. sr:rw:1:2 /dev/up0g:/mnt:rw:1:3 /4bsdhp0d/4bsd/< < a902510247437< a9/mnt00000007242hp1g 9600 DZ 5 Bob Kridle's office 6 570 Evans patch select DZ 6 7 570 Evans patch select DZ 7 vpd/lock; /usr/lib/vpd; echo -n ' versatec' v/consol /0 C. /\@,\D"spool/uucp/ 777 102 33 0 2552547712 6136 spool/uucppublic/ 777 102 33 0 2510247440 7322 spool/uucppublic/.plan 644 0 33 101 2424005771 10246 I copy files between UNIX systems and plan to continue to do so. 4bsdhp0d/4bsd/< < a902510247440< a9/mnt00000007322hp1g 9600 DZ 5 Bob Kridle's office 6 570 Evans patch select DZ 6 7 570 Evans patch select DZ 7 vpd/lock; /usr/lib/vpd; echo -n ' versatec' v/consol /0 C. /\@,\D"spool/vad/ 775 0 33 0 2510247441 5655 spool/vpd/ 775 0 33 0 2510247441 5674 tmp/ 777 0 33 0 2552604172 4555 ((ucb/ 775 0 33 0 2662272725 4533 ucb/1kfix 755 0 33 20000 2532061134 5560 (^Юn PPՀPpPP P(ά^׬լϵωϸЬP`,PPЬP`׬1 ߭ݭP ЭPP$PP 5ЬP`g1P P&ЬP`8$1vݏݭݭPݭPݭPݭݭݭwP(ݭݭݭcPݭݭݭOP ЬP`1wݭݏЬP`ϯPPЬP`Ϭ1ޭP( `ЭPP1&PP 1ԭЭЭ ߭ݭϮѭԏ ݏݭݭݭݭφѭԏ !PʏPíP~Ͱݭ[ݭݭݭMݭݭݭ?ݭ ݭݭ׬ݭլ1ͬЭPͬQA` ͬͬЬP`ϛӏ11PʏPÏPխЬP`Y1ݬ \~ݬKЬP PP\ X[`P@X[ݬQPZZݬ$[$P[PXb|*<H^p|$<I_nzError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large(\~ݬPP Ь[ZZZP   !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTP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ZZ~PZЭPZݭDЭPР [ԭ5ԭ'puѭ puqpk֭ѭZ֭ѭZ,^P*PРЭP ЭP z wzЭPРРѭ ЭPѭ Sz쑽 ЭPРxPPĭPxQQP~AP[[ z=[ŭPxPP[PxPPxPPxPPxPPЭPР YZ[ŭ[PZPp@[[ZZЭPݠ ЭPݠ ݭݭݭݭݭݭݭݭݭ OP[ݭj@[ cyﮠݭBЭPЭŭPЭQP 8^Ь[ЬZԭ5pxԭpeP`P֭ѭܬpЭPP@֭ѭج ԭ1]ЭPp@PxPPP[ԭpq pЭح֭ѭج ѭЭtЭP@ЭPЭQ@AЭPЭ@ЭPЭQp@AЭPp@ŬPxPPP[ŬPxPPPZԭpkpjp֭ѭܬpwŬPxPPPxQQP[pkЭԭpeP`P֭ѭܬqMwPp~`VpPq8wrPЭPp@ ePcPRgRwcPŬRRpPBԭfpwŬPxPPPxQQP[ŬPxPPPxQQPZЭԭpeȋP`P֭ѭܬePЭRpPB֭ѭج ԭyŬPxPPPxQQP[ŬPxPPPxQQPZЭPp@ЭԭZPZPePbP֭ѭܬŬPPp@ЭPb@֭ѭج ֭ѭԬ 1ԭ1%Ь[ЭԭԭЭPp@($֭ѭܬݬݬݬݬ ݬݬ ݬЭԭЬ[ԭBЭPr@($ЬZԭpŬ PPe@,P`P֭ѭج p֭ѭܬݬݬݬݬ ݬݬ ݬ~pLupLuЬ[ЬZԭpeP`PpeP`P֭ѭܬ euPqP1ӜЬ[ЬZԭ[P[P`֭ѭܬ etPqP1ЭԭЬ[ԭBЭPr@($ЬZԭpŬ PPe@,P`P֭ѭج p֭ѭܬݬݬݬݬ ݬݬ ݬwpp`tЬ[ԭpeP`P֭ѭܬ e=tPqP1ЭԭЬ[ԭЭPp@($֭ѭܬ ֭ѭԬ$1P (^ԭ1psŬPxPP PxQQP[xPPZpkЭpe܋P`P֭ѭЭPe@PfPŬPxPP PxQQP[xPPZЭpZPZPeܭP`P֭ѭ֭ѭ1OxPP[xPPZpzg{PRBRpPBPPer{p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WP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~}PYj|+~P O6G6 BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[1xݏPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~@PY PP*[ [[[>+ Ь[Z = 8[ePZ~ PZ ݫS ԫ kZP{^ݬPP߭ݬP eof> used before set fetch Btopval Ccollapse Xgetdat Bgetdat Bputdat Bputdat Berase%KWK kill%KAK erase ^H kill ^U cjcjcjcjcjJdk^d,krdDkdvkDekhkPFk:dG>r=; <2<57777C\B,\h&(VV*)"Ad$A$"?=?=! "(!d4xiiPj*jjvj iFiliiHl,H^Eh::BHSJUUUV@P$B[D_exec eof exec exec %d exec Bdyadic T Edyadic C Edyadic C Emonadic T EY D Edyadic Y C Edyadic Y C EY Bcontinuemiot Drho Casgn lvasgn varindexed assign valuesubscript Cassign Csubscript Xcat Xcat C@vP vP red Treduce identityiprod Tinner prod Coprod T@>S2к>mdom Cdomino Tdomino Cdomino Rdomino Mdomino DpCpCpCCCmibm Dmibm Tdibm Rfnam LSHELLSHELL/bin/shsh-cdibm unkbad fileib unk/bin/csh-grade Xtake Ctake Ctranpose Ctranpose Xtranpose Dreverse Xrotate Xrotate CCcompress Xcompress Cexpand Xexpand C@base Rrepresent Rrepresent DPPdeal DA]0pimmed B/bin/cshdigits Dwas %d /usr/bin/ed/usr/ucb/ex/usr/ucb/viwas %d width Dwas %d continuecannot create continue > use> type> labl> %d rank> %d type> size> %d indx> %d ival> %d dims> ;%d'> %d clear ws save Bcannot create%d ed Bexec failure: try againfnl Bcannot openfnd eofsyntax> dup labelarg BIins Bbranch Cnot a wscan not load wssave B.directory B @vP vP DDDscan Treduce identityplot Tplot Rplot Cplot off screenexecute Cmenc Cmenc Da p l ? 1 1 `` 1 april 1980 `` 2@@@A@@@@@@@@A@A@@@@@@P@div Dmod Dpwr Dlog Dcrc Dtanh Dcosh Darc cos Darc sin Dsinh Dcosh Dsqrt Dcomb Drecip Dexp Dlog Dfac DŬˬϬӬ׬ݬ #(-27<AFKPUY^bgkpu{­ǭ˭ϭԭ٭߭  $(,15:?DIOTZ^chmrw|%deoladdplussubminusmulsgndivrecipmodabsminfloormaxceilpwrexploglogecirpicombfacdealranddrhomrhodiotmiotrot0rev0dtrnmtrndibmmibmgdugdukgddgddkexdscanexdkscankiprodoprodquadqquadbr0brddommdomcomredcomkredkrotrevrotkrevkcatravcatkravkprintquotelidcquadcomntindexhprintltlegtgeeqneandornandnornotepsmepsreptakedropexd0asgnimmednameconstfunarg1arg2autorestcom0red0exd0scan0basemenclabelUnimplemented function 'sclr'Unimplemented function 'move'Unimplemented function 'line'k@?%CIA!h>%6` _gP; {a[;E}ֻ<%Ȱq#ǹ-q CCC]/#G!&I!$H!^J!%K!*L!)M!(N!O!P!-"_"="+"M "D "S "P""O""TQ#NT$YU$UV$[XER%Be%Q%R%I%%%!%1%#&%&7',;'Ի ڻ ޻        # (  ,38=  BE K  /_?_KLLOCJ)T(TOP.KO_?OBN+LHMGMMOFaFbFcFdFeFfFgFhFiFjFkFlFmFnFoFpFqFrFsFtFuFvFwFxFyFz B@C B@C@ B <: =Q RRROCSHG NLI MQ!s678T)*+,$ 4o$;Yu! e#vqdX 4\1wW9N! L# )k*+,HPQV> g=$2! Z#&3(%./$M! '#OSB A$" ! #a$fKJ! U#GER@F<^c?p_C :D#lI x[-]j05` bymnhrtiUh0`!!!#p*&3pHp!pp& pp&2!! "!pZYl[CNMO~G}sfgqeHE?    ! "" #&'"!%  !$'       "  !$46&'()+9;S-P. TUVW. >@GIJKC"3/57EF, #?028* ARB%3D1yacc stack overflowsyntax errorasciiaplclearcontinuecopycshdebugdigitsdropeditexerasefnsfuzzlibloadofforiginreadsavevarsviwidthsymbolssg@le$ge^ne*omWepErhRntTtkYdrUitIciOalAclSflDdlGdeHjtJqdLssZscXsiCsuV[^HbvBrpNbrMsp[go]or(nnnrlgrvtrrbcbsbbbgugdqqdmlmibexfrdiotld[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  A=~+)K:"P-,_./0123456789><#%&Q;?'Y[`abcdefghijklmnopqrstuvwxyz{(}T T !)<"=>]|&*%,+./0123456789([;#:\-"BCDEFGHIJ'LMNO*?RS~UVWX^Z_\]^-`abcdefghijklmnopqrstuvwxyz{|} unsign!d char ABCDEFGHIJKLMNOPQRSTUVWXYZ[ }; unsigned char changeoutput[256] = { %d }; Ay1?ϒy@!hI@!hB:IvDv6T1E r OER `EM2 fkCӴLE\QEYWF\*~`EM2 f@@@1@rzA]ݬ5@3elB#"3h@?ØGe@lB,k$d!r@AA@@@"@NnDOLX2xة3I䔶TX]1 D!L%dIgN5&GbqhDK->G?A@@AA@@OO@JGSrCu%طK@0qi9IE4Ÿ@;\)@3fG@@@@@M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec@@A@@A B=(\ B B@ B/bin/shsh-c((/dev/ucb/apropos 755 0 33 30 2532063402 6142 exec /usr/ucb/man -k $* /pT,pT5 /,"ucb/l 755 0 33 40000 2532123154 4774 4k^Юn PPՀPpPP3 P0 ^(868 PPPP7?Ha6$=%PÏNP7߭0PPPP7GP17 7ЬP` ЭP ֭ЭP`ЭP`PPfUPl)PrLPx1P7h7f7;ЭPl:707!#77 77׬1zЬPPP-k1Pc11PF1R1nPA11NP1135gb. 66ּмP`1l`PPm1xd6a6P6R6G6.6556!655PPP51w51nF5551R51I55C111551"w51Ek51 f51a51l51g51PC11Pa12 PR1Pb11Pi)PfPd191]Pg1|1NPl1*1?Ps1,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QP8ЭPР8ЭP4.8ݭݭ_(ԭѭUޭPЭQ RQSA`Cb֭ԭѭнPЭQޭRЭSA`Cb1uнPSQA`1b֭ЭPЭPЭЭPѭϧ- ЭPϝ-4 ϡ- (ЭQP4ݭЭPݠ4֭?ЭP5ԭޭPЭQ RQSA`CbЭPЭPЭЭPЭPР8ѭ*-1ݭ߭ݭ'P1g ЭЭPݭ& ЭPР8ѭ,ςݭϊ&,; -խ0 -1-.1, ."!.Э,1խ1ݭЭPѠ4a,1~ϐ,1Р4Pݠ/PP~&PЭPР4Pݠݭ_&ݭݭ8&ϩ-ݭlPiϙ-ύ( G22P2` 2~_#׽ЭPРQ֠aPݭϢPPݭ$C--+1ЭPР4PݠlPP~&PЭPР4PݠݭϜ%ݭݭu%,ݭϩP ,Z,Ͽ"22P 2` 1~ϗ"׽ЭPРQ֠aPݭPPݭ$ЭPѠ8*τ,YݭϫݭЭPР8ѭϪ*1.$ݼvP~%PݼPϳ$ЬPЬQРЬPݠFP~$ЬQPЬPݠЬPݠv$ЬPݠP~ϵ$ЬQPЬPݠЬPݠF$ЬPݠ P~υ$ЬQP ЬPݠ ЬPݠ $^ݬπ+S~+JЬP1)aPc ЬPP~?P ~B+~$P ~8+@+~U P)~P ~+Ϲ +Ϯ++ϥ0^ЬPР4ѭ)P++vݽ+eԭ")+ЬPݠ ϨPЬPݠ *< *1ЬP* ** ~\Pf ~߭ϟ"t0t)y"ԭޭPPޭQЭR@Ba呭d ЬP߭g*Ϝ d*ϑ~ϧP߭)"ЬP5P~_ ޭPPޭQЭR@Ba߭*2*6ԭޭPPޭQЭR@Ba߭)ЬPݠ,TPխIPEP)ЬPݠ,)1)ѭ íPѭPϴ)ϯ֭ЬPݠ$P@ЬPݠ$ϔ)ϊЬPݠ(P ЬPݠ(~)TѭSЬPݠ,r)AЬPݠ(ϦP ЬPݠ(\)$ѭ ЬPݠ,\)ѭ ЬPݠ,\)d)1^ЬPР4ѭh&PF)O)J)ݽP)ЬPK) I)T)ϩЬPݠ PЬPݠ 8)ωЬPݠ$P1ЬPݠ$')fЬPݠ(ϲPOЬPݠ()FЬPݠ,ϒPЬPݠ,(17ЬPݠ0tP1)ЬPݠ0(1ЬPݠ,SPЬPݠ,(ЬPݠ03P1ЬPݠ0(1ЬPݠ(PmЬPݠ(ϩ(ϦЬPݠ,P0ЬPݠ,ϔ(φЬPݠ0P1ЬPݠ0w(uЬPݠ0ϲPjЬPݠ0_(XЬPݠ,ϕP-ЬPݠ,H()ЬPݠ0uP-ЬPݠ03(ЬPݠ0XPЬPݠ0(ψ$9(ЭPݠ(ЭPݠ PЭPݠ 'ϭЬP?P~ϻ P[ ~[~'ς~PP*'g~{ P[ ~['F'1a^ЬPP PLP }ϵ'φ*Ϲ ݬ  x2-ԭޭPP֬딭߭ԭޭPЭQA`֬-ԭޭPP֬ԭޭPЭQA`֬-ԭޭPP֬-ԭޭPP֬딭1o^ЬPР4& ЬP&$ЬP&(ЬP&,ЬP&0ѭ"1lЭPРޭԭБ*֭̕E߭;P~ЬQP ߭ЬPݠ oЭP֭̑`,1ޭԭj,&&нȘPʏPP֭֭ЕȽ֭̽1v,,֭̽խ0 9PPP֭ЕΔ߭χPޭPQA`CR%ޭPQQP~ϱ~Ϻ%ޭPQQP~ϔ~ЬQP$߭ЬPݠ$1ޭPQA`EޭPQA`Ll%ޭPQQP~?~խ<ѭݭ߭8ЬQP(Bѭѭ 6ݭ߭ЬQP,!~AЬQP0߭ЬPݠ0ЭP֭̑`,1cޭԭ-,,֭̽խ0 9PPP֭ЕΔ߭+Pխ9PPP *ݭ߭rЬQP,6ݭ߭]ЬQP(!~χЬQP0߭ЬPݠ0ЭP֭̑`,1ޭԭ-,,֭̽խ0 9PPP֭ЕΔ߭qPխ0PP &ЬP,PQР,(ݭ߭ϬЬQP,(߭0P~ЬQP0߭ЬPݠ0dЬP P:ݬP2+0+J#% +^ЬPР4 +fЭPŭ~*ϭ ݭ߭*ϢP/ԭޭPЭQ RQSA`CbЬPЬPЭ"]%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<$/usr/adm/lastlog/etc/utmp/.plan/.projectshfinger: Usage -- 'finger [-bfhilmpqsw] [login1 [login2 ...] ]' No one logged on finger: error opening %s finger: error opening %s Login Name TTY Idle When Office Login TTY Idle When Office Login TTY When Idle rProject: rNo Plan. Plan: %-*.*s %-*.*s %-16.16s*%-*.*s %-16.16s %-*.*s %-16.16s Not Logged In %-*.*s ??? %-*.*s %-20.20s ??? * %-2.2s %-9.9s <%-12.12s> %s %-11.11s %8.8s %8.8s %8.8s %8.8s %12.12s Login name: %-10s In real life: ??? Login name: %-10s (messages off) In real life: %-s Office: %-.11s, %s Home phone: %s %s Home phone: %s %s Phone: %s , %s, %s , %s Phone: %s, %s %s Directory: %-25s Shell: %-s On since %15.15s on %-*.*s Idle Time Last login %16.16s on %.*s finger: error in phone numbering Cory Evans LBLfinger: lastlog open error finger: lastlog read error /dev/finger: error STATing %s %2.2d %1.1d %3.3d:%1.1d:%02.2d%3dd%2d minutes%2d seconds%1d minute %1d second%1d minute %d seconds%1d minutes %1d second%1d minutes %d seconds%2d hours%1d hour %1d minute%1d hour %2d minutes%1d hours %1d minute%1d hours %2d minutes%2d days%1d day %1d hour%1d day %2d hours%1d days %1d hour%1d days %2d hours@(#)finger.c 4.1 (Berkeley) 10/1/80M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/etc/passwdrrPDPD <Lucb/u 755 0 33 20000 2532150442 5003 ^Юn PPՀPpPP PZѬЬPРZZPYϳ.w 5Y/PQ ^ ߭ύ߭nP~PD߭=P7`όݼݼ ÏPP~Ϻϱ[ [ Pk E[[2Ь[XXFPX 鑫+PPPYkw+ݏݬPZY1ZZqkalYPPPݬPZ<3ݏݬ}PZYZZݬAPZZ)ZMYPPPݬPZZ1hZY kr  XP\~ݬtPP Ь[(PZ`Z ZP ``P|  Ь Ь Ŭ PP~ݬ^ YìPPPYxY~ݭPPYЭЬ[YZ+Yݭ[ݭ[8 PPhY[[]ZYݭKZY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pPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~YPYj ~P  BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[/1xݏ'PZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP` [ [[[  Ь[Z = 8[ePZ~UPZ ݫ{ ԫ kZP{ Ь[Zk[ZZPlP^߭ݬPPP<,PЬ[ЬZ[Y[YPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ68.G*G" ~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [GPYPƏPxPbPZxPZPPZxp~@PZZZMFPZP9x:PZPPjj#G1xYP[PZkk[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP)@j~\S^\_PCЬPЬPЬRRQ{RPPR PRPPP5P4.R.X.a.k.r.y...Bad flag %s Usage: %s [ -hlsuw ] [ user ] /dev/kmemNo kmem /vmunixNo namelist /etc/utmpr up %d day%s,s %2d:%02d, %d hr%s,s %d min%s,s %d users, load average:, %.2f User tty login@ idle JCPU PCPU what User tty idle what - %d %s & & %d %d /dev/%-*.*s %-*.*s%-2.2s%-2.2s %-.32s /dev/%3d: %02d%2d %spmam/dev/memNo mem /dev/drumNo drum ()vstodbvstodb *ip@(#)w.c 4.4 (Berkeley) 6/5/81_proc_swapdev_Usrptmap_usrpt_nswap_avenrun_bootime_nprocM:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDecr  AAAAAABBBBBB >>0Gucb/ex 1755 0 33 330000 2552600302 6403 1bin/exucb/vi 1755 0 33 330000 2552600302 6405 1bin/exucb/view 1755 0 33 330000 2552600302 6741 1bin/exucb/edit 1755 0 33 330000 2552600302 6714 1bin/exucb/checknr 755 0 33 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YPPPݬPZZ1hZY kr  XP $'[a0,'T0P@X[ݬPZZݬ.&[P[&$ , 6 P ` x   2 D P b q   3 B N a Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too largex$\~ݬo$PPЬ[  P ݏ- P ի ߘP@4 [1$ #B  P2PPݫ~e PkЫk!k    k1WP֫ Ь[ZZZPЬ[ЬZ[XY YY  YXP   !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~1PYj~P ## BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[11xݏPZZ  YYX ZYYXZYZ~`PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP4[ [[[^ Ь[Z = 8[ePZ~YPZ ݫS ԫ kZP{ Ь[ЬZkPkPzQQP@P^߭ݬ\PPPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6(.B(B(((((~*PYm([r(k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ.( [BP (YPƏPxP(bPZx'PZPPZx'~@PZZZ''PZP'x'PZPPjj'B'1xYP[Px'Zq'i'l'k]'V'k[P Ь[[ZZZ='jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP&@j~\S^\_PCЬPЬPЬRRQ{RPPR PRPPPP4,Y,\,_,b,e,h,k,n,q,t,w,z,},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,--- - -------"-%-(-+-.-1-3-5-8-;->-A-D-G-J-M-P-S-V-Y-\-_-b-e-h-k-n-q-t-w-z-}--------------------------------------------... . ....... .#.&.).,./.2.5.8.;.>.A.D.G.J.M.P.S.V.Y.\.^.a.d.g.j.l.o.r.u.x.{.~............................................/// / /////// /#/&/)/,///2/5/8/;/>/A/D/G/J/M/((P/S/V/Y/\/_/b/e/h/k/n/p/s/v/y/|/////////////////////////////////////////////000 0 0000000"0%0(0+0.0104070:0=0@0C0F0I0K0N0Q0T0W0Z0]0`0c0f0i0l0o0r0u0x0{0~00000000000000000000000000000000000000000000111 1 1111111!1$1'1*1-101215181;1>1A1D1rstdinUsage: checknr -s -f -a.xx.yy.xx.yy... -c.xx.xx.xx... Empty command Command too long deunmatched \s0 unmatched \fP Unmatched .%s\s%c%d\f%cBug: stk[%d].opno = %d = .%s, .%s does not match %d: Unmatched .%s %s: %d: .Unknown command: .%s illegal define: %s Only %d known commands allowed @(#)checknr.c 4.4 (Berkeley) 5/13/81szszftftALLEASAEBLLEBSBEDFDEDLLEDSDEFSFEMLLENSNERLLEVLLEABAECDDEDSDEFSFEIDDEKFKEKSKELDDELGNLQSQERSRESMNL(b)b(c)c(d)d(f)f(l)l(q)q(x)x(z)zEQENTSTE[]$c$f$h$p$s(b(c(d(f(l(q(t(x(z)b)c)d)f)l)q)t)x)z+++c1C1c2C2c@(@)@C@D@F@I@M@c@e@f@h@m@n@o@p@r@t@zABAEAFAIALASATAUAXBB1B2BDBEBGBLBSBTBXC1C2CDCMCTDDADEDFDLDSDTECEFEGEHEMENEQEXFAFDFEFGFJFKFLFNFOFQFSFVFXHHCHMHOHUIIDIEIHIMIPIZKDKEKFKQKSLBLCLDLELGLILPMCMEMFMHMLMRMTNDNENHNLNPNSOFOHOKOPPPFPHPPPTPYQEQPQSRRARCRERLRPRQRSRTSS0S2S3SASGSHSKSMSPSYTATBTCTDTETHTLTMTPTQTRTSTXULUSUXVLWCWHXDXFXKXP[[-[0[1[2[3[4[5[<[>[]]]-]<]>][abacadafamarasbbabcbdbiblbpbrbxc.c2cccecfchcsctcudadedidldndsdtdwdyecefehelemeoepevexfcfiflfofpftfzhchehlhphthwhxhyiieifiginipitixlclglilllnlolplsltm1m2m3m4mcmkmon1n2nanenfnhnlnmnnnpnrnsnxofohospapcpiplpmpnpopppsqrrbrdrermrnrorrrsrtsbscshsksospssstsvsztatcthtitltmtptruufuhulvswhxpyrUnknown error: #  AAAAAABBBBBB >>$3Bucb/chfn 4755 0 33 20000 2532067760 5513  ^Юn PPՀPpPP P(4^ԭѬ Y1:ЬPݠP ЬPݠPϾ)P3ЬPݠPϕPPPѭϖϞoPl1FχgP?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~)PYj ~P  BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[`1xݏPZZ  YYX ZYYXZYZ~XPY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PPd[ [[[  Ь[Z = 8[ePZ~YPZ ݫK ԫ kZP{ Ь[ЬZkPkPzQQP8P^߭ݬDPPPݬݏ tݬݬݏtݬ6 P.**~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZF [*P8YPƏPxPbPZx PZPPZx~@PZZZPZPxPZPPjj*1xYP[PZkunk[P Ь[[ZZZUjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~P((YYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j8~\S^\_PCЬPЬPЬRRQ{RPPR PRPPP P/etc/passwd/etc/ptmpUsage: chfn user full-name Illegal character in new string Permission denied. Temporary file busy -- try again wCannot create temporary file Permission denied. %s:%s:%d:%d:%s:%s:%s Temp file disappeared! Cannot recreat passwd file. @(#)chfn.c 4.1 (Berkeley) 10/1/80/etc/passwdrr"" +ucb/chsh 755 0 33 20000 2663140733 5473 t=^[[PPZZYՊZiZZYk P`4^ԭѬѬ ϋ1Ѭ ЬPAЬPݠ&P-ЬPݠPP<Ѭ'ЬPݠSPЬPݠϼP4ЬPݠϬPϓPPPѭϮ18ϛϿTPσ1ϞLP<ύ1ЬPwQР mPݠ ݠݠݠ ݠݠVϏݭ ϺIP@9ЬPݠ3PPPPѭ6=Z7ݭB2PݏϸP9Ϲ,]ݏݭ϶PP϶ݭϦݬ \~ݬЬP PP P QkЬ[k:[kk[PPPyݏ#P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PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ^ [\+PPYPƏPxP7bPZx$PZPPZx~@PZZZPZPxPZPPjj\+1xYP[PZkk[P Ь[[ZZZmjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@jH~\S^\_-P$CЬPЬPЬRRQ{RPPR PRPPP P@(#)crt0.c 4.3 (Berkeley) 1/13/82/etc/passwd/etc/ptmpUsage: chsh user [ /bin/oldcsh ] [ /bin/csh ] /bin/oldcsh/bin/cshOnly /bin/oldcsh or /bin/csh may be specified %s is unavailable Permission denied. Temporary file busy -- try again wCannot create temporary file Permission denied. %s:%s:%d:%d:%s:%s:%s Temp file disappeared! Cannot recreat passwd file. %W% (Berkeley) %G%/etc/passwdrr # #((t+ucb/lpq 755 0 33 22000 2532122733 5337 ^Юn PPՀPpPP PoP,\PIPg"Pt PP@uqU/M)dC f9#P" ]LaPrn.PP|dfPFPLRPPBDoP=X1jhP# [ZP[d ZK[PРQ֠aP PZP K[P tP!dЬ[ XXBPX 鑫+PPPYkw+ݏݬPZY1ZZkalYPPPݬPZ<3ݏݬ}PZYZZMݬqPZZ)ZYPPPݬDPZZ1hZY kr  XP4 ^ЬP ЬP 1Ѭ sՠn iмZЬլ ~PPZPPZЬP )Z%ѭZPQáPѭPQP­P[[ЬP PQРЬP ݬ [~ЬP~PԼ[h׼ ЬP֠ZݬNЬP BPЬP ԼЬP ЬPPQРݬ ݬЬP~PѭPP [P@X[ݬPZZݬL[P[o(^LT^x&8DZlx 8E[jvError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too largeP\~ݬ$GPP^Ь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Z[xYPZPP[xYPZP[PPe@jp~\S^\_UPLCЬ7PЬPЬRRQ{RPPR PRPPPP/usr/spool/lpd/usr/bin/lpr/bin/lpr/usr/ucb/lpr.rOwner Id Chars Filename Line printer is down. Line printer queue is empty. r%-10s%5s%8d %s @(#)lpq.c 4.4 (Berkeley) 81/04/21Unknown error: #""$'((ucb/colcrt 755 0 33 22000 2532070326 6031 ^Юn PPՀPpPP P@׬м'լ1#@ լ\ЬP`P0ЬP`׬wP`PrP2Sg/ЬP`P`-13ЬP`PPP3,׬1&P[[9'լ1[PP1P 1P P1PP)1;  >$~1}Pv`P gP[[PP7>P8'P91  >1~1l1Z1IڤԤ [ˤ ᄂ1ŏPPPPZ[_Z-[jrZYZZYj jj~[*P[j~P+j1j j[j1|-_PP^Ьѭ 2 [[~[[~[[[ǧ[;ŏ[P@Y蠟 iYM[[ì PŏP~ŏP@ŏ~ì PďP@y¬ ŏP@J[ŏPPPZ&kPP P|j  j|j[Zk֕kOŏP@[ŏP@Zk||jj j[ZkŏP@Ь[ЬZЬ YY Ь[ЬZZЬ[4XXjPX 鑫+PPPYkw+ݏݬPZY1ZZkalYPPPݬPZ<︥3ݏݬ}PZYZZݬPZZ)ZYPPPݬPZZ1hZY kr  XPX [ P@X[ݬMPZZݬ[ P[lt~$6FXdz " 1 @ X e { Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large\~ݬPPЬ[  P ݏ P ի ߘP@V [tJ 7N  P2PPݫ~Q PkЫk!k    k1WP֫Ь[ի ݫ Ь Ыk Ь[ZZZP   !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmn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ݭYP 11sS1cݏݏݭ[2PPxDY?YҭPP[P/Y-Y%Y YmXXPРQ֠XaXX~SXXPРQ֠XaXX~ Xx[[1OݭqXiXPРQ֠aP VX Pѭ18XP 12P@1ݏ2X1'XPxPXXWWWPРQ֠WaWW~HW9WWWPРQ֠WaWW~WЭ^W`WP PWP 91:WP ߭2P@W1P1Wh2P@Lyy2_wL1V11VPPS ~VvVPďPƭPPǏPďPPP P[ [P PP[P0PgV [P0P2P@w6V~Ǐ~Q~12P@UU2PP2QQPŰ2PP12PxPP|&^ЬxP|&PԭЭQPAxPx&[*ЭPx@@ЭP@֭֭k[k֭11x4U/UЭP@UUUUzTTPРQ֠TaTT~BTTPРQ֠TaTT~uTP cTЭPx@@PP17ЭP׭P1^ЬZ3XXPР3 T[ T[SxZP|&SPЫ РShh xPЫ x&xZQx&x&SP xP|&SPЫЫYSPY}SPZ rSPԠXdSPЩԨ(^xPx&[xP|&ЭP@ЭP@@ZíЭxP[PЭPQxPPPQaЭPQxPPPQaXխ1[RXxPP[ЭPQxPPPQaЭPQxPPPQaYѭOѭ1JЭPY@PѭP1-X2Z21V[>1YiЭPѭPPPQxPPPQaЭP@ЭPQxPPPQЭaЭPЭ@ݭ[ݭݭݭݭݭݭݭ[խPPPխPPPҭPPPxPPЭQҭRRQxQQQP̭ЭP̭ЭPQxPPPQaЭP@xPPiЭ[Э1%Эh9PѭP.0ZZPР0X[jZXЭhЭPZ@k[10PР0((0PР0ЬPլQQQQQP-x PЬx&x P|&լ*x PȬ|&Ь Ь Pլ Ь PȬlPݬ \~ݬЬP PPЬ[|XXPX 鑫+PPPYkw+ݏݬPZY1ZZkalYPPPݬPZXj| -=L]q Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceI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 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too largeЬ[  P ݏ P ի ߘP@R [!   P2PPݫ~) PkЫk!k    k1WP֫ Ь[ZZZP   !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj~P {AsA BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[!1xݏPZZ  YYX ZYYXZYZ~HPY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PPX[ [[[ Ь[Z = 8[ePZ~9PZ ݫ; ԫ kZP{HP8P^߭ݬDPPPݬݏ tݬݬݏtݬ6 P(G. cGcG GGFG~*PYF[Fk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZF [cPFYPƏPxPFbPZxpFPZPPZx`F~@PZZZ=F6FPZP)Fx*FPZPPjjFcF1xYP[PEZEEEkEEk[P Ь[[ZZZEjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPE@j<~\S^\_!PCЬPЬPЬRRQ{RPPR PRPPPe<P%s: File name must end with ".C" File name too long -- %s rw%s: File is packed. Use unpack. Not a compacted file. Unable to uncompact %s %s uncompacted to %s Unsuccessful uncompact of standard input to standard output. Unknown error: #^^D" cucb/ccat 755 0 33 66 2532070550 5404 # foreach file ($argv) /usr/ucb/uncompact < $file end D" c/pT,pT5L /,"ucb/ctags 755 0 33 32000 2532073402 5643 (^Юn PPՀPpPP' P(!^1ЬPРP`-1\PvHPw9Px:fϨ>6ЬPРPЭQA`PPaPuτ>ς>π>π>֭ЬPРPЭQA`׬Ѭ1mѬN'ar (>">P@r>>>*Bϗ6 =8'&ЭP@&'߭R߭N֭ѭϼ=ϸ= 'P'PPϔ& P϶APς&YϦAϕAVt=Z&V&Ͼ&߭߭χ ZJ1,J,,JϨ+Jϣ+J+J+Jϖ*((Jϐ,Z&[ kP@x*[k%[ kP@*[k%[ kP@L+[k%[ kP@϶+[k%[ kP@!,[k^ &ݬ PϬ@ ݬVݬk Pt<.ݬτ PP-chЭPg@ϮPZ@ωL@ ^ψPZ.σ%S( .@ϛ%@Ϩ]PZZ@;Ur%ݬ#PE/; P[ϻ;[[[L%/.϶ P[kݬt Pj{;ЬԪЪπ;ϴ;$z;ϣ;m;: P l?Ze? _?Z^+ԭЭЭЭx(t(PPl(ԭ*ZZYY ??PРQ֠aP >UP[[>P 1p[ Ϩ*[\;>Ͻ>PРQ֠aP Ϭ>֭ЭQPaa[ [1 [1խJ[*~>x>PРQ֠aP g>P[֭ЭP[``*[ *[/cԭ^խ["1#ԭ1խ ['ԭ1 [PP"1P#1P'1P/1P{1P}1խ1խխ'խ1Kϒ'1ω)YZ߭:P9ZYPP~ZZYPQQPϵ$Ϸ&ԭЭZ11G1@I=C=PРQ֠aP 2=ϕP[֭ЭP[``*1=~1ѭ/E&1֭1ѭ/ԭ1׭1K)'YKϞ' ЭYYZ֭[  ѭ;1π(ЭZZYϓ<Pϑ<ԭЭЭ%%PPϼ%1\ ^м[kԭϤ%_P@ϡ%cC<=1<1x Pt;mlP^bPO[PVP5QϼP$P@RP12ϖPsߴP@21iP`PP PPfPp)Ps=SP+.DP5P (PϣݬݏH33P1H7P[P PQKaQ QPQ ֬[ޕ [PPP@^P*P@HPP@>ϴϯ߫P@)^ϧ2[[k{φ߂P@P PP@e[kP@ kP@[kkk=k"?6 ݬPP[[~hPZݬZZP Ь[Zk[ZZPĬݬ+P[P[Z~PYԊY[Pݬd^ռԼЬP Dμ[[ЬP ՠ PQá[ЬP~PPЭPЬP P[ݬ \~ݬW ЬP PPЬ [ЬY׬&k ЫP֫`P [PPZZZ Z YPЬPЬ[XXPX 鑫+PPPYkw+ݏݬPZY1ZZkalYPPPݬPZl-[P[H $4LVp$6EUdu"5Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large\~ݬPPЬ[[ ~kЫ0   Ь[  P ݏ P ի ߘP@j6 [D+Z Gv  P2PPݫ~ PkЫk!k    k1WP֫ Ь[ZZZPЬ[ЬZ[XY YY  YXP ^pP+ݬzqcxݏcP[PZ߭MPP Pѭ[MZBЭPݬݬݬ;0^BЬ2߭ \~ݬ׭ ЭP֭` ߭rЬP  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj ~P ## BЫZ֫ZPѫPѬ ZPPXPZ~qPYZkn 1mЫZ3[T+1xݏ[PZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PPX [ [[[  Ь[Z = 8[ePZ~YPZ ݫ ԫ kZP{ Ь[ЬZkPkPzQQPP^߭ݬxPPPЬ[ЬZ[Y[YPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ68Ь[ѬP ѫѫk֫k׫ЫP`P(.pK(lK(((((~*PY([(k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZZ( [lKPL(YPƏPxP3(bPZx (PZPPZx(~@PZZZ''PZP'x'PZPPjj'lK'1xYP[P'Z'''k''k[P Ь[[ZZZi'jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP&@j~\S^\PЬPЬPЬRRQ{RPPR PRPPЭRBQPPbPbլQPP)?)))*S**%s;rm OTAGSawsort %s -o %srctags: too many functions to sort mainM%s$defineDuplicate function in file %s, line %d: %s Second entry ignored Duplicate function in files %s and %s: %s (Warning only) %s %s %c^\\%c %s %s %d %-16s%4d %-16s %s integerre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P[Pk[[P ݬPZJ:[ݬݫ/P[Pk[[P ݬP[ݬeoݫg^ЫZݪ HjZZ;4 ЬZ[ x[PQPQ[j[[PPP[Pߜ 3=Wi{˝ם ,<K\p˞؞ #panic: Stdio Error: rToo much "sourcing" going on. "Source" stack over-pop. reply-toFromremotefrom!No more mail. On last screenful of messages On first screenful of messages Unrecognized scrolling command "%s" subjectsubj %d/%d%c%3d %-8s %16.16s %s "%s" %c%3d %-8s %16.16s %s %d Commands are: %s, quietMessage %2d: toplinesNo messages applicable At EOF No messages to save. "%s" [Appended][New file]a%s %d/%d No messages to write. No file specified. No more messages forkOkie dokie -- Core dumped SHELL/bin/csh-c! /usr/lib/Mail.helpNo help just now. Sorry, can't reply to multiple messages at once ccCannot "preserve" in edit mode %d: %d %s %s Non-null variable name required "%s": undefined variable Reading "%s" Reading %s's mail dotignorewaskescape.henryUnknown tilde escape. ~h: no can do!? (continue) Interpolate what file? %s: directory Write what file!? No messages to send from!?! /usr/lib/Mail.help.~------- Message contains: %s: File exists %d/%ld %s: file exists EDITORVISUAL/usr/ucb/ex/usr/ucb/viFatal error in "%s" /bin/sh"%s" failed!? No bytes from "%s" !? No appropriate messages Interpolating: %d/tmp (Interrupt -- one more to kill letter) nosave@Messageholdfseektemporary file seekInsufficient memory for %d messages removed complete ~{[*?$`'"\pipeecho %s"Echo" failed read"%s": No match Buffer overflow expanding "%s" "%s": Ambiguous dup/etc/passwdFrom No from or date fieldDate field not legal date"%s" not a header because %s tty/usr/spool/mail/USER.lock/usr/spool/mail/tmXXXXXXLocked = %d !^:%@.bfgingresing70berkeleyingvaxvirusvlsiimageesvaxsesmqresearcharpavaxsrcmathstatcsvaxucbucbvaxvax135coryeecs40arpafix(%s, %s) Somethings amiss -- no @ or % in arpafix machine %s unknown, uses: %s machine %s known but remote, uses: %s daemonmachine local, call netmap(%s, %s) Ran out of machine id spots Out of machine ids Use made of undefined machine id No host named "%s" net name syntax Made up bad net name Strange arg to optiboth ERROR: unknown internal machine id No way to get from "%s" to "%s" !^@:% !^@:%detract asked to insert commas , ,(From %s %sCan't reopen image metooExpanding alias to depth larger than %d No names to unpacksend-mail-r-i-m-h%s(%d) /usr/lib/Mail.rc_ Can't "!" while sourcing 0123456789$^.-+*'"What? May not exe((cute "%s" while sending May not execute "%s" while sourcing No applicable messages %s requires at least %d arg(s) %s takes no more than %d arg(s) Unknown argtypeautoprintInterrupt Mail version 2.0 %s. Type ? for help. 1 message: %d messages: No numbers mixed with * Non-numeric second argument Referencing beyond EOF Referencing before 1 Can't mix "*" with anything No applicable messages. No applicable messages from {%s, %s} %d: Invalid message number %d: Inappropriate message Missing %c Too many regretsBad message number to markBad message number to unmarkUnknown metachar (%c) Address required after -r You obviously dont know what you're doing Number required for -h -h needs non-zero number Subject req'd for -s Unknown flag: %s /crp/kas/gotchauser daemon, real uid %d Cannot give -f and people to send to. The flags you gave make no sense since you're not sending mail. Warning: "%s" not writable. No mail for %s No mail. No messages. New mail has arrived. Held 1 message in %s Held %2d messages in %s appendSaved 1 message in mbox Saved %d messages in mbox Thou hast new mail. Held %d messages in %s No message !?! askccEOT No recipients specified Null message body; hope that's ok . . . message lost, sorry. Recipients of message: "%s"record/crp/kurt/postage%s %d %d /etc/delivermail/bin/mailShould be inserting commas in recip lists Please notify Kurt Shoens To: Subject: %s Cc: Bcc: String too largeNo room for space %d Internal error/tmp/Rs%05d/tmp/Rq%05d/tmp/Rm%05d/tmp/Re%05d/tmp/Rx%05dubluitWho are you!? HOME/mbox/.mailrc/dead.letteruid = %d, user = %s, mailname = %s deadletter = %s, mailrc = %s, mbox = %s gttySubject: too long to edit "%s": not a group %s January 13, 1981Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksB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ݬPYYPjYX kr  ZPݬ \~ݬЬP PP0 8[)@P@X[ݬ%PZZݬ[P[ 8H`j,8JYix*6IError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too largeЬ[  P ݏ P ի ߘP@ [\ N  P2PPݫ~Q PkЫk!k    k1WP֫Ь[ի ݫ Ь Ыk Ь[ZZZP   !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYjH~P   BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[l1xݏPZZ  YYX ZYYXZYZ~(PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[  Ь[Z = 8[ePZ~9PZ ݫ ԫ kZP{(P^߭ݬDP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֠aaP ݬݬdЬ[ЬZ!jЪP֪X``P ZX6PYXYPЬ[Ь Z+PPPXZkw+ݏݬPYX1YY kalXPPPݬPY<3ݏݬPYXYYݬPYY)YXPPPݬPYYPjYX kr  ZPݬ \~ݬ#ЬP PPЬ [ЬY׬&k ЫP֫`P [,PZZZ Z YPЬP'PZЬ[[ ZY0PPk ZPZ{X[aYYzPYkYݬ PЬP!Ь[XX2PX 鑫+PPPYkw+ݏݬPZY1ZZkalYPPPݬ PZ<3ݏݬ}PZYZZݬPZZ)ZYPPPݬPZZ1hZY kr  XP 4[Q<DP@X[ݬPZZݬJ9[P[#*<LXjz 1EVetError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too largeЬ[  P ݏq P ի ߘP@ [p&: 'f  P2PPݫ~ PkЫk!k    k1WP֫Ь[ЬZЬ YY kPYP kPzQQP Ь[ZZZP00 QP  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~QPYj ~P   BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[&1xݏPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PPH [ [[[r  Ь[Z = 8[ePZ~YPZ ݫs ԫ kZP{ Ь[ЬZkPkPzQQP`P^߭ݬDPPP0 ݬݏ tݬݬݏtݬ6 PЬPЬRRQ{RPRPPPRRP.0r0jdgUX~*PYA[Fk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [0PYPƏPxPbPZxPZPPZx~@PZZZPZPxPZPPjjk0_1xYP[PLZE=@k1*k[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPq@j~\S^\_PCЬPЬPЬRRQ{RPPR PRPPPP((@(#)pmerge.c 1.2 6/9/81/usr/tmp/MGXXXXXXw/usr/tmp/MGXXXXXXw/usr/tmp/MGXXXXXXw/usr/tmp/MGXXXXXXw/usr/tmp/MGXXXXXXw/usr/tmp/MGXXXXXXw/usr/tmp/MGXXXXXXwrincludeinclude table overflow include name table overflow rbad include format:beginimproper program bodycaseconstendtoo many end statementsexternalforwardfunctionforwardlabelprocedureprogramimproper program nestingtypevar%.*sr/Unknown error: #  AAAAAABBBBBB ,,',0 r<$ $f4 ,fl 6x @~ H QX Zh b j s|$(fy DTd"+729$ A4 JPV~f\r$e 9'l }'s G'|l$ $0$$($<uT{,$0$4$8$7<$@$D$.p&x th  B6l 6 )Jl0%9A4 H+ OX _x hqfz . ; '~pdX 4 '%$$ L3% (- 7y= ,E.KQDX^7g ,0lqcrt0.opmerge.o_sccsidfputc.ofputs.ofreopen.ofprintf.ofgets.omktemp.oaccess.ofopen.ocreat.operror.oerrlst.octype_.ofilbuf.ostrcmpn.ostrlen.osignal.olseek.ogetpid.odoprnt.oflsbuf.oexit.odata.ostrcmp.oclose.oisatty.oopen.oread.ostty.oioctl.ounlink.ourem.omalloc.osbrk.oudiv.owrite.ocerror.o_exitstart_main_environ_files_names_curfile_labelopen_constopen_typeopen_varopen_onintr_unlink_incom_incur_inbrac_instr_inprog_beginnest_nest__iob_signal_mktemp_fopen_quit_fclose_freopen_printout_split__ctype__strcmp_fputs_fgets_strcmpn_fputc_fprintf__filbuf__flsbuf_perror_creat_close_open_errno_lseek__doprnt_getpiduremudiv_accesscerror__lastbuf_sys_nerr_sys_errlist_strlen_write_malloc_fflush_read_getppid_isatty__sobuf__cleanup_free__sibuf_gtty_stty_ioctl_sbrk_realloc_end_brks_curfile_labelopen_constopen_typeopen_varopen_onintr_unlink_incom_incur_inbrac_instr_inprog_beginnest_nest__iob_signal_mktemp_fopen_quit_fclose_freopen_printout_split__ctype__strcmp_fputs_fgets_strcmpn_fputc_fprintf__filbuf__flsbuf_perror_creat_close_open_errno_lseek__doprnt_getpiduremudiv_accesscerror__lastbufucb/biff 755 0 33 16000 2532067107 5457 ^Юn PPՀPpPP P<$^8P׬Pϭ5 ߭ݭ>Pݭլ/ψPσPPsPPPϷЬP`P`PPn/Py@N`l*9H`mError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large\~ݬPP Ь[ZZZP  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭI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9PZ ݫ ԫ kZP{(P^߭ݬDPPPݬݏ tݬݬݏtݬ6.**~*PYq[vk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ2 [*P$YPƏPxP bPZxPZPPZx~@PZZZPZPxPZPPjj*1xYP[P|ZumpkaZk[P Ь[[ZZZAjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j4~\S^\_PCЬPЬPЬRRQ{RPPR PRPPPP((Unknown flag RE error Can't open %s %s %s:%ld RE botch %s:%d:%ld:%s &&+ucb/head 755 0 33 20000 2532110052 5431 ^Юn PPՀPpPP P  ^58׬Ь['ЬP`P`-ЬP`~Pύ[׬[[ 0!1[@dЬP`PЬP`ςϏЬP`[ԭ ϚϘPϓ ` φ Oϻ Ѭխ ݭπWT[1O ^Ь[/)ݏϒPϸ5[[ Ь[Zk9 ZkP0PPZ[k0k{ϦZPЬ[Ь Z+PPPXZ#kw+ݏݬCPYX1YY\kalXPPPݬjPY<3ݏݬPYXYYݬ,PYY)YXXPPPݬPYYPjYX kr  ZPݬ \~ݬЬP PPЬ [ЬY׬&k ЫP֫`P [PZZZ Z YPЬPX [i\P@X[ݬMPZZݬ[ P[LT^x&8DZlx 8E[jvError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large\~ݬPPЬ[  P ݏ P ի ߘP@ [pf SN  P2PPݫ~Q PkЫk!k    k1WP֫Ь[ի ݫ Ь Ыk Ь[ZZZP   !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPR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Z[YYPݬݏ tݬݬݏtݬ6+.F +F+****~*PY*[*k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ* [FP*YPƏPxPs*bPZx`*PZPPZxP*~@PZZZ-*&*PZP*x*PZPPjj*F)1xYP[P)Z)))k))k[P Ь[[ZZZ)jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP )@j\~\S^\_AP8CЬ#PЬPЬRRQ{RPPR PRPPPP ~tty/usr/adm/wtmp/usr/adm/wtmp%-*.*s %-*.*s %10.10s %5.5s still logged in - %s- %5.5s (%5.5s) (%ld+%5.5s) ~shutdowndown crash wtmp begins %10.10s %5.5s interrupted %10.10s %5.5s reboot@(#)last.c 4.3 (Berkeley) 2/28/81M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/etc/passwdrrUnknown error: # > >((#Fucb/lastcomm 755 0 33 22000 2532110413 6352 x2^Юn PPՀPpPP P@0^)mEP P@:"\EP P@)"MEP>EϚAP ϙ%E~#EPǏPPP1tx ~~ ݏϳ~P P14xP2P P@φ!1xP<~"PxP<~PnPvЭxP@RxP@>xP@2xP@!~?֭AЭP@xP@P-ЭP@xP2P P@ ϬP ֭ѭѬѭ@xP@ϭϤPVPgP~xP2P P@z xP@pχ ׭խ1׭խ1 [ЬP P׬x[[լ[PЬP֬ЬQ֬`aωPzP֬֬ݬ P5^߭A 2P?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDe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R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~ PYjp ~P   BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[d1xݏPZZ  YYX ZYYXZYZ~8PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP [ [[[2  Ь[Z = 8[ePZ~9PZ ݫ+ ԫ kZP{8P^߭ݬDPPPݬݏ tݬݬݏtݬ6 P4./&/  ~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [/PYPƏPxPbPZx|PZPPZxl~@PZZZIBPZP5x6PZPPjj/1xYP[PZkk[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP%@j~\S^\_PCЬPЬPЬRRQ{RPPR PRPPPP /usr/spool/lpd/tfaXXXXX/usr/spool/lpd/cfaXXXXX/usr/spool/lpd/lfaXXXXX/usr/spool/lpd/dfaXXXXX$ remote **,onlCannot open %s Cannot remove %s Cannot rename %s /usr/lib/lpdlpdDaemon doesn't exist Copy file is too large pdp::::m0000,m000:$ ident Cannot create %s @(#)lpr.c 4.4 (Berkeley) 81/05/21/etc/passwdr""((/ucb/lprm 755 0 33 20000 2532122742 5513 ^Юn PPՀPpPP P^PP P|׬լnrݼnPЬP`׬^ԭ}xdqfje`߭ݬPO֭߭߭(c߭l߭ t߭d߭dP1gխݬ(mЬ[k~Pf a[[~GPPyݬ?P|PPPEPPBPF PLݬP.m^ݏݬPݬIЬ[k PP [ZP[d ZK.[PРQ֠aP PZP K[P |Pݬ \~ݬЬP PPЬ[dXXPX 鑫+PPPYkw+ݏݬPZY1ZZkalYPPPݬPZ<3ݏݬ}PZYZZYݬ}PZZ)ZYPPPݬPPZZ1hZY kr  XP( [ (P@X[ݬPZZݬ[P[ 0<N^p|):IXp}Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large\~ݬXPP^Ь[ЬZԭլ05Ьj ЪP֪`P ZPYY׭֭ѭ ЭP^Ь[ЬZԭլ.3ЬYj ЪP֪` Z~ Y ֭ѭ ЭPЬ[[ ~kЫ0   Ь[  P ݏ P ի ߘP@~ [   P2PPݫ~9 PkЫk!k    k1WP֫ Ь[ZZZP   !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPY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  #1" ߭% P̀߭D ̀ݏ̀P1̀.́s͂o̓ 8̀QQP[k [kk̀P[P{/|| ̀QQPPx[x#̈́1̀[ k [|k||[~߭̀44v߭7h8͌4)P1߭7@͌4P ͤG )!4c4 Pw P߭q 0P  4߭߭^ݬЬP`c PPP! PPP ^ݬ tЬ[ЬZY [YPP^p P߭n ߭,^լebLPMDݬsP"PKݏPЬ[xЬ[kkiP9. ì[PP@[kk2P[ì[PP@k [k Ь[kPݬ[ PP[ Ь[ЬZjj~k~P[ZkjPPPP@P@PP@ PP PPP@ PP PPPP Ь[ZZՋZPլP]Ь[kSPk[kݬ  ^ݬWPP[1ݏtPЬZtЬZjjeP7!ìZPP@kZjj0PZìZPP@kjZj Ь[ЬZjj~k~'P[Zkjk(k, k k PkP@ kP@[k,P[kP@ Ь[[Z j/Z[Zjk.\[PPZ..~P[PPZ,.&~PP@)[P ^P+ݬݏ߭PP PѭЭPĬݬP[P[Z~PYԊY[Pݬ @PЬ[Ь Z+PPPXZkw+ݏݬcPYX1YYkalXPPPݬPY<3ݏݬ PYXYYݬPYY)YXPPPݬPYYPjYX kr  ZPݬ \~ݬЬP PPЬ [ЬY׬&k ЫP֫`P [PZZZ Z YPЬPЬ[TXXPX 鑫+PPPYkw+ݏݬPZY1ZZykalYPPPݬPZ<03ݏݬ}PZYZZ%ݬIPZZ)ZYPPPݬPZZ1hZY kr  XP [tP@X[ݬPZZݬ>X-[P[4,<HZj| !5FUd|Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large\~ݬ$PPЬ[  P ݏ P ի ߘP@ ['j W  P2PPݫ~ PkЫk!k    k1WP֫ Ь[ZZZPݬݬݬ;0QP^BЬ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file ... /usr/manCan't chdir to /usr/man. localnewpublicBut what do you want from section %s? 1nl6823457pmanx/.x1nlmcgjvjxmsfNo manual entry for %s. No entry for %s in section %c of the manual. No entry for %s in section %c of the manual. r.so .so /usr/man/mancatReformatting page. Wait...nroff -h -man %s > /tmp/man%d; trap '' 1 15; mv /tmp/man%d %s aborted (sorry) done %s %s%s %s|/usr/ucb/ul|/usr/ucb/more -fcat -snroff -mantroff -t -man /usr/lib/tmac/tmac.vcat %s|/usr/lib/rvsort|/usr/ucb/vpr -t/tmp/man%dman: -k what? /usr/lib/whatisr/usr/lib/whatis%s%s: nothing apropriate man: -f what? /usr/lib/whatisr/usr/lib/whatis%s%s: not found cosa12345678npP13/bin/shsh-cUnknown error: #  AAAAAABBBBBB - -(L1 r< y " , 6~ >XFxNW`i~r{$,<Lffy4Dd t!*!19 A J$ S7P"Z"a"i"p#x#~<r$ ) ) ) c ) V) )1 .'  ' 3D$!,4$<DJb|QfZtXai+ pxL2u p<FL $6  k z , ` 4' b ` ?"{ "$ !"& -y!3#:.xA;4HdN )U,\~en(x0'#tA  )  -P"7! L1}"crt0.oman.ocalloc.ochdir.ofreopen.ofprintf.ofgets.ofopen.ocreat.operror.oerrlst.oprintf.octype_.ofilbuf.ostrlen.o_exit.oexecl.oexecv.oexecve.osignal.olseek.ogetpid.osprintf.odoprnt.oflsbuf.oexit.odata.ostrcmp.oclose.oisatty.oopen.oread.ostat.ostrcat.ostrcpy.ostty.oioctl.oumask.ounlink.omalloc.osbrk.oudiv.ovfork.owait.owrite.ocerror.o_exitstart_main_environ_nomore_cflag_section_subsec_troffit_killtmp_signal_remove_umask__iob_fprintf_chdir_apropos_whatis_isatty_strcmp_manual_strcpy_strcat_strlen_printf_stat_troff__flsbuf_fopen_perror_fgets_fclose_fflush_unlink_getpid_sprintf_system_nroff_any_freopen_blklen_calloc_match_amatch_lmatch__ctype__trim_whatisit_wmatch_vfork_execl__exit_wait_mallocudiv_cfree_freecerror_creat_close_open_errno_lseek__doprnt__filbuf__lastbuf_sys_nerr_sys_errlist_write_read_execv_execve_getppid__sobuf__cleanup__sibuf_gtty_stty_ioctl_sbrk_realloc_end_brk_apropos_whatis_isatty_strcmp_manual_strcpy_strcat_strlen_printf_stat_troff__flsbuf_fopen_perror_fgets_fclose_fflush_unlink_getpid_sprintf_system_nroff_any_freopen_blklen_calloc_match_amatch_lmatch__ctype__trim_whatisit_wmatch_vfork_execl__exit_wait_mallocudiv_cfree_freecerror_creat_close_open_errno_lseek__doprnt__filbuf__lastbuf_sys_nerr_sys_errlist_write_read_execv_execve_getppid__sobuf__cleanup__sibuf_gtty_stty_ioctl_sbrk_realloc_enducb/num 755 0 33 24000 2532126033 5341  ^Юn PPՀPpPP PL^Ь[ЬZ%!W!VZ[YK"VL@&WA[1Vψ݊ϙPoz_h g ЧP֧` W~hg ЧP֧ `W ϥXY/WDYf֦V϶ XhXV [1YeЬ[Ь Z+PPPXZkw+ݏݬPYX1YY kalXPPPݬ.PY<)3ݏݬPYXYYݬPYY)Y XPPPݬPYYPjYX kr  ZPݬ \~ݬWЬP PP [=(0(P@X[ݬ] PZZݬRA[0 P[+hpz 2BT`v -<TawError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large\~ݬJ \~ݬݬ5^Ь[A[[ԭ֭ \~ݬ߭^Ь[Ь Zԭԭ1)ЬPРQ֠aP1LYY%1/ԭY* ZZYԭ PYP0PYIZխ20uYlԭ蘋YYhY[ [P[I YYP߭ݬݭݭYݭPխ֭խVխЭPP׼ЬPРQ֠aP ݬPP P P P ݬPYYPPJP P P P%1׼1ݬ%PPYP14ݬPpЭP^ѬcѬs Ѭ[#ݬݬݬ ݬլмPPPԭԭ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&U&k&z&&&Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large^߭PPrЭPЭPP[rЭPЭPPZPYR[rPPPZZݬO!F!8!!  Y1kYK6Z[ݬ[^ЬP[P PX PW PY߭PZPKU6 ZZX W Y ЭP@) Ь[p!ZZ"PZ jkr kaݬ9  +   ZP*PЬRPQbP!\~ݬ  PP Ь[( P Z` ZZ  P ``P c^Ь[ЬZԭլ05Ьj ЪP֪`P ZPYY׭֭ѭ ЭP^Ь[ЬZԭլ.3ЬYj ЪP֪` Z~Y ֭ѭ ЭPЬ[[~ kЫ0   \~ݬJ \~ݬݬ5^Ь[A[[ԭ֭ \~ݬ߭^Ь[Ь Zԭԭ1)ЬPРQ֠aP1LYY%1/ԭY* ZZYԭ PYP0PYI6խ20uYlԭ蘋YYhY[ [P[I YYP߭ݬݭݭYݭPխ֭խVխЭPP׼ЬPРQ֠aP ݬPP P P P ݬPYYPPJP P P P%1׼1ݬ%PPYP14ݬP|ЭP^ѬcѬs Ѭ[#ݬݬݬ ݬլмPPPԭԭԭѬe Ѭf YѬoY ѬxYޭ[ԭԭ׼ЬPРQ֠aP ݬNPZP Z Z Z-.֭Z׼ЬPРQ֠aP ݬPZ׬ 1Z+׬ ׼1ݬ1Za ZfZA1ZF֭YxY xPPPPxZJ0ZZaZf WZ7ZZЭZY 1խ֭Z׼1LЬPРQ֠aPPZ׬ ~J,1^Y1/Z.Ze ZESխNY IխDխ?֭Z׼ЬPРQ֠aP ݬPZZ+1pZ-Z0Z9խέZݬZ Լլ ޭP[PPxPȬPPPZZ&&&&&&&&&&&&&**=P߭мRvPb߭мRpPbмP`мPЭ`^Ь[ЬZԼ[XѬcѬ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:ܒX^Ь[    PPYYX1XX߭~PYj ~P  BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[I1xݏPZZ  YYX ZYYXZYZ~4PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP| [ [[[  Ь[Z = 8[ePZ~YPZ ݫ ԫ kZP{ Ь[ЬZkPkPzQQPP^߭ݬlPPPPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6pЬ[ѬP ѫѫk֫k׫ЫP`P  PЬPЬRRQ{RPRPPPRRP.^~^vpsad~*PYM[Rk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [^PYPƏPxPbPZxPZPPZx~@PZZZPZPxPZPPjjw^k1xYP[PXZQILk=6k[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP}@j~\S^\PЬPЬPЬRRQ{RPPR PRPPЭRBQP PbPbլQP PGSorry usage: msgs [fhlopq] [[-]number] %s/%s/usr/msgsboundsr%d %d /usr/msgsr/usr/msgs%s/%s/usr/msgsw%d %d w%s/%d/usr/msgsw%d %d Message %d: From %s %sSubject: From %s %sSubject: %s SubjNOTICE: Messages should have a Subject field! %s/%sHOME.msgsrcr%d a%d TERMli%s/%d/usr/msgsrThere are new messages. Message %d: From %s %sSubject: %s(%d%slines) more ----- More? [ynq](No more) [q] ?Next message? [yq]--Postponed-- Flushedreplay--%s-- -%d (No more) [q] ?No new messages. /usr/ucb/more -%dw--Killed--Interrupt%dGoto %d%s %s/%d/usr/msgsrMessage %d not found Messages/tmp/msgXXXXXX/usr/ucb/Mail -f %saMessage %d saved in "%s" FromSubj(No Subject) -TERMCAPTERM/etc/termcap/etc/termcapTermcap entry too long Bad termcap entry Infinite tc= loop Termcap entry too long E^^\\::n r t bf M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/etc/passwdrr/Unknown error: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PZ[xYPZPP[xYPZP[PPq @jL~\S^\_1P(CЬPЬPЬRRQ{RPPR PRPPP P %s @(#)printenv.c 4.1 (Berkeley) 10/2/80||tucb/print 755 0 33 14 2532136455 5626 pr $* | lpr /pT,pT5d /,"ucb/prmail 755 0 33 22000 2532136510 6025  ^Юn PPՀPpPP P0^׬ϼPϿլHϺPP%TPP[ϝkݭ Ϸ׬ЬP`^߭ݬPݬTݬ^χRݬPլ ݬWeݬWυ πլ D> PЬ[Zj7݊[ PYYP Ь[ЬZk =ZPk=P Ь[PZѪ[:ZPP Ь[k:[kk[P|z^P`PUݏ#P[['[P[['[xP[[P'[\P[[jP{'y'r'[/P[[c'[P[[T'[ P[[E'k [kk'PЬ[ZYk94 ZPQPQ0QZY[[kPP P P+P-k0YZPZPЬ [ЬY׬&k ЫP֫`P [(PZZZ Z YPЬPQP!Ь[XX"PX 鑫+PPPYkw+ݏݬPZY1ZZkalYPPPݬ+PZ<3ݏݬ}PZYZZݬPZZ)ZYPPPݬPZZ1hZY kr  XP [P@X[ݬIPZZݬd}[P[g@V,4>Xh$:LXjy%;JViError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too largex\~ݬoPPЬ[[ ~kЫ0   Ь[  P ݏ P ի ߘP@B! [ J  P2PPݫ~M PkЫk!k    k1WP֫ Ь[ZZZP ^P+ݬxݏcP[PZ߭PP Pѭ[MZBЭPݬݬݬ;z0l\^BЬ2߭ \~ݬ׭ ЭP֭` ߭rЬP  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQST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rk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ. [D&P YPƏPxPbPZxPZPPZx~@PZZZPZPxPZPPjjD&1xYP[PxZqilk]Vk[P Ь[[ZZZ=jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j@ ~\S^\_% P CЬ PЬPЬRRQ{RPPR PRPPPP(( $   !#%')+-/13579;=?ACEGIKMOQSUWY[]_acegikmoqsuwy{}Cannot open: %s %o < %d > %d %o Initialize Lower rail Upper rail Upper mag Lower mag Lower case Upper case > mode, %d < mode, %d STOP Lead forward, %d Lead backward, %d New page Undefined code Lead %d Size %d, double , single %s Total lead %d @(#)pti.c 4.1 (Berkeley) 10/1/80htnmlizsdbxfjukp-;a_c`e'orv-wq/.g,&y%QTOHNMLRGIPCVEZDBSYFXAWJUK0123456789*-()[]=:+!?'|$u@|"=o_\-></Y|||||||||||x{}'`^#~|*+@"@"\&ucb/reset 755 0 33 12000 2532141226 5662  ^Юn PPՀPpPP  P ^߭/߭ݏt5߭ݏtt%2Pʏ"PP ߭ݏ@߭ݏ߭ϴ߭Ϫ߭Ϡ߭ϖ߭ό߭ς߭x߭n߭d߭Z߭P߭ݏ tv߭ݏtf߭ݏutV ϼ # PP\~ݬx^ZY 5P /ݬgP PЭPP[|ݬ[P[}Ph[Y  PP ||̀xxxxPPQ@A|| ZZZݬ|1 PPPP P 1WY1WЬ[ЬZЬ Y k: k-kѬ Y/jik[[PPЬ[ Zj7݊[ PYYP Ь[ЬZk =ZPk=PЬ[k[PP^ԭլݏPO|PݭݭVխѭ¬ Э!Pݬ+ЬP}V}X}Z}Э`PЬPЬQ}V}X}Z}\Ё^PPݬݬ;Z0Lݬݏ tݬݬݏtݬ6PP^Ь[    PPYYX1XX߭~PYj~P  BЫZ֫ZPѫPѬ ZPPXPZ~)PYZkn 1mЫZ3[l 1xݏ_PZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫ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011111133-->7;9:)2CCxx (*z 3U7k, "E{K"9BKNGLM  -5.>/?@Ey ,~}H1A3CIPR2NQFKOG.QR$#:(;)<*=-.808l24V6j:nXYbcdoqt'+6Dg=.=3=5h7=8=R=====#=(=)=*=_ac&>?t@uA7 %+-/1357Kacegikmosy{%')+-/1579=?CEIMMalformed program statementbeginMalformed declarationMalformed const declarationMalformed type declarationMalformed var declarationrecordMalformed record declarationMalformed record declarationDeleted ';' before keyword elseMalformed statement in casebegincaseMalformed statementMissing/malformed expression@(#)y.tab.c 1.1 (Berkeley) 3/2/81Comment does not terminate - QUIT#include %c%s%c {(*}*) @(#)yycomm.c 1.1 (Berkeley) 3/2/81@(#)yycosts.c 1.1 (Berkeley) 3/2/81T^--- Too many syntax errors - QUITEnd matched %s on line %dInserted keyword end matching %s on line %d@(#)yyerror.c 1.1 (Berkeley) 3/2/81 program x(output); begin end. Input line too long - QUITincludeInclude syntax error - expected ' or " not found - QUITMissing closing %c for include file name - QUITInclude filename must end in .iAbsurdly deep include nesting - QUITr@(#)yyget.c 1.1 (Berkeley) 3/2/814@(#)yyid.c 1.1 (Berkeley) 3/2/81<unyylexOctal constants are non-standardDigits required after decimal pointDigits required in exponentCharacter/string delimiter is 'Unmatched %c for stringNull string not allowedDigits required before decimal point@(#)yylex.c 1.1 (Berkeley) 3/2/81No lines in fileFile not rewritten because of errors rw@(#)yymain.c 1.1 (Berkeley) 3/2/81XIllegal characterDeclaration found when statement expectedExpected keyword begin after declarations, before statementsParsing resumes@(#)yypanic.c 1.1 (Berkeley) 3/2/81Parse stack overflowUnrecoverable syntax error - QUITyyparse@(#)yyparse.c 1.1 (Berkeley) 3/2/81dcase-labelend-of-f((ileillegal charactererroridentifierreal numbernumbercharacterstring'..''x''x'keyword @(#)yyprint.c 1.1 (Berkeley) 3/2/81 %6d %s: @(#)yyput.c 1.1 (Berkeley) 3/2/81dddddddddUndefined identifierImproper %s identifierDeleted %s%sReplaced %s%s with a %s%sInserted %s%sExpected %s%sUndefined %sReplaced %s id with a %s idEnd-of-file expected - QUITUnexpected end-of-file - QUITloccor@(#)yyrecover.c 1.1 (Berkeley) 3/2/81@(#)yyseman.c 1.1 (Berkeley) 3/2/81@(#)yytree.c 1.1 (Berkeley) 3/2/81@@(#)printf.c 1.1 (Berkeley) 3/2/81h@(#)treen.c 1.1 (Berkeley) 3/2/81@(#)yycopy.c 1.1 (Berkeley) 3/2/81Psvz~ #'+/37<ADILORVXZ]^bgjlqvy{@(#)TRdata.c 1.1 (Berkeley) 3/2/81dpdppdppdppdppdppdppdppdppdppdppdppdppdpdppdppnppdpdppppn"ppn"pppppppppddpppppdpdpppnpnpnpnppnppnpnpnpppnpppnppnppnpnpn"pn"pn"pnppnppnppnppnpppnpppn"npppnpdpppn"ppppppppn"ppdppnpppnpppnpsnnnnnnppnppxunary -moddiv/*+-=<><><=>=notandor:=unary +inMay 7, 1979@(#)Version.c 1.1 (Berkeley) 3/2/81M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDecUnknown error: #x x <ucb/rewind 755 0 33 14000 2532141343 6032 ^Юn PPՀPpPP P ^Ѭ ЬPРϲݭ PPݭϠݭϬ \~ݬPP  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0q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1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj~P    BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[|1xݏPZZ  YYX ZYYXZYZ~(PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[ Ь[Z = 8[ePZ~9PZ ݫ ԫ kZP{(P^߭ݬDPPPݬݏ tݬݬݏtݬ6.!!~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZb [!PTYPƏPxP;bPZx(PZPPZx~@PZZZ  PZP x PZPPjj ! 1xYP[P Z  k  k[P Ь[[ZZZq jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP @j~\S^\_yPpCЬ[PЬPЬRRQ{RPPR PRPPPP0Usage: %s file [ file ... ] r.s.so@(#)soelim.c 4.1 (Berkeley) 10/1/80Unknown error: #!ucb/ssp 755 0 33 14000 2532143673 5357  ^Юn PPՀPpPP P$ ^׬լFլ1TϩЬP`zPPЬP`ϒ׬1ЬP`P`-[ (ϤϢPϝ[`1Ϗ[τ1ϻ{yPt ` g \׽ЭPРQ֠aPݭWP[[1[ +p)P$[`m׽ЭPРQ֠aPݭP[[ ە*(&"P ``P  [Bϻϵ[Ϫ׽ЭPРQ֠aPݭϠP[[1լ1eЬ[XXXPX 鑫+PPPYkw+ݏݬPZY1ZZ!kalYPPPݬ/PZ<$3ݏݬ}PZYZZݬPZZ)ZYPPPݬPZZ1hZY kr  XP   [u hP@X[ݬPZZݬ6  % [P[  $.HXpz*<HZiy+:FYError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too largeЬ[  P ݏ]P ի ߘP@ [H  P2PPݫ~PkЫk!k    k1WP֫ Ь[ZZZPL^Ь[    PPYYX1XX߭~PYj~P   BЫZ֫ZPѫPѬ ZPPXPZ~PYZ((kn 1mЫZ3[X1xݏPZZ  YYX ZYYXZYZ~(PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP`[ [[[ Ь[Z = 8[ePZ~9PZ ݫ ԫ kZP{(P^߭ݬDPPPݬݏ tݬݬݏtݬ6.~*PYy[~k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ: [P,YPƏPxPbPZxPZPPZx~@PZZZPZPxPZPPjj1xYP[PZ}uxkibk[P Ь[[ZZZIjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@jd~\S^\_IP@CЬ+PЬPЬRRQ{RPPR PRPPPP r@(#)ssp.c 4.1 (Berkeley) 10/1/80Unknown error: #ucb/strings 755 0 33 22000 2532143715 6237  ^Юn PPՀPpPP P׬լ1ЬP`P`-ЬP`P[Po, [ЬP`PK`ЬP`PK`PPaЬP`PK`P@UρόρЬP`PK`P0P0[ЬP`PK`P@Ϯ[ PЬQaQKaQQPլ9 +ЬP`ϲPЬP`ϛЬP`׬/37 P!+  φݏ*ϻ 2P PϪP~XϷϟ լ1,ϲ$[Y10.P)`P PZZ ZφPլW[& [&P[P,AώYPP~2$ϵ%$[Y[*ZYϡϛ ׬լ1OЬPP !P PPP  P PPPЬ[Ь Z+PPPXZkw+ݏݬgPYX1YY4kalXPPPݬBPY?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQR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ЬPݠJPЬPݠ@Y !Ϫ P!!1!&! ЬPݠσϵϕϭ!ЬPݠ|ϔtϬ!~σo! 2P P^!P]!Ph!Pg!PV!PP~!PЬPݠ64χ! 2P P !P !P!P!P!!X X!XY խ1trkY ϛ ~P ϱЬPݠυ X f d PӏPP ϕ ~ψ c ~Ϥ VV1mW VPPGρ G`1WGs  VPPG` VP VP VP PPWPYY ϢP lWݭ0 ϚݭP  X~ݭ ρݭϽP YqXYf 1V1 =~ϧIϜW WP WPϝϽWWϺ Ь[[5PZZP#92G#ZB#Z;#7#zP)#PP(ϵZ[ ##[Z"Z"[Pݬ \~ݬ ЬP PPЬ [ЬY׬&k ЫP֫`P [PZZZ Z YPЬPЬ[ XXBPX 鑫+PPPYkw+ݏݬPZY1ZZkalYPPPݬPZPѭPP [ P@X[ݬPZZݬL[P[(r  , > P ` l ~   1 E Y j y Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too largeP\~ݬPGPP^Ь[ЬZԭլ05Ьj ЪP֪`P ZoPYY׭֭ѭ ЭP^Ь[ЬZԭլ.3ЬYj ЪP֪` Z~ Y ֭ѭ ЭPЬ[  P ݏ P ի ߘP@# [L6 #B  P2PPݫ~U PkЫk!k    k1WP֫ Ь[ZZZPЬ[ЬZ[XY YY  YXP   !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~ PYj~P   BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[\1xݏPZZ  YYX ZYYXZYZ~8PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PPh[ [[[ Ь[Z = 8[ePZ~9PZ ݫ+ ԫ kZP{8P(P^߭ݬDPPPݬݏ tݬݬݏtݬ6((.//~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZR [/PDYPƏPxP+bPZxPZPPZx~@PZZZPZPxPZPPjj/1xYP[PZkzk[P Ь[[ZZZajPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j\~\S^\_AP8CЬ#PЬPЬRRQ{RPPR PRPPP P Usage: symorder orderlist file rrrsymorder: %s: bad format symorder: %s is stripped symorder: %s is in old format or truncated Short file Read err on 2nd asym write1write2%d symbol(s) not found: %s symorder: ran out of memory (savestr) @(#)symorder.c 4.2 (Berkeley) 10/2/80Unknown error: #++/ucb/ul 755 0 33 26000 2532150300 5156 $^Юn PPՀPpPP# P^׬ϼ# P 7P1Ϭ#61PtmЬP`P ЬP`6eЬPР6׬RЬP`P`-KЬP`PPPTPi׬ݬݬ#1#rլj6V.P1&P1$#P ݬ#0$2߭#2P6#6߭"P5"5߭"P5-"ϪP 5߭"PϷ5϶"Ϯ5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YYP Ь[ЬZk =ZPk=Pݬ \~ݬЬP PPЬ [ЬY׬&k ЫP֫`P [PZZZ Z YPЬPЬ[,XXbPX 鑫+PPPYkw+ݏݬPZY1ZZkalYPPPݬPZ< 23ݏݬ}PZYZZݬPZZ)ZYPPPݬPZZ1hZY kr  XP| d[]1lP1P@X[ݬPZZݬ&0[P[ 4D\f(4FUet&2EError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large\~ݬPPЬ[  P ݏ% P ի ߘP@5 [&B /:  P2PPݫ~] PkЫk!k    k1WP֫ Ь[ZZZPݬݬ;    !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU (( PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~1PYj ~P $$ BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[&1xݏPZZ  YYX ZYYXZYZ~`PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP| [ [[[  Ь[Z = 8[ePZ~YPZ ݫS ԫ kZP{ Ь[ЬZkPkPzQQP@P^߭ݬ\PPPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6).G)G)))))~*PYu)[z)k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ6) [GP()YPƏPxP)bPZx(PZPPZx(~@PZZZ((PZP(x(PZPPjj(G(1xYP[P(Zy(q(t(ke(^(k[P Ь[[ZZZE(jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP'@jH~\S^\_-P$CЬPЬPЬRRQ{RPPR PRPPPP$TERMdumbUsage: ul [ -i ] [ -tTerm ] file... os/bin/catbcucusulsoueulseul/bin/cattrouble reading termcapr%sr %sLine too long @(#)ul.c 4.1 (Berkeley) 10/1/80TERMCAPTERM/etc/termcap/etc/termcapTermcap entry too long Bad termcap entry Infinite tc= loop Termcap entry too long E^^\\::n r t bf 5MS7) Unknown error: #  AAAAAABBBBBB pCpCH'Gucb/trman 755 0 33 145 2532145731 5635 sed -n -f /usr/man/man0/m1.sed $1\ |sed -n -f /usr/man/man0/m2.sed \ |sed -f /usr/man/man0/trref.sed H'G/pT,pT5`d /,"ucb/tset 755 0 33 30000 2552600635 5525 $ ^Юn PPՀPpPP# P ^߭' P$ S߭߭ .ЬP`Ѭ"РP`-ЬPРP E*#*׬1ЬP`[k-1[k1i*1 *1W1PA11'PE)k1&k^[kPP)k)[kPP|)[1k^kj)#k)e)""PkЬPPЬP׬PP[b"P[ V"#[1# )kЬPPЬP׬PP[kP@&["kP@l&[I#!1P<1P=1P>1P@1PB11ЬPPЬP׬PP[1P:1r!PQPPQa!PQkЬPPЬP׬PP[5!P["[ "!1S!P!P P1mkPP14P!1L[kP@3% ke13[ QPkP@ %k.[\'1O'1R'1M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Z~[ #1K "Zj#EPjkZ[kkj| j:jPjj: j|Zj‘j:ZЬ[Ь[k:[kk:[[P"YYPYiPЬP`iߑّi@i#Y Zi0Z[ Z[P0PP[iP@R[P"[[hP[kPЬP`kڕkk:Pk@![[$P[kPЬP`kڑk@k=[ݬ[^Ь[мZozXYPPY&YUY:XYPP\P^;Y4XhIj%0YxYYP0PPY׭ kP@EYYм[Z[PЬ[Z[kP@ ZPQPQ0QZkP@ Zk.'[kP@ kP0PPZ[kP@k*[ĬZ~ kZ7 /2%P2@qYYPPZYZ ~ ZZЬ[ Zj7݊[ PYYP Ь[ЬZk =ZPk=PЬ [ЬY׬&k ЫP֫`P [TPZZZ Z YPЬPЬ[LXXPX 鑫+PPPYkw+ݏݬPZY1ZZkalYPPPݬPZ<3ݏݬ}PZYZZeݬPZZ)Z-YPPPݬlPZZ1hZY kr  XPxЬ[  P ݏP ի ߘP@: [(  P2PPݫ~PkЫk!k    k1WP֫^ԭլݏP|PݭݭVխѭ¬ Э!Pݬ@+ЬP}V}X}Z}Э`PЬPЬQ}V}X}Z}\Ё^PP Ь[ZZZP0^Ь[    PPYYX1XX߭~APYj ~P  BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[)1xݏPZZ  YYX ZYYXZYZ~pPY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP [ [[[  Ь[Z = 8[ePZ~-PZ ݫc ԫ kZP{ Ь[ЬZkPkPzQQP^ݬPP߭ݬPJ]Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space lef((t on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large \~ݬPPЬ[  P ݏ P ի ߘP@" [t   P2PPݫ~9 PkЫk!k    k1W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33 20000 2532150442 6717 1ucb/uucb/uudecode 755 0 33 26000 2532151336 6345 $ ^Юn PPՀPpPP# PΘ^Ѭ2ϻ#ЬPݠPЬPݠς׬q%Ѭ#D ]ݭݏPWPs#[%23l#pPT߭[#t T~1/TPP;#%UPPT#$ϦϧPݠ͘.#͘͘͘T"TϺPPTJݭT&ݭݭCݭݏP-Pϒ"Pφ" $^ݬݏP߭P\"Ϭ P PPPPP"ޭխݭݬݭ  ^P PPPxPPЬQQ QQQxQQQPЬPP PPPxPPЬQQ QQQxQQQPЬPP PPPxPPЬQQ QQQQPPѬ $׼ЬPРQ֠aaP ݬݭѬ $׼ЬPРQ֠aaP ݬݭϪѬ $׼ЬPРQ֠aaP ݬݭπ^ԭ?׼ЬPРQ֠aPݬϓPPЭPЬPЭQA`֭ѭ Ь PЬ[k[PPPݬ \~ݬЬP PP'P[kݬP8[P| x ^ P`  X H @ 3 Ь[k:[kk[P  PPݏU*P[[F.[P[[7.[xP[[P.[\P[[jP..k-[/P[[-[P[[-[ P[[-k [kk-PЬ[ZYk94 ZPQPQ0QZY[[kPP P P+P-k0YZPZPЬ [ЬY׬&k ЫP֫`P [ PZZZ Z YPЬPЬ[XX PX 鑫+PPPYkw+ݏݬPZY1ZZqkalYPPPݬPZ<\ 3ݏݬ}PZYZZݬAPZZ)ZM YPPPݬPZZ1hZY kr  XPP H[PP@X[ݬ PZZݬ[T P[ 0 < N ^ p |   ) : I X p } Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argument((File table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large$\~ݬ PPЬ[[~V kЫ0   \~ݬJ \~ݬݬ5^Ь[A[[ԭ֭ \~ݬ߭^Ь[Ь Zԭԭ1)ЬPРQ֠aP1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PЬPݠϧ|׬ѬρW߭ЭP~c ЬPݠݭuϩݭmϔ^-߭ݬϛP׼P PЬQСR֡PbݬP P~ԭݬޭPP~7ѭ׼ЬPРQ֠ aaP ݬ ~խ1t^PxPPPxPPʏPЬQQQPЬPPxPPʏPЬQQQPЬP׼P PЬQСR֡PbݬP P~׼P PЬQСR֡PbݬP P~ϻ׼P PЬQСR֡PbݬP P~ϋ׼P PЬQСR֡PbݬP P~[^ԭ?׼ЬPРQ֠aPݬPPЭPЬPЭQA`֭ѭ Ь PЬ[XXPX 鑫+PPPYkw+ݏݬPZY1ZZkalYPPPݬPZ<\3ݏݬ}PZYZZaݬPZZ)ZYPPPݬhPZZ1hZY kr  XP((0 T[\P@X[ݬPZZݬ [P[ *DTlv&8DVeu'6BUError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large$\~ݬPPЬ[  P ݏ P ի ߘP@ [   P2PPݫ~) PkЫk!k    k1WP֫ Ь[ZZZP   !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ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P2@kZ2Yլ P2@kY2kP2@kXYZZYJIJZXZYZZP2@kPYPZQPAkZZP2kQPQk2kPP@k!8 Ь[2Zk2kP2@kZ¬ Z2kPPPPYZYP2kPPZ@kY IJZYY k2kPPЬ[2ZYYP2@kPPZ#YP2@kZYYP2kQPQ2kPPPPZP!ݏݬmPЬ[Ь Z+PPPXZkw+ݏݬPYX1YYkalXPPPݬPY<63ݏݬxPYXYYpݬPYY)YXPPPݬwPYYPjYX kr  ZPP[P(PZ[~Zd>ZPZ >>Y y~>Pݬ \~ݬ ЬP PP Ь[PZѪ[:ZP,(P Ь[k:[kk[PPPݏ=P[[~A[P[[oA[xP[[PWA[\P[[jP?A=A6A[/P[['A[P[[A[ P[[ Ak [kk@PЬ[ZYk94 ZPQPQ0QZY[[kPP P P+P-k0YZPZPЬ [ЬY׬&k ЫP֫`P [PZZZ Z YPЬPQPЬ[XXPX 鑫+PPPYkw+ݏݬPZY1ZZkalYPPPݬPZ<23ݏݬ}PZYZZuݬPZZ)ZYPPPݬ|PZZ1hZY kr  XP [11P@X[ݬIPZZݬ2![P[  $.HZl|-<Mau Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large<\~ݬ3PPЬ[[ ~kЫ0   Ь[  P ݏ P ի ߘP@; [T7   P2PPݫ~ PkЫk!k    k1WP֫ Ь[ZZZP  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~-PYjX~P $$ BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[d71xݏPZZ  YYX ZYYXZYZ~\PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP [ [[[ Ь[Z = 8[ePZ~PZ ݫO ԫ kZP{P[P[P[P/[PZ[ZZfPXYX/P[Y[ZuPX\YPXOp/[[ݬP1yk  kN/P[Z[ Ь[Zk[ZZP Ь[ЬZkPkPzQQP^ݬPP߭ݬP'()<>@!.,;:\" ()<>@!.,;:\" Address too longUnbalanced '('Unbalanced '"'((Unbalanced '<'@(#)conf.c 2.7 4/1/8133333bC34 4 4E4"4&4)4QEhUC4P4S4V4Y4\4_4b4@x44444BC42444^4!4[unknown]amnesiavaxamnesiavaxMAILER-DAEMON/bin/mail...local%mail-d$u/bin/csh...prog%mail-fc$u/usr/net/bin/sendberkmail...berk%mail-m$h-t$u-h$c/usr/lib/mailers/arpa...arpa%mail$f$h$u/bin/mail...uucp%mail-d$h!$u!@(#)util.c 2.1 11/5/80Out of memory!!=951-)%! 11r4G(f3YC!d&Yo;VVu7{ʉ0- T;/> [2/a1<=`fvK_zlG6$C w$M670)Yn!N6V1p&83)]H+ܝ<5;71g$+#) n0%a3 $ 2nV01}D9R7N:#68W)9:{2}x|~L'\/qö.pag.dircann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WP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX((,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj ~P  BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[d'1xݏPZZ  YYX ZYYXZYZ~@PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP8 [ [[[b  Ь[Z = 8[ePZ~9PZ ݫ3 ԫ kZP{@P^߭ݬ\PPPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6.$5 5~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZZ [ 5PLYPƏPxP3bPZx PZPPZx~@PZZZPZPxPZPPjj 51xYP[PZkk[P Ь[[ZZZijPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j$ ~\S^\_ P CЬPЬPЬRRQ{RPPR PRPPPP&&&&&&&& '''$'-'6'?'I'@pC B@C/vmunixno /vmunix namelist /dev/kmemcannot open /dev/kmem /dev/kmemusage: vmstat [ -fs ] [ interval ] [ count] xxTime makes no sense... namelist must be wrong. procs memory page disk faults cpu r b w avm fre re at pi po fr de sr %c%d %c%d %c%d %c%d in sy cs us sy id %2d%2d%2d%6d%5d%4d%3d%4d%4d%4d%4d%4d%4d%4d%4d%3.0f %d reclaims, %d total time (usec) average: %d usec / reclaim %d page ins, %d total time (msec) average: %8.1f msec / page in %9d swap ins %9d swap outs %9d pages swapped in %9d pages swapped out %9d total address trans. faults taken %9d page ins %9d page outs %9d pages paged in %9d pages paged out %9d sequential process pages freed %9d total reclaims %9d reclaims from free list %9d intransit blocking page faults %9d zero fill pages created %9d zero fill page faults %9d executable fill pages created %9d executable fill page faults %9d swap text pages found in free list %9d inode text pages found in free list %9d file fill pages created %9d file fill page faults %9d pages examined by the clock daemon %9d revolutions of the clock hand %9d pages freed by the clock daemon %9d cpu context switches %9d device interrupts %9d pseduo-dma dz interrupts %9d traps %9d system calls %d forks, %d pages, average=%.2f %d vforks, %d pages, average=%.2f 0%3.0fiostat: Disk init info not in namelist %c%c%c%c@(#)vmstat.c 4.7 (Berkeley) 4/28/81_cp_time_rate_total_deficit_forkstat_sum_firstfree_maxfree_bootime_dk_xfer_mbdinit_ubdinit_rectime_pgintime_hzr00(85ucb/w 755 0 33 34000 2552600637 7100 1ucb/uptimeucb/what 755 0 33 20000 2532151713 5504  ^Юn PPՀPpPP P׬լFϺЬP`OPЬP`ϤyЬP`όψϊ׬+լ1Z@XX-ϣϡPϜ`P Ϗ϶PZhQPQ1Xhς πP{ ``J^PY`PE\ Z;Z"6Z>1Z ,<:P5Z`(Z7PZPP  `  eP`P PZP1Ь[Ь Z+PPPXZkw+ݏݬPYX1YYkalXPPPݬ PY<3ݏݬ|PYXYYݬPYY)YXPPPݬPYYPjYX kr  ZPh ^ЬP ЬP 1Ѭ sՠn iмZЬլ ~[PPZPPZЬP )Z%ѭZPQáPѭPQP­P[[ЬP PQРЬP ݬ [~ЬP~PԼ[h׼ ЬP֠ZݬNЬP BPQЬP ԼЬP ЬPPQРݬ ݬЬP~nPѭPP 4[<P@X[ݬPZZݬ[P[ *DTlv&8DVeu'6BUError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open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Q{RPPR PRPPPyP;r%s (#)@(#)what.c 4.1 (Berkeley) 10/15/80Standard inputUnknown error: #%ucb/whatis 755 0 33 20000 2532151740 6040 ^Юn PPՀPpPP PP׬լϺ*ϾϯϱPϴ0ЬP@Ь[ kϨPk[kݬ ^ݬkPP[OݏpPЬZhЬZjj[P12ìZPP@kZjj,PZìZPP@k jϵZj Ь[ЬZjj~k~WP[Zkjk(k, k k PkP@ kP@[k,P[kP@PP@ϼ P@ϰPP@ϡ PP PPP@ό PP PPPP Ь[ZZՋZP Ь[[Z j/Z[Zjk.R[PPZ.~;P[PPZ&. ~PP@[P Ь[ЬZj[PQPQPPĬݬ7P[P[Z~PYԊY[PݬpЬ[Ь Z+PPPXZkw+ݏݬCPYX1YY$kalXPPPݬ2PY<3ݏݬPYXYYݬPYY)Y XPPPݬPYYPjYX kr  ZPݬ \~ݬ[ЬP PPЬ [ЬY׬&k ЫP֫`P [PZZZ Z YPЬP  [P@X[ݬPZZݬ[P[x,>P`l~ 1EYjyError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large$\~ݬPPЬ[  P ݏ P ի ߘP@ [    P2PPݫ~ PkЫk!k    k1WP֫ Ь[ZZZP   !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXX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_PCЬPЬPЬRRQ{RPPR PRPPPuP(( )4=FTbp~ $3whereis [ -sbmu ] [ -SBM dir ... -f ] name... %s: r %s/%.14s@(#)whereis.c 4.4 (Berkeley) 7/3/81/etc/bin/usr/bin/usr/games/lib/usr/ucb/usr/lib/usr/local/usr/new/usr/old/usr/man/man1/usr/man/man2/usr/man/man3/usr/man/man4/usr/man/man5/usr/man/man6/usr/man/man7/usr/man/man8/usr/src/cmd/usr/src/games/usr/src/libc/gen/usr/src/libc/stdio/usr/src/libc/sys/usr/src/new/usr/src/old/usr/src/local/usr/src/undoc  AAAAAABBBBBB 8 8 d$ucb/whoami 755 0 33 16000 2532152047 6033  ^Юn PPՀPpPP PXiP*P[ϵϔ1kϴς Ь[PZѪ[:ZPP AxpKcЬ[k:[kk[P<:P PݏaP[[R [P[[C [xP[[P+ [\P[[jP   [/P[[[P[[[ P[[k [kkPЬ[ZYk94 ZPQPQ0QZY[[kPP P P+P-k0YZPZPЬ [ЬY׬&k ЫP֫`P [PZZZ Z YPЬPQPЬ[XXPX 鑫+PPPYkw+ݏݬPZY1ZZ} kalYPPPݬ PZ?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BC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 Э!Pݬ@5+ЬP}V}X}Z}Э`PЬPЬQ}V}X}Z}\Ё^PP Ь[ZZZPݬݬ;R0D4QP  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~ePYj~P OG BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[U1xݏ3PZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~(PY PPP[ [[[z Ь[Z = 8[ePZ~PZ ݫ ԫ kZP{P[P[P[P/[PZ[ZZPXYX/P[Y[ZuPX\YPXO)[[ݬP1yk  kj)P[(l[ Ь[Zk[ZZP Ь[ЬZkPkPzQQP^ݬPP߭ݬP>Uninserted error messages for file "%s" follow. +/###/You touched file(s): %s"%s", You didn't touch any files. r%s: Can't open file "%s" to touch (read). w%s: Can't open file "%s" to touch (wr((ite). %d [%s] Interrupt: Do you want to continue?[%s] Yes or No only! @(#)errortouch.c 1.2 (Berkeley) 10/16/80Unknownignoresynchronizationdiscardednon specificspecific to this filenulledtrueduplicatedErrorXXXXXX/bin/shPATH:/bin:/usr/binsh/etc/utmp/etc/passwdrr/  AAAAAABBBBBB |_|_V/etc/ttys/dev/`lucb/lisp 1755 0 33 1672273 2574150561 5631 4&$nil(eof(8HXhx  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~((      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~^Юn PPՀPpPPeP  (HLPX`h''''(( ($(((,(0(4(8((++++++++x+, ,,, , 0(0^Ь j_$WЬЬl#1Pv`PPPWVVWQHB@4.@2lvPfVfV l0 lvP6аP`EkVWÏPP@fVfVCknE09PwP uc]2P4r kdݬ5c^Ь[ԭ  %1j4b[0PР :P[fVVWQfV[fVP:2qj ^2BJP6/#NA閭PZPP1խPР [Pc][YSQP`ЭЭPѠ[7ѭw'PРЭPѠ[нZѭkZZ[vi;PZխPР ZPx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VЭPtPPΚPPЬPPЬ kݭWݬ ݬݬP1wЬPP P#P7Qݬ:›!:者ݬ:: ^ԭЙ_PbPLѬFѭ!,ЭPРPPѬѬ%ѭЭPЬ,MЬpݭ\ЭPР խPѭЭPѠ P1pѬЭPݠݬ+PѭЬ LЬ[ݫ^ԭԭЬЬxP@HЬ ЬPРxP@H=ЬPР3н:ЬЭPРн(ЭPРխЬѭPխխP^e9Hխ1 ݭQ9ЭPРPP6EЭPݠ_9ﮒ9&ЭPР  9c9TzЭPݠ~fbP[ `L $88&ЭPݠ*8ЭPݠ1~8Pݬݬ ^Z\lѬ PPPjY=aYݬݭݬݬݭݭLPYլxYP@FЩPмY2YݬݭݬݬݭݭPYլxYP@JFѫ [ZE[1ѫ1ѭѫﺗYYݬݭݬݬݭݭZ15PPfVЭPPPYԩ PiiYЬPiiYݬ7PPiiYЬ PiiYݬЎUPPiiYݬЎUPPiiYнЭP׭PЭHZ իgѬ]ݬ6 $﬏ЭP` #ЭP׭P} n"Ь SH[Ы [[1S9ݬݭݬݬݭݭPYլxYP@>D1ݬ5 $ЭP`Ԏ_"ЭP׭P:ĕPРYVWPfVfVЎU|P/PxP@C P`煉PݭЎUP`rF>PPP1P1VWÏPP@fVfVݭ4ﶍS祉wIPP ֒﫾P|լD4PݠZPР #FP-4N13ЬZЬ[ЬYVWЬPXXЬ |PhhXݬЎUP`PhhXЬOPhhXY3P4PhhXЋZPZPhPXWVXPБݬ3޾ѾWdVPPǓ0pQPQSP3p.EÏdVVWL3 3PfV63P+333ݬ2P$3*^ﱽ諾АɐʐÐy0rﵐkd]̐VŐOΐHǐA̐:ŐԭxPPxPP8(PЭQPAxPPxPP8(PЭQPA֭ѭ<ԏ&2@Խݏ 9zPVV,VWݏ XP%PPﮫ10P^10PF10P.10P*10Py10Pnl1m0PN^1Y0PRP1E0PRC110P41߭ԭ߭ 0ЭQPAﭐ-90/PEЭQPСَӎPVIQP P2 -漏QPP0s/P$xQPP_Cg01/PЭQPСP%r((QP P2 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ЭP~P tѭ܏tѭ܏ 2P PPPPPPP͘PЭP~6͔ЭP~P/u͔~P͔͜~͜ЭP~͔QPQ"0ѭ܏ 2P PPPPP~ݭ' ݭDPlP~)ԭ1ݭ )PڡP͜P͌yԭѭN P^͌ P@PD PЭlݭ͌(ѭ1͌(1֭͌P`ccs1cLc.`FP@1 7͌@P ~ ͌?P ^͌?P ͼ>͌?P ͸۠͌?P iʹ֭ѭ1Uͼg蘒アxʹPP P͐ ЭP~4͐~`%PͰPЭP~7PUl*ͰN"'͐͐Z 'ͰͬxʹPͬPPͨlͨͬE&ͬEͬѭͨ~\ݬͬq\ͼ~P͠ͼ~͠ЭP~V͠PPͤ͸͸kPPﲜ PP~ݭP$ݭxAPѭ1ݭ߭Y&P}I1ԭѭy PQQ1l P,oͰwPͰQPaj.^ z 4r%D$z6ѭl~1?%֭1 PͰPͰQPa֭1;662P+ ` s: ;ѭԏЭP ٙA ЭPͤЭQРͼPPlЭPݠg$}hxoAd ЎU\P,YpﵬPέƭ館ﴮ]ͬt1ЭVÏPP@=fVkYbPPpNY׽ ЭP֠ ݭ~,խ\ЭP֭Pﵝo#ݭ Pz `k 8\9Эtttͨ12͸bЭVÏPP@gfVXaPpX׽ ЭP֠ ݭ+ЭPЭĠЭP׭P̈́͠1ЭVÏPP@fVXoaPxխ<樂P"vx} ݄."T8pW׽ ЭP֠ ݭ*xfV݄1Pխ(xPՠx )!xPЭĠPͰ@݄ 1P݄ %P飯PЭQPխ1ݽxPݠʛݭ1hXd'խ8率!!GxN !)7xOVp̪d ЎUPݪԪ݄̈́1ЭP ЭQ3 ЭPԠЭQРPh}hExhP@XhPxP@X hhPРeXdݭ87խ ݭ)7P ^ѬW$ѬUUݏSPЭAUЭ7U2)U¬!UxPPЭPT[G[Z:լ&ЪPРYxYP@WxP@oW 9jijZjk[[PYYfVT[-[Z ЪPՠ{PXЪihXiZjk[[iP@(#)vsyscall.s 35.1 5/6/81ЬPЀQ RB`R ^\Q+:@(#)qfuncl.s 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(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8n((eVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~﹦PYjdm~P nwn BЫZ֫ZPѫPѬ ZPPXPZ~QPYZkn 1mЫZ3[1xݏPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~|PY PPk[ [[[&m Ь[Z = 8[ePZ~YPZ ݫ ԫ kZP{ Ь[ЬZkPkPzQQPP^߭ݬxPPPPЬ[ЬZ[Y[YPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6LЬ[ѬP ѫѫk֫k׫ЫP`P PHP$.d$`$$$$$~*PY$[$k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZj$ [`P\$YPƏPxPC$bPZx0$PZPPZx $~@PZZZ##PZP#x#PZPPjj#`#1xYP[P#Z###k##k[P Ь[[ZZZy#jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP"@jHi~\S^\-iP$iЬiPЬPЬRRQ{RPPR PRPPЭRBQPPbPb լQPP@(#)Orderit.s 35.1 5/6/81x@top-levelversion -> @(#)lisp.c 35.5 7/1/81Unbound Variable:Too few actual parametersToo many actual parameterseval: Undefined function Apply: Wrong number of args.Apply: non-list of argsapply: Undefined Function Too few actual parametersToo many actual parametersBad funcall arg(s) to fexpr.Bad funcall arg(s) to fexpr.funcall: Bad functionBYTE INTERPRETER CALLED ERRONEOUSLYUndefined function called from compiled code @(#)eval.c 35.3 7/9/81 foreign call: illegal argument @(#)eval2.c 35.2 5/18/81ȗ(0(0 @g`ب(Pxȩ@h`ب(Pxȩ@hBAD PAGE LIMIT all space exausted, goodbye PAGE LIMIT EXCEEDED--EMERGENCY PAGES ALLOCATEDSORRY, ABSOLUTE PAGE LIMIT HAS BEEN REACHEDPAGE LIMIT EXCEEDED--EMERGENCY PAGES ALLOCATEDSORRY, ABSOLUTE PAGE LIMIT HAS BEEN REACHEDYOU HAVE RUN OUT OF SPACEvalue to pruneb not a sdotvalue to pruneb not a listBAD FUNCTION DESCRIPTOR USED IN CALLBAD CALL TO GCNEED PORT FOR GCBegin gc name stack compiler stuff signif stuff time to sweep up Space request would exceed maximum memory allocationNOT ENOUGH SPACE FOR ARRAYThere isn't room enough to continue, goodbye all space exausted, goodbye BAD TYPE NAME[fasl hole filled up] For sbrk from lisp: no space... Goodbye!OUT OF SPACE FOR ARRAY REQUEST all space exausted, goodbye @(#)Talloc.c 35.5 6/28/81HdumpcoredumpcoreenvironmentInternal bad memory reference, you are advised to (reset).@(#)inits.c 35.1 5/6/81Ə"\|Bad reader construction: (. ) Should be (nil . ) Bad reader construction: ( .) Should be ( . ), assumed to be ()Bad reader construction: ( . not followed by )Number exceeds parse bufferNon-list returned from splicing macroPremature end of file after Improper value returned from splicing macro at top-levelReadlist error, code ATOM TOO LONGEOF encountered while reading atom[read: null read and ignored] %c (%o): ILLEGAL CHARACTER IN ATOM%FATOM TOO LONG(ptr to)%d%$unopenedport%%%s%{ ... }array[]#%X-& .... @(#)io.c 35.2 5/22/81|No prog to go to with this tag No prog to return fromNo catch for this tag Internal Inonlocalgoto errorFrame dump at %x is prog catching reset eval: funcall: unknown: %d End of stack @(#)frame.c 1.1 7/1/81%s %s Can't continue from this errorCan't 'go' through an error break %d:>%s Unrecoverable Namestack Overflow, (reset) is forced resetNAMESTACK OVERFLOWBindstack overflow.Illegal read table.Attempt to allocate beyond static structures.incorrect number of args to@(#)error.c 35.4 7/1/81nilsymbolstringfixnumlistflonumbignumarrayvaluebinaryporthunk0namestackunmarked_arraybindstacktlambdanlambdamacroibase*rsetsubroutinepiportpoporterrport$stdin$stdout$stderrreadtableptport^w$ldprintprinlevelprinlengthfloat-format%.16GError-Depth.()[]'!eofcarcdrperdlparrparlbktrbktnoptopcommentreadcommentslast lexpr bindinglexpreval1 binding pointerevalhookfuncallhookevalframesyspagelimitevalasinacosatancossinsqrtexploglshbignum-leftshiftsticky-bignum-leftshiftfrexprotrandomatomapplyfuncallreturnconssconsbignum-to-listcadrcaarcddrcaddrcdddrcadddrcddddrcaddddrnthelemeqequalzqualnumberpdtprbcdpportparraypvaluepget_pnameptrarrayrefmarraygetlengthputlengthgetaccessputaccessgetdeltaputdeltagetauxputauxgetdataputdatamfunctiongetentrygetdiscputdiscsegmentrplacarplacdsetreplaceinfileoutfileterprprintclosepatompntlenreadratomreadcimplodemaknamconcatuconcatputpropmonitorgetgetdputdprogquotefunctiongo*catcherrsetstatussstatuserr*throwresetbreakexitdefnullframedumpandorsetqcondlistloadnwritnprocessallocatesizeofodumplispdumplisptop-levelstartupmapcarmaplistmapcanmapconassqmapcmapflatcalphalesspdrainkillcopyopvalnconssysremobsplicingnotplusaddtimesdifferencequotient+-*/modminusabsvaladd1sub1greaterplesspany-zeropzeropminusponepsumproductdoprogvprognprog2oblistbaktracetyityipeektyosetsyntaxmakereadtablezaplineaexplodeaexplodecaexplodenhashtabstatargvargsetargshowstackfreturn*rseteval1evalframeevalhookfuncallhookresetiochdirasciibooletypefixfloatfactcpy1DivideEmuldivreadlistplistsetplisteval-whensyscallinternptimeforkwaitexecegensymrempropbcdadsymbolpstringprematomprnamegetenvI-throw-errmakunboundhaiparthaulongsignalfaslcfaslgetaddressremoveaddressboundpfakeodmaknum*modfseekfileopenpv%cprintfcopyint*purcopypurep*makhunkhunkpcxrrplacx*rplacxhunksizeprobefsubstringsubstringnodformatER%errER%tplER%allER%miscER%brkER%undefER%unwind-protecterrsetfeaturesfeaturefeaturefranzfeatureunixfeaturestringfeaturevaxfeatureucbvaxnofeaturesyntaxuctolcdumpcoredumpcorechainatomdumpmodeappendmapdebuggingevalhookevalhookbcdtracectimelocaltimeisattyignoreeofversionFranz Lisp, Opus 36automatic-resettranslinktranslinkundeffuncgcgcaftergcportgccheckgcdisablegcloadloadingnoautotraceARRAYBINARYINTERPRETEDMACROPROTECTEDBADPTRARGSTEMPTY??@(#)sysat.c 35.7 7/9/81 PxCD-||$xtp@@x @@P @@  @@ @ h l pt x@| ((@(#)data.c 35.5 7/1/81evalxcarBad arg to carxcdrFell of the end of a bignumBad arg to cdrc{ad}+rFell of the end of a bignumBad arg to cdrBad arg to carnthelemFirst arg to nthelem must be a fixnumsconsFirst arg to scons must be an int.Currently you may only link sdots to sdots.Bignum-to-lispNon bignum argument to Bignum-to-listconsrplac[ad]Attempt to rplac[ad] nil.Rplacca of a bignum will only replace INTSBad arg to rplaeqnullinfileinfile: file name must be atom or stringrUnable to open file for reading.woutfileIllegal file open mode.aPlease supply atom or string name for port.Unable to open file for writing.terprclosenwritnnwritnnumberpatomtypedtprbcdpportparrayphunkpsetIMPROPER USE OF SETequalequalequalprintpatom%d%gNon atom or number to pntlen @(#)lam1.c 35.3 7/8/81,flatsize: second arg not integerflatsizeread or ratom or readcloadFILENAME MUST BE ATOMIC/usr/lib/lisp/.lrrrrCan't open file: concat: string buffer overflow%d%fNon atom or number to concatputpropputprop: bad disembodied property listputprop: Bad first argument: getget: bad disembodied property listgetdgetd: Only symbols have function definitionsputdonly symbols have function definitionsbad list argument to mapbad type returned from funcall inside mapInappropriate list argument to mapc@(#)lam2.c 35.3 7/8/81@@alphalesspalphalessp: non symbol or string argalphalessp: non symbol or string argnconszeropLdiffnon-numeric argumentmodnon-numeric argumentnon-numeric argumentnon-numeric argumentminusnon-numeric argumentminusp: Non-(int,real,bignum) arg: absvalForms in evaluation: Backtrace: -- non symbol in hasht[%d] = %x: setsyntaxneither fixnum, atom or string as char to setsyntaxOnly 1 char atoms to setsyntax@(#)lam3.c 35.4 7/8/81Non-number to addInternal error in add Non-number to minusInternal error in differenceNon-number to addInternal error in timesInternal quotient error #1: Internal quotient error #2: Internal quotient error #3: Internal quotient error #4: Non-number to quotient Internal quotient error #5: @(#)lam4.c 35.2 7/8/81@O^m|expldxCan't explode without string delimiter%dEXPLODE ARG MUST BE STRING, SYMBOL, FIXNUM, OR FLONUMchdirchdir - non symbol or string argargument not an integerargument is out of ascii rangeBoole demands at least 3 argsFactorial of Non-fixnum. If you want meto calculate fact of > 2^30 We will be here till doomsday!.fixinnaproriate arg to fix.frexpfloatBad argument to floatDivideFirst arg to divide neither a bignum nor int.@(#)lam5.c 35.5 7/8/81Too many open files to do readlistreadlistNon atom or int to readlistgetenvargument to getenv must be atomboundpargument to boundp must be symbolplistOnly Atoms and disembodied property lists allowed for plistsetplistsetplist: First argument must be an symbolsetplist: Second argument must be a listsignalFirst arg to signal must be an intSecond arg to signal must be an atomassqArg: not in context of Lexpr.Out of bounds: arg to "Arg"setargArg: not in context of Lexpr.setarg: first argument not integersetarg: index out of rangecall to errSecond arg to err must be niltyityipeektyoTyo demands number for 1st argmakereadtable: wrong number of argsmakereadtable: arg must be atomBad arg to cpy1copyint* : non integer arg@(#)lam6.c 35.3 7/8/81forkwaitpipefdopenexeceexece: non atom function nameexece: non list arglistexece: non atom argument seenexece: Bad enviroment listgensym%c%05drempropremprop: Illegal first argument :remprop: Bad property listbcdadONLY ATOMS HAVE FUNCTION BINDINGSstringpsymbolprematomprname%d%f"%s"prname does not support this typeimplodemaknam/impode argument exceeds bufferimplode/maknam: Illegal type for this arg:internnon atom to intern @(#)lam7.c 35.4 7/8/81ABMath functionsNon fixnum or flonum to math functionarctanNon fixnum or flonum arg to atan2Non fixnum or flonum to atan2random: non fixnum arg:makunbound%%machine-polyev:non-real argDecompose-floatDecompose-float: Non-real argumentfseekfseek: First argument must be a port.fseek: Second argument must be an integer.fseek: Third argument must be an integer.fseek: Illegal parameters.I-throw-errMakehunk*makhunk: Illegal hunk size*makhunk: First arg must be an fixnumcxrcxr: First arg must be a fixnumcxr: Second arg must be a hunkcxr: Arg outside of hunk rangecxr: Arg outside of hunk rangerplacxrplacx: First arg must be a fixnumrplacx: Second arg must be a hunkrplacx: Arg outside hunk rangerplacx: Arg outside hunk range*rplacx*rplacx: First arg must be a fixnum*rplacx: Second arg must be a ((hunk*rplacx: Arg outside hunk rangehunksizehunksize: First argument must me a hunkfileopenfileopen:args must be atoms or stringsfileopen:args must be atoms or stringsModes are only r, w, a.fileopen:args must be atoms or stringsUnable to open file.fileopen:args must be atoms or strings*mod*mod: Arguments must be fixnumslshNon ints to lshrotNon ints to rotgetaddress: arguments must come in triples Incorrect entry specification for bindingBad associated atom name for bindinggetaddress: Incorrect discipline specification Getaddress: Bad fileUndefined symbol: %s cprintfcprintf: first arg not string or symbolcprintf: Illegal second argumentprobefprobef: not symbol or string arg substringsubstring: not symbol or string arg substring: non integer index substring: not integer length substringnsubstringn: non symbol or string arg substringn: non integer index substringn: not integer length purcopypurcopy: can't purcopy array structures bad type to purcopy purep@(#)lam8.c 35.7 7/8/81Halloc2nd argument to allocate must be an integersizeofsegmentLENGTH ARG TO SEGMENT MUST BE INTEGERLENGTH ARG TO SEGMENT MUST BE POSITIVEforgetremob: non-atom argumentgetlengthARG TO GETLENGTH MUST BE AN ARRAYputlengthARG TO PUTLENGTH MUST BE AN ARRAYARRAY LENGTH MUST BE AN INTEGERARRAY LENGTH MUST BE POSITIVEgetdeltaARG TO GETDELTA MUST BE AN ARRAYputdeltaARG TO PUTDELTA MUST BE AN ARRAYARRAY LENGTH MUST BE AN INTEGERArray delta must be positivegetauxArg to getaux must be an arrayputaux1st Arg to putaux must be arraygetdataArg to getdata must be an arrayputdata1st Arg to putaux must be arraygetaccessARG TO GETACCESS MUST BE AN ARRAYputaccessARG TO PUTACCESS MUST BE ARRAYmarraygetentryARG TO GETENTRY MUST BE FUNCTIONgetlangARG TO GETLANG MUST BE FUNCTION DESCRIPTORputlangFIRST ARG TO PUTLANG MUST BE FUNCTION DESCRIPTORgetparamsARG TO GETPARAMS MUST BE A FUNCTION DESCRIPTORputparams1st ARG TO PUTPARAMS MUST BE FUNCTION DESCRIPTORgetdiscARGUMENT OF GETDISC MUST BE FUNCTIONputdiscARGUMENT OF PUTDISC MUST BE FUNCTIONgetlocARGUMENT TO GETLOC MUST BE FUNCTIONputlocFIRST ARGUMENT TO PUTLOC MUST BE FUNCTIONmfunctionreplaceREPLACE ARGS MUST BE SAME TYPEReplace: cannot handle the type of this argvaluepod2nd ARG TO OD MUST BE INTEGERfakeARG TO FAKE MUST BE INTEGERmaknumpnameARG TO PNAME MUST BE AN ATOMarrayrefFIRST ARG TO ARRAYREF MUST BE ARRAYSECOND ARG TO ARRAYREF MUST BE INTEGERNEGATIVE ARRAY OFFSETARRAY OFFSET TOO LARGEptrlctracesimpldLCODE WAS TOO LONGbad call to opvalfirst arg to opval must be an atom@(#)lamr.c 35.2 7/8/81,Profiling not enabled@(#)lamnop.c 35.1 5/6/81progIllegal local variable list in prog Illegal form in prog body throwgoIllegal tag to go toBreaking:Warning: defining function with nonlist of argsodd number of args to setqAttempt to set nilCAN ONLY SETQ ATOMS OR VALUEScshcsh-cshsh-c@(#)fex1.c 35.2 7/1/81More than 15 do varsdo variable must be a symbol @(#)fex2.c 35.3 7/1/81<savedlispDumplisp failedDumplisp failedCould not seek to stabUnexpected end of symsFailure to write dumplisp stabsavedlispDumplisp failedDumplisp failedCould not seek to stabUnexpected end of symsFailure to write dumplisp stab Could not seek to string table Error in string table read @(#)fex3.c 35.1 5/6/81syscallsyscall: bad first argument syscall: arg not symbol, string or fixnumstatus: bad arg liststatus: Second arg not allowed.featuresstatus: need second argstatus: need second argstatus: second arg must be atomstatus: only one character atom allowedsstatus: Bad argssstatus: cannot set this statusfeaturesfeaturessstatus: bad dump mode:on@(#)fex4.c 35.2 5/22/81$BAD CALL TO OPVALFIRST ARG TO OPVAL MUST BE AN ATOMBAD ARG LIST FOR OPVAL@(#)fexr.c 35.1 5/6/81@(#)fpipe.c 35.1 5/6/81@(#)subbig.c 35.1 5/6/81%d%d%09d@(#)pbignum.c 35.1 5/6/81Haulong: bad argumentHaipart: bad first argumentHaipart: 2nd arg not intInternal error in haipart #1Bignum-shift: 2nd arg not intBignum-shift: bad bignum argumentsticky-bignum-leftshiftbignum-leftshift%lx@(#)divbig.c 35.3 5/29/81XcfaslIncorrect .o file specificationIncorrect entry specification for cfaslIncorrect discipline specification for cfaslBad associated atom name for faslBad loader flags/usr/lib/lisp/nld -N -x -A %s -T %x %s -e %s -o %s %s -lcLd returns error status Couldn't open temporary file: %s PATH:/usr/ucb:/bin:/usr/binCould not find which file is being executed./tmp/Li%d.%d/tmp/Li%d.%dIncorrect entry specification.rwRemoveaddress: Bad fileraRemoveaddress: Bad file@(#)ffasl.c 35.1 5/6/810H|OD-V/],eUnUxVUU yUV ` WUc<oWfaslfasl: non atom argdebugging.o.orrCan't open fileappendmapwafasl: can't open map file[fasl %s]fasl: header read failedfasl: bad magic number in fasl filefasl: string table read error, probably old fasl formatfasl: string table read error %d symbols in symbol table fasl: Symb tab read errorsymbol %s ord is %d Unknown symbol %s bind_orglit_orglit_endtrans_sizelinker_sizeFile not in new fasl formatRead error in text Read %d bytes of text into 0x%x incore segment size: %d (0x%x) lin_cor_org: %x, link_cor_end %x Bad text reloc readRelocating %d (ord %d) at %x Ran out of counters; increas NMCOUNT in fasl.c Couldnt find ord # %d No free file descriptor for fasl lit_org %d, charstrt %d form %d read: link form read: ,type: %d redefined %s %x Eval: transfer table too large@(#)nfasl.c 35.2 7/7/81trantblinkermcountmcounts_qnewint_qnewdoub_qcons_qoneplus_qoneminus_typetable_tynames_qget_errp_Inonlocalgo__erthrow_error_setsav_qpushframe_retval_lispretval_bnpEval: 2nd arg not legal alist pointerNot in *rsetmode; second arg is useless - evalWARNING - Nesting 2nd args to eval will give spurious valuesIllegal pdl pointer as 2nd arg - evalevalevalhookevalhook called before doing sstatus-evalhookevalhook called while not in *rset modefuncallhookfuncallhook called before doing sstatus-evalhookfuncallhook called while not in *rset modefuncallhook: first arg must be a listrset@(#)trace.c 35.2 7/7/81TevalfArg to evalframe must be integerevalapplyInvalid pdl pointer given: freturnfreturn: 1st arg not pdl pointer@(#)evalf.c 35.2 7/1/81@!h@@@3@333333@Ay1?ϒy@!hI@!hB:IvDv6T1E r OER `EM2 fkCӴLE\QEYWF\*~`EM2 f@@@1@rzA]ݬ5@3elB#"3h@?ØGe@lB,k$d!r@AA@@@"@NnDOLX2xة3I䔶TX]1 D!L%dIgN5&GbqhDK->G?A@@AA@@OO@JGSrCu%طK@0qi9IE4Ÿ@;\)@3fG@@@@@M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/bin/shPATH:/bin:/usr/binsh@@A@@Ar  AAAAAABBBBBB /bin/shsh-c, ,0xnil -> usr/lib/lisp/toplevel]]8̓,@Th|̭̝<P(P<ИԘĘȘܘxdxxd ,ȦdPx<P,ئx<|(Ƞܠ((Ȝܜ$0<HT`l((4@LXdp(Ȓܒ,@(()ylisppisp/step/9/810<,Td|h,,|,@h̽((<T@<dhd(T@hT((P|P|(T@h|x<PT@PhTȼP,xxx,h,Px̻T(Ȓܒ,@T(P,dȠd(<d<,ܬ,Ȥ,(@<Tx|,<xܤ,|(@Ȩxḓ<P,,Tx<hh|x@PTPP<hd(d|dhȸ,@ẖPdT|Ȭ<dd@ܸh<h<̹d,,ܰTdP@|xTh((d@̝,xxTܨ(x@PP|d̡x|@T,x|PT|@T,PPhT((xdxPP|TdTxhx<@ܺȺh(<xh(O\7}e(fasl '/usr/lib/lisp/auxfns0 'map)(sstatus appendmap t) (fasl '/usr/lib/lisp/auxfns1 'map) (fasl '/usr/lib/lisp/toplevel 'map) (sstatus appendmap nil) (dumplisp mylisp) ((((((((((((((((((x]>./tlisp/tlispe`h@T(8  (0h((((((((((((<<<(((((((((((((@P x(p08@HP@Xh`hpxĔ̔symbolstringfixnumlistflonumbignumarrayvaluebinaryporthunk0hunk1hunk2hunk3hunk4hunk5hunk6hunk7namestackunmarked_arraybindstacktlambdanlambdamacroibase*rsetsubroutinepiportpoporterrport$stdin$stdout$stderrreadtableptport^w$ldprintprinlevelprinlengthfloat-format%.16GError-Depth.()[]'!eofcarcdrperdlparrparlbktrbktnoptopcommentreadcomments(( dxȖܖ,@Th|̗     _l@@@{@@ ęș̙Йԙؙܙ||( 08@H̝Xh`px̝Țؚ̝̝̝(80@H̝PX̝`h̝x̝̝ț̝؛̝(ԔXܔ( ,48DPl\t$W(8xHXh|:L:XT$ا,/2@N\jx(2(Px, fnT  b *@:   V ک,@ThȕЕxؕp4x@hLX\hp x(08@HPXlast lexpr bindinglexpreval1 binding pointerevalhookfuncallhookevalframesyspagelimitevalasinacosatancossinsqrtexploglshbignum-leftshiftsticky-bignum-leftshiftfrexprotrandomatomapplyfuncallreturnconssconsbignum-to-listcadrcaarcddrcaddrcdddrcadddrcddddrcaddddrnthelemeqequalzqualnumberpdtprbcdpportparraypvaluepget_pnameptrarrayrefmarraygetlengthputlengthgetaccess`hpТxآܢd $Ȟ,О4؞<DLT\dlpx ̝̝ (̝8H@PX`h̝px̝̝̝Ц<@P d x(08PX`$(Hpx,0h48<@ЧاDHȧL(08@HPX<`ḥpԣx <$,4<DȟPП\؟dltputaccessgetdeltaputdeltagetauxputauxgetdataputdatamfunctiongetentrygetdiscputdiscsegmentrplacarplacdsetreplaceinfileoutfileterprprintclosepatompntlenreadratomreadcimplodemaknamconcatuconcatputpropmonitorgetgetdputdprogquotefunctiongo*catcherrsetstatussstatuserr*throwresetbreakexitdefnullframedumpandorsetqcondloadnwritnprocessallocatesizeofodumplispdumplispP| (08@ȪHЪPتX̓`hdpx$,4r @R^j̓̓$̓J̓̓D̓%̓2)̓<̓̓̓\b̓:̓ ̓̓b^̓l ̓\!̓&̓@N&4RhD^p\@DȮLЮTخ\d|hpx (08@`PXȫ`ЫhܫpxhƏ"\|Ə"\|top-levelstartupmapcarmaplistmapcanmapconassqmapcmapflatcalphalesspdrainkillcopyopvalnconsremobsplicingnotplusaddtimesdifferencequotient+-*/modminusabsvaladd1sub1greaterplesspany-zeropzeropminusponepsumproductdoprogvprognprog2oblistbaktracetyityipeektyosetsyntaxmakereadtablezaplineaexplodeaexplodecaexplodenhashtabstatargvargsetargshowstackfreturneval1 $h,4(<DHȯPЯ\دdpx (ĺ0Ⱥ8̺((ll\~dммd.lT̓̓̓̓p8^:z.^[W[X"Z̓N$|<02|%̓$@кHԺPغX`hpx|  (04<@HȾPо<Xؾ`lpxd|h (Ļ0@л8ػ@ܻHP` (,4<ȿPDпLؿT`hresetiochdirasciibooletypefixfloatfactcpy1DivideEmuldivreadlistplistsetplisteval-whensyscallinternptimeforkwaitexecegensymrempropbcdadsymbolpstringprematomprnamegetenvI-throw-errmakunboundhaiparthaulongsignalfaslcfaslgetaddressremoveaddressboundpfakeodmaknum*modfseekfileopenpv%cprintfcopyint*purcopypurep*makhunkhunkpcxrrplacx*rplacxhunksizeprobefsubstringsubstringnt (0(8@HPX`,hpܜx (0<LxRR.`76E;@z f >8*Dn,FF<̓ ,̓|>̓!U u)T\`hpx (08ܠ@H(P $odformatER%errER%tplER%allER%miscER%brkER%undefER%unwind-protectfeaturesfeaturefranzunixvaxucbvaxnofeaturesyntaxuctolcdumpcorechainatomdumpmodeappendmapdebuggingbcdtracectimelocaltimeisattyignoreeofFranz Lisp, Opus 36versionautomatic-resettranslinkonundeffuncgcgcaftergcportgccheckgcdisablegcloadloadingnoautotraceARRAYBINARYINTERPRETEDMACROPROTECTEDBADPTRARGSTEMPTY??USERbugsTERMCAP(08@HPX`hpx (08@HPX`hpx,4@xT`hpx|x$(,<P, TX08@@\`(PXȠ`d hHpxTlphhtx|| 08@(PX`Hpx<ĘȘ̘ИԘؘTHLXXX\dltd$,TLxT`ܘ 0@HX8hp`  $(, 00848H(X<`@DpPHLPxTX\`dhlpt x0(@8P@,H`hTXp|h̭̭(<PPP̭x ,0̭x<<p@`|hXx@xxco|c100|concept|c104|c1004p|concept100:is=\EU\Ef\E7\E5\E8\El\ENH\EK\E\200\Eo&\200\Eo\47\E:ti=\EU\Ev\040\0408p\Ep\r:te=\Ev\040\040\040\040\200\200\200\200\200\200\Ep\r\n:al=3*\E^R:am:bs:cd=16*\E^C:ce=16\E^S:cl=2*^L:cm=\Ea%+\040%+\040:co#80:dc=16\E^A:dl=3*\E^B:ei=\E\200:eo:im=\E^P:in:ip=16*:li#24:mi:nd=\E=:pt:kb=^h:ta=8\t:ul:up=\E;:db:us=\EG:ue=\Eg:xn:vs=\EW:ve=\Ew:vb=\Ek\200\200\200\200\200\200\200\200\200\200\200\200\200\200\EK:ks=\EX:ke=\Ex:ku=\E;:kd=\E<:kl=\E>:kr=\E=:kh=\E?:k1=\E5:k2=\E6:k3=\E7:.dN#9:dC#9TERMconceptSHELL/bin/cshPATH/etc:/usr/ucb:/bin:/usr/bin:.HOMEenvironment/usr/lib/lisp/auxfns0Non-list to append:Non-list to append:protect-listprotect-evformdefmacrooptlistdrdefmacroargdefmacro-for-compilingcompilec&rest&optional&protect&auxacaexprfexpr::1-let*letniresult<assoclsignp-argleegegbad arg to signp GFloating Exception Interrupt: [ut:%]:{%}; $gccount$P<(04(8@hLPX\`dxlhpx(<PPP8̭xPX`,p̭x<<@|`x@ (08@XHPxhpxx|`|`H0(x8 @|XPp@h8|@x0( xPx@x@@x@ (08@XHPxhpx@x@ @(0@xH`p̭(̭(<(<(<(h((|`Th(tPHP@lp\ 0̭(@̭(X<(h<(x<(h<P<x ((P8H̭X`(hP|x(P|,Ⱥ̭̭,̭(C@>(08@HPX`hpx (08@HPX`hpxC@ (08@HPX`hpx (08@HPX`hpxptimeatlastgcgcafter-panic-mode[Storage space totally exausted]Space exausted when allocating $gc_midlim$gc_minalloc$gc_pct$gc_lowlim$gcprint[Now in storage allocation panic mode]bad arg to assoc%\`,|~; too few args to delete non list arg to delete too few args to delete non list arg to delete exedit_file.l () . ) () . ) -lI77 -lF77 -lmtype (help fnc) for info on function fnctype (help n) to see chapter ntype (help tc) for a table of contentsBad option to help tcTable of contents1 - intro; 2 - data structure; 3 - arithmetic; 4 - special5 - i/o; 6 - system; 7 - reader; 8 - functions; 9 - arrays10 - exceptions; 11 - trace package; 12 - Liszt;14 - step package; 15 - fixit packageb - special symbols; c - gc & debugging & top level b/usr/ucb/ul /usr/lib/lisp/manual/ch.r | /usr/ucb/more -fUnknown function: appendhelplocationȰP|$|8HLXPxT|h|P`\<P(<8x@HX`h(Px̭(P|(P|,@<x̓( @̭h`p[Reading help index]/usr/lib/lisp/manual/helpindex /usr/ucb/ul /usr/lib/lisp/manual/ | /usr/ucb/more -f "+/("hunk: size is too bigload: illegal filename load-search-pathload: file not found /.o.lmakhunk: size is too bighunk'() . cshbad file namesort-functionoldnewvi*arrayno bounds to array declaration fixnum-blockflonum-blockarray: bad type: arrac-oneDarrac-twoDarrac-nD wrong number of subscripts to array: wrong number of subscripts to array: wrong number of subscripts to array: arraycallsegment-sizessmall-segment: bad type segment-typessegment-arraysnon array arg to arraydimsNon array to listarray defmcrosrchnreverseconcatldefmcrooptionlambdacvtde-composenconcreverseerrorsubst*breakdiffmaxprtpagesusedcopyexviexplodelastexplodecexplodenexptoddplengthgetcharlist-to-bignummacroexpandprincsortmergesplitlistc  u               (  D  K  Q  Y  l w  }          '  8  I  U  l             " ( 1 I P V ^ t           " > P c p       " A Q i y             , B `        ' Q f {       * 8  %+3?DKvpXWZVPZ~Z|jЪP1xjP@ﺨPxPPP*hjԆSPSPWuWVPjTФԆSPЪ xjP@^PxPPP+ШjԆuSPlSPWCuWV*кj"Ъ jTФԆ@SPQvPQ`` PЪ PЪ`ЪPVЎZoXW~VZWVPj~jP@P@1պxjP@ P1j j#jPzRPjкP@ЭպxP@J ЪPKкP@ЭЪLPѪ Ѫ#ЪPRPVnXWZVШjWsWVnXW~VZWVPj~jP@ѺЪPjкP@ЭЪWsWVPкP@ЭPѪ Ѫ#ЪPAQPmXWZVЪժPjЪTФPvPTP PкmXWZVШ ШкTdSУԆPPPPкTФԆPPPPPLmXWZVШШкTdSУԆPPPPкTФԆPPzPPqPlXWZVԆԆԆԆԆԆԆEUиШЪиШЪи Ш Ъ UкTdSУШ$ԆWqWVPШ(кTФШ,Ш0Ш4ԆЪժ8P Ъ8TФP`Ъ4OP4к88VЪ4WqWVVPԆи ժ<P1tЪJP5JЪP"UХХХU fXWZ VjЪP1xjP@﷞PxPPPNШdЪԆWkWVPIPWkWVPjIPЪI1YjTФPPhOdSУЪԆWgkWVPкTdЪЪWGkWVPWFkWV1ѤldЪЪW;kWV1Ѥp1dSУPxPP@PxPPPУԆHУPPШtԆиժP<ЪTФШxЪԆHPHVPЪHPкVЪWujWVVPaHPкTdЪЪЦjЦЦ V19Ѥ|1ԆкժPn((TФxP@ٜPxPPPȀЪG!кTФԆGPЪTФGVPЪ GP кVЪ WiWVVbФȄЪGPԆWriWVPкȈЪ\GPЪWGiWVPWFiWVcXWZ VԆԆjЪP1jTФPPh dSУЪЪWhWV1`xP@瀞PxPPPФ 1ФSУ cRТШdЪԆWhWVPFPWhWVPЪ jTдScRТЪԆdFP[FPRFPIFPи ?PШ4ЪW-aWVPԆЪWaWVPժHP1ЪHTФШ8ȸкLЪ Ԇ>P>P>PЪLTдSգ7Ш<ФRТУԆ>P>P>PԆ>PPԆW`WVPi>PШLШ<ЪLTФSУȴdԆB>P9>PԆ.>P%>P>PЪLTдSc,ШNWV`PРWMWVȌWMWVȐЪWMWVРWMWVPЪWMWV`PРP`UU~ЪWMWVаPРP`UUUn*PW{MWVPWMWVPWAMWVȔWMWVȘWMWVPк 1GXWZV|||ԆjP1_PȜWMWVP Џ؜P؜#؜P)P؜؜؜jTФWLWVPfWLWVPЪTФؠPРWaLWVPЏWaLWVPкTФؠP`SУW#LWVPЪؠЏЪTФWLWVPЏкTФdSУWKWVPWKWVPWKWVPؤcЪЏ|WJWVP<ȨWYKWVfWKWVȬjTФWKWVЏP1ЪذWJWVPDشظкTФWKWVPW*KWVPWKWVQЪؼW0JWVPشP/кTФЏWJWVPشPЏPP ؤ1Ъ ЏWIWVPи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ȬTTxTxTPTxTdTTTTdTT,T<TTTTdTTTTTTT|TTTTP(((( $,4@<DȜLhTPTXܼhpxX@x0(,  (8$H0P@8|DTdhtxdȼԼ@ ,Ldhpнmergelistssortcarhelpexchange2sublishelpsubsteqsubstequalsmall-segmentfillarrayarrayminarraydimsSCCS-auxfns0@(#)auxfns0.l 1.29 7/9/81back=quotify/usr/lib/lisp/backquotebackquote**backquote**comma not inside a backquote.,@,.franz-symbolic-character-namesIllegal character name in #\Bad character after #Unknown form after #+ or #-feature-presentSCCS-backquote@(#)backquote.l 1.4 3/7/81back-quote-ch-macroback-quote-comma-macro1+#о@8ܰ0(̭ܺ Ⱦ@d(xp̭h`XPṰH@,@<, ̭80̭,P(H̭@`,h̭x̭Pпȿ̭@̭dؿ`P$(T,8h<xDHPTxX\`hhpx̭T0(̭H @̭̻8X(̻xp̭hh̭̭(̭̭,̭((((,pTh̭P8 <`H PpX$dh(xx(0044(sharp-sign-macrobsbackspacetablflinefeedffformcrnewlinevtaltescspspaceruboutdeclarememqcatchthrowdefmacrodefundesetqlistifysassocsassqsignpsignphelpfcnunwind-protectFPEINTINTappend1bigpcopysymbolcvttointlispcvttomaclispcvttoucilispdefpropdeletedelqevenpexecexlxyresloopffaslfileposfixpflatsizefloatpgetcharngetlhelp/usr/lib/lispincludeincludefmakhunkmember$ l0l@(,P8@`HTX@0@̭ܰd,ḓȰ<0<(̭Pp P<H̭̭h@`X8,x| ̭x|̭X@a .!!"1#J$%&(()+̓"/S//,0̓B00W112y3̓3]56V7̓78̓C9̓n9;<>J@@A%BiBBB"CC̓;HIIN̓NOsOOQRESSRUzUU4V]VWXcXXY (08(@Hd`p$4DLhT\dlptx|(ܰ ̭P@,H80@̭ܰxph,,,(,, T0,8H,X<Phṱ@, @8,XH|P`@xp@h0(xPPhP| Ṱh@8̭0X(P̭Hh0Ṱhx̭̭((0Ṱh̭ (8@H̩dhp@x (008`@h|DL\dnreconcpluspprog1shellsloadsortsortcarsublisvilxconsev-arraycallstorestoreinternfillarraylistarrayabsbcdcallchrctcharcntnumbpremainderterpritypepsymeval=>*dif1+$1-$*$/$+$-$/usr/lib/lisp/auxfns1B NPprintblanks linel$fileopen$$outport$FAVbad arg to pp: pp: atom is unboundpp: function is machine coded (bcd) T-nargsT-arglistoriginalm . msgmakenthcdrcondclosefile+Zr[[x\]]]H^___\``̓a̓>a\aad=edef]g]ijkm(nop   ̓    ,g̓%>Y6vD D$z$$$&&Q'()(+,,̓(( ( ̭P8PXP̭(Hxp̭<h`̭h̭̭<̭0(̭PX PH̭d@8xp̭h̭̭x̭̭franz-top-level 71a00 debug-err-handler 71d76 break-err-handler 72044 debugging 72444 break 7247a *break 724f4 franz-reset 72624 error 7269b read-in-lisprc-file 72751 undef-func-handler 728e2 autorunlisp 729c8 cvtsearchpathtolist 72b28 load-autorunobject 72c06 debug 72cfd +2=DKT [bi,pgw|% >  Y  6\%F00008linkertrantb_qcons_typetableF00018_qoneminusF00026F00031_qnewintF00033F00042F00044F00051F00060_bnp_qgetF00097F00101F00105F00136_qoneplusF00146F00148F00157F00159bind_orglinker_sizetrans_sizelit_orglit_end[  j         &  7  Q  w      )  ` n    aXWZjVѸ#иPuPUиhjUfW4WVUХUVPWWVyXWZjVѸ Ѹ#иPHuP_UиhjULиP`%xP@ ШWWV1fWWVP)fWWVШfWZWVPtYfWZWVP)fWLWVШ fWWVPtШfWWVPtUХUsOXWZVԆԆԆԆԆxjP@!PxPPPШjԆ8tP/t1JjTФPPdP17xP@PxPPPФSУQШPPQ1z`PjTФW=WVPкW'WVPxP@tPxPPPԪШxP@QPxPPPԪ Ш ժЪTФPPԪШԪժWxP@PxPPP>ЪTФPP0ШкTФкSУsPԆrPrժ$кTդШ ЪԆrPrVժ+ЪTФPP Ш ЪкrPr&Ш$ЪЪԆrPyrPpr1jTФSУPP7Ш(cdWWVPԆ9rP0rP'rCУPP 7Ш,cdWsWVPԆqPqPqPXWZjVԆԆfWIWVPjj< jTЏ Uи0Ш0Ъ0UfWWVPԆrqeUХUWV1j=fWWVPЪWWVPfWWVPP1j=fWdWVPЪWvWVPfW=WVPP1jfW>WVPԆp1^jx:ЏЏ|fW WVPW WVPԆhp1j3Ш4fWWVPԆ@pP7pPԆ,p1j j,fWrWVPWWVPԆo1jprfW=WVPЪи8ժ P#ЪЪ TФSУPvPSP Pк V`jjШ<ЪWWVjԆro&Ш@jWWVPW”WVXWZVxjP@PxPPP2jШDWWVvQP Q `PPPPP1jTФPPH$dSУW]WVPШPP1ѤL:dժиP'ЪTФW#WVPP PкVVѤP:dժP)ЪTФWWVPиP PкVШTTWWVr,@h̭<(Th|@p|X<<X@ Hp`xh  0( ̭PH̭x@ph̭d`X̭̭,̭̭,( ̭PH@̭80ph̭`̭x̭̭x̭( ̭H@̭@p8h`̭XP̭̭P̭̭P ̭@H@8̭d0(h`̭,X̭dxp̭@̭|̭T ̭@8̭hh0`X̭hPH̭|x̭P,̭̭x ̓(8,@PP,X@̭pȰ̓,,̝xh@0<8D<PTX(08P|`H$@,4P@lpx<$prpr$prdf$tocolumn$patom1$dinc$prd1linelengthSCCS-auxfns1@(#)auxfns1.l 1.1 10/3/80nthnthrestlistpapply*$x$pp/usr/lib/lisp/toplevelfranz-not-virgin+++++*****break-err-handlerfranz-resettop-level-catchbreak-catchdebug-level-countbreak-level-counttpl-errlistuser-top-level-> top-level-eofGoodbyeEOF[Return to top level]Error: debug-err-handlerD<>: contuablocalcall<>: Can't continue from this errorretbrkerrlist h(|x,@0<P@`h̥p<̭@80̭( P,X(xp̭(h̭̭h,P ,H@@8̭0P(X`hpx,̭̭X@̭ܰxBreak /.lisprc/.lisprcError in .lisprc file detectedautoload[autoload ]Autoload file does not contain func -f:From lisp autorun: can't find file to loadCan't find file to execute /debugautorunlispread-in-lisprc-fileold-reset-functioncvtsearchpathtolistload-autorunobjectSCCS-toplevel@(#)toplevel.l 1.5 7/9/81QQ00000franz-top-levelundef-func-handlertrace/usr/lib/lisp/tracestep/usr/lib/lisp/stepmylispDP,P(@lph,x(8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P2ԪЏиpjWeWVPWeWVиpPPWueWVժ-ȈWeWVjи4WheWVjPPPGXWZjVȌW|eWV`UU~и4WeWV`UUUQ>XWZVк~и4WxdWV`UUU>PjjЏWeWVPOЏѪjP9Ȑи4WdWVѪ#ЪP>PVP[XWZVи(P`UU~jWcWV`UUUt="XWZVjи4WcWVȼḓ,(P<Pd\,lxȰ<XWZjVhWbWVPո1иԸԸ ԸԸԸԸШ$ Ш(Ш,PРWebWVfW`bWVP?Ш0WRbWVPWIbWVfWDbWVfW?bWVPPԆԆԆP1Ш4PP1P51P,1HXWZVԆ UиLШLЪLUШ*PЪTФЪ &*P к1K6XWZVjЏWQWVPQPPJQ`P=jWoQWVPjWbQWV WUQWVxЪԆժW5QWVUЪTФjWPWVP Ъ WPWVPЪ WPWV PкV?XWZVW_PWVj(PWOWV`<PdxȠܠ,L@(0T8l<|HPx̭X $P\`|(h@<$  ~@%r'63$/=$9AIQ.W %^ 8e m u }      .    o  (  9H L P X Z` h }  $ 7. 6 => G S A\ /e <l 'w d'} s' ' ( ((  ( 2$( (( j,( 0( 4( 8( 8( z+ + + + <+ b+ + \+& x+ +1 ,:  ,C ,I ,P  ,X  0d (0m;y|hIoW@f,&n+k`&$Z&D"uL L # /@i8 wD/MdU`Vktis T4{m4FVUcg,.t/3T3&3>3383f5n9@D HPT#`-.8A بKlU(`Pj4xsZ~ȩ<K57P,FXr@jC87<8f8r8T8`8,9!<9*^94iz9=9E$}M!UJ:^}gp:qt:yV:v^;p;x;;;< <aF< >L5\LJa;DdAoC jDBC%{C0x$D #PWXx(_I8flxmsyHXhZ|:L:XT$ا}v:24@N\ j x   & c(+ 23 ; E L 8(S P[  xd , m ]fu n{ % T     b y     *  * @  :  B    V  & ! * ک0 :r : eC @M U ] e Mm v m~ ! 3 C R ^ j r  |   + 6$ mJ  2D  % 2) < % - 5 < B \I O :T   [ b bi p y ?^ l    \! D@ N @& \4 R   h 0D   ^ - op! bl' - 3 d\8 e~= hB XG dM WU 2^ e l w 4 м d . gT     3  ep 8 ^ v :  z   % + s.4 = ^E [L [T X_ O"Zi s n{ N  -$   R| _ < 0   2 d|% \$   x  R(R00: D.NW`jws`7|6bE`;b@zS jf k>i88f*D$P,n2,; EPYeeFr(+|"v ,k} U(,w0<DH~L\ V pĞL3?t|oƉ%Њ+j$3<<~DȯMJU;^0a*jtl@\w[+<4+43> "HW\0 V|1pTm(fp0f 27&.`m6k<<BIprO|X r`o w pmm~x & %{x 1@ = F5 Ozb Wajsd|hm.C;LqPj~ |p/>p/( T8Wf?f 3\S&,"-+v.4 .;U(.D<LdU4.^.gTn/u/}=0n8000:112]<2\2^222q68^:X^?<~?,@"Nr)[6s19UCVJUTU_yUhVnWUxR_T ETcT KTQTWT]T^FF^((Z_(l cmyD|<f iFgOibj'vm.~5|<~2EOXqU(r\sc:slyst|yu|xnzpy܌X}d}^}}{~Y7ɍ !!U'0 <JPuZ)aea p.!u!}"1#J$%&(()+"/S//,0B00W112y3&3-]5268V7;7@8EC9In9Q;Z<c>hJ@n@vA{%BiBBB"CC;HIINNOsOOQRESSRU zUU4V]V#W)X1cX7X=YB+ZLr[V[ax\i]u]]H^___\``a>a\aad=edef]g]ij km$(n.o=pG O [ f n u y ,g%>Y6vD D$z$$$&!&'Q';(N)Z(+n,,start_exit_main_environ_xports_gstart_proflush_holbeg_holendFixzero__iob_Xargc_Xargv__sobuf_retval_orgbnp_orgnp_rlevel_errp_piport_poport_vtemp_bnp_sigintcnt_rsetsw_lispsys_stattab_bnplim_nplim_chkport_zeroq_atmlen_hunk_items_hunk_pages_hunk_name_itemp_purepage_strbuf_GCtime_datalim_beginsweep_usehole_curhbeg_hasht_exception_hash_sigstruck_sigacts_sigdelay_keywait_atomval_lastrtab_rbktf_rdrport_contval_errport_tint_gftab_proport_namptr_bcdtrsw_ftemp_argptr_ttemp_lctrace_trcur_end_pbuf_mcounts_globtag_syml_errno__sibuf_zfreespace_bitmapi_firstalloc_setbuf_initial_qpushframe_depth_clearerr_matom_Lapply_Ntpl_Istsrch_fputs_dmpport_Lread_eval_printr_franzexit_fvirgin_stabf_unlink_sigcall_evalhcallsw_lispretval_binderr_funhcallsw_Lfuncal_errorh_typetable_qpopnames_namerr_Ifcall_Iarray_qnewdot_qnewint_error_popnames_rebind_fchack_protect_unprot_linterp_Undeff_bindfix_alloca_callg_newdoub_bitmap_bitmapq_bitmsk_gcflag_current_atom_str_strng_str_int_str_dtpr_str_doub_str_array_str_sdot_str_val_str_funct_str_hunk_str_gcableptr_get_more_space_initflag_copval_xsbrk_fakettsize_printf_badmem_next_one_gc_next_pure_one_newint_pnewint_newdot_pnewdot_pnewdoub_newsdot_pnewsdot_newatom_newstr_strlen_strcpy_inewstr_strcpyn_newarray_Ipurep_pruneb_badcall_newfunct_newval_pnewval_newhunk_pnewhunk_inewval_Ngc_gc1_times_vadvise_fflush_blzero_markdp_hashtop_alloc_typenum_csegment_sbrk_csizeof_gethspace_ysbrk_gcrebear_markit_xcycle_lispend_getatom_hashfcn_strcmp_reborn_signal_siginth_Isstatus_makevals_clrtt_delayoff_dosig_badmemr_initread_prinlevel_prinlength_readr_rtaberr_ctable_Iratom_readrx_macrox_fprintf_Iget_ratomr__filbuf_getnum_finatom_endstrb_ungetc_calcnum_dopow_sscanf_Ltimes_dmlad_qpruneb_uctolc__ctype__lfltpr_ioname_pbignum__flsbuf_fputc_sprintf_Inonlocalgo_Iretfromfr_Inlthrow_matchtags_qretfromfr_Lframedump_calhan_argerr_tgcthresh_Imkrtab_Lcar_mfun_Lcdr_Vevalframe_Leval1_Lasin_Lacos_Latan_Lcos_Lsin_Lsqrt_Lexp_Llog_Llsh_Lbiglsh_Lsbiglsh_Lfrexp_Lrot_Lrandom_Latom_Lreturn_Lcons_Lscons_Lbigtol_Lcadr_Lcaar_Lc02r_Lc12r_Lc03r_Lc13r_Lc04r_Lc14r_Lnthelem_Leq_Lequal_Zequal_Lnumberp_Ldtpr_Lbcdp_Lportp_Larrayp_Lvaluep_Lpname_Lptr_Larrayref_Lmarray_Lgetl_Lputl_Lgeta_Lputa_Lgetdel_Lputdel_Lgetaux_Lputaux_Lgetdata_Lputdata_Lmfunction_Lgetentry_Lgetdisc_Lputdisc_Lsegment_Lrplaca_Lrplacd_Lset_Lreplace_Linfile_Loutfile_Lterpr_Lprint_Lclose_Lpatom_Lpntlen_Lratom_Lreadc_Limplode_Lmaknam_Lconcat_Luconcat_Lputprop_Lmonitor_Lget_Lgetd_Lputd_Nprog_Nquote_Nfunction_Ngo_Ncatch_Nerrset_Nstatus_Nsstatus_Lerr_Nthrow_Nreset_Nbreak_Lexit_Ndef_Lnull_Nand_Nor_Nsetq_Ncond_Llist_Lload_Lnwritn_Nprocess_Lalloc_Lsizeof_Ndumplisp_Nndumplisp_Lmapcar_Lmaplist_Lmapcan_Lmapcon_Lassq_Lmapc_Lmap_Lflatsi_Lalfalp_Ldrain_Lkilcopy_Lopval_Lncons_Lforget_Ladd_Lsub_Lquo_Lfp_Lfm_Lft_Lfd_Lmod_Lminus_Labsval_Ladd1_Lsub1_Lgreaterp_Llessp_Lzerop_Lnegp_Lonep_Ndo_Nprogv_Nprogn_Nprog2_Loblist_Lbaktrace_Ltyi_Ltyipeek_Ltyo_Lsetsyn_Lmakertbl_Lzapline_Lexplda_Lexpldc_Lexpldn_Lhashst_Largv_Larg_Lsetarg_Lshostk_Lfretn_Lrset_Levalf_Levalhook_Lfunhook_Nresetio_Lchdir_Lascii_Lboole_Ltype_Lfix_Lfloat_Lfact_Lcpy1_LDivide_LEmuldiv_Lreadli_Lplist_Lsetpli_Nevwhen_Lsyscall_Lintern_Lptime_Lfork_Lwait_Lexece_Lgensym_Lremprop_Lbcdad_Lsymbolp_Lstringp_Lrematom_Lprname_Lgetenv_Lctcherr_Lmakunb_Lhaipar_Lhau_Lsignal_Lnfasl_Lcfasl_Lgetaddress_Lrmadd_Lboundp_Lfake_Lod_Lmaknum_LstarMod_Lfseek_Lfileopen_Lpolyev_Lcprintf_Lcopyint_Lpurcopy_Lpurep_LMakhunk_Lhunkp_Lcxr_Lrplacx_Lstarrpx_Lhunksize_Lprobef_Lsubstring_Lsubstringn_Iaddstat_mstr_Ngcafter_strcatn_gctab_lineleng_keybin_protflag_dmpmode_trhead_trleft_bind_lists_lsbrkpnt_Leval_Lxcar_Lxcdr_cxxr_rpla_verify_fopen_fclose_gtty_stty_typred_oLequal_Iequal_Ipntlen_okport_Iflatsi_r_Iconcat_Iputprop_Igetplist_Lmapcrx_Lmapcx_cmpx_Ldiff_divbig_subbig_rpltab_qexarith_adbig_qprunei_Ifloat_exarith_mulbig_getpid_kill_Lexpldx_chdir_floor_myfrexp_Lbreak_mkstFI_frstFI_getenv_fork_wait_Lpipe_pipe_Lfdopen_fdopen_gensymcounter_execve_Iimplode_Imath_sin_cos_asin_acos_sqrt_exp_log_atan2_rand_pow_Lfdecom_fseek_ftell_dispget_gstab_nlist_bndchk_access_strncpy_Ipurcopy_Lgetlang_Lputlang_Lgetparams_Lputparams_Lgetloc_Lputloc_CNTTYP_Llctrace_Lslevel_Lsimpld_mcountp_doprof_Nexit_Nsys_fpipe_vfork_close_dup_execlp__exit_chkargDlast_open_read_creat_write_lseek_vsyscall_time_ctime_localtime_isatty_chktt_Nopval_setexit_getexit_reset_resexit_setsav_exitlnk_svkludg__dofpipcerrormcount_mcount_dodiv_dsnegBexportbackfr_inewint_calqhat_mlsb_adback_dsdiv_dsmult_export_dsrsh_dsadd1_Ihau_Ibiglsh_HackHex_mytemp_system_ungstab_stat_copyblock_fread_fwrite_Symbtb_qnewdoub_qcons_qoneplus_qoneminus_tynames_qget__erthrow_strcatudiv_gettran_qlinker__qf0__qfuncl__qf1__qf2__qf3__qf4_searchforpdl_verifypdlp_atan_frexp_log10_modf_ldexp_ceil_asctime_ftime_gmtime_dysize_execvp_index_execv_sleep__doprnt__lastbuf_dup2_srand_scanf__doscan_fscanf__sctab__getccl__innum__instr_atof_malloc_free_alarm_setjmp_pause_longjmp_execl_getppid__cleanup_ioctl_realloc_brkdeclareappendconcatlmaxmemqcatchthrowdefmacrodefmcrosrchdefmcrooptiondefunlambdacvtdesetqletde-composelet*listifysassocsassqsignpsignphelpfcnunwind-protectFPEINTINTprtpagesusedgcafterappend1assocbigpcommentcopycopysymbolcvttointlispcvttomaclispcvttoucilispdefpropdeletedelqevenpexexviexecexlexplodeexplodecexplodenexptffaslfileposfixpflatsizefloatpgetchargetcharngetlhelphunklastloadincludeincludeflengthlist-to-bignummacroexpandmakhunkmemberminnconcnreconcnreverseoddppluspprincprog1reverseshellsloadsortsortmergesplitlistmergelistssortcarsortcarhelpexchange2sublissublishelpsubstsubsteqsubstequalvivilxconsarray*arrayarraycallev-arraycallarrac-oneDarrac-twoDarrac-nDstorestoreinternsmall-segmentarraydimsfillarrayfillarrayarraylistarraymsgmakeprintblankslinelengthcharcntnthcdrnthnthrestlistpppcondclosefile$prpr$prdf$prd1$dinc$tocolumncharcnt$patom1franz-top-leveldebug-err-handlerbreak-err-handlerdebuggingbreak*breakfranz-reseterrorread-in-lisprc-fileundef-func-handlerautorunlispcvtsearchpathtolistload-autorunobjectdebugublishelpsubstsubsteqsubstequalvivilxconsarray*arrayarraycallev-arraycallarrac-oneDarrac-twoDarrac-nDstorestoreinternsmall-segmentarraydimsfillarrayfillarrayarraylistarraymsgmakeprintblankslinelengthcharcntnthcdrnthnthrestlistpppcondclosefile$prpr$prdf$prd1$dinc$tocolumncharcnt$patom1frucb/liszt 1755 0 33 2206407 2552755565 6033 * .$((nil(eof(8HXhx  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDE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PPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~﹦PYjtm~P nn BЫZ֫ZPѫPѬ ZPPXPZ~QPYZkn 1mЫZ3[1xݏPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~|PY PP l[ [[[6m Ь[Z = 8[ePZ~YPZ ݫ ԫ kZP{ Ь[ЬZkPkPzQQPP^߭ݬxPPPPЬ[ЬZ[Y[YPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6LЬ[ѬP ѫѫk֫k׫ЫP`P PHP$.d$`$$$$$~*PY$[$k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZz$ [`Pl$YPƏPxPS$bPZx@$PZPPZx0$~@PZZZ $$PZP#x#PZPPjj#`#1xYP[P#Z###k##k[P Ь[[ZZZ#jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP"@jXi~\S^\=iP4iЬiPЬPЬRRQ{RPPR PRPPЭR((BQPPbPb լQPѝP@(#)Orderit.s 35.1 5/6/81x@top-levelversion -> @(#)lisp.c 35.5 7/1/81Unbound Variable:Too few actual parametersToo many actual parameterseval: Undefined function Apply: Wrong number of args.Apply: non-list of argsapply: Undefined Function Too few actual parametersToo many actual parametersBad funcall arg(s) to fexpr.Bad funcall arg(s) to fexpr.funcall: Bad functionBYTE INTERPRETER CALLED ERRONEOUSLYUndefined function called from compiled code @(#)eval.c 35.3 7/9/81 foreign call: illegal argument @(#)eval2.c 35.2 5/18/81ȗ(0(0 @`ب(Pxȩ@h`ب(Pxȩ@hBAD PAGE LIMIT all space exausted, goodbye PAGE LIMIT EXCEEDED--EMERGENCY PAGES ALLOCATEDSORRY, ABSOLUTE PAGE LIMIT HAS BEEN REACHEDPAGE LIMIT EXCEEDED--EMERGENCY PAGES ALLOCATEDSORRY, ABSOLUTE PAGE LIMIT HAS BEEN REACHEDYOU HAVE RUN OUT OF SPACEvalue to pruneb not a sdotvalue to pruneb not a listBAD FUNCTION DESCRIPTOR USED IN CALLBAD CALL TO GCNEED PORT FOR GCBegin gc name stack compiler stuff signif stuff time to sweep up Space request would exceed maximum memory allocationNOT ENOUGH SPACE FOR ARRAYThere isn't room enough to continue, goodbye all space exausted, goodbye BAD TYPE NAME[fasl hole filled up] For sbrk from lisp: no space... Goodbye!OUT OF SPACE FOR ARRAY REQUEST all space exausted, goodbye @(#)Talloc.c 35.5 6/28/81HdumpcoredumpcoreenvironmentInternal bad memory reference, you are advised to (reset).@(#)inits.c 35.1 5/6/81Ə"\|Bad reader construction: (. ) Should be (nil . ) Bad reader construction: ( .) Should be ( . ), assumed to be ()Bad reader construction: ( . not followed by )Number exceeds parse bufferNon-list returned from splicing macroPremature end of file after Improper value returned from splicing macro at top-levelReadlist error, code ATOM TOO LONGEOF encountered while reading atom[read: null read and ignored] %c (%o): ILLEGAL CHARACTER IN ATOM%FATOM TOO LONG(ptr to)%d%$unopenedport%%%s%{ ... }array[]#%X-& .... @(#)io.c 35.2 5/22/81|No prog to go to with this tag No prog to return fromNo catch for this tag Internal Inonlocalgoto errorFrame dump at %x is prog catching reset eval: funcall: unknown: %d End of stack @(#)frame.c 1.1 7/1/81%s %s Can't continue from this errorCan't 'go' through an error break %d:>%s Unrecoverable Namestack Overflow, (reset) is forced resetNAMESTACK OVERFLOWBindstack overflow.Illegal read table.Attempt to allocate beyond static structures.incorrect number of args to@(#)error.c 35.4 7/1/81nilsymbolstringfixnumlistflonumbignumarrayvaluebinaryporthunk0namestackunmarked_arraybindstacktlambdanlambdamacroibase*rsetsubroutinepiportpoporterrport$stdin$stdout$stderrreadtableptport^w$ldprintprinlevelprinlengthfloat-format%.16GError-Depth.()[]'!eofcarcdrperdlparrparlbktrbktnoptopcommentreadcommentslast lexpr bindinglexpreval1 binding pointerevalhookfuncallhookevalframesyspagelimitevalasinacosatancossinsqrtexploglshbignum-leftshiftsticky-bignum-leftshiftfrexprotrandomatomapplyfuncallreturnconssconsbignum-to-listcadrcaarcddrcaddrcdddrcadddrcddddrcaddddrnthelemeqequalzqualnumberpdtprbcdpportparraypvaluepget_pnameptrarrayrefmarraygetlengthputlengthgetaccessputaccessgetdeltaputdeltagetauxputauxgetdataputdatamfunctiongetentrygetdiscputdiscsegmentrplacarplacdsetreplaceinfileoutfileterprprintclosepatompntlenreadratomreadcimplodemaknamconcatuconcatputpropmonitorgetgetdputdprogquotefunctiongo*catcherrsetstatussstatuserr*throwresetbreakexitdefnullframedumpandorsetqcondlistloadnwritnprocessallocatesizeofodumplispdumplisptop-levelstartupmapcarmaplistmapcanmapconassqmapcmapflatcalphalesspdrainkillcopyopvalnconssysremobsplicingnotplusaddtimesdifferencequotient+-*/modminusabsvaladd1sub1greaterplesspany-zeropzeropminusponepsumproductdoprogvprognprog2oblistbaktracetyityipeektyosetsyntaxmakereadtablezaplineaexplodeaexplodecaexplodenhashtabstatargvargsetargshowstackfreturn*rseteval1evalframeevalhookfuncallhookresetiochdirasciibooletypefixfloatfactcpy1DivideEmuldivreadlistplistsetplisteval-whensyscallinternptimeforkwaitexecegensymrempropbcdadsymbolpstringprematomprnamegetenvI-throw-errmakunboundhaiparthaulongsignalfaslcfaslgetaddressremoveaddressboundpfakeodmaknum*modfseekfileopenpv%cprintfcopyint*purcopypurep*makhunkhunkpcxrrplacx*rplacxhunksizeprobefsubstringsubstringnodformatER%errER%tplER%allER%miscER%brkER%undefER%unwind-protecterrsetfeaturesfeaturefeaturefranzfeatureunixfeaturestringfeaturevaxfeatureucbvaxnofeaturesyntaxuctolcdumpcoredumpcorechainatomdumpmodeappendmapdebuggingevalhookevalhookbcdtracectimelocaltimeisattyignoreeofversionFranz Lisp, Opus 36automatic-resettranslinktranslinkundeffuncgcgcaftergcportgccheckgcdisablegcloadloadingnoautotraceARRAYBINARYINTERPRETEDMACROPROTECTEDBADPTRARGSTEMPTY??@(#)sysat.c 35.7 7/9/81 Pxeֵ8|H:xt D@@P3?@(̗`>@   =@@ @ h l pt x@| ((@(#)data.c 35.5 7/1/81evalxcarBad arg to carxcdrFell of the end of a bignumBad arg to cdrc{ad}+rFell of the end of a bignumBad arg to cdrBad arg to carnthelemFirst arg to nthelem must be a fixnumsconsFirst arg to scons must be an int.Currently you may only link sdots to sdots.Bignum-to-lispNon bignum argument to Bignum-to-listconsrplac[ad]Attempt to rplac[ad] nil.Rplacca of a bignum will only replace INTSBad arg to rplaeqnullinfileinfile: file name must be atom or stringrUnable to open file for reading.woutfileIllegal file open mode.aPlease supply atom or string name for port.Unable to open file for writing.terprclosenwritnnwritnnumberpatomtypedtprbcdpportparrayphunkpsetIMPROPER USE OF SETequalequalequalprintpatom%d%gNon atom or number to pntlen @(#)lam1.c 35.3 7/8/81,flatsize: second arg not integerflatsizeread or ratom or readcloadFILENAME MUST BE ATOMIC/usr/lib/lisp/.lrrrrCan't open file: concat: string buffer overflow%d%fNon atom or number to concatputpropputprop: bad disembodied property listputprop: Bad first argument: getget: bad disembodied property listgetdgetd: Only symbols have function definitionsputdonly symbols have function definitionsbad list argument to mapbad type returned from funcall inside mapInappropriate list argument to mapc@(#)lam2.c 35.3 7/8/81@@alphalesspalphalessp: non symbol or string argalphalessp: non symbol or string argnconszeropLdiffnon-numeric argumentmodnon-numeric argumentnon-numeric argumentnon-numeric argumentminusnon-numeric argumentminusp: Non-(int,real,bignum) arg: absvalForms in evaluation: Backtrace: -- non symbol in hasht[%d] = %x: setsyntaxneither fixnum, atom or string as char to setsyntaxOnly 1 char atoms to setsyntax@(#)lam3.c 35.4 7/8/81Non-number to addInternal error in add Non-number to minusInternal error in differenceNon-number to addInternal error in timesInternal quotient error #1: Internal quotient error #2: Internal quotient error #3: Internal quotient error #4: Non-number to quotient Internal quotient error #5: @(#)lam4.c 35.2 7/8/81@O^m|expldxCan't explode without string delimiter%dEXPLODE ARG MUST BE STRING, SYMBOL, FIXNUM, OR FLONUMchdirchdir - non symbol or string argargument not an integerargument is out of ascii rangeBoole demands at least 3 argsFactorial of Non-fixnum. If you want meto calculate fact of > 2^30 We will be here till doomsday!.fixinnaproriate arg to fix.frexpfloatBad argument to floatDivideFirst arg to divide neither a bignum nor int.@(#)lam5.c 35.5 7/8/81Too many open files to do readlistreadlistNon atom or int to readlistgetenvargument to getenv must be atomboundpargument to boundp must be symbolplistOnly Atoms and disembodied property lists allowed for plistsetplistsetplist: First argument must be an symbolsetplist: Second argument must be a listsignalFirst arg to signal must be an intSecond arg to signal must be an atomassqArg: not in context of Lexpr.Out of bounds: arg to "Arg"setargArg: not in context of Lexpr.setarg: first argument not integersetarg: index out of rangecall to errSecond arg to err must be niltyityipeektyoTyo demands number for 1st argmakereadtable: wrong number of argsmakereadtable: arg must be atomBad arg to cpy1copyint* : non integer arg@(#)lam6.c 35.3 7/8/81forkwaitpipefdopenexeceexece: non atom function nameexece: non list arglistexece: non atom argument seenexece: Bad enviroment listgensym%c%05drempropremprop: Illegal first argument :remprop: Bad property listbcdadONLY ATOMS HAVE FUNCTION BINDINGSstringpsymbolprematomprname%d%f"%s"prname does not support this typeimplodemaknam/impode argument exceeds bufferimplode/maknam: Illegal type for this arg:internnon atom to intern @(#)lam7.c 35.4 7/8/81ABMath functionsNon fixnum or flonum to math functionarctanNon fixnum or flonum arg to atan2Non fixnum or flonum to atan2random: non fixnum arg:makunbound%%machine-polyev:non-real argDecompose-floatDecompose-float: Non-real argumentfseekfseek: First argument must be a port.fseek: Second argument must be an integer.fseek: Third argument must be an integer.fseek: Illegal parameters.I-throw-errMakehunk*makhunk: Illegal hunk size*makhunk: First arg must be an fixnumcxrcxr: First arg must be a fixnumcxr: Second arg must be a hunkcxr: Arg outside of hunk rangecxr: Arg outside of hunk rangerplacxrplacx: First arg must be a fixnumrplacx: Second arg must be a hunkrplacx: Arg outside hunk rangerplacx: Arg outside hunk range*rplacx*rplacx: First arg must be a fixnum*rplacx: Second arg must be a hunk*rplacx: Arg outside hunk rangehunksizehunksize: First argument must me a hunkfileopenfileopen:args must be atoms or stringsfileopen:args must be atoms or stringsModes are only r, w, a.fileopen:args must be atoms or stringsUnable to open file.fileopen:args must be atoms or strings*mod*mod: Arguments must be fixnumslshNon ints to lshrotNon ints to rotgetaddress: arguments must come in triples Incorrect entry specification for bindingBad associated atom name for bindinggetaddress: Incorrect discipline specification Getaddress: Bad fileUndefined symbol: %s cprintfcprintf: first arg not string or symbolcprintf: Illegal second argumentprobefprobef: not symbol or string arg substringsubstring: not symbol or string arg substring: non integer index substring: not integer length substringnsubstringn: non symbol or string arg substringn: non integer index substringn: not integer length purcopypurcopy: can't purcopy array structures bad type to purcopy purep@(#)lam8.c 35.7 7/8/81Halloc2nd argument to allocate must be an integersizeofsegmentLENGTH ARG TO SEGMENT MUST BE INTEGERLENGTH ARG TO SEGMENT MUST BE POSITIVEforgetremob: non-atom argumentgetlengthARG TO GETLENGTH MUST BE AN ARRAYputlengthARG TO PUTLENGTH MUST BE AN ARRAYARRAY LENGTH MUST BE AN INTEGERARRAY LENGTH MUST BE POSITIVEgetdeltaARG TO GETDELTA MUST BE AN ARRAYputdeltaARG TO PUTDELTA MUST BE AN ARRAYARRAY LENGTH MUST BE AN INTEGERArray delta must be positivegetauxArg to getaux must be an arrayputaux1st Arg to putaux must be arraygetdataArg to getdata must be an arrayputdata1st Arg to putaux must be arraygetaccessARG TO GETACCESS MUST BE AN ARRAYputaccessARG TO PUTACCESS MUST BE ARRAYmarraygetentryARG TO GETENTRY MUST BE FUNCTIONgetlangARG TO GETLANG MUST BE FUNCTION DESCRIPTORputlangFIRST ARG TO PUTLANG MUST BE FUNCTION DESCRIPTORgetparamsARG TO GETPARAMS MUST BE A FUNCTION DESCRIPTORputparams1st ARG TO PUTPARAMS MUST BE FUNCTION DESCRIPTORgetdiscARGUMENT OF GETDISC ((MUST BE FUNCTIONputdiscARGUMENT OF PUTDISC MUST BE FUNCTIONgetlocARGUMENT TO GETLOC MUST BE FUNCTIONputlocFIRST ARGUMENT TO PUTLOC MUST BE FUNCTIONmfunctionreplaceREPLACE ARGS MUST BE SAME TYPEReplace: cannot handle the type of this argvaluepod2nd ARG TO OD MUST BE INTEGERfakeARG TO FAKE MUST BE INTEGERmaknumpnameARG TO PNAME MUST BE AN ATOMarrayrefFIRST ARG TO ARRAYREF MUST BE ARRAYSECOND ARG TO ARRAYREF MUST BE INTEGERNEGATIVE ARRAY OFFSETARRAY OFFSET TOO LARGEptrlctracesimpldLCODE WAS TOO LONGbad call to opvalfirst arg to opval must be an atom@(#)lamr.c 35.2 7/8/81,Profiling not enabled@(#)lamnop.c 35.1 5/6/81progIllegal local variable list in prog Illegal form in prog body throwgoIllegal tag to go toBreaking:Warning: defining function with nonlist of argsodd number of args to setqAttempt to set nilCAN ONLY SETQ ATOMS OR VALUEScshcsh-cshsh-c@(#)fex1.c 35.2 7/1/81More than 15 do varsdo variable must be a symbol @(#)fex2.c 35.3 7/1/81<savedlispDumplisp failedDumplisp failedCould not seek to stabUnexpected end of symsFailure to write dumplisp stabsavedlispDumplisp failedDumplisp failedCould not seek to stabUnexpected end of symsFailure to write dumplisp stab Could not seek to string table Error in string table read @(#)fex3.c 35.1 5/6/81syscallsyscall: bad first argument syscall: arg not symbol, string or fixnumstatus: bad arg liststatus: Second arg not allowed.featuresstatus: need second argstatus: need second argstatus: second arg must be atomstatus: only one character atom allowedsstatus: Bad argssstatus: cannot set this statusfeaturesfeaturessstatus: bad dump mode:on@(#)fex4.c 35.2 5/22/81$BAD CALL TO OPVALFIRST ARG TO OPVAL MUST BE AN ATOMBAD ARG LIST FOR OPVAL@(#)fexr.c 35.1 5/6/81@(#)fpipe.c 35.1 5/6/81@(#)subbig.c 35.1 5/6/81%d%d%09d@(#)pbignum.c 35.1 5/6/81Haulong: bad argumentHaipart: bad first argumentHaipart: 2nd arg not intInternal error in haipart #1Bignum-shift: 2nd arg not intBignum-shift: bad bignum argumentsticky-bignum-leftshiftbignum-leftshift%lx@(#)divbig.c 35.3 5/29/81XcfaslIncorrect .o file specificationIncorrect entry specification for cfaslIncorrect discipline specification for cfaslBad associated atom name for faslBad loader flags/usr/lib/lisp/nld -N -x -A %s -T %x %s -e %s -o %s %s -lcLd returns error status Couldn't open temporary file: %s PATH:/usr/ucb:/bin:/usr/binCould not find which file is being executed./tmp/Li%d.%d/tmp/Li%d.%dIncorrect entry specification.rwRemoveaddress: Bad fileraRemoveaddress: Bad file@(#)ffasl.c 35.1 5/6/810HTOֵV/],eUnUxVU U  iUV ` GUc<_Wfaslfasl: non atom argdebugging.o.orrCan't open fileappendmapwafasl: can't open map file[fasl %s]fasl: header read failedfasl: bad magic number in fasl filefasl: string table read error, probably old fasl formatfasl: string table read error %d symbols in symbol table fasl: Symb tab read errorsymbol %s ord is %d Unknown symbol %s bind_orglit_orglit_endtrans_sizelinker_sizeFile not in new fasl formatRead error in text Read %d bytes of text into 0x%x incore segment size: %d (0x%x) lin_cor_org: %x, link_cor_end %x Bad text reloc readRelocating %d (ord %d) at %x Ran out of counters; increas NMCOUNT in fasl.c Couldnt find ord # %d No free file descriptor for fasl lit_org %d, charstrt %d form %d read: link form read: ,type: %d redefined %s %x Eval: transfer table too large@(#)nfasl.c 35.2 7/7/81trantblinkermcountmcounts_qnewint_qnewdoub_qcons_qoneplus_qoneminus_typetable_tynames_qget_errp_Inonlocalgo__erthrow_error_setsav_qpushframe_retval_lispretval_bnpEval: 2nd arg not legal alist pointerNot in *rsetmode; second arg is useless - evalWARNING - Nesting 2nd args to eval will give spurious valuesIllegal pdl pointer as 2nd arg - evalevalevalhookevalhook called before doing sstatus-evalhookevalhook called while not in *rset modefuncallhookfuncallhook called before doing sstatus-evalhookfuncallhook called while not in *rset modefuncallhook: first arg must be a listrset@(#)trace.c 35.2 7/7/81TevalfArg to evalframe must be integerevalapplyInvalid pdl pointer given: freturnfreturn: 1st arg not pdl pointer@(#)evalf.c 35.2 7/1/81@!h@@@3@333333@Ay1?ϒy@!hI@!hB:IvDv6T1E r OER `EM2 fkCӴLE\QEYWF\*~`EM2 f@@@1@rzA]ݬ5@3elB#"3h@?ØGe@lB,k$d!r@AA@@@"@NnDOLX2xة3I䔶TX]1 D!L%dIgN5&GbqhDK->G?A@@AA@@OO@JGSrCu%طK@0qi9IE4Ÿ@;\)@3fG@@@@@M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/bin/shPATH:/bin:/usr/binsh@@A@@Ar  AAAAAABBBBBB /bin/shsh-c, ,D fasl cddr] Opus 36 /toplevel]̓,@Th|̭̝<P(P<ИԘĘȘܘxdxxd ,ȦdPx<P,ئx<|(Ƞܠ((Ȝܜ $0<HT`l((4@LXdp(Ȓܒ,@((e-write5owbindnd81<8*Dn,FF<̓,̓|>̓!U u)T\`hpx@1 (08ܠ@H(P $odformatER%errER%tplER%allER%miscER%brkER%undefER%unwind-protectfeaturesfeaturefranzunixvaxucbvaxnofeaturesyntaxuctolcdumpcorechainatomdumpmodeappendmapdebuggingbcdtracectimelocaltimeisattyignoreeofFranz Lisp, Opus 36versionautomatic-resettranslinkonundeffuncgcgcaftergcportgccheckgcdisablegcloadloadingnoautotraceARRAYBINARYINTERPRETEDMACROPROTECTEDBADPTRARGSTEMPTY??USERsklowerTERMCAP (08@HPX`hpx (08@HPX,4@xT`hpx|x$(,<P, TX08@@\`(PXȠ`d hHpxTlphhtx|| 08@(PX`Hpx<<ĘȘ̘ИԘؘTHLXXX\dltT (4tܘ 0@HX8hp`  $(, 00848H(X<`@DpPHLPxTX\`dhlpt x0(0@8@PH,P`XT`ph|px̭̭(<PPP̭x, ̭(x08<@<H@PX|`Xhpxx@D@<8ęh2|2621|hp2621|hp2621a|hp2621p|2621|2621a|2621p:is=\E&j@\r\E3\r:bt=\Ei:cm=\E&a%r%dc%dY:dc=2\EP:ip=2:kh=\Ep\r:ku=\Et\r:kl=\Eu\r:kr=\Ev\r:kd=\Ew\r:kn#8:k1=\Ep\r:k2=\Eq\r:k3=\Er\r:k4=\Es\r:k5=\Et\r:k6=\Eu\r:k7=\Ev\r:k8=\Ew\r:ks=\E&jB:ke=\E&j@:ta=2^I:if=/usr/lib/tabset/stdcrt:al=\EL:am:bs:cd=\EJ:ce=\EK:ch=\E&a%dC:cl=\EH\EJ:co#80:cv=\E&a%dY:da:db:dl=\EM:ei=\ER:im=\EQ:kb=^H:li#24:mi:ml=\El:mu=\Em:nd=\EC:pt:se=\E&d@:so=\E&dJ:us=\E&dD:ue=\E&d@:up=\EA:xsTERM2621SHELL/bin/cshPATH/etc:/usr/ucb:/bin:/usr/bin:.HOMEenvironment//usr/lib/lisp/auxfns0Non-list to append:Non-list to append:protect-listprotect-evformdefmacrooptlistdrdefmacroargdefmacro-for-compilingcompilec&rest&optional&protect&auxacaexprfexpr::1-let*letniresult<assoclsignp-argleegegbad arg to signp GFloating Exception Interrupt: [ut:%]:{%}; $gccount$ptimeatlastgcgcafter-panic-modeP<( h $,048x@hDL(<PPP8̭xPX`,p̭x<<@|`x@ (08@XHPxhpxx|`|4ș0̙(,Й 8(ԙ0H$@X Ph`xp@  ̭0,d8̭((P8 ̭0,:@<8H,0X@`, p,x, ܬȬ,@ (08@XHPxhpx@x@ @(0@xH`p̭(̭(<(<(<(hP\`dh`TD(P`hPtxHP@HL<̭,(( L0H@K@̭8dLPhd`̭XPphK̭xxLḼ<<<̭ (08@HPX`hpx (08@HPX`hpxpCpCC@pCpC08@HPX`hpx (08@HPX`hpx(([Storage space totally exausted]Space exausted when allocating $gc_midlim$gc_minalloc$gc_pct$gc_lowlim$gcprint[Now in storage allocation panic mode]bad arg to assoc%\`,|~; too few args to delete non list arg to delete too few args to delete non list arg to delete exedit_file.l () . ) () . ) -lI77 -lF77 -lmtype (help fnc) for info on function fnctype (help n) to see chapter ntype (help tc) for a table of contentsBad option to help tcTable of contents1 - intro; 2 - data structure; 3 - arithmetic; 4 - special5 - i/o; 6 - system; 7 - reader; 8 - functions; 9 - arrays10 - exceptions; 11 - trace package; 12 - Liszt;14 - step package; 15 - fixit packageb - special symbols; c - gc & debugging & top level b/usr/ucb/ul /usr/lib/lisp/manual/ch.r | /usr/ucb/more -fUnknown function: appendhelplocation[Reading help index]`ȰP| | 04X8x<dht|P`\<P(<8x@HX`h(Px̭(P|(P|,@<x̓( @̭h`p<<(<<<P<PT=/usr/lib/lisp/manual/helpindex /usr/ucb/ul /usr/lib/lisp/manual/ | /usr/ucb/more -f "+/("hunk: size is too bigload: illegal filename load-search-pathload: file not found /.o.lmakhunk: size is too bighunk'() . cshbad file namesort-functionoldnewvi*arrayno bounds to array declaration fixnum-blockflonum-blockarray: bad type: arrac-oneDarrac-twoDarrac-nD wrong number of subscripts to array: wrong number of subscripts to array: wrong number of subscripts to array: arraycallsegment-sizessmall-segment: bad type segment-typessegment-arraysnon array arg to arraydimsNon array to listarray defmcrosrchnreverseconcatldefmcrooptionlambdacvtde-composenconcreverseerrorsubst*breakdiffmaxprtpagesusedcopyexviexplodelastexplodecexplodenexptoddplengthgetcharlist-to-bignummacroexpandprincsortmergesplitlistuncvt 8a560 e-cvtas 8a724 e-cmp 8a9ec e-docomment 8aa17 e-goto 8aab3 e-gotonil 8aad5 e-gotot 8aafc e-label 8ab23 e-move 8ab49 e-pop 8abb5 e-pushnil 8abf7 e-tst 8acdd e-setupbind 8ad04 e-unsetupbind 8ad31 e-shallowbind 8ad5e e-unshallowbind 8ae18 e-dropnp 8af40 e-jump 8af84 e-return 8b00b e-writel 8b032 e-write1 8b0d7 e-write2 8b182 e-write3 8b257 e-write4 8b356 e-write5 8b47f op 8736a d-handlearrayref 8751f d-dostore 876f2 d-arrayindexcomp 8788d d-fixnumexp 87acc c-fixnumop 87aff d-fixexpand 87b46 d-toplevmacroexpand 87e1f d-collapse 87ed4 d-fixnumcode 88156 d-shiftcheck 8848f cc-oneplus 884e7 cc-oneminus 88741 cc-< 889ec cc-> 88ad6 c-\ 88bc0 d-fixop 88be8 c-assembler-code 88f23 d-cmp 88fa0 d-handlecc 88fed d-invert 8903f d-noninvert 89166 d-macroexpand 8928d d-makespec 89303 d-move 8932e d-simple 8941b d-rsimple 897f8 d-movespec 898bf d-specialp 8995a d-tst 89985 d-typesimp 899bd d-typecmplx 89aba d-allocreg 89c13 d-bestreg 89d08 d-matchcnt 89e71 d-clearreg 89efc d-clearuse 89fb0 d-inreg 8a009 e-cvt 8a047 e-pXWZVPZ~Z|jЪP1xjP@ﺨPxPPP*hjԆSPSPWuWVPjTФԆSPЪ xjP@^PxPPP+ШjԆeSP\SPWCuWV*кj"Ъ jTФԆ0SPQvPQ`` PЪ PЪ`ЪPVЎZoXW~VZWVPj~jP@P@1պxjP@ P1j j#jPjRPjкP@ЭպxP@J ЪPKкP@ЭЪLPѪ Ѫ#ЪPQPVnXWZVШjWsWVnXW~VZWVPj~jP@ѺЪPjкP@ЭЪWsWVPкP@ЭPѪ Ѫ#ЪP1QPmXWZVЪժPjЪTФPvPTP PкmXWZVШ ШкTdSУԆPPPPкTФԆPPPPPLmXWZVШШкTdSУԆPPPPкTФԆsPPjPPaPlXWZVԆԆԆԆԆԆԆEUиШЪиШЪи Ш Ъ UкTdSУШ$ԆWqWVPШ(кTФШ,Ш0Ш4ԆЪժ8P Ъ8TФP`Ъ4OP4к88VЪ4WqWVVPԆи ժ<P1tЪP>P>PЪLTдSգ7Ш<ФRТУԆ>P>P>PԆy>PPԆW`WVPY>PШLШ<ЪLTФSУȴdԆ2>P)>PԆ>P>P >PЪLTдSc,Ш:1fWn\WVPЪWk\WVP Ш4ЪԆ9PԆЪ ժ,PeЪ,TФШ<к0Ъ0TФЪԆ9P9PԆ9P9P9VPЪ(9P(к,,VЪ(W[WVVPԆW}[WVPT9PK9PЪԆ<9P39PЪ&9PкTd1SUXWZVкTФdԆԆԆԆԆЪЪժ P14Ъ TФx$P@留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<TTTPTMTT,T(TT<T<T(TTPTMTTT<TTTTTTTTT,MT@MTȬTTMTTTTTxThMTȼT|MTT,TMTMTMTMThTMTTT(TTTTTTThT|TTTTThMTxTTTTThTTTTTT(TTTTMT<TPTTdTxTTTMTT,TxTTTMTTTTTT,T@TTTTȸThT|TTTTTTTT(T<TPTTdTxTTTTTMTTTTTMT<T,T@TTThT|TTTTTT(TMTTTTTMT4ThT4T4TPTThTTTTT(T@TTThTTT|TTTxTTTMTTTTTTT4T@TTTxT4TTMTT4T5ThTTxT5T,5T|T@5TT5TTh5TTܮT|5TT,T5T@MTTThMT5T5TT5TȸTT5TTdT8TMT8T(8(((( $,4@<DȜLhTPTXܼhpxXdx0(,  (8$H0P@8|DTdhtxdȼԼ@ ,Ldhpнmergelistssortcarhelpexchange2sublishelpsubsteqsubstequalsmall-segmentfillarrayarrayminarraydimsSCCS-auxfns0@(#)auxfns0.l 1.29 7/9/81back=quotify/usr/lib/lisp/backquotebackquote**backquote**comma not inside a backquote.,@,.franz-symbolic-character-namesIllegal character name in #\Bad character after #Unknown form after #+ or #-feature-presentSCCS-backquote@(#)backquote.l 1.4 3/7/81back-quote-ch-macroback-quote-comma-macro1+#h1ؙܙ 0@XPh`x̽px0d0xKKоKKhK@(*@H,0X@`, p,x, ܬȿȬпؿ,8`P$(T,8h<xDHPTxX\`hh1px̭,(( L0H@K@̭X(̻8dL`xdp̭hPhK̭(xLḼ<<<̭J@@A%BiBBB"CC̓;HIIN̓NOsOOQRESSRUzUU4V]VWXcXXY (08(@Hd`x2p$4DLhT\dlptx|<<hKhKL(0hKhLPX`HLxpL LLKJ(@T8̭0,H,@hPX,A,A̭x@̭,̭T@A@A̭( ̭@8̭0TP̭p̭h̭`̭xܴ̭ThP|ȴ@A(@A ̭Hȴ@̭8ph0X̭PT,A,A̭̭(0̭T ((8@H̩dhp@x8 (008`@h|DL\dnreconcpluspprog1shellsloadsortsortcarsublisvilxconsev-arraycallstorestoreinternfillarraylistarrayabsbcdcallchrctcharcntnumbpremainderterpritypepsymeval=>*dif1+$1-$*$/$+$-$//usr/lib/lisp/auxfns1B NPprintblanks linel$fileopen$$outport$FAVbad arg to pp: pp: atom is unboundpp: function is machine coded (bcd) T-nargsT-arglistoriginalm . msgmakenthcdrcondclosefile+Zr[[x\]]]H^___\``̓a̓>a\aad=edef]g]ijkm(nop   ̓    ,g̓%>Y6vD D$z$$$&&Q'()(+,,̓P@Q̓u1wB} ,A ,A̭H8P@̭(`X̭PTxp@A@A̭x̭@̭Td,A,A̭ḓ @̭TP0,AP,AH̭@hP`̭Xx̭pT<̭<̭̭T@AVc bc |c c c c c c c d d .d Jd jd zd d d d d d d d e e e 8e De qe e e e e e e f *f 6f ff qf zf f f f f f f )g 4g =g Pg mg zg g g g g g g h 0h Bh Oh [h ~h h h h h h i i /i Ai Ni Zi }i i i i i i j j .j @j Xj jj wj j j j j j j k -k ?k Wk ik k k k k k  1 %,>3k:'ALWan4 u~) ((aXWZjVѸ#иPuPUиhjUfW4WVUХUVPWWVyXWZjVѸ Ѹ#иP8uP_UиhjULиP`%xP@ ШWWV1fWWVP)fWWVШfWZWVPtYfWZWVP)fWLWVШ fWWVPtШfWWVP~tUХUsOXWZVԆԆԆԆԆxjP@!PxPPPШjԆ(tPt1JjTФPPdP17xP@PxPPPФSУQШPPQ1z`PjTФW=WVPкW'WVPxP@tPxPPPԪШxP@QPxPPPԪ Ш ժЪTФPPԪШԪժWxP@PxPPP>ЪTФPP0ШкTФкSУrPԆrPrժ$кTդШ ЪԆrPrVժ+ЪTФPP Ш ЪкrPr&Ш$ЪЪԆrrPirP`r1jTФSУPP7Ш(cdWWVPԆ)rP rPrCУPP 7Ш,cdWsWVPԆqPqPqPXWZjVԆԆfWIWVPjj< jTЏ Uи0Ш0Ъ0UfWWVPԆbqeUХUWV1j=fWWVPЪWWVPfWWVPP1j=fWdWVPЪWvWVPfW=WVPP1jfW>WVPԆp1^jx:ЏЏ|fW WVPW WVPԆXp1j3Ш4fWWVPԆ0pP'pPԆp1j j,fWrWVPWWVPԆo1jprfW=WVPЪи8ժ P#ЪЪ TФSУPvPSP Pк V`jjШ<ЪWWVjԆbo&Ш@jWWVPW”WVXWZVxjP@PxPPP2jШDWWVvQP Q `PPPPP1jTФPPH$dSУW]WVPШPP1ѤL:dժиP'ЪTФW#WVPP PкVVѤP:dժP)ЪTФWWVPиP PкVШTTWWVr,@h̭<(Th|@p|X<2<X@ Hp`xh  @A̭( ̭@8̭0T(Pph̭`(̭x̭TX@A@A̭̭̭TL0(̭ HL@̭8`̽X̭PTp@A@A̭̭̭̽Ṱ̭ ̭T0@AP@AH̭@h`̭Xx̭pT̳̭̭̭̳̭̭T,A,A̭( ̭@8̭0TP@Ap@Ah̭`̭xx̭Ṱ̭̭̭̭T|,A0,A(̭ H|@̭8`X̭PThp,A,A̭h̭̭TT,A,A̭Ṱ ,̭T@0@AP@AH̭@h@`̭Xx̭pT,@A@A̭,̭,̭T,@A@0<8D<PTX(08P|`H$@,4P@lpx<$prpr$prdf$tocolumn$patom1$dinc$prd1linelengthSCCS-auxfns1@(#)auxfns1.l 1.1 10/3/80nthnthrestlistpapply*$x$pp//usr/lib/lisp/toplevelfranz-not-virgin+++++*****break-err-handlerfranz-resettop-level-catchbreak-catchdebug-level-countbreak-level-counttpl-errlistuser-top-level-> top-level-eofGoodbyeEOF[Return to top level]Error: debug-err-handlerD<>: contuablocalcall<>: Can't continue from this errorretbrkerrlist h(|x,@0T<P@`h̥p<@A̭(, ̭@8̭0TP@Ap@Ah̭`̭x̭T@A@A̭̭̭T@A0@A(̭ H@̭8`X̭PTܲp,A,A̭̭̭̭ܲTȲ̭̭̭Break /.lisprc/.lisprcError in .lisprc file detectedautoload[autoload ]Autoload file does not contain func -f:From lisp autorun: can't find file to loadCan't find file to execute /debugautorunlispread-in-lisprc-fileold-reset-functioncvtsearchpathtolistload-autorunobjectSCCS-toplevel@(#)toplevel.l 1.5 7/9/81QQ00000franz-top-levelundef-func-handlertrace/usr/lib/lisp/tracestep/usr/lib/lisp/stepmylisp//.lisprcnlisztlisztDP,P(@lph,x(8:x: :Ȳ̭ ṰT0̭P̭H̭@h`̭Xx̭pṰ̭̭̭,@̭T@A @A̭H@T0̭(X@xp@,hT|8@̭88̭̭<( ̭̭8̭<XTP̭@pHh̭P`̭,Ax,APṰ̭ܰP̭,A,APṰ0(̭dH @̭,A8X,AdxTp̭h̭x̭,A,AxPṰ̯ ̭̭0̭̯PTH̭@̭hxpX̭̭̭ṰP̭̭̭̭8T0̭(P(H̭h@`̭̭Xx̭Ṱ|̭(̭,A,A(Ṱ̭T( ̭h@8̭̭0P̭hpTh̭`̭|x̭@A@A|Ṱ<̭̭@A@A0T(̭H @̭`8X̭̭Pp̭Ṱx̭̭̭̭Ṱ<̭(( ,A0T(̭(H @̭`8X̭@APp@AṰ̭̭,A,AṰ<̭, ̭,A0,A,PTH̭|h@`̭@Xx̭@Ap@A@Ṱ̭Ṱ̭̭TT@A(T ̭@8̭X0P̭@AHh@AṰx̭Ȯ̭,A,AȮ T ̭(   ̭ܮ@  8 ̭,A0 P ,Aܮp Th ̭ `  ̭ x  ̭,A  ,A T ̭   ̭  ̭,AXXWZVjTФj.hЪԆWqWVPKPԆK1Ѩ ШPPѨ FШЪԆWYqWVPKPкЪW?qWVPfK1fxP@4PxPPPkШШЪԆ6KP-KPЪԆWpWVP KPKPкЪWpWVPJ1ШЪTФPvP*кdԆWpWVPЦjЦV1ѨQШ dЪԆJPWApWVPpJPкЪW'pWVPNJOШTЪԆWoWVP(JPJPкЪWoWVPIE XWZVjЪЏWoWVPPBШ$ЪWoWVѪ Ѫ#ЪPfIP XWZVjи(P.jTФPxPP@6PxPPP Ф(и(Pи(P XWZVи(P`UU~jWnWV`UUUHL XWZVպxjP@ ЪPajЏWnWVPԆЪH7j j#jPfHPjкЦjЦV XWZVjЪWBnWVРP XWZVjЏWmWVPЪP7j j#jPGPjкЦjЦV, XWZVxjP@樂PШ,PjШ,PPPP XWZV||Uи0Ш0Ը0и4Ш4Ը4Uyи84jTФfWLmWVи,P1PxP@1MШЪTФѦWmWVP-VfWlWVкTФWlWVP41Ш<ЪTФѦWlWVP2VfWlWVкTФWlWVP4и,01Ш@ЪTФѦWjlWVPVи, кTФhШDЪTФPvPШH dSУHfWUХХUXWZjVո0-и4WiWVи4WiWVԸ0и0PPXWZVШ4WQiWVPи84Pи4W"iWVjЏЏW+iWV3XWZ VUиpШpЪpUЪWhWVxjP@PxPPPgиpP`UU~jи4WhWVPWhWV`UUUAPи4WhWVPW hWVPjи4WyhWVjP1-иtWihWVP1ЏjWRhWVPWgWVPjTФPxPP@PxPPP||jTФШxW hWVP ЏPЏPPjTФи4WgWVjTФPPШ|ѦW=gWVPԪVШ,ȀWgWVfWgWVP кк ~ժ1кTդ(ФPxPP@PxPPPԪШ,Ԫ ЏPЪP`UUU5@PW"gWVкjjP`>ժ кTФPxPP@TPxPPPи4WpfWVP1IPVOԆfWfWVP jЪ WfWVкjи4W"fWVPPVPP؄WPfWVPUХUXWZVjTФЪdjѸp# иpPi?pPNxjP@fPxPPP2ԪЏиpjWeWVPWeWVиpPPWueWVժ-ȈWeWVjи4WheWVjPPPGXWZjVȌW|eWV`UU~и4WeWV`UUUA>XWZVк~и4WxdWV`UUU >PjjЏWeWVPOЏѪjP9Ȑи4WdWVѪ#ЪP=PVP[XWZVи(P`UU~jWcWV`UUUd="XWZVjи4WcWVȼḓ,(P<Pd\,lxȰ<XWZjVhWbWVPո1иԸԸ ԸԸԸԸШ$ Ш(Ш,PРWebWVfW`bWVP?Ш0WRbWVPWIbWVfWDbWVfW?bWVPPԆԆԆP1Ш4PP>fl-vmsLISZT-CowqTpvu?Error: %.2f: : Unknown switch: Extra input file name: No file for input.lCouldn't open the source file :tty/tmp/jkf.s.sCouldn't open the .s file: .o.ovp-xfilev-xfile.xCan't open the .x filebasettymacsyma-env/usr/lib/lisp/machacks/usr/lib/lisp/ucifnccc-ignorefl-exprccfl-exprCompilation begins with source: , result: liszt-root-nameliszt-file-name.globl mcount<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ХUCbVWWVW WV,bU00Ъ0UaЪ WWVaUХUaVfWWVѸX#иXPpPXXXVк1'VЪPXWZVPXWZVjTФTиTPXWZVjTФببPXWZVԆjЪժP`ЪTФЪ شP9Ъ fW(WVPЏȻPشWrWVPVкVЪPZ~Z||||||jTФЏժ4P1Ъ4TФPvP6ԪѪ8 Ѫ8#Ъ8P P88813Ѫ8 Ѫ8#Ъ8PϺP8881k9,ԪԪѪ8 Ѫ8#Ъ8PP8881*ժ1"ФЪPxPP@nPxPPPOЪԆxPЪ8kPЪ^PЪЪLPԆЪ 

WVPкԆWOWVPPPԆкPPԆWWVPWWVPWWVP>P5PЪ WWVPԆWWVPPԆPP4VЎZFXWZjV<WWV#XWZjV@и@WWVD-,P̑|hT@,<ܐȐxdP<(xd<x<<<<<<;<==,=@=h=|=====<=>̽@@(@<@P@d@<x@<@4>@>H>L>P>,d>B|>>>>>D>>>>>@@??xB@| BTh0B@@@AP?A,A@A???TAhA?|AA FFF F@FHFLF\FxFDDFFFFFF FFFAF|GG GDG\GpGAGȰhA@@BGGHHd,AJ@HPHJpH̓HH(JHHassembler-codec-assembler-codefixnum-cxrcm-fixnum-cxrinternal-fixnum-boxc-internal-fixnum-boxoffset-cxrcc-offset-cxrlisztinit*fexprunspecial*expr*lexprmacarrayspecialslocalfv-form%Warning: %.2f: : bizzare function name ?Error: : : bad expressionstackcallingcalls$0*trantb+(r0)catcherrsettailmerging%Note: : : Tail merging being done: addl2(sp)Nil arg only allowed in lexprs̓̓̓a̓̓̓1̓̓̓̓̓ə̓̓1Ti=5n?oSAZ;#\*L/Z  G k     > 9KdHPX@`x<hM̷(pxLxP(xJLȾо<<<< x8@̝hPX`ܰpx@ܺȼмdP<@̭dd K0@<PhK`̭@hKKȽKؽKKxd0 arg expression is for non local lexpr immed*-4(fp)[r0]*-4(fp)[r0]-8(fp)*-4(fp)[r0]*-4(fp)[r0]-8(fp)xx-valxx-lis$1783$5$9tstl_retval_lispretvaljbrpushl$_qpushframe_errpbeginningbad cond clause _qconsCstackunCstackmovq_qnewdoubmoval_qnewintvstackmovaq-(sp)*(sp)+-(sp)*(sp)+unstackbind$3cmpl-8(r6)-4(r6)_qnewint$516Wrong number of args to get _qgetgo label not found for expression: P8Td8 Ȭ @4d<dltAx,KhĿ8DLP,l<,t-A|-`<: non local go used : : Go through a catch or errset expressionclrlXidentity4(r0)(r0)d-locd-tstd-moved-handleccd-cxxrcc-cxxrd-callbigd-handlearrayrefc-lambexpd-expd-dotailrecursiond-pushargsd-bcdcalld-calltrand-calld-tranloce-gotoe-labele-tstd-typecmplxd-typesimpd-pushframed-popframee-cvtd-expsd-supercxrd-fixnumexpd-simpled-semisimpled-structgene-gototd-superrplacxd-bestregd-movespecd-allocregd-inreg(-xȸ@=,( @x< <(<@0<8<DP\P<hp8x@-<-P@H<X(<-ܨ <dLH<x*,*, *,(*-4*-<*<H*<T*,`*<̝l*<Pt*,*<*<*<*<J*-*,***++@]XWZV3UиhjU2||xP@PxPPPbиWoWVP ոոЪ WWWVPЪ иWCWVfW>WVЪ P1иPРЪPxPP@,PxPPP1ո @ЪиP.ЪиPЪииWԶWVPЪWƶWVPѨЪиWWVP1ЪШ P Ъ WWV1ЪШ$ZP Ъ W_WVP1ЪШ(-P Ъ W2WV1Ѩ,Ш0P/PѨ4Ш8PPЪWWVP &P иP`TФЪ WWV1!Ѩ<@ЪШ@иP`ԆP︋PԆוֹPԆWWVYѨDѨH3иWWVP ЪиP`ԆWaWVѨLfW[WVP1ШDЪTФPvPfW>WV1Ѩ@ ѨP1ZոT14ШXWWVШ\/Uи`Ш`Ъ`U/иdWWV/UХU/VШhWWVШ\/Uи`Ш`Ъ`U/иlWWVh/UХUZ/VШpWdWVШtWRWVШ\)/Uи`Ш`Ъ`U/ЪPWWV.UХU.VfWWVPкTФиP`﷉P1ШxWƳWVШ\.Uи`Ш`Ъ`U.иdWWVp.UХUb.VШ|WlWVШ\C.Uи`Ш`Ъ`U..иlW;WV.UХU.VȀWWVȄWWVШ\-Uи`Ш`Ъ`U-иPWȲWV-UХU-VfWWV؈#؈P2P؈؈؈ȌYոոȐWWVPOиQȔPP+Q`P((ոȐWWVPȐиWWVոfWWVPPV,UХU,VXWZVԆԆxjP@dPxPPPxUExP@BЪWWVxP@ ЪTФPPPѪШPjؘP ЪPШDPШDP.VXWZVjԆԆԆ+U؜ȜЪ؜иШЪ иШЪU+պ ЪTФPЪTФWǰWVк+UХХХUk+VPWWV~UXWZVj1jȠԆԆ-+U؜ȜЪ؜иШЪ иШЪU*ժPTЪTФWWVԆؤƅPؤب#بPwPبببк*UХХХU*VPTXWZVjWWVPȬЪTФPvPddԆԆPPЪTФ dȰ ЪP5P1(ȴ ȸ Ъ ЪPPк VPTXWZVԆjԆﰄP龍PؼPؼЪWͮWV`@ŏUPUPWWVPЪW~WVPLSXWZ VjЄPԆjԆP߃PؼуPؼjЪWWVP1ժ zЪW WVЪ TФWޭWVЪW|WVPЪؤWɭWVPؤبP`UúUUÂPب1Iժ=ЪWWVЪWWVPЪWrWV1@ЪWGWVЪWլWVPjЪW4WV1Ш@jԆPPЪԆW WVPqPWЬWVjЪW[WVP#PPPPЪWWVЪؤW}WVPؤبP`UúUUwPبfW{WV QXWZVŏU@P度PWWVjWWVPWWVPWWVWWVcPXWZVjPnjPP`UxUUuPjЪWWV#PPЪPVOXWZVUŏUUPkPWWV WWVWsWVWVWV.OXWZV؜1jlЏؤժ иPtЪ TФPxPP@6ФSУPvPcЏW>WVPP+P Ѫ#ЪP2Pк VP1O $ؼ3PؼP(1 ,W6WVШ\ $Uи`Ш`Ъ`U#иdWWV#UХU#V0WۨWVШ\#Uи`Ш`Ъ`U#иlWWV#UХUw#V4WWVШ\W#Uи`Ш`Ъ`UB#иWOWV*#UХU#VfW3WVPؤب"UبȨЪ بؤȤЪؤU"ЪW%WV"UХХU"VԆԆ8HG<@DWȧWVH@LPWWVPTЪW>WVP Ъ ŏ U|PЏպxP@ P1ЪXԆ|P|PЪЪԆ|P|PWWVѪ Ѫ#ЪP[|PU{PU{Pvv1J Vx U{PЪԆ5|P,|PXWnWV\W˦WVVиPP(KXWZjVfWWVPԆиP`P`PPиP`1$Ԇj{PԆԆЪ U؜ȜЪ؜иШЪиШЪ Uu պ ЪTФPЪTФWWVкC UХХХU+ VPWNWVո_fW̥WVPЪWWVjWWVdиWWVЪWWVjWqWV17ո иP`jPԆj{zPԆԆЪsU؜ȜЪ؜иШЪиШЪ UAպ ЪTФPЪTФWSWVкUХХХUVPWWVոtfWWVPЪWzWVjWyWVdиWRWVиP`W=WVЪW;WVP VfWWVHXWZjVfWWVPfWWVPѨH81ШxW*WVШ\Uи`Ш`Ъ`UиdWWVUХUVШ|WТWVШ\Uи`Ш`Ъ`UиlWWVzUХUlVȀWuWVhWbWVfW]WV؈#؈PwP؈؈؈Ȍ PиP`WWVP1lpPРиP`TФPvP1eШxWȡWVШ\Uи`Ш`Ъ`UиdWWVrUХUdVШ|WnWVШ\EUи`Ш`Ъ`U0иlW=WVUХU VȀWWVtWWVШ\Uи`Ш`Ъ`UиWϠWVUХUVfWWV؈#؈P9vP؈؈؈Ȍ`TPոո1иP`TФPxPP@PxPPP1ФЏWWVPxиP`TФԆuPuPȐWWVWKWVո|иWWWVȀWZWVfW=WV1иP`Tդ,ФպxP@& ШPPPVPFոȄиWޞWVPиPՠиPРWWVP1`ȐԆjtPԆU؜ȜЪ؜иШЪ иШЪUШ4иP`TФԆtPtPWWVqUХХХUY VոȈиWWVȌWWVfWߝWVЪWŞWVjWĞWVո&ȐиWWVfWWV#иPՠиPРWjWVPЪWdWVPBXWZjVȔȘиP`TФԆ[sPRsPȜиPаTФȠ3sP*sPԆsPsPȤsPr/BXWZjVиP`TФȨWWVBXWZjVЏиP`иWWVAXWZjVиP`TФȬWcWVAXWZjVиP`TФȰW5WVuAXWZjVȐԆԆfWWVPfWߜWVPU؜ȜЪ؜иШЪиШjUиP`TФWWVЏȐԆWWVȴȸWWVȼЪWћWVWWVЪ WWVЪWWVиPаTФWQWVЪ WכWVfWWVؤP`ؤfW{WVUХХХU?XWZ Vժ*ЪWWVPWߚWVPժ*ЪWgWVPWWVPjWߚWVPW~WVWfWVWAWVؤoPؤؤP>XWZjVWWVoPWϙWV>XWZjV ؼQoPؼPиP`fWWVPԆԆԆjժ6ժdȐW͘WVPЪWǙWV1RjTФPxPP@PxPPP1iШxWWVШ\Uи`Ш`Ъ`UиdWWVUХU|VШ|WWVШ\]Uи`Ш`Ъ`UHиlWUWV0UХU"VȀW+WVWWVШ\Uи`Ш`Ъ`UjTФWWVUХUVfWȗWV؈#؈PNmP؈؈؈Ȍuw1մ1ոոȐPPPЪԆ7mP؜պШԆԆ U؜ȜЪ؜иШЪиШЪUjTФSУW WVUХХХU V1иФSУPvP'УѦWWVP|VոոȐPPPԆ[UиШЪиШЪU9jTдW3WVUХХU Vи1VԆԆfWWVPЪkPԆU؜ȜЪ؜иШЪиШЪUjTФSУW•WVUХХХUm VWnWVP ոոȐPPPԆ5UиШЪиШЪUjTдW WVUХХUVպժЪWWVPЪWWVЪ кj1oVfW*WV9XWZjVиP`WՔWVWWVؤPаؤبP`UUUiPبfWWVN9XWZjVиԆW"WV*9XWZVиP`TФdSУԆԆԆxP@PxPPP xЪԆiPiPЪWWVЪ WWVP1Ѫ1Ъ WWVPЪWWVPȐԆ&UиШЪ иШЪUЪ W)WV UХХU VѪժЪWkWVPPj1ЪЪЏ WWVP ЪWWVWWVfWϒWVո!ѸȐȐиWӑWVPиPՠиPРWWVP1ЪЪЏW WVPո"jPиWWVPPժ1ժЪЪWÑWVЪЪWWVjm WWVfW‘WVѸȐȐиWːWVPиPՠиPРWWVP#иPՠиPРW WVPYոRj%иPՠиPРWRWVP$ȴЪW͐WVfW0WVP5XWZVjWrWVP}xjP@j$jTФPvPYdSУPxPP@C(УRТPvP1bWЧPxPP@ﹺШ@ЧQСPvPPШPPPP4XWZ VxP@v1ЪTФPPȠqxjP@UjW&WVP,кTФԆEePoWVШ\Uи`Ш`Ъ`UиdW oWVUХUV0WnWVШ\Uи`Ш`Ъ`UиlWnWVUХUVȰWnWVШ\_Uи`Ш`Ъ`UJиWWnWV2UХU$VfW;nWVPЏЪЪѦWnWVPVP/fWnWVѪ#ЪPCPVPЪWfoWVЪ ЏW-nWVPЪ W?oWVPЪWnWVPnPPЪTФPxPP@ $к ~дP`UUUBP кЪP&dѪ#ЪPBPкj16XWZjVPXWZjVոոȐPPPԆUиШЪиШjUШDЏeBPؤWBPؤиP`WlWVиPРWnWVfWlWVUХХU 1XWZVкTФWjmWVԆlAPlfW[lWVкTdԆԆԆU؜ȜЪ؜иШЪ иШЪUպ ЪTФPЪTФWkWVкMUХХХU5VPWXkWVlP`lfWlWV1XWZVjWlWVPؤЏبWlWVPժ^fWlWVԆЪЪժ P+Ъ TФЪTФdW{lWVVк VfWilWVPXWZVj1jTФW@lWVPԆժ"Ѫ#ЪP?PPպHккЪѪ  Ѫ #Ъ P?P WkWVP кTФPЪ`ժЪjTФQvPQ;jTФȠЪ Ԇp?Pg?P^?PЪQ?PЪPVPrXWZjVԆиP`W+iWVPj ȴؼ?PؼPպ,xjP@Ɠ dȐWhWVP1PиP`W!iWVȸȼWhWVЏjWjWVPպxP@J PtWhWVfWhWVѺȐȠWgWVPѪ Ѫ#ЪP=P1sVjؤWPhWVPؤبP`UúUUJ=PبP XWZV||||ԆWiWVPԆк WciWVPժ8P1Ъ8WwiWVPժպ<DЪ@ЪLkL'O4T)UVWQWWXDZd]^B_Mc{ccbgcidknVppjsuvxzzF{~~VA֊#?f.*-4(fp)[r1]$1return used not within a prog or do%Note: : : non local return used wrong number of args to setq ashl$-9cvtbl_typetable+1[r0]_tynames+4[r0](r0)_InonlocalgorefdoingWrong number of subscripts to array jsb_qnewintInternal fixexpand error Illegal operand in fixnum op arithequivjleq_qoneplus_qoneminusjgeqjlssjgtrediv(r0)-(sp)(sp)+ashq$-32_qnewintassemblercodestartendfromtocdar .|.hA.T....L/PX/P`/l/x////x//K/̑//Ȩ//<///2x0202(2@282̽P2H2X2h2x2D2D2D2h12|112h12|112̝2212hK3̽hK@K@KLL83dH3dX3`3h3p3x333333333333333336 6M,6\666M6,7<P7,7<(7@<070-|<78-H7P-(\7h-h7X-x7`-7p-47-7=7X<7-L7-70<7raccbad arg to d-simple: fromspeccmpb_typetable+1[r0]_typetable+1[]bitw bad arg to e-cvt : bad arg to e-cvt : *()[]()+-()$$ #clrqsubl2ret:# , ,, ,,,d-classifye-pushnild-bindprge-moved-clearused-dostored-arrayindexcompd-fixexpandd-fixnumcoded-toplevmacroexpandd-collapsed-shiftcheckd-fixope-write5e-uncvtd-rsimpled-noninvertd-matchcnte-jumpe-docomment<7p<7`<::@:0:8:h<h@:8888899,9@9T9h9|999999e-cvtassectioncddrid@(#)cddr.l 5.14 7/1/81-(sp)(sp)+e-cmpZq G`$ժ#Iݬ1^@ 2װWV(=0=8=@=H=P=X=`=h=p=x=================((kXWZjVhиP`TФШ P kXWZjVո Ши PPոyиP`иPР PԆUи Ш Ъ иШjUwиP`TФW7WVXUХХUEV1dfWy7WVPfWi7WVPԆUи Ш Ъ UjԆ PԆUиШЪиШЪ UʯиP`TФW6WV﫯UХХUVШ$иW6WVиPՠиPРW6WVЪW6WVjW6WVШ(иWt6WVиP`иP`W_6WVPЪWQ6WVUХUޮ ViXWZjVиP`TФШ,W6WVciXWZjVfW5WVPԆиP`PШ0PPиPՠ1.jԆ\ PոШ4PPPԆЪFUи Ш Ъ иШЪиШЪ Uպ ЪTФPЪTФW15WVкUХХХUͭVPW4WVո^fW4WVPЪW4WVjW4WVШ4иW4WVЪW4WVjW4WV1Cո иPРjPjԆPոШ4PPPԆЪUи Ш Ъ иШЪиШЪ Uجպ ЪTФPЪTФW3WVк怜UХХХUVPW3WVոtfW3WVPЪW3WVjW3WVШ4иWz3WVиPРWl3WVЪWb3WVPfWa3WVfXWZjVԆԆԆԆиP`TФW83WVPи ԆԆԆԆԆ磌Uи Ш Ъ иШЪиШjU|ЪTФdSУ cRТ$b(Ъ W2WVPW2WVЪЪ W2WVժ$1Ъ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:a ;DdAoC jDBC%{C0x$D #PWXx(_I8flxmsyHXhZl:<:XT$ا}v:24@N\ j x   & c(+ 23 ; E L 8(S P[  xd , m ]fu n{ % T     b y     *  * @  :  B    V  & ! * ک0 :r : eC @M U ] e Mm v m~ ! 3 C R ^ j r  |   + 6$ m:  24  % ") < % - 5 < B \I O *T  [ |b bi p y ?N l   L! D@ N @& \4 R   h 0D   ^ - op! bl' - 3 d\8 e~= hB XG dM WU 2^ e l w 4 м d . gD     3  ep 8 ^ v :  z   % + s.4 = z^E [L [T X_ OZi s n{ N  -$   R| _ < 0   2 dl% \$   x  R(R00: D.NW`jwsP7|6bE`;b@zS jf k>i88f*D$P,n2,; EPYeeFr(+|"v,k} U(,w0<DH~L\ V pĞL3?tlo֊%+Z$3<<~DȯMJU;^0a*jtl@\w[+,4+$3> "8WL0 V|1pDm(fp f 27&.`m6k<,BI`rO|Xq`o~w p,c cf^;x_Tdmm~x & %{x 1@ = F5 Ozb Wajsd|hm.C;<q@j~ l`/>p/ S(Wf?f 3LS,"-+f.4-;U.D<LdU$.^|.gDn/u/}=0n(000:112],2L2^t222q68^:XN?,~?|@"Nr)[&s19UCVJUTU_iUhVnGUxЍR_T 5TST ;TATGTMT^F6^Z_l bmy4|<tf  i6gOiRj'vpm.~5|<~"EOXqU(r\xsc:slyst|yrulxny`y̌H}T}N}r}{~I7 !!U'0 <JPuZ)aea p.!u!}"1#J$%&(()+"/S//,0B00W112y3&3-]5268V7;7@8EC9In9Q;Z<c>hJ@n@vA{%BiBBB"CC;HIINNOsOOQRESSRU zUU4V]V#W)X1cX7X=YB+ZLr[V[ax\i]u]]H^___\``a>a\aad=edef]g]ij km$(n.o=pG O [ f n u y ,g%>Y6vD D$z$$$&!&'Q';(N)Z(+n,,P@Qu1wB}a1 ə$1-T<BiLS^e=lv5n?oSA ,Z8AO;Wa#f\w*L/Z  G k     > 9K #.5WB5JbT^ep$ zU J1J>LkL'O4T)UVWQWWXDZd]^B_ Mc{c!c*bg3ci<dkDnMVpXpajsju{vxzzF{~~VA ֊#0((6A?JfVdo.vZq G ` $  " ) ժ3 ; #C IJ P Z ݬ` l 1z ^  @    2 װ  W V  start_exit_main_environ_xports_gstart_proflush_holbeg_holendFixzero__iob_Xargc_Xargv__sobuf_retval_orgbnp_orgnp_rlevel_errp_piport_poport_vtemp_bnp_sigintcnt_rsetsw_lispsys_stattab_bnplim_nplim_chkport_zeroq_atmlen_hunk_items_hunk_pages_hunk_name_itemp_purepage_strbuf_GCtime_datalim_beginsweep_usehole_curhbeg_hasht_exception_hash_sigstruck_sigacts_sigdelay_keywait_atomval_lastrtab_rbktf_rdrport_contval_errport_tint_gftab_proport_namptr_bcdtrsw_ftemp_argptr_ttemp_lctrace_trcur_end_pbuf_mcounts_globtag_syml_errno__sibuf_zfreespace_bitmapi_firstalloc_setbuf_initial_qpushframe_depth_clearerr_matom_Lapply_Ntpl_Istsrch_fputs_dmpport_Lread_eval_printr_franzexit_fvirgin_stabf_unlink_sigcall_evalhcallsw_lispretval_binderr_funhcallsw_Lfuncal_errorh_typetable_qpopnames_namerr_Ifcall_Iarray_qnewdot_qnewint_error_popnames_rebind_fchack_protect_unprot_linterp_Undeff_bindfix_alloca_callg_newdoub_bitmap_bitmapq_bitmsk_gcflag_current_atom_str_strng_str_int_str_dtpr_str_doub_str_array_str_sdot_str_val_str_funct_str_hunk_str_gcableptr_get_more_space_initflag_copval_xsbrk_fakettsize_printf_badmem_next_one_gc_next_pure_one_newint_pnewint_newdot_pnewdot_pnewdoub_newsdot_pnewsdot_newatom_newstr_strlen_strcpy_inewstr_strcpyn_newarray_Ipurep_pruneb_badcall_newfunct_newval_pnewval_newhunk_pnewhunk_inewval_Ngc_gc1_times_vadvise_fflush_blzero_markdp_hashtop_alloc_typenum_csegment_sbrk_csizeof_gethspace_ysbrk_gcrebear_markit_xcycle_lispend_getatom_hashfcn_strcmp_reborn_signal_siginth_Isstatus_makevals_clrtt_delayoff_dosig_badmemr_initread_prinlevel_prinlength_readr_rtaberr_ctable_Iratom_readrx_macrox_fprintf_Iget_ratomr__filbuf_getnum_finatom_endstrb_ungetc_calcnum_dopow_sscanf_Ltimes_dmlad_qpruneb_uctolc__ctype__lfltpr_ioname_pbignum__flsbuf_fputc_sprintf_Inonlocalgo_Iretfromfr_Inlthrow_matchtags_qretfromfr_Lframedump_calhan_argerr_tgcthresh_Imkrtab_Lcar_mfun_Lcdr_Vevalframe_Leval1_Lasin_Lacos_Latan_Lcos_Lsin_Lsqrt_Lexp_Llog_Llsh_Lbiglsh_Lsbiglsh_Lfrexp_Lrot_Lrandom_Latom_Lreturn_Lcons_Lscons_Lbigtol_Lcadr_Lcaar_Lc02r_Lc12r_Lc03r_Lc13r_Lc04r_Lc14r_Lnthelem_Leq_Lequal_Zequal_Lnumberp_Ldtpr_Lbcdp_Lportp_Larrayp_Lvaluep_Lpname_Lptr_Larrayref_Lmarray_Lgetl_Lputl_Lgeta_Lputa_Lgetdel_Lputdel_Lgetaux_Lputaux_Lgetdata_Lputdata_Lmfunction_Lgetentry_Lgetdisc_Lputdisc_Lsegment_Lrplaca_Lrplacd_Lset_Lreplace_Linfile_Loutfile_Lterpr_Lprint_Lclose_Lpatom_Lpntlen_Lratom_Lreadc_Limplode_Lmaknam_Lconcat_Luconcat_Lputprop_Lmonitor_Lget_Lgetd_Lputd_Nprog_Nquote_Nfunction_Ngo_Ncatch_Nerrset_Nstatus_Nsstatus_Lerr_Nthrow_Nreset_Nbreak_Lexit_Ndef_Lnull_Nand_Nor_Nsetq_Ncond_Llist_Lload_Lnwritn_Nprocess_Lalloc_Lsizeof_Ndumplisp_Nndumplisp_Lmapcar_Lmaplist_Lmapcan_Lmapcon_Lassq_Lmapc_Lmap_Lflatsi_Lalfalp_Ldrain_Lkilcopy_Lopval_Lncons_Lforget_Ladd_Lsub_Lquo_Lfp_Lfm_Lft_Lfd_Lmod_Lminus_Labsval_Ladd1_Lsub1_Lgreaterp_Llessp_Lzerop_Lnegp_Lonep_Ndo_Nprogv_Nprogn_Nprog2_Loblist_Lbaktrace_Ltyi_Ltyipeek_Ltyo_Lsetsyn_Lmakertbl_Lzapline_Lexplda_Lexpldc_Lexpldn_Lhashst_Largv_Larg_Lsetarg_Lshostk_Lfretn_Lrset_Levalf_Levalhook_Lfunhook_Nresetio_Lchdir_Lascii_Lboole_Ltype_Lfix_Lfloat_Lfact_Lcpy1_LDivide_LEmuldiv_Lreadli_Lplist_Lsetpli_Nevwhen_Lsyscall_Lintern_Lptime_Lfork_Lwait_Lexece_Lgensym_Lremprop_Lbcdad_Lsymbolp_Lstringp_Lrematom_Lprname_Lgetenv_Lctcherr_Lmakunb_Lhaipar_Lhau_Lsignal_Lnfasl_Lcfasl_Lgetaddress_Lrmadd_Lboundp_Lfake_Lod_Lmaknum_LstarMod_Lfseek_Lfileopen_Lpolyev_Lcprintf_Lcopyint_Lpurcopy_Lpurep_LMakhunk_Lhunkp_Lcxr_Lrplacx_Lstarrpx_Lhunksize_Lprobef_Lsubstring_Lsubstringn_Iaddstat_mstr_Ngcafter_strcatn_gctab_lineleng_keybin_protflag_dmpmode_trhead_trleft_bind_lists_lsbrkpnt_Leval_Lxcar_Lxcdr_cxxr_rpla_verify_fopen_fclose_gtty_stty_typred_oLequal_Iequal_Ipntlen_okport_Iflatsi_r_Iconcat_Iputprop_Igetplist_Lmapcrx_Lmapcx_cmpx_Ldiff_divbig_subbig_rpltab_qexarith_adbig_qprunei_Ifloat_exarith_mulbig_getpid_kill_Lexpldx_chdir_floor_myfrexp_Lbreak_mkstFI_frstFI_getenv_fork_wait_Lpipe_pipe_Lfdopen_fdopen_gensymcounter_execve_Iimplode_Imath_sin_cos_asin_acos_sqrt_exp_log_atan2_rand_pow_Lfdecom_fseek_ftell_dispget_gstab_nlist_bndchk_access_strncpy_Ipurcopy_Lgetlang_Lputlang_Lgetparams_Lputparams_Lgetloc_Lputloc_CNTTYP_Llctrace_Lslevel_Lsimpld_mcountp_doprof_Nexit_Nsys_fpipe_vfork_close_dup_execlp__exit_chkargDlast_open_read_creat_write_lseek_vsyscall_time_ctime_localtime_isatty_chktt_Nopval_setexit_getexit_reset_resexit_setsav_exitlnk_svkludg__dofpipcerrormcount_mcount_dodiv_dsnegBexportbackfr_inewint_calqhat_mlsb_adback_dsdiv_dsmult_export_dsrsh_dsadd1_Ihau_Ibiglsh_HackHex_mytemp_system_ungstab_stat_copyblock_fread_fwrite_Symbtb_qnewdoub_qcons_qoneplus_qoneminus_tynames_qget__erthrow_strcatudiv_gettran_qlinker__qf0__qfuncl__qf1__qf2__qf3__qf4_searchforpdl_verifypdlp_atan_frexp_log10_modf_ldexp_ceil_asctime_ftime_gmtime_dysize_execvp_index_execv_sleep__doprnt__lastbuf_dup2_srand_scanf__doscan_fscanf__sctab__getccl__innum__instr_atof_malloc_free_alarm_setjmp_pause_longjmp_execl_getppid__cleanup_ioctl_realloc_brkdeclareappendconcatlmaxmemqcatchthrowdefmacrodefmcrosrchdefmcrooptiondefunlambdacvtdesetqletde-composelet*listifysassocsassqsignpsignphelpfcnunwind-protectFPEINTINTprtpagesusedgcafterappend1assocbigpcommentcopycopysymbolcvttointlispcvttomaclispcvttoucilispdefpropdeletedelqevenpexexviexecexlexplodeexplodecexplodenexptffaslfileposfixpflatsizefloatpgetchargetcharngetlhelphunklastloadincludeincludeflengthlist-to-bignummacroexpandmakhunkmemberminnconcnreconcnreverseoddppluspprincprog1reverseshellsloadsortsortmergesplitlistmergelistssortcarsortcarhelpexchange2sublissublishelpsubstsubsteqsubstequalvivilxconsarray*arrayarraycallev-arraycallarrac-oneDarrac-twoDarrac-nDstorestoreinternsmall-segmentarraydimsfillarrayfillarrayarraylistarraymsgmakeprintblankslinelengthcharcntnthcdrnthnthrestlistpppcondclosefile$prpr$prdf$prd1$dinc$tocolumncharcnt$patom1franz-top-leveldebug-err-handlerbreak-err-handlerdebuggingbreak*breakfranz-reseterrorread-in-lisprc-fileundef-func-handlerautorunlispcvtsearchpathtolistload-autorunobjectdebuglisztinitlisztcheckfatalliszt-formd-dodefcomplr-declare*fexprnlambdaspecialunspecial*expr*lexprfixnummacarrayflonummacrosspecialslocalfd-genlabd-printautorund-expd-functypd-expsd-pushargsd-cxxrd-calld-callbigd-calltrand-tranlocd-bcdcalld-dotailrecursioncc-andcc-argcm-assqcc-atomc-bcdcallcc-bcdpcc-bigpc-*catchd-pushframed-popframec-condc-conscc-cxrd-supercxrd-semisimpled-structgenc-rplacxd-superrplacxcc-cxxrc-declarec-dod-olddo-to-newdocc-dtprcc-eqcc-equalc-errsetcm-fixnum-cxrc-internal-fixnum-boxcc-offset-cxrcc-fixpcc-floatpc-getcm-getdcm-getdatac-gocc-ignorec-lambexpd-lambbodyd-bindlambd-bindlrecc-listd-mapconvertcm-mapccm-mapcarcm-mapcancm-mapcm-maplistcm-mapconcc-memqcm-nconscc-notcc-numberpcc-orc-progd-bindprgd-unbindd-classifycm-progncm-prog1cm-prog2cc-quoted-locd-loclitd-locvc-setargcc-stringpcc-symbolpc-returnc-rplacac-rplacdcc-setqcc-typepcm-symevalc-*throwcm-zeropd-handlearrayrefd-dostored-arrayindexcompd-fixnumexpc-fixnumopd-fixexpandd-toplevmacroexpandd-collapsed-fixnumcoded-shiftcheckcc-onepluscc-oneminuscc-<cc->c-\d-fixopc-assembler-coded-cmpd-handleccd-invertd-noninvertd-macroexpandd-makespecd-moved-simpled-rsimpled-movespecd-specialpd-tstd-typesimpd-typecmplxd-allocregd-bestregd-matchcntd-clearregd-clearused-inrege-cvte-uncvte-cvtase-cmpe-docommente-gotoe-gotonile-gotote-labele-movee-pope-pushnile-tste-setupbinde-unsetupbinde-shallowbinde-unshallowbinde-dropnpe-jumpe-returne-writele-write1e-write2e-write3e-write4e-write5shiftcheckcc-onepluscc-oneminuscc-<cc->c-\d-fixopc-assembler-coded-cmpd-handleccd-invertd-noninvertd-macroexpandd-makespecd-moved-simpled-rsimpled-movespecd-specialpd-tstd-typesimpd-typecmplxd-allocregd-bestregd-matchcntd-clucb/lxref 775 0 33 13026 2552755616 5713 HP^Юn PPՀPp2Q^RPQ /usr/ucb/lisp-f;XWZjVЏЏWyWV`PP#ЏW\WVPh Џ jPиWBWVPЏW!WV`PP1ЏWWVP P#PPPPԆѺEЏШ WWVԸШЪWWVPWWVPЪW|WVPЪlPѪ Ѫ#ЪPJP1dV+ШWOWVи((WEWVԸиPXWZV||||||||ԆfWWVP fWWVPfWWVPfWWVPj1Ш jTФWWVP8Ъ8PРPvPcк8WWVP$и$PxPP@NPxPPP)Ш(WZWVЏW=WVPкjPjժHP1_ЪHTФW>WVPW5WVP<Ш,ЪUE(+UE(WWVPԆP0ШTPШXPP,PЪ(WWVШ\WWVպ0AЪ0TФWWVШ`WWVЪ,TФWiWV1ШdWTWVԆЪ0Ъ,ժPժTP|ЪPTФЪTSУЪXWWVШhWWVЪ\WWVШlWWVVPЪLPLкPкTTvP1vVЪLWWVVfWWVШpWWVժ@ШtWrWV1ЪDи$WWVP9ШxWCWVЪDWWVШ|WWV1fЪ@ԆЏ U؀ȀЪT؀UժLP1ЪLTФSУPдQЪ,PPRQ`PEЪPWOWV`UUUwPW9WVЪPWWV1ЪPW WV`UU~ЪLTдWWV`UU~UPWWVЪPWWVȄWWVЪLTдWWVպLȈWWVPкLL1UХU VfWWVfWWVкHH1VЏPTXWZVк~؀P`UUU6P؀؀P`PPP7fWFWVȌW+WVUP؀؀PPXWZVxjP@jWWVxjP@ jTФPPcccc-freadtabletexituser-top-levellxref"Lxref - lisp cross reference program"poport-ignorelevel"bad ignorelevel count"l\.xER%all".x""Couldn't open "File"File "" is not a xref file"alphalessp(Franz-initial)(Undefined)" "" ""Mult def: "" in "", "" ""*** Unreferenced ***""Called by "" functions"width" in "", "" "argvmakereadtablesignalapplyexitpatomterprgensymexplodereadlistexplodecnreverseimplodeinfileportpconcatreadcloseputpropsortlengthlesspsortcartypeitprintflatcterprchkgetdisc(opval (quote pagelimit) 9999)(setq ignorelevel 50)xrefinit(setq user-top-level (quote xrefinit))lxrefterprchktypeit(setq readtable (makereadtable t))':Ac  B [ l        / @ Q u       \ e s             % - C T b h q             - [ q         8 A S p y        ( E p       3 A f x      . @ S y    6  u    3 K `  n  {       2 C T   UGX;%_,3:ELS^jpx  g $ HexitQL1QL2drln_execveexeceF00008linkertrantb_qoneminus_qconsF00024_typetable_qpushframe_errp_retval_lispretval_qget_bnp_qnewintF00092F00096bind_orglinker_sizetrans_sizelit_orglit_endUGX;%_,3:ELS^jpx  g $ HexitQL1QL2drln_execveexeceF00008linkertrantb_qoneminus_qconsF00024_typetable_qpushframe_errp_retval_lispretval_qget_bnp_qnewintF00092F00096bind_orglinker_sizetransucb/Mail 755 0 33 141450 2552600632 7156 1ucb/mailucb/fmt 755 0 33 24000 2532150242 5327   ^Юn PPՀPpPP P ZZY~" }"ݏ0P*! ѬaݏP Ͽ R{z2ݼτ Z&hЬP`=P[[[׬6Z5^׼ЬPРQ֠aPݬ| PYY[nP[P[׼LݬO PY 5׼6YCPP[PP1YY YY׼ЬPРQ֠aPPYY k)Y%׼ЬPРQ֠aPݬ PYY X[Z:XPPZPP&Y!Y PPZPP XX䘋YZPZP$ZjY1׼11j ݬ0 P(Ϲ31P, ``P  ϕЬ[[k ì[YY5 Y. Y' ~Pa[PX P   PP2P($ZP'Zj[jdPX Xk.PPXYϦ[Xϖ ^Ь[WZk k\P@Ϝkk ϣ~P k jk0#(#Oݬ PYÏ" #ZZYPPHЬ[ ""kZ Ь[ ""k"߹"ϵϬ"ݬH PP[k [[[kЬ[[k ì[YxYXYYX#P `  ~XYDP `  WY!P`ϿϺ~2kϪϨPϣ ``P ϓ   [Z [[ϭZ϶!ݬP P~WP[Zύ[ݬ[P Ь[ЬZjkPP^Ь[[(P6߭[4խխݭ$PݬPP ^ԼЬPԠЬPԠЬ[Ь [ϒP[[τPZϽP߭ZPϛZwP-ZDP[߭+ЬQP[߭[ Z߭Z ЬQPݬPYм[[Zݬ[YPP[[ZPЬ[ЬZЬ Y PYPЬ[b[PPk[Ь[ЬZyjyYPP9@M_f%[Ya YzIPYAYZ2Y +YϯP Y YϝPY:Y kkjP Ь[ݬ6|PЬZkk~zPj[ k~dPk[PݬnP[[A[ZPPѬ0 Ѭ9PP Ь[ЬZkjZP Ь[ЬZkZPQPQPPЬ[[a [z [[PЬPPPĬݬGP[P[Z~PYԊY[Pݬݬ \~ݬ?ЬP PPЬ[xXXPX 鑫+PPPYkw+ݏݬPZY1ZZkalYPPPݬPZ<3ݏݬ}PZYZZݬPZZ)ZYPPPݬPZZ1hZY ((kr  XPh [=0P@X[ݬ%PZZݬ|[P[X0 8 B \ l  ( > P \ n }   ) ? N Z m Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too largeЬ[  P ݏ9 P ի ߘP@# [|! N  P2PPݫ~q PkЫk!k    k1WP֫Ь[ի ݫ Ь Ыk Ь[ZZZP   !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~1PYjD ~P  BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[!1xݏPZZ  YYX ZYYXZYZ~`PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[  Ь[Z = 8[ePZ~YPZ ݫS ԫ kZP{ Ь[ЬZkPkPzQQP@P^߭ݬ\PPPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6.11y|~*PYe[jk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ& [1PYPƏPxPbPZxPZPPZx~@PZZZPZPxPZPPjj11xYP[PpZiadkUNk[P Ь[[ZZZ5jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j~\S^\_PCЬoPЬPЬRRQ{RPPR PRPPP P4 7 ? r.:!fmt: Ran out of memory ToSubjectCcFrom No from or date fieldDate field not legal date"%s" not a header because %s tty Unknown error: #  AAAAAABBBBBB |-|-"1ucb/which 755 0 33 1225 2532152002 5623 # # which : tells you which program you get # hacked to do aliases (from .cshrc file only!) set noglob foreach arg ( $argv ) set alius = `alias $arg` switch ( $#alius ) case 0 : breaksw case 1 : set arg = $alius[1] breaksw default : echo ${arg}: " " aliased to $alius continue endsw unset found if ( $arg:h != $arg:t ) then if ( -e $arg ) then echo $arg else echo $arg not found endif continue else foreach i ( $path ) if ( -x $i/$arg && ! -d $i/$arg ) then echo $i/$arg set found break endif end endif if ( ! $?found ) then echo no $arg in $path endif end arg` switch ( $#alius ) case 0 : breaksw case 1 : set arg = $alius[1] breaksw default : echo ${arg}: " " aliased to $alius continue endsw unset found if ( $arg:h != $arg:t ) then if ( -e $arg ) then echo $arg else echo $arg not found endif continue else foreach i ( $path ) if ( -x $i/$arucb/px.bad 755 0 33 102000 2572603402 5737 d^Юn PPՀPpPPc P0_ ^ЬK}Ь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P[[ЬP PQРЬP ݬ [~ЬP~ PԼ[h׼ ЬP֠Zݬ NЬP BPЬP ԼЬP ЬPPQРݬ ݬЬP~ PѭPP 84[<@4<P@X[ݬ5 PZZݬ4[ P[3GGHH,HDHNHhHzHHHHHHHHHII.I=IMI\ImIIIIIIIIIJJ-JError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large^Ь[ЬZԭլ05Ьj ЪP֪`P ZPYY׭֭ѭ ЭP^Ь[ЬZԭլ.3ЬYj ЪP֪` Z~Y ֭ѭ ЭPЬ[[~n kЫ0   \~ݬ%1J \~ݬݬ5^Ь[A[[ԭ֭ \~ݬ߭^Ь[Ь Zԭԭ1)ЬPРQ֠aP1LYY%1/ԭY* ZZYԭ PYP0PYI/խ20uYlԭ蘋YYhY[ [P[I/ YYP߭ݬݭݭYݭPխ֭խVխЭPP׼ЬPРQ֠aP ݬPP P P P ݬPIYYPPJP P P P%1׼1ݬ%PPYP14ݬPЭP^ѬcѬs Ѭ[#ݬݬݬ ݬլмPPPԭԭԭѬe Ѭf YѬoY ѬxYޭ[ԭԭ׼ЬPРQ֠aP ݬNPZP Z Z Z-.֭Z׼ЬPРQ֠aP ݬPZ׬ 1Z+׬ ׼1ݬ1Za ZfZA1ZF֭YxY xPPPPxZJ?-0ZZaZf WZ7ZZЭZY 1խ֭Z׼1LЬPРQ֠aPPZ׬ ~J,1^Y1/Z.Ze ZESխNY IխDխ?֭Z׼ЬPРQ֠aP ݬPZZ+1pZ-Z0Z9խέZݬZԼլ ޭP[PPxPȬPPPZZ&&&&&&&&&&&&&**=P߭мRvPb߭мRpPbмP`мPЭ`^Ь[ЬZԼ[XѬcѬ 0u ԭѬ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ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~4PY PPX[ [[[ Ь[Z = 8[ePZ~9PZ ݫ ԫ kZP{P^߭ݬDPPPp`ݬݏ tݬݬݏtݬ6$Ь[ѬP ѫѫk֫k׫ЫP`P PЬPЬRRQ{RPRPPPRRP`'.R'J'D'G'5'8'~*PY!'[&'k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ& [P&YPƏPxP&bPZx&PZPPZx&~@PZZZu&n&PZPa&xb&PZPPjjK&?&1xYP[P,&Z%&& &k& &k[P Ь[[ZZZ%jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPQ%@j~\S^\_PCЬPЬPЬRRQ{RPPR PRPPPa PС@(#)int.c 1.1 1/7/81objImproper specification of object file to PX r%s is obsolete and must be recompiled %s is not a Pascal program Read error occurred while loading %s Execution begins... @(#)interp.c 1.8 2/4/81  f f|ffH~L||fhgTJ~\|fwgaL~l|gastandard inputstandard outputMessage file@(#)except.c 1.2 1/24/81 Overflow arithmetic operation Call to procedure halt Run time stack overflow Panic: Computational error in interpreter Panic: stack not empty between statements Panic: bad op code Panic: unknown error @(#)utilities.c 1.2 1/10/81pC %1ld statements executed in %04.2f seconds cpu time. Program was not executed. Interrupted in " Halted in " Error in "%s"+%1d near line %1d. Called by "Execution terminated abnormally@(#)ARGV.c 1.1 10/29/80@(#)ASRT.c 1.1 10/29/80@(#)BUFF.c 1.1 10/29/80@(#)CARD.c 1.1 10/29/80@(#)CHR.c 1.1 10/29/80@(#)CLCK.c 1.1 10/29/80@(#)CTTOT.c 1.1 10/29/80@(#)DATE.c 1.1 10/29/80   @(#)DEFNAME.c 1.1 10/29/80@(#)DISPOSE.c 1.1 10/29/80@(#)EXPO.c 1.2 3/7/81%.1e@(#)FLUSH.c 1.1 10/29/80@(#)FNIL.c 1.2 1/24/81@(#)GET.c 1.1 10/29/80@(#)INCT.c 1.1 10/29/80@(#)LINO.c 1.1 10/29/80@(#)LLIMIT.c 1.1 10/29/80@(#)LN.c 1.3 1/6/81@(#)MAX.c 1.2 3/10/81@(#)NAM.c 1.1 10/29/80@(#)NEW.c 1.1 10/29/80@(#)NEWZ.c 1.1 10/29/80@(#)NIL.c 1.1 10/29/80@(#)PACK.c 1.1 10/29/80@(#)PAGE.c 1.1 10/29/80@(#)PRED.c 1.1 10/29/80@(#)PUT.c 1.1 10/29/80@(#)RANDOM.c 1.2 1/16/81O@(#)RANG4.c 1.1 10/29/80@(#)READ4.c 1.3 1/28/81%ld@(#)READ8.c 1.3 1/28/81%lf@(#)READC.c 1.1 10/29/80@(#)READE.c 1.3 1/28/81%*[ ]%74[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]@(#)READLN.c 1.3 1/26/81@(#)RELEQ.c 1.1 10/29/80@(#)RELTGE.c 1.1 10/29/80@(#)RELTGT.c 1.1 10/29/80@(#)RELTLE.c 1.1 10/29/80@(#)RELTLT.c 1.1 10/29/80@(#)REMOVE.c 1.1 10/29/80@(#)RESET.c 1.1 10/29/80r@(#)REWRITE.c 1.1 10/29/80w@(#)RSNG4.c 1.1 10/29/80@(#)SCLCK.c 1.1 10/29/80@(#)SEED.c 1.4 1/16/81@(#)SQRT.c 1.2 11/19/80@(#)STLIM.c 1.1 10/29/80@(#)SUBSC.c 1.1 10/29/80@(#)SUCC.c 1.1 10/29/80@(#)TEOF.c 1.1 10/29/80@(#)TEOLN.c 1.1 10/29/80@(#)TIME.c 1.1 10/29/80@(#)UNIT.c 1.1 10/29/80@(#)UNPACK.c 1.1 10/29/80@(#)WRITEC.c 1.1 10/29/80@(#)WRITEF.c 1.1 10/29/80@(#)WRITES.c 1.1 10/29/80@(#)WRITLN.c 1.1 10/29/80@(#)ERROR.c 1.3 3/10/81Argument to chr of %d is out of range Call to procedure halt Pointer value out of legal range %s: Tried to read past end of file %s: Attempt to read, but open for writing %s: Attempt to write, but open for reading %s: Close failed %s: Line limit exceeded Negative argument of %E to sqrt %s: Reference to an inactive file Could not write to Could not open Could not create Could not remove Could not reset %s: File name too long Non-positive argument of %E to ln %s: Bad data found on integer read %s: Bad data found on real read Unknown name "%s" found on enumerated type read Enumerated type value of %d is out of range on output Non-positive format width: %d Active frame not found in non-local goto Label of %d not found in case Ran out of memory Range lower bound of %d out of set bounds Range upper bound of %d out of set bounds Value of %d out of set bounds There were %d too few arguments to formal routine There were %d too many arguments to formal routine Argument to argv of %d is out of range i = %d: Bad i to pack(a,i,z) i = %d: Bad i to unpack(z,a,i) Value of %d is out of range Subscript value of %d is out of range Assertion failed: %s Statement count limit exceeded, %d statements executed Panic: unknown error @(#)GETNAME.c 1.2 1/10/81tmp.XXXXXX@(#)IOSYNC.c 1.3 1/26/81@(#)PCEXIT.c 1.1 10/29/80pC %1ld %s %04.2f seconds cpu time. statements executed in@(#)PCLOSE.c 1.3 1/15/81@(#)PFLUSH.c 1.1 10/29/80@(#)PMFLUSH.c 1.2 1/13/81pmon.outwpmon.out@(#)UNSYNC.c 1.2 1/24/81@(#)ACTFILE.c 1.1 10/29/80Ay1?ϒy@!hI@!hB:IvDv6T1E r OER `EM2 fkCӴLE\QEYWF\*~`EM2 f@@@1@rzA]ݬ5@3elB#"3h@?ØGe@lB,k$d!r@AA@@@"@NnDOLX2xة3I䔶TX]1 D!L%dIgN5&GbqhDK->G?A@@AA@@OO@JGSrCu%طK@0qi9IE4Ÿ@;\)@((3fG@@@@@M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec@@A@@A/Unknown error: #  AAAAAABBBBBB }ucb/pi 755 0 33 310655 2552606533 5222 X\^Юn PPՀPpPPCP0^ԭԭC[8[9խ w֭0[ӏpխ Y֭xP[PЬP֬`[ЭP ^ЬPݠPЬPЬPݠx PɏlP~jѬ %ЬPݠvP~8PmjݬaP[1}P1;P1X1PլݼݏBPPP_P ЬPР%ЭP`Aݼk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;ՠ nݠP[_::R FPP> ЬPՠ ݏ 5o2:QPA9_[PЬP`G= ЬP`PP1P1PG1w=45ЬPݠ*P[[F=ЬPР ЬP`G1PPP:29PPݏ ! "ݫ ЬPݠ*P[ Э ЬPݠ [P 1ЬPЫ QР 1ЬPՠ ݏ JЬPݠ)P*P[ 1*ЬPРZݏ$ ZݏE jLZ^zPZZ ЬPݠK)Pp*P[ ݫaPP1w@3s0xPyP`ݏ m1q1aЬPР u8QP$.3m2U8QPA\ԫݫ$ C12?ݏCݏCP\ݏvCP\[ЬPР YY1iթ"ݩ(PЭPЭ ЭЩYЬ[ЬPݠ [ЬPР Ы $ԫ ^Ь[[[ԭЬZ1[ЪY1Щ&i?ݏ ݏ ݏ [iЭP`LP`xP[Щխ1AiPP/[5 ݏU  PP[Pݏv [PP~Pݭ[ЭPݠ&P խЭPЭ ЭЭPР1Mݭ[ ЭPݠ&PЭPՠݏ ЭPԠݭ[ЭPݠT&P YݭF1uЭPՠݏ ЭPԠݭ[ЪZZ1QЭ[Ы έP PЭQPЭPР խέP P ^լ)ЬP"P ݼݭݭݏ1PPPЬP`AݠPPӘPPXP SPP1ЬPՠ ݽݭݏFЭPݠ24Px PPɏlP~P@ЭPЬPՠ ݽݭݏh4ݽݭݏ724PPPxPPP~rPݠ2r4Px PPɏoP~?ЭPݠ$2M4PxPPP~1hݼݭݭݏ1^2x6ԭԭլ1ЬPՠ4XiЬPРPРЬPРPР ЬPР Рխ6խЭPݭOݭOݭtf1!ЭPݠ;PPРЭPՠ !ݽݏ ЭPݠݏ *ЭP-=8353ݠ2&3~\Psݽݏ;-ݭmP-PiݭPݭPݽݏ~1ЭPݽݏlԭ1V7pPA7pPЭPݠ2Y2Px PPɏoP~=ݭݭ6NPݭݭPP ݏ խ1VЭP1KݭUzP  ЭPݠ21Px PPɏoP~?=ݭݭMPݭݭPP ݏխ1ЭP1ݭyP ЭPݠ2U1Px PPɏlP~<ЭPݠ221Px PPɏlP~<ЬP`: P PP.IPPb<IPP~Iݭ@ЭPݠ20Px PPɏlP~<g5ݭGݭxP ЭPРЭPЭQРЭP3M0ЭPXeݭ cЬP(0}eЭPݠ20Px PPɏlP~z;ݭl ݭFxP4ݭЭPݠݠP+xxPPЬQa:QQQP~"ݭЭPݠݠЬP`:PPP:ݭF2խ ЭPЭխЭPЭЭPЭP21QPQPd$^ЬPݠ PPD (ЬPР />2.~ ݭݭݽݏdЬPݠ  PԭЭZ֭ЪZZЭPˏY(s ݽݏzRYPPlPcPBP9P0P'ѭaݽݏ ݽݏݭ1PխY92PխIޭޭܭA0ԭЭY Y)ЭPݠR'ѭ1jݽݏ1xЭPݠZP[1YPP11P11P11PH11XP1'1?[P1[Pݽݏ1P?ЪZZ[PPXH!Z2(#PP"I@ZPj[ЪZZ$^լ1ݬwPЬP`A1ݠP[[[1ЬPР ZZPH PP1P (P1ޭЬPР 䘏DРޭZݫ2!Px PPɏlP~;-ԭԭZ1kݏn ݏ_PЫkP@Tݏ7[Ы[iPPBO 1(ЪYЭP@ 5 /[PݏЬPݠݏ1]խG ) !ݭ2 Px PPɏoP~2,Hݭ2 Px PPɏlP~խݭ., y ݏ|+ P/PP+ԭЭ1;/ѭЭPP@ЬPݠݏ1ݏ1eݏ)[PݏR1խ8ݭ2Px PPɏlP~"ݭ2Px PPɏoP~ խݭ.+ݩ[P1|P1!1[OPݏ1Pթ1ݩ[ ;P[ ݩݏ1+ ݪnP@ЪZZ1խ8ݭ2Px PPɏlP~"ݭ2Px PPɏoP~ խݭ.-*ЫP Ь[[ЫZPjPPB Ы[P ^Ь[լPЫ׭1լ1ݭ~ݏne Zjf ѭѭݭݏ«ЬPݠݫZP\ݏFѭݭݏ~PЫ [ЬPݠKHP1sЬPݠ9PZ1(ݭݬgPխhP1ZePݭPPPP(ݭ_1ЬPР֭լݭ~ݏ1KЭPP222.2~2~ݭZ6eP;,P92~ZeP*P+PQxQQQP~(-PP(ЬPР)լ1CPݬݬ ^ЬP`P`a ЬP`P`-:ЬP`Po,ЬP`8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Z1 7Z:8P PP﫴PiF1Hѩ 0O1 E tP1֭j6 1ѩ X1թ ݩ p5P%¿ +Pj 萏fЭPP"PHxPPVP`ݏBJ1#s߰xP(P`ݏթݩ4P1խ խݏj1<K(խ խsdݏѭd1ۏOۏXݏխݏݭ5ݏ ЭPݠ~%PP1ЭPݠݭݭAPݏ\1|ݭݭݭQP)ݏ1FۏOۏXTGssݏѭѭxPP`ݏ=1FѭѭЭPP#)WxPZP`ݏ1ۏf*ZZ5Pխ1gۏD1 RZ05Pݏ^1ۏXۏO  1ݏaZ4P  !ݏ,1ws ݏ[XZg4ݭPݏs1]Z34PЭPP 1YY ԭ1"e׭ѭѭ萏e׭ѭZb1-P@P`խ1Z~3PP J ׵cyԭ֭ЭP֭`ݭNPsЭխ1w ѭ­ݏ#tݩ 2PP1պݭPݭ殺Pݏ1/ݏ W Q ޴1{ѭѭ ѭJ2TPxPP`P}` eCPݠ2&Px PPɏoP~ݩ1PP1*ݭﻯPݭɯPݏ1SЭPP1XP1ѭ1e!ЭPݠ2Px PPɏlP~ݏ/ ) ﶳЭPݠ2CPx PPɏlP~߭Bݏ[ЭPP""+"":"""""ѸT1zЭPݠ2Px PPɏlP~ݭݏNHղ߭A1w!ЭPݠ2NPx PPɏlP~ݭ1s11~%i~ݭ߭菱Z~ D~ݭݭ߭}2~ݭ~ݭ~߭IޭPP~PPݏ ޭPP~ݏ ݭݏ ѭjݏ ݏ 1T Эݭݏm Z.PݏK ЭPРխ1,ˏPPP0Pխݏ[խ ݏGѭd ݏ;0ݏ ԭ6խ1ЭPݠ.PP ЭPРխLЭP BЭPРЭPРЭPݠnݏC ЭPР׭17ݏ% P@1ЭPРY1iAkݏ\I1YPPѭd1ЭPݠݭݭ Pݏ1խݭPݠݏlx ݏi ݭCHPݏ~N ݭݭ%ݭ'P ݭݭZݭGP) ݏ 1ݭPPP@.XxP$P`ݏ1X X <ݭPX wSsݏʹX+X"XЭPPPݭxXPXPPPݭFP ЭPРխ1ѫ(ѭd ݏ ,ݏ խ ݏ, ѭ kݏG1ЭPݠPPЭP PPkݏ`︸ݏP X1(խѭ kݏ1[ѭsݏjpЭPݠPVPЭP PLPkݏ1fݭmPPЭPݠEPݏѭ1ЭPРYݩ)PYYY\PYŧPkݏ1Y!EPݏ,ЭPРYݩ)PY"ݏݏЭPݠP1խ kݏ?1XPPPЭPݠPPЭP PPkݏa1ЭPРЭPР1ЭP1ݏ1ЭPݠ飯P kݏ1WЭPݠ/ЭPР PݠfPݏЭPРЭPnPqPЭPР խխ ݏT1ЭPРЭPРխЭPՠ1Eݏ1TݭdCPXsѭ1ЭPݠuPPݭBPݭCP 1ݭPkݏ1խ ݏ1Xѭ ݏ1ЭPݠK'PPݭPݭ"Pݏ1ЭPРYݩPPݭzP1ݭߤPݏ1ѭ ݏN1ЭPݠ&PPݭ~PݭPݏm15ݭAP1ݏ\1ѭ ݏ1CЭPݠA&P'PݭﰢPݭPݏ1ݭuAPݏЭPݠ%1ѭ ݏ1&ЭPРYݩ%PP ݭPݭPݏ1:ЭPݠ PPݭP1ݭRPݏ>1ѭ ݏv1ЭPݠPPݭKP1;ݭPݏ1ѭ ݏ1@DЭPРРYЩЩZЪ2ѭ ݏ1 ЭPРРYЩЩZЪ}XPPPݭPXPPPݭPY8խЭPP-Pݭݏ1FݭPݭݏ, 1(թ ЭPՠЭPѩPޡPݭݏX 1Y9?PЭPݠ'?PЭPР Щ YЭPՠ թ  ݭݏ 1>խYЭPPQáPPéPPѭݭݭݭݏ ,­ЭPРݭݏݭݏݭݏݭݏ}XPPPݭ}PYXPPPݭ^Pݭ"PP1kݏ 1?P11P17P11P11P1",P1P11\P11MP1MP110P101!P1=P1  P11P11P181P1P1;1P11 ^QЭP\[ЋkЭkԭЭP@թYPʭŭﺮЭPP11P1((1Ph141P 11cP1T16P1?1P12ѭ'ѭ!xPPPZP1rZ1o0Y1Y~Ï~y?խݭk*խݭZѭ ZZ1ZJk3ZЫPP`PrPsѫ1_ѫЫЭ[׭ѭ SYѭÚA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l0000 0100000100000 ߭ݬݬP1խ1O߭ݬ71$ЬPՠ 1ЫY1*Yv*PPoW6ݭݫ2Px PPɏnP~XYPݫ2Px PPɏmP~5ݫ2Px PPɏlP~ݫ2Px PPɏjP~ݫ2zPx PPɏhP~ݬݾPY1dY)PP>6.ݭݏ~1jݏ}1>ݏ|ݏzݏxЬPՠ ݠݏ!{1ЫYYhc1ЫЭԭ֭ЭP֭`ЭլD<ݬ(PݬPݏ!N1ݬ(Pݭݏí~ݭsݭPYY1QYd ݫݏ1VYo(PH;/ }1p~ݏ1ݫݏ12~ݏ1ݫݏ1ЬPՠ 1ݏ"1!kݏ*"1kݏ]"1ݭ'P~߭ݬgЭPݠM*2~ݏ2~ݏPxQQP~ݏЭPЬPݠPY1}YﴉPYÉPݭݏ"1ЬP`1Y 'xPPLP~$YP1BYP1CЬPݠgPY1jY"PY1Pݏ"1HCPЬPݠP[ЬPݠ PZ[1Z[ﳈP[ˆPݭݏ"1[ZPZPݭݏ #1ЬP`PPP1PЬPݠtP[ЬPݠ _PZ[1`Z[P[#Pݏ:#1:ĝZPZPݏm#1ZZ%P[O%PЬP`լ]ЬPݠ PYРѬ"wЬPݠP[լ1~ݬЬPݠ`P[[ЬPݠ KPZ[Zݜ[P͜ZP1ﺜ[zPH臭ZgP5[Z ݭݏ#1[5$PЬP`ݏ[Pc[P[Pݭݏ#1=ZUPZdPݭݏ $1ݭݏC$1lЬPݠJP[ЬPݠ 5PZ[16Z֛[P[Pݭݏ~$13ﮛZP1Z̅Pݭݏ$1ЬPݠ PZZ1Z`xЬPݠP[][Z"P["P[ݬЬPݠFP[X1IZP1ζРѬЬPݠPP1[ЬPݠ PZ[APZ4PݭPݭPԭЭPP *`GG}}`*Z!P[!PЬP`ݭ1aѭݭxP~P`xP}P`ݏ%1ѭѭѭZ9P[,PݭxP}P`ݏ%1ѭ1v>ЬP` ` 0#s~ݭݏ$C[Z1ѭ1[Z1rЬP``  ݭݏ$1D1ѭ ѭ1ЬP`1` ݭݏ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f `f`f    " , 6 @ @ J T ^ h h ff`f`ffr ݫݫ ݫ@qoݫE:PݫݫݏGPvPnPwݏM,ݫ9Pݫ2Pwի 1j1ݫa1Wu1M[^ Vݏj,71-^11 1ݫݫa9P1իPݫd`PP81ի Pݫ @`PPݫ81ݫݫm\ݫݫݫ \1}ݫݫM\ݏ,1<ݫݫIݫݫݫ 1Eݫݫ)ݏ,1ݫ ݫݫݫ8Pݫ 1ݫݫXݏ,1ݫl1ݫl1ݫl1ݫݫ ݫݫݫPt1u1u1ݫ71u1yݫ ݫ7P1ݫݫ7Pݫݫ ݫݫ7Pz1yݫݫ ݫݫ7PЫu1ݫ12ݫ 1Pݫ1:ݫݫݫ ݫ#ݫݏIݫ$ݫ Pݫ%1?ݫݫ&14ݫ6Pݫ'1 ݫ ݫݫ(1ݫݫ 6Pݫ)ݫ ݫ*1ݫ ݫ+1ݫݫ6PDtի 1+1ݫݫ6PݏPݏ,1ݫ ݫ^6PݫݏO1fݫF6Pݫݫ.1ݫ-6Pݫݫݫݫ6Pݫ/1"ЫZЪYiK JiЫ1|ݫ1ЫY1mЩZj=!P_ Ɛe;T ,ݏ,) 8PKj1sݏ-1ݫ ݫF5Pݫ01Rݫݫݫ իPݫ>`PPݫ31#ݫJ41ݫ 4Pݫݫݫ4Pݫ1Pnrի 1U)1ݫ4Pݫݫ6fP;rի1"1ݫݫy4Pݫ71ݫݫݫ81wݫݫT4Pݫ 91`ݫݫݫݫ:1ݫݫݫݫ;1ݫ@`ݫ<1=ݫݫݫ=1aݫݫݫݫݏJ1Lݫ ݫ>1 |qݏ1-17ݫݫݫ1]qݏF-1ݫ ݫЫPѠЫ PЫPРPPݫ1ݫЫPݠ1ݫЫPݠ1ݫ ݫЫPѠݫ ݫЫPѠ1ݫ1`ݫ!1VݫݏH1Hݫ"1>ݫ  3Pݫ51ݫ1ݫ2P?1 ݫ ݫݏ@1ݫ21ЫPݠ 2ЫQP 18ݫ 2PݏC,Pݫ ~2PݏCPЫPݠ %2ݫ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`Zݏ9CQPaZka[Z1(#  %MPؤn{ЬPPݏ1(hݏ1h ^Ozݼu ;zEwP`Pb~PO~Pu2P`P[ݬݬݬ[ݏgP[[2y=y5~xP~eP[DuB[[Ь Px@_P%PPZjZZ1jy>u6PdPSPtP`.P[sݬݬ~ FP[x1@P/P[et2[1zݬݬݬ[P[[2x9x1uPdP[s[5!([%/Ь wmP`vPGP6P~IP~6PusP` P[ݬݬݬcP`PkP[[2v_vWDP3P~P~P[r][![Ь Zj17Ь[Ь ZЬXh5XЬP`oPXЬY[9V~(( z[ [,P [ ЬP֬PP~X+PX<YYiPPZ Yi1|ZP^լPмYЬPР ﳟyu q2 #YuЭP@<q ׭խ1u*YPYPݼq .P@P@[P@]@[YZ[ЋZxZPPq?5 ZZ+Yt1 qC 1PZ@YЬPQРAItZp ЬP ZZWP@WZP4 t|P@)jP@)p 1LXJbsݭp ѭ%xPPxPP­1Jq_P@jP@Ae[}P@5PмPPk [k%sݫp =PЫ@-1r1o 1r1Bo1IЬPP$PPP" P*PPЬ[P:[ Ь[լ[P[ ݬЫZ9Zݬ Ь[PЫZԫZPЬ[ [P[[ݬݏAݬݬ,aݬݬݏDKPݬ P5^߭1 2PM\tError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too largef\~ݬfPP^Ь[ЬZԭլ05Ьj ЪP֪`P ZPYY׭֭ѭ ЭP^Ь[ЬZԭլ.3ЬYj ЪP֪` Z~ Y ֭ѭ ЭPPSЬRUT TTT +T-TST|PT04T9/Q yPVyPPVPWQ0TTPQUSUTǑT.SVTeTE[TT+T-STT0T9V FfV>FVSVVVUUЏUUdЏdU}PP1RU#Q yPPRyPVVPWQRU=;Q yP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PZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP @jV~\S^\wVPV[ЬwVPЬPЬRRQ{RPPR PRPPլQPP@(#)ato.c 1.2 3/8/81@(#)call.c 1.17 6/12/81bcsicallvarvaluefunctionprocedureSNARKplist@(#)case.c 1.3 3/8/81bcsi@(#)clas.c 1.4 6/1/81 &+38clas2classbcidtfilerecordarrayscalarpointersetstringSNARKBooleancharintegerreal"nil"@(#)const.c 1.4 9/4/80idgconstgconst2id@(#)conv.c 1.2 3/8/81convertrangechk@(#)cset.c 1.6 3/20/81empty settrbcsiiintsett@(#)error.c 1.3 3/18/81ESnark (%s) line=%d, yyline=%d Snark in pi ... %c - %c %d - @(#)fdec.c 1.20 6/1/81 %dIn %s %s: @(#)fend.c 1.9 6/8/81inputoutputs@(#)fhdr.c 1.3 6/1/81funchdrfunchdr2@(#)flvalue.c 1.11 6/8/81functionprocedure@(#)forop.c 1.9 6/1/81bcis@(#)func.c 1.7 3/8/81ididdibcisdbcsiiiitfunc1@(#)gen.c 1.2 3/8/81LTP`@08[ZXY    gen@(#)hash.c 1.2 11/24/80l p v -}      $                          ! #   % & '$ (* )/ +3 ,7 0h andarrayassertbegincaseconstdivdodowntoelseendfileforforwardfunctiongotoifinlabelmodnilnotoforpackedprocedureprogramrecordrepeatsetthentotypeuntilvarwhilewithocthexexternal@(#)lab.c 1.9 6/1/81@(#)lookup.c 1.1 8/27/80@(#)lval.c 1.8 6/15/81lval2lptr@(#)stklval.c 1.1 8/27/80@(#)Copyright (c) 1979 Regents of the University of California@(#)main.c 1((.4 3/9/81pi [ -blnpstuw ] [ -i file ... ] name.ppix [ -blnpstuw ] [ -i file ... ] name.p [ arg ... ]pc [ options ] [ -o file ] [ -i file ... ] name.p 4 J N OFatal error in pi /bin/catcatUsageName must end in '.p'rBerkeley Pascal PI -- Version 2.0 (%s) %s %s /usr/lib/pi2.0stringsobj/usr/lib/how_pi@(#)nl.c 1.5 6/1/81c"(,059=BEIMRX\`ejpz ',1HG9BLUZciy !(.37=ELRW\aeiosynlfree "%s" Block=%d Name Class Bn+Flags Type Val Chn %3d: %.7s %s%d [%d] %d %f %ld '%s' %d,%d %ld..%ld %d(%d) %d |%d| <%o> NSTAND <%d> [%d] VARNT=[%d] TAG=[%d] VTOREC=[%d] No entries truefalseTRUEFALSEminintmaxintmincharmaxcharbelltabbooleancharintegerreal_nilBooleanintsetalfatextinputoutputabsarctancardchrclockcoseofeolneosexpexpolnoddordpredroundsinsqrsqrtsucctruncundefinedargcrandomseedwallclocksysclockdatedisposeflushgetgetseghaltlinelimitmessagenewpackpageputputsegreadreadlnremoveresetrewritetimeunpackwritewritelnargvnullstlimitvariableundefinedconstanttypevariablearraypointer or filerecordfieldprocedurefunctionvariablevariablepointerfilesetsubrangelabelwithptrscalarstringprogramimpropervariantformal procedureformal functionSNARKBADUSECONSTTYPEVARARRAYPTRFILERECORDFIELDPROCFUNCFVARREFPTRFILETSETRANGELABELWITHPTRSCALSTRPROGIMPROPERVARNTFPROCFFUNC ***@(#)proc.c 1.9 6/4/81iifmt1iifmt2%%%c%%%d%c%%*%c%%%d.%d%c%%%d.*%c%%*.%d%c%%*.*%cbsciiiipack(a,i,z)unpack(z,a,i)proc case@(#)put.c 1.14 3/26/81ZX`ejpw} $*06;?GOU[`ekqx %+17>EKQX_ekqw} #*07=CHNU[bhnsz $+29BHNTZagkqx %*09@IOW^dlrx~     $ * 0 6 = op= %o put*%5d CON8 %22.14e IFEQIFNEIFLTIFGTIFLEIFGE'x''x'%5d CASE1 %d %5d CASE2 %d %5d %s:%d %D %d %5d %s:%d %s%d %5d "%s" %5d .=.+%d %5d "%s" patchfil patch %u %D NODUMP BEG END CALL FCALL FRTN FSAV SDUP2 SDUP4 TRA TRA4 GOTO LINO PUSH IF REL2 REL4 REL24 REL42 REL8 RELG RELT REL28 REL48 REL82 REL84 AND OR NOT AS2 AS4 AS24 AS42 AS21 AS41 AS28 AS48 AS8 AS INX2P2 INX4P2 INX2 INX4 OFF NIL ADD2 ADD4 ADD24 ADD42 ADD28 ADD48 ADD82 ADD84 SUB2 SUB4 SUB24 SUB42 SUB28 SUB48 SUB82 SUB84 MUL2 MUL4 MUL24 MUL42 MUL28 MUL48 MUL82 MUL84 ABS2 ABS4 ABS8 NEG2 NEG4 NEG8 DIV2 DIV4 DIV24 DIV42 MOD2 MOD4 MOD24 MOD42 ADD8 SUB8 MUL8 DVD8 STOI STOD ITOD ITOS DVD2 DVD4 DVD24 DVD42 DVD28 DVD48 DVD82 DVD84 RV1 RV14 RV2 RV24 RV4 RV8 RV LV LRV1 LRV14 LRV2 LRV24 LRV4 LRV8 LRV LLV IND1 IND14 IND2 IND24 IND4 IND8 IND CON1 CON14 CON2 CON24 CON4 CON8 CON LVCON RANG2 RANG42 RSNG2 RSNG42 RANG4 RANG24 RSNG4 RSNG24 STLIM LLIMIT BUFF HALT*ORD2*CONG*CONC*CONC4*ABORT PXPBUF COUNT CASE1OP CASE2OP CASE4OP*CASEBEG*CASE1*CASE2*CASE4*CASEEND ADDT SUBT MULT INCT CTTOT CARD IN ASRT FOR1U FOR2U FOR4U FOR1D FOR2D FOR4D READE READ4 READC READ8 READLN EOF EOLN WRITEC WRITES WRITEF WRITLN PAGE NAM MAX MIN UNIT UNITINP UNITOUT MESSAGE GET PUT FNIL DEFNAME RESET REWRITE FILE REMOVE FLUSH PACK UNPACK ARGC ARGV CLCK WCLCK SCLCK DISPOSE NEW DATE TIME UNDEF ATAN COS EXP LN SIN SQRT CHR2 CHR4 ODD2 ODD4 PRED2 PRED4 PRED24 SUCC2 SUCC4 SUCC24 SEED RANDOM EXPO SQR2 SQR4 SQR8 ROUND TRUNC@(#)rec.c 1.4 4/1/81bcsi@(#)rval.c 1.12 6/1/81rvalrvididdbbbididididttidtidtiitrval2rval3id@(#)stkrval.c 1.4 3/8/81stkrvalstkrvidstkrval3@(#)stat.c 1.5 6/1/81statibbbb@(#)string.c 1.2 11/24/80@(#)subr.c 1.4 11/24/80%s: %s @(#)tmps.c 1.5 6/1/81@(#)tree.c 1.2 11/24/80ttab@(#)type.c 1.6 3/8/81typedbcsi@(#)var.c 1.10 7/8/81widthwclassalign: scalalignaryaryransetran@(#)TRdata.c 1.1 8/27/80#########$$ $$$$$$"$%$)$,$1$6$9$<$?$A$C$F$H$J$L$N$Q$T$V$X$[$^$a$e$i$l$o$r$u$z$~$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%%% % %%%%%%%%%#%'%*%-%5%dpdppdppdppdppdppdppdppdppdppdppdppdppdpdppdppnppdpdppppn"ppn"pppppppppddpppppdpdpppnpnpnpnppnppnpnpnpppnpppnppnppnpnpn"pn"pn"pnppnppnppnppnpppnpppn"npppnpdpppn"ppppppppn"ppdppnpppnpppnpsnnnnnnppnppxunary -moddiv/*+-=<><><=>=notandor:=unary +in@(#)treen.c 1.1 8/27/80@(#)yycopy.c 1.1 8/27/80@(#)pas.y 1.4 3/18/81 0@00               00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" $ # & % ( ) * 0, "0#0- 0. ? 6 7 ^0; < 4 = 2 : 9 8 > ^0E 0F 0H G 00I J 0K 0L 0H M 0N O        R %0 0T U T0? 6 7 ^0; < 4 = 2 : ^09 8 > ^0W X `0Y 000000000c0\ e a j c _ ` b ] ^ g i k n n r t p0u w x v 0y z {  }   }   0 00  +0  H 0V0U0\ e a j c _ ` b ] ^ g i k b0 U  r0x0y0z0{0|0}0 0000000000000000000000000000000000 \ e a j c _ ` b ] ^ g i k 00 00000  U  k0  \ e a j c _ ` b ] ^ g i k  00 .0/0 203040500 80 :0 <0     I000 00   0  ,0H  _0 0 0d0 ]0 }  ]00 0!000000000000 t0(( u0~0 !0!!00 ! 0n  !!! 000!!000010090;0!H  }   }  !!!K0K0!F0H !0000!0*0$0 H !R H %0R H %00a0\ e a j c _ ` b ] ^ g i k 000&!'!%!W0Y0(!)!60   s0 v0w0000+! 00\ e a j c _ ` b ] ^ g i k f00g0 h0 .!  /! 0!l0o0 q000=0>03!2!C0@0A0B0E0 I0H06!-0&00 ;!0 }  ]0Z0e0\000 0? 6 7 ^0^0; < 4 = 2 : ^09 8 > ^0 0C!G0E!F!0J0'0(0)00X070[0i0j0m0D0 }  Q0M! 0?0O!L0L0N!N0(!P!Q!0 }  Q0P0S!O0 V!I0O!M0M0N!W!S0R0/012G\qruz34O4RU4X[\_filo~~o~~44I44Lijkpqx4   #&)*~-238;<ABef444}~4444678=>?@ABCDoI~Zknyz~44 =\{~4~~o +HZKLORSTU4VWXYZ[\~]^mp^ !! """###%&&&&'''$$$$$$$$$$$$$$$$$$$*++++++++++++++++++3344--555555;;;;;<<77)).......////00000022,,=6:89(1++P '-SR6Z:p/ !E|K%(>ENQGLM7 8CH!"Q!9":~%K3D5FLSU4QTINRJ1VW *)?.@/A0B01%=3;q57[9o=s]^ghitvy   $-1;Gl@1@6@8m:@;@W@@@@@)@.@/@0@dfh,AByCzD#$< #)+-/1357K_acekqsw})+-/1359;=ACGIMQbeginrecordbegincase@(#)yycosts.c 1.2 3/8/81;,:=*+/-|&()[]<>~^Insert Delete Rep(ID) Symbol %4d %4d %4d %s%s @(#)yyerror.c 1.2 3/8/81^--- @(#)yyget.c 1.1 8/27/80 includer@(#)yyid.c 1.3 3/8/81@(#)yylex.c 1.2 3/8/81unyylex@(#)yymain.c 1.2 3/8/81No lines in file/usr/lib/px_headermagic2@(#)yyoptions.c 1.1 8/27/80@(#)yypanic.c 1.2 3/8/81@(#)yyparse.c 1.2 3/8/81yyparse@(#)yyprint.c 1.2 3/8/81case-labelend-of-fileillegal charactererroridentifierreal numbernumbercharacterstring'..''x''x''x''x'keyword @(#)yyput.c 1.2 3/8/81r %6d %s %s: @(#)yyrecover.c 1.2 3/8/81dddddddddStates %d %d ... [Idfail]Input %s%s | %s%s Try Replace %s identifier with %s identifier cost=%d Cost %2d Replace %s identifier with %s identifier Unique symbol %s%s Trying state %d Try Delete %s%s cost=%d Cost %2d Delete %s%s Try Insert %s%s cost=%d Cost %2d Freebie %s%s Cost %2d Insert %s%s Try Replace %s%s with %s%s cost=%d Cost %2d Replace %s%s with %s%s Stack %d | %d, Input %s%s TIP OVFLO Shift to state %d YyEactr objects: have %s id, want %s id Reduce, length %d, new state %d Accept Error loccor@(#)yyseman.c 1.1 8/27/80@(#)yytree.c 1.1 8/27/80@(#)p2put.c 1.9 6/1/81@(#)stab.c 1.6 3/24/81@(#)pcproc.c 1.6 6/1/81@(#)pcfunc.c 1.6 6/1/81@(#)pccaseop.c 1.7 6/1/81@(#)pclval.c 1.4 6/1/81Wed Jul 8 23:36:45 1981M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDecUnknown error: #Z\(( r< (/h7| >FP N@Vd]xeDlt|h<$t*H+x078 l:@  <X =%t -C7 ?CF Q Y I^` f$Rmuk{xxD |d  !|4!$X!4x!!d!Ԧ!p%,"-p58%=ܫFP%NVl%^8hXRpzRȼRSl,SLSSSSSdT&2T:@HJ WR[~ =(Q|0X8@v E-OdXt*afj Fr<dyT12   GD OuNxyNwvܒuw  c* &N  %/> .WP 8@^ GLPNpzQUr _<gpnv8}D|xlDP rЂ Ԃ ؂ s| @ P" 4$ ( , '0 4 8 sX" t& d%- x0 h 9 M @ +|J ~R Z ed n x  ]S  H  dJH 'd x G g T T < `  t ft 5   bR# x' c0 9 B 2wJ vR "0vZ Jb Pj <s n} L QL Ԝ  $ 6 x V: z( H R( o4 + =` 47 nx 0 oC & '" J) p/ L6 rp= E M 8T ] f n w  *  F7  @8 d9 k $ *l: $; <  k{ XA A x u  4  l  w  g &  +  4  > .(E M S zDZ ` Gi $q bXy  ;t t x 2H    .X f`  Z  y Px   H t  ~W  x  C| *  4 % A  L  W 1 ` ,j 3t } 5p   I RL  L mP O jQ W8Q 2 $R tt }z F  , "xu  Lx7x$ @y,y6=#VF~XzN6{V`{]| jc uO#~x&8XTpR ~ P!2T!(0!pXP  3!!#!+ 4>žDWMqU P^ TgDpdy4>rsx)Ԧl^VGH"p Hܫ UX %@!F'I-;K3[DQ:4CMnzV_h tP{2UK8DڹHtR_wXȼ `R ( ,G8%.6T?GOXY\c SgNpy 0~blh Md. {H d Eh B(*`~ ez     #,U6TA L(We8^Ne^oNx*nT_TT S @ VH (  qT X (\ ` d h pq |  t?f) 29zAPpIP~zYZc jLrX|[RyTl3  L7 \ycrt0.oato.o_sccsidcall.o_sccsidcase.o_sccsidclas.o_sccsidconst.o_sccsidconv.o_sccsidcset.o_sccsiderror.o_sccsidfdec.o_sccsidfend.o_sccsidfhdr.o_sccsidflvalue.o_sccsidforop.o_sccsidfunc.o_sccsidgen.o_sccsidhash.o_sccsidlab.o_sccsidlookup.o_sccsidlval.o_sccsidstklval.o_sccsidmain.o_copyright_sccsidnl.o_sccsidproc.o_sccsidput.o_sccsidrec.o_sccsidrval.o_sccsidstkrval.o_sccsidstat.o_sccsidstring.o_sccsidsubr.o_sccsidtmps.o_sccsidtree.o_sccsidtype.o_sccsidvar.o_sccsidTRdata.o_sccsidtreen.o_sccsidyycopy.o_sccsidy.tab.o_sccsidyycosts.o_sccsidyyerror.o_sccsidyyget.o_sccsidyyid.o_sccsidyylex.o_sccsidyymain.o_sccsid_magichdryyoptions.o_sccsidyypanic.o_sccsidyyparse.o_sccsidyyprint.o_sccsidyyput.o_sccsidyyrecover.o_sccsid_ntokyyseman.o_sccsidyytree.o_sccsidp2put.o_sccsidstab.o_sccsidpcproc.o_sccsidpcfunc.o_sccsidpccaseop.o_sccsidpclval.o_sccsidVersion.oabort.octime.ofork.ofprintf.ofopen.ocreat.ofseek.operror.oerrlst.oprintf.ordwr.oatof.ofilbuf.oldexp.ostrlen.oexecl.oexecv.oexecve.osignal.olseek.otime.osprintf.odoprnt.oflsbuf.oexit.odata.oclose.oisatty.oopen.oread.ostat.ostty.oioctl.ounlink.omalloc.osbrk.oudiv.owait.owrite.ocerror.o_exitstart_main_environ_fulltrace_errtrace_testtrace_yyunique_opts_optstk_monflg_profflag_Recovery_Eholdnl_Enocascade_eflg_errpfx_cgenflg_syneflg_efil_ofil_obuf_Enoline_nlp_disptab_clnames_bn_cbn_line_display_frtn_sizes_dfiles_con_set_MAXINT_MININT_gocnt_cnts_parts_divchk_divflg_errcnt_forechain_withlist_intset_input_output_program_progseen_level_gotos_noreach_lc_pflist_pflstc_pfcnt_filename_tvec_a8tol_error_call_classify_put_lwidth_leven_plist_panic_lvalue_rvalue_compat_cerror_isa_rangechk_convert_flvalue_fcompat_rvlist_width_even_linenum_parnam_caseop_isnta_nameof_malloc_pexit_gconst_putspace_getlab_free_patchfil_putcnt_statement_ungoto_patch_clnxxxx_nl_text_scalar_nowexp_whereis_constbeg_level1_const_defnl_enter_constend_lookup_classes_atof_bytes_savestr_isconst_conv_precset_mask_setran_constval_postcset_stkrval_ibuf_ibp_charbuf_bufp_token_yyprtd_yycol_yyline_yyseqid_yysavc_yylinpt_Y_OY_Ps_yyval_N_lastkey_yykey_yyResume_dquote_errout_yyidhave_yyidwant_yyshifts_yyOshifts_yytshifts_printf_abort_Perror_geterr_yyoutline_yysetfile_pchr_bodycnts_cntpatch_nfppatch_funcfwd_funcext_funcbody_segend_pnums_pnumcnt_nerror_Fp_yySsync_funcend_cntstat_patch((4_lenstr_putstr_inccnt_strcmp_lookup1_statlist_dumpnl_nlfree_inpflist_opop_funchdr_opush_yyretrieve_getcnt_params_gtype_fparams_tmpalloc_forop_putline_gen_putlab_funccod_stklval_arret0_arret1_arret_arop_setop_ar8op_artab0_artab1_artab_reltab0_reltab1_reltab_asgntb0_asgntb1_asgntab_genmx_htab_inithash_hash_calloc_yerror_label_gotoop_labeled_flagwas_reclook_lptr_arycod_aryconst_piusage_pixusage_pcusage_usageis_errfile_obj_howfile_pcstream_creat_perror_fork_execl_wait_yycosts_dotted_togopt_open_close_fopen_signal_onintr_yymain_ugh__iob__flsbuf_getline_yyflush_write_unlink_pflush_lseek_read_header_gettime_myctime_version_ntab_nlact_in_consts_in_types_in_rclasses_in_ranges_in_ctypes_in_vars_in_funcs_in_procs_in_fops_in_pops_initnl_hdefnl_VARIABLE_snark_ctext_stars_nloff_nlcopy_rdxxxx_proc_listnames_tmpfree_sprintf_obufp_otext_word_getnextudiv_P0_tyrec_tyrec1_fields_variants_align_roundup_deffld_defvnt_uniqv_reccompline_nssetline_opnames_nocomp_ifop_asgnop_whilop_repop_withop_asrtop_asgnop1_strings_strng_strngp_strlen_strcpy_esavestr_stat_ctime_fprintf_copy_any_ttab_tract_space_spacep_trspace_inittree_tree_tralloc_trfree_yylacnt_bottled_copystr_typebeg_type_typeend_foredecl_tyscal_tyrang_tyary_norange_varbeg_var_varend_dotalign_trdesc_tree1_tree2_tree3_tree4_tree5_OYcopy_yypv_yyactr_yyact_yypact_yyr1_yyr2_yygo_yypgo_fixlist_yyPerror_brerror_newlist_addlist_setuptyrec_yylex_setupvar_setupfield_yyEactr_identis_inscost_repcost_delcost_nullsem_yysyms_yydocost_charname_yysync_readch_incs_inclev_yyLinpt__filbuf_uninclud_includ_setuflg_skipbl_printed_fclose_yyidok_yybadref_yybaduse_ud_yyidok1_yyisvar_Yla_unyylex_yyset_options_magic_yyparse_magic2_time_oldpos_yystate_yyv_yys_yyrecover_yyunexeof_yyexeof_bounce_tokname_lastname_lastid_hadsome_holdbl_yyoutfl_yyprline_yygetunit_yygetfile_yygetline_fseek_fread_yyprintf_graphic_yyputfn_insmult_repmult_delmult_yytips_yytipct_yytipv_yCcnt_YC0_YC_yyTshifts_cact_ccost_cchar_cflag_ACtok_correct_trystate_yCpv_yyredfail_loccor_localtime_asctime_ftime_gmtime_dysizecerror__doprnt__lastbuf_errno_fflush_sys_nerr_sys_errlist_fwrite_ldexp_execv_execve_isatty__sobuf__cleanup__sibuf_gtty_stty_ioctl_sbrk_realloc_end_brke_tokname_lastname_lastid_hadsome_holdbl_yyoutfl_yyprline_yygetunit_yygetfucb/cxref 755 0 33 72 2532073535 5604 : echo "use 'ctags -x' instead of cxref" exec ctags -x $* insmult_repmult_delmult_yytips_yytipct_yytipv_yCcnt_YC0_YC_yyTshifts_cact_ccost_cchar_cflag_ACtok_correct_trystate_yCpv_yyredfail_loccor_localtime_asctime_ftime_gmtime_dysizecerror__doprnt__lastbuf_errno_fflush_sys_nerr_sys_errlist_fwrite_ldexp_execv_execve_isatty__sobuf__cleanup__sibuf_gtty_stty_ioctl_sbrk_realloc_/pT,pT5@d /,"ucb/lnall 755 0 33 44 2532122413 5564 echo 'use ln, not lnall' exec ln $* ref" exec ctags -x $* insmult_repmult_delmult_yytips_yytipct_yytipv_yCcnt_YC0_YC_yyTshifts_cact_ccost_cchar_cflag_ACtok_correct_trystate_yCpv_yyredfail_loccor_localtime_asctime_ftime_gmtime_dysizecerror__doprnt__lastbuf_errno_fflush_sys_nerr_sys_errlist_fwrite_ldexp_execv_execve_isatty__sobuf__cleanup__sibuf_gtty_stty_ioctl_sbrk_realloc_/pT,pT5Pd /,"ucb/see 755 0 33 24 2532142667 5251 exec /bin/cat -v $* all' exec ln $* ref" exec ctags -x $* insmult_repmult_delmult_yytips_yytipct_yytipv_yCcnt_YC0_YC_yyTshifts_cact_ccost_cchar_cflag_ACtok_correct_trystate_yCpv_yyredfail_loccor_localtime_asctime_ftime_gmtime_dysizecerror__doprnt__lastbuf_errno_fflush_sys_nerr_sys_errlist_fwrite_ldexp_execv_execve_isatty__sobuf__cleanup__sibuf_gtty_stty_ioctl_sbrk_realloc_/pT,pT5`d /,"ucb/tra 755 0 33 127 2532145726 5306 echo "tra is obsolete; use 'tail -f' instead" echo "see 'man tail' for details" exit 1 tips_yytipct_yytipv_yCcnt_YC0_YC_yyTshifts_cact_ccost_cchar_cflag_ACtok_correct_trystate_yCpv_yyredfail_loccor_localtime_asctime_ftime_gmtime_dysizecerror__doprnt__lastbuf_errno_fflush_sys_nerr_sys_errlist_fwrite_ldexp_execv_execve_isatty__sobuf__cleanup__sibuf_gtty_stty_ioctl_sbrk_realloc_/pT,pT5pd /,"ucb/eyacc 755 0 33 74047 2552600626 5655 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q@AZ.Z[MW/~S ZZ[P@ﮁ9/^Sk Z&/GST [[Y[P[[z1. ^\.E׭1ݭUЭPЭ@pԭԭ׭YЭP@.GL@%GAԭ@GP׭ЭP@G֭ѭ ЭЭPPPP"ԭ׭>ЭP@F1@F&PЭP@F|E"C3"ݏRݭH"x-׭ЭP@A !@^!~#ЬP@խhԭԭѭЭP@PÏ;ЭP@Ի.ЭP@oPÏ`ЭP@ﲻ @碌֭ ,rЬP@M,Pԭ׭'ЭP@_@,P ,PDЬP@_,FPSԭcЭP@Ӻ1ЭP@PЭQ@M~AwDЭP@lD@cDP ,O֭ѭ=P@U.ЭP@H.ѭнP`ѭ1\^ЬP@ЬP@ePxPxQPQPxPxQPQPP(^[ԭҹy׭eЭP@ﴹX4@惡PIԭЭP@׭ЭP@}P֭ѭ ЭЭ׭ЭP@6P ЭP@(ԭP@,ЬP@, ЭѭܭyнP`ѭ խѭЬP@Bݬԭ׭1TЭP@1BxPP~Jխ1í0~1(-ÏP@ݬ)Mԭѭ1cЬPЭQ@6A61(QP)VMcP@+ЭP@+нP`<ѭܭέPЬQPAAЭP@vAIGݬ֭1Tѭݏ@ѭݏ ~0~ݏPЬQPA@PP^ݬ(GLTP@*ЬP@*#ݭP( LѭЬP@b@@Y@~_(K׭1ЭP@gvPP6(Kխ<ѭ((vK,ѭݭ' έ~'HKUOpd\'K)'KO^r'0a#'ݬPP$'ݬPЭPJ ЬJ'Iݬ>bJ լ ݬqP׼ЬPРQ֠aP ݬ׼ЬPРQ֠aaP ݬݬ ݬ \~ݬЬP PPЬ['XX6(PX 鑫+PPPYkw+ݏݬPZY1ZZ kalYPPPݬ PZ<@I3ݏݬ}PZYZZI ݬm PZZ)ZYPPPݬ@ PZZ1hZY kr  XP ^ЬP ЬP 1Ѭ sՠn iмZЬլ ~PPZPPZЬP )Z%ѭZPQáPѭPQP­P[[ЬP PQРЬP ݬ [~ЬP~}PԼ[h׼ ЬP֠ZݬbNЬP BP ЬP ԼЬP ЬPPQРݬ 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X@(#)ey0.c 4.1 (Berkeley) 3/1/81X./yopt -r./yopt -rv./yopt./yopt -v/usr/nlib/yaccopt-r-rv-voptimization execl call failsMH2019.yaccopt -rMH2019.yaccopt -rvMH2019.yaccoptMH2019.yaccopt -v : int nterms %d; int nnonter %d; int nstate %d; char *yysterm[] { "%s", 0 }; char *yysnter[] { "%s", "%s" }; %d/%d terminals, %d/%d nonterminals %d/%d grammar rules, %d/%d states %d shift/reduce, %d reduce/reduce conflicts reported %d/%d working sets used memory: states,etc. %d/%d, parser %d/%d %d/%d distinct lookahead sets %d extra closures %d action entries %d action entries saved through merging %d states %d goto entries %d entries saved by goto default (( conflicts: %d shift/reduce, %d reduce/reduce fatal error: , line %d int %s[] {0,%d ,-1}; memory overflow NULL { %s }@(#)ey1.c 4.1 (Berkeley) 3/1/81^y.outputcannot open y.outputillegal option: %cyacc.tmpy.tab.ccannot open table filecannot open input# $enderror$acceptdefine yyerrok yyerrf = 0 define yyclearin yychar = -1 subroutine yyactr(yyprdn) common/yycomn/yylval,yyval,yypv,yyvalv(150) common/yylcom/yychar,yyerrf,yydebu integer yychar, yyerrf, yydebu integer yyprdn,yyval,yylval,yypv,yyvalv #define yyclearin yychar = -1 #define yyerrok yyerrflag = 0 extern int yychar, yyerrflag; int yyval 0; int *yypv; int yylval 0; yyactr(__np__){ please define type # of %s earlierbad precedence syntax, input %dgoto 1000 switch(__np__){ previous rule not terminatedtoken illegal on lhs of grammar rulemissing :semicolon preceeds action %d case %d: return break;rule not terminated before %%%% or EOF%%prec must appear inside ruleillegal %%prec syntaxnonterminal %s illegal after %%prec%%{ appears within a rulesyntax error, input %d 1000 goto(%d,999),yyprdn 999 return end define YYERRCODE %d } } int yyerrval %d; too many nonterminals, limit %dtoo many terminals, limit %dinvalid escapeillegal \nnn construction'\000' is illegal%c define %s %d too many characters in id's and literalsillegal /illegal or missing ' or "termTERMtokenTOKENleftLEFTnonassocNONASSOCbinaryBINARYrightRIGHTprecPRECinvalid escape, or illegal reserved word: %s%s should have been defined earliereof before %%}yyvalyyvalv(yypv%c%d)yypv[%d]EOF inside commentEOF in string or character constantaction does not terminate@(#)ey2.c 4.2 (Berkeley) 4/1/81_nonterminal %s not defined! %s: %d too many statesputitem(%s), state %d yacc error--duplicate itemout of state space%d: %s %d, %s %d, working set overflow State %d, nolook = %d flag set! %s too many lookahead sets@(#)ey3.c 4.1 (Berkeley) 3/1/81ayyact %d: reduce/reduce conflict (red'ns %d and %d ) on %s %d: shift/reduce conflict (shift %d, red'n %d) on %syypactyyr1yyr2off = %d, k = %d action table overflow %d no space in action tableyygoyypgo%s: gotos on %s nonterminal %s %d %d state %d, pre-nonterminal %s states %d and %d have equal positions state %d %s same as %d %s accepterrorshift %dreduce %d . reduce %d . error @(#)ey4.c 4.1 (Berkeley) 3/1/81arawThe function "system" is called@(#)ey5.c 4.1 (Berkeley) 3/1/81ԈԈLch r<P<pU'-X5;^C,I_Q9Wa_:g:o:wf:~; <0<Lx=<>L>d>p>>fFyHIII0I@IPI |II7K!K($L04L9H?E~<KrPT 0Tc]Pe  Pm K\cu Ln~ d |0U&4U. R5 <8UD M+(: Ȅ:[TK :). b/74?szHNtW,_&guFn/tvD9} ̄Ph" (::^^n+E ^G>#^7^ ,(L0 0!L:5*b51*/8W_A_J<3RK_Zf8cx;je0<qLHyP:H:x=fF~@Lc. <;I0I Єp>4LI@IL>d>$L3I  ԄxHyJ" Ԉ*fI0PI6|I=KBKH7KQ hVK[crt0.oey0.o_sccsidey1.o_sccsidey2.o_sccsidey3.o_sccsidey4.o_sccsidey5.o_sccsidabort.ofgetc.ofputc.ofprintf.ofopen.ocreat.ofseek.ofilbuf.oexecl.oexecv.oexecve.olseek.odoprnt.oflsbuf.oexit.odata.oclose.oisatty.oopen.oread.ostty.oioctl.omalloc.osbrk.oudiv.owrite.ocerror.o_exitstart_main_environ_tbitset_nolook_nstate_pstate_apstate_tystate_stsize_memsiz_mem0_mem_amem_actsiz_memact_nprod_prdptr_prdlim_levprd_nterms_tlim_extval_trmset_cnames_cnamsz_cnamp_maxtmp_temp1_temp2_trmlev_nontrst_ntlim_indgo_pres_pfirst_pempty_nnonter_lastred_ftable_foutput_arrndx_zzcwset_zzpairs_zzgoent_zzgobest_zzacent_zzacsave_zznsave_zzclose_zzsrconf_zzrrconf_ctokn_lineno_peekc_tstates_ntstates_mstates_clset_lkst_nlset_lsetsz_wsets_cwset_wssize_numbval_rflag_oflag_ndefout_nerrors_fatfl_machine_whereami_setup_cpres_cempty_cpfir_stagen_output_go2out_summary_windup_cexit_system_execl_error_settty_cflush_cout_settab_chcopy_writem_symnam_fprintf__iob_arrset_arrval_arrdone_copy_compare_yalloc_aryfil_UNION_prlook_copen_cin_defin_chfind_gettok_defout_cpycode_cpyact_finact_fputc_fgetc_chstash_indebug_flset_state_pidebug_putitem_gsdebug_cldebug_closure_apack_go2_precftn_wract_prred_pkdebug_g2debug_go2gen_cdebug_wrstate_fopen_fseek_fflush_cclose_fclose_abort__filbuf__flsbuf__doprnt__lastbuf_creat_close_open_errno_lseekcerror_malloc_read_execv_execve_write_isatty__sobuf__cleanup_free__sibuf_gtty_stty_ioctludiv_sbrk_realloc_end_brkloc_aryfil_UNION_prlook_copen_cin_defin_chfind_gettok_defout_cpycode_cpyact_finact_fputc_fgetc_chstash_indebug_flset_state_pidebug_putitem_gsdebug_cldebug_closure_apack_go2_precftn_wract_prred_pkdebug_g2debug_go2gen_cdebug_wrstate_fopen_fseek_fflush_cclose_fclose_abort__filbuf__flsbuf__doprnt__lastbuf_creat_close_open_errno_lseekcerror_malloc_read_execv_execve_write_isatty__sobuf__cleanup_free__sibuf_gtty_sttucb/pc 755 0 33 36713 2552606753 5200  ^Юn PPՀPpPP P ^׬լH(@(3(2Pχ "| ZZ1J[k-QPPiS1JPb11PS11PJ11PC1Zd+FPϢ'@A9;ZP@P`-7ZP@ Pp!ZP Q@AZZPPZPPH'Ϩ)ϋ 1xZZB'ω)l ϡJp PopcJ"'O)2 σ*1w*1k*1PP0P1+P2;P3KP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ݬ [$P[ ,>P`l~ 1EYjyError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large\~ݬ,PP Ь[ZZZPЬ[ЬZ[XY YY  YXPݬ|ݬݬ;j0\QP  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj~P  BЫZ֫ZPѫPѬ ZPPXPZ~%PYZkn 1mЫZ3[+1xݏPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PPY PP0[ [[[Z Ь[Z = 8[ePZ~YPZ ݫc ԫ kZP{ Ь[ЬZkPkPzQQPP^߭ݬ4PPPlݬݏ tݬݬݏtݬ60  PЬPЬRRQ{RPRPPPRRPl.4^4VPSAD~*PY-[2k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [4PYPƏPxPbPZxPZPPZx~@PZZZzPZPmxnPZPPjjW4K1xYP[P8Z1),kk[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP]@j ~\S^\ P Ь PЬPЬRRQ{RPPR PRPPЭRBQP PbPbլQPq P@(#)pc.c 3.12 6/8/81T*a*i*v*~*************/bin/catcat/usr/lib/how_pc-ipc: bad -i construction pc: -o must specify file pc: -o would overwrite %s /usr/src/cmd/pc0/a.out/usr/src/cmd/pcc/pc1/usr/src/cmd/pascal/pc2/usr/src/cmd/pascal/pc3/usr/src/lib/libpc/libpcpc: -t is default; -C for checking pc: warning: -g overrides -O /tmp/p0XXXXXX/tmp/p1XXXXXX-J-o-p-J-opc3-old-X-lg-lnm-lc%s: %s <%s >%s pc: No more processes Fatal error in %s ran out of memory (savestr) /usr/lib/pc0/lib/f1/usr/lib/pc2/lib/c2/usr/lib/pc3/bin/ld/bin/as-lpc/lib/crt0.o/lib/mcrt0.opc0-oXXXpc1pc2c2as/Unknown error: #00((0,4 r<  "~ + 4 < E( NW~,`$@jlr|zf,y4@@`p7@ #,428~<>r G L Q$ Vt( Z, _0 c4 g8 lJ< rl@ y 8, @, MH, L, P, T, X, \, `,D ,H 'L 7L(GX(;`(\p( d, t( h,  l, p, t,zl#+ 3 ;.*A Jx Rl Z4 b^ iuq yo @D\ ?;` . | x, |,$,@~Fp   ,%*/( <CKTf,]3pe ,mL^u0,y 0@7 4mcrt0.opc.o_sccsidfprintf.omktemp.oaccess.ocreat.operror.oerrlst.oprintf.ostrlen.ostrncpy.oexecl.oexecv.oexecve.osignal.ogetpid.odoprnt.oflsbuf.oexit.odata.ostrcmp.oclose.oisatty.oopen.ostty.oioctl.ounlink.ourem.omalloc.osbrk.oudiv.ovfork.owait.owrite.ocerror.o_exitstart_main_environ_pc0_pc1_pc2_c2_pc3_ld_as_lpc_crt0_mcrt0_tname_tfile_Jflag_Sflag_Oflag_cflag_gflag_pflag_debug_ldargx_pc0argx_pc0args_pc1args_pc2args_c2args_pc3argx_asargx_asargs_np_nxo_onepso_errs_execl_signal_onintr_getsuf__iob_fprintf_mktemp_suffix_setsuf_dosys_unlink_remove_done_strcmp_savestr_printf_vfork_close_open_perror_creat_execv_wait_savetab_saveleft_strlen_malloc_strncpy__doprnt_getpiduremudiv_accesscerror_errno_sys_nerr_sys_errlist_write_execve_getppid__flsbuf_isatty__sobuf_fflush__cleanup_fclose__lastbuf_free__sibuf_gtty_stty_ioctl_sbrk_realloc_end_brkc0args_pc1args_pc2args_c2args_pc3argx_asargx_asucb/pxref 775 0 33 60635 2552607027 5717 << ^Юn PPՀPpPP;P61'"m}}\ $PPP\PPPPPPP PT PT)PacݭЎQС PPݏ<!ݭЎQС PP ~ 2+ P֡ݏ`1Ï@PP`@a@6ݏGPݭЎQС PP ~ * P֡ÏPPPݭ\@]ÏPPOPDI==@ݏ<ݭЎQС PPݭЎQС PPݏ<}c^1uݬnPxQ(Q4AЎPxQ(Q 1m} }\ݏ@ݬÏ]PPÏ]PP6P1 Ï]PPo`#1Ï]PPV`"E2?PPPy?Ï]PP\Pݭ\?Q2M?RRPBa2>?PPP4?Ï]PPPݭ?Q2?RRPBa>(@O1>>PP>>@$Ï]PPz>Q^>R`Ba2>PPP>Ï]PPPݭ>Q2q>RRPBaÏ]PP!`"1dÏ]PPPE26>PPP,>Ï]PPPݭ>Q2>RRPBa(0>( ݏJ1+Ï]PPpP1 Ï]PPl` PPPtÏ]PPJ` PPtPF2i=PPP_=Ï]PPBPݭB=Q23=RRPBa1}Ï]PP `P@=1)<(/><PP<<$Ï]PP =Qk<R`Ba2<PPP<Ï]PPPݭ<Q2~<RRPBaÏ]PP. `P@<PPPPPtÏ]PP `P@<PPtP1&ݏhKݏK?^(=nP&13Ï]PP `P@T<c2;PPP;Ï]PPPݭ;Q2;RRPBaÏ]PP6 `P@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ZZݬ![P[!X'`'j''''''''(("(2(D(P(f(x((((((((()),)D)Q)g)v)))Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large^Ь[ЬZԭլ05Ьj ЪP֪`P ZoPYY׭֭ѭ ЭP^Ь[ЬZԭլ.3ЬYj ЪP֪` Z~ Y ֭ѭ ЭPЬ[  P ݏq P ի ߘP@z [H   P2PPݫ~ PkЫk!k    k1WP֫Ь[ի ݫ* Ь Ыk Ь[ZZZP(+QP^BЬ2߭ \~ݬ׭ ЭP֭` ߭rЬP  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~ PYj<~P g_ BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[H1xݏPZZ  YYX ZYYXZYZ~8PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[ Ь[Z = 8[ePZ~9PZ ݫ+ ԫ kZP{8P^߭ݬDPPPݬݏ tݬݬݏtݬ6 P4.(&$ ~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZﶜ [$P靖YPƏPxPbPZx|PZPPZxl~@PZZZIBPZP5x6PZPPjj$1xYP[PZkޛk[P Ь[[ZZZśjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP%@j~\S^\_PCЬPЬPЬRRQ{RPPR PRPPPqP(( **** table full%6D text too long%6D #include usage: pxref [ - ] fileusage: pxref [ - ] fileand array assert begin case const div do downto else end file for function hex if in mod nil not oct of or packed procedure program record repeat set then to type until var while with %10D identifiers%10D occurrences@(#)ARGV.c 1.3 6/10/81Argument to argv of %D is out of range @(#)BUFF.c 1.2 3/7/81@(#)FNIL.c 1.3 6/10/81Reference to an inactive file %s: Reference to an inactive file @(#)GET.c 1.2 6/10/81%s: Attempt to read, but open for writing %s: Tried to read past end of file @(#)NEW.c 1.3 6/10/81Ran out of memory @(#)PACK.c 1.3 6/10/81i = %D: Bad i to pack(a,i,z) @(#)READC.c 1.2 6/10/81%s: Attempt to read, but open for writing %s: Tried to read past end of file @(#)RESET.c 1.4 6/10/81Could not reset rCould not open @(#)TEOF.c 1.3 6/10/81Reference to an inactive file @(#)TEOLN.c 1.3 6/10/81Reference to an inactive file @(#)UNIT.c 1.2 6/10/81Reference to an inactive file %s: Reference to an inactive file @(#)ERROR.c 1.8 6/10/81Label of %D not found in case @(#)GETNAME.c 1.6 6/10/81%s: Close failed Could not remove #tmp.%c%d%s: File name too long @(#)IOSYNC.c 1.5 6/10/81%s: Attempt to read, but open for writing %s: Tried to read past end of file %s: Tried to read past end of file @(#)PCEXIT.c 1.1 10/29/80pC %1ld %s %04.2f seconds cpu time. statements executed in@(#)PCLOSE.c 1.4 6/10/81%s: Close failed Could not remove @(#)PCSTART.c 1.5 6/10/81 FFGGHGGTHGGaHHastandard inputstandard outputMessage file@(#)PERROR.c 1.1 6/10/81@(#)PFLUSH.c 1.1 10/29/80@(#)UNWIND.c 1.2 3/7/81@(#)ACTFILE.c 1.1 10/29/80Unknown error: #I< r<000$0-060 ?0 J0 T0 a0 c0f0m0r0x00000000!0'0'0(0)0*0+0+0,0-0-0.0/0001020<0=0> 0?0D0V0{&010;BI P3lV3]<cjr3 z3 3LF N!!""#L(#S4#D#P#f|#f#~#$ %(LP&1&:)AfL*J+SyH+\$\+dl+lt+u+f+f84y@6L6L6\6|66666679X999@6 ~r<'2Lv" 'I% I* I4 I9 J? )JB JF , JI sJM tJQ J\ XJe `Jk 'Jv hKz K} 2K  }@r<4# /XZX<Gf84[)F#][^4LHLNlS hE{ . B  !"  ,!D# + F 3 (600E9EBFIe%P`"Xat#hJ#p.HvP#}S(#UEjELj55u6pt+F+N)6El+IEE4G  b |#P&~R-I).$0;L67|6= D\+K9RL*[He&r$H+z96yT8y+3\65 666X997p8 <A9crt0.opxref.opxref.p_99_100alfasizelinesizenamesizelinelengthmaxlinenocharclassizepnkblanksalfaindexlinptrlinebufreffilenamecharclassescharclasstypeworditemitopformfeedscrlistkk1nc1c2inputfilelineptrlinecharclassidatkeyemptynokeysearchprintwordprinttablereadinputARGV.oBUFF.oFNIL.oGET.oGOTO.oNEW.oPACK.oREADC.oRESET.oTEOF.oTEOLN.oUNIT.oERROR.oGETNAME.oIOSYNC.oPCEXIT.oPCLOSE.oPCSTART.oPERROR.oPFLUSH.oSETRACE.oUNWIND.oACTFILE.ofputc.ofputs.ofprintf.ofopen.ocreat.ofseek.operror.oerrlst.ordwr.ofilbuf.osetbuf.ostrlen.olseek.otimes.ogetpid.osprintf.odoprnt.oflsbuf.oexit.odata.oclose.oisatty.oopen.oread.ostty.oioctl.ounlink.omalloc.osbrk.oudiv.owrite.ocerror.o_exitstart_main_environ_99_100_i_top_formfeed_scr_list_k_k1_n_c1_c2_inputfile_lineptr_line_charclass_id_a_t_key_empty___nokey_nokey_UNWIND__disply___search_search_NEW_output__flsbuf_fwrite_GOTO___printword_printword_fprintf___printtable_printtable___readinput_lwriteln_readinput_lwriteln_UNIT_GET___readinput_newline_readinput_newline_FNIL_TEOLN___readinput_readinput_RESET_TEOF_READC_PACK_PCLOSE_PCSTART__argc__argv_program_PCEXIT_BUFF_ARGV_ERROR_ACTFILE__sobuf_setbuf__actfile_IOSYNC_malloc__minptr__maxptr_input_fseek_PERROR_GETNAME_fopen_PFLUSH__iob_fputc_SETRACE__filefre__fchain_fflush_fclose_unlink_getpid_sprintf_fread__stcnt_times__stlim__seed__err__inwin__outwin__errwin_fputs_perror__doprnt__lastbuf_creat_close_open_errno_lseekcerror__filbuf_sys_nerr_sys_errlist_strlen_write_read_free_getppid_isatty__cleanup__sibuf_gtty_stty_ioctludiv_sbrk_realloc_end_brk_PCEXIT_BUFF_ARGV_ERROR_ACTFILE__sobuf_setbuf__actfile_IOSYNC_malloc__minptr__maxptr_iucb/pix 755 0 33 16755 2552606753 5402 P((^Юn PPՀPpPP P ^PPPݭuPcZZݏpJP1Zruoݏ\uPP1NPP5խbѭ%cJPЬQPaݬtBݭ߭PP Pѭ ӏխ#xPP/ZDJЬP@xZPP~!jZ1\PzPP1gݬJP[[ЬP[QA`.[QA`PPKUQP'PZЬ[[ ZY0PPk ZpPZ{X[aYYz PYkYݬ PЬP!xh h [p P@X[ݬ)PZZݬ4 [P[ hpz 2BT`v -<TawError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large Ь[ZZZP, ݬݬ;0QPCP |PЬPЬRRQ{RPRPPPRRPЬPЬRRQ{RPPR PRPPլQPi P^Ь[    PPYYX1XX߭~PYj~P    BЫZ֫ZPѫPѬ ZPPXPZ~=PYZkn 1mЫZ3[1xݏPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~hPY PP[ [[[ Ь[Z = 8[ePZ~qPZ ݫ ԫ kZP^߭ݬ$PPPݬݏ tݬݬݏtݬ6.<8~PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ~ [8PpYPƏPxPWbPZxDPZPPZx4~@PZZZ PZPxPZPPjj81xYP[PZkk[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~jPYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP @j~\S^\GP+ЬP@(#)pix.c 1.2 3/6/81/dev/null-o/tmp/pixaXXXXXNo more processes Impossible error in pix /usr/ucb/piCan't find pi Execution suppressed due to compilation errors /usr/ucb/pxCan't find px /Unknown error: #88(P r< )@2P:`CLU$]fox,<Lty   $ 4 7` ~<r 0,;#+3b;xC.PJPW^ 4ek`s${u<pLt@\ f.3  84 L ~ (y  8% + 1$ 8` >7 G PL Qcrt0.opix.o_sccsidfork.omktemp.oaccess.ocreat.operror.oerrlst.ostrlen.oexecv.oexecve.osignal.ogetpid.oexit.oclose.oopen.ounlink.ourem.oudiv.owait.owrite.ocerror.oflsbuf.odata.oisatty.ostty.oioctl.omalloc.osbrk.o_exitstart_main_environ_name_open_close_signal_onintr_dotted_mktemp_creat_fork_write_execv_errno_wait_perror_strlen_unlinkcerror_getpiduremudiv_access_sys_nerr_sys_errlist_execve_getppid__cleanup__flsbuf__iob_isatty__sobuf_malloc_fflush_fclose__lastbuf_free__sibuf_gtty_stty_ioctl_sbrk_realloc_end_brkn.oexecv.oexecve.ucb/px 755 0 33 122075 2572604212 5230 d ^Юn PPՀPpPPc P4^ ^ЬwЬsdgP`P`-1UP`PoDP`Z<cZBPVZ+E]ݏVCV ߭Y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PYZkn 1mЫZ3[1xݏPZZ  YYX ZYYXZYZ~xPY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~ PY PP#[ [[[$ Ь[Z = 8[ePZ~9PZ ݫk ԫ kZP{xP^߭ݬDPPPH8ݬݏ tݬݬݏtݬ6Ь[ѬP ѫѫk֫k׫ЫP`P P,.z,r,l,o,],`,~*PYI,[N,k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ , [P+YPƏPxP+bPZx+PZPPZx+~@PZZZ++PZP+x+PZPPjjs+g+1xYP[PT+ZM+E+H+k9+2+k[P Ь[[ZZZ+jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPy*@j4!~\S^\_!P!CЬ PЬPЬRRQ{RPPR PRPPP%PA@(#)int.c 1.4 6/21/81objImproper specification of object file to PX r%s is obsolete and must be recompiled %s is not a Pascal interpreter file Read error occurred while loading %s Execution begins... @(#)interp.c 1.14 6/10/81 xgav$ehatxehTffe$eActive frame not found in non-local goto Label of %D not found in case Label of %D not found in case Label of %D not found in case Message filestandard outputstandard input@(#)except.c 1.6 6/10/81 Overflow arithmetic operation Call to procedure halt Run time stack overflow Panic: Computational error in interpreter Panic: stack not empty between statements Panic: bad op code Panic: unknown error @(#)utilities.c 1.4 3/6/81pC %1ld statements executed in %04.2f seconds cpu time. Program was not executed. Interrupted in " Halted in " Error in "%s"+%D near line %D. Called by "Execution terminated abnormally@(#)ARGV.c 1.3 6/10/81Argument to argv of %D is out of range @(#)ASRT.c 1.2 6/10/81Assertion failed: %s Assertion failed @(#)BUFF.c 1.2 3/7/81@(#)CARD.c 1.2 3/7/81@(#)CHR.c 1.3 6/10/81Argument to chr of %D is out of range @(#)CLCK.c 1.2 3/7/81@(#)CTTOT.c 1.4 6/10/81Range upper bound of %D out of set bounds Range lower bound of %D out of set bounds Value of %D out of set bounds @(#)DATE.c 1.1 10/29/80   @(#)DEFNAME.c 1.2 3/7/81@(#)DISPOSE.c 1.3 6/10/81Pointer value out of legal range @(#)EXPO.c 1.2 3/7/81%.1e@(#)FLUSH.c 1.2 6/10/81Reference to an inactive file @(#)FNIL.c 1.3 6/10/81Reference to an inactive file %s: Reference to an inactive file @(#)GET.c 1.2 6/10/81%s: Attempt to read, but open for writing %s: Tried to read past end of file @(#)INCT.c 1.2 3/7/81@(#)LINO.c 1.2 6/10/81Statement count limit of %D exceeded @(#)LLIMIT.c 1.3 6/10/81%s: Line limit exceeded @(#)LN.c 1.4 6/10/81Non-positive argument of %e to ln @(#)MAX.c 1.4 6/10/81Non-positive format width: %D @(#)NAM.c 1.3 6/10/81Enumerated type value of %D is out of range on output @(#)NEW.c 1.3 6/10/81Ran out of memory @(#)NEWZ.c 1.3 6/10/81Ran out of memory @(#)NIL.c 1.2 6/10/81Pointer value out of legal range @(#)PACK.c 1.3 6/10/81i = %D: Bad i to pack(a,i,z) @(#)PAGE.c 1.2 6/10/81%s: Attempt to write, but open for reading Could not write to @(#)PRED.c 1.4 6/10/81Cannot take pred of first element of a range Value of %D is out of range @(#)PUT.c 1.3 6/10/81%s: Attempt to write, but open for reading Could not write to @(#)RANDOM.c 1.3 3/7/81O@(#)RANG4.c 1.3 6/10/81Value of %D is out of range @(#)READ4.c 1.5 6/10/81%s: Attempt to read, but open for writing %ld%s: Tried to read past end of file %s: Bad data found on integer read @(#)READ8.c 1.4 6/10/81%s: Attempt to read, but open for writing %lf%s: Tried to read past end of file %s: Bad data found on real read @(#)READC.c 1.2 6/10/81%s: Attempt to read, but open for writing %s: Tried to read past end of file @(#)READE.c 1.5 6/10/81%s: Attempt to read, but open for writing %*[ ]%74[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]%s: Tried to read past end of file Unknown name "%s" found on enumerated type read @(#)READLN.c 1.4 6/10/81@(#)RELEQ.c 1.2 3/7/81@(#)RELTGE.c 1.2 3/7/81@(#)RELTGT.c 1.2 3/7/81@(#)RELTLE.c 1.2 3/7/81@(#)RELTLT.c 1.2 3/7/81@(#)REMOVE.c 1.3 6/10/81%s: File name too long Could not remove @(#)RESET.c 1.4 6/10/81Could not reset rCould not open @(#)REWRITE.c 1.3 6/10/81wCould not create @(#)RSNG4.c 1.3 6/10/81Value of %D is out of range @(#)SCLCK.c 1.2 3/7/81@(#)SEED.c 1.5 3/7/81@(#)SQRT.c 1.3 6/10/81Negative argument of %e to sqrt @(#)STLIM.c 1.2 6/10/81Statement count limit of %D exceeded @(#)SUBSC.c 1.3 6/10/81Subscript value of %D is out of range @(#)SUCC.c 1.4 6/10/81Cannot take succ of last element of a range Value of %D is out of range @(#)TEOF.c 1.3 6/10/81Reference to an inactive file @(#)TEOLN.c 1.3 6/10/81Reference to an inactive file @(#)TIME.c 1.1 10/29/80@(#)UNIT.c 1.2 6/10/81Reference to an inactive file %s: Reference to an inactive file @(#)UNPACK.c 1.3 6/10/81i = %D: Bad i to unpack(z,a,i) @(#)WRITEC.c 1.4 6/10/81%s: Attempt to write, but open for reading Could not write to @(#)WRITEF.c 1.4 6/10/81%s: Attempt to write, but open for reading Could not write to @(#)WRITES.c 1.4 6/10/81%s: Attempt to write, but open for reading Could not write to @(#)WRITLN.c 1.2 6/10/81%s: Attempt to write, but open for reading %s: Line limit exceeded Could not write to @(#)ERROR.c 1.8 6/10/81Label of %D not found in case @(#)GETNAME.c 1.6 6/10/81%s: Close failed Could not remove #tmp.%c%d%s: File name too long @(#)IOSYNC.c 1.5 6/10/81%s: Attempt to read, but open for writing %s: Tried to read past end of file %s: Tried to read past end of file @(#)PCLOSE.c 1.4 6/10/81%s: Close failed Could not remove @(#)PERROR.c 1.1 6/10/81@(#)PFLUSH.c 1.1 10/29/80@(#)PMFLUSH.c 1.3 3/7/81pmon.outwpmon.out@(#)UNSYNC.c 1.3 6/10/81%s: Attempt to read, but open for writing %s: Tried to read past end of file @(#)blkclr.c 1.1 3/7/81@(#)ACTFILE.c 1.1 10/29/80Ay1?ϒy@!hI@!hB:IvDv6T1E r OER `EM2 fkCӴLE\QEYWF\*~`EM2 f@@@1@rzA]ݬ5@3elB#"3h@?ØGe@lB,k$d!r@AA@@@"@NnDOLX2xة3I䔶TX]1 D!L%dIgN5&GbqhDK->G?A@@AA@@OO@JGSrCu%طK@0qi9IE4Ÿ@;\)@3fG@@@@@M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec@((@A@@AUnknown error: #Ā@(#)doscan.c 4.2 (Berkeley) 81/07/05  AAAAAABBBBBB  r<<d#X,d4=$hE!QiY#`#g#n@$uVd${$$&W@&d&y&v,'Lh'3'3',(X(((( )|))*P* `**`+ @+(h+0x+8xH,@3,HL-Q3h-Y-b[-kj-te.}t<.`.\////0D0Ip000313X1W112`d2`2`3``33)F52Nh6; 7DH7MLp7W7^8hS 8qAL8zd8p8||||||||||}}}}H990:`}h}p}x}}}}} } }0;}}#~'~+~/~3 ~7(~;0~?8~C`;Jx<Q`=W~[~_~c~g~k~o~v}D>>O,BfXBfBC~,CvDC\C|DDLEPF,IfI0JnP xRRR'xS0yPS9$dSBtSJSQSYSbSlfSufd\~yl^x^x^^^^^^_AD_T_aaa al^ ~<&rd/Kd; B ĂIdeR ȂYt\C`EheDoN,Iv.x|CT_^XB^uD_~b!dS*!F!~!!LXJH7(" Ђ pd dIe6e% e,0e5e>eIQeQC eX t` bvi xr4$exefUtfjxff 9h6`3,(t.j-e-[-mp0)@+V/D0X( #|)'$&V@$,#2,9h+@H,G+NL-V0\.1c2k2sd2{,B[~I(3fd\P*((16*'h'E@&.\/m<.,'*1#k$S /d& )c&$X1*Zp800;5`=:b(>0:CP;H&0Nx<Td$Y0_*e/k+s&yY!S!Sp7d8 S*jlM0mW>3y`FSv,CL]35 L8 ` 7 7  8! xI) h-0 S89 pSA A_I 8P W B^  ;e DCk pD>r xRy <> ?>  @ S ? OA ~~U  .|D ;x^ ^ tS a R < PF $PS a I :0J I& q1 D9 B &PK KS N[ nPa Sj 3^r ]|  ^ ^ ^ a a 7`  a crt0.oVersion.oint.o_sccsidinterp.o_sccsidexcept.o_sccsidutilities.o_sccsidARGV.oASRT.oBUFF.oCARD.oCHR.oCLCK.oCTTOT.oDATE.oDEFNAME.oDISPOSE.oEXPO.oFLUSH.oFNIL.oGET.oINCT.oLINO.oLLIMIT.oLN.oMAX.oNAM.oNEW.oNEWZ.oNIL.oPACK.oPAGE.oPRED.oPUT.oRANDOM.oRANG4.oREAD4.oREAD8.oREADC.oREADE.oREADLN.oRELEQ.oRELTGE.oRELTGT.oRELTLE.oRELTLT.oREMOVE.oRESET.oREWRITE.oRSNG4.oSCLCK.oSEED.oSQRT.oSTLIM.oSUBSC.oSUCC.oTEOF.oTEOLN.oTIME.oUNIT.oUNPACK.oWRITEC.oWRITEF.oWRITES.oWRITLN.oERROR.oGETNAME.oIOSYNC.oPCLOSE.oPERROR.oPFLUSH.oPMFLUSH.oRAND.oSETRACE.oUNSYNC.oblkclr.oACTFILE.oatan.o_sq2p1_sq2m1_pio2_pio4_p4_p3_p2_p1_p0_q4_q3_q2_q1_q0_satan_xatanlog.o_log2_ln10_sqrto2_p0_p1_p2_p3_q0_q1_q2sin.o_twoopi_p0_p1_p2_p3_p4_q0_q1_q2_q3_sinussqrt.oexp.o_p0_p1_p2_q0_q1_q2_log2e_sqrt2_maxffloor.octime.ofputc.ofputs.ofrexp.ofprintf.oindex.omodf.ofopen.ocreat.ofseek.operror.oerrlst.ordwr.oscanf.odoscan.oatof.octype_.ofilbuf.oldexp.osetbuf.ostrlen.osignal.olseek.otime.otimes.ogetpid.osprintf.odoprnt.oflsbuf.oexit.odata.oclose.oisatty.oopen.oread.ostty.oioctl.oungetc.ounlink.omalloc.o_allocs_allocp_alloct_allocxsbrk.oudiv.owrite.ocerror.o_exitstart_main_environ_createtime__argc__argv__nodump__mode_fopen_perror_fseek_fread__iob_fprintf_malloc_read_fputs_fclose_unlink_syserr_signal_intr_memsize_except_liberr_interpreter_PFLUSH_psexit__display__dp__lino__runtst__stlim__stcnt__seed__minptr__maxptr__pcpcount__cntrs__rtns__inwin__outwin__errwin__err_output_input__filefre__fchain__actfileLl1_panic_PCLOSE_ERROR_LINO_RELTLT_RELTGT_RELTLE_RELTGE_SUBSC_NIL_RANG4_RSNG4_STLIM_LLIMIT_BUFF_NEWZ_INCT_CTTOT_CARD_ASRT_READE_READ4_READC_READ8_READLN_TEOF_TEOLN_WRITEC_WRITES_WRITEF_fputc_fwrite_WRITLN__flsbuf_PAGE_NAM_MAX_UNIT_PUT_GET_FNIL_DEFNAME_RESET_REWRITE_REMOVE_FLUSH_PACK_UNPACK_ARGV_CLCK_time_SCLCK_DISPOSE_NEW_DATE_TIME_atan_cos_exp_LN_log_sin_SQRT_sqrt_CHR_SUCC_PRED_SEED_RANDOM_EXPO_backtrace_stats_times_PMFLUSH_ACTFILE__sobuf_setbuf__cntbl__mask__pd_date_ctime_GETNAME_free_sprintf_index_fflush_IOSYNC_blkclr_PERROR_RAND_UNSYNC_fscanf_RELEQ_SETRACE_getpid_ungetc_atan2_errno_frexp_log10_modf_floor_ldexp_ceil_localtime_asctime_ftime_gmtime_dysize__doprnt__lastbuf_creat_close_open_lseekcerror__filbuf_sys_nerr_sys_errlist_strlen_write_scanf__doscan_sscanf_scan1line__sctab__ctype___getccl__innum__instr_atof_getppid_isatty__cleanup__sibuf_gtty_stty_ioctludiv_sbrk_realloc_end_brk_cntbl__mask__pd_date_ctime_GETNAME_free_sprintf_index_fflush_IOSYNC_blkclr_PERROR_RAND_UNSYNC_fscanf_RELEQ_SETRACE_getpid_ungetc_atan2_errno_frexp_log10_modf_floor_ldexp_ceil_localtime_asctime_ftime_gmtime_dysize__doprnt__lastbuf_creat_close_open_lseekcerror__filbuf_sys_nerr_sys_errlist_strlen_write_scanf__doscan_sscanf_scan1line__sctab__ctype___getccl__innum__instr_atof_getppid_isatty__cleasrc/dummy 664 0 33 0 2534254111 5605 ((@A@@AUnknown error: #Ā@(#)doscan.c 4.2 (Berkeley) 81/07/05  AAAAAABBBBBB  r<<d#X,d4=$hE!QiY#`#g#n@$uVd${$$&W@&d&y&v,'Lh'3'3',(X(((( )|))*P* `**`+ @+(h+0x+8xH,@3,HL-Q3h-Y-b[-kj-te.}t<.`.\////0D0Ip000313X1W112`d2`2`3``33)F52Nh6; 7DH7MLp7W7^8hS 8qAL8zd8p8||||||||||}}}}H990:`}h}p}x}}}}} } }0;}}#~'~+~/~3 ~7(~;0~?8~C`;Jx<Q`=W~[~_~c~g~k~o~v}D>>O,BfXBfBC~,CvDC\C|DDLEPF,IfI0JnP xRRR'xS0yPS9$dSBtSJSQSYSbSlfSufd\~yl^x^x^^^^^^_AD_T_aaa al^ ~<&rd/Kd; B ĂIdeR ȂYt\C`EheDoN,Iv.x|CT_^XB^uD_~b!dS*!F!~!!LXJH7(" Ђ pd dIe6e% e,0e5e>eIQeQC eX t` bvi xr4$exefUtfjxff 9h6`3,(t.j-e-[-mp0)@+V/D0X( #|)'$&V@$,#2,9h+@H,G+NL-V0\.1c2k2sd2{,B[~I(3fd\P*((16*'h'E@&.\/m<.,'*1#k$S /d& )c&$X1*Zp800;5`=:b(>0:CP;H&0Nx<Td$Y0_*e/k+s&yY!S!Sp7d8 S*jlM0mW>3y`FSv,CL]35 L8 ` 7 7  8! xI) h-0 S89 pSA A_I 8P W B^  ;e DCk pD>r xRy <> ?>  @ S ? OA ~~U  .|D ;x^ ^ tS a R < PF $PS a I :0J I& q1 D9 B &PK KS N[ nPa Sj 3^r ]|  ^ ^ ^ a a 7`  a crt0.oVersion.oint.o_sccsidinterp.o_sccsidexcept.o_sccsidutilities.o_sccsidARGV.oASRT.oBUFF.oCARD.oCHR.oCLCK.oCTTOT.oDATE.oDEFNAME.oDISPOSE.oEXPO.oFLUSH.oFNIL.oGET.oINCT.oLINO.oLLIMIT.oLN.oMAX.oNAM.oNEW.oNEWZ.oNIL.oPACK.oPAGE.oPRED.oPUT.oRANDOM.oRANG4.oREAD4.oREAD8.oREADC.oREADE.oREADLN.oRELEQ.oRELTGE.oRELTGT.oRELTLE.oRELTLT.oREMOVE.oRESET.oREWRITE.oRSNG4.oSCLCK.oSEED.oSQRT.oSTLIM.oSUBSC.oSUCC.oTEOF.oTEOLN.oTIME.oUNIT.oUNPACK.oWRITEC.oWRITEF.oWRITES.oWRITLN.oERROR.oGETNAME.oIOSYNC.oPCLOSE.oPERROR.oPFLUSH.oPMFLUSH.oRAND.oSETRACE.oUNSYNC.oblkclr.oACTFILE.oatan.o_sq2p1_sq2m1_pio2_pio4_p4_p3_p2_p1_p0_q4_q3_q2_q1_q0_satan_xatanlog.o_log2_ln10_sqrto2_p0_p1_p2_p3_q0_q1_q2sin.o_twoopi_p0_p1_p2_p3_p4_q0_q1_q2_q3_sinussqrt.oexp.o_p0_p1_p2_q0_q1_q2_log2e_sqrt2_maxffloor.octime.ofputc.ofputs.ofrexp.ofprintf.oindex.omodf.ofopen.ocreat.ofseek.operror.oerrlst.ordwr.oscanf.odoscan.oatof.octype_.ofilbuf.oldexp.osetbuf.ostrlen.osignal.olseek.otime.otimes.ogetpid.osprintf.odoprnt.oflsbuf.oexit.odata.oclose.oisatty.oopen.oread.ostty.oioctl.oungetc.ounlink.omalloc.o_allocs_allocp_alloct_allocxsbrk.oudiv.owrite.ocerror.o_exitstart_main_environ_createtime__argc__argv__nodump__mode_fopen_perror_fseek_fread__iob_fprintf_malloc_read_fputs_fclose_unlink_syserr_signal_intr_memsize_except_liberr_interpreter_PFLUSH_psexit__display__dp__lino__runtst__stlim__stcnt__seed__minptr__maxptr__pcpcount__cntrs__rtns__inwin__outwin__errwin__err_output_input__filefre__fchain__actfileLl1_panic_PCLOSE_ERROR_LINO_RELTLT_RELTGT_RELTLE_RELTGE_SUBSC_NIL_RANG4_RSNG4_STLIM_LLIMIT_BUFF_NEWZ_INCT_CTTOT_CARD_ASRT_READE_READ4_READC_READ8_READLN_TEOF_TEOLN_WRITEC_WRITES_WRITEF_fputc_fwrite_WRITLN__flsbuf_PAGE_NAM_MAX_UNIT_PUT_GET_FNIL_DEFNAME_RESET_REWRITE_REMOVE_FLUSH_PACK_UNPACK_ARGV_CLCK_time_SCLCK_DISPOSE_NEW_DATE_TIME_atan_cos_exp_LN_log_sin_SQRT_sqrt_CHR_SUCC_PRED_SEED_RANDOM_EXPO_backtrace_stats_times_PMFLUSH_ACTFILE__sobuf_setbuf__cntbl__mask__pd_date_ctime_GETNAME_free_sprintf_index_fflush_IOSYNC_blkclr_PERROR_RAND_UNSYNC_fscanf_RELEQ_SETRACE_getpid_ungetc_atan2_errno_frexp_log10_modf_floor_ldexp_ceil_localtime_asctime_ftime_gmtime_dysize__doprnt__lastbuf_creat_close_open_lseekcerror__filbuf_sys_nerr_sys_errlist_strlen_write_scanf__doscan_sscanf_scan1line__sctab__ctype___getccl__innum__instr_atof_getppid_isatty__cleanup__sibuf_gtty_stty_ioctludiv_sbrk_realloc_end_brk_cntbl__mask__pd_date_ctime_GETNAME_free_sprintf_index_fflush_IOSYNC_blkclr_PERROR_RAND_UNSYNC_fscanf_RELEQ_SETRACE_getpid_ungetc_atan2_errno_frexp_log10_modf_floor_ldexp_ceil_localtime_asctime_ftime_gmtime_dysize__doprnt__lastbuf_creat_close_open_lseekcerror__filbuf_sys_nerr_sys_errlist_strlen_write_scanf__doscan_sscanf_scan1line__sctab__ctype___getccl__innum__instr_atof_getppid_isatty__cleasrc/dummy 664 0 33 0 2534254111 5605 ((cmd/ 775 0 33 0 2662302677 4525 cmd/cat.c 444 0 33 4415 2421025252 5505 /* * Concatenate files. */ static char *Sccsid = "@(#)cat.c 4.2 (Berkeley) 10/9/80"; #include #include #include char stdbuf[BUFSIZ]; int bflg, eflg, nflg, sflg, tflg, vflg; int spaced, col, lno, inline; main(argc, argv) char **argv; { int fflg = 0; register FILE *fi; register c; int dev, ino = -1; struct stat statb; lno = 1; setbuf(stdout, stdbuf); for( ; argc>1 && argv[1][0]=='-'; argc--,argv++) { switch(argv[1][1]) { case 0: break; case 'u': setbuf(stdout, (char *)NULL); continue; 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; } fstat(fileno(stdout), &statb); statb.st_mode &= S_IFMT; if (statb.st_mode!=S_IFCHR && statb.st_mode!=S_IFBLK) { dev = statb.st_dev; ino = statb.st_ino; } if (argc < 2) { argc = 2; fflg++; } while (--argc > 0) { if (fflg || (*++argv)[0]=='-' && (*argv)[1]=='\0') fi = stdin; else { if ((fi = fopen(*argv, "r")) == NULL) { fprintf(stderr, "cat: can't open %s\n", *argv); continue; } } fstat(fileno(fi), &statb); if (statb.st_dev==dev && statb.st_ino==ino) { fprintf(stderr, "cat: input %s is output\n", fflg?"-": *argv); fclose(fi); continue; } if (nflg||sflg||vflg) copyopt(fi); else { while ((c = getc(fi)) != EOF) putchar(c); } if (fi!=stdin) fclose(fi); } if (ferror(stdout)) fprintf(stderr, "cat: output write error\n"); return(0); } 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; } o 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) {cmd/dumpdir.c 444 0 33 17135 2477636050 6444 static char *sccsid = "@(#)dumpdir.c 4.4 (Berkeley) 2/28/81"; #define MAXINO 2000 #define BITS 8 #define MAXXTR 60 #define NCACHE 3 #include #include #include #include #include #include #include #include #include #define MWORD(m,i) (m[(unsigned)(i-1)/MLEN]) #define MBIT(i) (1<<((unsigned)(i-1)%MLEN)) #define BIS(i,w) (MWORD(w,i) |= MBIT(i)) #define BIC(i,w) (MWORD(w,i) &= ~MBIT(i)) #define BIT(i,w) (MWORD(w,i) & MBIT(i)) int mt; char tapename[] = "/dev/rmt8"; char *magtape = tapename; daddr_t seekpt; int ofile; FILE *df; char dirfile[] = "rstXXXXXX"; struct { ino_t t_ino; daddr_t t_seekpt; } inotab[MAXINO]; int ipos; #define ONTAPE 1 #define XTRACTD 2 #define XINUSE 4 short dumpmap[MSIZ]; short clrimap[MSIZ]; int bct = NTREC+1; char tbf[NTREC*BSIZE]; char prebuf[BUFSIZ]; int volno; main(argc, argv) char *argv[]; { extern char *ctime(); int interrupt(); mktemp(dirfile); signal(SIGINT, interrupt); argv++; if (argc>=3 && *argv[0] == 'f') magtape = *++argv; df = fopen(dirfile, "w"); if (df == NULL) { printf("dumpdir: %s - cannot create directory temporary\n", dirfile); quit(); } if ((mt = open(magtape, 0)) < 0) { printf("%s: cannot open tape\n", magtape); quit(); } if (readhdr(&spcl) == 0) { printf("Tape is not a dump tape\n"); quit(); } printf("Dump date: %s", ctime(&spcl.c_date)); printf("Dumped from: %s", ctime(&spcl.c_ddate)); if (checkvol(&spcl, 1) == 0) { printf("Tape is not volume 1 of the dump\n"); quit(); } pass1(); /* This sets the various maps on the way by */ freopen(dirfile, "r", df); strcpy(prebuf, "/"); printem(prebuf, (ino_t) 2); quit(); } /* * Interrupt -- Quit properly */ interrupt() { unlink(dirfile); exit(1); } quit() { unlink(dirfile); exit(0); } /* * Read the tape, bulding up a directory structure for extraction * by name */ pass1() { register i; struct dinode *ip; int putdir(), null(); while (gethead(&spcl) == 0) { printf("Can't find directory header!\n"); } for (;;) { if (checktype(&spcl, TS_BITS) == 1) { readbits(dumpmap); continue; } if (checktype(&spcl, TS_CLRI) == 1) { readbits(clrimap); continue; } if (checktype(&spcl, TS_INODE) == 0) { finish: flsh(); close(mt); return; } ip = &spcl.c_dinode; i = ip->di_mode & IFMT; if (i != IFDIR) { goto finish; } inotab[ipos].t_ino = spcl.c_inumber; inotab[ipos++].t_seekpt = seekpt; getfile(spcl.c_inumber, putdir, null, spcl.c_dinode.di_size); putent("\000\000/"); } } printem(prefix, inum) char *prefix; ino_t inum; { struct direct dir; register int i; for (i = 0; i < MAXINO; i++) if (inotab[i].t_ino == inum) { goto found; } printf("PANIC - can't find directory %d\n", inum); return; found: mseek(inotab[i].t_seekpt); for (;;) { getent((char *) &dir); if (direq(dir.d_name, "/")) return; if (search(dir.d_ino) != 0 && direq(dir.d_name, ".") == 0 && direq(dir.d_name, "..") == 0) { int len; FILE *tdf; tdf = df; df = fopen(dirfile, "r"); len = strlen(prefix); strncat(prefix, dir.d_name, sizeof(dir.d_name)); strcat(prefix, "/"); printem(prefix, dir.d_ino); prefix[len] = '\0'; fclose(df); df = tdf; } else if (BIT(dir.d_ino, dumpmap)) printf("%5d %s%-.14s\n", dir.d_ino, prefix, dir.d_name); } } /* * Do the file extraction, calling the supplied functions * with the blocks */ getfile(n, f1, f2, size) ino_t n; int (*f2)(), (*f1)(); long size; { register i; struct spcl addrblock; char buf[BSIZE]; addrblock = spcl; goto start; for (;;) { if (gethead(&addrblock) == 0) { printf("Missing address (header) block\n"); goto eloop; } if (checktype(&addrblock, TS_ADDR) == 0) { spcl = addrblock; return; } start: for (i = 0; i < addrblock.c_count; i++) { if (addrblock.c_addr[i]) { readtape(buf); (*f1)(buf, size > BSIZE ? (long) BSIZE : size); } else { clearbuf(buf); (*f2)(buf, size > BSIZE ? (long) BSIZE : size); } if ((size -= BSIZE) <= 0) { eloop: while (gethead(&spcl) == 0) ; if (checktype(&spcl, TS_ADDR) == 1) goto eloop; return; } } } } /* * Do the tape i\/o, dealling with volume changes * etc.. */ readtape(b) char *b; { register i; struct spcl tmpbuf; if (bct >= NTREC) { for (i = 0; i < NTREC; i++) ((struct spcl *)&tbf[i*BSIZE])->c_magic = 0; bct = 0; if ((i = read(mt, tbf, NTREC*BSIZE)) < 0) quit(); if (i == 0) { bct = NTREC + 1; volno++; loop: flsht(); close(mt); printf("Mount volume %d\n", volno); while (getchar() != '\n') ; if ((mt = open(magtape, 0)) == -1) { printf("Cannot open tape!\n"); } if (readhdr(&tmpbuf) == 0) { printf("Not a dump tape.Try again\n"); goto loop; } if (checkvol(&tmpbuf, volno) == 0) { printf("Wrong tape. Try again\n"); goto loop; } readtape(b); return; } } copy(&tbf[(bct++*BSIZE)], b, BSIZE); } flsht() { bct = NTREC+1; } copy(f, t, s) register char *f, *t; { register i; i = s; do *t++ = *f++; while (--i); } clearbuf(cp) register char *cp; { register i; i = BSIZE; do *cp++ = 0; while (--i); } /* * Put and get the directory entries from the compressed * directory file */ putent(cp) char *cp; { register i; for (i = 0; i < sizeof(ino_t); i++) writec(*cp++); for (i = 0; i < DIRSIZ; i++) { writec(*cp); if (*cp++ == 0) return; } return; } getent(bf) register char *bf; { register i; for (i = 0; i < sizeof(ino_t); i++) *bf++ = readc(); for (i = 0; i < DIRSIZ; i++) if ((*bf++ = readc()) == 0) return; return; } /* * read/write te directory file */ writec(c) char c; { seekpt++; fwrite(&c, 1, 1, df); } readc() { char c; fread(&c, 1, 1, df); return(c); } mseek(pt) daddr_t pt; { fseek(df, pt, 0); } flsh() { fflush(df); } /* * search the directory inode ino * looking for entry cp */ search(inum) ino_t inum; { register low, high, probe; low = 0; high = ipos-1; while (low != high) { probe = (high - low + 1)/2(( + low; /* printf("low = %d, high = %d, probe = %d, ino = %d, inum = %d\n", low, high, probe, inum, inotab[probe].t_ino); */ if (inum >= inotab[probe].t_ino) low = probe; else high = probe - 1; } return(inum == inotab[low].t_ino); } direq(s1, s2) register char *s1, *s2; { register i; for (i = 0; i < DIRSIZ; i++) if (*s1++ == *s2) { if (*s2++ == 0) return(1); } else return(0); return(1); } /* * read the tape into buf, then return whether or * or not it is a header block. */ gethead(buf) struct spcl *buf; { readtape((char *)buf); if (buf->c_magic != MAGIC || checksum((int *) buf) == 0) return(0); return(1); } /* * return whether or not the buffer contains a header block */ checktype(b, t) struct spcl *b; int t; { return(b->c_type == t); } checksum(b) int *b; { register i, j; j = BSIZE/sizeof(int); i = 0; do i += *b++; while (--j); if (i != CHECKSUM) { printf("Checksum error %o\n", i); return(0); } return(1); } checkvol(b, t) struct spcl *b; int t; { if (b->c_volume == t) return(1); return(0); } readhdr(b) struct spcl *b; { if (gethead(b) == 0) return(0); if (checktype(b, TS_TAPE) == 0) return(0); return(1); } putdir(b) char *b; { register struct direct *dp; register i; for (dp = (struct direct *) b, i = 0; i < BSIZE; dp++, i += sizeof(*dp)) { if (dp->d_ino == 0) continue; putent((char *) dp); } } /* * read a bit mask from the tape into m. */ readbits(m) short *m; { register i; i = spcl.c_count; while (i--) { readtape((char *) m); m += (BSIZE/(MLEN/BITS)); } while (gethead(&spcl) == 0) ; } null() { ; } b) == 0) return(0); if (checktype(b, TS_TAPE) == 0) return(0); return(1); } putdir(b) char *b; { register struct direct *dp; register i; for (dp = (struct direct *) b, i = 0; i < BSIZE; dp++, i += sizeof(*dp)) { if (dp->d_ino == 0) continue; putent((char *) dp); } } /* * read a bit mask from the tape into m. */ readbits(m) short *m; { register i; i = spcl.c_count; while (i--) { readtape(cmd/ac.c 444 0 33 10342 2663055035 5347 /* * acct [ -w wtmp ] [ -d ] [ -p ] [ people ] */ static char *sccsid = "@(#)ac.c 4.4 (Berkeley) 2/13/82"; #include #include #include #include #include #include #define NMAX sizeof(ibuf.ut_name) #define LMAX sizeof(ibuf.ut_line) /* #define TSIZE 1000 */ #define TSIZE 6242 #define USIZE 500 struct utmp ibuf; struct ubuf { char uname[NMAX]; long utime; } ubuf[USIZE]; struct tbuf { struct ubuf *userp; long ttime; } tbuf[TSIZE]; char *wtmp; int pflag, byday; long dtime; long midnight; long lastime; long day = 86400L; int pcount; char **pptr; main(argc, argv) char **argv; { int c, fl; register i; FILE *wf; wtmp = "/usr/adm/wtmp"; while (--argc > 0 && **++argv == '-') switch(*++*argv) { case 'd': byday++; continue; case 'w': if (--argc>0) wtmp = *++argv; continue; case 'p': pflag++; continue; } pcount = argc; pptr = argv; if ((wf = fopen(wtmp, "r")) == NULL) { printf("No %s\n", wtmp); exit(1); } for(;;) { if (fread((char *)&ibuf, sizeof(ibuf), 1, wf) != 1) break; fl = 0; for (i=0; ittime += ibuf.ut_time-dtime; dtime = 0; return; } if (lastime>ibuf.ut_time || lastime+(1.5*day) midnight) { upall(1); print(); newday(); for (up=ubuf; up < &ubuf[USIZE]; up++) up->utime = 0; } if (ibuf.ut_line[0] == '~') { ibuf.ut_name[0] = '\0'; upall(0); return; } /* if (ibuf.ut_line[0]=='t') i = (ibuf.ut_line[3]-'0')*10 + (ibuf.ut_line[4]-'0'); else i = TSIZE-1; if (i<0 || i>=TSIZE) i = TSIZE-1; */ /* * Correction contributed by Phyllis Kantar @ Rand-unix * * Fixes long standing problem with tty names other than 00-99 */ if (ibuf.ut_line[0]=='t') { i = (ibuf.ut_line[3]-'0'); if(ibuf.ut_line[4]) i = i*79 + (ibuf.ut_line[4]-'0'); } else i = TSIZE-1; if (i<0 || i>=TSIZE) { i = TSIZE-1; printf("ac: Bad tty name: %s\n", ibuf.ut_line); } tp = &tbuf[i]; update(tp, 0); } print() { int i; long ttime, t; ttime = 0; for (i=0; i0) ttime += t; if (pflag && ubuf[i].utime > 0) { printf("\t%-*.*s%6.2f\n", NMAX, NMAX, ubuf[i].uname, ubuf[i].utime/3600.); } } if (ttime > 0) { pdate(); printf("\ttotal%9.2f\n", ttime/3600.); } } upall(f) { register struct tbuf *tp; for (tp=tbuf; tp < &tbuf[TSIZE]; tp++) update(tp, f); } update(tp, f) struct tbuf *tp; { int j; struct ubuf *up; long t, t1; if (f) t = midnight; else t = ibuf.ut_time; if (tp->userp) { t1 = t - tp->ttime; if (t1 > 0) tp->userp->utime += t1; } tp->ttime = t; if (f) return; if (ibuf.ut_name[0]=='\0') { tp->userp = 0; return; } for (up=ubuf; up < &ubuf[USIZE]; up++) { if (up->uname[0] == '\0') break; for (j=0; juname[j]==ibuf.ut_name[j]; j++); if (j>=NMAX) break; } for (j=0; juname[j] = ibuf.ut_name[j]; tp->userp = up; } among(i) { register j, k; register char *p; if (pcount==0) return(1); for (j=0; jtm_isdst) midnight -= 3600; } while (midnight <= ibuf.ut_time) midnight += day; } pdate() { long x; char *ctime(); if (byday==0) return; x = midnight-1; printf("%.6s", ctime(&x)+4); } ) { if (*p == ubuf[i].uname[k]) { if (*p++ == '\0' || k == NMAX-1) return(1); } else break; } } return(0); } newday() { long ttime; struct timeb tb; struct tm *localtime(); time(&ttime); if (midnight == 0) { ftime(&tb); midnight = 60*(long)tb.timezone;cmd/sdb/ 775 0 33 0 2552562333 5270 cmd/sdb/Makefile 444 0 33 3054 2552446720 7014 # # sdb Makefile 4.2 7/8/81 # # Conditional compilation flags: # STD - Distribution systems UNIX/32V, VM/UNIX 2.n # VMUNIX - virtual memory system - keep namelist in VM. # VFORK - Use vfork call of VM/UNIX Berkeley version # FLEXNAMES - New a.out format with string table (VMUNIX Version 4) # # The files old.c and old.h contain routines and definitions peculiar # to old versions of the system. # CFLAGS= -R -DVMUNIX -DVFORK -DFLEXNAMES SRCS= access.c decode.c display.c docomm.c fio.c main.c message.c \ old.c opset.c optab.c pcs.c prvar.c re.c runpcs.c \ setup.c sub.c symt.c udef.c version.c xeq.c OBJS= access.o decode.o display.o docomm.o fio.o main.o message.o \ old.o opset.o optab.o pcs.o prvar.o re.o runpcs.o \ setup.o sub.o symt.o udef.o version.o xeq.o HDRS= cdefs.h defs.h head.h mac.h machine.h mode.h old.h sdb: sources ${OBJS} cc -o sdb *.o install: cp sdb sdb.temp install -s sdb $(DESTDIR)/usr/bin mv sdb.temp sdb clean: rm -f *.o sdb print: ls -l Makefile | pr pr -f *.h *.c sources: ${SRCS} ${HDRS} ${SRCS} ${HDRS}: sccs get $@ depend: /bin/grep '^#[ ]*include' ${SRCS} \ | sed '/<.*>/d' \ | sed 's/:[^"]*"\([^"]*\)".*/: \1/' \ | sed 's/\.c/.o/' >>makedep 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 # DO NOT DELETE THIS LINE -- make depend uses it depend: /bin/grep '^#[ ]*include' ${SRCS} \ | sed '/<.*>/d' \ | sed 's/:[^"]*"\([^"]*\)".*/: \1/' \ | sed 's/\.c/.o/' >>makedep 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 # DO ((cmd/sdb/access.c 444 0 33 5423 2514002157 6751 static char sccsid[] = "@(#)access.c 4.1 10/9/80"; # /* * * UNIX debugger * */ #include "head.h" struct user u; MSG BADDAT; MSG BADTXT; MAP txtmap; MAP datmap; STRING errflg; int errno; INT pid; /* file handling and access routines */ int dmask[5] = {0, 0xff, 0xffff, 0xffffff, 0xffffffff}; /* get data at loc using descriptor format d */ long getval(loc, d, space) ADDR loc; char d; { register int val; val = get(loc, space); val &= dmask[dtol(d)]; return(val); } /* put value at loc using descriptor format d */ putval(loc, d, value) ADDR loc; char d; long value; { register long val; val = get(loc, DSP); val = (val & !dmask[dtol(d)]) | (value & dmask[dtol(d)]); put(loc, DSP, val); } /* put value in named register using descriptor format d */ putreg(reg, d, value) ADDR reg; char d; long value; { register long val; val = *(ADDR *)(((ADDR)&u)+R0+WORDSIZE*reg); val = (val & !dmask[dtol(d)]) | (value & dmask[dtol(d)]); *(ADDR *)(((ADDR)&u)+R0+WORDSIZE*reg) = val; } put(adr,space,value) L_INT adr; { access(WT,adr,space,value); } POS get(adr, space) L_INT adr; { return(access(RD,adr,space,0)); } access(mode,adr,space,value) L_INT adr; { INT pmode,rd,file; ADDR w; if (debug) printf("access(mode=%d,adr=%d,space=%d,value=%d) with pid %d\n", mode, adr, space, value, pid); rd = mode==RD; IF space == NSP THEN return(0); FI IF pid /* tracing on? */ THEN #ifndef vax IF adr&01 ANDF !rd THEN error(ODDADR); FI #endif pmode = (space&DSP?(rd?RDUSER:WDUSER):(rd?RIUSER:WIUSER)); w = ptrace(pmode, pid, adr, value); if (debug) printf("ptrace(%d,%d,%d,%d) = %d with error=%d\n", pmode, pid, adr, value, w, errno); #ifndef vax IF adr&01 THEN w1 = ptrace(pmode, pid, shorten(adr+1), value); w = (w>>8)&LOBYTE | (w1<<8); FI #endif IF errno THEN errflg = (space&DSP ? BADDAT : BADTXT); FI return(w); FI w = 0; IF !chkmap(&adr,space) THEN return(0); FI file=(space&DSP?datmap.ufd:txtmap.ufd); if (longseek(file,adr)==0 || (rd ? read(file,&w,sizeof(w)) : write(file,&value,sizeof(w))) < 1) errflg=(space&DSP?BADDAT:BADTXT); return(w); } chkmap(adr,space) REG L_INT *adr; REG INT space; { REG MAPPTR amap; amap=((space&DSP?&datmap:&txtmap)); IF space&STAR ORF !within(*adr,amap->b1,amap->e1) THEN if (within(*adr,amap->b2,amap->e2)) *adr += (amap->f2)-(amap->b2); else { errflg=(space&DSP?BADDAT:BADTXT); return(0); } ELSE *adr += (amap->f1)-(amap->b1); FI return(1); } within(adr,lbd,ubd) POS adr, lbd, ubd; { return(adr>=lbd && adrb1,amap->e1) THEN if (within(*adr,amap->b2,amap->e2)) *adr += (amap->f2)-(amap->b2); else { errflg=(space&DSP?BADDAT:BADTXT); return(0); } ELSE *adr += (amap->f1)-(amap->b1); FI return(1); } within(adr,lbd,ubd) POcmd/sdb/cdefs.h 444 0 33 1647 2514002160 6577 /* "@(#)cdefs.h 4.1 10/9/80" */ /* type modifiers */ # define PTR 020 # define FTN 040 # define ARY 060 /* type packing constants */ # define TMASK 060 # define TMASK1 0300 # define TMASK2 0360 # define BTMASK 017 # define BTSHIFT 4 # define TSHIFT 2 /* macros */ # define BTYPE(x) (x&BTMASK) /* basic type of x */ # define ISUNSIGNED(x) ((x)<=ULONG&&(x)>=UCHAR) # define UNSIGNABLE(x) ((x)<=LONG&&(x)>=CHAR) # define ENUNSIGN(x) ((x)+(UNSIGNED-INT)) # define DEUNSIGN(x) ((x)+(INT-UNSIGNED)) # define ISPTR(x) ((x&TMASK)==PTR) # define ISFTN(x) ((x&TMASK)==FTN) /* is x a function type */ # define ISARY(x) ((x&TMASK)==ARY) /* is x an array type */ # define INCREF(x) (((x&~BTMASK)<>TSHIFT)&~BTMASK&0x3fff)|(x&BTMASK)) /* pack and unpack field descriptors (size and offset) */ # define PKFIELD(s,o) ((o<<6)|s) # define UPKFSZ(v) (v&077) # define UPKFOFF(v) (v>>6) define ENUNSIGN(x) ((x)+(UNSIGNED-INT)) # define DEUNSIGN(x) ((x)+(INT-UNSIGNED)) # defincmd/sdb/decode.c 444 0 33 4575 2514002161 6735 static char sccsid[] = "@(#)decode.c 4.1 10/9/80"; #include "head.h" /* decode() - read a line from standard input and decode it */ decode(p) char *p; { register char c, *q; register int diff; integ = scallf = reflag = colonflag = ncolonflag = percentflag = 0; proc[0] = cmd = args[0] = var[0] = '\0'; argsp = args; if (eqany(*p, "/?")) { /* regular expression */ c = *p; redir = (c == '/'); reflag = 1; p++; if (*p == '\n' || *p == c) return(0); q = re; while(*p != c && *p != '\n') *q++ = *p++; *q = '\0'; return(0); } if (*p == '!') { /* shell escape */ for (q = p; *q != '\n'; q++) ; *q = '\0'; system(p+1); return(0); } if (*p == '\n') { cmd = '\n'; return(0); } if (*p == ':') { colonflag++; } while (*p != '\n') { /* decode item by item */ if (number(*p)) { /* decimal number */ if (integ) { error("Too many numbers"); return(1); } integ = readint(&p); if (*p == ':') { ncolonflag++; p++; } continue; } if (varchar(*p) || eqany(*p, COMMANDS)) { /* proc, variable or command */ if (cmd != '\0') { p = cpall(args, p); continue; } q = p; while (varchar(*q) || number(*q) || eqany(*q,COMMANDS)) q++; if (*q == '(') { /* procedure call */ if (proc[0] != '\0') { error("Too many procedure calls"); return(1); } scallf = 1; p = cpname(proc, p); p = cpall(args, p); continue; } if (*q == ':') { /* procedure name */ colonflag++; p = cpname(proc, p); continue; } if (*q == '$') { /* variable name */ p = cpname(var, p); continue; } if (((q-p == 1 && eqany(*p,COMMANDS) && (proc[0]=='\0' || eqany(*p, "abcd"))) || (integ && eqany(*p,COMMANDS)) || eqany(*p, "+-?")) && !(*p=='-' && *(p+1) == '>')) { /* command */ cmd = *p++; if (eqany(cmd, "Macers")) { while(*p == ' ') p++; p = cpall(args, p); } continue; } /* otherwise, its a variable */ if (var[0] != '\0') { error("Too many variable names"); return(1); } p = cpname(var, p); if (*p == '%') { percentflag++; p++; } if (eqstr(var, ".?")) { var[1] = '\0'; cmd = '?'; } if (*p == '\n') { cmd = '/'; continue; } if (cmd == '\0') cmd = *p ? *p : '/'; p++; p = cpall(args,p); continue; } p++; /* otherwise ignore p */ } return(0); } p++; p = cpall(args, p); } continue; } /* otherwise, its a variable */ if (var[0] != '\0') { error("cmd/sdb/defs.h 444 0 33 7163 2514002162 6435 /* "@(#)defs.h 4.1 10/9/80" */ # /* * * UNIX debugger - common definitions * */ /* Layout of a.out file (fsym): * * header of 8 longwords * magic number 410 * text size ) * data size ) padded with 0 to multiple of 4 bytes * bss size ) * symbol table size * entry address * size of text relocation info * size of data relocation info * * * header: 0 * text: 32 * data: 32+textsize * text reloc: 32+textsize+datasize * data reloc: 32+textsize+datasize+textreloc * symbol table: 32+textsize+datasize+textreloc+datareloc * */ #include #include #include #include #include "mac.h" #include "mode.h" #define VARB 11 #define VARD 13 #define VARE 14 #define VARM 22 #define VARS 28 #define VART 29 #define COREMAGIC 0140000 /* access modes */ #define RD 0 #define WT 1 /* access spaces */ #define NSP 0 #define ISP 1 #define DSP 2 #define STAR 4 #define STARCOM 0200 #define DSYM 4 #define ISYM 4 #define ASYM 2 #define NSYM 0 #define ESYM (-1) #define BKPTSET 1 #define BKPTEXEC 2 #define SYMSIZ 100 #define MAXSIG 20 #define USERPS PSL #define USERPC PC #define BPT 03 #define TBIT 020 #define FD 0200 /* ptracew modes */ #define SETTRC 0 #define RDUSER 2 #define RIUSER 1 #define WDUSER 5 #define WIUSER 4 #define RUREGS 3 #define WUREGS 6 #define CONTIN 7 #define EXIT 8 #define SINGLE 9 #define FROFF (&(0->fpsr)) #define FRLEN 25 #define FRMAX 6 /* the quantities involving ctob() are located in the kernel stack. /* the ot((hers are in the pcb. */ #define KSP 0 #define ESP 4 #define SSP 8 #ifndef STD #define USP (ctob(UPAGES)-5*4) #define R0 (ctob(UPAGES)-18*4) #define R1 (ctob(UPAGES)-17*4) #define R2 (ctob(UPAGES)-16*4) #define R3 (ctob(UPAGES)-15*4) #define R4 (ctob(UPAGES)-14*4) #define R5 (ctob(UPAGES)-13*4) #define R6 (ctob(UPAGES)-12*4) #define R7 (ctob(UPAGES)-11*4) #define R8 (ctob(UPAGES)-10*4) #define R9 (ctob(UPAGES)-9*4) #define R10 (ctob(UPAGES)-8*4) #define R11 (ctob(UPAGES)-7*4) #define AP (ctob(UPAGES)-21*4) #define FP (ctob(UPAGES)-20*4) #define PC (ctob(UPAGES)-2*4) #define PSL (ctob(UPAGES)-1*4) #else #define USP (ctob(UPAGES)-5*4) #define R0 (ctob(UPAGES)-19*4) #define R1 (ctob(UPAGES)-18*4) #define R2 (ctob(UPAGES)-17*4) #define R3 (ctob(UPAGES)-16*4) #define R4 (ctob(UPAGES)-15*4) #define R5 (ctob(UPAGES)-14*4) #define R6 (ctob(UPAGES)-13*4) #define R7 (ctob(UPAGES)-12*4) #define R8 (ctob(UPAGES)-11*4) #define R9 (ctob(UPAGES)-10*4) #define R10 (ctob(UPAGES)-9*4) #define R11 (ctob(UPAGES)-8*4) #define AP (ctob(UPAGES)-7*4) #define FP (ctob(UPAGES)-6*4) #define PC (ctob(UPAGES)-2*4) #define PSL (ctob(UPAGES)-1*4) #endif #define P0BR 80 #define P0LR 84 #define P1BR 88 #define P1LR 92 #define MAXOFF 255 #define MAXPOS 80 #define MAXLIN 128 #define EOR '\n' #define SP ' ' #define TB '\t' #define QUOTE 0200 #define STRIP 0177 #define LOBYTE 0377 #define EVEN -2 #ifndef vax #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) #else #define leng(a) itol(0,a) #define shorten(a) ((short)(a)) #define itol(a,b) (itolws.I[0]=(b), itolws.I[1]=(a), itolws.L) #endif /* result type declarations */ L_INT inkdot(); SYMPTR lookupsym(); SYMPTR symget(); POS get(); POS chkget(); STRING exform(); L_INT round(); BKPTR scanbkpt(); VOID fault(); INT mkfault; INT executing; L_INT maxoff; L_INT maxpos; ADDR sigint; ADDR sigqit; INT wtflag; L_INT maxfile; L_INT maxstor; L_INT txtsiz; L_INT datsiz; L_INT datbas; L_INT stksiz; STRING errflg; INT magic; L_INT entrypt; CHAR lastc; STRING symfil; STRING corfil; MAP txtmap; MAP datmap; olws.L) #endif /* result type declarations */ L_INT inkdot(); SYMPTR lookupsym(); SYMPTR symget(); POS get(); POS chkget(); STRING exform(); L_INT round(); BKPTR scanbkpt(); VOID fault(); INT mkfault; INT executing; L_INT maxoff; L_INT maxpos; ADDR sigint; ADDR sigqit; INT wtflag; L_INT maxfile; L_INT maxstor; L_INT txtsiz; L_INT datsiz; L_INT datbas; L_INT stksiz; STcmd/sdb/display.c 444 0 33 24505 2514002165 7176 static char sccsid[] = "@(#)display.c 4.2 2/28/81"; #include "head.h" #include #include #include "cdefs.h" struct user u; BKPTR bkpthead; #ifdef FLEXNAMES #define bread(a,b,c) stread(b,c) #define blseek(a,b,c) stseek(b,c) #endif /* initialize frame pointers to top of call stack */ /* MACHINE DEPENDENT */ struct proct * initframe() { argp = *(ADDR *) (((ADDR) &u) + AP); frame = *(ADDR *) (((ADDR) &u) + FP); callpc = *(ADDR *) (((ADDR) &u) + PC); if ((frame == 0) || (frame & 0xf0000000 != 0x70000000)) return(badproc); return(adrtoprocp(callpc++)); /* ++ because UNIX backs up instrs */ } struct proct * nextframe() { callpc = get(frame+16, DSP); argp = get(frame+8, DSP); frame = get(frame+12, DSP) & EVEN; if (callpc > 0x70000000) { /* error handler kludge */ callpc = get(frame+64, DSP); argp = get(frame+8, DSP); frame = get(frame+12, DSP) & EVEN; } if ((frame == 0) || (frame & 0xf0000000 != 0x70000000)) return(badproc); return(adrtoprocp(callpc-1)); } /* returns core image address for variable */ /* MACHINE DEPENDENT */ ADDR formaddr(class, addr) register char class; ADDR addr; { if (debug) printf("formaddr(%o, %d)\n", class & 0377, addr); switch(class & STABMASK) { case N_RSYM: return(stackreg(addr)); case N_GSYM: case N_SSYM: case N_STSYM: case N_LCSYM: return(addr); case N_PSYM: return(argp+addr); case N_LSYM: return(frame+addr); default: printf("Bad class in formaddr: 0%o", class & 0377); return(0); } } char class; /* * stackreg(reg): * If the register for the current frame is somewhere on the stack * then return the address of where it is, otherwise its still in * the register so return the register number. * We distinguish the two by noting that register numbers are less * than 16 and that stack addresses are greater. * * MACHINE DEPENDENT */ ADDR stackreg(reg) { register int curframe, regfl, mask, i; struct proct *procp; ADDR regaddr; curframe = frame; regaddr = reg; regfl = 0x10000 << reg; for (procp=initframe(); frame!=curframe; procp=nextframe()) { if (procp == badproc) { error("Stackreg error: frame"); return(-1); } mask = get(frame+4, DSP); if (mask & regfl) { regaddr = frame + 20; for (i=0; i> 1; } if (!(mask & 0x10000)) { error("Stackreg error: contents"); return(-1); } } } return(regaddr); } /* returns address of proc:var. Sets externals class and subflag */ ADDR varaddr(proc, var) char *proc, *var; { return(findvar(proc, var, "", 0)); } /* * displays values of variables matching proc:var, * returns its address */ ADDR dispvar(proc, var, fmt) char *proc, *var, *fmt; { return(findvar(proc, var, fmt, 1)); } /* * Find and print values of all variables matching proc:var * using specified format. * Returns address of last matching variable. * * prvar==0 => no output, * prvar==1 => output value, * prvar==2 => output addr */ ADDR findvar(proc, var, fmt, prvar) char *proc, *var, *fmt; { ADDR addr = -1, a = -1; int metaflag = 0, match=0, nullflag=0, depthcnt = -1; char *comblk; register struct proct *procp; if (percentflag) { /* kludge for register names */ return(regout(var, prvar, fmt)); } if (var[0] == '\0') { error("Unexpected null variable name"); return(-1); } metaflag = eqany('*', proc) || eqany('?', proc) || eqany('*', var) || eqany('?', var); if (proc[0] == '\0') { nullflag++; proc = curproc()->pname; } comblk = colonflag ? "" : "*"; if (integ && !eqany(var[0], "->.[")) { depthcnt = integ; } if (integ) { if (eqany(var[0], "->.[")) match++; else depthcnt = integ; } procp = initframe(); if (!eqany(var[0], "->.[") && !(nullflag && colonflag)) { do { if (eqpat(proc, procp->pname)) { match++; if (--depthcnt==0 || integ==0) { a = outvar(procp->pname, var, fmt, metaflag, integ, N_GSYM, 0, prname, comblk, prvar); if (a != -1) addr = a; if (depthcnt == 0) break; } } } while ((procp=nextframe()) != badproc); } if ((colonflag || metaflag || a == -1) && (nullflag || eqpat(proc, ""))) { a = outvar("", var, fmt, metaflag, integ, N_GSYM, 0, prname, comblk, prvar); if (a != -1) { addr = a; match++; } } if (match==0 && colonflag) { procp = initframe(); do { if (eqstr(curproc()->pname, procp->pname)) break; } while ((procp=nextframe()) != badproc); a = outvar(curproc()->pname, var, fmt, metaflag, integ, N_GSYM, 0, prname, nullflag ? "_BLNK_" : proc, prvar); if (a != -1) { addr = a; match++; } } if (addr == -1 && match == 0) { addr = extoutvar(var, fmt, metaflag, prvar); if (addr != -1) return(addr); } if (match == 0) { printf("%s not an active procedure\n", proc); return(-1); } if (addr == -1) { if (var[0] == '.') var++; if (proc[0]) #ifndef FLEXNAMES printf("%.16s:%s not found\n", proc, var); #else printf("%s:%s not found\n", proc, var); #endif else printf("%s not found\n", var); return(-1); } return(addr); } char * typetodesc(type, subflag) short type; { register int ptr, ftn, ary; register char *desc; static char *typedesc[] = { "d", /* undef */ "d", /* farg */ "c", /* char */ "hd", /* short */ "d", /* int */ "ld", /* long */ "f", /* float */ "g", /* double */ "d", /* strty */ "d", /* unionty */ "d", /* enumty */ "d", /* moety */ "bu", /* uchar */ "hu", /* ushort */ "u", /* unsigned */ "lu", /* ulong */ "d" /* ? */ }; ptr = ftn = ary = 0; desc = typedesc[type&BTMASK]; for (; type & TMASK; type = DECREF(type)) { if (ISPTR(type)) ptr++; else if (ISFTN(type)) ftn++; else if (ISARY(type)) ary++; } if ((ptr-subflag == 1 || ary-subflag == 1) && desc[0] == 'c') return("s"); if (debug) printf ("PTR %d; FTN %d; ARY %d; DESC %s\n",ptr,ftn,ary,desc); if (ptr + ary == subflag) return(desc); if (ptr) return("x"); if (ptr==1 && ftn==1) return("p"); return(desc); } typetosize(type, stsize) short type; { register int ptr, ftn, ary; register int size; static char typesize[] = { 4, /* undef */ 4, /* farg */ 1, /* char */ 2, /* short */ WORDSIZE, /* int */ 4, /* long */ 4, /* float */ 8, /* double */ 0, /* strty */ 0, /* unionty */ 4, /* enumty */ 4, /* moety */ 1, /* uchar */ 2, /* ushort */ 4, /* unsigned */ 4, /* ulong */ 4 /* ? */ }; ptr = ftn = ary = 0; size = typesize[type&BTMASK]; for (; type & TMASK; type = DECREF(type)) { if (ISPTR(type)) ptr++; else if (ISFTN(type)) ftn++; else if (ISARY(type)) ary++; } if (debug) printf ("PTR %d; FTN %d; ARY %d; SIZE %d; STSIZE %d\n", ptr,ftn,ary,size,stsize); if (ptr>1) return(4); if (size == 0) return(stsize); else return(size); } /* print breakpoints */ prbkpt() { register BKPTR bkptr; register int cnt; char *cmdp; cnt = 0; for (bkptr = bkpthead; bkptr; bkptr=bkptr->nxtbkpt) if (bkptr->flag) { cnt++; printbkpt("", adrtoprocp(bkptr->loc), bkptr->loc); cmdp = bkptr->comm; (( if (*cmdp != '\n') { printf(" <"); while (*cmdp != '\n') printf("%c", *cmdp++); printf(">\n"); } else printf("\n"); } if (cnt == 0) printf("No breakpoints set\n"); } /* interactively delete breakpoints */ idbkpt() { register BKPTR bkptr; register int yesflg, cnt; register char c; cnt = 0; for (bkptr = bkpthead; bkptr; bkptr=bkptr->nxtbkpt) if (bkptr->flag) { printbkpt(" ? ", adrtoprocp(bkptr->loc), bkptr->loc); yesflg = 0; cnt++; do { c = getchar(); if (c == 'y' || c == 'd') yesflg++; } while (c != '\n'); if (yesflg) bkptr->flag = 0; } if (cnt == 0) printf("No breakpoints set\n"); } /* delete all breakpoints */ dabkpt() { register BKPTR bkptr; for (bkptr = bkpthead; bkptr; bkptr=bkptr->nxtbkpt) bkptr->flag = 0; } /* * Print name of breakpoint for a, b, d commands: */ printbkpt(s, procp, dot) char *s; struct proct *procp; ADDR dot; { adrtolineno(dot); if (dot != lnfaddr) printf("0x%x (", dot); prlnoff(procp, dot); if (dot != lnfaddr) printf(")"); printf("%s", s); } /* print call frame */ prframe() { prfrx(0); } /* set top to print just the top procedure */ prfrx(top) { int narg; long offset; register char class; register int endflg; char *p; struct proct *procp; struct nlist stentry; if ((procp = initframe()) == badproc) return; do { if (get(frame+12, DSP) == 0) return; p = procp->pname; if (eqstr("__dbsubc", p)) return; if (p[0] == '_') { endflg = 1; #ifndef FLEXNAMES printf("%.15s(", p+1); #else printf("%s(", p+1); #endif } else { #ifndef FLEXNAMES printf("%.16s(", p); #else printf("%s(", p); #endif endflg = 0; } if (endflg == 0) { offset = procp->st_offset; blseek(&sbuf, offset, 0); do { if (bread(&sbuf, &stentry, sizeof stentry) < sizeof stentry) { endflg++; break; } class = stentry.n_type & STABMASK; } while (class == N_FUN); while (class != N_PSYM) { if (bread(&sbuf, &stentry, sizeof stentry) < sizeof stentry) { endflg++; break; } class = stentry.n_type & STABMASK; if (class == N_FUN) { endflg++; break; } } } narg = get(argp, DSP); if (narg & ~0xff) narg = 0; argp += WORDSIZE; while (narg) { if (endflg) { printf("%d", get(argp, DSP)); argp += 4; } else { int length; #ifndef FLEXNAMES printf("%.16s=", stentry.n_name); #else printf("%s=", stentry.n_un.n_name); #endif dispx(argp, "", N_GSYM, stentry.n_desc, 0, 0, DSP); length = typetosize(stentry.n_desc, 0); if (length > WORDSIZE) argp += length; else argp += WORDSIZE; } do { if (endflg) break; if (bread(&sbuf, &stentry, sizeof stentry) < sizeof stentry) { endflg++; break; } class = stentry.n_type & STABMASK; if (class == N_FUN) { endflg++; break; } } while (class != N_PSYM); l1: if (--narg != 0) printf(","); } printf(")"); if (debug) printf(" @ 0x%x ", callpc); if (procp->sfptr != badfile) printf(" [%s:%d]", adrtofilep(callpc-1)->sfilename, adrtolineno(callpc-1)); printf("\n"); } while (((procp = nextframe()) != badproc) && !top); } INT signo; STRING signals[]; extern nsig; sigprint() { if (signo < nsig) printf("%s", signals[signo]); else printf("signal %d???", signals[signo]); } { endflg++; break; } } while (class != N_PSYM); l1: if (--narg != 0) printf(","); } printf(")"); if (debug) printf(" @ 0x%x ", callpc); if (procp->sfptr != bacmd/sdb/docomm.c 444 0 33 21263 2514002166 7006 static char sccsid[] = "@(#)docomm.c 4.1 10/9/80"; #include #include "head.h" #include #include struct user u; L_INT cntval; INT signo; INT adrflg; INT pid; ADDR userpc; char *s; enum {NOCOM, PRCOM, DSCOM, DSICOM} lastcom; /* last command: nothing noteworthy, print source, display variable, display instruction */ docommand() { register char *p; register int i; register ADDR addr, bkaddr; struct proct *procp; char s[4]; cntval = 1; adrflg = 0; errflg = 0; if (scallf) { doscall(); setcur(1); lastcom = NOCOM; return; } if (reflag) { /* search for regular expression */ dore(); lastcom = PRCOM; return; } if (cmd == '\0') { if (integ != 0 && var[0] != '\0') { error("Invalid command (1)"); return; } if (integ != 0) { /* print line number */ ffind(integ); fprint(); lastcom = PRCOM; return; } if (var[0] != 0) { printf("Unexpected null command\n"); return; } } switch (cmd) { case 'Y': debug = !debug; break; case 'V': version(); break; case 'M': if (args[0]) { setmap(args); } else { printmap("? map", &txtmap); printmap("/ map", &datmap); } break; case 'x': printregs(); break; case 'X': printpc(); break; case 'a': if (integ) { cpstr(args, "l\n"); } else if (proc[0]) { cpall(args, "T\n"); } else { error("Bad arguments"); break; } goto setbrk; break; case 'l': setcur(1); lastcom = NOCOM; break; case 'T': prfrx(1); lastcom = NOCOM; break; case 't': prframe(); lastcom = NOCOM; break; case 'e': p = args; if (*p == '\0') { #ifndef FLEXNAMES printf("%.16s() in \"%s\"\n", curproc()->pname, curfile); #else printf("%s() in \"%s\"\n", curproc()->pname, curfile); #endif break; } while (*p != '\0') if (*p++ == '.') goto l1; /* argument is procedure name */ procp = findproc(args); if ((procp->pname[0] != '\0') && (procp->sfptr != badfile)) { finit(adrtofilep(procp->paddr)->sfilename); ffind(procp->lineno); } else printf("Can't find %s\n", args); #ifndef FLEXNAMES printf("%.16s() in \"%s\"\n", curproc()->pname, curfile); #else printf("%s() in \"%s\"\n", curproc()->pname, curfile); #endif lastcom = PRCOM; break; l1: /* argument is filename */ finit(args); printf("\"%s\"\n", curfile); lastcom = PRCOM; break; case 'p': if (integ) ffind(integ); fprint(); lastcom = PRCOM; break; case 'q': exit(0); case 'w': if (integ) ffind(integ); i = fline; fback(WINDOW/2); fprintn(WINDOW); ffind(i); lastcom = PRCOM; break; case 'Q': prdebug(); break; case 'z': if (integ) ffind(integ); fprintn(WINDOW); lastcom = PRCOM; break; case '-': fback(integ ? integ : 1); fpargs(); lastcom = PRCOM; break; case '+': fforward(integ ? integ : 1); fpargs(); lastcom = PRCOM; break; case '\n': switch (lastcom) { case PRCOM: fforward(1); fprint(); break; case DSCOM: oaddr += oincr ? oincr : typetosize(otype, WORDSIZE); printf("0x%x/ ", oaddr); dispf((ADDR) oaddr, odesc, oclass == N_RSYM ? oclass : N_GSYM, otype, 0, 0, DSP); break; case DSICOM: dot += oincr; prisploc(); dispi(dot, odesc, N_GSYM, 0, 0); break; } break; case '\004': if (!isatty(0)) exit(0); switch (lastcom) { case PRCOM: fforward(1); printf("\b"); fprintn(WINDOW); lastcom = PRCOM; break; case DSICOM: printf("\b"); for (i=0; iflag = flagss; scallx = 0; error("Procedure killed"); longjmp(env, 0); } else { dopcs('k'); printf("\n"); lastcom = NOCOM; break; } case 'B': prbkpt(); break; case 'b': setbrk: if (proc[0] == '\0' && integ == 0) { integ = fline; } setdot(); if (dot == -1 || dot == 0) { error("Cannot set breakpoint"); break; } dopcs('b'); s[0] = ' '; s[1] = cmd; s[2] = '\n'; s[3] = 0; s[1] = cmd; printbkpt(s, adrtoprocp(dot), dot); break; case 'd': if (proc[0] == '\0' && integ == 0) { idbkpt(); break; } (( setdot(); if (dot == -1) { error("Non existent breakpoint"); break; } dopcs('d'); break; case 'D': dabkpt(); error("All breakpoints deleted"); break; case 'm': addr = varaddr(proc[0] ? proc : curproc()->pname, var); printf("stopped with value %d\n", monex(addr, 'd')); setcur(1); lastcom = NOCOM; break; case '?': if (!(var[0] == '.' && var[1] == '\0')) setdot(); if (errflg) { error(errflg); break; } prisploc(); dispi(dot, args[0] ? args : "i", N_GSYM, 0, 0); lastcom = DSICOM; break; case '/': if (var[0] == '.' && var[1] == '\0') { if (integ == 0) integ = oaddr; dispf((ADDR) integ, args[0] ? args : odesc, oclass == N_RSYM ? oclass : N_GSYM, otype, 0, 0, DSP); oaddr = integ; } else if (integ && (var[0] == '\0')) { dispf((ADDR) integ, args, N_GSYM, 0, 0, 0, DSP); oaddr = integ; cpstr(odesc, args); oclass = N_GSYM; otype = 0; } else dispvar(proc, var, args); lastcom = DSCOM; break; case '=': if (var[0] == '\0') { if (proc[0]) { addr = getaddr(proc, integ); if (addr == -1) { error("Unknown address"); break; } } else addr = integ; dispf(addr, args[0] ? args : "x", 0, -1, 0, 0, DSP); } else findvar(proc, var, args[0] ? args : "x", 2); break; case '!': if (var[0] == '\0') addr = getaddr(proc, integ); else addr = varaddr(proc, var); if (addr == -1) error("Unknown variable"); else { if (number(args[0]) || eqany(args[0], ".-")) { char *p; double atof(); union { struct{ int w1, w2; } ww; double d; } dbl; p = (args[0] == '-') ? args+1 : args; for (; *p != '.' && *p != 'e'; p++) { if (!number(*p)) goto l2; } dbl.d = atof(args); putval(addr, 'd', dbl.ww.w1); if (typetodesc(sl_type,0)[0] == 'g') putval(addr+WORDSIZE, 'd', dbl.ww.w2); break; } l2: if (percentflag) *(ADDR *)(((ADDR)&u)+addr) = argvalue(args); else if (sl_class == N_RSYM && addr < 16) putreg(addr,typetodesc(sl_type,subflag)[0], argvalue(args)); else putval(addr,typetodesc(sl_type,subflag)[0], argvalue(args)); } lastcom = NOCOM; break; case '"': printf(args); break; } } fpargs() { register int i; switch(args[0]) { case 'p': case '\0': fprint(); break; case 'w': i = fline; fback(WINDOW/2); fprintn(WINDOW); ffind(i); break; case 'z': fprintn(WINDOW); break; } } MSG BADTXT; /* Used by a, b, c, C, d and g commands to find linenumber */ setdot() { if (ncolonflag) { dot = integ; get(dot, ISP); if (errflg) dot = -1; } else { dot = getaddr(proc, integ); if (dot == -1) errflg = "Bad line number"; } } '"': printf(args); break; } } fpargs() { register int i; switch(args[0]) { case 'p': case '\0': fprint(); break; case 'w': i = fline; fback(WINDOW/2); fprintn(WINDOW); ffind(i); break; case 'z': fprintn(WINDOW); break; } } MSG BADTXT; /* Used by a, b, c, C, d and g commands to find linenumber */ setcmd/sdb/fio.c 444 0 33 15326 2514002170 6303 static char sccsid[] = "@(#)fio.c 4.1 10/9/80"; /* * sdb - a symbolic debugger for unix - source file access routines. */ #include "head.h" #include /* * These procedures manage the source files examined by sdb, * providing access to lines by number and utilities for printing * and scrolling. One file is kept open by these routines, and * line index tables are maintained for all files which have been * ``current'' at any time so far. This makes line access trivial, * since the location of each line in the files is known, * although we get ``burned'' if the file is changed. * SHOULD WATCH THE MODTIME OF FILES AND REINDEX IF IT CHANGES. */ /* * Structure for files which have been ``indexed''. * Contains a pointer to the file name, a pointer to an * array of seek pointers for the lines in the file, * and a next link in a chain of these for all files we have indexed, * The currently open file is cinfo->; the chain of active files is finfo. */ struct finfo { char *name; /* name of this file w/o common pfx */ off_t *lines; /* array of seek pointers */ /* line i stretches from lines[i-1] to lines[i] - 1, if first line is 1 */ int nlines; /* number of lines in file */ /* lines array actually has nlines+1 elements, so last line is bracketed */ struct finfo *next; /* link in chain of known files */ } *finfo, *cfile; FILE *FIO; /* current open file (only 1 now) */ char fibuf[BUFSIZ]; /* * We use stdio when first reading the file, but thereafter * use our own routines, because we want to be able * to read backwards efficiently and avoid a tell() system * call on each line. Fseekpt remebers where we are in the current * file. */ off_t fseekpt; /* * Make ``name'' the current source file, if it isn't already. * If we have never seen this file before, then we create a finfo * structure for it indexing the lines (this requires reading the * entire file and building an index, but is well worth it since * we otherwise have to brute force search the files all the time.) */ finit(name) char *name; { char buf[BUFSIZ]; register off_t *lp; if (cfile && !strcmp(cfile->name, name)) return; /* its already current, do nothing */ /* IT WOULD BE BETTER TO HAVE A COUPLE OF FILE DESCRIPTORS, LRU */ if (FIO) { fclose(FIO); FIO = NULL; } /* * Paste the given name onto the common prefix (directory path) * to form the full name of the file to be opened. */ strcpy(fp, name); if ((FIO = fopen(filework, "r")) == NULL) { nolines = 1; perror(filework); return; } setbuf(FIO, fibuf); fseekpt = -BUFSIZ; /* putatively illegal */ strcpy(curfile, name); /* * See if we have alread indexed this file. * If so, nothing much to do. */ for (cfile = finfo; cfile; cfile = cfile->next) if (!strcmp(cfile->name, name)) return; /* * Create a structure for this (new) file. * Lines array grows 100 lines at a time. * 1 extra so last line is bracketed. */ cfile = (struct finfo *)sbrk(sizeof (struct finfo)); lp = cfile->lines = (off_t *)sbrk(101 * sizeof (off_t)); *lp++ = 0; /* line 1 starts at 0 ... */ cfile->nlines = 0; /* IT WOULD PROBABLY BE FASTER TO JUST USE GETC AND LOOK FOR \n */ while (fgets(buf, sizeof buf, FIO)) { if ((++cfile->nlines % 100) == 0) sbrk(100 * sizeof (off_t)); /* * Mark end of the cfile->nlines'th line */ lp[0] = lp[-1] + strlen(buf); lp++; } if (cfile->nlines == 0) { printf("%s: no lines in file\n", filework); cfile = 0; return; } /* * Allocate space for the name, making sure to leave the * break on a word boundary. * IT WOULD BE MUCH BETTER TO USE MALLOC AND REALLOC IN SDB. */ sbrk(lp + ((strlen(name)+sizeof(off_t)-1)&~(sizeof(off_t)-1))); strcpy(cfile->name = (char *)lp, name); cfile->next = finfo; finfo = cfile; } /* * Get the current line (fline) into fbuf */ fgetline() { register off_t *op = &cfile->lines[fline-1]; int o, n; n = op[1] - op[0]; fbuf[n] = 0; /* * Case 1. Line begins in current buffer. * * Compute the number of characters into the buffer where * the line starts. If this offset plus its length is greater * than BUFSIZ, then this line splits across a buffer boundary * so take the rest of this buffer and the first part of the next. * Otherwise just take a chunk of this buffer. */ if (*op >= fseekpt && *op < fseekpt + BUFSIZ) { case1: o = op[0] - fseekpt; if (o + n > BUFSIZ) { strncpy(fbuf, fibuf+o, BUFSIZ-o); fseekpt += BUFSIZ; read(fileno(FIO), fibuf, BUFSIZ); strncpy(fbuf+BUFSIZ-o, fibuf, n-(BUFSIZ-o)); } else strncpy(fbuf, fibuf+o, n); return; } /* * Case 2. Line ends in current buffer. * * If the line ends in this buffer (but doesn't begin in * it or else we would have had case 1) take the beginning * part of the buffer (end of the line) and then back up and * get the rest of the line from the end of the previous block. */ if (op[1]-1 >= fseekpt && op[1] <= fseekpt+BUFSIZ) { o = op[1] - fseekpt; strncpy(fbuf+n-o, fibuf, o); fseekpt -= BUFSIZ; lseek(fileno(FIO), fseekpt, 0); read(fileno(FIO), fibuf, BUFSIZ); strncpy(fbuf, fibuf+op[0]-fseekpt, n-o); return; } /* * Case 3. Line not in current buffer at all. * * Read in the buffer where the line starts and then go * back and handle as case 1. */ fseekpt = (op[0] / BUFSIZ) * BUFSIZ; lseek(fileno(FIO), fseekpt, 0); read(fileno(FIO), fibuf, BUFSIZ); goto case1; } /* * Advance current line, end-around (like for / search). */ fnext() { if (cfile == 0) return; if (fline == cfile->nlines) { fline = 1; } else fline++; fgetline(); } /* * Retreat the current line, end around. */ fprev() { if (cfile == 0) return; if (fline == 1) fline = cfile->nlines; else fline--; fgetline(); } /* * Print the current line. */ fprint() { register char *p; if (cfile == 0) { error("No lines in file"); return; } printf("%d: %s", fline, fbuf); } /* * Make line `num' current. */ ffind(num) register int num; { if (cfile == 0) return; if (num > cfile->nlines) error("Not that many lines in file"); else if (num <= 0) error("Zero or negative line?"); else { fline = num; fgetline(); } } /* * Go back n lines. */ fback(n) { int i; if (cfile == 0) return (0); if (n > fline - 1) n = fline - 1; fline -= n; fgetline(); return (n); } /* * Go forwards n lines. */ fforward(n) int n; { register int fnext; if (cfile == 0) return(0); if (fline + n > cfile->nlines) n = cfile->nlines - fline; fline += n; fgetline(); return (n); } /* * Print (upto) n lines, returning number printed. */ fprintn(n) in((t n; { register int i; if (cfile == 0) { error("No lines in file"); return (0); } for (i = 1; i <= n; i++) { fprint(); if (fline == cfile->nlines || i == n) return(i); fnext(); } return (n); } return (n); } /* * Go forwards n lines. */ fforward(n) int n; { register int fnext; if (cfile == 0) return(0); if (fline + n > cfile->nlines) n = cfile->nlines - fline; fline += n; fgetline(); return (n); } /* * Print (upto) n lines, returning number printed. */ fprintn(n) incmd/sdb/head.h 444 0 33 10501 2514002171 6423 /* "@(#)head.h 4.1 10/9/80" */ #include #define PAGSIZ (CLSIZE*NBPG) #include #include #include #include "old.h" #include "defs.h" /* input line decoding */ char proc[30]; /* procedure name */ int integ; /* count or number in input */ char cmd; /* command letter */ char re[128]; /* regular expression */ char args[128]; /* arguments */ char *argsp; /* pointer to args */ char var[60]; /* variable name */ int scallf; /* set to 1 iff procedure call */ int reflag; /* set to 1 iff re */ int redir; /* set to 1 iff forward search */ int colonflag; /* set to 1 iff colon typed */ int ncolonflag; /* set to 1 iff colon typed after number */ int percentflag; /* set to 1 iff percent symbol typed */ /* source file i/o */ char curfile[30]; /* name of file being edited */ int fline; /* line number in file */ char fbuf[BUFSIZ]; /* current line from file */ char filework[128]; /* place to put filename */ char *fp; /* pointer to it */ int nolines; /* set to 1 iff no lines in file */ #ifdef FLEXNAMES off_t gstart; /* start of string table in a.out */ char *strtab; /* string table from a.out * (in core!) */ long ssiz; /* size of string table (for range checks) */ #endif /* returned by slookup */ #ifndef FLEXNAMES char sl_name[8]; #else char *sl_name; #endif char sl_class; short sl_type; int sl_size, sl_addr; int subflag; /* procedure call information */ int scallx; /* procedure call in progress */ ADDR fps, aps, pcs; /* old stack frame */ BKPTR bkpts; /* old breakpoint */ int flagss; /* and its flags */ char dschar; /* '/' if value should be displayed */ /* symbol table info */ long ststart; /* offset of symbol table in a.out */ #ifndef VMUNIX struct brbuf sbuf; /* buffer for symbol table */ #endif long extstart; /* offset of first external in a.out */ /* address info */ ADDR dot; /* current address */ ADDR callpc, frame, argp; /* current stack frame */ /* other */ char odesc[10]; /* descriptor of last displayed variable */ ADDR oaddr; /* address of last displayed variable */ char otype; /* type of last displayed variable */ char oclass; /* class of last displayed variable */ char oincr; /* size of last displayed variable */ struct sgttyb sdbttym, userttym; /* tty modes for sdb and user */ char oldargs[128]; char prname[50]; /* print name used by outvar */ jmp_buf env; /* environment for setjmp, longjmp */ int debug; /* toggled by Y command */ time_t symtime; /* modification time of symfil */ char *symfil; char *corfil; ADDR exactaddr, lnfaddr; /* set by adrtolineno() */ ADDR firstdata; /* lowest address of data */ #define STABMASK 0376 #define WINDOW 10 /* window size for display commands */ #define COMMANDS "\004\"+-=!/BCDMQRSTXabcdegklmpqrstwxzVXY" /* each sdb command must appear here */ #define NUMARGS 16 /* number of args allowed in sub call */ #define SUBSTSP 512 /* length of space for sub args and strings */ #define WORDSIZE 4 /* wordsize in bytes on this machine */ #define BIGNUM 0x7fffffff #define MAXADDR 1L<<30 struct filet { #ifndef FLEXNAMES char sfilename[31]; /* source file name */ #else char *sfilename; #endif char lineflag; /* set iff this is a '#line' file */ ADDR faddr; /* address in core */ long stf_offset; /* offset in a.out */ } *files, *badfile; struct proct { #ifndef FLEXNAMES char pname[8]; /* procedure name */ #else char *pname; #endif ADDR paddr; /* address in core */ long st_offset; /* offset in a.out */ struct filet *sfptr; /* source file name pointer */ int lineno; /* line number in source file */ char entrypt; /* 1 iff a F77 entry */ } *procs, *badproc; #define PROCINCR 20 #define FILEINCR 10 #define varchar(x) ((x>='A' && x<='Z') || (x>='a' && x<='z') || x == '_' || x == '.' || x == '[' || x == ']' || x == '-' || x == '>' || x == '*' || x == '?') #define number(x) (x >= '0' && x <= '9') char *readline(), readchar(), rdc(); char *cpname(); char *cpstr(), *cpall(); char *sbrk(); char *typetodesc(); int octdigit(), decdigit(); hexdigit(); int octconv(), decconv(); hexconv(); long readint(), rint(); long adrtostoffset(); long getval(), argvalue(); long slookup(), globallookup(); ADDR varaddr(), dispvar(); ADDR extaddr(), formaddr(), stackreg(); struct proct *curproc(); struct proct *findproc(); struct proct *adrtoprocp(); struct proct *initframe(), *nextframe(); struct filet *findfile(), *adrtofilep(); line(), readchar(), rdc(); char *cpname(); char *cpstr(), *cpall(); char *sbrk(); char *typetodesc(); int octdigit(), decdigit(); hexdigit(); int octconv(), decconv(); hexconv(); long readintcmd/sdb/mac.h 444 0 33 1323 2514002171 6244 /* "@(#)mac.h 4.1 10/9/80" */ # /* * UNIX debugger */ #define TYPE typedef #define STRUCT struct #define UNION union #define REG register #define BEGIN { #define END } #define IF if( #define THEN ){ #define ELSE } else { #define ELIF } else if ( #define FI } #define FOR for( #define WHILE while( #define DO ){ #define OD } #define REP do{ #define PER }while( #define DONE ); #define LOOP for(;;){ #define POOL } #define SKIP ; #define DIV / #define REM % #define NEQ ^ #define ANDF && #define ORF || #define TRUE (-1) #define FALSE 0 #define LOBYTE 0377 #define HIBYTE 0177400 #define STRIP 0177 #define HEXMSK 017 #define SP ' ' #define TB '\t' #define NL '\n' #define SCCSID(arg) static char Sccsid[] = "arg" ELSE } else { #define ELIF } else if ( #define FI } #define FOR for( #define WHILE while( #define DO ){ #define OD } #define REP do{ #define PER }while( #define DONE ); #define LOOP for(;;){ #define POOL } #define SKIP ; #define DIV / #define REM % #define NEQ ^ #define ANDF && #define ORF || #decmd/sdb/machine.h 444 0 33 1001 2514002172 7102 /* "@(#)machine.h 4.1 10/9/80" */ /* * UNIX/vax debugger */ /* unix parameters */ #define DBNAME "adb\n" #define LPRMODE "%R" #define OFFMODE "+%R" #define TXTRNDSIZ PAGSIZ TYPE long TXTHDR[8]; TYPE long SYMV; #ifndef vax struct {short hiword; short loword;}; /* stupid fp-11 */ #endif /* symbol table in a.out file */ struct symtab { char symc[8]; char symf; char sympad[3]; SYMV symv; }; #define SYMTABSIZ (sizeof (struct symtab)) #define SYMCHK 057 #define SYMTYPE(symflg) (symflg&41 ? DSYM : NSYM) * "@(#)machine.h 4.1 10/9/80" */ /* * UNIX/vax debugger */ /* unix parameters */ #define DBNAME "adb\n" #define LPRMODE "%R" #define OFFMODE "+%R" #define TXTRNDSIZ PAGSIZ TYPE long TXTHDR[8]; TYPE long SYMV; #ifndef vax struct {short hiword; short loword;}; /* stupid fp-11 */ #endif /* symbol table in a.out file */ struct symtab { char symc[8]; char symf; char sympad[3]; SYMV symv; }; #define SYMTABSIZ (sizeof (struct symtab)) #define SYMCHK 057 #define SYMTYPE(symflg) (symflg&41 ? DSYM : NSYM)cmd/sdb/TESTS/ 775 0 33 0 2527315024 6165 cmd/sdb/TESTS/t.c 644 0 33 627 2334465142 6647 struct { char cc; int aa; } s1, s2, s3[2]; main(argc,argv,envp) char **argv, **envp; { s1.cc = 'a'; s2.cc = 'b'; s3[0].cc = 'c'; s3[1].cc = 'd'; s1.aa = 22; s2.aa = 33; s3[0].aa = 44; sub(s1.cc); abort(); } sub(c) char c; { register char d; d = c; inner(&c); } inner(s) char *s; { char c; c = *s; core(s); } core(s) register char *s; { char *p; char c; p = s; c = *p; } |/ lC. /,"((cmd/sdb/TESTS/x.c 644 0 33 252 2334465144 6647 main() { foo(123456); } foo(){ register int f_a, f_b; f_a = 37; f_b = 38; bar(); }; bar(){ register int b_a, b_b, b_c; b_a = 2; b_b = 3; b_c = 4; abort(); } .aa = 33; s3[0].aa = 44; sub(s1.cc); abort(); } sub(c) char c; { register char d; d = c; inner(&c); } inner(s) char *s; { char c; c = *s; core(s); } core(s) register char *s; { char *p; char c; p = s; c = *p; } |//|,|5h< /,"cmd/sdb/TESTS/y.c 644 0 33 312 2334465145 6646 main() { int i = 0; int j = 0; register a, b, c, d, e, f, g, h; for (;;) { i++; j++; printf("Hello sailor\n"); a = 1; b = 3; c = 5; d = 7; e = 9; f = 11; g = 12; h = 13; } } (s1.cc); abort(); } sub(c) char c; { register char d; d = c; inner(&c); } inner(s) char *s; { char c; c = *s; core(s); } core(s) register char *s; { char *p; char c; p = s; c = *p; } |//|,|5x< /,"cmd/sdb/TESTS/z.c 644 0 33 247 2334465145 6656 struct z{ int i,j,k; } ; main() { struct z a; a.i = 3; a.j = 4; a.k = 5; sub(a,12); printf("Hello sailor\n"); abort(); } sub(y,m) struct z y; { y.i++; } ; f = 11; g = 12; h = 13; } } (s1.cc); abort(); } sub(c) char c; { register char d; d = c; inner(&c); } inner(s) char *s; { char c; c = *s; core(s); } core(s) register char *s; { char *p; char c; p = s; c = *p; } |//|,|5< /,"cmd/sdb/TESTS/zz.c 644 0 33 55 2373516066 7027 int i = 2; int j = 3; main() { int k = 4; } a; a.i = 3; a.j = 4; a.k = 5; sub(a,12); printf("Hello sailor\n"); abort(); } sub(y,m) struct z y; { y.i++; } ; f = 11; g = 12; h = 13; } } (s1.cc); abort(); } sub(c) char c; { register char d; d = c; inner(&c); } inner(s) char *s; { char c; c = *s; core(s); } core(s) register char *s; { char *p; char c; p = s; c = *p; } |//|,|5< /,"cmd/sdb/TESTS/test.c 644 0 33 773 2334465143 7366 int r = 22; int array[] = { 5, 4, 3, 2, 1}; char s[] = "abcdefg"; ignore(){ int i; i++; } main(argc, argv) char **argv; { char *p; p = s; test(); } test() { int a,b,c; a = 1; b = 2; c = 3; sub (a,b, 14); } sub(x,y) { x = 2; r = 22; final(y); } final(z) register int z; { register p,q,a; int f,g; int x[10]; struct { int aa; int bb; } d, *pd; pd = &d; d.aa=23; d.bb=34; p = 1; q = 2; a = 3; f = 4; { int i, j, k; i = 2; g = 5; x[10000] = 2; g = 0; } g = 1; } "cmd/sdb/TESTS/new 644 0 33 7127 2373451033 6773 /* * These macros are used to speak ``offsets'' to the outside world, * so that we can use the other source files for sdb essentially * unchanged, even though they believe that we work with symbol * table offsets, and we really have the whole symbol table in * core and would prefer to just work with pointers into it. */ #define sptooff(sp) (ststart + (int)(sp) - (int)(symtab)) #define offtosp(off) (&symtab[((off) - ststart) / sizeof (struct nlist)) /* * Initialize the file and procedure tables. * * This routine rummages through the symbol table and builds tables * of the files and procedures referenced there, sorting the latter * table into address order. These tables are used in the other * routines defined here. * * NB: * * In this version of sdb we could well dispense with most of the * fields of these tables, since we have the symbol table in core, * but for compatibility for the time being we duplicate the information * so older code in other sdb files will work unchanged. */ initfp() { register struct nlist *sp; register struct proct *procp; register struct filet *filep; struct stat stb; int nfile, nproc; int class; extern int compar(); /* Sort routine for procedure table */ firstdata = MAXPOS; /* * Since the symbol table is in core, we can afford * two passes over it to avoid messy allocation strategies * for these tables, who sizes are as yet unknown. */ nfile = 0; nproc = 0; for (sp = symtab; sp < esymtab; sp++) switch (sp->n_type & STABMASK) { case N_SO: case N_SOL: nfile++; continue; case N_TEXT: if (sp->n_name[0] == '_') nfile++; continue; case N_FUN: case N_ENTRY: nfile++; continue; } files = calloc(nfile+1, sizeof (struct filet)); procs = calloc(nfile+1, sizeof (struct filet)); if (files == 0 || procs == 0) { printf("Couldn't get space for file/procedure tables\n"); exit(1); } if (nfiles == 0) printf("Warning: `%s' not compiled with -g\n", symfil); procp = procs; filep = files; for (sp = symtab; sp < esymtab; sp++) { class = sp->n_type & STABMASK; switch (class) { case N_SO: case N_SOL: filep->faddr = sp->n_value; filep->lineflag = (class == N_SOL); filep->stf_offset = sptooff(sp); filep->sfilename = sp->n_name; strcpy(fp, filep->sfilename); if (stat(filework, &stb) == -1) printf("Warning: `%s' not found\n", filep->sfilename); else if (stb.st_mtime > symtime) printf("Warning: `%s' newer than `%s'\n", filep->sfilename, symfil); filep++; break; case N_TEXT: if (stentry.n_name[0] != '_') break; case N_FUN: case N_ENTRY: procp->pname = sp->n_name; procp->paddr = sp->n_value; procp->st_offset = sptooff(sp); if (class != N_TEXT) { procp->sfptr = filep - 1; procp->lineno = so->n_desc; } else { procp->sfptr = badfile; procp->lineno = 0; } procp->entrypt = class == N_ENTRY; procp++; break; } if (sp->n_type & N_EXT) { if (!extstart) extstart = sp; /* THIS LOOKS WRONG !!! SHOULD BE (x || y) && z ??? */ if (sp->n_type == (N_DATA+N_EXT) || sp->n_type == (N_BSS+N_EXT) || sp->n_value < firstdata) firstdata = sp->n_value; } } if (filep != &files[nfile] || procp != &procs[nproc]) { printf("initfp botch - tell someone\n"); exit(1); } /* * Now have the file and procedure tables. * Sort the procedure table, and initialize the boundary * elements of the tables. */ qsort(procs, procp-procs, sizeof procs[0], compar); badproc = procp; badfile = filep; badproc->st_offset = esymtab; badproc->sfptr = badfile; badproc->pname = badfile->sfilename = ""; setcur(1); } value < firstdata) firstdata = sp->n_value; } } if (filep != &files[nfile] || procp != &procs[nproc]) { printf("initfp botch - tell someone\n"); exit(1); } /* * Now have the file and procedure tables. * Sort the procedure table, and initialize the boundary * elements of the tables. */ qsort(procs, procp-procs, sizeof procs[0], compar); badproc = procp; badfile = filep; badproc->st_offset = esymtacmd/sdb/main.c 444 0 33 4501 2514002172 6425 ((static char sccsid[] = "@(#)main.c 4.1 10/9/80"; # /* * * UNIX debugger * */ #include "head.h" #include #include #include INT mkfault; INT executing; CHAR *lp; L_INT maxoff; L_INT maxpos; ADDR sigint; ADDR sigqit; INT wtflag; L_INT maxfile; L_INT maxstor; L_INT txtsiz; L_INT datsiz; L_INT datbas; L_INT stksiz; STRING errflg; INT magic; L_INT entrypt; CHAR lastc; STRING symfil; STRING corfil; INT argcount; ADDR userpc; int fpe(); main(argc, argv) REG STRING *argv; REG INT argc; { register char *p; struct stat stbuf; userpc = 1; symfil = "a.out"; corfil = "core"; maxfile=1L<<24; maxstor=1L<<31; #ifndef STD #ifndef VAX135 maxstor -= ctob(UPAGES); #endif #endif setbuf(stdout, NULL); setbuf(stderr, NULL); WHILE argc>1 DO IF eqstr("-w",argv[1]) THEN wtflag=2; argc--; argv++; ELSE break; FI OD IF argc>1 THEN symfil = argv[1]; FI IF argc>2 THEN corfil = argv[2]; FI fp = filework; if (argc > 3) { for (p = argv[3]; *p; *fp++ = *p++) ; *fp++ = '/'; } argcount=argc; if (stat(symfil, &stbuf) == -1) { printf("`%s' does not exist\n", symfil); exit(4); } symtime = stbuf.st_mtime; if (stat(corfil, &stbuf) != -1) { if (symtime > stbuf.st_mtime) printf("Warning: `%s' newer than `%s'\n", symfil, corfil); } setsym(); setcor(); initfp(); mkioptab(); /* set up variables for user */ maxoff=MAXOFF; maxpos=MAXPOS; gtty(2, &sdbttym); IF (sigint= (ADDR) signal(SIGINT,01))!=01 THEN sigint= (ADDR) fault; signal(SIGINT,fault); FI sigqit= (ADDR) signal(SIGQUIT,1); signal(SIGILL, fpe); setjmp(env); if (debug) printf("Sdb restarted\n"); gtty(2, &userttym); if (sdbttym.sg_flags != userttym.sg_flags) stty(2, &sdbttym); IF executing THEN delbp(); FI executing=FALSE; for (;;) { mkfault = 0; printf("*"); if (decode(readline(stdin)) == 1) { printf("Error; try again\n"); continue; } if (debug) { printf("cmd %c:\n", cmd); printf("%s:%s\n", proc, var); printf("args-%s;re-%s;integ-%d\n", args, re, integ); printf("scallf-%d;reflg-%d\n", scallf, reflag); printf("colonflag-%d;ncolonflag-%d\n\n", colonflag, ncolonflag); } docommand(); } } fault(a) { signal(a,fault); mkfault++; printf("\n"); longjmp(env, 0); } fpe() { signal(SIGILL, fpe); error("Illegal floating constant"); longjmp(env, 0); } dline(stdin)) == 1) { printf("Error; try again\n"); continue; } if (debug) { printf("cmd %c:\n", cmd); printf("%s:%s\n", proc, var); printf("args-%s;re-%s;integ-%d\n", args, rcmd/sdb/message.c 444 0 33 2141 2514002173 7124 static char sccsid[] = "@(#)message.c 4.1 10/9/80"; # /* * * UNIX debugger * */ #include "mac.h" #include "mode.h" MSG BADMOD = "bad modifier"; MSG NOBKPT = "no breakpoint set"; MSG NOPCS = "no process"; MSG BADTXT = "text address not found"; MSG BADDAT = "data address not found"; MSG EXBKPT = "too many breakpoints"; MSG BADWAIT = "wait error: process disappeared!"; MSG ENDPCS = "process terminated"; MSG NOFORK = "try again"; MSG SZBKPT = "bkpt: command too long"; MSG BADMAG = "bad core magic number"; STRING signals[] = { "", "hangup", "interrupt", "quit", "illegal instruction", "trace/BPT", "IOT", "EMT", "floating exception", "killed", "bus error", "memory fault", "bad system call", "broken pipe", "alarm call", "terminated", "signal 16", "stop (signal)", "stop (tty)", "continue (signal)", "child termination", "stop (tty input)", "stop (tty output)", "input available (signal)", "cpu timelimit", "file sizelimit", "signal 26", "signal 27", "signal 28", "signal 29", "signal 30", "signal 31", }; int nsig = sizeof (signals)/sizeof (signals[0]); instruction", "trace/BPT", "IOT", "EMT", "floating exception", "killed", "bus error", "memory fault", "bad system call", "broken pipe", "alarm call", "terminated", "signal 16", "stop (signal)", "stop (tty)", "continue (signal)", "child termination", "stop (tty input)", "stop (tty output)", "input available (signal)", "cpu timelimit", "file sizelimit", "signal 26", "signal 27", "signal 28cmd/sdb/mode.h 444 0 33 2037 2514002173 6435 /* "@(#)mode.h 4.1 10/9/80" */ #include "machine.h" /* * UNIX debugger */ #define MAXCOM 64 #define MAXARG 32 #define LINSIZ 256 TYPE long ADDR; #ifndef vax TYPE int INT; #else TYPE short INT; #endif TYPE int VOID; TYPE long int L_INT; TYPE float REAL; TYPE double L_REAL; TYPE unsigned POS; TYPE char BOOL; TYPE char CHAR; TYPE char *STRING; TYPE char MSG[]; TYPE struct map MAP; TYPE MAP *MAPPTR; TYPE struct symtab SYMTAB; TYPE SYMTAB *SYMPTR; TYPE struct symslave SYMSLAVE; TYPE struct bkpt BKPT; TYPE BKPT *BKPTR; /* file address maps */ struct map { L_INT b1; L_INT e1; L_INT f1; L_INT b2; L_INT e2; L_INT f2; INT ufd; }; /* slave table for symbols */ struct symslave { SYMV valslave; INT typslave; }; struct bkpt { ADDR loc; ADDR ins; INT count; INT initcnt; INT flag; CHAR comm[MAXCOM]; BKPT *nxtbkpt; }; TYPE struct reglist REGLIST; TYPE REGLIST *REGPTR; struct reglist { STRING rname; INT roffs; }; struct { INT junk[2]; INT fpsr; REAL Sfr[6]; }; struct { INT junk[2]; INT fpsr; L_REAL Lfr[6]; }; address maps */ struct map { L_INT b1; L_INT e1; L_INT f1; L_INT b2; L_INT e2; L_INT f2; INT ufd; }; /* slave table for symbols */ struct symslave { SYMV valslave; INT typslave; }; struct bkpt { ADDR loc; ADDR ins; INT count; INT initcnt; INT flag; CHAR comm[MAXCOM]; BKPT *nxtbkpt; }; TYPE struct reglist REGLIST; TYPE REGLIST *REGPTR; struct reglist { STRING rname; INT roffs; }; struct { INT junk[2]; INT fpsr; REAL Sfr[6]; }; struct { INT junk[2]; cmd/sdb/old.c 444 0 33 3035 2514002174 6262 static char sccsid[] = "@(#)old.c 4.1 10/9/80"; /* * sdb - a symbolic debugger for UNIX. */ /* * This file contains support routines for older versions of the system. */ #ifndef VMUNIX /* * These routines are used only if the system * doesn't have virtual memory. They * are used only to read the symbol table, which * is simply kept in VM on VMUNIX. */ #include #include "bio.h" bread(brs, buff, nbytes) struct brbuf *brs; char *buff; { register int k, nb; if (nbytes > 0) { for (nb=nbytes; nb>0; nb--) { if (brs->nr == 0) { brs->nr = read(brs->fd, brs->next=brs->b, BSIZE); brs->nl = 0; if (brs->nr < 0) return(-1); if (brs->nr == 0) return(nbytes-nb); } *buff++ = *brs->next++; brs->nr--; brs->nl++; } } else { nbytes = -nbytes; for (nb=nbytes; nb>0; nb--) { if (brs->nl == 0) { if ((k=tell(brs->fd)) >= BSIZE + brs->nr) { lseek(brs->fd, (long) -(BSIZE + brs->nr), 1); brs->nl = read(brs->fd, brs->b, BSIZE); } else { lseek(brs->fd, 0L, 0); k = k - brs->nr; if (k < 0) k = 0; brs->nl = read(brs->fd, brs->b, k); } if (brs->nl == 0) return(nbytes-nb); brs->next = brs->b + brs->nl; brs->nr = 0; } *--buff = *--brs->next; brs->nr++; brs->nl--; } } return(nbytes); } blseek(brs, offset, flag) struct brbuf *brs; long offset; { brs->nl = 0; brs->nr = 0; return(lseek(brs->fd,offset,flag)); } binit(brs) struct brbuf *brs; { brs->nl = brs->nr = 0; } long tell(fildes) { return(lseek(fildes, 0L, 1)); } #endif brs->nr; if (k < 0) k = 0; brs->nl = read(brs->fd, brs->b, k); } if (brs->nl == 0) return(nbytes-nb); brs->next = brs->b + brs->nl; brs->nr = 0; } *--buff = *--brs->next; brs->nr++; brs->nl--; } } return(nbytes); } blseek(brs, offset, flag) struct brbuf *brs; long offset; { brs->nl = 0; brs->nr = 0; return(lseek(brs->fd,offset,flag)); } binit(brs) struct brbuf *brs; { brs->nl = brs->nr = 0; } long tell(fildes) { return(lsecmd/sdb/old.h 444 0 33 206 2514002174 6244 /* "@(#)old.h 4.1 10/9/80" */ #ifndef VMUNIX struct brbuf { int nl, nr; char *next; char b[1024]; int fd; }; long lseek(); #endif urn(nbytes-nb); brs->next = brs->b + brs->nl; brs->nr = 0; } *--buff = *--brs->next; brs->nr++; brs->nl--; } } return(nbytes); } blseek(brs, offset, flag) struct brbuf *brs; long offset; { brs->nl = 0; brs->nr = 0; return(lseek(brs->fd,offset,flag)); }/,5X< /,"((cmd/sdb/opset.c 444 0 33 11217 2514002175 6660 static char sccsid[] = "@(#)opset.c 4.1 10/9/80"; # /* * * UNIX debugger * * Instruction printing routines. * MACHINE DEPENDENT. */ #include "head.h" SCCSID(@(#)opset.c 2.4); STRING errflg; L_INT dot; INT dotinc; L_INT vvar[36]; /* instruction printing */ /* * Argument access types */ #define ACCA (8<<3) /* address only */ #define ACCR (1<<3) /* read */ #define ACCW (2<<3) /* write */ #define ACCM (3<<3) /* modify */ #define ACCB (4<<3) /* branch displacement */ #define ACCI (5<<3) /* XFC code */ /* * Argument data types */ #define TYPB 0 /* byte */ #define TYPW 1 /* word */ #define TYPL 2 /* long */ #define TYPQ 3 /* quad */ #define TYPF 4 /* floating */ #define TYPD 5 /* double floating */ TYPE struct optab *OPTAB; struct optab { char *iname; char val; char nargs; char argtype[6]; } optab[]; #define SYSTAB struct systab SYSTAB { int argc; char *sname; } systab[]; STRING regname[]; STRING fltimm[]; POS type, space, incp; int ioptab[256]; /* index by opcode to optab */ mkioptab() {/* set up ioptab */ REG OPTAB p=optab; while (p->iname) {ioptab[p->val&LOBYTE]=p-optab; p++;} } extern char *fmtr; extern char *fmtR; printins(fmt,idsp,ins) char fmt; #ifndef vax REG INT ins; #else REG L_INT ins; #endif { short i,b,mode; char **r; long d; char *fmat; struct proct *procp; REG char * ap; REG OPTAB ip; #ifndef vax struct {char b_2,b_3,b_0,b_1;}; #else struct {char b_0,b_1,b_2,b_3;}; #endif procp = adrtoprocp(dot); if (procp->paddr == dot) { printf("0x%04.4x", ins & 0xffff); oincr = 2; return; } type=DSYM; space=idsp; ins &= LOBYTE; ip=optab+ioptab[ins]; printf("%s\t",ip->iname); incp=1; ap=ip->argtype; for (i=0; inargs; i++,ap++) { vvar[i]=0x80000000; if (i!=0) printc(','); top: if (*ap&ACCB) b= 0xAF + ((*ap&7)<<5); /* branch displacement */ else {b=bchkget(inkdot(incp),idsp); ++incp;} if (b&0300) {/* not short literal */ char *slnptr; int regno; regno = b & 0xF; if (fmt=='i' && regno >= 6 && regno <= 11 && adrtoregvar(regno, procp) != -1) { slnptr = sl_name; r = &slnptr; } else r= ®name[regno]; mode= b >>= 4; mid: switch ((int)mode) { case 4: /* [r] */ printf("[%s]",*r); goto top; case 5: /* r */ printf("%s",*r); break; case 7: /* -(r) */ printc('-'); base: case 6: /* (r) */ printf("(%s)",*r); break; case 9: /* *(r)+ */ printc('*'); case 8: /* (r)+ */ if (r==(regname+0xF)) {/* PC: immediate or absolute */ printc('$'); if (b==9) goto abs; mode=((*ap&7)<<1)+0xA; goto mid; } printf("(%s)+",*r); break; case 0xB: printc('*'); case 0xA: d=bchkget(inkdot(incp),idsp); ++incp; if (d&0x80) d -= 0x100; fmat=fmtr; disp: vvar[i]=d; if (r==(regname+0xF) && b>=0xA) vvar[i] += dot+incp; if (psymoff(vvar[i],r,fmt) && r!=regname+0xF) goto base; break; case 0xD: printc('*'); case 0xC: d=0; d.b_0 = bchkget(inkdot(incp),idsp); ++incp; d.b_1 = bchkget(inkdot(incp),idsp); ++incp; if (d&0x8000) d -= 0x10000; fmat=fmtr; goto disp; case 0xF: printc('*'); case 0xE: abs: d.b_0 = bchkget(inkdot(incp),idsp); ++incp; d.b_1 = bchkget(inkdot(incp),idsp); ++incp; d.b_2 = bchkget(inkdot(incp),idsp); ++incp; d.b_3 = bchkget(inkdot(incp),idsp); ++incp; fmat=fmtR; goto disp; } } else {/* short literal */ vvar[i]=b; if ((*ap&7)==TYPF || (*ap&7)==TYPD) printf("$%s",fltimm[b]); else printf("$%d",b); } } if (ins==0xCF || ins==0xAF || ins==0x8F) {/* CASEx instr */ for (i=0; i<=vvar[2]; ++i) { printc(EOR); printf(" %d: ",i+vvar[1]); d=get(inkdot(incp+i+i),idsp)&0xFFFF; if (d&0x8000) d -= 0x10000; psymoff(inkdot(incp)+d,type,fmt); } incp += vvar[2]+vvar[2]+2; } oincr=incp; } L_INT inkdot(incr) { L_INT newdot; newdot=dot+incr; return(newdot); } printc(c) char c; { printf("%c", c); } psymoff(v, r, fmt) L_INT v; char fmt, **r; { struct proct *procp; register int diff; if (fmt == 'i') { if (r == regname + 12) { /* parameter */ if ((diff = adrtoparam((ADDR) v, adrtoprocp(dot))) != -1) { printf("%s", sl_name); prdiff(diff); return(0); } } if (r == regname + 13) { /* local */ if ((diff = adrtolocal((ADDR) -v, adrtoprocp(dot)) ) != -1) { printf("%s", sl_name); prdiff(diff); return(0); } } if (v < firstdata) { if ((procp = adrtoprocp((ADDR) v)) != badproc) { prlnoff(procp, v); return(0); } } else { if ((diff = adrtoext((ADDR) v)) != -1) { printf("%s", sl_name); prdiff(diff); return(0); } } } prhex(v); return(1); } prdiff(diff) { if (diff) { printf("+"); prhex(diff); } } f (r == regname + 13) { /* local */ if ((diff = adrtolocal((ADDR) -v, adrtoprocp(dot)) ) != -1) { printf("%s", sl_name); prdiff(diff); return(0); } } if (v < firstdata) { if ((procp = adrtoprocp((ADDR) v)) != badproc) { prlnoff(procp, v); return(0); } } else { if ((diff = adrtoext((ADDR) v)) != -1) { printf("%s", slcmd/sdb/optab.c 444 0 33 5164 2514002176 6620 static char sccsid[] = "@(#)optab.c 4.1 10/9/80"; #include "defs.h" /* * Instruction printing routines. * MACHINE DEPENDENT * */ /* * Argument access types */ #define ACCA (8<<3) /* address only */ #define ACCR (1<<3) /* read */ #define ACCW (2<<3) /* write */ #define ACCM (3<<3) /* modify */ #define ACCB (4<<3) /* branch displacement */ #define ACCI (5<<3) /* XFC code */ /* * Argument data types */ #define TYPB 0 /* byte */ #define TYPW 1 /* word */ #define TYPL 2 /* long */ #define TYPQ 3 /* quad */ #define TYPF 4 /* floating */ #define TYPD 5 /* double floating */ TYPE struct optab *OPTAB; struct optab { char *iname; char val; char nargs; char argtype[6]; } optab[] = { #define OP(a,b,c,d,e,f,g,h,i) {a,b,c,d,e,f,g,h,i} #include "../as/instrs" 0}; #define SYSTAB struct systab SYSTAB { int argc; char *sname; } systab[] = { 1, "indir", 0, "exit", 0, "fork", 2, "read", 2, "write", 2, "open", 0, "close", 0, "wait", 2, "creat", 2, "link", 1, "unlink", 2, "exec", 1, "chdir", 0, "time", 3, "mknod", 2, "chmod", 2, "chown", 1, "break", 2, "stat", 2, "seek", 0, "getpid", 3, "mount", 1, "umount", 0, "setuid", 0, "getuid", 0, "stime", 3, "ptrace", 0, "alarm", 1, "fstat", 0, "pause", 1, "30", 1, "stty", 1, "gtty", 0, "access", 0, "nice", 0, "sleep", 0, "sync", 1, "kill", 0, "csw", 0, "setpgrp", 0, "tell", 0, "dup", 0, "pipe", 1, "times", 4, "profil", 0, "tiu", 0, "setgid", 0, "getgid", 2, "signal", 0, "49", 0, "50", 0, "51", 0, "52", 0, "53", 0, "54", 0, "55", 0, "56", 0, "57", 0, "58", 0, "59", 0, "60", 0, "61", 0, "62", 0, "63", }; STRING regname[] = { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10","r11","ap", "fp", "sp", "pc"}; STRING fltimm[] = { "0.5", "0.5625", "0.625", "0.6875", "0.75", "0.8125", "0.875", "0.9375", "1.0", "1.125", "1.25", "1.375", "1.5", "1.625", "1.75", "1.875", "2.0", "2.25", "2.5", "2.75", "3.0", "3.25", "3.5", "3.75", "4.0", "4.5", "5.0", "5.5", "6.0", "6.5", "7.0", "7.5", "8.0", "9.0", "10.0", "11.0", "12.0", "13.0", "14.0", "15.0", "16.0", "18.0", "20.0", "22.0", "24.0", "26.0", "28.0", "30.0", "32.0", "36.0", "40.0", "44.0", "48.0", "52.0", "56.0", "60.0", "64.0", "72.0", "80.0", "88.0", "96.0", "104.0", "112.0", "120.0" }; char *fmtr = {"%r"}; char *fmtR = {"%R"}; REGLIST reglist [] = { "p1lr", P1LR, "p1br",P1BR, "p0lr", P0LR, "p0br",P0BR, "ksp",KSP, "esp",ESP, "ssp",SSP, "psl", PSL, "pc", PC, "usp",USP, "fp", FP, "ap", AP, "r11", R11, "r10", R10, "r9", R9, "r8", R8, "r7", R7, "r6", R6, "r5", R5, "r4", R4, "r3", R3, "r2", R2, "r1", R1, "r0", R0, }; 0", "36.0", "40.0", "44.0", "48.0", "52.0", "56.0", "60.0", "64.0", "72.0", "80.0", "88.0", "96.0", "104.0", "112.0", "120.0" }; char *fmtr = {"%r"}; char *fmtR = {"%R"}; REGLIST reglist [] = { "p1lr", P1LR, "p1br",P1BR, "p0lr", P0LR, "p0br",P0BR, "ksp",KSP, "esp",ESP, "ssp",SSP, "psl", PSL, "pc", PC, "usp",USP, "fp", FP, "ap", AP, "r11", R11, "r10", R10, "r9", cmd/sdb/pcs.c 444 0 33 3502 2514002176 6272 static char sccsid[] = "@(#)pcs.c 4.1 10/9/80"; # /* * * UNIX debugger * */ #include "defs.h" MSG NOBKPT; MSG SZBKPT; MSG EXBKPT; MSG NOPCS; MSG BADMOD; /* breakpoints */ BKPTR bkpthead; CHAR lastc; struct user u; INT signo; L_INT dot; INT pid; L_INT cntval; L_INT loopcnt; /* sub process control */ subpcs(modif) { REG INT check; INT execsig,runmode; REG BKPTR bkptr; STRING comptr; execsig=0; loopcnt=cntval; switch (modif) { /* delete breakpoint */ case 'd': cas((e 'D': IF (bkptr=scanbkpt(dot)) THEN bkptr->flag=0; return; ELSE error(NOBKPT); FI /* set breakpoint */ case 'b': case 'B': IF (bkptr=scanbkpt(dot)) THEN bkptr->flag=0; FI FOR bkptr=bkpthead; bkptr; bkptr=bkptr->nxtbkpt DO IF bkptr->flag == 0 THEN break; FI OD IF bkptr==0 THEN IF (bkptr=(BKPTR) sbrk(sizeof *bkptr)) == (BKPTR) -1 THEN error(SZBKPT); ELSE bkptr->nxtbkpt=bkpthead; bkpthead=bkptr; FI FI bkptr->loc = dot; bkptr->initcnt = bkptr->count = cntval; bkptr->flag = BKPTSET; check=MAXCOM-1; comptr=bkptr->comm; /* rdc(); */ REP *comptr++ = readchar(); PER check-- ANDF lastc!=EOR DONE *comptr=0; IF check THEN return; ELSE error(EXBKPT); FI /* exit */ case 'k' :case 'K': IF pid THEN printf("%d: killed", pid); endpcs(); return; FI error(NOPCS); /* run program */ case 'r': case 'R': endpcs(); setup(); runmode=CONTIN; break; /* single step */ case 's': case 'S': IF pid THEN runmode=SINGLE; execsig=getsig(signo); ELSE setup(); loopcnt--; FI break; /* continue with optional signal */ case 'c': case 'C': case 0: IF pid==0 THEN error(NOPCS); FI runmode=CONTIN; execsig=getsig(signo); break; default: error(BADMOD); } runpcs(runmode,execsig); delbp(); } cs(); return; FI error(NOPCS); /* run program */ case 'r': case 'R': endpcs(); setup(); runmode=CONTIN; break; /* single step */ case 's': case 'S': IF pid cmd/sdb/prvar.c 444 0 33 25323 2552446721 6676 static char sccsid[] = "@(#)prvar.c 4.2 6/22/81"; #include "head.h" #include #include #include "cdefs.h" struct user u; BKPTR bkpthead; STRING errflg; /* * outvar(): * Prints named variable, recursing once for each structure member or * subscript. * proc:var: variable name * fmt: print format * metaflag: set iff var contains metacharacters * or ? * addr: partial address of variable, initally 0 * class: type class of variable * subflag: number of levels of subscript indirection * prnamep: pointer to end of partially formed print name of variable * comblk: name of common block containing variable, if any * prvar: as in findvar * * Here and elsewhere we assume that -1 is an invalid address, and * its is used to indicate error. */ outvar(proc, var, fmt, metaflag, addr, class, subflag, prnamep, comblk, prvar) ADDR addr; char *proc, *var, *fmt, *prnamep, *comblk; int class; { char *p, *q, *r, *oldpr; register int match; long soffset, goffset; register ADDR newaddr = -1, arrowaddr; register enum {INIT, ARROW, DOT} typeflag; switch (var[0]) { case '\0': if (prvar == 0) return(addr); if (metaflag) { if (comblk[0] && !(eqstr(comblk, "*"))) #ifndef FLEXNAMES printf("%.8s:%.8s", comblk, prname); #else printf("%s:%s", comblk, prname); #endif else if (proc[0]) #ifndef FLEXNAMES printf("%.8s:%.8s", proc, prname); #else printf("%s:%s", proc, prname); #endif else printf("%s", prname); } printit(metaflag, prvar, addr, fmt, class, sl_type, sl_size, subflag, DSP); return(addr); case '[': *prnamep++ = *var++; p = var; for (;;) { *prnamep++ = *var; if (*var == '\0' || *var == ']') break; var++; } newaddr = getindir(class, addr, sl_type); newaddr += typetosize(sl_type, sl_size) * readint(&p); return(outvar(proc, var+1, fmt, metaflag, newaddr, N_GSYM, subflag+1, prnamep, comblk, prvar)); case '-': case '>': typeflag = ARROW; while (eqany(*var, "->")) *prnamep++ = *var++; subflag++; arrowaddr = getindir(class, addr, sl_type); if (errflg) { printf("%s\n", errflg); errflg = 0; return(0); } class = N_GSYM; if (var[0] == '\0') { p = var; newaddr = arrowaddr; goto recurse; } break; case '.': typeflag = DOT; if (class == N_RSYM) { error("Not with a register variable"); return(0); } *prnamep++ = *var++; subflag = 0; break; default: typeflag = INIT; break; } if (typeflag == INIT) { soffset = proc[0] ? adrtostoffset(callpc-1) : -1; goffset = proc[0] ? -1 : findfile(curfile)->stf_offset; } else { soffset = proc[0] ? adrtostoffset(callpc-1) : -1; goffset = findfile(curfile)->stf_offset; } p = var; oldpr = prnamep; while (!eqany(*p, "->.[") && *p != '\0') *prnamep++ = *p++; *prnamep = '\0'; match = 0; slookinit(); for (;;) { if (soffset != -1) if ((soffset = slooknext(var, soffset, typeflag!=INIT, comblk)) != -1) goto found; if (goffset != -1) if ((goffset = globallookup(var, goffset, typeflag!=INIT)) != -1) goto found; return(newaddr); found: r = sl_name; q = oldpr; while (*r) *q++ = *r++; *q ='\0'; switch(typeflag) { case INIT: class = sl_class & STABMASK; if (!varclass(class) || class == N_SSYM) goto l; newaddr = (class == N_LSYM) ? -sl_addr : sl_addr; newaddr = formaddr(class, newaddr); break; case ARROW: class = sl_class & STABMASK; if (!varclass(class) || class != N_SSYM) goto l; newaddr = arrowaddr + sl_addr; break; case DOT: class = sl_class & STABMASK; if (!varclass(class) || class != N_SSYM) goto l; newaddr = addr + sl_addr; break; } recurse: newaddr = outvar(proc, p, fmt, metaflag, newaddr, class, subflag, prnamep, comblk, prvar); if (!metaflag) return(newaddr); l:; } } /* Output external variables. Arguments as in outvar() */ extoutvar(var, fmt, metaflag, prvar) char *var, *fmt; { long offset; ADDR addr = -1; offset = extstart; sl_addr = -1; for (;;) { offset = extlookup(var, offset); addr = sl_addr; if (offset == -1) return(addr); if (metaflag) #ifndef FLEXNAMES printf("%.7s", sl_name); #else printf("%s", sl_name); #endif printit(metaflag, prvar, addr, fmt[0] ? fmt : "d", N_GSYM, 0, 0, 0, DSP); if (!metaflag) return(addr); } } prdebug() { register struct proct *procp; register struct filet *filep; printf("dot=%d\n", dot); printf("extstart = %d\n", extstart); printf("firstdata = %d\n", firstdata); for(filep=files;filep->sfilename[0];filep++) printf("%s offs %d @ %d flag %d addr 0x%x\n", filep->sfilename, filep->stf_offset, filep, filep->lineflag, filep->faddr); for(procp=procs;procp->pname[0];procp++) { #ifndef FLEXNAMES printf("%s addr 0x%x; offs %d; sfptr %d; line %d", #else printf("%8.8s addr 0x%x; offs %d; sfptr %d; line %d", #endif procp->pname, procp->paddr, procp->st_offset, procp->sfptr, procp->lineno); if (procp->entrypt) printf(" entrypoint"); printf("\n"); } } /* * display addr in data space using format desc or class s * type == 1 => use addr for value to print */ dispf(addr, desc, class, type, size, subflag, space) char *desc; short type; ADDR addr; { dispx(addr, desc, class, type, size, subflag, DSP); printf("\n"); } /* display addr in instruction space using format desc or class s */ /* returns -1 if bad address */ dispi(addr, desc, class, type, size, subflag, space) char *desc; short type; ADDR addr; { register i; i = dispx(addr, desc, class, type, size, subflag, ISP); printf("\n"); return(i); } char pd[3]; dispx(addr, desc, class, type, size, subflag, space) char *desc; short type; ADDR addr; { int i, sflag; char *p; char dlen, dfmt; long value; union { char c[WORDSIZE]; int w; float f; } word; union { struct{ int w1, w2; } ww; double d; } dbl; class &= STABMASK; if (desc[0] == '\0') desc = typetodesc(type, subflag); cpstr(odesc, desc); otype = type; oclass = class; oaddr = addr; oincr = 0; if (debug) printf("dispx(addr=%d,desc=%s,class=%d,type=%d,size=%d,subflg=%d,space=%d)\n", addr, desc, class, type, size, subflag, space); pd[0] = '%'; pd[1] = dfmt = 'd'; dlen = '\0'; for (p = desc; *p; p++) { if (*p>= '0' && *p<'9') { size = readint(&p); p--; } else switch (*p) { case 'l': case 'h': case 'b': dlen = *p; break; case 'a': case 'c': case 'd': case 'f': case 'g': case 'i': case 'I': case 'o': case 'p': case 's': case 'u': case 'x': pd[1] = dfmt = *p; break; default: printf("Illegal descriptor: %c\n", *p); return(1); } } if (type == -1) value = addr; else if (class == N_RSYM && addr < 16) { /* MACHINE DEPENDENT */ if ((addr > 0 && addr < 6) || addr > 11) { printf("Bad register var %d\n", addr); return(-1); } value = *(ADDR *)(((ADDR) &u) + R0 + (WORDSIZE)*addr); } else { value = getval(addr, dfmt == 'g' ? 'd' : dfmt, space); } if (errflg) { printf("%s", errflg); errflg = 0; return(-1); } switch (dfmt) { default: switch (dfmt) { case 'u': case 'x': case 'o': switch (dlen) { case 'h': value = (unsigned short) value; oincr = 2; break; case 'b': value = (unsigned char) value; oincr = 1; break; case 'l': value = (unsigned long) value; oincr = 4; break; default: oincr = WORDSIZE; break; } break; default: switch (dlen) { case 'h': value = (short) value; oincr = 2; break; case 'b': value = (char) value; oincr = 1; break; case 'l': value = (long) value; oincr = 4; break; default: oincr = WORDSIZE; break; } } if (dfmt == 'x' && (value > 9 || value < 0)) printf("0x"); else if (dfmt == 'o' && (value > 7 || value < 0)) printf("0"); printf(pd, value); return(1); case 'f': pd[1] = 'g'; word.w = value; printf(pd, word.f); return(1); case 'g': dbl.ww.w1 = value; dbl.ww.w2 = (class == (char) N_RSYM) ? *(ADDR *)(((ADDR) &u)+R0+(WORDSIZE)*(addr+1)) : getval(addr+WORDSIZE, 'd', space); printf("%.13g", dbl.d); return(1);(( case 'p': printf("%s:%d", adrtoprocp(value)->pname, adrtolineno(value)); return(1); case 's': addr = getindir(class, addr, type); goto aa; case 'c': if (size <= 1) { oincr = 1; printchar(value); return(1); } else goto aa; case 'a': aa: sflag = size == 0; if (sflag) size = 128; /* maximum length for s and a */ else oincr = size; for (;;) { word.w = getval(addr, 'd', space); for (i=0; iufd; printf("%s\t`%s'\n",s,(file<0 ? "-" : (file==fcor ? corfil : symfil))); printf("b1 = 0x%-16x",amap->b1); printf("e1 = 0x%-16x",amap->e1); printf("f1 = 0x%-x",amap->f1); printf("\nb2 = 0x%-16x",amap->b2); printf("e2 = 0x%-16x",amap->e2); printf("f2 = 0x%-x",amap->f2); printf("\n"); } #define NUMREGS 24 /* number of hardware registers */ REGLIST reglist[]; printregs() { REG REGPTR p; for (p=reglist; p < ®list[NUMREGS/2]; p++) { printf("%4.4s/ ", p->rname); prhex12(*(ADDR *)(((ADDR)&u)+p->roffs)); printf(" %4.4s/ ",(p+NUMREGS/2)->rname); prhex(*(ADDR *)(((ADDR)&u)+(p+NUMREGS/2)->roffs)); printf("\n"); } printpc(); } printpc() { dot= *(ADDR *)(((ADDR)&u)+PC); prisploc(); printins('i',ISP,chkget(dot,ISP)); printf("\n"); } /* print register */ REGLIST reglist[]; regout(name, prvar, fmt) char *name, *fmt; { REG REGPTR p; for (p=reglist; p< ®list[24]; p++) { if (eqstr(name, p->rname)) { printit(0, prvar, *(ADDR *)(((ADDR)&u)+p->roffs), fmt[0] ? fmt : "d", N_GSYM, -1, 0, 0, DSP); return(p->roffs); } } error("Unknown register variable"); return(-1); } /* Print symbolic location of dot */ prisploc() { struct proct *procp; int lineno; printf("0x%x", dot); procp = adrtoprocp(dot); if (procp != badproc) { printf(" ("); prlnoff(procp, dot); printf("): \t"); } else printf(": \t"); } G REGPTR p; for (p=reglist; p< ®list[24]; p++) { if (eqstr(name, p->rname)) { printit(0, prvar, *(ADDR *)(((ADDR)&u)+p->roffs), fmt[0] ? fmt : "d", N_GSYM, -1, 0, 0, DSP); return(p->roffs); } } error("Unknown register variable"); return(-1); } /* Print symbolic location of dot */cmd/sdb/rdwr.c 444 0 33 15327 2514002202 6501 static char sccsid[] = "@(#)rdwr.c 4.1 10/9/80"; /* * sdb - a symbolic debugger for unix - source file access routines. */ #include "head.h" #include /* * These procedures manage the source files examined by sdb, * providing access to lines by number and utilities for printing * and scrolling. One file is kept open by these routines, and * line index tables are maintained for all files which have been * ``current'' at any time so far. This makes line access trivial, * since the location of each line in the files is known, * although we get ``burned'' if the file is changed. * SHOULD WATCH THE MODTIME OF FILES AND REINDEX IF IT CHANGES. */ /* * Structure for files which have been ``indexed''. * Contains a pointer to the file name, a pointer to an * array of seek pointers for the lines in the file, * and a next link in a chain of these for all files we have indexed, * The currently open file is cinfo->; the chain of active files is finfo. */ struct finfo { char *name; /* name of this file w/o common pfx */ off_t *lines; /* array of seek pointers */ /* line i stretches from lines[i-1] to lines[i] - 1, if first line is 1 */ int nlines; /* number of lines in file */ /* lines array actually has nlines+1 elements, so last line is bracketed */ struct finfo *next; /* link in chain of known files */ } *finfo, *cfile; FILE *FIO; /* current open file (only 1 now) */ char fibuf[BUFSIZ]; /* * We use stdio when first reading the file, but thereafter * use our own routines, because we want to be able * to read backwards efficiently and avoid a tell() system * call on each line. Fseekpt remebers where we are in the current * file. */ off_t fseekpt; /* * Make ``name'' the current source file, if it isn't already. * If we have never seen this file before, then we create a finfo * structure for it indexing the lines (this requires reading the * entire file and building an index, but is well worth it since * we otherwise have to brute force search the files all the time.) */ finit(name) char *name; { char buf[BUFSIZ]; register off_t *lp; if (cfile && !strcmp(cfile->name, name)) return; /* its already current, do nothing */ /* IT WOULD BE BETTER TO HAVE A COUPLE OF FILE DESCRIPTORS, LRU */ if (FIO) { fclose(FIO); FIO = NULL; } /* * Paste the given name onto the common prefix (directory path) * to form the full name of the file to be opened. */ strcpy(fp, name); if ((FIO = fopen(filework, "r")) == NULL) { nolines = 1; perror(filework); return; } setbuf(FIO, fibuf); fseekpt = -BUFSIZ; /* putatively illegal */ strcpy(curfile, name); /* * See if we have alread indexed this file. * If so, nothing much to do. */ for (cfile = finfo; cfile; cfile = cfile->next) if (!strcmp(cfile->name, name)) return; /* * Create a structure for this (new) file. * Lines array grows 100 lines at a time. * 1 extra so last line is bracketed. */ cfile = (struct finfo *)sbrk(sizeof (struct finfo)); lp = cfile->lines = (off_t *)sbrk(101 * sizeof (off_t)); *lp++ = 0; /* line 1 starts at 0 ... */ cfile->nlines = 0; /* IT WOULD PROBABLY BE FASTER TO JUST USE GETC AND LOOK FOR \n */ while (fgets(buf, sizeof buf, FIO)) { if ((++cfile->nlines % 100) == 0) sbrk(100 * sizeof (off_t)); /* * Mark end of the cfile->nlines'th line */ lp[0] = lp[-1] + strlen(buf); lp++; } if (cfile->nlines == 0) { printf("%s: no lines in file\n", filework); cfile = 0; return; } /* * Allocate space for the name, making sure to leave the * break on a word boundary. * IT WOULD BE MUCH BETTER TO USE MALLOC AND REALLOC IN SDB. */ sbrk(lp + ((strlen(name)+sizeof(off_t)-1)&~(sizeof(off_t)-1))); strcpy(cfile->name = (char *)lp, name); cfile->next = finfo; finfo = cfile; } /* * Get the current line (fline) into fbuf */ fgetline() { register off_t *op = &cfile->lines[fline-1]; int o, n; n = op[1] - op[0]; fbuf[n] = 0; /* * Case 1. Line begins in current buffer. * * Compute the number of characters into the buffer where * the line starts. If this offset plus its length is greater * than BUFSIZ, then this line splits across a buffer boundary * so take the rest of this buffer and the first part of the next. * Otherwise just take a chunk of this buffer. */ if (*op >= fseekpt && *op < fseekpt + BUFSIZ) { case1: o = op[0] - fseekpt; if (o + n > BUFSIZ) { strncpy(fbuf, fibuf+o, BUFSIZ-o); fseekpt += BUFSIZ; read(fileno(FIO), fibuf, BUFSIZ); strncpy(fbuf+BUFSIZ-o, fibuf, n-(BUFSIZ-o)); } else strncpy(fbuf, fibuf+o, n); return; } /* * Case 2. Line ends in current buffer. * * If the line ends in this buffer (but doesn't begin in * it or else we would have had case 1) take the beginning * part of the buffer (end of the line) and then back up and * get the rest of the line from the end of the previous block. */ if (op[1]-1 >= fseekpt && op[1] <= fseekpt+BUFSIZ) { o = op[1] - fseekpt; strncpy(fbuf+n-o, fibuf, o); fseekpt -= BUFSIZ; lseek(fileno(FIO), fseekpt, 0); read(fileno(FIO), fibuf, BUFSIZ); strncpy(fbuf, fibuf+op[0]-fseekpt, n-o); return; } /* * Case 3. Line not in current buffer at all. * * Read in the buffer where the line starts and then go * back and handle as case 1. */ fseekpt = (op[0] / BUFSIZ) * BUFSIZ; lseek(fileno(FIO), fseekpt, 0); read(fileno(FIO), fibuf, BUFSIZ); goto case1; } /* * Advance current line, end-around (like for / search). */ fnext() { if (cfile == 0) return; if (fline == cfile->nlines) { fline = 1; } else fline++; fgetline(); } /* * Retreat the current line, end around. */ fprev() { if (cfile == 0) return; if (fline == 1) fline = cfile->nlines; else fline--; fgetline(); } /* * Print the current line. */ fprint() { register char *p; if (cfile == 0) { error("No lines in file"); return; } printf("%d: %s", fline, fbuf); } /* * Make line `num' current. */ ffind(num) register int num; { if (cfile == 0) return; if (num > cfile->nlines) error("Not that many lines in file"); else if (num <= 0) error("Zero or negative line?"); else { fline = num; fgetline(); } } /* * Go back n lines. */ fback(n) { int i; if (cfile == 0) return (0); if (n > fline - 1) n = fline - 1; fline -= n; fgetline(); return (n); } /* * Go forwards n lines. */ fforward(n) int n; { register int fnext; if (cfile == 0) return(0); if (fline + n > cfile->nlines) n = cfile->nlines - fline; fline += n; fgetline(); return (n); } /* * Print (upto) n lines, returning number printed. */ fprintn(n) i((nt n; { register int i; if (cfile == 0) { error("No lines in file"); return (0); } for (i = 1; i <= n; i++) { fprint(); if (fline == cfile->nlines || i == n) return(i); fnext(); } return (n); } return (n); } /* * Go forwards n lines. */ fforward(n) int n; { register int fnext; if (cfile == 0) return(0); if (fline + n > cfile->nlines) n = cfile->nlines - fline; fline += n; fgetline(); return (n); } /* * Print (upto) n lines, returning number printed. */ fprintn(n) icmd/sdb/re.c 444 0 33 11150 2514002203 6120 static char sccsid[] = "@(#)re.c 4.1 10/9/80"; #include "head.h" #define CBRA 1 #define CCHR 2 #define CDOT 4 #define CCL 6 #define NCCL 8 #define CDOL 10 #define CEOF 11 #define CKET 12 #define CBACK 18 #define CSTAR 01 #define LBSIZE 512 #define ESIZE 256 #define NBRA 9 char expbuf[ESIZE]; int circf; char *braslist[NBRA]; char *braelist[NBRA]; char bittab[] = { 1, 2, 4, 8, 16, 32, 64, 128 }; dore() { register int line; register char *p; circf = 0; line = fline; compile(re); do { if (redir) fnext(); else fprev(); p = fbuf; while(*p++ != '\n') ; *--p = '\0'; if (match(fbuf)) goto l1; } while (fline != line); error("No match"); l1: *p = '\n'; fprint(); } compile(astr) char *astr; { register c; register char *ep, *sp; char *cstart; char *lastep; int cclcnt; char bracket[NBRA], *bracketp; int closed; char numbra; char neg; ep = expbuf; sp = astr; lastep = 0; bracketp = bracket; closed = numbra = 0; if (*sp == '^') { circf++; sp++; } for (;;) { if (ep >= &expbuf[ESIZE]) goto cerror; if ((c = *sp++) != '*') lastep = ep; switch (c) { case '\0': *ep++ = CEOF; return; case '.': *ep++ = CDOT; continue; case '*': if (lastep==0 || *lastep==CBRA || *lastep==CKET) goto defchar; *lastep |= CSTAR; continue; case '$': if (*sp != '\0') goto defchar; *ep++ = CDOL; continue; case '[': if(&ep[17] >= &expbuf[ESIZE]) goto cerror; *ep++ = CCL; neg = 0; if((c = *sp++) == '^') { neg = 1; c = *sp++; } cstart = sp; do { if (c=='\0') goto cerror; if (c=='-' && sp>cstart && *sp!=']') { for (c = sp[-2]; c<*sp; c++) ep[c>>3] |= bittab[c&07]; sp++; } ep[c>>3] |= bittab[c&07]; } while((c = *sp++) != ']'); if(neg) { for(cclcnt = 0; cclcnt < 16; cclcnt++) ep[cclcnt] ^= -1; ep[0] &= 0376; } ep += 16; continue; case '\\': if((c = *sp++) == '(') { if(numbra >= NBRA) { goto cerror; } *bracketp++ = numbra; *ep++ = CBRA; *ep++ = numbra++; continue; } if(c == ')') { if(bracketp <= bracket) { goto cerror; } *ep++ = CKET; *ep++ = *--bracketp; closed++; continue; } if(c >= '1' && c <= '9') { if((c -= '1') >= closed) goto cerror; *ep++ = CBACK; *ep++ = c; continue; } defchar: default: *ep++ = CCHR; *ep++ = c; } } cerror: errexit("RE error\n", (char *)NULL); } match(p1) register char *p1; { register char *p2; register c; 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: return(0); found: return(1); } 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|CSTAR: 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|CSTAR: curlp = lp; while (*lp++); goto star; case CCHR|CSTAR: curlp = lp; while (*lp++ == *ep); ep++; goto star; case CCL|CSTAR: curlp = lp; do { c = *lp++ & 0177; } while(ep[c>>3] & bittab[c & 07]); ep += 16; goto star; star: if(--lp == curlp) { continue; } if(*ep == CCHR) { c = ep[1]; do { if(*lp != c) continue; if(advance(lp, ep)) return(1); } while(lp-- > curlp); return(0); } do { if (advance(lp, ep)) return(1); } while (lp-- > curlp); return(0); default: errexit("RE botch\n", (char *)NULL); } } ecmp(a, b, count) char *a, *b; { register cc = count; while(cc--) if(*a++ != *b++) return(0); return(1); } errexit(s) char *s; { error(s); return; } star; star: if(--lp == curlp) { continue; } if(*ep == CCHR) { c = ep[1]; do { if(*lp != c) continue; if(advance(lp, ep)) return(1); } while(lp-- > curlp); return(0); } do { if (advance(lp, ep)) return(1); } while (lp-- > curlp); return(0); default: errexit("RE botch\n", (char *)NULL); } } ecmp(a, b, count) char *a, *b; { register cc = count;cmd/sdb/runpcs.c 444 0 33 13661 2514002204 7036 static char sccsid[] = "@(#)runpcs.c 4.1 10/9/80"; # /* * * UNIX debugger * */ #include "head.h" #include #include struct user u; #include #ifndef SIGTRAP #define SIGTRAP SIGTRC #endif MSG NOFORK; MSG ENDPCS; MSG BADWAIT; ADDR sigint; ADDR sigqit; ADDR userpc; /* breakpoints */ BKPTR bkpthead; CHAR lastc; INT fcor; INT fsym; STRING errflg; int errno; INT signo; L_INT dot; STRING symfil; INT wtflag; INT pid; INT adrflg; L_INT loopcnt; getsig(sig) { return(sig); } runpcs(runmode,execsig) { REG BKPTR bkpt; IF adrflg THEN userpc=dot; FI WHILE --loopcnt>=0 DO if (debug) printf("\ncontinue %x %d\n",userpc,execsig); IF runmode==SINGLE THEN delbp(); /* hardware handles single-stepping */ ELSE /* continuing from a breakpoint is hard */ IF bkpt=scanbkpt(userpc) THEN execbkpt(bkpt,execsig); execsig=0; FI setbp(); FI ptrace(runmode,pid,userpc,execsig); bpwait(); chkerr(); execsig=0; delbp(); readregs(); loop1: IF (signo==0) ANDF (bkpt=scanbkpt(userpc)) THEN /* stopped by BPT instruction */ if (debug) printf("\n BPT code; '%s'%o'%o'%d", bkpt->comm,bkpt->comm[0],EOR,bkpt->flag); dot=bkpt->loc; IF bkpt->comm[0] != EOR THEN acommand(bkpt->comm); FI IF bkpt->flag==BKPTEXEC ORF ((bkpt->flag=BKPTEXEC) ANDF bkpt->comm[0]!=EOR) THEN execbkpt(bkpt,execsig); execsig=0; loopcnt++; goto loop1; ELSE bkpt->flag=BKPTSET; bkpt->count=bkpt->initcnt; FI ELSE execsig=signo; if (execsig) break; FI OD if (debug) printf("Returning from runpcs\n"); } #define BPOUT 0 #define BPIN 1 INT bpstate; endpcs() { REG BKPTR bkptr; if (debug) printf("Entering endpcs with pid=%d\n"); IF pid THEN ptrace(EXIT,pid,0,0); pid=0; userpc=1; FOR bkptr=bkpthead; bkptr; bkptr=bkptr->nxtbkpt DO IF bkptr->flag THEN bkptr->flag=BKPTSET; FI OD FI bpstate=BPOUT; } #ifdef VFORK nullsig() { } #endif setup() { close(fsym); fsym = -1; #ifdef VFORK IF (pid = vfork()) == 0 #else IF (pid = fork()) == 0 #endif THEN ptrace(SETTRC,0,0,0); signal(SIGINT,sigint); signal(SIGQUIT,sigqit); #ifdef VFORK signal(SIGTRAP,nullsig); #endif if (debug) printf("About to doexec pid=%d\n",pid); doexec(); _exit(0); ELIF pid == -1 THEN error(NOFORK); ELSE bpwait(); readregs(); if (debug) printf("About to open symfil = %s\n", symfil); fsym=open(symfil,wtflag); IF errflg THEN printf("%s: cannot execute\n",symfil); if (debug) printf("%d %s\n", errflg, errflg); endpcs(); FI FI bpstate=BPOUT; } execbkpt(bkptr,execsig) BKPTR bkptr; { if (debug) printf("exbkpt: %d\n",bkptr->count); delbp(); ptrace(SINGLE,pid,bkptr->loc,execsig); bkptr->flag=BKPTSET; bpwait(); chkerr(); readregs(); } extern STRING environ; doexec() { char *argl[MAXARG], args[LINSIZ]; register char c, redchar, *argsp, **arglp, *filnam; arglp = argl; argsp = args; *arglp++ = symfil; c = ' '; do { while (eqany(c, " \t")) { c = rdc(); } if (eqany(c, "<>")) { redchar = c; do { c = rdc(); } while (eqany(c, " \t")); filnam = argsp; do { *argsp++ = c; c = rdc(); } while (!eqany(c, " <>\t\n")); *argsp++ = '\0'; if (redchar == '<') { close(0); if (open(filnam,0) < 0) { printf("%s: cannot open\n",filnam); fflush(stdout); _exit(0); } } else { close(1); if (creat(filnam,0666) < 0) { printf("%s: cannot create\n",filnam); fflush(stdout); _exit(0); } } } else if (c != '\n') { *arglp((++ = argsp; do { *argsp++ = c; c = rdc(); } while(!eqany(c, " <>\t\n")); *argsp++ = '\0'; } } while (c != '\n'); *arglp = (char *) 0; if (debug) { char **dap; printf("About to exect(%s, %d, %d)\n",symfil,argl,environ); for (dap = argl; *dap; dap++) { printf("%s, ", *dap); } } exect(symfil, argl, environ); perror("Returned from exect"); } BKPTR scanbkpt(adr) ADDR adr; { REG BKPTR bkptr; FOR bkptr=bkpthead; bkptr; bkptr=bkptr->nxtbkpt DO IF bkptr->flag ANDF bkptr->loc==adr THEN break; FI OD return(bkptr); } delbp() { REG ADDR a; REG BKPTR bkptr; IF bpstate!=BPOUT THEN FOR bkptr=bkpthead; bkptr; bkptr=bkptr->nxtbkpt DO IF bkptr->flag THEN a=bkptr->loc; ptrace(WIUSER,pid,a, (bkptr->ins&0xFF)|(ptrace(RIUSER,pid,a,0)&~0xFF)); FI OD bpstate=BPOUT; FI } setbp() { REG ADDR a; REG BKPTR bkptr; IF bpstate!=BPIN THEN FOR bkptr=bkpthead; bkptr; bkptr=bkptr->nxtbkpt DO IF bkptr->flag THEN a = bkptr->loc; bkptr->ins = ptrace(RIUSER, pid, a, 0); ptrace(WIUSER, pid, a, BPT | (bkptr->ins&~0xFF)); IF errno THEN error("cannot set breakpoint: "); printf("%s:%d @ %d\n", adrtoprocp(dot)->pname, adrtolineno(dot), dot); FI FI OD bpstate=BPIN; FI } bpwait() { REG ADDR w; ADDR stat; signal(SIGINT, 1); if (debug) printf("Waiting for pid %d\n",pid); WHILE (w = wait(&stat))!=pid ANDF w != -1 DONE if (debug) printf("Ending wait\n"); if (debug) printf("w = %d; pid = %d; stat = %o;\n", w,pid,stat); signal(SIGINT,sigint); IF w == -1 THEN pid=0; errflg=BADWAIT; ELIF (stat & 0177) != 0177 THEN IF signo = stat&0177 THEN sigprint(); FI IF stat&0200 THEN error(" - core dumped"); close(fcor); setcor(); FI pid=0; errflg=ENDPCS; ELSE signo = stat>>8; if (debug) printf("PC = %d, dbsubn = %d\n", ptrace(RUREGS, pid, PC, 0), extaddr("_dbsubn")); IF signo!=SIGTRAP ANDF ptrace(RUREGS, pid, PC, 0) != extaddr("_dbsubn") THEN sigprint(); ELSE signo=0; FI FI } REGLIST reglist[]; readregs() { /*get REG values from pcs*/ REG i; FOR i=24; --i>=0; DO *(ADDR *)(((ADDR)&u)+reglist[i].roffs) = ptrace(RUREGS, pid, reglist[i].roffs, 0); OD userpc= *(ADDR *)(((ADDR)&u)+PC); } char readchar() { lastc = *argsp++; if (lastc == '\0') lastc = '\n'; return(lastc); } char rdc() { register char c; c = *argsp++; return(c == '\0' ? '\n' : c); } ANDF ptrace(RUREGS, pid, PC, 0) != extaddr("_dbsubn") THEN sigprint();cmd/sdb/setup.c 444 0 33 6036 2517757002 6662 static char sccsid[] = "@(#)setup.c 4.2 4/18/81"; # /* * * UNIX debugger * */ #include "head.h" MSG BADMAG; INT wtflag; INT fcor; INT fsym; L_INT maxfile; L_INT maxstor; L_INT txtsiz; L_INT datsiz; L_INT datbas; L_INT stksiz; STRING errflg; INT magic; L_INT symbas; L_INT symnum; L_INT entrypt; INT argcount; INT signo; struct user u; #define TXTHDRSIZ (sizeof(txthdr)) #ifndef EDDT readl(f,p,n) int f,n; long * p;{ #ifndef vax int t=0; do {t += read(f,&(p->loword),2); t += read(f,&(p->hiword),2); p++;} while (--n); return(t); #else return(read(f,p,n*sizeof(long))); #endif } #endif setsym() { #ifndef EDDT TXTHDR txthdr; fsym=getfile(symfil,1); txtmap.ufd=fsym; IF readl(fsym, txthdr, TXTHDRSIZ/sizeof(txthdr[0]))==TXTHDRSIZ THEN magic=txthdr[0]; IF magic!=0410 ANDF magic!=0407 ANDF magic!=0412 ANDF magic!=0413 THEN magic=0; ELSE symnum=txthdr[4]/SYMTABSIZ; txtsiz=txthdr[1]; datsiz=txthdr[2]; symbas=txtsiz+datsiz; txtmap.f1=txtmap.f2=TXTHDRSIZ; switch (magic) { case 0407: txtmap.b1=0; txtmap.e1=0; txtmap.b2=datbas=0; txtmap.e2=symbas; break; case 0413: txtmap.f1=txtmap.f2=(CLSIZE*NBPG); case 0410: txtmap.b1=0; txtmap.e1=txtsiz; txtmap.b2=datbas=round(txtsiz,TXTRNDSIZ); txtmap.e2=datbas+datsiz; txtmap.f2+=txtmap.e1; } entrypt=txthdr[5]; symbas += txthdr[6]+txthdr[7]; symbas += magic==0412||magic==0413 ? (CLSIZE*NBPG) : TXTHDRSIZ; ststart = symbas; #ifdef FLEXNAMES gstart = ststart+txthdr[4]; #endif /* set up symvec */ FI FI IF magic==0 THEN txtmap.e1=maxfile; FI #endif } setcor() { fcor=getfile(corfil,2); datmap.ufd=fcor; IF read(fcor, &u, ctob(UPAGES))==ctob(UPAGES) #ifndef STD ANDF (u.u_pcb.pcb_ksp & 0xF0000000L)==0x70000000L #else ANDF (u.u_pcb.pcb_ksp & 0xF0000000L)==0x80000000L #endif ANDF (u.u_pcb.pcb_usp & 0xF0000000L)==0x70000000L THEN signo = u.u_arg[0]&017; txtsiz = ctob(u.u_tsize); datsiz = ctob(u.u_dsize); stksiz = ctob(u.u_ssize); datmap.b1 = datbas = (magic==0410?round(txtsiz,TXTRNDSIZ):0); if (magic == 0413) datmap.b1 = datbas = txtsiz; datmap.e1=(magic==0407?txtsiz:datmap.b1)+datsiz; #ifdef STD datmap.f1 = ctob(USIZE); #else datmap.f1 = ctob(UPAGES); #endif datmap.b2 = maxstor-stksiz; datmap.e2 = maxstor; #ifdef STD datmap.f2 = ctob(USIZE)+(magic==0410?datsiz:datmap.e1); #else datmap.f2 = ctob(UPAGES)+((magic==0410 || magic == 0413) ? datsiz : datmap.e1); #endif signo = *(ADDR *)(((ADDR)&u)+ctob(UPAGES)-4*sizeof(int)); IF magic ANDF magic!=u.u_exdata.ux_mag THEN printf("%s\n",BADMAG); FI ELSE datmap.e1 = maxfile; FI } create(f) STRING f; { int fd; IF (fd=creat(f,0644))>=0 THEN close(fd); return(open(f,wtflag)); ELSE return(-1); FI } getfile(filnam,cnt) STRING filnam; { REG INT fsym; IF !eqstr("-",filnam) THEN fsym=open(filnam,wtflag); IF fsym<0 ANDF argcount>cnt THEN IF wtflag THEN fsym=create(filnam); FI IF fsym<0 THEN printf("cannot open `%s'\n", filnam); FI FI ELSE fsym = -1; FI return(fsym); } ic!=u.u_exdata.ux_mag THEN printf("%s\n",BADMAG); FI ELSE datmap.e1 = maxfile; FI } create(f) STRING f; { int fd; IF (fd=creat(f,0644))>=0 THEN close(fd); return(open(f,wtflag)); ELSE return(-1); FI } getfile(filnam,cnt) STRING filnam; { REG INT fsym; IF !eqstr("-",filnam) THEN fsym=open(filnam,wtflag); IF fsym<0 ANDF argcount>cnt THEN IF wtflag THEN fsym=create(filnam); FI IF fsym<0 THEN printf("cannot open `%s'\n", filnam); FI FI ELSE fscmd/sdb/sub.c 444 0 33 12560 2514002206 6314 static char sccsid[] = "@(#)sub.c 4.1 10/9/80"; #include "head.h" #include #include #include "cdefs.h" #include struct user u; char * readline(f) FILE *f; { static char buff[128]; register char *p; register int i; p = buff; do { if ((i = getc(f)) == EOF) { *p++ = '\004'; *p = '\n'; } else *p = i; } while (*p++ != '\n'); return(buff); } char * cpname(p, q) char *p, *q; { while(varchar(*q) || number(*q)) *p++ = *q++; *p = '\0'; return(q); } char * cpall(p, q) char *p, *q; { while (*q != '\n') *p++ = *q++; *p = '\0'; return(q); } eqany(c, s) char c, *s; { while(*s != '\0') if (c == *s++) return(1); return(0); } error(s) char *s; { printf("%s\n", s); } char * cpstr(p,q) char *p, *q; { do { *p++ = *q++; } while (*q != '\0'); *p = '\0'; } L_INT round(a,b) REG L_INT a, b; { REG L_INT w; w = (a/b)*b; IF a!=w THEN w += b; FI return(w); } /* error handling */ chkerr() { IF errflg ORF mkfault THEN error(errflg); longjmp(env, 0); FI } eqstr(s1, s2) REG STRING s1, s2; { #ifndef FLEXNAMES REG STRING es1; #endif if (s2 == (STRING) -1) return(0); #ifndef FLEXNAMES es1 = s1+8; #endif WHILE *s1++ == *s2 #ifndef FLEXNAMES DO IF *s2++ == 0 ORF s1>=es1 #else DO IF *s2++ == 0 #endif THEN return(1); FI OD return(0); } longseek(f, a) L_INT a; { return(lseek(f,(long) a,0) != -1); } /* descriptor format to length */ dtol(d) char d; { switch(d) { case 'a': case 's': return(0); case 'b': case 'c': return(1); case 'h': return(2); case 'l': case 'f': return(4); case 'g': return(8); default: return(WORDSIZE); } } /* * checks equality of pattern pat with str, * assuming str is tructaed at length 8 */ eqpat(pat, str) char *pat, *str; { #ifndef FLEXNAMES return(eqpatr(pat, str, 0)); #else return(eqpatr(pat, str)); #endif } #ifndef FLEXNAMES eqpatr(pat, str, cnt) #else eqpatr(pat, str) #endif char *pat, *str; { register int i; register char p, s; p = pat[0]; s = str[0]; #ifndef FLEXNAMES if (cnt == 8) return(1); #endif if (p == '?') { if (s == '\0') return(0); #ifndef FLEXNAMES return(eqpatr(pat+1, str+1, cnt+1)); #else return(eqpatr(pat+1, str+1)); #endif } if (p == '*') { if (pat[1] == '\0') return(1); #ifndef FLEXNAMES for(i=1; i<8-cnt; i++) { if (eqpatr(pat+1, str+i, cnt+i)) return(1); #else for(i=1; ; i++) { if (eqpatr(pat+1, str+i)) return(1); #endif if (str[i] == '\0') return(0); } #ifndef FLEXNAMES return(0); #else /*NOTREACHED*/ #endif } if ((eqany(p, ".[->") || p == '\0') && s == '\0') return(1); if (p != s) return(0); #ifndef FLEXNAMES return(eqpatr(pat+1, str+1, cnt+1)); #else return(eqpatr(pat+1, str+1)); #endif } /* gets indirect address for pointers and subscripts */ getindir(class, addr, type) ADDR addr; { if (ISARY(type)) return(addr); if (class == N_RSYM) return(*(ADDR *)(((ADDR) &u) + R0 + (WORDSIZE)*addr)); return(getval(addr, 'd', DSP)); } long readint(p) char **p; { int sign; if (**p == '-') { sign = -1; (*p)++; } els((e { sign = 1; } if (**p == '0') { (*p)++; if (**p == 'x' || **p == 'X') { (*p)++; return(sign * rint(p, 16, hexdigit, hexconv)); } else return(sign * rint(p, 8, octdigit, octconv)); } else return(sign * rint(p, 10, decdigit, decconv)); } long rint(p, base, digit, conv) char **p; int (*digit)(), (*conv)(); { long value; value = 0; while ((*digit)(**p)) value = base*value + (*conv)(*(*p)++); return(value); } octdigit(c) char c; { return(c >= '0' && c <= '7'); } octconv(c) char c; { return(c - '0'); } decdigit(c) char c; { return(c >= '0' && c <= '9'); } decconv(c) char c; { return(c - '0'); } hexdigit(c) char c; { return((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')); } hexconv(c) char c; { if (c >= '0' && c <= '9') return(c - '0'); if (c >= 'a' && c <= 'f') return(c - 'a' + 10); if (c >= 'A' && c <= 'F') return(c - 'A' + 10); error("hex conversion error"); return(0); } /* decodes number, character or variable */ long argvalue(p) char *p; { register char ch; register long value; register ADDR j; char var[30]; ch = *p; if (ch == '\'') { value = *(p+1); } else if ((ch >= '0' && ch <= '9') || ch == '-') { value = readint(&p); } else if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || ch == '_') { cpname(var, p); j = varaddr(curproc()->pname, var); if (j == -1) { printf("Unknown variable: %s\n", argsp); return(-1); } value = getval(j, typetodesc(sl_type, 0)[0], DSP); do { p++; } while (varchar(*p) || number(*p)); } return(value); } prhex(v) long v; { if (v < 0) { v = -v; printf("-"); } if (v <= 9) printf("%d", v); else printf("0x%x", v); } /* print hex number in field of length 12 */ prhex12(v) long v; { if (v >= -9 && v <= 9) printf("%-12d", v); else printf("0x%-12x", v); } /* print line number followed by offset */ prlnoff(procp, v) struct proct *procp; ADDR v; { int lineno, diff; char *name; name = procp->pname; if (name[0] == '_') { #ifndef FLEXNAMES printf("%.7s", name+1); #else printf("%s", name+1); #endif lineno = -1; } else { #ifndef FLEXNAMES printf("%8s", name); #else printf("%s", name); #endif lineno = adrtolineno((ADDR) v); } if (lineno == -1) diff = v - procp->paddr; else { printf(":%d", lineno); diff = v - lnfaddr; /* set by adrtolineno() */ } if (diff) { printf("+"); prhex(diff); } } , v) struct proct *procp; ADDR v; { int lineno, diff; char *name; name = procp->pname; if (name[0] == '_') { #ifndef FLEXNAMES printf("%.7cmd/sdb/symt.c 444 0 33 54464 2552446722 6551 static char sccsid[] = "@(#)symt.c 4.2 7/8/81"; #include "head.h" #include #include #ifndef STABTYPES #define STABTYPES N_STAB #endif #include struct user u; int compar(); char *symfil; #ifdef FLEXNAMES struct nlist *symtab; char nullname[] = {0,0,0,0,0,0,0,0,0}; /* a few 0 bytes */ off_t stoff; stread(buff, nbytes) struct nlist *buff; int nbytes; { register int from = stoff; stoff += nbytes; if (stoff >= gstart) return (-1); if (nbytes < 0) { from = stoff; buff--; } from = (from - ststart); *buff = symtab[from/sizeof (struct nlist)]; return (sizeof (struct nlist)); } stseek(off, rel) long off; { if (rel == 1) stoff += off; else stoff = off; } #define bread(a,b,c) stread(b,c) #define blseek(a,b,c) stseek(b,c) #endif /* initialize file and procedure tables */ initfp() { struct nlist stentry; register struct proct *procp; register struct filet *filep; struct stat stbuf; long soffset; int i, gflag = 0; char class; register char *p, *q; #ifdef FLEXNAMES register struct nlist *sp; int malformed = 0; lseek(txtmap.ufd, gstart, 0); if (read(txtmap.ufd, &ssiz, sizeof(ssiz)) != sizeof (ssiz)) { printf("%s: no string table (old format?)\n", symfil); exit(1); } strtab = (char *)malloc(ssiz); if (strtab == 0) { printf("no room for %d bytes of string table\n", ssiz); exit(1); } ssiz -= sizeof (ssiz); if (read(txtmap.ufd, strtab+sizeof (ssiz), ssiz) != ssiz) { printf("%s: error reading string table\n", symfil); exit(1); } i = gstart - ststart; symtab = (struct nlist *)malloc(i); if (symtab == 0) { printf("no room for %d bytes of symbol table\n", i); exit(1); } lseek(txtmap.ufd, ststart, 0); if (read(txtmap.ufd, symtab, i) != i) { printf("%s: error reading symbol table\n", symfil); exit(1); } for (sp = &symtab[i/sizeof (struct nlist)]; --sp >= symtab; ) if (sp->n_un.n_strx != 0) { if (sp->n_un.n_strx < sizeof (ssiz) || sp->n_un.n_strx >= ssiz) { if (malformed == 0) { printf("danger: mangled symbol table\n"); malformed = 1; } sp->n_un.n_name = nullname; } else sp->n_un.n_name = strtab + sp->n_un.n_strx; } else sp->n_un.n_name = nullname; #endif #ifndef VMUNIX sbuf.fd = txtmap.ufd; #endif firstdata = MAXPOS; soffset = ststart; blseek(&sbuf,ststart,0); filep = files = badfile = (struct filet *) sbrk(sizeof filep[0]); procp = procs = badproc = (struct proct *) sbrk(sizeof procp[0]); for(;;) { if (bread(&sbuf, &stentry, sizeof stentry) < sizeof stentry) break; class = stentry.n_type & STABMASK; switch (class & STABMASK) { case N_SO: case N_SOL: gflag++; if (filep == badfile) { p = sbrk(FILEINCR*sizeof filep[0]); if (p < 0) { perror("sdb"); exit(4); } q = p + FILEINCR*sizeof filep[0]; while (p > (char *) procs) *--q = *--p; badfile += FILEINCR; procp = (struct proct *) ((char *) procp + FILEINCR*sizeof filep[0]); procs = (struct proct *) ((char *) procs + FILEINCR*sizeof filep[0]); badproc = (struct proct *) ((char *)badproc + FILEINCR*sizeof filep[0]); } filep->faddr = stentry.n_value; filep->lineflag = (class == N_SOL); filep->stf_offset = soffset; #ifndef FLEXNAMES p = filep->sfilename; for (;;) { for (i=0; i<8; i++) *p++ = stentry.n_un.n_name[i]; if (*(p-1) == '\0') break; if (bread(&sbuf, &stentry, sizeof stentry) < sizeof stentry) error("Bad N_SO entry (1)"); if ((stentry.n_type & STABMASK) != (unsigned char) class) error("Bad N_SO entry (2)"); soffset += sizeof stentry; } #else filep->sfilename = stentry.n_un.n_name; #endif q = filep->sfilename; for (p=fp; *q; *p++ = *q++) ; *p = 0; if (stat(filework, &stbuf) == -1) printf("Warning: `%s' not found\n", filep->sfilename); else if (stbuf.st_mtime > symtime) printf("Warning: `%s' newer than `%s'\n", filep->sfilename, symfil); filep++; break; case N_TEXT: if (stentry.n_un.n_name[0] != '_') break; case N_FUN: case N_ENTRY: if (procp == badproc) { if (sbrk(PROCINCR*sizeof procp[0]) < 0) { perror("sdb"); exit(4); } badproc += PROCINCR; } #ifndef FLEXNAMES for(i=0; i<8; i++) procp->pname[i] = stentry.n_un.n_name[i]; #else procp->pname = stentry.n_un.n_name; #endif procp->paddr = stentry.n_value; procp->st_offset = soffset; procp->sfptr = (class != N_TEXT) ? filep - 1 : badfile; procp->lineno = (class != N_TEXT) ? stentry.n_desc : 0; procp->entrypt = (class & STABMASK) == N_ENTRY; procp++; break; } if (stentry.n_type & N_EXT) { if (!extstart) extstart = soffset; if (stentry.n_type == N_DATA | N_EXT || stentry.n_type == N_BSS | N_EXT || stentry.n_value < firstdata) firstdata = stentry.n_value; } soffset += sizeof stentry; } qsort(procs, procp-procs, sizeof procs[0], compar); badproc->st_offset = badfile->stf_offset = soffset; badproc->sfptr = procp->sfptr = badfile; #ifndef FLEXNAMES badproc->pname[0] = badfile->sfilename[0]= procp->pname[0] = filep->sfilename[0] = '\0'; #else badproc->pname = badfile->sfilename= procp->pname = filep->sfilename = nullname; #endif if (!gflag) printf("Warning: `%s' not compiled with -g\n", symfil); setcur(1); } /* returns current procedure from state (curfile, fline) */ struct proct * curproc() { register ADDR addr; addr = getaddr("", fline ? fline : 1); if (addr == -1) return(badproc); return(adrtoprocp(addr)); } /* returns procedure s, uses curproc() if s == NULL */ struct proct * findproc(s) char *s; { register struct proct *p, *altproc; if (s[0] == '\0') return(curproc()); altproc = badproc; for (p=procs; p->pname[0]; p++) { if (eqpat(s, p->pname)) return(p); if (p->pname[0] == '_' && eqpatr(s, p->pname+1, 1)) altproc = p; } return(altproc); } /* returns file s containing filename */ struct filet * findfile(s) char *s; { register struct filet *f; if (s == 0 || *s == 0) return(files); /* start at beginning if no cur file */ for (f=files; f->sfilename[0]; f++) { if (eqpat(f->sfilename, s)) { for( ; f->lineflag; f--) ; if (f < files) error("Bad file array"); return(f); } } return(f); } /* * slookup(): * looks up variable matching pat starting at (offset + sizeof stentry) * in a.out, searching backwards, * ignoring nested blocks to beginning to procedure. * Returns its offset and symbol table entries decoded in sl_* * * If comblk == "*" then match both within and outside common blocks, * if comblk == "" then match only outside common blocks, * else match only within comblk. */ long slookup(pat, poffset, stelt) long poffset; char *pat; { slookinit(); slooknext(pat, poffset, stelt, "*"); } int clevel, level, fnameflag, comfound, incomm; slookinit() { clevel = level = fnameflag = comfound = incomm = 0; } long slooknext(pat, poffset, stelt, comblk) long poffset; char *pat, *comblk; { register int i; register long offset; char class, *q; struct nlist stentry; struct proct *procp, *p; offset = poffset + sizeo((f stentry; if (debug) printf("slookup(%s,%d)\n",pat,offset); blseek(&sbuf, offset, 0); for (;;) { offset -= sizeof stentry; if (offset < ststart) break; if (bread(&sbuf, &stentry+1, -sizeof stentry) < sizeof stentry) break; class = stentry.n_type & STABMASK; switch (class & STABMASK) { case 0: break; case N_FUN: return(-1); case N_RBRAC: level++; break; case N_LBRAC: level--; break; case N_ECOMM: i = 0; #ifndef FLEXNAMES for (q = &stentry.n_un.n_name[7]; q>=stentry.n_un.n_name; q--) { if (*q == '_') { *q = '\0'; i++; break; } } #else for (q = stentry.n_un.n_name; *q; q++) continue; if (*--q == '_') *q = 0, i++; #endif if (eqpat(comblk, stentry.n_un.n_name)) comfound = 1; if (i) *q = '_'; incomm = 1; case N_ECOML: clevel++; break; case N_BCOMM: comfound = incomm = 0; clevel--; break; case N_FNAME: if (fnameflag) break; procp = findproc(stentry.n_un.n_name); for (p=procs; p->pname[0]; p++) { if (p->entrypt == 0 && p->st_offset > procp->st_offset && p->st_offset < offset) offset = p->st_offset; } clevel = level = 0; fnameflag++; blseek(&sbuf, offset, 0); break; default: if (level <= 0 && eqpat(pat, stentry.n_un.n_name) && stentry.n_un.n_name[0] && class & STABTYPES && (eqstr("*", comblk) || (comblk[0] == '\0' && incomm == 0) || comfound) && (stelt == (class == N_SSYM))) { if (class == N_LENG) { sl_size = stentry.n_value; offset -= sizeof stentry; bread(&sbuf, &stentry+1, -sizeof stentry); if (stentry.n_type&~N_EXT == N_BSS) { bread(&sbuf, &stentry+1, -sizeof stentry); offset -= sizeof stentry; } } else sl_size = 0; sl_class = stentry.n_type & STABMASK; sl_type = stentry.n_desc; sl_addr = stentry.n_value; #ifndef FLEXNAMES for (i=0; i<8; i++) sl_name[i] = stentry.n_un.n_name[i]; #else sl_name = stentry.n_un.n_name; #endif if (clevel != 0) docomm(offset); return(offset - sizeof stentry); } } } return(-1); } /* * Look up global variable matching pat starting at (filestart+sizeof stentry) * Return its offset and symbol table entries decoded in sl_* */ long globallookup(pat, filestart, stelt) char *pat; long filestart; { register int offset, i; struct nlist stentry; int class, clevel; if (debug) printf("globallookup(%s,%d)\n", pat,filestart); blseek(&sbuf, filestart, 0); offset = filestart - sizeof stentry; clevel = 0; do { if (bread(&sbuf, &stentry, sizeof stentry) < sizeof stentry) return(-1); offset += sizeof stentry; } while ((stentry.n_type & STABMASK) == N_SO); for (;;) { class = stentry.n_type & STABMASK; switch (class & STABMASK) { case N_SO: return(-1); case N_ECOMM: clevel--; break; case N_BCOMM: clevel++; break; default: if (eqpat(pat, stentry.n_un.n_name) && stentry.n_un.n_name[0] && class & STABTYPES) { sl_class = stentry.n_type & STABMASK; if (sl_class != N_GSYM && sl_class != N_SSYM && sl_class != N_STSYM && sl_class != N_LCSYM) goto g1; if (stelt != (sl_class == N_SSYM)) goto g1; sl_size = 0; sl_type = stentry.n_desc; sl_addr = stentry.n_value; #ifndef FLEXNAMES for (i=0; i<8; i++) sl_name[i] = stentry.n_un.n_name[i]; #else sl_name = stentry.n_un.n_name; #endif if (clevel != 0) docomm(offset); goto g2; } } g1: if (bread(&sbuf, &stentry, sizeof stentry) < sizeof stentry) return(-1); offset += sizeof stentry; } g2: bread(&sbuf, &stentry, sizeof stentry); if (stentry.n_type&~N_EXT==N_BSS) { bread(&sbuf, &stentry, sizeof stentry); offset += sizeof stentry; } if (((stentry.n_type & STABMASK) == N_LENG) && (eqpat(sl_name, stentry.n_un.n_name))) sl_size = stentry.n_value; if (sl_class == N_GSYM && (clevel == 0)) { blseek(&sbuf, extstart, 0); for(;;) { if (bread(&sbuf, &stentry, sizeof stentry) < sizeof stentry) return(-1); if (stentry.n_un.n_name[0] != '_') continue; if (eqpatr(sl_name, stentry.n_un.n_name+1, 1)) { sl_addr = stentry.n_value; break; } } } return(offset + sizeof stentry); } /* core address to procedure (pointer to proc array) */ struct proct * adrtoprocp(addr) ADDR addr; { register struct proct *procp, *lastproc; lastproc = badproc; for (procp=procs; procp->pname[0]; procp++) { if (procp->paddr > addr) break; if (procp->entrypt == 0) lastproc = procp; } return (lastproc); } /* core address to file (pointer to file array) */ struct filet * adrtofilep(addr) ADDR addr; { register struct filet *filep; for (filep=files; filep->sfilename[0]; filep++) { if (filep->faddr > addr) break; } return (filep != files ? filep-1 : badfile); } /* * core address to linenumber * Sets external exactaddr to addr if addr is NOT the first instruction * of a line, set to -1 otherwise. * Sets external lnfaddr to address of first statement in line. */ long lastoffset; adrtolineno(addr) ADDR addr; { register int lineno; long offset; struct nlist stentry; exactaddr = addr; lineno = lastoffset = -1; offset = adrtoprocp(addr)->st_offset; blseek(&sbuf, offset, 0); for (;;) { if (bread(&sbuf, &stentry, sizeof stentry) < sizeof stentry) break; if (stentry.n_type == N_SO) break; if (stentry.n_type == N_SLINE) { if (stentry.n_value > addr) break; lastoffset = offset; lineno = stentry.n_desc; lnfaddr = stentry.n_value; if (stentry.n_value == addr) exactaddr = -1; } offset += sizeof stentry; } return (lineno); } /* address to a.out offset */ long adrtostoffset(addr) ADDR addr; { adrtolineno(addr); return(lastoffset); } /* * Set (curfile, lineno) from core image. * Returns 1 if there is a core image, 0 otherwise. * * Print the current line iff verbose is set. */ setcur(verbose) { register struct proct *procp; dot = *(ADDR *) (((ADDR) &u) + PC); if (dot == 0) { printf("No core image\n"); goto setmain; } procp = adrtoprocp(dot); if ((procp->sfptr) != badfile) { finit(adrtofilep(procp->paddr)->sfilename); ffind(adrtolineno(dot)); if (verbose) { if (exactaddr != -1) printf("0x%x in ", exactaddr); #ifndef FLEXNAMES printf("%.8s:", procp->pname); #else printf("%s:", procp->pname); #endif fprint(); } return(1); } if (verbose) { if (procp->pname[0] == '_') #ifndef FLEXNAMES printf("%.7s: address 0x%x\n", procp->pname+1, dot); #else printf("%s: address 0x%x\n", procp->pname+1, dot); #endif else #ifndef FLEXNAMES printf("%.8s: address %d\n", procp->pname, dot); #else printf("%s: address %d\n", procp->pname, dot); #endif } setmain: procp = findproc("MAIN_"); if ((procp->pname[0] != 'M') || (procp->sfptr == badfile)) { procp = findproc("main"); if ((procp->pname[0] != 'm') || (procp->sfptr == badfile)) { /* printf("main not compiled with debug flag\n"); */ return(0); } } finit(procp->sfptr->sfilename); ffind(procp->lineno); return(0); } compar(a, b) struct proct *a, *b; { if (a->paddr == b->paddr) { if (a->pname[0] == '_') return(-1); if (b->pname[0] == '_') return(1); return(0); } return(a->paddr < b->paddr ? -1 : 1); } /* gets offset of file or procedure named s */ nametooffset(s) char *s; { register struct filet *f; register struct proct *p; if (*s == '\0') return(-1); if (eqany('.', s)) { f = findfile(s); return(f->sfilename[0] ? f->stf_offset : -1); } p = findproc(s); return(p->pname[0] ? p->st_offset : -1); } /* returns s if its a filename, its file otherwise */ char * nametofile(s) char *s; { register struct proct *p; if (eqany('.', s)) { return(s); } p = findproc(s); return(adrtofilep(p->paddr)->sfilename); } /* line number to address, starting at offset in a.out */ /* assumes that offset is within file */ lntoaddr(lineno, offset, file) long offset; char *file; { struct nlist stentry; register int i, ignore = 0; register int bestln=BIGNUM; ADDR bestaddr; char *p; blseek(&sbuf, offset, 0); do { if (bread(&sbuf, &stentry, sizeof stentry) < sizeof stentry) return(-1); } while ((stentry.n_type & STABMASK) == N_SO); for (;;) { switch(stentry.n_type & STABMASK) { case N_SLINE: if (!ignore) { if (stentry.n_desc == lineno) return(stentry.n_value); if (stentry.n_desc > lineno && stentry.n_desc < bestln) { bestln = stentry.n_desc; bestaddr = stentry.n_value; } } break; case N_SO: goto ret; case N_SOL: p = file; #ifndef FLEXNAMES for (;;) { for (i=0; i<8; i++) { if (*p != stentry.n_un.n_name[i]) goto neq; if (*p++ == '\0') break; } if (stentry.n_un.n_name[7] == '\0') break; if (bread(&sbuf, &stentry, sizeof stentry) < sizeof stentry) error("Bad N_SO entry (1)"); if ((stentry.n_type & STABMASK) != (unsigned char) N_SOL) error("Bad N_SO entry (2)"); } #else if (strcmp(file, stentry.n_un.n_name)) goto neq; #endif ignore = 0; break; neq: ignore++; break; } if (bread(&sbuf, &stentry, sizeof stentry) < sizeof stentry) break; } ret: return(bestln == BIGNUM ? -1 : bestaddr); } /* gets address of proc:number */ getaddr(proc,integ) char *proc; { register long offset; register char *s, *f; ADDR addr; s = proc[0] ? proc : curfile; if (*s == '\0') return(-1); offset = nametooffset(s); f = nametofile(s); if (debug) printf("getaddr() computed offset %d", offset); if (offset == -1) { addr = extaddr(proc); if (addr != -1) addr += 2; /* MACHINE DEPENDENT */ if (debug) printf(" extaddr computed %d\n", addr); return(addr); } if (integ) addr = lntoaddr(integ, offset, s); else { ADDR oldaddr; oldaddr = findproc(proc)->paddr + 2; /* MACHINE DEPENDENT */ addr = lntoaddr(adrtolineno(addr)+1, offset, f); if (addr == -1) addr = oldaddr; } if (debug) printf(" and addr %d\n", addr); if (addr == -1) return(-1); return(addr); } /* returns address of external */ ADDR extaddr(name) char *name; { struct nlist stentry; blseek(&sbuf, extstart, 0); for (;;) { if (bread(&sbuf, &stentry, sizeof stentry) < sizeof stentry)(( return(-1); if (stentry.n_un.n_name[0] == '_' && eqpatr(name, stentry.n_un.n_name+1, 1)) return(stentry.n_value); } } /* * Look up external data symbol matching pat starting at * (filestart+sizeof stentry) * Return its address in sl_addr and name in sl_name. */ long extlookup(pat, filestart) char *pat; long filestart; { register int offset, i; struct nlist stentry; blseek(&sbuf, filestart, 0); offset = filestart - sizeof stentry; do { if (bread(&sbuf, &stentry, sizeof stentry) < sizeof stentry) return(-1); offset += sizeof stentry; } while ((stentry.n_type & STABMASK) == N_SO); for (;;) { if (stentry.n_un.n_name[0] == '_' && stentry.n_type == (N_DATA | N_EXT) && eqpatr(pat, stentry.n_un.n_name+1, 1)) { sl_addr = stentry.n_value; #ifndef FLEXNAMES for (i=0; i<7; i++) sl_name[i] = stentry.n_un.n_name[i+1]; #else sl_name = stentry.n_un.n_name; #endif return(offset + sizeof stentry); } g1: if (bread(&sbuf, &stentry, sizeof stentry) < sizeof stentry) return(-1); offset += sizeof stentry; } } /* find enclosing common blocks and fix up addresses */ docomm(offset) long offset; { struct nlist stentry; ADDR addr; for (;;) { if (bread(&sbuf, &stentry, sizeof stentry) < sizeof stentry) { error("Bad common block"); return; } sl_class = N_GSYM; if ((stentry.n_type & STABMASK) == N_ECOMM) { addr = extaddr(stentry.n_un.n_name); if (addr == -1) error("Lost common block"); sl_addr +=addr; blseek(&sbuf, offset, 0); return; } if ((stentry.n_type & STABMASK) == N_ECOML) { sl_addr += stentry.n_value; blseek(&sbuf, offset, 0); return; } } } /* determine if class is that of a variable */ char pctypes[] = {N_GSYM, N_STSYM, N_LCSYM, N_RSYM, N_SSYM, N_LSYM, N_PSYM, 0}; varclass(class) char class; { char *p; for (p=pctypes; *p; p++) { if (class == *p) return(1); } return(0); } /* * address to external name * returns difference between addr and address of external * name returned in sl_name */ adrtoext(addr) ADDR addr; { struct nlist stentry; register int i, prevdiff = MAXPOS, diff; blseek(&sbuf, extstart, 0); for (;;) { if (bread(&sbuf, &stentry, sizeof stentry) < sizeof stentry) return (prevdiff!=MAXPOS ? prevdiff : -1); if (stentry.n_type == (N_DATA | N_EXT) || stentry.n_type == (N_BSS | N_EXT)) { diff = addr - stentry.n_value; if (diff >= 0 && diff < prevdiff) { #ifndef FLEXNAMES for (i=0; i<7; i++) sl_name[i] = stentry.n_un.n_name[i+1]; #else sl_name = stentry.n_un.n_name; #endif if (diff == 0) return(0); prevdiff = diff; } } } } /* * address to local name in procp * returns difference between addr and address of local * returned in sl_name */ adrtolocal(addr, procp) ADDR addr; struct proct *procp; { struct nlist stentry; register int i, prevdiff = MAXPOS, diff; blseek(&sbuf, procp->st_offset + sizeof stentry, 0); for (;;) { if (bread(&sbuf, &stentry, sizeof stentry) < sizeof stentry) return(prevdiff!=MAXPOS ? prevdiff : -1); if (stentry.n_type == N_FUN) return(prevdiff!=MAXPOS ? prevdiff : -1); if (stentry.n_type == N_LSYM) { diff = addr - stentry.n_value; if (diff >= 0 && diff < prevdiff) { #ifndef FLEXNAMES for (i=0; i<8; i++) sl_name[i] = stentry.n_un.n_name[i]; #else sl_name = stentry.n_un.n_name; #endif if (diff == 0) return(0); prevdiff = diff; } } } } /* * address to parameter name in procp * returns difference between addr and address of local * returned in sl_name */ adrtoparam(addr, procp) ADDR addr; struct proct *procp; { struct nlist stentry; register int i, prevdiff = MAXPOS, diff; blseek(&sbuf, procp->st_offset + sizeof stentry, 0); for (;;) { if (bread(&sbuf, &stentry, sizeof stentry) < sizeof stentry) return(prevdiff!=MAXPOS ? prevdiff : -1); if (stentry.n_type == N_FUN) return(prevdiff!=MAXPOS ? prevdiff : -1); if (stentry.n_type == N_PSYM) { diff = addr - stentry.n_value; if (diff >= 0 && diff < prevdiff) { #ifndef FLEXNAMES for (i=0; i<8; i++) sl_name[i] = stentry.n_un.n_name[i]; #else sl_name = stentry.n_un.n_name; #endif if (diff == 0) return(0); prevdiff = diff; } } } } /* * register number to register variable name in procp * returned in sl_name */ adrtoregvar(regno, procp) ADDR regno; struct proct *procp; { struct nlist stentry; register int i; blseek(&sbuf, procp->st_offset + sizeof stentry, 0); for (;;) { if (bread(&sbuf, &stentry, sizeof stentry) < sizeof stentry) return(-1); if (stentry.n_type == N_FUN) return(-1); if (stentry.n_type == N_RSYM) { if (stentry.n_value == regno) { #ifndef FLEXNAMES for (i=0; i<8; i++) sl_name[i] = stentry.n_un.n_name[i]; #else sl_name = stentry.n_un.n_name; #endif return(0); } } } } /* sets file map for M command */ setmap(s) char *s; { union { MAP *m; L_INT *mp; } amap; int starflag = 0; amap.mp = 0; for (; *s; s++) { switch (*s) { case '/': amap.m = &datmap; break; case '?': amap.m = &txtmap; break; case '*': starflag++; break; default: goto sout; } } sout: if (amap.mp == 0) { error("Map `?' or `/' must be specified"); return; } if (starflag) amap.mp += 3; for (; *s; s++) { if (*s >= '0' && *s <= '9') *(amap.mp)++ = readint(&s); } } e map for M command */ setmap(s) char *s; { union { MAP *m; L_INT *mp; } amap; int starflag = 0; amap.mp = 0; for (; *s; s++) { switch (*s) { case '/': amap.m = &datmap; break; case cmd/sdb/udef.c 444 0 33 163 2514002214 6401 static char sccsid[] = "@(#)udef.c 4.1 10/9/80"; #include char u[ctob(UPAGES)]; /* struct user u */ f (amap.mp == 0) { error("Map `?' or `/' must be specified"); return; } if (starflag) amap.mp += 3; for (; *s; s++) { if (*s >= '0' && *s <= '9') *(amap.mp)++ = readint(&s); } } e map for M command */ setmap(s) char *s; { union { MAP *m; L_INT *mp; } amap; int starflag = 0; amap.m/,5< /,"cmd/sdb/version.c 444 0 33 154 2514002214 7143 static char sccsid[] = "@(#)version.c 4.1 10/9/80"; version() { error("Version 2.6 - February 1, 1980"); } r u */ f (amap.mp == 0) { error("Map `?' or `/' must be specified"); return; } if (starflag) amap.mp += 3; for (; *s; s++) { if (*s >= '0' && *s <= '9') *(amap.mp)++ = readint(&s); } } e map for M command */ setmap(s) char *s; { union { MAP *m; L_INT *mp; } amap; int starflag = 0; amap.m/,5< /,"cmd/sdb/xeq.c 444 0 33 15234 2552446722 6342 static char sccsid[] = "@(#)xeq.c 4.2 7/8/81"; #include "head.h" #include #include struct user u; #include INT signo; INT adrflg; INT pid; ADDR userpc; L_INT cntval; /* service routines for sub process control */ /* * single step until loc with descriptor format d is modified * return its new value. */ monex(loc, d) ADDR loc; char d; { register ADDR oldval; oldval = getval(loc, d, DSP); do { subpcs('s'); } while (oldval == getval(loc, d, DSP)); return(getval(loc, d, DSP)); } /* single step count source stmts */ singstep(count, cmd) char cmd; { register int thisline, curline; register struct proct *thisproc; if (sdbttym.sg_flags != userttym.sg_flags) stty(2, &userttym); dot = *(ADDR *) (((ADDR) &u) + PC); thisproc = adrtoprocp(dot); thisline = adrtolineno(dot); if (count == 0) count = 1; for(; count; count--) { do { if (cmd == 'S') { /* MACHINE DEPENDENT */ dot = *(ADDR *) (((ADDR) &u) + PC); if ((get(dot,ISP) & 0xff) == 0xfb){ /* calls */ int retaddr; subpcs('s'); retaddr = *(ADDR *) (((ADDR) &u) + USP) + 16; retaddr = dot = get(retaddr, DSP); subpcs('b'); subpcs('c'); dot = retaddr; subpcs('d'); dot = *(ADDR *) (((ADDR) &u) + PC); if (retaddr != dot && signo == 0) { gtty(2, &userttym); if (sdbttym.sg_flags != userttym.sg_flags) stty(2, &sdbttym); printf("Breakpoint at \n"); return; } continue; } } subpcs('s'); dot = *(ADDR *) (((ADDR) &u) + PC); curline = adrtolineno(dot); } while (!signo && ((thisproc == adrtoprocp(dot) && thisline == curline) || curline == -1)); gtty(2, &userttym); if (sdbttym.sg_flags != userttym.sg_flags) stty(2, &sdbttym); if (signo) return; } } doscall() { int subargs[NUMARGS]; /* subargs[0] = address, * subargs[1] = number of arguments * subargs[2:NUMARGS] = actual arguments */ union { int w[128-NUMARGS]; char c[4*(128-NUMARGS)]; }substr; register(( int i, numchars, *subargp; register char ch; ADDR straddr, adr, praddr; ADDR j; praddr = extaddr(proc); if (praddr == -1) { printf("Cannot find %s\n", proc); return; } straddr = extaddr("_dbargs"); if (straddr == -1) { error("Program not loaded with -lg"); return; } numchars = 0; subargp = subargs; argsp++; *subargp++ = praddr; subargp++; for (i=0; i sizeof substr.c) { error("Too many string constants"); return; } } } else if ((ch >= '0' && ch <= '9') || ch == '-') { *subargp++ = readint(&argsp); } else if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || ch == '_') { cpname(var, argsp); j = varaddr(curproc()->pname, var); if (j == -1) { return; } *subargp++ = sl_class == N_RSYM ? *(ADDR *)(((ADDR) &u) + R0 + (WORDSIZE)*j) : getval(j, typetodesc(sl_type, 0)[0], DSP); do { argsp++; } while (varchar(*argsp) || number(*argsp)); } else if (ch != ')') { printf("Unexpected character %c\n", ch); return; } do { ch = *argsp++; } while(ch == ' '); if (ch == ')') { if (scallx == 0) { scallx = 1; pcs = *(ADDR *)(((ADDR)&u)+PC); fps = *(ADDR *)(((ADDR)&u)+FP); aps = *(ADDR *)(((ADDR)&u)+AP); if (bkpts = scanbkpt(userpc)) { if (flagss = bkpts->flag) { bkpts->flag = BKPTSET; } } } dot = *(ADDR *)(((ADDR)&u)+PC) = extaddr("_dbsubc"); if (dot == -1) { error("Internal error - cannot find _dbsubc"); return; } adrflg = 1; cntval = 1; if (pid == 0 || signo) subpcs('r'); subargs[1] = (subargp - subargs) - 2; adr = straddr; for (j=0; j<=(subargp-subargs); j++) { put(adr, DSP, subargs[j]); adr += WORDSIZE; } adr = straddr + sizeof subargs; for (j=0; j<(numchars+WORDSIZE-1)/WORDSIZE; j++) { put(adr, DSP, substr.w[j]); adr += WORDSIZE; } dschar = *argsp++; errflg = 0; dopcs('c'); if (!signo) printf("Breakpoint"); printf(" at\n"); return; } while (*argsp == ' ' || *argsp == ',') argsp++; } error ("Too many arguments"); } /* get arguments from core file, place them in args */ getargs() { struct proct *procp; ADDR p, av; int ac, i; char *argsp = args; union { char c[WORDSIZE]; int w; float f; } word; if ((procp = initframe()) == badproc) goto old1; do { if (eqstr("main", procp->pname)) goto fnd; } while ((procp = nextframe()) != badproc); old1: cpstr(args, oldargs); printf("%s %s\n", symfil, args); return; fnd: ac = get(argp, DSP); if ((ac == 0) || (ac & 0xff)) goto old1; ac = get(argp+4, DSP); av = (ADDR) get(argp+8, DSP); av += WORDSIZE; ac--; for (; ac; ac--) { p = (ADDR) get(av, DSP); av += WORDSIZE; for (;;) { word.w = get(p, DSP); for (i=0; iflag = flagss; scallx = 0; longjmp(env, 0); } } /* execute commands from a breakpoint */ acommand(cmds) char *cmds; { char *p = cmds; int endflg = 0; setcur(0); do { /* process a command */ for (;;) { if (*p == ';') { *p = '\n'; break; } if (*p == '\n') { endflg++; break; } p++; } if (decode(cmds) == 1) { printf("Bad command: "); do { printf("%c", *cmds); } while (*cmds++ != '\n'); return; } docommand(); if (!endflg) *p = ';'; p = cmds = p + 1; } while (!endflg); } mp(env, 0); } } /* execute commands from a breakpoint */ acommand(cmds) char *cmds; { char *p = cmds; int endflg = 0; setcur(0); do { /* process a command */ for (;;) { if (*p == ';') { *p = '\n'; break; } if (*p == '\n') { endflg++; break; } p++; } if (decode(cmds) == 1) { printf("Bad command: "); do {cmd/accton.c 444 0 33 341 2416237511 6166 static char *sccsid = "@(#)accton.c 4.1 (Berkeley) 10/1/80"; main(argc, argv) char **argv; { extern errno; if (argc > 1) acct(argv[1]); else acct((char *)0); if (errno) { perror("accton"); exit(1); } exit(0); } ) { if (*p == ubuf[i].uname[k]) { if (*p++ == '\0' || k == NMAX-1) return(1); } else break; } } return(0); } newday() { long ttime; struct timeb tb; struct tm *localti/( ,( 5< /\@,\D"cmd/analyze.c 444 0 33 43250 2552426030 6425 static char *sccsid = "@(#)analyze.c 4.4 (Berkeley) 5/18/81"; #include #include #include #include #include #include #include #include #include #include #include /* * Analyze - analyze a core (and optional paging area) saved from * a virtual Unix system crash. */ int Dflg; int dflg; int vflg; int mflg; int fflg; int sflg; int uflg; /* use vprintf with care; it plays havoc with ``else's'' */ #define vprintf if (vflg) printf #define clear(x) ((int)x & 0x7fffffff) struct proc *proc, *aproc; int nproc; struct text *text, *atext; int ntext; struct mapent *swapmap; int nswapmap; struct cmap *cmap; int ecmx; struct pte *usrpt; struct pte *Usrptma; int firstfree; int maxfree; int freemem; struct pte p0br[ctopt(MAXTSIZ+MAXDSIZ+MAXSSIZ)][NPTEPG]; int pid; struct paginfo { char z_type; char z_count; short z_pid; struct pte z_pte; } *paginfo; #define ZLOST 0 #define ZDATA 1 #define ZSTACK 2 #define ZUDOT 3 #define ZPAGET 4 #define ZTEXT 5 #define ZFREE 6 #define ZINTRAN 7 struct dblks { short d_first; short d_size; char d_type; char d_index; } *dblks; int ndblks; #define DFREE 0 #define DDATA 1 #define DSTACK 2 #define DTEXT 3 #define DUDOT 4 #define DPAGET 5 union { char buf[UPAGES][512]; struct user U; } u_area; #define u u_area.U int fcore = -1; int fswap = -1; struct nlist nl[] = { #define X_PROC 0 { "_proc" }, #define X_USRPT 1 { "_usrpt" }, #define X_PTMA 2 { "_Usrptmap" }, #define X_FIRSTFREE 3 { "_firstfree" }, #define X_MAXFREE 4 { "_maxfree" }, #define X_TEXT 5 { "_text" }, #define X_FREEMEM 6 { "_freemem" }, #define X_CMAP 7 { "_cmap" }, #define X_ECMAP 8 { "_ecmap" }, #define X_SWAPMAP 9 { "_swapmap" }, #define X_NPROC 10 { "_nproc" }, #define X_NTEXT 11 { "_ntext" }, #define X_NSWAPMAP 12 { "_nswapmap" }, { 0 } }; main(argc, argv) int argc; char **argv; { register struct nlist *np; register struct proc *p; register struct text *xp; register struct pte *pte; register int i; int w, a; argc--, argv++; while (argc > 0 && argv[0][0] == '-') { register char *cp = *argv++; argc--; while (*++cp) switch (*cp) { case 'm': mflg++; break; case 'v': vflg++; break; case 's': if (argc < 2) goto usage; if ((fswap = open(argv[0], 0)) < 0) { perror(argv[0]); exit(1); } argc--,argv++; sflg++; break; case 'f': fflg++; break; case 'D': Dflg++; break; case 'd': dflg++; break; case 'u': uflg++; break; default: goto usage; } } if (argc < 1) { usage: fprintf(stderr, "usage: analyze [ -vmfd ] [ -s swapfile ] corefile [ system ]\n"); exit(1); } close(0); if ((fcore = open(argv[0], 0)) < 0) { perror(argv[0]); exit(1); } nlist(argc > 1 ? argv[1] : "/vmunix", nl); if (nl[0].n_value == 0) { fprintf(stderr, "%s: bad namelist\n", argc > 1 ? argv[1] : "/vmunix"); exit(1); } for (np = nl; np->n_name[0]; np++) vprintf("%8.8s %x\n", np->n_name ,np->n_value ); usrpt = (struct pte *)clear(nl[X_USRPT].n_value); Usrptma = (struct pte *)clear(nl[X_PTMA].n_value); firstfree = get(nl[X_FIRSTFREE].n_value); maxfree = get(nl[X_MAXFREE].n_value); freemem = get(nl[X_FREEMEM].n_value); paginfo = (struct paginfo *)calloc(maxfree, sizeof (struct paginfo)); if (paginfo == NULL) { fprintf(stderr, "maxfree %x?... out of mem!\n", maxfree); exit(1); } vprintf("usrpt %x\nUsrptma %x\nfirstfree %x\nmaxfree %x\nfreemem %x\n", usrpt, Usrptma, firstfree((, maxfree, freemem); { lseek(fcore, (long)clear(nl[X_PROC].n_value), 0); read(fcore, (char *)&aproc, sizeof aproc); lseek(fcore, (long)clear(nl[X_NPROC].n_value), 0); read(fcore, (char *)&nproc, sizeof nproc); printf("%d procs\n", nproc); proc = (struct proc *)calloc(nproc, sizeof (struct proc)); lseek(fcore, (long)clear(aproc), 0); if (read(fcore, (char *)proc, nproc * sizeof (struct proc)) != nproc * sizeof (struct proc)) { perror("proc read"); exit(1); } } { lseek(fcore, (long)clear(nl[X_TEXT].n_value), 0); read(fcore, (char *)&atext, sizeof atext); lseek(fcore, (long)clear(nl[X_NTEXT].n_value), 0); read(fcore, (char *)&ntext, sizeof ntext); printf("%d texts\n", ntext); text = (struct text *)calloc(ntext, sizeof (struct text)); lseek(fcore, (long)clear(atext), 0); if (read(fcore, (char *)text, ntext * sizeof (struct text)) != ntext * sizeof (struct text)) { perror("text read"); exit(1); } } i = (get(nl[X_ECMAP].n_value) - get(nl[X_CMAP].n_value)); ecmx = i / sizeof (struct cmap); cmap = (struct cmap *)calloc(i, 1); if (cmap == NULL) { fprintf(stderr, "not enough mem for %x bytes of cmap\n", i); exit(1); } lseek(fcore, (long)clear(get(nl[X_CMAP].n_value)), 0); if (read(fcore, (char *)cmap, i) != i) { perror("cmap read"); exit(1); } { struct mapent *aswapmap; lseek(fcore, (long)clear(nl[X_SWAPMAP].n_value), 0); read(fcore, (char *)&aswapmap, sizeof aswapmap); lseek(fcore, (long)clear(nl[X_NSWAPMAP].n_value), 0); read(fcore, (char *)&nswapmap, sizeof nswapmap); nswapmap--; printf("%d swapmap entries\n", nswapmap); swapmap = (struct mapent *)calloc(nswapmap, sizeof (struct mapent)); dblks = (struct dblks *)calloc(2 * nswapmap, sizeof (struct dblks)); lseek(fcore, (long)clear(aswapmap+1), 0); if (read(fcore, (char *)swapmap, nswapmap * sizeof (struct mapent)) != nswapmap * sizeof (struct mapent)) { perror("swapmap read"); exit(1); } } for (p = &proc[1]; p < proc+nproc; p++) { p->p_p0br = (struct pte *)clear(p->p_p0br); p->p_addr = (struct pte *)clear(p->p_addr); if (p->p_stat == 0) continue; printf("proc %d ", p->p_pid); if (p->p_stat == SZOMB) { printf("zombie\n"); continue; } if (p->p_flag & SLOAD) { printf("loaded, p0br %x, ", p->p_p0br); printf("%d pages of page tables:", p->p_szpt); a = btokmx(p->p_p0br); for (i = 0; i < p->p_szpt; i++) { w = get(&Usrptma[a + i]); printf(" %x", w & PG_PFNUM); } printf("\n"); for(i = 0; i < p->p_szpt; i++) { w = get(&Usrptma[a + i]); if (getpt(w, i)) count(p, (struct pte *)&w, ZPAGET); } } else { /* i = ctopt(btoc(u.u_exdata.ux_dsize)); */ i = clrnd(ctopt(p->p_tsize + p->p_dsize + p->p_ssize)); printf("swapped, swaddr %x\n", p->p_swaddr); duse(p->p_swaddr, clrnd(ctod(UPAGES)), DUDOT, p - proc); duse(p->p_swaddr + ctod(UPAGES), clrnd(i - p->p_tsize / NPTEPG), DPAGET, p - proc); /* i, DPAGET, p - proc); */ } p->p_p0br = (struct pte *)p0br; p->p_addr = uaddr(p); p->p_textp = &text[p->p_textp - atext]; if (p->p_pid == 2) continue; if (getu(p)) continue; u.u_procp = p; pdmap(); if ((p->p_flag & SLOAD) == 0) continue; pid = p->p_pid; for (i = 0; i < p->p_tsize; i++) { pte = tptopte(p, i); if (pte->pg_fod || pte->pg_pfnum == 0) continue; if (pte->pg_pfnum >= firstfree && pte->pg_pfnum < maxfree && cmap[pgtocm(pte->pg_pfnum)].c_intrans) count(p, pte, ZINTRAN); else count(p, pte, ZTEXT); } vprintf("\n"); for (i = 0; i < p->p_dsize; i++) { pte = dptopte(p, i); if (pte->pg_fod || pte->pg_pfnum == 0) continue; if (pte->pg_pfnum >= firstfree && pte->pg_pfnum < maxfree && cmap[pgtocm(pte->pg_pfnum)].c_intrans) count(p, pte, ZINTRAN); else count(p, pte, ZDATA); } vprintf("\n"); for (i = 0; i < p->p_ssize; i++) { pte = sptopte(p, i); if (pte->pg_fod || pte->pg_pfnum == 0) continue; if (pte->pg_pfnum >= firstfree && pte->pg_pfnum < maxfree && cmap[pgtocm(pte->pg_pfnum)].c_intrans) count(p, pte, ZINTRAN); else count(p, pte, ZSTACK); } vprintf("\n"); for (i = 0; i < UPAGES; i++) count(p, &p->p_addr[i], ZUDOT); vprintf("\n"); vprintf("\n"); } for (xp = &text[0]; xp < text+ntext; xp++) if (xp->x_iptr) { for (i = 0; i < xp->x_size; i += DMTEXT) duse(xp->x_daddr[i], (xp->x_size - i) > DMTEXT ? DMTEXT : xp->x_size - i, DTEXT, xp - text); if (xp->x_flag & XPAGI) duse(xp->x_ptdaddr, clrnd(ctopt(xp->x_size)), DTEXT, xp - text); } dmcheck(); fixfree(); summary(); exit(0); } pdmap() { register struct text *xp; if (fswap == -1 && (u.u_procp->p_flag & SLOAD) == 0) return; if (Dflg) printf("disk for pid %d", u.u_procp->p_pid); if ((xp = u.u_procp->p_textp) && Dflg) ptdmap(xp->x_daddr, xp->x_size); pdmseg("data", &u.u_dmap, DDATA); pdmseg("stack", &u.u_smap, DSTACK); if (Dflg) printf("\n"); } ptdmap(dp, size) register daddr_t *dp; int size; { register int i; int rem; if (Dflg) printf(" text:"); for (i = 0, rem = size; rem > 0; i++) { if (Dflg) printf(" %x<%x>", dp[i], rem < DMTEXT ? rem : DMTEXT); rem -= rem < DMTEXT ? rem : DMTEXT; } } pdmseg(cp, dmp, type) char *cp; struct dmap *dmp; { register int i; int b, rem; if (Dflg) printf(", %s:", cp); b = DMMIN; for (i = 0, rem = dmp->dm_size; rem > 0; i++) { if (Dflg) printf(" %x<%x>", dmp->dm_map[i], rem < b ? rem : b); duse(dmp->dm_map[i], b, type, u.u_procp - proc); rem -= b; if (b < DMMAX) b *= 2; } } duse(first, size, type, index) { register struct dblks *dp; if (fswap == -1) return; dp = &dblks[ndblks]; if (++ndblks > 2*nswapmap) { fprintf(stderr, "too many disk blocks\n"); exit(1); } dp->d_first = first; dp->d_size = size; dp->d_type = type; dp->d_index = index; } dsort(d, e) register struct dblks *d, *e; { return (e->d_first - d->d_first); } dmcheck() { register struct mapent *smp; register struct dblks *d, *e; for (smp = swapmap; smp->m_size; smp++) duse(smp->m_addr, smp->m_size, DFREE, 0); duse(CLSIZE, DMTEXT - CLSIZE, DFREE, 0); qsort(dblks, ndblks, sizeof (struct dblks), dsort); d = &dblks[ndblks - 1]; if (d->d_first > 1) printf("lost swap map: start %x size %x\n", 1, d->d_first); for (; d > dblks; d--) { if (dflg) dprint(d); e = d - 1; if (d->d_first + d->d_size > e->d_first) { printf("overlap in swap mappings:\n"); dprint(d); dprint(e); } else if (d->d_first + d->d_size < e->d_first) { printf("lost swap map: start %x size %x\n", d->d_first + d->d_size, e->d_first - (d->d_first + d->d_size)); } } if (dflg) dprint(dblks); if (sflg) printf("swap space ends at %x\n", d->d_first + d->d_size); } char *dnames[] = { "DFREE", "DDATA", "DSTACK", "DTEXT", "DUDOT", "DPAGET", }; dprint(d) register struct dblks *d; { printf("at %4x size %4x type %s", d->d_first, d->d_size, dnames[d->d_type]); switch (d->d_type) { case DSTACK: case DDATA: printf(" pid %d", proc[d->d_index].p_pid); break; } printf("\n"); } getpt(x, i) int x, i; { lseek(fcore, (long)ctob((x & PG_PFNUM)), 0); if (read(fcore, (char *)(p0br[i]), NBPG) != NBPG) { perror("read"); fprintf(stderr, "getpt error reading frame %x\n", clear(x)); return (0); } return (1); } checkpg(p, pte, type) register struct pte *pte; register struct proc *p; int type; { char corepg[NBPG], swapg[NBPG]; register int i, count, dblock; register int pfnum = pte->pg_pfnum; if (type == ZPAGET || type == ZUDOT) return (0); lseek(fcore, (long)(NBPG * pfnum), 0); if (read(fcore, corepg, NBPG) != NBPG){ perror("read"); fprintf(stderr, "Error reading core page %x\n", pfnum); return (0); } switch (type) { case ZDATA: if (ptetodp(p, pte) >= u.u_dmap.dm_size) return (0); break; case ZTEXT: break; case ZSTACK: if (ptetosp(p, pte) >= u.u_smap.dm_size) return (0); break; default: return(0); break; } dblock = vtod(p, ptetov(p, pte), &u.u_dmap, &u.u_smap); vprintf(" %x", dblock); if (pte->pg_fod || pte->pg_pfnum == 0) return (0); if (cmap[pgtocm(pte->pg_pfnum)].c_intrans || pte->pg_m || pte->pg_swapm) return (0); lseek(fswap, (long)(NBPG * dblock), 0); if (read(fswap, swapg, NBPG) != NBPG) { fprintf(stderr,"swap page %x: ", dblock); perror("read"); } count = 0; for (i = 0; i < NBPG; i++) if (corepg[i] != swapg[i]) count++; if (count == 0) vprintf("\tsame"); return (count); } getu(p) register struct proc *p; { int i, w, cc, errs = 0; if (uflg && (p->p_flag & SLOAD)) printf("pid %d u. pages:", p->p_pid); for (i = 0; i < UPAGES; i++) { if (p->p_flag & SLOAD) { if (uflg) printf(" %x", p->p_addr[i].pg_pfnum); lseek(fcore, ctob(p->p_addr[i].pg_pfnum), 0); if (read(fcore, u_area.buf[i], NBPG) != NBPG) perror("core u. read"), errs++; } else if (fswap >= 0) { lseek(fswap, (long)(NBPG * (p->p_swaddr+i)), 0); if (read(fswap, u_area.buf[i], NBPG) != NBPG) perror("swap u. read"), errs++; } } if (uflg && (p->p_flag & SLOAD)) printf("\n"); return (errs); } char *typepg[] = { "lost", "data", "stack", "udot", "paget", "text", "free", "intransit", }; count(p, pte, type) struct proc *p; register struct pte *pte; int type; { register int pfnum = pte->pg_pfnum; register struct paginfo *zp = &paginfo[pfnum]; int ndif; #define zprintf if (type==ZINTRAN || vflg) printf if (type == ZINTRAN && pfnum == 0) return; zprintf("page %x %s", pfnum, typepg[type]); if (sflg == 0 || (ndif = checkpg(p, pte, type)) == 0) { zprintf("\n"); } else { if (vflg == 0 && type != ZINTRAN) printf("page %x %s,", pfnum, typepg[type]); printf(" %d bytes differ\n",ndif); } if (pfnum < firstfree || pfnum > maxfree) { printf("page number out of range:\n"); printf("\tpage %x type %s pid %d\n", pfnum, typepg[type], pid); return; } if (bad(zp, type)) { printf("dup page pte %x", *(int *)pte); dumpcm("", pte->pg_pfnum); dump(zp); printf("pte %x and as %s in pid %d\n", zp->z_pte, typepg[type], pid); return; } zp->z_type = type; zp->z_count++; zp->z_pid = pid; zp->z_pte = ((*pte; } bad(zp, type) struct paginfo *zp; { if (type == ZTEXT) { if (zp->z_type != 0 && zp->z_type != ZTEXT) return (1); return (0); } return (zp->z_count); } dump(zp) struct paginfo *zp; { printf("page %x type %s pid %d ", zp - paginfo, typepg[zp->z_type], zp->z_pid); } summary() { register int i; register struct paginfo *zp; register int pfnum; for (i = firstfree + UPAGES; i < maxfree; i+= CLSIZE) { zp = &paginfo[i]; if (zp->z_type == ZLOST) dumpcm("lost", i); pfnum = pgtocm(i); if (cmap[pfnum].c_lock && cmap[pfnum].c_type != CSYS) dumpcm("locked", i); if (mflg) dumpcm("mem", i); } } char *tynames[] = { "sys", "text", "data", "stack" }; dumpcm(cp, pg) char *cp; int pg; { int pslot; int cm; register struct cmap *c; cm = pgtocm(pg); printf("cm %x %s page %x ", cm, cp, pg); c = &cmap[cm]; printf("\t[%x, %x", c->c_page, c->c_ndx); if (c->c_type == CSYS) goto skip; if (c->c_type != CTEXT) { if (c->c_ndx >= nproc) { printf(" [text c->c_ndx %d?]", c->c_ndx); goto skip; } printf(" (=pid %d)", proc[c->c_ndx].p_pid); } else { if (c->c_ndx >= ntext) { printf(" [text c->c_ndx %d?]", c->c_ndx); goto skip; } pslot= (text[c->c_ndx].x_caddr - aproc); printf(" (=pid"); for(;;) { printf(" %d", proc[pslot].p_pid); if (proc[pslot].p_xlink == 0) break; pslot= (proc[pslot].p_xlink - aproc); } printf(")"); } skip: printf("] "); printf(tynames[c->c_type]); if (c->c_free) printf(" free"); if (c->c_gone) printf(" gone"); if (c->c_lock) printf(" lock"); if (c->c_want) printf(" want"); if (c->c_intrans) printf(" intrans"); if (c->c_blkno) printf(" blkno %x mdev %d", c->c_blkno, c->c_mdev); if (c->c_hlink) { printf(" hlink %x page %x", c->c_hlink, cmtopg(c->c_hlink)); if (c->c_hlink > ecmx) printf(" <<<"); } printf("\n"); } fixfree() { register int i, next, prev; next = CMHEAD; for (i=freemem/CLSIZE; --i >=0; ) { prev = next; next = cmap[next].c_next; if (cmap[next].c_free == 0) { printf("link to non free block: in %x to %x\n", cmtopg(prev), cmtopg(next)); dumpcm("bad free link in", cmtopg(prev)); dumpcm("to non free block", cmtopg(next)); } if (cmtopg(next) > maxfree) { printf("free list link out of range: in %x to %x\n", cmtopg(prev), cmtopg(next)); dumpcm("bad link in", cmtopg(prev)); } paginfo[cmtopg(next)].z_type = ZFREE; if (fflg) dumpcm("free", cmtopg(next)); paginfo[cmtopg(next)+1].z_type = ZFREE; if (fflg) dumpcm("free", cmtopg(next)+1); } } get(loc) unsigned loc; { int x; lseek(fcore, (long)clear(loc), 0); if (read(fcore, (char *)&x, sizeof (int)) != sizeof (int)) { perror("read"); fprintf(stderr, "get failed on %x\n", clear(loc)); return (0); } return (x); } /* * Convert a virtual page number * to its corresponding disk block number. * Used in pagein/pageout to initiate single page transfers. */ vtod(p, v, dmap, smap) register struct proc *p; register struct dmap *dmap, *smap; { struct dblock db; if (v < p->p_tsize) return(p->p_textp->x_daddr[v / DMTEXT] + v % DMTEXT); if (isassv(p, v)) vstodb(vtosp(p, v), 1, smap, &db, 1); else vstodb(vtodp(p, v), 1, dmap, &db, 0); return (db.db_base); } /* * Convert a pte pointer to * a virtual page number. */ ptetov(p, pte) register struct proc *p; register struct pte *pte; { if (isatpte(p, pte)) return (tptov(p, ptetotp(p, pte))); else if (isadpte(p, pte)) return (dptov(p, ptetodp(p, pte))); else return (sptov(p, ptetosp(p, pte))); } /* * Given a base/size pair in virtual swap area, * return a physical base/size pair which is the * (largest) initial, physically contiguous block. */ vstodb(vsbase, vssize, dmp, dbp, rev) register int vsbase; int vssize; register struct dmap *dmp; register struct dblock *dbp; { register int blk = DMMIN; register swblk_t *ip = dmp->dm_map; if (vsbase < 0 || vsbase + vssize > dmp->dm_size) panic("vstodb"); while (vsbase >= blk) { vsbase -= blk; if (blk < DMMAX) blk *= 2; ip++; } dbp->db_size = min(vssize, blk - vsbase); dbp->db_base = *ip + (rev ? blk - (vsbase + vssize) : vsbase); } panic(cp) char *cp; { printf("panic!: %s\n", cp); } min(a, b) { return (a < b ? a : b); } er int vsbase; int vssize; register struct dmap *dmp; register struct dblock *dbp; { register int blk = DMMIN; register swblk_t *ip = dmp->dm_map; if (vsbase < 0 || vsbase + vssize > dmp->dm_size) panic("vstodb"); while (vsbase >= blk) { vsbase -= blk; if (blk < DMMAX) blk *= 2; ip++; } dbp->db_size = min(vssize, blk - vscmd/adb/ 775 0 33 0 2552516727 5254 cmd/adb/:rofix 644 0 33 35 2514002074 6420 g/^[ ]*\.data/s//.text/ w q } while (*cmds++ != '\n'); return; } docommand(); if (!endflg) *p = ';'; p = cmds = p + 1; < < a9mp(e02552516727 /* e< a9s fr00000005254int */ acommand(cmds) char *cmds; { char *p = cmds; int endflg = 0; setcur(0); do { /* process a command */ for (;;) { if (*p == ';') { *p = '\n'; break; } if (*p '\n') { / C. /,"cmd/adb/Makefile 644 0 33 2007 2514002074 6755 DESTDIR= CFLAGS= -O -w CFILES= access.c command.c expr.c format.c input.c main.c message.c \ opset.c optab.c output.c pcs.c print.c runpcs.c setup.c sym.c OFILES= access.o command.o expr.o format.o input.o main.o message.o \ opset.o optab.o output.o pcs.o print.o runpcs.o setup.o sym.o adb: ${OFILES} ${CC} -o adb ${OFILES} defs.h: mac.h mode.h mode.h: machine.h access.o: defs.h access.c command.o: defs.h command.c expr.o: defs.h expr.c format.o: defs.h format.c input.o: defs.h input.c main.o: defs.h main.c message.o: mac.h mode.h message.c ${CC} -S message.c ed <:rofix message.s ${AS} -o message.o message.s rm message.s opset.o: defs.h opset.c optab.o: defs.h optab.c ${CC} -S optab.c ed <:rofix optab.s ${AS} -o optab.o optab.s rm optab.s 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 install: install -s adb ${DESTDIR}/bin clean: rm -f adb ${OFILES} print: @ls -l | pr @pr -f Makefile *.h ${CFILES} n.c message.o: mac.h mode.h message.c ${CC} -S message.c ed <:rofix message.s ${AS} -o message.o message.s rm message.s opset.o: defs.h opset.c optab.o: defs.h optab.c ${CC} -S optab.c ed <:rofix optab.s ${AS} -o optab.o optab.s rm optab.s 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 install: install -s adb ${DESTDIR}/bin clean: rm -f adb ${OFILES} print: @ls -l | pr @pr -f Makefile *.h ${Ccmd/adb/access.c 644 0 33 4057 2514002075 6732 # /* * * UNIX debugger * */ #include "defs.h" static char sccsid[] = "%Z%%M% %I% %G%"; MSG ODDADR; MSG BADDAT; MSG BADTXT; MAP txtmap; MAP datmap; INT wtflag; STRING errflg; INT errno; INT pid; /* file handling and access routines */ put(adr,space,value) #ifndef EDDT L_INT adr; { access(WT,adr,space,value); } #else L_INT *adr; {*adr=value;} #endif POS get(adr, space) #ifndef EDDT L_INT adr; { return(access(RD,adr,space,0)); } #else L_INT *adr; {return(*adr);} #endif POS chkget(n, space) L_INT n; { #ifndef vax REG INT w; #else REG L_INT w; #endif w = get(n, space); chkerr(); return(w); } POS bchkget(n, space) L_INT n; { return(chkget(n, space) & LOBYTE); } #ifndef EDDT access(mode,adr,space,value) L_INT adr; { INT pmode,rd,file; ADDR w; rd = mode==RD; IF space == NSP THEN return(0); FI IF pid /* tracing on? */ THEN #ifndef vax IF adr&01 ANDF !rd THEN error(ODDADR); FI #endif pmode = (space&DSP?(rd?RDUSER:WDUSER):(rd?RIUSER:WIUSER)); w = ptrace(pmode, pid, adr, value); #ifndef vax IF adr&01 THEN w1 = ptrace(pmode, pid, shorten(adr+1), value); w = (w>>8)&LOBYTE | (w1<<8); FI #endif IF errno THEN errflg = (space&DSP ? BADDAT : BADTXT); FI return(w); FI w = 0; IF mode==WT ANDF wtflag==0 THEN error("not in write mode"); FI IF !chkmap(&adr,space) THEN return(0); FI file=(space&DSP?datmap.ufd:txtmap.ufd); IF longseek(file,adr)==0 ORF (rd ? read(file,&w,sizeof(w)) : write(file,&value,sizeof(w))) < 1 T((HEN errflg=(space&DSP?BADDAT:BADTXT); FI return(w); } #endif chkmap(adr,space) REG L_INT *adr; REG INT space; { REG MAPPTR amap; amap=((space&DSP?&datmap:&txtmap)); IF space&STAR ORF !within(*adr,amap->b1,amap->e1) THEN IF within(*adr,amap->b2,amap->e2) THEN *adr += (amap->f2)-(amap->b2); ELSE errflg=(space&DSP?BADDAT:BADTXT); return(0); FI ELSE *adr += (amap->f1)-(amap->b1); FI return(1); } within(adr,lbd,ubd) POS adr, lbd, ubd; { return(adr>=lbd && adrb1,amap->e1) THEN IF within(*adr,amap->b2,amap->e2) THEN *adr += (amap->f2)-(amap->b2); ELSE errflg=(space&DSP?BADDAT:BADTXT); return(0); FI ELSE *adr += (amap->f1)-(amap->b1); FI return(1); } within(adr,lbd,ubd) POS adr, lbd, ubd; { return(adr>=lbd && adrufd=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=(longpr?4:2); savdot=dot; expr(1); locval=expv; IF expr(0) THEN locmsk=expv; ELSE locmsk = -1L; FI IF !longpr THEN locmsk &= 0xFFFF; locval &= 0xFFFF; FI LOOP w=get(dot,itype); 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); ELSE put(dot,itype,itol(get(dot+2,itype),expv)); FI savdot=dot; printf("=%8t"); exform(1,wformat,itype,ptype); newline(); PER expr(0) ANDF errflg==0 DONE dot=savdot; chkerr(); break; default: lp--; getformat(eqcom ? eqformat : stformat); IF !eqcom THEN psymoff(dot,ptype,":%16t"); FI scanform(cntval,(eqcom?eqformat:stformat),itype,ptype); } break; case '>': lastcom=0; savc=rdc(); IF regptr=getreg(savc) THEN * (ADDR *) (((ADDR)&u)+regptr)=dot; ptrace(WUREGS,pid,regptr,* (ADDR *) (((ADDR)&u)+regptr)); ELIF (modifier=varchk(savc)) != -1 THEN var[modifier]=dot; ELSE error(BADVAR); FI break; case '!': lastcom=0; shell(); break; case '$': lastcom=0; printtrace(nextchar()); break; case ':': IF !executing THEN executing=TRUE; subpcs(nextchar()); executing=FALSE; lastcom=0; FI break; case 0: prints(DBNAME); break; default: error(BADCOM); } flushbuf(); PER rdc()==';' DONE IF buf THEN lp=savlp; ELSE lp--; FI return(adrflg ANDF dot!=0); } fier=varchk(savc)) != -1 THEN var[modifier]=dot; ELSE error(BADVAR); FI break; case '!': lastcom=0; shell(); break; case '$'cmd/adb/defs.h 644 0 33 5033 2514002076 6413 /* * adb - vax string table version; common definitions */ #include #include #include #include #include #include #include "mac.h" #include "mode.h" #include "head.h" /* access modes */ #define RD 0 #define WT 1 #define NSP 0 #define ISP 1 #define DSP 2 #define STAR 4 #define STARCOM 0200 /* * Symbol types, used internally in calls to findsym routine. * One the VAX this all degenerates since I & D symbols are indistinct. * Basically we get NSYM==0 for `=' command, ISYM==DSYM otherwise. */ #define NSYM 0 #define DSYM 1 /* Data space symbol */ #define ISYM DSYM /* Instruction space symbol == DSYM on VAX */ #define BKPTSET 1 #define BKPTEXEC 2 #define USERPS PSL #define USERPC PC #define BPT 03 #define TBIT 020 #define FD 0200 #define SETTRC 0 #define RDUSER 2 #define RIUSER 1 #define WDUSER 5 #define WIUSER 4 #define RUREGS 3 #define WUREGS 6 #define CONTIN 7 #define EXIT 8 #define SINGLE 9 /* the quantities involving ctob() are located in the kernel stack. */ /* the others are in the pcb. */ #define KSP 0 #define ESP 4 #define SSP 8 #define USP (ctob(UPAGES)-5*sizeof(int)) #define R0 (ctob(UPAGES)-18*sizeof(int)) #define R1 (ctob(UPAGES)-17*sizeof(int)) #define R2 (ctob(UPAGES)-16*sizeof(int)) #define R3 (ctob(UPAGES)-15*sizeof(int)) #define R4 (ctob(UPAGES)-14*sizeof(int)) #define R5 (ctob(UPAGES)-13*sizeof(int)) #define R6 (ctob(UPAGES)-12*sizeof(int)) #define R7 (ctob(UPAGES)-11*sizeof(int)) #define R8 (ctob(UPAGES)-10*sizeof(int)) #define R9 (ctob(UPAGES)-9*sizeof(int)) #define R10 (ctob(UPAGES)-8*sizeof(int)) #define R11 (ctob(UPAGES)-7*sizeof(int)) #define AP (ctob(UPAGES)-21*sizeof(int)) #define FP (ctob(UPAGES)-20*sizeof(int)) #define PC (ctob(UPAGES)-2*sizeof(int)) #define PSL (ctob(UPAGES)-1*sizeof(int)) #define P0BR 80 #define P0LR 84 #define P1BR 88 #define P1LR 92 #define MAXOFF 255 #define MAXPOS 80 #define MAXLIN 128 #define EOF 0 #define EOR '\n' #define SP ' ' #define TB '\t' #define QUOTE 0200 #define STRIP 0177 #define LOBYTE 0377 #define EVEN -2 /* long to ints and back (puns) */ union { INT I[2]; L_INT L; } itolws; #ifndef vax #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) #else #define leng(a) itol(0,a) #define shorten(a) ((short)(a)) #define itol(a,b) (itolws.I[0]=(b), itolws.I[1]=(a), itolws.L) #endif /* result type declarations */ L_INT inkdot(); POS get(); POS chkget(); STRING exform(); L_INT round(); BKPTR scanbkpt(); VOID fault(); ne EVEN -2 /* long to ints and back (puns) */ union { INT I[2]; L_INT L; } itolws; #ifndef vax #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) #else #define leng(a) itol(0,a) #define shorten(a) ((short)(a)) #define itol(a,b) (itolws.I[0]=(b), itolws.I[1]=(a), itolws.L) #endif /* result type declarations */ L_INT inkdot(); POS get(); POS chkget(); STRING exform(); L_INT round(); BKPTR cmd/adb/expr.c 644 0 33 11725 2514002100 6454 # /* * * UNIX debugger * */ #include "defs.h" static char sccsid[] = "%Z%%M% %I% %G%"; MSG BADSYM; MSG BADVAR; MSG BADKET; MSG BADSYN; MSG NOCFN; MSG NOADR; MSG BADLOC; ADDR lastframe; ADDR savlastf; ADDR savframe; ADDR savpc; ADDR callpc; CHAR *lp; INT radix; STRING errflg; L_INT localval; CHAR isymbol[BSIZE]; CHAR lastc,peekc; L_INT dot; L_INT ditto; INT dotinc; L_INT var[]; L_INT expv; expr(a) { /* term | term dyadic expr | */ INT rc; L_INT lhs; rdc(); lp--; ((rc=term(a); WHILE rc DO lhs = expv; switch ((int)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 ((int)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 '#': 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 | . | ^ | n_un.n_name,isymbol,'~') THEN break; FI callpc=get(frame+16, DSP); lastframe=frame; frame=get(frame+12,DSP)&EVEN; IF frame==0 THEN error(NOCFN); FI OD savlastf=lastframe; savframe=frame; readchar(); IF symchar(0) THEN chkloc(expv=frame); FI ELIF (symp=lookup(isymbol))==0 THEN error(BADSYM); ELSE expv = symp->n_value; FI lp--; ELIF getnum(readchar) THEN ; ELIF lastc=='.' THEN readchar(); IF symchar(0) THEN lastframe=savlastf; callpc=savpc; chkloc(savframe); ELSE expv=dot; FI lp--; ELIF lastc=='"' THEN expv=ditto; ELIF lastc=='+' THEN expv=inkdot(dotinc); ELIF lastc=='^' THEN expv=inkdot(-dotinc); ELIF lastc=='<' THEN savc=rdc(); IF regptr=getreg(savc) THEN expv= * (ADDR *)(((ADDR)&u)+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 */ getnum(rdf) int (*rdf)(); { INT base,d,frpt; BOOL hex; UNION{REAL r; L_INT i;} real; IF isdigit(lastc) ORF (hex=TRUE, lastc=='#' ANDF isxdigit((*rdf)())) THEN expv = 0; base = (hex ? 16 : radix); WHILE (base>10 ? isxdigit(lastc) : isdigit(lastc)) DO expv = (base==16 ? expv<<4 : expv*base); IF (d=convdig(lastc))>=base THEN error(BADSYN); FI expv += d; (*rdf)(); IF expv==0 THEN IF (lastc=='x' ORF lastc=='X') THEN hex=TRUE; base=16; (*rdf)(); ELIF (lastc=='t' ORF lastc=='T') THEN hex=FALSE; base=10; (*rdf)(); ELIF (lastc=='o' ORF lastc=='O') THEN hex=FALSE; base=8; (*rdf)(); FI FI OD IF lastc=='.' ANDF (base==10 ORF expv==0) ANDF !hex THEN real.r=expv; frpt=0; base=10; WHILE isdigit((*rdf)()) DO real.r *= base; frpt++; real.r += lastc-'0'; OD WHILE frpt-- DO real.r /= base; OD expv = real.i; FI peekc=lastc; /* lp--; */ return(1); ELSE return(0); FI } readsym() { REG char *p; p = isymbol; REP IF p < &isymbol[sizeof(isymbol)-1] THEN *p++ = lastc; FI readchar(); PER symchar(1) DONE *p++ = 0; } 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) L_INT frame; { readsym(); REP IF localsym(frame)==0 THEN error(BADLOC); FI expv=localval; PER !eqsym(cursym->n_un.n_name,isymbol,'~') DONE } eqsym(s1, s2, c) register char *s1, *s2; { if (!strcmp(s1,s2)) return (1); if (*s1 == c && !strcmp(s1+1, s2)) return (1); return (0); } FI return( isalpha(lastc) ORF lastc=='_' Ocmd/adb/format.c 644 0 33 12377 2522721435 7014 # /* * * UNIX debugger * */ #include "defs.h" static char sccsid[] = "%Z%%M% %I% %G%"; MSG BADMOD; MSG NOFORK; MSG ADWRAP; INT mkfault; CHAR *lp; L_INT maxoff; ADDR sigint; ADDR sigqit; STRING errflg; CHAR lastc,peekc; L_INT dot; INT dotinc; L_INT expv; L_INT var[]; STRING fphack; rdfp() { return(lastc= *fphack++); } scanform(icount,ifp,itype,ptype) L_INT icount; STRING ifp; { STRING fp; CHAR modifier; INT fcount, init=1; L_INT savdot; BOOL exact; BOOL doit = 1; WHILE icount DO fp=ifp; savdot=dot; init=0; IF init==0 ANDF (exact=(findsym(dot,ptype)==0)) ANDF maxoff THEN printf("\n%s:%16t",cursym->n_un.n_name); FI /*now loop over format*/ WHILE *fp ANDF errflg==0 DO IF digit(modifier = *fp) THEN fcount = 0; WHILE digit(modifier = *fp++) DO fcount *= 10; fcount += modifier-'0'; OD fp--; ELSE fcount = 1; FI IF *fp==0 THEN break; FI IF exact ANDF dot==savdot ANDF itype==ISP ANDF cursym->n_un.n_name[0]=='_' ANDF *fp=='i' THEN exform(1,"x",itype,ptype); fp++; printc(EOR); /* entry mask */ ELSE fp=exform(fcount,fp,itype,ptype); FI OD dotinc=dot-savdot; dot=savdot; IF errflg THEN IF icount<0 THEN errflg=0; break; ELSE error(errflg); FI FI IF --icount THEN dot=inkdot(dotinc); FI IF mkfault THEN error(0); FI OD } STRING exform(fcount,ifp,itype,ptype) INT fcount; STRING ifp; { /* execute single format item `fcount' times * sets `dotinc' and moves `dot' * returns address of next format item */ POS w; L_INT savdot, wx; STRING fp; CHAR c, modifier, longpr; L_REAL fw; struct{ L_INT sa; INT sb,sc; }; WHILE fcount>0 DO fp = ifp; c = *fp; longpr=(c>='A')&(c<='Z')|(c=='f')|(c=='4')|(c=='p'); IF itype==NSP ORF *fp=='a' THEN wx=dot; w=dot; ELSE w=get(dot,itype); IF longpr THEN wx=itol(get(inkdot(2),itype),w); ELSE wx=w; FI FI IF c=='F' THEN fw.sb=get(inkdot(4),itype); fw.sc=get(inkdot(6),itype); FI IF errflg THEN return(fp); FI IF mkfault THEN error(0); FI var[0]=wx; modifier = *fp++; dotinc=(longpr?4:2);; IF charpos()==0 ANDF modifier!='a' THEN printf("%16m"); FI switch(modifier) { case SP: case TB: break; case 't': case 'T': printf("%T",fcount); return(fp); case 'r': case 'R': printf("%M",fcount); return(fp); case 'a': psymoff(dot,ptype,":%16t"); dotinc=0; break; case 'p': psymoff(var[0],ptype,"%16t"); break; case 'u': printf("%-8u",w); break; case 'U': printf("%-16U",wx); break; case 'c': case 'C': IF modifier=='C' THEN printesc(w&LOBYTE); ELSE printc(w&LOBYTE); FI dotinc=1; break; case 'b': case 'B': printf("%-8o", w&LOBYTE); dotinc=1; break; case '1': printf("%-8r", w&LOBYTE); dotinc=1; break; case '2': case 'w': printf("%-8r", w); break; case '4': case 'W': printf("%-16R", wx); 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': printf("%-8o", w); break; case 'O': printf("%-16O", wx); break; case 'i': printins(0,itype,w); printc(EOR); break; case 'd': printf("%-8d", w); break; case 'D': printf("%-16D", wx); break; case 'f': fw = 0; fw.sa = wx; printf("%-16.9f", fw); dotinc=4; break; case 'F': fw.sa = wx; printf("%-32.18F", fw); dotinc=8; break; case 'n': case 'N': printc('\n'); dotinc=0; break; case '"': dotinc=0; WHILE *fp != '"' ANDF *fp DO printc(*fp++); OD IF *fp THEN fp++; FI break; case '^': dot=inkdot(-dotinc*fcount); return(fp); case '+': dot=inkdot(fcount); return(fp); case '-': dot=inkdot(-fcount); return(fp); default: error(BADMOD); } IF itype!=NSP THEN dot=inkdot(dotinc); FI fcount--; endline(); OD return(fp); } shell() { #ifndef EDDT INT rc, status, unixpid; STRING argp = lp; STRING getenv(), shell = getenv("SHELL"); #ifdef VFORK char oldstlp; #endif if (shell == 0) shell = "/bin/sh"; WHILE lastc!=EOR DO rdc(); OD #ifndef VFORK IF (unixpid=fork())==0 #else oldstlp = *lp; IF (unixpid=vfork())==0 #endif THEN signal(SIGINT,sigint); signal(SIGQUIT,sigqit); *lp=0; execl(shell, "sh", "-c", argp, 0); _exit(16); #ifndef VFORK ELIF unixpid == -1 #else ELIF *lp = oldstlp, unixpid == -1 #endif THEN error(NOFORK); ELSE signal(SIGINT,1); WHILE (rc = wait(&status)) != unixpid ANDF rc != -1 DONE signal(SIGINT,sigint); prints("!"); lp--; FI #endif } printesc(c) { c &= STRIP; IF c==017((7 THEN printf("^?"); ELIF c> 24 THEN error(ADWRAP); FI return(newdot); } digit(c) { return c >= '0' && c <= '9'; } == -1 #else ELIF *lp = oldstlp, unixpid == -1 #endif THEN error(NOFORK); ELSE signal(SIGINT,1); WHILE (rc = wait(&status)) != unixpid ANDF rc != -1 DONE signal(SIGINT,sigint); prints("!"); lp--; FI #endif } printesc(c) { c &= STRIP; IF c==017cmd/adb/head.h 644 0 33 540 2514002101 6336 ADDR maxoff; ADDR localval; struct nlist *symtab, *esymtab; struct nlist *cursym; struct nlist *lookup(); struct exec filhdr; long var[36]; int xargc; MAP txtmap; MAP datmap; INT wtflag; INT fcor; INT fsym; L_INT maxfile; L_INT maxstor; INT signo; union { struct user U; char UU[ctob(UPAGES)]; } udot; #define u udot.U char *corfil, *symfil; ); WHILE (rc = wait(&status)) != unixpid ANDF rc != -1 DONE sign/,5Ȇ< /,"cmd/adb/input.c 644 0 33 2116 2514002101 6610 # /* * * UNIX debugger * */ #include "defs.h" static char sccsid[] = "%Z%%M% %I% %G%"; INT mkfault; CHAR line[LINSIZ]; INT infile; CHAR *lp; CHAR peekc,lastc = EOR; INT eof; /* input routines */ eol(c) CHAR c; { return(c==EOR ORF c==';'); } rdc() { REP readchar(); PER lastc==SP ORF lastc==TB DONE return(lastc); } readchar() { IF eof THEN lastc=0; ELSE IF lp==0 THEN lp=line; REP eof = read(infile,lp,1)==0; IF mkfault THEN error(0); FI PER eof==0 ANDF *lp++!=EOR DONE *lp=0; lp=line; FI IF lastc = peekc THEN peekc=0; ELIF lastc = *lp THEN lp++; FI FI return(lastc); } nextchar() { IF eol(rdc()) THEN lp--; return(0); ELSE return(lastc); FI } quotchar() { IF readchar()=='\\' THEN return(readchar()); ELIF lastc=='\'' THEN return(0); ELSE return(lastc); FI } getformat(deformat) STRING deformat; { REG STRING fptr; REG BOOL quote; fptr=deformat; quote=FALSE; WHILE (quote ? readchar()!=EOR : !eol(readchar())) DO IF (*fptr++ = lastc)=='"' THEN quote = ~quote; FI OD lp--; IF fptr!=deformat THEN *fptr++ = '\0'; FI } p++; FI FI return(lastc); } nextchar() { IF eol(rdc()) THEN lp--; return(0); ELSE return(lastc); FI } quotchar() { IF readchar()=='\\' THEN return(readchar()); ELIF lastc=='\'' THEN return(0); ELSE return(lastc); FI } getformat(deformat) STRING deformat; { REG STRING fptr; REG BOOL quote; fptr=deformat; quote=FALSE; WHILE (quote ? readchar()!=EOR : !eol(readchar())) DO IF (*fptr++ = lastc)=='"' THEN qucmd/adb/mac.h 644 0 33 1221 2514002102 6213 # /* * UNIX debugger */ #define TYPE typedef #define STRUCT struct #define UNION union #define REG register #define BEGIN { #define END } #define IF if( #define THEN ){ #define ELSE } else { #define ELIF } else if ( #define FI } #define FOR for( #define WHILE while( #define DO ){ #define OD } #define REP do{ #define PER }while( #define DONE ); #define LOOP for(;;){ #define POOL } #define SKIP ; #define DIV / #define REM % #define NEQ ^ #define ANDF && #define ORF || #define TRUE (-1) #define FALSE 0 #define LOBYTE 0377 #define HIBYTE 0177400 #define STRIP 0177 #define HEXMSK 017 #define SP ' ' #define TB '\t' #define NL '\n' #define EOF 0 efine IF if( #define THEN ){ #define ELSE } else { #define ELIF } else if ( #define FI } #define FOR for( #define WHILE while( #define DO ){ #define OD } #define REP do{ #define PER }while( #define DONE ); #define LOOP for(;;){ #define POOL } #define SKIP ; #define DIV / #define REM % #define NEQ ^ #define ANDF && #define ORF || #define TRUE (-1) #define FALSE cmd/adb/machine.h 644 0 33 1470 2514002102 7065 #include #define PAGSIZ (NBPG*CLSIZE) #define DBNAME "adb\n" #define LPRMODE "%R" #define OFFMODE "+%R" #define TXTRNDSIZ PAGSIZ #define MAXINT 0x7fffffff #define MAXSTOR ((1L<<31) - ctob(UPAGES)) #define MAXFILE 0xffffffff /* * INSTACK tells whether its argument is a stack address. * INUDOT tells whether its argument is in the (extended) u. area. * These are used for consistency checking and dont have to be exact. * * INKERNEL tells whether its argument is a kernel space address. * KVTOPH trims a kernel virtal address back to its offset * in the kernel address space. */ #define INSTACK(x) (((x)&0xf0000000) == 0x70000000) #define INUDOT(x) (((x)&0xf0000000) == 0x70000000) #define INKERNEL(x) (((x)&0xf0000000) == 0x80000000) #define KVTOPH(x) ((x)&~ 0x80000000) #define KERNOFF 0x80000000 ells whether its argument is in the (extended) u. area. * These are used for consistency checking and dont have to be exact. * * INKERNEL tells whether its argument is a kernel space address. * KVcmd/adb/main.c 644 0 33 3571 2514002102 6404 static char sccsid[] = "%Z%%M% %I% %G%"; /* * adb - main command loop and error/interrupt handling */ #include "defs.h" MSG NOEOR; INT mkfault; INT executing; INT infile; CHAR *lp; L_INT maxoff; L_INT maxpos; ADDR sigint; ADDR sigqit; INT wtflag; L_INT maxfile; STRING errflg; L_INT exitflg; CHAR lastc; INT eof; INT lastcom; long maxoff = MAXOFF; long maxpos = MAXPOS; main(argc, argv) register char **argv; int argc; { mkioptab(); while (argc>1 && eqstr("-w", argv[1])) { wtflag = 2; /* suitable for open() */ argc--, argv++; } if (argc > 1) symfil = argv[1]; if (argc > 2) corfil = argv[2]; xargc = argc; setsym(); setcor(); setvar(); if ((sigint=signal(SIGINT,SIG_IGN)) != SIG_IGN) { sigint = fault; signal(SIGINT, fault); } sigqit = signal(SIGQUIT, SIG_IGN); setexit(); if (executing) delbp(); executing = 0; for (;;) { flushbuf(); if (errflg) { printf("%s\n", errflg); exitflg = errflg; errflg = 0; } if (mkfault) { mkfault=0; printc('\n'); prints(DBNAME); } lp=0; rdc(); lp--; if (eof) { if (infile) { iclose(-1, 0); eof=0; reset(); } else done(); } else exitflg = 0; command(0, lastcom); if (lp && lastc!='\n') error(NOEOR); } } done() { endpcs(); exit(exitflg); } L_INT round(a,b) REG L_INT a, b; { REG L_INT w; w = (a/b)*b; IF a!=w THEN w += b; FI return(w); } /* * If there has been an error or a fault, take the error. */ chkerr() { if (errflg || mkfault) error(errflg); } /* * An error occurred; save the message for later printing, * close open files, and reset to main command loop. */ error(n) char *n; { errflg = n; iclose(0, 1); oclose(); reset(); } /* * An interrupt occurred; reset the interrupt * catch, seek to the end of the current file * and remember that there was a fault. */ fault(a) { signal(a, fault); lseek(infile, 0L, 2); mkfault++; } If there has been an error or a fault, take the error. */ chkerr() { if (errflg || mkfault) error(errflg); } /* * An error occurcmd/adb/message.c 644 0 33 2376 2514002103 7107 # /* * * UNIX debugger * */ #include "mac.h" static char sccsid[] = "%Z%%M% %I% %G%"; #include "mode.h" MSG VERSION = "\nVERSION VM/VAX%I% DATE %G%\n"; MSG BADMOD = "bad modifier"; MSG BADCOM = "bad command"; MSG BADSYM = "symbol not found"; MSG BADLOC = "automatic variable not found"; MSG NOCFN = "c routine not found"; MSG NOMATCH = "cannot locate value"; MSG NOBKPT = "no breakpoint set"; MSG BADKET = "unexpected ')'"; MSG NOADR = "address expected"; MSG NOPCS = "no process"; M((SG BADVAR = "bad variable"; MSG BADTXT = "text address not found"; MSG BADDAT = "data address not found"; MSG ODDADR = "odd address"; MSG EXBKPT = "too many breakpoints"; MSG A68BAD = "bad a68 frame"; MSG A68LNK = "bad a68 link"; MSG ADWRAP = "address wrap around"; MSG BADEQ = "unexpected `='"; MSG BADWAIT = "wait error: process disappeared!"; MSG ENDPCS = "process terminated"; MSG NOFORK = "try again"; MSG BADSYN = "syntax error"; MSG NOEOR = "newline expected"; MSG SZBKPT = "bkpt: command too long"; MSG BADFIL = "bad file format"; MSG BADNAM = "not enough space for symbols"; MSG LONGFIL = "filename too long"; MSG NOTOPEN = "cannot open"; MSG BADMAG = "bad core magic number"; MSG TOODEEP = "$<< nesting too deep"; P = "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 = "cmd/adb/mode.h 644 0 33 1357 2514002103 6412 #include "machine.h" /* * sdb/adb - common definitions for old srb style code */ #define MAXCOM 64 #define MAXARG 32 #define LINSIZ 256 TYPE long ADDR; TYPE short INT; TYPE int VOID; TYPE long int L_INT; TYPE float REAL; TYPE double L_REAL; TYPE unsigned POS; TYPE char BOOL; TYPE char CHAR; TYPE char *STRING; TYPE char MSG[]; TYPE struct map MAP; TYPE MAP *MAPPTR; TYPE struct bkpt BKPT; TYPE BKPT *BKPTR; /* file address maps */ struct map { L_INT b1; L_INT e1; L_INT f1; L_INT b2; L_INT e2; L_INT f2; INT ufd; }; struct bkpt { ADDR loc; ADDR ins; INT count; INT initcnt; INT flag; CHAR comm[MAXCOM]; BKPT *nxtbkpt; }; TYPE struct reglist REGLIST; TYPE REGLIST *REGPTR; struct reglist { STRING rname; INT roffs; }; L_REAL; TYPE unsigned POS; TYPE char BOOL; TYPE char CHAR; TYPE char *STRING; TYPE char MSG[]; TYPE struct map MAP; TYPE MAP *MAPPTR; TYPE struct bkpt BKPT; TYPE BKPT *BKPTR; /* file address maps */ struct map { L_INT b1; L_INT e1; L_INT f1; L_INT b2; L_INT e2cmd/adb/opset.c 644 0 33 13346 2514002105 6636 # /* * * UNIX debugger * */ #include "defs.h" static char sccsid[] = "%Z%%M% %I% %G%"; STRING errflg; L_INT dot; INT dotinc; L_INT var[]; /* instruction printing */ /* * Argument access types */ #define ACCA (8<<3) /* address only */ #define ACCR (1<<3) /* read */ #define ACCW (2<<3) /* write */ #define ACCM (3<<3) /* modify */ #define ACCB (4<<3) /* branch displacement */ #define ACCI (5<<3) /* XFC code */ /* * Argument data types */ #define TYPB 0 /* byte */ #define TYPW 1 /* word */ #define TYPL 2 /* long */ #define TYPQ 3 /* quad */ #define TYPF 4 /* floating */ #define TYPD 5 /* double floating */ TYPE struct optab *OPTAB; struct optab { char *iname; char val; char nargs; char argtype[6]; } optab[]; #define SYSTAB struct systab SYSTAB { int argc; char *sname; } systab[]; STRING regname[]; STRING fltimm[]; POS type, space, incp; int ioptab[256]; /* index by opcode to optab */ mkioptab() {/* set up ioptab */ REG OPTAB p=optab; while (p->iname){ ioptab[p->val&LOBYTE]=p-optab; p++; } } extern char *fmtr; /* not used */ extern char *fmtR; /* not used */ printins(f,idsp,ins) #ifndef vax REG INT ins; #else REG L_INT ins; #endif { short argno; /* argument index */ short mode; /* mode */ char **r; /* register name */ long d; /* assembled byte, word, long or float */ long snarf(); REG char * ap; REG OPTAB ip; type = DSYM; space = idsp; ins &= LOBYTE; ip=optab+ioptab[ins]; printf("%s%8t",ip->iname); incp = 1; ap = ip->argtype; for (argno=0; argnonargs; argno++,ap++) { var[argno] = 0x80000000; if (argno!=0) printc(','); top: if (*ap&ACCB) mode = 0xAF + ((*ap&7)<<5); /* branch displacement */ else{ mode = bchkget(inkdot(incp),idsp); ++incp; } if (mode & 0300) {/* not short literal */ r = ®name[mode&0xF]; mode >>= 4; switch ((int)mode) { case 4: /* [r] */ printf("[%s]",*r); goto top; case 5: /* r */ printf("%s",*r); break; case 6: /* (r) */ printf("(%s)",*r); break; case 7: /* -(r) */ printf("-(%s)",*r); break; case 9: /* *(r)+ */ printc('*'); case 8: /* (r)+ */ if (r==(regname+0xF)) { printc('$'); if (mode==9){ /* PC absolute, always 4 bytes*/ d = snarf(4, idsp); goto disp; } switch(*ap&7){ case TYPB: d = snarf(1, idsp); goto disp; case TYPW: d = snarf(2, idsp); goto disp; case TYPL: d = snarf(4, idsp); goto disp; case TYPQ: d = snarf(4, idsp); printquad(d, snarf(4, idsp)); break; case TYPF: printfloating(TYPF, snarf(4, idsp), 0); break; case TYPD: d = snarf(4, idsp); printfloating(TYPQ, d, snarf(4, idsp)); break; } /*end of type switch */ /* * here only for TYPQ, TYPf, TYPD * others went to disp */ } else { /*it's not PC immediate or abs*/ printf("(%s)+",*r); } break; case 0xB: /* byte displacement defferred*/ printc('*'); case 0xA: /* byte displacement */ d = snarf(1, idsp); goto disp; case 0xD: /* word displacement deferred */ printc('*'); case 0xC: /* word displacement */ d = snarf(2, idsp); goto disp; case 0xF: /* long displacement deferred */ printc('*'); case 0xE: /* long displacement */ d = snarf(4, idsp); goto disp; disp: var[argno]=d; if (r==(regname+0xF) && mode>=0xA){ /* PC offset addressing */ var[argno] += dot+incp; } psymoff(var[argno],type,""); if (r != regname+0xF) printf("(%s)",*r); break; } /* end of the mode switch */ } else { /* short literal */ var[argno]=mode; if( (*ap&7)==TYPF || (*ap&7)==TYPD) printf("$%s",fltimm[mode]); else printf("$%r",mode); } } if (ins==0xCF || ins==0xAF || ins==0x8F) {/* CASEx instr */ for (argno=0; argno<=var[2]; ++argno) { printc(EOR); printf(" %R: ",argno+var[1]); d=get(inkdot(incp+argno+argno),idsp)&0xFFFF; if (d&0x8000) d -= 0x10000; psymoff(inkdot(incp)+d,type,""); } incp += var[2]+var[2]+2; } dotinc=incp; } /* * magic values to mung an offset to a register into * something that psymoff can understand.. all magic */ /* 0 1 2 3 4 */ static long magic_masks[5] = {0, 0x80, 0x8000, 0, 0}; static long magic_compl[5] = {0, 0x100, 0x10000,0, 0}; /* * The following code is NO LONGER portable from the PDP 11 to the VAX */ long snarf (nbytes, idsp) int nbytes; { register int byteindex; union Long{ char long_bytes[4]; long long_value; } d; d.long_value = 0; for (byteindex = 0; byteindex < nbytes; byteindex++){ d.long_bytes[byteindex] = bchkget(inkdot(incp), idsp); ++incp; } if (d.long_value & magic_masks[nbytes]) d.long_value -= magic_compl[nbytes]; return(d.long_value); } printfloating(type, word_first, word_last) int type; long word_first; long word_last; { union Double{ struct { long word_first; long word_last; } composite; double dvalue; } reconstructed; reconstructed.composite.word_first = word_first; reconstructed.composite.word_last = word_last; printf( "%f", reconstructed.dvalue); } printquad(word_first, word_last) long word_first; long word_last; { union Quad { char quad_bytes[8]; long quad_long[2]; } reconstructed; int leading_zero = 1; int byteindex; int nibbleindex; register int ch; reconstructed.quad_long[0] = word_first; reconstructed.quad_long[1] = word_last; for (byteindex = 7; byteindex >= 0; --byteindex){ for (nibbleindex = 4; nibbleindex >= 0; nibbleindex -= 4){ ch = (reconstructed.quad_bytes[byteindex] >> nibbleindex) & 0x0F; if ( ! (leading_zero &= (ch == 0) ) ){ if (ch <= 0x09) printc(ch + '0'); else printc(ch - 0x0A + 'a'); } } } } ad_long[2]; } reconstructed; int leading_zero = 1; int byteindex; int nibbleindex; register int ch; reconstructed.quad_long[0] = word_first; reconstructed.quad_long[1] = word_last; for (byteindex = 7; byteindex >= 0; --byteindex){ for (nibbleindex = 4; nibbleindex >= 0; cmd/adb/optab.c 644 0 33 4321 2514002105 6562 #include "defs.h" static char sccsid[] = "%Z%%M% %I% %G%"; /* * Argument access types */ #define ACCA (8<<3) /* address only */ #define ACCR (1<<3) /* read */ #define ACCW (2<<3) /* write */ #define ACCM (3<<3) /* modify */ #define ACCB (4<<3) /* branch displacement */ #define ACCI (5<<3) /* XFC code */ /* * Argument data types */ #define TYPB 0 /* byte */ #define TYPW 1 /* word */ #define TYPL 2 /* long */ #define TYPQ 3 /* quad */ #define TYPF 4 /* floating */ #define TYPD 5 /* double floating */ T((YPE struct optab *OPTAB; struct optab { char *iname; char val; char nargs; char argtype[6]; } optab[] = { #define OP(a,b,c,d,e,f,g,h,i) {a,b,c,d,e,f,g,h,i} #include "../as/instrs" 0}; #define SYSTAB struct systab SYSTAB { int argc; char *sname; } systab[] = { 1, "indir", 0, "exit", 0, "fork", 2, "read", 2, "write", 2, "open", 0, "close", 0, "wait", 2, "creat", 2, "link", 1, "unlink", 2, "exec", 1, "chdir", 0, "time", 3, "mknod", 2, "chmod", 2, "chown", 1, "break", 2, "stat", 2, "seek", 0, "getpid", 3, "mount", 1, "umount", 0, "setuid", 0, "getuid", 0, "stime", 3, "ptrace", 0, "alarm", 1, "fstat", 0, "pause", 1, "30", 1, "stty", 1, "gtty", 0, "access", 0, "nice", 0, "sleep", 0, "sync", 1, "kill", 0, "csw", 0, "setpgrp", 0, "tell", 0, "dup", 0, "pipe", 1, "times", 4, "profil", 0, "tiu", 0, "setgid", 0, "getgid", 2, "signal", 0, "49", 0, "50", 0, "51", 0, "52", 0, "53", 0, "54", 0, "55", 0, "56", 0, "57", 0, "58", 0, "59", 0, "60", 0, "61", 0, "62", 0, "63", }; STRING regname[] = { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10","r11","ap", "fp", "sp", "pc"}; STRING fltimm[] = { "0.5", "0.5625", "0.625", "0.6875", "0.75", "0.8125", "0.875", "0.9375", "1.0", "1.125", "1.25", "1.375", "1.5", "1.625", "1.75", "1.875", "2.0", "2.25", "2.5", "2.75", "3.0", "3.25", "3.5", "3.75", "4.0", "4.5", "5.0", "5.5", "6.0", "6.5", "7.0", "7.5", "8.0", "9.0", "10.0", "11.0", "12.0", "13.0", "14.0", "15.0", "16.0", "18.0", "20.0", "22.0", "24.0", "26.0", "28.0", "30.0", "32.0", "36.0", "40.0", "44.0", "48.0", "52.0", "56.0", "60.0", "64.0", "72.0", "80.0", "88.0", "96.0", "104.0", "112.0", "120.0" }; char *fmtr = {"%r"}; char *fmtR = {"%R"}; 0.8125", "0.875", "0.9375", "1.0", "1.125", "1.25", "1.375", "1.5", "1.625", "1.75", "1.875", "2.0", "2.25", "2.5", "2.75", "3.0", "3.25", "3.5", "3.75", "4.0", "4.5", "5.0", "5.5", "6.0", "6.5", "7.0", "7.5", "8.0", "9.0", "10.0", "11.0", "12.0", "13.0", "14.0", "15.0", "16.0", "18.0", "20.0", "22.0",cmd/adb/output.c 644 0 33 14163 2514002110 7036 # /* * * UNIX debugger * */ #include "defs.h" static char sccsid[] = "%Z%%M% %I% %G%"; #include INT mkfault; INT infile; INT outfile = 1; L_INT maxpos; L_INT maxoff; INT radix = 16; CHAR printbuf[MAXLIN]; CHAR *printptr = printbuf; CHAR *digitptr; eqstr(s1, s2) REG STRING s1, s2; { REG STRING es1; WHILE *s1++ == *s2 DO IF *s2++ == 0 THEN return(1); FI OD return(0); } length(s) REG STRING s; { INT n = 0; WHILE *s++ DO n++; OD return(n); } printc(c) CHAR c; { CHAR d; STRING q; INT posn, tabs, p; IF mkfault THEN return; ELIF (*printptr=c)==EOR THEN tabs=0; posn=0; q=printbuf; FOR p=0; p0 DO *q++=TB; tabs--; OD WHILE posn>0 DO *q++=SP; posn--; OD *q++=d; FI OD *q++=EOR; #ifdef EDDT printptr=printbuf; do putchar(*printptr++); while (printptr0 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; #endif #endif case 'm': vptr--; break; case 'M': width=x; break; case 'T': case 't': IF c=='T' THEN width=x; #ifndef vax ELSE vptr--; #else ELSE dptr--; #endif FI IF width THEN width -= charpos()%width; FI break; default: #ifndef vax printc(c); vptr--; #else printc(c); dptr--; #endif } IF s==0 THEN *digitptr=0; s=digits; FI n=length(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) L_INT tvec; { REG INT i; REG STRING timeptr; #ifndef EDDT timeptr = ctime(&tvec); #else timeptr="????????????????????????"; #endif FOR i=20; i<24; i++ DO *digitptr++ = *(timeptr+i); OD FOR i=3; i<19; i++ DO *digitptr++ = *(timeptr+i); OD } /*printdate*/ prints(s) char *s; { printf("%s",s); } newline() { printc(EOR); } convert(cp) REG STRING *cp; { REG CHAR c; INT n; n=0; WHILE ((c = *(*cp)++)>='0') ANDF (c<='9') DO n=n*10+c-'0'; OD (*cp)--; return(n); } printnum(n,fmat,base) REG INT n; { REG CHAR k; REG INT *dptr; INT digs[15]; dptr=digs; IF n<0 ANDF fmat=='d' THEN n = -n; *digitptr++ = '-'; FI n &= 0xffff; WHILE n DO *dptr++ = ((POS)(n&0xffff))%base; n=((POS)(n&0xffff))/base; OD IF dptr==digs THEN *dptr++=0; FI WHILE dptr!=digs DO k = *--dptr; *digitptr++ = (k+(k<=9 ? '0' : 'a'-10)); OD } printoct(o,s) L_INT o; INT s; { INT i; L_INT po = o; CHAR digs[12]; IF s THEN IF po<0 THEN po = -po; *digitptr++='-'; ELSE IF s>0 THEN *digitptr++='+'; FI FI FI FOR i=0;i<=11;i++ DO digs[i] = po&7; po >>= 3; OD digs[10] &= 03; digs[11]=0; FOR i=11;i>=0;i-- DO IF digs[i] THEN break; FI OD FOR i++;i>=0;i-- DO *digitptr++=digs[i]+'0'; OD } #ifndef vax printdbl(lx,ly,fmat,base) INT lx, ly; char fmat; int base; #else printdbl(lxy,fmat,base) L_INT lxy; char fmat; int base; #endif { int digs[20]; int *dptr; char k; #ifndef MULD2 register char *cp1; cp1=digs; if ((lxy&0xFFFF0000L)==0xFFFF0000L) {*cp1++='-'; lxy= -lxy;} sprintf(cp1,base==16 ? "%X" : "%D",lxy); cp1=digs; while (*digitptr++= *cp1++); --digitptr; #else L_REAL f ,g; long q; #ifdef vax INT lx,ly; ly=lxy; lx=(lxy>>16)&0xFFFF; #endif dptr=digs; IF fmat=='D' ORF fmat=='r' THEN f=itol(lx,ly); IF f<0 THEN *digitptr++='-'; f = -f; FI ELSE IF lx==-1 THEN *digitptr++='-'; f=leng(-ly); ELSE f=leng(lx); f *= itol(1,0); f += leng(ly); FI IF fmat=='x' THEN *digitptr++='#'; FI FI WHILE f DO q=f/base; g=q; *dptr++ = f-g*base; f=q; OD IF dptr==digs ORF dptr[-1]>9 THEN *dptr++=0; FI WHILE dptr!=digs DO k = *--dptr; *digitptr++ = (k+(k<=9 ? '0' : 'a'-10)); OD #endif } iclose() { IF infile THEN close(infile); infile=0; FI } oclose() { IF outfile!=1 THEN flushbuf(); close(outfile); outfile=1; FI } endline() { if (maxpos <= charpos()) printf("\n"); } ly); ELSE f=leng(lx); f *= itol(1,0); f += leng(ly); FI IF fmat=='x' THEN *digitptr++='#'; FI FI WHILE f DO q=f/base; g=q; *dptr++ = f-g*base; f=q; OD IF dptr==digs ORF dptr[-1]>9 THEN *dptr++=0; FI WHILE dptr!=digs DO k = *--dptr; *digitptr++ = (k+(k<=9 ? '0' : 'a'-10)); OD #endif } iclose() { IF infile THEN close(infile); infile=0; FI } oclose() { IF outficmd/adb/pcs.c 644 0 33 4034 2514002111 6240 # /* * * UNIX debugger * */ #include "defs.h" static char sccsid[] = "%Z%%M% %I% %G%"; MSG NOBKPT; MSG SZBKPT; MSG EXBKPT; MSG NOPCS; MSG BADMOD; /* breakpoints */ BKPTR bkpthead; CHAR *lp; CHAR lastc; INT signo; L_INT dot; INT pid; L_INT cntval; L_INT loopcnt; L_INT entrypt; INT adrflg; /* sub process control */ subpcs(modif) { REG INT check; INT execsig,runmode; REG BKPTR bkptr; STRING comptr; execsig=0; loopcnt=cntval; switch (modif) { /* delete breakpoint */(( case 'd': case 'D': IF (bkptr=scanbkpt(dot)) THEN bkptr->flag=0; return; ELSE error(NOBKPT); FI /* set breakpoint */ case 'b': case 'B': IF (bkptr=scanbkpt(dot)) THEN bkptr->flag=0; FI FOR bkptr=bkpthead; bkptr; bkptr=bkptr->nxtbkpt DO IF bkptr->flag == 0 THEN break; FI OD IF bkptr==0 THEN IF (bkptr=sbrk(sizeof *bkptr)) == -1 THEN error(SZBKPT); ELSE bkptr->nxtbkpt=bkpthead; bkpthead=bkptr; FI FI bkptr->loc = dot; bkptr->initcnt = bkptr->count = cntval; bkptr->flag = BKPTSET; check=MAXCOM-1; comptr=bkptr->comm; rdc(); lp--; REP *comptr++ = readchar(); PER check-- ANDF lastc!=EOR DONE *comptr=0; lp--; IF check THEN return; ELSE error(EXBKPT); FI /* exit */ case 'k' :case 'K': IF pid THEN printf("%d: killed", pid); endpcs(); return; FI error(NOPCS); /* run program */ case 'r': case 'R': endpcs(); setup(); runmode=CONTIN; IF adrflg THEN IF !scanbkpt(dot) THEN loopcnt++; FI ELSE IF !scanbkpt(entrypt+2) THEN loopcnt++; FI FI break; /* single step */ case 's': case 'S': IF pid THEN runmode=SINGLE; execsig=getsig(signo); ELSE setup(); loopcnt--; FI break; /* continue with optional signal */ case 'c': case 'C': case 0: IF pid==0 THEN error(NOPCS); FI runmode=CONTIN; execsig=getsig(signo); break; default: error(BADMOD); } IF loopcnt>0 ANDF runpcs(runmode,execsig) THEN printf("breakpoint%16t"); ELSE printf("stopped at%16t"); FI delbp(); printpc(); } ) THEN loopcnt++; FI FI break; /* single step */ case 's': case 'S': IF pid THEN runmode=SINGLE; execsig=getsig(signo); ELSE setup(); loopcnt--; FI break; /* continue with optional signal */ case 'c': case 'C': case 0: IF pid==0 THEN error(NOPCS); FI runmode=CONTIN; execsig=getsig(signo); break; default: error(BADMOD); } IF loopcnt>0 ANDF runpcs(runmode,execsig) THEN printf("breakpoint%16t"); ELSE printf("stopped at%16t"); cmd/adb/print.c 644 0 33 17007 2514002113 6635 static char sccsid[] = "%Z%%M% %I% %G%"; /* * * UNIX debugger * */ #include "defs.h" MSG LONGFIL; MSG NOTOPEN; MSG A68BAD; MSG A68LNK; MSG BADMOD; MAP txtmap; MAP datmap; ADDR lastframe; ADDR callpc; INT infile; INT outfile; CHAR *lp; L_INT maxoff; L_INT maxpos; INT radix; /* symbol management */ L_INT localval; /* breakpoints */ BKPTR bkpthead; REGLIST reglist [] = { "p1lr", P1LR, "p1br",P1BR, "p0lr", P0LR, "p0br",P0BR, "ksp",KSP, "esp",ESP, "ssp",SSP, "psl", PSL, "pc", PC, "usp",USP, "fp", FP, "ap", AP, "r11", R11, "r10", R10, "r9", R9, "r8", R8, "r7", R7, "r6", R6, "r5", R5, "r4", R4, "r3", R3, "r2", R2, "r1", R1, "r0", R0, }; char lastc; INT fcor; STRING errflg; INT signo; INT sigcode; L_INT dot; L_INT var[]; STRING symfil; STRING corfil; INT pid; L_INT adrval; INT adrflg; L_INT cntval; INT cntflg; STRING signals[] = { "", "hangup", "interrupt", "quit", "illegal instruction", "trace/BPT", "IOT", "EMT", "floating exception", "killed", "bus error", "memory fault", "bad system call", "broken pipe", "alarm call", "terminated", "signal 16", "stop (signal)", "stop (tty)", "continue (signal)", "child termination", "stop (tty input)", "stop (tty output)", "input available (signal)", "cpu timelimit", "file sizelimit", "signal 26", "signal 27", "signal 28", "signal 29", "signal 30", "signal 31", }; /* general printing routines ($) */ printtrace(modif) { INT narg, i, stat, name, limit; POS dynam; REG BKPTR bkptr; CHAR hi, lo; ADDR word; STRING comptr; ADDR argp, frame, link; register struct nlist *sp; INT stack; INT ntramp; 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 through */ case '>': {CHAR file[64]; INT index; index=0; IF modif=='<' THEN iclose(stack, 0); ELSE oclose(); FI IF rdc()!=EOR THEN REP file[index++]=lastc; IF index>=63 THEN error(LONGFIL); FI PER readchar()!=EOR DONE file[index]=0; IF modif=='<' THEN infile=open(file,0); IF infile<0 THEN infile=0; error(NOTOPEN); ELSE IF cntflg THEN var[9] = cntval; ELSE var[9] = 1; FI FI ELSE outfile=open(file,1); IF outfile<0 THEN outfile=creat(file,0644); #ifndef EDDT ELSE lseek(outfile,0L,2); #endif FI FI ELSE IF modif == '<' THEN iclose(-1, 0); FI FI lp--; } break; case 'd': if (adrflg) { if (adrval<2 || adrval>16) {printf("must have 2 <= radix <= 16"); break;} printf("radix=%d base ten",radix=adrval); } break; case 'q': case 'Q': case '%': done(); case 'w': case 'W': maxpos=(adrflg?adrval:MAXPOS); break; case 's': case 'S': maxoff=(adrflg?adrval:MAXOFF); break; case 'v': case 'V': prints("variables\n"); FOR i=0;i<=35;i++ DO IF var[i] THEN printc((i<=9 ? '0' : 'a'-10) + i); printf(" = %Q\n",var[i]); FI OD break; case 'm': case 'M': printmap("? map",&txtmap); printmap("/ map",&datmap); break; case 0: case '?': IF pid THEN printf("pcs id = %d\n",pid); ELSE prints("no process\n"); FI sigprint(); flushbuf(); case 'r': case 'R': printregs(); return; case 'c': case 'C': IF adrflg THEN frame=adrval; word=get(adrval+6,DSP)&0xFFFF; IF word&0x2000 THEN /* 'calls', can figure out argp */ argp=adrval+20+((word>>14)&3); word &= 0xFFF; WHILE word DO IF word&1 THEN argp+=4; FI word>>=1; OD ELSE /* 'callg', can't tell where argp is */ argp=frame; FI callpc=get(frame+16,DSP); ELSE argp= *(ADDR *)(((ADDR)&u)+AP); frame= *(ADDR *)(((ADDR)&u)+FP); callpc= *(ADDR *)(((ADDR)&u)+PC); FI lastframe=0; ntramp = 0; WHILE cntval-- DO char *name; chkerr(); if (callpc > 0x80000000 - 0x200 * UPAGES) { name = "sigtramp"; ntramp++; } else { ntramp = 0; findsym(callpc,ISYM); if (cursym && !strcmp(cursym->n_un.n_name, "start")) break; if (cursym) name = cursym->n_un.n_name; else name = "?"; } printf("%s(", name); narg = get(argp,DSP); IF narg&~0xFF THEN narg=0; FI LOOP IF narg==0 THEN break; FI printf("%R", get(argp += 4, DSP)); IF --narg!=0 THEN printc(','); FI POOL printf(") from %X\n",callpc); /* jkf mod */ IF modif=='C' THEN WHILE localsym(frame,argp) DO word=get(localval,DSP); printf("%8t%s:%10t", cursym->n_un.n_name); IF errflg THEN prints("?\n"); errflg=0; ELSE printf("%R\n",word); FI OD FI if (ntramp == 1) callpc=get(frame+64, DSP); else callpc=get(frame+16, DSP); argp=get(frame+8, DSP); lastframe=frame; frame=get(frame+12, DSP)&EVEN; IF frame==0 ORF (!adrflg ANDF !INSTACK(frame)) THEN break; FI OD break; /*print externals*/ case 'e': case 'E': for (sp = symtab; sp < esymtab; sp++) { if (sp->n_type==(N_DATA|N_EXT) ORF sp->n_type==(N_BSS|N_EXT)) printf("%s:%12t%R\n", sp->n_un.n_name, get(sp->n_value,DSP)); } break; case 'a': case 'A': error("No algol 68 on VAX"); /*NOTREACHED*/ /*print breakpoints*/ case 'b': case 'B': printf("breakpoints\ncount%8tbkpt%24tcommand\n"); for (bkptr=bkpthead; bkptr; bkptr=bkptr->nxtbkpt) if (bkptr->flag) { printf("%-8.8d",bkptr->count); psymoff(leng(bkptr->loc),ISYM,"%24t"); comptr=bkptr->comm; WHILE *comptr DO printc(*comptr++); OD } break; default: error(BADMOD); } } printmap(s,amap) STRING s; MAP *amap; { int file; file=amap->ufd; printf("%s%12t`%s'\n",s,(file<0 ? "-" : (file==fcor ? corfil : symfil))); printf("b1 = %-16R",amap->b1); printf("e1 = %-16R",amap->e1); printf("f1 = %-16R",amap->f1); printf("\nb2 = %-16R",amap->b2); printf("e2 = %-16R",amap->e2); printf("f2 = %-16R",amap->f2); printc(EOR); } printregs() { REG REGPTR p; L_INT v; FOR p=reglist; p < ®list[24]; p++ DO printf("%s%6t%R %16t", p->rname, v= *(ADDR *)(((ADDR)&u)+p->roffs)); valpr(v,(p->roffs==PC?ISYM:DSYM)); printc(EOR); OD printpc(); } getreg(regnam) { REG REGPTR p; REG STRING regptr; CHAR *olp; CHAR regnxt; olp=lp; FOR p=reglist; p < ®list[24]; p++ DO regptr=p->rname; IF (regnam == *regptr++) THEN WHILE *regptr DO IF (regnxt=readchar()) != *regptr++ THEN --regptr; break; FI OD IF *regptr THEN lp=olp; ELSE return(p->roffs); FI FI OD lp=olp; return(0); } printpc() { dot= *(ADDR *)(((ADDR)&u)+PC); psymoff(dot,ISYM,":%16t"); printins(0,ISP,chkget(dot,ISP)); printc(EOR); } char *illinames[] = { "reserved addressing fault", "priviliged instruction fault", "reserved operand fault" }; char *fpenames[] = { 0, "integer overflow trap", "integer divide by zero trap", "floating overflow trap", "floating/decimal divide by zero trap", "floating underflow trap", "decimal overflow trap", "subscript out of range trap", "floating overflow fault", "floating divide by zero fault", "floating undeflow fault" }; sigprint() { IF (signo>=0) ANDF (signo 0 && sigcode < sizeof fpenames / sizeof fpenames[0]) THEN prints(" ("); prints(fpenames[sigcode]); prints(")"); FI break; case SIGILL: IF (sigcode >= 0 && sigcode < sizeof illinames / sizeof illinames[0]) THEN prints(" ("); prints(illinames[sigcode]); prints(")"); FI break((; } } y zero fault", "floating undeflow fault" }; sigprint() { IF (signo>=0) ANDF (signo 0 && sigcode < sizeof fpenames / sizeof fpenames[0]) THEN prints(" ("); prints(fpenames[sigcode]); prints(")"); FI break; case SIGILL: IF (sigcode >= 0 && sigcode < sizeof illinames / sizeof illinames[0]) THEN prints(" ("); prints(illinames[sigcode]); prints(")"); FI breakcmd/adb/runpcs.c 644 0 33 13264 2663071556 7042 # /* * * UNIX debugger * */ #include "defs.h" static char sccsid[] = "@(#)runpcs.c 4.2 2/13/82"; extern MAP txtmap; MSG NOFORK; MSG ENDPCS; MSG BADWAIT; CHAR *lp; ADDR sigint; ADDR sigqit; /* breakpoints */ BKPTR bkpthead; REGLIST reglist[]; CHAR lastc; INT fcor; INT fsym; STRING errflg; INT errno; INT signo; INT sigcode; L_INT dot; STRING symfil; INT wtflag; L_INT pid; L_INT expv; INT adrflg; L_INT loopcnt; /* service routines for sub process control */ getsig(sig) { return(expr(0) ? expv : sig); } ADDR userpc = 1; runpcs(runmode,execsig) { INT rc; REG BKPTR bkpt; IF adrflg THEN userpc=dot; FI printf("%s: running\n", symfil); WHILE --loopcnt>=0 DO #ifdef DEBUG printf("\ncontinue %x %d\n",userpc,execsig); #endif IF runmode==SINGLE THEN delbp(); /* hardware handles single-stepping */ ELSE /* continuing from a breakpoint is hard */ IF bkpt=scanbkpt(userpc) THEN execbkpt(bkpt,execsig); execsig=0; FI setbp(); FI ptrace(runmode,pid,userpc,execsig); bpwait(); chkerr(); execsig=0; delbp(); readregs(); IF (signo==0) ANDF (bkpt=scanbkpt(userpc)) THEN /* stopped by BPT instruction */ #ifdef DEBUG printf("\n BPT code; '%s'%o'%o'%d", bkpt->comm,bkpt->comm[0],EOR,bkpt->flag); #endif dot=bkpt->loc; IF bkpt->flag==BKPTEXEC ORF ((bkpt->flag=BKPTEXEC) ANDF bkpt->comm[0]!=EOR ANDF command(bkpt->comm,':') ANDF --bkpt->count) THEN execbkpt(bkpt,execsig); execsig=0; loopcnt++; ELSE bkpt->count=bkpt->initcnt; rc=1; FI ELSE execsig=signo; rc=0; FI OD return(rc); } #define BPOUT 0 #define BPIN 1 INT bpstate = BPOUT; endpcs() { REG BKPTR bkptr; IF pid THEN ptrace(EXIT,pid,0,0); pid=0; userpc=1; FOR bkptr=bkpthead; bkptr; bkptr=bkptr->nxtbkpt DO IF bkptr->flag THEN bkptr->flag=BKPTSET; FI OD FI bpstate=BPOUT; } #ifdef VFORK nullsig() { } #endif setup() { close(fsym); fsym = -1; #ifndef VFORK IF (pid = fork()) == 0 #else IF (pid = vfork()) == 0 #endif THEN ptrace(SETTRC,0,0,0); #ifdef VFORK signal(SIGTRAP,nullsig); #endif signal(SIGINT,sigint); signal(SIGQUIT,sigqit); doexec(); exit(0); ELIF pid == -1 THEN error(NOFORK); ELSE bpwait(); readregs(); lp[0]=EOR; lp[1]=0; fsym=open(symfil,wtflag); IF errflg THEN printf("%s: cannot execute\n",symfil); endpcs(); error(0); FI FI bpstate=BPOUT; } execbkpt(bkptr,execsig) BKPTR bkptr; { #ifdef DEBUG printf("exbkpt: %d\n",bkptr->count); #endif delbp(); ptrace(SINGLE,pid,bkptr->loc,execsig); bkptr->flag=BKPTSET; bpwait(); chkerr(); readregs(); } doexec() { STRING argl[MAXARG]; CHAR args[LINSIZ]; STRING p, *ap, filnam; extern STRING environ; ap=argl; p=args; *ap++=symfil; REP IF rdc()==EOR THEN break; FI *ap = p; /* * First thing is to look for direction characters * and get filename. Do not use up the args for filenames. * Then get rid of spaces before next args. */ IF lastc=='<' THEN REP readchar(); PER lastc==SP ORF lastc==TB DONE filnam = p; WHILE lastc!=EOR ANDF lastc!=SP ANDF lastc!=TB ANDF lastc!='>' DO *p++=lastc; readchar(); OD *p = 0; close(0); IF open(filnam,0)<0 THEN printf("%s: cannot open\n",filnam); _exit(0); FI p = *ap; ELIF lastc=='>' THEN REP readchar(); PER lastc==SP ORF lastc==TB DONE filnam = p; WHILE lastc!=EOR ANDF lastc!=SP ANDF lastc!=TB ANDF lastc!='<' DO *p++=lastc; readchar(); OD *p = '\0'; close(1); IF creat(filnam,0666)<0 THEN printf("%s: cannot create\n",filnam); _exit(0); FI p = *ap; ELSE WHILE lastc!=EOR ANDF lastc!=SP ANDF lastc!=TB ANDF lastc!='>' ANDF lastc!='<' DO *p++=lastc; readchar(); OD *p++ = '\0'; ap++; FI WHILE lastc==SP ORF lastc==TB DO readchar(); OD PER lastc!=EOR DONE *ap++=0; exect(symfil, argl, environ); perror(symfil); } BKPTR scanbkpt(adr) ADDR adr; { REG BKPTR bkptr; FOR bkptr=bkpthead; bkptr; bkptr=bkptr->nxtbkpt DO IF bkptr->flag ANDF bkptr->loc==adr THEN break; FI OD return(bkptr); } delbp() { REG ADDR a; REG BKPTR bkptr; IF bpstate!=BPOUT THEN FOR bkptr=bkpthead; bkptr; bkptr=bkptr->nxtbkpt DO IF bkptr->flag THEN a=bkptr->loc; IF a < txtmap.e1 THEN ptrace(WIUSER,pid,a, (bkptr->ins&0xFF)|(ptrace(RIUSER,pid,a,0)&~0xFF)); ELSE ptrace(WDUSER,pid,a, (bkptr->ins&0xFF)|(ptrace(RDUSER,pid,a,0)&~0xFF)); FI FI OD bpstate=BPOUT; FI } setbp() { REG ADDR a; REG BKPTR bkptr; IF bpstate!=BPIN THEN FOR bkptr=bkpthead; bkptr; bkptr=bkptr->nxtbkpt DO IF bkptr->flag THEN a = bkptr->loc; IF a < txtmap.e1 THEN bkptr->ins = ptrace(RIUSER, pid, a, 0); ptrace(WIUSER, pid, a, BPT | (bkptr->ins&~0xFF)); ELSE bkptr->ins = ptrace(RDUSER, pid, a, 0); ptrace(WDUSER, pid, a, BPT | (bkptr->ins&~0xFF)); FI IF errno THEN prints("cannot set breakpoint: "); psymoff(bkptr->loc,ISYM,"\n"); FI FI OD bpstate=BPIN; FI } bpwait() { REG ADDR w; ADDR stat; signal(SIGINT, 1); WHILE (w = wait(&stat))!=pid ANDF w != -1 DONE signal(SIGINT,sigint); IF w == -1 THEN pid=0; errflg=BADWAIT; ELIF (stat & 0177) != 0177 THEN sigcode = 0; IF signo = stat&0177 THEN sigprint(); FI IF stat&0200 THEN prints(" - core dumped"); close(fcor); setcor(); FI pid=0; errflg=ENDPCS; ELSE signo = stat>>8; sigcode = ptrace(RUREGS, pid, &((struct user *)0)->u_code, 0); IF signo!=SIGTRAP THEN sigprint(); ELSE signo=0; FI flushbuf(); FI } readregs() { /*get REG values from pcs*/ REG i; FOR i=24; --i>=0; DO *(ADDR *)(((ADDR)&u)+reglist[i].roffs) = ptrace(RUREGS, pid, reglist[i].roffs, 0); OD userpc= *(ADDR *)(((ADDR)&u)+PC); } THEN prints(" - core dumped"); close(fcor); setcor(); FI pid=0; errflg=ENDPCS; ELSE signo = stat>>8; sigcode = ptrace(RUREGS, pid, &((struct user *)0)->u_code, 0); IF signo!=SIGTRAP THEN sigprint(); ELSE signo=0; FI flushbuf(); FI } readregs() { /*get REG valcmd/adb/setup.c 664 0 33 7374 2514002115 6633 static char sccsid[] = "%Z%%M% %I% %G%"; /* * adb - routines to read a.out+core at startup */ #include "defs.h" #include off_t datbas; /* offset of the base of the data segment */ off_t stksiz; /* stack size in the core image */ INT sigcode; /* belongs in head.h */ char *symfil = "a.out"; char *corfil = "core"; setsym() { off_t loc; struct exec hdr; register struct nlist *sp; int ssiz; char *strtab; fsym = getfile(symfil, 1); txtmap.ufd = fsym; if (read(fsym, (char *)&hdr, sizeof hdr) != sizeof hdr || N_BADMAG(hdr)) { txtmap.e1 = MAXFILE; return; } filhdr = hdr; loc = filhdr.a_text+filhdr.a_data; txtmap.f1 = txtmap.f2 = N_TXTOFF(filhdr); txtmap.b1 = 0; switch (filhdr.a_magic) { case OMAGIC: txtmap.b1 = txtmap.e1 = 0; txtmap.b2 = datbas = 0; txtmap.e2 = loc; break; case ZMAGIC: case NMAGIC: txtmap.e1 = filhdr.a_text; txtmap.b2 = datbas = round(filhdr.a_text, PAGSIZ); txtmap.e2 = datbas + filhdr.a_data; txtmap.f2 += txtmap.e1; } loc = N_SYMOFF(filhdr); symtab = (struct nlist *) malloc(filhdr.a_syms); esymtab = &symtab[filhdr.a_syms / sizeof (struct nlist)]; if (symtab == NULL) goto nospac; lseek(fsym, loc, 0); if (filhdr.a_syms == 0) goto nosymt; /* SHOULD SQUISH OUT STABS HERE!!! */ if (read(fsym, symtab, filhdr.a_syms) != filhdr.a_syms) goto readerr; if (read(fsym, &ssiz, sizeof (ssiz)) != sizeof (ssiz)) goto oldfmt; strtab = (char *) malloc(ssiz); if (strtab == 0) goto nospac; *(int *)strtab = ssiz; ssiz -= sizeof (ssiz); if (read(fsym, strtab + sizeof (ssiz), ssiz) != ssiz) goto readerr; for (sp = symtab; sp < esymtab; sp++) if (sp->n_strx) /* SHOULD PERFORM RANGE CHECK HERE */ sp->n_un.n_name = strtab + sp->n_un.n_strx; nosymt: if (INKERNEL(filhdr.a_entry)) { txtmap.b1 += KERNOFF; txtmap.e1 += KERNOFF; txtmap.b2 += KERNOFF; txtmap.e2 += KERNOFF; } return; readerr: printf("Error reading symbol|string table\n"); exit(1); nospac: printf("Not enough space for symbol|string table\n"); exit(1); oldfmt: printf("Old format a.out - no string table\n"); exit(1); } setcor() { fcor = datmap.ufd = getfile(corfil,2); if (fcor != -1 && INKERNEL(filhdr.a_entry)) { struct stat stb; fstat(fcor, &stb); datmap.b1 = 0; datmap.e1 = -1; if ((stb.st_mode&S_IFMT) == S_IFREG) datmap.b1 = 0x80000000; return; } if (read(fcor, (char *)&u, ctob(UPAGES))!=ctob(UPAGES) || !INUDOT(u.u_pcb.pcb_ksp) || !INSTACK(u.u_pcb.pcb_usp)) { datmap.e1 = MAXFILE; return; } signo = u.u_arg[0]; sigcode = u.u_code;(( filhdr.a_text = ctob(u.u_tsize); filhdr.a_data = ctob(u.u_dsize); stksiz = ctob(u.u_ssize); switch (filhdr.a_magic) { case OMAGIC: datmap.b1 = 0; datmap.e1 = filhdr.a_text+filhdr.a_data; datmap.f2 = ctob(UPAGES) + datmap.e1; break; case NMAGIC: case ZMAGIC: datmap.b1 = round(filhdr.a_text, PAGSIZ); datmap.e1 = datmap.b1 + filhdr.a_data; datmap.f2 = ctob(UPAGES) + filhdr.a_data; break; } datbas = datmap.b1; datmap.f1 = ctob(UPAGES); datmap.b2 = MAXSTOR - stksiz; datmap.e2 = MAXSTOR; if (filhdr.a_magic && u.u_exdata.ux_mag && filhdr.a_magic != u.u_exdata.ux_mag) printf("corefile not from this program"); } create(f) char *f; { register int fd; fd = creat(f, 0644); if (fd < 0) return (-1); close(fd); return (open(f, wtflag)); } getfile(filnam, cnt) char *filnam; { register int fsym; if (eqstr(filnam, "-")) return (-1); fsym = open(filnam, wtflag); if (fsym < 0 && xargc > cnt) { if (wtflag) fsym = create(filnam); if (fsym < 0) printf("cannot open `%s'\n", filnam); } return (fsym); } setvar() { var[varchk('b')] = datbas; var[varchk('d')] = filhdr.a_data; var[varchk('e')] = filhdr.a_entry; var[varchk('m')] = filhdr.a_magic; var[varchk('s')] = stksiz; var[varchk('t')] = filhdr.a_text; } pen(f, wtflag)); } getfile(filnam, cnt) char *filnam; { register int fsym; if (eqstr(filnam, "-")) return (-1); fsym = open(filnam, wtflag); if (fsym < 0 && xargc > cnt) { if (wtflag) fsym = create(filnam); if (fsym < 0) printf("cannot open cmd/adb/sym.c 644 0 33 5412 2514002116 6271 static char sccsid[] = "%Z%%M% %I% %G%"; /* * adb - symbol table routines */ #include "defs.h" #include /* * Lookup a symbol by name. */ struct nlist * lookup(symstr) char *symstr; { register struct nlist *sp; cursym = 0; if (symtab) for (sp = symtab; sp < esymtab; sp++) /* SHOULD DO SOME OF EQSYM INLINE TO SAVE TIME */ if ((sp->n_type&N_STAB)==0 && eqsym(sp->n_un.n_name, symstr, '_')) return(cursym = sp); return (0); } /* * Find the closest symbol to val, and return * the difference between val and the symbol found. * Leave a pointer to the symbol found as cursym. */ findsym(val, type) long val; int type; { long diff; register struct nlist *sp; cursym = 0; diff = MAXINT; if (type == NSYM || symtab == 0) return (diff); for (sp = symtab; sp < esymtab; sp++) { if (sp->n_type&N_STAB || (sp->n_type&N_EXT)==0) continue; if (val - sp->n_value < diff && val >= sp->n_value) { diff = val - sp->n_value; cursym = sp; if (diff == 0) break; } } return (diff); } /* * Advance cursym to the next local variable. * Leave its value in localval as a side effect. * Return 0 at end of file. */ localsym(cframe, cargp) ADDR cframe, cargp; { register int type; register struct nlist *sp; if (cursym) for (sp = cursym; ++sp < esymtab; ) { if (sp->n_un.n_name[0] =='_' || sp->n_type == N_FN) return (0); type = sp->n_type; switch (sp->n_type) { case N_TEXT: case N_TEXT|N_EXT: case N_DATA: case N_DATA|N_EXT: case N_BSS: case N_BSS|N_EXT: localval = sp->n_value; cursym = sp; return (1); case N_LSYM: localval = cframe - sp->n_value; cursym = sp; return (1); case N_PSYM: /* code below works since n_value > 0 */ case N_ABS: if (sp->n_value < 0) localval = cframe + sp->n_value; else localval = cargp + sp->n_value; cursym = sp; return (1); } } cursym = 0; return (0); } /* * Print value v and then the string s. * If v is not zero, then we look for a nearby symbol * and print name+offset if we find a symbol for which * offset is small enough. * * For values which are just into kernel address space * that they match exactly or that they be more than maxoff * bytes into kernel space. */ psymoff(v, type, s) long v; int type; char *s; { long w; if (v) w = findsym(v, type); if (v==0 || w >= maxoff || (KVTOPH(v) < maxoff && w)) printf(LPRMODE, v); else { printf("%s", cursym->n_un.n_name); if (w) printf(OFFMODE, w); } printf(s); } /* * Print value v symbolically if it has a reasonable * interpretation as name+offset. If not, print nothing. * Used in printing out registers $r. */ valpr(v, idsp) long v; { off_t d; d = findsym(v, idsp); if (d >= maxoff) return; printf("%s", cursym->n_un.n_name); if (d) printf(OFFMODE, d); } v) w = findsym(v, type); if (v==0 || w >= maxoff || (KVTOPH(v) < maxoff && w)) printf(LPRMODE, v); else { printf("%s", cursym->n_un.n_name); if (w) printf(OFFMODE, w); } printf(s); } /* * Print value v symbolically if it has a rcmd/iostat.c 444 0 33 12420 2520535070 6260 static char *sccsid = "@(#)iostat.c 4.6 (Berkeley) 81/04/21"; /* * iostat */ #include #include #include #include #include #include #include struct nlist nl[] = { { "_dk_busy" }, #define X_DK_BUSY 0 { "_dk_time" }, #define X_DK_TIME 1 { "_dk_xfer" }, #define X_DK_XFER 2 { "_dk_wds" }, #define X_DK_WDS 3 { "_tk_nin" }, #define X_TK_NIN 4 { "_tk_nout" }, #define X_TK_NOUT 5 { "_dk_seek" }, #define X_DK_SEEK 6 { "_cp_time" }, #define X_CP_TIME 7 { "_dk_mspw" }, #define X_DK_MSPW 8 { "_mbdinit" }, #define X_MBDINIT 9 { "_ubdinit" }, #define X_UBDINIT 10 { 0 }, }; char dr_name[DK_NDRIVE][10]; struct { int dk_busy; long cp_time[CPUSTATES]; long dk_time[DK_NDRIVE]; long dk_wds[DK_NDRIVE]; long dk_seek[DK_NDRIVE]; long dk_xfer[DK_NDRIVE]; float dk_mspw[DK_NDRIVE]; long tk_nin; long tk_nout; } s, s1; int mf; double etime; main(argc, argv) char *argv[]; { extern char *ctime(); register i; int iter; double f1, f2; long t; int tohdr = 1; nlist("/vmunix", nl); if(nl[X_DK_BUSY].n_type == 0) { printf("dk_busy not found in /vmunix namelist\n"); exit(1); } mf = open("/dev/kmem", 0); if(mf < 0) { printf("cannot open /dev/kmem\n"); exit(1); } iter = 0; while (argc>1&&argv[1][0]=='-') { argc--; argv++; } lseek(mf, (long)nl[X_DK_MSPW].n_value, 0); read(mf, s.dk_mspw, sizeof s.dk_mspw); for (i = 0; i < DK_NDRIVE; i++) sprintf(dr_name[i], "dk%d", i); read_names(); if(argc > 2) iter = atoi(argv[2]); loop: if (--tohdr == 0) { printf(" tty"); for (i = 0; i < DK_NDRIVE; i++) if (s.dk_mspw[i] != 0.0) printf(" %3.3s ", dr_name[i]); printf(" cpu\n"); printf(" tin tout"); for (i = 0; i < DK_NDRIVE; i++) if (s.dk_mspw[i] != 0.0) printf(" sps tps msps "); printf(" us ni sy id\n"); tohdr = 19; } lseek(mf, (long)nl[X_DK_BUSY].n_value, 0); read(mf, &s.dk_busy, sizeof s.dk_busy); lseek(mf, (long)nl[X_DK_TIME].n_value, 0); read(mf, s.dk_time, sizeof s.dk_time); lseek(mf, (long)nl[X_DK_XFER].n_value, 0); read(mf, s.dk_xfer, sizeof s.dk_xfer); lseek(mf, (long)nl[X_DK_WDS].n_value, 0); read(mf, s.dk_wds, sizeof s.dk_wds); lseek(mf, (long)nl[X_TK_NIN].n_value, 0); read(mf, &s.tk_nin, sizeof s.tk_nin); lseek(mf, (long)nl[X_TK_NOUT].n_value, 0); read(mf, &s.tk_nout, sizeof s.tk_nout); lseek(mf, (long)nl[X_DK_SEEK].n_value, 0); read(mf, s.dk_seek, sizeof s.dk_seek); lseek(mf, (long)nl[X_CP_TIME].n_value, 0); read(mf, s.cp_time, sizeof s.cp_time); lseek(mf, (long)nl[X_DK_MSPW].n_value, 0); read(mf, s.dk_mspw, sizeof s.dk_mspw); for (i = 0; i < DK_NDRIVE; i++) { #define X(fld) t = s.fld[i]; s.fld[i] -= s1.fld[i]; s1.fld[i] = t X(dk_xfer); X(dk_seek); X(dk_wds); X(dk_time); } t = s.tk_nin; s.tk_nin -= s1.tk_nin; s1.tk_nin = t; t = s.tk_nout; s.tk_nout -= s1.tk_nout; s1.tk_nout = t; etime = 0; for(i=0; i 1) { sleep(atoi(argv[1])); goto loop; } } stats(dn) { register i; double atime, words, xtime, itime; if (s.dk_mspw[dn] == 0.0) { printf("%4.0f%4.0f%5.1f ", 0.0, 0.0, 0.0); return; } atime = s.dk_time[dn]; atime /= 60.0; words = s.dk_wds[dn]*32.0; /* number of words transferred */ xtime = s.dk_mspw[dn]*words; /* transfer time */ itime = atime - xtime; /* time not transferring */ /* printf("\ndn %d, words %8.2f, atime %6.2f, xtime %6.2f, itime %6.2f\n", dn, words, atime, xtime, itime); */ if (xtime < 0) itime += xtime, xtime = 0; if (itime < 0) xtime += itime, itime = 0; printf("%4.0f", s.dk_seek[dn]/etime); printf("%4.0f", s.dk_xfer[dn]/etime); printf("%5.1f ", s.dk_seek[dn] ? itime*1000./s.dk_seek[dn] : 0.0); /* printf("%4.1f", s.dk_xfer[dn] ? xtime*1000./s.dk_xfer[dn] : 0.0); */ } stat1(o) { register i; double time; time = 0; for(i=0; i #include #include #include #include typedef unsigned short ushort; struct stat stbuf; struct ar_hdr arbuf; struct lar_hdr { char lar_name[16]; long lar_date; ushort lar_uid; ushort lar_gid; ushort lar_mode; long lar_size; } larbuf; #define SKIP 1 #define IODD 2 #define OODD 4 #define HEAD 8 char *man = { "mrxtdpq" }; char *opt = { "uvnbail" }; int signum[] = {SIGHUP, SIGINT, SIGQUIT, 0}; int sigdone(); long lseek(); int rcmd(); int dcmd(); int xcmd(); int tcmd(); int pcmd(); int mcmd(); int qcmd(); int (*comfun)(); char flg[26]; char **namv; int namc; char *arnam; char *ponam; char *tmpnam = { "/tmp/vXXXXX" }; char *tmp1nam = { "/tmp/v1XXXXX" }; char *tmp2nam = { "/tmp/v2XXXXX" }; char *tfnam; char *tf1nam; char *tf2nam; char *file; char name[16]; int af; int tf; int tf1; int tf2; int qf; int bastate; char buf[BUFSIZ]; char *trim(); char *mktemp(); char *ctime(); main(argc, argv) char *argv[]; { register i; register char *cp; for(i=0; signum[i]; i++) if(signal(signum[i], SIG_IGN) != SIG_IGN) signal(signum[i], sigdone); if(argc < 3) usage(); cp = argv[1]; for(cp = argv[1]; *cp; cp++) switch(*cp) { case 'l': case 'v': case 'u': case 'n': case 'a': case 'b': case 'c': case 'i': flg[*cp - 'a']++; continue; case 'r': setcom(rcmd); continue; case 'd': setcom(dcmd); continue; case 'x': setcom(xcmd); continue; case 't': setcom(tcmd); continue; case 'p': setcom(pcmd); continue; case 'm': setcom(mcmd); continue; case 'q': setcom(qcmd); continue; default: fprintf(stderr, "ar: bad option `%c'\n", *cp); done(1); } if(flg['l'-'a']) { tmpnam = "vXXXXX"; tmp1nam = "v1XXXXX"; tmp2nam = "v2XXXXX"; } if(flg['i'-'a']) flg['b'-'a']++; if(flg['a'-'a'] || flg['b'-'a']) { bastate = 1; ponam = trim(argv[2]); argv++; argc--; if(argc < 3) usage(); } arnam = argv[2]; namv = argv+3; namc = argc-3; if(comfun == 0) { if(flg['u'-'a'] == 0) { fprintf(stderr, "ar: one of [%s] must be specified\n", man); done(1); } setcom(rcmd); } (*comfun)(); done(notfound()); } setcom(fun) int (*fun)(); { if(comfun != 0) { fprintf(stderr, "ar: only one of [%s] allowed\n", man); done(1); } comfun = fun; } rcmd() { register f; init(); getaf(); while(!getdir()) { bamatch(); if(namc == 0 || match()) { f = stats(); if(f < 0) { if(namc) fprintf(stderr, "ar: cannot open %s\n", file); goto cp; } if(flg['u'-'a']) if(stbuf.st_mtime <= larbuf.lar_date) { close(f); goto cp; } mesg('r'); copyfil(af, -1, IODD+SKIP); movefil(f); continue; } cp: mesg('c'); copyfil(af, tf, IODD+OODD+HEAD); } cleanup(); } dcmd() { init(); if(getaf()) noar(); while(!getdir()) { if(match()) { mesg('d'); copyfil(af, -1, IODD+SKIP); continue; } mesg('c'); copyfil(af, tf, IODD+OODD+HEAD); } install(); } xcmd() { register f; if(getaf()) noar(); while(!getdir()) { if(namc == 0 || match()) { f = creat(file, larbuf.lar_mode & 0777); if(f < 0) { fprintf(stderr, "ar: %s cannot create\n", file); goto sk; } mesg('x'); copyfil(af, f, IODD); close(f); continue; } sk: mesg('c'); copyfil(af, -1, IODD+SKIP); if (namc > 0 && !morefil()) done(0); } } pcmd() { if(getaf()) noar(); while(!getdir()) { if(namc == 0 || match()) { if(flg['v'-'a']) { printf("\n<%s>\n\n", file); fflush(stdout); } copyfil(af, 1, IODD); continue; } copyfil(af, -1, IODD+SKIP); } } mcmd() { init(); if(getaf()) noar(); tf2nam = mktemp(tmp2nam); close(creat(tf2nam, 0600)); tf2 = open(tf2nam, 2); if(tf2 < 0) { fprintf(stderr, "ar: cannot create third temp\n"); done(1); } while(!getdir()) { bamatch(); if(match()) { mesg('m'); copyfil(af, tf2, IODD+OODD+HEAD); continue; } mesg('c'); copyfil(af, tf, IODD+OODD+HEAD); } install(); } tcmd() { if(getaf()) noar(); while(!getdir()) { if(namc == 0 || match()) { if(flg['v'-'a']) longt(); printf("%s\n", trim(file)); } copyfil(af, -1, IODD+SKIP); } } qcmd() { register i, f; if (flg['a'-'a'] || flg['b'-'a']) { fprintf(stderr, "ar: abi not allowed with q\n"); done(1); } getqf(); for(i=0; signum[i]; i++) signal(signum[i], SIG_IGN); lseek(qf, 0l, 2); for(i=0; i 0) if (write(af, buf, i) != i) wrerr(); } if(tf2nam) { lseek(tf2, 0l, 0); while((i = read(tf2, buf, BUFSIZ)) > 0) if (write(af, buf, i) != i) wrerr(); } if(tf1nam) { lseek(tf1, 0l, 0); while((i = read(tf1, buf, BUFSIZ)) > 0) if (write(af, buf, i) != i) wrerr(); } } /* * insert the file 'file' * into the temporary file */ movefil(f) { char buf[sizeof(arbuf)+1]; sprintf(buf, "%-16s%-12ld%-6u%-6u%-8o%-10ld%-2s", trim(file), stbuf.st_mtime, stbuf.st_uid, stbuf.st_gid, stbuf.st_mode, stbuf.st_size, ARFMAG); strncpy((char *)&arbuf, buf, sizeof(arbuf)); larbuf.lar_size = stbuf.st_size; copyfil(f, tf, OODD+HEAD); close(f); } stats() { register f; f = open(file, 0); if(f < 0) return(f); if(fstat(f, &stbuf) < 0) { close(f); return(-1); } return(f); } /* * copy next file * size given in arbuf */ copyfil(fi, fo, flag) { register i, o; int pe; if(flag & HEAD) { for (i=sizeof(arbuf.ar_name)-1; i>=0; i--) { if (arbuf.ar_name[i]==' ') continue; else if (arbuf.ar_name[i]=='\0') arbuf.ar_name[i] = ' '; else break; } if (write(fo, (char *)&arbuf, sizeof arbuf) != sizeof arbuf) wrerr(); } pe = 0; while(larbuf.lar_size > 0) { i = o = BUFSIZ; if(larbuf.lar_size < i) { i = o = larbuf.lar_size; if(i&1) { buf[i] = '\n'; if(flag & IODD) i++; if(flag & OODD) o++; } } if(read(fi, buf, i) != i) pe++; if((flag & SKIP) == 0) if (write(fo, buf, o) != o) wrerr(); larbuf.lar_size -= BUFSIZ; } if(pe) phserr(); } getdir() { register char *cp; register i; i = read(af, (char *)&arbuf, sizeof arbuf); if(i != sizeof arbuf) { if(tf1nam) { i = tf; tf = tf1; tf1 = i; } return(1); } if (strncmp(arbuf.ar_fmag, ARFMAG, sizeof(arbuf.ar_fmag))) { fprintf(stderr, "ar: malformed archive (at %ld)\n", lseek(af, 0L, 1)); do((ne(1); } cp = arbuf.ar_name + sizeof(arbuf.ar_name); while (*--cp==' ') ; *++cp = '\0'; strncpy(name, arbuf.ar_name, sizeof(arbuf.ar_name)); file = name; strncpy(larbuf.lar_name, name, sizeof(larbuf.lar_name)); sscanf(arbuf.ar_date, "%ld", &larbuf.lar_date); sscanf(arbuf.ar_uid, "%hd", &larbuf.lar_uid); sscanf(arbuf.ar_gid, "%hd", &larbuf.lar_gid); sscanf(arbuf.ar_mode, "%ho", &larbuf.lar_mode); sscanf(arbuf.ar_size, "%ld", &larbuf.lar_size); return(0); } match() { register i; for(i=0; i 1) printf("%c - %s\n", c, file); } char * trim(s) char *s; { register char *p1, *p2; for(p1 = s; *p1; p1++) ; while(p1 > s) { if(*--p1 != '/') break; *p1 = 0; } p2 = s; for(p1 = s; *p1; p1++) if(*p1 == '/') p2 = p1+1; return(p2); } #define IFMT 060000 #define ISARG 01000 #define LARGE 010000 #define SUID 04000 #define SGID 02000 #define ROWN 0400 #define WOWN 0200 #define XOWN 0100 #define RGRP 040 #define WGRP 020 #define XGRP 010 #define ROTH 04 #define WOTH 02 #define XOTH 01 #define STXT 01000 longt() { register char *cp; pmode(); printf("%3d/%1d", larbuf.lar_uid, larbuf.lar_gid); printf("%7ld", larbuf.lar_size); cp = ctime(&larbuf.lar_date); printf(" %-12.12s %-4.4s ", cp+4, cp+20); } int m1[] = { 1, ROWN, 'r', '-' }; int m2[] = { 1, WOWN, 'w', '-' }; int m3[] = { 2, SUID, 's', XOWN, 'x', '-' }; int m4[] = { 1, RGRP, 'r', '-' }; int m5[] = { 1, WGRP, 'w', '-' }; int m6[] = { 2, SGID, 's', XGRP, 'x', '-' }; int m7[] = { 1, ROTH, 'r', '-' }; int m8[] = { 1, WOTH, 'w', '-' }; int m9[] = { 2, STXT, 't', XOTH, 'x', '-' }; int *m[] = { m1, m2, m3, m4, m5, m6, m7, m8, m9}; pmode() { register int **mp; for (mp = &m[0]; mp < &m[9];) select(*mp++); } select(pairp) int *pairp; { register int n, *ap; ap = pairp; n = *ap++; while (--n>=0 && (larbuf.lar_mode&*ap++)==0) ap++; putchar(*ap); } wrerr() { perror("ar write error"); done(1); } { 1, WGRP, 'w', '-' }; int m6[] = { 2, SGID, 's', XGRP, 'x', '-' }; int m7[] = { 1, ROTH, 'r', '-' }; int m8[] = { 1, WOTH, 'w', '-' }; int m9[] = { 2, STXT, 't', XOTH, 'x', '-' }; int *m[] = { m1, m2, m3, m4, m5, m6, m7, m8, m9}; pmode() { register int **mp; for (mp = &m[0]; mp < &m[9];) select(*mp++); } select(pairp) int *pairp; { register int n, *ap; ap = pairp; n = *ap++; while (--n>=0 && (larbuf.lar_mode&*ap++)==0) ap++; putchar(*ap); } wrerr() { perror("ar write error"); done(1); }cmd/ar11.c 444 0 33 22563 2416237541 5540 static char *sccsid = "@(#)ar11.c 4.1 (Berkeley) 10/1/80"; /* ar11 - archiver for PDP-11 formatted archives */ #include #include #include #include #define ARMAG -155 /* 017545 */ struct ar_hdr { char ar_name[14]; short ar_date1; short ar_date2; char ar_uid; char ar_gid; short ar_mode; short ar_size1; short ar_size2; }; int ar_date; int ar_size; #include struct stat stbuf; struct ar_hdr arbuf; union ints { struct fun { short h1; short h2; }; int w1; } x; #define SKIP 1 #define IODD 2 #define OODD 4 #define HEAD 8 char *man = { "mrxtdp" }; char *opt = { "uvnbai" }; int signum[] = {SIGHUP, SIGINT, SIGQUIT, 0}; int sigdone(); int rcmd(); int dcmd(); int xcmd(); int tcmd(); int pcmd(); int mcmd(); int (*comfun)(); char flg[26]; char **namv; int namc; char *arnam; char *ponam; char *tfnam; char *tf1nam; char *tf2nam; char *file; char name[16]; int af; int tf; int tf1; int tf2; int bastate; char buf[512]; char *trim(); char *mktemp(); char *ctime(); main(argc, argv) char *argv[]; { register i; register char *cp; for(i=0; signum[i]; i++) if(signal(signum[i], SIG_IGN) != SIG_IGN) signal(signum[i], sigdone); if(argc < 3) usage(); cp = argv[1]; for(cp = argv[1]; *cp; cp++) switch(*cp) { case 'c': case 'v': case 'u': case 'n': case 'a': case 'b': case 'i': flg[*cp - 'a']++; continue; case 'r': setcom(rcmd); continue; case 'd': setcom(dcmd); continue; case 'x': setcom(xcmd); continue; case 't': setcom(tcmd); continue; case 'p': setcom(pcmd); continue; case 'm': setcom(mcmd); continue; default: fprintf(stderr, "ar11: bad option `%c'\n", *cp); done(1); } if(flg['i'-'a']) flg['b'-'a']++; if(flg['a'-'a'] || flg['b'-'a']) { bastate = 1; ponam = trim(argv[2]); argv++; argc--; if(argc < 3) usage(); } arnam = argv[2]; namv = argv+3; namc = argc-3; if(comfun == 0) { if(flg['u'-'a'] == 0) { fprintf(stderr, "ar11: one of [%s] must be specified\n", man); done(1); } setcom(rcmd); } (*comfun)(); done(notfound()); } setcom(fun) int (*fun)(); { if(comfun != 0) { fprintf(stderr, "ar11: only one of [%s] allowed\n", man); done(1); } comfun = fun; } rcmd() { register f; init(); if(getaf() && flg['c'-'a']==0) { fprintf(stderr, "ar11: %s does not exist\n", arnam); done(1); } while(!getdir()) { bamatch(); if(namc == 0 || match()) { f = stats(); if(f < 0) { if(namc) fprintf(stderr, "ar11: cannot open %s\n", file); goto cp; } if(flg['u'-'a']) if(stbuf.st_mtime <= ar_date) { close(f); goto cp; } mesg('r'); copyfil(af, -1, IODD+SKIP); movefil(f); continue; } cp: mesg('c'); copyfil(af, tf, IODD+OODD+HEAD); } cleanup(); } dcmd() { init(); if(getaf()) noar(); while(!getdir()) { if(match()) { mesg('d'); copyfil(af, -1, IODD+SKIP); continue; } mesg('c'); copyfil(af, tf, IODD+OODD+HEAD); } install(); } xcmd() { register f; if(getaf()) noar(); while(!getdir()) { if(namc == 0 || match()) { f = creat(file, arbuf.ar_mode & 0777); if(f < 0) { fprintf(stderr, "ar11: %s cannot create\n", file); goto sk; } mesg('x'); copyfil(af, f, IODD); close(f); continue; } sk: mesg('c'); copyfil(af, -1, IODD+SKIP); } } pcmd() { if(getaf()) noar(); while(!getdir()) { if(namc == 0 || match()) { if(flg['v'-'a']) { printf("\n<%s>\n\n", file); fflush(stdout); } copyfil(af, 1, IODD); continue; } copyfil(af, -1, IODD+SKIP); } } mcmd() { init(); if(getaf()) noar(); tf2nam = mktemp("/tmp/v2XXXXX"); close(creat(tf2nam, 0600)); tf2 = open(tf2nam, 2); if(tf2 < 0) { fprintf(stderr, "ar11: cannot create third temp\n"); done(1); } while(!getdir()) { bamatch(); if(match()) { mesg('m'); copyfil(af, tf2, IODD+OODD+HEAD); continue; } mesg('c'); copyfil(af, tf, IODD+OODD+HEAD); } install(); } tcmd() { if(getaf()) noar(); while(!getdir()) { if(namc == 0 || match()) { if(flg['v'-'a']) longt(); printf("%s\n", trim(file)); } copyfil(af, -1, IODD+SKIP); } } init() { static short mbuf = ARMAG; tfnam = mktemp("/tmp/vXXXXX"); close(creat(tfnam, 0600)); tf = open(tfnam, 2); if(tf < 0) { fprintf(stderr, "ar11: cannot create temp file\n"); done(1); } if (write(tf, (char *)&mbuf, sizeof(short)) != sizeof(short)) wrerr(); } getaf() { short mbuf; af = open(arnam, 0); if(af < 0) return(1); if (read(af, (char *)&mbuf, sizeof(short)) != sizeof(short) || mbuf!=ARMAG) { fprintf(stderr, "ar11: %s not in PDP-11 archive format\n", arnam); done(1); } return(0); } usage() { printf("usage: ar11 [%s][%s] archive files ...\n", opt, man); done(1); } noar() { fprintf(stderr, "ar11: %s does not exist\n", arnam); done(1); } sigdone() { done(100); } done(c) { if(tfnam) unlink(tfnam); if(tf1nam) unlink(tf1nam); if(tf2nam) unlink(tf2nam); exit(c); } notfound() { register i, n; n = 0; for(i=0; i 0) if (write(af, buf, i) != i) wrerr(); if(tf2nam) { lseek(tf2, 0l, 0); while((i = read(tf2, buf, 512)) > 0) if (write(af, buf, i) != i) wrerr(); } if(tf1nam) { lseek(tf1, 0l, 0); while((i = read(tf1, buf, 512)) > 0) if (write(af, buf, i) != i) wrerr(); } } /* * insert the file 'file' * into the temporary file */ movefil(f) { register char *cp; register i; cp = trim(file); for(i=0; i<14; i++) if(arbuf.ar_name[i] = *cp) cp++; x.w1 = stbuf.st_size; arbuf.ar_size1 = x.h2; arbuf.ar_size2 = x.h1; x.w1 = stbuf.st_mtime; arbuf.ar_date1 = x.h2; arbuf.ar_date2 = x.h1; arbuf.ar_uid = stbuf.st_uid; arbuf.ar_gid = stbuf.st_gid; arbuf.ar_mode = stbuf.st_mode; copyfil(f, tf, OODD+HEAD); close(f); } stats() { register f; f = open(file, 0); if(f < 0) return(f); if(fstat(f, &stbuf) < 0) { close(f); return(-1); } return(f); } /* * copy next file * size given in arbuf */ copyfil(fi, fo, flag) { register ((i, o; int pe; if(flag & HEAD) if (write(fo, (char *)&arbuf, sizeof arbuf) != sizeof arbuf) wrerr(); pe = 0; while(ar_size > 0) { i = o = 512; if(ar_size < i) { i = o = ar_size; if(i&1) { if(flag & IODD) i++; if(flag & OODD) o++; } } if(read(fi, buf, i) != i) pe++; if((flag & SKIP) == 0) if (write(fo, buf, o) != o) wrerr(); ar_size -= 512; } if(pe) phserr(); } getdir() { register i; i = read(af, (char *)&arbuf, sizeof arbuf); if(i != sizeof arbuf) { if(tf1nam) { i = tf; tf = tf1; tf1 = i; } return(1); } for(i=0; i<14; i++) { name[i] = arbuf.ar_name[i]; } file = name; ar_date = swap(&arbuf.ar_date1); ar_size = swap(&arbuf.ar_size1); return(0); } match() { register i; for(i=0; i 1) printf("%c - %s\n", c, file); } char * trim(s) char *s; { register char *p1, *p2; for(p1 = s; *p1; p1++) ; while(p1 > s) { if(*--p1 != '/') break; *p1 = 0; } p2 = s; for(p1 = s; *p1; p1++) if(*p1 == '/') p2 = p1+1; return(p2); } #define IFMT 060000 #define ISARG 01000 #define LARGE 010000 #define SUID 04000 #define SGID 02000 #define ROWN 0400 #define WOWN 0200 #define XOWN 0100 #define RGRP 040 #define WGRP 020 #define XGRP 010 #define ROTH 04 #define WOTH 02 #define XOTH 01 #define STXT 01000 longt() { register char *cp; pmode(); printf("%3d/%1d", arbuf.ar_uid, arbuf.ar_gid); printf("%7D", ar_size); cp = ctime(&ar_date); printf(" %-12.12s %-4.4s ", cp+4, cp+20); } int m1[] = { 1, ROWN, 'r', '-' }; int m2[] = { 1, WOWN, 'w', '-' }; int m3[] = { 2, SUID, 's', XOWN, 'x', '-' }; int m4[] = { 1, RGRP, 'r', '-' }; int m5[] = { 1, WGRP, 'w', '-' }; int m6[] = { 2, SGID, 's', XGRP, 'x', '-' }; int m7[] = { 1, ROTH, 'r', '-' }; int m8[] = { 1, WOTH, 'w', '-' }; int m9[] = { 2, STXT, 't', XOTH, 'x', '-' }; int *m[] = { m1, m2, m3, m4, m5, m6, m7, m8, m9}; pmode() { register int **mp; for (mp = &m[0]; mp < &m[9];) select(*mp++); } select(pairp) int *pairp; { register int n, *ap; ap = pairp; n = *ap++; while (--n>=0 && (arbuf.ar_mode&*ap++)==0) ap++; putchar(*ap); } wrerr() { perror("ar write error"); done(1); } swap(word) short *word; { x.h1 = ((struct fun *)word)->h2; x.h2 = ((struct fun *)word)->h1; return(x.w1); } { 1, WOTH, 'w', '-' }; int m9[] = { 2, STXT, 't', XOTH, 'x', '-' }; int *m[] = { m1, m2, m3, m4, m5, m6, m7, m8, m9}; pmode() { register cmd/arcv.c 444 0 33 3671 2477650634 5717 static char sccsid[] = "@(#)arcv.c 4.1 10/1/80"; /* * arcv - convert old to new archive format */ #include #include #define OARMAG 0177545 struct oar_hdr { char oar_name[14]; long oar_date; char oar_uid; char oar_gid; int oar_mode; long oar_size; }; struct ar_hdr nh; struct oar_hdr oh; char *tmp; char *mktemp(); int f; char buf[512]; int tf; main(argc, argv) char *argv[]; { register i; if (argc>1 && strcmp(argv[1], "-t")==0) { tmp = mktemp("/usr/tmp/arcXXXXXX"); argc--; argv++; } else tmp = mktemp("/tmp/arcXXXXXX"); for(i=1; i<4; i++) signal(i, SIG_IGN); for(i=1; i1) printf("%s:\n", argv[i]); conv(argv[i]); } unlink(tmp); return(0); } conv(fil) char *fil; { int oldmagic; long n; unsigned i; f = open(fil, 2); if(f < 0) { printf("arcv: cannot open %s\n", fil); return; } close(creat(tmp, 0600)); tf = open(tmp, 2); if(tf < 0) { printf("arcv: cannot open temp\n"); close(f); return; } oldmagic = 0; read(f, (char *)&oldmagic, sizeof(oldmagic)); if(oldmagic != 0177545) { printf("arcv: %s not old archive format\n", fil); close(tf); close(f); return; } chkwrite(tf, ARMAG, SARMAG); loop: i = read(f, (char *)&oh, sizeof(oh)); if(i != sizeof(oh)) goto out; sprintf(buf, "%-16.14s%-12ld%-6u%-6u%-8o%-10ld%-2s", oh.oar_name, oh.oar_date, oh.oar_uid, oh.oar_gid, (unsigned short)oh.oar_mode, oh.oar_size, ARFMAG); strncpy((char *)&nh, buf, sizeof(nh)); n = oh.oar_size; chkwrite(tf, (char *)&nh, sizeof(nh)); while(n > 0) { i = 512; if (n 0) chkwrite(f, buf, i); close(f); close(tf); } chkwrite(f, b, n) char *b; { if (write(f, b, n) != n) { printf("arcv: write error\n"); unlink(tmp); exit(1); } } rncpy((char *)&nh, buf, sizeof(nh)); n = oh.oar_size; chkwrite(tf, (ccmd/arff.c 444 0 33 41344 2552436165 5714 static char *sccsid = "@(#)arff.c 4.7 (Berkeley) 81/07/08"; #include #include #include #include #include #define dbprintf printf struct rt_dat { unsigned short int rt_yr:5; /* Year - 1972 */ unsigned short int rt_dy:5; /* day */ unsigned short int rt_mo:5; /* month */ }; struct rt_axent { char rt_sent[14]; }; struct rt_ent { char rt_pad; /* unusued */ char rt_stat; /* Type of entry, or end of seg */ unsigned short rt_name[3]; /* Name, 3 words in rad50 form */ short rt_len; /* Length of file */ char rt_chan; /* Only used in temporary files */ char rt_job; /* Only used in temporary files */ struct rt_dat rt_date; /* Creation Date */ }; #define RT_TEMP 1 #define RT_NULL 2 #define RT_FILE 4 #define RT_ESEG 8 #define RT_BLOCK 512 #define RT_DIRSIZE 31 /* max # of directory segments */ struct rt_head { short rt_numseg; /* number of segments available */ short rt_nxtseg; /* segment no of next log. seg */ short rt_lstseg; /* highest seg currenltly open */ unsigned short rt_entpad; /* extra words/dir. entry */ short rt_stfile; /* block no where files begin */ }; struct rt_dir { struct rt_head rt_axhead; struct rt_ent rt_ents[72]; char _dirpad[6]; }; extern struct rt_dir rt_dir[RT_DIRSIZE]; extern int rt_entsiz; extern int floppydes; extern char *rt_last; typedef struct fldope { int startad; int count; struct rt_ent *rtdope; } FLDOPE; FLDOPE *lookup(); #define rt(p) ((struct rt_ent *) p ) #define Ain1 03100 #define Ain2 050 #define flag(c) (flg[(c) - 'a']) char *man = { "rxtd" }; char zeroes[512]; extern char *val; extern char table[256]; struct rt_dir rt_dir[RT_DIRSIZE] = {{{4,0,1,0,14},{0,RT_NULL,{0,0,0},494,0}, {0,RT_ESEG}}}; int rt_entsiz; int rt_nleft; struct rt_ent *rt_curend[RT_DIRSIZE]; int floppydes; int dirdirty; char *rt_last; char *defdev = "/dev/floppy"; char *opt = { "vf" }; int signum[] = {SIGHUP, SIGINT, SIGQUIT, 0}; long lseek(); int rcmd(); int dcmd(); int xcmd(); int tcmd(); int (*comfun)(); char flg[26]; char **namv; int namc; int file; main(argc, argv) char *argv[]; { register char *cp; /* register i; for(i=0; signum[i]; i++) if(signal(signum[i], SIG_IGN) != SIG_IGN) signal(signum[i], sigdone); */ if(argc < 2) usage(); cp = argv[1]; for(cp = argv[1]; *cp; cp++) switch(*cp) { case 'm': case 'v': case 'u': case 'w': flg[*cp - 'a']++; continue; case 'c': { #define SURE "Are you sure you want to clobber the floppy?\n" int tty; char response[128]; tty = open("/dev/tty",2); write(tty,SURE,sizeof(SURE)); read(tty,response,sizeof(response)); if(*response!='y') exit(50); flag('c')++; close(tty); } dirdirty++; continue; case 'r': setcom(rcmd); flag('r')++; continue; case 'd': setcom(dcmd); flag('d')++; continue; case 'x': setcom(xcmd); continue; case 't': setcom(tcmd); continue; case 'f': defdev = argv[2]; argv++; argc--; continue; default: fprintf(stderr, "arff: bad option `%c'\n", *cp); exit(1); } namv = argv+2; namc = argc-2; if(comfun == 0) { if(flg['u'-'a'] == 0) { fprintf(stderr, "arff: one of [%s] must be specified\n", man); exit(1); } setcom(rcmd); } (*comfun)(); exit(notfound()); } setcom(fun) int (*fun)(); { if(comfun != 0) { fprintf(stderr, "arff: only one of [%s] allowed\n", man); exit(1); } comfun = fun; } usage() { fprintf(stderr, "usage: ar [%s][%s] archive files ...\n", opt, man); exit(1); } notfound() { register i, n; n = 0; for(i=0; i 1) printf("%c - %s\n", c, file); } tcmd() { register char *de; int segnum; register char *last; FLDOPE *lookup(), *dope; int nleft; register i; register struct rt_ent *rde; rt_init(); if(namc==0) for (segnum=0; segnum != -1; /* for all(( dir. segments */ segnum = rt_dir[segnum].rt_axhead.rt_nxtseg - 1) { last = rt_last + segnum*2*RT_BLOCK; for(de=((char *)&rt_dir[segnum])+10; de <= last; de += rt_entsiz) { if(rtls(rt(de))) { nleft = (last - de) / rt_entsiz; printf("\n%d entries remaining",nleft); printf(" in directory segment %d.\n",segnum+1); break; } } } else for(i = 0; i < namc; i++) { if(dope = lookup(namv[i])) { rde = dope->rtdope; rtls(rde); namv[i] = 0; } } } rtls(de) register struct rt_ent *de; { int month,day,year; char name[12], ext[4]; if(flg['v'-'a']) switch(de->rt_stat) { case RT_TEMP: printf("Tempfile:\n"); case RT_FILE: unrad50(2,de->rt_name,name); unrad50(1,&(de->rt_name[2]),ext); day = de->rt_date.rt_dy; year = de->rt_date.rt_yr + 72; month = de->rt_date.rt_mo; printf("%6.6s %3.3s %02d/%02d/%02d %d\n",name, ext,month,day,year,de->rt_len); break; case RT_NULL: printf("%-25.9s %d\n","",de->rt_len); break; case RT_ESEG: return(1); } else { switch(de->rt_stat) { case RT_TEMP: case RT_FILE: sunrad50(name,de->rt_name); printf(name);putchar('\n'); break; case RT_ESEG: return(1); case RT_NULL: ; } } return(0); } xcmd() { register char *de; int segnum; register char *last; char name[12]; register int i; rt_init(); if(namc==0) for (segnum=0; segnum != -1; /* for all dir. segments */ segnum = rt_dir[segnum].rt_axhead.rt_nxtseg - 1) { last = rt_last + segnum*2*RT_BLOCK; for(de=((char *)&rt_dir[segnum])+10; de <= last; de += rt_entsiz) { sunrad50(name,rt(de)->rt_name); rtx(name); } } else for(i = 0; i < namc; i++) if(rtx(namv[i])==0) namv[i] = 0; } rtx(name) char *name; { register FLDOPE *dope; FLDOPE *lookup(); register startad, count; int file; char buff[512]; if(dope = lookup(name)) { if(flg['v' - 'a']) rtls(dope->rtdope); else printf("x - %s\n",name); file = creat(name, 0666); if(file < 0) return(1); count = dope->count; startad = dope->startad; for( ; count > 0 ; count -= 512) { lread(startad,512,buff); write(file,buff,512); startad += 512; } close(file); return(0); } return(1); } rt_init() { static initized = 0; register char *de; register i; int dirnum; char *mode; register char *last; FILE *temp_floppydes; if(initized) return; initized = 1; if(flag('c') || flag('d') || flag('r')) mode = "r+"; else mode = "r"; if((temp_floppydes = fopen(defdev, mode)) == NULL) { perror(defdev); exit(1); } else floppydes = fileno(temp_floppydes); if(flag('c')==0) { lread(6*RT_BLOCK,2*RT_BLOCK,(char *)&rt_dir[0]); dirnum = rt_dir[0].rt_axhead.rt_numseg; if (dirnum > RT_DIRSIZE) { fprintf(stderr,"arff: too many directory segments\n"); exit(1); } for (i=1; irt_stat==RT_ESEG) break; } rt_curend[i] = rt(de); rt_nleft += (last - de) / rt_entsiz; } } static FLDOPE result; FLDOPE * lookup(name) char * name; { unsigned short rname[3]; register char *de; int segnum; register char *last; register index; srad50(name,rname); /* * Search for name, accumulate blocks in index */ rt_init(); for (segnum=0; segnum != -1; /* for all dir. segments */ segnum = rt_dir[segnum].rt_axhead.rt_nxtseg - 1) { index = 0; last = rt_last + segnum*2*RT_BLOCK; for(de=((char *)&rt_dir[segnum])+10; rt(de)->rt_stat != RT_ESEG; de += rt_entsiz) { switch(rt(de)->rt_stat) { case RT_FILE: case RT_TEMP: if(samename(rname,rt(de)->rt_name)) goto found; case RT_NULL: index += rt(de)->rt_len; } } } return((FLDOPE *) 0); found: result.count = rt(de)->rt_len * 512; result.startad = 512 * (rt_dir[segnum].rt_axhead.rt_stfile + index); result.rtdope = (struct rt_ent *) de; return(&result); } static samename(a,b) unsigned short a[3],b[3]; { return( a[0]==b[0] && a[1]==b[1] && a[2]==b[2] ); } rad50(cp,out) register unsigned char *cp; unsigned short *out; { register index; register temp; for(index = 0;*cp; index++) { temp = Ain1 * table[*cp++]; if(*cp!=0) { temp += Ain2 * table[*cp++]; if(*cp!=0) temp += table[*cp++]; } out[index] = temp; } } #define reduce(x,p,q) \ (x = v[p/q], p %= q); unrad50(count,in,cp) unsigned short *in; register char *cp; { register i, temp; register unsigned char *v = (unsigned char *) val; for(i = 0; i < count; i++) { temp = in[i]; reduce (*cp++,temp,Ain1); reduce (*cp++,temp,Ain2); reduce (*cp++,temp,1); } *cp=0; } srad50(name,rname) register char * name; register unsigned short *rname; { register index; register char *cp; char file[7],ext[4]; /* * Find end of pathname */ for(cp = name; *cp++; ); while(cp >= name && *--cp != '/'); cp++; /* * Change to rad50 * */ for(index = 0; *cp; ){ file[index++] = *cp++; if(*cp=='.') { cp++; break; } if(index>=6) { break; } } file[index] = 0; for(index = 0; *cp; ){ ext[index++] = *cp++; if(*cp=='.' || index>=3) { break; } } ext[index]=0; rname[0] = 0; rname[1] = 0; rname[2] = 0; rad50((unsigned char *)file,rname); rad50((unsigned char *)ext,rname+2); } sunrad50(name,rname) unsigned short rname[3]; register char *name; { register char *cp, *cp2; char ext[4]; unrad50(2,rname,name); unrad50(1,rname + 2,ext); /* Jam name and extension together with a dot deleting white space */ for(cp = name; *cp++;);--cp; while(*--cp==' ' && cp>=name); *++cp = '.';cp++; for(cp2=ext; *cp2!=' ' && cp2 < ext + 3;) { *cp++ = *cp2++; } *cp=0; if(cp[-1]=='.') cp[-1] = 0; } static char *oval = " ABCDEFGHIJKLMNOPQRSTUVWXYZ$.@0123456789"; static char *val = " abcdefghijklmnopqrstuvwxyz$.@0123456789"; static char table[256] = { 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 0, 29, 29, 29, 27, 29, 29, 29, 29, 29, 29, 29, 29, 29, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 29, 29, 29, 29, 29, 29, 29, 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, 29, 29, 29, 29, 29, 29, 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, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 0, 29, 29, 29, 27, 29, 29, 29, 29, 29, 29, 29, 29, 29, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 29, 29, 29, 29, 29, 29, 29, 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, 29, 29, 29, 29, 29, 29, 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, 29, 29, 29, 29 }; long trans(logical) register int logical; { /* Logical to physical adress translation */ register int sector, bytes, track; logical += 26 * 128; bytes = (logical & 127); logical >>= 7; sector = logical % 26; if(sector >= 13) sector = sector *2 +1; else sector *= 2; sector += 26 + ((track = (logical / 26)) - 1) * 6; sector %= 26; return( (((track *26) + sector) << 7) + bytes); } lread(startad,count,obuff) register startad, count; register char * obuff; { long trans(); extern floppydes; rt_init(); if(flg['m'-'a']==0) while( (count -= 128) >= 0) { lseek(floppydes, trans(startad), 0); if (read(floppydes,obuff,128) != 128) fprintf(stderr, "arff: read error block %d\n",startad/128); obuff += 128; startad += 128; } else while( (count -= 512) >= 0) { lseek(floppydes,(long) (startad), 0); if (read(floppydes, obuff, 512) != 512) fprintf(stderr, "arff: read error block %d\n",startad/512); obuff += 512; startad += 512; } } lwrite(startad,count,obuff) register startad, count; register char * obuff; { long trans(); extern floppydes; rt_init(); if(flg['m'-'a']==0) while( (count -= 128) >= 0) { lseek(floppydes, trans(startad), 0); if ( write(floppydes,obuff,128) != 128) fprintf(stderr, "arff: write error block %d\n",startad/128); obuff += 128; startad += 128; } else while( (count -= 512) >= 0) { lseek(floppydes,(long) (startad), 0); if ( write(floppydes,obuff,512) != 512) fprintf(stderr, "arff: write error block %d\n",startad/512); obuff += 512; startad += 512; } } rcmd() { register int i; rt_init(); if (namc>0) for(i = 0; i < namc; i++) if(rtr(namv[i])==0) namv[i]=0; } rtr(name) char *name; { register FLDOPE *dope; register struct rt_ent *de; struct stat buf; register struct stat *bufp = &buf; int segnum; register char *last; if(stat(name,bufp)<0) { perror(name); return(-1); } if(dope = lookup(name)) { /* can replace, no problem */ de = dope->rtdope; if(bufp->st_size <= (de->rt_len * 512)) printf("r - %s\n",name), toflop(name,bufp->st_size,dope); else { fprintf(stderr, "%s will not fit in currently used file on floppy\n",name); return(-1); } } else { /* Search for vacant spot */ for (segnum=0; segnum != -1; /* for all dir. segments */ segnum = rt_dir[segnum].rt_axhead.rt_nxtseg - 1) { last = rt_last + segnum*2*RT_BLOCK; for(de = rt_dir[segnum].rt_ents; rt(de)->rt_stat != RT_ESEG; de++) { switch((de)->rt_stat) { case RT_NULL: if(bufp->st_size <= (de->rt_len * 512)) { printf("a - %s\n",name), mkent(de,segnum,bufp,name); goto found; } continue; } } } printf("%s: no slot for file\n", name); return (-1); } found: if(dope=lookup(name)) { toflop(name,bufp->st_size,dope); return (0); } printf("%s: internal error, added then not found\n", name); return (-1); } mkent(de,segnum,bufp,name) register struct rt_ent *de; int segnum; register struct st((at *bufp; char *name; { struct tm *localtime(); register struct tm *timp; register struct rt_ent *workp; int count; count = (((bufp->st_size -1) >>9) + 1); /* Make sure there is room */ if(de->rt_len==count) goto overwrite; if(rt_curend[segnum] == (rt_last + (segnum*2*RT_BLOCK))) { /* no entries left on segment */ if(flg['o'-'a']) goto overwrite; fprintf(stderr,"Directory segment #%d full on %s\n",segnum+1, defdev); exit(1); } /* copy directory entries up */ for(workp = rt_curend[segnum]+1; workp > de; workp--) *workp = workp[-1]; de[1].rt_len -= count; de->rt_len = count; rt_curend[segnum]++; rt_nleft--; overwrite: srad50(name,de->rt_name); timp = localtime(&bufp->st_mtime); de->rt_date.rt_dy = timp->tm_mday + 1; de->rt_date.rt_mo = timp->tm_mon + 1; de->rt_date.rt_yr = timp->tm_year - 72; de->rt_stat = RT_FILE; de->rt_pad = 0; de->rt_chan = 0; de->rt_job = 0; lwrite((6+segnum*2)*RT_BLOCK,2*RT_BLOCK,(char *)&rt_dir[segnum]); } toflop(name,ocount,dope) char *name; register FLDOPE *dope; long ocount; { register file, n, startad = dope->startad, count = ocount; char buff[512]; file = open(name,0); if(file < 0) { fprintf(stderr, "arff: couldn't open %s\n",name);exit(1);} for( ; count >= 512; count -= 512) { read(file,buff,512); lwrite(startad,512,buff); startad += 512; } read(file,buff,count); close(file); if(count <= 0) return; for(n = count; n < 512; n ++) buff[n] = 0; lwrite(startad,512,buff); count = (dope->rtdope->rt_len * 512 - ocount) / 512 ; if(count <= 0) return; for( ; count > 0 ; count--) { startad += 512; lwrite(startad,512,zeroes); } } dcmd() { register int i; rt_init(); if(namc) for(i = 0; i < namc; i++) if(rtk(namv[i])==0) namv[i]=0; if(dirdirty) scrunch(); } rtk(name) char *name; { register FLDOPE *dope; register struct rt_ent *de; FLDOPE *lookup(); if(dope = lookup(name)) { printf("d - %s\n",name); de = dope->rtdope; de->rt_stat = RT_NULL; de->rt_name[0] = 0; de->rt_name[1] = 0; de->rt_name[2] = 0; * ((unsigned short *) & (de->rt_date)) = 0; dirdirty = 1; return(0); } return(1); } scrunch() { register struct rt_ent *de , *workp; register segnum; for (segnum=0; segnum != -1; /* for all dir. segments */ segnum = rt_dir[segnum].rt_axhead.rt_nxtseg - 1) { dirdirty = 0; for(de = rt_dir[segnum].rt_ents; de <= rt_curend[segnum]; de++) { if(de->rt_stat==RT_NULL && de[1].rt_stat==RT_NULL) { (de+1)->rt_len += de->rt_len; for(workp = de; workp < rt_curend[segnum]; workp++) *workp = workp[1]; de--; rt_curend[segnum]--; rt_nleft++; dirdirty = 1; } } if (dirdirty) lwrite((6+segnum*2)*RT_BLOCK,2*RT_BLOCK,(char *)&rt_dir[segnum]); } } /* for all dir. segments */ segnum = rt_dir[segnum].rt_axhead.rt_nxtseg - 1) { dirdirty = 0; for(de = rt_dir[segnum].rt_ents; de <= rt_curend[segnum]; de++) { if(de->rt_stat==RT_NULL && de[1].rt_stat==RT_NULL) { (de+1)->rt_len += de->rt_len; for(workp = de; wocmd/at.c 444 0 33 14200 2550761576 5376 static char *sccsid = "@(#)at.c 4.3 (Berkeley) 7/3/81"; /* * at time mon day * at time wday * at time wday 'week' * */ #include #include #include #include #define HOUR 100 #define HALFDAY (12*HOUR) #define DAY (24*HOUR) #define THISDAY "/usr/spool/at" char *days[] = { "sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", }; struct monstr { char *mname; int mlen; } months[] = { { "january", 31 }, { "february", 28 }, { "march", 31 }, { "april", 30 }, { "may", 31 }, { "june", 30 }, { "july", 31 }, { "august", 31 }, { "september", 30 }, { "october", 31 }, { "november", 30 }, { "december", 31 }, { 0, 0 }, }; char fname[100]; int utime; /* requested time in grains */ int now; /* when is it */ int uday; /* day of year to be done */ int uyear; /* year */ int today; /* day of year today */ FILE *file; FILE *ifile; char **environ; char *prefix(); char *getenv(); FILE *popen(); main(argc, argv) char **argv; { extern onintr(); register c; char pwbuf[100]; FILE *pwfil; int larg; char *tmp; /* argv[1] is the user's time: e.g., 3AM */ /* argv[2] is a month name or day of week */ /* argv[3] is day of month or 'week' */ /* another argument might be an input file */ if (argc < 2) { fprintf(stderr, "at: arg count\n"); exit(1); } makeutime(argv[1]); larg = makeuday(argc,argv)+1; if (uday==today && larg<=2 && utime<=now) uday++; c = uyear%4==0? 366: 365; if (uday >= c) { uday -= c; uyear++; } filename(THISDAY, uyear, uday, utime); /* Create file, then change UIDS */ close(creat(fname,0644)); chown(fname,getuid(),getgid()); setuid(getuid()); ifile = stdin; if (argc > larg) ifile = fopen(argv[larg], "r"); if (ifile == NULL) { fprintf(stderr, "at: cannot open input: %s\n", argv[larg]); exit(1); } if (signal(SIGINT, SIG_IGN) != SIG_IGN) signal(SIGINT, onintr); file = fopen(fname, "w"); if (file == NULL) { fprintf(stderr, "at: cannot open memo file\n"); exit(1); } if ((pwfil = popen("pwd", "r")) == NULL) { fprintf(stderr, "at: can't execute pwd\n"); exit(1); } fgets(pwbuf, 100, pwfil); pclose(pwfil); fprintf(file, "cd %s", pwbuf); c = umask(0); umask(c); fprintf(file, "umask %.1o\n", c); if (environ) { char **ep = environ; while(*ep) { char *cp; for (tmp = *ep, cp = "TERMCAP"; *tmp==*cp; tmp++,cp++); if (*cp == 0 && *tmp== '=') { ep++; continue; } for(tmp = *ep ; *tmp != '=' ; tmp++) putc(*tmp,file); putc('=', file); putc('\'', file); for (tmp++; *tmp; tmp++) { if (*tmp == '\'') fputs("'\\''", file); else putc(*tmp, file); } putc('\'', file); fprintf(file, "\nexport "); for(tmp = *ep ; *tmp != '=' ; tmp++) putc(*tmp,file); putc('\n',file); ep++; } } /* * see if the SHELL variable in the current enviroment is /bin/csh * and in that case, use the csh as the shell */ tmp = getenv("SHELL"); if (strcmp(tmp+strlen(tmp)-3, "csh") == 0) fprintf(file, "%s %s\n", tmp, "<< 'xxFUNNYxx'"); while((c = getc(ifile)) != EOF) { putc(c, file); } if (strcmp(tmp+strlen(tmp)-3, "csh") == 0) fprintf(file, "%s\n", "xxFUNNYxx"); exit(0); } makeutime(pp) char *pp; { register val; register char *p; /* p points to a user time */ p = pp; val = 0; while(isdigit(*p)) { val = val*10+(*p++ -'0'); } if (p-pp < 3) val *= HOUR; for (;;) { switch(*p) { case ':': ++p; if (isdigit(*p)) { if (isdigit(p[1])) { val +=(10* *p + p[1] - 11*'0'); p += 2; continue; } } fprintf(stderr, "at: bad time format:\n"); exit(1); case 'A': case 'a': if (val >= HALFDAY+HOUR) val = DAY+1; /* illegal */ if (val >= HALFDAY && val <(HALFDAY+HOUR)) val -= HALFDAY; break; case 'P': case 'p': if (val >= HALFDAY+HOUR) val = DAY+1; /* illegal */ if (val < HALFDAY) val += HALFDAY; break; case 'n': case 'N': val = HALFDAY; break; case 'M': case 'm': val = 0; break; case '\0': case ' ': /* 24 hour time */ if (val == DAY) val -= DAY; break; default: fprintf(stderr, "at: bad time format\n"); exit(1); } break; } if (val < 0 || val >= DAY) { fprintf(stderr, "at: time out of range\n"); exit(1); } if (val%HOUR >= 60) { fprintf(stderr, "at: illegal minute field\n"); exit(1); } utime = val; } makeuday(argc,argv) char **argv; { /* the presumption is that argv[2], argv[3] are either month day OR weekday [week]. Returns either 2 or 3 as last argument used */ /* first of all, what's today */ long tm; int found = -1; char **ps; struct tm *detail, *localtime(); struct monstr *pt; time(&tm); detail = localtime(&tm); uday = today = detail->tm_yday; uyear = detail->tm_year; now = detail->tm_hour*100+detail->tm_min; if (argc<=2) return(1); /* is the next argument a month name ? */ for (pt=months; pt->mname; pt++) { if (prefix(argv[2], pt->mname)) { if (found<0) found = pt-months; else { fprintf(stderr, "at: ambiguous month\n"); exit(1); } } } if (found>=0) { if (argc<=3) return(2); uday = atoi(argv[3]) - 1; if (uday<0) { fprintf(stderr, "at: illegal day\n"); exit(1); } while(--found>=0) uday += months[found].mlen; if (detail->tm_year%4==0 && uday>59) uday += 1; return(3); } /* not a month, try day of week */ found = -1; for (ps=days; pstm_wday; if (uday<=0) uday += 7; uday += today; if (argc>3 && strcmp("week", argv[3])==0) { uday += 7; return(3); } return(2); } char * prefix(begin, full) char *begin, *full; { int c; while (c = *begin++) { if (isupper(c)) c = tolower(c); if (*full != c) return(0); else full++; } return(full); } filename(dir, y, d, t) char *dir; { register i; for (i=0; ; i += 53) { sprintf(fname, "%s/%02d.%03d.%04d.%02d", dir, y, d, t, (getpid()+i)%100); if (access(fname, 0) == -1) return; } } onintr() { unlink(fname); exit(1); } gc>3 && strcmp("week", argv[3])==0) { uday += 7; return(3); } return(2); } char * prefix(begin, full) char *begin, *full; { int c; while (c = *begin++) { if (isupper(c)) c = tolower(c); if (*full != c) return(0); else full++; } return(full); } filename(dir, y, d, t) char *dir; { register i; for (i=0; ; i += 53) { sprintf(fname, "%s/%02d.%03d.%04d.%02((cmd/atrun.c 444 0 33 3757 2424741515 6111 static char *sccsid = "@(#)atrun.c 4.2 (Berkeley) 10/21/80"; /* * Run programs submitted by at. */ #include #include #include #include #include # define DIR "/usr/spool/at" # define PDIR "past" # define LASTF "/usr/spool/at/lasttimedone" int nowtime; int nowdate; int nowyear; main(argc, argv) char **argv; { int tt, day, year, uniq; struct direct dirent; FILE *dirf; char file[DIRSIZ+1]; chdir(DIR); makenowtime(); if ((dirf = fopen(".", "r")) == NULL) { fprintf(stderr, "Cannot read at directory\n"); exit(1); } while (fread((char *)&dirent, sizeof(dirent), 1, dirf) == 1) { if (dirent.d_ino==0) continue; strcpyn(file, dirent.d_name, DIRSIZ); file[DIRSIZ] = '\0'; if (sscanf(file, "%2d.%3d.%4d.%2d", &year, &day, &tt, &uniq) != 4) continue; if (nowyear < year) continue; if (nowyear==year && nowdate < day) continue; if (nowyear==year && nowdate==day && nowtime < tt) continue; run(file); } fclose(dirf); updatetime(nowtime); exit(0); } makenowtime() { long t; struct tm *localtime(); register struct tm *tp; time(&t); tp = localtime(&t); nowtime = tp->tm_hour*100 + tp->tm_min; nowdate = tp->tm_yday; nowyear = tp->tm_year; } updatetime(t) { FILE *tfile; tfile = fopen(LASTF, "w"); if (tfile == NULL) { fprintf(stderr, "can't write lastfile\n"); exit(1); } fprintf(tfile, "%04d\n", t); } run(file) char *file; { struct stat stbuf; register pid, i; char sbuf[64]; /* printf("running %s\n", file); */ if (fork()!=0) return; for (i=0; i<15; i++) close(i); dup(dup(open("/dev/null", 0))); sprintf(sbuf, "%s/%s", PDIR, file); link(file, sbuf); unlink(file); chdir(PDIR); if (stat(file, &stbuf) == -1) exit(1); if (pid = fork()) { if (pid == -1) exit(1); wait((int *)0); unlink(file); exit(0); } setgid(stbuf.st_gid); setuid(stbuf.st_uid); execl("/bin/sh", "sh", file, 0); execl("/usr/bin/sh", "sh", file, 0); fprintf(stderr, "Can't execl shell\n"); exit(1); } nning %s\n", filecmd/basename.c 444 0 33 673 2416237601 6502 static char *sccsid = "@(#)basename.c 4.1 (Berkeley) 10/1/80"; #include "stdio.h" main(argc, argv) char **argv; { register char *p1, *p2, *p3; if (argc < 2) { putchar('\n'); exit(1); } p1 = argv[1]; p2 = p1; while (*p1) { if (*p1++ == '/') p2 = p1; } if (argc>2) { for(p3=argv[2]; *p3; p3++) ; while(p1>p2 && p3>argv[2]) if(*--p3 != *--p1) goto output; *p1 = '\0'; } output: puts(p2, stdout); exit(0); } ,( 58< /\@,\D"cmd/bc.y 444 0 33 30317 2477627165 5416 %{ static char *sccsid = "@(#)bc.y 4.2 (Berkeley) 81/02/28"; int *getout(); %} %right '=' %left '+' '-' %left '*' '/' '%' %right '^' %left UMINUS %term LETTER DIGIT SQRT LENGTH _IF FFF EQ %term _WHILE _FOR NE LE GE INCR DECR %term _RETURN _BREAK _DEFINE BASE OBASE SCALE %term EQPL EQMI EQMUL EQDIV EQREM EQEXP %term _AUTO DOT %term QSTR %{ #include int in; char cary[1000], *cp = { cary }; char string[1000], *str = {string}; int crs = '0'; int rcrs = '0'; /* reset crs */ int bindx = 0; int lev = 0; int ln; char *ss; int bstack[10] = { 0 }; char *numb[15] = { " 0", " 1", " 2", " 3", " 4", " 5", " 6", " 7", " 8", " 9", " 10", " 11", " 12", " 13", " 14" }; int *pre, *post; %} %% start : | start stat tail = output( $2 ); | start def dargs ')' '{' dlist slist '}' ={ bundle( 6,pre, $7, post ,"0",numb[lev],"Q"); conout( $$, $2 ); rcrs = crs; output( "" ); lev = bindx = 0; } ; dlist : tail | dlist _AUTO dlets tail ; stat : e ={ bundle(2, $1, "ps." ); } | ={ bundle(1, "" ); } | QSTR ={ bundle(3,"[",$1,"]P");} | LETTER '=' e ={ bundle(3, $3, "s", $1 ); } | LETTER '[' e ']' '=' e ={ bundle(4, $6, $3, ":", geta($1)); } | LETTER EQOP e ={ bundle(6, "l", $1, $3, $2, "s", $1 ); } | LETTER '[' e ']' EQOP e ={ bundle(8,$3, ";", geta($1), $6, $5, $3, ":", geta($1));} | _BREAK ={ bundle(2, numb[lev-bstack[bindx-1]], "Q" ); } | _RETURN '(' e ')' = bundle(4, $3, post, numb[lev], "Q" ); | _RETURN '(' ')' = bundle(4, "0", post, numb[lev], "Q" ); | _RETURN = bundle(4,"0",post,numb[lev],"Q"); | SCALE '=' e = bundle(2, $3, "k"); | SCALE EQOP e = bundle(4,"K",$3,$2,"k"); | BASE '=' e = bundle(2,$3, "i"); | BASE EQOP e = bundle(4,"I",$3,$2,"i"); | OBASE '=' e = bundle(2,$3,"o"); | OBASE EQOP e = bundle(4,"O",$3,$2,"o"); | '{' slist '}' ={ $$ = $2; } | FFF ={ bundle(1,"fY"); } | error ={ bundle(1,"c"); } | _IF CRS BLEV '(' re ')' stat ={ conout( $7, $2 ); bundle(3, $5, $2, " " ); } | _WHILE CRS '(' re ')' stat BLEV ={ bundle(3, $6, $4, $2 ); conout( $$, $2 ); bundle(3, $4, $2, " " ); } | fprefix CRS re ';' e ')' stat BLEV ={ bundle(5, $7, $5, "s.", $3, $2 ); conout( $$, $2 ); bundle(5, $1, "s.", $3, $2, " " ); } | '~' LETTER '=' e ={ bundle(3,$4,"S",$2); } ; EQOP : EQPL ={ $$ = "+"; } | EQMI ={ $$ = "-"; } | EQMUL ={ $$ = "*"; } | EQDIV ={ $$ = "/"; } | EQREM ={ $$ = "%%"; } | EQEXP ={ $$ = "^"; } ; fprefix : _FOR '(' e ';' ={ $$ = $3; } ; BLEV : ={ --bindx; } ; slist : stat | slist tail stat ={ bundle(2, $1, $3 ); } ; tail : '\n' ={ln++;} | ';' ; re : e EQ e = bundle(3, $1, $3, "=" ); | e '<' e = bundle(3, $1, $3, ">" ); | e '>' e = bundle(3, $1, $3, "<" ); | e NE e = bundle(3, $1, $3, "!=" ); | e GE e = bundle(3, $1, $3, "!>" ); | e LE e = bundle(3, $1, $3, "!<" ); | e = bundle(2, $1, " 0!=" ); ; e : e '+' e = bundle(3, $1, $3, "+" ); | e '-' e = bundle(3, $1, $3, "-" ); | '-' e %prec UMINUS = bundle(3, " 0", $2, "-" ); | e '*' e = bundle(3, $1, $3, "*" ); | e '/' e = bundle(3, $1, $3, "/" ); | e '%' e = bundle(3, $1, $3, "%%" ); | e '^' e = bundle(3, $1, $3, "^" ); | LETTER '[' e ']' ={ bundle(3,$3, ";", geta($1)); } | LETTER INCR = bundle(4, "l", $1, "d1+s", $1 ); | INCR LETTER = bundle(4, "l", $2, "1+ds", $2 ); | DECR LETTER = bundle(4, "l", $2, "1-ds", $2 ); | LETTER DECR = bundle(4, "l", $1, "d1-s", $1 ); | LETTER '[' e ']' INCR = bundle(7,$3,";",geta($1),"d1+",$3,":",geta($1)); | INCR LETTER '[' e ']' = bundle(7,$4,";",geta($2),"1+d",$4,":",geta($2)); | LETTER '[' e ']' DECR = bundle(7,$3,";",geta($1),"d1-",$3,":",geta($1)); | DECR LETTER '[' e ']' = bundle(7,$4,";",geta($2),"1-d",$4,":",geta($2)); | SCALE INCR = bundle(1,"Kd1+k"); | INCR SCALE = bundle(1,"K1+dk"); | SCALE DECR = bundle(1,"Kd1-k"); | DECR SCALE = bundle(1,"K1-dk"); | BASE INCR = bundle(1,"Id1+i"); | INCR BASE = bundle(1,"I1+di"); | BASE DECR = bundle(1,"Id1-i"); | DECR BASE = bundle(1,"I1-di"); | OBASE INCR = bundle(1,"Od1+o"); | INCR OBASE = bundle(1,"O1+do"); | OBASE DECR = bundle(1,"Od1-o"); | DECR OBASE = bundle(1,"O1-do"); | LETTER '(' cargs ')' = bundle(4, $3, "l", getf($1), "x" ); | LETTER '(' ')' = bundle(3, "l", getf($1), "x" ); | cons ={ bundle(2, " ", $1 ); } | DOT cons ={ bundle(2, " .", $2 ); } | cons DOT cons ={ bundle(4, " ", $1, ".", $3 ); } | cons DOT ={ bundle(3, " ", $1, "." ); } | DOT ={ $$ = "l."; } | LETTER = { bundle(2, "l", $1 ); } | LETTER '=' e ={ bundle(3, $3, "ds", $1 ); } | LETTER EQOP e %prec '=' ={ bundle(6, "l", $1, $3, $2, "ds", $1 ); } | LETTER '[' e ']' '=' e = { bundle(5,$6,"d",$3,":",geta($1)); } | LETTER '[' e ']' EQOP e = { bundle(9,$3,";",geta($1),$6,$5,"d",$3,":",geta($1)); } | LENGTH '(' e ')' = bundle(2,$3,"Z"); | SCALE '(' e ')' = bundle(2,$3,"X"); /* must be before '(' e ')' */ | '(' e ')' = { $$ = $2; } | '?' ={ bundle(1, "?" ); } | SQRT '(' e ')' ={ bundle(2, $3, "v" ); } | '~' LETTER ={ bundle(2,"L",$2); } | SCALE '=' e = bundle(2,$3,"dk"); | SCALE EQOP e %prec '=' = bundle(4,"K",$3,$2,"dk"); | BASE '=' e = bundle(2,$3,"di"); | BASE EQOP e %prec '=' = bundle(4,"I",$3,$2,"di"); | OBASE '=' e = bundle(2,$3,"do"); | OBASE EQOP e %prec '=' = bundle(4,"O",$3,$2,"do"); | SCALE = bundle(1,"K"); | BASE = bundle(1,"I"); | OBASE = bundle(1,"O"); ; cargs : eora | cargs ',' eora = bundle(2, $1, $3 ); ; eora: e | LETTER '[' ']' =bundle(2,"l",geta($1)); ; cons : constant ={ *cp++ = '\0'; } constant: '_' ={ $$ = cp; *cp++ = '_'; } | DIGIT ={ $$ = cp; *cp++ = $1; } | constant DIGIT ={ *cp++ = $2; } ; CRS : ={ $$ = cp; *cp++ = crs++; *cp++ = '\0'; if(crs == '[')crs+=3; if(crs == 'a')crs='{'; if(crs >= 0241){yyerror("program too big"); getout(); } bstack[bindx++] = lev++; } ; def : _DEFINE LETTER '(' ={ $$ = getf($2); pre = ""; post = ""; lev = 1; bstack[bin((dx=0] = 0; } ; dargs : | lora ={ pp( $1 ); } | dargs ',' lora ={ pp( $3 ); } ; dlets : lora ={ tp($1); } | dlets ',' lora ={ tp($3); } ; lora : LETTER | LETTER '[' ']' ={ $$ = geta($1); } ; %% # define error 256 int peekc = -1; int sargc; int ifile; char **sargv; char funtab[52] = { 01,0,02,0,03,0,04,0,05,0,06,0,07,0,010,0,011,0,012,0,013,0,014,0,015,0,016,0,017,0, 020,0,021,0,022,0,023,0,024,0,025,0,026,0,027,0,030,0,031,0,032,0 }; char atab[52] = { 0241,0,0242,0,0243,0,0244,0,0245,0,0246,0,0247,0,0250,0,0251,0,0252,0,0253,0, 0254,0,0255,0,0256,0,0257,0,0260,0,0261,0,0262,0,0263,0,0264,0,0265,0,0266,0, 0267,0,0270,0,0271,0,0272,0}; char *letr[26] = { "a","b","c","d","e","f","g","h","i","j", "k","l","m","n","o","p","q","r","s","t", "u","v","w","x","y","z" } ; char *dot = { "." }; yylex(){ int c, ch; restart: c = getch(); peekc = -1; while( c == ' ' || c == '\t' ) c = getch(); if(c == '\\'){ getch(); goto restart; } if( c<= 'z' && c >= 'a' ) { /* look ahead to look for reserved words */ peekc = getch(); if( peekc >= 'a' && peekc <= 'z' ){ /* must be reserved word */ if( c=='i' && peekc=='f' ){ c=_IF; goto skip; } if( c=='w' && peekc=='h' ){ c=_WHILE; goto skip; } if( c=='f' && peekc=='o' ){ c=_FOR; goto skip; } if( c=='s' && peekc=='q' ){ c=SQRT; goto skip; } if( c=='r' && peekc=='e' ){ c=_RETURN; goto skip; } if( c=='b' && peekc=='r' ){ c=_BREAK; goto skip; } if( c=='d' && peekc=='e' ){ c=_DEFINE; goto skip; } if( c=='s' && peekc=='c' ){ c= SCALE; goto skip; } if( c=='b' && peekc=='a' ){ c=BASE; goto skip; } if( c=='i' && peekc == 'b'){ c=BASE; goto skip; } if( c=='o' && peekc=='b' ){ c=OBASE; goto skip; } if( c=='d' && peekc=='i' ){ c=FFF; goto skip; } if( c=='a' && peekc=='u' ){ c=_AUTO; goto skip; } if( c == 'l' && peekc=='e'){ c=LENGTH; goto skip; } if( c == 'q' && peekc == 'u'){getout();} /* could not be found */ return( error ); skip: /* skip over rest of word */ peekc = -1; while( (ch = getch()) >= 'a' && ch <= 'z' ); peekc = ch; return( c ); } /* usual case; just one single letter */ yylval = letr[c-'a']; return( LETTER ); } if( c>= '0' && c <= '9' || c>= 'A' && c<= 'F' ){ yylval = c; return( DIGIT ); } switch( c ){ case '.': return( DOT ); case '=': switch( peekc = getch() ){ case '=': c=EQ; goto gotit; case '+': c=EQPL; goto gotit; case '-': c=EQMI; goto gotit; case '*': c=EQMUL; goto gotit; case '/': c=EQDIV; goto gotit; case '%': c=EQREM; goto gotit; case '^': c=EQEXP; goto gotit; default: return( '=' ); gotit: peekc = -1; return(c); } case '+': return( cpeek( '+', INCR, cpeek( '=', EQPL, '+') ) ); case '-': return( cpeek( '-', DECR, cpeek( '=', EQMI, '-') ) ); case '<': return( cpeek( '=', LE, '<' ) ); case '>': return( cpeek( '=', GE, '>' ) ); case '!': return( cpeek( '=', NE, '!' ) ); case '/': if((peekc = getch()) == '*'){ peekc = -1; while((getch() != '*') || ((peekc = getch()) != '/')); peekc = -1; goto restart; } else if (peekc == '=') { c=EQDIV; goto gotit; } else return(c); case '*': return( cpeek( '=', EQMUL, '*' ) ); case '%': return( cpeek( '=', EQREM, '%' ) ); case '^': return( cpeek( '=', EQEXP, '^' ) ); case '"': yylval = str; while((c=getch()) != '"'){*str++ = c; if(str >= &string[999]){yyerror("string space exceeded"); getout(); } } *str++ = '\0'; return(QSTR); default: return( c ); } } cpeek( c, yes, no ){ if( (peekc=getch()) != c ) return( no ); else { peekc = -1; return( yes ); } } getch(){ int ch; loop: ch = (peekc < 0) ? getc(in) : peekc; peekc = -1; if(ch != EOF)return(ch); if(++ifile > sargc){ if(ifile >= sargc+2)getout(); in = stdin; ln = 0; goto loop; } fclose(in); if((in = fopen(sargv[ifile],"r")) != NULL){ ln = 0; ss = sargv[ifile]; goto loop; } yyerror("cannot open input file"); } # define b_sp_max 3000 int b_space [ b_sp_max ]; int * b_sp_nxt = { b_space }; int bdebug = 0; bundle(a){ int i, *p, *q; p = &a; i = *p++; q = b_sp_nxt; if( bdebug ) printf("bundle %d elements at %o\n",i, q ); while(i-- > 0){ if( b_sp_nxt >= & b_space[b_sp_max] ) yyerror( "bundling space exceeded" ); * b_sp_nxt++ = *p++; } * b_sp_nxt++ = 0; yyval = q; return( q ); } routput(p) int *p; { if( bdebug ) printf("routput(%o)\n", p ); if( p >= &b_space[0] && p < &b_space[b_sp_max]){ /* part of a bundle */ while( *p != 0 ) routput( *p++ ); } else printf( p ); /* character string */ } output( p ) int *p; { routput( p ); b_sp_nxt = & b_space[0]; printf( "\n" ); fflush(stdout); cp = cary; crs = rcrs; } conout( p, s ) int *p; char *s; { printf("["); routput( p ); printf("]s%s\n", s ); fflush(stdout); lev--; } yyerror( s ) char *s; { if(ifile > sargc)ss="teletype"; printf("c[%s on line %d, %s]pc\n", s ,ln+1,ss); fflush(stdout); cp = cary; crs = rcrs; bindx = 0; lev = 0; b_sp_nxt = &b_space[0]; } pp( s ) char *s; { /* puts the relevant stuff on pre and post for the letter s */ bundle(3, "S", s, pre ); pre = yyval; bundle(4, post, "L", s, "s." ); post = yyval; } tp( s ) char *s; { /* same as pp, but for temps */ bundle(3, "0S", s, pre ); pre = yyval; bundle(4, post, "L", s, "s." ); post = yyval; } yyinit(argc,argv) int argc; char *argv[];{ signal( 2, (int(*)())1 ); /* ignore all interrupts */ sargv=argv; sargc= -- argc; if(sargc == 0)in=stdin; else if((in = fopen(sargv[1],"r")) == NULL) yyerror("cannot open input file"); ifile = 1; ln = 0; ss = sargv[1]; } int *getout(){ printf("q"); fflush(stdout); exit(); } int * getf(p) char *p;{ return(&funtab[2*(*p -0141)]); } int * geta(p) char *p;{ return(&atab[2*(*p - 0141)]); } main(argc, argv) char **argv; { int p[2]; if (argc > 1 && *argv[1] == '-') { if((argv[1][1] == 'd')||(argv[1][1] == 'c')){ yyinit(--argc, ++argv); yyparse(); exit(); } if(argv[1][1] != 'l'){ printf("unrecognizable argument\n"); fflush(stdout); exit(); } argv[1] = "/usr/lib/lib.b"; } pipe(p); if (fork()==0) { close(1); dup(p[1]); close(p[0]); close(p[1]); yyinit(argc, argv); yyparse(); exit(); } close(0); dup(p[0]); close(p[0]); close(p[1]); execl("/bin/dc", "dc", "-", 0); execl("/usr/bin/dc", "dc", "-", 0); } && *argv[1] == '-') { if((argv[1][1] == 'd')||(argv[1][1] == 'c')){ yyinit(--argc, ++argv); yyparse(); exit(); } if(argv[1][1] != 'l'){ printf("unrecognizable argument\n"); fflush(stdout); exit(); } argv[1] = "/usr/lib/lib.b"; } pipe(p); if (fork()==0) { close(1); dup(pcmd/call.c 444 0 33 1011 2416237613 5650 static char *sccsid = "@(#)call.c 4.1 (Berkeley) 10/1/80"; char *dn; main(argc, argv) char *argv[]; { register f, n, c; if(argc < 2) goto arg; dn = "/dev/dn0"; if(*argv[1] == '-') { dn = argv[1]+1; argc--; argv++; } if(argc < 2) goto arg; c = 0; loop: f = open(dn, 1); if(f < 0) goto slp; for(n=0; argv[1][n]; n++) ; alarm(120); if(write(f, argv[1], n) == n) exit(0); slp: if(f >= 0) close(f); c++; if(c > 100) exit(1); sleep(10); goto loop; arg: printf("arg c\n"); exit(1); } ar *sccsid = "@(#)call.c 4.1 (Berkeley) 10/1/80"; char *dn; main(argc, argv) char *argv[]; { register f, n, c; if(argc < 2) goto arg; dn = "/dev/dn0"; if(*argv[1] == '-') { dn = argv[1]+1; argc--; argv++; } if(argc < 2) goto arg; c = 0; loop: f = open(dn, 1); if(f < 0) goto slp; for(n=0; argv[1][n]; n++) ; alarm(120); if(write(f, argv[1], n) == n) exit(0); slp: if(f >= 0) close(f); c++; if(c > 100) exit(1); sleep(10); goto loop; arg: printf("arg c\n"); excmd/colrm.c 444 0 33 2144 2421025323 6046 static char *Sccsid = "@(#)colrm.c 4.2 (Berkeley) 10/9/80"; #include /* COLRM removes unwanted columns from a file Jeff Schriebman UC Berkeley 11-74 */ main(argc,argv) char **argv; { int first; register ct,last; register char c; char buffer[BUFSIZ]; setbuf(stdout, buffer); first = 20000; last = -1; if (argc>1) { first = getn(*++argv); last = 20000; } if (argc>2) last = getn(*++argv); start: ct = 0; loop1: if ((c=getc(stdin))<0) goto fin; if (c == '\t') ct = (ct + 8) &~ 7; else if (c == '\b') ct = ct ? ct - 1 : 0; else ct++; if (c=='\n') { putc(c,stdout); goto start; } if (ct0) { putc(c,stdout); if (c=='\n') goto start; } fin: fflush(stdout); } getn(ap) char *ap; { register int n,c; register char *p; p = ap; n = 0; while ((c = *p++) >= '0' && c <= '9') n = n*10 + c - '0'; return(n); } goto start; } if (ct0) { putc(c,stdout); if (c=='\n') goto start; } fin: fflush(stdout); } getn(ap) char *ap; { register int n,c; register ch((cmd/catman.c 444 0 33 5111 2416237624 6207 static char *sccsid = "@(#)catman.c 4.1 (Berkeley) 10/1/80"; # include # include # include # include # include # define reg register # define bool char # define SYSTEM(str) (pflag ? printf("%s\n", str) : system(str)) char buf[BUFSIZ], pflag = 0, nflag = 0, wflag = 0; main(ac, av) int ac; char *av[]; { reg char *tsp, *msp, *csp, *man, *cat, *sp; reg FILE *mdir, *inf; reg long time; reg char *sections; reg int exstat = 0; reg bool changed = 0; static struct dir dir; static struct stat sbuf; while (ac > 1) { av++; if (strcmp(*av, "-p") == 0) pflag++; else if (strcmp(*av, "-n") == 0) nflag++; else if (strcmp(*av, "-w") == 0) wflag++; else if (*av[0] == '-') goto usage; else break; ac--; } if (ac == 2) sections = *av; else if (ac < 2) sections = "12345678"; else { usage: printf("usage: catman [ -p ] [ -n ] [ -w ] [ sections ]\n"); exit(-1); } if (wflag) goto whatis; chdir("/usr/man"); man = "manx/xxxxxxxxxxxxxx"; cat = "catx/xxxxxxxxxxxxxx"; msp = &man[5]; csp = &cat[5]; umask(0); for (sp = sections; *sp; sp++) { man[3] = cat[3] = *sp; *msp = *csp = '\0'; if ((mdir = fopen(man, "r")) == NULL) { fprintf(stderr, "fopen:"); perror(man); exstat = 1; continue; } if (stat(cat, &sbuf) < 0) { sprintf(buf, "mkdir %s", cat); SYSTEM(buf); stat(cat, &sbuf); } if ((sbuf.st_mode & 0777) != 0777) chmod(cat, 0777); while (fread((char *) &dir, sizeof dir, 1, mdir) > 0) { if (dir.d_ino == 0 || dir.d_name[0] == '.') continue; /* * make sure this is a man file, i.e., that it * ends in .[0-9] or .[0-9][a-z] */ tsp = rindex(dir.d_name, '.'); if (tsp == NULL) continue; if (!isdigit(*++tsp) || ((*++tsp && !isalpha(*tsp)) || *++tsp)) continue; strncpy(msp, dir.d_name, DIRSIZ); if ((inf = fopen(man, "r")) == NULL) { perror(man); exstat = 1; continue; } if (getc(inf) == '.' && getc(inf) == 's' && getc(inf) == 'o') { fclose(inf); continue; } fclose(inf); strncpy(csp, dir.d_name, DIRSIZ); if (stat(cat, &sbuf) >= 0) { time = sbuf.st_mtime; stat(man, &sbuf); if (time >= sbuf.st_mtime) continue; unlink(cat); } sprintf(buf, "nroff -man %s > %s", man, cat); SYSTEM(buf); changed = 1; } fclose(mdir); } if (changed && !nflag) { whatis: if (pflag) printf("/bin/sh /usr/lib/makewhatis\n"); else { execl("/bin/sh", "/bin/sh", "/usr/lib/makewhatis", 0); perror("/bin/sh /usr/lib/makewhatis"); exstat = 1; } } exit(exstat); } dir.d_name, DIRSIZ); if (stat(cat, &sbuf) >= 0) { time = sbuf.st_mtime; stat(man, &sbuf); if (time >= sbuf.st_mtime) continue; unlink(cat); } sprintf(buf, "nroff -man %s > %s", man, cat); SYSTEM(buf); changed = 1; } fclose(mdir); } if (changed && !nflag) { whatis: if (pflag) printf("/bin/sh /usr/lib/makewhatis\n"); else { execl("/bin/sh", "/bin/sh", "/usr/lib/makewhatis", 0); perrocmd/cb.c 444 0 33 13603 2416237627 5360 static char *sccsid = "@(#)cb.c 4.1 (Berkeley) 10/1/80"; #include int slevel[10]; int clevel = 0; int spflg[20][10]; int sind[20][10]; int siflev[10]; int sifflg[10]; int iflev = 0; int ifflg = -1; int level = 0; int ind[10] = { 0,0,0,0,0,0,0,0,0,0 }; int eflg = 0; int paren = 0; int pflg[10] = { 0,0,0,0,0,0,0,0,0,0 }; char lchar; char pchar; int aflg = 0; int ct; int stabs[20][10]; int qflg = 0; char *wif[] = { "if",0}; char *welse[] = { "else",0}; char *wfor[] = { "for",0}; char *wds[] = { "case","default",0}; int j = 0; char string[200]; char cc; int sflg = 1; int peek = -1; int tabs = 0; int lastchar; int c; main(argc,argv) int argc; char argv[]; { while((c = getch()) != EOF){ switch(c){ case ' ': case '\t': if(lookup(welse) == 1){ gotelse(); if(sflg == 0 || j > 0)string[j++] = c; puts(); sflg = 0; continue; } if(sflg == 0 || j > 0)string[j++] = c; continue; case '\n': if((eflg = lookup(welse)) == 1)gotelse(); puts(); printf("\n"); sflg = 1; if(eflg == 1){ pflg[level]++; tabs++; } else if(pchar == lchar) aflg = 1; continue; case '{': if(lookup(welse) == 1)gotelse(); siflev[clevel] = iflev; sifflg[clevel] = ifflg; iflev = ifflg = 0; clevel++; if(sflg == 1 && pflg[level] != 0){ pflg[level]--; tabs--; } string[j++] = c; puts(); getnl(); puts(); printf("\n"); tabs++; sflg = 1; if(pflg[level] > 0){ ind[level] = 1; level++; slevel[level] = clevel; } continue; case '}': clevel--; if((iflev = siflev[clevel]-1) < 0)iflev = 0; ifflg = sifflg[clevel]; if(pflg[level] >0 && ind[level] == 0){ tabs -= pflg[level]; pflg[level] = 0; } puts(); tabs--; ptabs(); if((peek = getch()) == ';'){ printf("%c;",c); peek = -1; } else printf("%c",c); getnl(); puts(); printf("\n"); sflg = 1; if(clevel < slevel[level])if(level > 0)level--; if(ind[level] != 0){ tabs -= pflg[level]; pflg[level] = 0; ind[level] = 0; } continue; case '"': case '\'': string[j++] = c; while((cc = getch()) != c){ string[j++] = cc; if(cc == '\\'){ string[j++] = getch(); } if(cc == '\n'){ puts(); sflg = 1; } } string[j++] = cc; if(getnl() == 1){ lchar = cc; peek = '\n'; } continue; case ';': string[j++] = c; puts(); if(pflg[level] > 0 && ind[level] == 0){ tabs -= pflg[level]; pflg[level] = 0; } getnl(); puts(); printf("\n"); sflg = 1; if(iflev > 0) if(ifflg == 1){iflev--; ifflg = 0; } else iflev = 0; continue; case '\\': string[j++] = c; string[j++] = getch(); continue; case '?': qflg = 1; string[j++] = c; continue; case ':': string[j++] = c; if(qflg == 1){ qflg = 0; continue; } if(lookup(wds) == 0){ sflg = 0; puts(); } else{ tabs--; puts(); tabs++; } if((peek = getch()) == ';'){ printf(";"); peek = -1; } getnl(); puts(); printf("\n"); sflg = 1; continue; case '/': string[j++] = c; if((peek = getch()) != '*')continue; string[j++] = peek; peek = -1; comment(); continue; case ')': paren--; string[j++] = c; puts(); if(getnl() == 1){ peek = '\n'; if(paren != 0)aflg = 1; else if(tabs > 0){ pflg[level]++; tabs++; ind[level] = 0; } } continue; case '#': string[j++] = c; while((cc = getch()) != '\n')string[j++] = cc; string[j++] = cc; sflg = 0; puts(); sflg = 1; continue; case '(': string[j++] = c; paren++; if(lookup(wfor) == 1){ while((c = gets()) != ';'); ct=0; cont: while((c = gets()) != ')'){ if(c == '(') ct++; } if(ct != 0){ ct--; goto cont; } paren--; puts(); if(getnl() == 1){ peek = '\n'; pflg[level]++; tabs++; ind[level] = 0; } continue; } if(lookup(wif) == 1){ puts(); stabs[clevel][iflev] = tabs; spflg[clevel][iflev] = pflg[level]; sind[clevel][iflev] = ind[level]; iflev++; ifflg = 1; } continue; default: string[j++] = c; if(c != ',')lchar = c; } } } ptabs(){ int i; for(i=0; i < tabs; i++)printf("\t"); } getch(){ if(peek < 0 && lastchar != ' ' && lastchar != '\t')pchar = lastchar; lastchar = (peek<0) ? getc(stdin):peek; peek = -1; return(lastchar); } puts(){ if(j > 0){ if(sflg != 0){ ptabs(); sflg = 0; if(aflg == 1){ aflg = 0; if(tabs > 0)printf(" "); } } string[j] = '\0'; printf("%s",string); j = 0; } else{ if(sflg != 0){ sflg = 0; aflg = 0; } } } lookup(tab) char *tab[]; { char r; int l,kk,k,i; if(j < 1)return(0); kk=0; while(string[kk] == ' ')kk++; for(i=0; tab[i] != 0; i++){ l=0; for(k=kk;(r = tab[i][l++]) == string[k] && r != '\0';k++); if(r == '\0' && (string[k] < 'a' || string[k] > 'z' || k >= j))return(1); } return(0); } gets(){ char ch; beg: if((ch = string[j++] = getch()) == '\\'){ string[j++] = getch(); goto beg; } if(ch == '\'' || ch == '"'){ while((cc = string[j++] = getch()) != ch)if(cc == '\\')string[j++] = getch(); goto beg; } if(ch == '\n'){ puts(); aflg = 1; goto beg; } else return(ch); } gotelse(){ tabs = stabs[clevel][iflev]; pflg[level] = spflg[clevel][iflev]; ind[level] = sind[clevel][iflev]; ifflg = 1; } getnl(){ while((peek = getch()) == '\t' || peek == ' '){ string[j++] = peek; peek = -1; } if((peek = getch()) == '/'){ peek = -1; if((peek = getch()) == '*'){ string[j++] = '/'; string[j++] = '*'; peek = -1; comment(); } else string[j++] = '/'; } if((peek = getch()) == '\n'){ peek = -1; return(1); } return(0); } comment(){ rep: while((c = string[j++] = getch()) != '*') if(c == '\n'){ puts(); sflg = 1; } gotstar: if((c = string[j++] = getch()) != '/'){ if(c == '*')goto gotstar; goto rep; } } '\t' || peek == ' '){ string[j++] = peek; peek = -1; } if((peek = getch()) == '/'){ peek = -1; if((peek = getch()) ((cmd/cc.c 444 0 33 15546 2416237632 5365 static char sccsid[] = "@(#)cc.c 4.1 10/1/80"; /* * cc - front end for C compiler */ #include #include #include #include #include char *cpp = "/lib/cpp"; char *ccom = "/lib/ccom"; 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, gflag, oflag, pflag, sflag, wflag, Rflag, exflag, proflag; char *dflag; 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': case 'o': error("-o would overwrite %s", outfile); exit(8); } } continue; case 'R': Rflag++; continue; case 'O': oflag++; continue; case 'p': proflag++; continue; case 'g': gflag++; 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 'D': case 'I': case 'U': case 'C': plist[np++] = 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': dflag = argv[i]; 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 (gflag) { if (oflag) fprintf(stderr, "cc: warning: -g disables -O\n"); oflag = 0; } 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, "ccom"); continue; case '2': c2 = strspl(npassname, "c2"); continue; case 'p': cpp = strspl(npassname, "cpp"); continue; } } if (proflag) crt0 = "/lib/mcrt0.o"; 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 (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) { printf("%s:\n", clist[i]); fflush(stdout); } if (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]; av[2] = exflag ? "-" : tmp4; na = 3; 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) assource = tmp3 = setsuf(clist[i], 's'); av[0] = "ccom"; av[1] = tmp4; av[2] = oflag?tmp5:tmp3; na = 3; if (proflag) av[na++] = "-XP"; if (gflag) av[na++] = "-Xg"; if (wflag) av[na++] = "-w"; av[na] = 0; if (callsys(ccom, 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] = "-o"; av[2] = setsuf(clist[i], 'o'); na = 3; if (Rflag) av[na++] = "-R"; if (dflag) av[na++] = dflag; av[na++] = assource; av[na] = 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 (gflag) av[na++] = "-lg"; 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 <= DIRSIZ && 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; 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)); } ister char *cp; { register int len; len = strlen(cp) + 1; if (len > saveleft) { saveleft = NSAVETAB; if (len > saveleft) saveleft = len; savecmd/chk.sh 755 0 33 112 2256376005 5661 for i in $* do echo icheck $i icheck $i echo dcheck $i dcheck $i done 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)); } ister char *cp; { register int len; len = strlen(cp) + 1; /( ,( 5< /\@,\D"cmd/checkeq.c 444 0 33 3664 2416237634 6363 static char *sccsid = "@(#)checkeq.c 4.1 (Berkeley) 10/1/80"; #include FILE *fin; int delim = '$'; main(argc, argv) char **argv; { if (argc <= 1) check(stdin); else while (--argc > 0) { if ((fin = fopen(*++argv, "r")) == NULL) { printf("Can't open %s\n", *argv); exit(1); } printf("%s:\n", *argv); check(fin); fclose(fin); } } check(f) FILE *f; { int start, line, eq, ndel, totdel; char in[600], *p; start = eq = line = ndel = totdel = 0; while (fgets(in, 600, f) != NULL) { line++; ndel = 0; for (p = in; *p; p++) if (*p == delim) ndel++; if (*in=='.' && *(in+1)=='E' && *(in+2)=='Q') { if (eq++) printf(" Spurious EQ, line %d\n", line); if (totdel) printf(" EQ in %c%c, line %d\n", delim, delim, line); } else if (*in=='.' && *(in+1)=='E' && *(in+2)=='N') { if (eq==0) printf(" Spurious EN, line %d\n", line); else eq = 0; if (totdel > 0) printf(" EN in %c%c, line %d\n", delim, delim, line); start = 0; } el((se if (eq && *in=='d' && *(in+1)=='e' && *(in+2)=='l' && *(in+3)=='i' && *(in+4)=='m') { for (p=in+5; *p; p++) if (*p != ' ') { if (*p == 'o' && *(p+1) == 'f') delim = 0; else delim = *p; break; } if (delim == 0) printf(" Delim off, line %d\n", line); else printf(" New delims %c%c, line %d\n", delim, delim, line); } if (ndel > 0 && eq > 0) printf(" %c%c in EQ, line %d\n", delim, delim, line); if (ndel == 0) continue; totdel += ndel; if (totdel%2) { if (start == 0) start = line; else { printf(" %d line %c%c, lines %d-%d\n", line-start+1, delim, delim, start, line); start = line; } } else { if (start > 0) { printf(" %d line %c%c, lines %d-%d\n", line-start+1, delim, delim, start, line); start = 0; } totdel = 0; } } if (totdel) printf(" Unfinished %c%c\n", delim, delim); if (eq) printf(" Unfinished EQ\n"); } n", delim, delim, line); if (ndel == 0) continue; totdel += ndel; icmd/checknr.c 444 0 33 27774 2531551141 6413 static char *sccsid = "@(#)checknr.c 4.4 (Berkeley) 5/13/81"; /* * checknr: check an nroff/troff input file for matching macro calls. * we also attempt to match size and font changes, but only the embedded * kind. These must end in \s0 and \fP resp. Maybe more sophistication * later but for now think of these restrictions as contributions to * structured typesetting. */ #include #include #define MAXSTK 100 /* Stack size */ #define MAXBR 100 /* Max number of bracket pairs known */ #define MAXCMDS 500 /* Max number of commands known */ /* * The stack on which we remember what we've seen so far. */ struct stkstr { int opno; /* number of opening bracket */ int pl; /* '+', '-', ' ' for \s, 1 for \f, 0 for .ft */ int parm; /* parm to size, font, etc */ int lno; /* line number the thing came in in */ } stk[MAXSTK]; int stktop; /* * The kinds of opening and closing brackets. */ struct brstr { char *opbr; char *clbr; } br[MAXBR] = { /* A few bare bones troff commands */ #define SZ 0 "sz", "sz", /* also \s */ #define FT 1 "ft", "ft", /* also \f */ /* the -mm package */ "AL", "LE", "AS", "AE", "BL", "LE", "BS", "BE", "DF", "DE", "DL", "LE", "DS", "DE", "FS", "FE", "ML", "LE", "NS", "NE", "RL", "LE", "VL", "LE", /* the -ms package */ "AB", "AE", "CD", "DE", "DS", "DE", "FS", "FE", "ID", "DE", "KF", "KE", "KS", "KE", "LD", "DE", "LG", "NL", "QS", "QE", "RS", "RE", "SM", "NL", /* The -me package */ "(b", ")b", "(c", ")c", "(d", ")d", "(f", ")f", "(l", ")l", "(q", ")q", "(x", ")x", "(z", ")z", /* Things needed by preprocessors */ "EQ", "EN", "TS", "TE", /* Refer */ "[", "]", 0, 0 }; /* * All commands known to nroff, plus macro packages. * Used so we can complain about unrecognized commands. */ char *knowncmds[MAXCMDS] = { "$c", "$f", "$h", "$p", "$s", "(b", "(c", "(d", "(f", "(l", "(q", "(t", "(x", "(z", ")b", ")c", ")d", ")f", ")l", ")q", ")t", ")x", ")z", "++", "+c", "1C", "1c", "2C", "2c", "@(", "@)", "@C", "@D", "@F", "@I", "@M", "@c", "@e", "@f", "@h", "@m", "@n", "@o", "@p", "@r", "@t", "@z", "AB", "AE", "AF", "AI", "AL", "AS", "AT", "AU", "AX", "B", "B1", "B2", "BD", "BE", "BG", "BL", "BS", "BT", "BX", "C1", "C2", "CD", "CM", "CT", "D", "DA", "DE", "DF", "DL", "DS", "DT", "EC", "EF", "EG", "EH", "EM", "EN", "EQ", "EX", "FA", "FD", "FE", "FG", "FJ", "FK", "FL", "FN", "FO", "FQ", "FS", "FV", "FX", "H", "HC", "HM", "HO", "HU", "I", "ID", "IE", "IH", "IM", "IP", "IZ", "KD", "KE", "KF", "KQ", "KS", "LB", "LC", "LD", "LE", "LG", "LI", "LP", "MC", "ME", "MF", "MH", "ML", "MR", "MT", "ND", "NE", "NH", "NL", "NP", "NS", "OF", "OH", "OK", "OP", "P", "PF", "PH", "PP", "PT", "PY", "QE", "QP", "QS", "R", "RA", "RC", "RE", "RL", "RP", "RQ", "RS", "RT", "S", "S0", "S2", "S3", "SA", "SG", "SH", "SK", "SM", "SP", "SY", "TA", "TB", "TC", "TD", "TE", "TH", "TL", "TM", "TP", "TQ", "TR", "TS", "TX", "UL", "US", "UX", "VL", "WC", "WH", "XD", "XF", "XK", "XP", "[", "[-", "[0", "[1", "[2", "[3", "[4", "[5", "[<", "[>", "[]", "]", "]-", "]<", "]>", "][", "ab", "ac", "ad", "af", "am", "ar", "as", "b", "ba", "bc", "bd", "bi", "bl", "bp", "br", "bx", "c.", "c2", "cc", "ce", "cf", "ch", "cs", "ct", "cu", "da", "de", "di", "dl", "dn", "ds", "dt", "dw", "dy", "ec", "ef", "eh", "el", "em", "eo", "ep", "ev", "ex", "fc", "fi", "fl", "fo", "fp", "ft", "fz", "hc", "he", "hl", "hp", "ht", "hw", "hx", "hy", "i", "ie", "if", "ig", "in", "ip", "it", "ix", "lc", "lg", "li", "ll", "ln", "lo", "lp", "ls", "lt", "m1", "m2", "m3", "m4", "mc", "mk", "mo", "n1", "n2", "na", "ne", "nf", "nh", "nl", "nm", "nn", "np", "nr", "ns", "nx", "of", "oh", "os", "pa", "pc", "pi", "pl", "pm", "pn", "po", "pp", "ps", "q", "r", "rb", "rd", "re", "rm", "rn", "ro", "rr", "rs", "rt", "sb", "sc", "sh", "sk", "so", "sp", "ss", "st", "sv", "sz", "ta", "tc", "th", "ti", "tl", "tm", "tp", "tr", "u", "uf", "uh", "ul", "vs", "wh", "xp", "yr", 0 }; int lineno; /* current line number in input file */ char line[256]; /* the current line */ char *cfilename; /* name of current file */ int nfiles; /* number of files to process */ int fflag; /* -f: ignore \f */ int sflag; /* -s: ignore \s */ int ncmds; /* size of knowncmds */ int slot; /* slot in knowncmds found by binsrch */ char *malloc(); main(argc, argv) int argc; char **argv; { FILE *f; int i; char *cp; char b1[4]; if (argc <= 1) usage(); /* Figure out how many known commands there are */ while (knowncmds[ncmds]) ncmds++; while (argc > 1 && argv[1][0] == '-') { switch(argv[1][1]) { /* -a: add pairs of macros */ case 'a': i = strlen(argv[1]) - 2; if (i % 6 != 0) usage(); /* look for empty macro slots */ for (i=0; br[i].opbr; i++) ; for (cp=argv[1]+3; cp[-1]; cp += 6) { br[i].opbr = malloc(3); strncpy(br[i].opbr, cp, 2); br[i].clbr = malloc(3); strncpy(br[i].clbr, cp+3, 2); addmac(br[i].opbr); /* knows pairs are also known cmds */ addmac(br[i].clbr); i++; } break; /* -c: add known commands */ case 'c': i = strlen(argv[1]) - 2; if (i % 3 != 0) usage(); for (cp=argv[1]+3; cp[-1]; cp += 3) { if (cp[2] && cp[2] != '.') usage(); strncpy(b1, cp, 2); addmac(b1); } break; /* -f: ignore font changes */ case 'f': fflag = 1; break; /* -s: ignore size changes */ case 's': sflag = 1; break; default: usage(); } argc--; argv++; } nfiles = argc - 1; if (nfiles > 0) { for (i=1; i=0; i--) { complain(i); } } complain(i) { pe(stk[i].lno); printf("Unmatched "); prop(i); printf("\n"); } prop(i) { if (stk[i].pl == 0) printf(".%s", br[stk[i].opno].opbr); else switch(stk[i].opno) { case SZ: printf("\\s%c%d", stk[i].pl, stk[i].parm); break; case FT: printf("\\f%c", stk[i].parm); break; default: printf("Bug: stk[%d].opno = %d = .%s, .%s", i, stk[i].opno, br[stk[i].opno].opbr, br[stk[i].opno].clbr); } } chkcmd(line, mac) char *line; char *mac; { register int i, n; /* * Check to see if it matches top of stack. */ if (stktop >= 0 && eq(mac, br[stk[stktop].opno].clbr)) stktop--; /* OK. Pop & forget */ else { /* No. Maybe it's an opener */ for (i=0; br[i].opbr; i++) { if (eq(mac, br[i].opbr)) { /* Found. Push it. */ stktop++; stk[stktop].opno = i; stk[stktop].pl = 0; stk[stktop].parm = 0; stk[stktop].lno = lineno; break; } /* * Maybe it's an unmatched closer. * NOTE: this depends on the fact * that(( none of the closers can be * openers too. */ if (eq(mac, br[i].clbr)) { nomatch(mac); break; } } } } nomatch(mac) char *mac; { register int i, j; /* * Look for a match further down on stack * If we find one, it suggests that the stuff in * between is supposed to match itself. */ for (j=stktop; j>=0; j--) if (eq(mac,br[stk[j].opno].clbr)) { /* Found. Make a good diagnostic. */ if (j == stktop-2) { /* * Check for special case \fx..\fR and don't * complain. */ if (stk[j+1].opno==FT && stk[j+1].parm!='R' && stk[j+2].opno==FT && stk[j+2].parm=='R') { stktop = j -1; return; } /* * We have two unmatched frobs. Chances are * they were intended to match, so we mention * them together. */ pe(stk[j+1].lno); prop(j+1); printf(" does not match %d: ", stk[j+2].lno); prop(j+2); printf("\n"); } else for (i=j+1; i <= stktop; i++) { complain(i); } stktop = j-1; return; } /* Didn't find one. Throw this away. */ pe(lineno); printf("Unmatched .%s\n", mac); } /* eq: are two strings equal? */ eq(s1, s2) char *s1, *s2; { return (strcmp(s1, s2) == 0); } /* print the first part of an error message, given the line number */ pe(lineno) int lineno; { if (nfiles > 1) printf("%s: ", cfilename); printf("%d: ", lineno); } checkknown(mac) char *mac; { if (eq(mac, ".")) return; if (binsrch(mac) >= 0) return; if (mac[0] == '\\' && mac[1] == '"') /* comments */ return; pe(lineno); printf("Unknown command: .%s\n", mac); } /* * We have a .de xx line in "line". Add xx to the list of known commands. */ addcmd(line) char *line; { char *mac; /* grab the macro being defined */ mac = line+4; while (isspace(*mac)) mac++; if (*mac == 0) { pe(lineno); printf("illegal define: %s\n", line); return; } mac[2] = 0; if (isspace(mac[1]) || mac[1] == '\\') mac[1] = 0; if (ncmds >= MAXCMDS) { printf("Only %d known commands allowed\n", MAXCMDS); exit(1); } addmac(mac); } /* * Add mac to the list. We should really have some kind of tree * structure here but this is a quick-and-dirty job and I just don't * have time to mess with it. (I wonder if this will come back to haunt * me someday?) Anyway, I claim that .de is fairly rare in user * nroff programs, and the register loop below is pretty fast. */ addmac(mac) char *mac; { register char **src, **dest, **loc; binsrch(mac); /* it's OK to redefine something */ /* binsrch sets slot as a side effect */ #ifdef DEBUG printf("binsrch(%s) -> %d\n", mac, slot); #endif loc = &knowncmds[slot]; src = &knowncmds[ncmds-1]; dest = src+1; while (dest > loc) *dest-- = *src--; *loc = malloc(3); strcpy(*loc, mac); ncmds++; #ifdef DEBUG printf("after: %s %s %s %s %s, %d cmds\n", knowncmds[slot-2], knowncmds[slot-1], knowncmds[slot], knowncmds[slot+1], knowncmds[slot+2], ncmds); #endif } /* * Do a binary search in knowncmds for mac. * If found, return the index. If not, return -1. */ binsrch(mac) char *mac; { register char *p; /* pointer to current cmd in list */ register int d; /* difference if any */ register int mid; /* mid point in binary search */ register int top, bot; /* boundaries of bin search, inclusive */ top = ncmds-1; bot = 0; while (top >= bot) { mid = (top+bot)/2; p = knowncmds[mid]; d = p[0] - mac[0]; if (d == 0) d = p[1] - mac[1]; if (d == 0) return mid; if (d < 0) bot = mid + 1; else top = mid - 1; } slot = bot; /* place it would have gone */ return -1; } regicmd/chfn.c 444 0 33 3737 2416237642 5676 static char *sccsid = "@(#)chfn.c 4.1 (Berkeley) 10/1/80"; /* * chfn - change full name (or other info in gecos field) */ #include #include #include char passwd[] = "/etc/passwd"; char temp[] = "/etc/ptmp"; struct passwd *pwd; struct passwd *getpwent(); int endpwent(); char *crypt(); char *getpass(); char *pw; char pwbuf[10]; char buf[BUFSIZ]; main(argc, argv) char *argv[]; { char *p; int i; char saltc[2]; long salt; int u,fi,fo; int insist; int ok, flags; int c; int pwlen; FILE *tf; insist = 0; if (argc != 3) { printf("Usage: chfn user full-name\n"); goto bex; } if (index(argv[2], ':') || index(argv[2], '\n')) { printf("Illegal character in new string\n"); exit(1); } while((pwd=getpwent()) != NULL){ if(strcmp(pwd->pw_name,argv[1]) == 0){ u = getuid(); if(u!=0 && u != pwd->pw_uid){ printf("Permission denied.\n"); goto bex; } break; } } endpwent(); signal(SIGHUP, 1); signal(SIGINT, 1); signal(SIGQUIT, 1); signal(SIGTSTP, 1); if(access(temp, 0) >= 0) { printf("Temporary file busy -- try again\n"); goto bex; } if((tf=fopen(temp,"w")) == NULL) { printf("Cannot create temporary file\n"); goto bex; } /* * copy passwd to temp, replacing matching lines * with new shell. */ while((pwd=getpwent()) != NULL) { if(strcmp(pwd->pw_name,argv[1]) == 0) { u = getuid(); if(u != 0 && u != pwd->pw_uid) { printf("Permission denied.\n"); goto out; } pwd->pw_gecos = argv[2]; } fprintf(tf,"%s:%s:%d:%d:%s:%s:%s\n", pwd->pw_name, pwd->pw_passwd, pwd->pw_uid, pwd->pw_gid, pwd->pw_gecos, pwd->pw_dir, pwd->pw_shell); } endpwent(); fclose(tf); /* * copy temp back to passwd file */ if((fi=open(temp,0)) < 0) { printf("Temp file disappeared!\n"); goto out; } if((fo=creat(passwd, 0644)) < 0) { printf("Cannot recreat passwd file.\n"); goto out; } while((u=read(fi,buf,sizeof(buf))) > 0) write(fo,buf,u); out: unlink(temp); bex: exit(1); } 2]; } fprintf(tf,"%s:%s:%d:%dcmd/chgrp.c 444 0 33 1456 2416237643 6060 static char *sccsid = "@(#)chgrp.c 4.1 (Berkeley) 10/1/80"; /* * chgrp gid file ... */ #include #include #include #include #include struct group *gr,*getgrnam(); struct stat stbuf; int gid; int status; main(argc, argv) char *argv[]; { register c; if(argc < 3) { printf("usage: chgrp gid file ...\n"); exit(4); } if(isnumber(argv[1])) { gid = atoi(argv[1]); } else { if((gr=getgrnam(argv[1])) == NULL) { printf("unknown group: %s\n",argv[1]); exit(4); } gid = gr->gr_gid; } for(c=2; c #include #include #define USER 05700 /* user's bits */ #define GROUP 02070 /* group's bits */ #define OTHER 00007 /* other's bits */ #define ALL 01777 /* all (note absence of setuid, etc) */ #define READ 00444 /* read permit */ #define WRITE 00222 /* write permit */ #define EXEC 00111 /* exec permit */ #define SETID 06000 /* set[ug]id */ #define STICKY 01000 /* sticky bit */ char *ms; int um; struct stat st; main(argc,argv) char **argv; { register i; register char *p; int status = 0; if (argc < 3) { fprintf(stderr, "Usage: chmod [ugoa][+-=][rwxstugo] file ...\n"); exit(255); } ms = argv[1]; um = umask(0); newmode(0); for (i = 2; i < argc; i++) { p = argv[i]; if (stat(p, &st) < 0) { fprintf(stderr, "chmod: can't access %s\n", p); ++status; continue; } ms = argv[1]; if (chmod(p, newmode(st.st_mode)) < 0) { fprintf(stderr, "chmod: can't change %s\n", p); ++status; continue; } } exit(status); } newmode(nm) unsigned nm; { register o, m, b; m = abs(); if (!*ms) return(m); do { m = who(); while (o = what()) { b = where(nm); switch (o) { case '+': nm |= b & m; break; case '-': nm &= ~(b & m); break; case '=': nm &= ~m; nm |= b & m; break; } } } while (*ms++ == ','); if (*--ms) { fprintf(stderr, "chmod: invalid mode\n"); exit(255); } return(nm); } abs() { register c, i; i = 0; while ((c = *ms++) >= '0' && c <= '7') i = (i << 3) + (c - '0'); ms--; return(i); } who() { register m; m = 0; for (;;) switch (*ms++) { case 'u': m |= USER; continue; case 'g': m |= GROUP; continue; case 'o': m |= OTHER; continue; case 'a': m |= ALL; continue; default: ms--; if (m == 0) m = ALL & ~um; return m; } } what() { switch (*ms) { case '+': case '-': case '=': return *ms++; } return(0); } where(om) ((register om; { register m; m = 0; switch (*ms) { case 'u': m = (om & USER) >> 6; goto dup; case 'g': m = (om & GROUP) >> 3; goto dup; case 'o': m = (om & OTHER); dup: m &= (READ|WRITE|EXEC); m |= (m << 3) | (m << 6); ++ms; return m; } for (;;) switch (*ms++) { case 'r': m |= READ; continue; case 'w': m |= WRITE; continue; case 'x': m |= EXEC; continue; case 's': m |= SETID; continue; case 't': m |= STICKY; continue; default: ms--; return m; } } om) cmd/chown.c 444 0 33 1467 2416237650 6073 static char *sccsid = "@(#)chown.c 4.1 (Berkeley) 10/1/80"; /* * chown uid file ... */ #include #include #include #include #include struct passwd *pwd,*getpwnam(); struct stat stbuf; int uid; int status; main(argc, argv) char *argv[]; { register c; if(argc < 3) { printf("usage: chown uid file ...\n"); exit(4); } if(isnumber(argv[1])) { uid = atoi(argv[1]); goto cho; } if((pwd=getpwnam(argv[1])) == NULL) { printf("unknown user id: %s\n",argv[1]); exit(4); } uid = pwd->pw_uid; cho: for(c=2; c #include #include char passwd[] = "/etc/passwd"; char temp[] = "/etc/ptmp"; struct passwd *pwd; struct passwd *getpwent(); int endpwent(); char *crypt(); char *getpass(); char *pw; char pwbuf[10]; char buf[BUFSIZ]; main(argc, argv) char *argv[]; { char *p; int i; char saltc[2]; long salt; int u,fi,fo; int insist; int ok, flags; int c; int pwlen; FILE *tf; insist = 0; if(argc < 2 || argc > 3) { printf("Usage: chsh user [ /bin/oldcsh ] [ /bin/csh ]\n"); goto bex; } if (argc == 2) argv[2] = ""; else if (strcmp(argv[2], "/bin/oldcsh") && strcmp(argv[2], "/bin/csh") && getuid()) { printf("Only /bin/oldcsh or /bin/csh may be specified\n"); exit(1); } if (argc == 3) if (stat(argv[2]) < 0) { printf("%s is unavailable\n",argv[2]); exit(1); } while((pwd=getpwent()) != NULL){ if(strcmp(pwd->pw_name,argv[1]) == 0){ u = getuid(); if(u!=0 && u != pwd->pw_uid){ printf("Permission denied.\n"); goto bex; } break; } } endpwent(); signal(SIGHUP, 1); signal(SIGINT, 1); signal(SIGQUIT, 1); signal(SIGTSTP, 1); if(access(temp, 0) >= 0) { printf("Temporary file busy -- try again\n"); goto bex; } if((tf=fopen(temp,"w")) == NULL) { printf("Cannot create temporary file\n"); goto bex; } /* * copy passwd to temp, replacing matching lines * with new shell. */ while((pwd=getpwent()) != NULL) { if(strcmp(pwd->pw_name,argv[1]) == 0) { u = getuid(); if(u != 0 && u != pwd->pw_uid) { printf("Permission denied.\n"); goto out; } pwd->pw_shell = argv[2]; } fprintf(tf,"%s:%s:%d:%d:%s:%s:%s\n", pwd->pw_name, pwd->pw_passwd, pwd->pw_uid, pwd->pw_gid, pwd->pw_gecos, pwd->pw_dir, pwd->pw_shell); } endpwent(); fclose(tf); /* * copy temp back to passwd file */ if((fi=open(temp,0)) < 0) { printf("Temp file disappeared!\n"); goto out; } if((fo=creat(passwd, 0644)) < 0) { printf("Cannot recreat passwd file.\n"); goto out; } while((u=read(fi,buf,sizeof(buf))) > 0) write(fo,buf,u); out: unlink(temp); bex: exit(1); } 2]; } fprintf(tf,"%s:%s:%d:%d:%s:%s:%s\n", pwd->pw_name, pwd->pw_passwd, pwd->pw_uid, pwd->pw_gid, pwd->pw_gecos, pwd->pw_dir, pwd->pw_shell); } endpwent(); fclose(tf); /* * copy temp back to passwd file */ if((fi=open(temp,0)) < 0) { printf("Temp file disappeared!\n"); goto out; } if((fo=creat(passwd, 0644)) < 0) { printf("Cannot recreat cmd/clear.c 444 0 33 1351 2416237655 6040 static char *sccsid = "@(#)clear.c 4.1 (Berkeley) 10/1/80"; /* load me with -ltermlib */ /* #include on version 6 */ /* * clear - clear the screen */ #include #include char *getenv(); char *tgetstr(); char PC; short ospeed; #undef putchar int putchar(); main() { char *cp = getenv("TERM"); char clbuf[20]; char pcbuf[20]; char *clbp = clbuf; char *pcbp = pcbuf; char *clear; char buf[1024]; char *pc; struct sgttyb tty; gtty(1, &tty); ospeed = tty.sg_ospeed; if (cp == (char *) 0) exit(1); if (tgetent(buf, cp) != 1) exit(1); pc = tgetstr("pc", &pcbp); if (pc) PC = *pc; clear = tgetstr("cl", &clbp); if (clear) tputs(clear, tgetnum("li"), putchar); exit (clear != (char *) 0); } r(); char PC; short ospeed; #undef putchar int putchar(); main() { char *cp = getenv("TERM"); char clbuf[20]; char pcbuf[20]; char *clbp = clbuf; char *pcbp = pcbuf; char *clear; char buf[1024]; char *pc; struct sgttyb tty; gtty(1, &tty); ospeed = tty.sg_ospeed; ifcmd/clri.c 444 0 33 2461 2416237657 5710 static char *sccsid = "@(#)clri.c 4.1 (Berkeley) 10/1/80"; /* * clri filsys inumber ... */ #include #include #define ISIZE (sizeof(struct dinode)) #define NI (BSIZE/ISIZE) struct ino { char junk[ISIZE]; }; struct ino buf[NI]; int status; main(argc, argv) char *argv[]; { register i, f; unsigned n; int j, k; long off; if(argc < 3) { printf("usage: clri filsys inumber ...\n"); exit(4); } f = open(argv[1], 2); if(f < 0) { printf("cannot open %s\n", argv[1]); exit(4); } for(i=2; i '9') return(0); return(1); } *)buf, BSIZE) != BSIZE) { printf("%s: read error\n", argv[i]); status = 1; } } if(status) exit(status); for(i=2; i #include FILE *file1,*file2; int eflg; int lflg = 1; long line = 1; long chr = 0; long skip1; long skip2; long otoi(); main(argc, argv) char **argv; { register c1, c2; char *arg; if(argc < 3) goto narg; arg = argv[1]; if(arg[0] == '-' && arg[1] == 's') { lflg--; argv++; argc--; } arg = argv[1]; if(arg[0] == '-' && arg[1] == 'l') { lflg++; argv++; argc--; } if(argc < 3) goto narg; arg = argv[1]; if( arg[0]=='-' && arg[1]==0 ) file1 = stdin; else if((file1 = fopen(arg, "r")) == NULL) goto barg; arg = argv[2]; if((file2 = fopen(arg, "r")) == NULL) goto barg; if (argc>3) skip1 = otoi(argv[3]); if (argc>4) skip2 = otoi(argv[4]); while (skip1) { if ((c1 = getc(file1)) == EOF) { arg = argv[1]; goto earg; } skip1--; } while (skip2) { if ((c2 = getc(file2)) == EOF) { arg = argv[2]; goto earg; } skip2--; } loop: chr++; c1 = getc(file1); c2 = getc(file2); ((if(c1 == c2) { if (c1 == '\n') line++; if(c1 == EOF) { if(eflg) exit(1); exit(0); } goto loop; } if(lflg == 0) exit(1); if(c1 == EOF) { arg = argv[1]; goto earg; } if(c2 == EOF) goto earg; if(lflg == 1) { printf("%s %s differ: char %ld, line %ld\n", argv[1], arg, chr, line); exit(1); } eflg = 1; printf("%6ld %3o %3o\n", chr, c1, c2); goto loop; narg: printf("cmp: arg count\n"); exit(2); barg: if (lflg) printf("cmp: cannot open %s\n", arg); exit(2); earg: printf("cmp: EOF on %s\n", arg); exit(1); } long otoi(s) char *s; { long v; int base; v = 0; base = 10; if (*s == '0') base = 8; while(isdigit(*s)) v = v*base + *s++ - '0'; return(v); } == EOF) goto earg; if(lflg == 1) { printf("%s %s differ: char %ld, line %ld\n", argv[1], arg, chr, line); exit(1); } eflg = 1; printf("%6ld %3o %3o\n", chr, c1, c2); goto loop; narg: printf("cmp: arg count\n"); exit(2); barg: if (lflg) printf("cmp: cannot open %s\n", arg); exit(2); earg:cmd/col.c 444 0 33 10227 2416237663 5550 static char *sccsid = "@(#)col.c 4.1 (Berkeley) 10/1/80"; # include # define PL 256 # define ESC '\033' # define RLF '\013' # define SI '\017' # define SO '\016' # define GREEK 0200 # define LINELN 800 char *page[PL]; char lbuff [LINELN], *line; int bflag, hflag, fflag; int half; int cp, lp; int ll, llh, mustwr; int pcp = 0; char *pgmname; char *strcpy(); main (argc, argv) int argc; char **argv; { int i; int greek; register int c; char fbuff[BUFSIZ]; setbuf (stdout, fbuff); pgmname = argv[0]; for (i = 1; i < argc; i++) { register char *p; if (*argv[i] != '-') { fprintf (stderr, "%s: bad option %s\n", pgmname, argv[i]); exit (2); } for (p = argv[i]+1; *p; p++) { switch (*p) { case 'b': bflag++; break; case 'h': hflag++; break; case 'f': fflag++; break; default: fprintf (stderr, "%s: bad option letter %c\n", pgmname, *p); exit (2); } } } for (ll=0; ll 0) { incr(); incr(); half -= 2; } } break; } continue; case SO: greek = GREEK; continue; case SI: greek = 0; continue; case RLF: decr(); decr(); continue; case '\r': cp = 0; continue; case '\t': cp = (cp + 8) & -8; continue; case '\b': if (cp > 0) cp--; continue; case ' ': cp++; continue; default: c &= 0177; if (c > 040 && c < 0177) { /* if printable */ outc(c | greek); cp++; } continue; } } for (i=0; i cp) { line = lbuff; lp = 0; } while (lp < cp) { switch (*line) { case '\0': *line = ' '; lp++; break; case '\b': lp--; break; default: lp++; } line++; } while (*line == '\b') { line += 2; } if (bflag || *line == '\0' || *line == ' ') *line = c; else { register char c1, c2, c3; c1 = *++line; *line++ = '\b'; c2 = *line; *line++ = c; while (c1) { c3 = *line; *line++ = c1; c1 = c2; c2 = c3; } lp = 0; line = lbuff; } } store (lno) { char *malloc(); lno %= PL; if (page[lno] != 0) free (page[lno]); page[lno] = malloc((unsigned)strlen(lbuff) + 2); if (page[lno] == 0) { fprintf (stderr, "%s: no storage\n", pgmname); exit (2); } strcpy (page[lno],lbuff); } fetch(lno) { register char *p; lno %= PL; p = lbuff; while (*p) *p++ = '\0'; line = lbuff; lp = 0; if (page[lno]) strcpy (line, page[lno]); } emit (s, lineno) char *s; int lineno; { static int cline = 0; register int ncp; register char *p; static int gflag = 0; if (*s) { while (cline < lineno - 1) { putchar ('\n'); pcp = 0; cline += 2; } if (cline != lineno) { putchar (ESC); putchar ('9'); cline++; } if (pcp) putchar ('\r'); pcp = 0; p = s; while (*p) { ncp = pcp; while (*p++ == ' ') { if ((++ncp & 7) == 0 && hflag) { pcp = ncp; putchar ('\t'); } } if (!*--p) break; while (pcp < ncp) { putchar (' '); pcp++; } if (gflag != (*p & GREEK) && *p != '\b') { if (gflag) putchar (SI); else putchar (SO); gflag ^= GREEK; } putchar (*p & ~GREEK); if (*p++ == '\b') pcp--; else pcp++; } } } incr() { store (ll++); if (ll > llh) llh = ll; if (ll >= mustwr && page[ll%PL]) { emit (page[ll%PL], ll - PL); mustwr++; free (page[ll%PL]); page[ll%PL] = 0; } fetch (ll); } decr() { if (ll > mustwr - PL) { store (ll--); fetch (ll); } } putchar (' '); pcp++; } if (gflag != (*p & GREEK) && *p != '\b') { if (gflag) putchar (SI); else putchar (SO); gflag ^= GREEK; } putchar (*p & ~GREEK); if (*p++ == '\b') pcp--; else pcp++; } } } incr() { store (ll++); if (ll > llh) llh = ll; if (ll >= mustwr && page[ll%PL]) { emit (page[ll%PL], cmd/colcrt.c 444 0 33 7454 2512563265 6246 static char *sccsid = "@(#)colcrt.c 4.2 (Berkeley) 4/3/81"; #include /* * colcrt - replaces col for crts with new nroff esp. when using tbl. * Bill Joy UCB July 14, 1977 * * This filter uses a screen buffer, 267 half-lines by 132 columns. * It interprets the up and down sequences generated by the new * nroff when used with tbl and by \u \d and \r. * General overstriking doesn't work correctly. * Underlining is split onto multiple lines, etc. * * Option - suppresses all underlining. * Option -2 forces printing of all half lines. */ char page[267][132]; int outline = 1; int outcol; char buf[BUFSIZ]; char suppresul; char printall; char *progname; FILE *f; main(argc, argv) int argc; char *argv[]; { register c; register char *cp, *dp; argc--; progname = *argv++; while (argc > 0 && argv[0][0] == '-') { switch (argv[0][1]) { case 0: suppresul = 1; break; case '2': printall = 1; break; default: printf("usage: %s [ - ] [ -2 ] [ file ... ]\n", progname); fflush(stdout); exit(1); } argc--; argv++; } setbuf(stdout, buf); do { if (argc > 0) { close(0); if ((f=fopen(argv[0], "r") ) < 0) { fflush(stdout); perror(argv[0]); fflush(stdout); exit (1); } argc--; argv++; } for (;;) { c = getc(stdin); if (c == -1) { pflush(outline); fflush(stdout); break; } switch (c) { case '\n': if (outline >= 265) pflush(62); outline += 2; outcol = 0; continue; case '\016': case '\017': continue; case 033: c = getc(stdin); switch (c) { case '9': if (outline >= 266) pflush(62); outline++; continue; case '8': if (outline >= 1) outline--; continue; case '7': outline -= 2; if (outline < 0) outline = 0; continue; default: continue; } case '\b': if (outcol) outcol--; continue; case '\t': outcol += 8; outcol &= ~7; outcol--; c = ' '; default: if (outcol >= 132) { outcol++; continue; } cp = &page[outline][outcol]; outcol++; if (c == '_') { if (suppresul) continue; cp += 132; c = '-'; } if (*cp == 0) { *cp = c; dp = cp - outcol; for (cp--; cp >= dp && *cp == 0; cp--) *cp = ' '; } else if (plus(c, *cp) || plus(*cp, c)) *cp = '+'; else if (*cp == ' ' || *cp == 0) *cp = c; continue; } } } while (argc > 0); fflush(stdout); exit(0); } plus(c, d) char c, d; { return (c == '|' && d == '-' || d == '_'); } int first; pflush(ol) int ol; { register int i, j; register char *cp; char lastomit; int l; l = ol; lastomit = 0; if (l > 266) l = 266; else l |= 1; for (i = first | 1; i < l; i++) { move(i, i - 1); move(i, i + 1); } for (i = first; i < l; i++) { cp = page[i]; if (printall == 0 && lastomit == 0 && *cp == 0) { lastomit = 1; continue; } lastomit = 0; printf("%s\n", cp); } copy(page, page[ol], (267 - ol) * 132); clear(page[267- ol], ol * 132); outline -= ol; outcol = 0; first = 1; } move(l, m) int l, m; { register char *cp, *dp; for (cp = page[l], dp = page[m]; *cp; cp++, dp++) { switch (*cp) { case '|': if (*dp != ' ' && *dp != '|' && *dp != 0) return; break; case ' ': break; default: return; } } if (*cp == 0) { for (cp = page[l], dp = page[m]; *cp; cp++, dp++) if (*cp == '|') *((dp = '|'; else if (*dp == 0) *dp = ' '; page[l][0] = 0; } } copy(to, from, i) register char *to, *from; register int i; { if (i > 0) do *to++ = *from++; while (--i); } clear(at, cnt) register char *at; register int cnt; { if (cnt > 0) do *at++ = 0; while (--cnt); } (*dp != ' ' && *dp != '|' && *dp != 0) return; break; case ' ': break; default: return; } } if (*cp == 0) { for (cp = page[l], dp = page[m]; *cp; cp++, dp++) if (*cp == '|') *cmd/halt.c 444 0 33 4527 2517475371 5713 static char *sccsid = "@(#)halt.c 4.5 (Berkeley) 4/17/81"; /* * Halt */ #include #include #include #include #include #include #define SHUTDOWNLOG "/usr/adm/shutdownlog" main(argc, argv) int argc; char **argv; { int howto; char *ttyn = (char *)ttyname(2); register i; register qflag; howto = RB_HALT; argc--, argv++; while (argc > 0) { if (!strcmp(*argv, "-n")) howto |= RB_NOSYNC; else if (!strcmp(*argv, "-y")) ttyn = 0; else if (!strcmp(*argv, "-q")) qflag++; else { fprintf(stderr, "usage: halt [ -n ]\n"); exit(1); } argc--, argv++; } if (ttyn && *(ttyn+strlen("/dev/tty")) == 'd') { fprintf(stderr, "halt: dangerous on a dialup; use ``halt -y'' if you are really sure\n"); exit(1); } if (kill(1, SIGTSTP) == -1) { fprintf(stderr, "reboot: can't idle init\n"); exit(1); } if (!qflag) for (i = 1; ; i++) { if (kill(-1, SIGKILL) == -1) { extern int errno; if (errno == ESRCH) break; perror("reboot: kill"); kill(1, SIGHUP); exit(1); } if (i > 5) { fprintf(stderr, "CAUTION: some process(es) wouldn't die\n"); break; } setalarm(2 * i); pause(); } if ((howto & RB_NOSYNC) == 0) log_entry(); if (!qflag) { if ((howto & RB_NOSYNC)==0) { markdown(); sync(); sync(); } setalarm(5); pause(); } syscall(55, howto); perror("reboot"); } dingdong() { /* RRRIIINNNGGG RRRIIINNNGGG */ } setalarm(n) { signal(SIGALRM, dingdong); alarm(n); } #include #define SCPYN(a, b) strncpy(a, b, sizeof(a)) char wtmpf[] = "/usr/adm/wtmp"; struct utmp wtmp; markdown() { register f = open(wtmpf, 1); if (f >= 0) { lseek(f, 0L, 2); SCPYN(wtmp.ut_line, "~"); SCPYN(wtmp.ut_name, "shutdown"); time(&wtmp.ut_time); write(f, (char *)&wtmp, sizeof(wtmp)); close(f); } } char *days[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; log_entry() { FILE *fp; struct tm *tm, *localtime(); time_t now; time(&now); tm = localtime(&now); fp = fopen(SHUTDOWNLOG, "a"); if (fp == NULL) return; fseek(fp, 0L, 2); fprintf(fp, "%02d:%02d %s %s %2d, %4d. Halted.\n", tm->tm_hour, tm->tm_min, days[tm->tm_wday], months[tm->tm_mon], tm->tm_mday, tm->tm_year + 1900); fclose(fp); } Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; log_entry(cmd/comm.c 444 0 33 4301 2416237672 5702 static char *sccsid = "@(#)comm.c 4.1 (Berkeley) 10/1/80"; #include #define LB 256 int one; int two; int three; char *ldr[3]; FILE *ib1; FILE *ib2; FILE *openfil(); main(argc,argv) char *argv[]; { int l; char lb1[LB],lb2[LB]; ldr[0] = ""; ldr[1] = "\t"; ldr[2] = "\t\t"; if(argc > 1) { if(*argv[1] == '-' && argv[1][1] != 0) { l = 1; while(*++argv[1]) { switch(*argv[1]) { case'1': if(!one) { one = 1; ldr[1][0] = ldr[2][l--] = '\0'; } break; case '2': if(!two) { two = 1; ldr[2][l--] = '\0'; } break; case '3': three = 1; break; default: fprintf(stderr,"comm: illegal flag\n"); exit(1); } } argv++; argc--; } } if(argc < 3) { fprintf(stderr,"comm: arg count\n"); exit(1); } ib1 = openfil(argv[1]); ib2 = openfil(argv[2]); if(rd(ib1,lb1) < 0) { if(rd(ib2,lb2) < 0) exit(0); copy(ib2,lb2,2); } if(rd(ib2,lb2) < 0) copy(ib1,lb1,1); while(1) { switch(compare(lb1,lb2)) { case 0: wr(lb1,3); if(rd(ib1,lb1) < 0) { if(rd(ib2,lb2) < 0) exit(0); copy(ib2,lb2,2); } if(rd(ib2,lb2) < 0) copy(ib1,lb1,1); continue; case 1: wr(lb1,1); if(rd(ib1,lb1) < 0) copy(ib2,lb2,2); continue; case 2: wr(lb2,2); if(rd(ib2,lb2) < 0) copy(ib1,lb1,1); continue; } } } rd(file,buf) FILE *file; char *buf; { register int i, c; i = 0; while((c = getc(file)) != EOF) { *buf = c; if(c == '\n' || i > LB-2) { *buf = '\0'; return(0); } i++; buf++; } return(-1); } wr(str,n) char *str; { switch(n) { case 1: if(one) return; break; case 2: if(two) return; break; case 3: if(three) return; } printf("%s%s\n",ldr[n-1],str); } copy(ibuf,lbuf,n) FILE *ibuf; char *lbuf; { do { wr(lbuf,n); } while(rd(ibuf,lbuf) >= 0); exit(0); } compare(a,b) char *a,*b; { register char *ra,*rb; ra = --a; rb = --b; while(*++ra == *++rb) if(*ra == '\0') return(0); if(*ra < *rb) return(1); return(2); } FILE *openfil(s) char *s; { FILE *b; if(s[0]=='-' && s[1]==0) b = stdin; else if((b=fopen(s,"r")) == NULL) { fprintf(stderr,"comm: cannot open %s\n",s); exit(1); } return(b); } e) return; } printf("%s%s\n",ldr[n-1],str); } copy(ibuf,lbuf,n) FILE *ibuf; char *lbuf; { do { wr(lbuf,n); } while(rd(ibuf,lbuf) >= 0); exit(0); } compare(a,b) char *a,*b; { register char *ra,*rb; ra = --a; rb = --b; while(*++ra == *++rb) if(*ra == '\0') return(0); if(*ra < *rb) return(1); return(2cmd/cp.c 444 0 33 4370 2416237673 5360 static char *sccsid = "@(#)cp.c 4.1 (Berkeley) 10/1/80"; /* * cp oldfile newfile */ #define BSIZE 1024 #include #include #include struct stat stbuf1, stbuf2; char iobuf[BSIZE]; int iflag = 0; /* interactive flag. If this flag is set, * the user is queried before files are * destroyed by cp. */ main(argc, argv) char *argv[]; { register i, r; /* get the flag(s) */ if (argc < 2) goto usage; if (*argv[1] == '-') { argc--; while (*++argv[1] != '\0') switch (*argv[1]) { /* interactive mode */ case 'i': iflag++; break; /* don't live with bad options */ default: goto usage; } argv++; } if (argc < 3) goto usage; if (argc > 3) { if (stat(argv[argc-1], &stbuf2) < 0) goto usage; if ((stbuf2.st_mode&S_IFMT) != S_IFDIR) goto usage; } r = 0; for(i=1; i=0 && (stbuf2.st_mode&S_IFMT) == S_IFDIR) { p1 = from; p2 = to; bp = iobuf; while(*bp++ = *p2++) ; bp[-1] = '/'; p2 = bp; while(*bp = *p1++) if (*bp++ == '/') bp = p2; to = iobuf; } if (stat(to, &stbuf2) >= 0) { if (stbuf1.st_dev == stbuf2.st_dev && stbuf1.st_ino == stbuf2.st_ino) { fprintf(stderr, "cp: cannot copy file to itself.\n"); return(1); } else if (iflag) { fprintf (stderr, "overwrite %s? ", to); i = c = getchar(); while (c != '\n' && c != EOF) c = getchar(); if (i != 'y') return(1); } } if ((fnew = creat(to, mode)) < 0) { fprintf(stderr, "cp: cannot create %s\n", to); close(fold); return(1); } while(n = read(fold, iobuf, BSIZE)) { if (n < 0) { perror("cp: read"); close(fold); close(fnew); return(1); } else if (write(fnew, iobuf, n) != n) { perror("cp: write"); close(fold); close(fnew); return(1); } } close(fold); close(fnew); return(0); } tchar(); while (c != '\n' && c != EOF) c = getchar(); if (i != 'y') return(1); } } if ((fnew = creat(to, mode)) < 0) { fprintf(stderr, "cp: cannot create %s\n", to); close(fold); return(1); } while(n = read(fold, iobuf, BSIZE)) { if (cmd/cron.c 444 0 33 7270 2551501136 5705 ((static char *sccsid = "@(#)cron.c 4.3 (Berkeley) 7/5/81"; #include #include #include #include #include #include #define LISTS 512 #define EXACT 100 #define ANY 101 #define LIST 102 #define RANGE 103 #define EOS 104 char crontab[] = "/usr/lib/crontab"; time_t itime; struct tm *loct; struct tm *localtime(); char *malloc(); char *realloc(); int flag; char *list; unsigned listsize; main() { register char *cp; char *cmp(); time_t filetime = 0; /* setuid(1); */ if (fork()) exit(0); chdir("/"); freopen(crontab, "r", stdin); freopen("/", "r", stdout); freopen("/", "r", stderr); signal(SIGHUP, SIG_IGN); signal(SIGINT, SIG_IGN); signal(SIGQUIT, SIG_IGN); time(&itime); itime -= localtime(&itime)->tm_sec; fclose(stdin); for (;; itime+=60, slp()) { struct stat cstat; if (stat(crontab, &cstat) == -1) continue; if (cstat.st_mtime > filetime) { filetime = cstat.st_mtime; init(); } loct = localtime(&itime); loct->tm_mon++; /* 1-12 for month */ for(cp = list; *cp != EOS;) { flag = 0; cp = cmp(cp, loct->tm_min); cp = cmp(cp, loct->tm_hour); cp = cmp(cp, loct->tm_mday); cp = cmp(cp, loct->tm_mon); cp = cmp(cp, loct->tm_wday); if(flag == 0) ex(cp); while(*cp++ != 0) ; } } } char * cmp(p, v) char *p; { register char *cp; cp = p; switch(*cp++) { case EXACT: if (*cp++ != v) flag++; return(cp); case ANY: return(cp); case LIST: while(*cp != LIST) if(*cp++ == v) { while(*cp++ != LIST) ; return(cp); } flag++; return(cp+1); case RANGE: if(*cp > v || cp[1] < v) flag++; return(cp+2); } if(cp[-1] != v) flag++; return(cp); } slp() { register i; time_t t; time(&t); i = itime - t; if(i < -60 * 60 || i > 60 * 60) { itime = t; i = 60 - localtime(&itime)->tm_sec; itime += i; } if(i > 0) sleep(i); } ex(s) char *s; { int st; if(fork()) { wait(&st); return; } if(fork()) exit(0); freopen("/", "r", stdin); execl("/bin/sh", "sh", "-c", s, 0); exit(0); } init() { register i, c; register char *cp; register char *ocp; register int n; freopen(crontab, "r", stdin); if (list) { free(list); list = realloc(list, LISTS); } else list = malloc(LISTS); listsize = LISTS; cp = list; loop: if(cp > list+listsize-100) { char *olist; listsize += LISTS; olist = list; free(list); list = realloc(list, listsize); cp = list + (cp - olist); } ocp = cp; for(i=0;; i++) { do c = getchar(); while(c == ' ' || c == '\t') ; if(c == EOF || c == '\n') goto ignore; if(i == 5) break; if(c == '*') { *cp++ = ANY; continue; } if ((n = number(c)) < 0) goto ignore; c = getchar(); if(c == ',') goto mlist; if(c == '-') goto mrange; if(c != '\t' && c != ' ') goto ignore; *cp++ = EXACT; *cp++ = n; continue; mlist: *cp++ = LIST; *cp++ = n; do { if ((n = number(getchar())) < 0) goto ignore; *cp++ = n; c = getchar(); } while (c==','); if(c != '\t' && c != ' ') goto ignore; *cp++ = LIST; continue; mrange: *cp++ = RANGE; *cp++ = n; if ((n = number(getchar())) < 0) goto ignore; c = getchar(); if(c != '\t' && c != ' ') goto ignore; *cp++ = n; } while(c != '\n') { if(c == EOF) goto ignore; if(c == '%') c = '\n'; *cp++ = c; c = getchar(); } *cp++ = '\n'; *cp++ = 0; goto loop; ignore: cp = ocp; while(c != '\n') { if(c == EOF) { *cp++ = EOS; *cp++ = EOS; fclose(stdin); return; } c = getchar(); } goto loop; } number(c) register c; { register n = 0; while (isdigit(c)) { n = n*10 + c - '0'; c = getchar(); } ungetc(c, stdin); if (n>100) return(-1); return(n); } = ' ') goto ignore; *cp++ = n; } while(c != '\n') { if(c == EOF) goto ignore; if(c == '%') c = '\n'; *cp++ = c; c = getchar(); } *cp++ = '\n'; *cp++ = 0; goto loop; ignore: cp = ocp; while(c != '\n') { if(c == EOF) { *cp++ = EOS; *cp++ = EOS; fclose(stdin); return; } c = getchar();cmd/crypt.c 444 0 33 3064 2416237701 6106 static char *sccsid = "@(#)crypt.c 4.1 (Berkeley) 10/1/80"; /* * A one-rotor machine designed along the lines of Enigma * but considerably trivialized. */ #define ECHO 010 #include #define ROTORSZ 256 #define MASK 0377 char t1[ROTORSZ]; char t2[ROTORSZ]; char t3[ROTORSZ]; char *getpass(); setup(pw) char *pw; { int ic, i, k, temp, pf[2]; unsigned random; char buf[13]; long seed; strncpy(buf, pw, 8); while (*pw) *pw++ = '\0'; buf[8] = buf[0]; buf[9] = buf[1]; pipe(pf); if (fork()==0) { close(0); close(1); dup(pf[0]); dup(pf[1]); execl("/usr/lib/makekey", "-", 0); execl("/lib/makekey", "-", 0); exit(1); } write(pf[1], buf, 10); wait((int *)NULL); if (read(pf[0], buf, 13) != 13) { fprintf(stderr, "crypt: cannot generate key\n"); exit(1); } seed = 123; for (i=0; i<13; i++) seed = seed*buf[i] + i; for(i=0;i>= 8; temp = t1[k]; t1[k] = t1[ic]; t1[ic] = temp; if(t3[k]!=0) continue; ic = (random&MASK) % k; while(t3[ic]!=0) ic = (ic+1) % k; t3[k] = ic; t3[ic] = k; } for(i=0;i=0) { i = t2[(t3[(t1[(i+n1)&MASK]+n2)&MASK]-n2)&MASK]-n1; putchar(i); n1++; if(n1==ROTORSZ) { n1 = 0; n2++; if(n2==ROTORSZ) n2 = 0; } } } t1[ic] = temp; if(t3[k]!=0) continue; ic = (random&MASK) % k; while(t3[ic]!=0) ic = (ic+1) % k; t3[k] = ic; t3[ic] = k; } for(i=0;i=0) { i = t2[(t3[(t1[(i+n1)&MASK]+n2)&MASK]-n2)&MASK]-n1; putchar(i); n1++; if(n1==ROTORSZ) { ncmd/mv.c 444 0 33 16006 2522357520 5407 static char *sccsid = "@(#)mv.c 4.4 (Berkeley) 81/04/26"; /* * mv file1 file2 */ #include #include #include #include #include #define DOT "." #define DOTDOT ".." #define DELIM '/' #define SDELIM "/" #define MAXN 100 #define MODEBITS 07777 #define ROOTINO 2 char *pname(); char *sprintf(); char *dname(); struct stat s1, s2; int iflag = 0; /* interactive flag. If this flag is set, * the user is queried before files are * destroyed by cp. */ int fflag = 0; /* force flag. supercedes all restrictions */ main(argc, argv) register char *argv[]; { register i, r; register char *arg; /* get the flag(s) */ 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) { /* interactive mode */ case 'i': iflag++; break; /* force moves */ case 'f': fflag++; break; /* don't live with bad options */ default: goto usage; } } if (argc < 3) goto usage; if (stat(argv[1], &s1) < 0) { fprintf(stderr, "mv: cannot access %s\n", argv[1]); return(1); } if ((s1.st_mode & S_IFMT) == S_IFDIR) { if (argc != 3) goto usage; return mvdir(argv[1], argv[2]); } setuid(getuid()); if (argc > 3) if (stat(argv[argc-1], &s2) < 0 || (s2.st_mode & S_IFMT) != S_IFDIR) goto usage; r = 0; for (i=1; i= 0) { if ((s2.st_mode & S_IFMT) == S_IFDIR) { sprintf(buf, "%s/%s", target, dname(source)); target = buf; } if (stat(target, &s2) >= 0) { if ((s2.st_mode & S_IFMT) == S_IFDIR) { fprintf(stderr, "mv: %s is a directory\n", target); return(1); } else if (iflag && !fflag) { fprintf(stderr, "remove %s? ", target); i = c = getchar(); while (c != '\n' && c != EOF) c = getchar(); if (i != 'y') return(1); } if (s1.st_dev==s2.st_dev && s1.st_ino==s2.st_ino) { fprintf(stderr, "mv: %s and %s are identical\n", source, target); return(1); } if (access(target, 2) < 0 && !fflag && isatty(fileno(stdin))) { fprintf(stderr, "override protection %o for %s? ", s2.st_mode & MODEBITS, target); i = c = getchar(); while (c != '\n' && c != EOF) c = getchar(); if (i != 'y') return(1); } if (unlink(target) < 0) { fprintf(stderr, "mv: cannot unlink %s\n", target); return(1); } } } if (link(source, target) < 0) { i = fork(); if (i == -1) { fpr((intf(stderr, "mv: try again\n"); return(1); } if (i == 0) { execl("/bin/cp", "cp", source, target, 0); fprintf(stderr, "mv: cannot exec cp\n"); exit(1); } while ((c = wait(&status)) != i && c != -1) ; if (status != 0) return(1); utime(target, &s1.st_atime); } if (unlink(source) < 0) { fprintf(stderr, "mv: cannot unlink %s\n", source); return(1); } return(0); } mvdir(source, target) char *source, *target; { register char *p; register i; char buf[MAXN]; char c,cc; if (stat(target, &s2) >= 0) { if ((s2.st_mode&S_IFMT) != S_IFDIR) { fprintf(stderr, "mv: %s exists\n", target); return(1); } if (strlen(target) > MAXN-DIRSIZ-2) { fprintf(stderr, "mv :target name too long\n"); return(1); } strcpy(buf, target); target = buf; strcat(buf, SDELIM); strcat(buf, dname(source)); if (stat(target, &s2) >= 0) { fprintf(stderr, "mv: %s exists\n", buf); return(1); } } if (strcmp(source, target) == 0) { fprintf(stderr, "mv: ?? source == target, source exists and target doesnt\n"); return(1); } p = dname(source); if (!strcmp(p, DOT) || !strcmp(p, DOTDOT) || !strcmp(p, "") || p[strlen(p)-1]=='/') { fprintf(stderr, "mv: cannot rename %s\n", p); return(1); } if (stat(pname(source), &s1) < 0 || stat(pname(target), &s2) < 0) { fprintf(stderr, "mv: cannot locate parent\n"); return(1); } if (access(pname(target), 2) < 0) { fprintf(stderr, "mv: no write access to %s\n", pname(target)); return(1); } if (access(pname(source), 2) < 0) { fprintf(stderr, "mv: no write access to %s\n", pname(source)); return(1); } if (s1.st_dev != s2.st_dev) { fprintf(stderr, "mv: cannot move directories across devices\n"); return(1); } if (s1.st_ino != s2.st_ino) { char dst[MAXN+5]; if (chkdot(source) || chkdot(target)) { fprintf(stderr, "mv: Sorry, path names including %s aren't allowed\n", DOTDOT); return(1); } stat(source, &s1); if (check(pname(target), s1.st_ino)) return(1); for (i = 1; i <= NSIG; i++) signal(i, SIG_IGN); if (link(source, target) < 0) { fprintf(stderr, "mv: cannot link %s to %s\n", target, source); return(1); } if (unlink(source) < 0) { fprintf(stderr, "mv: %s: cannot unlink\n", source); unlink(target); return(1); } strcat(dst, target); strcat(dst, "/"); strcat(dst, DOTDOT); if (unlink(dst) < 0) { fprintf(stderr, "mv: %s: cannot unlink\n", dst); if (link(target, source) >= 0) unlink(target); return(1); } if (link(pname(target), dst) < 0) { fprintf(stderr, "mv: cannot link %s to %s\n", dst, pname(target)); if (link(pname(source), dst) >= 0) if (link(target, source) >= 0) unlink(target); return(1); } return(0); } if (link(source, target) < 0) { fprintf(stderr, "mv: cannot link %s and %s\n", source, target); return(1); } if (unlink(source) < 0) { fprintf(stderr, "mv: ?? cannot unlink %s\n", source); return(1); } return(0); } char * pname(name) register char *name; { register c; register char *p, *q; static char buf[MAXN]; p = q = buf; while (c = *p++ = *name++) if (c == DELIM) q = p-1; if (q == buf && *q == DELIM) q++; *q = 0; return buf[0]? buf : DOT; } char * dname(name) register char *name; { register char *p; p = name; while (*p) if (*p++ == DELIM && *p) name = p; return name; } check(spth, dinode) char *spth; ino_t dinode; { char nspth[MAXN]; struct stat sbuf; sbuf.st_ino = 0; strcpy(nspth, spth); while (sbuf.st_ino != ROOTINO) { if (stat(nspth, &sbuf) < 0) { fprintf(stderr, "mv: cannot access %s\n", nspth); return(1); } if (sbuf.st_ino == dinode) { fprintf(stderr, "mv: cannot move a directory into itself\n"); return(1); } if (strlen(nspth) > MAXN-2-sizeof(DOTDOT)) { fprintf(stderr, "mv: name too long\n"); return(1); } strcat(nspth, SDELIM); strcat(nspth, DOTDOT); } return(0); } chkdot(s) register char *s; { do { if (strcmp(dname(s), DOTDOT) == 0) return(1); s = pname(s); } while (strcmp(s, DOT) != 0 && strcmp(s, SDELIM) != 0); return(0); } cannot access %s\n", nspth); return(1); } if (sbuf.st_ino == dinode) { fprintf(stderr, "mv: cannot move a directory into itself\n"); return(1); } if (strlen(nspth) > MAXN-2-sizeof(DOTDOT)) { fprintf(stderr, "mv: name too long\n"); return(1); } strcat(nspth, SDELIM); strcat(nspth, DOTDOT); } return(0); } chkdot(s) register char *s; { do { if (strcmp(dname(s), DOTDOT) == 0) return(1); s = pname(s); } while (strcmp(s, DOT) != 0 && strcmp(s, SDELIM) != 0); return(cmd/cu.c 444 0 33 40030 2550320313 5355 static char *sccsid = "@(#)cu.c 4.6 (Berkeley) 81/07/02"; #include #include #include /* * defs that come from uucp.h */ #define NAMESIZE 15 #define FAIL -1 #define SAME 0 #define SLCKTIME 5400 /* system/device timeout (LCK.. files) in seconds */ #define ASSERT(e, f, v) if (!(e)) {\ fprintf(stderr, "AERROR - (%s) ", "e");\ fprintf(stderr, f, v);\ cleanup(FAIL);\ } /* * cu telno [-t] [-s speed] [-l line] [-a acu] * * -t is for dial-out to terminal. * speeds are: 110, 134, 150, 300, 1200. 300 is default. * * Escape with `~' at beginning of line. * Ordinary diversions are ~<, ~> and ~>>. * Silent output diversions are ~>: and ~>>:. * Terminate output diversion with ~> alone. * Quit is ~. and ~! gives local command or shell. * Also ~$ for canned procedure pumping remote. * ~%put from [to] and ~%take from [to] invoke builtins */ #define CRLF "\r\n" #define wrc(ds) write(ds,&c,1) char *devcul = "/dev/cul0"; char *devcua = "/dev/cua0"; char *lspeed = "300"; int ln; /* fd for comm line */ char tkill, terase; /* current input kill & erase */ int efk; /* process of id of listener */ char c; char oc; char *connmsg[] = { "", "line busy", "call dropped", "no carrier", "can't fork", "acu access", "tty access", "tty hung", "usage: cu telno [-t] [-s speed] [-l line] [-a acu]", "lock failed: line busy" }; rdc(ds) { ds=read(ds,&c,1); oc = c; c &= 0177; return (ds); } int intr; sig2() { signal(SIGINT, SIG_IGN); intr = 1; } int set14; xsleep(n) { xalarm(n); pause(); xalarm(0); } xalarm(n) { set14=n; alarm(n); } sig14() { signal(SIGALRM, sig14); if (set14) alarm(1); } int dout; int nhup; int dbflag; int nullbrk; /* turn breaks (nulls) into dels */ /* * main: get connection, set speed for line. * spawn child to invoke rd to read from line, output to fd 1 * main line invokes wr to read tty, write to line */ main(ac,av) char *av[]; { int fk; int speed; char *telno; struct sgttyb stbuf; int cleanup(); signal(SIGALRM, sig14); signal(SIGINT, cleanup); signal(SIGHUP, cleanup); signal(SIGQUIT, cleanup); if (ac < 2) { prf(connmsg[8]); exit(8); } for (; ac > 1; av++,ac--) { if (av[1][0] != '-') telno = av[1]; else switch(av[1][1]) { case 't': dout = 1; --ac; continue; case 'b': nullbrk++; continue; case 'd': dbflag++; continue; case 's': lspeed = av[2]; ++av; --ac; break; case 'l': devcul = av[2]; ++av; --ac; break; case 'a': devcua = av[2]; ++av; --ac; break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': devcua[strlen(devcua)-1] = av[1][1]; devcul[strlen(devcul)-1] = av[1][1]; break; default: prf("Bad flag %s", av[1]); break; } } if (!exists(devcua) || !exists(devcul)) exit(9); ln = conn(devcul, devcua, telno); if (ln < 0) { prf("Connect failed: %s",connmsg[-ln]); cleanup(-ln); } switch(atoi(lspeed)) { case 110: speed = B110;break; case 150: speed = B150;break; default: case 300: speed = B300;break; case 1200: speed = B1200;break; } stbuf.sg_ispeed = speed; stbuf.sg_ospeed = speed; stbuf.sg_flags = EVENP|ODDP; if (!dout) { stbuf.sg_flags |= RAW; stbuf.sg_flags &= ~ECHO; } ioctl(ln, TIOCSETP, &stbuf); ioctl(ln, TIOCEXCL, (struct sgttyb *)NULL); ioctl(ln, TIOCHPCL, (struct sgttyb *)NULL); prf("Connected"); if (dout) fk = -1; else fk = fork(); nhup = (int)signal(SIGINT, SIG_IGN); if (fk == 0) { chwrsig(); rd(); prf("\007Lost carrier"); cleanup(3); } mode(1); efk = fk; wr(); mode(0); if (fk != -1) kill(fk, SIGKILL); wait((int *)NULL); stbuf.sg_ispeed = 0; stbuf.sg_ospeed = 0; ioctl(ln, TIOCSETP, &stbuf); prf("Disconnected"); cleanup(0); } /* * conn: establish dial-out connection. * Example: fd = conn("/dev/ttyh","/dev/dn1","4500"); * Returns descriptor open to tty for reading and writing. * Negative values (-1...-7) denote errors in connmsg. * Uses alarm and fork/wait; requires sig14 handler. * Be sure to disconnect tty when done, via HUPCL or stty 0. */ conn(dev,acu,telno) char *dev, *acu, *telno; { struct sgttyb stbuf; extern errno; char *p, *q, b[30]; char *ltail, *atail; char *rindex(); int er, fk, dn, dh, t; er=0; fk=(-1); atail = rindex(acu, '/')+1; if (mlock(atail) == FAIL) { er = 9; goto X; } ltail = rindex(dev, '/')+1; if (mlock(ltail) == FAIL) { er = 9; delock(atail); goto X; } if ((dn=open(acu,1))<0) { er=(errno == 6? 1:5); goto X; } if ((fk=fork()) == (-1)) { er=4; goto X; } if (fk == 0) { open(dev,2); for (;;) pause(); } xsleep(2); /* * copy phone #, assure EON */ p=b; q=telno; while (*p++=(*q++)) ; p--; if (*(p-1)!='<') { /*if (*(p-1)!='-') *p++='-';*/ *p++='<'; } t=p-b; xalarm(5*t); t=write(dn,b,t); xalarm(0); if (t<0) { er=2; goto X; } /* close(dn) */ xalarm(40); /* was 5; sometimes missed carrier */ dh = open(dev,2); xalarm(0); if (dh<0) { er=(errno == 4? 3:6); goto X; } ioctl(dh, TIOCGETP, &stbuf); stbuf.sg_flags &= ~ECHO; xalar((m(10); ioctl(dh, TIOCSETP, &stbuf); ioctl(dh, TIOCHPCL, (struct sgttyb *)NULL); xalarm(0); X: if (er) close(dn); delock(atail); if (fk!=(-1)) { kill(fk, SIGKILL); xalarm(10); while ((t=wait((int *)NULL))!=(-1) && t!=fk); xalarm(0); } return (er? -er:dh); } /* * wr: write to remote: 0 -> line. * ~. terminate * ~': case ':': { FILE *fp; char tbuff[128]; register char *q; sprintf(tbuff,"/tmp/cu%d",efk); if(NULL==(fp = fopen(tbuff,"w"))) { prf("Can't tell other demon to divert"); break; } fprintf(fp,"%s\n",(b[1]=='>'?&b[2]: &b[1] )); if(dbflag) prf("name to be written in temporary:"),prf(&b[2]); fclose(fp); if (efk != -1) kill(efk,SIGEMT); } break; #ifdef SIGTSTP #define CTRLZ 26 case CTRLZ: mode(0); kill(getpid(), SIGTSTP); mode(1); break; #endif case '%': dopercen(&b[2]); break; default: prf("Use `~~' to start line with `~'"); } continue; } } dopercen(line) register char *line; { char *args[10]; register narg, f; int rcount; for (narg = 0; narg < 10;) { while(*line == ' ' || *line == '\t') line++; if (*line == '\0') break; args[narg++] = line; while(*line != '\0' && *line != ' ' && *line != '\t') line++; if (*line == '\0') break; *line++ = '\0'; } if (equal(args[0], "take")) { if (narg < 2) { prf("usage: ~%%take from [to]"); return; } if (narg < 3) args[2] = args[1]; wrln("echo '~>:'"); wrln(args[2]); wrln(";tee /dev/null <"); wrln(args[1]); wrln(";echo '~>'\n"); return; } else if (equal(args[0], "put")) { if (narg < 2) { prf("usage: ~%%put from [to]"); return; } if (narg < 3) args[2] = args[1]; if ((f = open(args[1], 0)) < 0) { prf("cannot open: %s", args[1]); return; } wrln("stty -echo;cat >"); wrln(args[2]); wrln(";stty echo\n"); xsleep(5); intr = 0; if (!nhup) signal(SIGINT, sig2); mode(2); rcount = 0; while(!intr && rdc(f) == 1) { rcount++; if (c == tkill || c == terase) wrln("\\"); if (wrc(ln) != 1) { xsleep(2); if (wrc(ln) != 1) { prf("character missed"); intr = 1; break; } } } signal(SIGINT, SIG_IGN); close(f); if (intr) { wrln("\n"); prf("stopped after %d bytes", rcount); } wrln("\004"); xsleep(5); mode(1); return; } prf("~%%%s unknown\n", args[0]); } equal(s1, s2) register char *s1, *s2; { while (*s1++ == *s2) if (*s2++ == '\0') return(1); return(0); } wrln(s) register char *s; { while (*s) write(ln, s++, 1); } /* chwrsig: Catch orders from wr process * to instigate diversion */ int whoami; chwrsig(){ int dodiver(); whoami = getpid(); signal(SIGEMT,dodiver); } int ds,slnt; int justrung; dodiver(){ static char dobuff[128], morejunk[256]; register char *cp; FILE *fp; justrung = 1; signal(SIGEMT,dodiver); sprintf(dobuff,"/tmp/cu%d",whoami); fp = fopen(dobuff,"r"); if(fp==NULL) prf("Couldn't open temporary"); unlink(dobuff); if(dbflag) { prf("Name of temporary:"); prf(dobuff); } fgets(dobuff,128,fp); fclose(fp); if(dbflag) { prf("Name of target file:"); prf(dobuff); } for(cp = dobuff-1; *++cp; ) /* squash newline */ if(*cp=='\n') *cp=0; cp = dobuff; if (*cp=='>') cp++; if (*cp==':') { cp++; if(*cp==0) { slnt ^= 1; return; } else { slnt = 1; } } if (ds >= 0) close(ds); if (*cp==0) { slnt = 0; ds = -1; return; } if (*dobuff!='>' || (ds=open(cp,1))<0) ds=creat(cp,0644); lseek(ds, (long)0, 2); if(ds < 0) prf("Creat failed:"), prf(cp); if (ds<0) prf("Can't divert %s",cp+1); } /* * rd: read from remote: line -> 1 * catch: * ~>[>][:][file] * stuff from file... * ~> (ends diversion) */ rd() { extern int ds,slnt; char *p,*q,b[600]; p=b; ds=(-1); agin: while (rdc(ln) == 1) { if (!slnt) wrc(1); if (p < &b[600]) *p++=c; if (c!='\n') continue; q=p; p=b; if (b[0]!='~' || b[1]!='>') { if (*(q-2) == '\r') { q--; *(q-1)=(*q); } if (ds>=0) write(ds,b,q-b); continue; } if (ds>=0) close(ds); if (slnt) { write(1, b, q - b); write(1, CRLF, sizeof(CRLF)); } if (*(q-2) == '\r') q--; *(q-1)=0; slnt=0; q=b+2; if (*q == '>') q++; if (*q == ':') { slnt=1; q++; } if (*q == 0) { ds=(-1); continue; } if (b[2]!='>' || (ds=open(q,1))<0) ds=creat(q,0644); lseek(ds, (long)0, 2); if (ds<0) prf("Can't divert %s",b+1); } if(justrung) { justrung = 0; goto agin; } } struct {char lobyte; char hibyte;}; mode(f) { struct sgttyb stbuf; if (dout) return; ioctl(0, TIOCGETP, &stbuf); tkill = stbuf.sg_kill; terase = stbuf.sg_erase; if (f == 0) { stbuf.sg_flags &= ~RAW; stbuf.sg_flags |= ECHO|CRMOD; } if (f == 1) { stbuf.sg_flags |= RAW; stbuf.sg_flags &= ~(ECHO|CRMOD); } if (f == 2) { stbuf.sg_flags &= ~RAW; stbuf.sg_flags &= ~(ECHO|CRMOD); } ioctl(0, TIOCSETP, &stbuf); } echo(s) char *s; { char *p; for (p=s;*p;p++); if (p>s) write(0,s,p-s); write(0,CRLF, sizeof(CRLF)); } prf(f, s) char *f; char *s; { fprintf(stderr, f, s); fprintf(stderr, CRLF); } exists(devname) char *devname; { if (access(devname, 0)==0) return(1); prf("%s does not exist", devname); return(0); } cleanup(code) { rmlock(NULL); exit(code); } /* * This code is taken directly from uucp and follows the same * conventions. This is important since uucp and cu should * respect each others locks. */ /* ulockf 3.2 10/26/79 11:40:29 */ /* #include "uucp.h" */ #include #include /******* * ulockf(file, atime) * char *file; * time_t atime; * * ulockf - this routine will create a lock file (file). * If one already exists, the create time is checked for * older than the age time (atime). * If it is older, an attempt will be made to unlink it * and create a new one. * * return codes: 0 | FAIL */ ulockf(file, atime) char *file; time_t atime; { struct stat stbuf; time_t ptime; int ret; static int pid = -1; static char tempfile[NAMESIZE]; if (pid < 0) { pid = getpid(); sprintf(tempfile, "/usr/spool/uucp/LTMP.%d", pid); } if (onelock(pid, tempfile, file) == -1) { /* lock file exists */ /* get status to check age of the lock file */ ret = stat(file, &stbuf); if (ret != -1) { time(&ptime); if ((ptime - stbuf.st_ctime) < atime) { /* file not old enough to delete */ return(FAIL); } } ret = unlink(file); ret = onelock(pid, tempfile, file); if (ret != 0) return(FAIL); } stlock(file); return(0); } #define MAXLOCKS 10 /* maximum number of lock files */ char *Lockfile[MAXLOCKS]; int Nlocks = 0; /*** * stlock(name) put name in list of lock files * char *name; * * return codes: none */ stlock(name) char *name; { char *p; extern char *calloc(); int i; for (i = 0; i < Nlocks; i++) { if (Lockfile[i] == NULL) break; } ASSERT(i < MAXLOCKS, "TOO MANY LOCKS %d", i); if (i >= Nlocks) i = Nlocks++; p = calloc(strlen(name) + 1, sizeof (char)); ASSERT(p != NULL, "CAN NOT ALLOCATE FOR %s", name); strcpy(p, name); Lockfile[i] = p; return; } /*** * rmlock(name) remove all lock files in list * char *name; or name * * return codes: none */ rmlock(name) char *name; { int i; for (i = 0; i < Nlocks; i++) { if (Lockfile[i] == NULL) continue; if (name == NULL || strcmp(name, Lockfile[i]) == SAME) { unlink(Lockfile[i]); free(Lockfile[i]); Lockfile[i] = NULL; } } return; } /* this stuff from pjw */ /* /usr/pjw/bin/recover - check pids to remove unnecessary locks */ /* isalock(name) returns 0 if the name is a lock */ /* unlock(name) unlocks name if it is a lock*/ /* onelock(pid,tempfile,name) makes lock a name on behalf of pid. Tempfile must be in the same file system as name. */ /* lock(pid,tempfile,names) either locks all the names or none of them */ isalock(name) char *name; { struct stat xstat; if(stat(name,&xstat)<0) return(0); if(xstat.st_size!=sizeof(int)) return(0); return(1); } unlock(name) char *name; { if(isalock(name)) return(unlink(name)); else return(-1); } onelock(pid,tempfile,name) char *tempfile,*name; { int fd; fd=creat(tempfile,0444); if(fd<0) return(-1); write(fd,(char *) &pid,sizeof(int)); close(fd); if(link(tempfile,name)<0) { unlin((k(tempfile); return(-1); } unlink(tempfile); return(0); } lock(pid,tempfile,names) char *tempfile,**names; { int i,j; for(i=0;names[i]!=0;i++) { if(onelock(pid,tempfile,names[i])==0) continue; for(j=0;j /* * date : print date * date YYMMDDHHMM[.SS] : set date, if allowed * date -u ... : date in GMT */ #include #include #include #include long timbuf; char *ap, *ep, *sp; int uflag; char *timezone(); static int dmsize[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; struct utmp wtmp[2] = { {"|", "", 0}, {"{", "", 0}}; char *ctime(); char *asctime(); struct tm *localtime(); struct tm *gmtime(); main(argc, argv) char *argv[]; { register char *tzn; struct timeb info; int wf, rc; extern char _sobuf[]; setbuf(stdout, _sobuf); rc = 0; ftime(&info); if (argc>1 && argv[1][0]=='-' && argv[1][1]=='u') { argc--; argv++; uflag++; } if(argc > 1) { ap = argv[1]; if (gtime()) { printf("date: bad conversion\n"); exit(1); } /* convert to GMT assuming local time */ if (uflag==0) { timbuf += (long)info.timezone*60; /* now fix up local daylight time */ if(localtime(&timbuf)->tm_isdst) timbuf -= 60*60; } time(&wtmp[0].ut_time); if(stime(&timbuf) < 0) { rc++; printf("date: no permission\n"); } else if ((wf = open("/usr/adm/wtmp", 1)) >= 0) { time(&wtmp[1].ut_time); lseek(wf, 0L, 2); write(wf, (char *)wtmp, sizeof(wtmp)); close(wf); } } if (rc==0) time(&timbuf); if(uflag) { ap = asctime(gmtime(&timbuf)); tzn = "GMT"; } else { struct tm *tp; tp = localtime(&timbuf); ap = asctime(tp); tzn = timezone(info.timezone, tp->tm_isdst); } printf("%.20s", ap); if (tzn) printf("%s", tzn); printf("%s", ap+19); exit(rc); } gtime() { register int i, year, month; int day, hour, mins, secs; struct tm *L; char x; ep=ap; while(*ep) ep++; sp=ap; while(sptm_mday); month = gp(L->tm_mon+1); year = gp(L->tm_year); if(*sp) return(1); if( month<1 || month>12 || day<1 || day>31 || mins<0 || mins>59 || secs<0 || secs>59) return(1); if (hour==24) { hour=0; day++; } if (hour<0 || hour>23) return(1); timbuf = 0; year += 1900; for(i=1970; i= 3) timbuf++; while(--month) timbuf += dmsize[month-1]; timbuf += day-1; timbuf = 24*timbuf + hour; timbuf = 60*timbuf + mins; timbuf = 60*timbuf + secs; return(0); } gp(dfault) { register int c, d; if(*sp==0) return(dfault); c = (*sp++)-'0'; d = (*sp ? (*sp++)-'0' : 0); if(c<0 || c>9 || d<0 || d>9) return(-1); return(c+10*d); } ur<0 || hour>23) return(1); timbuf = 0; year += 1900; for(i=1970; i= 3) timbuf++; while(--month) timbuf += dmsize[month-1]; timbuf += day-1; timbuf = 24*timbuf + hour; timbuf = 60*timbuf + mins; timbuf = 60*tcmd/dcheck.c 444 0 33 6712 2416237722 6174 static char *sccsid = "@(#)dcheck.c 4.1 (Berkeley) 10/1/80"; /* * dcheck - check directory consistency */ #define NI 16 #define NB 10 #define NDIR (BSIZE/sizeof(struct direct)) #include #include #include #include #include #include #include struct filsys sblock; struct dinode itab[INOPB*NI]; daddr_t iaddr[NADDR]; ino_t ilist[NB]; int fi; ino_t ino; char *ecount; int headpr; unsigned nfiles; int nerror; daddr_t bmap(); long atol(); char *malloc(); main(argc, argv) char *argv[]; { register i; long n; while (--argc) { argv++; if (**argv=='-') switch ((*argv)[1]) { case 'i': for(i=0; i 250000) { printf("Only doing 250000 files\n"); nfiles = 250000; } ecount = malloc(nfiles+1); if (ecount==NULL) { printf("Not enough core\n"); exit(04); } for (i=0; i<=nfiles; i++) ecount[i] = 0; ino = 0; for(i=2;; i+=NI) { if(ino >= nfiles) break; bread((daddr_t)i, (char *)itab, sizeof(itab)); for(j=0; j= nfiles) break; ino++; pass1(&itab[j]); } } ino = 0; for(i=2;; i+=NI) { if(ino >= nfiles) break; bread((daddr_t)i, (char *)itab, sizeof(itab)); for(j=0; j= nfiles) break; ino++; pass2(&itab[j]); } } free(ecount); } pass1(ip) register struct dinode *ip; { struct direct dbuf[NDIR]; long doff; struct direct *dp; register i, j; int k; daddr_t d; ino_t kno; if((ip->di_mode&IFMT) != IFDIR) return; l3tol(iaddr, ip->di_addr, NADDR); doff = 0; for(i=0;; i++) { if(doff >= ip->di_size) break; d = bmap(i); if(d == 0) break; bread(d, (char *)dbuf, BSIZE); for(j=0; j= ip->di_size) break; doff += sizeof(struct direct); dp = &dbuf[j]; kno = dp->d_ino; if(kno == 0) continue; if(kno > nfiles || kno <= 1) { printf("%5u bad; %u/%.14s\n", kno, ino, dp->d_name); nerror++; continue; } for (k=0; ilist[k] != 0; k++) if (ilist[k]==kno) { printf("%5u arg; %u/%.14s\n", kno, ino, dp->d_name); nerror++; } ecount[kno]++; if (ecount[kno] == 0) ecount[kno] = 0377; } } } pass2(ip) register struct dinode *ip; { register i; i = ino; if ((ip->di_mode&IFMT)==0 && ecount[i]==0) return; if (ip->di_nlink==((ecount[i])&0377) && ip->di_nlink!=0) return; if (headpr==0) { printf(" entries link cnt\n"); headpr++; } printf("%u %d %d\n", ino, ecount[i]&0377, ip->di_nlink); } bread(bno, buf, cnt) daddr_t bno; char *buf; { register i; lseek(fi, bno*BSIZE, 0); if (read(fi, buf, cnt) != cnt) { printf("read error %d\n", bno); for(i=0; i NINDIR) { printf("%u - huge directory\n", ino); return((daddr_t)0); } bread(iaddr[NADDR-3], (char *)ibuf, sizeof(ibuf)); return(ibuf[i]); } tf("%u %d %d\n", ino, ecount[i]&0377, ip->di_nlincmd/dd.c 444 0 33 25105 2416237726 5363 static char *sccsid = "@(#)dd.c 4.1 (Berkeley) 10/1/80"; #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 nsp((ace; 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(); } ibc = 0; for(c=0; c>1) & ~1; if(cflag&SWAB && c) do { a = *ip++; ip[-1] = *ip; *ip++ = a; } while(--c); ip = ibuf; if (fflag) { obc = ibc; flsh(); ibc = 0; } goto loop; } c = 0; c |= *ip++; c &= 0377; (*conv)(c); goto loop; } flsh() { register c; if(obc) { if(obc == obs) nofr++; else nopr++; c = write(obf, obuf, obc); if(c != obc) { perror("write"); term(); } obc = 0; } } match(s) char *s; { register char *cs; cs = string; while(*cs++ == *s) if(*s++ == '\0') goto true; if(*s != '\0') return(0); true: cs--; string = cs; return(1); } number(big) { register char *cs; long n; cs = string; n = 0; while(*cs >= '0' && *cs <= '9') n = n*10 + *cs++ - '0'; for(;;) switch(*cs++) { case 'k': n *= 1024; continue; case 'w': n *= sizeof(int); continue; case 'b': n *= 512; continue; case '*': case 'x': string = cs; n *= number(BIG); case '\0': if (n>=big || n<0) { fprintf(stderr, "dd: argument %D out of range\n", n); exit(1); } return(n); } /* never gets here */ } cnull(cc) { register c; c = cc; if(cflag&UCASE && c>='a' && c<='z') c += 'A'-'a'; if(cflag&LCASE && c>='A' && c<='Z') c += 'a'-'A'; null(c); } null(c) { *op = c; op++; if(++obc >= obs) { flsh(); op = obuf; } } ascii(cc) { register c; c = etoa[cc] & 0377; if(cbs == 0) { cnull(c); return; } if(c == ' ') { nspace++; goto out; } while(nspace > 0) { null(' '); nspace--; } cnull(c); out: if(++cbc >= cbs) { null('\n'); cbc = 0; nspace = 0; } } 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() { stats(); exit(0); } stats() { fprintf(stderr,"%u+%u records in\n", nifr, nipr); fprintf(stderr,"%u+%u records out\n", nofr, nopr((); if(ntrunc) fprintf(stderr,"%u truncated records\n", ntrunc); } && 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() { stats(); exit(0); } stats() { fprintf(stderr,"%u+%u records in\n", nifr, nipr); fprintf(stderr,"%u+%u records out\n", nofr, noprcmd/diff/ 775 0 33 0 2552527640 5432 cmd/diff/diff.c 444 0 33 6030 2421007736 6560 static char sccsid[] = "@(#)diff.c 4.1 10/9/80"; #include "diff.h" /* * diff - driver and subroutines */ char diff[] = DIFF; char diffh[] = DIFFH; char pr[] = PR; extern char _sobuf[]; main(argc, argv) int argc; char **argv; { register char *argp; ifdef1 = "FILE1"; ifdef2 = "FILE2"; status = 2; diffargv = argv; setbuf(stdout, _sobuf); 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 'b': bflag = 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, -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() { unlink(tempfile); exit(status); } char * talloc(n) { register char *p; p = malloc((unsigned)n); if(p!=NULL) return(p); noroom(); } char * ralloc(p,n) /*compacting reallocation */ char *p; { register char *q; char *realloc(); free(p); free(dummy); dummy = malloc(1); q = realloc(p, (unsigned)n); if(q==NULL) noroom(); return(q); } noroom() { fprintf(stderr, "diff: files too big, try -h\n"); done(); } return (a < b ? a : b); } max(a,b) int a,b; { return (a > b ? a : b); } done() { unlink(tempfile); exit(status); } char * talloc(n) { register char *p; p = malloc((unsigned)n); if(p!=NULL) return(p); noroom(); } char * ralloc(p,n) /*compacting reallocation */ char *p; { register char *q; char *realloc(); free(p); free(dummy); dummy = malloc(1); q = realloc(p, (unsigned)n); if(q==NULL) noroom(); return(q); } noroom() { fprintf(stderr, "diff: files too big,cmd/diff/diff.h 444 0 33 3554 2421007737 6576 /* @(#)diff.h 4.1 10/9/80" */ /* * 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 */ /* * Algorithm related options */ int hflag; /* -h, use halfhearted DIFFH */ int bflag; /* ignore blanks in comparisions */ /* * 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; struct stat stb1, stb2; /* * This is allocated early, and used * to reset the free storage pointer to effect space compaction. */ char *dummy; char *malloc(), *talloc(), *ralloc(); char *savestr(), *splice(), *splicen(); char *mktemp(), *copytemp(), *rindex(); int done(); extern char diffh[], diff[], pr[]; diffdir, file1 and file2 are allocated BUFSIZ space, * and padded with a '/', and then efile0 and efile1 point after * the '/'. */ char *file1, cmd/diff/diffdir.c 444 0 33 17052 2477634710 7316 static char *sccsid = "@(#)diffdir.c 4.5 (Berkeley) 81/02/28"; #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 direct *setupdir(); int header; char title[2*BUFSIZ], *etitle; diffdir(argv) char **argv; { register struct direct *d1, *d2; struct direct *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_name[0] != 0 || d2->d_name[0] != 0) { if (d1->d_name[0] && useless(d1->d_name)) { d1++; continue; } if (d2->d_name[0] && useless(d2->d_name)) { d2++; continue; } if (d1->d_name[0] == 0) cmp = 1; else if (d2->d_name[0] == 0) cmp = -1; else cmp = strncmp(d1->d_name, d2->d_name, DIRSIZ); if (cmp < 0) { if (lflag) d1->d_flags |= ONLY; else if (opt == 0 || opt == 2) { only(d1, 1); printf(": %.*s\n", DIRSIZ, d1->d_name); } 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); printf(": %.*s\n", DIRSIZ, d2->d_name); } d2++; } } if (lflag) { scanpr(dir1, ONLY, "Only in %.*s", file1, efile1); scanpr(dir2, ONLY, "Only in %.*s", file2, efile2); scanpr(dir1, SAME, "Common identical files",(( 0, 0); scanpr(dir1, DIFFER, "Binary files which differ", 0, 0); scanpr(dir1, DIRECT, "Common subdirectories", 0, 0); } if (rflag) { if (header && lflag) printf("\f"); for (d1 = dir1; d1->d_name[0]; d1++) { if ((d1->d_flags & DIRECT) == 0) continue; strncpy(efile1, d1->d_name, DIRSIZ); strncpy(efile2, d1->d_name, DIRSIZ); /* if (opt != D_EDIT) { *etitle = 0; printf("%s%s %s\n", title, file1, file2); } */ 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, file, efile) register struct direct *dp; int test; char *title, *file, *efile; { int titled = 0; for (; dp->d_name[0]; dp++) if (dp->d_flags & test) { if (titled == 0) { if (header == 0) { if (anychange) printf("\f"); header = 1; } else printf("\n"); printf(title, efile - file - 1, file); printf(":\n"); titled = 1; } ptname(dp); } } only(dp, which) struct direct *dp; int which; { char *file = which == 1 ? file1 : file2; char *efile = which == 1 ? efile1 : efile2; printf("Only in %.*s", efile - file - 1, file, DIRSIZ, dp->d_name); } ptname(dp) struct direct *dp; { printf("\t%.*s\n", DIRSIZ, dp->d_name); } int entcmp(); struct direct * setupdir(cp) char *cp; { struct stat stb; register struct direct *dp, *ep; close(0); if (open(cp, 0) < 0) { fprintf(stderr, "diff: "); perror(cp); done(); } fstat(0, &stb); dp = (struct direct *)malloc((unsigned) stb.st_size + sizeof (struct direct)); if (dp == 0) { fprintf(stderr, "diff: ran out of memory\n"); done(); } if (read(0, (char *)dp, (int)stb.st_size) != (int)stb.st_size) { fprintf(stderr, "diff: "); perror(cp); done(); } qsort(dp, (int) stb.st_size / sizeof (struct direct), sizeof (struct direct), entcmp); ep = &dp[stb.st_size / sizeof (struct direct)]; ep->d_name[0] = 0; while (--ep >= dp && ep->d_ino == 0) ep->d_name[0] = 0; for (; ep >= dp; ep--) ep->d_flags = 0; return (dp); } entcmp(d1, d2) struct direct *d1, *d2; { if (d1->d_ino == 0) return (1); if (d2->d_ino == 0) return (-1); return (strncmp(d1->d_name, d2->d_name, DIRSIZ)); } compare(dp) register struct direct *dp; { register int i, j; int f1, f2, fmt1, fmt2; struct stat stb1, stb2; int flag = 0; char buf1[BUFSIZ], buf2[BUFSIZ]; strncpy(efile1, dp->d_name, DIRSIZ); strncpy(efile2, dp->d_name, DIRSIZ); 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", DIRSIZ, dp->d_name); 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(); } 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] == '.') return (1); if (start && strcmp(start, cp) > 0) return (1); return (0); } nclude 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] == '.') return (1); if (start && strcmp(stacmd/diff/Makefile 644 0 33 722 2423724645 7137 DESTDIR= DIFF= /bin/diff DIFFH= /usr/lib/diffh PR= /usr/bin/pr CFLAGS= -O -DDIFF='"${DIFF}"' -DDIFFH='"${DIFFH}"' -DPR='"${PR}"' -d2 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} ${LDFLAGS} diffh: diffh.o cc -o diffh diffh.o ${LDFLAGS} clean: rm -f diff diffh ${OBJS} diffh.o install: install -s diff ${DESTDIR}/bin/diff install -s diffh ${DESTDIR}/usr/lib/diffh /,"cmd/diff/diffh.c 444 0 33 10156 2421007745 6754 static char sccsid[] = "@(#)diffh.c 4.1 10/9/80"; #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(1); } /*stub for resychronization beyond limits of text buf*/ hardsynch() { change(n0,INF,n1,INF,"c"); printf("---change record omitted\n"); error("can't resynchronize",""); return(0); } eptr=f2;*eptr;eptr++) if(*eptr=='/'&&eptr[1]!=0&&eptr[1]!='/') f2 = eptr+1; while(*bptr++= *f2++) ; f1 = b; } f = fopen(f1,"r"); if(f==NULL) error("can't open",f1); return(f); } progerr(s) char *s; { error("program error ",s); } error(s,t) char *s,*t; { fprintf(stderr,"diffh: %s%s\n",s,t); exit(1); } /*stub for resychronization beyond limits of text buf*/ hardsynch() { chancmd/diff/diffreg.c 444 0 33 36040 2421007752 7300 static char sccsid[] = "@(#)diffreg.c 4.1 10/9/80"; #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] */ diffreg() { register int k; if (hflag) { diffargv[0] = "diffh"; execv(diffh, diffargv); fprintf(stderr, "diff: "); perror(diffh); done(); } dummy = malloc(1); if ((stb1.st_mode & S_IFMT) == S_IFDIR) file1 = splice(file1, file2); else if ((stb2.st_mode & S_IFMT) == S_IFDIR) file2 = splice(file2, file1); else if (!strcmp(file1, "-")) { if (!strcmp(file2, "-")) { fprintf(stderr, "diff: can't specify - -\n"); done(); } file1 = copytemp(); } else if (!strcmp(file2, "-")) file2 = copytemp(); prepare(0, file1); prepare(1, file2); prune(); sort(sfile[0],slen[0]); sort(sfile[1],slen[1]); member = (int *)file[1]; equiv(sfile[0], slen[0], sfile[1], slen[1], member); member = (int *)ralloc((char *)member,(slen[1]+2)*sizeof(int)); class = (int *)file[0]; unsort(sfile[0], slen[0], class); class = (int *)ralloc((char *)class,(slen[0]+2)*sizeof(int)); klist = (int *)talloc((slen[0]+2)*sizeof(int)); clist = (struct cand *)talloc(sizeof(cand)); k = stone(class, slen[0], member, klist); free((char *)member); free((char *)class); J = (int *)talloc((len[0]+2)*sizeof(int)); unravel(klist[k]); free((char *)clist); free((char *)klist); ixold = (long *)talloc((len[0]+2)*sizeof(long)); ixnew = (long *)talloc((len[1]+2)*sizeof(long)); check(); output(); status = anychange; 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("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, arg) char *arg; { register struct line *p; register j,h; if((input[i] = fopen(arg,"r")) == NULL){ fprintf(stderr, "diff: "); perror(arg); done(); } p = (struct line *)talloc(3*sizeof(line)); for(j=0; h=readhash(input[i]);) { p = (struct line *)ralloc((char *)p,(++j+3)*sizeof(line)); p[j].value = h; } len[i] = j; file[i] = p; fclose(input[i]); } prune() { register i,j; for(pref=0;pref 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 i) { t = clist[c[l]].y; if(t > y) j = l; else if(t < y) i = l; else return(l); } return(l+1); } unravel(p) { register int i; register struct cand *q; for(i=0; i<=len[0]; i++) J[i] = i<=pref ? i: i>len[0]-suff ? i+len[1]-len[0]: 0; for(q=clist+p;q->y!=0;q=clist+q->pred) J[q->x+pref] = q->y+pref; } /* check does double duty: 1. ferret out any fortuitous correspondences due to confounding by hashing (which result in "jackpot") 2. collect random access indexes to the two files */ check() { register int i, j; int jackpot; long ctold, ctnew; char c,d; input[0] = fopen(file1,"r"); input[1] = fopen(file2,"r"); j = 1; ixold[0] = ixnew[0] = 0; jackpot = 0; ctold = ctnew = 0; for(i=1;i<=len[0];i++) { if(J[i]==0) { ixold[i] = ctold += skipline(0); continue; } while(j 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; for(i=1;getc(input[f])!='\n';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 } } /* 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) { char 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)); } } if (a <= b && c <= d) ch = 'c'; else ch = (a <= b) ? 'd' : 'a'; if(opt == D_CONTEXT) { lowa = max(1, a-context); upb = min(len[0], b+context); lowc = max(1, c-context); upd = min(len[1], d+context); /* print out from file */ printf("***************\n*** "); range(lowa,upb,","); printf("\n"); if (ch == 'a') fetch(ixold,lowa,upb,input[0]," "); else { fetch(ixold,lowa,a-1,input[0]," "); fetch(ixold,a,b,input[0],ch == 'c' ? "! " : "- "); fetch(ixold,b+1,upb,input[0]," "); } putchar('\n'); printf("--- "); range(lowc,upd,","); printf(" -----\n"); if (ch == 'd') fetch(ixnew,lowc,upd,input[1]," "); else { fetch(ixnew,lowc,c-1,input[1]," "); fetch(ixnew,c,d,input[1],ch == 'c' ? "! " : "+ "); fetch(ixnew,d+1,upd,input[1]," "); } 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; } 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); 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) FILE *f; { long sum; register unsigned shift; register space; register t; sum = 1; space = 0; if(!bflag) for(shift=0;(t=getc(f))!='\n';shift+=7) { if(t==-1) return(0); sum += (long)t << (shift%=HALFLONG); } else for(shift=0;;) { switch(t=getc(f)) { case -1: return(0); case '\t': case ' ': space++; continue; default: if(space) { shift += 7; space = 0; } sum += (long)t << (shift%=HALFLONG); shift += 7; continue; case '\n': break; } break; } sum = low(sum) + high(sum); return((short)low(sum) + (short)high(sum)); } t; sum = 1; space = 0; if(!bflag) for(shift=0;(t=getc(f))!='\n';shift+=7) { if(t==-1) return(0); sum += (long)t << (shift%=HALFLONG); } else for(shift=0;;) { switch(t=getc(f)) { case -1: return(0); case '\t': case ' ': space++; continue; default: if(space) { shift += 7; space = 0; } sum += (long)t << (shift%=HALFLONG); shift += 7; continue; case '\n': break; } break; } sum = low(sum) + high(sum); return((short)cmd/reboot.c 444 0 33 4306 2520537130 6232 static char *sccsid = "@(#)reboot.c 4.5 (Berkeley) 4/21/81"; /* * Reboot */ #include #include #include #include #include #include #define SHUTDOWNLOG "/usr/adm/shutdownlog" main(argc, argv) int argc; char **argv; { int howto; register char *argp; register i; register ok = 0; register qflag = 0; argc--, argv++; howto = 0; while (argc > 0) { if (!strcmp(*argv, "-q")) qflag++; else if (!strcmp(*argv, "-n")) howto |= RB_NOSYNC; else { fprintf(stderr, "usage: reboot [ -n ][ -q ]\n"); exit(1); } argc--, argv++; } if (kill(1, SIGTSTP) == -1) { fprintf(stderr, "reboot: can't idle init\n"); exit(1); } if (!qflag) for (i = 1; ; i++) { if (kill(-1, SIGKILL) == -1) { extern int errno; if (errno == ESRCH) break; perror("reboot: kill"); kill(1, SIGHUP); exit(1); } if (i > 5) { fprintf(stderr, "CAUTION: some process(es) wouldn't die\n"); break; } setalarm(2 * i); pause(); } if ((howto & RB_NOSYNC) == 0) log_entry(); if (!qflag) { if (!(howto & RB_NOSYNC)) { markdown(); sync(); sync(); } setalarm(5); pause(); } syscall(55, howto); perror("reboot"); kill(1, SIGHUP); exit(1); } dingdong() { /* RRRIIINNNGGG RRRIIINNNGGG */ } setalarm(n) { signal(SIGALRM, dingdong); alarm(n); } #include #define SCPYN(a, b) strncpy(a, b, sizeof(a)) char wtmpf[] = "/usr/adm/wtmp"; struct utmp wtmp; markdown() { register f = open(wtmpf, 1); if (f >((= 0) { lseek(f, 0L, 2); SCPYN(wtmp.ut_line, "~"); SCPYN(wtmp.ut_name, "shutdown"); time(&wtmp.ut_time); write(f, (char *)&wtmp, sizeof(wtmp)); close(f); } } char *days[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; log_entry() { FILE *fp; struct tm *tm, *localtime(); time_t now; time(&now); tm = localtime(&now); fp = fopen(SHUTDOWNLOG, "a"); if (fp == 0) return; fseek(fp, 0L, 2); fprintf(fp, "%02d:%02d %s %s %2d, %4d. Halted for reboot.\n", tm->tm_hour, tm->tm_min, days[tm->tm_wday], months[tm->tm_mon], tm->tm_mday, tm->tm_year + 1900); fclose(fp); } on", "Tue", "Wed", "Thu", "Fri", "Sat" }; char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; log_entry() { FILE *fp; struct tm *tm, *localtime(); time_t now; time(&now); tm = localtime(&now); fp = fopen(SHUTDOWNLOG, "a"); if (fp == 0) return; fscmd/pascal/ 775 0 33 0 2552607041 5757 cmd/pascal/OPnames.h 644 0 33 5073 2552606266 7572 /* static char sccsid[] = "@(#)OPnames.h 1.2 10/2/80"; */ char *otext[] = { 0, " NODUMP", " BEG", " END", " CALL", " FCALL", " FRTN", " FSAV", " SDUP2", " SDUP4", " TRA", " TRA4", " GOTO", " LINO", " PUSH", 0, " IF", " REL2", " REL4", " REL24", " REL42", " REL8", " RELG", " RELT", " REL28", " REL48", " REL82", " REL84", " AND", " OR", " NOT", 0, " AS2", " AS4", " AS24", " AS42", " AS21", " AS41", " AS28", " AS48", " AS8", " AS", " INX2P2", " INX4P2", " INX2", " INX4", " OFF", " NIL", " ADD2", " ADD4", " ADD24", " ADD42", " ADD28", " ADD48", " ADD82", " ADD84", " SUB2", " SUB4", " SUB24", " SUB42", " SUB28", " SUB48", " SUB82", " SUB84", " MUL2", " MUL4", " MUL24", " MUL42", " MUL28", " MUL48", " MUL82", " MUL84", " ABS2", " ABS4", " ABS8", 0, " NEG2", " NEG4", " NEG8", 0, " DIV2", " DIV4", " DIV24", " DIV42", " MOD2", " MOD4", " MOD24", " MOD42", " ADD8", " SUB8", " MUL8", " DVD8", " STOI", " STOD", " ITOD", " ITOS", " DVD2", " DVD4", " DVD24", " DVD42", " DVD28", " DVD48", " DVD82", " DVD84", " RV1", " RV14", " RV2", " RV24", " RV4", " RV8", " RV", " LV", " LRV1", " LRV14", " LRV2", " LRV24", " LRV4", " LRV8", " LRV", " LLV", " IND1", " IND14", " IND2", " IND24", " IND4", " IND8", " IND", 0, " CON1", " CON14", " CON2", " CON24", " CON4", " CON8", " CON", " LVCON", " RANG2", " RANG42", " RSNG2", " RSNG42", " RANG4", " RANG24", " RSNG4", " RSNG24", " STLIM", " LLIMIT", " BUFF", " HALT", 0, 0, 0, 0, "*ORD2", "*CONG", "*CONC", "*CONC4", "*ABORT", " PXPBUF", " COUNT", 0, " CASE1OP", " CASE2OP", " CASE4OP", "*CASEBEG", "*CASE1", "*CASE2", "*CASE4", "*CASEEND", " ADDT", " SUBT", " MULT", " INCT", " CTTOT", " CARD", " IN", " ASRT", " FOR1U", " FOR2U", " FOR4U", " FOR1D", " FOR2D", " FOR4D", 0, 0, " READE", " READ4", " READC", " READ8", " READLN", " EOF", " EOLN", 0, " WRITEC", " WRITES", " WRITEF", " WRITLN", " PAGE", " NAM", " MAX", " MIN", " UNIT", " UNITINP", " UNITOUT", " MESSAGE", " GET", " PUT", " FNIL", 0, " DEFNAME", " RESET", " REWRITE", " FILE", " REMOVE", " FLUSH", 0, 0, " PACK", " UNPACK", " ARGC", " ARGV", 0, 0, 0, 0, " CLCK", " WCLCK", " SCLCK", " DISPOSE", " NEW", " DATE", " TIME", " UNDEF", " ATAN", " COS", " EXP", " LN", " SIN", " SQRT", " CHR2", " CHR4", " ODD2", " ODD4", " PRED2", " PRED4", " PRED24", " SUCC2", " SUCC4", " SUCC24", " SEED", " RANDOM", " EXPO", " SQR2", " SQR4", " SQR8", " ROUND", " TRUNC" }; MESSAGE", " GET", " PUT", " FNIL", 0, " DEFNAME", " RESET", " REWRITE", " FILE", " REMOVE", " FLUSH", 0, 0, " PACK", " UNPACK", " ARGC", " ARGV", 0, 0, 0, 0, " CLCK", " WCLCK", " SCLCK", " DISPOSE", " NEW", " DATE", " TIME", " UNDEF", " ATAN", " COS", " EXP", " LN", " SIN", " SQRT", " CHR2", " CHR4", " ODD2", " ODD4", " PRED2", " PRED4", " PRED24", " SUCC2", " SUCC4", " SUCC24", " SEED", " RANDOM", " EXcmd/pascal/how_pc 644 0 33 1024 2552606266 7251 @(#)how_pc 1.1 (Berkeley) 3/2/81 To translate a program using pc, place the source in a file whose name ends in the characters ".p", e.g. "prog.p". The command pc prog.p will translate the program, leaving an executable program in the file a.out in the current directory. This code can be executed by typing a.out The complete command line syntax for pc is pc [ option ] [ -i file ... ] name.p ... The command "man pc" will give information as to the options of pc. Refer to the Berkeley Pascal User's Manual for more details. eley) 3/2/81 To translate a program using pc, place the source in a file whose name ends in the characters ".p", e.g. "prog.p". The command pc prog.p will translate the program, leaving an executable program in the file a.out in the current directory. This code can be executed by typing a.out The complete command line syntax for pc is pc [ option ] [ -i file ... ] name.p ... The command "man pc" will give information as to the options of pc. Refer to the Berkeley Pascal User's Manuacmd/pascal/how_pi 644 0 33 1124 2552606266 7260 @(#)how_pi 1.1 (Berkeley) 3/2/81 To translate a program using pi, place the source in a file whose name ends in the characters ".p", i.e. "prog.p". The command pi prog.p will translate the program into interpreter code which will be left in the file "obj" in the current directory. This code can be executed by typing obj or px The program "pix" can be used for load and go Pascal. The complete command line syntax for pi is pi [ -blnpstuw ] [ -i file ... ] name.p The command "man pi" will give information as to the options of pi. Refer to the UNIX Pascal User's Manual for more details. n a file whose name ends in the characters ".p", i.e. "prog.p". The command pi prog.p will translate the program into interpreter code which will be left in the file "obj" in the current directory. This code can be executed by typing obj or px The program "pix" can be used for load and go Pascal. The complete command line syntax for pi is pi [ -blnpstuw ] [ -i file ... ] name.p The command "man pi" will give informatiocmd/pascal/how_pix 644 0 33 1577 2552606267 7465 @(#)how_pix 1.1 (Berkeley) 3/2/81 To translate and execute a program with pix, place the source in a file whose name ends in the characters ".p", i.e. "prog.p". The command pix prog.p will translate the program into interpreter code which will be then be executed If there are compilation errors `E', then execution will be suppressed. To create a permanent "obj" file which you can interpret, use "pi". Type "pi" for basic information on pi. The complete command line syntax for pix is pix [ -blnpstuw ] [ -i file ... ] name.p [ arg ... ] Here the trailing arguments are passed to your Pascal program. This command is equivalent to pi [ -blnpstuw ] [ -i file ... ] name.p and then px scratch [ arg ... ] where scratch is a temporary file which is then removed. The command "man pi" will give information as to the options of pix. Refer to the UNIX Pascal User's Manual for more details. n interpret, use "pi". Type "pi" for basic information on pi. The complete command line syntax for pix is pix [ -blnpstuw ] [ -cmd/pascal/how_pxp 644 0 33 553 2552606267 7445 ((@(#)how_pxp 1.1 (Berkeley) 3/2/81 To profile a program do pxp -z name.p after a translation specifying this option to pi and an execution, i.e.: pi -z name.p px or pix -z name.p To use pxp to reformat a program you can use the command: pxp name.p >newname.p The complete format for using pxp is pxp [ -acdefjntuw_ ] [ -23456789 ] [ -z [ name ... ] ] name.p l for more details. n interpret, use "pi". Type "pi" for /,5< /,"cmd/pascal/makefile 644 0 33 1642 2552606267 7556 SCCSID = @(#)makefile 1.2 4/21/81 INSTALL = ${DESTDIR}/usr/ucb INSTALLIB = ${DESTDIR}/usr/lib PX_HEADER = px_header CFLAGS = -O all: pix px_header pc pc2 pc3 pmerge install: all pxref.p dd if=px_header of=${INSTALLIB}/${PX_HEADER} conv=sync cp pc pix ${INSTALL} cp how* pc2 pc3 ${INSTALLIB} cp pmerge ${INSTALL}/pmerge pc -w pxref.p -o ${INSTALL}/pxref pix: pix.c ${CC} -O -o pix pix.c pmerge: pmerge.c ${CC} -O -o pmerge pmerge.c px_header: px_header.c objfmt.h ${CC} -O -d2 -o px_header px_header.c -N strip px_header pc2: pc2.c ${CC} pc2.c -lpc -o tmp ${CC} -S pc2.c ./tmp pc2.s | as -d2 -o pc2.o ${CC} pc2.o -o pc2 -s rm -f pc2.o pc2.s tmp pc3: pc3.c pc3.h pstab.h ${CC} -O -d2 pc3.c -o pc3 -s pxref: pxref.p pc -w pxref.p -o pxref pc: pc.c ${CC} -O -d2 -o pc pc.c clean: rm -f pix px_header pxref pmerge pc pc2 pc3 print: @pr READ_ME makefile @ls -l | pr @pr pix.c pmerge.c pxref.p pc.c pc2.c } -O -o pmerge pmerge.c px_header: px_header.c objfmt.h ${CC} -O -d2 -o px_header px_header.cmd/pascal/objfmt.h 644 0 33 6030 2552606267 7504 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)objfmt.h 1.6 3/10/81"; */ #ifdef OBJ /* * the creation time, the size and the magic number of the obj file */ struct pxhdr { long maketime; long objsize; short magicnum; }; # define HEADER_BYTES 1024 /* the size of px_header */ # define PX_HEADER "/usr/lib/px_header" /* px_header's name */ # define PI_COMP "/usr/ucb/pi" /* the compiler's name */ # define PX_INTRP "/usr/ucb/px" /* the interpreter's name */ # define INDX 1 /* amt to shift display index */ #endif OBJ /* * the file of error messages created by mkstr */ #ifdef OBJ # define ERR_STRNGS "/usr/lib/pi2.0strings" # define ERR_PATHLEN 9 # define HOW_STRNGS "/usr/lib/how_pi\0" # define HOW_PATHLEN 9 #endif OBJ #ifdef PC # define ERR_STRNGS "/usr/lib/pc2.0strings" # define ERR_PATHLEN 9 # define HOW_STRNGS "/usr/lib/how_pc\0" # define HOW_PATHLEN 9 #endif PC /* * these are because of varying sizes of pointers */ #ifdef VAX # define PTR_AS O_AS4 # define PTR_RV O_RV4 # define PTR_IND O_IND4 # define PTR_CON O_CON4 # define PTR_DUP O_SDUP4 # define CON_INT O_CON24 # define INT_TYP (nl + T4INT) # define PTR_DCL unsigned long /* for pointer variables */ # define SHORTADDR 32768 /* maximum short address */ # define TOOMUCH 65536 /* maximum variable size */ # define MAXSET 65536 /* maximum set size */ /* * Offsets due to the structure of the runtime stack. * DPOFF1 is the amount of fixed storage in each block allocated * as local variables for the runtime system. * since locals are allocated negative offsets, * -DPOFF1 is the last used implicit local offset. * DPOFF2 is the size of the block mark. * since arguments are allocated positive offsets, * DPOFF2 is the end of the implicit arguments. * for obj, the first argument has the highest offset * from the stackpointer. and the block mark is an * implicit last parameter. * for pc, the first argument has the lowest offset * from the argumentpointer. and the block mark is an * implicit first parameter. */ # ifdef OBJ # define DPOFF1 0 # define DPOFF2 32 # define INPUT_OFF -8 /* offset of `input' */ # define OUTPUT_OFF -4 /* offset of `output' */ # endif OBJ # ifdef PC # define DPOFF1 ( sizeof rtlocs - sizeof rtlocs.unwind ) # define DPOFF2 ( sizeof (long) ) # define INPUT_OFF 0 # define OUTPUT_OFF 0 # endif PC # define MAGICNUM 0403 /* obj magic number */ #endif VAX #ifdef PDP11 # define PTR_AS O_AS2 # define PTR_RV O_RV2 # define PTR_IND O_IND2 # define PTR_CON O_CON2 # define PTR_DUP O_SDUP2 # define CON_INT O_CON2 # define INT_TYP (nl + T2INT) # define PTR_DCL char * # define TOOMUCH 50000 # define SHORTADDR 65536 # define MAXSET 65536 /* maximum set size */ # define DPOFF1 0 # define DPOFF2 18 /* sizeof(struct stack) */ # define INPUT_OFF -2 # define OUTPUT_OFF -4 # define MAGICNUM 0404 #endif PDP11 PC # define MAGICNUM 0403 /* obj magic number */ #endif VAX #ifdef PDP11 # define PTR_AS O_AS2 # define PTR_RV O_RV2 # define PTR_IND O_IND2 # define PTR_CON O_CON2 # define PTR_DUP O_SDUP2 # define CON_INT O_CON2 # define INT_TYP (nl + T2INT) # define PTR_DCL char * # define TOOMUCH 50000 # define SHORTADDR 65536 # define MAXSET 65536 /* maximum set size */ # define DPOFF1 0 # define DPOFF2 18 /* sizeof(struct stack) */ # define INPUT_OFF -2 # define OUTPUT_OFF -4 # define MAGcmd/pascal/opc.c 644 0 33 417 2552606267 6762 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)opc.c 1.1 8/27/80"; #include "OPnames.h" main() { register int i; for (i = 0; i < 256; i++) if (otext[i]) printf("#define O_%s %04o\n", otext[i]+1, i); exit(0); } # define PTR_DCL char * # define TOOMUCH 50000 # define SHORTADDR 65536 # define MAXSET 65536 /* maximum set size */ # define DPOFF1 0 # define DPO/,5Ȇ< /,"cmd/pascal/opx_header.c 644 0 33 2756 2552606267 10347 #include #include #include #include "whoami.h" #include "../opi/objfmt.h" /* * pxheader - program to sit in front of interpreter code to make shell mods * unnecessary to make Pascal obj's look like real programs. * * This program lives in /usr/lib/px_header * Bill Joy UCB February 6, 1978 */ extern errno; #define BUFSIZ BSIZE #define ETXTBSY 26 #define ADDR_LC HEADER_BYTES - sizeof (struct exec) - sizeof (struct pxhdr) main(argc, argv) register int argc; register char *argv[]; { register int i, j; register unsigned short *ip; char *largv[512]; int pv[2]; if (argc > 510) { error("Too many arguments.\n"); exit(1); } largv[0] = argv[0]; largv[1] = "-"; for (i = 1; i < argc; i++) largv[i + 1] = argv[i]; largv[argc + 1] = 0; pipe(pv); i = fork(); if (i == -1) error("Try again.\n"); if (i == 0) { close(pv[0]); ip = (unsigned short *) (ADDR_LC); i = ((struct pxhdr *)(ADDR_LC))->objsize + sizeof(struct pxhdr); while (i != 0) { j = (i > 0 && i < BUFSIZ) ? i : BUFSIZ; write(pv[1], ip, j); ip += BUFSIZ / sizeof ( unsigned short ); i -= j; } exit(1); } close(pv[1]); if (pv[0] != 3) { close(3); dup(pv[0]); close(pv[0]); } for (;;) { execv(PX_INTRP, largv); if (errno != ETXTBSY) break; sleep(2); } error("Px not found.\n"); } error(cp) register char *cp; { register int i; register char *dp; dp = cp; i = 0; while (*dp++) i++; write(2, cp, i); exit(1); } exit(i) { _exit(i); } (i != 0) { j = cmd/pascal/pc.c 644 0 33 21125 2552606270 6634 static char sccsid[] = "@(#)pc.c 3.12 6/8/81"; #include #include #include /* * Pc - front end for Pascal compiler. */ char *pc0 = "/usr/lib/pc0"; char *pc1 = "/lib/f1"; char *pc2 = "/usr/lib/pc2"; char *c2 = "/lib/c2"; char *pc3 = "/usr/lib/pc3"; char *ld = "/bin/ld"; char *as = "/bin/as"; char *lpc = "-lpc"; char *crt0 = "/lib/crt0.o"; char *mcrt0 = "/lib/mcrt0.o"; char *mktemp(); char *tname[2]; char *tfile[2]; char *setsuf(), *savestr(); int Jflag, Sflag, Oflag, cflag,(( gflag, pflag; int debug; #define NARGS 512 int ldargx = 3; int pc0argx = 3; char *pc0args[NARGS] = { "pc0", "-o", "XXX" }; char *pc1args[3] = { "pc1", 0, }; char *pc2args[2] = { "pc2", 0 }; char *c2args[4] = { "c2", 0, 0, 0 }; int pc3argx = 1; #define pc3args pc0args #define ldargs pc0args /* char *pc3args[NARGS] = { "pc3", 0 }; */ /* char *ldargs[NARGS] = { "ld", "-X", "/lib/crt0.o", 0, }; */ int asargx; char *asargs[6] = { "as", 0, }; /* * If the number of .p arguments (np) is 1, and the number of .o arguments * (nxo) is 0, and we successfully create an ``a.out'', then we remove * the one .ps .o file (onepso). */ int np, nxo; char *onepso; int errs; int onintr(); main(argc, argv) int argc; char **argv; { register char *argp; register int i; int savargx; char *t, c; int j; argc--, argv++; if (argc == 0) { execl("/bin/cat", "cat", "/usr/lib/how_pc"); exit(1); } if (signal(SIGINT, SIG_IGN) != SIG_IGN) { signal(SIGINT, onintr); signal(SIGTERM, onintr); } for (i = 0; i < argc; i++) { argp = argv[i]; if (argp[0] != '-') continue; switch (argp[1]) { case 'd': if (argp[2] == 0) debug++; continue; case 'i': pc0args[pc0argx++] = "-i"; while (i+1 < argc && argv[i+1][0] != '-' && getsuf(argv[i+1]) != 'p') { pc0args[pc0argx++] = argv[i+1]; i++; } if (i+1 == argc) { fprintf(stderr, "pc: bad -i construction\n"); exit(1); } continue; case 'o': i++; if (i == argc) { fprintf(stderr, "pc: -o must specify file\n"); exit(1); } c = getsuf(argv[i]); if (c == 'o' || c == 'p' || c == 'c') { fprintf(stderr, "pc: -o would overwrite %s\n", argv[i]); exit(1); } continue; case 'O': Oflag = 1; continue; case 'S': Sflag = 1; continue; case 'J': Jflag = 1; continue; case 'T': switch (argp[2]) { case '0': pc0 = "/usr/src/cmd/pc0/a.out"; if (argp[3] != '\0') { pc0 = &argp[3]; } continue; case '1': pc1 = "/usr/src/cmd/pcc/pc1"; if (argp[3] != '\0') { pc1 = &argp[3]; } continue; case '2': pc2 = "/usr/src/cmd/pascal/pc2"; if (argp[3] != '\0') { pc2 = &argp[3]; } continue; case '3': pc3 = "/usr/src/cmd/pascal/pc3"; if (argp[3] != '\0') { pc3 = &argp[3]; } continue; case 'l': lpc = "/usr/src/lib/libpc/libpc"; if (argp[3] != '\0') { lpc = &argp[3]; } continue; } continue; case 'c': cflag = 1; continue; case 'l': if (argp[2]) continue; /* fall into ... */ case 'b': case 'g': case 's': case 'w': case 'z': case 'C': pc0args[pc0argx++] = argp; if (argp[1] == 'g') gflag = 1; continue; case 't': fprintf(stderr, "pc: -t is default; -C for checking\n"); continue; case 'p': crt0 = mcrt0; pflag++; continue; } } if (gflag && Oflag) { fprintf(stderr, "pc: warning: -g overrides -O\n"); Oflag = 0; } tname[0] = mktemp("/tmp/p0XXXXXX"); tname[1] = mktemp("/tmp/p1XXXXXX"); savargx = pc0argx; for (i = 0; i < argc; i++) { argp = argv[i]; if (argp[0] == '-') continue; if (suffix(argp) == 's') { asargx = 1; if (Jflag) asargs[asargx++] = "-J"; asargs[asargx++] = argp; asargs[asargx++] = "-o"; tfile[1] = setsuf(argp, 'o'); asargs[asargx++] = tfile[1]; asargs[asargx] = 0; if (dosys(as, asargs, 0, 0)) continue; tfile[1] = 0; continue; } if (suffix(argp) != 'p') continue; tfile[0] = tname[0]; pc0args[2] = tfile[0]; pc0argx = savargx; if (pflag) pc0args[pc0argx++] = "-p"; pc0args[pc0argx++] = argp; pc0args[pc0argx] = 0; if (dosys(pc0, pc0args, 0, 0)) continue; pc1args[1] = tfile[0]; tfile[1] = tname[1]; if (dosys(pc1, pc1args, 0, tfile[1])) continue; unlink(tfile[0]); tfile[0] = tname[0]; if (Oflag) { if (dosys(c2, c2args, tfile[1], tfile[0])) continue; unlink(tfile[1]); tfile[1] = tfile[0]; tfile[0] = tname[1]; } if (Sflag) tfile[0] = setsuf(argp, 's'); if (dosys(pc2, pc2args, tfile[1], tfile[0])) continue; unlink(tfile[1]); tfile[1] = 0; if (Sflag) { tfile[0] = 0; continue; } asargx = 1; if (Jflag) asargs[asargx++] = "-J"; asargs[asargx++] = tfile[0]; asargs[asargx++] = "-o"; tfile[1] = setsuf(argp, 'o'); asargs[asargx++] = tfile[1]; asargs[asargx] = 0; if (dosys(as, asargs, 0, 0)) continue; tfile[1] = 0; remove(); } if (errs || cflag || Sflag) done(); /* char *pc3args[NARGS] = { "pc3", 0 }; */ pc3args[0] = "pc3"; for (i = 0; i < argc; i++) { argp = argv[i]; if (!strcmp(argp, "-o")) i++; if (argp[0] == '-') continue; switch (getsuf(argp)) { case 'o': pc3args[pc3argx++] = argp; nxo++; continue; case 's': case 'p': onepso = pc3args[pc3argx++] = savestr(setsuf(argp, 'o')); np++; continue; } } pc3args[pc3argx] = 0; if (dosys(pc3, pc3args, 0, 0)) done(); /* char *ldargs[NARGS] = { "ld", "-X", "/lib/crt0.o", 0, }; */ ldargs[0] = "ld"; ldargs[1] = "-X"; ldargs[2] = crt0; for (i = 0; i < argc; i++) { argp = argv[i]; if (argp[0] != '-') { switch (getsuf(argp)) { case 'p': case 's': ldargs[ldargx] = savestr(setsuf(argp, 'o')); break; default: ldargs[ldargx] = argp; break; } if (getsuf(ldargs[ldargx]) == 'o') for (j = 0; j < ldargx; j++) if (!strcmp(ldargs[j], ldargs[ldargx])) goto duplicate; ldargx++; duplicate: continue; } switch (argp[1]) { case 'i': while (i+1 < argc && argv[i+1][0] != '-' && getsuf(argv[i+1]) != 'p') i++; continue; case 'd': if (argp[2] == 0) continue; ldargs[ldargx++] = argp; continue; case 'o': ldargs[ldargx++] = argp; i++; ldargs[ldargx++] = argv[i]; continue; case 'l': if (argp[2]) ldargs[ldargx++] = argp; continue; case 'c': case 'g': case 'w': case 'p': case 'S': case 'J': case 'T': case 'O': case 'C': case 'b': case 's': case 'z': continue; default: ldargs[ldargx++] = argp; continue; } } ldargs[ldargx++] = lpc; if (gflag) ldargs[ldargx++] = "-lg"; ldargs[ldargx++] = "-lnm"; ldargs[ldargx++] = "-lc"; ldargs[ldargx] = 0; if (dosys(ld, ldargs, 0, 0)==0 && np == 1 && nxo == 0) unlink(onepso); done(); } dosys(cmd, argv, in, out) char *cmd, **argv, *in, *out; { union wait status; int pid; if (debug) { int i; printf("%s:", cmd); for (i = 0; argv[i]; i++) printf(" %s", argv[i]); if (in) printf(" <%s", in); if (out) printf(" >%s", out); printf("\n"); } pid = vfork(); if (pid < 0) { fprintf(stderr, "pc: No more processes\n"); done(); } if (pid == 0) { if (in) { close(0); if (open(in, 0) != 0) { perror(in); exit(1); } } if (out) { close(1); unlink(out); if (creat(out, 0666) != 1) { perror(out); exit(1); } } signal(SIGINT, SIG_DFL); execv(cmd, argv); perror(cmd); exit(1); } while (wait(&status) != pid) ; if (WIFSIGNALED(status)) { if (status.w_termsig != SIGINT) fprintf(stderr, "Fatal error in %s\n", cmd); errs = 100; done(); /*NOTREACHED*/ } if (status.w_retcode) { errs = 1; remove(); } return (status.w_retcode); } done() { remove(); exit(errs); } remove() { if (tfile[0]) unlink(tfile[0]); if (tfile[1]) unlink(tfile[1]); } onintr() { errs = 1; done(); } getsuf(cp) char *cp; { if (*cp == 0) return; while (cp[1]) cp++; if (cp[-1] != '.') return (0); return (*cp); } 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); } #define NSAVETAB 512 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; return (cp); } suffix(cp) char *cp; { if (cp[0] == 0 || cp[1] == 0) return (0); while (cp[1]) cp++; if (cp[-1] == '.') return (*cp); return (0); } tr(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; return (cp); } suffix(cp) char *cp; { if (cp[0] == 0 || cp[1] == 0) rcmd/pascal/pc.h 644 0 33 6125 2552606270 6624 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)pc.h 1.2 10/14/80"; */ /* * random constants for pc */ /* * the name of the display. * the display is made up of saved AP's and FP's. * FP's are used to find locals, and AP's are used to find parameters. * FP and AP are untyped pointers, but are used throughout as (char *). * the display is used by adding AP_OFFSET or FP_OFFSET to the * address of the approriate display entry. */ #define DISPLAYNAME "__disply" struct dispsave { char *savedAP; char *savedFP; }; #define AP_OFFSET ( 0 ) #define FP_OFFSET ( sizeof(char *) ) /* * the structure below describes the locals used by the run time system. * at function entry, at least this much space is allocated, * and the following information is filled in: * the address of a routine to close the current frame for unwinding, * a pointer to the display entry for the current sta((tic level and * the previous contents of the display for this static level. * the curfile location is used to point to the currently active file, * and is filled in as io is initiated. * one of these structures is allocated on the (negatively growing) stack. * at function entry, fp is set to point to the last field of the struct, * thus the offsets of the fields are as indicated below. */ struct rtlocals { struct iorec *curfile; struct dispsave dsave; struct dispsave *dptr; int (*unwind)(); } rtlocs; #define CURFILEOFFSET ( ( -sizeof rtlocs ) + sizeof rtlocs.unwind ) #define DSAVEOFFSET ( CURFILEOFFSET + sizeof rtlocs.curfile ) #define DPTROFFSET ( DSAVEOFFSET + sizeof rtlocs.dsave ) #define UNWINDOFFSET ( DPTROFFSET + sizeof rtlocs.dptr ) #define UNWINDNAME "_UNWIND" /* * the register save mask for saving no registers */ #define RSAVEMASK ( 0 ) /* * runtime check mask for divide check and integer overflow */ #define RUNCHECK ( ( 1 << 15 ) | ( 1 << 14 ) ) /* * formats for various names * NAMEFORMAT arbitrary length strings. * EXTFORMAT for externals, a preceding underscore. * PREFIXFORMAT used to print made up names with prefixes. * LABELPREFIX with getlab() makes up label names. * LLABELPREFIX with getlab() makes up sdb labels. * a typical use might be to print out a name with a preceeding underscore * with putprintf( EXTFORMAT , 0 , name ); */ #define NAMEFORMAT "%s" #define EXTFORMAT "_%s" #define PREFIXFORMAT "%s%d" #define LABELPREFIX "L" #define LLABELPREFIX "LL" /* * the name of the statement counter */ #define STMTCOUNT "__stcnt" /* * the name of the pcp counters */ #define PCPCOUNT "__pcpcount" /* * a vector of pointer to enclosing functions for fully qualified names. */ char *enclosing[ DSPLYSZ ]; /* * and of course ... */ #define BITSPERBYTE 8 /* * error number for case label not found (ECASE) * stolen from ~mckusick/px/lib/h01errs.h */ #define ECASE 5 L" #define LLABELPREFIX "LL" /* * the name of the statement counter */ #define STMTCOUNT "__stcnt" /* * the name of the pcp counters */ #define PCPCOUNT "__pcpcount" /* * a vector of pointer to enclosing functions for fully qualified names. */ char *enclosing[ DSPLYSZ ]; /* * and of course ... */ #define BITSPERBYTE 8 /* * error number for case label not cmd/pascal/pc2.c 644 0 33 12106 2552606271 6716 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)pc2.c 1.10 6/8/81"; #include #include /* * The hash table must be at least twice as big as the number * of patterns, preferably bigger. It must also be a prime number */ #define HSHSIZ 101 struct pats { char *name; char *replace; } ptab[] = { { "1,_ACTFILE\n", " movl (sp)+,r1\n\ movl 12(r1),r0\n" }, { "1,_fgetc\n", " sobgeq *(sp),1f\n\ calls $1,__filbuf\n\ jbr 2f\n\ 1:\n\ addl3 $4,(sp)+,r1\n\ movzbl *(r1),r0\n\ incl (r1)\n\ 2:\n" }, { "2,_fputc\n", " sobgeq *4(sp),1f\n\ calls $2,__flsbuf\n\ jbr 2f\n\ 1:\n\ popr $0x3\n\ movb r0,*4(r1)\n\ incl 4(r1)\n\ 2:\n" }, { "3,_blkcpy\n", " popr $0xb\n\ pushl r0\n\ jbr 2f\n\ 1:\n\ subl2 r0,(sp)\n\ movc3 r0,(r1),(r3)\n\ 2:\n\ movzwl $65535,r0\n\ cmpl (sp),r0\n\ jgtr 1b\n\ movl (sp)+,r0\n\ movc3 r0,(r1),(r3)\n" }, { "2,_blkclr\n", " movl 4(sp),r3\n\ jbr 2f\n\ 1:\n\ subl2 r0,(sp)\n\ movc5 $0,(r3),$0,r0,(r3)\n\ 2:\n\ movzwl $65535,r0\n\ cmpl (sp),r0\n\ jgtr 1b\n\ popr $0x3\n\ movc5 $0,(r3),$0,r0,(r3)\n" }, { "3,_LOCC\n", " popr $0x30\n\ movl (sp)+,r1\n\ 1:\n\ movzwl $65535,r0\n\ cmpl r5,r0\n\ jleq 1f\n\ subl2 r0,r5\n\ locc r4,r0,(r1)\n\ jeql 1b\n\ addl2 r5,r0\n\ jbr 2f\n\ 1:\n\ locc r4,r5,(r1)\n\ 2:\n" }, { "2,_ROUND\n", " cvtrdl (sp)+,r0\n" }, { "2,_TRUNC\n", " cvtdl (sp)+,r0\n" }, { "1,_FCALL\n", " movl (sp),r0\n\ ashl $3,4(r0),r1\n\ movc3 r1,__disply+8,8(r0)[r1]\n\ movl (sp)+,r0\n\ ashl $3,4(r0),r1\n\ movc3 r1,8(r0),__disply+8\n" }, { "1,_FRTN\n", " movl (sp)+,r0\n\ ashl $3,4(r0),r1\n\ movc3 r1,8(r0)[r1],__disply+8\n" }, { "3,_FSAV\n", " movl 8(sp),r0\n\ movl (sp)+,(r0)\n\ movl (sp)+,4(r0)\n\ ashl $3,4(r0),r1\n\ movc3 r1,__disply+8,8(r0)\n\ movl (sp)+,r0" }, { "3,_RELEQ\n", " popr $0xb\n\ movl r0,r4\n\ 1:\n\ movzwl $65535,r0\n\ cmpl r4,r0\n\ jleq 3f\n\ subl2 r0,r4\n\ cmpc3 r0,(r1),(r3)\n\ jeql 1b\n\ 2:\n\ clrl r0\n\ jbr 4f\n\ 3:\n\ cmpc3 r4,(r1),(r3)\n\ jneq 2b\n\ incl r0\n\ 4:\n" }, { "3,_RELNE\n", " popr $0xb\n\ movl r0,r4\n\ 1:\n\ movzwl $65535,r0\n\ cmpl r4,r0\n\ jleq 3f\n\ subl2 r0,r4\n\ cmpc3 r0,(r1),(r3)\n\ jeql 1b\n\ 2:\n\ movl $1,r0\n\ jbr 4f\n\ 3:\n\ cmpc3 r4,(r1),(r3)\n\ jneq 2b\n\ 4:\n" }, { "3,_RELSLT\n", " popr $0xb\n\ movl r0,r4\n\ jbr 2f\n\ 1:\n\ subl2 r0,r4\n\ cmpc3 r0,(r1),(r3)\n\ jneq 3f\n\ 2:\n\ movzwl $65535,r0\n\ cmpl r4,r0\n\ jgtr 1b\n\ cmpc3 r4,(r1),(r3)\n\ 3:\n\ jlss 4f\n\ clrl r0\n\ jbr 5f\n\ 4:\n\ movl $1,r0\n\ 5:\n" }, { "3,_RELSLE\n", " popr $0xb\n\ movl r0,r4\n\ jbr 2f\n\ 1:\n\ subl2 r0,r4\n\ cmpc3 r0,(r1),(r3)\n\ jneq 3f\n\ 2:\n\ movzwl $65535,r0\n\ cmpl r4,r0\n\ jgtr 1b\n\ cmpc3 r4,(r1),(r3)\n\ 3:\n\ jleq 4f\n\ clrl r0\n\ jbr 5f\n\ 4:\n\ movl $1,r0\n\ 5:\n" }, { "3,_RELSGT\n", " popr $0xb\n\ movl r0,r4\n\ jbr 2f\n\ 1:\n\ subl2 r0,r4\n\ cmpc3 r0,(r1),(r3)\n\ jneq 3f\n\ 2:\n\ movzwl $65535,r0\n\ cmpl r4,r0\n\ jgtr 1b\n\ cmpc3 r4,(r1),(r3)\n\ 3:\n\ jgtr 4f\n\ clrl r0\n\ jbr 5f\n\ 4:\n\ movl $1,r0\n\ 5:\n" }, { "3,_RELSGE\n", " popr $0xb\n\ movl r0,r4\n\ jbr 2f\n\ 1:\n\ subl2 r0,r4\n\ cmpc3 r0,(r1),(r3)\n\ jneq 3f\n\ 2:\n\ movzwl $65535,r0\n\ cmpl r4,r0\n\ jgtr 1b\n\ cmpc3 r4,(r1),(r3)\n\ 3:\n\ jgeq 4f\n\ clrl r0\n\ jbr 5f\n\ 4:\n\ movl $1,r0\n\ 5:\n" }, { "4,_ADDT\n", " popr $0x17\n\ movl r0,r3\n\ 1:\n\ bisl3 (r1)+,(r2)+,(r3)+\n\ sobgtr r4,1b\n" }, { "4,_SUBT\n", " popr $0x17\n\ movl r0,r3\n\ 1:\n\ bicl3 (r2)+,(r1)+,(r3)+\n\ sobgtr r4,1b\n" }, { "4,_MULT\n", " popr $0x17\n\ movl r0,r3\n\ 1:\n\ mcoml (r1)+,r5\n\ bicl3 r5,(r2)+,(r3)+\n\ sobgtr r4,1b\n" }, { "4,_IN\n", " popr $0x1e\n\ clrl r0\n\ subl2 r2,r1\n\ cmpl r1,r3\n\ jgtru 1f\n\ jbc r1,(r4),1f\n\ incl r0\n\ 1:\n" } }; struct pats *htbl[HSHSIZ]; #define HASH(cp, hp) {\ hash = 0; rehash = 1; ccp = cp; \ do { \ hash *= (int)*ccp++; \ } while (*ccp && *ccp != '\n'); \ hash >>= 7; hash %= HSHSIZ; hp = &htbl[hash]; size = ccp - cp + 1; \ } #define REHASH(hp) {\ hp += rehash; rehash += 2; \ if (hp >= &htbl[HSHSIZ]) \ hp -= HSHSIZ; \ } main(argc, argv) int argc; char **argv; { register struct pats *pp; register struct pats **hp; register char *cp, *ccp, *lp; register int hash, rehash, size; char line[BUFSIZ]; extern char *index(); if (argc > 1) freopen(argv[1], "r", stdin); if (argc > 2) freopen(argv[2], "w", stdout); /* * set up the hash table */ for(pp = ptab; pp < &ptab[sizeof ptab/sizeof ptab[0]]; pp++) { HASH(pp->name, hp); while (*hp) REHASH(hp); *hp = pp; } /* * check each line and replace as appropriate */ while (fgets(line, BUFSIZ, stdin)) { lp = index(line, ':'); for (cp = (lp != NULL) ? ++lp : line; *cp == '\t'; ) cp++; if (strcmpn(cp, "calls\t$", 7) != 0) { fputs(line, stdout); continue; } cp += 7; HASH(cp, hp); while (*hp) { if (strcmpn((*hp)->name, cp, size)==NULL) { if (lp != NULL) { *lp++ = '\n'; *lp = '\0'; fputs(line, stdout); } fputs((*hp)->replace, stdout); goto nextline; } REHASH(hp); } fputs(line, stdout); nextline:; } exit(0); } le (fgets(line, BUFSIZ, stdin)) { lp = index(line, ':'); for (cp = (lp != NULL) ? ++lp : line; *cp == '\t'; ) cp++; if (strcmpn(cp, "calls\t$", 7) != 0) { fputs(line, stdout); continue; } cp += 7; HASH(cp, hp); while (*hp) { if (strcmpn((*hp)->name, cp, size)==NULL) { if (lp != NULL) { *lp++ = '\n'; *lp = '\0'; fputs(line, stdout); } fputs((*hp)->replace, stdout); goto nextline; cmd/pascal/pc3.c 644 0 33 50710 2552606273 6724 /* Copyright (c) 1980 Regents of the University of California */ static char sccsid[] = "@(#)pc3.c 1.6 9/9/80"; /* * Pc3 is a pass in the Berkeley Pascal compilation * process that is performed just prior to linking Pascal * object files. Its purpose is to enforce the rules of * separate compilation for Berkeley Pascal. Pc3 is called * with the same argument list of object files that is sent to * the loader. These checks are performed by pc3 by examining * the symbol tables of the object files: * (1) All source and included files must be "up-to-date" with * the object files of which they are components. * (2) Each global Pascal symbol (label, constant, type, * variable, procedure, or function name) must be uniquely * declared, i.e. declared in only one included file or * source file. * (3) Each external function (or procedure) may be resolved * at most once in a source file which included t((he * external declaration of the function. * * The symbol table of each object file is scanned and * each global Pascal symbol is placed in a hashed symbol * table. The Pascal compiler has been modified to emit all * Pascal global symbols to the object file symbol table. The * information stored in the symbol table for each such symbol * is: * * - the name of the symbol; * - a subtype descriptor; * - for file symbols, their last modify time; * - the file which logically contains the declaration of * the symbol (not an include file); * - the file which textually contains the declaration of * the symbol (possibly an include file); * - the line number at which the symbol is declared; * - the file which contains the resolution of the symbol. * - the line number at which the symbol is resolved; * * If a symbol has been previously entered into the symbol * table, a check is made that the current declaration is of * the same type and from the same include file as the previous * one. Except for files and functions and procedures, it is * an error for a symbol declaration to be encountered more * than once, unless the re-declarations come from the same * included file as the original. * * As an include file symbol is encountered in a source * file, the symbol table entry of each symbol declared in that * include file is modified to reflect its new logical * inclusion in the source file. File symbols are also * encountered as an included file ends, signaling the * continuation of the enclosing file. * * Functions and procedures which have been declared * external may be resolved by declarations from source files * which included the external declaration of the function. * Functions and procedures may be resolved at most once across * a set of object files. The loader will complain if a * function is not resolved at least once. */ char program[] = "pc"; #include #include #include #include #include #include #include #include #include "pstab.h" #include "pc3.h" int errors = 0; /* * check each of the argument .o files (or archives of .o files). */ main( argc , argv ) int argc; char **argv; { struct fileinfo ofile; while ( ++argv , --argc ) { # ifdef DEBUG fprintf( stderr , "[main] *argv = %s\n" , *argv ); # endif DEBUG ofile.name = *argv; checkfile( &ofile ); } exit( errors ); } /* * check the namelist of a file, or all namelists of an archive. */ checkfile( ofilep ) struct fileinfo *ofilep; { union { char mag_armag[ SARMAG + 1 ]; struct exec mag_exec; } mag_un; int red; struct stat filestat; ofilep -> file = fopen( ofilep -> name , "r" ); if ( ofilep -> file == NULL ) { error( WARNING , "cannot open: %s" , ofilep -> name ); return; } fstat( fileno( ofilep -> file ) , &filestat ); ofilep -> modtime = filestat.st_mtime; red = fread( (char *) &mag_un , 1 , sizeof mag_un , ofilep -> file ); if ( red != sizeof mag_un ) { error( WARNING , "cannot read header: %s" , ofilep -> name ); return; } if ( mag_un.mag_exec.a_magic == OARMAG ) { error( WARNING , "old archive: %s" , ofilep -> name ); return; } if ( strncmp( mag_un.mag_armag , ARMAG , SARMAG ) == 0 ) { /* archive, iterate through elements */ # ifdef DEBUG fprintf( stderr , "[checkfile] archive %s\n" , ofilep -> name ); # endif DEBUG ofilep -> nextoffset = SARMAG; while ( nextelement( ofilep ) ) { checknl( ofilep ); } } else if ( N_BADMAG( mag_un.mag_exec ) ) { /* not a file.o */ error( WARNING , "bad format: %s" , ofilep -> name ); return; } else { /* a file.o */ # ifdef DEBUG fprintf( stderr , "[checkfile] .o file %s\n" , ofilep -> name ); # endif DEBUG fseek( ofilep -> file , 0L , 0 ); ofilep -> nextoffset = filestat.st_size; checknl( ofilep ); } fclose( ofilep -> file ); } /* * check the namelist of this file for conflicts with * previously entered symbols. */ checknl( ofilep ) register struct fileinfo *ofilep; { long red; struct exec oexec; off_t symoff; long numsyms; register struct nlist *nlp; register char *stringp; long strsize; long sym; red = fread( (char *) &oexec , 1 , sizeof oexec , ofilep -> file ); if ( red != sizeof oexec ) { error( WARNING , "error reading struct exec: %s" , ofilep -> name ); return; } if ( N_BADMAG( oexec ) ) { return; } symoff = N_SYMOFF( oexec ) - sizeof oexec; fseek( ofilep -> file , symoff , 1 ); numsyms = oexec.a_syms / sizeof ( struct nlist ); if ( numsyms == 0 ) { error( WARNING , "no name list: %s" , ofilep -> name ); return; } nlp = (struct nlist *) calloc( numsyms , sizeof ( struct nlist ) ); if ( nlp == 0 ) { error( FATAL , "no room for %d nlists" , numsyms ); } red = fread( ( char * ) nlp , numsyms , sizeof ( struct nlist ) , ofilep -> file ); if ( ftell( ofilep -> file ) + sizeof ( off_t ) >= ofilep -> nextoffset ) { error( WARNING , "no string table (old format .o?)" , ofilep -> name ); return; } red = fread( (char *) &strsize , sizeof strsize , 1 , ofilep -> file ); if ( red != 1 ) { error( WARNING , "no string table (old format .o?)" , ofilep -> name ); return; } stringp = ( char * ) malloc( strsize ); if ( stringp == 0 ) { error( FATAL , "no room for %d bytes of strings" , strsize ); } red = fread( stringp + sizeof strsize , strsize - sizeof ( strsize ) , 1 , ofilep -> file ); if ( red != 1 ) { error( WARNING , "error reading string table: %s" , ofilep -> name ); } # ifdef DEBUG fprintf( stderr , "[checknl] %s: %d symbols\n" , ofilep -> name , numsyms ); # endif DEBUG for ( sym = 0 ; sym < numsyms ; sym++) { if ( nlp[ sym ].n_un.n_strx ) { nlp[ sym ].n_un.n_name = stringp + nlp[ sym ].n_un.n_strx; } else { nlp[ sym ].n_un.n_name = ""; } checksymbol( &nlp[ sym ] , ofilep ); } if ( nlp ) { free( nlp ); } if ( stringp ) { free( stringp ); } } /* * check a symbol. * look it up in the hashed symbol table, * entering it if necessary. * this maintains a state of which .p and .i files * it is currently in the midst from the nlist entries * for source and included files. * if we are inside a .p but not a .i, pfilep == ifilep. */ checksymbol( nlp , ofilep ) struct nlist *nlp; struct fileinfo *ofilep; { static struct symbol *pfilep = NIL; static struct symbol *ifilep = NIL; register struct symbol *symbolp; # ifdef DEBUG if ( pfilep && ifilep ) { fprintf( stderr , "[checksymbol] pfile %s ifile %s\n" , pfilep -> name , ifilep -> name ); } fprintf( stderr , "[checksymbol] ->name %s ->n_desc %x (%s)\n" , nlp -> n_un.n_name , nlp -> n_desc , classify( nlp -> n_desc ) ); # endif DEBUG if ( nlp -> n_type != N_PC ) { /* don't care about the others */ return; } symbolp = entersymbol( nlp -> n_un.n_name ); if ( symbolp -> lookup == NEW ) { # ifdef DEBUG fprintf( stderr , "[checksymbol] ->name %s is NEW\n" , symbolp -> name ); # endif DEBUG symbolp -> desc = nlp -> n_desc; switch ( symbolp -> desc ) { case N_PGLABEL: case N_PGCONST: case N_PGTYPE: case N_PGVAR: case N_PGFUNC: case N_PGPROC: symbolp -> sym_un.sym_str.rfilep = ifilep; symbolp -> sym_un.sym_str.rline = nlp -> n_value; symbolp -> sym_un.sym_str.fromp = pfilep; symbolp -> sym_un.sym_str.fromi = ifilep; symbolp -> sym_un.sym_str.iline = nlp -> n_value; return; case N_PEFUNC: case N_PEPROC: symbolp -> sym_un.sym_str.rfilep = NIL; symbolp -> sym_un.sym_str.rline = 0; /* * functions can only be declared external * in included files. */ if ( pfilep == ifilep ) { error( WARNING , "%s, line %d: %s %s must be declared in included file" , pfilep -> name , nlp -> n_value , classify( symbolp -> desc ) , symbolp -> name ); } symbolp -> sym_un.sym_str.fromp = pfilep; symbolp -> sym_un.sym_str.fromi = ifilep; symbolp -> sym_un.sym_str.iline = nlp -> n_value; return; case N_PSO: pfilep = symbolp; /* and fall through */ case N_PSOL: ifilep = symbolp; symbolp -> sym_un.modtime = mtime( symbolp -> name ); if ( symbolp -> sym_un.modtime > ofilep -> modtime ) { error( WARNING , "%s is out of date with %s" , ofilep -> name , symbolp -> name ); } return; } } else { # ifdef DEBUG fprintf( stderr , "[checksymbol] ->name %s is OLD\n" , symbolp -> name ); # endif DEBUG switch ( symbolp -> desc ) { case N_PSO: /* * finding a file again means you are back * in it after finishing an include file. */ pfilep = symbolp; /* and fall through */ case N_PSOL: /* * include files can be seen more than once, * but they still have to be timechecked. * (this will complain twice for out of date * include files which include other files. * sigh.) */ ifilep = symbolp; if ( symbolp -> sym_un.modtime > ofilep -> modtime ) { error( WARNING , "%s is out of date with %s" , ofilep -> name , symbolp -> name ); } return; case N_PEFUNC: case N_PEPROC: /* * we may see any number of external declarations, * but they all have to come * from the same include file. */ if ( nlp -> n_desc == N_PEFUNC || nlp -> n_desc == N_PEPROC ) { goto included; } /* * an external function can be resolved by * the resolution of the function * if the resolving file * included the external declaration. */ if ( ( symbolp -> desc == N_P((EFUNC && nlp -> n_desc != N_PGFUNC ) || ( symbolp -> desc == N_PEPROC && nlp -> n_desc != N_PGPROC ) || symbolp -> sym_un.sym_str.fromp != pfilep ) { break; } /* * an external function can only be resolved once. */ if ( symbolp -> sym_un.sym_str.rfilep != NIL ) { break; } symbolp -> sym_un.sym_str.rfilep = ifilep; symbolp -> sym_un.sym_str.rline = nlp -> n_value; return; case N_PGFUNC: case N_PGPROC: /* * functions may not be seen more than once. * the loader will complain about * `multiply defined', but we can, too. */ break; case N_PGLABEL: case N_PGCONST: case N_PGTYPE: case N_PGVAR: /* * labels, constants, types, variables * and external declarations * may be seen as many times as they want, * as long as they come from the same include file. * make it look like they come from this .p file. */ included: if ( nlp -> n_desc != symbolp -> desc || symbolp -> sym_un.sym_str.fromi != ifilep ) { break; } symbolp -> sym_un.sym_str.fromp = pfilep; return; } /* * this is the breaks */ error( WARNING , "%s, line %d: %s already defined (%s, line %d)." , ifilep -> name , nlp -> n_value , nlp -> n_un.n_name , symbolp -> sym_un.sym_str.rfilep -> name , symbolp -> sym_un.sym_str.rline ); } } /* * quadratically hashed symbol table. * things are never deleted from the hash symbol table. * as more hash table is needed, * a new one is alloc'ed and chained to the end. * search is by rehashing within each table, * traversing chains to next table if unsuccessful. */ struct symbol * entersymbol( name ) char *name; { static struct symboltableinfo *symboltable = NIL; char *enteredname; long hashindex; register struct symboltableinfo *tablep; register struct symbol **herep; register struct symbol **limitp; register long increment; enteredname = enterstring( name ); hashindex = SHORT_ABS( ( long ) enteredname ) % SYMBOLPRIME; for ( tablep = symboltable ; /*return*/ ; tablep = tablep -> chain ) { if ( tablep == NIL ) { # ifdef DEBUG fprintf( stderr , "[entersymbol] calloc\n" ); # endif DEBUG tablep = ( struct symboltableinfo * ) calloc( sizeof ( struct symboltableinfo ) , 1 ); if ( tablep == NIL ) { error( FATAL , "ran out of memory (entersymbol)" ); } if ( symboltable == NIL ) { symboltable = tablep; } } herep = &( tablep -> entry[ hashindex ] ); limitp = &( tablep -> entry[ SYMBOLPRIME ] ); increment = 1; do { # ifdef DEBUG fprintf( stderr , "[entersymbol] increment %d\n" , increment ); # endif DEBUG if ( *herep == NIL ) { /* empty */ if ( tablep -> used > ( ( SYMBOLPRIME / 3 ) * 4 ) ) { /* too full, break for next table */ break; } tablep -> used++; *herep = symbolalloc(); ( *herep ) -> name = enteredname; ( *herep ) -> lookup = NEW; # ifdef DEBUG fprintf( stderr , "[entersymbol] name %s NEW\n" , enteredname ); # endif DEBUG return *herep; } /* a find? */ if ( ( *herep ) -> name == enteredname ) { ( *herep ) -> lookup = OLD; # ifdef DEBUG fprintf( stderr , "[entersymbol] name %s OLD\n" , enteredname ); # endif DEBUG return *herep; } herep += increment; if ( herep >= limitp ) { herep -= SYMBOLPRIME; } increment += 2; } while ( increment < SYMBOLPRIME ); } } /* * allocate a symbol from the dynamically allocated symbol table. */ struct symbol * symbolalloc() { static struct symbol *nextsymbol = NIL; static long symbolsleft = 0; struct symbol *newsymbol; if ( symbolsleft <= 0 ) { # ifdef DEBUG fprintf( stderr , "[symbolalloc] malloc\n" ); # endif DEBUG nextsymbol = ( struct symbol * ) malloc( SYMBOLALLOC ); if ( nextsymbol == 0 ) { error( FATAL , "ran out of memory (symbolalloc)" ); } symbolsleft = SYMBOLALLOC / sizeof( struct symbol ); } newsymbol = nextsymbol; nextsymbol++; symbolsleft--; return newsymbol; } /* * hash a string based on all of its characters. */ long hashstring( string ) char *string; { register char *cp; register long value; value = 0; for ( cp = string ; *cp ; cp++ ) { value = ( value * 2 ) + *cp; } return value; } /* * quadratically hashed string table. * things are never deleted from the hash string table. * as more hash table is needed, * a new one is alloc'ed and chained to the end. * search is by rehashing within each table, * traversing chains to next table if unsuccessful. */ char * enterstring( string ) char *string; { static struct stringtableinfo *stringtable = NIL; long hashindex; register struct stringtableinfo *tablep; register char **herep; register char **limitp; register long increment; hashindex = SHORT_ABS( hashstring( string ) ) % STRINGPRIME; for ( tablep = stringtable ; /*return*/ ; tablep = tablep -> chain ) { if ( tablep == NIL ) { # ifdef DEBUG fprintf( stderr , "[enterstring] calloc\n" ); # endif DEBUG tablep = ( struct stringtableinfo * ) calloc( sizeof ( struct stringtableinfo ) , 1 ); if ( tablep == NIL ) { error( FATAL , "ran out of memory (enterstring)" ); } if ( stringtable == NIL ) { stringtable = tablep; } } herep = &( tablep -> entry[ hashindex ] ); limitp = &( tablep -> entry[ STRINGPRIME ] ); increment = 1; do { # ifdef DEBUG fprintf( stderr , "[enterstring] increment %d\n" , increment ); # endif DEBUG if ( *herep == NIL ) { /* empty */ if ( tablep -> used > ( ( STRINGPRIME / 3 ) * 4 ) ) { /* too full, break for next table */ break; } tablep -> used++; *herep = charalloc( strlen( string ) ); strcpy( *herep , string ); # ifdef DEBUG fprintf( stderr , "[enterstring] string %s copied\n" , *herep ); # endif DEBUG return *herep; } /* quick, check the first chars and then the rest */ if ( **herep == *string && strcmp( *herep , string ) == 0 ) { # ifdef DEBUG fprintf( stderr , "[enterstring] string %s found\n" , *herep ); # endif DEBUG return *herep; } herep += increment; if ( herep >= limitp ) { herep -= STRINGPRIME; } increment += 2; } while ( increment < STRINGPRIME ); } } /* * copy a string to the dynamically allocated character table. */ char * charalloc( length ) register long length; { static char *nextchar = NIL; static long charsleft = 0; register long lengthplus1 = length + 1; register long askfor; char *newstring; if ( charsleft < lengthplus1 ) { askfor = lengthplus1 > CHARALLOC ? lengthplus1 : CHARALLOC; # ifdef DEBUG fprintf( stderr , "[charalloc] malloc( %d )\n" , askfor ); # endif DEBUG nextchar = ( char * ) malloc( askfor ); if ( nextchar == 0 ) { error( FATAL , "no room for %d characters" , askfor ); } charsleft = askfor; } newstring = nextchar; nextchar += lengthplus1; charsleft -= lengthplus1; return newstring; } /* * read an archive header for the next element * and find the offset of the one after this. */ BOOL nextelement( ofilep ) struct fileinfo *ofilep; { register char *cp; register long red; register off_t arsize; struct ar_hdr archdr; fseek( ofilep -> file , ofilep -> nextoffset , 0 ); red = fread( (char *) &archdr , 1 , sizeof archdr , ofilep -> file ); if ( red != sizeof archdr ) { return FALSE; } /* null terminate the blank-padded name */ cp = &archdr.ar_name[ ( sizeof archdr.ar_name ) - 1 ]; *cp = '\0'; while ( *--cp == ' ' ) { *cp = '\0'; } /* set up the address of the beginning of next element */ arsize = atol( archdr.ar_size ); /* archive elements are aligned on 0 mod 2 boundaries */ if ( arsize & 1 ) { arsize += 1; } ofilep -> nextoffset = ftell( ofilep -> file ) + arsize; /* say we had one */ return TRUE; } /* * variable number of arguments to error, like printf. */ error( fatal , message , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 ) int fatal; char *message; { fprintf( stderr , "%s: " , program ); fprintf( stderr , message , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 ); fprintf( stderr , "\n" ); if ( fatal == FATAL ) { exit( 2 ); } errors = 1; } /* * find the last modify time of a file. * on error, return the current time. */ time_t mtime( filename ) char *filename; { struct stat filestat; # ifdef DEBUG fprintf( stderr , "[mtime] filename %s\n" , filename ); # endif DEBUG if ( stat( filename , &filestat ) != 0 ) { error( WARNING , "%s: cannot open" , filename ); return ( (time_t) time( 0 ) ); } return filestat.st_mtime; } char * classify( type ) unsigned char type; { switch ( type ) { case N_PSO: return "source file"; case N_PSOL: return "include file"; case N_PGLABEL: return "label"; case N_PGCONST: return "constant"; case N_PGTYPE: return "type"; case N_PGVAR: return "variable"; case N_PGFUNC: return "function"; case N_PGPROC: return "procedure"; case N_PEFUNC: return "external function"; case N_PEPROC: return "external procedure"; default: return "unknown symbol"; } } char type; { switch ( type ) { case N_PSO: rcmd/pascal/pc3.h 644 0 33 5334 2552606273 6713 (( /* Copyright (c) 1980 Regents of the University of California */ /* static char sccsid[] = "@(#)pc3.h 1.3 9/4/80"; */ /* * a symbol table entry. */ struct symbol { char *name; /* pointer to string table */ short desc; /* symbol description */ int lookup; /* whether new or old */ union { /* either */ struct { /* for a symbol, */ struct symbol *fromp; /* its defining .p file */ struct symbol *fromi; /* its defining .i file */ long iline; /* the .i file line */ struct symbol *rfilep; /* its resolving file */ long rline; /* resolving file line */ } sym_str; time_t modtime; /* for a file, its st_mtime */ } sym_un; }; /* * struct for an argument .o file. */ struct fileinfo { FILE *file; char *name; time_t modtime; off_t nextoffset; }; /* * old archive magic for error detection. */ #define OARMAG 0177545 /* * this is used to trim pointers into the range of a mod of a prime. */ #define SHORT_ABS( n ) ( n & 077777 ) /* * a prime number which gets sizeof( struct symboltableinfo ) * up to a multiple of BUFSIZ. */ #define SYMBOLPRIME 1021 /* * number of entries used in this symbol table, * a chain to the next symbol table, * and the entries. (pointers to struct symbols.) */ struct symboltableinfo { long used; struct symboltableinfo *chain; struct symbol *entry[ SYMBOLPRIME ]; }; /* * if new struct symbols are needed, * allocate this much space and hack it up into struct symbols. */ #define SYMBOLALLOC BUFSIZ /* * a prime number which gets sizeof( struct stringtableinfo ) * up to a multiple of BUFSIZ. */ #define STRINGPRIME 1021 /* * number of entries used in this string table, * a chain to the next string table, * and the entries. (pointers to the character table.) */ struct stringtableinfo { long used; struct stringtableinfo *chain; char *entry[ STRINGPRIME ]; }; /* * if more character table space is needed, * allocate this much and hack it up into strings. */ #define CHARALLOC BUFSIZ /* * uninitialized pointer */ #define NIL 0 /* * an enumeration for error types */ #define FATAL 0 #define WARNING 1 /* * an enumeration for lookups */ #define NEW 0 #define OLD 1 /* * booleans */ #define BOOL int #define FALSE 0 #define TRUE 1 /* * function types. */ struct symbol *entersymbol(); struct symbol *symbolalloc(); long stringhash(); char *enterstring(); char *charalloc(); BOOL nextelement(); time_t mtime(); char *classify(); * uninitialized pointer */ #define NIL 0 /* * an enumeration for error types */ #define FATAL 0 #define WARNING 1 /* * an enumeration for lookups */ #define NEW 0 #define OLD 1 /* * booleans */ #define BOOL int #define FALSE 0 #define TRUE cmd/pascal/pix.c 644 0 33 3312 2552606273 7013 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)pix.c 1.2 3/6/81"; /* * pix - pi then px * * Bill Joy UCB August 26, 1977 */ #include "whoami.h" #include "objfmt.h" #define ERRS 1 char *name; int onintr(); #define ETXTBSY 26 main(argc, argv) int argc; char *argv[]; { register char **av; register int ac; int i, io, pid, status; extern errno; do io = open("/dev/null", 0); while (io >= 0 && io < 3); for (io = 3; io < 15; io++) close(io); if ((signal(2, 1) & 01) == 0) signal(2, onintr); for (ac = 1; ac < argc; ac++) if (dotted(argv[ac], 'p')) { ac++; break; } name = "-o/tmp/pixaXXXXX" + 2; mktemp(name); for (;;) { io = creat(name, 0400); if (io > 0) break; if (name[8] == 'z') { perror(name); exit(1); } name[8]++; } pid = fork(); if (pid == -1) { write(2, "No more processes\n", 18); onintr(); } if (pid == 0) { if (io != 3) { write(2, "Impossible error in pix\n", 24); onintr(); } argv[ac] = 0; argv[0] = name - 2; do execv(PI_COMP, argv); while (errno == ETXTBSY); write(2, "Can't find pi\n", 14); onintr(); } close(io); do i = wait(&status); while (i != pid && i != -1); if (i == -1 || (status & 0377)) onintr(); if (status != 0) { if ((status >> 8) == ERRS) write(2, "Execution suppressed due to compilation errors\n", 47); onintr(); } ac--; argv[ac] = name - 2; argv[argc] = 0; do execv(PX_INTRP, &argv[ac]); while (errno == ETXTBSY); write(2, "Can't find px\n", 14); onintr(); } dotted(cp, ch) char *cp, ch; { register int i; i = strlen(cp); return (i > 1 && cp[i - 2] == '.' && cp[i - 1] == ch); } onintr() { signal(2, 1); unlink(name); exit(1); } if (i == -1 || (status & 0377)) onintr(); if (status != 0) { if ((status >> 8) == ERRS) write(2, "Execution suppressed due to compilation errors\n", 47); onintr(); } ac--; argv[ac] = name - 2; argv[argc] = 0; do execv(PX_INTRP, &argv[ac]); while (errno == ETXTBSY); write(2, "Can't find px\ncmd/pascal/pmerge.c 644 0 33 16701 2552606274 7521 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)pmerge.c 1.2 6/9/81"; #include #include #include #define PRGFILE 0 #define LABELFILE 1 #define CONSTFILE 2 #define TYPEFILE 3 #define VARFILE 4 #define RTNFILE 5 #define BODYFILE 6 #define NUMFILES 7 #define TRUE 1 #define FALSE 0 #define MAXINCL 9 #define MAXNAM 75 #define TMPNAME "/usr/tmp/MGXXXXXX" FILE *files[NUMFILES]; char *names[NUMFILES]; FILE *curfile; /* current output file */ FILE *fopen(); char labelopen = FALSE, constopen = FALSE, typeopen = FALSE, varopen = FALSE; char *mktemp(); /* * Remove temporary files if interrupted */ onintr() { int i; for (i = 0; i < NUMFILES; i++) if (files[i] != NULL) unlink(names[i]); } /* * Program to merge separately compiled pascal modules into a * single standard Pascal program. */ main(argc, argv) long argc; char **argv; { FILE *incl[MAXINCL]; /* include stack */ long inclcnt = 0; /* incl index */ char *name[MAXNAM]; /* include names seen so far */ long namcnt = 0; /* next name ptr slot available */ char nambuf[BUFSIZ]; /* string table for names */ char line[BUFSIZ]; /* input line buffer */ char *next = nambuf; /* next name space available */ FILE *input = stdin; /* current input file */ long ac = 0; /* argv index */ char **cpp, *cp, *fp;/* char ptrs */ char quote; /* include quote character */ int i; /* index var */ signal(SIGINT, onintr); curfile = files[PRGFILE] = fopen(names[PRGFILE] = mktemp(TMPNAME), "w"); files[LABELFILE] = fopen(names[LABELFILE] = mktemp(TMPNAME), "w"); files[CONSTFILE] = fopen(names[CONSTFILE] = mktemp(TMPNAME), "w"); files[TYPEFILE] = fopen(names[TYPEFILE] = mktemp(TMPNAME), "w"); files[VARFILE] = fopen(names[VARFILE] = mktemp(TMPNAME), "w"); files[RTNFILE] = fopen(names[RTNFILE] = mktemp(TMPNAME), "w"); files[BODYFILE] = fopen(names[BODYFILE] = mktemp(TMPNAME), "w"); for (i = 0; i < NUMFILES; i++) if (files[i] == NULL) quit(names[i]); name[namcnt] = next; for(;;) { if (inclcnt > 0) { inclcnt--; fclose(input); input = incl[inclcnt]; } else if (++ac < argc) { input = freopen(argv[ac], "r", input); if (input == NULL) quit(argv[ac]); } else { printout(); onintr(); exit(0); } fgets(line, BUFSIZ, input); while (!feof(input)) { if (line[0] != '#') { split(line); fgets(line, BUFSIZ, input); continue; } for (cp = &line[1]; isspace(*cp); cp++) /* void */; if (strcmpn("include", cp, 7)) goto bad; for (cp += 7; isspace(*cp); cp++) /* void */; if (*cp != '\'' && *cp != '"') goto bad; for (fp = next, quote = *cp++; *cp != '\0' && *cp != quote; ) *fp++ = *cp++; if (*cp != quote && (fp[-1] != 'i' || fp[-1] != 'h') && (fp[-2] != '.')) goto bad; *fp++ = '\0'; for (cpp = name; *cpp < next && strcmp(*cpp, next); ) cpp++; if (*cpp == next) { if (inclcnt == MAXINCL) { fputs("include table overflow\n", stderr); quit(NULL); } if (namcnt++ == MAXNAM) { fputs("include name table overflow\n", stderr); quit(NULL); } incl[inclcnt] = input; inclcnt++; input = fopen(next, "r"); if (input == NULL) quit(next); next = fp; name[namcnt] = next; } fgets(line, BUFSIZ, input); } } bad: fputs("bad include format:", stderr); fputs(line, stderr); quit(NULL); } /* * Split up output into the approprite files */ char incom = FALSE; /* TRUE => in comment */ char incur = FALSE; /* TRUE => in (* *) style comment */ char inbrac = FALSE; /* TRUE => in { } style comment */ char instr = FALSE; /* TRUE => in quoted string */ char inprog = FALSE; /* TRUE => program statement has been found */ int beginnest = 0; /* routine nesting level */ int nest = 0; /* begin block nesting level */ split(line) char *line; { char ch1, *cp; /* input window */ char *word; /* ptr to current word */ int len; /* length of current word */ char prt = TRUE; /* TRUE => print current word */ ch1 = ' '; cp = line;(( while (*cp) { switch(*cp) { case '*': if (!incom && ch1 == '(') { incom = TRUE; incur = TRUE; } break; case ')': if (incur && ch1 == '*') { incom = FALSE; incur = FALSE; } break; case '{': if (!incom) { inbrac = TRUE; incom = TRUE; } break; case '}': if (inbrac) { inbrac = FALSE; incom = FALSE; } break; case '\'': if (!incom) { incom = TRUE; instr = TRUE; } else if (instr) { incom = FALSE; instr = FALSE; } break; } if (incom || !isalpha(*cp)) { fputc(*cp, curfile); ch1 = *cp++; continue; } word = cp; while (isalpha(*cp)) cp++; len = cp - word; switch (*word) { case 'b': if (len == 5 && !strcmpn(word, "begin", 5)) { if (nest == 0 && beginnest == 0) { if (inprog != 1) { fprintf(stderr, "improper program body"); quit(NULL); } curfile = files[BODYFILE]; } else { beginnest++; } } break; case 'c': if (len == 4 && !strcmpn(word, "case", 4)) { if (beginnest > 0) { beginnest++; } break; } if (len == 5 && !strcmpn(word, "const", 5)) { if (nest == 0) { prt = FALSE; if (!constopen) { constopen = TRUE; prt = TRUE; } curfile = files[CONSTFILE]; } } break; case 'e': if (len == 3 && !strcmpn(word, "end", 3)) { if (beginnest == 1) { nest--; } if (beginnest > 0) { beginnest--; } if (nest < 0) { if (inprog == 1) { inprog = 0; nest = 0; } else { fprintf(stderr, "too many end statements"); quit(NULL); } } break; } if (len == 8 && !strcmpn(word, "external", 8)) { fputs("forward", curfile); prt = FALSE; nest--; } break; case 'f': if (len == 8 && !strcmpn(word, "function", 8)) { if (nest == 0) { curfile = files[RTNFILE]; } nest++; break; } if (len == 7 && !strcmpn(word, "forward", 7)) { nest--; } break; case 'l': if (len == 5 && !strcmpn(word, "label", 5)) { if (nest == 0) { prt = FALSE; if (!labelopen) { labelopen = TRUE; prt = TRUE; } curfile = files[LABELFILE]; } } break; case 'p': if (len == 9 && !strcmpn(word, "procedure", 9)) { if (nest == 0) { curfile = files[RTNFILE]; } nest++; break; } if (len == 7 && !strcmpn(word, "program", 7)) { if (nest != 0) { fprintf(stderr, "improper program nesting"); quit(NULL); } inprog = 1; curfile = files[PRGFILE]; } break; case 't': if (len == 4 && !strcmpn(word, "type", 4)) { if (nest == 0) { prt = FALSE; if (!typeopen) { typeopen = TRUE; prt = TRUE; } curfile = files[TYPEFILE]; } } break; case 'v': if (len == 3 && !strcmpn(word, "var", 3)) { if (nest == 0) { prt = FALSE; if (!varopen) { varopen = TRUE; prt = TRUE; } curfile = files[VARFILE]; } } break; } if (prt) fprintf(curfile, "%.*s", len, word); prt = TRUE; ch1 = ' '; } } /* * Print out the merged result */ printout() { FILE *fp; int i; char ch; for(i = 0; i < NUMFILES; i++) { fp = freopen(names[i], "r", files[i]); if (fp == NULL) quit(names[i]); ch = getc(fp); while (!feof(fp)) { putc(ch,stdout); ch = getc(fp); } } } /* * Die gracefully */ quit(fp) char *fp; { if (fp != NULL) perror(fp); onintr(); exit(1); } file = files[VARFILE]; } } break; } if (prt) fcmd/pascal/pstab.h 644 0 33 1226 2552606274 7334 /* static char sccsid[] = "@(#)pstab.h 1.2 9/9/80"; */ /* * subtypes within the above type * subtypes N_PSO and N_PSOL are .stabs name,,0,subtype,0 * others subtypes are .stabs name,,0,subtype,line */ #define N_PSO 0x1 /* source file name */ #define N_PSOL 0x2 /* include file name */ #define N_PGLABEL 0x3 /* global label */ #define N_PGCONST 0x4 /* global constant */ #define N_PGTYPE 0x5 /* global type */ #define N_PGVAR 0x6 /* global variable */ #define N_PGFUNC 0x7 /* global function */ #define N_PGPROC 0x8 /* global procedure */ #define N_PEFUNC 0x9 /* external function */ #define N_PEPROC 0xa /* external procedure */ ame,,0,subtype,0 * others subtypes are .stabs name,,0,subtype,line */ #define N_PSO 0x1 /* source file name */ #define N_PSOL 0x2 /* include file name */ #define N_PGLABEL 0x3 /* global label */ #define N_PGCONST 0x4 /* global constant */ #define N_PGTYPE 0x5 /* global type */ #define N_PGVAR 0x6 /* global variable */ #define N_PGFUNC 0x7 /* globcmd/pascal/px_header.c 644 0 33 3001 2552606275 10147 /* * pxheader - program to sit in front of interpreter code to make shell mods * unnecessary to make Pascal obj's look like real programs. * * This program lives in /usr/lib/px_header * Bill Joy UCB February 6, 1978 */ static char sccsid[] = "@(#)px_header.c 1.2 3/6/81"; #include #include #include #include "whoami.h" #include "objfmt.h" #define ETXTBSY 26 #define ADDR_LC HEADER_BYTES - sizeof (struct exec) - sizeof (struct pxhdr) extern errno; main(argc, argv) register int argc; register char *argv[]; { register int i, j; register unsigned short *ip; char *largv[512]; int pv[2]; if (argc > 510) { error("Too many arguments.\n"); exit(1); } largv[0] = argv[0]; largv[1] = "-"; for (i = 1; i < argc; i++) largv[i + 1] = argv[i]; largv[argc + 1] = 0; pipe(pv); i = fork(); if (i == -1) error("Try again.\n"); if (i == 0) { close(pv[0]); ip = (unsigned short *)(ADDR_LC); i = ((struct pxhdr *)(ip))->objsize + sizeof(struct pxhdr); while (i != 0) { j = (i > 0 && i < BUFSIZ) ? i : BUFSIZ; write(pv[1], ip, j); ip += BUFSIZ / sizeof ( unsigned short ); i -= j; } exit(1); } close(pv[1]); if (pv[0] != 3) { close(3); dup(pv[0]); close(pv[0]); } for (;;) { execv(PX_INTRP, largv); if (errno != ETXTBSY) break; sleep(2); } error("Px not found.\n"); } error(cp) register char *cp; { register int i; register char *dp; dp = cp; i = 0; while (*dp++) i++; write(2, cp, i); exit(1); } exit(i) { _exit(i); } (i != 0) { j = (i > 0 && i < BUFSIZ) ? i : BUFSIZ; write(pv[1], ip, j); ip += BUFSIZ / sizeof ( unsigned short ); i -= j; } exit(1); } close(pv[1]); if (pv[0] != 3) { close(3); dup(pv[0]); close(pv[0]); } for (;;) { execv(PX_INTRP, largv); if (errno != ETXTBSY) break; sleep(2); } error("Px not found.\n"); } error(cp) register char *cp; { register int i; register char *dp; dp = cp; i = 0; while (*dp++) i++; write(2, cp, i); exit(1); } exit(i) { _exit(i); }cmd/pascal/pxref.p 644 0 33 17422 2552606275 7405 {$t-,p-,b2,w+} program xref(input, output); label 99, 100; const { sccsid = '@(#)pxref.p 1.1 (Berkeley) 3/2/81'; } alfasize = 18; linesize = 10; namesize = 64; linelength = 133; maxlineno = 30000; charclassize = 127; p = 1000; nk = 36; blanks = ' '; type alfa = array[1..alfasize] of char; index = 0..p; linptr = 0..linelength; linebuf = array[1..linelength] of char; ref = ^item; filename = array [1..namesize] of char; charclasses = (digit, letter, separator, illegal); charclasstype = array[0..charclassize] of charclasses; word = record key: alfa; first, last: ref; fol: index end; item = packed record lno: 0..maxlineno; next: ref end; var i, top: index; formfeed :char; scr: alfa; list: boolean; k, k1: integer; n: integer; c1, c2: integer; inputfile : filename; lineptr :linptr; line :linebuf; charclass :charclasstype; id: record case boolean of false:( a: alfa ); true:( ord: integer ) end; a: array [1..alfasize] of char; t: array [index] of word; key: array [1..nk] of alfa; empty: alfa; function nokey(x: alfa): Boolean; var i, j, k: integer; begin i := 1; j := nk; repeat k := (i + j) div 2; if key[k] <= x then i := k + 1; if key[k] >= x then j := k - 1 until i > j; nokey := key[k] <> x end { nokey }; procedure search; var h, d: index; x: ref; f: Boolean; begin h := id.ord div 4096 mod p; f := false; d := 1; c2 := c2 + 1; new(x); x^.lno := n; x^.next := nil; repeat if t[h].key = id.a then begin f := true; t[h].last^.next := x; t[h].last := x end else if t[h].key = empty then begin f := true; c1 := c1 + 1; t[h].key := id.a; t[h].first := x; t[h].last := x; t[h].fol := top; top := h end else begin h := (h + d) mod p; d := d + 2; if d = p then begin writeln; writeln(' **** table ((full'); goto 99 end end until f end { search }; procedure printword(w: word); var l: integer; x: ref; begin write(' ', w.key); x := w.first; l := 0; repeat if l = linesize then begin l := 0; writeln; write(' ', empty) end; l := l + 1; write(x^.lno: 6); x := x^.next until x = nil; writeln end { printword }; procedure printtable; var i, j, m: index; begin i := top; while i <> p do begin m := i; j := t[i].fol; while j <> p do begin if t[j].key < t[m].key then m := j; j := t[j].fol end; printword(t[m]); if m <> i then begin t[m].key := t[i].key; t[m].first := t[i].first; t[m].last := t[i].last end; i := t[i].fol end end { printtable }; procedure readinput(var inpfile :filename); var inp :file of char; procedure lwriteln; var i :linptr; begin if list then begin { actually should use ... for i:=1 to lineptr do write(line[i]); } line[lineptr+1]:=chr(0); writeln(line); end; get(inp); line:=blanks; lineptr:=0 end { lwriteln }; procedure newline; begin n:=n+1; if n = maxlineno then begin writeln(' text too long'); goto 99 end; if inp^ = formfeed then begin if list then page(output); get(inp) end; if list then if not eoln(inp) then write(n:6,' ') end { newline }; begin reset(inp,inpfile); while not eof(inp) do begin newline; if inp^ = '#' then begin while inp^ <> '"' do begin lineptr:=lineptr+1; read(inp,line[lineptr]) end; lineptr:=lineptr+1; read(inp,line[lineptr]); k:=0; inputfile:=blanks; repeat k:=k+1; if k <= namesize then inputfile[k]:=inp^; lineptr:=lineptr+1; read(inp,line[lineptr]) until inp^ = '"'; while not eoln(inp) do begin lineptr:=lineptr+1; read(inp,line[lineptr]) end; id.a := '#include'; search; lwriteln; readinput(inputfile); end else begin while not eoln(inp) do begin if (inp^ = ' ') or (inp^ = tab) then begin lineptr:=lineptr+1; read(inp,line[lineptr]) end else if charclass[ord(inp^)] = letter then begin k := 0; a:=blanks; repeat k := k + 1; if k <= alfasize then a[k] := inp^; lineptr:=lineptr+1; read(inp,line[lineptr]) until (charclass[ord(inp^)] <> letter) and (charclass[ord(inp^)] <> digit); pack(a, 1, id.a); if nokey(id.a) then search end else if charclass[ord(inp^)] = digit then repeat lineptr:=lineptr+1; read(inp,line[lineptr]) until charclass[ord(inp^)] <> digit else if inp^='''' then begin repeat lineptr:=lineptr+1; read(inp,line[lineptr]) until inp^ = ''''; lineptr:=lineptr+1; read(inp,line[lineptr]) end else if inp^ = '{' then begin repeat lineptr:=lineptr+1; read(inp,line[lineptr]); while eoln(inp) do begin lwriteln; newline end until inp^ = '}'; lineptr:=lineptr+1; read(inp,line[lineptr]) end else if inp^ = '(' then begin lineptr:=lineptr+1; read(inp,line[lineptr]); if inp^ = '*' then begin lineptr:=lineptr+1; read(inp,line[lineptr]); repeat while inp^ <> '*' do if eoln(inp) then begin lwriteln; newline end else begin lineptr:=lineptr+1; read(inp,line[lineptr]) end; lineptr:=lineptr+1; read(inp,line[lineptr]) until inp^ = ')'; lineptr:=lineptr+1; read(inp,line[lineptr]) end end else begin lineptr:=lineptr+1; read(inp,line[lineptr]); end end; { scan of token } lwriteln; end; { scan of line } end; { while not eof } end; {readinput } begin { xref } empty := blanks; list := true; if argc = 3 then begin argv(1, scr); if (scr[1] <> '-') or (scr[2] <> ' ') then begin writeln('usage: pxref [ - ] file'); goto 100 end; list := false end; if (argc < 2) or (argc > 3) then begin writeln('usage: pxref [ - ] file'); goto 100 end; for i := 0 to p - 1 do t[i].key := empty; c1 := 0; c2 := 0; key[1] := 'and'; key[2] := 'array'; key[3] := 'assert'; key[4] := 'begin'; key[5] := 'case'; key[6] := 'const'; key[7] := 'div'; key[8] := 'do'; key[9] := 'downto'; key[10] := 'else'; key[11] := 'end'; key[12] := 'file'; key[13] := 'for'; key[14] := 'function'; key[15] := 'hex'; key[16] := 'if'; key[17] := 'in'; key[18] := 'mod'; key[19] := 'nil'; key[20] := 'not'; key[21] := 'oct'; key[22] := 'of'; key[23] := 'or'; key[24] := 'packed'; key[25] := 'procedure'; key[26] := 'program'; key[27] := 'record'; key[28] := 'repeat'; key[29] := 'set'; key[30] := 'then'; key[31] := 'to'; key[32] := 'type'; key[33] := 'until'; key[34] := 'var'; key[35] := 'while'; key[36] := 'with'; for k:= 0 to charclassize do charclass[k]:=illegal; for k:=ord('a') to ord('z') do charclass[k]:=letter; for k:=ord('A') to ord('Z') do charclass[k]:=letter; for k:=ord('0') to ord('9') do charclass[k]:=digit; charclass[ord('_')]:=letter; charclass[ord(' ')]:=separator; charclass[ord(tab)]:=separator; n := 0; lineptr:=0; line:=blanks; top := p; k1 := alfasize; formfeed:=chr(12); if list then argv(1,inputfile) else argv(2,inputfile); readinput(inputfile); 99: if list then begin page(output); writeln; end; printtable; writeln; writeln(c1, ' identifiers', c2, ' occurrences'); 100: {nil} end { xref }. lass[k]:=digit; charclass[ord('_')]:=letter; charclass[ord(' ')]:=separator; charclass[ord(tab)]:=separator; n := 0; lineptr:=0; line:=blanks; top := p; k1 := alfasize; formfeed:=chr(12); if list thcmd/pascal/whoami.h 644 0 33 1041 2552606275 7503 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)piwhoami.h 1.2 3/6/81"; */ /* * am i generating an obj file (OBJ), * postfix binary input to the 2nd pass of the portable c compiler (PC), * or pTrees (PTREE)? */ #define OBJ #undef PC #undef PTREE /* * am i the vax or the pdp11 version */ #define VAX #undef PDP11 #define DEC11 /* * am i pi or pxp? */ #define PI #undef PXP /* * am i both passes, or am i only one of the two passes pi0 or pi1? */ #define PI01 #undef PI0 #undef PI1 the University of California */ /* static char sccsid[] = "@(#)piwhoami.h 1.2 3/6/81"; */ /* * am i generating an obj file (OBJ), * postfix binary input to the 2nd pass of the portable c compiler (PC), * or pTrees (PTREE)? */ #define OBJ #undef PC #undef PTREE /* * am i the vax or the pdp11 version */ #define VAX #undef PDP11 #define DEC11 /* * am i pi or pxp? */ #define PI #undef PXP /* * am i both passes, or am i only one of the two passes pi0 or pi1? */ #decmd/wall.c 444 0 33 5150 2552440165 5703 static char *sccsid = "@(#)wall.c 4.5 (Berkeley) 81/06/12"; /* * 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 #define USERS 128 #define IGNOREUSER "sleeper" char mesg[3000]; int msize,sline; struct utmp utmp[USERS]; char *strcpy(); char *strcat(); char who[9] = "???"; long clock, time(); struct tm *localtime(); struct tm *localclock; main(argc, argv) char *argv[]; { register i; register char c; register struct utmp *p; FILE *f; FILE *mf; if((f = fopen("/etc/utmp", "r")) == NULL) { fprintf(stderr, "Cannot open /etc/utmp\n"); exit(1); } clock = time( 0 ); localclock = localtime( &clock ); mf = stdin; if(argc >= 2) { /* take message from unix file instead of standard input */ if((mf = fopen(argv[1], "r")) == NULL) { fprintf(stderr,"Cannot open %s\n", argv[1]); exit(1); } } while((i = getc(mf)) != EOF) { if (msize >= sizeof mesg) { fprintf(stderr, "Message too long\n"); exit(1); } mesg[msize++] = i; } fclose(mf); sline = ttyslot(2); /* 'utmp' slot no. of sender */ fread((char *)utmp, sizeof(struct utmp), USERS, f); fclose(f); if (sline) strncpy(who, utmp[sline].ut_name, sizeof(utmp[sline].ut_name)); for(i=0; iut_name[0] == 0) || (strncmp (p->ut_name, IGNOREUSER, sizeof(p->ut_name)) == 0)) continue; /*** this might be nice, but utmp gets so out of date !! sleep(1); ***/ sendmes(p->ut_line); } exit(0); } sendmes(tty) char *tty; { register i; char t[50], buf[BUFSIZ]; register char *cp; register int c, ch; FILE *f; /*** you can't do this with lots of users & MAXUPROC i = fork(); if(i == -1) { fprintf(stderr, "Try again\n"); return; } ***/ while ((i = fork()) == -1) if (wait((int *)0) == -1) { fprintf(stderr, "Try again\n"); return; } if(i) re((turn; strcpy(t, "/dev/"); strcat(t, tty); signal(SIGALRM, SIG_DFL); /* blow away if open hangs */ alarm(10); if((f = fopen(t, "w")) == NULL) { fprintf(stderr,"cannot open %s\n", t); exit(1); } setbuf(f, buf); fprintf(f, "\nBroadcast Message from %s!%s (%.*s) at %d:%02d ...\r\n\n" , sysname , who , sizeof(utmp[sline].ut_line) , utmp[sline].ut_line , localclock -> tm_hour , localclock -> tm_min ); /* fwrite(mesg, msize, 1, f); */ for (cp = mesg, c = msize; c-- > 0; cp++) { ch = *cp; if (ch == '\n') putc('\r', f); putc(ch, f); } /* * Bitchin'. */ exit(0); } larm(10); if((f = fopen(t, "w")) == NULL) { fprintf(stderr,"cannot open %s\n", t); exit(1); } setbuf(f, buf); fprintf(f, "\nBroadcast Message from %s!%s (%.*s) at %d:%02d ...\r\n\n" , sysname , who , sizeof(utmp[sline].ut_line) , utmp[sline].ut_line , localclock -> tm_hour , localclock -> tm_min ); /* fwrite(mesg, msize, 1, f); */ for (cp = mesg, c = msize; c-- > 0; cp++) {cmd/dmesg.c 444 0 33 4205 2477653366 6062 static char *sccsid = "@(#)dmesg.c 4.3 (Berkeley) 2/28/81"; /* * Suck up system messages * dmesg * print current buffer * dmesg - * print and update incremental history */ #include #include #include #include #include #include struct msgbuf msgbuf; char *msgbufp; int sflg; int of = -1; struct msgbuf omesg; struct nlist nl[2] = { { "_msgbuf" }, { 0 } }; main(argc, argv) char **argv; { int mem; register char *mp, *omp, *mstart; int timeout(); int samef; signal(SIGALRM, timeout); alarm(30); if (argc>1 && argv[1][0] == '-') { sflg++; argc--; argv++; } if (sflg) { of = open("/usr/adm/msgbuf", 2); read(of, (char *)&omesg, sizeof(omesg)); lseek(of, 0L, 0); } sflg = 0; nlist(argc>2? argv[2]:"/vmunix", nl); if (nl[0].n_type==0) done("No namelist\n"); if ((mem = open((argc>1? argv[1]: "/dev/kmem"), 0)) < 0) done("No mem\n"); lseek(mem, (long)nl[0].n_value, 0); read(mem, &msgbuf, sizeof (msgbuf)); if (msgbuf.msg_magic != MSG_MAGIC) done("Magic number wrong (namelist mismatch?)\n"); mstart = &msgbuf.msg_bufc[omesg.msg_bufx]; omp = &omesg.msg_bufc[msgbuf.msg_bufx]; mp = msgbufp = &msgbuf.msg_bufc[msgbuf.msg_bufx]; samef = 1; do { if (*mp++ != *omp++) { mstart = msgbufp; samef = 0; pdate(); printf("...\n"); break; } if (mp == &msgbuf.msg_bufc[MSG_BSIZE]) mp = msgbuf.msg_bufc; if (omp == &omesg.msg_bufc[MSG_BSIZE]) omp = omesg.msg_bufc; } while (mp != mstart); if (samef && omesg.msg_bufx == msgbuf.msg_bufx) exit(0); mp = mstart; do { pdate(); if (*mp && (*mp & 0200) == 0) putchar(*mp); mp++; if (mp == &msgbuf.msg_bufc[MSG_BSIZE]) mp = msgbuf.msg_bufc; } while (mp != msgbufp); done((char *)NULL); } done(s) char *s; { register char *p, *q; if (s && s!=(char *)omesg.msg_magic && sflg==0) { pdate(); printf(s); } write(of, (char *)&msgbuf, sizeof(msgbuf)); exit(s!=NULL); } pdate() { extern char *ctime(); static firstime; time_t tbuf; if (firstime==0) { firstime++; time(&tbuf); printf("\n%.12s\n", ctime(&tbuf)+4); } } timeout() { done("Buffer file screwed up\n"); } ; if (mp == &msgbuf.msg_bufc[MSG_BSIZE]) mp = msgbuf.msg_bufc; } while (mp != msgbufp); done((char *)NULL); } done(s) char *s; { register char *p, *q; if (s && s!=(char *)omesg.msg_magic && sflg==0) { pdate(); printf(s); } write(of, (char *)&msgbuf, sizeof(msgbuf)); exit(s!=NULL); } pdate() { extern char *ctime(); static firstime; time_t tbuf; if (firstcmd/du.c 444 0 33 6306 2416237734 5365 static char *sccsid = "@(#)du.c 4.1 (Berkeley) 10/1/80"; #include #include #include #include #define EQ(x,y) (strcmp(x,y)==0) #define ML 1000 struct stat Statb; char path[256], name[256]; int Aflag = 0, Sflag = 0, Noarg = 0; struct { int dev, ino; } ml[ML]; long descend(); char *rindex(); char *strcpy(); main(argc, argv) char **argv; { register i = 1; long blocks = 0; register char *np; if (argc>1) { if(EQ(argv[i], "-s")) { ++i; ++Sflag; } else if(EQ(argv[i], "-a")) { ++i; ++Aflag; } } if(i == argc) ++Noarg; do { strcpy(path, Noarg? ".": argv[i]); strcpy(name, path); if(np = rindex(name, '/')) { *np++ = '\0'; if(chdir(*name? name: "/") == -1) { fprintf(stderr, "cannot chdir()\n"); exit(1); } } else np = path; blocks = descend(path, *np? np: "."); if(Sflag) printf("%ld %s\n", blocks, path); } while(++i < argc); exit(0); } long descend(np, fname) char *np, *fname; { int dir = 0, /* open directory */ offset, dsize, entries, dirsize; struct direct dentry[BUFSIZ / sizeof (struct direct)]; register struct direct *dp; register char *c1, *c2; int i; char *endofname; long blocks = 0; if(stat(fname,&Statb)<0) { fprintf(stderr, "--bad status < %s >\n", name); return 0L; } if(Statb.st_nlink > 1 && (Statb.st_mode&S_IFMT)!=S_IFDIR) { static linked = 0; for(i = 0; i <= linked; ++i) { if(ml[i].ino==Statb.st_ino && ml[i].dev==Statb.st_dev) return 0; } if (linked < ML) { ml[linked].dev = Statb.st_dev; ml[linked].ino = Statb.st_ino; ++linked; } } /* blocks = (Statb.st_size + BSIZE-1) >> BSHIFT; */ blocks = (Statb.st_size + 511) >> 9; if((Statb.st_mode&S_IFMT)!=S_IFDIR) { if(Aflag) printf("%ld %s\n", blocks, np); return(blocks); } for(c1 = np; *c1; ++c1); if(*(c1-1) == '/') --c1; endofname = c1; dirsize = Statb.st_size; if(chdir(fname) == -1) return 0; for(offset=0; offset < dirsize; offset += BUFSIZ) { /* each block */ dsize = BUFSIZ<(dirsize-offset)? BUFSIZ: (dirsize-offset); if(!dir) { if((dir=open(".",0))<0) { fprintf(stderr, "--cannot open < %s >\n", np); goto ret; } if(offset) lseek(dir, (long)offset, 0); if(read(dir, (char *)dentry, dsize)<0) { fprintf(stderr, "--cannot read < %s >\n", np); goto ret; } if(dir > 10) { close(dir); dir = 0; } } else if(read(dir, (char *)dentry, dsize)<0) { fprintf(stderr, "--cannot read < %s >\n", np); goto ret; } for(dp=dentry, entries=dsize>>4; entries; --entries, ++dp) { /* each directory entry */ if(dp->d_ino==0 || EQ(dp->d_name, ".") || EQ(dp->d_name, "..")) continue; c1 = endofname; *c1++ = '/'; c2 = dp->d_name; for(i=0; i\n", np); while(*--endofname != '/'); *endofname = '\0'; if(chdir(np) == -1) exit(1); } return(blocks); } ++ = '/'; c2 = dp->d_name; for(i=0; i #include #endif #include #include #include #include #include #include #define OBSIZE 512 /* from old */ #define OINOPB 8 /* 8 inodes per block */ /* old */ #define NTREC 20 #define MLEN 16 #define MSIZ 4096 #define TS_TAPE 1 #define TS_INODE 2 #define TS_BITS 3 #define TS_ADDR 4 #define TS_END 5 #define TS_CLRI 6 #define MAGIC (int)60011 #define CHECKSUM (int)84446 struct spcl { int c_type; time_t c_date; time_t c_ddate; int c_volume; daddr_t c_tapea; ino_t c_inumber; int c_magic; int c_checksum; struct dinode c_dinode; int c_count; char c_addr[OBSIZE]; } spcl; struct idates { char id_name[16]; char id_incno; time_t id_ddate; }; /* end of old */ #define MWORD(m,i) (m[(unsigned)(i-1)/MLEN]) #define MBIT(i) (1<<((unsigned)(i-1)%MLEN)) #define BIS(i,w) (MWORD(w,i) |= MBIT(i)) #define BIC(i,w) (MWORD(w,i) &= ~MBIT(i)) #define BIT(i,w) (MWORD(w,i) & MBIT(i)) struct filsys sblock; int fi; ino_t ino, maxi, curino; int mt; char tapename[] = "/dev/rmt8"; char *magtape = tapename; #ifdef STANDALONE char mbuf[50]; #endif #ifndef STANDALONE daddr_t seekpt; int df, ofile; char dirfile[] = "rstXXXXXX"; struct { ino_t t_ino; daddr_t t_seekpt; } inotab[MAXINO]; int ipos; #define ((ONTAPE 1 #define XTRACTD 2 #define XINUSE 4 struct xtrlist { ino_t x_ino; char x_flags; } xtrlist[MAXXTR]; char name[12]; char drblock[BSIZE]; int bpt; #endif int eflag; int volno = 1; struct dinode tino, dino; daddr_t taddr[NADDR]; daddr_t curbno; short dumpmap[MSIZ]; short clrimap[MSIZ]; int bct = NTREC+1; char tbf[NTREC*OBSIZE]; struct cache { daddr_t c_bno; int c_time; char c_block[BSIZE]; } cache[NCACHE]; int curcache; main(argc, argv) char *argv[]; { register char *cp; char command; int done(); #ifndef STANDALONE mktemp(dirfile); if (argc < 2) { usage: printf("Usage: oldrestor x file file..., oldrestor r filesys, or oldrestor t\n"); exit(1); } argv++; argc -= 2; for (cp = *argv++; *cp; cp++) { switch (*cp) { case '-': break; case 'f': magtape = *argv++; argc--; break; case 'r': case 'R': case 't': case 'x': command = *cp; break; default: printf("Bad key character %c\n", *cp); goto usage; } } if (command == 'x') { if (signal(SIGINT, done) == SIG_IGN) signal(SIGINT, SIG_IGN); if (signal(SIGTERM, done) == SIG_IGN) signal(SIGTERM, SIG_IGN); df = creat(dirfile, 0666); if (df < 0) { printf("restor: %s - cannot create directory temporary\n", dirfile); exit(1); } close(df); df = open(dirfile, 2); } doit(command, argc, argv); if (command == 'x') unlink(dirfile); exit(0); #else magtape = "tape"; doit('r', 1, 0); #endif } doit(command, argc, argv) char command; int argc; char *argv[]; { extern char *ctime(); register i, k; ino_t d; #ifndef STANDALONE int xtrfile(), skip(); #endif int rstrfile(), rstrskip(); struct dinode *ip, *ip1; #ifndef STANDALONE if ((mt = open(magtape, 0)) < 0) { printf("%s: cannot open tape\n", magtape); exit(1); } #else do { printf("Tape? "); gets(mbuf); mt = open(mbuf, 0); } while (mt == -1); magtape = mbuf; #endif switch(command) { #ifndef STANDALONE case 't': if (readhdr(&spcl) == 0) { printf("Tape is not a dump tape\n"); exit(1); } printf("Dump date: %s", ctime(&spcl.c_date)); printf("Dumped from: %s", ctime(&spcl.c_ddate)); return; case 'x': if (readhdr(&spcl) == 0) { printf("Tape is not a dump tape\n"); exit(1); } if (checkvol(&spcl, 1) == 0) { printf("Tape is not volume 1 of the dump\n"); exit(1); } pass1(); /* This sets the various maps on the way by */ i = 0; while (i < MAXXTR-1 && argc--) { if ((d = psearch(*argv)) == 0 || BIT(d, dumpmap) == 0) { printf("%s: not on the tape\n", *argv++); continue; } xtrlist[i].x_ino = d; xtrlist[i].x_flags |= XINUSE; printf("%s: inode %u\n", *argv, d); argv++; i++; } newvol: flsht(); close(mt); getvol: printf("Mount desired tape volume: Specify volume #: "); if (gets(tbf) == NULL) return; volno = atoi(tbf); if (volno <= 0) { printf("Volume numbers are positive numerics\n"); goto getvol; } mt = open(magtape, 0); if (readhdr(&spcl) == 0) { printf("tape is not dump tape\n"); goto newvol; } if (checkvol(&spcl, volno) == 0) { printf("Wrong volume (%d)\n", spcl.c_volume); goto newvol; } rbits: while (gethead(&spcl) == 0) ; if (checktype(&spcl, TS_INODE) == 1) { printf("Can't find inode mask!\n"); goto newvol; } if (checktype(&spcl, TS_BITS) == 0) goto rbits; readbits(dumpmap); i = 0; for (k = 0; xtrlist[k].x_flags; k++) { if (BIT(xtrlist[k].x_ino, dumpmap)) { xtrlist[k].x_flags |= ONTAPE; i++; } } while (i > 0) { again: if (ishead(&spcl) == 0) while(gethead(&spcl) == 0) ; if (checktype(&spcl, TS_END) == 1) { printf("end of tape\n"); checkdone: for (k = 0; xtrlist[k].x_flags; k++) if ((xtrlist[k].x_flags&XTRACTD) == 0) goto newvol; return; } if (checktype(&spcl, TS_INODE) == 0) { gethead(&spcl); goto again; } d = spcl.c_inumber; for (k = 0; xtrlist[k].x_flags; k++) { if (d == xtrlist[k].x_ino) { printf("extract file %u\n", xtrlist[k].x_ino); sprintf(name, "%u", xtrlist[k].x_ino); if ((ofile = creat(name, 0666)) < 0) { printf("%s: cannot create file\n", name); i--; continue; } chown(name, spcl.c_dinode.di_uid, spcl.c_dinode.di_gid); getfile(ino, xtrfile, skip, spcl.c_dinode.di_size); i--; xtrlist[k].x_flags |= XTRACTD; close(ofile); goto done; } } gethead(&spcl); done: ; } goto checkdone; #endif case 'r': case 'R': #ifndef STANDALONE if ((fi = open(*argv, 2)) < 0) { printf("%s: cannot open\n", *argv); exit(1); } #else do { char charbuf[50]; printf("Disk? "); gets(charbuf); fi = open(charbuf, 2); } while (fi == -1); #endif #ifndef STANDALONE if (command == 'R') { printf("Enter starting volume number: "); if (gets(tbf) == EOF) { volno = 1; printf("\n"); } else volno = atoi(tbf); } else #endif volno = 1; printf("Last chance before scribbling on %s. ", #ifdef STANDALONE "disk"); #else *argv); #endif while (getchar() != '\n'); dread((daddr_t)1, (char *)&sblock, sizeof(sblock)); maxi = (sblock.s_isize-2)*INOPB; if (readhdr(&spcl) == 0) { printf("Missing volume record\n"); exit(1); } if (checkvol(&spcl, volno) == 0) { printf("Tape is not volume %d\n", volno); exit(1); } gethead(&spcl); for (;;) { ragain: if (ishead(&spcl) == 0) { printf("Missing header block\n"); while (gethead(&spcl) == 0) ; eflag++; } if (checktype(&spcl, TS_END) == 1) { printf("End of tape\n"); close(mt); dwrite( (daddr_t) 1, (char *) &sblock); return; } if (checktype(&spcl, TS_CLRI) == 1) { readbits(clrimap); for (ino = 1; ino <= maxi; ino++) if (BIT(ino, clrimap) == 0) { getdino(ino, &tino); if (tino.di_mode == 0) continue; itrunc(&tino); clri(&tino); putdino(ino, &tino); } dwrite( (daddr_t) 1, (char *) &sblock); goto ragain; } if (checktype(&spcl, TS_BITS) == 1) { readbits(dumpmap); goto ragain; } if (checktype(&spcl, TS_INODE) == 0) { printf("Unknown header type\n"); eflag++; gethead(&spcl); goto ragain; } ino = spcl.c_inumber; if (eflag) printf("Resynced at inode %u\n", ino); eflag = 0; if (ino > maxi) { printf("%u: ilist too small\n", ino); gethead(&spcl); goto ragain; } dino = spcl.c_dinode; getdino(ino, &tino); curbno = 0; itrunc(&tino); clri(&tino); for (i = 0; i < NADDR; i++) taddr[i] = 0; l3tol(taddr, dino.di_addr, 1); getfile(d, rstrfile, rstrskip, dino.di_size); ip = &tino; ltol3(ip->di_addr, taddr, NADDR); ip1 = &dino; ip->di_mode = ip1->di_mode; ip->di_nlink = ip1->di_nlink; ip->di_uid = ip1->di_uid; ip->di_gid = ip1->di_gid; ip->di_size = ip1->di_size; ip->di_atime = ip1->di_atime; ip->di_mtime = ip1->di_mtime; ip->di_ctime = ip1->di_ctime; putdino(ino, &tino); } } } /* * Read the tape, bulding up a directory structure for extraction * by name */ #ifndef STANDALONE pass1() { register i; struct dinode *ip; int putdir(), null(); while (gethead(&spcl) == 0) { printf("Can't find directory header!\n"); } for (;;) { if (checktype(&spcl, TS_BITS) == 1) { readbits(dumpmap); continue; } if (checktype(&spcl, TS_CLRI) == 1) { readbits(clrimap); continue; } if (checktype(&spcl, TS_INODE) == 0) { finish: flsh(); close(mt); return; } ip = &spcl.c_dinode; i = ip->di_mode & IFMT; if (i != IFDIR) { goto finish; } inotab[ipos].t_ino = spcl.c_inumber; inotab[ipos++].t_seekpt = seekpt; getfile(spcl.c_inumber, putdir, null, spcl.c_dinode.di_size); putent("\000\000/"); } } #endif /* * Do the file extraction, calling the supplied functions * with the blocks */ getfile(n, f1, f2, size) ino_t n; int (*f2)(), (*f1)(); long size; { register i; struct spcl addrblock; char buf[BSIZE]; addrblock = spcl; curino = n; goto start; for (;;) { if (gethead(&addrblock) == 0) { printf("Missing address (header) block\n"); goto eloop; } if (checktype(&addrblock, TS_ADDR) == 0) { spcl = addrblock; curino = 0; curino = 0; return; } start: for (i = 0; i < addrblock.c_count; i += 2) { if (addrblock.c_addr[i]) readtape(buf, 0); else clearbuf(buf, 0); if (size > OBSIZE && addrblock.c_addr[i+1]) readtape(buf, 1); else clearbuf(buf, 1); if (addrblock.c_addr[i] || size > OBSIZE && addrblock.c_addr[i + 1]) (*f1)(buf, size > BSIZE ? (long) BSIZE : size); else (*f2)(buf, size > BSIZE ? (long) BSIZE : size); if ((size -= BSIZE) <= 0) { eloop: while (gethead(&spcl) == 0) ; if (checktype(&spcl, TS_ADDR) == 1) goto eloop; curino = 0; return; } } } } /* * Do the tape i\/o, dealling with volume changes * etc.. */ readtape(b, part) char *b; { register i; struct spcl tmpbuf; if (bct >= NTREC) { for (i = 0; i < NTREC; i++) ((struct spcl *)&tbf[i*OBSIZE])->c_magic = 0; bct = 0; if ((i = read(mt, tbf, NTREC*OBSIZE)) < 0) { printf("Tape read error: inode %u\n", curino); eflag++; exit(1); } if (i == 0) { bct = NTREC + 1; volno++; loop: flsht(); close(mt); printf("Mount volume %d\n", volno); while (getchar() != '\n') ; if ((mt = open(magtape, 0)) == -1) { printf("Cannot open tape!\n"); goto loop; } if (readhdr(&tmpbuf) == 0) { printf("Not a dump tape.Try again\n"); goto loop; } if (checkvol(&tmpbuf, volno) == 0) { printf("Wrong tape. Try again\n"); goto loop; } readtape(b, part); return; } } copy(&tbf[(bct++*OBSIZE)], b + part * OBSIZE, OBSIZE); } flsht() { bct = NTREC+1; } copy(f, t, s) register char *f, *t; { register i; i = s; do *t++ = *f++; while (--i); } clearbuf(cp, part) register char *cp; { register i; cp += part * OBSIZE; i = OBSIZE; do *cp++ = 0; while (--i); } /* * Put and get the directory entries from the compressed * directory file */ #ifndef STANDALONE putent(cp) char *cp; { register i; for (i = 0; i < sizeof(ino_t); i++) writec(*cp++); for (i = 0; i < DIRSIZ((; i++) { writec(*cp); if (*cp++ == 0) return; } return; } getent(bf) register char *bf; { register i; for (i = 0; i < sizeof(ino_t); i++) *bf++ = readc(); for (i = 0; i < DIRSIZ; i++) if ((*bf++ = readc()) == 0) return; return; } /* * read/write te directory file */ writec(c) char c; { drblock[bpt++] = c; seekpt++; if (bpt >= BSIZE) { bpt = 0; write(df, drblock, BSIZE); } } readc() { if (bpt >= BSIZE) { read(df, drblock, BSIZE); bpt = 0; } return(drblock[bpt++]); } mseek(pt) daddr_t pt; { bpt = BSIZE; lseek(df, pt, 0); } flsh() { write(df, drblock, bpt+1); } /* * search the directory inode ino * looking for entry cp */ ino_t search(inum, cp) ino_t inum; char *cp; { register i; struct direct dir; for (i = 0; i < MAXINO; i++) if (inotab[i].t_ino == inum) { goto found; } return(0); found: mseek(inotab[i].t_seekpt); do { getent((char *)&dir); if (direq(dir.d_name, "/")) return(0); } while (direq(dir.d_name, cp) == 0); return(dir.d_ino); } /* * Search the directory tree rooted at inode 2 * for the path pointed at by n */ psearch(n) char *n; { register char *cp, *cp1; char c; ino = 2; if (*(cp = n) == '/') cp++; next: cp1 = cp + 1; while (*cp1 != '/' && *cp1) cp1++; c = *cp1; *cp1 = 0; ino = search(ino, cp); if (ino == 0) { *cp1 = c; return(0); } *cp1 = c; if (c == '/') { cp = cp1+1; goto next; } return(ino); } direq(s1, s2) register char *s1, *s2; { register i; for (i = 0; i < DIRSIZ; i++) if (*s1++ == *s2) { if (*s2++ == 0) return(1); } else return(0); return(1); } #endif /* * read/write a disk block, be sure to update the buffer * cache if needed. */ dwrite(bno, b) daddr_t bno; char *b; { register i; for (i = 0; i < NCACHE; i++) { if (cache[i].c_bno == bno) { copy(b, cache[i].c_block, BSIZE); cache[i].c_time = 0; break; } else cache[i].c_time++; } lseek(fi, bno*BSIZE, 0); if(write(fi, b, BSIZE) != BSIZE) { #ifdef STANDALONE printf("disk write error %D\n", bno); #else fprintf(stderr, "disk write error %ld\n", bno); #endif exit(1); } } dread(bno, buf, cnt) daddr_t bno; char *buf; { register i, j; j = 0; for (i = 0; i < NCACHE; i++) { if (++curcache >= NCACHE) curcache = 0; if (cache[curcache].c_bno == bno) { copy(cache[curcache].c_block, buf, cnt); cache[curcache].c_time = 0; return; } else { cache[curcache].c_time++; if (cache[j].c_time < cache[curcache].c_time) j = curcache; } } lseek(fi, bno*BSIZE, 0); if (read(fi, cache[j].c_block, BSIZE) != BSIZE) { #ifdef STANDALONE printf("read error %D\n", bno); #else printf("read error %ld\n", bno); #endif exit(1); } copy(cache[j].c_block, buf, cnt); cache[j].c_time = 0; cache[j].c_bno = bno; } /* * the inode manpulation routines. Like the system. * * clri zeros the inode */ clri(ip) struct dinode *ip; { int i, *p; i = sizeof(struct dinode)/sizeof(int); p = (int *)ip; do *p++ = 0; while(--i); } /* * itrunc/tloop/bfree free all of the blocks pointed at by the inode */ itrunc(ip) register struct dinode *ip; { register i; daddr_t bn, iaddr[NADDR]; if (ip->di_mode == 0) return; i = ip->di_mode & IFMT; if (i != IFDIR && i != IFREG) return; l3tol(iaddr, ip->di_addr, NADDR); for(i=NADDR-1;i>=0;i--) { bn = iaddr[i]; if(bn == 0) continue; switch(i) { default: bfree(bn); break; case NADDR-3: tloop(bn, 0, 0); break; case NADDR-2: tloop(bn, 1, 0); break; case NADDR-1: tloop(bn, 1, 1); } } ip->di_size = 0; } tloop(bn, f1, f2) daddr_t bn; int f1, f2; { register i; daddr_t nb; union { char data[BSIZE]; daddr_t indir[NINDIR]; } ibuf; dread(bn, ibuf.data, BSIZE); for(i=NINDIR-1;i>=0;i--) { nb = ibuf.indir[i]; if(nb) { if(f1) tloop(nb, f2, 0); else bfree(nb); } } bfree(bn); } bfree(bn) daddr_t bn; { register i; union { char data[BSIZE]; struct fblk frees; } fbuf; if(sblock.s_nfree >= NICFREE) { fbuf.df_nfree = sblock.s_nfree; for(i=0;i0; j--) { sh += NSHIFT; nb <<= NSHIFT; if(bn < nb) break; bn -= nb; } if(j == 0) { return((daddr_t)0); } /* * fetch the address from the inode */ if((nb = iaddr[NADDR-j]) == 0) { iaddr[NADDR-j] = nb = balloc(); } /* * fetch through the indirect blocks */ for(; j<=3; j++) { dread(nb, (char *)indir, BSIZE); sh -= NSHIFT; i = (bn>>sh) & NMASK; nnb = indir[i]; if(nnb == 0) { nnb = balloc(); indir[i] = nnb; dwrite(nb, (char *)indir); } nb = nnb; } return(nb); } /* * read the tape into buf, then return whether or * or not it is a header block. */ gethead(buf) struct spcl *buf; { readtape((char *)buf, 0); if (buf->c_magic != MAGIC || checksum((int *) buf) == 0) return(0); return(1); } /* * return whether or not the buffer contains a header block */ ishead(buf) struct spcl *buf; { if (buf->c_magic != MAGIC || checksum((int *) buf) == 0) return(0); return(1); } checktype(b, t) struct spcl *b; int t; { return(b->c_type == t); } checksum(b) int *b; { register i, j; j = OBSIZE/sizeof(int); i = 0; do i += *b++; while (--j); if (i != CHECKSUM) { printf("Checksum error %o\n", i); return(0); } return(1); } checkvol(b, t) struct spcl *b; int t; { if (b->c_volume == t) return(1); return(0); } readhdr(b) struct spcl *b; { if (gethead(b) == 0) return(0); if (checktype(b, TS_TAPE) == 0) return(0); return(1); } /* * The next routines are called during file extraction to * put the data into the right form and place. */ #ifndef STANDALONE xtrfile(b, size) char *b; long size; { write(ofile, b, (int) size); } null() {;} skip() { lseek(ofile, (long) OBSIZE, 1); } #endif rstrfile(b, s) char *b; long s; { daddr_t d; d = bmap(taddr, curbno); dwrite(d, b); curbno += 1; } rstrskip(b, s) char *b; long s; { curbno += 1; } #ifndef STANDALONE putdir(b) char *b; { register struct direct *dp; register i; for (dp = (struct direct *) b, i = 0; i < BSIZE; dp++, i += sizeof(*dp)) { if (dp->d_ino == 0) continue; putent((char *) dp); } } #endif /* * read/write an inode from the disk */ getdino(inum, b) ino_t inum; struct dinode *b; { daddr_t bno; char buf[BSIZE]; bno = (ino - 1)/INOPB; bno += 2; dread(bno, buf, BSIZE); copy(&buf[((inum-1)%INOPB)*sizeof(struct dinode)], (char *) b, sizeof(struct dinode)); } putdino(inum, b) ino_t inum; struct dinode *b; { daddr_t bno; char buf[BSIZE]; bno = ((ino - 1)/INOPB) + 2; dread(bno, buf, BSIZE); copy((char *) b, &buf[((inum-1)%INOPB)*sizeof(struct dinode)], sizeof(struct dinode)); dwrite(bno, buf); } /* * read a bit mask from the tape into m. */ readbits(m) short *m; { register i; i = spcl.c_count; while (i--) { readtape((char *) m, 0); m += (OBSIZE/(MLEN/BITS)); } while (gethead(&spcl) == 0) ; } done() { unlink(dirfile); exit(0); } ode)); } putdino(inum, b) ino_t inum; struct dinode *b; { daddr_t bno; char buf[BSIZE]; bno = ((ino - 1)/INOPB) + 2; dread(bno, buf, BSIZE); copy((char *) b, &buf[((inum-1)%INOPB)*sizeof(struct dinode)], sizeof(struct dinode)); dwrite(bno, buf); } /* * read a bit mask from the tape into m. */ readbits(m) short *m; { register i; i = spcl.c_count; while (i--) { readtape((char *) m, 0); m += (OBSIZE/(MLEN/BITS)); } while (gethead(&spcl) == 0) ; } done() { unlincmd/echo.c 444 0 33 575 2416237740 5652 static char *sccsid = "@(#)echo.c 4.1 (Berkeley) 10/1/80"; #include main(argc, argv) int argc; char *argv[]; { register int i, nflg; nflg = 0; if(argc > 1 && argv[1][0] == '-' && argv[1][1] == 'n') { nflg++; argc--; argv++; } for(i=1; i #define MAXLIN 350 #define MAXPOS 4000 #define NCHARS 128 #define NSTATES 128 #define FINAL -1 char gotofn[NSTATES][NCHARS]; int state[NSTATES]; char out[NSTATES]; int line = 1; int name[MAXLIN]; int left[MAXLIN]; int right[MAXLIN]; int parent[MAXLIN]; int foll[MAXLIN]; int positions[MAXPOS]; char chars[MAXLIN]; int nxtpos; int nxtchar = 0; int tmpstat[MAXLIN]; int initstat[MAXLIN]; int xstate; int count; int icount; char *input; long lnum; int bflag; int cflag; int fflag; int lflag; int nflag; int hflag = 1; int sflag; int vflag; int nfile; int blkno; long tln; int nsucc; int f; int fname; %} %% s: t ={ unary(FINAL, $1); line--; } ; t: b r ={ $$ = node(CAT, $1, $2); } | OR b r OR ={ $$ = node(CAT, $2, $3); } | OR b r ={ $$ = node(CAT, $2, $3); } | b r OR ={ $$ = node(CAT, $1, $2); } ; b: ={ $$ = enter(DOT); $$ = unary(STAR, $$); } ; r: CHAR ={ $$ = enter($1); } | DOT ={ $$ = enter(DOT); } | CCL ={ $$ = cclenter(CCL); } | NCCL ={ $$ = cclenter(NCCL); } ; r: r OR r ={ $$ = node(OR, $1, $3); } | r r %prec CAT ={ $$ = node(CAT, $1, $2); } | r STAR ={ $$ = unary(STAR, $1); } | r PLUS ={ $$ = unary(PLUS, $1); } | r QUEST ={ $$ = unary(QUEST, $1); } | '(' r ')' ={ $$ = $2; } | error ; %% yyerror(s) { fprintf(stderr, "egrep: %s\n", s); exit(2); } yylex() { extern int yylval; int cclcnt, x; register char c, d; switch(c = nextch()) { case '$': case '^': c = '\n'; goto defchar; case '|': return (OR); case '*': return (STAR); case '+': return (PLUS); case '?': return (QUEST); case '(': return (c); case ')': return (c); case '.': return (DOT); case '\0': return (0); case '\n': return (OR); case '[': x = CCL; cclcnt = 0; count = nxtchar++; if ((c = nextch()) == '^') { x = NCCL; c = nextch(); } do { if (c == '\0') synerror(); if (c == '-' && cclcnt > 0 && chars[nxtchar-1] != 0) { if ((d = nextch()) != 0) { c = chars[nxtchar-1]; while (c < d) { if (nxtchar >= MAXLIN) overflo(); chars[nxtchar++] = ++c; cclcnt++; } continue; } } if (nxtchar >= MAXLIN) overflo(); chars[nxtchar++] = c; cclcnt++; } while ((c = nextch()) != ']'); chars[count] = cclcnt; return (x); case '\\': if ((c = nextch()) == '\0') synerror(); defchar: default: yylval = c; return (CHAR); } } nextch() { register char c; if (fflag) { if ((c = getc(stdin)) == EOF) return(0); } else c = *input++; return(c); } synerror() { fprintf(stderr, "egrep: syntax error\n"); exit(2); } enter(x) int x; { if(line >= MAXLIN) overflo(); name[line] = x; left[line] = 0; right[line] = 0; return(line++); } cclenter(x) int x; { register linno; linno = enter(x); right[linno] = count; return (linno); } node(x, l, r) { if(line >= MAXLIN) overflo(); name[line] = x; left[line] = l; right[line] = r; parent[l] = line; parent[r] = line; return(line++); } unary(x, d) { if(line >= MAXLIN) overflo(); name[line] = x; left[line] = d; right[line] = 0; parent[d] = line; return(line++); } overflo() { fprintf(stderr, "egrep: regular expression too long\n"); exit(2); } cfoll(v) { register i; if (left[v] == 0) { count = 0; for (i=1; i<=line; i++) tmpstat[i] = 0; follow(v); add(foll, v); } else if (right[v] == 0) cfoll(left[v]); else { cfoll(left[v]); cfoll(right[v]); } } cgotofn() { register c, i, k; int n, s; char symbol[NCHARS]; int j, nc, pc, pos; int curpos, num; int number, newpos; count = 0; for (n=3; n<=line; n++) tmpstat[n] = 0; if (cstate(line-1)==0) { tmpstat[line] = 1; count++; out[0] = 1; } for (n=3; n<=line; n++) initstat[n] = tmpstat[n]; count--; /*leave out position 1 */ icount = count; tmpstat[1] = 0; add(state, 0); n = 0; for (s=0; s<=n; s++) { if (out[s] == 1) continue; for (i=0; i= 0) { if (c < NCHARS) symbol[c] = 1; else if (c == DOT) { for (k=0; k= 0) if ( (k == c) | (k == DOT) | (k == CCL && member(c, right[curpos], 1)) | (k == NCCL && member(c, right[curpos], 0)) ) { number = positions[foll[curpos]]; newpos = foll[curpos] + 1; for (k=0; k= NSTATES) overflo(); add(state, ++n); if (tmpstat[line] == 1) out[n] = 1; gotofn[s][c] = n; } else { gotofn[s][c] = xstate; } } } } } cstate(v) { register b; if (left[v] == 0) { if (tmpstat[v] != 1) { tmpstat[v] = 1; count++; } return(1); } else if (right[v] == 0) { if (cstate(left[v]) == 0) return (0); else if (name[v] == PLUS) return (1); else return (0); } else if (name[v] == CAT) { if (cstate(left[v]) == 0 && cstate(right[v]) == 0) return (0); else return (1); } else { /* name[v] == OR */ b = cstate(right[v]); if (cstate(left[v]) == 0 || b == 0) return (0); else return (1); } } member(symb, set, torf) { register i, num, pos; num = chars[set]; pos = set + 1; for (i=0; i MAXPOS) overflo(); array[n] = nxtpos; positions[nxtpos++] = count; for (i=3; i <= line; i++) { if (tmpstat[i] == 1) { positions[nxtpos++] = i; } } } follow(v) int v; { int p; if (v == line) return; p = parent[v]; switch(name[p]) { case STAR: case PLUS: cstate(v); follow(p); return; case OR: case QUEST: follow(p); return; case CAT: if (v == left[p]) { if (cstate(right[p]) == 0) { follow(p); return; } } else follow(p); return; case FINAL: if (tmpstat[line] != 1) { tmpstat[line] = 1; count++; } return; } } main(argc, argv) char **argv; { while (--argc > 0 && (++argv)[0][0]=='-') switch (argv[0][1]) { case 's': sflag++; continue; case 'h': hflag = 0; continue; case 'b': bflag++; continue; case 'c': cflag++; continue; case 'e': argc--; argv++; goto out; case 'f': fflag++; continue; case 'l': lflag++; continue; case 'n': nflag++; continue; case 'v': vflag++; continue; default: fprintf(stderr, "egrep: unknown flag\n"); continue; } out: if (argc<=0) exit(2); if (fflag) { if (freopen(fname = *argv, "r", stdin) == NULL) { fprintf(stderr, "egrep: can't open %s\n", fname); exit(2); } } else input = *argv; argc--; argv++; yyparse(); cfoll(line-1); cgotofn(); nfile = argc; if (argc<=0) { if (lflag) exit(1); execute(0); } else while (--argc >= 0) { execute(*argv); argv++; } exit(nsucc == 0); } execute(file) char *file; { register char *p; register cstat; register ccount; char buf[1024]; char *nlp; int istat; if (file) { if ((f = open(file, 0)) < 0) { fprintf(stderr, "egrep: can't open %s\n", file); exit(2); } } else f = 0; ccount = 0; lnum = 1; tln = 0; blkno = 0; p = buf; nlp = p; if ((ccount = read(f,p,512))<=0) goto done; istat = cstat = gotofn[0]['\n']; if (out[cstat]) goto found; for (;;) { cstat = gotofn[cstat][*p&0377]; /* all input chars made positive */ if (out[cstat]) { found: for(;;) { if (*p++ == '\n') { if (vflag == 0) { succeed: nsucc = 1; if (cflag) tln++; else if (sflag) ; /* ugh */ else if (lflag) { printf("%s\n", file); close(f); return; } else { if (nfile > 1 && hflag) printf("%s:", file); if (bflag) printf("%d:", blkno); if (nflag) printf("%ld:", lnum); if (p <= nlp) { while (nlp < &buf[1024]) putchar(*nlp++); nlp = buf; } while (nlp < p) putchar(*nlp++); } } lnum++; nlp = p; if ((out[(cstat=istat)]) == 0) goto brk2; } cfound: if (--ccount <= 0) { if (p <= &buf[512]) { if ((ccount = read(f, p, 512)) <= 0) goto done; } else if (p == &buf[1024]) { p = buf; if ((ccount = read(f, p, 512)) <= 0) goto done; } else { if ((ccount = read(f, p, &buf[1024]-p)) <= 0) goto done; } blkno++; } } } if (*p++ == '\n') { if (vflag) goto succeed; else { lnum++; nlp = p; if (out[(cstat=istat)]) goto cfound; } } brk2: if (--ccount <= 0) { if (p <= &buf[512]) { if ((cc((ount = read(f, p, 512)) <= 0) break; } else if (p == &buf[1024]) { p = buf; if ((ccount = read(f, p, 512)) <= 0) break; } else { if ((ccount = read(f, p, &buf[1024] - p)) <= 0) break; } blkno++; } } done: close(f); if (cflag) { if (nfile > 1) printf("%s:", file); printf("%ld\n", tln); } } if (vflag) goto succeed; else { lnum++; nlp = p; if (out[(cstat=istat)]) goto cfound; } } brk2: if (--ccount <= 0) { if (p <= &buf[512]) { if ((cccmd/expand.c 444 0 33 3376 2470645641 6240 static char *sccsid = "@(#)expand.c 4.2 (Berkeley) 2/7/81"; #include /* * expand - expand tabs to equivalent spaces */ char obuf[BUFSIZ]; int nstops; int tabstops[100]; main(argc, argv) int argc; char *argv[]; { register int c, column; register int n; setbuf(stdout, obuf); argc--, argv++; do { while (argc > 0 && argv[0][0] == '-') { getstops(argv[0]); argc--, argv++; } if (argc > 0) { if (freopen(argv[0], "r", stdin) == NULL) { perror(argv[0]); exit(1); } argc--, argv++; } column = 0; for (;;) { c = getc(stdin); if (c == -1) break; switch (c) { case '\t': if (nstops == 0) { do { putchar(' '); column++; } while (column & 07); continue; } if (nstops == 1) { do { putchar(' '); column++; } while (((column - 1) % tabstops[0]) != (tabstops[0] - 1)); continue; } for (n = 0; n < nstops; n++) if (tabstops[n] > column) break; if (n == nstops) { putchar(' '); column++; continue; } while (column < tabstops[n]) { putchar(' '); column++; } continue; case '\b': if (column) column--; putchar('\b'); continue; default: putchar(c); column++; continue; case '\n': putchar(c); column = 0; continue; } } } while (argc > 0); exit(0); } getstops(cp) register char *cp; { register int i; nstops = 0; cp++; for (;;) { i = 0; while (*cp >= '0' && *cp <= '9') i = i * 10 + *cp++ - '0'; if (i <= 0 || i > 256) { bad: fprintf(stderr, "Bad tab stop spec\n"); exit(1); } if (nstops > 0 && i <= tabstops[nstops-1]) goto bad; tabstops[nstops++] = i; if (*cp == 0) break; if (*cp++ != ',') goto bad; } } continue; case '\n': putchar(c); column = 0; continue; } } } while (argc > 0); exit(0); } getstops(cp) register char *cp; { register int i; nstops = 0; cp++; for (;;) { i = 0; while (*cp >= '0' && *cp <= '9') i = i * 10 cmd/vmstat.c 444 0 33 21077 2522754003 6304 static char *sccsid = "@(#)vmstat.c 4.7 (Berkeley) 4/28/81"; #include #include #include #include #include #include #include #include struct nlist nl[] = { #define X_CPTIME 0 { "_cp_time" }, #define X_RATE 1 { "_rate" }, #define X_TOTAL 2 { "_total" }, #define X_DEFICIT 3 { "_deficit" }, #define X_FORKSTAT 4 { "_forkstat" }, #define X_SUM 5 { "_sum" }, #define X_FIRSTFREE 6 { "_firstfree" }, #define X_MAXFREE 7 { "_maxfree" }, #define X_BOOTIME 8 { "_bootime" }, #define X_DKXFER 9 { "_dk_xfer" }, #define X_MBDINIT 10 { "_mbdinit" }, #define X_UBDINIT 11 { "_ubdinit" }, #define X_REC 12 { "_rectime" }, #define X_PGIN 13 { "_pgintime" }, #define X_HZ 14 { "_hz" }, { 0 }, }; char dr_name[DK_NDRIVE][10]; char dr_unit[DK_NDRIVE]; double stat1(); int firstfree, maxfree; int hz; struct { int busy; long time[CPUSTATES]; long xfer[DK_NDRIVE]; struct vmmeter Rate; struct vmtotal Total; struct vmmeter Sum; struct forkstat Forkstat; unsigned rectime; unsigned pgintime; } s, s1, z; #define rate s.Rate #define total s.Total #define sum s.Sum #define forkstat s.Forkstat int zero; int deficit; double etime; int mf; main(argc, argv) char **argv; { time_t now; int lines; extern char *ctime(); register i,j; int iter, nintv; time_t bootime; double f1, f2; long t; extern char _sobuf[]; setbuf(stdout, _sobuf); nlist("/vmunix", nl); if(nl[0].n_type == 0) { printf("no /vmunix namelist\n"); exit(1); } mf = open("/dev/kmem", 0); if(mf < 0) { printf("cannot open /dev/kmem\n"); exit(1); } iter = 0; argc--, argv++; while (argc>0 && argv[0][0]=='-') { char *cp = *argv++; argc--; while (*++cp) switch (*cp) { case 't': dotimes(); exit(0); case 'z': close(mf); mf = open("/dev/kmem", 2); lseek(mf, (long)nl[X_SUM].n_value, 0); write(mf, &z.Sum, sizeof z.Sum); exit(0); case 'f': doforkst(); exit(0); case 's': dosum(); exit(0); default: fprintf(stderr, "usage: vmstat [ -fs ] [ interval ] [ count]\n"); exit(1); } } if(argc > 1) iter = atoi(argv[1]); lseek(mf, (long)nl[X_FIRSTFREE].n_value, 0); read(mf, &firstfree, sizeof firstfree); lseek(mf, (long)nl[X_MAXFREE].n_value, 0); read(mf, &maxfree, sizeof maxfree); lseek(mf, (long)nl[X_BOOTIME].n_value, 0); read(mf, &bootime, sizeof bootime); lseek(mf, (long)nl[X_HZ].n_value, 0); read(mf, &hz, sizeof hz); for (i = 0; i < DK_NDRIVE; i++) { strcpy(dr_name[i], "xx"); dr_unit[i] = i; } read_names(); time(&now); nintv = now - bootime; if (nintv <= 0 || nintv > 60*60*24*365*10) { printf("Time makes no sense... namelist must be wrong.\n"); exit(1); } reprint: lines = 20; /* s1 = z; */ printf("\ procs memory page disk faults cpu\n\ r b w avm fre re at pi po fr de sr %c%d %c%d %c%d %c%d in sy cs us sy id\n\ ", dr_name[0][0], dr_unit[0], dr_name[1][0], dr_unit[1], dr_name[2][0], dr_unit[2], dr_name[3][0], dr_unit[3]); loop: lseek(mf, (long)nl[X_CPTIME].n_value, 0); read(mf, s.time, sizeof s.time); lseek(mf, (long)nl[X_DKXFER].n_value, 0); read(mf, s.xfer, sizeof s.xfer); if (nintv != 1) { lseek(mf, (long)nl[X_SUM].n_value, 0); read(mf, &rate, sizeof rate); } else { lseek(mf, (long)nl[X_RATE].n_value, 0); read(mf, &rate, sizeof rate); } lseek(mf, (long)nl[X_TOTAL].n_value, 0); read(mf, &total, sizeof total); lseek(mf, (long)nl[X_DEFICIT].n_value, 0); read(mf, &deficit, sizeof deficit); etime = 0; for (i=0; i < DK_NDRIVE; i++) { t = s.xfer[i]; s.xfer[i] -= s1.xfer[i]; s1.xfer[i] = t; } for (i=0; i < CPUSTATES; i++) { t = s.time[i]; s.time[i] -= s1.time[i]; s1.time[i] = t; etime += s.time[i]; } if(etime == 0.) etime = 1.; printf("%2d%2d%2d", total.t_rq, total.t_dw+total.t_pw, total.t_sw); printf("%6d%5d", total.t_avm/2, total.t_free/2); printf("%4d%3d%4d", (rate.v_pgrec - (rate.v_xsfrec+rate.v_xifrec))/nintv, (rate.v_xsfrec+rate.v_xifrec)/nintv, rate.v_pgpgin/2/nintv); printf("%4d%4d%4d%4d", rate.v_pgpgout/2/nintv, rate.v_dfree/2/nintv, deficit/2, rate.v_scan/nintv); etime /= 60.; for(i=0; i<4; i++) stats(i); printf("%4d%4d", (rate.v_intr/nintv) - hz, rate.v_syscall/nintv); printf("%4d", rate.v_swtch/nintv); for(i=0; i 0) { sleep(atoi(argv[0])); if (--lines <= 0) goto reprint; goto loop; } } dotimes() { lseek(mf, (long)nl[X_REC].n_value, 0); read(mf, &s.rectime, sizeof s.rectime); lseek(mf, (long)nl[X_PGIN].n_value, 0); read(mf, &s.pgintime, sizeof s.pgintime); lseek(mf, (long)nl[X_SUM].n_value, 0); read(mf, &sum, sizeof sum); printf("%d reclaims, %d total time (usec)\n", sum.v_pgrec, s.rectime); printf("average: %d usec / reclaim\n", s.rectime/sum.v_pgrec); printf("\n"); printf("%d page ins, %d total time (msec)\n",sum.v_pgin, s.pgintime/10); printf("average: %8.1f msec / page in\n", s.pgintime/(sum.v_pgin*10.0)); } dosum() { lseek(mf, (long)nl[X_SUM].n_value, 0); read(mf, &sum, sizeof sum); printf("%9d swap ins\n", sum.v_swpin); printf("%9d swap outs\n", sum.v_swpout); printf("%9d pages swapped in\n", sum.v_pswpin / CLSIZE); printf("%9d pages swapped out\n", sum.v_pswpout / CLSIZE); printf("%9d total address trans. faults taken\n", sum.v_faults); printf("%9d page ins\n", sum.v_pgin); printf("%9d page outs\n", sum.v_pgout); printf("%9d pages paged in\n", sum.v_pgpgin); printf("%9d pages paged out\n", sum.v_pgpgout); printf("%9d sequential process pages freed\n", sum.v_seqfree); printf("%9d total reclaims\n", sum.v_pgrec); printf("%9d reclaims from free list\n", sum.v_pgfrec); printf("%9d intransit blocking page faults\n", sum.v_intrans); printf("%9d zero fill pages created\n", sum.v_nzfod / CLSIZE); printf("%9d zero fill page faults\n", sum.v_zfod / CLSIZE); printf("%9d executable fill pages created\n", sum.v_nexfod / CLSIZE); printf("%9d executable fill page faults\n", sum.v_exfod / CLSIZE); printf("%9d swap text pages found in free list\n", sum.v_xsfrec); printf("%9d inode text pages found in free list\n", sum.v_xifrec); printf("%9d file fill pages created\n", sum.v_nvrfod / CLSIZE); printf("%9d file fill page faults\n", sum.v_vrfod / CLSIZE); printf("%9d pages examined by the clock daemon\n", sum.v_scan); printf("%9d revolutions of the clock hand\n", sum.v_rev); printf("%9d pages freed by the clock daemon\n"((, sum.v_dfree / CLSIZE); printf("%9d cpu context switches\n", sum.v_swtch); printf("%9d device interrupts\n", sum.v_intr); printf("%9d pseduo-dma dz interrupts\n", sum.v_pdma); printf("%9d traps\n", sum.v_trap); printf("%9d system calls\n", sum.v_syscall); } doforkst() { lseek(mf, (long)nl[X_FORKSTAT].n_value, 0); read(mf, &forkstat, sizeof forkstat); printf("%d forks, %d pages, average=%.2f\n", forkstat.cntfork, forkstat.sizfork, (float) forkstat.sizfork / forkstat.cntfork); printf("%d vforks, %d pages, average=%.2f\n", forkstat.cntvfork, forkstat.sizvfork, (float)forkstat.sizvfork / forkstat.cntvfork); } stats(dn) { if (dn >= DK_NDRIVE) { printf(" 0"); return; } printf("%3.0f", s.xfer[dn]/etime); } double stat1(row) { double t; register i; t = 0; for(i=0; i 0 && (++argv)[0][0]=='-') switch (argv[0][1]) { case 's': sflag++; continue; case 'h': hflag = 0; continue; case 'b': bflag++; continue; case 'c': cflag++; continue; case 'e': argc--; argv++; goto out; case 'f': fflag++; continue; case 'l': lflag++; continue; case 'n': nflag++; continue; case 'v': vflag++; continue; case 'x': xflag++; continue; case 'i': /* Berkeley */ case 'y': /* Btl */ yflag++; continue; default: fprintf(stderr, "fgrep: unknown flag\n"); continue; } out: if (argc<=0) exit(2); if (fflag) { wordf = fopen(*argv, "r"); if (wordf==NULL) { fprintf(stderr, "fgrep: can't open %s\n", *argv); exit(2); } } else argptr = *argv; argc--; argv++; cgotofn(); cfail(); nfile = argc; if (argc<=0) { if (lflag) exit(1); execute((char *)NULL); } else while (--argc >= 0) { execute(*argv); argv++; } exit(retcode != 0 ? retcode : nsucc == 0); } # define ccomp(a,b) (yflag ? lca(a)==lca(b) : a==b) # define lca(x) (isupper(x) ? tolower(x) : x) execute(file) char *file; { register struct words *c; register ccount; register char ch; register char *p; char buf[2*BUFSIZ]; int f; int failed; char *nlp; if (file) { if ((f = open(file, 0)) < 0) { fprintf(stderr, "fgrep: can't open %s\n", file); retcode = 2; return; } } else f = 0; ccount = 0; failed = 0; lnum = 1; tln = 0; blkno = 0; p = buf; nlp = p; c = w; for (;;) { if (--ccount <= 0) { if (p == &buf[2*BUFSIZ]) p = buf; if (p > &buf[BUFSIZ]) { if ((ccount = read(f, p, &buf[2*BUFSIZ] - p)) <= 0) break; } else if ((ccount = read(f, p, BUFSIZ)) <= 0) break; blkno += ccount; } nstate: if (ccomp(c->inp, *p)) { c = c->nst; } else if (c->link != 0) { c = c->link; goto nstate; } else { c = c->fail; failed = 1; if (c==0) { c = w; istate: if (ccomp(c->inp , *p)) { c = c->nst; } else if (c->link != 0) { c = c->link; goto istate; } } else goto nstate; } if (c->out) { while (*p++ != '\n') { if (--ccount <= 0) { if (p == &buf[2*BUFSIZ]) p = buf; if (p > &buf[BUFSIZ]) { if ((ccount = read(f, p, &buf[2&BUFSIZ] - p)) <= 0) break; } else if ((ccount = read(f, p, BUFSIZ)) <= 0) break; blkno += ccount; } } if ( (vflag && (failed == 0 || xflag == 0)) || (vflag == 0 && xflag && failed) ) goto nomatch; succeed: nsucc = 1; if (cflag) tln++; else if (sflag) ; /* ugh */ else if (lflag) { printf("%s\n", file); close(f); return; } else { if (nfile > 1 && hflag) printf("%s:", file); if (bflag) printf("%ld:", (blkno-ccount-1)/BUFSIZ); if (nflag) printf("%ld:", lnum); if (p <= nlp) { while (nlp < &buf[2*BUFSIZ]) putchar(*nlp++); nlp = buf; } while (nlp < p) putchar(*nlp++); } nomatch: lnum++; nlp = p; c = w; failed = 0; continue; } if (*p++ == '\n') if (vflag) goto succeed; else { lnum++; nlp = p; c = w; failed = 0; } } close(f); if (cflag) { if (nfile > 1) printf("%s:", file); printf("%ld\n", tln); } } getargc() { register c; if (wordf) return(getc(wordf)); if ((c = *argptr++) == '\0') return(EOF); return(c); } cgotofn() { register c; register struct words *s; s = smax = w; nword: for(;;) { c = getargc(); if (c==EOF) return; if (c == '\n') { if (xflag) { for(;;) { if (s->inp == c) { s = s->nst; break; } if (s->inp == 0) goto nenter; if (s->link == 0) { if (smax >= &w[MAXSIZ -1]) overflo(); s->link = ++smax; s = smax; goto nenter; } s = s->link; } } s->out = 1; s = w; } else { loop: if (s->inp == c) { s = s->nst; continue; } if (s->inp == 0) goto enter; if (s->link == 0) { if (smax >= &w[MAXSIZ - 1]) overflo(); s->link = ++smax; s = smax; goto enter; } s = s->link; goto loop; } } enter: do { s->inp = c; if (smax >= &w[MAXSIZ - 1]) overflo(); s->nst = ++smax; s = smax; } while ((c = getargc()) != '\n' && c!=EOF); if (xflag) { nenter: s->inp = '\n'; if (smax >= &w[MAXSIZ -1]) overflo(); s->nst = ++smax; } smax->out = 1; s = w; if (c != EOF) goto nword; } overflo() { fprintf(stderr, "wordlist too large\n"); exit(2); } cfail() { struct words *queue[QSIZE]; struct words **front, **rear; struct words *state; int bstart; register char c; register struct words *s; s = w; front = rear = queue; init: if ((s->inp) != 0) { *rear++ = s->nst; if (rear >= &queue[QSIZE - 1]) overflo(); } if ((s = s->link) != 0) { goto init; } while (rear!=front) { s = *front; if (front == &queue[QSIZE-1]) front = queue; else front++; cloop: if ((c = s->inp) != 0) { bstart = 0; *rear = (q = s->nst); if (front < rear) if (rear >= &queue[QSIZE-1]) if (front == queue) overflo(); else rear = queue; else rear++; else if (++rear == front) overflo(); state = s->fail; floop: if (state == 0) { state = w; bstart = 1; } if (state->inp == c) { qloop: q->fail = state->nst; if ((state->nst)->out == 1) q->out = 1; if ((q = q->link) != 0) goto qloop; } else if ((state = state->link) != 0) goto floop; else if(bstart == 0){ state = 0; goto floop((; } } if ((s = s->link) != 0) goto cloop; } } f (front == queue) overflo(); else rear = queue; else rear++; else if (++rear == front) overflo(); state = s->fail; floop: if (state == 0) { state = w; bstart = 1; } if (state->inp == c) { qloop: q->fail = state->nst; if ((state->nst)->out == 1) q->out = 1; if ((q = q->link) != 0) goto qloop; } else if ((state = state->link) != 0) goto floop; else if(bstart == 0){ state = 0; goto floopcmd/file.c 444 0 33 16261 2416237754 5717 static char sccsid[] = "@(#)file.c 4.1 10/1/80"; /* * file - determine type of file */ #include #include #include #include #include #include int in; int i = 0; char buf[BUFSIZ]; char *troff[] = { /* new troff intermediate lang */ "x","T","res","init","font","202","V0","p1",0}; char *fort[] = { "function","subroutine","common","dimension","block","integer", "real","data","double",0}; char *asc[] = { "chmk","mov","tst","clr","jmp",0}; char *c[] = { "int","char","float","double","struct","extern",0}; char *as[] = { "globl","byte","align","text","data","comm",0}; int ifile; main(argc, argv) char **argv; { FILE *fl; register char *p; char ap[128]; extern char _sobuf[]; if (argc>1 && argv[1][0]=='-' && argv[1][1]=='f') { if ((fl = fopen(argv[2], "r")) == NULL) { printf("Can't open %s\n", argv[2]); exit(2); } while ((p = fgets(ap, 128, fl)) != NULL) { int l = strlen(p); if (l>0) p[l-1] = '\0'; printf("%s: ", p); type(p); if (ifile>=0) close(ifile); } exit(1); } while(argc > 1) { printf("%s: ", argv[1]); type(argv[1]); fflush(stdout); argc--; argv++; if (ifile >= 0) close(ifile); } } type(file) char *file; { int j,nl; char ch; struct stat mbuf; ifile = -1; if(stat(file, &mbuf) < 0) { printf("cannot stat\n"); return; } switch (mbuf.st_mode & S_IFMT) { case S_IFCHR: printf("character"); goto spcl; case S_IFDIR: printf("directory\n"); return; case S_IFMPC: printf("char multiplexor\n"); return; case S_IFMPB: printf("block multiplexor\n"); return; case S_IFBLK: printf("block"); spcl: printf(" special (%d/%d)\n", major(mbuf.st_rdev), minor(mbuf.st_rdev)); return; } ifile = open(file, 0); if(ifile < 0) { printf("cannot open\n"); return; } in = read(ifile, buf, BUFSIZ); if(in == 0){ printf("empty\n"); return; } switch(*(int *)buf) { case 0413: printf("demand paged "); case 0410: printf("pure "); goto exec; case 0411: printf("jfr or pdp-11 unix 411 executable\n"); return; case 0407: exec: printf("executable"); if(((int *)buf)[4] != 0) { printf(" not stripped"); if(oldo(buf)) printf(" (old format symbol table)"); } printf("\n"); goto out; case 0177555: printf("very old archive\n"); goto out; case 0177545: printf("old archive\n"); goto out; case 070707: printf("cpio data\n"); goto out; } if(strncmp(buf, "!\n__.SYMDEF", 17) == 0 ) { printf("archive random library\n"); goto out; } if (strncmp(buf, "!\n", 8)==0) { printf("archive\n"); goto out; } i = 0; if(ccom() == 0)goto notc; while(buf[i] == '#'){ j = i; while(buf[i++] != '\n'){ if(i - j > 255){ printf("data\n"); goto out; } if(i >= in)goto notc; } if(ccom() == 0)goto notc; } check: if(lookup(c) == 1){ while((ch = buf[i++]) != ';' && ch != '{')if(i >= in)goto notc; printf("c program text"); goto outa; } nl = 0; while(buf[i] != '('){ if(buf[i] <= 0) goto notas; if(buf[i] == ';'){ i++; goto check; } if(buf[i++] == '\n') if(nl++ > 6)goto notc; if(i >= in)goto notc; } while(buf[i] != ')'){ if(buf[i++] == '\n') if(nl++ > 6)goto notc; if(i >= in)goto notc; } while(buf[i] != '{'){ if(buf[i++] == '\n') if(nl++ > 6)goto notc; if(i >= in)goto notc; } printf("c program text"); goto outa; notc: i = 0; while(buf[i] == 'c' || buf[i] == '#'){ while(buf[i++] != '\n')if(i >= in)goto notfort; } if(lookup(fort) == 1){ printf("fortran program text"); goto outa; } notfort: i=0; if(ascom() == 0)goto notas; j = i-1; if(buf[i] == '.'){ i++; if(lookup(as) == 1){ printf("assembler program text"); goto outa; } else if(buf[j] == '\n' && isalpha(buf[j+2])){ printf("roff, nroff, or eqn input text"); goto outa; } } while(lookup(asc) == 0){ if(ascom() == 0)goto notas; while(buf[i] != '\n' && buf[i++] != ':') if(i >= in)goto notas; while(buf[i] == '\n' || buf[i] == ' ' || buf[i] == '\t')if(i++ >= in)goto notas; j = i-1; if(buf[i] == '.'){ i++; if(lookup(as) == 1){ printf("assembler program text"); goto outa; } else if(buf[j] == '\n' && isalpha(buf[j+2])){ printf("roff, nroff, or eqn input text"); goto outa; } } } printf("assembler program text"); goto outa; notas: for(i=0; i < in; i++)if(buf[i]&0200){ if (buf[0]=='\100' && buf[1]=='\357') { printf("troff (CAT) output\n"); goto out; } printf("data\n"); goto out; } if (mbuf.st_mode&((S_IEXEC)|(S_IEXEC>>3)|(S_IEXEC>>6))) printf("commands text"); else if (troffint(buf, in)) printf("troff intermediate output text"); else if (english(buf, in)) printf("English text"); else printf("ascii text"); outa: while(i < in) if((buf[i++]&0377) > 127){ printf(" with garbage\n"); goto out; } /* if next few lines in then read whole file looking for nulls ... while((in = read(ifile,buf,BUFSIZ)) > 0) for(i = 0; i < in; i++) if((buf[i]&0377) > 127){ printf(" with garbage\n"); goto out; } /*.... */ printf("\n"); out:; } oldo(cp) char *cp; { struct exec ex; struct stat stb; ex = *(struct exec *)cp; if (fstat(ifile, &stb) < 0) return(0); if (N_STROFF(ex)+sizeof(off_t) > stb.st_size) return (1); return (0); } troffint(bp, n) char *bp; int n; { int k; i = 0; for (k = 0; k < 6; k++) { if (lookup(troff) == 0) return(0); if (lookup(troff) == 0) return(0); while (i < n && buf[i] != '\n') i++; if (i++ >= n) return(0); } return(1); } lookup(tab) char *tab[]; { char r; int k,j,l; while(buf[i] == ' ' || buf[i] == '\t' || buf[i] == '\n')i++; for(j=0; tab[j] != 0; j++){ l=0; for(k=i; ((r=tab[j][l++]) == buf[k] && r != '\0');k++); if(r == '\0') if(buf[k] == ' ' || buf[k] == '\n' || buf[k] == '\t' || buf[k] == '{' || buf[k] == '/'){ i=k; return(1); } } return(0); } ccom(){ char cc; while((cc = buf[i]) == ' ' || cc == '\t' || cc == '\n')if(i++ >= in)return(0); if(buf[i] == '/' && buf[i+1] == '*'){ i += 2; while(buf[i] != '*' || buf[i+1] != '/'){ if(buf[i] == '\\')i += 2; else i++; if(i >= in)return(0); } if((i += 2) >= in)return(0); } if(buf[i] == '\n')if(ccom() == 0)return(0); return(1); } ascom(){ while(buf[i] == '/'){ i++; while(buf[i++] != '\n')if(i >= in)return(0); while(buf[i] == '\n')if(i++ >= in)return(0); } return(1); } english (bp, n) char *bp; { # define NASC 128 int ct[NASC], j, vow, freq, rare; int badpun = 0, punct = 0; if (n<50) return(0); /* no point in statistics on squibs */ for(j=0; j punct) return(0); vow = ct['a'] + ct['e'] + ct['i'] + ct['o'] + ct['u']; freq = ct['e'] + ct['t'] + ct['a'] + ct['i'] + ct['o'] + ct['n']; rare = ct['v'] + ct['j'] + ct['k'] + ct['q'] + ct['x'] + ct['z']; if (2*ct[';'] > ct['e']) return(0); if ( (ct['>']+ct['<']+ct['/'])>ct['e']) return(0); /* shell file test */ return (vow*5 >= n-ct[' '] && freq >= 10*rare); } case ':': case '?': punct++; if ( j < n-1 && bp[j+1] != ' ' && bp[j+1] != '\n') badpun++; } } if (badpun*5 > punct) return(0); vow = ct['a'] + ct['e'] + ct['i'] + ct['o'] + ct['u']; freq = ct['e'] + ct['t'] + ct['a'] + ct['i'] + ct['o'] + ct['n']; rare = ct['v'] + ct['j'] + ct['k'] + ct['q'] + ct['cmd/find.c 444 0 33 34547 2551014371 5713 static char *sccsid = "@(#)find.c 4.4 (Berkeley) 7/3/81"; /* find COMPILE: cc -o find -s -O -i find.c -lS */ #include #include #include #include #define A_DAY 86400L /* a day full of seconds */ #define EQ(x, y) (strcmp(x, y)==0) int Randlast; char Pathname[200]; struct anode { int (*F)(); struct anode *L, *R; } Node[100]; int Nn; /* number of nodes */ char *Fname; long Now; int Argc, Ai, Pi; char **Argv; /* cpio stuff */ int Cpio; short *Buf, *Dbuf, *Wp; int Bufsize = 5120; int Wct = 2560; long Newer; struct stat Statb; struct anode *exp(), *e1(), *e2(), *e3(), *mk(); char *nxtarg(); char Home[128]; long Blocks; char *rindex(); char *sbrk(); main(argc, argv) char *argv[]; { struct anode *exlist; int paths; register char *cp, *sp = 0; FILE *pwd, *popen(); time(&Now); pwd = popen("pwd", "r"); fgets(Home, 128, pwd); pclose(pwd); Home[strlen(Home) - 1] = '\0'; Argc = argc; Argv = argv; if(argc<3) { usage: fprintf(stderr, "Usage: find ((path-list predicate-list\n"); exit(1); } for(Ai = paths = 1; Ai < (argc-1); ++Ai, ++paths) if(*Argv[Ai] == '-' || EQ(Argv[Ai], "(") || EQ(Argv[Ai], "!")) break; if(paths == 1) /* no path-list */ goto usage; if(!(exlist = exp())) { /* parse and compile the arguments */ fprintf(stderr, "find: parsing error\n"); exit(1); } if(Ai\n", s); exit(1); } Buf = (short *)sbrk(512); Wp = Dbuf = (short *)sbrk(5120); return(mk(cpio, (struct anode *)0, (struct anode *)0)); } else if(EQ(a, "-newer")) { if(stat(b, &Statb) < 0) { fprintf(stderr, "find: cannot access < %s >\n", b); exit(1); } Newer = Statb.st_mtime; return mk(newer, (struct anode *)0, (struct anode *)0); } err: fprintf(stderr, "find: bad option < %s >\n", a); exit(1); } struct anode *mk(f, l, r) int (*f)(); struct anode *l, *r; { Node[Nn].F = f; Node[Nn].L = l; Node[Nn].R = r; return(&(Node[Nn++])); } char *nxtarg() { /* get next arg from command line */ static strikes = 0; if(strikes==3) { fprintf(stderr, "find: incomplete statement\n"); exit(1); } if(Ai>=Argc) { strikes++; Ai = Argc + 1; return(""); } return(Argv[Ai++]); } /* execution time functions */ and(p) register struct anode *p; { return(((*p->L->F)(p->L)) && ((*p->R->F)(p->R))?1:0); } or(p) register struct anode *p; { return(((*p->L->F)(p->L)) || ((*p->R->F)(p->R))?1:0); } not(p) register struct anode *p; { return( !((*p->L->F)(p->L))); } glob(p) register struct { int f; char *pat; } *p; { return(gmatch(Fname, p->pat)); } print() { puts(Pathname); return(1); } mtime(p) register struct { int f, t, s; } *p; { return(scomp((int)((Now - Statb.st_mtime) / A_DAY), p->t, p->s)); } atime(p) register struct { int f, t, s; } *p; { return(scomp((int)((Now - Statb.st_atime) / A_DAY), p->t, p->s)); } user(p) register struct { int f, u, s; } *p; { return(scomp(Statb.st_uid, p->u, p->s)); } ino(p) register struct { int f, u, s; } *p; { return(scomp((int)Statb.st_ino, p->u, p->s)); } group(p) register struct { int f, u; } *p; { return(p->u == Statb.st_gid); } links(p) register struct { int f, link, s; } *p; { return(scomp(Statb.st_nlink, p->link, p->s)); } size(p) register struct { int f, sz, s; } *p; { return(scomp((int)((Statb.st_size+511)>>9), p->sz, p->s)); } perm(p) register struct { int f, per, s; } *p; { register i; i = (p->s=='-') ? p->per : 07777; /* '-' means only arg bits */ return((Statb.st_mode & i & 07777) == p->per); } type(p) register struct { int f, per, s; } *p; { return((Statb.st_mode&S_IFMT)==p->per); } exeq(p) register struct { int f, com; } *p; { fflush(stdout); /* to flush possible `-print' */ return(doex(p->com)); } ok(p) struct { int f, com; } *p; { char c; int yes; yes = 0; fflush(stdout); /* to flush possible `-print' */ fprintf(stderr, "< %s ... %s > ? ", Argv[p->com], Pathname); fflush(stderr); if((c=getchar())=='y') yes = 1; while(c!='\n') c = getchar(); if(yes) return(doex(p->com)); return(0); } #define MKSHORT(v, lv) {U.l=1L;if(U.c[0]) U.l=lv, v[0]=U.s[1], v[1]=U.s[0]; else U.l=lv, v[0]=U.s[0], v[1]=U.s[1];} union { long l; short s[2]; char c[4]; } U; long mklong(v) short v[]; { U.l = 1; if(U.c[0] /* VAX */) U.s[0] = v[1], U.s[1] = v[0]; else U.s[0] = v[0], U.s[1] = v[1]; return U.l; } cpio() { #define MAGIC 070707 struct header { short h_magic, h_dev, h_ino, h_mode, h_uid, h_gid, h_nlink, h_rdev; short h_mtime[2]; short h_namesize; short h_filesize[2]; char h_name[256]; } hdr; register ifile, ct; static long fsz; register i; hdr.h_magic = MAGIC; strcpy(hdr.h_name, !strncmp(Pathname, "./", 2)? Pathname+2: Pathname); hdr.h_namesize = strlen(hdr.h_name) + 1; hdr.h_uid = Statb.st_uid; hdr.h_gid = Statb.st_gid; hdr.h_dev = Statb.st_dev; hdr.h_ino = Statb.st_ino; hdr.h_mode = Statb.st_mode; MKSHORT(hdr.h_mtime, Statb.st_mtime); hdr.h_nlink = Statb.st_nlink; fsz = hdr.h_mode & S_IFREG? Statb.st_size: 0L; MKSHORT(hdr.h_filesize, fsz); hdr.h_rdev = Statb.st_rdev; if(EQ(hdr.h_name, "TRAILER!!!")) { bwrite((short *)&hdr, (sizeof hdr-256)+hdr.h_namesize); for(i = 0; i < 10; ++i) bwrite(Buf, 512); return; } if(!mklong(hdr.h_filesize)) return; if((ifile = open(Fname, 0)) < 0) { cerror: fprintf(stderr, "find: cannot copy < %s >\n", hdr.h_name); return; } bwrite((short *)&hdr, (sizeof hdr-256)+hdr.h_namesize); for(fsz = mklong(hdr.h_filesize); fsz > 0; fsz -= 512) { ct = fsz>512? 512: fsz; if(read(ifile, (char *)Buf, ct) < 0) goto cerror; bwrite(Buf, ct); } close(ifile); return; } newer() { return Statb.st_mtime > Newer; } /* support functions */ scomp(a, b, s) /* funny signed compare */ register a, b; register char s; { if(s == '+') return(a > b); if(s == '-') return(a < (b * -1)); return(a == b); } doex(com) { register np; register char *na; static char *nargv[50]; static ccode; ccode = np = 0; while (na=Argv[com++]) { if(strcmp(na, ";")==0) break; if(strcmp(na, "{}")==0) nargv[np++] = Pathname; else nargv[np++] = na; } nargv[np] = 0; if (np==0) return(9); if(fork()) /*parent*/ { #include int (*old)() = signal(SIGINT, SIG_IGN); int (*oldq)() = signal(SIGQUIT, SIG_IGN); wait(&ccode); signal(SIGINT, old); signal(SIGQUIT, oldq); } else { /*child*/ chdir(Home); execvp(nargv[0], nargv, np); exit(1); } return(ccode ? 0:1); } getunum(f, s) char *f, *s; { /* find user/group name and return number */ register i; register char *sp; register c; char str[20]; FILE *pin; i = -1; pin = fopen(f, "r"); c = '\n'; /* prime with a CR */ do { if(c=='\n') { sp = str; while((c = *sp++ = getc(pin)) != ':') if(c == EOF) goto RET; *--sp = '\0'; if(EQ(str, s)) { while((c=getc(pin)) != ':') if(c == EOF) goto RET; sp = str; while((*sp = getc(pin)) != ':') sp++; *sp = '\0'; i = atoi(str); goto RET; } } } while((c = getc(pin)) != EOF); RET: fclose(pin); return(i); } descend(name, fname, exlist) struct anode *exlist; char *name, *fname; { int dir = 0, /* open directory */ offset, dsize, entries, dirsize; struct direct dentry[BUFSIZ / sizeof (struct direct)]; register struct direct *dp; register char *c1, *c2; int i; int rv = 0; char *endofname; if(stat(fname, &Statb)<0) { fprintf(stderr, "find: bad status < %s >\n", name); return(((0); } (*exlist->F)(exlist); if((Statb.st_mode&S_IFMT)!=S_IFDIR) return(1); for(c1 = name; *c1; ++c1); if(*(c1-1) == '/') --c1; endofname = c1; dirsize = Statb.st_size; if(chdir(fname) == -1) return(0); for(offset=0 ; offset < dirsize ; offset += BUFSIZ) { /* each block */ dsize = BUFSIZ<(dirsize-offset)? BUFSIZ: (dirsize-offset); if(!dir) { if((dir=open(".", 0))<0) { fprintf(stderr, "find: cannot open < %s >\n", name); rv = 0; goto ret; } if(offset) lseek(dir, (long)offset, 0); if(read(dir, (char *)dentry, dsize)<0) { fprintf(stderr, "find: cannot read < %s >\n", name); rv = 0; goto ret; } if(dir > 10) { close(dir); dir = 0; } } else if(read(dir, (char *)dentry, dsize)<0) { fprintf(stderr, "find: cannot read < %s >\n", name); rv = 0; goto ret; } for(dp=dentry, entries=dsize>>4; entries; --entries, ++dp) { /* each directory entry */ if(dp->d_ino==0 || (dp->d_name[0]=='.' && dp->d_name[1]=='\0') || (dp->d_name[0]=='.' && dp->d_name[1]=='.' && dp->d_name[2]=='\0')) continue; c1 = endofname; *c1++ = '/'; c2 = dp->d_name; for(i=0; i<14; ++i) if(*c2) *c1++ = *c2++; else break; *c1 = '\0'; if(c1 == endofname) { /* ?? */ rv = 0; goto ret; } Fname = endofname+1; if(!descend(name, Fname, exlist)) { *endofname = '\0'; chdir(Home); if(chdir(Pathname) == -1) { fprintf(stderr, "find: bad directory tree\n"); exit(1); } } } } rv = 1; ret: if(dir) close(dir); if(chdir("..") == -1) { *endofname = '\0'; fprintf(stderr, "find: bad directory <%s>\n", name); rv = 1; } return(rv); } gmatch(s, p) /* string match as in glob */ register char *s, *p; { if (*s=='.' && *p!='.') return(0); return amatch(s, p); } amatch(s, p) register char *s, *p; { register cc; int scc, k; int c, lc; scc = *s; lc = 077777; switch (c = *p) { case '[': k = 0; while (cc = *++p) { switch (cc) { case ']': if (k) return(amatch(++s, ++p)); else return(0); case '-': k |= lc <= scc & scc <= (cc=p[1]); } if (scc==(lc=cc)) k++; } return(0); case '?': caseq: if(scc) return(amatch(++s, ++p)); return(0); case '*': return(umatch(s, ++p)); case 0: return(!scc); } if (c==scc) goto caseq; return(0); } umatch(s, p) register char *s, *p; { if(*p==0) return(1); while(*s) if (amatch(s++, p)) return(1); return(0); } bwrite(rp, c) register short *rp; register c; { register short *wp = Wp; c = (c+1) >> 1; while(c--) { if(!Wct) { again: if(write(Cpio, (char *)Dbuf, Bufsize)<0) { Cpio = chgreel(1, Cpio); goto again; } Wct = Bufsize >> 1; wp = Dbuf; ++Blocks; } *wp++ = *rp++; --Wct; } Wp = wp; } chgreel(x, fl) { register f; char str[22]; FILE *devtty; struct stat statb; extern errno; fprintf(stderr, "find: errno: %d, ", errno); fprintf(stderr, "find: can't %s\n", x? "write output": "read input"); fstat(fl, &statb); if((statb.st_mode&S_IFMT) != S_IFCHR) exit(1); again: fprintf(stderr, "If you want to go on, type device/file name %s\n", "when ready"); devtty = fopen("/dev/tty", "r"); fgets(str, 20, devtty); str[strlen(str) - 1] = '\0'; if(!*str) exit(1); close(fl); if((f = open(str, x? 1: 0)) < 0) { fprintf(stderr, "That didn't work"); fclose(devtty); goto again; } return f; } r, "find: errno: %d, ", errno); fprintf(stderr, "find: can't %s\n", x? "write output": "read input"); fstat(fl, &statb); if((statb.st_mode&S_IFMT) != cmd/finger.c 444 0 33 74601 2416237766 6257 static char *sccsid = "@(#)finger.c 4.1 (Berkeley) 10/1/80"; /* This is a finger program. It prints out useful information about users * by digging it up from various system files. It is not very portable * because the most useful parts of the information (the full user name, * office, and phone numbers) are all stored in the VAX-unused gecos field * of /etc/passwd, which, unfortunately, other UNIXes use for other things. * * There are three output formats, all of which give login name, teletype * line number, and login time. The short output format is reminiscent * of finger on ITS, and gives one line of information per user containing * in addition to the minimum basic requirements (MBR), the full name of * the user, his idle time and office location and phone number. The * quick style output is UNIX who-like, giving only name, teletype and * login time. Finally, the long style output give the same information * as the short (in more legible format), the home directory and shell * of the user, and, if it exits, a copy of the file .plan in the users * home directory. Finger may be called with or without a list of people * to finger -- if no list is given, all the people currently logged in * are fingered. * * The program is validly called by one of the following: * * finger {short form list of users} * finger -l {long form list of users} * finger -b {briefer long form list of users} * finger -q {quick list of users} * finger -i {quick list of users with idle times} * finger namelist {long format list of specified users} * finger -s namelist {short format list of specified users} * finger -w namelist {narrow short format list of specified users} * * where 'namelist' is a list of users login names. * The other options can all be given after one '-', or each can have its * own '-'. The -f option disables the printing of headers for short and * quick outputs. The -b option briefens long format outputs. The -p * option turns off plans for long format outputs. */ #include #include #include #include #include #include #include #include #include #include struct utmp utmp; /* for sizeof */ #define NMAX sizeof(utmp.ut_name) #define LMAX sizeof(utmp.ut_line) #define ASTERISK '*' /* ignore this in real name */ #define BLANK ' ' /* blank character (i.e. space) */ #define CAPITALIZE 0137& /* capitalize character macro */ #define COMMA ',' /* separator in pw_gecos field */ #define COMMAND '-' /* command line flag char */ #define CORY 'C' /* cory hall office */ #define EVANS 'E' /* evans hall office */ #define LINEBREAK 012 /* line feed */ #define NULLSTR "" /* the null string, opposed to NULL */ #define SAMENAME '&' /* repeat login name in real name */ #define TALKABLE 0222 /* tty is writeable if 222 mode */ struct person { /* one for each person fingered */ char name[NMAX+1]; /* login name */ char tty[LMAX+1]; /* NULL terminated tty line */ long loginat; /* time of login (possibly last) */ long idletime; /* how long idle (if logged in) */ short int loggedin; /* flag for being logged in */ short int writeable; /* flag for tty being writeable */ char *realname; /* pointer to full name */ char *office; /* pointer to office name */ char *officephone; /* pointer to office phone no. */ char *homephone; /* pointer to home phone no. */ char *random; /* for any random stuff in pw_gecos */ struct passwd *pwd; /* structure of /etc/passwd stuff */ struct person *link; /* link to next person */ }; struct passwd *NILPWD = 0; struct person *NILPERS = 0; int persize = sizeof( struct person ); int pwdsize = sizeof( struct passwd ); char LASTLOG[] = "/usr/adm/lastlog"; /* last login info */ char USERLOG[] = "/etc/utmp"; /* who is logged in */ char outbuf[BUFSIZ]; /* output buffer */ char *ctime(); int unbrief = 1; /* -b option default */ int header = 1; /* -f option default */ int hack = 1; /* -h option default */ int idle = 0; /* -i option default */ int large = 0; /* -l option default */ int match = 1; /* -m option default */ int plan = 1; /* -p option default */ int unquick = 1; /* -q option default */ int small = 0; /* -s option default */ int wide = 1; /* -w option default */ int lf; int llopenerr; long tloc; /* current time */ main( argc, argv ) int argc; char *argv[]; { FILE *fp, *fopen(); /* for plans */ struct passwd *getpwent(); /* read /etc/passwd */ struct person *person1, *p, *pend; /* people */ struct passwd *pw; /* temporary */ struct utmp user; /* ditto */ char *malloc(); char *s, *pn, *ln; char c; char *PLAN = "/.plan"; /* what plan file is */ char *PROJ = "/.project"; /* what project file */ int PLANLEN = strlen( PLAN ); int PROJLEN = strlen( PROJ ); int numnames = 0; int orgnumnames; int uf; int usize = sizeof user; int unshort; int i, j; int fngrlogin; setbuf( stdout, outbuf ); /* buffer output */ /* parse command line for (optional) arguments */ i = 1; if( strcmp( *argv, "sh" ) ) { fngrlogin = 0; while( i++ < argc && (*++argv)[0] == COMMAND ) { for( s = argv[0] + 1; *s != NULL; s++ ) { switch (*s) { case 'b': unbrief = 0; break; case 'f': header = 0; break; case 'h': hack = 0; break; case 'i': idle = 1; unquick = 0; break; case 'l': large = 1; break; case 'm': match = 0; break; case 'p': plan = 0; break; case 'q': unquick = 0; break; case 's': small = 1; break; case 'w': wide = 0; break; default: fprintf( stderr, "finger: Usage -- 'finger [-bfhilmpqsw] [login1 [login2 ...] ]'\n" ); exit( 1 ); } } } } else { fngrlogin = 1; } if( unquick ) { time( &tl((oc ); } else { if( idle ) { time( &tloc ); } } /* i > argc means no login names given so get them by reading USERLOG */ if( (i > argc) || fngrlogin ) { unshort = large; if( ( uf = open(USERLOG, 0) ) >= 0 ) { user.ut_name[0] = NULL; while( user.ut_name[0] == NULL ) { if( read( uf, (char *) &user, usize ) != usize ) { printf( "\nNo one logged on\n" ); exit( 0 ); } } person1 = (struct person *) malloc( persize ); for( j = 0; j < NMAX; j++ ) { person1->tty[j] = user.ut_line[j]; person1->name[j] = user.ut_name[j]; } person1->name[NMAX] = NULL; person1->tty[NMAX] = NULL; person1->loginat = user.ut_time; person1->pwd = NILPWD; person1->loggedin = 1; numnames++; p = person1; while( read( uf, (char *) &user, usize ) == usize ) { if( user.ut_name[0] == NULL ) continue; p->link = (struct person *) malloc( persize ); p = p->link; for( j = 0; j < NMAX; j++ ) { p->tty[j] = user.ut_line[j]; p->name[j] = user.ut_name[j]; } p->name[NMAX] = NULL; p->tty[NMAX] = NULL; p->loginat = user.ut_time; p->pwd = NILPWD; p->loggedin = 1; numnames++; } p->link = NILPERS; close( uf ); } else { fprintf( stderr, "finger: error opening %s\n", USERLOG ); exit( 2 ); } /* if we are doing it, read /etc/passwd for the useful info */ if( unquick ) { setpwent(); fwopen(); i = numnames; while( ( (pw = getpwent()) != NILPWD ) && ( i > 0 ) ) { p = person1; do { if( p->pwd == NILPWD ) { if( strcmp( p->name, pw->pw_name ) == 0 ) { p->pwd = (struct passwd *) malloc( pwdsize ); pwdcopy( p->pwd, pw ); decode( p ); i--; } } p = p->link; } while( p != NILPERS ); } fwclose(); endpwent(); } } /* get names from command line and check to see if they're logged in */ else { unshort = ( small == 1 ? 0 : 1 ); i++; person1 = (struct person *) malloc( persize ); strcpy( person1->name, (argv++)[ 0 ] ); person1->loggedin = 0; person1->pwd = NILPWD; numnames++; p = person1; while( i++ <= argc ) { p->link = (struct person *) malloc( persize ); p = p->link; strcpy( p->name, (argv++)[ 0 ] ); p->loggedin = 0; p->pwd = NILPWD; numnames++; } p->link = NILPERS; pend = p; /* if we are doing it, read /etc/passwd for the useful info */ orgnumnames = numnames; if( unquick ) { setpwent(); while( ( pw = getpwent() ) != NILPWD ) { p = person1; i = 0; do { if( strcmp( p->name, pw->pw_name ) == 0 || matchcmp( pw->pw_gecos, pw->pw_name, p->name ) ) { if( p->pwd == NILPWD ) { p->pwd = (struct passwd *) malloc( pwdsize ); pwdcopy( p->pwd, pw ); } else { /* handle multiple logins -- append new "duplicate" entry to end of list */ pend->link = (struct person *) malloc(persize); pend = pend->link; pend->link = NILPERS; strcpy( pend->name, p->name ); pend->pwd = (struct passwd *) malloc(pwdsize); pwdcopy( pend->pwd, pw ); numnames++; } } p = p->link; } while( ++i < orgnumnames ); } endpwent(); } /* Now get login information */ if( ( uf = open(USERLOG, 0) ) >= 0 ) { while( read( uf, (char *) &user, usize ) == usize ) { if( user.ut_name[0] == NULL ) continue; p = person1; do { pw = p->pwd; if( pw == NILPWD ) { i = ( strcmp( p->name, user.ut_name ) ? 0 : NMAX ); } else { i = 0; while( (i < NMAX) && ( pw->pw_name[i] == user.ut_name[i]) ) { if( pw->pw_name[i] == NULL ) { i = NMAX; break; } i++; } } if( i == NMAX ) { if( p->loggedin == 1 ) { pend->link = (struct person *) malloc(persize); pend = pend->link; pend->link = NILPERS; strcpy( pend->name, p->name ); for( j = 0; j < NMAX; j++ ) { pend->tty[j] = user.ut_line[j]; } pend->tty[ NMAX ] = NULL; pend->loginat = user.ut_time; pend->loggedin = 2; if( pw == NILPWD ) { pend ->pwd = NILPWD; } else { pend->pwd = (struct passwd *) malloc(pwdsize); pwdcopy( pend->pwd, pw ); } numnames++; } else { if( p->loggedin != 2 ) { for( j = 0; j < NMAX; j++ ) { p->tty[j] = user.ut_line[j]; } p->tty[ NMAX ] = NULL; p->loginat = user.ut_time; p->loggedin = 1; } } } p = p->link; } while( p != NILPERS ); } fwopen(); p = person1; while( p != NILPERS ) { if( p->loggedin == 2 ) { p->loggedin = 1; } decode( p ); p = p->link; } fwclose(); close( uf ); } else { fprintf( stderr, "finger: error opening %s\n", USERLOG ); exit( 2 ); } } /* print out what we got */ if( header ) { if( unquick ) { if( !unshort ) { if( wide ) { printf( "Login Name TTY Idle When Office\n" ); } else { printf( "Login TTY Idle When Office\n" ); } } } else { printf( "Login TTY When" ); if( idle ) { printf( " Idle" ); } printf( "\n" ); } } p = person1; do { if( unquick ) { if( unshort ) { personprint( p ); if( p->pwd != NILPWD ) { if( hack ) { s = malloc(strlen((p->pwd)->pw_dir) + PROJLEN + 1 ); strcpy( s, (p->pwd)->pw_dir ); strcat( s, PROJ ); if( ( fp = fopen( s, "r") ) != NULL ) { printf( "Project: " ); while( ( c = getc(fp) ) != EOF ) { if( c == LINEBREAK ) { break; } putc( c, stdout ); } fclose( fp ); printf( "\n" ); } } if( plan ) { s = malloc( strlen( (p->pwd)->pw_dir ) + PLANLEN + 1 ); strcpy( s, (p->pwd)->pw_dir ); strcat( s, PLAN ); if( ( fp = fopen( s, "r") ) == NULL ) { printf( "No Plan.\n" ); } else { printf( "Plan:\n" ); while( ( c = getc(fp) ) != EOF ) { putc( c, stdout ); } fclose( fp ); } } } if( p->link != NILPERS ) { printf( "\n" ); } } else { shortprint( p ); } } else { quickprint( p ); } p = p->link; } while( p != NILPERS ); exit(0); } /* given a pointer to a pwd (pfrom) copy it to another one, allocating * space for all the stuff in it. Note: Only the useful (what the * program currently uses) things are copied. */ pwdcopy( pto, pfrom ) /* copy relevant fields only */ struct passwd *pto, *pfrom; { pto->pw_name = malloc( strlen( pfrom->pw_name ) + 1 ); strcpy( pto->pw_name, pfrom->pw_name ); pto->pw_uid = pfrom->pw_uid; pto->pw_gecos = malloc( strlen( pfrom->pw_gecos ) + 1 ); strcpy( pto->pw_gecos, pfrom->pw_gecos ); pto->pw_dir = malloc( strlen( pfrom->pw_dir ) + 1 ); strcpy( pto->pw_dir, pfrom->pw_dir ); pto->pw_shell = malloc( strlen( pfrom->pw_shell ) + 1 ); strcpy( pto->pw_shell, pfrom->pw_shell ); } /* print out information on quick format giving just name, tty, login time * and idle time if idle is set. */ quickprint( pers ) struct person *pers; { int idleprinted; printf( "%-*.*s", NMAX, NMAX, pers->name ); printf( " " ); if( pers->loggedin ) { if( idle ) { findidle( pers ); if( pers->writeable ) { printf( " %-*.*s %-16.16s", LMAX, LMAX, pers->tty, ctime( &pers->loginat ) ); } else { printf( "*%-*.*s %-16.16s", LMAX, LMAX, pers->tty, ctime( &pers->loginat ) ); } printf( " " ); idleprinted = ltimeprint( &pers->idletime ); } else { printf( " %-*.*s %-16.16s", LMAX, LMAX, pers->tty, ctime( &pers->loginat ) ); } } else { printf( " Not Logged In" ); } printf( "\n" ); } /* print out information in short format, giving login name, full name, * tty, idle time, login time, office location and phone. */ shortprint( pers ) struct person *pers; { struct passwd *pwdt = pers->pwd; char buf[ 26 ]; int i, len, offset, dialup; if( pwdt == NILPWD ) { printf( "%-*.*s", NMAX, NMAX, pers->name ); printf( " ???\n" ); return; } printf( "%-*.*s", NMAX, NMAX, pwdt->pw_name ); dialup = 0; if( wide ) { if( strlen( pers->realname ) > 0 ) { printf( " %-20.20s", pers->realname ); } else { printf( " ??? " ); } } if( pers->loggedin ) { if( pers->writeable ) { printf( " " ); } else { printf( " *" ); } } else { printf( " " ); } if( strlen( pers->tty ) > 0 ) { strcpy( buf, pers->tty ); if( (buf[0] == 't') && (buf[1] == 't') && (buf[2] == 'y') ) { offset = 3; for( i = 0; i < 2; i++ ) { buf[i] = buf[i + offset]; } } if( (buf[0] == 'd') && pers->loggedin ) { dialup = 1; } printf( "%-2.2s ", buf ); } else { printf( " " ); } strcpy( buf, ctime( &pers->loginat ) ); if( pers->loggedin ) { stimeprint( &pers->idletime ); offset = 7; for( i = 4; i < 19; i++ ) { buf[i] = buf[i + offset]; } printf( " %-9.9s ", buf ); } else { printf( " " ); offset = 4; for( i = 0; i <22; i++ ) { buf[i] = buf[i + offset]; } printf( "<%-12.12s>", buf ); } len = strlen( pers->homephone ); if( dialup && (len > 0) ) { if( len == 8 ) { printf( " " ); } else { if( len == 12 ) { printf( " " ); } else { for( i = 1; i <= 21 - len; i++ ) { printf( " " ); } } } printf( "%s", pers->homephone ); } else { if( strlen( pers->office ) > 0 ) { printf( " %-11.11s", pers->office ); if( strlen( pers->officephone ) > 0 ) { printf( " %8.8s", pers->officephone ); } else { if( len == 8 ) { printf( " %8.8s", pers->homephone ); } } } else { if( strlen( pers->officephone ) > 0 ) { ((printf( " %8.8s", pers->officephone ); } else { if( len == 8 ) { printf( " %8.8s", pers->homephone ); } else { if( len == 12 ) { printf( " %12.12s", pers->homephone ); } } } } } printf( "\n" ); } /* print out a person in long format giving all possible information. * directory and shell are inhibited if unbrief is clear. */ personprint( pers ) struct person *pers; { struct passwd *pwdt = pers->pwd; int idleprinted; if( pwdt == NILPWD ) { printf( "Login name: %-10s", pers->name ); printf( " " ); printf( "In real life: ???\n"); return; } printf( "Login name: %-10s", pwdt->pw_name ); if( pers->loggedin ) { if( pers->writeable ) { printf( " " ); } else { printf( " (messages off) " ); } } else { printf( " " ); } if( strlen( pers->realname ) > 0 ) { printf( "In real life: %-s", pers->realname ); } if( strlen( pers->office ) > 0 ) { printf( "\nOffice: %-.11s", pers->office ); if( strlen( pers->officephone ) > 0 ) { printf( ", %s", pers->officephone ); if( strlen( pers->homephone ) > 0 ) { printf( " Home phone: %s", pers->homephone ); } else { if( strlen( pers->random ) > 0 ) { printf( " %s", pers->random ); } } } else { if( strlen( pers->homephone ) > 0 ) { printf(" Home phone: %s",pers->homephone); } if( strlen( pers->random ) > 0 ) { printf( " %s", pers->random ); } } } else { if( strlen( pers->officephone ) > 0 ) { printf( "\nPhone: %s", pers->officephone ); if( strlen( pers->homephone ) > 0 ) { printf( "\n, %s", pers->homephone ); if( strlen( pers->random ) > 0 ) { printf( ", %s", pers->random ); } } else { if( strlen( pers->random ) > 0 ) { printf( "\n, %s", pers->random ); } } } else { if( strlen( pers->homephone ) > 0 ) { printf( "\nPhone: %s", pers->homephone ); if( strlen( pers->random ) > 0 ) { printf( ", %s", pers->random ); } } else { if( strlen( pers->random ) > 0 ) { printf( "\n%s", pers->random ); } } } } if( unbrief ) { printf( "\n" ); printf( "Directory: %-25s", pwdt->pw_dir ); if( strlen( pwdt->pw_shell ) > 0 ) { printf( " Shell: %-s", pwdt->pw_shell ); } } if( pers->loggedin ) { register char *ep = ctime( &pers->loginat ); printf("\nOn since %15.15s on %-*.*s ", &ep[4], LMAX, LMAX, pers->tty ); idleprinted = ltimeprint( &pers->idletime ); if( idleprinted ) { printf( " Idle Time" ); } } else { register char *ep = ctime( &pers->loginat ); printf("\nLast login %16.16s on %.*s", ep, LMAX, pers->tty ); } printf( "\n" ); } /* * very hacky section of code to format phone numbers. filled with * magic constants like 4, 7 and 10. */ char *phone( s, len ) char *s; int len; { char *strsave(); char fonebuf[ 15 ]; int i; switch( len ) { case 4: fonebuf[ 0 ] = ' '; fonebuf[ 1 ] = 'x'; fonebuf[ 2 ] = '2'; fonebuf[ 3 ] = '-'; for( i = 0; i <= 3; i++ ) { fonebuf[ 4 + i ] = *s++; } fonebuf[ 8 ] = NULL; return( strsave( &fonebuf[0] ) ); break; case 7: for( i = 0; i <= 2; i++ ) { fonebuf[ i ] = *s++; } fonebuf[ 3 ] = '-'; for( i = 0; i <= 3; i++ ) { fonebuf[ 4 + i ] = *s++; } fonebuf[ 8 ] = NULL; return( strsave( &fonebuf[0] ) ); break; case 10: for( i = 0; i <= 2; i++ ) { fonebuf[ i ] = *s++; } fonebuf[ 3 ] = '-'; for( i = 0; i <= 2; i++ ) { fonebuf[ 4 + i ] = *s++; } fonebuf[ 7 ] = '-'; for( i = 0; i <= 3; i++ ) { fonebuf[ 8 + i ] = *s++; } fonebuf[ 12 ] = NULL; return( strsave( &fonebuf[0] ) ); break; default: fprintf( stderr, "finger: error in phone numbering\n" ); return( strsave(s) ); break; } } /* decode the information in the gecos field of /etc/passwd * another hacky section of code, but given the format the stuff is in... */ decode( pers ) struct person *pers; { struct passwd *pwdt = pers->pwd; char buffer[ 40 ], *bp, *gp, *lp; char *phone(); int alldigits; int len; int i; pers->realname = NULLSTR; pers->office = NULLSTR; pers->officephone = NULLSTR; pers->homephone = NULLSTR; pers->random = NULLSTR; if( pwdt != NILPWD ) { gp = pwdt->pw_gecos; bp = &buffer[ 0 ]; if( *gp == ASTERISK ) { gp++; } while( (*gp != NULL) && (*gp != COMMA) ) { /* name */ if( *gp == SAMENAME ) { lp = pwdt->pw_name; *bp++ = CAPITALIZE(*lp++); while( *lp != NULL ) { *bp++ = *lp++; } } else { *bp++ = *gp; } gp++; } *bp = NULL; pers->realname = malloc( strlen( &buffer[0] ) + 1 ); strcpy( pers->realname, &buffer[0] ); if( *gp++ == COMMA ) { /* office, supposedly */ alldigits = 1; bp = &buffer[ 0 ]; while( (*gp != NULL) && (*gp != COMMA) ) { *bp = *gp++; alldigits = alldigits && ('0' <= *bp) && (*bp <= '9'); bp++; } *bp = NULL; len = strlen( &buffer[0] ); if( buffer[ len - 1 ] == CORY ) { strcpy( &buffer[ len - 1 ], " Cory" ); pers->office = malloc( len + 5 ); strcpy( pers->office, &buffer[0] ); } else { if( buffer[ len - 1 ] == EVANS ) { strcpy( &buffer[ len - 1 ], " Evans" ); pers->office = malloc( len + 6 ); strcpy( pers->office, &buffer[0] ); } else { if( buffer[ len - 1 ] == 'L' ) { strcpy( &buffer[ len - 1 ], " LBL" ); pers->office = malloc( len + 4 ); strcpy( pers->office, &buffer[0] ); } else { if( alldigits ) { if( len == 4 ) { pers->officephone = phone(&buffer[0], len); } else { if( (len == 7) || (len == 10) ) { pers->homephone = phone(&buffer[0],len); } } } else { pers->random = malloc( len + 1 ); strcpy( pers->random, &buffer[0] ); } } } } if( *gp++ == COMMA ) { /* office phone, theoretically */ bp = &buffer[ 0 ]; alldigits = 1; while( (*gp != NULL) && (*gp != COMMA) ) { *bp = *gp++; alldigits = alldigits && ('0' <= *bp) && (*bp <= '9'); bp++; } *bp = NULL; len = strlen( &buffer[0] ); if( alldigits ) { if( len != 4 ) { if( (len == 7) || (len == 10) ) { pers->homephone = phone( &buffer[0], len ); } else { pers->random = malloc( len + 1 ); strcpy( pers->random, &buffer[0] ); } } else { pers->officephone = phone( &buffer[0], len ); } } else { pers->random = malloc( len + 1 ); strcpy( pers->random, &buffer[0] ); } if( *gp++ == COMMA ) { /* home phone?? */ bp = &buffer[ 0 ]; alldigits = 1; while( (*gp != NULL) && (*gp != COMMA) ) { *bp = *gp++; alldigits = alldigits && ('0' <= *bp) && (*bp <= '9'); bp++; } *bp = NULL; len = strlen( &buffer[0] ); if( alldigits && ( (len == 7) || (len == 10) ) ) { if( *pers->homephone != NULL ) { pers->officephone = pers->homephone; } pers->homephone = phone( &buffer[0], len ); } else { pers->random = malloc( strlen( &buffer[0] ) + 1 ); strcpy( pers->random, &buffer[0] ); } } } } if( pers->loggedin == 0 ) { findwhen( pers ); } else { findidle( pers ); } } } /* find the last log in of a user by checking the LASTLOG file. * the entry is indexed by the uid, so this can only be done if * the uid is known (which it isn't in quick mode) */ fwopen() { if( ( lf = open(LASTLOG, 0) ) >= 0 ) { llopenerr = 0; } else { fprintf( stderr, "finger: lastlog open error\n" ); llopenerr = 1; } } findwhen( pers ) struct person *pers; { struct passwd *pwdt = pers->pwd; struct lastlog ll; int llsize = sizeof ll; int i; if( !llopenerr ) { lseek( lf, pwdt->pw_uid*llsize, 0 ); if( read( lf, (char *) &ll, llsize ) == llsize ) { for( i = 0; i < LMAX; i++ ) { pers->tty[ i ] = ll.ll_line[ i ]; } pers->tty[ LMAX ] = NULL; pers->loginat = ll.ll_time; } else { fprintf( stderr, "finger: lastlog read error\n" ); pers->tty[ 0 ] = NULL; pers->loginat = 0L; } } else { pers->tty[ 0 ] = NULL; pers->loginat = 0L; } } fwclose() { if( !llopenerr ) { close( lf ); } } /* find the idle time of a user by doing a stat on /dev/histty, * where histty has been gotten from USERLOG, supposedly. */ findidle( pers ) struct person *pers; { struct stat ttystatus; struct passwd *pwdt = pers->pwd; char buffer[ 20 ]; char *TTY = "/dev/"; int TTYLEN = strlen( TTY ); int i; strcpy( &buffer[0], TTY ); i = 0; do { buffer[ TTYLEN + i ] = pers->tty[ i ]; } while( ++i <= LMAX ); if( stat( &buffer[0], &ttystatus ) >= 0 ) { time( &tloc ); if( tloc < ttystatus.st_atime ) { pers->idletime = 0L; } else { pers->idletime = tloc - ttystatus.st_atime; } if( (ttystatus.st_mode & TALKABLE) == TALKABLE ) { pers->writeable = 1; } else { pers->writeable = 0; } } else { fprintf( stderr, "finger: error STATing %s\n", &buffer[0] ); exit( 4 ); } } /* print idle time in short format; this program always prints 4 characters; * if the idle time is zero, it prints 4 blanks. */ stimeprint( dt ) long *dt; { struct tm *gmtime(); struct tm *delta; delta = gmtime( dt ); if( delta->tm_yday == 0 ) { if( delta->tm_hour == 0 ) { if( delta->tm_min >= 10 ) { printf( " %2.2d ", delta->tm_min ); } else { if( delta->tm_min == 0 ) { printf( " " ); } else { printf( " %1.1d ", delta->tm_min ); } } } else { if( delta->tm_hour >= 10 ) { printf( "%3.3d:", delta->tm_hour ); } else { printf( "%1.1d:%02.2d", delta->tm_hour, delta->tm_min ); } } } else { (( printf( "%3dd", delta->tm_yday ); } } /* print idle time in long format with care being taken not to pluralize * 1 minutes or 1 hours or 1 days. */ ltimeprint( dt ) long *dt; { struct tm *gmtime(); struct tm *delta; int printed = 1; delta = gmtime( dt ); if( delta->tm_yday == 0 ) { if( delta->tm_hour == 0 ) { if( delta->tm_min >= 10 ) { printf( "%2d minutes", delta->tm_min ); } else { if( delta->tm_min == 0 ) { if( delta->tm_sec > 10 ) { printf( "%2d seconds", delta->tm_sec ); } else { printed = 0; } } else { if( delta->tm_min == 1 ) { if( delta->tm_sec == 1 ) { printf( "%1d minute %1d second", delta->tm_min, delta->tm_sec ); } else { printf( "%1d minute %d seconds", delta->tm_min, delta->tm_sec ); } } else { if( delta->tm_sec == 1 ) { printf( "%1d minutes %1d second", delta->tm_min, delta->tm_sec ); } else { printf( "%1d minutes %d seconds", delta->tm_min, delta->tm_sec ); } } } } } else { if( delta->tm_hour >= 10 ) { printf( "%2d hours", delta->tm_hour ); } else { if( delta->tm_hour == 1 ) { if( delta->tm_min == 1 ) { printf( "%1d hour %1d minute", delta->tm_hour, delta->tm_min ); } else { printf( "%1d hour %2d minutes", delta->tm_hour, delta->tm_min ); } } else { if( delta->tm_min == 1 ) { printf( "%1d hours %1d minute", delta->tm_hour, delta->tm_min ); } else { printf( "%1d hours %2d minutes", delta->tm_hour, delta->tm_min ); } } } } } else { if( delta->tm_yday >= 10 ) { printf( "%2d days", delta->tm_yday ); } else { if( delta->tm_yday == 1 ) { if( delta->tm_hour == 1 ) { printf( "%1d day %1d hour", delta->tm_yday, delta->tm_hour ); } else { printf( "%1d day %2d hours", delta->tm_yday, delta->tm_hour ); } } else { if( delta->tm_hour == 1 ) { printf( "%1d days %1d hour", delta->tm_yday, delta->tm_hour ); } else { printf( "%1d days %2d hours", delta->tm_yday, delta->tm_hour ); } } } } return( printed ); } matchcmp( gname, login, given ) char *gname; char *login; char *given; { char buffer[ 20 ]; char c; int flag, i, unfound; if( !match ) { return( 0 ); } else { if( namecmp( login, given ) ) { return( 1 ); } else { if( *gname == ASTERISK ) { gname++; } flag = 1; i = 0; unfound = 1; while( unfound ) { if( flag ) { c = *gname++; if( c == SAMENAME ) { flag = 0; c = *login++; } else { unfound = (*gname != COMMA) && (*gname != NULL); } } else { c = *login++; if( c == NULL ) { if( (*gname == COMMA) || (*gname == NULL) ) { break; } else { flag = 1; continue; } } } if( c == BLANK ) { buffer[i++] = NULL; if( namecmp( buffer, given ) ) { return( 1 ); } i = 0; flag = 1; } else { buffer[ i++ ] = c; } } buffer[i++] = NULL; if( namecmp( buffer, given ) ) { return( 1 ); } else { return( 0 ); } } } } namecmp( name1, name2 ) char *name1; char *name2; { char c1, c2; c1 = *name1; if( (('A' <= c1) && (c1 <= 'Z')) || (('a' <= c1) && (c1 <= 'z')) ) { c1 = CAPITALIZE( c1 ); } c2 = *name2; if( (('A' <= c2) && (c2 <= 'Z')) || (('a' <= c2) && (c2 <= 'z')) ) { c2 = CAPITALIZE( c2 ); } while( c1 == c2 ) { if( c1 == NULL ) { return( 1 ); } c1 = *++name1; if( (('A'<=c1) && (c1<='Z')) || (('a'<=c1) && (c1<='z')) ) { c1 = CAPITALIZE( c1 ); } c2 = *++name2; if( (('A'<=c2) && (c2<='Z')) || (('a'<=c2) && (c2<='z')) ) { c2 = CAPITALIZE( c2 ); } } if( *name1 == NULL ) { while( ('0' <= *name2) && (*name2 <= '9') ) { name2++; } if( *name2 == NULL ) { return( 1 ); } } else { if( *name2 == NULL ) { while( ('0' <= *name1) && (*name1 <= '9') ) { name1++; } if( *name1 == NULL ) { return( 1 ); } } } return( 0 ); } char *strsave( s ) char *s; { char *malloc(); char *p; p = malloc( strlen( s ) + 1 ); strcpy( p, s ); } && (c2<='z')) ) { c2 = CAPITALIZE( c2 ); } } if( *name1 == NULL ) { while( ('0' <= *name2) && (*name2 <= '9'cmd/flcopy.c 444 0 33 5122 2424537710 6240 static char *sccsid ="@(#)flcopy.c 4.3 (Berkeley) 10/20/80"; int floppydes; char *flopname = "/dev/floppy"; long dsize = 77 * 26 * 128; int hflag; int rflag; main(argc,argv) register char **argv; { static char buff[512]; register long count; register startad = -26 * 128; register int n, file; register char *cp; while((cp = *++argv), --argc > 0) { if(*cp++!='-') continue; while(*cp) switch(*cp++) { case 'h': hflag++; printf("Halftime!\n"); if((file = open("floppy",0))<0) printf("failed to open floppy image, for reading\n"), exit(1); continue; case 't': if(*cp >= '0' && *cp <= '9') dsize = atoi(cp); else if(argc > 1) { dsize = atoi(*++argv); argc--; } else dsize = 77; if (dsize <= 0 || dsize > 77) printf("Bad number of tracks\n"), exit(2); dsize *= 26 * 128; continue; case 'r': rflag++; } } if(!hflag) { file = creat("floppy",0666); close(file); file = open("floppy",2); if(file < 0) printf("failed to open floppy image"), exit(1); for(count = dsize; count > 0 ; count -= 512) { n = count > 512 ? 512 : count ; lread(startad,n,buff); write(file,buff,n); startad += 512; } } if(rflag) exit(0); printf("Change Floppy, Hit return when done.\n"); gets(buff); lseek(file,0,0); count = dsize; startad = -26 * 128; for( ; count > 0 ; count -= 512) { n = count > 512 ? 512 : count ; read(file,buff,n); lwrite(startad,n,buff); startad += 512; } } rt_init() { static initized = 0; int mode = 2; if(initized) return; if(rflag) mode = 0; initized = 1; if((floppydes = open(flopname,mode)) < 0) { printf("Floppy open failed\n"); exit(1); } } long trans(logical) register int logical; { /* Logical to physical adress translation */ register int sector, bytes, track; logical += 26 * 128; bytes = (logical & 127); logical >>= 7; sector = logical % 26; if(sector >= 13) sector = sector *2 +1; else sector *= 2; sector += 26 + ((track = (logical / 26)) - 1) * 6; sector %= 26; return( (((track *26) + sector) << 7) + bytes); } lread(startad,count,obuff) register startad, count; register char * obuff; { long trans(); extern floppydes; rt_init(); while( (count -= 128) >= 0) { lseek(floppydes, trans(startad), 0); read(floppydes,obuff,128); obuff += 128; startad += 128; } } lwrite(startad,count,obuff) register startad, count; register char * obuff; { long trans(); extern floppydes; rt_init(); while( (count -= 128) >= 0) { lseek(floppydes, trans(startad), 0); write(floppydes,obuff,128); obuff += 128; startad += 128; } } f) register startad, count; register char * obuff; { long trans(); extern floppydes; rt_init(); while( (count -= 128) >= 0) { lseek(floppydes, trans(startad), 0); read(floppydes,obuff,128); obuff += 128; startad += 128; } } lwrite(startad,count,obuff) register startad, count; register char * obuff; { long trans(); extern floppydes; rt_init(); while( (count -= 128) >= 0) { lseek(floppydes, trans(startcmd/fold.c 444 0 33 2501 2416237771 5673 static char *sccsid = "@(#)fold.c 4.1 (Berkeley) 10/1/80"; #include /* * fold - fold long lines for finite output devices * * Bill Joy UCB June 28, 1977 */ int fold = 80; main(argc, argv) int argc; char *argv[]; { register c; FILE *f; char obuf[BUFSIZ]; argc--, argv++; setbuf(stdout, obuf); if (argc > 0 && argv[0][0] == '-') { fold = 0; argv[0]++; while (*argv[0] >= '0' && *argv[0] <= '9') fold =* 10, fold =+ *argv[0]++ - '0'; if (*argv[0]) { printf("Bad number for fold\n"); exit(1); } argc--, argv++; } do { if (argc > 0) { if (freopen(argv[0], "r", stdin) == NULL) { perror(argv[0]); exit(1); } argc--, argv++; } for (;;) { c = getc(stdin); if (c == -1) break; putch(c); } } while (argc > 0); exit(0); } int col; putch(c) register c; { register ncol; switch (c) { case '\n': ncol = 0; break; case '\t': ncol = (col + 8) &~ 7; break; case '\b': ncol = col ? col - 1 : 0; break; case '\r': ncol = 0; break; default: ncol = col + 1; } if (ncol > fold) putchar('\n'), col = 0; putchar(c); switch (c) { case '\n': col = 0; break; case '\t': col =+ 8; col =& ~7; break; case '\b': if (col) col--; break; case '\r': col = 0; break; default: col++; break; } } { register ncol; switch (c) { case '\n': ncol = 0; break; case '\t': ncol = (col + 8) &~ 7; break; case '\b': ncol = col ? col - 1 : 0; break; case '\r': ncol ((cmd/from.c 444 0 33 3342 2416237772 5717 static char *sccsid = "@(#)from.c 4.1 (Berkeley) 10/1/80"; #include #include #include struct passwd *getpwuid(); main(argc, argv) int argc; register char **argv; { char lbuf[BUFSIZ]; char lbuf2[BUFSIZ]; register struct passwd *pp; int stashed = 0; register char *name; char *sender; char *getlogin(); if (argc > 1 && *(argv[1]) == '-' && (*++argv)[1] == 's') { if (--argc <= 1) { fprintf (stderr, "Usage: from [-s sender] [user]\n"); exit (1); } --argc; sender = *++argv; for (name = sender; *name; name++) if (isupper(*name)) *name = tolower(*name); } else sender = NULL; if (chdir("/usr/spool/mail") < 0) exit(1); if (argc > 1) name = argv[1]; else { name = getlogin (); if (name == NULL || strlen(name) == 0) { pp = getpwuid(getuid()); if (pp == NULL) { fprintf(stderr, "Who are you?\n"); exit(1); } name = pp->pw_name; } } if (freopen(name, "r", stdin) == NULL) exit(0); while(fgets(lbuf, sizeof lbuf, stdin) != NULL) if (lbuf[0] == '\n' && stashed) { stashed = 0; printf("%s", lbuf2); } else if (bufcmp(lbuf, "From ", 5) && (sender == NULL || match(&lbuf[4], sender))) { strcpy(lbuf2, lbuf); stashed = 1; } if (stashed) printf("%s", lbuf2); exit(0); } bufcmp (b1, b2, n) register char *b1, *b2; register int n; { while (n-- > 0) if (*b1++ != *b2++) return (0); return (1); } match (line, str) register char *line, *str; { register char ch; while (*line == ' ' || *line == '\t') ++line; if (*line == '\n') return (0); while (*str && *line != ' ' && *line != '\t' && *line != '\n') { ch = isupper(*line) ? tolower(*line) : *line; if (ch != *str++) return (0); line++; } return (*str == '\0'); } ashed) printf("%s", lbuf2); exit(0); } bufcmp (b1, b2, n) register char *b1, *b2; register int n; { while (n-- > 0) if (*b1++ != *b2++) return (0); return (1); } match (line, str) register char *line, *str; { register char ch; while (*line == ' ' || *line == '\t') ++licmd/pstat.c 444 0 33 43703 2552465535 6135 static char *sccsid = "@(#)pstat.c 4.9 (Berkeley) 5/7/81"; /* * Print system stuff */ #define mask(x) (x&0377) #define clear(x) ((int)x&0x7fffffff) #include #include #include #include #include #include #include #include #include #include #include #include #include #define KERNEL #include #undef KERNEL char *fcore = "/dev/kmem"; char *fnlist = "/vmunix"; int fc; struct nlist nl[] = { #define SINODE 0 { "_inode" }, #define STEXT 1 { "_text" }, #define SPROC 2 { "_proc" }, #define SDZ 3 { "_dz_tty" }, #define SNDZ 4 { "_dz_cnt" }, #define SKL 5 { "_cons" }, #define SFIL 6 { "_file" }, #define USRPTMA 7 { "_Usrptmap" }, #define USRPT 8 { "_usrpt" }, #define SNSWAP 9 { "_nswap" }, #define SWAPMAP 10 { "_swapmap" }, #define SDH 11 { "_dh11" }, #define SNDH 12 { "_ndh11" }, #define SGROUP 13 { "_groups" }, #define SCHANS 14 { "_chans" }, #define SSCHANS 15 { "_schans" }, #define SNPROC 16 { "_nproc" }, #define SNTEXT 17 { "_ntext" }, #define SNFILE 18 { "_nfile" }, #define SNINODE 19 { "_ninode" }, #define SNSWAPMAP 20 { "_nswapmap" }, 0, }; int inof; int txtf; int prcf; int ttyf; int usrf; int mpxf; int groupf; long ubase; int filf; int swpf; int totflg; char partab[1]; struct cdevsw cdevsw[1]; struct bdevsw bdevsw[1]; int allflg; int kflg; struct pte *Usrptma; struct pte *usrpt; main(argc, argv) char **argv; { register char *argp; argc--, argv++; while (argc > 0 && **argv == '-') { argp = *argv++; argp++; argc--; while (*argp++) switch (argp[-1]) { case 'T': totflg++; break; case 'a': allflg++; break; case 'i': inof++; break; case 'k': kflg++; fcore = "/vmcore"; break; case 'x': txtf++; break; case 'p': prcf++; break; case 't': ttyf++; break; case 'u': if (argc == 0) break; argc--; usrf++; sscanf( *argv++, "%x", &ubase); break; case 'f': filf++; break; case 's': swpf++; break; case 'm': mpxf++; break; case 'g': groupf++; break; } } if (argc>0) fcore = argv[0]; if ((fc = open(fcore, 0)) < 0) { printf("Can't find %s\n", fcore); exit(1); } if (argc>1) fnlist = argv[1]; nlist(fnlist, nl); usrpt = (struct pte *)nl[USRPT].n_value; Usrptma = (struct pte *)nl[USRPTMA].n_value; if (nl[0].n_type == 0) { printf("no namelist\n"); exit(1); } if (filf||totflg) dofile(); if (inof||totflg) doinode(); if (prcf||totflg) doproc(); if (txtf||totflg) dotext(); if (ttyf) dotty(); if (usrf) dousr(); if (swpf||totflg) doswap(); if (mpxf) dompx(); if (groupf) dogroup(); } doinode() { register struct inode *ip; struct inode *xinode, *ainode; register int nin; int ninode; nin = 0; ninode = getw(nl[SNINODE].n_value); xinode = (struct inode *)calloc(ninode, sizeof (struct inode)); lseek(fc, (int)(ainode = (struct inode *)getw(nl[SINODE].n_value)), 0); read(fc, xinode, ninode * sizeof(struct inode)); for (ip = xinode; ip < &xinode[ninode]; ip++) if (ip->i_count) nin++; if (totflg) { printf("%3d/%3d inodes\n", nin, ninode); return; } printf("%d/%d active inodes\n", nin, ninode); printf(" LOC FLAGS CNT DEVICE INO MODE NLK UID SIZE/DEV\n"); for (ip = xinode; ip < &xinode[ninode]; ip++) { if (ip->i_count == 0) continue; printf("%8.1x ", ainode + (ip - xinode)); putf(ip->i_flag&ILOCK, 'L'); putf(ip->i_flag&IUPD, 'U'); putf(ip->i_flag&IACC, 'A'); putf(ip->i_flag&IMOUNT, 'M'); putf(ip->i_flag&IWANT, 'W'); putf(ip->i_flag&ITEXT, 'T'); printf("%4d", ip->i_count&0377); printf("%4d,%3d", major(ip->i_dev), minor(ip->i_dev)); printf("%6d", ip->i_number); printf("%6x", ip->i_mode & 0xffff); printf("%4d", ip->i_nlink); printf("%4d", ip->i_uid); if ((ip->i_mode&IFMT)==IFBLK || (ip->i_mode&IFMT)==IFCHR) printf("%6d,%3d", major(ip->i_un.i_rdev), minor(ip->i_un.i_rdev)); else printf("%10ld", ip->i_size); printf("\n"); } free(xinode); } getw(loc) off_t loc; { int word; if (kflg) loc &= 0x7fffffff; lseek(fc, loc, 0); read(fc, &word, sizeof (word)); if (kflg) word &= 0x7fffffff; return (word); } putf(v, n) { if (v) printf("%c", n); else printf(" "); } dotext() { register struct text *xp; int ntext; struct text *xtext, *atext; int ntx; ntx = 0; ntext = getw(nl[SNTEXT].n_value); xtext = (struct text *)calloc(ntext, sizeof (struct text)); lseek(fc, (int)(atext = (struct text *)getw(nl[STEXT].n_value)), 0); read(fc, xtext, ntext * sizeof (struct text)); for (xp = xtext; xp < &xtext[ntext]; xp++) if (xp->x_iptr!=NULL) ntx++; if (totflg) { printf("%3d/%3d texts\n", ntx, ntext); return; } printf("%d/%d active texts\n", ntx, ntext); printf(" LOC FLAGS DADDR CADDR RSS SIZE IPTR CNT CCNT\n"); for (xp = xtext; xp < &xtext[ntext]; xp++) { if (xp->x_iptr == NULL) continue; printf("%8.1x", atext + (xp - xtext)); printf(" "); putf(xp->x_flag&XPAGI, 'P'); putf(xp->x_flag&XTRC, 'T'); putf(xp->x_flag&XWRIT, 'W'); putf(xp->x_flag&XLOAD, 'L'); putf(xp->x_flag&XLOCK, 'K'); putf(xp->x_flag&XWANT, 'w'); printf("%5x", xp->x_daddr[0]); printf("%11x", xp->x_caddr); printf("%5d", xp->x_rssize); printf("%5d", xp->x_size); printf("%10.1x", xp->x_iptr); printf("%5d", xp->x_count&0377); printf("%5d", xp->x_ccount); printf("\n"); } free(xtext); } doproc() { struct proc *xproc, *aproc; int nproc; register struct proc *pp; register loc, np; struct pte apte; nproc = getw(nl[SNPROC].n_value); xproc = (struct proc *)calloc(nproc, sizeof (struct proc)); lseek(fc, (int)(aproc = (struct proc *)getw(nl[SPROC].n_value)), 0); read(fc, xproc, nproc * sizeof (struct proc)); np = 0; for (pp=xproc; pp < &xproc[nproc]; pp++) if (pp->p_stat) np++; if (totflg) { printf("%3d/%3d processes\n", np, nproc); return; } printf("%d/%d processes\n", np, nproc); printf(" LOC S F POIP PRI SIG UID SLP TIM CPU NI PGRP PID PPID ADDR RSS SRSS SIZE WCHAN LINK TEXTP CLKT\n"); for (pp=xproc; pp<&xproc[nproc]; pp++) { if (pp->p_stat==0 && allflg==0) continue; printf("%8x", aproc + (pp - xproc)); printf(" %2d", pp->p_stat); printf(" %4x", pp->p_flag & 0xffff); printf(" %4d", pp->p_poip); printf(" %3d", pp->p_pri); printf(" %8x", pp->p_sig); printf(" %4d", pp->p_uid); printf(" %3d", pp->p_slptime); printf(" %3d", pp->p_time); printf(" %4d", pp->p_cpu&0377); printf(" %3d", pp->p_nice); printf(" %6d", pp->p_pgrp); printf(" %6d", pp->p_pid); printf(" %6d", pp->p_ppid); if (kflg) pp->p_addr = (struct pte *)clear((int)pp->p_addr); lseek(fc, (long)(Usrptma+btokmx(pp->p_addr)), 0); read(fc, &apte, sizeof(apte)); printf(" %8x", ctob(apte.pg_pfnum+1) - sizeof(struct pte) * UPAGES); printf(" %4x", pp->p_rssize); printf(" %4x", pp->p_swrss); printf(" %5x", pp->p_dsize+pp->p_ssize); printf(" %7x", clear(pp->p_wchan)); printf(" %7x", clear(pp->p_link)); printf(" %7x", clear(pp->p_textp)); p((rintf(" %u", pp->p_clktim); printf("\n"); } } dotty() { struct tty dz_tty[64]; int ndz; register struct tty *tp; register char *mesg; printf("1 cons\n"); if (kflg) nl[SKL].n_value = clear(nl[SKL].n_value); lseek(fc, (long)nl[SKL].n_value, 0); read(fc, dz_tty, sizeof(dz_tty[0])); mesg = " # RAW CAN OUT MODE ADDR DEL COL STATE PGRP DISC\n"; printf(mesg); ttyprt(&dz_tty[0], 0); if (nl[SNDZ].n_type == 0) goto dh; if (kflg) { nl[SNDZ].n_value = clear(nl[SNDZ].n_value); nl[SDZ].n_value = clear(nl[SDZ].n_value); } lseek(fc, (long)nl[SNDZ].n_value, 0); read(fc, &ndz, sizeof(ndz)); printf("%d dz lines\n", ndz); lseek(fc, (long)nl[SDZ].n_value, 0); read(fc, dz_tty, sizeof(dz_tty)); for (tp = dz_tty; tp < &dz_tty[ndz]; tp++) ttyprt(tp, tp - dz_tty); dh: if (nl[SNDH].n_type == 0) return; if (kflg) { nl[SNDH].n_value = clear(nl[SNDH].n_value); nl[SDH].n_value = clear(nl[SDH].n_value); } lseek(fc, (long)nl[SNDH].n_value, 0); read(fc, &ndz, sizeof(ndz)); printf("%d dh lines\n", ndz); lseek(fc, (long)nl[SDH].n_value, 0); read(fc, dz_tty, sizeof(dz_tty)); for (tp = dz_tty; tp < &dz_tty[ndz]; tp++) ttyprt(tp, tp - dz_tty); } ttyprt(atp, line) struct tty *atp; { register struct tty *tp; printf("%2d", line); tp = atp; switch (tp->t_line) { case NETLDISC: if (tp->t_rec) printf("%4d%4d", 0, tp->t_inbuf); else printf("%4d%4d", tp->t_inbuf, 0); break; default: printf("%4d", tp->t_rawq.c_cc); printf("%4d", tp->t_canq.c_cc); } printf("%4d", tp->t_outq.c_cc); printf("%8.1o", tp->t_flags); printf(" %8.1x", tp->t_addr); printf("%3d", tp->t_delct); printf("%4d ", tp->t_col); putf(tp->t_state&TIMEOUT, 'T'); putf(tp->t_state&WOPEN, 'W'); putf(tp->t_state&ISOPEN, 'O'); putf(tp->t_state&CARR_ON, 'C'); putf(tp->t_state&BUSY, 'B'); putf(tp->t_state&ASLEEP, 'A'); putf(tp->t_state&XCLUDE, 'X'); /* putf(tp->t_state&HUPCLS, 'H'); */ printf("%6d", tp->t_pgrp); switch (tp->t_line) { case NTTYDISC: printf(" ntty"); break; case NETLDISC: printf(" net"); break; } printf("\n"); } dousr() { struct user U; register i, j, *ip; /* This wins only if PAGSIZ > sizeof (struct user) */ lseek(fc, ubase * NBPG, 0); read(fc, &U, sizeof(U)); printf("pcb"); ip = (int *)&U.u_pcb; while (ip < &U.u_arg[0]) { if ((ip - (int *)&U.u_pcb) % 4 == 0) printf("\t"); printf("%x ", *ip++); if ((ip - (int *)&U.u_pcb) % 4 == 0) printf("\n"); } if ((ip - (int *)&U.u_pcb) % 4 != 0) printf("\n"); printf("arg\t"); for (i=0; i<5; i++) printf(" %.1x", U.u_arg[i]); printf("\n"); for (i=0; if_count) nf++; if (totflg) { printf("%3d/%3d files\n", nf, nfile); return; } printf("%d/%d open files\n", nf, nfile); printf(" LOC FLG CNT INO OFFS\n"); for (fp=xfile,loc=nl[SFIL].n_value; fp < &xfile[nfile]; fp++,loc+=sizeof(xfile[0])) { if (fp->f_count==0) continue; printf("%8x ", loc); putf(fp->f_flag&FREAD, 'R'); putf(fp->f_flag&FWRITE, 'W'); putf(fp->f_flag&FPIPE, 'P'); printf("%4d", mask(fp->f_count)); printf("%9.1x", fp->f_inode); printf(" %ld\n", fp->f_un.f_offset); } } doswap() { struct proc *proc; int nproc; struct text *xtext; int ntext; struct map *swapmap; int nswapmap; register struct proc *pp; int nswap, used, tused, free; register struct mapent *me; register struct text *xp; nproc = getw(nl[SNPROC].n_value); proc = (struct proc *)calloc(nproc, sizeof (struct proc)); lseek(fc, getw(nl[SPROC].n_value), 0); read(fc, proc, nproc * sizeof (struct proc)); nswapmap = getw(nl[SNSWAPMAP].n_value); swapmap = (struct map *)calloc(nswapmap, sizeof (struct map)); lseek(fc, getw(nl[SWAPMAP].n_value), 0); read(fc, swapmap, nswapmap * sizeof (struct map)); nswap = getw(nl[SNSWAP].n_value); free = 0; for (me = (struct mapent *)(swapmap+1); me < (struct mapent *)&swapmap[nswapmap]; me++) free += me->m_size; ntext = getw(nl[SNTEXT].n_value); xtext = (struct text *)calloc(ntext, sizeof (struct text)); lseek(fc, getw(nl[STEXT].n_value), 0); read(fc, xtext, ntext * sizeof (struct text)); tused = 0; for (xp = xtext; xp < &xtext[ntext]; xp++) if (xp->x_iptr!=NULL) tused += xdsize(xp); used = tused; for (pp = proc; pp < &proc[nproc]; pp++) { if (pp->p_stat == 0 || pp->p_stat == SZOMB) continue; if (pp->p_flag & SSYS) continue; used += up(pp->p_dsize) + up(pp->p_ssize); if ((pp->p_flag&SLOAD) == 0) used += vusize(pp); } /* a DMMAX/2 block goes to argmap */ if (totflg) { printf("%3d/%3d 00k swap\n", used/2/100, (used+free)/2/100); return; } printf("%d used (%d text), %d free, %d missing\n", used/2, tused/2, free/2, (nswap - DMMAX/2 - (used + free))/2); } up(size) register int size; { register int i, block; i = 0; block = DMMIN; while (i < size) { i += block; if (block < DMMAX) block *= 2; } return (i); } vusize(p) struct proc *p; { register int tsz = p->p_tsize / NPTEPG; return (clrnd(UPAGES + clrnd(ctopt(p->p_tsize+p->p_dsize+p->p_ssize+UPAGES)) - tsz)); } xdsize(xp) struct text *xp; { if (xp->x_flag & XPAGI) return (clrnd(xp->x_size + ctopt(xp->x_size))); return (xp->x_size); } dompx() { register int i; struct chan chans[NCHANS]; struct schan schans[NPORTS]; lseek(fc, (long)nl[SCHANS].n_value, 0); read(fc, chans, sizeof chans); lseek(fc, (long)nl[SSCHANS].n_value, 0); read(fc, schans, sizeof schans); printf("CHAN FLAGS INDEX LINE GROUP FILE TTYP CTLX PGRP OTTYP OLINE DATQ CTLY\n"); for (i = 0; i < NCHANS; i++) { printf("%3d ", i); putf(chans[i].c_flags&INUSE, 'I'); putf(chans[i].c_flags&SIOCTL, 'S'); putf(chans[i].c_flags&XGRP, 'X'); putf(chans[i].c_flags&YGRP, 'Y'); putf(chans[i].c_flags&WCLOSE, 'W'); putf(chans[i].c_flags&ISGRP, 'i'); putf(chans[i].c_flags&BLOCK, 'B'); putf(chans[i].c_flags&EOTMARK, 'E'); putf(chans[i].c_flags&SIGBLK, 's'); putf(chans[i].c_flags&BLKMSG, 'b'); putf(chans[i].c_flags&ENAMSG, 'e'); putf(chans[i].c_flags&WFLUSH, 'w'); putf(chans[i].c_flags&NMBUF, 'N'); putf(chans[i].c_flags&PORT, 'P'); putf(chans[i].c_flags&ALT, 'A'); putf(chans[i].c_flags&FBLOCK, 'F'); printf("%8x ", chans[i].c_index); printf("%3d ", chans[i].c_line); printf("%8x ", chans[i].c_group); printf("%8x ", chans[i].c_fy); printf("%8x ", chans[i].c_ttyp); printf("%8x ", chans[i].c_ctlx); printf("%6d ", chans[i].c_pgrp); printf("%8x ", chans[i].c_ottyp); printf("%3d ", chans[i].c_oline); printf("%8x ", chans[i].cx.datq); printf("%8x\n", chans[i].c_ctly); } printf("\nCHAN FLAGS INDEX LINE GROUP FILE TTYP CTLX PGRP\n"); for (i = 0; i < NPORTS; i++) { printf("%3d ", i); putf(schans[i].c_flags&INUSE, 'I'); putf(schans[i].c_flags&SIOCTL, 'S'); putf(schans[i].c_flags&XGRP, 'X'); putf(schans[i].c_flags&YGRP, 'Y'); putf(schans[i].c_flags&WCLOSE, 'W'); putf(schans[i].c_flags&ISGRP, 'i'); putf(schans[i].c_flags&BLOCK, 'B'); putf(schans[i].c_flags&EOTMARK, 'E'); putf(schans[i].c_flags&SIGBLK, 's'); putf(schans[i].c_flags&BLKMSG, 'b'); putf(schans[i].c_flags&ENAMSG, 'e'); putf(schans[i].c_flags&WFLUSH, 'w'); putf(schans[i].c_flags&NMBUF, 'N'); putf(schans[i].c_flags&PORT, 'P'); putf(schans[i].((c_flags&ALT, 'A'); putf(schans[i].c_flags&FBLOCK, 'F'); printf("%8x ", schans[i].c_index); printf("%3d ", schans[i].c_line); printf("%8x ", schans[i].c_group); printf("%8x ", schans[i].c_fy); printf("%8x ", schans[i].c_ttyp); printf("%8x ", schans[i].c_ctlx); printf("%6d\n", schans[i].c_pgrp); } } dogroup() { register int i, j; struct group *groups[NGROUPS]; struct group g; lseek(fc, (long)nl[SGROUP].n_value, 0); read(fc, groups, sizeof groups); printf("GROUP STATE INDEX ROT *GROUP *INODE *FILE ROTM DATQ\n"); for (i = 0; i < NGROUPS; i++) { if (groups[i] == 0) continue; lseek(fc, (long) groups[i], 0); read(fc, &g, sizeof g); printf("%3d ", i); printf("%8x ", g.g_state); printf("%8x ", g.g_index); printf("%3d ", g.g_rot); printf("%8x ", g.g_group); printf("%8x ", g.g_inode); printf("%8x ", g.g_file); printf("%3d ", g.g_rotmask); printf("%3d\n", g.g_datq); } } d(fc, groups, sizeof groups); printf("GROUP STATE INDEXcmd/getNAME.c 444 0 33 3174 2416240006 6157 static char *sccsid = "@(#)getNAME.c 4.1 (Berkeley) 10/1/80"; #include int tocrc; main(argc, argv) int argc; char *argv[]; { argc--, argv++; if (!strcmp(argv[0], "-t")) argc--, argv++, tocrc++; while (argc > 0) getfrom(*argv++), argc--; exit(0); } getfrom(name) char *name; { char headbuf[BUFSIZ]; char linbuf[BUFSIZ]; register char *cp; int i = 0; if (freopen(name, "r", stdin) == 0) { perror(name); exit(1); } for (;;) { if (fgets(headbuf, sizeof headbuf, stdin) == NULL) return; if (headbuf[0] != '.') continue; if (headbuf[1] == 'T' && headbuf[2] == 'H') break; if (headbuf[1] == 't' && headbuf[2] == 'h') break; } for (;;) { if (fgets(linbuf, sizeof linbuf, stdin) == NULL) return; if (linbuf[0] != '.') continue; if (linbuf[1] == 'S' && linbuf[2] == 'H') break; if (linbuf[1] == 's' && linbuf[2] == 'h') break; } trimln(headbuf); if (tocrc) { register char *dp = name, *ep; again: while (*dp && *dp != '.') putchar(*dp++); if (*dp) for (ep = dp+1; *ep; ep++) if (*ep == '.') { putchar(*dp++); goto again; } putchar('('); if (*dp) dp++; while (*dp) putchar (*dp++); putchar(')'); putchar(' '); } printf("%s\t", headbuf); for (;;) { if (fgets(linbuf, sizeof linbuf, stdin) == NULL) break; if (linbuf[0] == '.') { if (linbuf[1] == 'S' && linbuf[2] == 'H') break; if (linbuf[1] == 's' && linbuf[2] == 'h') break; } trimln(linbuf); if (i != 0) printf(" "); i++; printf("%s", linbuf); } printf("\n"); } trimln(cp) register char *cp; { while (*cp) cp++; if (*--cp == '\n') *cp = 0; } *dp) dp++; while (*dp) putchar (*dp++); putchar(')'); putchar(' '); } printf("%s\t", headbuf); for (;;) { if (fgets(linbuf, sizeof linbuf, stdin) == NULL) break; if (linbuf[0] == '.') { if (linbuf[1] == 'S' && linbuf[2] == 'H') break; if (linbuf[1] == 's' && linbuf[2] == 'h') break; } trimln(linbuf); if (i != 0) printf(" "); i++; printf(cmd/gets.c 444 0 33 750 2544216561 5671 static char *sccsid = "@(#)gets.c 4.2 (Berkeley) 6/19/81"; #include /* * gets [ default ] * * read a line from standard input, echoing to std output * if an error occurs just return "default" * if no default and error exit abnormally */ main(argc, argv) int argc; char *argv[]; { char buf[BUFSIZ]; setbuf(stdin, NULL); if (gets(buf) == NULL || buf[0] < ' ') { if (argc == 1) exit(1); strcpy(buf,argv[1]); } printf("%s\n", buf); exit(0); } ,\D"cmd/last.c 444 0 33 6607 2477653033 5725 static char *sccsid = "@(#)last.c 4.3 (Berkeley) 2/28/81"; /* * last */ #include #include #include #include #include #define NMAX sizeof(buf[0].ut_name) #define LMAX sizeof(buf[0].ut_line) #define SECDAY (24*60*60) #define lineq(a,b) (!strncmp(a,b,LMAX)) #define nameq(a,b) (!strncmp(a,b,NMAX)) #define MAXTTYS 256 char **argv; int argc; struct utmp buf[128]; char ttnames[MAXTTYS][LMAX+1]; long logouts[MAXTTYS]; char *ctime(), *strspl(); int onintr(); main(ac, av) char **av; { register int i, k; int bl, wtmp; char *ct; register struct utmp *bp; long otime; struct stat stb; int print; char * crmsg = (char *)0; long crtime; time(&buf[0].ut_time); ac--, av++; argc = ac; argv = av; for (i = 0; i < argc; i++) { if (strlen(argv[i])>2) continue; if (!strcmp(argv[i], "~")) continue; if (getpwnam(argv[i])) continue; argv[i] = strspl("tty", argv[i]); } wtmp = open("/usr/adm/wtmp", 0); if (wtmp < 0) { perror("/usr/adm/wtmp"); exit(1); } fstat(wtmp, &stb); bl = (stb.st_size + sizeof (buf)-1) / sizeof (buf); if (signal(SIGINT, SIG_IGN) != SIG_IGN) { signal(SIGINT, onintr); signal(SIGQUIT, onintr); } for (bl--; bl >= 0; bl--) { lseek(wtmp, bl * sizeof (buf), 0); bp = &buf[read(wtmp, buf, sizeof (buf)) / sizeof(buf[0]) - 1]; for ( ; bp >= buf; bp--) { print = want(bp); if (print) { ct = ctime(&bp->ut_time); printf("%-*.*s %-*.*s %10.10s %5.5s ", NMAX, NMAX, bp->ut_name, LMAX, LMAX, bp->ut_line, ct, 11+ct); } for (i = 0; i < MAXTTYS; i++) { if (ttnames[i][0] == 0) { strncpy(ttnames[i], bp->ut_line, sizeof(bp->ut_line)); otime = logouts[i]; logouts[i] = bp->ut_time; break; } if (lineq(ttnames[i], bp->ut_line)) { otime = logouts[i]; logouts[i] = bp->ut_time; break; } } if (print) { if (otime == 0) printf(" still logged in\n"); else { long delta; if (otime < 0) { otime = -otime; printf("- %s", crmsg); } else printf("- %5.5s", ctime(&otime)+11); delta = otime - bp->ut_time; if (delta < SECDAY) printf(" (%5.5s)\n", asctime(gmtime(&delta))+11); else printf(" (%ld+%5.5s)\n", delta / SECDAY, asctime(gmtime(&delta))+11); } fflush(stdout); } if (lineq(bp->ut_line, "~")) { for (i = 0; i < MAXTTYS; i++) logouts[i] = -bp->ut_time; if (nameq(bp->ut_name, "shutdown")) crmsg = "down "; else crmsg = "crash"; } } } ct = ctime(&buf[0].ut_time); printf("\nwtmp begins %10.10s %5.5s \n", ct, ct + 11); exit(0); } onintr(signo) int signo; { char *ct; if (signo == SIGQUIT) signal(SIGQUIT, onintr); ct = ctime(&buf[0].ut_time); printf("\ninterrupted %10.10s %5.5s \n", ct, ct + 11); if (signo == SIGINT) exit(1); } want(bp) struct utmp *bp; { register char **av; register int ac; if (bp->ut_line[0] == '~' && bp->ut_name[0] == '\0') strcpy(bp->ut_name, "reboot"); /* bandaid */ if (bp->ut_name[0] == 0) return (0); if (argc == 0) return (1); av = argv; for (ac = 0; ac < argc; ac++) { if (nameq(*av, bp->ut_name) || lineq(*av, bp->ut_line)) return (1); av++; } return (0); } char * strspl(left, right) char *left, *right; { char *res = (char *)malloc(strlen(left)+strlen(right)+1); strcpy(res, left); strcat(res, right); return (res); } r **av; register int ac; if (bp->ut_line[0] == '~' && bp->ut_name[0] == '\0') strcpy(bp->ut_name, "reboot"); /* bancmd/head.c 444 0 33 2431 2416240011 5627 static char *sccsid = "@(#)head.c 4.1 (Berkeley) 10/1/80"; #include /* * head - give the first few lines of a stream or of each of a set of files * * Bill Joy UCB August 24, 1977 */ int linecnt = 10; int argc; main(Argc, argv) int Argc; char *argv[]; { register int argc; char *name; register char *argp; static int around; char obuf[BUFSIZ]; setbuf(stdout, obuf); Argc--, argv++; argc = Argc; do { while (argc > 0 && argv[0][0] == '-') { linecnt = getnum(argv[0] + 1); argc--, argv++, Argc--; } if (argc == 0 && around) break; if (argc > 0) { close(0); if (freopen(argv[0], "r", stdin) == NULL) { perror(argv[0]); exit(1); } name = argv[0]; argc--, argv++; } else name = 0; if (around) putchar('\n'); around++; if (Argc > 1 && name) printf("==> %s <==\n", name); copyout(linecnt); fflush(stdout); } while (argc > 0); } copyout(cnt) register int cnt; { register int c; char lbuf[BUFSIZ]; while (cnt > 0 && fgets(lbuf, sizeof lbu((f, stdin) != 0) { printf("%s", lbuf); fflush(stdout); cnt--; } } getnum(cp) register char *cp; { register int i; for (i = 0; *cp >= '0' && *cp <= '9'; cp++) i *= 10, i += *cp - '0'; if (*cp) { fprintf(stderr, "Badly formed number\n"); exit(1); } return (i); } if (Argc > 1 && name) printf("==> %s <==\n", name); copyout(linecnt); fflush(stdout); } while (argc > 0); } copyout(cnt) register int cnt; { register int c; char lbuf[BUFSIZ]; while (cnt > 0 && fgets(lbuf, sizeof lbucmd/icheck.c 444 0 33 17334 2470650061 6216 static char *sccsid = "@(#)icheck.c 4.2 (Berkeley) 81/02/07"; #define NI 16 #define NB 500 #define BITS 8 #define MAXFN 500 #ifndef STANDALONE #include #endif #include #include #include #include #include struct filsys sblock; struct dinode itab[INOPB*NI]; daddr_t iaddr[NADDR]; daddr_t blist[NB]; char *bmap; int sflg; int mflg; int dflg; int fi; ino_t ino; ino_t nrfile; ino_t ndfile; ino_t nbfile; ino_t ncfile; daddr_t ndirect; daddr_t nindir; daddr_t niindir; daddr_t niiindir; daddr_t nfree; daddr_t ndup; int nerror; long atol(); daddr_t alloc(); #ifndef STANDALONE char *malloc(); #endif main(argc, argv) char *argv[]; { register i; long n; blist[0] = -1; #ifndef STANDALONE while (--argc) { argv++; if (**argv=='-') switch ((*argv)[1]) { case 'd': dflg++; continue; case 'm': mflg++; continue; case 's': sflg++; continue; case 'b': for(i=0; i= mino) break; bread((daddr_t)i, (char *)itab, sizeof(itab)); for(j=0; j= mino) break; ino++; pass1(&itab[j]); } } ino = 0; #ifndef STANDALONE sync(); #endif i = sblock.s_tinode; bread((daddr_t)1, (char *)&sblock, sizeof(sblock)); sblock.s_tinode = i; if (sflg) { makefree(); close(fi); #ifndef STANDALONE if (bmap) free(bmap); #endif return; } nfree = 0; while(n = alloc()) { if (chk(n, "free")) break; nfree++; } close(fi); #ifndef STANDALONE if (bmap) free(bmap); #endif i = nrfile + ndfile + ncfile + nbfile; #ifndef STANDALONE printf("files %6u (r=%u,d=%u,b=%u,c=%u)\n", i, nrfile, ndfile, nbfile, ncfile); #else printf("files %u (r=%u,d=%u,b=%u,c=%u)\n", i, nrfile, ndfile, nbfile, ncfile); #endif n = ndirect + nindir + niindir + niiindir; #ifdef STANDALONE printf("used %ld (i=%ld,ii=%ld,iii=%ld,d=%ld)\n", n, nindir, niindir, niiindir, ndirect); printf("free %ld\n", nfree); #else printf("used %7ld (i=%ld,ii=%ld,iii=%ld,d=%ld)\n", n, nindir, niindir, niiindir, ndirect); printf("free %7ld\n", nfree); #endif if(!dflg) { n = 0; for(d=(int)sblock.s_isize; ddi_mode & IFMT; if(i == 0) { sblock.s_tinode++; return; } if(i == IFCHR) { ncfile++; return; } if(i == IFBLK) { nbfile++; return; } if(i == IFDIR) ndfile++; else if(i == IFREG) nrfile++; else { printf("bad mode %u\n", ino); return; } l3tol(iaddr, ip->di_addr, NADDR); for(i=0; i=sblock.s_fsize) { printf("%ld bad; inode=%u, class=%s\n", bno, ino, s); return(1); } if(duped(bno)) { printf("%ld dup; inode=%u, class=%s\n", bno, ino, s); ndup++; } for (n=0; blist[n] != -1; n++) if (bno == blist[n]) printf("%ld arg; inode=%u, class=%s\n", bno, ino, s); return(0); } duped(bno) daddr_t bno; { daddr_t d; register m, n; if(dflg) return(0); d = bno - (int)sblock.s_isize; m = 1 << (d%BITS); n = (d/BITS); if(bmap[n] & m) return(1); bmap[n] |= m; return(0); } daddr_t alloc() { int i; daddr_t bno; union { char data[BSIZE]; struct fblk fb; } buf; sblock.s_tfree--; if (sblock.s_nfree<=0) return(0); if (sblock.s_nfree>NICFREE) { printf("Bad free list, s.b. count = %d\n", sblock.s_nfree); return(0); } bno = sblock.s_free[--sblock.s_nfree]; sblock.s_free[sblock.s_nfree] = (daddr_t)0; if(bno == 0) return(bno); if(sblock.s_nfree <= 0) { bread(bno, buf.data, BSIZE); sblock.s_nfree = buf.df_nfree; if (sblock.s_nfree<0 || sblock.s_nfree>NICFREE) { printf("Bad free list, entry count of block %ld = %d\n", bno, sblock.s_nfree); sblock.s_nfree = 0; return(0); } for(i=0; i= NICFREE) { for(i=0; i MAXFN) n = MAXFN; sblock.s_n = n; m = sblock.s_m; if(m <= 0 || m > sblock.s_n) m = 3; sblock.s_m = m; for(i=0; i 0; d -= sblock.s_n) for(i=0; i= (int)sblock.s_isize) if(!duped(f)) bfree(f); } bwrite((daddr_t)1, (char *)&sblock); #ifndef STANDALONE sync(); #endif return; } .s_nfree = 0; sblock.s_ninode = 0; sblock.s_flock = 0; sblock.s_ilock = 0; sblock.s_fmod = 0; sblock.s_ronly = 0; #ifndef STANDALONE time(&sblock.s_time); #endif sblock.s_tfree = 0; bfree((daddr_t)0); d = sblock.s_fsize-1; while(d%sblock.s_n) d++; for(; d > 0; d -= sblock.s_n) cmd/install.sh 755 0 33 376 2520560203 6563 cmd=/bin/mv case $1 in -s ) /bin/strip $2 shift ;; -c ) cmd=cp shift esac if [ ! ${2-""} ] then echo 'install : no destination specified.' exit 1 fi $cmd $1 $2 if [ -d $2 ] then file=$2/$1 else file=$2 fi chmod 755 $file /etc/chown root $file ; sblock.s_flock = 0; sblock.s_ilock = 0; sblock.s_fmod = 0; sblock.s_ronly = 0; #ifndef STANDALONE time(&sblock.s_time); #endif sblock.s_tfree = 0; bfree((da/( ,( 5< /\@,\D"((cmd/ctags.c 444 0 33 31435 2440117252 6064 static char *sccsid = "@(#)ctags.c 4.3 (Berkeley) 11/24/80"; #include #include /* * ctags: create a tags file */ #define reg register #define logical char #define TRUE (1) #define FALSE (0) #define iswhite(arg) (_wht[arg]) /* T if char is white */ #define begtoken(arg) (_btk[arg]) /* T if char can start token */ #define intoken(arg) (_itk[arg]) /* T if char can be in token */ #define endtoken(arg) (_etk[arg]) /* T if char ends tokens */ #define isgood(arg) (_gd[arg]) /* T if char can be after ')' */ #define max(I1,I2) (I1 > I2 ? I1 : I2) struct nd_st { /* sorting structure */ char *func; /* function name */ char *file; /* file name */ int lno; /* for -x option */ char *pat; /* search pattern */ logical been_warned; /* set if noticed dup */ struct nd_st *left,*right; /* left and right sons */ }; long ftell(); typedef struct nd_st NODE; logical number, /* T if on line starting with # */ term = FALSE, /* T if print on terminal */ makefile= TRUE, /* T if to creat "tags" file */ gotone, /* found a func already on line */ /* boolean "func" (see init) */ _wht[0177],_etk[0177],_itk[0177],_btk[0177],_gd[0177]; char searchar = '?'; /* use ?...? searches */ int lineno; /* line number of current line */ char line[4*BUFSIZ], /* current input line */ *curfile, /* current input file name */ *outfile= "tags", /* output file */ *white = " \f\t\n", /* white chars */ *endtk = " \t\n\"'#()[]{}=-+%*/&|^~!<>;,.:?", /* token ending chars */ *begtk = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz", /* token starting chars */ *intk = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz0123456789", /* valid in-token chars */ *notgd = ",;"; /* non-valid after-function chars */ int file_num; /* current file number */ int aflag; /* -a: append to tags */ int uflag; /* -u: update tags */ int wflag; /* -w: suppress warnings */ int vflag; /* -v: create vgrind style index output */ int xflag; /* -x: create cxref style output */ char lbuf[BUFSIZ]; FILE *inf, /* ioptr for current input file */ *outf; /* ioptr for tags file */ long lineftell; /* ftell after getc( inf ) == '\n' */ NODE *head; /* the head of the sorted binary tree */ char *savestr(); char *rindex(); main(ac,av) int ac; char *av[]; { char cmd[100]; int i; while (ac > 1 && av[1][0] == '-') { for (i=1; av[1][i]; i++) { switch(av[1][i]) { case 'a': aflag++; break; case 'u': uflag++; break; case 'w': wflag++; break; case 'v': vflag++; xflag++; break; case 'x': xflag++; break; default: goto usage; } } ac--; av++; } if (ac <= 1) { usage: printf("Usage: ctags [-au] file ...\n"); exit(1); } init(); /* set up boolean "functions" */ /* * loop through files finding functions */ for (file_num = 1; file_num < ac; file_num++) find_funcs(av[file_num]); if (xflag) { put_funcs(head); exit(0); } if (uflag) { for (i=1; i%s;rm OTAGS", outfile, av[i], outfile); system(cmd); } aflag++; } outf = fopen(outfile, aflag ? "a" : "w"); if (outf == NULL) { perror(outfile); exit(1); } put_funcs(head); fclose(outf); if (uflag) { sprintf(cmd, "sort %s -o %s", outfile, outfile); system(cmd); } exit(0); } /* * This routine sets up the boolean psuedo-functions which work * by seting boolean flags dependent upon the corresponding character * Every char which is NOT in that string is not a white char. Therefore, * all of the array "_wht" is set to FALSE, and then the elements * subscripted by the chars in "white" are set to TRUE. Thus "_wht" * of a char is TRUE if it is the string "white", else FALSE. */ init() { reg char *sp; reg int i; for (i = 0; i < 0177; i++) { _wht[i] = _etk[i] = _itk[i] = _btk[i] = FALSE; _gd[i] = TRUE; } for (sp = white; *sp; sp++) _wht[*sp] = TRUE; for (sp = endtk; *sp; sp++) _etk[*sp] = TRUE; for (sp = intk; *sp; sp++) _itk[*sp] = TRUE; for (sp = begtk; *sp; sp++) _btk[*sp] = TRUE; for (sp = notgd; *sp; sp++) _gd[*sp] = FALSE; } /* * This routine opens the specified file and calls the function * which finds the function definitions. */ find_funcs(file) char *file; { char *cp; if ((inf=fopen(file,"r")) == NULL) { perror(file); return; } curfile = savestr(file); cp = rindex(file, '.'); if (cp && (cp[1] != 'c' || cp[1] != 'h') && cp[2] == 0) { if (PF_funcs(inf) == 0) { rewind(inf); C_funcs(); } } else C_funcs(); fclose(inf); } pfnote(name, ln) char *name; { register char *fp; register NODE *np; char nbuf[BUFSIZ]; if ((np = (NODE *) malloc(sizeof (NODE))) == NULL) { fprintf(stderr, "ctags: too many functions to sort\n"); put_funcs(head); free_tree(head); head = np = (NODE *) malloc(sizeof (NODE)); } if (xflag == 0 && !strcmp(name, "main")) { fp = rindex(curfile, '/'); if (fp == 0) fp = curfile; else fp++; sprintf(nbuf, "M%s", fp); fp = rindex(nbuf, '.'); if (fp && fp[2] == 0) *fp = 0; name = nbuf; } np->func = savestr(name); np->file = curfile; np->lno = ln; np->left = np->right = 0; if (xflag == 0) { lbuf[50] = 0; strcat(lbuf, "$"); lbuf[50] = 0; } np->pat = savestr(lbuf); if (head == NULL) head = np; else add_node(np, head); } /* * This routine finds functions in C syntax and adds them * to the list. */ C_funcs() { register int c; register char *token, *tp; int incomm, inquote, inchar, midtoken, level; char *sp; char tok[BUFSIZ]; lineno = 1; number = gotone = midtoken = inquote = inchar = incomm = FALSE; level = 0; sp = tp = token = line; for (;;) { *sp=c=getc(inf); if (feof(inf)) break; if (c == '\n') lineno++; if (c == '\\') { c = *++sp = getc(inf); if (c = '\n') c = ' '; } else if (incomm) { if (c == '*') { while ((*++sp=c=getc(inf)) == '*') continue; if (c == '\n') lineno++; if (c == '/') incomm = FALSE; } } else if (inquote) { /* * Too dumb to know about \" not being magic, but * they usually occur in pairs anyway. */ if (c == '"') inquote = FALSE; continue; } else if (inchar) { if (c == '\'') inchar = FALSE; continue; } else switch (c) { case '"': inquote = TRUE; continue; case '\'': inchar = TRUE; continue; case '/': if ((*++sp=c=getc(inf)) == '*') incomm = TRUE; else ungetc(*sp, inf); continue; case '#': if (sp == line) number = TRUE; continue; case '{': level++; continue; case '}': if (sp == line) level = 0; /* reset */ else level--; continue; } if (!level && !inquote && !incomm && gotone == 0) { if (midtoken) { if (endtoken(c)) { int pfline = lineno; if (start_func(&sp,token,tp)) { strncpy(tok,token,tp-token+1); tok[tp-token+1] = 0; getline(); pfnote(tok, pfline); gotone = TRUE; } midtoken = FALSE; token = sp; } else if (intoken(c)) tp++; } else if (begtoken(c)) { token = tp = sp; midtoken = TRUE; } } sp++; if (c == '\n' || sp > &line[sizeof (line) - BUFSIZ]) { tp = token = sp = line; lineftell = ftell(inf); number = gotone = midtoken = inquote = inchar = FALSE; } } } /* * This routine checks to see if the current token is * at the start of a function. It updates the input line * so that the '(' will be in it when it returns. */ start_func(lp,token,tp) char **lp,*token,*tp; { reg char c,*sp,*tsp; static logical found; logical firsttok; /* T if have seen first token in ()'s */ int bad; sp = *lp; c = *sp; bad = FALSE; if (!number) { /* space is not allowed in macro defs */ while (iswhite(c)) { *++sp = c = getc(inf); if (c == '\n') { lineno++; if (sp > &line[sizeof (line) - BUFSIZ]) goto ret; } } /* the following tries to make it so that a #define a b(c) */ /* doesn't count as a define of b. */ } else { logical define; define = TRUE; for (tsp = "define"; *tsp && token < tp; tsp++) if (*tsp != *token++) { define = FALSE; break; } if (define) found = 0; else found++; if (found >= 2) { gotone = TRUE; badone: bad = TRUE; goto ret; } } if (c != '(') goto badone; firsttok = FALSE; while ((*++sp=c=getc(inf)) != ')') { if (c == '\n') { lineno++; if (sp > &line[sizeof (line) - BUFSIZ]) goto ret; } /* * This line used to confuse ctags: * int (*oldhup)(); * This fixes it. A nonwhite char before the first * token, other than a / (in case of a comment in there) * makes this not a declaration. */ if (begtoken(c) || c=='/') firsttok++; else if (!iswhite(c) && !firsttok) goto badone; } while (iswhite(*++sp=c=getc(inf))) if (c == '\n') { lineno++; if (sp > &line[sizeof (line) - BUFSIZ]) break; } ret: *lp = --sp; if (c == '\n') lineno--; ungetc(c,inf); return !bad && isgood(c); } getline() { long saveftell = ftell( inf ); register char *cp; fseek( inf , lineftell , 0 ); fgets(lbuf, sizeof lbuf, inf); cp = rindex(lbuf, '\n'); if (cp) *cp = 0; fseek(inf, saveftell, 0); } free_tree(node) NODE *node; { while (node) { free_tree(node->right); cfree(node); node = node->left; } } add_node(node, cur_node) NODE *node,*cur_node; { register int dif; dif = strcmp(node->func,cur_node->func); if (dif == 0) { if (node->file == cur_node->file) { if (!wflag) { fprintf(stderr,"Duplicate function in file %s, line %d: %s\n", node->file,lineno,node->func); fprintf(stderr,"S((econd entry ignored\n"); } return; } if (!cur_node->been_warned) if (!wflag) fprintf(stderr,"Duplicate function in files %s and %s: %s (Warning only)\n", node->file, cur_node->file, node->func); cur_node->been_warned = TRUE; return; } if (dif < 0) { if (cur_node->left != NULL) add_node(node,cur_node->left); else cur_node->left = node; return; } if (cur_node->right != NULL) add_node(node,cur_node->right); else cur_node->right = node; } put_funcs(node) reg NODE *node; { reg char *sp; if (node == NULL) return; put_funcs(node->left); if (xflag == 0) { fprintf(outf, "%s\t%s\t%c^", node->func, node->file ,searchar); for (sp = node->pat; *sp; sp++) if (*sp == '\\') fprintf(outf, "\\\\"); else putc(*sp, outf); fprintf(outf, "%c\n", searchar); } else if (vflag) fprintf(stdout, "%s %s %d\n", node->func, node->file, (node->lno+63)/64); else fprintf(stdout, "%-16s%4d %-16s %s\n", node->func, node->lno, node->file, node->pat); put_funcs(node->right); } char *dbp = lbuf; int pfcnt; PF_funcs(fi) FILE *fi; { lineno = 0; pfcnt = 0; while (fgets(lbuf, sizeof(lbuf), fi)) { lineno++; dbp = lbuf; if ( *dbp == '%' ) dbp++ ; /* Ratfor escape to fortran */ while (isspace(*dbp)) dbp++; if (*dbp == 0) continue; switch (*dbp |' ') { case 'i': if (tail("integer")) takeprec(); break; case 'r': if (tail("real")) takeprec(); break; case 'l': if (tail("logical")) takeprec(); break; case 'c': if (tail("complex") || tail("character")) takeprec(); break; case 'd': if (tail("double")) { while (isspace(*dbp)) dbp++; if (*dbp == 0) continue; if (tail("precision")) break; continue; } break; } while (isspace(*dbp)) dbp++; if (*dbp == 0) continue; switch (*dbp|' ') { case 'f': if (tail("function")) getit(); continue; case 's': if (tail("subroutine")) getit(); continue; case 'p': if (tail("program")) { getit(); continue; } if (tail("procedure")) getit(); continue; } } return (pfcnt); } tail(cp) char *cp; { register int len = 0; while (*cp && (*cp&~' ') == ((*(dbp+len))&~' ')) cp++, len++; if (*cp == 0) { dbp += len; return (1); } return (0); } takeprec() { while (isspace(*dbp)) dbp++; if (*dbp != '*') return; dbp++; while (isspace(*dbp)) dbp++; if (!isdigit(*dbp)) { --dbp; /* force failure */ return; } do dbp++; while (isdigit(*dbp)); } getit() { register char *cp; char c; char nambuf[BUFSIZ]; for (cp = lbuf; *cp; cp++) ; *--cp = 0; /* zap newline */ while (isspace(*dbp)) dbp++; if (*dbp == 0 || !isalpha(*dbp)) return; for (cp = dbp+1; *cp && (isalpha(*cp) || isdigit(*cp)); cp++) continue; c = cp[0]; cp[0] = 0; strcpy(nambuf, dbp); cp[0] = c; pfnote(nambuf, lineno); pfcnt++; } char * savestr(cp) char *cp; { register int len; register char *dp; len = strlen(cp); dp = (char *)malloc(len+1); strcpy(dp, cp); return (dp); } /* * Return the ptr in sp at which the character c last * appears; NULL if not found * * Identical to v7 rindex, included for portability. */ char * rindex(sp, c) register char *sp, c; { register char *r; r = NULL; do { if (*sp == c) r = sp; } while (*sp++); return(r); } rcpy(nambuf, dbp); cp[0] = c; pfnote(nambuf, lineno); pfcnt++; } char * savestr(cp) char *cp; { register int len; register char *dp; len = strlen(cp); dp = (char *)malloc(len+1); strcpy(dp, cp); return (dp); } /* cmd/fsck.c 444 0 33 110105 2502722262 5723 static char *sccsid = "@(#)fsck.c 4.13 (Berkeley) 81/03/09"; #include #include #include #include #include #include #include #include #include #include typedef int (*SIG_TYP)(); #define NDIRECT (BSIZE/sizeof(struct direct)) #define SPERB (BSIZE/sizeof(short)) #define NO 0 #define YES 1 #define MAXDUP 10 /* limit on dup blks (per inode) */ #define MAXBAD 10 /* limit on bad blks (per inode) */ #define STEPSIZE 9 /* default step for freelist spacing */ #define CYLSIZE 400 /* default cyl size for spacing */ #define MAXCYL 500 /* maximum cylinder size */ #define BITSPB 8 /* number bits per byte */ #define BITSHIFT 3 /* log2(BITSPB) */ #define BITMASK 07 /* BITSPB-1 */ #define LSTATE 2 /* bits per inode state */ #define STATEPB (BITSPB/LSTATE) /* inode states per byte */ #define USTATE 0 /* inode not allocated */ #define FSTATE 01 /* inode is file */ #define DSTATE 02 /* inode is directory */ #define CLEAR 03 /* inode is to be cleared */ #define SMASK 03 /* mask for inode state */ typedef struct dinode DINODE; typedef struct direct DIRECT; #define ALLOC ((dp->di_mode & IFMT) != 0) #define DIR ((dp->di_mode & IFMT) == IFDIR) #define REG ((dp->di_mode & IFMT) == IFREG) #define BLK ((dp->di_mode & IFMT) == IFBLK) #define CHR ((dp->di_mode & IFMT) == IFCHR) #define MPC ((dp->di_mode & IFMT) == IFMPC) #define MPB ((dp->di_mode & IFMT) == IFMPB) #define SPECIAL (BLK || CHR || MPC || MPB) #define NINOBLK 11 /* num blks for raw reading */ #define MAXRAW 110 /* largest raw read (in blks) */ daddr_t startib; /* blk num of first in raw area */ unsigned niblk; /* num of blks in raw area */ struct bufarea { struct bufarea *b_next; /* must be first */ daddr_t b_bno; union { char b_buf[BSIZE]; /* buffer space */ short b_lnks[SPERB]; /* link counts */ daddr_t b_indir[NINDIR]; /* indirect block */ struct filsys b_fs; /* super block */ struct fblk b_fb; /* free block */ struct dinode b_dinode[INOPB]; /* inode block */ DIRECT b_dir[NDIRECT]; /* directory */ } b_un; char b_dirty; }; typedef struct bufarea BUFAREA; BUFAREA inoblk; /* inode blocks */ BUFAREA fileblk; /* other blks in filesys */ BUFAREA sblk; /* file system superblock */ BUFAREA *poolhead; /* ptr to first buffer in pool */ #define initbarea(x) (x)->b_dirty = 0;(x)->b_bno = (daddr_t)-1 #define dirty(x) (x)->b_dirty = 1 #define inodirty() inoblk.b_dirty = 1 #define fbdirty() fileblk.b_dirty = 1 #define sbdirty() sblk.b_dirty = 1 #define freeblk fileblk.b_un.b_fb #define dirblk fileblk.b_un #define superblk sblk.b_un.b_fs struct filecntl { int rfdes; int wfdes; int mod; }; struct filecntl dfile; /* file descriptors for filesys */ struct filecntl sfile; /* file descriptors for scratch file */ typedef unsigned MEMSIZE; MEMSIZE memsize; /* amt of memory we got */ #ifdef pdp11 #define MAXDATA ((MEMSIZE)54*1024) #endif #ifdef vax #define MAXDATA ((MEMSIZE)400*1024) #endif #define DUPTBLSIZE 100 /* num of dup blocks to remember */ daddr_t duplist[DUPTBLSIZE]; /* dup block table */ daddr_t *enddup; /* next entry in dup table */ daddr_t *muldup; /* multiple dups part of table */ #define MAXLNCNT 50 /* num zero link cnts to remember */ ino_t badlncnt[MAXLNCNT]; /* table of inos with zero link cnts */ ino_t *badlnp; /* next entry in table */ char sflag; /* salvage free block list */ char csflag; /* salvage free block list (conditional) */ char nflag; /* assume a no response */ char yflag; /* assume a yes response */ char tflag; /* scratch file specified */ char preen; /* just fix normal inconsistencies */ char rplyflag; /* any questions asked? */ char hotroot; /* checking root device */ char rawflg; /* read raw device */ char rmscr; /* remove scratch file when done */ char fixfree; /* corrupted free list */ char *membase; /* base of memory we get */ char *blkmap; /* ptr to primary blk allocation map */ char *freemap; /* ptr to secondary blk allocation map */ char *statemap; /* ptr to inode state table */ char *pathp; /* pointer to pathname position */ char *thisname; /* ptr to current pathname component */ char *srchname; /* name being searched for in dir */ char pathname[200]; char scrfile[80]; char *lfname = "lost+found"; char *checklist = FSTAB; short *lncntp; /* ptr to link count table */ int cylsize; /* num blocks per cylinder */ int stepsize; /* num blocks for spacing purposes */ int badblk; /* num of bad blks seen (per inode) */ int dupblk; /* num of dup blks seen (per inode) */ int (*pfunc)(); /* function to call to chk blk */ ino_t inum; /* inode we are currently working on */ ino_t imax; /* number of inodes */ ino_t parentdir; /* i number of parent directory */ ino_t lastino; /* hiwater mark of inodes */ ino_t lfdir; /* lost & found directory */ ino_t orphan; /* orphaned inode */ off_t filsize; /* num blks seen in file */ off_t maxblk; /* largest logical blk in file */ off_t bmapsz; /* num chars in blkmap */ daddr_t smapblk; /* starting blk of state map */ daddr_t lncntblk; /* starting blk of link cnt table */ daddr_t fmapblk; /* starting blk of free map */ daddr_t n_free; /* number of free blocks */ daddr_t n_blks; /* number of blocks used */ daddr_t n_files; /* number of files seen */ daddr_t fmin; /* block number of the first data block */ daddr_t fmax; /* number of blocks in the volume */ #define howmany(x,y) (((x)+((y)-1))/(y)) #define roundup(x,y) ((((x)+((y)-1))/(y))*(y)) #define outrange(x) (x < fmin || x >= fmax) #define zapino(x) clear((char *)(x),sizeof(DINODE)) #define setlncnt(x) dolncnt(x,0) #define getlncnt() dolncnt(0,1) #define declncnt() dolncnt(0,2) #define setbmap(x) domap(x,0) #define getbmap(x) domap(x,1) #define clrbmap(x) domap(x,2) #define setfmap(x) domap(x,0+4) #define getfmap(x) domap(x,1+4) #define clrfmap(x) domap(x,2+4) #define setstate(x) dostate(x,0) #define getstate() dostate(0,1) #define DATA 1 #define ADDR 0 #define ALTERD 010 #define KEEPON 04 #define SKIP 02 #define STOP 01 int (*signa((l())(); long lseek(); long time(); DINODE *ginode(); BUFAREA *getblk(); BUFAREA *search(); int dirscan(); int findino(); int catch(); int mkentry(); int chgdd(); int pass1(); int pass1b(); int pass2(); int pass3(); int pass4(); int pass5(); char *devname; main(argc,argv) int argc; char *argv[]; { register FILE *fp; register n; register char *p; char filename[50]; char *sbrk(); sync(); while(--argc > 0 && **++argv == '-') { switch(*++*argv) { case 'p': preen++; break; case 't': case 'T': tflag++; if(**++argv == '-' || --argc <= 0) errexit("Bad -t option\n"); p = scrfile; while(*p++ = **argv) (*argv)++; break; case 's': /* salvage flag */ stype(++*argv); sflag++; break; case 'S': /* conditional salvage */ stype(++*argv); csflag++; break; case 'n': /* default no answer flag */ case 'N': nflag++; yflag = 0; break; case 'y': /* default yes answer flag */ case 'Y': yflag++; nflag = 0; break; default: errexit("%c option?\n",**argv); } } if(nflag && (sflag || csflag)) errexit("Incompatible options: -n and -%s\n",sflag?"s":"S"); if(sflag && csflag) sflag = 0; memsize = (MEMSIZE)sbrk(0); memsize = MAXDATA - memsize - sizeof(int); while(memsize >= 2*sizeof(BUFAREA) && (membase = sbrk(memsize)) == (char *)-1) memsize -= 1024; if(memsize < 2*sizeof(BUFAREA)) errexit("Can't get memory\n"); if (signal(SIGINT, SIG_IGN) != SIG_IGN) signal(SIGINT, catch); if(argc) { /* arg list has file names */ while(argc-- > 0){ hotroot = 0; check(*argv++); } } else { /* use default checklist */ struct fstab *fsp; int pid, passno, anygtr, sumstatus = 0; passno = 1; do { anygtr = 0; if (setfsent() == 0) errexit("Can't open checklist file: %s\n", FSTAB); while ( (fsp = getfsent()) != 0){ if (strcmp(fsp->fs_type, FSTAB_RW) && strcmp(fsp->fs_type, FSTAB_RO)) continue; if (preen == 0 || passno == 1 && fsp->fs_passno == passno) { if (blockcheck(fsp->fs_spec) == NO && preen) exit(8); } else if (fsp->fs_passno > passno) anygtr = 1; else if (fsp->fs_passno == passno) { pid = fork(); if (pid < 0) { perror("fork"); exit(8); } if (pid == 0) if (blockcheck(fsp->fs_spec)==NO) exit(8); else exit(0); } } if (preen) { int status; while (wait(&status) != -1) sumstatus |= status; } passno++; } while (anygtr); if (sumstatus) exit(8); endfsent(); } exit(0); } char *rawname(), *rindex(), *unrawname(); blockcheck(name) char *name; { struct stat stat_slash, stat_block, stat_char; char *raw; int looped = 0; hotroot = 0; if (stat("/", &stat_slash) < 0){ error("Can't stat root\n"); return(NO); } retry: if (stat(name, &stat_block) < 0){ error("Can't stat %s\n", name); return(NO); } if (stat_block.st_mode & S_IFBLK){ raw = rawname(name); if (stat(raw, &stat_char) < 0){ error("Can't stat %s\n", raw); return(NO); } if (stat_char.st_mode & S_IFCHR){ if (stat_slash.st_dev == stat_block.st_rdev) { hotroot++; raw = unrawname(name); } check(raw); return(YES); } else { error("%s is not a character device\n", raw); return(NO); } } else if (stat_block.st_mode & S_IFCHR){ if (looped) { error("Can't make sense out of name %s\n", name); return(NO); } name = unrawname(name); looped++; goto retry; } error("Can't make sense out of name %s\n", name); return(NO); } char * unrawname(cp) char *cp; { char *dp = rindex(cp, '/'); struct stat stb; if (dp == 0) return(cp); if (stat(cp, &stb) < 0) return(cp); if ((stb.st_mode&S_IFMT) != S_IFCHR) return(cp); if (*(dp+1) != 'r') return(cp); strcpy(dp+1, dp+2); return(cp); } char * rawname(cp) char *cp; { static char rawbuf[32]; char *dp = rindex(cp, '/'); if (dp == 0) return (0); *dp = 0; strcpy(rawbuf, cp); *dp = '/'; strcat(rawbuf, "/r"); strcat(rawbuf, dp+1); return (rawbuf); } check(dev) char *dev; { devname = dev; check1(dev); devname = 0; } check1(dev) char *dev; { register DINODE *dp; register n; register ino_t *blp; ino_t savino; daddr_t blk; BUFAREA *bp1, *bp2; if(setup(dev) == NO) return; if (preen==0) { printf("** Checking %s\n", dev); printf("** Phase 1 - Check Blocks and Sizes\n"); } pfunc = pass1; for(inum = 1; inum <= imax; inum++) { if((dp = ginode()) == NULL) continue; if(ALLOC) { lastino = inum; if(ftypeok(dp) == NO) { pfatal("UNKNOWN FILE TYPE I=%u",inum); if(reply("CLEAR") == YES) { zapino(dp); inodirty(); } continue; } n_files++; if(setlncnt(dp->di_nlink) <= 0) { if(badlnp < &badlncnt[MAXLNCNT]) *badlnp++ = inum; else { pfatal("LINK COUNT TABLE OVERFLOW"); if(reply("CONTINUE") == NO) errexit(""); } } setstate(DIR ? DSTATE : FSTATE); badblk = dupblk = 0; filsize = 0; maxblk = 0; ckinode(dp,ADDR); if((n = getstate()) == DSTATE || n == FSTATE) sizechk(dp); } else if(dp->di_mode != 0) { pfatal("PARTIALLY ALLOCATED INODE I=%u",inum); if(reply("CLEAR") == YES) { zapino(dp); inodirty(); } } } if(enddup != &duplist[0]) { if (preen) pfatal("INTERNAL ERROR: dups with -p"); printf("** Phase 1b - Rescan For More DUPS\n"); pfunc = pass1b; for(inum = 1; inum <= lastino; inum++) { if(getstate() != USTATE && (dp = ginode()) != NULL) if(ckinode(dp,ADDR) & STOP) break; } } if(rawflg) { if(inoblk.b_dirty) bwrite(&dfile,membase,startib,(int)niblk*BSIZE); inoblk.b_dirty = 0; if(poolhead) { clear(membase,niblk*BSIZE); for(bp1 = poolhead;bp1->b_next;bp1 = bp1->b_next); bp2 = &((BUFAREA *)membase)[(niblk*BSIZE)/sizeof(BUFAREA)]; while(--bp2 >= (BUFAREA *)membase) { initbarea(bp2); bp2->b_next = bp1->b_next; bp1->b_next = bp2; } } rawflg = 0; } if (preen == 0) printf("** Phase 2 - Check Pathnames\n"); inum = ROOTINO; thisname = pathp = pathname; pfunc = pass2; switch(getstate()) { case USTATE: errexit("ROOT INODE UNALLOCATED. TERMINATING.\n"); case FSTATE: pfatal("ROOT INODE NOT DIRECTORY"); if(reply("FIX") == NO || (dp = ginode()) == NULL) errexit(""); dp->di_mode &= ~IFMT; dp->di_mode |= IFDIR; inodirty(); setstate(DSTATE); case DSTATE: descend(); break; case CLEAR: pfatal("DUPS/BAD IN ROOT INODE"); printf("\n"); if(reply("CONTINUE") == NO) errexit(""); setstate(DSTATE); descend(); } if (preen == 0) printf("** Phase 3 - Check Connectivity\n"); for(inum = ROOTINO; inum <= lastino; inum++) { if(getstate() == DSTATE) { pfunc = findino; srchname = ".."; savino = inum; do { orphan = inum; if((dp = ginode()) == NULL) break; filsize = dp->di_size; parentdir = 0; ckinode(dp,DATA); if((inum = parentdir) == 0) break; } while(getstate() == DSTATE); inum = orphan; if(linkup() == YES) { thisname = pathp = pathname; *pathp++ = '?'; pfunc = pass2; descend(); } inum = savino; } } if (preen == 0) printf("** Phase 4 - Check Reference Counts\n"); pfunc = pass4; for(inum = ROOTINO; inum <= lastino; inum++) { switch(getstate()) { case FSTATE: if(n = getlncnt()) adjust((short)n); else { for(blp = badlncnt;blp < badlnp; blp++) if(*blp == inum) { clri("UNREF",YES); break; } } break; case DSTATE: clri("UNREF",YES); break; case CLEAR: clri("BAD/DUP",YES); } } if(imax - n_files != superblk.s_tinode) { pwarn("FREE INODE COUNT WRONG IN SUPERBLK"); if (preen) printf(" (FIXED)\n"); if (preen || reply("FIX") == YES) { superblk.s_tinode = imax - n_files; sbdirty(); } } flush(&dfile,&fileblk); if (preen == 0) printf("** Phase 5 - Check Free List "); if(sflag || (csflag && rplyflag == 0)) { if (preen == 0) printf("(Ignored)\n"); fixfree = 1; } else { if (preen == 0) printf("\n"); if(freemap) copy(blkmap,freemap,(MEMSIZE)bmapsz); else { for(blk = 0; blk < fmapblk; blk++) { bp1 = getblk((BUFAREA *)NULL,blk); bp2 = getblk((BUFAREA *)NULL,blk+fmapblk); copy(bp1->b_un.b_buf,bp2->b_un.b_buf,BSIZE); dirty(bp2); } } badblk = dupblk = 0; freeblk.df_nfree = superblk.s_nfree; for(n = 0; n < NICFREE; n++) freeblk.df_free[n] = superblk.s_free[n]; freechk(); if(badblk) { pfatal("%d BAD BLKS IN FREE LIST",badblk); printf("\n"); } if(dupblk) pwarn("%d DUP BLKS IN FREE LIST\n",dupblk); if(fixfree == 0) { if((n_blks+n_free) != (fmax-fmin)) { pwarn("%ld BLK(S) MISSING\n", fmax-fmin-n_blks-n_free); fixfree = 1; } else if(n_free != superblk.s_tfree) { pwarn("FREE BLK COUNT WRONG IN SUPERBLK"); if (preen) printf(" (FIXED)\n"); if(preen || reply("FIX") == YES) { superblk.s_tfree = n_free; sbdirty(); } } } if(fixfree) { pwarn("BAD FREE LIST"); if (preen) printf(" (SALVAGED)\n"); else if(reply("SALVAGE") == NO) fixfree = 0; } } if(fixfree) { if (preen == 0) printf("** Phase 6 - Salvage Free List\n"); makefree(); n_free = superblk.s_tfree; } pwarn("%ld files %ld blocks %ld free\n", n_files,n_blks,n_free); if(dfile.mod) { time(&superblk.s_time); sbdirty(); } ckfini(); sync(); if(dfile.mod && preen == 0) printf("\n***** FILE SYSTEM WAS MODIFIED *****\n"); } /* VARARGS1 */ error(s1,s2,s3,s4) char *s1; { printf(s1,s2,s3,s4); } /* VARARGS1 */ errexit(s1,s2,s3,s4) char *s1; { error(s1,s2,s3,s4); exit(8); } /* * Pfatal is called when an inconsistency occurs * which should not happen during normal operations. * It prints a message and then dies. * When not preening, this is just a printf. */ pfatal(s,a1,a2,a3) { if (preen) { printf("%s: ", devname); printf(s, a1, a2, a3); printf("\n"); preendie(); } printf(s, a1, a2, a3); } /* * Fatal is called to terminate preening * due to unexplainable inconsistency. */ preendie() { printf("%s: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.\n", devname); exit(8)((; } /* * Pwarn is like printf when not preening, * or a warning (preceded by filename) when preening. */ pwarn(s,a1,a2,a3,a4,a5,a6) { if (preen) printf("%s: ", devname); printf(s, a1, a2, a3, a4, a5, a6); } ckinode(dp,flg) DINODE *dp; register flg; { register daddr_t *ap; register ret; int (*func)(), n; daddr_t iaddrs[NADDR]; if(SPECIAL) return(KEEPON); l3tol(iaddrs,dp->di_addr,NADDR); func = (flg == ADDR) ? pfunc : dirscan; for(ap = iaddrs; ap < &iaddrs[NADDR-3]; ap++) { if(*ap && (ret = (*func)(*ap)) & STOP) return(ret); } for(n = 1; n < 4; n++) { if(*ap && (ret = iblock(*ap,n,flg)) & STOP) return(ret); ap++; } return(KEEPON); } iblock(blk,ilevel,flg) daddr_t blk; register ilevel; { register daddr_t *ap; register n; int (*func)(); BUFAREA ib; if(flg == ADDR) { func = pfunc; if(((n = (*func)(blk)) & KEEPON) == 0) return(n); } else func = dirscan; if(outrange(blk)) /* protect thyself */ return(SKIP); initbarea(&ib); if(getblk(&ib,blk) == NULL) return(SKIP); ilevel--; for(ap = ib.b_un.b_indir; ap < &ib.b_un.b_indir[NINDIR]; ap++) { if(*ap) { if(ilevel > 0) { n = iblock(*ap,ilevel,flg); } else n = (*func)(*ap); if(n & STOP) return(n); } } return(KEEPON); } pass1(blk) daddr_t blk; { register daddr_t *dlp; if(outrange(blk)) { blkerr("BAD",blk); if(++badblk >= MAXBAD) { printf("EXCESSIVE BAD BLKS I=%u",inum); if(reply("CONTINUE") == NO) errexit(""); return(STOP); } return(SKIP); } if(getbmap(blk)) { blkerr("DUP",blk); if(++dupblk >= MAXDUP) { printf("EXCESSIVE DUP BLKS I=%u",inum); if(reply("CONTINUE") == NO) errexit(""); return(STOP); } if(enddup >= &duplist[DUPTBLSIZE]) { printf("DUP TABLE OVERFLOW."); if(reply("CONTINUE") == NO) errexit(""); return(STOP); } for(dlp = duplist; dlp < muldup; dlp++) { if(*dlp == blk) { *enddup++ = blk; break; } } if(dlp >= muldup) { *enddup++ = *muldup; *muldup++ = blk; } } else { n_blks++; setbmap(blk); } filsize++; return(KEEPON); } pass1b(blk) daddr_t blk; { register daddr_t *dlp; if(outrange(blk)) return(SKIP); for(dlp = duplist; dlp < muldup; dlp++) { if(*dlp == blk) { blkerr("DUP",blk); *dlp = *--muldup; *muldup = blk; return(muldup == duplist ? STOP : KEEPON); } } return(KEEPON); } pass2(dirp) register DIRECT *dirp; { register char *p; register n; DINODE *dp; if((inum = dirp->d_ino) == 0) return(KEEPON); thisname = pathp; for(p = dirp->d_name; p < &dirp->d_name[DIRSIZ]; ) if((*pathp++ = *p++) == 0) { --pathp; break; } *pathp = 0; n = NO; if(inum > imax || inum < ROOTINO) n = direrr("I OUT OF RANGE"); else { again: switch(getstate()) { case USTATE: n = direrr("UNALLOCATED"); break; case CLEAR: if((n = direrr("DUP/BAD")) == YES) break; if((dp = ginode()) == NULL) break; setstate(DIR ? DSTATE : FSTATE); goto again; case FSTATE: declncnt(); break; case DSTATE: declncnt(); descend(); } } pathp = thisname; if(n == NO) return(KEEPON); dirp->d_ino = 0; return(KEEPON|ALTERD); } pass4(blk) daddr_t blk; { register daddr_t *dlp; if(outrange(blk)) return(SKIP); if(getbmap(blk)) { for(dlp = duplist; dlp < enddup; dlp++) if(*dlp == blk) { *dlp = *--enddup; return(KEEPON); } clrbmap(blk); n_blks--; } return(KEEPON); } pass5(blk) daddr_t blk; { if(outrange(blk)) { fixfree = 1; if (preen) pfatal("BAD BLOCKS IN FREE LIST."); if(++badblk >= MAXBAD) { printf("EXCESSIVE BAD BLKS IN FREE LIST."); if(reply("CONTINUE") == NO) errexit(""); return(STOP); } return(SKIP); } if(getfmap(blk)) { fixfree = 1; if(++dupblk >= DUPTBLSIZE) { printf("EXCESSIVE DUP BLKS IN FREE LIST."); if(reply("CONTINUE") == NO) errexit(""); return(STOP); } } else { n_free++; setfmap(blk); } return(KEEPON); } blkerr(s,blk) daddr_t blk; char *s; { pfatal("%ld %s I=%u",blk,s,inum); printf("\n"); setstate(CLEAR); /* mark for possible clearing */ } descend() { register DINODE *dp; register char *savname; off_t savsize; setstate(FSTATE); if((dp = ginode()) == NULL) return; savname = thisname; *pathp++ = '/'; savsize = filsize; filsize = dp->di_size; ckinode(dp,DATA); thisname = savname; *--pathp = 0; filsize = savsize; } dirscan(blk) daddr_t blk; { register DIRECT *dirp; register char *p1, *p2; register n; DIRECT direntry; if(outrange(blk)) { filsize -= BSIZE; return(SKIP); } for(dirp = dirblk.b_dir; dirp < &dirblk.b_dir[NDIRECT] && filsize > 0; dirp++, filsize -= sizeof(DIRECT)) { if(getblk(&fileblk,blk) == NULL) { filsize -= (&dirblk.b_dir[NDIRECT]-dirp)*sizeof(DIRECT); return(SKIP); } p1 = &dirp->d_name[DIRSIZ]; p2 = &direntry.d_name[DIRSIZ]; while(p1 > (char *)dirp) *--p2 = *--p1; if((n = (*pfunc)(&direntry)) & ALTERD) { if(getblk(&fileblk,blk) != NULL) { p1 = &dirp->d_name[DIRSIZ]; p2 = &direntry.d_name[DIRSIZ]; while(p1 > (char *)dirp) *--p1 = *--p2; fbdirty(); } else n &= ~ALTERD; } if(n & STOP) return(n); } return(filsize > 0 ? KEEPON : STOP); } direrr(s) char *s; { register DINODE *dp; pwarn("%s ",s); pinode(); printf("\n"); if((dp = ginode()) != NULL && ftypeok(dp)) pfatal("%s=%s",DIR?"DIR":"FILE",pathname); else pfatal("NAME=%s",pathname); return(reply("REMOVE")); } adjust(lcnt) register short lcnt; { register DINODE *dp; if((dp = ginode()) == NULL) return; if(dp->di_nlink == lcnt) { if(linkup() == NO) clri("UNREF",NO); } else { pwarn("LINK COUNT %s", (lfdir==inum)?lfname:(DIR?"DIR":"FILE")); pinode(); printf(" COUNT %d SHOULD BE %d", dp->di_nlink,dp->di_nlink-lcnt); if (preen) { if (lcnt < 0) { printf("\n"); preendie(); } printf(" (ADJUSTED)\n"); } if(preen || reply("ADJUST") == YES) { dp->di_nlink -= lcnt; inodirty(); } } } clri(s,flg) char *s; { register DINODE *dp; if((dp = ginode()) == NULL) return; if(flg == YES) { pwarn("%s %s",s,DIR?"DIR":"FILE"); pinode(); } if(preen || reply("CLEAR") == YES) { if (preen) printf(" (CLEARED)\n"); n_files--; pfunc = pass4; ckinode(dp,ADDR); zapino(dp); inodirty(); } } setup(dev) char *dev; { register n; register BUFAREA *bp; register MEMSIZE msize; char *mbase; daddr_t bcnt, nscrblk; dev_t rootdev; off_t smapsz, lncntsz, totsz; struct stat statarea; if(stat("/",&statarea) < 0) errexit("Can't stat root\n"); rootdev = statarea.st_dev; if(stat(dev,&statarea) < 0) { error("Can't stat %s\n",dev); return(NO); } rawflg = 0; if((statarea.st_mode & S_IFMT) == S_IFBLK) ; else if((statarea.st_mode & S_IFMT) == S_IFCHR) rawflg++; else { if (reply("file is not a block or character device; OK") == NO) return(NO); } if(rootdev == statarea.st_rdev) hotroot++; if((dfile.rfdes = open(dev,0)) < 0) { error("Can't open %s\n",dev); return(NO); } if (preen == 0) printf("\n%s",dev); if(nflag || (dfile.wfdes = open(dev,1)) < 0) { dfile.wfdes = -1; if (preen) pfatal("NO WRITE ACCESS"); printf(" (NO WRITE)"); } if (preen == 0) printf("\n"); fixfree = 0; dfile.mod = 0; n_files = n_blks = n_free = 0; muldup = enddup = &duplist[0]; badlnp = &badlncnt[0]; lfdir = 0; rplyflag = 0; initbarea(&sblk); initbarea(&fileblk); initbarea(&inoblk); sfile.wfdes = sfile.rfdes = -1; rmscr = 0; if(getblk(&sblk,SUPERB) == NULL) { ckfini(); return(NO); } imax = ((ino_t)superblk.s_isize - (SUPERB+1)) * INOPB; fmin = (daddr_t)superblk.s_isize; /* first data blk num */ fmax = superblk.s_fsize; /* first invalid blk num */ if(fmin >= fmax || (imax/INOPB) != ((ino_t)superblk.s_isize-(SUPERB+1))) { pfatal("Size check: fsize %ld isize %d", superblk.s_fsize,superblk.s_isize); printf("\n"); ckfini(); return(NO); } if (preen == 0) printf("File System: %.12s\n\n", superblk.s_fsmnt); bmapsz = roundup(howmany(fmax,BITSPB),sizeof(*lncntp)); smapsz = roundup(howmany((long)(imax+1),STATEPB),sizeof(*lncntp)); lncntsz = (long)(imax+1) * sizeof(*lncntp); if(bmapsz > smapsz+lncntsz) smapsz = bmapsz-lncntsz; totsz = bmapsz+smapsz+lncntsz; msize = memsize; mbase = membase; if(rawflg) { if(msize < (MEMSIZE)(NINOBLK*BSIZE) + 2*sizeof(BUFAREA)) rawflg = 0; else { msize -= (MEMSIZE)NINOBLK*BSIZE; mbase += (MEMSIZE)NINOBLK*BSIZE; niblk = NINOBLK; startib = fmax; } } clear(mbase,msize); if((off_t)msize < totsz) { bmapsz = roundup(bmapsz,BSIZE); smapsz = roundup(smapsz,BSIZE); lncntsz = roundup(lncntsz,BSIZE); nscrblk = (bmapsz+smapsz+lncntsz)>>BSHIFT; if(tflag == 0) { printf("\nNEED SCRATCH FILE (%ld BLKS)\n",nscrblk); do { printf("ENTER FILENAME: "); if((n = getline(stdin,scrfile,sizeof(scrfile))) == EOF) errexit("\n"); } while(n == 0); } if(stat(scrfile,&statarea) < 0 || (statarea.st_mode & S_IFMT) == S_IFREG) rmscr++; if((sfile.wfdes = creat(scrfile,0666)) < 0 || (sfile.rfdes = open(scrfile,0)) < 0) { error("Can't create %s\n",scrfile); ckfini(); return(NO); } bp = &((BUFAREA *)mbase)[(msize/sizeof(BUFAREA))]; poolhead = NULL; while(--bp >= (BUFAREA *)mbase) { initbarea(bp); bp->b_next = poolhead; poolhead = bp; } bp = poolhead; for(bcnt = 0; bcnt < nscrblk; bcnt++) { bp->b_bno = bcnt; dirty(bp); flush(&sfile,bp); } blkmap = freemap = statemap = (char *) NULL; lncntp = (short *) NULL; smapblk = bmapsz / BSIZE; lncntblk = smapblk + smapsz / BSIZE; fmapblk = smapblk; } else { if(rawflg && (off_t)msize > totsz+BSIZE) { niblk += (unsigned)((off_t)msize-totsz)>>BSHIFT; if(niblk > MAXRAW) niblk = MAXRAW; msize = memsize - (niblk*BSIZE); mbase = membase + (niblk*BSIZE); } poolhead = NULL; blkmap = mbase; statemap = &mbase[(MEMSIZE)bmapsz]; freemap = statemap; lncntp = (short *)&statemap[(MEMSIZE)smapsz]; } return(YES); } DINODE * ginode() { register DINODE *dp; register char *mbase; daddr_t iblk; if(inum > imax) return(NULL); iblk = itod(inum); if(rawflg) { mbase = membase; if(iblk < startib || iblk >= starti((b+niblk) { if(inoblk.b_dirty) bwrite(&dfile,mbase,startib,(int)niblk*BSIZE); inoblk.b_dirty = 0; if(bread(&dfile,mbase,iblk,(int)niblk*BSIZE) == NO) { startib = fmax; return(NULL); } startib = iblk; } dp = (DINODE *)&mbase[(unsigned)((iblk-startib)<di_mode & IFMT) { case IFDIR: case IFREG: case IFBLK: case IFCHR: case IFMPC: case IFMPB: return(YES); default: return(NO); } } reply(s) char *s; { char line[80]; if (preen) pfatal("INTERNAL ERROR: GOT TO reply()"); rplyflag = 1; printf("\n%s? ",s); if(nflag || csflag || dfile.wfdes < 0) { printf(" no\n\n"); return(NO); } if(yflag) { printf(" yes\n\n"); return(YES); } if(getline(stdin,line,sizeof(line)) == EOF) errexit("\n"); printf("\n"); if(line[0] == 'y' || line[0] == 'Y') return(YES); else return(NO); } getline(fp,loc,maxlen) FILE *fp; char *loc; { register n; register char *p, *lastloc; p = loc; lastloc = &p[maxlen-1]; while((n = getc(fp)) != '\n') { if(n == EOF) return(EOF); if(!isspace(n) && p < lastloc) *p++ = n; } *p = 0; return(p - loc); } stype(p) register char *p; { if(*p == 0) return; if (*(p+1) == 0) { if (*p == '3') { cylsize = 200; stepsize = 5; return; } if (*p == '4') { cylsize = 418; stepsize = 9; return; } } cylsize = atoi(p); while(*p && *p != ':') p++; if(*p) p++; stepsize = atoi(p); if(stepsize <= 0 || stepsize > cylsize || cylsize <= 0 || cylsize > MAXCYL) { error("Invalid -s argument, defaults assumed\n"); cylsize = stepsize = 0; } } dostate(s,flg) { register char *p; register unsigned byte, shift; BUFAREA *bp; byte = (inum)/STATEPB; shift = LSTATE * ((inum)%STATEPB); if(statemap != NULL) { bp = NULL; p = &statemap[byte]; } else if((bp = getblk((BUFAREA *)NULL,(daddr_t)(smapblk+(byte/BSIZE)))) == NULL) errexit("Fatal I/O error\n"); else p = &bp->b_un.b_buf[byte%BSIZE]; switch(flg) { case 0: *p &= ~(SMASK<<(shift)); *p |= s<<(shift); if(bp != NULL) dirty(bp); return(s); case 1: return((*p>>(shift)) & SMASK); } return(USTATE); } domap(blk,flg) daddr_t blk; { register char *p; register unsigned n; register BUFAREA *bp; off_t byte; byte = blk >> BITSHIFT; n = 1<<((unsigned)(blk & BITMASK)); if(flg & 04) { p = freemap; blk = fmapblk; } else { p = blkmap; blk = 0; } if(p != NULL) { bp = NULL; p += (unsigned)byte; } else if((bp = getblk((BUFAREA *)NULL,blk+(byte>>BSHIFT))) == NULL) errexit("Fatal I/O error\n"); else p = &bp->b_un.b_buf[(unsigned)(byte&BMASK)]; switch(flg&03) { case 0: *p |= n; break; case 1: n &= *p; bp = NULL; break; case 2: *p &= ~n; } if(bp != NULL) dirty(bp); return(n); } dolncnt(val,flg) short val; { register short *sp; register BUFAREA *bp; if(lncntp != NULL) { bp = NULL; sp = &lncntp[inum]; } else if((bp = getblk((BUFAREA *)NULL,(daddr_t)(lncntblk+(inum/SPERB)))) == NULL) errexit("Fatal I/O error\n"); else sp = &bp->b_un.b_lnks[inum%SPERB]; switch(flg) { case 0: *sp = val; break; case 1: bp = NULL; break; case 2: (*sp)--; } if(bp != NULL) dirty(bp); return(*sp); } BUFAREA * getblk(bp,blk) daddr_t blk; register BUFAREA *bp; { register struct filecntl *fcp; if(bp == NULL) { bp = search(blk); fcp = &sfile; } else fcp = &dfile; if(bp->b_bno == blk) return(bp); flush(fcp,bp); if(bread(fcp,bp->b_un.b_buf,blk,BSIZE) != NO) { bp->b_bno = blk; return(bp); } bp->b_bno = (daddr_t)-1; return(NULL); } flush(fcp,bp) struct filecntl *fcp; register BUFAREA *bp; { if(bp->b_dirty) { bwrite(fcp,bp->b_un.b_buf,bp->b_bno,BSIZE); } bp->b_dirty = 0; } rwerr(s,blk) char *s; daddr_t blk; { if (preen == 0) printf("\n"); pfatal("CAN NOT %s: BLK %ld",s,blk); if(reply("CONTINUE") == NO) errexit("Program terminated\n"); } sizechk(dp) register DINODE *dp; { /* if (maxblk != howmany(dp->di_size, BSIZE)) printf("POSSIBLE FILE SIZE ERROR I=%u (%ld,%ld)\n\n", inum, maxblk, howmany(dp->di_size,BSIZE)); */ if(DIR && (dp->di_size % sizeof(DIRECT)) != 0) { pwarn("DIRECTORY MISALIGNED I=%u\n",inum); if (preen == 0) printf("\n"); } } ckfini() { flush(&dfile,&fileblk); flush(&dfile,&sblk); flush(&dfile,&inoblk); close(dfile.rfdes); close(dfile.wfdes); close(sfile.rfdes); close(sfile.wfdes); if(rmscr) { unlink(scrfile); } } pinode() { register DINODE *dp; register char *p; char uidbuf[200]; char *ctime(); printf(" I=%u ",inum); if((dp = ginode()) == NULL) return; printf(" OWNER="); if(getpw((int)dp->di_uid,uidbuf) == 0) { for(p = uidbuf; *p != ':'; p++); *p = 0; printf("%s ",uidbuf); } else { printf("%d ",dp->di_uid); } printf("MODE=%o\n",dp->di_mode); if (preen) printf("%s: ", devname); printf("SIZE=%ld ",dp->di_size); p = ctime(&dp->di_mtime); printf("MTIME=%12.12s %4.4s ",p+4,p+20); } copy(fp,tp,size) register char *tp, *fp; MEMSIZE size; { while(size--) *tp++ = *fp++; } freechk() { register daddr_t *ap; if(freeblk.df_nfree == 0) return; do { if(freeblk.df_nfree <= 0 || freeblk.df_nfree > NICFREE) { pfatal("BAD FREEBLK COUNT"); printf("\n"); fixfree = 1; return; } ap = &freeblk.df_free[freeblk.df_nfree]; while(--ap > &freeblk.df_free[0]) { if(pass5(*ap) == STOP) return; } if(*ap == (daddr_t)0 || pass5(*ap) != KEEPON) return; } while(getblk(&fileblk,*ap) != NULL); } makefree() { register i, cyl, step; int j; char flg[MAXCYL]; short addr[MAXCYL]; daddr_t blk, baseblk; superblk.s_nfree = 0; superblk.s_flock = 0; superblk.s_fmod = 0; superblk.s_tfree = 0; superblk.s_ninode = 0; superblk.s_ilock = 0; superblk.s_ronly = 0; if(cylsize == 0 || stepsize == 0) { step = superblk.s_dinfo[0]; cyl = superblk.s_dinfo[1]; } else { step = stepsize; cyl = cylsize; } if(step > cyl || step <= 0 || cyl <= 0 || cyl > MAXCYL) { error("Default free list spacing assumed\n"); step = STEPSIZE; cyl = CYLSIZE; } superblk.s_dinfo[0] = step; superblk.s_dinfo[1] = cyl; clear(flg,sizeof(flg)); i = 0; for(j = 0; j < cyl; j++) { while(flg[i]) i = (i + 1) % cyl; addr[j] = i + 1; flg[i]++; i = (i + step) % cyl; } baseblk = (daddr_t)roundup(fmax,cyl); clear((char *)&freeblk,BSIZE); freeblk.df_nfree++; for( ; baseblk > 0; baseblk -= cyl) for(i = 0; i < cyl; i++) { blk = baseblk - addr[i]; if(!outrange(blk) && !getbmap(blk)) { superblk.s_tfree++; if(freeblk.df_nfree >= NICFREE) { fbdirty(); fileblk.b_bno = blk; flush(&dfile,&fileblk); clear((char *)&freeblk,BSIZE); } freeblk.df_free[freeblk.df_nfree] = blk; freeblk.df_nfree++; } } superblk.s_nfree = freeblk.df_nfree; for(i = 0; i < NICFREE; i++) superblk.s_free[i] = freeblk.df_free[i]; sbdirty(); } clear(p,cnt) register char *p; MEMSIZE cnt; { while(cnt--) *p++ = 0; } BUFAREA * search(blk) daddr_t blk; { register BUFAREA *pbp, *bp; for(bp = (BUFAREA *) &poolhead; bp->b_next; ) { pbp = bp; bp = pbp->b_next; if(bp->b_bno == blk) break; } pbp->b_next = bp->b_next; bp->b_next = poolhead; poolhead = bp; return(bp); } findino(dirp) register DIRECT *dirp; { register char *p1, *p2; if(dirp->d_ino == 0) return(KEEPON); for(p1 = dirp->d_name,p2 = srchname;*p2++ == *p1; p1++) { if(*p1 == 0 || p1 == &dirp->d_name[DIRSIZ-1]) { if(dirp->d_ino >= ROOTINO && dirp->d_ino <= imax) parentdir = dirp->d_ino; return(STOP); } } return(KEEPON); } mkentry(dirp) register DIRECT *dirp; { register ino_t in; register char *p; if(dirp->d_ino) return(KEEPON); dirp->d_ino = orphan; in = orphan; p = &dirp->d_name[8]; *--p = 0; while(p > dirp->d_name) { *--p = (in % 10) + '0'; in /= 10; } *p = '#'; return(ALTERD|STOP); } chgdd(dirp) register DIRECT *dirp; { if(dirp->d_name[0] == '.' && dirp->d_name[1] == '.' && dirp->d_name[2] == 0) { dirp->d_ino = lfdir; return(ALTERD|STOP); } return(KEEPON); } linkup() { register DINODE *dp; register lostdir; register ino_t pdir; if((dp = ginode()) == NULL) return(NO); lostdir = DIR; pdir = parentdir; pwarn("UNREF %s ",lostdir ? "DIR" : "FILE"); pinode(); if (preen && dp->di_size == 0) return(NO); if (preen) printf(" (RECONNECTED)\n"); else if (reply("RECONNECT") == NO) return(NO); orphan = inum; if(lfdir == 0) { inum = ROOTINO; if((dp = ginode()) == NULL) { inum = orphan; return(NO); } pfunc = findino; srchname = lfname; filsize = dp->di_size; parentdir = 0; ckinode(dp,DATA); inum = orphan; if((lfdir = parentdir) == 0) { pfatal("SORRY. NO lost+found DIRECTORY"); printf("\n\n"); return(NO); } } inum = lfdir; if((dp = ginode()) == NULL || !DIR || getstate() != FSTATE) { inum = orphan; pfatal("SORRY. NO lost+found DIRECTORY"); printf("\n\n"); return(NO); } if(dp->di_size & BMASK) { dp->di_size = roundup(dp->di_size,BSIZE); inodirty(); } filsize = dp->di_size; inum = orphan; pfunc = mkentry; if((ckinode(dp,DATA) & ALTERD) == 0) { pfatal("SORRY. NO SPACE IN lost+found DIRECTORY"); printf("\n\n"); return(NO); } declncnt(); if(lostdir) { pfunc = chgdd; dp = ginode(); filsize = dp->di_size; ckinode(dp,DATA); inum = lfdir; if((dp = ginode()) != NULL) { dp->di_nlink++; inodirty(); setlncnt(getlncnt()+1); } inum = orphan; pwarn("DIR I=%u CONNECTED. ",orphan); printf("PARENT WAS I=%u\n",pdir); if (preen == 0) printf("\n"); } return(YES); } bread(fcp,buf,blk,size) daddr_t blk; register struct filecntl *fcp; register size; char *buf; { if(lseek(fcp->rfdes,blk<rfdes,buf,size) == size) return(YES); rwerr("READ",blk); return(NO); } bwrite(fcp,buf,blk,size) daddr_t blk; register struct filecntl *fcp; register size; char *buf; { if(fcp->wfdes < 0) return(NO); if(lseek(fcp->wfdes,blk<wfdes,buf,size) == size) { fcp->mod = 1; return(YES); } r((werr("WRITE",blk); return(NO); } catch() { ckfini(); exit(12); } *buf; { if(lseek(fcp->rfdes,blk<rfdes,buf,size) == size) return(YES); rwerr("READ",blk); return(NO); } bwrite(fcp,buf,blk,size) daddr_t blk; register struct filecntl *fcp; register size; char *buf; { if(fcp->wfdes < 0) return(NO); if(lseek(fcp->wfdes,blk<wfdes,buf,size) == size) { fcp->mod = 1; return(YES); } rcmd/join.c 444 0 33 10506 2416240021 5710 static char *sccsid = "@(#)join.c 4.1 (Berkeley) 10/1/80"; /* join F1 F2 on stuff */ #include #define F1 0 #define F2 1 #define NFLD 20 /* max field per line */ #define comp() cmp(ppi[F1][j1],ppi[F2][j2]) FILE *f[2]; char buf[2][BUFSIZ]; /*input lines */ char *ppi[2][NFLD]; /* pointers to fields in lines */ char *s1,*s2; int j1 = 1; /* join of this field of file 1 */ int j2 = 1; /* join of this field of file 2 */ int olist[2*NFLD]; /* output these fields */ int olistf[2*NFLD]; /* from these files */ int no; /* number of entries in olist */ int sep1 = ' '; /* default field separator */ int sep2 = '\t'; char* null = ""; int unpub1; int unpub2; int aflg; main(argc, argv) char *argv[]; { int i; int n1, n2; long top2, bot2; long ftell(); while (argc > 1 && argv[1][0] == '-') { if (argv[1][1] == '\0') break; switch (argv[1][1]) { case 'a': switch(argv[1][2]) { case '1': aflg |= 1; break; case '2': aflg |= 2; break; default: aflg |= 3; } break; case 'e': null = argv[2]; argv++; argc--; break; case 't': sep1 = sep2 = argv[1][2]; break; case 'o': for (no = 0; no < 2*NFLD; no++) { if (argv[2][0] == '1' && argv[2][1] == '.') { olistf[no] = F1; olist[no] = atoi(&argv[2][2]); } else if (argv[2][0] == '2' && argv[2][1] == '.') { olist[no] = atoi(&argv[2][2]); olistf[no] = F2; } else break; argc--; argv++; } break; case 'j': if (argv[1][2] == '1') j1 = atoi(argv[2]); else if (argv[1][2] == '2') j2 = atoi(argv[2]); else j1 = j2 = atoi(argv[2]); argc--; argv++; break; } argc--; argv++; } for (i = 0; i < no; i++) olist[i]--; /* 0 origin */ if (argc != 3) error("usage: join [-j1 x -j2 y] [-o list] file1 file2"); j1--; j2--; /* everyone else believes in 0 origin */ s1 = ppi[F1][j1]; s2 = ppi[F2][j2]; if (argv[1][0] == '-') f[F1] = stdin; else if ((f[F1] = fopen(argv[1], "r")) == NULL) error("can't open %s", argv[1]); if ((f[F2] = fopen(argv[2], "r")) == NULL) error("can't open %s", argv[2]); #define get1() n1=input(F1) #define get2() n2=input(F2) get1(); bot2 = ftell(f[F2]); get2(); while(n1>0 && n2>0 || aflg!=0 && n1+n2>0) { if(n1>0 && n2>0 && comp()>0 || n1==0) { if(aflg&2) output(0, n2); bot2 = ftell(f[F2]); get2(); } else if(n1>0 && n2>0 && comp()<0 || n2==0) { if(aflg&1) output(n1, 0); get1(); } else /*(n1>0 && n2>0 && comp()==0)*/ { while(n2>0 && comp()==0) { output(n1, n2); top2 = ftell(f[F2]); get2(); } fseek(f[F2], bot2, 0); get2(); get1(); for(;;) { if(n1>0 && n2>0 && comp()==0) { output(n1, n2); get2(); } else if(n1>0 && n2>0 && comp()<0 || n2==0) { fseek(f[F2], bot2, 0); get2(); get1(); } else /*(n1>0 && n2>0 && comp()>0 || n1==0)*/{ fseek(f[F2], top2, 0); bot2 = top2; get2(); break; } } } } return(0); } input(n) /* get input line and split into fields */ { register int i, c; char *bp; char **pp; bp = buf[n]; pp = ppi[n]; if (fgets(bp, BUFSIZ, f[n]) == NULL) return(0); for (i = 0; ; i++) { if (sep1 == ' ') /* strip multiples */ while ((c = *bp) == sep1 || c == sep2) bp++; /* skip blanks */ else c = *bp; if (c == '\n' || c == '\0') break; *pp++ = bp; /* record beginning */ while ((c = *bp) != sep1 && c != '\n' && c != sep2 && c != '\0') bp++; *bp++ = '\0'; /* mark end by overwriting blank */ /* fails badly if string doesn't have \n at end */ } *pp = 0; return(i); } output(on1, on2) /* print items from olist */ int on1, on2; { int i; char *temp; if (no <= 0) { /* default case */ printf("%s", on1? ppi[F1][j1]: ppi[F2][j2]); for (i = 0; i < on1; i++) if (i != j1) printf("%c%s", sep1, ppi[F1][i]); for (i = 0; i < on2; i++) if (i != j2) printf("%c%s", sep1, ppi[F2][i]); printf("\n"); } else { for (i = 0; i < no; i++) { temp = ppi[olistf[i]][olist[i]]; if(olistf[i]==F1 && on1<=olist[i] || olistf[i]==F2 && on2<=olist[i] || *temp==0) temp = null; printf("%s", temp); if (i == no - 1) printf("\n"); else printf("%c", sep1); } } } error(s1, s2, s3, s4, s5) char *s1; { fprintf(stderr, "join: "); fprintf(stderr, s1, s2, s3, s4, s5); fprintf(stderr, "\n"); exit(1); } cmp(s1, s2) char *s1, *s2; { return(strcmp(s1, s2)); } 2][i]); printf("\n"); } else { for (i = 0; i < no; i++) { temp = ppi[olistf[i]][olist[i]]; if(olistf[i]==F1 && on1<=olist[i] || olistf[i]==F2 && on2<=olist[i] || *cmd/kill.c 444 0 33 3136 2427260572 5704 static char *sccsid = "@(#)kill.c 4.2 (Berkeley) 10/9/80"; /* * 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", 0, /* 9-16 */ "STOP", "TSTP", "CONT", "CHLD", "TTIN", "TTOU", "TINT", "XCPU", /* 17-24 */ "XFSZ", 0, 0, 0, 0, 0, 0, 0, /* 25-31 */ }; main(argc, argv) char **argv; { register signo, pid, res; int errlev; extern char *sys_errlist[]; extern errno; errlev = 0; if (argc <= 1) { usage: printf("usage: kill [ -sig ] pid ...\n"); printf("for a list of signals: kill -l\n"); exit(2); } if (*argv[1] == '-') { if (argv[1][1] == 'l') { for (signo = 1; 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 < 1 || signo > NSIG) { printf("kill: %s: number out of range\n", argv[1]); exit(1); } } else { char *name = argv[1]+1; for (signo = 1; 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 (**argv<'0' || **argv>'9') goto usage; res = kill(pid = atoi(*argv), signo); if (res<0) { printf("%u: %s\n", pid, sys_errlist[errno]); errlev = 1; } argc--; argv++; } return(errlev); } rgv[1]+1; for (signo = 1; 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 (**argv<'0' || **argv>'9') goto usage; res = kill(pid = atoi(*argv), signo); if (res<0) { printf("%u: cmd/getty.c 444 0 33 12705 2574142204 6121 static char *sccsid = "@(#)getty.c 4.4 (Berkeley) 8/13/81"; /* * getty -- adapt to terminal speed on dialup, and call login */ #include #include #include #include #define ERASE '#' #define KILL '@' #define CEOT 004 #define CKILL '@' #define CQUIT 034 /* FS, cntl shift L */ #define CINTR 0177 /* DEL */ #define CSTOP 023 /* Stop output: ctl-s */ #define CSTART 021 /* Start output: ctl-q */ #define CBRK 0377 struct sgttyb tmode; struct tab { char tname; /* this table name */ char nname; /* successor table name */ int iflags; /* initial flags */ int fflags; /* final flags */ int ispeed; /* input speed */ int ospeed; /* output speed */ char *message; /* login message */ } itab[] = { /* table '0'-1-2-3 300,1200,150,110 */ '0', 1, ANYP+RAW+NL1+CR1, ANYP+XTABS+ECHO+CRMOD+CR2, B300, B300, "\n\rlogin: ", 1, 2, ANYP+RAW+NL1+CR1, ANYP+XTABS+ECHO+CRMOD+FF1, B1200, B1200, "\n\rlogin: ", 2, 3, ANYP+RAW+NL1+CR1, EVENP+ECHO+FF1+CR2+TAB1+NL1, B150, B150, "\n\rlogin: ", 3, '0', ANYP+RAW+NL1+CR1, ANYP+ECHO+CRMOD+XTABS+LCASE+CR1, B110, B110, "\n\rlogin: ", /* table '-' -- Console TTY 110 */ '-', '-', ANYP+RAW+NL1+CR1, ANYP+ECHO+CRMOD+XTABS+LCASE+CR1, B110, B110, "\n\rlogin: ", /* table '1' -- 150 */ '1', '1', ANYP+RAW+NL1+CR1, EVENP+ECHO+FF1+CR2+TAB1+NL1, B150, B150, "\n\r\033:\006\006\017login: ", /* table '2' -- 9600 */ '2', '2', ANYP+RAW+NL1+CR1, ANYP+XTABS+ECHO+CRMOD, B9600, B9600, "\n\rlogin: ", /* table '3'-'5' -- 1200,300 *((/ '3', '5', ANYP+RAW+NL1+CR1, ANYP+XTABS+ECHO+CRMOD+FF1, B1200, B1200, "\n\rlogin: ", /* table '5'-'3' -- 300,1200 */ '5', '3', ANYP+RAW+NL1+CR1, ANYP+ECHO+CR1, B300, B300, "\n\rlogin: ", /* table '4' -- Console Decwriter */ '4', '4', ANYP+RAW, ANYP+ECHO+CRMOD+XTABS, B300, B300, "\n\rlogin: ", /* table '6' -- 2400 */ '6', '6' , ANYP+RAW , ANYP+ECHO+CRMOD , B2400 , B2400 , "\n\rlogin: ", /* table '7' - - 4800 */ '7' , '7' , ANYP+RAW , ANYP+ECHO+CRMOD , B4800 , B4800 , "\n\rlogin: " , /* table '8'-'9' - - 9600 - 300 */ '8', '9', ANYP+RAW+NL1+CR1, ANYP+XTABS+ECHO+CRMOD, B9600, B9600, "\n\rlogin: ", '9', '8', ANYP+RAW+NL1+CR2, ANYP+XTABS+ECHO+CRMOD+CR2, B300, B300, "\n\rlogin: ", /* table 'i' -- Interdata Console */ 'i', 'i', RAW+CRMOD, CRMOD+ECHO+LCASE, 0, 0, "\n\rlogin: ", /* table 'l' -- LSI Chess Terminal */ 'l', 'l', ANYP+RAW/*+HUPCL*/, ANYP+ECHO/*+HUPCL*/, B300, B300, "*", }; #define NITAB sizeof itab/sizeof itab[0] #define EOT 04 /* EOT char */ char name[16]; int crmod; int upper; int lower; char partab[] = { 0001,0201,0201,0001,0201,0001,0001,0201, 0202,0004,0003,0205,0005,0206,0201,0001, 0201,0001,0001,0201,0001,0201,0201,0001, 0001,0201,0201,0001,0201,0001,0001,0201, 0200,0000,0000,0200,0000,0200,0200,0000, 0000,0200,0200,0000,0200,0000,0000,0200, 0000,0200,0200,0000,0200,0000,0000,0200, 0200,0000,0000,0200,0000,0200,0200,0000, 0200,0000,0000,0200,0000,0200,0200,0000, 0000,0200,0200,0000,0200,0000,0000,0200, 0000,0200,0200,0000,0200,0000,0000,0200, 0200,0000,0000,0200,0000,0200,0200,0000, 0000,0200,0200,0000,0200,0000,0000,0200, 0200,0000,0000,0200,0000,0200,0200,0000, 0200,0000,0000,0200,0000,0200,0200,0000, 0000,0200,0200,0000,0200,0000,0000,0201 }; main(argc, argv) char **argv; { register struct tab *tabp; char tname; struct tchars tc; /* signal(SIGINT, 1); signal(SIGQUIT, 0); */ tname = '0'; if (argc > 1) tname = argv[1][0]; for (;;) { int ldisp = 0; for(tabp = itab; tabp < &itab[NITAB]; tabp++) if(tabp->tname == tname) break; if(tabp >= &itab[NITAB]) tabp = itab; tmode.sg_ispeed = tabp->ispeed; tmode.sg_ospeed = tabp->ospeed; tmode.sg_flags = tabp->iflags; tmode.sg_ispeed = tabp->ispeed; tmode.sg_ospeed = tabp->ospeed; stty(0, &tmode); tc.t_intrc = CINTR; tc.t_quitc = CQUIT; tc.t_stopc = CSTOP; tc.t_startc = CSTART; tc.t_brkc = CBRK; tc.t_eofc = CEOT; ioctl(0, TIOCSETC, &tc); ioctl(0, TIOCSETD, &ldisp); if (tmode.sg_ospeed > B1200) puts("\n\r\n\r"); else puts("\n\r\r\r\r\r\n\r\r\r\r\r"); puts(myname); puts("\n\r\r\r\r"); puts(tabp->message); /* * Wait a while, then flush input to get rid * of noise from open lines */ sleep(1); stty(0, &tmode); if(getname()) { if (upper == 0 && lower == 0) continue; tmode.sg_erase = ERASE; tmode.sg_kill = KILL; tmode.sg_flags = tabp->fflags; if(crmod) tmode.sg_flags |= CRMOD; if(upper) tmode.sg_flags |= LCASE; if(lower) tmode.sg_flags &= ~LCASE; stty(0, &tmode); putchr('\n'); execl("/bin/login", "login", name, 0); exit(1); } tname = tabp->nname; } } getname() { register char *np; register c; char cs; crmod = 0; upper = 0; lower = 0; np = name; for (;;) { if (read(0, &cs, 1) <= 0) exit(0); if ((c = cs&0177) == 0) return(0); if (c==EOT) exit(1); if (c=='\r' || c=='\n' || np >= &name[16]) break; putchr(cs); if (c>='a' && c <='z') lower++; else if (c>='A' && c<='Z') { upper++; } else if (c==ERASE) { if (np > name) np--; continue; } else if (c==KILL) { putchr('\r'); putchr('\n'); np = name; continue; } else if(c == ' ') c = '_'; *np++ = c; } *np = 0; if (c == '\r') crmod++; if (upper && !lower) for (np = name; *np; np++) if (isupper(*np)) *np = tolower(*np); return(1); } puts(as) char *as; { register char *s; s = as; while (*s) putchr(*s++); } putchr(cc) { char c; c = cc; c |= partab[c&0177] & 0200; write(1, &c, 1); } ; } else if (c==ERASE) { if (np > name) np--; ccmd/lastcomm.c 444 0 33 4665 2446560071 6576 static char *sccsid = "@(#)lastcomm.c 4.3 (Berkeley) 12/14/80"; # /* * last command */ # include # include # include # include # include # include # define N_USER 1000 struct acct acct_buff [BUFSIZ / sizeof (struct acct)]; char yes = 1, no = 0, user_list [1000][9]; time_t expand (); struct passwd *passwd, *getpwent (); struct stat stat_buff; main (argc, argv) char **argv; { char acct_desc, *p; long i, j, i_block, n_blocks, n_byte, n_entry; float x; /* * set up user names */ while (passwd = getpwent ()) { if (user_list[passwd->pw_uid][0]==0) move (passwd->pw_name, user_list [passwd->pw_uid]); } acct_desc = open ("/usr/adm/acct", 0); if (acct_desc < 0) { perror ("/usr/adm/acct"); return; } fstat (acct_desc, &stat_buff); n_blocks = (stat_buff.st_size + BUFSIZ - 1) / BUFSIZ; /* * read one block's worth */ for (i_block = n_blocks - 1; i_block >= 0; i_block--) { lseek (acct_desc, i_block * BUFSIZ, 0); n_byte = read (acct_desc, acct_buff, BUFSIZ); n_entry = n_byte / sizeof acct_buff [0]; for (i = n_entry - 1; i >= 0; i--) { if (!*user_list [acct_buff [i].ac_uid]) continue; /* * get the times */ x = expand (acct_buff [i].ac_utime) + expand (acct_buff [i].ac_stime); /* * null terminate the command name */ acct_buff [i].ac_comm [10] = 0; /* * replace missing command names with question marks */ if (!*acct_buff [i].ac_comm) { move ("?", acct_buff [i].ac_comm); } /* * replace control characters with question marks */ for (p = acct_buff [i].ac_comm; *p; p++) { if (*p < '!' || '~' < *p) *p = '?'; } for (j = 1; j < argc; j++) { if ( equal (acct_buff [i].ac_comm, argv [j]) || equal ( user_list [acct_buff [i].ac_uid], argv [j] ) ) { break; } } if (argc == 1 || j != argc) { printf ( "%-10s %-8s %6.2f %.16s\n", acct_buff [i].ac_comm, user_list [acct_buff [i].ac_uid], x / 60.0, ctime (&acct_buff [i].ac_btime) ); } } } } time_t expand (t) unsigned t; { register time_t nt; nt = t & 017777; t >>= 13; while (t) { t--; nt <<= 3; } return (nt); } move (a, b) char *a, *b; { while (*b++ = *a++); } equal (a, b) char *a, *b; { for (;; a++, b++) { if (*a != *b) return no; if (!*a) return yes; } } || j != argc) { printf ( "%-10s %-8s %6.2f %.16s\n", cmd/ld.c 444 0 33 131133 2522375074 5407 static char sccsid[] = "@(#)ld.c 4.4 4/26/81"; /* * ld - string table version for VAX */ #include #include #include #include #include #include #include #include #include /* * Basic strategy: * * The loader takes a number of files and libraries as arguments. * A first pass examines each file in turn. Normal files are * unconditionally loaded, and the (external) symbols they define and require * are noted in the symbol table. Libraries are searched, and the * library members which define needed symbols are remembered * in a special data structure so they can be selected on the second * pass. Symbols defined and required by library members are also * recorded. * * After the first pass, the loader knows the size of the basic text * data, and bss segments from the sum of the sizes of the modules which * were required. It has computed, for each ``common'' symbol, the * maximum size of any reference to it, and these symbols are then assigned * storage locations after their sizes are appropriately rounded. * The loader now knows all sizes for the eventual output file, and * can determine the final locations of external symbols before it * begins a second pass. * * On the second pass each normal file and required library member * is processed again. The symbol table for each such file is * reread and relevant parts of it are placed in the output. The offsets * in the local symbol table for externally defined symbols are recorded * since relocation information refers to symbols in this way. * Armed with all necessary information, the text and data segments * are relocated and the result is placed in the output file, which * is pasted together, ``in place'', by writing to it in several * different places concurrently. */ /* * Internal data structures * * All internal data structures are segmented and dynamically extended. * The basic structures hold 1103 (NSYM) symbols, ~~200 (NROUT) * referenced library members, and 100 (NSYMPR) private (local) symbols * per object module. For large programs and/or modules, these structures * expand to be up to 40 (NSEG) times as large as this as necessary. */ #define NSEG 40 /* Number of segments, each data structure */ #define NSYM 1103 /* Number of symbols per segment */ #define NROUT 250 /* Number of library references per segment */ #define NSYMPR 100 /* Number of private symbols per segment */ /* * Structure describing each symbol table s((egment. * Each segment has its own hash table. We record the first * address in and first address beyond both the symbol and hash * tables, for use in the routine symx and the lookup routine respectively. * The symfree routine also understands this structure well as it used * to back out symbols from modules we decide that we don't need in pass 1. * * Csymseg points to the current symbol table segment; * csymseg->sy_first[csymseg->sy_used] is the next symbol slot to be allocated, * (unless csymseg->sy_used == NSYM in which case we will allocate another * symbol table segment first.) */ struct symseg { struct nlist *sy_first; /* base of this alloc'ed segment */ struct nlist *sy_last; /* end of this segment, for n_strx */ int sy_used; /* symbols used in this seg */ struct nlist **sy_hfirst; /* base of hash table, this seg */ struct nlist **sy_hlast; /* end of hash table, this seg */ } symseg[NSEG], *csymseg; /* * The lookup routine uses quadratic rehash. Since a quadratic rehash * only probes 1/2 of the buckets in the table, and since the hash * table is segmented the same way the symbol table is, we make the * hash table have twice as many buckets as there are symbol table slots * in the segment. This guarantees that the quadratic rehash will never * fail to find an empty bucket if the segment is not full and the * symbol is not there. */ #define HSIZE (NSYM*2) /* * Xsym converts symbol table indices (ala x) into symbol table pointers. * Symx (harder, but never used in loops) inverts pointers into the symbol * table into indices using the symseg[] structure. */ #define xsym(x) (symseg[(x)/NSYM].sy_first+((x)%NSYM)) /* symx() is a function, defined below */ struct nlist cursym; /* current symbol */ struct nlist *lastsym; /* last symbol entered */ struct nlist *nextsym; /* next available symbol table entry */ struct nlist *addsym; /* first sym defined during incr load */ int nsym; /* pass2: number of local symbols in a.out */ /* nsym + symx(nextsym) is the symbol table size during pass2 */ struct nlist **lookup(), **slookup(); struct nlist *p_etext, *p_edata, *p_end, *entrypt; /* * Definitions of segmentation for library member table. * For each library we encounter on pass 1 we record pointers to all * members which we will load on pass 2. These are recorded as offsets * into the archive in the library member table. Libraries are * separated in the table by the special offset value -1. */ off_t li_init[NROUT]; struct libseg { off_t *li_first; int li_used; int li_used2; } libseg[NSEG] = { li_init, 0, 0, }, *clibseg = libseg; /* * In processing each module on pass 2 we must relocate references * relative to external symbols. These references are recorded * in the relocation information as relative to local symbol numbers * assigned to the external symbols when the module was created. * Thus before relocating the module in pass 2 we create a table * which maps these internal numbers to symbol table entries. * A hash table is constructed, based on the local symbol table indices, * for quick lookup of these symbols. */ #define LHSIZ 31 struct local { int l_index; /* index to symbol in file */ struct nlist *l_symbol; /* ptr to symbol table */ struct local *l_link; /* hash link */ } *lochash[LHSIZ], lhinit[NSYMPR]; struct locseg { struct local *lo_first; int lo_used; } locseg[NSEG] = { lhinit, 0 }, *clocseg; /* * Libraries are typically built with a table of contents, * which is the first member of a library with special file * name __.SYMDEF and contains a list of symbol names * and with each symbol the offset of the library member which defines * it. The loader uses this table to quickly tell which library members * are (potentially) useful. The alternative, examining the symbol * table of each library member, is painfully slow for large archives. * * See for the definition of the ranlib structure and an * explanation of the __.SYMDEF file format. */ int tnum; /* number of symbols in table of contents */ int ssiz; /* size of string table for table of contents */ struct ranlib *tab; /* the table of contents (dynamically allocated) */ char *tabstr; /* string table for table of contents */ /* * We open each input file or library only once, but in pass2 we * (historically) read from such a file at 2 different places at the * same time. These structures are remnants from those days, * and now serve only to catch ``Premature EOF''. */ typedef struct { short *fakeptr; int bno; int nibuf; int nuser; char buff[BSIZE]; } PAGE; PAGE page[2]; struct { short *fakeptr; int bno; int nibuf; int nuser; } fpage; typedef struct { char *ptr; int bno; int nibuf; long size; long pos; PAGE *pno; } STREAM; STREAM text; STREAM reloc; /* * Header from the a.out and the archive it is from (if any). */ struct exec filhdr; struct ar_hdr archdr; #define OARMAG 0177545 /* * Options. */ int trace; 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 dflag; /* define common even with rflag */ int zflag; /* demand paged */ long hsize; /* size of hole at beginning of data to be squashed */ int Aflag; /* doing incremental load */ int Nflag; /* want impure a.out */ int funding; /* reading fundamental file for incremental load */ int yflag; /* number of symbols to be traced */ char **ytab; /* the symbols */ /* * These are the cumulative sizes, set in pass 1, which * appear in the a.out header when the loader is finished. */ off_t tsize, dsize, bsize, trsize, drsize, ssize; /* * Symbol relocation: c?rel is a scale factor which is * added to an old relocation to convert it to new units; * i.e. it is the difference between segment origins. * (Thus if we are loading from a data segment which began at location * 4 in a .o file into an a.out where it will be loaded starting at * 1024, cdrel will be 1020.) */ long ctrel, cdrel, cbrel; /* * Textbase is the start address of all text, 0 unless given by -T. * Database is the base of all data, computed before and used during pass2. */ long textbase, database; /* * The base addresses for the loaded text, data and bss from the * current module during pass2 are given by torigin, dorigin and borigin. */ long 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; int delarg = 4; /* * The biobuf structure and associated routines are used to write * into one file at several places concurrently. Calling bopen * with a biobuf structure sets it up to write ``biofd'' starting * at the specified offset. You can then use ``bwrite'' and/or ``bputc'' * to stuff characters in the stream, much like ``fwrite'' and ``fputc''. * Calling bflush drains all the buffers and MUST be done before exit. */ struct biobuf { short b_nleft; /* Number free spaces left in b_buf */ /* Initialize to be less than BUFSIZ initially, to boundary align in file */ char *b_ptr; /* Next place to stuff characters */ char b_buf[BUFSIZ]; /* The buffer itself */ off_t b_off; /* Current file offset */ struct biobuf *b_link; /* Link in chain for bflush() */ } *biobufs; #define bputc(c,b) ((b)->b_nleft ? (--(b)->b_nleft, *(b)->b_ptr++ = (c)) \ : bflushc(b, c)) int biofd; off_t boffset; struct biobuf *tout, *dout, *trout, *drout, *sout, *strout; /* * Offset is the current offset in the string file. * Its initial value reflects the fact that we will * eventually stuff the size of the string table at the * beginning of the string table (i.e. offset itself!). */ off_t offset = sizeof (off_t); int ofilfnd; /* -o given; otherwise move l.out to a.out */ char *ofilename = "l.out"; int ofilemode; /* respect umask even for unsucessful ld's */ int infil; /* current input file descriptor */ char *filname; /* and its name */ /* * Base of the string table of the current module (pass1 and pass2). */ char *curstr; char get(); int delexit(); char *savestr(); main(argc, argv) char **argv; { register int c, i; int num; register char *ap, **p; char save; if (signal(SIGINT, SIG_IGN) != SIG_IGN) { signal(SIGINT, delexit); signal(SIGTERM, delexit); } if (argc == 1) exit(4); 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 'H': if (++c >= argc) error(1, "-H: arg missing"); if (tsize!=0) error(1, "-H: too late, some text already loaded"); hsize = atoi(*p++); continue; case 'A': if (++c >= argc) error(1, "-A: arg missing"); if (Aflag) error(1, "-A: only one base file allowed"); Aflag = 1; nflag = 0; funding = 1; load1arg(*p++); trsize = drsize = tsize = dsize = bsize = 0; ctrel = cdrel = cbrel = 0; funding = 0; addsym = nextsym; continue; case 'D': if (++c >= argc) error(1, "-D: arg missing"); num = htoi(*p++); if (dsize > num) error(1, "-D: too small"); dsize = num; continue; case 'T': if (++c >= argc) error(1, "-T: arg missing"); if (tsize!=0) error(1, "-T: too late, some text already loaded"); textbase = htoi(*p++); continue; case 'l': save = ap[--i]; ap[i]='-'; load1arg(&ap[i]); ap[i]=save; goto next; case 'M': Mfl((ag++; 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++; Nflag = zflag = 0; continue; case 'N': Nflag++; nflag = zflag = 0; continue; case 'd': dflag++; continue; case 'i': printf("ld: -i ignored\n"); continue; case 't': trace++; continue; case 'y': if (ap[i+1] == 0) error(1, "-y: symbol name missing"); if (yflag == 0) { ytab = (char **)calloc(argc, sizeof (char **)); if (ytab == 0) error(1, "ran out of memory (-y)"); } ytab[yflag++] = &ap[i+1]; goto next; case 'z': zflag++; Nflag = nflag = 0; continue; default: filname = savestr("-x"); /* kludge */ filname[1] = ap[i]; /* kludge */ archdr.ar_name[0] = 0; /* kludge */ error(1, "bad flag"); } next: ; } if (rflag == 0 && Nflag == 0 && nflag == 0) zflag++; endload(argc, argv); exit(0); } /* * Convert a ascii string which is a hex number. * Used by -T and -D options. */ htoi(p) register char *p; { register int c, n; n = 0; while (c = *p++) { n <<= 4; if (isdigit(c)) n += c - '0'; else if (c >= 'a' && c <= 'f') n += 10 + (c - 'a'); else if (c >= 'A' && c <= 'F') n += 10 + (c - 'A'); else error(1, "badly formed hex number"); } return (n); } delexit() { bflush(); unlink("l.out"); if (delarg==0 && Aflag==0) chmod(ofilename, ofilemode); exit (delarg); } endload(argc, argv) int argc; char **argv; { register int c, i; long dnum; register char *ap, **p; clibseg = libseg; filname = 0; middle(); setupout(); p = argv+1; for (c=1; c= tab;) { if (tp->ran_un.ran_strx < 0 || tp->ran_un.ran_strx >= ssiz) error(1, "mangled archive table of contents"); tp->ran_un.ran_name = tabstr + tp->ran_un.ran_strx; } while (ldrand()) continue; cfree((char *)tab); cfree(tabstr); nextlibp(-1); 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 += sizeof(archdr) + round(atol(archdr.ar_size), sizeof(short)); while (step(nloc)); break; } 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; { dseek(&text, nloc, (long) sizeof archdr); if (text.size <= 0) { nextlibp(-1); return (0); } getarhdr(); if (load1(1, nloc + (sizeof archdr))) nextlibp(nloc); return (1); } /* * Record the location of a useful archive member. * Recording -1 marks the end of files from an archive. * The liblist data structure is dynamically extended here. */ nextlibp(val) off_t val; { if (clibseg->li_used == NROUT) { if (++clibseg == &libseg[NSEG]) error(1, "too many files loaded from libraries"); clibseg->li_first = (off_t *)malloc(NROUT * sizeof (off_t)); if (clibseg->li_first == 0) error(1, "ran out of memory (nextlibp)"); } clibseg->li_first[clibseg->li_used++] = val; if (val != -1 && Mflag) printf("\t%s\n", archdr.ar_name); } /* * One pass over an archive with a table of contents. * Remember the number of symbols currently defined, * then call step on members which look promising (i.e. * that define a symbol which is currently externally undefined). * Indicate to our caller whether this process netted any more symbols. */ ldrand() { register struct nlist *sp, **hp; register struct ranlib *tp, *tplast; off_t loc; int nsymt = symx(nextsym); tplast = &tab[tnum-1]; for (tp = tab; tp <= tplast; tp++) { if ((hp = slookup(tp->ran_un.ran_name)) == 0) continue; sp = *hp; 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 (symx(nextsym) != nsymt); } /* * Examine a single file or archive member on pass 1. */ load1(libflg, loc) off_t loc; { register struct nlist *sp; struct nlist *savnext; int ndef, nlocal, type, size, nsymt; register int i; off_t maxoff; struct stat stb; readhdr(loc); if (filhdr.a_syms == 0) { if (filhdr.a_text+filhdr.a_data == 0) return (0); error(1, "no namelist"); } if (libflg) maxoff = atol(archdr.ar_size); else { fstat(infil, &stb); maxoff = stb.st_size; } if (N_STROFF(filhdr) + sizeof (off_t) >= maxoff) error(1, "too small (old format .o?)"); ctrel = tsize; cdrel += dsize; cbrel += bsize; ndef = 0; nlocal = sizeof(cursym); savnext = nextsym; loc += N_SYMOFF(filhdr); dseek(&text, loc, filhdr.a_syms); dseek(&reloc, loc + filhdr.a_syms, sizeof(off_t)); mget(&size, sizeof (size), &reloc); dseek(&reloc, loc + filhdr.a_syms+sizeof (off_t), size-sizeof (off_t)); curstr = (char *)malloc(size); if (curstr == NULL) error(1, "no space for string table"); mget(curstr+sizeof(off_t), size-sizeof(off_t), &reloc); while (text.size > 0) { mget((char *)&cursym, sizeof(struct nlist), &text); if (cursym.n_un.n_strx) { if (cursym.n_un.n_strx=size) error(1, "bad string table index (pass 1)"); cursym.n_un.n_name = curstr + cursym.n_un.n_strx; } type = cursym.n_type; if ((type&N_EXT)==0) { if (Xflag==0 || cursym.n_un.n_name[0]!='L' || type & N_STAB) nlocal += sizeof cursym; continue; } symreloc(); if (enter(lookup())) continue; if ((sp = lastsym)->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; 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; } if (libflg==0 || ndef) { tsize += filhdr.a_text; dsize += round(filhdr.a_data, sizeof (long)); bsize += round(filhdr.a_bss, sizeof (long)); ssize += nlocal; trsize += filhdr.a_trsize; drsize += filhdr.a_drsize; if (funding) textbase = (*slookup("_end"))->n_value; nsymt = symx(nextsym); for (i = symx(savnext); i < nsymt; i++) { sp = xsym(i); sp->n_un.n_name = savestr(sp->n_un.n_name); } free(curstr); return (1); } /* * No symbols defined by this library member. * Rip out the hash table entries and reset the symbol table. */ symfree(savnext); free(curstr); return(0); } middle() { register struct nlist *sp; long csize, t, corigin, ocsize; int nund, rnd; char s; register int i; int nsymt; 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. */ nsymt = symx(nextsym); if (rflag==0) { for (i = 0; i < nsymt; i++) { sp = xsym(i); if (sp->n_type==N_EXT+N_UNDF && sp->n_value==0 && sp!=p_end && sp!=p_edata && sp!=p_etext) { rflag++; dflag = 0; break; } } } if (rflag) sflag = zflag = 0; /* * Assign common locations. */ csize = 0; if (!Aflag) addsym = symseg[0].sy_first; database = round(tsize+textbase, (nflag||zflag? PAGSIZ : sizeof (long))); database += hsize; 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 = symx(addsym); i < nsymt; i++) { sp = xsym(i); if ((s=sp->n_type)==N_EXT+N_UNDF && (t = sp->n_value)!=0) { if (t >= sizeof (double)) rnd = sizeof (double); else if (t >= sizeof (long)) rnd = sizeof (long); else rnd = sizeof (short); csize = round(csize, rnd); sp->n_value = csize; sp->n_type = N_EXT+N_COMM; ocsize = csize; csize += t; } if (s&N_EXT && (s&N_TYPE)==N_UNDF && s&N_STAB) { sp->n_v((alue = ocsize; sp->n_type = (s&N_STAB) | (N_EXT+N_COMM); } } } /* * Now set symbols to their final value */ csize = round(csize, sizeof (long)); torigin = textbase; dorigin = database; corigin = dorigin + dsize; borigin = corigin + csize; nund = 0; nsymt = symx(nextsym); for (i = symx(addsym); in_type & (N_TYPE+N_EXT)) { case N_EXT+N_UNDF: if (arflag == 0) errlev |= 01; if ((arflag==0 || dflag) && sp->n_value==0) { if (sp==p_end || sp==p_etext || sp==p_edata) continue; if (nund==0) printf("Undefined:\n"); nund++; printf("%s\n", sp->n_un.n_name); } continue; case N_EXT+N_ABS: default: continue; case N_EXT+N_TEXT: sp->n_value += torigin; continue; case N_EXT+N_DATA: sp->n_value += dorigin; continue; case N_EXT+N_BSS: sp->n_value += borigin; continue; case N_EXT+N_COMM: sp->n_type = (sp->n_type & N_STAB) | (N_EXT+N_BSS); sp->n_value += corigin; continue; } } if (sflag || xflag) ssize = 0; bsize += csize; nsym = ssize / (sizeof cursym); if (Aflag) { fixspec(p_etext,torigin); fixspec(p_edata,dorigin); fixspec(p_end,borigin); } } fixspec(sym,offset) struct nlist *sym; long offset; { if(symx(sym) < symx(addsym) && sym!=0) sym->n_value += offset; } ldrsym(sp, val, type) register struct nlist *sp; long val; { if (sp == 0) return; if ((sp->n_type != N_EXT+N_UNDF || sp->n_value) && !Aflag) { printf("%s: ", sp->n_un.n_name); error(0, "user attempt to redfine loader-defined symbol"); return; } sp->n_type = type; sp->n_value = val; } off_t wroff; struct biobuf toutb; setupout() { int bss; extern char *sys_errlist[]; extern int errno; ofilemode = 0777 & ~umask(0); biofd = creat(ofilename, 0666 & ofilemode); if (biofd < 0) { filname = ofilename; /* kludge */ archdr.ar_name[0] = 0; /* kludge */ error(1, sys_errlist[errno]); /* kludge */ } else { struct stat mybuf; /* kls kludge */ fstat(biofd, &mybuf); /* suppose file exists, wrong*/ if(mybuf.st_mode & 0111) { /* mode, ld fails? */ chmod(ofilename, mybuf.st_mode & 0666); ofilemode = mybuf.st_mode; } } tout = &toutb; bopen(tout, 0); filhdr.a_magic = nflag ? NMAGIC : (zflag ? ZMAGIC : OMAGIC); filhdr.a_text = nflag ? tsize : round(tsize, zflag ? PAGSIZ : sizeof (long)); filhdr.a_data = zflag ? round(dsize, PAGSIZ) : dsize; bss = bsize - (filhdr.a_data - dsize); if (bss < 0) bss = 0; filhdr.a_bss = bss; filhdr.a_trsize = trsize; filhdr.a_drsize = drsize; filhdr.a_syms = sflag? 0: (ssize + (sizeof cursym)*symx(nextsym)); if (entrypt) { if (entrypt->n_type!=N_EXT+N_TEXT) error(0, "entry point not in text"); else filhdr.a_entry = entrypt->n_value; } else filhdr.a_entry = 0; filhdr.a_trsize = (rflag ? trsize:0); filhdr.a_drsize = (rflag ? drsize:0); bwrite((char *)&filhdr, sizeof (filhdr), tout); if (zflag) { bflush1(tout); biobufs = 0; bopen(tout, PAGSIZ); } wroff = N_TXTOFF(filhdr) + filhdr.a_text; outb(&dout, filhdr.a_data); if (rflag) { outb(&trout, filhdr.a_trsize); outb(&drout, filhdr.a_drsize); } if (sflag==0 || xflag==0) { outb(&sout, filhdr.a_syms); wroff += sizeof (offset); outb(&strout, 0); } } outb(bp, inc) register struct biobuf **bp; { *bp = (struct biobuf *)malloc(sizeof (struct biobuf)); if (*bp == 0) error(1, "ran out of memory (outb)"); bopen(*bp, wroff); wroff += inc; } load2arg(acp) char *acp; { register char *cp; off_t loc; cp = acp; if (getfile(cp) == 0) { while (*cp) cp++; while (cp >= acp && *--cp != '/'); mkfsym(++cp); load2(0L); } else { /* scan archive members referenced */ for (;;) { if (clibseg->li_used2 == clibseg->li_used) { if (clibseg->li_used < NROUT) error(1, "libseg botch"); clibseg++; } loc = clibseg->li_first[clibseg->li_used2++]; if (loc == -1) break; dseek(&text, loc, (long)sizeof(archdr)); getarhdr(); mkfsym(archdr.ar_name); load2(loc + (long)sizeof(archdr)); } } close(infil); } load2(loc) long loc; { int size; register struct nlist *sp; register struct local *lp; register int symno, i; int type; readhdr(loc); if (!funding) { ctrel = torigin; cdrel += dorigin; cbrel += borigin; } /* * Reread the symbol table, recording the numbering * of symbols for fixing external references. */ for (i = 0; i < LHSIZ; i++) lochash[i] = 0; clocseg = locseg; clocseg->lo_used = 0; symno = -1; loc += N_TXTOFF(filhdr); dseek(&text, loc+filhdr.a_text+filhdr.a_data+ filhdr.a_trsize+filhdr.a_drsize+filhdr.a_syms, sizeof(off_t)); mget(&size, sizeof(size), &text); dseek(&text, loc+filhdr.a_text+filhdr.a_data+ filhdr.a_trsize+filhdr.a_drsize+filhdr.a_syms+sizeof(off_t), size - sizeof(off_t)); curstr = (char *)malloc(size); if (curstr == NULL) error(1, "out of space reading string table (pass 2)"); mget(curstr+sizeof(off_t), size-sizeof(off_t), &text); dseek(&text, loc+filhdr.a_text+filhdr.a_data+ filhdr.a_trsize+filhdr.a_drsize, filhdr.a_syms); while (text.size > 0) { symno++; mget((char *)&cursym, sizeof(struct nlist), &text); if (cursym.n_un.n_strx) { if (cursym.n_un.n_strx=size) error(1, "bad string table index (pass 2)"); cursym.n_un.n_name = curstr + cursym.n_un.n_strx; } /* inline expansion of symreloc() */ switch (cursym.n_type & 017) { 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; } /* end inline expansion of symreloc() */ type = cursym.n_type; if (yflag && cursym.n_un.n_name) for (i = 0; i < yflag; i++) /* fast check for 2d character! */ if (ytab[i][1] == cursym.n_un.n_name[1] && !strcmp(ytab[i], cursym.n_un.n_name)) { tracesym(); break; } if ((type&N_EXT) == 0) { if (!sflag&&!xflag&& (!Xflag||cursym.n_un.n_name[0]!='L'||type&N_STAB)) symwrite(&cursym, sout); continue; } if (funding) continue; if ((sp = *lookup()) == 0) error(1, "internal error: symbol not found"); if (cursym.n_type == N_EXT+N_UNDF) { if (clocseg->lo_used == NSYMPR) { if (++clocseg == &locseg[NSEG]) error(1, "local symbol overflow"); clocseg->lo_used = 0; } if (clocseg->lo_first == 0) { clocseg->lo_first = (struct local *) malloc(NSYMPR * sizeof (struct local)); if (clocseg->lo_first == 0) error(1, "out of memory (clocseg)"); } lp = &clocseg->lo_first[clocseg->lo_used++]; lp->l_index = symno; lp->l_symbol = sp; lp->l_link = lochash[symno % LHSIZ]; lochash[symno % LHSIZ] = lp; continue; } if (cursym.n_type & N_STAB) continue; if (cursym.n_type!=sp->n_type || cursym.n_value!=sp->n_value) { printf("%s: ", cursym.n_un.n_name); error(0, "multiply defined"); } } if (funding) return; dseek(&text, loc, filhdr.a_text); dseek(&reloc, loc+filhdr.a_text+filhdr.a_data, filhdr.a_trsize); load2td(ctrel, torigin - textbase, tout, trout); dseek(&text, loc+filhdr.a_text, filhdr.a_data); dseek(&reloc, loc+filhdr.a_text+filhdr.a_data+filhdr.a_trsize, filhdr.a_drsize); load2td(cdrel, dorigin - database, dout, drout); while (filhdr.a_data & (sizeof(long)-1)) { bputc(0, dout); filhdr.a_data++; } torigin += filhdr.a_text; dorigin += round(filhdr.a_data, sizeof (long)); borigin += round(filhdr.a_bss, sizeof (long)); free(curstr); } struct tynames { int ty_value; char *ty_name; } tynames[] = { N_UNDF, "undefined", N_ABS, "absolute", N_TEXT, "text", N_DATA, "data", N_BSS, "bss", N_COMM, "common", 0, 0, }; tracesym() { register struct tynames *tp; if (cursym.n_type & N_STAB) return; printf("%s", filname); if (archdr.ar_name[0]) printf("(%s)", archdr.ar_name); printf(": "); if ((cursym.n_type&N_TYPE) == N_UNDF && cursym.n_value) { printf("definition of common %s size %d\n", cursym.n_un.n_name, cursym.n_value); return; } for (tp = tynames; tp->ty_name; tp++) if (tp->ty_value == (cursym.n_type&N_TYPE)) break; printf((cursym.n_type&N_TYPE) ? "definition of" : "reference to"); if (cursym.n_type&N_EXT) printf(" external"); if (tp->ty_name) printf(" %s", tp->ty_name); printf(" %s\n", cursym.n_un.n_name); } /* * This routine relocates the single text or data segment argument. * Offsets from external symbols are resolved by adding the value * of the external symbols. Non-external reference are updated to account * for the relative motion of the segments (ctrel, cdrel, ...). If * a relocation was pc-relative, then we update it to reflect the * change in the positioning of the segments by adding the displacement * of the referenced segment and subtracting the displacement of the * current segment (creloc). * * If we are saving the relocation information, then we increase * each relocation datum address by our base position in the new segment. */ load2td(creloc, position, b1, b2) long creloc, offset; struct biobuf *b1, *b2; { register struct nlist *sp; register struct local *lp; long tw; register struct relocation_info *rp, *rpend; struct relocation_info *relp; char *codep; register char *cp; int relsz, codesz; relsz = reloc.size; relp = (struct relocation_info *)malloc(relsz); codesz = text.size; codep = (char *)malloc(codesz); if (relp == 0 || codep == 0) error(1, "out of memory (load2td)"); mget((char *)relp, relsz, &reloc); rpend = &relp[relsz / sizeof (struct relocation_info)]; mget(codep, codesz, &text); for (rp = relp; rp < rpend; rp++) { cp = codep + rp->r_address; /* * Pick up previous value at location to be relocated. */ switch (rp->r_length) { case 0: /* byte */ tw = *cp; break; case 1: /* word */ tw = *(short *)cp; break; case 2: /* long */ tw = *(long *)cp; break; default: error(1, "load2td botch: bad length"); } /* * If relative to an external which is defined, * resolve to a simpler kind of reference ((in the * result file. If the external is undefined, just * convert the symbol number to the number of the * symbol in the result file and leave it undefined. */ if (rp->r_extern) { /* * Search the hash table which maps local * symbol numbers to symbol tables entries * in the new a.out file. */ lp = lochash[rp->r_symbolnum % LHSIZ]; while (lp->l_index != rp->r_symbolnum) { lp = lp->l_link; if (lp == 0) error(1, "local symbol botch"); } sp = lp->l_symbol; if (sp->n_type == N_EXT+N_UNDF) rp->r_symbolnum = nsym+symx(sp); else { rp->r_symbolnum = sp->n_type & N_TYPE; tw += sp->n_value; rp->r_extern = 0; } } else switch (rp->r_symbolnum & N_TYPE) { /* * Relocation is relative to the loaded position * of another segment. Update by the change in position * of that segment. */ case N_TEXT: tw += ctrel; break; case N_DATA: tw += cdrel; break; case N_BSS: tw += cbrel; break; case N_ABS: break; default: error(1, "relocation format botch (symbol type))"); } /* * Relocation is pc relative, so decrease the relocation * by the amount the current segment is displaced. * (E.g if we are a relative reference to a text location * from data space, we added the increase in the text address * above, and subtract the increase in our (data) address * here, leaving the net change the relative change in the * positioning of our text and data segments.) */ if (rp->r_pcrel) tw -= creloc; /* * Put the value back in the segment, * while checking for overflow. */ switch (rp->r_length) { case 0: /* byte */ if (tw < -128 || tw > 127) error(0, "byte displacement overflow"); *cp = tw; break; case 1: /* word */ if (tw < -32768 || tw > 32767) error(0, "word displacement overflow"); *(short *)cp = tw; break; case 2: /* long */ *(long *)cp = tw; break; } /* * If we are saving relocation information, * we must convert the address in the segment from * the old .o file into an address in the segment in * the new a.out, by adding the position of our * segment in the new larger segment. */ if (rflag) rp->r_address += position; } bwrite(codep, codesz, b1); if (rflag) bwrite(relp, relsz, b2); cfree((char *)relp); cfree(codep); } finishout() { register int i; int nsymt; if (sflag==0) { nsymt = symx(nextsym); for (i = 0; i < nsymt; i++) symwrite(xsym(i), sout); bwrite(&offset, sizeof offset, sout); } if (!ofilfnd) { unlink("a.out"); if (link("l.out", "a.out") < 0) error(1, "cannot move l.out to a.out"); ofilename = "a.out"; } delarg = errlev; delexit(); } mkfsym(s) char *s; { if (sflag || xflag) return; cursym.n_un.n_name = s; cursym.n_type = N_TEXT; cursym.n_value = torigin; symwrite(&cursym, sout); } getarhdr() { register char *cp; mget((char *)&archdr, sizeof archdr, &text); for (cp=archdr.ar_name; cp<&archdr.ar_name[sizeof(archdr.ar_name)];) if (*cp++ == ' ') { cp[-1] = 0; return; } } mget(loc, n, sp) register STREAM *sp; register char *loc; { register char *p; register int take; top: if (n == 0) return; if (sp->size && sp->nibuf) { p = sp->ptr; take = sp->size; if (take > sp->nibuf) take = sp->nibuf; if (take > n) take = n; n -= take; sp->size -= take; sp->nibuf -= take; sp->pos += take; do *loc++ = *p++; while (--take > 0); sp->ptr = p; goto top; } if (n > BUFSIZ) { take = n - n % BSIZE; lseek(infil, (sp->bno+1)*BSIZE, 0); if (take > sp->size || read(infil, loc, take) != take) error(1, "premature EOF"); loc += take; n -= take; sp->size -= take; sp->pos += take; dseek(sp, (sp->bno+1+take/BSIZE)*BSIZE, -1); goto top; } *loc++ = get(sp); --n; goto top; } symwrite(sp, bp) struct nlist *sp; struct biobuf *bp; { register int len; register char *str; str = sp->n_un.n_name; if (str) { sp->n_un.n_strx = offset; len = strlen(str) + 1; bwrite(str, len, strout); offset += len; } bwrite(sp, sizeof (*sp), bp); sp->n_un.n_name = str; } dseek(sp, loc, s) register STREAM *sp; long loc, s; { register PAGE *p; register b, o; int n; b = loc>>BSHIFT; o = loc&BMASK; if (o&01) error(1, "loader error; odd offset"); --sp->pno->nuser; if ((p = &page[0])->bno!=b && (p = &page[1])->bno!=b) if (p->nuser==0 || (p = &page[0])->nuser==0) { if (page[0].nuser==0 && page[1].nuser==0) if (page[0].bno < page[1].bno) p = &page[0]; p->bno = b; lseek(infil, loc & ~(long)BMASK, 0); if ((n = read(infil, p->buff, sizeof(p->buff))) < 0) n = 0; p->nibuf = n; } else error(1, "botch: no pages"); ++p->nuser; sp->bno = b; sp->pno = p; if (s != -1) {sp->size = s; sp->pos = 0;} sp->ptr = (char *)(p->buff + o); if ((sp->nibuf = p->nibuf-o) <= 0) sp->size = 0; } char get(asp) STREAM *asp; { register STREAM *sp; sp = asp; if ((sp->nibuf -= sizeof(char)) < 0) { dseek(sp, ((long)(sp->bno+1)<nibuf -= sizeof(char); } if ((sp->size -= sizeof(char)) <= 0) { if (sp->size < 0) error(1, "premature EOF"); ++fpage.nuser; --sp->pno->nuser; sp->pno = (PAGE *) &fpage; } sp->pos += sizeof(char); return(*sp->ptr++); } getfile(acp) char *acp; { register char *cp; register int c; char arcmag[SARMAG+1]; struct stat stb; cp = acp; infil = -1; archdr.ar_name[0] = '\0'; filname = cp; if (cp[0]=='-' && cp[1]=='l') { char *locfilname = "/usr/local/lib/libxxxxxxxxxxxxxxx"; if(cp[2] == '\0') cp = "-la"; filname = "/usr/lib/libxxxxxxxxxxxxxxx"; for(c=0; cp[c+2]; c++) { filname[c+12] = cp[c+2]; locfilname[c+18] = cp[c+2]; } filname[c+12] = locfilname[c+18] = '.'; filname[c+13] = locfilname[c+19] = 'a'; filname[c+14] = locfilname[c+20] = '\0'; if ((infil = open(filname+4, 0)) >= 0) { filname += 4; } else if ((infil = open(filname, 0)) < 0) { filname = locfilname; } } if (infil == -1 && (infil = open(filname, 0)) < 0) error(1, "cannot open"); page[0].bno = page[1].bno = -1; page[0].nuser = page[1].nuser = 0; text.pno = reloc.pno = (PAGE *) &fpage; fpage.nuser = 2; dseek(&text, 0L, SARMAG); if (text.size <= 0) error(1, "premature EOF"); mget((char *)arcmag, SARMAG, &text); arcmag[SARMAG] = 0; if (strcmp(arcmag, ARMAG)) return (0); dseek(&text, SARMAG, sizeof archdr); if(text.size <= 0) return (1); getarhdr(); if (strncmp(archdr.ar_name, "__.SYMDEF", sizeof(archdr.ar_name)) != 0) return (1); fstat(infil, &stb); return (stb.st_mtime > atol(archdr.ar_date) ? 3 : 2); } struct nlist ** lookup() { register int sh; register struct nlist **hp; register char *cp, *cp1; register struct symseg *gp; register int i; sh = 0; for (cp = cursym.n_un.n_name; *cp;) sh = (sh<<1) + *cp++; sh = (sh & 0x7fffffff) % HSIZE; for (gp = symseg; gp < &symseg[NSEG]; gp++) { if (gp->sy_first == 0) { gp->sy_first = (struct nlist *) calloc(NSYM, sizeof (struct nlist)); gp->sy_hfirst = (struct nlist **) calloc(HSIZE, sizeof (struct nlist *)); if (gp->sy_first == 0 || gp->sy_hfirst == 0) error(1, "ran out of space for symbol table"); gp->sy_last = gp->sy_first + NSYM; gp->sy_hlast = gp->sy_hfirst + HSIZE; } if (gp > csymseg) csymseg = gp; hp = gp->sy_hfirst + sh; i = 1; do { if (*hp == 0) { if (gp->sy_used == NSYM) break; return (hp); } cp1 = (*hp)->n_un.n_name; for (cp = cursym.n_un.n_name; *cp == *cp1++;) if (*cp++ == 0) return (hp); hp += i; i += 2; if (hp >= gp->sy_hlast) hp -= HSIZE; } while (i < HSIZE); if (i > HSIZE) error(1, "hash table botch"); } error(1, "symbol table overflow"); /*NOTREACHED*/ } symfree(saved) struct nlist *saved; { register struct symseg *gp; register struct nlist *sp; for (gp = csymseg; gp >= symseg; gp--, csymseg--) { sp = gp->sy_first + gp->sy_used; if (sp == saved) { nextsym = sp; return; } for (sp--; sp >= gp->sy_first; sp--) { gp->sy_hfirst[sp->n_hash] = 0; gp->sy_used--; if (sp == saved) { nextsym = sp; return; } } } if (saved == 0) return; error(1, "symfree botch"); } struct nlist ** slookup(s) char *s; { cursym.n_un.n_name = s; cursym.n_type = N_EXT+N_UNDF; cursym.n_value = 0; return (lookup()); } enter(hp) register struct nlist **hp; { register struct nlist *sp; if (*hp==0) { if (hp < csymseg->sy_hfirst || hp >= csymseg->sy_hlast) error(1, "enter botch"); *hp = lastsym = sp = csymseg->sy_first + csymseg->sy_used; csymseg->sy_used++; sp->n_un.n_name = cursym.n_un.n_name; sp->n_type = cursym.n_type; sp->n_hash = hp - csymseg->sy_hfirst; sp->n_value = cursym.n_value; nextsym = lastsym + 1; return(1); } else { lastsym = *hp; return(0); } } symx(sp) struct nlist *sp; { register struct symseg *gp; if (sp == 0) return (0); for (gp = csymseg; gp >= symseg; gp--) /* <= is sloppy so nextsym will always work */ if (sp >= gp->sy_first && sp <= gp->sy_last) return ((gp - symseg) * NSYM + sp - gp->sy_first); error(1, "symx botch"); /*NOTREACHED*/ } symreloc() { if(funding) return; switch (cursym.n_type & 017) { case N_TEXT: case N_EXT+N_TEXT: cursym.n_value += ctrel; return; case N_DATA: case N_EXT+N_DATA: cursym.n_value += cdrel; return; case N_BSS: case N_EXT+N_BSS: cursym.n_value += cbrel; return; case N_EXT+N_UNDF: return; default: if (cursym.n_type&N_EXT) cursym.n_type = N_EXT+N_ABS; return; } } error(n, s) char *s; { if (errlev==0) printf("ld:"); if (filname) { printf("%s", filname); if (n != -1 && archdr.ar_name[0]) printf("(%s)", archdr.ar_name); printf(": "); } printf("%s\n", s); if (n == -1) return; if (n) delexit(); errlev = 2; } readhdr(loc) off_t loc; { dseek(&text, loc, (long)sizeof(filhdr)); mget((short *)&filhdr, sizeof(filhdr), &text); if (N_BADMAG(filhdr)) { if (filhdr.a_magic == OARMAG) error(1, "old archive"); error(1, "bad magic number"); } if (filhdr.a_text&01 || filhdr.a_data&01) error(1, "text/data size odd"); if (filhdr.a_magic == NMAGIC || filhdr.a_magic == ZMAGIC) { cdrel = -round(filhdr.a_tex((t, PAGSIZ); cbrel = cdrel - filhdr.a_data; } else if (filhdr.a_magic == OMAGIC) { cdrel = -filhdr.a_text; cbrel = cdrel - filhdr.a_data; } else error(1, "bad format"); } round(v, r) int v; u_long r; { r--; v += r; v &= ~(long)r; return(v); } #define NSAVETAB 8192 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) error(1, "ran out of memory (savestr)"); } strncpy(savetab, cp, len); cp = savetab; savetab += len; saveleft -= len; return (cp); } bopen(bp, off) struct biobuf *bp; { bp->b_ptr = bp->b_buf; bp->b_nleft = BUFSIZ - off % BUFSIZ; bp->b_off = off; bp->b_link = biobufs; biobufs = bp; } int bwrerror; bwrite(p, cnt, bp) register char *p; register int cnt; register struct biobuf *bp; { register int put; register char *to; top: if (cnt == 0) return; if (bp->b_nleft) { put = bp->b_nleft; if (put > cnt) put = cnt; bp->b_nleft -= put; to = bp->b_ptr; asm("movc3 r8,(r11),(r7)"); bp->b_ptr += put; p += put; cnt -= put; goto top; } if (cnt >= BUFSIZ) { if (bp->b_ptr != bp->b_buf) bflush1(bp); put = cnt - cnt % BUFSIZ; if (boffset != bp->b_off) lseek(biofd, bp->b_off, 0); if (write(biofd, p, put) != put) { bwrerror = 1; error(1, "output write error"); } bp->b_off += put; boffset = bp->b_off; p += put; cnt -= put; goto top; } bflush1(bp); goto top; } bflush() { register struct biobuf *bp; if (bwrerror) return; for (bp = biobufs; bp; bp = bp->b_link) bflush1(bp); } bflush1(bp) register struct biobuf *bp; { register int cnt = bp->b_ptr - bp->b_buf; if (cnt == 0) return; if (boffset != bp->b_off) lseek(biofd, bp->b_off, 0); if (write(biofd, bp->b_buf, cnt) != cnt) { bwrerror = 1; error(1, "output write error"); } bp->b_off += cnt; boffset = bp->b_off; bp->b_ptr = bp->b_buf; bp->b_nleft = BUFSIZ; } bflushc(bp, c) register struct biobuf *bp; { bflush1(bp); bputc(c, bp); } rerror) return; for (bp = biobufs; bp; bp = bp->b_link) bflush1(bp); } bflush1(bp) register struct biobuf *bp; { register int cnt = bp->b_ptr - bp->b_buf; if (cnt == 0) return; if (boffset != bp->b_off) lseek(biofd, bp->b_off, 0); if (write(biofd, bp->b_buf, cnt) != cnt) { bwrerror = 1; error(1, "output write error"); } bp->b_off += cnt; boffset = bp->b_off; bp->b_ptr = bp->b_buf; bp->b_nleft cmd/leave.c 444 0 33 5612 2416240040 6030 static char *sccsid = "@(#)leave.c 4.1 (Berkeley) 10/1/80"; #include /* * leave [hhmm] * * Reminds you when you have to leave. * Leave prompts for input and goes away if you hit return. * It nags you like a mother hen. */ char origlogin[20], thislogin[20]; char *getlogin(); char *whenleave; char *ctime(); char buff[100]; main(argc,argv) char **argv; { long when, tod, now, diff, hours, minutes; int *nv; int atoi(); int *localtime(); if (argc < 2) { printf("When do you have to leave? "); fflush(stdout); buff[read(0,buff,sizeof buff)] = 0; } else { strcpy(buff,argv[1]); } if (buff[0] == '\n') exit(0); if (buff[0] == '+') { diff = atoi(buff+1); doalarm(diff); } if (buff[0] < '0' || buff[0] > '9') { printf("usage: %s [hhmm]\n",argv[0]); exit(1); } strcpy(origlogin,getlogin()); tod = atoi(buff); hours = tod / 100; if (hours > 12) hours -= 12; if (hours == 12) hours = 0; minutes = tod % 100; if (hours < 0 || hours > 12 || minutes < 0 || minutes > 59) { printf("usage: %s [hhmm]\n",argv[0]); exit(1); } setexit(); /* refigure time if killed */ time(&now); nv = localtime(&now); when = 60*hours+minutes; if (nv[2] > 12) nv[2] -= 12; /* do am/pm bit */ now = 60*nv[2] + nv[1]; diff = when - now; while (diff < 0) diff += 12*60; if (diff > 11*60) printf("That time has already passed!\n"); doalarm(diff); exit(0); } doalarm(nmins) long nmins; { char *msg1, *msg2, *msg3, *msg4; register int i; int slp1, slp2, slp3, slp4; int seconds, gseconds; long daytime; seconds = 60 * nmins; if (seconds <= 0) seconds = 1; gseconds = seconds; msg1 = "You have to leave in 5 minutes"; if (seconds <= 60*5) { slp1 = 0; } else { slp1 = seconds - 60*5; seconds = 60*5; } msg2 = "Just one more minute!"; if (seconds <= 60) { slp2 = 0; } else { slp2 = seconds - 60; seconds = 60; } msg3 = "Time to leave!"; slp3 = seconds; msg4 = "You're going to be late!"; slp4 = 60; time(&daytime); daytime += gseconds; whenleave = ctime(&daytime); printf("Alarm set for %s\n",whenleave); if (fork()) exit(0); signal(2,1); signal(3,1); signal(15,1); if (slp1) bother(slp1,msg1); if (slp2) bother(slp2,msg2); bother(slp3,msg3); for (;;) { bother(slp4,msg4); } } bother(slp,msg) int slp; char *msg; { delay(slp); printf("\7\7\7"); printf("%s\n",msg); } /* * delay is like sleep but does it in 100 sec pieces and * knows what zero means. */ delay(secs) int secs; { int n; while(secs>0) { n = 100; secs = secs - 100; if (secs < 0) { n = n + secs; } if (n > 0) sleep(n); strcpy(thislogin,getlogin()); if (strcmp(origlogin, thislogin)) exit(0); } } #ifdef V6 char *getlogin() { #include static struct utmp ubuf; int ufd; ufd = open("/etc/utmp",0); seek(ufd, ttyn(0)*sizeof(ubuf), 0); read(ufd, &ubuf, sizeof(ubuf)); ubuf.ut_name[sizeof(ubuf.ut_name)] = 0; return(&ubuf.ut_name); } #endif what zero means. */ delay(secs) int secs; { int n; while(secs>0) { n = 100; secs = secs - 100; if (secs < 0cmd/ln.c 444 0 33 2345 2416240042 5347 static char sccsid[] = "@(#)ln.c 4.1 10/1/80"; /* * ln */ #include #include #include struct stat stb; int fflag; /* force flag set? */ char name[BUFSIZ]; char *rindex(); main(argc, argv) int argc; register char **argv; { register int i, r; argc--, argv++; if (argc && strcmp(argv[0], "-f") == 0) { fflag++; argv++; argc--; } if (argc == 0) goto usage; else if (argc == 1) { argv[argc] = "."; argc++; } if (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 f1\nor: ln f1 f2\nln f1 ... fn d2\n"); exit(1); } linkit(from, to) char *from, *to; { char *tail; /* is target a directory? */ if (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 (link(from, to) < 0) { perror(from); return (1); } return(0); } fn d2\n"); exit(1); } linkit(from, to) char *from, *to; { char *tail; /* is target a directory? */ if (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_modcmd/lock.c 444 1621 33 2176 2662302574 5776 static char *sccsid = "@(#)lock.c 4.2 (Berkeley) 2/11/82"; #include #include #include #include #include /* * Lock a terminal up until the knowledgeable Joe returns. */ char masterp[] = "hasta la vista\n"; struct sgttyb tty, ntty; char s[BUFSIZ], s1[BUFSIZ]; main(argc, argv) char **argv; { register int t; struct stat statb; /* * Ignore signals generated from tty keyboard. These signals * are for xBSD only. This program should be compiled with * the jobs library (cc ... -ljobs). */ sigset( SIGINT, SIG_IGN ); sigset( SIGQUIT, SIG_IGN ); sigset( SIGTSTP, SIG_IGN ); if (argc > 0) argv[0] = 0; if (gtty(0, &tty)) exit(1); ntty = tty; ntty.sg_flags &= ~ECHO; stty(0, &ntty); printf("Key: "); fgets(s, sizeof s, stdin); printf("\nAgain: "); fgets(s1, sizeof s1, stdin); putchar('\n'); if (strcmp(s1, s)) { putchar(07); stty(0, &tty); exit(1); } s[0] = 0; for (;;) { fgets(s, sizeof s, stdin); if (strcmp(s1, s) == 0) break; if (strcmp(s, masterp) == 0) break; putchar(07); if (gtty(0, &ntty)) exit(1); } stty(0, &tty); } P, SIG_IGN ); if (argc > 0) argv[0] = 0; if (gtty(0, &tty)) exit(1); ntty = tty; ntty.sg_flags &= ~ECHO; stty(0, &ntty); printf("Key: "); fgets(s, sizeof s, stdin); printf("\nAgain: "); fgets(s1, sizeof s1, stdin); putchar('\n'); if (strcmp(s1, s)) { putchar(07); stty(0, &tty); exit(1); } s[0] = 0; for (;;) { fgets(s, sizeof s, stdin); if (strcmp(s1, s) =((cmd/df.c 444 0 33 10250 2552445536 5361 static char *sccsid = "@(#)df.c 4.6 (Berkeley) 7/8/81"; #include #include #include #include #include #include /* * df */ #define NFS 20 /* Max number of filesystems */ struct { char path[32]; char spec[32]; } mtab[NFS]; char root[32]; char *mpath(); daddr_t blkno = 1; int lflag; int iflag; struct filsys sblock; int fi; daddr_t alloc(); main(argc, argv) char **argv; { int i; char buf[128]; while (argc >= 1 && argv[1][0]=='-') { switch(argv[1][1]) { case 'l': lflag++; break; case 'i': iflag++; break; default: fprintf(stderr, "usage: df [ -il ] [ filsys... ]\n"); exit(0); } argc--, argv++; } if ((i=open("/etc/mtab", 0)) >= 0) { read(i, mtab, sizeof mtab); /* Probably returns short */ close(i); } printf("Filesystem Mounted on kbytes\t used\t free"); if (lflag) printf("\thardway"); printf("\t%% used"); if (iflag) printf("\tiused\tifree\t%%iused"); putchar('\n'); if(argc <= 1) { struct fstab *fsp; if (setfsent() == 0) perror(FSTAB), exit(1); while( (fsp = getfsent()) != 0){ if ( (strcmp(fsp->fs_type, FSTAB_RW) != 0) &&(strcmp(fsp->fs_type, FSTAB_RO) != 0) ) continue; if (root[0] == 0) strcpy(root, fsp->fs_spec); dfree(fsp->fs_spec); } endfsent(); exit(0); } for(i=1; i=NICFREE) { printf("bad free count, b=%D\n", blkno); return(0); } b = sblock.s_free[i]; if(b == 0) return(0); if(b=sblock.s_fsize) { printf("bad free block (%D)\n", b); return(0); } if(sblock.s_nfree <= 0) { bread(b, (char *)&buf, sizeof(buf)); blkno = b; sblock.s_nfree = buf.df_nfree; for(i=0; i #include FILE *dfile; char *filenam = "/usr/dict/words"; int fold; int dict; int tab; char entry[250]; char word[250]; char key[50]; main(argc,argv) char **argv; { register c; long top,bot,mid; while(argc>=2 && *argv[1]=='-') { for(;;) { switch(*++argv[1]) { case 'd': dict++; continue; case 'f': fold++; continue; case 't': tab = argv[1][1]; if(tab) ++argv[1]; continue; case 0: break; default: continue; } break; } argc --; argv++; } if(argc<=1) return; if(argc==2) { fold++; dict++; } else filenam = argv[2]; dfile = fopen(filenam,"r"); if(dfile==NULL) { fprintf(stderr,"look: can't open %s\n",filenam); exit(2); } canon(argv[1],key); bot = 0; fseek(dfile,0L,2); top = ftell(dfile); for(;;) { mid = (top+bot)/2; fseek(dfile,mid,0); do { c = getc(dfile); mid++; } while(c!=EOF && c!='\n'); if(!getword(entry)) break; canon(entry,word); switch(compare(key,word)) { case -2: case -1: case 0: if(top<=mid) break; top = mid; continue; case 1: case 2: bot = mid; continue; } break; } fseek(dfile,bot,0); while(ftell(dfile) #include #include #include #include #include #include #include #include #include static char SccsId[] = "@(#)mail.c 4.2 5/8/81"; #define DELIVERMAIL "/etc/delivermail" /*copylet flags */ /*remote mail, add rmtmsg */ #define REMOTE 1 /* zap header and trailing empty line */ #define ZAP 3 #define ORDINARY 2 #define FORWARD 4 #define LSIZE 256 #define MAXLET 300 /* maximum number of letters */ #define MAILMODE (~0644) /* mode of created mail */ # ifndef DELIVERMAIL #define RMAIL "/usr/net/bin/sendberkmail" #define LOCNAM1 "csvax" #define LOCNAM2 "ucbvax" #define LOCNAM3 "vax" #define LOCNAM4 "v" # endif char line[LSIZE]; char resp[LSIZE]; struct let { long adr; char change; } let[MAXLET]; int nlet = 0; char lfil[50]; long iop, time(); char *getenv(); char *index(); char lettmp[] = "/tmp/maXXXXX"; char maildir[] = "/usr/spool/mail/"; char mailfile[] = "/usr/spool/mail/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; char dead[] = "dead.letter"; char *thissys = sysname; char *netname = "vax"; char forwmsg[] = " forwarded\n"; FILE *tmpf; FILE *malf; char *my_name; char *getlogin(); struct passwd *getpwuid(); int error; int changed; int forward; char from[] = "From "; long ftell(); int delete(); char *ctime(); int flgf; int flgp; int delflg = 1; int hseqno; jmp_buf sjbuf; int rmail; main(argc, argv) char **argv; { register i; char sobuf[BUFSIZ]; setbuf(stdout, sobuf); mktemp(lettmp); unlink(le((ttmp); my_name = getlogin(); if (my_name == NULL || strlen(my_name) == 0) { struct passwd *pwent; pwent = getpwuid(getuid()); if (pwent==NULL) my_name = "???"; else my_name = pwent->pw_name; } if(setjmp(sjbuf)) done(); for (i=0; i<20; i++) setsig(i, delete); tmpf = fopen(lettmp, "w"); if (tmpf == NULL) { fprintf(stderr, "mail: cannot open %s for writing\n", lettmp); done(); } if (argv[0][0] == 'r') rmail++; if (argv[0][0] != 'r' && /* no favors for rmail*/ (argc == 1 || argv[1][0] == '-' && !any(argv[1][1], "rhd"))) printmail(argc, argv); else sendmail(argc, argv); done(); } setsig(i, f) int i; int (*f)(); { if(signal(i, SIG_IGN)!=SIG_IGN) signal(i, f); } 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); if (stat(mailfile, &statb) >= 0 && (statb.st_mode & S_IFMT) == S_IFDIR) { strcat(mailfile, "/"); strcat(mailfile, my_name); } for (; argc>1; argv++, argc--) { if (argv[1][0]=='-') { if (argv[1][1]=='q') delflg = 0; else if (argv[1][1]=='p') { flgp++; delflg = 0; } else if (argv[1][1]=='f') { if (argc>=3) { strcpy(mailfile, argv[2]); argv++; argc--; } } else if (argv[1][1]=='r') { forward = 1; } else if (argv[1][1]=='h') { forward = 1; } else { fprintf(stderr, "mail: unknown option %c\n", argv[1][1]); done(); } } else break; } malf = fopen(mailfile, "r"); if (malf == NULL) { fprintf(stdout, "No mail.\n"); return; } lock(mailfile); copymt(malf, tmpf); fclose(malf); fclose(tmpf); unlock(); tmpf = fopen(lettmp, "r"); changed = 0; print = 1; for (i = 0; i < nlet; ) { j = forward ? i : nlet - i - 1; if(setjmp(sjbuf)) { print=0; } else { if (print) copylet(j, stdout, ORDINARY); print = 1; } if (flgp) { i++; continue; } setjmp(sjbuf); fprintf(stdout, "? "); fflush(stdout); if (fgets(resp, LSIZE, stdin) == NULL) break; switch (resp[0]) { default: fprintf(stderr, "usage\n"); case '?': print = 0; fprintf(stderr, "q\tquit\n"); fprintf(stderr, "x\texit without changing mail\n"); fprintf(stderr, "p\tprint\n"); fprintf(stderr, "s[file]\tsave (default mbox)\n"); fprintf(stderr, "w[file]\tsame without header\n"); fprintf(stderr, "-\tprint previous\n"); fprintf(stderr, "d\tdelete\n"); fprintf(stderr, "+\tnext (no delete)\n"); fprintf(stderr, "m user\tmail to user\n"); fprintf(stderr, "! cmd\texecute cmd\n"); break; case '+': case 'n': case '\n': i++; break; case 'x': changed = 0; case 'q': goto donep; case 'p': break; case '^': case '-': if (--i < 0) i = 0; break; case 'y': case 'w': case 's': flg = 0; if (resp[1] != '\n' && resp[1] != ' ') { printf("illegal\n"); flg++; print = 0; continue; } if (resp[1] == '\n' || resp[1] == '\0') { 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) { fprintf(stdout, "mail: cannot append to %s\n", lfil); flg++; continue; } copylet(j, malf, resp[0]=='w'? ZAP: ORDINARY); fclose(malf); } if (flg) print = 0; else { let[j].change = 'd'; changed++; i++; } break; case 'm': flg = 0; if (resp[1] == '\n' || resp[1] == '\0') { i++; continue; } if (resp[1] != ' ') { printf("invalid command\n"); flg++; print = 0; continue; } for (p = resp+1; (p = getarg(lfil, p)) != NULL; ) if (!sendrmt(j, lfil, "/bin/mail")) /* couldn't send it */ flg++; if (flg) print = 0; else { let[j].change = 'd'; changed++; i++; } break; case '!': system(resp+1); printf("!\n"); print = 0; break; case 'd': let[j].change = 'd'; changed++; i++; if (resp[1] == 'q') goto donep; break; } } donep: if (changed) copyback(); } copyback() /* copy temp or whatever back to /usr/spool/mail */ { register i, n, c; int new = 0; struct stat stbuf; signal(SIGINT, SIG_IGN); signal(SIGHUP, SIG_IGN); signal(SIGQUIT, SIG_IGN); lock(mailfile); stat(mailfile, &stbuf); if (stbuf.st_size != let[nlet].adr) { /* new mail has arrived */ malf = fopen(mailfile, "r"); if (malf == NULL) { fprintf(stdout, "mail: can't re-read %s\n", mailfile); done(); } fseek(malf, let[nlet].adr, 0); fclose(tmpf); tmpf = fopen(lettmp, "a"); fseek(tmpf, let[nlet].adr, 0); while ((c = fgetc(malf)) != EOF) fputc(c, tmpf); fclose(malf); fclose(tmpf); tmpf = fopen(lettmp, "r"); let[++nlet].adr = stbuf.st_size; new = 1; } malf = fopen(mailfile, "w"); if (malf == NULL) { fprintf(stderr, "mail: can't rewrite %s\n", lfil); done(); } n = 0; for (i = 0; i < nlet; i++) if (let[i].change != 'd') { copylet(i, malf, ORDINARY); n++; } fclose(malf); if (new) fprintf(stdout, "new mail arrived\n"); unlock(); } copymt(f1, f2) /* copy mail (f1) to temp (f2) */ FILE *f1, *f2; { long nextadr; nlet = nextadr = 0; let[0].adr = 0; while (fgets(line, LSIZE, f1) != NULL) { if (isfrom(line)) let[nlet++].adr = nextadr; nextadr += strlen(line); fputs(line, f2); } let[nlet].adr = nextadr; /* last plus 1 */ } copylet(n, f, type) FILE *f; { int ch, k; fseek(tmpf, let[n].adr, 0); k = let[n+1].adr - let[n].adr; while(k-- > 1 && (ch=fgetc(tmpf))!='\n') if(type!=ZAP) fputc(ch,f); if(type==REMOTE) fprintf(f, " remote from %s\n", thissys); else if (type==FORWARD) fprintf(f, forwmsg); else if(type==ORDINARY) fputc(ch,f); while(k-->1) fputc(ch=fgetc(tmpf), f); if(type!=ZAP || ch!= '\n') fputc(fgetc(tmpf), f); } isfrom(lp) register char *lp; { register char *p; for (p = from; *p; ) if (*lp++ != *p++) return(0); return(1); } sendmail(argc, argv) char **argv; { char truename[100]; int first; register char *cp; int gaver = 0; # ifdef DELIVERMAIL char *newargv[1000]; register char **ap; register char **vp; int dflag; dflag = 0; if (argc < 1) fprintf(stderr, "puke\n"); for (vp = argv, ap = newargv + 1; (*ap = *vp++) != 0; ap++) { if (ap[0][0] == '-' && ap[0][1] == 'd') dflag++; } if (!dflag) { /* give it to delivermail, rah rah! */ unlink(lettmp); ap = newargv+1; if (rmail) *ap-- = "-s"; *ap = "-delivermail"; execv(DELIVERMAIL, ap); perror(DELIVERMAIL); exit(EX_UNAVAILABLE); } # endif DELIVERMAIL truename[0] = 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 <= 0) { usage(); done(); } gaver++; strcpy(truename, argv[1]); fgets(line, LSIZE, stdin); if (strcmpn("From", line, 4) == 0) line[0] = '\0'; argv++; argc--; break; case 'h': if (argc <= 0) { usage(); done(); } hseqno = atoi(argv[1]); argv++; argc--; break; # ifdef DELIVERMAIL case 'd': break; # endif DELIVERMAIL default: usage(); done(); } } if (argc <= 1) { usage(); done(); } if (gaver == 0) strcpy(truename, my_name); /* if (argc > 4 && strcmp(argv[1], "-r") == 0) { strcpy(truename, argv[2]); argc -= 2; argv += 2; fgets(line, LSIZE, stdin); if (strcmpn("From", line, 4) == 0) line[0] = '\0'; } else strcpy(truename, my_name); */ time(&iop); fprintf(tmpf, "%s%s %s", from, truename, ctime(&iop)); iop = ftell(tmpf); flgf = 1; for (first = 1;; first = 0) { if (first && line[0] == '\0' && fgets(line, LSIZE, stdin) == NULL) break; if (!first && fgets(line, LSIZE, stdin) == NULL) break; if (line[0] == '.' && line[1] == '\n' && isatty(fileno(stdin))) break; if (isfrom(line)) fputs(">", tmpf); fputs(line, tmpf); flgf = 0; } fputs("\n", tmpf); nlet = 1; let[0].adr = 0; let[1].adr = ftell(tmpf); fclose(tmpf); if (flgf) return; tmpf = fopen(lettmp, "r"); if (tmpf == NULL) { fprintf(stderr, "mail: cannot reopen %s for reading\n", lettmp); return; } while (--argc > 0) if (!send(0, *++argv, truename)) error++; if (error) { setuid(getuid()); malf = fopen(dead, "w"); if (malf == NULL) { fprintf(stdout, "mail: cannot open %s\n", dead); fclose(tmpf); return; } copylet(0, malf, ZAP); fclose(malf); fprintf(stdout, "Mail saved in %s\n", dead); } fclose(tmpf); } sendrmt(n, name, rcmd) char *name; char *rcmd; { FILE *rmf, *popen(); register char *p; char rsys[64], cmd[64]; register local, pid; int sts; local = 0; if (index(name, '^')) { while (p = index(name, '^')) *p = '!'; if (strncmp(name, "researc", 7)) { strcpy(rsys, "research"); if (*name != '!') --name; goto skip; } } if (*name=='!') name++; for(p=rsys; *name!='!'; *p++ = *name++) if (*name=='\0') { local++; break; } *p = '\0'; if ((!local && *name=='\0') || (local && *rsys=='\0')) { fprintf(stdout, "null name\n"); return(0); } 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 (local) sprintf(cmd, "%s %s", rcmd, rsys); else { if (index(name+1, '!')) sprintf(cmd, "uux - %s!rmail \\(%s\\)", rsys, name+1); else sprintf(cmd, "uux - %s!rmail %s", rsys, name+1); } if ((rmf=popen(cmd, "w")) == NULL) exit(1); copylet(n, rmf, local ? !strcmp(rcmd, "/bin/mail") ? FORWARD : ORDINARY : REMOTE); pclose(rmf); exit(0); } # ifndef DELIVERMAIL /* * Send mail on the Berkeley network. * Sorry Bill, sendrmt() is so awful we just gave up. */ sendberkmail(n, name, fromaddr) char name[]; char fromaddr[]; { char cmd[200]; register FILE *cmdf; sprintf(cmd, "%s -h %d -f %s -t %s", RMAIL, hseqno, fromaddr, name); if ((cmdf = popen(c((md, "w")) == NULL) { perror(RMAIL); return(0); } copylet(n, cmdf, ORDINARY); pclose(cmdf); return(9); } # endif usage() { fprintf(stderr, "Usage: mail [ -f ] people . . .\n"); } send(n, name, fromaddr) int n; char *name; char *fromaddr; { char file[100]; register char *p; register mask; struct passwd *pw, *getpwnam(); struct stat statb; char buf[128]; int f; # ifndef DELIVERMAIL stripfx(LOCNAM1, &name); stripfx(LOCNAM2, &name); stripfx(LOCNAM3, &name); stripfx(LOCNAM4, &name); if(*name == ':')name++; /* skip colon in to-name */ for(p=name; *p!=':' && *p!='!' && *p!='^' &&*p!='\0'; p++); /* if(*p == ':') return(sendrmt(n, name, RMAIL)); */ if (*p == ':') return(sendberkmail(n, name, fromaddr)); else if (*p=='\0' && strcmp(name, "msgs") == 0) return(sendrmt(n, "-s", "/usr/ucb/msgs")); # endif for(p=name; *p!='!'&&*p!='^' &&*p!='\0'; p++) ; if (*p == '!'|| *p=='^') return(sendrmt(n, name, 0)); if ((pw = getpwnam(name)) == NULL) { fprintf(stdout, "mail: can't send to %s\n", name); return(0); } cat(file, maildir, name); if (stat(file, &statb) >= 0 && (statb.st_mode & S_IFMT) == S_IFDIR) { strcat(file, "/"); strcat(file, name); } mask = umask(MAILMODE); malf = fopen(file, "a"); umask(mask); if (malf == NULL) { fprintf(stdout, "mail: cannot append to %s\n", file); return(0); } lock(file); chown(file, pw->pw_uid, pw->pw_gid); { f = open("/dev/mail", 1); sprintf(buf, "%s@%d\n", name, ftell(malf)); } copylet(n, malf, ORDINARY); if (f >= 0) { write(f, buf, strlen(buf)+1); close(f); } fclose(malf); unlock(); return(1); } delete(i) { setsig(i, delete); fprintf(stderr, "\n"); if(delflg) longjmp(sjbuf, 1); done(); } /* * Lock the specified mail file by setting the file mailfile.lock. * We must, of course, be careful to unlink the lock file by a call * to unlock before we stop. The algorithm used here is to see if * the lock exists, and if it does, to check its modify time. If it * is older than 30 seconds, we assume error and set our own file. * Otherwise, we wait for 5 seconds and try again. */ char *maillock = ".lock"; /* Lock suffix for mailname */ char *lockname = "/usr/spool/mail/tmXXXXXX"; char locktmp[30]; /* Usable lock temporary */ char curlock[50]; /* Last used name of lock */ int locked; /* To note that we locked it */ lock(file) char *file; { register int f; struct stat sbuf; long curtime; int statfailed; if (locked || flgf) return(0); strcpy(curlock, file); strcat(curlock, maillock); strcpy(locktmp, lockname); mktemp(locktmp); unlink(locktmp); statfailed = 0; for (;;) { f = lock1(locktmp, curlock); if (f == 0) { locked = 1; return(0); } if (stat(curlock, &sbuf) < 0) { if (statfailed++ > 5) return(-1); sleep(5); continue; } statfailed = 0; time(&curtime); if (curtime < sbuf.st_ctime + 30) { sleep(5); continue; } unlink(curlock); } } /* * Remove the mail lock, and note that we no longer * have it locked. */ unlock() { unlink(curlock); locked = 0; } /* * Attempt to set the lock by creating the temporary file, * then doing a link/unlink. If it fails, return -1 else 0 */ lock1(tempfile, name) char tempfile[], name[]; { register int fd; fd = creat(tempfile, 0); if (fd < 0) return(-1); close(fd); if (link(tempfile, name) < 0) { unlink(tempfile); return(-1); } unlink(tempfile); return(0); } done() { if(locked) unlock(); unlink(lettmp); unlink(locktmp); exit(error); } cat(to, from1, from2) char *to, *from1, *from2; { int i, j; j = 0; for (i=0; from1[i]; i++) to[j++] = from1[i]; for (i=0; from2[i]; i++) to[j++] = from2[i]; to[j] = 0; } char *getarg(s, p) /* copy p... into s, update p */ register char *s, *p; { while (*p == ' ' || *p == '\t') p++; if (*p == '\n' || *p == '\0') return(NULL); while (*p != ' ' && *p != '\t' && *p != '\n' && *p != '\0') *s++ = *p++; *s = '\0'; return(p); } # ifndef DELIVERMAIL /* stripfx(prefix string, pointer to string) takes a ptr to string and compares it to prefix string. may be called multiple times */ stripfx(pfx, name) char *pfx; char **name; { register char *cp = *name; while (*pfx && (*cp == *pfx || *cp == toupper(*pfx))) cp++, pfx++; if (*cp != ':' || *pfx != 0) return; *name = cp; } # endif (*p == '\n' || *p == '\0') return(NULL); while (*p != ' ' && *p != '\t' && *p != '\n' && *p != '\0') *s++ = *p++; *s = '\0'; return(p); } # ifndef DELIVERMAIL /* stripfx(prefix string, pointer to string) takes a ptr to string and compares it to prefix strincmd/lookbib.sh 755 0 33 427 2111463406 6536 A= case $1 in -p) A="$1 $2" shift; shift;; -*) A=$1 shift;; esac case $1 in -p) A="$A $1 $2" shift; shift;; -*) A="$A $1" shift;; esac if test $1x = x then /usr/lib/refer/mkey -s else echo $* | /usr/lib/refer/mkey -s fi | /usr/lib/refer/hunt $A /usr/dict/papers/Ind n(NULL); while (*p != ' ' && *p != '\t' && *p != '\n' && *p != '\0') *s++ = *p++; *s = '\0'; return(p); } # ifndef DELIVERMAIL /* strip/( ,( 5< /\@,\D"cmd/lorder.sh 755 0 33 620 2111463406 6377 trap "rm -f $$sym?ef; exit" 0 1 2 13 15 case $# in 0) echo usage: lorder file ... exit ;; 1) case $1 in *.o) set $1 $1 esac esac nm -g $* | sed ' /^$/d /:$/{ /\.o:/!d s/:// h s/.*/& &/ p d } /[TD] /{ s/.* // G s/\n/ / w '$$symdef' d } s/.* // G s/\n/ / w '$$symref' d ' sort $$symdef -o $$symdef sort $$symref -o $$symref join $$symref $$symdef | sed 's/[^ ]* *//' ELIVERMAIL /* strip/( ,( 5< /\@,\D"cmd/makekey.c 444 0 33 530 2416240061 6337 static char *sccsid = "@(#)makekey.c 4.1 (Berkeley) 10/1/80"; /* * You send it 10 bytes. * It sends you 13 bytes. * The transformation is expensive to perform * (a significant part of a second). */ char *crypt(); main() { char key[8]; char salt[2]; read(0, key, 8); read(0, salt, 2); write(1, crypt(key, salt), 13); return(0); } -o $$symref join $$symref $$symdef | sed 's/[^ ]* *//' ELIVERMAIL /* strip/( ,( 5< /\@,\D"cmd/mesg.c 444 0 33 1573 2424015645 5703 static char *sccsid = "@(#)mesg.c 4.2 (Berkeley) 10/18/80"; /* * mesg -- set current tty to accept or * forbid write permission. * * mesg [y] [n] * y allow messages * n forbid messages */ #include #include #include struct stat sbuf; char *tty; char *ttyname(); main(argc, argv) char *argv[]; { int r=0; tty = ttyname(2); if (tty == 0) exit(13); if(stat(tty, &sbuf) < 0) error("cannot stat"); if(argc < 2) { if(sbuf.st_mode & 02) fprintf(stderr,"is y\n"); else { r=1; fprintf(stderr,"is n\n"); } } else switch(*argv[1]) { case 'y': newmode(sbuf.st_mode|022); break; case 'n': newmode(sbuf.st_mode&~022); r=1; break; default: error("usage: mesg [y] [n]"); } exit(r); } error(s) char *s; { fprintf(stderr,"mesg: %s\n",s); exit(-1); } newmode(m) { if(chmod(tty,m)<0) error("cannot change mode"); } ty == 0) exit(13); if(stat(tty, &sbuf) < 0) error("cannot stat"); if(argc < 2) { if(sbuf.st_mode & 02) fprintf(stderr,"is y\cmd/makewhatis.sh 755 0 33 1003 2423113440 7255 rm -f /tmp/whatis /tmp/whatis$$ cd /usr/man for i in man1 man2 man3 man4 man5 man6 man7 man8 do cd $i /usr/lib/getNAME *.* cd .. done >/tmp/whatis ed - /tmp/whatis <<\! g/\\-/s//-/ g/\\\*-/s//-/ g/ VAX-11/s/// 1,$s/.TH [^ ]* \([^ ]*\).* \([^-]*\)/\2(\1) / g/ /s// /g w /tmp/whatis2 q ! /usr/ucb/expand -24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100 /tmp/whatis2 | sort >/tmp/whatis$$ /usr/ucb/unexpand -a /tmp/whatis$$ > /usr/lib/whatis chmod 644 /usr/lib/whatis rm -f /tmp/whatis /tmp/whatis(($$ -f /tmp/whatis /tmp/whatis$$ cd /usr/man for i in man1 man2 man3 man4 man5 man6 man7 man8 do cd $i /usr/lib/getNAME *.* cd .. done >/tmp/whatis ed - /tmp/whatis <<\! g/\\-/s//-/ g/\\\*-/s//-/ g/ VAX-11/s/// 1,$s/.TH [^ ]* \([^ ]*\).* \([^-]*\)/\2(\1) / g/ /s// /g w /tmp/whatis2 q ! /usr/ucb/expand -24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100 /tmp/whatis2 | sort >/tmp/whatis$$ /usr/ucb/unexpand -a /tmp/whatis$$ > /usr/lib/whatis chmod 644 /usr/lib/whatis rm -f /tmp/whatis /tmp/whatiscmd/mkdir.c 444 0 33 2401 2416240064 6041 static char *sccsid = "@(#)mkdir.c 4.1 (Berkeley) 10/1/80"; /* ** make directory */ #include #include int Errors = 0; char *strcat(); char *strcpy(); main(argc, argv) char *argv[]; { signal(SIGHUP, SIG_IGN); signal(SIGINT, SIG_IGN); signal(SIGQUIT, SIG_IGN); signal(SIGPIPE, SIG_IGN); signal(SIGTERM, SIG_IGN); if(argc < 2) { fprintf(stderr, "mkdir: arg count\n"); exit(1); } while(--argc) mkdir(*++argv); exit(Errors!=0); } mkdir(d) char *d; { char pname[128], dname[128]; register i, slash = 0; pname[0] = '\0'; for(i = 0; d[i]; ++i) if(d[i] == '/') slash = i + 1; if(slash) strncpy(pname, d, slash); strcpy(pname+slash, "."); if (access(pname, 02)) { fprintf(stderr,"mkdir: cannot access %s\n", pname); ++Errors; return; } if ((mknod(d, 040777, 0)) < 0) { fprintf(stderr,"mkdir: cannot make directory %s\n", d); ++Errors; return; } chown(d, getuid(), getgid()); strcpy(dname, d); strcat(dname, "/."); if((link(d, dname)) < 0) { fprintf(stderr, "mkdir: cannot link %s\n", dname); unlink(d); ++Errors; return; } strcat(dname, "."); if((link(pname, dname)) < 0) { fprintf(stderr, "mkdir: cannot link %s\n",dname); dname[strlen(dname)] = '\0'; unlink(dname); unlink(d); ++Errors; } } Errors; return; } if ((mknod(d, 040777, 0)) < 0) { fprintf(stderr,"mkdir: cannot make directory %s\n", d); ++Errors; return; } chown(d, getuid(), getgid()); strcpy(dname, d); strcat(dname, "/."); if((link(d, dname)) < 0) { fprintf(stderr,cmd/mkfs.c 444 0 33 23050 2520357111 5714 static char *sccsid = "@(#)mkfs.c 4.2 (Berkeley) 4/20/81"; /* * Make a file system prototype. * usage: mkfs filsys proto/size [ m n ] */ #define NIPB (BSIZE/sizeof(struct dinode)) #define NINDIR (BSIZE/sizeof(daddr_t)) #define NDIRECT (BSIZE/sizeof(struct direct)) #define LADDR 10 #define MAXFN 500 #ifndef STANDALONE #include #include #endif #include #include #include #include #include #include time_t utime; #ifndef STANDALONE FILE *fin; #else int fin; #endif int fsi; int fso; char *charp; char buf[BSIZE]; union { struct fblk fb; char pad1[BSIZE]; } fbun; #define fbuf fbun.fb #ifndef STANDALONE struct exec head; #endif char string[50]; union { struct filsys fs; char pad2[BSIZE]; } fsun; #define filsys fsun.fs char *fsys; char *proto; int f_n = MAXFN; int f_m = 3; int error; ino_t ino; long getnum(); daddr_t alloc(); main(argc, argv) char *argv[]; { int f, c; long n; #ifndef STANDALONE time(&utime); if(argc < 3) { printf("usage: mkfs filsys proto/size [ m n ]\n"); exit(1); } fsys = argv[1]; proto = argv[2]; #else { static char protos[60]; printf("file sys size: "); gets(protos); proto = protos; } #endif #ifdef STANDALONE { char fsbuf[100]; do { printf("file system: "); gets(fsbuf); fso = open(fsbuf, 1); fsi = open(fsbuf, 0); } while (fso < 0 || fsi < 0); } fin = NULL; argc = 0; #else fso = creat(fsys, 0666); if(fso < 0) { printf("%s: cannot create\n", fsys); exit(1); } fsi = open(fsys, 0); if(fsi < 0) { printf("%s: cannot open\n", fsys); exit(1); } fin = fopen(proto, "r"); #endif if(fin == NULL) { n = 0; for(f=0; c=proto[f]; f++) { if(c<'0' || c>'9') { printf("%s: cannot open\n", proto); exit(1); } n = n*10 + (c-'0'); } filsys.s_fsize = n; n = n/25; if(n <= 0) n = 1; if(n > 65500/NIPB) n = 65500/NIPB; filsys.s_isize = n + 2; printf("isize = %D\n", n*NIPB); charp = "d--777 0 0 $ "; goto f3; } #ifndef STANDALONE /* * get name of boot load program * and read onto block 0 */ getstr(); f = open(string, 0); if(f < 0) { printf("%s: cannot open init\n", string); goto f2; } c = BSIZE; /* read(f, (char *)&head, sizeof head); if(head.a_magic != OMAGIC) { printf("%s: bad format\n", string); goto f1; } c = head.a_text + head.a_data; if(c > BSIZE) { printf("%s: too big\n", string); goto f1; } */ read(f, buf, c); wtfs((long)0, buf); f1: close(f); /* * get total disk size * and inode block size */ f2: filsys.s_fsize = getnum(); n = getnum(); n /= NIPB; filsys.s_isize = n + 3; #endif f3: if(argc >= 5) { f_m = atoi(argv[3]); f_n = atoi(argv[4]); if(f_n <= 0 || f_n >= MAXFN) f_n = MAXFN; if(f_m <= 0 || f_m > f_n) f_m = 3; } filsys.s_m = f_m; filsys.s_n = f_n; printf("m/n = %d %d\n", f_m, f_n); if(filsys.s_isize >= filsys.s_fsize) { printf("%ld/%ld: bad ratio\n", filsys.s_fsize, filsys.s_isize-2); exit(1); } filsys.s_tfree = 0; filsys.s_tinode = 0; for(c=0; c'7') { printf("%c/%s: bad octal mode digit\n", c, string); error = 1; c = 0; } in.i_mode |= (c-'0')<<(15-3*i); } in.i_uid = getnum(); in.i_gid = getnum(); /* * general initialization prior to * switching on format */ ino++; in.i_number = ino; for(i=0; i 0) { in.i_size += i; newblk(&dbc, db, &ibc, ib); } close(f); break; case IFBLK: case IFCHR: /* * special file * content is maj/min types */ i = getnum() & 0377; f = getnum() & 0377; in.i_un.i_addr[0] = (i<<8) | f; break; case IFDIR: /* * directory * put in extra links * call recursively until * name of "$" found */ par->i_nlink++; in.i_nlink++; entry(in.i_number, ".", &dbc, db, &ibc, ib); entry(par->i_number, "..", &dbc, db, &ibc, ib); in.i_size = 2*sizeof(struct direct); for(;;) { getstr(); if(string[0]=='$' && string[1]=='\0') break; entry(ino+1, string, &dbc, db, &ibc, ib); in.i_size += sizeof(struct direct); cfile(&in); } break; } if(dbc != 0) newblk(&dbc, db, &ibc, ib); iput(&in, &ibc, ib); } gmode(c, s, m0, m1, m2, m3) char c, *s; { int i; for(i=0; s[i]; i++) if(c == s[i]) return((&m0)[i]); printf("%c/%s: bad mode\n", c, string); error = 1; return(0); } long getnum() { int i, c; long n; getstr(); n = 0; i = 0; for(i=0; c=string[i]; i++) { if(c<'0' || c>'9') { printf("%s: bad number\n", string); error = 1; return((long)0); } n = n*10 + (c-'0'); } return(n); } getstr() { int i, c; loop: switch(c=getch()) { case ' ': case '\t': case '\n': goto loop; case '\0': printf("EOF\n"); exit(1); case ':': while(getch() != '\n'); goto loop; } i = 0; do { string[i++] = c; c = getch(); } while(c!=' '&&c!='\t'&&c!='\n'&&c!='\0'); string[i] = '\0'; } rdfs(bno, bf) daddr_t bno; char *bf; { int n; lseek(fsi, bno*BSIZE, 0); n = read(fsi, bf, BSIZE); if(n != BSIZE) { printf("read error: %ld\n", bno); exit(1); } } wtfs(bno, bf) daddr_t bno; char *bf; { int n; lseek(fso, bno*BSIZE, 0); n = write(fso, bf, BSIZE); if(n != BSIZE) { printf("write error: %D\n", bno); exit(1); } } daddr_t alloc() { int i; daddr_t bno; filsys.s_tfree--; bno = filsys.s_free[--filsys.s_nfree]; if(bno == 0) { printf("out of free space\n"); exit(1); } if(filsys.s_nfree <= 0) { rdfs(bno, (char *)&fbuf); filsys.s_nfree = fbuf.df_nfree; for(i=0; i= NICFREE) { fbuf.df_nfree = filsys.s_nfree; for(i=0; id_ino = inum; for(i=0; id_name[i] = 0; for(i=0; id_name[i] = str[i]) == 0) break; if(*adbc >= NDIRECT) newblk(adbc, db, aibc, ib); } newblk(adbc, db, aibc, ib) int *adbc, *aibc; char *db; daddr_t *ib; { int i; daddr_t bno; bno = alloc(); wtfs(bno, db); for(i=0; i= NINDIR) { printf("indirect block full\n"); error = 1; *aibc = 0; } } getch() { #ifndef STANDALONE if(charp) #endif return(*charp++); #ifndef STANDALONE return(getc(fin)); #endif } bflist() { struct inode in; daddr_t ib[NINDIR]; int ibc; char flg[MAXFN]; int adr[MAXFN]; int i, j; daddr_t f, d; for(i=0; i 0; d -= f_n) for(i=0; i= filsys.s_isize) if(badblk(f)) { if(ibc >= NINDIR) { printf("too many bad blocks\n"); error = 1; ibc = 0; } ib[ibc] = f; ibc++; } else bfree(f); } iput(&in, &ibc, ib); } iput(ip, aibc, ib) struct inode *ip; int *aibc; daddr_t *ib; { struct dinode *dp; daddr_t d; int i; filsys.s_tinode--; d = itod(ip->i_number); if(d >= filsys.s_isize) { if(error == 0) printf("ilist too small\n"); error = 1; return; } rdfs(d, buf); dp = (struct dinode *)buf; dp += itoo(ip->i_number); dp->di_mode = ip->i_mode; dp->di_nlink = ip->i_nlink; dp->di_uid = ip->i_uid; dp->di_gid = ip->i_gid; dp->di_size = ip->i_size; dp->di_atime = utime; dp->di_mtime = utime; dp->di_ctime = utime; switch(ip->i_mode&IFMT) { case IFDIR: case IFREG: for(i=0; i<*aibc; i++) { if(i >= LADDR) break; ip->i_un.i_addr[i] = ib[i]; } if(*aibc >= LADDR) { ip->i_un.i_addr[LADDR] = alloc(); for(i=0; ii_un.i_addr[LADDR], (char *)ib); } case IFBLK: case IFCHR: ltol3(dp->di_addr, ip->i_un.i_addr, NADDR); break; default: printf("bad mode %o\n", ip->i_mode); exit(1); } wtfs(d, buf); } badblk(bno) daddr_t bno; { return(0); } ase IFREG: for(i=0; i<*aibc; i++) { if(i >= LADDR) break; ip->i_un.i_addr[i] = ib[i]; } if(*aibc >= LADDR) { ip->i_un.i_addr[LADDR] = alloc(); for(i=0; ii_un.i_addr[LADDR], (char *)ib); } case IFBLK: case IFCHR: ltol3(dp->di_addr, ip->i_un.i_addr, NADDR); break; default: printf("bad mode %o\n", ip->i_mode); exit(1); } wtfs(d, buf); } bacmd/mknod.c 444 0 33 1156 2416240070 6046 static char *sccsid = "@(#)mknod.c 4.1 (Berkeley) 10/1/80"; main(argc, argv) int argc; char **argv; { int m, a, b; if(argc != 5) { printf("arg count\n"); goto usage; } if(*argv[2] == 'b') m = 060666; else if(*argv[2] == 'c') m = 020666; else goto usage; a = number(argv[3]); if(a < 0) goto usage; b = number(argv[4]); if(b < 0) goto usage; if(mknod(argv[1], m, (a<<8)|b) < 0) perror("mknod"); exit(0); usage: printf("usage: mknod name b/c major minor\n"); } number(s) char *s; { int n, c; n = 0; while(c = *s++) { if(c<'0' || c>'9') return(-1); n = n*10 + c-'0'; } return(n); } a, b; if(argc != 5) { printf("arg count\n"); goto usage; } if(*argv[2] == 'b') m = 060666; else if(*argv[2] == 'c') m = 020666; else goto usage; a = number(argv[3]); if(a < 0) goto usage; b = number(argv[4]); if(b < 0) goto usage; if(mknod(argv[1], m, (a<<8)|b) < 0) perror("mknod"); exit(0); usage: printf("usage: mknod name b/c major minor\n"); } number(s) char *s; { icmd/mkstr.c 444 0 33 11634 2416240071 6121 static char *sccsid = "@(#)mkstr.c 4.1 (Berkeley) 10/1/80"; #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 'error("' 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 != 'e') { putchar(c); continue; } if (match("error(")) { printf("error("); 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; 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("%d", 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; 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 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); /* 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 = 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; } /* 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); } , strlen(str) + 1, mesgwrite); fwrite("\n", sizeof (char), 1, mesgwrite); } bucket[i] = hp; ((cmd/mount.c 444 0 33 4564 2423003542 6105 static char *sccsid = "@(#)mount.c 4.3 (Berkeley) 10/15/80"; #include #include /* * mount */ int mountall; #define NMOUNT 16 #define NAMSIZ 32 struct mtab { char file[NAMSIZ]; char spec[NAMSIZ]; } mtab[NMOUNT]; int ro; main(argc, argv) char **argv; { register struct mtab *mp; register char *np; int mf; mountall = 0; mf = open("/etc/mtab", 0); read(mf, (char *)mtab, NMOUNT*2*NAMSIZ); if (argc==1) { for (mp = mtab; mp < &mtab[NMOUNT]; mp++) if (mp->file[0]) printf("%s on %s\n", mp->spec, mp->file); exit(0); } if (argc == 2){ if (strcmp(argv[1], "-a") == 0) mountall++; else { fprintf(stdout,"arg count\n"); exit(1); } } if (!mountall){ ro = 0; if(argc > 3) ro++; if (mountfs(argv[1], argv[2], ro)){ perror("mount"); exit(1); } } else { struct fstab *fsp; close(2); dup(1); if (setfsent() == 0) perror(FSTAB), exit(1); while ( (fsp = getfsent()) != 0){ if (strcmp(fsp->fs_file, "/") == 0) continue; ro = !strcmp(fsp->fs_type, FSTAB_RO); if (ro==0 && strcmp(fsp->fs_type, FSTAB_RW)) continue; if (mountfs(fsp->fs_spec, fsp->fs_file, ro)) failed(fsp); else succeed(fsp); } endfsent(); } exit(0); } failed(fsp) register struct fstab *fsp; { extern int errno; extern char *sys_errlist[]; int err = errno; printf("Attempt to mount "); location(fsp); printf("FAILED: %s\n", sys_errlist[err]); } succeed(fsp) register struct fstab *fsp; { printf("Mounted "); location(fsp); printf("\n"); } location(fsp) register struct fstab *fsp; { extern int ro; printf("%s on %s %s ", fsp->fs_file, fsp->fs_spec, ro ? "(Read Only)" : ""); } mountfs(spec, name, ro) char *spec, *name; int ro; { register char *np; register struct mtab *mp; int mf; if(mount(spec, name, ro) < 0) { return(1); } np = spec; while(*np++) ; np--; while(*--np == '/') *np = '\0'; while(np > spec && *--np != '/') ; if(*np == '/') np++; spec = np; for (mp = mtab; mp < &mtab[NMOUNT]; mp++) { if (mp->file[0] == 0) { for (np = mp->spec; np < &mp->spec[NAMSIZ-1];) if ((*np++ = *spec++) == 0) spec--; for (np = mp->file; np < &mp->file[NAMSIZ-1];) if ((*np++ = *name++) == 0) name--; mp = &mtab[NMOUNT]; while ((--mp)->file[0] == 0); mf = creat("/etc/mtab", 0644); write(mf, (char *)mtab, (mp-mtab+1)*2*NAMSIZ); return(0); } } return(0); } ; while(np > spec && *--np != '/') ; if(*np == '/') np++; spec = np; for (mp = mtab; mp < &mtab[NMOUNT]; mp++) { if (mp->file[0] =cmd/restor.c 444 0 33 45626 2537003056 6313 static char *sccsid = "@(#)restor.c 4.3 (Berkeley) 6/3/81"; #define MAXINO 3000 #define BITS 8 #define MAXXTR 600 #define NCACHE 3 #ifndef STANDALONE #include #include #endif #include #include #include #include #include #include #include #define MWORD(m,i) (m[(unsigned)(i-1)/MLEN]) #define MBIT(i) (1<<((unsigned)(i-1)%MLEN)) #define BIS(i,w) (MWORD(w,i) |= MBIT(i)) #define BIC(i,w) (MWORD(w,i) &= ~MBIT(i)) #define BIT(i,w) (MWORD(w,i) & MBIT(i)) struct filsys sblock; int fi; ino_t ino, maxi, curino; int mt; char tapename[] = "/dev/rmt8"; char *magtape = tapename; #ifdef STANDALONE char mbuf[50]; #endif #ifndef STANDALONE daddr_t seekpt; int df, ofile; char dirfile[] = "rstXXXXXX"; struct { ino_t t_ino; daddr_t t_seekpt; } inotab[MAXINO]; int ipos; #define ONTAPE 1 #define XTRACTD 2 #define XINUSE 4 struct xtrlist { ino_t x_ino; char x_flags; } xtrlist[MAXXTR]; char name[12]; char drblock[BSIZE]; int bpt; #endif int eflag; int volno = 1; struct dinode tino, dino; daddr_t taddr[NADDR]; daddr_t curbno; short dumpmap[MSIZ]; short clrimap[MSIZ]; int bct = NTREC+1; char tbf[NTREC*BSIZE]; struct cache { daddr_t c_bno; int c_time; char c_block[BSIZE]; } cache[NCACHE]; int curcache; main(argc, argv) char *argv[]; { register char *cp; char command; int done(); #ifndef STANDALONE mktemp(dirfile); if (argc < 2) { usage: printf("Usage: restor x file file..., restor r filesys, or restor t\n"); exit(1); } argv++; argc -= 2; for (cp = *argv++; *cp; cp++) { switch (*cp) { case '-': break; case 'f': magtape = *argv++; argc--; break; case 'r': case 'R': case 't': case 'x': command = *cp; break; default: printf("Bad key character %c\n", *cp); goto usage; } } if (command == 'x') { if (signal(SIGINT, done) == SIG_IGN) signal(SIGINT, SIG_IGN); if (signal(SIGTERM, done) == SIG_IGN) signal(SIGTERM, SIG_IGN); df = creat(dirfile, 0666); if (df < 0) { printf("restor: %s - cannot create directory temporary\n", dirfile); exit(1); } close(df); df = open(dirfile, 2); } doit(command, argc, argv); if (command == 'x') unlink(dirfile); exit(0); #else magtape = "tape"; doit('r', 1, 0); #endif } doit(command, argc, argv) char command; int argc; char *argv[]; { extern char *ctime(); register i, k; ino_t d; #ifndef STANDALONE int xtrfile(), skip(), null(); #endif int rstrfile(), rstrskip(); struct dinode *ip, *ip1; #ifndef STANDALONE if ((mt = open(magtape, 0)) < 0) { printf("%s: cannot open tape\n", magtape); exit(1); } #else do { printf("Tape? "); gets(mbuf); mt = open(mbuf, 0); } while (mt == -1); magtape = mbuf; #endif switch(command) { #ifndef STANDALONE case 't': if (readhdr(&spcl) == 0) { printf("Tape is not a dump tape\n"); exit(1); } printf("Dump date: %s", ctime(&spcl.c_date)); printf("Dumped from: %s", ctime(&spcl.c_ddate)); return; case 'x': if (readhdr(&spcl) == 0) { printf("Tape is not a dump tape\n"); exit(1); } if (checkvol(&spcl, 1) == 0) { printf("Tape is not volume 1 of the dump\n"); exit(1); } pass1(); /* This sets the various maps on the way by */ i = 0; while (i < MAXXTR-1 && argc--) { if ((d = psearch(*argv)) == 0 || BIT(d, dumpmap) == 0) { printf("%s: not on the tape\n", *argv++); continue; } xtrlist[i].x_ino = d; xtrlist[i].x_flags |= XINUSE; printf("%s: inode %u\n", *argv, d); argv++; i++; } newvol: flsht(); close(mt); getvol: printf("Mount desired tape volume: Specify volume #: "); if (gets(tbf) == NULL) return; volno = atoi(tbf); if (volno <= 0) { printf("Volume numbers are positive numerics\n"); goto getvol; } mt = open(magtape, 0); if (readhdr(&spcl) == 0) { printf("tape is not dump tape\n"); goto newvol; } if (checkvol(&spcl, volno) == 0) { printf("Wrong volume (%d)\n", spcl.c_volume); goto newvol; } rbits: while (gethead(&spcl) == 0) ; if (checktype(&spcl, TS_INODE) == 1) { printf("Can't find inode mask!\n"); goto newvol; } if (checktype(&spcl, TS_BITS) == 0) goto rbits; readbits(dumpmap); i = 0; for (k = 0; xtrlist[k].x_flags; k++) { if (BIT(xtrlist[k].x_ino, dumpmap)) { xtrlist[k].x_flags |= ONTAPE; i++; } } while (i > 0) { again: if (ishead(&spcl) == 0) while(gethead(&spcl) == 0) ; if (checktype(&spcl, TS_END) == 1) { printf("end of tape\n"); checkdone: for (k = 0; xtrlist[k].x_flags; k++) if ((xtrlist[k].x_flags&XTRACTD) == 0) goto newvol; return; } if (checktype(&spcl, TS_INODE) == 0) { gethead(&spcl); goto again; } d = spcl.c_inumber; for (k = 0; xtrlist[k].x_flags; k++) { if (d == xtrlist[k].x_ino) { printf("extract file %u\n", xtrlist[k].x_ino); sprintf(name, "%u", xtrlist[k].x_ino); if ((ofile = creat(name, 0666)) < 0) { printf("%s: cannot create file\n", name); i--; continue; } chown(name, spcl.c_dinode.di_uid, spcl.c_dinode.di_gid); getfile(ino, xtrfile, skip, spcl.c_dinode.di_size); i--; xtrlist[k].x_flags |= XTRACTD; close(ofile); goto done; } } getfile(d, null, null, spcl.c_dinode.di_size); done: ; } goto checkdone; #endif case 'r': case 'R': #ifndef STANDALONE if ((fi = open(*argv, 2)) < 0) { printf("%s: cannot open\n", *argv); exit(1); } #else do { char charbuf[50]; printf("Disk? "); gets(charbuf); fi = open(charbuf, 2); } while (fi == -1); #endif #ifndef STANDALONE if (command == 'R') { printf("Enter starting volume number: "); if (gets(tbf) == EOF) { volno = 1; printf("\n"); } else volno = atoi(tbf); } else #endif volno = 1; printf("Last chance before scribbling on %s. ", #ifdef STANDALONE "disk"); #else *argv); #endif while (getchar() != '\n'); dread((daddr_t)1, (char *)&sblock, sizeof(sblock)); maxi = (sblock.s_isize-2)*INOPB; if (readhdr(&spcl) == 0) { printf("Missing volume record\n"); exit(1); } if (checkvol(&spcl, volno) == 0) { printf("Tape is not volume %d\n", volno); exit(1); } gethead(&spcl); for (;;) { ragain: if (ishead(&spcl) == 0) { printf("Missing header block\n"); while (gethead(&spcl) == 0) ; eflag++; } if (checktype(&spcl, TS_END) == 1) { printf("End of tape\n"); close(mt); dwrite( (daddr_t) 1, (char *) &sblock); return; } if (checktype(&spcl, TS_CLRI) == 1) { readbits(clrimap((); for (ino = 1; ino <= maxi; ino++) if (BIT(ino, clrimap) == 0) { getdino(ino, &tino); if (tino.di_mode == 0) continue; itrunc(&tino); clri(&tino); putdino(ino, &tino); } dwrite( (daddr_t) 1, (char *) &sblock); goto ragain; } if (checktype(&spcl, TS_BITS) == 1) { readbits(dumpmap); goto ragain; } if (checktype(&spcl, TS_INODE) == 0) { printf("Unknown header type\n"); eflag++; gethead(&spcl); goto ragain; } ino = spcl.c_inumber; if (eflag) printf("Resynced at inode %u\n", ino); eflag = 0; if (ino > maxi) { printf("%u: ilist too small\n", ino); gethead(&spcl); goto ragain; } dino = spcl.c_dinode; getdino(ino, &tino); curbno = 0; itrunc(&tino); clri(&tino); for (i = 0; i < NADDR; i++) taddr[i] = 0; l3tol(taddr, dino.di_addr, 1); getfile(d, rstrfile, rstrskip, dino.di_size); ip = &tino; ltol3(ip->di_addr, taddr, NADDR); ip1 = &dino; ip->di_mode = ip1->di_mode; ip->di_nlink = ip1->di_nlink; ip->di_uid = ip1->di_uid; ip->di_gid = ip1->di_gid; ip->di_size = ip1->di_size; ip->di_atime = ip1->di_atime; ip->di_mtime = ip1->di_mtime; ip->di_ctime = ip1->di_ctime; putdino(ino, &tino); } } } /* * Read the tape, bulding up a directory structure for extraction * by name */ #ifndef STANDALONE pass1() { register i; struct dinode *ip; int putdir(), null(); while (gethead(&spcl) == 0) { printf("Can't find directory header!\n"); } for (;;) { if (checktype(&spcl, TS_BITS) == 1) { readbits(dumpmap); continue; } if (checktype(&spcl, TS_CLRI) == 1) { readbits(clrimap); continue; } if (checktype(&spcl, TS_INODE) == 0) { finish: flsh(); close(mt); return; } ip = &spcl.c_dinode; i = ip->di_mode & IFMT; if (i != IFDIR) { goto finish; } inotab[ipos].t_ino = spcl.c_inumber; inotab[ipos++].t_seekpt = seekpt; getfile(spcl.c_inumber, putdir, null, spcl.c_dinode.di_size); putent("\000\000/"); } } #endif /* * Do the file extraction, calling the supplied functions * with the blocks */ getfile(n, f1, f2, size) ino_t n; int (*f2)(), (*f1)(); long size; { register i; struct spcl addrblock; char buf[BSIZE]; addrblock = spcl; curino = n; goto start; for (;;) { if (gethead(&addrblock) == 0) { printf("Missing address (header) block\n"); goto eloop; } if (checktype(&addrblock, TS_ADDR) == 0) { spcl = addrblock; curino = 0; curino = 0; return; } start: for (i = 0; i < addrblock.c_count; i++) { if (addrblock.c_addr[i]) { readtape(buf); (*f1)(buf, size > BSIZE ? (long) BSIZE : size); } else { clearbuf(buf); (*f2)(buf, size > BSIZE ? (long) BSIZE : size); } if ((size -= BSIZE) <= 0) { eloop: while (gethead(&spcl) == 0) ; if (checktype(&spcl, TS_ADDR) == 1) goto eloop; curino = 0; return; } } } } /* * Do the tape i\/o, dealling with volume changes * etc.. */ readtape(b) char *b; { register i; struct spcl tmpbuf; if (bct >= NTREC) { for (i = 0; i < NTREC; i++) ((struct spcl *)&tbf[i*BSIZE])->c_magic = 0; bct = 0; if ((i = read(mt, tbf, NTREC*BSIZE)) < 0) { printf("Tape read error: inode %u\n", curino); eflag++; exit(1); } if (i == 0) { bct = NTREC + 1; volno++; loop: flsht(); close(mt); printf("Mount volume %d\n", volno); while (getchar() != '\n') ; if ((mt = open(magtape, 0)) == -1) { printf("Cannot open tape!\n"); goto loop; } if (readhdr(&tmpbuf) == 0) { printf("Not a dump tape.Try again\n"); goto loop; } if (checkvol(&tmpbuf, volno) == 0) { printf("Wrong tape. Try again\n"); goto loop; } readtape(b); return; } } copy(&tbf[(bct++*BSIZE)], b, BSIZE); } flsht() { bct = NTREC+1; } copy(f, t, s) register char *f, *t; { register i; i = s; do *t++ = *f++; while (--i); } clearbuf(cp) register char *cp; { register i; i = BSIZE; do *cp++ = 0; while (--i); } /* * Put and get the directory entries from the compressed * directory file */ #ifndef STANDALONE putent(cp) char *cp; { register i; for (i = 0; i < sizeof(ino_t); i++) writec(*cp++); for (i = 0; i < DIRSIZ; i++) { writec(*cp); if (*cp++ == 0) return; } return; } getent(bf) register char *bf; { register i; for (i = 0; i < sizeof(ino_t); i++) *bf++ = readc(); for (i = 0; i < DIRSIZ; i++) if ((*bf++ = readc()) == 0) return; return; } /* * read/write te directory file */ writec(c) char c; { drblock[bpt++] = c; seekpt++; if (bpt >= BSIZE) { bpt = 0; write(df, drblock, BSIZE); } } readc() { if (bpt >= BSIZE) { read(df, drblock, BSIZE); bpt = 0; } return(drblock[bpt++]); } mseek(pt) daddr_t pt; { bpt = BSIZE; lseek(df, pt, 0); } flsh() { write(df, drblock, bpt+1); } /* * search the directory inode ino * looking for entry cp */ ino_t search(inum, cp) ino_t inum; char *cp; { register i; struct direct dir; for (i = 0; i < MAXINO; i++) if (inotab[i].t_ino == inum) { goto found; } return(0); found: mseek(inotab[i].t_seekpt); do { getent((char *)&dir); if (direq(dir.d_name, "/")) return(0); } while (direq(dir.d_name, cp) == 0); return(dir.d_ino); } /* * Search the directory tree rooted at inode 2 * for the path pointed at by n */ psearch(n) char *n; { register char *cp, *cp1; char c; ino = 2; if (*(cp = n) == '/') cp++; next: cp1 = cp + 1; while (*cp1 != '/' && *cp1) cp1++; c = *cp1; *cp1 = 0; ino = search(ino, cp); if (ino == 0) { *cp1 = c; return(0); } *cp1 = c; if (c == '/') { cp = cp1+1; goto next; } return(ino); } direq(s1, s2) register char *s1, *s2; { register i; for (i = 0; i < DIRSIZ; i++) if (*s1++ == *s2) { if (*s2++ == 0) return(1); } else return(0); return(1); } #endif /* * read/write a disk block, be sure to update the buffer * cache if needed. */ dwrite(bno, b) daddr_t bno; char *b; { register i; for (i = 0; i < NCACHE; i++) { if (cache[i].c_bno == bno) { copy(b, cache[i].c_block, BSIZE); cache[i].c_time = 0; break; } else cache[i].c_time++; } lseek(fi, bno*BSIZE, 0); if(write(fi, b, BSIZE) != BSIZE) { #ifdef STANDALONE printf("disk write error %D\n", bno); #else fprintf(stderr, "disk write error %ld\n", bno); #endif exit(1); } } dread(bno, buf, cnt) daddr_t bno; char *buf; { register i, j; j = 0; for (i = 0; i < NCACHE; i++) { if (++curcache >= NCACHE) curcache = 0; if (cache[curcache].c_bno == bno) { copy(cache[curcache].c_block, buf, cnt); cache[curcache].c_time = 0; return; } else { cache[curcache].c_time++; if (cache[j].c_time < cache[curcache].c_time) j = curcache; } } lseek(fi, bno*BSIZE, 0); if (read(fi, cache[j].c_block, BSIZE) != BSIZE) { #ifdef STANDALONE printf("read error %D\n", bno); #else printf("read error %ld\n", bno); #endif exit(1); } copy(cache[j].c_block, buf, cnt); cache[j].c_time = 0; cache[j].c_bno = bno; } /* * the inode manpulation routines. Like the system. * * clri zeros the inode */ clri(ip) struct dinode *ip; { int i, *p; if (ip->di_mode&IFMT) sblock.s_tinode++; i = sizeof(struct dinode)/sizeof(int); p = (int *)ip; do *p++ = 0; while(--i); } /* * itrunc/tloop/bfree free all of the blocks pointed at by the inode */ itrunc(ip) register struct dinode *ip; { register i; daddr_t bn, iaddr[NADDR]; if (ip->di_mode == 0) return; i = ip->di_mode & IFMT; if (i != IFDIR && i != IFREG) return; l3tol(iaddr, ip->di_addr, NADDR); for(i=NADDR-1;i>=0;i--) { bn = iaddr[i]; if(bn == 0) continue; switch(i) { default: bfree(bn); break; case NADDR-3: tloop(bn, 0, 0); break; case NADDR-2: tloop(bn, 1, 0); break; case NADDR-1: tloop(bn, 1, 1); } } ip->di_size = 0; } tloop(bn, f1, f2) daddr_t bn; int f1, f2; { register i; daddr_t nb; union { char data[BSIZE]; daddr_t indir[NINDIR]; } ibuf; dread(bn, ibuf.data, BSIZE); for(i=NINDIR-1;i>=0;i--) { nb = ibuf.indir[i]; if(nb) { if(f1) tloop(nb, f2, 0); else bfree(nb); } } bfree(bn); } bfree(bn) daddr_t bn; { register i; union { char data[BSIZE]; struct fblk frees; } fbun; #define fbuf fbun.frees if(sblock.s_nfree >= NICFREE) { fbuf.df_nfree = sblock.s_nfree; for(i=0;i0; j--) { sh += NSHIFT; nb <<= NSHIFT; if(bn < nb) break; bn -= nb; } if(j == 0) { return((daddr_t)0); } /* * fetch the address from the inode */ if((nb = iaddr[NADDR-j]) == 0) { iaddr[NADDR-j] = nb = balloc(); } /* * fetch through the indirect blocks */ for(; j<=3; j++) { dread(nb, (char *)indir, BSIZE); sh -= NSHIFT; i = (bn>>sh) & NMASK; nnb = indir[i]; if(nnb == 0) { nnb = balloc(); indir[i] = nnb; (( dwrite(nb, (char *)indir); } nb = nnb; } return(nb); } /* * read the tape into buf, then return whether or * or not it is a header block. */ gethead(buf) struct spcl *buf; { readtape((char *)buf); if (buf->c_magic != MAGIC || checksum((int *) buf) == 0) return(0); return(1); } /* * return whether or not the buffer contains a header block */ ishead(buf) struct spcl *buf; { if (buf->c_magic != MAGIC || checksum((int *) buf) == 0) return(0); return(1); } checktype(b, t) struct spcl *b; int t; { return(b->c_type == t); } checksum(b) int *b; { register i, j; j = BSIZE/sizeof(int); i = 0; do i += *b++; while (--j); if (i != CHECKSUM) { printf("Checksum error %o\n", i); return(0); } return(1); } checkvol(b, t) struct spcl *b; int t; { if (b->c_volume == t) return(1); return(0); } readhdr(b) struct spcl *b; { if (gethead(b) == 0) return(0); if (checktype(b, TS_TAPE) == 0) return(0); return(1); } /* * The next routines are called during file extraction to * put the data into the right form and place. */ #ifndef STANDALONE xtrfile(b, size) char *b; long size; { write(ofile, b, (int) size); } null() {;} skip() { lseek(ofile, (long) BSIZE, 1); } #endif rstrfile(b, s) char *b; long s; { daddr_t d; d = bmap(taddr, curbno); dwrite(d, b); curbno += 1; } rstrskip(b, s) char *b; long s; { curbno += 1; } #ifndef STANDALONE putdir(b) char *b; { register struct direct *dp; register i; for (dp = (struct direct *) b, i = 0; i < BSIZE; dp++, i += sizeof(*dp)) { if (dp->d_ino == 0) continue; putent((char *) dp); } } #endif /* * read/write an inode from the disk */ getdino(inum, b) ino_t inum; struct dinode *b; { daddr_t bno; char buf[BSIZE]; bno = (ino - 1)/INOPB; bno += 2; dread(bno, buf, BSIZE); copy(&buf[((inum-1)%INOPB)*sizeof(struct dinode)], (char *) b, sizeof(struct dinode)); } putdino(inum, b) ino_t inum; struct dinode *b; { daddr_t bno; char buf[BSIZE]; if (b->di_mode&IFMT) sblock.s_tinode--; bno = ((ino - 1)/INOPB) + 2; dread(bno, buf, BSIZE); copy((char *) b, &buf[((inum-1)%INOPB)*sizeof(struct dinode)], sizeof(struct dinode)); dwrite(bno, buf); } /* * read a bit mask from the tape into m. */ readbits(m) short *m; { register i; i = spcl.c_count; while (i--) { readtape((char *) m); m += (BSIZE/(MLEN/BITS)); } while (gethead(&spcl) == 0) ; } done() { #ifndef STANDALONE unlink(dirfile); #endif exit(0); } _t bno; char buf[BSIZE]; if (b->di_mode&IFMT) sblock.s_tinode--; bno = ((ino - 1)/INOPB) + 2; dreadcmd/ncheck.c 444 0 33 12105 2416240102 6201 static char *sccsid = "@(#)ncheck.c 4.1 (Berkeley) 10/1/80"; /* * ncheck -- obtain file names from reading filesystem */ #define NI 16 #define NB 500 #define HSIZE 2503 #define NDIR (BSIZE/sizeof(struct direct)) #include #include #include #include #include #include #include struct filsys sblock; struct dinode itab[INOPB*NI]; daddr_t iaddr[NADDR]; ino_t ilist[NB]; struct htab { ino_t h_ino; ino_t h_pino; char h_name[DIRSIZ]; } htab[HSIZE]; int aflg; int sflg; int fi; ino_t ino; int nhent; int nxfile; int nerror; daddr_t bmap(); long atol(); struct htab *lookup(); main(argc, argv) char *argv[]; { register i; long n; while (--argc) { argv++; if (**argv=='-') switch ((*argv)[1]) { case 'a': aflg++; continue; case 'i': for(i=0; i= mino) break; bread((daddr_t)i, (char *)itab, sizeof(itab)); for(j=0; j= mino) break; ino++; pass1(&itab[j]); } } ilist[nxfile+1] = 0; ino = 0; for(i=2;; i+=NI) { if(ino >= mino) break; bread((daddr_t)i, (char *)itab, sizeof(itab)); for(j=0; j= mino) break; ino++; pass2(&itab[j]); } } ino = 0; for(i=2;; i+=NI) { if(ino >= mino) break; bread((daddr_t)i, (char *)itab, sizeof(itab)); for(j=0; j= mino) break; ino++; pass3(&itab[j]); } } } pass1(ip) register struct dinode *ip; { if((ip->di_mode & IFMT) != IFDIR) { if (sflg==0 || nxfile>=NB) return; if ((ip->di_mode&IFMT)==IFBLK || (ip->di_mode&IFMT)==IFCHR || ip->di_mode&(ISUID|ISGID)) ilist[nxfile++] = ino; return; } lookup(ino, 1); } pass2(ip) register struct dinode *ip; { struct direct dbuf[NDIR]; long doff; struct direct *dp; register i, j; int k; struct htab *hp; daddr_t d; ino_t kno; if((ip->di_mode&IFMT) != IFDIR) return; l3tol(iaddr, ip->di_addr, NADDR); doff = 0; for(i=0;; i++) { if(doff >= ip->di_size) break; d = bmap(i); if(d == 0) break; bread(d, (char *)dbuf, sizeof(dbuf)); for(j=0; j= ip->di_size) break; doff += sizeof(struct direct); dp = dbuf+j; kno = dp->d_ino; if(kno == 0) continue; hp = lookup(kno, 0); if(hp == 0) continue; if(dotname(dp)) continue; hp->h_pino = ino; for(k=0; kh_name[k] = dp->d_name[k]; } } } pass3(ip) register struct dinode *ip; { struct direct dbuf[NDIR]; long doff; struct direct *dp; register i, j; int k; daddr_t d; ino_t kno; if((ip->di_mode&IFMT) != IFDIR) return; l3tol(iaddr, ip->di_addr, NADDR); doff = 0; for(i=0;; i++) { if(doff >= ip->di_size) break; d = bmap(i); if(d == 0) break; bread(d, (char *)dbuf, sizeof(dbuf)); for(j=0; j= ip->di_size) break; doff += sizeof(struct direct); dp = dbuf+j; kno = dp->d_ino; if(kno == 0) continue; if(aflg==0 && dotname(dp)) continue; if(ilist[0] == 0) goto pr; for(k=0; ilist[k] != 0; k++) if(ilist[k] == kno) goto pr; continue; pr: printf("%u ", kno); pname(ino, 0); printf("/%.14s", dp->d_name); if (lookup(kno, 0)) printf("/."); printf("\n"); } } } dotname(dp) register struct direct *dp; { if (dp->d_name[0]=='.') if (dp->d_name[1]==0 || (dp->d_name[1]=='.' && dp->d_name[2]==0)) return(1); return(0); } pname(i, lev) ino_t i; { register struct htab *hp; if (i==ROOTINO) return; if ((hp = lookup(i, 0)) == 0) { printf("???"); return; } if (lev > 10) { printf("..."); return; } pname(hp->h_pino, ++lev); printf("/%.14s", hp->h_name); } struct htab * lookup(i, ef) ino_t i; { register struct htab *hp; for (hp = &htab[i%HSIZE]; hp->h_ino;) { if (hp->h_ino==i) return(hp); if (++hp >= &htab[HSIZE]) hp = htab; } if (ef==0) return(0); if (++nhent >= HSIZE) { fprintf(stderr, "ncheck: out of core-- increase HSIZE\n"); exit(1); } hp->h_ino = i; return(hp); } bread(bno, buf, cnt) daddr_t bno; char *buf; { register i; lseek(fi, bno*BSIZE, 0); if (read(fi, buf, cnt) != cnt) { fprintf(stderr, "ncheck: read error %d\n", bno); for(i=0; i NINDIR) { fprintf(stderr, "ncheck: %u - huge directory\n", ino); return((daddr_t)0); } bread(iaddr[NADDR-3], (char *)ibuf, sizeof(ibuf)); return(ibuf[i]); } >h_ino = i; return(hp); } bread(bno, buf, cnt) daddr_t bno; char *buf; { register i; lseek(fi, bno*BSIZE, 0); if (read(fi, buf, cnt) != cnt) { fprintf(stderr, "ncheck: read error %d\n", bno); for(i=0; i NINDIR) { fprintf(stderr, "ncheck: %u - huge directory\n", ino); return((daddr_t)0); } brcmd/newgrp.c 444 0 33 2115 2416240103 6231 static char *sccsid = "@(#)newgrp.c 4.1 (Berkeley) 10/1/80"; #include #include #include struct group *getgrnam(), *grp; struct passwd *getpwuid(), *pwd; char *getpass(), *crypt(); main(argc,argv) int argc; char **argv; { register i; if(argc != 2) { printf("usage: newgrp groupname\n"); exit(13); } if((grp=getgrnam(argv[1])) == NULL) { printf("%s: no such group\n", argv[1]); exit(13); } if((pwd=getpwuid(getuid())) == NULL) { printf("You do not exist!\n"); exit(13); } for(i=0;grp->gr_mem[i];i++) if(strcmp(grp->gr_mem[i], pwd->pw_name) == 0) break; if(grp->gr_mem[i] == 0 && strcmp(grp->gr_name,"other")) { printf("Sorry\n"); exit(13); } if(grp->gr_passwd[0] != '\0' && pwd->pw_passwd[0] == '\0') { if(strcmp(grp->gr_passwd, crypt(getpass("Password:"),grp->gr_passwd)) != 0) { printf("Sorry\n"); exit(13); } } if(setgid(grp->gr_gid) < 0) { perror("setgid"); exit(13); } setuid(getuid()); for (i=3; i<15; i++) close(i); execl((pwd->pw_shel((l[0]?pwd->pw_shell:"/bin/sh"), "-i", 0); printf("No shell!\n"); exit(0); } == 0) break; if(grp->gr_mem[i] == 0 && strcmp(grp->gr_name,"other")) { printf("Sorry\n"); exit(13); } if(grp->gr_passwd[0] != '\0' && pwd->pw_passwd[0] == '\0') { if(strcmp(grp->gr_passwd, crypt(getpass("Password:"),grp->gr_passwd)) != 0) { printf("Sorry\n"); exit(13); } } if(setgid(grp->gr_gid) < 0) { perror("setgid"); exit(13); } setuid(getuid()); for (i=3; i<15; i++) close(i); execl((pwd->pw_shelcmd/tail.c 444 0 33 7020 2420025362 5663 static char *sccsid = "@(#)tail.c 4.1 (Berkeley) 10/6/80"; /* tail command * * tail where [file] * where is +_n[type] * - means n lines before end * + means nth line from beginning * type 'b' means tail n blocks, not lines * type 'c' means tail n characters * Type 'r' means in lines in reverse order from end * (for -r, default is entire buffer ) * option 'f' means loop endlessly trying to read more * characters after the end of file, on the assumption * that the file is growing */ #include #include #include #include #include #define LBIN 4097 struct stat statb; int follow; int piped; char bin[LBIN]; int errno; main(argc,argv) char **argv; { long n,di; register i,j,k; char *arg; int partial,bylines,bkwds,fromend,lastnl; char *p; lseek(0,(long)0,1); piped = errno==ESPIPE; arg = argv[1]; if(argc<=1 || *arg!='-'&&*arg!='+') { arg = "-10l"; argc++; argv--; } fromend = *arg=='-'; arg++; n = 0; while(isdigit(*arg)) n = n*10 + *arg++ - '0'; if(!fromend&&n>0) n--; if(argc>2) { close(0); if(open(argv[2],0)!=0) { perror(argv[2]); exit(1); } } bylines = -1; bkwds = 0; while(*arg) switch(*arg++) { case 'b': n <<= 9; if(bylines!=-1) goto errcom; bylines=0; break; case 'c': if(bylines!=-1) goto errcom; bylines=0; break; case 'f': follow = 1; break; case 'r': if(n==0) n = LBIN; bkwds = 1; fromend = 1; bylines = 1; break; case 'l': if(bylines!=-1) goto errcom; bylines = 1; break; default: goto errcom; } if (n==0) n = 10; if(bylines==-1) bylines = 1; if(bkwds) follow=0; if(fromend) goto keep; /*seek from beginning */ if(bylines) { j = 0; while(n-->0) { do { if(j--<=0) { p = bin; j = read(0,p,BUFSIZ); if(j--<=0) fexit(); } } while(*p++ != '\n'); } write(1,p,j); } else if(n>0) { if(!piped) fstat(0,&statb); if(piped||(statb.st_mode&S_IFMT)==S_IFCHR) while(n>0) { i = n>BUFSIZ?BUFSIZ:n; i = read(0,bin,i); if(i<=0) fexit(); n -= i; } else lseek(0,n,0); } copy: while((i=read(0,bin,BUFSIZ))>0) write(1,bin,i); fexit(); /*seek from end*/ keep: if(n <= 0) fexit(); if(!piped) { fstat(0,&statb); di = !bylines&&n di) lseek(0,-di,2); if(!bylines) goto copy; } partial = 1; for(;;) { i = 0; do { j = read(0,&bin[i],LBIN-i); if(j<=0) goto brka; i += j; } while(i=LBIN ? i+1: i-n+LBIN; k--; } else { if(bkwds && bin[i==0?LBIN-1:i-1]!='\n'){ /* force trailing newline */ bin[i]='\n'; if(++i>=LBIN) {i = 0; partial = 0;} } k = i; j = 0; do { lastnl = k; do { if(--k<0) { if(partial) { if(bkwds) write(1,bin,lastnl+1); goto brkb; } k = LBIN -1; } } while(bin[k]!='\n'&&k!=i); if(bkwds && j>0){ if(k=LBIN) k = 0; } while(bin[k]!='\n'&&k!=i); } if(k 0) write (1, bin, n); } } k-1); write(1,bin,lastnl+1); } } } while(j++=LBIN) k = 0; } while(bin[k]!='\n'&&k!=i); } if(k 0) write (1cmd/nice.c 444 0 33 740 2416240106 5632 static char *sccsid = "@(#)nice.c 4.1 (Berkeley) 10/1/80"; /* nice */ #include main(argc, argv) int argc; char *argv[]; { int nicarg = 10; extern errno; extern char *sys_errlist[]; if(argc > 1 && argv[1][0] == '-') { nicarg = atoi(&argv[1][1]); argc--; argv++; } if(argc < 2) { fputs("usage: nice [ -n ] command\n", stderr); exit(1); } nice(nicarg); execvp(argv[1], &argv[1]); fprintf(stderr, "%s: %s\n", sys_errlist[errno], argv[1]); exit(1); } \@,\D"cmd/nm.c 444 0 33 14415 2416240110 5365 static char sccsid[] = "@(#)nm.c 4.1 10/1/80"; /* * nm - print name list; VAX string table version */ #include #include #include #include #include #include #include #include #define SELECT archive ? archdr.ar_name : *xargv int aflg, gflg, nflg, oflg, pflg, uflg; int rflg = 1; char **xargv; int archive; struct ar_hdr archdr; union { char mag_armag[SARMAG+1]; struct exec mag_exp; } mag_un; #define OARMAG 0177545 FILE *fi; off_t off; off_t ftell(); char *malloc(); char *realloc(); char *strp; char *stab(); off_t strsiz; int compare(); int narg; int errs; main(argc, argv) 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() { register int j; archive = 0; fi = fopen(*xargv, "r"); if (fi == NULL) { error(0, "cannot open"); return; } off = SARMAG; fread((char *)&mag_un, 1, sizeof(mag_un), fi); if (mag_un.mag_exp.a_magic == OARMAG) { error(0, "old archive"); return; } if (strncmp(mag_un.mag_armag, ARMAG, SARMAG)==0) archive++; else if (N_BADMAG(mag_un.mag_exp)) { error(0, "bad format"); return; } fseek(fi, 0L, 0); if (archive) { nextel(fi); if (narg > 1) printf("\n%s:\n", *xargv); } do { off_t o; register i, n, c; struct nlist *symp = NULL; struct nlist sym; struct stat stb; fread((char *)&mag_un.mag_exp, 1, sizeof(struct exec), fi); if (N_BADMAG(mag_un.mag_exp)) continue; if (archive == 0) fstat(fileno(fi), &stb); o = N_SYMOFF(mag_un.mag_exp) - sizeof (struct exec); fseek(fi, o, 1); n = mag_un.mag_exp.a_syms / sizeof(struct nlist); if (n == 0) { error(0, "no name list"); continue; } if (N_STROFF(mag_un.mag_exp) + sizeof (off_t) > (archive ? off : stb.st_size)) error(1, "old format .o (no string table) or truncated file"); i = 0; if (strp) free(strp), strp = 0; while (--n >= 0) { fread((char *)&sym, 1, sizeof(sym), fi); if (gflg && (sym.n_type&N_EXT)==0) continue; if ((sym.n_type&N_STAB) && (!aflg||gflg||uflg)) continue; if (symp==NULL) symp = (struct nlist *) malloc(sizeof(struct nlist)); else symp = (struct nlist *) realloc(symp, (i+1)*sizeof(struct nlist)); if (symp == NULL) error(1, "out of memory"); symp[i++] = sym; } if (archive && ftell(fi)+sizeof(off_t) >= off) { error(0, "no string table (old format .o?)"); continue; } if (fread((char *)&strsiz,sizeof(strsiz),1,fi) != 1) { error(0, "no string table (old format .o?)"); goto out; } strp = (char *)malloc(strsiz); if (strp == NULL) error(1, "ran out of memory"); if (fread(strp+sizeof(strsiz),strsiz-sizeof(strsiz),1,fi) != 1) error(1, "error reading string table"); for (j = 0; j < i; j++) if (symp[j].n_un.n_strx) symp[j].n_un.n_name = symp[j].n_un.n_strx + strp; else symp[j].n_un.n_name = ""; 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 = 0; if (strp) free((char *)strp), strp = 0; } 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; { register char *cp; register r; long arsize; fseek(af, off, 0); r = fread((char *)&archdr, 1, sizeof(struct ar_hdr), af); if (r != sizeof(struct ar_hdr)) return(0); for (cp = archdr.ar_name; cp < &archdr.ar_name[sizeof(archdr.ar_name)]; cp++) if (*cp == ' ') *cp = '\0'; arsize = atol(archdr.ar_size); if (arsize & 1) ++arsize; off = ftell(af) + arsize; /* beginning of next element */ return(1); } error(n, s) char *s; { fprintf(stderr, "nm: %s:", *xargv); if (archive) { fprintf(stderr, "(%s)", archdr.ar_name); fprintf(stderr, ": "); } else fprintf(stderr, " "); fprintf(stderr, "%s\n", s); if (n) exit(2); errs = 1; } struct stabnames { int st_value; char *st_name; } stabnames[] ={ N_GSYM, "GSYM", N_FNAME, "FNAME", N_FUN, "FUN", N_STSYM, "STSYM", N_LCSYM, "LCSYM", N_RSYM, "RSYM", N_SLINE, "SLINE", N_SSYM, "SSYM", N_SO, "SO", N_LSYM, "LSYM", N_SOL, "SOL", N_PSYM, "PSYM", N_ENTRY, "ENTRY", N_LBRAC, "LBRAC", N_RBRAC, "RBRAC", N_BCOMM, "BCOMM", N_ECOMM, "ECOMM", N_ECOML, "ECOML", N_LENG, "LENG", N_PC, "PC", 0, 0 }; char * stab(val) { register struct stabnames *sp; static char prbuf[32]; for (sp = stabnames; sp->st_name; sp++) if (sp->st_value == val) return (sp->st_name); sprintf(prbuf, "%02x", val); return (prbuf); } SYM", N_LCSYM, "LCSYM", N_RSYM, "RSYM", N_SLINE, "SLINE", N_SSYM, "SSYM", N_SO, "SO", N_LSYM, "LSYM", N_SOL, "SOL", N_PSYM, "PSYM", N_ENTRY, "ENTRY", N_LBRAC, "LBRAC", N_RBRAC, "RBRAC", N_BCOMM, "BCOMM", N_ECOMM, "ECOMM", N_ECOMLcmd/num.c 444 0 33 2130 2416240111 5522 static char *sccsid = "@(#)num.c 4.1 (Berkeley) 10/1/80"; #include "stdio.h" #define formfeed 0xc /* * number - a cat like program which prints a file with line * numbers. Printing of numbers is suppressed on blank * lines. * * Original Version by William Joy, June 1977 * Updated October 1979 by M. Kirk McKusick */ main(ac, av) int ac; char *av[]; { register int argc = ac; register char **argv = av; register int lino; register char *lineptr; register FILE *STDOUT = stdout; register FILE *STDIN = stdin; char line[512]; extern char _sibuf[], _sobuf[]; argv++; argc--; lino = 1; setbuf(STDIN,_sibuf); setbuf(STDOUT,_sobuf); do { if (argc) if (freopen(*argv++, "r", STDIN) == NULL) { perror(*--argv); exit(1); } for(;;) { lineptr = line; *lineptr = 0; fscanf(STDIN,"%[^\n]",lineptr); if (feof(STDIN)) break; if (*lineptr == formfeed) putc(*lineptr++,STDOUT); if (!*lineptr) putc('\n',STDOUT); else fprintf(STDOUT,"%6d %s\n",lino,lineptr); lino++; getc(STDIN); } } while (--argc > 0); exit(); } -; lino = 1; setbuf(STDIN,_sibuf); setbuf(STDOUT,_sobuf); do { if (argc) if (freopen(*argv++, "r", STDIN) == NULL) { perror(*--argv); exit(1); } for(;;) { lineptr = line; *lineptr = 0; fscanf(STDIN,"%[^\n]",lineptr); if (feof(STDIN)) break; if (*lineptr == formfeed) putc(*lineptr++,STDOUT); if (!*lineptr) putc('\n',STDOUT); else fprintf(STDOUT,"%6d %s\cmd/od.c 444 0 33 10377 2470653325 5400 static char *sccsid = "@(#)od.c 4.2 (Berkeley) 2/7/81"; /* * od -- octal (also hex, decimal, and character) dump */ #include typedef unsigned long ulong; unsigned short word[16]; unsigned short lastword[16]; short nword = 8; int conv; int base = 010; int max; ulong addr; #define DWORD 0700 /* bitmask for double word output formats */ main(argc, argv) char **argv; { register char *p; register n, f, same; char outbuf[BUFSIZ]; #ifdef STANDALONE if (argv[0][0] == '\0') argc = getargv("od", &argv, 0); #else setbuf(stdout, outbuf); #endif argv++; f = 0; if(argc > 1) { p = *argv; if(*p == '-') { while(*p != '\0') { switch(*p++) { case 'o': conv |= 001; f = 6; break; case 'd': conv |= 002; f = 5; break; case 'x': case 'h': conv |= 010; f = 4; break; case 'c': conv |= 020; f = 7; break; case 'b': conv |= 040; f = 7; break; case 'O': conv |= 0100; f = 6; break; case 'D': conv |= 0200; f = 5; break; case 'H': case 'X': conv |= 0400; f = 4; break; case 'w': nword = 16; break; } if(f > max) max = f; } argc--; argv++; } } if(!conv) { max = 6; conv = 1; } if(argc > 1) if(**argv != '+') { if (freopen(*argv, "r", stdin) == NULL) { fprintf(stderr, "od: cannot open %s\n", *argv); exit(2); } argv++; argc--; } if(argc > 1) offset(*argv); same = -1; for ( ; (n = fread((char *)word, 1, sizeof(word[0])*nword, stdin)) > 0; addr += n) { if (same>=0) { for (f=0; f037 && c<0177) { printf(" "); putchar(c); return; } switch(c) { case '\0': printf(" \\0"); break; case '\b': printf(" \\b"); break; case '\f': printf(" \\f"); break; case '\n': printf(" \\n"); break; case '\r': printf(" \\r"); break; case '\t': printf(" \\t"); break; default: putn((ulong)c, 8, 3); } } putn(n, b, c) ulong n; unsigned b; { unsigned d; if(!c) return; putn(n/b, b, c-1); d = n%b; if (d > 9) putchar(d-10+'a'); else putchar(d+'0'); } pre(n) { int i; for(i=n; i='0' && d<='9') a = a*base + d - '0'; else if (d>='a' && d<='f' && base==16) a = a*base + d + 10 - 'a'; else break; } if (*s == '.') s++; if(*s=='b' || *s=='B') a *= 512; fseek(stdin, a, 0); addr = a; } r *p; ulong a; register int d; if (*s=='+') s++; if (*s=='x') { s++; base = 16; } else if (*s=='0' && s[1]=='x') { s += 2; base = 16; } else if (*s == '0') base = 8; p = s; while(*p) { if (*p++=='.') base = 10; } for (a=0;((cmd/nohup.sh 755 0 33 213 2111463407 6240 trap "" 1 15 if test -t 2>&1 ; then echo "Sending output to 'nohup.out'" exec nice -5 $* >>nohup.out 2>&1 else exec nice -5 $* 2>&1 fi '; else break; } if (*s == '.') s++; if(*s=='b' || *s=='B') a *= 512; fseek(stdin, a, 0); addr = a; } r *p; ulong a; register int d; if (*s=='+') s++; if (*s=='x') { s++; base = 16; } else if (*s=='0' && s[1]=='x') { s += 2; base = 16; } else i/( ,( 5< /\@,\D"cmd/passwd.c 444 0 33 6561 2416240113 6242 static char *sccsid = "@(#)passwd.c 4.1 (Berkeley) 10/1/80"; /* * enter a password in the password file * this program should be suid with owner * with an owner with write permission on /etc/passwd */ #include #include #include char passwd[] = "/etc/passwd"; char temp[] = "/etc/ptmp"; struct passwd *pwd; struct passwd *getpwent(); int endpwent(); char *strcpy(); char *crypt(); char *getpass(); char *getlogin(); char *pw; char pwbuf[10]; char buf[BUFSIZ]; main(argc, argv) char *argv[]; { char *p; int i; char saltc[2]; long salt; int u,fi,fo; int insist; int ok, flags; int c; int pwlen; FILE *tf; char *uname; insist = 0; if(argc < 2) { if ((uname = getlogin()) == NULL) { printf ("Usage: passwd user\n"); goto bex; } else { printf("Changing password for %s\n", uname); } } else { uname = argv[1]; } while(((pwd=getpwent()) != NULL)&&(strcmp(pwd->pw_name,uname)!=0)); u = getuid(); if((pwd==NULL) || (u!=0 && u != pwd->pw_uid)) { printf("Permission denied.\n"); goto bex; } endpwent(); if (pwd->pw_passwd[0] && u != 0) { strcpy(pwbuf, getpass("Old password:")); pw = crypt(pwbuf, pwd->pw_passwd); if(strcmp(pw, pwd->pw_passwd) != 0) { printf("Sorry.\n"); goto bex; } } tryagn: strcpy(pwbuf, getpass("New password:")); pwlen = strlen(pwbuf); if (pwlen == 0) { printf("Password unchanged.\n"); goto bex; } ok = 0; flags = 0; p = pwbuf; while(c = *p++){ if(c>='a' && c<='z') flags |= 2; else if(c>='A' && c<='Z') flags |= 4; else if(c>='0' && c<='9') flags |= 1; else flags |= 8; } if(flags >=7 && pwlen>= 4) ok = 1; if(((flags==2)||(flags==4)) && pwlen>=6) ok = 1; if(((flags==3)||(flags==5)||(flags==6))&&pwlen>=5) ok = 1; if((ok==0) && (insist<2)){ if(flags==1) printf("Please use at least one non-numeric character.\n"); else printf("Please use a longer password.\n"); insist++; goto tryagn; } if (strcmp(pwbuf,getpass("Retype new password:")) != 0) { printf ("Mismatch - password unchanged.\n"); goto bex; } time(&salt); salt += getpid(); saltc[0] = salt & 077; saltc[1] = (salt>>6) & 077; for(i=0;i<2;i++){ c = saltc[i] + '.'; if(c>'9') c += 7; if(c>'Z') c += 6; saltc[i] = c; } pw = crypt(pwbuf, saltc); signal(SIGHUP, SIG_IGN); signal(SIGINT, SIG_IGN); signal(SIGQUIT, SIG_IGN); if(access(temp, 0) >= 0) { printf("Temporary file busy -- try again\n"); goto bex; } signal(SIGTSTP, SIG_IGN); close(creat(temp,0600)); if((tf=fopen(temp,"w")) == NULL) { printf("Cannot create temporary file\n"); goto bex; } /* * copy passwd to temp, replacing matching lines * with new password. */ while((pwd=getpwent()) != NULL) { if(strcmp(pwd->pw_name,uname) == 0) { u = getuid(); if(u != 0 && u != pwd->pw_uid) { printf("Permission denied.\n"); goto out; } pwd->pw_passwd = pw; if (pwd->pw_gecos[0] == '*') pwd->pw_gecos++; } fprintf(tf,"%s:%s:%d:%d:%s:%s:%s\n", pwd->pw_name, pwd->pw_passwd, pwd->pw_uid, pwd->pw_gid, pwd->pw_gecos, pwd->pw_dir, pwd->pw_shell); } endpwent(); fclose(tf); /* * copy temp back to passwd file */ if((fi=open(temp,0)) < 0) { printf("Temp file disappeared!\n"); goto out; } if((fo=creat(passwd, 0644)) < 0) { printf("Cannot recreat passwd file.\n"); goto out; } while((u=read(fi,buf,sizeof(buf))) > 0) write(fo,buf,u); out: unlink(temp); bex: exit(1); } ++; } fprintf(tf,"%s:%s:%d:%d:%s:%s:%s\n", pwd->pw_name, pwd->pw_passwd, pwd->pw_uid, pwd->pw_gid, pwd->pw_gecos, pwd->pwcmd/init.c 444 0 33 15101 2522472275 5730 static char *sccsid = "@(#)init.c 4.5 (Berkeley) 4/26/81"; #include #include #include #include #include #include #define LINSIZ sizeof(wtmp.ut_line) #define TABSIZ 100 #define ALL p = &itab[0]; p < &itab[TABSIZ]; p++ #define EVER ;; #define SCPYN(a, b) strncpy(a, b, sizeof(a)) #define SCMPN(a, b) strncmp(a, b, sizeof(a)) char shell[] = "/bin/sh"; char getty[] = "/etc/getty"; char minus[] = "-"; char runc[] = "/etc/rc"; char ifile[] = "/etc/ttys"; char utmp[] = "/etc/utmp"; char wtmpf[] = "/usr/adm/wtmp"; char ctty[] = "/dev/console"; char dev[] = "/dev/"; struct utmp wtmp; struct { char line[LINSIZ]; char comn; char flag; } line; struct tab { char line[LINSIZ]; char comn; char xflag; int pid; } itab[TABSIZ]; int fi; int mergflag; char tty[20]; jmp_buf sjbuf, shutpass; time_t time0; int reset(); int idle(); char *strcpy(), *strcat(); long lseek(); main() { register int r11; /* passed thru from boot */ int howto, oldhowto; time0 = time(0); howto = r11; setjmp(sjbuf); signal(SIGTERM, reset); signal(SIGTSTP, idle); signal(SIGSTOP, SIG_IGN); signal(SIGTTIN, SIG_IGN); signal(SIGTTOU, SIG_IGN); for(EVER) { oldhowto = howto; howto = RB_SINGLE; if (setjmp(shutpass) == 0) shutdown(); if (oldhowto & RB_SINGLE) single(); if (runcom(oldhowto) == 0) continue; merge(); multiple(); } } int shutreset(); shutdown() { register i; register struct tab *p; close(creat(utmp, 0644)); signal(SIGHUP, SIG_IGN); for(ALL) { term(p); p->line[0] = 0; } signal(SIGALRM, shutreset); alarm(30); for(i=0; i<5; i++) kill(-1, SIGKILL); while(wait((int *)0) != -1) ; alarm(0); shutend(); } char shutfailm[] = "WARNING: Something is hung (wont die); ps axl advised\n"; shutreset() { int status; if (fork() == 0) { int ct = open(ctty, 1); write(ct, shutfailm, sizeof (shutfailm)); sleep(5); exit(1); } sleep(5); shutend(); longjmp(shutpass, 1); } shutend() { register i, f; acct(0); signal(SIGALRM, SIG_DFL); for(i=0; i<10; i++) close(i); f = open(wtmpf, 1); if (f >= 0) { lseek(f, 0L, 2); SCPYN(wtmp.ut_line, "~"); SCPYN(wtmp.ut_name, "shutdown"); time(&wtmp.ut_time); write(f, (char *)&wtmp, sizeof(wtmp)); close(f); } return(1); } single() { register pid; register xpid; extern errno; do { pid = fork(); if(pid == 0) { /* alarm(300); */ signal(SIGTERM, SIG_DFL); signal(SIGHUP, SIG_DFL); signal(SIGALRM, SIG_DFL); open(ctty, 2); dup(0); dup(0); execl(shell, minus, (char *)0); exit(0); } while((xpid = wait((int *)0)) != pid) if (xpid == -1 && errno == ECHILD) break; } while (xpid == -1); } runcom(oldhowto) int oldhowto; { register pid, f; int status; pid = fork(); if(pid == 0) { open("/", 0); dup(0); dup(0); if (oldhowto & RB_SINGLE) execl(shell, shell, runc, (char *)0); else execl(shell, shell, runc, "autoboot", (char *)0); exit(1); } while(wait(&status) != pid) ; if(status) return(0); f = open(wtmpf, 1); if (f >= 0) { lseek(f, 0L, 2); SCPYN(wtmp.ut_line, "~"); SCPYN(wtmp.ut_name, "reboot"); if (time0) { wtmp.ut_time = time0; time0 = 0; } else time(&wtmp.ut_time); write(f, (char *)&wtmp, sizeof(wtmp)); close(f); } return(1); } setmerge() { signal(SIGHUP, setmerge); mergflag = 1; } multiple() { register struct tab *p; register pid; loop: mergflag = 0; signal(SIGHUP, setmerge); for(EVER) { pid = wait((int *)0); if(mergflag) { merge(); goto loop; } if(pid == -1) return; for(ALL) if(p->pid == pid || p->pid == -1) { rmut(p); dfork(p); } } } term(p) register struct tab *p; { if(p->pid != 0) { rmut(p); kill(p->pid, SIGKILL); } p->pid = 0; } rline() { register c, i; loop: c = get(); if(c < 0) return(0); if(c == 0) goto loop; line.flag = c; c = get(); if(c <= 0) goto loop; line.comn = c; SCPYN(line.line, ""); for (i=0; i 0) c = get(); if(line.line[0] == 0) goto loop; if(line.flag == '0') goto loop; strcpy(tty, dev); strncat(tty, line.line, LINSIZ); if(access(tty, 06) < 0) goto loop; return(1); } get() { char b; if(read(fi, &b, 1) != 1) return(-1); if(b == '\n') return(0); return(b); } #define FOUND 1 #define CHANGE 2 merge() { register struct tab *p; fi = open(ifile, 0); if(fi < 0) return; for(ALL) p->xflag = 0; while(rline()) { for(ALL) { if (SCMPN(p->line, line.line)) continue; p->xflag |= FOUND; if(li((ne.comn != p->comn) { p->xflag |= CHANGE; p->comn = line.comn; } goto contin1; } for(ALL) { if(p->line[0] != 0) continue; SCPYN(p->line, line.line); p->xflag |= FOUND|CHANGE; p->comn = line.comn; goto contin1; } contin1: ; } close(fi); for(ALL) { if((p->xflag&FOUND) == 0) { term(p); p->line[0] = 0; } if((p->xflag&CHANGE) != 0) { term(p); dfork(p); } } } dfork(p) struct tab *p; { register pid; pid = fork(); if(pid == 0) { signal(SIGTERM, SIG_DFL); signal(SIGHUP, SIG_IGN); strcpy(tty, dev); strncat(tty, p->line, LINSIZ); chown(tty, 0, 0); chmod(tty, 0622); if (open(tty, 2) < 0) { int repcnt = 0; do { if (repcnt % 10 == 0) { int f = open("/dev/console", 1); write(f, "init: ", 6); write(f, tty, strlen(tty)); write(f, ": cannot open\n\r", 15); close(f); } repcnt++; sleep(60); } while (open(tty, 2) < 0); exit(0); /* have wrong control tty, start over */ } vhangup(); signal(SIGHUP, SIG_DFL); open(tty, 2); close(0); dup(1); dup(0); tty[0] = p->comn; tty[1] = 0; execl(getty, minus, tty, (char *)0); exit(0); } p->pid = pid; } rmut(p) register struct tab *p; { register f; int found = 0; f = open(utmp, 2); if(f >= 0) { while(read(f, (char *)&wtmp, sizeof(wtmp)) == sizeof(wtmp)) { if (SCMPN(wtmp.ut_line, p->line) || wtmp.ut_name[0]==0) continue; lseek(f, -(long)sizeof(wtmp), 1); SCPYN(wtmp.ut_name, ""); time(&wtmp.ut_time); write(f, (char *)&wtmp, sizeof(wtmp)); found++; } close(f); } if (found) { f = open(wtmpf, 1); if (f >= 0) { SCPYN(wtmp.ut_line, p->line); SCPYN(wtmp.ut_name, ""); time(&wtmp.ut_time); lseek(f, (long)0, 2); write(f, (char *)&wtmp, sizeof(wtmp)); close(f); } } } reset() { longjmp(sjbuf, 1); } idle() { register struct tab *p; register pid; signal(SIGTSTP, idle); for (;;) { pid = wait((int *) 0); if (mergflag) return; if (pid == -1) pause(); else { for (ALL) if (p->pid == pid) { rmut(p); p->pid = -1; } } } } d) { f = open(wtmpf, 1); if (f >= 0) { SCPYN(wtmp.ut_line, p->line); SCPYN(wtmp.ut_name, ""); time(&wtmp.ut_time); lseek(f, (long)0, 2); write(f, (char *)&wtmp, sizeof(wtmp)); close(f); } } } reset() { longjmp(sjbuf, 1); } idle() { register struct tab *p; register pid; signal(SIGTSTP, idle); for (;;) { pid = wait((int *) 0); if (mergflag) return; if (pid == -1) pause(); else { for (ALL) if cmd/pr.c 444 0 33 14277 2416240116 5410 static char *sccsid = "@(#)pr.c 4.1 (Berkeley) 10/1/80"; /* * 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 6720 char buffer[BUFS]; /* for multi-column output */ char obuf[BUFSIZ]; #define FF 014 int line; char *colp[72]; int nofile; char isclosed[10]; FILE *ifile[10]; char **lastarg; int peekc; int fpage; int page; int colw; int nspace; int width = 72; int length = 66; int plength = 61; int margin = 10; int ntflg; int 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': if (argc>=2) { header = *++argv; argc--; } continue; case 't': ntflg++; continue; case 'f': fflg++; plength = 60; continue; case 'l': length = atoi(++*argv); continue; case 'w': width = atoi(++*argv); continue; case 's': if (*++*argv) tabc = **argv; else tabc = '\t'; continue; case 'm': mflg++; continue; default: ncol = atoi(*argv); continue; } } else if (**argv == '+') { fpage = atoi(++*argv); } else { print(*argv, argv); nfdone++; if (mflg) break; } } if (nfdone==0) print((char *)0, (char **)0); done(); } done() { if (tty) chmod(tty, mode); exit(0); } onintr() { if (tty) chmod(tty, mode); _exit(1); } fixtty() { struct stat sbuf; tty = ttyname(1); if (tty == 0) return; stat(tty, &sbuf); mode = sbuf.st_mode&0777; chmod(tty, 0600); } print(fp, argp) char *fp; char **argp; { extern char *sprintf(); struct stat sbuf; register sncol; register char *sheader; register char *cbuf; char linebuf[150], *cp; if (ntflg) margin = 0; else margin = 10; if (length <= margin) length = 66; if (width <= 0) width = 72; if (ncol>72 || ncol>width) { fprintf(stderr, "pr: No room for columns.\n"); done(); } if (mflg) { mopen(argp); ncol = nofile; } colw = width/(ncol==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) fprintf(stderr, "pr: can't open %s\n", fp); ncol = sncol; header = sheader; return; } stat(fp, &sbuf); } else { file = stdin; time(&sbuf.st_mtime); } if (header == 0) header = fp?fp:""; cbuf = ctime(&sbuf.st_mtime); cbuf[16] = '\0'; cbuf[24] = '\0'; page = 1; icol = 0; colp[ncol] = bufp = buffer; if (mflg==0) nexbuf(); while (mflg&&nofile || (!mflg)&&tpgetc(ncol)>0) { if (mflg==0) { colp[ncol]--; if (colp[ncol] < buffer) colp[ncol] = &buffer[BUFS]; } line = 0; if (ntflg==0) { 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); } ++; 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; cmd/printenv.c 444 0 33 1223 2416427500 6603 ((static char *sccsid = "@(#)printenv.c 4.1 (Berkeley) 10/2/80"; /* * printenv * * Bill Joy, UCB * February, 1979 */ extern char **environ; main(argc, argv) int argc; char *argv[]; { register char **ep; int found = 0; argc--, argv++; if (environ) for (ep = environ; *ep; ep++) if (argc == 0 || prefix(argv[0], *ep)) { register char *cp = *ep; found++; if (argc) { while (*cp && *cp != '=') cp++; if (*cp == '=') cp++; } printf("%s\n", cp); } exit (!found); } prefix(cp, dp) char *cp, *dp; { while (*cp && *dp && *cp == *dp) cp++, dp++; if (*cp == 0) return (*dp == '='); return (0); } in(argc, argv) int argc; char *argv[]; { register char **ep; int found = 0; argc--, argv++; if (environ) for (ep = environ; *ep; ep++) if (argc == 0 || prefix(argv[0], *ep)) { register char *cp = *ep; found++; if (argc) { while (*cp && *cp != '=') cp++; if (*cp == '=') cp++; } printf("%s\n", cp); } exit (cmd/print.sh 755 0 33 14 2105540076 6223 pr $* | lpr prefix(cp, dp) char *cp, *dp; { while (*cp && *dp && *cp == *dp) cp++, dp++; if (*cp == 0) return (*dp == '='); return (0); } in(argc, argv) int argc; char *argv[]; { register char **ep; int found = 0; argc--, argv++; if (environ) for (ep = environ; *ep; ep++) if (argc == 0 || prefix(argv[0], *ep)) { register char *cp = *ep; found++; if (argc) { while (*cp && *cp != /( ,( 5< /\@,\D"cmd/w.c 444 0 33 35153 2537542543 5246 static char *sccsid = "@(#)w.c 4.4 (Berkeley) 6/5/81"; /* * w - print system status (who and what) * * This program is similar to the systat command on Tenex/Tops 10/20 * It needs read permission on /dev/mem, /dev/kmem, and /dev/drum. */ #include #include #include #include #include #include #include #include #include #include #include #include #define NMAX sizeof(utmp.ut_name) #define LMAX sizeof(utmp.ut_line) #define ARGWIDTH 33 /* # chars left on 80 col crt for args */ struct pr { short w_pid; /* proc.p_pid */ char w_flag; /* proc.p_flag */ short w_size; /* proc.p_size */ long w_seekaddr; /* where to find args */ long w_lastpg; /* disk address of stack */ int w_igintr; /* INTR+3*QUIT, 0=die, 1=ign, 2=catch */ time_t w_time; /* CPU time used by this process */ time_t w_ctime; /* CPU time used by children */ dev_t w_tty; /* tty device of process */ char w_comm[15]; /* user.u_comm, null terminated */ char w_args[ARGWIDTH+1]; /* args if interesting process */ } *pr; int nproc; struct nlist nl[] = { { "_proc" }, #define X_PROC 0 { "_swapdev" }, #define X_SWAPDEV 1 { "_Usrptmap" }, #define X_USRPTMA 2 { "_usrpt" }, #define X_USRPT 3 { "_nswap" }, #define X_NSWAP 4 { "_avenrun" }, #define X_AVENRUN 5 { "_bootime" }, #define X_BOOTIME 6 { "_nproc" }, #define X_NPROC 7 { 0 }, }; FILE *ps; FILE *ut; FILE *bootfd; int kmem; int mem; int swap; /* /dev/kmem, mem, and swap */ int nswap; dev_t tty; char doing[520]; /* process attached to terminal */ time_t proctime; /* cpu time of process in doing */ double avenrun[3]; struct proc *aproc; #define DIV60(t) ((t+30)/60) /* x/60 rounded */ #define TTYEQ (tty == pr[i].w_tty) #define IGINT (1+3*1) /* ignoring both SIGINT & SIGQUIT */ char *getargs(); char *fread(); char *ctime(); char *rindex(); FILE *popen(); struct tm *localtime(); int debug; /* true if -d flag: debugging output */ int header = 1; /* true if -h flag: don't print heading */ int lflag = 1; /* true if -l flag: long style output */ int login; /* true if invoked as login shell */ int idle; /* number of minutes user is idle */ int nusers; /* number of users logged in now */ char * sel_user; /* login of particular user selected */ char firstchar; /* first char of name of prog invoked as */ time_t jobtime; /* total cpu time visible */ time_t now; /* the current time of day */ struct tm *nowt; /* current time as time struct */ time_t bootime, uptime; /* time of last reboot & elapsed time since */ int np; /* number of processes currently active */ struct utmp utmp; struct proc mproc; struct user up; char fill[512]; main(argc, argv) char **argv; { int days, hrs, mins; register int i, j; char *cp; register int curpid, empty; char obuf[BUFSIZ]; setbuf(stdout, obuf); login = (argv[0][0] == '-'); cp = rindex(argv[0], '/'); firstchar = login ? argv[0][1] : (cp==0) ? argv[0][0] : cp[1]; cp = argv[0]; /* for Usage */ while (argc > 1) { if (argv[1][0] == '-') { for (i=1; argv[1][i]; i++) { switch(argv[1][i]) { case 'd': debug++; break; case 'h': header = 0; break; case 'l': lflag++; break; case 's': lflag = 0; break; case 'u': case 'w': firstchar = argv[1][i]; break; default: printf("Bad flag %s\n", argv[1]); exit(1); } } } else { if (!isalnum(argv[1][0]) || argc > 2) { printf("Usage: %s [ -hlsuw ] [ user ]\n", cp); exit(1); } else sel_user = argv[1]; } argc--; argv++; } if ((kmem = open("/dev/kmem", 0)) < 0) { fprintf(stderr, "No kmem\n"); exit(1); } nlist("/vmunix", nl); if (nl[0].n_type==0) { fprintf(stderr, "No namelist\n"); exit(1); } if (firstchar != 'u') readpr(); ut = fopen("/etc/utmp","r"); if (header) { /* Print time of day */ time(&now); nowt = localtime(&now); prtat(nowt); /* * Print how long system has been up. * (Found by looking for "bootime" in kernel) */ lseek(kmem, (long)nl[X_BOOTIME].n_value, 0); read(kmem, &bootime, sizeof (bootime)); uptime = now - bootime; days = uptime / (60*60*24); uptime %= (60*60*24); hrs = uptime / (60*60); uptime %= (60*60); mins = DIV60(uptime); printf(" up"); if (days > 0) printf(" %d day%s,", days, days>1?"s":""); if (hrs > 0 && mins > 0) { printf(" %2d:%02d,", hrs, mins); } else { if (hrs > 0) printf(" %d hr%s,", hrs, hrs>1?"s":""); if (mins > 0) printf(" %d min%s,", mins, mins>1?"s":""); } /* Print number of users logged in to system */ while (fread(&utmp, sizeof(utmp), 1, ut)) { if (utmp.ut_name[0] != '\0') nusers++; } rewind(ut); printf(" %d users", nusers); /* * Print 1, 5, and 15 minute load averages. * (Found by looking in kernel for avenrun). */ printf(", load average:"); lseek(kmem, (long)nl[X_AVENRUN].n_value, 0); read(kmem, avenrun, sizeof(avenrun)); for (i = 0; i < (sizeof(avenrun)/sizeof(avenrun[0])); i++) { if (i > 0) printf(","); printf(" %.2f", avenrun[i]); } printf("\n"); if (firstchar == 'u') exit(0); /* Headers for rest of output */ if (lflag) printf("User tty login@ idle JCPU PCPU what\n"); else printf("User tty idle what\n"); fflush(stdout); } for (;;) { /* for each entry in utmp */ if (fread(&utmp, sizeof(utmp), 1, ut) == NULL) { fclose(ut); exit(0); } if (utmp.ut_name[0] == '\0') continue; /* that tty is free */ if (sel_user && strcmpn(utmp.ut_name, sel_user, NMAX) != 0) continue; /* we wanted only somebody else */ gettty(); jobtime = 0; proctime = 0; strcpy(doing, "-"); /* default act: normally never prints */ empty = 1; curpid = -1; idle = findidle(); for (i=0; i 0) if (j==IGINT) printf(" &"); else printf(" & %d %d", j%3, j/3); printf("\n"); } if (empty && pr[i].w_igintr!=IGINT) { empty = 0; curpid = -1; } if(pr[i].w_pid>curpid && (pr[i].w_igintr!=IGINT || empty)){ curpid = pr[i].w_pid; strcpy(doing, lflag ? pr[i].w_args : pr[i].w_comm); #ifdef notdef if (doing[0]==0 || doing[0]=='-' && doing[1]<=' ' || doing[0] == '?') { strcat(doing, " ("); strcat(doing, pr[i].w_comm); strcat(doing, ")"); } #endif } } putline(); } } /* figure out the major/minor device # pair for this tty */ gettty() { char ttybuf[20]; struct stat statbuf; ttybuf[0] = 0; strcpy(ttybuf, "/dev/"); strcat(ttybuf, utmp.ut_line); stat(ttybuf, &statbuf); tty = statbuf.st_rdev; } /* * putline: print out the accumulated line of info about one user. */ putline() { register int tm; /* print login name of the user */ printf("%-*.*s ", NMAX, NMAX, utmp.ut_name); /* print tty user is on */ if (lflag) /* long form: all (up to) LMAX chars */ printf("%-*.*s", LMAX, LMAX, utmp.ut_line); else { /* short form: 2 chars, skipping 'tty' if there */ if (utmp.ut_line[0]=='t' && utmp.ut_line[1]=='t' && utmp.ut_line[2]=='y') printf("%-2.2s", &utmp.ut_line[3]); else printf("%-2.2s", utmp.ut_line); } if (lflag) /* print when the user logged in */ prtat(localtime(&utmp.ut_time)); /* print idle time */ prttime(idle," "); if (lflag) { /* print CPU time for all processes & children */ (( prttime(DIV60(jobtime)," "); /* print cpu time for interesting process */ prttime(DIV60(proctime)," "); } /* what user is doing, either command tail or args */ printf(" %-.32s\n",doing); fflush(stdout); } /* find & return number of minutes current tty has been idle */ findidle() { struct stat stbuf; long lastaction, diff; char ttyname[20]; strcpy(ttyname, "/dev/"); strcatn(ttyname, utmp.ut_line, LMAX); stat(ttyname, &stbuf); time(&now); lastaction = stbuf.st_atime; diff = now - lastaction; diff = DIV60(diff); if (diff < 0) diff = 0; return(diff); } /* * prttime prints a time in hours and minutes. * The character string tail is printed at the end, obvious * strings to pass are "", " ", or "am". */ prttime(tim, tail) time_t tim; char *tail; { register int didhrs = 0; if (tim >= 60) { printf("%3d:", tim/60); didhrs++; } else { printf(" "); } tim %= 60; if (tim > 0 || didhrs) { printf(didhrs&&tim<10 ? "%02d" : "%2d", tim); } else { printf(" "); } printf("%s", tail); } /* prtat prints a 12 hour time given a pointer to a time of day */ prtat(p) struct tm *p; { register int t, pm; t = p -> tm_hour; pm = (t > 11); if (t > 11) t -= 12; if (t == 0) t = 12; prttime(t*60 + p->tm_min, pm ? "pm" : "am"); } /* * readpr finds and reads in the array pr, containing the interesting * parts of the proc and user tables for each live process. */ readpr() { int pn, mf, addr, c; int szpt, pfnum, i; struct pte *Usrptma, *usrpt, *pte, apte; struct dblock db; Usrptma = (struct pte *) nl[X_USRPTMA].n_value; usrpt = (struct pte *) nl[X_USRPT].n_value; if((mem = open("/dev/mem", 0)) < 0) { fprintf(stderr, "No mem\n"); exit(1); } if ((swap = open("/dev/drum", 0)) < 0) { fprintf(stderr, "No drum\n"); exit(1); } /* * read mem to find swap dev. */ lseek(kmem, (long)nl[X_SWAPDEV].n_value, 0); read(kmem, &nl[X_SWAPDEV].n_value, sizeof(nl[X_SWAPDEV].n_value)); /* * Find base of swap */ lseek(kmem, (long)nl[X_NSWAP].n_value, 0); read(kmem, &nswap, sizeof(nswap)); /* * Locate proc table */ lseek(kmem, (long)nl[X_NPROC].n_value, 0); read(kmem, &nproc, sizeof(nproc)); pr = (struct pr *)calloc(nproc, sizeof (struct pr)); np = 0; lseek(kmem, (long)nl[X_PROC].n_value, 0); read(kmem, &aproc, sizeof(aproc)); for (pn=0; pn1) + 3*((int)up.u_signal[3]==1)) + 6*((int)up.u_signal[3]>1); pr[np].w_time = up.u_vm.vm_utime + up.u_vm.vm_stime; pr[np].w_ctime = up.u_cvm.vm_utime + up.u_cvm.vm_stime; pr[np].w_tty = up.u_ttyd; up.u_comm[14] = 0; /* Bug: This bombs next field. */ strcpy(pr[np].w_comm, up.u_comm); /* * Get args if there's a chance we'll print it. * Cant just save pointer: getargs returns static place. * Cant use strcpyn: that crock blank pads. */ pr[np].w_args[0] = 0; strcatn(pr[np].w_args,getargs(&pr[np]),ARGWIDTH); if (pr[np].w_args[0]==0 || pr[np].w_args[0]=='-' && pr[np].w_args[1]<=' ' || pr[np].w_args[0] == '?') { strcat(pr[np].w_args, " ("); strcat(pr[np].w_args, pr[np].w_comm); strcat(pr[np].w_args, ")"); } np++; } } /* * getargs: given a pointer to a proc structure, this looks at the swap area * and tries to reconstruct the arguments. This is straight out of ps. */ char * getargs(p) struct pr *p; { int c, addr, nbad; static int abuf[CLSIZE*NBPG/sizeof(int)]; struct pte pagetbl[NPTEPG]; register int *ip; register char *cp, *cp1; if ((p->w_flag & SLOAD) == 0) { lseek(swap, p->w_lastpg, 0); if (read(swap, abuf, sizeof(abuf)) != sizeof(abuf)) return(p->w_comm); } else { c = p->w_seekaddr; lseek(mem,c,0); if (read(mem,pagetbl,NBPG) != NBPG) return(p->w_comm); if (pagetbl[NPTEPG-CLSIZE-UPAGES].pg_fod==0 && pagetbl[NPTEPG-CLSIZE-UPAGES].pg_pfnum) { lseek(mem,ctob(pagetbl[NPTEPG-CLSIZE-UPAGES].pg_pfnum),0); if (read(mem,abuf,sizeof(abuf)) != sizeof(abuf)) return(p->w_comm); } else { lseek(swap, p->w_lastpg, 0); if (read(swap, abuf, sizeof(abuf)) != sizeof(abuf)) return(p->w_comm); } } abuf[sizeof(abuf)/sizeof(abuf[0])-1] = 0; for (ip = &abuf[sizeof(abuf)/sizeof(abuf[0])-2]; ip > abuf;) { /* Look from top for -1 or 0 as terminator flag. */ if (*--ip == -1 || *ip == 0) { cp = (char *)(ip+1); if (*cp==0) cp++; nbad = 0; /* up to 5 funny chars as ?'s */ for (cp1 = cp; cp1 < (char *)&abuf[sizeof(abuf)/sizeof(abuf[0])]; cp1++) { c = *cp1&0177; if (c==0) /* nulls between args => spaces */ *cp1 = ' '; else if (c < ' ' || c > 0176) { if (++nbad >= 5) { *cp1++ = ' '; break; } *cp1 = '?'; } else if (c=='=') { /* Oops - found an * environment var, back * over & erase it. */ *cp1 = 0; while (cp1>cp && *--cp1!=' ') *cp1 = 0; break; } } while (*--cp1==' ') /* strip trailing spaces */ *cp1 = 0; return(cp); } } return (p->w_comm); } /* * Given a base/size pair in virtual swap area, * return a physical base/size pair which is the * (largest) initial, physically contiguous block. */ vstodb(vsbase, vssize, dmp, dbp, rev) register int vsbase; int vssize; struct dmap *dmp; register struct dblock *dbp; { register int blk = DMMIN; register swblk_t *ip = dmp->dm_map; if (vsbase < 0 || vsbase + vssize > dmp->dm_size) panic("vstodb"); while (vsbase >= blk) { vsbase -= blk; if (blk < DMMAX) blk *= 2; ip++; } if (*ip <= 0 || *ip + blk > nswap) panic("vstodb *ip"); dbp->db_size = min(vssize, blk - vsbase); dbp->db_base = *ip + (rev ? blk - (vsbase + dbp->db_size) : vsbase); } panic(cp) char *cp; { /* printf("%s\n", cp); */ } min(a, b) { return (a < b ? a : b); } struct dblock *dbp; { register int blk = DMMIN; register swblk_t *ip = dmp->dm_map; if (vsbase < 0 || vsbase + vssize > dmp->dm_size) panic("vstodb"); while (vsbase >= blk) { vsbase -= blk; if (blk < DMMAX) blk *= 2; ip++; } if (*ip <= 0 || *ip + blk > nswap) panic("vstodb *ip"); dbp->db_size = min(vssize, blk - vsbase); dbp->db_base = *ip + (rev ? blk - (vsbase + dbp->db_size) :cmd/prmail.c 444 0 33 1756 2421026415 6231 static char *sccsid = "@(#)prmail.c 4.1 (Berkeley) 10/9/80"; #include /* * prmail */ struct passwd *getpwuid(); char *getenv(); main(argc, argv) int argc; char **argv; { register struct passwd *pp; --argc, ++argv; if (chdir("/usr/spool/mail") < 0) { perror("/usr/spool/mail"); exit(1); } if (argc == 0) { char *user = getenv("USER"); if (user == 0) { pp = getpwuid(getuid()); if (pp == 0) { printf("Who are you?\n"); exit(1); } user = pp->pw_name; } prmail(user, 0); } else while (--argc >= 0) prmail(*argv++, 1); exit(0); } #include #include prmail(user, other) char *user; { struct stat stb; char cmdbuf[256]; if (stat(user, &stb) < 0) { printf("No mail for %s.\n", user); return; } if (access(user, "4") < 0) { printf("Mailbox for %s unreadable\n", user); return; } if (other) printf(">>> %s <<<\n", user); sprintf(cmdbuf, "more %s", user); system(cmdbuf); if (other) printf("-----\n\n"); } ; } prmail(usecmd/su.c 444 0 33 3673 2477644144 5414 static char *sccsid = "@(#)su.c 4.1 (Berkeley) 10/1/80"; #include #include struct passwd *pwd,*getpwnam(); char *crypt(); char *getpass(); main(argc,argv) int argc; char **argv; { char *nptr; char *password; int badsw = 0; char *shell = "/bin/sh"; int niced = 0; if(argc > 1) nptr = argv[1]; else { nptr = "root"; nice(-4); niced = -4; } if((pwd=getpwnam(nptr)) == NULL) { printf("Unknown id: %s\n",nptr); exit(1); } if(pwd->pw_passwd[0] == '\0' || getuid() == 0) go((to ok; password = getpass("Password:"); if(badsw || (strcmp(pwd->pw_passwd, crypt(password, pwd->pw_passwd)) != 0)) { bad: printf("Sorry\n"); if(pwd->pw_uid == 0) { FILE *console = fopen("/dev/console", "w"); if (console != NULL) { fprintf(console, "BADSU: %s %s\r\n", getlogin(), ttyname(2)); fclose(console); } } exit(2); } ok: endpwent(); if(pwd->pw_uid == 0) { FILE *console = fopen("/dev/console", "w"); if (console != NULL) { fprintf(console, "SU: %s %s\r\n", getlogin(), ttyname(2)); fclose(console); } } setgid(pwd->pw_gid); setuid(pwd->pw_uid); if (pwd->pw_shell && *pwd->pw_shell) shell = pwd->pw_shell; homeis(pwd->pw_dir); shellis(shell); nice(-niced); execl(shell, "su", 0); printf("No shell\n"); exit(3); } char **environ; homeis(hp) char *hp; { register char *cp, *dp; register char **ep = environ; static char homebuf[128]; while (dp = *ep++) { for (cp = "HOME"; *cp == *dp && *cp; cp++, dp++) continue; if (*cp == 0 && (*dp == '=' || *dp == 0)) { strcpy(homebuf, "HOME="); strcat(homebuf, hp); *--ep = homebuf; return; } } } shellis(sp) char *sp; { register char *cp, *dp; register char **ep = environ; static char shellbuf[128]; while (dp = *ep++) { for (cp = "SHELL"; *cp == *dp && *cp; cp++, dp++) continue; if (*cp == 0 && (*dp == '=' || *dp == 0)) { strcpy(shellbuf, "SHELL="); strcat(shellbuf, sp); *--ep = shellbuf; return; } } } & *cp; cp++, dp++) continue; if (*cp == 0 && (*dp == '=' || *dp cmd/pti.c 444 0 33 15640 2416240133 5555 static char *sccsid = "@(#)pti.c 4.1 (Berkeley) 10/1/80"; #define DBL 0200 /* C version of pti */ char *ap; char ibuf[512]; char *ibufp = ibuf; char *eibufp = ibuf; int fid; int esc; int escd; int verd; int esct; int osize = 02; int size = 02; int leadtot; int railmag; int lead; int mcase; int stab[] = {010,0,01,07,02,03,04,05,0211,06,0212,0213,0214,0215,0216,0217}; int rtab[] = {6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 28, 36, 18}; char *asctab[128]; char *spectab[128]; long offset; int lflg; int xxx; main(argc,argv) int argc; char **argv; { register i, j; register char *k; extern ex(); while((--argc > 0) && ((++argv)[0][0]=='-')){ switch(argv[0][1]){ case 'l': lflg++; continue; default: ap = &argv[0][1]; while(((j = *ap++ - '0') >= 0) && (j <= 9))offset = 8*offset +j; continue; } } if(argc){ if((fid=open(argv[0], 0)) < 0){ printf("Cannot open: %s\n",argv[0]); exit(1); } } lseek(fid,offset,0); while((i = getc()) >= 0){ if(i & 0200){ if(!lflg)printf("%o ",i); esc += (~i) & 0177; continue; } if(esc){ if(escd){ if(!lflg)printf("< %d\n",esc); esc = -esc; }else{ if(!lflg)printf("> %d\n",esc); } esct += esc; esc = 0; } if(!lflg)printf("%o ",i); if(!i){if(!lflg)printf("\n"); continue;} switch(i){ case 0100: /*init*/ escd = verd = mcase = railmag = 0; if(!lflg)printf("Initialize\n"); continue; case 0101: /*lower rail*/ railmag &= ~01; if(!lflg)printf("Lower rail\n"); continue; case 0102: /*upper rail*/ railmag |= 01; if(!lflg)printf("Upper rail\n"); continue; case 0103: /*upper mag*/ railmag |= 02; if(!lflg)printf("Upper mag\n"); continue; case 0104: /*lower mag*/ railmag &= ~02; if(!lflg)printf("Lower mag\n"); continue; case 0105: /*lower case*/ mcase = 0; if(!lflg)printf("Lower case\n"); continue; case 0106: /*upper case*/ mcase = 0100; if(!lflg)printf("Upper case\n"); continue; case 0107: /*escape forward*/ escd = 0; if(!lflg)printf("> mode, %d\n",esct); continue; case 0110: /*escape backward*/ escd = 1; if(!lflg)printf("< mode, %d\n",esct); continue; case 0111: /*stop*/ if(!lflg)printf("STOP\n"); continue; case 0112: /*lead forward*/ verd = 0; if(!lflg)printf("Lead forward, %d\n",leadtot); continue; case 0114: /*lead backward*/ verd = 1; if(!lflg)printf("Lead backward, %d\n",leadtot); continue; case 0115: /*undefined*/ if(!lflg)printf("New page\n"); continue; case 0116: lead = 64 * getc(); goto leadin; case 0117: case 0113: if(!lflg)printf("Undefined code\n"); continue; } if((i & 0340) == 0140){ /*leading*/ lead = (~i) & 037; leadin: if(!lflg)printf("Lead %d\n",lead); if(verd)lead = -lead; leadtot += lead; continue; } if((i & 0360) == 0120){ /*size change*/ i &= 017; for(j = 0; i != (stab[j] & 017); j++); osize = size; size = stab[j]; if(!lflg){ printf("Size %d",rtab[j]); if(!(osize & DBL) && (size & DBL))printf(", double\n"); else if((osize & DBL) && !(size & DBL))printf(", single\n"); else printf("\n"); } continue; } if(i & 0300)continue; i = (i & 077) | mcase; if(railmag != 03)k = asctab[i]; else k = spectab[i]; if(!lflg)printf("%s\n",k); continue; } ex(); } ex(){ printf("Total lead %d\n",leadtot); exit(0); } getc(){ register i; if(ibufp >= eibufp){ if((i=read(fid,ibuf,512)) <= 0)ex(); eibufp = ibuf + i; ibufp = ibuf; } return(*ibufp++ & 0377); } char *asctab[128] = { 0, /*blank*/ "h", /*h*/ "t", /*t*/ "n", /*n*/ "m", /*m*/ "l", /*l*/ "i", /*i*/ "z", /*z*/ "s", /*s*/ "d", /*d*/ "b", /*b*/ "x", /*x*/ "f", /*f*/ "j", /*j*/ "u", /*u*/ "k", /*k*/ 0, /*blank*/ "p", /*p*/ "-", /*_ 3/4 em dash*/ ";", /*;*/ 0, /*blank*/ "a", /*a*/ "_", /*rule*/ "c", /*c*/ "`", /*` open*/ "e", /*e*/ "'", /*' close*/ "o", /*o*/ 0, /*1/4*/ "r", /*r*/ 0, /*1/2*/ "v", /*v*/ "-", /*- hyphen*/ "w", /*w*/ "q", /*q*/ "/", /*/*/ ".", /*.*/ "g", /*g*/ 0, /*3/4*/ ",", /*,*/ "&", /*&*/ "y", /*y*/ 0, /*blank*/ "%", /*%*/ 0, /*blank*/ "Q", /*Q*/ "T", /*T*/ "O", /*O*/ "H", /*H*/ "N", /*N*/ "M", /*M*/ "L", /*L*/ "R", /*R*/ "G", /*G*/ "I", /*I*/ "P", /*P*/ "C", /*C*/ "V", /*V*/ "E", /*E*/ "Z", /*Z*/ "D", /*D*/ "B", /*B*/ "S", /*S*/ "Y", /*Y*/ 0, /*blank*/ "F", /*F*/ "X", /*X*/ "A", /*A*/ "W", /*W*/ "J", /*J*/ "U", /*U*/ "K", /*K*/ "0", /*0*/ "1", /*1*/ "2", /*2*/ "3", /*3*/ "4", /*4*/ "5", /*5*/ "6", /*6*/ "7", /*7*/ "8", /*8*/ "9", /*9*/ "*", /***/ "-", /*minus*/ 0, /*fi*/ 0, /*fl*/ 0, /*ff*/ 0, /*cent mark*/ 0, /*ffl*/ 0, /* ffi */ "(", /*(*/ ")", /*)*/ "[", /*[*/ "]", /*]*/ 0, /*degree*/ 0, /*dagger*/ "=", /*=*/ 0, /*registered*/ ":", /*:*/ "+", /*+*/ 0, /*blank*/ "!", /*!*/ 0, /*bullet*/ "?", /*?*/ "'", /*foot mark*/ "|", /*|*/ 0, /*blank*/ 0, /*copyright*/ 0, /*square*/ "$" }; /*$*/ char *spectab[128] = { 0, /*blank*/ 0, /*psi*/ 0, /*theta*/ 0, /*nu*/ 0, /*mu*/ 0, /*lambda*/ 0, /*iota*/ 0, /*zeta*/ 0, /*sigma*/ 0, /*delta*/ 0, /*beta*/ 0, /*xi*/ 0, /*eta*/ 0, /*phi*/ "u", /*upsilon*/ 0, /*kappa*/ 0, /*blank*/ 0, /*pi*/ "@", /*at sign @*/ 0, /*down arrow*/ 0, /*blank*/ 0, /*alpha*/ "|", /*or*/ 0, /*chi*/ "\"", /*"*/ 0, /*epsilon*/ "=", /*equals*/ "o", /*omicron*/ 0, /*left arrow*/ 0, /*rho*/ 0, /*up arrow*/ 0, /*tau*/ "_", /*underrule*/ "\\", /*\*/ 0, /*Psi*/ 0, /*bell system sign*/ 0, /*infinity*/ 0, /*gamma*/ 0, /*improper superset*/ 0, /*proportional to*/ 0, /*right hand*/ 0, /*omega*/ 0, /*blank*/ 0, /*gradient*/ 0, /*blank*/ 0, /*Phi*/ 0, /*Theta*/ 0, /*Omega*/ 0, /*cup (union)*/ 0, /*root en*/ 0, /*terminal sigma*/ 0, /*Lambda*/ "-", /*some horizontal line*/ 0, /*Gamma*/ 0, /*integral sign*/ 0, /*Pi*/ 0, /*subset of*/ 0, /*superset of*/ 0, /*approximates*/ 0, /*partial derivative*/ 0, /*Delta*/ 0, /*square root*/ 0, /*Sigma*/ 0, /*approx =*/ 0, /*blank*/ ">", /*>*/ 0, /*Xi*/ "<", /*<*/ "/", /*slash (longer)*/ 0, /*cap (intersection)*/ "Y", /*Upsilon*/ 0, /*not*/ "|", /*right ceiling (rt of ")*/ "|", /*left top (of big curly)*/ "|", /*bold vertical*/ "|", /*left center of big curly bracket*/ "|", /*left bottom*/ "|", /*right top*/ "|", /*right center of big curly bracket*/ "|", /*right bot*/ "|", /*right floor (rb of ")*/ "|", /*left floor (left bot of big sq bract)*/ "|", /*left ceiling (lt of ")*/ "x", /*multiply*/ 0, /*divide*/ 0, /*plus-minus*/ 0, /*<=*/ 0, /*>=*/ 0, /*identically equal*/ 0, /*not equal*/ "{", /*{*/ "}", /*}*/ "'", /*' acute accent*/ "`", /*` grave accent*/ "^", /*^*/ "#", /*sharp*/ 0, /*left hand*/ 0, /*member of*/ "~", /*~*/ 0, /*empty set*/ 0, /*blank*/ 0, /*dbl dagger*/ "|", /*box rule*/ "*", /*telephone asterisk?*/ 0, /*improper subset*/ 0, /*circle*/ 0, /*blank*/ "+", /*eqn plus sign*/ 0, /*right arrow*/ 0 }; /*section mark*/ (lt of ")*/ "x", /*multiply*/ 0, /*divide*/ 0, /*plus-minus*/ 0, /*<=*/ 0, /*>=*/ 0, /cmd/ptx.c 444 0 33 22724 2416240136 5600 static char *sccsid = "@(#)ptx.c 4.1 (Berkeley) 10/1/80"; # /* permuted title index ptx [-t] [-i ignore] [-o only] [-w num] [-f] [input] [output] Ptx reads the input file and permutes on words in it. It excludes all words in the ignore file. Alternately it includes words in the only file. if neither is given it excludes the words in /usr/lib/eign. The width of the output line can be changed to num characters. If omitted 72 is default unless troff than 100. the -f flag tells the program to fold th((e output the -t flag says the output is for troff and the output is then wider.  make: cc ptx.c -lS */ #include #include #include #define DEFLTX "/usr/lib/eign" #define TILDE 0177 #define SORT "/usr/bin/sort" #define N 30 #define MAX N*BUFSIZ #define LMAX 200 #define MAXT 2048 #define MASK 03777 #define SET 1 #define isabreak(c) (btable[c]) extern char *calloc(), *mktemp(); extern char *getline(); int status; char *hasht[MAXT]; char line[LMAX]; char btable[128]; int ignore; int only; int llen = 72; int gap = 3; int gutter = 3; int mlen = LMAX; int wlen; int rflag; int halflen; char *strtbufp, *endbufp; char *empty = ""; char *infile; FILE *inptr = stdin; char *outfile; FILE *outptr = stdout; char *sortfile; /* output of sort program */ char nofold[] = {'-', 'd', 't', TILDE, 0}; char fold[] = {'-', 'd', 'f', 't', TILDE, 0}; char *sortopt = nofold; FILE *sortptr; char *bfile; /*contains user supplied break chars */ FILE *bptr; main(argc,argv) int argc; char **argv; { register int c; register char *bufp; int pid; char *pend; extern onintr(); char *xfile; FILE *xptr; if(signal(SIGHUP,onintr)==SIG_IGN) signal(SIGHUP,SIG_IGN); if(signal(SIGINT,onintr)==SIG_IGN) signal(SIGINT,SIG_IGN); signal(SIGPIPE,onintr); signal(SIGTERM,onintr); /* argument decoding */ xfile = DEFLTX; argv++; while(argc>1 && **argv == '-') { switch (*++*argv){ case 'r': rflag++; break; case 'f': sortopt = fold; break; case 'w': if(argc >= 2) { argc--; wlen++; llen = atoi(*++argv); if(llen == 0) diag("Wrong width:",*argv); if(llen > LMAX) { llen = LMAX; msg("Lines truncated to 200 chars.",empty); } break; } case 't': if(wlen == 0) llen = 100; break; case 'g': if(argc >=2) { argc--; gap = gutter = atoi(*++argv); } break; case 'i': if(only) diag("Only file already given.",empty); if (argc>=2){ argc--; ignore++; xfile = *++argv; } break; case 'o': if(ignore) diag("Ignore file already given",empty); if (argc>=2){ only++; argc--; xfile = *++argv; } break; case 'b': if(argc>=2) { argc--; bfile = *++argv; } break; default: msg("Illegal argument:",*argv); } argc--; argv++; } if(argc>3) diag("Too many filenames",empty); else if(argc==3){ infile = *argv++; outfile = *argv; if((outptr = fopen(outfile,"w")) == NULL) diag("Cannot open output file:",outfile); } else if(argc==2) { infile = *argv; outfile = 0; } /* Default breaks of blank, tab and newline */ btable[' '] = SET; btable['\t'] = SET; btable['\n'] = SET; if(bfile) { if((bptr = fopen(bfile,"r")) == NULL) diag("Cannot open break char file",bfile); while((c = getc(bptr)) != EOF) btable[c] = SET; } /* Allocate space for a buffer. If only or ignore file present read it into buffer. Else read in default ignore file and put resulting words in buffer. */ if((strtbufp = calloc(N,BUFSIZ)) == NULL) diag("Out of memory space",empty); bufp = strtbufp; endbufp = strtbufp+MAX; if((xptr = fopen(xfile,"r")) == NULL) diag("Cannot open file",xfile); while(bufp < endbufp && (c = getc(xptr)) != EOF) { if(isabreak(c)) { if(storeh(hash(strtbufp,bufp),strtbufp)) diag("Too many words",xfile); *bufp++ = '\0'; strtbufp = bufp; } else { *bufp++ = (isupper(c)?tolower(c):c); } } if (bufp >= endbufp) diag("Too many words in file",xfile); endbufp = --bufp; /* open output file for sorting */ sortfile = mktemp("/tmp/ptxsXXXXX"); if((sortptr = fopen(sortfile, "w")) == NULL) diag("Cannot open output for sorting:",sortfile); /* get a line of data and compare each word for inclusion or exclusion in the sort phase */ if (infile!=0 && (inptr = fopen(infile,"r")) == NULL) diag("Cannot open data: ",infile); while(pend=getline()) cmpline(pend); fclose(sortptr); switch (pid = fork()){ case -1: /* cannot fork */ diag("Cannot fork",empty); case 0: /* child */ execl(SORT, SORT, sortopt, "+0", "-1", "+1", sortfile, "-o", sortfile, 0); default: /* parent */ while(wait(&status) != pid); } getsort(); onintr(); } msg(s,arg) char *s; char *arg; { fprintf(stderr,"%s %s\n",s,arg); return; } diag(s,arg) char *s, *arg; { msg(s,arg); exit(1); } char *getline() { register c; register char *linep; char *endlinep; endlinep= line + mlen; linep = line; /* Throw away leading white space */ while(isspace(c=getc(inptr))) ; if(c==EOF) return(0); ungetc(c,inptr); while(( c=getc(inptr)) != EOF) { switch (c) { case '\t': if(linephalflen-1) p3b = p3a+halflen-1; p2a = ltrim(ref,p2b=linep,halflen-1); if(p2b-p2a>halflen-1) p2a = p2b-halflen-1; p1b = rtrim(p1a=p3b+(isspace(p3b[0])!=0),tilde, w=halflen-(p2b-p2a)-gap); if(p1b-p1a>w) p1b = p1a; p4a = ltrim(ref,p4b=p2a-(isspace(p2a[-1])!=0), w=halflen-(p3b-p3a)-gap); if(p4b-p4a>w) p4a = p4b; fprintf(outptr,".xx \""); putout(p1a,p1b); /* tilde-1 to account for extra space before TILDE */ if(p1b!=(tilde-1) && p1a!=p1b) fprintf(outptr,"/"); fprintf(outptr,"\" \""); if(p4a==p4b && p2a!=ref && p2a!=p2b) fprintf(outptr,"/"); putout(p2a,p2b); fprintf(outptr,"\" \""); putout(p3a,p3b); /* ++p3b to account for extra blank after TILDE */ /* ++p3b to account for extra space before TILDE */ if(p1a==p1b && ++p3b!=tilde) fprintf(outptr,"/"); fprintf(outptr,"\" \""); if(p1a==p1b && p4a!=ref && p4a!=p4b) fprintf(outptr,"/"); putout(p4a,p4b); if(rflag) fprintf(outptr,"\" %s\n",tilde); else fprintf(outptr,"\"\n"); linep = line; break; case '"': /* put double " for " */ *linep++ = c; default: *linep++ = c; } } } char *rtrim(a,c,d) char *a,*c; { char *b,*x; b = c; for(x=a+1; x<=c&&x-a<=d; x++) if((x==c||isspace(x[0]))&&!isspace(x[-1])) b = x; if(b=c&&b-x<=d; x--) if(!isspace(x[0])&&(x==c||isspace(x[-1]))) a = x; if(a>c&&!isspace(a[-1])) a--; return(a); } putout(strt,end) char *strt, *end; { char *cp; cp = strt; for(cp=strt; cp>2)) & MASK; return(k); } storeh(num,strtp) int num; char *strtp; { int i; for(i=num; i #include #include #include char dot[] = "."; char dotdot[] = ".."; char name[BUFSIZ]; int file; int off = -1; struct stat d, dd; struct direct dir; main() { int rdev, rino; stat("/", &d); rdev = d.st_dev; rino = d.st_ino; for (;;) { stat(dot, &d); if (d.st_ino==rino && d.st_dev==rdev) prname(); if ((file = open(dotdot,0)) < 0) { f((printf(stderr,"pwd: cannot open ..\n"); exit(1); } fstat(file, &dd); chdir(dotdot); if(d.st_dev == dd.st_dev) { if(d.st_ino == dd.st_ino) prname(); do if (read(file, (char *)&dir, sizeof(dir)) < sizeof(dir)) { fprintf(stderr,"read error in ..\n"); exit(1); } while (dir.d_ino != d.st_ino); } else do { if(read(file, (char *)&dir, sizeof(dir)) < sizeof(dir)) { fprintf(stderr,"read error in ..\n"); exit(1); } stat(dir.d_name, &dd); } while(dd.st_ino != d.st_ino || dd.st_dev != d.st_dev); close(file); cat(); } } prname() { write(1, "/", 1); if (off<0) off = 0; name[off] = '\n'; write(1, name, off+1); exit(0); } cat() { register i, j; i = -1; while (dir.d_name[++i] != 0); if ((off+i+2) > BUFSIZ-1) prname(); for(j=off+1; j>=0; --j) name[j+i+1] = name[j]; off=i+off+1; name[i] = '/'; for(--i; i>=0; --i) name[i] = dir.d_name[i]; } f(stderr,"read error in ..\n"); exit(1); } stat(dir.d_name, &dd); } while(dcmd/quot.c 444 0 33 7276 2416240141 5736 static char *sccsid = "@(#)quot.c 4.1 (Berkeley) 10/1/80"; /* * Disk usage by user */ char *dargv[] = { "/dev/rrp3", 0 }; #include #include #include #include #include #include #include #define ITABSZ 256 #define ISIZ (BSIZE/sizeof(struct dinode)) #define NUID 1000 struct filsys sblock; struct dinode itab[ITABSZ]; struct du { long blocks; long nfiles; int uid; char *name; } du[NUID]; #define TSIZE 500 int sizes[TSIZE]; long overflow; int nflg; int fflg; int cflg; int fi; unsigned ino; unsigned nfiles; struct passwd *getpwent(); char *malloc(); char *copy(); main(argc, argv) char **argv; { register int n; register struct passwd *lp; register char **p; for(n=0; npw_uid; if (n>NUID) continue; if(du[n].name) continue; du[n].name = copy(lp->pw_name); } if (argc == 1) { for (p = dargv; *p;) { check(*p++); report(); } return(0); } while (--argc) { argv++; if (argv[0][0]=='-') { if (argv[0][1]=='n') nflg++; else if (argv[0][1]=='f') fflg++; else if (argv[0][1]=='c') cflg++; } else { check(*argv); report(); } } return(0); } check(file) char *file; { register unsigned i, j; register c; fi = open(file, 0); if (fi < 0) { printf("cannot open %s\n", file); return; } printf("%s:\n", file); sync(); bread(1, (char *)&sblock, sizeof sblock); nfiles = (sblock.s_isize-2)*(BSIZE/sizeof(struct dinode)); ino = 0; if (nflg) { if (isdigit(c = getchar())) ungetc(c, stdin); else while (c!='\n' && c != EOF) c = getchar(); } for(i=2; inodi_mode&IFMT) == 0) return; if (cflg) { if ((ip->di_mode&IFMT)!=IFDIR && (ip->di_mode&IFMT)!=IFREG) return; n = (ip->di_size+BSIZE-1)/BSIZE; if (n >= TSIZE) { overflow += n; n = TSIZE-1; } sizes[n]++; return; } if (ip->di_uid >= NUID) return; du[ip->di_uid].blocks += (ip->di_size+BSIZE-1)/BSIZE; du[ip->di_uid].nfiles++; if (nflg) { tryagain: if (fino==0) if (scanf("%d", &fino)<=0) return; if (fino > ino) return; if (finodi_uid].name) printf("%.7s ", np); else printf("%d ", ip->di_uid); while ((n = getchar())==' ' || n=='\t') ; putchar(n); while (n!=EOF && n!='\n') { n = getchar(); putchar(n); } fino = 0; } } bread(bno, buf, cnt) unsigned bno; char *buf; { lseek(fi, (long)bno*BSIZE, 0); if (read(fi, buf, cnt) != cnt) { printf("read error %u\n", bno); exit(1); } } qcmp(p1, p2) register struct du *p1, *p2; { if (p1->blocks > p2->blocks) return(-1); if (p1->blocks < p2->blocks) return(1); return(strcmp(p1->name, p2->name)); } report() { register i; if (nflg) return; if (cflg) { long t = 0; for (i=0; i #include #include #include #include #include struct ar_hdr archdr; #define OARMAG 0177545 long arsize; struct exec exp; FILE *fi, *fo; long off, oldoff; long atol(), ftell(); #define TABSZ 5000 struct ranlib tab[TABSZ]; int tnum; #define STRTABSZ 75000 char tstrtab[STRTABSZ]; int tssiz; char *strtab; int ssiz; int new; char tempnm[] = "__.SYMDEF"; char firstname[17]; main(argc, argv) char **argv; { char cmdbuf[BUFSIZ]; char magbuf[SARMAG+1]; --argc; while(argc--) { fi = fopen(*++argv,"r"); if (fi == NULL) { fprintf(stderr, "ranlib: cannot open %s\n", *argv); continue; } off = SARMAG; fread(magbuf, 1, SARMAG, fi); if (strncmp(magbuf, ARMAG, SARMAG)) { if (*(int *)magbuf == OARMAG) fprintf(stderr, "old format "); else fprintf(stderr, "not an "); fprintf(stderr, "archive: %s\n", *argv); continue; } fseek(fi, 0L, 0); new = tnum = 0; if (nextel(fi) == 0) { fclose(fi); continue; } do { long o; register n; struct nlist sym; fread((char *)&exp, 1, sizeof(struct exec), fi); if (N_BADMAG(exp)) continue; if (exp.a_syms == 0) { fprintf(stderr, "ranlib: warning: %s(%s): no symbol table\n", *argv, archdr.ar_name); continue; } o = N_STROFF(exp) - sizeof (struct exec); if (ftell(fi)+o+sizeof(ssiz) >= off) { fprintf(stderr, "ranlib: %s(%s): old format .o file\n", *argv, archdr.ar_name); exit(1); } fseek(fi, o, 1); fread((char *)&ssiz, 1, sizeof (ssiz), fi); strtab = (char *)calloc(1, ssiz); if (strtab == 0) { fprintf(stderr, "ranlib: ran out of memory\n"); exit(1); } fread(strtab+sizeof(ssiz), ssiz - sizeof(ssiz), 1, fi); fseek(fi, -(exp.a_syms+ssiz), 1); n = exp.a_syms / sizeof(struct nlist); while (--n >= 0) { fread((char *)&sym, 1, sizeof(sym), fi); if (sym.n_un.n_strx == 0) continue; sym.n_un.n_name = strtab + sym.n_un.n_strx; if ((sym.n_type&N_EXT)==0) continue; switch (sym.n_type&N_TYPE) { case N_UNDF: if (sym.n_value!=0) stash(&sym); continue; default: stash(&sym); continue; } } } while(nextel(fi)); new = fixsize(); fclose(fi); fo = fopen(tempnm, "w"); if(fo == NULL) { fprintf(stderr, "can't create temporary\n"); exit(1); } tnum *= sizeof (struct ranlib); fwrite(&tnum, 1, sizeof (tnum), fo); tnum /= sizeof (struct ranlib); fwrite((char *)tab, tnum, sizeof(struct ranlib), fo); fwrite(&tssiz, 1, sizeof (tssiz), fo); fwrite(tstrtab, tssiz, 1, fo); fclose(fo); if(new) sprintf(cmdbuf, "ar rlb %s %s %s\n", firstname, *argv, tempnm); else sprintf(cmdbuf, "ar rl %s %s\n", *argv, tempnm); if(system(cmdbuf)) fprintf(stderr, "ranlib: ``%s'' failed\n", cmdbuf); else fixdate(*argv); unlink(tempnm); } exit(0); } nextel(af) FILE *af; { register r; register char *cp; oldoff = off; fseek(af, off, 0); r = fread((char *)&archdr, 1, sizeof(struct ar_hdr), af); if (r != sizeof(struct ar_hdr)) return(0); for (cp=archdr.ar_name; cp < & archdr.ar_name[sizeof(archdr.ar_name)]; cp++) if (*cp == ' ') *cp = '\0'; arsize = atol(archdr.ar_size); if (arsize & 1) arsize++; off = ftell(af) + arsize; return(1); } stash(s) struct nlist *s; { int i; register char *cp; if(tnum >= TABSZ) { fprintf(stderr, "ranlib: symbol table overflow\n"); exit(1); } tab[tnum].ran_un.ran_strx = tssiz; tab[tnum].ran_off = oldoff; for (cp = s->n_un.n_name; tstrtab[tssiz++] = *cp++;) if (tssiz > STRTABSZ) { fprintf(stderr, "ranlib: string table overflow\n"); exit(1); } tnum++; } fixsize() { int i; off_t offdelta; if (tssiz&1) tssiz++; offdelta = sizeof(archdr) + sizeof (tnum) + tnum * sizeof(struct ranlib) + sizeof (tssiz) + tssiz; off = SARMAG; nextel(fi); if(strncmp(archdr.ar_name, tempnm, sizeof (archdr.ar_name)) == 0) { new = 0; offdelta -= sizeof(((archdr) + arsize; } else { new = 1; strncpy(firstname, archdr.ar_name, sizeof(archdr.ar_name)); } for(i=0; i #include #include #include #include #include struct proc *proc; struct nlist nl[] = { {"_proc"}, { "_nproc" }, {0}, }; /* * Change the running priority (nice) of a process which is already * running. * * Author: Kurt Shoens */ main(argc, argv) char **argv; { register struct proc *pp, *pend; int pid, nice, nproc; int addr, mem, a1, a2, coreaddr; if (argc != 2 && argc != 3) { fprintf(stderr, "usage: renice pid [ priority ]\n"); exit(1); } if (geteuid()) { fprintf(stderr, "NOT super user\n"); exit(1); } pid = atoi(argv[1]); nice = atoi(argc == 3 ? argv[2] : "19"); if (nice > 20) nice = 20; if (nice < -20) nice = -20; nice += NZERO; mem = open("/dev/kmem", 2); if (mem < 0) { perror("/dev/kmem"); exit(1); } nlist("/vmunix", nl); if ((addr = nl[1].n_value) == 0) { fprintf(stderr, "/vmunix: _nproc not in namelist"); exit(1); } lseek(mem, addr, 0); read(mem, &nproc, sizeof nproc); proc = (struct proc *) calloc(nproc, sizeof *proc); addr = nl[0].n_value; if (addr == 0) { fprintf(stderr, "/vmunix: _proc not in namelist"); exit(1); } lseek(mem, addr, 0); read(mem, &addr, sizeof addr); lseek(mem, addr, 0); read(mem, proc, nproc * (sizeof *proc)); pend = proc+nproc; for (pp = proc; pp < pend; pp++) if (pp->p_pid == pid) break; if (pp >= pend) { fprintf(stderr, "%d: process not found\n", pid); exit(1); } fprintf(stderr, "%d: old nice = %d, new nice = %d\n", pid, pp->p_nice - NZERO, nice - NZERO); a1 = (int)&pp->p_nice; a2 = (int)proc; coreaddr = a1-a2+addr; lseek(mem, (long)coreaddr, 0); write(mem, &nice, sizeof pp->p_nice); } 0); read(mem, &addr, sizeof addr); lseek(mem, addr, 0); read(mem, proc, nproc * (sizeof *proc)); pend = proc+nproc; for (pp = proc; pp < pend; pp++) if (pp->p_pid == pid) break; if (pp >= pend) { fprintf(stderr, "%d: process not found\n", pid); exit(1); } fpcmd/reset.c 444 0 33 2150 2443102622 6053 static char *sccsid = "@(#)reset.c 4.3 (Berkeley) 12/3/80"; /* * reset - restore tty to sensible state after crapping out in raw mode. */ #include #define CTRL(x) ('x'&037) main() { struct sgttyb buf; struct tchars tbuf; struct ltchars ltbuf; gtty(2, &buf); ioctl(2, TIOCGETC, &tbuf); ioctl(2, TIOCGLTC, <buf); buf.sg_flags &= ~(RAW|CBREAK|VTDELAY|ALLDELAY); buf.sg_flags |= XTABS|ECHO|CRMOD|ANYP; reset(&buf.sg_erase, CTRL(h)); reset(&buf.sg_kill, '@'); reset(&tbuf.t_intrc, 0177); reset(&tbuf.t_quitc, CTRL(\\\\)); reset(&tbuf.t_startc, CTRL(q)); reset(&tbuf.t_stopc, CTRL(s)); reset(&tbuf.t_eofc, CTRL(d)); reset(<buf.t_suspc, CTRL(z)); reset(<buf.t_dsuspc, CTRL(y)); reset(<buf.t_rprntc, CTRL(r)); reset(<buf.t_flushc, CTRL(o)); reset(<buf.t_lnextc, CTRL(v)); reset(<buf.t_werasc, CTRL(w)); /* brkc is left alone */ ioctl(2, TIOCSETN, &buf); ioctl(2, TIOCSETC, &tbuf); ioctl(2, TIOCSLTC, <buf); execlp("tset", "tset", "-Q", "-I", 0); /* fix term dependent stuff */ exit(1); } reset(cp, def) char *cp; int def; { if (*cp == 0 || (*cp&0377)==0377) *cp = def; } t(&tbuf.t_eofc, CTRL(d)); reset(<buf.t_suspc, CTRL(z)); reset(<buf.t_dsuspc, CTRL(y)); reset(<buf.t_rprntc, CTRL(r)); reset(<buf.t_flushc, CTRL(o)); reset(<buf.t_lnextc, CTRL(v)); reset(<buf.t_werasc, CTRL(w)); /* brkc is left alone */ ioctl(2, TIOCSETN, &buf); ioctl(2, TIOCSETC, &tbuf); ioctl(2, TIOCSLTC, <buf); execlp("tset", "tset", "-Q", "-I", 0); /* fix term dependent stuff *cmd/yes.c 444 0 33 215 2420504017 5510 static char *sccsid ="@(#)yes.c 4.1 (Berkeley) 10/8/80"; main(argc, argv) char **argv; { for (;;) printf("%s\n", argc>1? argv[1]: "y"); } uf.t_suspc, CTRL(z)); reset(<buf.t_dsuspc, CTRL(y)); reset(<buf.t_rprntc, CTRL(r)); reset(<buf.t_flushc, CTRL(o)); reset(<buf.t_lnextc, CTRL(v)); reset(<buf.t_werasc, CTRL(w)); /* brkc is left alone */ ioctl(2, TIOCSETN, &buf); ioctl(2, TIOCSETC, &tbuf); ioctl/( ,( 5< /\@,\D"cmd/rev.c 444 0 33 1242 2416240161 5527 static char *sccsid = "@(#)rev.c 4.1 (Berkeley) 10/1/80"; #include /* reverse lines of a file */ #define N 256 char line[N]; FILE *input; main(argc,argv) char **argv; { register i,c; input = stdin; do { if(argc>1) { if((input=fopen(argv[1],"r"))==NULL) { fprintf(stderr,"rev: cannot open %s\n", argv[1]); exit(1); } } for(;;){ for(i=0;i=0) putc(line[i],stdout); putc('\n',stdout); } eof: fclose(input); argc--; argv++; } while(argc>1); } rgv) char **argv; { register i,c; input = stdin; do { if(argc>1) { if((input=fopen(argv[1],"r"))==NULL) { fprintf(stderr,"rev: cannot open %s\n", argv[1]); exit(1); } } for(;;){ for(i=0;i 1) f = argv[1]; else f = "/dev/mt0"; fd = open(f,0); if (fd < 0) printf("Can't open %s\n",f); else close(fd); } ) { fprintf(stderr,"rev: cannot open %s\n", argv[1]); exit(1); } } for(;;){ for(i=0;i #include #include #include char *sprintf(); main(argc, argv) char *argv[]; { register char *arg; int fflg, iflg, rflg; fflg = 0; if (isatty(0) == 0) fflg++; iflg = 0; rflg = 0; 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': rflg++; break; default: printf("rm: unknown option %s\n", *argv); exit(1); } } while(--argc > 0) { if(!strcmp(*++argv, "..")) { fprintf(stderr, "rm: cannot remove `..'\n"); continue; } rm(*argv, fflg, rflg, iflg, 0); } exit(errcode); } rm(arg, fflg, rflg, iflg, level) char arg[]; { struct stat buf; struct direct direct; char name[100]; int d; if(stat(arg, &buf)) { if (fflg==0) { printf("rm: %s nonexistent\n", arg); ++errcode; } return; } if ((buf.st_mode&S_IFMT) == S_IFDIR) { if(rflg) { if (access(arg, 02) < 0) { if (fflg==0) printf("%s not changed\n", arg); errcode++; return; } if(iflg && level!=0) { printf("remove directory %s? ", arg); if(!yes()) return; } if((d=open(arg, 0)) < 0) { printf("rm: cannot read %s?\n", arg); exit(1); } while(read(d, (char *)&direct, sizeof(direct)) == sizeof(direct)) { if(direct.d_ino != 0 && !dotname(direct.d_name)) { sprintf(name, "%s/%.14s", arg, direct.d_name); rm(name, fflg, rflg, iflg, level+1); } } close(d); errcode += rmdir(arg, iflg); return; } printf("rm: %s directory\n", arg); ++errcode; return; } if(iflg) { printf("rm: remove %s? ", arg); if(!yes()) return; } else if(!fflg) { if (access(arg, 02)<0) { printf("rm: override protection %o for %s? ", buf.st_mode&0777, arg); if(!yes()) return; } } if(unlink(arg) && (fflg==0 || iflg)) { printf("rm: %s not removed\n", arg); ++errcode; } } dotname(s) char *s; { if(s[0] == '.') if(s[1] == '.') if(s[2] == '\0') return(1); else return(0); else if(s[1] == '\0') return(1); return(0); } rmdir(f, iflg) char *f; { int status, i; if(dotname(f)) return(0); if(iflg) { printf("rm: remove %s? ", f); if(!yes()) return(0); } while((i=fork()) == -1) sleep(3); if(i) { wait(&status); return(status); } execl("/bin/rmdir", "rmdir", f, 0); execl("/usr/bin/rmdir", "rmdir", f, 0); printf("rm: can't find rmdir\n"); exit(1); } yes() { int i, b; i = b = getchar(); while(b != '\n' && b != EOF) b = getchar(); return(i == 'y'); } e if(s[1] == '\0') return(1); return(0); } rmdir(f, iflg) char *f; { int status, i; if(dotname(f)) return(0); if(iflg) { printf("rm: remove %s? ", f); if(!yes()) return(0); } while((i=fork()) == -1) sleep(3); if(i) { wait(&status); return(status); } execl(cmd/rmail.c 444 0 33 4620 2416240167 6050 static char *sccsid = "@(#)rmail.c 4.1 (Berkeley) 10/1/80"; /* * rmail: front end for mail to stack up those stupid >From ... remote from ... * lines and make a correct return address. This works with the -f option * to /etc/delivermail so it won't work on systems without delivermail. * However, it ought to be easy to modify a standard /bin/mail to do the * same thing. * * NOTE: Rmail is SPECIFICALLY INTENDED for ERNIE COVAX because of its * physical position as a gateway between the uucp net and the arpanet. * By default, other sites will probably want /bin/rmail to be a link * to /bin/mail, as it was intended by BTL. However, other than the * (somewhat annoying) loss of information about when the mail was * originally sent, rmail should work OK on other systems running uucp. * If you don't run uucp you don't even need any rmail. */ #include FILE *popen(); char *index(); #define MAILER "/etc/delivermail" main(argc, argv) char **argv; { FILE *out; /* output to delivermail */ char lbuf[512]; /* one line of the message */ char from[512]; /* accumulated path of sender */ char ufrom[64]; /* user on remote system */ char sys[64]; /* a system in path */ char junk[512]; /* scratchpad */ char cmd[512]; char *to, *cp; to = argv[1]; if (argc != 2) { fprintf(stderr, "Usage: rmail user\n"); exit(1); } for (;;) { fgets(lbuf, sizeof lbuf, stdin); if (strncmp(lbuf, "From ", 5) && strncmp(lbuf, ">From ", 6)) break; /* sscanf(lbuf, "%s %s %s %s %s %s %s remote from %s", junk, ufrom, junk, junk, junk, junk, junk, sys); */ sscanf(lbuf, "%s %s", junk, ufrom); cp = lbuf; for (;;) { cp = index(cp+1, 'r'); if (cp == NULL) cp = "remote from somewhere"; #ifdef DEBUG printf("cp='%s'\n", cp); #endif if (strncmp(cp, "remote from ", 12)==0) break; } sscanf(cp, "remote from %s", sys); strcat(from, sys); strcat(from, "!"); #ifdef DEBUG printf("ufrom='%s', sys='%s', from now '%s'\n", ufrom, sys, from); #endif } strcat(from, ufrom); sprintf(cmd, "%s -r%s %s", MAILER, from, to); #ifdef DEBUG printf("cmd='%s'\n", cmd); #endif out = popen(cmd, "w"); fputs(lbuf, out); while (fgets(lbuf, sizeof lbuf, stdin)) fputs(lbuf, out); pclose(out); } /* * Return the ptr in sp at which the character c appears; * NULL if not found */ char * index(sp, c) register char *sp, c; { do { if (*sp == c) return(sp); } while (*sp++); return(NULL); } "ufrom='%s', sys='%s', from now '%s'\n", ufrom, sys, from); #endif } strcat(from, ufrom); sprintf(cmd, "%s -cmd/rmdir.c 444 0 33 4334 2433444650 6065 static char *sccsid = "@(#)rmdir.c 4.2 (Berkeley) 11/10/80"; /* * Remove directory */ #include #include #include #include int Errors = 0; char *rindex(); char *strcat(); char *strcpy(); main(argc,argv) int argc; char **argv; { if(argc < 2) { fprintf(stderr, "rmdir: arg count\n"); exit(1); } while(--argc) rmdir(*++argv); exit(Errors!=0); } rmdir(d) char *d; { int fd; char *np, name[500]; struct stat st, cst; struct direct dir; strcpy(name, d); /* eat trailing slashes */ np = &(name[strlen(name)-1]); while (*np == '/' && np != name) { *np = '\0'; np--; } /* point after last slash */ if((np = rindex(name, '/')) == NULL) np = name; else np++; if(!strcmp(np, ".") || !strcmp(np, "..")) { fprintf(stderr, "rmdir: cannot remove . or ..\n"); ++Errors; return; } if(stat(name,&st) < 0) { fprintf(stderr, "rmdir: %s non-existent\n", name); ++Errors; return; } if (stat("", &cst) < 0) { fprintf(stderr, "rmdir: cannot stat \"\""); ++Errors; exit(1); } if((st.st_mode & S_IFMT) != S_IFDIR) { fprintf(stderr, "rmdir: %s not a directory\n", name); ++Errors; return; } if(st.st_ino==cst.st_ino &&st.st_dev==cst.st_dev) { fprintf(stderr, "rmdir: cannot remove current directory\n"); ++Errors; return; } if((fd = open(name,0)) < 0) { fprintf(stderr, "rmdir: %s unreadable\n", name); ++Errors; return; } while(read(fd, (char *)&dir, sizeof dir) == sizeof dir) { if(dir.d_ino == 0) continue; if(!strcmp(dir.d_name, ".") || !strcmp(dir.d_name, "..")) continue; fprintf(stderr, "rmdir: %s not empty\n", name); ++Errors; close(fd); return; } close(fd); strcat(name, "/."); if((access(name, 0)) < 0) { /* name/. non-existent */ strcat(name, "."); goto unl; } strcat(name, "."); if((access(name, 0)) < 0) /* name/.. non-existent */ goto unl2; if(access(name, 02)) { name[strlen(name)-3] = '\0'; fprintf(stderr, "rmdir: %s: no permission\n", name); ++Errors; return; } unl: unlink(name); /* unlink name/.. */ unl2: name[strlen(name)-1] = '\0'; unlink(name); /* unlink name/. */ name[strlen(name)-2] = '\0'; if (unlink(name) < 0) { fprintf(stderr, "rmdir: %s not removed\n", name); ++Errors; } } non-existent */ strcat(name, "."); goto unl; } strcat(name, "."); if((access(name, 0)) < 0) /* name/.. non-existent */ goto unl2; if(access(name, 02)) { name[strlen(name)-3] = '\0'; fprintf(stderr, "rmdir: %s: no permission\n", name); ++Errors; return; } unl: unlink(namecmd/sa.c 444 0 33 52362 2477644011 5400 static char *sccsid = "@(#)sa.c 4.2 (Berkeley) 81/02/28"; /* * Extensive modifications to internal data structures * to allow arbitrary number of different commands and users added. * * Also allowed the digit option on the -v flag (interactive * threshold compress) to be a digit string, so one can * set the threshold > 9. * * Also added the -f flag, to force no interactive threshold * compression with the -v flag. * * Robert Henry * UC Berkeley * 31jan81 */ #include #include #include #include #include #include /* interpret command time accounting */ #define NC sizeof(acctbuf.ac_comm) struct acct acctbuf; int lflg; int cflg; int Dflg; int dflg; int iflg; int jflg; int Kflg; int kflg; int nflg; int aflg; int rflg; int oflg; int tflg; int vflg; int fflg; int uflg; int thres; int sflg; int bflg; int mflg; struct utmp utmp; #define NAMELG (sizeof(utmp.ut_name)+1) struct Olduser{ int Us_cnt; double Us_ctime; double Us_io; dou((ble Us_imem; }; struct user { char name[NC]; /* this is <\001><\000> */ struct Olduser oldu; char us_name[NAMELG]; }; #define us_cnt oldu.Us_cnt #define us_ctime oldu.Us_ctime #define us_io oldu.Us_io #define us_imem oldu.Us_imem /* * We protect ourselves from preposterous user id's by looking * through the passwd file for the highest uid allocated, and * then adding 10 to that. * This prevents the user structure from growing too large. */ #define USERSLOP 10 int maxuser; /* highest uid from /etc/passwd, + 10 for slop*/ struct process { char name[NC]; int count; double realt; double cput; double syst; double imem; double io; }; union Tab{ struct process p; struct user u; }; typedef union Tab cell; int (*cmp)(); /* compares 2 cells; set to appropriate func */ cell *enter(); struct user *finduser(); struct user *wasuser(); /* * Table elements are keyed by the name of the file exec'ed. * Because on large systems, many files can be exec'ed, * a static table size may grow to be too large. * * Table elements are allocated in chunks dynamically, linked * together so that they may be retrieved sequentially. * * An index into the table structure is provided by hashing through * a seperate hash table. * The hash table is segmented, and dynamically extendable. * Realize that the hash table and accounting information is kept * in different segments! * * We have a linked list of hash table segments; within each * segment we use a quadratic rehash that touches no more than 1/2 * of the buckets in the hash table when probing. * If the probe does not find the desired symbol, it moves to the * next segment, or allocates a new segment. * * Hash table segments are kept on the linked list with the first * segment always first (that will probably contain the * most frequently executed commands) and * the last added segment immediately after the first segment, * to hopefully gain something by locality of reference. * * We store the per user information in the same structure as * the per exec'ed file information. This allows us to use the * same managers for both, as the number of user id's may be very * large. * User information is keyed by the first character in the name * being a '\001', followed by four bytes of (long extended) * user id number, followed by a null byte. * The actual user names are kept in a seperate field of the * user structure, and is filled in upon demand later. * Iteration through all users by low user id to high user id * is done by just probing the table, which is gross. */ #define USERKEY '\001' #define ISPROCESS(tp) (tp->p.name[0] && (tp->p.name[0] != USERKEY)) #define ISUSER(tp) (tp->p.name[0] && (tp->p.name[0] == USERKEY)) #define TABDALLOP 500 struct allocbox{ struct allocbox *nextalloc; cell tabslots[TABDALLOP]; }; struct allocbox *allochead; /*head of chunk list*/ struct allocbox *alloctail; /*tail*/ struct allocbox *newbox; /*for creating a new chunk*/ cell *nexttab; /*next table element that is free*/ int tabsleft; /*slots left in current chunk*/ int ntabs; /* * Iterate through all symbols in the symbol table in declaration * order. * struct allocbox *allocwalk; * cell *sp, *ub; * * sp points to the desired item, allocwalk and ub are there * to make the iteration go. */ #define DECLITERATE(allocwalk, walkpointer, ubpointer) \ for(allocwalk = allochead; \ allocwalk != 0; \ allocwalk = allocwalk->nextalloc) \ for (walkpointer = &allocwalk->tabslots[0],\ ubpointer = &allocwalk->tabslots[TABDALLOP], \ ubpointer = ubpointer > ( (cell *)alloctail) \ ? nexttab : ubpointer ;\ walkpointer < ubpointer; \ walkpointer++ ) #define TABCHUNKS(allocwalk, tabptr, size) \ for (allocwalk = allochead; \ allocwalk != 0; \ allocwalk = allocwalk->nextalloc) \ if ( \ (tabptr = &allocwalk->tabslots[0]), \ (size = \ ( (&allocwalk->tabslots[TABDALLOP]) \ > ((cell *)alloctail) \ ) \ ? (nexttab - tabptr) : TABDALLOP \ ), \ 1 \ ) #define PROCESSITERATE(allocwalk, walkpointer, ubpointer) \ DECLITERATE(allocwalk, walkpointer, ubpointer) \ if (ISPROCESS(walkpointer)) #define USERITERATE(allocwalk, walkpointer, ubpointer) \ DECLITERATE(allocwalk, walkpointer, ubpointer) \ if (ISUSER(walkpointer)) /* * When we have to sort the segmented accounting table, we * create a vector of sorted queues that is merged * to sort the entire accounting table. */ struct chunkdesc { cell *chunk_tp; int chunk_n; }; /* * Hash table segments and manager */ #define NHASH 1103 struct hashdallop { int h_nused; struct hashdallop *h_next; cell *h_tab[NHASH]; }; struct hashdallop *htab; /* head of the list */ int htabinstall; /* install the symbol */ double treal; double tcpu; double tsys; double tio; double timem; cell *junkp; char *sname; double ncom; time_t expand(); char *getname(); /* * usracct saves records of type Olduser. * There is one record for every possible uid less than * the largest uid seen in the previous usracct or in savacct. * uid's that had no activity correspond to zero filled slots; * thus one can index the file and get the user record out. * It would be better to save only user information for users * that the system knows about to save space, but that is not * upward compatabile with the old system. * * In the old version of sa, uid's greater than 999 were not handled * properly; this system will do that. */ #ifdef DEBUG #define USRACCT "./usracct" #define SAVACCT "./savacct" #define ACCT "./acct" #else #define USRACCT "/usr/adm/usracct" #define SAVACCT "/usr/adm/savacct" #define ACCT "/usr/adm/acct" #endif DEBUG int cellcmp(); cell *junkp = 0; /* * The threshold is built up from digits in the argv ; * eg, -v1s0u1 * will build a value of thres of 101. * * If the threshold is zero after processing argv, it is set to 1 */ int thres = 0; int htabinstall = 1; int maxuser = -1; int (*cmp)(); main(argc, argv) char **argv; { FILE *ff; int i, j; extern tcmp(), ncmp(), bcmp(), dcmp(), Dcmp(), kcmp(), Kcmp(); extern double sum(); double ft; register struct allocbox *allocwalk; register cell *tp, *ub; int size; int nchunks; struct chunkdesc *chunkvector; int smallest; maxuser = USERSLOP + getmaxuid(); tabinit(); cmp = tcmp; if (argc>1) if (argv[1][0]=='-') { argv++; argc--; for(i=1; argv[0][i]; i++) switch(argv[0][i]) { case 'o': oflg++; break; case 'i': iflg++; break; case 'b': bflg++; cmp = bcmp; break; case 'l': lflg++; break; case 'c': cflg++; break; case 'd': dflg++; cmp = dcmp; break; case 'D': Dflg++; cmp = Dcmp; break; case 'j': jflg++; break; case 'k': kflg++; cmp = kcmp; break; case 'K': Kflg++; cmp = Kcmp; break; case 'n': nflg++; cmp = ncmp; break; case 'a': aflg++; break; case 'r': rflg++; break; case 't': tflg++; break; case 's': sflg++; aflg++; break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': thres = thres * 10 + (argv[0][i]-'0'); break; case 'v': vflg++; break; case 'f': fflg++; /* force v option; no tty interaction */ break; case 'u': uflg++; break; case 'm': mflg++; break; } } if (thres == 0) thres = 1; if (iflg==0) init(); if (argc<2) doacct(ACCT); else while (--argc) doacct(*++argv); if (uflg) { return; } /* * cleanup pass * put junk together */ if (vflg) strip(); if(!aflg) PROCESSITERATE(allocwalk, tp, ub){ for(j=0; jp.name[j] == '?') goto yes; if(tp->p.count != 1) continue; yes: if(junkp == 0) junkp = enter("***other"); junkp->p.count += tp->p.count; junkp->p.realt += tp->p.realt; junkp->p.cput += tp->p.cput; junkp->p.syst += tp->p.syst; junkp->p.imem += tp->p.imem; junkp->p.io += tp->p.io; tp->p.name[0] = 0; } if (sflg) { signal(SIGINT, SIG_IGN); if ((ff = fopen(USRACCT, "w")) != NULL) { static struct user ZeroUser = {0}; struct user *up; int uid; /* * Write out just enough user slots, * filling with zero slots for users that * weren't found. * The file can be indexed directly by uid * to get the correct record. */ for (uid = 0; uid < maxuser; uid++){ if ( (up = wasuser(uid)) != 0) fwrite((char *)&(up->oldu), sizeof(struct Olduser),1,ff); else fwrite((char *)&(ZeroUser.oldu), sizeof(struct Olduser),1,ff); } } if ((ff = fopen(SAVACCT, "w")) == NULL) { printf("Can't save\n"); exit(0); } PROCESSITERATE(allocwalk, tp, ub) fwrite((char *)&(tp->p), sizeof(struct process), 1, ff); fclose(ff); creat(sname, 0644); signal(SIGINT, SIG_DFL); } /* * sort and print */ if (mflg) { printmoney(); exit(0); } column(ncom, treal, tcpu, tsys, timem, tio); printf("\n"); /* * the fragmented table is sorted by sorting each fragment * and then merging. */ nchunks = 0; TABCHUNKS(allocwalk, tp, size){ qsort(tp, size, sizeof(cell), cellcmp); nchunks ++; } chunkvector = (struct chunkdesc *)calloc(nchunks, sizeof(struct chunkdesc)); nchunks = 0; TABCHUNKS(allocwalk, tp, size){ chunkvector[nchunks].chunk_tp = tp; chunkvector[nchunks].chunk_n = size; nchunks++; } for(; nchunks; ){ /* * Find the smallest element at the head of the queues. */ smallest = 0; for (i = 1; i < nchunks; i++){ if (cellcmp(chunkvector[i].chunk_tp, chunkvector[smallest].chunk_tp) < 0) smallest = i; } tp = chunkvector[smallest].chunk_tp++; /* * If this queue is drained, drop the chunk count, * and readjust the queues. */ if (--chunkvector[smallest].chunk_n == 0){ nchunks--; for (i = smallest; i < nchunks; i++) chunkvector[i] = chunkvector[i+1]; } if (ISPROCESS(tp)){ ft = tp->p.count; column(ft, tp->p.realt, tp->p.cput, tp->p.syst, tp->p.imem, tp->p.io); printf(" %.14s\n", tp->p.name); } } /* iterate to merge the lists */ } printmoney() { register i; register char *cp; register struc((t user *up; getnames(); /* fetches all of the names! */ for (i = 0; i < maxuser; i++) { if ( (up = wasuser(i)) != 0){ if (up->us_cnt) { if (up->us_name[0]) printf("%-8s", up->us_name); else printf("%-8d", i); printf("%7u %9.2fcpu %10.0ftio %12.0fk*sec\n", up->us_cnt, up->us_ctime/60, up->us_io, up->us_imem / (60 * 2)); } } } } column(n, a, b, c, d, e) double n, a, b, c, d, e; { printf("%8.0f", n); if(cflg) { if(n == ncom) printf("%9s", ""); else printf("%8.2f%%", 100.*n/ncom); } col(n, a, treal, "re"); if (oflg) col(n, 3600*(b/(b+c)), tcpu+tsys, "u/s"); else if(lflg) { col(n, b, tcpu, "u"); col(n, c, tsys, "s"); } else col(n, b+c, tcpu+tsys, "cp"); if(tflg) printf("%8.1f", a/(b+c), "re/cp"); if(dflg || !Dflg) printf("%10.0favio", e/(n?n:1)); else printf("%10.0ftio", e); if (kflg || !Kflg) printf("%10.0fk", d/(2*((b+c)!=0.0?(b+c):1.0))); else printf("%10.0fk*sec", d/(2*60)); } col(n, a, m, cp) double n, a, m; char *cp; { if(jflg) printf("%11.2f%s", a/(n*60.), cp); else printf("%11.2f%s", a/3600., cp); if(cflg) { if(a == m) printf("%9s", ""); else printf("%8.2f%%", 100.*a/m); } } doacct(f) char *f; { FILE *ff; long x, y, z; struct acct fbuf; register char *cp; register int c; register struct user *up; register cell *tp; #ifdef DEBUG int nrecords = 0; #endif DEBUG if (sflg && sname) { printf("Only 1 file with -s\n"); exit(0); } if (sflg) sname = f; if ((ff = fopen(f, "r"))==NULL) { printf("Can't open %s\n", f); return; } while (fread((char *)&fbuf, sizeof(fbuf), 1, ff) == 1) { #ifdef DEBUG if (++nrecords % 1000 == 0) printf("Input record from %s number %d\n", f, nrecords); #endif DEBUG if (fbuf.ac_comm[0]==0) { fbuf.ac_comm[0] = '?'; } for (cp = fbuf.ac_comm; cp < &fbuf.ac_comm[NC]; cp++) { c = *cp & 0377; if (c && (c < ' ' || c >= 0200)) { *cp = '?'; } } if (fbuf.ac_flag&AFORK) { for (cp=fbuf.ac_comm; cp < &fbuf.ac_comm[NC]; cp++) if (*cp==0) { *cp = '*'; break; } } x = expand(fbuf.ac_utime) + expand(fbuf.ac_stime); y = fbuf.ac_mem; z = expand(fbuf.ac_io); if (uflg) { printf("%3d%6.1fcp %6dmem %6dio %.14s\n", fbuf.ac_uid, x/60.0, y, z, fbuf.ac_comm); continue; } up = finduser(fbuf.ac_uid); if (up == 0) continue; /* preposterous user id */ up->us_cnt++; up->us_ctime += x/60.; up->us_imem += x * y; up->us_io += z; ncom += 1.0; tp = enter(fbuf.ac_comm); tp->p.imem += x * y; timem += x * y; tp->p.count++; x = expand(fbuf.ac_etime)*60; tp->p.realt += x; treal += x; x = expand(fbuf.ac_utime); tp->p.cput += x; tcpu += x; x = expand(fbuf.ac_stime); tp->p.syst += x; tsys += x; tp->p.io += z; tio += z; } fclose(ff); } /* * Generalized cell compare routine, to cast out users */ cellcmp(p1, p2) cell *p1, *p2; { if (ISPROCESS(p1)){ if (ISPROCESS(p2)) return(cmp(p1, p2)); return(-1); } if (ISPROCESS(p2)) return(1); return(0); } ncmp(p1, p2) cell *p1, *p2; { if(p1->p.count == p2->p.count) return(tcmp(p1, p2)); if(rflg) return(p1->p.count - p2->p.count); return(p2->p.count - p1->p.count); } bcmp(p1, p2) cell *p1, *p2; { double f1, f2; double sum(); f1 = sum(p1)/p1->p.count; f2 = sum(p2)/p2->p.count; if(f1 < f2) { if(rflg) return(-1); return(1); } if(f1 > f2) { if(rflg) return(1); return(-1); } return(0); } Kcmp(p1, p2) cell *p1, *p2; { if (p1->p.imem < p2->p.imem) { if(rflg) return(-1); return(1); } if (p1->p.imem > p2->p.imem) { if(rflg) return(1); return(-1); } return(0); } kcmp(p1, p2) cell *p1, *p2; { double a1, a2; a1 = p1->p.imem / ((p1->p.cput+p1->p.syst)?(p1->p.cput+p1->p.syst):1); a2 = p2->p.imem / ((p2->p.cput+p2->p.syst)?(p2->p.cput+p2->p.syst):1); if (a1 < a2) { if(rflg) return(-1); return(1); } if (a1 > a2) { if(rflg) return(1); return(-1); } return(0); } dcmp(p1, p2) cell *p1, *p2; { double a1, a2; a1 = p1->p.io / (p1->p.count?p1->p.count:1); a2 = p2->p.io / (p2->p.count?p2->p.count:1); if (a1 < a2) { if(rflg) return(-1); return(1); } if (a1 > a2) { if(rflg) return(1); return(-1); } return(0); } Dcmp(p1, p2) cell *p1, *p2; { if (p1->p.io < p2->p.io) { if(rflg) return(-1); return(1); } if (p1->p.io > p2->p.io) { if(rflg) return(1); return(-1); } return(0); } tcmp(p1, p2) cell *p1, *p2; { extern double sum(); double f1, f2; f1 = sum(p1); f2 = sum(p2); if(f1 < f2) { if(rflg) return(-1); return(1); } if(f1 > f2) { if(rflg) return(1); return(-1); } return(0); } double sum(p) cell *p; { if(p->p.name[0] == 0) return(0.0); return( p->p.cput + p->p.syst); } init() { struct user userbuf; struct process tbuf; register cell *tp; register struct user *up; int uid; FILE *f; if ((f = fopen(SAVACCT, "r")) == NULL) goto gshm; while (fread((char *)&tbuf, sizeof(struct process), 1, f) == 1) { tp = enter(tbuf.name); ncom += tbuf.count; tp->p.count = tbuf.count; treal += tbuf.realt; tp->p.realt = tbuf.realt; tcpu += tbuf.cput; tp->p.cput = tbuf.cput; tsys += tbuf.syst; tp->p.syst = tbuf.syst; tio += tbuf.io; tp->p.io = tbuf.io; timem += tbuf.imem; tp->p.imem = tbuf.imem; } fclose(f); gshm: if ((f = fopen(USRACCT, "r")) == NULL) return; for(uid = 0; fread((char *)&(userbuf.oldu), sizeof(struct Olduser), 1, f) == 1; uid++){ if (userbuf.us_cnt){ up = finduser(uid); if (up == 0) continue; /* preposterous user id */ up->oldu = userbuf.oldu; } } fclose(f); } strip() { int c; register struct allocbox *allocwalk; register cell *tp, *ub, *junkp; if (fflg) printf("Categorizing commands used %d times or fewer as **junk**\n", thres); junkp = enter("**junk**"); PROCESSITERATE(allocwalk, tp, ub){ if (tp->p.name[0] && tp->p.count <= thres) { if (!fflg) printf("%.14s--", tp->p.name); if (fflg || ((c=getchar())=='y')) { tp->p.name[0] = '\0'; junkp->p.count += tp->p.count; junkp->p.realt += tp->p.realt; junkp->p.cput += tp->p.cput; junkp->p.syst += tp->p.syst; junkp->p.imem += tp->p.imem; junkp->p.io += tp->p.io; } if (!fflg) while (c && c!='\n') c = getchar(); } } } time_t expand(t) unsigned t; { register time_t nt; nt = t&017777; t >>= 13; while (t!=0) { t--; nt <<= 3; } return(nt); } static char UserKey[NAMELG + 2]; char *makekey(uid) int uid; { sprintf(UserKey+1, "%04x", uid); UserKey[0] = USERKEY; return(UserKey); } struct user *wasuser(uid) int uid; { struct user *tp; htabinstall = 0; tp = finduser(uid); htabinstall = 1; return(tp); } /* * Only call this if you really want to insert it in the table! */ struct user *finduser(uid) int uid; { if (uid > maxuser){ fprintf(stderr, "Preposterous user id, %d: ignored\n", uid); return(0); } else { return((struct user*)enter(makekey(uid))); } } /* * Set the names of all users in the password file. * We will later not print those that didn't do anything. */ getnames() { register struct user *tp; register struct passwd *pw; struct passwd *getpwent(); setpwent(); while (pw = getpwent()){ if ( (tp = wasuser(pw->pw_uid)) != 0) strncpy(tp->us_name, pw->pw_name, NAMELG); } endpwent(); } int getmaxuid() { register struct user *tp; register struct passwd *pw; struct passwd *getpwent(); int maxuid = -1; setpwent(); while(pw = getpwent()){ if (pw->pw_uid > maxuid) maxuid = pw->pw_uid; } endpwent(); return(maxuid); } tabinit() { allochead = 0; alloctail = 0; nexttab = 0; tabsleft = 0; htab = 0; ntabs = 0; htaballoc(); /* get the first part of the hash table */ } #define ALLOCQTY sizeof (struct allocbox) cell *taballoc() { if (tabsleft == 0){ newbox = (struct allocbox *)calloc(1, ALLOCQTY); tabsleft = TABDALLOP; nexttab = &newbox->tabslots[0]; if (alloctail == 0){ allochead = alloctail = newbox; } else { alloctail->nextalloc = newbox; alloctail = newbox; } } --tabsleft; ++ntabs; #ifdef DEBUG if (ntabs % 100 == 0) printf("##Accounting table slot # %d\n", ntabs); #endif DEBUG return(nexttab++); } htaballoc() { register struct hashdallop *new; #ifdef DEBUG static int ntables = 0; printf("%%%New hash table chunk allocated, number %d\n", ++ntables); #endif DEBUG new = (struct hashdallop *)calloc(1, sizeof (struct hashdallop)); if (htab == 0) htab = new; else { /* add AFTER the 1st slot */ new->h_next = htab->h_next; htab->h_next = new; } } #define HASHCLOGGED (NHASH / 2) /* * Lookup a symbol passed in as the argument. * * We take pains to avoid function calls; this function * is called quite frequently, and the calling overhead * contributes significantly to the overall execution speed of sa. */ cell *enter(name) char *name; { static int initialprobe; register cell **hp; register char *from; register char *to; register int len; register int nprobes; static struct hashdallop *hdallop; static cell **emptyslot; static struct hashdallop *emptyhd; static cell **hp_ub; emptyslot = 0; for (nprobes = 0, from = name, len = 0; *from && len < NC; nprobes <<= 2, nprobes += *from++, len++) continue; nprobes += from[-1] << 5; nprobes %= NHASH; if (nprobes < 0) nprobes += NHASH; initialprobe = nprobes; for (hdallop = htab; hdallop != 0; hdallop = hdallop->h_next){ for (hp = &(hdallop->h_tab[initialprobe]), nprobes = 1, hp_ub = &(hdallop->h_tab[NHASH]); (*hp) && (nprobes < NHASH); hp += nprobes, hp -= (hp >= hp_ub) ? NHASH:0, nprobes += 2) { from = name; to = (*hp)->p.name; for (len = 0; (len= NC) /*both are maximal length*/ return(*hp); if (*to == 0) /*assert *from == 0*/ return(*hp); nextprobe: ; } if (*hp == 0 && emptyslot == 0 && hdallop->h_nused < HASHCLOGGED) { emptyslot = hp; emptyhd = hdallop; } } if (emptyslot == 0) { htaballoc(); hdallop = htab->h_next; /* aren't we smart! */ hp = &hdallop->h_tab[initialprobe]; } else { hdallop = emptyhd; (( hp = emptyslot; } if (htabinstall){ *hp = taballoc(); hdallop->h_nused++; for(len = 0, from = name, to = (*hp)->p.name; (lenh_nused < HASHCLOGGED) { emptyslot = hp; emptyhd = hdallop; } } if (emptyslot == 0) { htaballoc(); hdallop = htab->h_next; /* aren't we smart! */ hp = &hdallop->h_tab[initialprobe]; } else { hdallop = emptyhd; cmd/script.c 444 0 33 14744 2421026655 6300 static char *sccsid = "@(#)script.c 4.1 (Berkeley) 10/1/80"; /* * script - makes copy of terminal conversation. usage: * * script [ -n ] [ -s ] [ -q ] [ -a ] [ -S shell ] [ file ] * conversation saved in file. default is DFNAME */ #define DFNAME "typescript" #ifdef HOUXP #define STDSHELL "/bin/sh" #define NEWSHELL "/p4/3723mrh/bin/csh" char *shell = NEWSHELL; #endif #ifdef HOUXT #define STDSHELL "/bin/sh" #define NEWSHELL "/t1/bruce/ucb/bin/csh" char *shell = NEWSHELL; #endif #ifdef CORY #define STDSHELL "/bin/sh" #define NEWSHELL "/bin/csh" char *shell = NEWSHELL; #endif #ifdef CC #define STDSHELL "/bin/sh" #define NEWSHELL "/bin/csh" char *shell = NEWSHELL; #endif #ifndef STDSHELL # define V7ENV #endif #ifdef V7ENV #include /* used for version 7 with environments - gets your environment shell */ #define STDSHELL "/bin/sh" #define NEWSHELL "/bin/csh" char *shell; /* initialized in the code */ # include # include # define MODE st_mode # define STAT stat char *getenv(); #else /* * The following is the structure of the block returned by * the stat and fstat system calls. */ struct inode { char i_minor; /* +0: minor device of i-node */ char i_major; /* +1: major device */ int i_number; /* +2 */ int i_flags; /* +4: see below */ char i_nlinks; /* +6: number of links to file */ char i_uid; /* +7: user ID of owner */ char i_gid; /* +8: group ID of owner */ char i_size0; /* +9: high byte of 24-bit size */ int i_size1; /* +10: low word of 24-bit size */ int i_addr[8]; /* +12: block numbers or device number */ int i_actime[2]; /* +28: time of last access */ int i_modtime[2]; /* +32: time of last modification */ }; #define IALLOC 0100000 #define IFMT 060000 #define IFDIR 040000 #define IFCHR 020000 #define IFBLK 060000 #define MODE i_flags #define STAT inode #endif char *tty; /* name of users tty so can turn off writes */ char *ttyname(); /* std subroutine */ int mode = 0622; /* old permission bits for users tty */ int outpipe[2]; /* pipe from shell to output */ int fd; /* file descriptor of typescript file */ int inpipe[2]; /* pipe from input to shell */ long tvec; /* current time */ char buffer[256]; /* for block I/O's */ int n; /* number of chars read */ int status; /* dummy for wait sys call */ char *fname; /* name of typescript file */ int forkval, ttn; /* temps for error checking */ int qflg; /* true if -q (quiet) flag */ int aflg; /* true if -q (append) flag */ struct STAT sbuf; int flsh(); main(argc,argv) int argc; char **argv; { if ((tty = ttyname(2)) < 0) { printf("Nested script not allowed.\n"); fail(); } #ifdef V7ENV shell = getenv("SHELL"); #endif while ( argc > 1 && argv[1][0] == '-') { switch(argv[1][1]) { case 'n': shell = NEWSHELL; break; case 's': shell = STDSHELL; break; case 'S': shell = argv[2]; argc--; argv++; break; case 'q': qflg++; break; case 'a': aflg++; break; default: printf("Bad flag %s - ignored\n",argv[1]); } argc--; argv++; } if (argc > 1) { fname = argv[1]; if (!aflg && stat(fname,&sbuf) >= 0) { printf("File %s already exists.\n",fname); done(); } } else fname = DFNAME; if (!aflg) { fd = creat(fname,0); /* so can't cat/lpr typescript from inside */ } else { /* try to append to existing file first */ fd = open(fname,1); if (fd >= 0) lseek(fd,0l,2); else fd = creat(fname,0); } if (fd<0) { printf("Can't create %s\n",fname); if (unlink(fname)==0) { printf("because of previous typescript bomb - try again\n"); } fail(); } chmod(fname,0); /* in case it already exists */ fixtty(); if (!qflg) { printf("Script started, file is %s\n",fname); check(write(fd,"Script started on ",18)); time(&tvec); check(write(fd,ctime(&tvec),25)); } pipe(inpipe); pipe(outpipe); forkval = fork(); if (forkval < 0) goto ffail; if (forkval == 0) { forkval = fork(); if (forkval < 0) goto ffail; if (forkval == 0) dooutput(); forkval = fork(); if (forkval < 0) goto ffail; if (forkval == 0) doinput(); doshell(); } close(inpipe[0]); close(inpipe[1]); close(outpipe[0]); close(outpipe[1]); signal(SIGINT, SIG_IGN); signal(SIGQUIT, done); wait(&status); done(); /*NOTREACHED*/ ffail: printf("Fork failed. Try again.\n"); fail(); } /* input process - copy tty to pipe and file */ doinput() { signal(SIGINT, SIG_IGN); signal(SIGQUIT, SIG_IGN); signal(SIGTSTP, SIG_IGN); close(inpipe[0]); close(outpipe[0]); close(outpipe[1]); /* main input loop - copy until end of file (ctrl D) */ while ((n=read(0,buffer,256)) > 0) { check(write(fd,buffer,n)); write(inpipe[1],buffer,n); } /* end of script - close files and exit */ close(inpipe[1]); close(fd); done(); } /* do output process - copy to tty & file */ dooutput() { signal(SIGINT, flsh); signal(SIGQUIT, SIG_IGN); signal(SIGTSTP, SIG_IGN); close(0); close(inpipe[0]); close(inpipe[1]); close(outpipe[1]); /* main output proc loop */ while (n=read(outpipe[0],buffer,256)) { if (n > 0) { /* -1 means trap to flsh just happened */ write(1,buffer,n); check(write(fd,buffer,n)); } } /* output sees eof - close files and exit */ if (!qflg) { printf("Script done, file is %s\n",fname); check(write(fd,"\nscript done on ",16)); time(&tvec); check(write(fd,ctime(&tvec),25)); } close(fd); exit(0); } /* exec shell, after diverting std input & output */ doshell() { close(0); dup(inpipe[0]); close(1); dup(outpipe[1]); close(2); dup(outpipe[1]); /* close useless files */ close(inpipe[0]); close(inpipe[1]); close(outpipe[0]); close(outpipe[1]); execl(shell, "sh", "-i", 0); execl(STDSHELL, "sh", "-i", 0); execl(NEWSHELL, "sh", "-i", 0); printf("Can't execute shell\n"); fail(); } fixtty() { fstat(2, &sbuf); mode = sbuf.MODE&0777; chmod(tty, 0600); } /* come here on rubout to flush output - this doesn't work */ flsh() { signal(SIGINT, flsh); /* lseek(outpipe[0],0l,2); /* seeks on pipes don't work !"$"$!! */ } fail() { unlink(fname); kill(0, 15); /* shut off other script processes */ done(); } done() { chmod(tty, mode); chmod(fname, 0664); exit(); } #ifndef V7ENV #ifndef CC char *ttyname(i) int i; { char *string; string = "/dev/ttyx"; string[8] = ttyn(fd); if (string[8] == 'x') return((char *) (-1)); else return(string); } #endif #endif check(n) int n; { /* checks the result of a write call, if neg assume ran out of disk space & die */ if (n < 0) { write(1,"Disk quota exceeded - script quits\n",35); kill(0,15); done(); } } * shut off other script proccmd/size.c 444 0 33 1560 2550456013 5714 static char *sccsid = "@(#)size.c 4.3 (Berkeley) 7/2/81"; /* * size */ #include #include int header; main(argc, argv) char **argv; { struct exec buf; long sum; int gorp,i; FILE *f; if (argc==1) { *argv = "a.out"; argc++; --argv; } gorp = argc; while(--argc) { ++argv; if ((f = fopen(*argv, "r"))==NULL) { printf("size: %s not found\n", *argv); continue; } if (fread((char *)&buf, sizeof(buf), 1, f) != 1 || N_BADMAG(buf)) { printf("size: %s not an object file\n", *argv); fclose(f); 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); printf("\n"); fclose(f); } } s not found\n", *argv); continue; } if (fread((char *)&buf, sizeof(buf), 1, f) != 1 || N_BADMAG(buf)) { printf("size: %s not an cmd/sleep.c 444 0 33 475 2416240175 6037 static char *sccsid = "@(#)sleep.c 4.1 (Berkeley) 10/1/80"; main(argc, argv) char **argv; { int c, n; char *s; n = 0; if(argc < 2) { printf("arg count\n"); exit(0); } s = argv[1]; while(c = *s++) { if(c<'0' || c>'9') { printf("bad character\n"); exit(0); } n = n*10 + c - '0'; } sleep(n); } ("\t%s", *argv); printf("\n"); fclose(f); } } s not found\n", *argv); continue; } if (fread((ch C (7/\@,\D"((cmd/soelim.c 444 0 33 3230 2416240177 6231 static char *sccsid = "@(#)soelim.c 4.1 (Berkeley) 10/1/80"; #include /* * soelim - a filter to process n/troff input eliminating .so's * * Author: Bill Joy UCB July 8, 1977 * * This program eliminates .so's from a n/troff input stream. * It can be used to prepare safe input for submission to the * phototypesetter since the software supporting the operator * doesn't let him do chdir. * * This is a kludge and the operator should be given the * ability to do chdir. * * This program is more generally useful, it turns out, because * the program tbl doesn't understand ".so" directives. */ main(argc, argv) int argc; char *argv[]; { argc--; argv++; if (argc == 0) { fprintf(stderr, "Usage: %s file [ file ... ]\n", argv[-1]); exit(1); } do { process(argv[0]); argv++; argc--; } while (argc > 0); exit(0); } process(file) char *file; { register char *cp; register int c; char fname[BUFSIZ]; FILE *soee; soee = fopen(file, "r"); if (soee == NULL) { perror(file); return; } for (;;) { c = getc(soee); if (c < 0) break; if (c != '.') goto simple; c = getc(soee); if (c != 's') { putchar('.'); goto simple; } c = getc(soee); if (c != 'o') { printf(".s"); goto simple; } do c = getc(soee); while (c == ' ' || c == '\t'); cp = fname; for (;;) { switch (c) { case ' ': case '\t': case '\n': case EOF: goto donename; default: *cp++ = c; c = getc(soee); continue; } } donename: if (cp == fname) { printf(".so"); goto simple; } *cp++ = 0; process(fname); continue; simple: if (c == EOF) break; putchar(c); } fclose(soee); } o simple; } c = getc(soee); if (c != 'o') { printf(".s"); goto simple; } do c = getc(soee); while (c == ' ' || c == '\t'); cp = fname; for (;;) { switch (c) { case ' ': case '\t': case '\n': case EOF: goto donename; default: *cp++ = c; c = getc(soee); continue; } } donename: if (cp == fname)cmd/sort.c 444 0 33 37145 2503315632 5760 static char *sccsid = "@(#)sort.c 4.2 (Berkeley) 10/9/80"; #include #include #include #include #include #define L 512 #define N 7 #define C 20 #define MEM (16*2048) #define NF 10 FILE *is, *os; char *dirtry[] = {"/usr/tmp", "/tmp", NULL}; char **dirs; char file1[30]; char *file = file1; char *filep; int nfiles; unsigned nlines; unsigned ntext; int *lspace; char *tspace; int cmp(), cmpa(); int (*compare)() = cmpa; char *eol(); int term(); int mflg; int cflg; int uflg; char *outfil; int unsafeout; /*kludge to assure -m -o works*/ char tabchar; int eargc; char **eargv; char zero[256]; char fold[256] = { 0200,0201,0202,0203,0204,0205,0206,0207, 0210,0211,0212,0213,0214,0215,0216,0217, 0220,0221,0222,0223,0224,0225,0226,0227, 0230,0231,0232,0233,0234,0235,0236,0237, 0240,0241,0242,0243,0244,0245,0246,0247, 0250,0251,0252,0253,0254,0255,0256,0257, 0260,0261,0262,0263,0264,0265,0266,0267, 0270,0271,0272,0273,0274,0275,0276,0277, 0300,0301,0302,0303,0304,0305,0306,0307, 0310,0311,0312,0313,0314,0315,0316,0317, 0320,0321,0322,0323,0324,0325,0326,0327, 0330,0331,0332,0333,0334,0335,0336,0337, 0340,0341,0342,0343,0344,0345,0346,0347, 0350,0351,0352,0353,0354,0355,0356,0357, 0360,0361,0362,0363,0364,0365,0366,0367, 0370,0371,0372,0373,0374,0375,0376,0377, 0000,0001,0002,0003,0004,0005,0006,0007, 0010,0011,0012,0013,0014,0015,0016,0017, 0020,0021,0022,0023,0024,0025,0026,0027, 0030,0031,0032,0033,0034,0035,0036,0037, 0040,0041,0042,0043,0044,0045,0046,0047, 0050,0051,0052,0053,0054,0055,0056,0057, 0060,0061,0062,0063,0064,0065,0066,0067, 0070,0071,0072,0073,0074,0075,0076,0077, 0100,0101,0102,0103,0104,0105,0106,0107, 0110,0111,0112,0113,0114,0115,0116,0117, 0120,0121,0122,0123,0124,0125,0126,0127, 0130,0131,0132,0133,0134,0134,0136,0137, 0140,0101,0102,0103,0104,0105,0106,0107, 0110,0111,0112,0113,0114,0115,0116,0117, 0120,0121,0122,0123,0124,0125,0126,0127, 0130,0131,0132,0173,0174,0175,0176,0177 }; char nofold[256] = { 0200,0201,0202,0203,0204,0205,0206,0207, 0210,0211,0212,0213,0214,0215,0216,0217, 0220,0221,0222,0223,0224,0225,0226,0227, 0230,0231,0232,0233,0234,0235,0236,0237, 0240,0241,0242,0243,0244,0245,0246,0247, 0250,0251,0252,0253,0254,0255,0256,0257, 0260,0261,0262,0263,0264,0265,0266,0267, 0270,0271,0272,0273,0274,0275,0276,0277, 0300,0301,0302,0303,0304,0305,0306,0307, 0310,0311,0312,0313,0314,0315,0316,0317, 0320,0321,0322,0323,0324,0325,0326,0327, 0330,0331,0332,0333,0334,0335,0336,0337, 0340,0341,0342,0343,0344,0345,0346,0347, 0350,0351,0352,0353,0354,0355,0356,0357, 0360,0361,0362,0363,0364,0365,0366,0367, 0370,0371,0372,0373,0374,0375,0376,0377, 0000,0001,0002,0003,0004,0005,0006,0007, 0010,0011,0012,0013,0014,0015,0016,0017, 0020,0021,0022,0023,0024,0025,0026,0027, 0030,0031,0032,0033,0034,0035,0036,0037, 0040,0041,0042,0043,0044,0045,0046,0047, 0050,0051,0052,0053,0054,0055,0056,0057, 0060,0061,0062,0063,0064,0065,0066,0067, 0070,0071,0072,0073,0074,0075,0076,0077, 0100,0101,0102,0103,0104,0105,0106,0107, 0110,0111,0112,0113,0114,0115,0116,0117, 0120,0121,0122,0123,0124,0125,0126,0127, 0130,0131,0132,0133,0134,0135,0136,0137, 0140,0141,0142,0143,0144,0145,0146,0147, 0150,0151,0152,0153,0154,0155,0156,0157, 0160,0161,0162,0163,0164,0165,0166,0167, 0170,0171,0172,0173,0174,0175,0176,0177 }; char nonprint[256] = { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 }; char dict[256] = { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1, 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1, 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1 }; struct field { char *code; char *ignore; int nflg; int rflg; int bflg[2]; int m[2]; int n[2]; } fields[NF]; struct field proto = { nofold+128, zero+128, 0, 1, 0,0, 0,-1, 0,0 }; int nfields; int error = 1; char *setfil(); char *sbrk(); char *brk(); main(argc, argv) char **argv; { register a; extern char end[1]; char *ep; char *arg; struct field *p, *q; int i; copyproto(); eargv = argv; while (--argc > 0) { if(**++argv == '-') for(arg = *argv;;) { switch(*++arg) { case '\0': if(arg[-1] == '-') eargv[eargc++] = "-"; break; case 'o': if(--argc > 0) outfil = *++argv; continue; case 'T': if (--argc > 0) dirtry[0] = *++argv; continue; default: field(++*argv,nfields>0); break; } break; } else if (**argv == '+') { if(++nfields>=NF) { diag("too many keys",""); exit(1); } copyproto(); field(++*argv,0); } else eargv[eargc++] = *argv; } q = &fields[0]; for(a=1; a<=nfields; a++) { p = &fields[a]; if(p->code != proto.code) continue; if(p->ignore != proto.ignore) continue; if(p->nflg != proto.nflg) continue; if(p->rflg != proto.rflg) continue; if(p->bflg[0] != proto.bflg[0]) continue; if(p->bflg[1] != proto.bflg[1]) continue; p->code = q->code; p->ignore = q->ignore; p->nflg = q->nflg; p->rflg = q->rflg; p->bflg[0] = p->bflg[1] = q->bflg[0]; } if(eargc == 0) eargv[eargc++] = "-"; if(cflg && eargc>1) { diag("can check only 1 file",""); exit(1); } safeoutfil(); ep = end + MEM; lspace = (int *)sbrk(0); while((int)brk(ep) == -1) ep -= 512; brk(ep -= 512); /* for recursion */ a = ep - (char*)lspace; nlines = (a-L); nlines /= (5*(sizeof(char *)/sizeof(char))); ntext = nlines*8; tspace = (char *)(lspace + nlines); a = -1; for(dirs=dirtry; *dirs; dirs++) { sprintf(filep=file1, "%s/stm%05uaa", *dirs, getpid()); while (*filep) filep++; filep -= 2; if ( (a=creat(file, 0600)) >=0) break; } if(a < 0) { diag("can't locate temp",""); exit(1); } close(a); unlink(file); if (signal(SIGHUP, SIG_IGN) != SIG_IGN) signal(SIGHUP, term); if (signal(SIGINT, SIG_IGN) != SIG_IGN) signal(SIGINT, term); signal(SIGPIPE,term); if (signal(SIGTERM, SIG_IGN) != SIG_IGN) signal(SIGTERM,term); nfiles = eargc; if(!mflg && !cflg) { sort(); fclose(stdin); } for(a = mflg|cflg?0:eargc; a+N=nfiles) i = nfiles; newfile(); merge(a, i); } if(a != nfiles) { oldfile(); merge(a, nfiles); } error = 0; term(); } sort() { register char *cp; register char **lp; register c; in((t done; int i; char *f; done = 0; i = 0; c = EOF; do { cp = tspace; lp = (char **)lspace; while(lp < (char **)lspace+nlines && cp < tspace+ntext) { *lp++ = cp; while(c != '\n') { if(c != EOF) { *cp++ = c; c = getc(is); continue; } else if(is) fclose(is); if(i < eargc) { if((f = setfil(i++)) == 0) is = stdin; else if((is = fopen(f, "r")) == NULL) cant(f); c = getc(is); } else break; } *cp++ = '\n'; if(c == EOF) { done++; lp--; break; } c = getc(is); } qsort((char **)lspace, lp); if(done == 0 || nfiles != eargc) newfile(); else oldfile(); while(lp > (char **)lspace) { cp = *--lp; if(*cp) do putc(*cp, os); while(*cp++ != '\n'); } fclose(os); } while(done == 0); } struct merg { char l[L]; FILE *b; } *ibuf[256]; merge(a,b) { struct merg *p; register char *cp, *dp; register i; struct merg **ip, *jp; char *f; int j; int k, l; int muflg; p = (struct merg *)lspace; j = 0; for(i=a; i < b; i++) { f = setfil(i); if(f == 0) p->b = stdin; else if((p->b = fopen(f, "r")) == NULL) cant(f); ibuf[j] = p; if(!rline(p)) j++; p++; } do { i = j; qsort((char **)ibuf, (char **)(ibuf+i)); l = 0; while(i--) { cp = ibuf[i]->l; if(*cp == '\0') { l = 1; if(rline(ibuf[i])) { k = i; while(++k < j) ibuf[k-1] = ibuf[k]; j--; } } } } while(l); muflg = mflg & uflg | cflg; i = j; while(i > 0) { cp = ibuf[i-1]->l; if(!cflg && (uflg == 0 || muflg || (*compare)(ibuf[i-1]->l,ibuf[i-2]->l))) do putc(*cp, os); while(*cp++ != '\n'); if(muflg){ cp = ibuf[i-1]->l; dp = p->l; do { } while((*dp++ = *cp++) != '\n'); } for(;;) { if(rline(ibuf[i-1])) { i--; if(i == 0) break; if(i == 1) muflg = uflg; } ip = &ibuf[i]; while(--ip>ibuf&&(*compare)(ip[0]->l,ip[-1]->l)<0){ jp = *ip; *ip = *(ip-1); *(ip-1) = jp; } if(!muflg) break; j = (*compare)(ibuf[i-1]->l,p->l); if(cflg) { if(j > 0) disorder("disorder:",ibuf[i-1]->l); else if(uflg && j==0) disorder("nonunique:",ibuf[i-1]->l); } else if(j == 0) continue; break; } } p = (struct merg *)lspace; for(i=a; ib); p++; if(i >= eargc) unlink(setfil(i)); } fclose(os); } rline(mp) struct merg *mp; { register char *cp; register char *ce; FILE *bp; register c; bp = mp->b; cp = mp->l; ce = cp+L; do { c = getc(bp); if(c == EOF) return(1); if(cp>=ce) cp--; *cp++ = c; } while(c!='\n'); return(0); } disorder(s,t) char *s, *t; { register char *u; for(u=t; *u!='\n';u++) ; *u = 0; diag(s,t); term(); } newfile() { register char *f; f = setfil(nfiles); if((os=fopen(f, "w")) == NULL) { diag("can't create ",f); term(); } nfiles++; } char * setfil(i) { if(i < eargc) if(eargv[i][0] == '-' && eargv[i][1] == '\0') return(0); else return(eargv[i]); i -= eargc; filep[0] = i/26 + 'a'; filep[1] = i%26 + 'a'; return(file); } oldfile() { if(outfil) { if((os=fopen(outfil, "w")) == NULL) { diag("can't create ",outfil); term(); } } else os = stdout; } safeoutfil() { register int i; struct stat obuf,ibuf; if(!mflg||outfil==0) return; if(stat(outfil,&obuf)==-1) return; for(i=eargc-N;i0; k<=nfields; k++) { fp = &fields[k]; pa = i; pb = j; if(k) { la = skip(pa, fp, 1); pa = skip(pa, fp, 0); lb = skip(pb, fp, 1); pb = skip(pb, fp, 0); } else { la = eol(pa); lb = eol(pb); } if(fp->nflg) { if(tabchar) { if(parflg; if(*pa == '-') { pa++; sa = -sa; } if(*pb == '-') { pb++; sb = -sb; } for(ipa = pa; ipa pa && ipb > pb) if(b = *--ipb - *--ipa) a = b; while(ipa > pa) if(*--ipa != '0') return(-sa); while(ipb > pb) if(*--ipb != '0') return(sb); if(a) return(a*sa); if(*(pa=jpa) == '.') pa++; if(*(pb=jpb) == '.') pb++; if(sa==sb) while(pacode; ignore = fp->ignore; loop: while(ignore[*pa]) pa++; while(ignore[*pb]) pb++; if(pa>=la || *pa=='\n') if(pbrflg); else continue; if(pb>=lb || *pb=='\n') return(-fp->rflg); if((sa = code[*pb++]-code[*pa++]) == 0) goto loop; return(sa*fp->rflg); } if(uflg) return(0); return(cmpa(i, j)); } cmpa(pa, pb) register char *pa, *pb; { while(*pa == *pb) { if(*pa++ == '\n') return(0); pb++; } return( *pa == '\n' ? fields[0].rflg: *pb == '\n' ?-fields[0].rflg: *pb > *pa ? fields[0].rflg: -fields[0].rflg ); } char * skip(pp, fp, j) struct field *fp; char *pp; { register i; register char *p; p = pp; if( (i=fp->m[j]) < 0) return(eol(p)); while(i-- > 0) { if(tabchar != 0) { while(*p != tabchar) if(*p != '\n') p++; else goto ret; if(i>0||j==0) p++; } else { while(blank(*p)) p++; while(!blank(*p)) if(*p != '\n') p++; else goto ret; } } if(tabchar==0&&fp->bflg[j]) while(blank(*p)) p++; i = fp->n[j]; while(i-- > 0) { if(*p != '\n') p++; else goto ret; } ret: return(p); } char * eol(p) register char *p; { while(*p != '\n') p++; return(p); } copyproto() { register i; register int *p, *q; p = (int *)&proto; q = (int *)&fields[nfields]; for(i=0; ibflg[k]++; break; case 'd': p->ignore = dict+128; break; case 'f': p->code = fold+128; break; case 'i': p->ignore = nonprint+128; break; case 'c': cflg = 1; continue; case 'm': mflg = 1; continue; case 'n': p->nflg++; break; case 't': tabchar = *++s; if(tabchar == 0) s--; continue; case 'r': p->rflg = -1; continue; case 'u': uflg = 1; break; case '.': if(p->m[k] == -1) /* -m.n with m missing */ p->m[k] = 0; d = &fields[0].n[0]-&fields[0].m[0]; default: p->m[k+d] = number(&s); } compare = cmp; } } number(ppa) char **ppa; { int n; register char *pa; pa = *ppa; n = 0; while(isdigit(*pa)) { n = n*10 + *pa - '0'; *ppa = pa++; } return(n); } blank(c) { if(c==' ' || c=='\t') return(1); return(0); } #define qsexc(p,q) t= *p;*p= *q;*q=t #define qstexc(p,q,r) t= *p;*p= *r;*r= *q;*q=t qsort(a,l) char **a, **l; { register char **i, **j; char **k; char **lp, **hp; int c; char *t; unsigned n; start: if((n=l-a) <= 1) return; n /= 2; hp = lp = a+n; i = a; j = l-1; for(;;) { if(i < lp) { if((c = (*compare)(*i, *lp)) == 0) { --lp; qsexc(i, lp); continue; } if(c < 0) { ++i; continue; } } loop: if(j > hp) { if((c = (*compare)(*hp, *j)) == 0) { ++hp; qsexc(hp, j); goto loop; } if(c > 0) { if(i == lp) { ++hp; qstexc(i, hp, j); i = ++lp; goto loop; } qsexc(i, j); --j; ++i; continue; } --j; goto loop; } if(i == lp) { if(uflg) for(k=lp+1; k<=hp;) **k++ = '\0'; if(lp-a >= l-hp) { qsort(hp+1, l); l = lp; } else { qsort(a, lp); a = hp+1; } goto start; } --lp; qstexc(j, lp, i); j = --hp; } } { if((c = (*compare)(*hp, *j)) == 0) { ++hp; qsexc(hp, j); goto loop; } if(c > 0) { if(i == lp) { ++hp; qstexc(i, hp, j); i = ++lp; goto loop; } qsexc(i, j); --j; ++i; continue; } --j; goto loop; } if(i == lp) { if(uflg) for(k=lp+1; k<=hp;) **k++ = '\0'; if(lp-a >= l-hp) { qsort(hp+1, l); l = lp; } else { cmd/spline.c 444 0 33 17442 2416240204 6254 static char *sccsid = "@(#)spline.c 4.1 (Berkeley) 10/1/80"; #include #define NP 1000 #define INF 1.e37 struct proj { int lbf,ubf; float a,b,lb,ub,quant,mult,val[NP]; } x,y; float *diag, *r; float dx = 1.; float ni = 100.; int n; int auta; int periodic; float konst = 0.0; float zero = 0.; /* Spline fit technique let x,y be vectors of abscissas and ordinates h be vector of differences h9i8=x9i8-x9i-1988 y" be vector of 2nd derivs of approx function If the points are numbered ((0,1,2,...,n+1 then y" satisfies (R W Hamming, Numerical Methods for Engineers and Scientists, 2nd Ed, p349ff) h9i8y"9i-1988+2(h9i8+h9i+18)y"9i8+h9i+18y"9i+18 = 6[(y9i+18-y9i8)/h9i+18-(y9i8-y9i-18)/h9i8] i=1,2,...,n where y"908 = y"9n+18 = 0 This is a symmetric tridiagonal system of the form | a918 h928 | |y"918| |b918| | h928 a928 h938 | |y"928| |b928| | h938 a938 h948 | |y"938| = |b938| | . | | .| | .| | . | | .| | .| It can be triangularized into | d918 h928 | |y"918| |r918| | d928 h938 | |y"928| |r928| | d938 h948 | |y"938| = |r938| | . | | .| | .| | . | | .| | .| where d918 = a918 r908 = 0 d9i8 = a9i8 - h9i8829/d9i-18 1=0;){ /* back substitute */ end = i==n-1; hi1 = end?x.val[1]-x.val[0]: x.val[i+1]-x.val[i]; D2yi1 = D2yi; if(i>0){ hi = x.val[i]-x.val[i-1]; corr = end?2*s+u:zero; D2yi = (end*v+r[i]-hi1*D2yi1-s*D2yn1)/ (diag[i]+corr); if(end) D2yn1 = D2yi; if(i>1){ a = 2*(hi+hi1); if(i==1) a += konst*hi; if(i==n-2) a += konst*hi1; d = diag[i-1]; s = -s*d/hi; }} else D2yi = D2yn1; if(!periodic) { if(i==0) D2yi = konst*D2yi1; if(i==n-2) D2yi1 = konst*D2yi; } if(end) continue; m = hi1>0?ni:-ni; m = 1.001*m*hi1/(x.ub-x.lb); if(m<=0) m = 1; h = hi1/m; for(j=m;j>0||i==0&&j==0;j--){ /* interpolate */ x0 = (m-j)*h/hi1; x1 = j*h/hi1; yy = D2yi*(x0-x0*x0*x0)+D2yi1*(x1-x1*x1*x1); yy = y.val[i]*x0+y.val[i+1]*x1 -hi1*hi1*yy/6; printf("%f ",x.val[i]+j*h); printf("%f\n",yy); } } return(1); } readin() { for(n=0;nlbf && p->lb>(p->val[i])) p->lb = p->val[i]; if(!p->ubf && p->ub<(p->val[i])) p->ub = p->val[i]; } } main(argc,argv) char *argv[];{ extern char *malloc(); int i; x.lbf = x.ubf = y.lbf = y.ubf = 0; x.lb = INF; x.ub = -INF; y.lb = INF; y.ub = -INF; while(--argc > 0) { argv++; again: switch(argv[0][0]) { case '-': argv[0]++; goto again; case 'a': auta = 1; numb(&dx,&argc,&argv); break; case 'k': numb(&konst,&argc,&argv); break; case 'n': numb(&ni,&argc,&argv); break; case 'p': periodic = 1; break; case 'x': if(!numb(&x.lb,&argc,&argv)) break; x.lbf = 1; if(!numb(&x.ub,&argc,&argv)) break; x.ubf = 1; break; default: fprintf(stderr, "Bad agrument\n"); exit(1); } } if(auta&&!x.lbf) x.lb = 0; readin(); getlim(&x); getlim(&y); i = (n+1)*sizeof(dx); diag = (float *)malloc((unsigned)i); r = (float *)malloc((unsigned)i); if(r==NULL||!spline()) for(i=0;i unsigned count = 1000; int fnumber; char fname[100]; char *ifil; char *ofil; FILE *is; FILE *os; main(argc, argv) char *argv[]; { register i, c, f; int iflg = 0; for(i=1; i /* * ssp - single space output * * Bill Joy UCB August 25, 1977 * * Compress multiple empty lines to a single empty line. * Option - compresses to nothing. */ char poof, hadsome; int ibuf[256]; main(argc, argv) int argc; char *argv[]; { register int c; FILE *f; argc--, argv++; do { while (argc > 0 && argv[0][0] == '-') { poof = 1; argc--, argv++; } f = stdin; if (argc > 0) { if ((f=fopen(argv[0], "r")) == NULL) { fflush(f); perror(argv[0]); exit(1); } argc--, argv++; } for (;;) { c = getc(f); if (c == -1) break; if (c != '\n') { hadsome = 1; putchar(c); continue; } /* * Eat em up */ if (hadsome) putchar('\n'); c = getc(f); if (c == -1) break; if (c != '\n') { putchar(c); hadsome = 1; continue; } do c = getc(f); while (c == '\n'); if (!poof && hadsome) putchar('\n'); if (c == -1) break; putchar(c); hadsome = 1; } } while (argc > 0); } ); } argc--, argv++; } for (;;) { c = getc(f); if (c == -1) break; if (c != '\n') { hadsome = 1; putchar(c); continue; } /* * Eat em up */ if (hadsome) putchar('\n'); c = getc(f); if (c == -1) break; if (c != '\n') { putchar(c); hadsome = 1; continue; } do c = getc(f); while (c == '\n'); if (!poof && hadsome) putchar('\n'); if (c == -1) brecmd/strings.c 444 0 33 3720 2416240212 6424 static char *sccsid = "@(#)strings.c 4.1 (Berkeley) 10/1/80"; #include #include #include long ftell(); /* * strings */ struct exec header; char *infile = "Standard input"; int oflg; int asdata; long offset; int minlength = 4; main(argc, argv) int argc; char *argv[]; { argc--, argv++; while (argc > 0 && argv[0][0] == '-') { register int i; if (argv[0][1] == 0) asdata++; else for (i = 1; argv[0][i] != 0; i++) switch (argv[0][i]) { case 'o': oflg++; break; case 'a': asdata++; break; default: if (!isdigit(argv[0][i])) { fprintf(stderr, "Usage: strings [ -a ] [ -o ] [ -# ] [ file ... ]\n"); exit(1); } minlength = argv[0][i] - '0'; for (i++; isdigit(argv[0][i]); i++) minlength = minlength * 10 + argv[0][i] - '0'; i--; break; } argc--, argv++; } do { if (argc > 0) { if (freopen(argv[0], "r", stdin) == NULL) { perror(argv[0]); exit(1); } infile = argv[0]; argc--, argv++; } fseek(stdin, (long) 0, 0); if (asdata || fread((char *)&header, sizeof header, 1, stdin) != 1 || N_BADMAG(header)) { fseek(stdin, (long) 0, 0); find((long) 100000000L); continue; } fseek(stdin, (long) N_TXTOFF(header)+header.a_text, 1); find((long) header.a_data); } while (argc > 0); } find(cnt) long cnt; { static char buf[BUFSIZ]; register char *cp; register int c, cc; cp = buf, cc = 0; for (; cnt != 0; cnt--) { c = getc(stdin); if (c == '\n' || dirt(c) || cnt == 0) { if (cp > buf && cp[-1] == '\n') --cp; *cp++ = 0; if (cp > &buf[minlength]) { if (oflg) printf("%7D ", ftell(stdin) - cc - 1); printf("%s\n", buf); } cp = buf, cc = 0; } else { if (cp < &buf[sizeof buf - 2]) *cp++ = c; cc++; } if (ferror(stdin) || feof(stdin)) break; } } dirt(c) int c; { switch (c) { case '\n': case '\f': return (0); case 0177: return (1); default: return (c > 0200 || c < ' '); } } if (c == '\n' || dirt(c) || cnt == 0) { if (cmd/time.c 444 0 33 2774 2421027360 5704 static char *sccsid = "@(#)time.c 4.2 (Berkeley) 10/9/80"; /* time command */ #include #include #include #include extern int errno; extern char *sys_errlist[]; main(argc, argv) char **argv; { struct tms buffer, obuffer; int status; register p; time_t before, after; if(argc<=1) exit(0); time(&before); p = fork(); if(p == -1) { fprintf(stderr, "Try again.\n"); exit(1); } if(p == 0) { execvp(argv[1], &argv[1]); fprintf(stderr, "%s: %s\n", argv[1], sys_errlist[errno]); exit(1); } signal(SIGINT, SIG_IGN); signal(SIGQUIT, SIG_IGN); times(&obuffer); while(wait(&status) != p) times(&obuffer); time(&after); if((status&0377) != 0) fprintf(stderr,"Command terminated abnormally.\n"); times(&buffer); printt("real", (after-before) * 60); printt("user", buffer.tms_cutime - obuffer.tms_cutime); printt("sys ", buffer.tms_cstime - obuffer.tms_cstime); fprintf(stderr, "\n"); exit(status>>8); } char quant[] = { 6, 10, 10, 6, 10, 6, 10, 10, 10 }; char *pad = "000 "; char *sep = "\0\0.\0:\0:\0\0"; char *nsep = "\0\0.\0 \0 \0\0"; printt(s, a) char *s; long a; { char digit[9]; register i; char c; int nonzero; for(i=0; i<9; i++) { digit[i] = a % quant[i]; a /= quant[i]; } nonzero = 0; while(--i>0) { c = digit[i]!=0 ? digit[i]+'0': nonzero ? '0': pad[i]; if (c) fprintf(stderr,"%c",c); nonzero |= digit[i]; c = nonzero?sep[i]:nsep[i]; if (c) fprintf(stderr,"%c",c); } fprintf(stderr," %s ",s); } 0, 1cmd/strip.c 444 0 33 3577 2416240213 6107 static char *sccsid = "@(#)strip.c 4.1 (Berkeley) 10/1/80"; #include #include #include #define BUFSIZ BSIZE char *tname; char *mktemp(); struct exec head; int status; int tf; main(argc, argv) char *argv[]; { register i; signal(SIGHUP, SIG_IGN); signal(SIGINT, SIG_IGN); signal(SIGQUIT, SIG_IGN); tname = mktemp("/tmp/sXXXXX"); close(creat(tname, 0600)); tf = open(tname, 2); if(tf < 0) { printf("cannot create temp file\n"); exit(2); } for(i=1; i 1) break; } close(tf); unlink(tname); exit(status); } strip(name) char *name; { register f; long size; int i; f = open(name, 0); if(f < 0) { printf("cannot open %s\n", name); status = 1; goto out; } read(f, (char *)&head, sizeof(head)); if (N_BADMAG(head)) { printf("%s not in a.out format\n", name); status = 1; goto out; } if ((head.a_syms == 0) && (head.a_trsize == 0) && (head.a_drsize ==0)) { printf("%s already stripped\n", name); goto out; } size = (long)head.a_text + head.a_data; head.a_syms = head.a_trsize = head.a_drsize = 0 ; lseek(tf, (long)0, 0); write(tf, (char *)&head, sizeof(head)); if (head.a_magic == ZMAGIC) size += PAGSIZ - sizeof (head); if (copy(name, f, tf, size)) { status = 1; goto out; } size += sizeof(head); close(f); f = creat(name, 0666); if(f < 0) { printf("%s cannot recreate\n", name); status = 1; goto out; } lseek(tf, (long)0, 0); if(copy(name, tf, f, size)) status = 2; out: close(f); } copy(name, fr, to, size) char *name; long size; { register s, n; char buf[BUFSIZ]; while(size != 0) { s = BUFSIZ; if(size < BUFSIZ) s = size; n = read(fr, buf, s); if(n != s) { printf("%s unexpected eof\n", name); return(1); } n = write(to, buf, s); if(n != s) { printf("%s unexpected write eof\n", name); return(1); } size -= s; } return(0); } \n", name); status = 1; goto out; } lseek(tf, (long)0, 0); if(copy(name, tf, f, size)) status = 2; out: close(f); } ccmd/stty.c 444 0 33 25611 2552470011 5764 static char *sccsid ="@(#)stty.c 4.6 (Berkeley) 7/8/81"; /* * set teletype modes */ #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, "extb", EXTB, 0, }; struct { char *string; int set; int reset; int lset; int lreset; } modes[] = { "even", EVENP, 0, 0, 0, "-even", 0, EVENP, 0, 0, "odd", ODDP, 0, 0, 0, "-odd", 0, ODDP, 0, 0, "raw", RAW, 0, 0, 0, "-raw", 0, RAW, 0, 0, "cooked", 0, RAW, 0, 0, "-nl", CRMOD, 0, 0, 0, "nl", 0, CRMOD, 0, 0, "echo", ECHO, 0, 0, 0, "-echo", 0, ECHO, 0, 0, "LCASE", LCASE, 0, 0, 0, "lcase", LCASE, 0, 0, 0, "-LCASE", 0, LCASE, 0, 0, "-lcase", 0, LCASE, 0, 0, "-tabs", XTABS, 0, 0, 0, "tabs", 0, XTABS, 0, 0, "tandem", TANDEM, 0, 0, 0, "-tandem", 0, TANDEM, 0, 0, "cbreak", CBREAK, 0, 0, 0((, "-cbreak", 0, CBREAK, 0, 0, "cr0", CR0, CR3, 0, 0, "cr1", CR1, CR3, 0, 0, "cr2", CR2, CR3, 0, 0, "cr3", CR3, CR3, 0, 0, "tab0", TAB0, XTABS, 0, 0, "tab1", TAB1, XTABS, 0, 0, "tab2", TAB2, XTABS, 0, 0, "nl0", NL0, NL3, 0, 0, "nl1", NL1, NL3, 0, 0, "nl2", NL2, NL3, 0, 0, "nl3", NL3, NL3, 0, 0, "ff0", FF0, FF1, 0, 0, "ff1", FF1, FF1, 0, 0, "bs0", BS0, BS1, 0, 0, "bs1", BS1, BS1, 0, 0, "33", CR1, ALLDELAY, 0, 0, "tty33", CR1, ALLDELAY, 0, 0, "37", FF1+CR2+TAB1+NL1, ALLDELAY, 0, 0, "tty37", FF1+CR2+TAB1+NL1, ALLDELAY, 0, 0, "05", NL2, ALLDELAY, 0, 0, "vt05", NL2, ALLDELAY, 0, 0, "tn", CR1, ALLDELAY, 0, 0, "tn300", CR1, ALLDELAY, 0, 0, "ti", CR2, ALLDELAY, 0, 0, "ti700", CR2, ALLDELAY, 0, 0, "tek", FF1, ALLDELAY, 0, 0, "crtbs", 0, 0, LCRTBS, LPRTERA, "-crtbs", 0, 0, 0, LCRTBS, "prterase", 0, 0, LPRTERA, LCRTBS+LCRTKIL+LCRTERA, "-prterase", 0, 0, 0, LPRTERA, "crterase", 0, 0, LCRTERA, LPRTERA, "-crterase", 0, 0, 0, LCRTERA, "crtkill", 0, 0, LCRTKIL, LPRTERA, "-crtkill", 0, 0, 0, LCRTKIL, "tilde", 0, 0, LTILDE, 0, "-tilde", 0, 0, 0, LTILDE, "mdmbuf", 0, 0, LMDMBUF, 0, "-mdmbuf", 0, 0, 0, LMDMBUF, "litout", 0, 0, LLITOUT, 0, "-litout", 0, 0, 0, LLITOUT, "tostop", 0, 0, LTOSTOP, 0, "-tostop", 0, 0, 0, LTOSTOP, "flusho", 0, 0, LFLUSHO, 0, "-flusho", 0, 0, 0, LFLUSHO, "nohang", 0, 0, LNOHANG, 0, "-nohang", 0, 0, 0, LNOHANG, "etxack", 0, 0, LETXACK, 0, "-etxack", 0, 0, 0, LETXACK, "intrup", 0, 0, LINTRUP, 0, "-intrup", 0, 0, 0, LINTRUP, "ctlecho", 0, 0, LCTLECH, 0, "-ctlecho", 0, 0, 0, LCTLECH, "pendin", 0, 0, LPENDIN, 0, "-pendin", 0, 0, 0, LPENDIN, "decctlq", 0, 0, LDECCTQ, 0, "-decctlq", 0, 0, 0, LDECCTQ, 0, }; struct tchars tc; struct ltchars ltc; struct sgttyb mode; int lmode; int oldisc, ldisc; #define CTRL(x) ('x'&037) struct special { char *name; char *cp; char def; } special[] = { "erase", &mode.sg_erase, CTRL(h), "kill", &mode.sg_kill, '@', "intr", &tc.t_intrc, 0177, "quit", &tc.t_quitc, CTRL(\\\\), "start", &tc.t_startc, CTRL(q), "stop", &tc.t_stopc, CTRL(s), "eof", &tc.t_eofc, CTRL(d), "brk", &tc.t_brkc, 0377, "susp", <c.t_suspc, CTRL(z), "dsusp", <c.t_dsuspc, CTRL(y), "rprnt", <c.t_rprntc, CTRL(r), "flush", <c.t_flushc, CTRL(o), "werase", <c.t_werasc, CTRL(w), "lnext", <c.t_lnextc, CTRL(v), 0 }; char *arg; int argc; char **argv; main(iargc, iargv) char **iargv; { int i; register struct special *sp; char obuf[BUFSIZ]; setbuf(stderr, obuf); argc = iargc; argv = iargv; gtty(1, &mode); ioctl(1, TIOCGETD, &ldisc); oldisc = ldisc; ioctl(1, TIOCGETC, &tc); ioctl(1, TIOCLGET, &lmode); ioctl(1, TIOCGLTC, <c); if(argc == 1) { prmodes(0); exit(0); } if (argc == 2 && !strcmp(argv[1], "all")) { prmodes(1); exit(0); } if (argc == 2 && !strcmp(argv[1], "everything")) { prmodes(2); exit(0); } /* if (argc == 2 && !strcmp(argv[1], "all")) { prmodes(2); exit(0); } */ while(--argc > 0) { arg = *++argv; if (eq("ek")){ mode.sg_erase = '#'; mode.sg_kill = '@'; continue; } 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; if (**++argv == 'u') *sp->cp = 0377; else if (**argv == '^') *sp->cp = ((*argv)[1] == '?') ? 0177 : (*argv)[1] & 037; else *sp->cp = **argv; goto cont; } if (eq("gspeed")) { mode.sg_ispeed = B300; mode.sg_ospeed = B9600; continue; } if (eq("hup")) { ioctl(1, TIOCHPCL, NULL); continue; } 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")) { gtty(open("/dev/tty", 0), &mode); 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; lmode &= ~modes[i].lreset; lmode |= modes[i].lset; } 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); } eq(string) char *string; { int i; if(!arg) return(0); i = 0; loop: if(arg[i] != string[i]) return(0); if(arg[i++] != '\0') goto loop; arg = 0; return(1); } prmodes(all) { register m; int any; if(ldisc==NETLDISC) fprintf(stderr, "net discipline, "); else if(ldisc==NTTYDISC) fprintf(stderr, "new tty, "); else if(all==2) fprintf(stderr, "old tty, "); if(mode.sg_ispeed != mode.sg_ospeed) { prspeed("input speed ", mode.sg_ispeed); prspeed("output speed ", mode.sg_ospeed); } else prspeed("speed ", mode.sg_ispeed); fprintf(stderr, all==2 ? "\n" : "; "); m = mode.sg_flags; if(all==2 || (m&(EVENP|ODDP))!=(EVENP|ODDP)) { if(m & EVENP) fprintf(stderr,"even "); if(m & ODDP) fprintf(stderr,"odd "); } if(all==2 || m&RAW) fprintf(stderr,"-raw "+((m&RAW)!=0)); if(all==2 || (m&CRMOD)==0) fprintf(stderr,"-nl "+((m&CRMOD)==0)); if(all==2 || (m&ECHO)==0) fprintf(stderr,"-echo "+((m&ECHO)!=0)); if(all==2 || (m&LCASE)) fprintf(stderr,"-lcase "+((m&LCASE)!=0)); if(all==2 || (m&TANDEM)) fprintf(stderr,"-tandem "+((m&TANDEM)!=0)); fprintf(stderr,"-tabs "+((m&XTABS)!=XTABS)); if(all==2 || (m&CBREAK)) fprintf(stderr,"-cbreak "+((m&CBREAK)!=0)); if(all==2 || (m&NLDELAY)) delay((m&NLDELAY)/NL1, "nl"); if ((m&TBDELAY)!=XTABS) delay((m&TBDELAY)/TAB1, "tab"); if(all==2 || (m&CRDELAY)) delay((m&CRDELAY)/CR1, "cr"); if(all==2 || (m&VTDELAY)) delay((m&VTDELAY)/FF1, "ff"); if(all==2 || (m&BSDELAY)) delay((m&BSDELAY)/BS1, "bs"); if (all) fprintf(stderr,"\n"); #define lpit(what,str) \ if (all==2||(lmode&what)) { \ fprintf(stderr,str+((lmode&what)!=0)); any++; \ } if (ldisc == NTTYDISC) { int newcrt = (lmode&(LCTLECH|LCRTBS)) == (LCTLECH|LCRTBS) && (lmode&(LCRTERA|LCRTKIL)) == ((mode.sg_ospeed > B300) ? LCRTERA|LCRTKIL : 0); if (newcrt) { if (all==2) 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 "); lpit(LINTRUP, "-intrup "); if (all==2) { fprintf(stderr, "\n"); any = 0; } lpit(LTILDE, "-tilde "); lpit(LFLUSHO, "-flusho "); lpit(LMDMBUF, "-mdmbuf "); lpit(LLITOUT, "-litout "); lpit(LNOHANG, "-nohang "); lpit(LETXACK, "-etxack "); lpit(LPENDIN, "-pendin "); if (any) fprintf(stderr,"\n"); } else if (!all) fprintf(stderr,"\n"); if (all) { switch (ldisc) { case 0: fprintf(stderr,"\ erase kill intr quit stop eof\ \n"); pcol(mode.sg_erase, -1); pcol(mode.sg_kill, -1); pcol(tc.t_intrc, -1); pcol(tc.t_quitc, -1); pcol(tc.t_stopc, tc.t_startc); pcol(tc.t_eofc, tc.t_brkc); fprintf(stderr,"\n"); break; case NTTYDISC: fprintf(stderr,"\ erase kill werase rprnt flush lnext susp intr quit stop eof\ \n"); pcol(mode.sg_erase, -1); pcol(mode.sg_kill, -1); pcol(ltc.t_werasc, -1); pcol(ltc.t_rprntc, -1); pcol(ltc.t_flushc, -1); pcol(ltc.t_lnextc, -1); pcol(ltc.t_suspc, ltc.t_dsuspc); pcol(tc.t_intrc, -1); pcol(tc.t_quitc, -1); pcol(tc.t_stopc, tc.t_startc); pcol(tc.t_eofc, tc.t_brkc); fprintf(stderr,"\n"); break; } } else if (ldisc != NETLDISC) { register struct special *sp; int first = 1; for (sp = special; sp->name; sp++) { if ((*sp->cp&0377) != (sp->def&0377)) { pit(*sp->cp, sp->name, first ? "" : ", "); first = 0; }; if (sp->cp == &tc.t_brkc && ldisc == 0) break; } if (first == 0) fprintf(stderr, "\n"); } } pcol(ch1, ch2) int ch1, ch2; { int nout = 0; ch1 &= 0377; ch2 &= 0377; if (ch1 == ch2) ch2 = 0377; for (; ch1 != 0377 || ch2 != 0377; ch1 = ch2, ch2 = 0377) { if (ch1 == 0377) continue; if (ch1 & 0200) { fprintf(stderr, "M-"); nout += 2; ch1 &= ~ 0200; } if (ch1 == 0177) { fprintf(stderr, "^"); nout++; ch1 = '?'; } else if (ch1 < ' ') { fprintf(stderr, "^"); nout++; ch1 += '@'; } fprintf(stderr, "%c", ch1); nout++; if (ch2 != 0377) { fprintf(stderr, "/"); nout++; } } while (nout < 7) { fprintf(stderr, " "); nout++; } } pit(what, itsname, sep) unsigned what; char *itsname, *sep; { what &= 0377; fprintf(stderr, "%s%s", sep, itsname); if (what == 0377) { fprintf(stderr, " "); return; } fprintf(stderr, " = "); if (what & 0200) { fprintf(stderr, "M-"); what &= ~ 0200; } if (what == 0177) { fprintf(stderr, "^"); what = '?'; } else if (what < ' ') { fprintf(stderr, "^"); what += '@'; } fprintf(stderr, "%c", what); } delay(m, s) char *s; { if(m) fprintf(stderr,"%s%d ", s, m); } int speed[] = { 0,50,75,110,134,150,200,300,600,1200,1800,2400,4800,9600,0,0 }; prspeed(c, s) char *c; { fprintf(stderr,"%s%d baud", c, speed[s]); } rintf(stderr, " "); return; } fprintf(stderr, " = "); if (what & 0200) { fprintf(stderr, "M-"); what &=((cmd/login.c 444 0 33 16615 2552436411 6103 static char *sccsid = "@(#)login.c 4.11 (Berkeley) 81/07/05"; /* * login [ name ] */ #include #include #include #include #include #include #include #include #include #ifdef UNAME #include #endif #define SCPYN(a, b) strncpy(a, b, sizeof(a)) #define NMAX sizeof(utmp.ut_name) #define LMAX sizeof(utmp.ut_line) #define FALSE 0 #define TRUE -1 char nolog[] = "/etc/nologin"; char qlog[] = ".hushlogin"; char securetty[] = "/etc/securetty"; char maildir[30] = "/usr/spool/mail/"; char lastlog[] = "/usr/adm/lastlog"; struct passwd nouser = {"", "nope"}; struct sgttyb ttyb; struct utmp utmp; char minusnam[16] = "-"; char homedir[64] = "HOME="; char shell[64] = "SHELL="; char term[64] = "TERM="; char user[20] = "USER="; char *envinit[] = {homedir, shell, "PATH=:/usr/ucb:/bin:/usr/bin", term, user, 0}; struct passwd *pwd; struct passwd *getpwnam(); char *strcat(); int setpwent(); char *ttyname(); char *crypt(); char *getpass(); char *rindex(); char *stypeof(); extern char **environ; #define CTRL(c) ('c'&037) #define CERASE '#' #define CEOT CTRL(d) #define CKILL '@' #define CQUIT 034 /* FS, cntl shift L */ #define CINTR 0177 /* DEL */ #define CSTOP CTRL(s) #define CSTART CTRL(q) #define CBRK 0377 struct tchars tc = { CINTR, CQUIT, CSTART, CSTOP, CEOT, CBRK }; #ifdef TIOCLSET struct ltchars ltc = { CTRL(z), CTRL(y), CTRL(r), CTRL(o), CTRL(w), CTRL(v) }; #endif main(argc, argv) char **argv; { register char *namep; int t, f, c; int invalid; int quietlog; int i; FILE *nlfd; char *ttyn; int ldisc = 0; #ifdef UNAME struct utsname uts; #endif alarm(60); signal(SIGQUIT, SIG_IGN); signal(SIGINT, SIG_IGN); nice(-100); nice(20); nice(0); #ifdef TIOCLSET ioctl(0, TIOCLSET, 0); #endif ioctl(0, TIOCNXCL, 0); gtty(0, &ttyb); ttyb.sg_erase = CERASE; ttyb.sg_kill = CKILL; stty(0, &ttyb); ioctl(0, TIOCSETC, &tc); #ifdef TIOCLSET ioctl(0, TIOCSLTC, <c); #endif for (t=3; t<20; t++) close(t); ttyn = ttyname(0); if (ttyn==(char *)0) ttyn = "/dev/tty??"; do { ldisc = 0; ioctl(0, TIOCSETD, &ldisc); invalid = FALSE; SCPYN(utmp.ut_name, ""); if (argc>1) { SCPYN(utmp.ut_name, argv[1]); argc = 0; } while (utmp.ut_name[0] == '\0') { namep = utmp.ut_name; #ifdef UNAME if (uname(&uts) != -1) printf("%s login: ", uts.nodename); else #endif printf("login: "); while ((c = getchar()) != '\n') { if (c == ' ') c = '_'; if (c == EOF) exit(0); if (namep < utmp.ut_name+NMAX) *namep++ = c; } } setpwent(); if ((pwd = getpwnam(utmp.ut_name)) == NULL) pwd = &nouser; endpwent(); if (!strcmp(pwd->pw_shell, "/bin/csh")) { ldisc = NTTYDISC; ioctl(0, TIOCSETD, &ldisc); } if (*pwd->pw_passwd != '\0') { nice(-4); namep = crypt(getpass("Password:"),pwd->pw_passwd); nice(4); if (strcmp(namep, pwd->pw_passwd)) invalid = TRUE; } if (pwd->pw_uid != 0 && (nlfd = fopen(nolog, "r")) > 0) { /* logins are disabled except for root */ while ((c = getc(nlfd)) != EOF) putchar(c); fflush(stdout); sleep(5); exit(0); } if (!invalid && pwd->pw_uid == 0 && !rootterm(ttyn+sizeof("/dev/")-1)) { FILE *console = fopen("/dev/console", "w"); if (console != NULL) { fprintf(console, "\r\nROOT LOGIN REFUSED %s\r\n" , ttyn+sizeof("/dev/")-1 ); fclose(console); } invalid = TRUE; } if (invalid) { printf("Login incorrect\n"); if (ttyn[sizeof("/dev/tty")-1] == 'd') { FILE *console = fopen("/dev/console", "w"); if (console != NULL) { fprintf(console, "\r\nBADDIALUP %s %s\r\n" , ttyn+sizeof("/dev/")-1 , utmp.ut_name); fclose(console); } } } if (*pwd->pw_shell == '\0') pwd->pw_shell = "/bin/sh"; i = strlen(pwd->pw_shell); if (chdir(pwd->pw_dir) < 0 && !invalid ) { if (chdir("/") < 0) { printf("No directory!\n"); invalid = TRUE; } else { printf("No directory! Logging in with home=/\n"); pwd->pw_dir = "/"; } } } while (invalid); time(&utmp.ut_time); t = ttyslot(); if (t>0 && (f = open("/etc/utmp", 1)) >= 0) { lseek(f, (long)(t*sizeof(utmp)), 0); SCPYN(utmp.ut_line, rindex(ttyn, '/')+1); write(f, (char *)&utmp, sizeof(utmp)); close(f); } if (t>0 && (f = open("/usr/adm/wtmp", 1)) >= 0) { lseek(f, 0L, 2); write(f, (char *)&utmp, sizeof(utmp)); close(f); } quietlog = FALSE; if (access(qlog, 0) == 0) quietlog = TRUE; if ( !quietlog && (f = open(lastlog, 2)) >= 0 ) { struct lastlog ll; lseek(f, (long)pwd->pw_uid * sizeof (struct lastlog), 0); if (read(f, (char *) &ll, sizeof ll) == sizeof ll && ll.ll_time != 0) { printf("Last login: %.*s on %.*s\n" , 24-5 , (char *) ctime(&ll.ll_time) , sizeof(ll.ll_line) , ll.ll_line ); } lseek(f, (long)pwd->pw_uid * sizeof (struct lastlog), 0); time(&ll.ll_time); SCPYN(ll.ll_line, rindex(ttyn, '/')+1); write(f, (char *) &ll, sizeof ll); close(f); } chown(ttyn, pwd->pw_uid, pwd->pw_gid); setgid(pwd->pw_gid); setuid(pwd->pw_uid); environ = envinit; strncat(homedir, pwd->pw_dir, sizeof(homedir)-6); strncat(shell, pwd->pw_shell, sizeof(shell)-7); strncat(term, stypeof(ttyn), sizeof(term)-6); strncat(user, pwd->pw_name, sizeof(user)-6); if ((namep = rindex(pwd->pw_shell, '/')) == NULL) namep = pwd->pw_shell; else namep++; strcat(minusnam, namep); alarm(0); #ifdef ARPAVAX if (pwd->pw_gid == 27) /* UGLY ! */ umask(2); else #endif umask(022); if (ttyn[sizeof("/dev/tty")-1] == 'd') { FILE *console = fopen("/dev/console", "w"); if (console != NULL) { fprintf(console, "\r\nDIALUP %s %s\r\n" , ttyn+sizeof("/dev/")-1 , pwd->pw_name ); fclose(console); } } if ( !quietlog ) { showmotd(); strcat(maildir, pwd->pw_name); if (access(maildir,4)==0) { struct stat statb; stat(maildir, &statb); if (statb.st_size) printf("You have mail.\n"); } } signal(SIGQUIT, SIG_DFL); signal(SIGINT, SIG_DFL); signal(SIGTSTP, SIG_IGN); execlp(pwd->pw_shell, minusnam, 0); perror(pwd->pw_shell); printf("No shell\n"); exit(0); } int stopmotd; catch() { signal(SIGINT, SIG_IGN); stopmotd++; } /* * return true if OK for root to login on this terminal */ rootterm(tty) char *tty; { register FILE *fd; char buf[100]; if ((fd = fopen(securetty, "r")) == NULL) return(1); while (fgets(buf, sizeof buf, fd) != NULL) { buf[strlen(buf)-1] = '\0'; if (strcmp(tty, buf) == 0) { fclose(fd); return(1); } } fclose(fd); return(0); } showmotd() { FILE *mf; register c; signal(SIGINT, catch); if ((mf = fopen("/etc/motd","r")) != NULL) { while ((c = getc(mf)) != EOF && stopmotd == 0) putchar(c); fclose(mf); } signal(SIGINT, SIG_IGN); } #undef UNKNOWN #define UNKNOWN "su" char * stypeof(ttyid) char *ttyid; { static char typebuf[16]; char buf[50]; register FILE *f; register char *p, *t, *q; if (ttyid == NULL) return (UNKNOWN); f = fopen("/etc/ttytype", "r"); if (f == NULL) return (UNKNOWN); /* split off end of name */ for (p = q = ttyid; *p != 0; p++) if (*p == '/') q = p + 1; /* scan the file */ while (fgets(buf, sizeof buf, f) != NULL) { for (t=buf; *t!=' ' && *t != '\t'; t++) ; *t++ = 0; while (*t == ' ' || *t == '\t') t++; for (p=t; *p>' '; p++) ; *p = 0; if (strcmp(q,t)==0) { strcpy(typebuf, buf); fclose(f); return (typebuf); } } fclose (f); return (UNKNOWN); } rn (UNKNOWN); f = fopen("/etc/ttytype", "r"); if (f == NULL) return (UNKNOWN); /* split off end of name */ focmd/sum.c 444 0 33 1553 2416240220 5540 static char *sccsid = "@(#)sum.c 4.1 (Berkeley) 10/1/80"; /* * Sum bytes in file mod 2^16 */ #include main(argc,argv) char **argv; { register unsigned sum; register i, c; register FILE *f; register long nbytes; int errflg = 0; i = 1; do { if(i < argc) { if ((f = fopen(argv[i], "r")) == NULL) { fprintf(stderr, "sum: Can't open %s\n", argv[i]); errflg += 10; continue; } } else f = stdin; sum = 0; nbytes = 0; while ((c = getc(f)) != EOF) { nbytes++; if (sum&01) sum = (sum>>1) + 0x8000; else sum >>= 1; sum += c; sum &= 0xFFFF; } if (ferror(f)) { errflg++; fprintf(stderr, "sum: read error on %s\n", argc>1?argv[i]:"-"); } printf("%05u%6ld", sum, (nbytes+BUFSIZ-1)/BUFSIZ); if(argc > 2) printf(" %s", argv[i]); printf("\n"); fclose(f); } while(++i < argc); exit(errflg); } ", argv[i]); errflg += 10; continue; } } else f = stdin; sum = 0; nbytes = 0; while ((c = getc(f)) != EOF) { nbytes++; ifcmd/swapon.c 444 0 33 1560 2423014476 6253 ((static char *sccsid = "@(#)swapon.c 4.4 (Berkeley) 10/15/80"; #include #include #define VSWAPON 85 main(argc, argv) int argc; char *argv[]; { int stat = 0; --argc, argv++; if (argc == 0) { fprintf(stderr, "usage: swapon name...\n"); exit(1); } if (argc == 1 && !strcmp(*argv, "-a")) { struct fstab *fsp; if (setfsent() == 0) perror(FSTAB), exit(1); while ( (fsp = getfsent()) != 0){ if (strcmp(fsp->fs_type, FSTAB_SW) != 0) continue; printf("Adding %s as swap device\n", fsp->fs_spec); if (syscall(VSWAPON, fsp->fs_spec) == -1) { extern errno; extern char *sys_errlist[]; printf("%s: %s\n", sys_errlist[errno]); stat = 1; } } endfsent(); exit(stat); } do { if (syscall(VSWAPON, *argv++) == -1) { stat = 1; perror(argv[-1]); } argc--; } while (argc > 0); exit(stat); } rror(FSTAB), exit(1); while ( (fsp = getfsent()) != 0){ if (strcmp(fsp->fs_type, FSTAB_SW) != 0) continue; printf("Adding %s as swapcmd/symorder.c 444 0 33 6333 2524671563 6623 static char *sccsid = "@(#)symorder.c 4.2 (Berkeley) 10/2/80"; /* * symorder - reorder symbol table */ #include #include #include #include #include #define SPACE 100 struct nlist order[SPACE]; char *savestr(); struct nlist nl1, nl2; struct exec exec; FILE *strf; off_t sa, ss; struct stat stb; int nsym = 0; int symfound = 0; char asym[BUFSIZ]; main(argc, argv) char **argv; { register struct nlist *p, *q; register FILE *f; register int na, i, j; int maxlen; int n, o; if(argc != 3) { fprintf(stderr, "Usage: symorder orderlist file\n"); exit(1); } if((f = fopen(argv[1], "r")) == NULL) { perror(argv[1]); exit(1); } maxlen = 0; for(p = order; fgets(asym, sizeof asym, f) != NULL; p++, nsym++) { for(i = 0; asym[i] && asym[i] != '\n'; i++) continue; if (asym[i] == '\n') asym[i] = 0; p->n_un.n_name = savestr(asym); if (maxlen < strlen(p->n_un.n_name)) maxlen = strlen(p->n_un.n_name); } fclose(f); if((f = fopen(argv[2], "r")) == NULL) perror(argv[2]), exit(1); if((strf = fopen(argv[2], "r")) == NULL) perror(argv[2]), exit(1); if((o = open(argv[2], 1)) < 0) perror(argv[2]), exit(1); if((fread(&exec, sizeof exec, 1, f)) != 1 || N_BADMAG(exec)) { fprintf(stderr, "symorder: %s: bad format\n", argv[2]); exit(1); } if (exec.a_syms == 0) { fprintf(stderr, "symorder: %s is stripped\n", argv[2]); exit(1); } fstat(fileno(f), &stb); if (stb.st_size < N_STROFF(exec)+sizeof(off_t)) { fprintf(stderr, "symorder: %s is in old format or truncated\n", argv[2]); exit(1); } sa = N_SYMOFF(exec); na = sa; ss = sa + exec.a_syms; fseek(f, sa, 0); n = exec.a_syms; while(n && symfound < nsym) { if(fread(&nl1, sizeof nl1, 1, f) != 1) { fprintf(stderr, "Short file "); perror(argv[2]); exit(1); } na += sizeof nl1; n -= sizeof nl1; if (nl1.n_un.n_strx == 0 || nl1.n_type & N_STAB) continue; fseek(strf, ss+nl1.n_un.n_strx, 0); fread(asym, maxlen+1, 1, strf); for(j = 0; j < nsym; j++) { for(i = 0; asym[i]; i++) if(asym[i] != order[j].n_un.n_name[i]) goto cont; if (order[j].n_un.n_name[i]) goto cont; if (order[j].n_value) goto cont; order[j].n_value = 1; fseek(f, (i = (sa+(j * sizeof nl1))), 0); if(fread(&nl2, sizeof nl2, 1, f) != 1) printf("Read err on 2nd asym\n"); lseek(o, i, 0); if(write(o, &nl1, sizeof nl1) == -1) perror("write1"); lseek(o, na-sizeof nl1, 0); if(write(o, &nl2, sizeof nl2) == -1) perror("write2"); fseek(f, 0, 0); fseek(f, na, 0); symfound++; break; cont: ; } } if(symfound < nsym) { fprintf(stderr, "%d symbol(s) not found:\n", nsym - symfound); for (i = 0; i < nsym; i++) { if (order[i].n_value == 0) printf("%s\n", order[i].n_un.n_name); } } } #define NSAVETAB 4096 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, "symorder: ran out of memory (savestr)\n"); exit(1); } } strncpy(savetab, cp, len); cp = savetab; savetab += len; saveleft -= len; return (cp); } intf("%s\n", order[i].n_un.n_name); } } } #define NSAVETAB 4096 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 *)mallcmd/sync.c 444 0 33 120 2416240233 5661 static char *sccsid = "@(#)sync.c 4.1 (Berkeley) 10/1/80"; main() { sync(); } of memory (savestr)\n"); exit(1); } } strncpy(savetab, cp, len); cp = savetab; savetab += len; saveleft -= len; return (cp); } intf("%s\n", order[i].n_un.n_name); } } } #define NSAVETAB 4096 char *savetab; int saveleft; char * savestr(cp) register char *cp; { register int len; len = strlen(cp) + 1; if (len > saveleft/( ,( 5< /\@,\D"cmd/tabs.c 444 0 33 5224 2416240236 5673 static char *sccsid = "@(#)tabs.c 4.1 (Berkeley) 10/1/80"; #include #include #define SP ' ' #define TB '\t' #define NL '\n' # define ESC 033 # define RHM 060 # define SI 017 # define DEL 0177 # define SET '1' # define CLR '2' # define MGN '9' # define CR '\r' # define BS '\b' struct sysnod { char *sysnam; int sysval; }; #define DASI300 1 #define DASI300S 2 #define DASI450 3 #define TN300 4 #define TTY37 5 #define HP 6 struct sysnod tty[] = { {"dasi300", DASI300}, {"300", DASI300}, {"dasi300s", DASI300S}, {"300s", DASI300S}, {"dasi450", DASI450}, {"450", DASI450}, {"37", TTY37}, {"tty37", TTY37}, {"tn300", TN300}, {"terminet", TN300}, {"tn", TN300}, {"hp", HP}, {0, 0}, }; int margset = 1; syslook(w) char *w; { register struct sysnod *sp; for (sp = tty; sp->sysnam!=NULL; sp++) if (strcmp(sp->sysnam, w)==0) return(sp->sysval); return(0); } main(argc,argv) int argc; char **argv; { struct sgttyb tb; int type; char *getenv(); type=0; if (argc>=2 && strcmp(argv[1],"-n")==0) { margset--; argc--; argv++; } if (argc>=2) { type=syslook(argv[1]); } else { type=syslook(getenv("TERM")); } switch(type) { case DASI300: dasi300(); break; case DASI300S: dasi300(); break; case DASI450: dasi450(); break; case TN300: tn300(); break; case TTY37: tty37(); break; case HP: hp2645(); break; default: gtty (0, &tb); if ( (tb.sg_flags & (LCASE|CRMOD)) == CRMOD) { /* test for CR map on, upper case off, i.e. terminet but not 33 */ if ((tb.sg_ispeed) == B300) /* test for 300 baud */ misc(); } else if ((tb.sg_flags & (CRMOD|LCASE)) == 0 && (tb.sg_ispeed ) == B150) { /* apparent model 37 */ tty37(); } } } clear(n) { escape(CLR); delay(n); putchar(CR); nl(); } delay(n) { while (n--) putchar(DEL); } tabs(n) { int i,j; if(margset) n--; for( i=0; i #include #include #include #include #include char *sprintf(); char *strcat(); daddr_t bsrch(); #define TBLOCK 512 #define NBLOCK 20 #define NAMSIZ 100 union hblock { char dummy[TBLOCK]; struct header { char name[NAMSIZ]; char mode[8]; char uid[8]; char gid[8]; char size[12]; char mtime[12]; char chksum[8]; char linkflag; char linkname[NAMSIZ]; } dbuf; } dblock, tbuf[NBLOCK]; struct linkbuf { ino_t inum; dev_t devnum; int count; char pathname[NAMSIZ]; struct linkbuf *nextp; } *ihead; struct stat stbuf; int rflag, xflag, vflag, tflag, mt, cflag, mflag, fflag, oflag, pflag; int term, chksum, wflag, recno, first, linkerrok; int freemem = 1; int nblock = NBLOCK; daddr_t low; daddr_t high; FILE *tfile; char tname[] = "/tmp/tarXXXXXX"; char *usefile; char magtape[] = "/dev/rmt8"; char *malloc(); main(argc, argv) int argc; char *argv[]; { char *cp; int onintr(), onquit(), onhup(), onterm(); if (argc < 2) usage(); tfile = NULL; usefile = magtape; argv[argc] = 0; argv++; for (cp = *argv++; *cp; cp++) switch(*cp) { case 'f': usefile = *argv++; 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 THROUGH */ 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': nblock = atoi(*argv++); if (nblock > NBLOCK || nblock <= 0) { fprintf(stderr, "Invalid blocksize. (Max %d)\n", NBLOCK); done(1); } break; case 'l': linkerrok++; break; default: fprintf(stderr, "tar: %c: unknown option\n", *cp); usage(); } if (rflag) { if (cflag && tfile != NULL) { usage(); done(1); } if (signal(SIGINT, SIG_IGN) != SIG_IGN) signal(SIGINT, onintr); if (signal(SIGHUP, SIG_IGN) != SIG_IGN) signal(SIGHUP, onhup); if (signal(SIGQUIT, SIG_IGN) != SIG_IGN) signal(SIGQUIT, onquit); /* if (signal(SIGTERM, SIG_IGN) != SIG_IGN) signal(SIGTERM, onterm); */ if (strcmp(usefile, "-") == 0) { if (cflag == 0) { fprintf(stderr, "Can only create standard output archives\n"); done(1); } mt = dup(1); nblock = 1; } else if ((mt = open(usefile, 2)) < 0) { if (cflag == 0 || (mt = creat(usefile, 0666)) < 0) { fprintf(stderr, "tar: cannot open %s\n", usefile); done(1); } } dorep(argv); } else if (xflag) { if (strcmp(usefile, "-") == 0) { mt = dup(0); nblock = 1; } else if ((mt = open(usefile, 0)) < 0) { fprintf(stderr, "tar: cannot open %s\n", usefile); done(1); } doxtract(argv); } else if (tflag) { if (strcmp(usefile, "-") == 0) { mt = dup(0); nblock = 1; } else if ((mt = open(usefile, 0)) < 0) { fprintf(stderr, "tar: cannot open %s\n", usefile); done(1); } dotable(); } else usage(); done(0); } usage() { fprintf(stderr, "tar: usage tar -{txru}[cvfblm] [tapefile] [blocksize] file1 file2...\n"); done(1); } dorep(argv) char *argv[]; { register char *cp, *cp2; char wdir[60]; if (!cflag) { getdir(); do { passtape(); if (term) done(0); getdir(); } while (!endtape()); if (tfile != NULL) { char buf[200]; sprintf(buf, "sort +0 -1 +1nr %s -o %s; awk '$1 != prev {print; prev=$1}' %s >%sX; mv %sX %s", tname, tname, tname, tname, tname, tname); fflush(tfile); system(buf); freopen(tname, "r", tfile); fstat(fileno(tfile), &stbuf); high = stbuf.st_size; } } getwdir(wdir); while (*argv && ! term) { cp2 = *argv; if (!strcmp(cp2, "-C") && argv[1]) { argv++; if (chdir(*argv) < 0) perror(*argv); else getwdir(wdir); argv++; continue; } for (cp = *argv; *cp; cp++) if (*cp == '/') cp2 = cp; if (cp2 != *argv) { *cp2 = '\0'; chdir(*argv); *cp2 = '/'; cp2++; } putfile(*argv++, cp2); chdir(wdir); } putempty(); putempty(); flushtape(); if (linkerrok == 1) for (; ihead != NULL; ihead = ihead->nextp) if (ihead->count != 0) fprintf(stderr, "Missing links to %s\n", ihead->pathname); } endtape() { if (dblock.dbuf.name[0] == '\0') { backtape(); return(1); } else return(0); } getdir() { register struct stat *sp; int i; readtape( (char *) &dblock); if (dblock.dbuf.name[0] == '\0') return; sp = &stbuf; sscanf(dblock.dbuf.mode, "%o", &i); sp->st_mode = i; sscanf(dblock.dbuf.uid, "%o", &i); sp->st_uid = i; sscanf(dblock.dbuf.gid, "%o", &i); sp->st_gid = i; sscanf(dblock.dbuf.size, "%lo", &sp->st_size); sscanf(dblock.dbuf.mtime, "%lo", &sp->st_mtime); sscanf(dblock.dbuf.chksum, "%o", &chksum); if (chksum != checksum()) { fprintf(stderr, "directory checksum error\n"); done(2); } if (tfile != NULL) fprintf(tfile, "%s %s\n", dblock.dbuf.name, dblock.dbuf.mtime); } passtape() { long blocks; char buf[TBLOCK]; if (dblock.dbuf.linkflag == '1') return; blocks = stbuf.st_size; blocks += TBLOCK-1; blocks /= TBLOCK; while (blocks-- > 0) readtape(buf); } putfile(longname, shortname) char *longname; char *shortname; { int infile; long blocks; char buf[TBLOCK]; register char *cp, *cp2; struct direct dbuf; int i, j; infile = open(shortname, 0); if (infile < 0) { fprintf(stderr, "tar: %s: cannot open file\n", longname); return; } fstat(infile, &stbuf); if (tfile != NULL && checkupdate(longname) == 0) { close(infile); return; } if (checkw('r', longname) == 0) { close(infile); return; } if ((stbuf.st_mode & S_IFMT) == S_IFDIR) { for (i = 0, cp = buf; *cp++ = longname[i++];); *--cp = '/'; *++cp = 0 ; i = 0; if (!oflag) { if( (cp - buf) >= NAMSIZ) { fprintf(stderr, "%s: file name too long\n", longname); close(infile); return; } stbuf.st_size = 0; tomodes(&stbuf); strcpy(dblock.dbuf.name,buf); sprintf(dblock.dbuf.chksum, "%6o", checksum()); writetape( (char *) &dblock); } chdir(shortname); while (read(infile, (char *)&dbuf, sizeof(dbuf)) > 0 && !term) { if (dbuf.d_ino == 0) { i++; continue; } if (strcmp(".", dbuf.d_name) == 0 || strcmp("..", dbuf.d_name) == 0) { i++; continue; } cp2 = cp; for (j=0; j < DIRSIZ; j++) *cp2++ = dbuf.d_name[j]; *cp2 = '\0'; close(infile); putfile(buf, cp); infile = open(".", 0); i++; lseek(infile, (long) (sizeof(dbuf) * i), 0); } close(infile); chdir(".."); return; } if ((stbuf.st_mode & S_IFMT) != S_IFREG) { fprintf(stderr, "tar: %s is not a file. Not dumped\n", longname); return; } tomodes(&stbuf); cp2 = longname; for (cp = dblock.dbuf.name, i=0; (*cp++ = *cp2++) && i < NAMSIZ; i++); if (i >= NAMSIZ) { fprintf(stderr, "%s: file name too long\n", longname); close(infile); return; } if (stbuf.st_nlink > 1) { struct linkbuf *lp; int found = 0; for (lp = ihead; lp != NULL; lp = lp->nextp) { if (lp->inum == stbuf.st_ino && lp->devnum == stbuf.st_dev) { found++; break; } } if (found) { strcpy(dblock.dbuf.linkname, lp->pathname); dblock.dbuf.linkflag = '1'; sprintf(dblock.dbuf.chksum, "%6o", checksum()); writetape( (char *) &dblock); if (vflag) { fprintf(stderr, "a %s ", longname); fprintf(stderr, "link to %s\n", lp->pathname); } lp->count--; close(infile); return; } else { lp = (struct linkbuf *) malloc(sizeof(*lp)); if (lp == NULL) { if (freemem) { fprintf(stderr, "Out of memory. Link information lost\n"); freemem = 0; } } else { lp->nextp = ihead; ihead = lp; lp->inum = stbuf.st_ino; lp->devnum = stbuf.st_dev; lp->count = stbuf.st_nlink - 1; strcpy(lp->pathname, longname); } } } blocks = (stbuf.st_size + (TBLOCK-1)) / TBLOCK; if (vflag) { fprintf(stderr, "a %s ", longname); fprintf(stderr, "%ld blocks\n", blocks); } sprintf(dblock.dbuf.chksum, "%6o", checksum()); writetape( (char *) &dblock); while ((i = read(infile, buf, TBLOCK)) > 0 && blocks > 0) { writetape(buf); blocks--; } close(infile); if (blocks != 0 || i != 0) fprintf(stderr, "%s: file changed size\n", longname); while (blocks-- > 0) putempty(); } doxtract(argv) char *argv[]; { long blocks, bytes; char buf[TBLOCK]; char **cp; int ofile; for (;;) { getdir(); if (endtape()) break; if (*argv == 0) goto gotit; for (cp = argv; *cp; cp++) if (prefix(*cp, dblock.dbuf.name)) goto gotit; passtape(); continue; gotit: if (checkw('x', dblock.dbuf.name) == 0) { passtape(); continue; } if(checkdir(dblock.dbuf.name)) continue; if (dblock.dbuf.linkflag == '1') { unlink(dblock.dbuf.name); if (link(dblock.dbuf.linkname, dblock.dbuf.name) < 0) { fprintf(stderr, "%s: cannot link\n", dblock.dbuf.name); continue; } if (vflag) fprintf(stderr, "%s linked to %s\n", dblock.dbuf.name, dblock.dbuf.linkname); continue; } if ((ofile = creat(dblock.dbuf.name, stbuf.st_mode & 07777)) < 0) { fprintf(stderr, "tar: %s - cannot create\n", dblock.dbuf.name); passtape(); continue; } chown(dblock.dbuf.name, stbuf.st_uid, stbuf.st_gid); blocks = ((bytes = stbuf.st_size) + TBLOCK-1)/TBLOCK; if (vflag) fprintf(stderr, "x %s, %ld bytes, %ld tape blocks\n", dblock.dbuf.name, bytes, blocks); while (blocks-- > 0) { readtape(buf); if (bytes > TBLOCK) { if (write(ofile, buf, TBLOCK) < 0) { fprintf(stderr, "tar: %s: HELP - extract write error\n", dblock.dbuf.name); done(2); } } else if (write(ofile, buf, (int) bytes) < 0) { fprintf(stderr, "tar: %s: HELP - extract write error\n", dblock.dbuf.name); d((one(2); } bytes -= TBLOCK; } close(ofile); if (mflag == 0) { time_t timep[2]; timep[0] = time(NULL); timep[1] = stbuf.st_mtime; utime(dblock.dbuf.name, timep); } if (pflag) chmod(dblock.dbuf.name, stbuf.st_mode & 07777); } } dotable() { for (;;) { getdir(); if (endtape()) break; if (vflag) longt(&stbuf); printf("%s", dblock.dbuf.name); if (dblock.dbuf.linkflag == '1') printf(" linked to %s", dblock.dbuf.linkname); printf("\n"); passtape(); } } putempty() { char buf[TBLOCK]; char *cp; for (cp = buf; cp < &buf[TBLOCK]; ) *cp++ = '\0'; writetape(buf); } longt(st) register struct stat *st; { register char *cp; char *ctime(); pmode(st); printf("%3d/%1d", st->st_uid, st->st_gid); printf("%7D", st->st_size); cp = ctime(&st->st_mtime); printf(" %-12.12s %-4.4s ", cp+4, cp+20); } #define SUID 04000 #define SGID 02000 #define ROWN 0400 #define WOWN 0200 #define XOWN 0100 #define RGRP 040 #define WGRP 020 #define XGRP 010 #define ROTH 04 #define WOTH 02 #define XOTH 01 #define STXT 01000 int m1[] = { 1, ROWN, 'r', '-' }; int m2[] = { 1, WOWN, 'w', '-' }; int m3[] = { 2, SUID, 's', XOWN, 'x', '-' }; int m4[] = { 1, RGRP, 'r', '-' }; int m5[] = { 1, WGRP, 'w', '-' }; int m6[] = { 2, SGID, 's', XGRP, 'x', '-' }; int m7[] = { 1, ROTH, 'r', '-' }; int m8[] = { 1, WOTH, 'w', '-' }; int m9[] = { 2, STXT, 't', XOTH, 'x', '-' }; int *m[] = { m1, m2, m3, m4, m5, m6, m7, m8, m9}; pmode(st) register struct stat *st; { register int **mp; for (mp = &m[0]; mp < &m[9];) select(*mp++, st); } select(pairp, st) int *pairp; struct stat *st; { register int n, *ap; ap = pairp; n = *ap++; while (--n>=0 && (st->st_mode&*ap++)==0) ap++; printf("%c", *ap); } checkdir(name) register char *name; { register char *cp; int i; for (cp = name; *cp; cp++) { if (*cp == '/') { *cp = '\0'; if (access(name, 01) < 0) { register int pid, rp; if ((pid = fork()) == 0) { execl("/bin/mkdir", "mkdir", name, 0); execl("/usr/bin/mkdir", "mkdir", name, 0); fprintf(stderr, "tar: cannot find mkdir!\n"); done(0); } while ((rp = wait(&i)) >= 0 && rp != pid) ; chown(name, stbuf.st_uid, stbuf.st_gid); if (pflag) chmod(dblock.dbuf.name, stbuf.st_mode & 0777); } *cp = '/'; } } return(cp[-1]=='/'); } onintr() { signal(SIGINT, SIG_IGN); term++; } onquit() { signal(SIGQUIT, SIG_IGN); term++; } onhup() { signal(SIGHUP, SIG_IGN); term++; } onterm() { signal(SIGTERM, SIG_IGN); term++; } tomodes(sp) register struct stat *sp; { register char *cp; for (cp = dblock.dummy; cp < &dblock.dummy[TBLOCK]; cp++) *cp = '\0'; sprintf(dblock.dbuf.mode, "%6o ", sp->st_mode & 07777); sprintf(dblock.dbuf.uid, "%6o ", sp->st_uid); sprintf(dblock.dbuf.gid, "%6o ", sp->st_gid); sprintf(dblock.dbuf.size, "%11lo ", sp->st_size); sprintf(dblock.dbuf.mtime, "%11lo ", sp->st_mtime); } checksum() { register i; register char *cp; for (cp = dblock.dbuf.chksum; cp < &dblock.dbuf.chksum[sizeof(dblock.dbuf.chksum)]; cp++) *cp = ' '; i = 0; for (cp = dblock.dummy; cp < &dblock.dummy[TBLOCK]; cp++) i += *cp; return(i); } checkw(c, name) char *name; { if (wflag) { printf("%c ", c); if (vflag) longt(&stbuf); printf("%s: ", name); if (response() == 'y'){ return(1); } return(0); } return(1); } response() { char c; c = getchar(); if (c != '\n') while (getchar() != '\n'); else c = 'n'; return(c); } checkupdate(arg) char *arg; { char name[100]; long mtime; daddr_t seekp; daddr_t lookup(); rewind(tfile); for (;;) { if ((seekp = lookup(arg)) < 0) return(1); fseek(tfile, seekp, 0); fscanf(tfile, "%s %lo", name, &mtime); if (stbuf.st_mtime > mtime) return(1); else return(0); } } done(n) { unlink(tname); exit(n); } prefix(s1, s2) register char *s1, *s2; { while (*s1) if (*s1++ != *s2++) return(0); if (*s2) return(*s2 == '/'); return(1); } getwdir(s) char *s; { int i; int pipdes[2]; pipe(pipdes); if ((i = fork()) == 0) { close(1); dup(pipdes[1]); execl("/bin/pwd", "pwd", 0); execl("/usr/bin/pwd", "pwd", 0); fprintf(stderr, "pwd failed!\n"); printf("/\n"); exit(1); } while (wait((int *)NULL) != -1) ; read(pipdes[0], s, 50); while(*s != '\n') s++; *s = '\0'; close(pipdes[0]); close(pipdes[1]); } #define N 200 int njab; daddr_t lookup(s) char *s; { register i; daddr_t a; for(i=0; s[i]; i++) if(s[i] == ' ') break; a = bsrch(s, i, low, high); return(a); } daddr_t bsrch(s, n, l, h) daddr_t l, h; char *s; { register i, j; char b[N]; daddr_t m, m1; njab = 0; loop: if(l >= h) return(-1L); m = l + (h-l)/2 - N/2; if(m < l) m = l; fseek(tfile, m, 0); fread(b, 1, N, tfile); njab++; for(i=0; i= h) return(-1L); 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; { register int i; if (recno >= nblock || first == 0) { if ((i = read(mt, tbuf, TBLOCK*nblock)) < 0) { fprintf(stderr, "Tar: tape read error\n"); done(3); } if (first == 0) { if ((i % TBLOCK) != 0) { fprintf(stderr, "Tar: tape blocksize error\n"); done(3); } i /= TBLOCK; if (i != nblock) { fprintf(stderr, "Tar: blocksize = %d\n", i); nblock = i; } } recno = 0; } first = 1; copy(buffer, &tbuf[recno++]); return(TBLOCK); } writetape(buffer) char *buffer; { first = 1; if (recno >= nblock) { if (write(mt, tbuf, TBLOCK*nblock) < 0) { fprintf(stderr, "Tar: tape write error\n"); done(2); } recno = 0; } copy(&tbuf[recno++], buffer); if (recno >= nblock) { if (write(mt, tbuf, TBLOCK*nblock) < 0) { fprintf(stderr, "Tar: tape write error\n"); done(2); } recno = 0; } return(TBLOCK); } backtape() { static int mtdev = 1; static struct mtop mtop = {MTBSR, 1}; struct mtget mtget; if (mtdev == 1) mtdev = ioctl(mt, MTIOCGET, &mtget); if (mtdev == 0) { if (ioctl(mt, MTIOCTOP, &mtop) < 0) { fprintf(stderr, "Tar: tape backspace error\n"); done(4); } } else lseek(mt, (long) -TBLOCK*nblock, 1); recno--; } flushtape() { write(mt, tbuf, TBLOCK*nblock); } copy(to, from) register char *to, *from; { register i; i = TBLOCK; do { *to++ = *from++; } while (--i); } LOCK); } backtape() { static int mtdev = 1; static struct mtop mtop = {MTBSR, 1}; struct mtget mtget; if (mtdev == 1) mtdev = ioctl(mt, MTIOCGET, &mtget); if (mtdev == 0) { if (ioctl(mt, MTIOCTOP, &mtop) < 0) { fprintf(stderr, "Tar: tape backspace error\n"); done(4); } } else lseek(mt, (long) -TBLOCK*nblock, 1); recno--; } flushtape() { write(mt, tbuf, TBLOCK*nblock); } copy(to, from) register char *to, *from; { register i; i = TBLOCK; do { *to++ = *from++; } whcmd/tc.c 444 0 33 26733 2551654321 5404 static char *sccsid = "@(#)tc.c 4.2 (Berkeley) 7/6/81"; /* * Simulate typesetter on 4014 */ #include #include #define oput(c) if (pgskip==0) putchar(c); else (c); #define MAXY 3071 #define US 037 #define GS 035 #define ESC 033 #define FF 014 #define DBL 0200 int pl = 11*144; int mpy = 1; int div = 1; char *ap; int ch; int nonumb; int psize = 10; int dfact = 1; int esc; int escd; int verd; int esct; int osize = 02; int size = 02; int rx; int xx; int yy = MAXY+62+48; int leadtot = -31; int ohy = -1; int ohx = -1; int oxb = -1; int oly = -1; int olx = -1; int tflag; int railmag; int lead; int skip; int pgskip; int ksize = ';'; int mcase; int stab[] = {010,0,01,07,02,03,04,05,0211,06,0212,0213,0214,0215,0216,0217}; int rtab[] = {6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 28, 36, 18}; int ktab[] = {';',';',';',';',';',';',':',':','9','9','9','9','8','8','8','9'}; int first = 1; int alpha; extern char *asctab[128]; extern char *spectab[128]; int erase = 1; int (*sigint)(); int (*sigquit)(); main(argc,argv) int argc; char **argv; { register i, j; register char *k; extern ex(); while((--argc > 0) && ((++argv)[0][0]=='-')){ switch(argv[0][1]){ case 'p': ap = &argv[0][2]; dfact = 72; if(i = atoi())pl = i/3; continue; case 't': tflag++; continue; case 's': ap = &argv[0][2]; dfact = 1; pgskip = atoi(); continue; default: dfact = 1; ap = &argv[0][1]; if(i = atoi())mpy = i; if(i = atoi())div = i; continue; } } if(argc){ if (freopen(argv[0], "r", stdin) == NULL) { fprintf(stderr, "tc: cannot open %s\n", argv[0]); exit(1); } } sigint = signal(SIGINT, ex); sigquit = signal(SIGQUIT, SIG_IGN); while((i = getchar()) != EOF){ if(!i)continue; if(i & 0200){ esc += (~i) & 0177; continue; } if(esc){ if(escd)esc = -esc; esct += esc; xx += (esc*mpy + rx)/div; rx = (esc*mpy + rx)%div; sendpt(); esc = 0; } switch(i){ case 0100: /*init*/ escd = verd = mcase = railmag = xx = 0; yy = MAXY + 48; leadtot = -31; ohy = oxb = oly = ohx = olx = -1; oput(US); fflush(stdout); if(!first && !tflag)kwait(); if(first){ first = 0; yy += 62; } init(); continue; case 0101: /*lower rail*/ railmag &= ~01; continue; case 0102: /*upper rail*/ railmag |= 01; continue; case 0103: /*upper mag*/ railmag |= 02; continue; case 0104: /*lower mag*/ railmag &= ~02; continue; case 0105: /*lower case*/ mcase ((= 0; continue; case 0106: /*upper case*/ mcase = 0100; continue; case 0107: /*escape forward*/ escd = 0; continue; case 0110: /*escape backward*/ escd = 1; continue; case 0111: /*stop*/ continue; case 0112: /*lead forward*/ verd = 0; continue; case 0113: /*undefined*/ continue; case 0114: /*lead backward*/ verd = 1; continue; case 0115: /*undefined*/ case 0116: case 0117: continue; } if((i & 0340) == 0140){ /*leading*/ lead = (~i) & 037; if(verd)lead = -lead; if((leadtot += lead) > pl){ leadtot = lead; oput(US); fflush(stdout); if(!tflag)kwait(); yy = MAXY; if(pgskip)--pgskip; init(); continue; } if(skip)continue; if((yy -= (lead<<1)) < 0){ skip++; yy = 0; }else sendpt(); continue; } if((i & 0360) == 0120){ /*size change*/ i &= 017; for(j = 0; i != (stab[j] & 017); j++); osize = size; size = stab[j]; psize = rtab[j]; ksize = ktab[j]; oput(ESC); oput(ksize); i = 0; if(!(osize & DBL) && (size & DBL))i = -55; else if((osize & DBL) && !(size & DBL))i = 55; if(escd)i = -i; esc += i; continue; } if(i & 0300)continue; i = (i & 077) | mcase; if(railmag != 03)k = asctab[i]; else k = spectab[i]; if(alpha)sendpt(); if(*k!='\0'){ oput(US); while(*k & 0377)oput(*k++); alpha++; continue; }else{ if(railmag != 03){ switch(i){ case 0124: lig("fi"); break; case 0125: lig("fl"); break; case 0126: lig("ff"); break; case 0130: lig("ffl"); break; case 0131: lig("ffi"); break; default: continue; } } continue; } } ex(); } lig(x) char *x; { register i, j; register char *k; j = 0; k = x; oput(US); oput(*k++); i = psize * 8 * mpy / (div * 6); /* 8/36 em */ while(*k){ xx += i; j += i; sendpt(); oput(US); oput(*k++); } xx -= j; sendpt(); } init(){ fflush(stdout); if(erase){ oput(ESC); oput(FF); }else erase = 1; oput(ESC); oput(ksize); /*delay about a second*/ /* let the system do it... for(i = 960; i > 0; i--)oput(GS); */ skip = 0; sendpt(); } ex(){ yy = MAXY; xx = 0; sendpt(); oput(ESC); oput(';'); oput(US); fflush(stdout); exit(0); } kwait(){ char buf[128]; char *bptr; char c; if(pgskip) return; next: bptr=buf; while((c=readch())&&(c!='\n')) *bptr++=c; *bptr=0; if(bptr!=buf){ bptr = buf; if(*bptr == '!'){callunix(&buf[1]); fputs("!\n", stderr); goto next;} else switch(*bptr++){ case 'e': erase = 0; goto next; case 's': ap = &buf[1]; dfact = 1; pgskip = atoi() + 1; goto next; default: fputs("?\n", stderr); goto next; } } else if (c==0) ex(); else return; } callunix(line) char line[]; { int rc, status, unixpid; if( (unixpid=fork())==0 ) { signal(SIGINT,sigint); signal(SIGQUIT,sigquit); close(0); dup(2); execl("/bin/sh", "-sh", "-c", line, 0); exit(255); } else if(unixpid == -1) return; else{ signal(SIGINT, SIG_IGN); signal(SIGQUIT, SIG_IGN); while( (rc = wait(&status)) != unixpid && rc != -1 ) ; signal(SIGINT,ex); signal(SIGQUIT,sigquit); } } readch(){ char c; if (read(2,&c,1)<1) c=0; return(c); } sendpt(){ int hy,xb,ly,hx,lx; oput(GS); hy = ((yy>>7) & 037); xb = ((xx & 03) + ((yy<<2) & 014) & 017); ly = ((yy>>2) & 037); hx = ((xx>>7) & 037); lx = ((xx>>2) & 037); if(hy != ohy)oput(hy | 040); if(xb != oxb)oput(xb | 0140); if((ly != oly) || (hx != ohx) || (xb != oxb)) oput(ly | 0140); if(hx != ohx)oput(hx | 040); oput(lx | 0100); ohy = hy; oxb = xb; oly = ly; ohx = hx; olx = lx; alpha = 0; return; } atoi() { register i, j, acc; int field, digits; long dd; long tscale(); field = digits = acc = 0; a1: while(((j = (i = getch()) - '0') >= 0) && (j <= 9)){ field++; digits++; acc = 10*acc + j; } if(i == '.'){ field++; digits = 0; goto a1; } if(!(ch = i))ch = 'x'; dd = tscale(acc); acc = dd; if((field != digits) && (digits > 0)){ j = 1; while(digits--)j *= 10; acc = dd/j; } nonumb = !field; ch = 0; return(acc); } long tscale(n) int n; { register i, j; switch(i = getch()){ case 'u': j = 1; break; case 'p': /*Points*/ j = 6; break; case 'i': /*Inches*/ j = 432; break; case 'c': /*Centimeters; should be 170.0787*/ j = 170; break; case 'P': /*Picas*/ j = 72; break; default: j = dfact; ch = i; } return((long)n*j); } getch(){ register i; if(ch){ i = ch; ch = 0; return(i); } return(*ap++); } char *asctab[128] = { "\0", /*blank*/ "h", /*h*/ "t", /*t*/ "n", /*n*/ "m", /*m*/ "l", /*l*/ "i", /*i*/ "z", /*z*/ "s", /*s*/ "d", /*d*/ "b", /*b*/ "x", /*x*/ "f", /*f*/ "j", /*j*/ "u", /*u*/ "k", /*k*/ "\0", /*blank*/ "p", /*p*/ "-", /*_ 3/4 em dash*/ ";", /*;*/ "\0", /*blank*/ "a", /*a*/ "_", /*rule*/ "c", /*c*/ "`", /*` open*/ "e", /*e*/ "\'", /*' close*/ "o", /*o*/ "\0", /*1/4*/ "r", /*r*/ "\0", /*1/2*/ "v", /*v*/ "-", /*- hyphen*/ "w", /*w*/ "q", /*q*/ "/", /*/*/ ".", /*.*/ "g", /*g*/ "\0", /*3/4*/ ",", /*,*/ "&", /*&*/ "y", /*y*/ "\0", /*blank*/ "%", /*%*/ "\0", /*blank*/ "Q", /*Q*/ "T", /*T*/ "O", /*O*/ "H", /*H*/ "N", /*N*/ "M", /*M*/ "L", /*L*/ "R", /*R*/ "G", /*G*/ "I", /*I*/ "P", /*P*/ "C", /*C*/ "V", /*V*/ "E", /*E*/ "Z", /*Z*/ "D", /*D*/ "B", /*B*/ "S", /*S*/ "Y", /*Y*/ "\0", /*blank*/ "F", /*F*/ "X", /*X*/ "A", /*A*/ "W", /*W*/ "J", /*J*/ "U", /*U*/ "K", /*K*/ "0", /*0*/ "1", /*1*/ "2", /*2*/ "3", /*3*/ "4", /*4*/ "5", /*5*/ "6", /*6*/ "7", /*7*/ "8", /*8*/ "9", /*9*/ "*", /***/ "-", /*minus*/ "", /*fi*/ "", /*fl*/ "", /*ff*/ "\033\016Z\bM\033\017", /*cent sign*/ "", /*ffl*/ "", /*ffi*/ "(", /*(*/ ")", /*)*/ "[", /*[*/ "]", /*]*/ "\033\016J\033\017", /*degree*/ "\033\016M\b_\033\017", /*dagger*/ "=", /*=*/ "\033\016O\b&\033\017", /*registered*/ ":", /*:*/ "+", /*+*/ "\0", /*blank*/ "!", /*!*/ "\033\016O\b~\033\017", /*bullet*/ "?", /*?*/ "\'", /*foot mark*/ "|", /*|*/ "\0", /*blank*/ "\033\016O\b#\033\017", /*copyright*/ "\033\016L\033\017", /*square*/ "$" }; /*$*/ char *spectab[128] = { "\0", /*blank*/ "\033\016(\bM\033\017", /*psi*/ "\033\016o\b_\033\017", /*theta*/ "v\b)", /*nu*/ "\033\016V\b,\033\017", /*mu*/ "\033\016)\b?\033\017", /*lambda*/ "\033\016I\033\017", /*iota*/ "S\b\033\016Z\033\017", /*zeta*/ "o\b\'", /*sigma*/ "o\b\033\0165\033\017", /*delta*/ "\033\016b\033\017", /*beta*/ "\033\016e\bc\033\017", /*xi*/ "j\b\033\016C\033\017", /*eta*/ "\033\016O\bM\033\017", /*phi*/ "\033\016(\033\017", /*upsilon*/ "\033\016k\033\017", /*kappa*/ "\0", /*blank*/ "T\b\033\016S\033\017", /*pi*/ "@", /*at-sign*/ "\033\016U\033\017", /*down arrow*/ "\0", /*blank*/ "\033\016A\033\017", /*alpha*/ "|", /*or*/ "l\b/", /*chi*/ "\"", /*"*/ "\033\016E\033\017", /*epsilon*/ "=", /*=*/ "\033\016O\033\017", /*omicron*/ "\033\016[\033\017", /*left arrow*/ "\033\016R\033\017", /*rho*/ "\033\016Y\033\017", /*up arrow*/ "\033\016N\033\017", /*tau*/ "_", /*underrule*/ "\\", /*\*/ "I\b\033\016(\033\017", /*Psi*/ "\033\016O\bJ\033\017", /*bell system sign*/ "\033\016W\bX\033\017", /*infinity*/ "`\b/", /*gamma*/ "\033\016X\bF\033\017", /*improper superset*/ "\033\016A\033\017", /*proportional to*/ "\033\016\\\b]\033\017", /*right hand*/ "\033\016W\033\017", /*omega*/ "\0", /*blank*/ "\033\016G\033\017", /*gradient*/ "\0", /*blank*/ "I\033\016\bO\033\017", /*Phi*/ "O\b=", /*Theta*/ "O\b_", /*Omega*/ "\033\016V\033\017", /*cup (union)*/ "\033\016@\033\017", /*root en*/ "s", /*terminal sigma*/ "\033\016)\bK\033\017", /*Lambda*/ "-", /*minus*/ "\033\016S\bK\033\017", /*Gamma*/ "\033\016i\033\017", /*integral sign*/ "\033\016t\b'\033\017", /*Pi*/ "\033\016Z\033\017", /*subset of*/ "\033\016X\033\017", /*superset of*/ "\033\016T\033\017", /*approximates*/ "o\b`", /*partial derivative*/ "\033\016H\033\017", /*Delta*/ "\033\016I\b'\033\017", /*square root*/ ">\b\033\016F\b@\033\017", /*Sigma*/ "\033\016T\bF\033\017", /*approx =*/ "\0", /*blank*/ ">", /*>*/ "\033\016_\bF\b@\033\017", /*Xi*/ "<", /*<*/ "/", /*slash (longer)*/ "\033\016C\033\017", /*cap (intersection)*/ "\033\016y\033\017", /*Upsilon*/ "\033\016|\033\017", /*not*/ "|", /*right ceiling (rt of ")*/ "|", /*left top (of big curly)*/ "|", /*bold vertical*/ "|", /*left center of big curly bracket*/ "|", /*left bottom*/ "|", /*right top*/ "|", /*right center of big curly bracket*/ "|", /*right bot*/ "|", /*right floor (rb of ")*/ "|", /*left floor (left bot of big sq bract)*/ "|", /*left ceiling (lt of ")*/ "\033\016=\033\017", /*multiply*/ "\033\016+\033\017", /*divide*/ "+\b_", /*plus-minus*/ "\033\016$\033\017", /*<=*/ "\033\016^\033\017", /*>=*/ "=\b_", /*identically equal*/ "\033\016*\033\017", /*not equal*/ "{", /*{*/ "}", /*}*/ "\'", /*' acute accent*/ "`", /*` grave accent*/ "^", /*^*/ "#", /*sharp*/ "\033\016|\b[\033\017", /*left hand*/ "\033\016c\b_\033\017", /*member of*/ "~", /*~*/ "\033\016O\b/\033\017", /*empty set*/ "\0", /*blank*/ "\033\016%\bM\033\017", /*dbl dagger*/ "|", /*box rule*/ "*", /*asterisk*/ "\033\016Z\bF\033\017", /*improper subset*/ "\033\016O\033\017", /*circle*/ "\0", /*blank*/ "+", /*eqn plus*/ "\033\016]\033\017", /*right arrow*/ "g\b\033\016C\033\017" }; /*section mark*/ equal*/ "{", /*{*/ "}", /*}*/ "\'", cmd/tee.c 444 0 33 2646 2416240250 5520 static char *sccsid = "@(#)tee.c 4.1 (Berkeley) 10/1/80"; /* * tee-- pipe fitting */ #include #include #include #include #include #define BUFSIZ BSIZE 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); return; } } out[p++] = in[r++]; } stash(p); } } stash(p) { int k; int i; int d; d = t ? 16 : p; for(i=0; i #include #include #define EQ(a,b) ((tmp=a)==0?0:(strcmp(tmp,b)==0)) #define DIR 1 #define FIL 2 int ap; int ac; char **av; char *tmp; main(argc, argv) char *argv[]; { ac = argc; av = argv; ap = 1; if(EQ(argv[0],"[")) { if(!EQ(argv[--ac],"]")) synbad("] missing",""); } argv[ac] = 0; if (ac<=1) exit(1); exit(exp()?0:1); } char *nxtarg(mt) { if (ap>=ac) { if(mt) { ap++; return(0); } synbad("argument expected",""); } return(av[ap++]); } exp() { int p1; p1 = e1(); if (EQ(nxtarg(1), "-o")) return(p1 | exp()); ap--; return(p1); } e1() { int p1; p1 = e2(); if (EQ(nxtarg(1), "-a")) return (p1 & e1()); ap--; return(p1); } e2() { if (EQ(nxtarg(0), "!")) return(!e3()); ap--; return(e3()); } e3() { int p1; register char *a; char *p2; int int1, int2; a=nxtarg(0); if(EQ(a, "(")) { p1 = exp(); if(!EQ(nxtarg(0), ")")) synbad(") expected",""); return(p1); } if(EQ(a, "-r")) return(tio(nxtarg(0), 0)); if(EQ(a, "-w")) return(tio(nxtarg(0), 1)); if(EQ(a, "-d")) return(ftype(nxtarg(0))==DIR); if(EQ(a, "-f")) return(ftype(nxtarg(0))==FIL); if(EQ(a, "-s")) return(fsizep(nxtarg(0))); if(EQ(a, "-t")) if(ap>=ac) return(isatty(1)); else return(isatty(atoi(nxtarg(0)))); if(EQ(a, "-n")) return(!EQ(nxtarg(0), "")); if(EQ(a, "-z")) return(EQ(nxtarg(0), "")); p2 = nxtarg(1); if (p2==0) return(!EQ(a,"")); if(EQ(p2, "=")) return(EQ(nxtarg(0), a)); if(EQ(p2, "!=")) return(!EQ(nxtarg(0), a)); if(EQ(a, "-l")) { int1=length(p2); p2=nxtarg(0); } else{ int1=atoi(a); } int2 = atoi(nxtarg(0)); if(EQ(p2, "-eq")) return(int1==int2); if(EQ(p2, "-ne")) return(int1!=int2); if(EQ(p2, "-gt")) return(int1>int2); if(EQ(p2, "-lt")) return(int1=int2); if(EQ(p2, "-le")) return(int1<=int2); synbad("unknown operator ",p2); } tio(a, f) char *a; int f; { f = open(a, f); if (f>=0) { close(f); return(1); } return(0); } ftype(f) char *f; { struct stat statb; if(stat(f,&statb)<0) return(0); if((statb.st_mode&S_IFMT)==S_IFDIR) return(DIR); return(FIL); } fsizep(f) char *f; { struct stat statb; if(stat(f,&statb)<0) return(0); return(statb.st_size>0); } synbad(s1,s2) char *s1, *s2; { write(2, "test: ", 6); write(2, s1, strlen(s1)); write(2, s2, strlen(s2)); write(2, "\n", 1); exit(255); } length(s) char *s; { char *es=s; while(*es++); return(es-s-1); } =0) { close(f); return(1); } return(0); } ftype(f) char *f; { struct stat statb; if(stat(f,&statb)<0) return(0); if((statb.st_mode&S_IFMT)==S_IFDIR) return(DIR); return(FIL); } fsizep(f) char *f; { struct stat statb; if(stat(f,&statb)<0) return(0); return(statb.st_size>0); } synbad(s1,s2) char *s1, *s2; { write(2, "test: ", 6); write(2, s1, strlen(s1)); write(2, s2, strlen(s2)); write(2, "\n", 1); exit(255); } length(s) char *s; { char *es=cmd/tset/ 775 0 33 0 2552571030 5471 cmd/tset/makefile 644 0 33 216 2421027630 7230 DESTDIR= CFLAGS=-O tset: tset.c ${CC} ${CFLAGS} tset.c -o tset -ltermlib install: install -s tset ${DESTDIR}/usr/ucb clean: rm -f *.o tset < a9le (02552571030tfix b< a9 the00000005471 the portable c compiler (PC), * or pTrees (PTREE)? */ #define OBJ #undef PC #undef PTREE /* * am i the vax or the pdp11 version */ #define VAX #undef PDP11 #define DEC11 /* * am i r pxp? / C. /,"cmd/tset/tset.c 644 0 33 66773 2506526761 6754 /* # define DEB /* ** TSET -- set terminal modes ** ** This program does sophisticated terminal initialization. ** I recommend that you include it in your .start_up or .login ** file to initialize whatever terminal you are on. ** ** There are several features: ** ** A special file or sequence (as controlled by the ttycap file) ** is sent to the terminal. ** ** Mode bits are set on a per-terminal_type basis (much better ** than UNIX itself). This allows special delays, automatic ** tabs, etc. ** ** Erase and Kill characters can be set to whatever you want. ** Default is to change erase to control-H on a terminal which ** can overstrike, and leave it alone on anything else. Kill ** is always left alone unless specifically requested. These ** characters can be represented as "^X" meaning control-X; ** X is any character. ** ** Terminals which are dialups or plugboard types can be aliased ** to whatever type you may have in your home or office. Thus, ** if you know that when you dial up you will always be on a ** TI 733, you can specify that fact to tset. You can represent ** a type as "?type". This will ask you what type you want it ** to be -- if you reply with just a newline, it will default ** to the type given. ** ** The htmp file, used by ex, etc., can be updated. ** ** The current terminal type can be queried. ** ** Usage: ** tset [-] [-EC] [-eC] [-kC] [-s] [-h] [-u] [-r] ** [-m [ident] [test baudrate] :type] ** [-Q] [-I] [-S] [type] ** ** In systems with environments, use: ** `tset -s ...` ** Actually, this doesn't work because of a shell bug. ** Instead, use: ** tset -s ... > tset.tmp ** source tset.tmp ** rm tset.tmp ** or: ** set noglob ** set term=(`tset -S ....`) ** setenv TERM $term[1] ** setenv TERMCAP "$term[2]" ** unset term ** unset noglob ** ** Positional Parameters: ** type -- the terminal type to force. If this is ** specified, initialization is for this ** terminal type. ** ** Flags: ** - -- report terminal type. Whatever type is ** decided on is reported. If no other flags ** are stated, the only affect is to write ** the terminal type on the standard output. ** -r -- report to user in addition to other flags. ** -EC -- set the erase character to C on all terminals ** except those which cannot backspace (e.g., ** a TTY 33). C defaults to control-H. ** -eC -- set the erase character to C on all terminals. ** C defaults to control-H. If neither -E or -e ** are specified, the erase character is set to ** control-H if the terminal can both backspace ** and not overstrike (e.g., a CRT). If the erase ** character is NULL (zero byte), it will be reset ** to '#' if nothing else is specified. ** -kC -- set the kill character to C on all terminals. ** Default for C is control-X. If not specified, ** the kill character is untouched; however, if ** not specified and the kill character is NULL ** (zero byte), the kill character is set to '@'. ** -iC -- reserved for setable interrupt character. ** -qC -- reserved for setable quit character. ** -m -- map the system identified type to some user ** specified type. The mapping can be baud rate ** dependent. This replaces the old -d, -p flags. ** (-d type -> -m dialup:type) ** (-p type -> -m plug:type) ** Syntax: -m identifier [test baudrate] :type ** where: ``identifier'' is whatever is found in ** /etc/ttytype for this port, (abscence of an identifier ** matches any identifier); ``test'' may be any combination ** of > = < ! @; ``baudrate'' is as with stty(((1); ** ``type'' is the actual terminal type to use if the ** mapping condition is met. Multiple maps are scanned ** in order and the first match prevails. ** -h -- don't read htmp file. Normally the terminal type ** is determined by reading the htmp file or the ** environment (unless some mapping is specified). ** This forces a read of the ttytype file -- useful ** when htmp is somehow wrong. ** -u -- don't update htmp. It seemed like this should ** be put in. Note that htmp is never actually ** written if there are no changes, so don't bother ** bother using this for efficiency reasons alone. ** -s -- output setenv commands for TERM. This can be ** used with ** `tset -s ...` ** and is to be prefered to: ** setenv TERM `tset - ...` ** because -s sets the TERMCAP variable also. ** -S -- Similar to -s but outputs 2 strings suitable for ** use in csh .login files as follows: ** set noglob ** set term=(`tset -S .....`) ** setenv TERM $term[1] ** setenv TERMCAP "$term[2]" ** unset term ** unset noglob ** -Q -- be quiet. don't output 'Erase set to' etc. ** -I -- don't do terminal initialization (is & if ** strings). ** ** Files: ** /etc/ttytype ** contains a terminal id -> terminal type ** mapping; used when any user mapping is specified, ** or the environment doesn't have TERM set. ** /etc/termcap ** a terminal_type -> terminal_capabilities ** mapping. ** ** Return Codes: ** -1 -- couldn't open ttycap. ** 1 -- bad terminal type, or standard output not tty. ** 0 -- ok. ** ** Defined Constants: ** DIALUP -- the type code for a dialup port ** PLUGBOARD -- the code for a plugboard port. ** ARPANET -- the code for an arpanet port. ** BACKSPACE -- control-H, the default for -e. ** CONTROLX -- control-X, the default for -k. ** OLDERASE -- the system default erase character. ** OLDKILL -- the system default kill character. ** FILEDES -- the file descriptor to do the operation ** on, nominally 1 or 2. ** STDOUT -- the standard output file descriptor. ** UIDMASK -- the bit pattern to mask with the getuid() ** call to get just the user id. ** GTTYN -- defines file containing generalized ttynames ** and compiles code to look there. ** ** Requires: ** Routines to handle htmp, ttytype, and ttycap. ** ** Compilation Flags: ** OLDDIALUP -- accept the -d flag. Map "sd" to "dialup". ** OLDPLUGBOARD -- accept the -p flag. Map "sp" to "plugboard". ** OLDARPANET -- accept the -a flag. Map "sa" to "arpanet". ** OLDFLAGS -- must be defined to compile code for any of ** the -d, -p, or -a flags. ** FULLLOGIN -- if defined, login sets the ttytype from ** /etc/ttytype file. ** V6 -- if clear, use environments, not htmp. ** also use TIOCSETN rather than stty to avoid flushing ** GTTYN -- if set, compiles code to look at /etc/ttytype. ** ** Trace Flags: ** none ** ** Diagnostics: ** Bad flag ** An incorrect option was specified. ** Too few args ** more command line arguments are required. ** Unexpected arg ** wrong type of argument was encountered. ** Cannot open ... ** The specified file could not be openned. ** Type ... unknown ** An unknown terminal type was specified. ** Cannot update htmp ** Cannot update htmp file when the standard ** output is not a terminal. ** Erase set to ... ** Telling that the erase character has been ** set to the specified character. ** Kill set to ... ** Ditto for kill ** Erase is ... Kill is ... ** Tells that the erase/kill characters were ** wierd before, but they are being left as-is. ** Not a terminal ** Set if FILEDES is not a terminal. ** ** Compilation Instructions: ** cc -n -O tset.c -ltermlib ** mv a.out tset ** chown bin tset ** chmod 4755 tset ** ** where 'bin' should be whoever owns the 'htmp' file. ** If 'htmp' is 666, then tset need not be setuid. ** ** Author: ** Eric Allman ** Electronics Research Labs ** U.C. Berkeley ** ** History: ** 7/80 -- '-S' added. -m mapping added. TERMCAP string ** cleaned up. ** 3/80 -- Changed to use tputs. Prc & flush added. ** 10/79 -- '-s' option extended to handle TERMCAP ** variable, set noglob, quote the entry, ** and know about the Bourne shell. Terminal ** initialization moved to before any information ** output so screen clears would not screw you. ** '-Q' option added. ** 8/79 -- '-' option alone changed to only output ** type. '-s' option added. 'VERSION7' ** changed to 'V6' for compatibility. ** 12/78 -- modified for eventual migration to VAX/UNIX, ** so the '-' option is changed to output only ** the terminal type to STDOUT instead of ** FILEDES. FULLLOGIN flag added. ** 9/78 -- '-' and '-p' options added (now fully ** compatible with ttytype!), and spaces are ** permitted between the -d and the type. ** 8/78 -- The sense of -h and -u were reversed, and the ** -f flag is dropped -- same effect is available ** by just stating the terminal type. ** 10/77 -- Written. */ /* # define FULLLOGIN 1 */ # ifndef V6 # define GTTYN "/etc/ttytype" # endif # include # include # include # define BACKSPACE ('H' & 037) # define CONTROLX ('X' & 037) # define OLDERASE '#' # define OLDKILL '@' # define FILEDES 2 # define STDOUT 1 # ifdef V6 # define UIDMASK 0377 # else # define UIDMASK -1 # endif # define DEFTYPE "unknown" # define USAGE\ "usage: tset [-] [-hrsuIQS] [-eC] [-kC] [-m [ident][test speed]:type] [type]\n" # define DIALUP "dialup" # define OLDDIALUP "sd" # define PLUGBOARD "plugboard" # define OLDPLUGBOARD "sp" /*** # define ARPANET "arpanet" # define OLDARPANET "sa" ***/ # define OLDFLAGS # ifdef GTTYN typedef char *ttyid_t; # define NOTTY 0 # else typedef char ttyid_t; # define NOTTY 'x' # endif /* * Baud Rate Conditionals */ # define ANY 0 # define GT 1 # define EQ 2 # define LT 4 # define GE (GT|EQ) # define LE (LT|EQ) # define NE (GT|LT) # define ALL (GT|EQ|LT) # define NMAP 10 struct map { char *Ident; char Test; char Speed; char *Type; } map[NMAP]; struct map *Map = map; struct { char *string; int speed; } speeds[] = { "0", B0, "50", B50, "75", B75, "110", B110, "134", B134, "134.5",B134, "150", B150, "200", B200, "300", B300, "600", B600, "1200", B1200, "1800", B1800, "2400", B2400, "4800", B4800, "9600", B9600, "exta", EXTA, "extb", EXTB, 0, }; char Erase_char; /* new erase character */ char Kill_char; /* new kill character */ char Specialerase; /* set => Erase_char only on terminals with backspace */ ttyid_t Ttyid = NOTTY; /* terminal identifier */ char *TtyType; /* type of terminal */ char *DefType; /* default type if none other computed */ char *NewType; /* mapping identifier based on old flags */ int Dash_u; /* don't update htmp */ int Dash_h; /* don't read htmp */ int DoSetenv; /* output setenv commands */ int BeQuiet; /* be quiet */ int NoInit; /* don't output initialization string */ int Report; /* report current type */ int Ureport; /* report to user */ int RepOnly; /* report only */ int CmndLine; /* output full command lines (-s option) */ int Ask; /* ask user for termtype */ # define CAPBUFSIZ 1024 char Capbuf[CAPBUFSIZ]; /* line from /etc/termcap for this TtyType */ char *Ttycap; /* termcap line from termcap or environ */ struct delay { int d_delay; int d_bits; }; # include "tset.delays.h" main(argc, argv) int argc; char *argv[]; { struct sgttyb mode; struct sgttyb oldmode; char buf[256]; auto char *bufp; register char *p; char *command; register int i; int Break; int Not; int Mapped; extern char *nextarg(); extern char *mapped(); # ifdef V6 extern char *hsgettype(); # else extern char *getenv(); # endif # ifdef GTTYN extern char *stypeof(); extern char *ttyname(); extern char *tgetstr(); # endif char bs_char; int csh; extern prc(); extern char PC; extern short ospeed; if (gtty(FILEDES, &mode) < 0) { prs("Not a terminal\n"); exit(1); } bmove(&mode, &oldmode, sizeof mode); ospeed = mode.sg_ospeed; /* scan argument list and collect flags */ command = argv[0]; if (argc == 2 && argv[1][0] == '-' && argv[1][1] == '\0') { RepOnly++; Dash_u++; } argc--; while (--argc >= 0) { p = *++argv; if (*p == '-') { if (*++p == NULL) Report++; /* report current terminal type */ else while (*p) switch (*p++) { case 'r': /* report to user */ Ureport++; continue; case 'E': /* special erase: operate on all but TTY33 */ Specialerase++; /* explicit fall-through to -e case */ case 'e': /* erase character */ if (*p == NULL) Erase_char = -1; else { if (*p == '^' && p[1] != NULL) Erase_char = *++p & 037; else Erase_char = *p; p++; } continue; case 'k': /* kill character */ if (*p == NULL) Kill_char = CONTROLX; else { if (*p == '^' && p[1] != NULL) Kill_char = *++p & 037; else Kill_char = *p; p++; } continue; # ifdef OLDFLAGS # ifdef OLDDIALUP case 'd': /* dialup type */ NewType = DIALUP; goto mapold; # endif # ifdef OLDPLUGBOARD case 'p': /* plugboard type */ NewType = PLUGBOARD; goto mapold; # endif # ifdef OLDARPANET case 'a': /* arpanet type */ Newtype = ARPANET; goto mapold; # endif mapold: Map->Ident = NewType; Map->Test = ALL; if (*p == NULL) { p = nextarg(argc--, argv++); } Map->Type = p; Map++; Mapped++; p = ""; continue; # endif case 'm': /* map identifier to type */ /* This code is very loose. Almost no ** syntax checking is done!! However, ** illegal syntax will only produce ** weird results. */ if (*p == NULL) { p = nextarg(argc--, argv++); } if (isalnum(*p)) { Map->Ident = p; /* identifier */ while (isalnum(*p)) p++; } else Map->Ident = ""; Break = 0; Not = 0; while (!Break) switch (*p) { case NULL: p = nextarg(argc--, argv++); continue; case ':': /* mapped type */ *p++ = NULL; Break++; continue; case '>': /* conditional */ Map->Test ((|= GT; *p++ = NULL; continue; case '<': /* conditional */ Map->Test |= LT; *p++ = NULL; continue; case '=': /* conditional */ case '@': Map->Test |= EQ; *p++ = NULL; continue; case '!': /* invert conditions */ Not = ~Not; *p++ = NULL; continue; case 'B': /* Baud rate */ p++; /* intentional fallthru */ default: if (isdigit(*p) || *p == 'e') { Map->Speed = baudrate(p); while (isalnum(*p) || *p == '.') p++; } else Break++; continue; } if (Not) /* invert sense of test */ { Map->Test = (~(Map->Test))&ALL; } if (*p == NULL) { p = nextarg(argc--, argv++); } Map->Type = p; p = ""; Map++; Mapped++; continue; case 'h': /* don't get type from htmp or env */ Dash_h++; continue; case 'u': /* don't update htmp */ Dash_u++; continue; case 's': /* output setenv commands */ DoSetenv++; CmndLine++; continue; case 'S': /* output setenv strings */ DoSetenv++; CmndLine=0; continue; case 'Q': /* be quiet */ BeQuiet++; continue; case 'I': /* no initialization */ NoInit++; continue; case 'A': /* Ask user */ Ask++; continue; default: *p-- = NULL; fatal("Bad flag -", p); } } else { /* terminal type */ DefType = p; } } if (DefType) { if (Mapped) { Map->Ident = ""; /* means "map any type" */ Map->Test = ALL; /* at all baud rates */ Map->Type = DefType; /* to the default type */ } else TtyType = DefType; } # ifndef V6 /* get current idea of terminal type from environment */ if (!Dash_h && !Mapped && TtyType == 0) TtyType = getenv("TERM"); # endif /* determine terminal id if needed */ # ifdef V6 if (Ttyid == NOTTY && (TtyType == 0 || !Dash_h || !Dash_u)) Ttyid = ttyn(FILEDES); # else if (!RepOnly && Ttyid == NOTTY && (TtyType == 0 || !Dash_h)) Ttyid = ttyname(FILEDES); # endif # ifdef V6 /* get htmp if ever used */ if (!Dash_u || (TtyType == 0 && !Dash_h)) { /* get htmp entry -- if error or wrong user use ttytype */ if (Ttyid == NOTTY || hget(Ttyid) < 0 || hgettype() == 0 || hgetuid() != (getuid() & UIDMASK)) Dash_h++; } /* find terminal type (if not already known) */ if (TtyType == 0 && !Dash_h) { /* get type from /etc/htmp */ TtyType = hsgettype(); } # endif # ifdef GTTYN /* If still undefined, look at /etc/ttytype */ if (TtyType == 0) { TtyType = stypeof(Ttyid); } # endif /* If still undefined, use DEFTYPE */ if (TtyType == 0) { TtyType = DEFTYPE; } /* check for dialup or other mapping */ if (Mapped) TtyType = mapped(TtyType, ospeed); /* TtyType now contains a pointer to the type of the terminal */ /* If the first character is '?', ask the user */ if (TtyType[0] == '?') { Ask++; TtyType++; if (TtyType[0] == '\0') TtyType = DEFTYPE; } if (Ask) { prs("TERM = ("); prs(TtyType); prs(") "); flush(); /* read the terminal. If not empty, set type */ i = read(2, buf, sizeof buf - 1); if (i >= 0) { if (buf[i - 1] == '\n') i--; buf[i] = '\0'; if (buf[0] != '\0') TtyType = buf; } } if (Ttycap == 0) { /* get terminal capabilities */ switch (tgetent(Capbuf, TtyType)) { case -1: prs("Cannot open termcap file\n"); flush(); exit(-1); case 0: prs("Type "); prs(TtyType); prs(" unknown\n"); flush(); exit(1); } Ttycap = Capbuf; } if (!RepOnly) { /* determine erase and kill characters */ if (Specialerase && !tgetflag("bs")) Erase_char = 0; bufp = buf; p = tgetstr("kb", &bufp); if (p == NULL || p[1] != '\0') p = tgetstr("bc", &bufp); if (p != NULL && p[1] == '\0') bs_char = p[0]; else if (tgetflag("bs")) bs_char = BACKSPACE; else bs_char = 0; if (Erase_char == 0 && !tgetflag("os") && mode.sg_erase == OLDERASE) { if (tgetflag("bs") || bs_char != 0) Erase_char = -1; } if (Erase_char < 0) Erase_char = (bs_char != 0) ? bs_char : BACKSPACE; if (mode.sg_erase == 0) mode.sg_erase = OLDERASE; if (Erase_char != 0) mode.sg_erase = Erase_char; if (mode.sg_kill == 0) mode.sg_kill = OLDKILL; if (Kill_char != 0) mode.sg_kill = Kill_char; /* set modes */ setdelay("dC", CRdelay, CRbits, &mode.sg_flags); setdelay("dN", NLdelay, NLbits, &mode.sg_flags); setdelay("dB", BSdelay, BSbits, &mode.sg_flags); setdelay("dF", FFdelay, FFbits, &mode.sg_flags); setdelay("dT", TBdelay, TBbits, &mode.sg_flags); if (tgetflag("UC") || command[0] == 'T') mode.sg_flags |= LCASE; else if (tgetflag("LC")) mode.sg_flags &= ~LCASE; mode.sg_flags &= ~(EVENP | ODDP | RAW); # ifndef V6 mode.sg_flags &= ~CBREAK; # endif if (tgetflag("EP")) mode.sg_flags |= EVENP; if (tgetflag("OP")) mode.sg_flags |= ODDP; if ((mode.sg_flags & (EVENP | ODDP)) == 0) mode.sg_flags |= EVENP | ODDP; mode.sg_flags |= CRMOD | ECHO | XTABS; if (tgetflag("NL")) /* new line, not line feed */ mode.sg_flags &= ~CRMOD; if (tgetflag("HD")) /* half duplex */ mode.sg_flags &= ~ECHO; if (tgetflag("pt")) /* print tabs */ mode.sg_flags &= ~XTABS; if (!bequal(&mode, &oldmode, sizeof mode)) # ifndef V6 ioctl(FILEDES, TIOCSETN, &mode); # else stty(FILEDES, &mode); # endif /* get pad character */ bufp = buf; if (tgetstr("pc", &bufp) != 0) PC = buf[0]; /* output startup string */ if (!NoInit) { bufp = buf; if (tgetstr("is", &bufp) != 0) tputs(buf, 0, prc); flush(); bufp = buf; if (tgetstr("if", &bufp) != 0) cat(buf); sleep(1); /* let terminal settle down */ } /* set up environment for the shell we are using */ /* (this code is rather heuristic) */ csh = 0; if (DoSetenv) { # ifndef V6 char *sh; if ((sh = getenv("SHELL")) && (i = strlen(sh)) >= 3) { p = &sh[i-3]; if ((csh = sequal(p, "csh")) && CmndLine) write(STDOUT, "set noglob;\n", 12); } if (!csh) # endif /* running system shell */ write(STDOUT, "export TERMCAP TERM;\n", 21); } } /* report type if appropriate */ if (DoSetenv || Report || Ureport) { /* find first alias (if any) */ for (p = Ttycap; *p != 0 && *p != '|' && *p != ':'; p++) continue; if (*p == 0 || *p == ':') p = Ttycap; else p++; bufp = p; while (*p != '|' && *p != ':' && *p != 0) p++; i = *p; if (DoSetenv) { if (csh) { if (CmndLine) write(STDOUT, "setenv TERM ", 12); write(STDOUT, bufp, p - bufp); write(STDOUT, " ", 1); if (CmndLine) write(STDOUT, ";\n", 2); } else { write(STDOUT, "TERM=", 5); write(STDOUT, bufp, p - bufp); write(STDOUT, ";\n", 2); } } if (Report && !DoSetenv) { write(STDOUT, bufp, p - bufp); write(STDOUT, "\n", 1); } if (Ureport) { *p = '\0'; prs("Terminal type is "); prs(bufp); prs("\n"); flush(); } *p = i; if (DoSetenv) { if (csh) { if (CmndLine) write(STDOUT, "setenv TERMCAP '", 16); } else write(STDOUT, "TERMCAP='", 9); wrtermcap(Ttycap); if (csh) { if (CmndLine) { write(STDOUT, "';\n", 3); write(STDOUT, "unset noglob;\n", 14); } } else write(STDOUT, "';\n", 3); } } if (RepOnly) exit(0); /* tell about changing erase and kill characters */ reportek("Erase", mode.sg_erase, oldmode.sg_erase, OLDERASE); reportek("Kill", mode.sg_kill, oldmode.sg_kill, OLDKILL); # ifdef V6 /* update htmp */ if (!Dash_u) { if (Ttyid == 0) Ttyid = ttyn(FILEDES); if (Ttyid == 'x') { prs("Cannot update htmp\n"); flush(); } else { /* update htmp file only if changed */ if (!bequal(Capbuf, hsgettype(), 2)) { hsettype(Capbuf[0] | (Capbuf[1] << 8)); hput(Ttyid); } } } # endif exit(0); } reportek(name, new, old, def) char *name; char old; char new; char def; { register char o; register char n; register char *p; if (BeQuiet) return; o = old; n = new; if (o == n && n == def) return; prs(name); if (o == n) prs(" is "); else prs(" set to "); if (n < 040) { prs("control-"); n = (n & 037) | 0100; } else if (n == 0177) { prs("delete\n"); flush(); return; } p = "x\n"; p[0] = n; prs(p); flush(); } setdelay(cap, dtab, bits, flags) char *cap; struct delay dtab[]; int bits; int *flags; { register int i; register struct delay *p; /* see if this capability exists at all */ i = tgetnum(cap); if (i < 0) i = 0; /* clear out the bits, replace with new ones */ *flags &= ~bits; /* scan dtab for first entry with adequate delay */ for (p = dtab; p->d_delay >= 0; p++) { if (p->d_delay >= i) { p++; break; } } /* use last entry if none will do */ *flags |= (--p)->d_bits; } prs(s) char *s; { while (*s != '\0') prc(*s++); } char OutBuf[256]; int OutPtr; prc(c) char c; { OutBuf[OutPtr++] = c; if (OutPtr >= sizeof OutBuf) flush(); } flush() { if (OutPtr > 0) write(2, OutBuf, OutPtr); OutPtr = 0; } cat(file) char *file; { register int fd; register int i; char buf[BUFSIZ]; fd = open(file, 0); if (fd < 0) { prs("Cannot open "); prs(file); prs("\n"); flush(); exit(-1); } flush(); while ((i = read(fd, buf, BUFSIZ)) > 0) write(FILEDES, buf, i); close(fd); } bmove(from, to, length) char *from; char *to; int length; { register char *p, *q; register int i; i = length; p = from; q = to; while (i-- > 0) *q++ = *p++; } bequal(a, b, len) char *a; char *b; int len; { register char *p, *q; register int i; i = len; p = a; q = b; while (*p && *q && (*p == *q) && --i > 0) { p++; q++; } return ((*p == *q) && i >= 0); } sequal(a, b) char *a; char *b; { register char *p = a, *q = b; while (*p && *q && (*p == *q)) { p++; q++; } return (*p == *q); } # ifdef GTTYN char * stypeof(ttyid) char *ttyid; { static char typebuf[50]; register char *PortType; register char *PortName; register char *TtyId; register char *p; register FILE *f; if (ttyid == NOTTY) return (DEFTYPE); f = fopen(GTTYN, "r"); if (f == NULL) return (DEFTY((PE); /* split off end of name */ TtyId = ttyid; while (*ttyid) if (*ttyid++ == '/') TtyId = ttyid; /* scan the file */ while (fgets(typebuf, sizeof typebuf, f) != NULL) { p = PortType = typebuf; while (*p && isalnum(*p)) p++; *p++ = NULL; /* skip separator */ while (*p && !isalnum(*p)) p++; PortName = p; /* put NULL at end of name */ while (*p && isalnum(*p)) p++; *p = NULL; /* check match on port name */ if (sequal(PortName, TtyId)) /* found it */ { # ifdef OLDDIALUP if (sequal(PortType, OLDDIALUP)) PortType = DIALUP; # endif # ifdef OLDPLUGBOARD if (sequal(PortType, OLDPLUGBOARD)) PortType = PLUGBOARD; # endif # ifdef OLDARPANET if (sequal(PortType, OLDARPANET)) PortType = ARPANET; # endif fclose (f); return(PortType); } } fclose (f); return (DEFTYPE); } # endif #define YES 1 #define NO 0 /* * routine to output the string for the environment TERMCAP variable */ #define WHITE(c) (c == ' ' || c == '\t') char delcap[128][2]; int ncap = 0; wrtermcap(bp) char *bp; { char buf[CAPBUFSIZ]; char *p = buf; char *tp; char *putbuf(); int space, empty; /* discard names with blanks */ /** May not be desireable ? **/ while (*bp && *bp != ':') { if (*bp == '|') { tp = bp+1; space = NO; while (*tp && *tp != '|' && *tp != ':') { space = (space || WHITE(*tp) ); tp++; } if (space) { bp = tp; continue; } } *p++ = *bp++; } /**/ while (*bp) { switch (*bp) { case ':': /* discard empty, cancelled or dupl fields */ tp = bp+1; empty = YES; while (*tp && *tp != ':') { empty = (empty && WHITE(*tp) ); tp++; } if (empty || cancelled(bp+1)) { bp = tp; continue; } break; case ' ': /* no spaces in output */ p = putbuf(p, "\\040"); bp++; continue; case '"': /* no quotes in output */ p = putbuf(p, "\\042"); bp++; continue; case '\'': /* no quotes in output */ p = putbuf(p, "\\047"); bp++; continue; case '\\': case '^': /* anything following is OK */ *p++ = *bp++; } *p++ = *bp++; } write (STDOUT, buf, p-buf); } cancelled(cap) char *cap; { register int i; for (i = 0; i < ncap; i++) { if (cap[0] == delcap[i][0] && cap[1] == delcap[i][1]) return (YES); } /* delete a second occurrance of the same capability */ delcap[ncap][0] = cap[0]; delcap[ncap][1] = cap[1]; ncap++; return (cap[2] == '@'); } char * putbuf(ptr, str) char *ptr; char *str; { while (*str) *ptr++ = *str++; return (ptr); } baudrate(p) char *p; { char buf[8]; int i = 0; while (i < 7 && (isalnum(*p) || *p == '.')) buf[i++] = *p++; buf[i] = NULL; for (i=0; speeds[i].string; i++) if (sequal(speeds[i].string, buf)) return (speeds[i].speed); return (-1); } char * mapped(type, speed) char *type; short speed; { int match; # ifdef DEB printf ("spd:%d\n", speed); prmap(); # endif Map = map; while (Map->Ident) { if (*(Map->Ident) == NULL || bequal(Map->Ident, type, 4)) { match = NO; switch (Map->Test) { case ANY: /* no test specified */ case ALL: match = YES; break; case GT: match = (speed > Map->Speed); break; case GE: match = (speed >= Map->Speed); break; case EQ: match = (speed == Map->Speed); break; case LE: match = (speed <= Map->Speed); break; case LT: match = (speed < Map->Speed); break; case NE: match = (speed != Map->Speed); break; } if (match) return (Map->Type); } Map++; } /* no match found; return given type */ return (type); } # ifdef DEB prmap() { Map = map; while (Map->Ident) { printf ("%s t:%d s:%d %s\n", Map->Ident, Map->Test, Map->Speed, Map->Type); Map++; } } # endif char * nextarg(argc, argv) int argc; char *argv[]; { if (argc <= 0) fatal ("Too few args: ", *argv); if (*(*++argv) == '-') fatal ("Unexpected arg: ", *argv); return (*argv); } fatal (mesg, obj) char *mesg; char *obj; { prs (mesg); prs (obj); prc ('\n'); prs (USAGE); flush(); exit(1); } atch cmd/tset/tset.delays.h 644 0 33 2150 2371076331 10165 /* ** SYSTEM DEPENDENT TERMINAL DELAY TABLES ** ** Evans Hall VAX ** ** This file maintains the correspondence between the delays ** defined in /etc/termcap and the delay algorithms on a ** particular system. For each type of delay, the bits used ** for that delay must be specified (in XXbits) and a table ** must be defined giving correspondences between delays and ** algorithms. Algorithms which are not fixed delays (such ** as dependent on current column or line number) must be ** cludged in some way at this time. */ /* ** Carriage Return delays */ int CRbits = CRDELAY; struct delay CRdelay[] = { 0, CR0, 9, CR3, 80, CR1, 160, CR2, -1 }; /* ** New Line delays */ int NLbits = NLDELAY; struct delay NLdelay[] = { 0, NL0, 66, NL1, /* special M37 delay */ 100, NL2, -1 }; /* ** Back Space delays */ int BSbits = BSDELAY; struct delay BSdelay[] = { 0, BS0, -1 }; /* ** TaB delays */ int TBbits = TBDELAY; struct delay TBdelay[] = { 0, TAB0, 11, TAB1, /* special M37 delay */ -1 }; /* ** Form Feed delays */ int FFbits = VTDELAY; struct delay FFdelay[] = { 0, FF0, 2000, FF1, -1 }; , CR0, 9, CR3, 80, CR1, 160, CR2, -1 }; /* ** New Line delays */ int NLbits = NLDELAY; struct delay NLdelay[] = { 0, NL0, 66, NL1, /* special M37 delay */ 100, NL2, -1 }; /* ** Back Space delays */ int BSbits = BSDELAY; struct delay BSdelay[] = { 0, BS0, -1 }; /* ** TaB delays */ int TBbits = TBDELAY; struct delay TBdelay[] = { 0, TAB0, 11, TAB1, /* special M37 delay */ -1 }; /cmd/tk.c 444 0 33 7152 2416240254 5362 static char *sccsid = "@(#)tk.c 4.1 (Berkeley) 10/1/80"; /* * optimize output for Tek 4014 */ #include #include #define MAXY 3071 #define LINE 47 #define XOFF 248 #define US 037 #define GS 035 #define ESC 033 #define CR 015 #define FF 014 #define SO 016 #define SI 017 int pl = 66*LINE; int yyll = -1; char obuf[BUFSIZ]; int xx = XOFF; int xoff = XOFF; int coff = 0; int ncol = 0; int maxcol = 1; int yy = MAXY; int ohy = -1; int ohx = -1; int oxb = -1; int oly = -1; int olx = -1; int alpha; int ry; FILE *ttyin; main(argc, argv) int argc; char **argv; { register i, j; extern ex(); while (--argc > 0 && (++argv)[0][0]=='-') switch(argv[0][1]) { case 'p': if (i = atoi(&argv[0][2])) pl = i; yyll = MAXY + 1 - pl; break; default: if (i = atoi(&argv[0][1])) { maxcol = i; xx = xoff = 0; coff = 4096/i; } break; } if ((ttyin = fopen("/dev/tty", "r")) != NULL) setbuf(ttyin, (char *)NULL); if (argc) { if (freopen(argv[0], "r", stdin) == NULL) { fprintf(stderr, "tk: cannot open %s\n", argv[0]); exit(1); } } signal(SIGINT, ex); setbuf(stdout, obuf); ncol = maxcol; init(); while ((i = getchar()) != EOF) { switch(i) { case FF: yy = 0; case '\n': xx = xoff; yy -= LINE; alpha = 0; if (yy < yyll) { ncol++; yy = 0; sendpt(0); putchar(US); fflush(stdout); if (ncol >= maxcol) kwait(); init(); } continue; case CR: xx = xoff; alpha = 0; continue; case ' ': xx += 31; alpha = 0; continue; case '\t': /*tabstops at 8*31=248*/ j = ((xx-xoff)/248) + 1; xx += j*248 - (xx-xoff); alpha = 0; continue; case '\b': xx -= 31; alpha = 0; continue; case ESC: switch(i = getchar()) { case '7': yy += LINE; alpha = 0; continue; case '8': yy += (LINE + ry)/2; ry = (LINE + ry)%2; alpha = 0; continue; case '9': yy -= (LINE - ry)/2; ry = -(LINE - ry)%2; alpha = 0; continue; default: continue; } default: sendpt(alpha); if (alpha==0) { putchar(US); alpha = 1; } putchar(i); if (i>' ') xx += 31; continue; } } xx = xoff; yy = 0; sendpt(0); putchar(US); kwait(); ex(); } init() { ohx = oxb = olx = ohy = oly = -1; if (ncol >= maxcol) { ncol = 0; if (maxcol > 1) xoff = 0; else xoff = XOFF; } else xoff += coff; xx = xoff; yy = MAXY; if (ncol==0) fputs("\033\014\033;", stdout); sendpt(0); } ex() { yy = MAXY; xx = 0; fputs("\033;\037", stdout); sendpt(1); exit(0); } kwait() { register c; fflush(stdout); if (ttyin==NULL) return; while ((c=getc(ttyin))!='\n') { if (c=='!') { execom(); printf("!\n"); fflush(stdout); continue; } if (c==EOF) ex(); } } execom() { int (*si)(), (*sq)(); if (fork() != 0) { si = signal(SIGINT, SIG_IGN); sq = signal(SIGQUIT, SIG_IGN); wait((int *)NULL); signal(SIGINT, si); signal(SIGQUIT, sq); return; } if (isatty(fileno(stdin)) == 0) { if (freopen("/dev/tty", "r", stdin)==NULL) freopen("/dev/null", "r", stdin); } execl("/bin/sh", "sh", "-t", 0); } sendpt(a) { register zz; int hy,xb,ly,hx,lx; if (a) return; if ((zz = yy) < 0) zz = 0; hy = ((zz>>7) & 037); xb = ((xx & 03) + ((zz<<2) & 014) & 017); ly = ((zz>>2) & 037); hx = ((xx>>7) & 037); lx = ((xx>>2) & 037); putchar(GS); if (hy != ohy) putchar(hy | 040); if (xb != oxb) putchar(xb | 0140); if ((ly != oly) || (hx != ohx) || (xb != oxb)) putchar(ly | 0140); if (hx != ohx) put((char(hx | 040); putchar(lx | 0100); ohy = hy; oxb = xb; oly = ly; ohx = hx; olx = lx; alpha = 0; } t(a) { register zz; int hy,xb,ly,hx,lx; if (a) return; if ((zz = yy) < 0) zz = 0; hy = ((zz>>7) & 037); xb = ((xx & 03) + ((zz<<2) & 014) & 017); ly = ((zz>>2) & 037); hx = ((xx>>7) & 037); lx = ((xx>>2) & 037); putchar(GS); if (hy != ohy) putchar(hy | 040); if (xb != oxb) putchar(xb | 0140); if ((ly != oly) || (hx != ohx) || (xb != oxb)) putchar(ly | 0140); if (hx != ohx) putcmd/tp/ 775 0 33 0 2552567073 5151 cmd/tp/Makefile 644 0 33 235 2413341767 6650 CFLAGS=-O h = tp.h tp_defs.h o = tp0.o tp1.o tp2.o tp3.o tp : $o $(CC) -o tp $o $o : $h install : tp install -s tp ${DESTDIR}/bin clean : rm -f *.o ew 02552567073*/ in< a9ELAY00000005151ay NLdelay[] = { 0, NL0, 66, NL1, /* special M37 delay */ 100, NL2, -1 }; /* ** Back Space delays */ int BSbits = BSDELAY; struct delay BSdelay[] = { 0, BS0, -1 }; /* ** TaB ys */ i/ C. /,"cmd/tp/tp.h 644 0 33 2762 2414002465 6021 /* c-version of tp?.s * * M. Ferentz * August 1976 * * revised July 1977 BTL */ #define MDIRENT 496 /* must be zero mod 8 */ #define DIRSZ sizeof(struct dent) #define MAPSIZE 4096 #define MAPMASK 07777 #define NAMELEN 32 #define BSIZE 512 #define TCSIZ 578 #define TCDIRS 192 #define MTSIZ 32767 #define TPB (BSIZE/sizeof(struct tent)) #define OK 0100000 #define BRKINCR 512 #define tapeblk &tpentry[0] #define tapeb &tpentry[0] struct tent { /* Structure of a tape directory block */ char pathnam[NAMELEN]; short mode; char uid; char gid; char spare; char size0; unsigned short size1; long time; unsigned short tapea; /* tape address */ short unused[8]; short cksum; } tpentry[TPB]; struct dent { /* in core version of tent with "unused" removed * and pathname replaced by pointer to same in a * packed area (nameblock). */ char *d_namep; int d_mode; int d_uid; int d_gid; long d_size; long d_time; int d_tapea; } dir[MDIRENT]; char map[MAPSIZE]; char name[NAMELEN]; char name1[NAMELEN]; extern char mt[]; extern char tc[]; char *tname; extern char mheader[]; extern char theader[]; int narg, rnarg; char **parg; int wseeka,rseeka; int tapsiz; int fio; short ndirent, ndentb; struct dent *edir; struct dent *lastd; /* for improvement */ char *sbrk(); char *strcpy(); long lseek(); int (*command)(); char *nameblk; char *top; char *nptr; extern int flags; #define flc 0001 #define fli 0004 #define flm 0010 #define flu 0020 #define flv 0040 #define flw 0100 #define fls 0200 char name1[NAcmd/tp/tp0.c 644 0 33 45 2413777466 6047 #include "tp.h" #include "tp_defs.h" tc[]; char *tname; extern char mheader[]; extern char theader[]; int narg, rnarg; char **parg; int wseeka,rseeka; int tapsiz; int fio; short ndirent, ndentb; struct dent *edir; struct dent *lastd; /* for improvement */ char *sbrk(); char *strcpy(); long lseek(); int (*command)(); char *nameblk; char *top; char *nptr; extern int flags; #define flc 0001 #define fli 0004 #define/,5x< /,"cmd/tp/tp1.c 644 0 33 5722 2414002311 6062 #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(); top = nptr = nameblk = sbrk(0); (*command)(); } optap() { extern cmr(); if ((flags & flm) == 0) { /* DECTAPE */ tapsiz = TCSIZ; ndirent = TCDIRS; fio =open(tc,2); } else { /* MAGTAPE */ tapsiz = MTSIZ; ndirent = MDIRENT; if(command == cmr) { fio = open(tname,1); 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 * nptr points to next location in nameblk * dptr points to the dir entry */ char *pname; struct dent *dptr; { register char *np; register n; dptr->d_namep = np = nptr; if (np > top - NAMELEN) { if(sbrk(BRKINCR) == (char *)-1) { printf("Out of core\n"); done(); } else top += BRKINCR; } if((n=strlen(pname)) > NAMELEN) { printf("Pathname too long - %s\nFile ignored\n",pname); clrent(dptr); } else { nptr += n+1; strcpy(np, pname); } } decode(pname,dptr) /* dptr points to the dir entry * name is placed in pname[] */ char *pname; struct dent *dptr; { strcpy(pname, dptr->d_namep); } register char *np; register n; dptr->d_namcmd/tp/tp2.c 644 0 33 15046 2414002372 6112 #include "tp.h" #include #include #include #include struct direct direct; struct stat statb; clrdir() { register j, *p; j = ndirent * (DIRSZ/sizeof(int)); p = (int *)dir; do (*p++ = 0); while (--j); lastd = 0; } clrent(ptr) struct dent *ptr; { register *p, j; p = (int *)ptr; j = DIRSZ/sizeof(int); do *p++ = 0; while (--j); if (++ptr == lastd) do { if (--lastd < dir) { lastd = 0; return; } } while (lastd->d_namep == 0); } rddir() { register struct tent *tp; register struct dent *p1; struct dent *dptr; struct tent *tptr; int count, i, sum; short reg, *sp; sum = 0; clrdir(); rseek(0); tread(); /* Read the bootstrap block */ if ((tpentry[TPB-1].cksum != 0) && (flags & flm)) { ndirent = tpentry[TPB-1].cksum; if(flags & fls) swab((char *)&ndirent, (char *)&ndirent, sizeof(ndirent)); if(ndirent < 0 || ndirent > MDIRENT) ndirent = MDIRENT; ndentb = ndirent/TPB; } dptr = &dir[0]; count = ndirent; do { if ((co((unt % 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, fid; if ((fid = open(name,0)) < 0) fserr(); for (;;) { if ((n = read(fid, (char *)&direct, sizeof(direct))) != sizeof(direct)) { if (n == 0) { close(fid); return; } fserr(); } if (direct.d_ino == 0) /* null entry */ continue; p0 = name; if (direct.d_name[0] == '.') /* don't save .xxxx */ continue; while (*p0++); save0 = --p0; /* save loc of \0 */ if (p0[-1] != '/') *p0++ = '/'; strcpy(p0, direct.d_name); callout(); *save0 = 0; /* restore */ } } fserr() { printf("%s -- Cannot open file\n", name); done(); } callout() { register struct dent *d; register char *ptr1, *ptr0; struct dent *empty; int mode; if (stat(name,&statb) < 0) fserr(); mode = statb.st_mode; if ((mode &= S_IFMT) != 0) { if (mode == S_IFDIR) /* directory */ expand(); if(mode != S_IFREG) return; } /* when we reach here we have recursed until we found * an ordinary file. Now we look for it in "dir". */ empty = 0; d = &dir[0]; do { if (d->d_namep == 0) { /* empty directory slot */ if (empty == 0) /* remember the first one */ empty = d; continue; } decode(name1,d); ptr0 = name; ptr1 = name1; do if (*ptr0++ != *ptr1) goto cont; while (*ptr1++); /* veritably the same name */ if (flags & flu) { /* check the times */ if (d->d_time >= statb.st_mtime) return; } if (verify('r') < 0) return; goto copydir; cont: continue; } while (++d <= lastd); /* name not found in directory */ if ((d = empty) == 0) { d = lastd +1; if (d >= edir) { printf("Directory overflow\n"); done(); } } if (verify('a') < 0) return; if (d > lastd) lastd = d; encode(name,d); copydir: d->d_mode = statb.st_mode | OK; d->d_uid = statb.st_uid; d->d_gid = statb.st_gid; d->d_size = statb.st_size; d->d_time = statb.st_mtime; } swabdir(tp) register struct tent *tp; { swab((char *)tp, (char *)tp, sizeof(*tp)); swab(tp->pathnam, tp->pathnam, NAMELEN); swab((char *)&tp->uid, (char *)&tp->uid, 4); /* uid,gid,spare,size0 */ } 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-cmd/tp/tp3.c 644 0 33 11124 2414002421 6077 #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); } ->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); closcmd/tp/tp_defs.h 644 0 33 213 2403661217 6773 char mt[] = "/dev/rmt0"; char tc[] = "/dev/tapx"; int flags = flu; char mheader[] = "/usr/mdec/mboot"; char theader[] = "/usr/mdec/tboot"; seek(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 (wr/,5< /,"cmd/trman.sh 644 0 33 145 2111474701 6230 sed -n -f /usr/man/man0/m1.sed $1\ |sed -n -f /usr/man/man0/m2.sed \ |sed -f /usr/man/man0/trref.sed 0; } t(a) { register zz; int hy,xb,ly,hx,lx; if (a) return; if ((zz = yy) < 0) zz = 0; hy = ((zz>>7) & 037); xb = ((xx & 03) + ((zz<<2) & 014) & 017); ly = ((zz>>2) & 037); hx = ((xx>>7) & 037); lx = ((xx>>2) & 037); putchar(GS); if (hy != ohy) putchar(hy | 040); if (xb != oxb) putchar(xb | 0140);/( ,( 5< /\@,\D"cmd/true.sh 755 0 33 0 2111463414 6016 cmd/touch.c 444 0 33 1600 2416240255 6057 static char *sccsid = "@(#)touch.c 4.1 (Berkeley) 10/1/80"; #include main(argc,argv) int argc; char *argv[]; { int i; static int force = 1; for(i = 1 ; i < argc ; ++i) if( strcmp(argv[i], "-c") ) touch(force, argv[i]); else force = 0; } #include #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); } int fd; if( stat(name,&stbuff) < 0) if(force) goto create; else { fprintf(stderr, "touch: file %s does not exist.\n", cmd/tr.c 444 0 33 4230 2416240257 5366 static char *sccsid = "@(#)tr.c 4.1 (Berkeley) 10/1/80"; #include /* tr - transliterate data stream */ int dflag = 0; int sflag = 0; int cflag = 0; int save = 0; char code[256]; char squeez[256]; char vect[256]; struct string { int last, max; char *p; } string1, string2; main(argc,argv) char **argv; { register i; int j; register c, d; char *compl; int lastd; string1.last = string2.last = 0; string1.max = string2.max = 0; string1.p = string2.p = ""; if(--argc>0) { argv++; if(*argv[0]=='-'&&argv[0][1]!=0) { while(*++argv[0]) switch(*argv[0]) { case 'c': cflag++; continue; case 'd': dflag++; continue; case 's': sflag++; continue; } argc--; argv++; } } if(argc>0) string1.p = argv[0]; if(argc>1) string2.p = argv[1]; for(i=0; i<256; i++) code[i] = vect[i] = 0; if(cflag) { while(c = next(&string1)) vect[c&0377] = 1; j = 0; for(i=1; i<256; i++) if(vect[i]==0) vect[j++] = i; vect[j] = 0; compl = vect; } for(i=0; i<256; i++) squeez[i] = 0; lastd = 0; for(;;){ if(cflag) c = *compl++; else c = next(&string1); if(c==0) break; d = next(&string2); if(d==0) d = lastd; else lastd = d; squeez[d&0377] = 1; code[c&0377] = dflag?1:d; } while(d = next(&string2)) squeez[d&0377] = 1; squeez[0] = 1; for(i=0;i<256;i++) { if(code[i]==0) code[i] = i; else if(dflag) code[i] = 0; } while((c=getc(stdin)) != EOF ) { if(c == 0) continue; if(c = code[c&0377]&0377) if(!sflag || c!=save || !squeez[c&0377]) putchar(save = c); } exit(0); } next(s) struct string *s; { again: if(s->max) { if(s->last++ < s->max) return(s->last); s->max = s->last = 0; } if(s->last && *s->p=='-') { nextc(s); s->max = nextc(s); if(s->max==0) { s->p--; return('-'); } if(s->max < s->last) { s->last = s->max-1; return('-'); } goto again; } return(s->last = nextc(s)); } nextc(s) struct string *s; { register c, i, n; c = *s->p++; if(c=='\\') { i = n = 0; while(i<3 && (c = *s->p)>='0' && c<='7') { n = n*8 + c - '0'; i++; s->p++; } if(i>0) c = n; else c = *s->p++; } if(c==0) *--s->p = 0; return(c&0377); } x = s->last = 0; } if(s->last && *s->p=='-') { nextc(s); s->max = nextc(s); if(s->max==0) { s->p--; return('-'); } if(s->max < s->last) { s->last = s->max-1; return('-'); } goto again; } return(s->last = nextc(s)); } nextc(s) struct string *s; { register c, i, n; c = *s->p++; if(c=='\\') { i = n = 0; while(i<3 && (c = cmd/awk/ 775 0 33 0 2552522370 5277 cmd/awk/EXPLAIN 644 0 33 5146 2407264040 6407 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. .). 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 furncmd/awk/README 644 0 33 5636 2407264104 6251 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 will be well anyway. 5. The basic sequence of events (in case make doesn't seem to do the job) icmd/awk/awk.def 644 0 33 6114 2413240542 6620 #define hack int #define AWKFLOAT float #define xfree(a) { if(a!=NULL) { yfree(a); a=NULL;} } #define yfree free #ifdef DEBUG # define dprintf if(dbg)printf #else # define dprintf(x1, x2, x3, x4) #endif typedef 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 int dbg; extern int lineno; extern int errorflag; extern int donefld; /* 1 if record broken into fields */ extern int donerec; /* 1 if record is valid (no fld has changed */ typedef struct val { /* general value during processing */ char *nval; /* name, for variables only */ char *sval; /* string value */ awkfloat fval; /* value as number */ unsigned tval; /* type info */ struct val *nextval; /* ptr to next if chained */ } cell; extern cell *symtab[]; cell *setsymtab(), *lookup(), **makesymtab(); extern cell *recloc; /* location of input record */ extern cell *nrloc; /* NR */ extern cell *nfloc; /* NF */ #define STR 01 /* string value is valid */ #define NUM 02 /* number value is valid */ #define FLD 04 /* FLD means don't free string space */ #define CON 010 /* this is a constant */ #define ARR 020 /* this is an array */ awkfloat setfval(), getfval(); char *setsval(), *getsval(); char *tostring(), *tokname(), *malloc(); double log(), sqrt(), exp(), atof(); /* function types */ #define FLENGTH 1 #define FSQRT 2 #define FEXP 3 #define FLOG 4 #define FINT 5 typedef struct { char otype; char osub; cell *optr; } obj; #define BOTCH 1 struct nd { char ntype; char subtype; struct nd *nnext; int nobj; struct nd *narg[BOTCH]; /* C won't take a zero length array */ }; typedef struct nd node; extern node *winner; extern node *nullstat; /* otypes */ #define OCELL 0 #define OEXPR 1 #define OBOOL 2 #define OJUMP 3 /* cell subtypes */ #define CTEMP 4 #define CNAME 3 #define CVAR 2 #define CFLD 1 #define CCON 0 /* bool subtypes */ #define BTRUE 1 #define BFALSE 2 /* jump subtypes */ #define JEXIT 1 #define JNEXT 2 #define JBREAK 3 #define JCONT 4 /* node types */ #define NVALUE 1 #define NSTAT 2 #define NEXPR 3 #define NPA2 4 extern obj (*proctab[])(); extern obj true, false; extern int pairstack[], paircnt; #define cantexec(n) (n->ntype == NVALUE) #define notlegal(n) (n <= FIRSTTOKEN || n >= LASTTOKEN || proctab[n-FIRSTTOKEN]== nullproc) #define isexpr(n) (n->ntype == NEXPR) #define isjump(n) (n.otype == OJUMP) #define isexit(n) (n.otype == OJUMP && n.osub == JEXIT) #define isbreak(n) (n.otype == OJUMP && n.osub == JBREAK) #define iscont(n) (n.otype == OJUMP && n.osub == JCONT) #define isnext(n) (n.otype == OJUMP && n.osub == JNEXT) #define isstr(n) (n.optr->tval & STR) #define istrue(n) (n.otype == OBOOL && n.osub == BTRUE) #define istemp(n) (n.otype == OCELL && n.osub == CTEMP) #define isfld(n) (!donefld && n.osub==CFLD && n.otype==OCELL && n.optr->nval==0) #define isrec(n) (donefld && n.osub==CFLD && n.otype==OCELL && n.optr->nval!=0) obj nullproc(); obj relop(); #define MAXSYM 50 #define HAT 0177 /* matches ^ in regular expr */ /* watch out for mach dep */ .osub == JCONT) #define isnext(n) (n.otype == OJUMP && n.osub == JNEXT) #define isstr(n) (n.optr->tval & STR) #define istrue(n) (n.otype == OBOOL && n.osub == BTRUE) #define istemp(n) (n.otype == OCELL && n.osub == CTEMP) #define isfld(n) (!donefld && n.osub==CFLD && n.otype==OCELL && n.optr->nval==0) #define isrec(n) (donefld && n.osub==CFLD && n.otype==OCELL && n.optr->nval!=0) obj nullproc(); obj relop(); #define MAXSYM 50 #defi((cmd/awk/awk.g.y 644 0 33 20226 2407264330 6603 %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); } ; %% | { 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;ecmd/awk/awk.lx.l 644 0 33 11124 2407264413 6762 %Start A str chc sc reg comment %{ #include "awk.h" #include "awk.def" #undef input /* defeat lex */ extern int yylval; extern int mustfld; int lineno = 1; #ifdef DEBUG # define RETURN(x) {if (dbg) ptoken(x); return(x); } #else # define RETURN(x) return(x) #endif #define CADD cbuf[clen++]=yytext[0]; if(clen>=CBUFLEN-1) {yyerror("string too long", cbuf); BEGIN A;} #define CBUFLEN 150 char cbuf[CBUFLEN]; int clen, cflag; %} A [a-zA-Z_] B [a-zA-Z0-9_] D [0-9] WS [ \t] %% switch (yybgin-yysvec-1) { /* witc((hcraft */ 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, NULL, 0.0, NUM, symtab); RETURN(VAR); } ({D}+("."?){D}*|"."{D}+)((e|E)("+"|-)?{D}+)? { yylval = (hack)setsymtab(yytext, NULL, 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; } "\\""]" { 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') cmd/awk/b.c 644 0 33 25175 2407264571 6006 #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); } ct 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 (pfcmd/awk/freeze.c 644 0 33 1020 2407264121 6773 #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); } 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)cmd/awk/lib.c 644 0 33 13726 2407264674 6336 #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]; #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 {0, NULL, 0.0, FLD|STR} cell fldtab[MAXFLD] = { /*room for fields */ { "$record", record, 0.0, STR|FLD}, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT }; int maxfld = 0; /* last used field */ getrec() { register char *rr; extern int svargc; extern char **svargv; register c, sep; dprintf("**RS=%o, **FS=%o\n", **RS, **FS, NULL); donefld = 0; donerec = 1; record[0] = 0; while (svargc > 0) { dprintf("svargc=%d, *svargv=%s\n", svargc, *svargv, NULL); if (infile == NULL) { /* have to open a new file */ if (member('=', *svargv)) { /* it's a var=value argument */ setclvar(*svargv); svargv++; svargc--; continue; } *FILENAME = file = *svargv; dprintf("opening file %s\n", file, NULL, NULL); if (*file == '-') infile = stdin; else if ((infile = fopen(file, "r")) == NULL) error(FATAL, "can't open %s", file); } if ((sep = **RS) == 0) sep = '\n'; for (rr = record; ; ) { for (; (c=getc(infile)) != sep && c != EOF; *rr++ = c) ; if (**RS == sep || c == EOF) break; if ((c = getc(infile)) == '\n' || c == EOF) /* 2 in a row */ break; *rr++ = '\n'; *rr++ = c; } if (rr > record+RECSIZE) error(FATAL, "record `%.20s...' too long", record); *rr = 0; if (mustfld) fldbld(); if (c != EOF || 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)) xfree(fldtab[i].sval); fldtab[i].sval = fr; fldtab[i].tval = FLD | STR; do *fr++ = *r++; while (*r != ' ' && *r != '\t' && *r != '\n' && *r != '\0'); *fr++ = 0; } else 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)) xfree(fldtab[i].sval); fldtab[i].sval = fr; fldtab[i].tval = FLD | STR; while (*r != sep && *r != '\n' && *r != '\0') /* \n always a separator */ *fr++ = *r++; *fr++ = 0; if (*r++ == 0) break; } *fr = 0; for (j=MAXFLD-1; j>i; j--) { /* clean out junk from previous record */ if (!(fldtab[j].tval&FLD)) xfree(fldtab[j].sval); fldtab[j].tval = STR | FLD; fldtab[j].sval = NULL; } maxfld = i; donefld = 1; for(i=1; i<=maxfld; i++) if(isnumber(fldtab[i].sval)) { fldtab[i].fval = atof(fldtab[i].sval); fldtab[i].tval |= NUM; } setfval(lookup("NF", symtab, 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 > 0) fprintf(stderr, " record number %g\n", *NR); if (f) exit(2); } PUTS(s) char *s; { dprintf("%s\n", s, NULL, NULL); } #define MAXEXPON 38 /* maximum exponenet for fp number */ isnumber(s) register char *s; { register d1, d2; int point; char *es; d1 = d2 = point = 0; while (*s == ' ' || *s == '\t' || *s == '\n') s++; if (*s == '\0') return(0); /* empty stuff isn't number */ if (*s == '+' || *s == '-') s++; if (!isdigit(*s) && *s != '.') return(0); if (isdigit(*s)) { 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);} */ d2++; do { s++; } while (isdigit(*cmd/awk/main.c 644 0 33 5165 2407211370 6453 #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 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]"); if (strcmp(argv[0], "a.out")) logit(argc, argv); 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("-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); } logit(n, s) char *s[]; { int i, tvec[2]; FILE *f, *g; char buf[512]; if ((f=fopen("/crp/pjw/awkhist/awkhist", "a"))==NULL) return; time(tvec); fprintf(f, "%-8s %s", getlogin(), ctime(tvec)); for (i=0; i0) fwrite(buf, 1, i, f); fclose(f); fclose(g); } yywrap() { return(1); } exit(errorflag); } logit(n, s) char *s[]; { int i, tvec[2]; FILE *f, *g; char buf[512]; if ((f=fopen("/crp/pjw/awkhist/awkhist", "a"))==NULL) return; time(tvec); fprintf(f, "%-8s %s", getlogin(), ctime(tvec)); for (i=0; iproctab.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 $(FILES) mon.o cc -p -i awk.g.o $(FILES) mon.o -lm find: egrep -n "$(PAT)" *.[ylhc] awk.def list: -pr $(SOURCE) makefile tokenscript README EXPLAIN lint: lint -spu b.c main.c token.c tran.c run.c lib.c parse.c -lm |\ egrep -v '^(error|free|malloc)' proctab.c: proc proc >proctab.c proc: awk.h proc.o token.o cc -o proc proc.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:;cmd/awk/parse.c 644 0 33 4415 2407265011 6637 ((#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); } egister 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; { regcmd/awk/proc.c 644 0 33 4377 2407265046 6507 #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; itoken!=0;p++) table[p->token-FIRSTTOKEN]=p->name; printf("obj (*proctab[%d])() = {\n", SIZE); 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)) { xfree(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; xfree(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); } } } 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); doit: fprintf(files[i].fp, "%s", s); #ifndef gcos fflush(files[i].fp); /* in case someone is waiting for the output */ #endif tempfree(x); } f (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 == cmd/awk/test.a 644 0 33 35366 2407265506 6544 ! 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 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 ecmd/awk/token.c 644 0 33 2601 2552522001 6634 #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, }; ptoken(n) { if(n<128) printf("lex: %c\n",n); else if(n<=256) printf("lex:? %o\n",n); else if(n= LASTTOKEN) n = 257; return(tok[n-257].tnm); } 7, "CCL", 318, "NCCL", 319, "CHAR", 320, "CAT", 321, "STAR", 322, "PLUS", 323, "QUEST", 324, "POSTINCR", 325, "PREINCR", 326, "cmd/awk/tokenscript 644 0 33 166 2407265567 7650 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 ) { if(n<128) printf("lex: %c\n",n); else if(n<=256) printf("lex:? %o\n",n); else if(n= LASTTOKEN) n = 257; return(tok[n-257].tnm); } 7, "CCL", 318, "NCCL", 319, "CHAR",/,5H< /,"cmd/awk/tran.c 644 0 33 12562 2407265672 6530 #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 *nf((loc; /* 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", NULL, 0.0, STR|FLD, symtab)->sval; nfloc = setsymtab("NF", NULL, 0.0, NUM, symtab); NF = &nfloc->fval; nrloc = setsymtab("NR", NULL, 0.0, NUM, symtab); NR = &nrloc->fval; } cell **makesymtab() { int i; cell **cp; cp = (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) { xfree(cp->nval); xfree(cp->sval); free(cp); } } xfree(tp); } cell *setsymtab(n, s, f, t, tab) char *n, *s; awkfloat f; unsigned t; cell **tab; { register h; register cell *p; cell *lookup(); if (n != NULL && (p = lookup(n, tab, 0)) != NULL) { xfree(s); dprintf("setsymtab found %o: %s", p, p->nval, NULL); dprintf(" %s %g %o\n", p->sval, p->fval, p->tval); return(p); } p = (cell *) malloc(sizeof(cell)); if (p == NULL) error(FATAL, "symbol table overflow at %s", n); p->nval = tostring(n); p->sval = s; p->fval = f; p->tval = t; h = hash(n); p->nextval = tab[h]; tab[h] = p; dprintf("setsymtab set %o: %s", p, p->nval, NULL); dprintf(" %s %g %o\n", p->sval, p->fval, p->tval); return(p); } hash(s) /* form hash value for string s */ register 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) && vp->nval == 0) donerec = 0; return(vp->fval = f); } char *setsval(vp, s) register cell *vp; char *s; { dprintf("setsval: %o %s\n", vp, s, NULL); checkval(vp); if (vp == recloc) error(FATAL, "can't set $0"); vp->tval &= ~NUM; vp->tval |= STR; if ((vp->tval & FLD) && vp->nval == 0) donerec = 0; if (!(vp->tval&FLD)) xfree(vp->sval); vp->tval &= ~FLD; return(vp->sval = tostring(s)); } awkfloat getfval(vp) register cell *vp; { if (vp->sval == record && donerec == 0) recbld(); dprintf("getfval: %o", vp, NULL, NULL); checkval(vp); if ((vp->tval & NUM) == 0) { /* the problem is to make non-numeric things */ /* have unlikely numeric variables, so that */ /* $1 == $2 comparisons sort of make sense when */ /* one or the other is numeric */ if (isnumber(vp->sval)) { vp->fval = atof(vp->sval); if (!(vp->tval & CON)) /* don't change type of a constant */ vp->tval |= NUM; } else vp->fval = 0.0; /* not a very good idea */ } dprintf(" %g\n", vp->fval, NULL, NULL); return(vp->fval); } char *getsval(vp) register cell *vp; { char s[100]; if (vp->sval == record && donerec == 0) recbld(); dprintf("getsval: %o", vp, NULL, NULL); checkval(vp); if ((vp->tval & STR) == 0) { if (!(vp->tval&FLD)) xfree(vp->sval); if ((long)vp->fval==vp->fval) sprintf(s, "%.20g", vp->fval); else sprintf(s, *OFMT, vp->fval); vp->sval = tostring(s); vp->tval &= ~FLD; vp->tval |= STR; } dprintf(" %s\n", vp->sval, NULL, NULL); return(vp->sval); } checkval(vp) register cell *vp; { if (vp->tval & ARR) error(FATAL, "illegal reference to array %s", vp->nval); if ((vp->tval & (NUM | STR)) == 0) error(FATAL, "funny variable %o: %s %s %g %o", vp, vp->nval, vp->sval, vp->fval, vp->tval); } char *tostring(s) register char *s; { register char *p; p = malloc(strlen(s)+1); if (p == NULL) error(FATAL, "out of space in tostring on %s", s); strcpy(p, s); return(p); } #ifndef yfree yfree(a) char *a; { printf("%o\n", a); free(a); } #endif #ifdef malloc #undef malloc char *ymalloc(u) unsigned u; { char *p; p = malloc(u); printf("%o %o\n", u, p); return(p); } #endif tval & (NUM | STR)) == 0) error(FATAL, "funny variable %o: %s %s %g %o", vp, vp->nval, vp->sval, vp->fval, vp->tval); } char *tostring(scmd/tsort.c 444 0 33 7774 2416240261 6127 static char *sccsid = "@(#)tsort.c 4.1 (Berkeley) 10/1/80"; /* topological sort * input is sequence of pairs of items (blank-free strings) * nonidentical pair is a directed edge in graph * identical pair merely indicates presence of node * output is ordered list of items consistent with * the partial ordering specified by the graph */ #include "stdio.h" /* the nodelist always has an empty element at the end to * make it easy to grow in natural order * states of the "live" field:*/ #define DEAD 0 /* already printed*/ #define LIVE 1 /* not yet printed*/ #define VISITED 2 /*used only in findloop()*/ struct nodelist { struct nodelist *nextnode; struct predlist *inedges; char *name; int live; } firstnode = {NULL, NULL, NULL, DEAD}; /* a predecessor list tells all the immediate * predecessors of a given node */ struct predlist { struct predlist *nextpred; struct nodelist *pred; }; struct nodelist *index(); struct nodelist *findloop(); struct nodelist *mark(); char *malloc(); char *empty = ""; /* the first for loop reads in the graph, * the second prints out the ordering */ main(argc,argv) char **argv; { register struct predlist *t; FILE *input = stdin; register struct nodelist *i, *j; int x; char precedes[50], follows[50]; if(argc>1) { input = fopen(argv[1],"r"); if(input==NULL) error("cannot open ", argv[1]); } for(;;) { x = fscanf(input,"%s%s",precedes, follows); if(x==EOF) break; if(x!=2) error("odd data",empty); i = index(precedes); j = index(follows); if(i==j||present(i,j)) continue; t = (struct predlist *)malloc(sizeof(struct predlist)); t->nextpred = j->inedges; t->pred = i; j->inedges = t; } for(;;) { x = 0; /*anything LIVE on this sweep?*/ for(i= &firstnode; i->nextnode!=NULL; i=i->nextnode) { if(i->live==LIVE) { x = 1; if(!anypred(i)) break; } } if(x==0) break; if(i->nextnode==NULL) i = findloop(); printf("%s\n",i->name); i->live = DEAD; } } /* is i present on j's predecessor list? */ present(i,j) struct nodelist *i, *j; { register struct predlist *t; for(t=j->inedges; t!=NULL; t=t->nextpred) if(t->pred==i) return(1); return(0); } /* is there any live predecessor for i? */ anypred(i) struct nodelist *i; { register struct predlist *t; for(t=i->inedges; t!=NULL; t=t->nextpred) if(t->pred->live==LIVE) return(1); return(0); } /* turn a string into a node pointer */ struct nodelist * index(s) register char *s; { register struct nodelist *i; register char *t; for(i= &firstnode; i->nextnode!=NULL; i=i->nextnode) if(cmp(s,i->name)) return(i); for(t=s; *t; t++) ; t = malloc((unsigned)(t+1-s)); i->nextnode = (struct nodelist *)malloc(sizeof(struct nodelist)); if(i->nextnode==NULL||t==NULL) error("too many items",empty); i->name = t; i->live = LIVE; i->nextnode->nextnode = NULL; i->nextnode->inedges = NULL; i->nextnode->live = DEAD; while(*t++ = *s++); return(i); } cmp(s,t) register char *s, *t; { while(*s==*t) { if(*s==0) return(1); s++; t++; } return(0); } error(s,t) char *s, *t; { note(s,t); exit(1); } note(s,t) char *s,*t; { fprintf(stderr,"tsort: %s%s\n",s,t); } /* given that there is a cycle, find some * node in it */ struct nodelist * findloop() { register struct nodelist *i, *j; for(i= &firstnode; i->nextnode!=NULL; i=i->nextnode) if(i->live==LIVE) break; note("cycle in data",empty); i = mark(i); if(i==NULL) error("program error",empty); for(j= &firstnode; j->nextnode!=NULL; j=j->nextnode) if(j->live==VISITED) j->live = LIVE; return(i); } /* depth-first search of LIVE predecessors * to find some element of a cycle; * VISITED is a temporary state recording the * visits of the search */ struct nodelist * mark(i) register struct nodelist *i; { register struct nodelist *j; register struct predlist *t; if(i->live==DEAD) return(NULL); if(i->live==VISITED) return(i); i->live = VISITED; for(t=i->inedges; t!=NULL; t=t->nextpred) { j = mark(t->pred); if(j!=NULL) { note(i->name,empty); return(j); } } return(NULL); } n(i)cmd/tty.c 444 0 33 424 2416240262 5536 ((static char *sccsid = "@(#)tty.c 4.1 (Berkeley) 10/1/80"; /* * Type tty name */ char *ttyname(); main(argc, argv) char **argv; { register char *p; p = ttyname(0); if(argc==2 && !strcmp(argv[1], "-s")) ; else printf("%s\n", (p? p: "not a tty")); exit(p? 0: 1); } f(i->live==DEAD) return(NULL); if(i->live==VISITED) return(i); i->live = VISITED; for(t=i->inedges; t!=NULL; t=t->nextpred) { j = mark(/( ,( 5< /\@,\D"cmd/ul.c 444 0 33 11163 2416240267 5405 static char *sccsid = "@(#)ul.c 4.1 (Berkeley) 10/1/80"; /* * ul */ #include char buf[BUFSIZ]; char isul[BUFSIZ]; char termcap[1024]; char ulbuf[BUFSIZ]; char *stul, *endul, *chul; char *backspace; char *termtype; int outc(); char *tgetstr(); char *getenv(); main(argc, argv) int argc; char **argv; { register int i; char *cp; FILE *f; argc--, argv++; termtype = getenv("TERM"); if (termtype == NULL) termtype = "dumb"; while (argc > 0 && argv[0][0] == '-') { switch(argv[0][1]) { case 't': case 'T': /* for nroff compatibility */ if (argv[0][2]) termtype = &argv[0][2]; else { termtype = argv[1]; argc--; argv++; } break; case 'i': argc--, argv++; iul(argc, argv); exit(0); default: printf("Usage: ul [ -i ] [ -tTerm ] file...\n"); exit(1); } } switch(tgetent(termcap, termtype)) { case 1: if (tgetflag("os")) execv("/bin/cat",argv); cp = ulbuf; if ((backspace = tgetstr("bc",&cp)) == NULL) backspace = "\b"; /* * Handle terminals that have start underline/stop * underline sequences, as well as those with * underline char sequences (we assume the sequence * moves the cursor forward one character). * If we can't find underline sequences, we * settle for standout sequences. */ if ((chul=tgetstr("uc",&cp)) == NULL) chul = ""; if ((stul=tgetstr("us",&cp)) == NULL && !tgetflag("ul") && (!*chul) && (stul=tgetstr("so",&cp)) == NULL) stul = ""; if ((endul=tgetstr("ue",&cp)) == NULL && !tgetflag("ul") && (!*chul) && (endul=tgetstr("se",&cp)) == NULL) endul = ""; if (chul==0&&stul==0&&endul==0&&tgetflag("ul")) execv("/bin/cat",argv); break; default: fprintf(stderr,"trouble reading termcap"); /* fall through to ... */ case 0: /* No such terminal type - assume dumb */ stul = endul = chul = ""; break; } if (argc == 0) filter(stdin); else for (i=0; i 0) { p--; } } else if (c=='_' && isul[p]==0 && buf[p]) { isul[p] = 1; p++; } else { if (buf[p] == '_') isul[p] = 1; buf[p] = c; p++; if (n < p) n = p; } if (c=='\n') break; } state = 0; for (p=0; p 0) { if (freopen(argv[0], "r", stdin) == NULL) { perror(argv[0]); exit(1); } argc--; argv++; } while (fgets(linebuf, sizeof linebuf, stdin) != 0) { for (lp = linebuf; *lp; lp++) continue; *--lp = 0; doulg(); dographic(); if (genbuf[0]) printf("\n%s", genbuf); putchar('\n'); fflush(stdout); } } while (argc > 0); exit(0); } dographic() { register char *lp; register c; for (lp = linebuf; c = *lp++;) { switch (c) { case '\b': if (BACKSPACE == 0) c = '?'; break; default: if (c < ' ' || c == 0177) c = '?'; break; case '\t': break; } putchar(c); } } doulg() { register char *lp, *gp; char *maxgp; register c; char csw; int col; gp = genbuf; *gp = 0; maxgp = gp; col = 0; for (lp = linebuf; c = *lp++;) { switch (c) { case '\t': while ((col & 7) != 7) { *gp++ = ' '; if (gp >= &genbuf[BUFSIZ - 2]) goto ovflo; col++; } break; default: if (gp >= maxgp) break; c |= (*gp & QUOTE); break; case '_': if (gp >= maxgp) c = QUOTE; else c = *gp | QUOTE; break; case '\b': if (gp > genbuf) { gp--; col--; } continue; } if (gp >= &genbuf[BUFSIZ - 2]) { ovflo: fprintf(stderr, "Line too long\n"); exit(1); } *gp++ = c; if (gp > maxgp) maxgp = gp; col++; } *maxgp = 0; strcpy(linebuf, genbuf); for (lp = linebuf, gp = genbuf; c = *lp; gp++, lp++) if (c & QUOTE) { c &= 0177; if (c == 0) *lp = '_', *gp = ' '; else *lp = c, *gp = '-'; } else *gp = ' '; --gp; while (gp >= genbuf && *gp == ' ') --gp; gp[1] = 0; } if (gp > genbuf) { gp--; col--; } continue; } if (gp >= &genbuf[BUFSIZ - 2]) { ovflo: fprintf(stderr, "Line too long\n"); exit(1); } *gp++ = c; if (gp > maxgp) maxgp = gp; col++; } *maxgp = 0; strcpy(linebuf, genbuf); for (lp = linebuf, gp = genbuf; c = *lp; gp++, lp++) if (c & QUOTE) { c &= 0177; if (c == 0) *lp = '_', *gp = ' '; elcmd/umount.c 444 0 33 4044 2423014635 6270 static char *sccsid = "@(#)umount.c 4.3 (Berkeley) 10/15/80"; #include #include /* * umount */ #define NMOUNT 16 #define NAMSIZ 32 struct mtab { char file[NAMSIZ]; char spec[NAMSIZ]; } mtab[NMOUNT]; main(argc, argv) char **argv; { register struct mtab *mp; register char *p1, *p2; int mf; sync(); mf = open("/etc/mtab", 0); read(mf, (char *)mtab, NMOUNT*2*NAMSIZ); if(argc != 2) { printf("arg count\n"); return(1); } if (strcmp(argv[1], "-a") == 0){ if (setfsent() == 0) perror(FSTAB), exit(1); umountall(); endfsent(); } else { int back; if (back = umountfs(argv[1])){ if (back < 0) perror("umount"); exit(1); } } exit(0); } /* * It is important to unmount the files in * reverse! order from the order they were mounted, * so that file systems mounted as children to other * file systems get removed in the right order. */ umountall() { struct fstab fs; struct fstab *fsp; if ( (fsp = getfsent()) == 0) return; fs = *fsp; /* save info locally; it is static from getfsent() */ umountall(); if (strcmp(fs.fs_file, "/") == 0) return; if (strcmp(fs.fs_type, FSTAB_RW) && strcmp(fs.fs_type, FSTAB_RO)) return; if (umountfs(fs.fs_spec) < 0) fprintf(stdout, "Unmount of special file %s FAILED\n", fs.fs_spec); else fprintf(stdout, "Unmounted special file %s\n", fs.fs_spec); fflush(stdout); } int umountfs(name) char *name; { register char *p1, *p2; register struct mtab *mp; int mf; if (umount(name) < 0) { return(-1); } p1 = name; while(*p1++) ; p1--; while(*--p1 == '/') *p1 = '\0'; while(p1 > name && *--p1 != '/') ; if(*p1 == '/') p1++; name = p1; for (mp = mtab; mp < &mtab[NMOUNT]; mp++) { p1 = name; p2 = &mp->spec[0]; while (*p1++ == *p2) if (*p2++ == 0) { for (p1 = mp->file; p1 < &mp->file[NAMSIZ*2];) *p1++ = 0; mp = &mtab[NMOUNT]; while ((--mp)->file[0] == 0); mf = creat("/etc/mtab", 0644); write(mf, (char *)mtab, (mp-mtab+1)*2*NAMSIZ); return(0); } } printf("%s not in mount table\n", name); return(1); } p1 == '/') *p1 = '\0'; while(p1 > name && *--p1 != '/') ; if(*p1 == '/') p1++; name = p1; for (mp = mtab; mp < &mtab[NMOUNT]; mp++) { p1 = name; p2 = &mp->spec[0]; while (*p1++ == *p2) if (*p2++ == 0) { for (p1 = mp->file; p1 < &mp->file[NAMSIZ*2];) *p1++ = 0; mp = &mtab[NMOUNT]; while ((--mp)->file[0] == 0); mf = creat("/etc/mtab", 0644); write(mf, (char *)mtab, (mp-mtab+1)*2*NAMSIZ); return(0); } } printf("%s not in mcmd/ps.c 664 0 33 53234 2552464654 5431 static char *sccsid = "@(#)ps.c 4.13 (Berkeley) 81/07/08"; /* * ps; VAX 4BSD version */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include struct nlist nl[] = { { "_proc" }, #define X_PROC 0 { "_Usrptmap" }, #define X_USRPTMA 1 { "_usrpt" }, #de((fine X_USRPT 2 { "_text" }, #define X_TEXT 3 { "_nswap" }, #define X_NSWAP 4 { "_maxslp" }, #define X_MAXSLP 5 { "_ccpu" }, #define X_CCPU 6 { "_ecmx" }, #define X_ECMX 7 { "_nproc" }, #define X_NPROC 8 { "_ntext" }, #define X_NTEXT 9 { "_hz" }, #define X_HZ 10 { 0 }, }; struct savcom { union { struct lsav *lp; float u_pctcpu; struct vsav *vp; int s_ssiz; } sun; struct asav *ap; } *savcom; struct asav { char *a_cmdp; int a_flag; short a_stat, a_uid, a_pid, a_nice, a_pri, a_slptime, a_time; size_t a_size, a_rss, a_tsiz, a_txtrss; short a_xccount; char a_tty[DIRSIZ+1]; dev_t a_ttyd; time_t a_cpu; size_t a_maxrss; }; char *lhdr; struct lsav { short l_ppid; char l_cpu; int l_addr; caddr_t l_wchan; }; char *uhdr; char *shdr; char *vhdr; struct vsav { u_int v_majflt; size_t v_swrss, v_txtswrss; float v_pctcpu; }; struct proc proc[8]; /* 8 = a few, for less syscalls */ struct proc *mproc; struct text *text; int paduser1; /* avoid hardware mem clobbering botch */ union { struct user user; char upages[UPAGES][NBPG]; } user; #define u user.user int paduser2; /* avoid hardware mem clobbering botch */ #define clear(x) ((int)x & 0x7fffffff) int chkpid; int aflg, cflg, eflg, gflg, kflg, lflg, sflg, uflg, vflg, xflg; char *tptr; char *gettty(), *getcmd(), *getname(), *savestr(), *alloc(), *state(); double pcpu(), pmem(); int pscomp(); int nswap, maxslp; struct text *atext; double ccpu; int ecmx; struct pte *Usrptma, *usrpt; int nproc, ntext, hz; struct ttys { char name[DIRSIZ+1]; dev_t ttyd; struct ttys *next; struct ttys *cand; } *allttys, *cand[16]; int npr; int cmdstart; int twidth; char *kmemf, *memf, *swapf, *nlistf; int kmem, mem, swap; int rawcpu, sumcpu; int pcbpf; int argaddr; extern char _sobuf[]; main(argc, argv) char **argv; { register int i, j; register char *ap; int uid; off_t procp; if (chdir("/dev") < 0) { perror("/dev"); exit(1); } twidth = 80; setbuf(stdout, _sobuf); argc--, argv++; if (argc > 0) { ap = argv[0]; while (*ap) switch (*ap++) { case 'C': rawcpu++; break; case 'S': sumcpu++; break; case 'a': aflg++; break; case 'c': cflg = !cflg; break; case 'e': eflg++; break; case 'g': gflg++; break; case 'k': kflg++; break; case 'l': lflg++; break; case 's': sflg++; break; case 't': if (*ap) tptr = ap; aflg++; gflg++; if (*tptr == '?') xflg++; while (*ap) ap++; break; case 'u': uflg++; break; case 'v': cflg = 1; vflg++; break; case 'w': if (twidth == 80) twidth = 132; else twidth = BUFSIZ; 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); getdev(); uid = getuid(); printhdr(); procp = getw(nl[X_PROC].n_value); nproc = getw(nl[X_NPROC].n_value); hz = getw(nl[X_HZ].n_value); savcom = (struct savcom *)calloc(nproc, sizeof (*savcom)); for (i=0; i 8) j = 8; j *= sizeof (struct proc); if (read(kmem, (char *)proc, j) != j) cantread("proc table", kmemf); procp += j; for (j = j / sizeof (struct proc) - 1; j >= 0; j--) { mproc = &proc[j]; if (mproc->p_stat == 0 || mproc->p_pgrp == 0 && xflg == 0) continue; if (tptr == 0 && gflg == 0 && xflg == 0 && mproc->p_ppid == 1 && (mproc->p_flag&SDETACH) == 0) continue; if (uid != mproc->p_uid && aflg==0 || chkpid != 0 && chkpid != mproc->p_pid) continue; if (vflg && gflg == 0 && xflg == 0) { if (mproc->p_stat == SZOMB || mproc->p_flag&SWEXIT) continue; if (mproc->p_slptime > MAXSLP && (mproc->p_stat == SSLEEP || mproc->p_stat == SSTOP)) continue; } save(); } } qsort(savcom, npr, sizeof(savcom[0]), pscomp); for (i=0; iap->a_flag & SWEXIT) printf(" "); else if (sp->ap->a_stat == SZOMB) printf(" "); else if (sp->ap->a_pid == 0) printf(" swapper"); else if (sp->ap->a_pid == 2) printf(" pagedaemon"); else if (sp->ap->a_pid == 3 && sp->ap->a_flag & SSYS) printf(" ip input"); else printf(" %.*s", twidth - cmdstart - 2, sp->ap->a_cmdp); printf("\n"); } exit(npr == 0); } getw(loc) off_t loc; { long word; lseek(kmem, loc, 0); if (read(kmem, &word, sizeof (word)) != sizeof (word)) printf("error reading kmem at %x\n", loc); return (word); } openfiles(argc, argv) char **argv; { kmemf = "kmem"; if (kflg) kmemf = argc > 1 ? argv[1] : "/vmcore"; kmem = open(kmemf, 0); if (kmem < 0) { perror(kmemf); exit(1); } if (kflg) { mem = kmem; memf = kmemf; } else { memf = "mem"; mem = open(memf, 0); if (mem < 0) { perror(memf); exit(1); } } swapf = argc>2 ? argv[2]: "drum"; swap = open(swapf, 0); if (swap < 0) { perror(swapf); exit(1); } } getkvars(argc, argv) char **argv; { register struct nlist *nlp; nlistf = argc > 3 ? argv[3] : "/vmunix"; nlist(nlistf, nl); if (nl[0].n_type == 0) { fprintf(stderr, "%s: No namelist\n", nlistf); exit(1); } if (kflg) for (nlp = nl; nlp < &nl[sizeof (nl)/sizeof (nl[0])]; nlp++) nlp->n_value = clear(nlp->n_value); Usrptma = (struct pte *)nl[X_USRPTMA].n_value; usrpt = (struct pte *)nl[X_USRPT].n_value; lseek(kmem, (long)nl[X_NSWAP].n_value, 0); if (read(kmem, &nswap, sizeof (nswap)) != sizeof (nswap)) { cantread("nswap", kmemf); exit(1); } lseek(kmem, (long)nl[X_MAXSLP].n_value, 0); if (read(kmem, &maxslp, sizeof (maxslp)) != sizeof (maxslp)) { cantread("maxslp", kmemf); exit(1); } lseek(kmem, (long)nl[X_CCPU].n_value, 0); if (read(kmem, &ccpu, sizeof (ccpu)) != sizeof (ccpu)) { cantread("ccpu", kmemf); exit(1); } lseek(kmem, (long)nl[X_ECMX].n_value, 0); if (read(kmem, &ecmx, sizeof (ecmx)) != sizeof (ecmx)) { cantread("ecmx", kmemf); exit(1); } if (uflg || vflg) { ntext = getw(nl[X_NTEXT].n_value); text = (struct text *)alloc(ntext * sizeof (struct text)); if (text == 0) { fprintf(stderr, "no room for text table\n"); exit(1); } atext = (struct text *)getw(nl[X_TEXT].n_value); lseek(kmem, (int)atext, 0); if (read(kmem, (char *)text, ntext * sizeof (struct text)) != ntext * sizeof (struct text)) { cantread("text table", kmemf); exit(1); } } } printhdr() { char *hdr; if (sflg+lflg+vflg+uflg > 1) { fprintf(stderr, "ps: specify only one of s,l,v and u\n"); exit(1); } hdr = lflg ? lhdr : (vflg ? vhdr : (uflg ? uhdr : shdr)); if (lflg+vflg+uflg+sflg == 0) hdr += strlen("SSIZ "); cmdstart = strlen(hdr); printf("%s COMMAND\n", hdr); fflush(stdout); } cantread(what, fromwhat) char *what, *fromwhat; { fprintf(stderr, "ps: error reading %s from %s", what, fromwhat); } struct direct dbuf; int dialbase; getdev() { register FILE *df; register struct ttys *dp; dialbase = -1; if ((df = fopen(".", "r")) == NULL) { fprintf(stderr, "Can't open . in /dev\n"); exit(1); } while (fread((char *)&dbuf, sizeof(dbuf), 1, df) == 1) { if (dbuf.d_ino == 0) continue; maybetty(dp); } fclose(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() { register char *cp = dbuf.d_name; register struct ttys *dp; int x; struct stat stb; switch (cp[0]) { case 'c': if (!strcmp(cp, "console")) { x = 0; goto donecand; } /* cu[la]? are possible!?! don't rule them out */ break; case 'd': if (!strcmp(cp, "drum")) return (0); break; case 'f': if (!strcmp(cp, "floppy")) return (0); break; case 'k': cp++; if (*cp == 'U') cp++; goto trymem; case 'r': cp++; if (*cp == 'r' || *cp == 'u' || *cp == 'h') cp++; #define is(a,b) cp[0] == 'a' && cp[1] == 'b' if (is(r,p) || is(u,p) || is(r,k) || is(r,m) || is(m,t)) { cp += 2; if (isdigit(*cp) && cp[2] == 0) return (0); } break; case 'm': trymem: if (cp[0] == 'm' && cp[1] == 'e' && cp[2] == 'm' && cp[3] == 0) return (0); if (cp[0] == 'm' && cp[1] == 't') return (0); break; case 'n': if (!strcmp(cp, "null")) return (0); break; case 'v': if ((cp[1] == 'a' || cp[1] == 'p') && isdigit(cp[2]) && cp[3] == 0) return (0); break; } mightbe: cp = dbuf.d_name; while (cp < &dbuf.d_name[DIRSIZ] && *cp) cp++; --cp; x = 0; if (cp[-1] == 'd') { if (dialbase == -1) { if (stat("ttyd0", &stb) == 0) dialbase = stb.st_rdev & 017; else dialbase = -2; } if (dialbase == -2) x = 0; else x = 11; } if (cp > dbuf.d_name && isdigit(cp[-1]) && isdigit(*cp)) x += 10 * (cp[-1] - ' ') + cp[0] - '0'; else if (*cp >= 'a' && *cp <= 'f') x += 10 + *cp - 'a'; else if (isdigit(*cp)) x += *cp - '0'; else x = -1; donecand: dp = (struct ttys *)alloc(sizeof (struct ttys)); strncpy(dp->name, dbuf.d_name, DIRSIZ); dp->next = allttys; dp->ttyd = -1; allttys = dp; if (x == -1) return; x &= 017; dp->cand = cand[x]; cand[x] = dp; } char * gettty() { register char *p; register struct ttys *dp; struct stat stb; int x; if (u.u_ttyp == 0) return("?"); x = u.u_ttyd & 017; for (dp = cand[x]; dp; dp = dp->cand) { if (dp->ttyd == -1) { if (stat(dp->name, &stb) == 0 && (stb.st_mode&S_IFMT)==S_IFCHR) dp->ttyd = stb.st_rdev; else dp->ttyd = -2; } if (dp->ttyd == u.u_ttyd) goto found; } /* ick */ for (dp = allttys; dp; dp = dp->next) { if (dp->ttyd == -1) { if (stat(dp->name, &stb) == 0 && (stb.st_mode&S_IFMT)==S_IFCHR) dp->ttyd = stb.st_rdev; else dp->ttyd = -2; } if (dp->ttyd == u.u_ttyd) goto found; } return ("?"); found: p = dp->name; if (p[0]=='t' && p[1]=='t' && p[2]=='y') p += 3; return (p); } save() { register struct savcom *sp; register struct asav *ap; register char *cp; register struct text *x((p; char *ttyp, *cmdp; if (mproc->p_stat != SZOMB && getu() == 0) return; ttyp = gettty(); if (xflg == 0 && ttyp[0] == '?' || tptr && strcmpn(tptr, ttyp, 2)) return; sp = &savcom[npr]; cmdp = getcmd(); if (cmdp == 0) return; sp->ap = ap = (struct asav *)alloc(sizeof (struct asav)); sp->ap->a_cmdp = cmdp; #define e(a,b) ap->a = mproc->b e(a_flag, p_flag); e(a_stat, p_stat); e(a_nice, p_nice); e(a_uid, p_uid); e(a_pid, p_pid); e(a_pri, p_pri); e(a_slptime, p_slptime); e(a_time, p_time); ap->a_tty[0] = ttyp[0]; ap->a_tty[1] = ttyp[1] ? ttyp[1] : ' '; if (ap->a_stat == SZOMB) { register struct xproc *xp = (struct xproc *)mproc; ap->a_cpu = xp->xp_vm.vm_utime + xp->xp_vm.vm_stime; } else { ap->a_size = mproc->p_dsize + mproc->p_ssize; e(a_rss, p_rssize); ap->a_ttyd = u.u_ttyd; ap->a_cpu = u.u_vm.vm_utime + u.u_vm.vm_stime; if (sumcpu) ap->a_cpu += u.u_cvm.vm_utime + u.u_cvm.vm_stime; if (mproc->p_textp && text) { xp = &text[mproc->p_textp - atext]; ap->a_tsiz = xp->x_size; ap->a_txtrss = xp->x_rssize; ap->a_xccount = xp->x_ccount; } } #undef e ap->a_cpu /= hz; ap->a_maxrss = mproc->p_maxrss; if (lflg) { register struct lsav *lp; sp->sun.lp = lp = (struct lsav *)alloc(sizeof (struct lsav)); #define e(a,b) lp->a = mproc->b e(l_ppid, p_ppid); e(l_cpu, p_cpu); if (ap->a_stat != SZOMB) e(l_wchan, p_wchan); #undef e lp->l_addr = pcbpf; } else if (vflg) { register struct vsav *vp; sp->sun.vp = vp = (struct vsav *)alloc(sizeof (struct vsav)); #define e(a,b) vp->a = mproc->b if (ap->a_stat != SZOMB) { e(v_swrss, p_swrss); vp->v_majflt = u.u_vm.vm_majflt; if (mproc->p_textp) vp->v_txtswrss = xp->x_swrss; } vp->v_pctcpu = pcpu(); #undef e } else if (uflg) sp->sun.u_pctcpu = pcpu(); else if (sflg) { if (ap->a_stat != SZOMB) { for (cp = (char *)u.u_stack; cp < &user.upages[UPAGES][0]; ) if (*cp++) break; sp->sun.s_ssiz = (&user.upages[UPAGES][0] - cp); } } npr++; } double pmem(ap) register struct asav *ap; { double fracmem; int szptudot; if ((ap->a_flag&SLOAD) == 0) fracmem = 0.0; else { szptudot = UPAGES + clrnd(ctopt(ap->a_size+ap->a_tsiz)); fracmem = ((float)ap->a_rss+szptudot)/CLSIZE/ecmx; if (ap->a_xccount) fracmem += ((float)ap->a_txtrss)/CLSIZE/ ap->a_xccount/ecmx; } return (100.0 * fracmem); } double pcpu() { time_t time; time = mproc->p_time; if (time == 0 || (mproc->p_flag&SLOAD) == 0) return (0.0); if (rawcpu) return (100.0 * mproc->p_pctcpu); return (100.0 * mproc->p_pctcpu / (1.0 - exp(time * log(ccpu)))); } getu() { struct pte *pteaddr, apte; int pad1; /* avoid hardware botch */ struct pte arguutl[UPAGES+CLSIZE]; int pad2; /* avoid hardware botch */ register int i; int ncl, size; size = sflg ? ctob(UPAGES) : sizeof (struct user); if ((mproc->p_flag & SLOAD) == 0) { lseek(swap, ctob(mproc->p_swaddr), 0); if (read(swap, (char *)&user.user, size) != size) { fprintf(stderr, "ps: cant read u for pid %d from %s\n", mproc->p_pid, swapf); return (0); } pcbpf = 0; argaddr = 0; return (1); } pteaddr = &Usrptma[btokmx(mproc->p_p0br) + mproc->p_szpt - 1]; lseek(kmem, kflg ? clear(pteaddr) : (int)pteaddr, 0); if (read(kmem, (char *)&apte, sizeof(apte)) != sizeof(apte)) { printf("ps: cant read indir pte to get u for pid %d from %s\n", mproc->p_pid, swapf); return (0); } lseek(mem, ctob(apte.pg_pfnum+1) - (UPAGES+CLSIZE) * sizeof (struct pte), 0); if (read(mem, (char *)arguutl, sizeof(arguutl)) != sizeof(arguutl)) { printf("ps: cant read page table for u of pid %d from %s\n", mproc->p_pid, swapf); return (0); } if (arguutl[0].pg_fod == 0 && arguutl[0].pg_pfnum) argaddr = ctob(arguutl[0].pg_pfnum); else argaddr = 0; pcbpf = arguutl[CLSIZE].pg_pfnum; ncl = (size + NBPG*CLSIZE - 1) / (NBPG*CLSIZE); while (--ncl >= 0) { i = ncl * CLSIZE; lseek(mem, ctob(arguutl[CLSIZE+i].pg_pfnum), 0); if (read(mem, user.upages[i], CLSIZE*NBPG) != CLSIZE*NBPG) { printf("ps: cant read page %d of u of pid %d from %s\n", arguutl[CLSIZE+i].pg_pfnum, mproc->p_pid, memf); return(0); } } return (1); } char * getcmd() { char cmdbuf[BUFSIZ]; int pad1; /* avoid hardware botch */ union { char argc[CLSIZE*NBPG]; int argi[CLSIZE*NBPG/sizeof (int)]; } argspac; int pad2; /* avoid hardware botch */ register char *cp; register int *ip; char c; int nbad; struct dblock db; if (mproc->p_stat == SZOMB || mproc->p_flag&(SSYS|SWEXIT)) return (""); if (cflg) { strncpy(cmdbuf, u.u_comm, sizeof (u.u_comm)); return (savestr(cmdbuf)); } if ((mproc->p_flag & SLOAD) == 0 || argaddr == 0) { vstodb(0, CLSIZE, &u.u_smap, &db, 1); lseek(swap, ctob(db.db_base), 0); if (read(swap, (char *)&argspac, sizeof(argspac)) != sizeof(argspac)) goto bad; } else { lseek(mem, argaddr, 0); if (read(mem, (char *)&argspac, sizeof (argspac)) != sizeof (argspac)) goto bad; } ip = &argspac.argi[CLSIZE*NBPG/sizeof (int)]; ip -= 2; /* last arg word and .long 0 */ while (*--ip) if (ip == argspac.argi) goto retucomm; *(char *)ip = ' '; ip++; nbad = 0; for (cp = (char *)ip; cp < &argspac.argc[CLSIZE*NBPG]; cp++) { c = *cp & 0177; if (c == 0) *cp = ' '; else if (c < ' ' || c > 0176) { if (++nbad >= 5*(eflg+1)) { *cp++ = ' '; break; } *cp = '?'; } else if (eflg == 0 && c == '=') { while (*--cp != ' ') if (cp <= (char *)ip) break; break; } } *cp = 0; while (*--cp == ' ') *cp = 0; cp = (char *)ip; strncpy(cmdbuf, cp, &argspac.argc[CLSIZE*NBPG] - cp); if (cp[0] == '-' || cp[0] == '?' || cp[0] <= ' ') { strcat(cmdbuf, " ("); strncat(cmdbuf, u.u_comm, sizeof(u.u_comm)); strcat(cmdbuf, ")"); } /* if (xflg == 0 && gflg == 0 && tptr == 0 && cp[0] == '-') return (0); */ return (savestr(cmdbuf)); bad: fprintf(stderr, "ps: error locating command name for pid %d\n", mproc->p_pid); retucomm: strcpy(cmdbuf, " ("); strncat(cmdbuf, u.u_comm, sizeof (u.u_comm)); strcat(cmdbuf, ")"); return (savestr(cmdbuf)); } char *lhdr = " F UID PID PPID CP PRI NI ADDR SZ RSS WCHAN STAT TT TIME"; lpr(sp) struct savcom *sp; { register struct asav *ap = sp->ap; register struct lsav *lp = sp->sun.lp; printf("%6x%4d%6u%6u%3d%4d%3d%5x%4d%5d", ap->a_flag, ap->a_uid, ap->a_pid, lp->l_ppid, lp->l_cpu&0377, ap->a_pri-PZERO, ap->a_nice-NZERO, lp->l_addr, ap->a_size/2, ap->a_rss/2); printf(lp->l_wchan ? " %5x" : " ", (int)lp->l_wchan&0xfffff); printf(" %4.4s ", state(ap)); ptty(ap->a_tty); ptime(ap); } ptty(tp) char *tp; { printf("%-2.2s", tp); } ptime(ap) struct asav *ap; { printf("%3ld:%02ld", ap->a_cpu / hz, ap->a_cpu % hz); } char *uhdr = "USER PID %CPU %MEM SZ RSS TT STAT TIME"; upr(sp) struct savcom *sp; { register struct asav *ap = sp->ap; int vmsize, rmsize; vmsize = (ap->a_size + ap->a_tsiz)/2; rmsize = ap->a_rss/2; if (ap->a_xccount) rmsize += ap->a_txtrss/ap->a_xccount/2; printf("%-8.8s %5d%5.1f%5.1f%5d%5d", getname(ap->a_uid), ap->a_pid, sp->sun.u_pctcpu, pmem(ap), vmsize, rmsize); putchar(' '); ptty(ap->a_tty); printf(" %4.4s", state(ap)); ptime(ap); } char *vhdr = " PID TT STAT TIME SL RE PAGEIN SIZE RSS LIM TSIZ TRS %CPU %MEM"; vpr(sp) struct savcom *sp; { register struct vsav *vp = sp->sun.vp; register struct asav *ap = sp->ap; printf("%5u ", ap->a_pid); ptty(ap->a_tty); printf(" %4.4s", state(ap)); ptime(ap); printf("%3d%3d%7d%5d%5d", ap->a_slptime > 99 ? 99 : ap-> a_slptime, ap->a_time > 99 ? 99 : ap->a_time, vp->v_majflt, ap->a_size/2, ap->a_rss/2); if (ap->a_maxrss == (INFINITY/NBPG)) printf(" xx"); else printf("%5d", ap->a_maxrss/2); printf("%5d%4d%5.1f%5.1f", ap->a_tsiz/2, ap->a_txtrss/2, vp->v_pctcpu, pmem(ap)); } char *shdr = "SSIZ PID TT STAT TIME"; spr(sp) struct savcom *sp; { register struct asav *ap = sp->ap; if (sflg) printf("%4d ", sp->sun.s_ssiz); printf("%5u", ap->a_pid); putchar(' '); ptty(ap->a_tty); printf(" %4.4s", state(ap)); ptime(ap); } char * state(ap) register struct asav *ap; { char stat, load, nice, anom; static char res[5]; switch (ap->a_stat) { case SSTOP: stat = 'T'; break; case SSLEEP: if (ap->a_pri >= PZERO) if (ap->a_slptime >= MAXSLP) stat = 'I'; else stat = 'S'; else if (ap->a_flag & SPAGE) stat = 'P'; else stat = 'D'; break; case SWAIT: case SRUN: case SIDL: stat = 'R'; break; case SZOMB: stat = 'Z'; break; default: stat = '?'; } load = ap->a_flag & SLOAD ? (ap->a_rss>ap->a_maxrss ? '>' : ' ') : 'W'; if (ap->a_nice < NZERO) nice = '<'; else if (ap->a_nice > NZERO) nice = 'N'; else nice = ' '; anom = (ap->a_flag&SUANOM) ? 'A' : ((ap->a_flag&SSEQL) ? 'S' : ' '); res[0] = stat; res[1] = load; res[2] = nice; res[3] = anom; return (res); } /* * Given a base/size pair in virtual swap area, * return a physical base/size pair which is the * (largest) initial, physically contiguous block. */ vstodb(vsbase, vssize, dmp, dbp, rev) register int vsbase; int vssize; struct dmap *dmp; register struct dblock *dbp; { register int blk = DMMIN; register swblk_t *ip = dmp->dm_map; if (vsbase < 0 || vsbase + vssize > dmp->dm_size) panic("vstodb"); while (vsbase >= blk) { vsbase -= blk; if (blk < DMMAX) blk *= 2; ip++; } if (*ip <= 0 || *ip + blk > nswap) panic("vstodb *ip"); dbp->db_size = min(vssize, blk - vsbase); dbp->db_base = *ip + (rev ? blk - (vsbase + dbp->db_size) : vsbase); } /*ARGSUSED*/ panic(cp) char *cp; { #ifdef DEBUG printf("%s\n", cp); #endif } min(a, b) { return (a < b ? a : b); } pscomp(s1, s2) struct savcom *s1, *s2; { register int i; if (uflg) return (s2->sun.u_pctcpu > s1->sun.u_pctcpu ? 1 : -1); if (vflg) return (vsize(s2) - vsize(s1)); i = s1->ap->a_ttyd - s2->ap->a_ttyd; if (i == 0) i = s1->ap->a_pid - s2->ap->a_pid; return (i); } vsize(sp) struct savcom *sp; { register struct asav *ap = sp->ap; register struct vsav *vp = sp->sun.vp; if (ap->a_flag & SLOAD) return (ap->a_rss + ap->a_txtrss / (ap->a_xccount ? ap->a_xccount : 1)); return (vp->v_swrss(( + (ap->a_xccount ? 0 : vp->v_txtswrss)); } #define NMAX 8 #define NUID 2048 char names[NUID][NMAX+1]; /* * Stolen from ls... */ char * getname(uid) { register struct passwd *pw; static init; struct passwd *getpwent(); if (uid >= 0 && uid < NUID && names[uid][0]) return (&names[uid][0]); if (init == 2) return (0); if (init == 0) setpwent(), init = 1; while (pw = getpwent()) { if (pw->pw_uid >= NUID) continue; if (names[pw->pw_uid][0]) continue; strncpy(names[pw->pw_uid], pw->pw_name, NMAX); if (pw->pw_uid == uid) return (&names[uid][0]); } init = 2; endpwent(); return (0); } char *freebase; int nleft; char * alloc(size) int size; { register char *cp; register int i; if (size > nleft) { freebase = (char *)sbrk(i = size > 2048 ? size : 2048); if (freebase == 0) { fprintf(stderr, "ps: ran out of memory\n"); exit(1); } nleft = i - size; } else nleft -= size; cp = freebase; for (i = size; --i >= 0; ) *cp++ = 0; freebase = cp; return (cp - size); } char * savestr(cp) char *cp; { register int len; register char *dp; len = strlen(cp); dp = (char *)alloc(len+1); strcpy(dp, cp); return (dp); } ) int size; { register char *cp; register int i; if (size > nleft) { freebase = (char *)sbrk(i = size > 2048 ? size : 2048); if (freebase == 0) { fprintf(stderr, "ps: ran out of memory\n"); exit(1); } nleft = i - size; } else nleft -= size; cp = freebase; for (i = size; --i >= 0; ) *cp++ = 0; freebase = cp; return (cp - size);cmd/unexpand.c 444 0 33 2514 2416240271 6562 static char *sccsid = "@(#)unexpand.c 4.1 (Berkeley) 10/1/80"; /* * unexpand - put tabs into a file replacing blanks */ #include char genbuf[BUFSIZ]; char linebuf[BUFSIZ]; int all; main(argc, argv) int argc; char *argv[]; { register char *cp; argc--, argv++; if (argv[0][0] == '-') { if (strcmp(argv[0], "-a") != 0) { fprintf(stderr, "usage: unexpand [ -a ] file ...\n"); exit(1); } all++; argc--, argv++; } do { if (argc > 0) { if (freopen(argv[0], "r", stdin) == NULL) { perror(argv[0]); exit(1); } argc--, argv++; } while (fgets(genbuf, BUFSIZ, stdin) != NULL) { for (cp = linebuf; *cp; cp++) continue; if (cp > linebuf) cp[-1] = 0; tabify(all); printf("%s", linebuf); } } while (argc > 0); exit(0); } tabify(c) char c; { register char *cp, *dp; register int dcol; int ocol; ocol = 0; dcol = 0; cp = genbuf, dp = linebuf; for (;;) { switch (*cp) { case ' ': dcol++; break; case '\t': dcol =+ 8; dcol =& ~07; break; default: while (((ocol + 8) &~ 07) <= dcol) { if (ocol + 1 == dcol) break; *dp++ = '\t'; ocol =+ 8; ocol =& ~07; } while (ocol < dcol) { *dp++ = ' '; ocol++; } if (*cp == 0 || c == 0) { strcpy(dp, cp); return; } *dp++ = *cp; ocol++, dcol++; } cp++; } } int dcol; int ocol; ocol = 0; dcol = 0; cp = genbuf, dp = linebuf; for (;;) { switch (*cp) { case ' ': dcol++; break; case '\t': dcol =+ 8; dcol =& ~07; cmd/uniq.c 444 0 33 3634 2416240273 5722 static char *sccsid = "@(#)uniq.c 4.1 (Berkeley) 10/1/80"; /* * Deal with duplicated lines in a file */ #include #include int fields; int letters; int linec; char mode; int uniq; char *skip(); main(argc, argv) int argc; char *argv[]; { static char b1[1000], b2[1000]; while(argc > 1) { if(*argv[1] == '-') { if (isdigit(argv[1][1])) fields = atoi(&argv[1][1]); else mode = argv[1][1]; argc--; argv++; continue; } if(*argv[1] == '+') { letters = atoi(&argv[1][1]); argc--; argv++; continue; } if (freopen(argv[1], "r", stdin) == NULL) printe("cannot open %s\n", argv[1]); break; } if(argc > 2 && freopen(argv[2], "w", stdout) == NULL) printe("cannot create %s\n", argv[2]); if(gline(b1)) exit(0); for(;;) { linec++; if(gline(b2)) { pline(b1); exit(0); } if(!equal(b1, b2)) { pline(b1); linec = 0; do { linec++; if(gline(b1)) { pline(b2); exit(0); } } while(equal(b1, b2)); pline(b2); linec = 0; } } } gline(buf) register char buf[]; { register c; while((c = getchar()) != '\n') { if(c == EOF) return(1); *buf++ = c; } *buf = 0; return(0); } pline(buf) register char buf[]; { switch(mode) { case 'u': if(uniq) { uniq = 0; return; } break; case 'd': if(uniq) break; return; case 'c': printf("%4d ", linec); } uniq = 0; fputs(buf, stdout); putchar('\n'); } equal(b1, b2) register char b1[], b2[]; { register char c; b1 = skip(b1); b2 = skip(b2); while((c = *b1++) != 0) if(c != *b2++) return(0); if(*b2 != 0) return(0); uniq++; return(1); } char * skip(s) register char *s; { register nf, nl; nf = nl = 0; while(nf++ < fields) { while(*s == ' ' || *s == '\t') s++; while( !(*s == ' ' || *s == '\t' || *s == 0) ) s++; } while(nl++ < letters && *s != 0) s++; return(s); } printe(p,s) char *p,*s; { fprintf(stderr, p, s); exit(1); } equal(b1, b2) register char b1[], b2[]; { register char c; b1 = skip(b1); b2 = skip(b2); whilecmd/units.c 444 0 33 14156 2416240274 6132 static char *sccsid = "@(#)units.c 4.1 (Berkeley) 10/1/80"; #include #define NDIM 10 #define NTAB 601 char *dfile = "/usr/lib/units"; char *unames[NDIM]; double getflt(); int fperr(); struct table *hash(); struct unit { double factor; char dim[NDIM]; }; struct table { double factor; char dim[NDIM]; char *name; } table[NTAB]; char names[NTAB*10]; struct prefix { double factor; char *pname; } prefix[] = { 1e-18, "atto", 1e-15, "femto", 1e-12, "pico", 1e-9, "nano", 1e-6, "micro", 1e-3, "milli", 1e-2, "centi", 1e-1, "deci", 1e1, "deka", 1e2, "hecta", 1e2, "hecto", 1e3, "kilo", 1e6, "mega", 1e6, "meg", 1e9, "giga", 1e12, "tera", 0.0, 0 }; FILE *inp; int fperrc; int peekc; int dumpflg; main(argc, argv) char *argv[]; { register i; register char *file; struct unit u1, u2; double f; if(argc>1 && *argv[1]=='-') { argc--; argv++; dumpflg++; } file = dfile; if(argc > 1) file = argv[1]; if ((inp = fopen(file, "r")) == NULL) { printf("no table\n"); exit(1); } signal(8, fperr); init(); loop: fperrc = 0; printf("you have: "); if(convr(&u1)) goto loop; if(fperrc) goto fp; loop1: printf("you want: "); if(convr(&u2)) goto loop1; for(i=0; ifactor); f = 0; for(i=0; idim[i], i, f); if(f&1) { putchar('/'); f = 0; for(i=0; idim[i], i, f); } putchar('\n'); } pu(u, i, f) { if(u > 0) { if(f&2) putchar('-'); if(unames[i]) printf("%s", unames[i]); else printf("*%c*", i+'a'); if(u > 1) putchar(u+'0'); return(2); } if(u < 0) return(1); return(0); } convr(up) struct unit *up; { register struct unit *p; register c; register char *cp; char name[20]; int den, err; p = up; for(c=0; cdim[c] = 0; p->factor = getflt(); if(p->factor == 0.) p->factor = 1.0; err = 0; den = 0; cp = name; loop: switch(c=get()) { case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '-': case '/': case ' ': case '\t': case '\n': if(cp != name) { *cp++ = 0; cp = name; err |= lookup(cp, p, den, c); } if(c == '/') den++; if(c == '\n') return(err); goto loop; } *cp++ = c; goto loop; } lookup(name, up, den, c) char *name; struct unit *up; { register struct unit *p; register struct table *q; register i; char *cp1, *cp2; double e; p = up; e = 1.0; loop: q = hash(name); if(q->name) { l1: if(den) { p->factor /= q->factor*e; for(i=0; idim[i] -= q->dim[i]; } else { p->factor *= q->factor*e; for(i=0; idim[i] += q->dim[i]; } if(c >= '2' && c <= '9') { c--; goto l1; } return(0); } for(i=0; cp1 = prefix[i].pname; i++) { cp2 = name; while(*cp1 == *cp2++) if(*cp1++ == 0) { cp1--; break; } if(*cp1 == 0) { e *= prefix[i].factor; name = cp2-1; goto loop; } } for(cp1 = name; *cp1; cp1++); if(cp1 > name+1 && *--cp1 == 's') { *cp1 = 0; goto loop; } printf("cannot recognize %s\n", name); return(1); } equal(s1, s2) char *s1, *s2; { register char *c1, *c2; c1 = s1; c2 = s2; w((hile(*c1++ == *c2) if(*c2++ == 0) return(1); return(0); } init() { register char *cp; register struct table *tp, *lp; int c, i, f, t; char *np; cp = names; for(i=0; iname = np; lp->factor = 1.0; lp->dim[i] = 1; } lp = hash(""); lp->name = cp-1; lp->factor = 1.0; l0: c = get(); if(c == 0) { printf("%d units; %d bytes\n\n", i, cp-names); if(dumpflg) for(tp = &table[0]; tp < &table[NTAB]; tp++) { if(tp->name == 0) continue; printf("%s", tp->name); units(tp); } fclose(inp); inp = stdin; return; } if(c == '/') { while(c != '\n' && c != 0) c = get(); goto l0; } if(c == '\n') goto l0; np = cp; while(c != ' ' && c != '\t') { *cp++ = c; c = get(); if (c==0) goto l0; if(c == '\n') { *cp++ = 0; tp = hash(np); if(tp->name) goto redef; tp->name = np; tp->factor = lp->factor; for(c=0; cdim[c] = lp->dim[c]; i++; goto l0; } } *cp++ = 0; lp = hash(np); if(lp->name) goto redef; convr(lp); lp->name = np; f = 0; i++; if(lp->factor != 1.0) goto l0; for(c=0; cdim[c]; if(t>1 || (f>0 && t!=0)) goto l0; if(f==0 && t==1) { if(unames[c]) goto l0; f = c+1; } } if(f>0) unames[f-1] = np; goto l0; redef: printf("redefinition %s\n", np); goto l0; } double getflt() { register c, i, dp; double d, e; int f; d = 0.; dp = 0; do c = get(); while(c == ' ' || c == '\t'); l1: if(c >= '0' && c <= '9') { d = d*10. + c-'0'; if(dp) dp++; c = get(); goto l1; } if(c == '.') { dp++; c = get(); goto l1; } if(dp) dp--; if(c == '+' || c == '-') { f = 0; if(c == '-') f++; i = 0; c = get(); while(c >= '0' && c <= '9') { i = i*10 + c-'0'; c = get(); } if(f) i = -i; dp -= i; } e = 1.; i = dp; if(i < 0) i = -i; while(i--) e *= 10.; if(dp < 0) d *= e; else d /= e; if(c == '|') return(d/getflt()); peekc = c; return(d); } get() { register c; if(c=peekc) { peekc = 0; return(c); } c = getc(inp); if (c == EOF) { if (inp == stdin) { printf("\n"); exit(0); } return(0); } return(c); } struct table * hash(name) char *name; { register struct table *tp; register char *np; register unsigned h; h = 0; np = name; while(*np) h = h*57 + *np++ - '0'; if( ((int)h)<0) h= -(int)h; h %= NTAB; tp = &table[h]; l0: if(tp->name == 0) return(tp); if(equal(name, tp->name)) return(tp); tp++; if(tp >= &table[NTAB]) tp = table; goto l0; } fperr() { signal(8, fperr); fperrc++; } ); if (c == EOF) { if (inp == stdin) { printf("\n"); exit(0); } return(0); } return(c); } struct table * hash(name) char *name; { register struct table *tp; register char *np; register unsigned h; h = 0; np = name; while(*np) h = h*57 + *np++ - '0'; if( ((int)h)<0) h= -(int)h; h %= NTAB; tp = &table[h]; l0: if(tp->name == 0) return(tp); if(equal(name, tp->name)) retcmd/update.c 444 0 33 757 2423014712 6206 static char *sccsid = "@(#)update.c 4.2 (Berkeley) 10/15/80"; /* * Update the file system every 30 seconds. * For cache benefit, open certain system directories. */ #include char *fillst[] = { "/bin", "/lib", "/usr", "/usr/bin", "/usr/lib", "/usr/ucb", 0, }; main() { char **f; if(fork()) exit(0); close(0); close(1); close(2); for(f = fillst; *f; f++) open(*f, 0); dosync(); for(;;) pause(); } dosync() { sync(); signal(SIGALRM, dosync); alarm(30); } ,\D"cmd/users.c 444 0 33 1740 2416240276 6106 static char *sccsid = "@(#)users.c 4.1 (Berkeley) 10/1/80"; /* * users */ char *malloc(); #include #include #define NMAX sizeof(utmp.ut_name) #define LMAX sizeof(utmp.ut_line) struct utmp utmp; main(argc, argv) char **argv; { register char *tp, *s; register FILE *fi; s = "/etc/utmp"; if(argc == 2) s = argv[1]; if ((fi = fopen(s, "r")) == NULL) { puts("who: cannot open utmp"); exit(1); } while (fread((char *)&utmp, sizeof(utmp), 1, fi) == 1) { if(utmp.ut_name[0] == '\0') continue; putline(); } summary(); } char *names[128]; char **namp = names; putline() { char temp[NMAX+1]; strncpy(temp, utmp.ut_name, NMAX); temp[NMAX] = 0; *namp = malloc(strlen(temp) + 1); strcpy(*namp++, temp); } scmp(p, q) char **p, **q; { return(strcmp(*p, *q)); } summary() { register char **p; qsort(names, namp - names, sizeof names[0], scmp); for (p=names; p < namp; p++) { if (p != names) printf(" "); printf("%s", *p); } printf("\n"); } 1) { if(utmp.ut_name[0] == '\cmd/uudecode.c 444 0 33 5560 2416240300 6532 static char *sccsid = "@(#)uudecode.c 4.1 (Berkeley) 10/1/80"; /* * uudecode [input] * * create the specified file, decoding as you go. * used with uuencode. */ #include #include #include #include /* single character decode */ #define DEC(c) (((c) - ' ') & 077) main(argc, argv) char **argv; { FILE *in, *out; struct stat sbuf; int mode; char dest[128]; char buf[80]; /* optional input arg */ if (argc > 1) { if ((in = fopen(argv[1], "r")) == NULL) { perror(argv[1]); exit(1); } argv++; argc--; } else in = stdin; if (argc != 1) { printf("Usage: uudecode [infile]\n"); exit(2); } /* search for header line */ for (;;) { if (fgets(buf, sizeof buf, in) == NULL) { fprintf(stderr, "No begin line\n"); exit(3); } if (strncmp(buf, "begin ", 6) == 0) break; } sscanf(buf, "begin %o %s", &mode, dest); /* handle ~user/file format */ if (dest[0] == '~') { char *sl; struct passwd *getpwnam(); char *index(); struct passwd *user; char dnbuf[100]; sl = index(dest, '/'); if (sl == NULL) { fprintf(stderr, "Illegal ~user\n"); exit(3); } *sl++ = 0; user = getpwnam(dest+1); if (user == NULL) { fprintf(stderr, "No such user as %s\n", dest); exit(4); } strcpy(dnbuf, user->pw_dir); strcat(dnbuf, "/"); strcat(dnbuf, sl); strcpy(dest, dnbuf); } /* create output file */ out = fopen(dest, "w"); if (out == NULL) { perror(dest); exit(4); } chmod(dest, mode); decode(in, out); if (fgets(buf, sizeof buf, in) == NULL || strcmp(buf, "end\n")) { fprintf(stderr, "No end line\n"); exit(5); } exit(0); } /* * copy from in to out, decoding as you go along. */ decode(in, out) FILE *in; FILE *out; { char buf[80]; char *bp; int n; for (;;) { /* for each input line */ if (fgets(buf, sizeof buf, in) == NULL) { printf("Short file\n"); exit(10); } n = DEC(buf[0]); if (n <= 0) break; bp = &buf[1]; while (n > 0) { outdec(bp, out, n); bp += 4; n -= 3; } } } /* * output a group of 3 bytes (4 input characters). * the input chars are pointed to by p, they are to * be output to file f. n is used to tell us not to * output all of them at the end of the file. */ outdec(p, f, n) char *p; FILE *f; { int c1, c2, c3; c1 = DEC(*p) << 2 | DEC(p[1]) >> 4; c2 = DEC(p[1]) << 4 | DEC(p[2]) >> 2; c3 = DEC(p[2]) << 6 | DEC(p[3]); if (n >= 1) putc(c1, f); if (n >= 2) putc(c2, f); if (n >= 3) putc(c3, f); } /* fr: like read but stdio */ int fr(fd, buf, cnt) FILE *fd; char *buf; int cnt; { int c, i; for (i=0; i= 1) putc(c1, f); if (n >= 2) putc(c2, f); if (n >= 3) putc(c3, f); } /* fr: like read but stdio */ int fr(fd, buf, cnt) Fcmd/uuencode.c 444 0 33 3226 2416240301 6542 static char *sccsid = "@(#)uuencode.c 4.1 (Berkeley) 10/1/80"; /* * uuencode [input] output * * Encode a file so it can be mailed to a remote system. */ #include #include #include /* ENC is the basic 1 character encoding function to make a char printing */ #define ENC(c) (((c) & 077) + ' ') main(argc, argv) char **argv; { FILE *in; struct stat sbuf; int mode; /* optional 1st argument */ if (argc > 2) { if ((in = fopen(argv[1], "r")) == NULL) { perror(arg((v[1]); exit(1); } argv++; argc--; } else in = stdin; if (argc != 2) { printf("Usage: uuencode [infile] remotefile\n"); exit(2); } /* figure out the input file mode */ fstat(fileno(in), &sbuf); mode = sbuf.st_mode & 0777; printf("begin %o %s\n", mode, argv[1]); encode(in, stdout); printf("end\n"); exit(0); } /* * copy from in to out, encoding as you go along. */ encode(in, out) FILE *in; FILE *out; { char buf[80]; int i, n; for (;;) { /* 1 (up to) 45 character line */ n = fr(in, buf, 45); putc(ENC(n), out); for (i=0; i> 2; c2 = (*p << 4) & 060 | (p[1] >> 4) & 017; c3 = (p[1] << 2) & 074 | (p[2] >> 6) & 03; c4 = p[2] & 077; putc(ENC(c1), f); putc(ENC(c2), f); putc(ENC(c3), f); putc(ENC(c4), f); } /* fr: like read but stdio */ int fr(fd, buf, cnt) FILE *fd; char *buf; int cnt; { int c, i; for (i=0; i> 2; c2 = (*p << 4) & 060 | (p[1] >> 4) & 017; c3 = (p[1] << 2) & 074 | (p[2] >> 6) & 03; c4 = p[2] & 077; putc(ENC(c1), f); putc(ENC(c2), f); putc(ENC(c3), f); putc(ENC(c4), f); } /* fr: like read but stdio */ int fr(fd, buf, cnt)cmd/which.sh 755 0 33 1225 2255054441 6240 # # which : tells you which program you get # hacked to do aliases (from .cshrc file only!) set noglob foreach arg ( $argv ) set alius = `alias $arg` switch ( $#alius ) case 0 : breaksw case 1 : set arg = $alius[1] breaksw default : echo ${arg}: " " aliased to $alius continue endsw unset found if ( $arg:h != $arg:t ) then if ( -e $arg ) then echo $arg else echo $arg not found endif continue else foreach i ( $path ) if ( -x $i/$arg && ! -d $i/$arg ) then echo $i/$arg set found break endif end endif if ( ! $?found ) then echo no $arg in $path endif end arg` switch ( $#alius ) case 0 : breaksw case 1 : set arg = $alius[1] breaksw default : echo ${arg}: " " aliased to $alius continue endsw unset found if ( $arg:h != $arg:t ) then if ( -e $arg ) then echo $arg else echo $arg not found endif continue else foreach i ( $path ) if ( -x $i/$arcmd/uusend.c 444 0 33 7306 2520540744 6253 static char *sccsid = "@(#)uusend.c 4.2 (Berkeley) 4/21/81"; /* * uusend: primative operation to allow uucp like copy of binary files * but handle indirection over systems. * * usage: uusend [-m ooo] localfile sysname1!sysname2!...!destfile * uusend [-m ooo] - sysname1!sysname2!...!destfile * * Author: Mark Horton, May 1980. */ #include #include #include #include /* #define DEBUG "/usr/spool/uucp/uusend.log" */ FILE *in, *out; FILE *dout; FILE *popen(); char *index(); int mode = -1; /* mode to chmod new file to */ char nextsys[20]; /* next system in the chain */ char dnbuf[200]; /* buffer for result of ~user/file */ char cmdbuf[256]; /* buffer to build uux command in */ struct passwd *user; /* entry in /etc/passwd for ~user */ struct passwd *getpwnam(); struct stat stbuf; char *excl; /* location of first ! in destname */ char *sl; /* location of first / in destname */ char *sourcename; /* argv[1] */ char *destname; /* argv[2] */ main(argc, argv) int argc; char **argv; { register int c; register int count = 0; #ifdef DEBUG long t; dout = fopen(DEBUG, "a"); if (dout == NULL) { printf("Cannot append to %s\n", DEBUG); exit(1); } freopen(DEBUG, "a", stdout); freopen(DEBUG, "a", stderr); chmod(DEBUG, 0666); fprintf(dout, "\nuusend run: "); for (c=0; c 1 && argv[1][0] == '-' && argv[1][1]) { switch(argv[1][1]) { case 'm': sscanf(argv[2], "%o", &mode); argc--; argv++; break; default: fprintf(stderr, "Bad flag: %s\n", argv[1]); break; } argc--; argv++; } if (argc != 3) { fprintf(stderr, "Usage: uusend [-m ooo] -/file sys!sys!..!rfile\n"); exit(1); } sourcename = argv[1]; destname = argv[2]; if (sourcename[0] == '-') in = stdin; else { in = fopen(sourcename, "r"); if (in == NULL) { perror(argv[1]); exit(2); } } excl = index(destname, '!'); if (excl) { /* * destname is on a remote system. */ strncpy(nextsys, destname, excl-destname); nextsys[excl-destname] = 0; destname = excl+1; if (mode < 0) { fstat(fileno(in), &stbuf); mode = stbuf.st_mode & 0777; } sprintf(cmdbuf, "uux - -r \"%s!uusend -m %o - \(%s\)\"", nextsys, mode, destname); #ifdef DEBUG fprintf(dout, "remote: nextsys='%s', destname='%s', cmd='%s'\n", nextsys, destname, cmdbuf); #endif out = popen(cmdbuf, "w"); } else { /* * destname is local. */ if (destname[0] == '~') { #ifdef DEBUG fprintf(dout, "before ~: '%s'\n", destname); #endif sl = index(destname, '/'); if (sl == NULL) { fprintf(stderr, "Illegal ~user\n"); exit(3); } *sl++ = 0; user = getpwnam(destname+1); if (user == NULL) { fprintf(stderr, "No such user as %s\n", destname); exit(4); } strcpy(dnbuf, user->pw_dir); strcat(dnbuf, "/"); strcat(dnbuf, sl); destname = dnbuf; } out = fopen(destname, "w"); #ifdef DEBUG fprintf(dout, "local, file='%s'\n", destname); #endif if (out == NULL) { perror(destname); exit(5); } if (mode > 0) chmod(destname, mode); /* don't bother to check it */ } /* * Now, in any case, copy from in to out. */ while ((c=getc(in)) != EOF) { putc(c, out); count++; } #ifdef DEBUG fprintf(dout, "count %d bytes\n", count); fclose(dout); #endif fclose(in); fclose(out); /* really should pclose in that case */ exit(0); } /* * Return the ptr in sp at which the character c appears; * NULL if not found. Included so I don't have to fight the * index/strchr battle. */ #define NULL 0 char * index(sp, c) register char *sp, c; { do { if (*sp == c) return(sp); } while (*sp++); return(NULL); } . */ while ((c=getc(in)) != EOF) { putc(c, out); count++; } #ifdef DEBUG fprintf(dout, "count %d bytes\n", count); fclose(dout); #endif fclose(in); fclose(out); /* really should pclose in that case */ exit(0); } /* * Return the ptr in sp at which the character c appears; * NULL if not found. Icmd/pi/ 775 0 33 0 2552606464 5134 cmd/pi/0.h 644 0 33 46220 2552606432 5546 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)0.h 1.14 6/7/81"; */ #define DEBUG #define CONSETS #define CHAR #define STATIC #define hp21mx 0 #include #include typedef enum {FALSE, TRUE} bool; /* * Option flags * * The following options are recognized in the text of the program * and also on the command line: * * b block buffer the file output * * i make a listing of the procedures and functions in * the following include files * * l make a listing of the program * * n place each include file on a new page with a header * * p disable post mortem and statement limit counting * * t disable run-time tests * * u card image mode; only first 72 chars of input count * * w suppress special diagnostic warnings * * z generate counters for an execution profile */ #ifdef DEBUG bool fulltrace, errtrace, testtrace, yyunique; #endif DEBUG /* * Each option has a stack of 17 option values, with opts giving * the current, top value, and optstk the value beneath it. * One refers to option `l' as, e.g., opt('l') in the text for clarity. */ char opts[ 'z' - 'A' + 1]; short optstk[ 'z' - 'A' + 1]; #define opt(c) opts[c-'A'] /* * Monflg is set when we are generating * a pxp profile. this is set by the -z command line option. */ bool monflg; /* * profflag is set when we are generating a prof profile. * this is set by the -p command line option. */ bool profflag; /* * NOTES ON THE DYNAMIC NATURE OF ((THE DATA STRUCTURES * * Pi uses expandable tables for * its namelist (symbol table), string table * hash table, and parse tree space. The following * definitions specify the size of the increments * for these items in fundamental units so that * each uses approximately 1024 bytes. */ #define STRINC 1024 /* string space increment */ #define TRINC 512 /* tree space increment */ #define HASHINC 509 /* hash table size in words, each increment */ #define NLINC 56 /* namelist increment size in nl structs */ /* * The initial sizes of the structures. * These should be large enough to compile * an "average" sized program so as to minimize * storage requests. * On a small system or and 11/34 or 11/40 * these numbers can be trimmed to make the * compiler smaller. */ #define ITREE 2000 #define INL 200 #define IHASH 509 /* * The following limits on hash and tree tables currently * allow approximately 1200 symbols and 20k words of tree * space. The fundamental limit of 64k total data space * should be exceeded well before these are full. */ /* * TABLE_MULTIPLIER is for uniformly increasing the sizes of the tables */ #ifdef VAX #define TABLE_MULTIPLIER 8 #else #define TABLE_MULTIPLIER 1 #endif VAX #define MAXHASH (4 * TABLE_MULTIPLIER) #define MAXNL (12 * TABLE_MULTIPLIER) #define MAXTREE (30 * TABLE_MULTIPLIER) /* * MAXDEPTH is the depth of the parse stack. * STACK_MULTIPLIER is for increasing its size. */ #ifdef VAX #define STACK_MULTIPLIER 8 #else #define STACK_MULTIPLIER 1 #endif VAX #define MAXDEPTH ( 150 * STACK_MULTIPLIER ) /* * ERROR RELATED DEFINITIONS */ /* * Exit statuses to pexit * * AOK * ERRS Compilation errors inhibit obj productin * NOSTART Errors before we ever got started * DIED We ran out of memory or some such */ #define AOK 0 #define ERRS 1 #define NOSTART 2 #define DIED 3 bool Recovery; #define eholdnl() Eholdnl = 1 #define nocascade() Enocascade = 1 bool Eholdnl, Enocascade; /* * The flag eflg is set whenever we have a hard error. * The character in errpfx will precede the next error message. * When cgenflg is set code generation is suppressed. * This happens whenver we have an error (i.e. if eflg is set) * and when we are walking the tree to determine types only. */ bool eflg; char errpfx; #define setpfx(x) errpfx = x #define standard() setpfx('s') #define warning() setpfx('w') #define recovered() setpfx('e') int cgenflg; /* * The flag syneflg is used to suppress the diagnostics of the form * E 10 a, defined in someprocedure, is neither used nor set * when there were syntax errors in "someprocedure". * In this case, it is likely that these warinings would be spurious. */ bool syneflg; /* * The compiler keeps its error messages in a file. * The variable efil is the unit number on which * this file is open for reading of error message text. * Similarly, the file ofil is the unit of the file * "obj" where we write the interpreter code. */ short efil; short ofil; short obuf[518]; bool Enoline; #define elineoff() Enoline = TRUE #define elineon() Enoline = FALSE /* * SYMBOL TABLE STRUCTURE DEFINITIONS * * The symbol table is henceforth referred to as the "namelist". * It consists of a number of structures of the form "nl" below. * These are contained in a number of segments of the symbol * table which are dynamically allocated as needed. * The major namelist manipulation routines are contained in the * file "nl.c". * * The major components of a namelist entry are the "symbol", giving * a pointer into the string table for the string associated with this * entry and the "class" which tells which of the (currently 19) * possible types of structure this is. * * Many of the classes use the "type" field for a pointer to the type * which the entry has. * * Other pieces of information in more than one class include the block * in which the symbol is defined, flags indicating whether the symbol * has been used and whether it has been assigned to, etc. * * A more complete discussion of the features of the namelist is impossible * here as it would be too voluminous. Refer to the "PI 1.0 Implementation * Notes" for more details. */ /* * The basic namelist structure. * There are also two other variants, defining the real * field as longs or integers given below. * * The array disptab defines the hash header for the symbol table. * Symbols are hashed based on the low 6 bits of their pointer into * the string table; see the routines in the file "lookup.c" and also "fdec.c" * especially "funcend". */ extern struct nl *Fp; extern int pnumcnt; #ifdef PTREE # include "pTree.h" #endif PTREE struct nl { char *symbol; char class, nl_flags; #ifdef PC char extra_flags; /* for where things are */ #endif PC struct nl *type; struct nl *chain, *nl_next; int value[5]; # ifdef PTREE pPointer inTree; # endif PTREE } *nlp, *disptab[077+1]; extern struct nl nl[INL]; struct { char *symbol; char class, nl_flags; #ifdef PC char extra_flags; #endif struct nl *type; struct nl *chain, *nl_next; double real; }; struct { char *symbol; char class, nl_block; #ifdef PC char extra_flags; #endif struct nl *type; struct nl *chain, *nl_next; long range[2]; }; struct { char *symbol; char class, nl_flags; #ifdef PC char extra_flags; #endif struct nl *type; struct nl *chain, *nl_next; int *ptr[4]; #ifdef PI int entloc; #endif PI }; /* * NL FLAGS BITS * * Definitions of the usage of the bits in * the nl_flags byte. Note that the low 5 bits of the * byte are the "nl_block" and that some classes make use * of this byte as a "width". * * The only non-obvious bit definition here is "NFILES" * which records whether a structure contains any files. * Such structures are not allowed to be dynamically allocated. */ #define BLOCKNO( flag ) ( flag & 037 ) #define NLFLAGS( flag ) ( flag &~ 037 ) #define NUSED 0100 #define NMOD 0040 #define NFORWD 0200 #define NFILES 0200 #ifdef PC #define NEXTERN 0001 /* flag used to mark external funcs and procs */ #define NLOCAL 0002 /* variable is a local */ #define NPARAM 0004 /* variable is a parameter */ #define NGLOBAL 0010 /* variable is a global */ #define NREGVAR 0020 /* or'ed in if variable is in a register */ #endif PC /* * used to mark value[ NL_FORV ] for loop variables */ #define FORVAR 1 /* * Definition of the commonly used "value" fields. * The most important one is NL_OFFS which gives * the offset of a variable in its stack mark. */ #define NL_OFFS 0 #define NL_CNTR 1 #define NL_NLSTRT 2 #define NL_LINENO 3 #define NL_FVAR 3 #define NL_FCHAIN 4 #define NL_GOLEV 2 #define NL_GOLINE 3 #define NL_FORV 1 #define NL_FLDSZ 1 #define NL_VARNT 2 #define NL_VTOREC 2 #define NL_TAG 3 #define NL_ELABEL 4 /* * For BADUSE nl structures, NL_KINDS is a bit vector * indicating the kinds of illegal usages complained about * so far. For kind of bad use "kind", "1 << kind" is set. * The low bit is reserved as ISUNDEF to indicate whether * this identifier is totally undefined. */ #define NL_KINDS 0 #define ISUNDEF 1 /* * variables come in three flavors: globals, parameters, locals; * they can also hide in registers, but that's a different flag */ #define PARAMVAR 1 #define LOCALVAR 2 #define GLOBALVAR 3 /* * NAMELIST CLASSES * * The following are the namelist classes. * Different classes make use of the value fields * of the namelist in different ways. * * The namelist should be redesigned by providing * a number of structure definitions with one corresponding * to each namelist class, ala a variant record in Pascal. */ #define BADUSE 0 #define CONST 1 #define TYPE 2 #define VAR 3 #define ARRAY 4 #define PTRFILE 5 #define RECORD 6 #define FIELD 7 #define PROC 8 #define FUNC 9 #define FVAR 10 #define REF 11 #define PTR 12 #define FILET 13 #define SET 14 #define RANGE 15 #define LABEL 16 #define WITHPTR 17 #define SCAL 18 #define STR 19 #define PROG 20 #define IMPROPER 21 #define VARNT 22 #define FPROC 23 #define FFUNC 24 /* * Clnames points to an array of names for the * namelist classes. */ char **clnames; /* * PRE-DEFINED NAMELIST OFFSETS * * The following are the namelist offsets for the * primitive types. The ones which are negative * don't actually exist, but are generated and tested * internally. These definitions are sensitive to the * initializations in nl.c. */ #define TFIRST -7 #define TFILE -7 #define TREC -6 #define TARY -5 #define TSCAL -4 #define TPTR -3 #define TSET -2 #define TSTR -1 #define NIL 0 #define TBOOL 1 #define TCHAR 2 #define TINT 3 #define TDOUBLE 4 #define TNIL 5 #define T1INT 6 #define T2INT 7 #define T4INT 8 #define T1CHAR 9 #define T1BOOL 10 #define T8REAL 11 #define TLAST 11 /* * SEMANTIC DEFINITIONS */ /* * NOCON and SAWCON are flags in the tree telling whether * a constant set is part of an expression. * these are no longer used, * since we now do constant sets at compile time. */ #define NOCON 0 #define SAWCON 1 /* * The variable cbn gives the current block number, * the variable bn is set as a side effect of a call to * lookup, and is the block number of the variable which * was found. */ short bn, cbn; /* * The variable line is the current semantic * line and is set in stat.c from the numbers * embedded in statement type tree nodes. */ short line; /* * The size of the display * which defines the maximum nesting * of procedures and functions allowed. * Because of the flags in the current namelist * this must be no greater than 32. */ #define DSPLYSZ 20 /* * the display is made up of saved AP's and FP's. * FP's are used to find locals, and AP's are used to find parameters. * FP and AP are untyped pointers, but are used throughout as (char *). * the display is used by adding AP_OFFSET or FP_OFFSET to the * address of the approriate display entry. */ struct dispsave { char *savedAP; char *savedFP; } display[ DSPLYSZ ]; #define AP_OFFSET ( 0 ) #define FP_OFFSET ( sizeof(char *) ) /* * formal routine structure: */ struct formrtnhead { long (*fentryaddr)(); /* formal entry point */ long fbn; /* block num((ber of function */ } frtn; #define FENTRYOFFSET 0 #define FBNOFFSET ( FENTRYOFFSET + sizeof frtn.fentryaddr ) #define FDISPOFFSET ( FBNOFFSET + sizeof frtn.fbn ) /* * The following structure is used * to keep track of the amount of variable * storage required by each block. * "Max" is the high water mark, "off" * the current need. Temporaries for "for" * loops and "with" statements are allocated * in the local variable area and these * numbers are thereby changed if necessary. */ struct om { long om_max; long reg_max; struct tmps { long om_off; long reg_off; } curtmps; } sizes[DSPLYSZ]; #define NOREG 0 #define REGOK 1 /* * the following structure records whether a level declares * any variables which are (or contain) files. * this so that the runtime routines for file cleanup can be invoked. */ bool dfiles[ DSPLYSZ ]; /* * Structure recording information about a constant * declaration. It is actually the return value from * the routine "gconst", but since C doesn't support * record valued functions, this is more convenient. */ struct { struct nl *ctype; short cival; double crval; int *cpval; } con; /* * The set structure records the lower bound * and upper bound with the lower bound normalized * to zero when working with a set. It is set by * the routine setran in var.c. */ struct { short lwrb, uprbp; } set; /* * structures of this kind are filled in by precset and used by postcset * to indicate things about constant sets. */ struct csetstr { struct nl *csettype; long paircnt; long singcnt; bool comptime; }; /* * The following flags are passed on calls to lvalue * to indicate how the reference is to affect the usage * information for the variable being referenced. * MOD is used to set the NMOD flag in the namelist * entry for the variable, ASGN permits diagnostics * to be formed when a for variable is assigned to in * the range of the loop. */ #define NOFLAGS 0 #define MOD 01 #define ASGN 02 #define NOUSE 04 /* * the following flags are passed to lvalue and rvalue * to tell them whether an lvalue or rvalue is required. * the semantics checking is done according to the function called, * but for pc, lvalue may put out an rvalue by indirecting afterwards, * and rvalue may stop short of putting out the indirection. */ #define LREQ 01 #define RREQ 02 double MAXINT; double MININT; /* * Variables for generation of profile information. * Monflg is set when we want to generate a profile. * Gocnt record the total number of goto's and * cnts records the current counter for generating * COUNT operators. */ short gocnt; short cnts; /* * Most routines call "incompat" rather than asking "!compat" * for historical reasons. */ #define incompat !compat /* * Parts records which declaration parts have been seen. * The grammar allows the "label" "const" "type" "var" and routine * parts to be repeated and to be in any order, so that * they can be detected semantically to give better * error diagnostics. */ int parts[ DSPLYSZ ]; #define LPRT 1 #define CPRT 2 #define TPRT 4 #define VPRT 8 #define RPRT 16 /* * Flags for the "you used / instead of div" diagnostic */ bool divchk; bool divflg; bool errcnt[DSPLYSZ]; /* * Forechain links those types which are * ^ sometype * so that they can be evaluated later, permitting * circular, recursive list structures to be defined. */ struct nl *forechain; /* * Withlist links all the records which are currently * opened scopes because of with statements. */ struct nl *withlist; struct nl *intset; struct nl *input, *output; struct nl *program; /* progseen flag used by PC to determine if * a routine segment is being compiled (and * therefore no program statement seen) */ bool progseen; /* * STRUCTURED STATEMENT GOTO CHECKING * * The variable level keeps track of the current * "structured statement level" when processing the statement * body of blocks. This is used in the detection of goto's into * structured statements in a block. * * Each label's namelist entry contains two pieces of information * related to this check. The first `NL_GOLEV' either contains * the level at which the label was declared, `NOTYET' if the label * has not yet been declared, or `DEAD' if the label is dead, i.e. * if we have exited the level in which the label was defined. * * When we discover a "goto" statement, if the label has not * been defined yet, then we record the current level and the current line * for a later error check. If the label has been already become "DEAD" * then a reference to it is an error. Now the compiler maintains, * for each block, a linked list of the labels headed by "gotos[bn]". * When we exit a structured level, we perform the routine * ungoto in stat.c. It notices labels whose definition levels have been * exited and makes them be dead. For labels which have not yet been * defined, ungoto will maintain NL_GOLEV as the minimum structured level * since the first usage of the label. It is not hard to see that the label * must eventually be declared at this level or an outer level to this * one or a goto into a structured statement will exist. */ short level; struct nl *gotos[DSPLYSZ]; #define NOTYET 10000 #define DEAD 10000 /* * Noreach is true when the next statement will * be unreachable unless something happens along * (like exiting a looping construct) to save * the day. */ bool noreach; /* * UNDEFINED VARIABLE REFERENCE STRUCTURES */ struct udinfo { int ud_line; struct udinfo *ud_next; char nullch; }; /* * CODE GENERATION DEFINITIONS */ /* * NSTAND is or'ed onto the abstract machine opcode * for non-standard built-in procedures and functions. */ #define NSTAND 0400 #define codeon() cgenflg++ #define codeoff() --cgenflg #define CGENNING ( cgenflg >= 0 ) /* * Codeline is the last lino output in the code generator. * It used to be used to suppress LINO operators but no * more since we now count statements. * Lc is the intepreter code location counter. * short codeline; */ char *lc; /* * Routines which need types * other than "integer" to be * assumed by the compiler. */ double atof(); long lwidth(); long leven(); long aryconst(); long a8tol(); long roundup(); struct nl *tmpalloc(); struct nl *lookup(); double atof(); int *tree(); int *hash(); char *alloc(); int *calloc(); char *savestr(); char *parnam(); bool fcompat(); struct nl *lookup1(); struct nl *hdefnl(); struct nl *defnl(); struct nl *enter(); struct nl *nlcopy(); struct nl *tyrecl(); struct nl *tyary(); struct nl *fields(); struct nl *variants(); struct nl *deffld(); struct nl *defvnt(); struct nl *tyrec1(); struct nl *reclook(); struct nl *asgnop1(); struct nl *gtype(); struct nl *call(); struct nl *lvalue(); struct nl *rvalue(); struct nl *cset(); /* * type cast NIL to keep lint happy (which is not so bad) */ #define NLNIL ( (struct nl *) NIL ) /* * Funny structures to use * pointers in wild and wooly ways */ struct { char pchar; }; struct { short pint; short pint2; }; struct { long plong; }; struct { double pdouble; }; #define OCT 1 #define HEX 2 /* * MAIN PROGRAM VARIABLES, MISCELLANY */ /* * Variables forming a data base referencing * the command line arguments with the "i" option, e.g. * in "pi -i scanner.i compiler.p". */ char **pflist; short pflstc; short pfcnt; char *filename; /* current source file name */ long tvec; extern char *snark; /* SNARK */ extern char *classes[ ]; /* maps namelist classes to string names */ #define derror error #ifdef PC /* * the current function number, for [ lines */ int ftnno; /* * the pc output stream */ FILE *pcstream; #endif PC a data base referencing * the command line arguments with the "i" option, e.g. * in "pi -i scanner.i compiler.p". */ char **pflist; short pflstc; short pfcnt; char *filename; /* current source file name */ long tvec; extern char *snark; /* SNARK */ extern char *classes[ ]; /* maps namelist classes to string names */ #define derror error #ifdef PC /* cmd/pi/OPnames.h 644 0 33 5073 2552606432 6732 /* static char sccsid[] = "@(#)OPnames.h 1.2 10/2/80"; */ char *otext[] = { 0, " NODUMP", " BEG", " END", " CALL", " FCALL", " FRTN", " FSAV", " SDUP2", " SDUP4", " TRA", " TRA4", " GOTO", " LINO", " PUSH", 0, " IF", " REL2", " REL4", " REL24", " REL42", " REL8", " RELG", " RELT", " REL28", " REL48", " REL82", " REL84", " AND", " OR", " NOT", 0, " AS2", " AS4", " AS24", " AS42", " AS21", " AS41", " AS28", " AS48", " AS8", " AS", " INX2P2", " INX4P2", " INX2", " INX4", " OFF", " NIL", " ADD2", " ADD4", " ADD24", " ADD42", " ADD28", " ADD48", " ADD82", " ADD84", " SUB2", " SUB4", " SUB24", " SUB42", " SUB28", " SUB48", " SUB82", " SUB84", " MUL2", " MUL4", " MUL24", " MUL42", " MUL28", " MUL48", " MUL82", " MUL84", " ABS2", " ABS4", " ABS8", 0, " NEG2", " NEG4", " NEG8", 0, " DIV2", " DIV4", " DIV24", " DIV42", " MOD2", " MOD4", " MOD24", " MOD42", " ADD8", " SUB8", " MUL8", " DVD8", " STOI", " STOD", " ITOD", " ITOS", " DVD2", " DVD4", " DVD24", " DVD42", " DVD28", " DVD48", " DVD82", " DVD84", " RV1", " RV14", " RV2", " RV24", " RV4", " RV8", " RV", " LV", " LRV1", " LRV14", " LRV2", " LRV24", " LRV4", " LRV8", " LRV", " LLV", " IND1", " IND14", " IND2", " IND24", " IND4", " IND8", " IND", 0, " CON1", " CON14", " CON2", " CON24", " CON4", " CON8", " CON", " LVCON", " RANG2", " RANG42", " RSNG2", " RSNG42", " RANG4", " RANG24", " RSNG4", " RSNG24", " STLIM", " LLIMIT"((, " BUFF", " HALT", 0, 0, 0, 0, "*ORD2", "*CONG", "*CONC", "*CONC4", "*ABORT", " PXPBUF", " COUNT", 0, " CASE1OP", " CASE2OP", " CASE4OP", "*CASEBEG", "*CASE1", "*CASE2", "*CASE4", "*CASEEND", " ADDT", " SUBT", " MULT", " INCT", " CTTOT", " CARD", " IN", " ASRT", " FOR1U", " FOR2U", " FOR4U", " FOR1D", " FOR2D", " FOR4D", 0, 0, " READE", " READ4", " READC", " READ8", " READLN", " EOF", " EOLN", 0, " WRITEC", " WRITES", " WRITEF", " WRITLN", " PAGE", " NAM", " MAX", " MIN", " UNIT", " UNITINP", " UNITOUT", " MESSAGE", " GET", " PUT", " FNIL", 0, " DEFNAME", " RESET", " REWRITE", " FILE", " REMOVE", " FLUSH", 0, 0, " PACK", " UNPACK", " ARGC", " ARGV", 0, 0, 0, 0, " CLCK", " WCLCK", " SCLCK", " DISPOSE", " NEW", " DATE", " TIME", " UNDEF", " ATAN", " COS", " EXP", " LN", " SIN", " SQRT", " CHR2", " CHR4", " ODD2", " ODD4", " PRED2", " PRED4", " PRED24", " SUCC2", " SUCC4", " SUCC24", " SEED", " RANDOM", " EXPO", " SQR2", " SQR4", " SQR8", " ROUND", " TRUNC" }; MESSAGE", " GET", " PUT", " FNIL", 0, " DEFNAME", " RESET", " REWRITE", " FILE", " REMOVE", " FLUSH", 0, 0, " PACK", " UNPACK", " ARGC", " ARGV", 0, 0, 0, 0, " CLCK", " WCLCK", " SCLCK", " DISPOSE", " NEW", " DATE", " TIME", " UNDEF", " ATAN", " COS", " EXP", " LN", " SIN", " SQRT", " CHR2", " CHR4", " ODD2", " ODD4", " PRED2", " PRED4", " PRED24", " SUCC2", " SUCC4", " SUCC24", " SEED", " RANDOM", " EXcmd/pi/TRdata.c 644 0 33 3343 2552606432 6540 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)TRdata.c 1.1 8/27/80"; #include "whoami.h" #include "0.h" #ifdef PI1 #ifdef DEBUG char *trnames[] { 0, "MINUS", "MOD", "DIV", "DIVD", "MULT", "ADD", "SUB", "EQ", "NE", "LT", "GT", "LE", "GE", "NOT", "AND", "OR", "ASGN", "PLUS", "IN", "LISTPP", "PDEC", "FDEC", "PVAL", "PVAR", "PFUNC", "PPROC", "NIL", "STRNG", "CSTRNG", "PLUSC", "MINUSC", "ID", "INT", "FINT", "CINT", "CFINT", "TYPTR", "TYPACK", "TYSCAL", "TYRANG", "TYARY", "TYFILE", "TYSET", "TYREC", "TYFIELD", "TYVARPT", "TYVARNT", "CSTAT", "BLOCK", "BSTL", "LABEL", "PCALL", "FCALL", "CASE", "WITH", "WHILE", "REPEAT", "FORU", "FORD", "GOTO", "IF", "ASRT", "CSET", "RANG", "VAR", "ARGL", "ARY", "FIELD", "PTR", "WEXP", "PROG", "BINT", "CBINT", "IFEL", "IFX", "TYID", "COPSTR", "BOTTLE", "RFIELD", "FLDLST", "LAST" }; #endif #endif char *trdesc[] { 0, "dp", "dpp", "dpp", "dpp", "dpp", "dpp", "dpp", "dpp", "dpp", "dpp", "dpp", "dpp", "dpp", "dp", "dpp", "dpp", "npp", "dp", "dpp", "pp", "n\"pp", "n\"pp", "pp", "pp", "pp", "p", "d", "dp", "p", "p", "p", "p", "dp", "dp", "p", "p", "np", "np", "np", "npp", "npp", "np", "np", "np", "pp", "nppp", "npp", "npp", "np", "np", "n\"p", "n\"p", "n\"p", "npp", "npp", "npp", "npp", "nppp", "nppp", "n\"", "nppp", "np", "dp", "pp", "n\"p", "p", "p", "pp", "", "ppp", "n\"pp", "dp", "p", "nppp", "nppp", "np", "s", "nnnnn", "npp", "npp", "x" }; char *opnames[] { 0, "unary -", "mod", "div", "/", "*", "+", "-", "=", "<>", "<", ">", "<=", ">=", "not", "and", "or", ":=", "unary +", "in" }; "np", "np", "np", "npp", "npp", "np", "np", "np", "pp", "nppp", "npp", "npp", "np", "np", "n\"p", "n\"p", "n\"p", "npp", "npp", "npp", "npp", "nppp", "nppp", "n\"", "nppp", "np", "dp", "pp", "n\"p", "p", "p", "pp", "", "ppp", "n\"pp", "dp", "p", "cmd/pi/align.h 644 0 33 720 2552606432 6434 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)align.h 1.1 8/27/80"; */ /* * alignment of various types in bytes. * sizes are found using sizeof( type ). */ #define A_CHAR 1 #define A_INT 4 #define A_FLOAT 4 #define A_DOUBLE 4 #define A_LONG 4 #define A_SHORT 2 #define A_POINT 4 #define A_STRUCT 1 #define A_STACK 4 #define A_FILET 4 #define A_SET 4 #define A_MIN 1 #define A_MAX 4  /,"cmd/pi/ato.c 644 0 33 1246 2552606432 6144 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)ato.c 1.2 3/8/81"; #include "whoami.h" #include "0.h" long a8tol(cp) char *cp; { int err; long l; register CHAR c; l = 0; err = 0; while ((c = *cp++) != '\0') { if (c == '8' || c == '9') if (err == 0) { error("8 or 9 in octal number"); err++; } c -= '0'; if ((l & 016000000000L) != 0) if (err == 0) { error("Number too large for this implementation"); err++; } l = (l << 3) | c; } return (l); } /* * Note that the version of atof * used in this compiler does not * (sadly) complain when floating * point numbers are too large. */ char *cp; { int err; long l; register CHAR c; l = 0; err = 0; while ((c = *cp++) != '\0') { if (c == '8' || c == '9') if (err == 0) { error("8 or 9 in octal number"); err++; } c -= '0'; if ((l & 016000000000L) != 0) if (err == 0) { error("Number too large for this implementation"); err++; } l = (l << 3cmd/pi/call.c 644 0 33 31125 2552606433 6314 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)call.c 1.17 6/12/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "opcode.h" #include "objfmt.h" #ifdef PC # include "pc.h" # include "pcops.h" #endif PC /* * Call generates code for calls to * user defined procedures and functions * and is called by proc and funccod. * P is the result of the lookup * of the procedure/function symbol, * and porf is PROC or FUNC. * Psbn is the block number of p. * * the idea here is that regular scalar functions are just called, * while structure functions and formal functions have their results * stored in a temporary after the call. * structure functions do this because they return pointers * to static results, so we copy the static * and return a pointer to the copy. * formal functions do this because we have to save the result * around a call to the runtime routine which restores the display, * so we can't just leave the result lying around in registers. * formal calls save the address of the descriptor in a local * temporary, so it can be addressed for the call which restores * the display (FRTN). * calls to formal parameters pass the formal as a hidden argument * to a special entry point for the formal call. * [this is somewhat dependent on the way arguments are addressed.] * so PROCs and scalar FUNCs look like * p(...args...) * structure FUNCs look like * (temp = p(...args...),&temp) * formal FPROCs look like * ( t=p,( t -> entryaddr )(...args...,t),FRTN( t )) * formal scalar FFUNCs look like * ( t=p,temp=( t -> entryaddr )(...args...,t),FRTN( t ),temp) * formal structure FFUNCs look like * (t=p,temp = ( t -> entryaddr )(...args...,t),FRTN( t ),&temp) */ struct nl * call(p, argv, porf, psbn) struct nl *p; int *argv, porf, psbn; { register struct nl *p1, *q; int *r; struct nl *p_type_class = classify( p -> type ); bool chk = TRUE; # ifdef PC long p_p2type = p2type( p ); long p_type_p2type = p2type( p -> type ); bool noarguments; long calltype; /* type of the call */ /* * these get used if temporaries and structures are used */ struct nl *tempnlp; long temptype; /* type of the temporary */ long p_type_width; long p_type_align; char extname[ BUFSIZ ]; struct nl *tempdescrp; # endif PC # ifdef OBJ if (p->class == FFUNC || p->class == FPROC) { put(2, PTR_RV | psbn << 8+INDX, (int)p->value[NL_OFFS]); } if (porf == FUNC) { /* * Push some space * for the function return type */ put(2, O_PUSH, leven(-lwidth(p->type))); } # endif OBJ # ifdef PC /* * if this is a formal call, * stash the address of the descriptor * in a temporary so we can find it * after the FCALL for the call to FRTN */ if ( p -> class == FFUNC || p -> class == FPROC ) { tempdescrp = tmpalloc(sizeof( struct formalrtn *) , NIL , REGOK ); putRV( 0 , cbn , tempdescrp -> value[ NL_OFFS ] , tempdescrp -> extra_flags , ((P2PTR|P2STRTY ); putRV( 0 , psbn , p -> value[ NL_OFFS ] , p -> extra_flags , P2PTR|P2STRTY ); putop( P2ASSIGN , P2PTR | P2STRTY ); } /* * if we have to store a temporary, * temptype will be its type, * otherwise, it's P2UNDEF. */ temptype = P2UNDEF; calltype = P2INT; if ( porf == FUNC ) { p_type_width = width( p -> type ); switch( p_type_class ) { case TSTR: case TSET: case TREC: case TFILE: case TARY: calltype = temptype = P2STRTY; p_type_align = align( p -> type ); break; default: if ( p -> class == FFUNC ) { calltype = temptype = p2type( p -> type ); } break; } if ( temptype != P2UNDEF ) { tempnlp = tmpalloc(p_type_width, p -> type, NOREG); /* * temp * for (temp = ... */ putRV( 0 , cbn , tempnlp -> value[ NL_OFFS ] , tempnlp -> extra_flags , temptype ); } } switch ( p -> class ) { case FUNC: case PROC: /* * ... p( ... */ sextname( extname , p -> symbol , BLOCKNO(p -> nl_block) ); putleaf( P2ICON , 0 , 0 , p2type( p ) , extname ); break; case FFUNC: case FPROC: /* * ... ( t -> entryaddr )( ... */ putRV( 0 , cbn , tempdescrp -> value[ NL_OFFS ] , tempdescrp -> extra_flags , P2PTR | P2STRTY ); if ( FENTRYOFFSET != 0 ) { putleaf( P2ICON , FENTRYOFFSET , 0 , P2INT , 0 ); putop( P2PLUS , ADDTYPE( ADDTYPE( ADDTYPE( p2type( p ) , P2FTN ) , P2PTR ) , P2PTR ) ); } putop( P2UNARY P2MUL , ADDTYPE( ADDTYPE( p2type( p ) , P2FTN ) , P2PTR ) ); break; default: panic("call class"); } noarguments = TRUE; # endif PC /* * Loop and process each of * arguments to the proc/func. * ... ( ... args ... ) ... */ for (p1 = plist(p); p1 != NIL; p1 = p1->chain) { if (argv == NIL) { error("Not enough arguments to %s", p->symbol); return (NIL); } switch (p1->class) { case REF: /* * Var parameter */ r = argv[1]; if (r != NIL && r[0] != T_VAR) { error("Expression given (variable required) for var parameter %s of %s", p1->symbol, p->symbol); chk = FALSE; break; } q = lvalue( (int *) argv[1], MOD | ASGN , LREQ ); if (q == NIL) { chk = FALSE; break; } if (q != p1->type) { error("Parameter type not identical to type of var parameter %s of %s", p1->symbol, p->symbol); chk = FALSE; break; } break; case VAR: /* * Value parameter */ # ifdef OBJ q = rvalue(argv[1], p1->type , RREQ ); # endif OBJ # ifdef PC /* * structure arguments require lvalues, * scalars use rvalue. */ switch( classify( p1 -> type ) ) { case TFILE: case TARY: case TREC: case TSET: case TSTR: q = rvalue( argv[1] , p1 -> type , LREQ ); break; case TINT: case TSCAL: case TBOOL: case TCHAR: precheck( p1 -> type , "_RANG4" , "_RSNG4" ); q = rvalue( argv[1] , p1 -> type , RREQ ); postcheck( p1 -> type ); break; default: q = rvalue( argv[1] , p1 -> type , RREQ ); if ( isa( p1 -> type , "d" ) && isa( q , "i" ) ) { putop( P2SCONV , P2DOUBLE ); } break; } # endif PC if (q == NIL) { chk = FALSE; break; } if (incompat(q, p1->type, argv[1])) { cerror("Expression type clashed with type of value parameter %s of %s", p1->symbol, p->symbol); chk = FALSE; break; } # ifdef OBJ if (isa(p1->type, "bcsi")) rangechk(p1->type, q); if (q->class != STR) convert(q, p1->type); # endif OBJ # ifdef PC switch( classify( p1 -> type ) ) { case TFILE: case TARY: case TREC: case TSET: case TSTR: putstrop( P2STARG , p2type( p1 -> type ) , lwidth( p1 -> type ) , align( p1 -> type ) ); } # endif PC break; case FFUNC: /* * function parameter */ q = flvalue( (int *) argv[1] , p1 ); chk = (chk && fcompat(q, p1)); break; case FPROC: /* * procedure parameter */ q = flvalue( (int *) argv[1] , p1 ); chk = (chk && fcompat(q, p1)); break; default: panic("call"); } # ifdef PC /* * if this is the nth (>1) argument, * hang it on the left linear list of arguments */ if ( noarguments ) { noarguments = FALSE; } else { putop( P2LISTOP , P2INT ); } # endif PC argv = argv[2]; } if (argv != NIL) { error("Too many arguments to %s", p->symbol); rvlist(argv); return (NIL); } if (chk == FALSE) return NIL; # ifdef OBJ if ( p -> class == FFUNC || p -> class == FPROC ) { put(2, PTR_RV | psbn << 8+INDX, (int)p->value[NL_OFFS]); put(1, O_FCALL); put(2, O_FRTN, even(width(p->type))); } else { put(2, O_CALL | psbn << 8, (long)p->entloc); } # endif OBJ # ifdef PC /* * for formal calls: add the hidden argument * which is the formal struct describing the * environment of the routine. * and the argument which is the address of the * space into which to save the display. */ if ( p -> class == FFUNC || p -> class == FPROC ) { putRV( 0 , cbn , tempdescrp -> value[ NL_OFFS ] , tempdescrp -> extra_flags , P2PTR|P2STRTY ); if ( !noarguments ) { putop( P2LISTOP , P2INT ); } noarguments = FALSE; } /* * do the actual call: * either ... p( ... ) ... * or ... ( t -> entryaddr )( ... ) ... * and maybe an assignment. */ if ( porf == FUNC ) { switch ( p_type_class ) { case TBOOL: case TCHAR: case TINT: case TSCAL: case TDOUBLE: case TPTR: putop( ( noarguments ? P2UNARY P2CALL : P2CALL ) , p_type_p2type ); if ( p -> class == FFUNC ) { putop( P2ASSIGN , p_type_p2type ); } break; default: putstrop( ( noarguments ? P2UNARY P2STCALL : P2STCALL ), ADDTYPE( p_type_p2type , P2PTR ) , p_type_width , p_type_align ); putstrop( P2STASG , p_type_p2type , lwidth( p -> type ) , align( p -> type ) ); break; } } else { putop( ( noarguments ? P2UNARY P2CALL : P2CALL ) , P2INT ); } /* * ( t=p , ... , FRTN( t ) ... */ if ( p -> class == FFUNC || p -> class == FPROC ) { putop( P2COMOP , P2INT ); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_FRTN" ); putRV( 0 , cbn , tempdescrp -> value[ NL_OFFS ] , tempdescrp -> extra_flags , P2PTR | P2STRTY ); putop( P2CALL , P2INT ); putop( P2COMOP , P2INT ); } /* * if required: * either ... , temp ) * or ... , &temp ) */ if ( porf == FUNC && temptype != P2UNDEF ) { if ( temptype != P2STRTY ) { putRV( 0 , cbn , tempnlp -> value[ NL_OFFS ] , tempnlp -> extra_flags , p_type_p2type ); } else { putLV( 0 , cbn , tempnlp -> value[ NL_OFFS ] , tempnlp -> extra_flags , p_type_p2type ); } putop( P2COMOP , P2INT ); } if ( porf == PROC ) { putdot( filename , line ); } # endif PC return (p->type); } rvlist(al) register int *al; { for (; al != NIL; al = al[2]) rvalue( (int *) al[1], NLNIL , RREQ ); } /* * check that two function/procedure namelist entries are compatible */ bool fcompat( formal , actual ) struct nl *formal; struct nl *actual; { register struct nl *f_chain; register struct nl *a_chain; bool compat = TRUE; if ( formal == NIL || actual == NIL ) { return FALSE; } for (a_chain = plist(actual), f_chain = plist(formal); f_chain != NIL; f_chain = f_chain->chain, a_chain = a_chain->chain) { if (a_chain == NIL) { error("%s %s declared on line %d has more arguments than", parnam(formal->class), formal->symbol, linenum(formal)); cerror("%s %s declared on line %d", parnam(actual->class), actual->symbol, linenum(actual)); return FALSE; } if ( a_chain -> class != f_chain -> class ) { error("%s parameter %s of %s declared on line %d is not identical", parnam(f_chain->class), f_chain->symbol, formal->symbol, linenum(formal)); cerror("with %s parameter %s of %s declared on line %d", parnam(a_chain->class), a_chain->symbol, actual->symbol, linenum(actual)); compat = FALSE; } else if (a_chain->class == FFUNC || a_chain->class == FPROC) { compat = (compat && fcompat(f_chain, a_chain)); } if ((a_chain->class != FPROC && f_chain->class != FPROC) && (a_chain->type != f_chain->type)) { error("Type of %s parameter %s of %s declared on line %d is not identical", parnam(f_chain->class), f_chain->symbol, formal->symbol, linenum(formal)); cerror("to type of %s parameter %s of %s declared on line %d", parnam(a_chain->class), a_chain->symbol, actual->symbol, linenum(actual)); compat = FALSE; } } if (a_chain != NIL) { error("%s %s declared on line %d has fewer arguments than", parnam(formal->class), formal->symbol, linenum(formal)); cerror("%s %s declared on line %d", parnam(actual->class), actual->symbol, linenum(actual)); return FALSE; } return compat; } char * parnam(nltype) int nltype; { switch(nltype) { case REF: return "var"; case VAR: return "value"; case FUNC: case FFUNC: return "function"; case PROC: case FPROC: return "procedure"; default: return "SNARK"; } } plist(p) struct nl *p; { switch (p->class) { case FFUNC: case FPROC: return p->ptr[ NL_FCHAIN ]; case PROC: case FUNC: return p->chain; default: panic("plist"); } } linenum(p) struct nl *p; { if (p->class == FUNC) return p->ptr[NL_FVAR]->value[NL_LINENO]; return p->value[NL_LINENO]; } n "var"; case VAR: return "value"; case FUNC: case FFUNC: return "function"; case PROC: case FPROC: return "procedure"; default: return "SNARK"; } } plist(p) struct nl *p; { switch (p->class) { case FFUNC: case FPROC: return p->ptr[ NL_FCHAIN ]; case PROC: case FUNC: return p->chain; default: panic("plist"); } } linenum(p) struct nl *p; { if (p->class =((cmd/pi/case.c 644 0 33 6562 2552606433 6303 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)case.c 1.3 3/8/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "opcode.h" /* * The structure used to * hold information about * each case label. */ struct ct { long clong; int cline; }; #ifdef OBJ /* * Caseop generates the * pascal case statement code */ caseop(r) int *r; { register struct nl *p; register struct ct *ctab; register *cs; int *cl; double low, high; short *brtab; char *brtab0; char *csend; int w, i, j, m, n; int goc; bool nr; goc = gocnt; /* * Obtain selector attributes: * p type * w width * low lwb(p) * high upb(p) */ p = rvalue((int *) r[2], NLNIL , RREQ ); if (p != NIL) { if (isnta(p, "bcsi")) { error("Case selectors cannot be %ss", nameof(p)); p = NIL; } else { cl = p; if (p->class != RANGE) cl = p->type; if (cl == NIL) p = NIL; else { w = width(p); #ifdef DEBUG if (hp21mx) w = 2; #endif low = cl->range[0]; high = cl->range[1]; } } } /* * Count # of cases */ n = 0; for (cl = r[3]; cl != NIL; cl = cl[2]) { cs = cl[1]; if (cs == NIL) continue; for (cs = cs[2]; cs != NIL; cs = cs[2]) n++; } /* * Allocate case table space */ ctab = i = malloc(n * sizeof *ctab); if (i == 0) { error("Ran out of memory (case)"); pexit(DIED); } /* * Check the legality of the * labels and count the number * of good labels */ m = 0; for (cl = r[3]; cl != NIL; cl = cl[2]) { cs = cl[1]; if (cs == NIL) continue; line = cs[1]; for (cs = cs[2]; cs != NIL; cs = cs[2]) { gconst(cs[1]); if (p == NIL || con.ctype == NIL) continue; if (incompat(con.ctype, p, NIL )) { cerror("Case label type clashed with case selector expression type"); continue; } if (con.crval < low || con.crval > high) { error("Case label out of range"); continue; } ctab[m].clong = con.crval; ctab[m].cline = line; m++; } } /* * Check for duplicate labels */ for (i = 0; i < m; i++) for (j = 0; j < m; j++) if (ctab[i].clong == ctab[j].clong) { if (i == j) continue; if (j < i) break; error("Multiply defined label in case, lines %d and %d", ctab[i].cline, ctab[j].cline); } /* * Put out case operator and * leave space for the * branch table */ if (p != NIL) { put(2, O_CASE1OP + (w >> 1), n); brtab = brtab0 = lc; putspace(n * 2); put(1, O_CASEBEG); for (i=0; i> 1), (int)ctab[i].clong); else put(2 ,O_CASE4, ctab[i].clong); put(1, O_CASEEND); } csend = getlab(); put(2, O_TRA, csend); /* * Free the case * table space. */ free(ctab); /* * Generate code for each * statement. Patch branch * table to beginning of each * statement and follow each * statement with a branch back * to the TRA above. */ nr = TRUE; for (cl = r[3]; cl != NIL; cl = cl[2]) { cs = cl[1]; if (cs == NIL) continue; if (p != NIL) for (cs = cs[2]; cs != NIL; cs = cs[2]) { patchfil(brtab - 1, (long)(lc - brtab0), 1); brtab++; } cs = cl[1]; putcnt(); level++; statement(cs[3]); nr = (noreach && nr); noreach = 0; put(2, O_TRA, csend); level--; if (gotos[cbn]) ungoto(); } /* * Patch the termination branch */ patch(csend); noreach = nr; if (goc != gocnt) putcnt(); } #endif OBJ */ nr = TRUE; for (cl = r[3]; cl != NIL; cl = cl[2]) { cs = cl[1]; if (cs == NIL) continue; if (p != NIL) for (cs = cs[2]; cs cmd/pi/clas.c 644 0 33 7575 2552606433 6317 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)clas.c 1.4 6/1/81"; #include "whoami.h" #include "0.h" #include "tree.h" /* * This is the array of class * names for the classes returned * by classify. The order of the * classes is the same as the base * of the namelist, with special * negative index entries for structures, * scalars, pointers, sets and strings * to be collapsed into. */ char *clnxxxx[] = { "file", /* -7 TFILE */ "record", /* -6 TREC */ "array", /* -5 TARY */ "scalar", /* -4 TSCAL */ "pointer", /* -3 TPTR */ "set", /* -2 TSET */ "string", /* -1 TSTR */ "SNARK", /* 0 NIL */ "Boolean", /* 1 TBOOL */ "char", /* 2 TCHAR */ "integer", /* 3 TINT */ "real", /* 4 TREAL */ "\"nil\"", /* 5 TNIL */ }; char **clnames = &clnxxxx[-(TFIRST)]; /* * Classify takes a pointer * to a type and returns one * of several interesting group * classifications for easy use. */ classify(p1) struct nl *p1; { register struct nl *p; p = p1; swit: if (p == NIL) { nocascade(); return (NIL); } if (p == &nl[TSTR]) return (TSTR); if ( p == &nl[ TSET ] ) { return TSET; } switch (p->class) { case PTR: return (TPTR); case ARRAY: if (p->type == nl+T1CHAR) return (TSTR); return (TARY); case STR: return (TSTR); case SET: return (TSET); case RANGE: p = p->type; goto swit; case TYPE: if (p <= nl+TLAST) return (p - nl); panic("clas2"); case FILET: return (TFILE); case RECORD: return (TREC); case SCAL: return (TSCAL); default: panic("clas"); } } #ifndef PI0 /* * Is p a text file? */ text(p) struct nl *p; { return (p != NIL && p->class == FILET && p->type == nl+T1CHAR); } #endif /* * Scalar returns a pointer to * the the base scalar type of * its argument if its argument * is a SCALar else NIL. */ scalar(p1) struct nl *p1; { register struct nl *p; p = p1; if (p == NIL) return (NIL); if (p->class == RANGE) p = p->type; if (p == NIL) return (NIL); return (p->class == SCAL ? p : NIL); } /* * Isa tells whether p * is one of a group of * namelist classes. The * classes wanted are specified * by the characters in s. * (Note that s would more efficiently, * if less clearly, be given by a mask.) */ isa(p, s) register struct nl *p; char *s; { register i; register char *cp; if (p == NIL) return (NIL); /* * map ranges down to * the base type */ if (p->class == RANGE) p = p->type; /* * the following character/class * associations are made: * * s scalar * b Boolean * c character * i integer * d double (real) * t set */ switch (p->class) { case SET: i = TDOUBLE+1; break; case SCAL: i = 0; break; default: i = p - nl; } if (i >= 0 && i <= TDOUBLE+1) { i = "sbcidt"[i]; cp = s; while (*cp) if (*cp++ == i) return (1); } return (NIL); } /* * Isnta is !isa */ isnta(p, s) { return (!isa(p, s)); } /* * "shorthand" */ nameof(p) { return (clnames[classify(p)]); } #ifndef PI0 nowexp(r) int *r; { if (r[0] == T_WEXP) { if (r[2] == NIL) error("Oct/hex allowed only on writeln/write calls"); else error("Width expressions allowed only in writeln/write calls"); return (1); } return (NIL); } #endif /* * is a variable a local, a formal parameter, or a global? * all this from just the offset: * globals are at levels 0 or 1 * positives are parameters * negative evens are locals */ whereis( level , offset , extra_flags ) int level; int offset; char extra_flags; { # ifdef OBJ return ( offset >= 0 ? PARAMVAR : LOCALVAR ); # endif OBJ # ifdef PC switch ( extra_flags & ( NGLOBAL | NPARAM | NLOCAL ) ) { case NGLOBAL: return GLOBALVAR; case NPARAM: return PARAMVAR; case NLOCAL: return LOCALVAR; default: panic( "whereis" ); } # endif PC } t levels 0 or 1 * positives are parameters * negative evens are locals */ whereis( level , offset , extra_flcmd/pi/const.c 644 0 33 10563 2552606433 6532 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)const.c 1.4 9/4/80"; #include "whoami.h" #include "0.h" #include "tree.h" /* * Const enters the definitions * of the constant declaration * part into the namelist. */ #ifndef PI1 constbeg() { /* * this allows for multiple declaration * parts, unless the "standard" option * has been specified. * If a routine segment is being compiled, * do level one processing. */ if (!progseen) level1(); if (parts[ cbn ] & (TPRT|VPRT|RPRT)) { if ( opt( 's' ) ) { standard(); } else { warning(); } error("Constant declarations should precede type, var and routine declarations"); } if (parts[ cbn ] & CPRT) { if ( opt( 's' ) ) { standard(); } else { warning(); } error("All constants should be declared in one const part"); } parts[ cbn ] |= CPRT; } #endif PI1 const(cline, cid, cdecl) int cline; register char *cid; register int *cdecl; { register struct nl *np; #ifd((ef PI0 send(REVCNST, cline, cid, cdecl); #endif line = cline; gconst(cdecl); np = enter(defnl(cid, CONST, con.ctype, con.cival)); #ifndef PI0 np->nl_flags |= NMOD; #endif #ifdef PC if (cbn == 1) { stabgconst( cid , line ); } #endif PC # ifdef PTREE { pPointer Const = ConstDecl( cid , cdecl ); pPointer *Consts; pSeize( PorFHeader[ nesting ] ); Consts = &( pDEF( PorFHeader[ nesting ] ).PorFConsts ); *Consts = ListAppend( *Consts , Const ); pRelease( PorFHeader[ nesting ] ); } # endif if (con.ctype == NIL) return; if ( con.ctype == nl + TSTR ) np->ptr[0] = con.cpval; if (isa(con.ctype, "i")) np->range[0] = con.crval; else if (isa(con.ctype, "d")) np->real = con.crval; } #ifndef PI0 #ifndef PI1 constend() { } #endif #endif /* * Gconst extracts * a constant declaration * from the tree for it. * only types of constants * are integer, reals, strings * and scalars, the first two * being possibly signed. */ gconst(r) int *r; { register struct nl *np; register *cn; char *cp; int negd, sgnd; long ci; con.ctype = NIL; cn = r; negd = sgnd = 0; loop: if (cn == NIL || cn[1] == NIL) return (NIL); switch (cn[0]) { default: panic("gconst"); case T_MINUSC: negd = 1 - negd; case T_PLUSC: sgnd++; cn = cn[1]; goto loop; case T_ID: np = lookup(cn[1]); if (np == NIL) return; if (np->class != CONST) { derror("%s is a %s, not a constant as required", cn[1], classes[np->class]); return; } con.ctype = np->type; switch (classify(np->type)) { case TINT: con.crval = np->range[0]; break; case TDOUBLE: con.crval = np->real; break; case TBOOL: case TCHAR: case TSCAL: con.cival = np->value[0]; con.crval = con.cival; break; case TSTR: con.cpval = np->ptr[0]; break; case NIL: con.ctype = NIL; return; default: panic("gconst2"); } break; case T_CBINT: con.crval = a8tol(cn[1]); goto restcon; case T_CINT: con.crval = atof(cn[1]); if (con.crval > MAXINT || con.crval < MININT) { derror("Constant too large for this implementation"); con.crval = 0; } restcon: ci = con.crval; #ifndef PI0 if (bytes(ci, ci) <= 2) con.ctype = nl+T2INT; else #endif con.ctype = nl+T4INT; break; case T_CFINT: con.ctype = nl+TDOUBLE; con.crval = atof(cn[1]); break; case T_CSTRNG: cp = cn[1]; if (cp[1] == 0) { con.ctype = nl+T1CHAR; con.cival = cp[0]; con.crval = con.cival; break; } con.ctype = nl+TSTR; con.cpval = savestr(cp); break; } if (sgnd) { if (isnta(con.ctype, "id")) derror("%s constants cannot be signed", nameof(con.ctype)); else { if (negd) con.crval = -con.crval; ci = con.crval; } } } #ifndef PI0 isconst(r) register int *r; { if (r == NIL) return (1); switch (r[0]) { case T_MINUS: r[0] = T_MINUSC; r[1] = r[2]; return (isconst(r[1])); case T_PLUS: r[0] = T_PLUSC; r[1] = r[2]; return (isconst(r[1])); case T_VAR: if (r[3] != NIL) return (0); r[0] = T_ID; r[1] = r[2]; return (1); case T_BINT: r[0] = T_CBINT; r[1] = r[2]; return (1); case T_INT: r[0] = T_CINT; r[1] = r[2]; return (1); case T_FINT: r[0] = T_CFINT; r[1] = r[2]; return (1); case T_STRNG: r[0] = T_CSTRNG; r[1] = r[2]; return (1); } return (0); } #endif T_MINUSC; r[1] = r[2]; return (isconst(r[1])); case T_PLUS: r[0] = T_PLUSC; r[1] = r[2]; return (isconst(r[1])); case T_VAcmd/pi/conv.c 644 0 33 15712 2552606434 6353 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)conv.c 1.2 3/8/81"; #include "whoami.h" #ifdef PI #include "0.h" #include "opcode.h" #ifdef PC # include "pcops.h" #endif PC #ifndef PI0 /* * Convert a p1 into a p2. * Mostly used for different * length integers and "to real" conversions. */ convert(p1, p2) struct nl *p1, *p2; { if (p1 == NIL || p2 == NIL) return; switch (width(p1) - width(p2)) { case -7: case -6: put(1, O_STOD); return; case -4: put(1, O_ITOD); return; case -3: case -2: put(1, O_STOI); return; case -1: case 0: case 1: return; case 2: case 3: put(1, O_ITOS); return; default: panic("convert"); } } #endif /* * Compat tells whether * p1 and p2 are compatible * types for an assignment like * context, i.e. value parameters, * indicies for 'in', etc. */ compat(p1, p2, t) struct nl *p1, *p2; { register c1, c2; c1 = classify(p1); if (c1 == NIL) return (NIL); c2 = classify(p2); if (c2 == NIL) return (NIL); switch (c1) { case TBOOL: case TCHAR: if (c1 == c2) return (1); break; case TINT: if (c2 == TINT) return (1); case TDOUBLE: if (c2 == TDOUBLE) return (1); #ifndef PI0 if (c2 == TINT && divflg == 0 && t != NIL ) { divchk= 1; c1 = classify(rvalue(t, NLNIL , RREQ )); divchk = NIL; if (c1 == TINT) { error("Type clash: real is incompatible with integer"); cerror("This resulted because you used '/' which always returns real rather"); cerror("than 'div' which divides integers and returns integers"); divflg = 1; return (NIL); } } #endif break; case TSCAL: if (c2 != TSCAL) break; if (scalar(p1) != scalar(p2)) { derror("Type clash: non-identical scalar types"); return (NIL); } return (1); case TSTR: if (c2 != TSTR) break; if (width(p1) != width(p2)) { derror("Type clash: unequal length strings"); return (NIL); } return (1); case TNIL: if (c2 != TPTR) break; return (1); case TFILE: if (c1 != c2) break; derror("Type clash: files not allowed in this context"); return (NIL); default: if (c1 != c2) break; if (p1 != p2) { derror("Type clash: non-identical %s types", clnames[c1]); return (NIL); } if (p1->nl_flags & NFILES) { derror("Type clash: %ss with file components not allowed in this context", clnames[c1]); return (NIL); } return (1); } derror("Type clash: %s is incompatible with %s", clnames[c1], clnames[c2]); return (NIL); } #ifndef PI0 /* * Rangechk generates code to * check if the type p on top * of the stack is in range for * assignment to a variable * of type q. */ rangechk(p, q) struct nl *p, *q; { register struct nl *rp; register op; int wq, wrp; if (opt('t') == 0) return; rp = p; if (rp == NIL) return; if (q == NIL) return; # ifdef OBJ /* * When op is 1 we are checking length * 4 numbers against length 2 bounds, * and adding it to the opcode forces * generation of appropriate tests. */ op = 0; wq = width(q); wrp = width(rp); op = wq != wrp && (wq == 4 || wrp == 4); if (rp->class == TYPE) rp = rp->type; switch (rp->class) { case RANGE: if (rp->range[0] != 0) { # ifndef DEBUG if (wrp <= 2) put(3, O_RANG2+op, ( short ) rp->range[0], ( short ) rp->range[1]); else if (rp != nl+T4INT) put(3, O_RANG4+op, rp->range[0], rp->range[1] ); # else if (!hp21mx) { if (wrp <= 2) put(3, O_RANG2+op,( short ) rp->range[0], ( short ) rp->range[1]); else if (rp != nl+T4INT) put(3, O_RANG4+op,rp->range[0], rp->range[1]); } else if (rp != nl+T2INT && rp != nl+T4INT) put(3, O_RANG2+op,( short ) rp->range[0], ( short ) rp->range[1]); # endif break; } /* * Range whose lower bounds are * zero can be treated as scalars. */ case SCAL: if (wrp <= 2) put(2, O_RSNG2+op, ( short ) rp->range[1]); else put( 2 , O_RSNG4+op, rp->range[1]); break; default: panic("rangechk"); } # endif OBJ # ifdef PC /* * what i want to do is make this and some other stuff * arguments to a function call, which will do the rangecheck, * and return the value of the current expression, or abort * if the rangecheck fails. * probably i need one rangecheck routine to return each c-type * of value. * also, i haven't figured out what the `other stuff' is. */ putprintf( "# call rangecheck" , 0 ); # endif PC } #endif #endif #ifdef PC /* * if type p requires a range check, * then put out the name of the checking function * for the beginning of a function call which is completed by postcheck. * (name1 is for a full check; name2 assumes a lower bound of zero) */ precheck( p , name1 , name2 ) struct nl *p; char *name1 , *name2; { if ( opt( 't' ) == 0 ) { return; } if ( p == NIL ) { return; } if ( p -> class == TYPE ) { p = p -> type; } switch ( p -> class ) { case RANGE: if ( p != nl + T4INT ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , p -> range[0] != 0 ? name1 : name2 ); } break; case SCAL: /* * how could a scalar ever be out of range? */ break; default: panic( "precheck" ); break; } } /* * if type p requires a range check, * then put out the rest of the arguments of to the checking function * a call to which was started by precheck. * the first argument is what is being rangechecked (put out by rvalue), * the second argument is the lower bound of the range, * the third argument is the upper bound of the range. */ postcheck( p ) struct nl *p; { if ( opt( 't' ) == 0 ) { return; } if ( p == NIL ) { return; } if ( p -> class == TYPE ) { p = p -> type; } ((switch ( p -> class ) { case RANGE: if ( p != nl + T4INT ) { if (p -> range[0] != 0 ) { putleaf( P2ICON , p -> range[0] , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); } putleaf( P2ICON , p -> range[1] , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); } break; case SCAL: break; default: panic( "postcheck" ); break; } } #endif PC #ifdef DEBUG conv(dub) int *dub; { int newfp[2]; double *dp = dub; long *lp = dub; register int exp; long mant; newfp[0] = dub[0] & 0100000; newfp[1] = 0; if (*dp == 0.0) goto ret; exp = ((dub[0] >> 7) & 0377) - 0200; if (exp < 0) { newfp[1] = 1; exp = -exp; } if (exp > 63) exp = 63; dub[0] &= ~0177600; dub[0] |= 0200; mant = *lp; mant <<= 8; if (newfp[0]) mant = -mant; newfp[0] |= (mant >> 17) & 077777; newfp[1] |= (((int) (mant >> 1)) & 0177400) | (exp << 1); ret: dub[0] = newfp[0]; dub[1] = newfp[1]; } #endif t newfp[2]; double *dp = dub; long *lp = dub; regiscmd/pi/cset.c 644 0 33 27300 2552606434 6340 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)cset.c 1.6 3/20/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "opcode.h" #include "objfmt.h" #ifdef PC #include "pc.h" #include "pcops.h" #endif PC /* * CONSETS causes compile time constant sets to be constructed here. * * COMPSETSZE defines the maximum number of longs to be used in * constant set construction */ #define CONSETS #define COMPSETSZE 10 #define BITSPERBYTE 8 #define BITSPERLONG 32 #define LG2BITSBYTE 3 #define MSKBITSBYTE 0x07 #define LG2BITSLONG 5 #define MSKBITSLONG 0x1f /* * rummage through a `constant' set (i.e. anything within [ ]'s) tree * and decide if this is a compile time constant set or a runtime set. * this information is returned in a structure passed from the caller. * while rummaging, this also reorders the tree so that all ranges * preceed all singletons. */ bool precset( r , settype , csetp ) int *r; struct nl *settype; struct csetstr *csetp; { register int *e; register struct nl *t; register struct nl *exptype; register int *el; register int *pairp; register int *singp; int *ip; int lower; int upper; bool setofint; csetp -> csettype = NIL; csetp -> paircnt = 0; csetp -> singcnt = 0; csetp -> comptime = TRUE; setofint = FALSE; if ( settype != NIL ) { if ( settype -> class == SET ) { /* * the easy case, we are told the type of the set. */ exptype = settype -> type; } else { /* * we are told the type, but it's not a set * supposedly possible if someone tries * e.g string context [1,2] = 'abc' */ error("Constant set involved in non set context"); return csetp -> comptime; } } else { /* * So far we have no indication * of what the set type should be. * We "look ahead" and try to infer * The type of the constant set * by evaluating one of its members. */ e = r[2]; if (e == NIL) { /* * tentative for [], return type of `intset' */ settype = lookup( intset ); if ( settype == NIL ) { panic( "empty set" ); } settype = settype -> type; if ( settype == NIL ) { return csetp -> comptime; } if ( isnta( settype , "t" ) ) { error("Set default type \"intset\" is not a set"); return csetp -> comptime; } csetp -> csettype = settype; setran( settype -> type ); if (((set.uprbp + 1) >> LG2BITSLONG) >= COMPSETSZE) csetp -> comptime = FALSE; return csetp -> comptime; } e = e[1]; if (e == NIL) { return csetp -> comptime; } if (e[0] == T_RANG) { e = e[1]; } codeoff(); t = rvalue(e, NIL , RREQ ); codeon(); if (t == NIL) { return csetp -> comptime; } /* * The type of the set, settype, is * deemed to be a set of the base type * of t, which we call exptype. If, * however, this would involve a * "set of integer", we cop out * and use "intset"'s current scoped * type instead. */ if (isa(t, "r")) { error("Sets may not have 'real' elements"); return csetp -> comptime; } if (isnta(t, "bcsi")) { error("Set elements must be scalars, not %ss", nameof(t)); return csetp -> comptime; } if (isa(t, "i")) { settype = lookup(intset); if (settype == NIL) panic("intset"); settype = settype->type; if (settype == NIL) return csetp -> comptime; if (isnta(settype, "t")) { error("Set default type \"intset\" is not a set"); return csetp -> comptime; } exptype = settype->type; /* * say we are doing an intset * but, if we get out of range errors for intset * we punt constructing the set at compile time. */ setofint = TRUE; } else { exptype = t->type; if (exptype == NIL) return csetp -> comptime; if (exptype->class != RANGE) exptype = exptype->type; settype = defnl(0, SET, exptype, 0); } } csetp -> csettype = settype; # ifndef CONSETS csetp -> comptime = FALSE; # endif CONSETS setran( exptype ); if (((set.uprbp + 1) >> LG2BITSLONG) >= COMPSETSZE) csetp -> comptime = FALSE; lower = set.lwrb; upper = set.lwrb + set.uprbp; pairp = NIL; singp = NIL; codeoff(); while ( el = r[2] ) { e = el[1]; if (e == NIL) { /* * don't hang this one anywhere. */ csetp -> csettype = NIL; r[2] = el[2]; continue; } if (e[0] == T_RANG) { if ( csetp -> comptime && constval( e[2] ) ) { #ifdef CONSETS t = con.ctype; if ( con.crval < lower || con.crval > upper ) { if ( setofint ) { csetp -> comptime = FALSE; } else { error("Range upper bound of %D out of set bounds" , ((long)con.crval) ); csetp -> csettype = NIL; } } #endif CONSETS } else { csetp -> comptime = FALSE; t = rvalue(e[2], NIL , RREQ ); if (t == NIL) { rvalue(e[1], NIL , RREQ ); goto pairhang; } } if (incompat(t, exptype, e[2])) { cerror("Upper bound of element type clashed with set type in constant set"); } if ( csetp -> comptime && constval( e[1] ) ) { #ifdef CONSETS t = con.ctype; if ( con.crval < lower || con.crval > upper ) { if ( setofint ) { csetp -> comptime = FALSE; } else { error("Range lower bound of %D out of set bounds" , ((long)con.crval) ); csetp -> csettype = NIL; } } #endif CONSETS } else { csetp -> comptime = FALSE; t = rvalue(e[1], NIL , RREQ ); if (t == NIL) { goto pairhang; } } if (incompat(t, exptype, e[1])) { cerror("Lower bound of element type clashed with set type in constant set"); } pairhang: /* * remove this range from the tree list and * hang it on the pairs list. */ ip = el[2]; el[2] = pairp; pairp = r[2]; r[2] = ip; csetp -> paircnt++; } else { if ( csetp -> comptime && constval( e ) ) { #ifdef CONSETS t = con.ctype; if ( con.crval < lower || con.crval > upper ) { if ( setofint ) { csetp -> comptime = FALSE; } else { error("Value of %D out of set bounds" , ((long)con.crval) ); csetp -> csettype = NIL; } } #endif CONSETS } else { csetp -> comptime = FALSE; t = rvalue((int *) e, NLNIL , RREQ ); if (t == NIL) { goto singhang; } } if (incompat(t, exptype, e)) { cerror("Element type clashed with set type in constant set"); } singhang: /* * take this expression off the tree list and * hang it on the list of singletons. */ ip = el[2]; el[2] = singp; singp = r[2]; r[2] = ip; csetp -> singcnt++; } } codeon(); # ifdef PC if ( pairp != NIL ) { for ( el = pairp ; el[2] != NIL ; el = el[2] ) /* void */; el[2] = singp; r[2] = pairp; } else { r[2] = singp; } # endif PC # ifdef OBJ if ( singp != NIL ) { for ( el = singp ; el[2] != NIL ; el = el[2] ) /* void */; el[2] = pairp; r[2] = singp; } else { r[2] = pairp; } # endif OBJ if ( csetp -> csettype == NIL ) { csetp -> comptime = TRUE; } return csetp -> comptime; } #ifdef CONSETS /* * mask[i] has the low i bits turned off. */ long mask[] = { # ifdef DEC11 0xffffffff , 0xfffffffe , 0xfffffffc , 0xfffffff8 , 0xfffffff0 , 0xffffffe0 , 0xffffffc0 , 0xffffff80 , 0xffffff00 , 0xfffffe00 , 0xfffffc00 , 0xfffff800 , 0xfffff000 , 0xffffe000 , 0xffffc000 , 0xffff8000 , 0xffff0000 , 0xfffe0000 , 0xfffc0000 , 0xfff80000 , 0xfff00000 , 0xffe00000 , 0xffc00000 , 0xff800000 , 0xff000000 , 0xfe000000 , 0xfc000000 , 0xf8000000 , 0xf0000000 , 0xe0000000 , 0xc0000000 , 0x80000000 , 0x00000000 # else 0xffffffff , 0xfeffffff , 0xfcffffff , 0xf8ffffff , 0xf0ffffff , 0xe0ffffff , 0xc0ffffff , 0x80ffffff , 0x00ffffff , 0x00feffff , 0x00fcffff , 0x00f8ffff , 0x00f0ffff , 0x00e0ffff , 0x00c0ffff , 0x0080ffff , 0x0000ffff , 0x0000feff , 0x0000fcff , 0x0000f8ff , 0x0000f0ff , 0x0000e0ff , 0x0000c0ff , 0x000080ff , 0x000000ff , 0x000000fe , 0x000000fc , 0x000000f8 , 0x000000f0 , 0x000000e0 , 0x000000c0 , 0x00000080 , 0x00000000 # endif DEC11 }; /* * given a csetstr, either * put out a compile time constant set and an lvalue to it. * or * put out rvalues for the singletons and the pairs * and counts of each. */ #endif CONSETS postcset( r , csetp ) int *r; struct csetstr *cset((p; { register int *el; register int *e; int lower; int upper; int lowerdiv; int lowermod; int upperdiv; int uppermod; int label; long *lp; long *limit; long tempset[ COMPSETSZE ]; long temp; char *cp; # ifdef PC char labelname[ BUFSIZ ]; # endif PC if ( csetp -> comptime ) { #ifdef CONSETS setran( ( csetp -> csettype ) -> type ); limit = &tempset[ ( set.uprbp >> LG2BITSLONG ) + 1 ]; for ( lp = &tempset[0] ; lp < limit ; lp++ ) { *lp = 0; } for ( el = r[2] ; el != NIL ; el = el[2] ) { e = el[1]; if ( e[0] == T_RANG ) { constval( e[1] ); lower = con.crval; constval( e[2] ); upper = con.crval; if ( upper < lower ) { continue; } lowerdiv = ( lower - set.lwrb ) >> LG2BITSLONG; lowermod = ( lower - set.lwrb ) & MSKBITSLONG; upperdiv = ( upper - set.lwrb ) >> LG2BITSLONG; uppermod = ( upper - set.lwrb ) & MSKBITSLONG; temp = mask[ lowermod ]; if ( lowerdiv == upperdiv ) { temp &= ~mask[ uppermod + 1 ]; } tempset[ lowerdiv ] |= temp; limit = &tempset[ upperdiv-1 ]; for ( lp = &tempset[ lowerdiv+1 ] ; lp <= limit ; lp++ ) { *lp |= 0xffffffff; } if ( lowerdiv != upperdiv ) { tempset[ upperdiv ] |= ~mask[ uppermod + 1 ]; } } else { constval( e ); temp = con.crval - set.lwrb; cp = (char *)tempset; cp[temp >> LG2BITSBYTE] |= (1 << (temp & MSKBITSBYTE)); } } if ( !CGENNING ) return; # ifdef PC putprintf( " .data" , 0 ); putprintf( " .align 2" , 0 ); label = getlab(); putlab( label ); lp = &( tempset[0] ); limit = &tempset[ ( set.uprbp >> LG2BITSLONG ) + 1 ]; while ( lp < limit ) { putprintf( " .long 0x%x" , 1 , *lp ++ ); for ( temp = 2 ; ( temp <= 8 ) && lp < limit ; temp ++ ) { putprintf( ",0x%x" , 1 , *lp++ ); } putprintf( "" , 0 ); } putprintf( " .text" , 0 ); sprintf( labelname , PREFIXFORMAT , LABELPREFIX , label ); putleaf( P2ICON , 0 , 0 , P2PTR | P2STRTY , labelname ); # endif PC # ifdef OBJ put(2, O_CON, (int)(((set.uprbp >> LG2BITSLONG) + 1) * (BITSPERLONG >> LG2BITSBYTE))); lp = &( tempset[0] ); limit = &tempset[ ( set.uprbp >> LG2BITSLONG ) + 1 ]; while ( lp < limit ) { put(2, O_CASE4, *lp ++); } # endif OBJ #else panic("const cset"); #endif CONSETS } else { # ifdef PC putleaf( P2ICON , csetp -> paircnt , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , csetp -> singcnt , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); for ( el = r[2] ; el != NIL ; el = el[2] ) { e = el[1]; if ( e[0] == T_RANG ) { rvalue( e[2] , NIL , RREQ ); putop( P2LISTOP , P2INT ); rvalue( e[1] , NIL , RREQ ); putop( P2LISTOP , P2INT ); } else { rvalue( e , NIL , RREQ ); putop( P2LISTOP , P2INT ); } } # endif PC # ifdef OBJ for ( el = r[2] ; el != NIL ; el = el[2] ) { e = el[1]; if ( e[0] == T_RANG ) { stkrval( e[1] , NIL , RREQ ); stkrval( e[2] , NIL , RREQ ); } else { stkrval( e , NIL , RREQ ); } } put(2 , O_CON24 , (int)csetp -> singcnt ); put(2 , O_CON24 , (int)csetp -> paircnt ); # endif OBJ } } T ); rvalue( e[1] , NIL , RREQ ); putop( P2LISTOP , P2INT ); } else { rvalue( e , NIL , RREQ ); putop( P2LISTOP , P2INT ); } } # endif PC # ifdef OBJ for ( el = r[2] ; el != NIL ; el = el[2] ) { e = el[1]; if ( e[0] == T_RANG ) { stkrval( e[1] , NIL , RREQ ); stkrvacmd/pi/error.c 644 0 33 4061 2552606434 6512 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)error.c 1.3 3/18/81"; #include "whoami.h" #include "0.h" #ifndef PI1 #include "yy.h" #endif char errpfx = 'E'; extern int yyline; /* * Panic is called when impossible * (supposedly, anyways) situations * are encountered. * Panic messages should be short * as they do not go to the message * file. */ panic(s) char *s; { #ifdef DEBUG #ifdef PI1 printf("Snark (%s) line=%d\n", s, line); abort(); #else printf("Snark (%s) line=%d, yyline=%d\n", s, line, yyline); abort () ; /* die horribly */ #endif #endif #ifdef PI1 Perror( "Snark in pi1", s); #else Perror( "Snark in pi", s); #endif pexit(DIED); } extern char *errfile; /* * Error is called for * semantic errors and * prints the error and * a line number. */ /*VARARGS*/ error(a1, a2, a3, a4, a5) register char *a1; { char errbuf[256]; /* was extern. why? ...pbk */ register int i; if (errpfx == 'w' && opt('w') != 0) { errpfx = 'E'; return; } Enocascade = 0; geterr(a1, errbuf); a1 = errbuf; if (line < 0) line = -line; #ifndef PI1 if (opt('l')) yyoutline(); #endif yysetfile(filename); if (errpfx == ' ') { printf(" "); for (i = line; i >= 10; i /= 10) pchr( ' ' ); printf("... "); } else if (Enoline) printf(" %c - ", errpfx); else printf("%c %d - ", errpfx, line); printf(a1, a2, a3, a4, a5); if (errpfx == 'E') #ifndef PI0 eflg = TRUE, codeoff(); #else eflg = TRUE; #endif errpfx = 'E'; if (Eholdnl) Eholdnl = 0; else pchr( '\n' ); } /*VARAGRS*/ cerror(a1, a2, a3, a4, a5) { if (Enocascade) return; setpfx(' '); error(a1, a2, a3, a4, a5); } #ifdef PI1 /*VARARGS*/ derror(a1, a2, a3, a4, a5) { if (!holdderr) error(a1, a2, a3, a4, a5); errpfx = 'E'; } char *lastname, printed, hadsome; /* * this yysetfile for PI1 only. * the real yysetfile is in yyput.c */ yysetfile(name) char *name; { if (lastname == name) return; printed =| 1; gettime( name ); printf("%s %s:\n" , myctime( &tvec ) , name ); lastname = name; } #endif 1, a2, a3, a4, a5) { if (Enocascade) return; setpfx(' '); error(a1, a2, a3, a4, a5); } #ifdef PI1 /*VARARGS*/ derror(a1, a2, a3, a4, a5) { if (!holdderr) error(a1, a2, a3, a4, a5); errpfx = 'E'; } char *lastname, printed, hadsome; /* * this yysetfile for PI1 only. * the real yysetfile is in yyput.c */ yysetfile(name) char *name; { if (lastname == name) return; printed =| 1; gettime( name ); printf("%s %s:\n" , mycticmd/pi/fdec.c 644 0 33 12112 2552606435 6277 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)fdec.c 1.20 6/1/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "opcode.h" #include "objfmt.h" #include "align.h" /* * this array keeps the pxp counters associated with * functions and procedures, so that they can be output * when their bodies are encountered */ int bodycnts[ DSPLYSZ ]; #ifdef PC # include "pc.h" # include "pcops.h" #endif PC #ifdef OBJ int cntpatch; int nfppatch; #endif OBJ funcfwd(fp) struct nl *fp; { /* * save the counter for this function */ if ( monflg ) { fp -> value[ NL_CNTR ] = bodycnts[ cbn ]; } return (fp); } /* * Funcext marks the procedure or * function external in the symbol * table. Funcext should only be * called if PC, and is an error * otherwise. */ funcext(fp) struct nl *fp; { #ifdef PC if (opt('s')) { standard(); error("External procedures and functions are not standard"); } else { if (cbn == 1) { fp->extra_flags |= NEXTERN; stabefunc( fp -> symbol , fp -> class , line ); } else error("External procedures and functions can only be declared at the outermost level."); } #endif PC #ifdef OBJ error("Procedures or functions cannot be declared external."); #endif OBJ return(fp); } /* * Funcbody is called * when the actual (resolved) * declaration of a procedure is * encountered. It puts the names * of the (function) and parameters * into the symbol table. */ funcbody(fp) struct nl *fp; { register struct nl *q, *p; struct nl *functemp; cbn++; if (cbn >= DSPLYSZ) { error("Too many levels of function/procedure nesting"); pexit(ERRS); } sizes[cbn].om_max = sizes[cbn].curtmps.om_off = -DPOFF1; sizes[cbn].reg_max = -1; sizes[cbn].curtmps.reg_off = 0; gotos[cbn] = NIL; errcnt[cbn] = syneflg; parts[ cbn ] = NIL; dfiles[ cbn ] = FALSE; if (fp == NIL) return (NIL); /* * Save the virtual name * list stack pointer so * the space can be freed * later (funcend). */ fp->ptr[2] = nlp; if (fp->class != PROG) { for (q = fp->chain; q != NIL; q = q->chain) { enter(q); # ifdef PC q -> extra_flags |= NPARAM; # endif PC } } if (fp->class == FUNC) { /* * For functions, enter the fvar */ enter(fp->ptr[NL_FVAR]); # ifdef PC q = fp -> ptr[ NL_FVAR ]; if (q -> type != NIL ) { functemp = tmpalloc( leven( roundup( (int)lwidth(q -> type), (long)align(q -> type))), q -> type, NOREG); if ( q -> ptr[NL_OFFS] != functemp->value[NL_OFFS] ) panic("func var"); } q -> extra_flags |= functemp -> extra_flags; # endif PC } # ifdef PTREE /* * pick up the pointer to porf declaration */ PorFHeader[ ++nesting ] = fp -> inTree; # endif PTREE return (fp); } /* * Segend is called to check for * unresolved variables, funcs and * procs, and deliver unresolved and * baduse error diagnostics at the * end of a routine segment (a separately * compiled segment that is not the * main program) fo((r PC. This * routine should only be called * by PC (not standard). */ segend() { register struct nl *p; register int i,b; char *cp; #ifdef PC if (opt('s')) { standard(); error("Separately compiled routine segments are not standard."); } else { b = cbn; for (i=0; i<077; i++) { for (p = disptab[i]; p != NIL && (p->nl_block & 037) == b; p = p->nl_next) { switch (p->class) { case BADUSE: cp = 's'; if (p->chain->ud_next == NIL) cp++; eholdnl(); if (p->value[NL_KINDS] & ISUNDEF) nerror("%s undefined on line%s", p->symbol, cp); else nerror("%s improperly used on line%s", p->symbol, cp); pnumcnt = 10; pnums(p->chain); pchr('\n'); break; case FUNC: case PROC: if ((p->nl_flags & NFORWD) && ((p->extra_flags & NEXTERN) == 0)) nerror("Unresolved forward declaration of %s %s", classes[p->class], p->symbol); break; case FVAR: if (((p->nl_flags & NMOD) == 0) && ((p->chain->extra_flags & NEXTERN) == 0)) nerror("No assignment to the function variable"); break; } } disptab[i] = p; } } #endif PC #ifdef OBJ error("Missing program statement and program body"); #endif OBJ } /* * Level1 does level one processing for * separately compiled routine segments */ level1() { # ifdef OBJ error("Missing program statement"); # endif OBJ # ifdef PC if (opt('s')) { standard(); error("Missing program statement"); } # endif PC cbn++; sizes[cbn].om_max = sizes[cbn].curtmps.om_off = -DPOFF1; gotos[cbn] = NIL; errcnt[cbn] = syneflg; parts[ cbn ] = NIL; dfiles[ cbn ] = FALSE; progseen = TRUE; } pnums(p) struct udinfo *p; { if (p->ud_next != NIL) pnums(p->ud_next); if (pnumcnt == 0) { printf("\n\t"); pnumcnt = 20; } pnumcnt--; printf(" %d", p->ud_line); } nerror(a1, a2, a3) { if (Fp != NIL) { yySsync(); #ifndef PI1 if (opt('l')) yyoutline(); #endif yysetfile(filename); printf("In %s %s:\n", classes[Fp->class], Fp->symbol); Fp = NIL; elineoff(); } error(a1, a2, a3); } = NIL; errcnt[cbn] = syneflg; parts[ cbn ] = NIL; dfiles[ cbn ] = FALSE; progseen = TRUE; } pnums(p) struct udinfo *p; { if (p->ud_next != NIL) pnums(p->ud_next); if (pnumcnt == 0) { printf("\n\t"); pnumcnt = 20; } pnumcnt--; printf(" %d", p->ud_line); } nerror(a1, a2, a3) { if (Fp != NIL) { yySsync(); #ifndef PI1 if (opt('l')) yyoutline(); #endif yysetfile(filename); printf("In %s %s:\n", classes[Fpcmd/pi/fend.c 644 0 33 40631 2552606436 6322 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)fend.c 1.9 6/8/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "opcode.h" #include "objfmt.h" #include "align.h" /* * this array keeps the pxp counters associated with * functions and procedures, so that they can be output * when their bodies are encountered */ int bodycnts[ DSPLYSZ ]; #ifdef PC # include "pc.h" # include "pcops.h" #endif PC #ifdef OBJ int cntpatch; int nfppatch; #endif OBJ struct nl *Fp; int pnumcnt; /* * Funcend is called to * finish a block by generating * the code for the statements. * It then looks for unresolved declarations * of labels, procedures and functions, * and cleans up the name list. * For the program, it checks the * semantics of the program * statement (yuchh). */ funcend(fp, bundle, endline) struct nl *fp; int *bundle; int endline; { register struct nl *p; register int i, b; int var, inp, out, *blk; bool chkref; struct nl *iop; char *cp; extern int cntstat; # ifdef PC int savlabel = getlab(); int toplabel = getlab(); int botlabel = getlab(); int proflabel = getlab(); char extname[ BUFSIZ ]; # endif PC cntstat = 0; /* * yyoutline(); */ if (program != NIL) line = program->value[3]; blk = bundle[2]; if (fp == NIL) { cbn--; # ifdef PTREE nesting--; # endif PTREE return; } #ifdef OBJ /* * Patch the branch to the * entry point of the function */ patch4(fp->entloc); /* * Put out the block entrance code and the block name. * HDRSZE is the number of bytes of info in the static * BEG data area exclusive of the proc name. It is * currently defined as: /* struct hdr { /* long framesze; /* number of bytes of local vars */ /* long nargs; /* number of bytes of arguments */ /* bool tests; /* TRUE => perform runtime tests */ /* short offset; /* offset of procedure in source file */ /* char name[1]; /* name of active procedure */ /* }; */ # define HDRSZE (2 * sizeof(long) + sizeof(short) + sizeof(bool)) var = put(2, ((lenstr(fp->symbol,0) + HDRSZE) << 8) | (cbn == 1 && opt('p') == 0 ? O_NODUMP: O_BEG), (long)0); /* * output the number of bytes of arguments * this is only checked on formal calls. */ put(2, O_CASE4, cbn == 1 ? (long)0 : (long)(fp->value[NL_OFFS]-DPOFF2)); /* * Output the runtime test mode for the routine */ put(2, sizeof(bool) == 2 ? O_CASE2 : O_CASE4, opt('t') ? TRUE : FALSE); /* * Output line number and routine name */ put(2, O_CASE2, bundle[1]); putstr(fp->symbol, 0); #endif OBJ #ifdef PC /* * put out the procedure entry code */ if ( fp -> class == PROG ) { putprintf( " .text" , 0 ); putprintf( " .align 1" , 0 ); putprintf( " .globl _main" , 0 ); putprintf( "_main:" , 0 ); putprintf( " .word 0" , 0 ); putprintf( " calls $0,_PCSTART" , 0 ); putprintf( " movl 4(ap),__argc" , 0 ); putprintf( " movl 8(ap),__argv" , 0 ); putprintf( " calls $0,_program" , 0 ); putprintf( " calls $0,_PCEXIT" , 0 ); ftnno = fp -> entloc; putprintf( " .text" , 0 ); putprintf( " .align 1" , 0 ); putprintf( " .globl _program" , 0 ); putprintf( "_program:" , 0 ); stabfunc( "program" , fp -> class , bundle[1] , 0 ); } else { ftnno = fp -> entloc; putprintf( " .text" , 0 ); putprintf( " .align 1" , 0 ); sextname( extname , fp -> symbol , cbn - 1 ); putprintf( " .globl %s%s" , 0 , FORMALPREFIX , extname ); putprintf( " .globl %s" , 0 , extname ); putprintf( "%s:" , 0 , extname ); stabfunc( fp -> symbol , fp -> class , bundle[1] , cbn - 1 ); for ( p = fp -> chain ; p != NIL ; p = p -> chain ) { stabparam( p -> symbol , p2type( p -> type ) , p -> value[ NL_OFFS ] , lwidth( p -> type ) ); } if ( fp -> class == FUNC ) { /* * stab the function variable */ p = fp -> ptr[ NL_FVAR ]; stablvar( p -> symbol , p2type( p -> type ) , cbn , p -> value[ NL_OFFS ] , lwidth( p -> type ) ); } /* * stab local variables * rummage down hash chain links. */ for ( i = 0 ; i <= 077 ; i++ ) { for ( p = disptab[ i ] ; p != NIL ; p = p->nl_next) { if ( ( p -> nl_block & 037 ) != cbn ) { break; } /* * stab local variables * that's named variables, but not params */ if ( ( p -> symbol != NIL ) && ( p -> class == VAR ) && ( p -> value[ NL_OFFS ] < 0 ) ) { stablvar( p -> symbol , p2type( p -> type ) , cbn , p -> value[ NL_OFFS ] , lwidth( p -> type ) ); } } } } stablbrac( cbn ); /* * register save mask */ putprintf( " .word " , 1 ); putprintf( PREFIXFORMAT , 0 , LABELPREFIX , savlabel ); putjbr( botlabel ); putlab( toplabel ); if ( profflag ) { /* * call mcount for profiling */ putprintf( " moval " , 1 ); putprintf( PREFIXFORMAT , 1 , LABELPREFIX , proflabel ); putprintf( ",r0" , 0 ); putprintf( " jsb mcount" , 0 ); putprintf( " .data" , 0 ); putprintf( " .align 2" , 0 ); putlab( proflabel ); putprintf( " .long 0" , 0 ); putprintf( " .text" , 0 ); } /* * set up unwind exception vector. */ putprintf( " moval %s,%d(%s)" , 0 , UNWINDNAME , UNWINDOFFSET , P2FPNAME ); /* * save address of display entry, for unwind. */ putprintf( " moval %s+%d,%d(%s)" , 0 , DISPLAYNAME , cbn * sizeof(struct dispsave) , DPTROFFSET , P2FPNAME ); /* * save old display */ putprintf( " movq %s+%d,%d(%s)" , 0 , DISPLAYNAME , cbn * sizeof(struct dispsave) , DSAVEOFFSET , P2FPNAME ); /* * set up new display by saving AP and FP in appropriate * slot in display structure. */ putprintf( " movq %s,%s+%d" , 0 , P2APNAME , DISPLAYNAME , cbn * sizeof(struct dispsave) ); /* * ask second pass to allocate known locals */ putlbracket( ftnno , -sizes[ cbn ].om_max ); /* * and zero them if checking is on * by calling blkclr( bytes of locals , starting local address ); */ if ( opt( 't' ) && ( -sizes[ cbn ].om_max ) > DPOFF1 ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_blkclr" ); putleaf( P2ICON , ( -sizes[ cbn ].om_max ) - DPOFF1 , 0 , P2INT , 0 ); putLV( 0 , cbn , sizes[ cbn ].om_max , NLOCAL , P2CHAR ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); putdot( filename , line ); } #endif PC if ( monflg ) { if ( fp -> value[ NL_CNTR ] != 0 ) { inccnt( fp -> value [ NL_CNTR ] ); } inccnt( bodycnts[ fp -> nl_block & 037 ] ); } if (fp->class == PROG) { /* * The glorious buffers option. * 0 = don't buffer output * 1 = line buffer output * 2 = 512 byte buffer output */ # ifdef OBJ if (opt('b') != 1) put(1, O_BUFF | opt('b') << 8); # endif OBJ # ifdef PC if ( opt( 'b' ) != 1 ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_BUFF" ); putleaf( P2ICON , opt( 'b'(( ) , 0 , P2INT , 0 ); putop( P2CALL , P2INT ); putdot( filename , line ); } # endif PC out = 0; for (p = fp->chain; p != NIL; p = p->chain) { if (strcmp(p->symbol, "input") == 0) { inp++; continue; } if (strcmp(p->symbol, "output") == 0) { out++; continue; } iop = lookup1(p->symbol); if (iop == NIL || bn != cbn) { error("File %s listed in program statement but not declared", p->symbol); continue; } if (iop->class != VAR) { error("File %s listed in program statement but declared as a %s", p->symbol, classes[iop->class]); continue; } if (iop->type == NIL) continue; if (iop->type->class != FILET) { error("File %s listed in program statement but defined as %s", p->symbol, nameof(iop->type)); continue; } # ifdef OBJ put(2, O_CON24, text(iop->type) ? 0 : width(iop->type->type)); i = lenstr(p->symbol,0); put(2, O_CON24, i); put(2, O_LVCON, i); putstr(p->symbol, 0); put(2, O_LV | bn<<8+INDX, (int)iop->value[NL_OFFS]); put(1, O_DEFNAME); # endif OBJ # ifdef PC putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_DEFNAME" ); putLV( p -> symbol , bn , iop -> value[NL_OFFS] , iop -> extra_flags , p2type( iop ) ); putCONG( p -> symbol , strlen( p -> symbol ) , LREQ ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , strlen( p -> symbol ) , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , text(iop->type) ? 0 : width(iop->type->type) , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); putdot( filename , line ); # endif PC } if (out == 0 && fp->chain != NIL) { recovered(); error("The file output must appear in the program statement file list"); } } /* * Process the prog/proc/func body */ noreach = 0; line = bundle[1]; statlist(blk); # ifdef PTREE { pPointer Body = tCopy( blk ); pDEF( PorFHeader[ nesting -- ] ).PorFBody = Body; } # endif PTREE # ifdef OBJ if (cbn== 1 && monflg != 0) { patchfil(cntpatch - 2, (long)cnts, 2); patchfil(nfppatch - 2, (long)pfcnt, 2); } # endif OBJ # ifdef PC if ( fp -> class == PROG && monflg ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_PMFLUSH" ); putleaf( P2ICON , cnts , 0 , P2INT , 0 ); putleaf( P2ICON , pfcnt , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putLV( PCPCOUNT , 0 , 0 , NGLOBAL , P2INT ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); putdot( filename , line ); } # endif PC if (fp->class == PROG && inp == 0 && (input->nl_flags & (NUSED|NMOD)) != 0) { recovered(); error("Input is used but not defined in the program statement"); } /* * Clean up the symbol table displays and check for unresolves */ line = endline; b = cbn; Fp = fp; chkref = syneflg == errcnt[cbn] && opt('w') == 0; for (i = 0; i <= 077; i++) { for (p = disptab[i]; p != NIL && (p->nl_block & 037) == b; p = p->nl_next) { /* * Check for variables defined * but not referenced */ if (chkref && p->symbol != NIL) switch (p->class) { case FIELD: /* * If the corresponding record is * unused, we shouldn't complain about * the fields. */ default: if ((p->nl_flags & (NUSED|NMOD)) == 0) { warning(); nerror("%s %s is neither used nor set", classes[p->class], p->symbol); break; } /* * If a var parameter is either * modified or used that is enough. */ if (p->class == REF) continue; # ifdef OBJ if ((p->nl_flags & NUSED) == 0) { warning(); nerror("%s %s is never used", classes[p->class], p->symbol); break; } # endif OBJ # ifdef PC if (((p->nl_flags & NUSED) == 0) && ((p->extra_flags & NEXTERN) == 0)) { warning(); nerror("%s %s is never used", classes[p->class], p->symbol); break; } # endif PC if ((p->nl_flags & NMOD) == 0) { warning(); nerror("%s %s is used but never set", classes[p->class], p->symbol); break; } case LABEL: case FVAR: case BADUSE: break; } switch (p->class) { case BADUSE: cp = "s"; if (p->chain->ud_next == NIL) cp++; eholdnl(); if (p->value[NL_KINDS] & ISUNDEF) nerror("%s undefined on line%s", p->symbol, cp); else nerror("%s improperly used on line%s", p->symbol, cp); pnumcnt = 10; pnums(p->chain); pchr('\n'); break; case FUNC: case PROC: # ifdef OBJ if ((p->nl_flags & NFORWD)) nerror("Unresolved forward declaration of %s %s", classes[p->class], p->symbol); # endif OBJ # ifdef PC if ((p->nl_flags & NFORWD) && ((p->extra_flags & NEXTERN) == 0)) nerror("Unresolved forward declaration of %s %s", classes[p->class], p->symbol); # endif PC break; case LABEL: if (p->nl_flags & NFORWD) nerror("label %s was declared but not defined", p->symbol); break; case FVAR: if ((p->nl_flags & NMOD) == 0) nerror("No assignment to the function variable"); break; } } /* * Pop this symbol * table slot */ disptab[i] = p; } # ifdef OBJ put(1, O_END); # endif OBJ # ifdef PC /* * if there were file variables declared at this level * call pclose( &__disply[ cbn ] ) to clean them up. */ if ( dfiles[ cbn ] ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_PCLOSE" ); putRV( DISPLAYNAME , 0 , cbn * sizeof( struct dispsave ) , NGLOBAL , P2PTR | P2CHAR ); putop( P2CALL , P2INT ); putdot( filename , line ); } /* * if this is a function, * the function variable is the return value. * if it's a scalar valued function, return scalar, * else, return a pointer to the structure value. */ if ( fp -> class == FUNC ) { struct nl *fvar = fp -> ptr[ NL_FVAR ]; long fvartype = p2type( fvar -> type ); long label; char labelname[ BUFSIZ ]; switch ( classify( fvar -> type ) ) { case TBOOL: case TCHAR: case TINT: case TSCAL: case TDOUBLE: case TPTR: putRV( fvar -> symbol , ( fvar -> nl_block ) & 037 , fvar -> value[ NL_OFFS ] , fvar -> extra_flags , fvartype ); break; default: label = getlab(); sprintf( labelname , PREFIXFORMAT , LABELPREFIX , label ); putprintf( " .data" , 0 ); putprintf( " .lcomm %s,%d" , 0 , labelname , lwidth( fvar -> type ) ); putprintf( " .text" , 0 ); putleaf( P2NAME , 0 , 0 , fvartype , labelname ); putLV( fvar -> symbol , ( fvar -> nl_block ) & 037 , fvar -> value[ NL_OFFS ] , fvar -> extra_flags , fvartype ); putstrop( P2STASG , fvartype , lwidth( fvar -> type ) , align( fvar -> type ) ); putdot( filename , line ); putleaf( P2ICON , 0 , 0 , fvartype , labelname ); break; } putop( P2FORCE , fvartype ); putdot( filename , line ); } /* * restore old display entry from save area */ putprintf( " movq %d(%s),%s+%d" , 0 , DSAVEOFFSET , P2FPNAME , DISPLAYNAME , cbn * sizeof(struct dispsave) ); stabrbrac( cbn ); putprintf( " ret" , 0 ); /* * let the second pass allocate locals * and registers */ putprintf( " .set " , 1 ); putprintf( PREFIXFORMAT , 1 , LABELPREFIX , savlabel ); putprintf( ", 0x%x" , 0 , savmask() ); putlab( botlabel ); putprintf( " subl2 $LF%d,sp" , 0 , ftnno ); putrbracket( ftnno ); putjbr( toplabel ); /* * put down the entry point for formal calls * the arguments for FCALL have been passed to us * as hidden parameters after the regular arguments. */ if ( fp -> class != PROG ) { putprintf( "%s%s:" , 0 , FORMALPREFIX , extname ); putprintf( " .word " , 1 ); putprintf( PREFIXFORMAT , 0 , LABELPREFIX , savlabel ); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_FCALL" ); putRV( 0 , cbn , fp -> value[ NL_OFFS ] , NPARAM , P2PTR|P2STRTY ); putop( P2CALL , P2INT ); putdot( filename , line ); putjbr( botlabel ); } /* * declare pcp counters, if any */ if ( monflg && fp -> class == PROG ) { putprintf( " .data" , 0 ); putprintf( " .comm " , 1 ); putprintf( PCPCOUNT , 1 ); putprintf( ",%d" , 0 , ( cnts + 1 ) * sizeof (long) ); putprintf( " .text" , 0 ); } # endif PC #ifdef DEBUG dumpnl(fp->ptr[2], fp->symbol); #endif /* * Restore the * (virtual) name list * position */ nlfree(fp->ptr[2]); /* * Proc/func has been * resolved */ fp->nl_flags &= ~NFORWD; /* * Patch the beg * of the proc/func to * the proper variable size */ if (Fp == NIL) elineon(); # ifdef OBJ patchfil(var, (long)(-sizes[cbn].om_max), 2); # endif OBJ cbn--; if (inpflist(fp->symbol)) { opop('l'); } } #ifdef PC /* * construct the long name of a function based on it's static nesting. * into a caller-supplied buffer (that should be about BUFSIZ big). */ sextname( buffer , name , level ) char buffer[]; char *name; int level; { char *starthere; int i; starthere = &buffer[0]; for ( i = 1 ; i < level ; i++ ) { sprintf( starthere , EXTFORMAT , enclosing[ i ] ); starthere += strlen( enclosing[ i ] ) + 1; } sprintf( starthere , EXTFORMAT , name ); starthere += strlen( name ) + 1; if ( starthere >= &buffer[ BUFSIZ ] ) { panic( "sextname" ); } } #endif PC upplied buffer (that should be about BUFSIZ big). */ sextname( buffer , name , level ) char bucmd/pi/fhdr.c 644 0 33 23775 2552606436 6343 ((/* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)fhdr.c 1.3 6/1/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "opcode.h" #include "objfmt.h" #include "align.h" /* * this array keeps the pxp counters associated with * functions and procedures, so that they can be output * when their bodies are encountered */ int bodycnts[ DSPLYSZ ]; #ifdef PC # include "pc.h" # include "pcops.h" #endif PC #ifdef OBJ int cntpatch; int nfppatch; #endif OBJ /* * Funchdr inserts * declaration of a the * prog/proc/func into the * namelist. It also handles * the arguments and puts out * a transfer which defines * the entry point of a procedure. */ struct nl * funchdr(r) int *r; { register struct nl *p; register *il, **rl; struct nl *cp, *dp; int s, o, *pp; if (inpflist(r[2])) { opush('l'); yyretrieve(); /* kludge */ } pfcnt++; parts[ cbn ] |= RPRT; line = r[1]; if (r[3] == NIL && (p=lookup1(r[2])) != NIL && bn == cbn) { /* * Symbol already defined * in this block. it is either * a redeclared symbol (error) * a forward declaration, * or an external declaration. */ if ((p->class == FUNC || p->class == PROC) && (p->nl_flags & NFORWD) != 0) { /* * Grammar doesnt forbid * types on a resolution * of a forward function * declaration. */ if (p->class == FUNC && r[4]) error("Function type should be given only in forward declaration"); /* * get another counter for the actual */ if ( monflg ) { bodycnts[ cbn ] = getcnt(); } # ifdef PC enclosing[ cbn ] = p -> symbol; # endif PC # ifdef PTREE /* * mark this proc/func as forward * in the pTree. */ pDEF( p -> inTree ).PorFForward = TRUE; # endif PTREE return (p); } } /* if a routine segment is being compiled, * do level one processing. */ if ((r[0] != T_PROG) && (!progseen)) level1(); /* * Declare the prog/proc/func */ switch (r[0]) { case T_PROG: progseen = TRUE; if (opt('z')) monflg = TRUE; program = p = defnl(r[2], PROG, 0, 0); p->value[3] = r[1]; break; case T_PDEC: if (r[4] != NIL) error("Procedures do not have types, only functions do"); p = enter(defnl(r[2], PROC, 0, 0)); p->nl_flags |= NMOD; # ifdef PC enclosing[ cbn ] = r[2]; p -> extra_flags |= NGLOBAL; # endif PC break; case T_FDEC: il = r[4]; if (il == NIL) error("Function type must be specified"); else if (il[0] != T_TYID) { il = NIL; error("Function type can be specified only by using a type identifier"); } else il = gtype(il); p = enter(defnl(r[2], FUNC, il, NIL)); p->nl_flags |= NMOD; /* * An arbitrary restriction */ switch (o = classify(p->type)) { case TFILE: case TARY: case TREC: case TSET: case TSTR: warning(); if (opt('s')) { standard(); } error("Functions should not return %ss", clnames[o]); } # ifdef PC enclosing[ cbn ] = r[2]; p -> extra_flags |= NGLOBAL; # endif PC break; default: panic("funchdr"); } if (r[0] != T_PROG) { /* * Mark this proc/func as * being forward declared */ p->nl_flags |= NFORWD; /* * Enter the parameters * in the next block for * the time being */ if (++cbn >= DSPLYSZ) { error("Procedure/function nesting too deep"); pexit(ERRS); } /* * For functions, the function variable */ if (p->class == FUNC) { # ifdef OBJ cp = defnl(r[2], FVAR, p->type, 0); # endif OBJ # ifdef PC /* * fvars used to be allocated and deallocated * by the caller right before the arguments. * the offset of the fvar was kept in * value[NL_OFFS] of function (very wierd, * but see asgnop). * now, they are locals to the function * with the offset kept in the fvar. */ cp = defnl(r[2], FVAR, p->type, (int)-leven(roundup( (int)(DPOFF1+lwidth(p->type)), (long)align(p->type)))); cp -> extra_flags |= NLOCAL; # endif PC cp->chain = p; p->ptr[NL_FVAR] = cp; } /* * Enter the parameters * and compute total size */ p->value[NL_OFFS] = params(p, r[3]); /* * because NL_LINENO field in the function * namelist entry has been used (as have all * the other fields), the line number is * stored in the NL_LINENO field of its fvar. */ if (p->class == FUNC) p->ptr[NL_FVAR]->value[NL_LINENO] = r[1]; else p->value[NL_LINENO] = r[1]; cbn--; } else { /* * The wonderful * program statement! */ # ifdef OBJ if (monflg) { put(1, O_PXPBUF); cntpatch = put(2, O_CASE4, (long)0); nfppatch = put(2, O_CASE4, (long)0); } # endif OBJ cp = p; for (rl = r[3]; rl; rl = rl[2]) { if (rl[1] == NIL) continue; dp = defnl(rl[1], VAR, 0, 0); cp->chain = dp; cp = dp; } } /* * Define a branch at * the "entry point" of * the prog/proc/func. */ p->entloc = getlab(); if (monflg) { bodycnts[ cbn ] = getcnt(); p->value[ NL_CNTR ] = 0; } # ifdef OBJ put(2, O_TRA4, (long)p->entloc); # endif OBJ # ifdef PTREE { pPointer PF = tCopy( r ); pSeize( PorFHeader[ nesting ] ); if ( r[0] != T_PROG ) { pPointer *PFs; PFs = &( pDEF( PorFHeader[ nesting ] ).PorFPFs ); *PFs = ListAppend( *PFs , PF ); } else { pDEF( PorFHeader[ nesting ] ).GlobProg = PF; } pRelease( PorFHeader[ nesting ] ); } # endif PTREE return (p); } /* * deal with the parameter declaration for a routine. * p is the namelist entry of the routine. * formalist is the parse tree for the parameter declaration. * formalist [0] T_LISTPP * [1] pointer to a formal * [2] pointer to next formal * for by-value or by-reference formals, the formal is * formal [0] T_PVAL or T_PVAR * [1] pointer to id_list * [2] pointer to type (error if not typeid) * for function and procedure formals, the formal is * formal [0] T_PFUNC or T_PPROC * [1] pointer to id_list (error if more than one) * [2] pointer to type (error if not typeid, or proc) * [3] pointer to formalist for this routine. */ fparams(p, formal) register struct nl *p; int *formal; { params(p, formal[3]); p -> value[ NL_LINENO ] = formal[4]; p -> ptr[ NL_FCHAIN ] = p -> chain; p -> chain = NIL; } params(p, formalist) register struct nl *p; int *formalist; { struct nl *chainp, *savedp; struct nl *dp; register int **formalp; /* an element of the formal list */ register int *formal; /* a formal */ int *typ, *idlist; int w, o; /* * Enter the parameters * and compute total size */ chainp = savedp = p; # ifdef OBJ o = 0; # endif OBJ # ifdef PC /* * parameters used to be allocated backwards, * then fixed. for pc, they are allocated correctly. * also, they are aligned. */ o = DPOFF2; # endif PC for (formalp = formalist; formalp != NIL; formalp = formalp[2]) { p = NIL; formal = formalp[1]; if (formal == NIL) continue; /* * Parametric procedures * don't have types !?! */ typ = formal[2]; if ( typ == NIL ) { if ( formal[0] != T_PPROC ) { error("Types must be specified for arguments"); p = NIL; } } else { if ( formal[0] == T_PPROC ) { error("Procedures cannot have types"); p = NIL; } else { if (typ[0] != T_TYID) { error("Types for arguments can be specified only by using type identifiers"); p = NIL; } else { p = gtype(typ); } } } for (idlist = formal[1]; idlist != NIL; idlist = idlist[2]) { switch (formal[0]) { default: panic("funchdr2"); case T_PVAL: if (p != NIL) { if (p->class == FILET) error("Files cannot be passed by value"); else if (p->nl_flags & NFILES) error("Files cannot be a component of %ss passed by value", nameof(p)); } # ifdef OBJ w = lwidth(p); o -= even(w); # ifdef DEC11 dp = defnl(idlist[1], VAR, p, o); # else dp = defnl(idlist[1], VAR, p, (w < 2) ? o + 1 : o); # endif DEC11 # endif OBJ # ifdef PC dp = defnl( idlist[1] , VAR , p , o = roundup( o , (long)A_STACK ) ); o += lwidth( p ); # endif PC dp->nl_flags |= NMOD; break; case T_PVAR: # ifdef OBJ dp = defnl(idlist[1], REF, p, o -= sizeof ( int * ) ); # endif OBJ # ifdef PC dp = defnl( idlist[1] , REF , p , o = roundup( o , (long)A_STACK ) ); o += sizeof(char *); # endif PC break; case T_PFUNC: if (idlist[2] != NIL) { error("Each function argument must be declared separately"); idlist[2] = NIL; } # ifdef OBJ dp = defnl(idlist[1], FFUNC, p, o -= sizeof ( int * ) ); # endif OBJ # ifdef PC dp = defnl( idlist[1] , FFUNC , p , o = roundup( o , (long)A_STACK ) ); o += sizeof(char *); # endif PC dp -> nl_flags |= NMOD; fparams(dp, formal); break; case T_PPROC: if (idlist[2] != NIL) { error("Each procedure argument must be declared separately"); idlist[2] = NIL; } # ifdef OBJ dp = defnl(idlist[1], FPROC, p, o -= sizeof ( int * ) ); # endif OBJ # ifdef PC dp = defnl( idlist[1] , FPROC , p , o = roundup( o , (long)A_STACK ) ); o += sizeof(char *); # endif PC dp -> nl_flags |= NMOD; fparams(dp, formal); break; } if (dp != NIL) { # ifdef PC dp -> extra_flags |= NPARAM; # endif PC chainp->chain = dp; chainp = dp; } } } p = savedp; # ifdef OBJ /* * Correct the naivete (naivety) * of our above code to * calculate offsets */ for (dp = p->chain; dp != NIL; dp = dp->chain) dp->value[NL_OFFS] += -o + DPOFF2; return (-o + DPOFF2); # endif OBJ # ifdef PC return roundup( o , (long)A_STACK ); # endif PC } D; ((cmd/pi/flvalue.c 644 0 33 5255 2552606437 7030 /* Copyright (c) 1980 Regents of the University of California */ static char sccsid[] = "@(#)flvalue.c 1.11 6/8/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "opcode.h" #include "objfmt.h" #ifdef PC # include "pc.h" # include "pcops.h" #endif PC /* * flvalue generates the code to either pass on a formal routine, * or construct the structure which is the environment for passing. * it tells the difference by looking at the tree it's given. */ struct nl * flvalue( r , formalp ) int *r; struct nl *formalp; { struct nl *p; struct nl *tempnlp; char *typename; #ifdef PC char extname[ BUFSIZ ]; #endif PC if ( r == NIL ) { return NIL; } typename = formalp -> class == FFUNC ? "function":"procedure"; if ( r[0] != T_VAR ) { error("Expression given, %s required for %s parameter %s" , typename , typename , formalp -> symbol ); return NIL; } p = lookup(r[2]); if (p == NIL) { return NIL; } switch ( p -> class ) { case FFUNC: case FPROC: if ( r[3] != NIL ) { error("Formal %s %s cannot be qualified" , typename , p -> symbol ); return NIL; } # ifdef OBJ put(2, PTR_RV | bn << 8+INDX, (int)p->value[NL_OFFS]); # endif OBJ # ifdef PC putRV( p -> symbol , bn , p -> value[ NL_OFFS ] , p -> extra_flags , p2type( p ) ); # endif PC return p; case FUNC: case PROC: if ( r[3] != NIL ) { error("%s %s cannot be qualified" , typename , p -> symbol ); return NIL; } if (bn == 0) { error("Built-in %s %s cannot be passed as a parameter" , typename , p -> symbol ); return NIL; } /* * allocate space for the thunk */ tempnlp = tmpalloc( sizeof ( struct formrtnhead ) + 2 * bn * sizeof(struct dispsave) , nl+TSTR, NOREG); # ifdef OBJ put(2 , O_LV | cbn << 8 + INDX , (int)tempnlp -> value[ NL_OFFS ] ); put(2, O_FSAV | bn << 8, (long)p->entloc); # endif OBJ # ifdef PC putleaf( P2ICON , 0 , 0 , ADDTYPE( P2PTR , ADDTYPE( P2FTN , P2PTR|P2STRTY ) ) , "_FSAV" ); sprintf( extname , "%s" , FORMALPREFIX ); sextname( &extname[ strlen( extname ) ] , p -> symbol , bn ); putleaf( P2ICON , 0 , 0 , p2type( p ) , extname ); putleaf( P2ICON , bn , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putLV( 0 , cbn , tempnlp -> value[NL_OFFS] , tempnlp -> extra_flags , P2STRTY ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2PTR | P2STRTY ); # endif PC return p; default: error("Variable given, %s required for %s parameter %s" , typename , typename , formalp -> symbol ); return NIL; } } extname ) ] , p -> symbol , bn ); putleaf( P2ICON , 0 , 0 , p2type( p ) , extname ); putleaf( P2ICON , bn , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putLV( 0 , cbn , tempnlp -> value[NL_OFFS] , tempnlp -> extra_flags , P2STRTY ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2PTR | P2STRTY ); # endif Pcmd/pi/forop.c 644 0 33 24403 2552606437 6533 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)forop.c 1.9 6/1/81"; #include "whoami.h" #include "0.h" #include "opcode.h" #include "tree.h" #include "objfmt.h" #ifdef PC # include "pc.h" # include "pcops.h" #endif PC /* * forop for pc: * this evaluates the initial and termination expressions, * checks them to see if the loop executes at all, and then * does the assignment and the loop. * arg here looks like: * arg[0] T_FORU or T_FORD * [1] lineof "for" * [2] [0] T_ASGN * [1] lineof ":=" * [2] [0] T_VAR * [1] lineof id * [2] char * to id * [3] qualifications * [3] initial expression * [3] termination expression * [4] statement */ forop( arg ) int *arg; { int *lhs; struct nl *forvar; struct nl *fortype; int *init; struct nl *inittype; struct nl *initnlp; /* initial value namelist entry */ char forflags; int *term; struct nl *termtype; struct nl *termnlp; /* termination value namelist entry */ int *stat; int goc; /* saved gocnt */ int again; /* label at the top of the loop */ int after; /* label after the end of the loop */ bool shadowed; /* shadowing for var in temporary? */ long s_offset; /* saved offset of real for variable */ long s_flags; /* saved flags of real for variable */ long s_forv; /* saved NL_FORV of the for variable */ # ifdef PC char s_extra_flags; /* saved extra_flags of the for var */ # endif PC goc = gocnt; forvar = NIL; shadowed = FALSE; if ( arg == NIL ) { goto byebye; } if ( arg[2] == NIL ) { goto byebye; } line = arg[1]; putline(); lhs = ( (int *) arg[2] )[2]; init = ( (int *) arg[2] )[3]; term = arg[3]; stat = arg[4]; if (lhs == NIL) { nogood: if (forvar != NIL) { forvar->value[ NL_FORV ] = FORVAR; } rvalue( init , NIL , RREQ ); rvalue( term , NIL , RREQ ); statement( stat ); goto byebye; } /* * and this marks the variable as used!!! */ forvar = lookup( lhs[2] ); if ( forvar == NIL ) { goto nogood; } s_forv = forvar -> value[ NL_FORV ]; if ( lhs[3] != NIL ) { error("For variable %s must be unqualified", forvar->symbol); goto nogood; } if (forvar->class == WITHPTR) { error("For variable %s cannot be an element of a record", lhs[2]); goto nogood; } if ( opt('s') && ( ( bn != cbn ) || #ifdef OBJ ( whereis( bn , forvar->value[NL_OFFS] , 0 ) == PARAMVAR ) #endif OBJ #ifdef PC ( whereis( bn , forvar->value[NL_OFFS] , forvar -> extra_flags ) == PARAMVAR ) #endif PC ) ) { standard(); error("For variable %s must be declared in the block in which it is used", forvar->symbol); } /* * find out the type of the loop variable */ codeoff(); fortype = lvalue( lhs , MOD , RREQ ); codeon(); if ( fortype == NIL ) { goto nogood; } if ( isnta( fortype , "bcis" ) ) { error("For variable %s cannot be %ss", forvar->symbol, nameof( fortype ) ); goto nogood; } if ( forvar->value[ NL_FORV ] & FORVAR ) { error("Can't modify the for variable %s in the range of the loop", forvar->symbol); forvar = NIL; goto nogood; } /* * allocate space for the initial and termination expressions * the initial is tentatively placed in a register as it will * shadow the for loop variable in the body of the loop. */ initnlp = tmpalloc(sizeof(long), nl+T4INT, REGOK); termnlp = tmpalloc(sizeof(long), nl+T4INT, NOREG); # ifdef PC /* * compute and save the initial expression */ putRV( 0 , cbn , initnlp -> value[ NL_OFFS ] , initnlp -> extra_flags , P2INT ); # endif PC # ifdef OBJ put(2, O_LV | cbn<<8+INDX, initnlp -> value[ NL_OFFS ] ); # endif OBJ inittype = rvalue( init , fortype , RREQ ); if ( incompat( inittype , fortype , init ) ) { cerror("Type of initial expression clashed with index type in 'for' statement"); if (forvar != NIL) { forvar->value[ NL_FORV ] = FORVAR; } rvalue( term , NIL , RREQ ); statement( stat ); goto byebye; } # ifdef PC putop( P2ASSIGN , P2INT ); putdot( filename , line ); /* * compute and save the termination expression */ putRV( 0 , cbn , termnlp -> value[ NL_OFFS ] , termnlp -> extra_flags , P2INT ); # endif PC # ifdef OBJ gen(O_AS2, O_AS2, sizeof(long), width(inittype)); /* * compute and save the termination expression */ put(2, O_LV | cbn<<8+INDX, termnlp -> value[ NL_OFFS ] ); # endif OBJ termtype = rvalue( term , fortype , RREQ ); if ( incompat( termtype , fortype , term ) ) { cerror("Type of limit expression clashed with index type in 'for' statement"); if (forvar != NIL) { forvar->value[ NL_FORV ] = FORVAR; } statement( stat ); goto byebye; } # ifdef PC putop( P2ASSIGN , P2INT ); putdot( filename , line ); /* * we can skip the loop altogether if !( init <= term ) */ after = getlab(); putRV( 0 , cbn , initnlp -> value[ NL_OFFS ] , initnlp -> extra_flags , P2INT ); putRV( 0 , cbn , termnlp -> value[ NL_OFFS ] , termnlp -> extra_flags , P2INT ); putop( ( arg[0] == T_FORU ? P2LE : P2GE ) , P2INT ); putleaf( P2ICON , after , 0 , P2INT , 0 ); putop( P2CBRANCH , P2INT ); putdot( filename , line ); /* * put down the label at the top of the loop */ again = getlab(); putlab( again ); /* * okay, then we have to execute the body, but first, * assign the initial expression to the for variable. * see the note in asgnop1 about why this is an rvalue. */ lvalue( lhs , NOUSE , RREQ ); if ( opt( 't' ) ) { precheck( fortype , "_RANG4" , "_RSNG4" ); } putRV( 0 , cbn , initnlp -> value[ NL_OFFS ] , initnlp -> extra_flags , P2INT ); if ( opt( 't' ) ) { postcheck( fortype ); } putop( P2ASSIGN , p2type( fortype ) ); putdot( filename , line ); # endif PC # ifdef OBJ gen(O_AS2, O_AS2, sizeof(long), width(termtype)); /* * we(( can skip the loop altogether if !( init <= term ) */ put(2, O_RV4 | cbn<<8+INDX, initnlp -> value[ NL_OFFS ] ); put(2, O_RV4 | cbn<<8+INDX, termnlp -> value[ NL_OFFS ] ); gen(NIL, arg[0] == T_FORU ? T_LE : T_GE, sizeof(long), sizeof(long)); after = getlab(); put(2, O_IF, after); /* * put down the label at the top of the loop */ again = getlab(); putlab( again ); /* * okay, then we have to execute the body, but first, * assign the initial expression to the for variable. */ lvalue( lhs , NOUSE , LREQ ); put(2, O_RV4 | cbn<<8+INDX, initnlp -> value[ NL_OFFS ] ); rangechk(fortype, nl+T4INT); gen(O_AS2, O_AS2, width(fortype), sizeof(long)); # endif OBJ /* * shadowing the real for variable * with the initail expression temporary: * save the real for variable's offset, flags * (including nl_block). * replace them with the initial expression's offset, * and mark it as being a for variable. */ shadowed = TRUE; s_offset = forvar -> value[ NL_OFFS ]; s_flags = forvar -> nl_flags; forvar -> value[ NL_OFFS ] = initnlp -> value[ NL_OFFS ]; forvar -> nl_flags = cbn; forvar -> value[ NL_FORV ] = FORVAR; # ifdef PC s_extra_flags = forvar -> extra_flags; forvar -> extra_flags = initnlp -> extra_flags; # endif PC /* * and don't forget ... */ putcnt(); statement( stat ); /* * wasn't that fun? do we get to do it again? * we don't do it again if ( !( forvar < limit ) ) * pretend we were doing this at the top of the loop */ line = arg[ 1 ]; # ifdef PC if ( opt( 'p' ) ) { if ( opt('t') ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_LINO" ); putop( P2UNARY P2CALL , P2INT ); putdot( filename , line ); } else { putRV( STMTCOUNT , 0 , 0 , NGLOBAL , P2INT ); putleaf( P2ICON , 1 , 0 , P2INT , 0 ); putop( P2ASG P2PLUS , P2INT ); putdot( filename , line ); } } /*rvalue( lhs , NIL , RREQ );*/ putRV( 0 , cbn , initnlp -> value[ NL_OFFS ] , initnlp -> extra_flags , P2INT ); putRV( 0 , cbn , termnlp -> value[ NL_OFFS ] , termnlp -> extra_flags , P2INT ); putop( ( arg[ 0 ] == T_FORU ? P2LT : P2GT ) , P2INT ); putleaf( P2ICON , after , 0 , P2INT , 0 ); putop( P2CBRANCH , P2INT ); putdot( filename , line ); /* * okay, so we have to do it again, * but first, increment the for variable. * there it is again, an rvalue on the lhs of an assignment. */ /*lvalue( lhs , MOD , RREQ );*/ putRV( 0 , cbn , initnlp -> value[ NL_OFFS ] , initnlp -> extra_flags , P2INT ); if ( opt( 't' ) ) { precheck( fortype , "_RANG4" , "_RSNG4" ); } /*rvalue( lhs , NIL , RREQ );*/ putRV( 0 , cbn , initnlp -> value[ NL_OFFS ] , initnlp -> extra_flags , P2INT ); putleaf( P2ICON , 1 , 0 , P2INT , 0 ); putop( ( arg[0] == T_FORU ? P2PLUS : P2MINUS ) , P2INT ); if ( opt( 't' ) ) { postcheck( fortype ); } putop( P2ASSIGN , P2INT ); putdot( filename , line ); /* * and do it all again */ putjbr( again ); /* * and here we are */ putlab( after ); # endif PC # ifdef OBJ /* * okay, so we have to do it again. * Luckily we have a magic opcode which increments the * index variable, checks the limit falling through if * it has been reached, else range checking the result * updating the index variable, and returning to the top * of the loop. */ putline(); put(2, O_RV4 | cbn<<8+INDX, termnlp -> value[ NL_OFFS ] ); lvalue(lhs, MOD, LREQ); if (width(fortype) <= 2) put(4, (arg[0] == T_FORU ? O_FOR1U : O_FOR1D) + (width(fortype)>>1), (int)fortype->range[0], (int)fortype->range[1], again); else put(4, (arg[0] == T_FORU ? O_FOR4U : O_FOR4D), fortype->range[0], fortype->range[1], again); /* * and here we are */ patch( after ); # endif OBJ byebye: noreach = 0; if (forvar != NIL) { forvar -> value[ NL_FORV ] = s_forv; } if ( shadowed ) { forvar -> value[ NL_OFFS ] = s_offset; forvar -> nl_flags = s_flags; # ifdef PC forvar -> extra_flags = s_extra_flags; # endif PC } if ( goc != gocnt ) { putcnt(); } } ype->range[1], again); else put(4, (arg[0] == T_FORU ? O_FOR4U : O_FOR4D), fortype->range[0], fortype->range[1], again); /* * and here we are */ patch( after ); # endif OBJ byebye: noreach = 0; if (forvar != NIL) { cmd/pi/func.c 644 0 33 12036 2552606437 6340 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)func.c 1.7 3/8/81"; #include "whoami.h" #ifdef OBJ /* * the rest of the file */ #include "0.h" #include "tree.h" #include "opcode.h" /* * Funccod generates code for * built in function calls and calls * call to generate calls to user * defined functions and procedures. */ funccod(r) int *r; { struct nl *p; register struct nl *p1; register int *al; register op; int argc, *argv; int tr[2], tr2[4]; /* * Verify that the given name * is defined and the name of * a function. */ p = lookup(r[2]); if (p == NIL) { rvlist(r[3]); return (NIL); } if (p->class != FUNC && p->class != FFUNC) { error("%s is not a function", p->symbol); rvlist(r[3]); return (NIL); } argv = r[3]; /* * Call handles user defined * procedures and functions */ if (bn != 0) return (call(p, argv, FUNC, bn)); /* * Count the arguments */ argc = 0; for (al = argv; al != NIL; al = al[2]) argc++; /* * Built-in functions have * their interpreter opcode * associated with them. */ op = p->value[0] &~ NSTAND; if (opt('s') && (p->value[0] & NSTAND)) { standard(); error("%s is a nonstandard function", p->symbol); } switch (op) { /* * Parameterless functions */ case O_CLCK: case O_SCLCK: case O_WCLCK: case O_ARGC: if (argc != 0) { error("%s takes no arguments", p->symbol); rvlist(argv); return (NIL); } put(1, op); return (nl+T4INT); case O_EOF: case O_EOLN: if (argc == 0) { argv = tr; tr[1] = tr2; tr2[0] = T_VAR; tr2[2] = input->symbol; tr2[1] = tr2[3] = NIL; argc = 1; } else if (argc != 1) { error("%s takes either zero or one argument", p->symbol); rvlist(argv); return (NIL); } } /* * All other functions take * exactly one argument. */ if (argc != 1) { error("%s takes exactly one argument", p->symbol); rvlist(argv); return (NIL); } /* * Evaluate the argmument */ if (op == O_EOF || op == O_EOLN) p1 = stklval((int *) argv[1], NLNIL , LREQ ); else p1 = stkrval((int *) argv[1], NLNIL , RREQ ); if (p1 == NIL) return (NIL); switch (op) { case O_EXP: case O_SIN: case O_COS: case O_ATAN: case O_LN: case O_SQRT: case O_RANDOM: case O_EXPO: case O_UNDEF: if (isa(p1, "i")) convert( nl+T4INT , nl+TDOUBLE); else if (isnta(p1, "d")) { error("%s's argument must be integer or real, not %s", p->symbol, nameof(p1)); return (NIL); } put(1, op); if (op == O_UNDEF) return (nl+TBOOL); else if (op == O_EXPO) return (nl+T4INT); else return (nl+TDOUBLE); case O_SEED: if (isnta(p1, "i")) { error("seed's argument must be an integer, not %s", nameof(p1)); return (NIL); } put(1, op); return (nl+T4INT); case O_ROUND: case O_TRUNC: if (isnta(p1, "d")) { error("%s's argument must be a real, not %s", p->symbol, nameof(p1)); return (NIL); } put(1, op); return (nl+T4INT); case O_ABS2: case O_SQR2: if (isa(p1, "d")) { put(1, op + O_ABS8-O_ABS2); return (nl+TDOUBLE); } if (isa(p1, "i")) { put(1, op + (width(p1) >> 2)); return (nl+T4INT); } error("%s's argument must be an integer or real, not %s", p->symbol, nameof(p1)); return (NIL); case O_ORD2: if (isa(p1, "bcis") || classify(p1) == TPTR) { return (nl+T4INT); } error("ord's argument must be of scalar type or a pointer, not %s", nameof(p1)); return (NIL); case O_SUCC2: case O_PRED2: if (isa(p1, "d")) { error("%s is forbidden for reals", p->symbol); return (NIL); } if ( isnta( p1 , "bcsi" ) ) { error("%s's argument must be of scalar type, not %s", p->symbol, nameof(p1)); return NIL; } if (isa(p1, "i")) { if (width(p1) <= 2) { op += O_PRED24 - O_PRED2; put(3, op, (int)p1->range[0], (int)p1->range[1]); } else { op++; put(3, op, p1->range[0], p1->range[1]); } return nl + T4INT; } else { put(3, op, (int)p1->range[0], (int)p1->range[1]); return p1; } case O_ODD2: if (isnta(p1, "i")) { error("odd's argument must be an integer, not %s", nameof(p1)); return (NIL); } put(1, op + (width(p1) >> 2)); return (nl+TBOOL); case O_CHR2: if (isnta(p1, "i")) { error("chr's argument must be an integer, not %s", nameof(p1)); return (NIL); } put(1, op + (width(p1) >> 2)); return (nl+TCHAR); case O_CARD: if (isnta(p1, "t")) { error("Argument to card must be a set, not %s", nameof(p1)); return (NIL); } put(2, O_CARD, width(p1)); return (nl+T2INT); case O_EOLN: if (!text(p1)) { error("Argument to eoln must be a text file, not %s", nameof(p1)); return (NIL); } put(1, op); return (nl+TBOOL); case O_EOF: if (p1->class != FILET) { error("Argument to eof must be file, not %s", nameof(p1)); return (NIL); } put(1, op); return (nl+TBOOL); case 0: error("%s is an unimplemented 6000-3.4 extension", p->symbol); default: pa((nic("func1"); } } #endif OBJ } put(2, O_CARD, width(p1)); return (nl+T2INT); case O_EOLN: if (!text(p1)) { error("Argument to eoln must be a text file, not %s", nameof(p1)); return (NIL); } put(1, op); return (nl+TBOOL); case O_EOF: if (p1->class != FILET) { error("Argument to eof must be file, not %s", nameof(p1)); return (NIL); } put(1, op); return (nl+TBOOL); case 0: error("%s is an unimplemented 6000-3.4 extension", p->symbol); default: pacmd/pi/gen.c 644 0 33 12475 2552606440 6157 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)gen.c 1.2 3/8/81"; #include "whoami.h" #ifdef OBJ /* * and the rest of the file */ #include "0.h" #include "tree.h" #include "opcode.h" #include "objfmt.h" /* * This array tells the type * returned by an arithmetic * operation. It is indexed * by the logarithm of the * lengths base 2. */ #ifndef DEBUG char arret[] = { T4INT, T4INT, T4INT, TDOUBLE, T4INT, T4INT, T4INT, TDOUBLE, T4INT, T4INT, T4INT, TDOUBLE, TDOUBLE, TDOUBLE, TDOUBLE, TDOUBLE }; #else char arret0[] = { T4INT, T4INT, T4INT, TDOUBLE, T4INT, T4INT, T4INT, TDOUBLE, T4INT, T4INT, T4INT, TDOUBLE, TDOUBLE, TDOUBLE, TDOUBLE, TDOUBLE }; char arret1[] = { T4INT, T4INT, T4INT, TDOUBLE, T4INT, T4INT, T4INT, TDOUBLE, T4INT, T4INT, T4INT, TDOUBLE, TDOUBLE, TDOUBLE, TDOUBLE, TDOUBLE }; char *arret = arret0; #endif /* * These array of arithmetic and set * operators are indexed by the * tree nodes and is highly dependent * on their order. They thus take * on the flavor of magic. */ int arop[] = { 0, O_NEG2, O_MOD2, O_DIV2, O_DVD2, O_MUL2, O_ADD2, O_SUB2, O_REL2, O_REL2, O_REL2, O_REL2, O_REL2, O_REL2 }; int setop[] = { O_MULT, O_ADDT, O_SUBT, O_RELT, O_RELT, O_RELT, O_RELT, O_RELT, O_RELT, }; /* * The following array is * used when operating on * two reals since they are * shoved off in a corner in * the interpreter table. */ int ar8op[] = { O_DVD8, O_MUL8, O_ADD8, O_SUB8, O_REL8, O_REL8, O_REL8, O_REL8, O_REL8, O_REL8, }; /* * The following arrays, which are linearizations * of two dimensional arrays, are the offsets for * arithmetic, relational and assignment operations * indexed by the logarithms of the argument widths. */ #ifndef DEBUG char artab[] = { O_ADD2-O_ADD2, O_ADD2-O_ADD2, O_ADD42-O_ADD2, O_ADD82-O_ADD2, O_ADD2-O_ADD2, O_ADD2-O_ADD2, O_ADD42-O_ADD2, O_ADD82-O_ADD2, O_ADD24-O_ADD2, O_ADD24-O_ADD2, O_ADD4-O_ADD2, O_ADD84-O_ADD2, O_ADD28-O_ADD2, O_ADD28-O_ADD2, O_ADD48-O_ADD2, -1 }; #else char artab0[] = { O_ADD2-O_ADD2, O_ADD2-O_ADD2, O_ADD42-O_ADD2, O_ADD82-O_ADD2, O_ADD2-O_ADD2, O_ADD2-O_ADD2, O_ADD42-O_ADD2, O_ADD82-O_ADD2, O_ADD24-O_ADD2, O_ADD24-O_ADD2, O_ADD4-O_ADD2, O_ADD84-O_ADD2, O_ADD28-O_ADD2, O_ADD28-O_ADD2, O_ADD48-O_ADD2, -1 }; char artab1[] = { O_ADD2-O_ADD2, O_ADD2-O_ADD2, O_ADD2-O_ADD2, O_ADD82-O_ADD2, O_ADD2-O_ADD2, O_ADD2-O_ADD2, O_ADD2-O_ADD2, O_ADD82-O_ADD2, O_ADD2-O_ADD2, O_ADD2-O_ADD2, O_ADD2-O_ADD2, O_ADD84-O_ADD2, O_ADD28-O_ADD2, O_ADD28-O_ADD2, O_ADD28-O_ADD2, -1 }; char *artab = artab0; #endif #ifndef DEBUG char reltab[] = { O_REL2-O_REL2, O_REL2-O_REL2, O_REL42-O_REL2, O_REL82-O_REL2, O_REL2-O_REL2, O_REL2-O_REL2, O_REL42-O_REL2, O_REL82-O_REL2, O_REL24-O_REL2, O_REL24-O_REL2, O_REL4-O_REL2, O_REL84-O_REL2, O_REL28-O_REL2, O_REL28-O_REL2, O_REL48-O_REL2, O_REL8-O_REL2 }; #else char reltab0[] = { O_REL2-O_REL2, O_REL2-O_REL2, O_REL42-O_REL2, O_REL82-O_REL2, O_REL2-O_REL2, O_REL2-O_REL2, O_REL42-O_REL2, O_REL82-O_REL2, O_REL24-O_REL2, O_REL24-O_REL2, O_REL4-O_REL2, O_REL84-O_REL2, O_REL28-O_REL2, O_REL28-O_REL2, O_REL48-O_REL2, O_REL8-O_REL2 }; char reltab1[] = { O_REL2-O_REL2, O_REL2-O_REL2, O_REL2-O_REL2, O_REL82-O_REL2, O_REL2-O_REL2, O_REL2-O_REL2, O_REL2-O_REL2, O_REL82-O_REL2, O_REL2-O_REL2, O_REL2-O_REL2, O_REL2-O_REL2, O_REL82-O_REL2, O_REL28-O_REL2, O_REL28-O_REL2, O_REL28-O_REL2, O_REL8-O_REL2 }; char *reltab = reltab0; #endif #ifndef DEBUG char asgntab[] = { O_AS21-O_AS2, O_AS21-O_AS2, O_AS41-O_AS2, -1, O_AS2-O_AS2, O_AS2-O_AS2, O_AS42-O_AS2, -1, O_AS24-O_AS2, O_AS24-O_AS2, O_AS4-O_AS2, -1, O_AS28-O_AS2, O_AS28-O_AS2, O_AS48-O_AS2, O_AS8-O_AS2, }; #else char asgntb0[] = { O_AS21-O_AS2, O_AS21-O_AS2, O_AS41-O_AS2, -1, O_AS2-O_AS2, O_AS2-O_AS2, O_AS42-O_AS2, -1, O_AS24-O_AS2, O_AS24-O_AS2, O_AS4-O_AS2, -1, O_AS28-O_AS2, O_AS28-O_AS2, O_AS48-O_AS2, O_AS8-O_AS2, }; char asgntb1[] = { O_AS21-O_AS2, O_AS21-O_AS2, O_AS21-O_AS2, -1, O_AS2-O_AS2, O_AS2-O_AS2, O_AS2-O_AS2, -1, O_AS2-O_AS2, O_AS2-O_AS2, O_AS2-O_AS2, -1, O_AS28-O_AS2, O_AS28-O_AS2, O_AS28-O_AS2, O_AS4-O_AS2, }; char *asgntab = asgntb0; #endif #ifdef DEBUG genmx() { arret = arret1; artab = artab1; reltab = reltab1; asgntab = asgntb1; } #endif /* * Gen generates code for assignments, * and arithmetic and string operations * and comparisons. */ struct nl * gen(p, o, w1, w2) int p, o, w1, w2; { register i, j; int op, off; switch (p) { case O_AS2: case NIL: i = j = -1; /* * Take the log2 of the widths * and linearize them for indexing. * width for indexing. */ #ifdef DEBUG if (hp21mx) { if (w1 == 4) w1 = 8; if (w2 == 4) w2 = 8; } #endif do i++; while (w1 >>= 1); do j++; while (w2 >>= 1); i <<= 2; i |= j; if (p == O_AS2) { put(1, O_AS2 + asgntab[i]); return (NIL); } op = arop[o]; if (op == O_REL2) { put(1, (op + reltab[i]) | (o - T_EQ) << 8+INDX); return (nl+TBOOL); } put(1, i == 15 ? ar8op[o-T_DIVD] : op | artab[i]); return (op == O_DVD2 && !divchk ? nl+TDOUBLE : nl+arret[i]); case TREC: case TSTR: put(2, O_RELG | (o - T_EQ) << 8+INDX, w1); return (nl+TBOOL); case TSET: op = setop[o-T_MULT]; if (op == O_RELT) op |= (o - T_EQ)<<8+INDX; put(2, op, w1); return (o >= T_EQ ? nl+TBOOL : nl+TSET); default: panic("gen"); } } #endif OBJ if (op == O_REL2) { put(1, (op + reltab[i]) | (o - T_EQ) << 8+INDX); return (nl+TBOOL); } put(1, i == 15 ? ar8op[o-T_DIVD] : op | artab[i]); return (op == O_DVD2 && !divchk ? cmd/pi/gram 644 0 33 761 2552606440 6046 "@(#)gram 1.3 8/27/80" /yyval/s//*&/ /\*yysterm\[]/,$d 1;/yyactr/ka 'a,$s/yypv/yyYpv/g 'aa register int **yyYpv; register int *p, *q; yyYpv = yypv; . 1;/^##/-w! y.tab.h /^int yylval 0/d /extern int yychar,/s//extern/ /yyclearin/d /yyerrok/d 1;/^##/d $a yyEactr(__np__, var) int __np__; char *var; { switch(__np__) { default: return (1); . g/case.*@@/s/@@//\ .m$ g/@@/ka\ 'a;?case?,?case?t$\ 'am$\ a\ }\ break; $a } } . 1,$s/@@// /int nterms/d /int nnonter/d /int nstate/d /int yyerrval/d w! q ,"cmd/pi/hash.c 644 0 33 6751 2552606440 6311 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)hash.c 1.2 11/24/80"; #include "whoami.h" #include "0.h" #include "yy.h" /* * The definition for the segmented hash tables. */ struct ht { int *ht_low; int *ht_high; int ht_used; } htab[MAXHASH]; /* * This is the array of keywords and their * token values, which are hashed into the table * by inithash. */ struct kwtab yykey[] = { "and", YAND, "array", YARRAY, "assert", YASSERT, "begin", YBEGIN, "case", YCASE, "const", YCONST, "div", YDIV, "do", YDO, "downto", YDOWNTO, "else", YELSE, "end", YEND, "file", YFILE, "for", YFOR, "forward", YFORWARD, "function", YFUNCTION, "goto", YGOTO, "if", YIF, "in", YIN, "label", YLABEL, "mod", YMOD, "nil", YNIL, "not", YNOT, "of", YOF, "or", YOR, "packed", YPACKED, "procedure", YPROCEDURE, "program", YPROG, "record", YRECORD, "repeat", YREPEAT, "set", YSET, "then", YTHEN, "to", YTO, "type", YTYPE, "until", YUNTIL, "var", YVAR, "while", YWHILE, "with", YWITH, "oct", YOCT, /* non-standard Pascal */ "hex", YHEX, /* non-standard Pascal */ "external", YEXTERN, /* non-standard Pascal */ 0 }; char *lastkey = &yykey[sizeof yykey/sizeof yykey[0]]; /* * Inithash initializes the hash table routines * by allocating the first hash table segment using * an already existing memory slot. */ #ifndef PI0 inithash() #else inithash(hshtab) int *hshtab; #endif { register int *ip; #ifndef PI0 static int hshtab[HASHINC]; #endif htab[0].ht_low = hshtab; htab[0].ht_high = &hshtab[HASHINC]; for (ip = yykey; *ip; ip += 2) hash(ip[0], 0)[0] = ip; } /* * Hash looks up the s(ymbol) argument * in the string table, entering it if * it is not found. If save is 0, then * the argument string is already in * a safe place. Otherwise, if hash is * entering the symbol for the first time * it will save the symbol in the string * table using savestr. */ int *hash(s, save) char *s; int save; { register int *h; register i; ((register char *cp; int *sym; struct ht *htp; int sh; /* * The hash function is a modular hash of * the sum of the characters with the sum * doubled before each successive character * is added. */ cp = s; if (cp == NIL) cp = token; /* default symbol to be hashed */ i = 0; while (*cp) i = i*2 + *cp++; sh = (i&077777) % HASHINC; cp = s; if (cp == NIL) cp = token; /* * There are as many as MAXHASH active * hash tables at any given point in time. * The search starts with the first table * and continues through the active tables * as necessary. */ for (htp = htab; htp < &htab[MAXHASH]; htp++) { if (htp->ht_low == NIL) { cp = (char *) calloc(sizeof ( int * ), HASHINC); if (cp == 0) { yerror("Ran out of memory (hash)"); pexit(DIED); } htp->ht_low = cp; htp->ht_high = htp->ht_low + HASHINC; cp = s; if (cp == NIL) cp = token; } h = htp->ht_low + sh; /* * quadratic rehash increment * starts at 1 and incremented * by two each rehash. */ i = 1; do { if (*h == 0) { if (htp->ht_used > (HASHINC * 3)/4) break; htp->ht_used++; if (save != 0) { *h = (int) savestr(cp); } else *h = s; return (h); } sym = *h; if (sym < lastkey && sym >= yykey) sym = *sym; if (sym->pchar == *cp && strcmp(sym, cp) == 0) return (h); h += i; i += 2; if (h >= htp->ht_high) h -= HASHINC; } while (i < HASHINC); } yerror("Ran out of hash tables"); pexit(DIED); } d * by two each rehacmd/pi/iorec.h 644 0 33 1315 2552606440 6463 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)iorec.h 1.1 8/27/80"; */ #include #define NAMSIZ 76 struct iorec { char *fileptr; /* ptr to file window */ long lcount; /* number of lines printed */ long llimit; /* maximum number of text lines */ FILE *fbuf; /* FILE ptr */ struct iorec *fchain; /* chain to next file */ long *flev; /* ptr to associated file variable */ char *pfname; /* ptr to name of file */ long funit; /* file status flags */ long size; /* size of elements in the file */ char fname[NAMSIZ]; /* name of associated UNIX file */ char buf[BUFSIZ]; /* I/O buffer */ char window[1]; /* file window element */ }; le window */ long lcount; /* number of lines printed */ long llimit; /* maximum number of text lines */ FILE *fbuf; /* FILE ptr */ struct iorec *fchain; /* chain to next file */ long *flev; /* ptr to associated file variable */ char *pfname; /* ptr to name of file */ long funit; /* file scmd/pi/lab.c 644 0 33 7731 2552606440 6123 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)lab.c 1.9 6/1/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "opcode.h" #include "objfmt.h" #ifdef PC # include "pc.h" # include "pcops.h" #endif PC /* * Label enters the definitions * of the label declaration part * into the namelist. */ label(r, l) int *r, l; { #ifdef PC char extname[ BUFSIZ ]; #endif PC #ifndef PI0 register *ll; register struct nl *p, *lp; lp = NIL; #else send(REVLAB, r); #endif if ( ! progseen ) { level1(); } line = l; #ifndef PI1 if (parts[ cbn ] & (CPRT|TPRT|VPRT|RPRT)){ if ( opt( 's' ) ) { standard(); } else { warning(); } error("Label declarations should precede const, type, var and routine declarations"); } if (parts[ cbn ] & LPRT) { if ( opt( 's' ) ) { standard(); } else { warning(); } error("All labels should be declared in one label part"); } parts[ cbn ] |= LPRT; #endif #ifndef PI0 for (ll = r; ll != NIL; ll = ll[2]) { l = getlab(); p = enter(defnl(ll[1], LABEL, 0, l)); /* * Get the label for the eventual target */ p->value[1] = getlab(); p->chain = lp; p->nl_flags |= (NFORWD|NMOD); p->value[NL_GOLEV] = NOTYET; p->entloc = l; lp = p; # ifdef OBJ /* * This operator is between * the bodies of two procedures * and provides a target for * gotos for this label via TRA. */ putlab(l); /* put(2, O_GOTO | cbn<<8+INDX, (long)p->value[1]); */ put(2, O_GOTO | cbn<<8, (long)p->value[1]); # endif OBJ # ifdef PC /* * labels have to be .globl otherwise /lib/c2 may * throw them away if they aren't used in the function * which defines them. */ sextname( extname , p -> symbol , cbn ); putprintf( " .globl %s" , 0 , extname ); if ( cbn == 1 ) { stabglabel( extname , line ); } # endif PC } gotos[cbn] = lp; # ifdef PTREE { pPointer Labels = LabelDCopy( r ); pDEF( PorFHeader[ nesting ] ).PorFLabels = Labels; } # endif PTREE #endif } #ifndef PI0 /* * Gotoop is called when * we get a statement "goto label" * and generates the needed tra. */ gotoop(s) char *s; { register struct nl *p; #ifdef PC char extname[ BUFSIZ ]; #endif PC gocnt++; p = lookup(s); if (p == NIL) return (NIL); # ifdef OBJ put(2, O_TRA4, (long)p->entloc); # endif OBJ # ifdef PC if ( cbn != bn ) { /* * call goto to unwind the stack to the destination level */ putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_GOTO" ); putLV( DISPLAYNAME , 0 , bn * sizeof( struct dispsave ) , NGLOBAL , P2PTR | P2INT ); putop( P2CALL , P2INT ); putdot( filename , line ); } sextname( extname , p -> symbol , bn ); putprintf( " jbr %s" , 0 , extname ); # endif PC if (bn == cbn) if (p->nl_flags & NFORWD) { if (p->value[NL_GOLEV] == NOTYET) { p->value[NL_GOLEV] = level; p->value[NL_GOLINE] = line; } } else if (p->value[NL_GOLEV] == DEAD) { recovered(); error("Goto %s is into a structured statement", p->symbol); } } /* * Labeled is called when a label * definition is encountered, and * marks that it has been found and * patches the associated GOTO generated * by gotoop. */ labeled(s) char *s; { register struct nl *p; #ifdef PC char extname[ BUFSIZ ]; #endif PC p = lookup(s); if (p == NIL) return (NIL); if (bn != cbn) { error("Label %s not defined in correct block", s); return; } if ((p->nl_flags & NFORWD) == 0) { error("Label %s redefined", s); return; } p->nl_flags &= ~NFORWD; # ifdef OBJ patch4(p->entloc); # endif OBJ # ifdef PC sextname( extname , p -> symbol , bn ); putprintf( "%s:" , 0 , extname ); # endif PC if (p->value[NL_GOLEV] != NOTYET) if (p->value[NL_GOLEV] < level) { recovered(); error("Goto %s from line %d is into a structured statement", s, p->value[NL_GOLINE]); } p->value[NL_GOLEV] = level; } #endif orrect block", s); return; } if ((pcmd/pi/lookup.c 644 0 33 3774 2552606441 6702 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)lookup.c 1.1 8/27/80"; #include "whoami.h" #include "0.h" /* * Lookup is called to * find a symbol in the * block structure symbol * table and returns a pointer to * its namelist entry. */ struct nl * lookup(s) register char *s; { register struct nl *p; register struct udinfo *udp; if (s == NIL) { nocascade(); return (NIL); } p = lookup1(s); if (p == NIL) { derror("%s is undefined", s); return (NIL); } if (p->class == FVAR) { p = p->chain; bn--; } return (p); } #ifndef PI0 int flagwas; #endif /* * Lookup1 is an internal lookup. * It is not an error to call lookup1 * if the symbol is not defined. Also * lookup1 will return FVARs while * lookup never will, thus asgnop * calls it when it thinks you are * assigning to the function variable. */ struct nl * lookup1(s) register char *s; { register struct nl *p; #ifndef PI0 register struct nl *q; #endif register int i; if (s == NIL) return (NIL); bn = cbn; #ifndef PI0 /* * We first check the field names * of the currently active with * statements (expensive since they * are not hashed). */ for (p = withlist; p != NIL; p = p->nl_next) { q = p->type; if (q == NIL) continue; if (reclook(q, s) != NIL) /* * Return the WITHPTR, lvalue understands. */ return (p); } #endif /* * Symbol table is a 64 way hash * on the low bits of the character * pointer value. (Simple, but effective) */ i = (int) s & 077; for (p = disptab[i]; p != NIL; p = p->nl_next) if (p->symbol == s && p->class != FIELD && p->class != BADUSE) { bn = (p->nl_block & 037); #ifndef PI0 flagwas = p->nl_flags; p->nl_flags |= NUSED; #endif return (p); } return (NIL); } #ifndef PI01 nlfund(sp) char *sp; { register struct nl *p; register int i; i = (int) sp & 077; for (p = disptab[i]; p != NIL; p = p->nl_next) if (p->symbol == sp && (p->nl_block & 037) == 0) return (nloff(p)); return (0); } #endif i =((cmd/pi/lval.c 644 0 33 21275 2552606441 6343 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)lval.c 1.8 6/15/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "opcode.h" #include "objfmt.h" #ifdef PC # include "pc.h" # include "pcops.h" #endif PC extern int flagwas; /* * Lvalue computes the address * of a qualified name and * leaves it on the stack. * for pc, it can be asked for either an lvalue or an rvalue. * the semantics are the same, only the code is different. */ struct nl * lvalue(r, modflag , required ) int *r, modflag; int required; { register struct nl *p; struct nl *firstp, *lastp; register *c, *co; int f, o; /* * Note that the local optimizations * done here for offsets would more * appropriately be done in put. */ int tr[2], trp[3]; if (r == NIL) { return (NIL); } if (nowexp(r)) { return (NIL); } if (r[0] != T_VAR) { error("Variable required"); /* Pass mesgs down from pt of call ? */ return (NIL); } # ifdef PC /* * pc requires a whole different control flow */ return pclvalue( r , modflag , required ); # endif PC # ifdef OBJ /* * pi uses the rest of the function */ firstp = p = lookup(r[2]); if (p == NIL) { return (NIL); } c = r[3]; if ((modflag & NOUSE) && !lptr(c)) { p->nl_flags = flagwas; } if (modflag & MOD) { p->nl_flags |= NMOD; } /* * Only possibilities for p->class here * are the named classes, i.e. CONST, TYPE * VAR, PROC, FUNC, REF, or a WITHPTR. */ switch (p->class) { case WITHPTR: /* * Construct the tree implied by * the with statement */ trp[0] = T_LISTPP; trp[1] = tr; trp[2] = r[3]; tr[0] = T_FIELD; tr[1] = r[2]; c = trp; # ifdef PTREE /* * mung r[4] to say which field this T_VAR is * for VarCopy */ r[4] = reclook( p -> type , r[2] ); # endif /* and fall through */ case REF: /* * Obtain the indirect word * of the WITHPTR or REF * as the base of our lvalue */ put(2, PTR_RV | bn << 8+INDX , (int)p->value[0] ); f = 0; /* have an lv on stack */ o = 0; break; case VAR: f = 1; /* no lv on stack yet */ o = p->value[0]; break; default: error("%s %s found where variable required", classes[p->class], p->symbol); return (NIL); } /* * Loop and handle each * qualification on the name */ if (c == NIL && (modflag&ASGN) && ( p->value[NL_FORV] & FORVAR ) ) { error("Can't modify the for variable %s in the range of the loop", p->symbol); return (NIL); } for (; c != NIL; c = c[2]) { co = c[1]; if (co == NIL) { return (NIL); } lastp = p; p = p->type; if (p == NIL) { return (NIL); } switch (co[0]) { case T_PTR: /* * Pointer qualification. */ lastp->nl_flags |= NUSED; if (p->class != PTR && p->class != FILET) { error("^ allowed only on files and pointers, not on %ss", nameof(p)); goto bad; } if (f) { if (p->class == FILET && bn != 0) put(2, O_LV | bn <<8+INDX , o ); else /* * this is the indirection from * the address of the pointer * to the pointer itself. * kirk sez: * fnil doesn't want this. * and does it itself for files * since only it knows where the * actual window is. * but i have to do this for * regular pointers. * This is further complicated by * the fact that global variables * are referenced through pointers * on the stack. Thus an RV on a * global variable is the same as * an LV of a non-global one ?!? */ put(2, PTR_RV | bn <<8+INDX , o ); } else { if (o) { put(2, O_OFF, o); } if (p->class != FILET || bn == 0) put(1, PTR_IND); } /* * Pointer cannot be * nil and file cannot * be at end-of-file. */ put(1, p->class == FILET ? O_FNIL : O_NIL); f = o = 0; continue; case T_ARGL: if (p->class != ARRAY) { if (lastp == firstp) { error("%s is a %s, not a function", r[2], classes[firstp->class]); } else { error("Illegal function qualificiation"); } return (NIL); } recovered(); error("Pascal uses [] for subscripting, not ()"); case T_ARY: if (p->class != ARRAY) { error("Subscripting allowed only on arrays, not on %ss", nameof(p)); goto bad; } if (f) { if (bn == 0) /* * global variables are * referenced through pointers * on the stack */ put(2, PTR_RV | bn<<8+INDX, o); else put(2, O_LV | bn<<8+INDX, o); } else { if (o) { put(2, O_OFF, o); } } switch (arycod(p, co[1])) { case 0: return (NIL); case -1: goto bad; } f = o = 0; continue; case T_FIELD: /* * Field names are just * an offset with some * semantic checking. */ if (p->class != RECORD) { error(". allowed only on records, not on %ss", nameof(p)); goto bad; } if (co[1] == NIL) { return (NIL); } p = reclook(p, co[1]); if (p == NIL) { error("%s is not a field in this record", co[1]); goto bad; } # ifdef PTREE /* * mung co[3] to indicate which field * this is for SelCopy */ co[3] = p; # endif if (modflag & MOD) { p->nl_flags |= NMOD; } if ((modflag & NOUSE) == 0 || lptr(c[2])) { p->nl_flags |= NUSED; } o += p->value[0]; continue; default: panic("lval2"); } } if (f) { if (bn == 0) /* * global variables are referenced through * pointers on the stack */ put(2, PTR_RV | bn<<8+INDX, o); else put(2, O_LV | bn<<8+INDX, o); } else { if (o) { put(2, O_OFF, o); } } return (p->type); bad: cerror("Error occurred on qualification of %s", r[2]); return (NIL); # endif OBJ } lptr(c) register int *c; { register int *co; for (; c != NIL; c = c[2]) { co = c[1]; if (co == NIL) { return (NIL); } switch (co[0]) { case T_PTR: return (1); case T_ARGL: return (0); case T_ARY: case T_FIELD: continue; default: panic("lptr"); } } return (0); } /* * Arycod does the * code generation * for subscripting. */ arycod(np, el) struct nl *np; int *el; { register struct nl *p, *ap; long sub; bool constsub; int i, d, v, v1; int w; p = np; if (el == NIL) { return (0); } d = p->value[0]; /* * Check each subscript */ for (i = 1; i <= d; i++) { if (el == NIL) { error("Too few subscripts (%d given, %d required)", i-1, d); return (-1); } p = p->chain; if (constsub = constval(el[1])) { ap = con.ctype; sub = con.crval; if (sub < p->range[0] || sub > p->range[1]) { error("Subscript value of %D is out of range", sub); return (0); } sub -= p->range[0]; } else { # ifdef PC precheck( p , "_SUBSC" , "_SUBSCZ" ); # endif PC ap = rvalue(el[1], NLNIL , RREQ ); if (ap == NIL) { return (0); } # ifdef PC postcheck( p ); # endif PC } if (incompat(ap, p->type, el[1])) { cerror("Array index type incompatible with declared index type"); if (d != 1) { cerror("Error occurred on index number %d", i); } return (-1); } w = aryconst(np, i); # ifdef OBJ if (constsub) { sub *= w; if (sub != 0) { w = width(ap); put(2, w <= 2 ? O_CON2 : O_CON4, sub); gen(NIL, T_ADD, sizeof(char *), w); } el = el[2]; continue; } if (opt('t') == 0) { switch (w) { case 8: w = 6; case 4: case 2: case 1: put(2, (width(ap) != 4 ? O_INX2P2 : O_INX4P2) | (w & ~1) << 7, ( short ) p->range[0]); el = el[2]; continue; } } put(4, width(ap) != 4 ? O_INX2 : O_INX4, w, (short)p->range[0], (short)(p->range[1])); el = el[2]; continue; # endif OBJ # ifdef PC /* * subtract off the lower bound */ if (constsub) { sub *= w; if (sub != 0) { putleaf( P2ICON , sub , 0 , P2INT , 0 ); putop(P2PLUS, ADDTYPE(p2type(np->type), P2PTR)); } el = el[2]; continue; } if ( p -> range[ 0 ] != 0 ) { putleaf( P2ICON , p -> range[0] , 0 , P2INT , 0 ); putop( P2MINUS , P2INT ); } /* * multiply by the width of the elements */ if ( w != 1 ) { putleaf( P2ICON , w , 0 , P2INT , 0 ); putop( P2MUL , P2INT ); } /* * and add it to the base address */ putop( P2PLUS , ADDTYPE( p2type( np -> type ) , P2PTR ) ); # endif PC el = el[2]; } if (el != NIL) { do { el = el[2]; i++; } while (el != NIL); error("Too many subscripts (%d given, %d required)", i-1, d); return (-1); } return (1); } , 0 ); putop( P2MINUS , P2INT ); } /* * multiply by the width of the elements */ if ( w != 1 ) { putleaf( P2ICON , w , 0 , P2INT , 0 ); putop( P2MUL , P2INT ); } /* * and add it to the base address */ putop( P2PLUS , ADDTYPE( p2type( np -> type ) , P2PTR ) ); # endifcmd/pi/main.c 644 0 33 17454 2552606441 6335 ((/* Copyright (c) 1979 Regents of the University of California */ static char copyright[] = "@(#)Copyright (c) 1979 Regents of the University of California"; static char sccsid[] = "@(#)main.c 1.4 3/9/81"; #include "whoami.h" #include "0.h" #include "yy.h" #include #include "objfmt.h" /* * This version of pi has been in use at Berkeley since May 1977 * and is very stable. Please report any problems with the error * recovery to the second author at the address given in the file * READ_ME. The second author takes full responsibility for any bugs * in the syntactic error recovery. */ char piusage[] = "pi [ -blnpstuw ] [ -i file ... ] name.p"; char pixusage[] = "pix [ -blnpstuw ] [ -i file ... ] name.p [ arg ... ]"; char pcusage[] = "pc [ options ] [ -o file ] [ -i file ... ] name.p"; char *usageis = piusage; char *errfile = ERR_STRNGS; #ifdef OBJ char *obj = "obj"; #endif OBJ #ifdef PC char *pcname = "pc.pc1"; #endif PC #ifdef PTREE char *pTreeName = "pi.pTree"; #endif PTREE /* * Be careful changing errfile and howfile. * There are the "magic" constants 9 and 15 immediately below. * errfile is now defined by ERR_STRNGS, in objfmt.h, * and its leading path name length is ERR_PATHLEN long. * this for executing out of the current directory if running as `a.something'. */ #ifdef OBJ char *howfile = HOW_STRNGS; #endif OBJ #ifdef PC char *howfile = HOW_STRNGS; #endif PC int onintr(); extern char *lastname; FILE *ibuf; FILE *pcstream = NULL; /* * these are made real variables * so they can be changed * if you are compiling on a smaller machine */ double MAXINT = 2147483647.; double MININT = -2147483648.; /* * Main program for pi. * Process options, then call yymain * to do all the real work. */ main(argc, argv) int argc; char *argv[]; { register char *cp; register c; int i; if (argv[0][0] == 'a') errfile += ERR_PATHLEN , howfile += HOW_PATHLEN; # ifdef OBJ if (argv[0][0] == '-' && argv[0][1] == 'o') { obj = &argv[0][2]; usageis = pixusage; howfile[HOW_PATHLEN+6] = 'x'; ofil = 3; } else { ofil = creat(obj, 0755); if (ofil < 0) { perror(obj); pexit(NOSTART); } } # endif OBJ argv++, argc--; if (argc == 0) { i = fork(); if (i == -1) goto usage; if (i == 0) { execl("/bin/cat", "cat", howfile, 0); goto usage; } while (wait(&i) != -1) continue; pexit(NOSTART); } # ifdef OBJ opt('p') = opt('t') = opt('b') = 1; while (argc > 0) { cp = argv[0]; if (*cp++ != '-') break; while (c = *cp++) switch (c) { #ifdef DEBUG case 'k': case 'r': case 'y': togopt(c); continue; case 'K': yycosts(); pexit(NOSTART); case 'A': testtrace = TRUE; case 'F': fulltrace = TRUE; case 'E': errtrace = TRUE; opt('r')++; continue; case 'U': yyunique = 0; continue; #endif case 'b': opt('b') = 2; continue; case 'i': pflist = argv + 1; pflstc = 0; while (argc > 1) { if (dotted(argv[1], 'p')) break; pflstc++, argc--, argv++; } if (pflstc == 0) goto usage; continue; case 'l': case 'n': case 'p': case 's': case 't': case 'u': case 'w': togopt(c); continue; case 'z': monflg = TRUE; continue; default: usage: Perror( "Usage", usageis); pexit(NOSTART); } argc--, argv++; } # endif OBJ # ifdef PC opt( 'b' ) = 1; opt( 'g' ) = 0; opt( 't' ) = 0; opt( 'p' ) = 0; usageis = pcusage; while ( argc > 0 ) { cp = argv[0]; if ( *cp++ != '-' ) { break; } c = *cp++; switch( c ) { #ifdef DEBUG case 'k': case 'r': case 'y': togopt(c); break; case 'K': yycosts(); pexit(NOSTART); case 'A': testtrace = TRUE; /* and fall through */ case 'F': fulltrace = TRUE; /* and fall through */ case 'E': errtrace = TRUE; opt('r')++; break; case 'U': yyunique = 0; break; #endif case 'b': opt('b') = 2; break; case 'i': pflist = argv + 1; pflstc = 0; while (argc > 1) { if (dotted(argv[1], 'p')) break; pflstc++, argc--, argv++; } if (pflstc == 0) goto usage; break; /* * output file for the first pass */ case 'o': if ( argc < 2 ) { goto usage; } argv++; argc--; pcname = argv[0]; break; case 'C': /* * since -t is an ld switch, use -C * to turn on tests */ togopt( 't' ); break; case 'g': /* * sdb symbol table */ togopt( 'g' ); break; case 'l': case 's': case 'u': case 'w': togopt(c); break; case 'p': /* * -p on the command line means profile */ profflag = TRUE; break; case 'z': monflg = TRUE; break; default: usage: Perror( "Usage", usageis); pexit(NOSTART); } argc--; argv++; } # endif PC if (argc != 1) goto usage; efil = open ( errfile, 0 ); if ( efil < 0 ) perror(errfile), pexit(NOSTART); filename = argv[0]; if (!dotted(filename, 'p')) { Perror(filename, "Name must end in '.p'"); pexit(NOSTART); } close(0); if ( ( ibuf = fopen( filename , "r" ) ) == NULL ) perror(filename), pexit(NOSTART); ibp = ibuf; # ifdef PC if ( ( pcstream = fopen( pcname , "w" ) ) == NULL ) { perror( pcname ); pexit( NOSTART ); } stabsource( filename ); # endif PC # ifdef PTREE # define MAXpPAGES 16 if ( ! pCreate( pTreeName , MAXpPAGES ) ) { perror( pTreeName ); pexit( NOSTART ); } # endif PTREE if ( signal( SIGINT , SIG_IGN ) != SIG_IGN ) signal( SIGINT , onintr ); if (opt('l')) { opt('n')++; yysetfile(filename); opt('n')--; } yymain(); /* No return */ } pchr(c) char c; { putc ( c , stdout ); } char ugh[] = "Fatal error in pi\n"; /* * Exit from the Pascal system. * We throw in an ungraceful termination * message if c > 1 indicating a severe * error such as running out of memory * or an internal inconsistency. */ pexit(c) int c; { if (opt('l') && c != DIED && c != NOSTART) while (getline() != -1) continue; yyflush(); switch (c) { case DIED: write(2, ugh, sizeof ugh); case NOSTART: case ERRS: # ifdef OBJ if (ofil > 0) unlink(obj); # endif OBJ # ifdef PC if ( pcstream != NULL ) { unlink( pcname ); } # endif PC break; case AOK: # ifdef OBJ pflush(); # endif OBJ # ifdef PC puteof(); # endif PC break; } /* * this to gather statistics on programs being compiled * taken 20 june 79 ... peter * * if (fork() == 0) { * char *cp = "-0"; * cp[1] += c; * execl("/usr/lib/gather", "gather", cp, filename, 0); * exit(1); * } */ # ifdef PTREE pFinish(); # endif exit(c); } onintr() { signal( SIGINT , SIG_IGN ); pexit(NOSTART); } /* * Get an error message from the error message file */ geterr(seekpt, buf) int seekpt; char *buf; { lseek(efil, (long) seekpt, 0); if (read(efil, buf, 256) <= 0) perror(errfile), pexit(DIED); } header() { extern char version[]; static char anyheaders; gettime( filename ); if (anyheaders && opt('n')) putc( '\f' , stdout ); anyheaders++; # ifdef OBJ printf("Berkeley Pascal PI -- Version 2.0 (%s)\n\n%s %s\n\n", version, myctime(&tvec), filename); # endif OBJ # ifdef PC printf("Berkeley Pascal PC -- Version 2.0 (%s)\n\n%s %s\n\n", version, myctime(&tvec), filename); # endif PC } efil, (long) seekpt, 0); if (read(efil, buf, 256) <= 0) perror(errfile), pexit(DIED); } header() { extern char version[]; static char anyheaders; gettime( filename ); if (anyheaders && opt('n')) putc( cmd/pi/makefile 644 0 33 16253 2552606442 6742 SCCSID = "@(#)pimakefile 1.18 4/1/81" WHOAMI = pi INSTALLNAME = ${DESTDIR}/usr/ucb/pi VERSION = 2.0 MKSTR = /usr/ucb/mkstr EYACC = /usr/ucb/eyacc RM = -rm -f GET = touch CFLAGS = -O -w LDFLAGS = -z LIBDIR = ${DESTDIR}/usr/lib TMPDIR = tmp ERRORSTRINGS = ${WHOAMI}${VERSION}strings SRCS = ato.c \ call.c case.c clas.c const.c conv.c cset.c \ error.c fdec.c fend.c fhdr.c flvalue.c forop.c func.c gen.c \ hash.c lab.c lookup.c lval.c stklval.c \ main.c nl.c proc.c put.c \ rec.c rval.c stkrval.c\ stat.c string.c subr.c \ tmps.c tree.c type.c var.c \ TRdata.c \ treen.c yycopy.c \ yycosts.c yyerror.c yyget.c yyid.c yylex.c yymain.c yyoptions.c \ yypanic.c yyparse.c yyprint.c yyput.c yyrecover.c yyseman.c yytree.c \ p2put.c stab.c pcproc.c pcfunc.c pccaseop.c pclval.c HDRS = 0.h OPnames.h align.h iorec.h objfmt.h pstab.h pc.h pcops.h \ send.h tree.h whoami.h yy.h OTHERS = pas.y opc.c version.c gram pic.c OBJS = ato.o \ call.o case.o clas.o const.o conv.o cset.o \ error.o fdec.o fend.o fhdr.o flvalue.o forop.o func.o gen.o \ hash.o lab.o lookup.o lval.o stklval.o \ main.o nl.o proc.o put.o \ rec.o rval.o stkrval.o\ stat.o string.o subr.o \ tmps.o tree.o type.o var.o \ TRdata.o \ treen.o yycopy.o \ y.tab.o \ yycosts.o yyerror.o yyget.o yyid.o yylex.o yymain.o yyoptions.o \ yypanic.o yyparse.o yyprint.o yyput.o yyrecover.o yyseman.o yytree.o \ p2put.o stab.o pcproc.o pcfunc.o pccaseop.o pclval.o a.out: ${OBJS} version ${RM} Version.[oc] ./version > Version.c ${CC} ${CFLAGS} ${LDFLAGS} $(({OBJS} Version.c sources: ${SRCS} ${HDRS} ${OTHERS} ${SRCS} ${HDRS} ${OTHERS}: ${GET} $@ .c.o: ${RM} ${TMPDIR}/$*.c ${MKSTR} - ${ERRORSTRINGS} ${TMPDIR}/ $*.c cd ${TMPDIR} ; ${CC} ${CFLAGS} -I.. -c $*.c ;\ rm -f ../$*.o; mv $*.o ../$*.o ${RM} ${TMPDIR}/$*.c y.tab.h: pas.y gram ${RM} y.tab.c y.tab.h ${EYACC} pas.y > /dev/null ex - y.tab.c opcode.h ${RM} opc pTree.h: echo "/* this is not pTree.h */" > pTree.h version: version.c ${CC} version.c -o version clean: ${RM} *.o ${TMPDIR}/*.c ${RM} y.tab.h y.tab.c y.tab.out ${RM} ${ERRORSTRINGS} ${RM} version Version.c ${RM} a.out core *.list *.bak ${RM} opc pic tags print: sources @pr makefile READ_ME @ls -ls | pr @cc -o pic pic.c @pic | pr @rm pic @pr 0.h whoami.h main.c pas.y @pr OPnames.h opcode.h tree.h @pr pc.h @pr [a-ln-x]*.c @pr yy.h yy*.c install: a.out cp ${ERRORSTRINGS} ${LIBDIR}/${ERRORSTRINGS} cp a.out ${INSTALLNAME} depend: sources /bin/grep '^#[ ]*include' *.h \ | sed '/<.*>/d' \ | sed 's/\(.*\):[^"]*"\([^"]*\)".*/\1: \2/' >makedep /bin/grep '^#[ ]*include' *.c \ | sed '/<.*>/d' \ | sed 's/:[^"]*"\([^"]*\)".*/: \1/' \ | sed 's/\.c/.o/' >>makedep 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 # DO NOT DELETE THIS LINE -- make depend uses it 0.h: pTree.h yy.h: y.tab.h TRdata.o: whoami.h TRdata.o: 0.h ato.o: whoami.h ato.o: 0.h call.o: whoami.h call.o: 0.h call.o: tree.h call.o: opcode.h call.o: objfmt.h call.o: pc.h call.o: pcops.h case.o: whoami.h case.o: 0.h case.o: tree.h case.o: opcode.h clas.o: whoami.h clas.o: 0.h clas.o: tree.h const.o: whoami.h const.o: 0.h const.o: tree.h conv.o: whoami.h conv.o: 0.h conv.o: opcode.h conv.o: pcops.h cset.o: whoami.h cset.o: 0.h cset.o: tree.h cset.o: opcode.h cset.o: objfmt.h cset.o: pc.h cset.o: pcops.h error.o: whoami.h error.o: 0.h error.o: yy.h fdec.o: whoami.h fdec.o: 0.h fdec.o: tree.h fdec.o: opcode.h fdec.o: objfmt.h fdec.o: align.h fdec.o: pc.h fdec.o: pcops.h fend.o: whoami.h fend.o: 0.h fend.o: tree.h fend.o: opcode.h fend.o: objfmt.h fend.o: align.h fend.o: pc.h fend.o: pcops.h fhdr.o: whoami.h fhdr.o: 0.h fhdr.o: tree.h fhdr.o: opcode.h fhdr.o: objfmt.h fhdr.o: align.h fhdr.o: pc.h fhdr.o: pcops.h flvalue.o: whoami.h flvalue.o: 0.h flvalue.o: tree.h flvalue.o: opcode.h flvalue.o: objfmt.h flvalue.o: pc.h flvalue.o: pcops.h forop.o: whoami.h forop.o: 0.h forop.o: opcode.h forop.o: tree.h forop.o: objfmt.h forop.o: pc.h forop.o: pcops.h func.o: whoami.h func.o: 0.h func.o: tree.h func.o: opcode.h gen.o: whoami.h gen.o: 0.h gen.o: tree.h gen.o: opcode.h gen.o: objfmt.h hash.o: whoami.h hash.o: 0.h hash.o: yy.h lab.o: whoami.h lab.o: 0.h lab.o: tree.h lab.o: opcode.h lab.o: objfmt.h lab.o: pc.h lab.o: pcops.h lookup.o: whoami.h lookup.o: 0.h lval.o: whoami.h lval.o: 0.h lval.o: tree.h lval.o: opcode.h lval.o: objfmt.h lval.o: pc.h lval.o: pcops.h main.o: whoami.h main.o: 0.h main.o: yy.h main.o: objfmt.h nl.o: whoami.h nl.o: 0.h nl.o: opcode.h nl.o: objfmt.h opc.o: OPnames.h p2put.o: whoami.h p2put.o: 0.h p2put.o: pcops.h p2put.o: pc.h pccaseop.o: whoami.h pccaseop.o: 0.h pccaseop.o: tree.h pccaseop.o: objfmt.h pccaseop.o: pcops.h pccaseop.o: pc.h pcfunc.o: whoami.h pcfunc.o: 0.h pcfunc.o: tree.h pcfunc.o: opcode.h pcfunc.o: pc.h pcfunc.o: pcops.h pclval.o: whoami.h pclval.o: 0.h pclval.o: tree.h pclval.o: opcode.h pclval.o: objfmt.h pclval.o: pc.h pclval.o: pcops.h pcproc.o: whoami.h pcproc.o: 0.h pcproc.o: tree.h pcproc.o: opcode.h pcproc.o: pc.h pcproc.o: pcops.h pic.o: OPnames.h proc.o: whoami.h proc.o: 0.h proc.o: tree.h proc.o: opcode.h proc.o: objfmt.h put.o: whoami.h put.o: opcode.h put.o: 0.h put.o: objfmt.h put.o: pc.h put.o: OPnames.h rec.o: whoami.h rec.o: 0.h rec.o: tree.h rec.o: opcode.h rval.o: whoami.h rval.o: 0.h rval.o: tree.h rval.o: opcode.h rval.o: objfmt.h rval.o: pc.h rval.o: pcops.h stab.o: whoami.h stab.o: 0.h stab.o: pstab.h stab.o: pc.h stat.o: whoami.h stat.o: 0.h stat.o: tree.h stat.o: objfmt.h stat.o: pcops.h stat.o: pc.h stat.o: opcode.h stklval.o: whoami.h stklval.o: 0.h stklval.o: tree.h stklval.o: opcode.h stklval.o: objfmt.h stkrval.o: whoami.h stkrval.o: 0.h stkrval.o: tree.h stkrval.o: opcode.h stkrval.o: objfmt.h stkrval.o: pcops.h string.o: whoami.h string.o: 0.h string.o: send.h subr.o: whoami.h subr.o: 0.h tmps.o: whoami.h tmps.o: 0.h tree.o: whoami.h tree.o: 0.h type.o: whoami.h type.o: 0.h type.o: tree.h type.o: objfmt.h var.o: whoami.h var.o: 0.h var.o: align.h var.o: iorec.h var.o: pc.h var.o: pcops.h y.tab.o: whoami.h y.tab.o: 0.h y.tab.o: yy.h y.tab.o: tree.h yycopy.o: 0.h yycopy.o: yy.h yycosts.o: whoami.h yycosts.o: 0.h yycosts.o: yy.h yyerror.o: whoami.h yyerror.o: 0.h yyerror.o: yy.h yyget.o: whoami.h yyget.o: 0.h yyget.o: yy.h yyid.o: whoami.h yyid.o: 0.h yyid.o: yy.h yylex.o: whoami.h yylex.o: 0.h yylex.o: yy.h yymain.o: whoami.h yymain.o: 0.h yymain.o: yy.h yymain.o: objfmt.h yyoptions.o: whoami.h yyoptions.o: 0.h yyoptions.o: yy.h yypanic.o: whoami.h yypanic.o: 0.h yypanic.o: yy.h yyparse.o: whoami.h yyparse.o: 0.h yyparse.o: yy.h yyprint.o: whoami.h yyprint.o: 0.h yyprint.o: yy.h yyput.o: whoami.h yyput.o: 0.h yyput.o: tree.h yyput.o: yy.h yyrecover.o: whoami.h yyrecover.o: 0.h yyrecover.o: yy.h yyseman.o: whoami.h yyseman.o: 0.h yyseman.o: yy.h yytree.o: whoami.h yytree.o: 0.h yytree.o: tree.h # DEPENDENCIES MUST END AT END OF FILE # IF YOU PUT STUFF HERE IT WILL GO AWAY # see make depend above h yyoptions.o: 0.h yyoptions.o: yy.h yypanic.o: whoami.h yypanic.o: 0.h yypanic.o: yy.h yyparse.o: whoami.h yyparse.o: 0.h yyparse.o: yy.h yyprint.o: whoami.h yyprint.o: 0.h yyprint.o: yy.h yyput.o: whoami.h yyput.o: 0.h yyput.o: tree.h yyput.o: yy.h yyrecover.o: whoami.h yyrecover.o: 0.h yyrecover.o: yy.h yyseman.o: whoami.h yyseman.o: 0.cmd/pi/nl.c 644 0 33 31363 2552606442 6016 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)nl.c 1.5 6/1/81"; #include "whoami.h" #include "0.h" #include "opcode.h" #include "objfmt.h" /* * NAMELIST SEGMENT DEFINITIONS */ struct nls { struct nl *nls_low; struct nl *nls_high; } ntab[MAXNL], *nlact; struct nl nl[INL]; struct nl *nlp = nl; struct nls *nlact = ntab; /* * all these strings must be places where people can find them * since lookup only looks at the string pointer, not the chars. * see, for example, pTreeInit. */ /* * built in constants */ char *in_consts[] = { "true" , "false" , "TRUE", "FALSE", "minint" , "maxint" , "minchar" , "maxchar" , "bell" , "tab" , 0 }; /* * built in simple types */ char *in_types[] = { "boolean", "char", "integer", "real", "_nil", /* dummy name */ 0 }; int in_rclasses[] = { TINT , TINT , TINT , TCHAR , TBOOL , TDOUBLE , 0 }; long in_ranges[] = { -128L , 128L , -32768L , 32767L , -2147483648L , 2147483647L , 0L , 127L , 0L , 1L , 0L , 0L /* fake for reals */ }; /* * built in constructed types */ char *in_ctypes[] = { "Boolean" , "intset" , "alfa" , "text" , 0 }; /* * built in variables */ char *in_vars[] = { "input" , "output" , 0 }; /* * built in functions */ char *in_funcs[] = { "abs" , "arctan" , "card" , "chr" , "clock" , "cos" , "eof" , "eoln" , "eos" , "exp" , "expo" , "ln" , "odd" , "ord" , "pred" , "round" , "sin" , "sqr" , "sqrt" , "succ" , "trunc" , "undefined" , /* * Extensions */ "argc" , "random" , "seed" , "wallclock" , "sysclock" , 0 }; /* * Built-in procedures */ char *in_procs[] = { "date" , "dispose" , "flush" , "get" , "getseg" , "halt" , "linelimit" , "message" , "new" , "pack" , "page" , "put" , "putseg" , "read" , "readln" , "remove" , "reset" , "rewrite" , "time" , "unpack" , "write" , "writeln" , /* * Extensions */ "argv" , "null" , "stlimit" , 0 }; #ifndef PI0 /* * and their opcodes */ int in_fops[] = { O_ABS2, O_ATAN, O_CARD|NSTAND, O_CHR2, O_CLCK|NSTAND, O_COS, O_EOF, O_EOLN, 0, O_EXP, O_EXPO|NSTAND, O_LN, O_ODD2, O_ORD2, O_PRED2, O_ROUND, O_SIN, O_SQR2, O_SQRT, O_SUCC2, O_TRUNC, O_UNDEF|NSTAND, /* * Extensions */ O_ARGC|NSTAND, O_RANDOM|NSTAND, O_SEED|NSTAND, O_WCLCK|NSTAND, O_SCLCK|NSTAND }; /* * Built-in procedures */ int in_pops[] = { O_DATE|NSTAND, O_DISPOSE|NSTAND, O_FLUSH|NSTAND, O_GET, 0, O_HALT|NSTAND, O_LLIMIT|NSTAND, O_MESSAGE|NSTAND, O_NEW, O_PACK, O_PAGE, O_PUT, 0, O_READ4, O_READLN, O_REMOVE|NSTAND, O_RESET, O_REWRITE, O_TIME|NSTAND, O_UNPACK, O_WRITEF, O_WRITLN, /* * Extensions */ O_ARGV|NSTAND, O_ABORT|NSTAND, O_STLIM|NSTAND }; #endif /* * Initnl initializes the first namelist segment and then * initializes the name list for block 0. */ initnl() { register char **cp; register struct nl *np; struct nl *fp; int *ip; long *lp; #ifdef DEBUG if ( hp21mx ) { MININT = -32768.; MAXINT = 32767.; #ifndef PI0 genmx(); #endif } #endif ntab[0].nls_low = nl; ntab[0].nls_high = &nl[INL]; defnl ( 0 , 0 , 0 , 0 ); /* * Types */ for ( cp = in_types ; *cp != 0 ; cp ++ ) hdefnl ( *cp , TYPE , nlp , 0 ); /* * Ranges */ lp = in_ranges; for ( ip = in_rc((lasses ; *ip != 0 ; ip ++ ) { np = defnl ( 0 , RANGE , nl+(*ip) , 0 ); nl[*ip].type = np; np -> range[0] = *lp ++ ; np -> range[1] = *lp ++ ; }; /* * built in constructed types */ cp = in_ctypes; /* * Boolean = boolean; */ hdefnl ( *cp++ , TYPE , nl+T1BOOL , 0 ); /* * intset = set of 0 .. 127; */ intset = *cp++; hdefnl( intset , TYPE , nlp+1 , 0 ); defnl ( 0 , SET , nlp+1 , 0 ); np = defnl ( 0 , RANGE , nl+TINT , 0 ); np -> range[0] = 0L; np -> range[1] = 127L; /* * alfa = array [ 1 .. 10 ] of char; */ np = defnl ( 0 , RANGE , nl+TINT , 0 ); np -> range[0] = 1L; np -> range[1] = 10L; defnl ( 0 , ARRAY , nl+T1CHAR , 1 ) -> chain = np; hdefnl ( *cp++ , TYPE , nlp-1 , 0 ); /* * text = file of char; */ hdefnl ( *cp++ , TYPE , nlp+1 , 0 ); np = defnl ( 0 , FILET , nl+T1CHAR , 0 ); np -> nl_flags |= NFILES; /* * input,output : text; */ cp = in_vars; # ifndef PI0 input = hdefnl ( *cp++ , VAR , np , INPUT_OFF ); output = hdefnl ( *cp++ , VAR , np , OUTPUT_OFF ); # else input = hdefnl ( *cp++ , VAR , np , 0 ); output = hdefnl ( *cp++ , VAR , np , 0 ); # endif # ifdef PC input -> extra_flags |= NGLOBAL; output -> extra_flags |= NGLOBAL; # endif PC /* * built in constants */ cp = in_consts; np = hdefnl ( *cp++ , CONST , nl + TBOOL , 1 ); fp = hdefnl ( *cp++ , CONST , nl + TBOOL , 0 ); (nl + TBOOL)->chain = fp; fp->chain = np; np = hdefnl ( *cp++ , CONST , nl + TBOOL , 1 ); fp = hdefnl ( *cp++ , CONST , nl + TBOOL , 0 ); fp->chain = np; if (opt('s')) (nl + TBOOL)->chain = fp; hdefnl ( *cp++ , CONST , nl + T4INT , 0 ) -> range[0] = MININT; hdefnl ( *cp++ , CONST , nl + T4INT , 0 ) -> range[0] = MAXINT; hdefnl ( *cp++ , CONST , nl + T1CHAR , 0 ); hdefnl ( *cp++ , CONST , nl + T1CHAR , 127 ); hdefnl ( *cp++ , CONST , nl + T1CHAR , '\007' ); hdefnl ( *cp++ , CONST , nl + T1CHAR , '\t' ); /* * Built-in functions and procedures */ #ifndef PI0 ip = in_fops; for ( cp = in_funcs ; *cp != 0 ; cp ++ ) hdefnl ( *cp , FUNC , 0 , * ip ++ ); ip = in_pops; for ( cp = in_procs ; *cp != 0 ; cp ++ ) hdefnl ( *cp , PROC , 0 , * ip ++ ); #else for ( cp = in_funcs ; *cp != 0 ; cp ++ ) hdefnl ( *cp , FUNC , 0 , 0 ); for ( cp = in_procs ; *cp != 0 , cp ++ ) hdefnl ( *cp , PROC , 0 , 0 ); #endif # ifdef PTREE pTreeInit(); # endif } struct nl * hdefnl(sym, cls, typ, val) { register struct nl *p; #ifndef PI1 if (sym) hash(sym, 0); #endif p = defnl(sym, cls, typ, val); if (sym) enter(p); return (p); } /* * Free up the name list segments * at the end of a statement/proc/func * All segments are freed down to the one in which * p points. */ nlfree(p) struct nl *p; { nlp = p; while (nlact->nls_low > nlp || nlact->nls_high < nlp) { free(nlact->nls_low); nlact->nls_low = NIL; nlact->nls_high = NIL; --nlact; if (nlact < &ntab[0]) panic("nlfree"); } } char *VARIABLE = "variable"; char *classes[ ] = { "undefined", "constant", "type", "variable", /* VARIABLE */ "array", "pointer or file", "record", "field", "procedure", "function", "variable", /* VARIABLE */ "variable", /* VARIABLE */ "pointer", "file", "set", "subrange", "label", "withptr", "scalar", "string", "program", "improper", "variant", "formal procedure", "formal function" }; char *snark = "SNARK"; #ifdef PI #ifdef DEBUG char *ctext[] = { "BADUSE", "CONST", "TYPE", "VAR", "ARRAY", "PTRFILE", "RECORD", "FIELD", "PROC", "FUNC", "FVAR", "REF", "PTR", "FILET", "SET", "RANGE", "LABEL", "WITHPTR", "SCAL", "STR", "PROG", "IMPROPER", "VARNT", "FPROC", "FFUNC" }; char *stars = "\t***"; /* * Dump the namelist from the * current nlp down to 'to'. * All the namelist is dumped if * to is NIL. */ dumpnl(to, rout) struct nl *to; { register struct nl *p; register int j; struct nls *nlsp; int i, v, head; if (opt('y') == 0) return; if (to != NIL) printf("\n\"%s\" Block=%d\n", rout, cbn); nlsp = nlact; head = NIL; for (p = nlp; p != to;) { if (p == nlsp->nls_low) { if (nlsp == &ntab[0]) break; nlsp--; p = nlsp->nls_high; } p--; if (head == NIL) { printf("\tName\tClass Bn+Flags\tType\tVal\tChn\n"); head++; } printf("%3d:", nloff(p)); if (p->symbol) printf("\t%.7s", p->symbol); else printf(stars); if (p->class) printf("\t%s", ctext[p->class]); else printf(stars); if (p->nl_flags) { pchr('\t'); if (p->nl_flags & 037) printf("%d ", p->nl_flags & 037); #ifndef PI0 if (p->nl_flags & NMOD) pchr('M'); if (p->nl_flags & NUSED) pchr('U'); #endif if (p->nl_flags & NFILES) pchr('F'); } else printf(stars); if (p->type) printf("\t[%d]", nloff(p->type)); else printf(stars); v = p->value[0]; switch (p->class) { case TYPE: break; case VARNT: goto con; case CONST: switch (nloff(p->type)) { default: printf("\t%d", v); break; case TDOUBLE: printf("\t%f", p->real); break; case TINT: case T4INT: con: printf("\t%ld", p->range[0]); break; case TSTR: printf("\t'%s'", p->ptr[0]); break; } break; case VAR: case REF: case WITHPTR: case FFUNC: case FPROC: printf("\t%d,%d", cbn, v); break; case SCAL: case RANGE: printf("\t%ld..%ld", p->range[0], p->range[1]); break; case RECORD: printf("\t%d(%d)", v, p->value[NL_FLDSZ]); break; case FIELD: printf("\t%d", v); break; case STR: printf("\t|%d|", p->value[0]); break; case FVAR: case FUNC: case PROC: case PROG: if (cbn == 0) { printf("\t<%o>", p->value[0] & 0377); #ifndef PI0 if (p->value[0] & NSTAND) printf("\tNSTAND"); #endif break; } v = p->value[1]; default: casedef: if (v) printf("\t<%d>", v); else printf(stars); } if (p->chain) printf("\t[%d]", nloff(p->chain)); switch (p->class) { case RECORD: if (p->ptr[NL_VARNT]) printf("\tVARNT=[%d]", nloff(p->ptr[NL_VARNT])); if (p->ptr[NL_TAG]) printf(" TAG=[%d]", nloff(p->ptr[NL_TAG])); break; case VARNT: printf("\tVTOREC=[%d]", nloff(p->ptr[NL_VTOREC])); break; } # ifdef PC if ( p -> extra_flags != 0 ) { pchr( '\t' ); if ( p -> extra_flags & NEXTERN ) printf( "NEXTERN " ); if ( p -> extra_flags & NLOCAL ) printf( "NLOCAL " ); if ( p -> extra_flags & NPARAM ) printf( "NPARAM " ); if ( p -> extra_flags & NGLOBAL ) printf( "NGLOBAL " ); if ( p -> extra_flags & NREGVAR ) printf( "NREGVAR " ); } # endif PC # ifdef PTREE pchr( '\t' ); pPrintPointer( stdout , "%s" , p -> inTree ); # endif pchr('\n'); } if (head == 0) printf("\tNo entries\n"); } #endif /* * Define a new name list entry * with initial symbol, class, type * and value[0] as given. A new name * list segment is allocated to hold * the next name list slot if necessary. */ struct nl * defnl(sym, cls, typ, val) char *sym; int cls; struct nl *typ; int val; { register struct nl *p; register int *q, i; char *cp; p = nlp; /* * Zero out this entry */ q = p; i = (sizeof *p)/(sizeof (int)); do *q++ = 0; while (--i); /* * Insert the values */ p->symbol = sym; p->class = cls; p->type = typ; p->nl_block = cbn; p->value[0] = val; /* * Insure that the next namelist * entry actually exists. This is * really not needed here, it would * suffice to do it at entry if we * need the slot. It is done this * way because, historically, nlp * always pointed at the next namelist * slot. */ nlp++; if (nlp >= nlact->nls_high) { i = NLINC; cp = malloc(NLINC * sizeof *nlp); if (cp == 0) { i = NLINC / 2; cp = malloc((NLINC / 2) * sizeof *nlp); } if (cp == 0) { error("Ran out of memory (defnl)"); pexit(DIED); } nlact++; if (nlact >= &ntab[MAXNL]) { error("Ran out of name list tables"); pexit(DIED); } nlp = cp; nlact->nls_low = nlp; nlact->nls_high = nlact->nls_low + i; } return (p); } /* * Make a duplicate of the argument * namelist entry for, e.g., type * declarations of the form 'type a = b' * and array indicies. */ struct nl * nlcopy(p) struct nl *p; { register int *p1, *p2, i; p1 = p; p = p2 = defnl(0, 0, 0, 0); i = (sizeof *p)/(sizeof (int)); do *p2++ = *p1++; while (--i); p->chain = NIL; return (p); } /* * Compute a namelist offset */ nloff(p) struct nl *p; { return (p - nl); } /* * Enter a symbol into the block * symbol table. Symbols are hashed * 64 ways based on low 6 bits of the * character pointer into the string * table. */ struct nl * enter(np) struct nl *np; { register struct nl *rp, *hp; register struct nl *p; int i; rp = np; if (rp == NIL) return (NIL); #ifndef PI1 if (cbn > 0) if (rp->symbol == input->symbol || rp->symbol == output->symbol) error("Pre-defined files input and output must not be redefined"); #endif i = rp->symbol; i &= 077; hp = disptab[i]; if (rp->class != BADUSE && rp->class != FIELD) for (p = hp; p != NIL && (p->nl_block & 037) == cbn; p = p->nl_next) if (p->symbol == rp->symbol && p->class != BADUSE && p->class != FIELD) { #ifndef PI1 error("%s is already defined in this block", rp->symbol); #endif break; } rp->nl_next = hp; disptab[i] = rp; return (rp); } #endif symbol || rp->symbol == output->symbol) error("Pre-defined files input and output must not be redefined"); #endif i = rp->symbol; i &= 077; hp = disptab[i]; if (rp->class != BADUSE && rp->class != FIELD) for (p = hp; p != NIL && (p->nl_block & 037) == cbn; p = cmd/pi/objfmt.h 644 0 33 6030 2552606443 6645 ((/* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)objfmt.h 1.6 3/10/81"; */ #ifdef OBJ /* * the creation time, the size and the magic number of the obj file */ struct pxhdr { long maketime; long objsize; short magicnum; }; # define HEADER_BYTES 1024 /* the size of px_header */ # define PX_HEADER "/usr/lib/px_header" /* px_header's name */ # define PI_COMP "/usr/ucb/pi" /* the compiler's name */ # define PX_INTRP "/usr/ucb/px" /* the interpreter's name */ # define INDX 1 /* amt to shift display index */ #endif OBJ /* * the file of error messages created by mkstr */ #ifdef OBJ # define ERR_STRNGS "/usr/lib/pi2.0strings" # define ERR_PATHLEN 9 # define HOW_STRNGS "/usr/lib/how_pi\0" # define HOW_PATHLEN 9 #endif OBJ #ifdef PC # define ERR_STRNGS "/usr/lib/pc2.0strings" # define ERR_PATHLEN 9 # define HOW_STRNGS "/usr/lib/how_pc\0" # define HOW_PATHLEN 9 #endif PC /* * these are because of varying sizes of pointers */ #ifdef VAX # define PTR_AS O_AS4 # define PTR_RV O_RV4 # define PTR_IND O_IND4 # define PTR_CON O_CON4 # define PTR_DUP O_SDUP4 # define CON_INT O_CON24 # define INT_TYP (nl + T4INT) # define PTR_DCL unsigned long /* for pointer variables */ # define SHORTADDR 32768 /* maximum short address */ # define TOOMUCH 65536 /* maximum variable size */ # define MAXSET 65536 /* maximum set size */ /* * Offsets due to the structure of the runtime stack. * DPOFF1 is the amount of fixed storage in each block allocated * as local variables for the runtime system. * since locals are allocated negative offsets, * -DPOFF1 is the last used implicit local offset. * DPOFF2 is the size of the block mark. * since arguments are allocated positive offsets, * DPOFF2 is the end of the implicit arguments. * for obj, the first argument has the highest offset * from the stackpointer. and the block mark is an * implicit last parameter. * for pc, the first argument has the lowest offset * from the argumentpointer. and the block mark is an * implicit first parameter. */ # ifdef OBJ # define DPOFF1 0 # define DPOFF2 32 # define INPUT_OFF -8 /* offset of `input' */ # define OUTPUT_OFF -4 /* offset of `output' */ # endif OBJ # ifdef PC # define DPOFF1 ( sizeof rtlocs - sizeof rtlocs.unwind ) # define DPOFF2 ( sizeof (long) ) # define INPUT_OFF 0 # define OUTPUT_OFF 0 # endif PC # define MAGICNUM 0403 /* obj magic number */ #endif VAX #ifdef PDP11 # define PTR_AS O_AS2 # define PTR_RV O_RV2 # define PTR_IND O_IND2 # define PTR_CON O_CON2 # define PTR_DUP O_SDUP2 # define CON_INT O_CON2 # define INT_TYP (nl + T2INT) # define PTR_DCL char * # define TOOMUCH 50000 # define SHORTADDR 65536 # define MAXSET 65536 /* maximum set size */ # define DPOFF1 0 # define DPOFF2 18 /* sizeof(struct stack) */ # define INPUT_OFF -2 # define OUTPUT_OFF -4 # define MAGICNUM 0404 #endif PDP11 PC # define MAGICNUM 0403 /* obj magic number */ #endif VAX #ifdef PDP11 # define PTR_AS O_AS2 # define PTR_RV O_RV2 # define PTR_IND O_IND2 # define PTR_CON O_CON2 # define PTR_DUP O_SDUP2 # define CON_INT O_CON2 # define INT_TYP (nl + T2INT) # define PTR_DCL char * # define TOOMUCH 50000 # define SHORTADDR 65536 # define MAXSET 65536 /* maximum set size */ # define DPOFF1 0 # define DPOFF2 18 /* sizeof(struct stack) */ # define INPUT_OFF -2 # define OUTPUT_OFF -4 # define MAGcmd/pi/opc.c 644 0 33 417 2552606443 6123 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)opc.c 1.1 8/27/80"; #include "OPnames.h" main() { register int i; for (i = 0; i < 256; i++) if (otext[i]) printf("#define O_%s %04o\n", otext[i]+1, i); exit(0); } # define PTR_DCL char * # define TOOMUCH 50000 # define SHORTADDR 65536 # define MAXSET 65536 /* maximum set size */ # define DPOFF1 0 # define DPO/,5(< /,"cmd/pi/opcode.h 644 0 33 11306 2552606443 6657 #define O_NODUMP 0001 #define O_BEG 0002 #define O_END 0003 #define O_CALL 0004 #define O_FCALL 0005 #define O_FRTN 0006 #define O_FSAV 0007 #define O_SDUP2 0010 #define O_SDUP4 0011 #define O_TRA 0012 #define O_TRA4 0013 #define O_GOTO 0014 #define O_LINO 0015 #define O_PUSH 0016 #define O_IF 0020 #define O_REL2 0021 #define O_REL4 0022 #define O_REL24 0023 #define O_REL42 0024 #define O_REL8 0025 #define O_RELG 0026 #define O_RELT 0027 #define O_REL28 0030 #define O_REL48 0031 #define O_REL82 0032 #define O_REL84 0033 #define O_AND 0034 #define O_OR 0035 #define O_NOT 0036 #define O_AS2 0040 #define O_AS4 0041 #define O_AS24 0042 #define O_AS42 0043 #define O_AS21 0044 #define O_AS41 0045 #define O_AS28 0046 #define O_AS48 0047 #define O_AS8 0050 #define O_AS 0051 #define O_INX2P2 0052 #define O_INX4P2 0053 #define O_INX2 0054 #define O_INX4 0055 #define O_OFF 0056 #define O_NIL 0057 #define O_ADD2 0060 #define O_ADD4 0061 #define O_ADD24 0062 #define O_ADD42 0063 #define O_ADD28 0064 #define O_ADD48 0065 #define O_ADD82 0066 #define O_ADD84 0067 #define O_SUB2 0070 #define O_SUB4 0071 #define O_SUB24 0072 #define O_SUB42 0073 #define O_SUB28 0074 #define O_SUB48 0075 #define O_SUB82 0076 #define O_SUB84 0077 #define O_MUL2 0100 #define O_MUL4 0101 #define O_MUL24 0102 #define O_MUL42 0103 #define O_MUL28 0104 #define O_MUL48 0105 #define O_MUL82 0106 #define O_MUL84 0107 #define O_ABS2 0110 #define O_ABS4 0111 #define O_ABS8 0112 #define O_NEG2 0114 #define O_NEG4 0115 #define O_NEG8 0116 #define O_DIV2 0120 #define O_DIV4 0121 #define O_DIV24 0122 #define O_DIV42 0123 #define O_MOD2 0124 #define O_MOD4 0125 #define O_MOD24 0126 #define O_MOD42 0127 #define O_ADD8 0130 #define O_SUB8 0131 #define O_MUL8 0132 #define O_DVD8 0133 #define O_STOI 0134 #define O_STOD 0135 #define O_ITOD 0136 #define O_ITOS 0137 #define O_DVD2 0140 #define O_DVD4 0141 #define O_DVD24 0142 #define O_DVD42 0143 #define O_DVD28 0144 #define O_DVD48 0145 #define O_DVD82 0146 #define O_DVD84 0147 #define O_RV1 0150 #define O_RV14 0151 #define O_RV2 0152 #define O_RV24 0153 #define O_RV4 0154 #define O_RV8 0155 #define O_RV 0156 #define O_LV 0157 #define O_LRV1 0160 #define O_LRV14 0161 #define O_LRV2 0162 #define O_LRV24 0163 #define O_LRV4 0164 #define O_LRV8 0165 #define O_LRV 0166 #define O_LLV 0167 #define O_IND1 0170 #define O_IND14 0171 #define O_IND2 0172 #define O_IND24 0173 #define O_IND4 0174 #define O_IND8 0175 #define O_IND 0176 #define O_CON1 0200 #define O_CON14 0201 #define O_CON2 0202 #define O_CON24 0203 #define O_CON4 0204 #define O_CON8 0205 #define O_CON 0206 #define O_LVCON 0207 #define O_RANG2 0210 #define O_RANG42 0211 #define O_RSNG2 0212 #define O_RSNG42 0213 #define O_RANG4 0214 #define O_RANG24 0215 #define O_RSNG4 0216 #define O_RSNG24 0217 #define O_STLIM 0220 #define O_LLIMIT 0221 #define O_BUFF 0222 #define O_HALT 0223 #define O_ORD2 0230 #define O_CONG 0231 #define O_CONC 0232 #define O_CONC4 0233 #define O_ABORT 0234 #define O_PXPBUF 0235 #define O_COUNT 0236 #define O_CASE1OP 0240 #define O_CASE2OP 0241 #define O_CASE4OP 0242 #define O_CASEBEG 0243 #define O_CASE1 0244 #define O_CASE2 0245 #define O_CASE4 0246 #define O_CASEEND 0247 #define O_ADDT 0250 #define O_SUBT 0251 #define O_MULT 0252 #define O_INCT 0253 #define O_CTTOT 0254 #define O_CARD 0255 #define O_IN 0256 #define O_ASRT 0257 #define O_FOR1U 0260 #define O_FOR2U 0261 #define O_FOR4U 0262 #define O_FOR1D 0263 #define O_FOR2D 0264 #define O_FOR4D 0265 #define O_READE 0270 #define O_READ4 0271 #define O_READC 0272 #define O_READ8 0273 #define O_READLN 0274 #define O_EOF 0275 #define O_EOLN 0276 #define O_WRITEC 0300 #define O_WRITES 0301 #define O_WRITEF 0302 #define O_WRITLN 0303 #define O_PAGE 0304 #define O_NAM 0305 #define O_MAX 0306 #define O_MIN 0307 #define O_UNIT 0310 #define O_UNITINP 0311 #define O_UNITOUT 0312 #define O_MESSAGE 0313 #define O_GET 0314 #define O_PUT 0315 #define O_FNIL 0316 #define O_DEFNAME 0320 #define O_RESET 0321 #define O_REWRITE 0322 #define O_FILE 0323 #define O_REMOVE 0324 #define O_FLUSH 0325 #define O_PACK 0330 #define O_UNPACK 0331 #define O_ARGC 0332 #define O_ARGV 0333 #define O_CLCK 0340 #define O_WCLCK 0341 #define O_SCLCK 0342 #define O_DISPOSE 0343 #define O_NEW 0344 #define O_DATE 0345 #define O_TIME 0346 #define O_UNDEF 0347 #define O_ATAN 0350 #define O_COS 0351 #define O_EXP 0352 #define O_LN 0353 #define O_SIN 0354 #define O_SQRT 0355 #define O_CHR2 0356 #define O_CHR4 0357 #define O_ODD2 0360 #define O_ODD4 0361 #define O_PRED2 0362 #define O_PRED4 0363 #define O_PRED24 0364 #define O_SUCC2 0365 #define O_SUCC4 0366 #define O_SUCC24 0367 #define O_SEED 0370 #define O_RANDOM 0371 #define O_EXPO 0372 #define O_SQR2 0373 #define O_SQR4 0374 #define O_SQR8 0375 #define O_ROUND 0376 #define O_TRUNC 0377 346 #define O_UNDEF 0347 #define O_ATAN 0350 #define O_COS 0351 #define O_EXP 0352 #define O_LN 0353 #define O_SIN 0354 #define O_SQRT 0355 #define O_CHR2 0356 #define O_CHR4 0357 #define O_ODD2 0360 #define O_ODD4 0361 #define O_PRED2 0362 #define O_PRED4 0363 #define O_PRED24 0364 #define O_SUCC2 0365 #define O((cmd/pi/p2put.c 644 0 33 40512 2552606444 6455 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)p2put.c 1.9 6/1/81"; /* * functions to help pi put out * polish postfix binary portable c compiler intermediate code * thereby becoming the portable pascal compiler */ #include "whoami.h" #ifdef PC #include "0.h" #include "pcops.h" #include "pc.h" /* * mash into f77's format * lovely, isn't it? */ #define TOF77( fop,val,rest ) ( ( ( (rest) & 0177777 ) << 16 ) \ | ( ( (val) & 0377 ) << 8 ) \ | ( (fop) & 0377 ) ) /* * emits an ftext operator and a string to the pcstream */ puttext( string ) char *string; { int length = str4len( string ); if ( !CGENNING ) return; p2word( TOF77( P2FTEXT , length , 0 ) ); # ifdef DEBUG if ( opt( 'k' ) ) { fprintf( stdout , "P2FTEXT | %3d | 0 " , length ); } # endif p2string( string ); } int str4len( string ) char *string; { return ( ( strlen( string ) + 3 ) / 4 ); } /* * put formatted text into a buffer for printing to the pcstream. * a call to putpflush actually puts out the text. * none of arg1 .. arg5 need be present. * and you can add more if you need them. */ /* VARARGS */ putprintf( format , incomplete , arg1 , arg2 , arg3 , arg4 , arg5 ) char *format; int incomplete; { static char ppbuffer[ BUFSIZ ]; static char *ppbufp = ppbuffer; if ( !CGENNING ) return; sprintf( ppbufp , format , arg1 , arg2 , arg3 , arg4 , arg5 ); ppbufp = &( ppbuffer[ strlen( ppbuffer ) ] ); if ( ppbufp >= &( ppbuffer[ BUFSIZ ] ) ) panic( "putprintf" ); if ( ! incomplete ) { puttext( ppbuffer ); ppbufp = ppbuffer; } } /* * emit a left bracket operator to pcstream * with function number, the maximum temp register, and total local bytes * until i figure out how to use them, regs 0 .. 11 are free. * one idea for one reg is to save the display pointer on block entry */ putlbracket( ftnno , localbytes ) int ftnno; int localbytes; { # define MAXTP2REG 11 p2word( TOF77( P2FLBRAC , MAXTP2REG , ftnno ) ); p2word( BITSPERBYTE * localbytes ); # ifdef DEBUG if ( opt( 'k' ) ) { fprintf( stdout , "P2FLBRAC | %3d | %d " , MAXTP2REG , ftnno ); fprintf( stdout , "%d\n" , BITSPERBYTE * localbytes ); } # endif } /* * emit a right bracket operator * which for the binary (fortran) interface * forces the stack allocate and register mask */ putrbracket( ftnno ) int ftnno; { p2word( TOF77( P2FRBRAC , 0 , ftnno ) ); # ifdef DEBUG if ( opt( 'k' ) ) { fprintf( stdout , "P2FRBRAC | 0 | %d\n" , ftnno ); } # endif } /* * emit an eof operator */ puteof() { p2word( P2FEOF ); # ifdef DEBUG if ( opt( 'k' ) ) { fprintf( stdout , "P2FEOF\n" ); } # endif } /* * emit a dot operator, * with a source file line number and name * if line is negative, there was an error on that line, but who cares? */ putdot( filename , line ) char *filename; int line; { int length = str4len( filename ); if ( line < 0 ) { line = -line; } p2word( TOF77( P2FEXPR , length , line ) ); # ifdef DEBUG if ( opt( 'k' ) ) { fprintf( stdout , "P2FEXPR | %3d | %d " , length , line ); } # endif p2string( filename ); } /* * put out a leaf node */ putleaf( op , lval , rval , type , name ) int op; int lval; int rval; int type; char *name; { if ( !CGENNING ) return; switch ( op ) { default: panic( "[putleaf]" ); case P2ICON: p2word( TOF77( P2ICON , name != NIL , type ) ); p2word( lval ); # ifdef DEBUG if ( opt( 'k' ) ) { fprintf( stdout , "P2ICON | %3d | 0x%x " , name != NIL , type ); fprintf( stdout , "%d\n" , lval ); } # endif if ( name ) p2name( name ); break; case P2NAME: p2word( TOF77( P2NAME , lval != 0 , type ) ); if ( lval ) p2word( lval ); # ifdef DEBUG if ( opt( 'k' ) ) { fprintf( stdout , "P2NAME | %3d | 0x%x " , lval != 0 , type ); if ( lval ) fprintf( stdout , "%d " , lval ); } # endif p2name( name ); break; case P2REG: p2word( TOF77( P2REG , rval , type ) ); # ifdef DEBUG if ( opt( 'k' ) ) { fprintf( stdout , "P2REG | %3d | 0x%x\n" , rval , type ); } # endif break; } } /* * rvalues are just lvalues with indirection, except * special cases for registers and for named globals, * whose names are their rvalues. */ putRV( name , level , offset , extra_flags , type ) char *name; int level; int offset; char extra_flags; int type; { char extname[ BUFSIZ ]; char *printname; int regnumber; if ( !CGENNING ) return; if ( extra_flags & NREGVAR ) { if ( ( offset < 0 ) || ( offset > P2FP ) ) { panic( "putRV regvar" ); } putleaf( P2REG , 0 , offset , type , 0 ); return; } if ( whereis( level , offset , extra_flags ) == GLOBALVAR ) { if ( name != 0 ) { if ( name[0] != '_' ) { sprintf( extname , EXTFORMAT , name ); printname = extname; } else { printname = name; } putleaf( P2NAME , offset , 0 , type , printname ); return; } else { panic( "putRV no name" ); } } putLV( name , level , offset , extra_flags , type ); putop( P2UNARY P2MUL , type ); } /* * put out an lvalue * given a level and offset * special case for * named globals, whose lvalues are just their names as constants. */ putLV( name , level , offset , extra_flags , type ) char *name; int level; int offset; char extra_flags; int type; { char extname[ BUFSIZ ]; char *printname; if ( !CGENNING ) return; if ( extra_flags & NREGVAR ) { panic( "putLV regvar" ); } switch ( whereis( level , offset , extra_flags ) ) { case GLOBALVAR: if ( ( name != 0 ) ) { if ( name[0] != '_' ) { sprintf( extname , EXTFORMAT , name ); printname = extname; } else { printname = name; } putleaf( P2ICON , offset , 0 , ADDTYPE( type , P2PTR ) , printname ); return; } else { panic( "putLV no name" ); } case PARAMVAR: if ( level == cbn ) { putleaf( P2REG , 0 , P2AP , ADDTYPE( type , P2PTR ) , 0 ); } else { putleaf( P2NAME , (level * sizeof(struct dispsave)) + AP_OFFSET , 0 , P2PTR | P2CHAR , DISPLAYNAME ); } putleaf( P2ICON , offset , 0 , P2INT , 0 ); putop( P2PLUS , P2PTR | P2CHAR ); break; case LOCALVAR: if ( level == cbn ) { putleaf( P2REG , 0 , P2FP , ADDTYPE( type , P2PTR ) , 0 ); } else { putleaf( P2NAME , (level * sizeof(struct dispsave)) + FP_OFFSET , 0 , P2PTR | P2CHAR , DISPLAYNAME ); } putleaf( P2ICON , -offset , 0 , P2INT , 0 ); putop( P2MINUS , P2PTR | P2CHAR ); break; } return; } /* * put out a floating point constant leaf node * the constant is declared in aligned data space * and a P2NAME leaf put out for it */ putCON8( value ) double value; { int label; char name[ BUFSIZ ]; if ( !CGENNING ) return; putprintf( " .data" , 0 ); putprintf( " .align 2" , 0 ); label = getlab(); putlab( label ); putprintf( " .double 0d%.20e" , 0 , value ); putprintf( " .text" , 0 ); sprintf( name , PREFIXFORMAT , LABELPREFIX , label ); putleaf( P2NAME , 0 , 0 , P2DOUBLE , name ); } /* * put out either an lvalue or an rvalue for a constant string. * an lvalue (for assignment rhs's) is the name as a constant, * an rvalue (for parameters) is just the name. */ putCONG( string , length , required ) char *string; int length; int required; { char name[ BUFSIZ ]; int label; char *cp; int pad; int others; if ( !CGENNING ) return; putprintf( " .data" , 0 ); label = getlab(); putlab( label ); cp = string; while ( *cp ) { putprintf( " .byte 0%o" , 1 , *cp ++ ); for ( others = 2 ; ( others <= 8 ) && *cp ; others ++ ) { putprintf( ",0%o" , 1 , *cp++ ); } putprintf( "" , 0 ); } pad = length - strlen( string ); while ( pad-- > 0 ) { putprintf( " .byte 0%o" , 1 , ' ' ); for ( others = 2 ; ( others <= 8 ) && ( pad-- > 0 ) ; others++ ) { putprintf( ",0%o" , 1 , ' ' ); } putprintf( "" , 0 ); } putprintf( " .byte 0" , 0 ); putprintf( " .text" , 0 ); sprintf( name , PREFIXFORMAT , LABELPREFIX , label ); if ( required == RREQ ) { putleaf( P2NAME , 0 , 0 , P2ARY | P2CHAR , name ); } else { putleaf( P2ICON , 0 , 0 , P2PTR | P2CHAR , name ); } } /* * map a pascal type to a c type * this would be tail recursive, but i unfolded it into a for (;;). * this is sort of like isa and lwidth * a note on the types used by the portable c compiler: * they are divided into a basic type (char, short, int, long, etc.) * and qualifications on those basic types (pointer, function, array). * the basic type is kept in the low 4 bits of the type descriptor, * and the qualifications are arranged in two bit chunks, with the * most significant on the right, * and the least significant on the left * e.g. int *foo(); * (a function returning a pointer to an integer) * is stored as * * so, we build types recursively * also, we know that /lib/f1 can only deal with 6 qualifications * so we stop the recursion there. this stops infinite type recursion * through mutually recursive pointer types.(( */ #define MAXQUALS 6 int p2type( np ) { return typerecur( np , 0 ); } typerecur( np , quals ) struct nl *np; int quals; { if ( np == NIL || quals > MAXQUALS ) { return P2UNDEF; } switch ( np -> class ) { case SCAL : case RANGE : if ( np -> type == ( nl + TDOUBLE ) ) { return P2DOUBLE; } switch ( bytes( np -> range[0] , np -> range[1] ) ) { case 1: return P2CHAR; case 2: return P2SHORT; case 4: return P2INT; default: panic( "p2type int" ); } case STR : return ( P2ARY | P2CHAR ); case RECORD : case SET : return P2STRTY; case FILET : return ( P2PTR | P2STRTY ); case CONST : case VAR : case FIELD : return p2type( np -> type ); case TYPE : switch ( nloff( np ) ) { case TNIL : return ( P2PTR | P2UNDEF ); case TSTR : return ( P2ARY | P2CHAR ); case TSET : return P2STRTY; default : return ( p2type( np -> type ) ); } case REF: case WITHPTR: case PTR : return ADDTYPE( typerecur( np -> type , quals + 1 ) , P2PTR ); case ARRAY : return ADDTYPE( typerecur( np -> type , quals + 1 ) , P2ARY ); case FUNC : /* * functions are really pointers to functions * which return their underlying type. */ return ADDTYPE( ADDTYPE( typerecur( np -> type , quals + 2 ) , P2FTN ) , P2PTR ); case PROC : /* * procedures are pointers to functions * which return integers (whether you look at them or not) */ return ADDTYPE( ADDTYPE( P2INT , P2FTN ) , P2PTR ); case FFUNC : case FPROC : /* * formal procedures and functions are pointers * to structures which describe their environment. */ return ( P2PTR | P2STRTY ); default : panic( "p2type" ); } } /* * add a most significant type modifier to a type */ long addtype( underlying , mtype ) long underlying; long mtype; { return ( ( ( underlying & ~P2BASETYPE ) << P2TYPESHIFT ) | mtype | ( underlying & P2BASETYPE ) ); } /* * put a typed operator to the pcstream */ putop( op , type ) int op; int type; { extern char *p2opnames[]; if ( !CGENNING ) return; p2word( TOF77( op , 0 , type ) ); # ifdef DEBUG if ( opt( 'k' ) ) { fprintf( stdout , "%s (%d) | 0 | 0x%x\n" , p2opnames[ op ] , op , type ); } # endif } /* * put out a structure operator (STASG, STARG, STCALL, UNARY STCALL ) * which looks just like a regular operator, only the size and * alignment go in the next consecutive words */ putstrop( op , type , size , alignment ) int op; int type; int size; int alignment; { extern char *p2opnames[]; if ( !CGENNING ) return; p2word( TOF77( op , 0 , type ) ); p2word( size ); p2word( alignment ); # ifdef DEBUG if ( opt( 'k' ) ) { fprintf( stdout , "%s (%d) | 0 | 0x%x %d %d\n" , p2opnames[ op ] , op , type , size , alignment ); } # endif } /* * the string names of p2ops */ char *p2opnames[] = { "", "P2UNDEFINED", /* 1 */ "P2NAME", /* 2 */ "P2STRING", /* 3 */ "P2ICON", /* 4 */ "P2FCON", /* 5 */ "P2PLUS", /* 6 */ "", "P2MINUS", /* 8 also unary == P2NEG */ "", "P2NEG", "P2MUL", /* 11 also unary == P2INDIRECT */ "", "P2INDIRECT", "P2AND", /* 14 also unary == P2ADDROF */ "", "P2ADDROF", "P2OR", /* 17 */ "", "P2ER", /* 19 */ "", "P2QUEST", /* 21 */ "P2COLON", /* 22 */ "P2ANDAND", /* 23 */ "P2OROR", /* 24 */ "", /* 25 */ "", /* 26 */ "", /* 27 */ "", /* 28 */ "", /* 29 */ "", /* 30 */ "", /* 31 */ "", /* 32 */ "", /* 33 */ "", /* 34 */ "", /* 35 */ "", /* 36 */ "", /* 37 */ "", /* 38 */ "", /* 39 */ "", /* 40 */ "", /* 41 */ "", /* 42 */ "", /* 43 */ "", /* 44 */ "", /* 45 */ "", /* 46 */ "", /* 47 */ "", /* 48 */ "", /* 49 */ "", /* 50 */ "", /* 51 */ "", /* 52 */ "", /* 53 */ "", /* 54 */ "", /* 55 */ "P2LISTOP", /* 56 */ "", "P2ASSIGN", /* 58 */ "P2COMOP", /* 59 */ "P2DIV", /* 60 */ "", "P2MOD", /* 62 */ "", "P2LS", /* 64 */ "", "P2RS", /* 66 */ "", "P2DOT", /* 68 */ "P2STREF", /* 69 */ "P2CALL", /* 70 also unary */ "", "P2UNARYCALL", "P2FORTCALL", /* 73 also unary */ "", "P2UNARYFORTCALL", "P2NOT", /* 76 */ "P2COMPL", /* 77 */ "P2INCR", /* 78 */ "P2DECR", /* 79 */ "P2EQ", /* 80 */ "P2NE", /* 81 */ "P2LE", /* 82 */ "P2LT", /* 83 */ "P2GE", /* 84 */ "P2GT", /* 85 */ "P2ULE", /* 86 */ "P2ULT", /* 87 */ "P2UGE", /* 88 */ "P2UGT", /* 89 */ "P2SETBIT", /* 90 */ "P2TESTBIT", /* 91 */ "P2RESETBIT", /* 92 */ "P2ARS", /* 93 */ "P2REG", /* 94 */ "P2OREG", /* 95 */ "P2CCODES", /* 96 */ "P2FREE", /* 97 */ "P2STASG", /* 98 */ "P2STARG", /* 99 */ "P2STCALL", /* 100 also unary */ "", "P2UNARYSTCALL", "P2FLD", /* 103 */ "P2SCONV", /* 104 */ "P2PCONV", /* 105 */ "P2PMCONV", /* 106 */ "P2PVCONV", /* 107 */ "P2FORCE", /* 108 */ "P2CBRANCH", /* 109 */ "P2INIT", /* 110 */ "P2CAST", /* 111 */ }; /* * low level routines */ /* * puts a long word on the pcstream */ p2word( word ) long word; { putw( word , pcstream ); } /* * put a length 0 mod 4 null padded string onto the pcstream */ p2string( string ) char *string; { int slen = strlen( string ); int wlen = ( slen + 3 ) / 4; int plen = ( wlen * 4 ) - slen; char *cp; int p; for ( cp = string ; *cp ; cp++ ) putc( *cp , pcstream ); for ( p = 1 ; p <= plen ; p++ ) putc( '\0' , pcstream ); # ifdef DEBUG if ( opt( 'k' ) ) { fprintf( stdout , "\"%s" , string ); for ( p = 1 ; p <= plen ; p++ ) fprintf( stdout , "\\0" ); fprintf( stdout , "\"\n" ); } # endif } /* * puts a name on the pcstream */ p2name( name ) char *name; { int pad; fprintf( pcstream , NAMEFORMAT , name ); pad = strlen( name ) % sizeof (long); for ( ; pad < sizeof (long) ; pad++ ) { putc( '\0' , pcstream ); } # ifdef DEBUG if ( opt( 'k' ) ) { fprintf( stdout , NAMEFORMAT , name ); pad = strlen( name ) % sizeof (long); for ( ; pad < sizeof (long) ; pad++ ) { fprintf( stdout , "\\0" ); } fprintf( stdout , "\n" ); } # endif } /* * put out a jump to a label */ putjbr( label ) long label; { printjbr( LABELPREFIX , label ); } /* * put out a jump to any kind of label */ printjbr( prefix , label ) char *prefix; long label; { putprintf( " jbr " , 1 ); putprintf( PREFIXFORMAT , 0 , prefix , label ); } /* * another version of put to catch calls to put */ put( arg1 , arg2 ) { putprintf( "# PUT CALLED!: arg1 = %d arg2 = 0%o" , 0 , arg1 , arg2 ); } #endif PC * put out a jump to a label */ putjbr( label ) long label; { printjbr( LABELPREFIX , label ); } /* * put out a jump to any kind of label */ prcmd/pi/pTree.h 644 0 33 225 2552606444 6424 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)pTree.h 1.1 8/27/80"; */ /* this is not pTree.h */ /* * another version of put to catch calls to put */ put( arg1 , arg2 ) { putprintf( "# PUT CALLED!: arg1 = %d arg2 = 0%o" , 0 , arg1 , arg2 ); } #endif PC * put out a jump to a label */ putjbr( label ) long label; { printjbr/,5X< /,"cmd/pi/pas.y 644 0 33 36640 2552606445 6224 /* Copyright (c) 1979 Regents of the University of California */ /* * Yacc grammar for UNIX Pascal * * This grammar is processed by the commands in the shell script * "gram" to yield parse tables and semantic routines in the file * "y.tab.c" and a header defining the lexical tokens in "yy.h". * * In order for the syntactic error recovery possible with this * grammar to work, the grammar must be processed by a yacc which * has been modified to fully enumerate possibilities in states * which involve the symbol "error". * The parser used for Pascal also uses a different encoding of * the test entries in the action table which speeds the parse. * A version of yacc which will work for Pascal is included on * the distribution table as "eyacc". * * The "gram" script also makes the following changes to the "y.tab.c" * file: * * 1) Causes yyval to be declared int *. * * 2) Loads the variable yypv into a register as yyYpv so that * the arguments $1, ... are available as yyYpv[1] etc. * This produces much smaller code in the semantic actions. * * 3) Deletes the unused array yysterm. * * 4) Moves the declarations up to the flag line containing * '##' to the file yy.h so that the routines which use * these "magic numbers" don't have to all be compiled at * the same time. * * 5) Creates the semantic restriction checking routine yyEactr * by processing action lines containing `@@'. * * This compiler uses a different version of the yacc parser, a * different yyerror which ((is called yerror, and requires more * lookahead sets than normally provided by yacc. * * Source for the yacc used with this grammar is included on * distribution tapes. */ /* * TERMINAL DECLARATIONS * * Some of the terminal declarations are out of the most natural * alphabetic order because the error recovery * will guess the first of equal cost non-terminals. * This makes, e.g. YTO preferable to YDOWNTO. */ %term YAND YARRAY YBEGIN YCASE YCONST YDIV YDO YDOTDOT YTO YELSE YEND YFILE YFOR YFORWARD YFUNCTION YGOTO YID YIF YIN YINT YLABEL YMOD YNOT YNUMB YOF YOR YPACKED YNIL YPROCEDURE YPROG YRECORD YREPEAT YSET YSTRING YTHEN YDOWNTO YTYPE YUNTIL YVAR YWHILE YWITH YBINT YOCT YHEX YASSERT YCASELAB YILLCH YEXTERN YLAST /* * PRECEDENCE DECLARATIONS * * Highest precedence is the unary logical NOT. * Next are the multiplying operators, signified by '*'. * Lower still are the binary adding operators, signified by '+'. * Finally, at lowest precedence and non-associative are the relationals. */ %binary '<' '=' '>' YIN %left '+' '-' YOR '|' %left UNARYSIGN %left '*' '/' YDIV YMOD YAND '&' %left YNOT %{ /* * GLOBALS FOR ACTIONS */ /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)pas.y 1.4 3/18/81"; */ /* * The following line marks the end of the yacc * Constant definitions which are removed from * y.tab.c and placed in the file y.tab.h. */ ## /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)pas.y 1.4 3/18/81"; #include "whoami.h" #include "0.h" #include "yy.h" #include "tree.h" #ifdef PI #define lineof(l) l #define line2of(l) l #endif %} %% /* * PRODUCTIONS */ goal: prog_hedr decls block '.' = funcend($1, $3, lineof($4)); | decls = segend(); ; prog_hedr: YPROG YID '(' id_list ')' ';' = $$ = funcbody(funchdr(tree5(T_PROG, lineof($1), $2, fixlist($4), NIL))); | YPROG error = { yyPerror("Malformed program statement", PPROG); /* * Should make a program statement * with "input" and "output" here. */ $$ = funcbody(funchdr(tree5(T_PROG, lineof($1), NIL, NIL, NIL))); } ; block: YBEGIN stat_list YEND = { $$ = tree3(T_BSTL, lineof($1), fixlist($2)); if ($3 < 0) brerror($1, "begin"); } ; /* * DECLARATION PART */ decls: decls decl = trfree(); | decls error = { Derror: constend(), typeend(), varend(), trfree(); yyPerror("Malformed declaration", PDECL); } | /* lambda */ = trfree(); ; decl: labels | const_decl = constend(); | type_decl = typeend(); | var_decl = varend(); | proc_decl ; /* * LABEL PART */ labels: YLABEL label_decl ';' = label(fixlist($2), lineof($1)); ; label_decl: YINT = $$ = newlist($1 == NIL ? NIL : *hash($1, 1)); | label_decl ',' YINT = $$ = addlist($1, $3 == NIL ? NIL : *hash($3, 1)); ; /* * CONST PART */ const_decl: YCONST YID '=' const ';' = constbeg($1, line2of($2)), const(lineof($3), $2, $4); | const_decl YID '=' const ';' = const(lineof($3), $2, $4); | YCONST error = { constbeg($1, line2of($1)); Cerror: yyPerror("Malformed const declaration", PDECL); } | const_decl error = goto Cerror; ; /* * TYPE PART */ type_decl: YTYPE YID '=' type ';' = typebeg($1, line2of($2)), type(lineof($3), $2, $4); | type_decl YID '=' type ';' = type(lineof($3), $2, $4); | YTYPE error = { typebeg($1, line2of($1)); Terror: yyPerror("Malformed type declaration", PDECL); } | type_decl error = goto Terror; ; /* * VAR PART */ var_decl: YVAR id_list ':' type ';' = varbeg($1, line2of($3)), var(lineof($3), fixlist($2), $4); | var_decl id_list ':' type ';' = var(lineof($3), fixlist($2), $4); | YVAR error = { varbeg($1, line2of($1)); Verror: yyPerror("Malformed var declaration", PDECL); } | var_decl error = goto Verror; ; /* * PROCEDURE AND FUNCTION DECLARATION PART */ proc_decl: phead YFORWARD ';' = funcfwd($1); | phead YEXTERN ';' = funcext($1); | pheadres decls block ';' = funcend($1, $3, lineof($4)); ; pheadres: phead = funcbody($1); ; phead: porf YID params ftype ';' = $$ = funchdr(tree5($1, lineof($5), $2, $3, $4)); ; porf: YPROCEDURE = $$ = T_PDEC; | YFUNCTION = $$ = T_FDEC; ; params: '(' param_list ')' = $$ = fixlist($2); | /* lambda */ = $$ = NIL; ; /* * PARAMETERS */ param: id_list ':' type = $$ = tree3(T_PVAL, fixlist($1), $3); | YVAR id_list ':' type = $$ = tree3(T_PVAR, fixlist($2), $4); | YFUNCTION id_list params ftype = $$ = tree5(T_PFUNC, fixlist($2), $4, $3, lineof($1)); | YPROCEDURE id_list params ftype = $$ = tree5(T_PPROC, fixlist($2), $4, $3, lineof($1)); ; ftype: ':' type = $$ = $2; | /* lambda */ = $$ = NIL; ; param_list: param = $$ = newlist($1); | param_list ';' param = $$ = addlist($1, $3); ; /* * CONSTANTS */ const: YSTRING = $$ = tree2(T_CSTRNG, $1); | number | '+' number = $$ = tree2(T_PLUSC, $2); | '-' number = $$ = tree2(T_MINUSC, $2); ; number: const_id = $$ = tree2(T_ID, $1); | YINT = $$ = tree2(T_CINT, $1); | YBINT = $$ = tree2(T_CBINT, $1); | YNUMB = $$ = tree2(T_CFINT, $1); ; const_list: const = $$ = newlist($1); | const_list ',' const = $$ = addlist($1, $3); ; /* * TYPES */ type: simple_type | '^' YID = $$ = tree3(T_TYPTR, lineof($1), tree2(T_ID, $2)); | struct_type | YPACKED struct_type = $$ = tree3(T_TYPACK, lineof($1), $2); ; simple_type: type_id | '(' id_list ')' = $$ = tree3(T_TYSCAL, lineof($1), fixlist($2)); | const YDOTDOT const = $$ = tree4(T_TYRANG, lineof($2), $1, $3); ; struct_type: YARRAY '[' simple_type_list ']' YOF type = $$ = tree4(T_TYARY, lineof($1), fixlist($3), $6); | YFILE YOF type = $$ = tree3(T_TYFILE, lineof($1), $3); | YSET YOF simple_type = $$ = tree3(T_TYSET, lineof($1), $3); | YRECORD field_list YEND = { $$ = setuptyrec( lineof( $1 ) , $2 ); if ($3 < 0) brerror($1, "record"); } ; simple_type_list: simple_type = $$ = newlist($1); | simple_type_list ',' simple_type = $$ = addlist($1, $3); ; /* * RECORD TYPE */ field_list: fixed_part variant_part = $$ = tree4(T_FLDLST, lineof(NIL), fixlist($1), $2); ; fixed_part: field = $$ = newlist($1); | fixed_part ';' field = $$ = addlist($1, $3); | fixed_part error = yyPerror("Malformed record declaration", PDECL); ; field: /* lambda */ = $$ = NIL; | id_list ':' type = $$ = tree4(T_RFIELD, lineof($2), fixlist($1), $3); ; variant_part: /* lambda */ = $$ = NIL; | YCASE type_id YOF variant_list = $$ = tree5(T_TYVARPT, lineof($1), NIL, $2, fixlist($4)); | YCASE YID ':' type_id YOF variant_list = $$ = tree5(T_TYVARPT, lineof($1), $2, $4, fixlist($6)); ; variant_list: variant = $$ = newlist($1); | variant_list ';' variant = $$ = addlist($1, $3); | variant_list error = yyPerror("Malformed record declaration", PDECL); ; variant: /* lambda */ = $$ = NIL; | const_list ':' '(' field_list ')' = $$ = tree4(T_TYVARNT, lineof($2), fixlist($1), $4); | const_list ':' '(' ')' = $$ = tree4(T_TYVARNT, lineof($2), fixlist($1), NIL); ; /* * STATEMENT LIST */ stat_list: stat = $$ = newlist($1); | stat_lsth stat = { if ((p = $1) != NIL && (q = p[1])[0] == T_IFX) { q[0] = T_IFEL; q[4] = $2; } else $$ = addlist($1, $2); } ; stat_lsth: stat_list ';' = if ((q = $1) != NIL && (p = q[1]) != NIL && p[0] == T_IF) { if (yychar < 0) yychar = yylex(); if (yyshifts >= 2 && yychar == YELSE) { recovered(); copy(&Y, &OY, sizeof Y); yerror("Deleted ';' before keyword else"); yychar = yylex(); p[0] = T_IFX; } } ; /* * CASE STATEMENT LIST */ cstat_list: cstat = $$ = newlist($1); | cstat_list ';' cstat = $$ = addlist($1, $3); | error = { $$ = NIL; Kerror: yyPerror("Malformed statement in case", PSTAT); } | cstat_list error = goto Kerror; ; cstat: const_list ':' stat = $$ = tree4(T_CSTAT, lineof($2), fixlist($1), $3); | YCASELAB stat = $$ = tree4(T_CSTAT, lineof($1), NIL, $2); | /* lambda */ = $$ = NIL; ; /* * STATEMENT */ stat: /* lambda */ = $$ = NIL; | YINT ':' stat = $$ = tree4(T_LABEL, lineof($2), $1 == NIL ? NIL : *hash($1, 1), $3); | proc_id = $$ = tree4(T_PCALL, lineof(yyline), $1, NIL); | proc_id '(' wexpr_list ')' = $$ = tree4(T_PCALL, lineof($2), $1, fixlist($3)); | YID error = goto NSerror; | assign | YBEGIN stat_list YEND = { $$ = tree3(T_BLOCK, lineof($1), fixlist($2)); if ($3 < 0) brerror($1, "begin"); } | YCASE expr YOF cstat_list YEND = { $$ = tree4(T_CASE, lineof($1), $2, fixlist($4)); if ($5 < 0) brerror($1, "case"); } | YWITH var_list YDO stat = $$ = tree4(T_WITH, lineof($1), fixlist($2), $4); | YWHILE expr YDO stat = $$ = tree4(T_WHILE, lineof($1), $2, $4); | YREPEAT stat_list YUNTIL expr = $$ = tree4(T_REPEAT, lineof($3), fixlist($2), $4); | YFOR assign YTO expr YDO stat = $$ = tree5(T_FORU, lineof($1), $2, $4, $6); | YFOR assign YDOWNTO expr YDO stat = $$ = tree5(T_FORD, lineof($1), $2, $4, $6); | YGOTO YINT = $$ = tree3(T_GOTO, lineof($1), *hash($2, 1)); | YIF expr YTHEN stat = $$ = tree5(T_IF, lineof($1), $2, $4, NIL); | YIF expr YTHEN stat YELSE stat = $$ = tree5(T_IFEL, lineof($1), $2, $4, $6); | YIF expr YTHEN stat YELSE = $$ = tree5(T_IFEL, lineof($1), $2, $4, NIL); | YASSERT '(' expr ')' = $$ = tree3(T_ASRT, lineof($1), $3); | error = { NSerror: $$ = NIL; Serror: yyPerror("Malformed statement", PSTAT); } ; assign: variable ':' '=' expr = $$ = tree4(T_ASGN, lineof($2), $1, $4); ; /* * EXPRESSION */ expr: error = { NEerror: $$ = NIL; Eerror: yyPerror("Missing/malformed expression", PEXPR); } | expr relop expr %prec '<' = $$ = tree4($2, $1[1] == SAWCON ? $3[1] : $1[1], $1, $3); | '+' expr %prec UNARYSIGN = $$ = tree3(T_PLUS, $2[1], $2); | '-' expr %prec UNARYSIGN = $$ = tree((3(T_MINUS, $2[1], $2); | expr addop expr %prec '+' = $$ = tree4($2, $1[1] == SAWCON ? $3[1] : $1[1], $1, $3); | expr divop expr %prec '*' = $$ = tree4($2, $1[1] == SAWCON ? $3[1] : $1[1], $1, $3); | YNIL = $$ = tree2(T_NIL, NOCON); | YSTRING = $$ = tree3(T_STRNG, SAWCON, $1); | YINT = $$ = tree3(T_INT, NOCON, $1); | YBINT = $$ = tree3(T_BINT, NOCON, $1); | YNUMB = $$ = tree3(T_FINT, NOCON, $1); | variable | YID error = goto NEerror; | func_id '(' wexpr_list ')' = $$ = tree4(T_FCALL, NOCON, $1, fixlist($3)); | '(' expr ')' = $$ = $2; | negop expr %prec YNOT = $$ = tree3(T_NOT, NOCON, $2); | '[' element_list ']' = $$ = tree3(T_CSET, SAWCON, fixlist($2)); | '[' ']' = $$ = tree3(T_CSET, SAWCON, NIL); ; element_list: element = $$ = newlist($1); | element_list ',' element = $$ = addlist($1, $3); ; element: expr | expr YDOTDOT expr = $$ = tree3(T_RANG, $1, $3); ; /* * QUALIFIED VARIABLES */ variable: YID = { @@ return (identis(var, VAR)); $$ = setupvar($1, NIL); } | qual_var = $1[3] = fixlist($1[3]); ; qual_var: array_id '[' expr_list ']' = $$ = setupvar($1, tree2(T_ARY, fixlist($3))); | qual_var '[' expr_list ']' = $1[3] = addlist($1[3], tree2(T_ARY, fixlist($3))); | record_id '.' field_id = $$ = setupvar($1, setupfield($3, NIL)); | qual_var '.' field_id = $1[3] = addlist($1[3], setupfield($3, NIL)); | ptr_id '^' = $$ = setupvar($1, tree1(T_PTR)); | qual_var '^' = $1[3] = addlist($1[3], tree1(T_PTR)); ; /* * Expression with write widths */ wexpr: expr | expr ':' expr = $$ = tree4(T_WEXP, $1, $3, NIL); | expr ':' expr ':' expr = $$ = tree4(T_WEXP, $1, $3, $5); | expr octhex = $$ = tree4(T_WEXP, $1, NIL, $2); | expr ':' expr octhex = $$ = tree4(T_WEXP, $1, $3, $4); ; octhex: YOCT = $$ = OCT; | YHEX = $$ = HEX; ; expr_list: expr = $$ = newlist($1); | expr_list ',' expr = $$ = addlist($1, $3); ; wexpr_list: wexpr = $$ = newlist($1); | wexpr_list ',' wexpr = $$ = addlist($1, $3); ; /* * OPERATORS */ relop: '=' = $$ = T_EQ; | '<' = $$ = T_LT; | '>' = $$ = T_GT; | '<' '>' = $$ = T_NE; | '<' '=' = $$ = T_LE; | '>' '=' = $$ = T_GE; | YIN = $$ = T_IN; ; addop: '+' = $$ = T_ADD; | '-' = $$ = T_SUB; | YOR = $$ = T_OR; | '|' = $$ = T_OR; ; divop: '*' = $$ = T_MULT; | '/' = $$ = T_DIVD; | YDIV = $$ = T_DIV; | YMOD = $$ = T_MOD; | YAND = $$ = T_AND; | '&' = $$ = T_AND; ; negop: YNOT | '~' ; /* * LISTS */ var_list: variable = $$ = newlist($1); | var_list ',' variable = $$ = addlist($1, $3); ; id_list: YID = $$ = newlist($1); | id_list ',' YID = $$ = addlist($1, $3); ; /* * Identifier productions with semantic restrictions * * For these productions, the characters @@ signify * that the associated C statement is to provide * the semantic restriction for this reduction. * These lines are made into a procedure yyEactr, similar to * yyactr, which determines whether the corresponding reduction * is permitted, or whether an error is to be signaled. * A zero return from yyEactr is considered an error. * YyEactr is called with an argument "var" giving the string * name of the variable in question, essentially $1, although * $1 will not work because yyEactr is called from loccor in * the recovery routines. */ const_id: YID = @@ return (identis(var, CONST)); ; type_id: YID = { @@ return (identis(var, TYPE)); $$ = tree3(T_TYID, lineof(yyline), $1); } ; var_id: YID = @@ return (identis(var, VAR)); ; array_id: YID = @@ return (identis(var, ARRAY)); ; ptr_id: YID = @@ return (identis(var, PTRFILE)); ; record_id: YID = @@ return (identis(var, RECORD)); ; field_id: YID = @@ return (identis(var, FIELD)); ; proc_id: YID = @@ return (identis(var, PROC)); ; func_id: YID = @@ return (identis(var, FUNC)); ; var, CONST)); ; type_id: YID = { @@ return (identis(var, TYPE)); $$ = tree3(T_TYID, lcmd/pi/pc.h 644 0 33 5372 2552606445 6000 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)pc.h 1.3 4/1/81"; */ /* * random constants for pc */ /* * the name of the display. */ #define DISPLAYNAME "__disply" /* * the structure below describes the locals used by the run time system. * at function entry, at least this much space is allocated, * and the following information is filled in: * the address of a routine to close the current frame for unwinding, * a pointer to the display entry for the current static level and * the previous contents of the display for this static level. * the curfile location is used to point to the currently active file, * and is filled in as io is initiated. * one of these structures is allocated on the (negatively growing) stack. * at function entry, fp is set to point to the last field of the struct, * thus the offsets of the fields are as indicated below. */ struct rtlocals { struct iorec *curfile; struct dispsave dsave; struct dispsave *dptr; int (*unwind)(); } rtlocs; #define CURFILEOFFSET ( ( -sizeof rtlocs ) + sizeof rtlocs.unwind ) #define DSAVEOFFSET ( CURFILEOFFSET + sizeof rtlocs.curfile ) #define DPTROFFSET ( DSAVEOFFSET + sizeof rtlocs.dsave ) #define UNWINDOFFSET ( DPTROFFSET + sizeof rtlocs.dptr ) #define UNWINDNAME "_UNWIND" /* * the register save mask for saving no registers */ #define RSAVEMASK ( 0 ) /* * runtime check mask for divide check and integer overflow */ #define RUNCHECK ( ( 1 << 15 ) | ( 1 << 14 ) ) /* * formats for various names * NAMEFORMAT arbitrary length strings. * EXTFORMAT for externals, a preceding underscore. * PREFIXFORMAT used to print made up names with prefixes. * LABELPREFIX with getlab() makes up label names. * LLABELPREFIX with getlab() makes up sdb labels. * FORMALPREFIX prefix for EXTFORMAT for formal entry points. * a typical use might be to print out a name with a preceeding underscore * with putprintf( EXTFORMAT , 0 , name ); */ #define NAMEFORMAT "%s" #define EXTFORMAT "_%s" #define PREFIXFORMAT "%s%d" #define LABELPREFIX "L" #define LLABELPREFIX "LL" #define FORMALPREFIX "__" /* * the name of the statement counter */ #define STMTCOUNT "__stcnt" /* * the name of the pcp counters */ #define PCPCOUNT "__pcpcount" /* * a vector of pointer to enclosing functions for fully qualified names. */ char *enclosing[ DSPLYSZ ]; /* * and of course ... */ #define BITSPERBYTE 8 /* * error number for case label not found (ECASE) * stolen from ~mckusick/px/lib/h01errs.h */ #define ECASE 5 L" #define FORMALPREFIX "__" /* * the name of the statement counter */ #define STMTCOUNT "__stcnt" /* * the name of the pcp counters */ #define PCPCOUNT "__pcpcount" /* * a vector of pointer to enclosing functions for fullcmd/pi/pccaseop.c 644 0 33 17740 2552606445 7210 /* Copyright (c) 1980 Regents of the University of California */ static char sccsid[] = "@(#)pccaseop.c 1.7 6/1/81"; #include "whoami.h" #ifdef PC /* * and the rest of the file */ #include "0.h" #include "tree.h" #include "objfmt.h" #include "pcops.h" #include "pc.h" /* * structure for a case: * its constant label, line number (for errors), and location label. */ struct ct { long cconst; int cline; int clabel; }; /* * the P2FORCE operator puts its operand into a register. * these to keep from thinking of it as r0 all over. */ #define FORCENAME "r0" /* * given a tree for a case statement, generate code for it. * this computes the expression into a register, * puts down the code for each of the cases, * and then decides how to do the case switching. * tcase [0] T_CASE * [1] lineof "case" * [2] expression * [3] list of cased statements: * cstat [0] T_CSTAT * [1] lineof ":" * [2] list of constant labels * [3] statement */ pccaseop( tcase ) int *tcase; { struct nl *exprtype; struct nl *exprnlp; struct nl *rangetype; long low; long high; long exprctype; long swlabel; long endlabel; long label; long count; long *cstatlp; long *cstatp; long *casep; struct ct *ctab; struct ct *ctp; long i; long nr; long goc; int casecmp(); bool dupcases; goc = gocnt; /* * find out the type of the case expression * even if the expression has errors (exprtype == NIL), continue. */ line = tcase[1]; codeoff(); exprtype = rvalue( (int *) tcase[2] , NIL , RREQ ); codeon(); if ( exprtype != NIL ) { if ( isnta( exprtype , "bcsi" ) ) { error("Case selectors cannot be %ss" , nameof( exprtype ) ); exprtype = NIL; } else { if ( exprtype -> class != RANGE ) { rangetype = exprtype -> type; } else { rangetype = exprtype; } if ( rangetype == NIL(( ) { exprtype = NIL; } else { low = rangetype -> range[0]; high = rangetype -> range[1]; } } } if ( exprtype != NIL ) { /* * compute and save the case expression. * also, put expression into a register * save its c-type and jump to the code to do the switch. */ exprctype = p2type( exprtype ); exprnlp = tmpalloc( sizeof (long) , nl + T4INT , NOREG ); putRV( 0 , cbn , exprnlp -> value[ NL_OFFS ] , exprnlp -> extra_flags , P2INT ); (void) rvalue( (int *) tcase[2] , NIL , RREQ ); putop( P2ASSIGN , P2INT ); putop( P2FORCE , P2INT ); putdot( filename , line ); swlabel = getlab(); putjbr( swlabel ); } /* * count the number of cases * and allocate table for cases, lines, and labels * default case goes in ctab[0]. */ count = 1; for ( cstatlp = tcase[3] ; cstatlp != NIL ; cstatlp = cstatlp[2] ) { cstatp = cstatlp[1]; if ( cstatp == NIL ) { continue; } for ( casep = cstatp[2] ; casep != NIL ; casep = casep[2] ) { count++; } } /* */ ctab = (struct ct *) malloc( count * sizeof( struct ct ) ); if ( ctab == (struct ct *) 0 ) { error("Ran out of memory (case)"); pexit( DIED ); } /* * pick up default label and label for after case statement. */ ctab[0].clabel = getlab(); endlabel = getlab(); /* * generate code for each case * filling in ctab for each. * nr is for error if no case falls out bottom. */ nr = 1; count = 0; for ( cstatlp = tcase[3] ; cstatlp != NIL ; cstatlp = cstatlp[2] ) { cstatp = cstatlp[1]; if ( cstatp == NIL ) { continue; } line = cstatp[1]; label = getlab(); for ( casep = cstatp[2] ; casep != NIL ; casep = casep[2] ) { gconst( casep[1] ); if( exprtype == NIL || con.ctype == NIL ) { continue; } if ( incompat( con.ctype , exprtype , NIL ) ) { cerror("Case label type clashed with case selector expression type"); continue; } if ( con.crval < low || con.crval > high ) { error("Case label out of range"); continue; } count++; ctab[ count ].cconst = con.crval; ctab[ count ].cline = line; ctab[ count ].clabel = label; } /* * put out the statement */ putlab( label ); putcnt(); level++; statement( cstatp[3] ); nr = (nr && noreach); noreach = 0; level--; if (gotos[cbn]) { ungoto(); } putjbr( endlabel ); } noreach = nr; /* * default action is to call error */ putlab( ctab[0].clabel ); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_ERROR" ); putleaf( P2ICON , ECASE , 0 , P2INT , 0 ); putRV( 0 , cbn , exprnlp -> value[ NL_OFFS ] , exprnlp -> extra_flags , P2INT ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); putdot( filename , line ); /* * sort the cases */ qsort( &ctab[1] , count , sizeof (struct ct) , casecmp ); /* * check for duplicates */ dupcases = FALSE; for ( ctp = &ctab[1] ; ctp < &ctab[ count ] ; ctp++ ) { if ( ctp[0].cconst == ctp[1].cconst ) { error("Multiply defined label in case, lines %d and %d" , ctp[0].cline , ctp[1].cline ); dupcases = TRUE; } } if ( dupcases ) { return; } /* * choose a switch algorithm and implement it: * direct switch >= 1/3 full and >= 4 cases. * binary switch not direct switch and > 8 cases. * ifthenelse not direct or binary switch. */ putlab( swlabel ); if ( ctab[ count ].cconst - ctab[1].cconst < 3 * count && count >= 4 ) { directsw( ctab , count ); } else if ( count > 8 ) { binarysw( ctab , count ); } else { itesw( ctab , count ); } putlab( endlabel ); if ( goc != gocnt ) { putcnt(); } } /* * direct switch */ directsw( ctab , count ) struct ct *ctab; int count; { int fromlabel = getlab(); long i; long j; putprintf( " casel %s,$%d,$%d" , 0 , FORCENAME , ctab[1].cconst , ctab[ count ].cconst - ctab[1].cconst ); putlab( fromlabel ); i = 1; j = ctab[1].cconst; while ( i <= count ) { if ( j == ctab[ i ].cconst ) { putprintf( " .word " , 1 ); putprintf( PREFIXFORMAT , 1 , LABELPREFIX , ctab[ i ].clabel ); putprintf( "-" , 1 ); putprintf( PREFIXFORMAT , 0 , LABELPREFIX , fromlabel ); i++; } else { putprintf( " .word " , 1 ); putprintf( PREFIXFORMAT , 1 , LABELPREFIX , ctab[ 0 ].clabel ); putprintf( "-" , 1 ); putprintf( PREFIXFORMAT , 0 , LABELPREFIX , fromlabel ); } j++; } putjbr( ctab[0].clabel ); } /* * binary switch * special case out default label and start recursion. */ binarysw( ctab , count ) struct ct *ctab; int count; { bsrecur( ctab[0].clabel , &ctab[0] , count ); } /* * recursive log( count ) search. */ bsrecur( deflabel , ctab , count ) int deflabel; struct ct *ctab; int count; { if ( count <= 0 ) { putprintf( " jbr L%d" , 0 , deflabel ); return; } else if ( count == 1 ) { putprintf( " cmpl %s,$%d" , 0 , FORCENAME , ctab[1].cconst ); putprintf( " jeql L%d" , 0 , ctab[1].clabel ); putprintf( " jbr L%d" , 0 , deflabel ); return; } else { int half = ( count + 1 ) / 2; int gtrlabel = getlab(); putprintf( " cmpl %s,$%d" , 0 , FORCENAME , ctab[ half ].cconst ); putprintf( " jgtr L%d" , 0 , gtrlabel ); putprintf( " jeql L%d" , 0 , ctab[ half ].clabel ); bsrecur( deflabel , &ctab[0] , half - 1 ); putprintf( "L%d:" , 0 , gtrlabel ); bsrecur( deflabel , &ctab[ half ] , count - half ); return; } } itesw( ctab , count ) struct ct *ctab; int count; { int i; for ( i = 1 ; i <= count ; i++ ) { putprintf( " cmpl %s,$%d" , 0 , FORCENAME , ctab[ i ].cconst ); putprintf( " jeql L%d" , 0 , ctab[ i ].clabel ); } putprintf( " jbr L%d" , 0 , ctab[0].clabel ); return; } int casecmp( this , that ) struct ct *this; struct ct *that; { if ( this -> cconst < that -> cconst ) { return -1; } else if ( this -> cconst > that -> cconst ) { return 1; } else { return 0; } } #endif PC ) struct ct *ctab; int cmd/pi/pcfunc.c 644 0 33 23173 2552606446 6667 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)pcfunc.c 1.6 6/1/81"; #include "whoami.h" #ifdef PC /* * and to the end of the file */ #include "0.h" #include "tree.h" #include "opcode.h" #include "pc.h" #include "pcops.h" /* * Funccod generates code for * built in function calls and calls * call to generate calls to user * defined functions and procedures. */ pcfunccod( r ) int *r; { struct nl *p; register struct nl *p1; register int *al; register op; int argc, *argv; int tr[2], tr2[4]; char *funcname; struct nl *tempnlp; long temptype; struct nl *rettype; /* * Verify that the given name * is defined and the name of * a function. */ p = lookup(r[2]); if (p == NIL) { rvlist(r[3]); return (NIL); } if (p->class != FUNC && p->class != FFUNC) { error("%s is not a function", p->symbol); rvlist(r[3]); return (NIL); } argv = r[3]; /* * Call handles user defined * procedures and functions */ if (bn != 0) return (call(p, argv, FUNC, bn)); /* * Count the arguments */ argc = 0; for (al = argv; al != NIL; al = al[2]) argc++; /* * Built-in functions have * their interpreter opcode * associated with them. */ op = p->value[0] &~ NSTAND; if (opt('s') && (p->value[0] & NSTAND)) { standard(); error("%s is a nonstandard function", p->symbol); } if ( op == O_ARGC ) { putleaf( P2NAME , 0 , 0 , P2INT , "__argc" ); return nl + T4INT; } switch (op) { /* * Parameterless functions */ case O_CLCK: funcname = "_CLCK"; goto noargs; case O_SCLCK: funcname = "_SCLCK"; goto noargs; noargs: if (argc != 0) { error("%s takes no arguments", p->symbol); rvlist(argv); return (NIL); } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , funcname ); putop( P2UNARY P2CALL , P2INT ); return (nl+T4INT); case O_WCLCK: if (argc != 0) { error("%s takes no arguments", p->symbol); rvlist(argv); return (NIL); } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_time" ); putleaf( P2ICON , 0 , 0 , P2INT , 0 ); putop( P2CALL , P2INT ); return (nl+T4INT); case O_EOF: case O_EOLN: if (argc == 0) { argv = tr; tr[1] = tr2; tr2[0] = T_VAR; tr2[2] = input->symbol; tr2[1] = tr2[3] = NIL; argc = 1; } else if (argc != 1) { error("%s takes either zero or one argument", p->symbol); rvlist(argv); return (NIL); } } /* * All other functions take * exactly one argument. */ if (argc != 1) { error("%s takes exactly one argument", p->symbol); rvlist(argv); return (NIL); } /* * find out the type of the argument */ codeoff(); p1 = stkrval((int *) argv[1], NLNIL , RREQ ); codeon(); if (p1 == NIL) return (NIL); /* * figure out the return type and the funtion name */ switch (op) { case O_EXP: funcname = "_exp"; goto mathfunc; case O_SIN: funcname = "_sin"; goto mathfunc; case O_COS: funcname = "_cos"; goto mathfunc; case O_ATAN: funcname = "_atan"; goto mathfunc; case O_LN: funcname = opt('t') ? "_LN" : "_log"; goto mathfunc; case O_SQRT: funcname = opt('t') ? "_SQRT" : "_sqrt"; goto mathfunc; case O_RANDOM: funcname = "_RANDOM"; goto mathfunc; mathfunc: if (isnta(p1, "id")) { error("%s's argument must be integer or real, not %s", p->symbol, nameof(p1)); return (NIL); } putleaf( P2ICON , 0 , 0 (( , ADDTYPE( P2FTN | P2DOUBLE , P2PTR ) , funcname ); p1 = stkrval( (int *) argv[1] , NLNIL , RREQ ); if ( isa( p1 , "i" ) ) { putop( P2SCONV , P2DOUBLE ); } putop( P2CALL , P2DOUBLE ); return nl + TDOUBLE; case O_EXPO: if (isnta( p1 , "id" ) ) { error("%s's argument must be integer or real, not %s", p->symbol, nameof(p1)); return NIL; } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_EXPO" ); p1 = stkrval( (int *) argv[1] , NLNIL , RREQ ); if ( isa( p1 , "i" ) ) { putop( P2SCONV , P2DOUBLE ); } putop( P2CALL , P2INT ); return ( nl + T4INT ); case O_UNDEF: if ( isnta( p1 , "id" ) ) { error("%s's argument must be integer or real, not %s", p->symbol, nameof(p1)); return NIL; } p1 = stkrval( (int *) argv[1] , NLNIL , RREQ ); putleaf( P2ICON , 0 , 0 , P2INT , 0 ); putop( P2COMOP , P2INT ); return ( nl + TBOOL ); case O_SEED: if (isnta(p1, "i")) { error("seed's argument must be an integer, not %s", nameof(p1)); return (NIL); } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_SEED" ); p1 = stkrval( (int *) argv[1] , NLNIL , RREQ ); putop( P2CALL , P2INT ); return nl + T4INT; case O_ROUND: case O_TRUNC: if ( isnta( p1 , "d" ) ) { error("%s's argument must be a real, not %s", p->symbol, nameof(p1)); return (NIL); } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , op == O_ROUND ? "_ROUND" : "_TRUNC" ); p1 = stkrval( (int *) argv[1] , NLNIL , RREQ ); putop( P2CALL , P2INT ); return nl + T4INT; case O_ABS2: if ( isa( p1 , "d" ) ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2DOUBLE , P2PTR ) , "_fabs" ); p1 = stkrval( (int *) argv[1] , NLNIL , RREQ ); putop( P2CALL , P2DOUBLE ); return nl + TDOUBLE; } if ( isa( p1 , "i" ) ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_abs" ); p1 = stkrval( (int *) argv[1] , NLNIL , RREQ ); putop( P2CALL , P2INT ); return nl + T4INT; } error("%s's argument must be an integer or real, not %s", p->symbol, nameof(p1)); return NIL; case O_SQR2: if ( isa( p1 , "d" ) ) { temptype = P2DOUBLE; rettype = nl + TDOUBLE; tempnlp = tmpalloc(sizeof(double), rettype, REGOK); } else if ( isa( p1 , "i" ) ) { temptype = P2INT; rettype = nl + T4INT; tempnlp = tmpalloc(sizeof(long), rettype, REGOK); } else { error("%s's argument must be an integer or real, not %s", p->symbol, nameof(p1)); return NIL; } putRV( 0 , cbn , tempnlp -> value[ NL_OFFS ] , tempnlp -> extra_flags , temptype , 0 ); p1 = rvalue( (int *) argv[1] , NLNIL , RREQ ); putop( P2ASSIGN , temptype ); putRV( 0 , cbn , tempnlp -> value[ NL_OFFS ] , tempnlp -> extra_flags , temptype , 0 ); putRV( 0 , cbn , tempnlp -> value[ NL_OFFS ] , tempnlp -> extra_flags , temptype , 0 ); putop( P2MUL , temptype ); putop( P2COMOP , temptype ); return rettype; case O_ORD2: p1 = stkrval( (int *) argv[1] , NLNIL , RREQ ); if (isa(p1, "bcis") || classify(p1) == TPTR) { return (nl+T4INT); } error("ord's argument must be of scalar type or a pointer, not %s", nameof(p1)); return (NIL); case O_SUCC2: case O_PRED2: if (isa(p1, "d")) { error("%s is forbidden for reals", p->symbol); return (NIL); } if ( isnta( p1 , "bcsi" ) ) { error("%s's argument must be of scalar type, not %s", p->symbol, nameof(p1)); return NIL; } if ( opt( 't' ) ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , op == O_SUCC2 ? "_SUCC" : "_PRED" ); p1 = stkrval( (int *) argv[1] , NLNIL , RREQ ); putleaf( P2ICON , p1 -> range[0] , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , p1 -> range[1] , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); } else { p1 = rvalue( argv[1] , NIL , RREQ ); putleaf( P2ICON , 1 , 0 , P2INT , 0 ); putop( op == O_SUCC2 ? P2PLUS : P2MINUS , P2INT ); } if ( isa( p1 , "bcs" ) ) { return p1; } else { return nl + T4INT; } case O_ODD2: if (isnta(p1, "i")) { error("odd's argument must be an integer, not %s", nameof(p1)); return (NIL); } p1 = rvalue( (int *) argv[1] , NLNIL , RREQ ); putleaf( P2ICON , 1 , 0 , P2INT , 0 ); putop( P2AND , P2INT ); return nl + TBOOL; case O_CHR2: if (isnta(p1, "i")) { error("chr's argument must be an integer, not %s", nameof(p1)); return (NIL); } if (opt('t')) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2CHAR , P2PTR ) , "_CHR" ); p1 = stkrval( (int *) argv[1] , NLNIL , RREQ ); putop( P2CALL , P2CHAR ); } else { p1 = stkrval( (int *) argv[1] , NLNIL , RREQ ); } return nl + TCHAR; case O_CARD: if (isnta(p1, "t")) { error("Argument to card must be a set, not %s", nameof(p1)); return (NIL); } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_CARD" ); p1 = stkrval( (int *) argv[1] , NLNIL , LREQ ); putleaf( P2ICON , lwidth( p1 ) , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); return nl + T2INT; case O_EOLN: if (!text(p1)) { error("Argument to eoln must be a text file, not %s", nameof(p1)); return (NIL); } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_TEOLN" ); p1 = stklval( (int *) argv[1] , NOFLAGS ); putop( P2CALL , P2INT ); return nl + TBOOL; case O_EOF: if (p1->class != FILET) { error("Argument to eof must be file, not %s", nameof(p1)); return (NIL); } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_TEOF" ); p1 = stklval( (int *) argv[1] , NOFLAGS ); putop( P2CALL , P2INT ); return nl + TBOOL; case 0: error("%s is an unimplemented 6000-3.4 extension", p->symbol); default: panic("func1"); } } #endif PC *) argv[1] , NOFLAGS ); putop( P2CALL , P2INT ); return nl + TBOOL; case O_EOF: if (p1->class != FILET) { error("Argument to eof must be file, not %s", nameof(p1)); return (NIL); } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_TEOF" ); p1 = stklval( (int *) argv[1] , NOFLAGS ); putop( P2CALL , P2INT ); return nl + TBOOL; cmd/pi/pclval.c 644 0 33 17366 2552606446 6701 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)pclval.c 1.4 6/1/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "opcode.h" #include "objfmt.h" #ifdef PC /* * and the rest of the file */ # include "pc.h" # include "pcops.h" extern int flagwas; /* * pclvalue computes the address * of a qualified name and * leaves it on the stack. * for pc, it can be asked for either an lvalue or an rvalue. * the semantics are the same, only the code is different. * for putting out calls to check for nil and fnil, * we have to traverse the list of qualifications twice: * once to put out the calls and once to put out the address to be checked. */ struct nl * pclvalue( r , modflag , required ) int *r; int modflag; int required; { register struct nl *p; register *c, *co; int f, o; int tr[2], trp[3]; struct nl *firstp; struct nl *lastp; char *firstsymbol; char firstextra_flags; int firstbn; if ( r == NIL ) { return NIL; } if ( nowexp( r ) ) { return NIL; } if ( r[0] != T_VAR ) { error("Variable required"); /* Pass mesgs down from pt of call ? */ return NIL; } firstp = p = lookup( r[2] ); if ( p == NIL ) { return NIL; } firstsymbol = p -> symbol; firstbn = bn; firstextra_flags = p -> extra_flags; c = r[3]; if ( ( modflag & NOUSE ) && ! lptr( c ) ) { p -> nl_flags = flagwas; } if ( modflag & MOD ) { p -> nl_flags |= NMOD; } /* * Only possibilities for p -> class here * are the named classes, i.e. CONST, TYPE * VAR, PROC, FUNC, REF, or a WITHPTR. */ if ( p -> class == WITHPTR ) { /* * Construct the tree implied by * the with statement */ trp[0] = T_LISTPP; trp[1] = tr; trp[2] = r[3]; tr[0] = T_FIELD; tr[1] = r[2]; c = trp; } /* * this not only puts out the names of functions to call * but also does all the semantic checking of the qualifications. */ if ( ! nilfnil( p , c , modflag , firstp , r[2] ) ) { return NIL; } switch (p -> class) { case WITHPTR: case REF: /* * Obtain the indirect word * of the WITHPTR or REF * as the base of our lvalue */ putRV( firstsymbol , firstbn , p -> value[ 0 ] , firstextra_flags , p2type( p ) ); firstsymbol = 0; f = 0; /* have an lv on stack */ o = 0; break; case VAR: f = 1; /* no lv on stack yet */ o = p -> value[0]; break; default: error("%s %s found where variable required", classes[p -> class], p -> symbol); return (NIL); } /* * Loop and handle each * qualification on the name */ if ( c == NIL && ( modflag & ASGN ) && ( p -> value[ NL_FORV ] & FORVAR ) ) { error("Can't modify the for variable %s in the range of the loop", p -> symbol); return (NIL); } for ( ; c != NIL ; c = c[2] ) { co = c[1]; if ( co == NIL ) { return NIL; } lastp = p; p = p -> type; if ( p == NIL ) { return NIL; } switch ( co[0] ) { case T_PTR: /* * Pointer qualification. */ if ( f ) { (( putLV( firstsymbol , firstbn , o , firstextra_flags , p2type( p ) ); firstsymbol = 0; } else { if (o) { putleaf( P2ICON , o , 0 , P2INT , 0 ); putop( P2PLUS , P2PTR | P2CHAR ); } } /* * Pointer cannot be * nil and file cannot * be at end-of-file. * the appropriate function name is * already out there from nilfnil. */ if ( p -> class == PTR ) { /* * this is the indirection from * the address of the pointer * to the pointer itself. * kirk sez: * fnil doesn't want this. * and does it itself for files * since only it knows where the * actual window is. * but i have to do this for * regular pointers. */ putop( P2UNARY P2MUL , p2type( p ) ); if ( opt( 't' ) ) { putop( P2CALL , P2INT ); } } else { putop( P2CALL , P2INT ); } f = o = 0; continue; case T_ARGL: case T_ARY: if ( f ) { putLV( firstsymbol , firstbn , o , firstextra_flags , p2type( p ) ); firstsymbol = 0; } else { if (o) { putleaf( P2ICON , o , 0 , P2INT , 0 ); putop( P2PLUS , P2INT ); } } arycod( p , co[1] ); f = o = 0; continue; case T_FIELD: /* * Field names are just * an offset with some * semantic checking. */ p = reclook(p, co[1]); o += p -> value[0]; continue; default: panic("lval2"); } } if (f) { if ( required == LREQ ) { putLV( firstsymbol , firstbn , o , firstextra_flags , p2type( p -> type ) ); } else { putRV( firstsymbol , firstbn , o , firstextra_flags , p2type( p -> type ) ); } } else { if (o) { putleaf( P2ICON , o , 0 , P2INT , 0 ); putop( P2PLUS , P2INT ); } if ( required == RREQ ) { putop( P2UNARY P2MUL , p2type( p -> type ) ); } } return ( p -> type ); } /* * this recursively follows done a list of qualifications * and puts out the beginnings of calls to fnil for files * or nil for pointers (if checking is on) on the way back. * this returns true or false. */ nilfnil( p , c , modflag , firstp , r2 ) struct nl *p; int *c; int modflag; struct nl *firstp; char *r2; /* no, not r2-d2 */ { int *co; struct nl *lastp; int t; if ( c == NIL ) { return TRUE; } co = (int *) ( c[1] ); if ( co == NIL ) { return FALSE; } lastp = p; p = p -> type; if ( p == NIL ) { return FALSE; } switch ( co[0] ) { case T_PTR: /* * Pointer qualification. */ lastp -> nl_flags |= NUSED; if ( p -> class != PTR && p -> class != FILET) { error("^ allowed only on files and pointers, not on %ss", nameof(p)); goto bad; } break; case T_ARGL: if ( p -> class != ARRAY ) { if ( lastp == firstp ) { error("%s is a %s, not a function", r2, classes[firstp -> class]); } else { error("Illegal function qualificiation"); } return FALSE; } recovered(); error("Pascal uses [] for subscripting, not ()"); /* and fall through */ case T_ARY: if ( p -> class != ARRAY ) { error("Subscripting allowed only on arrays, not on %ss", nameof(p)); goto bad; } codeoff(); t = arycod( p , co[1] ); codeon(); switch ( t ) { case 0: return FALSE; case -1: goto bad; } break; case T_FIELD: /* * Field names are just * an offset with some * semantic checking. */ if ( p -> class != RECORD ) { error(". allowed only on records, not on %ss", nameof(p)); goto bad; } if ( co[1] == NIL ) { return FALSE; } p = reclook( p , co[1] ); if ( p == NIL ) { error("%s is not a field in this record", co[1]); goto bad; } if ( modflag & MOD ) { p -> nl_flags |= NMOD; } if ( ( modflag & NOUSE ) == 0 || lptr( c[2] ) ) { p -> nl_flags |= NUSED; } break; default: panic("nilfnil"); } /* * recursive call, check the rest of the qualifications. */ if ( ! nilfnil( p , c[2] , modflag , firstp , r2 ) ) { return FALSE; } /* * the point of all this. */ if ( co[0] == T_PTR ) { if ( p -> class == PTR ) { if ( opt( 't' ) ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_NIL" ); } } else { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_FNIL" ); } } return TRUE; bad: cerror("Error occurred on qualification of %s", r2); return FALSE; } #endif PC ! nilfnil( p , c[2] , modflag , firstp , r2 ) ) { return FALSE; } /* * the point of all this. */ if ( co[0] == T_PTR ) { if ( p -> class == PTR ) { if ( opt( 't' ) ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , Pcmd/pi/pcops.h 644 0 33 5754 2552606446 6527 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)pcops.h 1.1 8/27/80"; */ /* * tree node operators */ #define P2UNDEFINED 1 #define P2NAME 2 #define P2STRING 3 #define P2ICON 4 #define P2FCON 5 #define P2PLUS 6 #define P2MINUS 8 /* also unary == P2NEG */ #define P2MUL 11 /* also unary == P2INDIRECT */ #define P2AND 14 /* also unary */ #define P2OR 17 #define P2ER 19 #define P2QUEST 21 #define P2COLON 22 #define P2ANDAND 23 #define P2OROR 24 /* * yacc operator classes, reserved words, little symbols, etc. * operators 25 .. 57 not used, except 56 */ #define P2LISTOP 56 #define P2ASSIGN 58 #define P2COMOP 59 #define P2DIV 60 #define P2MOD 62 #define P2LS 64 #define P2RS 66 #define P2DOT 68 #define P2STREF 69 #define P2CALL 70 /* also unary */ #define P2FORTCALL 73 /* also unary */ #define P2NOT 76 #define P2COMPL 77 #define P2INCR 78 #define P2DECR 79 #define P2EQ 80 #define P2NE 81 #define P2LE 82 #define P2LT 83 #define P2GE 84 #define P2GT 85 #define P2ULE 86 #define P2ULT 87 #define P2UGE 88 #define P2UGT 89 #define P2SETBIT 90 #define P2TESTBIT 91 #define P2RESETBIT 92 #define P2ARS 93 #define P2REG 94 #define P2OREG 95 #define P2CCODES 96 #define P2FREE 97 #define P2STASG 98 #define P2STARG 99 #define P2STCALL 100 /* also unary */ /* * some conversion operators */ #define P2FLD 103 #define P2SCONV 104 #define P2PCONV 105 #define P2PMCONV 106 #define P2PVCONV 107 /* * special node operators, used for special contexts */ #define P2FORCE 108 #define P2CBRANCH 109 #define P2INIT 110 #define P2CAST 111 /* * prefix unary operator modifier */ #define P2ASG 1+ #define P2UNARY 2+ /* * these borrowed from /usr/src/cmd/mip/fort.c * to use the binary interface. * only FTEXT, FEXPR, FLBRAC, FRBRAC, and FEOF are used */ #define P2FTEXT 200 #define P2FEXPR 201 #define P2FLBRAC 203 #define P2FRBRAC 204 #define P2FEOF 205 /* * type names */ #define P2UNDEF 0 #define P2FARG 1 #define P2CHAR 2 #define P2SHORT 3 #define P2INT 4 /* this is also used for booleans */ #define P2LONG 5 /* don't use these, the second pass chokes */ #define P2FLOAT 6 #define P2DOUBLE 7 #define P2STRTY 8 #define P2UNIONTY 9 #define P2ENUMTY 10 #define P2MOETY 11 #define P2UCHAR 12 #define P2USHORT 13 #define P2UNSIGNED 14 #define P2ULONG 15 /* * type modifiers */ #define P2PTR 020 #define P2FTN 040 #define P2ARY 060 /* * see the comment for p2type for an explanation of c type words */ #define P2BASETYPE 017 #define P2TYPESHIFT 2 /* * add a most significant type modifier, m, to a type, t */ #define ADDTYPE( t,m ) ( ( ( ( t ) & ~P2BASETYPE ) << P2TYPESHIFT ) \ | ( m ) \ | ( ( t ) & P2BASETYPE ) ) /* * the runtime framepointer and argumentpointer registers */ #define P2FP 13 #define P2FPNAME "fp" #define P2AP 12 #define P2APNAME "ap" 2FTN 040 #define P2cmd/pi/pcproc.c 644 0 33 107570 2552606447 6724 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)pcproc.c 1.6 6/1/81"; #include "whoami.h" #ifdef PC /* * and to the end of the file */ #include "0.h" #include "tree.h" #include "opcode.h" #include "pc.h" #include "pcops.h" /* * The following array is used to determine which classes may be read * from textfiles. It is indexed by the return value from classify. */ #define rdops(x) rdxxxx[(x)-(TFIRST)] int rdxxxx[] = { 0, /* -7 file types */ 0, /* -6 record types */ 0, /* -5 array types */ O_READE, /* -4 scalar types */ 0, /* -3 pointer types */ 0, /* -2 set types */ 0, /* -1 string types */ 0, /* 0 nil, no type */ O_READE, /* 1 boolean */ O_READC, /* 2 character */ O_READ4, /* 3 integer */ O_READ8 /* 4 real */ }; /* * Proc handles procedure calls. * Non-builtin procedures are "buck-passed" to func (with a flag * indicating that they are actually procedures. * builtin procedures are handled here. */ pcproc(r) int *((r; { register struct nl *p; register int *alv, *al, op; struct nl *filetype, *ap; int argc, *argv, typ, fmtspec, strfmt, stkcnt, *file; char fmt, format[20], *strptr; int prec, field, strnglen, fmtlen, fmtstart, pu; int *pua, *pui, *puz; int i, j, k; int itemwidth; char *readname; struct nl *tempnlp; long readtype; struct tmps soffset; #define CONPREC 4 #define VARPREC 8 #define CONWIDTH 1 #define VARWIDTH 2 #define SKIP 16 /* * Verify that the name is * defined and is that of a * procedure. */ p = lookup(r[2]); if (p == NIL) { rvlist(r[3]); return; } if (p->class != PROC && p->class != FPROC) { error("Can't call %s, its %s not a procedure", p->symbol, classes[p->class]); rvlist(r[3]); return; } argv = r[3]; /* * Call handles user defined * procedures and functions. */ if (bn != 0) { call(p, argv, PROC, bn); return; } /* * Call to built-in procedure. * Count the arguments. */ argc = 0; for (al = argv; al != NIL; al = al[2]) argc++; /* * Switch on the operator * associated with the built-in * procedure in the namelist */ op = p->value[0] &~ NSTAND; if (opt('s') && (p->value[0] & NSTAND)) { standard(); error("%s is a nonstandard procedure", p->symbol); } switch (op) { case O_ABORT: if (argc != 0) error("null takes no arguments"); return; case O_FLUSH: if (argc == 0) { putleaf( P2ICON , 0 , 0 , P2INT , "_PFLUSH" ); putop( P2UNARY P2CALL , P2INT ); putdot( filename , line ); return; } if (argc != 1) { error("flush takes at most one argument"); return; } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_FLUSH" ); ap = stklval(argv[1], NOFLAGS); if (ap == NIL) return; if (ap->class != FILET) { error("flush's argument must be a file, not %s", nameof(ap)); return; } putop( P2CALL , P2INT ); putdot( filename , line ); return; case O_MESSAGE: case O_WRITEF: case O_WRITLN: /* * Set up default file "output"'s type */ file = NIL; filetype = nl+T1CHAR; /* * Determine the file implied * for the write and generate * code to make it the active file. */ if (op == O_MESSAGE) { /* * For message, all that matters * is that the filetype is * a character file. * Thus "output" will suit us fine. */ putleaf( P2ICON , 0 , 0 , P2INT , "_PFLUSH" ); putop( P2UNARY P2CALL , P2INT ); putdot( filename , line ); putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putLV( "__err" , 0 , 0 , NGLOBAL , P2PTR|P2STRTY ); putop( P2ASSIGN , P2PTR|P2STRTY ); putdot( filename , line ); } else if (argv != NIL && (al = argv[1])[0] != T_WEXP) { /* * If there is a first argument which has * no write widths, then it is potentially * a file name. */ codeoff(); ap = stkrval(argv[1], NIL , RREQ ); codeon(); if (ap == NIL) argv = argv[2]; if (ap != NIL && ap->class == FILET) { /* * Got "write(f, ...", make * f the active file, and save * it and its type for use in * processing the rest of the * arguments to write. */ putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_UNIT" ); file = argv[1]; filetype = ap->type; stklval(argv[1], NOFLAGS); putop( P2CALL , P2INT ); putop( P2ASSIGN , P2PTR|P2STRTY ); putdot( filename , line ); /* * Skip over the first argument */ argv = argv[2]; argc--; } else { /* * Set up for writing on * standard output. */ putRV( 0, cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putLV( "_output" , 0 , 0 , NGLOBAL , P2PTR|P2STRTY ); putop( P2ASSIGN , P2PTR|P2STRTY ); putdot( filename , line ); } } else { putRV( 0, cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putLV( "_output" , 0 , 0 , NGLOBAL , P2PTR|P2STRTY ); putop( P2ASSIGN , P2PTR|P2STRTY ); putdot( filename , line ); } /* * Loop and process each * of the arguments. */ for (; argv != NIL; argv = argv[2]) { /* * fmtspec indicates the type (CONstant or VARiable) * and number (none, WIDTH, and/or PRECision) * of the fields in the printf format for this * output variable. * stkcnt is the number of longs pushed on the stack * fmt is the format output indicator (D, E, F, O, X, S) * fmtstart = 0 for leading blank; = 1 for no blank */ fmtspec = NIL; stkcnt = 0; fmt = 'D'; fmtstart = 1; al = argv[1]; if (al == NIL) continue; if (al[0] == T_WEXP) alv = al[1]; else alv = al; if (alv == NIL) continue; codeoff(); ap = stkrval(alv, NIL , RREQ ); codeon(); if (ap == NIL) continue; typ = classify(ap); if (al[0] == T_WEXP) { /* * Handle width expressions. * The basic game here is that width * expressions get evaluated. If they * are constant, the value is placed * directly in the format string. * Otherwise the value is pushed onto * the stack and an indirection is * put into the format string. */ if (al[3] == OCT) fmt = 'O'; else if (al[3] == HEX) fmt = 'X'; else if (al[3] != NIL) { /* * Evaluate second format spec */ if ( constval(al[3]) && isa( con.ctype , "i" ) ) { fmtspec += CONPREC; prec = con.crval; } else { fmtspec += VARPREC; } fmt = 'f'; switch ( typ ) { case TINT: if ( opt( 's' ) ) { standard(); error("Writing %ss with two write widths is non-standard", clnames[typ]); } /* and fall through */ case TDOUBLE: break; default: error("Cannot write %ss with two write widths", clnames[typ]); continue; } } /* * Evaluate first format spec */ if (al[2] != NIL) { if ( constval(al[2]) && isa( con.ctype , "i" ) ) { fmtspec += CONWIDTH; field = con.crval; } else { fmtspec += VARWIDTH; } } if ((fmtspec & CONPREC) && prec < 0 || (fmtspec & CONWIDTH) && field < 0) { error("Negative widths are not allowed"); continue; } if ( opt('s') && ((fmtspec & CONPREC) && prec == 0 || (fmtspec & CONWIDTH) && field == 0)) { standard(); error("Zero widths are non-standard"); } } if (filetype != nl+T1CHAR) { if (fmt == 'O' || fmt == 'X') { error("Oct/hex allowed only on text files"); continue; } if (fmtspec) { error("Write widths allowed only on text files"); continue; } /* * Generalized write, i.e. * to a non-textfile. */ putleaf( P2ICON , 0 , 0 , ADDTYPE( ADDTYPE( ADDTYPE( p2type( filetype ) , P2PTR ) , P2FTN ) , P2PTR ) , "_FNIL" ); stklval(file, NOFLAGS); putop( P2CALL , ADDTYPE( p2type( filetype ) , P2PTR ) ); putop( P2UNARY P2MUL , p2type( filetype ) ); /* * file^ := ... */ switch ( classify( filetype ) ) { case TBOOL: case TCHAR: case TINT: case TSCAL: precheck( filetype , "_RANG4" , "_RSGN4" ); /* and fall through */ case TDOUBLE: case TPTR: ap = rvalue( argv[1] , filetype , RREQ ); break; default: ap = rvalue( argv[1] , filetype , LREQ ); break; } if (ap == NIL) continue; if (incompat(ap, filetype, argv[1])) { cerror("Type mismatch in write to non-text file"); continue; } switch ( classify( filetype ) ) { case TBOOL: case TCHAR: case TINT: case TSCAL: postcheck( filetype ); /* and fall through */ case TDOUBLE: case TPTR: putop( P2ASSIGN , p2type( filetype ) ); putdot( filename , line ); break; default: putstrop( P2STASG , p2type( filetype ) , lwidth( filetype ) , align( filetype ) ); putdot( filename , line ); break; } /* * put(file) */ putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_PUT" ); putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putop( P2CALL , P2INT ); putdot( filename , line ); continue; } /* * Write to a textfile * * Evaluate the expression * to be written. */ if (fmt == 'O' || fmt == 'X') { if (opt('s')) { standard(); error("Oct and hex are non-standard"); } if (typ == TSTR || typ == TDOUBLE) { error("Can't write %ss with oct/hex", clnames[typ]); continue; } if (typ == TCHAR || typ == TBOOL) typ = TINT; } /* * If there is no format specified by the programmer, * implement the default. */ switch (typ) { case TINT: if (fmt == 'f') { typ = TDOUBLE; goto tdouble; } if (fmtspec == NIL) { if (fmt == 'D') field = 10; else if (fmt == 'X') field = 8; else if (fmt == 'O') field = 11; else panic("fmt1"); fmtspec = CONWIDTH; } break; case TCHAR: tchar: fmt = 'c'; break; case TSCAL: warning(); if (opt('s')) { standard(); } error("Writing scalars to text files is non-standard"); case TBOOL: fmt = 's'; break; case TDOUBLE: tdouble: switch (fmtspec) { case NIL: field = 21; prec = 14; fmt = 'e'; fmtspec = CONWIDTH + CONPREC; break; case CONWIDTH: if (--field < 1) field = 1; prec = field - 7; if (prec < 1) prec = 1; fmtspec += CONPREC; fmt = 'e'; break; case VARWIDTH: fmtspec += VARPREC; fmt = 'e'; break; case CONWIDTH + CONPREC: case CONWIDTH + VARPREC: if (--field < 1) field = 1; } format[0] = ' '; fmtstart = 0; break; case TSTR: constval( alv ); switch ( classify( con.ctype ) ) { case TCHAR: typ = TCHAR; goto tchar; case TSTR: strptr = con.cpval; for (s((trnglen = 0; *strptr++; strnglen++) /* void */; strptr = con.cpval; break; default: strnglen = width(ap); break; } fmt = 's'; strfmt = fmtspec; if (fmtspec == NIL) { fmtspec = SKIP; break; } if (fmtspec & CONWIDTH) { if (field <= strnglen) fmtspec = SKIP; else field -= strnglen; } break; default: error("Can't write %ss to a text file", clnames[typ]); continue; } /* * Generate the format string */ switch (fmtspec) { default: panic("fmt2"); case NIL: if (fmt == 'c') { if ( opt( 't' ) ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN|P2INT , P2PTR ) , "_WRITEC" ); putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); stkrval( alv , NIL , RREQ ); putop( P2LISTOP , P2INT ); } else { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN|P2INT , P2PTR ) , "_fputc" ); stkrval( alv , NIL , RREQ ); } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_ACTFILE" ); putRV( 0, cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putop( P2CALL , P2INT ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); putdot( filename , line ); } else { sprintf(&format[1], "%%%c", fmt); goto fmtgen; } case SKIP: break; case CONWIDTH: sprintf(&format[1], "%%%1D%c", field, fmt); goto fmtgen; case VARWIDTH: sprintf(&format[1], "%%*%c", fmt); goto fmtgen; case CONWIDTH + CONPREC: sprintf(&format[1], "%%%1D.%1D%c", field, prec, fmt); goto fmtgen; case CONWIDTH + VARPREC: sprintf(&format[1], "%%%1D.*%c", field, fmt); goto fmtgen; case VARWIDTH + CONPREC: sprintf(&format[1], "%%*.%1D%c", prec, fmt); goto fmtgen; case VARWIDTH + VARPREC: sprintf(&format[1], "%%*.*%c", fmt); fmtgen: if ( opt( 't' ) ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_WRITEF" ); putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_ACTFILE" ); putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putop( P2CALL , P2INT ); putop( P2LISTOP , P2INT ); } else { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_fprintf" ); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_ACTFILE" ); putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putop( P2CALL , P2INT ); } putCONG( &format[ fmtstart ] , strlen( &format[ fmtstart ] ) , LREQ ); putop( P2LISTOP , P2INT ); if ( fmtspec & VARWIDTH ) { /* * either * ,(temp=width,MAX(temp,...)), * or * , MAX( width , ... ) , */ if ( ( typ == TDOUBLE && al[3] == NIL ) || typ == TSTR ) { soffset = sizes[cbn].curtmps; tempnlp = tmpalloc(sizeof(long), nl+T4INT, REGOK); putRV( 0 , cbn , tempnlp -> value[ NL_OFFS ] , tempnlp -> extra_flags , P2INT ); ap = stkrval( al[2] , NIL , RREQ ); putop( P2ASSIGN , P2INT ); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_MAX" ); putRV( 0 , cbn , tempnlp -> value[ NL_OFFS ] , tempnlp -> extra_flags , P2INT ); } else { if (opt('t') || typ == TSTR || typ == TDOUBLE) { putleaf( P2ICON , 0 , 0 ,ADDTYPE( P2FTN | P2INT, P2PTR ) ,"_MAX" ); } ap = stkrval( al[2] , NIL , RREQ ); } if (ap == NIL) continue; if (isnta(ap,"i")) { error("First write width must be integer, not %s", nameof(ap)); continue; } switch ( typ ) { case TDOUBLE: putleaf( P2ICON , 1 , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , 1 , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); if ( al[3] == NIL ) { /* * finish up the comma op */ putop( P2COMOP , P2INT ); fmtspec &= ~VARPREC; putop( P2LISTOP , P2INT ); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_MAX" ); putRV( 0 , cbn , tempnlp -> value[ NL_OFFS ] , tempnlp -> extra_flags , P2INT ); tmpfree(&soffset); putleaf( P2ICON , 8 , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , 1 , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); } putop( P2LISTOP , P2INT ); break; case TSTR: putleaf( P2ICON , strnglen , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , 0 , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); putop( P2COMOP , P2INT ); putop( P2LISTOP , P2INT ); break; default: if (opt('t')) { putleaf( P2ICON , 0 , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , 0 , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); } putop( P2LISTOP , P2INT ); break; } } /* * If there is a variable precision, * evaluate it */ if (fmtspec & VARPREC) { if (opt('t')) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_MAX" ); } ap = stkrval( al[3] , NIL , RREQ ); if (ap == NIL) continue; if (isnta(ap,"i")) { error("Second write width must be integer, not %s", nameof(ap)); continue; } if (opt('t')) { putleaf( P2ICON , 0 , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , 0 , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); } putop( P2LISTOP , P2INT ); } /* * evaluate the thing we want printed. */ switch ( typ ) { case TCHAR: case TINT: stkrval( alv , NIL , RREQ ); putop( P2LISTOP , P2INT ); break; case TDOUBLE: ap = stkrval( alv , NIL , RREQ ); if ( isnta( ap , "d" ) ) { putop( P2SCONV , P2DOUBLE ); } putop( P2LISTOP , P2INT ); break; case TSCAL: case TBOOL: putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_NAM" ); ap = stkrval( alv , NIL , RREQ ); sprintf( format , PREFIXFORMAT , LABELPREFIX , listnames( ap ) ); putleaf( P2ICON , 0 , 0 , P2PTR | P2CHAR , format ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); putop( P2LISTOP , P2INT ); break; case TSTR: putCONG( "" , 0 , LREQ ); putop( P2LISTOP , P2INT ); break; } putop( P2CALL , P2INT ); putdot( filename , line ); } /* * Write the string after its blank padding */ if (typ == TSTR ) { if ( opt( 't' ) ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_WRITES" ); putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); ap = stkrval(alv, NIL , RREQ ); putop( P2LISTOP , P2INT ); } else { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_fwrite" ); ap = stkrval(alv, NIL , RREQ ); } if (strfmt & VARWIDTH) { /* * min, inline expanded as * temp < len ? temp : len */ putRV( 0 , cbn , tempnlp -> value[ NL_OFFS ] , tempnlp -> extra_flags , P2INT ); putleaf( P2ICON , strnglen , 0 , P2INT , 0 ); putop( P2LT , P2INT ); putRV( 0 , cbn , tempnlp -> value[ NL_OFFS ] , tempnlp -> extra_flags , P2INT ); putleaf( P2ICON , strnglen , 0 , P2INT , 0 ); putop( P2COLON , P2INT ); putop( P2QUEST , P2INT ); tmpfree(&soffset); } else { if ( ( fmtspec & SKIP ) && ( strfmt & CONWIDTH ) ) { strnglen = field; } putleaf( P2ICON , strnglen , 0 , P2INT , 0 ); } putop( P2LISTOP , P2INT ); putleaf( P2ICON , 1 , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_ACTFILE" ); putRV( 0, cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putop( P2CALL , P2INT ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); putdot( filename , line ); } } /* * Done with arguments. * Handle writeln and * insufficent number of args. */ switch (p->value[0] &~ NSTAND) { case O_WRITEF: if (argc == 0) error("Write requires an argument"); break; case O_MESSAGE: if (argc == 0) error("Message requires an argument"); case O_WRITLN: if (filetype != nl+T1CHAR) error("Can't 'writeln' a non text file"); if ( opt( 't' ) ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_WRITLN" ); putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); } else { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_fputc" ); putleaf( P2ICON , '\n' , 0 , P2CHAR , 0 ); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_ACTFILE" ); putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putop( P2CALL , P2INT ); putop( P2LISTOP , P2INT ); } putop( P2CALL , P2INT ); putdot( filename , line ); break; } return; case O_READ4: case O_READLN: /* * Set up default * file "input". */ file = NIL; filetype = nl+T1CHAR; /* * Determine the file implied * for the read and generate * code to make it the active file. */ if (argv != NIL) { codeoff(); ap = stkrval(argv[1], NIL , RREQ ); codeon(); if (ap == NIL) argv = argv[2]; if (ap != NIL && ap->class == FILET) { /* * Got "read(f, ...", make * f the active file, and save * it and its typ((e for use in * processing the rest of the * arguments to read. */ file = argv[1]; filetype = ap->type; putRV( 0, cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_UNIT" ); stklval(argv[1], NOFLAGS); putop( P2CALL , P2INT ); putop( P2ASSIGN , P2PTR|P2STRTY ); putdot( filename , line ); argv = argv[2]; argc--; } else { /* * Default is read from * standard input. */ putRV( 0, cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putLV( "_input" , 0 , 0 , NGLOBAL , P2PTR|P2STRTY ); putop( P2ASSIGN , P2PTR|P2STRTY ); putdot( filename , line ); input->nl_flags |= NUSED; } } else { putRV( 0, cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putLV( "_input" , 0 , 0 , NGLOBAL , P2PTR|P2STRTY ); putop( P2ASSIGN , P2PTR|P2STRTY ); putdot( filename , line ); input->nl_flags |= NUSED; } /* * Loop and process each * of the arguments. */ for (; argv != NIL; argv = argv[2]) { /* * Get the address of the target * on the stack. */ al = argv[1]; if (al == NIL) continue; if (al[0] != T_VAR) { error("Arguments to %s must be variables, not expressions", p->symbol); continue; } codeoff(); ap = stklval(al, MOD|ASGN|NOUSE); codeon(); if (ap == NIL) continue; if (filetype != nl+T1CHAR) { /* * Generalized read, i.e. * from a non-textfile. */ if (incompat(filetype, ap, argv[1] )) { error("Type mismatch in read from non-text file"); continue; } /* * var := file ^; */ ap = lvalue( al , MOD | ASGN | NOUSE , RREQ ); if ( isa( ap , "bsci" ) ) { precheck( ap , "_RANG4" , "_RSNG4" ); } putleaf( P2ICON , 0 , 0 , ADDTYPE( ADDTYPE( ADDTYPE( p2type( filetype ) , P2PTR ) , P2FTN ) , P2PTR ) , "_FNIL" ); if (file != NIL) stklval(file, NOFLAGS); else /* Magic */ putRV( "_input" , 0 , 0 , NGLOBAL , P2PTR | P2STRTY ); putop( P2CALL , P2INT ); switch ( classify( filetype ) ) { case TBOOL: case TCHAR: case TINT: case TSCAL: case TDOUBLE: case TPTR: putop( P2UNARY P2MUL , p2type( filetype ) ); } switch ( classify( filetype ) ) { case TBOOL: case TCHAR: case TINT: case TSCAL: postcheck( ap ); /* and fall through */ case TDOUBLE: case TPTR: putop( P2ASSIGN , p2type( ap ) ); putdot( filename , line ); break; default: putstrop( P2STASG , p2type( ap ) , lwidth( ap ) , align( ap ) ); putdot( filename , line ); break; } /* * get(file); */ putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_GET" ); putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putop( P2CALL , P2INT ); putdot( filename , line ); continue; } /* * if you get to here, you are reading from * a text file. only possiblities are: * character, integer, real, or scalar. * read( f , foo , ... ) is done as * foo := read( f ) with rangechecking * if appropriate. */ typ = classify(ap); op = rdops(typ); if (op == NIL) { error("Can't read %ss from a text file", clnames[typ]); continue; } /* * left hand side of foo := read( f ) */ ap = lvalue( al , MOD|ASGN|NOUSE , RREQ ); if ( isa( ap , "bsci" ) ) { precheck( ap , "_RANG4" , "_RSNG4" ); } switch ( op ) { case O_READC: readname = "_READC"; readtype = P2INT; break; case O_READ4: readname = "_READ4"; readtype = P2INT; break; case O_READ8: readname = "_READ8"; readtype = P2DOUBLE; break; case O_READE: readname = "_READE"; readtype = P2INT; break; } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | readtype , P2PTR ) , readname ); putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); if ( op == O_READE ) { sprintf( format , PREFIXFORMAT , LABELPREFIX , listnames( ap ) ); putleaf( P2ICON , 0 , 0 , P2PTR | P2CHAR , format ); putop( P2LISTOP , P2INT ); warning(); if (opt('s')) { standard(); } error("Reading scalars from text files is non-standard"); } putop( P2CALL , readtype ); if ( isa( ap , "bcsi" ) ) { postcheck( ap ); } putop( P2ASSIGN , p2type( ap ) ); putdot( filename , line ); } /* * Done with arguments. * Handle readln and * insufficient number of args. */ if (p->value[0] == O_READLN) { if (filetype != nl+T1CHAR) error("Can't 'readln' a non text file"); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_READLN" ); putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putop( P2CALL , P2INT ); putdot( filename , line ); } else if (argc == 0) error("read requires an argument"); return; case O_GET: case O_PUT: if (argc != 1) { error("%s expects one argument", p->symbol); return; } putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_UNIT" ); ap = stklval(argv[1], NOFLAGS); if (ap == NIL) return; if (ap->class != FILET) { error("Argument to %s must be a file, not %s", p->symbol, nameof(ap)); return; } putop( P2CALL , P2INT ); putop( P2ASSIGN , P2PTR|P2STRTY ); putdot( filename , line ); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , op == O_GET ? "_GET" : "_PUT" ); putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putop( P2CALL , P2INT ); putdot( filename , line ); return; case O_RESET: case O_REWRITE: if (argc == 0 || argc > 2) { error("%s expects one or two arguments", p->symbol); return; } if (opt('s') && argc == 2) { standard(); error("Two argument forms of reset and rewrite are non-standard"); } putleaf( P2ICON , 0 , 0 , P2INT , op == O_RESET ? "_RESET" : "_REWRITE" ); ap = stklval(argv[1], MOD|NOUSE); if (ap == NIL) return; if (ap->class != FILET) { error("First argument to %s must be a file, not %s", p->symbol, nameof(ap)); return; } if (argc == 2) { /* * Optional second argument * is a string name of a * UNIX (R) file to be associated. */ al = argv[2]; al = stkrval(al[1], NOFLAGS , RREQ ); if (al == NIL) return; if (classify(al) != TSTR) { error("Second argument to %s must be a string, not %s", p->symbol, nameof(al)); return; } strnglen = width(al); } else { putleaf( P2ICON , 0 , 0 , P2INT , 0 ); strnglen = 0; } putop( P2LISTOP , P2INT ); putleaf( P2ICON , strnglen , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , text(ap) ? 0: width(ap->type) , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); putdot( filename , line ); return; case O_NEW: case O_DISPOSE: if (argc == 0) { error("%s expects at least one argument", p->symbol); return; } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , op == O_DISPOSE ? "_DISPOSE" : opt('t') ? "_NEWZ" : "_NEW" ); ap = stklval(argv[1], op == O_NEW ? ( MOD | NOUSE ) : MOD ); if (ap == NIL) return; if (ap->class != PTR) { error("(First) argument to %s must be a pointer, not %s", p->symbol, nameof(ap)); return; } ap = ap->type; if (ap == NIL) return; argv = argv[2]; if (argv != NIL) { if (ap->class != RECORD) { error("Record required when specifying variant tags"); return; } for (; argv != NIL; argv = argv[2]) { if (ap->ptr[NL_VARNT] == NIL) { error("Too many tag fields"); return; } if (!isconst(argv[1])) { error("Second and successive arguments to %s must be constants", p->symbol); return; } gconst(argv[1]); if (con.ctype == NIL) return; if (incompat(con.ctype, (ap->ptr[NL_TAG])->type , NIL )) { cerror("Specified tag constant type clashed with variant case selector type"); return; } for (ap = ap->ptr[NL_VARNT]; ap != NIL; ap = ap->chain) if (ap->range[0] == con.crval) break; if (ap == NIL) { error("No variant case label value equals specified constant value"); return; } ap = ap->ptr[NL_VTOREC]; } } putleaf( P2ICON , width( ap ) , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); putdot( filename , line ); return; case O_DATE: case O_TIME: if (argc != 1) { error("%s expects one argument", p->symbol); return; } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , op == O_DATE ? "_DATE" : "_TIME" ); ap = stklval(argv[1], MOD|NOUSE); if (ap == NIL) return; if (classify(ap) != TSTR || width(ap) != 10) { error("Argument to %s must be a alfa, not %s", p->symbol, nameof(ap)); return; } putop( P2CALL , P2INT ); putdot( filename , line ); return; case O_HALT: if (argc != 0) { error("halt takes no arguments"); return; } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_HALT" ); putop( P2UNARY P2CALL , P2INT ); putdot( filename , line ); noreach = 1; return; case O_ARGV: if (argc != 2) { error("argv takes two arguments"); return; } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_ARGV" ); ap = stkrval(argv[1], NIL , RREQ ); if (ap == NIL) return; if (isnta(ap, "i")) { error("argv's first argument must be an integer, not %s", nameof(ap)); return; } al = argv[2]; ap = stklval(al[1], MOD|NOUSE); if (ap == NIL) return; if (classify(ap) != TSTR) { error("argv's second argument must be a string, not %s", nameof(ap)); return; } putop( P2LISTOP , P2INT ); putleaf( P2ICON , width( ap ) , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); putdot( filename , line ); return; case O_STLIM: if (argc != 1) { error("stlimit requ((ires one argument"); return; } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_STLIM" ); ap = stkrval(argv[1], NIL , RREQ ); if (ap == NIL) return; if (isnta(ap, "i")) { error("stlimit's argument must be an integer, not %s", nameof(ap)); return; } putop( P2CALL , P2INT ); putdot( filename , line ); return; case O_REMOVE: if (argc != 1) { error("remove expects one argument"); return; } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_REMOVE" ); ap = stkrval(argv[1], NOFLAGS , RREQ ); if (ap == NIL) return; if (classify(ap) != TSTR) { error("remove's argument must be a string, not %s", nameof(ap)); return; } putleaf( P2ICON , width( ap ) , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); putdot( filename , line ); return; case O_LLIMIT: if (argc != 2) { error("linelimit expects two arguments"); return; } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_LLIMIT" ); ap = stklval(argv[1], NOFLAGS|NOUSE); if (ap == NIL) return; if (!text(ap)) { error("linelimit's first argument must be a text file, not %s", nameof(ap)); return; } al = argv[2]; ap = stkrval(al[1], NIL , RREQ ); if (ap == NIL) return; if (isnta(ap, "i")) { error("linelimit's second argument must be an integer, not %s", nameof(ap)); return; } putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); putdot( filename , line ); return; case O_PAGE: if (argc != 1) { error("page expects one argument"); return; } putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_UNIT" ); ap = stklval(argv[1], NOFLAGS); if (ap == NIL) return; if (!text(ap)) { error("Argument to page must be a text file, not %s", nameof(ap)); return; } putop( P2CALL , P2INT ); putop( P2ASSIGN , P2PTR|P2STRTY ); putdot( filename , line ); if ( opt( 't' ) ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_PAGE" ); putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); } else { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_fputc" ); putleaf( P2ICON , '\f' , 0 , P2CHAR , 0 ); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_ACTFILE" ); putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putop( P2CALL , P2INT ); putop( P2LISTOP , P2INT ); } putop( P2CALL , P2INT ); putdot( filename , line ); return; case O_PACK: if (argc != 3) { error("pack expects three arguments"); return; } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_PACK" ); pu = "pack(a,i,z)"; pua = (al = argv)[1]; pui = (al = al[2])[1]; puz = (al = al[2])[1]; goto packunp; case O_UNPACK: if (argc != 3) { error("unpack expects three arguments"); return; } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_UNPACK" ); pu = "unpack(z,a,i)"; puz = (al = argv)[1]; pua = (al = al[2])[1]; pui = (al = al[2])[1]; packunp: ap = stkrval((int *) pui, NLNIL , RREQ ); if (ap == NIL) return; ap = stklval(pua, op == O_PACK ? NOFLAGS : MOD|NOUSE); if (ap == NIL) return; if (ap->class != ARRAY) { error("%s requires a to be an unpacked array, not %s", pu, nameof(ap)); return; } putop( P2LISTOP , P2INT ); al = (struct nl *) stklval(puz, op == O_UNPACK ? NOFLAGS : MOD|NOUSE); if (al->class != ARRAY) { error("%s requires z to be a packed array, not %s", pu, nameof(ap)); return; } if (al->type == NIL || ap->type == NIL) return; if (al->type != ap->type) { error("%s requires a and z to be arrays of the same type", pu, nameof(ap)); return; } putop( P2LISTOP , P2INT ); k = width(al); itemwidth = width(ap->type); ap = ap->chain; al = al->chain; if (ap->chain != NIL || al->chain != NIL) { error("%s requires a and z to be single dimension arrays", pu); return; } if (ap == NIL || al == NIL) return; /* * al is the range for z i.e. u..v * ap is the range for a i.e. m..n * i will be n-m+1 * j will be v-u+1 */ i = ap->range[1] - ap->range[0] + 1; j = al->range[1] - al->range[0] + 1; if (i < j) { error("%s cannot have more elements in a (%d) than in z (%d)", pu, j, i); return; } /* * get n-m-(v-u) and m for the interpreter */ i -= j; j = ap->range[0]; putleaf( P2ICON , itemwidth , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , j , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , i , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , k , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); putdot( filename , line ); return; case 0: error("%s is an unimplemented 6400 extension", p->symbol); return; default: panic("proc case"); } } #endif PC i -= j; j = ap->range[0]; putleaf( P2ICON , itemwidth , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , j , 0 , cmd/pi/pcwhoami.h 644 0 33 1041 2552606450 7166 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)pcwhoami.h 1.2 3/6/81"; */ /* * am i generating an obj file (OBJ), * postfix binary input to the 2nd pass of the portable c compiler (PC), * or pTrees (PTREE)? */ #undef OBJ #define PC #undef PTREE /* * am i the vax or the pdp11 version */ #define VAX #undef PDP11 #define DEC11 /* * am i pi or pxp? */ #define PI #undef PXP /* * am i both passes, or am i only one of the two passes pi0 or pi1? */ #define PI01 #undef PI0 #undef PI1 the University of California */ /* static char sccsid[] = "@(#)pcwhoami.h 1.2 3/6/81"; */ /* * am i generating an obj file (OBJ), * postfix binary input to the 2nd pass of the portable c compiler (PC), * or pTrees (PTREE)? */ #undef OBJ #define PC #undef PTREE /* * am i the vax or the pdp11 version */ #define VAX #undef PDP11 #define DEC11 /* * am i pi or pxp? */ #define PI #undef PXP /* * am i both passes, or am i only one of the two passes pi0 or pi1? */ #decmd/pi/pic.c 644 0 33 762 2552606450 6116 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)pic.c 1.1 8/27/80"; #include "OPnames.h" main() { register int j, k; for(j = 0; j < 32; j++) { for (k = 0; k < 256; k += 32) if (otext[j+k]) printf("%03o%cO_%s\t", j+k, *otext[j+k], otext[j+k]+1); else printf("%03o\t\t", j+k); putchar('\n'); if ((j+1)%8 == 0) putchar('\n'); } printf("Starred opcodes are used internally in Pi and are never generated.\n"); exit(0); } ,"cmd/pi/piwhoami.h 644 0 33 1041 2552606450 7174 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)piwhoami.h 1.2 3/6/81"; */ /* * am i generating an obj file (OBJ), * postfix binary input to the 2nd pass of the portable c compiler (PC), * or pTrees (PTREE)? */ #define OBJ #undef PC #undef PTREE /* * am i the vax or the pdp11 version */ #define VAX #undef PDP11 #define DEC11 /* * am i pi or pxp? */ #define PI #undef PXP /* * am i both passes, or am i only one of the two passes pi0 or pi1? */ #define PI01 #undef PI0 #undef PI1 the University of California */ /* static char sccsid[] = "@(#)piwhoami.h 1.2 3/6/81"; */ /* * am i generating an obj file (OBJ), * postfix binary input to the 2nd pass of the portable c compiler (PC), * or pTrees (PTREE)? */ #define OBJ #undef PC #undef PTREE /* * am i the vax or the pdp11 version */ #define VAX #undef PDP11 #define DEC11 /* * am i pi or pxp? */ #define PI #undef PXP /* * am i both passes, or am i only one of the two passes pi0 or pi1? */ #decmd/pi/proc.c 644 0 33 57310 2552606451 6350 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)proc.c 1.9 6/4/81"; #include "whoami.h" #ifdef OBJ /* * and the rest of the file */ #include "0.h" #include "tree.h" #include "opcode.h" #include "objfmt.h" /* * The following array is used to determine which classes may be read * from textfiles. It is indexed by the return value from classify. */ #define rdops(x) rdxxxx[(x)-(TFIRST)] int rdxxxx[] = { 0, /* -7 file types */ 0, /* -6 record t((ypes */ 0, /* -5 array types */ O_READE, /* -4 scalar types */ 0, /* -3 pointer types */ 0, /* -2 set types */ 0, /* -1 string types */ 0, /* 0 nil, no type */ O_READE, /* 1 boolean */ O_READC, /* 2 character */ O_READ4, /* 3 integer */ O_READ8 /* 4 real */ }; /* * Proc handles procedure calls. * Non-builtin procedures are "buck-passed" to func (with a flag * indicating that they are actually procedures. * builtin procedures are handled here. */ proc(r) int *r; { register struct nl *p; register int *alv, *al, op; struct nl *filetype, *ap; int argc, *argv, typ, fmtspec, strfmt, stkcnt, *file; char fmt, format[20], *strptr; int prec, field, strnglen, fmtlen, fmtstart, pu; int *pua, *pui, *puz; int i, j, k; int itemwidth; struct tmps soffset; struct nl *tempnlp; #define CONPREC 4 #define VARPREC 8 #define CONWIDTH 1 #define VARWIDTH 2 #define SKIP 16 /* * Verify that the name is * defined and is that of a * procedure. */ p = lookup(r[2]); if (p == NIL) { rvlist(r[3]); return; } if (p->class != PROC && p->class != FPROC) { error("Can't call %s, its %s not a procedure", p->symbol, classes[p->class]); rvlist(r[3]); return; } argv = r[3]; /* * Call handles user defined * procedures and functions. */ if (bn != 0) { call(p, argv, PROC, bn); return; } /* * Call to built-in procedure. * Count the arguments. */ argc = 0; for (al = argv; al != NIL; al = al[2]) argc++; /* * Switch on the operator * associated with the built-in * procedure in the namelist */ op = p->value[0] &~ NSTAND; if (opt('s') && (p->value[0] & NSTAND)) { standard(); error("%s is a nonstandard procedure", p->symbol); } switch (op) { case O_ABORT: if (argc != 0) error("null takes no arguments"); return; case O_FLUSH: if (argc == 0) { put(1, O_MESSAGE); return; } if (argc != 1) { error("flush takes at most one argument"); return; } ap = stklval(argv[1], NIL , LREQ ); if (ap == NIL) return; if (ap->class != FILET) { error("flush's argument must be a file, not %s", nameof(ap)); return; } put(1, op); return; case O_MESSAGE: case O_WRITEF: case O_WRITLN: /* * Set up default file "output"'s type */ file = NIL; filetype = nl+T1CHAR; /* * Determine the file implied * for the write and generate * code to make it the active file. */ if (op == O_MESSAGE) { /* * For message, all that matters * is that the filetype is * a character file. * Thus "output" will suit us fine. */ put(1, O_MESSAGE); } else if (argv != NIL && (al = argv[1])[0] != T_WEXP) { /* * If there is a first argument which has * no write widths, then it is potentially * a file name. */ codeoff(); ap = stkrval(argv[1], NIL , RREQ ); codeon(); if (ap == NIL) argv = argv[2]; if (ap != NIL && ap->class == FILET) { /* * Got "write(f, ...", make * f the active file, and save * it and its type for use in * processing the rest of the * arguments to write. */ file = argv[1]; filetype = ap->type; stklval(argv[1], NIL , LREQ ); put(1, O_UNIT); /* * Skip over the first argument */ argv = argv[2]; argc--; } else /* * Set up for writing on * standard output. */ put(1, O_UNITOUT); } else put(1, O_UNITOUT); /* * Loop and process each * of the arguments. */ for (; argv != NIL; argv = argv[2]) { /* * fmtspec indicates the type (CONstant or VARiable) * and number (none, WIDTH, and/or PRECision) * of the fields in the printf format for this * output variable. * stkcnt is the number of bytes pushed on the stack * fmt is the format output indicator (D, E, F, O, X, S) * fmtstart = 0 for leading blank; = 1 for no blank */ fmtspec = NIL; stkcnt = 0; fmt = 'D'; fmtstart = 1; al = argv[1]; if (al == NIL) continue; if (al[0] == T_WEXP) alv = al[1]; else alv = al; if (alv == NIL) continue; codeoff(); ap = stkrval(alv, NIL , RREQ ); codeon(); if (ap == NIL) continue; typ = classify(ap); if (al[0] == T_WEXP) { /* * Handle width expressions. * The basic game here is that width * expressions get evaluated. If they * are constant, the value is placed * directly in the format string. * Otherwise the value is pushed onto * the stack and an indirection is * put into the format string. */ if (al[3] == OCT) fmt = 'O'; else if (al[3] == HEX) fmt = 'X'; else if (al[3] != NIL) { /* * Evaluate second format spec */ if ( constval(al[3]) && isa( con.ctype , "i" ) ) { fmtspec += CONPREC; prec = con.crval; } else { fmtspec += VARPREC; } fmt = 'f'; switch ( typ ) { case TINT: if ( opt( 's' ) ) { standard(); error("Writing %ss with two write widths is non-standard", clnames[typ]); } /* and fall through */ case TDOUBLE: break; default: error("Cannot write %ss with two write widths", clnames[typ]); continue; } } /* * Evaluate first format spec */ if (al[2] != NIL) { if ( constval(al[2]) && isa( con.ctype , "i" ) ) { fmtspec += CONWIDTH; field = con.crval; } else { fmtspec += VARWIDTH; } } if ((fmtspec & CONPREC) && prec < 0 || (fmtspec & CONWIDTH) && field < 0) { error("Negative widths are not allowed"); continue; } if ( opt('s') && ((fmtspec & CONPREC) && prec == 0 || (fmtspec & CONWIDTH) && field == 0)) { standard(); error("Zero widths are non-standard"); } } if (filetype != nl+T1CHAR) { if (fmt == 'O' || fmt == 'X') { error("Oct/hex allowed only on text files"); continue; } if (fmtspec) { error("Write widths allowed only on text files"); continue; } /* * Generalized write, i.e. * to a non-textfile. */ stklval(file, NIL , LREQ ); put(1, O_FNIL); /* * file^ := ... */ ap = rvalue(argv[1], NIL); if (ap == NIL) continue; if (incompat(ap, filetype, argv[1])) { cerror("Type mismatch in write to non-text file"); continue; } convert(ap, filetype); put(2, O_AS, width(filetype)); /* * put(file) */ put(1, O_PUT); continue; } /* * Write to a textfile * * Evaluate the expression * to be written. */ if (fmt == 'O' || fmt == 'X') { if (opt('s')) { standard(); error("Oct and hex are non-standard"); } if (typ == TSTR || typ == TDOUBLE) { error("Can't write %ss with oct/hex", clnames[typ]); continue; } if (typ == TCHAR || typ == TBOOL) typ = TINT; } /* * Place the arguement on the stack. If there is * no format specified by the programmer, implement * the default. */ switch (typ) { case TINT: if (fmt != 'f') { ap = stkrval(alv, NIL , RREQ ); stkcnt += sizeof(long); } else { ap = stkrval(alv, NIL , RREQ ); put(1, O_ITOD); stkcnt += sizeof(double); typ = TDOUBLE; goto tdouble; } if (fmtspec == NIL) { if (fmt == 'D') field = 10; else if (fmt == 'X') field = 8; else if (fmt == 'O') field = 11; else panic("fmt1"); fmtspec = CONWIDTH; } break; case TCHAR: tchar: if (fmtspec == NIL) { put(1, O_FILE); ap = stkrval(alv, NIL , RREQ ); convert(nl + T4INT, INT_TYP); put(2, O_WRITEC, sizeof(char *) + sizeof(int)); fmtspec = SKIP; break; } ap = stkrval(alv, NIL , RREQ ); convert(nl + T4INT, INT_TYP); stkcnt += sizeof(int); fmt = 'c'; break; case TSCAL: warning(); if (opt('s')) { standard(); } error("Writing scalars to text files is non-standard"); case TBOOL: stkrval(alv, NIL , RREQ ); put(2, O_NAM, (long)listnames(ap)); stkcnt += sizeof(char *); fmt = 's'; break; case TDOUBLE: ap = stkrval(alv, TDOUBLE , RREQ ); stkcnt += sizeof(double); tdouble: switch (fmtspec) { case NIL: # ifdef DEC11 field = 21; # else field = 22; # endif DEC11 prec = 14; fmt = 'e'; fmtspec = CONWIDTH + CONPREC; break; case CONWIDTH: if (--field < 1) field = 1; # ifdef DEC11 prec = field - 7; # else prec = field - 8; # endif DEC11 if (prec < 1) prec = 1; fmtspec += CONPREC; fmt = 'e'; break; case CONWIDTH + CONPREC: case CONWIDTH + VARPREC: if (--field < 1) field = 1; } format[0] = ' '; fmtstart = 0; break; case TSTR: constval( alv ); switch ( classify( con.ctype ) ) { case TCHAR: typ = TCHAR; goto tchar; case TSTR: strptr = con.cpval; for (strnglen = 0; *strptr++; strnglen++) /* void */; strptr = con.cpval; break; default: strnglen = width(ap); break; } fmt = 's'; strfmt = fmtspec; if (fmtspec == NIL) { fmtspec = SKIP; break; } if (fmtspec & CONWIDTH) { if (field <= strnglen) { fmtspec = SKIP; break; } else field -= strnglen; } /* * push string to implement leading blank padding */ put(2, O_LVCON, 2); putstr("", 0); stkcnt += sizeof(char *); break; default: error("Can't write %ss to a text file", clnames[typ]); continue; } /* * If there is a variable precision, evaluate it onto * the stack */ if (fmtspec & VARPREC) { ap = stkrval(al[3], NIL , RREQ ); if (ap == NIL) continue; if (isnta(ap,"i")) { error("Second write width must be integer, not %s", nameof(ap)); continue; } if ( opt( 't' ) ) { put(3, O_MAX, 0, 0); } convert(nl+T4INT, INT_TYP); stkcnt += sizeof(int); } /* * If there is a variable width, evaluate it onto * th((e stack */ if (fmtspec & VARWIDTH) { if ( ( typ == TDOUBLE && fmtspec == VARWIDTH ) || typ == TSTR ) { soffset = sizes[cbn].curtmps; tempnlp = tmpalloc(sizeof(long), nl+T4INT, REGOK); put(2, O_LV | cbn << 8 + INDX, tempnlp -> value[ NL_OFFS ] ); } ap = stkrval(al[2], NIL , RREQ ); if (ap == NIL) continue; if (isnta(ap,"i")) { error("First write width must be integer, not %s", nameof(ap)); continue; } /* * Perform special processing on widths based * on data type */ switch (typ) { case TDOUBLE: if (fmtspec == VARWIDTH) { fmt = 'e'; put(1, O_AS4); put(2, O_RV4 | cbn << 8 + INDX, tempnlp -> value[NL_OFFS] ); # ifdef DEC11 put(3, O_MAX, 8, 1); # else put(3, O_MAX, 9, 1); # endif DEC11 convert(nl+T4INT, INT_TYP); stkcnt += sizeof(int); put(2, O_RV4 | cbn << 8 + INDX, tempnlp->value[NL_OFFS] ); fmtspec += VARPREC; tmpfree(&soffset); } put(3, O_MAX, 1, 1); break; case TSTR: put(1, O_AS4); put(2, O_RV4 | cbn << 8 + INDX, tempnlp -> value[ NL_OFFS ] ); put(3, O_MAX, strnglen, 0); break; default: if ( opt( 't' ) ) { put(3, O_MAX, 0, 0); } break; } convert(nl+T4INT, INT_TYP); stkcnt += sizeof(int); } /* * Generate the format string */ switch (fmtspec) { default: panic("fmt2"); case SKIP: break; case NIL: sprintf(&format[1], "%%%c", fmt); goto fmtgen; case CONWIDTH: sprintf(&format[1], "%%%d%c", field, fmt); goto fmtgen; case VARWIDTH: sprintf(&format[1], "%%*%c", fmt); goto fmtgen; case CONWIDTH + CONPREC: sprintf(&format[1], "%%%d.%d%c", field, prec, fmt); goto fmtgen; case CONWIDTH + VARPREC: sprintf(&format[1], "%%%d.*%c", field, fmt); goto fmtgen; case VARWIDTH + CONPREC: sprintf(&format[1], "%%*.%d%c", prec, fmt); goto fmtgen; case VARWIDTH + VARPREC: sprintf(&format[1], "%%*.*%c", fmt); fmtgen: fmtlen = lenstr(&format[fmtstart], 0); put(2, O_LVCON, fmtlen); putstr(&format[fmtstart], 0); put(1, O_FILE); stkcnt += 2 * sizeof(char *); put(2, O_WRITEF, stkcnt); } /* * Write the string after its blank padding */ if (typ == TSTR) { put(1, O_FILE); put(2, CON_INT, 1); if (strfmt & VARWIDTH) { put(2, O_RV4 | cbn << 8 + INDX , tempnlp -> value[ NL_OFFS ] ); put(2, O_MIN, strnglen); convert(nl+T4INT, INT_TYP); tmpfree(&soffset); } else { if ((fmtspec & SKIP) && (strfmt & CONWIDTH)) { strnglen = field; } put(2, CON_INT, strnglen); } ap = stkrval(alv, NIL , RREQ ); put(2, O_WRITES, 2 * sizeof(char *) + 2 * sizeof(int)); } } /* * Done with arguments. * Handle writeln and * insufficent number of args. */ switch (p->value[0] &~ NSTAND) { case O_WRITEF: if (argc == 0) error("Write requires an argument"); break; case O_MESSAGE: if (argc == 0) error("Message requires an argument"); case O_WRITLN: if (filetype != nl+T1CHAR) error("Can't 'writeln' a non text file"); put(1, O_WRITLN); break; } return; case O_READ4: case O_READLN: /* * Set up default * file "input". */ file = NIL; filetype = nl+T1CHAR; /* * Determine the file implied * for the read and generate * code to make it the active file. */ if (argv != NIL) { codeoff(); ap = stkrval(argv[1], NIL , RREQ ); codeon(); if (ap == NIL) argv = argv[2]; if (ap != NIL && ap->class == FILET) { /* * Got "read(f, ...", make * f the active file, and save * it and its type for use in * processing the rest of the * arguments to read. */ file = argv[1]; filetype = ap->type; stklval(argv[1], NIL , LREQ ); put(1, O_UNIT); argv = argv[2]; argc--; } else { /* * Default is read from * standard input. */ put(1, O_UNITINP); input->nl_flags |= NUSED; } } else { put(1, O_UNITINP); input->nl_flags |= NUSED; } /* * Loop and process each * of the arguments. */ for (; argv != NIL; argv = argv[2]) { /* * Get the address of the target * on the stack. */ al = argv[1]; if (al == NIL) continue; if (al[0] != T_VAR) { error("Arguments to %s must be variables, not expressions", p->symbol); continue; } ap = stklval(al, MOD|ASGN|NOUSE); if (ap == NIL) continue; if (filetype != nl+T1CHAR) { /* * Generalized read, i.e. * from a non-textfile. */ if (incompat(filetype, ap, argv[1] )) { error("Type mismatch in read from non-text file"); continue; } /* * var := file ^; */ if (file != NIL) stklval(file, NIL , LREQ ); else /* Magic */ put(2, PTR_RV, (int)input->value[0]); put(1, O_FNIL); put(2, O_IND, width(filetype)); convert(filetype, ap); if (isa(ap, "bsci")) rangechk(ap, ap); put(2, O_AS, width(ap)); /* * get(file); */ put(1, O_GET); continue; } typ = classify(ap); op = rdops(typ); if (op == NIL) { error("Can't read %ss from a text file", clnames[typ]); continue; } if (op != O_READE) put(1, op); else { put(2, op, (long)listnames(ap)); warning(); if (opt('s')) { standard(); } error("Reading scalars from text files is non-standard"); } /* * Data read is on the stack. * Assign it. */ if (op != O_READ8 && op != O_READE) rangechk(ap, op == O_READC ? ap : nl+T4INT); gen(O_AS2, O_AS2, width(ap), op == O_READ8 ? 8 : op == O_READ4 ? 4 : 2); } /* * Done with arguments. * Handle readln and * insufficient number of args. */ if (p->value[0] == O_READLN) { if (filetype != nl+T1CHAR) error("Can't 'readln' a non text file"); put(1, O_READLN); } else if (argc == 0) error("read requires an argument"); return; case O_GET: case O_PUT: if (argc != 1) { error("%s expects one argument", p->symbol); return; } ap = stklval(argv[1], NIL , LREQ ); if (ap == NIL) return; if (ap->class != FILET) { error("Argument to %s must be a file, not %s", p->symbol, nameof(ap)); return; } put(1, O_UNIT); put(1, op); return; case O_RESET: case O_REWRITE: if (argc == 0 || argc > 2) { error("%s expects one or two arguments", p->symbol); return; } if (opt('s') && argc == 2) { standard(); error("Two argument forms of reset and rewrite are non-standard"); } codeoff(); ap = stklval(argv[1], MOD|NOUSE); codeon(); if (ap == NIL) return; if (ap->class != FILET) { error("First argument to %s must be a file, not %s", p->symbol, nameof(ap)); return; } put(2, O_CON24, text(ap) ? 0: width(ap->type)); if (argc == 2) { /* * Optional second argument * is a string name of a * UNIX (R) file to be associated. */ al = argv[2]; codeoff(); al = stkrval(al[1], NOFLAGS , RREQ ); codeon(); if (al == NIL) return; if (classify(al) != TSTR) { error("Second argument to %s must be a string, not %s", p->symbol, nameof(al)); return; } put(2, O_CON24, width(al)); al = argv[2]; al = stkrval(al[1], NOFLAGS , RREQ ); } else { put(2, O_CON24, 0); put(2, PTR_CON, NIL); } ap = stklval(argv[1], MOD|NOUSE); put(1, op); return; case O_NEW: case O_DISPOSE: if (argc == 0) { error("%s expects at least one argument", p->symbol); return; } ap = stklval(argv[1], op == O_NEW ? ( MOD | NOUSE ) : MOD ); if (ap == NIL) return; if (ap->class != PTR) { error("(First) argument to %s must be a pointer, not %s", p->symbol, nameof(ap)); return; } ap = ap->type; if (ap == NIL) return; argv = argv[2]; if (argv != NIL) { if (ap->class != RECORD) { error("Record required when specifying variant tags"); return; } for (; argv != NIL; argv = argv[2]) { if (ap->ptr[NL_VARNT] == NIL) { error("Too many tag fields"); return; } if (!isconst(argv[1])) { error("Second and successive arguments to %s must be constants", p->symbol); return; } gconst(argv[1]); if (con.ctype == NIL) return; if (incompat(con.ctype, (ap->ptr[NL_TAG])->type , NIL )) { cerror("Specified tag constant type clashed with variant case selector type"); return; } for (ap = ap->ptr[NL_VARNT]; ap != NIL; ap = ap->chain) if (ap->range[0] == con.crval) break; if (ap == NIL) { error("No variant case label value equals specified constant value"); return; } ap = ap->ptr[NL_VTOREC]; } } put(2, op, width(ap)); return; case O_DATE: case O_TIME: if (argc != 1) { error("%s expects one argument", p->symbol); return; } ap = stklval(argv[1], MOD|NOUSE); if (ap == NIL) return; if (classify(ap) != TSTR || width(ap) != 10) { error("Argument to %s must be a alfa, not %s", p->symbol, nameof(ap)); return; } put(1, op); return; case O_HALT: if (argc != 0) { error("halt takes no arguments"); return; } put(1, op); noreach = 1; return; case O_ARGV: if (argc != 2) { error("argv takes two arguments"); return; } ap = stkrval(argv[1], NIL , RREQ ); if (ap == NIL) return; if (isnta(ap, "i")) { error("argv's first argument must be an integer, not %s", nameof(ap)); return; } al = argv[2]; ap = stklval(al[1], MOD|NOUSE); if (ap == NIL) return; if (classify(ap) != TSTR) { error("argv's second argument must be a string, not %s", nameof(ap)); return; } put(2, op, width(ap)); return; case O_STLIM: if (argc != 1) { error("stlimit requires one argument"); return; } ap = stkrval(argv[1], NIL , RREQ ); if (ap == NIL) return; if (isnta(ap, "i")) { error("stlimit's argument must be an integer, not %s", nameof(ap)); return; } if (width(ap) != 4) put(1, O_STOI); put(1, op); return; case O_REMOVE: if (argc != 1)(( { error("remove expects one argument"); return; } codeoff(); ap = stkrval(argv[1], NOFLAGS , RREQ ); codeon(); if (ap == NIL) return; if (classify(ap) != TSTR) { error("remove's argument must be a string, not %s", nameof(ap)); return; } put(2, O_CON24, width(ap)); ap = stkrval(argv[1], NOFLAGS , RREQ ); put(1, op); return; case O_LLIMIT: if (argc != 2) { error("linelimit expects two arguments"); return; } al = argv[2]; ap = stkrval(al[1], NIL , RREQ ); if (ap == NIL) return; if (isnta(ap, "i")) { error("linelimit's second argument must be an integer, not %s", nameof(ap)); return; } ap = stklval(argv[1], NOFLAGS|NOUSE); if (ap == NIL) return; if (!text(ap)) { error("linelimit's first argument must be a text file, not %s", nameof(ap)); return; } put(1, op); return; case O_PAGE: if (argc != 1) { error("page expects one argument"); return; } ap = stklval(argv[1], NIL , LREQ ); if (ap == NIL) return; if (!text(ap)) { error("Argument to page must be a text file, not %s", nameof(ap)); return; } put(1, O_UNIT); put(1, op); return; case O_PACK: if (argc != 3) { error("pack expects three arguments"); return; } pu = "pack(a,i,z)"; pua = argv[1]; al = argv[2]; pui = al[1]; alv = al[2]; puz = alv[1]; goto packunp; case O_UNPACK: if (argc != 3) { error("unpack expects three arguments"); return; } pu = "unpack(z,a,i)"; puz = argv[1]; al = argv[2]; pua = al[1]; alv = al[2]; pui = alv[1]; packunp: codeoff(); ap = stklval(pua, op == O_PACK ? NOFLAGS : MOD|NOUSE); al = (struct nl *) stklval(puz, op == O_UNPACK ? NOFLAGS : MOD|NOUSE); codeon(); if (ap == NIL) return; if (ap->class != ARRAY) { error("%s requires a to be an unpacked array, not %s", pu, nameof(ap)); return; } if (al->class != ARRAY) { error("%s requires z to be a packed array, not %s", pu, nameof(ap)); return; } if (al->type == NIL || ap->type == NIL) return; if (al->type != ap->type) { error("%s requires a and z to be arrays of the same type", pu, nameof(ap)); return; } k = width(al); itemwidth = width(ap->type); ap = ap->chain; al = al->chain; if (ap->chain != NIL || al->chain != NIL) { error("%s requires a and z to be single dimension arrays", pu); return; } if (ap == NIL || al == NIL) return; /* * al is the range for z i.e. u..v * ap is the range for a i.e. m..n * i will be n-m+1 * j will be v-u+1 */ i = ap->range[1] - ap->range[0] + 1; j = al->range[1] - al->range[0] + 1; if (i < j) { error("%s cannot have more elements in a (%d) than in z (%d)", pu, j, i); return; } /* * get n-m-(v-u) and m for the interpreter */ i -= j; j = ap->range[0]; put(2, O_CON24, k); put(2, O_CON24, i); put(2, O_CON24, j); put(2, O_CON24, itemwidth); al = (struct nl *) stklval(puz, op == O_UNPACK ? NOFLAGS : MOD|NOUSE); ap = stklval(pua, op == O_PACK ? NOFLAGS : MOD|NOUSE); ap = stkrval((int *) pui, NLNIL , RREQ ); if (ap == NIL) return; put(1, op); return; case 0: error("%s is an unimplemented 6400 extension", p->symbol); return; default: panic("proc case"); } } #endif OBJ nd m for the interpreter */ i -= j; j = ap->range[0]; put(2, O_CON24, k); put(2, O_CON24, i); put(2, O_CON24, j); put(2, O_CON24, itemwidth); al = (struct nl *) stklval(puz, op == O_UNPACK ? NOFLAGS : MOD|NOUSE); ap = stklval(pua, op == O_PACK ? NOFLAGS : MOD|NOUSE); ap = stkrval((int *) pucmd/pi/pstab.h 644 0 33 1226 2552606451 6476 /* static char sccsid[] = "@(#)pstab.h 1.2 9/9/80"; */ /* * subtypes within the above type * subtypes N_PSO and N_PSOL are .stabs name,,0,subtype,0 * others subtypes are .stabs name,,0,subtype,line */ #define N_PSO 0x1 /* source file name */ #define N_PSOL 0x2 /* include file name */ #define N_PGLABEL 0x3 /* global label */ #define N_PGCONST 0x4 /* global constant */ #define N_PGTYPE 0x5 /* global type */ #define N_PGVAR 0x6 /* global variable */ #define N_PGFUNC 0x7 /* global function */ #define N_PGPROC 0x8 /* global procedure */ #define N_PEFUNC 0x9 /* external function */ #define N_PEPROC 0xa /* external procedure */ ame,,0,subtype,0 * others subtypes are .stabs name,,0,subtype,line */ #define N_PSO 0x1 /* source file name */ #define N_PSOL 0x2 /* include file name */ #define N_PGLABEL 0x3 /* global label */ #define N_PGCONST 0x4 /* global constant */ #define N_PGTYPE 0x5 /* global type */ #define N_PGVAR 0x6 /* global variable */ #define N_PGFUNC 0x7 /* globcmd/pi/put.c 644 0 33 32375 2552606451 6221 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)put.c 1.14 3/26/81"; #include "whoami.h" #include "opcode.h" #include "0.h" #include "objfmt.h" #ifdef PC # include "pc.h" #endif PC short *obufp = obuf; /* * If DEBUG is defined, include the table * of the printing opcode names. */ #ifdef DEBUG #include "OPnames.h" #endif #ifdef OBJ /* * Put is responsible for the interpreter equivalent of code * generation. Since the interpreter is specifically designed * for Pascal, little work is required here. */ put(a) { register int *p, i; register char *cp; register short *sp; register long *lp; int n, subop, suboppr, op, oldlc, w; char *string; static int casewrd; /* * It would be nice to do some more * optimizations here. The work * done to collapse offsets in lval * should be done here, the IFEQ etc * relational operators could be used * etc. */ oldlc = lc; if ( !CGENNING ) /* * code disabled - do nothing */ return (oldlc); p = &a; n = *p++; suboppr = subop = (*p >> 8) & 0377; op = *p & 0377; string = 0; #ifdef DEBUG if ((cp = otext[op]) == NIL) { printf("op= %o\n", op); panic("put"); } #endif switch (op) { case O_ABORT: cp = "*"; break; case O_AS: switch(p[1]) { case 2: op = O_AS2; break; case 4: op = O_AS4; break; case 8: op = O_AS8; break; default: goto pack; } n = 1; # ifdef DEBUG cp = otext[op]; # endif DEBUG break; case O_CONG: case O_LVCON: case O_CON: case O_LINO: case O_NEW: case O_DISPOSE: case O_IND: case O_OFF: case O_INX2: case O_INX4: case O_CARD: case O_ADDT: case O_SUBT: case O_MULT: case O_IN: case O_CASE1OP: case O_CASE2OP: case O_CASE4OP: case O_FRTN: case O_WRITES: case O_WRITEC: case O_WRITEF: case O_MAX: case O_MIN: case O_ARGV: case O_CTTOT: case O_INCT: case O_RANG2: case O_RSNG2: case O_RANG42: case O_RSNG42: case O_SUCC2: case O_SUCC24: case O_PRED2: case O_PRED24: if (p[1] == 0) break; case O_CON2: case O_CON24: pack: if (p[1] < 128 && p[1] >= -128) { suboppr = subop = p[1]; p++; n--; if (op == O_CON2) { op = O_CON1; # ifdef DEBUG cp = otext[O_CON1]; # endif DEBUG } if (op == O_CON24) { op = O_CON14; # ifdef DEBUG cp = otext[O_CON14]; # endif DEBUG } } break; case O_CON8: { short *sp = &p[1]; #ifdef DEBUG if ( opt( 'k' ) ) printf ( "%5d\tCON8\t%22.14e\n" , lc - HEADER_BYTES , * ( ( double * ) &p[1] ) ); #endif # ifdef DEC11 word(op); # else word(op << 8); # endif DEC11 for ( i = 1 ; i <= 4 ; i ++ ) word ( *sp ++ ); return ( oldlc ); } default: if (op >= O_REL2 && op <= O_REL84) { if ((i = (subop >> INDX) * 5 ) >= 30) i -= 30; else i += 2; #ifdef DEBUG string = &"IFEQ\0IFNE\0IFLT\0IFGT\0IFLE\0IFGE"[i]; #endif suboppr = 0; } break; case O_IF: case O_TRA: /***** codeline = 0; *****/ /* relative addressing */ p[1] -= ( unsigned ) lc + sizeof(short); break; case O_FOR1U: case O_FOR2U: case O_FOR1D: case O_FOR2D: /* relative addressing */ p[3] -= ( unsigned ) lc + 3 * sizeof(short); break; case O_CONC: #ifdef DEBUG (string = "'x'")[1] = p[1]; #endif suboppr = 0; op = O_CON1; # ifdef DEBUG cp = otext[O_CON1]; # endif DEBUG subop = p[1]; goto around; case O_CONC4: #ifdef DEBUG (string = "'x'")[1] = p[1]; #endif suboppr = 0; op = O_CON14; subop = p[1]; goto around; case O_CON1: case O_CON14: suboppr = subop = p[1]; around: n--; break; case O_CASEBEG: casewrd = 0; return (oldlc); case O_CASEEND: if ((unsigned) lc & 1) { lc--; word(casewrd); } return (oldlc); case O_CASE1: #ifdef DEBUG if (opt('k')) printf("%5d\tCASE1\t%d\n" , lc - HEADER_BYTES, p[1]); #endif /* * this to build a byte size case table * saving bytes across calls in casewrd * so they can be put out by word() */ lc++; if ((unsigned) lc & 1) # ifdef DEC11 casewrd = p[1] & 0377; # else casewrd = (p[1] & 0377) << 8; # endif DEC11 else { lc -= 2; # ifdef DEC11 word(((p[1] & 0377) << 8) | casewrd); # else word((p[1] & 0377) | casewrd); # endif DEC11 } return (oldlc); case O_CASE2: #ifdef DEBUG if (opt('k')) printf("%5d\tCASE2\t%d\n" , lc - HEADER_BYTES , p[1]); #endif word(p[1]); return (((oldlc); case O_PUSH: lp = (long *)&p[1]; if (*lp == 0) return (oldlc); if (*lp < 128 && *lp >= -128) { suboppr = subop = *lp; p++; n--; break; } goto longgen; case O_FOR4U: case O_FOR4D: /* relative addressing */ p[1 + 2 * (sizeof(long) / sizeof(int))] -= (unsigned)lc + (sizeof(short) + 2 * sizeof(long)); goto longgen; case O_TRA4: case O_CALL: case O_FSAV: case O_GOTO: case O_NAM: case O_READE: /* absolute long addressing */ lp = (long *)&p[1]; *lp -= HEADER_BYTES; goto longgen; case O_RV1: case O_RV14: case O_RV2: case O_RV24: case O_RV4: case O_RV8: case O_RV: case O_LV: /* * positive offsets represent arguments * and must use "ap" display entry rather * than the "fp" entry */ if (p[1] >= 0) { subop++; suboppr++; } # ifdef PDP11 break; # else /* * offsets out of range of word addressing * must use long offset opcodes */ if (p[1] < SHORTADDR && p[1] >= -SHORTADDR) break; else { op += O_LRV - O_RV; # ifdef DEBUG cp = otext[op]; # endif DEBUG } /* and fall through */ # endif PDP11 case O_BEG: case O_NODUMP: case O_CON4: case O_CASE4: case O_RANG4: case O_RANG24: case O_RSNG4: case O_RSNG24: case O_SUCC4: case O_PRED4: longgen: n = (n << 1) - 1; if ( op == O_LRV || op == O_FOR4U || op == O_FOR4D) n--; #ifdef DEBUG if (opt('k')) { printf("%5d\t%s", lc - HEADER_BYTES, cp+1); if (suboppr) printf(":%d", suboppr); for ( i = 2, lp = (long *)&p[1]; i < n ; i += sizeof ( long )/sizeof ( short ) ) printf( "\t%D " , *lp ++ ); if (i == n) { sp = (short *)lp; printf( "\t%d ", *sp ); } pchr ( '\n' ); } #endif if ( op != O_CASE4 ) # ifdef DEC11 word((op & 0377) | subop << 8); # else word(op << 8 | (subop & 0377)); # endif DEC11 for ( i = 1, sp = (short *)&p[1]; i < n; i++) word ( *sp ++ ); return ( oldlc ); } #ifdef DEBUG if (opt('k')) { printf("%5d\t%s", lc - HEADER_BYTES, cp+1); if (suboppr) printf(":%d", suboppr); if (string) printf("\t%s",string); if (n > 1) pchr('\t'); for (i=1; iclass != TYPE) ap = ap->type; if (ap->value[ NL_ELABEL ] != 0) { /* the list already exists */ return( ap -> value[ NL_ELABEL ] ); } # ifdef OBJ oldlc = lc; put(2, O_TRA, lc); ap->value[ NL_ELABEL ] = lc; # endif OBJ # ifdef PC putprintf( " .data" , 0 ); putprintf( " .align 1" , 0 ); ap -> value[ NL_ELABEL ] = getlab(); putlab( ap -> value[ NL_ELABEL ] ); # endif PC /* number of scalars */ next = ap->type; len = next->range[1]-next->range[0]+1; # ifdef OBJ put(2, O_CASE2, len); # endif OBJ # ifdef PC putprintf( " .word %d" , 0 , len ); # endif PC /* offsets of each scalar name */ len = (len+1)*sizeof(short); # ifdef OBJ put(2, O_CASE2, len); # endif OBJ # ifdef PC putprintf( " .word %d" , 0 , len ); # endif PC next = ap->chain; do { for(strptr = next->symbol; *strptr++; len++) continue; len++; # ifdef OBJ put(2, O_CASE2, len); # endif OBJ # ifdef PC putprintf( " .word %d" , 0 , len ); # endif PC } while (next = next->chain); /* list of scalar names */ strptr = getnext(ap, &next); # ifdef OBJ do { # ifdef DEC11 w = (unsigned) *strptr; # else w = *strptr << 8; # endif DEC11 if (!*strptr++) strptr = getnext(next, &next); # ifdef DEC11 w |= *strptr << 8; # else w |= (unsigned) *strptr; # endif DEC11 if (!*strptr++) strptr = getnext(next, &next); word(w); } while (next); /* jump over the mess */ patch(oldlc); # endif OBJ # ifdef PC while ( next ) { while ( *strptr ) { putprintf( " .byte 0%o" , 1 , *strptr++ ); for ( w = 2 ; ( w <= 8 ) && *strptr ; w ++ ) { putprintf( ",0%o" , 1 , *strptr++ ); } putprintf( "" , 0 ); } putprintf( " .byte 0" , 0 ); strptr = getnext( next , &next ); } putprintf( " .text" , 0 ); # endif PC return( ap -> value[ NL_ELABEL ] ); } getnext(next, new) struct nl *next, **new; { if (next != NIL) { next = next->chain; *new = next; } if (next == NIL) return(""); #ifdef OBJ if (opt('k') && CGENNING ) printf("%5d\t\t\"%s\"\n", lc-HEADER_BYTES, next->symbol); #endif OBJ return(next->symbol); } #ifdef OBJ /* * Putspace puts out a table * of nothing to leave space * for the case branch table e.g. */ putspace(n) int n; { register i; if ( !CGENNING ) /* * code disabled - do nothing */ return(lc); #ifdef DEBUG if (opt('k')) printf("%5d\t.=.+%d\n", lc - HEADER_BYTES, n); #endif for (i = even(n); i > 0; i -= 2) word(0); } putstr(sptr, padding) char *sptr; int padding; { register unsigned short w; register char *strptr = sptr; register int pad = padding; if ( !CGENNING ) /* * code disabled - do nothing */ return(lc); #ifdef DEBUG if (opt('k')) printf("%5d\t\t\"%s\"\n", lc-HEADER_BYTES, strptr); #endif if (pad == 0) { do { # ifdef DEC11 w = (unsigned short) * strptr; # else w = (unsigned short)*strptr<<8; # endif DEC11 if (w) # ifdef DEC11 w |= *++strptr << 8; # else w |= *++strptr; # endif DEC11 word(w); } while (*strptr++); } else { # ifdef DEC11 do { w = (unsigned short) * strptr; if (w) { if (*++strptr) w |= *strptr << 8; else { w |= ' \0'; pad--; } word(w); } } while (*strptr++); # else do { w = (unsigned short)*strptr<<8; if (w) { if (*++strptr) w |= *strptr; else { w |= ' '; pad--; } word(w); } } while (*strptr++); # endif DEC11 while (pad > 1) { word(' '); pad -= 2; } if (pad == 1) # ifdef DEC11 word(' '); # else word(' \0'); # endif DEC11 else word(0); } } #endif OBJ lenstr(sptr, padding) char *sptr; int padding; { register int cnt; register char *strptr = sptr; cnt = padding; do { cnt++; } while (*strptr++); return((++cnt) & ~1); } /* * Patch repairs the branch * at location loc to come * to the current location. * for PC, this puts down the label * and the branch just references that label. * lets here it for two pass assemblers. */ patch(loc) { # ifdef OBJ patchfil(loc, (long)(lc-loc-2), 1); # endif OBJ # ifdef PC putlab( loc ); # endif PC } #ifdef OBJ patch4(loc) { patchfil(loc, (long)(lc - HEADER_BYTES), 2); } /* * Patchfil makes loc+2 have value * as its contents. */ patchfil(loc, value, words) PTR_DCL loc; long value; int words; { register i; int val; if ( !CGENNING ) return; if (loc > (unsigned) lc) panic("patchfil"); #ifdef DEBUG if (opt('k')) printf("\tpatch %u %D\n", loc - HEADER_BYTES, value); #endif val = value; do { # ifndef DEC11 if (words > 1) val = value >> 16; else val = value; # endif DEC11 i = ((unsigned) loc + 2 - ((unsigned) lc & ~01777))/2; if (i >= 0 && i < 1024) obuf[i] = val; else { lseek(ofil, (long) loc+2, 0); write(ofil, &val, 2); lseek(ofil, (long) 0, 2); } loc += 2; # ifdef DEC11 val = value >> 16; # endif DEC11 } while (--words); } /* * Put the word o into the code */ word(o) int o; { *obufp = o; obufp++; lc += 2; if (obufp >= obuf+512) pflush(); } extern char *obj; /* * Flush the code buffer */ pflush() { register i; i = (obufp - ( ( short * ) obuf ) ) * 2; if (i != 0 && write(ofil, obuf, i) != i) perror(obj), pexit(DIED); obufp = obuf; } #endif OBJ /* * Getlab - returns the location counter. * included here for the eventual code generator. * for PC, thank you! */ getlab() { # ifdef OBJ return (lc); # endif OBJ # ifdef PC static long lastlabel; return ( ++lastlabel ); # endif PC } /* * Putlab - lay down a label. * for PC, just print the label name with a colon after it. */ putlab(l) int l; { # ifdef PC putprintf( PREFIXFORMAT , 1 , LABELPREFIX , l ); putprintf( ":" , 0 ); # endif PC return (l); } uf; } #endif OBJ /* * Getlab - returns the location counter. * included here for the eventual code generator. * for PC, thank you! */ getlab() { # ifdef OBJ return (lc); # endif OBJ # ifdef PC static long lastlabel; return ( ++lastlabel cmd/pi/putn.c 644 0 33 1711 2552606452 6346 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)putn.c 1.1 8/27/80"; /* * put[1234] * these sort of replace the assembler code * which used to mung the stack inserting 1, 2, 3, or 4 and then * jmp ( not jsr ) to put. these are more portable, * but since they can only receive integer arguments, calls * to one of these with long or real arguments must be changed * to call put directly. */ /* * is there some ((reason why these aren't #defined? */ put1 ( arg1 ) int arg1; { return ( put ( 1 , arg1 ) ); } put2 ( arg1 , arg2 ) int arg1 , arg2; { return ( put ( 2 , arg1 , arg2 ) ); } put3 ( arg1 , arg2 , arg3 ) int arg1 , arg2 , arg3; { return ( put ( 3 , arg1 , arg2 , arg3 ) ); } put4 ( arg1 , arg2 , arg3 , arg4 ) int arg1 , arg2 , arg3 , arg4; { return ( put ( 4 , arg1 , arg2 , arg3 , arg4 ) ); } all put directly. */ /* * is there some cmd/pi/rec.c 644 0 33 13501 2552606452 6151 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)rec.c 1.4 4/1/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "opcode.h" /* * Build a record namelist entry. * Some of the processing here is somewhat involved. * The basic structure we are building is as follows. * * Each record has a main RECORD entry, with an attached * chain of fields as ->chain; these include all the fields in all * the variants of this record. * * Attached to NL_VARNT is a chain of VARNT structures * describing each of the variants. These are further linked * through ->chain. Each VARNT has, in ->range[0] the value of * the associated constant, and each points at a RECORD describing * the subrecord through NL_VTOREC. These pointers are not unique, * more than one VARNT may reference the same RECORD. * * The involved processing here is in computing the NL_OFFS entry * by maxing over the variants. This works as follows. * * Each RECORD has two size counters. NL_OFFS is the maximum size * so far of any variant of this record; NL_FLDSZ gives the size * of just the FIELDs to this point as a base for further variants. * * As we process each variant record, we start its size with the * NL_FLDSZ we have so far. After processing it, if its NL_OFFS * is the largest so far, we update the NL_OFFS of this subrecord. * This will eventually propagate back and update the NL_OFFS of the * entire record. */ /* * P0 points to the outermost RECORD for name searches. */ struct nl *P0; tyrec(r, off) int *r, off; { return tyrec1(r, off, 1); } /* * Define a record namelist entry. * R is the tree for the record to be built. * Off is the offset for the first item in this (sub)record. */ struct nl * tyrec1(r, off, first) register int *r; int off; char first; { register struct nl *p, *P0was; p = defnl(0, RECORD, 0, 0); P0was = P0; if (first) P0 = p; #ifndef PI0 p->value[NL_FLDSZ] = p->value[NL_OFFS] = off; #endif if (r != NIL) { fields(p, r[2]); variants(p, r[3]); } /* * round the lengths of records up to their alignments */ p->value[NL_OFFS] = roundup(p->value[NL_OFFS], (long)align(p)); P0 = P0was; return (p); } /* * Define the fixed part fields for p. */ struct nl * fields(p, r) struct nl *p; int *r; { register int *fp, *tp, *ip; struct nl *jp; for (fp = r; fp != NIL; fp = fp[2]) { tp = fp[1]; if (tp == NIL) continue; jp = gtype(tp[3]); line = tp[1]; for (ip = tp[2]; ip != NIL; ip = ip[2]) deffld(p, ip[1], jp); } } /* * Define the variants for RECORD p. */ struct nl * variants(p, r) struct nl *p; register int *r; { register int *vc, *v; int *vr; struct nl *ct; if (r == NIL) return; ct = gtype(r[3]); if ( ( ct != NIL ) && ( isnta( ct , "bcsi" ) ) ) { error("Tag fields cannot be %ss" , nameof( ct ) ); } line = r[1]; /* * Want it even if r[2] is NIL so * we check its type in "new" and "dispose" * calls -- link it to NL_TAG. */ p->ptr[NL_TAG] = deffld(p, r[2], ct); for (vc = r[4]; vc != NIL; vc = vc[2]) { v = vc[1]; if (v == NIL) continue; vr = tyrec1(v[3], p->value[NL_FLDSZ], 0); #ifndef PI0 if (vr->value[NL_OFFS] > p->value[NL_OFFS]) p->value[NL_OFFS] = vr->value[NL_OFFS]; #endif line = v[1]; for (v = v[2]; v != NIL; v = v[2]) defvnt(p, v[1], vr, ct); } } /* * Define a field in subrecord p of record P0 * with name s and type t. */ struct nl * deffld(p, s, t) struct nl *p; register char *s; register struct nl *t; { register struct nl *fp; if (reclook(P0, s) != NIL) { #ifndef PI1 error("%s is a duplicate field name in this record", s); #endif s = NIL; } #ifndef PI0 /* * it used to be easy to keep track of offsets of fields * and total sizes of records. * but now, the offset of the field is aligned * so only it knows it's offset, and calculating * the total size of the record is based on it, * rather than just the width of the field. */ fp = enter(defnl(s, FIELD, t, (int)roundup(p->value[NL_OFFS], (long)align(t)))); #else fp = enter(defnl(s, FIELD, t, 0)); #endif if (s != NIL) { fp->chain = P0->chain; P0->chain = fp; #ifndef PI0 /* * and the size of the record is incremented. */ p -> value[ NL_OFFS ] = fp -> value[ NL_OFFS ] + width( t ); p -> value[ NL_FLDSZ ] = p -> value[ NL_OFFS ]; #endif if (t != NIL) { P0->nl_flags |= t->nl_flags & NFILES; p->nl_flags |= t->nl_flags & NFILES; } # ifdef PC stabfield( s , p2type( t ) , fp -> value[ NL_OFFS ] , lwidth( t ) ); # endif PC } return (fp); } /* * Define a variant from the constant tree of t * in subrecord p of record P0 where the casetype * is ct and the variant record to be associated is vr. */ struct nl * defvnt(p, t, vr, ct) struct nl *p, *vr; int *t; register struct nl *ct; { register struct nl *av; gconst(t); if (ct != NIL && incompat(con.ctype, ct , t )) { #ifndef PI1 cerror("Variant label type incompatible with selector type"); #endif ct = NIL; } av = defnl(0, VARNT, ct, 0); #ifndef PI1 if (ct != NIL) uniqv(p); #endif av->chain = p->ptr[NL_VARNT]; p->ptr[NL_VARNT] = av; av->ptr[NL_VTOREC] = vr; av->range[0] = con.crval; return (av); } #ifndef PI1 /* * Check that the constant label value * is unique among the labels in this variant. */ uniqv(p) struct nl *p; { register struct nl *vt; for (vt = p->ptr[NL_VARNT]; vt != NIL; vt = vt->chain) if (vt->range[0] == con.crval) { error("Duplicate variant case label in record"); return; } } #endif /* * See if the field name s is defined * in the record p, returning a pointer * to it namelist entry if it is. */ struct nl * reclook(p, s) register struct nl *p; char *s; { if (p == NIL || s == NIL) return (NIL); for (p = p->chain; p != NIL; p = p->chain) if (p->symbol == s) return (p); return (NIL); } ster struct nl *vt; for (vt = p->ptr[NL_VARNT]; vt != NIL; vt = vt->chain) if (vt->range[0] == con.crval) { error("Duplicate variant case label in record"); return; } } #endif /*cmd/pi/rval.c 644 0 33 63750 2552606453 6360 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)rval.c 1.12 6/1/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "opcode.h" #include "objfmt.h" #ifdef PC # include "pc.h" # include "pcops.h" #endif PC extern char *opnames[]; /* line number of the last record comparison warning */ short reccompline = 0; /* line number of the last non-standard set comparison */ short nssetline = 0; #ifdef PC char *relts[] = { "_RELEQ" , "_RELNE" , "_RELTLT" , "_RELTGT" , "_RELTLE" , "_RELTGE" }; char *relss[] = { "_RELEQ" , "_RELNE" , "_RELSLT" , "_RELSGT" , "_RELSLE" , "_RELSGE" }; long relops[] = { P2EQ , P2NE , P2LT , P2GT , P2LE , P2GE }; long mathop[] = { P2MUL , P2PLUS , P2MINUS }; char *setop[] = { "_MULT" , "_ADDT" , "_SUBT" }; #endif PC /* * Rvalue - an expression. * * Contype is the type that the caller would prefer, nand is important * if constant sets or constant strings are involved, the latter * because of string padding. * required is a flag whether an lvalue or an rvalue is required. * only VARs and structured things can have gt their lvalue this way. */ struct nl * rvalue(r, contype , required ) int *r; struct nl *contype; int required; { register struct nl *p, *p1; register struct nl *q; int c, c1, *rt, w, g; char *cp, *cp1, *opname; long l; double f; extern int flagwas; struct csetstr csetd; # ifdef PC struct nl *rettype; long ctype; struct nl *tempnlp; # endif PC if (r == NIL) return (NIL); if (nowexp(r)) return (NIL); /* * Pick up the name of the operation * for future error messages. */ if (r[0] <= T_IN) opname = opnames[r[0]]; /* * The root of the tree tells us what sort of expression we have. */ switch (r[0]) { /* * The constant nil */ case T_NIL: # ifdef OBJ put(2, O_CON2, 0); # endif OBJ # ifdef PC putleaf( P2ICON , 0 , 0 , P2PTR|P2UNDEF , 0 ); # endif PC return (nl+TNIL); /* * Function call with arguments. */ case T_FCALL: # ifdef OBJ return (funccod(r)); # endif OBJ # ifdef PC return (pcfunccod( r )); # endif PC case T_VAR: p = lookup(r[2]); if (p == NIL || p->class == BADUSE) return (NIL); switch (p->class) { case VAR: /* * If a variable is * qualified then get * the rvalue by a * lvalue and an ind. */ if (r[3] != NIL) goto ind; q = p->type; if (((q == NIL) return (NIL); # ifdef OBJ w = width(q); switch (w) { case 8: put(2, O_RV8 | bn << 8+INDX, (int)p->value[0]); break; case 4: put(2, O_RV4 | bn << 8+INDX, (int)p->value[0]); break; case 2: put(2, O_RV2 | bn << 8+INDX, (int)p->value[0]); break; case 1: put(2, O_RV1 | bn << 8+INDX, (int)p->value[0]); break; default: put(3, O_RV | bn << 8+INDX, (int)p->value[0], w); } # endif OBJ # ifdef PC if ( required == RREQ ) { putRV( p -> symbol , bn , p -> value[0] , p -> extra_flags , p2type( q ) ); } else { putLV( p -> symbol , bn , p -> value[0] , p -> extra_flags , p2type( q ) ); } # endif PC return (q); case WITHPTR: case REF: /* * A lvalue for these * is actually what one * might consider a rvalue. */ ind: q = lvalue(r, NOFLAGS , LREQ ); if (q == NIL) return (NIL); # ifdef OBJ w = width(q); switch (w) { case 8: put(1, O_IND8); break; case 4: put(1, O_IND4); break; case 2: put(1, O_IND2); break; case 1: put(1, O_IND1); break; default: put(2, O_IND, w); } # endif OBJ # ifdef PC if ( required == RREQ ) { putop( P2UNARY P2MUL , p2type( q ) ); } # endif PC return (q); case CONST: if (r[3] != NIL) { error("%s is a constant and cannot be qualified", r[2]); return (NIL); } q = p->type; if (q == NIL) return (NIL); if (q == nl+TSTR) { /* * Find the size of the string * constant if needed. */ cp = p->ptr[0]; cstrng: cp1 = cp; for (c = 0; *cp++; c++) continue; w = c; if (contype != NIL && !opt('s')) { if (width(contype) < c && classify(contype) == TSTR) { error("Constant string too long"); return (NIL); } w = width(contype); } # ifdef OBJ put(2, O_CONG, w); putstr(cp1, w - c); # endif OBJ # ifdef PC putCONG( cp1 , w , required ); # endif PC /* * Define the string temporarily * so later people can know its * width. * cleaned out by stat. */ q = defnl(0, STR, 0, w); q->type = q; return (q); } if (q == nl+T1CHAR) { # ifdef OBJ put(2, O_CONC, (int)p->value[0]); # endif OBJ # ifdef PC putleaf( P2ICON , p -> value[0] , 0 , P2CHAR , 0 ); # endif PC return (q); } /* * Every other kind of constant here */ switch (width(q)) { case 8: #ifndef DEBUG # ifdef OBJ put(2, O_CON8, p->real); # endif OBJ # ifdef PC putCON8( p -> real ); # endif PC #else if (hp21mx) { f = p->real; conv(&f); l = f.plong; put(2, O_CON4, l); } else # ifdef OBJ put(2, O_CON8, p->real); # endif OBJ # ifdef PC putCON8( p -> real ); # endif PC #endif break; case 4: # ifdef OBJ put(2, O_CON4, p->range[0]); # endif OBJ # ifdef PC putleaf( P2ICON , p -> range[0] , 0 , P2INT , 0 ); # endif PC break; case 2: # ifdef OBJ put(2, O_CON2, (short)p->range[0]); # endif OBJ # ifdef PC /* * make short constants ints */ putleaf( P2ICON , (short) p -> range[0] , 0 , P2INT , 0 ); # endif PC break; case 1: # ifdef OBJ put(2, O_CON1, p->value[0]); # endif OBJ # ifdef PC /* * make char constants ints */ putleaf( P2ICON , p -> value[0] , 0 , P2INT , 0 ); # endif PC break; default: panic("rval"); } return (q); case FUNC: case FFUNC: /* * Function call with no arguments. */ if (r[3]) { error("Can't qualify a function result value"); return (NIL); } # ifdef OBJ return (funccod((int *) r)); # endif OBJ # ifdef PC return (pcfunccod( r )); # endif PC case TYPE: error("Type names (e.g. %s) allowed only in declarations", p->symbol); return (NIL); case PROC: case FPROC: error("Procedure %s found where expression required", p->symbol); return (NIL); default: panic("rvid"); } /* * Constant sets */ case T_CSET: # ifdef OBJ if ( precset( r , contype , &csetd ) ) { if ( csetd.csettype == NIL ) { return NIL; } postcset( r , &csetd ); } else { put( 2, O_PUSH, -lwidth(csetd.csettype)); postcset( r , &csetd ); setran( ( csetd.csettype ) -> type ); put( 2, O_CON24, set.uprbp); put( 2, O_CON24, set.lwrb); put( 2, O_CTTOT, (int)(4 + csetd.singcnt + 2 * csetd.paircnt)); } return csetd.csettype; # endif OBJ # ifdef PC if ( precset( r , contype , &csetd ) ) { if ( csetd.csettype == NIL ) { return NIL; } postcset( r , &csetd ); } else { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_CTTOT" ); /* * allocate a temporary and use it */ tempnlp = tmpalloc(lwidth(csetd.csettype), csetd.csettype, NOREG); putLV( 0 , cbn , tempnlp -> value[ NL_OFFS ] , tempnlp -> extra_flags , P2PTR|P2STRTY ); setran( ( csetd.csettype ) -> type ); putleaf( P2ICON , set.lwrb , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , set.uprbp , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); postcset( r , &csetd ); putop( P2CALL , P2INT ); } return csetd.csettype; # endif PC /* * Unary plus and minus */ case T_PLUS: case T_MINUS: q = rvalue(r[2], NIL , RREQ ); if (q == NIL) return (NIL); if (isnta(q, "id")) { error("Operand of %s must be integer or real, not %s", opname, nameof(q)); return (NIL); } if (r[0] == T_MINUS) { # ifdef OBJ put(1, O_NEG2 + (width(q) >> 2)); # endif OBJ # ifdef PC putop( P2UNARY P2MINUS , p2type( q ) ); # endif PC return (isa(q, "d") ? q : nl+T4INT); } return (q); case T_NOT: q = rvalue(r[2], NIL , RREQ ); if (q == NIL) return (NIL); if (isnta(q, "b")) { error("not must operate on a Boolean, not %s", nameof(q)); return (NIL); } # ifdef OBJ put(1, O_NOT); # endif OBJ # ifdef PC putop( P2NOT , P2INT ); # endif PC return (nl+T1BOOL); case T_AND: case T_OR: p = rvalue(r[2], NIL , RREQ ); p1 = rvalue(r[3], NIL , RREQ ); if (p == NIL || p1 == NIL) return (NIL); if (isnta(p, "b")) { error("Left operand of %s must be Boolean, not %s", opname, nameof(p)); return (NIL); } if (isnta(p1, "b")) { error("Right operand of %s must be Boolean, not %s", opname, nameof(p1)); return (NIL); } # ifdef OBJ put(1, r[0] == T_AND ? O_AND : O_OR); # endif OBJ # ifdef PC /* * note the use of & and | rather than && and || * to force evaluation of all the expressions. */ putop( r[ 0 ] == T_AND ? P2AND : P2OR , P2INT ); # endif PC return (nl+T1BOOL); case T_DIVD: # ifdef OBJ p = rvalue(r[2], NIL , RREQ ); p1 = rvalue(r[3], NIL , RREQ ); # endif OBJ # ifdef PC /* * force these to be doubles for the divide */ p = rvalue( r[ 2 ] , NIL , RREQ ); if ( isnta( p , "d" ) ) { putop( P2SCONV , P2DOUBLE ); } p1 = rvalue( r[ 3 ] , NIL , RREQ ); if ( isnta( p1 , "d" ) ) { putop( P2SCONV , P2DOUBLE ); } # endif PC if (p == NIL || p1 == NIL) return (NIL); if (isnta(p, "id")) { error("Left operand of / must be integer or real, not %s", nameof(p)); return (NIL); } if (isnta(p1, "id")) { error("Right operand of / must be integer or real, not %s", nameof(p1)); return (NIL); } # ifdef OBJ return gen(NIL, r[0], width(p), width(p1)); # endif OBJ # ifdef PC putop( P2DIV , P2DOUBLE ); return nl + TDOUBLE; # endif PC case T_MULT: case T_ADD: case T_SUB: # ifdef OBJ /* * If the context hasn't told us the type * and a constant set is present * we need to infer the type * before generating code. */ if ( contype == NIL ) { codeoff(); contype = rvalue( r[3] , NIL , RREQ ); codeon(); if ( contype == lookup( intset ) -> type ) { codeoff(); contype = rvalue( r[2] , NIL , RREQ ); codeon(); } } if ( contype == NIL ) { return NIL; } p = rvalue( r[2] , contype , RREQ ); p1 = rvalue( r[3] , p , RREQ ); if ( p == NIL || p1 == NIL ) return NIL; if (isa(p, "id") && isa(p1, "id")) return (gen(NIL, r[0], width(p), width(p1))); if (isa(p, "t") && isa(p1, "t")) { if (p != p1) { error("Set types of operands of %s must be identical", opname); return (NIL); } gen(TSET, r[0], width(p), 0); return (p); } # endif OBJ # ifdef PC /* * the second pass can't do * long op double or double op long * so we have to know the type of both operands * also, it gets tricky for sets, which are done * by function calls. */ codeoff(); p1 = rvalue( r[ 3 ] , contype , RREQ ); codeon(); if ( isa( p1 , "id" ) ) { p = rvalue( r[ 2 ] , contype , RREQ ); if ( ( p == NIL ) || ( p1 == NIL ) ) { return NIL; } if ( isa( p , "i" ) && isa( p1 , "d" ) ) { putop( P2SCONV , P2DOUBLE ); } p1 = rvalue( r[ 3 ] , contype , RREQ ); if ( isa( p , "d" ) && isa( p1 , "i" ) ) { putop( P2SCONV , P2DOUBLE ); } if ( isa( p , "id" ) ) { if ( isa( p , "d" ) || isa( p1 , "d" ) ) { ctype = P2DOUBLE; rettype = nl + TDOUBLE; } else { ctype = P2INT; (( rettype = nl + T4INT; } putop( mathop[ r[0] - T_MULT ] , ctype ); return rettype; } } if ( isa( p1 , "t" ) ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( ADDTYPE( P2PTR | P2STRTY , P2FTN ) , P2PTR ) , setop[ r[0] - T_MULT ] ); if ( contype == NIL ) { contype = p1; if ( contype == lookup( intset ) -> type ) { codeoff(); contype = rvalue( r[2] , NIL , LREQ ); codeon(); } } if ( contype == NIL ) { return NIL; } /* * allocate a temporary and use it */ tempnlp = tmpalloc(lwidth(contype), contype, NOREG); putLV( 0 , cbn , tempnlp -> value[ NL_OFFS ] , tempnlp -> extra_flags , P2PTR|P2STRTY ); p = rvalue( r[2] , contype , LREQ ); if ( isa( p , "t" ) ) { putop( P2LISTOP , P2INT ); if ( p == NIL || p1 == NIL ) { return NIL; } p1 = rvalue( r[3] , p , LREQ ); if ( p != p1 ) { error("Set types of operands of %s must be identical", opname); return NIL; } putop( P2LISTOP , P2INT ); putleaf( P2ICON , lwidth( p1 ) / sizeof( long ) , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2PTR | P2STRTY ); return p; } } if ( isnta( p1 , "idt" ) ) { /* * find type of left operand for error message. */ p = rvalue( r[2] , contype , RREQ ); } /* * don't give spurious error messages. */ if ( p == NIL || p1 == NIL ) { return NIL; } # endif PC if (isnta(p, "idt")) { error("Left operand of %s must be integer, real or set, not %s", opname, nameof(p)); return (NIL); } if (isnta(p1, "idt")) { error("Right operand of %s must be integer, real or set, not %s", opname, nameof(p1)); return (NIL); } error("Cannot mix sets with integers and reals as operands of %s", opname); return (NIL); case T_MOD: case T_DIV: p = rvalue(r[2], NIL , RREQ ); p1 = rvalue(r[3], NIL , RREQ ); if (p == NIL || p1 == NIL) return (NIL); if (isnta(p, "i")) { error("Left operand of %s must be integer, not %s", opname, nameof(p)); return (NIL); } if (isnta(p1, "i")) { error("Right operand of %s must be integer, not %s", opname, nameof(p1)); return (NIL); } # ifdef OBJ return (gen(NIL, r[0], width(p), width(p1))); # endif OBJ # ifdef PC putop( r[ 0 ] == T_DIV ? P2DIV : P2MOD , P2INT ); return ( nl + T4INT ); # endif PC case T_EQ: case T_NE: case T_LT: case T_GT: case T_LE: case T_GE: /* * Since there can be no, a priori, knowledge * of the context type should a constant string * or set arise, we must poke around to find such * a type if possible. Since constant strings can * always masquerade as identifiers, this is always * necessary. */ codeoff(); p1 = rvalue(r[3], NIL , RREQ ); codeon(); if (p1 == NIL) return (NIL); contype = p1; # ifdef OBJ if (p1->class == STR) { /* * For constant strings we want * the longest type so as to be * able to do padding (more importantly * avoiding truncation). For clarity, * we get this length here. */ codeoff(); p = rvalue(r[2], NIL , RREQ ); codeon(); if (p == NIL) return (NIL); if (width(p) > width(p1)) contype = p; } else if ( isa( p1 , "t" ) ) { if ( contype == lookup( intset ) -> type ) { codeoff(); contype = rvalue( r[2] , NIL , RREQ ); codeon(); if ( contype == NIL ) { return NIL; } } } /* * Now we generate code for * the operands of the relational * operation. */ p = rvalue(r[2], contype , RREQ ); if (p == NIL) return (NIL); p1 = rvalue(r[3], p , RREQ ); if (p1 == NIL) return (NIL); # endif OBJ # ifdef PC c1 = classify( p1 ); if ( c1 == TSET || c1 == TSTR || c1 == TREC ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , c1 == TSET ? relts[ r[0] - T_EQ ] : relss[ r[0] - T_EQ ] ); /* * for [] and strings, comparisons are done on * the maximum width of the two sides. * for other sets, we have to ask the left side * what type it is based on the type of the right. * (this matters for intsets). */ if ( c1 == TSTR ) { codeoff(); p = rvalue( r[ 2 ] , NIL , LREQ ); codeon(); if ( p == NIL ) { return NIL; } if ( lwidth( p ) > lwidth( p1 ) ) { contype = p; } } else if ( c1 == TSET ) { if ( contype == lookup( intset ) -> type ) { codeoff(); p = rvalue( r[ 2 ] , NIL , LREQ ); codeon(); if ( p == NIL ) { return NIL; } contype = p; } } /* * put out the width of the comparison. */ putleaf( P2ICON , lwidth( contype ) , 0 , P2INT , 0 ); /* * and the left hand side, * for sets, strings, records */ p = rvalue( r[ 2 ] , contype , LREQ ); putop( P2LISTOP , P2INT ); p1 = rvalue( r[ 3 ] , p , LREQ ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); } else { /* * the easy (scalar or error) case */ p = rvalue( r[ 2 ] , contype , RREQ ); if ( p == NIL ) { return NIL; } /* * since the second pass can't do * long op double or double op long * we may have to do some coercing. */ if ( isa( p , "i" ) && isa( p1 , "d" ) ) { putop( P2SCONV , P2DOUBLE ); } p1 = rvalue( r[ 3 ] , p , RREQ ); if ( isa( p , "d" ) && isa( p1 , "i" ) ) putop( P2SCONV , P2DOUBLE ); putop( relops[ r[0] - T_EQ ] , P2INT ); } # endif PC c = classify(p); c1 = classify(p1); if (nocomp(c) || nocomp(c1)) return (NIL); g = NIL; switch (c) { case TBOOL: case TCHAR: if (c != c1) goto clash; break; case TINT: case TDOUBLE: if (c1 != TINT && c1 != TDOUBLE) goto clash; break; case TSCAL: if (c1 != TSCAL) goto clash; if (scalar(p) != scalar(p1)) goto nonident; break; case TSET: if (c1 != TSET) goto clash; if ( opt( 's' ) && ( ( r[0] == T_LT ) || ( r[0] == T_GT ) ) && ( line != nssetline ) ) { nssetline = line; standard(); error("%s comparison on sets is non-standard" , opname ); } if (p != p1) goto nonident; g = TSET; break; case TREC: if ( c1 != TREC ) { goto clash; } if ( p != p1 ) { goto nonident; } if (r[0] != T_EQ && r[0] != T_NE) { error("%s not allowed on records - only allow = and <>" , opname ); return (NIL); } g = TREC; break; case TPTR: case TNIL: if (c1 != TPTR && c1 != TNIL) goto clash; if (r[0] != T_EQ && r[0] != T_NE) { error("%s not allowed on pointers - only allow = and <>" , opname ); return (NIL); } break; case TSTR: if (c1 != TSTR) goto clash; if (width(p) != width(p1)) { error("Strings not same length in %s comparison", opname); return (NIL); } g = TSTR; break; default: panic("rval2"); } # ifdef OBJ return (gen(g, r[0], width(p), width(p1))); # endif OBJ # ifdef PC return nl + TBOOL; # endif PC clash: error("%ss and %ss cannot be compared - operator was %s", clnames[c], clnames[c1], opname); return (NIL); nonident: error("%s types must be identical in comparisons - operator was %s", clnames[c1], opname); return (NIL); case T_IN: rt = r[3]; # ifdef OBJ if (rt != NIL && rt[0] == T_CSET) { precset( rt , NIL , &csetd ); p1 = csetd.csettype; if (p1 == NIL) return NIL; postcset( rt, &csetd); } else { p1 = stkrval(r[3], NIL , RREQ ); rt = NIL; } # endif OBJ # ifdef PC if (rt != NIL && rt[0] == T_CSET) { if ( precset( rt , NIL , &csetd ) ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_IN" ); } else { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_INCT" ); } p1 = csetd.csettype; if (p1 == NIL) return NIL; } else { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_IN" ); codeoff(); p1 = rvalue(r[3], NIL , LREQ ); codeon(); } # endif PC p = stkrval(r[2], NIL , RREQ ); if (p == NIL || p1 == NIL) return (NIL); if (p1->class != SET) { error("Right operand of 'in' must be a set, not %s", nameof(p1)); return (NIL); } if (incompat(p, p1->type, r[2])) { cerror("Index type clashed with set component type for 'in'"); return (NIL); } setran(p1->type); # ifdef OBJ if (rt == NIL || csetd.comptime) put(4, O_IN, width(p1), set.lwrb, set.uprbp); else put(2, O_INCT, (int)(3 + csetd.singcnt + 2*csetd.paircnt)); # endif OBJ # ifdef PC if ( rt == NIL || rt[0] != T_CSET ) { putleaf( P2ICON , set.lwrb , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , set.uprbp , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); p1 = rvalue( r[3] , NIL , LREQ ); putop( P2LISTOP , P2INT ); } else if ( csetd.comptime ) { putleaf( P2ICON , set.lwrb , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , set.uprbp , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); postcset( r[3] , &csetd ); putop( P2LISTOP , P2INT ); } else { postcset( r[3] , &csetd ); } putop( P2CALL , P2INT ); # endif PC return (nl+T1BOOL); default: if (r[2] == NIL) return (NIL); switch (r[0]) { default: panic("rval3"); /* * An octal number */ case T_BINT: f = a8tol(r[2]); goto conint; /* * A decimal number */ case T_INT: f = atof(r[2]); conint: if (f > MAXINT || f < MININT) { error("Constant too large for this implementation"); return (NIL); } l = f; if (bytes(l, l) <= 2) { # ifdef OBJ put(2, O_CON2, ( short ) l); # endif OBJ # ifdef PC /* * short constants are ((ints */ putleaf( P2ICON , l , 0 , P2INT , 0 ); # endif PC return (nl+T2INT); } # ifdef OBJ put(2, O_CON4, l); # endif OBJ # ifdef PC putleaf( P2ICON , l , 0 , P2INT , 0 ); # endif PC return (nl+T4INT); /* * A floating point number */ case T_FINT: # ifdef OBJ put(2, O_CON8, atof(r[2])); # endif OBJ # ifdef PC putCON8( atof( r[2] ) ); # endif PC return (nl+TDOUBLE); /* * Constant strings. Note that constant characters * are constant strings of length one; there is * no constant string of length one. */ case T_STRNG: cp = r[2]; if (cp[1] == 0) { # ifdef OBJ put(2, O_CONC, cp[0]); # endif OBJ # ifdef PC putleaf( P2ICON , cp[0] , 0 , P2CHAR , 0 ); # endif PC return (nl+T1CHAR); } goto cstrng; } } } /* * Can a class appear * in a comparison ? */ nocomp(c) int c; { switch (c) { case TREC: if ( line != reccompline ) { reccompline = line; warning(); if ( opt( 's' ) ) { standard(); } error("record comparison is non-standard"); } break; case TFILE: case TARY: error("%ss may not participate in comparisons", clnames[c]); return (1); } return (NIL); } /* * this is sort of like gconst, except it works on expression trees * rather than declaration trees, and doesn't give error messages for * non-constant things. * as a side effect this fills in the con structure that gconst uses. * this returns TRUE or FALSE. */ constval(r) register int *r; { register struct nl *np; register *cn; char *cp; int negd, sgnd; long ci; con.ctype = NIL; cn = r; negd = sgnd = 0; loop: /* * cn[2] is nil if error recovery generated a T_STRNG */ if (cn == NIL || cn[2] == NIL) return FALSE; switch (cn[0]) { default: return FALSE; case T_MINUS: negd = 1 - negd; /* and fall through */ case T_PLUS: sgnd++; cn = cn[2]; goto loop; case T_NIL: con.cpval = NIL; con.cival = 0; con.crval = con.cival; con.ctype = nl + TNIL; break; case T_VAR: np = lookup(cn[2]); if (np == NIL || np->class != CONST) { return FALSE; } if ( cn[3] != NIL ) { return FALSE; } con.ctype = np->type; switch (classify(np->type)) { case TINT: con.crval = np->range[0]; break; case TDOUBLE: con.crval = np->real; break; case TBOOL: case TCHAR: case TSCAL: con.cival = np->value[0]; con.crval = con.cival; break; case TSTR: con.cpval = np->ptr[0]; break; default: con.ctype = NIL; return FALSE; } break; case T_BINT: con.crval = a8tol(cn[2]); goto restcon; case T_INT: con.crval = atof(cn[2]); if (con.crval > MAXINT || con.crval < MININT) { derror("Constant too large for this implementation"); con.crval = 0; } restcon: ci = con.crval; #ifndef PI0 if (bytes(ci, ci) <= 2) con.ctype = nl+T2INT; else #endif con.ctype = nl+T4INT; break; case T_FINT: con.ctype = nl+TDOUBLE; con.crval = atof(cn[2]); break; case T_STRNG: cp = cn[2]; if (cp[1] == 0) { con.ctype = nl+T1CHAR; con.cival = cp[0]; con.crval = con.cival; break; } con.ctype = nl+TSTR; con.cpval = cp; break; } if (sgnd) { if (isnta(con.ctype, "id")) { derror("%s constants cannot be signed", nameof(con.ctype)); return FALSE; } else if (negd) con.crval = -con.crval; } return TRUE; } ndif con.ctype = nl+cmd/pi/send.h 644 0 33 1122 2552606453 6313 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)send.h 1.1 8/27/80"; */ #define RINIT 1 #define RENQ 2 #define RTREE 3 #define RTRFREE 4 #define RTRCHK 5 #define REVENIT 6 #define RSTRING 7 #define REVLAB 8 #define REVCNST 9 #define REVTBEG 10 #define REVTYPE 11 #define REVTEND 12 #define REVVBEG 13 #define REVVAR 14 #define REVVEND 15 #define REVFHDR 16 #define REVFFWD 17 #define REVFBDY 18 #define REVFEND 19 #define ROPUSH 20 #define ROPOP 21 #define ROSET 22 #define RKILL 23 #define RFINISH 24 #define RLAST 24 extern char *trdesc[]; ccsid[] = "@(#)send.h 1.1 8/27/80"; */ #define RINIT 1 #define RENQ 2 #define RTREE 3 #define RTRFREE 4 #define RTRCHK 5 #define REVENIT 6 #define RSTRING 7 #define REVLAB 8 #define REVCNST 9 #define REVTBEG 10 #define REVTYPE 11 #define REVTEND 12 #define REVVBEG 13 #define REVVAR 14 #define REVVEND 15 #define REVFHDR 16 #define REVFFWD 17 #define REVFBDY 18 #define REVFEND 19 #define ROPUSH 20 #define ROPOP 21 #define ROSETcmd/pi/stab.c 644 0 33 14737 2552606453 6346 /* Copyright (c) 1980 Regents of the University of California */ static char sccsid[] = "@(#)stab.c 1.6 3/24/81"; /* * procedures to put out sdb symbol table information. * and stabs for separate compilation type checking. * these use the new .stabs, .stabn, and .stabd directives */ #include "whoami.h" #ifdef PC /* and the rest of the file */ # include "0.h" # include /* * additional symbol definition for * that is used by the separate compilation facility -- * eventually, should be updated to include this */ # include "pstab.h" # include "pc.h" /* * absolute value: line numbers are negative if error recovery. */ #define ABS( x ) ( x < 0 ? -x : x ) /* * global variables */ stabgvar( name , type , offset , length , line ) char *name; int type; int offset; int length; int line; { /* * for separate compilation */ putprintf( " .stabs \"%s\",0x%x,0,0x%x,0x%x" , 0 , name , N_PC , N_PGVAR , ABS( line ) ); /* * for sdb */ if ( ! opt('g') ) { return; } putprintf( " .stabs \"" , 1 ); putprintf( NAMEFORMAT , 1 , name ); putprintf( "\",0x%x,0,0x%x,0" , 0 , N_GSYM , type ); putprintf( " .stabs \"" , 1 ); putprintf( NAMEFORMAT , 1 , name ); putprintf( "\",0x%x,0,0,0x%x" , 0 , N_LENG , length ); } /* * local variables */ stablvar( name , type , level , offset , length ) char *name; int type; int level; int offset; int length; { if ( ! opt('g') ) { return; } putprintf( " .stabs \"" , 1 ); putprintf( NAMEFORMAT , 1 , name ); putprintf( "\",0x%x,0,0x%x,0x%x" , 0 , N_LSYM , type , -offset ); putprintf( " .stabs \"" , 1 ); putprintf( NAMEFORMAT , 1 , name ); putprintf( "\",0x%x,0,0,0x%x" , 0 , N_LENG , length ); } /* * parameters */ stabparam( name , type , offset , length ) char *name; int type; int offset; int length; { if ( ! opt('g') ) { return; } putprintf( " .stabs \"" , 1 ); putprintf( NAMEFORMAT , 1 , name ); putprintf( "\",0x%x,0,0x%x,0x%x" , 0 , N_PSYM , type , offset ); putprintf( " .stabs \"" , 1 ); putprintf( NAMEFORMAT , 1 , name ); putprintf( "\",0x%x,0,0,0x%x" , 0 , N_LENG , length ); } /* * fields */ stabfield( name , type , offset , length ) char *name; int type; int offset; int length; { if ( ! opt('g') ) { return; } putprintf( " .stabs \"" , 1 ); putprintf( NAMEFORMAT , 1 , name ); putprintf( "\",0x%x,0,0x%x,0x%x" , 0 , N_SSYM , type , offset ); putprintf( " .stabs \"" , 1 ); putprintf( NAMEFORMAT , 1 , name ); putprintf( "\",0x%x,0,0,0x%x" , 0 , N_LENG , length ); } /* * left brackets */ stablbrac( level ) int level; { if ( ! opt('g') ) { return; } putprintf( " .stabd 0x%x,0,0x%x" , 0 , N_LBRAC , level ); } /* * right brackets */ stabrbrac( level ) int level; { if ( ! opt('g') ) { return; } putprintf( " .stabd 0x%x,0,0x%x" , 0 , N_RBRAC , level ); } /* * functions */ stabfunc( name , class , line , level ) char *name; int class; int line; long level; { int type; long i; char extname[ BUFSIZ ]; /* * for separate compilation */ if ( level == 1 ) { if ( class == FUNC ) { putprintf( " .stabs \"%s\",0x%x,0,0x%x,0x%x" , 0 , name , N_PC , N_PGFUNC , ABS( line ) ); } else if ( class == PROC ) { putprintf( " .stabs \"%s\",0x%x,0,0x%x,0x%x" , 0 , name , N_PC , N_PGPROC , ABS( line ) ); } } /* * for sdb */ if ( ! opt('g') ) { return; } putprintf( " .stabs \"" , 1 ); putprintf( NAMEFORMAT , 1 , name ); sextname( extname , name , level ); putprintf( "\",0x%x,0,0x%x,%s" , 0 , N_FUN , line , extname ); } /* * source line numbers */ stabline( line ) int line; { if ( ! opt('g') ) { return; } putprintf( " .stabd 0x%x,0,0x%x" , 0 , N_SLINE , ABS( line ) ); } /* * source files */ stabsource( filename ) char *filename; { int label; /* * for separate compilation */ putprintf( " .stabs \"%s\",0x%x,0,0x%x,0" , 0 , filename , N_PC , N_PSO ); /* * for sdb */ if ( ! opt('g') ) { return; } label = getlab(); putprintf( " .stabs \"" , 1 ); putprintf( NAMEFORMAT , 1 , filename ); putprintf( "\",0x%x,0,0," , 1 , N_SO ); putprintf( PREFIXFORMAT , 0 , LLABELPREFIX , label ); putprintf( PREFIXFORMAT ,(( 1 , LLABELPREFIX , label ); putprintf( ":" , 0 ); } /* * included files get one or more of these: * one as they are entered by a #include, * and one every time they are returned to by nested #includes */ stabinclude( filename ) char *filename; { int label; /* * for separate compilation */ putprintf( " .stabs \"%s\",0x%x,0,0x%x,0" , 0 , filename , N_PC , N_PSOL ); /* * for sdb */ if ( ! opt('g') ) { return; } label = getlab(); putprintf( " .stabs \"" , 1 ); putprintf( NAMEFORMAT , 1 , filename ); putprintf( "\",0x%x,0,0," , 1 , N_SOL ); putprintf( PREFIXFORMAT , 0 , LLABELPREFIX , label ); putprintf( PREFIXFORMAT , 1 , LLABELPREFIX , label ); putprintf( ":" , 0 ); } /* * global Pascal symbols : * labels, types, constants, and external procedure and function names: * These are used by the separate compilation facility * to be able to check for disjoint header files. */ /* * global labels */ stabglabel( label , line ) char *label; int line; { putprintf( " .stabs \"%s\",0x%x,0,0x%x,0x%x" , 0 , label , N_PC , N_PGLABEL , ABS( line ) ); } /* * global constants */ stabgconst( const , line ) char *const; int line; { putprintf( " .stabs \"%s\",0x%x,0,0x%x,0x%x" , 0 , const , N_PC , N_PGCONST , ABS( line ) ); } /* * global types */ stabgtype( type , line ) char *type; int line; { putprintf( " .stabs \"%s\",0x%x,0,0x%x,0x%x" , 0 , type , N_PC , N_PGTYPE , ABS( line ) ); } /* * external functions and procedures */ stabefunc( name , class , line ) char *name; int class; int line; { int type; if ( class == FUNC ) { type = N_PEFUNC; } else if ( class == PROC ) { type = N_PEPROC; } else { return; } putprintf( " .stabs \"%s\",0x%x,0,0x%x,0x%x" , 0 , name , N_PC , type , ABS( line ) ); } #endif PC ine; { putprintf( " .stcmd/pi/stat.c 644 0 33 26625 2552606454 6370 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)stat.c 1.5 6/1/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "objfmt.h" #ifdef PC # include "pcops.h" # include "pc.h" #endif PC int cntstat; short cnts = 3; #include "opcode.h" /* * Statement list */ statlist(r) int *r; { register *sl; for (sl=r; sl != NIL; sl=sl[2]) statement(sl[1]); } /* * Statement */ statement(r) int *r; { register *s; register struct nl *snlp; struct tmps soffset; s = r; snlp = nlp; soffset = sizes[cbn].curtmps; top: if (cntstat) { cntstat = 0; putcnt(); } if (s == NIL) return; line = s[1]; if (s[0] == T_LABEL) { labeled(s[2]); s = s[3]; noreach = 0; cntstat = 1; goto top; } if (noreach) { noreach = 0; warning(); error("Unreachable statement"); } switch (s[0]) { case T_PCALL: putline(); # ifdef OBJ proc(s); # endif OBJ # ifdef PC pcproc( s ); # endif PC break; case T_ASGN: putline(); asgnop(s); break; case T_GOTO: putline(); gotoop(s[2]); noreach = 1; cntstat = 1; break; default: level++; switch (s[0]) { default: panic("stat"); case T_IF: case T_IFEL: ifop(s); break; case T_WHILE: whilop(s); noreach = 0; break; case T_REPEAT: repop(s); break; case T_FORU: case T_FORD: forop(s); noreach = 0; break; case T_BLOCK: statlist(s[2]); break; case T_CASE: putline(); # ifdef OBJ caseop(s); # endif OBJ # ifdef PC pccaseop( s ); # endif PC break; case T_WITH: withop(s); break; case T_ASRT: putline(); asrtop(s); break; } --level; if (gotos[cbn]) ungoto(); break; } /* * Free the temporary name list entries defined in * expressions, e.g. STRs, and WITHPTRs from withs. */ nlfree(snlp); /* * free any temporaries allocated for this statement * these come from strings and sets. */ tmpfree(&soffset); } ungoto() { register struct nl *p; for (p = gotos[cbn]; p != NIL; p = p->chain) if ((p->nl_flags & NFORWD) != 0) { if (p->value[NL_GOLEV] != NOTYET) if (p->value[NL_GOLEV] > level) p->value[NL_GOLEV] = level; } else if (p->value[NL_GOLEV] != DEAD) if (p->value[NL_GOLEV] > level) p->value[NL_GOLEV] = DEAD; } putcnt() { if (monflg == 0) { return; } inccnt( getcnt() ); } int getcnt() { return ++cnts; } inccnt( counter ) int counter; { # ifdef OBJ put(2, O_COUNT, counter ); # endif OBJ # ifdef PC putRV( PCPCOUNT , 0 , counter * sizeof (long) , NGLOBAL , P2INT ); putleaf( P2ICON , 1 , 0 , P2INT , 0 ); putop( P2ASG P2PLUS , P2INT ); putdot( filename , line ); # endif PC } putline() { # ifdef OBJ if (opt('p') != 0) put(2, O_LINO, line); # endif OBJ # ifdef PC static lastline; if ( line != lastline ) { stabline( line ); lastline = line; } if ( opt( 'p' ) ) { if ( opt('t') ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_LINO" ); putop( P2UNARY P2CALL , P2INT ); putdot( filename , line ); } else { putRV( STMTCOUNT , 0 , 0 , NGLOBAL , P2INT ); putleaf( P2ICON , 1 , 0 , P2INT , 0 ); putop( P2ASG P2PLUS , P2INT ); putdot( filename , line ); } } # endif PC } /* * With varlist do stat * * With statement requires an extra word * in automatic storage for each level of withing. * These indirect pointers are initialized here, and * the scoping effect of the with statement occurs * because lookup examines the field names of the records * associated with the WITHPTRs on the withlist. */ withop(s) int *s; { register *p; register struct nl *r; struct nl *tempnlp; int *swl; putline(); swl = withlist; for (p = s[2]; p != NIL; p = p[2]) { tempnlp = tmpalloc(sizeof(int *), INT_TYP, REGOK); # ifdef OBJ put(2, O_LV | cbn <<8+INDX, tempnlp -> value[ NL_OFFS ] ); # endif OBJ # ifdef PC putRV( 0 , cbn , tempnlp -> value[ NL_OFFS ] , tempnlp -> extra_flags , P2PTR|P2STRTY ); # endif PC r = lvalue(p[1], MOD , LREQ ); if (r == NIL) continue; if (r->class != RECORD) { error("Variable in with statement refers to %s, not to a record", nameof(r)); continue; } r = defnl(0, WITHPTR, r, tempnlp -> value[ NL_OFFS ] ); # ifdef PC r -> extra_flags |= tempnlp -> extra_flags; # endif PC r->nl_next = withlist; withlist = r; # ifdef OBJ put(1, PTR_AS); # endif OBJ # ifdef PC putop( P2ASSIGN , P2PTR|P2STRTY ); putdot( filename , line ); # endif PC } statement(s[3]); withlist = swl; } extern flagwas; /* * var := expr */ asgnop(r) int *r; { register struct nl *p; register *av; if (r == NIL) return (NIL); /* * Asgnop's only function is * to handle function variable * assignments. All other assignment * stuff is handled by asgnop1. * the if below checks for unqualified lefthandside: * necessary for fvars. */ av = r[2]; if (av != NIL && av[0] == T_VAR && av[3] == NIL) { p = lookup1(av[2]); if (p != NIL) p->nl_flags = flagwas; if (p != NIL && p->class == FVAR) { /* * Give asgnop1 the func * which is the chain of * the FVAR. */ p->nl_flags |= NUSED|NMOD; p = p->chain; if (p == NIL) { rvalue(r[3], NIL , RREQ ); return; } # ifdef OBJ put(2, O_LV | bn << 8+INDX, (int)p->value[NL_OFFS]); if (isa(p->type, "i") && width(p->type) == 1) asgnop1(r, nl+T2INT); else asgnop1(r, p->type); # endif OBJ # ifdef PC /* * this should be the lvalue of the fvar, * but since the second pass knows to use * the address of the left operand of an * assignment, what i want here is an rvalue. * see note in funchdr about fvar allocation. */ p = p -> ptr[ NL_FVAR ]; putRV( p -> symbol , bn , p -> value[ NL_OFFS ] , p -> extra_flags , p2type( p -> type ) ); asgnop1( r , p -> type ); # endif PC return; } } asgnop1(r, NIL); } /* * Asgnop1 handles all assignments. * If p is not nil then we are assigning * to a function variable, otherwise * we look the variable up ourselves. */ struct nl * asgnop1(r, p) int *r; register struct nl *p; { register struct nl *p1; int w; if (r == NIL) return (NIL); if (p == NIL) { # ifdef OBJ p = lvalue(r[2], MOD|ASGN|NOUSE , LREQ ); w = width(p); # endif OBJ # ifdef PC /* * since the second pass knows that it should reference * the lefthandside of asignments, what i need here is * an rvalue. */ p = lvalue( r[2] , MOD|ASGN|NOUSE , RREQ ); # endif PC if ( p == NIL ) { rvalue( r[3] , NIL , RREQ ); return NIL; } } # ifdef OBJ /* * assigning to the return value, which is at least * of width two since it resides on the stack */ else { w = width(p); if (w < 2) w = 2; } p1 = rvalue(r[3], p , RREQ ); # endif OBJ # ifdef PC /* * if this is a scalar assignment, * then i want to rvalue the righthandside. * if this is a structure assignment, * then i want an lvalue to the righthandside. * that's what the intermediate form sez. */ switch ( classify( p ) ) { case TINT: case TCHAR: case TBOOL: case TSCAL: precheck( p , "_RANG4" , "_RSNG4" ); case TDOUBLE: case TPTR: p1 = rvalue( r[3] , p , RREQ ); break; default: p1 = rvalue( r[3] , p , LREQ ); break;(( } # endif PC if (p1 == NIL) return (NIL); if (incompat(p1, p, r[3])) { cerror("Type of expression clashed with type of variable in assignment"); return (NIL); } switch (classify(p)) { case TINT: case TBOOL: case TCHAR: case TSCAL: # ifdef OBJ rangechk(p, p1); # endif OBJ # ifdef PC postcheck( p ); # endif PC case TDOUBLE: case TPTR: # ifdef OBJ gen(O_AS2, O_AS2, w, width(p1)); # endif OBJ # ifdef PC putop( P2ASSIGN , p2type( p ) ); putdot( filename , line ); # endif PC break; default: # ifdef OBJ put(2, O_AS, w); # endif OBJ # ifdef PC putstrop( P2STASG , p2type( p ) , lwidth( p ) , align( p ) ); putdot( filename , line ); # endif PC } return (p); /* Used by for statement */ } /* * if expr then stat [ else stat ] */ ifop(r) int *r; { register struct nl *p; register l1, l2; /* l1 is start of else, l2 is end of else */ int goc; bool nr; goc = gocnt; if (r == NIL) return; putline(); p = rvalue(r[2], NIL , RREQ ); if (p == NIL) { statement(r[3]); noreach = 0; statement(r[4]); noreach = 0; return; } if (isnta(p, "b")) { error("Type of expression in if statement must be Boolean, not %s", nameof(p)); statement(r[3]); noreach = 0; statement(r[4]); noreach = 0; return; } # ifdef OBJ l1 = put(2, O_IF, getlab()); # endif OBJ # ifdef PC l1 = getlab(); putleaf( P2ICON , l1 , 0 , P2INT , 0 ); putop( P2CBRANCH , P2INT ); putdot( filename , line ); # endif PC putcnt(); statement(r[3]); nr = noreach; if (r[4] != NIL) { /* * else stat */ --level; ungoto(); ++level; # ifdef OBJ l2 = put(2, O_TRA, getlab()); # endif OBJ # ifdef PC l2 = getlab(); putjbr( l2 ); # endif PC patch(l1); noreach = 0; statement(r[4]); noreach = (noreach && nr); l1 = l2; } else noreach = 0; patch(l1); if (goc != gocnt) putcnt(); } /* * while expr do stat */ whilop(r) int *r; { register struct nl *p; register l1, l2; int goc; goc = gocnt; if (r == NIL) return; putlab(l1 = getlab()); putline(); p = rvalue(r[2], NIL , RREQ ); if (p == NIL) { statement(r[3]); noreach = 0; return; } if (isnta(p, "b")) { error("Type of expression in while statement must be Boolean, not %s", nameof(p)); statement(r[3]); noreach = 0; return; } l2 = getlab(); # ifdef OBJ put(2, O_IF, l2); # endif OBJ # ifdef PC putleaf( P2ICON , l2 , 0 , P2INT , 0 ); putop( P2CBRANCH , P2INT ); putdot( filename , line ); # endif PC putcnt(); statement(r[3]); # ifdef OBJ put(2, O_TRA, l1); # endif OBJ # ifdef PC putjbr( l1 ); # endif PC patch(l2); if (goc != gocnt) putcnt(); } /* * repeat stat* until expr */ repop(r) int *r; { register struct nl *p; register l; int goc; goc = gocnt; if (r == NIL) return; l = putlab(getlab()); putcnt(); statlist(r[2]); line = r[1]; p = rvalue(r[3], NIL , RREQ ); if (p == NIL) return; if (isnta(p,"b")) { error("Until expression type must be Boolean, not %s, in repeat statement", nameof(p)); return; } # ifdef OBJ put(2, O_IF, l); # endif OBJ # ifdef PC putleaf( P2ICON , l , 0 , P2INT , 0 ); putop( P2CBRANCH , P2INT ); putdot( filename , line ); # endif PC if (goc != gocnt) putcnt(); } /* * assert expr */ asrtop(r) register int *r; { register struct nl *q; if (opt('s')) { standard(); error("Assert statement is non-standard"); } if (!opt('t')) return; r = r[2]; # ifdef OBJ q = rvalue((int *) r, NLNIL , RREQ ); # endif OBJ # ifdef PC putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_ASRT" ); q = stkrval( r , NLNIL , RREQ ); # endif PC if (q == NIL) return; if (isnta(q, "b")) error("Assert expression must be Boolean, not %ss", nameof(q)); # ifdef OBJ put(1, O_ASRT); # endif OBJ # ifdef PC putop( P2CALL , P2INT ); putdot( filename , line ); # endif PC } is non-standard"); } if (!opt('t')) return; r = r[2]; # ifdef OBJ q = rvalue((int *) r, NLNIL , cmd/pi/stklval.c 644 0 33 744 2552606454 7027 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)stklval.c 1.1 8/27/80"; #include "whoami.h" #include "0.h" #include "tree.h" #include "opcode.h" #include "objfmt.h" /* * Lvalue computes the address * of a qualified name and * leaves it on the stack. */ struct nl * stklval(r, modflag) int *r, modflag; { /* * For the purposes of the interpreter stklval * is the same as an lvalue. */ return(lvalue(r, modflag , LREQ )); } ,"cmd/pi/stkrval.c 644 0 33 16750 2552606454 7101 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)stkrval.c 1.4 3/8/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "opcode.h" #include "objfmt.h" #ifdef PC # include "pcops.h" #endif PC /* * stkrval Rvalue - an expression, and coerce it to be a stack quantity. * * Contype is the type that the caller would prefer, nand is important * if constant sets or constant strings are involved, the latter * because of string padding. */ /* * for the obj version, this is a copy of rvalue hacked to use fancy new * push-onto-stack-and-convert opcodes. * for the pc version, i just call rvalue and convert if i have to, * based on the return type of rvalue. */ struct nl * stkrval(r, contype , required ) register int *r; struct nl *contype; long required; { register struct nl *p; register struct nl *q; register char *cp, *cp1; register int c, w; int **pt; long l; double f; if (r == NIL) return (NIL); if (nowexp(r)) return (NIL); /* * The root of the tree tells us what sort of expression we have. */ switch (r[0]) { /* * The constant nil */ case T_NIL: # ifdef OBJ put(2, O_CON14, 0); # endif OBJ # ifdef PC putleaf( P2ICON , 0 , 0 , P2INT , 0 ); # endif PC return (nl+TNIL); case T_FCALL: case T_VAR: p = lookup(r[2]); if (p == NIL || p->class == BADUSE) return (NIL); switch (p->class) { case VAR: /* * if a variable is * qualified then get * the rvalue by a * stklval and an ind. */ if (r[3] != NIL) goto ind; q = p->type; if (q == NIL) return (NIL); if (classify(q) == TSTR) return(stklval(r, NOFLAGS)); # ifdef OBJ w = width(q); switch (w) { case 8: put(2, O_RV8 | bn << 8+INDX, (int)p->value[0]); return(q); case 4: put(2, O_RV4 | bn << 8+INDX, (int)p->value[0]); return(q); case 2: put(2, O_RV24 | bn << 8+INDX, (int)p->value[0]); return(q); case 1: put(2, O_RV14 | bn << 8+INDX, (int)p->value[0]); return(q); default: put(3, O_RV | bn << 8+INDX, (int)p->value[0], w); return(q); } # endif OBJ # ifdef PC return rvalue( r , contype , required ); # endif PC case WITHPTR: case REF: /* * A stklval for these * is actually what one * might consider a rvalue. */ ind: q = stklval(r, NOFLAGS); if (q == NIL) return (NIL); if (classify(q) == TSTR) return(q); # ifdef OBJ w = width(q); switch (w) { case 8: put(1, O_IND8); return(q); case 4: put(1, O_IND4); return(q); case 2: put(1, O_IND24); return(q); case 1: put(1, O_IND14); return(q); default: put(2, O_IND, w); return(q); } # endif OBJ # ifdef PC if ( required == RREQ ) { putop( P2UNARY P2MUL , p2type( q ) ); } return q; # endif PC case CONST: if (r[3] != NIL) { error("%s is a constant and cannot be qualified", r[2]); return (NIL); } q = p->type; if (q == NIL) return (NIL); if (q == nl+TSTR) { /* * Find the size of the string * constant if needed. */ cp = p->ptr[0]; cstrng: cp1 = cp; for (c = 0; *cp++; c++) continue; w = 0; if (contype != NIL && !opt('s')) { if (width(contype) < c && classify(contype) == TSTR) { error("Constant string too long"); return (NIL); } w = width(contype) - c; } # ifdef OBJ put(2, O_LVCON, lenstr(cp1, w)); putstr(cp1, w); # endif OBJ # ifdef PC putCONG( cp1 , c + w , LREQ ); # endif PC /* * Define the string temporarily * so later people can know its * width. * cleaned out by stat. */ q = defnl(0, STR, 0, c); q->type = q; return (q); } if (q == nl+T1CHAR) { # ifdef OBJ put(2, O_CONC4, (int)p->value[0]); # endif OBJ # ifdef PC putleaf( P2ICON , p -> value[0] , 0 , P2CHAR , 0 ); # endif PC return(q); } /* * Every other kind of constant here */ # ifdef OBJ switch (width(q)) { case 8: #ifndef DEBUG put(2, O_CON8, p->real); return(q); #else if (hp21mx) { f = p->real; conv(&f); l = f.plong; put(2, O_CON4, l); } else put(2, O_CON8, p->real); return(q); #endif case 4: (( put(2, O_CON4, p->range[0]); return(q); case 2: put(2, O_CON24, (short)p->range[0]); return(q); case 1: put(2, O_CON14, p->value[0]); return(q); default: panic("stkrval"); } # endif OBJ # ifdef PC return rvalue( r , contype , required ); # endif PC case FUNC: case FFUNC: /* * Function call */ pt = (int **)r[3]; if (pt != NIL) { switch (pt[1][0]) { case T_PTR: case T_ARGL: case T_ARY: case T_FIELD: error("Can't qualify a function result value"); return (NIL); } } # ifdef OBJ q = p->type; if (classify(q) == TSTR) { c = width(q); put(2, O_LVCON, even(c+1)); putstr("", c); put(1, PTR_DUP); p = funccod(r); put(2, O_AS, c); return(p); } p = funccod(r); if (width(p) <= 2) put(1, O_STOI); # endif OBJ # ifdef PC p = pcfunccod( r ); # endif PC return (p); case TYPE: error("Type names (e.g. %s) allowed only in declarations", p->symbol); return (NIL); case PROC: case FPROC: error("Procedure %s found where expression required", p->symbol); return (NIL); default: panic("stkrvid"); } case T_PLUS: case T_MINUS: case T_NOT: case T_AND: case T_OR: case T_DIVD: case T_MULT: case T_SUB: case T_ADD: case T_MOD: case T_DIV: case T_EQ: case T_NE: case T_GE: case T_LE: case T_GT: case T_LT: case T_IN: p = rvalue(r, contype , required ); # ifdef OBJ if (width(p) <= 2) put(1, O_STOI); # endif OBJ return (p); case T_CSET: p = rvalue(r, contype , required ); return (p); default: if (r[2] == NIL) return (NIL); switch (r[0]) { default: panic("stkrval3"); /* * An octal number */ case T_BINT: f = a8tol(r[2]); goto conint; /* * A decimal number */ case T_INT: f = atof(r[2]); conint: if (f > MAXINT || f < MININT) { error("Constant too large for this implementation"); return (NIL); } l = f; if (bytes(l, l) <= 2) { # ifdef OBJ put(2, O_CON24, (short)l); # endif OBJ # ifdef PC putleaf( P2ICON , (short) l , 0 , P2INT , 0 ); # endif PC return(nl+T4INT); } # ifdef OBJ put(2, O_CON4, l); # endif OBJ # ifdef PC putleaf( P2ICON , l , 0 , P2INT , 0 ); # endif PC return (nl+T4INT); /* * A floating point number */ case T_FINT: # ifdef OBJ put(2, O_CON8, atof(r[2])); # endif OBJ # ifdef PC putCON8( atof( r[2] ) ); # endif PC return (nl+TDOUBLE); /* * Constant strings. Note that constant characters * are constant strings of length one; there is * no constant string of length one. */ case T_STRNG: cp = r[2]; if (cp[1] == 0) { # ifdef OBJ put(2, O_CONC4, cp[0]); # endif OBJ # ifdef PC putleaf( P2ICON , cp[0] , 0 , P2CHAR , 0 ); # endif PC return(nl+T1CHAR); } goto cstrng; } } } tof(r[2])); # endif OBcmd/pi/string.c 644 0 33 4310 2552606454 6666 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)string.c 1.2 11/24/80"; #include "whoami.h" #include "0.h" #ifndef PI01 #ifndef PXP #include "send.h" #endif #endif /* * STRING SPACE DECLARATIONS * * Strng is the base of the current * string space and strngp the * base of the free area therein. * Strp is the array of descriptors. */ #ifndef PI0 STATIC char strings[STRINC]; STATIC char *strng = strings; STATIC char *strngp = strings; #else char *strng, *strngp; #endif #ifndef PI01 #ifndef PXP STATIC char *strp[20]; STATIC char **stract strp; int strmax; #endif #endif #ifndef PI01 #ifndef PXP #ifndef PI0 initstring() #else initstring(strings) char *strings; #endif { *stract++ = strings; #ifdef PI0 strng = strngp = strings; #endif strmax = STRINC * 2; } #endif #endif /* * Copy a string into the string area. */ char * savestr(cp) register char *cp; { register int i; i = strlen(cp) + 1; if (strngp + i >= strng + STRINC) { strngp = malloc(STRINC); if (strngp == 0) { yerror("Ran out of memory (string)"); pexit(DIED); } #ifndef PI01 #ifndef PXP *stract++ = strngp; strmax =+ STRINC; #endif #endif strng = strngp; } strcpy(strngp, cp); cp = strngp; strngp = cp + i; #ifdef PI0 send(RSTRING, cp); #endif return (cp); } #ifndef PI1 #ifndef PXP esavestr(cp) char *cp; { #ifdef PI0 send(REVENIT); #endif strngp = ( (char *) ( ( (int) (strngp + 1) ) &~ 1 ) ); return (savestr(cp)); } #endif #endif #ifndef PI01 #ifndef PXP soffset(cp) register char *cp; { register char **sp; register int i; if (cp == NIL || cp == OCT || cp == HEX) return (-cp); for (i = STRINC, sp = strp; sp < stract; sp++) { if (cp >= *sp && cp < (*sp + STRINC)) return (i + (cp - *sp)); i =+ STRINC; } i = nlfund(cp); if (i != 0) return (i); panic("soffset"); } #ifdef PI1 sreloc(i) register int i; { if (i == 0 || i == -OCT || i == -HEX) return (-i); if (i < STRINC) { if (i >= INL) panic("sreloc INL"); i = nl[i].symbol; if (i == 0) panic("sreloc nl[i]"); return (i); } if (i > strmax || i < 0) panic("sreloc"); return (strp[(i / STRINC) - 1] + (i % STRINC)); } evenit() { strngp = (strngp + 1) &~ 1; } #endif #endif #endif STRINC)) return (i + (cp - *sp)); i =+ STRINC; } i = nlfund(cp); if (i != 0) return (i); panic("soffset"); } #ifdef PI1 sreloc(i) register int i; { if (i == 0 || i == -OCT || i == -HEX) return (-i); if (i < STRINC) { if (i >= INL) panic("sreloc INL"); i = nl[i].symbol; if (i == 0) pcmd/pi/subr.c 644 0 33 5445 2552606454 6345 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)subr.c 1.4 11/24/80"; #include "whoami.h" #include "0.h" #ifndef PI1 /* * Does the string fp end in '.' and the character c ? */ dotted(fp, c) register char *fp; char c; { register int i; i = strlen(fp); return (i > 1 && fp[i - 2] == '.' && fp[i - 1] == c); } /* * Toggle the option c. */ togopt(c) char c; { register char *tp; tp = &opt( c ); *tp = 1 - *tp; } /* * Set the time vector "tvec" to the * modification time stamp of a file. */ gettime( filename ) char *filename; { #include struct stat stb; stat(filename, &stb); tvec = stb.st_mtime; } /* * Convert a "ctime" into a Pascal styple time line */ char * myctime(tv) int *tv; { register char *cp, *dp; char *cpp; register i; static char mycbuf[26]; cpp = ctime(tv); dp = mycbuf; cp = cpp; cpp[16] = 0; while (*dp++ = *cp++); dp--; cp = cpp+19; cpp[24] = 0; while (*dp++ = *cp++); return (mycbuf); } /* * Is "fp" in the command line list of names ? */ inpflist(fp) char *fp; { register i, *pfp; pfp = pflist; for (i = pflstc; i > 0; i--) if (strcmp(fp, *pfp++) == 0) return (1); return (0); } #endif extern int errno; extern char *sys_errlist[]; /* * Boom! */ Perror(file, error) char *file, *error; { fprintf( stderr , "%s: %s\n" , file , error ); } int * calloc(num, size) int num, size; { register int p1, *p2, nbyte; nbyte = (num*size+( ( sizeof ( int ) ) - 1 ) ) & ~( ( sizeof ( int ) ) - 1 ); if ((p1 = malloc(nbyte)) == 0) return (0); p2 = p1; nbyte /= sizeof ( int ); do { *p2++ = 0; } while (--nbyte); return (p1); } /* * Compare strings: s1>s2: >0 s1==s2: 0 s1>= 1; #ifdef PI0 send(ROPOP, c); #endif } m; register int bytes; { if (bytes != 0) do *to++ = *from++; while (--bytes); } /* * Is ch one of the characters in the string cp ? */ any(cp, ch) register char *cp; char ch; { while (*cp) if (*cp++ =cmd/pi/tmps.c 644 0 33 4372 2552606455 6354 ((/* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)tmps.c 1.5 6/1/81"; #include "whoami.h" #include "0.h" #ifdef PC # include "pc.h" #endif PC /* * This routine defines the register allocation strategy * All temporaries are allocated here, and this routines decides * where they are to be put. */ #ifdef PC #ifdef VAX # define MAXREGS 6 # define MINREGSIZE 4 # define MAXREGSIZE 4 # define FIRSTREG 6 #else #ifdef PDP11 # define MAXREGS 3 # define MINREGSIZE 2 # define MAXREGSIZE 2 # define FIRSTREG 2 #else # define MAXREGS 0 # define MINREGSIZE 0 # define MAXREGSIZE 0 # define FIRSTREG 0 #endif PDP11 #endif VAX #endif PC /* * allocate runtime temporary variables */ struct nl * tmpalloc(size, type, mode) long size; struct nl *type; int mode; { register struct om *op = &sizes[ cbn ]; register int offset; register struct nl *nlp; # ifdef PC if (mode == REGOK && size >= MINREGSIZE && size <= MAXREGSIZE && op->curtmps.reg_off < MAXREGS) { offset = op->curtmps.reg_off++; if ( offset > op->reg_max ) { op->reg_max = offset; } nlp = defnl( 0 , VAR , type , offset + FIRSTREG ); nlp -> extra_flags = NLOCAL | NREGVAR; return nlp; } # endif PC offset = op->curtmps.om_off -= leven( size ); if ( offset < op->om_max ) { op->om_max = offset; } nlp = defnl( 0 , VAR , type , offset ); # ifdef PC nlp -> extra_flags = NLOCAL; putlbracket( ftnno , -offset ); # endif PC return nlp; } /* * deallocate runtime temporary variables */ tmpfree(restore) register struct tmps *restore; { register struct om *op = &sizes[ cbn ]; # ifdef PC if (restore->reg_off < op->curtmps.reg_off) { op->curtmps.reg_off = restore->reg_off; } # endif PC if (restore->om_off > op->curtmps.om_off) { op->curtmps.om_off = restore->om_off; # ifdef PC putlbracket( ftnno , -restore->om_off ); # endif PC } } #ifdef PC #ifdef VAX /* * create a save mask for registers which have been used * in this level */ savmask() { int mask; int i; mask = RSAVEMASK; if (opt('t')) mask |= RUNCHECK; for (i = 0; i <= sizes[ cbn ].reg_max; i++) mask |= 1 << (FIRSTREG + i); return mask; } #endif VAX #endif PC ff = restore->reg_off; } # endif PC if (restore->om_off > op->curtmps.om_off) { op->curtmps.om_off = restore->om_off; # ifdef PC putlbracket( ftnno , -restore->om_off ); # endif PC } } #ifdef PC #ifdef VAX /* * create a save mask for registercmd/pi/tree.c 644 0 33 6622 2552606455 6330 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)tree.c 1.2 11/24/80"; #include "whoami.h" #include "0.h" /* * TREE SPACE DECLARATIONS */ struct tr { int *tr_low; int *tr_high; } ttab[MAXTREE], *tract; /* * The variable space is the * absolute base of the tree segments. * (exactly the same as ttab[0].tr_low) * Spacep is maintained to point at the * beginning of the next tree slot to * be allocated for use by the grammar. * Spacep is used "extern" by the semantic * actions in pas.y. * The variable tract is maintained to point * at the tree segment out of which we are * allocating (the active segment). */ int *space, *spacep; /* * TREENMAX is the maximum width * in words that any tree node * due to the way in which the parser uses * the pointer spacep. */ #define TREENMAX 6 int trspace[ITREE]; int *space = trspace; int *spacep = trspace; struct tr *tract = ttab; /* * Inittree allocates the first tree slot * and sets up the first segment descriptor. * A lot of this work is actually done statically * above. */ inittree() { ttab[0].tr_low = space; ttab[0].tr_high = &space[ITREE]; } /* * Tree builds the nodes in the * parse tree. It is rarely called * directly, rather calls are made * to tree[12345] which supplies the * first argument to save space in * the code. Tree also guarantees * that spacep points to the beginning * of the next slot it will return, * a property required by the parser * which was always true before we * segmented the tree space. */ int *tree(cnt, a) int cnt; { register int *p, *q; register int i; i = cnt; p = spacep; q = &a; do *p++ = *q++; while (--i); q = spacep; spacep = p; if (p+TREENMAX >= tract->tr_high) /* * this peek-ahead should * save a great number of calls * to tralloc. */ tralloc(TREENMAX); return (q); } /* * Tralloc preallocates enough * space in the tree to allow * the grammar to use the variable * spacep, as it did before the * tree was segmented. */ tralloc(howmuch) { register char *cp; register i; if (spacep + howmuch >= tract->tr_high) { i = TRINC; cp = malloc(i * sizeof ( int )); if (cp == 0) { yerror("Ran out of memory (tralloc)"); pexit(DIED); } spacep = cp; tract++; if (tract >= &ttab[MAXTREE]) { yerror("Ran out of tree tables"); pexit(DIED); } tract->tr_low = cp; tract->tr_high = tract->tr_low+i; } } extern int yylacnt; extern bottled; #ifdef PXP #endif /* * Free up the tree segments * at the end of a block. * If there is scanner lookahead, * i.e. if yylacnt != 0 or there is bottled output, then we * cannot free the tree space. * This happens only when errors * occur and the forward move extends * across "units". */ trfree() { if (yylacnt != 0 || bottled != NIL) return; #ifdef PXP if (needtree()) return; #endif spacep = space; while (tract->tr_low > spacep || tract->tr_high <= spacep) { free(tract->tr_low); tract->tr_low = NIL; tract->tr_high = NIL; tract--; if (tract < ttab) panic("ttab"); } #ifdef PXP packtree(); #endif } /* * Copystr copies a token from * the "token" buffer into the * tree space. */ copystr(token) register char *token; { register char *cp; register int i; i = (strlen(token) + sizeof ( int )) & ~( ( sizeof ( int ) ) - 1 ); tralloc(i / sizeof ( int )); strcpy(spacep, token); cp = spacep; spacep = cp + i; tralloc(TREENMAX); return (cp); } { free(tract->tr_low); tract->tr_low = NIL; tract->tr_high = NIL; tract--; if (tract < ttab) pancmd/pi/tree.h 644 0 33 3066 2552606455 6334 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)tree.h 1.1 8/27/80"; */ #define T_MINUS 1 #define T_MOD 2 #define T_DIV 3 #define T_DIVD 4 #define T_MULT 5 #define T_ADD 6 #define T_SUB 7 #define T_EQ 8 #define T_NE 9 #define T_LT 10 #define T_GT 11 #define T_LE 12 #define T_GE 13 #define T_NOT 14 #define T_AND 15 #define T_OR 16 #define T_ASGN 17 #define T_PLUS 18 #define T_IN 19 #define T_LISTPP 20 #define T_PDEC 21 #define T_FDEC 22 #define T_PVAL 23 #define T_PVAR 24 #define T_PFUNC 25 #define T_PPROC 26 #define T_NIL 27 #define T_STRNG 28 #define T_CSTRNG 29 #define T_PLUSC 30 #define T_MINUSC 31 #define T_ID 32 #define T_INT 33 #define T_FINT 34 #define T_CINT 35 #define T_CFINT 36 #define T_TYPTR 37 #define T_TYPACK 38 #define T_TYSCAL 39 #define T_TYRANG 40 #define T_TYARY 41 #define T_TYFILE 42 #define T_TYSET 43 #define T_TYREC 44 #define T_TYFIELD 45 #define T_TYVARPT 46 #define T_TYVARNT 47 #define T_CSTAT 48 #define T_BLOCK 49 #define T_BSTL 50 #define T_LABEL 51 #define T_PCALL 52 #define T_FCALL 53 #define T_CASE 54 #define T_WITH 55 #define T_WHILE 56 #define T_REPEAT 57 #define T_FORU 58 #define T_FORD 59 #define T_GOTO 60 #define T_IF 61 #define T_ASRT 62 #define T_CSET 63 #define T_RANG 64 #define T_VAR 65 #define T_ARGL 66 #define T_ARY 67 #define T_FIELD 68 #define T_PTR 69 #define T_WEXP 70 #define T_PROG 71 #define T_BINT 72 #define T_CBINT 73 #define T_IFEL 74 #define T_IFX 75 #define T_TYID 76 #define T_COPSTR 77 #define T_BOTTLE 78 #define T_RFIELD 79 #define T_FLDLST 80 #define T_LAST 81 #define T_CASE 54 #define T_WITH 55 #define T_WHILE 56 #define T_REPEAT 57 #define T_FORU 58 #define T_FORD 59 #define T_GOTO 60 #define T_IF 61 #define T_ASRT 62 #define T_CSET 63 #define T_RANG 64 #define T_VAR 65 #define T_ARGL 66 #define T_ARY 67 #define T_FIELD 68 #define T_PTR 69 #define T_WEXP 70 #define T_PROG 71 #define T_BINT 72 #define T_CBINT 73 #define T_IFEL 74 #define T_IFX 75 #define T_TYID 76 #define T_COPSTR 77 #define T_BOTTLE 78 #defcmd/pi/treen.c 644 0 33 1311 2552606455 6474 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)treen.c 1.1 8/27/80"; /* * is there some reason why these aren't #defined? */ tree1 ( arg1 ) int arg1; { tree ( 1 , arg1 ); } tree2 ( arg1 , arg2 ) int arg1 , arg2; { tree ( 2 , arg1 , arg2 ); } tree3 ( arg1 , arg2 , arg3 ) int arg1 , arg2 , arg3; { tree ( 3 , arg1 , arg2 , arg3 ); } tree4 ( arg1 , arg2 , arg3 , arg4 ) int arg1 , arg2 , arg3 , arg4; (( { tree ( 4 , arg1 , arg2 , arg3 , arg4 ); } tree5 ( arg1 , arg2 , arg3 , arg4 , arg5 ) int arg1 , arg2 , arg3 , arg4 , arg5; { tree ( 5 , arg1 , arg2 , arg3 , arg4 , arg5 ); } ) int arg1; { tree ( 1 , arg1 ); } tree2 ( arg1 , arg2 ) int arg1 , arg2; { tree ( 2 , arg1 , arg2 ); } tree3 ( arg1 , arg2 , arg3 ) int arg1 , arg2 , arg3; { tree ( 3 , arg1 , arg2 , arg3 ); } tree4 ( arg1 , arg2 , arg3 , arg4 ) int arg1 , arg2 , arg3 , arg4; cmd/pi/type.c 644 0 33 15722 2552606456 6374 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)type.c 1.6 3/8/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "objfmt.h" /* * Type declaration part */ typebeg() { /* * this allows for multiple * declaration parts unless * standard option has been * specified. * If routine segment is being * compiled, do level one processing. */ #ifndef PI1 if (!progseen) level1(); if ( parts[ cbn ] & ( VPRT | RPRT ) ) { if ( opt( 's' ) ) { standard(); } else { warning(); } error("Type declarations should precede var and routine declarations"); } if (parts[ cbn ] & TPRT) { if ( opt( 's' ) ) { standard(); } else { warning(); } error("All types should be declared in one type part"); } parts[ cbn ] |= TPRT; #endif /* * Forechain is the head of a list of types that * might be self referential. We chain them up and * process them later. */ forechain = NIL; #ifdef PI0 send(REVTBEG); #endif } type(tline, tid, tdecl) int tline; char *tid; register int *tdecl; { register struct nl *np; np = gtype(tdecl); line = tline; #ifndef PI0 enter(defnl(tid, TYPE, np, 0))->nl_flags |= NMOD; #else enter(defnl(tid, TYPE, np, 0)); send(REVTYPE, tline, tid, tdecl); #endif #ifdef PC if (cbn == 1) { stabgtype( tid , line ); } #endif PC # ifdef PTREE { pPointer Type = TypeDecl( tid , tdecl ); pPointer *Types; pSeize( PorFHeader[ nesting ] ); Types = &( pDEF( PorFHeader[ nesting ] ).PorFTypes ); *Types = ListAppend( *Types , Type ); pRelease( PorFHeader[ nesting ] ); } # endif } typeend() { #ifdef PI0 send(REVTEND); #endif foredecl(); } /* * Return a type pointer (into the namelist) * from a parse tree for a type, building * namelist entries as needed. */ struct nl * gtype(r) register int *r; { register struct nl *np; register char *cp; register int oline; long w; if (r == NIL) return (NIL); oline = line; if (r[0] != T_ID) oline = line = r[1]; switch (r[0]) { default: panic("type"); case T_TYID: r++; case T_ID: np = lookup(r[1]); if (np == NIL) break; if (np->class != TYPE) { #ifndef PI1 error("%s is a %s, not a type as required", r[1], classes[np->class]); #endif np = NIL; break; } np = np->type; break; case T_TYSCAL: np = tyscal(r); break; case T_TYRANG: np = tyrang(r); break; case T_TYPTR: np = defnl(0, PTR, 0, 0 ); np -> ptr[0] = r[2]; np->nl_next = forechain; forechain = np; break; case T_TYPACK: np = gtype(r[2]); break; case T_TYARY: np = tyary(r); break; case T_TYREC: np = tyrec(r[2], 0); # ifdef PTREE /* * mung T_TYREC[3] to point to the record * for RecTCopy */ r[3] = np; # endif break; case T_TYFILE: np = gtype(r[2]); if (np == NIL) break; #ifndef PI1 if (np->nl_flags & NFILES) error("Files cannot be members of files"); #endif np = defnl(0, FILET, np, 0); np->nl_flags |= NFILES; break; case T_TYSET: np = gtype(r[2]); if (np == NIL) break; if (np->type == nl+TDOUBLE) { #ifndef PI1 error("Set of real is not allowed"); #endif np = NIL; break; } if (np->class != RANGE && np->class != SCAL) { #ifndef PI1 error("Set type must be range or scalar, not %s", nameof(np)); #endif np = NIL; break; } #ifndef PI1 if (width(np) > 2) error("Implementation restriction: sets must be indexed by 16 bit quantities"); #endif np = defnl(0, SET, np, 0); break; } line = oline; w = lwidth(np); #ifndef PC if (w >= TOOMUCH) { error("Storage requirement of %s exceeds the implementation limit of %D by %D bytes", nameof(np), (long)(TOOMUCH-1), (long)(w-TOOMUCH+1)); np = NIL; } #endif return (np); } /* * Scalar (enumerated) types */ tyscal(r) int *r; { register struct nl *np, *op, *zp; register *v; int i; np = defnl(0, SCAL, 0, 0); np->type = np; v = r[2]; if (v == NIL) return (NIL); i = -1; zp = np; for (; v != NIL; v = v[2]) { op = enter(defnl(v[1], CONST, np, ++i)); #ifndef PI0 op->nl_flags |= NMOD; #endif op->value[1] = i; zp->chain = op; zp = op; } np->range[1] = i; return (np); } /* * Declare a subrange. */ tyrang(r) register int *r; { register struct nl *lp, *hp; double high; int c, c1; gconst(r[3]); hp = con.ctype; high = con.crval; gconst(r[2]); lp = con.ctype; if (lp == NIL || hp == NIL) return (NIL); if (norange(lp) || norange(hp)) return (NIL); c = classify(lp); c1 = classify(hp); if (c != c1) { #ifndef PI1 error("Can't mix %ss and %ss in subranges", nameof(lp), nameof(hp)); #endif return (NIL); } if (c == TSCAL && scalar(lp) != scalar(hp)) { #ifndef PI1 error("Scalar types must be identical in subranges"); #endif return (NIL); } if (con.crval > high) { #ifndef PI1 error("Range lower bound exceeds upper bound"); #endif return (NIL); } lp = defnl(0, RANGE, hp->type, 0); lp->range[0] = con.crval; lp->range[1] = high; return (lp); } norange(p) register struct nl *p; { if (isa(p, "d")) { #ifndef PI1 error("Subrange of real is not allowed"); #endif return (1); } if (isnta(p, "bcsi")) { #ifndef PI1 error("Subrange bounds must be Boolean, character, integer or scalar, not %s", nameof(p)); #endif return (1); } return (0); } /* * Declare arrays and chain together the dimension specification */ struct nl * tyary(r) int *r; { struct nl *np; register *tl; register struct nl *tp, *ltp; int i; tp = gtype(r[3]); if (tp == NIL) return (NIL); np = defnl(0, ARRAY, tp, 0); np->nl_flags |= (tp->nl_flags) & NFILES; ltp = np; i = 0; for (tl = r[2]; tl != NIL; tl = tl[2]) { tp = gtype(tl[1]); if (tp == NIL) { np = NIL; continue; } if (tp->class == RANGE && tp->type == nl+TDOUBLE) { #ifndef PI1 error("Index type for arrays cannot be real"); #endif np = NIL; continue; } if (tp->class != RANGE && tp->class != SCAL) { #ifndef PI1 error("Array index type is a %s, not a range or scalar as required", classes[tp->class]); #endif np = NIL; continue; } #ifndef PC if (tp->class == RANGE && bytes(tp->range[0], tp->range[1]) > 2) { #ifndef PI1 error("Value of dimension specifier too large or small for this implementation"); #endif continue; } #endif tp = nlcopy(tp); i++; ltp->chain = tp; ltp = tp; } if (np != NIL) np->value[0] = i; return (np); } /* * Delayed processing for pointers to * allow self-referential and mutually * recursive pointer constructs. */ foredecl() { register struct nl *p, *q; for (p = forechain; p != NIL; p = p->nl_next) { if (p->class == PTR && p -> ptr[0] != 0) { p->type = gtype(p -> ptr[0]); #ifndef PI1 if (p->type != NIL && ( ( p->type )->nl_flags & NFILES)) error("Files cannot be members of dynamic structures"); #endif # ifdef PTREE { if ( pUSE( p -> inTree ).PtrTType == pNIL ) { pPointer PtrTo = tCopy( p -> ptr[0] ); pDEF( p -> inTree ).PtrTType = PtrTo; } } # endif p -> ptr[0] = 0; } } } { register struct nl *p, *q; for (p = foreccmd/pi/var.c 644 0 33 17630 2552606456 6203 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)var.c 1.10 7/8/81"; #include "whoami.h" #include "0.h" #include "align.h" #include "iorec.h" #ifdef PC # include "pc.h" # include "pcops.h" #endif PC /* * Declare variables of a var part. DPOFF1 is * the local variable storage for all prog/proc/func * modules aside from the block mark. The total size * of all the local variables is entered into the * size array. */ varbeg() { /* this allows for multiple declaration * parts except when the "standard" * option has been specified. * If routine segment is being compiled, * do level one processing. */ #ifndef PI1 if (!progseen) level1(); if ( parts[ cbn ] & RPRT ) { if ( opt( 's' ) ) { standard(); } else { warning(); } error("Variable declarations should precede routine declarations"); } if ( parts[ cbn ] & VPRT ) { if ( opt( 's' ) ) { standard(); } else { warning(); } error("All variables should be declared in one var part"); } parts[ cbn ] |= VPRT; #endif /* * #ifndef PI0 * sizes[cbn].om_max = sizes[cbn].curtmps.om_off = -DPOFF1; * #endif */ forechain = NIL; #ifdef PI0 send(REVVBEG); #endif } var(vline, vidl, vtype) #ifdef PI0 int vline, *vidl, *vtype; { register struct nl *np; register int *vl; np = gtype(vtype); line = vline; for (vl = vidl; vl != NIL; vl = vl[2]) { } } send(REVVAR, vline, vidl, vtype); } #else int vline; register int *vidl; int *((vtype; { register struct nl *np; register struct om *op; long w; int o2; int *ovidl = vidl; struct nl *vp; np = gtype(vtype); line = vline; w = lwidth(np); op = &sizes[cbn]; for (; vidl != NIL; vidl = vidl[2]) { # ifdef OBJ op->curtmps.om_off = roundup((int)(op->curtmps.om_off-w), (long)align(np)); o2 = op -> curtmps.om_off; # endif OBJ # ifdef PC if ( cbn == 1 ) { /* * global variables are not accessed off the fp * but rather by their names. */ o2 = 0; } else { /* * locals are aligned, too. */ op->curtmps.om_off = roundup((int)(op->curtmps.om_off - w), (long)align(np)); o2 = op -> curtmps.om_off; } # endif PC vp = enter(defnl(vidl[1], VAR, np, o2)); if ( np -> nl_flags & NFILES ) { dfiles[ cbn ] = TRUE; } # ifdef PC if ( cbn == 1 ) { putprintf( " .data" , 0 ); putprintf( " .align %d" , 0 , dotalign(align(np))); putprintf( " .comm " , 1 ); putprintf( EXTFORMAT , 1 , vidl[1] ); putprintf( ",%d" , 0 , w ); putprintf( " .text" , 0 ); stabgvar( vidl[1] , p2type( np ) , o2 , w , line ); vp -> extra_flags |= NGLOBAL; } else { vp -> extra_flags |= NLOCAL; } # endif PC } # ifdef PTREE { pPointer *Vars; pPointer Var = VarDecl( ovidl , vtype ); pSeize( PorFHeader[ nesting ] ); Vars = &( pDEF( PorFHeader[ nesting ] ).PorFVars ); *Vars = ListAppend( *Vars , Var ); pRelease( PorFHeader[ nesting ] ); } # endif } #endif varend() { foredecl(); #ifndef PI0 sizes[cbn].om_max = sizes[cbn].curtmps.om_off; #else send(REVVEND); #endif } /* * Evening */ long leven(w) register long w; { if (w < 0) return (w & 0xfffffffe); return ((w+1) & 0xfffffffe); } int even(w) register int w; { return leven((long)w); } /* * Find the width of a type in bytes. */ width(np) struct nl *np; { return (lwidth(np)); } long lwidth(np) struct nl *np; { register struct nl *p; long w; p = np; if (p == NIL) return (0); loop: switch (p->class) { case TYPE: switch (nloff(p)) { case TNIL: return (2); case TSTR: case TSET: panic("width"); default: p = p->type; goto loop; } case ARRAY: return (aryconst(p, 0)); case PTR: return ( sizeof ( int * ) ); case FILET: return ( sizeof(struct iorec) + lwidth( p -> type ) ); case RANGE: if (p->type == nl+TDOUBLE) #ifdef DEBUG return (hp21mx ? 4 : 8); #else return (8); #endif case SCAL: return (bytes(p->range[0], p->range[1])); case SET: setran(p->type); return roundup((int)((set.uprbp >> 3) + 1), (long)(A_SET)); case STR: case RECORD: return ( p->value[NL_OFFS] ); default: panic("wclass"); } } /* * round up x to a multiple of y * for computing offsets of aligned things. * y had better be positive. * rounding is in the direction of x. */ long roundup( x , y ) int x; register long y; { if ( y == 0 ) { return 0; } if ( x >= 0 ) { return ( ( ( x + ( y - 1 ) ) / y ) * y ); } else { return ( ( ( x - ( y - 1 ) ) / y ) * y ); } } /* * alignment of an object using the c alignment scheme */ int align( np ) struct nl *np; { register struct nl *p; p = np; if ( p == NIL ) { return 0; } alignit: switch ( p -> class ) { case TYPE: switch ( nloff( p ) ) { case TNIL: return A_POINT; case TSTR: return A_CHAR; case TSET: return A_SET; default: p = p -> type; goto alignit; } case ARRAY: /* * arrays are aligned as their component types */ p = p -> type; goto alignit; case PTR: return A_POINT; case FILET: return A_FILET; case RANGE: if ( p -> type == nl+TDOUBLE ) { return A_DOUBLE; } /* else, fall through */ case SCAL: switch ( bytes( p -> range[0] , p -> range[1] ) ) { case 4: return A_LONG; case 2: return A_SHORT; case 1: return A_CHAR; default: panic( "align: scal" ); } case SET: return A_SET; case STR: return A_CHAR; case RECORD: /* * follow chain through all fields in record, * taking max of alignments of types of fields. * short circuit out if i reach the maximum alignment. * this is pretty likely, as A_MAX is only 4. */ { register long recalign; register long fieldalign; recalign = A_MIN; p = p -> chain; while ( ( p != NIL ) && ( recalign < A_MAX ) ) { fieldalign = align( p -> type ); if ( fieldalign > recalign ) { recalign = fieldalign; } p = p -> chain; } return recalign; } default: panic( "align" ); } } /* * given an alignment, return power of two for .align pseudo-op */ dotalign( alignment ) int alignment; { switch ( alignment ) { case A_CHAR: /* * also * A_STRUCT */ return 0; case A_SHORT: return 1; case A_LONG: /* * also * A_POINT, A_INT, A_FLOAT, A_DOUBLE, * A_STACK, A_FILET, A_SET */ return 2; } } /* * Return the width of an element * of a n time subscripted np. */ long aryconst(np, n) struct nl *np; int n; { register struct nl *p; long s, d; if ((p = np) == NIL) return (NIL); if (p->class != ARRAY) panic("ary"); s = lwidth(p->type); /* * Arrays of anything but characters are word aligned. */ if (s & 1) if (s != 1) s++; /* * Skip the first n subscripts */ while (n >= 0) { p = p->chain; n--; } /* * Sum across remaining subscripts. */ while (p != NIL) { if (p->class != RANGE && p->class != SCAL) panic("aryran"); d = p->range[1] - p->range[0] + 1; s *= d; p = p->chain; } return (s); } /* * Find the lower bound of a set, and also its size in bits. */ setran(q) struct nl *q; { register lb, ub; register struct nl *p; p = q; if (p == NIL) return (NIL); lb = p->range[0]; ub = p->range[1]; if (p->class != RANGE && p->class != SCAL) panic("setran"); set.lwrb = lb; /* set.(upperbound prime) = number of bits - 1; */ set.uprbp = ub-lb; } /* * Return the number of bytes required to hold an arithmetic quantity */ bytes(lb, ub) long lb, ub; { #ifndef DEBUG if (lb < -32768 || ub > 32767) return (4); else if (lb < -128 || ub > 127) return (2); #else if (!hp21mx && (lb < -32768 || ub > 32767)) return (4); if (lb < -128 || ub > 127) return (2); #endif else return (1); } ge[1]; if (p->class != RANGE && p->class != SCAL) panic("setran"); set.lwrb = lb; /* set.(upperbouncmd/pi/version.c 644 0 33 766 2552606456 7042 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)version.c 1.1 8/27/80"; /* * this writes the declaration of the character string version * onto standard output. * useful for makeing Version.c give the correct date for pi. */ #include char *ctime(); long clock; char *cstring; main() { time( &clock ); cstring = ctime( &clock ); cstring[ 24 ] = '\0'; printf( "char version[] = \"%s\";\n" , cstring ); } "cmd/pi/whoami.h 644 0 33 1041 2552606457 6652 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)piwhoami.h 1.2 3/6/81"; */ /* * am i generating an obj file (OBJ), * postfix binary input to the 2nd pass of the portable c compiler (PC), * or pTrees (PTREE)? */ #define OBJ #undef PC #undef PTREE /* * am i the vax or the pdp11 version */ #define VAX #undef PDP11 #define DEC11 /* * am i pi or pxp? */ #define PI #undef PXP /* * am i both passes, or am i only one of the two passes pi0 or pi1? */ #define PI01 #undef PI0 #undef PI1 the University of California */ /* static char sccsid[] = "@(#)piwhoami.h 1.2 3/6/81"; */ /* * am i generating an obj file (OBJ), * postfix binary input to the 2nd pass of the portable c compiler (PC), * or pTrees (PTREE)? */ #define OBJ #undef PC #undef PTREE /* * am i the vax or the pdp11 version */ #define VAX #undef PDP11 #define DEC11 /* * am i pi or pxp? */ #define PI #undef PXP /* * am i both passes, or am i only one of the two passes pi0 or pi1? */ #decmd/pi/yy.h 644 0 33 15036 2552606457 6060 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)yy.h 1.1 8/27/80"; */ #include "y.tab.h" /* * INPUT/OUTPUT */ /* * The buffer for the input file is normally "ibuf". * When files are included, however, this may be * pushed down in the stack of currently active * files. For this reason, the pointer ibp always * references the i/o buffer of the current input file. */ FILE *ibuf, *ibp; /* * Line and token buffers. Charbuf is the character buffer fo((r * input lines, token the buffer for tokens returned * by the scanner. CBSIZE defines the maximum line * length allowed on input and is doubtless too small. * The token buffer should be a local array in yylex. */ #define CBSIZE 161 char charbuf[CBSIZE], *bufp, token[CBSIZE]; #define digit(c) (c >= '0' && c <= '9') #define alph(c) ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) /* * Flag to prevent reprinting current line after * an error. */ char yyprtd; /* * The following variables are maintained by * the scanner in the file lex and used in scanning * and in parsing. * * The variable yychar is the current scanner character. * Currently, the scanner must be called as * yychar = yylex() * even though it should set yychar itself. * Yychar has value YEOF at end of file, and negative value if * there is no yychar, e.g. after a shift in the parser. * * The variable yycol is the current column in the line whose number * is given by yyline. Yyecol and yyeline give the position for an * error message to flag, usually the start of an input token. * Yylval is the semantic return from the scanner. * * In fact all of these variables are "per token". * In the usual case, only the copies in the scanner token structure * 'Y' are used, and the #defines below serve to make them look * like variables. * * For the purposes of the error recovery, however, they are copied * and restored quite freely. For the error recovery also, the * file name which the input line this token is on and the seek * pointer of this line in its source file are saved as yyefile * and yyseekp. The global variable yylinpt is the seek pointer * of the current input line. */ int yycol; int yyline; int yyseqid; int yysavc; int yylinpt; /* *** NOTE *** * It would be much better to not have the Yyeline and Yyefile * in the scanner structure and to have a mechanism for mapping * seqid's to these globally. */ struct yytok { int Yychar; int Yylval; int Yyecol; int Yyeline; int Yyseekp; char *Yyefile; int Yyeseqid; } Y, OY; #define yychar Y.Yychar #define yylval Y.Yylval #define yyecol Y.Yyecol #define yyeline Y.Yyeline #define yyseekp Y.Yyseekp #define yyefile Y.Yyefile #define yyeseqid Y.Yyeseqid /* * Yyval is the semantic value returned by a reduction. * It is what "$$" is expanded to by yacc. */ int *Ps, *yyval; /* * N is the length of a reduction. * Used externally by "lineof" to get the left and * right margins for a reduction. */ int N; /* * Definitions for looking up keywords. * The keyword array is called yykey, and * lastkey points at the end of it. */ char *lastkey; struct kwtab { char *kw_str; int kw_val; } yykey[]; /* * ERROR RECOVERY EXTERNALS */ #define CLIMIT 40 /* see yyrecover.c */ char *tokname(); char *charname(); char *classes[]; /* * Tokens which yacc doesn't define */ #define YEOF 0 #define ERROR 256 /* * Limit on the number of syntax errors */ #define MAXSYNERR 100 /* * Big costs */ #define HUGE 50 #define INFINITY 100 /* * Kinds of panics */ #define PDECL 0 #define PSTAT 1 #define PEXPR 2 #define PPROG 3 #define yyresume() yyResume = 1; char yyResume; char dquote; char errout; /* * Yyidwant and yyidhave are the namelist classes * of identifiers associated with a identifier reduce * error, set before the recovery is called. * Since they may be set again during the forward move * they must be saved by yyrecover, which uses them in printing * error messages. */ int yyidhave, yyidwant; /* * The variables yy*shifts are used to prevent looping and the printing * of spurious messages in the parser. Yyshifts gives the number of * true input shifts since the last corrective action. YyOshifts * is the value of yyshifts before it was last cleared, and is used * by yyPerror in yypanic.c to suppress messages. * * Yytshifts counts true input shifts. It is used to prevent looping * inserting unique symbols. If yytshifts == yyTshifts (local to * yyrecover.c) then there has been no shift over true input since * the last unique symbol insertion. We refuse, in this case, * to insert more unique symbols so as to prevent looping. * * The recovery cannot loop because it guarantees the progress of the * parse, i.e.: * * 1) Any insertion guarantees to shift over 2 symbols, a replacement * over one symbol. * * 2) Unique symbol insertions are limited to one for each true * symbol of input, or "safe" insertion of the keywords "end" * and "until" at zero cost (safe since these are know to match * stack that cannot have been generated - e.g. "begin" or "repeat") * * 3) We never panic more than once from a given state without * shifting over input, i.e. we force the parse stack to shrink * after each unsuccessful panic. */ int yyshifts, yyOshifts; unsigned yytshifts; #ifdef PXP /* * Identifier class definitions */ #define UNDEF 0 #define CONST 1 #define TYPE 2 #define VAR 3 #define ARRAY 4 #define PTRFILE 5 #define RECORD 6 #define FIELD 7 #define PROC 8 #define FUNC 9 #define FVAR 10 #define REF 11 #define PTR 12 #define FILET 13 #define SET 14 #define RANGE 15 #define LABEL 16 #define WITHPTR 17 #define SCAL 18 #define STR 19 #define PROG 20 #define IMPROPER 21 /* * COMMENT FORMATTING DEFINITIONS */ /* * Count of tokens on this input line * Note that this can be off if input is not syntactically correct. */ int yytokcnt; int yywhcnt; /* * Types of comments */ #define CLMARG 0 #define CALIGN 1 #define CTRAIL 2 #define CRMARG 3 #define CSRMARG 4 #define CNL 5 #define CNLBL 6 #define CFORM 7 #define CINCLUD 8 /* * Comment structure * Cmhp is the head of the current list of comments */ struct comment { struct comment *cmnext; int cmdelim; struct commline *cml; int cmjust; int cmseqid; } *cmhp; /* * Structure for holding a comment line */ struct commline { char *cmtext; int cmcol; /* Only used for first line of comment currently */ struct commline *cml; }; struct W { int Wseqid; int Wcol; } yyw[MAXDEPTH + 1], *yypw; #define commform() quickcomm(CFORM) #define commnl() quickcomm(CNL) #define commnlbl() quickcomm(CNLBL) #endif p is the head of the current list of comments */ struct comment { struct comment *cmnext; int cmdelim; struct commline *cml; int cmjust; int cmseqid; } *cmhp; /* * Structure for holding a comment line */ struct commline { char *cmtext; int cmcol; /* Only used for first line of comment currently */ struct commline *cml; }; struct W { int Wseqid; int Wcol; } yyw[MAXDEPTH + 1], *yypw; #define commform() quickcomm(CFORM) #define commnl() quickcomm(CNL) #define commncmd/pi/yycopy.c 644 0 33 547 2552606457 6707 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)yycopy.c 1.1 8/27/80"; #include "0.h" #include "yy.h" OYcopy () { register int *r0 = & OY; register int *r1 = & Y; register int r2 = ( sizeof ( struct yytok ) ) / ( sizeof ( int ) ); do { * r0 ++ = * r1 ++ ; } while ( -- r2 > 0 ); } ml; }; struct W { int Wseqid; int Wcol; } yyw[MAXDEPTH + 1/,5x< /,"cmd/pi/yycosts.c 644 0 33 11455 2552606457 7130 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)yycosts.c 1.2 3/8/81"; #include "whoami.h" #include "0.h" #include "yy.h" /* * Symbol costs for Pascal. * * Cost strategy of August 14, 1977. * * The costs determined by the routines in this file are used by * the recovery in choosing appropriate corrections. * The cost vectors and the error productions in the grammar * work together to define the corrective capacity of the grammar. * * The costs here largely derive from those given in Steve Rhode's * thesis for the Pascal-I error correcting parser which he implemented. * Some minor changes have been made to adjust for the fact that * the current error recovery is not as "smart", both because of the * limited forward move and because of the lack of any type information * about identifiers. * * These adjustments largely take the form of increased costs for certain * tokens, noticeably keywords which are major brackets such as "begin" * "label", "procedure", etc. * * The overall weighting strategy is still similar to Rhodes' strategy. * The costs can be considered: * * LOW <= 3 * MEDIUM 4 or 5 * HIGH >= 6 */ /* * Insertion costs * * In addition to the normal symbol insertion costs, * there are zero cost insertions here. * The current error recovery system treats symbols * which have zero insertion cost in a special way, * inserting them but suppressing diagnostics. * This allows the system to hold of on bracketing * error diagnostics about missing end's until the * reduction occurs which knows the line number of the * corresponding "begin", "repeat", etc. * A more intelligent and useful diagnostic can then * be printed. * * Although this routine never allows the insertion * of the keyword begin, it can be inserted after a * procedure or function body starts, if it was omitted * by a special case in the panic routine, which notices * the keywords in the statement body of the procedure * and inserts the begin to recover. *(( * Similarly, we do not insert end-of-file, but * the fact that end-of-file is the unique input * is noticed by the recovery routines as a special * case and handled there. */ inscost(sy, before) register int sy, before; { switch (before) { case YEND: if (sy == YEND) break; case YPROCEDURE: case YFUNCTION: if (sy == YUNTIL || sy == YEND) return (0); } switch (sy) { case ';': return (1); case ',': case ':': case YOF: case YDO: return (2); case YARRAY: case '+': case '*': return (3); default: return (4); case '^': case YNOT: case YLABEL: case YCONST: case YTYPE: case YVAR: case YUNTIL: case '(': case '[': case YWHILE: case YWITH: case YASSERT: return (5); case YPROCEDURE: case YFUNCTION: case YCASE: return (6); case YEND: return (8); case YBEGIN: case YEOF: case YREPEAT: case YRECORD: return (INFINITY); } } /* * Replacement costs * * Most replacement costs are the same as an insertion * plus a deletion cost. One special case is the replacement * of a large number of keywords by an identifier. * These are given lower costs, especially the keyword "to". */ repcost(what, with) register int what, with; { register int c; if (with == what) return (INFINITY); if (with == YID && what > ERROR) switch (what) { case YID: case YDOTDOT: case YINT: case YBINT: case YSTRING: case YNUMB: break; case YTO: return (3); default: return (5); case YRECORD: case YTHEN: return (6); case YBEGIN: break; } if (what == ';' && (with == ',' || with == '.')) return (CLIMIT - 1); c = delcost(what) + inscost(with); /* * It costs extra to replace something which has * semantics by something which doesn't. */ if (nullsem(what) == NIL && nullsem(with) != NIL) c += 4; return (c); } /* * Deletion costs */ delcost(what) int what; { switch (what) { case '.': case ':': case ',': case '=': case '(': return (3); case YELSE: case YTHEN: return (4); default: return (5); case YLABEL: case YCONST: case YTYPE: case YVAR: return (10); case YPROCEDURE: case YFUNCTION: case YBEGIN: case YEND: return ((CLIMIT * 3) / 4); case ';': case YEOF: return (INFINITY); } } #ifdef DEBUG /* * Routine to print out costs with "-K" option. */ char yysyms[] = ";,:=*+/-|&()[]<>~^"; yycosts() { register int c; register char *cp; printf("Insert\tDelete\tRep(ID)\tSymbol\n"); for (cp = yysyms; *cp; cp++) yydocost(*cp); for (c = ERROR + 1; c < YLAST; c++) yydocost(c); #ifdef PXP flush(); #endif } yydocost(c) int c; { printf("%4d\t", inscost(c, -1)); printf("%4d\t", delcost(c)); if (repcost(c, YID) != inscost(YID) + delcost(c)) printf("%4d", repcost(c, YID)); printf("\t%s%s\n", charname(c)); } #endif ut costs with "-K" option. */ char yysyms[] = ";,:=*+/-|&()[]<>~^"; yycosts() { register int c; register char *cp; printf("Insert\tDelete\tRep(ID)\tSymbol\n"); for (cp = yysyms; *cp; cp++) yydocost(*cpcmd/pi/yyerror.c 644 0 33 3133 2552606460 7072 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)yyerror.c 1.2 3/8/81"; #include "whoami.h" #include "0.h" #include "yy.h" /* * Yerror prints an error * message and then returns * NIL for the tree if needed. * The error is flagged on the * current line which is printed * if the listing is turned off. #ifdef PXP * * As is obvious from the fooling around * with fout below, the Pascal system should * be changed to use the new library "lS". #endif */ yerror(s, a1, a2, a3, a4, a5) char *s; { #ifdef PI char buf[256]; #endif register int i, j; static yySerrs; #ifdef PXP int ofout; #endif if (errpfx == 'w' && opt('w') != 0) { errpfx = 'E'; return; } #ifdef PXP flush(); ofout = fout[0]; fout[0] = errout; #endif yyResume = 0; #ifdef PI geterr(s, buf); s = buf; #endif yysync(); pchr(errpfx); pchr(' '); for (i = 3; i < yyecol; i++) pchr('-'); printf("^--- "); /* if (yyecol > 60) printf("\n\t"); */ printf(s, a1, a2, a3, a4, a5); pchr('\n'); if (errpfx == 'E') #ifdef PI eflg = TRUE, codeoff(); #endif #ifdef PXP eflg = TRUE; #endif errpfx = 'E'; yySerrs++; if (yySerrs >= MAXSYNERR) { yySerrs = 0; yerror("Too many syntax errors - QUIT"); pexit(ERRS); } #ifdef PXP flush(); fout[0] = ofout; return (0); #endif } /* * A bracketing error message */ brerror(where, what) int where; char *what; { if (where == 0) { line = yyeline; setpfx(' '); error("End matched %s on line %d", what, where); return; } if (where < 0) where = -where; yerror("Inserted keyword end matching %s on line %d", what, where); } UE; #endif errpfx = 'E'; yySerrs++; if (yySerrs >= MAXSYNERR) { yySerrs = 0; yerror("Too many syntax errors - QUIT"); pexit(ERRS); } #ifdef PXP flush(); fout[0] = ofout; return (0); #endif } /* * A bracketing error message */ brerror(where, what) int where; char *what; { if (where == 0) { line = yyeline; setpfx(' '); error("End matched %s on line %d", what, where); return; } if (where < 0cmd/pi/yyget.c 644 0 33 13747 2552606461 6555 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)yyget.c 1.1 8/27/80"; #include "whoami.h" #include "0.h" #include "yy.h" #ifdef PXP int yytokcnt; #endif /* * Readch returns the next * character from the current * input line or -1 on end-of-file. * It also maintains yycol for use in * printing error messages. */ readch() { register i, c; if (*bufp == '\n' && bufp >= charbuf) { #ifdef PXP yytokcnt = 0; #endif if (getline() < 0) return (-1); } c = *++bufp; if (c == '\t') yycol = ((yycol + 8) & ~7); else yycol++; return (c); } /* * Definitions of the structures used for the * include facility. The variable "ibp" points * to the getc buffer of the current input file. * There are "inclev + 1" current include files, * and information in saved in the incs stack * whenever a new level of include nesting occurs. * * Ibp in the incs structure saves the pointer * to the previous levels input buffer; * filename saves the previous file name; * Printed saves whether the previous file name * had been printed before this nesting occurred; * and yyline is the line we were on on the previous file. */ #define MAXINC 10 struct inc { FILE *ibp; char *filename; int Printed; int yyline; int yyLinpt; } incs[MAXINC]; extern char *printed; int inclev = -1; #ifdef PXP /* * These initializations survive only if * pxp is asked to pretty print one file. * Otherwise they are destroyed by the initial * call to getline. */ char charbuf[CBSIZE] = " program x(output);\n"; int yycol = 8; char *bufp = charbuf; #endif /* * YyLinpt is the seek pointer to the beginning of the * next line in the file. */ int yyLinpt; /* * Getline places the next line * from the input stream in the * line buffer, returning -1 at YEOF. */ getline() { register char *cp; register CHAR c; #ifdef PXP static char ateof; #endif register FILE *ib; int i; if (opt('l') && yyprtd == 0) yyoutline(); yyprtd = 0; top: yylinpt = yyLinpt; yyline++; yyseqid++; cp = charbuf; ib = ibp; i = sizeof charbuf - 1; for (;;) { c = getc(ib); if (c == EOF) { if (uninclud()) goto top; #ifdef PXP if (ateof == 0 && bracket) { strcpy(charbuf, "begin end.\n"); ateof = 1; goto out; } #endif bufp = "\n"; yyline--; yyseqid--; yyprtd = 1; return (-1); } *cp++ = c; if (c == '\n') break; if (--i == 0) { line = yyline; error("Input line too long - QUIT"); pexit(DIED); } } *cp = 0; yyLinpt = yylinpt + cp - charbuf; if (includ()) goto top; #ifdef PXP if (cp == &charbuf[1]) commnl(); else if (cp == &charbuf[2]) switch (charbuf[0]) { case ' ': commnlbl(); break; case '\f': commform(); } #endif if (opt('u')) setuflg(); out: bufp = charbuf - 1; yycol = 8; return (1); } /* * Check an input line to see if it is a "#include" pseudo-statement. * We allow arbitrary blanks in the line and the file name * may be delimited by either 's or "s. A single semicolon * may be placed after the name, but nothing else is allowed */ includ() { register char *cp, *dp; char ch; register struct inc *ip; cp = charbuf; if (*cp++ != '#') return (0); cp = skipbl(cp); for (dp = "include"; *dp; dp++) if (*dp != *cp++) return (0); line = yyline; cp = skipbl(cp); ch = *cp++; if (ch != '\'' && ch != '"') { /* * This should be a yerror flagging the place * but its not worth figuring out the column. */ line = yyline; error("Include syntax error - expected ' or \" not found - QUIT"); pexit(DIED); } for (dp = cp; *dp != ch; dp++) if (*dp == 0) { line = yyline; error("Missing closing %c for include file name - QUIT", ch); pexit(DIED); } *dp++ = 0; /* * if (*dp == ';') * dp++; * dp = skipbl(dp); * if (*dp != '\n') { * line = yyline; * error("Garbage after filename in include"); * pexit(DIED); * } */ if ((!dotted(cp, 'i')) && (!dotted(cp, 'h'))) { line = yyline; error("Include filename must end in .i or .h"); } #ifdef PXP commincl(cp, ch); if (noinc((lude) return (1); #endif inclev++; if (inclev > MAXINC) { line = yyline; error("Absurdly deep include nesting - QUIT"); pexit(DIED); } ip = &incs[inclev]; ip->filename = filename; filename = savestr(cp); /* * left over from before stdio * * cp = malloc(518); * if (cp == -1) { * error("Ran out of memory (include)"); * pexit(DIED); * } * */ ip->ibp = ibp; if ( ( ibp = fopen(filename, "r" ) ) == NULL ) { perror(filename); pexit(DIED); } if (inpflist(filename)) { #ifdef PI opush('l'); #endif #ifdef PXP opush('z'); #endif } ip->Printed = printed; printed = 0; ip->yyline = yyline; yyline = 0; ip->yyLinpt = yyLinpt; yyLinpt = 0; /* * left over from before stdio * * ip->ibp = ibp; * ibp = cp; * */ # ifdef PC stabinclude( filename ); # endif PC return (1); } skipbl(ocp) char *ocp; { register char *cp; cp = ocp; while (*cp == ' ' || *cp == '\t') cp++; return (cp); } /* * At the end of an include, * close the file, free the input buffer, * and restore the environment before * the "push", including the value of * the z option for pxp and the l option for pi. */ uninclud() { register struct inc *ip; if (inclev < 0) return (0); /* * left over from before stdio: becomes fclose ( ibp ) * * close(ibp[0]); * free(ibp); * */ fclose ( ibp ); ip = &incs[inclev]; ibp = ip->ibp; yyline = ip->yyline; if (inpflist(filename)) { #ifdef PI opop('l'); #endif #ifdef PXP opop('z'); #endif } filename = ip->filename; yyLinpt = ip->yyLinpt; /* * If we printed out the nested name, * then we should print all covered names again. * If we didn't print out the nested name * we print the uncovered name only if it * has not been printed before (unstack). */ if (printed) { printed = 0; while (ip >= incs) { ip->Printed = 0; ip--; } } else printed = ip->Printed; # ifdef PC if ( inclev == 0 ) { stabsource( filename ); } else { stabinclude( filename ); } # endif PC inclev--; return (1); } t = ip->yyLinpt; /* * cmd/pi/yyid.c 644 0 33 11660 2552606461 6362 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)yyid.c 1.3 3/8/81"; #include "whoami.h" #include "0.h" #include "yy.h" #ifdef PI extern int *yypv; /* * Determine whether the identifier whose name * is "cp" can possibly be a kind, which is a * namelist class. We look through the symbol * table for the first instance of cp as a non-field, * and at all instances of cp as a field. * If any of these are ok, we return true, else false. * It would be much better to handle with's correctly, * even to just know whether we are in a with at all. * * Note that we don't disallow constants on the lhs of assignment. */ identis(cp, kind) register char *cp; int kind; { register struct nl *p; int i; /* * Cp is NIL when error recovery inserts it. */ if (cp == NIL) return (1); /* * Record kind we want for possible later use by yyrecover */ yyidwant = kind; yyidhave = NIL; i = ( (int) cp ) & 077; for (p = disptab[i]; p != NIL; p = p->nl_next) if (p->symbol == cp) { if (yyidok(p, kind)) goto gotit; if (p->class != FIELD && p->class != BADUSE) break; } if (p != NIL) for (p = p->nl_next; p != NIL; p = p->nl_next) if (p->symbol == cp && p->class == FIELD && yyidok(p, kind)) goto gotit; return (0); gotit: if (p->class == BADUSE && !Recovery) { yybadref(p, OY.Yyeline); yypv[0] = NIL; } return (1); } /* * A bad reference to the identifier cp on line * line and use implying the addition of kindmask * to the mask of kind information. */ yybaduse(cp, line, kindmask) register char *cp; int line, kindmask; { register struct nl *p, *oldp; int i; i = ( (int) cp ) & 077; for (p = disptab[i]; p != NIL; p = p->nl_next) if (p->symbol == cp) break; oldp = p; if (p == NIL || p->class != BADUSE) p = enter(defnl(cp, BADUSE, 0, 0)); p->value[NL_KINDS] |= kindmask; yybadref(p, line); return (oldp); } /* * ud is initialized so that esavestr will allocate * sizeof ( struct udinfo ) bytes for the 'real' struct udinfo */ struct udinfo ud = { ~0 , ~0 , 0}; /* * Record a reference to an undefined identifier, * or one which is improperly used. */ yybadref(p, line) register struct nl *p; int line; { register struct udinfo *udp; if (p->chain != NIL && p->chain->ud_line == line) return; udp = esavestr(&ud); udp->ud_line = line; udp->ud_next = p->chain; p->chain = udp; } #define varkinds ((1<class == BADUSE) { if (kind == VAR) return (p->value[0] & varkinds); return (p->value[0] & (1 << kind)); } if (yyidok1(p, kind)) return (1); if (yyidhave != NIL) yyidhave = IMPROPER; else yyidhave = p->class; return (0); } yyidok1(p, kind) register struct nl *p; int kind; { int i; switch (kind) { case FUNC: return ( p -> class == FUNC || p -> class == FVAR || p -> class == FFUNC ); case PROC: return ( p -> class == PROC || p -> class == FPROC ); case CONST: case TYPE: case FIELD: return (p->class == kind); case VAR: return (p->class == CONST || yyisvar(p, NIL)); case ARRAY: case RECORD: return (yyisvar(p, kind)); case PTRFILE: return (yyisvar(p, PTR) || yyisvar(p, FILET)); } } yyisvar(p, class) register struct nl *p; int class; { switch (p->class) { case FIELD: case VAR: case REF: case FVAR: /* * We would prefer to return * parameterless functions only. */ case FUNC: case FFUNC: return (class == NIL || (p->type != NIL && p->type->class == class)); case PROC: case FPROC: return ( class == NIL ); } return (0); } #endif #ifdef PXP #ifndef DEBUG identis() { return (1); } #endif #ifdef DEBUG extern char *classes[]; char kindchars[] "UCTVAQRDPF"; /* * Fake routine "identis" for pxp when testing error recovery. * Looks at letters in variable names to answer questions * about attributes. Mapping is * C const_id * T type_id * V var_id also if any of AQRDF * A array_id * Q ptr_id * R record_id * D field_id D for "dot" * P proc_id * F func_id */ identis(cp, kind) register char *cp; int kind; { register char *dp; char kindch; /* * Don't do anything unless -T */ if (!typetest) return (1); /* * Inserted symbols are always correct */ if (cp == NIL) return (1); /* * Set up the names for error messages */ yyidwant = classes[kind]; for (dp = kindchars; *dp; dp++) if (any(cp, *dp)) { yyidhave = classes[dp - kindchars]; break; } /* * U in the name means undefined */ if (any(cp, 'U')) return (0); kindch = kindchars[kind]; if (kindch == 'V') for (dp = "AQRDF"; *dp; dp++) if (any(cp, *dp)) return (1); return (any(cp, kindch)); } #endif #endif eturn (1); /* * Inserted symbols are always correct */ if (cp == NIL) rcmd/pi/yylex.c 644 0 33 13356 2552606461 6562 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)yylex.c 1.2 3/8/81"; #include "whoami.h" #include "0.h" #include "yy.h" /* * Scanner */ int yylacnt; #define YYLASIZ 10 struct yytok Yla[YYLASIZ]; unyylex(y) struct yylex *y; { if (yylacnt == YYLASIZ) panic("unyylex"); copy(&Yla[yylacnt], y, sizeof Yla[0]); yylacnt++; } yylex() { register c; register **ip; register char *cp; int f; char delim; if (yylacnt != 0) { yylacnt--; copy(&Y, &Yla[yylacnt], sizeof Y); return (yychar); } if (c = yysavc) yysavc = 0; else c = readch(); #ifdef PXP yytokcnt++; #endif next: /* * skip white space */ #ifdef PXP yywhcnt = 0; #endif while (c == ' ' || c == '\t') { #ifdef PXP if (c == '\t') yywhcnt++; yywhcnt++; #endif c = readch(); } yyecol = yycol; yyeline = yyline; yyefile = filename; yyeseqid = yyseqid; yyseekp = yylinpt; cp = token; yylval = yyline; switch (c) { case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': case 's': case 't': case 'u': case 'v': case 'w': case 'x': case 'y': case 'z': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z': do { *cp++ = c; c = readch(); } while (alph(c) || digit(c)); *cp = 0; if (opt('s')) for (cp = token; *cp; cp++) if (*cp >= 'A' && *cp <= 'Z') { *cp |= ' '; } yysavc = c; ip = hash(0, 1); if (*ip < yykey || *ip >= lastkey) { yylval = *ip; return (YID); } yylval = yyline; /* * For keywords * the lexical token * is magically retrieved * from the keyword table. */ return ((*ip)[1]); case '0': case '1': case '2': case '3': case '4': case '5': case(( '6': case '7': case '8': case '9': f = 0; do { *cp++ = c; c = readch(); } while (digit(c)); if (c == 'b' || c == 'B') { /* * nonstandard - octal constants */ if (opt('s')) { standard(); yerror("Octal constants are non-standard"); } *cp = 0; yylval = copystr(token); return (YBINT); } if (c == '.') { c = readch(); if (c == '.') { *cp = 0; yysavc = YDOTDOT; yylval = copystr(token); return (YINT); } infpnumb: f++; *cp++ = '.'; if (!digit(c)) { yyset(); recovered(); yerror("Digits required after decimal point"); *cp++ = '0'; } else while (digit(c)) { *cp++ = c; c = readch(); } } if (c == 'e' || c == 'E') { f++; *cp++ = c; if ((c = yysavc) == 0) c = readch(); if (c == '+' || c == '-') { *cp++ = c; c = readch(); } if (!digit(c)) { yyset(); yerror("Digits required in exponent"); *cp++ = '0'; } else while (digit(c)) { *cp++ = c; c = readch(); } } *cp = 0; yysavc = c; yylval = copystr(token); if (f) return (YNUMB); return (YINT); case '"': case '`': if (!any(bufp + 1, c)) goto illch; if (!dquote) { recovered(); dquote++; yerror("Character/string delimiter is '"); } case '\'': case '#': delim = c; do { do { c = readch(); if (c == '\n') { yerror("Unmatched %c for string", delim); if (cp == token) *cp++ = ' ', cp++; break; } *cp++ = c; } while (c != delim); c = readch(); } while (c == delim); *--cp = 0; if (cp == token) { yerror("Null string not allowed"); *cp++ = ' '; *cp++ = 0; } yysavc = c; yylval = copystr(token); return (YSTRING); case '.': c = readch(); if (c == '.') return (YDOTDOT); if (digit(c)) { recovered(); yerror("Digits required before decimal point"); *cp++ = '0'; goto infpnumb; } yysavc = c; return ('.'); case '{': /* * { ... } comment */ #ifdef PXP getcm(c); #endif #ifdef PI c = options(); while (c != '}') { if (c <= 0) goto nonterm; if (c == '{') { warning(); yyset(); yerror("{ in a { ... } comment"); } c = readch(); } #endif c = readch(); goto next; case '(': if ((c = readch()) == '*') { /* * (* ... *) comment */ #ifdef PXP getcm(c); c = readch(); goto next; #endif #ifdef PI c = options(); for (;;) { if (c < 0) { nonterm: yerror("Comment does not terminate - QUIT"); pexit(ERRS); } if (c == '(' && (c = readch()) == '*') { warning(); yyset(); yerror("(* in a (* ... *) comment"); } if (c == '*') { if ((c = readch()) != ')') continue; c = readch(); goto next; } c = readch(); } #endif } yysavc = c; c = '('; case ';': case ',': case ':': case '=': case '*': case '+': case '/': case '-': case '|': case '&': case ')': case '[': case ']': case '<': case '>': case '~': case '^': return (c); default: switch (c) { case YDOTDOT: return (c); case '\n': c = readch(); #ifdef PXP yytokcnt++; #endif goto next; case '\f': c = readch(); goto next; } if (c <= 0) return (YEOF); illch: do yysavc = readch(); while (yysavc == c); yylval = c; return (YILLCH); } } yyset() { yyecol = yycol; yyeline = yyline; yyefile = filename; yyseekp = yylinpt; } /* * Setuflg trims the current * input line to at most 72 chars * for the u option. */ setuflg() { if (charbuf[71] != '\n') { charbuf[72] = '\n'; charbuf[73] = 0; } } ; #ifdef PXP yytokcnt++; #endif goto next; case '\f': c = readch(); goto next; } if (c <= 0) return (YEOF); illch: do yysavc = readch(); while (yysavc == c); yylval = c; return (YILLCH); } } yyset() { yyecol = yycol; yycmd/pi/yymain.c 644 0 33 5122 2552606462 6667 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)yymain.c 1.2 3/8/81"; #include "whoami.h" #include "0.h" #include "yy.h" #include #include "objfmt.h" #include /* * Yymain initializes each of the utility * clusters and then starts the processing * by calling yyparse. */ yymain() { /* * Initialize the scanner */ #ifdef PXP if (bracket == 0) { #endif if (getline() == -1) { Perror(filename, "No lines in file"); pexit(NOSTART); } #ifdef PXP } else yyline = 0; #endif #ifdef PI # ifdef OBJ magic(); # endif OBJ #endif line = 1; errpfx = 'E'; /* * Initialize the clusters * initstring(); */ inithash(); inittree(); #ifdef PI initnl(); #endif /* * Process the input */ yyparse(); #ifdef PI # ifdef OBJ magic2(); # endif OBJ # ifdef DEBUG dumpnl(0); # endif #endif #ifdef PXP prttab(); if (onefile) { extern int outcol; if (outcol) pchr('\n'); flush(); if (eflg) { writef(2, "File not rewritten because of errors\n"); pexit(ERRS); } signal(SIGHUP, SIG_IGN); signal(SIGINT, SIG_IGN); copyfile(); } #endif pexit(eflg ? ERRS : AOK); } #ifdef PXP copyfile() { extern int fout[]; register int c; close(1); if (creat(firstname, 0644) != 1) { perror(firstname); pexit(ERRS); } lseek(fout[0], 0l, 0); while ((c = read(fout[0], &fout[3], 512)) > 0) { if (write(1, &fout[3], c) != c) { perror(firstname); pexit(ERRS); } } } #endif static struct exec magichdr; #ifdef PI #ifdef OBJ magic() { short buf[HEADER_BYTES / sizeof ( short )]; unsigned *ubuf = buf; register int hf, i; hf = open(PX_HEADER,0); if (hf >= 0 && read(hf, buf, HEADER_BYTES) > sizeof(struct exec)) { magichdr.a_magic = ubuf[0]; magichdr.a_text = ubuf[1]; magichdr.a_data = ubuf[2]; magichdr.a_bss = ubuf[3]; magichdr.a_syms = ubuf[4]; magichdr.a_entry = ubuf[5]; magichdr.a_trsize = ubuf[6]; magichdr.a_drsize = ubuf[7]; for (i = 0; i < HEADER_BYTES / sizeof ( short ); i++) word(buf[i]); } close(hf); } #endif OBJ #ifdef OBJ magic2() { struct pxhdr pxhd; if (magichdr.a_magic != 0407) panic ( "magic2" ); pflush(); lseek(ofil, 0l, 0); magichdr.a_data = ( unsigned ) lc - magichdr.a_text; magichdr.a_data -= sizeof (struct exec); write(ofil, &magichdr, sizeof(struct exec)); pxhd.objsize = ( ( unsigned ) lc) - HEADER_BYTES; time(&pxhd.maketime); pxhd.magicnum = MAGICNUM; lseek(ofil, ( long ) ( HEADER_BYTES - sizeof ( pxhd ) ) , 0); write(ofil, &pxhd, sizeof (pxhd)); } #endif OBJ #endif #ifdef PXP writef(i, cp) { write(i, cp, strlen(cp)); } #endif if (magichdr.a_magic != 0407) panic ( "magic2" ); pflush(); lseek(ofil, 0l, 0); magichdr.a_data = ( unsigned ) lc - magichdr.a_text; magichdr.a_data -= sizeof (struct exec); write(ofil, &magichdr, sizeof(struct exec)); pxhd.objsize = ( ( unsigned ) lc) - HEADER_BYTES; time(&pxhd.maketime); pxhd.magicnum = MAGICNUM; lseek(ofil, ( long ) ( HEADER_BYTES - sizeof ( pxhd ) ) , 0); write(ofil, &pxhd, sizeof (pxhd)); } #cmd/pi/yyoptions.c 644 0 33 2274 2552606462 7443 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)yyoptions.c 1.1 8/27/80"; #include "whoami.h" #include "0.h" #include "yy.h" /* * Options processes the option * strings which can appear in * comments and returns the next character. */ options() { register c, ch; register char *optp; int ok; c = readch(); if (c != '$') return (c); do { ch = c = readch(); switch (c) { case 'b': optp = &opt( 'b' ); c = readch(); if (!digit(c)) return (c); *optp = c - '0'; c = readch(); break; # ifdef PC case 'C': /* * C is a replacement for t, fake it. */ c = 't'; /* and fall through */ case 'g': # endif PC case 'k': case 'l': case 'n': case 'p': case 's': case 't': case 'u': case 'w': case 'z': optp = &opt( c ); c = readch(); if (c == '+') { *optp = 1; c = readch(); } else if (c == '-') { *optp = 0; c = readch(); } else { return (c); } break; default: return (c); } #ifdef PI0 send(ROSET, ch, *optp); #endif } while (c == ','); if ( opt( 'u' ) ) setuflg(); return (c); } l through */ case 'g': # endif PC case 'k': case 'l': case 'n': case 'p': case 's': case 't': case 'u': case 'w': case 'z': optp = &opt( c ); c = readch(); if (c == '+') { *optp = 1; c = readch(); } else if (c == '-') { *optp = 0; c = readch(); } elcmd/pi/yypanic.c 644 0 33 6140 2552606462 7036 ((/* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)yypanic.c 1.2 3/8/81"; #include "whoami.h" #include "0.h" #include "yy.h" struct yytok oldpos; /* * The routine yyPerror coordinates the panic when * the correction routines fail. Three types of panics * are possible - those in a declaration part, those * in a statement part, and those in an expression. * * Declaration part panics consider insertion of "begin", * expression part panics will stop on more symbols. * The panics are otherwise the same. * * ERROR MESSAGE SUPPRESSION STRATEGY: August 11, 1977 * * If the parser has not made at least 2 moves since the last point of * error then we want to suppress the supplied error message. * Otherwise we print it. * We then skip input up to the next solid symbol. */ yyPerror(cp, kind) char *cp; register int kind; { register int ishifts, brlev; copy(&oldpos, &Y, sizeof oldpos); brlev = 0; if (yychar < 0) yychar = yylex(); for (ishifts = yyshifts; ; yychar = yylex(), yyshifts++) switch (yychar) { case YILLCH: yerror("Illegal character"); if (ishifts == yyshifts) yyOshifts = 0; continue; case YEOF: goto quiet; case ';': if (kind == PPROG) continue; if (kind == PDECL) yychar = yylex(); goto resume; case YEND: if (kind == PPROG) continue; case YPROCEDURE: case YFUNCTION: goto resume; case YLABEL: case YTYPE: case YCONST: case YVAR: if (kind == PSTAT) { yerror("Declaration found when statement expected"); goto quiet; } case YBEGIN: goto resume; case YFOR: case YREPEAT: case YWHILE: case YGOTO: case YIF: if (kind != PDECL) goto resume; yerror("Expected keyword begin after declarations, before statements"); unyylex(&Y); yychar = YBEGIN; yylval = nullsem(YBEGIN); goto quiet; case YTHEN: case YELSE: case YDO: if (kind == PSTAT) { yychar = yylex(); goto resume; } if (kind == PEXPR) goto resume; continue; case ')': case ']': if (kind != PEXPR) continue; if (brlev == 0) goto resume; if (brlev > 0) brlev--; continue; case '(': case '[': brlev++; continue; case ',': if (brlev != 0) continue; case YOF: case YTO: case YDOWNTO: if (kind == PEXPR) goto resume; continue; #ifdef PI /* * A rough approximation for now * Should be much more lenient on suppressing * warnings. */ case YID: syneflg = TRUE; continue; #endif } resume: if (yyOshifts >= 2) { if (yychar != -1) unyylex(&Y); copy(&Y, &oldpos, sizeof Y); yerror(cp); yychar = yylex(); } quiet: if (yyshifts - ishifts > 2 && opt('r')) { setpfx('r'); yerror("Parsing resumes"); } /* * If we paniced in the statement part, * and didn't stop at a ';', then we insert * a ';' to prevent the recovery from immediately * inserting one and complaining about it. */ if (kind == PSTAT && yychar != ';') { unyylex(&Y); yyshifts--; yytshifts--; yychar = ';'; yylval = nullsem(';'); } } char != -1) unyylex(&Y); copy(&Y, &oldpos, sizeof Y); yerror(cp); yychar = yylex(); } quiet: if (yyshifts - ishifts > 2 && opt('r')) { setpfx('r'); yerror("Parsing resumes"); } /* * If we paniced in the statement part, * and didn't stop at a ';', then we insert * a ';' to prevent the recovery from immediately * inserting one and complaining about it. */ if (kind == PSTAT && yychar != 'cmd/pi/yyparse.c 644 0 33 6400 2552606462 7055 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)yyparse.c 1.2 3/8/81"; #include "whoami.h" #include "0.h" #include "yy.h" /* * Parser for 'yacc' output. * Specifially Modified for Berkeley Pascal */ int yystate; /* Current parser state */ int *yypv; unsigned yytshifts = 1; /* Number of "true" shifts */ /* * Parse Tables */ int yygo[]; int yypgo[]; int yyr1[]; int yyr2[]; int yyact[]; int yypact[]; /* * Parse and parallel semantic stack */ int yyv[MAXDEPTH]; int yys[MAXDEPTH]; /* * This routine parses the input stream, and * returns if it accepts, or if an unrecoverable syntax * error is encountered. */ yyparse() { register int *ps, n, *p; int paniced, *panicps, idfail; yystate = 0; yychar = yylex(); OY.Yychar = -1; yyshifts = 3; paniced = 0; ps = &yys[0]-1; yypv = &yyv[0]-1; #ifdef PXP yypw = &yyw[0]-1; #endif stack: /* * Push new state and value. */ if (yypv >= &yyv[MAXDEPTH-1]) { yerror("Parse stack overflow"); pexit(DIED); } *++ps = yystate; *++yypv = yyval; #ifdef PXP yypw++; #endif newstate: /* * Locate parsing actions for the * new parser state. */ p = &yyact[ yypact[yystate+1] ]; actn: /* * Search the parse actions table * for something useful to do. * While n is non-positive, it is the negation * of the token we are testing for. */ #ifdef PI if ((n = *p++) <= 0) { if (yychar < 0) yychar = yylex(); do if ((n += yychar) != 0) p++; while ((n = *p++) <= 0); } #else while ((n = *p++) <= 0) if ((n += yychar) != 0) p++; #endif switch (n >> 12) { /* * Shift. */ case 2: #ifdef PXP yypw[1].Wseqid = yyseqid; yypw[1].Wcol = yycol; #endif OYcopy(); yystate = n & 07777; yyval = yylval; #ifdef PI yychar = -1; #else yychar = yylex(); #endif yyshifts++; yytshifts++; goto stack; /* * Reduce. */ case 3: n &= 07777; N = yyr2[n]; if (N == 1 && OY.Yychar == YID && !yyEactr(n, yypv[0])) { idfail = 1; goto errin; } OY.Yychar = -1; ps -= N; yypv -= N; #ifdef PXP yypw -= N; #endif yyval = yypv[1]; yyactr(n); /* * Use goto table to find next state. */ p = &yygo[yypgo[yyr1[n]]]; while (*p != *ps && *p >= 0) p += 2; yystate = p[1]; goto stack; /* * Accept. */ case 4: return; /* * Error. */ case 1: idfail = 0; errin: if ((paniced || yyshifts != 0) && yyrecover(ps, idfail)) { paniced = 0; ps = Ps; yystate = *ps; goto newstate; } /* * Find a state where 'error' is a * legal shift action. */ if (paniced && yyshifts <= 0 && ps >= panicps) { yypv -= (ps - panicps) + 1; #ifdef PXP yypw -= (ps - panicps) + 1; #endif ps = panicps - 1; } while (ps >= yys) { for (p = &yyact[ yypact[*ps+1] ] ; *p <= 0; p += 2) if (*p == -256) { panicps = ps; yystate= p[1] & 07777; yyOshifts = yyshifts; yyshifts = 0; paniced = 1; goto stack; } --ps; --yypv; #ifdef PXP --yypw; #endif #ifdef PI if (OY.Yychar != YID) syneflg = TRUE; #endif OY.Yychar = -1; } if (yychar == YEOF) yyunexeof(); if (yystate == 1) yyexeof(); yerror("Unrecoverable syntax error - QUIT"); return; } panic("yyparse"); } (p = &yyact[ yypact[*ps+1] ] ; *p <= 0; p += 2) if (*p == -256) { panicps = ps; yystate= p[1] & 07777; yyOshifts = yyshifts; yyshifts = 0; paniced = 1; goto stack; } --ps; --yypv; #ifdef PXP --yypw;cmd/pi/yyprint.c 644 0 33 3400 2552606462 7074 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)yyprint.c 1.2 3/8/81"; #include "whoami.h" #include "0.h" #include "yy.h" char *tokname(); STATIC short bounce; /* * Printing representation of a * "character" - a lexical token * not in a yytok structure. * 'which' indicates which char * you want * should always be called as "charname(...,0),charname(...,1)" */ char * charname(ch , which ) int ch; int which; { struct yytok Ych; Ych.Yychar = ch; Ych.Yylval = nullsem(ch); return (tokname(&Ych , which )); } /* * Printing representation of a token * 'which' as above. */ char * tokname(tp , which ) register struct yytok *tp; int which; { register char *cp; register struct kwtab *kp; char *cp2; cp2 = ""; switch (tp->Yychar) { case YCASELAB: cp = "case-label"; break; case YEOF: cp = "end-of-file"; break; case YILLCH: cp = "illegal character"; break; case 256: /* error token */ cp = "error"; break; case YID: cp = "identifier"; break; case YNUMB: cp = "real number"; break; case YINT: case YBINT: cp = "number"; break; case YSTRING: cp = tp->Yylval; cp = cp == NIL || cp[1] == 0 ? "character" : "string"; break; case YDOTDOT: cp = "'..'"; break; default: if (tp->Yychar < 256) { cp = "'x'\0'x'\0'x'\0'x'"; /* * for four times reentrant code! * used to be: * if (bounce = ((bounce + 1) & 1)) * cp += 4; */ bounce = ( bounce + 1 ) % 4; cp += (4 * bounce); /* 'x'\0 is 4 chars */ cp[1] = tp->Yychar; break; } for (kp = yykey; kp->kw_str != NIL && kp->kw_val != tp->Yychar; kp++) continue; cp = "keyword "; cp2 = kp->kw_str; } return ( which ? cp2 : cp ); } TDOT: cp = "'..'"; break; default: if (tp->Yychar < 256) { cp = "'x'\0'x'\0'x'\0'x'"; /* * for four times reentrant code! * used to be: * if (bounce = ((bounce + 1) & 1)) * cp += 4; */ bounce = ( bounce + 1 )((cmd/pi/yyput.c 644 0 33 12056 2552606463 6600 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)yyput.c 1.2 3/8/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "yy.h" /* * Structure describing queued listing lines during the forward move * of error recovery. These lines will be stroed by yyoutline during * the forward move and flushed by yyoutfl or yyflush when an * error occurs or a program termination. */ struct B { int Bmagic; int Bline; int Bseekp; char *Bfile; int Bseqid; struct B *Bnext; } *bottled; /* * Filename gives the current input file, lastname is * the last filename we printed, and lastid is the seqid of the last line * we printed, to help us avoid printing * multiple copies of lines. */ extern char *filename; char *lastname; int lastid; char hadsome; char holdbl; /* * Print the current line in the input line * buffer or, in a forward move of the recovery, queue it for printing. */ yyoutline() { register struct B *bp; if (Recovery) { bp = tree(6, T_BOTTLE, yyline, yylinpt, filename, yyseqid); if (bottled != NIL) bp->Bnext = bottled->Bnext, bottled->Bnext = bp; else bp->Bnext = bp; bottled = bp; return; } yyoutfl(yyseqid); if (yyseqid != lastid) yyprline(charbuf, yyline, filename, yyseqid); } /* * Flush all the bottled output. */ yyflush() { yyoutfl(32767); } /* * Flush the listing to the sequence id toseqid */ yyoutfl(toseqid) int toseqid; { register struct B *bp; bp = bottled; if (bp == NIL) return; bp = bp->Bnext; while (bp->Bseqid <= toseqid) { yygetline(bp->Bfile, bp->Bseekp, bp->Bline, bp->Bseqid); if (bp->Bnext == bp) { bottled = NIL; break; } bp = bp->Bnext; bottled->Bnext = bp; } } FILE *yygetunit = NULL; char *yygetfile; /* * Yysync guarantees that the line associated * with the current token was the last line * printed for a syntactic error message. */ yysync() { yyoutfl(yyeseqid); if (lastid != yyeseqid) yygetline(yyefile, yyseekp, yyeline, yyeseqid); } yySsync() { yyoutfl(OY.Yyeseqid); } /* * Yygetline gets a line from a file after we have * lost it. The pointer efile gives the name of the file, * seekp its offset in the file, and eline its line number. * If this routine has been called before the last file * it worked on will be open in yygetunit, with the files * name being given in yygetfile. Note that this unit must * be opened independently of the unit in use for normal i/o * to this file; if it were a dup seeks would seek both files. */ yygetline(efile, seekp, eline, eseqid) char *efile; int seekp, eline, eseqid; { register int cnt; register char *bp; char buf[CBSIZE + 1]; if (lastid == eseqid) return; if (eseqid == yyseqid) { bp = charbuf; yyprtd++; } else { bp = buf; if (efile != yygetfile) { if ( yygetunit != NULL ) fclose( yygetunit ); yygetfile = efile; yygetunit = fopen( yygetfile , "r" ); if (yygetunit < 0) oops: perror(yygetfile), pexit(DIED); } if ( fseek( yygetunit , (long) seekp , 0 ) < 0) goto oops; cnt = fread( bp , sizeof( * bp ) , CBSIZE , yygetunit ); if (cnt < 0) goto oops; bp[cnt] = 0; } yyprline(bp, eline, efile, eseqid); } yyretrieve() { yygetline(OY.Yyefile, OY.Yyseekp, OY.Yyeline, OY.Yyeseqid); } /* * Print the line in the character buffer which has * line number line. The buffer may be terminated by a new * line character or a null character. We process * form feed directives, lines with only a form feed character, and * suppress numbering lines which are empty here. */ yyprline(buf, line, file, id) register char *buf; int line; char *file; int id; { lastid = id; if (buf[0] == '\f' && buf[1] == '\n') { printf("\f\n"); hadsome = 0; holdbl = 0; return; } if (holdbl) { pchr('\n'); holdbl = 0; } if (buf[0] == '\n') holdbl = 1; else { yysetfile(file); yyprintf(buf, line); } hadsome = 1; } yyprintf(cp, line) register char *cp; int line; { printf("%6d ", line); while (*cp != 0 && *cp != '\n') pchr(graphic(*cp++)); pchr('\n'); } graphic(ch) register CHAR ch; { switch (ch) { default: if (ch >= ' ') return (ch); case 0177: return ('?'); case '\n': case '\t': return (ch); } } extern int nopflg; char printed = 1; /* * Set the current file name to be file, * printing the name, or a header on a new * page if required. * there is another yysetfile in error.c * this one is for PI and PXP that one is for PI1 */ yysetfile(file) register char *file; { #ifdef PXP if (nopflg == 1) return; #endif if (lastname == file) return; if (file == filename && opt('n') && (printed & 02) == 0) { printed |= 02; header(); } else yyputfn(file); lastname = file; } /* * Put out an include file name * if an error occurs but the name has * not been printed (or if another name * has been printed since it has). */ yyputfn(cp) register char *cp; { extern int outcol; if (cp == lastname && printed) return; lastname = cp; printed = 1; #ifdef PXP if (outcol) pchr('\n'); #endif gettime( cp ); printf("%s %s:\n" , myctime( &tvec ) , cp ); hadsome = 1; } t('n') && (printed & 02) == 0) { printed |= 02; header(); } else yyputfn(file); lastname = file; } /* * Put out an include file name * if an error occurs but the name has * not been printed (or if another name * has been printed since it has). */ yyputfn(cp) register char *cp; { extern int outcol; if (cp == lastname && printed) return; lastname = cp; printed = 1; #ifdef PXP if (outcol) pchr('\n'); #endif gettime( cp ); printf("%s %s:\cmd/pi/yyrecover.c 644 0 33 46725 2552606463 7447 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)yyrecover.c 1.2 3/8/81"; #include "whoami.h" #include "0.h" #include "yy.h" /* * Very simplified version of Graham-Rhodes error recovery * method for LALR parsers. Backward move is embodied in * default reductions of the yacc parser until an error condition * is reached. Forward move is over a small number of input tokens * and cannot "condense". The basic corrections are: * * 1) Delete the input token. * * 2) Replace the current input with a legal input. * * 3) Insert a legal token. * * All corrections are weighted, considered only if they allow * at least two shifts, and the cost of a correction increases if * it allows shifting over only a part of the lookahead. * * Another error situation is that which occurs when an identifier "fails" * a reduction because it is not the required "class". * In this case, we also consider replacing this identifier, which has * already been shifted over, with an identifier of the correct class. * * Another correction performed here is unique symbol insertion. * If the current state admits only one input, and no other alternative * correction presents itself, then that symbol will be inserted. * There is a danger in this of looping, and it is handled * by counting true shifts over input (see below). * * * A final class of corrections, considered only when the error * occurred immediately after a shift over a terminal, involves * the three basic corrections above, but with the point of error * considered to be before this terminal was shifted over, effectively * "unreading" this terminal. This is a feeble attempt at elimination * of the left-right bias and because "if" has a low weight and some * statements are quite simple i.e. * * cse ch of ... * * we can get a small number of errors. The major deficiency of * this is that we back up only one token, and that the forward * move is over a small number of tokens, often not enough to really * tell what the input should be, e.g. in * * a[i] > a[i - 1] ... * * In such cases a bad identifier (misspelled keyword) or omitted * keyword will be change or inserted as "if" as it has the lowest cost. * This is not terribly bad, as "if"s are most common. * This also allows the correction of other errors. * * This recovery depends on the default reductions which delay * noticing the error until the parse reaches a state where the * relevant "alternatives" are visible. Note that it does not * consider tokens which will cause reductions before being * shifted over. This requires the grammar to be written in a * certain way for the recovery to work correctly. * In some sense, also, the recovery suffers because we have * LALR(1) tables rather than LR(1) tables, e.g. in * * if rec.field < rec2,field2 then */ /* * Definitions of possible corrective actions */ #define CPANIC 0 #define CDELETE 1 #define CREPLACE 2 #define CINSERT 3 #define CUNIQUE 4 #define CCHIDENT 5 /* * Multiplicative cost factors for corrective actions. * * When an error occurs we take YCSIZ - 1 look-ahead tokens. * If a correction being considered will shift over only part of * that look-ahead, it is not completely discarded, but rather * "weighted", its cost being multiplied by a weighting factor. * For a correction to be considered its weighted cost must be less * than CLIMIT. * * Non-weighted costs are considered: * * LOW <= 3 * MEDIUM 4,5 * HIGH >= 6 * * CURRENT WEIGHTING STRATEGY: Aug 20, 1977 ((* * For all kinds of corrections we demand shifts over two symbols. * Corrections have high weight even after two symbol * shifts because the costs for deleting and inserting symbols are actually * quite low; we do not want to change weighty symbols * on inconclusive evidence. * * The weights are the same after the third look ahead. * This prevents later, unrelated errors from causing "funny" * biases of the weights toward one type of correction. * * Current look ahead is 5 symbols. */ /*** CLIMIT is defined in yy.h for yycosts ***/ #define CPRLIMIT 50 #define CCHIDCOST 3 char insmult[8] = {INFINITY, INFINITY, INFINITY, 15, 8, 6, 3, 1}; char repmult[7] = {INFINITY, INFINITY, INFINITY, 8, 6, 3, 1}; char delmult[6] = {INFINITY, INFINITY, INFINITY, 6, 3, 1}; #define NOCHAR -1 #define Eprintf if (errtrace) printf #define Tprintf if (testtrace) printf /* * Action arrays of the parser needed here */ int yyact[], yypact[], *yypv; /* * Yytips is the tip of the stack when using * the function loccor to check for local * syntactic correctness. As we don't want * to copy the whole parser stack, but want * to simulate parser moves, we "split" * the parser stack and keep the tip here. */ #define YYTIPSIZ 16 int yytips[YYTIPSIZ], yytipct; int yytipv[YYTIPSIZ]; /* * The array YC saves the lookahead tokens for the * forward moves. * Yccnt is the number of tokens in the YC array. */ #define YCSIZ 6 int yCcnt; struct yytok YC0[YCSIZ + 1]; struct yytok *YC; /* * YCps gives the top of stack at * the point of error. */ bool yyunique = 1; STATIC unsigned yyTshifts; /* * Cact is the corrective action we have decided on * so far, ccost its cost, and cchar the associated token. * Cflag tells if the correction is over the previous input token. */ int cact, ccost, cchar, cflag; /* * ACtok holds the token under * consideration when examining * the lookaheads in a state. */ struct yytok ACtok; #define acchar ACtok.Yychar #define aclval ACtok.Yylval /* * Make a correction to the current stack which has * top of stack pointer Ps. */ yyrecover(Ps0, idfail) int *Ps0, idfail; { register int c, i; int yyrwant, yyrhave; #ifdef PI Recovery = 1; #endif YC = &YC0[1]; #ifdef DEBUG if (errtrace) { setpfx('p'); yerror("Point of error"); printf("States %d %d ...", Ps0[0], Ps0[-1]); if (idfail) printf(" [Idfail]"); pchr('\n'); printf("Input %s%s", tokname(&Y , 0) , tokname(&Y , 1)); } #endif /* * We first save the current input token * and its associated semantic information. */ if (yychar < 0) yychar = yylex(); copy(&YC[0], &Y, sizeof Y); /* * Set the default action and cost */ cact = CPANIC, ccost = CLIMIT, cflag = 0; /* * Peek ahead */ for (yCcnt = 1; yCcnt < YCSIZ; yCcnt++) { yychar = yylex(); copy(&YC[yCcnt], &Y, sizeof YC[0]); #ifdef DEBUG Eprintf(" | %s%s", tokname(&YC[yCcnt] , 0 ) , tokname(&YC[yCcnt] , 1 )); #endif } #ifdef DEBUG Eprintf("\n"); #endif /* * If we are here because a reduction failed, try * correcting that. */ if (idfail) { /* * Save the particulars about * the kind of identifier we want/have. */ yyrwant = yyidwant; yyrhave = yyidhave; #ifdef DEBUG Tprintf(" Try Replace %s identifier with %s identifier cost=%d\n", classes[yyidhave], classes[yyidwant], CCHIDCOST); #endif /* * Save the semantics of the ID on the * stack, and null them out to free * up the reduction in question. */ i = yypv[0]; yypv[0] = nullsem(YID); c = correct(NOCHAR, 0, CCHIDCOST, &repmult[2], Ps0, yypv); yypv[0] = i; #ifdef DEBUG if (c < CPRLIMIT || fulltrace) Eprintf("Cost %2d Replace %s identifier with %s identifier\n", c, classes[yyrhave], classes[yyrwant]); #endif if (c < ccost) cact = CCHIDENT, ccost = c, cchar = YID; } /* * First try correcting the state we are in */ trystate(Ps0, yypv, 0, &insmult[1], &delmult[1], &repmult[1]); /* * Now, if we just shifted over a terminal, try * correcting it. */ if (OY.Yychar != -1 && OY.Yylval != nullsem(OY.Yychar)) { YC--; copy(&YC[0], &OY, sizeof YC[0]); trystate(Ps0 - 1, yypv - 1, 1, insmult, delmult, repmult); if (cflag == 0) YC++; else { yypv--; #ifdef PXP yypw--; #endif Ps0--; yCcnt++; } } /* * Restoring the first look ahead into * the scanner token allows the error message * routine to print the error message with the text * of the correct line. */ copy(&Y, &YC[0], sizeof Y); /* * Unique symbol insertion. * * If there was no reasonable correction found, * but only one input to the parser is acceptable * we report that, and try it. * * Special precautions here to prevent looping. * The number of true inputs shifted over at the point * of the last unique insertion is recorded in the * variable yyTshifts. If this is not less than * the current number in yytshifts, we do not insert. * Thus, after one unique insertion, no more unique * insertions will be made until an input is shifted * over. This guarantees termination. */ if (cact == CPANIC && !idfail) { register int *ap; ap = &yyact[yypact[*Ps0 + 1]]; if (*ap == -ERROR) ap += 2; if (ap[0] <= 0 && ap[2] > 0) { cchar = -ap[0]; if (cchar == YEOF) yyexeof(); if (cchar != ERROR && yyTshifts < yytshifts) { cact = CUNIQUE; #ifdef DEBUG Eprintf("Unique symbol %s%s\n" , charname(cchar , 0 ) , charname(cchar , 1 )); #endif /* * Note that the inserted symbol * will not be counted as a true input * (i.e. the "yytshifts--" below) * so that a true shift will be needed * to make yytshifts > yyTshifts. */ yyTshifts = yytshifts; } } } /* * Set up to perform the correction. * Build a token appropriate for replacement * or insertion in the yytok structure ACchar * having the attributes of the input at the * point of error. */ copy(&ACtok, &YC[0], sizeof ACtok); acchar = cchar; aclval = nullsem(acchar); if (aclval != NIL) recovered(); switch (cact) { /* * Panic, just restore the * lookahead and return. */ case CPANIC: setpfx('E'); if (idfail) { copy(&Y, &OY, sizeof Y); if (yyrhave == NIL) { #ifdef PI if (yybaduse(yypv[0], yyeline, ISUNDEF) == NIL) #endif yerror("Undefined identifier"); } else { yerror("Improper %s identifier", classes[yyrhave]); #ifdef PI yybaduse(yypv[0], yyeline, NIL); #endif } /* * Suppress message from panic routine */ yyshifts = 1; } i = 0; /* Note that on one path we dont touch yyshifts ! */ break; /* * Delete the input. * Mark this as a shift over true input. * Restore the lookahead starting at * the second token. */ case CDELETE: if (ccost != 0) yerror("Deleted %s%s", tokname(&YC[0] , 0 ) , tokname(&YC[0] , 1 )); yytshifts++; i = 1; yyshifts = 0; break; /* * Replace the input with a new token. */ case CREPLACE: if (acchar == YEOF) yyexeof(); if (acchar == YEND) aclval = NIL; yerror("Replaced %s%s with a %s%s", tokname(&YC[0] , 0 ), tokname(&YC[0] , 1 ), tokname(&ACtok , 0 ), tokname(&ACtok , 1 )); copy(&YC[0], &ACtok, sizeof YC[0]); i = 0; yyshifts = 0; break; /* * Insert a token. * Don't count this token as a true input shift. * For inserted "end"s pas.y is responsible * for the error message later so suppress it. * Restore all the lookahead. */ case CINSERT: if (acchar == YEOF) yyexeof(); if (acchar != YEND) yerror("Inserted %s%s", tokname(&ACtok , 0 ), tokname(&ACtok , 1 )); yytshifts--; i = 0; yyshifts = 0; break; /* * Make a unique symbol correction. * Like an insertion but a different message. */ case CUNIQUE: setpfx('E'); yerror("Expected %s%s", tokname(&ACtok , 0 ), tokname(&ACtok , 1 )); yytshifts--; i = 0; if (ccost == 0 || yyunique) yyshifts = 0; else yyshifts = -1; break; /* * Change an identifier's type * to make it work. */ case CCHIDENT: copy(&Y, &OY, sizeof Y); #ifdef PI i = 1 << yyrwant; #endif if (yyrhave == NIL) { yerror("Undefined %s", classes[yyrwant]); #ifdef PI i |= ISUNDEF; #endif } else yerror("Replaced %s id with a %s id", classes[yyrhave], classes[yyrwant]); #ifdef PI yybaduse(yypv[0], yyeline, i); #endif yypv[0] = nullsem(YID); i = 0; yyshifts = 0; break; } /* * Restore the desired portion of the lookahead, * and possibly the inserted or unique inserted token. */ for (yCcnt--; yCcnt >= i; yCcnt--) unyylex(&YC[yCcnt]); if (cact == CINSERT || cact == CUNIQUE) unyylex(&ACtok); /* * Put the scanner back in sync. */ yychar = yylex(); /* * We succeeded if we didn't "panic". */ Recovery = 0; Ps = Ps0; return (cact != CPANIC); } yyexeof() { yerror("End-of-file expected - QUIT"); pexit(ERRS); } yyunexeof() { yerror("Unexpected end-of-file - QUIT"); pexit(ERRS); } /* * Try corrections with the state at Ps0. * Flag is 0 if this is the top of stack state, * 1 if it is the state below. */ trystate(Ps0, Pv0, flag, insmult, delmult, repmult) int *Ps0, *Pv0, flag; char *insmult, *delmult, *repmult; { /* * C is a working cost, ap a pointer into the action * table for looking at feasible alternatives. */ register int c, *ap; int i, *actions; #ifdef DEBUG Eprintf("Trying state %d\n", *Ps0); #endif /* * Try deletion. * Correct returns a cost. */ #ifdef DEBUG Tprintf(" Try Delete %s%s cost=%d\n", tokname(&YC[0] , 0 ), tokname(&YC[0] , 1 ), delcost(YC[0].Yychar)); #endif c = delcost(YC[0].Yychar); #ifndef DEBUG if (c < ccost) { #endif c = correct(NOCHAR, 1, c, delmult, Ps0, Pv0); #ifdef DEBUG if (c < CPRLIMIT || fulltrace) Eprintf("Cost %2d Delete %s%s\n", c, tokname(&YC[0] , 0 ), tokname(&YC[0] , 1 )); #endif if (c < ccost) cact = CDELETE, ccost = c, cflag = flag; #ifndef DEBUG } #endif /* * Look at the inputs to this state * which will cause parse action shift. */ aclval = NIL; ap = &yyact[yypact[*Ps0 + 1]]; /* * Skip action on error to (( * detect true unique inputs. * Error action is always first. */ if (*ap == -ERROR) ap += 2; /* * Loop through the test actions * for this state. */ for (actions = ap; *ap <= 0; ap += 2) { /* * Extract the token of this action */ acchar = -*ap; /* * Try insertion */ #ifdef DEBUG Tprintf(" Try Insert %s%s cost=%d\n" , charname(acchar , 0 ) , charname(acchar , 1 ) , inscost(acchar)); #endif c = inscost(acchar, YC[0].Yychar); #ifndef DEBUG if (c < ccost) { #endif if (c == 0) { c = correct(acchar, 0, 1, insmult + 1, Ps0, Pv0); #ifdef DEBUG Eprintf("Cost %2d Freebie %s%s\n", c , charname(acchar , 0 ) , charname(acchar , 1 )); #endif if (c < ccost) cact = CUNIQUE, ccost = 0, cchar = acchar, cflag = flag; } else { c = correct(acchar, 0, c, insmult, Ps0, Pv0); #ifdef DEBUG if (c < CPRLIMIT || fulltrace) Eprintf("Cost %2d Insert %s%s\n", c , charname(acchar , 0 ) , charname(acchar , 1 )); #endif if (c < ccost) cact = CINSERT, ccost = c, cchar = acchar, cflag = flag; } #ifndef DEBUG } #endif /* * Try replacement */ #ifdef DEBUG Tprintf(" Try Replace %s%s with %s%s cost=%d\n", tokname(&YC[0] , 0 ), tokname(&YC[0] , 1 ), charname(acchar , 0 ), charname(acchar , 1 ), repcost(YC[0].Yychar, acchar)); #endif c = repcost(YC[0].Yychar, acchar); #ifndef DEBUG if (c < ccost) { #endif c = correct(acchar, 1, repcost(YC[0].Yychar, acchar), repmult, Ps0, Pv0); #ifdef DEBUG if (c < CPRLIMIT || fulltrace) Eprintf("Cost %2d Replace %s%s with %s%s\n", c, tokname(&YC[0] , 0 ), tokname(&YC[0] , 1 ), tokname(&ACtok , 0 ), tokname(&ACtok , 1 )); #endif if (c < ccost) cact = CREPLACE, ccost = c, cchar = acchar, cflag = flag; #ifndef DEBUG } #endif } } int *yCpv; char yyredfail; /* * The ntok structure is used to build a * scanner structure for tokens inserted * from the argument "fchar" to "correct" below. */ static struct yytok ntok; /* * Compute the cost of a correction * C is the base cost for it. * Fchar is the first input character from * the current state, NOCHAR if none. * The rest of the inputs come from the array * YC, starting at origin and continuing to the * last character there, YC[yCcnt - 1].Yychar. * * The cost returned is INFINITE if this correction * allows no shifts, otherwise is weighted based * on the number of shifts this allows against the * maximum number possible with the available lookahead. */ correct(fchar, origin, c, multvec, Ps0, Pv0) register int fchar, c; int origin; char *multvec; int *Ps0, *Pv0; { register char *mv; /* * Ps is the top of the parse stack after the most * recent local correctness check. Loccor returns * NIL when we cannot shift. */ register int *ps; yyredfail = 0; /* * Initialize the tip parse and semantic stacks. */ ps = Ps0; yytips[0] = *ps; ps--; yytipv[0] = Pv0[0]; yCpv = Pv0 - 1; yytipct = 1; /* * Shift while possible. * Adjust cost as necessary. */ mv = multvec; do { if (fchar != NOCHAR) { copy(&ntok, &YC[0], sizeof ntok); ntok.Yychar = fchar, ntok.Yylval = nullsem(fchar); fchar = NOCHAR; ps = loccor(ps, &ntok); } else ps = loccor(ps, &YC[origin++]); if (ps == NIL) { if (yyredfail && mv > multvec) mv--; c *= *mv; break; } mv++; } while (*mv != 1); return (c); } extern int yygo[], yypgo[], yyr1[], yyr2[]; /* * Local syntactic correctness check. * The arguments to this routine are a * top of stack pointer, ps, and an input * token tok. Also, implicitly, the contents * of the yytips array which contains the tip * of the stack, and into which the new top * state on the stack will be placed if we shift. * * If we succeed, we return a new top of stack * pointer, else we return NIL. */ loccor(ps, ntok) int *ps; struct yytok *ntok; { register int *p, n; register int nchar; int i; if (ps == NIL) return (NIL); nchar = ntok->Yychar; yyeline = ntok->Yyeline; #ifdef DEBUG Tprintf(" Stack "); for (i = yytipct - 1; i >= 0; i--) Tprintf("%d ", yytips[i]); Tprintf("| %d, Input %s%s\n", *ps , charname(nchar , 0 ) , charname(nchar , 1 )); #endif /* * As in the yacc parser yyparse, * p traces through the action list * and "n" is the information associated * with the action. */ newstate: p = &yyact[ yypact[yytips[yytipct - 1]+1] ]; actn: /* * Search the parse actions table * for something useful to do. * While n is non-positive, it is the * arithmetic inverse of the token to be tested. * This allows a fast check. */ while ((n = *p++) <= 0) if ((n += nchar) != 0) p++; switch (n >> 12) { /* * SHIFT */ case 2: n &= 07777; yyredfail = 0; if (nchar == YID) yyredfail++; if (yytipct == YYTIPSIZ) { tipover: #ifdef DEBUG Tprintf("\tTIP OVFLO\n"); #endif return (NIL); } yytips[yytipct] = n; yytipv[yytipct] = ntok->Yylval; yytipct++; #ifdef DEBUG Tprintf("\tShift to state %d\n", n); #endif return (ps); /* * REDUCE */ case 3: n &= 07777; if (yyEactr(n, yytipv[yytipct - 1]) == 0) { #ifdef DEBUG Tprintf("\tYyEactr objects: have %s id, want %s id\n", classes[yyidhave], classes[yyidwant]); #endif return (NIL); } yyredfail = 0; i = yyr2[n]; #ifdef DEBUG Tprintf("\tReduce, length %d,", i); #endif if (i > yytipct) { i -= yytipct; yytipct = 0; ps -= i; yCpv -= i; } else yytipct -= i; if (yytipct >= YYTIPSIZ) goto tipover; /* * Use goto table to find next state */ p = &yygo[yypgo[yyr1[n]]]; i = yytipct ? yytips[yytipct - 1] : *ps; while (*p != i && *p >= 0) p += 2; #ifdef DEBUG Tprintf(" new state %d\n", p[1]); #endif yytips[yytipct] = p[1]; yytipct++; goto newstate; /* * ACCEPT */ case 4: #ifdef DEBUG Tprintf("\tAccept\n"); #endif return (ps); /* * ERROR */ case 1: #ifdef DEBUG Tprintf("\tError\n"); #endif return (0); } panic("loccor"); } goto tipover; /* * Use goto tablecmd/pi/yyseman.c 644 0 33 1350 2552606463 7046 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)yyseman.c 1.1 8/27/80"; #include "whoami.h" #include "0.h" #include "yy.h" /* * Assign semantics to a generated token * * Most terminals have a semantic value the current * input line. If they are generated they are flagged * by having this number negated. * * The terminals which have true semantics such * as identifiers and strings are instead given * semantic value NIL here - we do not attempt * to do repair, e.g. by giving generated integers * the value 1, etc. */ nullsem(ch) int ch; { switch (ch) { case YID: case YINT: case YNUMB: case YBINT: case YSTRING: return (NIL); default: return (-yyeline); } } als have a semantic value the current * input line. If they are generated they are flagged * by having this number negated. * * The terminals which have true semantics such * as identifiers and strings are instead given * semantic value NIL here - we do not attempt * to dcmd/pi/yytree.c 644 0 33 7740 2552606464 6714 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)yytree.c 1.1 8/27/80"; #include "whoami.h" #include "0.h" #include "tree.h" extern int *spacep; /* * LIST MANIPULATION ROUTINES * * The grammar for Pascal is written left recursively. * Because of this, the portions of parse trees which are to resemble * lists are in the somewhat inconvenient position of having * the nodes built from left to right, while we want to eventually * have as semantic value the leftmost node. * We could carry the leftmost node as semantic value, but this * would be inefficient as to add a new node to the list we would * have to chase down to the end. Other solutions involving a head * and tail pointer waste space. * * The simple solution to this apparent dilemma is to carry along * a pointer to the leftmost node in a list in the rightmost node * which is the current semantic value of the list. * When we have completed building the list, we can retrieve this * left end pointer very easily; neither adding new elements to the list * nor finding the left end is thus expensive. As the bottommost node * has an unused next pointer in it, no space is wasted either. * * The nodes referred to here are of the T_LISTPP type and have * the form: * * T_LISTPP some_pointer next_element * * Here some_pointer points to the things of interest in the list, * and next_element to the next thing in the list except for the * rightmost node, in which case it points to the leftmost node. * The next_element of the rightmost node is of course zapped to the * NIL pointer when the list is completed. * * Thinking of the lists as tree we heceforth refer to the leftmost * node as the "top", and the rightmost node as the "bottom" or as * the "virtual root". */ /* * Make a new list */ newlist(new) register int *new; { if (new == NIL) return (NIL); return (tree3(T_LISTPP, new, spacep)); } /* * Add a new element to an existing list */ addlist(vroot, new) register int *vroot; (( int *new; { register int *top; if (new == NIL) return (vroot); if (vroot == NIL) return (newlist(new)); top = vroot[2]; vroot[2] = spacep; return (tree3(T_LISTPP, new, top)); } /* * Fix up the list which has virtual root vroot. * We grab the top pointer and return it, zapping the spot * where it was so that the tree is not circular. */ fixlist(vroot) register int *vroot; { register int *top; if (vroot == NIL) return (NIL); top = vroot[2]; vroot[2] = NIL; return (top); } /* * Set up a T_VAR node for a qualified variable. * Init is the initial entry in the qualification, * or NIL if there is none. * * if we are building pTrees, there has to be an extra slot for * a pointer to the namelist entry of a field, if this T_VAR refers * to a field name within a WITH statement. * this extra field is set in lvalue, and used in VarCopy. */ setupvar(var, init) char *var; register int *init; { if (init != NIL) init = newlist(init); # ifndef PTREE return (tree4(T_VAR, NOCON, var, init)); # else return tree5( T_VAR , NOCON , var , init , NIL ); # endif } /* * set up a T_TYREC node for a record * * if we are building pTrees, there has to be an extra slot for * a pointer to the namelist entry of the record. * this extra field is filled in in gtype, and used in RecTCopy. */ setuptyrec( line , fldlst ) int line; int *fldlst; { # ifndef PTREE return tree3( T_TYREC , line , fldlst ); # else return tree4( T_TYREC , line , fldlst , NIL ); # endif } /* * set up a T_FIELD node for a field. * * if we are building pTrees, there has to be an extra slot for * a pointer to the namelist entry of the field. * this extra field is set in lvalue, and used in SelCopy. */ setupfield( field , other ) int *field; int *other; { # ifndef PTREE return tree3( T_FIELD , field , other ); # else return tree4( T_FIELD , field , other , NIL ); # endif } return tree4( T_TYREC , line , cmd/delivermail/ 775 0 33 0 2552612046 7012 cmd/delivermail/READ_ME 644 0 37 17371 2522723140 10144 This directory contains the files for delivermail. On some installations it may also contain the source files for auxiliary mailers. NOTE: If you are currently running the initial version of delivermail (delivermail release 1, on the initial release of 4BSD), please pay special attention to the section "Converting from Release 1" toward the bottom of this file. The approximate description of each file is as follows: TO_BE_DONE New features to be put in (maybe) at some time. addr.c Routines to manipulate addresses and address lists. alias.c Does name aliasing in all forms. alias.c.save An old version which has a tentative (and later rejected) method of mail forwarding. arpa-mailer.8 Documentation for arpa.c. arpa.c The auxiliary mailer for the ARPANET. arpadate.c A subroutine used by delivermail & arpa.c which creates ARPANET standard dates. bmove.c A core-to-core move. This is in a seperate file because it can easily be replaced by a blindingly efficient version on Vaxes. conf.c The configuration file. This uses compilation flags from to figure out what to do. This is probably the same as conf.ucb.c. conf.skel.c A stripped version of conf.c; if you are forced to build a configuration file from scratch, you are probably better off starting with this one. conf.ucb.c The version we use at Berkeley. deliver.c Routines to deliver mail, including queueing up for eventual delivery & actual sending. delivermail.8 Documentation for delivermail. dlvrmail.h Main header file for delivermail. err.c Routines to print error messages. logmsg.3 Documentation for the message logging routines (on Ing70 only as of 3/5/80). mail-dm.c Example of the code in server ftp for the Arpanet software. mailaliases.5 Documentation for the alias file used by delivermail. main.c The main routine to delivermail. This file also contains some miscellaneous routines. makefile The makefile used here. maketemp.c The routine that actually reads the mail into a temp file. It also does a certain amount of parsing of the header, etc. matchhdr.c A routine used by delivermail & arpa.c (& others?) which performs a match on ARPANET format header items. parse.c The routines which do address parsing. savemail.c Routines which save the letter on processing errors. sysexits.c List of error messages associated with error codes in sysexits.h. sysexits.h List of exit statuses that could someday become a standard. In any case, they are what delivermail & a handful of other programs use. useful.h A header file containing a few things that appear to be useful for even the most various programs. userinfo.5 Tentative documentation for the proposed (and rejected) user info database. util.c Some general purpose routines used by delivermail. v6-mail.c Local mailer under version 6. This is included to permit you to see the sorts of modifications that had to take place. vax-mail.c Local mailer under VM/UNIX (similar for V7). This is also included as an example. This is more complex than v6-mail.c because it has to be able to deal with UUCP mail also. Beware of local hacks that will not apply to your installation. version.c A file defining the version. This gets bumped every time a new version is installed (theoretically). [This list was current as of 10/27/80] The configuration table distributed here should work with a vanilla system. It will try to figure out who you are from whoami.h. It depends on: BERKELEY -- if set, does all the Berkeley-specific stuff. Other local compilation flags provide machine- specific definition. V6 -- set this if you are on version 6 system. sysname -- a defined constant which is your name on the UUCP net. It is assumed that you are on the UUCP net. There are two tables in conf.c which are critical. The first is the Mailers table. This describes each mailer available to your system. The second is the parse table, describing how to decide what net an address applies to, etc. The comments in the code should explain how to set these up. If you do not have any more nets than berknet, uucp, and arpanet, and if the mailers for these are in the standard places, you probably won't have to touch the Mailers table. You will also have to create a new makefile. There are only two basic types: for a v6 system & for a v7 system. All pathnames & system dependent stuff should be in conf.c. The makefile distributed is for our CSVAX site, and should work for you. You may want to change some of the compile flags as listed in the makefile; these control things like logging, hashed alias tables, and debugging info. You will have to change your equivalent of /bin/mail to take a "-d" flag. If this flag is not asserted, /bin/mail should just turn itself into /etc/delivermail (this is probably in a routine called "bulkmail" or "sendmail"). The code looks like something like: # ifdef DELIVERMAIL {search argv for a -d flag} if (!dflag) { argv[0] = "-delivermail"; argv[argc] = 0; execv(DELIVERMAIL, argv); perror(DELIVERMAIL); } {ignore -d flag in further processing} # endif This is actually somewhat oversimplified. See the example mailers for something more realistic. Besides the mailers in this directory, see ../berknet/v6mail.c. Argv[0] should begin with a "-" to indicate that it is being called from /bin/mail. If you are running server ftp on arpanet, you will have to change the incoming mail routine to accept mail for any address (rather than checking to see that the user exists). Instead of writing the mail in some non-standard mailbox, pipe the mail to /etc/delivermail instead (include the -a flag). Delivermail will mail back a message if the letter can't be sent. Also, I have changed the "success" message to read "Mail accepted" rather than "Mail delivered", since the mere fact that delivermail chewed up the mail does not mean that it has been delivered. Our "mail-dm.c" is given as an example. Sometimes (particularly in Arpa-land) mail comes from a person who doesn't really exist. Some mail will be returned to them from a pseudo-user named MAILER-DAEMON, which will of course be returned. But MAILER-DAEMON does not exist, so it is returned.... and you have a loop. To break this, every site should have the entry: mailer-daemon:root in their aliases file. Converting from Release 1 This is release 2 of delivermail. Some of you have probably spent a fair amount of time building a conf.c. This section describes how to convert your existing conf.c to the new release. Although the changes to delivermail are extensive, the changes to conf.c are quite trivial. Add a line: char *DaemonName = ""; For example: char *DaemonName = "Cory:MAILER-DAEMON"; This is the name the program uses when it returns mail. The old version was not clever about telling which machine generated an error; this fixes this problem. If you do not have a local net, just use: char *DaemonName = "MAILER-DAEMON"; For the purposes of this change, the UUCP net is not considered a local net, but the Berkeley Network is local. I((f you had a line in your "aliases" file of the form: ~mailer~daemon~: root change this to: mailer-daemon: root If you did not have such a line, add it. This insures that mail returned to the mailer daemon won't cause a loop. The change in default name from ~MAILER~DAEMON~ to MAILER-DAEMON is because tilde has special meanings. Add the M_FHDR bit to the status word for mailer # 1 (pipes through programs). The code should now read: /* pipes through programs -- must be #1 */ { "/bin/csh", M_HDR|M_FHDR|M_NOHOST, EX_UNAVAILABLE, NULL, { "...prog%mail", "-fc", "$u", NULL } }, This is part of the fix that tries to keep the date listed on the "From" line as close to the origination date as possible; release 1 always listed the date delivered. t name from ~MAILER~DAEMON~ to MAILER-DAEMON is because tilde has special meanings. Add the M_FHDR bit to the status word for mailer # 1 (pipes through programs). The code should now read: /* pipes through programs -- must be #1 */ { "/bin/csh", M_HDR|M_Fcmd/delivermail/TO_BE_DONE 644 0 37 2434 2516353471 10530 ***** Change sendto & aliasdbm to know about quoted commas. Currently, quoted commas delimit aliases when they should be ignored. **** Collect mail together that can be sent all at once, i.e., create equivalence classes of hosts. This could end up needing great knowledge about network topology, but most errors would end up being inefficient although still ok. *** Put host aliasing into the users file, e.g., ``vax135!:research!vax135!'' This would simplify configuration considerably, but it might not be worth it. For example, this is too sensitive to be in a file that is writable by all users. ** Collect all names that are local in advance, and send them all off to /bin/mail at once -- fork before sending so that we can return status quickly. ** Handle :Include: specifications. * (Somehow) have "From" person modified so that if an alias exists for the person, it will appear post-aliased rather than pre-aliased, especially (perhaps only?) in ARPANET mail. For example, if there exists an alias "fabry->cory:fabry", then if mail comes in from "cory:fabry", make it appear as though it were from "fabry". This should probably be in Mail (put "From" and "Date" lines in) or in the arpa mailer. * Do aliasing on mail being returned also (?). le :Include: specifications. * (Somehow) have "From" person modified so that if an alias exists for the person, it will appear post-aliased rather than pre-aliased, especially (perhaps only?) in ARPANET mail. For exampcmd/delivermail/addr.c 644 0 37 4302 2516353472 10163 # include "dlvrmail.h" static char SccsId[] = "@(#)addr.c 2.1 11/5/80"; /* ** PUTONQ -- put an address node on the end of a queue ** ** Parameters: ** a -- the address to put on the queue. ** q -- the queue to put it on. ** ** Returns: ** none ** ** Side Effects: ** none ** ** Called By: ** alias ** recipient */ putonq(a, q) register addrq *a; register addrq *q; { if (q->q_prev == NULL) { q->q_prev = q->q_next = a; a->q_prev = NULL; } else { a->q_prev = q->q_prev; q->q_prev->q_next = a; q->q_prev = a; } a->q_next = NULL; } /* ** TKOFFQ -- remove address node from queue ** ** Takes a node off of a queue, from anyplace in the queue. ** ** Parameters: ** a -- the node to remove. ** q -- the queue to remove it from. ** ** Returns: ** none ** ** Side Effects: ** none ** ** Called By: ** alias */ tkoffq(a, q) register addrq *a; register addrq *q; { if (a->q_prev != NULL) a->q_prev->q_next = a->q_next; else q->q_next = a->q_next; if (a->q_next != NULL) a->q_next->q_prev = a->q_prev; else q->q_prev = a->q_prev; } /* ** SAMEADDR -- Determine if tow addresses are the same ** ** This is not just a straight comparison -- if the mailer doesn't ** care about the host we just ignore it, etc. ** ** Parameters: ** a, b -- pointers to the internal forms to compare. ** wildflg -- if TRUE, 'a' may have no user specified, ** in which case it is to match anything. ** ** Returns: ** TRUE -- they represent the same mailbox. ** FALSE -- they don't. ** ** Side Effects: ** none. ** ** Called By: ** recipient ** alias */ bool sameaddr(a, b, wildflg) register addrq *a; register addrq *b; bool wildflg; { /* if they don't have the same mailer, forget it */ if (a->q_mailer != b->q_mailer) return (FALSE); /* if the user isn't the same, we can drop out */ if ((!wildflg || a->q_user[0] != '\0') && strcmp(a->q_user, b->q_user) != 0) return (FALSE); /* if the mailer ignores hosts, we have succeeded! */ if (flagset(M_NOHOST, a->q_mailer->m_flags)) return (TRUE); /* otherwise compare hosts (but be careful for NULL ptrs) */ if (a->q_host == NULL || b->q_host == NULL) return (FALSE); if (strcmp(a->q_host, b->q_host) != 0) return (FALSE); return (TRUE); } _mailer != b->q_mailer) return (FALSE); /* if the user isn't the same, we can drop out */ if ((!wildflg || a->q_user[0] != '\0') && strcmp(a->q_user, b->q_user) != 0) return (FALSE); /* if the mailer ignores hosts, we have succeeded! */ if (flagset(M_NOHOST, a->q_mailer->m_flags)) return (TRUE); /* othecmd/delivermail/conf.ucb.c 644 0 37 30546 2552546775 11011 # include # include # include "dlvrmail.h" /* ** CONF.C -- Delivermail Configuration Tables. ** ** Defines the configuration of this installation. ** ** Compilation Flags: ** HASARPA -- set if this machine has a connection to ** the Arpanet. ** HASUUCP -- set if this machine has a connection to ** the UUCP network. ** NETV6MAIL -- set if you want to use "v6mail" that ** comes with the Berkeley network. Normally ** /bin/mail will work fine, but around Berkeley ** we use v6mail because it is a "fixed target". ** Also, only v6mail has the "/dev/mail" stuff ** in it (for biff(1)). ** V6 -- running on a version 6 system. This determines ** whether to define certain routines between ** the two systems. If you are running a funny ** system, e.g., V6 with long tty names, this ** should be checked carefully. ** DUMBMAIL -- set if your /bin/mail doesn't have the ** -d flag. ** ** Configuration Variables: ** ArpaHost -- the arpanet name of the host through ** which arpanet mail will be sent. ** MyLocName -- the name of the host on a local network. ** This is used to disambiguate the contents of ** ArpaHost among many hosts who may be sharing ** a gateway. ** DaemonName -- the name of this agent for use in ** error messages, typically "MAILER-DAEMON" ** at this host on the local net. ** ArpaLocal -- a list of local names for this host on ** the arpanet. Only functional if HASARPA set. ** UucpLocal -- ditto for the Arpanet. ** BerkLocal -- ditto for the Berknet. ** Mailer -- a table of mailers known to the system. ** The fields are: ** - the pathname of the mailer. ** - a list of flags describing the properties ** of this mailer: ** M_FOPT -- if set, the mailer has a picky "-f" ** option. In this mode, the mailer will ** only accept the "-f" option if the ** sender is actually "root", "network", ** and possibly (but not necessarily) if ** the -f argument matches the real sender. ** The effect is that if the "-f" option ** is given to delivermail then it will be ** passed through (as arguments 1 & 2) to ** the mailer. ** M_ROPT -- identical to M_FOPT, except uses ** -r instead. ** M_QUIET -- if set, don't print a message if ** the mailer returns bad status. ** M_RESTR -- if set, this mailer is restricted ** to use by "daemon"; otherwise, we do a ** setuid(getuid()) before calling the ** mailer. ** M_HDR -- if set, the mailer wants us to ** insert a UNIX "From" line before ** outputing. ** M_FHDR -- if set, the header that we ** generate will be used literally, so ** we must force it to be correct. The ** effect is that we generate a header ** even if one exists. ** M_NOHOST -- if set, this mailer doesn't care ** about the host part (e.g., the local ** mailer). ** M_STRIPQ -- if set, strip quote (`"') ** characters out of parameters as you ** transliterate them into the argument ** vector. For example, the local mailer ** is called directly, so these should be ** stripped, but the program-mailer (i.e., ** csh) should leave them in. ** - an exit status to use as the code for the ** error message print if the mailer returns ** something we don't understand. ** - A list of names that are to be considered ** "local" (and hence are stripped off) for ** this mailer. ** - An argument vector to be passed to the ** mailer with the following substitutions: ** $f - the from person name. ** $u - the tar((get user name. ** $h - the target user host. ** $c - the hop count. ** >>>>>>>>>> Entry zero must be for the local ** >> NOTE >> mailer and entry one must be for ** >>>>>>>>>> the shell. ** ParseTab -- a table driving the parsing process. Each ** entry contains: ** - a character that will trigger this entry. ** - an index into the Mailer table. ** - a word of flags, described in dlvrmail.h. ** - an argument. If we have P_MAP, it is the ** character to turn the trigger character into. ** If we have P_MOVE, it is the site to send it ** to, using the mailer specified above. ** This table will almost certainly have to be ** changed on your site if you have anything more ** than the UUCP net. */ static char SccsId[] = "@(#)conf.c 2.7 4/1/81"; bool UseMsgId = FALSE; /* don't put message id's in anywhere */ # include /* definitions of machine id's at berkeley */ # ifdef BERKELEY char *ArpaHost = "Berkeley"; /* host name of gateway on Arpanet */ # define NETV6MAIL /* use /usr/net/bin/v6mail for local delivery */ # else BERKELEY char *ArpaHost = "[unknown]"; char *MyLocName = sysname; # define HASUUCP /* default to having UUCP net */ char *UucpLocal[] = { sysname, NULL }; static char *BerkLocal[1]; # endif BERKELEY /* Specific Configurations for Berkeley Machines */ /* Berkeley people: mail changes to csvax:eric or they will be lost! */ # ifdef ING70 static char *BerkLocal[] = { "i", "ingres", "ing70", NULL }; char *ArpaLocal = { "berkeley", "ucb", NULL }; char *MyLocName = "Ing70"; char *DaemonName = "Ing70:MAILER-DAEMON"; # define HASARPA # define V6 # endif ING70 # ifdef INGVAX static char *BerkLocal[] = { "j", "ingvax", NULL }; char *MyLocName = "IngVax"; char *DaemonName = "IngVax:MAILER-DAEMON"; # endif INGVAX # ifdef CSVAX static char *BerkLocal[] = { "v", "csvax", "vax", NULL }; static char *UucpLocal[] = { "ucbvax", "ernie", NULL }; char *MyLocName = "CSVAX"; char *DaemonName = "CSVAX:MAILER-DAEMON"; # define HASUUCP # endif CSVAX # ifdef ARPAVAX static char *BerkLocal[] = { "r", "arpavax", NULL }; static char *UucpLocal[] = { "arpavax", "bert", NULL }; char *MyLocName = "ARPAVAX"; char *DaemonName = "ARPAVAX:MAILER-DAEMON"; # define HASUUCP # endif ARPAVAX # ifdef CORY static char *BerkLocal[] = { "y", "cory", NULL }; char *MyLocName = "Cory"; char *DaemonName = "Cory:MAILER-DAEMON"; # endif CORY # ifdef ONYX static char *BerkLocal[[] = { "x", "onyx", NULL }; char *MyLocName = "Onyx"; char *DaemonName = "Onyx:MAILER-DAEMON"; # endif ONYX # ifdef IMAGE /* untested */ static char *BerkLocal[] = { "m", "image", NULL }; char *MyLocName = "Image"; char *DaemonName = "Image:MAILER-DAEMON"; # define V6 # endif IMAGE # ifdef ESVAX static char *BerkLocal[] = { "o", "esvax", NULL }; char *MyLocName = "ESVAX"; char *DaemonName = "ESVAX:MAILER-DAEMON"; # endif ESVAX # ifdef EECS40 /* untested */ static char *BerkLocal[] = { "z", "eecs40", NULL }; char *MyLocName = "EECS40"; char *DaemonName = "EECS40:MAILER-DAEMON"; # define V6 # endif EECS40 # ifndef HASARPA # define ArpaLocal NULL # endif HASARPA # ifndef HASUUCP # define UucpLocal NULL # endif HASUUCP struct mailer Mailer[] = { /* local mail -- must be #0 */ { # ifdef NETV6MAIL "/usr/net/bin/v6mail", # else "/bin/mail", # endif M_ROPT|M_NOHOST|M_STRIPQ, EX_NOUSER, NULL, { "...local%mail", "-d", "$u", NULL } }, /* pipes through programs -- must be #1 */ { "/bin/csh", M_HDR|M_FHDR|M_NOHOST, EX_UNAVAILABLE, NULL, { "...prog%mail", "-fc", "$u", NULL } }, /* local berkeley mail */ { "/usr/net/bin/sendberkmail", M_FOPT|M_HDR|M_STRIPQ, EX_UNAVAILABLE, BerkLocal, { "...berk%mail", "-m", "$h", "-t", "$u", "-h", "$c", NULL } }, /* arpanet mail */ { "/usr/lib/mailers/arpa", M_STRIPQ, 0, ArpaLocal, { "...arpa%mail", "$f", "$h", "$u", NULL } }, /* uucp mail (cheat & use Bell's v7 mail) */ { "/bin/mail", M_ROPT|M_STRIPQ, EX_NOUSER, UucpLocal, # ifdef DUMBMAIL { "...uucp%mail", "$h!$u", NULL } # else { "...uucp%mail", "-d", "$h!$u", NULL } # endif DUMBMAIL }, }; # define M_LOCAL 0 # define M_BERK 2 # define M_ARPA 3 # define M_UUCP 4 # ifdef BERKELEY struct parsetab ParseTab[] = { ':', M_BERK, P_ONE, NULL, # ifdef HASARPA '@', M_ARPA, P_HLAST|P_USR_UPPER, NULL, # else '@', M_BERK, P_HLAST|P_USR_UPPER|P_MOVE, "ing70", # endif HASARPA '^', -1, P_MAP, "!", # ifdef HASUUCP '!', M_UUCP, 0, NULL, # else '!', M_BERK, P_MOVE, "csvax", # endif HASUUCP '.', -1, P_MAP|P_ONE, ":", '\0', M_LOCAL, P_MOVE, "", }; # else BERKELEY struct parsetab ParseTab[] = { # ifdef HASARPA '@', M_ARPA, P_HLAST|P_USR_UPPER, NULL, # endif HASARPA # ifdef HASUUCP '^', -1, P_MAP, "!", '!', M_UUCP, 0, NULL, # endif HASUUCP '\0', M_LOCAL, P_MOVE, "", }; # endif BERKELEY /* ** GETNAME -- Get the current users login name. ** ** This is in config.c because it is somewhat machine dependent. ** Examine it carefully for your installation. ** ** Algorithm: ** See if the person is logged in. If so, return ** the name s/he is logged in as. ** Look up the user id in /etc/passwd. If found, ** return that name. ** Return NULL. ** ** Parameters: ** none ** ** Returns: ** The login name of this user. ** NULL if this person is noone. ** ** Side Effects: ** none ** ** Called By: ** main */ char * getname() { register char *p; register struct passwd *w; extern char *getlogin(); extern struct passwd *getpwuid(); static char namebuf[9]; p = getlogin(); if (p != NULL && p[0] != '\0') return (p); # ifdef V6 w = getpwuid(getuid() & 0377); # else w = getpwuid(getuid()); # endif V6 if (w != NULL) { strcpy(namebuf, w->pw_name); return (namebuf); } return (NULL); } # ifdef V6 /* ** TTYPATH -- Get the path of the user's tty -- Version 6 version. ** ** Returns the pathname of the user's tty. Returns NULL if ** the user is not logged in or if s/he has write permission ** denied. ** ** Parameters: ** none ** ** Returns: ** pathname of the user's tty. ** NULL if not logged in or write permission denied. ** ** Side Effects: ** none. ** ** WARNING: ** Return value is in a local buffer. ** ** Called By: ** savemail */ # include # include char * ttypath() { struct stat stbuf; register int i; static char pathn[] = "/dev/ttyx"; extern int errno; /* compute the pathname of the controlling tty */ if ((i = ttyn(2)) == 'x' && (i = ttyn(1)) == 'x' && (i = ttyn(0)) == 'x') { errno = 0; return (NULL); } pathn[8] = i; /* see if we have write permission */ if (stat(pathn, &stbuf) < 0 || !flagset(02, stbuf.st_mode)) { errno = 0; return (NULL); } /* see if the user is logged in */ if (getlogin() == NULL) return (NULL); /* looks good */ return (pathn); } /* ** FDOPEN -- Open a stdio file given an open file descriptor. ** ** This is included here because it is standard in v7, but we ** need it in v6. ** ** Algorithm: ** Open /dev/null to create a descriptor. ** Close that descriptor. ** Copy the existing fd into the descriptor. ** ** Parameters: ** fd -- the open file descriptor. ** type -- "r", "w", or whatever. ** ** Returns: ** The file descriptor it creates. ** ** Side Effects: ** none ** ** Called By: ** deliver ** ** Notes: ** The mode of fd must match "type". */ FILE * fdopen(fd, type) int fd; char *type; { register FILE *f; f = fopen("/dev/null", type); close(fileno(f)); fileno(f) = fd; return (f); } /* ** INDEX -- Return pointer to character in string ** ** For V7 compatibility. ** ** Parameters: ** s -- a string to scan. ** c -- a character to look for. ** ** Returns: ** If c is in s, returns the address of the first ** instance of c in s. ** NULL if c is not in s. ** ** Side Effects: ** none. */ index(s, c) register char *s; register char c; { while (*s != '\0') { if (*s++ == c) return (--s); } return (NULL); } # endif V6 # ifndef V6 /* ** TTYPATH -- Get the path of the user's tty -- Version 7 version. ** ** Returns the pathname of the user's tty. Returns NULL if ** the user is not logged in or if s/he has write permission ** denied. ** ** Parameters: ** none ** ** Returns: ** pathname of the user's tty. ** NULL if not logged in or write permission denied. ** ** Side Effects: ** none. ** ** WARNING: ** Return value is in a local buffer. ** ** Called By: ** savemail */ # include # include char * ttypath() { struct stat stbuf; register char *pathn; extern int errno; extern char *ttyname(); /* compute the pathname of the controlling tty */ if ((pathn = ttyname(2)) == NULL && (pathn = ttyname(1)) == NULL && (pathn = ttyname(0)) == NULL) { errno = 0; return (NULL); } /* see if we have write permission */ if (stat(pathn, &stbuf) < 0 || !flagset(02, stbuf.st_mode)) { errno = 0; return (NULL); } /* see if the user is logged in */ if (getlogin() == NULL) return (NULL); /* looks good */ return (pathn); } # endif V6 er char *pathn; extern int errno; extern char *ttyname(); /* compute the pathname of the controlling tty */ if ((pathn = ttyname(2)) == NULL && (pathcmd/delivermail/alias.c 644 0 37 13754 2516353472 10375 # include # include # include # include "dlvrmail.h" static char SccsId[] = "@(#)alias.c 2.2 12/6/80"; /* ** ALIAS -- Compute aliases. ** ** Scans the file ALIASFILE for a set of aliases. ** If found, it arranges to deliver to them by inserting the ** new names onto the SendQ queue. Uses libdbm database if -DDBM. ** ** Parameters: ** none ** ** Returns: ** none ** ** Side Effects: ** Aliases found on SendQ are removed and put onto ** AliasQ; replacements are added to Send((Q. This is ** done until no such replacement occurs. ** ** Defined Constants: ** MAXRCRSN -- the maximum recursion depth. ** ** Called By: ** main ** ** Files: ** ALIASFILE -- the mail aliases. The format is ** a series of lines of the form: ** alias:name1,name2,name3,... ** where 'alias' expands to all of ** 'name[i]'. Continuations begin with ** space or tab. ** ALIASFILE.pag, ALIASFILE.dir: libdbm version ** of alias file. Keys are aliases, datums ** (data?) are name1,name2, ... ** ** Notes: ** If NoAlias (the "-n" flag) is set, no aliasing is ** done. ** ** Deficiencies: ** It should complain about names that are aliased to ** nothing. ** It is unsophisticated about line overflows. */ # define MAXRCRSN 10 #ifdef DBM typedef struct {char *dptr; int dsize;} datum; datum lhs, rhs; extern datum fetch(); #endif DBM alias() { register addrq *q; addrq *q2; FILE *af; char line[MAXLINE+1]; register char *p; extern int errno; bool didalias; bool gotmatch; auto addrq al; extern bool sameaddr(); extern addrq *parse(); if (NoAlias) return; # ifdef DEBUG if (Debug) printf("--- alias ---\n"); # endif /* open alias file if not already open */ #ifndef DBM # ifdef DEBUG if (Debug && (af = fopen("mailaliases", "r")) != NULL) printf(" [using local alias file]\n"); else # endif if ((af = fopen(ALIASFILE, "r")) == NULL) { # ifdef DEBUG if (Debug) printf("Can't open %s\n", ALIASFILE); # endif errno = 0; return; } #else DBM dbminit(ALIASFILE); #endif DBM #ifndef DBM /* ** Scan alias file. ** If we find any user that any line matches any user, we ** will send to the line rather than to the user. ** ** We pass through the file several times. Didalias tells ** us if we took some alias on this pass through the file; ** when it goes false at the top of the loop we don't have ** to scan any more. Gotmatch tells the same thing, but ** on a line-by-line basis; it is used for processing ** continuation lines. */ do { didalias = FALSE; gotmatch = FALSE; rewind(af); while (fgets(line, sizeof line, af) != NULL) { /* comments begin with `#' */ if (line[0] == '#') continue; /* check for continuation lines */ if (isspace(line[0])) { if (gotmatch) { sendto(line, 1); } continue; } gotmatch = FALSE; /* ** Check to see if this pseudonym exists in SendQ. ** Turn the alias into canonical form. ** Then scan SendQ until you do (or do not) ** find that address. */ /* Get a canonical form for the alias. */ for (p = line; *p != '\0' && *p != ':' && *p != '\n'; p++) continue; if (*p == '\0' || *p == '\n') { syntaxerr: syserr("Bad alias line `%s'", line); continue; } *p++ = '\0'; if (parse(line, &al, -1) == NULL) { *--p = ':'; goto syntaxerr; } /* if already in AliasQ don't realias */ for (q = &AliasQ; (q = nxtinq(q)) != NULL; ) { if (sameaddr(&al, q, TRUE)) break; } if (q != NULL) continue; /* Scan SendQ for that canonical form. */ for (q = &SendQ; (q = nxtinq(q)) != NULL; ) { if (sameaddr(&al, q, TRUE)) break; } if (q != NULL) { /* ** Match on Alias. ** Deliver to the target list. ** Remove the alias from the send queue ** and put it on the Alias queue. */ # ifdef DEBUG if (Debug) printf("%s (%s, %s) aliased to %s (%s,%s,%s)\n", q->q_paddr, q->q_host, q->q_user, p, al.q_paddr, al.q_host, al.q_user); # endif tkoffq(q, &SendQ); didalias++; gotmatch++; sendto(p, 1); putonq(q, &AliasQ); } } } while (didalias); fclose(af); #else DBM /* ** Scan SendQ ** We only have to do this once, since anything we alias ** to is being put at the end of the queue we are ** scanning. ** If the alias on SendQ is also (already) on AliasQ, we ** have an alias such as: ** eric:eric,i:eric ** In this case we have already done this alias once, and ** we don't want to do it again (for obvious reasons!). */ for (q2 = nxtinq(&SendQ); q2 != NULL; ) { /* if already in AliasQ, don't realias */ for (q = &AliasQ; (q = nxtinq(q)) != NULL; ) { if (sameaddr(q, q2, TRUE)) break; } if (q != NULL) { q2 = nxtinq(q2); continue; } /* save ptr to next address */ q = q2; q2 = nxtinq(q); /* only alias local users */ if (q->q_mailer != &Mailer[0]) continue; /* create a key for fetch */ lhs.dptr = q->q_user; lhs.dsize = strlen(q->q_user) + 1; rhs = fetch(lhs); /* find this alias? */ p = rhs.dptr; if (p == NULL) continue; /* ** Match on Alias. ** Deliver to the target list. ** Remove the alias from the send queue ** and put it on the Alias queue. */ # ifdef DEBUG if (Debug) printf("%s (%s, %s) aliased to %s\n", q->q_paddr, q->q_host, q->q_user, p); # endif tkoffq(q, &SendQ); sendto(p, 1); putonq(q, &AliasQ); /* if our last entry had an alias, process them */ if (q2 == NULL) q2 = nxtinq(&SendQ); } #endif DBM } /* ** FORWARD -- Try to forward mail ** ** This is similar but not identical to aliasing. ** ** Currently it is undefined, until the protocol for userinfo ** databases is finalized. ** ** Parameters: ** user -- the name of the user who's mail we ** would like to forward to. ** ** Returns: ** TRUE -- we have forwarded it somewhere. ** FALSE -- not forwarded; go ahead & deliver. ** ** Side Effects: ** New names are added to SendQ. ** ** Called By: ** recipient */ bool forward(user) addrq *user; { return (FALSE); } Try to forward mailcmd/delivermail/conf.c 644 0 37 30612 2552547044 10221 # include # include # include "dlvrmail.h" /* ** CONF.C -- Delivermail Configuration Tables. ** ** Defines the configuration of this installation. ** ** Compilation Flags: ** HASARPA -- set if this machine has a connection to ** the Arpanet. ** HASUUCP -- set if this machine has a connection to ** the UUCP network. ** NETV6MAIL -- set if you want to use "v6mail" that ** comes with the Berkeley network. Normally ** /bin/mail will work fine, but around Berkeley ** we use v6mail because it is a "fixed target". ** Also, only v6mail has the "/dev/mail" stuff ** in it (for biff(1)). ** V6 -- running on a version 6 system. This determines ** whether to define certain routines between ** the two systems. If you are running a funny ** system, e.g., V6 with long tty names, this ** should be checked carefully. ** DUMBMAIL -- set if your /bin/mail doesn't have the ** -d flag. ** ** Configuration Variables: ** ArpaHost -- the arpanet name of the host through ** which arpanet mail will be sent. ** MyLocName -- the name of the host on a local network. ** This is used to disambiguate the contents of ** ArpaHost among many hosts who may be sharing ** a gateway. ** DaemonName -- the name of this agent for use in ** error messages, typically "MAILER-DAEMON" ** at this host on the local net. ** ArpaLocal -- a list of local names for this host on ** the arpanet. Only functional if HASARPA set. ** UucpLocal -- ditto for the Arpanet. ** BerkLocal -- ditto for the Berknet. ** Mailer -- a table of mailers known to the system. ** The fields are: ** - the pathname of the mailer. ** - a list of flags describing the properties ** of this mailer: ** M_FOPT -- if set, the mailer has a picky "-f" ** option. In this mode, the mailer will ** only accept the "-f" option if the ** sender is actually "root", "network", ** and possibly (but not necessarily) if ** the -f argument matches the real sender. ** The effect is that if the "-f" option ** is given to delivermail then it will be ** passed through (as arguments 1 & 2) to ** the mailer. ** M_ROPT -- identical to M_FOPT, except uses ** -r instead. ** M_QUIET -- if set, don't print a message if ** the mailer returns bad status. ** M_RESTR -- if set, this mailer is restricted ** to use by "daemon"; otherwise, we do a ** setuid(getuid()) before calling the ** mailer. ** M_HDR -- if set, the mailer wants us to ** insert a UNIX "From" line before ** outputing. ** M_FHDR -- if set, the header that we ** generate will be used literally, so ** we must force it to be correct. The ** effect is that we generate a header ** even if one exists. ** M_NOHOST -- if set, this mailer doesn't care ** about the host part (e.g., the local ** mailer). ** M_STRIPQ -- if set, strip quote (`"') ** characters out of parameters as you ** transliterate them into the argument ** vector. For example, the local mailer ** is called directly, so these should be ** stripped, but the program-mailer (i.e., ** csh) should leave them in. ** - an exit status to use as the code for the ** error message print if the mailer returns ** something we don't understand. ** - A list of names that are to be considered ** "local" (and hence are stripped off) for ** this mailer. ** - An argument vector to be passed to the ** mailer with the following substitutions: ** $f - the from person name. ** $u - the target user name. ** $h - the target user host. ** $c - the hop count. ** >>>>>>>>>> Entry zero must be for the local ** >> NOTE >> mailer and entry one must be for ** >>>>>>>>>> the shell. ** ParseTab -- a table driving the parsing process. Each ** entry contains: ** - a character that will trigger this entry. ** - an index into the Mailer table. ** - a word of flags, described in dlvrmail.h. ** - an argument. If we have P_MAP, it is the ** character to turn the trigger charac((ter into. ** If we have P_MOVE, it is the site to send it ** to, using the mailer specified above. ** This table will almost certainly have to be ** changed on your site if you have anything more ** than the UUCP net. */ static char SccsId[] = "@(#)conf.c 2.7 4/1/81"; bool UseMsgId = FALSE; /* don't put message id's in anywhere */ # include /* definitions of machine id's at berkeley */ # ifdef BERKELEY char *ArpaHost = "Berkeley"; /* host name of gateway on Arpanet */ # define NETV6MAIL /* use /usr/net/bin/v6mail for local delivery */ # else BERKELEY char *ArpaHost = "[unknown]"; char *MyLocName = sysname; # define HASUUCP /* default to having UUCP net */ char *UucpLocal[] = { sysname, NULL }; char *DaemonName = "MAILER-DAEMON"; static char *BerkLocal[1]; # endif BERKELEY /* Specific Configurations for Berkeley Machines */ /* Berkeley people: mail changes to csvax:eric or they will be lost! */ # ifdef ING70 static char *BerkLocal[] = { "i", "ingres", "ing70", NULL }; char *ArpaLocal = { "berkeley", "ucb", NULL }; char *MyLocName = "Ing70"; char *DaemonName = "Ing70:MAILER-DAEMON"; # define HASARPA # define V6 # endif ING70 # ifdef INGVAX static char *BerkLocal[] = { "j", "ingvax", NULL }; char *MyLocName = "IngVax"; char *DaemonName = "IngVax:MAILER-DAEMON"; # endif INGVAX # ifdef CSVAX static char *BerkLocal[] = { "v", "csvax", "vax", NULL }; static char *UucpLocal[] = { "ucbvax", "ernie", NULL }; char *MyLocName = "CSVAX"; char *DaemonName = "CSVAX:MAILER-DAEMON"; # define HASUUCP # endif CSVAX # ifdef ARPAVAX static char *BerkLocal[] = { "r", "arpavax", NULL }; static char *UucpLocal[] = { "arpavax", "bert", NULL }; char *MyLocName = "ARPAVAX"; char *DaemonName = "ARPAVAX:MAILER-DAEMON"; # define HASUUCP # endif ARPAVAX # ifdef CORY static char *BerkLocal[] = { "y", "cory", NULL }; char *MyLocName = "Cory"; char *DaemonName = "Cory:MAILER-DAEMON"; # endif CORY # ifdef ONYX static char *BerkLocal[[] = { "x", "onyx", NULL }; char *MyLocName = "Onyx"; char *DaemonName = "Onyx:MAILER-DAEMON"; # endif ONYX # ifdef IMAGE /* untested */ static char *BerkLocal[] = { "m", "image", NULL }; char *MyLocName = "Image"; char *DaemonName = "Image:MAILER-DAEMON"; # define V6 # endif IMAGE # ifdef ESVAX static char *BerkLocal[] = { "o", "esvax", NULL }; char *MyLocName = "ESVAX"; char *DaemonName = "ESVAX:MAILER-DAEMON"; # endif ESVAX # ifdef EECS40 /* untested */ static char *BerkLocal[] = { "z", "eecs40", NULL }; char *MyLocName = "EECS40"; char *DaemonName = "EECS40:MAILER-DAEMON"; # define V6 # endif EECS40 # ifndef HASARPA # define ArpaLocal NULL # endif HASARPA # ifndef HASUUCP # define UucpLocal NULL # endif HASUUCP struct mailer Mailer[] = { /* local mail -- must be #0 */ { # ifdef NETV6MAIL "/usr/net/bin/v6mail", # else "/bin/mail", # endif M_ROPT|M_NOHOST|M_STRIPQ, EX_NOUSER, NULL, { "...local%mail", "-d", "$u", NULL } }, /* pipes through programs -- must be #1 */ { "/bin/csh", M_HDR|M_FHDR|M_NOHOST, EX_UNAVAILABLE, NULL, { "...prog%mail", "-fc", "$u", NULL } }, /* local berkeley mail */ { "/usr/net/bin/sendberkmail", M_FOPT|M_HDR|M_STRIPQ, EX_UNAVAILABLE, BerkLocal, { "...berk%mail", "-m", "$h", "-t", "$u", "-h", "$c", NULL } }, /* arpanet mail */ { "/usr/lib/mailers/arpa", M_STRIPQ, 0, ArpaLocal, { "...arpa%mail", "$f", "$h", "$u", NULL } }, /* uucp mail (cheat & use Bell's v7 mail) */ { "/bin/mail", M_ROPT|M_STRIPQ, EX_NOUSER, UucpLocal, # ifdef DUMBMAIL { "...uucp%mail", "$h!$u", NULL } # else { "...uucp%mail", "-d", "$h!$u", NULL } # endif DUMBMAIL }, }; # define M_LOCAL 0 # define M_BERK 2 # define M_ARPA 3 # define M_UUCP 4 # ifdef BERKELEY struct parsetab ParseTab[] = { ':', M_BERK, P_ONE, NULL, # ifdef HASARPA '@', M_ARPA, P_HLAST|P_USR_UPPER, NULL, # else '@', M_BERK, P_HLAST|P_USR_UPPER|P_MOVE, "ing70", # endif HASARPA '^', -1, P_MAP, "!", # ifdef HASUUCP '!', M_UUCP, 0, NULL, # else '!', M_BERK, P_MOVE, "csvax", # endif HASUUCP '.', -1, P_MAP|P_ONE, ":", '\0', M_LOCAL, P_MOVE, "", }; # else BERKELEY struct parsetab ParseTab[] = { # ifdef HASARPA '@', M_ARPA, P_HLAST|P_USR_UPPER, NULL, # endif HASARPA # ifdef HASUUCP '^', -1, P_MAP, "!", '!', M_UUCP, 0, NULL, # endif HASUUCP '\0', M_LOCAL, P_MOVE, "", }; # endif BERKELEY /* ** GETNAME -- Get the current users login name. ** ** This is in config.c because it is somewhat machine dependent. ** Examine it carefully for your installation. ** ** Algorithm: ** See if the person is logged in. If so, return ** the name s/he is logged in as. ** Look up the user id in /etc/passwd. If found, ** return that name. ** Return NULL. ** ** Parameters: ** none ** ** Returns: ** The login name of this user. ** NULL if this person is noone. ** ** Side Effects: ** none ** ** Called By: ** main */ char * getname() { register char *p; register struct passwd *w; extern char *getlogin(); extern struct passwd *getpwuid(); static char namebuf[9]; p = getlogin(); if (p != NULL && p[0] != '\0') return (p); # ifdef V6 w = getpwuid(getuid() & 0377); # else w = getpwuid(getuid()); # endif V6 if (w != NULL) { strcpy(namebuf, w->pw_name); return (namebuf); } return (NULL); } # ifdef V6 /* ** TTYPATH -- Get the path of the user's tty -- Version 6 version. ** ** Returns the pathname of the user's tty. Returns NULL if ** the user is not logged in or if s/he has write permission ** denied. ** ** Parameters: ** none ** ** Returns: ** pathname of the user's tty. ** NULL if not logged in or write permission denied. ** ** Side Effects: ** none. ** ** WARNING: ** Return value is in a local buffer. ** ** Called By: ** savemail */ # include # include char * ttypath() { struct stat stbuf; register int i; static char pathn[] = "/dev/ttyx"; extern int errno; /* compute the pathname of the controlling tty */ if ((i = ttyn(2)) == 'x' && (i = ttyn(1)) == 'x' && (i = ttyn(0)) == 'x') { errno = 0; return (NULL); } pathn[8] = i; /* see if we have write permission */ if (stat(pathn, &stbuf) < 0 || !flagset(02, stbuf.st_mode)) { errno = 0; return (NULL); } /* see if the user is logged in */ if (getlogin() == NULL) return (NULL); /* looks good */ return (pathn); } /* ** FDOPEN -- Open a stdio file given an open file descriptor. ** ** This is included here because it is standard in v7, but we ** need it in v6. ** ** Algorithm: ** Open /dev/null to create a descriptor. ** Close that descriptor. ** Copy the existing fd into the descriptor. ** ** Parameters: ** fd -- the open file descriptor. ** type -- "r", "w", or whatever. ** ** Returns: ** The file descriptor it creates. ** ** Side Effects: ** none ** ** Called By: ** deliver ** ** Notes: ** The mode of fd must match "type". */ FILE * fdopen(fd, type) int fd; char *type; { register FILE *f; f = fopen("/dev/null", type); close(fileno(f)); fileno(f) = fd; return (f); } /* ** INDEX -- Return pointer to character in string ** ** For V7 compatibility. ** ** Parameters: ** s -- a string to scan. ** c -- a character to look for. ** ** Returns: ** If c is in s, returns the address of the first ** instance of c in s. ** NULL if c is not in s. ** ** Side Effects: ** none. */ index(s, c) register char *s; register char c; { while (*s != '\0') { if (*s++ == c) return (--s); } return (NULL); } # endif V6 # ifndef V6 /* ** TTYPATH -- Get the path of the user's tty -- Version 7 version. ** ** Returns the pathname of the user's tty. Returns NULL if ** the user is not logged in or if s/he has write permission ** denied. ** ** Parameters: ** none ** ** Returns: ** pathname of the user's tty. ** NULL if not logged in or write permission denied. ** ** Side Effects: ** none. ** ** WARNING: ** Return value is in a local buffer. ** ** Called By: ** savemail */ # include # include char * ttypath() { struct stat stbuf; register char *pathn; extern int errno; extern char *ttyname(); /* compute the pathname of the controlling tty */ if ((pathn = ttyname(2)) == NULL && (pathn = ttyname(1)) == NULL && (pathn = ttyname(0)) == NULL) { errno = 0; return (NULL); } /* see if we have write permission */ if (stat(pathn, &stbuf) < 0 || !flagset(02, stbuf.st_mode)) { errno = 0; return (NULL); } /* see if the user is logged in */ if (getlogin() == NULL) return (NULL); /* looks good */ return (pathn); } # endif V6 er char *pathn; extern int errno; extern char *ttyname(); /* compute the pathname of the controlling tty */ if ((cmd/delivermail/arpa-mailer.8 644 0 37 1531 2516353473 11372 .TH ARPA-MAILER 8 12/31/79 .SH NAME arpa-mailer \- deliver mail to the .SM ARPANET .SH SYNOPSIS /usr/lib/mailers/arpa .I from-address .I to-host .I to-user .SH DESCRIPTION .I Arpa-mailer queues the letter found on its standard input for delivery to the host and user specified. The actual delivery will be performed by the .SM ARPANET mailer daemon. .PP If the letter does not appear to have a full .SM ARPANET header, .I arpa-mailer will insert ``Date:'' and ``From:'' fields in the proper format. The ``From:'' person is determined by the from-address argument, with colons translated to periods and ``@Berkeley'' appended. The from-address argument is also used by the mailer daemon to return the mail to you if there is a problem at the receiving host. .SH FILES .RI /dev/net/ to-host .br /usr/spool/netmail/* .SH SEE\ ALSO delivermail(8), mailer(ARPA) mon. .PP If the letter does not appear to have a full .SM ARPANET header, .I arpa-mailer will insert ``Date:'' and ``From:'' fields in the proper format. The ``From:''((cmd/delivermail/arpa.c 644 0 37 25215 2516353474 10224 # include # include # include # include # include "useful.h" static char SccsId[] = "@(#)arpa.c 2.2 1/11/81"; char Version[] = "@(#)Arpa-mailer version 2.2 of 1/11/81"; /* ** ARPA MAILER -- Queue ARPANET mail for eventual delivery ** ** The standard input is stuck away in the outgoing arpanet ** mail queue for delivery by the true arpanet mailer. ** ** Usage: ** /usr/lib/mailers/arpa from host user ** ** Positional Parameters: ** from -- the person sending the mail. ** host -- the host to send the mail to. ** user -- the user to send the mail to. ** ** Flags: ** -T -- debug flag. ** ** Files: ** /usr/spool/netmail/* -- the queue file. ** ** Return Codes: ** 0 -- all messages successfully mailed. ** 2 -- user or host unknown. ** 3 -- service unavailable, probably temporary ** file system condition. ** 4 -- syntax error in address. ** ** Compilation Flags: ** SPOOLDIR -- the spool directory ** ** Compilation Instructions: ** cc -n -O -s arpa-mailer.c -o arpa-mailer -lX ** chmod 755 arpa-mailer ** mv arpa-mailer /usr/lib/mailers/arpa ** ** Author: ** Eric Allman, UCB/INGRES (eric@berkeley) */ # define SPOOLDIR "/usr/spool/netmail" char *From; /* person sending this mail */ char *To; /* current "To:" person */ int State; /* the current state (for exit codes) */ # ifdef DEBUG bool Tflag; /* -T given */ # endif DEBUG char FromHost[200]; /* string to prepend to addresses */ /* ** MAIN -- Main program for arpa mailer ** ** Processes arguments, and calls sendmail successively on ** the To: list. ** ** Algorithm: ** Scan for debug flag. ** Catch interrupt signals. ** Collect input file name and from person. ** If more than one person in the to list, and ** if the input file is not a real file, ** collect input into a temp file. ** For each person in the to list ** Send to that person. ** ** Parameters: ** argc ** argv -- as usual ** ** Returns: ** via exit ** ** Side Effects: ** Mail gets sent. ** ** Called By: ** /etc/delivermail ** ** Author: ** Eric Allman UCB/INGRES. */ main(argc, argv) int argc; char **argv; { register int i; register char *p; register int ifd; char buf[512]; extern int finis(); extern char *locv(); register char *q; char *lastmark; State = 3; if (signal(SIGINT, SIG_IGN) != SIG_IGN) signal(SIGINT, finis); /* process flags */ argv[argc] = 0; # ifdef DEBUG if (strcmp(argv[1], "-T") == 0) { Tflag++; argv++; argc--; printf("%s\n", Version); } # endif DEBUG if (argc != 4) { rexit (EX_SOFTWARE); } /* decode parameters */ From = argv[1]; lastmark = &FromHost[-1]; for (p = From, q = FromHost; (*q = *p) != '\0'; p++, q++) { if (*p == ':') *q = *p = '.'; if (*q == '.' || *q == '!' || *q == '@') lastmark = q; } lastmark[1] = '\0'; /* start sending mail */ State = sendmail(argv[2], argv[3]); /* all done, clean up */ finis(); } /* ** FINIS -- Finish up, remove temp files, etc. ** ** This does basic cleanup on interrupt, error, or ** normal termination. It uses "State" to tell which ** is happening. ** ** Parameters: ** none ** ** Returns: ** none ** ** Side Effects: ** Exit(State). ** ** Called By: ** interrupt signal. ** main */ finis() { rexit(State); } /* ** REXIT -- exit, reporting error code if -T given ** ** Parameters: ** e -- error code to exit with; see sysexits.h ** ** Returns: ** none ** ** Side Effects: ** Exit(e). ** ** Called By: ** main ** finis ** sendmail */ rexit(e) { # ifdef DEBUG if (Tflag) fprintf(stderr, "arpa-mail: return code %d\n", e); # endif exit(e); } /* ** SENDMAIL -- Queue up mail for the arpanet mailer. ** ** The mail is inserted with proper headers into the ** arpanet queue directory. ** ** Algorithm: ** decode "to" address ** if error, exit. ** create a spool file name. ** output the header information to spool file, ** separate names in To:, CC: fields with commas. ** copy the mail to the spool file. ** ** Parameters: ** host -- the host to send to. ** user -- the user to send to. ** ** Returns: ** none ** ** Side Effects: ** the mail is copied into a file in the network ** queue directory (/usr/spool/netmail). ** ** Called By: ** main */ sendmail(host, user) char *host; char *user; { char spoolfile[50]; /* gets the spool file name */ register int i; register char *p; static int callnum; /* for the final letter on spoolfile */ char buf[512]; register FILE *sfp; /* spool file */ register int c; extern char *matchhdr(); /* verify that the host exists */ #ifndef TESTING strcpy(buf, "/dev/net/"); strcat(buf, host); if (host[0] == '\0' || access(buf, 0) < 0) return (EX_NOHOST); #endif TESTING /* ** Create spool file name. ** Format is "username000nnX", where username is ** padded on the right with zeros and nn (the process ** id) is padded on the left with zeros; X is a unique ** sequence character. */ # ifdef DEBUG if (Tflag) strcpy(spoolfile, "test.out"); # endif DEBUG else sprintf(spoolfile, "%s/arpamail%05d%c", SPOOLDIR, getpid(), 'a' + callnum++); /* create spool file */ sfp = fopen(spoolfile, "w"); if (sfp == NULL) { spoolerr: return (EX_OSERR); } # ifdef DEBUG if (!Tflag) # endif DEBUG chmod(spoolfile, 0400); /* ** Output mailer control lines. ** These lines are as follows: ** /dev/net/ {target host} ** user-name {at target host} ** /mnt/eric {pathname of sender; not used} ** eric {name of user who is sending} */ fputs(buf, sfp); fputs("\n", sfp); fputs(user, sfp); fputs("\n\n", sfp); fputs(From, sfp); fputs("\n", sfp); /* ** Output the mail ** Check the first line for the date. If not found, ** assume the message is not in arpanet standard format ** and output a "Date:" and "From:" header. */ if (fgets(buf, sizeof buf, stdin) == NULL) { /* no message */ unlink(spoolfile); return (EX_OK); } if (strncmp("From ", buf, 5) == 0) { /* strip Unix "From" line */ /* should save the date here */ fgets(buf, sizeof buf, stdin); } if (matchhdr(buf, "date") == NULL) putdate(sfp); if (!ishdr(buf)) { putc('\n', sfp); goto hdrdone; } /* ** At this point, we have a message with REAL headers. ** We look at each head line and insert commas if it ** is a To: or Cc: field. */ do { if (!ishdr(buf)) break; if (!matchhdr(buf, "to") && !matchhdr(buf, "cc")) { fputs(buf, sfp); continue; } /* gotcha! */ rewrite(buf, 1, sfp); while (isspace(c = peekc(stdin)) && c != '\n') { fgets(buf, BUFSIZ, stdin); rewrite(buf, 0, sfp); } } while (fgets(buf, BUFSIZ, stdin) != NULL); hdrdone: /* output the rest of the header & the body of the letter */ do { fputs(buf, sfp); if (ferror(sfp)) goto spoolerr; } while (fgets(buf, sizeof buf, stdin) != NULL); /* all done! */ fclose(sfp); return (EX_OK); } /* ** REWRITE -- Output header line with needed commas. ** ** Parameters: ** buf -- header line ** first -- true if this is not a continuation ** ** Returns: ** none ** ** Side effects: ** The contents of buf is copied onto the spool file with ** with the right commas interlaced ** ** Called by: ** sendmail */ rewrite(buf, first, spf) char buf[]; register FILE *spf; { register char *cp; register int c; char word[BUFSIZ], word2[BUFSIZ]; char *gword(); static char wsep[] = ", "; cp = buf; if (first) { while (*cp != ':' && *cp) putc(*cp++, spf); if (*cp == ':') { fputs(": ", spf); cp++; } } else while (*cp && isspace(*cp)) putc(*cp++, spf); cp = gword(word, cp); if (strlen(word) == 0) { putc('\n', spf); goto test; } for (;;) { cp = gword(word2, cp); if (strlen(word2) == 0) { putaddr(word, spf); break; } if (strcmp(word2, "%") == 0) word2[0] = '@'; if (strcmp(word2, "@") && strcmp(word2, "at")) { putaddr(word, spf); fputs(wsep, spf); strcpy(word, word2); continue; } fputs(word, spf); if (word2[0] == '@') putc('@', spf); else fputs(" at ", spf); cp = gword(word, cp); fputs(word, spf); cp = gword(word, cp); if (strlen(word)) fputs(wsep, spf); } test: c = peekc(stdin); if (isspace(c) && c != '\n') fputs(",\n", spf); else putc('\n', spf); } /* ** PUTADDR -- output address onto file ** ** Putaddr prepends the network header onto the address ** unless one already exists. ** ** Parameters: ** name -- the name to output. ** fp -- the file to put it on. ** ** Returns: ** none. ** ** Side Effects: ** name is put onto fp. */ putaddr(name, fp) char *name; FILE *fp; { register char *p; if (strlen(name) == 0) return; for (p = name; *p != '\0' && *p != ':' && *p != '.' && *p != '@' && *p != '!' && *p != '^'; p++) continue; if (*p == ':') *p = '.'; else if (*p == '\0') fputs(FromHost, fp); fputs(name, fp); if (*p != '@') fputs("@Berkeley", fp); } /* ** PEEKC -- peek at next character in input file ** ** Parameters: ** fp -- stdio file buffer ** ** Returns: ** the next character in the input or EOF ** ** Side effects: ** None. ** ** Called by: ** sendmail ** rewrite */ peekc(fp) register FILE *fp; { register int c; c = getc(fp); ungetc(c, fp); return(c); } /* ** GWORD -- get the next liberal word from a string ** ** Parameters: ** buf -- place to put scanned word ** p -- place to start looking for word ** ** Returns: ** updated value of p or 0 if no more left after this ** ** Side effects: ** buf gets the liberal word scanned. ** buf will be length 0 if there is no more input, ** or if p was passed as 0 ** ** Called by: ** rewrite */ char * gword(buf, p) char buf[]; register char *p; { register char *sp, *dp; strcpy(buf, ""); if (((p == 0) return(0); sp = p; while (*sp && (isspace(*sp) || *sp == ',')) sp++; dp = buf; if (*sp != '%' && *sp != '@') { while (*sp && !isspace(*sp) && *sp != ',' && *sp != '%' && *sp != '@') *dp++ = *sp++; } else *dp++ = *sp++; *dp = 0; if (*sp == 0) return(0); return(sp); } /* ** ISHDR -- see if the passed line is a ARPA style header line ** ** Parameters: ** buf -- header line ** ** Returns: ** non-zero if the line is a header line, else zero ** ** Side effects: ** none ** ** Called by: ** sendmail */ ishdr(buf) char buf[]; { register char *p; p = buf; if (isspace(*p)) p = 0; else { while (*p != ':' && !isspace(*p)) p++; while (isspace(*p)) p++; if (*p != ':') p = 0; } return(p != 0); } /* ** PUTDATE -- Put the date & from field into the message. ** ** Parameters: ** fp -- file to put them onto. ** ** Returns: ** none ** ** Side Effects: ** output onto fp. ** ** Called By: ** sendmail */ putdate(fp) register FILE *fp; { register char *p; fputs("Date: ", fp); fputs(arpadate(), fp); /* output from field */ fputs("\nFrom: ", fp); fputs(From, fp); fputs(" at Berkeley\n", fp); } isspace(*p)) p++; while (isspace(*p)) p++; if (*p != ':') p = 0; } return(p != 0); } /* ** PUTDATE -- Put the date & from field into the message. ** ** Parameters: ** fp -- file to put them onto. ** ** Returns: ** none ** ** Side Effects: ** output onto fp. ** ** Called By: ** sendmail */ putdate(fp) register FILE *fp; { register char *p; fputcmd/delivermail/arpadate.c 644 0 37 1551 2516353474 11037 # include static char SccsId[] = "@(#)arpadate.c 2.1 11/5/80"; /* ** ARPADATE -- Create date in ARPANET format ** ** Parameters: ** none ** ** Returns: ** pointer to an ARPANET date field ** ** Side Effects: ** none ** ** WARNING: ** date is stored in a local buffer -- subsequent ** calls will overwrite. */ char * arpadate() { register char *ud; /* the unix date */ long t; extern struct tm *localtime(); register char *p; static char b[40]; extern char *ctime(); time(&t); ud = ctime(&t); ud[3] = ud[7] = ud[10] = ud[19] = ud[24] = '\0'; p = &ud[8]; /* 16 */ if (*p == ' ') p++; strcpy(b, p); strcat(b, " "); strcat(b, &ud[4]); /* Sep */ strcat(b, " "); strcat(b, &ud[20]); /* 1979 */ strcat(b, " "); strcat(b, &ud[11]); /* 01:03:52 */ if (localtime(&t)->tm_isdst) strcat(b, "-PDT"); else strcat(b, "-PST"); return (b); } *ud; /* the unix date */ long t; extern struct tm *localtime(); register char *p; static char b[40]; extern char *ctime(); time(&t); ud = ctimcmd/delivermail/bmove.11.s 644 0 37 3400 2516353474 10621 / / BMOVE -- block move / / @(#)bmove.11.s 2.1 11/5/80 / / This is a highly optimized version of the old C-language / bmove routine; it's function (should be) identical. / It uses a fancy algorithm to move words instead of bytes / whenever possible. / / In C the routine is: / char *bmove(a, b, l) / char *a, *b; / int l; / { / register int n; / register char *p, *q; / p = a; / q = b; / n = l; / while (n--) / *q++ = *p++; / return (q); / } / / Parameters: / a [4(sp)] -- source area / b [6(sp)] -- target area / l [10(sp)] -- byte count / / Returns: / Pointer to end of target area. / / History: / 3/14/79 [rse] -- added odd to odd case / 2/9/78 [bob] -- converted from "C" / / .globl _bmove _bmove: mov r2,-(sp) / save r2 mov 4(sp),r1 / get src address mov 6(sp),r0 / get dst address / determine whether to use word or byte move mov r0,r2 / r2 will reflect the three cases bic $177776,r2 / keep only last bit of dst ror 4(sp) / get least significant bit of src adc r2 / add it in. beq wordm / both on even boundary dec r2 / check for odd case bgt wordodd / both on odd boundary mov 10(sp),r2 / get count beq done bytem: movb (r1)+,(r0)+ / copy next byte sob r2,bytem / branch until done br done wordm: mov 10(sp),r2 / get count wordt: beq done asr r2 / get word count bcs odd / count was odd even: mov (r1)+,(r0)+ / copy word sob r2,even / more to do if non-zero br done wordodd: mov 10(sp),r2 / get count beq done movb (r1)+,(r0)+ / copy byte dec r2 / dec count br wordt / now treat as an even word move odd: beq odd2 / special case of count = 1 odd1: mov (r1)+,(r0)+ / copy word sob r2,odd1 / continue odd2: movb (r1)+,(r0)+ / count was odd. do last one done: mov (sp)+,r2 / restore r2 rts pc / return t count wordt: beq done asr r2 / get word count bcs odd / count was odd even: mov (r1)+,(r0)+ / copy word sob r2,even / more to do if non-zero br done wordodd: mov 10(sp),r2 / get count beq done movb (r1)+,(r0)+ / copy byte dec r2 / dec councmd/delivermail/bmove.c 644 0 37 172 2516353474 10344 /* @(#)bmove.c 2.1 11/5/80 */ bmove(s, d, l) register char *s, *d; register int l; { while (l-- > 0) *d++ = *s++; } ord sob r2,odd1 / continue odd2: movb (r1)+,(r0)+ / count was odd. do last one done: mov (sp)+,r2 / restore r2 rts pc / return t count wordt: beq done asr r2 / get word count bcs odd / count was odd even: mov (r1)+,(r0)+ / copy word sob r2,even / more to do if non-zero br done wor/,5< /,"cmd/delivermail/conf.skel.c 644 0 37 24356 2522722677 11172 # include # include # include "dlvrmail.h" /* ** CONF.C -- Delivermail Configuration Tables. ** ** Defines the configuration of this installation. ** ** Compilation Flags: ** HASARPA -- set if this machine has a connection to ** the Arpanet. ** HASUUCP -- set if this machine has a connection to ** the UUCP network. ** NETV6MAIL -- set if you want to use "v6mail" that ** comes with the Berkeley network. Normally ** /bin/mail will work fine, but around Berkeley ** we use v6mail because it is a "fixed target". ** Also, only v6mail has the "/dev/mail" stuff ** in it (for biff(1)). ** V6 -- running on a version 6 system. This determines ** whether to define certain routines between ** the two systems. If you are running a funny ** system, e.g., V6 with long tty names, this ** should be checked carefully. ** DUMBMAIL -- set if your /bin/mail doesn't have the ** -d flag. ** ** Configuration Variables: ** ArpaHost -- the arpanet name of the host through ** which arpanet mail will be sent. ** MyLocName -- the name of the host on a local network. ** This is used to disambiguate the contents of ** ArpaHost among many hosts who may be sharing ** a gateway. ** DaemonName -- the name of this agent for use in ** error messages, typically "MAILER-DAEMON" ** at this host on the local net. ** ArpaLocal -- a list of local names for this host on ** the arpanet. Only functional if HASARPA set. ** UucpLocal -- ditto for the Arpanet. ** BerkLocal -- ditto for the Berknet. ** Mailer -- a table of mailers known to the system. ** The fields are: ** - the pathname of the mailer. ** - a list of flags describing the properties ** of this mailer: ** M_FOPT -- if set, the mailer has a picky "-f" ** option. In this mode, the mailer will ** only accept the "-f" option if the ** sender is actually "root", "network", ** and possibly (but not necessarily) if ** the -f argument matches the real sender. ** The effect is that if the "-f" option ** is given to delivermail then it will be ** passed through (as arguments 1 & 2) to ** the mailer. ** M_ROPT -- identical to M_FOPT, except uses ** -r instead. ** M_QUIET -- if set, don't print a message if ** the mailer returns bad status. ** M_RESTR -- if set, this mailer is restricted ** to use by "daemon"; otherwise, we do a ** setuid(getuid()) before calling the ** mailer. ** M_HDR -- if set, the mailer wants us to ** insert a UNIX "From" line before ** outputing. ** M_FHDR -- if set, the header that we ** generate will be used literally, so ** we must force it to be correct. The ** effect is that we generate a header ** even if one exists. ** M_NOHOST -- if set, this mailer doesn't care ** about the host part (e.g., the local ** mailer). ** M_STRIPQ -- if set, strip quote (`"') ** characters out of parameters as you ** transliterate them into the argument ** vector. For example, the local mailer ** is calle((d directly, so these should be ** stripped, but the program-mailer (i.e., ** csh) should leave them in. ** - an exit status to use as the code for the ** error message print if the mailer returns ** something we don't understand. ** - A list of names that are to be considered ** "local" (and hence are stripped off) for ** this mailer. ** - An argument vector to be passed to the ** mailer with the following substitutions: ** $f - the from person name. ** $u - the target user name. ** $h - the target user host. ** $c - the hop count. ** >>>>>>>>>> Entry zero must be for the local ** >> NOTE >> mailer and entry one must be for ** >>>>>>>>>> the shell. ** ParseTab -- a table driving the parsing process. Each ** entry contains: ** - a character that will trigger this entry. ** - an index into the Mailer table. ** - a word of flags, described in dlvrmail.h. ** - an argument. If we have P_MAP, it is the ** character to turn the trigger character into. ** If we have P_MOVE, it is the site to send it ** to, using the mailer specified above. ** This table will almost certainly have to be ** changed on your site if you have anything more ** than the UUCP net. */ static char SccsId[] = "@(#)conf.c 2.6 2/15/81"; /************ BEGIN CONFIGURATION SECTION ************/ bool UseMsgId = FALSE; /* don't put message id's in anywhere */ # include /* definitions of machine id's at berkeley */ char *ArpaHost = "[unknown]"; char *MyLocName = sysname; char *DaemonName = "MAILER-DAEMON"; # define HASUUCP /* default to having UUCP net */ char *UucpLocal[] = { sysname, NULL }; /* if you define HASARPA you must include a declaration for ArpaLocal */ /************ END CONFIGURATION SECTION ************/ # ifndef HASARPA # define ArpaLocal NULL # endif HASARPA # ifndef HASUUCP # define UucpLocal NULL # endif HASUUCP # ifndef HASBERK # define BerkLocal NULL # endif HASBERK struct mailer Mailer[] = { /* local mail -- must be #0 */ { # ifdef NETV6MAIL "/usr/net/bin/v6mail", # else "/bin/mail", # endif M_ROPT|M_NOHOST|M_STRIPQ, EX_NOUSER, NULL, { "...local%mail", "-d", "$u", NULL } }, /* pipes through programs -- must be #1 */ { "/bin/csh", M_HDR|M_FHDR|M_NOHOST, EX_UNAVAILABLE, NULL, { "...prog%mail", "-fc", "$u", NULL } }, /* local berkeley mail */ { "/usr/net/bin/sendberkmail", M_FOPT|M_HDR|M_STRIPQ, EX_UNAVAILABLE, BerkLocal, { "...berk%mail", "-m", "$h", "-t", "$u", "-h", "$c", NULL } }, /* arpanet mail */ { "/usr/lib/mailers/arpa", M_STRIPQ, 0, ArpaLocal, { "...arpa%mail", "$f", "$h", "$u", NULL } }, /* uucp mail (cheat & use Bell's v7 mail) */ { "/bin/mail", M_ROPT|M_STRIPQ, EX_NOUSER, UucpLocal, # ifdef DUMBMAIL { "...uucp%mail", "$h!$u", NULL } # else { "...uucp%mail", "-d", "$h!$u", NULL } # endif DUMBMAIL }, }; # define M_LOCAL 0 # define M_BERK 2 # define M_ARPA 3 # define M_UUCP 4 struct parsetab ParseTab[] = { # ifdef HASARPA '@', M_ARPA, P_HLAST|P_USR_UPPER, NULL, # endif HASARPA # ifdef HASUUCP '^', -1, P_MAP, "!", '!', M_UUCP, 0, NULL, # endif HASUUCP '\0', M_LOCAL, P_MOVE, "", }; /* ** GETNAME -- Get the current users login name. ** ** This is in config.c because it is somewhat machine dependent. ** Examine it carefully for your installation. ** ** Algorithm: ** See if the person is logged in. If so, return ** the name s/he is logged in as. ** Look up the user id in /etc/passwd. If found, ** return that name. ** Return NULL. ** ** Parameters: ** none ** ** Returns: ** The login name of this user. ** NULL if this person is noone. ** ** Side Effects: ** none ** ** Called By: ** main */ char * getname() { register char *p; register struct passwd *w; extern char *getlogin(); extern struct passwd *getpwuid(); static char namebuf[9]; p = getlogin(); if (p != NULL && p[0] != '\0') return (p); # ifdef V6 w = getpwuid(getuid() & 0377); # else w = getpwuid(getuid()); # endif V6 if (w != NULL) { strcpy(namebuf, w->pw_name); return (namebuf); } return (NULL); } # ifdef V6 /* ** TTYPATH -- Get the path of the user's tty -- Version 6 version. ** ** Returns the pathname of the user's tty. Returns NULL if ** the user is not logged in or if s/he has write permission ** denied. ** ** Parameters: ** none ** ** Returns: ** pathname of the user's tty. ** NULL if not logged in or write permission denied. ** ** Side Effects: ** none. ** ** WARNING: ** Return value is in a local buffer. ** ** Called By: ** savemail */ # include # include char * ttypath() { struct stat stbuf; register int i; static char pathn[] = "/dev/ttyx"; extern int errno; /* compute the pathname of the controlling tty */ if ((i = ttyn(2)) == 'x' && (i = ttyn(1)) == 'x' && (i = ttyn(0)) == 'x') { errno = 0; return (NULL); } pathn[8] = i; /* see if we have write permission */ if (stat(pathn, &stbuf) < 0 || !flagset(02, stbuf.st_mode)) { errno = 0; return (NULL); } /* see if the user is logged in */ if (getlogin() == NULL) return (NULL); /* looks good */ return (pathn); } /* ** FDOPEN -- Open a stdio file given an open file descriptor. ** ** This is included here because it is standard in v7, but we ** need it in v6. ** ** Algorithm: ** Open /dev/null to create a descriptor. ** Close that descriptor. ** Copy the existing fd into the descriptor. ** ** Parameters: ** fd -- the open file descriptor. ** type -- "r", "w", or whatever. ** ** Returns: ** The file descriptor it creates. ** ** Side Effects: ** none ** ** Called By: ** deliver ** ** Notes: ** The mode of fd must match "type". */ FILE * fdopen(fd, type) int fd; char *type; { register FILE *f; f = fopen("/dev/null", type); close(fileno(f)); fileno(f) = fd; return (f); } /* ** INDEX -- Return pointer to character in string ** ** For V7 compatibility. ** ** Parameters: ** s -- a string to scan. ** c -- a character to look for. ** ** Returns: ** If c is in s, returns the address of the first ** instance of c in s. ** NULL if c is not in s. ** ** Side Effects: ** none. */ index(s, c) register char *s; register char c; { while (*s != '\0') { if (*s++ == c) return (--s); } return (NULL); } # endif V6 # ifndef V6 /* ** TTYPATH -- Get the path of the user's tty -- Version 7 version. ** ** Returns the pathname of the user's tty. Returns NULL if ** the user is not logged in or if s/he has write permission ** denied. ** ** Parameters: ** none ** ** Returns: ** pathname of the user's tty. ** NULL if not logged in or write permission denied. ** ** Side Effects: ** none. ** ** WARNING: ** Return value is in a local buffer. ** ** Called By: ** savemail */ # include # include char * ttypath() { struct stat stbuf; register char *pathn; extern int errno; extern char *ttyname(); /* compute the pathname of the controlling tty */ if ((pathn = ttyname(2)) == NULL && (pathn = ttyname(1)) == NULL && (pathn = ttyname(0)) == NULL) { errno = 0; return (NULL); } /* see if we have write permission */ if (stat(pathn, &stbuf) < 0 || !flagset(02, stbuf.st_mode)) { errno = 0; return (NULL); } /* see if the user is logged in */ if (getlogin() == NULL) return (NULL); /* looks good */ return (pathn); } # endif V6 er char *pathn; extern int errno; extern char *ttyname(); /* compute the pathname of the controlling tty */ if ((pathn = ttyname(2)) == NULL && (pathn = ttyname(1)) == NULL && (pathn = ttyname(0)) == NULL) { errno = 0; return (NULL); } /* see if we have write pcmd/delivermail/bmove.vax.s 644 0 37 225 2516353475 11161 # # BMOVE.S -- optimized block move routine. # # @(#)bmove.vax.s 2.1 11/5/80 # .globl _bmove _bmove: .word 0x0030 movc3 12(ap),*4(ap),*8(ap) ret f (getlogin() == NULL) return (NULL); /* looks good */ return (pathn); } # endif V6 er char *pathn; extern int errno; extern char *ttyname(); /* compute the pathname of the controlling tty */ if ((pathn = ttyname(2)) == NULL && (pathn = ttyname(1)) == NULL && (/,5< /,"cmd/delivermail/deliver.c 644 0 37 36405 2516353500 10724 # include # include # include # include "dlvrmail.h" # ifdef LOG # include # endif LOG static char SccsId[] = "@(#)deliver.c 2.5 2/5/81"; /* ** DELIVER -- Deliver a message to a particular address. ** ** Algorithm: ** Compute receiving network (i.e., mailer), host, & user. ** If local, see if this is really a program name. ** Build argument for the mailer. ** Create pipe through edit fcn if appropriate. ** Fork. ** Child: call mailer ** Parent: call editfcn if specified. ** Wait for mailer to finish. ** Interpret exit status. ** ** Parameters: ** to -- the address to deliver the message to. ** editfcn -- if non-NULL, we want to call this function ** to output the letter (instead of just out- ** putting it raw). ** ** Returns: ** zero -- successfully delivered. ** else -- some failure, see ExitStat for more info. ** ** Side Effects: ** The standard input is passed off to someone. ** ** WARNING: ** The standard input is shared amongst all children, ** (( including the file pointer. It is critical that the ** parent waits for the child to finish before forking ** another child. ** ** Called By: ** main ** savemail ** ** Files: ** standard input -- must be opened to the message to ** deliver. */ deliver(to, editfcn) addrq *to; int (*editfcn)(); { register struct mailer *m; char *host; char *user; extern struct passwd *getpwnam(); char **pvp; extern char **buildargv(); auto int st; register int i; register char *p; int pid; int pvect[2]; extern FILE *fdopen(); extern int errno; FILE *mfile; extern putheader(); extern pipesig(); extern bool GotHdr; extern char *index(); /* ** Compute receiving mailer, host, and to addreses. ** Do some initialization first. To is the to address ** for error messages. */ To = to->q_paddr; m = to->q_mailer; user = to->q_user; host = to->q_host; Errors = 0; errno = 0; # ifdef DEBUG if (Debug) printf("deliver(%s [%d, `%s', `%s'])\n", To, m, host, user); # endif DEBUG /* ** Remove quote bits from user/host. */ for (p = user; (*p++ &= 0177) != '\0'; ) continue; if (host != NULL) for (p = host; (*p++ &= 0177) != '\0'; ) continue; /* ** Strip quote bits from names if the mailer wants it. */ if (flagset(M_STRIPQ, m->m_flags)) { stripquotes(user); stripquotes(host); } /* ** See if this user name is "special". ** If the user is a program, diddle with the mailer spec. ** If the user name has a slash in it, assume that this ** is a file -- send it off without further ado. ** Note that this means that editfcn's will not ** be applied to the message. */ if (m == &Mailer[0]) { if (*user == '|') { user++; m = &Mailer[1]; } else { if (index(user, '/') != NULL) { i = mailfile(user); giveresponse(i, TRUE, m); return (i); } } } /* ** See if the user exists. ** Strictly, this is only needed to print a pretty ** error message. ** ** >>>>>>>>>> This clause assumes that the local mailer ** >> NOTE >> cannot do any further aliasing; that ** >>>>>>>>>> function is subsumed by delivermail. */ if (m == &Mailer[0]) { if (getpwnam(user) == NULL) { giveresponse(EX_NOUSER, TRUE, m); return (EX_NOUSER); } } /* ** If the mailer wants a From line, insert a new editfcn. */ if (flagset(M_HDR, m->m_flags) && editfcn == NULL && (!GotHdr || flagset(M_FHDR, m->m_flags))) editfcn = putheader; /* ** Call the mailer. ** The argument vector gets built, pipes through 'editfcn' ** are created as necessary, and we fork & exec as ** appropriate. In the parent, we call 'editfcn'. */ pvp = buildargv(m->m_argv, m->m_flags, host, user, From.q_paddr); if (pvp == NULL) { usrerr("name too long"); return (-1); } rewind(stdin); /* create a pipe if we will need one */ if (editfcn != NULL && pipe(pvect) < 0) { syserr("pipe"); return (-1); } # ifdef VFORK pid = vfork(); # else pid = fork(); # endif if (pid < 0) { syserr("Cannot fork"); if (editfcn != NULL) { close(pvect[0]); close(pvect[1]); } return (-1); } else if (pid == 0) { /* child -- set up input & exec mailer */ /* make diagnostic output be standard output */ close(2); dup(1); signal(SIGINT, SIG_IGN); if (editfcn != NULL) { close(0); if (dup(pvect[0]) < 0) { syserr("Cannot dup to zero!"); _exit(EX_OSERR); } close(pvect[0]); close(pvect[1]); } if (!flagset(M_RESTR, m->m_flags)) setuid(getuid()); # ifdef LOG closelog(); # endif LOG # ifndef VFORK /* * We have to be careful with vfork - we can't mung up the * memory but we don't want the mailer to inherit any extra * open files. Chances are the mailer won't * care about an extra file, but then again you never know. * Actually, we would like to close(fileno(pwf)), but it's * declared static so we can't. But if we fclose(pwf), which * is what endpwent does, it closes it in the parent too and * the next getpwnam will be slower. If you have a weird mailer * that chokes on the extra file you should do the endpwent(). */ endpwent(); # endif execv(m->m_mailer, pvp); /* syserr fails because log is closed */ /* syserr("Cannot exec %s", m->m_mailer); */ printf("Cannot exec %s\n", m->m_mailer); fflush(stdout); _exit(EX_UNAVAILABLE); } /* arrange to write out header message if error */ if (editfcn != NULL) { close(pvect[0]); signal(SIGPIPE, pipesig); mfile = fdopen(pvect[1], "w"); (*editfcn)(mfile); fclose(mfile); } /* ** Wait for child to die and report status. ** We should never get fatal errors (e.g., segmentation ** violation), so we report those specially. For other ** errors, we choose a status message (into statmsg), ** and if it represents an error, we print it. */ while ((i = wait(&st)) > 0 && i != pid) continue; if (i < 0) { syserr("wait"); return (-1); } if ((st & 0377) != 0) { syserr("%s: stat %o", pvp[0], st); ExitStat = EX_UNAVAILABLE; return (-1); } i = (st >> 8) & 0377; giveresponse(i, TRUE, m); return (i); } /* ** GIVERESPONSE -- Interpret an error response from a mailer ** ** Parameters: ** stat -- the status code from the mailer (high byte ** only; core dumps must have been taken care of ** already). ** force -- if set, force an error message output, even ** if the mailer seems to like to print its own ** messages. ** m -- the mailer descriptor for this mailer. ** ** Returns: ** none. ** ** Side Effects: ** Errors may be incremented. ** ExitStat may be set. ** ** Called By: ** deliver */ giveresponse(stat, force, m) int stat; int force; register struct mailer *m; { register char *statmsg; extern char *SysExMsg[]; register int i; extern int N_SysEx; extern long MsgSize; char buf[30]; i = stat - EX__BASE; if (i < 0 || i > N_SysEx) statmsg = NULL; else statmsg = SysExMsg[i]; if (stat == 0) statmsg = "ok"; else { Errors++; if (statmsg == NULL && m->m_badstat != 0) { stat = m->m_badstat; i = stat - EX__BASE; # ifdef DEBUG if (i < 0 || i >= N_SysEx) syserr("Bad m_badstat %d", stat); else # endif DEBUG statmsg = SysExMsg[i]; } if (statmsg == NULL) usrerr("unknown mailer response %d", stat); else if (force || !flagset(M_QUIET, m->m_flags)) usrerr("%s", statmsg); } /* ** Final cleanup. ** Log a record of the transaction. Compute the new ** ExitStat -- if we already had an error, stick with ** that. */ if (statmsg == NULL) { sprintf(buf, "error %d", stat); statmsg = buf; } # ifdef LOG logmsg(LOG_INFO, "%s->%s: %ld: %s", From.q_paddr, To, MsgSize, statmsg); # endif LOG setstat(stat); return (stat); } /* ** PUTHEADER -- insert the From header into some mail ** ** For mailers such as 'msgs' that want the header inserted ** into the mail, this edit filter inserts the From line and ** then passes the rest of the message through. ** ** Parameters: ** fp -- the file pointer for the output. ** ** Returns: ** none ** ** Side Effects: ** Puts a "From" line in UNIX format, and then ** outputs the rest of the message. ** ** Called By: ** deliver */ putheader(fp) register FILE *fp; { char buf[MAXLINE + 1]; long tim; extern char *ctime(); register char *p; extern char *index(); /* output the header part */ fgets(buf, sizeof buf, stdin); if (strncmp(buf, "From ", 5) != 0 || (p = index(&buf[5], ' ')) == NULL) { time(&tim); fprintf(fp, "From %s %s", From.q_paddr, ctime(&tim)); fputs(buf, fp); } else fprintf(fp, "From %s %s", From.q_paddr, &p[1]); /* output the body */ while (!ferror(fp) && fgets(buf, sizeof buf, stdin) != NULL) fputs(buf, fp); if (ferror(fp)) { syserr("putheader: write error"); setstat(EX_IOERR); } } /* ** PIPESIG -- Handle broken pipe signals ** ** This just logs an error. ** ** Parameters: ** none ** ** Returns: ** none ** ** Side Effects: ** logs an error message. */ pipesig() { syserr("Broken pipe"); signal(SIGPIPE, SIG_IGN); } /* ** SENDTO -- Designate a send list. ** ** The parameter is a comma-separated list of people to send to. ** This routine arranges to send to all of them. ** ** Parameters: ** list -- the send list. ** copyf -- the copy flag; passed to parse. ** ** Returns: ** none ** ** Side Effects: ** none. ** ** Called By: ** main ** alias */ sendto(list, copyf) char *list; int copyf; { register char *p; register char *q; register char c; addrq *a; extern addrq *parse(); bool more; /* more keeps track of what the previous delimiter was */ more = TRUE; for (p = list; more; ) { /* find the end of this address */ q = p; while ((c = *p++) != '\0' && c != ',' && c != '\n') continue; more = c != '\0'; *--p = '\0'; if (more) p++; /* parse the address */ if ((a = parse(q, (addrq *) NULL, copyf)) == NULL) continue; /* arrange to send to this person */ recipient(a, &SendQ); } To = NULL; } /* ** RECIPIENT -- Designate a message recipient ** ** Saves the named person for future mailing. ** ** Designates a person as a recipient. This routine ** does the initial parsing, and checks to see if ** this person has already received the mail. ** It also supresses local network names and turns them into ** local names. ** ** Parameters: ** a -- the (preparsed) address header for the recipient. ** targetq -- the queue to add the name to. ** ** Returns: ** none. ** ** Side Effects: ** none. ** ** Called By: ** sendto ** main */ recipient(a, targetq) register addrq *a; addrq *targetq; { register addrq *q; register struct mailer *m; register char **pvp; extern char *xalloc(); extern bool forward(); extern int errno; extern bool sameaddr(); To = a->q_paddr; m = a->q_mailer; errno = 0; # ifdef DEBUG if (Debug) printf("recipient(%s)\n", To); # endif DEBUG /* ** Look up this person in the recipient list. If they ** are there already, return, otherwise continue. */ if (!ForceMail) { for (q = &SendQ; (q = nxtinq(q)) != NULL; ) if (sameaddr(q, a, FALSE)) { # ifdef DEBUG if (Debug) printf("(%s in SendQ)\n", a->q_paddr); # endif DEBUG return; } for (q = &AliasQ; (q = nxtinq(q)) != NULL; ) if (sameaddr(q, a, FALSE)) (( { # ifdef DEBUG if (Debug) printf("(%s in AliasQ)\n", a->q_paddr); # endif DEBUG return; } } /* ** See if the user wants hir mail forwarded. ** `Forward' must do the forwarding recursively. */ if (m == &Mailer[0] && !NoAlias && targetq == &SendQ && forward(a)) return; /* ** Put the user onto the target queue. */ if (targetq != NULL) { putonq(a, targetq); } return; } /* ** BUILDARGV -- Build an argument vector for a mail server. ** ** Using a template defined in config.c, an argv is built. ** The format of the template is already a vector. The ** items of this vector are copied, unless a dollar sign ** is encountered. In this case, the next character ** specifies something else to copy in. These can be ** $f The from address. ** $h The host. ** $u The user. ** $c The hop count. ** The vector is built in a local buffer. A pointer to ** the static argv is returned. ** ** Parameters: ** tmplt -- a template for an argument vector. ** flags -- the flags for this server. ** host -- the host name to send to. ** user -- the user name to send to. ** from -- the person this mail is from. ** ** Returns: ** A pointer to an argv. ** ** Side Effects: ** none ** ** WARNING: ** Since the argv is staticly allocated, any subsequent ** calls will clobber the old argv. ** ** Called By: ** deliver */ char ** buildargv(tmplt, flags, host, user, from) char **tmplt; int flags; char *host; char *user; char *from; { register char *p; register char *q; static char *pv[MAXPV+1]; char **pvp; char **mvp; static char buf[512]; register char *bp; char pbuf[30]; /* ** Do initial argv setup. ** Insert the mailer name. Notice that $x expansion is ** NOT done on the mailer name. Then, if the mailer has ** a picky -f flag, we insert it as appropriate. This ** code does not check for 'pv' overflow; this places a ** manifest lower limit of 4 for MAXPV. */ pvp = pv; bp = buf; *pvp++ = tmplt[0]; /* insert -f or -r flag as appropriate */ if (flagset(M_FOPT|M_ROPT, flags) && FromFlag) { if (flagset(M_FOPT, flags)) *pvp++ = "-f"; else *pvp++ = "-r"; *pvp++ = From.q_paddr; } /* ** Build the rest of argv. ** For each prototype parameter, the prototype is ** scanned character at a time. If a dollar-sign is ** found, 'q' is set to the appropriate expansion, ** otherwise it is null. Then either the string ** pointed to by q, or the original character, is ** interpolated into the buffer. Buffer overflow is ** checked. */ for (mvp = tmplt; (p = *++mvp) != NULL; ) { if (pvp >= &pv[MAXPV]) { syserr("Too many parameters to %s", pv[0]); return (NULL); } *pvp++ = bp; for (; *p != '\0'; p++) { /* q will be the interpolated quantity */ q = NULL; if (*p == '$') { switch (*++p) { case 'f': /* from person */ q = from; break; case 'u': /* user */ q = user; break; case 'h': /* host */ q = host; break; case 'c': /* hop count */ sprintf(pbuf, "%d", HopCount); q = pbuf; break; } } /* ** Interpolate q or output one character ** Strip quote bits as we proceed..... */ if (q != NULL) { while (bp < &buf[sizeof buf - 1] && (*bp++ = *q++) != '\0') continue; bp--; } else if (bp < &buf[sizeof buf - 1]) *bp++ = *p; } *bp++ = '\0'; if (bp >= &buf[sizeof buf - 1]) return (NULL); } *pvp = NULL; # ifdef DEBUG if (Debug) { printf("Interpolated argv is:\n"); for (mvp = pv; *mvp != NULL; mvp++) printf("\t%s\n", *mvp); } # endif DEBUG return (pv); } /* ** MAILFILE -- Send a message to a file. ** ** Parameters: ** filename -- the name of the file to send to. ** ** Returns: ** The exit code associated with the operation. ** ** Side Effects: ** none. ** ** Called By: ** deliver */ mailfile(filename) char *filename; { char buf[MAXLINE]; register FILE *f; auto long tim; extern char *ctime(); f = fopen(filename, "a"); if (f == NULL) return (EX_CANTCREAT); /* output the timestamp */ time(&tim); fprintf(f, "From %s %s", From.q_paddr, ctime(&tim)); rewind(stdin); while (fgets(buf, sizeof buf, stdin) != NULL) { fputs(buf, f); if (ferror(f)) { fclose(f); return (EX_IOERR); } } fputs("\n", f); fclose(f); return (EX_OK); } . ** ** Called By: ** deliver */ mailfile(filename) char *filename; { char buf[MAXLINE]; register FILE *f; auto long tim; extern char *ctime(); f = fopen(filename, "a"); if (f == NULL) return (EX_CANTCREAT); /* output the timestamp */ cmd/delivermail/delivermail.8 644 0 37 12274 2516353503 11515 .TH DELIVERMAIL 8 .SH NAME delivermail \- deliver mail to arbitrary people .SH SYNOPSIS .B /etc/delivermail [ .BR \- [ fr ] .I address ] [ .B \-a ] [ .BR \-e [ empqw ] ] [ .B \-n ] [ .B \-m ] [ .B \-s ] [ .B \-i ] [ .B \-h .I N ] address ... .SH DESCRIPTION .I Delivermail delivers a letter to one or more people, routing the letter over whatever networks are necessary. .I Delivermail will do inter-net forwarding as necessary to deliver the mail to the correct place. .PP .I Delivermail is not intended as a user interface routine; it is expected that other programs will provide user-friendly front ends, and .I delivermail will be used only to deliver pre-formatted messages. .PP .I Delivermail reads its standard input up to a control-D or a single dot and sends a copy of the letter found there to all of the addresses listed. If the .B \-i flag is given, single dots are ignored. It determines the network to use based on the syntax of the addresses. Addresses containing the character `@' or the word ``at'' are sent to the .SM ARPANET; addresses containing `!' are sent to the .SM UUCP net, and addresses containing `:' or `.' are sent to the Berkeley network. Other addresses are assumed to be local. .PP Local addresses are looked up in the file .I /usr/lib/mailaliases and aliased appropriately. Aliasing can be prevented by preceeding the address with a backslash or using the .B \-n flag. Normally the sender is not included in any alias expansions, e.g., if `john' sends to `group', and `group' includes `john' in the expansion, then the letter will not be delivered to `john'. The .B \-m flag disables this suppression. .PP .I Delivermail computes the person sending the mail by looking at your login name. The ``from'' person can be explicitly specified by using the .B \-f flag; or, if the .B \-a flag is given, delivermail looks in the body of the message for a ``From:'' or ``Sender:'' field in .SM ARPANET format. The .B \-f and .B \-a flags can be used only by the special users .I root and .I network, or if the person you are trying to become is the same as the person you are. The .B \-r flag is entirely equivalent to the .B \-f flag; it is provided for ease of interface only. .PP The .BI \-e x flag controls the disposition of error output, as follows: .TP 3n .B e Print errors on the standard output, and echo a copy of the message when done. It is assumed that a network server will return the message back to the user. .TP .B m Mail errors back to the user. .TP .B p Print errors on the standard output. .TP .B q Throw errors away; only exit status is returned. .TP .B w Write errors back to the user's terminal, but only if the user is still logged in and write permission is enabled; otherwise errors are mailed back. .LP If the error is not mailed back, and if the mail originated on the machine where the error occurred, the letter is appended to the file .I dead.letter in the sender's home directory. .PP If the first character of the user name is a vertical bar, the rest of the user name is used as the name of a program to pipe the mail to. It may be necessary to quote the name of the user to keep .I delivermail from supressing the blanks from between arguments. .PP The message is normally editted to eliminate ``From'' lines that might confuse other mailers. In particular, ``From'' lines in the header are deleted, and ``From'' lines in the body are prepended by `>'. The .B \-s flag saves ``From'' lines in the header. .PP The .B \-h flag gives a ``hop-count'', i.e., a measure of how many times this message has been processed by .I delivermail (presumably on different machines). Each time .I delivermail processes a message, it increases the hop-count by one; if it exceeds 30 .I delivermail assumes that an alias loop has occured and it aborts the message. The hop-count defaults to zero. .PP .I Delivermail returns an exit status describing what it did. The codes are defined in .IR mailexits.h : .ta 3n +\w'EX_UNAVAILABLE'u+3n .de XX .ti \n(.iu .. .in +\w'EX_UNAVAILABLE'u+6n .XX 0 EX_OK Succesful completion on all addresses. .XX 2 EX_NOUSER User name not recognized. .XX 3 EX_UNAVAILABLE Catchall meaning necessary resources were not available. .XX 4 EX_SYNTAX Syntax error in address. .XX 5 EX_SOFTWARE Internal software error, including bad arguments. .XX 6 EX_OSERR Temporary operating system error, such as ``cannot fork''. .XX 7 EX_NOHOST Host name not recognized. .DT .PP .SH FILES .in +10 .ti -10 /usr/lib/mailaliases \- to alias names .ti -10 /bin/mail \- to deliver local mail .ti -10 /usr/net/bin/sendmail \- to deliver Berkeley mail .ti -10 /usr/lib/mailers/arpa \- to deliver .SM ARPANET mail .ti -10 /usr/lib/mailers/uucp \- to deliver .SM UUCP mail .ti -10 /tmp/mail* \- temp file .ti -10 /tmp/xscript* \- saved transcript .ti -10 /dev/log \- to log status (optional) .in -10 .SH SEE\ ALSO mail(1), Mail(UCB), arpa-mailer(8), uucp-mailer(8), mailaliases(5), userinfo(5) .SH BUGS .I Delivermail sends one copy of the letter to each user; it should send one copy of the letter to each host and distribute to multiple users there whenever possible. .PP .I(( Delivermail assumes the addresses can be represented as one word. This is incorrect according to the .SM ARPANET mail protocol RFC 733 (NIC 41952), but is consistant with the real world. 10 /dev/log \- to log status (optional) .in -10 .SH SEE\ ALSO mail(1), Mail(UCB), arpa-mailer(8), uucp-mailer(8), mailaliases(5), userinfo(5) .SH BUGS .I Delivermail sends one copy of the letter to each user; it should send one copy of the letter to each host and distribute to multiple users there whenever possible. .PP .Icmd/delivermail/dlvrmail.h 644 0 37 10372 2516353503 11107 /* ** DLVRMAIL.H -- Global definitions for delivermail. ** ** Most of these are actually allocated in globals.c ** ** @(#)dlvrmail.h 2.2 11/21/80 */ # include "useful.h" /* ** Manifest constants. */ # define MAXLINE 256 /* maximum line length */ # define MAXNAME 128 /* maximum length of a name */ # define MAXFIELD 2500 /* maximum total length of a header field */ # define MAXPV 15 /* maximum # of parms to mailers */ # define MAXHOP 30 /* maximum value of HopCount */ # define ALIASFILE "/usr/lib/aliases" /* location of alias file */ /* ** Mailer definition structure. ** Every mailer known to the system is declared in this ** structure. It defines the pathname of the mailer, some ** flags associated with it, and the argument vector to ** pass to it. The flags are defined in conf.c ** ** The argument vector is expanded before actual use. Every- ** thing is passed through except for things starting with "$". ** "$x" defines some interpolation, as described in conf.c ** "$x" where x is unknown expands to "x", so use "$$" to get "$". */ struct mailer { char *m_mailer; /* pathname of the mailer to use */ short m_flags; /* status flags, see below */ short m_badstat; /* the status code to use on unknown error */ char **m_local; /* list of local names for this host */ char *m_argv[MAXPV]; /* template argument vector */ }; # define M_FOPT 0001 /* mailer takes picky -f flag */ # define M_ROPT 0002 /* mailer takes picky -r flag */ # define M_QUIET 0004 /* don't print error on bad status */ # define M_RESTR 0010 /* must be daemon to execute */ # define M_HDR 0020 /* insert From line */ # define M_NOHOST 0040 /* ignore host in comparisons */ # define M_STRIPQ 0100 /* strip quote characters from user/host */ # define M_FHDR 0200 /* force good From line */ extern struct mailer Mailer[]; /* ** Address structure. ** Addresses are stored internally in this structure. */ struct address { char *q_paddr; /* the printname for the address */ char *q_user; /* user name */ char *q_host; /* host name */ struct mailer *q_mailer; /* mailer to use */ struct address *q_next; /* chain */ struct address *q_prev; /* back pointer */ }; typedef struct address addrq; /* some other primitives */ # define nxtinq(q) ((q)->q_next) # define clearq(q) (q)->q_next = (q)->q_prev = NULL extern addrq SendQ; /* queue of people to send to */ extern addrq AliasQ; /* queue of people that are aliases */ /* ** Parse structure. ** This table drives the parser which determines the network ** to send the mail to. */ struct parsetab { char p_char; /* trigger character */ char p_mailer; /* the index of the mailer to call */ short p_flags; /* see below */ char *p_arg; /* extra info needed for some flags */ }; # define P_MAP 0001 /* map p_char -> p_arg[0] */ # define P_HLAST 0002 /* host is last, & right associative */ # define P_ONE 0004 /* can only be one p_char in addr */ # define P_MOVE 0010 /* send untouched to host p_arg */ # define P_USR_UPPER 0020 /* don't map UPPER->lower in user names */ # define P_HST_UPPER 0040 /* don't map UPPER->lower in host names */ /* ** Global variables. */ extern bool ArpaFmt; /* if set, message is in arpanet fmt */ extern bool FromFlag; /* if set, "From" person is explicit */ extern bool Debug; /* if set, debugging info */ extern bool MailBack; /* mail back response on error */ extern bool BerkNet; /* called from BerkNet */ extern bool WriteBack; /* write back response on error */ extern bool NoAlias; /* if set, don't do any aliasing */ extern bool ForceMail; /* if set, mail even if already got a copy */ extern bool MeToo; /* send to the sender also */ extern bool UseMsgId; /* put msg-id's in all msgs [conf.c] */ extern bool IgnrDot; /* don't let dot end messages */ extern bool SaveFrom; /* save leading "From" lines */ extern int Errors; /* set if errors */ extern int ExitStat; /* exit status code */ extern char InFileName[]; /* input file name */ extern char Transcript[]; /* the transcript file name */ extern char MsgId[]; /* the message id for this message */ extern addrq From; /* the person it is from */ extern char *To; /* the target person */ extern int HopCount; /* hop count */ # include # define flagset(bits, word) ((bits) & (word)) # define setstat(s) { if (ExitStat == EX_OK) ExitStat = s; } / extern int Errors; /* set if errors */ extern int ExitStat; /* exit status code */ extern char InFileName[]; /* input file name */ extern char Transcript[]; /* the transcript file name */ extern char MsgId[]; /* the message id for this message */ extern addrqcmd/delivermail/err.c 644 0 37 3137 2516353505 10043 # include # include "dlvrmail.h" # ifdef LOG # include # endif LOG static char SccsId[] = "@(#)err.c 2.2 1/10/81"; /* ** SYSERR -- Print error message. ** ** Prints an error message via printf to the diagnostic ** output. If LOG is defined, it logs it also. ** ** Parameters: ** f -- the format string ** a, b, c, d, e -- parameters ** ** Returns: ** -1 always ** ** Side Effects: ** increments Errors. ** sets ExitStat. */ /*VARARGS1*/ syserr(fmt, a, b, c, d, e) char *fmt; { extern int errno; static char errbuf[MAXLINE+1]; register char *p; extern char *sys_errlist[]; extern int sys_nerr; sprintf(errbuf, fmt, a, b, c, d, e); if (errno != 0) { p = &errbuf[strlen(errbuf)]; if (errno < sys_nerr && errno > 0) sprintf(p, ": %s", sys_errlist[errno]); else sprintf(p, ": error %d", errno); } printf("delivermail: %s\n", errbuf); fflush(stdout); Errors++; /* determine exit status if not already set */ if (ExitStat == EX_OK) { if (errno == 0) ExitStat = EX_SOFTWARE; else ExitStat = EX_OSERR; } # ifdef LOG logmsg(LOG_ERR, "%s->%s: %s", From.q_paddr, To, errbuf); # endif LOG errno = 0; return (-1); } /* ** USRERR -- Signal user error. ** ** This is much like syserr except it is for user errors. ** ** Parameters: ** fmt, a, b, c, d -- printf strings ** ** Returns: ** -1 ** ** Side Effects: ** increments Errors. */ /*VARARGS1*/ usrerr(fmt, a, b, c, d, e) char *fmt; { extern char SuprErrs; if (SuprErrs) return; Errors++; if (To != NULL) printf("%s... ", To); printf(fmt, a, b, c, d, e); printf("\n"); fflush(stdout); return (-1); } r, To, errbuf); # endif LOG errno = 0; return (-1); } /* ** USRERR -- Signal user error. ** ** This is much like syserr except it is for user errors. ** ** Parameters: ** fmt, a, b, c, d -- printf strings ** ** Returns: ** -1 ** ** Side Effects: ** increments Errors. */ /*VARARGS1*/ usrerr(fmt, a, b, c, d, e) char *fmt; { extern char SuprErrs; if (SuprErrs) return; Errors++; if (To != NULL) princmd/delivermail/mail-dm.c 644 0 37 20061 2516353506 10607 #include #include "srvrftp.h" #include #include #include #include #include #include #include extern int fout; /* Name: mail Function: handle the MAIL command over the command connection Algorithm: see if we have a known user if mailbox file can't be gotten return tell him it is ok to go ahead with mail while he doesn't type a period read and write data say completed Parameters: username in arg Returns: nothing Globals: arg username= Calls: strmove getuser loguser openmail closemail getline chown (sys) time (sys) printf (sys) getch (util) putch (util) Called by: main thru command array History: initial coding Mark Kampe UCLA-ATS modified 4/13/76 by S. F. Holmgren for Illinois version modified 6/30/76 by S. F. Holmgren to call getmbox modified 10/18/76 by J. S. Kravitz to improve net mail header chown removed by R. Balocca @ CAC, Sunday 1977 February 20 getline removed and limit on line length removed by using getch and putch added by R. Balocca @ CAC, 1977 March 8 Tuesday Fixed oversight in above (forgot to translate to ) 1977 March 10 Thursday by Rick Balocca @ CAC Added openmail & closemail, added logging, and fixed several bugs on or about 12/21/79 by Eric Allman, UCB/INGRES. Changed to always accept mail -- bad mail will be sent back -- 1/9/80 by Eric Allman, UCB/INGRES. */ #define gt (c = getch()) mail() { register char *p; /* gener((al use */ register int c; int i; /* extern struct io_buf obuf; */ /* get to open mailbox file descriptor */ fflush(&fout); if( (fout = openmail(arg)) < 0 ) return; /* obuf.unused = 0; obuf.addr = 0; /* fake a fcreat */ /* say its ok to continue */ netreply( "350 Enter mail, end with a line containing only `.'\r\n" ); for(;;) /* while no error or . */ { /* we are at beginning of line */ if(gt=='.') /*"."*/ { if(gt=='\r') /*".\r"*/ { if(gt=='\n') /*".\r\n"*/ { /* end of message */ break; } else { /*".\r"c*/ putch('.'); putch('\r'); } } else /*"."c"*/ putch('.'); } /*"-"*/ /* c */ for(;;) { for(; c != '\r'; gt) { if( c < 0 ) { /* fflush(&obuf); */ /* write(obuf.fid, "\n***** Sender aborted connection *****\n", 39); */ fflush(&fout); write(fout, "\n***** Sender aborted connection *****\n", 39); goto out; } else putch(c); } /*"\r"*/ if( gt == '\n' ) { /*"\r\n"*/ crlf: putch('\n'); break; } else { /*"\r"c*/ crc: putch('\r'); if(c=='\0') gt; /* "\r\0" */ /* is arpa escape for "\r" */ } } } out: fflush(&fout); if (closemail(fout) >= 0) netreply("256 Mail accepted\r\n"); } /* Name: datamail Function: handle the MLFL command Algorithm: fork make sure we have a valid user say bad user and exit send sock command open data connection get open mailbox file descriptor call rcvdata to receive mail Parameters: username in arg Returns: nothing Globals: arg Calls: fork (sys) strmove netreply sendsock dataconnection getmbox rcvdata printf (sys) time (sys) Called by: main thru command array History: initial coding 4/13/76 by S. F. Holmgren modified 10/18/76 by J. S. Kravitz to put net mail header chown removed by R. Balocca @ CAC, Sunday 1977 February 20 */ datamail() { register netdata; /* register mboxfid; */ register int i; i = fork(); if (i < 0) { netreply("455 Mail server temporarily unavailable\r\n"); return; } else if (i == 0) { fflush(&fout); if ((fout = openmail(arg)) < 0) exit(3); /* send sock command */ sendsock( U4 ); /* open data connection */ netdata = dataconnection( U4 ); /* say its ok to proceed */ numreply( NUM250 ); /* get data from net connection and copy to mail file */ /* rcvdata( netdata,mboxfid ); */ if (rcvdata(netdata, fout) < 0) exit(1); /* close the mail, see if ok; if so say ok */ fflush(&fout); if (closemail(fout) >= 0) numreply( NUM252 ); exit( 0 ); } } /* ** OPENMAIL -- Open a channel to the mail server ** ** Gets the mail server started up ready to handle our ** mail. ** ** Algorithm: ** See if the user is specified. ** If not, send to user "root". ** See if the user exists. ** If not, signal error 450 and return. ** Fork. ** Create a pipe ** Signal "unavailable" and exit on failure. ** Fork. ** Signal "unavailable" and exit on failure ** In child: ** Call mailer: /etc/delivermail is preferred. ** In parent: ** Avoid pipe signals in case delivermail dies. ** Save the childs pid. ** Return file descriptor. ** ** Notes: ** The check to see if the user actually exists should ** go away so that we can do real mail forwarding. ** ** Parameters: ** who -- the user to send the mail to. ** ** Returns: ** File descriptor to send mail to. ** -1 on failure. ** ** Side Effects: ** Forks /etc/delivermail or /bin/mail or /usr/bin/mail. ** Becomes "network" in the child. ** ** Requires: ** strmove ** getuser ** netreply ** pipe (sys) ** fork (sys) ** close (sys) ** dup (sys) ** execl (sys) ** signal (sys) ** exit (sys) ** ** Called By: ** mail ** datamail ** ** History: ** 1/9/80 -- Added 050 & 455 reply messages if execl's ** fail. Eric Allman UCB/INGRES. ** 11/26/79 -- Modified to map upper case to lower ** case. Eric Allman UCB/INGRES. ** 11/10/79 -- Written by Eric Allman UCB/INGRES ** 3/6/80 -- Dropped case mapping; delivermail does ** that now. EPA UCB/INGRES. */ int Mail_pid; char *Mail_user; openmail(who) char *who; { register char *w; register int i; int pvect[2]; register char *p; w = who; if (w == 0) w = "root"; /* else { for (p = w; *p != '\0'; p++) { if (*p >= 'A' && *p <= 'Z') *p =- 'A' - 'a'; } } */ Mail_user = w; /* see if the user exists */ strmove(w, username); /* if (getuser(0) == 0) { netreply("450 User unknown\r\n"); return (-1); } */ /* try to get a pipe to the mailer */ if (pipe(pvect) < 0) { unavailable: netreply("455 Mail server temporarily unavailable\r\n"); return (-1); } /* fork */ i = fork(); if (i < 0) { /* failure */ close(pvect[0]); close(pvect[1]); goto unavailable; } else if (i == 0) { /* child */ close(pvect[1]); close(0); dup(pvect[0]); close(pvect[0]); setuid(NETUID); /* try to call something to deliver the mail */ execl("/etc/delivermail", "delivermail", "-em", "-a", w, 0); netreply("050 Not using normal mail server, beware!\r\n"); execl("/bin/mail", "mail", w, 0); execl("/usr/bin/mail", "mail", w, 0); /* doesn't seem to be anything around */ netreply("455 Mail server unavailable\r\n"); exit(3); } /* else parent */ signal(SIGPIPE, SIG_IGN); Mail_pid = i; close(pvect[0]); return (pvect[1]); } /* ** CLOSEMAIL -- Close the mail file and get actual status ** ** The mail file is closed. ** ** Algorithm: ** Wait for the mailer to die. ** If it wasn't there, be non-comittal. ** If it died a violent death, give error. ** ** Parameters: ** fd -- the file descriptor of the mail file. ** ** Returns: ** none. ** ** Side Effects: ** mailer is soaked up. ** ** Requires: ** close (sys) ** wait (sys) ** ** Called By: ** mail ** datamail ** ** History: ** 1/9/80 -- Changed to not check for errors in mailing, ** since these will be mailed back. ** 11/10/79 -- Written by Eric Allman UCB/INGRES. */ closemail(fd) int fd; { auto int st; register int i; /* close the pipe -- mail should go away */ close(fd); /* wait for its body */ while ((i = wait(&st)) != Mail_pid) { if (i < 0) { /* how did this happen? */ logmsg(LOG_ERR, "mail from host %d to %s: no child", openparams.o_frnhost & 0377, Mail_user); goto unavailable; } } /* 'st' is now the status of the mailer */ if ((st & 0377) != 0) { logmsg(LOG_ERR, "mail from host %d to %s: status %o", openparams.o_frnhost & 0377, Mail_user, st); unavailable: netreply("455 Mail not delivered -- local system error\r\n"); return (-1); } return (0); } */ while ((i = wait(&st)) != Mail_pid) { if (i < 0) { /* how did this happen? */ logmsg(LOG_ERR, "mail from host %d to %s: no child", openparams.o_frnhost & 0377, Mail_user); goto unavailable; } } /* 'st' is now the status of the mailer */ if ((st & 0377) != 0) { logmsg(LOG_ERR, "mail from host %d to %s: status %o", openparams.o_frnhost & 0377, Mail_user, st); unavailable: netreply("455 Mail not delivered -- local systecmd/delivermail/main.c 644 0 37 26035 2516353507 10223 # include # include # include # include "dlvrmail.h" # ifdef LOG # include # endif LOG static char SccsId[] = "@(#)main.c 2.3 1/10/81"; /* ** DELIVERMAIL -- Deliver mail to a set of destinations ** ** This is the basic mail router. All user mail programs should ** call this routine to actually deliver mail. Delivermail in ** turn calls a bunch of mail servers that do the real work of ** delivering the mail. ** ** Delivermail is driven by tables defined in config.c. This ** file will be different from system to system, but the rest ** of the code will be the same. This table could be read in, ** but it seemed nicer to have it compiled in, since deliver- ** mail will potentially be exercised a lot. ** ** Usage: ** /etc/delivermail [-f name] [-a] [-q] [-v] [-n] [-m] addr ... ** ** Positional Parameters: ** addr -- the address to deliver the mail to. There ** can be several. ** ** Flags: ** -f name The mail is from "name" -- used for ** the header in local mail, and to ** deliver reports of failures to. ** -r name Same as -f; however, this flag is ** reserved to indicate special processing ** for remote mail delivery as needed ** in the future. So, network servers ** should use -r. ** -a This mail should be in ARPANET std ** format (not used). ** -n Don't do aliasing. This might be used ** when delivering responses, for ** instance. ** -d Run in debug mode. ** -em Mail back a response if there was an ** error in processing. This should be ** used when the origin of this message ** is another machine. ** -ew Write back a response if the user is ** still logged in, otherwise, act like ** -em. ** -eq Don't print any error message (just ** return exit status). ** -ep (default) Print error messages ** normally. ** -ee Send BerkNet style errors. This ** is equivalent to MailBack except ** that it has gives zero return code ** (unless there were errors during ** returning). This used to be ** "EchoBack", but you know how the old ** software bounces. ** -m In group expansion, send to the ** sender also (stands for the Mail metoo ** option. ** -i Do not terminate mail on a line ** containing just dot. ** -s Save UNIX-like "From" lines on the ** front of messages. ** ** Return Codes: ** As defined in . ** ** These codes are actually returned from the auxiliary ** mailers; it is their responsibility to make them ** correct. ** ** Compilation Flags: ** LOG(( -- if set, everything is logged. ** ** Compilation Instructions: ** cc -c -O main.c config.c deliver.c parse.c ** cc -n -s *.o -lS ** chown root a.out ** chmod 755 a.out ** mv a.out delivermail ** ** Deficiencies: ** It ought to collect together messages that are ** destined for a single host and send these ** to the auxiliary mail server together. ** It should take "user at host" as three separate ** parameters and combine them into one address. ** ** Author: ** Eric Allman, UCB/INGRES */ bool ArpaFmt; /* mail is expected to be in ARPANET format */ bool FromFlag; /* from person is explicitly specified */ bool Debug; /* run in debug mode */ bool MailBack; /* mail back response on error */ bool BerkNet; /* called from BerkNet */ bool WriteBack; /* write back response on error */ bool HasXscrpt; /* if set, the transcript file exists */ bool NoAlias; /* don't do aliasing */ bool ForceMail; /* mail even if already sent a copy */ bool MeToo; /* send to the sender also if in a group expansion */ bool SaveFrom; /* save From lines on the front of messages */ bool IgnrDot; /* if set, ignore dot when collecting mail */ bool SuprErrs; /* supress errors if set */ int Errors; /* count of errors */ char InFileName[] = "/tmp/mailtXXXXXX"; char Transcript[] = "/tmp/mailxXXXXXX"; addrq From; /* the from person */ char *To; /* the target person */ int HopCount; /* hop count */ int ExitStat; /* the exit status byte */ addrq SendQ; /* queue of people to send to */ addrq AliasQ; /* queue of people who turned out to be aliases */ main(argc, argv) int argc; char **argv; { register char *p; extern char *maketemp(); extern char *getname(); extern int finis(); extern addrq *parse(); register addrq *q; extern char Version[]; extern int errno; char *from; register int i; typedef int (*fnptr)(); char nbuf[MAXLINE]; if (signal(SIGINT, SIG_IGN) != SIG_IGN) signal(SIGINT, finis); signal(SIGTERM, finis); setbuf(stdout, (char *) NULL); # ifdef LOG openlog("delivermail", 0); # endif LOG # ifdef DEBUG # ifdef DEBUGFILE if ((i = open(DEBUGFILE, 1)) > 0) { lseek(i, 0L, 2); close(1); dup(i); close(i); Debug++; } # endif DEBUGFILE # endif errno = 0; from = NULL; /* ** Crack argv. */ while (--argc > 0 && (p = *++argv)[0] == '-') { switch (p[1]) { case 'r': /* obsolete -f flag */ case 'f': /* from address */ p += 2; if (*p == '\0') { p = *++argv; if (--argc <= 0 || *p == '-') { syserr("No \"from\" person"); argc++; argv--; break; } } if (from != NULL) { syserr("More than one \"from\" person"); break; } from = p; break; case 'h': /* hop count */ p += 2; if (*p == '\0') { p = *++argv; if (--argc <= 0 || *p < '0' || *p > '9') { syserr("Bad hop count (%s)", p); argc++; argv--; break; } } HopCount = atoi(p); break; case 'e': /* error message disposition */ switch (p[2]) { case 'p': /* print errors normally */ break; /* (default) */ case 'q': /* be silent about it */ freopen("/dev/null", "w", stdout); break; case 'm': /* mail back */ MailBack++; openxscrpt(); break; case 'e': /* do berknet error processing */ BerkNet++; openxscrpt(); break; case 'w': /* write back (or mail) */ WriteBack++; openxscrpt(); break; } break; # ifdef DEBUG case 'd': /* debug */ Debug++; printf("%s\n", Version); break; # endif DEBUG case 'n': /* don't alias */ NoAlias++; break; case 'm': /* send to me too */ MeToo++; break; case 'i': /* don't let dot stop me */ IgnrDot++; break; case 'a': /* arpanet format */ ArpaFmt++; break; case 's': /* save From lines in headers */ SaveFrom++; break; default: /* at Eric Schmidt's suggestion, this will not be an error.... syserr("Unknown flag %s", p); ... seems that upward compatibility will be easier. */ break; } } if (from != NULL && ArpaFmt) syserr("-f and -a are mutually exclusive"); /* ** Get a temp file. */ p = maketemp(); if (from == NULL) from = p; # ifdef DEBUG if (Debug) printf("Message-Id: <%s>\n", MsgId); # endif DEBUG /* ** Figure out who it's coming from. ** Under certain circumstances allow the user to say who ** s/he is (using -f or -r). These are: ** 1. The user's uid is zero (root). ** 2. The user's login name is "network" (mail from ** a network server). ** 3. The user's login name is "uucp" (mail from the ** uucp network). ** 4. The address the user is trying to claim has a ** "!" character in it (since #3 doesn't do it for ** us if we are dialing out). ** A better check to replace #3 & #4 would be if the ** effective uid is "UUCP" -- this would require me ** to rewrite getpwent to "grab" uucp as it went by, ** make getname more nasty, do another passwd file ** scan, or compile the UID of "UUCP" into the code, ** all of which are reprehensible. ** ** Assuming all of these fail, we figure out something ** ourselves. */ errno = 0; p = getname(); if (p == NULL || p[0] == '\0') { syserr("Who are you? (uid=%d)", getuid()); finis(); } errno = 0; if (from != NULL) { if (strcmp(p, "network") != 0 && strcmp(p, "uucp") != 0 && index(from, '!') == NULL && getuid() != 0) { /* network sends -r regardless (why why why?) */ /* syserr("%s, you cannot use the -f flag", p); */ from = NULL; } } if (from == NULL || from[0] == '\0') from = p; else FromFlag++; SuprErrs = TRUE; if (parse(from, &From, 0) == NULL) { /* too many arpanet hosts generate garbage From addresses .... syserr("Bad from address `%s'", from); .... so we will just ignore this address */ from = p; FromFlag = FALSE; } SuprErrs = FALSE; # ifdef DEBUG if (Debug) printf("From person = \"%s\"\n", From.q_paddr); # endif DEBUG if (argc <= 0) usrerr("Usage: /etc/delivermail [flags] addr..."); /* ** Process Hop count. ** The Hop count tells us how many times this message has ** been processed by delivermail. If it exceeds some ** fairly large threshold, then we assume that we have ** an infinite forwarding loop and die. */ if (++HopCount > MAXHOP) syserr("Infinite forwarding loop (%s->%s)", From.q_paddr, *argv); /* ** Scan argv and deliver the message to everyone. */ for (; argc-- > 0; argv++) { p = argv[1]; if (argc >= 2 && p[2] == '\0' && (p[0] == 'a' || p[0] == 'A') && (p[1] == 't' || p[1] == 'T')) { if (strlen(argv[0]) + strlen(argv[2]) + 2 > sizeof nbuf) { usrerr("address overflow"); p = argv[0]; } else { strcpy(nbuf, argv[0]); strcat(nbuf, "@"); strcat(nbuf, argv[2]); p = nbuf; argv += 2; argc -= 2; } } else p = argv[0]; sendto(p, 0); } /* if we have had errors sofar, drop out now */ if (Errors > 0 && ExitStat == EX_OK) ExitStat = EX_USAGE; if (ExitStat != EX_OK) finis(); /* ** See if we have anyone to send to at all. */ if (nxtinq(&SendQ) == NULL && ExitStat == EX_OK) { syserr("Noone to send to!"); ExitStat = EX_USAGE; finis(); } /* ** Do aliasing. ** First arrange that the person who is sending the mail ** will not be expanded (unless explicitly requested). */ if (!MeToo) recipient(&From, &AliasQ); To = NULL; alias(); if (nxtinq(&SendQ) == NULL && ExitStat == EX_OK) { /* syserr("Vacant send queue; probably aliasing loop"); ExitStat = EX_SOFTWARE; finis(); */ recipient(&From, &SendQ); } /* ** Actually send everything. */ for (q = &SendQ; (q = nxtinq(q)) != NULL; ) deliver(q, (fnptr) NULL); /* ** All done. */ finis(); } /* ** FINIS -- Clean up and exit. ** ** Parameters: ** none ** ** Returns: ** never ** ** Side Effects: ** exits delivermail ** ** Called By: ** main ** via signal on interrupt. ** ** Deficiencies: ** It may be that it should only remove the input ** file if there have been no errors. */ finis() { /* mail back the transcript on errors */ if (ExitStat != EX_OK) savemail(); if (HasXscrpt) unlink(Transcript); unlink(InFileName); exit(ExitStat); } /* ** OPENXSCRPT -- Open transcript file ** ** Creates a transcript file for possible eventual mailing or ** sending back. ** ** Parameters: ** none ** ** Returns: ** none ** ** Side Effects: ** Turns the standard output into a special file ** somewhere. ** ** Called By: ** main */ openxscrpt() { mktemp(Transcript); HasXscrpt++; if (freopen(Transcript, "w", stdout) == NULL) syserr("Can't create %s", Transcript); chmod(Transcript, 0600); setbuf(stdout, (char *) NULL); } ); exit(ExitStat); } /* ** OPENXSCRPT -- Open transcript file ** ** Creates a transcript file for possible eventual mailing or ** sending back. ** ** Parameters: ** none ** ** Returns: ** none ** ** Side Effects: ** Turns the standard output into a special file ** somewhere. ** ** Called By: ** main */ openxscrpt() { mktemp(Transcript); HasXscrpt++; if (freopen(Transcript, "w", stdout) == NULL) syserr("Can't create %s", Transcript); chmod(Transcript, 0600); setbcmd/delivermail/makefile 644 0 37 4757 2532276452 10623 # # VAX Version # # @(#)makefile 2.2 12/6/80 # # Compilation Flags (in CFLAGS): # -DDEBUG -- compile in debug stuff. This is not enabled # unless the debug flag is given, so the only # advantage in not including this is that the # binaries will be smaller. # -DLOG -- include log information. This is probably # only useful on systems that include the logger. # -DVFORK -- use 'vfork' instead of 'fork'. # -DDBM -- use the dbm package instead of scanning the # ALIASFILE sequentially. LIBS must(( include # -ldbm for this to work. # LIBS= -ldbm TARG= $(DESTDIR)/etc OBJS1= conf.o main.o maketemp.o parse.o alias.o deliver.o \ savemail.o addr.o err.o OBJS2= matchhdr.o sysexits.o util.o bmove.o SRCS= useful.h dlvrmail.h \ conf.c deliver.c main.c parse.c err.c alias.c savemail.c addr.c \ matchhdr.c sysexits.c util.c bmove.c bmove.11.s bmove.vax.s \ arpa.c arpadate.c version.c maketemp.c \ newaliases.c praliases.c ALL= delivermail newaliases arpa CHOWN= -echo chown CHMOD= chmod CFLAGS= -O -DDBM -DVFORK -DDEBUG LDFLAGS= AR= -ar ARFLAGS=rvu LINT= lint LINTFLAGS=-bxa XREF= csh /usr/bin/xref CP= cp ROOT= root OBJMODE=755 delivermail: $(OBJS1) $(OBJS2) version.o $(CC) $(LDFLAGS) -o delivermail version.o $(OBJS1) $(OBJS2) $(LIBS) $(CHMOD) $(OBJMODE) delivermail size delivermail; ls -l delivermail install: all $(CP) delivermail $(TARG)/delivermail install -s newaliases $(DESTDIR)/usr/ucb $(OBJS1): dlvrmail.h dlvrmail.h util.o: useful.h all: $(ALL) # # Auxiliary stuff # clean: rm -f core delivermail arpa uucp a.out xref rm -f *.o archive: ${AR} ${ARFLAGS} delivermail.a READ_ME TO_BE_DONE makefile makefl.* *.h *.c *.s makeversion *.[123456789u] print: xref @ls -l | pr -h "delivermail directory" @pr -h "cross reference listing" xref @size *.o | pr -h "object code sizes" @pr *.h *.[cs] lint: $(LINT) $(LINTFLAGS) $(SRCS) xref: *.c ${XREF} *.c > xref # # Data base maintenance routines # AOBJS= newaliases.o parse.o conf.o util.o newaliases: $(AOBJS) $(CC) $(LDFLAGS) $(AOBJS) -o newaliases $(LIBS) praliases: praliases.c $(CC) $(CFLAGS) praliases.c -o praliases $(LIBS) newaliases.o praliases.o: dlvrmail.h # # Auxiliary mailers # arpa: arpa.o matchhdr.o arpadate.o $(CC) $(LDFLAGS) -o arpa arpa.o matchhdr.o arpadate.o $(LIBS) ${CHMOD} ${OBJMODE} arpa size arpa; ls -l arpa uucp: uucp.o ${CC} ${LDFLAGS} -o uucp uucp.o ${LIBS} ${CHMOD} ${OBJMODE} uucp size uucp; ls -l uucp mail: mail.o getname.o $(CC) $(LDFLAGS) -o mail mail.o getname.o size mail; ls -l mail $(AOBJS) -o newacmd/delivermail/makefl.ing70 644 0 37 3742 2516353510 11212 # # INGRES 11/70 Version # # @(#)makefl.ing70 2.1 11/5/80 # LIBS= -lX -lS TARG= /etc OBJS1= conf.o main.o maketemp.o parse.o alias.o deliver.o \ savemail.o addr.o err.o OBJS2= matchhdr.o sysexits.o util.o bmove.o SRCS= useful.h dlvrmail.h \ conf.c deliver.c main.c parse.c err.c alias.c savemail.c addr.c \ matchhdr.c sysexits.c util.c bmove.c bmove.11.s bmove.vax.s \ arpa.c arpadate.c version.c maketemp.c CHOWN= -echo chown CHMOD= chmod CFLAGS= -O -DDEBUG -DLOG LDFLAGS=-n AR= -ar ARFLAGS=rvu LINT= lint LINTFLAGS=-bxa XREF= csh /usr/bin/xref CP= cp GET= sccs get DELTA= sccs delta REL= ROOT= root OBJMODE=755 delivermail: $(OBJS1) $(OBJS2) version.o $(CC) $(LDFLAGS) -o delivermail version.o $(OBJS1) $(OBJS2) $(LIBS) $(CHMOD) $(OBJMODE) delivermail size delivermail; ls -l delivermail install: $(OBJS1) $(OBJS2) install1 delivermail $(CP) delivermail $(TARG)/delivermail install1: @rm -f SCCS/p.version.c version.c @$(GET) $(REL) -e -s SCCS/s.version.c @$(DELTA) -s SCCS/s.version.c @$(GET) -t SCCS/s.version.c main.o: main.c $(CC) $(CFLAGS) -DDEBUGFILE=\"/mnt/eric/DEBUG.DLVRML\" -c $< $(OBJS1): dlvrmail.h dlvrmail.h util.o: useful.h # # Auxiliary stuff # clean: rm -f core delivermail arpa uucp a.out xref version.c rm -f *.o sources: $(SRCS) $(SRCS): $(GET) $(REL) SCCS/s.$@ archive: ${AR} ${ARFLAGS} delivermail.a READ_ME TO_BE_DONE makefile makefl.* *.h *.c *.s makeversion *.[123456789u] print: xref @ls -l | pr -h "delivermail directory" @pr -h "cross reference listing" xref @size *.o | pr -h "object code sizes" @pr *.h *.[cs] lint: $(LINT) $(LINTFLAGS) $(SRCS) xref: *.c ${XREF} *.c > xref # # Auxiliary mailers # arpa: arpa.o matchhdr.o arpadate.o $(CC) $(LDFLAGS) -o arpa arpa.o matchhdr.o arpadate.o $(LIBS) ${CHMOD} ${OBJMODE} arpa size arpa; ls -l arpa uucp: uucp.o ${CC} ${LDFLAGS} -o uucp uucp.o ${LIBS} ${CHMOD} ${OBJMODE} uucp size uucp; ls -l uucp mail: mail.o getname.o $(CC) $(LDFLAGS) -o mail mail.o getname.o size mail; ls -l mail erence listing" xref @size *.cmd/delivermail/makefl.vax 644 0 37 3602 2516353510 11057 # # VAX Version # # @(#)makefl.vax 2.1 11/5/80 # LIBS= TARG= /etc OBJS1= conf.o main.o maketemp.o parse.o alias.o deliver.o \ savemail.o addr.o err.o OBJS2= matchhdr.o sysexits.o util.o bmove.o SRCS= useful.h dlvrmail.h \ conf.c deliver.c main.c parse.c err.c alias.c savemail.c addr.c \ matchhdr.c sysexits.c util.c bmove.c bmove.11.s bmove.vax.s \ arpa.c arpadate.c version.c maketemp.c CHOWN= -echo chown CHMOD= chmod CFLAGS= -O -DDEBUG -I. LDFLAGS=-n -s AR= -ar ARFLAGS=rvu LINT= lint LINTFLAGS=-bxa XREF= csh /usr/bin/xref CP= cp GET= sccs get DELTA= sccs delta REL= ROOT= root OBJMODE=755 delivermail: $(OBJS1) $(OBJS2) version.o $(CC) $(LDFLAGS) -o delivermail version.o $(OBJS1) $(OBJS2) $(LIBS) $(CHMOD) $(OBJMODE) delivermail size delivermail; ls -l delivermail install: $(OBJS1) $(OBJS2) install1 delivermail $(CP) delivermail $(TARG)/delivermail install1: @rm -f SCCS/p.version.c version.c @$(GET) $(REL) -e -s SCCS/s.version.c @$(DELTA) -s SCCS/s.version.c @$(GET) -t SCCS/s.version.c $(OBJS1): dlvrmail.h dlvrmail.h util.o: useful.h # # Auxiliary stuff # clean: rm -f core delivermail arpa uucp a.out xref version.c rm -f *.o sources: $(SRCS) $(SRCS): $(GET) $(REL) SCCS/s.$@ archive: ${AR} ${ARFLAGS} delivermail.a READ_ME TO_BE_DONE makefile makefl.* *.h *.c *.s makeversion *.[123456789u] print: xref @ls -l | pr -h "delivermail directory" @pr -h "cross reference listing" xref @size *.o | pr -h "object code sizes" @pr *.h *.[cs] lint: $(LINT) $(LINTFLAGS) $(SRCS) xref: *.c ${XREF} *.c > xref # # Auxiliary mailers # arpa: arpa.o matchhdr.o arpadate.o $(CC) $(LDFLAGS) -o arpa arpa.o matchhdr.o arpadate.o $(LIBS) ${CHMOD} ${OBJMODE} arpa size arpa; ls -l arpa uucp: uucp.o ${CC} ${LDFLAGS} -o uucp uucp.o ${LIBS} ${CHMOD} ${OBJMODE} uucp size uucp; ls -l uucp mail: mail.o getname.o $(CC) $(LDFLAGS) -o mail mail.o getname.o size mail; ls -l mail erence listing" xref @size *.o | pr -h "object code sizes" @pr *.h *.[cs] lint: $(LINT) $(LINTFLAGS) $(SRCS) xref: *.c $cmd/delivermail/maketemp.c 644 0 37 12140 2516353511 11065 # include # include # include # include "dlvrmail.h" static char SccsId[] = "@(#)maketemp.c 2.3 12/6/80"; /* ** MAKETEMP -- read & parse message header & make temp file. ** ** Creates a temporary file name and copies the standard ** input to that file. While it is doing it, it looks for ** "From:" and "Sender:" fields to use as the from-person ** (but only if the -a flag is specified). It prefers to ** to use the "Sender:" field. ** ** MIT seems to like to produce "Sent-By:" fields instead ** of "Sender:" fields. We used to catch this, but it turns ** out that the "Sent-By:" field doesn't always correspond ** to someone real ("___057", for instance), as required by ** the protocol. So we limp by..... ** ** Parameters: ** none ** ** Returns: ** Name of temp file. ** ** Side Effects: ** Temp file is created and filled. ** ** Called By: ** main ** ** Notes: ** This is broken off from main largely so that the ** temp buffer can be deallocated. */ char MsgId[MAXNAME]; /* message-id, determined or created */ long MsgSize; /* size of message in bytes */ bool GotHdr; /* if set, "From ..." line exists */ char * maketemp() { register FILE *tf; char buf[MAXFIELD+1]; static char fbuf[sizeof buf]; extern char *prescan(); extern char *matchhdr(); register char *p; register bool inheader; bool firstline; char c; extern int errno; /* ** Create the temp file name and create the file. */ mktemp(InFileName); close(creat(InFileName, 0600)); if ((tf = fopen(InFileName, "w")) == NULL) { syserr("Cannot create %s", InFileName); return (NULL); } /* ** Copy stdin to temp file & do message editting. ** From person gets copied into fbuf. At the end of ** this loop, if fbuf[0] == '\0' then there was no ** recognized from person in the message. We also ** save the message id in MsgId. The ** flag 'inheader' keeps track of whether we are ** in the header or in the body of the message. ** The flag 'firstline' is only true on the first ** line of a message. ** To keep certain mailers from getting confused, ** and to keep the output clean, lines that look ** like UNIX "From" lines are deleted in the header, ** and prepended with ">" in the body. */ inheader = TRUE; firstline = TRUE; fbuf[0] = '\0'; while (!feof(stdin) && fgets(buf, sizeof buf, stdin) != NULL) { if (inheader && isalnum(buf[0])) { /* get the rest of this field */ while ((c = getc(stdin)) == ' ' || c == '\t') { p = &buf[strlen(buf)]; *p++ = c; if (fgets(p, sizeo((f buf - (p - buf), stdin) == NULL) break; } if (c != EOF) ungetc(c, stdin); } if (!IgnrDot && buf[0] == '.' && (buf[1] == '\n' || buf[1] == '\0')) break; /* are we still in the header? */ if ((buf[0] == '\n' || buf[0] == '\0') && inheader) { inheader = FALSE; if (MsgId[0] == '\0') { makemsgid(); if (UseMsgId) fprintf(tf, "Message-Id: <%s>\n", MsgId); } # ifdef DEBUG if (Debug) printf("EOH\n"); # endif DEBUG } /* Hide UNIX-like From lines */ if (strncmp(buf, "From ", 5) == 0) { if (!firstline) { fputs(">", tf); MsgSize++; } else GotHdr++; } if (inheader && !isspace(buf[0])) { /* find out if this is really a header */ for (p = buf; *p != ':' && *p != '\0' && !isspace(*p); p++) continue; while (*p != ':' && isspace(*p)) p++; if (*p != ':') { inheader = FALSE; # ifdef DEBUG if (Debug) printf("EOH?\n"); # endif DEBUG } } if (inheader) { /* find the sender */ p = matchhdr(buf, "sender"); if (p == NULL && fbuf[0] == '\0') p = matchhdr(buf, "from"); if (p != NULL) prescan(p, fbuf, &fbuf[sizeof fbuf - 1], '\0'); /* find the message id */ p = matchhdr(buf, "message-id"); if (p != NULL && MsgId[0] == '\0') prescan(p, MsgId, &MsgId[sizeof MsgId - 1], '\0'); } MsgSize += strlen(buf); fputs(buf, tf); firstline = FALSE; if (ferror(tf)) { if (errno == ENOSPC) { freopen(InFileName, "w", tf); fputs("\nMAIL DELETED BECAUSE OF LACK OF DISK SPACE\n\n", tf); syserr("Out of disk space for temp file"); } else syserr("Cannot write %s", InFileName); freopen("/dev/null", "w", tf); } } fclose(tf); if (MsgId[0] == '\0') makemsgid(); if (freopen(InFileName, "r", stdin) == NULL) syserr("Cannot reopen %s", InFileName); return (ArpaFmt && fbuf[0] != '\0' ? fbuf : NULL); } /* ** MAKEMSGID -- Compute a message id for this process. ** ** This routine creates a message id for a message if ** it did not have one already. If the MESSAGEID compile ** flag is set, the messageid will be added to any message ** that does not already have one. Currently it is more ** of an artifact, but I suggest that if you are hacking, ** you leave it in -- I may want to use it someday if ** duplicate messages turn out to be a problem. ** ** Parameters: ** none. ** ** Returns: ** none. ** ** Side Effects: ** Stores a message-id into MsgId. ** ** Called By: ** maketemp */ makemsgid() { auto long t; extern char *MyLocName; extern char *ArpaHost; time(&t); sprintf(MsgId, "%ld.%d.%s@%s", t, getpid(), MyLocName, ArpaHost); } t does not already have one. Currently it is more ** of an artifact, but I suggest that if you are hacking, ** you leave it in -- I may want to use it someday if ** duplicate messages turn out to be a problem. ** ** Parameters: ** none. ** ** Returns: ** none. ** ** Side Effects: ** Stores a message-id into MsgId. ** ** Called By: ** maketemp */ makemsgid() { auto long t; extern char *MyLocName; extern ccmd/delivermail/matchhdr.c 644 0 37 2622 2516353511 11040 # include # include static char SccsId[] = "@(#)matchhdr.c 2.1 11/5/80"; /* ** MATCHHDR -- Match header line ** ** Matches a header line in arpanet format (case and white ** space is ignored). ** ** This routine is used by arpa-mailer and delivermail. ** ** Parameters: ** line -- the line to match against. ** pat -- the pattern to match against; must be in ** lower case. ** ** Returns: ** address of the 'value' of the pattern (the beginning ** of the non-white string following the delim). ** NULL if none found. ** ** Side Effects: ** none ** ** Called By: ** maketemp ** sendmail [arpa.c] ** ** Deficiencies: ** It doesn't handle folded lines. */ char * matchhdr(line, pat) char *line; char *pat; { register char *p; register char *q; for (q = pat, p = line; *q != '\0'; p++, q++) if (lower(*p) != *q) return (NULL); while (isspace(*p)) p++; if (*p != ':') return (NULL); while (isspace(*++p)) continue; return (*p == '\0' ? NULL : p); } /* ** LOWER -- Convert a character to lower case ** ** If the argument is an upper case letter, it is converted ** to a lower case letter, otherwise it is passed through ** unchanged. ** ** Parameters: ** c -- the character to check. ** ** Returns: ** c converted to lower case. ** ** Side Effects: ** none ** ** Called By: ** matchhdr */ lower(c) register char c; { if (isupper(c)) c -= 'A' - 'a'; return (c); } return (NULL); while (isspace(*++p)) continue; return (*p == '\0' ? NULL : p); } /* ** LOWER -- Convercmd/delivermail/newaliases.c 644 0 37 6601 2516353512 11403 # include # include # include "dlvrmail.h" static char SccsId[] = "@(#)newaliases.c 2.1 11/5/80"; typedef struct { char *dptr; int dsize; } datum; char *aliases = ALIASFILE; char dirbuf[100]; char pagbuf[100]; int LineNo; char *To; int ExitStat; int Errors; # ifdef DEBUG bool Debug; # endif DEBUG main(argc, argv) int argc; char *argv[]; { int f; char line[BUFSIZ]; char line2[MAXLINE]; register char *p; char *cp, *p2; char *rhs; int naliases, bytes, longest; datum key, content; bool skipping; addrq al, bl; extern char *prescan(); extern addrq *parse(); bool contin; # ifdef DEBUG if (argc > 1 && strcmp(argv[1], "-T") == 0) { Debug++; argc--; argv++; } # endif DEBUG if (argc > 1) aliases = argv[1]; strcpy(dirbuf, aliases); strcat(dirbuf, ".dir"); strcpy(pagbuf, aliases); strcat(pagbuf, ".pag"); f = creat(dirbuf, 0666); if (f < 0) { perror(dirbuf); exit(1); } close(f); f = creat(pagbuf, 0666); if (f < 0) { perror(pagbuf); exit(1); } close(f); if (dbminit(aliases) < 0) exit(1); if (freopen(aliases, "r", stdin) == 0) { perror(aliases); exit(1); } /* read and interpret lines */ LineNo = 0; naliases = 0; bytes = 0; longest = 0; skipping = FALSE; while (fgets(line, sizeof (line), stdin) != NULL) { LineNo++; switch (line[0]) { case '#': case '\n': case '\0': skipping = FALSE; continue; case ' ': case '\t': if (!skipping) usrerr("Non-continuation line starts with space"); skipping = TRUE; continue; } skipping = FALSE; /* process the LHS */ for (p = line; *p != '\0' && *p != ':' && *p != '\n'; p++) continue; if (*p == '\0' || *p == '\n') { syntaxerr: usrerr("missing colon"); continue; } *p++ = '\0'; if (parse(line, &al, 1) == NULL) { *--p = ':'; goto syntaxerr; } rhs = cp = p; contin = FALSE; for (;;) { register char c; /* do parsing & compression of addresses */ c = *p; while (c != '\0') { p2 = p; while (*p != '\n' && *p != ',' && *p != '\0') p++; c = *p; *p++ = '\0'; if (prescan(p2, cp, &line[sizeof line - 1], ',') == NULL) continue; contin = FALSE; if (parse(cp, &bl, -1) != NULL) cp += strlen(cp); if (c == ',') { *cp++ = ','; contin = TRUE; } } /* see if there should be a continuation line */ if (!contin) break; /* read continuation line */ if (fgets(line2, sizeof (line2), stdin) == NULL) break; LineNo++; if (!isspace(line2[0])) usrerr("continuation line missing"); p = line2; } if (al.q_mailer != &Mailer[0]) { usrerr("cannot alias non-local names"); continue; } naliases++; key.dsize = strlen(al.q_user) + 1; key.dptr = al.q_user; content.dsize = strlen(rhs) + 1; if (content.dsize > longest) longest = content.dsize; content.dptr = rhs; bytes += key.dsize + content.dsize; if (store(key, content), 0) /* if (f = store(key, content)) */ usrerr("Dbm internal error return %d from store\n", f); } fprintf(stderr, "%d aliases, %d bytes, longest %d bytes, %d errors\n", naliases, bytes, longest, Errors); exit(ExitStat); } usrerr(fmt, a, b, c, d, e) char *fmt; { Errors++; fprintf(stderr, "line %d: ", LineNo); fprintf(stderr, fmt, a, b, c, d, e); fprintf(stderr, "\n"); return (-1); } syserr(fmt, a, b, c, d, e) char *fmt; { return (usrerr(fmt, a, b, c, d, e)); } if (store(key, content), 0) /* if (f = store(key, content)) */ usrerr("Dbm internal error return %d from store\n", f); }cmd/delivermail/parse.c 644 0 37 24205 2516353512 10402 # include # include # include "dlvrmail.h" static char SccsId[] = "@(#)parse.c 2.5 1/8/81"; /* ** PARSE -- Parse an address ** ** Parses an address and breaks it up into three parts: a ** net to transmit the message on, the host to transmit it ** to, and a user on that host. These are loaded into an ** addrq header with the values squirreled away if necessary. ** The "user" part may not be a real user; the process may ** just reoccur on that machine. For example, on a machine ** wit((h an arpanet connection, the address ** csvax.bill@berkeley ** will break up to a "user" of 'csvax.bill' and a host ** of 'berkeley' -- to be transmitted over the arpanet. ** ** Parameters: ** addr -- the address to parse. ** a -- a pointer to the address descriptor buffer. ** If NULL, a header will be created. ** copyf -- determines what shall be copied: ** -1 -- don't copy anything. The printname ** (q_paddr) is just addr, and the ** user & host are allocated internally ** to parse. ** 0 -- copy out the parsed user & host, but ** don't copy the printname. ** +1 -- copy everything. ** ** Returns: ** A pointer to the address descriptor header (`a' if ** `a' is non-NULL). ** NULL on error. ** ** Side Effects: ** none ** ** Called By: ** main ** sendto ** alias ** savemail */ # define DELIMCHARS "()<>@!.,;:\\\" \t\r\n" /* word delimiters */ # define SPACESUB ('.'|0200) /* substitution for */ addrq * parse(addr, a, copyf) char *addr; register addrq *a; int copyf; { register char *p; register struct parsetab *t; extern struct parsetab ParseTab[]; static char buf[MAXNAME]; register char c; register char *q; bool got_one; extern char *prescan(); extern char *xalloc(); char **pvp; /* ** Initialize and prescan address. */ To = addr; if (prescan(addr, buf, &buf[sizeof buf], '\0') == NULL) return (NULL); /* ** Scan parse table. ** Look for the first entry designating a character ** that is contained in the address. ** Arrange for q to point to that character. ** Check to see that there is only one of the char ** if it must be unique. ** Find the last one if the host is on the RHS. ** Insist that the host name is atomic. ** If just doing a map, do the map and then start all ** over. */ rescan: got_one = FALSE; for (t = ParseTab; t->p_char != '\0'; t++) { q = NULL; for (p = buf; (c = *p) != '\0'; p++) { /* find the end of this token */ while (isalnum(c) || c == '-' || c == '_') c = *++p; if (c == '\0') break; if (c == t->p_char) { got_one = TRUE; /* do mapping as appropriate */ if (flagset(P_MAP, t->p_flags)) { *p = t->p_arg[0]; if (flagset(P_ONE, t->p_flags)) goto rescan; else continue; } /* arrange for q to point to it */ if (q != NULL && flagset(P_ONE, t->p_flags)) { usrerr("multichar error"); ExitStat = EX_USAGE; return (NULL); } if (q == NULL || flagset(P_HLAST, t->p_flags)) q = p; } else { /* insist that host name is atomic */ if (flagset(P_HLAST, t->p_flags)) q = NULL; else break; } } if (q != NULL) break; } /* ** If we matched nothing cleanly, but we did match something ** somewhere in the process of scanning, then we have a ** syntax error. This can happen on things like a@b:c where ** @ has a right host and : has a left host. ** ** We also set `q' to the null string, in case someone forgets ** to put the P_MOVE bit in the local mailer entry of the ** configuration table. */ if (q == NULL) { q = ""; if (got_one) { usrerr("syntax error"); ExitStat = EX_USAGE; return (NULL); } } /* ** Interpret entry. ** t points to the entry for the mailer we will use. ** q points to the significant character. */ if (a == NULL) a = (addrq *) xalloc(sizeof *a); if (copyf > 0) { p = xalloc((unsigned) strlen(addr) + 1); strcpy(p, addr); a->q_paddr = p; } else a->q_paddr = addr; a->q_mailer = &Mailer[t->p_mailer]; if (flagset(P_MOVE, t->p_flags)) { /* send the message to another host & retry */ a->q_host = t->p_arg; if (copyf >= 0) { p = xalloc((unsigned) strlen(buf) + 1); strcpy(p, buf); a->q_user = p; } else a->q_user = buf; } else { /* ** Make local copies of the host & user and then ** transport them out. */ *q++ = '\0'; if (flagset(P_HLAST, t->p_flags)) { a->q_host = q; a->q_user = buf; } else { a->q_host = buf; a->q_user = q; } /* ** Don't go to the net if already on the target host. ** This is important on the berkeley network, since ** it get confused if we ask to send to ourselves. ** For nets like the ARPANET, we probably will have ** the local list set to NULL to simplify testing. ** The canonical representation of the name is also set ** to be just the local name so the duplicate letter ** suppression algorithm will work. */ if ((pvp = a->q_mailer->m_local) != NULL) { while (*pvp != NULL) { auto char buf2[MAXNAME]; strcpy(buf2, a->q_host); if (!flagset(P_HST_UPPER, t->p_flags)) makelower(buf2); if (strcmp(*pvp++, buf2) == 0) { strcpy(buf2, a->q_user); p = a->q_paddr; if (parse(buf2, a, -1) == NULL) { To = addr; return (NULL); } To = a->q_paddr = p; break; } } } /* make copies if specified */ if (copyf >= 0) { p = xalloc((unsigned) strlen(a->q_host) + 1); strcpy(p, a->q_host); a->q_host = p; p = xalloc((unsigned) strlen(a->q_user) + 1); strcpy(p, a->q_user); a->q_user = p; } } /* ** Do UPPER->lower case mapping unless inhibited. */ if (!flagset(P_HST_UPPER, t->p_flags)) makelower(a->q_host); if (!flagset(P_USR_UPPER, t->p_flags)) makelower(a->q_user); /* ** Compute return value. */ # ifdef DEBUG if (Debug) printf("parse(\"%s\"): host \"%s\" user \"%s\" mailer %d\n", addr, a->q_host, a->q_user, t->p_mailer); # endif DEBUG return (a); } /* ** MAKELOWER -- Translate a line into lower case ** ** Parameters: ** p -- the string to translate. If NULL, return is ** immediate. ** ** Returns: ** none. ** ** Side Effects: ** String pointed to by p is translated to lower case. ** ** Called By: ** parse */ makelower(p) register char *p; { register char c; if (p == NULL) return; for (; (c = *p) != '\0'; p++) if ((c & 0200) == 0 && isupper(c)) *p = c - 'A' + 'a'; } /* ** PRESCAN -- Prescan name and make it canonical ** ** Scans a name and turns it into canonical form. This involves ** deleting blanks, comments (in parentheses), and turning the ** word "at" into an at-sign ("@"). The name is copied as this ** is done; it is legal to copy a name onto itself, since this ** process can only make things smaller. ** ** This routine knows about quoted strings and angle brackets. ** ** There are certain subtleties to this routine. The one that ** comes to mind now is that backslashes on the ends of names ** are silently stripped off; this is intentional. The problem ** is that some versions of sndmsg (like at LBL) set the kill ** character to something other than @ when reading addresses; ** so people type "csvax.eric\@berkeley" -- which screws up the ** berknet mailer. ** ** Parameters: ** addr -- the name to chomp. ** buf -- the buffer to copy it into. ** buflim -- the last usable address in the buffer ** (which will old a null byte). Normally ** &buf[sizeof buf - 1]. ** delim -- the delimiter for the address, normally ** '\0' or ','; \0 is accepted in any case. ** are moving in place; set buflim to high core. ** ** Returns: ** A pointer to the terminator of buf. ** NULL on error. ** ** Side Effects: ** buf gets clobbered. ** ** Called By: ** parse ** maketemp */ char * prescan(addr, buf, buflim, delim) char *addr; char *buf; char *buflim; char delim; { register char *p; bool space; bool quotemode; bool bslashmode; bool delimmode; int cmntcnt; int brccnt; register char c; register char *q; extern bool any(); space = FALSE; delimmode = TRUE; q = buf; bslashmode = quotemode = FALSE; cmntcnt = brccnt = 0; for (p = addr; (c = *p++) != '\0'; ) { /* chew up special characters */ *q = '\0'; if (bslashmode) { c |= 0200; bslashmode = FALSE; } else if (c == '"') quotemode = !quotemode; else if (c == '\\') { bslashmode++; continue; } else if (quotemode) c |= 0200; else if (c == delim) break; else if (c == '(') { cmntcnt++; continue; } else if (c == ')') { if (cmntcnt <= 0) { usrerr("Unbalanced ')'"); return (NULL); } else { cmntcnt--; continue; } } if (cmntcnt > 0) continue; else if (isascii(c) && isspace(c) && (space || delimmode)) continue; else if (c == '<') { if (brccnt < 0) { usrerr("multiple < spec"); return (NULL); } brccnt++; delimmode = TRUE; space = FALSE; if (brccnt == 1) { /* we prefer using machine readable name */ q = buf; *q = '\0'; continue; } } else if (c == '>') { if (brccnt <= 0) { usrerr("Unbalanced `>'"); return (NULL); } else brccnt--; if (brccnt <= 0) { brccnt = -1; continue; } } /* ** Turn "at" into "@", ** but only if "at" is a word. ** By the way, I violate the ARPANET RFC-733 ** standard here, by assuming that 'space' delimits ** atoms. I assume that is just a mistake, since ** it violates the spirit of the semantics ** of the document..... */ if (delimmode && (c == 'a' || c == 'A') && (p[0] == 't' || p[0] == 'T') && (any(p[1], DELIMCHARS) || p[1] <= 040)) { c = '@'; p++; } if (delimmode = any(c, DELIMCHARS)) space = FALSE; /* if not a space, squirrel it away */ if ((!isascii(c) || !isspace(c)) && brccnt >= 0) { if (q >= buflim-1) { usrerr("Address too long"); return (NULL); } if (space) *q++ = SPACESUB; *q++ = c; } space = isascii(c) && isspace(c); } *q = '\0'; if (c == '\0') p--; if (cmntcnt > 0) usrerr("Unbalanced '('"); else if (quotemode) usrerr("Unbalanced '\"'"); else if (brccnt > 0) usrerr("Unbalanced '<'"); else if (buf[0] != '\0') return (p); return (NULL); } ; /* if not a space, squirrel it away */ if ((!isascii(c) || !isspace(c)) && brccnt >= 0) { if (q >= buflim-1) { usrerr("Address too long"); return (NULL); } if (space) *q++ = SPACESUB; *q++ = c; } space = isascii(c) && isspace(c); } *q = '\0'; if (c == '\0') p--; if (cmntcnt > 0) usrerr("Unbalanced '('"); else if (quotemode) us((cmd/delivermail/savemail.c 644 0 37 12655 2516353513 11100 # include # include # include "dlvrmail.h" static char SccsId[] = "@(#)savemail.c 2.2 1/10/81"; /* ** SAVEMAIL -- Save mail on error ** ** If the MailBack flag is set, mail it back to the originator ** together with an error message; otherwise, just put it in ** dead.letter in the user's home directory (if he exists on ** this machine). ** ** Parameters: ** none ** ** Returns: ** none ** ** Side Effects: ** Saves the letter, by writing or mailing it back to the ** sender, or by putting it in dead.letter in her home ** directory. ** ** WARNING: the user id is reset to the original user. */ savemail() { register struct passwd *pw; register FILE *xfile; char buf[MAXLINE+1]; extern errhdr(); auto addrq to_addr; extern struct passwd *getpwnam(); register char *p; register int i; auto long tim; extern int errno; extern char *ttypath(); extern char *ctime(); extern addrq *parse(); static int exclusive; extern char *DaemonName; if (exclusive++) return; /* ** In the unhappy event we don't know who to return the mail ** to, make someone up. */ if (From.q_paddr == NULL) { if (parse("root", &From, 0) == NULL) { syserr("Cannot parse root!"); ExitStat = EX_SOFTWARE; finis(); } } /* ** If called from Eric Schmidt's network, do special mailback. ** Fundamentally, this is the mailback case except that ** it returns an OK exit status (assuming the return ** worked). */ if (BerkNet) { ExitStat = EX_OK; MailBack++; } /* ** If writing back, do it. ** If the user is still logged in on the same terminal, ** then write the error messages back to hir (sic). ** If not, set the MailBack flag so that it will get ** mailed back instead. */ if (WriteBack) { p = ttypath(); if (p == NULL || freopen(p, "w", stdout) == NULL) { MailBack++; errno = 0; } else { xfile = fopen(Transcript, "r"); if (xfile == NULL) syserr("Cannot open %s", Transcript); printf("\r\nMessage from %s\r\n", DaemonName); printf("Errors occurred while sending mail, transcript follows:\r\n"); while (fgets(buf, sizeof buf, xfile) && !ferror(stdout)) fputs(buf, stdout); if (ferror(stdout)) syserr("savemail: stdout: write err"); fclose(xfile); } } /* ** If mailing back, do it. ** Throw away all further output. Don't do aliases, since ** this could cause loops, e.g., if joe mails to x:joe, ** and for some reason the network for x: is down, then ** the response gets sent to x:joe, which gives a ** response, etc. Also force the mail to be delivered ** even if a version of it has already been sent to the ** sender. */ if (MailBack || From.q_mailer != &Mailer[0]) { freopen("/dev/null", "w", stdout); NoAlias++; ForceMail++; /* fake up an address header for the from person */ bmove((char *) &From, (char *) &to_addr, sizeof to_addr); if (parse(DaemonName, &From, -1) == NULL) { syserr("Can't parse myself!"); ExitStat = EX_SOFTWARE; finis(); } i = deliver(&to_addr, errhdr); bmove((char *) &to_addr, (char *) &From, sizeof From); if (i != 0) syserr("Can't return mail to %s", p); else return; } /* ** Save the message in dead.letter. ** If we weren't mailing back, and the user is local, we ** should save the message in dead.letter so that the ** poor person doesn't have to type it over again -- ** and we all know what poor typists programmers are. */ setuid(getuid()); setgid(getgid()); setpwent(); if (From.q_mailer == &Mailer[0] && (pw = getpwnam(From.q_user)) != NULL) { /* user has a home directory */ p = pw->pw_dir; } else { syserr("Can't return mail to %s (pw=%u)", From.q_paddr, pw); # ifdef DEBUG p = "/usr/tmp"; # else p = NULL; # endif } if (p != NULL) { /* we have a home directory; open dead.letter */ strcpy(buf, p); strcat(buf, "/dead.letter"); xfile = fopen(buf, "a"); if (xfile == NULL) printf("Cannot save mail, sorry\n"); else { rewind(stdin); errno = 0; time(&tim); fprintf(xfile, "----- Mail saved at %s", ctime(&tim)); while (fgets(buf, sizeof buf, stdin) && !ferror(xfile)) fputs(buf, xfile); fputs("\n", xfile); if (ferror(xfile)) syserr("savemail: dead.letter: write err"); fclose(xfile); printf("Letter saved in dead.letter\n"); } } else /* add terminator to writeback message */ if (WriteBack) printf("-----\r\n"); } /* ** ERRHDR -- Output the header for error mail. ** ** This is the edit filter to error mailbacks. ** ** Algorithm: ** Output fixed header. ** Output the transcript part. ** Output the original message. ** ** Parameters: ** xfile -- the transcript file. ** fp -- the output file. ** ** Returns: ** none ** ** Side Effects: ** input from xfile ** output to fp ** ** Called By: ** deliver */ errhdr(fp) register FILE *fp; { char copybuf[512]; register int i; register int xfile; extern int errno; if ((xfile = open(Transcript, 0)) < 0) syserr("Cannot open %s", Transcript); fflush(stdout); errno = 0; fprintf(fp, "To: %s\n", To); fprintf(fp, "Subject: Unable to deliver mail\n"); fprintf(fp, "\n ----- Transcript of session follows -----\n"); fflush(fp); while ((i = read(xfile, copybuf, sizeof copybuf)) > 0) write(fileno(fp), copybuf, i); fprintf(fp, "\n ----- Unsent message follows -----\n"); fflush(fp); rewind(stdin); while ((i = read(fileno(stdin), copybuf, sizeof copybuf)) > 0) write(fileno(fp), copybuf, i); close(xfile); if (errno != 0) syserr("errhdr: I/O error"); } errno = 0; fprintf(fp, "To: %s\n", To); fprintf(fp, "Subject: Unable to delivercmd/delivermail/showdbm.c 644 0 37 1463 2516353513 10715 # include "dlvrmail.h" static char sccsid[] = "@(#)showdbm.c 2.1 11/5/80"; typedef struct { char *dptr; int dsize; } datum; datum firstkey(), nextkey(), fetch(); char *filename = ALIASFILE; main(argc, argv) char **argv; { datum content, key; if (argc > 2 && strcmp(argv[1], "-f") == 0) { argv++; filename = *++argv; argc -= 2; } if (dbminit(filename) < 0) exit(EX_OSFILE); argc--, argv++; if (argc == 0) { for (key = firstkey(); key.dptr; key = nextkey(key)) { content = fetch(key); printf("\n%s:%s\n", key.dptr, content.dptr); } exit(EX_OK); } while (argc) { key.dptr = *argv; key.dsize = strlen(*argv)+1; content = fetch(key); if (content.dptr == 0) printf("%s: No such key\n"); else printf("\n%s:%s\n", key.dptr, content.dptr); argc--, argv++; } exit(EX_OK); } filename = *++argv; argc -= 2; } if (dbminit(filename) < 0) exit(EX_OSFILE); argc--, argv++; if (argc == 0) { for (key = firstkey(); key.dptr; key = nextkey(key)) { content = fetch(key); cmd/delivermail/sysexits.c 644 0 37 1042 2516353513 11136 # include static char SccsId[] = "@(#)sysexits.c 2.1 11/5/80"; /* ** SYSEXITS.C -- error messages corresponding to sysexits.h */ char *SysExMsg[] = { /* 64 */ "Bad usage", /* 65 */ "Data format error", /* 66 */ "Cannot open input", /* 67 */ "User unknown", /* 68 */ "Host unknown", /* 69 */ "Service unavailable", /* 70 */ "Internal error", /* 71 */ "Operating system error", /* 72 */ "System file missing", /* 73 */ "Can't create output", /* 74 */ "I/O error", }; int N_SysEx = sizeof SysExMsg / sizeof SysExMsg[0]; r SccsId[] = "@(#)sysexits.c 2.1 11/5/80"; /* ** SYSEXITS.C -- error messages corresponding to sysexits.h */ char *SysExMsg[] = { /* 64 */ "Bad usage", /* 65 */ "Data format error", /* 66 */ "Cannot open input", /* 67 */ "User unknown", /* 68 */ "Host unknown", /* 69 */ "Service unavailable", /* 70 */ "Internal error", /* 71 */ "Operating system error", /* 72 */ "System file missing", /* 73 */ "Can't create output", /* 74 */ "I/O error", }; int N_SysEx = sizecmd/delivermail/syslog.8 644 0 37 6425 2516353514 10523 .TH SYSLOG 8 .SH NAME syslog \- log systems messages .SH SYNOPSIS /etc/syslog < /dev/logx .SH DESCRIPTION .I Syslog reads its standard input and logs each line it reads into a set of files described by the configuration file /etc/syslog.config. .I Syslog configures when it starts up and whenever it receives a hangup signal. .PP Each message is one line. A message can contain a priority code, marked by a digit in angle braces at the beginning of the line. Priorities are defined in , as follows: .IP LO((G_ALERT \w'LOG_WARNING'u+2n this priority should essentially never be used. It applies only to messages that are so important that every user should be aware of them, e.g., a serious hardware failure. .IP LOG_SALERT messages of this priority should be issued only when immediate attention is needed by a qualified system person, e.g., when some valuable system resource dissappears. They get sent to a list of system people. .IP LOG_EMERG Emergency messages are not sent to users, but represent major conditions. An example might be hard disk failures. These could be logged in a separate file so that critical conditions could be easily scanned. .IP LOG_ERR these represent error conditions, such as soft disk failures, etc. .IP LOG_CRIT such messages contain critical information, but which can not be classed as errors, for example, 'su' attempts. Messages of this priority and higher are typically logged on the system console. .IP LOG_WARNING issued when an abnormal condition has been detected, but recovery can take place. .IP LOG_NOTICE something that falls in the class of "important information"; this class is informational but important enough that you don't want to throw it away casually. Messages without any priority assigned to them are typically mapped into this priority. .IP LOG_INFO information level messages. These messages could be thrown away without problems, but should be included if you want to keep a close watch on your system. .IP LOG_DEBUG it may be useful to log certain debugging information. Normally this will be thrown away. .PP It is expected that the kernel will not log anything below LOG_ERR priority. .PP The configuration file is in two sections seperated by a blank line. The first section defines files that .I syslog will log into. Each line contains a single digit which defines the lowest priority (highest numbered priority) that this file will receive, an optional asterisk which guarantees that something gets output at least every 20 minutes, and a pathname. The second part of the file contains a list of users that will be informed on SALERT level messages. For example, the configuration file: .nf 5*/dev/tty8 8/usr/spool/adm/syslog 3/usr/adm/critical eric kridle birman .fi logs all messages of priority 5 or higher onto the system console, including timing marks every 20 minutes; all messages of priority 8 or higher into the file /usr/spool/adm/syslog; and all messages of priority 3 or higher into /usr/adm/critical. The users ``eric'', ``kridle'', and ``birman'' will be informed on any subalert messages. .PP To bring .I syslog down, it should be sent a terminate signal. It logs that it is going down and then waits approximately 30 seconds for any additional messages to come in. .SH FILES /etc/syslog.config \- the configuration file .SH SEE\ ALSO logmsg(3) ng marks every 20 minutes; all messages of priority 8 or higher into the file /usr/spool/adm/syslog; and all messages of priority 3 or higher into /usr/adm/critical. The users ``eric'', ``kridle'', and ``birman'' will be informed on ancmd/delivermail/useful.h 644 0 37 251 2516353514 10535 /* ** USEFUL.H -- Some useful stuff. ** ** @(#)useful.h 2.1 11/5/80 */ # define bool char # define TRUE 1 # define FALSE 0 # ifndef NULL # define NULL 0 # endif NULL itional messages to come in. .SH FILES /etc/syslog.config \- the configuration file .SH SEE\ ALSO logmsg(3) ng marks every 20 minutes; all messages of priority 8 or higher into the file /usr/spool/adm/syslog; and all messages of priority 3 or higher i/,58< /,"cmd/delivermail/util.c 644 0 37 3071 2516353515 10226 # include # include "useful.h" static char SccsId[] = "@(#)util.c 2.1 11/5/80"; /* ** STRIPQUOTES -- Strip quotes & quote bits from a string. ** ** Runs through a string and strips off unquoted quote ** characters and quote bits. This is done in place. ** ** Parameters: ** s -- the string to strip. ** ** Returns: ** none. ** ** Side Effects: ** none. ** ** Called By: ** deliver */ stripquotes(s) char *s; { register char *p; register char *q; register char c; for (p = q = s; (c = *p++) != '\0'; ) { if (c != '"') *q++ = c & 0177; } *q = '\0'; } /* ** XALLOC -- Allocate memory and bitch wildly on failure. ** ** THIS IS A CLUDGE. This should be made to give a proper ** error -- but after all, what can we do? ** ** Parameters: ** sz -- size of area to allocate. ** ** Returns: ** pointer to data region. ** ** Side Effects: ** Memory is allocated. ** ** Called By: ** lots of people. */ char * xalloc(sz) register unsigned int sz; { register char *p; extern char *malloc(); p = malloc(sz); if (p == NULL) { syserr("Out of memory!!"); exit(EX_UNAVAILABLE); } return (p); } /* ** ANY -- Return TRUE if the character exists in the string. ** ** Parameters: ** c -- the character. ** s -- the string ** (sounds like an avant garde script) ** ** Returns: ** TRUE -- if c could be found in s. ** FALSE -- otherwise. ** ** Side Effects: ** none. ** ** Called By: ** prescan */ any(c, s) register char c; register char *s; { register char c2; while ((c2 = *s++) != '\0') if (c2 == c) return (TRUE); return (FALSE); } emory!!"); exit(EX_UNAVAILABLE); } return (p); } /* ** ANY -- Return TRUE if the character exists in the string. ** ** Parameters: ** c -- the character. ** s -- the string ** (sounds like an avant garde script) ** ** Returns: ** TRUE -- if c could be found in s. ** FALSE -- otherwise. ** ** Side Effects: ** none. ** ** Called By: ** prescan */ any(c, s) register char c; register char *s; { register char c2; while ((c2 = *s++) != 'cmd/delivermail/v6-mail.c 644 0 37 21712 2516353515 10546 # /* * mail command usage * mail [-yn] * prints your mail * mail people * sends standard input to people * * mail -r machine user people * sends mail from the network * * if NOTROOT is defined, don't run as root. */ #define SIGINT 2 #define DIRECT 040000 #define RMAILCMD "/usr/net/bin/sendmail" #define GETUID() (getuid() & 0377) #define SPOOLDIR "/usr/spool/mail/" #define NOTROOT $ struct inode { char minor; char major; int inumber; int flags; char nlinks; char uid; char gid; char size0; int size1; int addr[8]; int actime[2]; int modtime[2]; } inode; char lettmp[] "/tmp/maXXXXX"; char preptmp[] "/tmp/mbXXXXX"; int pwfil; int chew; int errs; char *strcat(), *strcpy(); main(argc, argv) char **argv; { register int me; extern int fout; int uf, delexit(); char namebuf[20]; mktemp(lettmp); mktemp(preptmp); unlink(lettmp); unlink(preptmp); me = GETUID(); if (getname(me, namebuf) < 0) { printf("Who are you?\n"); delexit(1); } if (argc < 2) goto hitit; for (argc--, argv++; argc > 0 && argv[0][0] == '-'; argc--, argv++) switch(argv[0][1]) { register char *cp, *np; case 'y': case 'n': argc++, argv--; hitit: printmail(argc, argv, namebuf); delexit(0); case 'r': if (argc < 2) continue; case 'f': if (argc < 1) continue; if (!equal("network", namebuf) && me != 0) { printf("Nice try!\n"); delexit(1); } chew++; np = namebuf; for (cp = argv[1]; *cp; cp++) *np++ = *cp; if (argv[0][1] == 'r') { argc--, argv++; *np++ = ':'; for (cp = argv[1]; *cp; cp++) *np++ = *cp; } *np++ = 0; argc--, argv++; continue; } if ((signal(SIGINT, 01) & 01) == 0) signal(SIGINT, delexit); unlink(lettmp); # ifdef NOTROOT fout = creat(lettmp, 0666); # else fout = creat(lettmp, 0600); # endif if (fout < 0) { fout = 1; perror(lettmp); delexit(1); } argc++, argv--; bulkmail(argc, argv, namebuf); delexit(0); } printmail(argc, argv, name) char **argv; char *name; { extern int fin, fout; register n, c, f; char *mname; mname = cat(SPOOLDIR, name); if (stat(mname, &inode)>=0 && inode.nlinks==1 && fopen(mname, &fin)>=0 && (c = getchar())) { putchar(c); getput(); close(fin); c = 'x'; if (argc<2) { if (ttyn(0)!='x') { printf("Save?"); fin = 0; c = getchar(); } } else c = argv[1][1]; if (!any(c, "yn")) delexit(0); if (c == 'y') { if (accesss("mbox")) { printf("Saved mail in 'mbox'\n"); prepend(mname, "mbox", GETUID()); unlink(mname); } else printf("In wrong directory\n"); } else unlink(mname); } else printf("No mail.\n"); } bulkmail(argc, argv, from) char **argv, *from; { extern int fin, fout; register int c; register char *cp; char linebuf[128]; int tbuf[2], ttyn1; fin = 0; (&fin)[1] = 0; time(tbuf); ttyn1 = ttyn(1); if (ttyn1 < 033) { ttyn1 =+ 'a' - 1; ttyn1 =<< 8; ttyn1 =| '^'; } printf("From %s tty%c %s", from, ttyn1, ctime(tbuf)); /* * If delivering mail from the network via mail -r, * Strip the l((eading line and throw it away, as long * as it begins with "From ..." */ if (chew) { cp = linebuf; do { c = getchar(); if (cp - linebuf < 120) *cp++ = c; } while (c != '\n' && c != 0); *cp = '\0'; if (linebuf[0] != 'F' || linebuf[1] != 'r' || linebuf[2] != 'o' || linebuf[3] != 'm') printf("%s", linebuf); } getput(); putchar('\n'); flush(); close(fout); while (--argc > 0) sendto(*++argv); delexit(errs); } sendto(person) char *person; { static int saved; extern int fout, fin; register char *filep; register int him; int i; if ((person[0] == 'i' || person[0] == 'I') && person[1] == ':') person += 2; for (i = 0; person[i] != '\0'; i++) { if (person[i] == ':') { person[i] = '\0'; if (equal(person, "ing70") || equal(person, "ingres")) person += i + 1; else person[i] = ':'; break; } } if (person[i] == ':' || equal(person, "msgs")) { int i = fork(); int s; if (i < 0) { perror("fork"); goto assback; } if (i == 0) { close(0); open(lettmp, 0); if (any(':', person)) { execl(RMAILCMD, "sendmail", person, 0); execl("/usr/bin/sendmail", "sendmail", person, 0); execl("/bin/sendmail", "sendmail", person, 0); perror("sendmail"); } else { execl("/usr/new/msgs", "msgs", "-s", 0); execl("/usr/ucb/msgs", "msgs", "-s", 0); execl("/usr/bin/msgs", "msgs", "-s", 0); } exit(12); } for (;;) { register int j = wait(&s); if (j == -1) goto assback; if (j == i) break; } if ((s & 0377) != 0 || (s >> 8) == 12) goto assback; return; } if ((him = getuserid(person)) == -1) { assback: fout = 1; flush(); printf("Can't send to %s.\n", person); errs++; if (ttyn(0)!='x' && saved==0) { saved++; if (accesss("dead.letter")) { printf("Letter saved in 'dead.letter'\n"); prepend(lettmp, "dead.letter", GETUID()); } else printf("In wrong directory\n"); } return; } filep = cat(SPOOLDIR, person); lock(filep); prepend(lettmp, filep, him); unlock(); } prepend(from, to, own) char *from, *to; { extern int fin, fout; register int sig; int statb[18]; if (stat(to, statb) >= 0 && (statb[2] & 060000) != 0) { write(2, "Exotic destination\n", 19); delexit(1); } unlink(preptmp); if (fcreat(preptmp, &fout) < 0) { fout = 1; perror("mail"); delexit(1); } chmod(preptmp, 0600); if (fopen(from, &fin) < 0) { close(fout); fout = 1; perror("mail"); unlink(preptmp); return(0); } getput(); close(fin); fopen(to, &fin); getput(); close(fin); flush(); close(fout); sig = signal(SIGINT, 01); unlink(to); if (fcreat(to, &fout) < 0) { unlink(preptmp); fout = 1; signal(SIGINT, sig); return(0); } # ifdef NOTROOT chmod(to, 0666); # else chmod(to, 0600); chown(to, own); # endif if(stat(to, &inode) < 0 || inode.nlinks != 1) { close(fout); fout = 1; unlink(preptmp); signal(SIGINT, sig); return(0); } if (fopen(preptmp, &fin) < 0) { fout = 1; perror("mail"); signal(SIGINT, sig); errs++; return(0); } getput(); flush(); close(fout); close(fin); fout = 1; signal(SIGINT, sig); return(1); } delexit(ex) { unlock(); unlink(lettmp); unlink(preptmp); exit(ex); } equal(as1, as2) { register char *s1, *s2; s1 = as1; s2 = as2; while (*s1++ == *s2) if (*s2++ == 0) return(1); return(0); } cat(ap1, ap2) char *ap1, *ap2; { register char *p1, *p2; static char fn[32]; p1 = ap1; p2 = fn; while (*p2++ = *p1++); p2--; p1 = ap2; while (*p2++ = *p1++); return(fn); } getput() { extern int errno; register c; while(c = getchar()) { errno = 0; putchar(c); if(errno) { perror("mail"); delexit(1); } } } accesss(s1) { if (access(".", 2) != -1 && (stat(s1, &inode)<0 || access(s1, 2)==0)) return(1); return(0); } any(c, str) char *str; { register char *f; f = str; while (*f) if (c == *f++) return(1); return(0); } char *maillock = ".lock"; /* Lock suffix for mailname */ char *lockname = "/usr/spool/mail/tmXXXXXX"; char locktmp[30]; /* Usable lock temporary */ char curlock[50]; /* Last used name of lock */ int locked; /* To note that we locked it */ /* * Lock the specified mail file by setting the file mailfile.lock. * We must, of course, be careful to unlink the lock file by a call * to unlock before we stop. The algorithm used here is to see if * the lock exists, and if it does, to check its modify time. If it * is older than 30 seconds, we assume error and set our own file. * Otherwise, we wait for 5 seconds and try again. */ lock(file) char *file; { register int f; long age; struct inode sbuf; long curtime; if (file == (char *) 0) { printf("Locked = %d\n", locked); return(0); } if (locked) return(0); strcpy(curlock, file); strcat(curlock, maillock); strcpy(locktmp, lockname); mktemp(locktmp); unlink(locktmp); for (;;) { f = lock1(locktmp, curlock); if (f == 0) { locked = 1; return(0); } if (stat(curlock, &sbuf) < 0) return(0); time(&curtime); age = * ((long *) sbuf.modtime); if (curtime < age + 30) { sleep(5); continue; } unlink(curlock); } } /* * Remove the mail lock, and note that we no longer * have it locked. */ unlock() { if (locked) unlink(curlock); locked = 0; } /* * Attempt to set the lock by creating the temporary file, * then doing a link/unlink. If it fails, return -1 else 0 */ lock1(tempfile, name) char tempfile[], name[]; { register int fd; fd = creat(tempfile, 0); if (fd < 0) return(-1); close(fd); if (link(tempfile, name) < 0) { unlink(tempfile); return(-1); } unlink(tempfile); return(0); } /* * Concatenate s2 on the end of s1. S1's space must be large enough. * Return s1. */ char * strcat(s1, s2) register char *s1, *s2; { register os1; os1 = s1; while (*s1++) ; *--s1; while (*s1++ = *s2++) ; return(os1); } /* * Copy string s2 to s1. s1 must be large enough. * return s1 */ char * strcpy(s1, s2) register char *s1, *s2; { register os1; os1 = s1; while (*s1++ = *s2++) ; return(os1); } name) < 0) { unlink(tempfile); return(-1); } unlcmd/delivermail/vax-mail.c 644 0 37 37117 2516353516 11020 #include #include #include #include #include #include #include #include #include #include static char SccsId[] = "@(#)mail.c 4.1 10/1/80"; #define DELIVERMAIL "/etc/delivermail" /*copylet flags */ /*remote mail, add rmtmsg */ #define REMOTE 1 /* zap header and trailing empty line */ #define ZAP 3 #define ORDINARY 2 #define FORWARD 4 #define LSIZE 256 #define MAXLET 300 /* maximum number of letters */ #define MAILMODE (~0644) /* mode of created mail */ # ifndef DELIVERMAIL #define RMAIL "/usr/net/bin/sendberkmail" #define LOCNAM1 "csvax" #define LOCNAM2 "ucbvax" #define LOCNAM3 "vax" #define LOCNAM4 "v" # endif char line[LSIZE]; char resp[LSIZE]; struct let { long adr; char change; } let[MAXLET]; int nlet = 0; char lfil[50]; long iop, time(); char *getenv(); char *index(); char lettmp[] = "/tmp/maXXXXX"; char maildir[] = "/usr/spool/mail/"; char mailfile[] = "/usr/spool/mail/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; char dead[] = "dead.letter"; char *thissys = sysname; char *netname = "vax"; char forwmsg[] = " forwarded\n"; FILE *tmpf; FILE *malf; char *my_name; char *getlogin(); struct passwd *getpwuid(); int error; int changed; int forward; char from[] = "From "; long ftell(); int delete(); char *ctime(); int flgf; int flgp; int delflg = 1; int hseqno; jmp_buf sjbuf; int rmail; main(argc, argv) char **argv; { register i; char sobuf[BUFSIZ]; setbuf(stdout, sobuf); mktemp(lettmp); unlink(lettmp); my_name = getlogin(); if (my_name == NULL || strlen(my_name) == 0) { struct passwd *pwent; pwent = getpwuid(getuid()); if (pwent==NULL) my_name = "???"; else my_name = pwent->pw_name; } if(setjmp(sjbuf)) done(); for (i=0; i<20; i++) setsig(i, delete); tmpf = fopen(lettmp, "w"); if (tmpf == NULL) { fprintf(stderr, "mail: cannot open %s for writing\n", lettmp); done(); } if (argv[0][0] == 'r') rmail++; if (argv[0][0] != 'r' && /* no favors for rmail*/ (argc == 1 || argv[1][0] == '-' && !any(argv[1][1], "rhd"))) printmail(argc, argv); else sendmail(argc, argv); done(); } setsig(i, f) int i; int (*f)(); { if(signal(i, SIG_IGN)!=SIG_IGN) signal(i, f); } 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); if (stat(mailfile, &statb) >= 0 && (statb.st_mode & S_IFMT) == S_IFDIR) { strcat(mailfile, "/"); strcat(mailfile, my_name); } for (; argc>1; argv++, argc--) { if (argv[1][0]=='-') { if (argv[1][1]=='q') delflg = 0; else if (argv[1][1]=='p') { flgp++; delflg = 0; } else if (argv[1][1]=='f') { if (argc>=3) { strcpy(mailfile, argv[2]); argv++; argc--; } } else if (argv[1][1]=='r') { forward = 1; } else if (argv[1][1]=='h') { forward = 1; } else { fprintf(stderr, "mail: unknown option %c\n", argv[1][1]); done(); } } else break; } malf = fopen(mailfile, "r"); if (malf == NULL) { fprintf(stdout, "No mail.\n"); return; } lock(mailfile); copymt(malf, tmpf); fclose(malf); fclose(tmpf); unlock(); tmpf = fopen(lettmp, "r"); changed = 0; print = 1; for (i = 0; i < nlet; ) { j = forward ? i : nlet - i - 1; if(setjmp(sjbuf)) { print=0; } else { if (print) copylet(j, stdout, ORDINARY); print = 1; } if (flgp) { i++; continue; } (( setjmp(sjbuf); fprintf(stdout, "? "); fflush(stdout); if (fgets(resp, LSIZE, stdin) == NULL) break; switch (resp[0]) { default: fprintf(stderr, "usage\n"); case '?': print = 0; fprintf(stderr, "q\tquit\n"); fprintf(stderr, "x\texit without changing mail\n"); fprintf(stderr, "p\tprint\n"); fprintf(stderr, "s[file]\tsave (default mbox)\n"); fprintf(stderr, "w[file]\tsame without header\n"); fprintf(stderr, "-\tprint previous\n"); fprintf(stderr, "d\tdelete\n"); fprintf(stderr, "+\tnext (no delete)\n"); fprintf(stderr, "m user\tmail to user\n"); fprintf(stderr, "! cmd\texecute cmd\n"); break; case '+': case 'n': case '\n': i++; break; case 'x': changed = 0; case 'q': goto donep; case 'p': break; case '^': case '-': if (--i < 0) i = 0; break; case 'y': case 'w': case 's': flg = 0; if (resp[1] != '\n' && resp[1] != ' ') { printf("illegal\n"); flg++; print = 0; continue; } if (resp[1] == '\n' || resp[1] == '\0') { 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) { fprintf(stdout, "mail: cannot append to %s\n", lfil); flg++; continue; } copylet(j, malf, resp[0]=='w'? ZAP: ORDINARY); fclose(malf); } if (flg) print = 0; else { let[j].change = 'd'; changed++; i++; } break; case 'm': flg = 0; if (resp[1] == '\n' || resp[1] == '\0') { i++; continue; } if (resp[1] != ' ') { printf("invalid command\n"); flg++; print = 0; continue; } for (p = resp+1; (p = getarg(lfil, p)) != NULL; ) if (!sendrmt(j, lfil, "/bin/mail")) /* couldn't send it */ flg++; if (flg) print = 0; else { let[j].change = 'd'; changed++; i++; } break; case '!': system(resp+1); printf("!\n"); print = 0; break; case 'd': let[j].change = 'd'; changed++; i++; if (resp[1] == 'q') goto donep; break; } } donep: if (changed) copyback(); } copyback() /* copy temp or whatever back to /usr/spool/mail */ { register i, n, c; int new = 0; struct stat stbuf; signal(SIGINT, SIG_IGN); signal(SIGHUP, SIG_IGN); signal(SIGQUIT, SIG_IGN); lock(mailfile); stat(mailfile, &stbuf); if (stbuf.st_size != let[nlet].adr) { /* new mail has arrived */ malf = fopen(mailfile, "r"); if (malf == NULL) { fprintf(stdout, "mail: can't re-read %s\n", mailfile); done(); } fseek(malf, let[nlet].adr, 0); fclose(tmpf); tmpf = fopen(lettmp, "a"); fseek(tmpf, let[nlet].adr, 0); while ((c = fgetc(malf)) != EOF) fputc(c, tmpf); fclose(malf); fclose(tmpf); tmpf = fopen(lettmp, "r"); let[++nlet].adr = stbuf.st_size; new = 1; } malf = fopen(mailfile, "w"); if (malf == NULL) { fprintf(stderr, "mail: can't rewrite %s\n", lfil); done(); } n = 0; for (i = 0; i < nlet; i++) if (let[i].change != 'd') { copylet(i, malf, ORDINARY); n++; } fclose(malf); if (new) fprintf(stdout, "new mail arrived\n"); unlock(); } copymt(f1, f2) /* copy mail (f1) to temp (f2) */ FILE *f1, *f2; { long nextadr; nlet = nextadr = 0; let[0].adr = 0; while (fgets(line, LSIZE, f1) != NULL) { if (isfrom(line)) let[nlet++].adr = nextadr; nextadr += strlen(line); fputs(line, f2); } let[nlet].adr = nextadr; /* last plus 1 */ } copylet(n, f, type) FILE *f; { int ch, k; fseek(tmpf, let[n].adr, 0); k = let[n+1].adr - let[n].adr; while(k-- > 1 && (ch=fgetc(tmpf))!='\n') if(type!=ZAP) fputc(ch,f); if(type==REMOTE) fprintf(f, " remote from %s\n", thissys); else if (type==FORWARD) fprintf(f, forwmsg); else if(type==ORDINARY) fputc(ch,f); while(k-->1) fputc(ch=fgetc(tmpf), f); if(type!=ZAP || ch!= '\n') fputc(fgetc(tmpf), f); } isfrom(lp) register char *lp; { register char *p; for (p = from; *p; ) if (*lp++ != *p++) return(0); return(1); } sendmail(argc, argv) char **argv; { char truename[100]; int first; register char *cp; int gaver = 0; # ifdef DELIVERMAIL char *newargv[1000]; register char **ap; register char **vp; int dflag; dflag = 0; if (argc < 1) fprintf(stderr, "puke\n"); for (vp = argv, ap = newargv + 1; (*ap = *vp++) != 0; ap++) { if (ap[0][0] == '-' && ap[0][1] == 'd') dflag++; } if (!dflag) { /* give it to delivermail, rah rah! */ unlink(lettmp); ap = newargv+1; if (rmail) *ap-- = "-s"; *ap = "-delivermail"; execv(DELIVERMAIL, ap); perror(DELIVERMAIL); exit(EX_UNAVAILABLE); } # endif DELIVERMAIL truename[0] = 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 <= 0) { usage(); done(); } gaver++; strcpy(truename, argv[1]); fgets(line, LSIZE, stdin); if (strcmpn("From", line, 4) == 0) line[0] = '\0'; argv++; argc--; break; case 'h': if (argc <= 0) { usage(); done(); } hseqno = atoi(argv[1]); argv++; argc--; break; # ifdef DELIVERMAIL case 'd': break; # endif DELIVERMAIL default: usage(); done(); } } if (argc <= 1) { usage(); done(); } if (gaver == 0) strcpy(truename, my_name); /* if (argc > 4 && strcmp(argv[1], "-r") == 0) { strcpy(truename, argv[2]); argc -= 2; argv += 2; fgets(line, LSIZE, stdin); if (strcmpn("From", line, 4) == 0) line[0] = '\0'; } else strcpy(truename, my_name); */ time(&iop); fprintf(tmpf, "%s%s %s", from, truename, ctime(&iop)); iop = ftell(tmpf); flgf = 1; for (first = 1;; first = 0) { if (first && line[0] == '\0' && fgets(line, LSIZE, stdin) == NULL) break; if (!first && fgets(line, LSIZE, stdin) == NULL) break; if (line[0] == '.' && line[1] == '\n' && isatty(fileno(stdin))) break; if (isfrom(line)) fputs(">", tmpf); fputs(line, tmpf); flgf = 0; } fputs("\n", tmpf); nlet = 1; let[0].adr = 0; let[1].adr = ftell(tmpf); fclose(tmpf); if (flgf) return; tmpf = fopen(lettmp, "r"); if (tmpf == NULL) { fprintf(stderr, "mail: cannot reopen %s for reading\n", lettmp); return; } while (--argc > 0) if (!send(0, *++argv, truename)) error++; if (error) { setuid(getuid()); malf = fopen(dead, "w"); if (malf == NULL) { fprintf(stdout, "mail: cannot open %s\n", dead); fclose(tmpf); return; } copylet(0, malf, ZAP); fclose(malf); fprintf(stdout, "Mail saved in %s\n", dead); } fclose(tmpf); } sendrmt(n, name, rcmd) char *name; char *rcmd; { FILE *rmf, *popen(); register char *p; char rsys[64], cmd[64]; register local, pid; int sts; local = 0; if (index(name, '^')) { while (p = index(name, '^')) *p = '!'; if (strncmp(name, "researc", 7)) { strcpy(rsys, "research"); if (*name != '!') --name; goto skip; } } if (*name=='!') name++; for(p=rsys; *name!='!'; *p++ = *name++) if (*name=='\0') { local++; break; } *p = '\0'; if ((!local && *name=='\0') || (local && *rsys=='\0')) { fprintf(stdout, "null name\n"); return(0); } 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 (local) sprintf(cmd, "%s %s", rcmd, rsys); else { if (index(name+1, '!')) sprintf(cmd, "uux - %s!rmail \\(%s\\)", rsys, name+1); else sprintf(cmd, "uux - %s!rmail %s", rsys, name+1); } if ((rmf=popen(cmd, "w")) == NULL) exit(1); copylet(n, rmf, local ? !strcmp(rcmd, "/bin/mail") ? FORWARD : ORDINARY : REMOTE); pclose(rmf); exit(0); } # ifndef DELIVERMAIL /* * Send mail on the Berkeley network. * Sorry Bill, sendrmt() is so awful we just gave up. */ sendberkmail(n, name, fromaddr) char name[]; char fromaddr[]; { char cmd[200]; register FILE *cmdf; sprintf(cmd, "%s -h %d -f %s -t %s", RMAIL, hseqno, fromaddr, name); if ((cmdf = popen(cmd, "w")) == NULL) { perror(RMAIL); return(0); } copylet(n, cmdf, ORDINARY); pclose(cmdf); return(9); } # endif usage() { fprintf(stderr, "Usage: mail [ -f ] people . . .\n"); } send(n, name, fromaddr) int n; char *name; char *fromaddr; { char file[100]; register char *p; register mask; struct passwd *pw, *getpwnam(); struct stat statb; # ifndef DELIVERMAIL stripfx(LOCNAM1, &name); stripfx(LOCNAM2, &name); stripfx(LOCNAM3, &name); stripfx(LOCNAM4, &name); if(*name == ':')name++; /* skip colon in to-name */ for(p=name; *p!=':' && *p!='!' && *p!='^' &&*p!='\0'; p++); /* if(*p == ':') return(sendrmt(n, name, RMAIL)); */ if (*p == ':') return(sendberkmail(n, name, fromaddr)); else if (*p=='\0' && strcmp(name, "msgs") == 0) return(sendrmt(n, "-s", "/usr/ucb/msgs")); # endif for(p=name; *p!='!'&&*p!='^' &&*p!='\0'; p++) ; if (*p == '!'|| *p=='^') return(sendrmt(n, name, 0)); if ((pw = getpwnam(name)) == NULL) { fprintf(stdout, "mail: can't send to %s\n", name); return(0); } cat(file, maildir, name); if (stat(file, &statb) >= 0 && (statb.st_mode & S_IFMT) == S_IFDIR) { strcat(file, "/"); strcat(file, name); } mask = umask(MAILMODE); malf = fopen(file, "a"); umask(mask); if (malf == NULL) { fprintf(stdout, "mail: cannot append to %s\n", file); return(0); } lock(file); chown(file, pw->pw_uid, pw->pw_gid); copylet(n, malf, ORDINARY); fclose(malf); unlock(); return(1); } delete(i) { setsig(i, delete); fprintf(stderr, "\n"); if(delflg) longjmp(sjbuf, 1); done(); } /* * Lock the specified mail file by setting the file mailfile.lock. * We must, of course, be careful to unlink the lock file by a call * to unlock before we stop. The algorithm used here is to see if * the lock exists, and if it does, to check its modify time. If it * is older than 30 seconds, we assume error and set our own file. * Otherwise, we wait for 5 seconds and try again. */ char *maillock = ".lock"; /* Lock suffix for mailname */ char *lockname = "/usr/spool/mail/tmXXXXX((X"; char locktmp[30]; /* Usable lock temporary */ char curlock[50]; /* Last used name of lock */ int locked; /* To note that we locked it */ lock(file) char *file; { register int f; struct stat sbuf; long curtime; int statfailed; if (locked || flgf) return(0); strcpy(curlock, file); strcat(curlock, maillock); strcpy(locktmp, lockname); mktemp(locktmp); unlink(locktmp); statfailed = 0; for (;;) { f = lock1(locktmp, curlock); if (f == 0) { locked = 1; return(0); } if (stat(curlock, &sbuf) < 0) { if (statfailed++ > 5) return(-1); sleep(5); continue; } statfailed = 0; time(&curtime); if (curtime < sbuf.st_ctime + 30) { sleep(5); continue; } unlink(curlock); } } /* * Remove the mail lock, and note that we no longer * have it locked. */ unlock() { unlink(curlock); locked = 0; } /* * Attempt to set the lock by creating the temporary file, * then doing a link/unlink. If it fails, return -1 else 0 */ lock1(tempfile, name) char tempfile[], name[]; { register int fd; fd = creat(tempfile, 0); if (fd < 0) return(-1); close(fd); if (link(tempfile, name) < 0) { unlink(tempfile); return(-1); } unlink(tempfile); return(0); } done() { if(locked) unlock(); unlink(lettmp); unlink(locktmp); exit(error); } cat(to, from1, from2) char *to, *from1, *from2; { int i, j; j = 0; for (i=0; from1[i]; i++) to[j++] = from1[i]; for (i=0; from2[i]; i++) to[j++] = from2[i]; to[j] = 0; } char *getarg(s, p) /* copy p... into s, update p */ register char *s, *p; { while (*p == ' ' || *p == '\t') p++; if (*p == '\n' || *p == '\0') return(NULL); while (*p != ' ' && *p != '\t' && *p != '\n' && *p != '\0') *s++ = *p++; *s = '\0'; return(p); } # ifndef DELIVERMAIL /* stripfx(prefix string, pointer to string) takes a ptr to string and compares it to prefix string. may be called multiple times */ stripfx(pfx, name) char *pfx; char **name; { register char *cp = *name; while (*pfx && (*cp == *pfx || *cp == toupper(*pfx))) cp++, pfx++; if (*cp != ':' || *pfx != 0) return; *name = cp; } # endif (*p == '\n' || *p == '\0') return(NULL); while (*p != ' ' && *p != '\t' && *p != '\n' && *p != '\0') *s++ = *p++; *s = '\0'; return(p); } # ifndef DELIVERMAIL /* stripfx(prefix string, pointer to string) takes a ptr to string and compares it to prefix string. may be called multiple times */ stripfx(pfx, name) char *pfx; char **name; { register char *cp = *name; while (*pfx && (*cp == *pfx || *cp == toupper(*pfx)))cmd/delivermail/version.c 644 0 37 72 2516353517 10676 char Version[] = "@(#)Delivermail version 2.7 of 2/5/81"; name = cp; } # endif (*p == '\n' || *p == '\0') return(NULL); while (*p != ' ' && *p != '\t' && *p != '\n' && *p != '\0') *s++ = *p++; *s = '\0'; return(p); } # ifndef DELIVERMAIL /* stripfx(prefix string, pointer to string) takes a ptr to string and compares it to prefix string. may be called multiple times */ stripfx(pfx, name) char *pfx; char */,5x< /,"cmd/expr.y 444 0 33 25242 2502722273 5772 /* 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 i; if(ematch(r1, "-*[0-9]*$") && ematch(r2, "[0-9]*$")) i = atol(r1) - atol(r2); else i = strcmp(r1, r2); switch(op) { case EQ: i = i==0; break; case GT: i = i>0; break; case GEQ: i = i>=0; break; case LT: i = i<0; break; case LEQ: i = i<=0; break; case NEQ: i = i!=0; break; } return i? "1": "0"; } char *arith(op, r1, r2) char *r1, *r2; { long i1, i2; register char *rv; if(!(ematch(r1, "[0-9]*$") && ematch(r2, "[0-9]*$"))) yyerror("non-numeric argument"); i1 = atol(r1); i2 = atol(r2); switch(op) { case ADD: i1 = i1 + i2; break; case SUBT: i1 = i1 - i2; break; case MULT: i1 = i1 * i2; break; case DIV: i1 = i1 / i2; break; case REM: i1 = i1 % i2; break; } rv = malloc(16); sprintf(rv, "%D", i1); return rv; } char *conj(op, r1, r2) char *r1, *r2; { register char *rv; switch(op) { case OR: if(EQL(r1, "0") || EQL(r1, "")) if(EQL(r2, "0") || EQL(r2, "")) rv = "0"; else rv = r2; else rv = r1; break; case AND: if(EQL(r1, "0") || EQL(r1, "")) rv = "0"; else if(EQL(r2, "0") || EQL(r2, "")) rv = "0"; else rv = r1; break; } return rv; } char *substr(v, s, w) char *v, *s, *w; { register si, wi; register char *res; si = atol(s); wi = atol(w); while(--si) if(*v) ++v; res = v; while(wi--) if(*v) ++v; *v = '\0'; return res; } char *length(s) register char *s; { register i = 0; register char *rv; while(*s++) ++i; rv = malloc(8); sprintf(rv, "%d", i); return rv; } char *index(s, t) char *s, *t; { register i, j; register char *rv; for(i = 0; s[i] ; ++i) for(j = 0; t[j] ; ++j) if(s[i]==t[j]) { sprintf(rv = malloc(8), "%d", ++i); return rv; } return "0"; } char *match(s, p) { register char *rv; sprintf(rv = malloc(8), "%d", ematch(s, p)); if(nbra) { rv = malloc(strlen(Mstring[0])+1); strcpy(rv, Mstring[0]); } return rv; } #define INIT register char *sp = instring; #define GETC() (*sp++) #define PEEKC() (*sp) #define UNGETC(c) (--sp) #define RETURN(c) return #define ERROR(c) errxx(c) ematch(s, p) char *s; register char *p; { static char expbuf[ESIZE]; char *compile(); register num; extern char *braslist[], *braelist[], *loc2; compile(p, expbuf, &expbuf[512], 0); if(nbra > 1) yyerror("Too many '\\('s"); if(advance(s, expbuf)) { if(nbra == 1) { p = braslist[0]; num = braelist[0] - p; strncpy(Mstring[0], p, num); Mstring[0][num] = '\0'; } return(loc2-s); } return(0); } errxx(c) { yyerror("RE error"); } #define CBRA 2 #define CCHR 4 #define CDOT 8 #define CCL 12 #define CDOL 20 #define CEOF 22 #define CKET 24 #define CBACK 36 #define STAR 01 #define RNGE 03 #define NBRA 9 #define PLACE(c) ep[c >> 3] |= bittab[c & 07] #define ISTHERE(c) (ep[c >> 3] & bittab[c & 07]) char *braslist[NBRA]; char *braelist[NBRA]; int nbra; char *loc1, *loc2, *locs; int sed; int circf; int low; int size; char bittab[] = { 1, 2, 4, 8, 16, 32, 64, 128 }; char * compile(instring, ep, endbuf, seof) register char *ep; char *instring, *endbuf; { INIT /* Dependent declarations and initializations */ register c; register eof = seof; char *lastep = instring; int cclcnt; char bracket[NBRA], *bracketp; int closed; char neg; int lc; int i, cflg; lastep = 0; if((c = GETC()) == eof) { if(*ep == 0 && !sed) ERROR(41); RETURN(ep); } bracketp = bracket; circf = closed = nbra = 0; if (c == '^') circf++; else UNGETC(c); for (;;) { if (ep >= endbuf) ERROR(50); if((c = GETC()) != '*' && ((c != '\\') || (PEEKC() != '{'))) lastep = ep; if (c == eof) { *ep++ = CEOF; RETURN(ep); } switch (c) { case '.': *ep++ = CDOT; continue; case '\n': ERROR(36); case '*': if (lastep==0 || *lastep==CBRA || *lastep==CKET) goto defchar; *lastep |= STAR; continue; case '$': if(PEEK((C() != 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.2 (Berkeley) 3/9/81"; yyerror(s) { fprintf(stderr, "%s\n", s); exit(2); } = 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(countcmd/vipw.sh 744 0 33 333 2424113377 6102 cp /dev/null /etc/vipw.lock chmod 0 /etc/vipw.lock ln /etc/vipw.lock /etc/ptmp > /dev/null 2>& 1 case $? in 0) trap '' 1 2 3 15 vi /etc/passwd rm /etc/ptmp ;; *) echo Temporary file busy, try again later. ;; esac } 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; regist/( ,( 5< /\@,\D"cmd/msgs/ 775 0 33 0 2552554727 5501 cmd/msgs/msgs.c 644 0 33 32775 2364534370 6730 /* * msgs - a user bulletin board program * * usage: * msgs [fhlopq] [[-]number] to read messages * msgs -s to place messages * msgs -c [-days] to clean up the bulletin board * * prompt commands are: * y print message * n flush message, go to next message * q flush message, quit * p print message, turn on 'pipe thru more' mode * P print message, turn off 'pipe thru more' mode * - reprint last message * s[-][] [] save message * m[-][] mail with message in temp mbox * x exit without flushing this message */ #define V7 /* will look for TERM in the environment */ #define OBJECT /* will object to messages without Subjects */ /* #define REJECT /* will reject messages without Subjects (OBJECT must be defined also) */ /* #define UNBUFFERED /* use unbuffered output */ #include #include #include #include #include #include #include #include #include "msgs.h" #define CMODE 0666 /* bounds file creation mode */ #define NO 0 #define YES 1 #define SUPERUSER 0 /* superuser uid */ #define DAEMON 1 /* daemon uid */ #define NLINES 24 /* default number of lines/crt screen */ #define NDAYS 21 /* default keep time for messages */ #define DAYS *24*60*60 /* seconds/day */ #define TEMP "/tmp/msgXXXXXX" #define MSGSRC ".msgsrc" /* user's rc file */ #define BOUNDS "bounds" /* message bounds file */ #define NEXT "Next message? [yq]" #define MORE "More? [ynq]" #define NOMORE "(No more) [q] ?" typedef char bool; FILE *newmsg; char *sep = "-"; char inbuf[BUFSIZ]; char fname[128]; char cmdbuf[128]; char subj[128]; char from[128]; char date[128]; char *ptr; char *in; bool local; bool ruptible; bool totty; bool seenfrom; bool seensubj; bool blankline; bool printing = NO; bool mailing = NO; bool quitit = NO; bool sending = NO; bool intrpflg = NO; int uid; int msg; int prevmsg; int lct; int nlines; int Lpp = NLINES; time_t t; time_t keep; struct sgttyb otty; char *ctime(); char *nxtfld(); int onintr(); off_t ftell(); FILE *popen(); struct passwd *getpwuid(); extern int errno; /* option initialization */ bool hdrs = NO; bool qopt = NO; bool hush = NO; bool send = NO; bool locomode = NO; bool pause = NO; bool clean = NO; bool lastcmd = NO; main(argc, argv) int argc; char *argv[]; { bool newrc, already; int rcfirst = 0; /* first message to print (from .rc) */ int rcback = 0; /* amount to back off of rcfirst*/ int firstmsg, nextmsg, lastmsg = 0; int blast = 0; FILE *bounds, *msgsrc; #ifndef UNBUFFERED char obuf[BUFSIZ]; setbuf(stdout, obuf); #else setbuf(stdout, NULL); #endif gtty(fileno(stdout), &otty); time(&t); setuid(uid = getuid()); ruptible = (signal(SIGINT, SIG_IGN) == SIG_DFL); if (ruptible) signal(SIGINT, SIG_DFL); argc--, argv++; while (argc > 0) { if (isdigit(argv[0][0])) { /* starting message # */ rcfirst = atoi(argv[0]); } else if (isdigit(argv[0][1])) { /* backward offset */ rcback = atoi( &( argv[0][1] ) ); } else { ptr = *argv; while (*ptr) switch(( (*ptr++) { case '-': break; case 'c': if (uid != SUPERUSER && uid != DAEMON) { fprintf(stderr, "Sorry\n"); exit(1); } clean = YES; break; case 'f': /* silently */ hush = YES; break; case 'h': /* headers only */ hdrs = YES; break; case 'l': /* local msgs only */ locomode = YES; break; case 'o': /* option to save last message */ lastcmd = YES; break; case 'p': /* pipe thru 'more' during long msgs */ pause = YES; break; case 'q': /* query only */ qopt = YES; break; case 's': /* sending TO msgs */ send = YES; break; default: fprintf(stderr, "usage: msgs [fhlopq] [[-]number]\n"); exit(1); } } argc--, argv++; } /* * determine current message bounds */ sprintf(fname, "%s/%s", USRMSGS, BOUNDS); bounds = fopen(fname, "r"); if (bounds != NULL) { fscanf(bounds, "%d %d\n", &firstmsg, &lastmsg); fclose(bounds); blast = lastmsg; /* save upper bound */ } if (clean) keep = t - (rcback? rcback : NDAYS) DAYS; if (clean || bounds == NULL) { /* relocate message bounds */ struct direct dirent; struct stat stbuf; bool seenany = NO; FILE *d = fopen(USRMSGS, "r"); if (d == NULL) { perror(USRMSGS); exit(errno); } firstmsg = 32767; lastmsg = 0; while (fread(&dirent, sizeof dirent, 1, d) == 1) { register char *cp = dirent.d_name; register int i = 0; if (dirent.d_ino == 0) continue; if (clean) sprintf(inbuf, "%s/%s", USRMSGS, cp); while (isdigit(*cp)) i = i * 10 + *cp++ - '0'; if (*cp) continue; /* not a message! */ if (clean) { if (stat(inbuf, &stbuf) != 0) continue; if (stbuf.st_mtime < keep && stbuf.st_mode&S_IWRITE) { unlink(inbuf); continue; } } if (i > lastmsg) lastmsg = i; if (i < firstmsg) firstmsg = i; seenany = YES; } fclose(d); if (!seenany) { if (blast != 0) /* never lower the upper bound! */ lastmsg = blast; firstmsg = lastmsg + 1; } else if (blast > lastmsg) lastmsg = blast; if (!send) { bounds = fopen(fname, "w"); if (bounds == NULL) { perror(fname); exit(errno); } chmod(fname, CMODE); fprintf(bounds, "%d %d\n", firstmsg, lastmsg); fclose(bounds); } } if (send) { /* * Send mode - place msgs in USRMSGS */ bounds = fopen(fname, "w"); if (bounds == NULL) { perror(fname); exit(errno); } nextmsg = lastmsg + 1; sprintf(fname, "%s/%d", USRMSGS, nextmsg); newmsg = fopen(fname, "w"); if (newmsg == NULL) { perror(fname); exit(errno); } chmod(fname, 0644); fprintf(bounds, "%d %d\n", firstmsg, nextmsg); fclose(bounds); sending = YES; if (ruptible) signal(SIGINT, onintr); if (isatty(fileno(stdin))) { ptr = getpwuid(uid)->pw_name; printf("Message %d:\nFrom %s %sSubject: ", nextmsg, ptr, ctime(&t)); fflush(stdout); fgets(inbuf, sizeof inbuf, stdin); putchar('\n'); fflush(stdout); fprintf(newmsg, "From %s %sSubject: %s\n", ptr, ctime(&t), inbuf); blankline = seensubj = YES; } else blankline = seensubj = NO; for (;;) { fgets(inbuf, sizeof inbuf, stdin); if (feof(stdin) || ferror(stdin)) break; blankline = (blankline || (inbuf[0] == '\n')); seensubj = (seensubj || (!blankline && (strncmp(inbuf, "Subj", 4) == 0))); fputs(inbuf, newmsg); } #ifdef OBJECT if (!seensubj) { printf("NOTICE: Messages should have a Subject field!\n"); #ifdef REJECT unlink(fname); #endif exit(1); } #endif exit(ferror(stdin)); } if (clean) exit(0); /* * prepare to display messages */ totty = (isatty(fileno(stdout)) != 0); pause = pause && totty; sprintf(fname, "%s/%s", getenv("HOME"), MSGSRC); msgsrc = fopen(fname, "r"); if (msgsrc) { newrc = NO; fscanf(msgsrc, "%d\n", &nextmsg); fclose(msgsrc); if (!rcfirst) rcfirst = nextmsg - rcback; } else { newrc = YES; nextmsg = 0; } msgsrc = fopen(fname, "a"); if (msgsrc == NULL) { perror(fname); exit(errno); } if (rcfirst) firstmsg = rcfirst; if (newrc) { nextmsg = firstmsg; fseek(msgsrc, 0L, 0); fprintf(msgsrc, "%d\n", nextmsg); fflush(msgsrc); } #ifdef V7 if (totty) { if (tgetent(inbuf, getenv("TERM")) <= 0 || (Lpp = tgetnum("li")) <= 0) { Lpp = NLINES; } } #endif Lpp -= 6; /* for headers, etc. */ already = NO; prevmsg = firstmsg; printing = YES; if (ruptible) signal(SIGINT, onintr); /* * Main program loop */ for (msg = firstmsg; msg <= lastmsg; msg++) { sprintf(fname, "%s/%d", USRMSGS, msg); newmsg = fopen(fname, "r"); if (newmsg == NULL) continue; gfrsub(newmsg); /* get From and Subject fields */ if (locomode && !local) { fclose(newmsg); continue; } if (qopt) { /* This has to be located here */ printf("There are new messages.\n"); exit(0); } if (already && !hdrs) putchar('\n'); already = YES; /* * Print header */ nlines = 2; if (seenfrom) { printf("Message %d:\nFrom %s %s", msg, from, date); nlines++; } if (seensubj) { printf("Subject: %s", subj); nlines++; } else { if (seenfrom) { putchar('\n'); nlines++; } while (nlines < 6 && fgets(inbuf, sizeof inbuf, newmsg) && inbuf[0] != '\n') { fputs(inbuf, stdout); nlines++; } } lct = linecnt(newmsg); if (lct) printf("(%d%slines) ", lct, seensubj? " " : " more "); if (hdrs) { printf("\n-----\n"); fclose(newmsg); continue; } /* * Ask user for command */ if (totty) ask(lct? MORE : (msg==lastmsg? NOMORE : NEXT)); else inbuf[0] = 'y'; cmnd: in = inbuf; switch (*in) { case 'x': case 'X': exit(0); case 'q': case 'Q': quitit = YES; printf("--Postponed--\n"); exit(0); /* intentional fall-thru */ case 'n': case 'N': if (msg >= nextmsg) sep = "Flushed"; break; case 'p': case 'P': pause = (*in++ == 'p'); /* intentional fallthru */ case '\n': case 'y': default: if (*in == '-') { msg = prevmsg-1; sep = "replay"; break; } if (isdigit(*in)) { msg = next(in); sep = in; break; } prmesg(nlines + lct + (seensubj? 1 : 0)); prevmsg = msg; } printf("--%s--\n", sep); sep = "-"; if (msg >= nextmsg) { nextmsg = msg + 1; fseek(msgsrc, 0L, 0); fprintf(msgsrc, "%d\n", nextmsg); fflush(msgsrc); } if (newmsg) fclose(newmsg); if (quitit) break; } if (already && !quitit && lastcmd && totty) { /* * save or reply to last message? */ msg = prevmsg; ask(NOMORE); if (inbuf[0] == '-' || isdigit(inbuf[0])) goto cmnd; } if (!(already || hush || qopt)) printf("No new messages.\n"); exit(0); } prmesg(length) int length; { FILE *outf, *inf; int c; if (pause && length > Lpp) { sprintf(cmdbuf, PAGE, Lpp); outf = popen(cmdbuf, "w"); if (!outf) outf = stdout; else setbuf(outf, NULL); } else outf = stdout; if (seensubj) putc('\n', outf); while (fgets(inbuf, sizeof inbuf, newmsg)) fputs(inbuf, outf); if (outf != stdout) { pclose(outf); } else { fflush(stdout); } /* trick to force wait on output */ stty(fileno(stdout), &otty); } onintr() { signal(SIGINT, onintr); if (mailing) unlink(fname); if (sending) { unlink(fname); puts("--Killed--"); exit(1); } if (printing) { putchar('\n'); if (hdrs) exit(0); sep = "Interrupt"; if (newmsg) fseek(newmsg, 0L, 2); intrpflg = YES; } } linecnt(f) FILE *f; { off_t oldpos = ftell(f); int l = 0; char lbuf[BUFSIZ]; while (fgets(lbuf, sizeof lbuf, f)) l++; clearerr(f); fseek(f, oldpos, 0); return (l); } next(buf) char *buf; { int i; sscanf(buf, "%d", &i); sprintf(buf, "Goto %d", i); return(--i); } ask(prompt) char *prompt; { char inch; int n, cmsg; off_t oldpos; FILE *cpfrom, *cpto; printf("%s ", prompt); fflush(stdout); intrpflg = NO; gets(inbuf); if (intrpflg) inbuf[0] = 'x'; /* * Handle 'mail' and 'save' here. */ if ((inch = inbuf[0]) == 's' || inch == 'm') { if (inbuf[1] == '-') cmsg = prevmsg; else if (isdigit(inbuf[1])) cmsg = atoi(&inbuf[1]); else cmsg = msg; sprintf(fname, "%s/%d", USRMSGS, cmsg); oldpos = ftell(newmsg); cpfrom = fopen(fname, "r"); if (!cpfrom) { printf("Message %d not found\n", cmsg); ask (prompt); return; } if (inch == 's') { in = nxtfld(inbuf); if (*in) { for (n=0; in[n] > ' '; n++) { /* sizeof fname? */ fname[n] = in[n]; } fname[n] = NULL; } else strcpy(fname, "Messages"); } else { strcpy(fname, TEMP); mktemp(fname); sprintf(cmdbuf, MAIL, fname); mailing = YES; } cpto = fopen(fname, "a"); if (!cpto) { perror(fname); mailing = NO; fseek(newmsg, oldpos, 0); ask(prompt); return; } while (n = fread(inbuf, 1, sizeof inbuf, cpfrom)) fwrite(inbuf, 1, n, cpto); fclose(cpfrom); fclose(cpto); fseek(newmsg, oldpos, 0); /* reposition current message */ if (inch == 's') printf("Message %d saved in \"%s\"\n", cmsg, fname); else { system(cmdbuf); unlink(fname); mailing = NO; } ask(prompt); } } gfrsub(infile) FILE *infile; { off_t frompos; seensubj = seenfrom = NO; local = YES; subj[0] = from[0] = date[0] = NULL; /* * Is this a normal message? */ if (fgets(inbuf, sizeof inbuf, infile)) { if (strncmp(inbuf, "From", 4)==0) { /* * expected form starts with From */ seenfrom = YES; frompos = ftell(infile); ptr = from; in = nxtfld(inbuf); if (*in) while (*in && *in > ' ') { if (*in == ':') local = NO; *ptr++ = *in++; /* what about sizeof from ? */ } *ptr = NULL; if (*(in = nxtfld(in))) strncpy(date, in, sizeof date); else { date[0] = '\n'; date[1] = NULL; } } else { /* * not the expected form */ fseek(infile, 0L, 0); return; } } else /* * empty file ? */ return; /* * look for Subject line until EOF or a blank line */ while (fgets(inbuf, sizeof inbuf, infile) && !(blankline = (inbuf[0] == '\n'))) { /* * extract Subject line */ if(( (!seensubj && strncmp(inbuf, "Subj", 4)==0) { seensubj = YES; frompos = ftell(infile); strncpy(subj, nxtfld(inbuf), sizeof subj); } } if (!blankline) /* * ran into EOF */ fseek(infile, frompos, 0); if (!seensubj) /* * for possible use with Mail */ strncpy(subj, "(No Subject)\n", sizeof subj); } char * nxtfld(s) char *s; { if (*s) while (*s && *s > ' ') s++; /* skip over this field */ if (*s) while (*s && *s <= ' ') s++; /* find start of next field */ return (s); } ifcmd/msgs/msgs.h 644 0 33 336 2341634317 6656 /* * Local definitions for msgs. */ #define USRMSGS "/usr/msgs" /* msgs directory */ #define MAIL "/usr/ucb/Mail -f %s" /* could set destination also */ #define PAGE "/usr/ucb/more -%d" /* crt screen paging program */ if (!seensubj) /* * for possible use with Mail */ strncpy(subj, "(No Subject)\n", sizeof subj); } char * nxtfld(s) char *s; { if (*s) while (*s && *s > ' ') s++; /* skip over this fiel/,5h< /,"cmd/msgs/Makefile 644 0 33 206 2413330424 7160 CFLAGS=-O msgs: msgs.c msgs.h cc $(CFLAGS) -o msgs msgs.c -ltermlib install: install -s msgs ${DESTDIR}/usr/ucb clean: -rm -f msgs et destination also */ #define PAGE "/usr/ucb/more -%d" /* crt screen paging program */ if (!seensubj) /* * for possible use with Mail */ strncpy(subj, "(No Subject)\n", sizeof subj); } char * nxtfld(s) char *s; { if (*s) while (*s && *s > ' ') s++; /* skip over this fiel/,5x< /,"cmd/apl/ 775 0 33 0 2552517770 5301 cmd/apl/documents/ 775 0 33 0 2527315122 7267 cmd/apl/documents/APL_MODS 644 0 33 6102 2233425625 10536 Modifications to APL- April, May 1978 UCSF H. Ross Harvey. FILE DATE DESCRIPTION ---- ---- ----------- a9.c 24-Apr-78 Added I-beam 22: Workspace available (free) in bytes. Added I-beam 32: Escape to /bin/sh. apl.h 27-Apr-78 Added control statements for conditional a1.c compilation of debug code. Defining ai.c `FULLD', or `SHORTD' will include two aw.c levels of debugging information. The default level is none at all. Do not define both FULLD and SHORTD. a1.c 29-Apr-78 Execute() now references the opnames[] table (FULLD version only) to make the debugging information somewhat less cryptic. a0.c 2-May-78 Dealloc() now de-allocates variables of type `EL'. This solves some of the ws memory management problems. a0.c 3-May-78 Aplmod() now preserves the ttymode bits (still sets TECO, though). It was previously very presumptious, turning tabs off, even parity on (!), etc. apl.y 11-May-78 Code for labels complete! The lexical ai.c analyzer (yylex()+getnam()) and the lex.c control routine for function compiles (funcomp()) now collaborate and return the line number (lexical value `numb') whenever a label identifier is encountered. An (new) initial pass picks out labels `manually' and links them into a list of structures which are searched by getnam(). This list is discarded when the function compile is complete. aj.c 11-May-78 Replaced `&end' with `memstart' in clear(). Memstart is set by sbrk(0) at the beginning of main(). This was necessary to allow independant calls to sbrk(), spec., in the profiler. ah.c 16-May-78 Added a command `)SYMBOLS' which prints apl.h the namelist and item tables. This command tab.c is valid for SHORTD or FULLD versions only (see mods of 27-Apr-78). ad.c 16-May-78 Modified comk() so vector/scaler will work if the vector has one element. This is usually allowed elsewhere in this and other apl's. aj.c 18-May-78 Wsload() and wssave() now buffer all I/O operations; this cuts )LOAD and )SAVE times by a factor of four (much more on busy systems). Several error messages changed. apl.h 23-May-78 The internal stack is now allocated apl.s (new) dynamically. All but one stack push a0.c operations are handled as calls to the a1.c (case NAME) machine-coded routine 'push()'. If aj.c the operation results in an internal an.c stack overflow, a new and larger stack is allocated, the old stack copied over and then freed. This mod actually affects almost every file because each '*sp++=expr' was changed to 'push(expr)'. ai.c 23-May-78 Added insuate() and code to ex_fun() to fetch function arguments before the function is executed. This was necessary to eliminate interactions between formal and actual paramenters. Previously, a recursive subroutine which interchanged its arguments between calls would clobber its own actual parameters. a0.c 25-May-78 More I beams. Added the file access a9.c system and a shell I beam. apl.h file because each '*sp++=expr' was changed to 'push(expr)'. ai.c 23-May-78 Added insuate() and code to ex_fun() to fetch function arguments before the function is executed. This was necessary to eliminate interactions between formal and actual paramenters. Previously, a recursive subroutine which interchanged its arguments between calls would clobber its own actual parameters. a0.c 25-May-78 More I beamcmd/apl/documents/I-beams 644 0 33 1170 2233425642 10554 New I-beams: 1I'file name' -Switch input to 'file name'. 1I0 -Switch input back to the terminal. 2I'file name' -Switch output to 'file name'. 2I0 -Switch output back to the terminal. 3I'file name' -Switch output to 'file name'. If the file exists, append to it. 3I0 -Switch output back to the terminal. 10I 'UNIX command' -Execute the command as if it were typed in to UNIX. In the above examples, the zero could have also been a null vector. Example: If OUTPUTFILE is a character vector which contains a file name, the file could be printed by the command: 10I'pr -l64 ',OUTPUTFILE,' | opr -lp' -Switch output to 'file name'. 2I0 -Switch output back to the terminal. 3I'file name' -Switch output to 'file name'. If the file exists, append to it. 3I0 -Switch output back to the terminal. 10I 'UNIX command' -Execute the command as if it were typed in to UNIX. In the above examples, the zero could have also been a null vector. Example: If OUTPUTFILE is a charactcmd/apl/documents/apl.1 644 0 33 3247 2233425662 10223 .th APL I 7/10/78 .sh NAME apl \*- The UCSF APL interpreter .sh SYNOPSIS .bd apl .sh DESCRIPTION The UCSF APL interpreter contains all the APL 360 operators plus execute (epsilon), scan, and relational character operators. The maximum workspace size is about 50,000 bytes. .s3 Function definition is not what you would expect. Functions are created and modified with the system editor. Type `)EDIT fname' or `)EX fname' to creat or modify a function. Type `)READ fname' if it exists and doesn't need editing. .((s3 The following I-beams are recognized by APL: .in +.6i .s3 1iF Open F for reading. .s3 2iF Create F for writing. .s3 3iF Append to F. .s3 1i0, 2i0, 3i0 Close the named channel. .in .s3 Only one read channel and one write channel may be open simultaneously. When a file is open for reading, references to the quad or quote-quad variable are actually references to the named file. When open for writing, assignments to the quad variable are written to the file. .s3 .in +.6i 10iC Send command C to the shell. .in The command will be executed as if it were typed at a UNIX terminal. This is equivalent to the `!' feature of the editor. .s3 Monadic I-beam functions are: 20 for the time of day, 21 to return CPU time used, 22 to return WS free in bytes, 24 to return the starting time, 25 to return the date, 28 to return the starting date, 29 to read the index origin, 30 to read the terminal width, 31 to read the printing precision (or `digits'), and 32 to run the shell. .sh BUGS No trace function or state indicator. .s3 No `)WSID' command. The existing system commands take only one argument. .s3 A `)WRITE fname' command is needed to get at functions which exist only in workspaces. the time of day, 21 to return CPU time used, 22 to return WS free in bytes, 24 to return the starting time, 25 to return the date, 28 to return the starting date, 29 to read the index origin, 30 to read the terminal width, 31 to read the printing precision (or `digits'), and 32 to run the shell. .sh BUGS No trace function or state indicator. .cmd/apl/documents/apl.2 644 0 33 3052 2233425673 10220 APL System commands. There are a whole bunch of them. Most are pretty familiar. )DIGITS n sets the number of digits displayed to n, from 1 to 19. )FUZZ n sets the fuzz to n. )ORIGIN n sets the origin to n, which can be any integer, not just 1 or 0 )WIDTH n sets APL's idea of your terminal's carriage width. )ERASE n gets rid of function or variable named n. )SAVE n saves all variables and functions in file named n. The format used is peculiar to APL workspaces and can only be read back in by APL. )LOAD n gets the stuff in file n (which must have been saved) back. )COPY n like )LOAD but variables and functions are not erased. Things in the loaded file take precedence over stuff already in. )CLEAR discards everything. )DROP n deletes file n, which need not be saved from APL. )CONTINUE does what you'd expect. )OFF exits, as does ctrl/d. )READ n reads in a function from file n. The first line is the header, with no del's. The full APL\360 header is accepted. All other lines in the file are lines in the function. Lines are impli- citly numbered, and transfers are as usual.There are no labels. )EDIT n runs the UNIX editor on file n, and then READ's it when you leave the editor. )LIB lists out all of the files in the current directory. )FNS lists out all current functions. )VARS lists out all current variables. )DEBUG toggles a debugging switch, which can produce vast amounts of hopelessly cryptic output. If you find bugs, have comments, or anything else having to do with APL, please mail them to user "apl". are impli- citly numbered, and transfers are as usual.There are no labels. )EDIT n runs the UNIX editor on file n, and then READ's it when you leave the editor. )LIB lists out all of the files in the current directory. )FNS lists out all current functions. )VARS lists out all current variables. )DEBUG toggles a debugging switch, which can produce vast amounts of hopelessly cryptic output. If you find bugs, have comments, or anything else having to do cmd/apl/documents/apl.6 644 0 33 3015 2233425701 10213 .th APL VI 5/19/76 .sh NAME apl \*- apl interpreter .sh SYNPOSIS .bd apl .sh DESCRIPTION This is the really improved APL interpreter. It puts the terminal into a funny mode, so watch out. If it blows up, push the single/multi page button to switch back. .s3 All of the operators are exactly as in apl\\360. Overstrikes are often required, and they work (use space, not cursor right). The keyboard is just the same as a 2741 apl keyboard. .s3 Function definition is not what you would expect. Functions are loaded from files. The first line of the file is the function header, as you would expect it but with no del. The rest of the file is the lines of the function. Lines are numbered, but there's none of the square bracket jazz. If you say )READ FILE it will load the function in that file. If you say )EDIT FILE it will put you in the unix editor to change that file. Upon exit, it will read the file in as though by )READ. .s3 All of the usual operators are available, including domino. Also available are monadic encode and epsilon. .sh FILES apl_ws \*- temporary workspace file. .s3 continue - continue workspace .sh "SEE ALSO" apl.2 \*- synposis of system commands .sh BUGS I don't know of too many, but mail any trouble reports to jrl. .s3 Interpreter occasionally blows up, giving core images. .s3 Character comparisons don't work (but try concatenating a character vector to a numeric vector and vice versa.) .s3 Many mixed functions take less general arguments than you might expect. Then again any integer origin is allowed. nd epsilon. .sh FILES apl_ws \*- temporary workspace file. .s3 continue - continue workspace .sh "SEE ALSO" apl.2 \*- synposis of system commands .sh BUGS I don't know of too many, but mail any trouble reports to jrl. .s3 Interpreter occasionally blows up, giving core images. .s3 Character comparisons don't work (but try concatenating a character vector to a numeric vector and vice versa.) .s3 Many mixed functions take less general arguments than you might expect. Then again any integer origincmd/apl/documents/apl.how 644 0 33 15437 2247510212 10673 .nr PO .5i .de B .ft B .. .RP .TL The UNIX APL Interpreter -- UCSF Version .AU H. Ross Harvey .AI UCSF Computer Graphics Laboratory .AB The UNIX APL interpreter is an incremental `compiler' which employs a multi-pass translator to produce an intermediate code. This technique is much faster than the normal interpretive method and requires less memory. The action of the translator is visible in only one way: poor run-time error reporting. The UCSF APL version features a 50K byte workspace, a simple file access procedure, character comparisons and an extended set of I-beams. The interpreter itself has been made much more reliable and the error messages have been improved. .AE .ND .PP UNIX APL is a very well written package containing all the APL 360 operators plus execute, scan, and relational character operators. UNIX APL does not have a trace feature or a state indicator. .NH 1 Major Data Structures .NH 2 Overview .PP Functions are compiled when they are first referenced; this compiled code is then stored in memory. Data always resides in memory, although there is a facility for reading and write files. The source code to the functions is maintained in the disk-saved workspaces, in the APL temporary file, and possibly as single user files. The generated code usually consists of single-byte values which are indices into the array \fBexop\fR. This array contains the addresses of functions implementing the APL operators. A reference to a variable will be specified by the \fBNAME\fR operator and the two-byte address of an \fBitem\fR or \fBnlist\fR structure. A reference to a constant will be specified by the \fBELID\fR or \fBCONST\fR operator and an eight-byte double constant. .NH 2 The Item and Nlist Structures .PP The item and nlist structures are: .DS .B struct item { struct nlist { char rank; char use; char type; char type; int size; int *itemp; int index; char *namep; data *datap; int label; int dim[0]; }; }; .R .DE The \fBrank\fR element is precisly the APL rank of the variable. The \fBtype\fR element may contain one status byte. The \fBuse\fR element contains the same information as the type element of the item structure. \fBItemp\fR usually points to the item structure describing a variable or function whose name is addressed by the \fBnamep\fR element. If the nlist structure describes a function, then itemp will be zero until the function is referenced and compiled; if the nlist structure describes some other type of variable, itemp will be zero until the variable has been set. \fBSize\fR is the total number of elements in the vector and index is an index into the currently selected member. \fBDatap\fR points to the actual data and dim[] (actually dim[rank]) naturally contains the various dimensions of the object. Since the \fBtype\fR field indicates important information such as whether the data can be destroyed, it is important to understand the meaning of the different types. .IP DA 10 This indicates numeric data \fInot\fR associated with some variable. This attribute is(( given to data which exists only on the stack in some way as an intermediate value. Objects of type \fBDA\fR may be overwritten if necessary and \fBwill\fR be deallocated if they are found on the stack after a line is executed. .IP LV \fBLV\fR indicates an \fBlvalue\fR or assignable quantity. This descriptor declares that the element is the actual data of some variable. It can not be overwritten or de-allocated. It also specifies that the pointed-to structure is not an item structure at all but is in fact the nlist structure. In this case, the \fBuse\fR member will specify the actual data type and the \fBitemp\fR member will point to an \fBitem\fR structure. .IP CH This indicates character data. .IP QD This is the \fBquad\fR variable. A reference to a quantity of this type will cause the appropriate processing (an expression is read and evaluated) and result in an element of type \fBDA\fR being placed on the stack. .IP QQ \fBQQ\fR refers to a quote-quad variable. A line of text is read from the terminal and placed (as type \fBCH\fR) on the stack. .IP IN This is integer data. This type is not fully supported so it works only when the next operator is expecting an integer. .IP EL This data type is used for data entered literally in function calls. \fBEL\fR data is deallocated in the UCSF version. .IP "NF MF DF" These types specify functions which are to be called with 0, 1 or 2 arguments. .NH 2 The Env Structure .PP The \fBenv\fR structure contains the index origin, printing precision, terminal width, and fuzz factor associated with the current workspace. When a saved workspace is loaded, these parameters are restored to their state at the time the workspace was saved. .NH 2 The Nlist Array .PP The \fBnlist\fR structure described above is found in an array of structures which is also called \fBnlist\fR. This array is maintained by ???????. .NH 2 The Labldefs Structure .PP The \fBlabldefs\fR structure is the start of a linked list containing label-name/line-number pairs. This list is allocated dynamically and is used only when a function is being compiled. .NH 2 The Idx Structure .PP The \fBidx\fR structure is used ????????. .NH 2 The Stack .PP Most operators take their source operands from the top of the internal stack. Most operators place their results on the top of the stack. In addition, local variables require space on the stack at each entrance to the function with which they are bound. The principle objects involved here are: .DS .I struct item **sp, **stack, **staktop; .R .DE The address of a memory block of size \fIsizeof(sp)*STKS\fR is initially assigned to \fBstack\fR. The variable \fBsp\fR points the the top of the stack. A call to the machine-coded function \fBpush(\fIaddress\fB)\fR will place \fIaddress\fR on top of the stack, incrementing \fBsp\fR appropriatly. \fBStaktop\fR marks the top of the current stack; if \fBpush(...)\fR finds that \fBsp\fR has passed \fBstaktop\fR, a call to \fBnewstak()\fR will allocate a new (contiguous) stack that is \fBSTKS\fR words larger. The information on the old stack is copied to the new one; \fBstack\fR is assigned the address of the new stack, and the memory occupied by the old stack is freed. .PP The function \fBReset\fR is called when APL returns to the top command level or when any error is detected. \fBReset\fR frees the current stack and allocates a new stack of size \fBSTKS\fR. This is done to ensure the integrity of the stack in the face of errors such as \fIWS EXCEEDED\fR or \fBINTERRUPT\fR. In addition, recursive or deeply nested function calls will cause a large amount of memory to be allocated to the stack. It is considered desireable to reset the stack to a small default value when possible. This prevents intentional or accidental recursion from impairing the operation of the interpreter by permanently allocating a large block of memory. ates a new stack of size \fBSTKS\fR. This is done to ensure the integrity of the stack in the face of errors such as \fIWS EXCEEDED\fR or \fBINTERRUPT\fR. In addition, recursive or deeply nested function calls will cause a lacmd/apl/documents/apl.man 644 0 33 3727 2233425725 10641 APL(I) 7/10/78 APL(I) NAME apl - The UCSF APL interpreter SYNOPSIS apl DESCRIPTION The UCSF APL interpreter contains all the APL 360 operators plus execute (epsilon), scan, and relational character operators. The maximum workspace size is about 50,000 bytes. Function definition is not what you would expect. Functions are created and modified with the system editor. Type `)EDIT fname' or `)EX fname' to creat or modify a function. Type `)READ fname' if it exists and doesn't need editing. The following I-beams are recognized by APL: 1iF Open F for reading. 2iF Create F for writing. 3iF Append to F. 1i0, 2i0, 3i0 Close the named channel. Only one read channel and one write channel may be open simultaneously. When a file is open for reading, references to the quad or quote-quad variable are actually references to the named file. When open for writing, assignments to the quad variable are written to the file. 10iC Send command C to the shell. The command will be executed as if it were typed at a UNIX terminal. This is equivalent to the `!' feature of the edi- tor. Monadic I-beam functions are: 20 for the time of day, 21 to return CPU time used, 22 to return WS free in bytes, 24 to return the starting time, 25 to return the date, 28 to re- turn the starting date, 29 to read the index origin, 30 to read the terminal width, 31 to read the printing precision (or `digits'), and 32 to run the shell. BUGS No trace function or state indicator. No `)WSID' command. The existing system commands take only one argument. A `)WRITE fname' command is needed to get at functions which exist only in workspaces. - 1 - turn the starting time, 25 to return the cmd/apl/documents/libr.doc 644 0 33 4365 2233426033 10777 .tl 'LIBR(I)'12/17/75'LIBR(I)' NAME libr - fortran librarian SYNOPSIS libr libfile -k1 n11 n12 ... n1k ... -kn ... DESCRIPTION LIBR is a program to build and maintain libraries of object modules to be used with LINK. An object module in a library is included in the out file iff it satisfies an undefined reference at the time it is encountered. (With some exceptions for -i: and -e: ) Therefore, the order of modules in a library is important. All commands except append (-a ) require that the file designated 'libfile' already exit. The append command will create the library file if it does not exist. The action of LIBR is governed by the keybytes, which are interpreted in left-to-right order. The entire command line is checked for correctness, and then executed. In a library, all modules are identifies by their module name. Assembly language programs get their module name from a .title directive. In fortran subprograms the module name is the name of the subroutine declared in it. There are no default extensions. The keybytes are: -l .in 20 list the contents of the library as it will appear at the completion of the LIBR command .in 0 -g mod syms .in 20 As noted above, a module is included into an outfile from a library only if it 'declares' a yet-undefined global symbol. Initially, a module declares all those global symbols which are assigned values within it. The -g command allows one to eliminate declarations from a module. .in 0 -d mods .in 20 delete the named modules from the library .in 0 -i mod files .in 20 place the modules in the named files into the library before the given module. .in 0 -r files .in 20 Replace the modules in the library with those in the files having the same module name. .in 0 -a files .in 20 Append the modules in the named files to the library. Create the library if it does not exist. .in 0 -c .in 20 Generate a cross-reference .in 0 EXAMPLE A fortran user wants to create a library of six graphics subroutines in the object files graph1.obj ... graph6.obj. First, a library is created: libr graphlib -a graph1.obj ... graph6.obj If, later, it is necessary to replace one of the subroutines, say #4, this can be done as: libr graphlib -r graph4.obj FILES libr1.tmp - scratch file .in 20 Append the modules in the named files to the library. Create the library if it does not exist. .in 0 -c .in 20 Generate a cross-reference .in 0 EXAMPLE A fortran user wants to create a library of six graphics subroutines in the object files graph1.obj .cmd/apl/a0.c 644 0 33 25254 2344034664 6053 ((#include "apl.h" /*#include "/usr/sys/tty.h" /* pick up TECO-mode bit */ #define APLMOD 01000 short TERMtype = 0 ; /* for now ( very stupid variable) */ short chartab[]; char partab[1]; int ifile = 0, ofile = 1; data zero = 0.0; data one = 1.0; data pi = 3.141592653589793238462643383; data maxexp = 88.0; struct env thread = { 1.0e-13, 1, 9, 72 }; main(ac,av) char **av; { register a, c; int fflag; int intr(); int floatover(); extern headline[]; memstart = sbrk(0); Reset(); signal(8,floatover); if(--ac&&*av[1]=='-') ++echoflg; time(stime); setterm(1); /* turn off APL mode */ aprintf(headline); if(ttyname(0) == 'x') echoflg++; a = "apl_ws"; while((wfile = open(a, 2)) < 0) { c = creat(a, 0666); if(c < 0) { aprintf("cannot create apl_ws"); exit(0); } close(c); } fflag = 1; sp = stack; signal(2, intr); setexit(); if(fflag) { fflag =0; if((a=open("continue",0)) < 0) { aprintf("clear ws\n"); goto loop; } wsload(a); aprintf(" continue\n"); } loop: while(sp > stack) pop(); Reset(); signal(8,floatover); if(intflg) error("I"); if(!ifile&&ofile==1) aputchar('\t'); a = rline(8); if(a==0) { if(ifile) { ifile = 0; goto loop; } ctrld(); } c = compile(a, 0); afree(a); if(c == 0) goto loop; execute(c); afree(c); goto loop; } /* this procedure is for trapping floating point exceptions, and */ /* then reset the program. added june 1979 */ floatover() { printf("\t\nerror -- floating point exception\n"); signal(8,floatover); reset(); }; setterm(toggle) { TERMtype = toggle; aplmod(toggle + 1); } nargs() { return 1; } Reset() { afree(stack); cs_size = STKS; stack = alloc(sizeof(sp)*STKS); /* Set up internal stack */ sp = stack; staktop = &stack[STKS-1]; } intr() { intflg = 1; signal(2, intr); lseek(0, 0, 2); } rline(s) { int rlcmp(); char line[CANBS]; register char *p; register c, col; char *cp; char *dp; short i; int j; column = 0; col = s; p = line; loop: c = agetchar(); if(intflg) error("I"); switch(c) { case '\0': case -1: return(0); case '\b': if(col) col--; goto loop; case '\t': col = (col+8) & ~7; goto loop; case ' ': case 016: /* cursor right */ col++; goto loop; case '\r': col = 0; goto loop; default: *p++ = col; *p++ = c & 0177; col++; goto loop; case 033: /* escape - APL line feed */ for(cp=dp=line; cp=0;j--) if ((i.c[0] == chartab[j].a1) && ( i.c[1]==chartab[j].a2)) { *cp = j | 0200; j = 0; break; } if(j) { yuck: *cp = '\n'; pline(c,++col); error("Y E"); } } *++cp = '\n'; return(c); } rlcmp(a, b) char *a, *b; { register c; if(c = a[0] - b[0]) return(c); return(a[1] - b[1]); } pline(str, loc) char *str; { register c, l, col; col = 0; l = 0; do { c = *str++; l++; if(l == loc) col = column; aputchar(c); } while(c != '\n'); if(col) { putto(col); if (TERMtype == 0)aputchar(')'); else aputchar('^'); aputchar('\n'); } } putto(col) { while(col > column+8) aputchar('\t'); while(col > column) aputchar(' '); } term() { unlink("apl_ws"); aputchar('\n'); aplmod(0); /*turn off APL mode */ exit(0); } fix(d) data d; { register i; i = floor(d+0.5); return(i); } xeq_mark() { if(now_xeq.name) { aprintf(now_xeq.name); aprintf(" ;%d'\n", now_xeq.line); } now_xeq.name = now_xeq.line = 0; } error(s) char *s; { register c; register char *cp; intflg = 0; if(ifile) close(ifile); if(ofile&&ofile!=1) close(ofile); ifile = 0; ofile = 1; xeq_mark(); cp = s; while(c = *cp++) { if(c >= 'A' && c <= 'Z') { switch(c) { case 'L': c = "length"; break; case 'I': c = "\ninterrupt"; break; case 'C': c = "conformability"; break; case 'S': c = "syntax"; break; case 'R': c = "rank"; break; case 'X': c = "index"; break; case 'Y': c = "character"; break; case 'M': c = "memory"; break; case 'D': c = "domain"; break; case 'T': c = "type"; break; case 'E': c = "error"; break; case 'B': default: c = "botch"; } aprintf(c); continue; } aputchar(c); } aputchar('\n'); reset(); }; /* procedure to catch control d and prevent it from logging out the user*/ ctrld(){ aprintf("\nto exit type \"off\nto exit and save workspace type \"continue\n"); reset(); } aprintf(f, a) char *f; { register char *s; register *p; s = f; p = &a; while(*s) { if(s[0] == '%' && s[1] == 'd') { putn(*p++); s += 2; continue; } aputchar(*s++); } } putn(n) { register a; if(n < 0) { n = -n; if(n < 0) { aprintf("2147483648"); return; } aputchar('@'); /* apl minus sign */ } if(a=n/10) putn(a); aputchar(n%10 + '0'); } agetchar() { int c; c = 0; read(ifile, &c, 1); if(echoflg) write(1, &c, 1); return(c); } aputchar(c) register c; { register i; unsigned char c2; extern unsigned char changeoutput[]; if(TERMtype == 1) /* ascii terminal */ c = changeoutput [ (0377 & c) ]; switch(c) { case '\0': return; case '\b': if(column) column--; break; case '\t': column = (column+8) & ~7; break; case '\r': case '\n': column = 0; break; default: column++; } /* for encode numbers */ if(mencflg) { if(c != '\n') { mencflg = 1; *mencptr++ = c; } else if(mencflg > 1) mencptr += rowsz; else mencflg = 2; return; } if(intflg == 0) { if(c & 0200) { i = chartab[c & 0177]; aputchar(i>>8); c = i & 0177; aputchar('\b'); } c2 = c; write(ofile, &c2, 1); } } fuzz(d1, d2) data d1, d2; { double f1, f2; f1 = d1; if(f1 < 0.) f1 = -f1; f2 = d2; if(f2 < 0.) f2 = -f2; if(f2 > f1) f1 = f2; f1 *= thread.fuzz; if(d1 > d2) { if(d2+f1 >= d1) return(0); return(1); } if(d1+f1 >= d2) return(0); return(-1); } pop() { dealloc(*--sp); } erase(np) struct nlist *np; { register *p; p = np->itemp; if(p) { switch(np->use) { case NF: case MF: case DF: for(; *p>0; (*p)--) afree(p[*p]); } afree(p); np->itemp = 0; } np->use = 0; } dealloc(p) struct item *p; { switch(p->type) { case DA: case CH: case QQ: case QD: case QC: case EL: afree(p); } } newdat(type, rank, size) { register i; register struct item *p; if(rank > MRANK) error("R E"); i = sizeof *p + rank * SINT; if(type == DA) i += size * SDAT; else if(type == CH) i += size; p = alloc(i); p->rank = rank; p->type = type; p->size = size; p->index = 0; if(rank == 1) p->dim[0] = size; p->datap = &p->dim[rank]; return(p); } copy(type, from, to, size) char *from, *to; { register i; register char *a, *b; int s; if((i = size) == 0) return(0); a = from; b = to; if(type == DA) i *= SDAT; else if(type == IN) i *= SINT; s = i; do *b++ = *a++; while(--i); return(s); } fetch1() { return sp[-1] = fetch(sp[-1]); } fetch2() { sp[-2] = fetch(sp[-2]); return sp[-1] = fetch(sp[-1]); } fetch(ip) struct item *ip; { register struct item *p, *q; char *ubset; register i; int c; p = ip; loop: switch(p->type) { case QQ: afree(p); c = rline(0); if(c == 0) error("eof"); for(i=0; c->c[i] != '\n'; i++) continue; p = newdat(CH, 1, i); copy(CH, c, p->datap, i); goto loop; case QD: case QC: if(!ifile&&ofile==1) aprintf("L>\n\t"); i = rline(8); if(i == 0) error("eof"); c = compile(i, 1); afree(i); if(c == 0) goto loop; i = pcp; execute(c); pcp = i; afree(c); afree(p); p = *--sp; goto loop; case DA: case CH: p->index = 0; return(p); case LV: if(p->use != DA) { ubset = ip->namep; xeq_mark(); while(*ubset) aputchar(*ubset++); error("> used before set\n"); } p = p->itemp; q = newdat(p->type, p->rank, p->size); copy(IN, p->dim, q->dim, p->rank); copy(p->type, p->datap, q->datap, p->size); return(q); default: error("fetch B"); } } topfix() { register struct item *p; register i; p = fetch1(); if(p->type != DA || p->size != 1) error("topval C"); i = fix(p->datap[0]); pop(); return(i); } bidx(ip) struct item *ip; { register struct item *p; p = ip; idx.type = p->type; idx.rank = p->rank; copy(IN, p->dim, idx.dim, idx.rank); size(); } size() { register i, s; s = 1; for(i=idx.rank-1; i>=0; i--) { idx.del[i] = s; s *= idx.dim[i]; } idx.size = s; return(s); } colapse(k) { register i; if(k < 0 || k >= idx.rank) error("collapse X"); idx.dimk = idx.dim[k]; idx.delk = idx.del[k]; for(i=k; i= idx.dim[i-1]) if(--i <= 0) return; } } access() { register i, n; n = 0; for(i=0; iindex; while(i >= p->size) { if(i == 0) error("getdat B"); i -= p->size; } if(p->type == DA) { d = p->datap[i]; } else if(p->type == CH) { d = p->datap->c[i]; } else error("getdat B"); i++; p->index = i; return(d); } putdat(ip, d) data d; struct item *ip; { register struct item *p; register i; p = ip; i = p->index; if(i >= p->size) error("p((utdat B"); if(p->type == DA) { p->datap[i] = d; } else if(p->type == CH) { p->datap->c[i] = d; } else error("putdat B"); i++; p->index = i; } aplmod(xyz) { static firstvisit=0; static short old[3], new[3]; static short diff; if(xyz> 0) { if (firstvisit == 0){ if(gtty(0,old)<0) { diff = 0; return; } diff = 1; } if (diff == 1) { gtty(0, new); if (xyz == 1)new[1] = 'W'|'A'<<8; /* apl terminal */ else new[1] = ''|''<<8; /* ascii terminal */ stty(0, new); if (firstvisit) if (xyz == 1)aprintf("erase%KWK kill%KAK\n\n"); else aprintf("erase ^H kill ^U\n\n"); } firstvisit++; } else { if(diff) stty(0, old); } } tic firstvisit=0; static short old[3], new[3]; static short diff; if(xyz> 0) { if (firstvisit == 0){ if(gtty(0,old)<0) { diff = 0; return; } diff = 1; } if (diff == 1) { gtty(0, new); if (xyz == 1)new[1] = 'W'|'A'<<8; /* apl terminal */ else new[1] = ''|''<<8; /* ascii terminal */ stty(0, new); cmd/apl/a1.c 644 0 33 17114 2162772103 6043 #include "apl.h" char *continu = "continue"; execute(s) char *s; { register i; register data *dp; register struct item *p; struct item *p1; int j; data (*f)(), d; #ifdef SOMED if(debug) dump(s); #endif loop: i = *s++; #ifdef FULLD if(debug) { extern char *opname[]; if(i==-1) aprintf("exec eof\n"); else if(0<=i&&i<103) { aprintf("exec "); aprintf(opname[i]); aputchar('\n'); } else aprintf("exec %d\n",i); } #endif #ifdef SHORTD if(debug) aprintf("exec %d\n", i); #endif switch(i) { default: error("exec B"); case EOF: return; case EOL: pop(); goto loop; case COMNT: push(newdat(DA,1,0)); goto loop; case ADD: case SUB: case MUL: case DIV: case MOD: case MIN: case MAX: case PWR: case LOG: case CIR: case COMB: case AND: case OR: case NAND: case NOR: case LT: case LE: case EQ: case GE: case GT: case NE: f = exop[i]; p = fetch2(); p1 = sp[-2]; if(p->type!=DA||p1->type!=DA) { if(p->type==CH&&p1->type==CH) { charfun(i, p, p1); goto loop; } else error("dyadic T E"); } if(!p->rank||p->rank==1&&p->size==1) { d = p->datap[0]; pop(); p = p1; dp = p->datap; for(i=0; isize; i++) { *dp = (*f)(d, *dp); dp++; } goto loop; } if(!p1->rank||p1->rank==1&&p1->size==1) { sp--; d = p1->datap[0]; pop(); push(p); dp = p->datap; for(i=0; isize; i++) { *dp = (*f)(*dp, d); dp++; } goto loop; } if(p1->rank != p->rank) error("dyadic C E"); for(i=0; irank; i++) if(p->dim[i] != p1->dim[i]) error("dyadic C E"); dp = p1->datap; for(i=0; isize; i++) { *dp = (*f)(p->datap[i], *dp); dp++; } pop(); goto loop; case PLUS: case MINUS: case SGN: case RECIP: case ABS: case FLOOR: case CEIL: case EXP: case LOGE: case PI: case RAND: case FAC: case NOT: f = exop[i]; p = fetch1(); if(p->type != DA) error("monadic T E"); dp = p->datap; for(i=0; isize; i++) { *dp = (*f)(*dp); dp++; } goto loop; case MEPS: /* execute */ case MENC: /* monadic encode */ case DRHO: case DIOT: case EPS: case REP: case BASE: case DEAL: case DTRN: case CAT: case CATK: case TAKE: case DROP: case DDOM: case MDOM: case GDU: case GDUK: case GDD: case GDDK: case COM: case COM0: case COMK: case EXD: case EXD0: case EXDK: case ROT: case ROT0: case ROTK: case MRHO: case MTRN: case RAV: case RAVK: case RED: case RED0: case REDK: case SCAN: case SCANK: case SCAN0: case REV: case REV0: case REVK: case ASGN: case INDEX: case ELID: case IPROD: case OPROD: case IMMED: case HPRINT: case PRINT: case MIOT: case MIBM: case DIBM: case BRAN0: case BRAN: case FUN: case ARG1: case ARG2: case AUTO: case REST: pcp = s; (*exop[i])(); s = pcp; goto loop; case NAME: s += copy(IN, s, sp, 1); sp++; if(sp>staktop) newstak(); goto loop; case QUOT: j = CH; goto con; case CONST: j = DA; con: i = *s++; p = newdat(j, i==1?0:1, i); s += copy(j, s, p->datap, i); push(p); goto loop; case QUAD: push(newdat(QD,0,0)); goto loop; case QQUAD: push(newdat(QQ,0,0)); goto loop; case CQUAD: push(newdat(QC,0,0)); goto loop; } } static int comop; charfun(op, p, p1) struct item *p, *p1; { register char c, *cxi; register double *dxi; int i; comop = op; switch(op) { default: error("Y D E"); case LT: case LE: case EQ: case GE: case GT: case NE: /* OK */; } if(!p->rank) { c = *((char*)(p->datap)); cxi = (char*)(p1->datap); push(newdat(DA,p1->rank,p1->size)); copy(IN, p1->dim, sp[-1]->dim, p1->rank); dxi = sp[-1]->datap; for(i=0; isize; i++) *dxi++ = (double)charcom(c,*cxi++); goto done; } if(!p1->rank) { c = ((char*)(p1->datap))[0]; cxi = (char*)(p->datap); push(newdat(DA,p->rank,p->size)); copy(IN, p->dim, sp[-1]->dim, p->rank); dxi = sp[-1]->datap; for(i=0; isize; i++) *dxi++ = (double)charcom(*cxi++,c); goto done; } if(p1->rank != p->rank) error("dyadic Y C E"); for(i=0; irank; i++) if(p->dim[i]!=p1->dim[i]) error("dyadic Y C E"); cxi = (char*)(p1->datap); push(newdat(DA,p->rank,p->size)); copy(IN, p->dim, sp[-1]->dim, p->rank); dxi = sp[-1]->datap; for(i=0; isize; i++) *dxi++ = (double)charcom(((char*)(p->datap))[i],*cxi++); done: dealloc(sp[-2]); dealloc(sp[-3]); sp[-3] = sp[-1]; sp -= 2; return; } charcom(c1, c2) register char c1, c2; { switch(comop) { case LE: return c1<=c2; case LT: return c1c2; case GE: return c1>=c2; } error("Y B"); /* "Cannot happen" */ } int ex_add(), ex_plus(), ex_sub(), ex_minus(), ex_mul(), ex_sgn(), ex_div(), ex_recip(), ex_mod(), ex_abs(), ex_min(), ex_floor(), ex_max(), ex_ceil(), ex_pwr(), ex_exp(), ex_log(), ex_loge(), ex_cir(), ex_pi(), ex_comb(), ex_fac(), ex_deal(), ex_rand(), ex_drho(), ex_mrho(), ex_diot(), ex_miot(), ex_rot0(), ex_rev0(), ex_dtrn(), ex_mtrn(), ex_dibm(), ex_mibm(), ex_gdu(), ex_gduk(), ex_gdd(), ex_gddk(), ex_exd(), ex_scan(), ex_exdk(), ex_scnk(), ex_iprod(), ex_oprod(), ex_br0(), ex_br(), ex_ddom(), ex_mdom(), ex_com(), ex_red(), ex_comk(), ex_redk(), ex_rot(), ex_rev(), ex_rotk(), ex_revk(), ex_cat(), ex_rav(), ex_catk(), ex_ravk(), ex_print(), ex_elid(), ex_index(), ex_hprint(), ex_lt(), ex_le(), ex_gt(), ex_ge(), ex_eq(), ex_ne(), ex_and(), ex_or(), ex_nand(), ex_nor(), ex_not(), ex_eps(), ex_meps(), ex_rep(), ex_take(), ex_drop(), ex_exd0(), ex_asgn(), ex_immed(), ex_fun(), ex_arg1(), ex_arg2(), ex_auto(), ex_rest(), ex_com0(), ex_red0(), ex_exd0(), ex_scn0(), ex_base(), ex_menc(); int (*exop[])() = { 0, /* 0 */ ex_add, /* 1 */ ex_plus, /* 2 */ ex_sub, /* 3 */ ex_minus, /* 4 */ ex_mul, /* 5 */ ex_sgn, /* 6 */ ex_div, /* 7 */ ex_recip, /* 8 */ ex_mod, /* 9 */ ex_abs, /* 10 */ ex_min, /* 11 */ ex_floor, /* 12 */ ex_max, /* 13 */ ex_ceil, /* 14 */ ex_pwr, /* 15 */ ex_exp, /* 16 */ ex_log, /* 17 */ ex_loge, /* 18 */ ex_cir, /* 19 */ ex_pi, /* 20 */ ex_comb, /* 21 */ ex_fac, /* 22 */ ex_deal, /* 23 */ ex_rand, /* 24 */ ex_drho, /* 25 */ ex_mrho, /* 26 */ ex_diot, /* 27 */ ex_miot, /* 28 */ ex_rot0, /* 29 */ ex_rev0, /* 30 */ ex_dtrn, /* 31 */ ex_mtrn, /* 32 */ ex_dibm, /* 33 */ ex_mibm, /* 34 */ ex_gdu, /* 35 */ ex_gduk, /* 36 */ ex_gdd, /* 37 */ ex_gddk, /* 38 */ ex_exd, /* 39 */ ex_scan, /* 40 */ ex_exdk, /* 41 */ ex_scnk, /* 42 */ ex_iprod, /* 43 */ ex_oprod, /* 44 */ 0, /* 45 */ 0, /* 46 */ ex_br0, /* 47 */ ex_br, /* 48 */ ex_ddom, /* 49 */ ex_mdom, /* 50 */ ex_com, /* 51 */ ex_red, /* 52 */ ex_comk, /* 53 */ ex_redk, /* 54 */ ex_rot, /* 55 */ ex_rev, /* 56 */ ex_rotk, /* 57 */ ex_revk, /* 58 */ ex_cat, /* 59 */ ex_rav, /* 60 */ ex_catk, /* 61 */ ex_ravk, /* 62 */ ex_print, /* 63 */ 0, /* 64 */ ex_elid, /* 65 */ 0, /* 66 */ 0, /* 67 */ ex_index, /* 68 */ ex_hprint, /* 69 */ 0, /* 70 */ ex_lt, /* 71 */ ex_le, /* 72 */ ex_gt, /* 73 */ ex_ge, /* 74 */ ex_eq, /* 75 */ ex_ne, /* 76 */ ex_and, /* 77 */ ex_or, /* 78 */ ex_nand, /* 79 */ ex_nor, /* 80 */ ex_not, /* 81 */ ex_eps, /* 82 */ ex_meps, /* 83 */ ex_rep, /* 84 */ ex_take, /* 85 */ ex_drop, /* 86 */ ex_exd0, /* 87 */ ex_asgn, /* 88 */ ex_immed, /* 89 */ 0, /* 90 */ 0, /* 91 */ ex_fun, /* 92 */ ex_arg1, /* 93 */ ex_arg2, /* 94 */ ex_auto, /* 95 */ ex_rest, /* 96 */ ex_com0, /* 97 */ ex_red0, /* 98 */ ex_exd0, /* 99 */ ex_scn0, /*100 */ ex_base, /*101 */ ex_menc, /*102 */ /* monadic encod */ }; */ ex_or, /* 78 */ ex_nand, /* 79 */ ex_nor, /* 80 */ ex_not, /* 81 */ ex_eps, /* 82 */ ex_meps, /* 83 */ ex_rep, /* 84 */ ex_take, /* 85 */ ex_drop, /* 86 */ ex_exd0, /* 87 */ ex_asgn, /* 88 */ ex_immed, /* 89 */ 0, /* 90 */ 0, /* 91 */ ex_fun, /* 92 */ ex_arg1, /* 93 */ ex_arg2, /* 94 */ ex_auto, /* 95 */ ex_rest, /* 96 */ ex_com0, /* 97 */ ex_red0, /* 98 */ ex_exd0, /* 99 */ ex_scn0, /*100 */ ex_bacmd/apl/a2.c 644 0 33 4565 2152074414 6031 ((#include "apl.h" ex_print() { epr0(); aputchar('\n'); } ex_hprint() { epr0(); pop(); } epr0() { register struct item *p; register data *dp; data dp2; short int dp7; register i; int j; int param[4]; p = fetch1(); if(p->size == 0) return; if(p->type == DA) { for(i=0; i<4; i++) param[i] = 0; dp = p->datap; dp2 = *(dp); for(i=0; isize; i++) epr1(*dp++, param); i = param[1] + param[2]; /* size if fp */ if(i > thread.digits) i += 100; if(param[2]) i++; if(i > param[0]+5) { i = param[0] + 5; /* size if ep */ param[1] = param[0]; param[2] = -1; } if(param[3]) i++; /* sign */ i++; /* leading space */ param[0] = i; dp = p->datap; } bidx(p); for(i=1; isize; i++) { if(intflg) break; if(p->type == CH) { j = getdat(p); aputchar(j); } else epr2(*dp++, param); for(j=p->rank-2; j>=0; j--) if(i%idx.del[j] == 0) aputchar('\n'); } if(p->type == CH) { j = getdat(p); aputchar(j); } else epr2(*dp, param); } epr1(d, param) data d; int *param; { double f; register a; register char *c; int dp, sg; f = d; c = ecvt(f, thread.digits, &dp, &sg); a = thread.digits; while(c[a-1]=='0' && a>1) a--; if(a > param[0]) /* sig digits */ param[0] = a; a -= dp; if(a < 0) a = 0; if(a > param[2]) /* digits to right of dp */ param[2] = a; if(dp > param[1]) /* digits to left of dp */ param[1] = dp; param[3] |= sg; /* and sign */ } epr2(d, param) int *param; data d; { register i; register char *c, *mc; double f; int dp, sg; if(param[0]+column > thread.width) { aputchar('\n'); putto(param[0]); } f = d; c = ecvt(f, thread.digits, &dp, &sg); mc = c + thread.digits; aputchar(' '); sg = sg? '@': ' '; if(param[2] < 0) { if(param[3]) aputchar(sg); for(i=0; i= mc) aputchar('0'); else aputchar(*c++); for(i=0; i= mc) aputchar('0'); else aputchar(*c++); } } if(dp < 0) { aputchar('@'); dp = -dp; } else aputchar('-'); /* an apl style plus sign */ aputchar(dp/10 + '0'); aputchar(dp%cmd/apl/a3.c 644 0 33 1731 2144260571 6024 #include "apl.h" ex_miot() { register struct item *p; register data *dp; register i; i = topfix(); if(i < 0) error("miot D"); p = newdat(DA, 1, i); dp = p->datap; datum = thread.iorg; for(; i; i--) { *dp++ = datum; datum =+ one; } push(p); } ex_mrho() { register struct item *p, *q; register data *dp; int i; p = fetch1(); q = newdat(DA, 1, p->rank); dp = q->datap; for(i=0; irank; i++) *dp++ = p->dim[i]; pop(); push(q); } ex_drho() { register struct item *p, *q; struct item *r; int s, i; register data *dp; char *cp; p = fetch2(); q = sp[-2]; if(p->type != DA || p->rank > 1 || q->size < 1) error("rho C"); s = 1; dp = p->datap; for(i=0; isize; i++) s =* fix(*dp++); r = newdat(q->type, p->size, s); dp = p->datap; for(i=0; isize; i++) r->dim[i] = fix(*dp++); cp = r->datap; while(s > 0) { i = s; if(i > q->size) i = q->size; cp =+ copy(q->type, q->datap, cp, i); s =- i; } pop(); pop(); push(r); } register struct item *p, *q; struct icmd/apl/a4.c 644 0 33 4132 2151424063 6017 #include "apl.h" ex_asgn() { register struct nlist *p; register struct item *q; p = sp[-1]; if(p->type == QD) { pop(); ex_print(); return; } if(p->type == QC) { pop(); ex_plot(); return; } if(p->type != LV) error("asgn lv"); if(p->use != 0 && p->use != DA) error("asgn var"); sp--; q = fetch1(); erase(p); p->use = DA; p->itemp = q; sp[-1] = p; } ex_elid() { push(newdat(EL,0,0)); } ex_index() { register struct item *p; struct item *q; register i, j; int f, n, lv; n = *pcp++; f = *pcp; p = sp[-1]; if(f == ASGN) { pcp++; if(p->type != LV) error("indexed assign value"); if(p->use != DA) fetch1(); /* error("used before set"); */ q = p->itemp; } else q = fetch1(); if(q->rank != n) error("subscript C"); idx.rank = 0; for(i=0; itype == EL) { idx.dim[idx.rank++] = q->dim[i]; continue; } p = fetch(p); sp[-i-2] = p; for(j=0; jrank; j++) idx.dim[idx.rank++] = p->dim[j]; } size(); if(f == ASGN) { p = fetch(sp[-n-2]); sp[-n-2] = p; if(p->size > 1) { if(idx.size != p->size) error("assign C"); f = 1; /* v[i] <- v */ } else { datum = getdat(p); f = 2; /* v[i] <- s */ } ex_elid(); } else { p = newdat(q->type, idx.rank, idx.size); copy(IN, idx.dim, p->dim, idx.rank); push(p); f = 0; /* v[i] */ } bidx(q); index1(0, f); if(f == 0) { p = sp[-1]; sp--; for(i=0; i<=n; i++) pop(); push(p); } else { sp -= 2; for(i=0; i= idx.rank) switch(f) { case 0: p = sp[-2]; p->index = access(); putdat(sp[-1], getdat(p)); return; case 1: datum = getdat(sp[-idx.rank-3]); case 2: p = sp[-2]->itemp; p->index = access(); putdat(p, datum); return; } p = sp[-i-3]; if(p->type == EL) { for(j=0; jindex = 0; for(j=0; jsize; j++) { k = fix(getdat(p)) - thread.iorg; if(k < 0 || k > idx.dim[i]) error("subscript X"); idx.idx[i] = k; index1(i+1, f); } } se 0: p = sp[-2]; p->index = access(); putdat(sp[-1], getdat(p)); return; case 1: datum = getdat(sp[-idx.rank-3]); case 2: p = sp[-2]->itemp; p->index = access(); putdat(p, datum); return; } p = sp[-i-3]; if(p->type == EL) { for(j=0; jindex = 0; for(j=0; jsize; j++) { k = fix(getdat(p)) - thread.iorg; if(kcmd/apl/a5.c 644 0 33 3726 2144260574 6037 #include "apl.h" ex_rav() { register struct item *p, *r; p = fetch1(); if(p->rank == 0) { r = newdat(p->type, 1, 1); putdat(r, getdat(p)); pop(); push(r); return; } rav0(p->rank-1); } ex_ravk() { register i; i = topfix() - thread.iorg; fetch1(); rav0(i); } rav0(k) { register struct item *p, *r; struct item *param[2]; int rav1(); p = sp[-1]; bidx(p); colapse(k); r = newdat(p->type, 1, p->size); param[0] = p; param[1] = r; forloop(rav1, param); pop(); push(r); } rav1(param) struct item *param[]; { register struct item *p; register i, n; p = param[0]; n = access(); for(i=0; iindex = n; putdat(param[1], getdat(p)); n =+ idx.delk; } } ex_cat() { register struct item *p, *q; struct item *r; register k; p = fetch2(); q = sp[-2]; k = p->rank; if(q->rank > k) k = q->rank; if(k == 0) { r = newdat(p->type, 1, 2); putdat(r, getdat(p)); putdat(r, getdat(q)); pop(); pop(); push(r); } else cat0(k-1); } ex_catk() { register k; k = topfix() - thread.iorg; fetch2(); cat0(k); } cat0(k) { register struct item *p, *q; register i; struct item *r; int a, b; p = sp[-1]; q = sp[-2]; i = k; if(p->rank >= q->rank) { bidx(p); b = cat1(q, i); a = idx.dim[i]; } else { bidx(q); a = cat1(p, i); b = idx.dim[i]; } idx.dim[i] = a+b; size(); r = newdat(p->type, idx.rank, idx.size); copy(IN, idx.dim, r->dim, idx.rank); i = idx.del[i]; a =* i; b =* i; while(r->index < r->size) { for(i=0; i= idx.rank) error("cat X"); p = ip; a = 1; if(p->rank == 0) return(a); j = 0; for(i=0; irank == idx.rank) { a = p->dim[i]; j++; } continue; } if(idx.dim[i] != p->dim[j]) error("cat C"); j++; } return(a); } size) { for(i=0; irank-1); } ex_redk() { register i; i = topfix() - thread.iorg; fetch1(); red0(i); } red0(k) { register struct item *p, *q; int param[3], red1(); p = fetch1(); if(p->type != DA) error("red T"); bidx(p); colapse(k); if(idx.dimk == 0) { /* * reduction identities - ets/jrl 5/76 */ q = newdat(DA,0,1); q->dim[0] = 1; switch(*pcp++) { case ADD: case SUB: case OR: q->datap[0] = 0; break; case AND: case MUL: case DIV: q->datap[0] = 1; break; case MIN: q->datap[0] = 1.0e38; break; case MAX: q->datap[0] = -1.0e38; break; default: error("reduce identity"); } pop(); push(q); return; } q = newdat(idx.type, idx.rank, idx.size); copy(IN, idx.dim, q->dim, idx.rank); param[0] = p->datap; param[1] = q; param[2] = exop[*pcp++]; forloop(red1, param); pop(); push(q); } red1(param) int param[]; { register i; register data *dp; data d, (*f)(); dp = param[0]; dp =+ access() + (idx.dimk-1) * idx.delk; f = param[2]; d = *dp; for(i=1; idim, idx.rank); param[0] = p->datap; param[1] = q; param[2] = exop[*pcp++]; forloop(red1, param); pop(); push(q); } red1(param) int param[]; { register i; register data *dp; data d, cmd/apl/a7.c 644 0 33 3366 2144260576 6043 #include "apl.h" ex_iprod() { register i, j; struct item *p, *q, *r; int param[10], ipr1(); param[0] = exop[*pcp++]; param[1] = exop[*pcp++]; p = fetch2(); q = sp[-2]; if(p->type != DA || q->type != DA) error("iprod T"); bidx(p); idx.rank--; param[2] = idx.dim[idx.rank]; if(param[2] != q->dim[0]) error("inner prod C"); param[3] = q->size/param[2]; for(i=1; irank; i++) idx.dim[idx.rank++] = q->dim[i]; r = newdat(DA, idx.rank, size()); copy(IN, idx.dim, r->dim, idx.rank); param[4] = 0; param[5] = 0; param[6] = p->datap; param[7] = q->datap; param[8] = r->datap; param[9] = p->size; forloop(ipr1, param); pop(); pop(); push(r); } ipr1(param) int param[]; { register i, dk; int lk, a, b; data *dp1, *dp2, *dp3; data (*f1)(), (*f2)(), d; f1 = param[0]; f2 = param[1]; dk = param[2]; lk = param[3]; a = param[4]; b = param[5]; dp1 = param[6]; dp2 = param[7]; dp3 = param[8]; a =+ dk; b =+ (dk * lk); for(i=0; i= lk) { param[5] = 0; param[4] =+ dk; if(param[4] >= param[9]) param[4] = 0; } } ex_oprod() { register i, j; register data *dp; struct item *p, *q, *r; data *dp1, *dp2; data (*f)(); f = exop[*pcp++]; p = fetch2(); q = sp[-2]; if(p->type != DA || q->type != DA) error("oprod T"); bidx(p); for(i=0; irank; i++) idx.dim[idx.rank++] = q->dim[i]; r = newdat(DA, idx.rank, size()); copy(IN, idx.dim, r->dim, idx.rank); dp = r->datap; dp1 = p->datap; for(i=0; isize; i++) { datum = *dp1++; dp2 = q->datap; for(j=0; jsize; j++) *dp++ = (*f)(datum, *dp2++); } pop(); pop(); push(r); } register data *dp; struct item *p, *q, *r; data *dp1, *dp2; data (*f)(); f = exop[*pcp++]; p = fetch2(); q = sp[-2]; if(p->type != DA || q->type != DA) error("oprod T"); bidx(p); for(i=0; irank; i++) idx.dim[idx.rank++] = q->dim[i]; r = newdat(DAcmd/apl/a8.c 644 0 33 10071 2146147331 6046 #include "apl.h" ex_mdom() { register data *dp; register a; int i, j; struct item *p, *q; p = fetch1(); if(p->rank != 2) error("mdom C"); a = p->dim[0]; q = newdat(DA, 2, a*a); q->dim[0] = a; q->dim[1] = a; push(q); dp = q->datap; for(i=0; itype != DA || q->type != DA) error("domino T"); if((p->rank != 1 && p->rank != 2) || q->rank != 2) error("domino C"); m = q->dim[0]; n = q->dim[1]; if(m < n || m != p->dim[0]) error("domino R"); o = 1; if(p->rank == 2) o = p->dim[1]; a = alloc(n*(SINT + SDAT*m + SDAT*3) + SDAT*m); if(a == -1) error("domino M"); dmn = a; dn1 = dmn + m*n; dn2 = dn1 + n; dn3 = dn2 + n; dm = dn3 + n; in = dm + m; d1 = q->datap; for(b=0; bdatap, q->datap); afree(dmn); if(a) error("domino D"); sp--; pop(); push(p); p->dim[0] = n; p->size = n*o; } lsq(dmn, dn1, dn2, dn3, dm, in, m, n, p, d1, d2) data *dmn, *dn1, *dn2, *dn3, *dm; data *d1, *d2; int *in; { register data *dp1, *dp2; double f1, f2, f3, f4; int i, j, k, l; dp1 = dmn; dp2 = dn1; for(j=0; j= 0.) f2 = -f2; dn2[k] = f2; f1 = 1./(f1 - f3*f2); dmn[k*m+k] = f3 - f2; for(j=k+1; j 0.0625*f4) return(1); loop: if(intflg) return(1); dp1 = dn3; dp2 = dn1; for(i=0; i=0; i--) { f1 = -*--dp1; k = (i+1)*m + i; for(j=i+1; j=0; i--) { f1 = -*--dp1; k = (i+1)*m + i; for(j=i+1; jtype!=CH) { if(a->size==0||a->size==1&&fuzz(*a->datap,0.0)==0) { push(newdat(DA,1,0)); switch(inde) { case 1: if(i=ifile) close(i); ifile = 0; return; case 2: case 3: if((i=ofile)&&i!=1) close(i); ofile = 1; return; default: error("mibm D"); } } error("mibm T"); } if(a->rank!=1) error((("dibm R"); if(!(1<=a->size&&a->size<128)) error("fnam L"); fsize = a->size; b = a->datap; a = fname; for(i=0; inxtblk!=-1) { freesum += runthru->size; runthru = runthru->nxtblk; } datum = freesum + runthru->size; } break; case 24: /* starting time */ p = stime; tod: p = localtime(p); datum = 60.*(p[0]+60.*(p[1]+60.*p[2])); break; case 25: /* date */ time(t); p = t; goto dt; /* * non standard I functions */ case 28: /* starting date */ p = stime; dt: p = localtime(p); datum = p[5]+100.*(p[3]+100.*(p[4]+1)); break; case 29: /* iorg */ datum = thread.iorg; break; case 30: /* width */ datum = thread.width; break; case 31: /* digits */ datum = thread.digits; break; case 32: { int shellpid, oldsignal, termproc; oldsignal = signal(2, 1); if(!(shellpid=fork())) execl("/bin/csh","-",0); else while((termproc=wait(&termproc))!=-1) if(termproc==shellpid) break; signal(2, oldsignal); push(newdat(DA,1,0)); return; } } p = newdat(DA, 0, 1); p->datap[0] = datum; push(p); } 29: /* iorg */ datum = thread.iorg; break; case 30: /* width */ datum = thread.width; break; case 31: /* digits */ datum = thread.digits; break; case 32: { int shellpid, oldsignal, termproc; oldsignal = signal(2, 1); if(!(shellpid=fork())) execl("/bin/csh","-",0); else while((termproc=wait(&termproc))!=-1) if(termproc==shellpid) break; signal(2, oldsignal); push(newdat(DA,1,0)); return; } } pcmd/apl/aa.c 644 0 33 3133 2146147365 6107 #include "apl.h" int gdu(); int gdd(); ex_gdu() { register struct item *p; p = fetch1(); gd0(p->rank-1, gdu); } ex_gduk() { register k; k = topfix() - thread.iorg; fetch1(); gd0(k, gdu); } ex_gdd() { register struct item *p; p = fetch1(); gd0(p->rank-1, gdd); } ex_gddk() { register k; k = topfix() - thread.iorg; fetch1(); gd0(k, gdd); } gd0(k, f) int (*f)(); { register struct item *p; int param[2]; int gd1(); bidx(sp[-1]); if(k < 0 || k >= idx.rank) error("grade X"); p = newdat(DA, idx.rank, idx.size); copy(IN, idx.dim, p->dim, idx.rank); push(p); colapse(k); param[0] = alloc(idx.dimk*SINT); param[1] = f; forloop(gd1, param); afree(param[0]); p = sp[-1]; sp--; pop(); push(p); } gd1(param) int param[]; { register struct item *p; register i, *m; integ = access(); m = param[0]; for(i=0; iindex = integ; datum = *m++ + thread.iorg; putdat(p, datum); integ =+ idx.delk; } } gdu(p1, p2) int *p1, *p2; { register struct item *p; data d1, d2; p = sp[-2]; p->index = integ + *p1 * idx.delk; d1 = getdat(p); p->index = integ + *p2 * idx.delk; d2 = getdat(p); if(fuzz(d1, d2) != 0) { if(d1 > d2) return(1); return(-1); } return(*p1 - *p2); } gdd(p1, p2) int *p1, *p2; { register struct item *p; data d1, d2; p = sp[-2]; p->index = integ + *p1 * idx.delk; d1 = getdat(p); p->index = integ + *p2 * idx.delk; d2 = getdat(p); if(fuzz(d1, d2) != 0) { if(d1 > d2) return(-1); return(1); } return(*p1 - *p2); } *p; data d1, d2; p = sp[-2]; p->index = integ + *p1 * idx.delk; d1 = getdat(p); p->index = integ + *p2 * idx.delk; d2 = getdat(p); if(fuzz(d1, d2) != 0) { if(d1 > d2) return(1); return(-1); } return(*p1 - *p2); } gdd(p1, p2) int *p1, *p2; { register struct item *p; data d1, d2; p = sp[-2]; p->index = integ + *p1 * idx.delk; d1 = getdat(p); p->index = integ + *p2 * idx.delk; d2 = getdat(p); cmd/apl/ab.c 644 0 33 4550 2144260605 6103 #include "apl.h" ex_take() { register i, k, o; o = 0; td1(); for(i=0; i 0) o =+ idx.del[i] * k; else k = -k; idx.dim[i] =- k; } map(o); } td1() { register struct item *p; struct item *q; register i, k; p = fetch2(); q = sp[-2]; if(p->rank > 1 || q->rank != p->size) error("take C"); bidx(q); for(i=0; isize; i++) { k = fix(getdat(p)); idx.idx[i] = k; if(k < 0) k = -k; if(k > idx.dim[i]) error("take C"); } pop(); } ex_dtrn() { register struct item *p, *q; register i; p = fetch2(); q = sp[-2]; if(p->rank > 1 || p->size != q->rank) error("tranpose C"); for(i=0; isize; i++) idx.idx[i] = fix(getdat(p)) - thread.iorg; pop(); trn0(); } ex_mtrn() { register struct item *p; register i; p = fetch1(); if(p->rank <= 1) return; for(i=0; irank; i++) idx.idx[i] = i; idx.idx[i-1] = i-2; idx.idx[i-2] = i-1; trn0(); } trn0() { register i, j; int d[MRANK], r[MRANK]; bidx(sp[-1]); for(i=0; i=idx.rank) error("tranpose X"); if(d[j] != -1) { if(idx.dim[i] < d[j]) d[j] = idx.dim[i]; r[j] =+ idx.del[i]; } else { d[j] = idx.dim[i]; r[j] = idx.del[i]; } } j = idx.rank; for(i=0; i j) error("tranpose D"); idx.dim[i] = d[i]; idx.del[i] = r[i]; } else if(i < j) j = i; } idx.rank = j; map(0); } ex_rev0() { fetch1(); revk(0); } ex_revk() { register k; k = topfix() - thread.iorg; fetch1(); revk(k); } ex_rev() { register struct item *p; p = fetch1(); revk(p->rank-1); } revk(k) { register o; bidx(sp[-1]); if(k < 0 || k >= idx.rank) error("reverse X"); o = idx.del[k] * (idx.dim[k]-1); idx.del[k] = -idx.del[k]; map(o); } map(o) { register struct item *p; register n, i; int map1(); n = 1; for(i=0; idim, idx.rank); push(p); forloop(map1, o); sp--; pop(); push(p); } map1(o) { register struct item *p; p = sp[-2]; p->index = access() + o; putdat(sp[-1], getdat(p)); } ) { register o; bidx(sp[-1]); if(k < 0 || k >= idx.rank) error("reverse X"); o = idx.del[k] * (idx.dim[k]-1); idx.del[k] = -idx.del[k]; map(o);cmd/apl/ac.c 644 0 33 1754 2144260607 6111 #include "apl.h" ex_rot0() { fetch2(); rotk(0); } ex_rotk() { register k; k = topfix() - thread.iorg; fetch2(); rotk(k); } ex_rot() { register struct item *p; fetch2(); p = sp[-2]; rotk(p->rank-1); } rotk(k) { register struct item *p, *q; register param; int rot1(); p = sp[-1]; bidx(sp[-2]); if(k < 0 || k >= idx.rank) error("rotate X"); param = 0; colapse(k); if(idx.size != p->size) { if(p->size != 1) error("rotate C"); param++; datum = getdat(p); } p = newdat(idx.type, 1, idx.dimk); push(p); forloop(rot1, param); pop(); pop(); } rot1(param) { register struct item *p, *q; register i; int o, n; if(param == 0) datum = getdat(sp[-2]); o = fix(datum); if(o < 0) o = idx.dimk - (-o % idx.dimk); q = sp[-1]; p = sp[-3]; q->index = 0; n = access(); for(i=0; iindex = n + (o%idx.dimk)*idx.delk; putdat(q, getdat(p)); o++; } for(i=0; iindex = n; putdat(p, getdat(q)); n =+ idx.delk; } } p = newdat(idx.typ((cmd/apl/ad.c 644 0 33 3454 2144260610 6103 #include "apl.h" ex_com0() { fetch2(); comk(0); } ex_comk() { register k; k = topfix() - thread.iorg; fetch2(); comk(k); } ex_com() { register struct item *q; fetch2(); q = sp[-2]; comk(q->rank-1); } comk(k) { register struct item *p; register i; int dk, ndk, com1(); p = sp[-1]; bidx(sp[-2]); if(p->rank==0||p->rank==1&&p->size==1) { if(getdat(p)) { pop(); return; } p = newdat(idx.type, 1, 0); pop(); pop(); push(p); return; } if(k < 0 || k >= idx.rank) error("compress X"); dk = idx.dim[k]; if(p->rank != 1 || p->size != dk) error("compress C"); ndk = 0; for(i=0; idim, idx.rank); p->dim[k] = ndk; push(p); forloop(com1, k); sp--; pop(); pop(); push(p); } com1(k) { register struct item *p; p = sp[-2]; p->index = idx.idx[k]; if(getdat(p)) { p = sp[-3]; p->index = access(); putdat(sp[-1], getdat(p)); } } ex_exd0() { fetch2(); exdk(0); } ex_exdk() { register k; k = topfix() - thread.iorg; fetch2(); exdk(k); } ex_exd() { register struct item *q; fetch2(); q = sp[-2]; exdk(q->rank-1); } exdk(k) { register struct item *p; register i, dk; int exd1(); p = sp[-1]; bidx(sp[-2]); if(k < 0 || k >= idx.rank) error("expand X"); dk = 0; for(i=0; isize; i++) if(getdat(p)) dk++; if(p->rank != 1 || dk != idx.dim[k]) error("expand C"); idx.dim[k] = p->size; size(); p = newdat(idx.type, idx.rank, idx.size); copy(IN, idx.dim, p->dim, idx.rank); push(p); forloop(exd1, k); sp--; pop(); pop(); push(p); } exd1(k) { register struct item *p; p = sp[-2]; p->index = idx.idx[k]; if(getdat(p)) datum = getdat(sp[-3]); else if(idx.type == DA) datum = zero; else datum = ' '; putdat(sp[-1], datum); } "expand X"); dk = 0; for(i=0; isize; i++) if(getdat(p)) dk++; if(p->rank != 1 || dk != idx.dim[k]) error("expand C"); idx.dim[k] = p->size; size(); p = newdat(idx.type, idx.rank, idx.size); copycmd/apl/ae.c 644 0 33 1567 2171211524 6107 #include "apl.h" ex_base() { register struct item *p, *q; int s, s1; data d, d1; double r, b; p = fetch2(); q = sp[-2]; if(p->rank > 1 || q->rank > 1) error("base R"); b = 1.; r = 0.; s = p->size; s1 = q->size; while(s > 0 || s1 > 0) { if(s > 0) { s--; p->index = s; d = getdat(p); } if(s1 > 0) { s1--; q->index = s1; d1 = getdat(q); } r += d1 * b; b *= d; } pop(); pop(); p = newdat(DA, 0, 1); push(p); d = r; putdat(p, d); } ex_rep() { register struct item *p, *q; register s; double a, b, r; p = fetch2(); q = sp[-2]; if(q->size != 1 || p->rank > 1) error("represent R"); r = getdat(q); s = p->size; while(s > 0) { s--; p->index = s; b = getdat(p); if(b == 0.) error("represent D"); r /= b; a = r; r = floor(r); datum = (a - r) * b; p->index = s; putdat(p, datum); } sp--; pop(); push(p); } } r += d1 * b; b *= d; } pop(); pop(); p = newdat(DA, 0, 1); push(p); d = r; putdat(p, d); } ex_rep() { register struct itecmd/apl/af.c 644 0 33 1130 2155374467 6114 #include "apl.h" ex_deal() { register struct item *p; register m, n; double f; data d1, d2; m = topfix(); n = topfix(); if(m < 0 || m > n) error("deal D"); p = newdat(DA, 1, m); datum = thread.iorg; for(; n!=0; n--) { f = m; f /= n; if(rand()/(32768.*32768.*2.) < f) { putdat(p, datum); m--; } datum += one; } m = p->size; while(m > 0) { f = rand()/(32768.*32768.*2.); n = m * f; m--; if(n != m) { p->index = n; d1 = getdat(p); p->index = m; d2 = getdat(p); p->index = n; putdat(p, d2); p->index = m; putdat(p, d1); } } push(p); } d1, d2; m = topfix(); n = topfix(); if(m < 0 || m > n) error("deal D"); p = newdat(DA, 1, m); datum = thread.iorg; for(; n!=0; n--) { f = m; f /= n; if(rand()/(32768.*32768.*2.) < f) { putdat(p, datum); m--; } datum += one; } m = p->size; while(m > 0) { f = rand()/(32768.*32768.*2.); n = m * f; m--; if(n != m) { p->index = n; d1 = getdat(p); p->index = m; d2 = getdat(p); cmd/apl/ag.c 644 0 33 1406 2144260614 6105 #include "apl.h" ex_diot() { register struct item *p, *q, *r; int i, j; p = fetch2(); q = sp[-2]; r = newdat(DA, q->rank, q->size); copy(IN, q->dim, r->dim, q->rank); for(i=0; isize; i++) { datum = getdat(q); p->index = 0; for(j=0; jsize; j++) if(fuzz(getdat(p), datum) == 0) break; datum = j + thread.iorg; putdat(r, datum); } pop(); pop(); push(r); } ex_eps() { register struct item *p, *q, *r; int i, j; data d; p = fetch2(); q = sp[-2]; r = newdat(DA, p->rank, p->size); copy(IN, p->dim, r->dim, p->rank); for(i=0; isize; i++) { datum = getdat(p); d = zero; q->index = 0; for(j=0; jsize; j++) if(fuzz(getdat(q), datum) == 0) { d = one; break; } putdat(r, d); } pop(); pop(); push(r); } j++) if(fuzz(getdat(p), datum) == 0) break; datum = j + thread.iorg; putdat(r, datum); } pop(); pop(); push(r); } ex_eps() { register struct item *p, *q, *r; int i, j; data d; p = fetch2(); q = sp[-2]; r = newdat(DA, p->rank, pcmd/apl/ah.c 644 0 33 6343 2326421115 6110 #include "apl.h" ex_immed() { register i; register struct item *p; register struct nlist *n; double f; i = *pcp++; switch(i) { default: error("immed B"); case APL: setterm(0); return; case ASCII: setterm(1); return; case CSH: system("/bin/csh"); return; case DEBUG: debug = ~debug; return; case DIGITS: i = topfix(); if(i < 1 || i > 20) error("digits D"); aprintf("was %d\n",thread.digits); thread.digits = i; return; case ED_IT: funedit(EDIT_ED); return; case EX_IT: funedit(EDIT_EX); return; case EX_VI: funedit(EDIT_VI); return; case FUZZ: i = topfix(); if(i <= 0) { thread.fuzz = 0.; return; } f = i; thread.fuzz = exp(-f*2.3025851); return; case ORIGIN: aprintf("was %d\n",thread.iorg); thread.iorg = topfix(); return; case WIDTH: i = topfix(); if(i < 1) error("width D"); aprintf("was %d\n",thread.width); thread.width = i; return; case READ: funload(0); return; case ERASE: p = sp[-1]; sp--; erase(p); return; case CONTIN: if((i=creat("continue",0644)) < 0) error("cannot create"); wssave(i); aprintf(" continue"); case OFF: term(); case VARS: for(n=nlist; n->namep; n++) if(n->itemp && n->use == DA) { if(column+8 >= thread.width) aprintf("\n\t"); aprintf(n->namep); aputchar('\t'); } aputchar('\n'); return; /*#ifdef SOMED*/ case SYMBOLS: { int typkey, ii; for(n=nlist; n->namep; n++) { aputchar('\n'); aprintf(n->namep); aprintf(">\n use>\t"); prtype(n->use); aprintf(" type>\t"); prtype(n->type); aprintf(" labl>\t%d\n", n->label); aprintf(" rank>\t%d\n", n->itemp->rank); aprintf(" type>\t"); prtype(n->itemp->type); aprintf(" size>\t%d\n", n->itemp->size); aprintf(" indx>\t%d\n", n->itemp->index); if(n->itemp->datap) aprintf(" ival>\t%d\n", (int)*n->itemp->datap); aprintf(" dims>\n"); for(ii=0; iiitemp->rank; ++ii) aprintf(" ;%d'>\t%d\n",ii,n->itemp->dim[ii]); } } /*#endif*/ case FNS: for(n=nlist; n->namep; n++) if(n->use == DF || n->use == MF || n->use == NF) { if(column+8 >= thread.width) aprintf("\n\t"); aprintf(n->namep); aputchar('\t'); } aputchar('\n'); return; case CLEAR: clear(); aprintf("clear ws\n"); break; case LIB: listdir(); return; case LOAD: funload(2); break; case COPY: funload(1); return; case DROPC: i = 1; goto drcom; case SAVE: i = 0; drcom: n = sp[-1]; sp--; if(n->type != LV) erro((r("save B"); if(i) { unlink(n->namep); return; } i = creat(n->namep,0644); if(i < 0) error("cannot create"); wssave(i); aputchar('\n'); return; } /* special return for after clear */ sp = stack; reset(); } /*#ifdef SOMED*/ prtype(type) { int typkey; #define TYPCASE(type,print) case type: typkey = print; break; switch(type) { default: aprintf("%d\n", type); return; TYPCASE(DA,'da') TYPCASE(CH,'dh') TYPCASE(LV,'lv') TYPCASE(QD,'qd') TYPCASE(QQ,'qq') TYPCASE(IN,'in') TYPCASE(EL,'el') TYPCASE(NF,'nf') TYPCASE(MF,'mf') TYPCASE(DF,'df') TYPCASE(QC,'qc') } aputchar(typkey.c[0]); aputchar(typkey.c[1]); aputchar('\n'); return; } /*#endif*/ (); } /*#ifdef SOMED*/ prtype(type) { int typkey; #define TYPCASE(type,print) case type: typkey = print; break; switch(type) { default: aprintf("%d\n", type); return; TYPCASE(DA,'da') TYPCASE(CH,'dh') TYPCASE(LV,'lv') TYPCASE(QD,'qd') TYPCASE(QQ,cmd/apl/ai.c 644 0 33 12636 2263342006 6134 #include "apl.h" funedit(an_editor) register char *an_editor; { register struct item *p; register f; int a, q; p = sp[-1]; if(p->type != LV) error("ed B"); f = fork(); if(f==0) { for(f=3; f<7; f++) close(f); execl(an_editor+4, an_editor+9, p->namep, 0); execl(an_editor, an_editor+9, p->namep, 0); aprintf("exec failure: "); aprintf(an_editor); exit(0); } if(f==-1) error("try again"); a = signal(2, 1); while((q=wait(&integ))!=f) if(q==-1) break; signal(2, a); funload(0); } funload(s) { register struct item *p; register int *f; p = sp[-1]; sp--; if(p->type != LV) error("fnl B"); f = open(p->namep, 0); if((int)f <= 0) error("cannot open"); switch(s) { case 0: fundef(f); return; case 2: clear(); case 1: wsload(f); aputchar('\n'); } } fundef(f) { short i; register char *a, *c; struct nlist *np; int oifile; long b[256]; char bbuf[BUFSIZ]; oifile = ifile; ifile = f; a = rline(0); if(a == 0) error("fnd eof"); c = compile(a, 2); afree(a); if(c == 0) goto out; copy(IN, c+1, &np, 1); erase(np); np->use = c->c[0]; fstat(wfile, b); np->label = b[4]; lseek(wfile, 0,2); lseek(ifile, 0, 0); while((a=read(ifile, bbuf, BUFSIZ)) > 0) write(wfile, bbuf, a); write(wfile, '\0', 1); out: close(ifile); ifile = oifile; } struct lablist labldefs = { 0, 0, 0 }; funcomp(np) struct nlist *np; { register a, c, *p; int err, size; int oifile; ifile = dup(wfile); lseek(ifile, np->label, 0); size = 0; err = 0; labldefs.nextll = 0; now_xeq.name = np->namep; now_xeq.line = 0; afree(rline(0)); /* Rather inefficient */ pass1A: now_xeq.line = size++; if((a=rline(0))==0) { lseek(ifile, np->label, 0); size = 0; now_xeq.line = -1; goto pass1B; } lablchk(a,size); afree(a); goto pass1A; pass1B: ++now_xeq.line; a = rline(0); if(a == 0) { if(err) goto out; p = alloc((size+2)*SINT); *p = size; size = 0; now_xeq.line = -1; lseek(ifile, np->label, 0); err++; goto pass2; } c = compile(a, size==0? 3: 5); size++; afree(a); if(c == 0) { err++; goto pass1B; } afree(c); goto pass1B; pass2: ++now_xeq.line; a = rline(0); if(a == 0) goto pass3; c = compile(a, size==0? 3: 5); size++; afree(a); if(c == 0) goto out; p[size] = c; goto pass2; pass3: now_xeq.line = 0; lseek(ifile, np->label, 0); a = rline(0); if(a == 0) goto out; c = compile(a, 4); afree(a); if(c == 0) goto out; p[size+1] = c; #ifdef SOMED if(debug) { dump(p[1]); dump(c); } #endif np->itemp = p; err = 0; out: unlabel(); close(ifile); ifile = oifile; if(err) error("syntax"); } lablchk(line,line_no) register char *line; { register struct lablist *lblthru = &labldefs; register char *match; int i, len; match = line; while(*match++==' ') continue; line = --match; if(!alpha(*match++)) return; len = 1; while(alpha(*match)||digit(*match)) ++len, ++match; while(*match++==' ') continue; --match; if(*match++!='>') return; match[-1] = '\0'; while(lblthru->nextll) { if(equal(line,lblthru->lname)) { xeq_mark(); aprintf(lblthru->lname); aprintf("> "); error("dup label"); } lblthru = lblthru->nextll; } lblthru = lblthru->nextll = alloc(sizeof(struct lablist)); lblthru->lno = line_no; lblthru->lname = alloc(match-line); lblthru->nextll = 0; match = line; line = lblthru->lname; for(i=0; ilname); lblthru = lblthru->nextll; } lblthru = &labldefs; while(nextdef=lblthru->nextll) { lblthru = nextdef->nextll; afree(nextdef); if(!lblthru) goto quit; } quit: labldefs.nextll = 0; } ex_fun() { struct nlist *np; register *p, s; int oldflc, oldpcp; pcp += copy(IN, pcp, &np, 1); if(np->itemp == 0) funcomp(np); switch(np->use) { default: error("arg B"); case NF: break; case DF: insulate(-2); case MF: insulate(-1); } p = np->itemp; oldflc = funlc; oldpcp = pcp; funlc = 0; s = *p; loop: funlc++; now_xeq.name = np->namep; now_xeq.line = funlc; execute(p[funlc]); if(intflg) error("I"); if(funlc <= 0 || funlc >= s) { execute(p[s+1]); funlc = oldflc; pcp = oldpcp; now_xeq.name = now_xeq.line = 0; return; } pop(); goto loop; } insulate(arg) { register s, p; p = sp[arg]; switch(p->type) { case DA: case CH: p->index = 0; return; case LV: p = p->itemp; s = newdat(p->type, p->rank, p->size); copy(IN, p->dim, s->dim, p->rank); copy(p->type, p->datap, s->datap, p->size); sp[arg] = s; return; default: error("ins B"); } } ex_arg1() { register struct item *p; struct nlist *np; pcp += copy(IN, pcp, &np, 1); p = fetch1(); sp[-1] = np->itemp; np->itemp = p; np->use = DA; } ex_arg2() { register struct item *p; struct nlist *np; pcp += copy(IN, pcp, &np, 1); p = fetch(sp[-2]); sp[-2] = np->itemp; np->itemp = p; np->use = DA; } ex_auto() { struct nlist *np; pcp += copy(IN, pcp, &np, 1); push(np->itemp); np->itemp = 0; np->use = 0; } ex_rest() { register struct item *p; struct nlist *np; p = fetch1(); pcp += copy(IN, pcp, &np, 1); erase(np); np->itemp = sp[-2]; np->use = 0; if(np->itemp) np->use = DA; sp--; sp[-1] = p; } ex_br0() { funlc = 0; ex_elid(); } ex_br() { register struct item *p; p = fetch1(); if(p->size == 0) return; if(p->size != 1) error("branch C"); funlc = fix(getdat(p)); } DA; } ex_auto() { struct nlist *np; pcp += copy(IN, pcp, &np, 1); push(np->itemp); np->itemcmd/apl/aj.c 644 0 33 6700 2164020144 6104 #include "apl.h" clear() { register struct nlist *n; extern freelist[]; for(n=nlist; n->namep; n++) { n->itemp = 0; n->use = 0; n->namep = 0; } freelist[0] = 0; freelist[1] = -1; /*empty free list*/ /* brk(memstart); /*shrink core*/ stack = sp = 0; Reset(); } lsize(s) char *s; { register short i; register char *p; i=1; p=s; while (*p++) i++; return(i); } isize(ip) struct item *ip; { register struct item *p; register i; p=ip; i=sizeof *p + p->rank*SINT; if(p->type == DA) i += p->size*SDAT; else if(p->type == CH) i += p->size; return(i); } wsload(ffile) { long b [ 256 ]; int ibuf, obuf; char name[NAMS]; short iz; long vmagic[1]; register i; register struct nlist *n; register struct item *p; char ch[1]; iz = 0; ibuf = ffile; /* ibuf[1] = ibuf[2] = 0;*/ /* Check for correct magic number */ read(ibuf,vmagic,4); if(vmagic[0] != (long)MAGIC) { close(ffile); error("not a ws"); } read(ibuf,&thread,sizeof thread); while(read(ibuf,&iz,2) == 2) { i = iz.c[1]; /* read name of vbl or fn */ read(ibuf,name,i); for(n=nlist; n->namep; n++) if(equal(name,n->namep)) { erase(n); goto hokay; } n->namep = alloc(i); copy(CH,name,n->namep,i); hokay: n->use = iz.c[0]; n->type = LV; switch(n->use) { default: close(ffile); error("can not load ws"); case DA: read(ibuf,&iz,2); p=alloc(iz); read(ibuf,p,iz); p->label += ((int)p);/*make absolute*/ n->itemp = p; continue; case NF: case MF: case DF: n->itemp = 0; fstat(obuf=wfile,b); /*obuf[1] = obuf[2] = 0;*/ n->label=b[4]; lseek(wfile,b[4],0); do { read(ibuf,ch,1); write(obuf,ch,1); } while(ch[0] != '\0'); fflush(obuf); } } fdat(ffile); close(ffile); } wssave(ffile) { long vmagic[1]; short iz; int jfile,ibuf, obuf; register struct nlist *n; register i; register struct item *p; char c[1]; ibuf = jfile = dup(wfile); obuf = ffile; /* obuf[1] = obuf[2] = 0; */ vmagic[0] = (long)MAGIC; write(obuf,vmagic,4); /*putw(vmagic, obuf); */ write(obuf,&thread,sizeof thread); for(n=nlist; n->namep; n++) { if(n->use == 0 || (n->use == DA && n->itemp == 0)) continue; iz.c[0] = n->use; i= lsize(n->namep); iz.c[1] = (char)i ; write(obuf,&iz,2); write(obuf,n->namep,i); switch(n->use) { default: close(ffile); close(jfile); error("save B"); case DA: p = n->itemp; i = isize(p); iz = (short) i; p -> label -= ((int)p); write(obuf,&iz,2); write(obuf,p,i); p-((>label += ((int)p); continue; case NF: case MF: case DF: lseek(ibuf,n->label,0); /* ibuf[1] = ibuf[2] = 0; */ do { read(ibuf,c,1); write(obuf,c,1); } while (c[0] != '\0') ; } } fflush(obuf); fdat(ffile); close(ffile); close(jfile); }; listdir() { register f; struct { short in; char nam[14]; } dir; if((f = open(".",0)) < 0) error("directory B"); while(read(f,&dir,sizeof dir) == sizeof dir) if(dir.in != 0 && dir.nam[0] != '.') { if(column+10 >= thread.width){ aprintf("\n\t"); } aprintf(dir.nam); aputchar('\t'); } aputchar('\n'); close(f); } fdat(f) { long b [ 256 ] ; register long *p; fstat(f,b); p = localtime(&b[7]); aprintf(" "); pr2d(p[2]); aputchar('.'); pr2d(p[1]); aputchar('.'); pr2d(p[0]); aputchar(' '); pr2d(p[4]+1); aputchar('/'); pr2d(p[3]); aputchar('/'); pr2d(p[5]); } pr2d(i) long i; { aputchar(i/10+'0'); aputchar(i % 10 + '0'); } of dir) if(dir.in != 0 && dir.nam[0] != '.') { if(column+10cmd/apl/ak.c 644 0 33 3140 2144260623 6106 #include "apl.h" ex_scn0() { fetch1(); scan0(0); } ex_scan() { register struct item *p; p = fetch1(); scan0(p->rank-1); } ex_scnk() { register i; i = topfix() - thread.iorg; scan0(i); } scan0(k) { register struct item *p, *q; int param[2]; int scan1(); p = fetch1(); if(p->type != DA) error("scan T"); bidx(p); colapse(k); if(idx.dimk == 0) { /* * scan identities - ets/jrl 5/76 */ q = newdat(DA,0,1); q->dim[0] = 1; switch(*pcp++) { case ADD: case SUB: case OR: q->datap[0] = 0; break; case AND: case MUL: case DIV: q->datap[0] = 1; break; case MIN: q->datap[0] = 1.0e38; break; case MAX: q->datap[0] = -1.0e38; break; default: error("reduce identity"); } pop(); push(q); return; } param[0] = p->datap; param[1] = exop[*pcp++]; forloop(scan1, param); } scan1(param) int param[]; { register i; register data *dp; data d; data (*f)(); dp = param[0]; f = param[1]; dp =+ access(); d = *dp; for(i = 1; i < idx.dimk; i++) { dp =+ idx.delk; *dp = d = (*f)(*dp, d); } } data scalex 453.; data scaley 453.; data origx 0.0; data origy 0.0; ex_plot() { register struct item *p; register data *dp; register i; int ic; int x, y; p = fetch1(); if(p->type != DA) error("plot T"); if(p->rank != 2) error("plot R"); if(p->dim[1] != 2) error("plot C"); dp = p->datap; if ((i = p->dim[0]) == 0) return; ic=0; while(i--) { x = scalex*(*dp++ - origx); y = 454-(scaley*(*dp++ - origy)); if(x<0 || x >= 576 || y<0 || y>=454) error("plot off screen"); if(ic) line(x,y); else { move(x,y); ic=1; } } } ata origy 0.0; ex_plot() { register struct item *p; register data *dp; register i; int ic; int x, y; p = fetch1(); if(p->type != DA) error("plot T"); if(p->rank != 2) error("plot R"); if(p->dim[1] != 2) error("plot C"); dp = p->datap; if ((i = p->dim[0]) == 0) return; ic=0; while(i--) { x = scalex*(*dp++ - origx); y = 454-(scaley*(*dp++ - origy)); if(x<0 || x >= 576 || y<0 || y>=45cmd/apl/al.c 644 0 33 6337 2167476307 6137 # /* * monadic epsilon and encode /rww */ #include "apl.h" ex_meps() { register struct item *p; register i,j; struct item *mark; char *a,*b,*c; int dim0,dim1; int xpcp; p = fetch1(); if(p->rank>2 || p->type!=CH) error("execute C"); if(!p->size) { pop(); push(newdat(DA,1,0)); return; } b = p->datap; dim0 = p->rank<2 ? 1 : p->dim[0]; dim1 = p->rank<2 ? p->size : p->dim[1]; a = alloc(dim1+1); xpcp = pcp; mark = sp; for(i=0; imark) dealloc(*--sp); pop(); push(newdat(DA,1,0)); } ex_menc() { struct item *p; p = fetch1(); if(p->type == CH) menc0(); else menc1(); } menc0() /* dredge up a function and put it into an array*/ { int oifile; char name[NAMS]; char *c, *c2; struct nlist *np; struct item *p; int len, dim0, dim1; register i; register char *dp; p = fetch1(); if(p->size == 0 || p->rank >1 || p->size >= NAMS) error("menc C"); /* set up the name in search format */ copy(CH, p->datap, name, p->size); name[p->size] = '\0'; /* search for name among the functions */ for(np = nlist; np->namep; np++) if(equal(np->namep,name)) break; /* if not found then domain error */ if(!np->namep) error("menc D"); /* set up new array */ dim0 = 0; dim1 = 0; oifile = ifile; ifile = dup(wfile); lseek(ifile, np->label, 0); /* look up function */ /* compute max width and height */ while(c2 = c = rline(0)) { while(*c2++ != '\n'); dim0++; len = c2 - c - 1; dim1 = dim1 < len ? len : dim1; afree(c); } afree(p); /* release old variable */ /* create new array and put function in */ p = newdat(CH, 2, dim0*dim1); p->rank = 2; p->dim[0] = dim0; p->dim[1] = dim1; dp = p->datap; lseek(ifile, np->label, 0); while(c2 = c = rline(0)) { for(i=0; idatap; /* find the maximum # of chars in any # */ for(i=0; isize; i++) epr1(*dp++, param); numsz = param[1] + param[2] + !!param[2] + param[3] + 1; /* rowsize is max # size x last dim */ rowsz = p->rank ? p->dim[p->rank-1] : 1; rowsz *= numsz; /* row size x # of rows(incl blank)*/ total = p->size * numsz; for(j=i=0; irank; i++) if(p->dim[i] != 1) if(j++ > 1) total =+ rowsz; /* make new data and fill with blanks */ q = newdat(CH, 2, total); q->dim[0] = total/rowsz; q->dim[1] = rowsz; mencptr = q->datap; for(i=0; idatap; /* use putchar()to fill up the array */ mencflg = 2; ex_hprint(); mencflg = 0; /* put it on the stack */ push(q); } *= numsz; /* row size x # of rows(incl blank)*/ total = p->size * numsz; for(j=i=0; irank; i++) if(p->dim[i] != 1) if(j++ > 1) total =+ rowsz; /* make new data and fill with blanks */ q = newdat(CH, 2, total); q->dim[0] = total/rowsz; q->dim[1] = rowsz; mencptrcmd/apl/an.c 644 0 33 1053 2330137366 6116 # #include "apl.h" /* * name line */ char headline[] = { "a p l ? 1 1 `` 1 april 1980 ``\n" }; int cs_size = STKS; /* Current stack size */ newstak() { register struct item **news, **olds; register i; struct item **oldstak; unsignd diff; #ifdef TRACE aprintf("\nnew stack allocated\n"); #endif diff = sp - stack; olds = stack;oldstak = stack; stack = alloc((cs_size+STKS)*sizeof(stack));news = stack; for(i=0; i d2) return(d1); return(d2); } data ex_pwr(d1, d2) data d1, d2; { register s; double f1; s = 0; f1 = d1; if(f1 > 0.) { f1 = d2 * log(f1); goto chk; } if(f1 == 0.) { if(d2 == zero) goto bad; return(zero); } /* should check rational d2 here */ goto bad; chk: if(f1 < maxexp) { d1 = exp(f1); if(s) d1 = -d1; return(d1); } bad: error("pwr D"); } data ex_log(d1, d2) data d1, d2; { double f1, f2; f1 = d1; f2 = d2; if(f1 <= 0. || f2 <= 0.) error("log D"); d1 = log(f2)/log(f1); return(d1); } data ex_cir(d1, d2) data d1, d2; { double f, f1; switch(fix(d1)) { default: error("crc D"); case -7: /* arc tanh */ f = d2; if(f <= -1. || f >= 1.) error("tanh D"); f = log((1.+f)/(1.-f))/2.; goto ret; case -6: /* arc cosh */ f = d2; if(f < 1.) error("cosh D"); f = log(f+sqrt(f*f-1.)); goto ret; case -5: /* arc sinh */ f = d2; f = log(f+sqrt(f*f+1.)); goto ret; case -4: /* sqrt(-1 + x*x) */ f = -one + d2*d2; goto sq; case -3: /* arc tan */ f = d2; f = atan(f); goto ret; case -2: /* arc cos */ f = d2; if(f < -1. || f > 1.) error("arc cos D"); f = atan2(sqrt(1.-f*f), f); goto ret; case -1: /* arc sin */ f = d2; if(f < -1. || f > 1.) error("arc sin D"); f = atan2(f, sqrt(1.-f*f)); goto ret; case 0: /* sqrt(1 - x*x) */ f = one - d2*d2; goto sq; case 1: /* sin */ f = d2; f = sin(f); goto ret; case 2: /* cos */ f = d2; f = cos(f); goto ret; case 3: /* tan */ f = d2; f1 = cos(f); if(f1 == 0.) f = exp(maxexp); else f = sin(f)/f1; goto ret; case 4: /* sqrt(1 + x*x) */ f = one + d2*d2; goto sq; case 5: /* sinh */ f = d2; if(f < -maxexp || f > maxexp) error("sinh D"); f = exp(f); f = (f-1./f)/2.; goto ret; case 6: /* cosh */ f = d2; if(f < -maxexp || f > maxexp) error("cosh D"); f = exp(f); f = (f+1./f)/2.; goto ret; case 7: /* tanh */ f = d2; if(f > maxexp) { f = 1.; goto ret; } if(f < -maxexp) { f = -1.; goto ret; } f = exp(f); f = (f-1./f)/(f+1./f); goto ret; } sq: if(f < 0.) error("sqrt D"); f = sqrt(f); ret: d1 = f; return(d1); } data ex_comb(d1, d2) data d1, d2; { double f; if(d1 > d2) return(zero); f = gamma(d2+1.) - gamma(d1+1.) - gamma(d2-d1+1.); if(f > maxexp) error("comb D"); d1 = exp(f); return(d1); } data ex_and(d1, d2) data d1, d2; { if(d1!=zero && d2!=zero) return(one); return(zero); } data ex_or(d1, d2) data d1, d2; { if(d1!=zero || d2!=zero) return(one); return(zero); } data ex_nand(d1, d2) data d1, d2; { if(d1!=zero && d2!=zero) return(zero); return(one); } data ex_nor(d1, d2) data d1, d2; { if(d1!=zero || d2!=zero) return(zero); return(one); } data ex_lt(d1, d2) data d1, d2; { if(fuzz(d1, d2) < 0) return(one); return(zero); } data ex_le(d1, d2) data d1, d2; { if(fuzz(d1, d2) <= 0) return(one); return(zero); } data ex_eq(d1, d2) data d1, d2; { if(fuzz(d1, d2) == 0) return(one); return(zero); } data ex_ge(d1, d2) data d1, d2; { if(fuzz(d1, d2) >= 0) return(one); return(zero); } data ex_gt(d1, d2) data d1, d2; { if(fuzz(d1, d2) > 0) return(one); return(zero); } data ex_ne(d1, d2) data d1, d2; { if(fuzz(d1, d2) != 0) return(one); return(zero); } data ex_plus(d) data d; { return(d); } data ex_minus(d) data d; { return(-d); } data ex_sgn(d) data d; { if(d == zero) return(zero); if(d < zero) return(-one); return(one); } data ex_recip(d) data d; { if(d == zero) error("recip D"); return(one/d); } data ex_abs(d) data d; { if(d < zero) return(-d); return(d); } data ex_floor(d) data d; { d = floor(d + thread.fuzz); return(d); } data ex_ceil(d) data d; { d = ceil(d - thread.fuzz); return(d); } data ex_exp(d) data d; { double f; f = d; if(f > maxexp) error ("exp D"); d = exp(f); return(d); } data ex_loge(d) data d; { double f; f = d; if(f <= 0.) error("log D"); d = log(f); return(d); } data ex_pi(d) data d; { d = pi * d; return(d); } data ex_rand(d) data d; { double f; f = (rand()/(32768.*32768.*2.)) * d; d = floor(f) + thread.iorg; return(d); } data ex_fac(d) data d; { double f; f = gamma(d+1.); if(f > maxexp) error("fac D"); d = exp(f); if(signgam == -1) d = -d; return(d); } data ex_not(d) data d; { if(d == zero) return(one); return(zero); } return(d)cmd/apl/Makefile 644 0 33 613 2343047732 6776 CFLAGS = -O -w AS = -as OBJS = \ a0.o a1.o a2.o a3.o a4.o a5.o a6.o a7.o a8.o a9.o aa.o ab.o ac.o ad.o\ ae.o af.o ag.o ah.o ai.o aj.o ak.o al.o an.o ao.o aq.o aw.o az.o apl_s.o\ gamma.o apl.o asciiterm.o write2.o write3.o apl: $(OBJS) cc $(OBJS) -lm -o apl apl.o: apl.c tab.c apl.c: apl.y yacc apl.y mv y.tab.c apl.c clean: rm -f apl *.o apl.c install: install -s apl ${DESTDIR}/usr/ucb m == -1) d = -d; retur/,5< /,"cmd/apl/apl.h 644 0 33 11120 2344125255 6314 #include double *test1; double gamma(); /* * A P L */ /* * Magic numbers */ #define OPERBOXSIZE 76 #define MRANK 8 /* Size of dimension buffer */ #define CANBS 300 /* Size of input buffer */ #define STKS 50 /* Size of stack increment */ #define NLS 100 /* Size of namelist */ #define NAMS 24 /* Size of name buffer */ #define OBJS 500 /* Size of compiled expr buffer */ #define MAGIC 0100554 /* Magic word for WS file */ /* * Magic words */ #define EDIT_ED "/usr/bin/ed" #define EDIT_EX "/usr/ucb/ex" #define EDIT_VI "/usr/ucb/vi" /* * Debug modes */ #define FULLD 1 #ifdef FULLD #define SOMED SOMED #endif #ifdef SHORTD #define SOMED SOMED #endif /* * Derived constants */ #define SDAT sizeof datum #define SINT sizeof integ /* * Interpreter Op Codes */ #define EOF (-1) #define EOL 0 #define ADD 1 #define PLUS 2 #define SUB 3 #define MINUS 4 #define MUL 5 #define SGN 6 #define DIV 7 #define RECIP 8 #define MOD 9 #define ABS 10 #define MIN 11 #define FLOOR 12 #define MAX 13 #define CEIL 14 #define PWR 15 #define EXP 16 #define LOG 17 #define LOGE 18 #define CIR 19 #define PI 20 #define COMB 21 #define FAC 22 #define DEAL 23 #define RAND 24 #define DRHO 25 #define MRHO 26 #define DIOT 27 #define MIOT 28 #define ROT0 29 #define REV0 30 #define DTRN 31 #define MTRN 32 #define DIBM 33 #define MIBM 34 #define GDU 35 #define GDUK 36 #define GDD 37 #define GDDK 38 #define EXD 39 #define SCAN 40 #define EXDK 41 #define SCANK 42 #define IPROD 43 #define OPROD 44 #define QUAD 45 #define QQUAD 46 #define BRAN0 47 #define BRAN 48 #define DDOM 49 #define MDOM 50 #define COM 51 #define RED 52 #define COMK 53 #define REDK 54 #define ROT 55 #define REV 56 #define ROTK 57 #define REVK 58 #define CAT 59 #define RAV 60 #define CATK 61 #define RAVK 62 #define PRINT 63 #define QUOT 64 #define ELID 65 #define CQUAD 66 #define COMNT 67 #define INDEX 68 #define HPRINT 69 #define LT 71 #define LE 72 #define GT 73 #define GE 74 #define EQ 75 #define NE 76 #define AND 77 #define OR 78 #define NAND 79 #define NOR 80 #define NOT 81 #define EPS 82 #define MEPS 83 #define REP 84 #define TAKE 85 #define DROP 86 #define ASGN 88 #define IMMED 89 #define NAME 90 #define CONST 91 #define FUN 92 #define ARG1 93 #define ARG2 94 #define AUTO 95 #define REST 96 #define COM0 97 #define RED0 98 #define EXD0 99 #define SCAN0 100 #define BASE 101 #define MENC 102 /* monadic encode */ /* * Immediate sub-op codes */ #define CLEAR 1 #define DIGITS 2 #define ED_IT 3 #define ERASE 4 #define FNS 5 #define FUZZ 6 #define READ 7 #define ORIGIN 8 #define VARS 9 #define WIDTH 10 #define DEBUG 11 #define OFF 12 #define LOAD 13 #define SAVE 14 #define COPY 15 #define CONTIN 16 #define LIB 17 #define DROPC 18 #ifdef SOMED #define SYMBOLS 19 #endif #define EX_IT 20 #define EX_VI 21 #define ASCII 22 #define APL 23 #define CSH 24 /* * Types */ #define DA 1 /* Numeric data (?) */ #define CH 2 /* Character data (?) */ #define LV 3 /* Used for most data items */ #define QD 4 /* Quad (assignment to (?)) */ #define QQ 5 /* Quote-quad */ #define IN 6 /* ??? */ #define EL 7 /* Literal data (??) */ #define NF 8 /* Name of function with no args */ #define MF 9 /* Monadic function */ #define DF 10 /* Dyadic function */ #define QC 11 /* * Idiosyncracies */ #define data double #define unsignd unsigned /* * Structures */ struct { char c[8]; }; struct env { double fuzz; int iorg; int digits; int width; } thread; struct item { char rank; char type; int size; int index; data *datap; int dim[MRANK]; }; struct nlist { char use; char type; /* == LV */ int *itemp; char *namep; int label; } nlist[NLS]; struct lablist { char *lname; int lno; struct lablist *nextll; } labldefs; struct { char rank; char type; int size; int dimk; int delk; int dim[MRANK]; int del[MRANK]; int idx[MRANK]; } idx; struct { char *name; int line; } now_xeq; struct item **sp, **stack, **staktop; /* Internal run-time stack */ /* * Externals */ data zero; data one; data pi; data maxexp; data datum; data getdat();(( int cs_size; /* Current stack size */ int (*exop[])(); double floor(); double ceil(); double log(); double sin(); double cos(); double atan(); double atan2(); double sqrt(); double exp(); double gamma(); double ltod(); int integ; int signgam; int column; int intflg; int echoflg; int ifile; int wfile; int ofile; int funlc; int debug; int ttystat[3]; int stime[2]; char *pcp; int rowsz; int mencflg; char *mencptr; char *memstart; int pt; int syze; int pas1; char *continu; struct charbox { char a1,a2; }; struct asoperbox { unsigned char letters[2]; int returnchar }; double ceil(); double log(); double sin(); double cos(); double atan(); double atan2(); double sqrt(); double exp(); double gamma(); double ltod(); int integ; int signgam; int column; int intflg; int echoflg; int ifile; int wfile; int ofile; int funlc; int debug; int ttystat[3]; int stime[2]; char *pcp; int rowsz; int mencflg; char *mencptr; char *memstart; int pt; int syze; int pas1; char *continu; struct charbox { ccmd/apl/apl.y 644 0 33 12351 2254102164 6336 %term lex0, lex1, lex2, lex3, lex4, lex5, lex6 %term lpar, rpar, lbkt, rbkt, eol, unk %term com, com0, strng, null, dot, cln %term quad, semi, comnt, tran, asg %term nam, numb, nfun, mfun, dfun %term comexpr, comnam, comnull %term dscal, mdscal %term m, d, md %term msub, mdsub, %{ #include "apl.h" int vcount; int scount; int litflag; int nlexsym; int context; unsigned char *iline; char *ccharp; %} %% /* * line-at-a-time APL compiler. * first lexical character gives context. */ line: /* * immediate. */ lex0 stat = { integ = ccharp[-1]; if(integ != ASGN && integ != PRINT) *ccharp++ = PRINT; *ccharp++ = EOL; } | lex0 bcomand comand eol = { *ccharp++ = IMMED; *ccharp++ = $3; } | /* * quad */ lex1 stat | /* * function definition */ lex2 func | /* * function prolog */ lex3 func | /* * function epilog */ lex4 func | /* * function body */ lex5 fstat ; /* * function header */ func: anyname asg header = { switch(context) { case lex3: name($$, AUTO); *ccharp++ = ELID; break; case lex4: integ = ccharp; *ccharp++ = EOL; name($$, NAME); name($$, REST); invert($3, integ); } } | header = { if(context == lex3) *ccharp++ = ELID; } ; header: args autos = { if(context == lex4) invert($$, $2); } ; args: anyname anyname anyname = { $$ = ccharp; switch(context) { case lex2: name($2, DF); break; case lex3: name($1, ARG1); name($3, ARG2); break; case lex4: name($1, REST); name($3, REST); } } | anyname anyname = { $$ = ccharp; switch(context) { case lex2: name($1, MF); break; case lex3: name($2, ARG1); break; case lex4: name($2, REST); } } | anyname = { if(context == lex2) name($$, NF); $$ = ccharp; } ; autos: semi nam autos = { $$ = $3; switch(context) { case lex3: name($2, AUTO); break; case lex4: integ = name($2, REST); invert($$, integ); } } | eol = { $$ = ccharp; } ; /* * system commands */ bcomand: rpar = { litflag = -1; } ; comand: comexpr expr | comnam anyname = { name($2, NAME); } | comnull ; /* * statement: * comments * expressions * heterogeneous output * transfers (in functions) */ fstat: numb cln realfstat = { $$ = $3; } | realfstat = $$ = $1; realfstat: stat | tran eol = { $$ = ccharp; *ccharp++ = BRAN0; } | tran expr eol = { $$ = $2; *ccharp++ = BRAN; } ; stat: statement eol ; statement: comnt = { litflag = 1; $$ = ccharp; *ccharp++ = COMNT; } | expr | hprint ; hprint: expr hsemi output ; output: expr = { *ccharp++ = PRINT; } | hprint ; hsemi: semi = { *ccharp++ = HPRINT; }; expr: e1 | monadic expr = { invert($$, $2); } | e1 dyadic expr = { invert($$, $3); } ; e1: e2 | e2 lsub subs rbkt = { invert($$, $3); *ccharp++ = INDEX; *ccharp++ = scount; scount = $2; } ; e2: nfun = { $$ = name($$, FUN); } | nam = { $$ = name($$, NAME); } | strng = { $$ = ccharp; ccharp += 2; integ = iline[-1]; vcount = 0; for(;;) { if(*iline == '\n') { nlexsym = unk; break; } if(*iline == integ) { iline++; break; } *ccharp++ = *iline++; vcount++; } $$->c[0] = QUOT; $$->c[1] = vcount; } | vector = { *ccharp++ = CONST; *ccharp++ = vcount; invert($$, ccharp-2); } | lpar expr rpar = { $$ = $2; } | quad = { $$ = ccharp; *ccharp++ = $1; } ; vector: number vector = { vcount++; } | number = { vcount = 1; } ; number: numb = { $$ = ccharp; for(integ=0; integnext) != -1) { if (np->size>=size) { if (size+slop >= np->size) { cp->next = np->next; return(&np->next); } cp = cp->next = np+size; cp->size = np->size - size; cp->next = np->next; np->size = size; return(&np->next); } cp = np; } return ( calloc ( 1 , asize ) ); /* asize = size<1024? 1024: size; if ((cp = sbrk(asize)) == -1) { error("workspace exceeded"); } cp->size = asize; free(&cp->next); } } */ afree(aptr) char *aptr; {if ( aptr == 0 ) return; cfree ( aptr ); } /* { register logical ptr; register logical cp; register logical np; ((if (aptr == 0) return; ptr = aptr-4; cp = freelist; while ((np = cp->next) < ptr) cp = np; if (ptr+ptr->size == np) { ptr->size += np->size; ptr->next = np->next; np = ptr; } else ptr->next = np; if (cp+cp->size == ptr) { cp->size += ptr->size; cp->next = ptr->next; } else cp->next = ptr; } */ cp->size = asize; free(&cp->next); } } */ afree(aptr) char *aptr; {if ( aptr == 0 ) return; cfree ( aptr ); } /* { register logical ptr; register logical cp; register logical np; cmd/apl/asciiterm.c 644 0 33 7040 2326377336 7512 #include "apl.h" asciich() { extern unsigned char *iline; extern struct asoperbox charconv[OPERBOXSIZE]; register D,E,F,I; F = *iline++; if ( ( F == '.') && ( digit(*iline) == 0 ) ) { D = (int)*iline++; E = (int)*iline++; for (I = 0; I <= OPERBOXSIZE;I++) { if (( D== (charconv[I].letters[0]) ) && ( E== (charconv[I].letters[1]) ) ) { F = charconv[I].returnchar; goto out; } } --iline;--iline; } out: return(F); }; /* eventually this should be replaces with arrays that hae a better */ /* method of selecting and returning the lexical value, but */ /* for now, this is a quick implementation */ /* */ /* use char as subscript from ascii - get apl character hopefully */ /* for character conversion from ascii to apl char set --- */ /* see files write2.c and write3.c for more recent version */ struct asoperbox charconv[OPERBOXSIZE] = { /* ascii mnemonic ( from HP APL ascii char mnemonics and */ /* equivalent apl character value. */ /* all are two lowercase letters preceeded by a dot. */ /* letters for identifiers are lowercase or uppercase */ /* lowercase corresponding to apl uppercase and */ /* uppercase corresponding to apl underscored letters. */ "sg", /* unary SGN */ '@', "le", /* less than or equal */ '$', "ge", /* greater than or equal*/ '^', "ne", /* not equal */ '*', "om", /* omega ( not used ) */ 'W', "ep", /* epsilon */ 'E', "rh", /* shape (rho) */ 'R', "nt", /* not ( also '~' ) */ 'T', "tk", /* take ( also '^' ) */ 'Y', "dr", /* drop */ 'U', "it", /* iota */ 'I', "ci", /* circular function */ 'O', "al", /* alpha ( not used ) */ 'A', "cl", /* maximum ( ceiling ) */ 'S', "fl", /* minimum ( floor ) */ 'D', "dl", /* del ( not used ) */ 'G', "de", /* upside down del */ 'H', "jt", /* small circle ( null )*/ 'J', "qd", /* quad */ 'L', "ss", /* right U ( not used ) */ 'Z', "sc", /* left U ( not used ) */ 'X', "si", /* Down U */ 'C', "su", /* U ( not used ) */ 'V', "[^", /* upside-down del */ 'H', "bv", /* decode ( base ) */ 'B', "rp", /* encode ( rep ) */ 'N', "br", /* residue ( mod ) */ 'M', "sp", /* assignment */ '[', "go", /* goto */ ']', "or", /* or */ '(', "nn", /* nand */ 0205, "nr", /* nor */ 0206, "lg", /* log */ 0207, "rv", /* reversal */ 0217, "tr", /* transpose */ 0212, "rb", /* reverse bar */ 0214, "cb", /* comma bar ( not used)*/ 0, "sb", /* slash bar */ 0200, "bb", /* blackslash bar */ 0201, "gu", /* grade up */ 0215, "gd", /* grade down */ 0216, "qq", /* quote quad */ 0202, "dm", /* domino */ 0214, "lm", /* lamp */ 0204, "ib", /* i - beam */ 0213, "ex", /* execute ( not used ) */ 0, "fr", /* format( not used ) */ 0, "di", /* diamond ( not used ) */ 0, "ot", /* out ( not used ) */ 0, "ld", /* locked del (not used)*/ 0, "[a", /* alias for 'A' */ 0220, "[b", /* alias for 'B' */ 0221, "[c", /* alias for 'C' */ 0222, "[d", /* alias for 'D' */ 0223, "[e", /* alias for 'E' */ 0224, "[f", /* alias for 'F' */ 0225, "[g", /* alias for 'G' */ 0226, "[h", /* alias for 'H' */ 0227, "[i", /* alias for 'I' */ 0230, "[j", /* alias for 'J' */ 0231, "[k", /* alias for 'K' */ 0232, "[l", /* alias for 'L' */ 0233, "[m", /* alias for 'M' */ 0234, "[n", /* alias for 'N' */ 0235, "[o", /* alias for 'O' */ 0236, "[p", /* alias for 'P' */ 0237, "[q", /* alias for 'Q' */ 0240, "[r", /* alias for 'R' */ 0241, "[s", /* alias for 'S' */ 0242, "[t", /* alias for 'T' */ 0243, "[u", /* alias for 'U' */ 0244, "[v", /* alias for 'V' */ 0245, "[w", /* alias for 'W' */ 0246, "[x", /* alias for 'X' */ 0247, "[y", /* alias for 'Y' */ 0250, "[z", /* alias for 'Z' */ 0251 }; k", /* alias for 'K' */ 0232, "[l", /* alias for 'L' */ 0233, "[m", /* alias for 'M' */ 0234, "[n", /* alias for 'N' */ 0235, "[o", /* alias for 'O' */ 0236, "[p", /* alias for 'P' */ 0237, "[q", /* alias for 'Q' */ 0240, "[r", /* alias for 'R' */ 0241, "[s", /* alias for 'S' */ 0242, "[t", /* alias for 'T' */ 0243, "[u", /* alias for 'U' */ 0244, "[v", /* alias for 'V' */ 0245, "[w", /* alias for 'W' */ 0246, "[x", /* alias for 'X' */ 0247, "[y", /* alias for 'Y' */ 0250, "[cmd/apl/aw.c 644 0 33 5236 2230212626 6126 #include "apl.h" #ifdef FULLD char *opname[] { "eol", /* 0 */ "add", /* 1 */ "plus", /* 2 */ "sub", /* 3 */ "minus", /* 4 */ "mul", /* 5 */ "sgn", /* 6 */ "div", /* 7 */ "recip", /* 8 */ "mod", /* 9 */ "abs", /* 10 */ "min", /* 11 */ "floor", /* 12 */ "max", /* 13 */ "ceil", /* 14 */ "pwr", /* 15 */ "exp", /* 16 */ "log", /* 17 */ "loge", /* 18 */ "cir", /* 19 */ "pi", /* 20 */ "comb", /* 21 */ "fac", /* 22 */ "deal", /* 23 */ "rand", /* 24 */ "drho", /* 25 */ "mrho", /* 26 */ "diot", /* 27 */ "miot", /* 28 */ "rot0", /* 29 */ "rev0", /* 30 */ "dtrn", /* 31 */ "mtrn", /* 32 */ "dibm", /* 33 */ "mibm", /* 34 */ "gdu", /* 35 */ "gduk", /* 36 */ "gdd", /* 37 */ "gddk", /* 38 */ "exd", /* 39 */ "scan", /* 40 */ "exdk", /* 41 */ "scank", /* 42 */ "iprod", /* 43 */ "oprod", /* 44 */ "quad", /* 45 */ "qquad", /* 46 */ "br0", /* 47 */ "br", /* 48 */ "ddom", /* 49 */ "mdom", /* 50 */ "com", /* 51 */ "red", /* 52 */ "comk", /* 53 */ "redk", /* 54 */ "rot", /* 55 */ "rev", /* 56 */ "rotk", /* 57 */ "revk", /* 58 */ "cat", /* 59 */ "rav", /* 60 */ "catk", /* 61 */ "ravk", /* 62 */ "print", /* 63 */ "quot", /* 64 */ "elid", /* 65 */ "cquad", /* 66 */ "comnt", /* 67 */ "index", /* 68 */ "hprint", /* 69 */ 0, /* 70 */ "lt", /* 71 */ "le", /* 72 */ "gt", /* 73 */ "ge", /* 74 */ "eq", /* 75 */ "ne", /* 76 */ "and", /* 77 */ "or", /* 78 */ "nand", /* 79 */ "nor", /* 80 */ "not", /* 81 */ "eps", /* 82 */ "meps", /* 83 */ "rep", /* 84 */ "take", /* 85 */ "drop", /* 86 */ "exd0", /* 87 */ "asgn", /* 88 */ "immed", /* 89 */ "name", /* 90 */ "const", /* 91 */ "fun", /* 92 */ "arg1", /* 93 */ "arg2", /* 94 */ "auto", /* 95 */ "rest", /* 96 */ "com0", /* 97 */ "red0", /* 98 */ "exd0", /* 99 */ "scan0", /*100 */ "base", /*101 */ "menc", /*102 */ /* monadic encode */ "label", /*103 */ }; #endif #ifdef SOMED dump(cp) char *cp; { register char *s, *t; register i; s = cp; loop: putchar(' '); if(column > 50) putchar('\n'); i = *s++; #ifdef FULLD if(i >= 0 && i <= 103 && opname[i]) { t = opname[i]; while(*t) putchar(*t++); } else #endif printf("%d", i); switch(i) { case EOL: if(*s != EOL) break; case EOF: putchar('\n'); return; case QUOT: i = *s++; s =+ i; break; case CONST: i = *s++; s =+ i*SDAT; break; case NAME: case FUN: case ARG1: case ARG2: case AUTO: case REST: s =+ copy(IN, s, &cp, 1); putchar('-'); t = cp->namep; while(*t) putchar(*t++); break; case INDEX: case IMMED: s++; break; } goto loop; } #endif me[i]) { t = opname[i]; while(*t) putchar(*t++); } else #endif printf("%d", i); switch(i) { case EOL: if(*s != EOL) break; case EOF: putchar('\n'); return; case QUOT: i = *s++; s =+ i; break; case CONST: i = *s++; s =+ i*SDAT; break; case NAME: case FUN: case ARG1: case ARG2: case AUTO: case REST: s =+ cocmd/apl/az.c 644 0 33 322 2230220553 6076 /* * This is a dummy plotting function module */ sclr() { error("Unimplemented function 'sclr'"); } move() { error("Unimplemented function 'move'"); } line() { error("Unimplemented function 'line'"); } +); } else #endif printf("%d", i); switch(i) { case EOL: if(*s != EOL) break; case EOF: putchar('\n'); return; case QUOT: i = *s++; s =+ i; break; case CONST: i = *s++; s =+ i*SDAT/,5X< /,"cmd/apl/gamma.c 644 0 33 4027 2230214064 6574 ((/* C program for floating point log gamma function gamma(x) computes the log of the absolute value of the gamma function. The sign of the gamma function is returned in the external quantity signgam. The coefficients for expansion around zero are #5243 from Hart & Cheney; for expansion around infinity they are #5404. Calls log and sin. */ #include #include int errno; int signgam = 0; static double goobie = 0.9189385332046727417803297; static double pi = 3.1415926535897932384626434; #define M 6 #define N 8 static double p1[] = { 0.83333333333333101837e-1, -.277777777735865004e-2, 0.793650576493454e-3, -.5951896861197e-3, 0.83645878922e-3, -.1633436431e-2, }; static double p2[] = { -.42353689509744089647e5, -.20886861789269887364e5, -.87627102978521489560e4, -.20085274013072791214e4, -.43933044406002567613e3, -.50108693752970953015e2, -.67449507245925289918e1, 0.0, }; static double q2[] = { -.42353689509744090010e5, -.29803853309256649932e4, 0.99403074150827709015e4, -.15286072737795220248e4, -.49902852662143904834e3, 0.18949823415702801641e3, -.23081551524580124562e2, 0.10000000000000000000e1, }; double gamma(arg) double arg; { double log(), pos(), neg(), asym(); signgam = 1.; if(arg <= 0.) return(neg(arg)); if(arg > 8.) return(asym(arg)); return(log(pos(arg))); } static double asym(arg) double arg; { double log(); double n, argsq; int i; argsq = 1./(arg*arg); for(n=0,i=M-1; i>=0; i--){ n = n*argsq + p1[i]; } return((arg-.5)*log(arg) - arg + goobie + n/arg); } static double neg(arg) double arg; { double temp; double log(), sin(), pos(); arg = -arg; temp = sin(pi*arg); if(temp == 0.) { errno = EDOM; return(HUGE); } if(temp < 0.) temp = -temp; else signgam = -1; return(-log(arg*pos(arg)*temp/pi)); } static double pos(arg) double arg; { double n, d, s; register i; if(arg < 2.) return(pos(arg+1.)/arg); if(arg > 3.) return((arg-1.)*pos(arg-1.)); s = arg - 2.; for(n=0,d=0,i=N-1; i>=0; i--){ n = n*s + p2[i]; d = d*s + q2[i]; } return(n/d); } tatic double neg(arg) double arg; { double temp; double log(), sin(), pos(); arg = -arg; temp = sin(pi*arg); if(temp == 0.) { errno = EDOM; return(HUGE); } if(temp < 0.) temp = -temp; else signgam = -1; return(-log(arg*pos(arg)*temp/pi)); } static double pos(arg) double arg; { double n, d, s; register i; if(arg < 2.) return(pos(arg+1.)/arg); if(arg > 3.) return((arg-1.)*pos(arg-1.)); s = arg - 2.; for(n=0,d=0,i=N-1; i>=0; i--){ n = n*s + p2[i]; d = d*s + q2[cmd/apl/lex.c 644 0 33 10007 2230205065 6316 #define lv yylval #define v yyval yylex() { register c; register struct tab *tp; extern TERMtype; if(nlexsym != -1) { if (TERMtype == 1) dofix(); /* convert iline */ c = nlexsym; nlexsym = -1; return(c); } while(litflag > 0) { if (TERMtype == 0)c = (int)*iline++; else c = asciich(); if(c == '\n') { nlexsym = 0; return(eol); } } do if (TERMtype == 0)c = (int)*iline++; else c = asciich(); while(c == ' '); if(c == '\n') { nlexsym = 0; return(eol); } if(alpha(c)) return(getnam(c)); if(digit(c) || c == '@' || (c=='.' && digit(*iline))) return(getnum(c)); c &= 0377; for(tp = tab; tp->input; tp++) if(tp->input == c) { lv = tp->lexval; return(tp->retval); } return(unk); } getnam(ic) { char name[NAMS]; register c; register char *cp; register struct nlist *np; cp = name; do { *cp++ = c; if (TERMtype == 0)c = (int)*iline++; else c = asciich(); } while(alpha(c) || digit(c)); *cp++ = 0; iline--; if(litflag < 0) { /* commands */ litflag = 0; for(c=0; comtab[c]; c+=3) if(equal(name, comtab[c])) break; lv = comtab[c+2]; return(comtab[c+1]); } if(a_label(name)){ return(numb); } for(np=nlist; np->namep; np++) if(equal(np->namep, name)) { lv = np; switch(np->use) { case NF: return(nfun); case MF: return(mfun); case DF: return(dfun); } return(nam); } np->namep = alloc(cp-name); copy(CH, name, np->namep, cp-name); np->type = LV; lv = np; return(nam); } a_label(x) register char *x; { register struct lablist *lblthru; lblthru = labldefs.nextll; while(lblthru) { if(equal(lblthru->lname,x)) { datum = (double) lblthru->lno; return(1); } lblthru = lblthru->nextll; } return(0); } getnum(ic) { double d1, d2; register c, n, n1; int s, s1; s = 0; n = 0; d1 = 0.; c = ic; if(c == '@') { s++; if (TERMtype == 0)c = (int)*iline++; else c = asciich(); } while(digit(c)) { d1 = d1*10. + c - '0'; if (TERMtype == 0)c = (int)*iline++; else c = asciich(); } if(c == '.') { if (TERMtype == 0)c = (int)*iline++; else c = asciich(); while(digit(c)) { d1 = d1*10. + c - '0'; if (TERMtype == 0)c = (int)*iline++; else c = asciich(); n--; } } if(c == 'e') { s1 = 0; n1 = 0; if (TERMtype == 0)c = (int)*iline++; else c = asciich(); if(c == '@') { s1++; if (TERMtype == 0)c = (int)*iline++; else c = asciich(); } while(digit(c)) { n1 = n1*10 + c - '0'; if (TERMtype == 0)c = (int)*iline++; else c = asciich(); } if(s1) n -= n1; else n += n1; } n1 = n; if(n1 < 0) n1 = -n1; d2 = 1.; while(n1--) d2 *= 10.; if(n < 0) d1 /= d2; else d1 *= d2; if(s) d1 = -d1; iline--; datum = d1; return(numb); } alpha(s) { register c; c = s & 0377; if(c >= 'a' && c <= 'z') return(1); if(c == 'H') return(1); if(c == 'F') return(1); if(c >= 0220 && c<=0252) return(1); return(0); } digit(s) { register c; c = s; if(c >='0' && c <= '9') return(1); return(0); } /* * s is statement * f is execution flag: * 0 compile immediate * 1 compile L * 2 function definition * 3 function prolog * 4 function epilog * 5 function body */ int ilex[] { lex0, lex1, lex2, lex3, lex4, lex5, lex6 }; compile(s, f) { register char *p, *q; char oline[OBJS]; iline = s; ccharp = oline; litflag = 0; nlexsym = ilex[f]; context = nlexsym; if(yyparse()) { pline(s, iline-s); return(0); } *ccharp++ = EOF; p = alloc(ccharp-oline); iline = p; for(q=oline; q', unk,cln, 0204 , COMNT,comnt, 'C', COMNT,comnt, ']', BRAN0,tran, /* * dyadic scalars * op2 op1 v (dyadic op) */ '#', LT,dscal, '&', GT,dscal, '$', LE,dscal, '^', GE,dscal, '%', EQ,dscal, '*', NE,dscal, ')', AND,dscal, '(', OR,dscal, 0205 , NAND,dscal, 0206 , NOR,dscal, /* * monadic or dyadic scalars * op2 op1 v (dyadic op) * op1 v+1 (monadic op) */ '-', ADD,mdscal, '_', SUB,mdscal, '=', MUL,mdscal, '+', DIV,mdscal, 'M', MOD,mdscal, 'D', MIN,mdscal, 'S', MAX,mdscal, 'P', PWR,mdscal, 0207 , LOG,mdscal, 'O', CIR,mdscal, 0210 , COMB,mdscal, /* * monadic * op1 v (monadic op) */ 'T', NOT,m, /* * dyadic * op2 op1 v (dyadic op) */ 'N', REP,d, 'Y', TAKE,d, 'U', DROP,d, '[', ASGN,asg, /* * monadic or dyadic * op2 op1 v (dyadic op) * op1 v+1 (monadic op) */ 'E', EPS,md, 'B', BASE,md, 'Q', DEAL,md, 'R', DRHO,md, 'I', DIOT,md, 0211 , ROT0,md, 0212 , DTRN,md, 0213 , DIBM,md, 0214 , DDOM,md, /* * monadic with optional subscript * op1 v (monadic op) * op1 sub v+1 (subscripted monadic op) */ 0215 , GDU,msub, 0216 , GDD,msub, /* * dyadic with optional subscript * op2 op1 v (dyadic op) * op2 op1 sub v+1 (subscripted dyadic op) */ /* * monadic or dyadic with optional subscript * op2 op1 v (dyadic op) * op1 v+1 (monadic op) * op2 op1 sub v+2 (subscripted dyadic op) * op1 sub v+3 (subscripted monadic op) */ 0217 , ROT,mdsub, ',', CAT,mdsub, /* * end of list */ 0 }; int comtab[] = { "ascii", comnull, ASCII, "apl", comnull, APL, "clear", comnull, CLEAR, "continue", comnull, CONTIN, "copy", comnam, COPY, "csh", comnull, CSH, "debug", comnull, DEBUG, (("digits", comexpr, DIGITS, "drop", comnam, DROPC, "edit", comnam, ED_IT, "ex", comnam, EX_IT, "erase", comnam, ERASE, "fns", comnull, FNS, "fuzz", comexpr, FUZZ, "lib", comnull, LIB, "load", comnam, LOAD, "off", comnull, OFF, "origin", comexpr, ORIGIN, "read", comnam, READ, "save", comnam, SAVE, "vars", comnull, VARS, "vi", comnam, EX_VI, "width", comexpr, WIDTH, #ifdef SOMED "symbols", comnull, SYMBOLS, #endif 0, unk }; struct charbox chartab[] = { '/','_', '?','_', 'K','L', 'L','O', 'C','J', ')','T', '(','T', 'O','P', '.','K', 'O','_', '?','O', 'B','N', '+','L', 'H','M', 'G','M', 'M','O', 'F','a', 'F','b', 'F','c', 'F','d', 'F','e', 'F','f', 'F','g', 'F','h', 'F','i', 'F','j', 'F','k', 'F','l', 'F','m', 'F','n', 'F','o', 'F','p', 'F','q', 'F','r', 'F','s', 'F','t', 'F','u', 'F','v', 'F','w', 'F','x', 'F','y', 'F','z' }; def SOMED "symbols", comnull, SYMBOLS, #endif 0, unk }; struct charbox chartab[] = { '/','_', '?','_'cmd/apl/write2.c 644 0 33 4073 2167732735 6752 unsigned char changeinput[256] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 136, 65, 61, 126, 43, 41, 75, 58, 34, 80, 45, 44, 95, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 62, 60, 35, 37, 38, 81, 1, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 148, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 59, 63, 39, 89, 91, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 40, 125, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; unsigned char changeoutput[256] = { 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, 84, 31, 32, 33, 41, 60, 34, 61, 62, 93, 124, 38, 42, 37, 44, 43, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 40, 91, 59, 35, 58, 92, 45, 34, 66, 67, 68, 69, 70, 71, 72, 73, 74, 39, 76, 77, 78, 79, 42, 63, 82, 83, 126, 85, 86, 87, 88, 94, 90, 95, 92, 93, 94, 45, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 0, 0, 10, 10, 117, 110, 115, 105, 103, 110, 33, 100, 32, 99, 104, 97, 114, 32, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 0, 10, 125, 59, 0, 10, 10, 10, 117, 110, 115, 105, 103, 110, 101, 100, 32, 99, 104, 97, 114, 32, 99, 104, 97, 110, 103, 101, 111, 117, 116, 112, 117, 116, 91, 50, 53, 54, 93, 32, 61, 32, 123, 10, 0, 9, 37, 100, 0, 10, 0, 125, 59, 10, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 18, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0}; 110, 115, 105, 103, 110, 33, 100, 32, 99, 104, 97, 114, 32, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 0, 10, 125, 59, 0, 10, 10, 10, 117, 110, 115, 105, 103, 110, 101, 100, 32, 99, 104, 97, 114, 32, 99, 104, 97, 110, 103, 101, 111, 117, 116, 112, 117, 116, 91, 50, 53, 54, 93, 32, 61, 32, 123, 10, 0, 9, 37, 100, 0, 10, 0, 125, 59, 10, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 18, cmd/apl/write3.c 644 0 33 440 2166024720 6710 #include "apl.h" dofix() { register unsigned char cha; extern TERMtype; register unsigned char *fixline; extern unsigned char *iline; extern unsigned char changeinput[]; fixline = iline; while ( *fixline != '\0' ) { cha = *fixline; *fixline++ = changeinput[( int )cha]; } } 110, 101, 100, 32, 99, 104, 97, 114, 32, 99, 104, 97, 110, 103, 101, 111, 117, 116, 112, 117, 116, 91, 50, 53, 54, 93, 32, 61, 32/,5< /,"cmd/mip/ 775 0 33 0 2527315141 5300 cmd/mip/INDEX 644 0 33 1110 2333400427 6143 This directory contains the machine independent parts of the portable C compiler. For more explanation of how these files are used, see the "Tour through the Portable C Compiler" in Volume 2 of the UNIX(TM) documentation. The makefile in this directory is useful when makeing a compiler; create a directory, copy the makefile into it, write the machine dependent files, and you are off and running. The file g is a useful aid for finding out when things are used. The pcc command (see the pcc source) uses this makefile and the files in this directory. Lint also uses the files. compiler. For more explanation of how these files are used, see the "Tour through the Portable C Compiler" in Volume 2 of the UNIX(TM) documentation. The makefile in this directory is useful when makeing a compiler; create a directory, copy the makefile into it, write the machine dependent files, and you are off and running. The file g is a useful aid for finding out when things are used. The pcc command (see the pcc source) uses thcmd/mip/allo.c 644 0 33 26141 2416242017 6500 static char *sccsid ="%W% (Berkeley) %G%"; # include "mfile2" NODE resc[3]; int busy[REGSZ]; int maxa, mina, maxb, minb; # ifndef ALLO0 allo0(){ /* free everything */ register i; maxa = maxb = -1; mina = minb = 0; REGLOOP(i){ busy[i] = 0; if( rstatus[i] & STAREG ){ if( maxa<0 ) mina = i; maxa = i; } if( rstatus[i] & STBREG ){ if( maxb<0 ) minb = i; maxb = i; } } } # endif # define TBUSY 01000 # ifndef ALLO allo( p, q ) NODE *p; struct optab *q; { register n, i, j; int either; n = q->needs; either = ( EITHER & n ); i = 0; while( n & NACOUNT ){ resc[i].in.op = REG; resc[i].tn.rval = freereg( p, n&NAMASK ); resc[i].tn.lval = 0; #ifdef FLEXNAMES resc[i].in.name = ""; #else resc[i].in.name[0] = '\0'; #endif n -= NAREG; ++i; } if (either) { /* all or nothing at all */ for( j = 0; j < i; j++ ) if( resc[j].tn.rval < 0 ) { /* nothing */ i = 0; break; } if( i != 0 ) goto ok; /* all */ } while( n & NBCOUNT ){ resc[i].in.op = REG; resc[i].tn.rval = freereg( p, n&NBMASK ); resc[i].tn.lval = 0; #ifdef FLEXNAMES resc[i].in.name = ""; #else resc[i].in.name[0] = '\0'; #endif n -= NBREG; ++i; } if (either) { /* all or nothing at all */ for( j = 0; j < i; j++ ) if( resc[j].tn.rval < 0 ) { /* nothing */ i = 0; break; } if( i != 0 ) goto ok; /* all */ } if( n & NTMASK ){ resc[i].in.op = OREG; resc[i].tn.rval = TMPREG; if( p->in.op == STCALL || p->in.op == STARG || p->in.op == UNARY STCALL || p->in.op == STASG ){ resc[i].tn.lval = freetemp( (SZCHAR*p->stn.stsize + (SZINT-1))/SZINT ); } else { resc[i].tn.lval = freetemp( (n&NTMASK)/NTEMP ); } #ifdef FLEXNAMES resc[i].in.name = ""; #else resc[i].in.name[0] = '\0'; #endif resc[i].tn.lval = BITOOR(resc[i].tn.lval); ++i; } /* turn off "temporarily busy" bit */ ok: REGLOOP(j){ busy[j] &= ~TBUSY; } for( j=0; j1 ){ SETOFF( tmpoff, ALDOUBLE ); } t = tmpoff; tmpoff += k*SZINT; if( tmpoff > maxoff ) maxoff = tmpoff; if( tmpoff >= offsz ) cerror( "stack overflow" ); if( tmpoff-baseoff > maxtemp ) maxtemp = tmpoff-baseoff; return(t); # else tmpoff += k*SZINT; if( k>1 ) { SETOFF( tmpoff, ALDOUBLE );(( } if( tmpoff > maxoff ) maxoff = tmpoff; if( tmpoff >= offsz ) cerror( "stack overflow" ); if( tmpoff-baseoff > maxtemp ) maxtemp = tmpoff-baseoff; return( -tmpoff ); # endif } freereg( p, n ) NODE *p; { /* allocate a register of type n */ /* p gives the type, if floating */ register j; /* not general; means that only one register (the result) OK for call */ if( callop(p->in.op) ){ j = callreg(p); if( usable( p, n, j ) ) return( j ); /* have allocated callreg first */ } j = p->in.rall & ~MUSTDO; if( j!=NOPREF && usable(p,n,j) ){ /* needed and not allocated */ return( j ); } if( n&NAMASK ){ for( j=mina; j<=maxa; ++j ) if( rstatus[j]&STAREG ){ if( usable(p,n,j) ){ return( j ); } } } else if( n &NBMASK ){ for( j=minb; j<=maxb; ++j ) if( rstatus[j]&STBREG ){ if( usable(p,n,j) ){ return(j); } } } return( -1 ); } # ifndef USABLE usable( p, n, r ) NODE *p; { /* decide if register r is usable in tree p to satisfy need n */ /* checks, for the moment */ if( !istreg(r) ) cerror( "usable asked about nontemp register" ); if( busy[r] > 1 ) return(0); if( isbreg(r) ){ if( n&NAMASK ) return(0); } else { if( n & NBMASK ) return(0); } if( (n&NAMASK) && (szty(p->in.type) == 2) ){ /* only do the pairing for real regs */ if( r&01 ) return(0); if( !istreg(r+1) ) return( 0 ); if( busy[r+1] > 1 ) return( 0 ); if( busy[r] == 0 && busy[r+1] == 0 || busy[r+1] == 0 && shareit( p, r, n ) || busy[r] == 0 && shareit( p, r+1, n ) ){ busy[r] |= TBUSY; busy[r+1] |= TBUSY; return(1); } else return(0); } if( busy[r] == 0 ) { busy[r] |= TBUSY; return(1); } /* busy[r] is 1: is there chance for sharing */ return( shareit( p, r, n ) ); } # endif shareit( p, r, n ) NODE *p; { /* can we make register r available by sharing from p given that the need is n */ if( (n&(NASL|NBSL)) && ushare( p, 'L', r ) ) return(1); if( (n&(NASR|NBSR)) && ushare( p, 'R', r ) ) return(1); return(0); } ushare( p, f, r ) NODE *p; { /* can we find a register r to share on the left or right (as f=='L' or 'R', respectively) of p */ p = getlr( p, f ); if( p->in.op == UNARY MUL ) p = p->in.left; if( p->in.op == OREG ){ if( R2TEST(p->tn.rval) ){ return( r==R2UPK1(p->tn.rval) || r==R2UPK2(p->tn.rval) ); } else return( r == p->tn.rval ); } if( p->in.op == REG ){ return( r == p->tn.rval || ( szty(p->in.type) == 2 && r==p->tn.rval+1 ) ); } return(0); } recl2( p ) register NODE *p; { register r = p->tn.rval; #ifndef OLD int op = p->in.op; if (op == REG && r >= REGSZ) op = OREG; if( op == REG ) rfree( r, p->in.type ); else if( op == OREG ) { if( R2TEST( r ) ) { if( R2UPK1( r ) != 100 ) rfree( R2UPK1( r ), PTR+INT ); rfree( R2UPK2( r ), INT ); } else { rfree( r, PTR+INT ); } } #else if( p->in.op == REG ) rfree( r, p->in.type ); else if( p->in.op == OREG ) { if( R2TEST( r ) ) { if( R2UPK1( r ) != 100 ) rfree( R2UPK1( r ), PTR+INT ); rfree( R2UPK2( r ), INT ); } else { rfree( r, PTR+INT ); } } #endif } int rdebug = 0; # ifndef RFREE rfree( r, t ) TWORD t; { /* mark register r free, if it is legal to do so */ /* t is the type */ # ifndef BUG3 if( rdebug ){ printf( "rfree( %s ), size %d\n", rnames[r], szty(t) ); } # endif if( istreg(r) ){ if( --busy[r] < 0 ) cerror( "register overfreed"); if( szty(t) == 2 ){ if( (r&01) || (istreg(r)^istreg(r+1)) ) cerror( "illegal free" ); if( --busy[r+1] < 0 ) cerror( "register overfreed" ); } } } # endif # ifndef RBUSY rbusy(r,t) TWORD t; { /* mark register r busy */ /* t is the type */ # ifndef BUG3 if( rdebug ){ printf( "rbusy( %s ), size %d\n", rnames[r], szty(t) ); } # endif if( istreg(r) ) ++busy[r]; if( szty(t) == 2 ){ if( istreg(r+1) ) ++busy[r+1]; if( (r&01) || (istreg(r)^istreg(r+1)) ) cerror( "illegal register pair freed" ); } } # endif # ifndef BUG3 rwprint( rw ){ /* print rewriting rule */ register i, flag; static char * rwnames[] = { "RLEFT", "RRIGHT", "RESC1", "RESC2", "RESC3", 0, }; if( rw == RNULL ){ printf( "RNULL" ); return; } if( rw == RNOP ){ printf( "RNOP" ); return; } flag = 0; for( i=0; rwnames[i]; ++i ){ if( rw & (1<in.op==FREE && rw==RNULL ) ) return; /* do nothing */ walkf( p, recl2 ); if( callop(p->in.op) ){ /* check that all scratch regs are free */ callchk(p); /* ordinarily, this is the same as allchk() */ } if( rw == RNULL || (cookie&FOREFF) ){ /* totally clobber, leaving nothing */ tfree(p); return; } /* handle condition codes specially */ if( (cookie & FORCC) && (rw&RESCC)) { /* result is CC register */ tfree(p); p->in.op = CCODES; p->tn.lval = 0; p->tn.rval = 0; return; } /* locate results */ qq = recres; if( rw&RLEFT) *qq++ = getlr( p, 'L' );; if( rw&RRIGHT ) *qq++ = getlr( p, 'R' ); if( rw&RESC1 ) *qq++ = &resc[0]; if( rw&RESC2 ) *qq++ = &resc[1]; if( rw&RESC3 ) *qq++ = &resc[2]; if( qq == recres ){ cerror( "illegal reclaim"); } *qq = NIL; /* now, select the best result, based on the cookie */ for( r=respref; r->cform; ++r ){ if( cookie & r->cform ){ for( qq=recres; (q= *qq) != NIL; ++qq ){ if( tshape( q, r->mform ) ) goto gotit; } } } /* we can't do it; die */ cerror( "cannot reclaim"); gotit: if( p->in.op == STARG ) p = p->in.left; /* STARGs are still STARGS */ q->in.type = p->in.type; /* to make multi-register allocations work */ /* maybe there is a better way! */ q = tcopy(q); tfree(p); p->in.op = q->in.op; p->tn.lval = q->tn.lval; p->tn.rval = q->tn.rval; #ifdef FLEXNAMES p->in.name = q->in.name; #ifdef ONEPASS p->in.stalign = q->in.stalign; #endif #else for( i=0; iin.name[i] = q->in.name[i]; #endif q->in.op = FREE; /* if the thing is in a register, adjust the type */ switch( p->in.op ){ case REG: if( !rtyflg ){ /* the C language requires intermediate results to change type */ /* this is inefficient or impossible on some machines */ /* the "T" command in match supresses this type changing */ if( p->in.type == CHAR || p->in.type == SHORT ) p->in.type = INT; else if( p->in.type == UCHAR || p->in.type == USHORT ) p->in.type = UNSIGNED; else if( p->in.type == FLOAT ) p->in.type = DOUBLE; } if( ! (p->in.rall & MUSTDO ) ) return; /* unless necessary, ignore it */ i = p->in.rall & ~MUSTDO; if( i & NOPREF ) return; if( i != p->tn.rval ){ if( busy[i] || ( szty(p->in.type)==2 && busy[i+1] ) ){ cerror( "faulty register move" ); } rbusy( i, p->in.type ); rfree( p->tn.rval, p->in.type ); rmove( i, p->tn.rval, p->in.type ); p->tn.rval = i; } case OREG: if( p->in.op == REG || !R2TEST(p->tn.rval) ) { if( busy[p->tn.rval]>1 && istreg(p->tn.rval) ) cerror( "potential register overwrite"); } else if( (R2UPK1(p->tn.rval) != 100 && busy[R2UPK1(p->tn.rval)]>1 && istreg(R2UPK1(p->tn.rval)) ) || (busy[R2UPK2(p->tn.rval)]>1 && istreg(R2UPK2(p->tn.rval)) ) ) cerror( "potential register overwrite"); } } ncopy( q, p ) NODE *p, *q; { /* copy the contents of p into q, without any feeling for the contents */ /* this code assume that copying rval and lval does the job; in general, it might be necessary to special case the operator types */ register i; q->in.op = p->in.op; q->in.rall = p->in.rall; q->in.type = p->in.type; q->tn.lval = p->tn.lval; q->tn.rval = p->tn.rval; #ifdef FLEXNAMES q->in.name = p->in.name; #ifdef ONEPASS q->in.stalign = p->in.stalign; #endif #else for( i=0; iin.name[i] = p->in.name[i]; #endif } NODE * tcopy( p ) register NODE *p; { /* make a fresh copy of p */ register NODE *q; register r; ncopy( q=talloc(), p ); r = p->tn.rval; if( p->in.op == REG ) rbusy( r, p->in.type ); else if( p->in.op == OREG ) { if( R2TEST(r) ){ if( R2UPK1(r) != 100 ) rbusy( R2UPK1(r), PTR+INT ); rbusy( R2UPK2(r), INT ); } else { rbusy( r, PTR+INT ); } } switch( optype(q->in.op) ){ case BITYPE: q->in.right = tcopy(p->in.right); case UTYPE: q->in.left = tcopy(p->in.left); } return(q); } allchk(){ /* check to ensure that all register are free */ register i; REGLOOP(i){ if( istreg(i) && busy[i] ){ cerror( "register allocation error"); } } } in.type ); else if( p->in.op == OREG ) { if( R2TEST(r) ){ if( R2UPK1(r) != 100 ) rbusy( R2UPK1(r), PTR+INT ); rbusy( R2UPK2(r), INT ); } else { rbusy( r, PTR+INT ); } } switch( optype(q->in.op) ){ case BITYPE: q->in.right = tcopy(p->in.right); case UTYPE: q->in.left = tcopy(p->in.left); } return(q); } allchk(){ /* check to ensure that all register are free */ register i; cmd/mip/cgram.y 644 0 33 51052 2374212231 6665 %term NAME 2 %term STRING 3 %term ICON 4 %term FCON 5 %term PLUS 6 %term MINUS 8 %term MUL 11 %term AND 14 %term OR 17 %term ER 19 %term QUEST 21 %term COLON 22 %term ANDAND 23 %term OROR 24 /* special interfaces for yacc alone */ /* These serve as abbreviations of 2 or more ops: ASOP =, = ops RELOP LE,LT,GE,GT EQUOP EQ,NE DIVOP DIV,MOD SHIFTOP LS,RS ICOP ICR,DECR UNOP NOT,COMPL STROP DOT,STREF */ %term ASOP 25 %term RELOP 26 %term EQUOP 27 %term DIVOP 28 %term SHIFTOP 29(( %term INCOP 30 %term UNOP 31 %term STROP 32 /* reserved words, etc */ %term TYPE 33 %term CLASS 34 %term STRUCT 35 %term RETURN 36 %term GOTO 37 %term IF 38 %term ELSE 39 %term SWITCH 40 %term BREAK 41 %term CONTINUE 42 %term WHILE 43 %term DO 44 %term FOR 45 %term DEFAULT 46 %term CASE 47 %term SIZEOF 48 %term ENUM 49 /* little symbols, etc. */ /* namely, LP ( RP ) LC { RC } LB [ RB ] CM , SM ; */ %term LP 50 %term RP 51 %term LC 52 %term RC 53 %term LB 54 %term RB 55 %term CM 56 %term SM 57 %term ASSIGN 58 /* at last count, there were 7 shift/reduce, 1 reduce/reduce conflicts /* these involved: if/else recognizing functions in various contexts, including declarations error recovery */ %left CM %right ASOP ASSIGN %right QUEST COLON %left OROR %left ANDAND %left OR %left ER %left AND %left EQUOP %left RELOP %left SHIFTOP %left PLUS MINUS %left MUL DIVOP %right UNOP %right INCOP SIZEOF %left LB LP STROP %{ # include "mfile1" %} /* define types */ %start ext_def_list %type con_e ifelprefix ifprefix whprefix forprefix doprefix switchpart enum_head str_head name_lp %type e .e term attributes oattributes type enum_dcl struct_dcl cast_type null_decl funct_idn declarator fdeclarator nfdeclarator elist %token CLASS NAME STRUCT RELOP CM DIVOP PLUS MINUS SHIFTOP MUL AND OR ER ANDAND OROR ASSIGN STROP INCOP UNOP ICON %token TYPE %% %{ static int fake = 0; #ifndef FLEXNAMES static char fakename[NCHNAM+1]; #else static char fakename[24]; #endif %} ext_def_list: ext_def_list external_def | =ftnend(); ; external_def: data_def ={ curclass = SNULL; blevel = 0; } | error ={ curclass = SNULL; blevel = 0; } ; data_def: oattributes SM ={ $1->in.op = FREE; } | oattributes init_dcl_list SM ={ $1->in.op = FREE; } | oattributes fdeclarator { defid( tymerge($1,$2), curclass==STATIC?STATIC:EXTDEF ); #ifndef LINT pfstab(stab[$2->tn.rval].sname); #endif } function_body ={ if( blevel ) cerror( "function level error" ); if( reached ) retstat |= NRETVAL; $1->in.op = FREE; ftnend(); } ; function_body: arg_dcl_list compoundstmt ; arg_dcl_list: arg_dcl_list declaration | ={ blevel = 1; } ; stmt_list: stmt_list statement | /* empty */ ={ bccode(); locctr(PROG); } ; r_dcl_stat_list : dcl_stat_list attributes SM ={ $2->in.op = FREE; #ifndef LINT plcstab(blevel); #endif } | dcl_stat_list attributes init_dcl_list SM ={ $2->in.op = FREE; #ifndef LINT plcstab(blevel); #endif } ; dcl_stat_list : dcl_stat_list attributes SM ={ $2->in.op = FREE; } | dcl_stat_list attributes init_dcl_list SM ={ $2->in.op = FREE; } | /* empty */ ; declaration: attributes declarator_list SM ={ curclass = SNULL; $1->in.op = FREE; } | attributes SM ={ curclass = SNULL; $1->in.op = FREE; } | error SM ={ curclass = SNULL; } ; oattributes: attributes | /* VOID */ ={ $$ = mkty(INT,0,INT); curclass = SNULL; } ; attributes: class type ={ $$ = $2; } | type class | class ={ $$ = mkty(INT,0,INT); } | type ={ curclass = SNULL ; } | type class type ={ $1->in.type = types( $1->in.type, $3->in.type, UNDEF ); $3->in.op = FREE; } ; class: CLASS ={ curclass = $1; } ; type: TYPE | TYPE TYPE ={ $1->in.type = types( $1->in.type, $2->in.type, UNDEF ); $2->in.op = FREE; } | TYPE TYPE TYPE ={ $1->in.type = types( $1->in.type, $2->in.type, $3->in.type ); $2->in.op = $3->in.op = FREE; } | struct_dcl | enum_dcl ; enum_dcl: enum_head LC moe_list optcomma RC ={ $$ = dclstruct($1); } | ENUM NAME ={ $$ = rstruct($2,0); stwart = instruct; } ; enum_head: ENUM ={ $$ = bstruct(-1,0); stwart = SEENAME; } | ENUM NAME ={ $$ = bstruct($2,0); stwart = SEENAME; } ; moe_list: moe | moe_list CM moe ; moe: NAME ={ moedef( $1 ); } | NAME ASSIGN con_e ={ strucoff = $3; moedef( $1 ); } ; struct_dcl: str_head LC type_dcl_list optsemi RC ={ $$ = dclstruct($1); } | STRUCT NAME ={ $$ = rstruct($2,$1); } ; str_head: STRUCT ={ $$ = bstruct(-1,$1); stwart=0; } | STRUCT NAME ={ $$ = bstruct($2,$1); stwart=0; } ; type_dcl_list: type_declaration | type_dcl_list SM type_declaration ; type_declaration: type declarator_list ={ curclass = SNULL; stwart=0; $1->in.op = FREE; } | type ={ if( curclass != MOU ){ curclass = SNULL; } else { sprintf( fakename, "$%dFAKE", fake++ ); #ifdef FLEXSTRINGS /* No need to hash this, we won't look it up */ defid( tymerge($1, bdty(NAME,NIL,lookup( savestr(fakename), SMOS ))), curclass ); #else defid( tymerge($1, bdty(NAME,NIL,lookup( fakename, SMOS ))), curclass ); #endif werror("structure typed union member must be named"); } stwart = 0; $1->in.op = FREE; } ; declarator_list: declarator ={ defid( tymerge($0,$1), curclass); stwart = instruct; } | declarator_list CM {$$=$0;} declarator ={ defid( tymerge($0,$4), curclass); stwart = instruct; } ; declarator: fdeclarator | nfdeclarator | nfdeclarator COLON con_e %prec CM ={ if( !(instruct&INSTRUCT) ) uerror( "field outside of structure" ); if( $3<0 || $3 >= FIELD ){ uerror( "illegal field size" ); $3 = 1; } defid( tymerge($0,$1), FIELD|$3 ); $$ = NIL; } | COLON con_e %prec CM ={ if( !(instruct&INSTRUCT) ) uerror( "field outside of structure" ); falloc( stab, $2, -1, $0 ); /* alignment or hole */ $$ = NIL; } | error ={ $$ = NIL; } ; /* int (a)(); is not a function --- sorry! */ nfdeclarator: MUL nfdeclarator ={ umul: $$ = bdty( UNARY MUL, $2, 0 ); } | nfdeclarator LP RP ={ uftn: $$ = bdty( UNARY CALL, $1, 0 ); } | nfdeclarator LB RB ={ uary: $$ = bdty( LB, $1, 0 ); } | nfdeclarator LB con_e RB ={ bary: if( (int)$3 <= 0 ) werror( "zero or negative subscript" ); $$ = bdty( LB, $1, $3 ); } | NAME ={ $$ = bdty( NAME, NIL, $1 ); } | LP nfdeclarator RP ={ $$=$2; } ; fdeclarator: MUL fdeclarator ={ goto umul; } | fdeclarator LP RP ={ goto uftn; } | fdeclarator LB RB ={ goto uary; } | fdeclarator LB con_e RB ={ goto bary; } | LP fdeclarator RP ={ $$ = $2; } | name_lp name_list RP ={ if( blevel!=0 ) uerror("function declaration in bad context"); $$ = bdty( UNARY CALL, bdty(NAME,NIL,$1), 0 ); stwart = 0; } | name_lp RP ={ $$ = bdty( UNARY CALL, bdty(NAME,NIL,$1), 0 ); stwart = 0; } ; name_lp: NAME LP ={ /* turn off typedefs for argument names */ stwart = SEENAME; if( stab[$1].sclass == SNULL ) stab[$1].stype = FTN; } ; name_list: NAME ={ ftnarg( $1 ); stwart = SEENAME; } | name_list CM NAME ={ ftnarg( $3 ); stwart = SEENAME; } | error ; /* always preceeded by attributes: thus the $0's */ init_dcl_list: init_declarator %prec CM | init_dcl_list CM {$$=$0;} init_declarator ; /* always preceeded by attributes */ xnfdeclarator: nfdeclarator ={ defid( $1 = tymerge($0,$1), curclass); beginit($1->tn.rval); } | error ; /* always preceeded by attributes */ init_declarator: nfdeclarator ={ nidcl( tymerge($0,$1) ); } | fdeclarator ={ defid( tymerge($0,$1), uclass(curclass) ); } | xnfdeclarator optasgn e %prec CM ={ doinit( $3 ); endinit(); } | xnfdeclarator optasgn LC init_list optcomma RC ={ endinit(); } | error ; init_list: initializer %prec CM | init_list CM initializer ; initializer: e %prec CM ={ doinit( $1 ); } | ibrace init_list optcomma RC ={ irbrace(); } ; optcomma : /* VOID */ | CM ; optsemi : /* VOID */ | SM ; optasgn : /* VOID */ ={ werror( "old-fashioned initialization: use =" ); } | ASSIGN ; ibrace : LC ={ ilbrace(); } ; /* STATEMENTS */ compoundstmt: dcmpstmt | cmpstmt ; dcmpstmt: begin r_dcl_stat_list stmt_list RC ={ #ifndef LINT prcstab(blevel); #endif --blevel; if( blevel == 1 ) blevel = 0; clearst( blevel ); checkst( blevel ); autooff = *--psavbc; regvar = *--psavbc; } ; cmpstmt: begin stmt_list RC ={ --blevel; if( blevel == 1 ) blevel = 0; clearst( blevel ); checkst( blevel ); autooff = *--psavbc; regvar = *--psavbc; } ; begin: LC ={ if( blevel == 1 ) dclargs(); ++blevel; if( psavbc > &asavbc[BCSZ-2] ) cerror( "nesting too deep" ); *psavbc++ = regvar; *psavbc++ = autooff; } ; statement: e SM ={ ecomp( $1 ); } | compoundstmt | ifprefix statement ={ deflab($1); reached = 1; } | ifelprefix statement ={ if( $1 != NOLAB ){ deflab( $1 ); reached = 1; } } | whprefix statement ={ branch( contlab ); deflab( brklab ); if( (flostat&FBRK) || !(flostat&FLOOP)) reached = 1; else reached = 0; resetbc(0); } | doprefix statement WHILE LP e RP SM ={ deflab( contlab ); if( flostat & FCONT ) reached = 1; ecomp( buildtree( CBRANCH, buildtree( NOT, $5, NIL ), bcon( $1 ) ) ); deflab( brklab ); reached = 1; resetbc(0); } | forprefix .e RP statement ={ deflab( contlab ); if( flostat&FCONT ) reached = 1; if( $2 ) ecomp( $2 ); branch( $1 ); deflab( brklab ); if( (flostat&FBRK) || !(flostat&FLOOP) ) reached = 1; else reached = 0; resetbc(0); } | switchpart statement ={ if( reached ) branch( brklab ); deflab( $1 ); swend(); deflab(brklab); if( (flostat&FBRK) || !(flostat&FDEF) ) reached = 1; ((resetbc(FCONT); } | BREAK SM ={ if( brklab == NOLAB ) uerror( "illegal break"); else if(reached) branch( brklab ); flostat |= FBRK; if( brkflag ) goto rch; reached = 0; } | CONTINUE SM ={ if( contlab == NOLAB ) uerror( "illegal continue"); else branch( contlab ); flostat |= FCONT; goto rch; } | RETURN SM ={ retstat |= NRETVAL; branch( retlab ); rch: if( !reached ) werror( "statement not reached"); reached = 0; } | RETURN e SM ={ register NODE *temp; idname = curftn; temp = buildtree( NAME, NIL, NIL ); if(temp->in.type == TVOID) uerror("void function %s cannot return value", stab[idname].sname); temp->in.type = DECREF( temp->in.type ); temp = buildtree( RETURN, temp, $2 ); /* now, we have the type of the RHS correct */ temp->in.left->in.op = FREE; temp->in.op = FREE; ecomp( buildtree( FORCE, temp->in.right, NIL ) ); retstat |= RETVAL; branch( retlab ); reached = 0; } | GOTO NAME SM ={ register NODE *q; q = block( FREE, NIL, NIL, INT|ARY, 0, INT ); q->tn.rval = idname = $2; defid( q, ULABEL ); stab[idname].suse = -lineno; branch( stab[idname].offset ); goto rch; } | SM | error SM | error RC | label statement ; label: NAME COLON ={ register NODE *q; q = block( FREE, NIL, NIL, INT|ARY, 0, LABEL ); q->tn.rval = $1; defid( q, LABEL ); reached = 1; } | CASE e COLON ={ addcase($2); reached = 1; } | DEFAULT COLON ={ reached = 1; adddef(); flostat |= FDEF; } ; doprefix: DO ={ savebc(); if( !reached ) werror( "loop not entered at top"); brklab = getlab(); contlab = getlab(); deflab( $$ = getlab() ); reached = 1; } ; ifprefix: IF LP e RP ={ ecomp( buildtree( CBRANCH, $3, bcon( $$=getlab()) ) ) ; reached = 1; } ; ifelprefix: ifprefix statement ELSE ={ if( reached ) branch( $$ = getlab() ); else $$ = NOLAB; deflab( $1 ); reached = 1; } ; whprefix: WHILE LP e RP ={ savebc(); if( !reached ) werror( "loop not entered at top"); if( $3->in.op == ICON && $3->tn.lval != 0 ) flostat = FLOOP; deflab( contlab = getlab() ); reached = 1; brklab = getlab(); if( flostat == FLOOP ) tfree( $3 ); else ecomp( buildtree( CBRANCH, $3, bcon( brklab) ) ); } ; forprefix: FOR LP .e SM .e SM ={ if( $3 ) ecomp( $3 ); else if( !reached ) werror( "loop not entered at top"); savebc(); contlab = getlab(); brklab = getlab(); deflab( $$ = getlab() ); reached = 1; if( $5 ) ecomp( buildtree( CBRANCH, $5, bcon( brklab) ) ); else flostat |= FLOOP; } ; switchpart: SWITCH LP e RP ={ savebc(); brklab = getlab(); ecomp( buildtree( FORCE, $3, NIL ) ); branch( $$ = getlab() ); swstart(); reached = 0; } ; /* EXPRESSIONS */ con_e: { $$=instruct; stwart=instruct=0; } e %prec CM ={ $$ = icons( $2 ); instruct=$1; } ; .e: e | ={ $$=0; } ; elist: e %prec CM | elist CM e ={ goto bop; } ; e: e RELOP e ={ preconf: if( yychar==RELOP||yychar==EQUOP||yychar==AND||yychar==OR||yychar==ER ){ precplaint: if( hflag ) werror( "precedence confusion possible: parenthesize!" ); } bop: $$ = buildtree( $2, $1, $3 ); } | e CM e ={ $2 = COMOP; goto bop; } | e DIVOP e ={ goto bop; } | e PLUS e ={ if(yychar==SHIFTOP) goto precplaint; else goto bop; } | e MINUS e ={ if(yychar==SHIFTOP ) goto precplaint; else goto bop; } | e SHIFTOP e ={ if(yychar==PLUS||yychar==MINUS) goto precplaint; else goto bop; } | e MUL e ={ goto bop; } | e EQUOP e ={ goto preconf; } | e AND e ={ if( yychar==RELOP||yychar==EQUOP ) goto preconf; else goto bop; } | e OR e ={ if(yychar==RELOP||yychar==EQUOP) goto preconf; else goto bop; } | e ER e ={ if(yychar==RELOP||yychar==EQUOP) goto preconf; else goto bop; } | e ANDAND e ={ goto bop; } | e OROR e ={ goto bop; } | e MUL ASSIGN e ={ abop: $$ = buildtree( ASG $2, $1, $4 ); } | e DIVOP ASSIGN e ={ goto abop; } | e PLUS ASSIGN e ={ goto abop; } | e MINUS ASSIGN e ={ goto abop; } | e SHIFTOP ASSIGN e ={ goto abop; } | e AND ASSIGN e ={ goto abop; } | e OR ASSIGN e ={ goto abop; } | e ER ASSIGN e ={ goto abop; } | e QUEST e COLON e ={ $$=buildtree(QUEST, $1, buildtree( COLON, $3, $5 ) ); } | e ASOP e ={ werror( "old-fashioned assignment operator" ); goto bop; } | e ASSIGN e ={ goto bop; } | term ; term: term INCOP ={ $$ = buildtree( $2, $1, bcon(1) ); } | MUL term ={ ubop: $$ = buildtree( UNARY $1, $2, NIL ); } | AND term ={ if( ISFTN($2->in.type) || ISARY($2->in.type) ){ werror( "& before array or function: ignored" ); $$ = $2; } else goto ubop; } | MINUS term ={ goto ubop; } | UNOP term ={ $$ = buildtree( $1, $2, NIL ); } | INCOP term ={ $$ = buildtree( $1==INCR ? ASG PLUS : ASG MINUS, $2, bcon(1) ); } | SIZEOF term ={ $$ = doszof( $2 ); } | LP cast_type RP term %prec INCOP ={ $$ = buildtree( CAST, $2, $4 ); $$->in.left->in.op = FREE; $$->in.op = FREE; $$ = $$->in.right; } | SIZEOF LP cast_type RP %prec SIZEOF ={ $$ = doszof( $3 ); } | term LB e RB ={ $$ = buildtree( UNARY MUL, buildtree( PLUS, $1, $3 ), NIL ); } | funct_idn RP ={ $$=buildtree(UNARY CALL,$1,NIL); } | funct_idn elist RP ={ $$=buildtree(CALL,$1,$2); } | term STROP NAME ={ if( $2 == DOT ){ if( notlval( $1 ) )uerror("structure reference must be addressable"); $1 = buildtree( UNARY AND, $1, NIL ); } idname = $3; $$ = buildtree( STREF, $1, buildtree( NAME, NIL, NIL ) ); } | NAME ={ idname = $1; /* recognize identifiers in initializations */ if( blevel==0 && stab[idname].stype == UNDEF ) { register NODE *q; #ifndef FLEXNAMES werror( "undeclared initializer name %.8s", stab[idname].sname ); #else werror( "undeclared initializer name %s", stab[idname].sname ); #endif q = block( FREE, NIL, NIL, INT, 0, INT ); q->tn.rval = idname; defid( q, EXTERN ); } $$=buildtree(NAME,NIL,NIL); stab[$1].suse = -lineno; } | ICON ={ $$=bcon(0); $$->tn.lval = lastcon; $$->tn.rval = NONAME; if( $1 ) $$->fn.csiz = $$->in.type = ctype(LONG); } | FCON ={ $$=buildtree(FCON,NIL,NIL); $$->fpn.dval = dcon; } | STRING ={ $$ = getstr(); /* get string contents */ } | LP e RP ={ $$=$2; } ; cast_type: type null_decl ={ $$ = tymerge( $1, $2 ); $$->in.op = NAME; $1->in.op = FREE; } ; null_decl: /* empty */ ={ $$ = bdty( NAME, NIL, -1 ); } | LP RP ={ $$ = bdty( UNARY CALL, bdty(NAME,NIL,-1),0); } | LP null_decl RP LP RP ={ $$ = bdty( UNARY CALL, $2, 0 ); } | MUL null_decl ={ goto umul; } | null_decl LB RB ={ goto uary; } | null_decl LB con_e RB ={ goto bary; } | LP null_decl RP ={ $$ = $2; } ; funct_idn: NAME LP ={ if( stab[$1].stype == UNDEF ){ register NODE *q; q = block( FREE, NIL, NIL, FTN|INT, 0, INT ); q->tn.rval = $1; defid( q, EXTERN ); } idname = $1; $$=buildtree(NAME,NIL,NIL); stab[idname].suse = -lineno; } | term LP ; %% NODE * mkty( t, d, s ) unsigned t; { return( block( TYPE, NIL, NIL, t, d, s ) ); } NODE * bdty( op, p, v ) NODE *p; { register NODE *q; q = block( op, p, NIL, INT, 0, INT ); switch( op ){ case UNARY MUL: case UNARY CALL: break; case LB: q->in.right = bcon(v); break; case NAME: q->tn.rval = v; break; default: cerror( "bad bdty" ); } return( q ); } dstash( n ){ /* put n into the dimension table */ if( curdim >= DIMTABSZ-1 ){ cerror( "dimension table overflow"); } dimtab[ curdim++ ] = n; } savebc() { if( psavbc > & asavbc[BCSZ-4 ] ){ cerror( "whiles, fors, etc. too deeply nested"); } *psavbc++ = brklab; *psavbc++ = contlab; *psavbc++ = flostat; *psavbc++ = swx; flostat = 0; } resetbc(mask){ swx = *--psavbc; flostat = *--psavbc | (flostat&mask); contlab = *--psavbc; brklab = *--psavbc; } addcase(p) NODE *p; { /* add case to switch */ p = optim( p ); /* change enum to ints */ if( p->in.op != ICON ){ uerror( "non-constant case expression"); return; } if( swp == swtab ){ uerror( "case not in switch"); return; } if( swp >= &swtab[SWITSZ] ){ cerror( "switch table overflow"); } swp->sval = p->tn.lval; deflab( swp->slab = getlab() ); ++swp; tfree(p); } adddef(){ /* add default case to switch */ if( swtab[swx].slab >= 0 ){ uerror( "duplicate default in switch"); return; } if( swp == swtab ){ uerror( "default not inside switch"); return; } deflab( swtab[swx].slab = getlab() ); } swstart(){ /* begin a switch block */ if( swp >= &swtab[SWITSZ] ){ cerror( "switch table overflow"); } swx = swp - swtab; swp->slab = -1; ++swp; } swend(){ /* end a switch block */ register struct sw *swbeg, *p, *q, *r, *r1; CONSZ temp; int tempi; swbeg = &swtab[swx+1]; /* sort */ r1 = swbeg; r = swp-1; while( swbeg < r ){ /* bubble largest to end */ for( q=swbeg; qsval > (q+1)->sval ){ /* swap */ r1 = q+1; temp = q->sval; q->sval = r1->sval; r1->sval = temp; tempi = q->slab; q->slab = r1->slab; r1->slab = tempi; } } r = r1; r1 = swbeg; } /* it is now sorted */ for( p = swbeg+1; psval == (p-1)->sval ){ uerror( "duplicate case in switch, %d", tempi=p->sval ); return; } } genswitch((( swbeg-1, swp-swbeg ); swp = swbeg-1; } * bubble largest to end */ for( q=swbeg; qsval > (q+1)->sval ){ /* swap */ r1 = q+1; temp = q->sval; q->sval = r1->sval; r1->sval = temp; tempi = q->slab; q->slab = r1->slab; r1->slab = tempi; } } r = r1; r1 = swbeg; } /* it is now sorted */ for( p = swbeg+1; psval == (p-1)->sval ){ uerror( "duplicate case in switch, %d", tempi=p->sval ); return; } } genswitch(cmd/mip/comm1.c 644 0 33 123 2416242034 6514 static char *sccsid ="%W% (Berkeley) %G%"; # include "mfile1" # include "common" ; qsval > (q+1)->sval ){ /* swap */ r1 = q+1; temp = q->sval; q->sval = r1->sval; r1->sval = temp; tempi = q->slab; q->slab = r1->slab; r1->slab = tempi; } } r = r1; r1 = swbeg; } /* it is now sorted */ for( p = swbeg+1; psval == (p-1)->sval ){ /,5< /,"cmd/mip/comm2.c 644 0 33 122 2416242041 6512 static char *sccsid ="%W% (Berkeley) %G%"; # include "mfile2" # include "common" ; qsval > (q+1)->sval ){ /* swap */ r1 = q+1; temp = q->sval; q->sval = r1->sval; r1->sval = temp; tempi = q->slab; q->slab = r1->slab; r1->slab = tempi; } } r = r1; r1 = swbeg; } /* it is now sorted */ for( p = swbeg+1; psval == (p-1)->sval ){ /,5< /,"cmd/mip/common 644 0 33 14620 2404255550 6622 #ifdef FORT #undef BUFSTDERR #endif #ifndef ONEPASS #undef BUFSTDERR #endif # ifndef EXIT # define EXIT exit # endif int nerrors = 0; /* number of errors */ extern unsigned int offsz; unsigned caloff(){ register i; unsigned int temp; unsigned int off; temp = 1; i = 0; do { temp <<= 1; ++i; } while( temp > 0 ); off = 1 << (i-1); return (off); } NODE *lastfree; /* pointer to last free node; (for allocator) */ /* VARARGS1 */ uerror( s, a ) char *s; { /* nonfatal error message */ /* the routine where is different for pass 1 and pass 2; /* it tells where the error took place */ ++nerrors; where('u'); fprintf( stderr, s, a ); fprintf( stderr, "\n" ); #ifdef BUFSTDERR fflush(stderr); #endif if( nerrors > 30 ) cerror( "too many errors"); } /* VARARGS1 */ cerror( s, a, b, c ) char *s; { /* compiler error: die */ where('c'); if( nerrors && nerrors <= 30 ){ /* give the compiler the benefit of the doubt */ fprintf( stderr, "cannot recover from earlier errors: goodbye!\n" ); } else { fprintf( stderr, "compiler error: " ); fprintf( stderr, s, a, b, c ); fprintf( stderr, "\n" ); } #ifdef BUFSTDERR fflush(stderr); #endif EXIT(1); } int Wflag = 0; /* Non-zero means do not print warnings */ /* VARARGS1 */ werror( s, a, b ) char *s; { /* warning */ if(Wflag) return; where('w'); fprintf( stderr, "warning: " ); fprintf( stderr, s, a, b ); fprintf( stderr, "\n" ); #ifdef BUFSTDERR fflush(stderr); #endif } tinit(){ /* initialize expression tree search */ NODE *p; for( p=node; p<= &node[TREESZ-1]; ++p ) p->in.op = FREE; lastfree = node; } # define TNEXT(p) (p== &node[TREESZ-1]?node:p+1) NODE * talloc(){ NODE *p, *q; q = lastfree; for( p = TNEXT(q); p!=q; p= TNEXT(p)) if( p->in.op ==FREE ) return(lastfree=p); cerror( "out of tree space; simplify expression"); /* NOTREACHED */ } tcheck(){ /* ensure that all nodes have been freed */ NODE *p; if( !nerrors ) for( p=node; p<= &node[TREESZ-1]; ++p ) if( p->in.op != FREE ) cerror( "wasted space: %o", p ); tinit(); #ifdef FLEXNAMES freetstr(); #endif } tfree( p ) NODE *p; { /* free the tree p */ extern tfree1(); if( p->in.op != FREE ) walkf( p, tfree1 ); } tfree1(p) NODE *p; { if( p == 0 ) cerror( "freeing blank tree!"); else p->in.op = FREE; } fwalk( t, f, down ) register NODE *t; int (*f)(); { int down1, down2; more: down1 = down2 = 0; (*f)( t, down, &down1, &down2 ); switch( optype( t->in.op ) ){ case BITYPE: fwalk( t->in.left, f, down1 ); t = t->in.right; down = down2; goto more; case UTYPE: t = t->in.left; down = down1; goto more; } } walkf( t, f ) register NODE *t; int (*f)(); { register opty; opty = optype(t->in.op); if( opty != LTYPE ) walkf( t->in.left, f ); if( opty == BITYPE ) walkf( t->in.right, f ); (*f)( t ); } int dope[ DSIZE ]; char *opst[DSIZE]; struct dopest { int dopeop; char opst[8]; int dopeval; } indope[] = { NAME, "NAME", LTYPE, STRING, "STRING", LTYPE, REG, "REG", LTYPE, OREG, "OREG", LTYPE, ICON, "ICON", LTYPE, FCON, "FCON", LTYPE, CCODES, "CCODES", LTYPE, UNARY MINUS, "U-", UTYPE, UNARY MUL, "U*", UTYPE, UNARY AND, "U&", UTYPE, UNARY CALL, "UCALL", UTYPE|CALLFLG, UNARY FORTCALL, "UFCALL", UTYPE|CALLFLG, NOT, "!", UTYPE|LOGFLG, COMPL, "~", UTYPE, FORCE, "FORCE", UTYPE, INIT, "INIT", UTYPE, SCONV, "SCONV", UTYPE, PCONV, "PCONV", UTYPE, PLUS, "+", BITYPE|FLOFLG|SIMPFLG|COMMFLG, ASG PLUS, "+=", BITYPE|ASGFLG|ASGOPFLG|FLOFLG|SIMPFLG|COMMFLG, MINUS, "-", BITYPE|FLOFLG|SIMPFLG, ASG MINUS, "-=", BITYPE|FLOFLG|SIMPFLG|ASGFLG|ASGOPFLG, MUL, "*", BITYPE|FLOFLG|MULFLG, ASG MUL, "*=", BITYPE|FLOFLG|MULFLG|ASGFLG|ASGOPFLG, AND, "&", BITYPE|SIMPFLG|COMMFLG, ASG AND, "&=", BITYPE|SIMPFLG|COMMFLG|ASGFLG|ASGOPFLG, QUEST, "?", BITYPE, COLON, ":", BITYPE, ANDAND, "&&", BITYPE|LOGFLG, OROR, "||", BITYPE|LOGFLG, CM, ",", BITYPE, COMOP, ",OP", BITYPE, ASSIGN, "=", BITYPE|ASGFLG, DIV, "/", BITYPE|FLOFLG|MULFLG|DIVFLG, ASG DIV, "/=", BITYPE|FLOFLG|MULFLG|DIVFLG|ASGFLG|ASGOPFLG, MOD, "%", BITYPE|DIVFLG, ASG MOD, "%=", BITYPE|DIVFLG|ASGFLG|ASGOPFLG, LS, "<<", BITYPE|SHFFLG, ASG LS, "<<=", BITYPE|SHFFLG|ASGFLG|ASGOPFLG, RS, ">>", BITYPE|SHFFLG, ASG RS, ">>=", BITYPE|SHFFLG|ASGFLG|ASGOPFLG, OR, "|", BITYPE|COMMFLG|SIMPFLG, ASG OR, "|=", BITYPE|COMMFLG|SIMPFLG|ASGFLG|ASGOPFLG, ER, "^", BITYPE|COMMFLG|SIMPFLG, ASG ER, "^=", BITYPE|COMMFLG|SIMPFLG|ASGFLG|ASGOPFLG, INCR, "++", BITYPE|ASGFLG, DECR, "--", BITYPE|ASGFLG, STREF, "->", BITYPE, CALL, "CALL", BITYPE|CALLFLG, FORTCALL, "FCALL", BITYPE|CALLFLG, EQ, "==", BITYPE|LOGFLG, NE, "!=", BITYPE|LOGFLG, LE, "<=", BITYPE|LOGFLG, LT, "<", BITYPE|LOGFLG, GE, ">", BITYPE|LOGFLG, GT, ">", BITYPE|LOGFLG, UGT, "UGT", BITYPE|LOGFLG, UGE, "UGE", BITYPE|LOGFLG, ULT, "ULT", BITYPE|LOGFLG, ULE, "ULE", BITYPE|LOGFLG, ARS, "A>>", BITYPE, TYPE, "TYPE", LTYPE, LB, "[", BITYPE, CBRANCH, "CBRANCH", BITYPE, FLD, "FLD", UTYPE, PMCONV, "PMCONV", BITYPE, PVCONV, "PVCONV", BITYPE, RETURN, "RETURN", BITYPE|ASGFLG|ASGOPFLG, CAST, "CAST", BITYPE|ASGFLG|ASGOPFLG, GOTO, "GOTO", UTYPE, STASG, "STASG", BITYPE|ASGFLG, STARG, "STARG", UTYPE, STCALL, "STCALL", BITYPE|CALLFLG, UNARY STCALL, "USTCALL", UTYPE|CALLFLG, -1, 0 }; mkdope(){ register struct dopest *q; for( q = indope; q->dopeop >= 0; ++q ){ dope[q->dopeop] = q->dopeval; opst[q->dopeop] = q->opst; } } # ifndef BUG4 tprint( t ) TWORD t; { /* output a nice description of the type of t */ static char * tnames[] = { "undef", "farg", "char", "short", "int", "long", "float", "double", "strty", "unionty", "enumty", "moety", "uchar", "ushort", "unsigned", "ulong", "?", "?" }; for(;; t = DECREF(t) ){ if( ISPTR(t) ) printf( "PTR " ); else if( ISFTN(t) ) printf( "FTN " ); else if( ISARY(t) ) printf( "ARY " ); else { printf( "%s", tnames[t] ); return; } } } # endif #ifdef FLEXNAMES #define NTSTRBUF 40 #define TSTRSZ 2048 char itstrbuf[TSTRSZ]; char *tstrbuf[NTSTRBUF] = { itstrbuf }; char **curtstr = tstrbuf; int tstrused; char * tstr(cp) register char *cp; { register int i = strlen(cp); register char *dp; if (tstrused + i >= TSTRSZ) { if (++curtstr >= &tstrbuf[NTSTRBUF]) cerror("out of temporary string space"); tstrused = 0; if (*curtstr == 0) { dp = (char *)malloc(TSTRSZ); if (dp == 0) cerror("out of memory (tstr)"); *curtstr = dp; } } strcpy(dp = *curtstr+tstrused, cp); tstrused += i + 1; return (dp); } #endif har *tstrbuf[NTSTRBUF] = { itstrbuf }; char **curtstr = tstrbuf; int tstrused; char * tstr(cp) register char *cmd/mip/convert 644 0 33 6176 2333400454 6775 ((To convert two pass to 1 pass operation: (I suggest that you use a subdirectory, since it is hard to repair some of this damage once done) I assume that you have new copies of the machine-independent files. The file cl is no longer used, and there is no use of lex at all. The file scan.c contains the new lexical analyzer. Moreover, the file comm2.c is no longer used when the passes are loaded together. These changes may affect local procedures for searching, printing, diffing, etc. the compiler. I suggest that you take the makefile in /usr/n as well, to help you along. The conversion process, as well as I understand it is as follows. 1. Make a subdirectory, and put in it the old machine dependent files macdefs, mac2defs, local.c, order.c, code.c, local2.c, and table.c. Put in all the new machine independent stuff, including the new makefile 2. Insert the line # define ONEPASS into macdefs Change LABFMT by deleting the \n. 3. In all the machine dependent source files local.c, code.c, order.c, local2.c, and table.c, remove the includes of manifest and macdefs; these are now included by mfile1 and mfile2. 4. The main routine for pass 2 (probably on local2.c) should be deleted; it probably only does a call to mainp2. If it does anything else of interest, let me know. 5. On the file local.c, in the routine `ecode', replace the lines printf( ".%d\t%s\n", lineno, ftitle ); prtree( p ); by p2tree( p ); p2compile( p ); 6. In code.c, in the function bccode, replace the line printf( "[\t%d\t%d\t%d\t\n", ftnno, XXXX, YYYY ); by p2bbeg( XXXX, YYYY ); Also, in efcode, replace the line which prints out the "]..." with p2bend(); 7. In code.c and local.c, look at all remaining printfs. Lines which go onto the intermediate file all had ")" at the head. All of these must be clobbered. Thus, a line which read printf( ") xxx yyy\n) zzz www\n" ); must be changed to read printf( " xxx yyy\n zzz www\n" ); This is tedious, although a few cleverly chosen ed commands will probably do the trick. 8. Say make, and stand back. The result is a single program called comp. You may experience loading errors as a result of having used the same external names in the first and second pass. Look at the beginning of mfile2 to get a hint about one way to deal with this problem (add stuff to mac2defs to change the names). The other way to deal with it is just fix it... 9. As a side-effect of other changes, the meaning of the arguments to match has changed slightly; ASG OPANY, as it always did, matches any assignment op except ++, --, and = itself. OPANY, on the other hand, matches only ops which are not assignment ops. In table.c, there must be explicit rewriting rule entries for ++, --, and =. In most cases with which I am familiar, this should be true already, and no change is needed. 10. Usage is /lib/cpp x.c | comp which produces assembler output on the std. output. research!/usr/bin/ncc gives the interdata compiler, with many bells and whistles, as a Bourne shell script. regression tests, and checks that this compiler produces the same output as the earlier one, are both wise. Good Luck! are not assignment ops. In table.c, there must be explicit rewriting rule entries for ++, --, and =. In most cases with which I am familiar, this should be true already, and no change is needed. 10. Usage is /lib/cpp x.c | comp which produces assembler output on the std. output. research!/usr/bin/ncc gives the interdata compiler, with many bells and whistles, as a Bourne shell sccmd/mip/fallo.c 644 0 33 41 2416242322 6554 # define FORT # include "allo.c" s that this compiler produces the same output as the earlier one, are both wise. Good Luck! are not assignment ops. In table.c, there must be explicit rewriting rule entries for ++, --, and =. In most cases with which I am familiar, this should be true already, and no change is needed. 10. Usage is /lib/cpp x.c | comp which produces assembler output on the std. output. research!//,5Ȇ< /,"cmd/mip/fcomm2.c 644 0 33 64 2416242326 6653 # define FORT # include "mfile2" # include "common" r produces the same output as the earlier one, are both wise. Good Luck! are not assignment ops. In table.c, there must be explicit rewriting rule entries for ++, --, and =. In most cases with which I am familiar, this should be true already, and no change is needed. 10. Usage is /lib/cpp x.c | comp which produces assembler output on the std. output. research!//,5؆< /,"cmd/mip/fconvert 644 0 33 2016 2333400456 7132 In an attempt to speed up the Fortran 77 compiler, we have provided a new interface between the fortran compiler and the portable C compiler. The intermediate file is binary, and the result is to speed up the execution of Fortran considerably. The changes necessary to make this work are as follows: *** The ONEPASS flag should be off for Fortran; the simplest way of making this happen is to take the line # define ONEPASS on macdefs, and put a # ifndef FORT ... # endif around it. *** The function label from pass 1 must be put in a file, fort.h. Also, a simple function, tlabel, must be written to copy names and make labels. *** The function `where' must be defined, as well as the function main (which was once on local2.c). They can be defined on fort.h, or on local2.c (surrounded by # ifnded ONEPASS and # endif) *** Other things from pass one may have crept into the pass 2 code: they must be also done, either on fort.h or on local2.c surrounded by ifdefs. *** make fort then creates the fortran interface... t be put in a file, fort.h. Also, a simple function, tlabel, must be written to copy names and make labels. *** The function `where' must be defined, as well as the function main (which was once on local2.c). They can be defined on fort.h, or on local2.c (surrounded by # ifnded ONEPASS and # endif) *** Other things from pass one may have crept into the pass 2 code: they must be also done, either on fort.h or on local2.c surrounded by ifdefs. *** make fort then creates the fortran cmd/mip/flocal2.c 644 0 33 67 2416242331 7011 # define FORT # include "local2.c" int ftlab1, ftlab2; mple function, tlabel, must be written to copy names and make labels. *** The function `where' must be defined, as well as the function main (which was once on local2.c). They can be defined on fort.h, or on local2.c (surrounded by # ifnded ONEPASS and # endif) *** Other things from pass one may have crept into the pass 2 code: they must be also done, eith/,5< /,"cmd/mip/fmatch.c 644 0 33 42 2416242336 6727 # define FORT # include "match.c" int ftlab1, ftlab2; mple function, tlabel, must be written to copy names and make labels. *** The function `where' must be defined, as well as the function main (which was once on local2.c). They can be defined on fort.h, or on local2.c (surrounded by # ifnded ONEPASS and # endif) *** Other things from pass one may have crept into the pass 2 code: they must be also done, eith/,5< /,"cmd/mip/forder.c 644 0 33 42 2416242342 6743 ((# define FORT # include "order.c" int ftlab1, ftlab2; mple function, tlabel, must be written to copy names and make labels. *** The function `where' must be defined, as well as the function main (which was once on local2.c). They can be defined on fort.h, or on local2.c (surrounded by # ifnded ONEPASS and # endif) *** Other things from pass one may have crept into the pass 2 code: they must be also done, eith/,5< /,"cmd/mip/fort.c 644 0 33 13456 2416242121 6524 static char *sccsid ="%W% (Berkeley) %G%"; # define FORT /* this forces larger trees, etc. */ # include "mfile2" # include "fort.h" /* masks for unpacking longs */ # ifndef FOP # define FOP(x) (int)((x)&0377) # endif # ifndef VAL # define VAL(x) (int)(((x)>>8)&0377) # endif # ifndef REST # define REST(x) (((x)>>16)&0177777) # endif FILE * lrd; /* for default reading routines */ # ifndef NOLNREAD #ifdef FLEXNAMES char * lnread() { char buf[BUFSIZ]; register char *cp = buf; register char *limit = &buf[BUFSIZ]; for (;;) { if (fread(cp, sizeof (long), 1, lrd) != 1) cerror("intermediate file read error"); cp += sizeof (long); if (cp[-1] == 0) break; if (cp >= limit) cerror("lnread overran string buffer"); } return (tstr(buf)); } # endif NOLNREAD # ifndef NOLREAD long lread(){ static long x; if( fread( (char *) &x, 4, 1, lrd ) <= 0 ) cerror( "intermediate file read error" ); return( x ); } # endif # ifndef NOLOPEN lopen( s ) char *s; { /* if null, opens the standard input */ if( *s ){ lrd = fopen( s, "r" ); if( lrd == NULL ) cerror( "cannot open intermediate file %s", s ); } else lrd = stdin; } # endif # ifndef NOLCREAD lcread( cp, n ) char *cp; { if( n > 0 ){ if( fread( cp, 4, n, lrd ) != n ) cerror( "intermediate file read error" ); } } # endif # ifndef NOLCCOPY lccopy( n ) register n; { register i; static char fbuf[128]; if( n > 0 ){ if( n > 32 ) cerror( "lccopy asked to copy too much" ); if( fread( fbuf, 4, n, lrd ) != n ) cerror( "intermediate file read error" ); for( i=4*n; fbuf[i-1] == '\0' && i>0; --i ) { /* VOID */ } if( i ) { if( fwrite( fbuf, 1, i, stdout ) != i ) cerror( "output file error" ); } } } # endif /* new opcode definitions */ # define FORTOPS 200 # define FTEXT 200 # define FEXPR 201 # define FSWITCH 202 # define FLBRAC 203 # define FRBRAC 204 # define FEOF 205 # define FARIF 206 # define LABEL 207 /* stack for reading nodes in postfix form */ # define NSTACKSZ 250 NODE * fstack[NSTACKSZ]; NODE ** fsp; /* points to next free position on the stack */ unsigned int offsz; unsigned int caloff(); mainp2( argc, argv ) char *argv[]; { int files; register long x; register NODE *p; offsz = caloff(); files = p2init( argc, argv ); tinit(); if( files ){ while( files < argc && argv[files][0] == '-' ) { ++files; } if( files > argc ) return( nerrors ); lopen( argv[files] ); } else lopen( "" ); fsp = fstack; for(;;){ /* read nodes, and go to work... */ x = lread(); if( xdebug ) fprintf( stderr, "op=%d, val = %d, rest = 0%o\n", FOP(x), VAL(x), (int)REST(x) ); switch( (int)FOP(x) ){ /* switch on opcode */ case 0: fprintf( stderr, "null opcode ignored\n" ); continue; case FTEXT: lccopy( VAL(x) ); printf( "\n" ); continue; case FLBRAC: tmpoff = baseoff = lread(); maxtreg = VAL(x); if( ftnno != REST(x) ){ /* beginning of function */ maxoff = baseoff; ftnno = REST(x); maxtemp = 0; } else { if( baseoff > maxoff ) maxoff = baseoff; /* maxoff at end of ftn is max of autos and temps over all blocks in the function */ } setregs(); continue; case FRBRAC: SETOFF( maxoff, ALSTACK ); eobl2(); continue; case FEOF: return( nerrors ); case FSWITCH: uerror( "switch not yet done" ); for( x=VAL(x); x>0; --x ) lread(); continue; case ICON: p = talloc(); p->in.op = ICON; p->in.type = REST(x); p->tn.rval = 0; p->tn.lval = lread(); if( VAL(x) ){ #ifndef FLEXNAMES lcread( p->in.name, 2 ); #else p->in.name = lnread(); #endif } #ifndef FLEXNAMES else p->in.name[0] = '\0'; #else else p->in.name = ""; #endif bump: p->in.su = 0; p->in.rall = NOPREF; *fsp++ = p; if( fsp >= &fstack[NSTACKSZ] ) uerror( "expression depth exceeded" ); continue; case NAME: p = talloc(); p->in.op = NAME; p->in.type = REST(x); p->tn.rval = 0; if( VAL(x) ) p->tn.lval = lread(); else p->tn.lval = 0; #ifndef FLEXNAMES lcread( p->in.name, 2 ); #else p->in.name = lnread(); #endif goto bump; case OREG: p = talloc(); p->in.op = OREG; p->in.type = REST(x); p->tn.rval = VAL(x); p->tn.lval = lread(); #ifndef FLEXNAMES lcread( p->in.name, 2 ); #else p->in.name = lnread(); #endif goto bump; case REG: p = talloc(); p->in.op = REG; p->in.type = REST(x); p->tn.rval = VAL(x); rbusy( p->tn.rval, p->in.type ); p->tn.lval = 0; #ifndef FLEXNAMES p->in.name[0] = '\0'; #else p->in.name = ""; #endif goto bump; case FEXPR: lineno = REST(x); if( VAL(x) ) lcread( filename, VAL(x) ); if( fsp == fstack ) continue; /* filename only */ if( --fsp != fstack ) uerror( "expression poorly formed" ); if( lflag ) lineid( lineno, filename ); tmpoff = baseoff; p = fstack[0]; if( edebug ) fwalk( p, eprint, 0 ); # ifdef MYREADER MYREADER(p); # endif nrecur = 0; delay( p ); reclaim( p, RNULL, 0 ); allchk(); tcheck(); continue; case LABEL: if( VAL(x) ){ tlabel(); } else { label( (int) REST(x) ); } continue; case GOTO: if( VAL(x) ) { cbgen( 0, (int) REST(x), 'I' ); /* unconditional branch */ continue; } /* otherwise, treat as unary */ goto def; case STASG: case STARG: case STCALL: case UNARY STCALL: /* * size and alignment come from next long words */ p = talloc(); p -> stn.stsize = lread(); p -> stn.stalign = lread(); goto defa; default: def: p = talloc(); defa: p->in.op = FOP(x); p->in.type = REST(x); switch( optype( p->in.op ) ){ case BITYPE: p->in.right = *--fsp; p->in.left = *--fsp; goto bump; case UTYPE: p->in.left = *--fsp; p->tn.rval = 0; goto bump; case LTYPE: uerror( "illegal leaf node: %d", p->in.op ); exit( 1 ); } } } } t come from next long words */ p = talloc(); p -> stn.stsize = lread(); p -> stn.stalign = lread(); goto defa; default: def: p = talloc(); defa: p->in.op = FOP(x); p->in.type cmd/mip/freader.c 644 0 33 63 2333400460 7070 # define FORT # define NOMAIN # include "reader.c" se BITYPE: p->in.right = *--fsp; p->in.left = *--fsp; goto bump; case UTYPE: p->in.left = *--fsp; p->tn.rval = 0; goto bump; case LTYPE: uerror( "illegal leaf node: %d", p->in.op ); exit( 1 ); } } } } t come from next long words */ p = talloc(); p -> stn.stsize = lread(); p -> stn.stalign = lread(); /,58< /,"cmd/mip/ftable.c 644 0 33 42 2333400460 6712 # define FORT # include "table.c" clude "reader.c" se BITYPE: p->in.right = *--fsp; p->in.left = *--fsp; goto bump; case UTYPE: p->in.left = *--fsp; p->tn.rval = 0; goto bump; case LTYPE: uerror( "illegal leaf node: %d", p->in.op ); exit( 1 ); } } } } t come from next long words */ p = talloc(); p -> stn.stsize = lread(); p -> stn.stalign = lread(); /,5H< /,"cmd/mip/manifest 644 0 33 14411 2443265645 7147 # include /* manifest constant file for the lex/yacc interface */ # define ERROR 1 # define NAME 2 # define STRING 3 # define ICON 4 # define FCON 5 # define PLUS 6 # define MINUS 8 # define MUL 11 # define AND 14 # define OR 17 # define ER 19 # define QUEST 21 # define COLON 22 # define ANDAND 23 # define OROR 24 /* the defines for ASOP, RELOP, EQUOP, DIVOP, SHIFTOP, ICOP, UNOP, and STROP have been moved to mfile1 */ /* reserved words, etc */ # define TYPE 33 # define CLASS 34 # defin((e STRUCT 35 # define RETURN 36 # define GOTO 37 # define IF 38 # define ELSE 39 # define SWITCH 40 # define BREAK 41 # define CONTINUE 42 # define WHILE 43 # define DO 44 # define FOR 45 # define DEFAULT 46 # define CASE 47 # define SIZEOF 48 # define ENUM 49 /* little symbols, etc. */ /* namely, LP ( RP ) LC { RC } LB [ RB ] CM , SM ; */ /* These defines are being moved to mfile1 to alleviate preprocessor problems with second pass files. # define LP 50 # define RP 51 # define LC 52 # define RC 53 */ # define LB 54 # define RB 55 # define CM 56 # define SM 57 # define ASSIGN 58 /* END OF YACC */ /* left over tree building operators */ # define COMOP 59 # define DIV 60 # define MOD 62 # define LS 64 # define RS 66 # define DOT 68 # define STREF 69 # define CALL 70 # define FORTCALL 73 # define NOT 76 # define COMPL 77 # define INCR 78 # define DECR 79 # define EQ 80 # define NE 81 # define LE 82 # define LT 83 # define GE 84 # define GT 85 # define ULE 86 # define ULT 87 # define UGE 88 # define UGT 89 # define SETBIT 90 # define TESTBIT 91 # define RESETBIT 92 # define ARS 93 # define REG 94 # define OREG 95 # define CCODES 96 # define FREE 97 # define STASG 98 # define STARG 99 # define STCALL 100 /* some conversion operators */ # define FLD 103 # define SCONV 104 # define PCONV 105 # define PMCONV 106 # define PVCONV 107 /* special node operators, used for special contexts */ # define FORCE 108 # define CBRANCH 109 # define INIT 110 # define CAST 111 /* node types */ # define LTYPE 02 # define UTYPE 04 # define BITYPE 010 /* DSIZE is the size of the dope array */ # define DSIZE CAST+1 /* type names, used in symbol table building */ # define TNULL PTR /* pointer to UNDEF */ # define TVOID FTN /* function returning UNDEF (for void) */ # define UNDEF 0 # define FARG 1 # define CHAR 2 # define SHORT 3 # define INT 4 # define LONG 5 # define FLOAT 6 # define DOUBLE 7 # define STRTY 8 # define UNIONTY 9 # define ENUMTY 10 # define MOETY 11 # define UCHAR 12 # define USHORT 13 # define UNSIGNED 14 # define ULONG 15 # define ASG 1+ # define UNARY 2+ # define NOASG (-1)+ # define NOUNARY (-2)+ /* various flags */ # define NOLAB (-1) /* type modifiers */ # define PTR 020 # define FTN 040 # define ARY 060 /* type packing constants */ # define TMASK 060 # define TMASK1 0300 # define TMASK2 0360 # define BTMASK 017 # define BTSHIFT 4 # define TSHIFT 2 /* macros */ # define MODTYPE(x,y) x = ( (x)&(~BTMASK))|(y) /* set basic type of x to y */ # define BTYPE(x) ( (x)&BTMASK) /* basic type of x */ # define ISUNSIGNED(x) ((x)<=ULONG&&(x)>=UCHAR) # define UNSIGNABLE(x) ((x)<=LONG&&(x)>=CHAR) # define ENUNSIGN(x) ((x)+(UNSIGNED-INT)) # define DEUNSIGN(x) ((x)+(INT-UNSIGNED)) # define ISPTR(x) (( (x)&TMASK)==PTR) # define ISFTN(x) (( (x)&TMASK)==FTN) /* is x a function type */ # define ISARY(x) (( (x)&TMASK)==ARY) /* is x an array type */ # define INCREF(x) ((( (x)&~BTMASK)<>TSHIFT)&~BTMASK)|( (x)&BTMASK)) # define SETOFF(x,y) if( (x)%(y) != 0 ) (x) = ( ((x)/(y) + 1) * (y)) /* advance x to a multiple of y */ # define NOFIT(x,y,z) ( ( (x)%(z) + (y) ) > (z) ) /* can y bits be added to x without overflowing z */ /* pack and unpack field descriptors (size and offset) */ # define PKFIELD(s,o) (( (o)<<6)| (s) ) # define UPKFSZ(v) ( (v) &077) # define UPKFOFF(v) ( (v) >>6) /* operator information */ # define TYFLG 016 # define ASGFLG 01 # define LOGFLG 020 # define SIMPFLG 040 # define COMMFLG 0100 # define DIVFLG 0200 # define FLOFLG 0400 # define LTYFLG 01000 # define CALLFLG 02000 # define MULFLG 04000 # define SHFFLG 010000 # define ASGOPFLG 020000 # define SPFLG 040000 #define optype(o) (dope[o]&TYFLG) #define asgop(o) (dope[o]&ASGFLG) #define logop(o) (dope[o]&LOGFLG) #define callop(o) (dope[o]&CALLFLG) /* table sizes */ # ifndef FORT # define TREESZ 350 /* space for building parse tree */ # else # define TREESZ 1000 # endif #ifndef FLEXNAMES # define NCHNAM 8 /* number of characters in a name */ #else char *hash(); char *savestr(); char *tstr(); extern int tstrused; extern char *tstrbuf[], **curtstr; #define freetstr() curtstr = tstrbuf, tstrused = 0 #endif /* common defined variables */ extern int nerrors; /* number of errors seen so far */ typedef union ndu NODE; typedef unsigned int TWORD; # define NIL (NODE *)0 extern int dope[]; /* a vector containing operator information */ extern char *opst[]; /* a vector containing names for ops */ # ifdef ONEPASS /* in one-pass operation, define the tree nodes */ union ndu { struct { int op; int rall; TWORD type; int su; #ifndef FLEXNAMES char name[NCHNAM]; #else char *name; int stalign; #endif NODE *left; NODE *right; }in; /* interior node */ struct { int op; int rall; TWORD type; int su; #ifndef FLEXNAMES char name[NCHNAM]; #else char *name; int stalign; #endif CONSZ lval; int rval; }tn; /* terminal node */ struct { int op, rall; TWORD type; int su; int label; /* for use with branching */ }bn; /* branch node */ struct { int op, rall; TWORD type; int su; int stsize; /* sizes of structure objects */ int stalign; /* alignment of structure objects */ }stn; /* structure node */ struct { int op; int cdim; TWORD type; int csiz; }fn; /* front node */ struct { /* this structure is used when a floating point constant is being computed */ int op; int cdim; TWORD type; int csiz; double dval; }fpn; /* floating point node */ }; # endif # ifdef BUG2 # define BUG1 # endif # ifdef BUG3 # define BUG2 # define BUG1 # endif # ifdef BUG4 # define BUG1 # define BUG2 # define BUG3 # endif # ifndef ONEPASS # ifndef EXPR # define EXPR '.' # endif # ifndef BBEG # define BBEG '[' # endif # ifndef BEND # define BEND ']' # endif # endif nt node */ struct { /* this structure is used when a floating point constant is being computed */ int op; int cdim; TWORD type; int csiz; double dval; }fpn; /* floating point node */ }; # endif # ifdef BUG2 # define BUG1 # cmd/mip/match.c 644 0 33 33617 2527230504 6654 static char *sccsid ="%W% (Berkeley) %G%"; # include "mfile2" # ifdef WCARD1 # ifdef WCARD2 # define NOINDIRECT # endif # endif extern vdebug; int fldsz, fldshf; static int mamask[] = { /* masks for matching dope with shapes */ SIMPFLG, /* OPSIMP */ SIMPFLG|ASGFLG, /* ASG OPSIMP */ COMMFLG, /* OPCOMM */ COMMFLG|ASGFLG, /* ASG OPCOMM */ MULFLG, /* OPMUL */ MULFLG|ASGFLG, /* ASG OPMUL */ DIVFLG, /* OPDIV */ DIVFLG|ASGFLG, /* ASG OPDIV */ UTYPE, /* OPUNARY */ TYFLG, /* ASG OPUNARY is senseless */ LTYPE, /* OPLEAF */ TYFLG, /* ASG OPLEAF is senseless */ 0, /* OPANY */ ASGOPFLG|ASGFLG, /* ASG OPANY */ LOGFLG, /* OPLOG */ TYFLG, /* ASG OPLOG is senseless */ FLOFLG, /* OPFLOAT */ FLOFLG|ASGFLG, /* ASG OPFLOAT */ SHFFLG, /* OPSHFT */ SHFFLG|ASGFLG, /* ASG OPSHIFT */ SPFLG, /* OPLTYPE */ TYFLG, /* ASG OPLTYPE is senseless */ }; int sdebug = 0; tshape( p, shape ) NODE *p; { /* return true if shape is appropriate for the node p side effect for SFLD is to set up fldsz,etc */ register o, mask; o = p->in.op; # ifndef BUG3 if( sdebug ){ printf( "tshape( %o, %o), op = %d\n", p, shape, o ); } # endif if( shape & SPECIAL ){ switch( shape ){ case SZERO: case SONE: case SMONE: case SSCON: case SCCON: if( o != ICON || p->in.name[0] ) return(0); if( p->tn.lval == 0 && shape == SZERO ) return(1); else if( p->tn.lval == 1 && shape == SONE ) return(1); else if( p->tn.lval == -1 && shape == SMONE ) return(1); else if( p->tn.lval > -129 && p->tn.lval < 128 && shape == SCCON ) return(1); else if( p->tn.lval > -32769 && p->tn.lval < 32768 && shape == SSCON ) return(1); else return(0); case SSOREG: /* non-indexed OREG */ if( o == OREG && !R2TEST(p->tn.rval) ) return(1); else return(0); default: # ifdef MULTILEVEL if( shape & MULTILEVEL ) return( mlmatch(p,shape,0) ); else # endif return( special( p, shape ) ); } } if( shape & SANY ) return(1); if( (shape&INTEMP) && shtemp(p) ) return(1); if( (shape&SWADD) && (o==NAME||o==OREG) ){ if( BYTEOFF(p->tn.lval) ) return(0); } # ifdef WCARD1 if( shape & WCARD1 ) return( wcard1(p) & shape ); # endif # ifdef WCARD2 if( shape & WCARD2 ) return( wcard2(p) & shape ); # endif switch( o ){ case NAME: return( shape&SNAME ); case ICON: mask = SCON; return( shape & mask ); case FLD: if( shape & SFLD ){ if( !flshape( p->in.left ) ) return(0); /* it is a FIELD shape; make side-effects */ o = p->tn.rval; fldsz = UPKFSZ(o); # ifdef RTOLBYTES fldshf = UPKFOFF(o); # else fldshf = SZINT - fldsz - UPKFOFF(o); # endif return(1); } return(0); case CCODES: return( shape&SCC ); case REG: /* distinctions: SAREG any scalar register STAREG any temporary scalar register SBREG any lvalue (index) register STBREG any temporary lvalue register */ mask = isbreg( p->tn.rval ) ? SBREG : SAREG; if( istreg( p->tn.rval ) && busy[p->tn.rval]<=1 ) mask |= mask==SAREG ? STAREG : STBREG; return( shape & mask ); case OREG: return( shape & SOREG ); # ifndef NOINDIRECT case UNARY MUL: /* return STARNM or STARREG or 0 */ return( shumul(p->in.left) & shape ); # endif } return(0); } int tdebug = 0; ttype( t, tword ) TWORD t; { /* does the type t match tword */ if( tword & TANY ) return(1); if( t == UNDEF ) t=INT; /* void functions eased thru tables */ # ifndef BUG3 if( tdebug ){ printf( "ttype( %o, %o )\n", t, tword ); } # endif if( ISPTR(t) && (tword&TPTRTO) ) { do { t = DECREF(t); } while ( ISARY(t) ); /* arr((ays that are left are usually only in structure references... */ return( ttype( t, tword&(~TPTRTO) ) ); } if( t != BTYPE(t) ) return( tword & TPOINT ); /* TPOINT means not simple! */ if( tword & TPTRTO ) return(0); switch( t ){ case CHAR: return( tword & TCHAR ); case SHORT: return( tword & TSHORT ); case STRTY: case UNIONTY: return( tword & TSTRUCT ); case INT: return( tword & TINT ); case UNSIGNED: return( tword & TUNSIGNED ); case USHORT: return( tword & TUSHORT ); case UCHAR: return( tword & TUCHAR ); case ULONG: return( tword & TULONG ); case LONG: return( tword & TLONG ); case FLOAT: return( tword & TFLOAT ); case DOUBLE: return( tword & TDOUBLE ); } return(0); } struct optab *rwtable; struct optab *opptr[DSIZE]; setrew(){ /* set rwtable to first value which allows rewrite */ register struct optab *q; register int i; # ifdef MULTILEVEL /* also initialize multi-level tree links */ mlinit(); # endif for( q = table; q->op != FREE; ++q ){ if( q->needs == REWRITE ){ rwtable = q; goto more; } } cerror( "bad setrew" ); more: for( i=0; iop != FREE; ++q ){ /* beware; things like LTYPE that match multiple things in the tree must not try to look at the NIL at this stage of things! Put something else first in table.c */ /* at one point, the operator matching was 15% of the total comile time; thus, the function call that was here was removed... */ if( q->op < OPSIMP ){ if( q->op==i ) break; } else { register opmtemp; if((opmtemp=mamask[q->op - OPSIMP])&SPFLG){ if( i==NAME || i==ICON || i==OREG ) break; else if( shltype( i, NIL ) ) break; } else if( (dope[i]&(opmtemp|ASGFLG)) == opmtemp ) break; } } opptr[i] = q; } } } match( p, cookie ) NODE *p; { /* called by: order, gencall look for match in table and generate code if found unless entry specified REWRITE. returns MDONE, MNOPE, or rewrite specification from table */ register struct optab *q; register NODE *r; rcount(); if( cookie == FORREW ) q = rwtable; else q = opptr[p->in.op]; for( ; q->op != FREE; ++q ){ /* at one point the call that was here was over 15% of the total time; thus the function call was expanded inline */ if( q->op < OPSIMP ){ if( q->op!=p->in.op ) continue; } else { register opmtemp; if((opmtemp=mamask[q->op - OPSIMP])&SPFLG){ if( p->in.op!=NAME && p->in.op!=ICON && p->in.op!= OREG && ! shltype( p->in.op, p ) ) continue; } else if( (dope[p->in.op]&(opmtemp|ASGFLG)) != opmtemp ) continue; } if( !(q->visit & cookie ) ) continue; r = getlr( p, 'L' ); /* see if left child matches */ if( !tshape( r, q->lshape ) ) continue; if( !ttype( r->in.type, q->ltype ) ) continue; r = getlr( p, 'R' ); /* see if right child matches */ if( !tshape( r, q->rshape ) ) continue; if( !ttype( r->in.type, q->rtype ) ) continue; /* REWRITE means no code from this match but go ahead and rewrite node to help future match */ if( q->needs & REWRITE ) return( q->rewrite ); if( !allo( p, q ) ) continue; /* if can't generate code, skip entry */ /* resources are available */ expand( p, cookie, q->cstring ); /* generate code */ reclaim( p, q->rewrite, cookie ); return(MDONE); } return(MNOPE); } int rtyflg = 0; expand( p, cookie, cp ) NODE *p; register char *cp; { /* generate code by interpreting table entry */ register char c; CONSZ val; rtyflg = 0; for( ; *cp; ++cp ){ switch( *cp ){ default: PUTCHAR( *cp ); continue; /* this is the usual case... */ case 'T': /* rewrite register type is suppressed */ rtyflg = 1; continue; case 'Z': /* special machine dependent operations */ # ifdef NEWZZZ switch( c = *++cp ) { case '1': case '2': case '3': case 'R': case 'L': /* get down first */ zzzcode( getlr( p, c ), *++cp ); break; default: /* normal zzzcode processing otherwise */ zzzcode( p, c ); break; } # else zzzcode( p, *++cp ); # endif continue; case 'F': /* this line deleted if FOREFF is active */ if( cookie & FOREFF ) while( *++cp != '\n' ) ; /* VOID */ continue; case 'S': /* field size */ printf( "%d", fldsz ); continue; case 'H': /* field shift */ printf( "%d", fldshf ); continue; case 'M': /* field mask */ case 'N': /* complement of field mask */ val = 1; val <<= fldsz; --val; val <<= fldshf; adrcon( *cp=='M' ? val : ~val ); continue; case 'L': /* output special label field */ printf( "%d", p->bn.label ); continue; case 'O': /* opcode string */ hopcode( *++cp, p->in.op ); continue; case 'B': /* byte offset in word */ val = getlr(p,*++cp)->tn.lval; val = BYTEOFF(val); printf( CONFMT, val ); continue; case 'C': /* for constant value only */ conput( getlr( p, *++cp ) ); continue; case 'I': /* in instruction */ insput( getlr( p, *++cp ) ); continue; case 'A': /* address of */ adrput( getlr( p, *++cp ) ); continue; case 'U': /* for upper half of address, only */ upput( getlr( p, *++cp ) ); continue; } } } NODE * getlr( p, c ) NODE *p; { /* return the pointer to the left or right side of p, or p itself, depending on the optype of p */ switch( c ) { case '1': case '2': case '3': return( &resc[c-'1'] ); case 'L': return( optype( p->in.op ) == LTYPE ? p : p->in.left ); case 'R': return( optype( p->in.op ) != BITYPE ? p : p->in.right ); } cerror( "bad getlr: %c", c ); /* NOTREACHED */ } # ifdef MULTILEVEL union mltemplate{ struct ml_head{ int tag; /* identifies class of tree */ int subtag; /* subclass of tree */ union mltemplate * nexthead; /* linked by mlinit() */ } mlhead; struct ml_node{ int op; /* either an operator or op description */ int nshape; /* shape of node */ /* both op and nshape must match the node. * where the work is to be done entirely by * op, nshape can be SANY, visa versa, op can * be OPANY. */ int ntype; /* type descriptor from mfile2 */ } mlnode; }; # define MLSZ 30 extern union mltemplate mltree[]; int mlstack[MLSZ]; int *mlsp; /* pointing into mlstack */ NODE * ststack[MLSZ]; NODE **stp; /* pointing into ststack */ mlinit(){ union mltemplate **lastlink; register union mltemplate *n; register mlop; lastlink = &(mltree[0].nexthead); n = &mltree[0]; for( ; (n++)->mlhead.tag != 0; *lastlink = ++n, lastlink = &(n->mlhead.nexthead) ){ # ifndef BUG3 if( vdebug )printf("mlinit: %d\n",(n-1)->mlhead.tag); # endif /* wander thru a tree with a stack finding * its structure so the next header can be located. */ mlsp = mlstack; for( ;; ++n ){ if( (mlop = n->mlnode.op) < OPSIMP ){ switch( optype(mlop) ){ default: cerror("(1)unknown opcode: %o",mlop); case BITYPE: goto binary; case UTYPE: break; case LTYPE: goto leaf; } } else{ if( mamask[mlop-OPSIMP] & (SIMPFLG|COMMFLG|MULFLG|DIVFLG|LOGFLG|FLOFLG|SHFFLG) ){ binary: *mlsp++ = BITYPE; } else if( ! (mamask[mlop-OPSIMP] & UTYPE) ){/* includes OPANY */ leaf: if( mlsp == mlstack ) goto tree_end; else if ( *--mlsp != BITYPE ) cerror("(1)bad multi-level tree descriptor around mltree[%d]", n-mltree); } } } tree_end: /* n points to final leaf */ ; } # ifndef BUG3 if( vdebug > 3 ){ printf("mltree={\n"); for( n= &(mltree[0]); n->mlhead.tag != 0; ++n) printf("%o: %d, %d, %o,\n",n, n->mlhead.tag,n->mlhead.subtag,n->mlhead.nexthead); printf(" }\n"); } # endif } mlmatch( subtree, target, subtarget ) NODE * subtree; int target,subtarget;{ /* * does subtree match a multi-level tree with * tag "target"? Return zero on failure, * non-zero subtag on success (or MDONE if * there is a zero subtag field). */ union mltemplate *head; /* current template header */ register union mltemplate *n; /* node being matched */ NODE * st; /* subtree being matched */ register int mlop; # ifndef BUG3 if( vdebug ) printf("mlmatch(%o,%d)\n",subtree,target); # endif for( head = &(mltree[0]); head->mlhead.tag != 0; head=head->mlhead.nexthead){ # ifndef BUG3 if( vdebug > 1 )printf("mlmatch head(%o) tag(%d)\n", head->mlhead.tag); # endif if( head->mlhead.tag != target )continue; if( subtarget && head->mlhead.subtag != subtarget)continue; # ifndef BUG3 if( vdebug ) printf("mlmatch for %d\n",target); # endif /* potential for match */ n = head + 1; st = subtree; stp = ststack; mlsp = mlstack; /* compare n->op, ->nshape, ->ntype to * the subtree node st */ for( ;; ++n ){ /* for each node in multi-level template */ /* opmatch */ if( n->op < OPSIMP ){ if( st->op != n->op )break; } else { register opmtemp; if((opmtemp=mamask[n->op-OPSIMP])&SPFLG){ if(st->op!=NAME && st->op!=ICON && st->op!=OREG && ! shltype(st->op,st)) break; } else if((dope[st->op]&(opmtemp|ASGFLG))!=opmtemp) break; } /* check shape and type */ if( ! tshape( st, n->mlnode.nshape ) ) break; if( ! ttype( st->type, n->mlnode.ntype ) ) break; /* that node matched, let's try another */ /* must advance both st and n and halt at right time */ if( (mlop = n->mlnode.op) < OPSIMP ){ switch( optype(mlop) ){ default: cerror("(2)unknown opcode: %o",mlop); case BITYPE: goto binary; case UTYPE: st = st->left; break; case LTYPE: goto leaf; } } else{ if( mamask[mlop - OPSIMP] & (SIMPFLG|COMMFLG|MULFLG|DIVFLG|LOGFLG|FLOFLG|SHFFLG) ){ binary: *mlsp++ = BITYPE; *stp++ = st; st = st->left; } else if( ! (mamask[mlop-OPSIMP] & UTYPE) ){/* includes OPANY */ leaf: if( mlsp == mlstack ) goto matched; else if ( *--mlsp != BITYPE ) cerror("(2)bad multi-level tree descriptor around mltree[%d]", n-mltree); st = (*--stp)->right; } else /* ((UNARY */ st = st->left; } continue; matched: /* complete multi-level match successful */ # ifndef BUG3 if( vdebug ) printf("mlmatch() success\n"); # endif if( head->mlhead.subtag == 0 ) return( MDONE ); else { # ifndef BUG3 if( vdebug )printf("\treturns %d\n", head->mlhead.subtag ); # endif return( head->mlhead.subtag ); } } } return( 0 ); } # endif d multi-level tree descriptor around mltree[%d]", n-mltree); st = (*--stp)->right; } else /* cmd/mip/mfile1 644 0 33 11763 2452510540 6510 # include "macdefs" # include "manifest" /* storage classes */ # define SNULL 0 # define AUTO 1 # define EXTERN 2 # define STATIC 3 # define REGISTER 4 # define EXTDEF 5 # define LABEL 6 # define ULABEL 7 # define MOS 8 # define PARAM 9 # define STNAME 10 # define MOU 11 # define UNAME 12 # define TYPEDEF 13 # define FORTRAN 14 # define ENAME 15 # define MOE 16 # define UFORTRAN 17 # define USTATIC 18 /* field size is ORed in */ # define FIELD 0100 # define FLDSIZ 077 # ifndef BUG1 extern char *scnames(); # endif /* location counters */ # define PROG 0 # define DATA 1 # define ADATA 2 # define STRNG 3 # define ISTRNG 4 # define STAB 5 /* symbol table flags */ # define SMOS 01 # define SHIDDEN 02 # define SHIDES 04 # define SSET 010 # define SREF 020 # define SNONUNIQ 040 # define STAG 0100 # ifndef FIXDEF # define FIXDEF(p) #endif # ifndef FIXARG # define FIXARG(p) # endif # ifndef FIXSTRUCT # define FIXSTRUCT(a,b) # endif /* alignment of initialized quantities */ # ifndef AL_INIT # define AL_INIT ALINT # endif struct symtab { #ifndef FLEXNAMES char sname[NCHNAM]; #else char *sname; #endif TWORD stype; /* type word */ char sclass; /* storage class */ char slevel; /* scope level */ char sflags; /* flags for set, use, hidden, mos, etc. */ int offset; /* offset or value */ short dimoff; /* offset into the dimension table */ short sizoff; /* offset into the size table */ short suse; /* line number of last use of the variable */ }; # ifdef ONEPASS /* NOPREF must be defined for use in first pass tree machine */ # define NOPREF 020000 /* no preference for register assignment */ #else union ndu { struct { int op; TWORD type; int cdim, csiz; }fn; /* front node */ struct { int op; TWORD type; int cdim, csiz; NODE *left; NODE * right; }in; /* interior node */ struct { /* this structure is the same as above, but is used when a value, rather than address, is kept in +left */ int op; TWORD type; int cdim, csiz; CONSZ lval; int rval; }tn; /* terminal node */ struct { /* this structure is used when a floating point constant is being computed */ int op; TWORD type; int cdim, csiz; double dval; }fpn; /* floating point node */ }; # endif struct sw { CONSZ sval; int slab; }; extern struct sw swtab[]; extern struct sw *swp; extern int swx; extern int ftnno; extern int blevel; extern int instruct, stwart; extern int lineno, nerrors; typedef union { int intval; NODE * nodep; } YYSTYPE; extern YYSTYPE yylval; extern CONSZ lastcon; extern double dcon; extern char ftitle[]; extern char ititle[]; extern struct symtab stab[]; extern int curftn; extern int curclass; extern int curdim; extern int dimtab[]; extern int paramstk[]; extern int paramno; extern int autooff, argoff, strucoff; extern int regvar; extern int minrvar; extern int brkflag; extern char yytext[]; extern int strflg; extern OFFSZ inoff; extern int reached; /* tunnel to buildtree for name id's */ extern int idname; extern NODE node[]; extern NODE *lastfree; extern int cflag, hflag, pflag; /* various labels */ extern int brklab; extern int contlab; extern int flostat; extern int retlab; extern int retstat; extern int asavbc[], *psavbc; /* flags used in structures/unions */ # define SEENAME 01 # define INSTRUCT 02 # define INUNION 04 # define FUNNYNAME 010 # define TAGNAME 020 /* flags used in the (elementary) flow analysis ... */ # define FBRK 02 # define FCONT 04 # define FDEF 010 # define FLOOP 020 /* flags used for return status */ # define RETVAL 1 # define NRETVAL 2 /* used to mark a constant with no name field */ # define NONAME 040000 /* mark an offset which is undefined */ # define NOOFFSET (-10201) /* declarations of various functions */ extern NODE *buildtree(), *bdty(), *mkty(), *rstruct(), *dclstruct(), *getstr(), *tymerge(), *stref(), *offcon(), *bcon(), *bpsize(), *convert(), *pconvert(), *oconvert(), *ptmatch(), *tymatch(), *makety(), *block(), *doszof(), *talloc(), *optim(), *strargs(), *clocal(); OFFSZ tsize(), psize(); TWORD types(); double atof(); char *exname(), *exdcon(); # define checkst(x) # ifndef CHARCAST /* to make character constants into character connstants */ /* this is a macro to defend against cross-compilers, etc. */ # define CHARCAST(x) (char)(x) # endif # define BCSZ 100 /* size of the table to save break and continue labels */ # define SYMTSZ 1300 /* size of the symbol table (was 500) */ # define DIMTABSZ 2000 /* size of the dimension/size table (was 800) */ # define PARAMSZ 150 /* size of the parameter stack */ # define SWITSZ 500 /* size of switch table */ /* special interfaces for yacc alone */ /* These serve as abbreviations of 2 or more ops: ASOP =, = ops RELOP LE,LT,GE,GT EQUOP EQ,NE DIVOP DIV,MOD SHIFTOP LS,RS ICOP ICR,DECR UNOP NOT,COMPL STROP DOT,STREF */ # define ASOP 25 # define RELOP 26 # define EQUOP 27 # define DIVOP 28 # define SHIFTOP 29 # define INCOP 30 # define UNOP 31 # define STROP 32 # define LP 50 # define RP 51 # define LC 52 # define RC 53 Z 150 /* sizecmd/mip/mfile2 644 0 33 14573 2375156354 6530 # include "macdefs" # include "mac2defs" # include "manifest" # ifdef ONEPASS /* bunch of stuff for putting the passes together... */ # define crslab crs2lab # define where where2 # define xdebug x2debug # define tdebug t2debug # define deflab def2lab # define edebug e2debug # define eprint e2print # define getlab get2lab # define filename ftitle # endif /* cookies, used as arguments to codgen */ # define FOREFF 01 /* compute for effects only */ # define INAREG 02 /* compute into a register */ # define INTAREG 04 /* compute into a scratch register */ # define INBREG 010 /* compute into a lvalue register */ # define INTBREG 020 /* compute into a scratch lvalue register */ # define FORCC 040 /* compute for condition codes only */ # define INTEMP 010000 /* compute into a temporary location */ # define FORARG 020000 /* compute for an argument of a function */ # define FORREW 040000 /* search the table, looking for a rewrite rule */ /* OP descriptors */ /* the ASG operator may be used on some of these */ # define OPSIMP 010000 /* +, -, &, |, ^ */ # define OPCOMM 010002 /* +, &, |, ^ */ # define OPMUL 010004 /* *, / */ # define OPDIV 010006 /* /, % */ # define OPUNARY 010010 /* unary ops */ # define OPLEAF 010012 /* leaves */ # define OPANY 010014 /* any op... */ # define OPLOG 010016 /* logical ops */ # define OPFLOAT 010020 /* +, -, *, or / (for floats) */ # define OPSHFT 010022 /* <<, >> */ # define OPLTYPE 010024 /* leaf type nodes (e.g, NAME, ICON, etc. ) */ /* match returns */ # define MNOPE 010000 # define MDONE 010001 /* shapes */ # define SANY 01 /* same as FOREFF */ # define SAREG 02 /* same as INAREG */ # define STAREG 04 /* same as INTAREG */ # define SBREG 010 /* same as INBREG */ # define STBREG 020 /* same as INTBREG */ # define SCC 040 /* same as FORCC */ # define SNAME 0100 # define SCON 0200 # define SFLD 0400 # define SOREG 01000 /* indirection or wild card shapes */ # ifndef WCARD1 # define STARNM 02000 # endif # ifndef WCARD2 # define STARREG 04000 # endif # define SWADD 040000 # define SPECIAL 0100000 # define SZERO SPECIAL # define SONE (SPECIAL|1) # define SMONE (SPECIAL|2) # define SCCON (SPECIAL|3) /* -256 <= constant < 256 */ # define SSCON (SPECIAL|4) /* -32768 <= constant < 32768 */ # define SSOREG (SPECIAL|5) /* non-indexed OREG */ /* FORARG and INTEMP are carefully not conflicting with shapes */ /* types */ # define TCHAR 01 # define TSHORT 02 # define TINT 04 # define TLONG 010 # define TFLOAT 020 # define TDOUBLE 040 # define TPOINT 0100 # define TUCHAR 0200 # define TUSHORT 0400 # define TUNSIGNED 01000 # define TULONG 02000 # define TPTRTO 04000 /* pointer to one of the above */ # define TANY 010000 /* matches anything within reason */ # define TSTRUCT 020000 /* structure or union */ /* reclamation cookies */ # define RNULL 0 /* clobber result */ # define RLEFT 01 # define RRIGHT 02 # define RESC1 04 # define RESC2 010 # define RESC3 020 # define RESCC 04000 # define RNOP 010000 /* DANGER: can cause loops.. */ /* needs */ # define NAREG 01 # define NACOUNT 03 # define NAMASK 017 # define NASL 04 /* share left register */ # define NASR 010 /* share right register */ # define NBREG 020 # define NBCOUNT 060 # define NBMASK 0360 # define NBSL 0100 # define NBSR 0200 # define NTEMP 0400 # define NTMASK 07400 # define REWRITE 010000 # define EITHER 040000 /* "either" modifier for needs */ # define MUSTDO 010000 /* force register requirements */ # define NOPREF 020000 /* no preference for register assignment */ /* register allocation */ extern ((int rstatus[]; extern int busy[]; extern struct respref { int cform; int mform; } respref[]; # define isbreg(r) (rstatus[r]&SBREG) # define istreg(r) (rstatus[r]&(STBREG|STAREG)) # define istnode(p) (p->in.op==REG && istreg(p->tn.rval)) # define TBUSY 01000 # define REGLOOP(i) for(i=0;i>7)-1)&0177) # define R2UPK2(x) ((x)&0177) # define R2UPK3(x) (x>>14) # define R2TEST(x) ((x)>=0200) # ifdef MULTILEVEL union mltemplate{ struct ml_head{ int tag; /* identifies class of tree */ int subtag; /* subclass of tree */ union mltemplate * nexthead; /* linked by mlinit() */ } mlhead; struct ml_node{ int op; /* either an operator or op description */ int nshape; /* shape of node */ /* both op and nshape must match the node. * where the work is to be done entirely by * op, nshape can be SANY, visa versa, op can * be OPANY. */ int ntype; /* type descriptor from mfile2 */ } mlnode; }; # endif mltemplate{ struct ml_head{ int tag; /* identifies class of tree */ int subtag; /* subclass of tree */ union mltemplate * nextcmd/mip/optim.c 644 0 33 7562 2416242157 6674 static char *sccsid ="%W% (Berkeley) %G%"; # include "mfile1" # define SWAP(p,q) {sp=p; p=q; q=sp;} # define RCON(p) (p->in.right->in.op==ICON) # define RO(p) p->in.right->in.op # define RV(p) p->in.right->tn.lval # define LCON(p) (p->in.left->in.op==ICON) # define LO(p) p->in.left->in.op # define LV(p) p->in.left->tn.lval int oflag = 0; NODE * fortarg( p ) NODE *p; { /* fortran function arguments */ if( p->in.op == CM ){ p->in.left = fortarg( p->in.left ); p->in.right = fortarg( p->in.right ); return(p); } while( ISPTR(p->in.type) ){ p = buildtree( UNARY MUL, p, NIL ); } return( optim(p) ); } /* mapping relationals when the sides are reversed */ short revrel[] ={ EQ, NE, GE, GT, LE, LT, UGE, UGT, ULE, ULT }; NODE * optim(p) register NODE *p; { /* local optimizations, most of which are probably machine independent */ register o, ty; NODE *sp; int i; TWORD t; if( (t=BTYPE(p->in.type))==ENUMTY || t==MOETY ) econvert(p); if( oflag ) return(p); ty = optype( o=p->in.op); if( ty == LTYPE ) return(p); if( ty == BITYPE ) p->in.right = optim(p->in.right); p->in.left = optim(p->in.left); /* collect constants */ switch(o){ case SCONV: case PCONV: return( clocal(p) ); case FORTCALL: p->in.right = fortarg( p->in.right ); break; case UNARY AND: if( LO(p) != NAME ) cerror( "& error" ); if( !andable(p->in.left) ) return(p); LO(p) = ICON; setuleft: /* paint over the type of the left hand side with the type of the top */ p->in.left->in.type = p->in.type; p->in.left->fn.cdim = p->fn.cdim; p->in.left->fn.csiz = p->fn.csiz; p->in.op = FREE; return( p->in.left ); case UNARY MUL: if( LO(p) != ICON ) break; LO(p) = NAME; goto setuleft; case MINUS: if( !nncon(p->in.right) ) break; RV(p) = -RV(p); o = p->in.op = PLUS; case MUL: case PLUS: case AND: case OR: case ER: /* commutative ops; for now, just collect constants */ /* someday, do it right */ if( nncon(p->in.left) || ( LCON(p) && !RCON(p) ) ) SWAP( p->in.left, p->in.right ); /* make ops tower to the left, not the right */ if( RO(p) == o ){ NODE *t1, *t2, *t3; t1 = p->in.left; sp = p->in.right; t2 = sp->in.left; t3 = sp->in.right; /* now, put together again */ p->in.left = sp; sp->in.left = t1; sp->in.right = t2; p->in.right = t3; } if(o == PLUS && LO(p) == MINUS && RCON(p) && RCON(p->in.left) && conval(p->in.right, MINUS, p->in.left->in.right)){ zapleft: RO(p->in.left) = FREE; LO(p) = FREE; p->in.left = p->in.left->in.left; } if( RCON(p) && LO(p)==o && RCON(p->in.left) && conval( p->in.right, o, p->in.left->in.right ) ){ goto zapleft; } else if( LCON(p) && RCON(p) && conval( p->in.left, o, p->in.right ) ){ zapright: RO(p) = FREE; p->in.left = makety( p->in.left, p->in.type, p->fn.cdim, p->fn.csiz ); p->in.op = FREE; return( clocal( p->in.left ) ); } /* change muls to shifts */ if( o==MUL && nncon(p->in.right) && (i=ispow2(RV(p)))>=0){ if( i == 0 ){ /* multiplication by 1 */ goto zapright; } o = p->in.op = LS; p->in.right->in.type = p->in.right->fn.csiz = INT; RV(p) = i; } /* change +'s of negative consts back to - */ if( o==PLUS && nncon(p->in.right) && RV(p)<0 ){ RV(p) = -RV(p); o = p->in.op = MINUS; } break; case DIV: if( nncon( p->in.right ) && p->in.right->tn.lval == 1 ) goto zapright; break; case EQ: case NE: case LT: case LE: case GT: case GE: case ULT: case ULE: case UGT: case UGE: if( !LCON(p) ) break; /* exchange operands */ sp = p->in.left; p->in.left = p->in.right; p->in.right = sp; p->in.op = revrel[p->in.op - EQ ]; break; } return(p); } ispow2( c ) CONSZ c; { register i; if( c <= 0 || (c&(c-1)) ) return(-1); for( i=0; c>1; ++i) c >>= 1; return(i); } nncon( p ) NODE *p; { /* is p a constant without a name */ return( p->in.op == ICON && p->tn.rval == NONAME ); } NE: case LT: case LE: case GT: case GE: case ULT: case ULE: case UGT: case UGE: if( !LCON(p) ) break; /* exchange operands */ cmd/mip/pftn.c 644 0 33 117553 2416242205 6547 static char *sccsid ="%W% (Berkeley) %G%"; # include "mfile1" unsigned int offsz; struct instk { int in_sz; /* size of array element */ int in_x; /* current index for structure member in structure initializations */ int in_n; /* number of initializations seen */ int in_s; /* sizoff */ int in_d; /* dimoff */ TWORD in_t; /* type */ int in_id; /* stab index */ int in_fl; /* flag which says if this level is controlled by {} */ OFFSZ in_off; /* offset of the beginning of this level */ } instack[10], *pstk; /* defines used for getting things off of the initialization stack */ struct symtab *relook(); int ddebug = 0; struct symtab * mknonuniq(); defid( q, class ) NODE *q; { register struct symtab *p; int idp; TWORD type; TWORD stp; int scl; int dsym, ddef; int slev, temp; if( q == NIL ) return; /* an error was detected */ if( q < node || q >= &node[TREESZ] ) cerror( "defid call" ); idp = q->tn.rval; if( idp < 0 ) cerror( "tyreduce" ); p = &stab[idp]; # ifndef BUG1 if( ddebug ){ #ifndef FLEXNAMES printf( "defid( %.8s (%d), ", p->sname, idp ); #else printf( "defid( %s (%d), ", p->sname, idp ); #endif tprint( q->in.type ); printf( ", %s, (%d,%d) ), level %d\n", scnames(class), q->fn.cdim, q->fn.csiz, blevel ); } # endif fixtype( q, class ); type = q->in.type; class = fixclass( class, type ); stp = p->stype; slev = p->slevel; # ifndef BUG1 if( ddebug ){ printf( " modified to " ); tprint( type ); printf( ", %s\n", scnames(class) ); printf( " previous def'n: " ); tprint( stp ); printf( ", %s, (%d,%d) ), level %d\n", scnames(p->sclass), p->dimoff, p->sizoff, slev ); } # endif if( stp == FTN && p->sclass == SNULL )goto enter; /* name encountered as function, not yet defined */ if( stp == UNDEF|| stp == FARG ){ if( blevel==1 && stp!=FARG ) switch( class ){ default: #ifndef FLEXNAMES if(!(class&FIELD)) uerror( "declared argument %.8s is missing", p->sname ); #else if(!(class&FIELD)) uerror( "declared argument %s is miss((ing", p->sname ); #endif case MOS: case STNAME: case MOU: case UNAME: case MOE: case ENAME: case TYPEDEF: ; } goto enter; } if( type != stp ) goto mismatch; /* test (and possibly adjust) dimensions */ dsym = p->dimoff; ddef = q->fn.cdim; for( temp=type; temp&TMASK; temp = DECREF(temp) ){ if( ISARY(temp) ){ if( dimtab[dsym] == 0 ) dimtab[dsym] = dimtab[ddef]; else if( dimtab[ddef]!=0 && dimtab[dsym] != dimtab[ddef] ){ goto mismatch; } ++dsym; ++ddef; } } /* check that redeclarations are to the same structure */ if( (temp==STRTY||temp==UNIONTY||temp==ENUMTY) && p->sizoff != q->fn.csiz && class!=STNAME && class!=UNAME && class!=ENAME ){ goto mismatch; } scl = ( p->sclass ); # ifndef BUG1 if( ddebug ){ printf( " previous class: %s\n", scnames(scl) ); } # endif if( class&FIELD ){ /* redefinition */ if( !falloc( p, class&FLDSIZ, 1, NIL ) ) { /* successful allocation */ psave( idp ); return; } /* blew it: resume at end of switch... */ } else switch( class ){ case EXTERN: switch( scl ){ case STATIC: case USTATIC: if( slev==0 ) return; break; case EXTDEF: case EXTERN: case FORTRAN: case UFORTRAN: return; } break; case STATIC: if( scl==USTATIC || (scl==EXTERN && blevel==0) ){ p->sclass = STATIC; if( ISFTN(type) ) curftn = idp; return; } break; case USTATIC: if( scl==STATIC || scl==USTATIC ) return; break; case LABEL: if( scl == ULABEL ){ p->sclass = LABEL; deflab( p->offset ); return; } break; case TYPEDEF: if( scl == class ) return; break; case UFORTRAN: if( scl == UFORTRAN || scl == FORTRAN ) return; break; case FORTRAN: if( scl == UFORTRAN ){ p->sclass = FORTRAN; if( ISFTN(type) ) curftn = idp; return; } break; case MOU: case MOS: if( scl == class ) { if( oalloc( p, &strucoff ) ) break; if( class == MOU ) strucoff = 0; psave( idp ); return; } break; case MOE: if( scl == class ){ if( p->offset!= strucoff++ ) break; psave( idp ); } break; case EXTDEF: if( scl == EXTERN ) { p->sclass = EXTDEF; if( ISFTN(type) ) curftn = idp; return; } break; case STNAME: case UNAME: case ENAME: if( scl != class ) break; if( dimtab[p->sizoff] == 0 ) return; /* previous entry just a mention */ break; case ULABEL: if( scl == LABEL || scl == ULABEL ) return; case PARAM: case AUTO: case REGISTER: ; /* mismatch.. */ } mismatch: /* allow nonunique structure/union member names */ if( class==MOU || class==MOS || class & FIELD ){/* make a new entry */ int * memp; p->sflags |= SNONUNIQ; /* old entry is nonunique */ /* determine if name has occurred in this structure/union */ for( memp = ¶mstk[paramno-1]; /* while */ *memp>=0 && stab[*memp].sclass != STNAME && stab[*memp].sclass != UNAME; /* iterate */ --memp){ char * cname, * oname; if( stab[*memp].sflags & SNONUNIQ ){int k; cname=p->sname; oname=stab[*memp].sname; #ifndef FLEXNAMES for(k=1; k<=NCHNAM; ++k){ if(*cname++ != *oname)goto diff; if(!*oname++)break; } #else if (cname != oname) goto diff; #endif uerror("redeclaration of: %s",p->sname); break; diff: continue; } } p = mknonuniq( &idp ); /* update p and idp to new entry */ goto enter; } if( blevel > slev && class != EXTERN && class != FORTRAN && class != UFORTRAN && !( class == LABEL && slev >= 2 ) ){ q->tn.rval = idp = hide( p ); p = &stab[idp]; goto enter; } #ifndef FLEXNAMES uerror( "redeclaration of %.8s", p->sname ); #else uerror( "redeclaration of %s", p->sname ); #endif if( class==EXTDEF && ISFTN(type) ) curftn = idp; return; enter: /* make a new entry */ # ifndef BUG1 if( ddebug ) printf( " new entry made\n" ); # endif if( type == UNDEF ) uerror("void type for %s",p->sname); p->stype = type; p->sclass = class; p->slevel = blevel; p->offset = NOOFFSET; p->suse = lineno; if( class == STNAME || class == UNAME || class == ENAME ) { p->sizoff = curdim; dstash( 0 ); /* size */ dstash( -1 ); /* index to members of str or union */ dstash( ALSTRUCT ); /* alignment */ dstash( idp ); } else { switch( BTYPE(type) ){ case STRTY: case UNIONTY: case ENUMTY: p->sizoff = q->fn.csiz; break; default: p->sizoff = BTYPE(type); } } /* copy dimensions */ p->dimoff = q->fn.cdim; /* allocate offsets */ if( class&FIELD ){ falloc( p, class&FLDSIZ, 0, NIL ); /* new entry */ psave( idp ); } else switch( class ){ case AUTO: oalloc( p, &autooff ); break; case STATIC: case EXTDEF: p->offset = getlab(); if( ISFTN(type) ) curftn = idp; break; case ULABEL: case LABEL: p->offset = getlab(); p->slevel = 2; if( class == LABEL ){ locctr( PROG ); deflab( p->offset ); } break; case EXTERN: case UFORTRAN: case FORTRAN: p->offset = getlab(); p->slevel = 0; break; case MOU: case MOS: oalloc( p, &strucoff ); if( class == MOU ) strucoff = 0; psave( idp ); break; case MOE: p->offset = strucoff++; psave( idp ); break; case REGISTER: p->offset = regvar--; if( blevel == 1 ) p->sflags |= SSET; if( regvar < minrvar ) minrvar = regvar; break; } /* user-supplied routine to fix up new definitions */ FIXDEF(p); # ifndef BUG1 if( ddebug ) printf( " dimoff, sizoff, offset: %d, %d, %d\n", p->dimoff, p->sizoff, p->offset ); # endif } psave( i ){ if( paramno >= PARAMSZ ){ cerror( "parameter stack overflow"); } paramstk[ paramno++ ] = i; } ftnend(){ /* end of function */ if( retlab != NOLAB ){ /* inside a real function */ efcode(); } checkst(0); retstat = 0; tcheck(); curclass = SNULL; brklab = contlab = retlab = NOLAB; flostat = 0; if( nerrors == 0 ){ if( psavbc != & asavbc[0] ) cerror("bcsave error"); if( paramno != 0 ) cerror("parameter reset error"); if( swx != 0 ) cerror( "switch error"); } psavbc = &asavbc[0]; paramno = 0; autooff = AUTOINIT; minrvar = regvar = MAXRVAR; reached = 1; swx = 0; swp = swtab; locctr(DATA); } dclargs(){ register i, j; register struct symtab *p; register NODE *q; argoff = ARGINIT; # ifndef BUG1 if( ddebug > 2) printf("dclargs()\n"); # endif for( i=0; i 2 ){ printf("\t%s (%d) ",p->sname, j); tprint(p->stype); printf("\n"); } # endif if( p->stype == FARG ) { q = block(FREE,NIL,NIL,INT,0,INT); q->tn.rval = j; defid( q, PARAM ); } FIXARG(p); /* local arg hook, eg. for sym. debugger */ oalloc( p, &argoff ); /* always set aside space, even for register arguments */ } cendarg(); locctr(PROG); defalign(ALINT); ftnno = getlab(); bfcode( paramstk, paramno ); paramno = 0; } NODE * rstruct( idn, soru ){ /* reference to a structure or union, with no definition */ register struct symtab *p; register NODE *q; p = &stab[idn]; switch( p->stype ){ case UNDEF: def: q = block( FREE, NIL, NIL, 0, 0, 0 ); q->tn.rval = idn; q->in.type = (soru&INSTRUCT) ? STRTY : ( (soru&INUNION) ? UNIONTY : ENUMTY ); defid( q, (soru&INSTRUCT) ? STNAME : ( (soru&INUNION) ? UNAME : ENAME ) ); break; case STRTY: if( soru & INSTRUCT ) break; goto def; case UNIONTY: if( soru & INUNION ) break; goto def; case ENUMTY: if( !(soru&(INUNION|INSTRUCT)) ) break; goto def; } stwart = instruct; return( mkty( p->stype, 0, p->sizoff ) ); } moedef( idn ){ register NODE *q; q = block( FREE, NIL, NIL, MOETY, 0, 0 ); q->tn.rval = idn; if( idn>=0 ) defid( q, MOE ); } bstruct( idn, soru ){ /* begining of structure or union declaration */ register NODE *q; psave( instruct ); psave( curclass ); psave( strucoff ); strucoff = 0; instruct = soru; q = block( FREE, NIL, NIL, 0, 0, 0 ); q->tn.rval = idn; if( instruct==INSTRUCT ){ curclass = MOS; q->in.type = STRTY; if( idn >= 0 ) defid( q, STNAME ); } else if( instruct == INUNION ) { curclass = MOU; q->in.type = UNIONTY; if( idn >= 0 ) defid( q, UNAME ); } else { /* enum */ curclass = MOE; q->in.type = ENUMTY; if( idn >= 0 ) defid( q, ENAME ); } psave( idn = q->tn.rval ); /* the "real" definition is where the members are seen */ if ( idn >= 0 ) stab[idn].suse = lineno; return( paramno-4 ); } NODE * dclstruct( oparam ){ register struct symtab *p; register i, al, sa, j, sz, szindex; register TWORD temp; register high, low; /* paramstack contains: paramstack[ oparam ] = previous instruct paramstack[ oparam+1 ] = previous class paramstk[ oparam+2 ] = previous strucoff paramstk[ oparam+3 ] = structure name paramstk[ oparam+4, ... ] = member stab indices */ if( (i=paramstk[oparam+3]) < 0 ){ szindex = curdim; dstash( 0 ); /* size */ dstash( -1 ); /* index to member names */ dstash( ALSTRUCT ); /* alignment */ dstash( -lineno ); /* name of structure */ } else { szindex = stab[i].sizoff; } # ifndef BUG1 if( ddebug ){ #ifndef FLEXNAMES printf( "dclstruct( %.8s ), szindex = %d\n", (i>=0)? stab[i].sname : "??", szindex ); #else printf( "dclstruct( %s ), szindex = %d\n", (i>=0)? stab[i].sname : "??", szindex ); #endif } # endif temp = (instruct&INSTRUCT)?STRTY:((instruct&INUNION)?UNIONTY:ENUMTY); stwart = instruct = paramstk[ oparam ]; curclass = paramstk[ oparam+1 ]; dimtab[ szindex+1 ] = curdim; al = ALSTRUCT; high = low = 0; for( i = oparam+4; i< paramno; ++i ){ dstash( j=paramstk[i] ); if( j<0 || j>= SYMTSZ ) cerror( "gummy structure member" ); p = &stab[j]; if( temp == ENUMTY ){ if( p->offset < low ) low = p->offset; if( p->offset > high ) high = p->offset; p->sizoff = szindex; continue; } sa = talign( p->stype, p->sizoff ); if( p->sclass & FIELD ){ sz = p->sclass&FLDSIZ; } else { sz = tsize( p->stype, p->dimoff, p->sizoff ); } if( sz == 0 ){ #ifndef FLEXNAMES werror( "illegal zero sized structure member: %.8s", p->sname ); #else werror( "illegal zero sized structure member: %s", p->sname ); #endif } if( sz > strucoff ) strucoff = sz; /* for use with unions */ SETOFF( al, sa ); /* set al, the alignment, to the lc((m of the alignments of the members */ } dstash( -1 ); /* endmarker */ SETOFF( strucoff, al ); if( temp == ENUMTY ){ register TWORD ty; # ifdef ENUMSIZE ty = ENUMSIZE(high,low); # else if( (char)high == high && (char)low == low ) ty = ctype( CHAR ); else if( (short)high == high && (short)low == low ) ty = ctype( SHORT ); else ty = ctype(INT); #endif strucoff = tsize( ty, 0, (int)ty ); dimtab[ szindex+2 ] = al = talign( ty, (int)ty ); } if( strucoff == 0 ) uerror( "zero sized structure" ); dimtab[ szindex ] = strucoff; dimtab[ szindex+2 ] = al; dimtab[ szindex+3 ] = paramstk[ oparam+3 ]; /* name index */ FIXSTRUCT( szindex, oparam ); /* local hook, eg. for sym debugger */ # ifndef BUG1 if( ddebug>1 ){ printf( "\tdimtab[%d,%d,%d] = %d,%d,%d\n", szindex,szindex+1,szindex+2, dimtab[szindex],dimtab[szindex+1],dimtab[szindex+2] ); for( i = dimtab[szindex+1]; dimtab[i] >= 0; ++i ){ #ifndef FLEXNAMES printf( "\tmember %.8s(%d)\n", stab[dimtab[i]].sname, dimtab[i] ); #else printf( "\tmember %s(%d)\n", stab[dimtab[i]].sname, dimtab[i] ); #endif } } # endif strucoff = paramstk[ oparam+2 ]; paramno = oparam; return( mkty( temp, 0, szindex ) ); } /* VARARGS */ yyerror( s ) char *s; { /* error printing routine in parser */ uerror( s ); } yyaccpt(){ ftnend(); } ftnarg( idn ) { switch( stab[idn].stype ){ case UNDEF: /* this parameter, entered at scan */ break; case FARG: #ifndef FLEXNAMES uerror("redeclaration of formal parameter, %.8s", #else uerror("redeclaration of formal parameter, %s", #endif stab[idn].sname); /* fall thru */ case FTN: /* the name of this function matches parm */ /* fall thru */ default: idn = hide( &stab[idn]); break; case TNULL: /* unused entry, fill it */ ; } stab[idn].stype = FARG; stab[idn].sclass = PARAM; psave( idn ); } talign( ty, s) register unsigned ty; register s; { /* compute the alignment of an object with type ty, sizeoff index s */ register i; if( s<0 && ty!=INT && ty!=CHAR && ty!=SHORT && ty!=UNSIGNED && ty!=UCHAR && ty!=USHORT #ifdef LONGFIELDS && ty!=LONG && ty!=ULONG #endif ){ return( fldal( ty ) ); } for( i=0; i<=(SZINT-BTSHIFT-1); i+=TSHIFT ){ switch( (ty>>i)&TMASK ){ case FTN: cerror( "compiler takes alignment of function"); case PTR: return( ALPOINT ); case ARY: continue; case 0: break; } } switch( BTYPE(ty) ){ case UNIONTY: case ENUMTY: case STRTY: return( (unsigned int) dimtab[ s+2 ] ); case CHAR: case UCHAR: return( ALCHAR ); case FLOAT: return( ALFLOAT ); case DOUBLE: return( ALDOUBLE ); case LONG: case ULONG: return( ALLONG ); case SHORT: case USHORT: return( ALSHORT ); default: return( ALINT ); } } OFFSZ tsize( ty, d, s ) TWORD ty; { /* compute the size associated with type ty, dimoff d, and sizoff s */ /* BETTER NOT BE CALLED WHEN t, d, and s REFER TO A BIT FIELD... */ int i; OFFSZ mult; mult = 1; for( i=0; i<=(SZINT-BTSHIFT-1); i+=TSHIFT ){ switch( (ty>>i)&TMASK ){ case FTN: cerror( "compiler takes size of function"); case PTR: return( SZPOINT * mult ); case ARY: mult *= (unsigned int) dimtab[ d++ ]; continue; case 0: break; } } if( dimtab[s]==0 ) { uerror( "unknown size"); return( SZINT ); } return( (unsigned int) dimtab[ s ] * mult ); } inforce( n ) OFFSZ n; { /* force inoff to have the value n */ /* inoff is updated to have the value n */ OFFSZ wb; register rest; /* rest is used to do a lot of conversion to ints... */ if( inoff == n ) return; if( inoff > n ) { cerror( "initialization alignment error"); } wb = inoff; SETOFF( wb, SZINT ); /* wb now has the next higher word boundary */ if( wb >= n ){ /* in the same word */ rest = n - inoff; vfdzero( rest ); return; } /* otherwise, extend inoff to be word aligned */ rest = wb - inoff; vfdzero( rest ); /* now, skip full words until near to n */ rest = (n-inoff)/SZINT; zecode( rest ); /* now, the remainder of the last word */ rest = n-inoff; vfdzero( rest ); if( inoff != n ) cerror( "inoff error"); } vfdalign( n ){ /* make inoff have the offset the next alignment of n */ OFFSZ m; m = inoff; SETOFF( m, n ); inforce( m ); } int idebug = 0; int ibseen = 0; /* the number of } constructions which have been filled */ int iclass; /* storage class of thing being initialized */ int ilocctr = 0; /* location counter for current initialization */ beginit(curid){ /* beginning of initilization; set location ctr and set type */ register struct symtab *p; # ifndef BUG1 if( idebug >= 3 ) printf( "beginit(), curid = %d\n", curid ); # endif p = &stab[curid]; iclass = p->sclass; if( curclass == EXTERN || curclass == FORTRAN ) iclass = EXTERN; switch( iclass ){ case UNAME: case EXTERN: return; case AUTO: case REGISTER: break; case EXTDEF: case STATIC: ilocctr = ISARY(p->stype)?ADATA:DATA; locctr( ilocctr ); defalign( talign( p->stype, p->sizoff ) ); defnam( p ); } inoff = 0; ibseen = 0; pstk = 0; instk( curid, p->stype, p->dimoff, p->sizoff, inoff ); } instk( id, t, d, s, off ) OFFSZ off; TWORD t; { /* make a new entry on the parameter stack to initialize id */ register struct symtab *p; for(;;){ # ifndef BUG1 if( idebug ) printf( "instk((%d, %o,%d,%d, %d)\n", id, t, d, s, off ); # endif /* save information on the stack */ if( !pstk ) pstk = instack; else ++pstk; pstk->in_fl = 0; /* { flag */ pstk->in_id = id ; pstk->in_t = t ; pstk->in_d = d ; pstk->in_s = s ; pstk->in_n = 0; /* number seen */ pstk->in_x = t==STRTY ?dimtab[s+1] : 0 ; pstk->in_off = off; /* offset at the beginning of this element */ /* if t is an array, DECREF(t) can't be a field */ /* INS_sz has size of array elements, and -size for fields */ if( ISARY(t) ){ pstk->in_sz = tsize( DECREF(t), d+1, s ); } else if( stab[id].sclass & FIELD ){ pstk->in_sz = - ( stab[id].sclass & FLDSIZ ); } else { pstk->in_sz = 0; } if( (iclass==AUTO || iclass == REGISTER ) && (ISARY(t) || t==STRTY) ) uerror( "no automatic aggregate initialization" ); /* now, if this is not a scalar, put on another element */ if( ISARY(t) ){ t = DECREF(t); ++d; continue; } else if( t == STRTY ){ id = dimtab[pstk->in_x]; p = &stab[id]; if( p->sclass != MOS && !(p->sclass&FIELD) ) cerror( "insane structure member list" ); t = p->stype; d = p->dimoff; s = p->sizoff; off += p->offset; continue; } else return; } } NODE * getstr(){ /* decide if the string is external or an initializer, and get the contents accordingly */ register l, temp; register NODE *p; if( (iclass==EXTDEF||iclass==STATIC) && (pstk->in_t == CHAR || pstk->in_t == UCHAR) && pstk!=instack && ISARY( pstk[-1].in_t ) ){ /* treat "abc" as { 'a', 'b', 'c', 0 } */ strflg = 1; ilbrace(); /* simulate { */ inforce( pstk->in_off ); /* if the array is inflexible (not top level), pass in the size and be prepared to throw away unwanted initializers */ lxstr((pstk-1)!=instack?dimtab[(pstk-1)->in_d]:0); /* get the contents */ irbrace(); /* simulate } */ return( NIL ); } else { /* make a label, and get the contents and stash them away */ if( iclass != SNULL ){ /* initializing */ /* fill out previous word, to permit pointer */ vfdalign( ALPOINT ); } temp = locctr( blevel==0?ISTRNG:STRNG ); /* set up location counter */ deflab( l = getlab() ); strflg = 0; lxstr(0); /* get the contents */ locctr( blevel==0?ilocctr:temp ); p = buildtree( STRING, NIL, NIL ); p->tn.rval = -l; return(p); } } putbyte( v ){ /* simulate byte v appearing in a list of integer values */ register NODE *p; p = bcon(v); incode( p, SZCHAR ); tfree( p ); gotscal(); } endinit(){ register TWORD t; register d, s, n, d1; # ifndef BUG1 if( idebug ) printf( "endinit(), inoff = %d\n", inoff ); # endif switch( iclass ){ case EXTERN: case AUTO: case REGISTER: return; } pstk = instack; t = pstk->in_t; d = pstk->in_d; s = pstk->in_s; n = pstk->in_n; if( ISARY(t) ){ d1 = dimtab[d]; vfdalign( pstk->in_sz ); /* fill out part of the last element, if needed */ n = inoff/pstk->in_sz; /* real number of initializers */ if( d1 >= n ){ /* once again, t is an array, so no fields */ inforce( tsize( t, d, s ) ); n = d1; } if( d1!=0 && d1!=n ) uerror( "too many initializers"); if( n==0 ) werror( "empty array declaration"); dimtab[d] = n; } else if( t == STRTY || t == UNIONTY ){ /* clearly not fields either */ inforce( tsize( t, d, s ) ); } else if( n > 1 ) uerror( "bad scalar initialization"); /* this will never be called with a field element... */ else inforce( tsize(t,d,s) ); paramno = 0; vfdalign( AL_INIT ); inoff = 0; iclass = SNULL; } doinit( p ) register NODE *p; { /* take care of generating a value for the initializer p */ /* inoff has the current offset (last bit written) in the current word being generated */ register sz, d, s; register TWORD t; /* note: size of an individual initializer is assumed to fit into an int */ if( iclass < 0 ) goto leave; if( iclass == EXTERN || iclass == UNAME ){ uerror( "cannot initialize extern or union" ); iclass = -1; goto leave; } if( iclass == AUTO || iclass == REGISTER ){ /* do the initialization and get out, without regard for filing out the variable with zeros, etc. */ bccode(); idname = pstk->in_id; p = buildtree( ASSIGN, buildtree( NAME, NIL, NIL ), p ); ecomp(p); return; } if( p == NIL ) return; /* for throwing away strings that have been turned into lists */ if( ibseen ){ uerror( "} expected"); goto leave; } # ifndef BUG1 if( idebug > 1 ) printf( "doinit(%o)\n", p ); # endif t = pstk->in_t; /* type required */ d = pstk->in_d; s = pstk->in_s; if( pstk->in_sz < 0 ){ /* bit field */ sz = -pstk->in_sz; } else { sz = tsize( t, d, s ); } inforce( pstk->in_off ); p = buildtree( ASSIGN, block( NAME, NIL,NIL, t, d, s ), p ); p->in.left->in.op = FREE; p->in.left = p->in.right; p->in.right = NIL; p->in.left = optim( p->in.left ); if( p->in.lef((t->in.op == UNARY AND ){ p->in.left->in.op = FREE; p->in.left = p->in.left->in.left; } p->in.op = INIT; if( sz < SZINT ){ /* special case: bit fields, etc. */ if( p->in.left->in.op != ICON ) uerror( "illegal initialization" ); else incode( p->in.left, sz ); } else if( p->in.left->in.op == FCON ){ fincode( p->in.left->fpn.dval, sz ); } else { cinit( optim(p), sz ); } gotscal(); leave: tfree(p); } gotscal(){ register t, ix; register n, id; struct symtab *p; OFFSZ temp; for( ; pstk > instack; ) { if( pstk->in_fl ) ++ibseen; --pstk; t = pstk->in_t; if( t == STRTY ){ ix = ++pstk->in_x; if( (id=dimtab[ix]) < 0 ) continue; /* otherwise, put next element on the stack */ p = &stab[id]; instk( id, p->stype, p->dimoff, p->sizoff, p->offset+pstk->in_off ); return; } else if( ISARY(t) ){ n = ++pstk->in_n; if( n >= dimtab[pstk->in_d] && pstk > instack ) continue; /* put the new element onto the stack */ temp = pstk->in_sz; instk( pstk->in_id, (TWORD)DECREF(pstk->in_t), pstk->in_d+1, pstk->in_s, pstk->in_off+n*temp ); return; } } } ilbrace(){ /* process an initializer's left brace */ register t; struct instk *temp; temp = pstk; for( ; pstk > instack; --pstk ){ t = pstk->in_t; if( t != STRTY && !ISARY(t) ) continue; /* not an aggregate */ if( pstk->in_fl ){ /* already associated with a { */ if( pstk->in_n ) uerror( "illegal {"); continue; } /* we have one ... */ pstk->in_fl = 1; break; } /* cannot find one */ /* ignore such right braces */ pstk = temp; } irbrace(){ /* called when a '}' is seen */ # ifndef BUG1 if( idebug ) printf( "irbrace(): paramno = %d on entry\n", paramno ); # endif if( ibseen ) { --ibseen; return; } for( ; pstk > instack; --pstk ){ if( !pstk->in_fl ) continue; /* we have one now */ pstk->in_fl = 0; /* cancel { */ gotscal(); /* take it away... */ return; } /* these right braces match ignored left braces: throw out */ } upoff( size, alignment, poff ) register alignment, *poff; { /* update the offset pointed to by poff; return the /* offset of a value of size `size', alignment `alignment', /* given that off is increasing */ register off; off = *poff; SETOFF( off, alignment ); if( (offsz-off) < size ){ if( instruct!=INSTRUCT )cerror("too many local variables"); else cerror("Structure too large"); } *poff = off+size; return( off ); } oalloc( p, poff ) register struct symtab *p; register *poff; { /* allocate p with offset *poff, and update *poff */ register al, off, tsz; int noff; al = talign( p->stype, p->sizoff ); noff = off = *poff; tsz = tsize( p->stype, p->dimoff, p->sizoff ); #ifdef BACKAUTO if( p->sclass == AUTO ){ if( (offsz-off) < tsz ) cerror("too many local variables"); noff = off + tsz; SETOFF( noff, al ); off = -noff; } else #endif if( p->sclass == PARAM && ( tsz < SZINT ) ){ off = upoff( SZINT, ALINT, &noff ); # ifndef RTOLBYTES off = noff - tsz; #endif } else { off = upoff( tsz, al, &noff ); } if( p->sclass != REGISTER ){ /* in case we are allocating stack space for register arguments */ if( p->offset == NOOFFSET ) p->offset = off; else if( off != p->offset ) return(1); } *poff = noff; return(0); } falloc( p, w, new, pty ) register struct symtab *p; NODE *pty; { /* allocate a field of width w */ /* new is 0 if new entry, 1 if redefinition, -1 if alignment */ register al,sz,type; type = (new<0)? pty->in.type : p->stype; /* this must be fixed to use the current type in alignments */ switch( new<0?pty->in.type:p->stype ){ case ENUMTY: { int s; s = new<0 ? pty->fn.csiz : p->sizoff; al = dimtab[s+2]; sz = dimtab[s]; break; } case CHAR: case UCHAR: al = ALCHAR; sz = SZCHAR; break; case SHORT: case USHORT: al = ALSHORT; sz = SZSHORT; break; case INT: case UNSIGNED: al = ALINT; sz = SZINT; break; #ifdef LONGFIELDS case LONG: case ULONG: al = ALLONG; sz = SZLONG; break; #endif default: if( new < 0 ) { uerror( "illegal field type" ); al = ALINT; } else { al = fldal( p->stype ); sz =SZINT; } } if( w > sz ) { uerror( "field too big"); w = sz; } if( w == 0 ){ /* align only */ SETOFF( strucoff, al ); if( new >= 0 ) uerror( "zero size field"); return(0); } if( strucoff%al + w > sz ) SETOFF( strucoff, al ); if( new < 0 ) { if( (offsz-strucoff) < w ) cerror("structure too large"); strucoff += w; /* we know it will fit */ return(0); } /* establish the field */ if( new == 1 ) { /* previous definition */ if( p->offset != strucoff || p->sclass != (FIELD|w) ) return(1); } p->offset = strucoff; if( (offsz-strucoff) < w ) cerror("structure too large"); strucoff += w; p->stype = type; fldty( p ); return(0); } nidcl( p ) NODE *p; { /* handle unitialized declarations */ /* assumed to be not functions */ register class; register commflag; /* flag for labelled common declarations */ commflag = 0; /* compute class */ if( (class=curclass) == SNULL ){ if( blevel > 1 ) class = AUTO; else if( blevel != 0 || instruct ) cerror( "nidcl error" ); else { /* blevel = 0 */ class = noinit(); if( class == EXTERN ) commflag = 1; } } #ifdef LCOMM /* hack so stab will come at as LCSYM rather than STSYM */ if (class == STATIC) { extern int stabLCSYM; stabLCSYM = 1; } #endif defid( p, class ); #ifndef LCOMM if( class==EXTDEF || class==STATIC ){ #else if (class==STATIC) { register struct symtab *s = &stab[p->tn.rval]; extern int stabLCSYM; int sz = tsize(s->stype, s->dimoff, s->sizoff)/SZCHAR; stabLCSYM = 0; if (sz % sizeof (int)) sz += sizeof (int) - (sz % sizeof (int)); if (s->slevel > 1) printf(" .lcomm L%d,%d\n", s->offset, sz); else printf(" .lcomm %s,%d\n", exname(s->sname), sz); }else if (class == EXTDEF) { #endif /* simulate initialization by 0 */ beginit(p->tn.rval); endinit(); } if( commflag ) commdec( p->tn.rval ); } TWORD types( t1, t2, t3 ) TWORD t1, t2, t3; { /* return a basic type from basic types t1, t2, and t3 */ TWORD t[3], noun, adj, unsg; register i; t[0] = t1; t[1] = t2; t[2] = t3; unsg = INT; /* INT or UNSIGNED */ noun = UNDEF; /* INT, CHAR, or FLOAT */ adj = INT; /* INT, LONG, or SHORT */ for( i=0; i<3; ++i ){ switch( t[i] ){ default: bad: uerror( "illegal type combination" ); return( INT ); case UNDEF: continue; case UNSIGNED: if( unsg != INT ) goto bad; unsg = UNSIGNED; continue; case LONG: case SHORT: if( adj != INT ) goto bad; adj = t[i]; continue; case INT: case CHAR: case FLOAT: if( noun != UNDEF ) goto bad; noun = t[i]; continue; } } /* now, construct final type */ if( noun == UNDEF ) noun = INT; else if( noun == FLOAT ){ if( unsg != INT || adj == SHORT ) goto bad; return( adj==LONG ? DOUBLE : FLOAT ); } else if( noun == CHAR && adj != INT ) goto bad; /* now, noun is INT or CHAR */ if( adj != INT ) noun = adj; if( unsg == UNSIGNED ) return( noun + (UNSIGNED-INT) ); else return( noun ); } NODE * tymerge( typ, idp ) NODE *typ, *idp; { /* merge type typ with identifier idp */ register unsigned t; register i; extern int eprint(); if( typ->in.op != TYPE ) cerror( "tymerge: arg 1" ); if(idp == NIL ) return( NIL ); # ifndef BUG1 if( ddebug > 2 ) fwalk( idp, eprint, 0 ); # endif idp->in.type = typ->in.type; idp->fn.cdim = curdim; tyreduce( idp ); idp->fn.csiz = typ->fn.csiz; for( t=typ->in.type, i=typ->fn.cdim; t&TMASK; t = DECREF(t) ){ if( ISARY(t) ) dstash( dimtab[i++] ); } /* now idp is a single node: fix up type */ idp->in.type = ctype( idp->in.type ); if( (t = BTYPE(idp->in.type)) != STRTY && t != UNIONTY && t != ENUMTY ){ idp->fn.csiz = t; /* in case ctype has rewritten things */ } return( idp ); } tyreduce( p ) register NODE *p; { /* build a type, and stash away dimensions, from a parse tree of the declaration */ /* the type is build top down, the dimensions bottom up */ register o, temp; register unsigned t; o = p->in.op; p->in.op = FREE; if( o == NAME ) return; t = INCREF( p->in.type ); if( o == UNARY CALL ) t += (FTN-PTR); else if( o == LB ){ t += (ARY-PTR); temp = p->in.right->tn.lval; p->in.right->in.op = FREE; if( ( temp == 0 ) & ( p->in.left->tn.op == LB ) ) uerror( "Null dimension" ); } p->in.left->in.type = t; tyreduce( p->in.left ); if( o == LB ) dstash( temp ); p->tn.rval = p->in.left->tn.rval; p->in.type = p->in.left->in.type; } fixtype( p, class ) register NODE *p; { register unsigned t, type; register mod1, mod2; /* fix up the types, and check for legality */ if( (type = p->in.type) == UNDEF ) return; if( mod2 = (type&TMASK) ){ t = DECREF(type); while( mod1=mod2, mod2 = (t&TMASK) ){ if( mod1 == ARY && mod2 == FTN ){ uerror( "array of functions is illegal" ); type = 0; } else if( mod1 == FTN && ( mod2 == ARY || mod2 == FTN ) ){ uerror( "function returns illegal type" ); type = 0; } t = DECREF(t); } } /* detect function arguments, watching out for structure declarations */ /* for example, beware of f(x) struct [ int a[10]; } *x; { ... } */ /* the danger is that "a" will be converted to a pointer */ if( class==SNULL && blevel==1 && !(instruct&(INSTRUCT|INUNION)) ) class = PARAM; if( class == PARAM || ( class==REGISTER && blevel==1 ) ){ if( type == FLOAT ) type = DOUBLE; else if( ISARY(type) ){ ++p->fn.cdim; type += (PTR-ARY); } else if( ISFTN(type) ){ werror( "a function is declared as an argument" ); type = INCREF(type); } } if( instruct && ISFTN(type) ){ uerror( "function illegal in structure or union" ); type = INCREF(type); } p->in.type = type; } uclass( class ) register class; { /* give undefined version of class */ if( class == SNULL ) return( EXTERN ); else if( class == STATIC ) return( USTATIC ); else if( class == FORTRAN ) return( UFORTRAN ); else return( class ); } fixclass( class, type ) TWORD type; { /* first, fix null class */ if( class == SNULL ){ if( instruct&INSTRUCT ) class = MOS; (( else if( instruct&INUNION ) class = MOU; else if( blevel == 0 ) class = EXTDEF; else if( blevel == 1 ) class = PARAM; else class = AUTO; } /* now, do general checking */ if( ISFTN( type ) ){ switch( class ) { default: uerror( "function has illegal storage class" ); case AUTO: class = EXTERN; case EXTERN: case EXTDEF: case FORTRAN: case TYPEDEF: case STATIC: case UFORTRAN: case USTATIC: ; } } if( class&FIELD ){ if( !(instruct&INSTRUCT) ) uerror( "illegal use of field" ); return( class ); } switch( class ){ case MOU: if( !(instruct&INUNION) ) uerror( "illegal class" ); return( class ); case MOS: if( !(instruct&INSTRUCT) ) uerror( "illegal class" ); return( class ); case MOE: if( instruct & (INSTRUCT|INUNION) ) uerror( "illegal class" ); return( class ); case REGISTER: if( blevel == 0 ) uerror( "illegal register declaration" ); else if( regvar >= MINRVAR && cisreg( type ) ) return( class ); if( blevel == 1 ) return( PARAM ); else return( AUTO ); case AUTO: case LABEL: case ULABEL: if( blevel < 2 ) uerror( "illegal class" ); return( class ); case PARAM: if( blevel != 1 ) uerror( "illegal class" ); return( class ); case UFORTRAN: case FORTRAN: # ifdef NOFORTRAN NOFORTRAN; /* a condition which can regulate the FORTRAN usage */ # endif if( !ISFTN(type) ) uerror( "fortran declaration must apply to function" ); else { type = DECREF(type); if( ISFTN(type) || ISARY(type) || ISPTR(type) ) { uerror( "fortran function has wrong type" ); } } case STNAME: case UNAME: case ENAME: case EXTERN: case STATIC: case EXTDEF: case TYPEDEF: case USTATIC: return( class ); default: cerror( "illegal class: %d", class ); /* NOTREACHED */ } } struct symtab * mknonuniq(idindex) int *idindex; {/* locate a symbol table entry for */ /* an occurrence of a nonunique structure member name */ /* or field */ register i; register struct symtab * sp; char *p,*q; sp = & stab[ i= *idindex ]; /* position search at old entry */ while( sp->stype != TNULL ){ /* locate unused entry */ if( ++i >= SYMTSZ ){/* wrap around symbol table */ i = 0; sp = stab; } else ++sp; if( i == *idindex ) cerror("Symbol table full"); } sp->sflags = SNONUNIQ | SMOS; p = sp->sname; q = stab[*idindex].sname; /* old entry name */ #ifdef FLEXNAMES sp->sname = stab[*idindex].sname; #endif # ifndef BUG1 if( ddebug ){ printf("\tnonunique entry for %s from %d to %d\n", q, *idindex, i ); } # endif *idindex = i; #ifndef FLEXNAMES for( i=1; i<=NCHNAM; ++i ){ /* copy name */ if( *p++ = *q /* assign */ ) ++q; } #endif return ( sp ); } lookup( name, s) char *name; { /* look up name: must agree with s w.r.t. STAG, SMOS and SHIDDEN */ register char *p, *q; int i, j, ii; register struct symtab *sp; /* compute initial hash index */ # ifndef BUG1 if( ddebug > 2 ){ printf( "lookup( %s, %d ), stwart=%d, instruct=%d\n", name, s, stwart, instruct ); } # endif i = 0; #ifndef FLEXNAMES for( p=name, j=0; *p != '\0'; ++p ){ i += *p; if( ++j >= NCHNAM ) break; } #else i = (int)name; #endif i = i%SYMTSZ; sp = &stab[ii=i]; for(;;){ /* look for name */ if( sp->stype == TNULL ){ /* empty slot */ sp->sflags = s; /* set STAG, SMOS if needed, turn off all others */ #ifndef FLEXNAMES p = sp->sname; for( j=0; jsname = name; #endif sp->stype = UNDEF; sp->sclass = SNULL; return( i ); } if( (sp->sflags & (STAG|SMOS|SHIDDEN)) != s ) goto next; p = sp->sname; q = name; #ifndef FLEXNAMES for( j=0; j= SYMTSZ ){ i = 0; sp = stab; } else ++sp; if( i == ii ) cerror( "symbol table full" ); } } #ifndef checkst /* if not debugging, make checkst a macro */ checkst(lev){ register int s, i, j; register struct symtab *p, *q; for( i=0, p=stab; istype == TNULL ) continue; j = lookup( p->sname, p->sflags&(SMOS|STAG) ); if( j != i ){ q = &stab[j]; if( q->stype == UNDEF || q->slevel <= p->slevel ){ #ifndef FLEXNAMES cerror( "check error: %.8s", q->sname ); #else cerror( "check error: %s", q->sname ); #endif } } #ifndef FLEXNAMES else if( p->slevel > lev ) cerror( "%.8s check at level %d", p->sname, lev ); #else else if( p->slevel > lev ) cerror( "%s check at level %d", p->sname, lev ); #endif } } #endif struct symtab * relook(p) register struct symtab *p; { /* look up p again, and see where it lies */ register struct symtab *q; /* I'm not sure that this handles towers of several hidden definitions in all cases */ q = &stab[lookup( p->sname, p->sflags&(STAG|SMOS|SHIDDEN) )]; /* make relook always point to either p or an empty cell */ if( q->stype == UNDEF ){ q->stype = TNULL; return(q); } while( q != p ){ if( q->stype == TNULL ) break; if( ++q >= &stab[SYMTSZ] ) q=stab; } return(q); } clearst( lev ){ /* clear entries of internal scope from the symbol table */ register struct symtab *p, *q, *r; register int temp, rehash; temp = lineno; aobeg(); /* first, find an empty slot to prevent newly hashed entries from being slopped into... */ for( q=stab; q< &stab[SYMTSZ]; ++q ){ if( q->stype == TNULL )goto search; } cerror( "symbol table full"); search: p = q; for(;;){ if( p->stype == TNULL ) { rehash = 0; goto next; } lineno = p->suse; if( lineno < 0 ) lineno = - lineno; if( p->slevel>lev ){ /* must clobber */ if( p->stype == UNDEF || ( p->sclass == ULABEL && lev < 2 ) ){ lineno = temp; #ifndef FLEXNAMES uerror( "%.8s undefined", p->sname ); #else uerror( "%s undefined", p->sname ); #endif } else aocode(p); # ifndef BUG1 #ifndef FLEXNAMES if (ddebug) printf("removing %8s from stab[ %d], flags %o level %d\n", #else if (ddebug) printf("removing %s from stab[ %d], flags %o level %d\n", #endif p->sname,p-stab,p->sflags,p->slevel); # endif if( p->sflags & SHIDES ) unhide(p); p->stype = TNULL; rehash = 1; goto next; } if( rehash ){ if( (r=relook(p)) != p ){ movestab( r, p ); p->stype = TNULL; } } next: if( ++p >= &stab[SYMTSZ] ) p = stab; if( p == q ) break; } lineno = temp; aoend(); } movestab( p, q ) register struct symtab *p, *q; { int k; /* structure assignment: *p = *q; */ p->stype = q->stype; p->sclass = q->sclass; p->slevel = q->slevel; p->offset = q->offset; p->sflags = q->sflags; p->dimoff = q->dimoff; p->sizoff = q->sizoff; p->suse = q->suse; #ifndef FLEXNAMES for( k=0; ksname[k] = q->sname[k]; } #else p->sname = q->sname; #endif } hide( p ) register struct symtab *p; { register struct symtab *q; for( q=p+1; ; ++q ){ if( q >= &stab[SYMTSZ] ) q = stab; if( q == p ) cerror( "symbol table full" ); if( q->stype == TNULL ) break; } movestab( q, p ); p->sflags |= SHIDDEN; q->sflags = (p->sflags&(SMOS|STAG)) | SHIDES; #ifndef FLEXNAMES if( hflag ) werror( "%.8s redefinition hides earlier one", p->sname ); #else if( hflag ) werror( "%s redefinition hides earlier one", p->sname ); #endif # ifndef BUG1 if( ddebug ) printf( " %d hidden in %d\n", p-stab, q-stab ); # endif return( idname = q-stab ); } unhide( p ) register struct symtab *p; { register struct symtab *q; register s, j; s = p->sflags & (SMOS|STAG); q = p; for(;;){ if( q == stab ) q = &stab[SYMTSZ-1]; else --q; if( q == p ) break; if( (q->sflags&(SMOS|STAG)) == s ){ #ifndef FLEXNAMES for( j =0; jsname[j] != q->sname[j] ) break; if( j == NCHNAM ){ /* found the name */ #else if (p->sname == q->sname) { #endif q->sflags &= ~SHIDDEN; # ifndef BUG1 if( ddebug ) printf( "unhide uncovered %d from %d\n", q-stab,p-stab); # endif return; } } } cerror( "unhide fails" ); } >sflags & (SMOS|STAG); q = p; for(;;){ if( q == stab ) q = &stab[SYMTSZ-1]; else --q; if( q == p ) break; if( (q->sflags&(SMOS|STAG)) =cmd/mip/reader.c 644 0 33 61626 2416242241 7021 static char *sccsid ="%W% (Berkeley) %G%"; # include "mfile2" /* some storage declarations */ # ifndef ONEPASS NODE node[TREESZ]; char filename[100] = ""; /* the name of the file */ int ftnno; /* number of current function */ int lineno; # else # define NOMAIN #endif int nrecur; int lflag; extern int Wflag; int edebug = 0; int xdebug = 0; int udebug = 0; int vdebug = 0; OFFSZ tmpoff; /* offset for first temporary, in bits for current block */ OFFSZ maxoff; /* maximum temporary offset over all blocks in current ftn, in bits */ int maxtreg; NODE *stotree; int stocook; OFFSZ baseoff = 0; OFFSZ maxtemp = 0; p2init( argc, argv ) char *argv[];{ /* set the values of the pass 2 arguments */ register int c; register char *cp; register files; allo0(); /* free all regs */ files = 0; for( c=1; c argc ) return( nerrors ); freopen( argv[files], "r", stdin ); } while( (c=getchar()) > 0 ) switch( c ){ case ')': default: /* copy line unchanged */ if ( c != ')' ) PUTCHAR( c ); /* initial tab */ while( (c=getchar()) > 0 ){ PUTCHAR(c); if( c == '\n' ) break; } continue; case BBEG: /* beginning of a block */ temp = rdin(10); /* ftnno */ tmpoff = baseoff = (unsigned int) rdin(10); /* autooff for block gives max offset of autos in block */ maxtreg = rdin(10); if( getchar() != '\n' ) cerror( "intermediate file format error"); if( temp != ftnno ){ /* beginning of function */ maxoff = baseoff; ftnno = temp; maxtemp = 0; } else { if( baseoff > maxoff ) maxoff = baseoff; /* maxoff at end of ftn is max of autos and temps over all blocks in the function */ } setregs(); continue; case BEND: /* end of block */ SETOFF( maxoff, ALSTACK ); eobl2(); while( (c=getchar()) != '\n' ){ if( c <= 0 ) cerror( "intermediate file format eof" ); } continue; case EXPR: /* compile code for an expression */ lineno = rdin( 10 ); for( cp=filename; (*cp=getchar()) != '\n'; ++cp ) ; /* VOID, reads filename */ *cp = '\0'; if( lflag ) lineid( lineno, filename ); tmpoff = baseoff; /* expression at top level reuses temps */ p = eread(); # ifndef BUG4 if( edebug ) fwalk( p, eprint, 0 ); # endif # ifdef MYREADER MYREADER(p); /* do your own laundering of the input */ # endif nrecur = 0; delay( p ); /* expression statement throws out results */ reclaim( p, RNULL, 0 ); allchk(); tcheck(); continue; default: cerror( "intermediate file format error" ); } /* EOF */ if( files ) goto reread; return(nerrors); } # endif # ifdef ONEPASS p2compile( p ) NODE *p; { if( lflag ) lineid( lineno, filename ); tmpoff = baseoff; /* expression at top level reuses temps */ /* generate code for the tree p */ # ifndef BUG4 if( edebug ) fwalk( p, eprint, 0 ); # endif # ifdef MYREADER MYREADER(p); /* do your own laundering of the input */ # endif nrecur = 0; delay( p ); /* do the code generation */ reclaim( p, RNULL, 0 ); allchk(); /* can't do tcheck here; some stuff (e.g., attributes) may be around from first pass */ /* first pass will do it... */ } p2bbeg( aoff, myreg ) { static int myftn = -1; tmpoff = baseoff = (unsigned int) aoff; maxtreg = myreg; if( myftn != ftnno ){ /* beginning of function */ maxoff = baseoff; myftn = ftnno; maxtemp = 0; } else { if( baseoff > maxoff ) maxoff = baseoff; /* maxoff at end of ftn is max of autos and temps over all blocks */ } setregs(); } p2bend(){ SETOFF( maxoff, ALSTACK ); eobl2(); } # endif NODE *deltrees[DELAYS]; int deli; delay( p ) register NODE *p; { /* look in all legal places for COMOP's and ++ and -- ops to delay */ /* note; don't delay ++ and -- within calls or things like /* getchar (in their macro forms) will start behaving strangely */ register i; /* look for visible COMOPS, and rewrite repeatedly */ while( delay1( p ) ) { /* VOID */ } /* look for visible, delayable ++ and -- */ deli = 0; delay2( p ); codgen( p, FOREFF ); /* do what is left */ for( i = 0; iin.op; ty = optype( o ); if( ty == LTYPE ) return( 0 ); else if( ty == UTYPE ) return( delay1( p->in.left ) ); switch( o ){ case QUEST: case ANDAND: case OROR: /* don't look on RHS */ return( delay1(p->in.left ) ); case COMOP: /* the meat of the routine */ delay( p->in.left ); /* completely evaluate the LHS */ /* rewrite the COMOP */ { register NODE *q; q = p->in.right; ncopy( p, p->in.right ); q->in.op = FREE; } return( 1 ); } return( delay1(p->in.left) || delay1(p->in.right ) ); } delay2( p ) register NODE *p; { /* look for delayable ++ and -- operators */ register o, ty; o = p->in.op; ty = optype( o ); switch( o ){ case NOT: case QUEST: case ANDAND: case OROR: case CALL: case UNARY CALL: case STCALL: case UNARY STCALL: case FORTCALL: case UNARY FORTCALL: case COMOP: case CBRANCH: /* for the moment, don7t delay past a conditional context, or /* inside of a call */ return; case UNARY MUL: /* if *p++, do not rewrite */ if( autoincr( p ) ) return; break; case INCR: case DECR: if( deltest( p ) ){ if( deli < DELAYS ){ register NODE *q; deltrees[deli++] = tcopy(p); q = p->in.left; p->in.right->in.op = FREE; /* zap constant */ ncopy( p, q ); q->in.op = FREE; return; } } } if( ty == BITYPE ) delay2( p->in.right ); if( ty != LTYPE ) delay2( p->in.left ); } codgen( p, cookie ) NODE *p; { /* generate the code for p; order may call codgen recursively */ /* cookie is used to describe the context */ for(;;){ canon(p); /* creats OREG from * if possible and does sucomp */ stotree = NIL; # ifndef BUG4 if( edebug ){ printf( "store called on:\n" ); fwalk( p, eprint, 0 ); } # endif store(p); if( stotree==NIL ) break; /* because it's minimal, can do w.o. stores */ order( stotree, stocook ); } order( p, cookie ); } # ifndef BUG4 char *cnames[] = { "SANY", "SAREG", "STAREG", "SBREG", "STBREG", "SCC", "SNAME", "SCON", "SFLD", "SOREG", # ifdef WCARD1 "WCARD1", # else "STARNM", # endif # ifdef WCARD2" "WCARD2", # else "STARREG", # endif "INTEMP", "FORARG", "SWADD", 0, }; prcook( cookie ){ /* print a nice-looking description of cookie */ int i, flag; if( cookie & SPECIAL ){ if( cookie == SZERO ) printf( "SZERO" ); else if( cookie == SONE ) printf( "SONE" ); else if( cookie == SMONE ) printf( "SMONE" ); else printf( "SPECIAL+%d", cookie & ~SPECIAL ); return; } flag = 0; for( i=0; cnames[i]; ++i ){ if( cookie & (1<in.rall ); goto first; /* by this time, p should be able to be generated without stores; the only question is how */ again: if ( p->in.op == FREE ) return; /* whole tree was done */ cookie = cook; rcount(); canon(p); rallo( p, p->in.rall ); /* if any rewriting and canonicalization has put * the tree (p) into a shape that cook is happy * with (exclusive of FOREFF, FORREW, and INTEMP) * then we are done. * this allows us to call order with shapes in * addition to cookies and stop short if possible. */ if( tshape(p, cook &(~(FOREFF|FORREW|INTEMP))) )return; first: # ifndef BUG4 if( odebug ){ printf( "order( %o, ", p ); prcook( cookie ); printf( " )\n" ); fwalk( p, eprint, 0 ); } # endif o = p->in.op; ty = optype(o); /* first of all, for most ops, see if it is in the table */ /* look for ops */ switch( m = p->in.op ){ default: /* look for op in table */ for(;;){ if( (m = match( p, cookie ) ) == MDONE ) goto cleanup; else if( m == MNOPE ){ if( !(cookie = nextcook( p, cookie ) ) ) goto nomat; continue; } else break; } break; case COMOP: case FORCE: case CBRANCH: case QUEST: case ANDAND: case OROR: case NOT: case UNARY CALL: case CALL: case UNARY STCALL: case STCALL: case UNARY FORTCALL: case FORTCALL: /* don't even go near the table... */ ; } /* get here to do rewriting if no match or fall through from above for hard ops */ p1 = p->in.left; if( ty == BITYPE ) p2 = p->in.right; else p2 = NIL; # ifndef BUG4 if( odebug ){ printf( "order( %o, ", p ); prcook( cook ); printf( " ), cookie " ); prcook( cookie ); printf( ", rewrite %s\n", opst[m] ); } # endif switch( m ){ default: nomat: cerror( "no table entry for op %s", opst[p->in.op] ); case COMOP: codgen( p1, FOREFF ); p2->in.rall = p->in.rall; codgen( p2, cookie ); ncopy( p, p2 ); p2->in.op = FREE; goto cleanup; case FORCE: /* recurse, letting the work be done by rallo */ p = p->in.left; cook = INTAREG|INTBREG; goto again; case CBRANCH: o = p2->tn.lval; cbranch( p1, -1, o ); p2->in.op = FREE; p->in.op = FREE; return; case QUEST: cbranch( p1, -1, m=getlab() ); p2->in.left->in.rall = p->in.rall; codgen( p2->in.left, INTAREG|INTBREG ); /* force right to compute result into same reg used by left */ p2->in.right->in.rall = p2->in.left->tn.rval|MUSTDO; reclaim( p2->in.left, RNULL, 0 ); cbgen( 0, m1 = getlab(), 'I' ); deflab( m ); codgen( p2->in.right, INTAREG|INTBREG ); deflab( m1 ); p->in.op = REG; /* set up node describing result */ p->tn.lval = 0; p->tn.rval = p2->in.right->tn.rval; p->in.type = p2->in.right->in.type; tfree( p2->in.right ); p2->in.op = FREE; goto cleanup; case ANDAND: case OROR: case NOT: /* logical operators */ /* if here, must be a logical operator for 0-1 value */ cbranch( p, -1, m=getlab() ); p->in.op = CCODES; p->bn.label = m; order( p, INTAREG ); goto cleanup; case FLD: /* fields of funny type */ if ( p1->in.op == UNARY MUL ){ offstar( p1->in.left, cook ); goto again; } case UNARY MINUS: order( p1, INBREG|INAREG ); goto again; case NAME: /* all leaves end up here ... */ if( o == REG ) goto nomat; order( p, INTAREG|INTBREG ); goto again; case INIT: uerror( "illegal initialization" ); return; case UNARY FORTCALL: p((->in.right = NIL; case FORTCALL: o = p->in.op = UNARY FORTCALL; if( genfcall( p, cookie ) ) goto nomat; goto cleanup; case UNARY CALL: p->in.right = NIL; case CALL: o = p->in.op = UNARY CALL; if( gencall( p, cookie ) ) goto nomat; goto cleanup; case UNARY STCALL: p->in.right = NIL; case STCALL: o = p->in.op = UNARY STCALL; if( genscall( p, cookie ) ) goto nomat; goto cleanup; /* if arguments are passed in register, care must be taken that reclaim /* not throw away the register which now has the result... */ case UNARY MUL: if( cook == FOREFF ){ /* do nothing */ order( p->in.left, FOREFF ); p->in.op = FREE; return; } offstar( p->in.left, cook ); goto again; case INCR: /* INCR and DECR */ if( setincr(p, cook) ) goto again; /* x++ becomes (x += 1) -1; */ if( cook & FOREFF ){ /* result not needed so inc or dec and be done with it */ /* x++ => x += 1 */ p->in.op = (p->in.op==INCR)?ASG PLUS:ASG MINUS; goto again; } p1 = tcopy(p); reclaim( p->in.left, RNULL, 0 ); p->in.left = p1; p1->in.op = (p->in.op==INCR)?ASG PLUS:ASG MINUS; p->in.op = (p->in.op==INCR)?MINUS:PLUS; goto again; case STASG: if( setstr( p, cook ) ) goto again; goto nomat; case ASG PLUS: /* and other assignment ops */ if( setasop(p, cook) ) goto again; /* there are assumed to be no side effects in LHS */ p2 = tcopy(p); p->in.op = ASSIGN; reclaim( p->in.right, RNULL, 0 ); p->in.right = p2; canon(p); rallo( p, p->in.rall ); # ifndef BUG4 if( odebug ) fwalk( p, eprint, 0 ); # endif order( p2->in.left, INTBREG|INTAREG ); order( p2, INTBREG|INTAREG ); goto again; case ASSIGN: if( setasg( p, cook ) ) goto again; goto nomat; case BITYPE: if( setbin( p, cook ) ) goto again; /* try to replace binary ops by =ops */ switch(o){ case PLUS: case MINUS: case MUL: case DIV: case MOD: case AND: case OR: case ER: case LS: case RS: p->in.op = ASG o; goto again; } goto nomat; } cleanup: /* if it is not yet in the right state, put it there */ if( cook & FOREFF ){ reclaim( p, RNULL, 0 ); return; } if( p->in.op==FREE ) return; if( tshape( p, cook ) ) return; if( (m=match(p,cook) ) == MDONE ) return; /* we are in bad shape, try one last chance */ if( lastchance( p, cook ) ) goto again; goto nomat; } int callflag; int fregs; store( p ) register NODE *p; { /* find a subtree of p which should be stored */ register o, ty; o = p->in.op; ty = optype(o); if( ty == LTYPE ) return; switch( o ){ case UNARY CALL: case UNARY FORTCALL: case UNARY STCALL: ++callflag; break; case UNARY MUL: if( asgop(p->in.left->in.op) ) stoasg( p->in.left, UNARY MUL ); break; case CALL: case FORTCALL: case STCALL: store( p->in.left ); stoarg( p->in.right, o ); ++callflag; return; case COMOP: markcall( p->in.right ); if( p->in.right->in.su > fregs ) SETSTO( p, INTEMP ); store( p->in.left ); return; case ANDAND: case OROR: case QUEST: markcall( p->in.right ); if( p->in.right->in.su > fregs ) SETSTO( p, INTEMP ); case CBRANCH: /* to prevent complicated expressions on the LHS from being stored */ case NOT: constore( p->in.left ); return; } if( ty == UTYPE ){ store( p->in.left ); return; } if( asgop( p->in.right->in.op ) ) stoasg( p->in.right, o ); if( p->in.su>fregs ){ /* must store */ mkadrs( p ); /* set up stotree and stocook to subtree that must be stored */ } store( p->in.right ); store( p->in.left ); } constore( p ) register NODE *p; { /* store conditional expressions */ /* the point is, avoid storing expressions in conditional conditional context, since the evaluation order is predetermined */ switch( p->in.op ) { case ANDAND: case OROR: case QUEST: markcall( p->in.right ); case NOT: constore( p->in.left ); return; } store( p ); } markcall( p ) register NODE *p; { /* mark off calls below the current node */ again: switch( p->in.op ){ case UNARY CALL: case UNARY STCALL: case UNARY FORTCALL: case CALL: case STCALL: case FORTCALL: ++callflag; return; } switch( optype( p->in.op ) ){ case BITYPE: markcall( p->in.right ); case UTYPE: p = p->in.left; /* eliminate recursion (aren't I clever...) */ goto again; case LTYPE: return; } } stoarg( p, calltype ) register NODE *p; { /* arrange to store the args */ if( p->in.op == CM ){ stoarg( p->in.left, calltype ); p = p->in.right ; } if( calltype == CALL ){ STOARG(p); } else if( calltype == STCALL ){ STOSTARG(p); } else { STOFARG(p); } callflag = 0; store(p); # ifndef NESTCALLS if( callflag ){ /* prevent two calls from being active at once */ SETSTO(p,INTEMP); store(p); /* do again to preserve bottom up nature.... */ } #endif } int negrel[] = { NE, EQ, GT, GE, LT, LE, UGT, UGE, ULT, ULE } ; /* negatives of relationals */ cbranch( p, true, false ) NODE *p; { /* evaluate p for truth value, and branch to true or false /* accordingly: label <0 means fall through */ register o, lab, flab, tlab; lab = -1; switch( o=p->in.op ){ case ULE: case ULT: case UGE: case UGT: case EQ: case NE: case LE: case LT: case GE: case GT: if( true < 0 ){ o = p->in.op = negrel[ o-EQ ]; true = false; false = -1; } #ifndef NOOPT if( p->in.right->in.op == ICON && p->in.right->tn.lval == 0 && p->in.right->in.name[0] == '\0' ){ switch( o ){ case UGT: case ULE: o = p->in.op = (o==UGT)?NE:EQ; case EQ: case NE: case LE: case LT: case GE: case GT: if( logop(p->in.left->in.op) ){ /* strange situation: e.g., (a!=0) == 0 */ /* must prevent reference to p->in.left->lable, so get 0/1 */ /* we could optimize, but why bother */ codgen( p->in.left, INAREG|INBREG ); } codgen( p->in.left, FORCC ); cbgen( o, true, 'I' ); break; case UGE: codgen(p->in.left, FORCC); cbgen( 0, true, 'I' ); /* unconditional branch */ break; case ULT: codgen(p->in.left, FORCC); } } else #endif { p->bn.label = true; codgen( p, FORCC ); } if( false>=0 ) cbgen( 0, false, 'I' ); reclaim( p, RNULL, 0 ); return; case ANDAND: lab = false<0 ? getlab() : false ; cbranch( p->in.left, -1, lab ); cbranch( p->in.right, true, false ); if( false < 0 ) deflab( lab ); p->in.op = FREE; return; case OROR: lab = true<0 ? getlab() : true; cbranch( p->in.left, lab, -1 ); cbranch( p->in.right, true, false ); if( true < 0 ) deflab( lab ); p->in.op = FREE; return; case NOT: cbranch( p->in.left, false, true ); p->in.op = FREE; break; case COMOP: codgen( p->in.left, FOREFF ); p->in.op = FREE; cbranch( p->in.right, true, false ); return; case QUEST: flab = false<0 ? getlab() : false; tlab = true<0 ? getlab() : true; cbranch( p->in.left, -1, lab = getlab() ); cbranch( p->in.right->in.left, tlab, flab ); deflab( lab ); cbranch( p->in.right->in.right, true, false ); if( true < 0 ) deflab( tlab); if( false < 0 ) deflab( flab ); p->in.right->in.op = FREE; p->in.op = FREE; return; case ICON: if( p->in.type != FLOAT && p->in.type != DOUBLE ){ if( p->tn.lval || p->in.name[0] ){ /* addresses of C objects are never 0 */ if( true>=0 ) cbgen( 0, true, 'I' ); } else if( false>=0 ) cbgen( 0, false, 'I' ); p->in.op = FREE; return; } /* fall through to default with other strange constants */ default: /* get condition codes */ codgen( p, FORCC ); if( true >= 0 ) cbgen( NE, true, 'I' ); if( false >= 0 ) cbgen( true >= 0 ? 0 : EQ, false, 'I' ); reclaim( p, RNULL, 0 ); return; } } rcount(){ /* count recursions */ if( ++nrecur > NRECUR ){ cerror( "expression causes compiler loop: try simplifying" ); } } # ifndef BUG4 eprint( p, down, a, b ) NODE *p; int *a, *b; { *a = *b = down+1; while( down >= 2 ){ printf( "\t" ); down -= 2; } if( down-- ) printf( " " ); printf( "%o) %s", p, opst[p->in.op] ); switch( p->in.op ) { /* special cases */ case REG: printf( " %s", rnames[p->tn.rval] ); break; case ICON: case NAME: case OREG: printf( " " ); adrput( p ); break; case STCALL: case UNARY STCALL: case STARG: case STASG: printf( " size=%d", p->stn.stsize ); printf( " align=%d", p->stn.stalign ); break; } printf( ", " ); tprint( p->in.type ); printf( ", " ); if( p->in.rall == NOPREF ) printf( "NOPREF" ); else { if( p->in.rall & MUSTDO ) printf( "MUSTDO " ); else printf( "PREF " ); printf( "%s", rnames[p->in.rall&~MUSTDO]); } printf( ", SU= %d\n", p->in.su ); } # endif # ifndef NOMAIN NODE * eread(){ /* call eread recursively to get subtrees, if any */ register NODE *p; register i, c; register char *pc; register j; i = rdin( 10 ); p = talloc(); p->in.op = i; i = optype(i); if( i == LTYPE ) p->tn.lval = rdin( 10 ); if( i != BITYPE ) p->tn.rval = rdin( 10 ); p->in.type = rdin(8 ); p->in.rall = NOPREF; /* register allocation information */ if( p->in.op == STASG || p->in.op == STARG || p->in.op == STCALL || p->in.op == UNARY STCALL ){ p->stn.stsize = (rdin( 10 ) + (SZCHAR-1) )/SZCHAR; p->stn.stalign = rdin(10) / SZCHAR; if( getchar() != '\n' ) cerror( "illegal \n" ); } else { /* usual case */ if( p->in.op == REG ) rbusy( p->tn.rval, p->in.type ); /* non usually, but sometimes justified */ #ifndef FLEXNAMES for( pc=p->in.name,j=0; ( c = getchar() ) != '\n'; ++j ){ if( j < NCHNAM ) *pc++ = c; } if( j < NCHNAM ) *pc = '\0'; #else { char buf[BUFSIZ]; for( pc=buf,j=0; ( c = getchar() ) != '\n'; ++j ){ if( j < BUFSIZ ) *pc++ = c; } if( j < BUFSIZ ) *pc = '\0'; p->in.name = tstr(buf); } #endif } /* now, recursively read descendents, if any */ if( i != LTYPE ) p->in.left = eread(); if( i == BITYPE ) p->in.right = eread(); return( p ); } CONSZ rdin( base ){ register sign, c; CONSZ val; sign = 1; val = 0; while( (c=getchar()) > 0 ) { if( c == '-' ){ if( val != 0 ) cerror( "illegal -"); sign = -sign; continue; } if( c == '\t' ) break; if( c>='0' && c<='9' ) { val *= base; if( sign > 0 ) val +((= c-'0'; else val -= c-'0'; continue; } cerror( "illegal character `%c' on intermediate file", c ); break; } if( c <= 0 ) { cerror( "unexpected EOF"); } return( val ); } # endif #ifndef FIELDOPS /* do this if there is no special hardware support for fields */ ffld( p, down, down1, down2 ) NODE *p; int *down1, *down2; { /* look for fields that are not in an lvalue context, and rewrite them... */ register NODE *shp; register s, o, v, ty; *down1 = asgop( p->in.op ); *down2 = 0; if( !down && p->in.op == FLD ){ /* rewrite the node */ if( !rewfld(p) ) return; ty = (szty(p->in.type) == 2)? LONG: INT; v = p->tn.rval; s = UPKFSZ(v); # ifdef RTOLBYTES o = UPKFOFF(v); /* amount to shift */ # else o = szty(p->in.type)*SZINT - s - UPKFOFF(v); /* amount to shift */ #endif /* make & mask part */ p->in.left->in.type = ty; p->in.op = AND; p->in.right = talloc(); p->in.right->in.op = ICON; p->in.right->in.rall = NOPREF; p->in.right->in.type = ty; p->in.right->tn.lval = 1; p->in.right->tn.rval = 0; #ifndef FLEXNAMES p->in.right->in.name[0] = '\0'; #else p->in.right->in.name = ""; #endif p->in.right->tn.lval <<= s; p->in.right->tn.lval--; /* now, if a shift is needed, do it */ if( o != 0 ){ shp = talloc(); shp->in.op = RS; shp->in.rall = NOPREF; shp->in.type = ty; shp->in.left = p->in.left; shp->in.right = talloc(); shp->in.right->in.op = ICON; shp->in.right->in.rall = NOPREF; shp->in.right->in.type = ty; shp->in.right->tn.rval = 0; shp->in.right->tn.lval = o; /* amount to shift */ #ifndef FLEXNAMES shp->in.right->in.name[0] = '\0'; #else shp->in.right->in.name = ""; #endif p->in.left = shp; /* whew! */ } } } #endif oreg2( p ) register NODE *p; { /* look for situations where we can turn * into OREG */ NODE *q; register i; register r; register char *cp; register NODE *ql, *qr; CONSZ temp; if( p->in.op == UNARY MUL ){ q = p->in.left; if( q->in.op == REG ){ temp = q->tn.lval; r = q->tn.rval; cp = q->in.name; goto ormake; } if( q->in.op != PLUS && q->in.op != MINUS ) return; ql = q->in.left; qr = q->in.right; #ifdef R2REGS /* look for doubly indexed expressions */ if( q->in.op == PLUS) { if( (r=base(ql))>=0 && (i=offset(qr, tlen(p)))>=0) { makeor2(p, ql, r, i); return; } else if( (r=base(qr))>=0 && (i=offset(ql, tlen(p)))>=0) { makeor2(p, qr, r, i); return; } } #endif if( (q->in.op==PLUS || q->in.op==MINUS) && qr->in.op == ICON && ql->in.op==REG && szty(qr->in.type)==1) { temp = qr->tn.lval; if( q->in.op == MINUS ) temp = -temp; r = ql->tn.rval; temp += ql->tn.lval; cp = qr->in.name; if( *cp && ( q->in.op == MINUS || *ql->in.name ) ) return; if( !*cp ) cp = ql->in.name; ormake: if( notoff( p->in.type, r, temp, cp ) ) return; p->in.op = OREG; p->tn.rval = r; p->tn.lval = temp; #ifndef FLEXNAMES for( i=0; iin.name[i] = *cp++; #else p->in.name = cp; #endif tfree(q); return; } } } canon(p) NODE *p; { /* put p in canonical form */ int oreg2(), sucomp(); #ifndef FIELDOPS int ffld(); fwalk( p, ffld, 0 ); /* look for field operators */ # endif walkf( p, oreg2 ); /* look for and create OREG nodes */ #ifdef MYCANON MYCANON(p); /* your own canonicalization routine(s) */ #endif walkf( p, sucomp ); /* do the Sethi-Ullman computation */ } fndef FLEXNAMES for( i=0; iin.name[i] = *cp++; #else p->in.name = cp; #endif cmd/mip/scan.c 644 0 33 53313 2416242252 6477 static char *sccsid ="%W% (Berkeley) %G%"; # include "mfile1" # include # include # include /* temporarily */ int asm_esc = 0; /* asm escaped used in file */ /* lexical actions */ # define A_ERR 0 /* illegal character */ # define A_LET 1 /* saw a letter */ # define A_DIG 2 /* saw a digit */ # define A_1C 3 /* return a single character */ # define A_STR 4 /* string */ # define A_CC 5 /* character constant */ # define A_BCD 6 /* GCOS BCD constant */ # define A_SL 7 /* saw a / */ # define A_DOT 8 /* saw a . */ # define A_PL 9 /* + */ # define A_MI 10 /* - */ # define A_EQ 11 /* = */ # define A_NOT 12 /* ! */ # define A_LT 13 /* < */ # define A_GT 14 /* > */ # define A_AND 16 /* & */ # define A_OR 17 /* | */ # define A_WS 18 /* whitespace (not \n) */ # define A_NL 19 /* \n */ /* character classes */ # define LEXLET 01 # define LEXDIG 02 # define LEXOCT 04 # define LEXHEX 010 # define LEXWS 020 # define LEXDOT 040 /* reserved word actions */ # define AR_TY 0 /* type word */ # define AR_RW 1 /* simple reserved word */ # define AR_CL 2 /* storage class word */ # define AR_S 3 /* struct */ # define AR_U 4 /* union */ # define AR_E 5 /* enum */ # define AR_A 6 /* asm */ /* text buffer */ #ifndef FLEXNAMES # define LXTSZ 100 #else #define LXTSZ BUFSIZ #endif char yytext[LXTSZ]; char * lxgcp; extern int proflg; extern int gdebug; #ifndef LINT extern int lastloc; #endif unsigned caloff(); /* ARGSUSED */ mainp1( argc, argv ) int argc; char *argv[]; { /* control multiple files */ register i; register char *cp; extern int idebug, bdebug, tdebug, edebug, ddebug, xdebug, gdebug; extern unsigned int offsz; int fdef = 0; char *release = "PCC/364r1 vax uts3.0"; offsz = caloff(); for( i=1; i', A_GT, RELOP, GT, '=', A_EQ, ASSIGN, ASSIGN, -1, A_1C, 0, 0, }; struct lxdope *lxcp[CSSZ+1]; lxinit(){ register struct lxdope *p; register i; register char *cp; /* set up character classes */ lxenter( "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$", LEXLET ); lxenter( "0123456789", LEXDIG ); lxenter( "0123456789abcdefABCDEF", LEXHEX ); /* \013 should become \v someday; \013 is OK for ASCII and EBCDIC */ lxenter( " \t\r\b\f\013", LEXWS ); lxenter( "01234567", LEXOCT ); lxmask['.'+1] |= LEXDOT; /* make lxcp point to appropriate lxdope entry for each character */ /* initialize error entries */ for( i= 0; i<=CSSZ; ++i ) lxcp[i] = lxdope; /* make unique entries */ for( p=lxdope; ; ++p ) { lxcp[p->lxch+1] = p; if( p->lxch < 0 ) break; } /* handle letters, digits, and whitespace */ /* by convention, first, second, and third places */ cp = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$"; while( *cp ) lxcp[*cp++ + 1] = &lxdope[1]; cp = "123456789"; while( *cp ) lxcp[*cp++ + 1] = &lxdope[2]; cp = "\t\b\r\f\013"; while( *cp ) lxcp[*cp++ + 1] = &lxdope[3]; /* first line might have title */ lxtitle(); } int lxmatch; /* character to be matched in char or string constant */ lxstr(ct){ /* match a string or character constant, up to lxmatch */ register c; register val; register i;(( i=0; while( (c=getchar()) != lxmatch ){ switch( c ) { case EOF: uerror( "unexpected EOF" ); break; case '\n': uerror( "newline in string or char constant" ); ++lineno; break; case '\\': switch( c = getchar() ){ case '\n': ++lineno; continue; default: val = c; goto mkcc; case 'n': val = '\n'; goto mkcc; case 'r': val = '\r'; goto mkcc; case 'b': val = '\b'; goto mkcc; case 't': val = '\t'; goto mkcc; case 'f': val = '\f'; goto mkcc; case 'v': val = '\013'; goto mkcc; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': val = c-'0'; c=getchar(); /* try for 2 */ if( lxmask[c+1] & LEXOCT ){ val = (val<<3) | (c-'0'); c = getchar(); /* try for 3 */ if( lxmask[c+1] & LEXOCT ){ val = (val<<3) | (c-'0'); } else ungetc( c ,stdin); } else ungetc( c ,stdin); goto mkcc1; } default: val =c; mkcc: val = CCTRANS(val); mkcc1: if( lxmatch == '\'' ){ val = CHARCAST(val); /* it is, after all, a "character" constant */ makecc( val, i ); } else { /* stash the byte into the string */ if( strflg ) { if( ct==0 || i(SZINT/SZCHAR) || ( (pflag||hflag)&&i>1) ) uerror( "too many characters in character constant" ); } } lxcom(){ register c; /* saw a /*: process a comment */ for(;;){ switch( c = getchar() ){ case EOF: uerror( "unexpected EOF" ); return; case '\n': ++lineno; default: continue; case '*': if( (c = getchar()) == '/' ) return; else ungetc( c ,stdin); continue; # ifdef LINT case 'V': lxget( c, LEXLET|LEXDIG ); { extern int vaflag; int i; i = yytext[7]?yytext[7]-'0':0; yytext[7] = '\0'; if( strcmp( yytext, "VARARGS" ) ) continue; vaflag = i; continue; } case 'L': lxget( c, LEXLET ); if( strcmp( yytext, "LINTLIBRARY" ) ) continue; { extern int libflag; libflag = 1; } continue; case 'A': lxget( c, LEXLET ); if( strcmp( yytext, "ARGSUSED" ) ) continue; { extern int argflag, vflag; argflag = 1; vflag = 0; } continue; case 'N': lxget( c, LEXLET ); if( strcmp( yytext, "NOTREACHED" ) ) continue; reached = 0; continue; # endif } } } yylex(){ for(;;){ register lxchar; register struct lxdope *p; register struct symtab *sp; int id; switch( (p=lxcp[(lxchar=getchar())+1])->lxact ){ onechar: ungetc( lxchar ,stdin); case A_1C: /* eat up a single character, and return an opcode */ yylval.intval = p->lxval; return( p->lxtok ); case A_ERR: uerror( "illegal character: %03o (octal)", lxchar ); break; case A_LET: /* collect an identifier, check for reserved word, and return */ lxget( lxchar, LEXLET|LEXDIG ); if( (lxchar=lxres()) > 0 ) return( lxchar ); /* reserved word */ if( lxchar== 0 ) continue; #ifdef FLEXNAMES id = lookup( hash(yytext), #else id = lookup( yytext, #endif /* tag name for struct/union/enum */ (stwart&TAGNAME)? STAG: /* member name for struct/union */ (stwart&(INSTRUCT|INUNION|FUNNYNAME))?SMOS:0 ); sp = &stab[id]; if( sp->sclass == TYPEDEF && !stwart ){ stwart = instruct; yylval.nodep = mkty( sp->stype, sp->dimoff, sp->sizoff ); return( TYPE ); } stwart = (stwart&SEENAME) ? instruct : 0; yylval.intval = id; return( NAME ); case A_DIG: /* collect a digit string, then look at last one... */ lastcon = 0; lxget( lxchar, LEXDIG ); switch( lxchar=getchar() ){ case 'x': case 'X': if( yytext[0] != '0' && !yytext[1] ) uerror( "illegal hex constant" ); lxmore( lxchar, LEXHEX ); /* convert the value */ { register char *cp; for( cp = yytext+2; *cp; ++cp ){ /* this code won't work for all wild character sets, but seems ok for ascii and ebcdic */ lastcon <<= 4; if( isdigit( *cp ) ) lastcon += *cp-'0'; else if( isupper( *cp ) ) lastcon += *cp - 'A'+ 10; else lastcon += *cp - 'a'+ 10; } } hexlong: /* criterion for longness for hex and octal constants is that it fit within 0177777 */ if( lastcon & ~0177777L ) yylval.intval = 1; else yylval.intval = 0; goto islong; case '.': lxmore( lxchar, LEXDIG ); getfp: if( (lxchar=getchar()) == 'e' || lxchar == 'E' ){ /* exponent */ case 'e': case 'E': if( (lxchar=getchar()) == '+' || lxchar == '-' ){ *lxgcp++ = 'e'; } else { ungetc(lxchar,stdin); lxchar = 'e'; } lxmore( lxchar, LEXDIG ); /* now have the whole thing... */ } else { /* no exponent */ ungetc( lxchar ,stdin); } return( isitfloat( yytext ) ); default: ungetc( lxchar ,stdin); if( yytext[0] == '0' ){ /* convert in octal */ register char *cp; for( cp = yytext+1; *cp; ++cp ){ lastcon <<= 3; lastcon += *cp - '0'; } goto hexlong; } else { /* convert in decimal */ register char *cp; for( cp = yytext; *cp; ++cp ){ lastcon = lastcon * 10 + *cp - '0'; } } /* decide if it is long or not (decimal case) */ /* if it is positive and fits in 15 bits, or negative and and fits in 15 bits plus an extended sign, it is int; otherwise long */ /* if there is an l or L following, all bets are off... */ { CONSZ v; v = lastcon & ~077777L; if( v == 0 || v == ~077777L ) yylval.intval = 0; else yylval.intval = 1; } islong: /* finally, look for trailing L or l */ if( (lxchar = getchar()) == 'L' || lxchar == 'l' ) yylval.intval = 1; else ungetc( lxchar ,stdin); return( ICON ); } case A_DOT: /* look for a dot: if followed by a digit, floating point */ lxchar = getchar(); if( lxmask[lxchar+1] & LEXDIG ){ ungetc(lxchar,stdin); lxget( '.', LEXDIG ); goto getfp; } stwart = FUNNYNAME; goto onechar; case A_STR: /* string constant */ lxmatch = '"'; return( STRING ); case A_CC: /* character constant */ lxmatch = '\''; lastcon = 0; lxstr(0); yylval.intval = 0; return( ICON ); case A_BCD: { register i; int j; for( i=0; i6 ) uerror( "BCD constant exceeds 6 characters" ); # ifdef gcos else strtob( yytext, &lastcon, i ); lastcon >>= 6*(6-i); # else uerror( "gcos BCD constant illegal" ); # endif yylval.intval = 0; /* not long */ return( ICON ); } case A_SL: /* / */ if( (lxchar=getchar()) != '*' ) goto onechar; lxcom(); case A_WS: continue; case A_NL: ++lineno; lxtitle(); continue; case A_NOT: /* ! */ if( (lxchar=getchar()) != '=' ) goto onechar; yylval.intval = NE; return( EQUOP ); case A_MI: /* - */ if( (lxchar=getchar()) == '-' ){ yylval.intval = DECR; return( INCOP ); } if( lxchar != '>' ) goto onechar; stwart = FUNNYNAME; yylval.intval=STREF; return( STROP ); case A_PL: /* + */ if( (lxchar=getchar()) != '+' ) goto onechar; yylval.intval = INCR; return( INCOP ); case A_AND: /* & */ if( (lxchar=getchar()) != '&' ) goto onechar; return( yylval.intval = ANDAND ); case A_OR: /* | */ if( (lxchar=getchar()) != '|' ) goto onechar; return( yylval.intval = OROR ); case A_LT: /* < */ if( (lxchar=getchar()) == '<' ){ yylval.intval = LS; return( SHIFTOP ); } if( lxchar != '=' ) goto onechar; yylval.intval = LE; return( RELOP ); case A_GT: /* > */ if( (lxchar=getchar()) == '>' ){ yylval.intval = RS; return(SHIFTOP ); } if( lxchar != '=' ) goto onechar; yylval.intval = GE; return( RELOP ); case A_EQ: /* = */ switch( lxchar = getchar() ){ case '=': yylval.intval = EQ; return( EQUOP ); case '+': yylval.intval = ASG PLUS; break; case '-': yylval.intval = ASG MINUS; warn: if( lxmask[ (lxchar=getchar())+1] & (LEXLET|LEXDIG|LEXDOT) ){ werror( "ambiguous assignment: assignment op taken" ); } ungetc( lxchar ,stdin); break; case '*': yylval.intval = ASG MUL; goto warn; case '/': yylval.intval = ASG DIV; break; case '%': yylval.intval = ASG MOD; break; case '&': yylval.intval = ASG AND; break; case '|': yylval.intval = ASG OR; break; case '^': yylval.intval = ASG ER; break; case '<': if( (lxchar=getchar()) != '<' ){ uerror( "=<%c illegal", lxchar ); } yylval.intval = ASG LS; break; case '>': if( (lxchar=getchar()) != '>' ){ uerror( "=>%c illegal", lxchar ); } yylval.intval = ASG RS; break; default: goto onechar; } return( ASOP ); default: cerror( "yylex error, character %03o (octal)", lxchar ); } /* ordinarily, repeat here... */ cerror( "out of switch in yylex" ); } } struct lxrdope { /* dope for reserved, in alphabetical order */ char *lxrch; /* name of reserved word */ short lxract; /* reserved word action */ short lxrval; /* value to be returned */ } lxrdope[] = { "asm", AR_A, 0, "auto", AR_CL, AUTO, "break", AR_RW, BREAK, "char", AR_TY, CHAR, "case", AR_RW, CASE, "continue", AR_RW, CONTINUE, "double",(( AR_TY, DOUBLE, "default", AR_RW, DEFAULT, "do", AR_RW, DO, "extern", AR_CL, EXTERN, "else", AR_RW, ELSE, "enum", AR_E, ENUM, "for", AR_RW, FOR, "float", AR_TY, FLOAT, "fortran", AR_CL, FORTRAN, "goto", AR_RW, GOTO, "if", AR_RW, IF, "int", AR_TY, INT, "long", AR_TY, LONG, "return", AR_RW, RETURN, "register", AR_CL, REGISTER, "switch", AR_RW, SWITCH, "struct", AR_S, 0, "sizeof", AR_RW, SIZEOF, "short", AR_TY, SHORT, "static", AR_CL, STATIC, "typedef", AR_CL, TYPEDEF, "unsigned", AR_TY, UNSIGNED, "union", AR_U, 0, "void", AR_TY, UNDEF, /* tymerge adds FTN */ "while", AR_RW, WHILE, "", 0, 0, /* to stop the search */ }; lxres() { /* check to see of yytext is reserved; if so, /* do the appropriate action and return */ /* otherwise, return -1 */ register c, ch; register struct lxrdope *p; ch = yytext[0]; if( !islower(ch) ) return( -1 ); switch( ch ){ case 'a': c=0; break; case 'b': c=2; break; case 'c': c=3; break; case 'd': c=6; break; case 'e': c=9; break; case 'f': c=12; break; case 'g': c=15; break; case 'i': c=16; break; case 'l': c=18; break; case 'r': c=19; break; case 's': c=21; break; case 't': c=26; break; case 'u': c=27; break; case 'v': c=29; break; case 'w': c=30; break; default: return( -1 ); } for( p= lxrdope+c; p->lxrch[0] == ch; ++p ){ if( !strcmp( yytext, p->lxrch ) ){ /* match */ switch( p->lxract ){ case AR_TY: /* type word */ stwart = instruct; yylval.nodep = mkty( (TWORD)p->lxrval, 0, p->lxrval ); return( TYPE ); case AR_RW: /* ordinary reserved word */ return( yylval.intval = p->lxrval ); case AR_CL: /* class word */ yylval.intval = p->lxrval; return( CLASS ); case AR_S: /* struct */ stwart = INSTRUCT|SEENAME|TAGNAME; yylval.intval = INSTRUCT; return( STRUCT ); case AR_U: /* union */ stwart = INUNION|SEENAME|TAGNAME; yylval.intval = INUNION; return( STRUCT ); case AR_E: /* enums */ stwart = SEENAME|TAGNAME; return( yylval.intval = ENUM ); case AR_A: /* asm */ asm_esc = 1; /* warn the world! */ lxget( ' ', LEXWS ); if( getchar() != '(' ) goto badasm; lxget( ' ', LEXWS ); if( getchar() != '"' ) goto badasm; # ifndef ONEPASS # ifndef LINT putchar(')'); # endif # endif while( (c=getchar()) != '"' ){ if( c=='\n' || c==EOF ) goto badasm; # ifndef LINT putchar(c); # endif } lxget( ' ', LEXWS ); if( getchar() != ')' ) goto badasm; # ifndef LINT putchar('\n'); # endif return( 0 ); badasm: uerror( "bad asm construction" ); return( 0 ); default: cerror( "bad AR_?? action" ); } } } return( -1 ); } extern int labelno; lxtitle(){ /* called after a newline; set linenumber and file name */ register c, val; register char *cp, *cq; for(;;){ /* might be several such lines in a row */ if( (c=getchar()) != '#' ){ if( c != EOF ) ungetc(c,stdin); #ifndef LINT if ( lastloc != PROG) return; cp = ftitle; cq = ititle; while ( *cp ) if (*cp++ != *cq++) return; if ( *cq ) return; psline(); #endif return; } lxget( ' ', LEXWS ); val = 0; for( c=getchar(); isdigit(c); c=getchar() ){ val = val*10+ c - '0'; } ungetc( c, stdin ); lineno = val; lxget( ' ', LEXWS ); if( (c=getchar()) != '\n' ){ for( cp=ftitle; c!='\n'; c=getchar(),++cp ){ *cp = c; } *cp = '\0'; #ifndef LINT if (ititle[0] == '\0') { cp = ftitle; cq = ititle; while ( *cp ) *cq++ = *cp++; *cq = '\0'; *--cq = '\0'; #ifndef FLEXNAMES for ( cp = ititle+1; *(cp-1); cp += 8 ) { pstab(cp, N_SO); if (gdebug) printf("0,0,LL%d\n", labelno); } #else pstab(ititle+1, N_SO); if (gdebug) printf("0,0,LL%d\n", labelno); #endif *cq = '"'; printf("LL%d:\n", labelno++); } #endif } } } #ifdef FLEXNAMES #define NSAVETAB 4096 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) cerror("Ran out of memory (savestr)"); } strncpy(savetab, cp, len); cp = savetab; savetab += len; saveleft -= len; return (cp); } /* * The definition for the segmented hash tables. */ #define MAXHASH 20 #define HASHINC 1013 struct ht { char **ht_low; char **ht_high; int ht_used; } htab[MAXHASH]; char * hash(s) char *s; { register char **h; register i; register char *cp; struct ht *htp; int sh; /* * The hash function is a modular hash of * the sum of the characters with the sum * doubled before each successive character * is added. */ cp = s; i = 0; while (*cp) i = i*2 + *cp++; sh = (i&077777) % HASHINC; cp = s; /* * There are as many as MAXHASH active * hash tables at any given point in time. * The search starts with the first table * and continues through the active tables * as necessary. */ for (htp = htab; htp < &htab[MAXHASH]; htp++) { if (htp->ht_low == 0) { register char **hp = (char **) calloc(sizeof (char **), HASHINC); if (hp == 0) cerror("ran out of memory (hash)"); htp->ht_low = hp; htp->ht_high = htp->ht_low + HASHINC; } h = htp->ht_low + sh; /* * quadratic rehash increment * starts at 1 and incremented * by two each rehash. */ i = 1; do { if (*h == 0) { if (htp->ht_used > (HASHINC * 3)/4) break; htp->ht_used++; *h = savestr(cp); return (*h); } if (**h == *cp && strcmp(*h, cp) == 0) return (*h); h += i; i += 2; if (h >= htp->ht_high) h -= HASHINC; } while (i < HASHINC); } cerror("ran out of hash tables"); } #endif p->ht_high = htp->ht_low + HASHINC; } h = htp->ht_low + sh; /* * quadratic rehash increment * starts at 1 and incremented * by two each rehash. */ i = 1; do { if (*h == 0) { if (htp->ht_used > (HASHINC * 3)/4) break; htp->ht_used++; *h = savestr(cp); return (*h);cmd/mip/trees.c 644 0 33 75554 2416242273 6713 static char *sccsid ="%W% (Berkeley) %G%"; # include "mfile1" /* corrections when in violation of lint */ /* some special actions, used in finding the type of nodes */ # define NCVT 01 # define PUN 02 # define TYPL 04 # define TYPR 010 # define TYMATCH 040 # define LVAL 0100 # define CVTO 0200 # define CVTL 0400 # define CVTR 01000 # define PTMATCH 02000 # define OTHER 04000 # define NCVTR 010000 /* node conventions: NAME: rval>0 is stab index for external rval<0 is -inlabel number lval is offset in bits ICON: lval has the value rval has the STAB index, or - label number, if a name whose address is in the constant rval = NONAME means no name REG: rval is reg. identification cookie */ int bdebug = 0; extern ddebug; NODE * buildtree( o, l, r ) register NODE *l, *r; { register NODE *p, *q; register actions; register opty; register struct symtab *sp; register NODE *lr, *ll; int i; extern int eprint(); # ifndef BUG1 if( bdebug ) printf( "buildtree( %s, %o, %o )\n", opst[o], l, r ); # endif opty = optype(o); /* check for constants */ if( opty == UTYPE && l->in.op == ICON ){ switch( o ){ case NOT: if( hflag ) werror( "constant argument to NOT" ); case UNARY MINUS: case COMPL: if( conval( l, o, l ) ) return(l); break; } } else if( o==UNARY MINUS && l->in.op==FCON ){ l->fpn.dval = -l->fpn.dval; return(l); } else if( o==QUEST && l->in.op==ICON ) { l->in.op = FREE; r->in.op = FREE; if( l->tn.lval ){ tfree( r->in.right ); return( r->in.left ); } else { tfree( r->in.left ); return( r->in.right ); } } else if( (o==ANDAND || o==OROR) && (l->in.op==ICON||r->in.op==ICON) ) goto ccwarn; else if( opty == BITYPE && l->in.op == ICON && r->in.op == ICON ){ switch( o ){ case ULT: case UGT: case ULE: case UGE: case LT: case GT: case LE: case GE: case EQ: case NE: case ANDAND: case OROR: case CBRANCH: ccwarn: if( hflag ) werror( "constant in conditional context" ); case PLUS: case MINUS: case MUL: case DIV: case MOD: case AND: case OR: case ER: case LS: case RS: if( conval( l, o, r ) ) { r->in.op = FREE; return(l); } break; } } else if( opty == BITYPE && (l->in.op==FCON||l->in.op==ICON) && (r->in.op==FCON||r->in.op==ICON) ){ switch(o){ case PLUS: case MINUS: case MUL: case DIV: if( l->in.op == ICON ){ l->fpn.dval = l->tn.lval; } if( r->in.op == ICON ){ r->fpn.dval = r->tn.lval; } l->in.op = FCON; l->in.type = l->fn.csiz = DOUBLE; r->in.op = FREE; switch(o){ case PLUS: l->fpn.dval += r->fpn.dval; return(l); case MINUS: l->fpn.dval -= r->fpn.dval; return(l); case MUL: l->fpn.dval *= r->fpn.dval; return(l); case DIV: if( r->fpn.dval == 0 ) uerror( "division by 0." ); else l->fpn.dval /= r->fpn.dval; return(l); } } } /* its real; we must make a new node */ p = block( o, l, r, INT, 0, INT ); actions = opact(p); if( actions&LVAL ){ /* check left descendent */ if( notlval(p->in.left) ) { uerror( "illegal lhs of assignment operator" ); } } if( actions & NCVTR ){ p->in.left = pconvert( p->in.left ); } else if( !(actions & NCVT ) ){ switch( opty ){ case BITYPE: p->in.right = pconvert( p->in.right ); case UTYPE: p->in.left = pconvert( p->in.left ); } } if( (actions&PUN) && (o!=CAST||cflag) ){ chkpun(p); } if( actions & (TYPL|TYPR) ){ q = (actions&TYPL) ? p->in.left : p->in.right; p->in.type = q->in.type; p->((fn.cdim = q->fn.cdim; p->fn.csiz = q->fn.csiz; } if( actions & CVTL ) p = convert( p, CVTL ); if( actions & CVTR ) p = convert( p, CVTR ); if( actions & TYMATCH ) p = tymatch(p); if( actions & PTMATCH ) p = ptmatch(p); if( actions & OTHER ){ l = p->in.left; r = p->in.right; switch(o){ case NAME: sp = &stab[idname]; if( sp->stype == UNDEF ){ #ifndef FLEXNAMES uerror( "%.8s undefined", sp->sname ); #else uerror( "%s undefined", sp->sname ); #endif /* make p look reasonable */ p->in.type = p->fn.cdim = p->fn.csiz = INT; p->tn.rval = idname; p->tn.lval = 0; defid( p, SNULL ); break; } p->in.type = sp->stype; p->fn.cdim = sp->dimoff; p->fn.csiz = sp->sizoff; p->tn.lval = 0; p->tn.rval = idname; /* special case: MOETY is really an ICON... */ if( p->in.type == MOETY ){ p->tn.rval = NONAME; p->tn.lval = sp->offset; p->fn.cdim = 0; p->in.type = ENUMTY; p->in.op = ICON; } break; case ICON: p->in.type = INT; p->fn.cdim = 0; p->fn.csiz = INT; break; case STRING: p->in.op = NAME; p->in.type = CHAR+ARY; p->tn.lval = 0; p->tn.rval = NOLAB; p->fn.cdim = curdim; p->fn.csiz = CHAR; break; case FCON: p->tn.lval = 0; p->tn.rval = 0; p->in.type = DOUBLE; p->fn.cdim = 0; p->fn.csiz = DOUBLE; break; case STREF: /* p->x turned into *(p+offset) */ /* rhs must be a name; check correctness */ i = r->tn.rval; if( i<0 || ((sp= &stab[i])->sclass != MOS && sp->sclass != MOU && !(sp->sclass&FIELD)) ){ uerror( "member of structure or union required" ); }else /* if this name is non-unique, find right one */ if( stab[i].sflags & SNONUNIQ && (l->in.type==PTR+STRTY || l->in.type == PTR+UNIONTY) && (l->fn.csiz +1) >= 0 ){ /* nonunique name && structure defined */ char * memnam, * tabnam; register k; int j; int memi; j=dimtab[l->fn.csiz+1]; for( ; (memi=dimtab[j]) >= 0; ++j ){ tabnam = stab[memi].sname; memnam = stab[i].sname; # ifndef BUG1 if( ddebug>1 ){ #ifndef FLEXNAMES printf("member %.8s==%.8s?\n", #else printf("member %s==%s?\n", #endif memnam, tabnam); } # endif if( stab[memi].sflags & SNONUNIQ ){ #ifndef FLEXNAMES for( k=0; ktn.rval = i = memi; break; } next: continue; } if( memi < 0 ) #ifndef FLEXNAMES uerror("illegal member use: %.8s", #else uerror("illegal member use: %s", #endif stab[i].sname); } else { register j; if( l->in.type != PTR+STRTY && l->in.type != PTR+UNIONTY ){ if( stab[i].sflags & SNONUNIQ ){ uerror( "nonunique name demands struct/union or struct/union pointer" ); } else werror( "struct/union or struct/union pointer required" ); } else if( (j=l->fn.csiz+1)<0 ) cerror( "undefined structure or union" ); else if( !chkstr( i, dimtab[j], DECREF(l->in.type) ) ){ #ifndef FLEXNAMES werror( "illegal member use: %.8s", stab[i].sname ); #else werror( "illegal member use: %s", stab[i].sname ); #endif } } p = stref( p ); break; case UNARY MUL: if( l->in.op == UNARY AND ){ p->in.op = l->in.op = FREE; p = l->in.left; } if( !ISPTR(l->in.type))uerror("illegal indirection"); p->in.type = DECREF(l->in.type); p->fn.cdim = l->fn.cdim; p->fn.csiz = l->fn.csiz; break; case UNARY AND: switch( l->in.op ){ case UNARY MUL: p->in.op = l->in.op = FREE; p = l->in.left; case NAME: p->in.type = INCREF( l->in.type ); p->fn.cdim = l->fn.cdim; p->fn.csiz = l->fn.csiz; break; case COMOP: lr = buildtree( UNARY AND, l->in.right, NIL ); p->in.op = l->in.op = FREE; p = buildtree( COMOP, l->in.left, lr ); break; case QUEST: lr = buildtree( UNARY AND, l->in.right->in.right, NIL ); ll = buildtree( UNARY AND, l->in.right->in.left, NIL ); p->in.op = l->in.op = l->in.right->in.op = FREE; p = buildtree( QUEST, l->in.left, buildtree( COLON, ll, lr ) ); break; # ifdef ADDROREG case OREG: /* OREG was built in clocal() * for an auto or formal parameter * now its address is being taken * local code must unwind it * back to PLUS/MINUS REG ICON * according to local conventions */ { extern NODE * addroreg(); p->in.op = FREE; p = addroreg( l ); } break; # endif default: uerror( "unacceptable operand of &" ); break; } break; case LS: case RS: case ASG LS: case ASG RS: if(tsize(p->in.right->in.type, p->in.right->fn.cdim, p->in.right->fn.csiz) > SZINT) p->in.right = makety(p->in.right, INT, 0, INT ); break; case RETURN: case ASSIGN: case CAST: /* structure assignment */ /* take the addresses of the two sides; then make an /* operator using STASG and /* the addresses of left and right */ { register TWORD t; register d, s; if( l->fn.csiz != r->fn.csiz ) uerror( "assignment of different structures" ); r = buildtree( UNARY AND, r, NIL ); t = r->in.type; d = r->fn.cdim; s = r->fn.csiz; l = block( STASG, l, r, t, d, s ); if( o == RETURN ){ p->in.op = FREE; p = l; break; } p->in.op = UNARY MUL; p->in.left = l; p->in.right = NIL; break; } case COLON: /* structure colon */ if( l->fn.csiz != r->fn.csiz ) uerror( "type clash in conditional" ); break; case CALL: p->in.right = r = strargs( p->in.right ); case UNARY CALL: if( !ISPTR(l->in.type)) uerror("illegal function"); p->in.type = DECREF(l->in.type); if( !ISFTN(p->in.type)) uerror("illegal function"); p->in.type = DECREF( p->in.type ); p->fn.cdim = l->fn.cdim; p->fn.csiz = l->fn.csiz; if( l->in.op == UNARY AND && l->in.left->in.op == NAME && l->in.left->tn.rval >= 0 && l->in.left->tn.rval != NONAME && ( (i=stab[l->in.left->tn.rval].sclass) == FORTRAN || i==UFORTRAN ) ){ p->in.op += (FORTCALL-CALL); } if( p->in.type == STRTY || p->in.type == UNIONTY ){ /* function returning structure */ /* make function really return ptr to str., with * */ p->in.op += STCALL-CALL; p->in.type = INCREF( p->in.type ); p = buildtree( UNARY MUL, p, NIL ); } break; default: cerror( "other code %d", o ); } } if( actions & CVTO ) p = oconvert(p); p = clocal(p); # ifndef BUG1 if( bdebug ) fwalk( p, eprint, 0 ); # endif return(p); } NODE * strargs( p ) register NODE *p; { /* rewrite structure flavored arguments */ if( p->in.op == CM ){ p->in.left = strargs( p->in.left ); p->in.right = strargs( p->in.right ); return( p ); } if( p->in.type == STRTY || p->in.type == UNIONTY ){ p = block( STARG, p, NIL, p->in.type, p->fn.cdim, p->fn.csiz ); p->in.left = buildtree( UNARY AND, p->in.left, NIL ); p = clocal(p); } return( p ); } chkstr( i, j, type ) TWORD type; { /* is the MOS or MOU at stab[i] OK for strict reference by a ptr */ /* i has been checked to contain a MOS or MOU */ /* j is the index in dimtab of the members... */ int k, kk; extern int ddebug; # ifndef BUG1 #ifndef FLEXNAMES if( ddebug > 1 ) printf( "chkstr( %.8s(%d), %d )\n", stab[i].sname, i, j ); #else if( ddebug > 1 ) printf( "chkstr( %s(%d), %d )\n", stab[i].sname, i, j ); #endif # endif if( (k = j) < 0 ) uerror( "undefined structure or union" ); else { for( ; (kk = dimtab[k] ) >= 0; ++k ){ if( kk >= SYMTSZ ){ cerror( "gummy structure" ); return(1); } if( kk == i ) return( 1 ); switch( stab[kk].stype ){ case STRTY: case UNIONTY: if( type == STRTY ) continue; /* no recursive looking for strs */ if( hflag && chkstr( i, dimtab[stab[kk].sizoff+1], stab[kk].stype ) ){ if( stab[kk].sname[0] == '$' ) return(0); /* $FAKE */ werror( #ifndef FLEXNAMES "illegal member use: perhaps %.8s.%.8s?", #else "illegal member use: perhaps %s.%s?", #endif stab[kk].sname, stab[i].sname ); return(1); } } } } return( 0 ); } conval( p, o, q ) register NODE *p, *q; { /* apply the op o to the lval part of p; if binary, rhs is val */ int i, u; CONSZ val; val = q->tn.lval; u = ISUNSIGNED(p->in.type) || ISUNSIGNED(q->in.type); if( u && (o==LE||o==LT||o==GE||o==GT)) o += (UGE-GE); if( p->tn.rval != NONAME && q->tn.rval != NONAME ) return(0); if( q->tn.rval != NONAME && o!=PLUS ) return(0); if( p->tn.rval != NONAME && o!=PLUS && o!=MINUS ) return(0); switch( o ){ case PLUS: p->tn.lval += val; if( p->tn.rval == NONAME ){ p->tn.rval = q->tn.rval; p->in.type = q->in.type; } break; case MINUS: p->tn.lval -= val; break; case MUL: p->tn.lval *= val; break; case DIV: if( val == 0 ) uerror( "division by 0" ); else p->tn.lval /= val; break; case MOD: if( val == 0 ) uerror( "division by 0" ); else p->tn.lval %= val; break; case AND: p->tn.lval &= val; break; case OR: p->tn.lval |= val; break; case ER: p->tn.lval ^= val; break; case LS: i = val; p->tn.lval = p->tn.lval << i; break; case RS: i = val; p->tn.lval = p->tn.lval >> i; break; case UNARY MINUS: p->tn.lval = - p->tn.lval; break; case COMPL: p->tn.lval = ~p->tn.lval; break; case NOT: p->tn.lval = !p->tn.lval; break; case LT: p->tn.lval = p->tn.lval < val; break; case LE: p->tn.lval = p->tn.lval <= val; break; case GT: p->tn.lval = p->tn.lval > val; break; case GE: p->tn.lval = p->tn.lval >= val; break; case ULT: p->tn.lval = (p->tn.lval-val)<0; break; case ULE: p->tn.lval = (p->tn.lval-val)<=0; break; case UGE: p->tn.lval = (p->tn.lval-val)>=0; break; case UGT: p->tn.lval = (p->tn.lval-val)>0; break; case EQ: p->tn.lval = p->tn.lval == val; break; case NE: p->tn.lval = p->tn.lval != val; break; default: return(0); } return(1); } chkpun(p) register NODE *p; { /* checks p for the existance of a pun */ /* this is called when the op of p is ASSIGN, RETURN, CAST, COLO((N, or relational */ /* one case is when enumerations are used: this applies only to lint */ /* in the other case, one operand is a pointer, the other integer type */ /* we check that this integer is in fact a constant zero... */ /* in the case of ASSIGN, any assignment of pointer to integer is illegal */ /* this falls out, because the LHS is never 0 */ register NODE *q; register t1, t2; register d1, d2; t1 = p->in.left->in.type; t2 = p->in.right->in.type; if( t1==ENUMTY || t2==ENUMTY ) { /* check for enumerations */ if( logop( p->in.op ) && p->in.op != EQ && p->in.op != NE ) { uerror( "illegal comparison of enums" ); return; } if( t1==ENUMTY && t2==ENUMTY && p->in.left->fn.csiz==p->in.right->fn.csiz ) return; werror( "enumeration type clash, operator %s", opst[p->in.op] ); return; } if( ISPTR(t1) || ISARY(t1) ) q = p->in.right; else q = p->in.left; if( !ISPTR(q->in.type) && !ISARY(q->in.type) ){ if( q->in.op != ICON || q->tn.lval != 0 ){ werror( "illegal combination of pointer and integer, op %s", opst[p->in.op] ); } } else { d1 = p->in.left->fn.cdim; d2 = p->in.right->fn.cdim; for( ;; ){ if( t1 == t2 ) {; if( p->in.left->fn.csiz != p->in.right->fn.csiz ) { werror( "illegal structure pointer combination" ); } return; } if( ISARY(t1) || ISPTR(t1) ){ if( !ISARY(t2) && !ISPTR(t2) ) break; if( ISARY(t1) && ISARY(t2) && dimtab[d1] != dimtab[d2] ){ werror( "illegal array size combination" ); return; } if( ISARY(t1) ) ++d1; if( ISARY(t2) ) ++d2; } else break; t1 = DECREF(t1); t2 = DECREF(t2); } werror( "illegal pointer combination" ); } } NODE * stref( p ) register NODE *p; { TWORD t; int d, s, dsc, align; OFFSZ off; register struct symtab *q; /* make p->x */ /* this is also used to reference automatic variables */ q = &stab[p->in.right->tn.rval]; p->in.right->in.op = FREE; p->in.op = FREE; p = pconvert( p->in.left ); /* make p look like ptr to x */ if( !ISPTR(p->in.type)){ p->in.type = PTR+UNIONTY; } t = INCREF( q->stype ); d = q->dimoff; s = q->sizoff; p = makety( p, t, d, s ); /* compute the offset to be added */ off = q->offset; dsc = q->sclass; if( dsc & FIELD ) { /* normalize offset */ align = ALINT; s = INT; off = (off/align)*align; } if( off != 0 ) p = clocal( block( PLUS, p, offcon( off, t, d, s ), t, d, s ) ); p = buildtree( UNARY MUL, p, NIL ); /* if field, build field info */ if( dsc & FIELD ){ p = block( FLD, p, NIL, q->stype, 0, q->sizoff ); p->tn.rval = PKFIELD( dsc&FLDSIZ, q->offset%align ); } return( clocal(p) ); } notlval(p) register NODE *p; { /* return 0 if p an lvalue, 1 otherwise */ again: switch( p->in.op ){ case FLD: p = p->in.left; goto again; case UNARY MUL: /* fix the &(a=b) bug, given that a and b are structures */ if( p->in.left->in.op == STASG ) return( 1 ); /* and the f().a bug, given that f returns a structure */ if( p->in.left->in.op == UNARY STCALL || p->in.left->in.op == STCALL ) return( 1 ); case NAME: case OREG: if( ISARY(p->in.type) || ISFTN(p->in.type) ) return(1); case REG: return(0); default: return(1); } } NODE * bcon( i ){ /* make a constant node with value i */ register NODE *p; p = block( ICON, NIL, NIL, INT, 0, INT ); p->tn.lval = i; p->tn.rval = NONAME; return( clocal(p) ); } NODE * bpsize(p) register NODE *p; { return( offcon( psize(p), p->in.type, p->fn.cdim, p->fn.csiz ) ); } OFFSZ psize( p ) NODE *p; { /* p is a node of type pointer; psize returns the size of the thing pointed to */ if( !ISPTR(p->in.type) ){ uerror( "pointer required"); return( SZINT ); } /* note: no pointers to fields */ return( tsize( DECREF(p->in.type), p->fn.cdim, p->fn.csiz ) ); } NODE * convert( p, f ) register NODE *p; { /* convert an operand of p f is either CVTL or CVTR operand has type int, and is converted by the size of the other side */ register NODE *q, *r; q = (f==CVTL)?p->in.left:p->in.right; r = block( PMCONV, q, bpsize(f==CVTL?p->in.right:p->in.left), INT, 0, INT ); r = clocal(r); if( f == CVTL ) p->in.left = r; else p->in.right = r; return(p); } econvert( p ) register NODE *p; { /* change enums to ints, or appropriate types */ register TWORD ty; if( (ty=BTYPE(p->in.type)) == ENUMTY || ty == MOETY ) { if( dimtab[ p->fn.csiz ] == SZCHAR ) ty = CHAR; else if( dimtab[ p->fn.csiz ] == SZINT ) ty = INT; else if( dimtab[ p->fn.csiz ] == SZSHORT ) ty = SHORT; else ty = LONG; ty = ctype( ty ); p->fn.csiz = ty; MODTYPE(p->in.type,ty); if( p->in.op == ICON && ty != LONG ) p->in.type = p->fn.csiz = INT; } } NODE * pconvert( p ) register NODE *p; { /* if p should be changed into a pointer, do so */ if( ISARY( p->in.type) ){ p->in.type = DECREF( p->in.type ); ++p->fn.cdim; return( buildtree( UNARY AND, p, NIL ) ); } if( ISFTN( p->in.type) ) return( buildtree( UNARY AND, p, NIL ) ); return( p ); } NODE * oconvert(p) register NODE *p; { /* convert the result itself: used for pointer and unsigned */ switch(p->in.op) { case LE: case LT: case GE: case GT: if( ISUNSIGNED(p->in.left->in.type) || ISUNSIGNED(p->in.right->in.type) ) p->in.op += (ULE-LE); case EQ: case NE: return( p ); case MINUS: return( clocal( block( PVCONV, p, bpsize(p->in.left), INT, 0, INT ) ) ); } cerror( "illegal oconvert: %d", p->in.op ); return(p); } NODE * ptmatch(p) register NODE *p; { /* makes the operands of p agree; they are either pointers or integers, by this time */ /* with MINUS, the sizes must be the same */ /* with COLON, the types must be the same */ TWORD t1, t2, t; int o, d2, d, s2, s; o = p->in.op; t = t1 = p->in.left->in.type; t2 = p->in.right->in.type; d = p->in.left->fn.cdim; d2 = p->in.right->fn.cdim; s = p->in.left->fn.csiz; s2 = p->in.right->fn.csiz; switch( o ){ case ASSIGN: case RETURN: case CAST: { break; } case MINUS: { if( psize(p->in.left) != psize(p->in.right) ){ uerror( "illegal pointer subtraction"); } break; } case COLON: { if( t1 != t2 ) uerror( "illegal types in :"); break; } default: /* must work harder: relationals or comparisons */ if( !ISPTR(t1) ){ t = t2; d = d2; s = s2; break; } if( !ISPTR(t2) ){ break; } /* both are pointers */ if( talign(t2,s2) < talign(t,s) ){ t = t2; s = s2; } break; } p->in.left = makety( p->in.left, t, d, s ); p->in.right = makety( p->in.right, t, d, s ); if( o!=MINUS && !logop(o) ){ p->in.type = t; p->fn.cdim = d; p->fn.csiz = s; } return(clocal(p)); } int tdebug = 0; NODE * tymatch(p) register NODE *p; { /* satisfy the types of various arithmetic binary ops */ /* rules are: if assignment, op, type of LHS if any float or doubles, make double if any longs, make long otherwise, make int if either operand is unsigned, the result is... */ register TWORD t1, t2, t, tu; register o, u; o = p->in.op; t1 = p->in.left->in.type; t2 = p->in.right->in.type; if( (t1==UNDEF || t2==UNDEF) && o!=CAST ) uerror("void type illegal in expression"); u = 0; if( ISUNSIGNED(t1) ){ u = 1; t1 = DEUNSIGN(t1); } if( ISUNSIGNED(t2) ){ u = 1; t2 = DEUNSIGN(t2); } if( ( t1 == CHAR || t1 == SHORT ) && o!= RETURN ) t1 = INT; if( t2 == CHAR || t2 == SHORT ) t2 = INT; if( t1==DOUBLE || t1==FLOAT || t2==DOUBLE || t2==FLOAT ) t = DOUBLE; else if( t1==LONG || t2==LONG ) t = LONG; else t = INT; if( asgop(o) ){ tu = p->in.left->in.type; t = t1; } else { tu = (u && UNSIGNABLE(t))?ENUNSIGN(t):t; } /* because expressions have values that are at least as wide as INT or UNSIGNED, the only conversions needed are those involving FLOAT/DOUBLE, and those from LONG to INT and ULONG to UNSIGNED */ if( t != t1 ) p->in.left = makety( p->in.left, tu, 0, (int)tu ); if( t != t2 || o==CAST ) p->in.right = makety( p->in.right, tu, 0, (int)tu ); if( asgop(o) ){ p->in.type = p->in.left->in.type; p->fn.cdim = p->in.left->fn.cdim; p->fn.csiz = p->in.left->fn.csiz; } else if( !logop(o) ){ p->in.type = tu; p->fn.cdim = 0; p->fn.csiz = t; } # ifndef BUG1 if( tdebug ) printf( "tymatch(%o): %o %s %o => %o\n",p,t1,opst[o],t2,tu ); # endif return(p); } NODE * makety( p, t, d, s ) register NODE *p; TWORD t; { /* make p into type t by inserting a conversion */ if( p->in.type == ENUMTY && p->in.op == ICON ) econvert(p); if( t == p->in.type ){ p->fn.cdim = d; p->fn.csiz = s; return( p ); } if( t & TMASK ){ /* non-simple type */ return( block( PCONV, p, NIL, t, d, s ) ); } if( p->in.op == ICON ){ if( t==DOUBLE||t==FLOAT ){ p->in.op = FCON; if( ISUNSIGNED(p->in.type) ){ p->fpn.dval = /* (unsigned CONSZ) */ p->tn.lval; } else { p->fpn.dval = p->tn.lval; } p->in.type = p->fn.csiz = t; return( clocal(p) ); } } return( block( SCONV, p, NIL, t, d, s ) ); } NODE * block( o, l, r, t, d, s ) register NODE *l, *r; TWORD t; { register NODE *p; p = talloc(); p->in.op = o; p->in.left = l; p->in.right = r; p->in.type = t; p->fn.cdim = d; p->fn.csiz = s; return(p); } icons(p) register NODE *p; { /* if p is an integer constant, return its value */ int val; if( p->in.op != ICON ){ uerror( "constant expected"); val = 1; } else { val = p->tn.lval; if( val != p->tn.lval ) uerror( "constant too big for cross-compiler" ); } tfree( p ); return(val); } /* the intent of this table is to examine the operators, and to check them for correctness. The table is searched for the op and the modified type (where this is one of the types INT (includes char and short), LONG, DOUBLE (includes FLOAT), and POINTER The default action is to make the node type integer The actions taken include: PUN check for puns CVTL convert the left operand CVTR convert the right operand TYPL the type is determined by the left operand TYPR the type is determined by the right operand TYMATCH force type of left and right to match, by inserting conversions PTMATCH like TYMATCH, but for(( pointers LVAL left operand must be lval CVTO convert the op NCVT do not convert the operands OTHER handled by code NCVTR convert the left operand, not the right... */ # define MINT 01 /* integer */ # define MDBI 02 /* integer or double */ # define MSTR 04 /* structure */ # define MPTR 010 /* pointer */ # define MPTI 020 /* pointer or integer */ # define MENU 040 /* enumeration variable or member */ opact( p ) NODE *p; { register mt12, mt1, mt2, o; mt12 = 0; switch( optype(o=p->in.op) ){ case BITYPE: mt12=mt2 = moditype( p->in.right->in.type ); case UTYPE: mt12 &= (mt1 = moditype( p->in.left->in.type )); } switch( o ){ case NAME : case STRING : case ICON : case FCON : case CALL : case UNARY CALL: case UNARY MUL: { return( OTHER ); } case UNARY MINUS: if( mt1 & MDBI ) return( TYPL ); break; case COMPL: if( mt1 & MINT ) return( TYPL ); break; case UNARY AND: { return( NCVT+OTHER ); } case INIT: case CM: case NOT: case CBRANCH: case ANDAND: case OROR: return( 0 ); case MUL: case DIV: if( mt12 & MDBI ) return( TYMATCH ); break; case MOD: case AND: case OR: case ER: if( mt12 & MINT ) return( TYMATCH ); break; case LS: case RS: if( mt12 & MINT ) return( TYMATCH+OTHER ); break; case EQ: case NE: case LT: case LE: case GT: case GE: if( (mt1&MENU)||(mt2&MENU) ) return( PTMATCH+PUN+NCVT ); if( mt12 & MDBI ) return( TYMATCH+CVTO ); else if( mt12 & MPTR ) return( PTMATCH+PUN ); else if( mt12 & MPTI ) return( PTMATCH+PUN ); else break; case QUEST: case COMOP: if( mt2&MENU ) return( TYPR+NCVTR ); return( TYPR ); case STREF: return( NCVTR+OTHER ); case FORCE: return( TYPL ); case COLON: if( mt12 & MENU ) return( NCVT+PUN+PTMATCH ); else if( mt12 & MDBI ) return( TYMATCH ); else if( mt12 & MPTR ) return( TYPL+PTMATCH+PUN ); else if( (mt1&MINT) && (mt2&MPTR) ) return( TYPR+PUN ); else if( (mt1&MPTR) && (mt2&MINT) ) return( TYPL+PUN ); else if( mt12 & MSTR ) return( NCVT+TYPL+OTHER ); break; case ASSIGN: case RETURN: if( mt12 & MSTR ) return( LVAL+NCVT+TYPL+OTHER ); case CAST: if(o==CAST && mt1==0)return(TYPL+TYMATCH); if( mt12 & MDBI ) return( TYPL+LVAL+TYMATCH ); else if( (mt1&MENU)||(mt2&MENU) ) return( LVAL+NCVT+TYPL+PTMATCH+PUN ); else if( mt12 == 0 ) break; else if( mt1 & MPTR ) return( LVAL+PTMATCH+PUN ); else if( mt12 & MPTI ) return( TYPL+LVAL+TYMATCH+PUN ); break; case ASG LS: case ASG RS: if( mt12 & MINT ) return( TYPL+LVAL+OTHER ); break; case ASG MUL: case ASG DIV: if( mt12 & MDBI ) return( LVAL+TYMATCH ); break; case ASG MOD: case ASG AND: case ASG OR: case ASG ER: if( mt12 & MINT ) return( LVAL+TYMATCH ); break; case ASG PLUS: case ASG MINUS: case INCR: case DECR: if( mt12 & MDBI ) return( TYMATCH+LVAL ); else if( (mt1&MPTR) && (mt2&MINT) ) return( TYPL+LVAL+CVTR ); break; case MINUS: if( mt12 & MPTR ) return( CVTO+PTMATCH+PUN ); if( mt2 & MPTR ) break; case PLUS: if( mt12 & MDBI ) return( TYMATCH ); else if( (mt1&MPTR) && (mt2&MINT) ) return( TYPL+CVTR ); else if( (mt1&MINT) && (mt2&MPTR) ) return( TYPR+CVTL ); } uerror( "operands of %s have incompatible types", opst[o] ); return( NCVT ); } moditype( ty ) TWORD ty; { switch( ty ){ case TVOID: case UNDEF: return(0); /* type is void */ case ENUMTY: case MOETY: return( MENU ); case STRTY: case UNIONTY: return( MSTR ); case CHAR: case SHORT: case UCHAR: case USHORT: return( MINT|MPTI|MDBI ); case UNSIGNED: case ULONG: case INT: case LONG: return( MINT|MDBI|MPTI ); case FLOAT: case DOUBLE: return( MDBI ); default: return( MPTR|MPTI ); } } NODE * doszof( p ) register NODE *p; { /* do sizeof p */ int i; /* whatever is the meaning of this if it is a bitfield? */ i = tsize( p->in.type, p->fn.cdim, p->fn.csiz )/SZCHAR; tfree(p); if( i <= 0 ) werror( "sizeof returns 0" ); return( bcon( i ) ); } # ifndef BUG2 eprint( p, down, a, b ) register NODE *p; int *a, *b; { register ty; *a = *b = down+1; while( down > 1 ){ printf( "\t" ); down -= 2; } if( down ) printf( " " ); ty = optype( p->in.op ); printf("%o) %s, ", p, opst[p->in.op] ); if( ty == LTYPE ){ printf( CONFMT, p->tn.lval ); printf( ", %d, ", p->tn.rval ); } tprint( p->in.type ); printf( ", %d, %d\n", p->fn.cdim, p->fn.csiz ); } # endif prtdcon( p ) register NODE *p; { int i; if( p->in.op == FCON ){ locctr( DATA ); defalign( ALDOUBLE ); deflab( i = getlab() ); fincode( p->fpn.dval, SZDOUBLE ); p->tn.lval = 0; p->tn.rval = -i; p->in.type = DOUBLE; p->in.op = NAME; } } int edebug = 0; ecomp( p ) register NODE *p; { # ifndef BUG2 if( edebug ) fwalk( p, eprint, 0 ); # endif if( !reached ){ werror( "statement not reached" ); reached = 1; } p = optim(p); walkf( p, prtdcon ); locctr( PROG ); ecode( p ); tfree(p); } # ifdef STDPRTREE # ifndef ONEPASS prtree(p) register NODE *p; { register struct symtab *q; register ty; # ifdef MYPRTREE MYPRTREE(p); /* local action can be taken here; then return... */ #endif ty = optype(p->in.op); printf( "%d\t", p->in.op ); if( ty == LTYPE ) { printf( CONFMT, p->tn.lval ); printf( "\t" ); } if( ty != BITYPE ) { if( p->in.op == NAME || p->in.op == ICON ) printf( "0\t" ); else printf( "%d\t", p->tn.rval ); } printf( "%o\t", p->in.type ); /* handle special cases */ switch( p->in.op ){ case NAME: case ICON: /* print external name */ if( p->tn.rval == NONAME ) printf( "\n" ); else if( p->tn.rval >= 0 ){ q = &stab[p->tn.rval]; printf( "%s\n", exname(q->sname) ); } else { /* label */ printf( LABFMT, -p->tn.rval ); } break; case STARG: case STASG: case STCALL: case UNARY STCALL: /* print out size */ /* use lhs size, in order to avoid hassles with the structure `.' operator */ /* note: p->in.left not a field... */ printf( CONFMT, (CONSZ) tsize( STRTY, p->in.left->fn.cdim, p->in.left->fn.csiz ) ); printf( "\t%d\t\n", talign( STRTY, p->in.left->fn.csiz ) ); break; default: printf( "\n" ); } if( ty != LTYPE ) prtree( p->in.left ); if( ty == BITYPE ) prtree( p->in.right ); } # else p2tree(p) register NODE *p; { register ty; # ifdef MYP2TREE MYP2TREE(p); /* local action can be taken here; then return... */ # endif ty = optype(p->in.op); switch( p->in.op ){ case NAME: case ICON: #ifndef FLEXNAMES if( p->tn.rval == NONAME ) p->in.name[0] = '\0'; #else if( p->tn.rval == NONAME ) p->in.name = ""; #endif else if( p->tn.rval >= 0 ){ /* copy name from exname */ register char *cp; register i; cp = exname( stab[p->tn.rval].sname ); #ifndef FLEXNAMES for( i=0; iin.name[i] = *cp++; #else p->in.name = tstr(cp); #endif } #ifndef FLEXNAMES else sprintf( p->in.name, LABFMT, -p->tn.rval ); #else else { char temp[32]; sprintf( temp, LABFMT, -p->tn.rval ); p->in.name = tstr(temp); } #endif break; case STARG: case STASG: case STCALL: case UNARY STCALL: /* set up size parameters */ p->stn.stsize = (tsize(STRTY,p->in.left->fn.cdim,p->in.left->fn.csiz)+SZCHAR-1)/SZCHAR; p->stn.stalign = talign(STRTY,p->in.left->fn.csiz)/SZCHAR; break; case REG: rbusy( p->tn.rval, p->in.type ); default: #ifndef FLEXNAMES p->in.name[0] = '\0'; #else p->in.name = ""; #endif } p->in.rall = NOPREF; if( ty != LTYPE ) p2tree( p->in.left ); if( ty == BITYPE ) p2tree( p->in.right ); } # endif # endif ase STARG: case STASG: case STCALL: case UNARY STCALL: /* set up size parameters */ p->stn.stsize = (tsize(STRTY,p->in.left->fn.cdim,p->in.lecmd/mip/xdefs.c 644 0 33 5227 2443265552 6655 static char *sccsid ="%W% (Berkeley) %G%"; # include "mfile1" /* communication between lexical routines */ char ftitle[100] = ""; /* title of the file */ char ititle[100] = ""; /* title of initial file */ int lineno; /* line number of the input file */ CONSZ lastcon; /* the last constant read by the lexical analyzer */ double dcon; /* the last double read by the lexical analyzer */ /* symbol table maintainence */ struct symtab stab[SYMTSZ+1]; /* one extra slot for scratch */ int curftn; /* "current" function */ int ftnno; /* "current" function number */ int curclass, /* current storage class */ instruct, /* "in structure" flag */ stwart, /* for accessing names which are structure members or names */ blevel, /* block level: 0 for extern, 1 for ftn args, >=2 inside function */ curdim; /* current offset into the dimension table */ int dimtab[ DIMTABSZ ]; int paramstk[ PARAMSZ ]; /* used in the definition of function parameters */ int paramno; /* the number of parameters */ int autooff, /* the next unused automatic offset */ argoff, /* the next unused argument offset */ strucoff; /* the next structure offset position */ int regvar; /* the next free register for register variables */ int minrvar; /* the smallest that regvar gets witing a function */ OFFSZ inoff; /* offset of external element being initialized */ int brkflag = 0; /* complain about break statements not reached */ struct sw swtab[SWITSZ]; /* table for cases within a switch */ struct sw *swp; /* pointer to next free entry in swtab */ int swx; /* index of beginning of cases for current switch */ /* debugging flag */ int xdebug = 0; int strflg; /* if on, strings are to be treated as lists */ int reached; /* true if statement can be reached... */ int idname; /* tunnel to buildtree for name id's */ NODE node[TREESZ]; int cflag = 0; /* do we check for funny casts */ int hflag = 0; /* do we check for various heuristics which may indicate errors */ int pflag = 0; /* do we check for portable constructions */(( int brklab; int contlab; int flostat; int retlab = NOLAB; int retstat; /* save array for break, continue labels, and flostat */ int asavbc[BCSZ]; int *psavbc = asavbc ; # ifndef BUG1 static char * ccnames[] = { /* names of storage classes */ "SNULL", "AUTO", "EXTERN", "STATIC", "REGISTER", "EXTDEF", "LABEL", "ULABEL", "MOS", "PARAM", "STNAME", "MOU", "UNAME", "TYPEDEF", "FORTRAN", "ENAME", "MOE", "UFORTRAN", "USTATIC", }; char * scnames( c ) register c; { /* return the name for storage class c */ static char buf[12]; if( c&FIELD ){ sprintf( buf, "FIELD[%d]", c&FLDSIZ ); return( buf ); } return( ccnames[c] ); } # endif nt *psavbc = asavbc ; # ifndef BUG1 static char * ccnames[] = { /* names of storage classes */ "SNULL", "AUTO", "EXTERN", "STATIC", "REGISTER", "EXTDEF", "LABEL", "ULABEL", "MOS", "PARAM", "STNAME", "MOU", "UNAME", "TYPEDEF", "FORTRAN", "ENAME", "MOE", "UFORTRAN", "USTATIC", }; char * scnames( c ) register c; { /* return the name for stcmd/mip/omatch.c 644 0 33 33617 2416242147 7036 static char *sccsid ="%W% (Berkeley) %G%"; # include "mfile2" # ifdef WCARD1 # ifdef WCARD2 # define NOINDIRECT # endif # endif extern vdebug; int fldsz, fldshf; static int mamask[] = { /* masks for matching dope with shapes */ SIMPFLG, /* OPSIMP */ SIMPFLG|ASGFLG, /* ASG OPSIMP */ COMMFLG, /* OPCOMM */ COMMFLG|ASGFLG, /* ASG OPCOMM */ MULFLG, /* OPMUL */ MULFLG|ASGFLG, /* ASG OPMUL */ DIVFLG, /* OPDIV */ DIVFLG|ASGFLG, /* ASG OPDIV */ UTYPE, /* OPUNARY */ TYFLG, /* ASG OPUNARY is senseless */ LTYPE, /* OPLEAF */ TYFLG, /* ASG OPLEAF is senseless */ 0, /* OPANY */ ASGOPFLG|ASGFLG, /* ASG OPANY */ LOGFLG, /* OPLOG */ TYFLG, /* ASG OPLOG is senseless */ FLOFLG, /* OPFLOAT */ FLOFLG|ASGFLG, /* ASG OPFLOAT */ SHFFLG, /* OPSHFT */ SHFFLG|ASGFLG, /* ASG OPSHIFT */ SPFLG, /* OPLTYPE */ TYFLG, /* ASG OPLTYPE is senseless */ }; int sdebug = 0; tshape( p, shape ) NODE *p; { /* return true if shape is appropriate for the node p side effect for SFLD is to set up fldsz,etc */ register o, mask; o = p->in.op; # ifndef BUG3 if( sdebug ){ printf( "tshape( %o, %o), op = %d\n", p, shape, o ); } # endif if( shape & SPECIAL ){ switch( shape ){ case SZERO: case SONE: case SMONE: case SSCON: case SCCON: if( o != ICON || p->in.name[0] ) return(0); if( p->tn.lval == 0 && shape == SZERO ) return(1); else if( p->tn.lval == 1 && shape == SONE ) return(1); else if( p->tn.lval == -1 && shape == SMONE ) return(1); else if( p->tn.lval > -257 && p->tn.lval < 256 && shape == SCCON ) return(1); else if( p->tn.lval > -32769 && p->tn.lval < 32768 && shape == SSCON ) return(1); else return(0); case SSOREG: /* non-indexed OREG */ if( o == OREG && !R2TEST(p->tn.rval) ) return(1); else return(0); default: # ifdef MULTILEVEL if( shape & MULTILEVEL ) return( mlmatch(p,shape,0) ); else # endif return( special( p, shape ) ); } } if( shape & SANY ) return(1); if( (shape&INTEMP) && shtemp(p) ) return(1); if( (shape&SWADD) && (o==NAME||o==OREG) ){ if( BYTEOFF(p->tn.lval) ) return(0); } # ifdef WCARD1 if( shape & WCARD1 ) return( wcard1(p) & shape ); # endif # ifdef WCARD2 if( shape & WCARD2 ) return( wcard2(p) & shape ); # endif switch( o ){ case NAME: return( shape&SNAME ); case ICON: mask = SCON; return( shape & mask ); case FLD: if( shape & SFLD ){ if( !flshape( p->in.left ) ) return(0); /* it is a FIELD shape; make side-effects */ o = p->tn.rval; fldsz = UPKFSZ(o); # ifdef RTOLBYTES fldshf = UPKFOFF(o); # else fldshf = SZINT - fldsz - UPKFOFF(o); # endif return(1); } return(0); case CCODES: return( shape&SCC ); case REG: /* distinctions: SAREG any scalar register STAREG any temporary scalar register SBREG any lvalue (index) register STBREG any temporary lvalue register */ mask = isbreg( p->tn.rval ) ? SBREG : SAREG; if( istreg( p->tn.rval ) && busy[p->tn.rval]<=1 ) mask |= mask==SAREG ? STAREG : STBREG; return( shape & mask ); case OREG: return( shape & SOREG ); # ifndef NOINDIRECT case UNARY MUL: /* return STARNM or STARREG or 0 */ return( shumul(p->in.left) & shape ); # endif } return(0); } int tdebug = 0; ttype( t, tword ) TWORD t; { /* does the type t match tword */ if( tword & TANY ) return(1); if( t == UNDEF ) t=INT; /* void functions eased thru tables */ # ifndef BUG3 if( tdebug ){ printf( "ttype( %o, %o )\n", t, tword ); } # endif if( ISPTR(t) && (tword&TPTRTO) ) { do { t = DECREF(t); } while ( ISARY(t) ); /* arrays that are left are usually only in structure references... */ return( ttype( t, tword&(~TPTRTO) ) ); } if( t != BTYPE(t) ) return( tword & TPOINT ); /* TPOINT means not simple! */ if( tword & TPTRTO ) return(0); switch( t ){ case CHAR: return( tword & TCHAR ); case SHORT: return( tword & TSHORT ); case STRTY: case UNIONTY: return( tword & TSTRUCT ); case INT: return( tword & TINT ); case UNSIGNED: return( tword & TUNSIGNED ); case USHORT: return( tword & TUSHORT ); case UCHAR: return( tword & TUCHAR ); case ULONG: return( tword & TULONG ); case LONG: return( tword & TLONG ); case FLOAT: return( tword & TFLOAT ); case DOUBLE: return( tword & TDOUBLE ); } return(0); } struct optab *rwtable; struct optab *opptr[DSIZE]; setrew(){ /* set rwtable to first value which allows rewrite */ register struct optab *q; register int i; # ifdef MULTILEVEL /* also initialize multi-level tree links */ mlinit(); # endif for( q = table; q->op != FREE; ++q ){ if( q->needs == REWRITE ){ rwtable = q; goto more; } } cerror( "bad setrew" ); more: for( i=0; iop != FREE; ++q ){ /* beware; things like LTYPE that match multiple things in the tree must not try to look at the NIL at this stage of things! Put something else first in table.c */ /* at one point, the operator matching was 15% of the total comile time; thus, the function call that was here was removed... */ if( q->op < OPSIMP ){ if( q->op==i ) break; } else { register opmtemp; if((opmtemp=mamask[q->op - OPSIMP])&SPFLG){ if( i==NAME || i==ICON || i==OREG ) break; else if( shltype( i, NIL ) ) break; } else if( (dope[i]&(opmtemp|ASGFLG)) == opmtemp ) break; } } opptr[i] = q; } } } match( p, cookie ) NODE *p; { /* called by: order, gencall look for match in table and generate code if found unless entry specified REWRITE. returns MDONE, MNOPE, or rewrite specification from table */ register struct optab *q; register NODE *r; rcount(); if( cookie == FORREW ) q = rwtable; else q = opptr[p->in.op]; for( ; q->op != FREE; ++q ){ /* at one point the call that was here was over 15% of the total time; thus the function call was expanded inline */ if( q->op < OPSIMP ){ if( q->op!=p->in.op ) continue; } else { register opmtemp; if((opmtemp=mamask[q->op - OPSIMP])&SPFLG){ if( p->in.op!=NAME && p->in.op!=ICON && p->in.op!= OREG && ! shltype( p->in.op, p ) ) continue; } else if( (dope[p->in.op]&(opmtemp|ASGFLG)) != opmtemp ) continue; } if( !(q->visit & cookie ) ) continue; r = getlr( p, 'L' ); /* see if left child matches */ if( !tshape( r, q->lshape ) ) continue; if( !ttype( r->in.type, q->ltype ) ) continue; r = getlr( p, 'R' ); /* see if right child matches */ if( !tshape( r, q->rshape ) ) continue; if( !ttype( r->in.type, q->rtype ) ) continue; /* REWRITE means no code from this match but go ahead and rewrite node to help future match */ if( q->needs & REWRITE ) return( q->rewrite ); if( !allo( p, q ) ) continue; /* if can't generate code, skip entry */ /* resources are available */ expand( p, cookie, q->cstring ); /* generate code */ reclaim( p, q->rewrite, cookie ); return(MDONE); } return(MNOPE); } int rtyflg = 0; expand( p, cookie, cp ) NODE *p; register char *cp; { /* generate code by interpreting table entry */ register char c; CONSZ val; rtyflg = 0; for( ; *cp; ++cp ){ switch( *cp ){ default: PUTCHAR( *cp ); continue; /* this is the usual case... */ case 'T': /* rewrite register type is suppressed */ rtyflg = 1; continue; case 'Z': /* special machine dependent operations */ # ifdef NEWZZZ switch( c = *++cp ) { case '1': case '2': case '3': case 'R': case 'L': /* get down first */ zzzcode( getlr( p, c ), *++cp ); break; default: /* normal zzzcode processing otherwise */ zzzcode( p, c ); break; } # else zzzcode( p, *++cp ); # endif continue; case 'F': /* this line deleted if FOREFF is active */ if( cookie & FOREFF ) while( *++cp != '\n' ) ; /* VOID */ continue; case 'S': /* field size */ printf( "%d", fldsz ); continue; case 'H': /* field shift */ printf( "%d", fldshf ); continue; case 'M': /* field mask */ case 'N': /* complement of field mask */ val = 1; val <<= fldsz; --val; val <<= fldshf; adrcon( *cp=='M' ? val : ~val ); continue; case 'L': /* output special label field */ printf( "%d", p->bn.label ); continue; case 'O': /* opcode string */ hopcode( *++cp, p->in.op ); continue; case 'B': /* byte offset in word */ val = getlr(p,*++cp)->tn.lval; val = BYTEOFF(val); printf( CONFMT, val ); continue; case 'C': /* for constant value only */ conput( getlr( p, *++cp ) ); continue; case 'I': /* in instruction */(( insput( getlr( p, *++cp ) ); continue; case 'A': /* address of */ adrput( getlr( p, *++cp ) ); continue; case 'U': /* for upper half of address, only */ upput( getlr( p, *++cp ) ); continue; } } } NODE * getlr( p, c ) NODE *p; { /* return the pointer to the left or right side of p, or p itself, depending on the optype of p */ switch( c ) { case '1': case '2': case '3': return( &resc[c-'1'] ); case 'L': return( optype( p->in.op ) == LTYPE ? p : p->in.left ); case 'R': return( optype( p->in.op ) != BITYPE ? p : p->in.right ); } cerror( "bad getlr: %c", c ); /* NOTREACHED */ } # ifdef MULTILEVEL union mltemplate{ struct ml_head{ int tag; /* identifies class of tree */ int subtag; /* subclass of tree */ union mltemplate * nexthead; /* linked by mlinit() */ } mlhead; struct ml_node{ int op; /* either an operator or op description */ int nshape; /* shape of node */ /* both op and nshape must match the node. * where the work is to be done entirely by * op, nshape can be SANY, visa versa, op can * be OPANY. */ int ntype; /* type descriptor from mfile2 */ } mlnode; }; # define MLSZ 30 extern union mltemplate mltree[]; int mlstack[MLSZ]; int *mlsp; /* pointing into mlstack */ NODE * ststack[MLSZ]; NODE **stp; /* pointing into ststack */ mlinit(){ union mltemplate **lastlink; register union mltemplate *n; register mlop; lastlink = &(mltree[0].nexthead); n = &mltree[0]; for( ; (n++)->mlhead.tag != 0; *lastlink = ++n, lastlink = &(n->mlhead.nexthead) ){ # ifndef BUG3 if( vdebug )printf("mlinit: %d\n",(n-1)->mlhead.tag); # endif /* wander thru a tree with a stack finding * its structure so the next header can be located. */ mlsp = mlstack; for( ;; ++n ){ if( (mlop = n->mlnode.op) < OPSIMP ){ switch( optype(mlop) ){ default: cerror("(1)unknown opcode: %o",mlop); case BITYPE: goto binary; case UTYPE: break; case LTYPE: goto leaf; } } else{ if( mamask[mlop-OPSIMP] & (SIMPFLG|COMMFLG|MULFLG|DIVFLG|LOGFLG|FLOFLG|SHFFLG) ){ binary: *mlsp++ = BITYPE; } else if( ! (mamask[mlop-OPSIMP] & UTYPE) ){/* includes OPANY */ leaf: if( mlsp == mlstack ) goto tree_end; else if ( *--mlsp != BITYPE ) cerror("(1)bad multi-level tree descriptor around mltree[%d]", n-mltree); } } } tree_end: /* n points to final leaf */ ; } # ifndef BUG3 if( vdebug > 3 ){ printf("mltree={\n"); for( n= &(mltree[0]); n->mlhead.tag != 0; ++n) printf("%o: %d, %d, %o,\n",n, n->mlhead.tag,n->mlhead.subtag,n->mlhead.nexthead); printf(" }\n"); } # endif } mlmatch( subtree, target, subtarget ) NODE * subtree; int target,subtarget;{ /* * does subtree match a multi-level tree with * tag "target"? Return zero on failure, * non-zero subtag on success (or MDONE if * there is a zero subtag field). */ union mltemplate *head; /* current template header */ register union mltemplate *n; /* node being matched */ NODE * st; /* subtree being matched */ register int mlop; # ifndef BUG3 if( vdebug ) printf("mlmatch(%o,%d)\n",subtree,target); # endif for( head = &(mltree[0]); head->mlhead.tag != 0; head=head->mlhead.nexthead){ # ifndef BUG3 if( vdebug > 1 )printf("mlmatch head(%o) tag(%d)\n", head->mlhead.tag); # endif if( head->mlhead.tag != target )continue; if( subtarget && head->mlhead.subtag != subtarget)continue; # ifndef BUG3 if( vdebug ) printf("mlmatch for %d\n",target); # endif /* potential for match */ n = head + 1; st = subtree; stp = ststack; mlsp = mlstack; /* compare n->op, ->nshape, ->ntype to * the subtree node st */ for( ;; ++n ){ /* for each node in multi-level template */ /* opmatch */ if( n->op < OPSIMP ){ if( st->op != n->op )break; } else { register opmtemp; if((opmtemp=mamask[n->op-OPSIMP])&SPFLG){ if(st->op!=NAME && st->op!=ICON && st->op!=OREG && ! shltype(st->op,st)) break; } else if((dope[st->op]&(opmtemp|ASGFLG))!=opmtemp) break; } /* check shape and type */ if( ! tshape( st, n->mlnode.nshape ) ) break; if( ! ttype( st->type, n->mlnode.ntype ) ) break; /* that node matched, let's try another */ /* must advance both st and n and halt at right time */ if( (mlop = n->mlnode.op) < OPSIMP ){ switch( optype(mlop) ){ default: cerror("(2)unknown opcode: %o",mlop); case BITYPE: goto binary; case UTYPE: st = st->left; break; case LTYPE: goto leaf; } } else{ if( mamask[mlop - OPSIMP] & (SIMPFLG|COMMFLG|MULFLG|DIVFLG|LOGFLG|FLOFLG|SHFFLG) ){ binary: *mlsp++ = BITYPE; *stp++ = st; st = st->left; } else if( ! (mamask[mlop-OPSIMP] & UTYPE) ){/* includes OPANY */ leaf: if( mlsp == mlstack ) goto matched; else if ( *--mlsp != BITYPE ) cerror("(2)bad multi-level tree descriptor around mltree[%d]", n-mltree); st = (*--stp)->right; } else /* UNARY */ st = st->left; } continue; matched: /* complete multi-level match successful */ # ifndef BUG3 if( vdebug ) printf("mlmatch() success\n"); # endif if( head->mlhead.subtag == 0 ) return( MDONE ); else { # ifndef BUG3 if( vdebug )printf("\treturns %d\n", head->mlhead.subtag ); # endif return( head->mlhead.subtag ); } } } return( 0 ); } # endif d multi-level tree descriptor around mltree[%d]", n-mltree); st = (*--stp)->right; } else /* cmd/who.c 444 0 33 2515 2503315701 5534 static char *sccsid = "@(#)who.c 4.3 (Berkeley) 3/11/81"; /* * who */ #include #include #include #include #include #define NMAX sizeof(utmp.ut_name) #define LMAX sizeof(utmp.ut_line) struct utmp utmp; struct passwd *pw; struct passwd *getpwuid(); char *ttyname(), *rindex(), *ctime(), *strcpy(); main(argc, argv) char **argv; { register char *tp, *s; register FILE *fi; extern char _sobuf[]; setbuf(stdout, _sobuf); s = "/etc/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()); strcpy(utmp.ut_name, pw?pw->pw_name: "?"); strcpy(utmp.ut_line, "tty??"); time(&utmp.ut_time); putline(); exit(0); } } if ((fi = fopen(s, "r")) == NULL) { puts("who: cannot open utmp"); exit(1); } while (fread((char *)&utmp, sizeof(utmp), 1, fi) == 1) { if(argc==3) { static char myname[]=sysname; if (strcmp(utmp.ut_line, tp)) continue; printf("%s!",myname); 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\n", cbuf+4); } = NULL) { puts("who: cannot open utmp"); exit(1); } while (fread((char *)&utmp, sizeof(utmp), 1, fi) == 1) { if(argc==3) { static char myname[]=sysname; if (strcmp(ucmd/c2/ 775 0 33 0 2552523125 5020 cmd/c2/Makefile 644 0 33 357 2505043227 6526 CFLAGS=-c -d2 -w -DCOPYCODE LDFLAGS= c2: c20.o c21.o c22.o $(CC) $(LDFLAGS) -z -o c2 c2?.o c20.o: c20.c c2.h c21.o: c21.c c2.h c22.o: c22.c c2.h $(CC) $(CFLAGS) -R c22.c clean: rm -f *.o *.s install: install -s c2 $(DESTDIR)/lib ef BUG3 if( vdebug )printf("\treturns %d\n", head->mlhead.subtag ); # endif return( head->mlhead.subtag ); } } } return( 0 ); } # end multi-l/ C. /,"cmd/c2/c20.c 444 0 33 34531 2551472335 5664 # static char sccsid[] = "@(#)c20.c 4.5 7/5/81"; /* char C20[] = {"@(#)c20.c 1.35 80/08/26 14:13:40"}; /* sccs ident */ /* * C object code improver */ #include "c2.h" #include #include char _sibuf[BUFSIZ], _sobuf[BUFSIZ]; int ioflag; long isn = 2000000; struct optab *oplook(); struct optab *getline(); long lgensym[10] = {100000L,200000L,300000L,400000L,500000L,600000L,700000L,800000L,900000L,1000000L}; struct node * alloc(an) { register int n; register char *p; n = an; n+=si((zeof(char *)-1; n &= ~(sizeof(char *)-1); if (lasta+n >= lastr) { if (sbrk(2000) == -1) { fprintf(stderr, "Optimizer: out of space\n"); exit(1); } lastr += 2000; } p = lasta; lasta += n; return(p); } main(argc, argv) char **argv; { register int niter, maxiter, isend; int nflag,infound; nflag = 0; infound=0; argc--; argv++; while (argc>0) {/* get flags */ if (**argv=='+') debug++; else if (**argv=='-') { if ((*argv)[1]=='i') ioflag++; else nflag++; } else if (infound==0) { if (freopen(*argv, "r", stdin) ==NULL) { fprintf(stderr,"C2: can't find %s\n", *argv); exit(1); } setbuf(stdin,_sibuf); ++infound; } else if (freopen(*argv, "w", stdout) ==NULL) { fprintf(stderr,"C2: can't create %s\n", *argv); exit(1); } setbuf(stdout,_sobuf); argc--; argv++; } lasta = lastr = sbrk(2); opsetup(); lasta = firstr = lastr = alloc(0); maxiter = 0; do { isend = input(); niter = 0; bmove(); do { refcount(); do { iterate(); clearreg(); niter++; } while (nchange); comjump(); rmove(); } while (nchange || jumpsw()); addsob(); output(); if (niter > maxiter) maxiter = niter; lasta = firstr; } while (isend); if (nflag) { fprintf(stderr,"%d iterations\n", maxiter); fprintf(stderr,"%d jumps to jumps\n", nbrbr); fprintf(stderr,"%d inst. after jumps\n", iaftbr); fprintf(stderr,"%d jumps to .+1\n", njp1); fprintf(stderr,"%d redundant labels\n", nrlab); fprintf(stderr,"%d cross-jumps\n", nxjump); fprintf(stderr,"%d code motions\n", ncmot); fprintf(stderr,"%d branches reversed\n", nrevbr); fprintf(stderr,"%d redundant moves\n", redunm); fprintf(stderr,"%d simplified addresses\n", nsaddr); fprintf(stderr,"%d loops inverted\n", loopiv); fprintf(stderr,"%d redundant jumps\n", nredunj); fprintf(stderr,"%d common seqs before jmp's\n", ncomj); fprintf(stderr,"%d skips over jumps\n", nskip); fprintf(stderr,"%d sob's added\n", nsob); fprintf(stderr,"%d redundant tst's\n", nrtst); fprintf(stderr,"%d jump on bit\n", nbj); fprintf(stderr,"%d field operations\n", nfield); fprintf(stderr,"%dK core\n", ((unsigned)lastr+01777) >> 10); } putc('\n',stdout); fflush(stdout); exit(0); } input() { register struct node *p, *lastp; struct optab *op; register char *cp1; static struct optab F77JSW = {".long", T(JSW,1)}; lastp = &first; for (;;) { top: op = getline(); if (debug && op==0) fprintf(stderr,"? %s\n",line); switch (op->opcode&0377) { case LABEL: p = alloc(sizeof first); if (isdigit(line[0]) && (p->labno=locdef(line)) || (line[0] == 'L') && (p->labno=getnum(line+1))) { p->combop = LABEL; if (p->labno<100000L && isn<=p->labno) isn=1+p->labno; p->code = 0; } else { p->combop = DLABEL; p->labno = 0; p->code = copy(line); } break; case LGEN: if (*curlp!='L' && !locuse(curlp)) goto std; op= &F77JSW; case JBR: if (op->opcode==T(JBR,RET) || op->opcode==T(JBR,RSB)) goto std; case CBR: case JMP: case JSW: case SOBGEQ: case SOBGTR: case AOBLEQ: case AOBLSS: case ACB: p = alloc(sizeof first); p->combop = op->opcode; p->code=0; cp1=curlp; if ((!isdigit(*cp1) || 0==(p->labno=locuse(cp1))) && (*cp1!='L' || 0==(p->labno = getnum(cp1+1)))) {/* jbs, etc.? */ while (*cp1++); while (*--cp1!=',' && cp1!=curlp); if (cp1==curlp || (!isdigit(*++cp1) || 0==(p->labno=locuse(cp1))) && (*cp1!='L' || 0==(p->labno=getnum(cp1+1)))) p->labno = 0; else *--cp1=0; p->code = copy(curlp); } if (isn<=p->labno) isn=1+p->labno; break; case MOVA: p=alloc(sizeof first); p->combop=op->opcode; p->code=0; cp1=curlp+1; if (cp1[-1]=='L' || isdigit(cp1[-1])) { while (*cp1++!=','); *--cp1=0; if (0!=(p->labno=locuse(curlp)) || 0!=(p->labno=getnum(curlp+1))) p->code=copy(cp1+1); else {*cp1=','; p->code=copy(curlp);} } else {p->code=copy(--cp1); p->labno=0;} break; case SET: case COMM: case LCOMM: printf("%s\n",line); goto top; case BSS: case DATA: for (;;) { printf("%s%c",line,(op->opcode==LABEL ? ':' : '\n')); if (op->opcode==TEXT) goto top; if (END==(op=getline())->opcode) {/* dangling .data is bad for you */ printf(".text\n"); break; } } std: default: p = alloc(sizeof first); p->combop = op->opcode; p->labno = 0; p->code = copy(curlp); break; } p->forw = 0; p->back = lastp; p->pop = op; lastp->forw = p; lastp = p; p->ref = 0; if (p->op==CASE) { char *lp; int ncase; lp=curlp; while (*lp++); while (*--lp!='$'); ncase=getnum(lp+1); if (LABEL!=(getline())->opcode) abort(-2); do { if (WGEN!=(getline())->opcode) abort(-3); p = alloc(sizeof first); p->combop = JSW; p->code = 0; lp=curlp; while(*lp++!='-'); *--lp=0; p->labno=getnum(curlp+1); if (isn<=p->labno) isn=1+p->labno; p->forw = 0; p->back = lastp; lastp->forw = p; lastp = p; p->ref = 0; p->pop=0; } while (--ncase>=0); } if (op->opcode==EROU) return(1); if (op->opcode==END) return(0); } } struct optab * getline() { register char *lp; register c; static struct optab OPLABEL={"",LABEL}; static struct optab OPEND={"",END}; lp = line; while (EOF!=(c=getchar()) && isspace(c)); while (EOF!=c) { if (c==':') { *lp++ = 0; return(&OPLABEL); } if (c=='\n') { *lp++ = 0; return(oplook()); } *lp++ = c; c = getchar(); } *lp++ = 0; return(&OPEND); } long getnum(p) register char *p; { register c; int neg; register long n; n = 0; neg=0; if (*p=='-') {++neg; ++p;} while (isdigit(c = *p++)) { c -= '0'; n *= 10; if (neg) n -= c; else n += c; } if (*--p != 0) return(0); return(n); } locuse(p) register char *p; { register c; int neg; register long n; if (!isdigit(p[0]) || p[1] != 'f' && p[1] != 'b' || p[2]) return(0); return (lgensym[p[0] - '0'] - (p[1] == 'b')); } locdef(p) register char *p; { if (!isdigit(p[0]) || p[1]) return(0); return (lgensym[p[0] - '0']++); } output() { register struct node *t; int casebas; t = &first; while (t = t->forw) switch (t->op) { case END: fflush(stdout); return; case LABEL: printf("L%d:", t->labno); continue; case DLABEL: printf("%s:", t->code); continue; case CASE: casebas=0; default: std: if (t->pop==0) {/* must find it */ register struct optab *p; for (p=optab; p->opstring[0]; ++p) if (p->opcode==t->combop) {t->pop=p; break;} } printf("%s", t->pop->opstring); if (t->code) printf("\t%s", t->code); if (t->labno!=0) printf("%cL%d\n", (t->code ? ',' : '\t'), t->labno); else printf("\n"); continue; case MOVA: if (t->labno==0) goto std; printf("mova%c\tL%d,%s\n","bwlq"[t->subop-BYTE],t->labno,t->code); continue; case JSW: if (t->subop!=0) {/* F77JSW */ printf(".long\tL%d\n",t->labno); continue; } if (casebas==0) printf("L%d:\n",casebas=isn++); printf(".word L%d-L%d\n", t->labno, casebas); continue; } } char * copy(ap) char *ap; { register char *p, *np; char *onp; register n; int na; na = nargs(); p = ap; n = 0; if (*p==0) return(0); do n++; while (*p++); if (na>1) { p = (&ap)[1]; while (*p++) n++; } onp = np = alloc(n); p = ap; while (*np++ = *p++); if (na>1) { p = (&ap)[1]; np--; while (*np++ = *p++); } return(onp); } #define OPHS 560 struct optab *ophash[OPHS]; opsetup() { register struct optab *optp, **ophp; register int i,t; for(i=NREG+5;--i>=0;) regs[i]=alloc(C2_ASIZE); for (optp = optab; optp->opstring[0]; optp++) { t=7; i=0; while (--t>=0) i+= i+optp->opstring[t]; ophp = &ophash[i % OPHS]; while (*ophp++) { /* fprintf(stderr,"\ncollision: %d %s %s", /* ophp-1-ophash,optp->opstring,(*(ophp-1))->opstring); */ if (ophp > &ophash[OPHS]) ophp = ophash; } *--ophp = optp; } } struct optab * oplook() { register struct optab *optp,**ophp; register char *p,*p2; register int t; char tempop[20]; static struct optab OPNULL={"",0}; for (p=line, p2=tempop; *p && !isspace(*p); *p2++= *p++); *p2=0; p2=p; while (isspace(*p2)) ++p2; curlp=p2; t=0; while(--p>=line) t += t+*p; ophp = &ophash[t % OPHS]; while (optp = *ophp) { if (equstr(tempop,optp->opstring)) return(optp); if ((++ophp) >= &ophash[OPHS]) ophp = ophash; } curlp = line; return(&OPNULL); } refcount() { register struct node *p, *lp; struct node *labhash[LABHS]; register struct node **hp; for (hp = labhash; hp < &labhash[LABHS];) *hp++ = 0; for (p = first.forw; p!=0; p = p->forw) if (p->op==LABEL) { labhash[p->labno % LABHS] = p; p->refc = 0; } for (p = first.forw; p!=0; p = p->forw) { if (p->combop==JBR || p->op==CBR || p->op==JSW || p->op==JMP || p->op==SOBGEQ || p->op==SOBGTR || p->op==AOBLEQ || p->op==AOBLSS || p->op==ACB || (p->op==MOVA && p->labno!=0)) { p->ref = 0; lp = labhash[p->labno % LABHS]; if (lp==0 || p->labno!=lp->labno) for (lp = first.forw; lp!=0; lp = lp->forw) { if (lp->op==LABEL && p->labno==lp->labno) break; } if (lp) { hp = nonlab(lp)->back; if (hp!=lp) { p->labno = hp->labno; lp = hp; } p->ref = lp; lp->refc++; } } } for (p = first.forw; p!=0; p = p->forw) if (p->op==LABEL && p->refc==0 && (lp = nonlab(p))->op && lp->op!=JSW) decref(p); } iterate() { register struct node *p, *rp, *p1; nchange = 0; for (p = first.forw; p!=0; p = p->forw) { if ((p->op==JBR||p->op==CBR||p->op==JSW) && p->ref) { rp = nonlab(p->ref); if (rp->op==JBR && rp->labno && p->labno!=rp->labno) { nbrbr++; p->labno = rp->labno; decref(p->ref); rp->ref->refc++; p->ref = rp->ref; nchange++; } } #ifndef COPYCODE if (p->op==CBR && (p1 = p->forw)->combop==JBR) {/* combop: RET problems */ #else if (p->op==CBR && (p1 = p->forw)->combop==JBR && p->ref) {/* combop: RET problems */ #endif rp = p->ref; do rp = rp->back; while (rp->op==LABEL); if (rp==p1) { decref(p->ref); p->ref = p1->ref; p->labno = p1->labno; #ifdef COPYCODE if (p->labno == 0) p->code = p1->code; #endif p1->forw->back = p; p->forw = p1->forw; p->subop = revbr[p->subop]; p->pop=0; nc((hange++; nskip++; } } if (p->op==JBR || p->op==JMP) { while (p->forw && p->forw->op!=LABEL && p->forw->op!=DLABEL && p->forw->op!=EROU && p->forw->op!=END && p->forw->op!=ALIGN && p->forw->op!=0 && p->forw->op!=DATA) { nchange++; iaftbr++; if (p->forw->ref) decref(p->forw->ref); p->forw = p->forw->forw; p->forw->back = p; } rp = p->forw; while (rp && rp->op==LABEL) { if (p->ref == rp) { p->back->forw = p->forw; p->forw->back = p->back; p = p->back; decref(rp); nchange++; njp1++; break; } rp = rp->forw; } xjump(p); p = codemove(p); } } } xjump(p1) register struct node *p1; { register struct node *p2, *p3; int nxj; nxj = 0; if ((p2 = p1->ref)==0) return(0); for (;;) { while ((p1 = p1->back) && p1->op==LABEL); while ((p2 = p2->back) && p2->op==LABEL); if (!equop(p1, p2) || p1==p2) return(nxj); p3 = insertl(p2); p1->combop = JBR; p1->pop=0; p1->ref = p3; p1->labno = p3->labno; p1->code = 0; nxj++; nxjump++; nchange++; } } struct node * insertl(op) register struct node *op; { register struct node *lp; if (op->op == LABEL) { op->refc++; return(op); } if (op->back->op == LABEL) { op = op->back; op->refc++; return(op); } lp = alloc(sizeof first); lp->combop = LABEL; lp->labno = isn++; lp->ref = 0; lp->code = 0; lp->refc = 1; lp->back = op->back; lp->forw = op; op->back->forw = lp; op->back = lp; return(lp); } struct node * codemove(ap) struct node *ap; { register struct node *p1, *p2, *p3; struct node *t, *tl; int n; p1 = ap; /* last clause to avoid infinite loop on partial compiler droppings: L183: jbr L179 L191: jbr L179 casel r0,$0,$1 L193: .word L183-L193 .word L191-L193 L179: ret */ if (p1->op!=JBR || (p2 = p1->ref)==0 || p2==p1->forw) return(p1); while (p2->op == LABEL) if ((p2 = p2->back) == 0) return(p1); if (p2->op!=JBR && p2->op!=JMP) goto ivloop; p2 = p2->forw; p3 = p1->ref; while (p3) { if (p3->op==JBR || p3->op==JMP) { if (p1==p3) return(p1); ncmot++; nchange++; p1->back->forw = p2; p1->forw->back = p3; p2->back->forw = p3->forw; p3->forw->back = p2->back; p2->back = p1->back; p3->forw = p1->forw; decref(p1->ref); return(p2); } else p3 = p3->forw; } return(p1); ivloop: if (p1->forw->op!=LABEL) return(p1); p3 = p2 = p2->forw; n = 16; do { if ((p3 = p3->forw) == 0 || p3==p1 || --n==0) return(p1); } while (p3->op!=CBR || p3->labno!=p1->forw->labno); do if ((p1 = p1->back) == 0) return(ap); while (p1!=p3); p1 = ap; tl = insertl(p1); p3->subop = revbr[p3->subop]; p3->pop=0; decref(p3->ref); p2->back->forw = p1; p3->forw->back = p1; p1->back->forw = p2; p1->forw->back = p3; t = p1->back; p1->back = p2->back; p2->back = t; t = p1->forw; p1->forw = p3->forw; p3->forw = t; p2 = insertl(p1->forw); p3->labno = p2->labno; #ifdef COPYCODE if (p3->labno == 0) p3->code = p2->code; #endif p3->ref = p2; decref(tl); if (tl->refc<=0) nrlab--; loopiv++; nchange++; return(p3); } comjump() { register struct node *p1, *p2, *p3; for (p1 = first.forw; p1!=0; p1 = p1->forw) if (p1->op==JBR && ((p2 = p1->ref) && p2->refc > 1 || p1->subop==RET || p1->subop==RSB)) for (p3 = p1->forw; p3!=0; p3 = p3->forw) if (p3->op==JBR && p3->ref == p2) backjmp(p1, p3); } backjmp(ap1, ap2) struct node *ap1, *ap2; { register struct node *p1, *p2, *p3; p1 = ap1; p2 = ap2; for(;;) { while ((p1 = p1->back) && p1->op==LABEL); p2 = p2->back; if (equop(p1, p2)) { p3 = insertl(p1); p2->back->forw = p2->forw; p2->forw->back = p2->back; p2 = p2->forw; decref(p2->ref); p2->combop = JBR; /* to handle RET */ p2->pop=0; p2->labno = p3->labno; #ifdef COPYCODE p2->code = 0; #endif p2->ref = p3; nchange++; ncomj++; } else return; } } ; } backjmp(ap1, ap2) struct node *ap1, *ap2; { register struct node *p1, *p2, *p3; p1 = ap1; p2 = ap2; for(;;) { while ((p1 = p1->back) && p1->op==LABEL); pcmd/c2/c2.h 444 0 33 4774 2500330455 5565 /*static char sccsid[] = "@(#)c2.h 4.4 3/2/81";*/ /* @(#)c2.h 1.19 80/08/26 13:39:07 */ /* * Header for object code improver */ #define JBR 1 #define CBR 2 #define JMP 3 #define LABEL 4 #define DLABEL 5 #define EROU 7 #define JSW 9 #define MOV 10 #define CLR 11 #define INC 12 #define DEC 13 #define TST 14 #define PUSH 15 #define CVT 16 #define CMP 17 #define ADD 18 #define SUB 19 #define BIT 20 #define BIC 21 #define BIS 22 #define XOR 23 #define COM 24 #define NEG 25 #define MUL 26 #define DIV 27 #define ASH 28 #define EXTV 29 #define EXTZV 30 #define INSV 31 #define CALLS 32 #define RET 33 #define CASE 34 #define SOB 35 #define TEXT 36 #define DATA 37 #define BSS 38 #define ALIGN 39 #define END 40 #define MOVZ 41 #define WGEN 42 #define SOBGEQ 43 #define SOBGTR 44 #define AOBLEQ 45 #define AOBLSS 46 #define ACB 47 #define MOVA 48 #define PUSHA 49 #define LGEN 50 #define SET 51 #define MOVC3 52 #define RSB 53 #define JSB 54 #define MFPR 55 #define MTPR 56 #define PROBER 57 #define PROBEW 58 #define LCOMM 59 #define COMM 60 #define JEQ 0 #define JNE 1 #define JLE 2 #define JGE 3 #define JLT 4 #define JGT 5 /* rearranged for unsigned branches so that jxxu = jxx + 6 */ #define JLOS 8 #define JHIS 9 #define JLO 10 #define JHI 11 #define JBC 12 #define JBS 13 #define JLBC 14 #define JLBS 15 #define JBCC 16 #define JBSC 17 #define JBCS 18 #define JBSS 19 #define BYTE 1 #define WORD 2 #define LONG 3 #define FLOAT 4 #define DOUBLE 5 #define QUAD 6 #define OP2 7 #define OP3 8 #define OPB 9 #define OPX 10 #define T(a,b) (a|((b)<<8)) #define U(a,b) (a|((b)<<4)) #define C2_ASIZE 128 struct optab { char opstring[7]; short opcode; } optab[]; struct node { char op; char subop; short refc; struct node *forw; struct node *back; struct node *ref; char *code; struct optab *pop; long labno; short seq; }; struct { short combop; }; char line[512]; struct node first; char *curlp; int nbrbr; int nsaddr; int redunm; int iaftbr; int njp1; int nrlab; int nxjump; int ncmot; int nrevbr; int loopiv; int nredunj; int nskip; int ncomj; int nsob; int nrtst; int nbj; int nfield; int nchange; int isn; int debug; char *lasta; char *lastr; char *firstr; char revbr[]; #define NREG 12 char *regs[NREG+5]; /* 0-11, 4 for operands, 1 for running off end */ char conloc[C2_ASIZE]; char conval[C2_ASIZE]; char ccloc[C2_ASIZE]; #define RT1 12 #define RT2 13 #define RT3 14 #define RT4 15 #define LABHS 127 struct { char lbyte; }; char *copy(); long getnum(); struct node *codemove(); struct node *insertl(); struct node *nonlab(); int cmd/c2/c22.c 444 0 33 14137 2423272230 5654 static char sccsid[] = "@(#)c22.c 4.1 10/16/80"; #include "c2.h" /* char c22[] = "@(#)c22.c 1.10 80/03/14 10:27:37"; */ #define readonly readonly char revbr[] = { JNE, JEQ, JGT, JLT, JGE, JLE, JNE, JEQ, JHI, JLO, JHIS, JLOS, JBS, JBC, JLBS, JLBC, JBSC, JBCC, JBSS, JBCS }; /* cursed be the preprocessor, whose impotence and stupidity /* prevented this table being macro-generated from ../as/instrs */ readonly struct optab optab[] = { "jbr",JBR, "jeql",T(CBR,JEQ), "jneq",T(CBR,JNE), "jleq",T(CBR,JLE), "jgeq",T(CBR,JGE), "jlss",T(CBR,JLT), "jgtr",T(CBR,JGT), "jbc",T(CBR,JBC), "jbs",T(CBR,JBS), "jlequ",T(CBR,JLOS), "jgequ",T(CBR,JHIS), "jlssu",T(CBR,JLO), "jgtru",T(CBR,JHI), "jlbc",T(CBR,JLBC), "jlbs",T(CBR,JLBS), "jbcc",T(CBR,JBCC), "jbsc",T(CBR,JBSC), "jbcs",T(CBR,JBCS), "jbss",T(CBR,JBSS), "acbb",T(ACB,BYTE), "acbd",T(ACB,DOUBLE), "acbf",T(ACB,FLOAT), "acbl",T(ACB,LONG), "acbw",T(ACB,WORD), "addb2",T(ADD,U(BYTE,OP2)), "addb3",T(ADD,U(BYTE,OP3)), "addd2",T(ADD,U(DOUBLE,OP2)), "addd3",T(ADD,U(DOUBLE,OP3)), "addf2",T(ADD,U(FLOAT,OP2)), "addf3",T(ADD,U(FLOAT,OP3)), "addl2",T(ADD,U(LONG,OP2)), "addl3",T(ADD,U(LONG,OP3)), "addw2",T(ADD,U(WORD,OP2)), "addw3",T(ADD,U(WORD,OP3)), "aobleq",AOBLEQ, "aoblss",AOBLSS, "ashl",T(ASH,LONG), "ashq",T(ASH,QUAD), "bbc",T(CBR,JBC), "bbcc",T(CBR,JBCC), "bbcci",T(CBR,JBCC), "bbcs",T(CBR,JBCS), "bbs",T(CBR,JBS), "bbsc",T(CBR,JBSC), "bbss",T(CBR,JBSS), "bbssi",T(CBR,JBSS), "bcc",T(CBR,JHIS), "bcs",T(CBR,JLO), "beql",T(CBR,JEQ), "beqlu",T(CBR,JEQ), "bgeq",T(CBR,JGE), "bgequ",T(CBR,JHIS), "bgtr",T(CBR,JGT), "bgtru",T(CBR,JHI), "bicb2",T(BIC,U(BYTE,OP2)), "bicb3",T(BIC,U(BYTE,OP3)), "bicl2",T(BIC,U(LONG,OP2)), "bicl3",T(BIC,U(LONG,OP3)), "bicw2",T(BIC,U(WORD,OP2)), "bicw3",T(BIC,U(WORD,OP3)), "bisb2",T(BIS,U(BYTE,OP2)), "bisb3",T(BIS,U(BYTE,OP3)), "bisl2",T(BIS,U(LONG,OP2)), "bisl3",T(BIS,U(LONG,OP3)), "bisw2",T(BIS,U(WORD,OP2)), "bisw3",T(BIS,U(WORD,OP3)), "bitb",T(BIT,BYTE), "bitl",T(BIT,LONG), "bitw",T(BIT,WORD), "blbs",T(CBR,JLBS), "blbc",T(CBR,JLBC), "bleq",T(CBR,JLE), "blequ",T(CBR,JLOS), "blss",T(CBR,JLT), "blssu",T(CBR,JLO), "bneq",T(CBR,JNE), "bnequ",T(CBR,JNE), "brb",JBR, "brw",JBR, "bvc",T(CBR,0), "bvs",T(CBR,0), "callg",CALLS, "calls",CALLS, "caseb",T(CASE,BYTE), "casel",T(CASE,LONG), "casew",T(CASE,WORD), "clrb",T(CLR,BYTE), "clrd",T(CLR,DOUBLE), "clrf",T(CLR,FLOAT), "clrl",T(CLR,LONG), "clrq",T(CLR,QUAD), "clrw",T(CLR,WORD), "cmpb",T(CMP,BYTE), "cmpd",T(CMP,DOUBLE), "cmpf",T(CMP,FLOAT), "cmpl",T(CMP,LONG), "cmpw",T(CMP,WORD), "cvtbd",T(CVT,U(BYTE,DOUBLE)), "cvtbf",T(CVT,U(BYT((E,FLOAT)), "cvtbl",T(CVT,U(BYTE,LONG)), "cvtbw",T(CVT,U(BYTE,WORD)), "cvtdb",T(CVT,U(DOUBLE,BYTE)), "cvtdf",T(CVT,U(DOUBLE,FLOAT)), "cvtdl",T(CVT,U(DOUBLE,LONG)), "cvtdw",T(CVT,U(DOUBLE,WORD)), "cvtfb",T(CVT,U(FLOAT,BYTE)), "cvtfd",T(CVT,U(FLOAT,DOUBLE)), "cvtfl",T(CVT,U(FLOAT,LONG)), "cvtfw",T(CVT,U(FLOAT,WORD)), "cvtlb",T(CVT,U(LONG,BYTE)), "cvtld",T(CVT,U(LONG,DOUBLE)), "cvtlf",T(CVT,U(LONG,FLOAT)), "cvtlw",T(CVT,U(LONG,WORD)), "cvtrdl",T(CVT,U(DOUBLE,LONG)), "cvtrfl",T(CVT,U(FLOAT,LONG)), "cvtwb",T(CVT,U(WORD,BYTE)), "cvtwd",T(CVT,U(WORD,DOUBLE)), "cvtwf",T(CVT,U(WORD,FLOAT)), "cvtwl",T(CVT,U(WORD,LONG)), "decb",T(DEC,BYTE), "decl",T(DEC,LONG), "decw",T(DEC,WORD), "divb2",T(DIV,U(BYTE,OP2)), "divb3",T(DIV,U(BYTE,OP3)), "divd2",T(DIV,U(DOUBLE,OP2)), "divd3",T(DIV,U(DOUBLE,OP3)), "divf2",T(DIV,U(FLOAT,OP2)), "divf3",T(DIV,U(FLOAT,OP3)), "divl2",T(DIV,U(LONG,OP2)), "divl3",T(DIV,U(LONG,OP3)), "divw2",T(DIV,U(WORD,OP2)), "divw3",T(DIV,U(WORD,OP3)), "extv",T(EXTV,LONG), "extzv",T(EXTZV,LONG), "incb",T(INC,BYTE), "incl",T(INC,LONG), "incw",T(INC,WORD), "insv",T(INSV,-1), "jmp",JMP, "mcomb",T(COM,BYTE), "mcoml",T(COM,LONG), "mcomw",T(COM,WORD), "mnegb",T(NEG,BYTE), "mnegd",T(NEG,DOUBLE), "mnegf",T(NEG,FLOAT), "mnegl",T(NEG,LONG), "mnegw",T(NEG,WORD), "movab",T(MOVA,BYTE), "movad",T(MOVA,DOUBLE), "movaf",T(MOVA,FLOAT), "moval",T(MOVA,LONG), "movaq",T(MOVA,QUAD), "movaw",T(MOVA,WORD), "movb",T(MOV,BYTE), "movd",T(MOV,DOUBLE), "movf",T(MOV,FLOAT), "movl",T(MOV,LONG), "movq",T(MOV,QUAD), "movw",T(MOV,WORD), "movzbl",T(MOVZ,U(BYTE,LONG)), "movzbw",T(MOVZ,U(BYTE,WORD)), "movzwl",T(MOVZ,U(WORD,LONG)), "mulb2",T(MUL,U(BYTE,OP2)), "mulb3",T(MUL,U(BYTE,OP3)), "muld2",T(MUL,U(DOUBLE,OP2)), "muld3",T(MUL,U(DOUBLE,OP3)), "mulf2",T(MUL,U(FLOAT,OP2)), "mulf3",T(MUL,U(FLOAT,OP3)), "mull2",T(MUL,U(LONG,OP2)), "mull3",T(MUL,U(LONG,OP3)), "mulw2",T(MUL,U(WORD,OP2)), "mulw3",T(MUL,U(WORD,OP3)), "pushab",T(PUSHA,BYTE), "pushad",T(PUSHA,DOUBLE), "pushaf",T(PUSHA,FLOAT), "pushal",T(PUSHA,LONG), "pushaq",T(PUSHA,QUAD), "pushaw",T(PUSHA,WORD), "pushl",T(PUSH,LONG), "ret",T(JBR,RET), "sobgeq",SOBGEQ, "sobgtr",SOBGTR, "subb2",T(SUB,U(BYTE,OP2)), "subb3",T(SUB,U(BYTE,OP3)), "subd2",T(SUB,U(DOUBLE,OP2)), "subd3",T(SUB,U(DOUBLE,OP3)), "subf2",T(SUB,U(FLOAT,OP2)), "subf3",T(SUB,U(FLOAT,OP3)), "subl2",T(SUB,U(LONG,OP2)), "subl3",T(SUB,U(LONG,OP3)), "subw2",T(SUB,U(WORD,OP2)), "subw3",T(SUB,U(WORD,OP3)), "tstb",T(TST,BYTE), "tstd",T(TST,DOUBLE), "tstf",T(TST,FLOAT), "tstl",T(TST,LONG), "tstw",T(TST,WORD), "xorb2",T(XOR,U(BYTE,OP2)), "xorb3",T(XOR,U(BYTE,OP3)), "xorl2",T(XOR,U(LONG,OP2)), "xorl3",T(XOR,U(LONG,OP3)), "xorw2",T(XOR,U(WORD,OP2)), "xorw3",T(XOR,U(WORD,OP3)), "movc3",MOVC3, ".globl",EROU, ".text",TEXT, ".data",DATA, ".bss",BSS, ".align",ALIGN, ".word",WGEN, ".long",LGEN, ".set",SET, ".lcomm",LCOMM, ".comm",COMM, ".end",END, "rsb",T(JBR,RSB), "jsb",JSB, "mfpr",T(MFPR,LONG), "mtpr",T(MTPR,LONG), "prober",T(PROBER,BYTE), "probew",T(PROBEW,BYTE), "adawi",0, "addp4",0, "addp6",0, "adwc",0, "ashp",0, "bicpsw",0, "bispsw",0, "bpt",0, "bsbb",0, "bsbw",0, "chme",0, "chmk",0, "chms",0, "chmu",0, "cmpc3",0, "cmpc5",0, "cmpp3",0, "cmpp4",0, "cmpv",0, "cmpzv",0, "crc",0, "cvtlp",0, "cvtpl",0, "cvttp",0, "cvtpt",0, "cvtps",0, "cvtsp",0, "divp",0, "editpc",0, "ediv",0, "emodd",0, "emodf",0, "emul",0, "ffc",0, "ffs",0, "halt",0, "index",0, "insque",0, "ldpctx",0, "locc",0, "matchc",0, "movc5",0, "movp",0, "movpsl",0, "movtc",0, "movtuc",0, "mulp",0, "nop",0, "polyd",0, "polyf",0, "popr",0, "pushr",0, "rei",0, "remque",0, "rotl",0, "sbwc",0, "scanc",0, "skpc",0, "spanc",0, "subp4",0, "subp6",0, "svpctx",0, "xfc",0, "escd",0, "esce",0, "escf",0, 0, 0}; ",0, "cmpzv",0, "crc",0, "cvtlp",0, "cvtpl",0, "cvttp",0, "cvtpt",0, "cvtps",0, "cvtsp",0, "divp",0, "editpc",0, "ediv",0, "emodd",0, "emodf",0, "emul",0, "ffc",0, "ffs",0, "halt",0, "index",0, "insque",0, "ldpctx",0, "locc",0, "matchc",0, "movc5",0, "movp",0, "movpsl",0, "movtc",0, "movtuc",0, "mulp",0, "nop",0, "polyd",0, "polyf",0, "popr",0, "pushr",0, "rei",0, "remque",0, "rotl",0, "sbwc",0, "scanc",0, "skpc",cmd/c2/c21.c 444 0 33 103512 2551472336 5702 static char sccsid[] = "@(#)c21.c 4.5 7/5/81"; /* char C21[] = {"@(#)c21.c 1.83 80/10/16 21:18:22 JFR"}; /* sccs ident */ /* * C object code improver-- second part */ #include "c2.h" #include #include #define NUSE 6 int ioflag; int biti[NUSE] = {1,2,4,8,16,32}; int bitsize[4] = {0,8,16,32}; /* index by type codes */ int pos,siz; long f; /* for bit field communication */ struct node *uses[NUSE]; /* for backwards flow analysis */ char *lastrand; /* last operand of instruction */ struct node *bflow(); struct node *bicopt(); char *findcon(); redun3(p,split) register struct node *p; int split; { /* check for 3 addr instr which should be 2 addr */ if (OP3==((p->subop>>4)&0xF)) { if (split) splitrand(p); if (equstr(regs[RT1],regs[RT3]) && (p->op==ADD || p->op==MUL || p->op==BIS || p->op==XOR)) { register char *t=regs[RT1]; regs[RT1]=regs[RT2]; regs[RT2]=t; } if (equstr(regs[RT2],regs[RT3])) { p->subop=(p->subop&0xF)|(OP2<<4); p->pop=0; lastrand=regs[RT2]; *regs[RT3]=0; return(1); } } return(0); } bmove() { register struct node *p, *lastp; register char *cp1,*cp2; register int r; refcount(); for (p=lastp= &first; 0!=(p=p->forw); lastp=p); clearreg(); clearuse(); for (p=lastp; p!= &first; p=p->back) { if (debug) { printf("Uses:\n"); for (r=NUSE;--r>=0;) if (uses[r]) printf("%d: %s\n",r,uses[r]->code? uses[r]->code:""); printf("-\n"); } r=(p->subop>>4)&0xF; if (OP2==r && (cp1=p->code, *cp1++)=='$' && *cp1++=='0' && *cp1++==',' && !source(cp1)) {/* a no-op unless MUL or DIV */ if (p->op==MUL) {p->op=MOV; p->subop&=0xF; p->pop=0;} else if (p->op==DIV) fprintf(stderr,"c2: zero divide\n"); else {delnode(p); redunm++; continue;} } if (OP3==r && 0!=redun3(p,1)) {newcode(p); redunm++;} switch (p->op) { case LABEL: case DLABEL: for (r=NUSE; --r>=0;) if (uses[r]) p->ref=(struct node *) (((int)p->ref)|biti[r]); break; case CALLS: clearuse(); goto std; case 0: clearuse(); break; case SUB: if ((p->subop&0xF)!=LONG) goto std; cp1=p->code; if (*cp1++!='$') goto std; splitrand(p); if (equstr(regs[RT2],"fp") && !indexa(regs[RT1])) {/* address comp. */ char buf[C2_ASIZE]; cp2=buf; *cp2++='-'; cp1=regs[RT1]+1; while (*cp2++= *cp1++); --cp2; cp1="(fp),"; while (*cp2++= *cp1++); --cp2; cp1=regs[RT3]; while (*cp2++= *cp1++); p->code=copy(buf); p->combop=T(MOVA,LONG); p->pop=0; } else if (*cp1++=='-' && 0<=(r=getnum(cp1))) { p->op=ADD; p->pop=0; *--cp1='$'; p->code=cp1; } goto std; case ADD: if ((p->subop&0xF)!=LONG) goto std; cp1=p->code; if (*cp1++!='$') goto std; splitrand(p); if (isstatic(cp1) && (r=isreg(regs[RT2]))>=0 && rforw) { /* address comp: ** addl2 $_foo,r0 \ movab _foo[r0],bar ** movl r0,bar / */ register struct node *pnext = p->forw; char buf[C2_ASIZE]; if (pnext->op == MOV && pnext->subop == LONG) { cp1 = ®s[RT1][1]; cp2 = &buf[0]; while (*cp2++ = *cp1++) ; cp2--; splitrand(pnext); if (r == isreg(regs[RT1])) { delnode(p); p = pnext; p->op = MOVA; p->subop = BYTE; p->pop = 0; cp1 = regs[RT1]; *cp2++ = '['; while (*cp2++ = *cp1++) ; cp2--; *cp2++ = ']'; *cp2++ = ','; cp1 = regs[RT2]; while (*cp2++ = *cp1++) ; p->code = copy(buf); } } } else if (equstr(regs[RT2],"fp") && !indexa(regs[RT1])) {/* address comp. */ cp2=cp1-1; cp1=regs[RT1]+1; while (*cp2++= *cp1++); --cp2; cp1="(fp)"; while (*cp2++= *cp1++); *--cp2=','; p->combop=T(MOVA,LONG); p->pop=0; } else if (*cp1++=='-' && 0<=(r=getnum(cp1))) { p->op=SUB; p->pop=0; *--cp1='$'; p->code=cp1; } /* fall thru ... */ case CASE: default: std: p=bflow(p); break; case MUL: { /* ** Change multiplication by constant powers of 2 to ** shifts. */ splitrand(p); if (regs[RT1][0] != '$' || regs[RT1][1] == '-') goto std; if ((r = ispow2(getnum(®s[RT1][1]))) < 0) goto std; switch (r) { case 0: /* mull3 $1,x,y */ if (p->subop == U(LONG,OP3)) { if (equstr(regs[RT2], regs[RT3])) { delnode(p); p = p->forw; } else { p->op = MOV; p->subop = LONG; p->pop = 0; newcode(p); nchange++; } } else if (p->subop == U(LONG,OP2)) { delnode(p); p = p->forw; } goto std; case 1: /* mull2 $2,x */ if (p->subop == U(LONG, OP2) && !source(regs[RT2])) { strcpy(regs[RT1], regs[RT2]); p->op = ADD; p->pop = 0; newcode(p); nchange++; } goto std; } if(p->subop==U(LONG,OP3)||(p->subop==U(LONG,OP2)&&!source(regs[RT2]))) { if (p->subop == U(LONG,OP2)) strcpy(regs[RT3], regs[RT2]); sprintf(regs[RT1], "$%d", r); p->op = ASH; p->subop = LONG; p->pop = 0; newcode(p); nchange++; } goto std; } case ASH: { /* address comp: ** ashl $1,bar,r0 \ movl bar,r0 ** movab _foo[r0] / movaw _foo[r0] ** ** ashl $2,r0,r0 \ moval _foo[r0] ** movab _foo[r0] / */ register struct node *pf; register int shfrom, shto; long shcnt; char *regfrom; splitrand(p); if (regs[RT1][0] != '$') goto std; if ((shcnt = getnum(®s[RT1][1])) < 1 || shcnt > 3) goto std; if ((shfrom = isreg(regs[RT2])) >= 0) regfrom = copy(regs[RT2],"]"); if ((shto = isreg(regs[RT3])) >= 0 && shtoforw)) goto ashadd; if (pf->op != MOVA && pf->op != PUSHA) goto ashadd; if (pf->subop != BYTE) goto ashadd; splitrand(pf); if (!indexa(regs[RT1])) goto std; cp2 = regs[RT1]; if(!isstatic(cp2)) goto std; while (*cp2++ != '[') ; if (*cp2++ != 'r' || !isdigit(*cp2)) ((goto std; regnum = *cp2++ - '0'; if (isdigit(*cp2)) { if (cp2[1] != ']') goto std; regnum *= 10; regnum += *cp2 - '0'; } if (regnum != shto) goto std; if (shfrom >= 0) /* ashl $N,r*,r0 */ { delnode(p); if (shfrom != shto) { uses[shto] = NULL; splitrand(pf); cp2=regs[RT1]; while (*cp2++!='['); cp1=regfrom; while (*cp2++= *cp1++); newcode(pf); } } else { p->op = MOV; splitrand(p); strcpy(regs[RT1], regs[RT2]); strcpy(regs[RT2], regs[RT3]); regs[RT3][0] = '\0'; p->pop = 0; newcode(p); } switch (shcnt) { case 1: pf->subop = WORD; break; case 2: pf->subop = LONG; break; case 3: pf->subop = QUAD; break; } redunm++; nsaddr++; nchange++; } goto std; ashadd: /* at this point, RT2 and RT3 are guaranteed to be simple regs*/ if (shcnt == 1 && equstr(regs[RT2], regs[RT3])) { /* ** quickie: ** ashl $1,A,A > addl2 A,A */ p->op = ADD; p->subop = U(LONG,OP2); p->pop = 0; strcpy(regs[RT1], regs[RT2]); regs[RT3][0] = '\0'; newcode(p); nchange++; } goto std; } case EXTV: case EXTZV: { /* bit tests: ** extv A,$1,B,rC \ ** tstl rC > jbc A,B,D ** jeql D / ** ** also byte- and word-size fields: ** extv $n*8,$8,A,B > cvtbl n+A,B ** extv $n*16,$16,A,B > cvtwl n+A,B ** extzv $n*8,$8,A,B > movzbl n+A,B ** extzv $n*16,$16,A,B > movzwl n+A,B */ register struct node *pf; /* forward node */ register struct node *pn; /* next node (after pf) */ int flen; /* field length */ splitrand(p); if (regs[RT2][0] != '$') goto std; if ((flen = getnum(®s[RT2][1])) < 0) goto std; if (flen == 1) { register int extreg; /* reg extracted to */ extreg = isreg(regs[RT4]); if (extreg < 0 || extreg >= NUSE) goto std; if ((pf = p->forw)->op != TST) goto std; if (uses[extreg] && uses[extreg] != pf) goto std; splitrand(pf); if (extreg != isreg(regs[RT1])) goto std; if ((pn = pf->forw)->op != CBR) goto std; if (pn->subop != JEQ && pn->subop != JNE) goto std; delnode(p); delnode(pf); pn->subop = (pn->subop == JEQ) ? JBC : JBS; for(cp2=p->code; *cp2++!=',';); for(cp1=cp2; *cp1++!=',';); while (*cp1!=',') *cp2++= *cp1++; *cp2='\0'; pn->code = p->code; pn->pop = NULL; uses[extreg] = NULL; } else if (flen == 8 || flen == 16) { register int boff; /* bit offset */ register int coff; /* chunk (byte or word) offset*/ if (regs[RT1][0] != '$') goto std; if ((boff = getnum(®s[RT1][1])) < 0) goto std; coff = boff / flen; if (coff && (isreg(regs[RT3]) >= 0)) goto std; if (boff < 0 || (boff % flen) != 0) goto std; p->op = (p->op == EXTV) ? CVT : MOVZ; p->subop = U((flen == 8 ? BYTE : WORD), LONG); if (coff == 0) strcpy(regs[RT1], regs[RT3]); else sprintf(regs[RT1], "%d%s%s", coff, regs[RT3][0]=='(' ? "":"+", regs[RT3]); strcpy(regs[RT2], regs[RT4]); regs[RT3][0] = '\0'; regs[RT4][0] = '\0'; p->pop = 0; newcode(p); } nchange++; goto std; } case CMP: { /* comparison to -63 to -1: ** cmpl r0,$-1 > incl r0 ** jeql ... ** ** cmpl r0,$-63 > addl2 $63,r0 ** jeql ... */ register int num; register int reg; register struct node *regp = p->back; if (p->forw->op != CBR) goto std; if (p->forw->subop != JEQ && p->forw->subop != JNE) goto std; splitrand(p); if (strncmp(regs[RT2], "$-", 2) != 0) goto std; reg = r = isreg(regs[RT1]); if (r < 0) goto std; if (r < NUSE && uses[r] != 0) goto std; if (r >= NUSE && regp->op == MOV && p->subop == regp->subop) { if (*regp->code != 'r') goto std; reg = regp->code[1] - '0'; if (isdigit(regp->code[2]) || reg >= NUSE || uses[reg]) goto std; } if (r >= NUSE) goto std; if (reg != r) sprintf(regs[RT1], "r%d", reg); if ((num = getnum(®s[RT2][2])) <= 0 || num > 63) goto std; if (num == 1) { p->op = INC; regs[RT2][0] = '\0'; } else { register char *t; t=regs[RT1];regs[RT1]=regs[RT2];regs[RT2]=t; p->op = ADD; p->subop = U(p->subop, OP2); for (t = ®s[RT1][2]; t[-1] = *t; t++) ; } p->pop = 0; newcode(p); nchange++; goto std; } case JSB: if (equstr(p->code,"mcount")) {uses[0]=p; regs[0][0]= -1;} goto std; case JBR: case JMP: clearuse(); if (p->subop==RET || p->subop==RSB) {uses[0]=p; regs[0][0]= -1; break;} if (p->ref==0) goto std; /* jmp (r0) */ /* fall through */ case CBR: if (p->ref->ref!=0) for (r=NUSE;--r>=0;) if (biti[r] & (int)p->ref->ref) {uses[r]=p; regs[r][0]= -1;} case EROU: case JSW: case TEXT: case DATA: case BSS: case ALIGN: case WGEN: case END: ; } } for (p= &first; p!=0; p=p->forw) if (p->op==LABEL || p->op==DLABEL) p->ref=0; /* erase our tracks */ } rmove() { register struct node *p, *lastp; register int r; int r1; clearreg(); for (p=first.forw; p!=0; p = p->forw) { lastp=p; if (debug) { printf("Regs:\n"); for (r=0; r>4, regs[r]+1); } printf("-\n"); } switch (p->op) { case CVT: splitrand(p); goto mov; case MOV: splitrand(p); if ((r = findrand(regs[RT1],p->subop)) >= 0) { if (r == isreg(regs[RT2]) && p->forw->op!=CBR) { delnode(p); redunm++; break; } } mov: repladdr(p); r = isreg(regs[RT1]); r1 = isreg(regs[RT2]); dest(regs[RT2],p->subop); if (r>=0) { if (r1>=0) savereg(r1, regs[r]+1, p->subop); else if (p->op!=CVT) savereg(r, regs[RT2], p->subop); } else if (r1>=0) savereg(r1, regs[RT1], p->subop); else if (p->op!=CVT) setcon(regs[RT1], regs[RT2], p->subop); break; /* .rx,.wx */ case MFPR: case COM: case NEG: /* .rx,.wx or .rx,.rx,.wx */ case ADD: case SUB: case BIC: case BIS: case XOR: case MUL: case DIV: case ASH: case MOVZ: /* .rx,.rx,.rx,.wx */ case EXTV: case EXTZV: case INSV: splitrand(p); repladdr(p); dest(lastrand,p->subop); if (p->op==INSV) ccloc[0]=0; break; /* .mx or .wx */ case CLR: case INC: case DEC: splitrand(p); dest(lastrand,p->subop); if (p->op==CLR) if ((r = isreg(regs[RT1])) >= 0) savereg(r, "$0", p->subop); else setcon("$0", regs[RT1], p->subop); break; /* .rx */ case TST: case PUSH: splitrand(p); lastrand=regs[RT1+1]; /* fool repladdr into doing 1 operand */ repladdr(p); if (p->op==TST && equstr(lastrand=regs[RT1], ccloc+1) && ((0xf&(ccloc[0]>>4))==p->subop || equtype(ccloc[0],p->subop)) &&!source(lastrand)) { delnode(p); p = p->back; nrtst++; nchange++; } setcc(lastrand,p->subop); break; /* .rx,.rx,.rx */ case PROBER: case PROBEW: case CASE: case MOVC3: /* .rx,.rx */ case MTPR: case CALLS: case CMP: case BIT: splitrand(p); /* fool repladdr into doing right number of operands */ if (p->op==CASE || p->op==MOVC3 || p->op==PROBER || p->op==PROBEW) lastrand=regs[RT4]; else lastrand=regs[RT3]; repladdr(p); if (p->op==CALLS || p->op==MOVC3) clearreg(); if (p->op==BIT) bitopt(p); ccloc[0]=0; break; case CBR: if (p->subop>=JBC) { splitrand(p); if (p->subopsubop>>4)) return(regs[RT3]); switch (p->op) { case MFPR: case JSB: case PUSHA: case TST: case INC: case DEC: case PUSH: return(regs[RT2]); case MTPR: case BIT: case CMP: case CALLS: return(regs[RT3]); case PROBER: case PROBEW: case CASE: case MOVC3: return(regs[RT4]); } return(lastrand); } struct node * bflow(p) register struct node *p; { register char *cp1,*cp2,**preg; register int r; int flow= -1; struct node *olduse=0; splitrand(p); if (p->op!=PUSH && p->subop && 0<=(r=isreg(lastrand)) && rforw) { if (equtype(p->subop,regs[r][0]) || ((p->op==CVT || p->op==MOVZ) && 0xf®s[r][0] && compat(0xf&(p->subop>>4),regs[r][0]))) { register int r2; if (regs[r][1]!=0) {/* send directly to destination */ if (p->op==INC || p->op==DEC) { if (p->op==DEC) p->op=SUB; else p->op=ADD; p->subop=(OP2<<4)+(p->subop&0xF); /* use 2 now, convert to 3 later */ p->pop=0; cp1=lastrand; cp2=regs[RT2]; while (*cp2++= *cp1++); /* copy reg */ cp1=lastrand; *cp1++='$'; *cp1++='1'; *cp1=0; } cp1=regs[r]+1; cp2=lastrand; if (OP2==(p->subop>>4)) {/* use 3 operand form of instruction */ p->pop=0; p->subop += (OP3-OP2)<<4; lastrand=cp2=regs[RT3]; } while (*cp2++= *cp1++); if (p->op==MOVA && p->forw->op==PUSH) { p->op=PUSHA; *regs[RT2]=0; p->pop=0; } else if (p->op==MOV && p->forw->op==PUSH) { p->op=PUSH ; *regs[RT2]=0; p->pop=0; } delnode(p->forw); if (0<=(r2=isreg(lastrand)) && r2op==MOV && p->forw->op!=EXTV && p->forw->op!=EXTZV) { /* superfluous fetch */ int nmatch; char src[C2_ASIZE]; movit: cp2=src; cp1=regs[RT1]; while (*cp2++= *cp1++); splitrand(p->forw); if (p->forw->op != INC && p->forw->op != DEC) lastrand=byondrd(p->forw); nmatch=0; for (preg=regs+RT1;*preg!=lastrand;preg++) if (r==isreg(*preg)) { cp2= *preg; cp1=src; while (*cp2++= *cp1++); ++nmatch; } if (nmatch==1) { if (OP2==(p->forw->subop>>4) && equstr(src,regs[RT2])) { p->forw->pop=0; p->forw->subop += (OP3-OP2)<<4; cp1=regs[RT3]; *cp1++='r'; *cp1++=r+'0'; *cp1=0; } delnode(p); p=p->forw; if (0<=(r2=isreg(src)) && r2op==MOV && (p->forw->op==CVT || p->forw->op==MOVZ) && p->forw->subop&0xf /* if base or index, then forget it */ && compat(p->subop,p->forw->subop) && !source(cp1=regs[RT1]) && !indexa(cp1)) goto movit; } /* adjust 'lastrand' past any 'read' or 'modify' operands. */ lastrand=byondrd(p); /* a 'write' clob((bers the register. */ if (0<=(r=isreg(lastrand)) && rsubop>>4) && 0<=(r=isreg(regs[RT2])) && rop) { case ACB: case AOBLEQ: case AOBLSS: case SOBGTR: case SOBGEQ: break; default: if (uses[r]==0) {/* no direct uses, check for use of condition codes */ register struct node *q=p; while ((q=nonlab(q->forw))->combop==JBR) q=q->ref; /* cc unused, unchanged */ if (q->op!=CBR) {/* ... and destroyed */ preg=regs+RT1; while (cp1= *preg++) { if (cp1==lastrand) {redunm++; delnode(p); return(p->forw);} if (source(cp1) || equstr(cp1,lastrand)) break; } } } flow=r; } } if (0<=(r=flow)) {olduse=uses[r]; uses[r]=0; *(short *)(regs[r])=0;} /* these two are here, rather than in bmove(), /* because I decided that it was better to go for 3-address code /* (save time) rather than fancy jbxx (save 1 byte) /* on sequences like bisl2 $64,r0; movl r0,foo */ if (p->op==BIC) {p=bicopt(p); splitrand(p); lastrand=byondrd(p);} if (p->op==BIS) {bixprep(p,JBSS); lastrand=byondrd(p);} /* now look for 'read' or 'modify' (read & write) uses */ preg=regs+RT1; while (*(cp1= *preg++)) { /* check for r */ if (lastrand!=cp1 && 0<=(r=isreg(cp1)) && rsubop; if (p->op==ASH && preg==(regs+RT1+1)) cp2[-1]=BYTE; /* stupid DEC */ if (p->op==MOV || p->op==PUSH || p->op==CVT || p->op==MOVZ || p->op==COM || p->op==NEG) { if (p->op==PUSH) cp1="-(sp)"; else { cp1=regs[RT2]; if (0<=(r=isreg(cp1)) && rop!=MOV) cp1=0; } if (cp1) while (*cp2++= *cp1++); else *cp2=0; } else *cp2=0; continue; } /* check for (r),(r)+,-(r),[r] */ do if (*cp1=='(' || *cp1=='[') {/* get register number */ char t; cp2= ++cp1; while (*++cp1!=')' && *cp1!=']'); t= *cp1; *cp1=0; if (0<=(r=isreg(cp2)) && rcombop==T(MOV,LONG)) { if (regs[RT1][1]=='L' && 0!=(p->labno=getnum(regs[RT1]+2))) { cp1=p->code; while (*cp1++!=','); p->code= --cp1; } p->combop=T(MOVA,LONG); ++p->code; p->pop=0; } else if (p->combop==T(PUSH,LONG)) { p->combop=T(PUSHA,LONG); ++p->code; p->pop=0; } else if ((p->combop&0xFFFF)==T(ADD,U(LONG,OP3)) && 0<=(r=isreg(regs[RT2]))) { cp1=cp2=p->code; ++cp1; do *cp2++= *cp1; while (*cp1++!=','); cp2[-1]='['; do *cp2++= *cp1; while (*cp1++!=','); cp2[-1]=']'; if (!equstr(regs[RT3],"-(sp)")) p->combop=T(MOVA,BYTE); else {p->combop=T(PUSHA,BYTE); *cp2=0;} if (uses[r]==0) {uses[r]=p; regs[r][0]=OPX<<4;} p->pop=0; } } return(p); } ispow2(n) register long n; {/* -1 -> no; else -> log to base 2 */ register int log; if (n==0 || n&(n-1)) return(-1); log=0; for (;;) {n >>= 1; if (n==0) return(log); ++log; if (n== -1) return(log);} } bitopt(p) register struct node *p; { /* change "bitx $,a" followed by JEQ or JNE /* into JBC or JBS. watch out for I/O registers. (?) /* assumes that 'splitrand' has already been called. */ register char *cp1,*cp2; int b; cp1=regs[RT1]; cp2=regs[RT2]; if (*cp1++!='$' || !okio(cp2) || p->forw->op!=CBR || p->forw->subop&-2 || 0>(b=ispow2(getnum(cp1))) || p->subop!=BYTE && (source(cp2) || indexa(cp2))) return; if (b>=bitsize[p->subop]) {/* you dummy! */ if (source(cp2)) {/* side effect: auto increment or decrement */ p->pop=0; p->op=TST; --cp1; while (*cp1++= *cp2++); regs[RT2][0]=0; newcode(p); } else delnode(p); p = p->forw; if (p->subop==JEQ) {p->combop=JBR; p->pop=0;} else delnode(p); nchange++; nbj++; return; } if (cp1=p->forw->code) {/* destination is not an internal label */ cp2=regs[RT3]; while (*cp2++= *cp1++); } if (b==0 && (p->subop==LONG || !indexa(regs[RT2]))) {/* JLB optimization, ala BLISS */ cp2=regs[RT1]; cp1=regs[RT2]; while (*cp2++= *cp1++); cp2=regs[RT2]; cp1=regs[RT3]; while (*cp2++= *cp1++); *(regs[RT3])=0; p->forw->subop += JLBC-JBC; p->forw->pop=0; } else { cp1=regs[RT1]+1; if (b>9) *cp1++= b/10 +'0'; *cp1++= b%10 +'0'; *cp1=0; /* $ */ } nbj++; newcode(p); p->combop = p->forw->combop+((JBC-JEQ)<<8); p->labno = p->forw->labno; delnode(p->forw); p->pop=0; } isfield(n) register long n; {/* -1 -> no; else -> position of low bit */ register int pos; register long t; t= ((n-1)|n) +1; if (n!=0 && (0==t || 0==n || 0<=ispow2(t))) { pos=0; while(!(n&1)) {n >>= 1; ++pos;} return(pos); } else return(-1); } bixprep(p,bix) register struct node *p; { /* initial setup, single-bit checking for bisopt, bicopt. /* return: 0->don't bother any more; 1->worthwhile trying */ register char *cp1,*cp2; splitrand(p); cp1=regs[RT1]; cp2=regs[RT2]; if (*cp1++!='$' || 0>(pos=isfield(f=getnum(cp1))) || !okio(cp2) || indexa(cp2) || source(cp2) || !okio(lastrand)) return(0); f |= f-1; if (++f==0) siz=32-pos; else siz=ispow2(f)-pos; if (siz==1 && pos>5 && (p->subop>>4)==OP2 && (p->subop&0xF)!=BYTE && possubop&0xF]) { p->ref = insertl(p->forw); p->combop = CBR | (bix<<8); p->pop=0; p->labno = p->ref->labno; if (pos>9) {*cp1++= pos/10 +'0'; pos %= 10;} *cp1++=pos+'0'; *cp1=0; newcode(p); nbj++; return(0); } return(1); } struct node * bicopt(p) register struct node *p; { /* use field operations or MOVZ if possible. done as part of 'bflow'. */ register char *cp1,*cp2; int r; char src[C2_ASIZE]; if (!bixprep(p,JBCC)) return(p); if (f==0) {/* the BIC isolates low order bits */ siz=pos; pos=0; if ((p->subop&0xF)==LONG && *(regs[RT2])!='$') {/* result of EXTZV is long */ /* save source of BICL in 'src' */ cp1=regs[RT2]; cp2=src; while (*cp2++= *cp1++); if (p->back->op==ASH) {/* try for more */ splitrand(p->back); cp1=regs[RT1]; cp2=regs[RT3]; if (*cp1++=='$' && *(regs[RT2])!='$' && !indexa(regs[RT2]) && 0>(f=getnum(cp1)) && equstr(src,cp2) && 0<=(r=isreg(cp2)) && rback); } } if (p->back->op==CVT || p->back->op==MOVZ) {/* greedy, aren't we? */ splitrand(p->back); cp1=regs[RT1]; cp2=regs[RT2]; if (equstr(src,cp2) && okio(cp1) && !indexa(cp1) && 0<=(r=isreg(cp2)) && rback->subop&0xF]>=(pos+siz) && bitsize[p->back->subop>>4]>=(pos+siz)) {/* good CVT */ cp1=regs[RT1]; cp2=src; while (*cp2++= *cp1++); delnode(p->back); } } /* 'pos', 'siz' known; source of field is in 'src' */ splitrand(p); /* retrieve destination of BICL */ if (siz==8 && pos==0) { p->combop = T(MOVZ,U(BYTE,LONG)); sprintf(line,"%s,%s",src,lastrand); } else { p->combop = T(EXTZV,LONG); sprintf(line,"$%d,$%d,%s,%s",pos,siz,src,lastrand); } p->pop=0; p->code = copy(line); nfield++; return(p); }/* end EXTZV possibility */ }/* end low order bits */ /* unfortunately, INSV clears the condition codes, thus cannot be used */ /* else {/* see if BICL2 of positive field should be INSV $0 */ /* if (p->subop==(LONG | (OP2<<4)) && 6<=(pos+siz)) { /* p->combop = INSV; /* sprintf(line,"$0,$%d,$%d,%s",pos,siz,lastrand); /* p->code = copy(line); nfield++; return(p); /* } /* } */ return(p); } jumpsw() { register struct node *p, *p1; register t; int nj; t = 0; nj = 0; for (p=first.forw; p!=0; p = p->forw) p->seq = ++t; for (p=first.forw; p!=0; p = p1) { p1 = p->forw; if (p->op == CBR && p1->op==JBR && p->ref && p1->ref && abs(p->seq - p->ref->seq) > abs(p1->seq - p1->ref->seq)) { if (p->ref==p1->ref) continue; p->subop = revbr[p->subop]; p->pop=0; t = p1->ref; p1->ref = p->ref; p->ref = t; t = p1->labno; p1->labno = p->labno; p->labno = t; #ifdef COPYCODE if (p->labno == 0) { t = p1->code; p1->code = p->code; p->code = t; } #endif nrevbr++; nj++; } } return(nj); } addsob() { register struct node *p, *p1, *p2, *p3; for (p = &first; (p1 = p->forw)!=0; p = p1) { if (p->combop==T(DEC,LONG) && p1->op==CBR) { if (abs(p->seq - p1->ref->seq) > 8) continue; if (p1->subop==JGE || p1->subop==JGT) { if (p1->subop==JGE) p->combop=SOBGEQ; else p->combop=SOBGTR; p->pop=0; p->labno = p1->labno; delnode(p1); nsob++; } } else if (p->combop==T(INC,LONG)) { if (p1->op==LABEL && p1->refc==1 && p1->forw->combop==T(CMP,LONG) && (p2=p1->forw->forw)->combop==T(CBR,JLE) && (p3=p2->ref->back)->combop==JBR && p3->ref==p1 && p3->forw->op==LABEL && p3->forw==p2->ref) { /* change INC LAB: CMP to LAB: INC CMP */ p->back->forw=p1; p1->back=p->back; p->forw=p1->forw; p1->forw->back=p; p->back=p1; p1->forw=p; p1=p->forw; /* adjust beginning value by 1 */ p2=alloc(sizeof first); p2->combop=T(DEC,LONG); p2->pop=0; p2->forw=p3; p2->back=p3->back; p3->back->forw=p2; p3->back=p2; p2->code=p->code; p2->labno=0; } if (p1->combop==T(CMP,LONG) && (p2=p1->forw)->op==CBR) { register char *cp1,*cp2; splitrand(p1); if (!equstr(p->code,regs[RT1])) continue; if (abs(p->seq - p2->ref->seq)>8) {/* outside byte displ range */ if (p2->subop!=JLE) continue; p->combop=T(ACB,LONG); cp2=regs[RT1]; cp1=regs[RT2]; while (*cp2++= *cp1++); /* limit */ cp2=regs[RT2]; cp1="$1"; while (*cp2++= *cp1++); /* increment */ cp2=regs[RT3]; cp1=p->code; while (*cp2++= *cp1++); /* index */ p->pop=0; newcode(p); p->labno = p2->labno; delnode(p2); delnode(p1); nsob++; } else if (p2->subop==JLE || p2->subop==JLT) { if (p2->subop==JLE) p->combop=AOBLEQ; else p->combop=AOBLSS; cp2=regs[RT1]; cp1=regs[RT2]; while (*cp2++= *cp1++); /* limit */ cp2=regs[RT2]; cp1=p->code; while (*cp2++= *cp1++); /* index */ p->pop=0; newcode(p); p->labno = p2->labno; delnode(p2); delnode(p1); nsob++; } } } } } abs(x) { return(x<0((? -x: x); } equop(p1, p2) register struct node *p1; struct node *p2; { register char *cp1, *cp2; if (p1->combop != p2->combop) return(0); if (p1->op>0 && p1->opop==MOVA && p1->labno!=p2->labno) return(0); cp1 = p1->code; cp2 = p2->code; if (cp1==0 && cp2==0) return(1); if (cp1==0 || cp2==0) return(0); while (*cp1 == *cp2++) if (*cp1++ == 0) return(1); return(0); } delnode(p) register struct node *p; { p->back->forw = p->forw; p->forw->back = p->back; } decref(p) register struct node *p; { if (p && --p->refc <= 0) { nrlab++; delnode(p); } } struct node * nonlab(ap) struct node *ap; { register struct node *p; p = ap; while (p && p->op==LABEL) p = p->forw; return(p); } clearuse() { register struct node **i; for (i=uses+NUSE; i>uses;) *--i=0; } clearreg() { register short **i; for (i=regs+NREG; i>regs;) **--i=0; conloc[0] = 0; ccloc[0] = 0; } savereg(ai, s, type) register char *s; { register char *p, *sp; sp = p = regs[ai]; if (source(s)) /* side effects in addressing */ return; /* if any indexing, must be parameter or local */ /* indirection (as in "*-4(fp)") is ok, however */ *p++ = type; while (*p++ = *s) if (*s=='[' || *s++=='(' && *s!='a' && *s!='f') {*sp = 0; return;} } dest(s,type) register char *s; { register int i; source(s); /* handle addressing side effects */ if ((i = isreg(s)) >= 0) { *(short *)(regs[i]) = 0; /* if register destination, that reg is a goner */ if (DOUBLE==(type&0xF) || DOUBLE==((type>>4)&0xF)) *(short *)(regs[i+1]) = 0; /* clobber two at once */ } for (i=NREG; --i>=0;) if (regs[i][1]=='*' && equstr(s, regs[i]+2)) *(short *)(regs[i]) = 0; /* previous indirection through destination is invalid */ while ((i = findrand(s,0)) >= 0) /* previous values of destination are invalid */ *(short *)(regs[i]) = 0; if (!natural(s)) {/* wild store, everything except constants vanishes */ for (i=NREG; --i>=0;) if (regs[i][1] != '$') *(short *)(regs[i]) = 0; conloc[0] = 0; ccloc[0] = 0; } else setcc(s,type); /* natural destinations set condition codes */ } splitrand(p) struct node *p; { /* separate operands at commas, set up 'regs' and 'lastrand' */ register char *p1, *p2; register char **preg; preg=regs+RT1; if (p1=p->code) while (*p1) { lastrand=p2= *preg++; while (*p1) if (','==(*p2++= *p1++)) {--p2; break;} *p2=0; } while (preg<(regs+RT1+5)) *(*preg++)=0; } compat(have, want) { register int hsrc, hdst; if (0==(want &= 0xF)) return(1); /* anything satisfies a wildcard want */ hsrc=have&0xF; if (0==(hdst=((have>>4)&0xF)) || hdst>=OP2) hdst=hsrc; if (want>=FLOAT) return(hdst==want && hsrc==want); /* FLOAT, DOUBLE not compat: rounding */ return(hsrc>=want && hdst>=want && hdst=regs;) { if (**i && equstr(*i+1, as) && compat(**i,type)) return(i-regs); } return(-1); } isreg(s) register char *s; { if (*s++!='r' || !isdigit(*s++)) return(-1); if (*s==0) return(*--s-'0'); if (*(s-1)=='1' && isdigit(*s++) && *s==0) return(10+*--s-'0'); return(-1); } check() { register struct node *p, *lp; lp = &first; for (p=first.forw; p!=0; p = p->forw) { if (p->back != lp) abort(-1); lp = p; } } source(ap) char *ap; { register char *p1, *p2; p1 = ap; p2 = p1; if (*p1==0) return(0); while (*p2++ && *(p2-1)!='['); if (*p1=='-' && *(p1+1)=='(' || *p1=='*' && *(p1+1)=='-' && *(p1+2)=='(' || *(p2-2)=='+') { while (*p1 && *p1++!='r'); if (isdigit(*p1++)) if (isdigit(*p1)) *(short *)(regs[10+*p1-'0'])=0; else *(short *)(regs[*--p1-'0'])=0; return(1); } return(0); } newcode(p) struct node *p; { register char *p1,*p2,**preg; preg=regs+RT1; p2=line; while (*(p1= *preg++)) {while (*p2++= *p1++); *(p2-1)=',';} *--p2=0; p->code=copy(line); } repladdr(p) struct node *p; { register r; register char *p1, *p2; char **preg; int nrepl; preg=regs+RT1; nrepl=0; while (lastrand!=(p1= *preg++)) if (!source(p1) && 0<=(r=findrand(p1,p->subop))) { *p1++='r'; if (r>9) {*p1++='1'; r -= 10;} *p1++=r+'0'; *p1=0; nrepl++; nsaddr++; } if (nrepl) newcode(p); } /* movedat() /* { /* register struct node *p1, *p2; /* struct node *p3; /* register seg; /* struct node data; /* struct node *datp; /* /* if (first.forw == 0) /* return; /* datp = &data; /* for (p1 = first.forw; p1!=0; p1 = p1->forw) { /* if (p1->op == DATA) { /* p2 = p1->forw; /* while (p2 && p2->op!=TEXT) /* p2 = p2->forw; /* if (p2==0) /* break; /* p3 = p1->back; /* p1->back->forw = p2->forw; /* p2->forw->back = p3; /* p2->forw = 0; /* datp->forw = p1; /* p1->back = datp; /* p1 = p3; /* datp = p2; /* } /* } /* if (data.forw) { /* datp->forw = first.forw; /* first.forw->back = datp; /* data.forw->back = &first; /* first.forw = data.forw; /* } /* seg = -1; /* for (p1 = first.forw; p1!=0; p1 = p1->forw) { /* if (p1->op==TEXT||p1->op==DATA||p1->op==BSS) { /* if (p1->op == seg || p1->forw&&p1->forw->op==seg) { /* p1->back->forw = p1->forw; /* p1->forw->back = p1->back; /* p1 = p1->back; /* continue; /* } /* seg = p1->op; /* } /* } /* } */ redunbr(p) register struct node *p; { register struct node *p1; register char *ap1; char *ap2; if ((p1 = p->ref) == 0) return; p1 = nonlab(p1); if (p1->op==TST) { splitrand(p1); savereg(RT2, "$0", p1->subop); } else if (p1->op==CMP) splitrand(p1); else return; if (p1->forw->op==CBR) { ap1 = findcon(RT1, p1->subop); ap2 = findcon(RT2, p1->subop); p1 = p1->forw; if (compare(p1->subop, ap1, ap2)) { nredunj++; nchange++; decref(p->ref); p->ref = p1->ref; p->labno = p1->labno; #ifdef COPYCODE if (p->labno == 0) p->code = p1->code; if (p->ref) #endif p->ref->refc++; } } else if (p1->op==TST && equstr(regs[RT1],ccloc+1) && equtype(ccloc[0],p1->subop)) { p1=insertl(p1->forw); decref(p->ref); p->ref=p1; nrtst++; nchange++; } } char * findcon(i, type) { register char *p; register r; p = regs[i]; if (*p=='$') return(p); if ((r = isreg(p)) >= 0 && compat(regs[r][0],type)) return(regs[r]+1); if (equstr(p, conloc)) return(conval+1); return(p); } compare(op, acp1, acp2) char *acp1, *acp2; { register char *cp1, *cp2; register n1; int n2; int sign; cp1 = acp1; cp2 = acp2; if (*cp1++ != '$' || *cp2++ != '$') return(0); n1 = 0; sign=1; if (*cp2=='-') {++cp2; sign= -1;} while (isdigit(*cp2)) {n1 *= 10; n1 += (*cp2++ - '0')*sign;} n2 = n1; n1 = 0; sign=1; if (*cp1=='-') {++cp1; sign= -1;} while (isdigit(*cp1)) {n1 *= 10; n1 += (*cp1++ - '0')*sign;} if (*cp1=='+') cp1++; if (*cp2=='+') cp2++; do { if (*cp1++ != *cp2) return(0); } while (*cp2++); cp1 = n1; cp2 = n2; switch(op) { case JEQ: return(cp1 == cp2); case JNE: return(cp1 != cp2); case JLE: return(((int)cp1) <= ((int)cp2)); case JGE: return(((int)cp1) >= ((int)cp2)); case JLT: return(((int)cp1) < ((int)cp2)); case JGT: return(((int)cp1) > ((int)cp2)); case JLO: return(cp1 < cp2); case JHI: return(cp1 > cp2); case JLOS: return(cp1 <= cp2); case JHIS: return(cp1 >= cp2); } return(0); } setcon(cv, cl, type) register char *cv, *cl; { register char *p; if (*cv != '$') return; if (!natural(cl)) return; p = conloc; while (*p++ = *cl++); p = conval; *p++ = type; while (*p++ = *cv++); } equstr(p1, p2) register char *p1, *p2; { do { if (*p1++ != *p2) return(0); } while (*p2++); return(1); } setcc(ap,type) char *ap; { register char *p, *p1; p = ap; if (!natural(p)) { ccloc[0] = 0; return; } p1 = ccloc; *p1++ = type; while (*p1++ = *p++); } okio(p) register char *p; {/* 0->probable I/O space address; 1->not */ if (ioflag && (!natural(p) || 0>getnum(p))) return(0); return(1); } indexa(p) register char *p; {/* 1-> uses [r] addressing mode; 0->doesn't */ while (*p) if (*p++=='[') return(1); return(0); } natural(p) register char *p; {/* 1->simple local, parameter, global, or register; 0->otherwise */ if (*p=='*' || *p=='(' || *p=='-'&&*(p+1)=='(' || *p=='$'&&getnum(p+1)) return(0); while (*p++); p--; if (*--p=='+' || *p==']' || *p==')' && *(p-2)!='a' && *(p-2)!='f') return(0); return(1); } /* ** Tell if an argument is most likely static. */ isstatic(cp) register char *cp; { if (*cp == '_' || *cp == 'L' || (*cp++ == 'v' && *cp == '.')) return (1); return (0); } ='[') return(1); return(0); } natural(p) register char *p; {/* 1->simple local, parameter, global, or register; 0->otherwise */ if (*p=='*' || *p=='(' || *p=='-'&&*(p+1)=='(' || *cmd/c2/changes 644 0 33 4470 2423537046 6447 Only in .: Keep Only in .: Makefile Only in .: SCCS Only in .: c2 diff ./c2.h /va/staff/sklower/c2/c2.h 1,2c1 < /*static char sccsid[] = "@(#)c2.h 4.1 10/16/80";*/ < /* @(#)c2.h 1.18 80/03/14 10:27:01 */ --- > /* @(#)c2.h 1.19 80/08/26 13:39:07 */ 63,64c62,63 < #define COMM 59 < #define LCOMM 60 --- > #define LCOMM 59 > #define COMM 60 115c114 < int labno; --- > long labno; diff ./c20.c /va/staff/sklower/c2/c20.c 2,3c2 < static char sccsid[] = "@(#)c20.c 4.1 10/16/80"; < /* char C20[] = {"@(#)c20.c 1.33 80/08/08 10:01:02"}; /* sccs ident */ --- > char C20[] = {"@(#)c20.c 1.35 80/08/26 14:13:40"}; /* sccs ident */ 14c13 < int isn = 2000000; --- > int isn = 20000; 17,18c16,17 < int lgensym[10] = < {100000,200000,300000,400000,500000,600000,700000,800000,900000,1000000}; --- > long lgensym[10] = > {100000L,200000L,300000L,400000L,500000L,600000L,700000L,800000L,900000L,1000000L}; 27,28c26,27 < n++; < n &= ~01; --- > n+=sizeof(char *)-1; > n &= ~(sizeof(char *)-1); 132c131 < if (isn<=p->labno) isn=1((+p->labno; --- > if (p->labno<100000L && isn<=p->labno) isn=1+p->labno; diff ./c21.c /va/staff/sklower/c2/c21.c 1,3c1 < static char sccsid[] = "@(#)c21.c 4.2 10/16/80"; < /* char C21[] = {"@(#)c21.c 1.83 80/10/16 21:18:22 JFR"}; /* sccs ident */ < --- > char C21[] = {"@(#)c21.c 1.83 80/10/16 21:18:22"}; /* sccs ident */ 422,426c420,424 < if (r>=0) { < if (r1>=0) savereg(r1, regs[r]+1, p->subop); < else if (p->op!=CVT) savereg(r, regs[RT2], p->subop); < } else if (r1>=0) savereg(r1, regs[RT1], p->subop); < else if (p->op!=CVT) setcon(regs[RT1], regs[RT2], p->subop); --- > if (r>=0) { > if (r1>=0) savereg(r1, regs[r]+1, p->subop); > else if (p->op!=CVT) savereg(r, regs[RT2], p->subop); > } else if (r1>=0) savereg(r1, regs[RT1], p->subop); > else if (p->op!=CVT) setcon(regs[RT1], regs[RT2], p->subop); 648c646 < if (p->op==ASH && preg==(regs+RT1+1)) cp2[-1]=BYTE; /* stupid DEC */ --- > if (p->op==ASH && preg==(regs+RT1+1)) cp2[-1]=BYTE; /* stupid DEC */ 659,660c657,658 < else *cp2=0; < } else *cp2=0; --- > else *cp2=0; > } else *cp2=0; diff ./c22.c /va/staff/sklower/c2/c22.c 1d0 < static char sccsid[] = "@(#)c22.c 4.1 10/16/80"; 3c2 < /* char c22[] = "@(#)c22.c 1.10 80/03/14 10:27:37"; */ --- > char c22[] = "@(#)c22.c 1.11 80/08/26 13:53:54"; Only in .: jfr.mail gs[RT2], p->subop); 648c646 < if (p->op==ASH && preg==(regs+RT1+1)) cp2[-1]=BYTE; /* stupid DEC */ --- > if (p->op==ASH && preg==(regs+RT1+1)) cp2[-1]=BYTE; /* stupid DEC */ 659,660c657,658 < cmd/c2/jfr.mail 644 0 33 1463 2402330351 6523 From vax135!jfr Tue Aug 26 15:19:15 1980 I incorporated your changes to c2. However, I felt that things were getting out of hand when c2 used 7-digit numbers for labels it introduced, when there were no local labels in the input. [In the spirit of 16 bits, I made lgensym a 'long' array. In the spirit of 32 bits, I changed alloc(): n = an; n+=sizeof(char *)-1; n &= ~(sizeof(char *)-1); if (lasta+n >= lastr) { ] Aug 26 14:18 1980 s.c20.c: -r1.34 vs. -r1.35 Page 1 13c13 < long isn = 2000000; --- > int isn = 20000; 17c17 < {100000,200000,300000,400000,500000,600000,700000,800000,900000,1000000}; --- > {100000L,200000L,300000L,400000L,500000L,600000L,700000L,800000L,900000L,1000000L}; 131c131 < if (isn<=p->labno) isn=1+p->labno; --- > if (p->labno<100000L && isn<=p->labno) isn=1+p->labno; 32 bits, I changed alloc(): n = an; n+=sizeof(char *)-1; n &= ~(sizeof(char *)-1); if (lasta+n >= lastr) { ] Aug 26 14:18 1980 s.c20.c: -r1.34 vs. -r1.35 Page 1 13c13 < long isn = 2000000; --- > incmd/c2/libI77.fix 664 0 33 6562 2523177406 6670 From G:dlw Tue Apr 28 14:03:40 1981 To: r:sklower Subject: reading into (nH.... The following puts it back. David ---- Apr 28 13:56 1981 s.rdfmt.c: -r1.2 vs. -r1.3 Page 1 55,58c55,60 < /* case APOS: < /* return(rd_POS(p->p1)); < /* case H: < /* return(rd_H(p->p1,p->p2)); */ --- > #ifndef KOSHER > case APOS: /* NOT STANDARD F77 */ > return(rd_POS((char *)p->p1)); > case H: /* NOT STANDARD F77 */ > return(rd_H(p->p1,(char *)p->p2)); > #endif 234,253c236,264 < /*rd_H(n,s) char *s; < /*{ int i,ch; < /* for(i=0;i rd_H(n,s) char *s; > { int i,ch = 0; > for(i=0;i { if (ch != '\n') > GET(ch); > if (ch == '\n') > *s++ = ' '; > else > *s++ = ch; > } > return(OK); > } > > rd_POS(s) char *s; > { char quote; > int ch = 0; > quote = *s++; > while(*s) > { if(*s==quote && *(s+1)!=quote) > break; > if (ch != '\n') > GET(ch); > if (ch == '\n') > *s++ = ' '; > else > *s++ = ch; > } > return(OK); > } From G:dlw Tue Apr 28 19:48:37 1981 To: r:sklower Subject: fort-66 carriage control on lu.6 Below are diffs to allow initialization of the I/O lib for carriage control on logical unit 6 (stdout). The "trick" is to load a module that initializes a short int (init66_) to: for fortran-66, 0 for f-77 (this is the default) Now, there are several ways to force init66_ to be set. 1) pass "-u _init66_" to the loader. This is next to impossible with the f77 driver as it is. 2) load a BLOCK DATA module that does the initialization. For example: block data old66 common /init66/ iflag integer*2 iflag data iflag/1/ end The following two routines are new in libI77 ..... --- yes_66.c --- /* char id_yes_66[] = "@(#)yes_66.c 1.1"; * set flag to initialize fortran-66 mods * * user's load command must include "-u _init66_" */ short init66_ = 1; --- no_66.c --- /* char id_no_66[] = "@(#)no_66.c 1.1"; * flag to NOT initialize fortran-66 mods */ short init66_ = 0; --- sccsdiffs for other affected routines --- Apr 28 19:31 1981 s.Makefile: -r1.8 vs. -r1.9 Page 1 20c20,21 < dofio.c f_errlist.c f_errno.h fiodefs.h fio.h format.h lio.h --- > dofio.c f_errlist.c yes_66.c no_66.c \ > f_errno.h fiodefs.h fio.h format.h lio.h 26c27 < dballoc.o err.o util.o f_errlist.o --- > dballoc.o yes_66.o err.o no_66.o util.o f_errlist.o Apr 28 19:29 1981 s.err.c: -r1.4 vs. -r1.5 Page 1 148,150c148,151 < { ini_std(STDERR, stderr, WRITE); < ini_std(STDIN, stdin, READ); < ini_std(STDOUT, stdout, WRITE); --- > { extern short init66_; > ini_std(STDERR, stderr, WRITE, 0); > ini_std(STDIN, stdin, READ, 0); > ini_std(STDOUT, stdout, WRITE, init66_); Apr 28 19:30 1981 s.util.c: -r1.2 vs. -r1.3 Page 1 12c12 < ini_std(u,F,w) FILE *F; --- > ini_std(u,F,w,i66) FILE *F; 20c20,21 < p->ublnk = p->uscrtch = p->uprnt = p->uend = NO; --- > p->ublnk = p->uscrtch = p->uend = NO; > p->uprnt = (i66!=0)? YES : NO; ------------------------------------------------- Please let me know if this allows the "standard nbs" tests to run. David 6_; > ini_std(STDERR, stderr, WRITE, 0); > ini_std(STDIN, stdin, READ, 0); > ini_std(STDOUT, stdout, WRITE, init66_); Apr 28 19:30 1981cmd/calendar/ 775 0 33 0 2552523162 6266 cmd/calendar/calendar.c 444 0 33 1565 2477633540 10303 static char *sccsid = "@(#)calendar.c 4.2 (Berkeley) 81/02/28"; /* /usr/lib/calendar produces an egrep -f file that will select today's and tomorrow's calendar entries, with special weekend provisions used by calendar command */ #include #define DAY (3600*24L) char *month[] = { "[Jj]an", "[Ff]eb", "[Mm]ar", "[Aa]pr", "[Mm]ay", "[Jj]un", "[Jj]ul", "[Aa]ug", "[Ss]ep", "[Oo]ct", "[Nn]ov", "[Dd]ec" }; struct tm *localtime(); tprint(t) long t; { struct tm *tm; tm = localtime(&t); printf("(^|[ (,;])((%s[^ ]* *|%d/)0*%d)([^0123456789]|$)\n", month[tm->tm_mon], tm->tm_mon + 1, tm->tm_mday); printf("(^|[ (,;])((\\* *)0*%d)([^0123456789]|$)\n", tm->tm_mday); } main() { long t; time(&t); tprint(t); switch(localtime(&t)->tm_wday) { case 5: t += DAY; tprint(t); case 6: t += DAY; tprint(t); default: t += DAY; tprint(t); } } l", "[Aa]ug", "[Ss]ep", "[Oo]ct", "[Nn]ov", "[Dd]ec" }; struct tm *localtime(); tprint(t) long t; { struct tm *tm; tm = localtime(&cmd/calendar/calendar.sh 444 0 33 1024 2663135105 10450 : calendar.sh 4.3 82/02/13 PATH=/bin:/usr/bin: tmp=/tmp/cal$$ trap "rm -f $tmp /tmp/cal2$$" trap exit 1 2 13 15 /usr/lib/calendar >$tmp case $# in 0) trap "rm -f $tmp ; exit" 0 1 2 13 15 egrep -f $tmp calendar;; *) trap "rm -f $tmp /tmp/cal2$$; exit" 0 1 2 13 15 sed ' s/\([^:]*\):.*:\(.*\):[^:]*$/y=\2 z=\1/ ' /etc/passwd \ | while read x do eval $x if test -r $y/calendar then egrep -f $tmp $y/calendar 2>/dev/null > /tmp/cal2$$ if test -s /tmp/cal2$$ then < /tmp/cal2$$ mail $z (( fi fi done esac /02/13 PATH=/bin:/usr/bin: tmp=/tmp/cal$$ trap "rm -f $tmp /tmp/cal2$$" trap exit 1 2 13 15 /usr/lib/calendar >$tmp case $# in 0) trap "rm -f $tmp ; exit" 0 1 2 13 15 egrep -f $tmp calendar;; *) trap "rm -f $tmp /tmp/cal2$$; exit" 0 1 2 13 15 sed ' s/\([^:]*\):.*:\(.*\):[^:]*$/y=\2 z=\1/ ' /etc/passwd \ | while read x do eval $x if test -r $y/calendar then egrep -f $tmp $y/calendar 2>/dev/null > /tmp/cal2$$ if test -s /tmp/cal2$$ then < /tmp/cal2$$ mail $z cmd/calendar/Makefile 600 0 33 245 2477632516 7774 calendar: cc -O -o calendar calendar.c install: install -s calendar $(DESTDIR)/usr/lib install -c calendar.sh $(DESTDIR)/usr/bin/calendar clean: rm -f calendar mp ; exit" 0 1 2 13 15 egrep -f $tmp calendar;; *) trap "rm -f $tmp /tmp/cal2$$; exit" 0 1 2 13 15 sed ' s/\([^:]*\):.*:\(.*\):[^:]*$/y=\2 z=\1/ ' /etc/passwd \ | while read x do eval $x if test -r $y/calendar then egrep -f $tmp $y/calend/,5x< /,"cmd/compact/ 775 0 33 0 2552524142 6142 cmd/compact/compact.c 644 0 33 13633 2254113650 10042 /* * Adaptive Huffman code input to output * * On - line algorithm * * Does not prepend decoding tree * * Written by Colin L. Mc Master (UCB) February 28, 1979 */ #include "compact.h" union cio d; int bits; main (argc, argv) short argc; char *argv [ ]; { register short i, j; register int m; union cio c; short l; longint ic, n; char *cp, fname [LNAME]; dir [513] . next = NULL; for (head = dir + (j = 513); j--; ) { dirp = head--; head -> next = dirp; } bottom = dirp -> pt = dict; dict [0] . top [0] = dict [0] . top [1] = dirp; dirq = dirp -> next; in [EF] . flags = FBIT | SEEN; for (i = 1; ; i++) { ic = oc = 0; (bottom -> top [1]) -> next = flist; bottom -> top [1] = dirp; flist = dirq; if (i >= argc) { uncfp = stdin; cfp = stdout; } else { m = -1; cp = fname; for (l = 0; l < (LNAME - 3) && (*cp = argv [i][l]); l++) if (*cp++ == '/') m = l; if (l >= (LNAME - 3) || (l - m) > 13) { fprintf (stderr, "%s: File name too long\n", argv [i]); if (i == argc - 1) break; continue; } if ((uncfp = fopen (argv [i], "r")) == NULL) { perror (argv [i]); if (i == argc - 1) break; continue; } } fstat (fileno (uncfp), &status); if ((status.st_mode & 040000) == 040000) { fprintf (stderr, "%s: Can't compact a directory\n", argv [i]); if (i < argc) goto closein; break; } if ((d . integ = getc (uncfp)) != EOF) { ic++; if ((c . integ = getc (uncfp)) != EOF) { d . chars . hib = c . integ & 0377; if ((d . integ &= 0177777) == COMPACTED) { fprintf (stderr, "%s: Already compacted.\n", argv [i]); if (i < argc) goto closein; break; } if (d . integ == PACKED) { fprintf (stderr, "%s: Already packed using program pack. Use unpack.\n", argv [i]); if (i < argc) goto closein; break; } if (i < argc) { *cp++ = '.'; *cp++ = 'C'; *cp = '\0'; if ((cfp = fopen (fname, "w")) == NULL) { perror (fname); goto closein; } chmod (fname, status.st_mode); } c . integ = COMPACTED; putc (c . chars . lob, cfp); putc (c . chars . hib, cfp); if (ferror (cfp)) if (i < argc) { perror (fname); unlink (fname); goto closeboth; } else goto fail; bits = 8; oc = 2; c . integ = d . integ & 0377; in [NC] . fp = in [EF] . fp = dict [0] . sp [0] . p = bottom = dict + 1; bottom -> count [0] = bottom -> count [1] = dict [0] . count [1] = 1; dirp -> next = dict [0] . top [1] = bottom -> top [0] = bottom -> top [1] = dirq = NEW; dirq -> next = NULL; dict [0] . fath . fp = NULL; dirq -> pt = bottom -> fath . fp = in [c . integ] . fp = dict; in [c . integ] . flags = (FBIT | SEEN); in [NC] . flags = SEEN; dict [0] . fath . flags = RLEAF; bottom -> fath . flags = (LLEAF | RLEAF); dict [0] . count [0] = 2; dict [0] . sp [1] . ch = c . integ; bottom -> sp [0] . ch = NC; bottom -> sp [1] . ch = EF; for (c . integ = ((d . integ >> 8) & 0377); c . integ != EOF; c . integ = getc (uncfp)) { ic++; if (in [c . integ] . flags & SEEN) encode (c . integ); else { encode (NC); uptree (NC); insert (c . integ); m = 0200; for (j = 8; j--; m >>= 1) { d . integ <<= 1; if (m & c . integ) d . integ++; ++bits; if ((bits &= 017) == 0) { putc (d . chars . hib, cfp); putc (d . chars . lob, cfp); oc += 2; } } } if (ferror (cfp)) if (i < argc) { perror (fname); unlink (fname); goto closeboth; } else goto fail; uptree (c . integ); } if (ferror (uncfp)) if (i < argc) { perror (argv [i]); unlink (fname); goto closeboth; } else goto fail; encode (EF); if (bits) { d . integ <<= (16 - bits); oc++; putc (d . chars . hib, cfp); if (bits > 8) { oc++; putc (d . chars . lob, cfp); } bits = 0; } } else oc = ic; } if (ferror (uncfp) || ferror (cfp)) if (i < argc) { if (ferror (cfp)) perror (fname); else perror (argv [i]); if (oc > 1) { unlink (fname); goto closeboth; } goto closein; } else goto fail; else { if (oc >= ic) { if (i < argc) fprintf (stderr, "%s: ", argv [i]); if (i < argc) fprintf (stderr, "Not compacted. "); fprintf (stderr, "Does not save bytes.\n"); if (i < argc) { if (oc > 1) { unlink (fname); goto closeboth; } goto closein; } else break; } while ((ic - oc) > 21474) { ic /= 10; oc /= 10; } n = 100000 * (ic - oc) / ic + 5; m = (n % 1000) / 10; bits = m % 10 + '0'; c . integ = m / 10 + '0'; if (i < argc) fprintf (stderr, "%s: ", argv [i]); fprintf (stderr, "Compression : %4ld.%c%c%%\n", n / 1000, c . chars . lob, bits); } if (i >= argc) break; unlink (argv [i]); closeboth : fclose (cfp); closein : fclose (uncfp); if (i == argc - 1) break; for (j = 256; j--; ) in [j] . flags = 0; continue; fail : fprintf (stderr, "Unsuccessful compact of standard input to standard output.\n"); break; } } encode (ch) int ch; { register struct node *pp; register char j; union cio c; int stack [17], stp, stbits; c . integ = ch; stack [stp = 0] = in [c . integ] . flags & FBIT; stbits = 1; pp = in [c . integ] . fp; while (pp -> fath . fp) { stack [stp] <<= 1; if (pp -> fath . flags & FBIT) stack [stp]++; stbits++; if ((stbits &= 017) == 0) stp++; pp = pp -> fath . fp; } /* pop the output stack */ for (stp++; stp--; ) { for (j = 0; j < stbits; j++) { d . integ <<= 1; if (stack [stp] & 01) d . integ++; ++bits; if ((bits &= 017) == 0) { putc (d . chars . hib, cfp); putc (d . chars . lob, cfp); if (ferror (cfp)) return; oc += 2; } stack [stp] >>= 1; } stbits = 16; } } le (pp -> fath . fp) { stack [stp] <<= 1; if (pp -> fath . flags & FBIT) stack [stp]++; stbits+cmd/compact/uncompact.c 644 0 33 10453 2254113650 10402 /* * Uncompact adaptive Huffman code input to output * * On - line algorithm * * Input file does not contain decoding tree * * Written by Colin L. Mc Master (UCB) February 14, 1979 */ #include "compact.h" main (argc, argv) short argc; char *argv [ ]; { register short i; register struct node *p; register short j; register int m; union cio c, d; char b; longint ic, n; char fname [LNAME], *cp; dir [513] . next = NULL; for (head = dir + (j = 513); j--; ) { dirp = head--; head -> next = dirp; } bottom = dirp -> pt = dict; dict [0] . top [0] = dict [0] . top [1] = dirp; dirq = dirp -> next; in [EF] . flags = FBIT | SEEN; for (i = 1; ; i++) { ic = oc = 0; (bottom -> top [1]) -> next = flist; bottom -> top [1] = dirp; flist = dirq; if (i >= argc) { uncfp = stdout; cfp = stdin; } else { m = -1; cp = fname; for (j = 0; j < (LNAME - 3) && (*cp = argv [i][j]); j++) if (*cp++ == '/') m = j; if (cp [-1] == 'C' && cp [-2] == '.') cp [-2] = 0; else {(( fprintf (stderr, "%s: File name must end with \".C\"\n", argv [i]); if (i == argc - 1) break; continue; } if (j >= (LNAME - 3) || (j - m) > 15) { fprintf (stderr, "File name too long -- %s\n", argv [i]); if (i == argc - 1) break; continue; } if ((cfp = fopen (argv [i], "r")) == NULL) { perror (argv [i]); if (i == argc - 1) break; continue; } if ((uncfp = fopen (fname, "w")) == NULL) { perror (fname); fclose (cfp); if (i == argc - 1) break; continue; } fstat (fileno (cfp), &status); chmod (fname, status.st_mode & 07777); } if ((c . integ = getc (cfp)) != EOF) { if ((d . integ = getc (cfp)) != EOF) { c . chars . hib = d . integ & 0377; c . integ &= 0177777; if (c . integ != COMPACTED) goto notcompact; if ((c . integ = getc (cfp)) != EOF) { putc (c . chars . lob, uncfp); ic = 3; in [NC] . fp = in [EF] . fp = dict [0] . sp [0] . p = bottom = dict + 1; bottom -> count [0] = bottom -> count [1] = dict [0] . count [1] = 1; dirp -> next = dict [0] . top [1] = bottom -> top [0] = bottom -> top [1] = dirq = NEW; dirq -> next = NULL; dict [0] . fath . fp = NULL; dirq -> pt = bottom -> fath . fp = in [c . integ] . fp = dict; in [c . integ] . flags = (FBIT | SEEN); in [NC] . flags = SEEN; dict [0] . fath . flags = RLEAF; bottom -> fath . flags = (LLEAF | RLEAF); dict [0] . count [0] = 2; dict [0] . sp [1] . ch = c . integ; bottom -> sp [0] . ch = NC; bottom -> sp [1] . ch = EF; p = dict; while ((c . integ = getc (cfp)) != EOF) { ic++; for (m = 0200; m; ) { b = (m & c . integ ? 1 : 0); m >>= 1; if (p -> fath . flags & (b ? RLEAF : LLEAF)) { d . integ = p -> sp [b] . ch; if (d . integ == EF) break; if (d . integ == NC) { uptree (NC); d . integ = 0; for (j = 8; j--; m >>= 1) { if (m == 0) { c . integ = getc (cfp); ic++; m = 0200; } d . integ <<= 1; if (m & c . integ) d . integ++; } insert (d . integ); } uptree (d . integ); putc (d . chars . lob, uncfp); oc++; p = dict; } else p = p -> sp [b] . p; } } } } else goto notcompact; } else { notcompact : if (i < argc) { fprintf (stderr, "%s: ", argv [i]); unlink (fname); } if (c . integ == PACKED) fprintf (stderr, "File is packed. Use unpack.\n"); else fprintf (stderr, "Not a compacted file.\n"); if (i >= argc) break; goto closeboth; } if (ferror (uncfp) || ferror (cfp)) if (i < argc) { if (ferror (uncfp)) perror (fname); else perror (argv [i]); fprintf (stderr, "Unable to uncompact %s\n", argv [i]); unlink (fname); goto closeboth; } if (i >= argc) break; fprintf (stderr, "%s uncompacted to %s\n", argv [i], fname); unlink (argv [i]); closeboth : fclose (cfp); closein : fclose (uncfp); if (i == argc - 1) break; for (j = 256; j--; ) in [j] . flags = 0; continue; fail : fprintf (stderr, "Unsuccessful uncompact of standard input to standard output.\n"); break; } } [i]); fprintf (stderr, "Unable to uncompact %s\n", argv [i]); unlink (fname); goto closeboth; } if (i >= argc) break; fprintf (stderr, "%s uncompacted to %s\n", argv [i], fname); cmd/compact/tree.c 644 0 33 5520 2254113651 7330 #include "compact.h" insert (ch) int ch; { register struct node *pp; register int c; union cio d; register struct index *qt, *wt; c = ch; wt = NEW; pp = bottom++; bottom -> fath . fp = pp; in [c] . flags = (SEEN | FBIT); d . integ = bottom -> sp [0] . ch = pp -> sp [1] . ch; in [c] . fp = in [d . integ] . fp = pp -> sp [1] . p = wt -> pt = bottom; bottom -> fath . flags = (LLEAF | RLEAF | FBIT); pp -> fath . flags &= ~RLEAF; in [d . integ] . flags = SEEN; bottom -> count [0] = pp -> count [1]; qt = pp -> top [1]; bottom -> top [0] = qt; bottom -> sp [1] . ch = c; bottom -> count [1] = 0; bottom -> top [1] = qt -> next = wt; wt -> next = NULL; } uptree (ch) int ch; { register struct node *r; union treep q, s; int rs, qs, ss, ts; longint rc, qc, sc; struct node *t; register struct index *rt, *qt, *st; r = in [ch] . fp; rs = in [ch] . flags & FBIT; do { (r -> count [rs])++; rc = r -> count [rs]; rt = r -> top [rs]; for ( ; ; ) { qs = ss = 1 - rs; s . p = r + rs; sc = (s . p) -> count [ss]; st = (s . p) -> top [ss]; if (rs) if (r == bottom) { sc = rc - 2; st = NULL; } else; else if (r == dict) { qc = rc + 1; qt = head; break; } q . p = r - qs; qc = (q . p) -> count [qs]; qt = (q . p) -> top [qs]; if (rc <= qc) break; t = qt -> pt; ts = (rc <= t -> count [0] ? 1 : 0); /* exchange pointers of (t, ts) and (r, rs) */ q . ch = t -> sp [ts] . ch; /* { */ s . ch = r -> sp [rs] . ch; /* { */ t -> sp [ts] . ch = s . ch; /* { */ r -> sp [rs] . ch = q . ch; /* { change code when Cory gets v. 7 */ /* { */ exch (t, ts, q . ch, r, rs); /* { */ exch (r, rs, s . ch, t, ts); /* { */ qs = (rs ? RLEAF : LLEAF); ss = (ts ? RLEAF : LLEAF); if (((r -> fath . flags & qs) << rs) ^ ((t -> fath . flags & ss) << ts)) { r -> fath . flags ^= qs; t -> fath . flags ^= ss; } (t -> count [ts])++; (r -> count [rs])--; (qt -> pt) += ts; r = t; rs = ts; } if (rc == qc) { r -> top [rs] = qt; if (rc > sc + 1) { qt -> next = st; /* dispose of rt */ rt -> next = flist; flist = rt; } else st -> pt = s . p; } else if (rc == sc + 1) { /* create new index at rt */ rt = NEW; rt -> next = st; rt -> pt = r; qt -> next = rt; if (st) st -> pt = s . p; r -> top [rs] = rt; } rs = r -> fath . flags & FBIT; r = r -> fath . fp; } while (r); dirp = head -> next; dirq = dirp -> next; } exch (v, vs, x, w, ws) struct node *v, *w; union treep x; int vs, ws; { if (v -> fath . flags & (vs ? RLEAF : LLEAF)) { in [x . ch] . fp = w; in [x . ch] . flags &= ~01; if (ws) in [x . ch] . flags |= ws; } else { (x . p) -> fath . fp = w; (x . p) -> fath . flags &= ~01; if (ws) (x . p) -> fath . flags |= ws; } } = rt; if (st) st -> pt = s . p; r -> top [rs] = rt; } rs = r -> fath . flags & FBIT; r = r -> fath . fp; } while (r); dirp = head -> next; dirq = dirp -> next;cmd/compact/ccat.sh 755 0 33 66 2235023115 7430 # foreach file ($argv) /usr/ucb/uncompact < $file end reep x; int vs, ws; { if (v -> fath . flags & (vs ? RLEAF : LLEAF)) { in [x . ch] . fp = w; in [x . ch] . flags &= ~01; if (ws) in [x . ch] . flags |= ws; } else { (x . p) -> fath . fp = w; (x . p) -> fath . flags &= ~01; if (ws) (x . p) -> fath . flags |= ws; } } = rt; if (st) st -> pt = s . p; r -> top [rs] = rt; } rs = r -> fath . fl/,5< /,"cmd/compact/Makefile 644 0 33 566 2254114300 7642 CFLAGS=-O DESTDIR= all: compact uncompact compact: compact.o tree.o cc compact.o tree.o -o compact uncompact: uncompact.o tree.o cc uncompact.o tree.o -o uncompact install: install -s compact ${DESTDIR}/usr/ucb install -s uncompact ${DESTDIR}/usr/ucb cp ccat.sh ${DESTDIR}/usr/ucb/ccat chmod 755 ${DESTDIR}/usr/ucb/ccat clean: rm -f compact.o uncompact.o tree.o r -> top [rs] = rt; } rs = r -> fath . fl/,5< /,"cmd/compact/compact.h 644 0 33 1523 2254114510 10016 #define VAX 11/780 #ifdef VAX typedef int longint; #else typedef long longint; #include #endif #include #include #include #define LNAME 80 #define NEW flist; flist = flist -> next #define LLEAF 010 #define RLEAF 04 #define SEEN 02 #define FBIT 01 #define COMPACTED 017777 #define PACKED 017437 #define EF 0400 #define NC 0401 struct charac { char lob; char hib; }; union cio { struct charac chars; int integ; }; struct fpoint { struct node *fp; int(( flags; } in [258]; struct index { struct node *pt; struct index *next; } dir [514], *head, *flist, *dirp, *dirq; union treep { struct node *p; int ch; }; struct node { struct fpoint fath; union treep sp [2]; struct index *top [2]; longint count [2]; } dict [258], *bottom; longint oc; FILE *cfp, *uncfp; struct stat status; ED 017437 #define EF 0400 #define NC 0401 struct charac { char lob; char hib; }; union cio { struct charac chars; int integ; }; struct fpoint { struct node *fp; intcmd/cpp/ 775 0 33 0 2552524373 5304 cmd/cpp/Makefile 644 0 33 567 2416425316 7013 CFLAGS=-O -Dunix=1 -Dvax=1 -DFLEXNAMES cpp : cpp.o cpy.o rodata.o $(CC) $(CFLAGS) -o cpp rodata.o cpp.o cpy.o cpy.c : cpy.y yacc cpy.y ../pcc/:yyfix yyexca yyact yypact yypgo yyr1 yyr2 yychk yydef mv y.tab.c cpy.c cpy.o : cpy.c yylex.c rodata.o : cpy.c $(CC) $(CFLAGS) -R -c rodata.c clean : rm -f *.s *.o cpy.c rodata.c install : install -s cpp $(DESTDIR)/lib 0401 struct charac har lob;/ C. /,"cmd/cpp/README 644 0 33 14330 2334426270 6263 August 25, 1978 Files in this directory form the C preprocessor, which handles '#include' files and macro definition and expansion for the C compiler. This new version was written by John F. Reiser and is from 5 to 12 times faster (on UNIX systems) than the old. To create the executable file 'cpp' in the current directory: make To install the preprocessor 'cpp' so it will be used by the C compiler: : safety first: backup the existing version cp /lib/cpp /lib/ocpp : install the new version cp cpp /lib/cpp Invocation cpp [-CEPR] [-Dname] ... [-Dname=def] ... [-Idirectory] ... [-Uname] ... [] [] If there are two non-flag arguments then the first is the name of the input file and the second is the name of the output file. If there is one non-flag argument then it is the name of the input file and the output is written on the standard output. If there are no non-flag arguments then the input is taken from the standard input and the output is written on the standard output. Flag arguments are: -C retain comments in output -Dname define name as "1" -Dname=def define name as def -E ignored -Idirectory add directory to search list for #include files -P don't insert lines "# 12 \"foo.c\"" into output -R allow recursive macros -Uname undefine name Documentation clarifications: Symbols defined on the command line by "-Dfoo" are defined as "1", i.e., as if they had been defined by "#define foo 1" or "-Dfoo=1". The directory search order for #include files is 1) the directory of the file which contains the #include request (e.g. #include is relative to the file being scanned when the request is made) 2) the directories specified by -I, in left-to-right order 3) the standard directory(s) (which for UNIX is /usr/include) An unescaped linefeed (the single character "\n") terminates a character constant or quoted string. An escaped linefeed (the two-character sequence "\\\n") may be used in the body of a '#define' statement to continue the definition onto the next line. The escaped linefeed is not included in the macro body. Comments are uniformly removed (except if the argument -C is specified). They are also ignored, except that a comment terminates a token. Thus "foo/* la di da */bar" may expand 'foo' and 'bar' but will never expand 'foobar'. If neither 'foo' nor 'bar' is a macro then the output is "foobar", even if 'foobar' is defined as something else. The file #define foo(a,b)b/**/a foo(1,2) produces "21" because the comment causes a break which enables the recognition of 'b' and 'a' as formals in the string "b/**/a". Macro formal parameters are recognized in '#define' bodies even inside character constants and quoted strings. The output from #define foo(a) '\a' foo(bar) is the seven characters " '\\bar'". Macro names are not recognized inside character constants or quoted strings during the regular scan. Thus #define foo bar printf("foo"); does not expand 'foo' in the second line, because it is inside a quoted string which is not part of a '#define' macro definition. Macros are not expanded while processing a '#define' or '#undef'. Thus #define foo bletch #define bar foo #undef foo bar produces "foo". The token appearing immediately after a '#ifdef' or '#ifndef' is not expanded (of course!). Macros are not expanded during the scan which determines the actual parameters to another macro call. Thus #define foo(a,b)b a #define bar hi foo(bar, #define bar bye ) produces " bye" (and warns about the redefinition of 'bar'). There are some differences between the new and the old preprocessor. Bugs fixed: "1.e4" is recognized as a floating-point number, rather than as an opportunity to expand the possible macro name "e4". Any kind and amount of white space (space, tab, linefeed, vertical tab, formfeed, carriage return) is allowed between a macro name and the left parenthesis which introduces its actual parameters. The comma operator is legal in preprocessor '#if' statements. Macros with parameters are legal in preprocessor '#if' statements. Single-character character constants are legal in preprocessor '#if' statements. Linefeeds are put out in the proper place when a multiline comment is not passed through to the output. The following example expands to "# # #" : #define foo # foo foo foo If the -R flag is not specified then the invocation of some recursive macros is trapped and the recursion forcibly terminated with an error message. The recursions that are trapped are the ones in which the nesting level is non-decreasing from some point on. In particular, #define a a a will be detected. (Use "#undef a" if that is what you want.) The recursion #define a c b #define b c a #define c foo a will not be detected because the nesting level decreases after each expansion of "c". The -R flag specifically allows recursive macros and recursion will be strictly obeyed (to the extent that space is available). Assuming that -R is specified: #define a a a causes an infinite loop with very little output. The tail recursion #define a a a causes the string "<>" to be output infinitely many times. The non-tail recursion #define a b> #define b a< a complains "too much pushback", dumps the pushback, and continues (again, infinitely). Stylistic choice: Nothing (not even linefeeds) is output while a false '#if', '#ifdef', or '#ifndef' is in effect. Thus when all conditions become true a line of the form "# 12345 \"foo.c\"" is output (unless -P). Error and warning messages always appear on standard error (file descriptor 2). Mismatch between the number of formals and actuals in a macro call produces only a warning, and not an error. Excess actuals are ignored; missing actuals are turned into null strings. Incompatibility: The virgule '/' in "a=/*b" is interpreted as the first character of the pair "/*" which introduces a comment, rather than as the second character of the divide-and-replace operator "=/". This incompatibility reflects the recent change in the C language which made "a/=*b" the legal way to write such a statement if the meaning "a=a/ *b" is intended. macro call produces only a warning, and not an error. Excess actuals are ignored; missing actuals are turned into null strings. Incompatibility: The virgule '/' in "a=/*b" is interpreted as the first character of the pair "/*" which introduces a comment, rather than as the second charcmd/cpp/cpp.c 644 0 33 77325 2512556663 6356 #ifdef FLEXNAMES #define NCPS 128 #else #define NCPS 8 #endif # include "stdio.h" /* C command /* written by John F. Reiser /* July/August 1978 */ #define STATIC #define STDIN 0 #define STDOUT 1 #define STDERR 2 #define READ 0 #define WRITE 1 #define SALT '#' #ifndef BUFSIZ #define BUFSIZ 512 #endif char *pbeg,*pbuf,*pend; char *outp,*inp; char *newp; char cinit; /* some code depends on whether characters are sign or zero extended */ /* #if '\377' < 0 not used here, old cpp doesn't understand */ #if p((dp11 | vax #define COFF 128 #else #define COFF 0 #endif # if gcos #define ALFSIZ 512 /* alphabet size */ # else #define ALFSIZ 256 /* alphabet size */ # endif char macbit[ALFSIZ+11]; char toktyp[ALFSIZ]; #define BLANK 1 #define IDENT 2 #define NUMBR 3 /* a superimposed code is used to reduce the number of calls to the /* symbol table lookup routine. (if the kth character of an identifier /* is 'a' and there are no macro names whose kth character is 'a' /* then the identifier cannot be a macro name, hence there is no need /* to look in the symbol table.) 'scw1' enables the test based on /* single characters and their position in the identifier. 'scw2' /* enables the test based on adjacent pairs of characters and their /* position in the identifier. scw1 typically costs 1 indexed fetch, /* an AND, and a jump per character of identifier, until the identifier /* is known as a non-macro name or until the end of the identifier. /* scw1 is inexpensive. scw2 typically costs 4 indexed fetches, /* an add, an AND, and a jump per character of identifier, but it is also /* slightly more effective at reducing symbol table searches. /* scw2 usually costs too much because the symbol table search is /* usually short; but if symbol table search should become expensive, /* the code is here. /* using both scw1 and scw2 is of dubious value. */ #define scw1 1 #define scw2 0 #if scw2 char t21[ALFSIZ],t22[ALFSIZ],t23[ALFSIZ+NCPS]; #endif #if scw1 #define b0 1 #define b1 2 #define b2 4 #define b3 8 #define b4 16 #define b5 32 #define b6 64 #define b7 128 #endif #define IB 1 #define SB 2 #define NB 4 #define CB 8 #define QB 16 #define WB 32 char fastab[ALFSIZ]; char slotab[ALFSIZ]; char *ptrtab; #define isslo (ptrtab==(slotab+COFF)) #define isid(a) ((fastab+COFF)[a]&IB) #define isspc(a) (ptrtab[a]&SB) #define isnum(a) ((fastab+COFF)[a]&NB) #define iscom(a) ((fastab+COFF)[a]&CB) #define isquo(a) ((fastab+COFF)[a]&QB) #define iswarn(a) ((fastab+COFF)[a]&WB) #define eob(a) ((a)>=pend) #define bob(a) (pbeg>=(a)) char buffer[NCPS+BUFSIZ+BUFSIZ+NCPS]; # define SBSIZE 48000 /* std = 12000, wnj aug 1979 */ char sbf[SBSIZE]; char *savch = sbf; # define DROP 0xFE /* special character not legal ASCII or EBCDIC */ # define WARN DROP # define SAME 0 # define MAXINC 10 # define MAXFRE 14 /* max buffers of macro pushback */ # define MAXFRM 31 /* max number of formals/actuals to a macro */ static char warnc = WARN; int mactop,fretop; char *instack[MAXFRE],*bufstack[MAXFRE],*endbuf[MAXFRE]; int plvl; /* parenthesis level during scan for macro actuals */ int maclin; /* line number of macro call requiring actuals */ char *macfil; /* file name of macro call requiring actuals */ char *macnam; /* name of macro requiring actuals */ int maclvl; /* # calls since last decrease in nesting level */ char *macforw; /* pointer which must be exceeded to decrease nesting level */ int macdam; /* offset to macforw due to buffer shifting */ #if tgp int tgpscan; /* flag for dump(); */ #endif STATIC int inctop[MAXINC]; STATIC char *fnames[MAXINC]; STATIC char *dirnams[MAXINC]; /* actual directory of #include files */ STATIC int fins[MAXINC]; STATIC int lineno[MAXINC]; STATIC char *dirs[10]; /* -I and <> directories */ char *strdex(), *copy(), *subst(), *trmdir(); struct symtab *stsym(); STATIC int fin = STDIN; STATIC FILE *fout = stdout; STATIC int nd = 1; STATIC int pflag; /* don't put out lines "# 12 foo.c" */ STATIC int passcom; /* don't delete comments */ STATIC int rflag; /* allow macro recursion */ STATIC int ifno; # define NPREDEF 20 STATIC char *prespc[NPREDEF]; STATIC char **predef = prespc; STATIC char *punspc[NPREDEF]; STATIC char **prund = punspc; STATIC int exfail; struct symtab { char *name; char *value; } *lastsym, *lookup(), *slookup(); # if gcos #include static jmp_buf env; # define main mainpp # undef exit # define exit(S) longjmp(env, 1) # define open(S,D) fileno(fopen(S, "r")) # define close(F) fclose(_f[F]) extern FILE *_f[]; # define symsiz 500 # else # define symsiz 1000 /* std = 500, wnj aug 1979 */ # endif STATIC struct symtab stab[symsiz]; STATIC struct symtab *defloc; STATIC struct symtab *udfloc; STATIC struct symtab *incloc; STATIC struct symtab *ifloc; STATIC struct symtab *elsloc; STATIC struct symtab *eifloc; STATIC struct symtab *ifdloc; STATIC struct symtab *ifnloc; STATIC struct symtab *ysysloc; STATIC struct symtab *varloc; STATIC struct symtab *lneloc; STATIC struct symtab *ulnloc; STATIC struct symtab *uflloc; STATIC int trulvl; STATIC int flslvl; sayline() { if (pflag==0) fprintf(fout,"# %d \"%s\"\n", lineno[ifno], fnames[ifno]); } /* data structure guide /* /* most of the scanning takes place in the buffer: /* /* (low address) (high address) /* pbeg pbuf pend /* | <-- BUFSIZ chars --> | <-- BUFSIZ chars --> | /* _______________________________________________________________________ /* |_______________________________________________________________________| /* | | | /* |<-- waiting -->| |<-- waiting --> /* | to be |<-- current -->| to be /* | written | token | scanned /* | | | /* outp inp p /* /* *outp first char not yet written to output file /* *inp first char of current token /* *p first char not yet scanned /* /* macro expansion: write from *outp to *inp (chars waiting to be written), /* ignore from *inp to *p (chars of the macro call), place generated /* characters in front of *p (in reverse order), update pointers, /* resume scanning. /* /* symbol table pointers point to just beyond the end of macro definitions; /* the first preceding character is the number of formal parameters. /* the appearance of a formal in the body of a definition is marked by /* 2 chars: the char WARN, and a char containing the parameter number. /* the first char of a definition is preceded by a zero character. /* /* when macro expansion attempts to back up over the beginning of the /* buffer, some characters preceding *pend are saved in a side buffer, /* the address of the side buffer is put on 'instack', and the rest /* of the main buffer is moved to the right. the end of the saved buffer /* is kept in 'endbuf' since there may be nulls in the saved buffer. /* /* similar action is taken when an 'include' statement is processed, /* except that the main buffer must be completely emptied. the array /* element 'inctop[ifno]' records the last side buffer saved when /* file 'ifno' was included. these buffers remain dormant while /* the file is being read, and are reactivated at end-of-file. /* /* instack[0 : mactop] holds the addresses of all pending side buffers. /* instack[inctop[ifno]+1 : mactop-1] holds the addresses of the side /* buffers which are "live"; the side buffers instack[0 : inctop[ifno]] /* are dormant, waiting for end-of-file on the current file. /* /* space for side buffers is obtained from 'savch' and is never returned. /* bufstack[0:fretop-1] holds addresses of side buffers which /* are available for use. */ dump() { /* write part of buffer which lies between outp and inp . /* this should be a direct call to 'write', but the system slows to a crawl /* if it has to do an unaligned copy. thus we buffer. this silly loop /* is 15% of the total time, thus even the 'putc' macro is too slow. */ register char *p1,*p2; register FILE *f; if ((p1=outp)==inp || flslvl!=0) return; #if tgp #define MAXOUT 80 if (!tgpscan) {/* scan again to insure <= MAXOUT chars between linefeeds */ register char c,*pblank; char savc,stopc,brk; tgpscan=1; brk=stopc=pblank=0; p2=inp; savc= *p2; *p2='\0'; while (c= *p1++) { if (c=='\\') c= *p1++; if (stopc==c) stopc=0; else if (c=='"' || c=='\'') stopc=c; if (p1-outp>MAXOUT && pblank!=0) { *pblank++='\n'; inp=pblank; dump(); brk=1; pblank=0; } if (c==' ' && stopc==0) pblank=p1-1; } if (brk) sayline(); *p2=savc; inp=p2; p1=outp; tgpscan=0; } #endif f=fout; # if gcos /* filter out "$ program c" card if first line of input */ /* gmatch is a simple pattern matcher in the GCOS Standard Library */ { static int gmfirst = 0; if (!gmfirst) { ++gmfirst; if (gmatch(p1, "^$*program[ \t]*c*")) p1 = strdex(p1, '\n'); } } # endif while (p1inctop[ifno]) {/* retrieve hunk of pushed-back macro text */ op=instack[--mactop]; np=pbuf; do {while (*np++= *op++);} while (op=0) *np++=')'; /* supply missing parens */ pend=np; *np='\0'; if (plvl<0) plvl=0; return(p); } inp=p; dump(); exit(exfail); } close(fin); fin=fins[--ifno]; dirs[0]=dirnams[ifno]; sayline(); } } } #define BEG 0 #define LF 1 char * cotoken(p) register char *p; { register int c,i; char quoc; static int state = BEG; if (state!=BEG) goto prevlf; for (;;) { again: while (!isspc(*p++)); switch (*(inp=p-1)) { case 0: { if (eob(--p)) {p=refill(p); goto again;} else ++p;(( /* ignore null byte */ } break; case '|': case '&': for (;;) {/* sloscan only */ if (*p++== *inp) break; if (eob(--p)) p=refill(p); else break; } break; case '=': case '!': for (;;) {/* sloscan only */ if (*p++=='=') break; if (eob(--p)) p=refill(p); else break; } break; case '<': case '>': for (;;) {/* sloscan only */ if (*p++=='=' || p[-2]==p[-1]) break; if (eob(--p)) p=refill(p); else break; } break; case '\\': for (;;) { if (*p++=='\n') {++lineno[ifno]; break;} if (eob(--p)) p=refill(p); else {++p; break;} } break; case '/': for (;;) { if (*p++=='*') {/* comment */ if (!passcom) {inp=p-2; dump(); ++flslvl;} for (;;) { while (!iscom(*p++)); if (p[-1]=='*') for (;;) { if (*p++=='/') goto endcom; if (eob(--p)) { if (!passcom) {inp=p; p=refill(p);} else if ((p-inp)>=BUFSIZ) {/* split long comment */ inp=p; p=refill(p); /* last char written is '*' */ putc('/',fout); /* terminate first part */ /* and fake start of 2nd */ outp=inp=p-=3; *p++='/'; *p++='*'; *p++='*'; } else p=refill(p); } else break; } else if (p[-1]=='\n') { ++lineno[ifno]; if (!passcom) putc('\n',fout); } else if (eob(--p)) { if (!passcom) {inp=p; p=refill(p);} else if ((p-inp)>=BUFSIZ) {/* split long comment */ inp=p; p=refill(p); putc('*',fout); putc('/',fout); outp=inp=p-=2; *p++='/'; *p++='*'; } else p=refill(p); } else ++p; /* ignore null byte */ } endcom: if (!passcom) {outp=inp=p; --flslvl; goto again;} break; } if (eob(--p)) p=refill(p); else break; } break; # if gcos case '`': # endif case '"': case '\'': { quoc=p[-1]; for (;;) { while (!isquo(*p++)); if (p[-1]==quoc) break; if (p[-1]=='\n') {--p; break;} /* bare \n terminates quotation */ if (p[-1]=='\\') for (;;) { if (*p++=='\n') {++lineno[ifno]; break;} /* escaped \n ignored */ if (eob(--p)) p=refill(p); else {++p; break;} } else if (eob(--p)) p=refill(p); else ++p; /* it was a different quote character */ } } break; case '\n': { ++lineno[ifno]; if (isslo) {state=LF; return(p);} prevlf: state=BEG; for (;;) { if (*p++=='#') return(p); if (eob(inp= --p)) p=refill(p); else goto again; } } break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': for (;;) { while (isnum(*p++)); if (eob(--p)) p=refill(p); else break; } break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z': case '_': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': case 's': case 't': case 'u': case 'v': case 'w': case 'x': case 'y': case 'z': #if scw1 #define tmac1(c,bit) if (!xmac1(c,bit,&)) goto nomac #define xmac1(c,bit,op) ((macbit+COFF)[c] op (bit)) #else #define tmac1(c,bit) #define xmac1(c,bit,op) #endif #if scw2 #define tmac2(c0,c1,cpos) if (!xmac2(c0,c1,cpos,&)) goto nomac #define xmac2(c0,c1,cpos,op)\ ((macbit+COFF)[(t21+COFF)[c0]+(t22+COFF)[c1]] op (t23+COFF+cpos)[c0]) #else #define tmac2(c0,c1,cpos) #define xmac2(c0,c1,cpos,op) #endif if (flslvl) goto nomac; for (;;) { c= p[-1]; tmac1(c,b0); i= *p++; if (!isid(i)) goto endid; tmac1(i,b1); tmac2(c,i,0); c= *p++; if (!isid(c)) goto endid; tmac1(c,b2); tmac2(i,c,1); i= *p++; if (!isid(i)) goto endid; tmac1(i,b3); tmac2(c,i,2); c= *p++; if (!isid(c)) goto endid; tmac1(c,b4); tmac2(i,c,3); i= *p++; if (!isid(i)) goto endid; tmac1(i,b5); tmac2(c,i,4); c= *p++; if (!isid(c)) goto endid; tmac1(c,b6); tmac2(i,c,5); i= *p++; if (!isid(i)) goto endid; tmac1(i,b7); tmac2(c,i,6); tmac2(i,0,7); while (isid(*p++)); if (eob(--p)) {refill(p); p=inp+1; continue;} goto lokid; endid: if (eob(--p)) {refill(p); p=inp+1; continue;} tmac2(p[-1],0,-1+(p-inp)); lokid: slookup(inp,p,0); if (newp) {p=newp; goto again;} else break; nomac: while (isid(*p++)); if (eob(--p)) {p=refill(p); goto nomac;} else break; } break; } /* end of switch */ if (isslo) return(p); } /* end of infinite loop */ } char * skipbl(p) register char *p; {/* get next non-blank token */ do {outp=inp=p; p=cotoken(p);} while ((toktyp+COFF)[*inp]==BLANK); return(p); } char * unfill(p) register char *p; { /* take <= BUFSIZ chars from right end of buffer and put them on instack . /* slide rest of buffer to the right, update pointers, return new p. */ register char *np,*op; register int d; if (mactop>=MAXFRE) { pperror("%s: too much pushback",macnam); p=inp=pend; dump(); /* begin flushing pushback */ while (mactop>inctop[ifno]) {p=refill(p); p=inp=pend; dump();} } if (fretop>0) np=bufstack[--fretop]; else { np=savch; savch+=BUFSIZ; if (savch>=sbf+SBSIZE) {pperror("no space"); exit(exfail);} *savch++='\0'; } instack[mactop]=np; op=pend-BUFSIZ; if (op syntax */ inctype=1; ++flslvl; /* prevent macro expansion */ for (;;) { outp=inp=p; p=cotoken(p); if (*inp=='\n') {--p; *cp='\0'; break;} if (*inp=='>') { *cp='\0'; break;} # ifdef gimpel if (*inp=='.' && !intss()) *inp='#'; # endif while (inp=MAXINC) { pperror("Unreasonable include nesting",0); return(p); } if((nfil=savch)>sbf+SBSIZE-BUFSIZ) {pperror("no space"); exit(exfail);} filok=0; for (dirp=dirs+inctype; *dirp; ++dirp) { if ( # if gcos strdex(filname, '/') # else filname[0]=='/' # endif || **dirp=='\0') strcpy(nfil,filname); else { strcpy(nfil,*dirp); # if unix || gcos strcat(nfil,"/"); # endif #ifdef ibm #ifndef gimpel strcat(nfil,"."); #endif #endif strcat(nfil,filname); } if (0<(fins[ifno+1]=open(nfil,READ))) { filok=1; fin=fins[++ifno]; break; } } if (filok==0) pperror("Can't find include file %s",filname); else { lineno[ifno]=1; fnames[ifno]=cp=nfil; while (*cp++); savch=cp; dirnams[ifno]=dirs[0]=trmdir(copy(nfil)); sayline(); /* save current contents of buffer */ while (!eob(p)) p=unfill(p); inctop[ifno]=mactop; } return(p); } equfrm(a,p1,p2) register char *a,*p1,*p2; { register char c; int flag; c= *p2; *p2='\0'; flag=strcmp(a,p1); *p2=c; return(flag==SAME); } char * dodef(p) char *p; {/* process '#define' */ register char *pin,*psav,*cf; char **pf,**qf; int b,c,params; struct symtab *np; char *oldval,*oldsavch; char *formal[MAXFRM]; /* formal[n] is name of nth formal */ char formtxt[BUFSIZ]; /* space for formal names */ if (savch>sbf+SBSIZE-BUFSIZ) {pperror("too much defining"); return(p);} oldsavch=savch; /* to reclaim space if redefinition */ ++flslvl; /* prevent macro expansion during 'define' */ p=skipbl(p); pin=inp; if ((toktyp+COFF)[*pin]!=IDENT) { ppwarn("illegal macro name"); while (*inp!='\n') p=skipbl(p); return(p); } np=slookup(pin,p,1); if (oldval=np->value) savch=oldsavch; /* was previously defined */ b=1; cf=pin; while (cfname); break; } if (*pin==')') break; if (*pin==',') continue; if ((toktyp+COFF)[*pin]!=IDENT) { c= *p; *p='\0'; pperror("bad formal: %s",pin); *p=c; } else if (pf>= &formal[MAXFRM]) { c= *p; *p='\0'; pperror("too many formals: %s",pin); *p=c; } else { *pf++=cf; while (pin=formal; ) { if (equfrm(*qf,pin,p)) { *psav++=qf-formal+1; *psav++=WARN; pin=p; break; } } } else if (*pin=='"' || *pin=='\'' # if gcos || *pin=='`' # endif ) {/* inside quotation marks, too */ char quoc= *pin; for (*psav++= *pin++; pin

=formal; ) { if (equfrm(*qf,pin,cf)) { *psav++=qf-formal+1; *psav++=WARN; pin=cf; break; } } while (pinname); ++lineno[ifno]; np->value=psav-1; } else psav=oldsavch; /* identical redef.; reclaim space */ } else np->value=psav-1; --flslvl; inp=pin; savch=psav; return(p); } #define fasscan() ptrtab=fastab+COFF #define sloscan() ptrtab=slotab+COFF char * control(p) register char *p; {/* find and handle preprocessor control lines */ register struct symtab *np; for (;;) { fasscan(); p=cotoken(p); if (*inp=='\n') ++inp; dump(); sloscan(); p=skipbl(p); *--inp=SALT; outp=inp; ++flslvl; np=slookup(inp,p,0); --flslvl; if (np==defloc) {/* define */ if (flslvl==0) {p=dodef(p); continue;} } else if (np==incloc) {/* include */ if (flslvl==0) {p=doincl(p); continue;} } else if (np==ifnloc) {/* ifndef */ ++flslvl; p=skipbl(p); np=slookup(inp,p,0); --flslvl; if (flslvl==0 && np->value==0) ++trulvl; else ++flslvl; } else if (np==ifdloc) {/* ifdef */ ++flslvl; p=skipbl(p); np=slookup(inp,p,0); --flslvl; if (flslvl==0 && np->value!=0) ++trulvl; else ++flslvl; } else if (np==eifloc) {/* endif */ if (flslvl) {if (--flslvl==0) sayline();} else if (trulvl) --trulvl; else pperror("If-less endif",0); } else if (np==elsloc) {/* else */ if (flslvl) { if (--flslvl!=0) ++flslvl; else {++trulvl; sayline();} } else if (trulvl) {++flslvl; --trulvl;} else pperror("If-less else",0); } else if (np==udfloc) {/* undefine */ if (flslvl==0) { ++flslvl; p=skipbl(p); slookup(inp,p,DROP); --flslvl; } } else if (np==ifloc) {/* if */ #if tgp pperror(" IF not implemented, true assumed", 0); if (flslvl==0) ++trulvl; else ++flslvl; #else newp=p; if (flslvl==0 && yyparse()) ++trulvl; else ++flslvl; p=newp; #endif } else if (np==lneloc) {/* line */ if (flslvl==0 && pflag==0) { outp=inp=p; *--outp='#'; while (*inp!='\n') p=cotoken(p); continue; } } else if (*++inp=='\n') outp=inp; /* allows blank line after # */ else pperror("undefined control",0); /* flush to lf */ ++flslvl; while (*inp!='\n') {outp=inp=p; p=cotoken(p);} --flslvl; } } struct symtab * stsym(s) register char *s; { char buf[BUFSIZ]; register char *p; /* make definition look exactly like end of #define line */ /* copy to avoid running off end of world when param list is at end */ p=buf; while (*p++= *s++); p=buf; while (isid(*p++)); /* skip first identifier */ if (*--p=='=') {*p++=' '; while (*p++);} else {s=" 1"; while (*p++= *s++);} pend=p; *--p='\n'; sloscan(); dodef(buf); return(lastsym); } struct symtab * ppsym(s) char *s; {/* kluge */ register struct symtab *sp; cinit=SALT; *savch++=SALT; sp=stsym(s); --sp->name; cinit=0; return(sp); } /* VARARGS1 */ pperror(s,x,y) char *s; { if (fnames[ifno][0]) fprintf(stderr, # if gcos "*%c* \"%s\", line ", exfail >= 0 ? 'F' : 'W', # else "%s: ", # endif fnames[ifno]); fprintf(stderr, "%d: ",lineno[ifno]); fprintf(stderr, s, x, y); fprintf(stderr,"\n"); ++exfail; } yyerror(s,a,b) char *s; { pperror(s,a,b); } ppwarn(s,x) char *s; { int fail = exfail; exfail = -1; pperror(s,x); exfail = fail; } struct symtab * lookup(namep, enterf) char *namep; { register char *np, *snp; register int c, i; int around; register struct symtab *sp; /* namep had better not be too long (currently, <=NCPS chars) */ np=namep; around=0; i=cinit; while (c= *np++) i += i+c; c=i; /* c=i for register usage on pdp11 */ c %= symsiz; if (c<0) c += symsiz; sp = &stab[c]; while (snp=sp->name) { np = namep; while (*snp++ == *np) if (*np++ == '\0') { if (enterf==DROP) {sp->name[0]= DROP; sp->value=0;} return(lastsym=sp); } if (--sp < &stab[0]) if (around) {pperror("too many defines", 0); exit(exfail);} else {++around; sp = &stab[symsiz-1];} } if (enterf==1) sp->name=namep; return(lastsym=sp); } struct symtab * slookup(p1,p2,enterf) register char *p1,*p2; int enterf;{ register char *p3; char c2,c3; struct symtab *np; c2= *p2; *p2='\0'; /* mark end of token */ if ((p2-p1)>NCPS) p3=p1+NCPS; else p3=p2; c3= *p3; *p3='\0'; /* truncate to NCPS chars or less */ if (enterf==1) p1=copy(p1); np=lookup(p1,enterf); *p3=c3; *p2=c2; if (np->value!=0 && flslvl==0) newp=subst(p2,np); else newp=0; return(np); } char * subst(p,sp) register char *p; struct symtab *sp; { static char match[]="%s: argument mismatch"; register char *ca,*vp; int params; char *actual[MAXFRM]; /* actual[n] is text of nth actual */ char acttxt[BUFSIZ]; /* space for actuals */ if (0==(vp=sp->value)) return(p); if ((p-macforw)<=macdam) { if (++maclvl>symsiz && !rflag) { pperror("%s: macro recursion",sp->name); return(p); } } else maclvl=0; /* level decreased */ macforw=p; macdam=0; /* new target for decrease in level */ macnam=sp->name; dump(); if (sp==ulnloc) { vp=acttxt; *vp++='\0'; sprintf(vp,"%d",lineno[ifno]); while (*vp++); } else if (sp==uflloc) { vp=acttxt; *vp++='\0'; sprintf(vp,"\"%s\"",fnames[ifno]); while (*vp++); } if (0!=(params= *--vp&0xFF)) {/* definition calls for params */ register char **pa; ca=acttxt; pa=actual; if (params==0xFF) params=1; /* #define foo() ... */ sloscan(); ++flslvl; /* no expansion during search for actuals */ plvl= -1; do p=skipbl(p); while (*inp=='\n'); /* skip \n too */ if (*inp=='(') { maclin=lineno[ifno]; macfil=fnames[ifno]; for (plvl=1; plvl!=0; ) { *ca++='\0'; for (;;) { outp=inp=p; p=cotoken(p); if (*inp=='(') ++plvl; if (*inp==')' && --plvl==0) {--params; break;} if (plvl==1 && *inp==',') {--params; break;} while (inp &acttxt[BUFSIZ]) pperror("%s: actuals too long",sp->name); } if (pa>= &actual[MAXFRM]) ppwarn(match,sp->name); else *pa++=ca; } } if (params!=0) ppwarn(match,sp->name); while (--params>=0) *pa++=""+1; /* null string for missing actuals */ --flslvl; fasscan(); } for (;;) {/* push definition onto front of input stack */ while (!iswarn(*--vp)) { if (bob(p)) {outp=inp=p; p=unfill(p);} *--p= *vp; } if (*vp==warnc) {/* insert actual param */ ca=actual[*--vp-1]; while (*--ca) { if (bob(p)) {outp=inp=p; p=unfill(p);} *--p= *ca; } } else break; } outp=inp=p; return(p); } char * trmdir(s) register char *s; { register char *p = s; while (*p++); --p; while (p>s && *--p!='/'); # if unix if (p==s) *p++='.'; # endif *p='\0'; return(s); } STATIC char * copy(s) register char *s; { register char *old; old = savch; while (*savch++ = *s++); return(old); } char * strdex(s,c) char *s,c; { while (*s) if (*s++==c) return(--s); return(0); } yywrap(){ return(1); } main(argc,argv) char *argv[]; { register int i,c; register char *p; char *tf,**cp2; # if gcos if (setjmp(env)) return (exfail); # endif p="_$ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; i=0; while (c= *p++) { (fastab+COFF)[c] |= IB|NB|SB; (toktyp+COFF)[c]=IDENT; #if scw2 /* 53 == 63-10; digits rarely appear in identifiers, /* and can never be the first char of an identifier. /* 11 == 53*53/sizeof(macbit) . */ ++i; (t21+COFF)[c]=(53*i)/11; (t22+COFF)[c]=i%11; #endif } p="0123456789."; while (c= *p++) {(fastab+COFF)[c] |= NB|SB; (toktyp+COFF)[c]=NUMBR;} # if gcos p="\n\"'`/\\"; # else p="\n\"'/\\"; # endif while (c= *p++) (fastab+COFF)[c] |= SB; # if gcos p="\n\"'`\\"; # else p="\n\"'\\"; # endif while (c= *p++) (fastab+COFF)[c] |= QB; p="*\n"; while (c= *p++) (fastab+COFF)[c] |= CB; (fastab+COFF)[warnc] |= WB; (fastab+COFF)['\0'] |= CB|QB|SB|WB; for (i=ALFSIZ; --i>=0; ) slotab[i]=fastab[i]|SB; p=" \t\013\f\r"; /* note no \n; \v not legal for vertical tab? */ while (c= *p++) (toktyp+COFF)[c]=BLANK; #if scw2 for ((t23+COFF)[i=ALFSIZ+7-COFF]=1; --i>=-COFF; ) if (((t23+COFF)[i]=(t23+COFF+1)[i]<<1)==0) (t23+COFF)[i]=1; #endif # if unix fnames[ifno=0] = ""; dirnams[0]=dirs[0]="."; # endif # if ibm fnames[ifno=0] = ""; # endif # if gcos if (inquire(stdin, _TTY)) freopen("*src", "rt", stdin); # endif # if gimpel || gcos fnames[ifno=0] = (char *)inquire(stdin, _FILENAME); dirnams[0] = dirs[0] = trmdir(copy(fnames[0])); # endif for(i=1; iprespc+NPREDEF) { pperror("too many -D options, ignoring %s",argv[i]); continue; } /* ignore plain "-D" (no argument) */ if (*(argv[i]+2)) *predef++ = argv[i]+2; continue; case 'U': if (prund>punspc+NPREDEF) { pperror("too many -U options, ignoring %s",argv[i]); continue; } *prund++ = argv[i]+2; continue; case 'I': if (nd>8) pperror("excessive -I file (%s) ignored",argv[i]); else dirs[nd++] = argv[i]+2; continue; case '\0': continue; default: pperror("unknown flag %s", argv[i]); continue; } default: if (fin==STDIN) { if (0>(fin=open(argv[i], READ))) { pperror("No source file %s",argv[i]); exit(8); } fnames[ifno]=copy(argv[i]); dirs[0]=dirnams[ifno]=trmdir(copy(argv[i])); # ifndef gcos /* too dangerous to have file name in same syntactic position be input or output file depending on file redirections, so force output to stdout, willy-nilly [i don't see what the problem is. jfr] */ } else if (fout==stdout) { extern char _sobuf[BUFSIZ]; if (NULL==(fout=fopen(argv[i], "w"))) { pperror("Can't create %s", argv[i]); exit(8); } else {fclose(stdout); setbuf(fout,_sobuf);} # endif } else pperror("extraneous name %s", argv[i]); } } fins[ifno]=fin; exfail = 0; /* after user -I files here are the standard include libraries */ # if unix dirs[nd++] = "/usr/include"; # endif # if gcos dirs[nd++] = "cc/include"; # endif # if ibm # ifndef gimpel dirs[nd++] = "BTL$CLIB(("; # endif # endif # ifdef gimpel dirs[nd++] = intss() ? "SYS3.C." : "" ; # endif /* dirs[nd++] = "/compool"; */ dirs[nd++] = 0; defloc=ppsym("define"); udfloc=ppsym("undef"); incloc=ppsym("include"); elsloc=ppsym("else"); eifloc=ppsym("endif"); ifdloc=ppsym("ifdef"); ifnloc=ppsym("ifndef"); ifloc=ppsym("if"); lneloc=ppsym("line"); for (i=sizeof(macbit)/sizeof(macbit[0]); --i>=0; ) macbit[i]=0; # if unix ysysloc=stsym("unix"); # endif # if gcos ysysloc=stsym ("gcos"); # endif # if ibm ysysloc=stsym ("ibm"); # endif # if pdp11 varloc=stsym("pdp11"); # endif # if vax varloc=stsym("vax"); # endif # if interdata varloc=stsym ("interdata"); # endif # if tss varloc=stsym ("tss"); # endif # if os varloc=stsym ("os"); # endif # if mert varloc=stsym ("mert"); # endif ulnloc=stsym ("__LINE__"); uflloc=stsym ("__FILE__"); tf=fnames[ifno]; fnames[ifno]="command line"; lineno[ifno]=1; cp2=prespc; while (cp2' LE GE %left LS RS %left '+' '-' %left '*' '/' '%' %right '!' '~' UMINUS %left '(' '.' %% S: e stop ={return($1);} e: e '*' e ={$$ = $1 * $3;} | e '/' e ={$$ = $1 / $3;} | e '%' e ={$$ = $1 % $3;} | e '+' e ={$$ = $1 + $3;} | e '-' e ={$$ = $1 - $3;} | e LS e ={$$ = $1 << $3;} | e RS e ={$$ = $1 >> $3;} | e '<' e ={$$ = $1 < $3;} | e '>' e ={$$ = $1 > $3;} | e LE e ={$$ = $1 <= $3;} | e GE e ={$$ = $1 >= $3;} | e EQ e ={$$ = $1 == $3;} | e NE e ={$$ = $1 != $3;} | e '&' e ={$$ = $1 & $3;} | e '^' e ={$$ = $1 ^ $3;} | e '|' e ={$$ = $1 | $3;} | e ANDAND e ={$$ = $1 && $3;} | e OROR e ={$$ = $1 || $3;} | e '?' e ':' e ={$$ = $1 ? $3 : $5;} | e ',' e ={$$ = $3;} | term ={$$ = $1;} term: '-' term %prec UMINUS ={$$ = -$1;} | '!' term ={$$ = !$2;} | '~' term ={$$ = ~$2;} | '(' e ')' ={$$ = $2;} | DEFINED '(' number ')' ={$$= $3;} | DEFINED number ={$$ = $2;} | number ={$$= $1;} %% # include "yylex.c" E e ={$$ = $1 != $3;} | e '&' e ={$$ = $1 & $3;} | e '^' e ={$$ = $1 ^ $3;} | e '|' e ={$$ = $1 | $3;} | e ANDAND e ={$$ = $1 && $3;} | e OROR e ={$$ = $1 || $3;} | e '?' e ':' e ={$$ = $1 ? $3 : $5;} | e ',' e ={$$ = $3;} | term ={$$ = $1;} term: '-' term %prec UMINUS ={$$ = -$1;} | '!' term ={$$ = !$2;} | '~' term ={$cmd/cpp/yylex.c 644 0 33 4573 2334426300 6703 #define isid(a) ((fastab+COFF)[a]&IB) #define IB 1 /* #if '\377' < 0 it would be nice if this worked properly!!!!! */ #if pdp11 | vax #define COFF 128 #else #define COFF 0 #endif yylex() { static int ifdef=0; static char *op2[]={"||", "&&" , ">>", "<<", ">=", "<=", "!=", "=="}; static int val2[]={OROR, ANDAND, RS, LS, GE, LE, NE, EQ}; static char *opc="b\bt\tn\nf\fr\r\\\\"; extern char fastab[]; extern char *outp,*inp,*newp; extern int flslvl; register char savc, *s; char *skipbl(); int val; register char **p2; struct symtab { char *name; char *value; } *sp, *lookup(); for (;;) { newp=skipbl(newp); if (*inp=='\n') return(stop); /* end of #if */ savc= *newp; *newp='\0'; for (p2=op2+8; --p2>=op2; ) /* check 2-char ops */ if (0==strcmp(*p2,inp)) {val=val2[p2-op2]; goto ret;} s="+-*/%<>&^|?:!~(),"; /* check 1-char ops */ while (*s) if (*s++== *inp) {val= *--s; goto ret;} if (*inp<='9' && *inp>='0') {/* a number */ if (*inp=='0') yylval= (inp[1]=='x' || inp[1]=='X') ? tobinary(inp+2,16) : tobinary(inp+1,8); else yylval=tobinary(inp,10); val=number; } else if (isid(*inp)) { if (0==strcmp(inp,"defined")) {ifdef=1; ++flslvl; val=DEFINED;} else { sp=lookup(inp,-1); if (ifdef!=0) {ifdef=0; --flslvl;} yylval= (sp->value==0) ? 0 : 1; val=number; } } else if (*inp=='\'') {/* character constant */ val=number; if (inp[1]=='\\') {/* escaped */ char c; if (newp[-1]=='\'') newp[-1]='\0'; s=opc; while (*s) if (*s++!=inp[2]) ++s; else {yylval= *s; goto ret;} if (inp[2]<='9' && inp[2]>='0') yylval=c=tobinary(inp+2,8); else yylval=inp[2]; } else yylval=inp[1]; } else if (0==strcmp("\\\n",inp)) {*newp=savc; continue;} else { *newp=savc; pperror("Illegal character %c in preprocessor if", *inp); continue; } ret: *newp=savc; outp=inp=newp; return(val); } } tobinary(st, b) char *st; { int n, c, t; char *s; n=0; s=st; while (c = *s++) { switch(c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': t = c-'0'; break; case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': t = c-'a'; if (b>10) break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': t = c - 'A'; if (b>10) break; default: t = -1; if ( c=='l' || c=='L') if (*s=='\0') break; pperror("Illegal number %s", st); } if (t<0) break; n = n*b+t; } return(n); } s=st; while (c = *s++) { switch(c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8cmd/csh/ 775 0 33 0 2607303230 5263 cmd/csh/alloc.c 444 0 33 11225 2420701141 6617 static char *sccsid = "@(#)alloc.c 4.1 10/9/80"; #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 #ifdef debug showall(v) char **v; { register union store *p, *q; int used = 0, free = 0, i; for (p = clearbusy(allocs[1].ptr); p != alloct; p = q) { q = clearbusy(p->ptr); if (v[1]) printf("%6o %5d %s\n", p, ((unsigned) q - (unsigned) p), testbusy(p->ptr) ? "BUSY" : "FREE"); i = ((unsigned) q - (unsigned) p); if (testbusy(p->ptr)) used += i; else free += i; } printf("%d used, %d free, %l end\n", used, free, clearbusy(alloct)); } #endif llocp); #else return(1); #endif } #endif #ifdef debug showall(v) char **v; { register union store *p, *q; int used = 0, free = 0, i; for (p = clearbusy(allocs[1].ptr); p != alloct; p = q) { q = clearbusy(p->ptr); if (v[1]) printf("%6o %5d %s\n", p, ((unsigned) q - (unsigned) p), testbusy(p->ptr) ? "BUSY" : "FREE"); i = ((unsigned) q -cmd/csh/doprnt.c 444 0 33 27726 2420701144 7053 /* static char *sccsid = "@(#)doprnt.c 4.1 10/9/80"; */ # 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 0x((42,'+ # 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 0lp: jbc r4,r2,el1 # want this power? mcmd/csh/errlst.c 444 0 33 1520 2420701146 7022 static char *sccsid = "@(#)errlst.c 4.1 10/9/80"; char *sys_errlist[] { "Error 0", "Not super-user", "No such file or directory", "No such process", "Interrupted system call", "I/O error", "No such device or address", "Arguments too long", "Exec format error", "Bad file number", "No children", "No more processes", "Not enough core", "Permission denied", "Error 14", "Block device required", "Mount device busy", "File exists", "Cross-device link", "No such device", "Not a directory", "Is a directory", "Invalid argument", "File table overflow", "Too many open files", "Not a typewriter", "Text file busy", "File too large", "No space left on device", "Illegal seek", "Read-only file system", "Too many links", "Broken Pipe", "Disk quota exceeded", }; int sys_nerr { sizeof sys_errlist/sizeof sys_errlist[0] }; nough core", "Permission denied", "Error 14", "Block device required", "Mount device busy", "File exists", "Cross-device link", "No such device", "Not a directory", "Icmd/csh/getpwent.c 444 0 33 2550 2420701152 7345 static char *sccsid = "@(#)getpwent.c 4.1 10/9/80"; #include #define BUFSIZ 160 static int pwf = -1; static char line[BUFSIZ+1]; static struct passwd passwd; setpwent() { if( pwf == -1 ) pwf = open( "/etc/passwd", 0 ); else lseek(pwf, 0l, 0); } endpwent() { if( pwf != -1 ){ close( pwf ); pwf = -1; } } static char * pwskip(p) register char *p; { while( *p && *p != ':' ) ++p; if( *p ) *p++ = 0; return(p); } struct passwd * getpwent() { register char *p, *q; register int i, j; if (pwf == -1) { if( (pwf = open( "/etc/passwd", 0 )) == -1 ) return(0); } i = read(pwf, line, BUFSIZ); for (j = 0; j < i; j++) if (line[j] == '\n') break; if (j >= i) return(0); line[++j] = 0; lseek(pwf, (long) (j - i), 1); p = line; passwd.pw_name = p; p = pwskip(p); /* passwd.pw_passwd = p; */ p = q = pwskip(p); /* passwd.pw_uid = atoi(p); */ p = pwskip(p); p[-1] = 0; passwd.pw_uid = atou(q); /* passwd.pw_gid = atoi(p); */ /* passwd.pw_quota = 0; */ /* passwd.pw_comment = ""; */ q = p; p = pwskip(p); p[-1] = 0; passwd.pw_gid = atou(q); /* passwd.pw_gecos = p; */ p = pwskip(p); passwd.pw_dir = p; p = pwskip(p); /* passwd.pw_shell = p; */ /* while(*p && *p != '\n') p++; */ *p = '\0'; return(&passwd); } atou(p) register char *p; { register int i = 0; if (p != 0) while (*p) i = i * 10 + *p++ - '0'; return (i); } atoi(p); */ p = pwskip(p); p[-1] = 0; passwd.pw_uid = atou(q); /* passwd.pw_gid = atoi(p); */ /* passwd.pw_quota = 0; */ /* passwd.pw_comment = ""; cmd/csh/getpwnam.c 444 0 33 414 2420701154 7311 static char *sccsid = "@(#)getpwnam.c 4.1 10/9/80"; #include struct passwd * getpwnam(name) char *name; { register struct passwd *p; struct passwd *getpwent(); setpwent(); while( (p = getpwent()) && strcmp(name,p->pw_name) ); endpwent(); return(p); } register int i = 0; if (p != 0) while (*p) i = i * 10 + *p++ - '0'; return (i); } atoi(p); */ p = pwskip(p); p[-1] = 0; passwd.pw_uid = at/,5< /,"cmd/csh/getpwuid.c 444 0 33 406 2420701156 7322 ((static char *sccsid = "@(#)getpwuid.c 4.1 10/9/80"; #include struct passwd * getpwuid(uid) register uid; { register struct passwd *p; struct passwd *getpwent(); setpwent(); while( (p = getpwent()) && p->pw_uid != uid ); endpwent(); return(p); } p); } register int i = 0; if (p != 0) while (*p) i = i * 10 + *p++ - '0'; return (i); } atoi(p); */ p = pwskip(p); p[-1] = 0; passwd.pw_uid = at/,5< /,"cmd/csh/makefile 444 0 33 4261 2420701160 7044 # # makefile 4.1 10/9/80 # # C Shell with process control; VM/UNIX VAX Makefile # Bill Joy UC Berkeley; Jim Kulp IIASA, Austria # CFLAGS= -O -DTELL -DVMUNIX -Ddebug -DVFORK XSTR= /usr/ucb/xstr ED= -ed AS= -as RM= -rm CXREF= /usr/ucb/cxref VGRIND= csh /usr/ucb/vgrind CTAGS= /usr/ucb/ctags LIBES= -ljobs SCCS= /usr/local/sccs # strings.o must be last in OBJS since it can change when previous files compile OBJS= sh.o sh.dol.o sh.err.o sh.exec.o sh.exp.o sh.func.o sh.glob.o \ sh.hist.o sh.lex.o sh.misc.o sh.parse.o sh.print.o sh.sem.o sh.set.o \ sh.proc.o sh.dir.o sh.time.o alloc.o sh.init.o printf.o \ strings.o doprnt.o # Special massaging of C files for sharing of strings .c.o: ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c - ${CC} -c ${CFLAGS} x.c mv x.o $*.o csh: ${OBJS} sh.local.h rm -f csh cc ${OBJS} -o csh ${LIBES} csh.prof: ${OBJS} sh.prof.o sh.local.h mcrt0.o rm -f csh.prof ld -X mcrt0.o ${OBJS} -o csh.prof ${LIBES} -lc sh.o.prof: cp sh.c sh.prof.c cc -c ${CFLAGS} -DPROF sh.prof.c .DEFAULT: ${SCCS} get $< # need an old doprnt, whose output we can trap doprnt.o: doprnt.c cc -E doprnt.c > doprnt.s as -o doprnt.o doprnt.s rm -f doprnt.s # strings.o and sh.init.o are specially processed to be shared strings.o: strings ${XSTR} ${CC} -c -R xs.c mv xs.o strings.o sh.init.o: ${CC} -E ${CFLAGS} sh.init.c | ${XSTR} -c - ${CC} ${CFLAGS} -c -R x.c mv x.o sh.init.o lint: lint ${CFLAGS} sh*.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 @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: csh sh.local.h install -s csh ${DESTDIR}/bin/csh clean: ${RM} -f a.out strings x.c xs.c csh ${RM} -f *.o sh.prof.c tags: /tmp ${CTAGS} sh*.c 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 >/ccmd/csh/malloc.c 444 0 33 10156 2420701163 7002 static char *sccsid = "@(#)malloc.c 4.1 10/9/80"; #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 - 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)cmd/csh/printf.c 444 0 33 1106 2420701165 7012 static char *sccsid = "@(#)printf.c 4.1 10/9/80"; /* * 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--; } } f" 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) putc((cmd/csh/sh.c 444 0 33 44001 2503316143 6143 static char *sccsid = "@(#)sh.c 4.2 3/11/81"; #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 HIST = '!'; char HISTSUB = '^'; bool nofile; bool reenter; bool nverbose; bool nexececho; bool quitit; bool fast; bool prompt = 1; main(c, av) int c; char **av; { register char **v, *cp; register int f; settimes(); /* Immed. estab. timing base */ v = av; if (eq(v[0], "a.out")) /* A.out's are quittable */ quitit = 1; uid = getuid(); loginsh = **v == '-'; if (loginsh) 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 { register unsigned i = 0; register char *dp; register char **pv; for (dp = cp; *dp; dp++) if (*dp == ':') i++; pv = (char **)calloc(i+2, sizeof (char **)); for (dp = cp, i = 0; ;) if (*dp == ':') { *dp = 0; pv[i++] = savestr(*cp ? cp : "."); *dp++ = ':'; cp = dp; } else if (*dp++ == 0) { pv[i++] = savestr(*cp ? cp : "."); break; } pv[i] = 0; set1("path", pv, &shvhed); } 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. */ parintr = signal(SIGINT, SIG_IGN); /* parents interruptibility */ sigset(SIGINT, parintr); /* ... restore */ parterm = signal(SIGTERM, SIG_IGN); /* parents terminability */ signal(SIGTERM, parterm); /* ... restore */ /* * 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. */ c--, v++; while (c > 0 && (cp = v[0])[0] == '-') { do switch (*cp++) { case 0: /* - Interruptible, no prompt */ prompt = 0; setintr++; nofile++; 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 */ 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 */ prompt = 0; c--, v++; } /* * 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! */ signal(SIGQUIT, SIG_IGN); sigset(SIGINT, pintr); sighold(SIGINT); signal(SIGTERM, SIG_IGN); if (quitit == 0 && arginp == 0) { signal(SIGTSTP, SIG_IGN); signal(SIGTTIN, SIG_IGN); 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, &tpgrp) == 0 && tpgrp != -1) { int ldisc; if (tpgrp != shpgrp) { int old = sigsys(SIGTTIN, SIG_DFL); kill(0, SIGTTIN); sigsys(SIGTTIN, old); goto retry; } if (ioctl(f, TIOCGETD, &oldisc) != 0) goto notty; if (oldisc != NTTYDISC) { printf("Switching to new tty driver...\n"); ldisc = NTTYDISC; ioctl(f, TIOCSETD, &ldisc); } else oldisc = -1; opgrp = shpgrp; shpgrp = getpid(); tpgrp = shpgrp; ioctl(f, TIOCSPGRP, &shpgrp); setpgrp(0, shpgrp); dcopy(f, FSHTTY); ioctl(FSHTTY, FIOCLEX, 0); } else { notty: printf("Warning: no access to tty; thus no job control in this shell...\n"); tpgrp = -1; } } } sigset(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) dohash(); if (loginsh) { int ldisc; srccat(value("home"), "/.login"); } } /* * 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"); close(SHIN); child++; goodbye(); } exitstat(); } untty() { if (tpgrp > 0) { setpgrp(0, opgrp); ioctl(FSHTTY, TIOCSPGRP, &opgrp); if (oldisc != -1 && oldisc != NTTYDISC) { printf("\nReverting to old tty driver...\n"); ioctl(FSHTTY, TIOCSETD, &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(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); /* ioctl(unit, FIOCLEX, NULL); */ xfree(ep); #ifdef INGRES srcunit(unit, 0); #else srcunit(unit, 1); #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) register int unit; bool onlyown; { /* 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; #ifdef TELL bool otell = cantell; #endif struct Bin saveB; /* The (few) real local variables */ jmp_buf oldexit; int reenter; if (unit < 0) return; if (didfd((s) donefds(); if (onlyown) { struct stat stb; if (fstat(unit, &stb) < 0 || (stb.st_uid != uid && stb.st_gid != getgid())) { 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) sighold(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; /* * Now if we are allowing commands to be interrupted, * we let ourselves be interrupted. */ if (setintr) sigrelse(SIGINT); #ifdef TELL settell(); #endif process(0); /* 0 -> blow away on errors */ } if (setintr) sigrelse(SIGINT); 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); close(SHIN), SHIN = oSHIN; arginp = oarginp, onelflg = oonelflg; evalp = oevalp, evalvec = oevalvec; intty = oldintty, whyles = oldwhyl, gointr = ogointr; #ifdef TELL cantell = otell; #endif } resexit(oldexit); /* * If process reset() (effectively an unwind) then * we must also unwind. */ if (reenter >= 2) error(NOSTR); } goodbye() { if (loginsh) { signal(SIGQUIT, SIG_IGN); sigset(SIGINT, SIG_IGN); signal(SIGTERM, SIG_IGN); setintr = 0; /* No interrupts after "logout" */ if (adrof("home")) srccat(value("home"), "/.logout"); } exitstat(); } exitstat() { /* * 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"))); } 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; if (setintr) { sigrelse(SIGINT); if (pjobs) { pjobs = 0; printf("\n"); dojobs(jobargv); bferr("Interrupted"); } } if (setintr) sighold(SIGINT); sigrelse(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; { register char *cp; jmp_buf osetexit; struct command *t; getexit(osetexit); for (;;) { pendjob(); paraml.next = paraml.prev = ¶ml; paraml.word = ""; t = 0; setexit(); justpr = 0; /* A chance to execute */ /* * Interruptible during interactive reads */ if (setintr) sigrelse(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 && 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) 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(); } 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) sighold(SIGINT); /* * Save input text on the history list if it * is from the terminal at the top level and not * in a loop. */ if (catch && intty && !whyles) savehist(¶ml); /* * Print lexical error messages. */ if (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; t++; f = globone(*t); u = dmove(open(f, 0), -1); xfree(f); if (u < 0) Perror(f); srcunit(u, 0); } /* * 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; 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; 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); strcpy(home, pp->pw_dir); return (0); } /* * Move the initial descriptors to their eventual * resting places, closin all other units. */ initdesc() { didcch = 0; /* Havent closed for child */ didfds = 0; /* 0, 1, 2 aren't set up */ SHIN = dcopy(0, FSHIN); SHOUT = dcopy(1, FSHOUT); SHDIAG = dcopy(2, FSHDIAG); OLDSTD = dcopy(SHIN, FOLDSTD); closem(); } exit(i) int i; { untty(); #ifdef PROF IEH3exit(i); #else _exit(i); #endif } passwd *pp = getpwnam(home); if (pp == 0) return (1); strcpy(home, pp->pw_dir); return (0); } /* * Move the initial descriptors to their eventual * resting places, closin all other units. */ initdesc() { didcch = 0; /* Havent closed for child */ didfds = 0; /* 0, 1, 2 aren't set up */ SHIN = dcopy(0, FSHIN); SHOUT = dcopy(1, FSHOUT); SHDIAG = dcopy(2, FSHDIAG); OLDSTD = dcopy(SHIN, FOLDSTD); closem(); } exit(i) int i; { untty(); #ifdef PROF IEH3exit(i); #else _exit(i); #endif }cmd/csh/sh.dir.c 444 0 33 15320 2420701200 6710 static char *sccsid = "@(#)sh.dir.c 4.1 10/9/80"; #include "sh.h" #include "sh.dir.h" /* * C Shell - directory management */ struct directory *dfind(); char *dfollow(); 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[BUFSIZ]; if (loginsh && hp) cp = hp; else cp = getwd(pa((th); 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 **cdp; struct varent *c; cp = globone(cp); if (chdir(cp) == 0) goto gotcha; if (cp[0] != '/' && !prefix("./", cp) && !prefix("../", cp) && (c = adrof("cdpath"))) { for (cdp = c->vec; *cdp; cdp++) { char buf[BUFSIZ]; strcpy(buf, *cdp); strcat(buf, "/"); strcat(buf, cp); if (chdir(buf) >= 0) { printd = 1; xfree(cp); cp = savestr(buf); goto gotcha; } } } if (adrof(cp)) { char *dp = value(cp); if (dp[0] == '/' || dp[0] == '.') if (chdir(dp) >= 0) { xfree(cp); cp = savestr(dp); printd = 1; goto gotcha; } } xfree(cp); Perror(cp); gotcha: if (*cp != '/') { char *dp = calloc(strlen(cp) + strlen(dcwd->di_name) + 2, 1); strcpy(dp, dcwd->di_name); strcat(dp, "/"); strcat(dp, cp); xfree(cp); cp = dp; } dcanon(cp); return (cp); } /* * 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) */ dcanon(cp) char *cp; { register char *p, *sp; register bool slash; if (*cp != '/') abort(); for (p = cp; *p; ) { /* for each component */ sp = p; /* save slash address */ while(*++p == '/') /* flush extra slashes */ ; if (p != ++sp) strcpy(sp, p); 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 (eq(".", sp)) { if (slash) { strcpy(sp, ++p); p = --sp; } else if (--sp != cp) *sp = '\0'; } else if (eq("..", sp)) { if (--sp != cp) while (*--sp != '/') ; if (slash) { strcpy(++sp, ++p); p = --sp; } else if (cp == sp) *++sp = '\0'; else *sp = '\0'; } else if (slash) *p = '/'; } } /* * 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); } strcpy(sp, ++p); p = --sp; } else if (--sp != cp) *sp = '\0'; } else if (eq("..", sp)) { if (--sp != cp) while (*--sp != '/') ; if (slash) { strcpy(++sp, ++p); p = --sp; } else if (cp == sp) *++sp = '\0'; else *sp = '\0'; } else if (slash) *p = cmd/csh/sh.dir.h 444 0 33 523 2420701203 6657 /* sh.dir.h 4.1 10/9/80 */ /* * 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 */ ile (*--sp != '/') ; if (slash) { strcpy(++sp, ++p); p = --sp; /,5< /,"cmd/csh/sh.dol.c 444 0 33 31606 2524675665 6753 static char *sccsid = "@(#)sh.dol.c 4.2 5/3/81"; #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 "scan(,&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 char *QUOTES = "\\'`\""; /* * 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 */ int Dtest(); /* Test for \ " ` or ' */ /* * Fix up the $ expansions and quotations in the * argument list to command t. */ Dfix(t) register struct command *t; { if (noexec) return; gflag = 0, rscan(t->t_dcom, Dtest); if (gflag == 0) return; Dfix2(t->t_dcom); blkfree(t->t_dcom), t->t_dcom = gargv, gargv = 0; } /* * $ 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 */ u((nDgetC(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 (any(c, " '`\"\t\n")) { unDgetC(c); if (any(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 (any(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, isset = 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 == '?') isset++, c = DgetC(0); /* $? tests existence */ switch (c) { case '$': if (dimen || isset) goto syntax; /* No $?$, $#$ */ setDolp(doldol); goto eatbrac; case '<'|QUOTE: if (dimen || isset) 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 '*': 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 (isset) { dolp = file ? "1" : "0"; goto eatbrac; } if (file == 0) error("No file for $0"); setDolp(file); goto eatbrac; } if (isset) 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 (isset) { 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->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 (' '); } Dtest(c) register int c; { /* Note that c isn't trimmed thus !...:q's aren't lost */ if (any(c, "$\\'`\"")) gflag = 1; } Dtestq(c) register int c; { if (any(c, "\\'`\"")) 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); close(0); if (open(shtemp, 2) < 0) { int oerrno = errno; unlink(shtemp); errno = oerrno; Perror(shtemp); } unlink(shtemp); /* 0 0 inode! */ Dv[0] = term; Dv[1] = NOSTR; gflag = 0; scan(Dv, trim); 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)) { write(0, obuf, BUFSIZ - ocnt); lseek(0, 0l, 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) { 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 b((roken 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) { write(0, obuf, BUFSIZ); obp = obuf; ocnt = BUFSIZ; } } *obp++ = '\n'; if (--ocnt == 0) { write(0, obuf, BUFSIZ); obp = obuf; ocnt = BUFSIZ; } } if (pargv) blkfree(pargv), pargv = 0; } } e of a command substitution will have been * discarded, but we put a newline after the last word * because this reprcmd/csh/sh.err.c 444 0 33 5270 2420701213 6711 static char *sccsid = "@(#)sh.err.c 4.1 10/9/80"; #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. */ 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; /* * Reset the state of the input. * This buffered seek to end of file will also * clear the while/foreach stack. */ btoeof(); /* * Go away if -e or we are a child shell */ if (exiterr || child) exit(1); setq("status", onev, &shvhed); if (tpgrp > 0) ioctl(FSHTTY, TIOCSPGRP, &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; 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); } r 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, dpcmd/csh/sh.exec.c 444 0 33 14020 2420701217 7062 static char *sccsid = "@(#)sh.exec.c 4.1 10/9/80"; #include "sh.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. */ char *exerr; /* Execution error message */ char *expath; /* Path for exerr */ /* * Xhash is an array of HSHSIZ chars, which are used to hash execs. * If it is allocated, then to tell whether ``name'' is (possibly) * present in the i'th component of the variable path, you look at * the i'th bit of xhash[hash("name")]. This is setup automatically * after .login is executed, and recomputed whenever ``path'' is * changed. */ int havhash; #define HSHSIZ 511 char xhash[HSHSIZ]; #ifdef VFORK int hits, misses; #endif /* 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, 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]; rscan(av, tglob); 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 scan(av, trim); xechoit(av); /* Echo command if -x */ closech(); /* Close random fd's */ /* * We must do this after any possible forking (like `foo` * in glob) so that this shell can still do subprocesses. */ sigsys(SIGCHLD, SIG_IGN); /* sigsys for vforks sake */ /* * 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 = xhash[hash(*av)]; i = 0; #ifdef VFORK hits++; #endif do { if (!slash && pv[0][0] == '/' && havhash && (hashval & (1 << (i % 8))) == 0) 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(av); pexerr(); } pexerr() { /* Couldn't find the damn thing */ setname(expath); /* xfree(expath); */ if (exerr) bferr(exerr); bferr("Command not found"); } /* Last resort shell */ char *lastsh[] = { SHELLPATH, 0 }; /* * 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; extern char *sys_errlist[]; 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; #ifdef OTHERSH if (ff != -1 && read(ff, &ch, 1) == 1 && ch != '#') vp[0] = OTHERSH; close(ff); #endif } else vp = v->vec; t[0] = f; t = blkspl(vp, t); /* Splice up the new arglst */ f = *t; execv(f, t); xfree((char *)t); /* The sky is falling, the sky is falling! */ case ENOMEM: Perror(f); case ENOENT: break; default: if (exerr == 0) { exerr = sys_errlist[errno]; expath = savestr(f); } } } execash(t, kp) register struct command *kp; { didcch++; signal(SIGINT, parintr); signal(SIGQUIT, parintr); 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), printf("\n"); haderr = 0; } } dohash() { struct stat stb; struct direct dirbuf[BUFSIZ / sizeof (struct direct)]; char d_name[DIRSIZ + 1]; register int dirf, cnt; int ((i = 0; struct varent *v = adrof("path"); char **pv; havhash = 1; for (cnt = 0; cnt < HSHSIZ; cnt++) xhash[cnt] = 0; if (v == 0) return; for (pv = v->vec; *pv; pv++, i = (i + 1) % 8) { if (pv[0][0] != '/') continue; dirf = open(*pv, 0); if (dirf < 0) continue; if (fstat(dirf, &stb) < 0 || !isdir(stb)) { close(dirf); continue; } while ((cnt = read(dirf, (char *) dirbuf, sizeof dirbuf)) >= sizeof dirbuf[0]) { register struct direct *ep = dirbuf; for (cnt /= sizeof(struct direct); cnt > 0; cnt--, ep++) { if (ep->d_ino == 0) continue; copdent(d_name, ep->d_name); xhash[hash(d_name)] |= (1 << i); } } close(dirf); } } dounhash() { havhash = 0; } #ifdef VFORK hashstat() { if (hits+misses) printf("%d hits, %d misses, %2d%%\n", hits, misses, 100 * hits / (hits + misses)); } #endif hash(cp) register char *cp; { register long hash = 0; int retval; while (*cp) hash += hash + *cp++; if (hash < 0) hash = -hash; retval = hash % HSHSIZ; return (retval); } > 0; cnt--, ep++) { if (ep->d_ino == 0) continue; copdent(d_name, ep->d_name); xhash[hash(d_name)] |= (1 << i); } } close(dirf); } } dounhash() { havhash = 0; } #ifdef VFORK hashstat() { if (hits+misses) printf("%d hits, %d misses, %2d%%\n", hits, misses, 100 * hits / (hits + misses)); } #endif hash(cp) register char *cp; { register long hash = 0; int retval; while (*cp) hash += hash + *cp++; if (hash < 0) hash = -hash; retval = hash % HSHSIZ; retcmd/csh/sh.exp.c 444 0 33 21562 2420701223 6740 static char *sccsid = "@(#)sh.exp.c 4.1 10/9/80"; #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 (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 ? 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) && any(cp[0], "+-")) return (1); if ((what & MULO((P) && any(cp[0], "*/%")) return (1); if ((what & RESTOP) && any(cp[0], "()!~^")) return (1); } if ((what & RESTOP) && (any(cp[0], "|&") || eq(cp, "<<") || eq(cp, ">>"))) return (1); if (what & EQOP) { if (eq(cp, "==")) return (EQEQ); if (eq(cp, "!=")) return (NOTEQ); if (eq(cp, "=~")) return (EQMATCH); if (eq(cp, "!~")) return (NOTEQMATCH); } if (!(what & RELOP)) return (0); 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 TCH); } if (!(what & RELOP)) return (0); if (*cp == '<') return (LSS); if (*cp == '>') return (GTR); return (0); } egetn(cp) regicmd/csh/sh.func.c 444 0 33 41072 2544220750 7105 static char *sccsid = "@(#)sh.func.c 4.5 81/06/19"; #include "sh.h" #include /* * C shell */ struct biltins * isbfunc(t) register struct command *t; { register char *cp = t->t_dcom[0]; register char *dp; register struct biltins *bp; 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); } for (bp = bfunc; dp = bp->bname; bp++) { if (dp[0] == cp[0] && eq(dp, cp)) return (bp); if (dp[0] > cp[0]) break; } 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) sighold(SIGINT); else sigset(SIGINT, SIG_DFL); gointr = 0; } else if (eq((vv = strip(vv)), "-")) { sigset(SIGINT, SIG_IGN); gointr = "-"; } else { gointr = savestr(vv); sigset(SIGINT, pintr); } } donohup() { if (intty) bferr("Can't from terminal"); if (setintr == 0) { 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(); signal(SIGTERM, parterm); execl("/bin/login", "login", v[1], 0); untty(); exit(1); } donewgrp(v) char **v; { if (chkstop == 0 && setintr) panystop(0); signal(SIGTERM, parterm); execl("/bin/newgrp", "newgrp", v[1], 0); execl("/usr/bin/newgrp", "newgrp", v[1], 0); untty(); exit(1); } 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) 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, rscan(v, tglob); 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) sigrelse(SIGINT); search(ZBREAK, 0); if (setintr) sighold(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; i = getn(v[1]); if (setintr) sighold(SIGINT); lshift(v, 2); while (i > 0) { if (setintr) sigrelse(SIGINT); reexecute(kp); --i; } donefds(); if (setintr) sigrelse(SIGINT); } doswbrk() { search(ZBRKSW, 0); } srchx(cp) register char *cp; { register struct srch *sp; for (sp = srchn; sp->s_name; sp++) if (eq(cp, sp->s_name)) return (sp->s_value); 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(0l); do { if (intty && fseekp == feobp) printf("? "), flush(); aword[0] = 0, 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[s((trlen(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; 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; } 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 (any(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) sigrelse(SIGINT); v++; if (*v == 0) return; gflag = 0; rscan(v, tglob); if (gflag) { v = glob(v); if (v == 0) bferr("No match"); } else scan(v, trim); if (sep == ' ' && !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) sighold(SIGINT); if (gargv) blkfree(gargv), gargv = 0; } char **environ; dosetenv(v) register char **v; { char *lp = globone(v[2]); setenv(v[1], lp); if (eq(v[1], "PATH")) { importpath(lp); dohash(); } xfree(lp); } dounsetenv(v) register char **v; { v++; do unsetenv(*v++); while (*v); } setenv(name, value) char *name, *value; { 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("=", value); xfree(*ep); *ep = strspl(name, cp); xfree(cp); scan(ep, trim); return; } blk[0] = strspl(name, "="); blk[1] = 0; environ = blkspl(environ, blk); xfree((char *)oep); setenv(name, value); } 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); 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"); umask(i); } #include struct limits { int limconst; char *limname; int limdiv; char *limscale; } limits[] = { LIM_NORAISE, "noraise", 1, "", LIM_CPU, "cputime", 1, "seconds", LIM_FSIZE, "filesize", 1024, "kbytes", LIM_DATA, "datasize", 1024, "kbytes", LIM_STACK, "stacksize", 1024, "kbytes", LIM_CORE, "coredumpsize", 1024, "kbytes", LIM_MAXRSS, "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"); } dolimit(v) register char **v; { register struct limits *lp; register int limit; v++; if (*v == 0) { for (lp = limits+1; lp->limconst >= 0; lp++) plim(lp); if (vlimit(LIM_NORAISE, -1) && getuid()) printf("Limits cannot be raised\n"); return; } lp = findlim(v[0]); if (v[1] == 0) { plim(lp); return; } limit = getval(lp, v+1); setlim(lp, limit); } 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 ((int)(f+0.5) * lp->limdiv); cp = *v; } if (lp->limconst == LIM_NORAISE) goto badscal; switch (*cp) { case ':': if (lp->limconst != LIM_CPU) goto badscal; return ((int)(f * 60.0 + atof(cp+1))); case 'h': if (lp->limconst != LIM_CPU) goto badscal; limtail(cp, "hours"); f *= 3600.; break; case 'm': if (lp->limconst == LIM_CPU) { limtail(cp, "minutes"); f *= 60.; break; } case 'M': if (lp->limconst == LIM_CPU) goto badscal; *cp = 'm'; limtail(cp, "megabytes"); f *= 1024.*1024.; break; case 's': if (lp->limconst != LIM_CPU) goto badscal; limtail(cp, "seconds"); break; case 'k': if (lp->limconst == LIM_CPU) goto badscal; limtail(cp, "kbytes"); f *= 1024; break; case 'u': limtail(cp, "unlimited"); return (INFINITY); default: badscal: bferr("Improper or unknown scale factor"); } return ((int)(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) register struct limits *lp; { register int lim; printf("%s \t", lp->limname); lim = vlimit(lp->limconst, -1); if (lim == INFINITY) printf("unlimited"); else if (lp->limconst == LIM_CPU) psecs((long)lim); else printf("%d %s", lim / lp->limdiv, lp->limscale); printf("\n"); } dounlimit(v) register char **v; { register struct limits *lp; v++; if (*v == 0) { for (lp = limits+1; lp->limconst >= 0; lp++) setlim(lp, INFINITY); return; } while (*v) { lp = findlim(*v++); setlim(lp, INFINITY); } } setlim(lp, limit) register struct limits *lp; { if (vlimit(lp->limconst, limit) < 0) Perror(bname); } dosuspend() { int old, ldisc; short ctpgrp; if (loginsh) error("Can't suspend a login shell (yet)"); untty(); old = sigsys(SIGTSTP, SIG_DFL); kill(0, SIGTSTP); /* the shell stops here */ sigsys(SIGTSTP, old); if (tpgrp != -1) { retry: ioctl(FSHTTY, TIOCGPGRP, &ctpgrp); if (ctpgrp != opgrp) { old = sigsys(SIGTTIN, SIG_DFL); kill(0, SIGTTIN); sigsys(SIGTTIN, old); goto retry; } ioctl(FSHTTY, TIOCSPGRP, &shpgrp); setpgrp(0, shpgrp); } ioctl(FSHTTY, TIOCGETD, &oldisc); if (oldisc != NTTYDISC) { printf("Switching to new tty driver...\n"); ldisc = NTTYDISC; ioctl(FSHTTY, TIOCSETD, &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; rscan(v, tglob); if (gflag) { gv = v = glob(v); gargv = 0; if (v == 0) error("No match"); v = copyblk(v); } else scan(v, trim); 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); } ar *oevalp = evalp; jmp_buf osetexit; int reenter; char **gv = 0; v++; if (*v == 0) return; gflag = 0; rscan(v, tglob); if (gflag) { gv = v = glob(v); gargv = 0; if (v == 0) error("No match"); v = copyblk(v); } else scan(v, trim); 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);cmd/csh/sh.glob.c 444 0 33 27672 2503316150 7102 static char *sccsid = "@(#)sh.glob.c 4.2 3/11/81"; #include "sh.h" /* * C Shell */ int globcnt; char *globchars = "`{[*?"; char *gpath, *gpathp, *lastgpathp; int globbed; bool noglob; bool nonomatch; char *entp; char **sortbas; 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 dobackp(as, 0); #ifdef GDEBUG printf("backp done, acollect'ing\n"); #endif for (i = 0; i < pargc; i++) if (noglob) Gcat(pargv[i], ""); 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(); } sort() { register char **p1, **p2, *c; char **Gvp = &gargv[gargc]; p1 = sortbas; while (p1 < Gvp-1) { p2 = p1; while (++p2 < Gvp) if (strcmp(*p1, *p2) > 0) c = *p1, *p1 = *p2, *p2 = c; p1++; } sortbas = Gvp; } 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); strcpy(gpath, gpath + 1); } else strcpy(gpath, value("home")); gpathp = strend(gpath); } } while (!any(*cs, globchars)) { 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 == '{') { execbrc(cs, NOSTR); return; } matchdir(cs); endit: gpathp = sgpathp; *gpathp = 0; } matchdir(pattern) char *pattern; { struct stat stb; struct direct dirbuf[BUFSIZ / sizeof (struct direct)]; char d_name[DIRSIZ+1]; register int dirf, cnt; dirf = open(gpath, 0); if (dirf < 0) { if (globbed) return; goto patherr; } if (fstat(dirf, &stb) < 0) goto patherr; if (!isdir(stb)) { errno = ENOTDIR; goto patherr; } while ((cnt = read(dirf, (char *) dirbuf, sizeof dirbuf)) >= sizeof dirbuf[0]) { register struct direct *ep = dirbuf; for (cnt /= sizeof (struct direct); cnt > 0; cnt--, ep++) { if (ep->d_ino == 0) continue; copdent(d_name, ep->d_name); if (match(d_name, pattern)) { Gcat(gpath, d_name); globcnt++; } } } close(dirf); return; patherr: Perror(gpath); } copdent(to, from) register char *to, *from; { register int cnt = DIRSIZ; do *to++ = *from++; while (--cnt); *to = 0; } 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; strcpy(lm, pl); 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 != 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 && isdir(stb)) 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) register char *s1, *s2; { gnleft -= strlen(s1) + strlen(s2) + 1; if (gnleft <= 0 || ++gargc >= GAVSIZ) error("Arguments too long"); gargv[gargc] = 0; gargv[gargc - 1] = strspl(s1, s2); } addpath(c) char c; { if (gpathp >= lastgpathp) error("Pathname too long"); *gpathp++ = c; *gpathp = 0; } rscan(t, f) register char **t; int (*f)(); { register char *p, c; while (p = *t++) { if (f == tglob) if (*p == '~') gflag |= 2; else if (eq(p, "{") || eq(p, "{}")) continue; while (c = *p++) (*f)(c); } } scan(t, f) register char **t; int (*f)(); { register char *p, c; while (p = *t++) while (c = *p) *p++ = (*f)(c); } tglob(c) register char c; { if (any(c, globchars)) gflag |= c == '{' ? 2 : 1; return (c); } trim(c) char c; { return (c & TRIM); } tback(c) char c; { if (c == '`') gflag = 1; } char * globone(str) register char *str; { char *gv[2]; register char **gvp; register char *cp; gv[0] = str; gv[1] = 0; gflag = 0; rscan(gv, tglob); 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 { scan(gv, trim); 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; close(pvec[0]); dmove(pvec[1], 1); dmove(SHDIAG, 2); initdesc(); arginp = cp; while (*cp) *cp++ &= TRIM; lex(¶ml); if (err) error(err); alias(¶ml); t = syntax(paraml.next, ¶ml, 0); if (err) error(err); if (t) t->t_dflg |= FPAR; execute(t, -1); exitstat(); } xfree(cp); 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 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; } 0; } while (c >= 0); #ifdef GDEBUG printf("done in backeval, pvec: cmd/csh/sh.h 444 0 33 27352 2420701264 6162 /* sh.h 4.1 10/9/80 */ #include "sh.local.h" #ifdef VMUNIX #include #endif /* * C shell * * Bill Joy, UC Berkeley * October, 1978; May 1980 * * Jim Kulp, IIASA, Laxenburg Austria * April, 1980 */ #include #include #include #define isdir(d) ((d.st_mode & S_IFMT) == S_IFDIR) #include #include #include #include typedef char bool; #define eq(a, b) (strcmp(a, b) == 0) /* * Global flags */ bool chkstop; /* Warned of stopped jobs... allow exit */ bool didcch; /* Have closed unused fd's for child */ 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 */ /* * 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 */ time_t time0; /* Time at which the shell started */ /* * Miscellany */ char *doldol; /* Character pid for $$ */ int uid; /* Invokers uid */ time_t chktim; /* Time mail last checked */ short shpgrp; /* Pgrp of shell */ short tpgrp; /* Terminal process group */ /* If tpgrp is -1, leave tty alone! */ short opgrp; /* Initial pgrp and tty pgrp */ int oldisc; /* Initial line discipline or -1 */ struct tms shtimes; /* shell and child times for process timing */ /* * 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[]; #define INF 1000 struct srch { char *s_name; short s_value; } srchn[]; /* * 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() setjmp(reslab) #define reset() longjmp(reslab) /* 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 off_t btell(); /* * 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 off_t 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. */ #ifdef VMUNIX char labuf[BUFSIZ]; #else char labuf[256]; #endif 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 * * Lists of aliases and variables are sorted alp((habetically by name */ struct varent { char **vec; /* Array of words which is the value */ char *name; /* Name of variable/alias */ struct varent *link; } shvhed, aliases; /* * 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. */ #define GAVSIZ NCARGS / 6 /* * 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 */ char *Dfix1(); struct varent *adrof(), *adrof1(); char **blkcat(); char **blkcpy(); char **blkend(); char **blkspl(); char *calloc(); 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 *globone(); struct biltins *isbfunc(); char **glob(); char *operate(); int pintr(); int pchild(); char *putn(); 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(); int tglob(); int trim(); char *value(), *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 #ifdef VMUNIX struct vtimes zvms; #endif char **evalvec; char *evalp; struct mesg { char *iname; /* name from /usr/include */ char *pname; /* print name */ } mesg[]; yn1b(); struct command *syn2(); struct command *syn3(); int tglob(); int trim(); char *value(), *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 = cmd/csh/sh.hist.c 444 0 33 3403 2420701274 7073 static char *sccsid = "@(#)sh.hist.c 4.1 10/9/80"; #include "sh.h" /* * C shell */ savehist(sp) struct wordent *sp; { register struct Hist *hp, *np; int histlen; register char *cp; cp = value("history"); if (*cp == 0) histlen = 0; else { while (*cp && digit(*cp)) cp++; /* avoid a looping snafu */ if (*cp) set("history", "10"); histlen = getn(value("history")); } /* throw away null lines */ if (sp->next->word[0] == '\n') return; for (hp = &Histlist; np = hp->Hnext;) if (eventno - np->Href >= histlen || histlen == 0) hp->Hnext = np->Hnext, hfree(np); else hp = np; 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 *) calloc(1, 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; if (getn(value("history")) == 0) return; if (setintr) sigrelse(SIGINT); vp++; if (*vp && eq(*vp, "-r")) { rflg++; vp++; } if (*vp) n = getn(*vp); else n = 1000; dohist1(Histlist.Hnext, &n, rflg); } dohist1(hp, np, rflg) struct Hist *hp; int *np; { bool print = (*np) > 0; top: if (hp == 0) return; (*np)--; hp->Href++; if (rflg == 0) { dohist1(hp->Hnext, np, rflg); if (print) phist(hp); return; } if (*np >= 0) phist(hp); hp = hp->Hnext; goto top; } phist(hp) register struct Hist *hp; { printf("%6d\t", hp->Hnum); prlex(&hp->Hlex); } T); vp++; if (*vp && eq(*vp, "-r")) { rflg++; vp++; } if (*vp) n = getn(*vp); else n = 1000; dohist1(Histlist.Hnext, &n, rflg); } dohist1(hp, np, rflg) struct Hist *hp; int *np; { bool print = (*np) > 0; top: if (hp == 0) return; (cmd/csh/sh.init.c 444 0 33 11061 2420701303 7077 static char *sccsid = "@(#)sh.init.c 4.1 10/9/80"; #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(); extern int dolimit(); extern int dologin(); extern int dologout(); extern int donewgrp(); 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(); extern int dounlimit(); extern int doumask(); extern int dowait(); extern int dowhile(); 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, #ifdef debug "alloc", showall, 0, 1, #endif "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, "limit", dolimit, 0, 3, "login", dologin, 0, 1, "logout", dologout, 0, 0, "newgrp", donewgrp, 1, 1, "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, 2, 2, "shift", shift, 0, 1, "source", dosource, 1, 1, "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, "unlimit", dounlimit, 0, INF, "unset", unset, 1, INF, "unsetenv", dounsetenv, 1, INF, "wait", dowait, 0, 0, "while", dowhile, 1, INF, 0, 0, 0, 0, }; #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, 0, 0, }; 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", 0, "Signal 16", "STOP", "Stopped (signal)", "TSTP", "Stopped", "CONT", "Continued", "CHLD", "Child exited", "TTIN", "Stopped (tty input)", "TTOU", "Stopped (tty output)", "TINT", "Tty input interrupt", "XCPU", "Cputime limit exceeded", "XFSZ", "Filesize limit exceeded", 0, "Signal 26", 0, "Signal 27", 0, "Signal 28", 0, "Signal 29", 0, "Signal 30", 0, "Signal 31", 0, "Signal 32" }; ion fault", "SYS", "Bad system call", "PIPE", "Broken pipe", "ALRM", "Alarm clock", "TERM", "Terminated", 0, "Signal 16", "STOP", "Stopped (signal)", "TSTP", "Stopped", "CONT", "Continued", "CHLD", "Child exited", "TTIN", "Stopped (tty input)", "TTOU", "Stopped (tty output)", "TINT", "Tty input interrupt", "XCPU", "Cputime limit exceeded", "XFSZ", "Filesize limit exceeded", 0, "Signal 26", 0, "Signal 27", 0, "Signal 28", 0, "Signal 29", 0, cmd/csh/sh.lex.c 444 0 33 50446 2420701314 6740 static char *sccsid = "@(#)sh.lex.c 4.1 10/9/80"; #include "sh.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. */ 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; #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 *) calloc(1, sizeof *wdp); 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; printf(" "); } } copylex(hp, fp) register struct wordent *hp; struct wordent *fp; { register struct wordent *wdp; wdp = hp; fp = fp->next; do { register struct wordent *new = (struct wordent *) calloc(1, 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 *WORDMETA = "# '`\"\t;&<>()|\n"; char * word() { register char c, c1; register char *wp; char wbuf[BUFSIZ]; register bool dolflg; register int i; wp = wbuf; i = BUFSIZ - 4; loop: c = getC(DOALL); switch (c) { case ' ': case '\t': goto loop; case '`': case '\'': case '"': *wp++ = c, --i, c1 = c; dolflg = c == '"' ? DOALL : DOEXCL; for (;;) { c = getC(dolflg); if (c == c1) break; if (c == '\n') { seterrc("Unmatched ", c1); ungetC(c); goto ret; } if (c == '\\') { c = getC(0); if (c == HIST) c |= QUOTE; else { if (c == '\n' && c1 != '`') c |= QUOTE; ungetC(c), c = '\\'; } } if (--i <= 0) goto toochars; *wp++ = c; } *wp++ = c, --i; goto pack; case '&': case '|': case '<': case '>': *wp++ = c; c1 = getC(DOALL); if (c1 == c) *wp++ = c1; else ungetC(c1); goto ret; case '#': if (intty) break; if (wp != wbuf) { ungetC(c); goto ret; } 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; casebksl: case '\\': c = getC(0); if (c == '\n') { if (onelflg == 1) onelflg = 2; goto loop; } if (c != HIST) *wp++ = '\\', --i; c |= QUOTE; break; } ungetC(c); pack: for (;;) { c = getC(DOALL); if (c == '\\') { c = getC(0); if (c == '\n') { if (onelflg == 1) onelflg = 2; goto ret; } if (c != HIST) *wp++ = '\\', --i; c |= QUOTE; } if (any(c, WORDMETA + intty)) { ungetC(c); if (any(c, "\"'`")) goto loop; goto ret; } if (--i <= 0) goto toochars; *wp++ = c; } toochars: seterr("Word too long"); wp = &wbuf[1]; ret: *wp = 0; return (savestr(wbuf)); } getC(flag) register int flag; { register char c; top: if (c = peekc) { peekc = 0; return (c); } if (lap) { c = *lap++; if (c == 0) { lap = 0; goto top; } if (any(c, WORDMETA + intty)) 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) strcpy(buf, lap); strcpy(labuf, cp); if (lap) 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 = do((l; 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; } 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); goto bads; } 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; 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; 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; } 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 '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; strcat(wp, lhsb); wp = strend(wp); continue; } mp += strlen(lhsb); i -= strlen(mp); if (i < 0) { ovflo: seterr("Subst buf ovflo"); return (""); } *wp = 0; 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)) /* what if :h :t are both the same? */ return (0); wp = strend(cp); while (*--wp != '/') continue; if (type == 'h') take: 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) if (matchev(hp, cp, anyarg)) return (hp); noev(cp); return (0); } noev(cp) char *cp; { seterr2(cp, ": Event not found"); } matchev(hp, cp, anyarg) register struct Hist *hp; char *cp; bool anyarg; { register char *dp; struct wordent *lp = &hp->Hlex; int argno = 0; for (;;) { lp = lp->next; if (lp->word[0] == '\n') return (0); for (dp = lp->word; *dp; dp++) { if (matchs(dp, cp)) { if (anyarg) quesarg = argno; return (1); } if (!anyarg) return (0); } argno++; } } setexclp(cp) register char *cp; { if (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) { #include struct sgttyb tty; if (wanteof) return (-1); /* was isatty but raw with ignoreeof yields problems */ if (ioctl(SHIN, TIOCGETP, &tty)==0 && (tty.sg_flags & RAW) == 0) { short ctpgrp; if (++sincereal > 25) goto oops; if (tpgrp != -1 && ioctl(FSHTTY, TIOCGPGRP, &ctpgrp) == 0 && tpgrp != ctpgrp) { ioctl(FSHTTY, TIOCSPGRP, &tpgrp); 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 TELL if (cantell) { if (fseekp < fbobp || fseekp > feobp) { fbobp = feobp = fseekp; 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); } #endif again: buf = (int) fseekp / BUFSIZ; if (buf >= fblocks) { register char **nfbuf = (char **) calloc(fblocks+2, sizeof (char **)); if (fbuf) { 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; do c = read(SHIN, fbuf[buf] + off, BUFSIZ - off); while (c < 0 && errno == EINTR); if (c <= 0) return (-1); feobp += c; goto again; } c = fbuf[buf][(int) fseekp % BUFSIZ]; fseekp++; return (c); } 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]); blkcpy(fbuf, &fbuf[sb]); fseekp -= BUFSIZ * sb; feobp -= BUFSIZ * sb; fblocks -= sb; } } bseek(l) long 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 */ long btell() { return (fseekp); } btoeof() { lseek(SHIN, 0l, 2); fseekp = feobp; wfree(); bfree(); } #ifdef TELL settell() { cantell = 0; if (arginp || onelflg || intty) return; if (lseek(SHIN, 0l, 1) < 0 || errno == ESPIPE) return; fbuf = (char **) calloc(2, sizeof (char **)); fblocks = 1; fbuf[0] = calloc(BUFSIZ, sizeof (char)); fseekp = fbobp = feobp = tell(SHIN); cantell = 1; } #endif wp->w_start; #ifdef TELL } #endif } /* any similarity to bell telephone is purely accidental */ long btell() { return (fseekp); } btoeof() { lseek(SHIN, 0l, 2); fseekp = feobp; wfree(); bfree(); } #ifdef TELcmd/csh/sh.local.h 444 0 33 3137 2420701317 7225 /* sh.local.h 4.1 10/9/80 */ /* * 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 * HZ Cycle of ac power * OTHERSH Shell for scripts which don't start with # */ #define BUFSIZ 512 /* default buffer size */ #define HZ 60 /* for division into seconds */ #define SHELLPATH "/bin/csh" #define OTHERSH "/bin/sh" #define FORKSLEEP 10 /* delay loop on non-interactive fork failure */ #define MAILINTVL 600 /* 10 minutes */ /* * NCARGS and NOFILE are from which we choose not * to wholly include */ #define NCARGS 10240 /* Max. chars in an argument list */ /* * 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. If possible they should go into descriptors closed by exec. */ #define NOFILE 20 /* Max number of open files */ #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 */ #define V7 #ifdef IIASA #undef HZ #define HZ 60 #undef OTHERSH #endif #ifdef VMUNIX #include #undef BUFSIZ #define BUFSIZ BSIZE #endif mmands. If possible they should go into descriptors closed by exec. */ #define NOFILE 20 /* Max number of open files */ #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 */ #define V7 #ifdef IIASA #undef HZ #define HZ 60 #undcmd/csh/sh.misc.c 444 0 33 11312 2420701322 7067 static char *sccsid = "@(#)sh.misc.c 4.1 10/9/80"; #include "sh.h" /* * C Shell */ letter(c) register char c; { return (c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c == '_'); } digit(c) register char c; { return (c >= '0' && c <= '9'); } alnum(c) register char c; { return (letter(c) || digit(c)); } any(c, s) register int c; register char *s; { while (*s) if (*s++ == c) return(1); return(0); } char * calloc(i, j) register unsigned i; unsigned j; { register char *cp, *dp; #ifdef debug static char *av[2] = {0, 0}; #endif i *= j; cp = (char *) malloc(i); if (cp == 0) { child++; #ifndef debug error("Out of memory"); #else showall(av); printf("i=%d, j=%d: ", i/j, j); printf("Out of memory\n"); chdir("/usr/bill/cshcore"); abort(); #endif } dp = cp; if (i != 0) do *dp++ = 0; while (--i); return (cp); } cfree(p) char *p; { free(p); } 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; { blkcpy(blkend(up), vp); return (up); } blkfree(av0) char **av0; { register char **av = av0; while (*av) xfree(*av++); xfree((char *)av0); } char ** saveblk(v) register char **v; { register int len = blklen(v) + 1; register char **newv = (char **) calloc(len, sizeof (char **)); char **onewv = newv; while (*v) *newv++ = savestr(*v++); return (onewv); } char * strspl(cp, dp) register char *cp, *dp; { register char *ep = calloc(1, strlen(cp) + strlen(dp) + 1); strcpy(ep, cp); strcat(ep, dp); return (ep); } char ** blkspl(up, vp) register char **up, **vp; { register char **wp = (char **) calloc(blklen(up) + blklen(vp) + 1, sizeof (char **)); 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) close(f); } /* * 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! */ closech() { register int f; if (didcch) return; didcch = 1; SHIN = 0; SHOUT = 1; SHDIAG = 2; OLDSTD = 0; for (f = 3; f < NOFILE; f++) close(f); } donefds() { close(0), close(1), 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); #ifdef V7 if (j >= 0) { dup2(i, j); return (j); } else #endif j = dcopy(i, j); if (j != i) close(i); return (j); } dcopy(i, j) register int i, j; { if (i == j || i < 0 || j < 0 && i > 2) return (i); #ifdef V7 if (j >= 0) { dup2(i, j); return (j); } #endif 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); close(k); return (j); } return (k); } copy(to, from, size) register char *to, *from; register int size; { if (size) 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". */ lshift(v, c) register char **v; register int c; { register char **u = v; while (*u && --c >= 0) xfree(*u++); 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(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); } } (char **) calloc(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)cmd/csh/sh.parse.c 444 0 33 23571 2420701327 7265 static char *sccsid = "@(#)sh.parse.c 4.1 10/9/80"; #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) { 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(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 redi((rect"); 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); } seterr("Invalid null command"); t->t_dtyp = TCOM; } return (t); } freesyn(t) register struct command *t; { register char **v; cmd/csh/sh.print.c 444 0 33 3010 2420701333 7246 static char *sccsid = "@(#)sh.print.c 4.1 10/9/80"; #include "sh.h" /* * C Shell */ p60ths(l) long l; { l += 3; printf("%d.%d", (int) (l / 60), (int) ((l % 60) / 6)); } 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 = 0; #include if (linp == linbuf) return; if (haderr) unit = didfds ? 2 : SHDIAG; else unit = didfds ? 1 : SHOUT; #ifdef TIOCLGET if (didfds==0 && ioctl(unit, TIOCLGET, &lmode)==0 && lmode & LFLUSHO) { lmode = LFLUSHO; ioctl(unit, TIOCLBIC, &lmode); write(unit, "\n", 1); } #endif write(unit, linbuf, linp - linbuf); linp = linbuf; } plist(vp) register struct varent *vp; { if (setintr) sigrelse(SIGINT); for (vp = vp->link; vp != 0; vp = vp->link) { int len = blklen(vp->vec); printf(vp->name); printf("\t"); if (len != 1) putchar('('); blkpr(vp->vec); if (len != 1) putchar(')'); printf("\n"); } if (setintr) sigrelse(SIGINT); } ET, &lmode)==0 && lmode & LFLUSHO) { lmode = LFLUSHO; ioctl(unit, TIOCLBIC, &lmode); write(unit, "\n", 1); } #endif write(unit, linbuf, linp - linbuf); linp = linbuf; } plist(vp) register struct varent *vp; { if (setintr) sigrelse(SIGINT); for (vp = vp->link; vp != 0; vp = vp->link) { int len = blklen(vp->vec); printf(vp->name); printf("\t"); if (len != 1) putchar('('); blkpr(vp->vec); if (len != 1) putchar(')'); printf("\n"); } if (setintr) sigrelse(SIGcmd/csh/sh.proc.c 444 0 33 54772 2524675752 7146 static char *sccsid = "@(#)sh.proc.c 4.6 (Berkeley) 81/05/03"; #include "sh.h" #include "sh.dir.h" #include "sh.proc.h" #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; #ifdef VMUNIX struct vtimes vt; #endif if (!timesdone) timesdone++, times(&shtimes); loop: pid = wait3(&w.w_status, (setintr ? WNOHANG|WUNTRACED:WNOHANG), #ifndef VMUNIX 0); #else &vt); #endif 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")) { time_t oldcutimes, oldcstimes; oldcutimes = shtimes.tms_cutime; oldcstimes = shtimes.tms_cstime; time(&pp->p_etime); times(&shtimes); pp->p_utime = shtimes.tms_cutime - oldcutimes; pp->p_stime = shtimes.tms_cstime - oldcstimes; } else times(&shtimes); #ifdef VMUNIX pp->p_vtimes = vt; #endif 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; #ifdef IIASA if (pp->p_reason >= 3) #else if (pp->p_reason != 0) #endif 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_utime + fp->p_stime) / HZ >= 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"); 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; neednote = 0; for (pp = proclist.p_next; pp != PNULL; pp = pp->p_next) { if (pp->p_flags & PNEEDNOTE) { sighold(SIGCHLD); pp->p_flags &= ~PNEEDNOTE; flags = pprint(pp, NUMBER|NAME|REASON); if ((flags&(PRUNNING|PSTOPPED)) == 0) pflush(pp); sigrelse(SIGCHLD); } } } /* * pwait - wait for current job to terminate, maintaining integrity * of current and previous job indicators. */ pwait() { register struct process *fp, *pp; /* * Here's where dead procs get flushed. */ sighold(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; } sigrelse(SIGCHLD); if (setintr) sigignore(SIGINT); 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; 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; for (;;) { sighold(SIGCHLD); jobflags = 0; do jobflags |= fp->p_flags; while((fp = (fp->p_friends)) != pp); if ((jobflags & PRUNNING) == 0) break; sigpause(SIGCHLD); } sigrelse(SIGCHLD); if (tpgrp > 0) ioctl(FSHTTY, TIOCSPGRP, &tpgrp); /* get tty back */ if ((jobflags&(PSIGNALED|PSTOPPED|PTIME)) || !eq(dcwd->di_name, fp->p_cwd->di_name)) { if (jobflags&PSTOPPED) printf("\n"); 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; pjobs++; if (setintr) sigrelse(SIGINT); loop: sighold(SIGCHLD); 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(SIGCHLD); goto loop; } sigr((else(SIGCHLD); 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; time(&pp->p_btime); } 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 TFIL: padd(t->t_dcar); pads(" | "); padd(t->t_dcdr); return; case TLST: padd(t->t_dcar); pads("; "); 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) { strcpy(cmdp, " ..."); cmdlen = PMAXLEN; cmdp += 4; return; } 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 || 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"); #ifndef VMUNIX ptimes(pp->p_utime, pp->p_stime, pp->p_etime-pp->p_btime); #else pvtimes(&zvms, &pp->p_vtimes, pp->p_etime - pp->p_btime); #endif } 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; { time_t tetime = 0; #ifdef VMUNIX struct vtimes vmt; #else time_t tutime = 0, tstime = 0; #endif register struct process *pp = tp; vmt = zvms; do { #ifdef VMUNIX vmsadd(&vmt, &pp->p_vtimes); #else tutime += pp->p_utime; tstime += pp->p_stime; #endif if (pp->p_etime - pp->p_btime > tetime) tetime = pp->p_etime - pp->p_btime; } while ((pp = pp->p_friends) != tp); #ifdef VMUNIX pvtimes(&zvms, &vmt, tetime); #else ptimes(tutime, tstime, tetime); #endif } /* * 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); if (setintr) sigignore(SIGINT); 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); if (setintr) sigignore(SIGINT); 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) printf("\n"); } printf("\n"); return; } if (digit(v[0][1])) { signum = atoi(v[0]+1); if (signum < 1 || 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; extern char *sys_errlist[]; int err = 0; if (setintr) sighold(SIGINT); sighold(SIGCHLD); while (*v) { if (**v == '%') { np = pp = pfind(*v); 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", *v); err++; goto cont; } } killpg(pp->p_jobid, signum); if (signum == SIGTERM || signum == SIGHUP) killpg(pp->p_jobid, SIGCONT); } else if (!digit(**v)) bferr("Arguments should be jobs or process id's"); else { pid = atoi(*v); if (kill(pid, signum) < 0) { printf("%d: ", pid); printf("%s\n", sys_errlist[errno]); err++; goto cont; } if (signum == SIGTERM || signum == SIGHUP) kill(pid, SIGCONT); } cont: v++; } sigrelse(SIGCHLD); if (setintr) sigrelse(SIGINT); 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; sighold(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); pprint(pp, foregnd ? NAME|JOBDIR : NUMBER|NAME|AMPERSAND); if (foregnd) ioctl(FSHTTY, TIOCSPGRP, &pp->p_jobid); if (jobflags&PSTOPPED) killpg(pp->p_jobid, SIGCONT); sigrelse(SIGCHLD); } 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"); } /* * 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; /* * 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. */ sighold(SIGCHLD); while ((pid = fork()) < 0) if (setintr == 0) sleep(FORKSLEEP); else { sigrelse(SIGINT); sigrelse(SIGCHLD); error("No more processes"); } if (pid == 0) { settimes(); pgrp = pcurrjob ? pcurrjob->p_jobid : getpid(); pflushall(); pcurrjob = PNULL; timesdone = 0; child++; if (setintr) { setintr = 0; /* until I think otherwise */ sigrelse(SIGCHLD); /* * Children just get blown away on SIGINT, SIGQUIT * unless "onintr -" seen. */ signal(SIGINT, ignint ? SIG_IGN : SIG_DFL); signal(SIGQUIT, ignint ? SIG_IGN : SIG_DFL); if (wanttty >= 0) { /* make stoppable */ signal(SIGTSTP, SIG_DFL); signal(SIGTTIN, SIG_DFL); signal(SIGTTOU, SIG_DFL); } signal(SIGTERM, parterm); } else if (tpgrp == -1 && (t->t_dflg&FINT)) { signal(SIGINT, SIG_IGN); signal(SIGQUIT, SIG_IGN); } if (wanttty > 0) ioctl(FSHTTY, TIOCSPGRP, &pgrp); if (wanttty >= 0 && tpgrp >= 0) 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) signal(SIGHUP, SIG_IGN); if (t->t_dflg & FNICE) { /* sigh... nice(20); nice(-10); */ nice(t->t_nice); } } else { palloc(pid, t); sigrelse(SIGCHLD); } return (pid); } okpcntl() { if (tpgrp == -1) error("No job control in this shell"); if (tpgrp == 0) error("No job control in subshells"); } d nicecmd/csh/sh.proc.h 444 0 33 5624 2420701364 7103 /* sh.proc.h 4.1 10/9/80 */ /* * 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 */ short p_pid; short p_jobid; /* pid of job leader */ /* if a job is stopped/background p_jobid gives its pgrp */ time_t p_btime; /* begin time */ time_t p_etime; /* end time */ long p_stime; /* system cpu time */ long p_utime; /* user cpu time */ #ifdef VMUNIX struct vtimes p_vtimes; #endif 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 */ bool timesdone; /* shtimes buffer full ? */ int psigint(); struct process *pgetcurr(); struct process *plookup(); struct process *pfind(); /* list head of all processes */ bool pnoprocesses; /* pchild found nothing to wait for */ struct proce((cmd/csh/sh.sem.c 444 0 33 20160 2420701375 6731 static char *sccsid = "@(#)sh.sem.c 4.1 10/9/80"; #include "sh.h" #include "sh.proc.h" #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) 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) { close(0); heredoc(t->t_dlef); if (noexec) 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, odidcch; int oSHIN, oSHOUT, oSHDIAG, oOLDSTD, otpgrp; sighold(SIGCHLD); ochild = child; osetintr = setintr; ohaderr = haderr; odidfds = didfds; odidcch = didcch; oSHIN = SHIN; oSHOUT = SHOUT; oSHDIAG = SHDIAG; oOLDSTD = OLDSTD; otpgrp = tpgrp; Vsav = Vdp = 0; Vav = 0; pid = vfork(); if (pid < 0) { sigrelse(SIGCHLD); error("No more processes"); } forked++; if (pid) { child = ochild; setintr = osetintr; haderr = ohaderr; didfds = odidfds; didcch = odidcch; SHIN = oSHIN; SHOUT = oSHOUT; SHDIAG = oSHDIAG; OLDSTD = oOLDSTD; tpgrp = otpgrp; xfree(Vsav); Vsav = 0; xfree(Vdp); Vdp = 0; xfree(Vav); Vav = 0; /* this is from pfork() */ palloc(pid, t); sigrelse(SIGCHLD); } else { /* 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; sigsys(SIGCHLD, SIG_DFL); sigsys(SIGINT, ignint ? SIG_IGN : vffree); sigsys(SIGQUIT, ignint ? SIG_IGN : SIG_DFL); if (wanttty >= 0) { sigsys(SIGTSTP, SIG_DFL); sigsys(SIGTTIN, SIG_DFL); sigsys(SIGTTOU, SIG_DFL); } sigsys(SIGTERM, parterm); } else if (tpgrp == -1 && (t->t_dflg&FINT)) { sigsys(SIGINT, SIG_IGN); sigsys(SIGQUIT, SIG_IGN); } if (wanttty > 0) ioctl(FSHTTY, TIOCSPGRP, &pgrp); if (wanttty >= 0 && tpgrp >= 0) setpgrp(0, pgrp); if (tpgrp > 0) tpgrp = 0; if (t->t_dflg & FNOHUP) sigsys(SIGHUP, SIG_IGN); if (t->t_dflg & FNICE) nice(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) close(pipein[0]), close(pipein[1]); if ((t->t_dflg & (FPOU|FAND)) == 0) pwait(); break; } doio(t, pipein, pipeout); if (t->t_dflg & FPOU) close(pipeout[0]), 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); close(SHIN), SHIN = -1; didcch = 0, 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, xfree(gargv); if (v = pargv) pargv = 0, xfree(pargv); _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 */ close(0); if (cp = t->t_dlef) { cp = globone(Dfix1(cp)); xfree(cp); if (open(cp, 0) < 0) Perror(cp); } else if (flags & FPIN) dup(pipein[0]), close(pipein[0]), close(pipein[1]); else if ((flags & FINT) && tpgrp == -1) close(0), open("/dev/null", 0); else dup(OLDSTD); } close(1); if (cp = t->t_drit) { cp = globone(Dfix1(cp)); xfree(cp); if ((flags & FCAT) && open(cp, 1) >= 0) lseek(1, 0l, 2); else { if (!(flags & FANY) && adrof("noclobber")) { if (flags & FCAT) Perror(cp); chkclob(cp); } if (creat(cp, 0666) < 0) Perror(cp); } } else if (flags & FPOU) dup(pipeout[1]); else dup(SHOUT); close(2); dup((flags & FDIAG) ? 1 : 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); } Perror(cp); } } else if (flags & FPOU) dup(pipeout[1]); else dup(SHOUT); close(2); dup((flags & FDIAG) ? 1 : 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 (scmd/csh/sh.set.c 444 0 33 17622 2420701400 6736 static char *sccsid = "@(#)sh.set.c 4.1 10/9/80"; #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) 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)); } 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) { 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; letter(*p); p++) continue; if (vp == p) 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 (strcmp(vp, "path") == 0) 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)); } onlyread(cp) char *cp; { extern char end[]; return (cp < end); } xfree(cp) char *cp; { extern char end[]; if (cp >= end && cp < (char *) &cp) cfree(cp); } char * savestr(s) register char *s; { register char *n; if (s == 0) s = ""; strcpy(n = calloc(1, strlen(s) + 1), s); return (n); } 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 * value(var) char *var; { return (value1(var, &shvhed)); } 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]); } static struct varent *shprev; struct varent * adrof(var) char *var; { return (adrof1(var, &shvhed)); } struct varent * madrof(pat, head) char *pat; struct varent *head; { register struct varent *vp; shprev = head; for (vp = shprev->link; vp != 0; vp = vp->link) { if (Gmatch(vp->name, pat)) return (vp); shprev = vp; } return (0); } struct varent * adrof1(var, head) char *var; struct varent *head; { register struct varent *vp; int cmp; shprev = head; for (vp = shprev->link; vp != 0; vp = vp->link) { cmp = strcmp(vp->name, var); if (cmp == 0) return (vp); else if (cmp > 0) return (0); shprev = vp; } return (0); } /* * The caller is responsible for putting value in a safe place */ set(var, value) char *var, *value; { register char **vec = (char **) calloc(2, sizeof (char **)); vec[0] = onlyread(value) ? savestr(value) : value; set1(var, vec, &shvhed); } set1(var, vec, head) char *var, **vec; struct varent *head; { register char **oldv = vec; gflag = 0; rscan(oldv, tglob); if (gflag) { vec = glob(oldv); if (vec == 0) { bferr("No match"); blkfree(oldv); return; } blkfree(oldv); gargv = 0; } setq(var, vec, head); } setq(var, vec, head) char *var, **vec; struct varent *head; { register struct varent *vp; vp = adrof1(var, head); if (vp == 0) { vp = (struct varent *) calloc(1, sizeof *vp); vp->name = savestr(var); vp->link = shprev->link; shprev->link = vp; } if (vp->vec) blkfree(vp->vec); scan(vec, trim); vp->vec = vec; } unset(v) register char *v[]; { unset1(v, &shvhed); if (adrof("histchars") == 0) { HIST = '!'; HISTSUB = '^'; } } unset1(v, head) register char *v[]; struct varent *head; { register char *var; register struct varent *vp; register int cnt; v++; while (var = *v++) { cnt = 0; while (vp = madrof(var, head)) unsetv1(vp->name, head), cnt++; if (cnt == 0) setname(var); } } unsetv(var) char *var; { unsetv1(var, &shvhed); } unsetv1(var, head) char *var; struct varent *head; { register struct varent *vp; vp = adrof1(var, head); if (vp == 0) udvar(var); vp = shprev->link; shprev->link = vp->link; blkfree(vp->vec); xfree(vp->name); xfree((char *)vp); } 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 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]; register char *dir; exppath[0] = 0; if (val) while (*val) { if (strlen(*val) + strlen(exppath) + 2 > BUFSIZ) { printf("Warning: ridiculously long PATH truncated\n"); break; } strcat(exppath, *val++); if (*val == 0 || eq(*val, ")")) break; strcat(exppath, ":"); } setenv("PATH", exppath); } me); argv = adrof(name); if (argv == 0) udvar(name); if (argv->vec[0] == 0) bferr("No more words"); lscmd/csh/sh.time.c 444 0 33 5762 2420701403 7066 static char *sccsid = "@(#)sh.time.c 4.1 10/9/80"; #include "sh.h" /* * C Shell - routines handling process timing and niceing */ #ifdef VMUNIX struct vtimes vm0; #else struct tms times0; struct tms timesdol; #endif settimes() { time(&time0); #ifdef VMUNIX vtimes(&vm0, 0); #else times(×0); #endif } /* * dotime is only called if it is truly a builtin function and not a * prefix to another command */ dotime() { time_t timedol; #ifdef VMUNIX struct vtimes vm1, vmch; vtimes(&vm1, &vmch); vmsadd(&vm1, &vmch); #endif time(&timedol); #ifdef VMUNIX pvtimes(&vm0, &vm1, timedol - time0); #else times(×dol); ptimes(timedol - time0, ×0, ×dol); #endif } /* * donice is only called when it on the line by itself or with a +- value */ donice(v) register char **v; { register char *cp; v++, cp = *v++; if (cp == 0) { #ifndef V6 nice(20); nice(-10); #endif nice(4); } else if (*v == 0 && any(cp[0], "+-")) { #ifndef V6 nice(20); nice(-10); #endif nice(getn(cp)); } } #ifndef VMUNIX ptimes(utime, stime, etime) register time_t utime, stime, etime; { p60ths(utime); printf("u "); p60ths(stime); printf("s "); psecs(etime); printf(" %d%%\n", (int) (100 * (utime+stime) / (60 * (etime ? etime : 1)))); } #else vmsadd(vp, wp) register struct vtimes *vp, *wp; { vp->vm_utime += wp->vm_utime; vp->vm_stime += wp->vm_stime; vp->vm_nswap += wp->vm_nswap; vp->vm_idsrss += wp->vm_idsrss; vp->vm_ixrss += wp->vm_ixrss; if (vp->vm_maxrss < wp->vm_maxrss) vp->vm_maxrss = wp->vm_maxrss; vp->vm_majflt += wp->vm_majflt; vp->vm_minflt += wp->vm_minflt; vp->vm_inblk += wp->vm_inblk; vp->vm_oublk += wp->vm_oublk; } pvtimes(v0, v1, sec) register struct vtimes *v0, *v1; time_t sec; { register time_t t = (v1->vm_utime-v0->vm_utime)+(v1->vm_stime-v0->vm_stime); register char *cp; register int i; register struct varent *vp = adrof("time"); cp = "%Uu %Ss %E %P %X+%Dk %I+%Oio %Fpf+%Ww"; 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': p60ths(v1->vm_utime - v0->vm_utime); break; case 'S': p60ths(v1->vm_stime - v0->vm_stime); break; case 'E': psecs(sec); break; case 'P': printf("%d%%", (int) ((100 * t) / (60 * (sec ? sec : 1)))); break; case 'W': i = v1->vm_nswap - v0->vm_nswap; printf("%d", i); break; case 'X': printf("%d", t == 0 ? 0 : (v1->vm_ixrss-v0->vm_ixrss)/(2*t)); break; case 'D': printf("%d", t == 0 ? 0 : (v1->vm_idsrss-v0->vm_idsrss)/(2*t)); break; case 'K': printf("%d", t == 0 ? 0 : ((v1->vm_ixrss+v1->vm_idsrss) - (v0->vm_ixrss+v0->vm_idsrss))/(2*t)); break; case 'M': printf("%d", v1->vm_maxrss/2); break; case 'F': printf("%d", v1->vm_majflt-v0->vm_majflt); break; case 'R': printf("%d", v1->vm_minflt-v0->vm_minflt); break; case 'I': printf("%d", v1->vm_inblk-v0->vm_inblk); break; case 'O': printf("%d", v1->vm_oublk-v0->vm_oublk); break; } putchar('\n'); } #endif 1->vm_idsrss-vcmd/csh/nfunc.c 644 0 33 40632 2466211315 6655 static char *sccsid = "@(#)sh.func.c 4.2 1/15/81"; #include "sh.h" #include /* * C shell */ struct biltins * isbfunc(t) register struct command *t; { register char *cp = t->t_dcom[0]; register char *dp; register struct biltins *bp; 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); } for (bp = bfunc; dp = bp->bname; bp++) { if (dp[0] == cp[0] && eq(dp, cp)) return (bp); if (dp[0] > cp[0]) break; } 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) sighold(SIGINT); else sigset(SIGINT, SIG_DFL); gointr = 0; } else if (eq((vv = strip(vv)), "-")) { sigset(SIGINT, SIG_IGN); gointr = "-"; } else { gointr = savestr(vv); sigset(SIGINT, pintr); } } donohup() { if (intty) bferr("Can't from terminal"); if (setintr == 0) { 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(); signal(SIGTERM, parterm); execl("/bin/login", "login", v[1], 0); untty(); exit(1); } donewgrp(v) char **v; { signal(SIGTERM, parterm); execl("/bin/newgrp", "newgrp", v[1], 0); execl("/usr/bin/newgrp", "newgrp", v[1], 0); untty(); exit(1); } 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) 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, rscan(v, tglob); 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) sigrelse(SIGINT); search(ZBREAK, 0); if (setintr) sighold(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; i = getn(v[1]); if (setintr) sighold(SIGINT); lshift(v, 2); while (i > 0) { if (setintr) sigrelse(SIGINT); reexecute(kp); --i; } donefds(); if (setintr) sigrelse(SIGINT); } doswbrk() { search(ZBRKSW, 0); } srchx(cp) register char *cp; { register struct srch *sp; for (sp = srchn; sp->s_name; sp++) if (eq(cp, sp->s_name)) return (sp->s_value); 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(0l); do { if (intty && fseekp == feobp) printf("? "), flush(); aword[0] = 0, 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; 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; } 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 < 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 (any(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) sigrelse(SIGINT); v++; if (*v == 0) return; gflag = 0; rscan(v, tglob); if (gflag) { v = glob(v); if (v == 0) bferr("No match"); } else scan(v, trim); if (sep == ' ' && !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) sighold(SIGINT); if (gargv) blkfree(gargv), gargv = 0; } char **environ; dosetenv(v) register char **v; { char *lp = globone(v[2]); setenv(v[1], lp); if (eq(v[1], "PATH")) { importpath(lp); dohash(); } xfree(lp); } dounsetenv(v) register char **v; { v++; do unsetenv(*v++); while (*v); } setenv(name, value) char *name, *value; { 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("=", value); xfree(*ep); *ep = strspl(name, cp); xfree(cp); scan(ep, trim); return; } blk[0] = strspl(name, "="); blk[1] = 0; environ = blkspl(environ, blk); xfree((char *)oep); setenv(name, value); } 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); 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"); umask(i); } #include struct limits { int limconst; char *limname; int limdiv; char *limscale; } limits[] = { LIM_NORAISE, "noraise", 1, "", LIM_CPU, "cputime", 1, "seconds", LIM_FSIZE, "filesize", 1024, "kbytes", LIM_DATA, "datasize", 1024, "kbytes", LIM_STACK, "stacksize", 1024, "kbytes", LIM_CORE, "coredumpsize", 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"); } dolimit(v) register char **v; { register struct limits *lp; register int limit; v++; if (*v == 0) { for (lp = limits+1; lp->limconst >= 0; lp++) plim(lp); if (vlimit(LIM_NORAISE, -1) && getuid()) printf("Limits cannot be raised\n"); return; } lp = findlim(v[0]); if (v[1] == 0) { plim(lp); return; } limit = getval(lp, v+1); setlim(lp, limit); } 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 ((int)(f+0.5) * lp->limdiv); cp = *v; } if (lp->limconst == LIM_NORAISE) goto badscal; switch (*cp) { case ':': if (lp->limconst != LIM_CPU) goto badscal; return ((int)(f * 60.0 + atof(cp+1))); case 'h': if (lp->limconst != LIM_CPU) goto badscal; limtail(cp, "hours"); f *= 3600.; break; case 'm': if (lp->limconst == LIM_CPU) { limtail(cp, "minutes"); f *= 60.; break; } case 'M': if (lp->limconst == LIM_CPU) goto badscal; *cp = 'm'; limtail(cp, "megabytes"); f *= 1024.*1024.; break; case 's': if (lp->limconst != LIM_CPU) goto badscal; limtail(cp, "seconds"); break; case 'k': if (lp->limconst == LIM_CPU) goto badscal; limtail(cp, "kbytes"); f *= 1024; break; case 'u': limtail(cp, "unlimited"); return (INFINITY); default: badscal: bferr("Improper or unknown scale factor"); } return ((int)(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) register struct limits *lp; { register int lim; printf("%s \t", lp->limname); lim = vlimit(lp->limconst, -1); if (lim == INFINITY) printf("unlimited"); else if (lp->limconst == LIM_CPU) psecs((long)lim); else printf("%d %s", lim / lp->limdiv, lp->limscale); printf("\n"); } dounlimit(v) register char **v; { register struct limits *lp; v++; if (*v == 0) { for (lp = limits+1; lp->limconst >= 0; lp++) setlim(lp, INFINITY); return; } while (*v) { lp = findlim(*v++); setlim(lp, INFINITY); } } setlim(lp, limit) register struct limits *lp; { if (vlimit(lp->limconst, limit) < 0) Perror(bname); } dosuspend() { int old, ldisc; short ctpgrp; if (loginsh) error("Can't suspend a login shell (yet)"); untty(); old = sigsys(SIGTSTP, SIG_DFL); kill(0, SIGTSTP); /* the shell stops here */ sigsys(SIGTSTP, old); if (tpgrp != -1) { retry: ioctl(FSHTTY, TIOCGPGRP, &ctpgrp); if (ctpgrp != opgrp) { old = sigsys(SIGTTIN, SIG_DFL); kill(0, SIGTTIN); sigsys(SIGTTIN, old); goto retry; } ioctl(FSHTTY, TIOCSPGRP, &shpgrp); setpgrp(0, shpgrp); } ioctl(FSHTTY, TIOCGETD, &oldisc); if (oldisc != NTTYDISC) { printf("Switching to new tty driver...\n"); ldisc = NTTYDISC; ioctl(FSHTTY, TIOCSETD, &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; rscan(v, tglob); if (gflag) { gv = v = glob(v); gargv = 0; if (v == 0) error("No match"); v = copyblk(v); } else scan(v, trim); 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); } ar *oevalp = evalp; jmp_buf osetexit; int reenter; char **gv = 0; v++; if (*v == 0) return; gcmd/dc/ 775 0 33 0 2552526110 5077 cmd/dc/Makefile 644 0 33 141 2254134676 6611 dc: dc.c dc.h cc -O dc.c -o dc install: dc install -s dc $(DESTDIR)/usr/bin clean: rm -f *.o "No match"); v = copyblk(v); } els< < a9texi02552526110 reen< a9xit(00000005077+; if (reenter == 1) { evalvec = v; evalp = 0; process(0); } evalvec = oevalvec; evalp = oevalp; doneinp = 0; if (gv) blkfree(gv); resexit(osetexit); if (reenter >= 2) er NOSTR); / C. /,"cmd/dc/dc.c 644 0 33 75475 2405674143 5765 ((#include #include #include "dc.h" main(argc,argv) int argc; char *argv[]; { init(argc,argv); commnds(); } commnds(){ register int c; register struct blk *p,*q; long l; int sign; struct blk **ptr,*s,*t; struct sym *sp; int sk,sk1,sk2; int n,d; while(1){ if(((c = readc())>='0' && c <= '9')|| (c>='A' && c <='F') || c == '.'){ unreadc(c); p = readin(); pushp(p); continue; } switch(c){ case ' ': case '\n': case 0377: case EOF: continue; case 'Y': sdump("stk",*stkptr); printf("all %ld rel %ld headmor %ld\n",all,rel,headmor); printf("nbytes %ld\n",nbytes); continue; case '_': p = readin(); savk = sunputc(p); chsign(p); sputc(p,savk); pushp(p); continue; case '-': subt(); continue; case '+': if(eqk() != 0)continue; binop('+'); continue; case '*': arg1 = pop(); EMPTY; arg2 = pop(); EMPTYR(arg1); sk1 = sunputc(arg1); sk2 = sunputc(arg2); binop('*'); p = pop(); sunputc(p); savk = sk1+sk2; if(savk>k && savk>sk1 && savk>sk2){ sk = sk1; if(sk=3){ error("exp too big\n"); } savk = sunputc(arg2); p = exp(arg2,arg1); release(arg2); rewind(arg1); c = sgetc(arg1); if(sfeof(arg1) == 0) c = sgetc(arg1)*100 + c; d = c*savk; release(arg1); if(neg == 0){ if(k>=savk)n = k; else n = savk; if(n= 100){ sputc(p,n/100); n %= 100; } sputc(p,n); sputc(p,0); pushp(p); continue; case 'Z': p = pop(); EMPTY; n = (length(p)-1)<<1; fsfile(p); sbackc(p); if(sfbeg(p) == 0){ if((c = sbackc(p))<0){ n -= 2; if(sfbeg(p) == 1)n += 1; else { if((c = sbackc(p)) == 0)n += 1; else if(c > 90)n -= 1; } } else if(c < 10) n -= 1; } release(p); q = salloc(1); if(n >= 100){ sputc(q,n%100); n /= 100; } sputc(q,n); sputc(q,0); pushp(q); continue; case 'i': p = pop(); EMPTY; p = scalint(p); release(inbas); inbas = p; continue; case 'I': p = copy(inbas,length(inbas)+1); sputc(p,0); pushp(p); continue; case 'o': p = pop(); EMPTY; p = scalint(p); sign = 0; n = length(p); q = copy(p,n); fsfile(q); l = c = sbackc(q); if(n != 1){ if(c<0){ sign = 1; chsign(q); n = length(q); fsfile(q); l = c = sbackc(q); } if(n != 1){ while(sfbeg(q) == 0)l = l*100+sbackc(q); } } logo = log2(l); obase = l; release(basptr); if(sign == 1)obase = -l; basptr = p; outdit = bigot; if(n == 1 && sign == 0){ if(c <= 16){ outdit = hexot; fw = 1; fw1 = 0; ll = 70; release(q); continue; } } n = 0; if(sign == 1)n++; p = salloc(1); sputc(p,-1); t = add(p,q); n += length(t)*2; fsfile(t); if((c = sbackc(t))>9)n++; release(t); release(q); release(p); fw = n; fw1 = n-1; ll = 70; if(fw>=ll)continue; ll = (70/fw)*fw; continue; case 'O': p = copy(basptr,length(basptr)+1); sputc(p,0); pushp(p); continue; case '[': n = 0; p = salloc(0); while(1){ if((c = readc()) == ']'){ if(n == 0)break; n--; } sputc(p,c); if(c == '[')n++; } pushp(p); continue; case 'k': p = pop(); EMPTY; p = scalint(p); if(length(p)>1){ error("scale too big\n"); } rewind(p); k = sfeof(p)?0:sgetc(p); release(scalptr); scalptr = p; continue; case 'K': p = copy(scalptr,length(scalptr)+1); sputc(p,0); pushp(p); continue; case 'X': p = pop(); EMPTY; fsfile(p); n = sbackc(p); release(p); p = salloc(2); sputc(p,n); sputc(p,0); pushp(p); continue; case 'Q': p = pop(); EMPTY; if(length(p)>2){ error("Q?\n"); } rewind(p); if((c = sgetc(p))<0){ error("neg Q\n"); } release(p); while(c-- > 0){ if(readptr == &readstk[0]){ error("readstk?\n"); } if(*readptr != 0)release(*readptr); readptr--; } continue; case 'q': if(readptr <= &readstk[1])exit(0); if(*readptr != 0)release(*readptr); readptr--; if(*readptr != 0)release(*readptr); readptr--; continue; case 'f': if(stkptr == &stack[0])printf("empty stack\n"); else { for(ptr = stkptr; ptr > &stack[0];){ print(*ptr--); } } continue; case 'p': if(stkptr == &stack[0])printf("empty stack\n"); else{ print(*stkptr); } continue; case 'P': p = pop(); EMPTY; sputc(p,0); printf("%s",p->beg); release(p); continue; case 'd': if(stkptr == &stack[0]){ printf("empty stack\n"); continue; } q = *stkptr; n = length(q); p = copy(*stkptr,n); pushp(p); continue; case 'c': while(stkerr == 0){ p = pop(); if(stkerr == 0)release(p); } continue; case 'S': if(stkptr == &stack[0]){ error("save: args\n"); } c = readc() & 0377; sptr = stable[c]; sp = stable[c] = sfree; sfree = sfree->next; if(sfree == 0)goto sempty; sp->next = sptr; p = pop(); EMPTY; if(c >= ARRAYST){ q = copy(p,PTRSZ); for(n = 0;n < PTRSZ-1;n++)sputc(q,0); release(p); p = q; } sp->val = p; continue; sempty: error("symbol table overflow\n"); case 's': if(stkptr == &stack[0]){ error("save:args\n"); } c = readc() & 0377; sptr = stable[c]; if(sptr != 0){ p = sptr->val; if(c >= ARRAYST){ rewind(p); while(sfeof(p) == 0)release(getwd(p)); } release(p); } else{ sptr = stable[c] = sfree; sfree = sfree->next; if(sfree == 0)goto sempty; sptr->next = 0; } p = pop(); sptr->val = p; continue; case 'l': load(); continue; case 'L': c = readc() & 0377; sptr = stable[c]; if(sptr == 0){ error("L?\n"); } stable[c] = sptr->next; sptr->next = sfree; sfree = sptr; p = sptr->val; if(c >= ARRAYST){ rewind(p); while(sfeof(p) == 0){ q = getwd(p); if(q != 0)release(q); } } pushp(p); continue; case ':': p = pop(); EMPTY; q = scalint(p); fsfile(q); c = 0; if((sfbeg(q) == 0) && ((c = sbackc(q))<0)){ error("neg index\n"); } if(length(q)>2){ error("index too big\n"); } if(sfbeg(q) == 0)c = c*100+sbackc(q); if(c >= MAXIND){ error("index too big\n"); } release(q); n = readc() & 0377; sptr = stable[n]; if(sptr == 0){ sptr = stable[n] = sfree; sfree = sfree->next; if(sfree == 0)goto sempty; sptr->next = 0; p = salloc((c+PTRSZ)*PTRSZ); zero(p); } else{ p = sptr->val; if(length(p)-PTRSZ < c*PTRSZ){ q = copy(p,(c+PTRSZ)*PTRSZ); release(p); p = q; } } seekc(p,c*PTRSZ); q = lookwd(p); if (q!=NULL) release(q); s = pop(); EMPTY; salterwd(p,s); sptr->val = p; continue; case ';': p = pop(); EMPTY; q = scalint(p); fsfile(q); c = 0; if((sfbeg(q) == 0) && ((c = sbackc(q))<0)){ error("neg index\n"); } if(length(q)>2){ error("index too big\n"); } if(sfbeg(q) == 0)c = c*100+sbackc(q); if(c >= MAXIND){ error("index too big\n"); } release(q); n = readc() & 0377; sptr = stable[n]; if(sptr != 0){ p = sptr->val; if(length(p)-PTRSZ >= c*PTRSZ){ seekc(p,c*PTRSZ); s = getwd(p); if(s != 0){ q = copy(s,length(s)); pushp(q); continue; } } } q = salloc(PTRSZ); putwd(q, (struct blk *)0); pushp(q); continue; case 'x': execute: p = pop(); EMPTY; if((readptr != &readstk[0]) && (*readptr != 0)){ if((*readptr)->rd == (*readptr)->wt) release(*readptr); else{ if(readptr++ == &readstk[RDSKSZ]){ error("nesting depth\n"); } } } else readptr++; *readptr = p; if(p != 0)rewind(p); else{ if((c = readc()) != '\n')unreadc(c); } continue; case '?': if(++readptr == &readstk[RDSKSZ]){ error("nesting depth\n"); } *readptr = 0; fsave = curfile; curfile = stdin; while((c = readc()) == '!')command(); p = salloc(0); sputc(p,c); while((c = readc()) != '\n'){ sputc(p,c); if(c == '\\')sputc(p,readc()); } curfile = fsave; *readptr = p; continue; case '!': if(command() == 1)goto execute; continue; case '<': case '>': case '=': if(cond(c) == 1)goto execute; continue; default: printf("%o is unimplemented\n",c); } } } struct blk * div(ddivd,ddivr) struct blk *ddivd,*ddivr; { int divsign,remsign,offset,divcarry; int carry, dig,magic,d,dd; long c,td,cc; struct blk *ps; register struct blk *p,*divd,*divr; rem = 0; p = salloc(((0); if(length(ddivr) == 0){ pushp(ddivr); errorrt("divide by 0\n"); } divsign = remsign = 0; divr = ddivr; fsfile(divr); if(sbackc(divr) == -1){ divr = copy(ddivr,length(ddivr)); chsign(divr); divsign = ~divsign; } divd = copy(ddivd,length(ddivd)); fsfile(divd); if(sfbeg(divd) == 0 && sbackc(divd) == -1){ chsign(divd); divsign = ~divsign; remsign = ~remsign; } offset = length(divd) - length(divr); if(offset < 0)goto ddone; seekc(p,offset+1); sputc(divd,0); magic = 0; fsfile(divr); c = sbackc(divr); if(c<10)magic++; c = c*100 + (sfbeg(divr)?0:sbackc(divr)); if(magic>0){ c = (c*100 +(sfbeg(divr)?0:sbackc(divr)))*2; c /= 25; } while(offset >= 0){ fsfile(divd); td = sbackc(divd)*100; dd = sfbeg(divd)?0:sbackc(divd); td = (td+dd)*100; dd = sfbeg(divd)?0:sbackc(divd); td = td+dd; cc = c; if(offset == 0)td += 1; else cc += 1; if(magic != 0)td = td<<3; dig = td/cc; rewind(divr); rewind(divxyz); carry = 0; while(sfeof(divr) == 0){ d = sgetc(divr)*dig+carry; carry = d / 100; salterc(divxyz,d%100); } salterc(divxyz,carry); rewind(divxyz); seekc(divd,offset); carry = 0; while(sfeof(divd) == 0){ d = slookc(divd); d = d-(sfeof(divxyz)?0:sgetc(divxyz))-carry; carry = 0; if(d < 0){ d += 100; carry = 1; } salterc(divd,d); } divcarry = carry; sbackc(p); salterc(p,dig); sbackc(p); if(--offset >= 0)divd->wt--; } if(divcarry != 0){ salterc(p,dig-1); salterc(divd,-1); ps = add(divr,divd); release(divd); divd = ps; } rewind(p); divcarry = 0; while(sfeof(p) == 0){ d = slookc(p)+divcarry; divcarry = 0; if(d >= 100){ d -= 100; divcarry = 1; } salterc(p,d); } if(divcarry != 0)salterc(p,divcarry); fsfile(p); while(sfbeg(p) == 0){ if(sbackc(p) == 0)truncate(p); else break; } if(divsign < 0)chsign(p); fsfile(divd); while(sfbeg(divd) == 0){ if(sbackc(divd) == 0)truncate(divd); else break; } ddone: if(remsign<0)chsign(divd); if(divr != ddivr)release(divr); rem = divd; return(p); } dscale(){ register struct blk *dd,*dr; register struct blk *r; int c; dr = pop(); EMPTYS; dd = pop(); EMPTYSR(dr); fsfile(dd); skd = sunputc(dd); fsfile(dr); skr = sunputc(dr); if(sfbeg(dr) == 1 || (sfbeg(dr) == 0 && sbackc(dr) == 0)){ sputc(dr,skr); pushp(dr); errorrt("divide by 0\n"); } c = k-skd+skr; if(c < 0)r = removr(dd,-c); else { r = add0(dd,c); irem = 0; } arg1 = r; arg2 = dr; savk = k; return(0); } struct blk * removr(p,n) struct blk *p; { int nn; register struct blk *q,*s,*r; rewind(p); nn = (n+1)/2; q = salloc(nn); while(n>1){ sputc(q,sgetc(p)); n -= 2; } r = salloc(2); while(sfeof(p) == 0)sputc(r,sgetc(p)); release(p); if(n == 1){ s = div(r,tenptr); release(r); rewind(rem); if(sfeof(rem) == 0)sputc(q,sgetc(rem)); release(rem); irem = q; return(s); } irem = q; return(r); } struct blk * sqrt(p) struct blk *p; { struct blk *t; struct blk *r,*q,*s; int c,n,nn; n = length(p); fsfile(p); c = sbackc(p); if((n&1) != 1)c = c*100+(sfbeg(p)?0:sbackc(p)); n = (n+1)>>1; r = salloc(n); zero(r); seekc(r,n); nn=1; while((c -= nn)>=0)nn+=2; c=(nn+1)>>1; fsfile(r); sbackc(r); if(c>=100){ c -= 100; salterc(r,c); sputc(r,1); } else salterc(r,c); while(1){ q = div(p,r); s = add(q,r); release(q); release(rem); q = div(s,sqtemp); release(s); release(rem); s = copy(r,length(r)); chsign(s); t = add(s,q); release(s); fsfile(t); nn = sfbeg(t)?0:sbackc(t); if(nn>=0)break; release(r); release(t); r = q; } release(t); release(q); release(p); return(r); } struct blk * exp(base,ex) struct blk *base,*ex; { register struct blk *r,*e,*p; struct blk *e1,*t,*cp; int temp,c,n; r = salloc(1); sputc(r,1); p = copy(base,length(base)); e = copy(ex,length(ex)); fsfile(e); if(sfbeg(e) != 0)goto edone; temp=0; c = sbackc(e); if(c<0){ temp++; chsign(e); } while(length(e) != 0){ e1=div(e,sqtemp); release(e); e = e1; n = length(rem); release(rem); if(n != 0){ e1=mult(p,r); release(r); r = e1; } t = copy(p,length(p)); cp = mult(p,t); release(p); release(t); p = cp; } if(temp != 0){ if((c = length(base)) == 0){ goto edone; } if(c>1)create(r); else{ rewind(base); if((c = sgetc(base))<=1){ create(r); sputc(r,c); } else create(r); } } edone: release(p); release(e); return(r); } init(argc,argv) int argc; char *argv[]; { register struct sym *sp; if (signal(SIGINT, SIG_IGN) != SIG_IGN) signal(SIGINT,onintr); setbuf(stdout,(char *)NULL); svargc = --argc; svargv = argv; while(svargc>0 && svargv[1][0] == '-'){ switch(svargv[1][1]){ default: dbg=1; } svargc--; svargv++; } ifile=1; if(svargc<=0)curfile = stdin; else if((curfile = fopen(svargv[1],"r")) == NULL){ printf("can't open file %s\n",svargv[1]); exit(1); } dummy = malloc(1); scalptr = salloc(1); sputc(scalptr,0); basptr = salloc(1); sputc(basptr,10); obase=10; log10=log2(10L); ll=70; fw=1; fw1=0; tenptr = salloc(1); sputc(tenptr,10); obase=10; inbas = salloc(1); sputc(inbas,10); sqtemp = salloc(1); sputc(sqtemp,2); chptr = salloc(0); strptr = salloc(0); divxyz = salloc(0); stkbeg = stkptr = &stack[0]; stkend = &stack[STKSZ]; stkerr = 0; readptr = &readstk[0]; k=0; sp = sptr = &symlst[0]; while(sptr < &symlst[TBLSZ]){ sptr->next = ++sp; sptr++; } sptr->next=0; sfree = &symlst[0]; return; } onintr(){ signal(SIGINT,onintr); while(readptr != &readstk[0]){ if(*readptr != 0){release(*readptr);} readptr--; } curfile = stdin; commnds(); } pushp(p) struct blk *p; { if(stkptr == stkend){ printf("out of stack space\n"); return; } stkerr=0; *++stkptr = p; return; } struct blk * pop(){ if(stkptr == stack){ stkerr=1; return(0); } return(*stkptr--); } struct blk * readin(){ register struct blk *p,*q; int dp,dpct; register int c; dp = dpct=0; p = salloc(0); while(1){ c = readc(); switch(c){ case '.': if(dp != 0){ unreadc(c); break; } dp++; continue; case '\\': readc(); continue; default: if(c >= 'A' && c <= 'F')c = c - 'A' + 10; else if(c >= '0' && c <= '9')c -= '0'; else goto gotnum; if(dp != 0){ if(dpct >= 99)continue; dpct++; } create(chptr); if(c != 0)sputc(chptr,c); q = mult(p,inbas); release(p); p = add(chptr,q); release(q); } } gotnum: unreadc(c); if(dp == 0){ sputc(p,0); return(p); } else{ q = scale(p,dpct); return(q); } } struct blk * add0(p,ct) int ct; struct blk *p; { /* returns pointer to struct with ct 0's & p */ register struct blk *q,*t; q = salloc(length(p)+(ct+1)/2); while(ct>1){ sputc(q,0); ct -= 2; } rewind(p); while(sfeof(p) == 0){ sputc(q,sgetc(p)); } release(p); if(ct == 1){ t = mult(tenptr,q); release(q); return(t); } return(q); } struct blk * mult(p,q) struct blk *p,*q; { register struct blk *mp,*mq,*mr; int sign,offset,carry; int cq,cp,mt,mcr; offset = sign = 0; fsfile(p); mp = p; if(sfbeg(p) == 0){ if(sbackc(p)<0){ mp = copy(p,length(p)); chsign(mp); sign = ~sign; } } fsfile(q); mq = q; if(sfbeg(q) == 0){ if(sbackc(q)<0){ mq = copy(q,length(q)); chsign(mq); sign = ~sign; } } mr = salloc(length(mp)+length(mq)); zero(mr); rewind(mq); while(sfeof(mq) == 0){ cq = sgetc(mq); rewind(mp); rewind(mr); mr->rd += offset; carry=0; while(sfeof(mp) == 0){ cp = sgetc(mp); mcr = sfeof(mr)?0:slookc(mr); mt = cp*cq + carry + mcr; carry = mt/100; salterc(mr,mt%100); } offset++; if(carry != 0){ mcr = sfeof(mr)?0:slookc(mr); salterc(mr,mcr+carry); } } if(sign < 0){ chsign(mr); } if(mp != p)release(mp); if(mq != q)release(mq); return(mr); } chsign(p) struct blk *p; { register int carry; register char ct; carry=0; rewind(p); while(sfeof(p) == 0){ ct=100-slookc(p)-carry; carry=1; if(ct>=100){ ct -= 100; carry=0; } salterc(p,ct); } if(carry != 0){ sputc(p,-1); fsfile(p); sbackc(p); ct = sbackc(p); if(ct == 99){ truncate(p); sputc(p,-1); } } else{ fsfile(p); ct = sbackc(p); if(ct == 0)truncate(p); } return; } readc(){ loop: if((readptr != &readstk[0]) && (*readptr != 0)){ if(sfeof(*readptr) == 0)return(lastchar = sgetc(*readptr)); release(*readptr); readptr--; goto loop; } lastchar = getc(curfile); if(lastchar != EOF)return(lastchar); if(readptr != &readptr[0]){ readptr--; if(*readptr == 0)curfile = stdin; goto loop; } if(curfile != stdin){ fclose(curfile); curfile = stdin; goto loop; } exit(0); } unreadc(c) char c; { if((readptr != &readstk[0]) && (*readptr != 0)){ sungetc(*readptr,c); } else ungetc(c,curfile); return; } binop(c) char c; { register struct blk *r; switch(c){ case '+': r = add(arg1,arg2); break; case '*': r = mult(arg1,arg2); break; case '/': r = div(arg1,arg2); break; } release(arg1); release(arg2); sputc(r,savk); pushp(r); return; } print(hptr) struct blk *hptr; { int sc; register struct blk *p,*q,*dec; int dig,dout,ct; rewind(hptr); while(sfeof(hptr) == 0){ if(sgetc(hptr)>99){ rewind(hptr); while(sfeof(hptr) == 0){ printf("%c",sgetc(hptr)); } printf("\n"); return; } } fsfile(hptr); sc = sbackc(hptr); if(sfbeg(hptr) != 0){ printf("0\n"); return; } count = ll; p = copy(hptr,length(hptr)); sunputc(p); fsfile(p); if(sbackc(p)<0){ chsign(p); OUTC('-'); } if((obase == 0) || (obase == -1)){ oneot(p,sc,'d'); return; } if(obase == 1){ oneot(p,sc,'1'); return; } if(obase == 10){ tenot(p,sc); return; } create(strptr); dig = log10*sc; dout = ((dig/10) + dig) /logo; dec = getdec(p,sc); p = removc(p,sc); while(length(p) != 0){ q = div(p,basptr); release(p); p = q; (*outdit)(rem,0); } release(p); fsfile(strptr); while(sfbeg(strptr) == 0)OUTC(sbackc(strptr)); if(sc == 0){ release(dec); printf("\n"); return; } create(strptr); OUTC('.'); ct=0; do{ q = mult(basptr,dec); release(dec); dec = getdec(q,sc); p = removc(q,sc); (*outdit)(p,1); }while(++ct < dout); release(dec); rewind(strp((tr); while(sfeof(strptr) == 0)OUTC(sgetc(strptr)); printf("\n"); return; } struct blk * getdec(p,sc) struct blk *p; { int cc; register struct blk *q,*t,*s; rewind(p); if(length(p)*2 < sc){ q = copy(p,length(p)); return(q); } q = salloc(length(p)); while(sc >= 1){ sputc(q,sgetc(p)); sc -= 2; } if(sc != 0){ t = mult(q,tenptr); s = salloc(cc = length(q)); release(q); rewind(t); while(cc-- > 0)sputc(s,sgetc(t)); sputc(s,0); release(t); t = div(s,tenptr); release(s); release(rem); return(t); } return(q); } tenot(p,sc) struct blk *p; { register int c,f; fsfile(p); f=0; while((sfbeg(p) == 0) && ((p->rd-p->beg-1)*2 >= sc)){ c = sbackc(p); if((c<10) && (f == 1))printf("0%d",c); else printf("%d",c); f=1; TEST2; } if(sc == 0){ printf("\n"); release(p); return; } if((p->rd-p->beg)*2 > sc){ c = sbackc(p); printf("%d.",c/10); TEST2; OUTC(c%10 +'0'); sc--; } else { OUTC('.'); } if(sc > (p->rd-p->beg)*2){ while(sc>(p->rd-p->beg)*2){ OUTC('0'); sc--; } } while(sc > 1){ c = sbackc(p); if(c<10)printf("0%d",c); else printf("%d",c); sc -= 2; TEST2; } if(sc == 1){ OUTC(sbackc(p)/10 +'0'); } printf("\n"); release(p); return; } oneot(p,sc,ch) struct blk *p; char ch; { register struct blk *q; q = removc(p,sc); create(strptr); sputc(strptr,-1); while(length(q)>0){ p = add(strptr,q); release(q); q = p; OUTC(ch); } release(q); printf("\n"); return; } hexot(p,flg) struct blk *p; { register int c; rewind(p); if(sfeof(p) != 0){ sputc(strptr,'0'); release(p); return; } c = sgetc(p); release(p); if(c >= 16){ printf("hex digit > 16"); return; } sputc(strptr,c<10?c+'0':c-10+'A'); return; } bigot(p,flg) struct blk *p; { register struct blk *t,*q; register int l; int neg; if(flg == 1)t = salloc(0); else{ t = strptr; l = length(strptr)+fw-1; } neg=0; if(length(p) != 0){ fsfile(p); if(sbackc(p)<0){ neg=1; chsign(p); } while(length(p) != 0){ q = div(p,tenptr); release(p); p = q; rewind(rem); sputc(t,sfeof(rem)?'0':sgetc(rem)+'0'); release(rem); } } release(p); if(flg == 1){ l = fw1-length(t); if(neg != 0){ l--; sputc(strptr,'-'); } fsfile(t); while(l-- > 0)sputc(strptr,'0'); while(sfbeg(t) == 0)sputc(strptr,sbackc(t)); release(t); } else{ l -= length(strptr); while(l-- > 0)sputc(strptr,'0'); if(neg != 0){ sunputc(strptr); sputc(strptr,'-'); } } sputc(strptr,' '); return; } struct blk * add(a1,a2) struct blk *a1,*a2; { register struct blk *p; register int carry,n; int size; int c,n1,n2; size = length(a1)>length(a2)?length(a1):length(a2); p = salloc(size); rewind(a1); rewind(a2); carry=0; while(--size >= 0){ n1 = sfeof(a1)?0:sgetc(a1); n2 = sfeof(a2)?0:sgetc(a2); n = n1 + n2 + carry; if(n>=100){ carry=1; n -= 100; } else if(n<0){ carry = -1; n += 100; } else carry = 0; sputc(p,n); } if(carry != 0)sputc(p,carry); fsfile(p); if(sfbeg(p) == 0){ while(sfbeg(p) == 0 && (c = sbackc(p)) == 0); if(c != 0)salterc(p,c); truncate(p); } fsfile(p); if(sfbeg(p) == 0 && sbackc(p) == -1){ while((c = sbackc(p)) == 99){ if(c == EOF)break; } sgetc(p); salterc(p,-1); truncate(p); } return(p); } eqk(){ register struct blk *p,*q; register int skp; int skq; p = pop(); EMPTYS; q = pop(); EMPTYSR(p); skp = sunputc(p); skq = sunputc(q); if(skp == skq){ arg1=p; arg2=q; savk = skp; return(0); } else if(skp < skq){ savk = skq; p = add0(p,skq-skp); } else { savk = skp; q = add0(q,skp-skq); } arg1=p; arg2=q; return(0); } struct blk * removc(p,n) struct blk *p; { register struct blk *q,*r; rewind(p); while(n>1){ sgetc(p); n -= 2; } q = salloc(2); while(sfeof(p) == 0)sputc(q,sgetc(p)); if(n == 1){ r = div(q,tenptr); release(q); release(rem); q = r; } release(p); return(q); } struct blk * scalint(p) struct blk *p; { register int n; n = sunputc(p); p = removc(p,n); return(p); } struct blk * scale(p,n) struct blk *p; { register struct blk *q,*s,*t; t = add0(p,n); q = salloc(1); sputc(q,n); s = exp(inbas,q); release(q); q = div(t,s); release(t); release(s); release(rem); sputc(q,n); return(q); } subt(){ arg1=pop(); EMPTYS; savk = sunputc(arg1); chsign(arg1); sputc(arg1,savk); pushp(arg1); if(eqk() != 0)return(1); binop('+'); return(0); } command(){ int c; char line[100],*sl; register (*savint)(),pid,rpid; int retcode; switch(c = readc()){ case '<': return(cond(NL)); case '>': return(cond(NG)); case '=': return(cond(NE)); default: sl = line; *sl++ = c; while((c = readc()) != '\n')*sl++ = c; *sl = 0; if((pid = fork()) == 0){ execl("/bin/sh","sh","-c",line,0); exit(0100); } savint = signal(SIGINT, SIG_IGN); while((rpid = wait(&retcode)) != pid && rpid != -1); signal(SIGINT,savint); printf("!\n"); return(0); } } cond(c) char c; { register struct blk *p; register char cc; if(subt() != 0)return(1); p = pop(); sunputc(p); if(length(p) == 0){ release(p); if(c == '<' || c == '>' || c == NE){ readc(); return(0); } load(); return(1); } else { if(c == '='){ release(p); readc(); return(0); } } if(c == NE){ release(p); load(); return(1); } fsfile(p); cc = sbackc(p); release(p); if((cc<0 && (c == '<' || c == NG)) || (cc >0) && (c == '>' || c == NL)){ readc(); return(0); } load(); return(1); } load(){ register int c; register struct blk *p,*q; struct blk *t,*s; c = readc() & 0377; sptr = stable[c]; if(sptr != 0){ p = sptr->val; if(c >= ARRAYST){ q = salloc(length(p)); rewind(p); while(sfeof(p) == 0){ s = getwd(p); if(s == 0){putwd(q, (struct blk *)NULL);} else{ t = copy(s,length(s)); putwd(q,t); } } pushp(q); } else{ q = copy(p,length(p)); pushp(q); } } else{ q = salloc(1); sputc(q,0); pushp(q); } return; } log2(n) long n; { register int i; if(n == 0)return(0); i=31; if(n<0)return(i); while((n= n<<1) >0)i--; return(--i); } struct blk * salloc(size) int size; { register struct blk *hdr; register char *ptr; all++; nbytes += size; ptr = malloc((unsigned)size); if(ptr == 0){ garbage("salloc"); if((ptr = malloc((unsigned)size)) == 0) ospace("salloc"); } if((hdr = hfree) == 0)hdr = morehd(); hfree = (struct blk *)hdr->rd; hdr->rd = hdr->wt = hdr->beg = ptr; hdr->last = ptr+size; return(hdr); } struct blk * morehd(){ register struct blk *h,*kk; headmor++; nbytes += HEADSZ; hfree = h = (struct blk *)malloc(HEADSZ); if(hfree == 0){ garbage("morehd"); if((hfree = h = (struct blk *)malloc(HEADSZ)) == 0) ospace("headers"); } kk = h; while(hrd = (char *)++kk; (--h)->rd=0; return(hfree); } /* sunputc(hptr) struct blk *hptr; { hptr->wt--; hptr->rd = hptr->wt; return(*hptr->wt); } */ struct blk * copy(hptr,size) struct blk *hptr; int size; { register struct blk *hdr; register unsigned sz; register char *ptr; all++; nbytes += size; sz = length(hptr); ptr = nalloc(hptr->beg, (unsigned)size); if(ptr == 0){ garbage("copy"); if((ptr = nalloc(hptr->beg, (unsigned)size)) == NULL){ printf("copy size %d\n",size); ospace("copy"); } } if((hdr = hfree) == 0)hdr = morehd(); hfree = (struct blk *)hdr->rd; hdr->rd = hdr->beg = ptr; hdr->last = ptr+size; hdr->wt = ptr+sz; ptr = hdr->wt; while(ptrlast)*ptr++ = '\0'; return(hdr); } sdump(s1,hptr) char *s1; struct blk *hptr; { char *p; printf("%s %o rd %o wt %o beg %o last %o\n",s1,hptr,hptr->rd,hptr->wt,hptr->beg,hptr->last); p = hptr->beg; while(p < hptr->wt)printf("%d ",*p++); printf("\n"); } seekc(hptr,n) struct blk *hptr; { register char *nn,*p; nn = hptr->beg+n; if(nn > hptr->last){ nbytes += nn - hptr->last; free(hptr->beg); p = realloc(hptr->beg, (unsigned)n); if(p == 0){ hptr->beg = realloc(hptr->beg, (unsigned)(hptr->last-hptr->beg)); garbage("seekc"); if((p = realloc(hptr->beg, (unsigned)n)) == 0) ospace("seekc"); } hptr->beg = p; hptr->wt = hptr->last = hptr->rd = p+n; return; } hptr->rd = nn; if(nn>hptr->wt)hptr->wt = nn; return; } salterwd(hptr,n) struct wblk *hptr; struct blk *n; { if(hptr->rdw == hptr->lastw)more(hptr); *hptr->rdw++ = n; if(hptr->rdw > hptr->wtw)hptr->wtw = hptr->rdw; return; } more(hptr) struct blk *hptr; { register unsigned size; register char *p; if((size=(hptr->last-hptr->beg)*2) == 0)size=1; nbytes += size/2; free(hptr->beg); p = realloc(hptr->beg, (unsigned)size); if(p == 0){ hptr->beg = realloc(hptr->beg, (unsigned)(hptr->last-hptr->beg)); garbage("more"); if((p = realloc(hptr->beg,size)) == 0) ospace("more"); } hptr->rd = hptr->rd-hptr->beg+p; hptr->wt = hptr->wt-hptr->beg+p; hptr->beg = p; hptr->last = p+size; return; } ospace(s) char *s; { printf("out of space: %s\n",s); printf("all %ld rel %ld headmor %ld\n",all,rel,headmor); printf("nbytes %ld\n",nbytes); sdump("stk",*stkptr); abort(); } garbage(s) char *s; { int i; struct blk *p, *q; struct sym *tmps; int ct; /* printf("got to garbage %s\n",s); */ for(i=0;ival; if(((int)p->beg & 01) != 0){ printf("string %o\n",i); sdump("odd beg",p); } redef(p); tmps = tmps->next; } while(tmps != 0); continue; } else { do { p = tmps->val; rewind(p); ct = 0; while((q = getwd(p)) != NULL){ ct++; if(q != 0){ if(((int)q->beg & 01) != 0){ printf("array %o elt %d odd\n",i-ARRAYST,ct); printf("tmps %o p %o\n",tmps,p); sdump("elt",q); } redef(q); } } tmps = tmps->next; } while(tmps != 0); } } } } redef(p) struct blk *p; { register offset; register char *newp; if ((int)p->beg&01) { printf("odd ptr %o hdr %o\n",p->beg,p); ospace("redef-bad"); } free(p->beg); free(dummy); dummy = malloc(1); if(dummy == NULL)ospace("dummy"); newp = realloc(p->beg, (unsigned)(p->last-p->beg)); if(newp == NULL)ospace("redef"); offset = newp - p->beg; p->beg = newp; p->rd(( += offset; p->wt += offset; p->last += offset; } release(p) register struct blk *p; { rel++; nbytes -= p->last - p->beg; p->rd = (char *)hfree; hfree = p; free(p->beg); } struct blk * getwd(p) struct blk *p; { register struct wblk *wp; wp = (struct wblk *)p; if (wp->rdw == wp->wtw) return(NULL); return(*wp->rdw++); } putwd(p, c) struct blk *p, *c; { register struct wblk *wp; wp = (struct wblk *)p; if (wp->wtw == wp->lastw) more(p); *wp->wtw++ = c; } struct blk * lookwd(p) struct blk *p; { register struct wblk *wp; wp = (struct wblk *)p; if (wp->rdw == wp->wtw) return(NULL); return(*wp->rdw); } char * nalloc(p,nbytes) register char *p; unsigned nbytes; { char *malloc(); register char *q, *r; q = r = malloc(nbytes); if(q==0) return(0); while(nbytes--) *q++ = *p++; return(r); } urn(*wp->rdw++); } putwd(p, c) struct blk *p, *c; { register struct wblk *wp; wp = (struct wblk *)p; if (wp->wtw == wp->lastw) more(p); *wp->wtw++ = c; } struct blk * lookwd(p) struct blcmd/dc/dc.h 644 0 33 6226 2111463444 5730 #define FATAL 0 #define NFATAL 1 #define BLK sizeof(struct blk) #define PTRSZ sizeof(int *) #define HEADSZ 1024 #define STKSZ 100 #define RDSKSZ 100 #define TBLSZ 256 #define ARRAYST 0241 #define MAXIND 2048 #define NL 1 #define NG 2 #define NE 3 #define length(p) ((p)->wt-(p)->beg) #define rewind(p) (p)->rd=(p)->beg #define create(p) (p)->rd = (p)->wt = (p)->beg #define fsfile(p) (p)->rd = (p)->wt #define truncate(p) (p)->wt = (p)->rd #define sfeof(p) (((p)->rd==(p)->wt)?1:0) #define sfbeg(p) (((p)->rd==(p)->beg)?1:0) #define sungetc(p,c) *(--(p)->rd)=c #ifdef interdata #define NEGBYTE 0200 #define MASK (-1 & ~0377) #define sgetc(p) ( ((p)->rd==(p)->wt) ? EOF :( ((*(p)->rd & NEGBYTE) != 0) ? ( *(p)->rd++ | MASK): *(p)->rd++ )) #define slookc(p) ( ((p)->rd==(p)->wt) ? EOF :( ((*(p)->rd & NEGBYTE) != 0) ? (*(p)->rd | MASK) : *(p)->rd )) #define sbackc(p) ( ((p)->rd==(p)->beg) ? EOF :( ((*(--(p)->rd) & NEGBYTE) != 0) ? (*(p)->rd | MASK): *(p)->rd )) #endif #ifndef interdata #define sgetc(p) (((p)->rd==(p)->wt)?EOF:*(p)->rd++) #define slookc(p) (((p)->rd==(p)->wt)?EOF:*(p)->rd) #define sbackc(p) (((p)->rd==(p)->beg)?EOF:*(--(p)->rd)) #endif #define sputc(p,c) {if((p)->wt==(p)->last)more(p); *(p)->wt++ = c; } #define salterc(p,c) {if((p)->rd==(p)->last)more(p); *(p)->rd++ = c; if((p)->rd>(p)->wt)(p)->wt=(p)->rd;} #define sunputc(p) (*( (p)->rd = --(p)->wt)) #define zero(p) for(pp=(p)->beg;pp<(p)->last;)*pp++='\0' #define OUTC(x) {printf("%c",x); if(--count == 0){printf("\\\n"); count=ll;} } #define TEST2 {if((count -= 2) <=0){printf("\\\n");count=ll;}} #define EMPTY if(stkerr != 0){printf("stack empty\n"); continue; } #define EMPTYR(x) if(stkerr!=0){pushp(x);printf("stack empty\n");continue;} #define EMPTYS if(stkerr != 0){printf("stack empty\n"); return(1);} #define EMPTYSR(x) if(stkerr !=0){printf("stack empty\n");pushp(x);return(1);} #define error(p) {printf(p); continue; } #define errorrt(p) {printf(p); return(1); } struct blk { char *rd; char *wt; char *beg; char *last; }; struct blk *hfree; struct blk *getwd(); struct blk *lookwd(); struct blk *getdec(); struct blk *morehd(); struct blk *arg1, *arg2; int svargc; char savk; char **svargv; int dbg; int ifile; FILE *curfile; struct blk *scalptr, *basptr, *tenptr, *inbas; struct blk *sqtemp, *chptr, *strptr, *divxyz; struct blk *stack[STKSZ]; struct blk **stkptr,**stkbeg; struct blk **stkend; int stkerr; int lastchar; struct blk *readstk[RDSKSZ]; struct blk **readptr; struct blk *rem; int k; struct blk *irem; int skd,skr; struct blk *pop(),*readin(),*add0(),*mult(); struct blk *scalint(); struct blk *removc(); struct blk *add(),*div(),*removr(); struct blk *exp(); struct blk *sqrt(); struct blk *salloc(),*copy(); struct blk *scale(); int neg; struct sym { struct sym *next; struct blk *val; } symlst[TBLSZ]; struct sym *stable[TBLSZ]; struct sym *sptr,*sfree; struct wblk { struct blk **rdw; struct blk **wtw; struct blk **begw; struct blk **lastw; }; FILE *fsave; long rel; long nbytes; long all; long headmor; long obase; int fw,fw1,ll; int (*outdit)(); int bigot(),hexot(); int logo; int log10; int count; char *pp; int (*signal())(); int onintr(); char *malloc(); char *nalloc(); char *realloc(); char *dummy; y(); struct blk *scale(); int neg; struct sym { struct sym *next; struct blk *val; } symlst[TBLSZ]; struct sym *stable[TBLSZ]; struct sym *sptr,*sfree; struct wblk { struct blk **rdw; struct blk **wtw; struct blk **begw; struct blk **lastw; }; FILE *fsave; long rel; long nbytes; long all; long headmor; long obase; int fw,fw1,ll; int (*outdit)(); int bigocmd/diff3/ 775 0 33 0 2552527705 5517 cmd/diff3/Makefile 644 0 33 264 2247130140 7204 CFLAGS=-O -d2 diff3: diff3.o cc -o diff3 diff3.o install: diff3 install -s diff3 $(DESTDIR)/usr/lib install -c diff3.sh $(DESTDIR)/usr/bin/diff3 clean: rm -f diff3.o diff3 a9sym 00000005517m *next; struct blk *val; } symlst[TBLSZ]; struct sym *stable[TBLSZ]; struct sym *sptr,*sfree; struct wblk { struct blk **rdw; struct blk **wtw; struct blk **begw; struct blk **lastw; FILE *fs/ C. /,"cmd/diff3/diff3.c 644 0 33 17456 2263054537 6773 #include # /* diff3 - 3-way differential file comparison*/ /* diff3 [-e] d13 d23 f1 f2 f3 * * d13 = diff report on f1 vs f3 * d23 = diff report on f2 vs f3 * f1, f2, f3 the 3 files */ struct range {int from,to; }; /* from is first in range of changed lines * to is last+1 * from=to=line after point of insertion * for added lines */ struct diff {struct range old, new;}; #define NC 200 /* de is used to gather editing scripts, * that are later spewed out in reverse order. * its first element must be all zero * the "new" component of de contains line positions * or byte positions depending on when you look(!?) */ struct diff d13[NC]; struct diff d23[NC]; struct diff de[NC]; char line[256]; FILE *fp[3]; int linct[3] = {0,0,0}; /* the number of the last-read line in each file * is kept in cline[0-2] */ int cline[3]; /* the latest known correspondence between line * numbers of the 3 files is stored in last[1-3] */ int last[4]; int eflag; int debug = 0; main(argc,argv) char **argv; { register i,m,n; if(*argv[1]=='-') { switch(argv[1][1]) { default: eflag = 3; break; case '3': eflag = 2; break; case 'x': eflag = 1; } argv++; argc--; } if(argc<6) { fprintf(stderr,"diff3: arg count\n"); exit(1); } m = readin(argv[1],d13); n = readin(argv[2],d23); for(i=0;i<=2;i++) if((fp[i] = fopen(argv[i+3],"r")) == NULL) { printf("diff3: can't open %s\n",argv[i+3]); exit(1); } merge(m,n); } /*pick up the line numbers of allcahnges from * one change file * (this puts the numbers in a vector, which is not * strictly necessary, since the vector is processed * in one sequential pass. The vector could be optimized * out of existence) */ readin(name,dd) char *name; struct diff *dd; { register i; int a,b,c,d; char kind; char *p; fp[0] = fopen(name,"r"); for(i=0;getchange(fp[0]);i++) { if(i>=NC) { fprintf(stderr,"diff3: too many changes\n"); exit(0); } p = line; a = b = number(&p); if(*p==',') { p++; b = number(&p); } kind = *p++; c = d = number(&p); if(*p==',') { p++; d = number(&p); } if(kind=='a') a++; if(kind=='d') c++; b++; d++; dd[i].old.from = a; dd[i].old.to = b; dd[i].new.from = c; dd[i].new.to = d; } dd[i].old.from = dd[i-1].old.to; dd[i].new.from = dd[i-1].new.to; fclose(fp[0]); return(i); } number(lc) char **lc; { register nn; nn = 0; while(digit(**lc)) nn = nn*10 + *(*lc)++ - '0'; return(nn); } digit(c) { return(c>='0'&&c<='9'); } getchange(b) FILE *b; { while(getline(b)) if(digit(line[0])) return(1); return(0); } getline(b) FILE *b; { register i, c; for(i=0;iold.from,d1->old.to, d1->new.from,d1->((new.to, d2->old.from,d2->old.to, d2->new.from,d2->new.to); } /* first file is different from others*/ if(!t2||t1&&d1->new.to < d2->new.from) { /* stuff peculiar to 1st file */ if(eflag==0) { separate("1"); change(1,&d1->old,0); keep(2,&d1->old,&d1->new); change(3,&d1->new,0); } d1++; continue; } /* second file is different from others*/ if(!t1||t2&&d2->new.to < d1->new.from) { if(eflag==0) { separate("2"); keep(1,&d2->old,&d2->new); change(2,&d2->old,0); change(3,&d2->new,0); } d2++; continue; } /* merge overlapping changes in first file * this happens after extension see below*/ if(d1+1new.to>=d1[1].new.from) { d1[1].old.from = d1->old.from; d1[1].new.from = d1->new.from; d1++; continue; } /* merge overlapping changes in second*/ if(d2+1new.to>=d2[1].new.from) { d2[1].old.from = d2->old.from; d2[1].new.from = d2->new.from; d2++; continue; } /* stuff peculiar to third file or different in all*/ if(d1->new.from==d2->new.from&& d1->new.to==d2->new.to) { dup = duplicate(&d1->old,&d2->old); /* dup=0 means all files differ * dup =1 meands files 1&2 identical*/ if(eflag==0) { separate(dup?"3":""); change(1,&d1->old,dup); change(2,&d2->old,0); d3 = d1->old.to>d1->old.from?d1:d2; change(3,&d3->new,0); } else j = edit(d1,dup,j); d1++; d2++; continue; } /* overlapping changes from file1 & 2 * extend changes appropriately to * make them coincide*/ if(d1->new.fromnew.from) { d2->old.from -= d2->new.from-d1->new.from; d2->new.from = d1->new.from; } else if(d2->new.fromnew.from) { d1->old.from -= d1->new.from-d2->new.from; d1->new.from = d2->new.from; } if(d1->new.to >d2->new.to) { d2->old.to += d1->new.to - d2->new.to; d2->new.to = d1->new.to; } else if(d2->new.to >d1->new.to) { d1->old.to += d2->new.to - d1->new.to; d1->new.to = d2->new.to; } } if(eflag) edscript(j); } separate(s) char *s; { printf("====%s\n",s); } /* the range of ines rold.from thru rold.to in file i * is to be changed. it is to be printed only if * it does not duplicate something to be printed later */ change(i,rold,dup) struct range *rold; { printf("%d:",i); last[i] = rold->to; prange(rold); if(dup) return; if(debug) return; i--; skip(i,rold->from,(char *)0); skip(i,rold->to," "); } /* print the range of line numbers, rold.from thru rold.to * as n1,n2 or n1 */ prange(rold) struct range *rold; { if(rold->to<=rold->from) printf("%da\n",rold->from-1); else { printf("%d",rold->from); if(rold->to > rold->from+1) printf(",%d",rold->to-1); printf("c\n"); } } /* no difference was reported by diff between file 1(or 2) * and file 3, and an artificial dummy difference (trange) * must be ginned up to correspond to the change reported * in the other file */ keep(i,rold,rnew) struct range *rold, *rnew; { register delta; struct range trange; delta = last[3] - last[i]; trange.from = rnew->from - delta; trange.to = rnew->to - delta; change(i,&trange,1); } /* skip to just befor line number from in file i * if "pr" is nonzero, print all skipped stuff * w with string pr as a prefix */ skip(i,from,pr) char *pr; { register j,n; for(n=0;cline[i]to-r1->from != r2->to-r2->from) return(0); skip(0,r1->from,(char *)0); skip(1,r2->from,(char *)0); nchar = 0; for(nline=0;nlineto-r1->from;nline++) { do { c = getc(fp[0]); d = getc(fp[1]); if(c== -1||d== -1) trouble(); nchar++; if(c!=d) { repos(nchar); return; } } while(c!= '\n'); } repos(nchar); return(1); } repos(nchar) { register i; for(i=0;i<2;i++) fseek(fp[i], (long)-nchar, 1); } trouble() { fprintf(stderr,"diff3: logic error\n"); abort(); } /* collect an editing script for later regurgitation */ edit(diff,dup,j) struct diff *diff; { if(((dup+1)&eflag)==0) return(j); j++; de[j].old.from = diff->old.from; de[j].old.to = diff->old.to; de[j].new.from = de[j-1].new.to +skip(2,diff->new.from,(char *)0); de[j].new.to = de[j].new.from +skip(2,diff->new.to,(char *)0); return(j); } /* regurgitate */ edscript(n) { register j,k; char block[BUFSIZ]; for(n=n;n>0;n--) { prange(&de[n].old); fseek(fp[2], (long)de[n].new.from, 0); for(k=de[n].new.to-de[n].new.from;k>0;k-= j) { j = k>BUFSIZ?BUFSIZ:k; if(fread(block,1,j,fp[2])!=j) trouble(); fwrite(block, 1, j, stdout); } printf(".\n"); } } ld.to = diff->old.to; de[j].new.from = de[j-1].new.to +skip(2,diff->new.from,(char *)0); de[j].new.to = de[j].new.from +skip(2,diff->new.to,(char *)0); return(j); } /* regurgitate */ edscript(n) cmd/diff3/diff3.sh 755 0 33 416 2247130141 7076 e= case $1 in -*) e=$1 shift;; esac if test $# = 3 -a -f $1 -a -f $2 -a -f $3 then : else echo usage: diff3 file1 file2 file3 1>&2 exit fi trap "rm -f /tmp/d3[ab]$$" 0 1 2 13 15 diff $1 $3 >/tmp/d3a$$ diff $2 $3 >/tmp/d3b$$ /usr/lib/diff3 $e /tmp/d3[ab]$$ $1 $2 $3 out); } printf(".\n"); } } ld.to = diff->old.to; de[j].new.from = de[j-1].new.to +skip(2,diff->new.from,(char *)0); de[j].new.to = de[j].n/,5x< /,"cmd/ed/ 775 0 33 0 2552530341 5102 cmd/ed/ed.c 644 0 33 60422 2111463404 5741 /* * Editor */ #include #include #include #define NULL 0 #define FNSIZE 64 #define LBSIZE 512 #define ESIZE 128 #define GBSIZE 256 #define NBRA 5 #define EOF -1 #define KSIZE 9 #define CBRA 1 #define CCHR 2 #define CDOT 4 #define CCL 6 #define NCCL 8 #define CDOL 10 #define CEOF 11 #define CKET 12 #define CBACK 14 #define STAR 01 char Q[] = ""; char T[] = "TMP"; #define READ 0 #define WRITE 1 int peekc; int lastc; char savedfile[FNSIZE]; char file[FNSIZE]; char linebuf[LBSIZE]; char rhsbuf[LBSIZE/2]; char expbuf[ESIZE+4]; int circfl; int *zero; int *dot; int *dol; int *addr1; int *addr2; char genbuf[LBSIZE]; long count; char *nextip; char *linebp; int ninbuf; int io; int pflag; long lseek(); int (*oldhup)(); int (*oldquit)(); int vflag = 1; int xflag; int xtflag; int kflag; char key[KSIZE + 1]; char crbuf[512]; char perm[768]; char tperm[768]; int listf; int col; char *globp; int tfile = -1; int tline; char *tfname; char *loc1; char *loc2; char *locs; char ibuff[512]; int iblock = -1; char obuff[512]; int oblock = -1; int ichanged; int nleft; char WRERR[] = "WRITE ERROR"; int names[26]; int anymarks; char *braslist[NBRA]; char *braelist[NBRA]; int nbra; int subnewa; int subolda; int fchange; int wrapp; unsigned nlall = 128; int *address(); char *getline(); char *getblock(); char *place(); char *mktemp(); char *malloc(); char *realloc(); jmp_buf savej; main(argc, argv) char **argv; { register char *p1, *p2; extern int onintr(), quit(), onhup(); int (*oldintr)(); oldquit = signal(SIGQUIT, SIG_IGN); oldhup = signal(SIGHUP, SIG_IGN); oldintr = signal(SIGINT, SIG_IGN); if ((int)signal(SIGTERM, SIG_IGN) == 0) signal(SIGTERM, quit); argv++; while (argc > 1 && **argv=='-') { switch((*argv)[1]) { case '\0': vflag = 0; break; case 'q': signal(SIGQUIT, SIG_DFL); vflag = 1; break; case 'x': xflag = 1; break; } argv++; argc--; } if(xflag){ getkey(); kflag = crinit(key, perm); } if (argc>1) { p1 = *argv; p2 = savedfile; while (*p2++ = *p1++) ; globp = "r"; } zero = (int *)malloc(nlall*sizeof(int)); tfname = mktemp("/tmp/eXXXXX"); init(); if (((int)oldintr&01) == 0) signal(SIGINT, onintr); if (((int)oldhup&01) == 0) signal(SIGHUP, onhup); setjmp(savej); commands(); quit(); } commands() { int getfile(), gettty(); register *a1, c; for (;;) { if (pflag) { pflag = 0; addr1 = addr2 = dot; goto print; } addr1 = 0; addr2 = 0; do { addr1 = addr2; if ((a1 = address())==0) { c = getchr(); break; } addr2 = a1; if ((c=getchr()) == ';') { c = ','; dot = a1; } } while (c==','); if (addr1==0) addr1 = addr2; switch(c) { case 'a': setdot(); newline(); append(gettty, addr2); continue; case 'c': delete(); append(gettty, addr1-1); continue; case 'd': delete(); continue; case 'E': fchange = 0; c = 'e'; case 'e': setnoaddr(); if (vflag && fchange) { fchange = 0; error(Q); } filename(c); init(); addr2 = zero; goto caseread; case 'f': ((setnoaddr(); filename(c); puts(savedfile); continue; case 'g': global(1); continue; case 'i': setdot(); nonzero(); newline(); append(gettty, addr2-1); continue; case 'j': if (addr2==0) { addr1 = dot; addr2 = dot+1; } setdot(); newline(); nonzero(); join(); continue; case 'k': if ((c = getchr()) < 'a' || c > 'z') error(Q); newline(); setdot(); nonzero(); names[c-'a'] = *addr2 & ~01; anymarks |= 01; continue; case 'm': move(0); continue; case '\n': if (addr2==0) addr2 = dot+1; addr1 = addr2; goto print; case 'l': listf++; case 'p': case 'P': newline(); print: setdot(); nonzero(); a1 = addr1; do { puts(getline(*a1++)); } while (a1 <= addr2); dot = addr2; listf = 0; continue; case 'Q': fchange = 0; case 'q': setnoaddr(); newline(); quit(); case 'r': filename(c); caseread: if ((io = open(file, 0)) < 0) { lastc = '\n'; error(file); } setall(); ninbuf = 0; c = zero != dol; append(getfile, addr2); exfile(); fchange = c; continue; case 's': setdot(); nonzero(); substitute(globp!=0); continue; case 't': move(1); continue; case 'u': setdot(); nonzero(); newline(); if ((*addr2&~01) != subnewa) error(Q); *addr2 = subolda; dot = addr2; continue; case 'v': global(0); continue; case 'W': wrapp++; case 'w': setall(); nonzero(); filename(c); if(!wrapp || ((io = open(file,1)) == -1) || ((lseek(io, 0L, 2)) == -1)) if ((io = creat(file, 0666)) < 0) error(file); wrapp = 0; putfile(); exfile(); if (addr1==zero+1 && addr2==dol) fchange = 0; continue; case 'x': setnoaddr(); newline(); xflag = 1; puts("Entering encrypting mode!"); getkey(); kflag = crinit(key, perm); continue; case '=': setall(); newline(); count = (addr2-zero)&077777; putd(); putchr('\n'); continue; case '!': callunix(); continue; case EOF: return; } error(Q); } } int * address() { register *a1, minus, c; int n, relerr; minus = 0; a1 = 0; for (;;) { c = getchr(); if ('0'<=c && c<='9') { n = 0; do { n *= 10; n += c - '0'; } while ((c = getchr())>='0' && c<='9'); peekc = c; if (a1==0) a1 = zero; if (minus<0) n = -n; a1 += n; minus = 0; continue; } relerr = 0; if (a1 || minus) relerr++; switch(c) { case ' ': case '\t': continue; case '+': minus++; if (a1==0) a1 = dot; continue; case '-': case '^': minus--; if (a1==0) a1 = dot; continue; case '?': case '/': compile(c); a1 = dot; for (;;) { if (c=='/') { a1++; if (a1 > dol) a1 = zero; } else { a1--; if (a1 < zero) a1 = dol; } if (execute(0, a1)) break; if (a1==dot) error(Q); } break; case '$': a1 = dol; break; case '.': a1 = dot; break; case '\'': if ((c = getchr()) < 'a' || c > 'z') error(Q); for (a1=zero; a1<=dol; a1++) if (names[c-'a'] == (*a1 & ~01)) break; break; default: peekc = c; if (a1==0) return(0); a1 += minus; if (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) { if (kflag) crblock(perm, genbuf, ninbuf+1, count); break; } } fp = genbuf; } c = *fp++; if (c=='\0') continue; if (c&0200 || lp >= &linebuf[LBSIZE]) { lastc = '\n'; error(Q); } *lp++ = c; count++; } while (c != '\n'); *--lp = 0; nextip = fp; return(0); } putfile() { int *a1, n; register char *fp, *lp; register nib; nib = 512; fp = genbuf; a1 = addr1; do { lp = getline(*a1++); for (;;) { if (--nib < 0) { n = fp-genbuf; if(kflag) crblock(perm, genbuf, n, count-n); if(write(io, genbuf, n) != n) { puts(WRERR); error(Q); } nib = 511; fp = genbuf; } count++; if ((*fp++ = *lp++) == 0) { fp[-1] = '\n'; break; } } } while (a1 <= addr2); n = fp-genbuf; if(kflag) crblock(perm, genbuf, n, count-n); if(write(io, genbuf, n) != n) { puts(WRERR); error(Q); } } append(f, a) int *a; int (*f)(); { register *a1, *a2, *rdot; int nline, tl; nline = 0; dot = a; while ((*f)() == 0) { if ((dol-zero)+1 >= nlall) { int *ozero = zero; nlall += 512; free((char *)zero); if ((zero = (int *)realloc((char *)zero, nlall*sizeof(int)))==NULL) { lastc = '\n'; zero = ozero; error("MEM?"); } dot += zero - ozero; dol += zero - ozero; } tl = putline(); nline++; a1 = ++dol; a2 = a1+1; rdot = ++dot; while (a1 > rdot) *--a2 = *--a1; *rdot = tl; } return(nline); } callunix() { register (*savint)(), pid, rpid; int retcode; setnoaddr(); if ((pid = fork()) == 0) { signal(SIGHUP, oldhup); signal(SIGQUIT, oldquit); execl("/bin/sh", "sh", "-t", 0); exit(0100); } savint = signal(SIGINT, SIG_IGN); while ((rpid = wait(&retcode)) != pid && rpid != -1) ; signal(SIGINT, savint); puts("!"); } quit() { if (vflag && fchange && dol!=zero) { fchange = 0; error(Q); } unlink(tfname); exit(0); } delete() { setdot(); newline(); nonzero(); rdelete(addr1, addr2); } rdelete(ad1, ad2) int *ad1, *ad2; { register *a1, *a2, *a3; a1 = ad1; a2 = ad2+1; a3 = dol; dol -= a2 - a1; do { *a1++ = *a2++; } while (a2 <= a3); a1 = ad1; if (a1 > dol) a1 = dol; dot = a1; fchange = 1; } gdelete() { register *a1, *a2, *a3; a3 = dol; for (a1=zero+1; (*a1&01)==0; a1++) if (a1>=a3) return; for (a2=a1+1; a2<=a3;) { if (*a2&01) { a2++; dot = a1; } else *a1++ = *a2++; } dol = a1-1; if (dot>dol) dot = dol; fchange = 1; } char * getline(tl) { register char *bp, *lp; register nl; lp = linebuf; bp = getblock(tl, READ); nl = nleft; tl &= ~0377; while (*lp++ = *bp++) if (--nl == 0) { bp = getblock(tl+=0400, READ); nl = nleft; } return(linebuf); } putline() { register char *bp, *lp; register nl; int tl; fchange = 1; lp = linebuf; tl = tline; bp = getblock(tl, WRITE); nl = nleft; tl &= ~0377; while (*bp = *lp++) { if (*bp++ == '\n') { *--bp = 0; linebp = lp; break; } if (--nl == 0) { bp = getblock(tl+=0400, WRITE); nl = nleft; } } nl = tline; tline += (((lp-linebuf)+03)>>1)&077776; return(nl); } char * getblock(atl, iof) { extern read(), write(); register bno, off; register char *p1, *p2; register int n; bno = (atl>>8)&0377; off = (atl<<1)&0774; if (bno >= 255) { lastc = '\n'; error(T); } nleft = 512 - off; if (bno==iblock) { ichanged |= iof; return(ibuff+off); } if (bno==oblock) return(obuff+off); if (iof==READ) { if (ichanged) { if(xtflag) crblock(tperm, ibuff, 512, (long)0); blkio(iblock, ibuff, write); } ichanged = 0; iblock = bno; blkio(bno, ibuff, read); if(xtflag) crblock(tperm, ibuff, 512, (long)0); return(ibuff+off); } if (oblock>=0) { if(xtflag) { p1 = obuff; p2 = crbuf; n = 512; while(n--) *p2++ = *p1++; crblock(tperm, crbuf, 512, (long)0); blkio(oblock, crbuf, write); } else blkio(oblock, obuff, write); } oblock = bno; return(obuff+off); } blkio(b, buf, iofcn) char *buf; int (*iofcn)(); { lseek(tfile, (long)b<<9, 0); if ((*iofcn)(tfile, buf, 512) != 512) { error(T); } } init() { register *markp; close(tfile); tline = 2; for (markp = names; markp < &names[26]; ) *markp++ = 0; subnewa = 0; anymarks = 0; iblock = -1; oblock = -1; ichanged = 0; close(creat(tfname, 0600)); tfile = open(tfname, 2); if(xflag) { xtflag = 1; makekey(key, tperm); } dot = dol = zero; } global(k) (({ register char *gp; register c; register int *a1; char globuf[GBSIZE]; if (globp) error(Q); setall(); nonzero(); if ((c=getchr())=='\n') error(Q); compile(c); gp = globuf; while ((c = getchr()) != '\n') { if (c==EOF) error(Q); if (c=='\\') { c = getchr(); if (c!='\n') *gp++ = '\\'; } *gp++ = c; if (gp >= &globuf[GBSIZE-2]) error(Q); } *gp++ = '\n'; *gp++ = 0; for (a1=zero; a1<=dol; a1++) { *a1 &= ~01; if (a1>=addr1 && a1<=addr2 && execute(0, a1)==k) *a1 |= 01; } /* * Special case: g/.../d (avoid n^2 algorithm) */ if (globuf[0]=='d' && globuf[1]=='\n' && globuf[2]=='\0') { gdelete(); return; } for (a1=zero; a1<=dol; a1++) { if (*a1 & 01) { *a1 &= ~01; dot = a1; globp = globuf; commands(); a1 = zero; } } } join() { register char *gp, *lp; register *a1; gp = genbuf; for (a1=addr1; a1<=addr2; a1++) { lp = getline(*a1); while (*gp = *lp++) if (gp++ >= &genbuf[LBSIZE-2]) error(Q); } lp = linebuf; gp = genbuf; while (*lp++ = *gp++) ; *addr1 = putline(); if (addr1= &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; } crblock(permp, buf, nchar, startn) char *permp; char *buf; long startn; { register char *p1; int n1; int n2; register char *t1, *t2, *t3; t1 = permp; t2 = &permp[256]; t3 = &permp[512]; n1 = startn&0377; n2 = (startn>>8)&0377; p1 = buf; while(nchar--) { *p1 = t2[(t3[(t1[(*p1+n1)&0377]+n2)&0377]-n2)&0377]-n1; n1++; if(n1==256){ n1 = 0; n2++; if(n2==256) n2 = 0; } p1++; } } getkey() { struct sgttyb b; int save; int (*sig)(); register char *p; register c; sig = signal(SIGINT, SIG_IGN); if (gtty(0, &b) == -1) error("Input not tty"); save = b.sg_flags; b.sg_flags &= ~ECHO; stty(0, &b); puts("Key:"); p = key; while(((c=getchr()) != EOF) && (c!='\n')) { if(p < &key[KSIZE]) *p++ = c; } *p = 0; b.sg_flags = save; stty(0, &b); signal(SIGINT, sig); return(key[0] != 0); } /* * Besides initializing the encryption machine, this routine * returns 0 if the key is null, and 1 if it is non-null. */ crinit(keyp, permp) char *keyp, *permp; { register char *t1, *t2, *t3; regist((er i; int ic, k, temp, pf[2]; unsigned random; char buf[13]; long seed; t1 = permp; t2 = &permp[256]; t3 = &permp[512]; if(*keyp == 0) return(0); strncpy(buf, keyp, 8); while (*keyp) *keyp++ = '\0'; buf[8] = buf[0]; buf[9] = buf[1]; if (pipe(pf)<0) pf[0] = pf[1] = -1; if (fork()==0) { close(0); close(1); dup(pf[0]); dup(pf[1]); execl("/usr/lib/makekey", "-", 0); execl("/lib/makekey", "-", 0); exit(1); } write(pf[1], buf, 10); if (wait((int *)NULL)==-1 || read(pf[0], buf, 13)!=13) error("crypt: cannot generate key"); close(pf[0]); close(pf[1]); seed = 123; for (i=0; i<13; i++) seed = seed*buf[i] + i; for(i=0;i<256;i++){ t1[i] = i; t3[i] = 0; } for(i=0; i<256; i++) { seed = 5*seed + buf[i%13]; random = seed % 65521; k = 256-1 - i; ic = (random&0377) % (k+1); random >>= 8; temp = t1[k]; t1[k] = t1[ic]; t1[ic] = temp; if(t3[k]!=0) continue; ic = (random&0377) % k; while(t3[ic]!=0) ic = (ic+1) % k; t3[k] = ic; t3[ic] = k; } for(i=0; i<256; i++) t2[t1[i]&0377] = i; return(1); } makekey(a, b) char *a, *b; { register int i; long t; char temp[KSIZE + 1]; for(i = 0; i < KSIZE; i++) temp[i] = *a++; time(&t); t += getpid(); for(i = 0; i < 4; i++) temp[i] ^= (t>>(8*i))&0377; crinit(temp, b); } 256-1 - i; ic = (random&0377) % (k+1); random >>= 8; temp = t1[k]; t1[k] = t1[ic]; t1[ic] = temp; if(t3[k]!=0) continue; ic = (random&0377) % k; while(t3[ic]!=0) ic = (ic+1) % k; t3[k] = ic; t3[ic] = k; } for(i=0; icmd/ed/makefile 644 0 33 215 2265744105 6651 all: cc -O -d2 ed.c -o ed install: mv ed ${DESTDIR}/bin/ed rm -f ${DESTDIR}/bin/e ln ${DESTDIR}/bin/ed ${DESTDIR}/bin/e clean: rm -f ed < KSIZE; i++) temp[i] = *a++; time(&t); t += getpid(); for(i = 0; i < 4; i++) temp[i] ^= (t>>(8*i))&0377; crinit(temp, b); } 256-1 - i; ic = (random&0377) % (k+1); random >>= 8; temp = t1[k]; t1[k] = t1[ic]; t1[ic] = temp; if(t3[k]!=0) continue; ic = (rand/,5h< /,"cmd/eqn/ 775 0 33 0 2552533170 5300 cmd/eqn/Makefile 644 0 33 1226 2254140152 7015 CFLAGS=-O -d2 YFLAGS=-d SOURCE = e.y e.h diacrit.c eqnbox.c font.c fromto.c funny.c glob.c integral.c \ io.c lex.c lookup.c mark.c matrix.c move.c over.c paren.c \ pile.c shift.c size.c sqrt.c text.c FILES = e.o diacrit.o eqnbox.o font.o fromto.o funny.o glob.o integral.o \ io.o lex.o lookup.o mark.o matrix.o move.o over.o paren.o \ pile.o shift.o size.o sqrt.o text.o eqn: $(FILES) cc $(CFLAGS) $(FILES) -o eqn e.c: e.def e.def: e.y yacc -d e.y mv y.tab.c e.c mv y.tab.h e.def $(FILES): e.h e.def install: eqn install -s eqn $(DESTDIR)/usr/bin clean: rm -f *.o e.c e.def eqn list: pr TODO $(SOURCE) makefile lint: y.tab.c lint -spb *.c ver.c paren.c \ pile.c shift.c size.c sqrt.c text.c FILES = e.o diacrit.o eqnbox.o font.o fromto.o funny.o glob.o integral.o \ io.o lex.o lookup.o mark.o matrix.o move.o over.o paren.o \ pile.o shift.o size.o sqrt.o text.o eqn: $(FILES) cc $(CFLAGS) $(FILES) -o eqn e.c: e.def e.def: e.y yacc -d e.y mv y.tab.c e.c mv y.tab.h e.def $(FILES): e.h e.decmd/eqn/diacrit.c 644 0 33 3247 2111463444 7151 # include "e.h" # include "e.def" diacrit(p1, type) int p1, type; { int c, t, effps; c = oalloc(); t = oalloc(); effps = EFFPS(ps); nrwid(p1, effps, p1); printf(".nr 10 %du\n", VERT(max(eht[p1]-ebase[p1]-6*ps,0))); /* vertical shift if high */ printf(".if \\n(ct>1 .nr 10 \\n(10+\\s%d.25m\\s0\n", effps); printf(".nr %d \\s%d.1m\\s0\n", t, effps); /* horiz shift if high */ printf(".if \\n(ct>1 .nr %d \\s%d.15m\\s0\n", t, effps); switch(type) { case VEC: printf(".ds %d \\v'-.4m'\\s%d\\(->\\s0\\v'.4m'\n", c, max(effps-3, 6)); break; case DYAD: printf(".ds %d \\v'-.4m'\\s%d\\z\\(<-\\(->\\s0\\v'.4m'\n", c, max(effps-3, 6)); break; case HAT: printf(".ds %d ^\n", c); break; case TILDE: printf(".ds %d ~\n", c); break; case DOT: printf(".ds %d \\s%d\\v'-.67m'.\\v'.67m'\\s0\n", c, effps); break; case DOTDOT: printf(".ds %d \\s%d\\v'-.67m'..\\v'.67m\\s0'\n", c, effps); break; case BAR: printf(".ds %d \\s%d\\v'.18m'\\h'.05m'\\l'\\n(%du-.1m\\(rn'\\h'.05m'\\v'-.18m'\\s0\n", c, effps, p1); break; case UNDER: printf(".ds %d \\l'\\n(%du\\(ul'\n", c, p1); printf(".nr %d 0\n", t); printf(".nr 10 0-%d\n", ebase[p1]); break; } nrwid(c, ps, c); if (lfont[p1] != ITAL) printf(".nr %d 0\n", t); printf(".as %d \\h'-\\n(%du-\\n(%du/2u+\\n(%du'\\v'0-\\n(10u'\\*(%d", p1, p1, c, t, c); printf("\\v'\\n(10u'\\h'-\\n(%du+\\n(%du/2u-\\n(%du'\n", c, p1, t); /* BUG - should go to right end of widest */ if (type != UNDER) eht[p1] += VERT( (6*ps*15) / 100); /* 0.15m */ if(dbg)printf(".\tdiacrit: %c over S%d, lf=%c, rf=%c, h=%d,b=%d\n", type, p1, lfont[p1], rfont[p1], eht[p1], ebase[p1]); ofree(c); ofree(t); } p1]); break; } nrwid(c, ps, c); if (lfont[p1] != ITAL) printf(".nr %d 0\n", t); printf(".as %d \\h'-\\n(%du-\\n(%du/2u+\\n(%du'\\v'0-\\n(10u'\\*(%d", p1, p1, c, t, c); printf("\\v'\\n(10u'\\h'-\\n(%du+\\n(%du/2u-\\n(%du'\n", c, p1, t); /* BUG - should go to right end of widest */ if (type != UNDER) eht[p1] += VERT( (6*ps*15) cmd/eqn/e.h 644 0 33 2040 2111463444 5751 #include #define FATAL 1 #define ROM '1' #define ITAL '2' #define BLD '3' #define VERT(n) ((((n)+1)/3)*3) #define EFFPS(p) ((p) >= 6 ? (p) : 6) extern int dbg; extern int ct; extern int lp[]; extern int used[]; /* available registers */ extern int ps; /* dflt init pt size */ extern int deltaps; /* default change in ps */ extern int gsize; /* global size */ extern int gfont; /* global font */ extern int ft; /* dflt font */ extern FILE *curfile; /* current input file */ extern int ifile; /* input file number */ extern int linect; /* line number in current file */ extern int eqline; /* line where eqn started */ extern int svargc; extern char **svargv; extern int eht[]; extern int ebase[]; extern int lfont[]; extern int rfont[]; extern int yyval; extern int *yypv; extern int yylval; extern int eqnreg, eqnht; extern int lefteq, righteq; extern int lastchar; /* last character read by lex */ extern int markline; /* 1 if this EQ/EN contains mark or lineup */ typedef struct s_tbl { char *name; char *defn; struct s_tbl *next; } tbl; t; /* line number in current file */ extern int eqline; /* line where eqn started */ extern int svargc; extern char **svargv; extern int eht[]; extern int ebase[]; extern int lfont[]; extern int rfont[]; extern int yyval; extern int *yypv; extern int yylval; extern int eqnreg, eqnht; extern int lefteq, righteq; extern int lastchar; /* last character read by lex */ extern int markline; /* 1 if this EQ/EN contains mark or lineup */ typedef struct s_tbl { char *name; char *decmd/eqn/e.y 644 0 33 7625 2111463445 6011 %{# #include "e.h" # int fromflg; %} %term CONTIG QTEXT SPACE THIN TAB %term MATRIX LCOL CCOL RCOL COL %term MARK LINEUP %term SUM INT PROD UNION INTER %term LPILE PILE CPILE RPILE ABOVE %term DEFINE TDEFINE NDEFINE DELIM GSIZE GFONT INCLUDE %right FROM TO %left OVER SQRT %right SUP SUB %right SIZE FONT ROMAN ITALIC BOLD FAT %right UP DOWN BACK FWD %left LEFT RIGHT %right DOT DOTDOT HAT TILDE BAR UNDER VEC DYAD %% stuff : eqn { putout($1); } | error { error(!FATAL, "syntax error"); } | { eqnreg = 0; } (( ; eqn : box | eqn box { eqnbox($1, $2, 0); } | eqn lineupbox { eqnbox($1, $2, 1); } | LINEUP { lineup(0); } ; lineupbox: LINEUP box { $$ = $2; lineup(1); } ; matrix : MATRIX { $$ = ct; } ; collist : column | collist column ; column : lcol '{' list '}' { column('L', $1); } | ccol '{' list '}' { column('C', $1); } | rcol '{' list '}' { column('R', $1); } | col '{' list '}' { column('-', $1); } ; lcol : LCOL { $$ = ct++; } ; ccol : CCOL { $$ = ct++; } ; rcol : RCOL { $$ = ct++; } ; col : COL { $$ = ct++; } ; sbox : sup box %prec SUP { $$ = $2; } ; tbox : to box %prec TO { $$ = $2; } | %prec FROM { $$ = 0; } ; box : box OVER box { boverb($1, $3); } | MARK box { mark($2); } | size box %prec SIZE { size($1, $2); } | font box %prec FONT { font($1, $2); } | FAT box { fatbox($2); } | SQRT box { sqrt($2); } | lpile '{' list '}' { lpile('L', $1, ct); ct = $1; } | cpile '{' list '}' { lpile('C', $1, ct); ct = $1; } | rpile '{' list '}' { lpile('R', $1, ct); ct = $1; } | pile '{' list '}' { lpile('-', $1, ct); ct = $1; } | box sub box sbox %prec SUB { shift2($1, $3, $4); } | box sub box %prec SUB { bshiftb($1, $2, $3); } | box sup box %prec SUP { bshiftb($1, $2, $3); } | int sub box sbox %prec SUB { integral($1, $3, $4); } | int sub box %prec SUB { integral($1, $3, 0); } | int sup box %prec SUP { integral($1, 0, $3); } | int { integral($1, 0, 0); } | left eqn right { paren($1, $2, $3); } | pbox | box from box tbox %prec FROM { fromto($1, $3, $4); fromflg=0; } | box to box %prec TO { fromto($1, 0, $3); } | box diacrit { diacrit($1, $2); } | fwd box %prec UP { move(FWD, $1, $2); } | up box %prec UP { move(UP, $1, $2); } | back box %prec UP { move(BACK, $1, $2); } | down box %prec UP { move(DOWN, $1, $2); } | matrix '{' collist '}' { matrix($1); } ; int : INT { setintegral(); } ; fwd : FWD text { $$ = atoi((char *) $1); } ; up : UP text { $$ = atoi((char *) $1); } ; back : BACK text { $$ = atoi((char *) $1); } ; down : DOWN text { $$ = atoi((char *) $1); } ; diacrit : HAT { $$ = HAT; } | VEC { $$ = VEC; } | DYAD { $$ = DYAD; } | BAR { $$ = BAR; } | UNDER { $$ = UNDER; } /* under bar */ | DOT { $$ = DOT; } | TILDE { $$ = TILDE; } | DOTDOT { $$ = DOTDOT; } /* umlaut = double dot */ ; from : FROM { $$=ps; ps -= 3; fromflg = 1; if(dbg)printf(".\tfrom: old ps %d, new ps %d, fflg %d\n", $$, ps, fromflg); } ; to : TO { $$=ps; if(fromflg==0)ps -= 3; if(dbg)printf(".\tto: old ps %d, new ps %d\n", $$, ps); } ; left : LEFT text { $$ = ((char *)$2)[0]; } | LEFT '{' { $$ = '{'; } ; right : RIGHT text { $$ = ((char *)$2)[0]; } | RIGHT '}' { $$ = '}'; } | { $$ = 0; } ; list : eqn { lp[ct++] = $1; } | list ABOVE eqn { lp[ct++] = $3; } ; lpile : LPILE { $$ = ct; } ; cpile : CPILE { $$ = ct; } ; pile : PILE { $$ = ct; } ; rpile : RPILE { $$ = ct; } ; size : SIZE text { $$ = ps; setsize((char *) $2); } ; font : ROMAN { setfont(ROM); } | ITALIC { setfont(ITAL); } | BOLD { setfont(BLD); } | FONT text { setfont(((char *)$2)[0]); } ; sub : SUB { shift(SUB); } ; sup : SUP { shift(SUP); } ; pbox : '{' eqn '}' { $$ = $2; } | QTEXT { text(QTEXT, (char *) $1); } | CONTIG { text(CONTIG, (char *) $1); } | SPACE { text(SPACE, 0); } | THIN { text(THIN, 0); } | TAB { text(TAB, 0); } | SUM { funny(SUM); } | PROD { funny(PROD); } | UNION { funny(UNION); } | INTER { funny(INTER); } /* intersection */ ; text : CONTIG | QTEXT ; %% IC { setfont(ITAL); } | BOLD { setfont(BLD); } | FONT text { setfont(((char *)$2)[0]); } ; sub : SUB {cmd/eqn/eqnbox.c 644 0 33 1067 2111463445 7025 # include "e.h" eqnbox(p1, p2, lu) { int b, h; char *sh; yyval = p1; b = max(ebase[p1], ebase[p2]); eht[yyval] = h = b + max(eht[p1]-ebase[p1], eht[p2]-ebase[p2]); ebase[yyval] = b; if(dbg)printf(".\te:eb: S%d <- S%d S%d; b=%d, h=%d\n", yyval, p1, p2, b, h); if (rfont[p1] == ITAL && lfont[p2] == ROM) sh = "\\|"; else sh = ""; if (lu) { printf(".nr %d \\w'\\s%d\\*(%d%s'\n", p1, ps, p1, sh); printf(".ds %d \\h'|\\n(97u-\\n(%du'\\*(%d\n", p1, p1, p1); } printf(".as %d \"%s\\*(%d\n", yyval, sh, p2); rfont[p1] = rfont[p2]; ofree(p2); } *sh; yyval = p1; b = max(ebase[p1], ebase[p2]); eht[yyval] = h = b + max(eht[p1]-ebase[p1], eht[p2]-ebase[p2]); ebase[yyval] = b; if(dbg)printf(".\te:eb: S%d <- S%d S%d; b=%d, h=%d\n", yyval, p1, p2, b, h); if (rfont[p1] == ITAL && lfont[p2] == ROM) sh = "\\|"; else sh = ""; if (lu) { printf(".nr %d \\w'\\s%d\\*(%d%s'\n", p1, ps, p1, sh); printf(".ds %d \\h'|\\n(97u-\\n(%du'\\*(%d\n", p1, p1, p1); } printf(".as %d \"%s\\*(%d\n",cmd/eqn/font.c 644 0 33 2254 2111463445 6476 # include "e.h" setfont(ch1) char ch1; { /* use number '1', '2', '3' for roman, italic, bold */ yyval = ft; if (ch1 == 'r' || ch1 == 'R') ft = ROM; else if (ch1 == 'i' || ch1 == 'I') ft = ITAL; else if (ch1 == 'b' || ch1 == 'B') ft = BLD; else ft = ch1; printf(".ft %c\n", ft); if(dbg)printf(".\tsetfont %c %c\n", ch1, ft); } font(p1, p2) int p1, p2; { /* old font in p1, new in ft */ yyval = p2; lfont[yyval] = rfont[yyval] = ft==ITAL ? ITAL : ROM; if(dbg)printf(".\tb:fb: S%d <- \\f%c S%d \\f%c b=%d,h=%d,lf=%c,rf=%c\n", yyval, ft, p2, p1, ebase[yyval], eht[yyval], lfont[yyval], rfont[yyval]); printf(".ds %d \\f%c\\*(%d\\f%c\n", yyval, ft, p2, p1); ft = p1; printf(".ft %c\n", ft); } fatbox(p) int p; { int sh; yyval = p; sh = ps / 4; nrwid(p, ps, p); printf(".ds %d \\*(%d\\h'-\\n(%du+%du'\\*(%d\n", p, p, p, sh, p); if(dbg)printf(".\tfat %d, sh=%d\n", p, sh); } globfont() { char temp[20]; getstr(temp, 20); yyval = eqnreg = 0; gfont = temp[0]; switch (gfont) { case 'r': case 'R': gfont = '1'; break; case 'i': case 'I': gfont = '2'; break; case 'b': case 'B': gfont = '3'; break; } printf(".ft %c\n", gfont); ft = gfont; } ft = p1; printf(".ft %c\n", ft); } fatbox(p) int p; { int sh; yyval = p; sh = ps / 4; nrwid(p, ps, p); printf(".ds %d \\*(%d\\h'-\\n(%du+%du'\\*(%d\n", p, p, p, sh, p); if(dbg)printf(".\tfat %d, sh=%d\n", p, sh); } globfont() { char temp[20]; getstr(temp, 20); yyval = eqnreg = 0; gfont = temp[0]; switch (gfont) { case 'r'cmd/eqn/fromto.c 644 0 33 2470 2111463445 7036 # include "e.h" fromto(p1, p2, p3) int p1, p2, p3; { int b, h1, b1, pss; yyval = oalloc(); lfont[yyval] = rfont[yyval] = 0; h1 = eht[yyval] = eht[p1]; b1 = ebase[p1]; b = 0; pss = EFFPS(ps); ps += 3; nrwid(p1, ps, p1); printf(".nr %d \\n(%d\n", yyval, p1); if( p2>0 ) { nrwid(p2, pss, p2); printf(".if \\n(%d>\\n(%d .nr %d \\n(%d\n", p2, yyval, yyval, p2); eht[yyval] += eht[p2]; b = eht[p2]; } if( p3>0 ) { nrwid(p3, pss, p3); printf(".if \\n(%d>\\n(%d .nr %d \\n(%d\n", p3, yyval, yyval, p3); eht[yyval] += eht[p3]; } printf(".ds %d ", yyval); /* bottom of middle box */ if( p2>0 ) { printf("\\v'%du'\\h'\\n(%du-\\n(%du/2u'\\s%d\\*(%d\\s%d", eht[p2]-ebase[p2]+b1, yyval, p2, pss, p2, EFFPS(ps)); printf("\\h'-\\n(%du-\\n(%du/2u'\\v'%du'\\\n", yyval, p2, -(eht[p2]-ebase[p2]+b1)); } printf("\\h'\\n(%du-\\n(%du/2u'\\*(%d\\h'\\n(%du-\\n(%du/2u'\\\n", yyval, p1, p1, yyval, p1); if( p3>0 ) { printf("\\v'%du'\\h'-\\n(%du-\\n(%du/2u'\\s%d\\*(%d\\s%d\\h'\\n(%du-\\n(%du/2u'\\v'%du'\\\n", -(h1-b1+ebase[p3]), yyval, p3, pss, p3, EFFPS(ps), yyval, p3, (h1-b1+ebase[p3])); } printf("\n"); ebase[yyval] = b + b1; if(dbg)printf(".\tfrom to: S%d <- %d f %d t %d; h=%d b=%d\n", yyval, p1, p2, p3, eht[yyval], ebase[yyval]); ofree(p1); if( p2>0 ) ofree(p2); if( p3>0 ) ofree(p3); } } printf("\\h'\\n(%du-\\n(%du/2u'\\*(%d\\h'\\n(%du-\\n(%du/2u'\\\n", yyval, p1, p1, yyval, p1); if( p3>0 ) { printf("\\v'%du'\\h'-\\n(%du-\\n(%du/2u'\\s%d\\*(%d\\s%d\\h'\\n(%du-\\n(%du/2u'\\vcmd/eqn/funny.c 644 0 33 1130 2111463445 6657 # include "e.h" # include "e.def" funny(n) int n; { char *f; yyval = oalloc(); switch(n) { case SUM: f = "\\(*S"; break; case UNION: f = "\\(cu"; break; case INTER: /* intersection */ f = "\\(ca"; break; case PROD: f = "\\(*P"; break; default: error(FATAL, "funny type %d in funny", n); } printf(".ds %d \\s%d\\v'.3m'\\s+5%s\\s-5\\v'-.3m'\\s%d\n", yyval, ps, f, ps); eht[yyval] = VERT( (ps+5)*6 -(ps*6*2)/10 ); ebase[yyval] = VERT( (ps*6*3)/10 ); if(dbg)printf(".\tfunny: S%d <- %s; h=%d(( b=%d\n", yyval, f, eht[yyval], ebase[yyval]); lfont[yyval] = rfont[yyval] = ROM; } ch(n) { case SUM: f = "\\(*S"; break; case UNION: f = "\\(cu"; break; case INTER: /* intersection */ f = "\\(ca"; break; case PROD: f = "\\(*P"; break; default: error(FATAL, "funny type %d in funny", n); } printf(".ds %d \\s%d\\v'.3m'\\s+5%s\\s-5\\v'-.3m'\\s%d\n", yyval, ps, f, ps); eht[yyval] = VERT( (ps+5)*6 -(ps*6*2)/10 ); ebase[yyval] = VERT( (ps*6*3)/10 ); if(dbg)printf(".\tfunny: S%d <- %s; h=%dcmd/eqn/glob.c 644 0 33 1603 2111463445 6450 #include "e.h" int dbg; /* debugging print if non-zero */ int lp[80]; /* stack for things like piles and matrices */ int ct; /* pointer to lp */ int used[100]; /* available registers */ int ps; /* default init point size */ int deltaps = 3; /* default change in ps */ int gsize = 10; /* default initial point size */ int gfont = ITAL; /* italic */ int ft; /* default font */ FILE *curfile; /* current input file */ int ifile; int linect; /* line number in file */ int eqline; /* line where eqn started */ int svargc; char **svargv; int eht[100]; int ebase[100]; int lfont[100]; int rfont[100]; int eqnreg; /* register where final string appears */ int eqnht; /* inal height of equation */ int lefteq = '\0'; /* left in-line delimiter */ int righteq = '\0'; /* right in-line delimiter */ int lastchar; /* last character read by lex */ int markline = 0; /* 1 if this EQ/EN contains mark or lineup */ le; /* current input file */ int ifile; int linect; /* line number in file */ int eqline; /* line where eqn started */ int svcmd/eqn/integral.c 644 0 33 1261 2111463445 7332 # include "e.h" # include "e.def" integral(p, p1, p2) { if (p1 != 0) printf(".ds %d \\h'-0.4m'\\v'0.4m'\\*(%d\\v'-0.4m'\n", p1, p1); if (p2 != 0) printf(".ds %d \\v'-0.3m'\\*(%d\\v'0.3m'\n", p2, p2); if (p1 != 0 && p2 != 0) shift2(p, p1, p2); else if (p1 != 0) bshiftb(p, SUB, p1); else if (p2 != 0) bshiftb(p, SUP, p2); if(dbg)printf(".\tintegral: S%d; h=%d b=%d\n", p, eht[p], ebase[p]); lfont[p] = ROM; } setintegral() { char *f; yyval = oalloc(); f = "\\(is"; printf(".ds %d \\s%d\\v'.1m'\\s+4%s\\s-4\\v'-.1m'\\s%d\n", yyval, ps, f, ps); eht[yyval] = VERT( (((ps+4)*12)/10)*6 ); ebase[yyval] = VERT( (ps*6*3)/10 ); lfont[yyval] = rfont[yyval] = ROM; } '\\*(%d\\v'0.3m'\n", p2, p2); if (p1 != 0 && p2 != 0) shift2(p, p1, p2); else if (p1 != 0) bshiftb(p, SUB, p1); else if (p2 != 0) bshiftb(p, SUP, p2); if(dbg)printf(".\tintegral: S%d; h=%d b=%d\n", p, eht[p], ebase[p]); lfont[p] = ROM; } setintegral() { char *f; yyval = oalloc(); f = "\\(is"; printf(".ds %d \\s%d\cmd/eqn/io.c 644 0 33 10126 2111463445 6154 # include "e.h" #define MAXLINE 1200 /* maximum input line */ char in[MAXLINE]; /* input buffer */ int eqnexit(); int noeqn; main(argc,argv) int argc; char *argv[];{ eqnexit(eqn(argc, argv)); } eqnexit(n) { #ifdef gcos if (n) fprintf(stderr, "run terminated due to eqn error\n"); exit(0); #endif exit(n); } eqn(argc,argv) int argc; char *argv[];{ int i, type; setfile(argc,argv); init_tbl(); /* install keywords in tables */ while ((type=getline(in)) != EOF) { eqline = linect; if (in[0]=='.' && in[1]=='E' && in[2]=='Q') { for (i=11; i<100; used[i++]=0); printf("%s",in); printf(".nr 99 \\n(.s\n.nr 98 \\n(.f\n"); markline = 0; init(); yyparse(); if (eqnreg>0) { printf(".nr %d \\w'\\*(%d'\n", eqnreg, eqnreg); /* printf(".if \\n(%d>\\n(.l .tm too-long eqn, file %s, between lines %d-%d\n", */ /* eqnreg, svargv[ifile], eqline, linect); */ printf(".nr MK %d\n", markline); /* for -ms macros */ printf(".if %d>\\n(.v .ne %du\n", eqnht, eqnht); printf(".rn %d 10\n", eqnreg); if(!noeqn)printf("\\*(10\n"); } printf(".ps \\n(99\n.ft \\n(98\n"); printf(".EN"); if (lastchar == EOF) { putchar('\n'); break; } if (putchar(lastchar) != '\n') while (putchar(gtc()) != '\n'); } else if (type == lefteq) inline(); else printf("%s",in); } return(0); } getline(s) register char *s; { register c; while((*s++=c=gtc())!='\n' && c!=EOF && c!=lefteq) if (s >= in+MAXLINE) { error( !FATAL, "input line too long: %.20s\n", in); in[MAXLINE] = '\0'; break; } if (c==lefteq) s--; *s++ = '\0'; return(c); } inline() { int ds; printf(".nr 99 \\n(.s\n.nr 98 \\n(.f\n"); ds = oalloc(); printf(".rm %d \n", ds); do{ if (*in) printf(".as %d \"%s\n", ds, in); init(); yyparse(); if (eqnreg > 0) { printf(".as %d \\*(%d\n", ds, eqnreg); ofree(eqnreg); } printf(".ps \\n(99\n.ft \\n(98\n"); } while (getline(in) == lefteq); if (*in) printf(".as %d \"%s", ds, in); printf(".ps \\n(99\n.ft \\n(98\n"); printf("\\*(%d\n", ds); ofree(ds); } putout(p1) int p1; { extern int gsize, gfont; int before, after; if(dbg)printf(".\tanswer <- S%d, h=%d,b=%d\n",p1, eht[p1], ebase[p1]); eqnht = eht[p1]; printf(".ds %d \\x'0'", p1); /* suppposed to leave room for a subscript or superscript */ before = eht[p1] - ebase[p1] - VERT((ps*6*12)/10); if (before > 0) printf("\\x'0-%du'", before); printf("\\f%c\\s%d\\*(%d%s\\s\\n(99\\f\\n(98", gfont, gsize, p1, rfont[p1] == ITAL ? "\\|" : ""); after = ebase[p1] - VERT((ps*6*2)/10); if (after > 0) printf("\\x'%du'", after); putchar('\n'); eqnreg = p1; } max(i,j) int i,j; { return (i>j ? i : j); } oalloc() { int i; for (i=11; i<100; i++) if (used[i]++ == 0) return(i); error( FATAL, "no eqn strings left", i); return(0); } ofree(n) int n; { used[n] = 0; } setps(p) int p; { printf(".ps %d\n", EFFPS(p)); } nrwid(n1, p, n2) int n1, p, n2; { printf(".nr %d \\w'\\s%d\\*(%d'\n", n1, EFFPS(p), n2); } setfile(argc, argv) int argc; char *argv[]; { static char *nullstr = "-"; svargc = --argc; svargv = argv; while (svargc > 0 && svargv[1][0] == '-') { switch (svargv[1][1]) { case 'd': lefteq=svargv[1][2]; righteq=svargv[1][3]; break; case 's': gsize = atoi(&svargv[1][2]); break; case 'p': deltaps = atoi(&svargv[1][2]); break; case 'f': gfont = svargv[1][2]; break; case 'e': noeqn++; break; default: dbg = 1; } svargc--; svargv++; } ifile = 1; linect = 1; if (svargc <= 0) { curfile = stdin; svargv[1] = nullstr; } else if ((curfile = fopen(svargv[1], "r")) == NULL) error( FATAL,"can't open file %s", svargv[1]); } yyerror() {;} init() { ct = 0; ps = gsize; ft = gfont; setps(ps); printf(".ft %c\n", ft); } error(fatal, s1, s2) int fatal; char *s1, *s2; { if (fatal>0) printf("eqn fatal error: "); printf(s1,s2); printf("\nfile %s, between lines %d and %d\n", svargv[ifile], eqline, linect); fprintf(stderr, "eqn: "); if (fatal>0) fprintf(stderr, "fatal error: "); fprintf(stderr, s1, s2); fprintf(stderr, "\nfile %s, between lines %d and %d\n", svargv[ifile], eqline, linect); if (fatal > 0) eqnexit(1); } () {;} init() { ct = 0; ps = gsize; ft = gfont; setps(ps); printf(".ft %c\n", ft); } error(fatal, s1, s2) int fatal; char *s1, *s2; { if (fatal>0) printf("eqn fatal error: "); printf(s1,s2); printf("\nfile %s, between lines %d and %d\n", svargv[ifile], eqline, linect); fprintf(stderr, "eqn: "); if (fatal>0) fprintf(stderr, "fatal error: "); fprintf(stderr, s1, s2); fprintf(stderr, "\nfile %s, between lcmd/eqn/lex.c 644 0 33 10240 2111463445 6332 #include "e.h" #include "e.def" #define SSIZE 400 char token[SSIZE]; int sp; #define putbak(c) *ip++ = c; #define PUSHBACK 300 /* maximum pushback characters */ char ibuf[PUSHBACK+SSIZE]; /* pushback buffer for definitions, etc. */ char *ip = ibuf; gtc() { loop: if (ip > ibuf) return(*--ip); /* already present */ lastchar = getc(curfile); if (lastchar=='\n') linect++; if (lastchar != EOF) return(lastchar); if (++ifile > svargc) { return(EOF); } fclose(curfile); linect = 1; if ((curfile=fopen(svargv[ifile], "r")) != NULL) goto loop; error(FATAL, "can't open file %s", svargv[ifile]); return(EOF); } pbstr(str) register char *str; { register char *p; p = str; while (*p++); --p; if (ip >= &ibuf[PUSHBACK]) error( FATAL, "pushback overflow"); while (p > str) putbak(*--p); } yylex() { register int c; tbl *tp, *lookup(); extern tbl **keytbl, **deftbl; beg: while ((c=gtc())==' ' || c=='\n') ; yylval=c; switch(c) { case EOF: return(EOF); case '~': return(SPACE); c((ase '^': return(THIN); case '\t': return(TAB); case '{': return('{'); case '}': return('}'); case '"': for (sp=0; (c=gtc())!='"' && c != '\n'; ) { if (c == '\\') if ((c = gtc()) != '"') token[sp++] = '\\'; token[sp++] = c; if (sp>=SSIZE) error(FATAL, "quoted string %.20s... too long", token); } token[sp]='\0'; yylval = (int) &token[0]; if (c == '\n') error(!FATAL, "missing \" in %.20s", token); return(QTEXT); } if (c==righteq) return(EOF); putbak(c); getstr(token, SSIZE); if (dbg)printf(".\tlex token = |%s|\n", token); if ((tp = lookup(&deftbl, token, NULL)) != NULL) { putbak(' '); pbstr(tp->defn); putbak(' '); if (dbg) printf(".\tfound %s|=%s|\n", token, tp->defn); } else if ((tp = lookup(&keytbl, token, NULL)) == NULL) { if(dbg)printf(".\t%s is not a keyword\n", token); return(CONTIG); } else if (tp->defn == (char *) DEFINE || tp->defn == (char *) NDEFINE || tp->defn == (char *) TDEFINE) define(tp->defn); else if (tp->defn == (char *) DELIM) delim(); else if (tp->defn == (char *) GSIZE) globsize(); else if (tp->defn == (char *) GFONT) globfont(); else if (tp->defn == (char *) INCLUDE) include(); else { return((int) tp->defn); } goto beg; } getstr(s, n) char *s; register int n; { register int c; register char *p; p = s; while ((c = gtc()) == ' ' || c == '\n') ; if (c == EOF) { *s = 0; return; } while (c != ' ' && c != '\t' && c != '\n' && c != '{' && c != '}' && c != '"' && c != '~' && c != '^' && c != righteq) { if (c == '\\') if ((c = gtc()) != '"') *p++ = '\\'; *p++ = c; if (--n <= 0) error(FATAL, "token %.20s... too long", s); c = gtc(); } if (c=='{' || c=='}' || c=='"' || c=='~' || c=='^' || c=='\t' || c==righteq) putbak(c); *p = '\0'; yylval = (int) s; } cstr(s, quote, maxs) char *s; int quote; { int del, c, i; while((del=gtc()) == ' ' || del == '\t' || del == '\n'); if (quote) for (i=0; (c=gtc()) != del && c != EOF;) { s[i++] = c; if (i >= maxs) return(1); /* disaster */ } else { s[0] = del; for (i=1; (c=gtc())!=' ' && c!= '\t' && c!='\n' && c!=EOF;) { s[i++]=c; if (i >= maxs) return(1); /* disaster */ } } s[i] = '\0'; if (c == EOF) error(FATAL, "Unexpected end of input at %.20s", s); return(0); } define(type) int type; { char *strsave(), *p1, *p2; tbl *lookup(); extern tbl **deftbl; getstr(token, SSIZE); /* get name */ if (type != DEFINE) { cstr(token, 1, SSIZE); /* skip the definition too */ return; } p1 = strsave(token); if (cstr(token, 1, SSIZE)) error(FATAL, "Unterminated definition at %.20s", token); p2 = strsave(token); lookup(&deftbl, p1, p2); if (dbg)printf(".\tname %s defined as %s\n", p1, p2); } char *strsave(s) char *s; { char *malloc(); register char *q; q = malloc(strlen(s)+1); if (q == NULL) error(FATAL, "out of space in strsave on %s", s); strcpy(q, s); return(q); } include() { error(!FATAL, "Include not yet implemented"); } delim() { yyval = eqnreg = 0; if (cstr(token, 0, SSIZE)) error(FATAL, "Bizarre delimiters at %.20s", token); lefteq = token[0]; righteq = token[1]; if (lefteq == 'o' && righteq == 'f') lefteq = righteq = '\0'; } \tname %s defined as %s\n", p1, p2); } char *strsave(s) char *s; { char *malloc(); register char *q; q = malloc(strlen(s)+1); if (q == NULL) error(FATAL, "out of space in strsave on %s", s); strcpy(q, s); return(q); } include() { error(!FATAL, "Include not yet implemented"); } delim() { yyval = eqnreg = 0; if (cstr(token, 0, SSIZE)) cmd/eqn/lookup.c 644 0 33 10230 2346232762 7060 # include "e.h" #include "e.def" #define TBLSIZE 100 tbl *keytbl[TBLSIZE]; /* key words */ tbl *restbl[TBLSIZE]; /* reserved words */ tbl *deftbl[TBLSIZE]; /* user-defined names */ struct { char *key; int keyval; } keyword[] ={ "sub", SUB, "sup", SUP, ".EN", EOF, "from", FROM, "to", TO, "sum", SUM, "hat", HAT, "vec", VEC, "dyad", DYAD, "dot", DOT, "dotdot", DOTDOT, "bar", BAR, "tilde", TILDE, "under", UNDER, "prod", PROD, "int", INT, "integral", INT, "union", UNION, "inter", INTER, "pile", PILE, "lpile", LPILE, "cpile", CPILE, "rpile", RPILE, "over", OVER, "sqrt", SQRT, "above", ABOVE, "size", SIZE, "font", FONT, "fat", FAT, "roman", ROMAN, "italic", ITALIC, "bold", BOLD, "left", LEFT, "right", RIGHT, "delim", DELIM, "define", DEFINE, #ifdef NEQN /* make ndefine synonym for define, tdefine a no-op */ "tdefine", TDEFINE, "ndefine", DEFINE, #else /* tdefine = define, ndefine = no-op */ "tdefine", DEFINE, "ndefine", NDEFINE, #endif "gsize", GSIZE, ".gsize", GSIZE, "gfont", GFONT, "include", INCLUDE, "up", UP, "down", DOWN, "fwd", FWD, "back", BACK, "mark", MARK, "lineup", LINEUP, "matrix", MATRIX, "col", COL, "lcol", LCOL, "ccol", CCOL, "rcol", RCOL, 0, 0 }; struct { char *res; char *resval; } resword[] ={ ">=", "\\(>=", "<=", "\\(<=", "==", "\\(==", "!=", "\\(!=", "+-", "\\(+-", "->", "\\(->", "<-", "\\(<-", "inf", "\\(if", "infinity", "\\(if", "partial", "\\(pd", "half", "\\f1\\(12\\fP", "prime", "\\f1\\(fm\\fP", "dollar", "\\f1$\\fP", "nothing", "", "times", "\\(mu", "del", "\\(gr", "grad", "\\(gr", #ifdef NEQN "<<", "<<", ">>", ">>", "approx", "~\b\\d~\\u", "cdot", "\\v'-.5'.\\v'.5'", "...", "...", ",...,", ",...,", #else "<<", "<\\h'-.3m'<", ">>", ">\\h'-.3m'>", "approx", "\\v'-.2m'\\z\\(ap\\v'.25m'\\(ap\\v'-.05m'", "cdot", "\\v'-.3m'.\\v'.3m'", "...", "\\v'-.3m'\\ .\\ .\\ .\\ \\v'.3m'", ",...,", ",\\ .\\ .\\ .\\ ,\\|", #endif "alpha", "\\(*a", "beta", "\\(*b", "gamma", "\\(*g", "GAMMA", "\\(*G", "delta", "\\(*d", "DELTA", "\\(*D", "epsilon", "\\(*e", "EPSILON", "\\f1E\\fP", "omega", "\\(*w", "OMEGA", "\\(*W", "lambda", "\\(*l", "LAMBDA", "\\(*L", "mu", "\\(*m", "nu", "\\(*n", "theta", "\\(*h", "THETA", "\\(*H", "phi", "\\(*f", "PHI", "\\(*F", "pi", "\\(*p", "PI", "\\(*P", "sigma", "\\(*s", "SIGMA", "\\(*S", "xi", "\\(*c", "XI", "\\(*C", "zeta", "\\(*z", "iota", "\\(*i", "eta", "\\(*y", "kappa", "\\(*k", "rho", "\\(*r", "tau", "\\(*t", "omicron", "\\(*o", "upsilon", "\\(*u", "UPSILON", "\\(*U", "psi", "\\(*q", "PSI", "\\(*Q", "chi", "\\(*x", "and", "\\f1and\\fP", "for", "\\f1for\\fP", "if", "\\f1if\\fP", "Re", "\\f1Re\\fP", "Im", "\\f1Im\\fP", "sin", "\\f1sin\\fP", "cos", "\\f1cos\\fP", "tan", "\\f1tan\\fP", "sec", "\\f1sec\\fP", "csc", "\\f1csc\\fP", "arc", "\\f1arc\\fP", "asin", "\\f1asin\\fP", "acos", "\\f1acos\\fP", "atan", "\\f1atan\\fP", "asec", "\\f1asec\\fP", "acsc", "\\f1acsc\\fP", "sinh", "\\f1sinh\\fP", "coth", "\\f1coth\\fP", "tanh", "\\f1tanh\\fP", "cosh", "\\f1cosh\\fP", "lim", "\\f1lim\\fP", "log", "\\f1log\\fP", "max", "\\f1max\\fP", "min", "\\f1min\\fP", "ln", "\\f1ln\\fP", "exp", "\\f1exp\\fP", "det", "\\f1det\\fP", 0, 0 }; tbl *lookup(tblp, name, defn) /* find name in tbl. if defn non-null, install */ tbl **tblp; char *name, *defn; { register tbl *p; register int h; register char *s = name; char *malloc(); for (h = 0; *s != '\0'; ) h += *s++; h %= TBLSIZE; for (p = tblp[h]; p != NULL; p = p->next) if (strcmp(name, p->name) == 0) { /* found it */ if (defn != NULL) p->defn = defn; return(p); } /* didn't find it */ if (defn == NULL) return(NULL); p = (tbl *) malloc(sizeof (tbl)); if (p == NULL) error(FATAL, "out of space in lookup"); p->name = name; p->defn = defn; p->next = tblp[h]; tblp[h] = p; return(p); } init_tbl() /* initialize all tables */ { int i; for (i = 0; keyword[i].key != NULL; i++) lookup(keytbl, keyword[i].key, keyword[i].keyval); for (i = 0; resword[i].res != NULL; i++) lookup(restbl, resword[i].res, resword[i].resval); } p->defn = defn; return(p); } /* didn't find it */ if (defn == NULL) return(NULL); p = (tbl *) malloc(sizeof (tbl)); if (p == NULL) error(FATAL, "out of space in lookup"); p->name = name; p->defn = defn; p->next = tblp[h]; tblp[h] = p; return(p); } init_tbl() /* initialize all tables */ { int i; for (i = 0; keyword[i].key != NULL; i++cmd/eqn/mark.c 644 0 33 446 2111463445 6443 #include "e.h" mark(p1) int p1; { markline = 1; printf(".ds %d \\k(97\\*(%d\n", p1, p1); yyval = p1; if(dbg)printf(".\tmark %d\n", p1); } lineup(p1) { markline = 1; if (p1 == 0) { yyval = oalloc(); printf(".ds %d \\h'|\\n(97u'\n", yyval); } if(dbg)printf(".\tlineup %d\n", p1); } L) error(FATAL, "out of space in lookup"); p->name = name; p->defn = defn; p->next = tblp[h]; tblp[h] = p; return(p); }/,5(< /,"cmd/eqn/matrix.c 644 0 33 2442 2111463445 7033 ((#include "e.h" column(type, p1) int type, p1; { int i; lp[p1] = ct - p1 - 1; if( dbg ){ printf(".\t%d column of", type); for( i=p1+1; i\\n(%d .nr %d \\n(%d\n", p2, treg, treg, p2); printf(".nr %d \\n(%d+\\s%d.5m\\s0\n", treg, treg, EFFPS(ps)); printf(".ds %d \\v'%du'\\h'\\n(%du-\\n(%du/2u'\\*(%d\\\n", yyval, eht[p2]-ebase[p2]-d, treg, p2, p2); printf("\\h'-\\n(%du-\\n(%du/2u'\\v'%du'\\*(%d\\\n", p2, p1, -(eht[p2]-ebase[p2]+d+ebase[p1]), p1); printf("\\h'-\\n(%du-\\n(%du/2u+.1m'\\v'%du'\\l'\\n(%du-.2m'\\h'.1m'\\v'%du'\n", treg, p1, ebase[p1]+d, treg, d); ebase[yyval] = b; eht[yyval] = h; lfont[yyval] = rfont[yyval] = 0; ofree(p2); ofree(treg); } p2, treg, treg, p2); printf(".nr %d \\n(%d+\\s%d.5m\\s0\n", treg, treg, EFFPS(ps)); printf(".ds %d \\v'%du'\\h'\\n(%du-cmd/eqn/paren.c 644 0 33 4437 2111463445 6642 # include "e.h" paren(leftc, p1, rightc) int p1, leftc, rightc; { int n, m, h1, j, b1, v; h1 = eht[p1]; b1 = ebase[p1]; yyval = p1; lfont[yyval] = rfont[yyval] = 0; n = (h1+(6*EFFPS(ps)-1))/(6*EFFPS(ps)); if( n<2 ) n = 1; m = n-2; if (leftc=='{' || rightc == '}') { n = n%2 ? n : ++n; if( n<3 ) n=3; m = n-3; } eht[yyval] = VERT(6 * ps * n); ebase[yyval] = b1 + (eht[yyval]-h1)/2; v = b1 - h1/2 + VERT( (ps*6*4)/10 ); printf(".ds %d \\|\\v'%du'", yyval, v); switch( leftc ) { case 'n': /* nothing */ case '\0': break; case 'f': /* floor */ if (n <= 1) printf("\\(lf"); else brack(m, "\\(bv", "\\(bv", "\\(lf"); break; case 'c': /* ceiling */ if (n <= 1) printf("\\(lc"); else brack(m, "\\(lc", "\\(bv", "\\(bv"); break; case '{': printf("\\b'\\(lt"); for(j = 0; j < m; j += 2) printf("\\(bv"); printf("\\(lk"); for(j = 0; j < m; j += 2) printf("\\(bv"); printf("\\(lb'"); break; case '(': brack(m, "\\(lt", "\\(bv", "\\(lb"); break; case '[': brack(m, "\\(lc", "\\(bv", "\\(lf"); break; case '|': brack(m, "|", "|", "|"); break; default: brack(m, (char *) &leftc, (char *) &leftc, (char *) &leftc); break; } printf("\\v'%du'\\*(%d", -v, p1); if( rightc ) { printf("\\|\\v'%du'", v); switch( rightc ) { case 'f': /* floor */ if (n <= 1) printf("\\(rf"); else brack(m, "\\(bv", "\\(bv", "\\(rf"); break; case 'c': /* ceiling */ if (n <= 1) printf("\\(rc"); else brack(m, "\\(rc", "\\(bv", "\\(bv"); break; case '}': printf("\\b'\\(rt"); for(j = 0; j< m; j += 2)printf("\\(bv"); printf("\\(rk"); for(j = 0; j< m; j += 2) printf("\\(bv"); printf("\\(rb'"); break; case ']': brack(m, "\\(rc", "\\(bv", "\\(rf"); break; case ')': brack(m, "\\(rt", "\\(bv", "\\(rb"); break; case '|': brack(m, "|", "|", "|"); break; default: brack(m, (char *) &rightc, (char *) &rightc, (char *) &rightc); break; } printf("\\v'%du'", -v); } printf("\n"); if(dbg)printf(".\tcurly: h=%d b=%d n=%d v=%d l=%c, r=%c\n", eht[yyval], ebase[yyval], n, v, leftc, rightc); } brack(m, t, c, b) int m; char *t, *c, *b; { int j; printf("\\b'%s", t); for( j=0; jmid; i-- ) b += eht[lp[i]] + gap; ebase[yyval] = (nlist%2) ? b + ebase[lp[mid]] : b - VERT( (ps*6*5)/10 ) - gap; if(dbg) { printf(".\tS%d <- %c pile of:", yyval, type); for( i=p1; i\\n(%d .nr %d \\n(%d\n", lp[i], yyval, yyval, lp[i]); } printf(".ds %d \\v'%du'\\h'%du*\\n(%du'\\\n", yyval, ebase[yyval], type=='R' ? 1 : 0, yyval); for(i = p2-1; i >=p1; i--) { hi = eht[lp[i]]; bi = ebase[lp[i]]; switch(type) { case 'L': printf("\\v'%du'\\*(%d\\h'-\\n(%du'\\v'0-%du'\\\n", -bi, lp[i], lp[i], hi-bi+gap); continue; case 'R': printf("\\v'%du'\\h'-\\n(%du'\\*(%d\\v'0-%du'\\\n", -bi, lp[i], lp[i], hi-bi+gap); continue; case 'C': case '-': printf("\\v'%du'\\h'\\n(%du-\\n(%du/2u'\\*(%d", -bi, yyval, lp[i], lp[i]); printf("\\h'-\\n(%du-\\n(%du/2u'\\v'0-%du'\\\n", yyval, lp[i], hi-bi+gap); continue; } } printf("\\v'%du'\\h'%du*\\n(%du'\n", eht[yyval]-ebase[yyval]+gap, type!='R' ? 1 : 0, yyval); for( i=p1; i h2 ) /* move little sub down */ shval = b1-b2; ebase[yyval] = b1 + max(0, h2-b1-d1); eht[yyval] = h1 + max(0, h2-b1-d1); if (rfont[p1] == ITAL && lfont[p2] == ROM) sh1 = "\\|"; if (rfont[p2] == ITAL) sh2 = "\\|"; } else { /* superscript */ /* 4/10 up main box */ d1 = VERT( (effps*6*2)/10 ); ebase[yyval] = b1; shval = -VERT( (4 * (h1-b1)) / 10 ) - b2; if( VERT(4*(h1-b1)/10) + h2 < h1-b1 ) /* raise little super */ shval = -(h1-b1) + h2-b2 - d1; eht[yyval] = h1 + max(0, h2-VERT((6*(h1-b1))/10)); if (rfont[p1] == ITAL) sh1 = "\\|"; if (rfont[p2] == ITAL) sh2 = "\\|"; } if(dbg)printf(".\tb:b shift b: S%d <- S%d vert %d S%d vert %d; b=%d, h=%d\n", yyval, p1, shval, p2, -shval, ebase[yyval], eht[yyval]); printf(".as %d \\v'%du'\\s-%d%s\\*(%d\\s+%d%s\\v'%du'\n", yyval, shval, diffps, sh1, p2, diffps, sh2, -shval); ps += deltaps; if (rfont[p2] == ITAL) rfont[p1] = 0; else rfont[p1] = rfont[p2]; ofree(p2); } shift(p1) int p1; { ps -= deltaps; yyval = p1; if(dbg)printf(".\tshift: %d;ps=%d\n", yyval, ps); } shift2(p1, p2, p3) int p1, p2, p3; { int effps, effps2, h1, h2, h3, b1, b2, b3, subsh, d1, d2, supsh; int treg; treg = oalloc(); yyval = p1; if(dbg)printf(".\tshift2 s%d <- %d %d %d\n", yyval, p1, p2, p3); effps = EFFPS(ps+deltaps); eht[p3] = h3 = VERT( (eht[p3] * effps) / EFFPS(ps) ); ps += deltaps; effps2 = EFFPS(ps+deltaps); h1 = eht[p1]; b1 = ebase[p1]; h2 = eht[p2]; b2 = ebase[p2]; b3 = ebase[p3]; d1 = VERT( (effps2*6)/2 ); subsh = -d1+h2-b2; if( d1+b1 > h2 ) /* move little sub down */ subsh = b1-b2; supsh = -VERT( (4*(h1-b1))/10 ) - b3; d2 = VERT( (effps*6*2)/10 ); if( VERT(4*(h1-b1)/10)+h3 < h1-b1 ) supsh = -(h1-b1) + (h3-b3) - d2; eht[yyval] = h1 + max(0, h3-VERT( (6*(h1-b1))/10 )) + max(0, h2-b1-d1); ebase[yyval] = b1+max(0, h2-b1-d1); if (rfont[p1] == ITAL && lfont[p2] == ROM) printf(".ds %d \\|\\*(%d\n", p2, p2); if (rfont[p2] == ITAL) printf(".as %d \\|\n", p2); nrwid(p2, effps, p2); if (rfont[p1] == ITAL && lfont[p3] == ROM) printf(".ds %d \\|\\|\\*(%d\n", p3, p3); else printf(".ds %d \\|\\*(%d\n", p3, p3); nrwid(p3, effps, p3); printf(".nr %d \\n(%d\n", treg, p3); printf(".if \\n(%d>\\n(%d .nr %d \\n(%d\n", p2, treg, treg, p2); printf(".as %d \\v'%du'\\s%d\\*(%d\\h'-\\n(%du'\\v'%du'\\\n", p1, subsh, effps, p2, p2, -subsh+supsh); printf("\\s%d\\*(%d\\h'-\\n(%du+\\n(%du'\\s%d\\v'%du'\n", effps, p3, p3, treg, effps2, -supsh); ps += deltaps; if (rfont[p2] == ITAL) rfont[yyval] = 0; /* lie */ ofree(p2); ofree(p3); ofree(treg); } |\\|\\*(%d\n", p3, p3); else printf("cmd/eqn/size.c 644 0 33 1546 2111463445 6505 # include "e.h" setsize(p) /* set size as found in p */ char *p; { if (*p == '+') ps += atoi(p+1); else if (*p == '-') ps -= atoi(p+1); else ps = atoi(p); if(dbg)printf(".\tsetsize %s; ps = %d\n", p, ps); } size(p1, p2) int p1, p2; { /* old size in p1, new in ps */ int effps, effp1; yyval = p2; if(dbg)printf(".\tb:sb: S%d <- \\s%d S%d \\s%d; b=%d, h=%d\n", yyval, ps, p2, p1, ebase[yyval], eht[yyval]); effps = EFFPS(ps); effp1 = EFFPS(p1); printf(".ds %d \\s%d\\*(%d\\s%d\n", yyval, effps, p2, effp1); ps = p1; } globsize() { char temp[20]; getstr(temp, 20); if (temp[0] == '+') gsize += atoi(temp+1); else if (temp[0] == '-') gsize -= atoi(temp+1); else gsize = atoi(temp); yyval = eqnreg = 0; setps(gsize); ps = gsize; if (gsize >= 12) /* sub and sup size change */ deltaps = gsize / 4; else deltaps = gsize / 3; } %d; b=%d, h=%d\n", yyval, ps, p2, p1, ebase[yyval], eht[yyval]); effps = EFFPS(ps); effp1 = EFFPS(p1); printf(".ds %d \\s%d\\*(%d\\s%d\n", yyval,cmd/eqn/sqrt.c 644 0 33 764 2111463445 6505 # include "e.h" sqrt(p2) int p2; { int nps; nps = EFFPS(((eht[p2]*9)/10+5)/6); yyval = p2; eht[yyval] = VERT( (nps*6*12)/10 ); if(dbg)printf(".\tsqrt: S%d <- S%d;b=%d, h=%d\n", yyval, p2, ebase[yyval], eht[yyval]); if (rfont[yyval] == ITAL) printf(".as %d \\|\n", yyval); nrwid(p2, ps, p2); printf(".ds %d \\v'%du'\\s%d\\v'-.2m'\\(sr\\l'\\n(%du\\(rn'\\v'.2m'\\s%d", yyval, ebase[p2], nps, p2, ps); printf("\\v'%du'\\h'-\\n(%du'\\*(%d\n", -ebase[p2], p2, p2); lfont[yyval] = ROM; } "cmd/eqn/text.c 644 0 33 6326 2111463445 6520 # include "e.h" # include "e.def" int csp; int psp; #define CSSIZE 400 char cs[420]; int lf, rf; /* temporary spots for left and right fonts */ text(t,p1) int t; char *p1; { int c; char *p; tbl *tp, *lookup(); extern tbl *restbl; yyval = oalloc(); ebase[yyval] = 0; eht[yyval] = VERT(6 * ((ps>6)?ps:6)); /* ht in machine units */ lfont[yyval] = rfont[yyval] = ROM; if (t == QTEXT) p = p1; else if ( t == SPACE ) p = "\\ "; else if ( t == THIN ) p = "\\|"; else if ( t == TAB ) p = "\\t"; else if ((tp = lookup(&restbl, p1, NULL)) != NULL) p = tp->defn; else { lf = rf = 0; for (csp=psp=0; (c=p1[psp++])!='\0';) { rf = trans(c, p1); if (lf == 0) lf = rf; /* save first */ if (csp>CSSIZE) error(FATAL,"converted token %.25s... too long",p1); } cs[csp] = '\0'; p = cs; lfont[yyval] = lf; rfont[yyval] = rf; } if(dbg)printf(".\t%dtext: S%d <- %s; b=%d,h=%d,lf=%c,rf=%c\n", t, yyval, p, ebase[yyval], eht[yyval], lfont[yyval], rfont[yyval]); printf(".ds %d \"%s\n", yyval, p); } trans(c,p1) int c; char *p1; { int f; f = ROM; switch( c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case ':': case ';': case '!': case '%': case '(': case '[': case ')': case ']': case ',': if (rf == ITAL) shim(); roman(c); break; case '.': if (rf == ROM) roman(c); else cs[csp++] = c; f = rf; break; case '|': if (rf == ITAL) shim(); shim(); roman(c); shim(); break; case '=': if (rf == ITAL) shim(); name4('e','q'); break; case '+': if (rf == ITAL) shim(); name4('p', 'l'); break; case '>': case '<': if (rf == ITAL) shim(); if (p1[psp]=='=') { /* look ahead for == <= >= */ name4(c,'='); psp++; } else { cs[csp++] = c; } break; case '-': if (rf == ITAL) shim(); if (p1[psp]=='>') { name4('-','>'); psp++; } else { name4('m','i'); } break; case '/': if (rf == ITAL) shim(); name4('s','l'); break; case '~': case ' ': shim(); shim(); break; case '^': shim(); break; case '\\': /* troff - pass 2 or 3 more chars */ if (rf == ITAL) shim(); cs[csp++] = c; cs[csp++] = c = p1[psp++]; cs[csp++] = p1[psp++]; if (c=='(') cs[csp++] = p1[psp++]; if (c=='*' && cs[csp-1] == '(') { cs[csp++] = p1[psp++]; cs[csp++] = p1[psp++]; } break; case '\'': cs[csp++] = '\\'; cs[csp++] = 'f'; cs[csp++] = rf==ITAL ? ITAL : ROM; name4('f','m'); cs[csp++] = '\\'; cs[csp++] = 'f'; cs[csp++] = 'P'; f = rf==ITAL ? ITAL : ROM; break; case 'f': if (ft == ITAL) { cs[csp++] = '\\'; cs[csp++] = '^'; cs[csp++] = 'f'; cs[csp++] = '\\'; cs[csp++] = '|'; /* trying | instead of ^ */ f = ITAL; } else cs[csp++] = 'f'; break; case 'j': if (ft == ITAL) { cs[csp++] = '\\'; cs[csp++] = '^'; cs[csp++] = 'j'; f = ITAL; } else cs[csp++] = 'j'; break; default: cs[csp++] = c; f = ft==ITAL ? ITAL : ROM; break; } return(f); } shim() { cs[csp++] = '\\'; cs[csp++] = '|'; } roman(c) int c; { cs[csp++] = '\\'; cs[csp++] = 'f'; cs[csp++] = ROM; cs[csp++] = c; cs[csp++] = '\\'; cs[csp++] = 'f'; cs[csp++] = 'P'; } name4(c1,c2) int c1,c2; { cs[csp++] = '\\'; cs[csp++] = '('; cs[csp++] = c1; cs[csp++] = c2; } se 'j': if (ft == ITAL) { cs[csp++] = '\\'; cs[csp++] = '^'; cs[csp++] = 'j'; f = ITAL; } else cs[csp++] = 'j'; break; default: cs[csp++] = c; f = ft==ITAL ? ITAL : ROM; break; } return(f); } shim() { cs[csp++] = '\\'; cs[csp++] = '|'; } roman(c) int c; { cs[csp++]cmd/eqn/lookup.old.c 644 0 33 7753 2346232741 7632 ((# include "e.h" #include "e.def" #define TBLSIZE 100 tbl *keytbl[TBLSIZE]; /* key words */ tbl *restbl[TBLSIZE]; /* reserved words */ tbl *deftbl[TBLSIZE]; /* user-defined names */ struct { char *key; int keyval; } keyword[] ={ "sub", SUB, "sup", SUP, ".EN", EOF, "from", FROM, "to", TO, "sum", SUM, "hat", HAT, "vec", VEC, "dyad", DYAD, "dot", DOT, "dotdot", DOTDOT, "bar", BAR, "tilde", TILDE, "under", UNDER, "prod", PROD, "int", INT, "integral", INT, "union", UNION, "inter", INTER, "pile", PILE, "lpile", LPILE, "cpile", CPILE, "rpile", RPILE, "over", OVER, "sqrt", SQRT, "above", ABOVE, "size", SIZE, "font", FONT, "fat", FAT, "roman", ROMAN, "italic", ITALIC, "bold", BOLD, "left", LEFT, "right", RIGHT, "delim", DELIM, "define", DEFINE, #ifdef NEQN /* make ndefine synonym for define, tdefine a no-op */ "tdefine", TDEFINE, "ndefine", DEFINE, #else /* tdefine = define, ndefine = no-op */ "tdefine", DEFINE, "ndefine", NDEFINE, #endif "gsize", GSIZE, ".gsize", GSIZE, "gfont", GFONT, "include", INCLUDE, "up", UP, "down", DOWN, "fwd", FWD, "back", BACK, "mark", MARK, "lineup", LINEUP, "matrix", MATRIX, "col", COL, "lcol", LCOL, "ccol", CCOL, "rcol", RCOL, 0, 0 }; struct { char *res; char *resval; } resword[] ={ ">=", "\\(>=", "<=", "\\(<=", "==", "\\(==", "!=", "\\(!=", "+-", "\\(+-", "->", "\\(->", "<-", "\\(<-", "inf", "\\(if", "infinity", "\\(if", "partial", "\\(pd", "half", "\\f1\\(12\\fP", "prime", "\\f1\\(fm\\fP", "dollar", "\\f1$\\fP", "nothing", "", "times", "\\(mu", "del", "\\(gr", "grad", "\\(gr", #ifdef NEQN "<<", "<<", ">>", ">>", "approx", "~\b\\d~\\u", "cdot", "\\v'-.5'.\\v'.5'", "...", "...", ",...,", ",...,", #else "<<", "<\\h'-.3m'<", ">>", ">\\h'-.3m'>", "approx", "\\v'-.2m'\\z\\(ap\\v'.25m'\\(ap\\v'-.05m'", "cdot", "\\v'-.3m'.\\v'.3m'", "...", "\\v'-.3m'\\ .\\ .\\ .\\ \\v'.3m'", ",...,", ",\\ .\\ .\\ .\\ ,\\|", #endif "alpha", "\\(*a", "beta", "\\(*b", "gamma", "\\(*g", "GAMMA", "\\(*G", "delta", "\\(*d", "DELTA", "\\(*D", "epsilon", "\\(*e", "EPSILON", "\\f1E\\fP", "omega", "\\(*w", "OMEGA", "\\(*W", "lambda", "\\(*l", "LAMBDA", "\\(*L", "mu", "\\(*m", "nu", "\\(*n", "theta", "\\(*h", "THETA", "\\(*H", "phi", "\\(*f", "PHI", "\\(*F", "pi", "\\(*p", "PI", "\\(*P", "sigma", "\\(*s", "SIGMA", "\\(*S", "xi", "\\(*c", "XI", "\\(*C", "zeta", "\\(*z", "iota", "\\(*i", "eta", "\\(*y", "kappa", "\\(*k", "rho", "\\(*r", "tau", "\\(*t", "omicron", "\\(*o", "upsilon", "\\(*u", "UPSILON", "\\(*U", "psi", "\\(*q", "PSI", "\\(*Q", "chi", "\\(*x", "and", "\\f1and\\fP", "for", "\\f1for\\fP", "if", "\\f1if\\fP", "Re", "\\f1Re\\fP", "Im", "\\f1Im\\fP", "sin", "\\f1sin\\fP", "cos", "\\f1cos\\fP", "tan", "\\f1tan\\fP", "arc", "\\f1arc\\fP", "sinh", "\\f1sinh\\fP", "coth", "\\f1coth\\fP", "tanh", "\\f1tanh\\fP", "cosh", "\\f1cosh\\fP", "lim", "\\f1lim\\fP", "log", "\\f1log\\fP", "max", "\\f1max\\fP", "min", "\\f1min\\fP", "ln", "\\f1ln\\fP", "exp", "\\f1exp\\fP", "det", "\\f1det\\fP", 0, 0 }; tbl *lookup(tblp, name, defn) /* find name in tbl. if defn non-null, install */ tbl **tblp; char *name, *defn; { register tbl *p; register int h; register char *s = name; char *malloc(); for (h = 0; *s != '\0'; ) h += *s++; h %= TBLSIZE; for (p = tblp[h]; p != NULL; p = p->next) if (strcmp(name, p->name) == 0) { /* found it */ if (defn != NULL) p->defn = defn; return(p); } /* didn't find it */ if (defn == NULL) return(NULL); p = (tbl *) malloc(sizeof (tbl)); if (p == NULL) error(FATAL, "out of space in lookup"); p->name = name; p->defn = defn; p->next = tblp[h]; tblp[h] = p; return(p); } init_tbl() /* initialize all tables */ { int i; for (i = 0; keyword[i].key != NULL; i++) lookup(keytbl, keyword[i].key, keyword[i].keyval); for (i = 0; resword[i].res != NULL; i++) lookup(restbl, resword[i].res, resword[i].resval); } p->defn = defn; cmd/ex/ 775 0 33 0 2552537264 5141 cmd/ex/ex.c 444 0 33 21043 2432713421 6006 /* Copyright (c) 1980 Regents of the University of California */ static char *sccsid = "@(#)ex.c 6.4 11/8/80"; #include "ex.h" #include "ex_argv.h" #include "ex_temp.h" #include "ex_tty.h" #ifdef TRACE char tttrace[] = { '/','d','e','v','/','t','t','y','x','x',0 }; #endif /* * The code for ex is divided as follows: * * ex.c Entry point and routines handling interrupt, hangup * signals; initialization code. * * ex_addr.c Address parsing routines for command mode decoding. * Routines to set and check address ranges on commands. * * ex_cmds.c Command mode command decoding. * * ex_cmds2.c Subroutines for command decoding and processing of * file names in the argument list. Routines to print * messages and reset state when errors occur. * * ex_cmdsub.c Subroutines which implement command mode functions * such as append, delete, join. * * ex_data.c Initialization of options. * * ex_get.c Command mode input routines. * * ex_io.c General input/output processing: file i/o, unix * escapes, filtering, source commands, preserving * and recovering. * * ex_put.c Terminal driving and optimizing routines for low-level * output (cursor-positioning); output line formatting * routines. * * ex_re.c Global commands, substitute, regular expression * compilation and execution. * * ex_set.c The set command. * * ex_subr.c Loads of miscellaneous subroutines. * * ex_temp.c Editor buffer routines for main buffer and also * for named buffers (Q registers if you will.) * * ex_tty.c Terminal dependent initializations from termcap * data base, grabbing of tty modes (at beginning * and after escapes). * * ex_unix.c Routines for the ! command and its variations. * * ex_v*.c Visual/open mode routines... see ex_v.c for a * guide to the overall organization. */ /* * Main procedure. Process arguments and then * transfer control to the main command processing loop * in the routine commands. We are entered as either "ex", "edit", "vi" * or "view" and the distinction is made here. Actually, we are "vi" if * there is a 'v' in our name, "view" is there is a 'w', and "edit" if * there is a 'd' in our name. For edit we just diddle options; * for vi we actually force an early visual command. */ main(ac, av) register int ac; register char *av[]; { #ifndef VMUNIX char *erpath = EXSTRINGS; #endif register char *cp; register int c; bool recov = 0; bool ivis; bool itag = 0; bool fast = 0; extern int onemt(); #ifdef TRACE register char *tracef; #endif /* * Immediately grab the tty modes so that we wont * get messed up if an interrupt comes in quickly. */ gTTY(1); #ifndef USG3TTY normf = tty.sg_flags; #else normf = tty; #endif ppid = getpid(); /* * Defend against d's, v's, w's, and a's in directories of * path leading to our true name. */ av[0] = tailpath(av[0]); /* * Figure out how we were invoked: ex, edit, vi, view. */ ivis = any('v', av[0]); /* "vi" */ if (any('w', av[0])) /* "view" */ value(READONLY) = 1; if (any('d', av[0])) { /* "edit" */ value(OPEN) = 0; value(REPORT) = 1; value(MAGIC) = 0; } #ifndef VMUNIX /* * For debugging take files out of . if name is a.out. */ if (av[0][0] == 'a') erpath = tailpath(erpath); #endif /* * Open the error message file. */ draino(); #ifndef VMUNIX erfile = open(erpath+4, 0); if (erfile < 0) { erfile = open(erpath, 0); } #endif pstop(); /* * Initialize interrupt handling. */ oldhup = signal(SIGHUP, SIG_IGN); if (oldhup == SIG_DFL) signal(SIGHUP, onhup); oldquit = signal(SIGQUIT, SIG_IGN); ruptible = signal(SIGINT, SIG_IGN) == SIG_DFL; if (signal(SIGTERM, SIG_IGN) == SIG_DFL) signal(SIGTERM, onhup); if (signal(SIGEMT, SIG_IGN) == SIG_DFL) signal(SIGEMT, onemt); /* * Initialize end of core pointers. * Normally we avoid breaking back to fendcore after each * file since this can be expensive (much core-core copying). * If your system can scatter load processes you could do * this as ed does, saving a little core, but it will probably * not often make much difference. */ fendcore = (line *) sbrk(0); endcore = fendcore - 2; /* * Process flag arguments. */ ac--, av++; while (ac && av[0][0] == '-') { c = av[0][1]; if (c == 0) { hush = 1; value(AUTOPRINT) = 0; fast++; } else switch (c) { case 'R': value(READONLY) = 1; break; #ifdef TRACE case 'T': if (av[0][2] == 0) tracef = "trace"; else { tracef = tttrace; tracef[8] = av[0][2]; if (tracef[8]) tracef[9] = av[0][3]; else tracef[9] = 0; } trace = fopen(tracef, "w"); if (trace == NULL) printf("Trace create error\n"); setbuf(trace, tracbuf); break; #endif #ifdef LISPCODE case 'l': value(LISP) = 1; value(SHOWMATCH) = 1; break; #endif case 'r': recov++; break; case 't': if (ac > 1 && av[1][0] != '-') { ac--, av++; itag = 1; /* BUG: should check for too long tag. */ CP(lasttag, av[0]); } break; case 'v': ivis = 1; break; case 'w': defwind(( = 0; if (av[0][2] == 0) defwind = 3; else for (cp = &av[0][2]; isdigit(*cp); cp++) defwind = 10*defwind + *cp - '0'; break; #ifdef CRYPT case 'x': /* -x: encrypted mode */ xflag = 1; break; #endif default: smerror("Unknown option %s\n", av[0]); break; } ac--, av++; } #ifdef SIGTSTP if (!hush && signal(SIGTSTP, SIG_IGN) == SIG_DFL) signal(SIGTSTP, onsusp), dosusp++; #endif if (ac && av[0][0] == '+') { firstpat = &av[0][1]; ac--, av++; } #ifdef CRYPT if(xflag){ key = getpass(KEYPROMPT); kflag = crinit(key, perm); } #endif /* * If we are doing a recover and no filename * was given, then execute an exrecover command with * the -r option to type out the list of saved file names. * Otherwise set the remembered file name to the first argument * file name so the "recover" initial command will find it. */ if (recov) { if (ac == 0) { ppid = 0; setrupt(); execl(EXRECOVER, "exrecover", "-r", 0); filioerr(EXRECOVER); exit(1); } CP(savedfile, *av++), ac--; } /* * Initialize the argument list. */ argv0 = av; argc0 = ac; args0 = av[0]; erewind(); /* * Initialize a temporary file (buffer) and * set up terminal environment. Read user startup commands. */ if (setexit() == 0) { setrupt(); intty = isatty(0); value(PROMPT) = intty; if (cp = getenv("SHELL")) CP(shell, cp); if (fast || !intty) setterm("dumb"); else { gettmode(); if ((cp = getenv("TERM")) != 0 && *cp) setterm(cp); } } if (setexit() == 0 && !fast && intty) if ((globp = getenv("EXINIT")) && *globp) commands(1,1); else { globp = 0; if ((cp = getenv("HOME")) != 0 && *cp) source(strcat(strcpy(genbuf, cp), "/.exrc"), 1); } init(); /* moved after prev 2 chunks to fix directory option */ /* * Initial processing. Handle tag, recover, and file argument * implied next commands. If going in as 'vi', then don't do * anything, just set initev so we will do it later (from within * visual). */ if (setexit() == 0) { if (recov) globp = "recover"; else if (itag) globp = ivis ? "tag" : "tag|p"; else if (argc) globp = "next"; if (ivis) initev = globp; else if (globp) { inglobal = 1; commands(1, 1); inglobal = 0; } } /* * Vi command... go into visual. * Strange... everything in vi usually happens * before we ever "start". */ if (ivis) { /* * Don't have to be upward compatible with stupidity * of starting editing at line $. */ if (dol > zero) dot = one; globp = "visual"; if (setexit() == 0) commands(1, 1); } /* * Clear out trash in state accumulated by startup, * and then do the main command loop for a normal edit. * If you quit out of a 'vi' command by doing Q or ^\, * you also fall through to here. */ seenprompt = 1; ungetchar(0); globp = 0; initev = 0; setlastchar('\n'); setexit(); commands(0, 0); cleanup(1); exit(0); } /* * Initialization, before editing a new file. * Main thing here is to get a new buffer (in fileinit), * rest is peripheral state resetting. */ init() { register int i; fileinit(); dot = zero = truedol = unddol = dol = fendcore; one = zero+1; undkind = UNDNONE; chng = 0; edited = 0; for (i = 0; i <= 'z'-'a'+1; i++) names[i] = 1; anymarks = 0; #ifdef CRYPT if(xflag) { xtflag = 1; makekey(key, tperm); } #endif } /* * Return last component of unix path name p. */ char * tailpath(p) register char *p; { register char *r; for (r=p; *p; p++) if (*p == '/') r = p+1; return(r); } . */ init() { register int i; fileinit(); dot = zero = truedol = unddol = dol = fendcore; one = zero+1; undkind = UNDNONE; chng = 0; edited = 0; for (i = 0; i <= 'z'-'a'+1; i++) names[i] = 1; anymarks = 0; #ifdef CRYPT if(xflag) { xtflag = 1; makekey(key, tperm); } #endif } /* * Return last component of unix path name p. */ char * tailpath(p) register char *p; { register char *r; for (r=p; *p; p++) if (*pcmd/ex/ex.h 444 0 33 30177 2425425362 6031 /* Copyright (c) 1980 Regents of the University of California */ /* sccs id: @(#)ex.h 6.1 10/18/80 */ #ifdef V6 #include #endif /* * Ex version 3 (see exact version in ex_cmds.c, search for /Version/) * * Mark Horton, UC Berkeley * Bill Joy, UC Berkeley * November 1979 * * This file contains most of the declarations common to a large number * of routines. The file ex_vis.h contains declarations * which are used only inside the screen editor. * The file ex_tune.h contains parameters which can be diddled per installation. * * The declarations relating to the argument list, regular expressions, * the temporary file data structure used by the editor * and the data describing terminals are each fairly substantial and * are kept in the files ex_{argv,re,temp,tty}.h which * we #include separately. * * If you are going to dig into ex, you should look at the outline of the * distribution of the code into files at the beginning of ex.c and ex_v.c. * Code which is similar to that of ed is lightly or undocumented in spots * (e.g. the regular expression code). Newer code (e.g. open and visual) * is much more carefully documented, and still rough in spots. * * Please forward bug reports to * * Mark Horton * Computer Science Division, EECS * EVANS HALL * U.C. Berkeley 94704 * (415) 642-4948 * (415) 642-1024 (dept. office) * * or to csvax.mark@berkeley on the ARPA-net. I would particularly like to hear * of additional terminal descriptions you add to the termcap data base. */ #include #include #include #include #include #include /* * The following little dance copes with the new USG tty handling. * This stuff has the advantage of considerable flexibility, and * the disadvantage of being incompatible with anything else. * The presence of the symbol USG3TTY will indicate the new code: * in this case, we define CBREAK (because we can simulate it exactly), * but we won't actually use it, so we set it to a value that will * probably blow the compilation if we goof up. */ #ifdef USG3TTY #include #define CBREAK xxxxx #else #include #endif extern int errno; #ifndef VMUNIX typedef short line; #else typedef int line; #endif typedef short bool; #include "ex_tune.h" #include "ex_vars.h" /* * Options in the editor are referred to usually by "value(name)" where * name is all uppercase, i.e. "value(PROMPT)". This is actually a macro * which expands to a fixed field in a static structure and so generates * very little code. The offsets for the option names in the structure * are generated automagically from the structure initializing them in * ex_data.c... see the shell script "makeoptions". */ struct option { char *oname; char *oabbrev; short otype; /* Types -- see below */ short odefault; /* Default value */ short ovalue; /* Current value */ char *osvalue; }; #define ONOFF 0 #define NUMERIC 1 #define STRING 2 /* SHELL or DIRECTORY */ #define OTERM 3 #define value(a) options[a].ovalue #define svalue(a) options[a].osvalue struct option options[NOPTS + 1]; /* * The editor does not normally use the standard i/o library. Because * we expect the editor to be a heavily used program and because it * does a substantial amount of input/output processing it is appropriate * for it to call low level read/write primitives directly. In fact, * when debugging the editor we use the standard i/o library. In any * case the editor needs a printf which prints through "putchar" ala the * old version 6 printf. Thus we normally steal a copy of the "printf.c" * and "strout" code from the standard i/o library and mung it for our * purposes to avoid dragging in the stdio library headers, etc if we * are not debugging. Such a modified printf exists in "printf.c" here. */ #ifdef TRACE # include FILE *trace; bool trubble; bool techoin; char tracbuf[BUFSIZ]; # undef putchar # undef getchar #else # ifdef VMUNIX # define BUFSIZ 1024 # else # define BUFSIZ 512 # endif # define NULL 0 # define EOF -1 #endif /* * Character constants and bits * * The editor uses the QUOTE bit as a flag to pass on with characters * e.g. to the putchar routine. The editor never uses a simple char variable. * Only arrays of and pointers to characters are used and parameters and * registers are never declared character. */ #define QUOTE 0200 #define TRIM 0177 #define CTRL(c) ('c' & 037) #define NL CTRL(j) #define CR CTRL(m) #define DELETE 0177 /* See also ATTN, QUIT in ex_tune.h */ #define ESCAPE 033 /* * Miscellaneous random variables used in more than one place */ bool aiflag; /* Append/change/insert with autoindent */ bool anymarks; /* We have used '[a-z] */ int chng; /* Warn "No write" */ char *Command; short defwind; /* -w# change default window size */ int dirtcnt; /* When >= MAXDIRT, should sync temporary */ #ifdef TIOCLGET bool dosusp; /* Do SIGTSTP in visual when ^Z typed */ #endif bool edited; /* Current file is [Edited] */ line *endcore; /* Last available core location */ bool endline; /* Last cmd mode command ended with \n */ #ifndef VMUNIX short erfile; /* Error message file unit */ #endif line *fendcore; /* First address in line pointer space */ char file[FNSIZE]; /* Working file name */ char genbuf[LBSIZE]; /* Working buffer when manipulating linebuf */ bool hush; /* Command line option - was given, hush up! */ char *globp; /* (Untyped) input string to command mode */ bool holdcm; /* Don't cursor address */ bool inappend; /* in ex command append mode */ b((ool inglobal; /* Inside g//... or v//... */ char *initev; /* Initial : escape for visual */ bool inopen; /* Inside open or visual */ char *input; /* Current position in cmd line input buffer */ bool intty; /* Input is a tty */ short io; /* General i/o unit (auto-closed on error!) */ short lastc; /* Last character ret'd from cmd input */ bool laste; /* Last command was an "e" (or "rec") */ char lastmac; /* Last macro called for ** */ char lasttag[TAGSIZE]; /* Last argument to a tag command */ char *linebp; /* Used in substituting in \n */ char linebuf[LBSIZE]; /* The primary line buffer */ bool listf; /* Command should run in list mode */ char *loc1; /* Where re began to match (in linebuf) */ char *loc2; /* First char after re match (") */ line names['z'-'a'+2]; /* Mark registers a-z,' */ int notecnt; /* Count for notify (to visual from cmd) */ bool numberf; /* Command should run in number mode */ char obuf[BUFSIZ]; /* Buffer for tty output */ short oprompt; /* Saved during source */ short ospeed; /* Output speed (from gtty) */ int otchng; /* Backup tchng to find changes in macros */ short peekc; /* Peek ahead character (cmd mode input) */ char *pkill[2]; /* Trim for put with ragged (LISP) delete */ bool pfast; /* Have stty -nl'ed to go faster */ int pid; /* Process id of child */ int ppid; /* Process id of parent (e.g. main ex proc) */ jmp_buf resetlab; /* For error throws to top level (cmd mode) */ int rpid; /* Pid returned from wait() */ bool ruptible; /* Interruptible is normal state */ bool seenprompt; /* 1 if have gotten user input */ bool shudclob; /* Have a prompt to clobber (e.g. on ^D) */ int status; /* Status returned from wait() */ int tchng; /* If nonzero, then [Modified] */ short tfile; /* Temporary file unit */ bool vcatch; /* Want to catch an error (open/visual) */ jmp_buf vreslab; /* For error throws to a visual catch */ bool writing; /* 1 if in middle of a file write */ int xchng; /* Suppresses multiple "No writes" in !cmd */ /* * Macros */ #define CP(a, b) (ignore(strcpy(a, b))) /* * FIXUNDO: do we want to mung undo vars? * Usually yes unless in a macro or global. */ #define FIXUNDO (inopen >= 0 && (inopen || !inglobal)) #define ckaw() {if (chng && value(AUTOWRITE)) wop(0);} #define copy(a,b,c) Copy((char *) a, (char *) b, c) #define eq(a, b) ((a) && (b) && strcmp(a, b) == 0) #define getexit(a) copy(a, resetlab, sizeof (jmp_buf)) #define lastchar() lastc #define outchar(c) (*Outchar)(c) #define pastwh() (ignore(skipwh())) #define pline(no) (*Pline)(no) #define reset() longjmp(resetlab,1) #define resexit(a) copy(resetlab, a, sizeof (jmp_buf)) #define setexit() setjmp(resetlab) #define setlastchar(c) lastc = c #define ungetchar(c) peekc = c #define CATCH vcatch = 1; if (setjmp(vreslab) == 0) { #define ONERR } else { vcatch = 0; #define ENDCATCH } vcatch = 0; /* * Environment like memory */ char altfile[FNSIZE]; /* Alternate file name */ char direct[ONMSZ]; /* Temp file goes here */ char shell[ONMSZ]; /* Copied to be settable */ char ttytype[ONMSZ]; /* A long and pretty name */ char uxb[UXBSIZE + 2]; /* Last !command for !! */ /* * The editor data structure for accessing the current file consists * of an incore array of pointers into the temporary file tfile. * Each pointer is 15 bits (the low bit is used by global) and is * padded with zeroes to make an index into the temp file where the * actual text of the line is stored. * * To effect undo, copies of affected lines are saved after the last * line considered to be in the buffer, between dol and unddol. * During an open or visual, which uses the command mode undo between * dol and unddol, a copy of the entire, pre-command buffer state * is saved between unddol and truedol. */ line *addr1; /* First addressed line in a command */ line *addr2; /* Second addressed line */ line *dol; /* Last line in buffer */ line *dot; /* Current line */ line *one; /* First line */ line *truedol; /* End of all lines, including saves */ line *unddol; /* End of undo saved lines */ line *zero; /* Points to empty slot before one */ /* * Undo information * * For most commands we save lines changed by salting them away between * dol and unddol before they are changed (i.e. we save the descriptors * into the temp file tfile which is never garbage collected). The * lines put here go back after unddel, and to complete the undo * we delete the lines [undap1,undap2). * * Undoing a move is much easier and we treat this as a special case. * Similarly undoing a "put" is a special case for although there * are lines saved between dol and unddol we don't stick these back * into the buffer. */ short undkind; line *unddel; /* Saved deleted lines go after here */ line *undap1; /* Beginning of new lines */ line *undap2; /* New lines end before undap2 */ line *undadot; /* If we saved all lines, dot reverts here */ #define UNDCHANGE 0 #define UNDMOVE 1 #define UNDALL 2 #define UNDNONE 3 #define UNDPUT 4 #ifdef CRYPT /* * Various miscellaneous flags and buffers needed by the encryption routines. */ #define KSIZE 9 /* key size for encryption */ #define KEYPROMPT "Key: " int xflag; /* True if we are in encryption mode */ int xtflag; /* True if the temp file is being encrypted */ int kflag; /* True if the key has been accepted */ char perm[768]; char tperm[768]; char *key; char crbuf[CRSIZE]; char *getpass(); #endif /* * Function type definitions */ #define NOSTR (char *) 0 #define NOLINE (line *) 0 int (*Outchar)(); int (*Pline)(); int (*Putchar)(); int (*oldhup)(); int (*setlist())(); int (*setnorm())(); int (*setnorm())(); int (*setnumb())(); line *address(); char *cgoto(); char *genindent(); char *getblock(); char *getenv(); line *getmark(); char *longname(); char *mesg(); char *place(); char *plural(); line *scanfor(); line *setin(); char *strcat(); char *strcpy(); char *strend(); char *tailpath(); char *tgetstr(); char *tgoto(); char *ttyname(); line *vback(); char *vfindcol(); char *vgetline(); char *vinit(); char *vpastwh(); char *vskipwh(); int put(); int putreg(); int YANKreg(); int delete(); int execl(); int filter(); int getfile(); int getsub(); int gettty(); int join(); int listchar(); off_t lseek(); int normchar(); int normline(); int numbline(); int (*oldquit)(); int onhup(); int onintr(); int onsusp(); int putch(); int shift(); int termchar(); int vfilter(); #ifdef CBREAK int vintr(); #endif int vputch(); int vshftop(); int yank(); /* * C doesn't have a (void) cast, so we have to fake it for lint's sake. */ #ifdef lint # define ignore(a) Ignore((char *) (a)) # define ignorf(a) Ignorf((int (*) ()) (a)) #else # define ignore(a) a # define ignorf(a) a #endif nt join(); int listchar(); off_t lseek(); int normchar(); int normline(); int numbline(); int (*oldquit)(); int onhup(); int onintr(); int onsusp(); int putch(); int shift(); int termchar(); int vfilter(); #ifdef CBREAK int vintr(); #endif int vputch(); int vshftop(); int yank(); /* * C doesn't have a (void) cast, so we have to fake it for lint's sake. */ #ifdef lint # define igncmd/ex/makeSCCS 644 0 33 4635 2414013256 6533 ex.c: SCCS/s.ex.c ${HDRS}; rm -f ex.c; sccs get ex.c ex.h: SCCS/s.ex.h; rm -f ex.h; sccs get ex.h ex_addr.c: SCCS/s.ex_addr.c; rm -f ex_addr.c; sccs get ex_addr.c ex_argv.h: SCCS/s.ex_argv.h; rm -f ex_argv.h; sccs get ex_argv.h ex_cmds.c: SCCS/s.ex_cmds.c; rm -f ex_cmds.c; sccs get ex_cmds.c ex_cmds2.c: SCCS/s.ex_cmds2.c; rm -f ex_cmds2.c; sccs get ex_cmds2.c ex_cmdsub.c: SCCS/s.ex_cmdsub.c; rm -f ex_cmdsub.c; sccs get ex_cmdsub.c ex_data.c: SCCS/s.ex_data.c; rm -f ex_data.c; sccs get ex_data.c ex_get.c: SCCS/s.ex_get.c; rm -f ex_get.c; sccs get ex_get.c ex_io.c: SCCS/s.ex_io.c; rm -f ex_io.c; sccs get ex_io.c ex_put.c: SCCS/s.ex_put.c; rm -f ex_put.c; sccs get ex_put.c ex_re.c: SCCS/s.ex_re.c; rm -f ex_re.c; sccs get ex_re.c ex_re.h: SCCS/s.ex_re.h; rm -f ex_re.h; sccs get ex_re.h ex_set.c: SCCS/s.ex_set.c; rm -f ex_set.c; sccs get ex_set.c ex_subr.c: SCCS/s.ex_subr.c; rm -f ex_subr.c; sccs get ex_subr.c ex_temp.c: SCCS/s.ex_temp.c; rm -f ex_temp.c; sccs get ex_temp.c ex_temp.h: SCCS/s.ex_temp.h; rm -f ex_temp.h; sccs get ex_temp.h ex_tty.c: SCCS/s.ex_tty.c; rm -f ex_tty.c; sccs get ex_tty.c ex_tty.h: SCCS/s.ex_tty.h; rm -f ex_tty.h; sccs get ex_tty.h ex_tune.h: SCCS/s.ex_tune.h; rm -f ex_tune.h; sccs get ex_tune.h ex_unix.c: SCCS/s.ex_unix.c; rm -f ex_unix.c; sccs get ex_unix.c ex_v.c: SCCS/s.ex_v.c; rm -f ex_v.c; sccs get ex_v.c ex_vadj.c: SCCS/s.ex_vadj.c; rm -f ex_vadj.c; sccs get ex_vadj.c ex_vars.h: SCCS/s.ex_vars.h; rm -f ex_vars.h; sccs get ex_vars.h ex_vget.c: SCCS/s.ex_vget.c; rm -f ex_vget.c; sccs get ex_vget.c ex_vis.h: SCCS/s.ex_vis.h; rm -f ex_vis.h; sccs get ex_vis.h ex_vmain.c: SCCS/s.ex_vmain.c; rm -f ex_vmain.c; sccs get ex_vmain.c ex_voper.c: SCCS/s.ex_voper.c; rm -f ex_voper.c; sccs get ex_voper.c ex_vops.c: SCCS/s.ex_vops.c; rm -f ex_vops.c; sccs get ex_vops.c ex_vops2.c: SCCS/s.ex_vops2.c; rm -f ex_vops2.c; sccs get ex_vops2.c ex_vops3.c: SCCS/s.ex_vops3.c; rm -f ex_vops3.c; sccs get ex_vops3.c ex_vput.c: SCCS/s.ex_vput.c; rm -f ex_vput.c; sccs get ex_vput.c ex_vwind.c: SCCS/s.ex_vwind.c; rm -f ex_vwind.c; sccs get ex_vwind.c expreserve.c: SCCS/s.expreserve.c; rm -f expreserve.c; sccs get expreserve.c exrecover.c: SCCS/s.exrecover.c; rm -f exrecover.c; sccs get exrecover.c makeoptions: SCCS/s.makeoptions; rm -f makeoptions; sccs get makeoptions bcopy.c: SCCS/s.bcopy.c; rm -f bcopy.c; sccs get bcopy.c printf.c: SCCS/s.printf.c; rm -f printf.c; sccs get printf.c _vops3.c; sccs get ex_vops3.c ex_vput.c: SCCS/s.ex_vput.c; rm -f ex_vput.c; sccs get ex_vput.c ex((cmd/ex/ex_addr.c 444 0 33 12321 2425425370 7004 /* Copyright (c) 1979 Regents of the University of California */ static char *sccsid = "@(#)ex_addr.c 6.1 10/18/80"; #include "ex.h" #include "ex_re.h" /* * Routines for address parsing and assignment and checking of address bounds * in command mode. The routine address is called from ex_cmds.c * to parse each component of a command (terminated by , ; or the beginning * of the command itself. It is also called by the scanning routine * in ex_voperate.c from within open/visual. * * Other routines here manipulate the externals addr1 and addr2. * These are the first and last lines for the current command. * * The variable bigmove remembers whether a non-local glitch of . was * involved in an address expression, so we can set the previous context * mark '' when such a motion occurs. */ static bool bigmove; /* * Set up addr1 and addr2 for commands whose default address is dot. */ setdot() { setdot1(); if (bigmove) markDOT(); } /* * Call setdot1 to set up default addresses without ever * setting the previous context mark. */ setdot1() { if (addr2 == 0) addr1 = addr2 = dot; if (addr1 > addr2) { notempty(); error("Addr1 > addr2|First address exceeds second"); } } /* * Ex allows you to say * delete 5 * to delete 5 lines, etc. * Such nonsense is implemented by setcount. */ setcount() { register int cnt; pastwh(); if (!isdigit(peekchar())) { setdot(); return; } addr1 = addr2; setdot(); cnt = getnum(); if (cnt <= 0) error("Bad count|Nonzero count required"); addr2 += cnt - 1; if (addr2 > dol) addr2 = dol; nonzero(); } /* * Parse a number out of the command input stream. */ getnum() { register int cnt; for (cnt = 0; isdigit(peekcd());) cnt = cnt * 10 + getchar() - '0'; return (cnt); } /* * Set the default addresses for commands which use the whole * buffer as default, notably write. */ setall() { if (addr2 == 0) { addr1 = one; addr2 = dol; if (dol == zero) { dot = zero; return; } } /* * Don't want to set previous context mark so use setdot1(). */ setdot1(); } /* * No address allowed on, e.g. the file command. */ setnoaddr() { if (addr2 != 0) error("No address allowed@on this command"); } /* * Parse an address. * Just about any sequence of address characters is legal. * * If you are tricky you can use this routine and the = command * to do simple addition and subtraction of cardinals less * than the number of lines in the file. */ line * address(inline) char *inline; { register line *addr; register int offset, c; short lastsign; bigmove = 0; lastsign = 0; offset = 0; addr = 0; for (;;) { if (isdigit(peekcd())) { if (addr == 0) { addr = zero; bigmove = 1; } loc1 = 0; addr += offset; offset = getnum(); if (lastsign >= 0) addr += offset; else addr -= offset; lastsign = 0; offset = 0; } switch (c = getcd()) { case '?': case '/': case '$': case '\'': case '\\': bigmove++; case '.': if (addr || offset) error("Badly formed address"); } offset += lastsign; lastsign = 0; switch (c) { case ' ': case '\t': continue; case '+': lastsign = 1; if (addr == 0) addr = dot; continue; case '^': case '-': lastsign = -1; if (addr == 0) addr = dot; continue; case '\\': case '?': case '/': c = compile(c, 1); notempty(); savere(scanre); addr = dot; if (inline && execute(0, dot)) { if (c == '/') { while (loc1 <= inline) { if (loc1 == loc2) loc2++; if (!execute(1)) goto nope; } break; } else if (loc1 < inline) { char *last; doques: do { last = loc1; if (loc1 == loc2) loc2++; if (!execute(1)) break; } while (loc1 < inline); loc1 = last; break; } } nope: for (;;) { if (c == '/') { addr++; if (addr > dol) { if (value(WRAPSCAN) == 0) error("No match to BOTTOM|Address search hit BOTTOM without matching pattern"); addr = zero; } } else { addr--; if (addr < zero) { if (value(WRAPSCAN) == 0) error("No match to TOP|Address search hit TOP without matching pattern"); addr = dol; } } if (execute(0, addr)) { if (inline && c == '?') { inline = &linebuf[LBSIZE]; goto doques; } break; } if (addr == dot) error("Fail|Pattern not found"); } continue; case '$': addr = dol; continue; case '.': addr = dot; continue; case '\'': c = markreg(getchar()); if (c == 0) error("Marks are ' and a-z"); addr = getmark(c); if (addr == 0) error("Undefined mark@referenced"); break; default: ungetchar(c); if (offset) { if (addr == 0) addr = dot; addr += offset; loc1 = 0; } if (addr == 0) { bigmove = 0; return (0); } if (addr != zero) notempty(); addr += lastsign; if (addr < zero) error("Negative address@- first buffer line is 1"); if (addr > dol) error("Not that many lines@in buffer"); return (addr); } } } /* * Abbreviations to make code smaller * Left over from squashing ex version 1.1 into * 11/34's and 11/40's. */ setCNL() { setcount(); newline(); } setNAEOL() { setnoaddr(); eol(); } ddr += offset; loc1 = 0; } if (addr == 0) { bigmove = 0; return (0); } if (addr != zero) notempty(); addr += lastsign; if (addr < zero) error("Negative address@- first buffer line is 1"); if (addr > dol) error("Not that many lines@in buffer"); return (addcmd/ex/ex_argv.h 444 0 33 1510 2425425377 7023 /* Copyright (c) 1980 Regents of the University of California */ /* sccs id: @(#)ex_argv.h 6.1 10/18/80 */ /* * The current implementation of the argument list is poor, * using an argv even for internally done "next" commands. * It is not hard to see that this is restrictive and a waste of * space. The statically allocated glob structure could be replaced * by a dynamically allocated argument area space. */ char **argv; char **argv0; char *args; char *args0; short argc; short argc0; short morargc; /* Used with "More files to edit..." */ int firstln; /* From +lineno */ char *firstpat; /* From +/pat */ /* Yech... */ struct glob { short argc; /* Index of current file in argv */ short argc0; /* Number of arguments in argv */ char *argv[NARGS + 1]; /* WHAT A WASTE! */ char argspac[NCARGS + sizeof (int)]; } frob; ed glob structure could be replaced * by a dynamically allocated argument area space. */ char **argv; char **argv0; char *args; char *args0; short argc; short argc0; short morargc; cmd/ex/ex_cmds.c 444 0 33 33033 2431052135 7013 /* Copyright (c) 1980 Regents of the University of California */ static char *sccsid = "@(#)ex_cmds.c 6.3 11/3/80"; #include "ex.h" #include "ex_argv.h" #include "ex_temp.h" #include "ex_tty.h" bool pflag, nflag; int poffset; #define nochng() lchng = chng /* * Main loop for command mode command decoding. * A few commands are executed here, but main function * is to strip command addresses, do a little address oriented * processing and call command routines to do the real work. */ commands(noprompt, exitoneof) bool noprompt, exitoneof; { register line *addr; register int c; register int lchng; int given; int seensemi; int cnt; bool hadpr; resetflav(); nochng(); for (;;) { /* * If dot at last command * ended up at zero, advance to one if there is a such. */ if (dot <= zero) { dot = zero; if (dol > zero) dot = one; } shudclob = 0; /* * If autoprint or trailing print flags, * print the line at the specified offset * before the next command. */ if (pflag || lchng != chng && value(AUTOPRINT) && !inglobal && !inopen && endline) { pflag = 0; nochng(); if (dol != zero) { addr1 = addr2 = dot + poffset; if (addr1 < one || addr1 > dol) error("Offset out-of-bounds|Offset after command too large"); setdot1(); goto print; } } nochng(); /* * Print prompt if appropriate. * If not in global flush output first to prevent * going into pfast mode unreasonably. */ if (inglobal == 0) { flush(); if (!hush && value(PROMPT) && !globp && !noprompt && endline) { putchar(':'); hadpr = 1; } TSYNC(); } /* * Gobble up the address. * Degenerate addresses yield ".". */ addr2 = 0; given = seensemi = 0; do { addr1 = addr2; addr = address(0); c = getcd(); if (addr == 0) if (c == ',') addr = dot; else if (addr1 != 0) { addr2 = dot; break; } else break; addr2 = addr; given++; if (c == ';') { c = ','; dot = addr; seensemi = 1; } (( } while (c == ','); if (c == '%') { /* %: same as 1,$ */ addr1 = one; addr2 = dol; given = 2; c = getchar(); } if (addr1 == 0) addr1 = addr2; if (c == ':') c = getchar(); /* * Set command name for special character commands. */ tailspec(c); /* * If called via : escape from open or visual, limit * the set of available commands here to save work below. */ if (inopen) { if (c=='\n' || c=='\r' || c==CTRL(d) || c==EOF) { if (addr2) dot = addr2; if (c == EOF) return; continue; } if (any(c, "o")) notinvis: tailprim(Command, 1, 1); } choice: switch (c) { case 'a': switch(peekchar()) { case 'b': /* abbreviate */ tail("abbreviate"); setnoaddr(); mapcmd(0, 1); anyabbrs = 1; continue; case 'r': /* args */ tail("args"); setnoaddr(); eol(); pargs(); continue; } /* append */ if (inopen) goto notinvis; tail("append"); setdot(); aiflag = exclam(); newline(); vmacchng(0); deletenone(); setin(addr2); inappend = 1; ignore(append(gettty, addr2)); inappend = 0; nochng(); continue; case 'c': switch (peekchar()) { /* copy */ case 'o': tail("copy"); vmacchng(0); move(); continue; #ifdef CHDIR /* cd */ case 'd': tail("cd"); goto changdir; /* chdir */ case 'h': ignchar(); if (peekchar() == 'd') { register char *p; tail2of("chdir"); changdir: if (savedfile[0] == '/' || !value(WARN)) ignore(exclam()); else ignore(quickly()); if (skipend()) { p = getenv("HOME"); if (p == NULL) error("Home directory unknown"); } else getone(), p = file; eol(); if (chdir(p) < 0) filioerr(p); if (savedfile[0] != '/') edited = 0; continue; } if (inopen) tailprim("change", 2, 1); tail2of("change"); break; #endif default: if (inopen) goto notinvis; tail("change"); break; } /* change */ aiflag = exclam(); setCNL(); vmacchng(0); setin(addr1); delete(0); inappend = 1; ignore(append(gettty, addr1 - 1)); inappend = 0; nochng(); continue; /* delete */ case 'd': /* * Caution: dp and dl have special meaning already. */ tail("delete"); c = cmdreg(); setCNL(); vmacchng(0); if (c) YANKreg(c); delete(0); appendnone(); continue; /* edit */ /* ex */ case 'e': tail(peekchar() == 'x' ? "ex" : "edit"); editcmd: if (!exclam() && chng) c = 'E'; filename(c); if (c == 'E') { ungetchar(lastchar()); ignore(quickly()); } setnoaddr(); doecmd: init(); addr2 = zero; laste++; sync(); rop(c); nochng(); continue; /* file */ case 'f': tail("file"); setnoaddr(); filename(c); noonl(); /* synctmp(); */ continue; /* global */ case 'g': tail("global"); global(!exclam()); nochng(); continue; /* insert */ case 'i': if (inopen) goto notinvis; tail("insert"); setdot(); nonzero(); aiflag = exclam(); newline(); vmacchng(0); deletenone(); setin(addr2); inappend = 1; ignore(append(gettty, addr2 - 1)); inappend = 0; if (dot == zero && dol > zero) dot = one; nochng(); continue; /* join */ case 'j': tail("join"); c = exclam(); setcount(); nonzero(); newline(); vmacchng(0); if (given < 2 && addr2 != dol) addr2++; join(c); continue; /* k */ case 'k': casek: pastwh(); c = getchar(); if (endcmd(c)) serror("Mark what?|%s requires following letter", Command); newline(); if (!islower(c)) error("Bad mark|Mark must specify a letter"); setdot(); nonzero(); names[c - 'a'] = *addr2 &~ 01; anymarks = 1; continue; /* list */ case 'l': tail("list"); setCNL(); ignorf(setlist(1)); pflag = 0; goto print; case 'm': if (peekchar() == 'a') { ignchar(); if (peekchar() == 'p') { /* map */ tail2of("map"); setnoaddr(); mapcmd(0, 0); continue; } /* mark */ tail2of("mark"); goto casek; } /* move */ tail("move"); vmacchng(0); move(); continue; case 'n': if (peekchar() == 'u') { tail("number"); goto numberit; } /* next */ tail("next"); setnoaddr(); ckaw(); ignore(quickly()); if (getargs()) makargs(); next(); c = 'e'; filename(c); goto doecmd; /* open */ case 'o': tail("open"); oop(); pflag = 0; nochng(); continue; case 'p': case 'P': switch (peekchar()) { /* put */ case 'u': tail("put"); setdot(); c = cmdreg(); eol(); vmacchng(0); if (c) putreg(c); else put(); continue; case 'r': ignchar(); if (peekchar() == 'e') { /* preserve */ tail2of("preserve"); eol(); if (preserve() == 0) error("Preserve failed!"); else error("File preserved."); } tail2of("print"); break; default: tail("print"); break; } /* print */ setCNL(); pflag = 0; print: nonzero(); if (CL && span() > LINES) { flush1(); vclear(); } plines(addr1, addr2, 1); continue; /* quit */ case 'q': tail("quit"); setnoaddr(); c = quickly(); eol(); if (!c) quit: nomore(); if (inopen) { vgoto(WECHO, 0); if (!ateopr()) vnfl(); else { tostop(); } flush(); setty(normf); } cleanup(1); exit(0); case 'r': if (peekchar() == 'e') { ignchar(); switch (peekchar()) { /* rewind */ case 'w': tail2of("rewind"); setnoaddr(); if (!exclam()) { ckaw(); if (chng && dol > zero) error("No write@since last chage (:rewind! overrides)"); } eol(); erewind(); next(); c = 'e'; ungetchar(lastchar()); filename(c); goto doecmd; /* recover */ case 'c': tail2of("recover"); setnoaddr(); c = 'e'; if (!exclam() && chng) c = 'E'; filename(c); if (c == 'E') { ungetchar(lastchar()); ignore(quickly()); } init(); addr2 = zero; laste++; sync(); recover(); rop2(); revocer(); if (status == 0) rop3(c); if (dol != zero) change(); nochng(); continue; } tail2of("read"); } else tail("read"); /* read */ if (savedfile[0] == 0 && dol == zero) c = 'e'; pastwh(); vmacchng(0); if (peekchar() == '!') { setdot(); ignchar(); unix0(0); filter(0); continue; } filename(c); rop(c); nochng(); if (inopen && endline && addr1 > zero && addr1 < dol) dot = addr1 + 1; continue; case 's': switch (peekchar()) { /* * Caution: 2nd char cannot be c, g, or r * because these have meaning to substitute. */ /* set */ case 'e': tail("set"); setnoaddr(); set(); continue; /* shell */ case 'h': tail("shell"); setNAEOL(); vnfl(); putpad(TE); flush(); unixwt(1, unixex("-i", (char *) 0, 0, 0)); vcontin(0); continue; /* source */ case 'o': #ifdef notdef if (inopen) goto notinvis; #endif tail("source"); setnoaddr(); getone(); eol(); source(file, 0); continue; #ifdef SIGTSTP /* stop, suspend */ case 't': tail("stop"); goto suspend; case 'u': tail("suspend"); suspend: if (!ldisc) error("Old tty driver|Not using new tty driver/shell"); c = exclam(); eol(); if (!c) ckaw(); onsusp(); continue; #endif } /* fall into ... */ /* & */ /* ~ */ /* substitute */ case '&': case '~': Command = "substitute"; if (c == 's') tail(Command); vmacchng(0); if (!substitute(c)) pflag = 0; continue; /* t */ case 't': if (peekchar() == 'a') { tail("tag"); tagfind(exclam()); if (!inopen) lchng = chng - 1; else nochng(); continue; } tail("t"); vmacchng(0); move(); continue; case 'u': if (peekchar() == 'n') { ignchar(); switch(peekchar()) { /* unmap */ case 'm': tail2of("unmap"); setnoaddr(); mapcmd(1, 0); continue; /* unabbreviate */ case 'a': tail2of("unabbreviate"); setnoaddr(); mapcmd(1, 1); anyabbrs = 1; continue; } /* undo */ tail2of("undo"); } else tail("undo"); setnoaddr(); markDOT(); c = exclam(); newline(); undo(c); continue; case 'v': switch (peekchar()) { case 'e': /* version */ tail("version"); setNAEOL(); printf("@(#) Version 3.6, 11/3/80."+5); noonl(); continue; /* visual */ case 'i': tail("visual"); if (inopen) { c = 'e'; goto editcmd; } vop(); pflag = 0; nochng(); continue; } /* v */ tail("v"); global(0); nochng(); continue; /* write */ case 'w': c = peekchar(); tail(c == 'q' ? "wq" : "write"); wq: if (skipwh() && peekchar() == '!') { pofix(); ignchar(); setall(); unix0(0); filter(1); } else { setall(); wop(1); nochng(); } if (c == 'q') goto quit; continue; /* xit */ case 'x': tail("xit"); if (!chng) goto quit; c = 'q'; goto wq; /* yank */ case 'y': tail("yank"); c = cmdreg(); setcount(); eol(); vmacchng(0); if (c) YANKreg(c); else yank(); continue; /* z */ case 'z': zop(0); pflag = 0; continue; /* * */ /* @ */ case '*': case '@': c = getchar(); if (c=='\n' || c=='\r') ungetchar(c); if (any(c, "@*\n\r")) c = lastmac; if (isupper(c)) c = tolower(c); if (!islower(c)) error("Bad register"); newline(); setdot(); cmdmac(c); continue; /* | */ case '|': endline = 0; goto caseline; /* \n */ case '\n': endline = 1; caseline: notempty(); if (addr2 == 0) { if (UP != NOSTR && c == '\n' && !inglobal) c = CTRL(k); if (inglobal) addr1 = addr2 = dot; else { if (dot == dol) error("At EOF|At end-of-file"); addr1 = addr2 = dot + 1; } } setdot(); nonzero()((; if (seensemi) addr1 = addr2; getline(*addr1); if (c == CTRL(k)) { flush1(); destline--; if (hadpr) shudclob = 1; } plines(addr1, addr2, 1); continue; /* " */ case '"': comment(); continue; /* # */ case '#': numberit: setCNL(); ignorf(setnumb(1)); pflag = 0; goto print; /* = */ case '=': newline(); setall(); if (inglobal == 2) pofix(); printf("%d", lineno(addr2)); noonl(); continue; /* ! */ case '!': if (addr2 != 0) { vmacchng(0); unix0(0); setdot(); filter(2); } else { unix0(1); pofix(); putpad(TE); flush(); unixwt(1, unixex("-c", uxb, 0, 0)); vclrech(1); /* vcontin(0); */ nochng(); } continue; /* < */ /* > */ case '<': case '>': for (cnt = 1; peekchar() == c; cnt++) ignchar(); setCNL(); vmacchng(0); shift(c, cnt); continue; /* ^D */ /* EOF */ case CTRL(d): case EOF: if (exitoneof) { if (addr2 != 0) dot = addr2; return; } if (!isatty(0)) { if (intty) /* * Chtty sys call at UCB may cause a * input which was a tty to suddenly be * turned into /dev/null. */ onhup(); return; } if (addr2 != 0) { setlastchar('\n'); putnl(); } if (dol == zero) { if (addr2 == 0) putnl(); notempty(); } ungetchar(EOF); zop(hadpr); continue; default: if (!isalpha(c)) break; ungetchar(c); tailprim("", 0, 0); } error("What?|Unknown command character '%c'", c); } } if (intty) /* * Chtty sys call at UCB may cause a * input which was a tty to suddenly be * turned into /dev/null. */ onhup(); return; } if (addr2 != 0) { setlastchar('\n'); putnl(); } if (dol == zero) { if (addr2 == 0) putnl(); notempty(); } ungetchar(EOF); zop(hadpr); continue; default: if (!isalpha(c)) break; ungetchar(c); tailprim("", 0, 0); } error("What?|Unknown commandcmd/ex/ex_cmds2.c 444 0 33 21226 2425425443 7107 /* Copyright (c) 1980 Regents of the University of California */ static char *sccsid = "@(#)ex_cmds2.c 6.1 10/18/80"; #include "ex.h" #include "ex_argv.h" #include "ex_temp.h" #include "ex_tty.h" #include "ex_vis.h" bool pflag, nflag; int poffset; /* * Subroutines for major command loop. */ /* * Is there a single letter indicating a named buffer next? */ cmdreg() { register int c = 0; register int wh = skipwh(); if (wh && isalpha(peekchar())) c = getchar(); return (c); } /* * Tell whether the character ends a command */ endcmd(ch) int ch; { switch (ch) { case '\n': case EOF: endline = 1; return (1); case '|': case '"': endline = 0; return (1); } return (0); } /* * Insist on the end of the command. */ eol() { if (!skipend()) error("Extra chars|Extra characters at end of command"); ignnEOF(); } /* * Print out the message in the error message file at str, * with i an integer argument to printf. */ /*VARARGS2*/ error(str, i) #ifdef lint register char *str; #else register int str; #endif int i; { error0(); merror(str, i); if (writing) { serror(" [Warning - %s is incomplete]", file); writing = 0; } error1(str); } /* * Rewind the argument list. */ erewind() { argc = argc0; argv = argv0; args = args0; if (argc > 1 && !hush) { printf(mesg("%d files@to edit"), argc); if (inopen) putchar(' '); else putNFL(); } } /* * Guts of the pre-printing error processing. * If in visual and catching errors, then we dont mung up the internals, * just fixing up the echo area for the print. * Otherwise we reset a number of externals, and discard unused input. */ error0() { if (laste) { #ifdef VMUNIX tlaste(); #endif laste = 0; sync(); } if (vcatch) { if (splitw == 0) fixech(); if (!SO || !SE) dingdong(); return; } if (input) { input = strend(input) - 1; if (*input == '\n') setlastchar('\n'); input = 0; } setoutt(); flush(); resetflav(); if (!SO || !SE) dingdong(); if (inopen) { /* * We are coming out of open/visual ungracefully. * Restore COLUMNS, undo, and fix tty mode. */ COLUMNS = OCOLUMNS; undvis(); ostop(normf); /* ostop should be doing this putpad(VE); putpad(KE); */ putnl(); } inopen = 0; holdcm = 0; } /* * Post error printing processing. * Close the i/o file if left open. * If catching in visual then throw to the visual catch, * else if a child after a fork, then exit. * Otherwise, in the normal command mode error case, * finish state reset, and throw to top. */ error1(str) char *str; { bool die; if (io > 0) { close(io); io = -1; } die = (getpid() != ppid); /* Only children die */ inappend = inglobal = 0; globp = vglobp = vmacp = 0; if (vcatch && !die) { inopen = 1; vcatch = 0; if (str) noonl(); fixol(); longjmp(vreslab,1); } if (str && !vcatch) putNFL(); if (die) exit(1); lseek(0, 0L, 2); if (inglobal) setlastchar('\n'); while (lastchar() != '\n' && lastchar() != EOF) ignchar(); ungetchar(0); endline = 1; reset(); } fixol() { if (Outchar != vputchar) { flush(); if (state == ONEOPEN || state == HARDOPEN) outline = destline = 0; Outchar = vputchar; vcontin(1); } else { if (destcol) vclreol(); vclean(); } } /* * Does an ! character follow in the command stream? */ exclam() { if (peekchar() == '!') { ignchar(); return (1); } return (0); } /* * Make an argument list for e.g. next. */ makargs() { glob(&frob); argc0 = frob.argc0; argv0 = frob.argv; args0 = argv0[0]; erewind(); } /* * Advance to next file in argument list. */ next() { extern short isalt; /* defined in ex_io.c */ if (argc == 0) error("No more files@to edit"); morargc = argc; isalt = (strcmp(altfile, args)==0) + 1; if (savedfile[0]) CP(altfile, savedfile); CP(savedfile, args); argc--; args = argv ? *++argv : strend(args) + 1; } /* * Eat trailing flags and offsets after a command, * saving for possible later post-command prints. */ newline() { register int c; resetflav(); for (;;) { c = getchar(); switch (c) { case '^': case '-': poffset--; break; case '+': poffset++; break; case 'l': listf++; break; case '#': nflag++; break; case 'p': listf = 0; break; case ' ': case '\t': continue; case '"': comment(); setflav(); return; default: if (!endcmd(c)) serror("Extra chars|Extra characters at end of \"%s\" command", Command); if (c == EOF) ungetchar(c); setflav(); return; } pflag++; } } /* * Before quit or respec of arg list, check that there are * no more files in the arg list. */ nomore() { if (argc == 0 || morargc == argc) return; morargc = argc; merror("%d more file", argc); serror("%s@to edit", plural((long) argc)); } /* * Before edit of new file check that either an ! follows * or the file has not been changed. */ quickly() { if (exclam()) return (1); if (chng && dol > zero) { /* chng = 0; */ xchng = 0; error("No write@since last change (:%s! overrides)", Command); } return (0); } /* * Reset the flavor of the output to print mode with no numbering. */ resetflav() { if (inopen) return; listf = 0; nflag = 0; pflag = 0; poffset = 0; setflav(); } /* * Print an error message with a %s type argument to printf. * Message text comes from error message file. */ serror(str, cp) #ifdef lint register char *str; #else register int str; #endif char *cp; { error0(); smerror(str, cp); error1(str); } /* * Set the flavor of the output based on the flags given * and the number and list options to either number or not number lines * and either use normally decoded (ARPAnet standard) characters or list mode, * where end of lines are marked and tabs print as ^I. */ setflav() { if (inopen) return; setnumb(nflag || value(NUMBER)); setlist(listf || value(LIST)); setoutt(); } /* * Skip white space and tell whether command ends then. */ skipend() { pastwh(); return (endcmd(peekchar()) && peekchar() != '"'); } /* * Set the command name for non-word commands. */ tailspec(c) int c; { static char foocmd[2]; foocmd[0] = c; Command = foocmd; } /* * Try to read off the rest of the command word. * If alphabetics follow, then this is not the command we seek. */ tail(comm) char *comm; { tailprim(comm, 1, 0); } tail2of(comm) char *comm; { tailprim(comm, 2, 0); } char tcommand[20]; tailprim(comm, i, notinvis) register char *comm; int i; bool notinvis; { register char *cp; register int c; Command = comm; for (cp = tcommand; i > 0; i--) *cp++ = *comm++; while (*comm && peekchar() == *comm) *cp++ = getchar(), comm++; c = peekchar(); if (notinvis || isalpha(c)) { /* * Of the trailing lp funny business, only dl and dp * survive the move from ed to ex. */ if (tcommand[0] == 'd' && any(c, "lp")) goto ret; if (tcommand[0] == 's' && any(c, "gcr")) goto ret; while (cp < &tcommand[19] && isalpha(peekchar())) *cp++ = getchar(); *cp = 0; if (notinvis) serror("What?|%s: No such command from open/visual", tcommand); else serror("What?|%s: Not an editor command", tcommand); } ret: *cp = 0; } /* * Continue after a : command from open/visual. */ vcontin(ask) bool ask; { if (vcnt > 0) vcnt = -vcnt; if (inopen) { if (state != VISUAL) { /* * We don't know what a shell command may have left on * the screen, so we move the cursor to the right place * and then put out a newline. But this makes an extra * blank line most of the time so we only do it for :sh * since the prompt gets left on the screen. * * BUG:(( :!echo longer than current line \\c * will screw it up, but be reasonable! */ if (state == CRTOPEN) { termreset(); vgoto(WECHO, 0); } if (!ask) { putch('\r'); putch('\n'); } return; } if (ask) { merror("[Hit return to continue] "); flush(); } #ifndef CBREAK vraw(); #endif if (ask) { #ifdef EATQS /* * Gobble ^Q/^S since the tty driver should be eating * them (as far as the user can see) */ while (peekkey() == CTRL(Q) || peekkey() == CTRL(S)) ignore(getkey()); #endif if(getkey() == ':') { /* Ugh. Extra newlines, but no other way */ putch('\n'); outline = WECHO; ungetkey(':'); } } vclrech(1); if (Peekkey != ':') { putpad(TI); tostart(); /* replaced by ostart. putpad(VS); putpad(KS); */ } } } /* * Put out a newline (before a shell escape) * if in open/visual. */ vnfl() { if (inopen) { if (state != VISUAL && state != CRTOPEN && destline <= WECHO) vclean(); else vmoveitup(1, 0); vgoto(WECHO, 0); vclrbyte(vtube[WECHO], WCOLS); tostop(); /* replaced by the ostop above putpad(VE); putpad(KE); */ } flush(); } ungetkey(':'); } } vclrech(1); if (Peekkey != ':') { putpad(TI); tostart(); /* replaced by ostart. putpad(VS); putpad(KS); */ } } } /* * Put out a newline (before a shell escape) * if in open/visual. */ vnfl() { if (inopen) { if (state != VISUAL && state != CRTOPEN && destline <= WECHO) vclean(); else vmoveitup(1,cmd/ex/ex_cmdsub.c 444 0 33 57477 2425425470 7375 /* Copyright (c) 1980 Regents of the University of California */ static char *sccsid = "@(#)ex_cmdsub.c 6.1 10/18/80"; #include "ex.h" #include "ex_argv.h" #include "ex_temp.h" #include "ex_tty.h" #include "ex_vis.h" /* * Command mode subroutines implementing * append, args, copy, delete, join, move, put, * shift, tag, yank, z and undo */ bool endline = 1; line *tad1; static jnoop(); /* * Append after line a lines returned by function f. * Be careful about intermediate states to avoid scramble * if an interrupt comes in. */ append(f, a) int (*f)(); line *a; { register line *a1, *a2, *rdot; int nline; nline = 0; dot = a; if(FIXUNDO && !inopen && f!=getsub) { undap1 = undap2 = dot + 1; undkind = UNDCHANGE; } while ((*f)() == 0) { if (truedol >= endcore) { if (morelines() < 0) { if (FIXUNDO && f == getsub) { undap1 = addr1; undap2 = addr2 + 1; } error("Out of memory@- too many lines in file"); } } nline++; a1 = truedol + 1; a2 = a1 + 1; dot++; undap2++; dol++; unddol++; truedol++; for (rdot = dot; a1 > rdot;) *--a2 = *--a1; *rdot = 0; putmark(rdot); if (f == gettty) { dirtcnt++; TSYNC(); } } return (nline); } appendnone() { if(FIXUNDO) { undkind = UNDCHANGE; undap1 = undap2 = addr1; } } /* * Print out the argument list, with []'s around the current name. */ pargs() { register char **av = argv0, *as = args0; register int ac; for (ac = 0; ac < argc0; ac++) { if (ac != 0) putchar(' '); if (ac + argc == argc0 - 1) printf("["); lprintf("%s", as); if (ac + argc == argc0 - 1) printf("]"); as = av ? *++av : strend(as) + 1; } noonl(); } /* * Delete lines; two cases are if we are really deleting, * more commonly we are just moving lines to the undo save area. */ delete(hush) bool hush; { register line *a1, *a2; nonzero(); if(FIXUNDO) { register int (*dsavint)(); #ifdef TRACE if (trace) vudump("before delete"); #endif change(); dsavint = signal(SIGINT, SIG_IGN); undkind = UNDCHANGE; a1 = addr1; squish(); a2 = addr2; if (a2++ != dol) { reverse(a1, a2); reverse(a2, dol + 1); reverse(a1, dol + 1); } dol -= a2 - a1; unddel = a1 - 1; if (a1 > dol) a1 = dol; dot = a1; pkill[0] = pkill[1] = 0; signal(SIGINT, dsavint); #ifdef TRACE if (trace) vudump("after delete"); #endif } else { register line *a3; register int i; change(); a1 = addr1; a2 = addr2 + 1; a3 = truedol; i = a2 - a1; unddol -= i; undap2 -= i; dol -= i; truedol -= i; do *a1++ = *a2++; while (a2 <= a3); a1 = addr1; if (a1 > dol) a1 = dol; dot = a1; } if (!hush) killed(); } deletenone() { if(FIXUNDO) { undkind = UNDCHANGE; squish(); unddel = addr1; } } /* * Crush out the undo save area, moving the open/visual * save area down in its place. */ squish() { register line *a1 = dol + 1, *a2 = unddol + 1, *a3 = truedol + 1; if(FIXUNDO) { if (inopen == -1) return; if (a1 < a2 && a2 < a3) do *a1++ = *a2++; while (a2 < a3); truedol -= unddol - dol; unddol = dol; } } /* * Join lines. Special hacks put in spaces, two spaces if * preceding line ends with '.', or no spaces if next line starts with ). */ static int jcount, jnoop(); join(c) int c; { register line *a1; register char *cp, *cp1; cp = genbuf; *cp = 0; for (a1 = addr1; a1 <= addr2; a1++) { getline(*a1); cp1 = linebuf; if (a1 != addr1 && c == 0) { while (*cp1 == ' ' || *cp1 == '\t') cp1++; if (*cp1 && cp > genbuf && cp[-1] != ' ' && cp[-1] != '\t') { if (*cp1 != ')') { *cp++ = ' '; if (cp[-2] == '.') *cp++ = ' '; } } } while (*cp++ = *cp1++) if (cp > &genbuf[LBSIZE-2]) error("Line overflow|Result line of join would be too long"); cp--; } strcLIN(genbuf); delete(0); jcount = 1; if (FIXUNDO) undap1 = undap2 = addr1; ignore(append(jnoop, --addr1)); if (FIXUNDO) vundkind = VMANY; } static jnoop() { return(--jcount); } /* * Move and copy lines. Hard work is done by move1 which * is also called by undo. */ int getcopy(); move() { register line *adt; bool iscopy = 0; if (Command[0] == 'm') { setdot1(); markpr(addr2 == dot ? addr1 - 1 : addr2 + 1); } else { iscopy++; setdot(); } nonzero(); adt = address(0); if (adt == 0) serror("%s where?|%s requires a trailing address", Command); newline(); move1(iscopy, adt); killed(); } move1(cflag, addrt) int cflag; line *addrt; { register line *adt, *ad1, *ad2; int lines; adt = addrt; lines = (addr2 - addr1) + 1; if (cflag) { tad1 = addr1; ad1 = dol; ignore(append(getcopy, ad1++)); ad2 = dol; } else { ad2 = addr2; for (ad1 = addr1; ad1 <= ad2;) *ad1++ &= ~01; ad1 = addr1; } ad2++; if (adt < ad1) { if (adt + 1 == ad1 && !cflag && !inglobal) error("That move would do nothing!"); dot = adt + (ad2 - ad1); if (++adt != ad1) { reverse(adt, ad1); reverse(ad1, ad2); reverse(adt, ad2); } } else if (adt >= ad2) { dot = adt++; reverse(ad1, ad2); reverse(ad2, adt); reverse(ad1, adt); } else error("Move to a moved line"); change(); if (!inglobal) if(FIXUNDO) { if (cflag) { undap1 = addrt + 1; undap2 = undap1 + lines; deletenone(); } else { undkind = UNDMOVE; undap1 = addr1; undap2 = addr2; unddel = addrt; squish(); } } } getcopy() { if (tad1 > addr2) return (EOF); getline(*tad1++); return (0); } /* * Put lines in the buffer from the undo save area. */ getput() { if (tad1 > unddol) return (EOF); getline(*tad1++); tad1++; return (0); } put() { register int cnt; if (!FIXUNDO) error("Cannot put inside global/macro"); cnt = unddol - dol; if (cnt && inopen && pkill[0] && pkill[1]) { pragged(1); return; } tad1 = dol + 1; ignore(append(getput, addr2)); undkind = UNDPUT; notecnt = cnt; netchange(cnt); } /* * A tricky put, of a group of lines in the middle * of an existing line. Only from open/visual. * Argument says pkills have meaning, e.g. called from * put; it is 0 on calls from putreg. */ pragged(kill) bool kill; { extern char *cursor; register char *gp = &genbuf[cursor - linebuf]; /* * This kind of stuff is TECO's forte. * We just grunge along, since it cuts * across our line-oriented model of the world * almost scrambling our addled brain. */ if (!kill) getDOT(); strcpy(genbuf, linebuf); getline(*unddol); if (kill) *pkill[1] = 0; strcat(linebuf, gp); putmark(unddol); getline(dol[1]); if (kill) strcLIN(pkill[0]); strcpy(gp, linebuf); strcLIN(genbuf); putmark(dol+1); undkind = UNDCHANGE; undap1 = dot; undap2 = dot + 1; unddel = dot - 1; undo(1); } /* * Shift lines, based on c. * If c is neither < nor >, then this is a lisp aligning =. */ shift(c, cnt) int c; int cnt; { register line *addr; register char *cp; char *dp; register int i; if(FIXUNDO) save12(), undkind = UNDCHANGE; cnt *= value(SHIFTWIDTH); for (addr = addr1; addr <= addr2; addr++) { dot = addr; #ifdef LISPCODE if (c == '=' && addr == addr1 && addr != addr2) continue; #endif getDOT(); i = whitecnt(linebuf); switch (c) { case '>': if (linebuf[0] == 0) continue; cp = genindent(i + cnt); break; case '<': if (i == 0) continue; i -= cnt; cp = i > 0 ? genindent(i) : genbuf; break; #ifdef LISPCODE default: i = lindent(addr); getDOT(); cp = genindent(i); break; #endif } if (cp + strlen(dp = vpastwh(linebuf)) >= &genbuf[LBSIZE - 2]) error("Line too long|Result line after shift would be too long"); CP(cp, dp); strcLIN(genbuf); putmark(addr); } killed(); } /* * Find a tag in the tags file. * Most work here is in parsing the tags file itself. */ tagfind(quick) bool quick; { char cmdbuf[BUFSIZ]; char filebuf[FNSIZE]; char tagfbuf[128]; register int c, d; bool samef = 1; int tfcount = 0; int omagic; char *fn, *fne; #ifdef VMUNIX /* * We have lots of room so we bring in stdio and do * a binary search on the tags file. */ # undef EOF # include # undef getchar # undef putchar FILE *iof; char iofbuf[BUFSIZ]; ((long mid; /* assumed byte offset */ long top, bot; /* length of tag file */ struct stat sbuf; #endif omagic = value(MAGIC); if (!skipend()) { register char *lp = lasttag; while (!iswhite(peekchar()) && !endcmd(peekchar())) if (lp < &lasttag[sizeof lasttag - 2]) *lp++ = getchar(); else ignchar(); *lp++ = 0; if (!endcmd(peekchar())) badtag: error("Bad tag|Give one tag per line"); } else if (lasttag[0] == 0) error("No previous tag"); c = getchar(); if (!endcmd(c)) goto badtag; if (c == EOF) ungetchar(c); clrstats(); /* * Loop once for each file in tags "path". */ CP(tagfbuf, svalue(TAGS)); fne = tagfbuf - 1; while (fne) { fn = ++fne; while (*fne && *fne != ' ') fne++; if (*fne == 0) fne = 0; /* done, quit after this time */ else *fne = 0; /* null terminate filename */ #ifdef VMUNIX iof = fopen(fn, "r"); if (iof == NULL) continue; tfcount++; setbuf(iof, iofbuf); fstat(fileno(iof), &sbuf); top = sbuf.st_size; if (top == 0L || iof == NULL) top = -1L; bot = 0L; while (top >= bot) { #else /* * Avoid stdio and scan tag file linearly. */ io = open(fn, 0); if (io<0) continue; tfcount++; while (getfile() == 0) { #endif /* loop for each tags file entry */ register char *cp = linebuf; register char *lp = lasttag; char *oglobp; #ifdef VMUNIX mid = (top + bot) / 2; fseek(iof, mid, 0); if (mid > 0) /* to get first tag in file to work */ /* scan to next \n */ if(fgets(linebuf, sizeof linebuf, iof)==NULL) goto goleft; /* get the line itself */ if(fgets(linebuf, sizeof linebuf, iof)==NULL) goto goleft; linebuf[strlen(linebuf)-1] = 0; /* was '\n' */ #endif while (*cp && *lp == *cp) cp++, lp++; if ((*lp || !iswhite(*cp)) && (value(TAGLENGTH)==0 || lp-lasttag < value(TAGLENGTH))) { #ifdef VMUNIX if (*lp > *cp) bot = mid + 1; else goleft: top = mid - 1; #endif /* Not this tag. Try the next */ continue; } /* * We found the tag. Decode the line in the file. */ #ifdef VMUNIX fclose(iof); #else close(io); #endif /* Rest of tag if abbreviated */ while (!iswhite(*cp)) cp++; /* name of file */ while (*cp && iswhite(*cp)) cp++; if (!*cp) badtags: serror("%s: Bad tags file entry", lasttag); lp = filebuf; while (*cp && *cp != ' ' && *cp != '\t') { if (lp < &filebuf[sizeof filebuf - 2]) *lp++ = *cp; cp++; } *lp++ = 0; if (*cp == 0) goto badtags; if (dol != zero) { /* * Save current position in 't for ^^ in visual. */ names['t'-'a'] = *dot &~ 01; if (inopen) { extern char *ncols['z'-'a'+2]; extern char *cursor; ncols['t'-'a'] = cursor; } } strcpy(cmdbuf, cp); if (strcmp(filebuf, savedfile) || !edited) { char cmdbuf2[sizeof filebuf + 10]; /* Different file. Do autowrite & get it. */ if (!quick) { ckaw(); if (chng && dol > zero) error("No write@since last change (:tag! overrides)"); } oglobp = globp; strcpy(cmdbuf2, "e! "); strcat(cmdbuf2, filebuf); globp = cmdbuf2; d = peekc; ungetchar(0); commands(1, 1); peekc = d; globp = oglobp; value(MAGIC) = omagic; samef = 0; } /* * Look for pattern in the current file. */ oglobp = globp; globp = cmdbuf; d = peekc; ungetchar(0); if (samef) markpr(dot); /* * BUG: if it isn't found (user edited header * line) we get left in nomagic mode. */ value(MAGIC) = 0; commands(1, 1); peekc = d; globp = oglobp; value(MAGIC) = omagic; return; } /* end of "for each tag in file" */ /* * No such tag in this file. Close it and try the next. */ #ifdef VMUNIX fclose(iof); #else close(io); #endif } /* end of "for each file in path" */ if (tfcount <= 0) error("No tags file"); else serror("%s: No such tag@in tags file", lasttag); } /* * Save lines from addr1 thru addr2 as though * they had been deleted. */ yank() { if (!FIXUNDO) error("Can't yank inside global/macro"); save12(); undkind = UNDNONE; killcnt(addr2 - addr1 + 1); } /* * z command; print windows of text in the file. * * If this seems unreasonably arcane, the reasons * are historical. This is one of the first commands * added to the first ex (then called en) and the * number of facilities here were the major advantage * of en over ed since they allowed more use to be * made of fast terminals w/o typing .,.22p all the time. */ bool zhadpr; bool znoclear; short zweight; zop(hadpr) int hadpr; { register int c, lines, op; bool excl; zhadpr = hadpr; notempty(); znoclear = 0; zweight = 0; excl = exclam(); switch (c = op = getchar()) { case '^': zweight = 1; case '-': case '+': while (peekchar() == op) { ignchar(); zweight++; } case '=': case '.': c = getchar(); break; case EOF: znoclear++; break; default: op = 0; break; } if (isdigit(c)) { lines = c - '0'; for(;;) { c = getchar(); if (!isdigit(c)) break; lines *= 10; lines += c - '0'; } if (lines < LINES) znoclear++; value(WINDOW) = lines; if (op == '=') lines += 2; } else lines = op == EOF ? value(SCROLL) : excl ? LINES - 1 : 2*value(SCROLL); if (inopen || c != EOF) { ungetchar(c); newline(); } addr1 = addr2; if (addr2 == 0 && dot < dol && op == 0) addr1 = addr2 = dot+1; setdot(); zop2(lines, op); } zop2(lines, op) register int lines; register int op; { register line *split; split = NULL; switch (op) { case EOF: if (addr2 == dol) error("\nAt EOF"); case '+': if (addr2 == dol) error("At EOF"); addr2 += lines * zweight; if (addr2 > dol) error("Hit BOTTOM"); addr2++; default: addr1 = addr2; addr2 += lines-1; dot = addr2; break; case '=': case '.': znoclear = 0; lines--; lines >>= 1; if (op == '=') lines--; addr1 = addr2 - lines; if (op == '=') dot = split = addr2; addr2 += lines; if (op == '.') { markDOT(); dot = addr2; } break; case '^': case '-': addr2 -= lines * zweight; if (addr2 < one) error("Hit TOP"); lines--; addr1 = addr2 - lines; dot = addr2; break; } if (addr1 <= zero) addr1 = one; if (addr2 > dol) addr2 = dol; if (dot > dol) dot = dol; if (addr1 > addr2) return; if (op == EOF && zhadpr) { getline(*addr1); putchar('\r' | QUOTE); shudclob = 1; } else if (znoclear == 0 && CL != NOSTR && !inopen) { flush1(); vclear(); } if (addr2 - addr1 > 1) pstart(); if (split) { plines(addr1, split - 1, 0); splitit(); plines(split, split, 0); splitit(); addr1 = split + 1; } plines(addr1, addr2, 0); } static splitit() { register int l; for (l = COLUMNS > 80 ? 40 : COLUMNS / 2; l > 0; l--) putchar('-'); putnl(); } plines(adr1, adr2, movedot) line *adr1; register line *adr2; bool movedot; { register line *addr; pofix(); for (addr = adr1; addr <= adr2; addr++) { getline(*addr); pline(lineno(addr)); if (inopen) putchar('\n' | QUOTE); if (movedot) dot = addr; } } pofix() { if (inopen && Outchar != termchar) { vnfl(); setoutt(); } } /* * Dudley doright to the rescue. * Undo saves the day again. * A tip of the hatlo hat to Warren Teitleman * who made undo as useful as do. * * Command level undo works easily because * the editor has a unique temporary file * index for every line which ever existed. * We don't have to save large blocks of text, * only the indices which are small. We do this * by moving them to after the last line in the * line buffer array, and marking down info * about whence they came. * * Undo is its own inverse. */ undo(c) bool c; { register int i; register line *jp, *kp; line *dolp1, *newdol, *newadot; #ifdef TRACE if (trace) vudump("before undo"); #endif if (inglobal && inopen <= 0) error("Can't undo in global@commands"); if (!c) somechange(); pkill[0] = pkill[1] = 0; change(); if (undkind == UNDMOVE) { /* * Command to be undone is a move command. * This is handled as a special case by noting that * a move "a,b m c" can be inverted by another move. */ if ((i = (jp = unddel) - undap2) > 0) { /* * when c > b inverse is a+(c-b),c m a-1 */ addr2 = jp; addr1 = (jp = undap1) + i; unddel = jp-1; } else { /* * when b > c inverse is c+1,c+1+(b-a) m b */ addr1 = ++jp; addr2 = jp + ((unddel = undap2) - undap1); } kp = undap1; move1(0, unddel); dot = kp; Command = "move"; killed(); } else { int cnt; newadot = dot; cnt = lineDOL(); newdol = dol; dolp1 = dol + 1; /* * Command to be undone is a non-move. * All such commands are treated as a combination of * a delete command and a append command. * We first move the lines appended by the last command * from undap1 to undap2-1 so that they are just before the * saved deleted lines. */ if ((i = (kp = undap2) - (jp = undap1)) > 0) { if (kp != dolp1) { reverse(jp, kp); reverse(kp, dolp1); reverse(jp, dolp1); } /* * Account for possible backward motion of target * for restoration of saved deleted lines. */ if (unddel >= jp) unddel -= i; newdol -= i; /* * For the case where no lines are restored, dot * is the line before the first line deleted. */ dot = jp-1; } /* * Now put the deleted lines, if any, back where they were. * Basic operation is: dol+1,unddol m unddel */ if (undkind == UNDPUT) { unddel = undap1 - 1; squish(); } jp = unddel + 1; if ((i = (kp = unddol) - dol) > 0) { if (jp != dolp1) { reverse(jp, dolp1); reverse(dolp1, ++kp); reverse(jp, kp); } /* * Account for possible forward motion of the target * for restoration of the deleted lines. */ if (undap1 >= jp) undap1 += i; /* * Dot is the first resurrected line. */ dot = jp; newdol += i; } /* * Clean up so we are invertible */ unddel = undap1 - 1; undap1 = jp; undap2 = jp + i; dol = newdol; netchHAD(cnt); if (undkind == UNDALL) { dot = undadot; undadot = newadot; } else undkind = UNDCHA((NGE; } /* * Defensive programming - after a munged undadot. * Also handle empty buffer case. */ if ((dot <= zero || dot > dol) && dot != dol) dot = one; #ifdef TRACE if (trace) vudump("after undo"); #endif } /* * Be (almost completely) sure there really * was a change, before claiming to undo. */ somechange() { register line *ip, *jp; switch (undkind) { case UNDMOVE: return; case UNDCHANGE: if (undap1 == undap2 && dol == unddol) break; return; case UNDPUT: if (undap1 != undap2) return; break; case UNDALL: if (unddol - dol != lineDOL()) return; for (ip = one, jp = dol + 1; ip <= dol; ip++, jp++) if ((*ip &~ 01) != (*jp &~ 01)) return; break; case UNDNONE: error("Nothing to undo"); } error("Nothing changed|Last undoable command didn't change anything"); } /* * Map command: * map src dest */ mapcmd(un, ab) int un; /* true if this is unmap command */ int ab; /* true if this is abbr command */ { char lhs[100], rhs[100]; /* max sizes resp. */ register char *p; register char c; char *dname; struct maps *mp; /* the map structure we are working on */ mp = ab ? abbrevs : exclam() ? immacs : arrows; if (skipend()) { int i; /* print current mapping values */ if (peekchar() != EOF) ignchar(); if (un) error("Missing lhs"); if (inopen) pofix(); for (i=0; mp[i].mapto; i++) if (mp[i].cap) { lprintf("%s", mp[i].descr); putchar('\t'); lprintf("%s", mp[i].cap); putchar('\t'); lprintf("%s", mp[i].mapto); putNFL(); } return; } ignore(skipwh()); for (p=lhs; ; ) { c = getchar(); if (c == CTRL(v)) { c = getchar(); } else if (!un && any(c, " \t")) { /* End of lhs */ break; } else if (endcmd(c) && c!='"') { ungetchar(c); if (un) { newline(); *p = 0; addmac(lhs, NOSTR, NOSTR, mp); return; } else error("Missing rhs"); } *p++ = c; } *p = 0; if (skipend()) error("Missing rhs"); for (p=rhs; ; ) { c = getchar(); if (c == CTRL(v)) { c = getchar(); } else if (endcmd(c) && c!='"') { ungetchar(c); break; } *p++ = c; } *p = 0; newline(); /* * Special hack for function keys: #1 means key f1, etc. * If the terminal doesn't have function keys, we just use #1. */ if (lhs[0] == '#') { char *fnkey; char *fkey(); char funkey[3]; fnkey = fkey(lhs[1] - '0'); funkey[0] = 'f'; funkey[1] = lhs[1]; funkey[2] = 0; if (fnkey) strcpy(lhs, fnkey); dname = funkey; } else { dname = lhs; } addmac(lhs,rhs,dname,mp); } /* * Add a macro definition to those that already exist. The sequence of * chars "src" is mapped into "dest". If src is already mapped into something * this overrides the mapping. There is no recursion. Unmap is done by * using NOSTR for dest. Dname is what to show in listings. mp is * the structure to affect (arrows, etc). */ addmac(src,dest,dname,mp) register char *src, *dest, *dname; register struct maps *mp; { register int slot, zer; #ifdef TRACE if (trace) fprintf(trace, "addmac(src='%s', dest='%s', dname='%s', mp=%x\n", src, dest, dname, mp); #endif if (dest && mp==arrows) { /* Make sure user doesn't screw himself */ /* * Prevent tail recursion. We really should be * checking to see if src is a suffix of dest * but this makes mapping involving escapes that * is reasonable mess up. */ if (src[1] == 0 && src[0] == dest[strlen(dest)-1]) error("No tail recursion"); /* * We don't let the user rob himself of ":", and making * multi char words is a bad idea so we don't allow it. * Note that if user sets mapinput and maps all of return, * linefeed, and escape, he can screw himself. This is * so weird I don't bother to check for it. */ if (isalpha(src[0]) && src[1] || any(src[0],":")) error("Too dangerous to map that"); } else if (dest) { /* check for tail recursion in input mode: fussier */ if (eq(src, dest+strlen(dest)-strlen(src))) error("No tail recursion"); } /* * If the src were null it would cause the dest to * be mapped always forever. This is not good. */ if (src == NOSTR || src[0] == 0) error("Missing lhs"); /* see if we already have a def for src */ zer = -1; for (slot=0; mp[slot].mapto; slot++) { if (mp[slot].cap) { if (eq(src, mp[slot].cap) || eq(src, mp[slot].mapto)) break; /* if so, reuse slot */ } else { zer = slot; /* remember an empty slot */ } } if (dest == NOSTR) { /* unmap */ if (mp[slot].cap) { mp[slot].cap = NOSTR; mp[slot].descr = NOSTR; } else { error("Not mapped|That macro wasn't mapped"); } return; } /* reuse empty slot, if we found one and src isn't already defined */ if (zer >= 0 && mp[slot].mapto == 0) slot = zer; /* if not, append to end */ if (slot >= MAXNOMACS) error("Too many macros"); if (msnext == 0) /* first time */ msnext = mapspace; /* Check is a bit conservative, we charge for dname even if reusing src */ if (msnext - mapspace + strlen(dest) + strlen(src) + strlen(dname) + 3 > MAXCHARMACS) error("Too much macro text"); CP(msnext, src); mp[slot].cap = msnext; msnext += strlen(src) + 1; /* plus 1 for null on the end */ CP(msnext, dest); mp[slot].mapto = msnext; msnext += strlen(dest) + 1; if (dname) { CP(msnext, dname); mp[slot].descr = msnext; msnext += strlen(dname) + 1; } else { /* default descr to string user enters */ mp[slot].descr = src; } } /* * Implements macros from command mode. c is the buffer to * get the macro from. */ cmdmac(c) char c; { char macbuf[BUFSIZ]; line *ad, *a1, *a2; char *oglobp; char pk; bool oinglobal; lastmac = c; oglobp = globp; oinglobal = inglobal; pk = peekc; peekc = 0; if (inglobal < 2) inglobal = 1; regbuf(c, macbuf, sizeof(macbuf)); a1 = addr1; a2 = addr2; for (ad=a1; ad<=a2; ad++) { globp = macbuf; dot = ad; commands(1,1); } globp = oglobp; inglobal = oinglobal; peekc = pk; } c; } } /* * Implements macros from command mode. c is the buffer to * get the macro from. */ cmdmac(c) char c; { char macbuf[BUFSIZ]; line *ad, *a1, *a2; char *oglobp; char pk; bool ocmd/ex/ex_data.c 444 0 33 4707 2425425500 6767 /* Copyright (c) 1980 Regents of the University of California */ static char *sccsid = "@(#)ex_data.c 6.1 10/18/80"; #include "ex.h" #include "ex_tty.h" /* * Initialization of option values. * The option #defines in ex_vars.h are made * from this file by the script makeoptions. * * These initializations are done char by char instead of as strings * to confuse xstr so it will leave them alone. */ char direct[ONMSZ] = { '/', 't', 'm', 'p' }; char paragraphs[ONMSZ] = { 'I', 'P', 'L', 'P', 'P', 'P', 'Q', 'P', /* -ms macros */ 'P', ' ', 'L', 'I', /* -mm macros */ 'b', 'p' /* bare nroff */ }; char sections[ONMSZ] = { 'N', 'H', 'S', 'H', /* -ms macros */ 'H', ' ', 'H', 'U' /* -mm macros */ }; char shell[ONMSZ] = { '/', 'b', 'i', 'n', '/', 's', 'h' }; char tags[ONMSZ] = { 't', 'a', 'g', 's', ' ', '/', 'u', 's', 'r', '/', 'l', 'i', 'b', '/', 't', 'a', 'g', 's' }; char ttytype[ONMSZ] = { 'd', 'u', 'm', 'b' }; short COLUMNS = 80; short LINES = 24; struct option options[NOPTS + 1] = { "autoindent", "ai", ONOFF, 0, 0, 0, "autoprint", "ap", ONOFF, 1, 1, 0, "autowrite", "aw", ONOFF, 0, 0, 0, "beautify", "bf", ONOFF, 0, 0, 0, "directory", "dir", STRING, 0, 0, direct, "edcompatible", "ed", ONOFF, 0, 0, 0, "errorbells", "eb", ONOFF, 0, 0, 0, "hardtabs", "ht", NUMERIC, 8, 8, 0, "ignorecase", "ic", ONOFF, 0, 0, 0, "lisp", 0, ONOFF, 0, 0, 0, "list", 0, ONOFF, 0, 0, 0, "magic", 0, ONOFF, 1, 1, 0, "mesg", 0, ONOFF, 1, 1, 0, "number", "nu", ONOFF, 0, 0, 0, "open", 0, ONOFF, 1, 1, 0, "optimize", "opt", ONOFF, 0, 0, 0, "paragraphs", "para", STRING, 0, 0, paragraphs, "prompt", 0, ONOFF, 1, 1, 0, "readonly", "ro", ONOFF, 0, 0, 0, "redraw", 0, ONOFF, 0, 0, 0, "remap", 0, ONOFF, 1, 1, 0, "report", 0, NUMERIC, 5, 5, 0, "scroll", "scr", NUMERIC, 12, 12, 0, "sections", "sect", STRING, 0, 0, sections, "shell", "sh", STRING, 0, 0, shell, "shiftwidth", "sw", NUMERIC, TABS, TABS, 0, "showmatch", "sm", ONOFF, 0, 0, 0, "slowopen", "slow", ONOFF, 0, 0, 0, "tabstop", "ts", NUMERIC, TABS, TABS, 0, "taglength", "tl", NUMERIC, 0, 0, 0, "tags", "tag", STRING, 0, 0, tags, "term", 0, OTERM, 0, 0, ttytype, "terse", 0, ONOFF, 0, 0, 0, "timeout", "to", ONOFF, 1, 1, 0, "ttytype", "tty", OTERM, 0, 0, ttytype, "warn", 0, ONOFF, 1, 1, 0, "window", "wi", NUMERIC, 23, 23, 0, "wrapscan", "ws", ONOFF, 1, 1, 0, "wrapmargin", "wm", NUMERIC, 0, 0, 0, "writeany", "wa", ONOFF, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; 0, 0, 0, "slowopen", "slow", ONOFF, 0, 0, 0, "tabstocmd/ex/ex_get.c 444 0 33 10267 2425425512 6656 /* Copyright (c) 1980 Regents of the University of California */ static char *sccsid = "@(#)ex_get.c 6.1 10/18/80"; #include "ex.h" #include "ex_tty.h" /* * Input routines for command mode. * Since we translate the end of reads into the implied ^D's * we have different flavors of routines which do/don't return such. */ static bool junkbs; short lastc = '\n'; ignchar() { ignore(getchar()); } getchar() { register int c; do c = getcd(); while (!globp && c == CTRL(d)); return (c); } getcd() { r((egister int c; again: c = getach(); if (c == EOF) return (c); c &= TRIM; if (!inopen) if (!globp && c == CTRL(d)) setlastchar('\n'); else if (junk(c)) { checkjunk(c); goto again; } return (c); } peekchar() { if (peekc == 0) peekc = getchar(); return (peekc); } peekcd() { if (peekc == 0) peekc = getcd(); return (peekc); } getach() { register int c; static char inline[128]; c = peekc; if (c != 0) { peekc = 0; return (c); } if (globp) { if (*globp) return (*globp++); globp = 0; return (lastc = EOF); } top: if (input) { if (c = *input++) { if (c &= TRIM) return (lastc = c); goto top; } input = 0; } flush(); if (intty) { c = read(0, inline, sizeof inline - 4); if (c < 0) return (lastc = EOF); if (c == 0 || inline[c-1] != '\n') inline[c++] = CTRL(d); if (inline[c-1] == '\n') noteinp(); inline[c] = 0; for (c--; c >= 0; c--) if (inline[c] == 0) inline[c] = QUOTE; input = inline; goto top; } if (read(0, (char *) &lastc, 1) != 1) lastc = EOF; return (lastc); } /* * Input routine for insert/append/change in command mode. * Most work here is in handling autoindent. */ static short lastin; gettty() { register int c = 0; register char *cp = genbuf; char hadup = 0; int numbline(); extern int (*Pline)(); int offset = Pline == numbline ? 8 : 0; int ch; if (intty && !inglobal) { if (offset) { holdcm = 1; printf(" %4d ", lineDOT() + 1); flush(); holdcm = 0; } if (value(AUTOINDENT) ^ aiflag) { holdcm = 1; #ifdef LISPCODE if (value(LISP)) lastin = lindent(dot + 1); #endif tab(lastin + offset); while ((c = getcd()) == CTRL(d)) { if (lastin == 0 && isatty(0) == -1) { holdcm = 0; return (EOF); } lastin = backtab(lastin); tab(lastin + offset); } switch (c) { case '^': case '0': ch = getcd(); if (ch == CTRL(d)) { if (c == '0') lastin = 0; if (!OS) { putchar('\b' | QUOTE); putchar(' ' | QUOTE); putchar('\b' | QUOTE); } tab(offset); hadup = 1; c = getchar(); } else ungetchar(ch); break; case '.': if (peekchar() == '\n') { ignchar(); noteinp(); holdcm = 0; return (EOF); } break; case '\n': hadup = 1; break; } } flush(); holdcm = 0; } if (c == 0) c = getchar(); while (c != EOF && c != '\n') { if (cp > &genbuf[LBSIZE - 2]) error("Input line too long"); *cp++ = c; c = getchar(); } if (c == EOF) { if (inglobal) ungetchar(EOF); return (EOF); } *cp = 0; cp = linebuf; if ((value(AUTOINDENT) ^ aiflag) && hadup == 0 && intty && !inglobal) { lastin = c = smunch(lastin, genbuf); for (c = lastin; c >= value(TABSTOP); c -= value(TABSTOP)) *cp++ = '\t'; for (; c > 0; c--) *cp++ = ' '; } CP(cp, genbuf); if (linebuf[0] == '.' && linebuf[1] == 0) return (EOF); return (0); } /* * Crunch the indent. * Hard thing here is that in command mode some of the indent * is only implicit, so we must seed the column counter. * This should really be done differently so as to use the whitecnt routine * and also to hack indenting for LISP. */ smunch(col, ocp) register int col; char *ocp; { register char *cp; cp = ocp; for (;;) switch (*cp++) { case ' ': col++; continue; case '\t': col += value(TABSTOP) - (col % value(TABSTOP)); continue; default: cp--; CP(ocp, cp); return (col); } } char *cntrlhm = "^H discarded\n"; checkjunk(c) char c; { if (junkbs == 0 && c == '\b') { write(2, cntrlhm, 13); junkbs = 1; } } line * setin(addr) line *addr; { if (addr == zero) lastin = 0; else getline(*addr), lastin = smunch(0, linebuf); } char *ocp; { register char *cp; cp = ocp; for (;;) switch (*cp++) { case ' ': col++; continue; case '\t': col += value(TABSTOP) - (col % value(TABSTOP)); continue; default: cp--; CP(ocp, cp); return (col); } } char *cntrlhm = "^H discarded\n"; checkjunk(c) char c; { if (junkbs == 0 &cmd/ex/ex_io.c 444 0 33 34730 2425425531 6510 /* Copyright (c) 1980 Regents of the University of California */ static char *sccsid = "@(#)ex_io.c 6.2 10/23/80"; #include "ex.h" #include "ex_argv.h" #include "ex_temp.h" #include "ex_tty.h" #include "ex_vis.h" /* * File input/output, source, preserve and recover */ /* * Following remember where . was in the previous file for return * on file switching. */ int altdot; int oldadot; bool wasalt; short isalt; long cntch; /* Count of characters on unit io */ #ifndef VMUNIX short cntln; /* Count of lines " */ #else int cntln; #endif long cntnull; /* Count of nulls " */ long cntodd; /* Count of non-ascii characters " */ /* * Parse file name for command encoded by comm. * If comm is E then command is doomed and we are * parsing just so user won't have to retype the name. */ filename(comm) int comm; { register int c = comm, d; register int i; d = getchar(); if (endcmd(d)) { if (savedfile[0] == 0 && comm != 'f') error("No file|No current filename"); CP(file, savedfile); wasalt = (isalt > 0) ? isalt-1 : 0; isalt = 0; oldadot = altdot; if (c == 'e' || c == 'E') altdot = lineDOT(); if (d == EOF) ungetchar(d); } else { ungetchar(d); getone(); eol(); if (savedfile[0] == 0 && c != 'E' && c != 'e') { c = 'e'; edited = 0; } wasalt = strcmp(file, altfile) == 0; oldadot = altdot; switch (c) { case 'f': edited = 0; /* fall into ... */ case 'e': if (savedfile[0]) { altdot = lineDOT(); CP(altfile, savedfile); } CP(savedfile, file); break; default: if (file[0]) { if (c != 'E') altdot = lineDOT(); CP(altfile, file); } break; } } if (hush && comm != 'f' || comm == 'E') return; if (file[0] != 0) { lprintf("\"%s\"", file); if (comm == 'f') { if (value(READONLY)) printf(" [Read only]"); if (!edited) printf(" [Not edited]"); if (tchng) printf(" [Modified]"); } flush(); } else printf("No file "); if (comm == 'f') { if (!(i = lineDOL())) i++; printf(" line %d of %d --%ld%%--", lineDOT(), lineDOL(), (long) 100 * lineDOT() / i); } } /* * Get the argument words for a command into genbuf * expanding # and %. */ getargs() { register int c; register char *cp, *fp; static char fpatbuf[32]; /* hence limit on :next +/pat */ pastwh(); if (peekchar() == '+') { for (cp = fpatbuf;;) { c = *cp++ = getchar(); if (cp >= &fpatbuf[sizeof(fpatbuf)]) error("Pattern too long"); if (c == '\\' && isspace(peekchar())) c = getchar(); if (c == EOF || isspace(c)) { ungetchar(c); *--cp = 0; firstpat = &fpatbuf[1]; break; } } } if (skipend()) return (0); CP(genbuf, "echo "); cp = &genbuf[5]; for (;;) { c = getchar(); if (endcmd(c)) { ungetchar(c); break; } switch (c) { case '\\': if (any(peekchar(), "#%|")) c = getchar(); /* fall into... */ default: if (cp > &genbuf[LBSIZE - 2]) flong: error("Argument buffer overflow"); *cp++ = c; break; case '#': fp = altfile; if (*fp == 0) error("No alternate filename@to substitute for #"); goto filexp; case '%': fp = savedfile; if (*fp == 0) error("No current filename@to substitute for %%"); filexp: while (*fp) { if (cp > &genbuf[LBSIZE - 2]) goto flong; *cp++ = *fp++; } break; } } *cp = 0; return (1); } /* * Glob the argument words in genbuf, or if no globbing * is implied, just split them up directly. */ glob(gp) struct glob *gp; { int pvec[2]; register char **argv = gp->argv; register char *cp = gp->argspac; register int c; char ch; int nleft = NCARGS; gp->argc0 = 0; if (gscan() == 0) { register char *v = genbuf + 5; /* strlen("echo ") */ for (;;) { while (isspace(*v)) v++; if (!*v) break; *argv++ = cp; while (*v && !isspace(*v)) *cp++ = *v++; *cp++ = 0; gp->argc0++; } *argv = 0; return; } if (pipe(pvec) < 0) error("Can't make pipe to glob"); pid = fork(); io = pvec[0]; if (pid < 0) { close(pvec[1]); error("Can't fork to do glob"); } if (pid == 0) { int oerrno; close(1); dup(pvec[1]); close(pvec[0]); close(2); /* so errors don't mess up the screen */ open("/dev/null", 1); execl(svalue(SHELL), "sh", "-c", genbuf, 0); oerrno = errno; close(1); dup(2); errno = oerrno; filioerr(svalue(SHELL)); } close(pvec[1]); do { *argv = cp; for (;;) { if (read(io, &ch, 1) != 1) { close(io); c = -1; } else c = ch & TRIM; if (c <= 0 || isspace(c)) break; *cp++ = c; if (--nleft <= 0) error("Arg list too long"); } if (cp != *argv) { --nleft; *cp++ = 0; gp->argc0++; if (gp->argc0 >= NARGS) error("Arg list too long"); argv++; } } while (c >= 0); waitfor(); if (gp->argc0 == 0) error("No match"); } /* * Scan genbuf for shell metacharacters. * Set is union of v7 shell and csh metas. */ gscan() { register char *cp; for (cp = genbuf; *cp; cp++) if (any(*cp, "~{[*?$`'\"\\")) return (1); return (0); } /* * Parse one filename into file. */ getone() { register char *str; struct glob G; if (getargs() == 0) error("Missing filename"); glob(&G); if (G.argc0 > 1) error("Ambiguous|Too many file names"); str = G.argv[G.argc0 - 1]; if (strlen(str) > FNSIZE - 4) error("Filename too long"); samef: CP(file, str); } /* * Read a file from the world. * C is command, 'e' if this really an edit (or a recover). */ rop(c) int c; { register int i; struct stat stbuf; short magic; static int ovro; /* old value(READONLY) */ static int denied; /* 1 if READONLY was se((t due to file permissions */ io = open(file, 0); if (io < 0) { if (c == 'e' && errno == ENOENT) { edited++; /* * If the user just did "ex foo" he is probably * creating a new file. Don't be an error, since * this is ugly, and it screws up the + option. */ if (!seenprompt) { printf(" [New file]"); noonl(); return; } } syserror(); } if (fstat(io, &stbuf)) syserror(); switch (stbuf.st_mode & S_IFMT) { case S_IFBLK: error(" Block special file"); case S_IFCHR: if (isatty(io)) error(" Teletype"); if (samei(&stbuf, "/dev/null")) break; error(" Character special file"); case S_IFDIR: error(" Directory"); case S_IFREG: #ifdef CRYPT if (xflag) break; #endif i = read(io, (char *) &magic, sizeof(magic)); lseek(io, 0l, 0); if (i != sizeof(magic)) break; switch (magic) { case 0405: /* Interdata? overlay */ case 0407: /* unshared */ case 0410: /* shared text */ case 0411: /* separate I/D */ case 0413: /* VM/Unix demand paged */ case 0430: /* PDP-11 Overlay shared */ case 0431: /* PDP-11 Overlay sep I/D */ error(" Executable"); /* * We do not forbid the editing of portable archives * because it is reasonable to edit them, especially * if they are archives of text files. This is * especially useful if you archive source files together * and copy them to another system with ~%take, since * the files sometimes show up munged and must be fixed. */ case 0177545: case 0177555: error(" Archive"); default: if (magic & 0100200) error(" Non-ascii file"); break; } } if (c != 'r') { if (value(READONLY) && denied) { value(READONLY) = ovro; denied = 0; } if ((stbuf.st_mode & 0222) == 0 || access(file, 2) < 0) { ovro = value(READONLY); denied = 1; value(READONLY) = 1; } } if (value(READONLY)) { printf(" [Read only]"); flush(); } if (c == 'r') setdot(); else setall(); if (FIXUNDO && inopen && c == 'r') undap1 = undap2 = dot + 1; rop2(); rop3(c); } rop2() { deletenone(); clrstats(); ignore(append(getfile, addr2)); } rop3(c) int c; { if (iostats() == 0 && c == 'e') edited++; if (c == 'e') { if (wasalt || firstpat) { register line *addr = zero + oldadot; if (addr > dol) addr = dol; if (firstpat) { globp = (*firstpat) ? firstpat : "$"; commands(1,1); firstpat = 0; } else if (addr >= one) { if (inopen) dot = addr; markpr(addr); } else goto other; } else other: if (dol > zero) { if (inopen) dot = one; markpr(one); } if(FIXUNDO) undkind = UNDNONE; if (inopen) { vcline = 0; vreplace(0, LINES, lineDOL()); } } if (laste) { #ifdef VMUNIX tlaste(); #endif laste = 0; sync(); } } /* * Are these two really the same inode? */ samei(sp, cp) struct stat *sp; char *cp; { struct stat stb; if (stat(cp, &stb) < 0 || sp->st_dev != stb.st_dev) return (0); return (sp->st_ino == stb.st_ino); } /* Returns from edited() */ #define EDF 0 /* Edited file */ #define NOTEDF -1 /* Not edited file */ #define PARTBUF 1 /* Write of partial buffer to Edited file */ /* * Write a file. */ wop(dofname) bool dofname; /* if 1 call filename, else use savedfile */ { register int c, exclam, nonexist; line *saddr1, *saddr2; struct stat stbuf; c = 0; exclam = 0; if (dofname) { if (peekchar() == '!') exclam++, ignchar(); ignore(skipwh()); while (peekchar() == '>') ignchar(), c++, ignore(skipwh()); if (c != 0 && c != 2) error("Write forms are 'w' and 'w>>'"); filename('w'); } else { if (savedfile[0] == 0) error("No file|No current filename"); saddr1=addr1; saddr2=addr2; addr1=one; addr2=dol; CP(file, savedfile); if (inopen) { vclrech(0); splitw++; } lprintf("\"%s\"", file); } nonexist = stat(file, &stbuf); switch (c) { case 0: if (!exclam && (!value(WRITEANY) || value(READONLY))) switch (edfile()) { case NOTEDF: if (nonexist) break; if ((stbuf.st_mode & S_IFMT) == S_IFCHR) { if (samei(&stbuf, "/dev/null")) break; if (samei(&stbuf, "/dev/tty")) break; } io = open(file, 1); if (io < 0) syserror(); if (!isatty(io)) serror(" File exists| File exists - use \"w! %s\" to overwrite", file); close(io); break; case EDF: if (value(READONLY)) error(" File is read only"); break; case PARTBUF: if (value(READONLY)) error(" File is read only"); error(" Use \"w!\" to write partial buffer"); } cre: /* synctmp(); */ #ifdef V6 io = creat(file, 0644); #else io = creat(file, 0666); #endif if (io < 0) syserror(); writing = 1; if (hush == 0) if (nonexist) printf(" [New file]"); else if (value(WRITEANY) && edfile() != EDF) printf(" [Existing file]"); break; case 2: io = open(file, 1); if (io < 0) { if (exclam || value(WRITEANY)) goto cre; syserror(); } lseek(io, 0l, 2); break; } putfile(); ignore(iostats()); if (c != 2 && addr1 == one && addr2 == dol) { if (eq(file, savedfile)) edited = 1; sync(); } if (!dofname) { addr1 = saddr1; addr2 = saddr2; } writing = 0; } /* * Is file the edited file? * Work here is that it is not considered edited * if this is a partial buffer, and distinguish * all cases. */ edfile() { if (!edited || !eq(file, savedfile)) return (NOTEDF); return (addr1 == one && addr2 == dol ? EDF : PARTBUF); } /* * Extract the next line from the io stream. */ static char *nextip; getfile() { register short c; register char *lp, *fp; lp = linebuf; fp = nextip; do { if (--ninbuf < 0) { ninbuf = read(io, genbuf, LBSIZE) - 1; if (ninbuf < 0) { if (lp != linebuf) { lp++; printf(" [Incomplete last line]"); break; } return (EOF); } #ifdef CRYPT fp = genbuf; while(fp < &genbuf[ninbuf]) { if (*fp++ & 0200) { if (kflag) crblock(perm, genbuf, ninbuf+1, cntch); break; } } #endif fp = genbuf; cntch += ninbuf+1; } if (lp >= &linebuf[LBSIZE]) { error(" Line too long"); } c = *fp++; if (c == 0) { cntnull++; continue; } if (c & QUOTE) { cntodd++; c &= TRIM; if (c == 0) continue; } *lp++ = c; } while (c != '\n'); *--lp = 0; nextip = fp; cntln++; return (0); } /* * Write a range onto the io stream. */ putfile() { line *a1; register char *fp, *lp; register int nib; a1 = addr1; clrstats(); cntln = addr2 - a1 + 1; if (cntln == 0) return; nib = BUFSIZ; fp = genbuf; do { getline(*a1++); lp = linebuf; for (;;) { if (--nib < 0) { nib = fp - genbuf; #ifdef CRYPT if(kflag) crblock(perm, genbuf, nib, cntch); #endif if (write(io, genbuf, nib) != nib) { wrerror(); } cntch += nib; nib = BUFSIZ - 1; fp = genbuf; } if ((*fp++ = *lp++) == 0) { fp[-1] = '\n'; break; } } } while (a1 <= addr2); nib = fp - genbuf; #ifdef CRYPT if(kflag) crblock(perm, genbuf, nib, cntch); #endif if (write(io, genbuf, nib) != nib) { wrerror(); } cntch += nib; } /* * A write error has occurred; if the file being written was * the edited file then we consider it to have changed since it is * now likely scrambled. */ wrerror() { if (eq(file, savedfile) && edited) change(); syserror(); } /* * Source command, handles nested sources. * Traps errors since it mungs unit 0 during the source. */ short slevel; short ttyindes; source(fil, okfail) char *fil; bool okfail; { jmp_buf osetexit; register int saveinp, ointty, oerrno; char savepeekc, *saveglobp; signal(SIGINT, SIG_IGN); saveinp = dup(0); savepeekc = peekc; saveglobp = globp; peekc = 0; globp = 0; if (saveinp < 0) error("Too many nested sources"); if (slevel <= 0) ttyindes = saveinp; close(0); if (open(fil, 0) < 0) { oerrno = errno; setrupt(); dup(saveinp); close(saveinp); errno = oerrno; if (!okfail) filioerr(fil); return; } slevel++; ointty = intty; intty = isatty(0); oprompt = value(PROMPT); value(PROMPT) &= intty; getexit(osetexit); setrupt(); if (setexit() == 0) commands(1, 1); else if (slevel > 1) { close(0); dup(saveinp); close(saveinp); slevel--; resexit(osetexit); reset(); } intty = ointty; value(PROMPT) = oprompt; close(0); dup(saveinp); close(saveinp); globp = saveglobp; peekc = savepeekc; slevel--; resexit(osetexit); } /* * Clear io statistics before a read or write. */ clrstats() { ninbuf = 0; cntch = 0; cntln = 0; cntnull = 0; cntodd = 0; } /* * Io is finished, close the unit and print statistics. */ iostats() { close(io); io = -1; if (hush == 0) { if (value(TERSE)) printf(" %d/%D", cntln, cntch); else printf(" %d line%s, %D character%s", cntln, plural((long) cntln), cntch, plural(cntch)); if (cntnull || cntodd) { printf(" ("); if (cntnull) { printf("%D null", cntnull); if (cntodd) printf(", "); } if (cntodd) printf("%D non-ASCII", cntodd); putchar(')'); } noonl(); flush(); } return (cntnull != 0 || cntodd != 0); } and print statistics. */ iostats() { cmd/ex/ex_put.c 444 0 33 45251 2432713423 6707 /* Copyright (c) 1980 Regents of the University of California */ static char *sccsid = "@(#)ex_put.c 6.4 11/8/80"; #include "ex.h" #include "ex_tty.h" #include "ex_vis.h" /* * Terminal driving and line formatting routines. * Basic motion optimizations are done here as well * as formatting of lines (printing of control characters, * line numbering and the like). */ /* * The routines outchar, putchar and pline are actually * variables, and these variables point at the current definitions * of the ro((utines. See the routine setflav. * We sometimes make outchar be routines which catch the characters * to be printed, e.g. if we want to see how long a line is. * During open/visual, outchar and putchar will be set to * routines in the file ex_vput.c (vputchar, vinschar, etc.). */ int (*Outchar)() = termchar; int (*Putchar)() = normchar; int (*Pline)() = normline; int (* setlist(t))() bool t; { register int (*P)(); listf = t; P = Putchar; Putchar = t ? listchar : normchar; return (P); } int (* setnumb(t))() bool t; { register int (*P)(); numberf = t; P = Pline; Pline = t ? numbline : normline; return (P); } /* * Format c for list mode; leave things in common * with normal print mode to be done by normchar. */ listchar(c) register short c; { c &= (TRIM|QUOTE); switch (c) { case '\t': case '\b': outchar('^'); c = ctlof(c); break; case '\n': break; case '\n' | QUOTE: outchar('$'); break; default: if (c & QUOTE) break; if (c < ' ' && c != '\n' || c == DELETE) outchar('^'), c = ctlof(c); break; } normchar(c); } /* * Format c for printing. Handle funnies of upper case terminals * and crocky hazeltines which don't have ~. */ normchar(c) register short c; { register char *colp; c &= (TRIM|QUOTE); if (c == '~' && HZ) { normchar('\\'); c = '^'; } if (c & QUOTE) switch (c) { case ' ' | QUOTE: case '\b' | QUOTE: break; case QUOTE: return; default: c &= TRIM; } else if (c < ' ' && (c != '\b' || !OS) && c != '\n' && c != '\t' || c == DELETE) putchar('^'), c = ctlof(c); else if (UPPERCASE) if (isupper(c)) { outchar('\\'); c = tolower(c); } else { colp = "({)}!|^~'`"; while (*colp++) if (c == *colp++) { outchar('\\'); c = colp[-2]; break; } } outchar(c); } /* * Print a line with a number. */ numbline(i) int i; { if (shudclob) slobber(' '); printf("%6d ", i); normline(); } /* * Normal line output, no numbering. */ normline() { register char *cp; if (shudclob) slobber(linebuf[0]); /* pdp-11 doprnt is not reentrant so can't use "printf" here in case we are tracing */ for (cp = linebuf; *cp;) putchar(*cp++); if (!inopen) putchar('\n' | QUOTE); } /* * Given c at the beginning of a line, determine whether * the printing of the line will erase or otherwise obliterate * the prompt which was printed before. If it won't, do it now. */ slobber(c) int c; { shudclob = 0; switch (c) { case '\t': if (Putchar == listchar) return; break; default: return; case ' ': case 0: break; } if (OS) return; flush(); putch(' '); if (BC) tputs(BC, 0, putch); else putch('\b'); } /* * The output buffer is initialized with a useful error * message so we don't have to keep it in data space. */ static char linb[66]; static char *linp = linb; /* * Phadnl records when we have already had a complete line ending with \n. * If another line starts without a flush, and the terminal suggests it, * we switch into -nl mode so that we can send lineffeeds to avoid * a lot of spacing. */ static bool phadnl; /* * Indirect to current definition of putchar. */ putchar(c) int c; { (*Putchar)(c); } /* * Termchar routine for command mode. * Watch for possible switching to -nl mode. * Otherwise flush into next level of buffering when * small buffer fills or at a newline. */ termchar(c) int c; { if (pfast == 0 && phadnl) pstart(); if (c == '\n') phadnl = 1; else if (linp >= &linb[63]) flush1(); *linp++ = c; if (linp >= &linb[63]) { fgoto(); flush1(); } } flush() { flush1(); flush2(); } /* * Flush from small line buffer into output buffer. * Work here is destroying motion into positions, and then * letting fgoto do the optimized motion. */ flush1() { register char *lp; register short c; *linp = 0; lp = linb; while (*lp) switch (c = *lp++) { case '\r': destline += destcol / COLUMNS; destcol = 0; continue; case '\b': if (destcol) destcol--; continue; case ' ': destcol++; continue; case '\t': destcol += value(TABSTOP) - destcol % value(TABSTOP); continue; case '\n': destline += destcol / COLUMNS + 1; if (destcol != 0 && destcol % COLUMNS == 0) destline--; destcol = 0; continue; default: fgoto(); for (;;) { if (AM == 0 && outcol == COLUMNS) fgoto(); c &= TRIM; putch(c); if (c == '\b') { outcol--; destcol--; } else if (c >= ' ' && c != DELETE) { outcol++; destcol++; if (XN && outcol % COLUMNS == 0) putch('\n'); } c = *lp++; if (c <= ' ') break; } --lp; continue; } linp = linb; } flush2() { fgoto(); flusho(); pstop(); } /* * Sync the position of the output cursor. * Most work here is rounding for terminal boundaries getting the * column position implied by wraparound or the lack thereof and * rolling up the screen to get destline on the screen. */ fgoto() { register int l, c; if (destcol > COLUMNS - 1) { destline += destcol / COLUMNS; destcol %= COLUMNS; } if (outcol > COLUMNS - 1) { l = (outcol + 1) / COLUMNS; outline += l; outcol %= COLUMNS; if (AM == 0) { while (l > 0) { if (pfast) if (xCR) tputs(xCR, 0, putch); else putch('\r'); if (xNL) tputs(xNL, 0, putch); else putch('\n'); l--; } outcol = 0; } if (outline > LINES - 1) { destline -= outline - (LINES - 1); outline = LINES - 1; } } if (destline > LINES - 1) { l = destline; destline = LINES - 1; if (outline < LINES - 1) { c = destcol; if (pfast == 0 && (!CA || holdcm)) destcol = 0; fgoto(); destcol = c; } while (l > LINES - 1) { /* * The following linefeed (or simulation thereof) * is supposed to scroll up the screen, since we * are on the bottom line. We make the assumption * that linefeed will scroll. If ns is in the * capability list this won't work. We should * probably have an sc capability but sf will * generally take the place if it works. * * Superbee glitch: in the middle of the screen we * have to use esc B (down) because linefeed screws up * in "Efficient Paging" (what a joke) mode (which is * essential in some SB's because CRLF mode puts garbage * in at end of memory), but you must use linefeed to * scroll since down arrow won't go past memory end. * I turned this off after recieving Paul Eggert's * Superbee description which wins better. */ if (xNL /* && !XB */ && pfast) tputs(xNL, 0, putch); else putch('\n'); l--; if (pfast == 0) outcol = 0; } } if (destline < outline && !(CA && !holdcm || UP != NOSTR)) destline = outline; if (CA && !holdcm) if (plod(costCM) > 0) plod(0); else tputs(tgoto(CM, destcol, destline), 0, putch); else plod(0); outline = destline; outcol = destcol; } /* * Tab to column col by flushing and then setting destcol. * Used by "set all". */ tab(col) int col; { flush1(); destcol = col; } /* * Move (slowly) to destination. * Hard thing here is using home cursor on really deficient terminals. * Otherwise just use cursor motions, hacking use of tabs and overtabbing * and backspace. */ static int plodcnt, plodflg; plodput(c) { if (plodflg) plodcnt--; else putch(c); } plod(cnt) { register int i, j, k; register int soutcol, soutline; plodcnt = plodflg = cnt; soutcol = outcol; soutline = outline; /* * Consider homing and moving down/right from there, vs moving * directly with local motions to the right spot. */ if (HO) { /* * i is the cost to home and tab/space to the right to * get to the proper column. This assumes ND space costs * 1 char. So i+destcol is cost of motion with home. */ if (GT) i = (destcol / value(HARDTABS)) + (destcol % value(HARDTABS)); else i = destcol; /* * j is cost to move locally without homing */ if (destcol >= outcol) { /* if motion is to the right */ j = destcol / value(HARDTABS) - outcol / value(HARDTABS); if (GT && j) j += destcol % value(HARDTABS); else j = destcol - outcol; } else /* leftward motion only works if we can backspace. */ if (outcol - destcol <= i && (BS || BC)) i = j = outcol - destcol; /* cheaper to backspace */ else j = i + 1; /* impossibly expensive */ /* k is the absolute value of vertical distance */ k = outline - destline; if (k < 0) k = -k; j += k; /* * Decision. We may not have a choice if no UP. */ if (i + destline < j || (!UP && destline < outline)) { /* * Cheaper to home. Do it now and pretend it's a * regular local motion. */ tputs(HO, 0, plodput); outcol = outline = 0; } else if (LL) { /* * Quickly consider homing down and moving from there. * Assume cost of LL is 2. */ k = (LINES - 1) - destline; if (i + k + 2 < j && (k<=0 || UP)) { tputs(LL, 0, plodput); outcol = 0; outline = LINES - 1; } } } else /* * No home and no up means it's impossible, so we return an * incredibly big number to make cursor motion win out. */ if (!UP && destline < outline) return (500); if (GT) i = destcol % value(HARDTABS) + destcol / value(HARDTABS); else i = destcol; /* if (BT && outcol > destcol && (j = (((outcol+7) & ~7) - destcol - 1) >> 3)) { j *= (k = strlen(BT)); if ((k += (destcol&7)) > 4) j += 8 - (destcol&7); else j += k; } else */ j = outcol - destcol; /* * If we will later need a \n which will turn into a \r\n by * the system or the terminal, then don't bother to try to \r. */ if ((NONL || !pfast) && outline < destline) goto dontcr; /* * If the terminal will do a \r\n and there isn't room for it, * then we can't afford a \r. */ if (NC && outline >= destline) goto dontcr; /* * If it will be cheaper, or if we can't back up, then send * a return preliminarily. */ if (j > i + 1 || outcol > destcol && !BS && !BC) { /* * BUG: this doesn't take the (possibly long) length * of xCR into account. */ if (xCR) tputs(xCR, 0, plodput); else plodput('\r'); if (NC) {(( if (xNL) tputs(xNL, 0, plodput); else plodput('\n'); outline++; } outcol = 0; } dontcr: while (outline < destline) { outline++; if (xNL && pfast) tputs(xNL, 0, plodput); else plodput('\n'); if (plodcnt < 0) goto out; if (NONL || pfast == 0) outcol = 0; } if (BT) k = strlen(BT); while (outcol > destcol) { if (plodcnt < 0) goto out; /* if (BT && !insmode && outcol - destcol > 4+k) { tputs(BT, 0, plodput); outcol--; outcol &= ~7; continue; } */ outcol--; if (BC) tputs(BC, 0, plodput); else plodput('\b'); } while (outline > destline) { outline--; tputs(UP, 0, plodput); if (plodcnt < 0) goto out; } if (GT && !insmode && destcol - outcol > 1) { for (;;) { i = tabcol(outcol, value(HARDTABS)); if (i > destcol) break; if (TA) tputs(TA, 0, plodput); else plodput('\t'); outcol = i; } if (destcol - outcol > 4 && i < COLUMNS && (BC || BS)) { if (TA) tputs(TA, 0, plodput); else plodput('\t'); outcol = i; while (outcol > destcol) { outcol--; if (BC) tputs(BC, 0, plodput); else plodput('\b'); } } } while (outcol < destcol) { /* * move one char to the right. We don't use ND space * because it's better to just print the char we are * moving over. There are various exceptions, however. * If !inopen, vtube contains garbage. If the char is * a null or a tab we want to print a space. Other random * chars we use space for instead, too. */ if (!inopen || vtube[outline]==NULL || (i=vtube[outline][outcol]) < ' ') i = ' '; if (insmode && ND) tputs(ND, 0, plodput); else plodput(i); outcol++; if (plodcnt < 0) goto out; } out: if (plodflg) { outcol = soutcol; outline = soutline; } return(plodcnt); } /* * An input line arrived. * Calculate new (approximate) screen line position. * Approximate because kill character echoes newline with * no feedback and also because of long input lines. */ noteinp() { outline++; if (outline > LINES - 1) outline = LINES - 1; destline = outline; destcol = outcol = 0; } /* * Something weird just happened and we * lost track of whats happening out there. * Since we cant, in general, read where we are * we just reset to some known state. * On cursor addressible terminals setting to unknown * will force a cursor address soon. */ termreset() { endim(); if (TI) /* otherwise it flushes anyway, and 'set tty=dumb' vomits */ putpad(TI); /*adb change -- emit terminal initial sequence */ destcol = 0; destline = LINES - 1; if (CA) { outcol = UKCOL; outline = UKCOL; } else { outcol = destcol; outline = destline; } } /* * Low level buffering, with the ability to drain * buffered output without printing it. */ char *obp = obuf; draino() { obp = obuf; } flusho() { if (obp != obuf) { write(1, obuf, obp - obuf); obp = obuf; } } putnl() { putchar('\n'); } putS(cp) char *cp; { if (cp == NULL) return; while (*cp) putch(*cp++); } putch(c) int c; { *obp++ = c & 0177; if (obp >= &obuf[sizeof obuf]) flusho(); } /* * Miscellaneous routines related to output. */ /* * Put with padding */ putpad(cp) char *cp; { flush(); tputs(cp, 0, putch); } /* * Set output through normal command mode routine. */ setoutt() { Outchar = termchar; } /* * Printf (temporarily) in list mode. */ /*VARARGS2*/ lprintf(cp, dp) char *cp, *dp; { register int (*P)(); P = setlist(1); printf(cp, dp); Putchar = P; } /* * Newline + flush. */ putNFL() { putnl(); flush(); } /* * Try to start -nl mode. */ pstart() { if (NONL) return; if (!value(OPTIMIZE)) return; if (ruptible == 0 || pfast) return; fgoto(); flusho(); pfast = 1; normtty++; #ifndef USG3TTY tty.sg_flags = normf & ~(ECHO|XTABS|CRMOD); #else tty = normf; tty.c_oflag &= ~(ONLCR|TAB3); tty.c_lflag &= ~ECHO; #endif sTTY(1); } /* * Stop -nl mode. */ pstop() { if (inopen) return; phadnl = 0; linp = linb; draino(); normal(normf); pfast &= ~1; } /* * Prep tty for open mode. */ ttymode ostart() { ttymode f; if (!intty) error("Open and visual must be used interactively"); gTTY(1); normtty++; #ifndef USG3TTY f = tty.sg_flags; tty.sg_flags = (normf &~ (ECHO|XTABS|CRMOD)) | # ifdef CBREAK CBREAK; # else RAW; # endif # ifdef TIOCGETC ttcharoff(); # endif #else f = tty; tty = normf; tty.c_iflag &= ~ICRNL; tty.c_lflag &= ~(ECHO|ICANON); tty.c_oflag &= ~TAB3; tty.c_cc[VMIN] = 1; tty.c_cc[VTIME] = 1; ttcharoff(); #endif sTTY(1); tostart(); pfast |= 2; return (f); } /* actions associated with putting the terminal in open mode */ tostart() { putpad(VS); putpad(KS); if (!value(MESG)) { if (ttynbuf[0] == 0) { register char *tn; if ((tn=ttyname(2)) == NULL && (tn=ttyname(1)) == NULL && (tn=ttyname(0)) == NULL) ttynbuf[0] = 1; else strcpy(ttynbuf, tn); } if (ttynbuf[0] != 1) { struct stat sbuf; stat(ttynbuf, &sbuf); ttymesg = sbuf.st_mode & 0777; chmod(ttynbuf, #ifdef UCBV7 /* * This applies to the UCB V7 Pdp-11 system with the * -u write option only. */ 0611 /* 11 = urgent only allowed */ #else 0600 #endif ); } } } /* * Turn off start/stop chars if they aren't the default ^S/^Q. * This is so idiots who make esc their start/stop don't lose. * We always turn off quit since datamedias send ^\ for their * right arrow key. */ #ifdef TIOCGETC ttcharoff() { nttyc.t_quitc = '\377'; if (nttyc.t_startc != CTRL(q)) nttyc.t_startc = '\377'; if (nttyc.t_stopc != CTRL(s)) nttyc.t_stopc = '\377'; # ifdef TIOCLGET nlttyc.t_suspc = '\377'; /* ^Z */ nlttyc.t_dsuspc = '\377'; /* ^Y */ nlttyc.t_flushc = '\377'; /* ^O */ nlttyc.t_lnextc = '\377'; /* ^V */ # endif } #endif #ifdef USG3TTY ttcharoff() { tty.c_cc[VQUIT] = '\377'; # ifdef VSTART /* * The following is sample code if USG ever lets people change * their start/stop chars. As long as they can't we can't get * into trouble so we just leave them alone. */ if (tty.c_cc[VSTART] != CTRL(q)) tty.c_cc[VSTART] = '\377'; if (tty.c_cc[VSTOP] != CTRL(s)) tty.c_cc[VSTOP] = '\377'; # endif } #endif /* * Stop open, restoring tty modes. */ ostop(f) ttymode f; { #ifndef USG3TTY pfast = (f & CRMOD) == 0; #else pfast = (f.c_oflag & OCRNL) == 0; #endif termreset(), fgoto(), flusho(); normal(f); tostop(); } /* Actions associated with putting the terminal in the right mode. */ tostop() { putpad(VE); putpad(KE); if (!value(MESG)) chmod(ttynbuf, ttymesg); } #ifndef CBREAK /* * Into cooked mode for interruptibility. */ vcook() { tty.sg_flags &= ~RAW; sTTY(1); } /* * Back into raw mode. */ vraw() { tty.sg_flags |= RAW; sTTY(1); } #endif /* * Restore flags to normal state f. */ normal(f) ttymode f; { if (normtty > 0) { setty(f); normtty--; } } /* * Straight set of flags to state f. */ ttymode setty(f) ttymode f; { #ifndef USG3TTY register int ot = tty.sg_flags; #else ttymode ot; ot = tty; #endif #ifndef USG3TTY if (f == normf) { nttyc = ottyc; # ifdef TIOCLGET nlttyc = olttyc; # endif } else ttcharoff(); tty.sg_flags = f; #else if (tty.c_lflag & ICANON) ttcharoff(); tty = f; #endif sTTY(1); return (ot); } gTTY(i) int i; { #ifndef USG3TTY ignore(gtty(i, &tty)); # ifdef TIOCGETC ioctl(i, TIOCGETC, &ottyc); nttyc = ottyc; # endif # ifdef TIOCGLTC ioctl(i, TIOCGLTC, &olttyc); nlttyc = olttyc; # endif #else ioctl(i, TCGETA, &tty); #endif } /* * sTTY: set the tty modes on file descriptor i to be what's * currently in global "tty". (Also use nttyc if needed.) */ sTTY(i) int i; { #ifndef USG3TTY # ifdef USG /* Bug in USG tty driver, put out a DEL as a patch. */ if (tty.sg_ospeed >= B1200) write(1, "\377", 1); # endif # ifdef TIOCSETN /* Don't flush typeahead if we don't have to */ ioctl(i, TIOCSETN, &tty); # else /* We have to. Too bad. */ stty(i, &tty); # endif # ifdef TIOCGETC /* Update the other random chars while we're at it. */ ioctl(i, TIOCSETC, &nttyc); # endif # ifdef TIOCSLTC ioctl(i, TIOCSLTC, &nlttyc); # endif #else /* USG 3 very simple: just set everything */ ioctl(i, TCSETAW, &tty); #endif } /* * Print newline, or blank if in open/visual */ noonl() { putchar(Outchar != termchar ? ' ' : '\n'); } ef TIOCSETN /* Don't flush typeahead if we don't have to */ ioctl(i, TIOCSETN, &tty); # else /* We have to. Too bad. */ stty(i, &tty); # endif # ifdef TIOCGETC /* Update the other random chars while we're at it. */ ioctl(i, TIOCSETC, &nttyc); # endif # ifdef TIOCSLTC ioctl(i, TIOCSLTC, &nlttyc); # endif #else /* USG 3 very simple:cmd/ex/ex_re.c 444 0 33 37751 2425470142 6513 /* Copyright (c) 1980 Regents of the University of California */ static char *sccsid = "@(#)ex_re.c 6.2 10/23/80"; #include "ex.h" #include "ex_re.h" /* * Global, substitute and regular expressions. * Very similar to ed, with some re extensions and * confirmed substitute. */ global(k) bool k; { register char *gp; register int c; register line *a1; char globuf[GBSIZE], *Cwas; int lines = lineDOL(); int oinglobal = inglobal; char *oglobp = globp; Cwas = Command; /* * States of inglobal: * 0: ordinary - not in a global command. * 1: text coming from some buffer, not tty. * 2: like 1, but the source of the buffer is a global command. * Hence you're only in a global command if inglobal==2. This * strange sounding convention is historically derived from * everybody simulating a global command. */ if (inglobal==2) error("Global within global@not allowed"); markDOT(); setall(); nonzero(); if (skipend()) error("Global needs re|Missing regular expression for global"); c = ge((tchar(); ignore(compile(c, 1)); savere(scanre); gp = globuf; while ((c = getchar()) != '\n') { switch (c) { case EOF: c = '\n'; goto brkwh; case '\\': c = getchar(); switch (c) { case '\\': ungetchar(c); break; case '\n': break; default: *gp++ = '\\'; break; } break; } *gp++ = c; if (gp >= &globuf[GBSIZE - 2]) error("Global command too long"); } brkwh: ungetchar(c); out: newline(); *gp++ = c; *gp++ = 0; saveall(); inglobal = 2; for (a1 = one; a1 <= dol; a1++) { *a1 &= ~01; if (a1 >= addr1 && a1 <= addr2 && execute(0, a1) == k) *a1 |= 01; } #ifdef notdef /* * This code is commented out for now. The problem is that we don't * fix up the undo area the way we should. Basically, I think what has * to be done is to copy the undo area down (since we shrunk everything) * and move the various pointers into it down too. I will do this later * when I have time. (Mark, 10-20-80) */ /* * Special case: g/.../d (avoid n^2 algorithm) */ if (globuf[0]=='d' && globuf[1]=='\n' && globuf[2]=='\0') { gdelete(); return; } #endif if (inopen) inopen = -1; /* * Now for each marked line, set dot there and do the commands. * Note the n^2 behavior here for lots of lines matching. * This is really needed: in some cases you could delete lines, * causing a marked line to be moved before a1 and missed if * we didn't restart at zero each time. */ for (a1 = one; a1 <= dol; a1++) { if (*a1 & 01) { *a1 &= ~01; dot = a1; globp = globuf; commands(1, 1); a1 = zero; } } globp = oglobp; inglobal = oinglobal; endline = 1; Command = Cwas; netchHAD(lines); setlastchar(EOF); if (inopen) { ungetchar(EOF); inopen = 1; } } /* * gdelete: delete inside a global command. Handles the * special case g/r.e./d. All lines to be deleted have * already been marked. Squeeze the remaining lines together. * Note that other cases such as g/r.e./p, g/r.e./s/r.e.2/rhs/, * and g/r.e./.,/r.e.2/d are not treated specially. There is no * good reason for this except the question: where to you draw the line? */ gdelete() { register line *a1, *a2, *a3; a3 = dol; /* find first marked line. can skip all before it */ for (a1=zero; (*a1&01)==0; a1++) if (a1>=a3) return; /* copy down unmarked lines, compacting as we go. */ for (a2=a1+1; a2<=a3;) { if (*a2&01) { a2++; /* line is marked, skip it */ dot = a1; /* dot left after line deletion */ } else *a1++ = *a2++; /* unmarked, copy it */ } dol = a1-1; if (dot>dol) dot = dol; change(); } bool cflag; int scount, slines, stotal; substitute(c) int c; { register line *addr; register int n; int gsubf, hopcount = 0; gsubf = compsub(c); if(FIXUNDO) save12(), undkind = UNDCHANGE; stotal = 0; slines = 0; for (addr = addr1; addr <= addr2; addr++) { scount = 0; if (dosubcon(0, addr) == 0) continue; if (gsubf) { /* * The loop can happen from s/\ sizeof linebuf) error("substitution loop"); if (dosubcon(1, addr) == 0) break; } } if (scount) { stotal += scount; slines++; putmark(addr); n = append(getsub, addr); addr += n; addr2 += n; } } if (stotal == 0 && !inglobal && !cflag) error("Fail|Substitute pattern match failed"); snote(stotal, slines); return (stotal); } compsub(ch) { register int seof, c, uselastre; static int gsubf; if (!value(EDCOMPATIBLE)) gsubf = cflag = 0; uselastre = 0; switch (ch) { case 's': ignore(skipwh()); seof = getchar(); if (endcmd(seof) || any(seof, "gcr")) { ungetchar(seof); goto redo; } if (isalpha(seof) || isdigit(seof)) error("Substitute needs re|Missing regular expression for substitute"); seof = compile(seof, 1); uselastre = 1; comprhs(seof); gsubf = 0; cflag = 0; break; case '~': uselastre = 1; /* fall into ... */ case '&': redo: if (re.Expbuf[0] == 0) error("No previous re|No previous regular expression"); if (subre.Expbuf[0] == 0) error("No previous substitute re|No previous substitute to repeat"); break; } for (;;) { c = getchar(); switch (c) { case 'g': gsubf = !gsubf; continue; case 'c': cflag = !cflag; continue; case 'r': uselastre = 1; continue; default: ungetchar(c); setcount(); newline(); if (uselastre) savere(subre); else resre(subre); return (gsubf); } } } comprhs(seof) int seof; { register char *rp, *orp; register int c; char orhsbuf[RHSSIZE]; rp = rhsbuf; CP(orhsbuf, rp); for (;;) { c = getchar(); if (c == seof) break; switch (c) { case '\\': c = getchar(); if (c == EOF) { ungetchar(c); break; } if (value(MAGIC)) { /* * When "magic", \& turns into a plain &, * and all other chars work fine quoted. */ if (c != '&') c |= QUOTE; break; } magic: if (c == '~') { for (orp = orhsbuf; *orp; *rp++ = *orp++) if (rp >= &rhsbuf[RHSSIZE - 1]) goto toobig; continue; } c |= QUOTE; break; case '\n': case EOF: if (!(globp && globp[0])) { ungetchar(c); goto endrhs; } case '~': case '&': if (value(MAGIC)) goto magic; break; } if (rp >= &rhsbuf[RHSSIZE - 1]) { toobig: *rp = 0; error("Replacement pattern too long@- limit 256 characters"); } *rp++ = c; } endrhs: *rp++ = 0; } getsub() { register char *p; if ((p = linebp) == 0) return (EOF); strcLIN(p); linebp = 0; return (0); } dosubcon(f, a) bool f; line *a; { if (execute(f, a) == 0) return (0); if (confirmed(a)) { dosub(); scount++; } return (1); } confirmed(a) line *a; { register int c, ch; if (cflag == 0) return (1); pofix(); pline(lineno(a)); if (inopen) putchar('\n' | QUOTE); c = column(loc1 - 1); ugo(c - 1 + (inopen ? 1 : 0), ' '); ugo(column(loc2 - 1) - c, '^'); flush(); ch = c = getkey(); again: if (c == '\r') c = '\n'; if (inopen) putchar(c), flush(); if (c != '\n' && c != EOF) { c = getkey(); goto again; } noteinp(); return (ch == 'y'); } getch() { char c; if (read(2, &c, 1) != 1) return (EOF); return (c & TRIM); } ugo(cnt, with) int with; int cnt; { if (cnt > 0) do putchar(with); while (--cnt > 0); } int casecnt; bool destuc; dosub() { register char *lp, *sp, *rp; int c; lp = linebuf; sp = genbuf; rp = rhsbuf; while (lp < loc1) *sp++ = *lp++; casecnt = 0; while (c = *rp++) { if (c & QUOTE) switch (c & TRIM) { case '&': sp = place(sp, loc1, loc2); if (sp == 0) goto ovflo; continue; case 'l': casecnt = 1; destuc = 0; continue; case 'L': casecnt = LBSIZE; destuc = 0; continue; case 'u': casecnt = 1; destuc = 1; continue; case 'U': casecnt = LBSIZE; destuc = 1; continue; case 'E': case 'e': casecnt = 0; continue; } if (c < 0 && (c &= TRIM) >= '1' && c < nbra + '1') { sp = place(sp, braslist[c - '1'], braelist[c - '1']); if (sp == 0) goto ovflo; continue; } if (casecnt) *sp++ = fixcase(c & TRIM); else *sp++ = c & TRIM; if (sp >= &genbuf[LBSIZE]) ovflo: error("Line overflow@in substitute"); } lp = loc2; loc2 = sp + (linebuf - genbuf); while (*sp++ = *lp++) if (sp >= &genbuf[LBSIZE]) goto ovflo; strcLIN(genbuf); } fixcase(c) register int c; { if (casecnt == 0) return (c); casecnt--; if (destuc) { if (islower(c)) c = toupper(c); } else if (isupper(c)) c = tolower(c); return (c); } char * place(sp, l1, l2) register char *sp, *l1, *l2; { while (l1 < l2) { *sp++ = fixcase(*l1++); if (sp >= &genbuf[LBSIZE]) return (0); } return (sp); } snote(total, lines) register int total, lines; { if (!notable(total)) return; printf(mesg("%d subs|%d substitutions"), total); if (lines != 1 && lines != total) printf(" on %d lines", lines); noonl(); flush(); } compile(eof, oknl) int eof; int oknl; { register int c; register char *ep; char *lastep; char bracket[NBRA], *bracketp, *rhsp; int cclcnt; if (isalpha(eof) || isdigit(eof)) error("Regular expressions cannot be delimited by letters or digits"); ep = expbuf; c = getchar(); if (eof == '\\') switch (c) { case '/': case '?': if (scanre.Expbuf[0] == 0) error("No previous scan re|No previous scanning regular expression"); resre(scanre); return (c); case '&': if (subre.Expbuf[0] == 0) error("No previous substitute re|No previous substitute regular expression"); resre(subre); return (c); default: error("Badly formed re|Regular expression \\ must be followed by / or ?"); } if (c == eof || c == '\n' || c == EOF) { if (*ep == 0) error("No previous re|No previous regular expression"); if (c == '\n' && oknl == 0) error("Missing closing delimiter@for regular expression"); if (c != eof) ungetchar(c); return (eof); } bracketp = bracket; nbra = 0; circfl = 0; if (c == '^') { c = getchar(); circfl++; } ungetchar(c); for (;;) { if (ep >= &expbuf[ESIZE - 2]) complex: cerror("Re too complex|Regular expression too complicated"); c = getchar(); if (c == eof || c == EOF) { if (bracketp != bracket) cerror("Unmatched \\(|More \\('s than \\)'s in regular expression"); *ep++ = CEOFC; if (c == EOF) ungetchar(c); return (eof); } if (value(MAGIC)) { if (c != '*' || ep == expbuf) lastep = ep; } else if (c != '\\' || peekchar() != '*' || ep == expbuf) lastep = ep; switch (c) { case '\\': c = getchar(); switch (c) { case '(': if (nbra >= NBRA) cerror("Awash in \\('s!|Too many \\('d subexressions in a regular expression"); *bracketp++ = nbra; *ep++ = CBRA; *ep++ = nbra++; continue; case ')': if (bracketp <= bracket) cerror("Extra \\)|More \\)'s than \\('s in regular expression"); *ep++ = CKET; *ep++ = *--bracketp; continue; case '<': *ep++ = CBRC; continue; case '>': *ep++ = CLET; continue; } if (value(MAGIC) == 0) magic: switch (c) { case '.': *ep++ = CDOT; (( continue; case '~': rhsp = rhsbuf; while (*rhsp) { if (*rhsp & QUOTE) { c = *rhsp & TRIM; if (c == '&') error("Replacement pattern contains &@- cannot use in re"); if (c >= '1' && c <= '9') error("Replacement pattern contains \\d@- cannot use in re"); } if (ep >= &expbuf[ESIZE-2]) goto complex; *ep++ = CCHR; *ep++ = *rhsp++ & TRIM; } continue; case '*': if (ep == expbuf) break; if (*lastep == CBRA || *lastep == CKET) cerror("Illegal *|Can't * a \\( ... \\) in regular expression"); if (*lastep == CCHR && (lastep[1] & QUOTE)) cerror("Illegal *|Can't * a \\n in regular expression"); *lastep |= STAR; continue; case '[': *ep++ = CCL; *ep++ = 0; cclcnt = 1; c = getchar(); if (c == '^') { c = getchar(); ep[-2] = NCCL; } if (c == ']') cerror("Bad character class|Empty character class '[]' or '[^]' cannot match"); while (c != ']') { if (c == '\\' && any(peekchar(), "]-^\\")) c = getchar() | QUOTE; if (c == '\n' || c == EOF) cerror("Missing ]"); *ep++ = c; cclcnt++; if (ep >= &expbuf[ESIZE]) goto complex; c = getchar(); } lastep[1] = cclcnt; continue; } if (c == EOF) { ungetchar(EOF); c = '\\'; goto defchar; } *ep++ = CCHR; if (c == '\n') cerror("No newlines in re's|Can't escape newlines into regular expressions"); /* if (c < '1' || c > NBRA + '1') { */ *ep++ = c; continue; /* } c -= '1'; if (c >= nbra) cerror("Bad \\n|\\n in regular expression with n greater than the number of \\('s"); *ep++ = c | QUOTE; continue; */ case '\n': if (oknl) { ungetchar(c); *ep++ = CEOFC; return (eof); } cerror("Badly formed re|Missing closing delimiter for regular expression"); case '$': if (peekchar() == eof || peekchar() == EOF || oknl && peekchar() == '\n') { *ep++ = CDOL; continue; } goto defchar; case '.': case '~': case '*': case '[': if (value(MAGIC)) goto magic; defchar: default: *ep++ = CCHR; *ep++ = c; continue; } } } cerror(s) char *s; { expbuf[0] = 0; error(s); } same(a, b) register int a, b; { return (a == b || value(IGNORECASE) && ((islower(a) && toupper(a) == b) || (islower(b) && toupper(b) == a))); } char *locs; execute(gf, addr) line *addr; { register char *p1, *p2; register int c; if (gf) { if (circfl) return (0); locs = p1 = loc2; } else { if (addr == zero) return (0); p1 = linebuf; getline(*addr); locs = 0; } p2 = expbuf; if (circfl) { loc1 = p1; return (advance(p1, p2)); } /* fast check for first character */ if (*p2 == CCHR) { c = p2[1]; do { if (c != *p1 && (!value(IGNORECASE) || !((islower(c) && toupper(c) == *p1) || (islower(*p1) && toupper(*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); } #define uletter(c) (isalpha(c) || c == '_') advance(lp, ep) register char *lp, *ep; { register char *curlp; char *sp, *sp1; int c; for (;;) switch (*ep++) { case CCHR: /* useless if (*ep & QUOTE) { c = *ep++ & TRIM; sp = braslist[c]; sp1 = braelist[c]; while (sp < sp1) { if (!same(*sp, *lp)) return (0); sp++, lp++; } continue; } */ if (!same(*ep, *lp)) return (0); ep++, lp++; continue; case CDOT: if (*lp++) continue; return (0); case CDOL: if (*lp == 0) continue; return (0); case CEOFC: loc2 = lp; return (1); case CCL: if (cclass(ep, *lp++, 1)) { ep += *ep; continue; } return (0); case NCCL: if (cclass(ep, *lp++, 0)) { ep += *ep; continue; } return (0); case CBRA: braslist[*ep++] = lp; continue; case CKET: braelist[*ep++] = lp; continue; case CDOT|STAR: curlp = lp; while (*lp++) continue; goto star; case CCHR|STAR: curlp = lp; while (same(*lp, *ep)) lp++; lp++; ep++; goto star; case CCL|STAR: case NCCL|STAR: curlp = lp; while (cclass(ep, *lp++, ep[-1] == (CCL|STAR))) continue; ep += *ep; goto star; star: do { lp--; if (lp == locs) break; if (advance(lp, ep)) return (1); } while (lp > curlp); return (0); case CBRC: if (lp == expbuf) continue; if ((isdigit(*lp) || uletter(*lp)) && !uletter(lp[-1]) && !isdigit(lp[-1])) continue; return (0); case CLET: if (!uletter(*lp) && !isdigit(*lp)) continue; return (0); default: error("Re internal error"); } } cclass(set, c, af) register char *set; register int c; int af; { register int n; if (c == 0) return (0); if (value(IGNORECASE) && isupper(c)) c = tolower(c); n = *set++; while (--n) if (n > 2 && set[1] == '-') { if (c >= (set[0] & TRIM) && c <= (set[2] & TRIM)) return (af); set += 3; n -= 2; } else if ((*set++ & TRIM) == c) return (af); return (!af); } CLET: if (!uletter(*cmd/ex/ex_re.h 444 0 33 3523 2425425573 6476 /* Copyright (c) 1980 Regents of the University of California */ /* sccs id: @(#)ex_re.h 6.1 10/18/80 */ /* * Regular expression definitions. * The regular expressions in ex are similar to those in ed, * with the addition of the word boundaries from Toronto ed * and allowing character classes to have [a-b] as in the shell. * The numbers for the nodes below are spaced further apart then * necessary because I at one time partially put in + and | (one or * more and alternation.) */ struct regexp { char Expbuf[ESIZE + 2]; bool Circfl; short Nbra; }; /* * There are three regular expressions here, the previous (in re), * the previous substitute (in subre) and the previous scanning (in scanre). * It would be possible to get rid of "re" by making it a stack parameter * to the appropriate routines. */ struct regexp re; /* Last re */ struct regexp scanre; /* Last scanning re */ struct regexp subre; /* Last substitute re */ /* * Defining circfl and expbuf like this saves us from having to change * old code in the ex_re.c stuff. */ #define expbuf re.Expbuf #define circfl re.Circfl #define nbra re.Nbra /* * Since the phototypesetter v7-epsilon * C compiler doesn't have structure assignment... */ #define savere(a) copy(&a, &re, sizeof (struct regexp)) #define resre(a) copy(&re, &a, sizeof (struct regexp)) /* * Definitions for substitute */ char *braslist[NBRA]; /* Starts of \(\)'ed text in lhs */ char *braelist[NBRA]; /* Ends... */ char rhsbuf[RHSSIZE]; /* Rhs of last substitute */ /* * Definitions of codes for the compiled re's. * The re algorithm is described in a paper * by K. Thompson in the CACM about 10 years ago * and is the same as in ed. */ #define STAR 1 #define CBRA 1 #define CDOT 4 #define CCL 8 #define NCCL 12 #define CDOL 16 #define CEOFC 17 #define CKET 18 #define CCHR 20 #define CBRC 24 #define CLET 25 r substitute */ char *braslist[NBRA]; /* Starts of \(\)'ed text in lhs */ char *braelist[NBRA]; /* Ends... */ char rhsbuf[RHSSIZE]; /* Rhs of last substitute */ /* * Deficmd/ex/ex_set.c 444 0 33 11145 2427734252 6674 /* Copyright (c) 1980 Regents of the University of California */ static char *sccsid = "@(#)ex_set.c 6.3 10/30/80"; #include "ex.h" #include "ex_temp.h" #include "ex_tty.h" /* * Set command. */ char optname[ONMSZ]; set() { register char *cp; register struct option *op; register int c; bool no; extern short ospeed; setnoaddr(); if (skipend()) { if (peekchar() != EOF) ignchar(); propts(); return; } do { cp = optname; do { if (cp < &optname[ONMSZ - 2]) *cp++ = getchar(); } while (isalnum(peekchar())); *cp = 0; cp = optname; if (eq("all", cp)) { if (inopen) pofix(); prall(); goto next; } no = 0; if (cp[0] == 'n' && cp[1] == 'o') { cp += 2; no++; } /* Implement w300, w1200, and w9600 specially */ if (eq(cp, "w300")) { if (ospeed >= B1200) { dontset: ignore(getchar()); /* = */ ignore(getnum()); /* value */ continue; } cp = "window"; } else if (eq(cp, "w1200")) { if (ospeed < B1200 || ospeed >= B2400) goto dontset; cp = "window"; } else if (eq(cp, "w9600")) { if (ospeed < B2400) goto dontset; cp = "window"; } for (op = options; op < &options[NOPTS]; op++) if (eq(op->oname, cp) || op->oabbrev && eq(op->oabbrev, cp)) break; if (op->oname == 0) serror("%s: No such option@- 'set all' gives all option values", cp); c = skipwh(); if (peekchar() == '?') { ignchar(); printone: propt(op); noonl(); goto next; } if (op->otype == ONOFF) { op->ovalue = 1 - no; if (op == &options[PROMPT]) oprompt = 1 - no; goto next; } if (no) serror("Option %s is not a toggle", op->oname); if (c != 0 || setend()) goto printone; if (getchar() != '=') serror("Missing =@in assignment to option %s", op->oname); switch (op->otype) { case NUMERIC: if (!isdigit(peekchar())) error("Digits required@after ="); op->ovalue = getnum(); if (value(TABSTOP) <= 0) value(TABSTOP) = TABS; if (op == &options[WINDOW]) { if (value(WINDOW) >= LINES) value(WI((NDOW) = LINES-1; vsetsiz(value(WINDOW)); } break; case STRING: case OTERM: cp = optname; while (!setend()) { if (cp >= &optname[ONMSZ]) error("String too long@in option assignment"); /* adb change: allow whitepace in strings */ if( (*cp = getchar()) == '\\') if( peekchar() != EOF) *cp = getchar(); cp++; } *cp = 0; if (op->otype == OTERM) { /* * At first glance it seems like we shouldn't care if the terminal type * is changed inside visual mode, as long as we assume the screen is * a mess and redraw it. However, it's a much harder problem than that. * If you happen to change from 1 crt to another that both have the same * size screen, it's OK. But if the screen size if different, the stuff * that gets initialized in vop() will be wrong. This could be overcome * by redoing the initialization, e.g. making the first 90% of vop into * a subroutine. However, the most useful case is where you forgot to do * a setenv before you went into the editor and it thinks you're on a dumb * terminal. Ex treats this like hardcopy and goes into HARDOPEN mode. * This loses because the first part of vop calls oop in this case. * The problem is so hard I gave up. I'm not saying it can't be done, * but I am saying it probably isn't worth the effort. */ if (inopen) error("Can't change type of terminal from within open/visual"); setterm(optname); } else { CP(op->osvalue, optname); op->odefault = 1; } break; } next: flush(); } while (!skipend()); eol(); } setend() { return (iswhite(peekchar()) || endcmd(peekchar())); } prall() { register int incr = (NOPTS + 2) / 3; register int rows = incr; register struct option *op = options; for (; rows; rows--, op++) { propt(op); tab(24); propt(&op[incr]); if (&op[2*incr] < &options[NOPTS]) { tab(56); propt(&op[2 * incr]); } putNFL(); } } propts() { register struct option *op; for (op = options; op < &options[NOPTS]; op++) { #ifdef V6 if (op == &options[TERM]) #else if (op == &options[TTYTYPE]) #endif continue; switch (op->otype) { case ONOFF: case NUMERIC: if (op->ovalue == op->odefault) continue; break; case STRING: if (op->odefault == 0) continue; break; } propt(op); putchar(' '); } noonl(); flush(); } propt(op) register struct option *op; { register char *name; name = op->oname; switch (op->otype) { case ONOFF: printf("%s%s", op->ovalue ? "" : "no", name); break; case NUMERIC: printf("%s=%d", name, op->ovalue); break; case STRING: case OTERM: printf("%s=%s", name, op->osvalue); break; } } UMERIC: if (op->ovalue == op->odefault) continue; break; case STRING: if (op->odefault == 0) continue; break; } propt(op); putchar(' '); } noonl(); flush(); } propt(op) register struct option *op; { register char *name; name = op->oname; switch (op->otype) { case ONOFF: printf("%s%s", op->ovalue ? "" : "no", name); break; case NUMERIC: printf("%s=%d", name, ocmd/ex/ex_subr.c 444 0 33 32635 2432713425 7056 /* Copyright (c) 1980 Regents of the University of California */ static char *sccsid = "@(#)ex_subr.c 6.3 11/8/80"; #include "ex.h" #include "ex_re.h" #include "ex_tty.h" #include "ex_vis.h" /* * Random routines, in alphabetical order. */ any(c, s) int c; register char *s; { register int x; while (x = *s++) if (x == c) return (1); return (0); } backtab(i) register int i; { register int j; j = i % value(SHIFTWIDTH); if (j == 0) j = value(SHIFTWIDTH); i -= j; if (i < 0) i = 0; return (i); } change() { tchng++; chng = tchng; } /* * Column returns the number of * columns occupied by printing the * characters through position cp of the * current line. */ column(cp) register char *cp; { if (cp == 0) cp = &linebuf[LBSIZE - 2]; return (qcolumn(cp, (char *) 0)); } /* * Ignore a comment to the end of the line. * This routine eats the trailing newline so don't call newline(). */ comment() { register int c; do { c = getchar(); } while (c != '\n' && c != EOF); if (c == EOF) ungetchar(c); } Copy(to, from, size) register char *from, *to; register int size; { if (size > 0) do *to++ = *from++; while (--size > 0); } copyw(to, from, size) register line *from, *to; register int size; { if (size > 0) do *to++ = *from++; while (--size > 0); } copywR(to, from, size) register line *from, *to; register int size; { while (--size >= 0) to[size] = from[size]; } ctlof(c) int c; { return (c == TRIM ? '?' : c | ('A' - 1)); } dingdong() { if (VB) putpad(VB); else if (value(ERRORBELLS)) putch('\207'); } fixindent(indent) int indent; { register int i; register char *cp; i = whitecnt(genbuf); cp = vpastwh(genbuf); if (*cp == 0 && i == indent && linebuf[0] == 0) { genbuf[0] = 0; return (i); } CP(genindent(i), cp); return (i); } filioerr(cp) char *cp; { register int oerrno = errno; lprintf("\"%s\"", cp); errno = oerrno; syserror(); } char * genindent(indent) register int indent; { register char *cp; for (cp = genbuf; indent >= value(TABSTOP); indent -= value(TABSTOP)) *cp++ = '\t'; for (; indent > 0; indent--) *cp++ = ' '; return (cp); } getDOT() { getline(*dot); } line * getmark(c) register int c; { register line *addr; for (addr = one; addr <= dol; addr++) if (names[c - 'a'] == (*addr &~ 01)) { return (addr); } return (0); } getn(cp) register char *cp; { register int i = 0; while (isdigit(*cp)) i = i * 10 + *cp++ - '0'; if (*cp) return (0); return (i); } ignnEOF() { register int c = getchar(); if (c == EOF) ungetchar(c); else if (c=='"') comment(); } iswhite(c) int c; { return (c == ' ' || c == '\t'); } junk(c) register int c; { if (c && !value(BEAUTIFY)) return (0); if (c >= ' ' && c != TRIM) return (0); switch (c) { case '\t': case '\n': case '\f': return (0); default: return (1); } } killed() { killcnt(addr2 - addr1 + 1); } killcnt(cnt) register int cnt; { if (inopen) { notecnt = cnt; notenam = notesgn = ""; return; } if (!notable(cnt)) return; printf("%d lines", cnt); if (value(TERSE) == 0) { printf(" %c%s", Command[0] | ' ', Command + 1); if (Command[strlen(Command) - 1] != 'e') putchar('e'); putchar('d'); } putNFL(); } lineno(a) line *a; { return (a - zero); } lineDOL() { return (lineno(dol)); } lineDOT() { return (lineno(dot)); } markDOT() { markpr(dot); } markpr(which) line *which; { if ((inglobal == 0 || inopen) && which <= endcore) { names['z'-'a'+1] = *which & ~01; if (inopen) ncols['z'-'a'+1] = cursor; } } markreg(c) register int c; { if (c == '\'' || c == '`') return ('z' + 1); if (c >= 'a' && c <= 'z') return (c); return (0); } /* * Mesg decodes the terse/verbose strings. Thus * 'xxx@yyy' -> 'xxx' if terse, else 'xxx yyy' * 'xxx|yyy' -> 'xxx' if terse, else 'yyy' * All others map to themselves. */ char * mesg(str) register char *str; { register char *cp; str = strcpy(genbuf, str); for (cp = str; *cp; cp++) switch (*cp) { case '@': if (value(TERSE)) *cp = 0; else *cp = ' '; break; case '|': if (value(TERSE) == 0) return (cp + 1); *cp = 0; break; } return (str); } /*VARARGS2*/ merror(seekpt, i) #ifdef VMUNIX char *seekpt; #else # ifdef lint char *seekpt; # else int seekpt; # endif #endif int i; { register char *cp = linebuf; if (seekpt == 0) return; merror1(seekpt); if (*cp == '\n') putnl(), cp++; if (inopen && CE) vclreol(); if (SO && SE) putpad(SO); printf(mesg(cp), i); if (SO && SE) putpad(SE); } merror1(seekpt) #ifdef VMUNIX char *seekpt; #else # ifdef lint char *seekpt; # else int seekpt; # endif #endif { #ifdef VMUNIX strcpy(linebuf, seekpt); #else lseek(erfile, (long) seekpt, 0); if (read(erfile, linebuf, 128) < 2) CP(linebuf, "ERROR"); #endif } morelines() { if ((int) sbrk(1024 * sizeof (line)) == -1) return (-1); endcore += 1024; return (0); } nonzero() { if (addr1 == zero) { notempty(); error("Nonzero address required@on this command"); } } notable(i) int i; { return (hush == 0 && !inglobal && i > value(REPORT)); } notempty() { if (dol == zero) error("No lines@in the buffer"); } netchHAD(cnt) int cnt; { netchange(lineDOL() - cnt); } netchange(i) register int i; { register char *cp; if (i > 0) notesgn = cp = "more "; else notesgn = cp = "fewer ", i = -i; if (inopen) { notecnt = i; notenam = ""; return; } if (!notable(i)) return; printf(mesg("%d %slines@in file after %s"), i, cp, Command); putNFL(); } putmark(addr) line *addr; { putmk1(addr, putline()); } putmk1(addr, n) register line *addr; int n; { register line *markp; register oldglobmk; oldglobmk = *addr & 1; *addr &= ~1; for (markp = (anymarks ? names : &names['z'-'a'+1]); markp <= &names['z'-'a'+1]; markp++) if (*markp == *addr) *markp = n; *addr = n | oldglobmk; } char * plural(i) long i; { return (i == 1 ? "" : "s"); } int qcount(); short vcntcol; qcolumn(lim, gp) register char *lim, *gp; { register int x; int (*OO)(); OO = Outchar; Outchar = qcount; vcntcol = 0; if (lim != NULL) x = lim[1], lim[1] = 0; pline(0); if (lim != NULL) lim[1] = x; if (gp) while (*gp) putchar(*gp++); Outchar = OO; return (vcntcol); } int qcount(c) int c; { if (c == '\t') { vcntcol += value(TABSTOP) - vcntcol % value(TABSTOP); return; } vcntcol++; } reverse(a1, a2) register line *a1, *a2; { register line t; for (;;) { t = *--a2; if (a2 <= a1) return; *a2 = *a1; *a1++ = t; } } save(a1, a2) line *a1; register line *a2; { register int more; ((if (!FIXUNDO) return; #ifdef TRACE if (trace) vudump("before save"); #endif undkind = UNDNONE; undadot = dot; more = (a2 - a1 + 1) - (unddol - dol); while (more > (endcore - truedol)) if (morelines() < 0) error("Out of memory@saving lines for undo - try using ed"); if (more) (*(more > 0 ? copywR : copyw))(unddol + more + 1, unddol + 1, (truedol - unddol)); unddol += more; truedol += more; copyw(dol + 1, a1, a2 - a1 + 1); undkind = UNDALL; unddel = a1 - 1; undap1 = a1; undap2 = a2 + 1; #ifdef TRACE if (trace) vudump("after save"); #endif } save12() { save(addr1, addr2); } saveall() { save(one, dol); } span() { return (addr2 - addr1 + 1); } sync() { chng = 0; tchng = 0; xchng = 0; } skipwh() { register int wh; wh = 0; while (iswhite(peekchar())) { wh++; ignchar(); } return (wh); } /*VARARGS2*/ smerror(seekpt, cp) #ifdef lint char *seekpt; #else int seekpt; #endif char *cp; { if (seekpt == 0) return; merror1(seekpt); if (inopen && CE) vclreol(); if (SO && SE) putpad(SO); lprintf(mesg(linebuf), cp); if (SO && SE) putpad(SE); } #define std_nerrs (sizeof std_errlist / sizeof std_errlist[0]) #define error(i) i #ifdef lint char *std_errlist[] = { #else # ifdef VMUNIX char *std_errlist[] = { # else short std_errlist[] = { # endif #endif error("Error 0"), error("Not super-user"), error("No such file or directory"), error("No such process"), error("Interrupted system call"), error("Physical I/O error"), error("No such device or address"), error("Argument list too long"), error("Exec format error"), error("Bad file number"), error("No children"), error("No more processes"), error("Not enough core"), error("Permission denied"), error("Bad address"), error("Block device required"), error("Mount device busy"), error("File exists"), error("Cross-device link"), error("No such device"), error("Not a directory"), error("Is a directory"), error("Invalid argument"), error("File table overflow"), error("Too many open files"), error("Not a typewriter"), error("Text file busy"), error("File too large"), error("No space left on device"), error("Illegal seek"), error("Read-only file system"), error("Too many links"), error("Broken pipe"), #ifndef V6 error("Math argument"), error("Result too large"), #endif error("Quota exceeded") /* Berkeley quota systems only */ }; #undef error char * strend(cp) register char *cp; { while (*cp) cp++; return (cp); } strcLIN(dp) char *dp; { CP(linebuf, dp); } syserror() { register int e = errno; dirtcnt = 0; putchar(' '); edited = 0; /* for temp file errors, for example */ if (e >= 0 && errno <= std_nerrs) error(std_errlist[e]); else error("System error %d", e); } /* * Return the column number that results from being in column col and * hitting a tab, where tabs are set every ts columns. Work right for * the case where col > COLUMNS, even if ts does not divide COLUMNS. */ tabcol(col, ts) int col, ts; { int offset, result; if (col >= COLUMNS) { offset = COLUMNS * (col/COLUMNS); col -= offset; } else offset = 0; result = col + ts - (col % ts) + offset; return (result); } char * vfindcol(i) int i; { register char *cp; register int (*OO)() = Outchar; Outchar = qcount; ignore(qcolumn(linebuf - 1, NOSTR)); for (cp = linebuf; *cp && vcntcol < i; cp++) putchar(*cp); if (cp != linebuf) cp--; Outchar = OO; return (cp); } char * vskipwh(cp) register char *cp; { while (iswhite(*cp) && cp[1]) cp++; return (cp); } char * vpastwh(cp) register char *cp; { while (iswhite(*cp)) cp++; return (cp); } whitecnt(cp) register char *cp; { register int i; i = 0; for (;;) switch (*cp++) { case '\t': i += value(TABSTOP) - i % value(TABSTOP); break; case ' ': i++; break; default: return (i); } } #ifdef lint Ignore(a) char *a; { a = a; } Ignorf(a) int (*a)(); { a = a; } #endif markit(addr) line *addr; { if (addr != dot && addr >= one && addr <= dol) markDOT(); } /* * The following code is defensive programming against a bug in the * pdp-11 overlay implementation. Sometimes it goes nuts and asks * for an overlay with some garbage number, which generates an emt * trap. This is a less than elegant solution, but it is somewhat * better than core dumping and losing your work, leaving your tty * in a weird state, etc. */ int _ovno; onemt() { int oovno; signal(SIGEMT, onemt); oovno = _ovno; /* 2 and 3 are valid on 11/40 type vi, so */ if (_ovno < 0 || _ovno > 3) _ovno = 0; error("emt trap, _ovno is %d @ - try again"); } /* * When a hangup occurs our actions are similar to a preserve * command. If the buffer has not been [Modified], then we do * nothing but remove the temporary files and exit. * Otherwise, we sync the temp file and then attempt a preserve. * If the preserve succeeds, we unlink our temp files. * If the preserve fails, we leave the temp files as they are * as they are a backup even without preservation if they * are not removed. */ onhup() { /* * USG tty driver can send multiple HUP's!! */ signal(SIGINT, SIG_IGN); signal(SIGHUP, SIG_IGN); if (chng == 0) { cleanup(1); exit(0); } if (setexit() == 0) { if (preserve()) { cleanup(1); exit(0); } } exit(1); } /* * An interrupt occurred. Drain any output which * is still in the output buffering pipeline. * Catch interrupts again. Unless we are in visual * reset the output state (out of -nl mode, e.g). * Then like a normal error (with the \n before Interrupt * suppressed in visual mode). */ onintr() { #ifndef CBREAK signal(SIGINT, onintr); #else signal(SIGINT, inopen ? vintr : onintr); #endif draino(); if (!inopen) { pstop(); setlastchar('\n'); #ifdef CBREAK } #else } else vraw(); #endif error("\nInterrupt" + inopen); } /* * If we are interruptible, enable interrupts again. * In some critical sections we turn interrupts off, * but not very often. */ setrupt() { if (ruptible) { #ifndef CBREAK signal(SIGINT, onintr); #else signal(SIGINT, inopen ? vintr : onintr); #endif #ifdef SIGTSTP if (dosusp) signal(SIGTSTP, onsusp); #endif } } preserve() { #ifdef VMUNIX tflush(); #endif synctmp(); pid = fork(); if (pid < 0) return (0); if (pid == 0) { close(0); dup(tfile); execl(EXPRESERVE, "expreserve", (char *) 0); exit(1); } waitfor(); if (rpid == pid && status == 0) return (1); return (0); } #ifndef V6 exit(i) int i; { # ifdef TRACE if (trace) fclose(trace); # endif _exit(i); } #endif #ifdef SIGTSTP /* * We have just gotten a susp. Suspend and prepare to resume. */ onsusp() { ttymode f; f = setty(normf); vnfl(); putpad(TE); flush(); signal(SIGTSTP, SIG_DFL); kill(0, SIGTSTP); /* the pc stops here */ signal(SIGTSTP, onsusp); vcontin(0); setty(f); if (!inopen) error(0); else { if (vcnt < 0) { vcnt = -vcnt; if (state == VISUAL) vclear(); else if (state == CRTOPEN) vcnt = 0; } vdirty(0, LINES); vrepaint(cursor); } } endif _exit(i); } #endif #ifdef SIGTSTP /* * We have just gotten a susp. Suspend and prepare tcmd/ex/ex_temp.c 444 0 33 33757 2425472321 7055 /* Copyright (c) 1980 Regents of the University of California */ static char *sccsid = "@(#)ex_temp.c 6.2 10/23/80"; #include "ex.h" #include "ex_temp.h" #include "ex_vis.h" #include "ex_tty.h" /* * Editor temporary file routines. * Very similar to those of ed, except uses 2 input buffers. */ #define READ 0 #define WRITE 1 char tfname[40]; char rfname[40]; int havetmp; short tfile = -1; short rfile = -1; fileinit() { register char *p; register int i, j; struct stat stbuf; if (tline == INCRMT * (HBLKS+2)) return; cleanup(0); close(tfile); tline = INCRMT * (HBLKS+2); blocks[0] = HBLKS; blocks[1] = HBLKS+1; blocks[2] = -1; dirtcnt = 0; iblock = -1; iblock2 = -1; oblock = -1; CP(tfname, svalue(DIRECTORY)); if (stat(tfname, &stbuf)) { dumbness: if (setexit() == 0) filioerr(tfname); else putNFL(); cleanup(1); exit(1); } if ((stbuf.st_mode & S_IFMT) != S_IFDIR) { errno = ENOTDIR; goto dumbness; } ichanged = 0; ichang2 = 0; ignore(strcat(tfname, "/ExXXXXX")); for (p = strend(tfname), i = 5, j = getpid(); i > 0; i--, j /= 10) *--p = j % 10 | '0'; tfile = creat(tfname, 0600); if (tfile < 0) goto dumbness; #ifdef VMUNIX { extern stilinc; /* see below */ stilinc = 0; } #endif havetmp = 1; close(tfile); tfile = open(tfname, 2); if (tfile < 0) goto dumbness; /* brk((char *)fendcore); */ } cleanup(all) bool all; { if (all) { putpad(TE); flush(); } if (havetmp) unlink(tfname); havetmp = 0; if (all && rfile >= 0) { unlink(rfname); close(rfile); rfile = -1; } } getline(tl) line tl; { register char *bp, *lp; register int nl; lp = linebuf; bp = getblock(tl, READ); nl = nleft; tl &= ~OFFMSK; while (*lp++ = *bp++) if (--nl == 0) { bp = getblock(tl += INCRMT, READ); nl = nleft; } } putline() { register char *bp, *lp; register int nl; line tl; dirtcnt++; lp = linebuf; change(); tl = tline; bp = getblock(tl, WRITE); nl = nleft; tl &= ~OFFMSK; while (*bp = *lp++) { if (*bp++ == '\n') { *--bp = 0; linebp = lp; break; } if (--nl == 0) { bp = getblock(tl += INCRMT, WRITE); nl = nleft; } } tl = tline; tline += (((lp - linebuf) + BNDRY - 1) >> SHFT) & 077776; return (tl); } int read(); int write(); char * getblock(atl, iof) line atl; int iof; { register int bno, off; register char *p1, *p2; register int n; bno = (atl >> OFFBTS) & BLKMSK; off = (atl << SHFT) & LBTMSK; if (bno >= NMBLKS) error(" Tmp file too large"); nleft = BUFSIZ - off; if (bno == iblock) { ichanged ((|= iof; hitin2 = 0; return (ibuff + off); } if (bno == iblock2) { ichang2 |= iof; hitin2 = 1; return (ibuff2 + off); } if (bno == oblock) return (obuff + off); if (iof == READ) { if (hitin2 == 0) { if (ichang2) { #ifdef CRYPT if(xtflag) crblock(tperm, ibuff2, CRSIZE, (long)0); #endif blkio(iblock2, ibuff2, write); } ichang2 = 0; iblock2 = bno; blkio(bno, ibuff2, read); #ifdef CRYPT if(xtflag) crblock(tperm, ibuff2, CRSIZE, (long)0); #endif hitin2 = 1; return (ibuff2 + off); } hitin2 = 0; if (ichanged) { #ifdef CRYPT if(xtflag) crblock(tperm, ibuff, CRSIZE, (long)0); #endif blkio(iblock, ibuff, write); } ichanged = 0; iblock = bno; blkio(bno, ibuff, read); #ifdef CRYPT if(xtflag) crblock(tperm, ibuff, CRSIZE, (long)0); #endif return (ibuff + off); } if (oblock >= 0) { #ifdef CRYPT if(xtflag) { /* * Encrypt block before writing, so some devious * person can't look at temp file while editing. */ p1 = obuff; p2 = crbuf; n = CRSIZE; while(n--) *p2++ = *p1++; crblock(tperm, crbuf, CRSIZE, (long)0); blkio(oblock, crbuf, write); } else #endif blkio(oblock, obuff, write); } oblock = bno; return (obuff + off); } #ifdef VMUNIX #define INCORB 64 char incorb[INCORB+1][BUFSIZ]; #define pagrnd(a) ((char *)(((int)a)&~(BUFSIZ-1))) int stilinc; /* up to here not written yet */ #endif blkio(b, buf, iofcn) short b; char *buf; int (*iofcn)(); { #ifdef VMUNIX if (b < INCORB) { if (iofcn == read) { bcopy(pagrnd(incorb[b+1]), buf, BUFSIZ); return; } bcopy(buf, pagrnd(incorb[b+1]), BUFSIZ); if (laste) { if (b >= stilinc) stilinc = b + 1; return; } } else if (stilinc) tflush(); #endif lseek(tfile, (long) (unsigned) b * BUFSIZ, 0); if ((*iofcn)(tfile, buf, BUFSIZ) != BUFSIZ) filioerr(tfname); } #ifdef VMUNIX tlaste() { if (stilinc) dirtcnt = 0; } tflush() { int i = stilinc; stilinc = 0; lseek(tfile, (long) 0, 0); if (write(tfile, pagrnd(incorb[1]), i * BUFSIZ) != (i * BUFSIZ)) filioerr(tfname); } #endif /* * Synchronize the state of the temporary file in case * a crash occurs. */ synctmp() { register int cnt; register line *a; register short *bp; #ifdef VMUNIX if (stilinc) return; #endif if (dol == zero) return; if (ichanged) blkio(iblock, ibuff, write); ichanged = 0; if (ichang2) blkio(iblock2, ibuff2, write); ichang2 = 0; if (oblock != -1) blkio(oblock, obuff, write); time(&H.Time); uid = getuid(); *zero = (line) H.Time; for (a = zero, bp = blocks; a <= dol; a += BUFSIZ / sizeof *a, bp++) { if (*bp < 0) { tline = (tline + OFFMSK) &~ OFFMSK; *bp = ((tline >> OFFBTS) & BLKMSK); if (*bp > NMBLKS) error(" Tmp file too large"); tline += INCRMT; oblock = *bp + 1; bp[1] = -1; } lseek(tfile, (long) (unsigned) *bp * BUFSIZ, 0); cnt = ((dol - a) + 2) * sizeof (line); if (cnt > BUFSIZ) cnt = BUFSIZ; if (write(tfile, (char *) a, cnt) != cnt) { oops: *zero = 0; filioerr(tfname); } *zero = 0; } flines = lineDOL(); lseek(tfile, 0l, 0); if (write(tfile, (char *) &H, sizeof H) != sizeof H) goto oops; } TSYNC() { if (dirtcnt > 12) { #ifdef VMUNIX if (stilinc) tflush(); #endif dirtcnt = 0; synctmp(); } } /* * Named buffer routines. * These are implemented differently than the main buffer. * Each named buffer has a chain of blocks in the register file. * Each block contains roughly 508 chars of text, * and a previous and next block number. We also have information * about which blocks came from deletes of multiple partial lines, * e.g. deleting a sentence or a LISP object. * * We maintain a free map for the temp file. To free the blocks * in a register we must read the blocks to find how they are chained * together. * * BUG: The default savind of deleted lines in numbered * buffers may be rather inefficient; it hasn't been profiled. */ struct strreg { short rg_flags; short rg_nleft; short rg_first; short rg_last; } strregs[('z'-'a'+1) + ('9'-'0'+1)], *strp; struct rbuf { short rb_prev; short rb_next; char rb_text[BUFSIZ - 2 * sizeof (short)]; } *rbuf; #ifdef VMUNIX short rused[256]; #else short rused[32]; #endif short rnleft; short rblock; short rnext; char *rbufcp; regio(b, iofcn) short b; int (*iofcn)(); { if (rfile == -1) { CP(rfname, tfname); *(strend(rfname) - 7) = 'R'; rfile = creat(rfname, 0600); if (rfile < 0) oops: filioerr(rfname); close(rfile); rfile = open(rfname, 2); if (rfile < 0) goto oops; } lseek(rfile, (long) b * BUFSIZ, 0); if ((*iofcn)(rfile, rbuf, BUFSIZ) != BUFSIZ) goto oops; rblock = b; } REGblk() { register int i, j, m; for (i = 0; i < sizeof rused / sizeof rused[0]; i++) { m = (rused[i] ^ 0177777) & 0177777; if (i == 0) m &= ~1; if (m != 0) { j = 0; while ((m & 1) == 0) j++, m >>= 1; rused[i] |= (1 << j); #ifdef RDEBUG printf("allocating block %d\n", i * 16 + j); #endif return (i * 16 + j); } } error("Out of register space (ugh)"); /*NOTREACHED*/ } struct strreg * mapreg(c) register int c; { if (isupper(c)) c = tolower(c); return (isdigit(c) ? &strregs[('z'-'a'+1)+(c-'0')] : &strregs[c-'a']); } int shread(); KILLreg(c) register int c; { struct rbuf arbuf; register struct strreg *sp; rbuf = &arbuf; sp = mapreg(c); rblock = sp->rg_first; sp->rg_first = sp->rg_last = 0; sp->rg_flags = sp->rg_nleft = 0; while (rblock != 0) { #ifdef RDEBUG printf("freeing block %d\n", rblock); #endif rused[rblock / 16] &= ~(1 << (rblock % 16)); regio(rblock, shread); rblock = rbuf->rb_next; } } /*VARARGS*/ shread() { struct front { short a; short b; }; if (read(rfile, (char *) rbuf, sizeof (struct front)) == sizeof (struct front)) return (sizeof (struct rbuf)); return (0); } int getREG(); putreg(c) char c; { struct rbuf arbuf; register line *odot = dot; register line *odol = dol; register int cnt; deletenone(); appendnone(); rbuf = &arbuf; rnleft = 0; rblock = 0; rnext = mapreg(c)->rg_first; if (rnext == 0) { if (inopen) { splitw++; vclean(); vgoto(WECHO, 0); } vreg = -1; error("Nothing in register %c", c); } if (inopen && partreg(c)) { if (!FIXUNDO) { splitw++; vclean(); vgoto(WECHO, 0); vreg = -1; error("Can't put partial line inside macro"); } squish(); addr1 = addr2 = dol; } cnt = append(getREG, addr2); if (inopen && partreg(c)) { unddol = dol; dol = odol; dot = odot; pragged(0); } killcnt(cnt); notecnt = cnt; } partreg(c) char c; { return (mapreg(c)->rg_flags); } notpart(c) register int c; { if (c) mapreg(c)->rg_flags = 0; } getREG() { register char *lp = linebuf; register int c; for (;;) { if (rnleft == 0) { if (rnext == 0) return (EOF); regio(rnext, read); rnext = rbuf->rb_next; rbufcp = rbuf->rb_text; rnleft = sizeof rbuf->rb_text; } c = *rbufcp; if (c == 0) return (EOF); rbufcp++, --rnleft; if (c == '\n') { *lp++ = 0; return (0); } *lp++ = c; } } YANKreg(c) register int c; { struct rbuf arbuf; register line *addr; register struct strreg *sp; char savelb[LBSIZE]; if (isdigit(c)) kshift(); if (islower(c)) KILLreg(c); strp = sp = mapreg(c); sp->rg_flags = inopen && cursor && wcursor; rbuf = &arbuf; if (sp->rg_last) { regio(sp->rg_last, read); rnleft = sp->rg_nleft; rbufcp = &rbuf->rb_text[sizeof rbuf->rb_text - rnleft]; } else { rblock = 0; rnleft = 0; } CP(savelb,linebuf); for (addr = addr1; addr <= addr2; addr++) { getline(*addr); if (sp->rg_flags) { if (addr == addr2) *wcursor = 0; if (addr == addr1) strcpy(linebuf, cursor); } YANKline(); } rbflush(); killed(); CP(linebuf,savelb); } kshift() { register int i; KILLreg('9'); for (i = '8'; i >= '0'; i--) copy(mapreg(i+1), mapreg(i), sizeof (struct strreg)); } YANKline() { register char *lp = linebuf; register struct rbuf *rp = rbuf; register int c; do { c = *lp++; if (c == 0) c = '\n'; if (rnleft == 0) { rp->rb_next = REGblk(); rbflush(); rblock = rp->rb_next; rp->rb_next = 0; rp->rb_prev = rblock; rnleft = sizeof rp->rb_text; rbufcp = rp->rb_text; } *rbufcp++ = c; --rnleft; } while (c != '\n'); if (rnleft) *rbufcp = 0; } rbflush() { register struct strreg *sp = strp; if (rblock == 0) return; regio(rblock, write); if (sp->rg_first == 0) sp->rg_first = rblock; sp->rg_last = rblock; sp->rg_nleft = rnleft; } /* Register c to char buffer buf of size buflen */ regbuf(c, buf, buflen) char c; char *buf; int buflen; { struct rbuf arbuf; register char *p, *lp; rbuf = &arbuf; rnleft = 0; rblock = 0; rnext = mapreg(c)->rg_first; if (rnext==0) { *buf = 0; error("Nothing in register %c",c); } p = buf; while (getREG()==0) { for (lp=linebuf; *lp;) { if (p >= &buf[buflen]) error("Register too long@to fit in memory"); *p++ = *lp++; } *p++ = '\n'; } if (partreg(c)) p--; *p = '\0'; getDOT(); } /* * Encryption routines. These are essentially unmodified from ed. */ #ifdef CRYPT /* * crblock: encrypt/decrypt a block of text. * buf is the buffer through which the text is both input and * output. nchar is the size of the buffer. permp is a work * buffer, and startn is the beginning of a sequence. */ crblock(permp, buf, nchar, startn) char *permp; char *buf; int nchar; long startn; { register char *p1; int n1; int n2; register char *t1, *t2, *t3; t1 = permp; t2 = &permp[256]; t3 = &permp[512]; n1 = startn&0377; n2 = (startn>>8)&0377; p1 = buf; while(nchar--) { *p1 = t2[(t3[(t1[(*p1+n1)&0377]+n2)&0377]-n2)&0377]-n1; n1++; if(n1==256){ n1 = 0; n2++; if(n2==256) n2 = 0; } p1++; } } /* * makekey: initialize buffers based on user key a. */ makekey(a, b) char *a, *b; { register int i; long t; char temp[KSIZE + 1]; for(i = 0; i < KSIZE; i++) temp[i] = *a++; time(&t); t += getpid(); for(i = 0; i < 4; i++) temp[i] ^= (t>>(8*i))&0377; crinit(temp, b); } /* * crinit: besides initializing the encryption machine, this routine * returns 0 if the key is null, and 1 if it is non-null. */ crinit(keyp, permp) char ((*keyp, *permp; { register char *t1, *t2, *t3; register i; int ic, k, temp; unsigned random; char buf[13]; long seed; t1 = permp; t2 = &permp[256]; t3 = &permp[512]; if(*keyp == 0) return(0); strncpy(buf, keyp, 8); while (*keyp) *keyp++ = '\0'; buf[8] = buf[0]; buf[9] = buf[1]; domakekey(buf); seed = 123; for (i=0; i<13; i++) seed = seed*buf[i] + i; for(i=0;i<256;i++){ t1[i] = i; t3[i] = 0; } for(i=0; i<256; i++) { seed = 5*seed + buf[i%13]; random = seed % 65521; k = 256-1 - i; ic = (random&0377) % (k+1); random >>= 8; temp = t1[k]; t1[k] = t1[ic]; t1[ic] = temp; if(t3[k]!=0) continue; ic = (random&0377) % k; while(t3[ic]!=0) ic = (ic+1) % k; t3[k] = ic; t3[ic] = k; } for(i=0; i<256; i++) t2[t1[i]&0377] = i; return(1); } /* * domakekey: the following is the major nonportable part of the encryption * mechanism. A 10 character key is supplied in buffer. * This string is fed to makekey (an external program) which * responds with a 13 character result. This result is placed * in buffer. */ domakekey(buffer) char *buffer; { int pf[2]; if (pipe(pf)<0) pf[0] = pf[1] = -1; if (fork()==0) { close(0); close(1); dup(pf[0]); dup(pf[1]); execl("/usr/lib/makekey", "-", 0); execl("/lib/makekey", "-", 0); exit(1); } write(pf[1], buffer, 10); if (wait((int *)NULL)==-1 || read(pf[0], buffer, 13)!=13) error("crypt: cannot generate key"); close(pf[0]); close(pf[1]); /* end of nonportable part */ } #endif ds with a 13 charcmd/ex/ex_temp.h 444 0 33 11112 2425425640 7041 /* Copyright (c) 1980 Regents of the University of California */ /* sccs id: @(#)ex_temp.h 6.1 10/18/80 */ /* * The editor uses a temporary file for files being edited, in a structure * similar to that of ed. The first block of the file is used for a header * block which guides recovery after editor/system crashes. * Lines are represented in core by a pointer into the temporary file which * is packed into 16 bits (32 on VMUNIX). All but the low bit index the temp * file; the last is used by global commands. The parameters below control * how much the other bits are shifted left before they index the temp file. * Larger shifts give more slop in the temp file but allow larger files * to be edited. * * The editor does not garbage collect the temporary file. When a new * file is edited, the temporary file is rather discarded and a new one * created for the new file. Garbage collection would be rather complicated * in ex because of the general undo, and in any case would require more * work when throwing lines away because marks would have be carefully * checked before reallocating temporary file space. Said another way, * each time you create a new line in the temporary file you get a unique * number back, and this is a property used by marks. * * The following temp file parameters allow 256k bytes in the temporary * file. By changing to the numbers in comments you can get 512k. * For VMUNIX you get more than you could ever want. * VMUNIX uses long (32 bit) integers giving much more * space in the temp file and no waste. This doubles core * requirements but allows files of essentially unlimited size to be edited. */ #ifndef VMUNIX #define BLKMSK 0777 /* 01777 */ #define BNDRY 8 /* 16 */ #define INCRMT 0200 /* 0100 */ #define LBTMSK 0770 /* 0760 */ #define NMBLKS 506 /* 1018 */ #define OFFBTS 7 /* 6 */ #define OFFMSK 0177 /* 077 */ #define SHFT 2 /* 3 */ #else #define BLKMSK 077777 #define BNDRY 2 #define INCRMT 02000 #define LBTMSK 01776 #define NMBLKS 077770 #define OFFBTS 10 #define OFFMSK 01777 #define SHFT 0 #endif /* * The editor uses three buffers into the temporary file (ed uses two * and is very similar). These are two read buffers and one write buffer. * Basically, the editor deals with the file as a sequence of BUFSIZ character * blocks. Each block contains some number of lines (and lines * can run across block boundaries. * * New lines are written into the last block in the temporary file * which is in core as obuf. When a line is needed which isn't in obuf, * then it is brought into an input buffer. As there are two, the choice * is to take the buffer into which the last read (of the two) didn't go. * Thus this is a 2 buffer LRU replacement strategy. Measurement * shows that this saves roughly 25% of the buffer reads over a one * input buffer strategy. Since the editor (on our VAX over 1 week) * spends (spent) roughly 30% of its time in the system read routine, * this can be a big help. */ bool hitin2; /* Last read hit was ibuff2 not ibuff */ bool ichang2; /* Have actually changed ibuff2 */ bool ichanged; /* Have actually changed ibuff */ short iblock; /* Temp file block number of ibuff (or -1) */ short iblock2; /* Temp file block number of ibuff2 (or -1) */ short ninbuf; /* Number useful chars left in input buffer */ short nleft; /* Number usable chars left in output buffer */ short oblock; /* Temp file block number of obuff (or -1) */ #ifndef VMUNIX short tline; /* Current temp file ptr */ #else int tline; #endif char ibuff[BUFSIZ]; char ibuff2[BUFSIZ]; char obuff[BUFSIZ]; /* * Structure of the descriptor block which resides * in the first block of the temporary file and is * the guiding light for crash recovery. * * As the Blocks field below implies, there are temporary file blocks * devoted to (some) image of the incore array of pointers into the temp * file. Thus, to recover from a crash we use these indices to get the * line pointers back, and then use the line pointers to get the text back. * Except for possible lost lines due to sandbagged I/O, the entire * file (at the time of the last editor "sync") can be recovered from * the temp file. */ /* This definition also appears in expreserve.c... beware */ struct header { time_t Time; /* Time temp file last updated */ short Uid; #ifndef VMUNIX short Flines; /* Number of lines in file */ #else int Flines; #endif char Savedfile[FNSIZE]; /* The current file name */ short Blocks[LBLKS]; /* Blocks where line pointers stashed */ } H; #define uid H.Uid #define flines H.Flines #define savedfile H.Savedfile #define blocks H.Blocks t editor "sync") can be recovered from * the temp file. */ /* This definition also appears in expreserve.c... beware */ struct header { time_t Time; /* Time temp file last updated */ short Uid; #ifndef VMUNIX short Flines; /* Number of lines in file */ #else int Flines; #endif char Savedfile[FNSIZE]; /* The current file name */ short Blocks[LBLKS]; /* Blocks where line pointers stashed */ } H; #define uid H.Uid #defincmd/ex/ex_tty.c 444 0 33 12064 2427734253 6723 /* Copyright (c) 1980 Regents of the University of California */ static char *sccsid = "@(#)ex_tty.c 6.2 10/30/80"; #include "ex.h" #include "ex_tty.h" /* * Terminal type initialization routines, * and calculation of flags at entry or after * a shell escape which may change them. */ short ospeed = -1; gettmode() { #ifndef USG3TTY if (gtty(1, &tty) < 0) return; if (ospeed != tty.sg_ospeed) value(SLOWOPEN) = tty.sg_ospeed < B1200; ospeed = tty.sg_ospeed; normf = tty.sg_flags; UPPERCASE = (tty.sg_flags & LCASE) != 0; GT = (tty.sg_flags & XTABS) != XTABS && !XT; NONL = (tty.sg_flags & CRMOD) == 0; #else if (ioctl(1, TCGETA, &tty) < 0) return; if (ospeed != tty.c_cflag & CBAUD) value(SLOWOPEN) = (tty.c_cflag & CBAUD) < B1200; ospeed = tty.c_cflag & CBAUD; normf = tty; UPPERCASE = (tty.c_iflag & IUCLC) != 0; GT = (tty.c_oflag & TABDLY) != TAB3 && !XT; NONL = (tty.c_oflag & OCRNL) == 0; #endif } char *xPC; char **sstrs[] = { &AL, &BC, &BT, &CD, &CE, &CL, &CM, &xCR, &DC, &DL, &DM, &DO, &ED, &EI, &F0, &F1, &F2, &F3, &F4, &F5, &F6, &F7, &F8, &F9, &HO, &IC, &IM, &IP, &KD, &KE, &KH, &KL, &KR, &KS, &KU, &LL, &ND, &xNL, &xPC, &SE, &SF, &SO, &SR, &TA, &TE, &TI, &UP, &VB, &VS, &VE }; bool *sflags[] = { &AM, &BS, &DA, &DB, &EO, &HC, &HZ, &IN, &MI, &NC, &NS, &OS, &UL, &XB, &XN, &XT, &XX }; char **fkeys[10] = { &F0, &F1, &F2, &F3, &F4, &F5, &F6, &F7, &F8, &F9 }; setterm(type) char *type; { char *tgoto(); register int unknown, i; register int l; char ltcbuf[TCBUFSIZE]; if (type[0] == 0) type = "xx"; unknown = 0; putpad(TE); if (tgetent(ltcbuf, type) != 1) { unknown++; CP(ltcbuf, "xx|dumb:"); } i = LINES = tgetnum("li"); if (LINES <= 5) LINES = 24; if (LINES > TUBELINES) LINES = TUBELINES; l = LINES; if (ospeed < B1200) l = 9; /* including the message line at the bottom */ else if (ospeed < B2400) l = 17; if (l > LINES) l = LINES; aoftspace = tspace; zap(); /* * Initialize keypad arrow keys. */ arrows[0].cap = KU; arrows[0].mapto = "k"; arrows[0].descr = "up"; arrows[1].cap = KD; arrows[1].mapto = "j"; arrows[1].descr = "down"; arrows[2].cap = KL; arrows[2].mapto = "h"; arrows[2].descr = "left"; arrows[3].cap = KR; arrows[3].mapto = "l"; arrows[3].descr = "right"; arrows[4].cap = KH; arrows[4].mapto = "H"; arrows[4].descr = "home"; #ifdef TIOCLGET /* * Now map users susp char to ^Z, being careful that the susp * overrides any arrow key, but only for hackers (=new tty driver). */ { static char sc[2]; int i, fnd; ioctl(0, TIOCGETD, &ldisc);(( if (ldisc == NTTYDISC) { sc[0] = olttyc.t_suspc; sc[1] = 0; if (olttyc.t_suspc == CTRL(z)) { for (i=0; i<=4; i++) if (arrows[i].cap[0] == CTRL(z)) addmac(sc, NULL, NULL, arrows); } else addmac(sc, "\32", "susp", arrows); } } #endif options[WINDOW].ovalue = options[WINDOW].odefault = l - 1; if (defwind) options[WINDOW].ovalue = defwind; options[SCROLL].ovalue = options[SCROLL].odefault = HC ? 11 : ((l-1) / 2); COLUMNS = tgetnum("co"); if (COLUMNS <= 4) COLUMNS = 1000; if (tgoto(CM, 2, 2)[0] == 'O') /* OOPS */ CA = 0, CM = 0; else CA = 1, costCM = cost(tgoto(CM, 8, 10)); costSR = cost(SR); costAL = cost(AL); PC = xPC ? xPC[0] : 0; aoftspace = tspace; CP(ttytype, longname(ltcbuf, type)); if (i <= 0) LINES = 2; /* proper strings to change tty type */ termreset(); gettmode(); value(REDRAW) = AL && DL; value(OPTIMIZE) = !CA && !GT; if (ospeed == B1200 && !value(REDRAW)) value(SLOWOPEN) = 1; /* see also gettmode above */ if (unknown) serror("%s: Unknown terminal type", type); } zap() { register char *namp; register bool **fp; register char ***sp; namp = "ambsdadbeohchzinmincnsosulxbxnxtxx"; fp = sflags; do { *(*fp++) = tgetflag(namp); namp += 2; } while (*namp); namp = "albcbtcdceclcmcrdcdldmdoedeik0k1k2k3k4k5k6k7k8k9hoicimipkdkekhklkrkskullndnlpcsesfsosrtatetiupvbvsve"; sp = sstrs; do { *(*sp++) = tgetstr(namp, &aoftspace); namp += 2; } while (*namp); } char * longname(bp, def) register char *bp; char *def; { register char *cp; while (*bp && *bp != ':' && *bp != '|') bp++; if (*bp == '|') { bp++; cp = bp; while (*cp && *cp != ':' && *cp != '|') cp++; *cp = 0; return (bp); } return (def); } char * fkey(i) int i; { if (0 <= i && i <= 9) return(*fkeys[i]); else return(NOSTR); } /* * cost figures out how much (in characters) it costs to send the string * str to the terminal. It takes into account padding information, as * much as it can, for a typical case. (Right now the typical case assumes * the number of lines affected is the size of the screen, since this is * mainly used to decide if AL or SR is better, and this always happens * at the top of the screen. We assume cursor motion (CM) has little * padding, if any, required, so that case, which is really more important * than AL vs SR, won't be really affected.) */ static int costnum; cost(str) char *str; { int countnum(); if (str == NULL) return 10000; /* infinity */ costnum = 0; tputs(str, LINES, countnum); return costnum; } /* ARGSUSED */ countnum(ch) char ch; { costnum++; } een, since this is * mainly used to decide if AL or SR is better, and this always happens * at the top of the screen. We assume cursor motion (CM) has little * padding, if any, required, so that case, which is really more important * than AL vs SR, won't be really affected.) */ static int costnum; cost(str) char *str; { int countnum(); if (str == NULL) return 10000; /* infinity */ costnum = 0; tputs(str, LINES, countnum); return costnum; } /cmd/ex/ex_tty.h 444 0 33 16120 2425425671 6724 /* Copyright (c) 1980 Regents of the University of California */ /* sccs id: @(#)ex_tty.h 6.1 10/18/80 */ /* * Capabilities from termcap * * The description of terminals is a difficult business, and we only * attempt to summarize the capabilities here; for a full description * see the paper describing termcap. * * Capabilities from termcap are of three kinds - string valued options, * numeric valued options, and boolean options. The string valued options * are the most complicated, since they may include padding information, * which we describe now. * * Intelligent terminals often require padding on intelligent operations * at high (and sometimes even low) speed. This is specified by * a number before the string in the capability, and has meaning for the * capabilities which have a P at the front of their comment. * This normally is a number of milliseconds to pad the operation. * In the current system which has no true programmible delays, we * do this by sending a sequence of pad characters (normally nulls, but * specifiable as "pc"). In some cases, the pad is better computed * as some number of milliseconds times the number of affected lines * (to bottom of screen usually, except when terminals have insert modes * which will shift several lines.) This is specified as '12*' e.g. * before the capability to say 12 milliseconds per affected whatever * (currently always line). Capabilities where this makes sense say P*. */ char tspace[256]; /* Space for capability strings */ char *aoftspace; /* Address of tspace for relocation */ char *AL; /* P* Add new blank line */ char *BC; /* Back cursor */ char *BT; /* P Back tab */ char *CD; /* P* Clear to end of display */ char *CE; /* P Clear to end of line */ char *CL; /* P* Clear screen */ char *CM; /* P Cursor motion */ char *xCR; /* P Carriage return */ char *DC; /* P* Delete character */ char *DL; /* P* Delete line sequence */ char *DM; /* Delete mode (enter) */ char *DO; /* Down line sequence */ char *ED; /* End delete mode */ char *EI; /* End insert mode */ char *F0,*F1,*F2,*F3,*F4,*F5,*F6,*F7,*F8,*F9; /* Strings sent by various function keys */ char *HO; /* Home cursor */ char *IC; /* P Insert character */ char *IM; /* Insert mode (give as ':im=:' if 'ic' */ char *IP; /* P* Insert pad after char ins'd using IM+IE */ char *KD; /* Keypad down arrow */ char *KE; /* Keypad don't xmit */ char *KH; /* Keypad home key */ char *KL; /* Keypad left arrow */ char *KR; /* Keypad right arrow */ char *KS; /* Keypad start xmitting */ char *KU; /* Keypad up arrow */ char *LL; /* Quick to last line, column 0 */ char *ND; /* Non-destructive space */ char *xNL; /* Line feed (new line) */ char PC; /* Pad character */ char *SE; /* Standout end (may leave space) */ char *SF; /* P Scroll forwards */ char *SO; /* Stand out begin (may leave space) */ char *SR; /* P Scroll backwards */ char *TA; /* P Tab (other than ^I or with padding) */ char *TE; /* Terminal end sequence */ char *TI; /* Terminal initial sequence */ char *UP; /* Upline */ char *VB; /* Visible bell */ char *VE; /* Visual end sequence */ char *VS; /* Visual start sequence */ bool AM; /* Automatic margins */ bool BS; /* Backspace works */ bool CA; /* Cursor addressible */ bool DA; /* Display may be retained above */ bool DB; /* Display may be retained below */ bool EO; /* Can erase overstrikes with ' ' */ bool GT; /* Gtty indicates tabs */ bool HC; /* Hard copy terminal */ bool HZ; /* Hazeltine ~ braindamage */ bool IN; /* Insert-null blessing */ bool MI; /* can move in insert mode */ bool NC; /* No Cr - \r snds \r\n then eats \n (dm2500) */ bool NS; /* No scroll - linefeed at bottom won't scroll */ bool OS; /* Overstrike works */ bool UL; /* Underlining works even though !os */ bool XB; /* Beehive (no escape key, simulate with f1) */ bool XN; /* A newline gets eaten after wrap (concept) */ bool XT; /* Tabs are destructive */ bool XX; /* Tektronix 4025 insert line */ /* X? is reserved for severely nauseous glitches */ /* If there are enough of these we may need bit masks! */ /* * From the tty modes... */ bool NONL; /* Terminal can't hack linefeeds doing a CR */ bool UPPERCASE; /* Ick! */ short LINES; /* Number of lines on screen */ short COLUMNS; short OCOLUMNS; /* Save COLUMNS for a hack in open mode */ short outcol; /* Where the cursor is */ short outline; short destcol; /* Where the cursor should be */ short destline; /* * There are several kinds of tty drivers to contend with. These include: * (1) V6: no CBREAK, no ioctl. (Include PWB V1 here). * (2) V7 research: has CBREAK, has ioctl, and has the tchars (TIOCSETC) * business to change start, stop, etc. chars. * (3) USG V2: Basically like V6 but RAW mode is like V7 RAW. * (We treat it as V6.) * (4) USG V3: equivalent to V7 but totally incompatible. * (5) Berkeley: has ltchars in addition to all of V7. * * The following attempts to decide what we are on, and declare * some variables in the appropriate format. The wierd looking one (ttymode) * is the thing we pass to sTTY and family to turn "RAW" mode on or off * when we go into or out of visual mode. In V7/V6 it's just the flags word * to stty. In USG V3 it's the whole tty structure. */ #ifdef USG3TTY /* USG V3 */ struct termio tty; /* Use this one structure to change modes */ typedef struct termio ttymode; /* Mode to contain tty flags */ #else /* All others */ struct sgttyb tty; /* Always stty/gtty using this one structure */ typedef int ttymode; /* Mode to contain tty flags */ # ifdef TIOCSETC /* V7 */ struct tchars ottyc, nttyc; /* For V7 character masking */ # endif # ifdef TIOCLGET /* Berkeley */ struct ltchars olttyc, nlttyc; /* More of tchars style stuff */ # endif #endif ttymode normf; /* Restore tty flags to this (someday) */ bool normtty; /* Have to restore normal mode from normf */ ttymode ostart(), setty(), unixex(); short WBOT; short WECHO; short costCM; /* # chars to output a typical CM, with padding etc. */ short costSR; /* likewise */ short costAL; #ifdef VMUNIX # define MAXNOMACS 128 /* max number of macros of each kind */ # define MAXCHARMACS 2048 /* max # of chars total in macros */ #else # define MAXNOMACS 32 /* max number of macros of each kind */ # define MAXCHARMACS 512 /* max # of chars total in macros */ #endif struct maps { char *cap; /* pressing button that sends this.. */ char *mapto; /* .. maps(( to this string */ char *descr; /* legible description of key */ }; struct maps arrows[MAXNOMACS]; /* macro defs - 1st 5 built in */ struct maps immacs[MAXNOMACS]; /* for while in insert mode */ struct maps abbrevs[MAXNOMACS]; /* for word abbreviations */ int ldisc; /* line discipline for ucb tty driver */ char mapspace[MAXCHARMACS]; char *msnext; /* next free location in mapspace */ int maphopcnt; /* check for infinite mapping loops */ bool anyabbrs; /* true if abbr or unabbr has been done */ char ttynbuf[20]; /* result of ttyname() */ int ttymesg; /* original mode of users tty */ arrows[MAXNOMACS]; /* macro defs - 1st 5 built in */ struct maps immacs[MAXNOMACS]; /* for while in insert mode */ struct maps abbrevs[MAXNOMACS]; /* for word abbreviations */ int ldisc; /* line discipline for ucb tty driver */ char mapspace[MAXCHARMACS]; char *msnext; /* next free location in mapspace */ int maphopcnt; /* check for infinite mapping loops */ bool anyabbrs; /* true if abbr or unabbr has been done */ char ttynbcmd/ex/ex_tune.h 444 0 33 7053 2427734254 7046 /* Copyright (c) 1980 Regents of the University of California */ /* sccs id: @(#)ex_tune.h 6.2 10/30/80 */ /* * Definitions of editor parameters and limits */ /* * Pathnames. * * Only exstrings is looked at "+4", i.e. if you give * "/usr/lib/..." here, "/lib" will be tried only for strings. */ #include "local/uparm.h" #define EXRECOVER libpath(ex3.6recover) #define EXPRESERVE libpath(ex3.6preserve) #ifndef VMUNIX #define EXSTRINGS libpath(ex3.6strings) #endif /* * If your system believes that tabs expand to a width other than * 8 then your makefile should cc with -DTABS=whatever, otherwise we use 8. */ #ifndef TABS #define TABS 8 #endif /* * Maximums * * The definition of LBSIZE should be the same as BUFSIZ (512 usually). * Most other definitions are quite generous. */ /* FNSIZE is also defined in expreserve.c */ #define FNSIZE 128 /* File name size */ #ifdef VMUNIX #define LBSIZE 1024 #define ESIZE 512 #define CRSIZE 1024 #else #define LBSIZE 512 /* Line length */ #define ESIZE 128 /* Size of compiled re */ #define CRSIZE 512 #endif #define RHSSIZE 256 /* Size of rhs of substitute */ #define NBRA 9 /* Number of re \( \) pairs */ #define TAGSIZE 32 /* Tag length */ #define ONMSZ 64 /* Option name size */ #define GBSIZE 256 /* Buffer size */ #define UXBSIZE 128 /* Unix command buffer size */ #define VBSIZE 128 /* Partial line max size in visual */ /* LBLKS is also defined in expreserve.c */ #ifndef VMUNIX #define LBLKS 125 /* Line pointer blocks in temp file */ #define HBLKS 1 /* struct header fits in BUFSIZ*HBLKS */ #else #define LBLKS 900 #define HBLKS 2 #endif #define MAXDIRT 12 /* Max dirtcnt before sync tfile */ #define TCBUFSIZE 1024 /* Max entry size in termcap, see also termlib and termcap */ /* * Except on VMUNIX, these are a ridiculously small due to the * lousy arglist processing implementation which fixes core * proportional to them. Argv (and hence NARGS) is really unnecessary, * and argument character space not needed except when * arguments exist. Argument lists should be saved before the "zero" * of the incore line information and could then * be reasonably large. */ #ifndef VMUNIX #define NARGS 100 /* Maximum number of names in "next" */ #define NCARGS LBSIZE /* Maximum arglist chars in "next" */ #else #define NCARGS 5120 #define NARGS (NCARGS/6) #endif /* * Note: because the routine "alloca" is not portable, TUBESIZE * bytes are allocated on the stack each time you go into visual * and then never freed by the system. Thus if you have no terminals * which are larger than 24 * 80 you may well want to make TUBESIZE * smaller. TUBECOLS should stay at 160 since this defines the maximum * length of opening on hardcopies and allows two lines of open on * terminals like adm3's (glass tty's) where it switches to pseudo * hardcopy mode when a line gets longer than 80 characters. */ #ifndef VMUNIX #define TUBELINES 60 /* Number of screen lines for visual */ #define TUBECOLS 160 /* Number of screen columns for visual */ #define TUBESIZE 5000 /* Maximum screen size for visual */ #else #define TUBELINES 66 #define TUBECOLS 160 #define TUBESIZE 6600 /* 66 * 100 */ #endif /* * Output column (and line) are set to this value on cursor addressible * terminals when we lose track of the cursor to force cursor * addressing to occur. */ #define UKCOL -20 /* Prototype unknown column */ /* * Attention is the interrupt character (normally 0177 -- delete). * Quit is the quit signal (normally FS -- control-\) and quits open/visual. */ #define ATTN (-2) #define QUIT ('\\' & 037) sual */ #else #define TUBELINES 66 #define TUBECOLS 160 #define TUBESIZE 6600 /* 66 * 100 */ #endif /* * Output column (and line) are set to this value on cursor addressible * terminals when we lose track of the cursor to force cursor * addressing to occur. */ #define UKCOL -20 /* Prototype unknown column */ /* * Attention is the interrupt character (normally 0177 -- delete). * Quit is the quit signal (normally FS -- control-\) and quits open/visual. */ #cmd/ex/ex_v.c 444 0 33 17307 2425425734 6354 /* Copyright (c) 1980 Regents of the University of California */ static char *sccsid = "@(#)ex_v.c 6.1 10/18/80"; #include "ex.h" #include "ex_re.h" #include "ex_tty.h" #include "ex_vis.h" /* * Entry points to open and visual from command mode processor. * The open/visual code breaks down roughly as follows: * * ex_v.c entry points, checking of terminal characteristics * * ex_vadj.c logical screen control, use of intelligent operations * insert/delete line and coordination with screen image; * updating of screen after changes. * * ex_vget.c input of single keys and reading of input lines * from the echo area, handling of \ escapes on input for * uppercase only terminals, handling of memory for repeated * commands and small saved texts from inserts and partline * deletes, notification of multi line changes in the echo * area. * * ex_vmain.c main command decoding, some command processing. * * ex_voperate.c decoding of operator/operand sequences and * contextual scans, implementation of word motions. * * ex_vops.c major operator interfaces, undos, motions, deletes, * changes, opening new lines, shifts, replacements and yanks * coordinating logical and physical changes. * * ex_vops2.c subroutines for operator interfaces in ex_vops.c, * insert mode, read input line processing at lowest level. * * ex_vops3.c structured motion definitions of ( ) { } and [ ] operators, * indent for lisp routines, () and {} balancing. * * ex_vput.c output routines, clearing, physical mapping of logical cursor * positioning, cursor motions, handling of insert character * and delete character functions of intelligent and unintelligent * terminals, visual mode tracing routines (for debugging), * control of screen image and its updating. * * ex_vwind.c window level control of display, forward and backward rolls, * absolute motions, contextual displays, line depth determination */ /* * Enter open mode */ oop() { register char *ic; char atube[TUBESIZE + LBSIZE]; register ttymode f; ovbeg(); if (peekchar() == '/') { ignore(compile(getchar(), 1)); savere(scanre); if (execute(0, dot) == 0) error("Fail|Pattern not found on addressed line"); ic = loc1; if (ic > linebuf && *ic == 0) ic--; } else { getDOT(); ic = vskipwh(linebuf); } newline(); /* * If overstrike then have to HARDOPEN * else if can move cursor up off current line can use CRTOPEN (~~vi1) * otherwise (ugh) have to use ONEOPEN (like adm3) */ if (OS && !EO) bastate = HARDOPEN; else if (CA || UP) bastate = CRTOPEN; else bastate = ONEOPEN; setwind(); /* * To avoid bombing on glass-crt's when the line is too long * pretend that such terminals are 160 columns wide. * If a line is too wide for display, we will dynamically * switch to hardcopy open mode. */ if (state != CRTOPEN) WCOLS = TUBECOLS; if (!inglobal) savevis(); vok(atube); if (state != CRTOPEN) COLUMNS = WCOLS; Outchar = vputchar; f = ostart(); if (state == CRTOPEN) { if (outcol == UKCOL) outcol = 0; vmoveitup(1, 1); } else outline = destline = WBOT; vshow(dot, NOLINE); vnline(ic); vmain(); if (state != CRTOPEN) vclean(); Command = "open"; ovend(f); } ovbeg() { if (!value(OPEN)) error("Can't use open/visual unless open option is set"); if (inopen) error("Recursive open/visual not allowed"); Vlines = lineDOL(); fixzero(); setdot(); pastwh(); dot = addr2; } ovend(f) ttymode f; { splitw++; vgoto(WECHO, 0); vclreol(); vgoto(WECHO, 0); holdcm = 0; splitw = 0; ostop(f); setoutt(); undvis(); COLUMNS = OCOLUMNS; inopen = 0; flusho(); netchHAD(Vlines); } /* * Enter visual mode */ vop() { register int c; char atube[TUBESIZE + LBSIZE]; register ttymode f; if (!CA && UP == NOSTR) { if (initev) { toopen: merror("[Using open mode]"); putNFL(); oop(); return; } error("Visual needs addressible cursor or upline capability"); } if (OS && !EO) { if (initev) goto toopen; error("Can't use visual on a terminal which overstrikes"); } if (!CL) { ((if (initev) goto toopen; error("Visual requires clear screen capability"); } if (NS && !SF) { if (initev) goto toopen; error("Visual requires scrolling"); } ovbeg(); bastate = VISUAL; c = 0; if (any(peekchar(), "+-^.")) c = getchar(); pastwh(); vsetsiz(isdigit(peekchar()) ? getnum() : value(WINDOW)); setwind(); newline(); vok(atube); if (!inglobal) savevis(); Outchar = vputchar; vmoving = 0; f = ostart(); if (initev == 0) { vcontext(dot, c); vnline(NOSTR); } vmain(); Command = "visual"; ovend(f); } /* * Hack to allow entry to visual with * empty buffer since routines internally * demand at least one line. */ fixzero() { if (dol == zero) { register bool ochng = chng; vdoappend(""); if (!ochng) sync(); addr1 = addr2 = one; } else if (addr2 == zero) addr2 = one; } /* * Save lines before visual between unddol and truedol. * Accomplish this by throwing away current [unddol,truedol] * and then saving all the lines in the buffer and moving * unddol back to dol. Don't do this if in a global. * * If you do * g/xxx/vi. * and then do a * :e xxxx * at some point, and then quit from the visual and undo * you get the old file back. Somewhat weird. */ savevis() { if (inglobal) return; truedol = unddol; saveall(); unddol = dol; undkind = UNDNONE; } /* * Restore a sensible state after a visual/open, moving the saved * stuff back to [unddol,dol], and killing the partial line kill indicators. */ undvis() { if (ruptible) signal(SIGINT, onintr); squish(); pkill[0] = pkill[1] = 0; unddol = truedol; unddel = zero; undap1 = one; undap2 = dol + 1; undkind = UNDALL; if (undadot <= zero || undadot > dol) undadot = zero+1; } /* * Set the window parameters based on the base state bastate * and the available buffer space. */ setwind() { WCOLS = COLUMNS; switch (bastate) { case ONEOPEN: if (AM) WCOLS--; /* fall into ... */ case HARDOPEN: basWTOP = WTOP = WBOT = WECHO = 0; ZERO = 0; holdcm++; break; case CRTOPEN: basWTOP = LINES - 2; /* fall into */ case VISUAL: ZERO = LINES - TUBESIZE / WCOLS; if (ZERO < 0) ZERO = 0; if (ZERO > basWTOP) error("Screen too large for internal buffer"); WTOP = basWTOP; WBOT = LINES - 2; WECHO = LINES - 1; break; } state = bastate; basWLINES = WLINES = WBOT - WTOP + 1; } /* * Can we hack an open/visual on this terminal? * If so, then divide the screen buffer up into lines, * and initialize a bunch of state variables before we start. */ vok(atube) register char *atube; { register int i; if (WCOLS == 1000) serror("Don't know enough about your terminal to use %s", Command); if (WCOLS > TUBECOLS) error("Terminal too wide"); if (WLINES >= TUBELINES || WCOLS * (WECHO - ZERO + 1) > TUBESIZE) error("Screen too large"); vtube0 = atube; vclrbyte(atube, WCOLS * (WECHO - ZERO + 1)); for (i = 0; i < ZERO; i++) vtube[i] = (char *) 0; for (; i <= WECHO; i++) vtube[i] = atube, atube += WCOLS; for (; i < TUBELINES; i++) vtube[i] = (char *) 0; vutmp = atube; vundkind = VNONE; vUNDdot = 0; OCOLUMNS = COLUMNS; inopen = 1; #ifdef CBREAK signal(SIGINT, vintr); #endif vmoving = 0; splitw = 0; doomed = 0; holdupd = 0; Peekkey = 0; vcnt = vcline = 0; if (vSCROLL == 0) vSCROLL = (value(WINDOW)+1)/2; /* round up so dft=6,11 */ } #ifdef CBREAK vintr() { signal(SIGINT, vintr); if (vcatch) onintr(); ungetkey(ATTN); draino(); } #endif /* * Set the size of the screen to size lines, to take effect the * next time the screen is redrawn. */ vsetsiz(size) int size; { register int b; if (bastate != VISUAL) return; b = LINES - 1 - size; if (b >= LINES - 1) b = LINES - 2; if (b < 0) b = 0; basWTOP = b; basWLINES = WBOT - b + 1; } e = 0; if (vSCROLL == 0) vSCROLL = (value(WINDOW)+1)/2; /* round up so dft=6,11 */ } #ifdef CBREAK vintr() { signal(SIGINT, vintr); if (vcatch) onintr(); ungetkey(ATTN); draino(); } #endif /* * Set the size of the screen to size lines, to take effect the * next time the screen is redrawn. */ vsetscmd/ex/ex_unix.c 444 0 33 13405 2425425754 7067 /* Copyright (c) 1979 Regents of the University of California */ static char *sccsid = "@(#)ex_unix.c 6.1 10/18/80"; #include "ex.h" #include "ex_temp.h" #include "ex_tty.h" #include "ex_vis.h" /* * Unix escapes, filtering */ /* * First part of a shell escape, * parse the line, expanding # and % and ! and printing if implied. */ unix0(warn) bool warn; { register char *up, *fp; register short c; char printub, puxb[UXBSIZE + sizeof (int)]; printub = 0; CP(puxb, uxb); c = getchar(); if (c == '\n' || c == EOF) error("Incomplete shell escape command@- use 'shell' to get a shell"); up = uxb; do { switch (c) { case '\\': if (any(peekchar(), "%#!")) c = getchar(); default: if (up >= &uxb[UXBSIZE]) { tunix: uxb[0] = 0; error("Command too long"); } *up++ = c; break; case '!': fp = puxb; if (*fp == 0) { uxb[0] = 0; error("No previous command@to substitute for !"); } printub++; while (*fp) { if (up >= &uxb[UXBSIZE]) goto tunix; *up++ = *fp++; } break; case '#': fp = altfile; if (*fp == 0) { uxb[0] = 0; error("No alternate filename@to substitute for #"); } goto uexp; case '%': fp = savedfile; if (*fp == 0) { uxb[0] = 0; error("No filename@to substitute for %%"); } uexp: printub++; while (*fp) { if (up >= &uxb[UXBSIZE]) goto tunix; *up++ = *fp++ | QUOTE; } break; } c = getchar(); } while (c == '"' || c == '|' || !endcmd(c)); if (c == EOF) ungetchar(c); *up = 0; if (!inopen) resetflav(); if (warn) ckaw(); if (warn && hush == 0 && chng && xchng != chng && value(WARN) && dol > zero) { xchng = chng; vnfl(); printf(mesg("[No write]|[No write since last change]")); noonl(); flush(); } else warn = 0; if (printub) { if (uxb[0] == 0) error("No previous command@to repeat"); if (inopen) { splitw++; vclean(); vgoto(WECHO, 0); } if (warn) vnfl(); if (hush == 0) lprintf("!%s", uxb); if (inopen && Outchar != termchar) { vclreol(); vgoto(WECHO, 0); } else putnl(); flush(); } } /* * Do the real work for execution of a shell escape. * Mode is like the number passed to open system calls * and indicates filtering. If input is implied, newstdin * must have been setup already. */ ttymode unixex(opt, up, newstdin, mode) char *opt, *up; int newstdin, mode; { int pvec[2]; ttymode f; signal(SIGINT, SIG_IGN); #ifdef SIGTSTP if (dosusp) signal(SIGTSTP, SIG_DFL); #endif if (inopen) f = setty(normf); if ((mode & 1) && pipe(pvec) < 0) { /* Newstdin should be io so it will be closed */ if (inopen) setty(f); error("Can't make pipe for filter"); } #ifndef VFORK pid = fork(); #else pid = vfork(); #endif if (pid < 0) { if (mode & 1) { close(pvec[0]); close(pvec[1]); } setrupt(); error("No more processes"); } if (pid == 0) { if (mode & 2) { close(0); dup(newstdin); close(newstdin); } if (mode & 1) { close(pvec[0]); close(1); dup(pvec[1]); if (inopen) { close(2); dup(1); } close(pvec[1]); } if (io) close(io); if (tfile) close(tfile); #ifndef VMUNIX close(erfile); #endif signal(SIGHUP, oldhup); signal(SIGQUIT, oldquit); if (ruptible) signal(SIGINT, SIG_DFL); execl(svalue(SHELL), "sh", opt, up, (char *) 0); printf("No %s!\n", svalue(SHELL)); error(NOSTR); } if (mode & 1) { io = pvec[0]; close(pvec[1]); } if (newstdin) close(newstdin); return (f); } /* * Wait for the command to complete. * F is for restoration of tty mode if from open/visual. * C flags suppression of printing. */ unixwt(c, f) bool c; ttymode f; { waitfor(); #ifdef SIGTSTP if (dosusp) signal(SIGTSTP, onsusp); #endif if (inopen) setty(f); setrupt(); if (!inopen && c && hush == 0) { printf("!\n"); flush(); termreset(); gettmode(); } } /* * Setup a pipeline for the filtration implied by mode * which is like a open number. If input is required to * the filter, then a child editor is created to write it. * If output is catch it from io which is created by unixex. */ filter(mode) register int mode; { static int pvec[2]; register ttymode f; register int lines = lineDOL(); mode++; if (mode & 2) { signal(SIGINT, SIG_IGN); if (pipe(pvec) < 0) error("Can't make pipe"); pid = fork(); io = pvec[0]; if (pid < 0) { setrupt(); close(pvec[1]); error("No more processes"); } if (pid == 0) { setrupt(); io = pvec[1]; close(pvec[0]); putfile(); exit(0); } close(pvec[1]); io = pvec[0]; setrupt(); } f = unixex("-c", uxb, (mode & 2) ? pvec[0] : 0, mode); if (mode == 3) { delete(0); addr2 = addr1 - 1; } if (mode & 1) { if(FIXUNDO) undap1 = undap2 = addr2+1; ignore(append(getfile, addr2)); #ifdef TRACE if (trace) vudump("after append in filter"); #endif } close(io); io = -1; unixwt(!inopen, f); netchHAD(lines); } /* * Set up to do a recover, getting io to be a pipe from * the recover process. */ recover() { static int pvec[2]; if (pipe(pvec) < 0) error(" Can't make pipe for recovery"); pid = fork(); io = pvec[0]; if (pid < 0) { close(pvec[1]); error(" Can't fork to execute recovery"); } if (pid == 0) { close(2); dup(1); close(1); dup(pvec[1]); close(pvec[1]); execl(EXRECOVER, "exrecover", svalue(DIRECTORY), file, (char *) 0); close(1); dup(2); error(" No recovery routine"); } close(pvec[1]); } /* * Wait for the process (pid an external) to complete. */ waitfor() { do rpid = wait(&status); while (rpid != pid && rp((id != -1); status = (status >> 8) & 0377; } /* * The end of a recover operation. If the process * exits non-zero, force not edited; otherwise force * a write. */ revocer() { waitfor(); if (pid == rpid && status != 0) edited = 0; else change(); } over", svalue(DIRECTORY), file, (char *) 0); close(1); dup(2); error(" No recovery routine"); } close(pvec[1]); } /* * Wait for the process (pid an external) to complete. */ waitfor() { do rpid = wait(&status); while (rpid != pid && rpcmd/ex/ex_vadj.c 444 0 33 54747 2425472330 7036 /* Copyright (c) 1980 Regents of the University of California */ static char *sccsid = "@(#)ex_vadj.c 6.2 10/23/80"; #include "ex.h" #include "ex_tty.h" #include "ex_vis.h" /* * Routines to deal with management of logical versus physical * display, opening and redisplaying lines on the screen, and * use of intelligent terminal operations. Routines to deal with * screen cleanup after a change. */ /* * Display a new line at physical line p, returning * the depth of the newly displayed line. We may decide * to expand the window on an intelligent terminal if it is * less than a full screen by deleting a line above the top of the * window before doing an insert line to keep all the good text * on the screen in which case the line may actually end up * somewhere other than line p. */ vopen(tp, p) line *tp; int p; { register int cnt; register struct vlinfo *vp, *vpc; #ifdef ADEBUG if (trace != NULL) tfixnl(), fprintf(trace, "vopen(%d, %d)\n", lineno(tp), p); #endif if (state != VISUAL) { if (vcnt) if (hold & HOLDROL) vup1(); else vclean(); /* * Forget all that we once knew. */ vcnt = vcline = 0; p = WBOT; LASTLINE = WBOT + 1; state = bastate; WTOP = basWTOP; WLINES = basWLINES; } vpc = &vlinfo[vcline]; for (vp = &vlinfo[vcnt]; vp >= vpc; vp--) vlcopy(vp[1], vp[0]); vcnt++; if (Pline == numbline) /* * Dirtying all the lines is rather inefficient * internally, but number mode is used rarely * and so its not worth optimizing. */ vdirty(vcline+1, WECHO); getline(*tp); /* * If we are opening at the top of the window, can try a window * expansion at the top. */ if (state == VISUAL && vcline == 0 && vcnt > 1 && p > ZERO) { cnt = p + vdepth() - LINE(1); if (cnt > 0) { p -= cnt; if (p < ZERO) p = ZERO; WTOP = p; WLINES = WBOT - WTOP + 1; } } vpc->vliny = p, vpc->vdepth = 0, vpc->vflags = 0; cnt = vreopen(p, lineno(tp), vcline); if (vcline + 1 == vcnt) LINE(vcnt) = LINE(vcline) + cnt; } /* * Redisplay logical line l at physical line p with line number lineno. */ vreopen(p, lineno, l) int p, lineno, l; { register int d; register struct vlinfo *vp = &vlinfo[l]; d = vp->vdepth; if (d == 0 || (vp->vflags & VDIRT)) vp->vdepth = d = vdepth(); vp->vliny = p, vp->vflags &= ~VDIRT; /* * Try to win by making the screen larger rather than inserting * a line and driving text off the bottom. */ p = vglitchup(l, 0); /* * BUG: Should consider using CE here to clear to end of line. * As it stands we always strike over the current text. * Since often the current text is the same as what * we are overstriking with, it tends not to show. * On the other hand if it is different and we end up * spacing out a lot of text, we could have won with * a CE. This is probably worthwhile at low speed * only however, since clearly computation will be * necessary to determine which way to go. */ vigoto(p, 0); pline(lineno); /* * When we are typing part of a line for hardcopy open, don't * want to type the '$' marking an end of line if in list mode. */ if (hold & HOLDDOL) return (d); if (Putchar == listchar) putchar('$'); /* * Optimization of cursor motion may prevent screen rollup if the * line has blanks/tabs at the end unless we force the cursor to appear * on the last line segment. */ if (vp->vliny + d - 1 > WBOT) vcsync(); /* * Switch into hardcopy open mode if we are in one line (adm3) * open mode and this line is now too long. If in hardcopy * open mode, then call sethard to move onto the next line * with appropriate positioning. */ if (state == ONEOPEN) { WCOLS = OCOLUMNS; if (vdepth() > 1) { WCOLS = TUBECOLS; sethard(); } else WCOLS = TUBECOLS; } else if (state == HARDOPEN) sethard(); /* * Unless we filled (completely) the last line we typed on, * we have to clear to the end of the line * in case stuff is left from before. */ if (vp->vliny + d > destline) { if (IN && destcol == WCOLS) vigoto(vp->vliny + d - 1, 0); vclreol(); } return (d); } /* * Real work for winning growing of window at top * when inserting in the middle of a partially full * screen on an intelligent terminal. We have as argument * the logical line number to be inserted after, and the offset * from that line where the insert will go. * We look at the picture of depths and positions, and if we can * delete some (blank) lines from the top of the screen so that * later inserts will not push stuff off the bottom. */ vglitchup(l, o) int l, o; { register struct vlinfo *vp = &vlinfo[l]; register int need; register int p = vp->vliny; short oldhold, oldheldech; bool glitched = 0; if (l < vcnt - 1) { need = p + vp->vdepth - (vp+1)->vliny; if (need > 0) { if (state == VISUAL && WTOP - ZERO >= need && AL && DL) { glitched++; WTOP -= need; WLINES = WBOT - WTOP + 1; p -= need; if (p + o == WTOP) { vp->vliny = WTOP; return (WTOP + o); } vdellin(WTOP, need, -1); oldheldech = heldech; oldhold = hold; hold |= HOLDECH; } vinslin((vp+1)->vliny, need, l); if (glitched) { hold = oldhold; heldech = oldheldech; } } } else vp[1].vliny = vp[0].vliny + vp->vdepth; return (p + o); } /* * Insert cnt blank lines before line p, * logically and (if supported) physically. */ vinslin(p, cnt, l) register int p, cnt; int l; { register int i; bool could = 1; #ifdef ADEBUG if (trace) tfixnl(), fprintf(trace, "vinslin(%d, %d, %d)\n", p, cnt, l); #endif if (p + cnt > WBOT && CD) { /* * Really quick -- clear to end of screen. */ cnt = WECHO + 1 - p; vgoto(p, 0), vputp(CD, cnt); vclrech(1); vadjAL(p, cnt); } else if (SR && p == WTOP && costSR < costAL) { /* * Use reverse scroll mode of the terminal, at * the top of the window. Reverse linefeed works * too, since we only use it from line WTOP. */ for (i = cnt; i > 0; i--) { vgoto(p, 0), vputp(SR, 0); if (i > 1 && (hold & HOLDAT) == 0) putchar('@'); /* * If we are at the top of the screen, and the * terminal retains display above, then we * should try to clear to end of line. * Have to use CE since we don't remember what is * actually on the line. */ if (CE && (DA || p != 0)) vputp(CE, 1); } vadjAL(p, cnt); } else if (AL) { /* * Use insert line. */ vgoto(p, 0), vputp(AL, WECHO + 1 - p); for (i = cnt - 1; i > 0; i--) { vgoto(outline+1, 0), vputp(AL, WECHO + 1 - outline); if ((hold & HOLDAT) == 0) putchar('@'); } vadjAL(p, cnt); } else could = 0; vopenup(cnt, could, l); } /* * Logically open up after line l, cnt of them. * We need to know if it was done ``physically'' since in this * case we accept what the hardware gives us. If we have to do * it ourselves (brute force) we will squish out @ lines in the process * if this will save us work. */ vopenup(cnt, could, l) int cnt; bool could; { register struct vlinfo *vc = &vlinfo[l + 1]; register struct vlinfo *ve = &vlinfo[vcnt]; #ifdef ADEBUG if (trace) tfixnl(), fprintf(trace, "vopenup(%d, %d, %d)\n", cnt, could, l); #endif if (could) /* * This will push @ lines down the screen, * just as the hardware did. Since the default * for intelligent terminals is to never have @ * lines on the screen, this should never happen, * and the code makes no special effort to be nice in this * case, e.g. squishing out the @ lines by delete lines * before doing append lines. */ for (; vc <= ve; vc++) vc->vliny += cnt; else { /* * Will have to clean up brute force eventually, * so push the line data around as little as possible. */ vc->vliny += cnt, vc->vflags |= VDIRT; while (vc < ve) { register int i = vc->vliny + vc->vdepth; vc++; if (i <= vc->vliny) break; vc->vliny = i, vc->vflags |= VDIRT; } } vscrap(); } /* * Adjust data structure internally to account for insertion of * blank lines on the screen. */ vadjAL(p, cnt) int p, cnt; { char *tlines[TUBELINES]; register int from, to; #ifdef ADEBUG if (trace) tfixnl(), fprintf(trace, "vadjal(%d, %d)\n", p, cnt); #endif copy(tlines, vtube, sizeof vtube); /*SASSIGN*/ for (from = p, to = p + cnt; to <= WECHO; from++, to++) vtube[to] = tlines[from]; for (to = p; from <= WECHO; from++, to++) { vtube[to] = tlines[from]; vclrbyte(vtube[to], WCOLS); } /* * Have to clear the echo area since its contents aren't * necessarily consistent with the rest of the display. */ vclrech(0); } /* * Roll the screen up logically and physically * so that line dl is the bottom line on the screen. */ vrollup(dl) int dl; { register int cnt; register int dc = destcol; #ifdef ADEBUG if (trace) tfixnl(), fprintf(trace, "vrollup(%d)\n", dl); #endif cnt = dl - (splitw ? WECHO : WBOT); if (splitw && (state == VISUAL || state == CRTOPEN)) holdupd = 1; vmoveitup(cnt, 1); vscroll(cnt); destline = dl - cnt, destcol = dc; } vup1() { vrollup(WBOT + 1); } /* * Scroll the screen up cnt lines physically. * If doclr is true, do a clear eol if the terminal * has ((standout (to prevent it from scrolling up) */ vmoveitup(cnt, doclr) register int cnt; bool doclr; { if (cnt == 0) return; #ifdef ADEBUG if (trace) tfixnl(), fprintf(trace, "vmoveitup(%d)\n", cnt); #endif if (doclr && (SO || SE)) vclrech(0); if (SF) { while (cnt > 0) vputp(SF, 0), cnt--; return; } destline = WECHO + cnt; destcol = (NONL ? 0 : outcol % WCOLS); fgoto(); if (state == ONEOPEN || state == HARDOPEN) { outline = destline = 0; vclrbyte(vtube[0], WCOLS); } } /* * Scroll the screen up cnt lines logically. */ vscroll(cnt) register int cnt; { register int from, to; char *tlines[TUBELINES]; #ifdef ADEBUG if (trace) fprintf(trace, "vscroll(%d)\n", cnt); #endif if (cnt < 0 || cnt > TUBELINES) error("Internal error: vscroll"); if (cnt == 0) return; copy(tlines, vtube, sizeof vtube); for (to = ZERO, from = ZERO + cnt; to <= WECHO - cnt; to++, from++) vtube[to] = tlines[from]; for (from = ZERO; to <= WECHO; to++, from++) { vtube[to] = tlines[from]; vclrbyte(vtube[to], WCOLS); } for (from = 0; from <= vcnt; from++) LINE(from) -= cnt; } /* * Discard logical lines due to physical wandering off the screen. */ vscrap() { register int i, j; #ifdef ADEBUG if (trace) tfixnl(), fprintf(trace, "vscrap\n"), tvliny(); #endif if (splitw) return; if (vcnt && WBOT != WECHO && LINE(0) < WTOP && LINE(0) >= ZERO) { WTOP = LINE(0); WLINES = WBOT - WTOP + 1; } for (j = 0; j < vcnt; j++) if (LINE(j) >= WTOP) { if (j == 0) break; /* * Discard the first j physical lines off the top. */ vcnt -= j, vcline -= j; for (i = 0; i <= vcnt; i++) vlcopy(vlinfo[i], vlinfo[i + j]); break; } /* * Discard lines off the bottom. */ if (vcnt) { for (j = 0; j <= vcnt; j++) if (LINE(j) > WBOT || LINE(j) + DEPTH(j) - 1 > WBOT) { vcnt = j; break; } LASTLINE = LINE(vcnt-1) + DEPTH(vcnt-1); } #ifdef ADEBUG if (trace) tvliny(); #endif /* * May have no lines! */ } /* * Repaint the screen, with cursor at curs, aftern an arbitrary change. * Handle notification on large changes. */ vrepaint(curs) char *curs; { wdot = NOLINE; /* * In open want to notify first. */ noteit(0); vscrap(); /* * Deal with a totally useless display. */ if (vcnt == 0 || vcline < 0 || vcline > vcnt || holdupd && state != VISUAL) { register line *odol = dol; vcnt = 0; if (holdupd) if (state == VISUAL) ignore(peekkey()); else vup1(); holdupd = 0; if (odol == zero) fixzero(); vcontext(dot, '.'); noteit(1); if (noteit(1) == 0 && odol == zero) { CATCH error("No lines in buffer"); ENDCATCH linebuf[0] = 0; splitw = 0; } vnline(curs); return; } /* * Have some useful displayed text; refresh it. */ getDOT(); /* * This is for boundary conditions in open mode. */ if (FLAGS(0) & VDIRT) vsync(WTOP); /* * If the current line is after the last displayed line * or the bottom of the screen, then special effort is needed * to get it on the screen. We first try a redraw at the * last line on the screen, hoping it will fill in where @ * lines are now. If this doesn't work, then roll it onto * the screen. */ if (vcline >= vcnt || LINE(vcline) > WBOT) { short oldhold = hold; hold |= HOLDAT, vredraw(LASTLINE), hold = oldhold; if (vcline >= vcnt) { register int i = vcline - vcnt + 1; dot -= i; vcline -= i; vroll(i); } else vsyncCL(); } else vsync(vcline > 0 ? LINE(vcline - 1) : WTOP); /* * Notification on large change for visual * has to be done last or we may lose * the echo area with redisplay. */ noteit(1); /* * Finally. Move the cursor onto the current line. */ vnline(curs); } /* * Fully cleanup the screen, leaving no @ lines except at end when * line after last won't completely fit. The routine vsync is * more conservative and much less work on dumb terminals. */ vredraw(p) register int p; { register int l; register line *tp; char temp[LBSIZE]; bool anydl = 0; short oldhold = hold; #ifdef ADEBUG if (trace) tfixnl(), fprintf(trace, "vredraw(%d)\n", p), tvliny(); #endif if (holdupd) { holdupd = 3; return; } if (state == HARDOPEN || splitw) return; if (p < 0 /* || p > WECHO */) error("Internal error: vredraw"); /* * Trim the ragged edges (lines which are off the screen but * not yet logically discarded), save the current line, and * search for first logical line affected by the redraw. */ vscrap(); CP(temp, linebuf); l = 0; tp = dot - vcline; if (vcnt == 0) LINE(0) = WTOP; while (l < vcnt && LINE(l) < p) l++, tp++; /* * We hold off echo area clearing during the redraw in deference * to a final clear of the echo area at the end if appropriate. */ heldech = 0; hold |= HOLDECH; for (; l < vcnt && Peekkey != ATTN; l++) { if (l == vcline) strcLIN(temp); else getline(*tp); /* * Delete junk between displayed lines. */ if (LINE(l) != LINE(l + 1) && LINE(l) != p) { if (anydl == 0 && DB && CD) { hold = oldhold; vclrech(0); anydl = 1; hold |= HOLDECH; heldech = 0; } vdellin(p, LINE(l) - p, l); } /* * If line image is not know to be up to date, then * redisplay it; else just skip onward. */ LINE(l) = p; if (FLAGS(l) & VDIRT) { DEPTH(l) = vdepth(); if (l != vcline && p + DEPTH(l) - 1 > WBOT) { vscrap(); break; } FLAGS(l) &= ~VDIRT; vreopen(p, lineno(tp), l); p = LINE(l) + DEPTH(l); } else p += DEPTH(l); tp++; } /* * That takes care of lines which were already partially displayed. * Now try to fill the rest of the screen with text. */ if (state == VISUAL && p <= WBOT) { int ovcline = vcline; vcline = l; for (; tp <= dol && Peekkey != ATTN; tp++) { getline(*tp); if (p + vdepth() - 1 > WBOT) break; vopen(tp, p); p += DEPTH(vcline); vcline++; } vcline = ovcline; } /* * Thats all the text we can get on. * Now rest of lines (if any) get either a ~ if they * are past end of file, or an @ if the next line won't fit. */ for (; p <= WBOT && Peekkey != ATTN; p++) vclrlin(p, tp); strcLIN(temp); hold = oldhold; if (heldech) vclrech(0); #ifdef ADEBUG if (trace) tvliny(); #endif } /* * Do the real work in deleting cnt lines starting at line p from * the display. First affected line is line l. */ vdellin(p, cnt, l) int p, cnt, l; { register int i; if (cnt == 0) return; if (DL == NOSTR || cnt < 0) { /* * Can't do it; just remember that line l is munged. */ FLAGS(l) |= VDIRT; return; } #ifdef ADEBUG if (trace) tfixnl(), fprintf(trace, "vdellin(%d, %d, %d)\n", p, cnt, l); #endif /* * Send the deletes to the screen and then adjust logical * and physical internal data structures. */ vgoto(p, 0); for (i = 0; i < cnt; i++) vputp(DL, WECHO - p); vadjDL(p, cnt); vcloseup(l, cnt); } /* * Adjust internal physical screen image to account for deleted lines. */ vadjDL(p, cnt) int p, cnt; { char *tlines[TUBELINES]; register int from, to; #ifdef ADEBUG if (trace) tfixnl(), fprintf(trace, "vadjDL(%d, %d)\n", p, cnt); #endif /* * Would like to use structured assignment but early * v7 compiler (released with phototypesetter for v6) * can't hack it. */ copy(tlines, vtube, sizeof vtube); /*SASSIGN*/ for (from = p + cnt, to = p; from <= WECHO; from++, to++) vtube[to] = tlines[from]; for (from = p; to <= WECHO; from++, to++) { vtube[to] = tlines[from]; vclrbyte(vtube[to], WCOLS); } } /* * Sync the screen, like redraw but more lazy and willing to leave * @ lines on the screen. VsyncCL syncs starting at the current line. * In any case, if the redraw option is set then all syncs map to redraws * as if vsync didn't exist. */ vsyncCL() { vsync(LINE(vcline)); } vsync(p) register int p; { if (value(REDRAW)) vredraw(p); else vsync1(p); } /* * The guts of a sync. Similar to redraw but * just less ambitous. */ vsync1(p) register int p; { register int l; char temp[LBSIZE]; register struct vlinfo *vp = &vlinfo[0]; short oldhold = hold; #ifdef ADEBUG if (trace) tfixnl(), fprintf(trace, "vsync1(%d)\n", p), tvliny(); #endif if (holdupd) { if (holdupd < 3) holdupd = 2; return; } if (state == HARDOPEN || splitw) return; vscrap(); CP(temp, linebuf); if (vcnt == 0) LINE(0) = WTOP; l = 0; while (l < vcnt && vp->vliny < p) l++, vp++; heldech = 0; hold |= HOLDECH; while (p <= WBOT && Peekkey != ATTN) { /* * Want to put a line here if not in visual and first line * or if there are lies left and this line starts before * the current line, or if this line is piled under the * next line (vreplace does this and we undo it). */ if (l == 0 && state != VISUAL || (l < vcnt && (vp->vliny <= p || vp[0].vliny == vp[1].vliny))) { if (l == 0 || vp->vliny < p || (vp->vflags & VDIRT)) { if (l == vcline) strcLIN(temp); else getline(dot[l - vcline]); /* * Be careful that a long line doesn't cause the * screen to shoot up. */ if (l != vcline && (vp->vflags & VDIRT)) { vp->vdepth = vdepth(); vp->vflags &= ~VDIRT; if (p + vp->vdepth - 1 > WBOT) break; } vreopen(p, lineDOT() + (l - vcline), l); } p = vp->vliny + vp->vdepth; vp++; l++; } else /* * A physical line between logical lines, * so we settle for an @ at the beginning. */ vclrlin(p, dot + (l - vcline)), p++; } strcLIN(temp); hold = oldhold; if (heldech) vclrech(0); } /* * Subtract (logically) cnt physical lines from the * displayed position of lines starting with line l. */ vcloseup(l, cnt) int l; register int cnt; { register int i; #ifdef ADEBUG if (trace) tfixnl(), fprintf(trace, "vcloseup(%d, %d)\n", l, cnt); #endif for (i = l + 1; i <= vcnt; i++) LINE(i) -= cnt; } /* * Workhorse for rearranging line descriptors on changes. * The idea here is that, starting with line l, cnt lines * have been replaced with newcnt lines. All of these may * be ridiculous, i.e. l may be -1000, cnt 50 and newcnt 0, * since we may be called from an undo after the screen has * moved a lot. Thus we have t((o be careful. * * Many boundary conditions here. */ vreplace(l, cnt, newcnt) int l, cnt, newcnt; { register int from, to, i; bool savenote = 0; #ifdef ADEBUG if (trace) { tfixnl(), fprintf(trace, "vreplace(%d, %d, %d)\n", l, cnt, newcnt); tvliny(); } #endif if (l >= vcnt) return; if (l < 0) { if (l + cnt < 0) { /* * Nothing on the screen is relevant. * Settle for redrawing from scratch (later). */ vcnt = 0; return; } /* * Normalize l to top of screen; the add is * really a subtract from cnt since l is negative. */ cnt += l; l = 0; /* * Unseen lines were affect so notify (later). */ savenote++; } /* * These shouldn't happen * but would cause great havoc. */ if (cnt < 0) cnt = 0; if (newcnt < 0) newcnt = 0; /* * Surely worthy of note if more than report * lines were changed. */ if (cnt > value(REPORT) || newcnt > value(REPORT)) savenote++; /* * Same number of lines affeted as on screen, and we * can insert and delete lines. Thus we just type * over them, since otherwise we will push them * slowly off the screen, a clear lose. */ if (cnt == newcnt || vcnt - l == newcnt && AL && DL) { if (cnt > 1 && l + cnt > vcnt) savenote++; vdirty(l, newcnt); } else { /* * Lines are going away, squish them out. */ if (cnt > 0) { /* * If non-displayed lines went away, * always notify. */ if (cnt > 1 && l + cnt > vcnt) savenote++; if (l + cnt >= vcnt) cnt = vcnt - l; else for (from = l + cnt, to = l; from <= vcnt; to++, from++) vlcopy(vlinfo[to], vlinfo[from]); vcnt -= cnt; } /* * Open up space for new lines appearing. * All new lines are piled in the same place, * and will be unpiled by vredraw/vsync, which * inserts lines in front as it unpiles. */ if (newcnt > 0) { /* * Newlines are appearing which may not show, * so notify (this is only approximately correct * when long lines are present). */ if (newcnt > 1 && l + newcnt > vcnt + 1) savenote++; /* * If there will be more lines than fit, then * just throw way the rest of the stuff on the screen. */ if (l + newcnt > WBOT && AL && DL) { vcnt = l; goto skip; } from = vcnt, to = vcnt + newcnt; i = TUBELINES - to; if (i < 0) from += i, to += i; vcnt = to; for (; from >= l; from--, to--) vlcopy(vlinfo[to], vlinfo[from]); for (from = to + 1, to = l; to < l + newcnt && to <= WBOT + 1; to++) { LINE(to) = LINE(from); DEPTH(to) = 0; FLAGS(to) = VDIRT; } } } skip: if (Pline == numbline && cnt != newcnt) /* * When lines positions are shifted, the numbers * will be wrong. */ vdirty(l, WECHO); if (!savenote) notecnt = 0; #ifdef ADEBUG if (trace) tvliny(); #endif } /* * Start harcopy open. * Print an image of the line to the left of the cursor * under the full print of the line and position the cursor. * If we are in a scroll ^D within hardcopy open then all this * is suppressed. */ sethard() { if (state == VISUAL) return; rubble = 0; state = HARDOPEN; if (hold & HOLDROL) return; vup1(); LINE(0) = WBOT; if (Pline == numbline) vgoto(WBOT, 0), printf("%6d ", lineDOT()); } /* * Mark the lines starting at base for i lines * as dirty so that they will be checked for correct * display at next sync/redraw. */ vdirty(base, i) register int base, i; { register int l; for (l = base; l < vcnt; l++) { if (--i < 0) return; FLAGS(l) |= VDIRT; } } * is suppressed. */ sethcmd/ex/ex_vars.h 444 0 33 2153 2425426020 7025 /* sccs id @(#)ex_vars.h 6.1 10/18/80 */ #define AUTOINDENT 0 #define AUTOPRINT 1 #define AUTOWRITE 2 #define BEAUTIFY 3 #define DIRECTORY 4 #define EDCOMPATIBLE 5 #define ERRORBELLS 6 #define HARDTABS 7 #define IGNORECASE 8 #define LISP 9 #define LIST 10 #define MAGIC 11 #define MESG 12 #define NUMBER 13 #define OPEN 14 #define OPTIMIZE 15 #define PARAGRAPHS 16 #define PROMPT 17 #define READONLY 18 #define REDRAW 19 #define REMAP 20 #define REPORT 21 #define SCROLL 22 #define SECTIONS 23 #define SHELL 24 #define SHIFTWIDTH 25 #define SHOWMATCH 26 #define SLOWOPEN 27 #define TABSTOP 28 #define TAGLENGTH 29 #define TAGS 30 #define TERM 31 #define TERSE 32 #define TIMEOUT 33 #define TTYTYPE 34 #define WARN 35 #define WINDOW 36 #define WRAPSCAN 37 #define WRAPMARGIN 38 #define WRITEANY 39 #define NOPTS 40 21 #define SCROLL 22 #define SECTIONS 23 #define SHELL 24 #define SHIFTWIDTH 25 #define SHOWMATCH 26 #define SLOWOPEN 27 #define TABSTOP 28 #define TAGLENGTH 29 #define TAGS 30 #define TERM 31 #define TERSE 32 #define TIMEOUT 33 #define TTYTYPE 34 #define WARN 35 #define WINDOW cmd/ex/ex_vget.c 444 0 33 31400 2425472343 7040 /* Copyright (c) 1980 Regents of the University of California */ static char *sccsid = "@(#)ex_vget.c 6.2 10/23/80"; #include "ex.h" #include "ex_tty.h" #include "ex_vis.h" /* * Input routines for open/visual. * We handle upper case only terminals in visual and reading from the * echo area here as well as notification on large changes * which appears in the echo area. */ /* * Return the key. */ ungetkey(c) char c; { if (Peekkey != ATTN) Peekkey = c; } /* * Return a keystroke, but never a ^@. */ getkey() { register char c; do { c = getbr(); if (c==0) beep(); } while (c == 0); return (c); } /* * Tell whether next keystroke would be a ^@. */ peekbr() { Peekkey = getbr(); return (Peekkey == 0); } short precbksl; /* * Get a keystroke, including a ^@. * If an key was returned with ungetkey, that * comes back first. Next comes unread input (e.g. * from repeating commands with .), and finally new * keystrokes. * * The hard work here is in mapping of \ escaped * characters on upper case only terminals. */ getbr() { char ch; register int c, d; register char *colp; #define BEEHIVE #ifdef BEEHIVE static char Peek2key; #endif extern short slevel, ttyindes; getATTN: if (Peekkey) { c = Peekkey; Peekkey = 0; return (c); } #ifdef BEEHIVE if (Peek2key) { c = Peek2key; Peek2key = 0; return (c); } #endif if (vglobp) { if (*vglobp) return (lastvgk = *vglobp++); lastvgk = 0; return (ESCAPE); } if (vmacp) { if (*vmacp) return(*vmacp++); /* End of a macro or set of nested macros */ vmacp = 0; if (inopen == -1) /* don't screw up undo for esc esc */ vundkind = VMANY; inopen = 1; /* restore old setting now that macro done */ vch_mac = VC_NOTINMAC; } flusho(); again: if (read(slevel == 0 ? 0 : ttyindes, &ch, 1) != 1) { if (errno == EINTR) goto getATTN; error("Input read error"); } c = ch & TRIM; #ifdef BEEHIVE if (XB && slevel==0 && c == ESCAPE) { if (read(0, &Peek2key, 1) != 1) goto getATTN; Peek2key &= TRIM; switch (Peek2key) { case 'C': /* SPOW mode sometimes sends \EC for space */ c = ' '; Peek2key = 0; break; case 'q': /* f2 -> ^C */ c = CTRL(c); Peek2key = 0; break; case 'p': /* f1 -> esc */ Peek2key = 0; break; } } #endif #ifdef UCVISUAL /* * The algorithm here is that of the UNIX kernel. * See the description in the programmers manual. */ if (UPPERCASE) { if (isupper(c)) c = tolower(c); if (c == '\\') { if (precbksl < 2) precbksl++; if (precbksl == 1) goto again; } else if (precbksl) { d = 0; if (islower(c)) d = toupper(c); else { colp = "({)}!|^~'~"; while (d = *colp++) if (d == c) { d = *colp++; break; } else colp++; } if (precbksl == 2) { if (!d) { Peekkey = c; precbksl = 0; c = '\\'; } } else if (d) c = d; else { Peekkey = c; precbksl = 0; c = '\\'; } } if (c != '\\') precbksl = 0; } #endif #ifdef TRACE if (trace) { if (!techoin) { tfixnl(); techoin = 1; fprintf(trace, "*** Input: "); } tracec(c); } #endif lastvgk = 0; return (c); } /* * Get a key, but if a delete, quit or attention * is typed return 0 so we will abort a partial command. */ getesc() { register int c; c = getkey(); switch (c) { case CTRL(v): case CTRL(q): c = getkey(); return (c); case ATTN: case QUIT: ungetkey(c); return (0); case ESCAPE: return (0); } return (c); } /* * Peek at the next keystroke. */ peekkey() { Peekkey = getkey(); return (Peekkey); } /* * Read a line from the echo area, with single character prompt c. * A return value of 1 means the user blewit or blewit away. */ readecho(c) char c; { register char *sc = cursor; register int (*OP)(); bool waste; register int OPeek; if (WBOT == WECHO) vclean(); else vclrech(0); splitw++; vgoto(WECHO, 0); putchar(c); vclreol(); vgoto(WECHO, 1); cursor = linebuf; linebuf[0] = 0; genbuf[0] = c; if (peekbr()) { if (!INS[0] || (INS[0] & (QUOTE|TRIM)) == OV((ERBUF) goto blewit; vglobp = INS; } OP = Pline; Pline = normline; ignore(vgetline(0, genbuf + 1, &waste, c)); if (Outchar == termchar) putchar('\n'); vscrap(); Pline = OP; if (Peekkey != ATTN && Peekkey != QUIT && Peekkey != CTRL(h)) { cursor = sc; vclreol(); return (0); } blewit: OPeek = Peekkey==CTRL(h) ? 0 : Peekkey; Peekkey = 0; splitw = 0; vclean(); vshow(dot, NOLINE); vnline(sc); Peekkey = OPeek; return (1); } /* * A complete command has been defined for * the purposes of repeat, so copy it from * the working to the previous command buffer. */ setLAST() { if (vglobp || vmacp) return; lastreg = vreg; lasthad = Xhadcnt; lastcnt = Xcnt; *lastcp = 0; CP(lastcmd, workcmd); } /* * Gather up some more text from an insert. * If the insertion buffer oveflows, then destroy * the repeatability of the insert. */ addtext(cp) char *cp; { if (vglobp) return; addto(INS, cp); if ((INS[0] & (QUOTE|TRIM)) == OVERBUF) lastcmd[0] = 0; } setDEL() { setBUF(DEL); } /* * Put text from cursor upto wcursor in BUF. */ setBUF(BUF) register char *BUF; { register int c; register char *wp = wcursor; c = *wp; *wp = 0; BUF[0] = 0; addto(BUF, cursor); *wp = c; } addto(buf, str) register char *buf, *str; { if ((buf[0] & (QUOTE|TRIM)) == OVERBUF) return; if (strlen(buf) + strlen(str) + 1 >= VBSIZE) { buf[0] = OVERBUF; return; } ignore(strcat(buf, str)); } /* * Note a change affecting a lot of lines, or non-visible * lines. If the parameter must is set, then we only want * to do this for open modes now; return and save for later * notification in visual. */ noteit(must) bool must; { register int sdl = destline, sdc = destcol; if (notecnt < 2 || !must && state == VISUAL) return (0); splitw++; if (WBOT == WECHO) vmoveitup(1, 1); vigoto(WECHO, 0); printf("%d %sline", notecnt, notesgn); if (notecnt > 1) putchar('s'); if (*notenam) { printf(" %s", notenam); if (*(strend(notenam) - 1) != 'e') putchar('e'); putchar('d'); } vclreol(); notecnt = 0; if (state != VISUAL) vcnt = vcline = 0; splitw = 0; if (state == ONEOPEN || state == CRTOPEN) vup1(); destline = sdl; destcol = sdc; return (1); } /* * Rrrrringgggggg. * If possible, use flash (VB). */ beep() { if (VB) vputp(VB, 0); else vputc(CTRL(g)); } /* * Map the command input character c, * for keypads and labelled keys which do cursor * motions. I.e. on an adm3a we might map ^K to ^P. * DM1520 for example has a lot of mappable characters. */ map(c,maps) register int c; register struct maps *maps; { register int d; register char *p, *q; char b[10]; /* Assumption: no keypad sends string longer than 10 */ /* * Mapping for special keys on the terminal only. * BUG: if there's a long sequence and it matches * some chars and then misses, we lose some chars. * * For this to work, some conditions must be met. * 1) Keypad sends SHORT (2 or 3 char) strings * 2) All strings sent are same length & similar * 3) The user is unlikely to type the first few chars of * one of these strings very fast. * Note: some code has been fixed up since the above was laid out, * so conditions 1 & 2 are probably not required anymore. * However, this hasn't been tested with any first char * that means anything else except escape. */ #ifdef MDEBUG if (trace) fprintf(trace,"map(%c): ",c); #endif /* * If c==0, the char came from getesc typing escape. Pass it through * unchanged. 0 messes up the following code anyway. */ if (c==0) return(0); b[0] = c; b[1] = 0; for (d=0; maps[d].mapto; d++) { #ifdef MDEBUG if (trace) fprintf(trace,"\ntry '%s', ",maps[d].cap); #endif if (p = maps[d].cap) { for (q=b; *p; p++, q++) { #ifdef MDEBUG if (trace) fprintf(trace,"q->b[%d], ",q-b); #endif if (*q==0) { /* * Is there another char waiting? * * This test is oversimplified, but * should work mostly. It handles the * case where we get an ESCAPE that * wasn't part of a keypad string. */ if ((c=='#' ? peekkey() : fastpeekkey()) == 0) { #ifdef MDEBUG if (trace) fprintf(trace,"fpk=0: return '%c'",c); #endif /* * Nothing waiting. Push back * what we peeked at & return * failure (c). * * We want to be able to undo * commands, but it's nonsense * to undo part of an insertion * so if in input mode don't. */ macpush(&b[1],maps == arrows); return(c); } *q = getkey(); q[1] = 0; } if (*p != *q) goto contin; } macpush(maps[d].mapto,maps == arrows); c = getkey(); #ifdef MDEBUG if (trace) fprintf(trace,"Success: push(%s), return %c",maps[d].mapto, c); #endif return(c); /* first char of map string */ contin:; } } #ifdef MDEBUG if (trace) fprintf(trace,"Fail: push(%s), return %c", &b[1], c); #endif macpush(&b[1],0); return(c); } /* * Push st onto the front of vmacp. This is tricky because we have to * worry about where vmacp was previously pointing. We also have to * check for overflow (which is typically from a recursive macro) * Finally we have to set a flag so the whole thing can be undone. * canundo is 1 iff we want to be able to undo the macro. This * is false for, for example, pushing back lookahead from fastpeekkey(), * since otherwise two fast escapes can clobber our undo. */ macpush(st, canundo) char *st; int canundo; { char tmpbuf[BUFSIZ]; if (st==0 || *st==0) return; #ifdef notdef if (!value(UNDOMACRO)) canundo = 0; #endif #ifdef TRACE if (trace) fprintf(trace, "macpush(%s), canundo=%d\n",st,canundo); #endif if ((vmacp ? strlen(vmacp) : 0) + strlen(st) > BUFSIZ) error("Macro too long@ - maybe recursive?"); if (vmacp) { strcpy(tmpbuf, vmacp); if (!FIXUNDO) canundo = 0; /* can't undo inside a macro anyway */ } strcpy(vmacbuf, st); if (vmacp) strcat(vmacbuf, tmpbuf); vmacp = vmacbuf; /* arrange to be able to undo the whole macro */ if (canundo) { #ifdef notdef otchng = tchng; vsave(); saveall(); inopen = -1; /* no need to save since it had to be 1 or -1 before */ vundkind = VMANY; #endif vch_mac = VC_NOCHANGE; } } #ifdef TRACE visdump(s) char *s; { register int i; if (!trace) return; fprintf(trace, "\n%s: basWTOP=%d, basWLINES=%d, WTOP=%d, WBOT=%d, WLINES=%d, WCOLS=%d, WECHO=%d\n", s, basWTOP, basWLINES, WTOP, WBOT, WLINES, WCOLS, WECHO); fprintf(trace, " vcnt=%d, vcline=%d, cursor=%d, wcursor=%d, wdot=%d\n", vcnt, vcline, cursor-linebuf, wcursor-linebuf, wdot-zero); for (i=0; i= 0) { signal(SIGALRM, trapalarm); alarm(1); } CATCH c = peekkey(); #ifdef MDEBUG if (trace) fprintf(trace,"[OK]",c); #endif alarm(0); ONERR c = 0; #ifdef MDEBUG if (trace) fprintf(trace,"[TOUT]",c); #endif ENDCATCH #ifdef MDEBUG if (trace) fprintf(trace,"[fpk:%o]",c); #endif return(c); } trapalarm() { alarm(0); longjmp(vreslab,1); } fast typing get counted * as separate. notimeout is provided for people who dislike such * nondeterminism. */ if (value(TIMEOUT) && inopen >= 0) { signal(SIGALRM, trapalarm); alarm(1); } CATCH c = peekkey(); #ifdef MDEBUG if (trace) fprcmd/ex/ex_vis.h 444 0 33 21725 2425426074 6712 /* Copyright (c) 1980 Regents of the University of California */ /* sccs id: @(#)ex_vis.h 6.1 10/18/80 */ /* * Ex version 3 * Mark Horton, UCB * Bill Joy UCB * * Open and visual mode definitions. * * There are actually 4 major states in open/visual modes. These * are visual, crt open (where the cursor can move about the screen and * the screen can scroll and be erased), one line open (on dumb glass-crt's * like the adm3), and hardcopy open (for everything else). * * The basic state is given b((y bastate, and the current state by state, * since we can be in pseudo-hardcopy mode if we are on an adm3 and the * line is longer than 80. */ short bastate; short state; #define VISUAL 0 #define CRTOPEN 1 #define ONEOPEN 2 #define HARDOPEN 3 /* * The screen in visual and crtopen is of varying size; the basic * window has top basWTOP and basWLINES lines are thereby implied. * The current window (which may have grown from the basic size) * has top WTOP and WLINES lines. The top line of the window is WTOP, * and the bottom line WBOT. The line WECHO is used for messages, * search strings and the like. If WBOT==WECHO then we are in ONEOPEN * or HARDOPEN and there is no way back to the line we were on if we * go to WECHO (i.e. we will have to scroll before we go there, and * we can't get back). There are WCOLS columns per line. * If WBOT!=WECHO then WECHO will be the last line on the screen * and WBOT is the line before it. */ short basWTOP; short basWLINES; short WTOP; short WBOT; short WLINES; short WCOLS; short WECHO; /* * When we are dealing with the echo area we consider the window * to be "split" and set the variable splitw. Otherwise, moving * off the bottom of the screen into WECHO causes a screen rollup. */ bool splitw; /* * Information about each line currently on the screen includes * the y coordinate associated with the line, the printing depth * of the line (0 indicates unknown), and a mask which indicates * whether the line is "unclean", i.e. whether we should check * to make sure the line is displayed correctly at the next * appropriate juncture. */ struct vlinfo { char vliny; /* Y coordinate */ char vdepth; /* Depth of displayed line */ short vflags; /* Is line potentially dirty ? */ } vlinfo[TUBELINES + 2]; #define DEPTH(c) (vlinfo[c].vdepth) #define LINE(c) (vlinfo[c].vliny) #define FLAGS(c) (vlinfo[c].vflags) #define VDIRT 1 /* * Hacks to copy vlinfo structures around */ #ifdef V6 /* Kludge to make up for no structure assignment */ struct { long longi; }; # define vlcopy(i, j) i.longi = j.longi #else # define vlcopy(i, j) i = j; #endif /* * The current line on the screen is represented by vcline. * There are vcnt lines on the screen, the last being "vcnt - 1". * Vcline is intimately tied to the current value of dot, * and when command mode is used as a subroutine fancy footwork occurs. */ short vcline; short vcnt; /* * To allow many optimizations on output, an exact image of the terminal * screen is maintained in the space addressed by vtube0. The vtube * array indexes this space as lines, and is shuffled on scrolls, insert+delete * lines and the like rather than (more expensively) shuffling the screen * data itself. It is also rearranged during insert mode across line * boundaries to make incore work easier. */ char *vtube[TUBELINES]; char *vtube0; /* * The current cursor position within the current line is kept in * cursor. The current line is kept in linebuf. During insertions * we use the auxiliary array genbuf as scratch area. * The cursor wcursor and wdot are used in operations within/spanning * lines to mark the other end of the affected area, or the target * for a motion. */ char *cursor; char *wcursor; line *wdot; /* * Undo information is saved in a LBSIZE buffer at "vutmp" for changes * within the current line, or as for command mode for multi-line changes * or changes on lines no longer the current line. * The change kind "VCAPU" is used immediately after a U undo to prevent * two successive U undo's from destroying the previous state. */ #define VNONE 0 #define VCHNG 1 #define VMANY 2 #define VCAPU 3 #define VMCHNG 4 #define VMANYINS 5 short vundkind; /* Which kind of undo - from above */ char *vutmp; /* Prev line image when "VCHNG" */ /* * State information for undoing of macros. The basic idea is that * if the macro does only 1 change or even none, we don't treat it * specially. If it does 2 or more changes we want to be able to * undo it as a unit. We remember how many changes have been made * within the current macro. (Remember macros can be nested.) */ #define VC_NOTINMAC 0 /* Not in a macro */ #define VC_NOCHANGE 1 /* In a macro, no changes so far */ #define VC_ONECHANGE 2 /* In a macro, one change so far */ #define VC_MANYCHANGE 3 /* In a macro, at least 2 changes so far */ short vch_mac; /* Change state - one of the above */ /* * For U undo's the line is grabbed by "vmove" after it first appears * on that line. The "vUNDdot" which specifies which line has been * saved is selectively cleared when changes involving other lines * are made, i.e. after a 'J' join. This is because a 'JU' would * lose completely the text of the line just joined on. */ char *vUNDcurs; /* Cursor just before 'U' */ line *vUNDdot; /* The line address of line saved in vUNDsav */ line vUNDsav; /* Grabbed initial "*dot" */ #define killU() vUNDdot = NOLINE /* * There are a number of cases where special behaviour is needed * from deeply nested routines. This is accomplished by setting * the bits of hold, which acts to change the state of the general * visual editing behaviour in specific ways. * * HOLDAT prevents the clreol (clear to end of line) routines from * putting out @'s or ~'s on empty lines. * * HOLDDOL prevents the reopen routine from putting a '$' at the * end of a reopened line in list mode (for hardcopy mode, e.g.). * * HOLDROL prevents spurious blank lines when scrolling in hardcopy * open mode. * * HOLDQIK prevents the fake insert mode during repeated commands. * * HOLDPUPD prevents updating of the physical screen image when * mucking around while in insert mode. * * HOLDECH prevents clearing of the echo area while rolling the screen * backwards (e.g.) in deference to the clearing of the area at the * end of the scroll (1 time instead of n times). The fact that this * is actually needed is recorded in heldech, which says that a clear * of the echo area was actually held off. */ short hold; short holdupd; /* Hold off update when echo line is too long */ #define HOLDAT 1 #define HOLDDOL 2 #define HOLDROL 4 #define HOLDQIK 8 #define HOLDPUPD 16 #define HOLDECH 32 #define HOLDWIG 64 /* * Miscellaneous variables */ short CDCNT; /* Count of ^D's in insert on this line */ char DEL[VBSIZE]; /* Last deleted text */ bool HADUP; /* This insert line started with ^ then ^D */ bool HADZERO; /* This insert line started with 0 then ^D */ char INS[VBSIZE]; /* Last inserted text */ int Vlines; /* Number of file lines "before" vi command */ int Xcnt; /* External variable holding last cmd's count */ bool Xhadcnt; /* Last command had explicit count? */ short ZERO; short dir; /* Direction for search (+1 or -1) */ short doomed; /* Disply chars right of cursor to be killed */ bool gobblebl; /* Wrapmargin space generated nl, eat a space */ bool hadcnt; /* (Almost) internal to vmain() */ bool heldech; /* We owe a clear of echo area */ bool insmode; /* Are in character insert mode */ char lastcmd[5]; /* Chars in last command */ int lastcnt; /* Count for last command */ char *lastcp; /* Save current command here to repeat */ bool lasthad; /* Last command had a count? */ short lastvgk; /* Previous input key, if not from keyboard */ short lastreg; /* Register with last command */ char *ncols['z'-'a'+2]; /* Cursor positions of marks */ char *notenam; /* Name to be noted with change count */ char *notesgn; /* Change count from last command */ char op; /* Operation of current command */ short Peekkey; /* Peek ahead key */ bool rubble; /* Line is filthy (in hardcopy open), redraw! */ int vSCROLL; /* Number lines to scroll on ^D/^U */ char *vglobp; /* Untyped input (e.g. repeat insert text) */ char vmacbuf[VBSIZE]; /* Text of visual macro, hence nonnestable */ char *vmacp; /* Like vglobp but for visual macros */ char *vmcurs; /* Cursor for restore after undo d), e.g. */ short vmovcol; /* Column to try to keep on arrow keys */ bool vmoving; /* Are trying to keep vmovcol */ char vreg; /* Register for this command */ short wdkind; /* Liberal/conservative words? */ char workcmd[5]; /* Temporary for lastcmd */ /* * Macros */ #define INF 30000 #define LASTLINE LINE(vcnt) #define OVERBUF QUOTE #define beep obeep #define cindent() ((outline - vlinfo[vcline].vliny) * WCOLS + outcol) #define vputp(cp, cnt) tputs(cp, cnt, vputch) #define vputc(c) putch(c) /* * Function types */ int beep(); int qcount(); int vchange(); int vdelete(); int vgrabit(); int vinschar(); int vmove(); int vputchar(); int vshift(); int vyankit(); wdkind; /* Liberal/conservative words? */cmd/ex/ex_vmain.c 444 0 33 65175 2425472353 7226 /* Copyright (c) 1980 Regents of the University of California */ static char *sccsid = "@(#)ex_vmain.c 6.2 10/23/80"; #include "ex.h" #include "ex_tty.h" #include "ex_vis.h" /* * This is the main routine for visual. * We here decode the count and possible named buffer specification * preceding a command and interpret a few of the commands. * Commands which involve a target (i.e. an operator) are decoded * in the routine operate in ex_voperate.c. */ #define forbid(a) { if (a) goto fonfon; } vmain() { register int c, cnt, i; char esave[TUBECOLS]; char *oglobp; char d; line *addr; int ind, nlput; int shouldpo = 0; int onumber, olist, (*OPline)(), (*OPutchar)(); vch_mac = VC_NOTINMAC; /* * If we started as a vi command (on the command line) * then go process initial commands (recover, next or tag). */ if (initev) { oglobp = globp; globp = initev; hadcnt = cnt = 0; i = tchng; addr = dot; goto doinit; } /* * NB: * * The current line is always in the line buffer lineb((uf, * and the cursor at the position cursor. You should do * a vsave() before moving off the line to make sure the disk * copy is updated if it has changed, and a getDOT() to get * the line back if you mung linebuf. The motion * routines in ex_vwind.c handle most of this. */ for (;;) { /* * Decode a visual command. * First sync the temp file if there has been a reasonable * amount of change. Clear state for decoding of next * command. */ TSYNC(); vglobp = 0; vreg = 0; hold = 0; seenprompt = 1; wcursor = 0; Xhadcnt = hadcnt = 0; Xcnt = cnt = 1; splitw = 0; if (i = holdupd) { if (state == VISUAL) ignore(peekkey()); holdupd = 0; /* if (LINE(0) < ZERO) { vclear(); vcnt = 0; i = 3; } */ if (state != VISUAL) { vcnt = 0; vsave(); vrepaint(cursor); } else if (i == 3) vredraw(WTOP); else vsync(WTOP); vfixcurs(); } /* * Gobble up counts and named buffer specifications. */ for (;;) { looptop: #ifdef MDEBUG if (trace) fprintf(trace, "pc=%c",peekkey()); #endif if (isdigit(peekkey()) && peekkey() != '0') { hadcnt = 1; cnt = vgetcnt(); forbid (cnt <= 0); } if (peekkey() != '"') break; ignore(getkey()), c = getkey(); /* * Buffer names be letters or digits. * But not '0' as that is the source of * an 'empty' named buffer spec in the routine * kshift (see ex_temp.c). */ forbid (c == '0' || !isalpha(c) && !isdigit(c)); vreg = c; } reread: /* * Come to reread from below after some macro expansions. * The call to map allows use of function key pads * by performing a terminal dependent mapping of inputs. */ #ifdef MDEBUG if (trace) fprintf(trace,"pcb=%c,",peekkey()); #endif op = getkey(); maphopcnt = 0; do { /* * Keep mapping the char as long as it changes. * This allows for double mappings, e.g., q to #, * #1 to something else. */ c = op; op = map(c,arrows); #ifdef MDEBUG if (trace) fprintf(trace,"pca=%c,",c); #endif /* * Maybe the mapped to char is a count. If so, we have * to go back to the "for" to interpret it. Likewise * for a buffer name. */ if ((isdigit(c) && c!='0') || c == '"') { ungetkey(c); goto looptop; } if (!value(REMAP)) { c = op; break; } if (++maphopcnt > 256) error("Infinite macro loop"); } while (c != op); /* * Begin to build an image of this command for possible * later repeat in the buffer workcmd. It will be copied * to lastcmd by the routine setLAST * if/when completely specified. */ lastcp = workcmd; if (!vglobp) *lastcp++ = c; /* * First level command decode. */ switch (c) { /* * ^L Clear screen e.g. after transmission error. */ /* * ^R Retype screen, getting rid of @ lines. * If in open, equivalent to ^L. * On terminals where the right arrow key sends * ^L we make ^R act like ^L, since there is no * way to get ^L. These terminals (adm31, tvi) * are intelligent so ^R is useless. Soroc * will probably foul this up, but nobody has * one of them. */ case CTRL(l): case CTRL(r): if (c == CTRL(l) || (KR && *KR==CTRL(l))) { vclear(); vdirty(0, vcnt); } if (state != VISUAL) { /* * Get a clean line, throw away the * memory of what is displayed now, * and move back onto the current line. */ vclean(); vcnt = 0; vmoveto(dot, cursor, 0); continue; } vredraw(WTOP); /* * Weird glitch -- when we enter visual * in a very small window we may end up with * no lines on the screen because the line * at the top is too long. This forces the screen * to be expanded to make room for it (after * we have printed @'s ick showing we goofed). */ if (vcnt == 0) vrepaint(cursor); vfixcurs(); continue; /* * $ Escape just cancels the current command * with a little feedback. */ case ESCAPE: beep(); continue; /* * @ Macros. Bring in the macro and put it * in vmacbuf, point vglobp there and punt. */ case '@': c = getesc(); if (c == 0) continue; if (c == '@') c = lastmac; if (isupper(c)) c = tolower(c); forbid(!islower(c)); lastmac = c; vsave(); CATCH char tmpbuf[BUFSIZ]; regbuf(c,tmpbuf,sizeof(vmacbuf)); macpush(tmpbuf, 1); ONERR lastmac = 0; splitw = 0; getDOT(); vrepaint(cursor); continue; ENDCATCH vmacp = vmacbuf; goto reread; /* * . Repeat the last (modifying) open/visual command. */ case '.': /* * Check that there was a last command, and * take its count and named buffer unless they * were given anew. Special case if last command * referenced a numeric named buffer -- increment * the number and go to a named buffer again. * This allows a sequence like "1pu.u.u... * to successively look for stuff in the kill chain * much as one does in EMACS with C-Y and M-Y. */ forbid (lastcmd[0] == 0); if (hadcnt) lastcnt = cnt; if (vreg) lastreg = vreg; else if (isdigit(lastreg) && lastreg < '9') lastreg++; vreg = lastreg; cnt = lastcnt; hadcnt = lasthad; vglobp = lastcmd; goto reread; /* * ^U Scroll up. A count sticks around for * future scrolls as the scroll amount. * Attempt to hold the indentation from the * top of the screen (in logical lines). * * BUG: A ^U near the bottom of the screen * on a dumb terminal (which can't roll back) * causes the screen to be cleared and then * redrawn almost as it was. In this case * one should simply move the cursor. */ case CTRL(u): if (hadcnt) vSCROLL = cnt; cnt = vSCROLL; if (state == VISUAL) ind = vcline, cnt += ind; else ind = 0; vmoving = 0; vup(cnt, ind, 1); vnline(NOSTR); continue; /* * ^D Scroll down. Like scroll up. */ case CTRL(d): #ifdef TRACE if (trace) fprintf(trace, "before vdown in ^D, dot=%d, wdot=%d, dol=%d\n", lineno(dot), lineno(wdot), lineno(dol)); #endif if (hadcnt) vSCROLL = cnt; cnt = vSCROLL; if (state == VISUAL) ind = vcnt - vcline - 1, cnt += ind; else ind = 0; vmoving = 0; vdown(cnt, ind, 1); #ifdef TRACE if (trace) fprintf(trace, "before vnline in ^D, dot=%d, wdot=%d, dol=%d\n", lineno(dot), lineno(wdot), lineno(dol)); #endif vnline(NOSTR); #ifdef TRACE if (trace) fprintf(trace, "after vnline in ^D, dot=%d, wdot=%d, dol=%d\n", lineno(dot), lineno(wdot), lineno(dol)); #endif continue; /* * ^E Glitch the screen down (one) line. * Cursor left on same line in file. */ case CTRL(e): if (state != VISUAL) continue; if (!hadcnt) cnt = 1; /* Bottom line of file already on screen */ forbid(lineDOL()-lineDOT() <= vcnt-1-vcline); ind = vcnt - vcline - 1 + cnt; vdown(ind, ind, 1); vnline(cursor); continue; /* * ^Y Like ^E but up */ case CTRL(y): if (state != VISUAL) continue; if (!hadcnt) cnt = 1; forbid(lineDOT()-1<=vcline); /* line 1 already there */ ind = vcline + cnt; vup(ind, ind, 1); vnline(cursor); continue; /* * m Mark position in mark register given * by following letter. Return is * accomplished via ' or `; former * to beginning of line where mark * was set, latter to column where marked. */ case 'm': /* * Getesc is generally used when a character * is read as a latter part of a command * to allow one to hit rubout/escape to cancel * what you have typed so far. These characters * are mapped to 0 by the subroutine. */ c = getesc(); if (c == 0) continue; /* * Markreg checks that argument is a letter * and also maps ' and ` to the end of the range * to allow '' or `` to reference the previous * context mark. */ c = markreg(c); forbid (c == 0); vsave(); names[c - 'a'] = (*dot &~ 01); ncols[c - 'a'] = cursor; anymarks = 1; continue; /* * ^F Window forwards, with 2 lines of continuity. * Count repeats. */ case CTRL(f): vsave(); if (vcnt > 2) { addr = dot + (vcnt - vcline) - 2 + (cnt-1)*basWLINES; forbid(addr > dol); dot = addr; vcnt = vcline = 0; } vzop(0, 0, '+'); continue; /* * ^B Window backwards, with 2 lines of continuity. * Inverse of ^F. */ case CTRL(b): vsave(); if (one + vcline != dot && vcnt > 2) { addr = dot - vcline - 2 + (cnt-1)*basWLINES; forbid (addr <= zero); dot = addr; vcnt = vcline = 0; } vzop(0, 0, '^'); continue; /* * z Screen adjustment, taking a following character: * z current line to top * z like z * z- current line to bottom * also z+, z^ like ^F and ^B. * A preceding count is line to use rather * than current line. A count between z and * specifier character changes the screen size * for the redraw. * */ case 'z': if (state == VISUAL) { i = vgetcnt(); if (i > 0) vsetsiz(i); c = getesc(); if (c == 0) continue; } vsave(); vzop(hadcnt, cnt, c); continue; /* * Y Yank lines, abbreviation for y_ or yy. * Yanked lines can be put later if no * changes intervene, or can be put in named * buffers and put anytime in this session. */ case 'Y': ungetkey('_'); c = 'y'; break; /* * J Join lines, 2 by default. Count is number * of lines to join (no join operator sorry.) */ case 'J': forbid (dot == dol); if (cnt == 1) cnt = 2; if (cnt > (i = dol - dot + 1)) cnt = i; vsave(); vmacchng(1); setLAST(); cursor = strend(linebuf); vremote(cnt, join, 0); notenam = "join"; vmoving = 0; killU(); vreplace(vcline, cnt, 1); if (!*cursor && cursor > linebuf) cursor--; if (notecnt == 2) notecnt = 0; vrepaint(cursor); continue; /* * S Substitute text for whole lines, abbrev for c_. * Count is number of lines to change. */ case 'S': ungetkey('_'); c = 'c';(( break; /* * O Create a new line above current and accept new * input text, to an escape, there. * A count specifies, for dumb terminals when * slowopen is not set, the number of physical * line space to open on the screen. * * o Like O, but opens lines below. */ case 'O': case 'o': vmacchng(1); voOpen(c, cnt); continue; /* * C Change text to end of line, short for c$. */ case 'C': if (*cursor) { ungetkey('$'), c = 'c'; break; } goto appnd; /* * ~ Switch case of letter under cursor */ case '~': { char mbuf[4]; setLAST(); mbuf[0] = 'r'; mbuf[1] = *cursor; mbuf[2] = cursor[1]==0 ? 0 : ' '; mbuf[3] = 0; if (isalpha(mbuf[1])) mbuf[1] ^= ' '; /* toggle the case */ macpush(mbuf, 1); } continue; /* * A Append at end of line, short for $a. */ case 'A': operate('$', 1); appnd: c = 'a'; /* fall into ... */ /* * a Appends text after cursor. Text can continue * through arbitrary number of lines. */ case 'a': if (*cursor) { if (state == HARDOPEN) putchar(*cursor); cursor++; } goto insrt; /* * I Insert at beginning of whitespace of line, * short for ^i. */ case 'I': operate('^', 1); c = 'i'; /* fall into ... */ /* * R Replace characters, one for one, by input * (logically), like repeated r commands. * * BUG: This is like the typeover mode of many other * editors, and is only rarely useful. Its * implementation is a hack in a low level * routine and it doesn't work very well, e.g. * you can't move around within a R, etc. */ case 'R': /* fall into... */ /* * i Insert text to an escape in the buffer. * Text is arbitrary. This command reminds of * the i command in bare teco. */ case 'i': insrt: /* * Common code for all the insertion commands. * Save for redo, position cursor, prepare for append * at command and in visual undo. Note that nothing * is doomed, unless R when all is, and save the * current line in a the undo temporary buffer. */ vmacchng(1); setLAST(); vcursat(cursor); prepapp(); vnoapp(); doomed = c == 'R' ? 10000 : 0; if(FIXUNDO) vundkind = VCHNG; vmoving = 0; CP(vutmp, linebuf); /* * If this is a repeated command, then suppress * fake insert mode on dumb terminals which looks * ridiculous and wastes lots of time even at 9600B. */ if (vglobp) hold = HOLDQIK; vappend(c, cnt, 0); continue; /* * ^? An attention, normally a ^?, just beeps. * If you are a vi command within ex, then * two ATTN's will drop you back to command mode. */ case ATTN: beep(); if (initev || peekkey() != ATTN) continue; /* fall into... */ /* * ^\ A quit always gets command mode. */ case QUIT: /* * Have to be careful if we were called * g/xxx/vi * since a return will just start up again. * So we simulate an interrupt. */ if (inglobal) onintr(); /* fall into... */ #ifdef notdef /* * q Quit back to command mode, unless called as * vi on command line in which case dont do it */ case 'q': /* quit */ if (initev) { vsave(); CATCH error("Q gets ex command mode, :q leaves vi"); ENDCATCH splitw = 0; getDOT(); vrepaint(cursor); continue; } #endif /* fall into... */ /* * Q Is like q, but always gets to command mode * even if command line invocation was as vi. */ case 'Q': vsave(); /* * If we are in the middle of a macro, throw away * the rest and fix up undo. * This code copied from getbr(). */ if (vmacp) { vmacp = 0; if (inopen == -1) /* don't screw up undo for esc esc */ vundkind = VMANY; inopen = 1; /* restore old setting now that macro done */ } return; /* * ZZ Like :x */ case 'Z': forbid(getkey() != 'Z'); oglobp = globp; globp = "x"; vclrech(0); goto gogo; /* * P Put back text before cursor or before current * line. If text was whole lines goes back * as whole lines. If part of a single line * or parts of whole lines splits up current * line to form many new lines. * May specify a named buffer, or the delete * saving buffers 1-9. * * p Like P but after rather than before. */ case 'P': case 'p': vmoving = 0; #ifdef notdef forbid (!vreg && value(UNDOMACRO) && inopen < 0); #endif /* * If previous delete was partial line, use an * append or insert to put it back so as to * use insert mode on intelligent terminals. */ if (!vreg && DEL[0]) { forbid ((DEL[0] & (QUOTE|TRIM)) == OVERBUF); vglobp = DEL; ungetkey(c == 'p' ? 'a' : 'i'); goto reread; } /* * If a register wasn't specified, then make * sure there is something to put back. */ forbid (!vreg && unddol == dol); /* * If we just did a macro the whole buffer is in * the undo save area. We don't want to put THAT. */ forbid (vundkind == VMANY && undkind==UNDALL); vsave(); vmacchng(1); setLAST(); i = 0; if (vreg && partreg(vreg) || !vreg && pkill[0]) { /* * Restoring multiple lines which were partial * lines; will leave cursor in middle * of line after shoving restored text in to * split the current line. */ i++; if (c == 'p' && *cursor) cursor++; } else { /* * In whole line case, have to back up dot * for P; also want to clear cursor so * cursor will eventually be positioned * at the beginning of the first put line. */ cursor = 0; if (c == 'P') { dot--, vcline--; c = 'p'; } } killU(); /* * The call to putreg can potentially * bomb since there may be nothing in a named buffer. * We thus put a catch in here. If we didn't and * there was an error we would end up in command mode. */ addr = dol; /* old dol */ CATCH vremote(1, vreg ? putreg : put, vreg); ONERR if (vreg == -1) { splitw = 0; if (op == 'P') dot++, vcline++; goto pfixup; } ENDCATCH splitw = 0; nlput = dol - addr + 1; if (!i) { /* * Increment undap1, undap2 to make up * for their incorrect initialization in the * routine vremote before calling put/putreg. */ if (FIXUNDO) undap1++, undap2++; vcline++; nlput--; /* * After a put want current line first line, * and dot was made the last line put in code * run so far. This is why we increment vcline * above and decrease dot here. */ dot -= nlput - 1; } #ifdef TRACE if (trace) fprintf(trace, "vreplace(%d, %d, %d), undap1=%d, undap2=%d, dot=%d\n", vcline, i, nlput, lineno(undap1), lineno(undap2), lineno(dot)); #endif vreplace(vcline, i, nlput); if (state != VISUAL) { /* * Special case in open mode. * Force action on the screen when a single * line is put even if it is identical to * the current line, e.g. on YP; otherwise * you can't tell anything happened. */ vjumpto(dot, cursor, '.'); continue; } pfixup: vrepaint(cursor); vfixcurs(); continue; /* * ^^ Return to previous file. * Like a :e #, and thus can be used after a * "No Write" diagnostic. */ case CTRL(^): forbid (hadcnt); vsave(); ckaw(); oglobp = globp; if (value(AUTOWRITE)) globp = "e! #"; else globp = "e #"; goto gogo; /* * ^] Takes word after cursor as tag, and then does * tag command. Read ``go right to''. */ case CTRL(]): grabtag(); oglobp = globp; globp = "tag"; goto gogo; /* * & Like :& */ case '&': oglobp = globp; globp = "&"; goto gogo; /* * ^G Bring up a status line at the bottom of * the screen, like a :file command. * * BUG: Was ^S but doesn't work in cbreak mode */ case CTRL(g): oglobp = globp; globp = "file"; gogo: addr = dot; vsave(); goto doinit; #ifdef SIGTSTP /* * ^Z: suspend editor session and temporarily return * to shell. Only works with Berkeley/IIASA process * control in kernel. */ case CTRL(z): forbid(dosusp == 0 || !ldisc); vsave(); oglobp = globp; globp = "stop"; goto gogo; #endif /* * : Read a command from the echo area and * execute it in command mode. */ case ':': forbid (hadcnt); vsave(); i = tchng; addr = dot; if (readecho(c)) { esave[0] = 0; goto fixup; } getDOT(); /* * Use the visual undo buffer to store the global * string for command mode, since it is idle right now. */ oglobp = globp; strcpy(vutmp, genbuf+1); globp = vutmp; doinit: esave[0] = 0; fixech(); /* * Have to finagle around not to lose last * character after this command (when run from ex * command mode). This is clumsy. */ d = peekc; ungetchar(0); if (shouldpo) { /* * So after a "Hit return..." ":", we do * another "Hit return..." the next time */ pofix(); shouldpo = 0; } CATCH /* * Save old values of options so we can * notice when they change; switch into * cooked mode so we are interruptible. */ onumber = value(NUMBER); olist = value(LIST); OPline = Pline; OPutchar = Putchar; #ifndef CBREAK vcook(); #endif commands(1, 1); if (dot == zero && dol > zero) dot = one; #ifndef CBREAK vraw(); #endif ONERR #ifndef CBREAK vraw(); #endif copy(esave, vtube[WECHO], TUBECOLS); ENDCATCH fixol(); Pline = OPline; Putchar = OPutchar; ungetchar(d); globp = oglobp; /* * If we ended up with no lines in the buffer, make * a line, and don't consider the buffer changed. */ if (dot == zero) { fixzero(); sync(); } splitw = 0; /* * Special case: did list/number options change? */ if (onumber != value(NUMBER)) setnumb(value(NUMBER)); if (olist != value(LIST)) setlist(value(LIST)); fixup: /* * If a cha((nge occurred, other than * a write which clears changes, then * we should allow an undo even if . * didn't move. * * BUG: You can make this wrong by * tricking around with multiple commands * on one line of : escape, and including * a write command there, but its not * worth worrying about. */ if (FIXUNDO && tchng && tchng != i) vundkind = VMANY, cursor = 0; /* * If we are about to do another :, hold off * updating of screen. */ if (vcnt < 0 && Peekkey == ':') { getDOT(); shouldpo = 1; continue; } shouldpo = 0; /* * In the case where the file being edited is * new; e.g. if the initial state hasn't been * saved yet, then do so now. */ if (unddol == truedol) { vundkind = VNONE; Vlines = lineDOL(); if (!inglobal) savevis(); addr = zero; vcnt = 0; if (esave[0] == 0) copy(esave, vtube[WECHO], TUBECOLS); } /* * If the current line moved reset the cursor position. */ if (dot != addr) { vmoving = 0; cursor = 0; } /* * If current line is not on screen or if we are * in open mode and . moved, then redraw. */ i = vcline + (dot - addr); if (i < 0 || i >= vcnt && i >= -vcnt || state != VISUAL && dot != addr) { if (state == CRTOPEN) vup1(); if (vcnt > 0) vcnt = 0; vjumpto(dot, (char *) 0, '.'); } else { /* * Current line IS on screen. * If we did a [Hit return...] then * restore vcnt and clear screen if in visual */ vcline = i; if (vcnt < 0) { vcnt = -vcnt; if (state == VISUAL) vclear(); else if (state == CRTOPEN) { vcnt = 0; } } /* * Limit max value of vcnt based on $ */ i = vcline + lineDOL() - lineDOT() + 1; if (i < vcnt) vcnt = i; /* * Dirty and repaint. */ vdirty(0, LINES); vrepaint(cursor); } /* * If in visual, put back the echo area * if it was clobberred. */ if (state == VISUAL) { int sdc = destcol, sdl = destline; splitw++; vigoto(WECHO, 0); for (i = 0; i < TUBECOLS - 1; i++) { if (esave[i] == 0) break; vputchar(esave[i]); } splitw = 0; vgoto(sdl, sdc); } continue; /* * u undo the last changing command. */ case 'u': vundo(1); continue; /* * U restore current line to initial state. */ case 'U': vUndo(); continue; fonfon: beep(); vmacp = 0; inopen = 1; /* might have been -1 */ continue; } /* * Rest of commands are decoded by the operate * routine. */ operate(c, cnt); } } /* * Grab the word after the cursor so we can look for it as a tag. */ grabtag() { register char *cp, *dp; cp = vpastwh(cursor); if (*cp) { dp = lasttag; do { if (dp < &lasttag[sizeof lasttag - 2]) *dp++ = *cp; cp++; } while (isalpha(*cp) || isdigit(*cp) || *cp == '_'); *dp++ = 0; } } /* * Before appending lines, set up addr1 and * the command mode undo information. */ prepapp() { addr1 = dot; deletenone(); addr1++; appendnone(); } /* * Execute function f with the address bounds addr1 * and addr2 surrounding cnt lines starting at dot. */ vremote(cnt, f, arg) int cnt, (*f)(), arg; { register int oing = inglobal; addr1 = dot; addr2 = dot + cnt - 1; inglobal = 0; if (FIXUNDO) undap1 = undap2 = dot; (*f)(arg); inglobal = oing; if (FIXUNDO) vundkind = VMANY; vmcurs = 0; } /* * Save the current contents of linebuf, if it has changed. */ vsave() { char temp[LBSIZE]; CP(temp, linebuf); if (FIXUNDO && vundkind == VCHNG || vundkind == VCAPU) { /* * If the undo state is saved in the temporary buffer * vutmp, then we sync this into the temp file so that * we will be able to undo even after we have moved off * the line. It would be possible to associate a line * with vutmp but we assume that vutmp is only associated * with line dot (e.g. in case ':') above, so beware. */ prepapp(); strcLIN(vutmp); putmark(dot); vremote(1, yank, 0); vundkind = VMCHNG; notecnt = 0; undkind = UNDCHANGE; } /* * Get the line out of the temp file and do nothing if it hasn't * changed. This may seem like a loss, but the line will * almost always be in a read buffer so this may well avoid disk i/o. */ getDOT(); if (strcmp(linebuf, temp) == 0) return; strcLIN(temp); putmark(dot); } #undef forbid #define forbid(a) if (a) { beep(); return; } /* * Do a z operation. * Code here is rather long, and very uninteresting. */ vzop(hadcnt, cnt, c) bool hadcnt; int cnt; register int c; { register line *addr; if (state != VISUAL) { /* * Z from open; always like a z=. * This code is a mess and should be cleaned up. */ vmoveitup(1, 1); vgoto(outline, 0); ostop(normf); setoutt(); addr2 = dot; vclear(); destline = WECHO; zop2(Xhadcnt ? Xcnt : value(WINDOW) - 1, '='); if (state == CRTOPEN) putnl(); putNFL(); termreset(); Outchar = vputchar; ignore(ostart()); vcnt = 0; outline = destline = 0; vjumpto(dot, cursor, 0); return; } if (hadcnt) { addr = zero + cnt; if (addr < one) addr = one; if (addr > dol) addr = dol; markit(addr); } else switch (c) { case '+': addr = dot + vcnt - vcline; break; case '^': addr = dot - vcline - 1; forbid (addr < one); c = '-'; break; default: addr = dot; break; } switch (c) { case '.': case '-': break; case '^': forbid (addr <= one); break; case '+': forbid (addr >= dol); /* fall into ... */ case CR: case NL: c = CR; break; default: beep(); return; } vmoving = 0; vjumpto(addr, NOSTR, c); } ddr > dol) addr = dol; markit(addr); } else switch (c) { case '+': addr = dot + vcnt - vcline; break; case '^': addr = dot - vcline - 1; forbid (addr < one); c = '-'; break; default: addr = dot; break; } switch (c) { case '.': case '-': break; case '^': forbid (addr <= one); break; case '+': forbid (addr >= dol); /* fall intcmd/ex/ex_voper.c 444 0 33 34740 2425472356 7244 /* Copyright (c) 1980 Regents of the University of California */ static char *sccsid = "@(#)ex_voper.c 6.2 10/23/80"; #include "ex.h" #include "ex_tty.h" #include "ex_vis.h" #define blank() isspace(wcursor[0]) #define forbid(a) if (a) goto errlab; char vscandir[2] = { '/', 0 }; /* * Decode an operator/operand type command. * Eventually we switch to an operator subroutine in ex_vops.c. * The work here is setting up a function variable to point * to the routine we want, and manipulation of the variables * wcursor and wdot, which mark the other end of the affected * area. If wdot is zero, then the current line is the other end, * and if wcursor is zero, then the first non-blank location of the * other line is implied. */ operate(c, cnt) register int c, cnt; { register int i; int (*moveop)(), (*deleteop)(); register int (*opf)(); bool subop = 0; char *oglobp, *ocurs; register line *addr; line *odot; static char lastFKND, lastFCHR; char d; moveop = vmove, deleteop = vdelete; wcursor = cursor; wdot = NOLINE; notecnt = 0; dir = 1; switch (c) { /* * d delete operator. */ case 'd': moveop = vdelete; deleteop = beep; break; /* * s substitute characters, like c\040, i.e. change space. */ case 's': ungetkey(' '); subop++; /* fall into ... */ /* * c Change operator. */ case 'c': if (c == 'c' && workcmd[0] == 'C' || workcmd[0] == 'S') subop++; moveop = vchange; deleteop = beep; break; /* * ! Filter through a UNIX command. */ case '!': moveop = vfilter; deleteop = beep; break; /* * y Yank operator. Place specified text so that it * can be put back with p/P. Also yanks to named buffers. */ case 'y': moveop = vyankit; deleteop = beep; break; /* * = Reformat operator (for LISP). */ #ifdef LISPCODE case '=': forbid(!value(LISP)); /* fall into ... */ #endif /* * > Right shift operator. * < Left shift operator. */ case '<': case '>': moveop = vshftop; deleteop = beep; break; /* * r Replace character under cursor with single following * character. */ case 'r': vmacchng(1); vrep(cnt); return; default: goto nocount; } vmacchng(1); /* * Had an operator, so accept another count. * Multiply counts together. */ if (isdigit(peekkey()) && peekkey() != '0') { cnt *= vgetcnt(); Xcnt = cnt; forbid (cnt <= 0); } /* * Get next character, mapping it and saving as * part of command for repeat. */ c = map(getesc(),arrows); if (c == 0) return; if (!subop) *lastcp++ = c; nocount: opf = moveop; switch (c) { /* * b Back up a word. * B Back up a word, liberal definition. */ case 'b': case 'B': dir = -1; /* fall into ... */ /* * w Forward a word. * W Forward a word, liberal definition. */ case 'W': case 'w': wdkind = c & ' '; forbid(lfind(2, cnt, opf, 0) < 0); vmoving = 0; break; /* * E to end of following blank/nonblank word */ case 'E': wdkind = 0; goto ein; /* * e To end of following word. */ case 'e': wdkind = 1; ein: forbid(lfind(3, cnt - 1, opf, 0) < 0); vmoving = 0; break; /* * ( Back an s-expression. */ case '(': dir = -1; /* fall into... */ /* * ) Forward an s-expression. */ case ')': forbid(lfind(0, cnt, opf, (line *) 0) < 0); markDOT(); break; /* * { Back an s-expression, but don't stop on atoms. * In text mode, a paragraph. For C, a balanced set * of {}'s. */ case '{': dir = -1; /* fall into... */ /* * } Forward an s-expression, but don't stop on(( atoms. * In text mode, back paragraph. For C, back a balanced * set of {}'s. */ case '}': forbid(lfind(1, cnt, opf, (line *) 0) < 0); markDOT(); break; /* * % To matching () or {}. If not at ( or { scan for * first such after cursor on this line. */ case '%': vsave(); i = lmatchp((line *) 0); #ifdef TRACE if (trace) fprintf(trace, "after lmatchp in %, dot=%d, wdot=%d, dol=%d\n", lineno(dot), lineno(wdot), lineno(dol)); #endif getDOT(); forbid(!i); if (opf != vmove) if (dir > 0) wcursor++; else cursor++; else markDOT(); vmoving = 0; break; /* * [ Back to beginning of defun, i.e. an ( in column 1. * For text, back to a section macro. * For C, back to a { in column 1 (~~ beg of function.) */ case '[': dir = -1; /* fall into ... */ /* * ] Forward to next defun, i.e. a ( in column 1. * For text, forward section. * For C, forward to a } in column 1 (if delete or such) * or if a move to a { in column 1. */ case ']': if (!vglobp) forbid(getkey() != c); forbid (Xhadcnt); vsave(); i = lbrack(c, opf); getDOT(); forbid(!i); markDOT(); if (ospeed > B300) hold |= HOLDWIG; break; /* * , Invert last find with f F t or T, like inverse * of ;. */ case ',': forbid (lastFKND == 0); c = isupper(lastFKND) ? tolower(lastFKND) : toupper(lastFKND); i = lastFCHR; if (vglobp == 0) vglobp = ""; subop++; goto nocount; /* * 0 To beginning of real line. */ case '0': wcursor = linebuf; vmoving = 0; break; /* * ; Repeat last find with f F t or T. */ case ';': forbid (lastFKND == 0); c = lastFKND; i = lastFCHR; subop++; goto nocount; /* * F Find single character before cursor in current line. * T Like F, but stops before character. */ case 'F': /* inverted find */ case 'T': dir = -1; /* fall into ... */ /* * f Find single character following cursor in current line. * t Like f, but stope before character. */ case 'f': /* find */ case 't': if (!subop) { i = getesc(); if (i == 0) return; *lastcp++ = i; } if (vglobp == 0) lastFKND = c, lastFCHR = i; for (; cnt > 0; cnt--) forbid (find(i) == 0); vmoving = 0; switch (c) { case 'T': wcursor++; break; case 't': wcursor--; case 'f': fixup: if (moveop != vmove) wcursor++; break; } break; /* * | Find specified print column in current line. */ case '|': if (Pline == numbline) cnt += 8; vmovcol = cnt; vmoving = 1; wcursor = vfindcol(cnt); break; /* * ^ To beginning of non-white space on line. */ case '^': wcursor = vskipwh(linebuf); vmoving = 0; break; /* * $ To end of line. */ case '$': if (opf == vmove) { vmoving = 1; vmovcol = 20000; } else vmoving = 0; if (cnt > 1) { if (opf == vmove) { wcursor = 0; cnt--; } else wcursor = linebuf; /* This is wrong at EOF */ wdot = dot + cnt; break; } if (linebuf[0]) { wcursor = strend(linebuf) - 1; goto fixup; } wcursor = linebuf; break; /* * h Back a character. * ^H Back a character. */ case 'h': case CTRL(h): dir = -1; /* fall into ... */ /* * space Forward a character. */ case 'l': case ' ': forbid (margin() || opf == vmove && edge()); while (cnt > 0 && !margin()) wcursor += dir, cnt--; if (margin() && opf == vmove || wcursor < linebuf) wcursor -= dir; vmoving = 0; break; /* * D Delete to end of line, short for d$. */ case 'D': cnt = INF; goto deleteit; /* * X Delete character before cursor. */ case 'X': dir = -1; /* fall into ... */ deleteit: /* * x Delete character at cursor, leaving cursor where it is. */ case 'x': if (margin()) goto errlab; vmacchng(1); while (cnt > 0 && !margin()) wcursor += dir, cnt--; opf = deleteop; vmoving = 0; break; default: /* * Stuttered operators are equivalent to the operator on * a line, thus turn dd into d_. */ if (opf == vmove || c != workcmd[0]) { errlab: beep(); vmacp = 0; return; } /* fall into ... */ /* * _ Target for a line or group of lines. * Stuttering is more convenient; this is mostly * for aesthetics. */ case '_': wdot = dot + cnt - 1; vmoving = 0; wcursor = 0; break; /* * H To first, home line on screen. * Count is for count'th line rather than first. */ case 'H': wdot = (dot - vcline) + cnt - 1; if (opf == vmove) markit(wdot); vmoving = 0; wcursor = 0; break; /* * - Backwards lines, to first non-white character. */ case '-': wdot = dot - cnt; vmoving = 0; wcursor = 0; break; /* * ^P To previous line same column. Ridiculous on the * console of the VAX since it puts console in LSI mode. */ case 'k': case CTRL(p): wdot = dot - cnt; if (vmoving == 0) vmoving = 1, vmovcol = column(cursor); wcursor = 0; break; /* * L To last line on screen, or count'th line from the * bottom. */ case 'L': wdot = dot + vcnt - vcline - cnt; if (opf == vmove) markit(wdot); vmoving = 0; wcursor = 0; break; /* * M To the middle of the screen. */ case 'M': wdot = dot + ((vcnt + 1) / 2) - vcline - 1; if (opf == vmove) markit(wdot); vmoving = 0; wcursor = 0; break; /* * + Forward line, to first non-white. * * CR Convenient synonym for +. */ case '+': case CR: wdot = dot + cnt; vmoving = 0; wcursor = 0; break; /* * ^N To next line, same column if possible. * * LF Linefeed is a convenient synonym for ^N. */ case CTRL(n): case 'j': case NL: wdot = dot + cnt; if (vmoving == 0) vmoving = 1, vmovcol = column(cursor); wcursor = 0; break; /* * n Search to next match of current pattern. */ case 'n': vglobp = vscandir; c = *vglobp++; goto nocount; /* * N Like n but in reverse direction. */ case 'N': vglobp = vscandir[0] == '/' ? "?" : "/"; c = *vglobp++; goto nocount; /* * ' Return to line specified by following mark, * first white position on line. * * ` Return to marked line at remembered column. */ case '\'': case '`': d = c; c = getesc(); if (c == 0) return; c = markreg(c); forbid (c == 0); wdot = getmark(c); forbid (wdot == NOLINE); forbid (Xhadcnt); vmoving = 0; wcursor = d == '`' ? ncols[c - 'a'] : 0; if (opf == vmove && (wdot != dot || (d == '`' && wcursor != cursor))) markDOT(); if (wcursor) { vsave(); getline(*wdot); if (wcursor > strend(linebuf)) wcursor = 0; getDOT(); } if (ospeed > B300) hold |= HOLDWIG; break; /* * G Goto count'th line, or last line if no count * given. */ case 'G': if (!Xhadcnt) cnt = lineDOL(); wdot = zero + cnt; forbid (wdot < one || wdot > dol); if (opf == vmove) markit(wdot); vmoving = 0; wcursor = 0; break; /* * / Scan forward for following re. * ? Scan backward for following re. */ case '/': case '?': forbid (Xhadcnt); vsave(); ocurs = cursor; odot = dot; wcursor = 0; if (readecho(c)) return; if (!vglobp) vscandir[0] = genbuf[0]; oglobp = globp; CP(vutmp, genbuf); globp = vutmp; d = peekc; fromsemi: ungetchar(0); fixech(); CATCH #ifndef CBREAK /* * Lose typeahead (ick). */ vcook(); #endif addr = address(cursor); #ifndef CBREAK vraw(); #endif ONERR #ifndef CBREAK vraw(); #endif slerr: globp = oglobp; dot = odot; cursor = ocurs; ungetchar(d); splitw = 0; vclean(); vjumpto(dot, ocurs, 0); return; ENDCATCH if (globp == 0) globp = ""; else if (peekc) --globp; if (*globp == ';') { /* /foo/;/bar/ */ globp++; dot = addr; cursor = loc1; goto fromsemi; } dot = odot; ungetchar(d); c = 0; if (*globp == 'z') globp++, c = '\n'; if (any(*globp, "^+-.")) c = *globp++; i = 0; while (isdigit(*globp)) i = i * 10 + *globp++ - '0'; if (any(*globp, "^+-.")) c = *globp++; if (*globp) { /* random junk after the pattern */ beep(); goto slerr; } globp = oglobp; splitw = 0; vmoving = 0; wcursor = loc1; if (i != 0) vsetsiz(i); if (opf == vmove) { if (state == ONEOPEN || state == HARDOPEN) outline = destline = WBOT; if (addr != dot || loc1 != cursor) markDOT(); if (loc1 > linebuf && *loc1 == 0) loc1--; if (c) vjumpto(addr, loc1, c); else { vmoving = 0; if (loc1) { vmoving++; vmovcol = column(loc1); } getDOT(); if (state == CRTOPEN && addr != dot) vup1(); vupdown(addr - dot, NOSTR); } return; } lastcp[-1] = 'n'; getDOT(); wdot = addr; break; } /* * Apply. */ if (vreg && wdot == 0) wdot = dot; (*opf)(c); wdot = NOLINE; } /* * Find single character c, in direction dir from cursor. */ find(c) char c; { for(;;) { if (edge()) return (0); wcursor += dir; if (*wcursor == c) return (1); } } /* * Do a word motion with operator op, and cnt more words * to go after this. */ word(op, cnt) register int (*op)(); int cnt; { register int which; register char *iwc; register line *iwdot = wdot; if (dir == 1) { iwc = wcursor; which = wordch(wcursor); while (wordof(which, wcursor)) { if (cnt == 1 && op != vmove && wcursor[1] == 0) { wcursor++; break; } if (!lnext()) return (0); if (wcursor == linebuf) break; } /* Unless last segment of a change skip blanks */ if (op != vchange || cnt > 1) while (!margin() && blank()) wcursor++; else if (wcursor == iwc && iwdot == wdot && *iwc) wcursor++; if (op == vmove && margin()) wcursor--; } else { if (!lnext()) return (0); while (blank()) if (!lnext()) return (0); if (!margin()) { which = wordch(wcursor); while (!margin() && wordof(which, wcursor)) wcursor--; } if (wcursor < linebuf || !wordof(which, wcursor)) wcursor++; } return (1); } /* * To end of word, with operator op and cnt more motions * remaining after this. */ eend(op) register int (*op)(); { register int which; if (!lnext()) return; while (blank()) if (!lnext()) return; which = wordch(wcursor); while (word((of(which, wcursor)) { if (wcursor[1] == 0) { wcursor++; break; } if (!lnext()) return; } if (op != vchange && op != vdelete && wcursor > linebuf) wcursor--; } /* * Wordof tells whether the character at *wc is in a word of * kind which (blank/nonblank words are 0, conservative words 1). */ wordof(which, wc) char which; register char *wc; { if (isspace(*wc)) return (0); return (!wdkind || wordch(wc) == which); } /* * Wordch tells whether character at *wc is a word character * i.e. an alfa, digit, or underscore. */ wordch(wc) char *wc; { register int c; c = wc[0]; return (isalpha(c) || isdigit(c) || c == '_'); } /* * Edge tells when we hit the last character in the current line. */ edge() { if (linebuf[0] == 0) return (1); if (dir == 1) return (wcursor[1] == 0); else return (wcursor == linebuf); } /* * Margin tells us when we have fallen off the end of the line. */ margin() { return (wcursor < linebuf || wcursor[0] == 0); } r at *wc is a word character * cmd/ex/ex_vops.c 444 0 33 44232 2425477470 7077 /* Copyright (c) 1980 Regents of the University of California */ static char *sccsid = "@(#)ex_vops.c 6.3 10/23/80"; #include "ex.h" #include "ex_tty.h" #include "ex_vis.h" /* * This file defines the operation sequences which interface the * logical changes to the file buffer with the internal and external * display representations. */ /* * Undo. * * Undo is accomplished in two ways. We often for small changes in the * current line know how (in terms of a change operator) how the change * occurred. Thus on an intelligent terminal we can undo the operation * by another such operation, using insert and delete character * stuff. The pointers vU[AD][12] index the buffer vutmp when this * is possible and provide the necessary information. * * The other case is that the change involved multiple lines or that * we have moved away from the line or forgotten how the change was * accomplished. In this case we do a redisplay and hope that the * low level optimization routines (which don't look for winning * via insert/delete character) will not lose too badly. */ char *vUA1, *vUA2; char *vUD1, *vUD2; vUndo() { /* * Avoid UU which clobbers ability to do u. */ if (vundkind == VCAPU || vUNDdot != dot) { beep(); return; } CP(vutmp, linebuf); vUD1 = linebuf; vUD2 = strend(linebuf); putmk1(dot, vUNDsav); getDOT(); vUA1 = linebuf; vUA2 = strend(linebuf); vundkind = VCAPU; if (state == ONEOPEN || state == HARDOPEN) { vjumpto(dot, vUNDcurs, 0); return; } vdirty(vcline, 1); vsyncCL(); cursor = linebuf; vfixcurs(); } vundo(show) bool show; /* if true update the screen */ { register int cnt; register line *addr; register char *cp; char temp[LBSIZE]; bool savenote; int (*OO)(); short oldhold = hold; switch (vundkind) { case VMANYINS: wcursor = 0; addr1 = undap1; addr2 = undap2 - 1; vsave(); YANKreg('1'); notecnt = 0; /* fall into ... */ case VMANY: case VMCHNG: vsave(); addr = dot - vcline; notecnt = 1; if (undkind == UNDPUT && undap1 == undap2) { beep(); break; } /* * Undo() call below basically replaces undap1 to undap2-1 * with dol through unddol-1. Hack screen image to * reflect this replacement. */ if (show) if (undkind == UNDMOVE) vdirty(0, LINES); else vreplace(undap1 - addr, undap2 - undap1, undkind == UNDPUT ? 0 : unddol - dol); savenote = notecnt; undo(1); if (show && (vundkind != VMCHNG || addr != dot)) killU(); vundkind = VMANY; cnt = dot - addr; if (cnt < 0 || cnt > vcnt || state != VISUAL) { if (show) vjumpto(dot, NOSTR, '.'); break; } if (!savenote) notecnt = 0; if (show) { vcline = cnt; vrepaint(vmcurs); } vmcurs = 0; break; case VCHNG: case VCAPU: vundkind = VCHNG; strcpy(temp, vutmp); strcpy(vutmp, linebuf); doomed = column(vUA2 - 1) - column(vUA1 - 1); strcLIN(temp); cp = vUA1; vUA1 = vUD1; vUD1 = cp; cp = vUA2; vUA2 = vUD2; vUD2 = cp; if (!show) break; cursor = vUD1; if (state == HARDOPEN) { doomed = 0; vsave(); vopen(dot, WBOT); vnline(cursor); break; } /* * Pseudo insert command. */ vcursat(cursor); OO = Outchar; Outchar = vinschar; hold |= HOLDQIK; vprepins(); temp[vUA2 - linebuf] = 0; for (cp = &temp[vUA1 - linebuf]; *cp;) putchar(*cp++); Outchar = OO; hold = oldhold; endim(); physdc(cindent(), cindent() + doomed); doomed = 0; vdirty(vcline, 1); vsyncCL(); if (cursor > linebuf && cursor >= strend(linebuf)) cursor--; vfixcurs(); break; case VNONE: beep(); break; } } /* * Routine to handle a change inside a macro. * Fromvis is true if we were called from a visual command (as * opposed to an ex command). This has nothing to do with being * in open/visual mode as :s/foo/bar is not fromvis. */ vmacchng(fromvis) bool fromvis; { line *savedot, *savedol; char *savecursor; char savelb[LBSIZE]; int nlines, more; register line *a1, *a2; char ch; /* DEBUG */ int copyw(), copywR(); if (!inopen) return; if (!vmacp) vch_mac = VC_NOTINMAC; #ifdef TRACE if (trace) fprintf(trace, "vmacchng, vch_mac=%d, linebuf='%s', *dot=%o\n", vch_mac, linebuf, *dot); #endif if (vmacp && fromvis) vsave(); #ifdef TRACE if (trace) fprintf(trace, "after vsave, linebuf='%s', *dot=%o\n", linebuf, *dot); #endif switch(vch_mac) { case VC_NOCHANGE: vch_mac = VC_ONECHANGE; break; case VC_ONECHANGE: /* Save current state somewhere */ #ifdef TRACE vudump("before vmacchng hairy case"); #endif savedot = dot; savedol = dol; savecursor = cursor; CP(savelb, linebuf); nlines = dol - zero; while ((line *) endcore - truedol < nlines) morelines(); copyw(truedol+1, zero+1, nlines); truedol += nlines; #ifdef TRACE visdump("before vundo"); #endif /* Restore state as it was at beginning of macro */ vundo(0); #ifdef TRACE visdump("after vundo"); vudump("after vundo"); #endif /* Do the saveall we should have done then */ saveall(); #ifdef TRACE vudump("after saveall"); #endif /* Restore current state from where saved */ more = savedol - dol; /* amount we shift everything by */ if (more) (*(more>0 ? copywR : copyw))(savedol+1, dol+1, truedol-dol); unddol += more; truedol += more; undap2 += more; truedol -= nlines; copyw(zero+1, truedol+1, nlines); dot = savedot; dol = savedol ; cursor = savecursor; CP(linebuf, savelb); vch_mac = VC_MANYCHANGE; /* Arrange that no further undo saving happens within macro */ otchng = tchng; /* Copied this line blindly - bug? */ inopen = -1; /* no need to save since it had to be 1 or -1 before */ vundkind = VMANY; #ifdef TRACE vudump("after vmacchng"); #endif break; case VC_NOTINMAC: case VC_MANYCHANGE: /* Nothing to do for various reasons. */ break; } } /* * Initialize undo information before an append. */ vnoapp() { vUD1 = vUD2 = cursor; } /* * All the rest of the motion sequences have one or more * cases to deal with. In the case wdot == 0, operation * is totally within current line, from cursor to wcursor. * If wdot is given, but wcursor is 0, then operation affects * the inclusive line range. The hardest case is when both wdot * and wcursor are given, then operation affects from line dot at * cursor to line wdot at wcursor. */ /* * Move is simple, except for moving onto new lines in hardcopy open mode. */ vmove() { register int cnt; if (wdot) { if (wdot < one || wdot > dol) { beep(); return; } cnt = wdot - dot; wdot = NOLINE; if (cnt) killU(); vupdown(cnt, wcursor); return; } /* * When we move onto a new line, save information for U undo. */ if (vUNDdot != dot) { vUNDsav = *dot; vUNDcurs = wcursor; vUNDdot = dot; } /* * In hardcopy open, type characters to left of cursor * on new line, or back cursor up if its to left of where we are. * In any case if the current line is ``rubbled'' i.e. has trashy * looking overstrikes on it or \'s from deletes, we reprint * so it is more comprehensible (and also because we can't work * if we let it get more out of sync since column() won't work right. */ if (state == HARDOPEN) { register char *cp; if (rubble) { register int c; int oldhold = hold; sethard(); cp = wcursor; c = *cp; *cp = 0; hold |= HOLDDOL; vreopen(WTOP, lineDOT(), vcline); hold = oldhold; *cp = c; } else if (wcursor > cursor) { vfixcurs(); for (cp = cursor; *cp && cp < wcursor;) { register int c = *cp++ & TRIM; putchar(c ? c : ' '); } } } vsetcurs(wcursor); } /* * Delete operator. * * Hard case of deleting a range where both wcursor and wdot * are specified is treated as a special case of change and handled * by vchange (although vchange may pass it back if it degenerates * to a full line range delete.) */ vdelete(c) char c; { register char *cp; register int i; if (wdot) { if (wcursor) { vchange('d'); return; } if ((i = xdw()) < 0) return; if (state != VISUAL) { vgoto(LINE(0), 0); vputchar('@'); } wdot = dot; vremote(i, delete, 0); notenam = "delete"; DEL[0] = 0; killU(); vreplace(vcline, i, 0); if (wdot > dol) vcline--; vrepaint(NOSTR); return; } if (wcursor < linebuf) wcursor = linebuf; if (cursor == wcursor) { beep(); return; } i = vdcMID(); cp = cursor; setDEL(); CP(cp, wcursor); if (cp > linebuf && (cp[0] == 0 || c == '#')) cp--; if (state == HARDOPEN) { bleep(i, cp); cursor = cp; return; } physdc(column(cursor - 1), i); DEPTH(vcline) = 0; vreopen(LINE(vcline), lineDOT(), vcline); vsyncCL(); vsetcurs(cp); } /* * Change operator. * * In a single lin((e we mark the end of the changed area with '$'. * On multiple whole lines, we clear the lines first. * Across lines with both wcursor and wdot given, we delete * and sync then append (but one operation for undo). */ vchange(c) char c; { register char *cp; register int i, ind, cnt; line *addr; if (wdot) { /* * Change/delete of lines or across line boundaries. */ if ((cnt = xdw()) < 0) return; getDOT(); if (wcursor && cnt == 1) { /* * Not really. */ wdot = 0; if (c == 'd') { vdelete(c); return; } goto smallchange; } if (cursor && wcursor) { /* * Across line boundaries, but not * necessarily whole lines. * Construct what will be left. */ *cursor = 0; strcpy(genbuf, linebuf); getline(*wdot); if (strlen(genbuf) + strlen(wcursor) > LBSIZE - 2) { getDOT(); beep(); return; } strcat(genbuf, wcursor); if (c == 'd' && *vpastwh(genbuf) == 0) { /* * Although this is a delete * spanning line boundaries, what * would be left is all white space, * so take it all away. */ wcursor = 0; getDOT(); op = 0; notpart(lastreg); notpart('1'); vdelete(c); return; } ind = -1; } else if (c == 'd' && wcursor == 0) { vdelete(c); return; } else #ifdef LISPCODE /* * We are just substituting text for whole lines, * so determine the first autoindent. */ if (value(LISP) && value(AUTOINDENT)) ind = lindent(dot); else #endif ind = whitecnt(linebuf); i = vcline >= 0 ? LINE(vcline) : WTOP; /* * Delete the lines from the buffer, * and remember how the partial stuff came about in * case we are told to put. */ addr = dot; vremote(cnt, delete, 0); setpk(); notenam = "delete"; if (c != 'd') notenam = "change"; /* * If DEL[0] were nonzero, put would put it back * rather than the deleted lines. */ DEL[0] = 0; if (cnt > 1) killU(); /* * Now hack the screen image coordination. */ vreplace(vcline, cnt, 0); wdot = NOLINE; noteit(0); vcline--; if (addr <= dol) dot--; /* * If this is a across line delete/change, * cursor stays where it is; just splice together the pieces * of the new line. Otherwise generate a autoindent * after a S command. */ if (ind >= 0) { *genindent(ind) = 0; vdoappend(genbuf); } else { vmcurs = cursor; strcLIN(genbuf); vdoappend(linebuf); } /* * Indicate a change on hardcopies by * erasing the current line. */ if (c != 'd' && state != VISUAL && state != HARDOPEN) { int oldhold = hold; hold |= HOLDAT, vclrlin(i, dot), hold = oldhold; } /* * Open the line (logically) on the screen, and * update the screen tail. Unless we are really a delete * go off and gather up inserted characters. */ vcline++; if (vcline < 0) vcline = 0; vopen(dot, i); vsyncCL(); noteit(1); if (c != 'd') { if (ind >= 0) { cursor = linebuf; linebuf[0] = 0; vfixcurs(); } else { ind = 0; vcursat(cursor); } vappend('x', 1, ind); return; } if (*cursor == 0 && cursor > linebuf) cursor--; vrepaint(cursor); return; } smallchange: /* * The rest of this is just low level hacking on changes * of small numbers of characters. */ if (wcursor < linebuf) wcursor = linebuf; if (cursor == wcursor) { beep(); return; } i = vdcMID(); cp = cursor; if (state != HARDOPEN) vfixcurs(); /* * Put out the \\'s indicating changed text in hardcopy, * or mark the end of the change with $ if not hardcopy. */ if (state == HARDOPEN) bleep(i, cp); else { vcursbef(wcursor); putchar('$'); i = cindent(); } /* * Remember the deleted text for possible put, * and then prepare and execute the input portion of the change. */ cursor = cp; setDEL(); CP(cursor, wcursor); if (state != HARDOPEN) { vcursaft(cursor - 1); doomed = i - cindent(); } else { /* sethard(); wcursor = cursor; cursor = linebuf; vgoto(outline, value(NUMBER) << 3); vmove(); */ doomed = 0; } prepapp(); vappend('c', 1, 0); } /* * Open new lines. * * Tricky thing here is slowopen. This causes display updating * to be held off so that 300 baud dumb terminals don't lose badly. * This also suppressed counts, which otherwise say how many blank * space to open up. Counts are also suppressed on intelligent terminals. * Actually counts are obsoleted, since if your terminal is slow * you are better off with slowopen. */ voOpen(c, cnt) char c; register int cnt; { register int ind = 0, i; short oldhold = hold; if (value(SLOWOPEN) || value(REDRAW) && AL && DL) cnt = 1; vsave(); setLAST(); if (value(AUTOINDENT)) ind = whitecnt(linebuf); if (c == 'O') { vcline--; dot--; if (dot > zero) getDOT(); } if (value(AUTOINDENT)) { #ifdef LISPCODE if (value(LISP)) ind = lindent(dot + 1); #endif } killU(); prepapp(); if (FIXUNDO) vundkind = VMANY; if (state != VISUAL) c = WBOT + 1; else { c = vcline < 0 ? WTOP - cnt : LINE(vcline) + DEPTH(vcline); if (c < ZERO) c = ZERO; i = LINE(vcline + 1) - c; if (i < cnt && c <= WBOT && (!AL || !DL)) vinslin(c, cnt - i, vcline); } *genindent(ind) = 0; vdoappend(genbuf); vcline++; oldhold = hold; hold |= HOLDROL; vopen(dot, c); hold = oldhold; if (value(SLOWOPEN)) /* * Oh, so lazy! */ vscrap(); else vsync1(LINE(vcline)); cursor = linebuf; linebuf[0] = 0; vappend('o', 1, ind); } /* * > < and = shift operators. * * Note that =, which aligns lisp, is just a ragged sort of shift, * since it never distributes text between lines. */ char vshnam[2] = { 'x', 0 }; vshftop() { register line *addr; register int cnt; if ((cnt = xdw()) < 0) return; addr = dot; vremote(cnt, vshift, 0); vshnam[0] = op; notenam = vshnam; dot = addr; vreplace(vcline, cnt, cnt); if (state == HARDOPEN) vcnt = 0; vrepaint(NOSTR); } /* * !. * * Filter portions of the buffer through unix commands. */ vfilter() { register line *addr; register int cnt; char *oglobp, d; if ((cnt = xdw()) < 0) return; if (vglobp) vglobp = uxb; if (readecho('!')) return; oglobp = globp; globp = genbuf + 1; d = peekc; ungetchar(0); CATCH fixech(); unix0(0); ONERR splitw = 0; ungetchar(d); vrepaint(cursor); globp = oglobp; return; ENDCATCH ungetchar(d); globp = oglobp; addr = dot; CATCH vgoto(WECHO, 0); flusho(); vremote(cnt, filter, 2); ONERR vdirty(0, LINES); ENDCATCH if (dot == zero && dol > zero) dot = one; splitw = 0; notenam = ""; /* * BUG: we shouldn't be depending on what undap2 and undap1 are, * since we may be inside a macro. What's really wanted is the * number of lines we read from the filter. However, the mistake * will be an overestimate so it only results in extra work, * it shouldn't cause any real screwups. */ vreplace(vcline, cnt, undap2 - undap1); dot = addr; if (dot > dol) { dot--; vcline--; } vrepaint(NOSTR); } /* * Xdw exchanges dot and wdot if appropriate and also checks * that wdot is reasonable. Its name comes from * xchange dotand wdot */ xdw() { register char *cp; register int cnt; /* register int notp = 0; */ if (wdot == NOLINE || wdot < one || wdot > dol) { beep(); return (-1); } vsave(); setLAST(); if (dot > wdot) { register line *addr; vcline -= dot - wdot; addr = dot; dot = wdot; wdot = addr; cp = cursor; cursor = wcursor; wcursor = cp; } /* * If a region is specified but wcursor is at the begining * of the last line, then we move it to be the end of the * previous line (actually off the end). */ if (cursor && wcursor == linebuf && wdot > dot) { wdot--; getDOT(); if (vpastwh(linebuf) >= cursor) wcursor = 0; else { getline(*wdot); wcursor = strend(linebuf); getDOT(); } /* * Should prepare in caller for possible dot == wdot. */ } cnt = wdot - dot + 1; if (vreg) { vremote(cnt, YANKreg, vreg); /* if (notp) notpart(vreg); */ } /* * Kill buffer code. If delete operator is c or d, then save * the region in numbered buffers. * * BUG: This may be somewhat inefficient due * to the way named buffer are implemented, * necessitating some optimization. */ vreg = 0; if (any(op, "cd")) { vremote(cnt, YANKreg, '1'); /* if (notp) notpart('1'); */ } return (cnt); } /* * Routine for vremote to call to implement shifts. */ vshift() { shift(op, 1); } /* * Replace a single character with the next input character. * A funny kind of insert. */ vrep(cnt) register int cnt; { register int i, c; if (cnt > strlen(cursor)) { beep(); return; } i = column(cursor + cnt - 1); vcursat(cursor); doomed = i - cindent(); if (!vglobp) { c = getesc(); if (c == 0) { vfixcurs(); return; } ungetkey(c); } CP(vutmp, linebuf); if (FIXUNDO) vundkind = VCHNG; wcursor = cursor + cnt; vUD1 = cursor; vUD2 = wcursor; CP(cursor, wcursor); prepapp(); vappend('r', cnt, 0); *lastcp++ = INS[0]; setLAST(); } /* * Yank. * * Yanking to string registers occurs for free (essentially) * in the routine xdw(). */ vyankit() { register int cnt; if (wdot) { if ((cnt = xdw()) < 0) return; vremote(cnt, yank, 0); setpk(); notenam = "yank"; if (FIXUNDO) vundkind = VNONE; DEL[0] = 0; wdot = NOLINE; if (notecnt <= vcnt - vcline && notecnt < value(REPORT)) notecnt = 0; vrepaint(cursor); return; } takeout(DEL); } /* * Set pkill variables so a put can * know how to put back partial text. * This is necessary because undo needs the complete * line images to be saved, while a put wants to trim * the first and last lines. The compromise * is for put to be more clever. */ setpk() { if (wcursor) { pkill[0] = cursor; pkill[1] = wcursor; } } kind = VNONE; DEL[0] = 0; wdot = NOLINE; if (notecnt <= vcnt - vcline && notecnt < value(REPORT)) notecnt = 0; vrepaint(cursor); return; } takeout(DEL); } /* * Set pkill variables so a put can * know how to put back partial text. * This is necessary because undo needs the complete * line images to be saved, while a put wants to trim * ((cmd/ex/ex_vops2.c 444 0 33 44104 2425472371 7152 /* Copyright (c) 1980 Regents of the University of California */ static char *sccsid = "@(#)ex_vops2.c 6.2 10/23/80"; #include "ex.h" #include "ex_tty.h" #include "ex_vis.h" /* * Low level routines for operations sequences, * and mostly, insert mode (and a subroutine * to read an input line, including in the echo area.) */ char *vUA1, *vUA2; char *vUD1, *vUD2; /* * Obleeperate characters in hardcopy * open with \'s. */ bleep(i, cp) register int i; char *cp; { i -= column(cp); do putchar('\\' | QUOTE); while (--i >= 0); rubble = 1; } /* * Common code for middle part of delete * and change operating on parts of lines. */ vdcMID() { register char *cp; squish(); setLAST(); if (FIXUNDO) vundkind = VCHNG, CP(vutmp, linebuf); if (wcursor < cursor) cp = wcursor, wcursor = cursor, cursor = cp; vUD1 = vUA1 = vUA2 = cursor; vUD2 = wcursor; return (column(wcursor - 1)); } /* * Take text from linebuf and stick it * in the VBSIZE buffer BUF. Used to save * deleted text of part of line. */ takeout(BUF) char *BUF; { register char *cp; if (wcursor < linebuf) wcursor = linebuf; if (cursor == wcursor) { beep(); return; } if (wcursor < cursor) { cp = wcursor; wcursor = cursor; cursor = cp; } setBUF(BUF); if ((BUF[0] & (QUOTE|TRIM)) == OVERBUF) beep(); } /* * Are we at the end of the printed representation of the * line? Used internally in hardcopy open. */ ateopr() { register int i, c; register char *cp = vtube[destline] + destcol; for (i = WCOLS - destcol; i > 0; i--) { c = *cp++; if (c == 0) return (1); if (c != ' ' && (c & QUOTE) == 0) return (0); } return (1); } /* * Append. * * This routine handles the top level append, doing work * as each new line comes in, and arranging repeatability. * It also handles append with repeat counts, and calculation * of autoindents for new lines. */ bool vaifirst; bool gobbled; char *ogcursor; vappend(ch, cnt, indent) char ch; int cnt, indent; { register int i; register char *gcursor; bool escape; int repcnt, savedoomed; short oldhold = hold; /* * Before a move in hardopen when the line is dirty * or we are in the middle of the printed representation, * we retype the line to the left of the cursor so the * insert looks clean. */ if (ch != 'o' && state == HARDOPEN && (rubble || !ateopr())) { rubble = 1; gcursor = cursor; i = *gcursor; *gcursor = ' '; wcursor = gcursor; vmove(); *gcursor = i; } vaifirst = indent == 0; /* * Handle replace character by (eventually) * limiting the number of input characters allowed * in the vgetline routine. */ if (ch == 'r') repcnt = 2; else repcnt = 0; /* * If an autoindent is specified, then * generate a mixture of blanks to tabs to implement * it and place the cursor after the indent. * Text read by the vgetline routine will be placed in genbuf, * so the indent is generated there. */ if (value(AUTOINDENT) && indent != 0) { gcursor = genindent(indent); *gcursor = 0; vgotoCL(qcolumn(cursor - 1, genbuf)); } else { gcursor = genbuf; *gcursor = 0; if (ch == 'o') vfixcurs(); } /* * Prepare for undo. Pointers delimit inserted portion of line. */ vUA1 = vUA2 = cursor; /* * If we are not in a repeated command and a ^@ comes in * then this means the previous inserted text. * If there is none or it was too long to be saved, * then beep() and also arrange to undo any damage done * so far (e.g. if we are a change.) */ if ((vglobp && *vglobp == 0) || peekbr()) { if ((INS[0] & (QUOTE|TRIM)) == OVERBUF) { beep(); if (!splitw) ungetkey('u'); doomed = 0; hold = oldhold; return; } /* * Unread input from INS. * An escape will be generated at end of string. * Hold off n^^2 type update on dumb terminals. */ vglobp = INS; hold |= HOLDQIK; } else if (vglobp == 0) /* * Not a repeated command, get * a new inserted text for repeat. */ INS[0] = 0; /* * For wrapmargin to hack away second space after a '.' * when the first space caused a line break we keep * track that this happened in gobblebl, which says * to gobble up a blank silently. */ gobblebl = 0; /* * Text gathering loop. * New text goes into genbuf starting at gcursor. * cursor preserves place in linebuf where text will eventually go. */ if (*cursor == 0 || state == CRTOPEN) hold |= HOLDROL; for (;;) { if (ch == 'r' && repcnt == 0) escape = 0; else { gcursor = vgetline(repcnt, gcursor, &escape, ch); /* * After an append, stick information * about the ^D's and ^^D's and 0^D's in * the repeated text buffer so repeated * inserts of stuff indented with ^D as backtab's * can work. */ if (HADUP) addtext("^"); else if (HADZERO) addtext("0"); while (CDCNT > 0) addtext("\204"), CDCNT--; if (gobbled) addtext(" "); addtext(ogcursor); } repcnt = 0; /* * Smash the generated and preexisting indents together * and generate one cleanly made out of tabs and spaces * if we are using autoindent. */ if (!vaifirst && value(AUTOINDENT)) { i = fixindent(indent); if (!HADUP) indent = i; gcursor = strend(genbuf); } /* * Limit the repetition count based on maximum * possible line length; do output implied * by further count (> 1) and cons up the new line * in linebuf. */ cnt = vmaxrep(ch, cnt); CP(gcursor + 1, cursor); do { CP(cursor, genbuf); if (cnt > 1) { int oldhold = hold; Outchar = vinschar; hold |= HOLDQIK; printf("%s", genbuf); hold = oldhold; Outchar = vputchar; } cursor += gcursor - genbuf; } while (--cnt > 0); endim(); vUA2 = cursor; if (escape != '\n') CP(cursor, gcursor + 1); /* * If doomed characters remain, clobber them, * and reopen the line to get the display exact. */ if (state != HARDOPEN) { DEPTH(vcline) = 0; savedoomed = doomed; if (doomed > 0) { register int cind = cindent(); physdc(cind, cind + doomed); doomed = 0; } i = vreopen(LINE(vcline), lineDOT(), vcline); #ifdef TRACE if (trace) fprintf(trace, "restoring doomed from %d to %d\n", doomed, savedoomed); #endif if (ch == 'R') doomed = savedoomed; } /* * All done unless we are continuing on to another line. */ if (escape != '\n') break; /* * Set up for the new line. * First save the current line, then construct a new * first image for the continuation line consisting * of any new autoindent plus the pushed ahead text. */ killU(); addtext(gobblebl ? " " : "\n"); vsave(); cnt = 1; if (value(AUTOINDENT)) { #ifdef LISPCODE if (value(LISP)) indent = lindent(dot + 1); else #endif if (!HADUP && vaifirst) indent = whitecnt(linebuf); vaifirst = 0; strcLIN(vpastwh(gcursor + 1)); gcursor = genindent(indent); *gcursor = 0; if (gcursor + strlen(linebuf) > &genbuf[LBSIZE - 2]) gcursor = genbuf; CP(gcursor, linebuf); } else { CP(genbuf, gcursor + 1); gcursor = genbuf; } /* * If we started out as a single line operation and are now * turning into a multi-line change, then we had better yank * out dot before it changes so that undo will work * correctly later. */ if (FIXUNDO && vundkind == VCHNG) { vremote(1, yank, 0); undap1--; } /* * Now do the append of the new line in the buffer, * and update the display. If slowopen * we don't do very much. */ vdoappend(genbuf); vundkind = VMANYINS; vcline++; if (state != VISUAL) vshow(dot, NOLINE); else { i += LINE(vcline - 1); vopen(dot, i); if (value(SLOWOPEN)) vscrap(); else vsync1(LINE(vcline)); } strcLIN(gcursor); *gcursor = 0; cursor = linebuf; vgotoCL(qcolumn(cursor - 1, genbuf)); } /* * All done with insertion, position the cursor * and sync the screen. */ hold = oldhold; if (cursor > linebuf) cursor--; if (state != HARDOPEN) vsyncCL(); else if (cursor > linebuf) back1(); doomed = 0; wcursor = cursor; vmove(); } /* * Subroutine for vgetline to back up a single character position, * backwards around end of lines (vgoto can't hack columns which are * less than 0 in general). */ back1() { vgoto(destline - 1, WCOLS + destcol - 1); } /* * Get a line into genbuf after gcursor. * Cnt limits the number of input characters * accepted and is used for handling the replace * single character command. Aescaped is the location * where we stick a termination indicator (whether we * ended with an ESCAPE or a newline/return. * * We do erase-kill type processing here and also * are careful about the way we do this so that it is * repeatable. (I.e. so that your kill doesn't happen, * when you repeat an insert if it was escaped with \ the * first time you did it. commch is the command character * involved, including the prompt for readline. */ char * vgetline(cnt, gcursor, aescaped, commch) int cnt; register char *gcursor; bool *aescaped; char commch; { register int c, ch; register char *cp; int x, y, iwhite, backsl=0; char *iglobp; char cstr[2]; int (*OO)() = Outchar; /* * Clear the output state and counters * for autoindent backwards motion (counts of ^D, etc.) * Remember how much white space at beginning of line so * as not to allow backspace over autoindent. */ *aescaped = 0; ogcursor = gcursor; flusho(); CDCNT = 0; HADUP = 0; HADZERO = 0; gobbled = 0; iwhite = whitecnt(genbuf); iglobp = vglobp; /* * Carefully avoid using vinschar in the echo area. */ if (splitw) Outchar = vputchar; else { Outchar = vinschar; vprepins()((; } for (;;) { backsl = 0; if (gobblebl) gobblebl--; if (cnt != 0) { cnt--; if (cnt == 0) goto vadone; } c = getkey(); if (c != ATTN) c &= (QUOTE|TRIM); ch = c; maphopcnt = 0; if (vglobp == 0 && Peekkey == 0 && commch != 'r') while ((ch = map(c, immacs)) != c) { c = ch; if (!value(REMAP)) break; if (++maphopcnt > 256) error("Infinite macro loop"); } if (!iglobp) { /* * Erase-kill type processing. * Only happens if we were not reading * from untyped input when we started. * Map users erase to ^H, kill to -1 for switch. */ #ifndef USG3TTY if (c == tty.sg_erase) c = CTRL(h); else if (c == tty.sg_kill) c = -1; #else if (c == tty.c_cc[VERASE]) c = CTRL(h); else if (c == tty.c_cc[VKILL]) c = -1; #endif switch (c) { /* * ^? Interrupt drops you back to visual * command mode with an unread interrupt * still in the input buffer. * * ^\ Quit does the same as interrupt. * If you are a ex command rather than * a vi command this will drop you * back to command mode for sure. */ case ATTN: case QUIT: ungetkey(c); goto vadone; /* * ^H Backs up a character in the input. * * BUG: Can't back around line boundaries. * This is hard because stuff has * already been saved for repeat. */ case CTRL(h): bakchar: cp = gcursor - 1; if (cp < ogcursor) { if (splitw) { /* * Backspacing over readecho * prompt. Pretend delete but * don't beep. */ ungetkey(c); goto vadone; } beep(); continue; } goto vbackup; /* * ^W Back up a white/non-white word. */ case CTRL(w): wdkind = 1; for (cp = gcursor; cp > ogcursor && isspace(cp[-1]); cp--) continue; for (c = wordch(cp - 1); cp > ogcursor && wordof(c, cp - 1); cp--) continue; goto vbackup; /* * users kill Kill input on this line, back to * the autoindent. */ case -1: cp = ogcursor; vbackup: if (cp == gcursor) { beep(); continue; } endim(); *cp = 0; c = cindent(); vgotoCL(qcolumn(cursor - 1, genbuf)); if (doomed >= 0) doomed += c - cindent(); gcursor = cp; continue; /* * \ Followed by erase or kill * maps to just the erase or kill. */ case '\\': x = destcol, y = destline; putchar('\\'); vcsync(); c = getkey(); #ifndef USG3TTY if (c == tty.sg_erase || c == tty.sg_kill) #else if (c == tty.c_cc[VERASE] || c == tty.c_cc[VKILL]) #endif { vgoto(y, x); if (doomed >= 0) doomed++; goto def; } ungetkey(c), c = '\\'; backsl = 1; break; /* * ^Q Super quote following character * Only ^@ is verboten (trapped at * a lower level) and \n forces a line * split so doesn't really go in. * * ^V Synonym for ^Q */ case CTRL(q): case CTRL(v): x = destcol, y = destline; putchar('^'); vgoto(y, x); c = getkey(); #ifdef TIOCSETC if (c == ATTN) c = nttyc.t_intrc; #endif if (c != NL) { if (doomed >= 0) doomed++; goto def; } break; } } /* * If we get a blank not in the echo area * consider splitting the window in the wrapmargin. */ if (c != NL && !splitw) { if (c == ' ' && gobblebl) { gobbled = 1; continue; } if (value(WRAPMARGIN) && (outcol >= OCOLUMNS - value(WRAPMARGIN) || backsl && outcol==0) && commch != 'r') { /* * At end of word and hit wrapmargin. * Move the word to next line and keep going. */ wdkind = 1; *gcursor++ = c; if (backsl) *gcursor++ = getkey(); *gcursor = 0; /* * Find end of previous word if we are past it. */ for (cp=gcursor; cp>ogcursor && isspace(cp[-1]); cp--) ; if (outcol+(backsl?OCOLUMNS:0) - (gcursor-cp) >= OCOLUMNS - value(WRAPMARGIN)) { /* * Find beginning of previous word. */ for (; cp>ogcursor && !isspace(cp[-1]); cp--) ; if (cp <= ogcursor) { /* * There is a single word that * is too long to fit. Just * let it pass, but beep for * each new letter to warn * the luser. */ c = *--gcursor; *gcursor = 0; beep(); goto dontbreak; } /* * Save it for next line. */ macpush(cp, 0); cp--; } macpush("\n", 0); /* * Erase white space before the word. */ while (cp > ogcursor && isspace(cp[-1])) cp--; /* skip blank */ gobblebl = 3; goto vbackup; } dontbreak:; } /* * Word abbreviation mode. */ cstr[0] = c; if (anyabbrs && gcursor > ogcursor && !wordch(cstr) && wordch(gcursor-1)) { int wdtype, abno; cstr[1] = 0; wdkind = 1; cp = gcursor - 1; for (wdtype = wordch(cp - 1); cp > ogcursor && wordof(wdtype, cp - 1); cp--) ; *gcursor = 0; for (abno=0; abbrevs[abno].mapto; abno++) { if (eq(cp, abbrevs[abno].cap)) { macpush(cstr, 0); macpush(abbrevs[abno].mapto); goto vbackup; } } } switch (c) { /* * ^M Except in repeat maps to \n. */ case CR: if (vglobp) goto def; c = '\n'; /* presto chango ... */ /* * \n Start new line. */ case NL: *aescaped = c; goto vadone; /* * escape End insert unless repeat and more to repeat. */ case ESCAPE: if (lastvgk) goto def; goto vadone; /* * ^D Backtab. * ^T Software forward tab. * * Unless in repeat where this means these * were superquoted in. */ case CTRL(d): case CTRL(t): if (vglobp) goto def; /* fall into ... */ /* * ^D|QUOTE Is a backtab (in a repeated command). */ case CTRL(d) | QUOTE: *gcursor = 0; cp = vpastwh(genbuf); c = whitecnt(genbuf); if (ch == CTRL(t)) { /* * ^t just generates new indent replacing * current white space rounded up to soft * tab stop increment. */ if (cp != gcursor) /* * BUG: Don't hack ^T except * right after initial * white space. */ continue; cp = genindent(iwhite = backtab(c + value(SHIFTWIDTH) + 1)); ogcursor = cp; goto vbackup; } /* * ^D works only if we are at the (end of) the * generated autoindent. We count the ^D for repeat * purposes. */ if (c == iwhite && c != 0) if (cp == gcursor) { iwhite = backtab(c); CDCNT++; ogcursor = cp = genindent(iwhite); goto vbackup; } else if (&cp[1] == gcursor && (*cp == '^' || *cp == '0')) { /* * ^^D moves to margin, then back * to current indent on next line. * * 0^D moves to margin and then * stays there. */ HADZERO = *cp == '0'; ogcursor = cp = genbuf; HADUP = 1 - HADZERO; CDCNT = 1; endim(); back1(); vputchar(' '); goto vbackup; } if (vglobp && vglobp - iglobp >= 2 && (vglobp[-2] == '^' || vglobp[-2] == '0') && gcursor == ogcursor + 1) goto bakchar; continue; default: /* * Possibly discard control inputs. */ if (!vglobp && junk(c)) { beep(); continue; } def: if (!backsl) { putchar(c); flush(); } if (gcursor > &genbuf[LBSIZE - 2]) error("Line too long"); *gcursor++ = c & TRIM; vcsync(); if (value(SHOWMATCH) && !iglobp) if (c == ')' || c == '}') lsmatch(gcursor); continue; } } vadone: *gcursor = 0; if (Outchar != termchar) Outchar = OO; endim(); return (gcursor); } int vgetsplit(); char *vsplitpt; /* * Append the line in buffer at lp * to the buffer after dot. */ vdoappend(lp) char *lp; { register int oing = inglobal; vsplitpt = lp; inglobal = 1; ignore(append(vgetsplit, dot)); inglobal = oing; } /* * Subroutine for vdoappend to pass to append. */ vgetsplit() { if (vsplitpt == 0) return (EOF); strcLIN(vsplitpt); vsplitpt = 0; return (0); } /* * Vmaxrep determines the maximum repetitition factor * allowed that will yield total line length less than * LBSIZE characters and also does hacks for the R command. */ vmaxrep(ch, cnt) char ch; register int cnt; { register int len, replen; if (cnt > LBSIZE - 2) cnt = LBSIZE - 2; replen = strlen(genbuf); if (ch == 'R') { len = strlen(cursor); if (replen < len) len = replen; CP(cursor, cursor + len); vUD2 += len; } len = strlen(linebuf); if (len + cnt * replen <= LBSIZE - 2) return (cnt); cnt = (LBSIZE - 2 - len) / replen; if (cnt == 0) { vsave(); error("Line too long"); } return (cnt); } haracters and also does hacks for the R command. */ vmaxrep(ch, cnt) char ch; register int cnt; { register int len, replen; if (cnt > LBSIZE - 2) cnt = LBSIZE - 2; replen = strlen(genbuf); if (ch == 'R') { len = strlen(cursor); if (replen < len) len = replen; CP(cursor, cursor + len); vUD2 += len; } len = strlen(linebuf); if (len + cnt * replen <= LBSIZE - 2) return (cnt); cnt = (LBSIZE - 2 - len) / replen; if (ccmd/ex/ex_vops3.c 444 0 33 23044 2425472377 7161 /* Copyright (c) 1980 Regents of the University of California */ static char *sccsid = "@(#)ex_vops3.c 6.2 10/23/80"; #include "ex.h" #include "ex_tty.h" #include "ex_vis.h" /* * Routines to handle structure. * Operations supported are: * ( ) { } [ ] * * These cover: LISP TEXT * ( ) s-exprs sentences * { } list at same paragraphs * [ ] defuns sections * * { and } for C used to attempt to do something with matching {}'s, but * I couldn't find definitions which worked intuitively very well,(( so I * scrapped this. * * The code here is very hard to understand. */ line *llimit; int (*lf)(); #ifdef LISPCODE int lindent(); #endif bool wasend; /* * Find over structure, repeated count times. * Don't go past line limit. F is the operation to * be performed eventually. If pastatom then the user said {} * rather than (), implying past atoms in a list (or a paragraph * rather than a sentence. */ lfind(pastatom, cnt, f, limit) bool pastatom; int cnt, (*f)(); line *limit; { register int c; register int rc = 0; char save[LBSIZE]; /* * Initialize, saving the current line buffer state * and computing the limit; a 0 argument means * directional end of file. */ wasend = 0; lf = f; strcpy(save, linebuf); if (limit == 0) limit = dir < 0 ? one : dol; llimit = limit; wdot = dot; wcursor = cursor; if (pastatom >= 2) { while (cnt > 0 && word(f, cnt)) cnt--; if (pastatom == 3) eend(f); if (dot == wdot) { wdot = 0; if (cursor == wcursor) rc = -1; } } #ifdef LISPCODE else if (!value(LISP)) { #else else { #endif char *icurs; line *idot; if (linebuf[0] == 0) { do if (!lnext()) goto ret; while (linebuf[0] == 0); if (dir > 0) { wdot--; linebuf[0] = 0; wcursor = linebuf; /* * If looking for sentence, next line * starts one. */ if (!pastatom) { icurs = wcursor; idot = wdot; goto begin; } } } icurs = wcursor; idot = wdot; /* * Advance so as to not find same thing again. */ if (dir > 0) { if (!lnext()) { rc = -1; goto ret; } } else ignore(lskipa1("")); /* * Count times find end of sentence/paragraph. */ begin: for (;;) { while (!endsent(pastatom)) if (!lnext()) goto ret; if (!pastatom || wcursor == linebuf && endPS()) if (--cnt <= 0) break; if (linebuf[0] == 0) { do if (!lnext()) goto ret; while (linebuf[0] == 0); } else if (!lnext()) goto ret; } /* * If going backwards, and didn't hit the end of the buffer, * then reverse direction. */ if (dir < 0 && (wdot != llimit || wcursor != linebuf)) { dir = 1; llimit = dot; /* * Empty line needs special treatement. * If moved to it from other than begining of next line, * then a sentence starts on next line. */ if (linebuf[0] == 0 && !pastatom && (wdot != dot - 1 || cursor != linebuf)) { lnext(); goto ret; } } /* * If we are not at a section/paragraph division, * advance to next. */ if (wcursor == icurs && wdot == idot || wcursor != linebuf || !endPS()) ignore(lskipa1("")); } #ifdef LISPCODE else { c = *wcursor; /* * Startup by skipping if at a ( going left or a ) going * right to keep from getting stuck immediately. */ if (dir < 0 && c == '(' || dir > 0 && c == ')') { if (!lnext()) { rc = -1; goto ret; } } /* * Now chew up repitition count. Each time around * if at the beginning of an s-exp (going forwards) * or the end of an s-exp (going backwards) * skip the s-exp. If not at beg/end resp, then stop * if we hit a higher level paren, else skip an atom, * counting it unless pastatom. */ while (cnt > 0) { c = *wcursor; if (dir < 0 && c == ')' || dir > 0 && c == '(') { if (!lskipbal("()")) goto ret; /* * Unless this is the last time going * backwards, skip past the matching paren * so we don't think it is a higher level paren. */ if (dir < 0 && cnt == 1) goto ret; if (!lnext() || !ltosolid()) goto ret; --cnt; } else if (dir < 0 && c == '(' || dir > 0 && c == ')') /* Found a higher level paren */ goto ret; else { if (!lskipatom()) goto ret; if (!pastatom) --cnt; } } } #endif ret: strcLIN(save); return (rc); } /* * Is this the end of a sentence? */ endsent(pastatom) bool pastatom; { register char *cp = wcursor; register int c, d; /* * If this is the beginning of a line, then * check for the end of a paragraph or section. */ if (cp == linebuf) return (endPS()); /* * Sentences end with . ! ? not at the beginning * of the line, and must be either at the end of the line, * or followed by 2 spaces. Any number of intervening ) ] ' " * characters are allowed. */ if (!any(c = *cp, ".!?")) goto tryps; do if ((d = *++cp) == 0) return (1); while (any(d, ")]'")); if (*cp == 0 || *cp++ == ' ' && *cp == ' ') return (1); tryps: if (cp[1] == 0) return (endPS()); return (0); } /* * End of paragraphs/sections are respective * macros as well as blank lines and form feeds. */ endPS() { return (linebuf[0] == 0 || isa(svalue(PARAGRAPHS)) || isa(svalue(SECTIONS))); } #ifdef LISPCODE lindent(addr) line *addr; { register int i; char *swcurs = wcursor; line *swdot = wdot; again: if (addr > one) { register char *cp; register int cnt = 0; addr--; getline(*addr); for (cp = linebuf; *cp; cp++) if (*cp == '(') cnt++; else if (*cp == ')') cnt--; cp = vpastwh(linebuf); if (*cp == 0) goto again; if (cnt == 0) return (whitecnt(linebuf)); addr++; } wcursor = linebuf; linebuf[0] = 0; wdot = addr; dir = -1; llimit = one; lf = lindent; if (!lskipbal("()")) i = 0; else if (wcursor == linebuf) i = 2; else { register char *wp = wcursor; dir = 1; llimit = wdot; if (!lnext() || !ltosolid() || !lskipatom()) { wcursor = wp; i = 1; } else i = 0; i += column(wcursor) - 1; if (!inopen) i--; } wdot = swdot; wcursor = swcurs; return (i); } #endif lmatchp(addr) line *addr; { register int i; register char *parens, *cp; for (cp = cursor; !any(*cp, "({[)}]");) if (*cp++ == 0) return (0); lf = 0; parens = any(*cp, "()") ? "()" : any(*cp, "[]") ? "[]" : "{}"; if (*cp == parens[1]) { dir = -1; llimit = one; } else { dir = 1; llimit = dol; } if (addr) llimit = addr; if (splitw) llimit = dot; wcursor = cp; wdot = dot; i = lskipbal(parens); return (i); } lsmatch(cp) char *cp; { char save[LBSIZE]; register char *sp = save; register char *scurs = cursor; wcursor = cp; strcpy(sp, linebuf); *wcursor = 0; strcpy(cursor, genbuf); cursor = strend(linebuf) - 1; if (lmatchp(dot - vcline)) { register int i = insmode; register int c = outcol; register int l = outline; if (!MI) endim(); vgoto(splitw ? WECHO : LINE(wdot - llimit), column(wcursor) - 1); flush(); sleep(1); vgoto(l, c); if (i) goim(); } else { strcLIN(sp); strcpy(scurs, genbuf); if (!lmatchp((line *) 0)) beep(); } strcLIN(sp); wdot = 0; wcursor = 0; cursor = scurs; } ltosolid() { return (ltosol1("()")); } ltosol1(parens) register char *parens; { register char *cp; if (*parens && !*wcursor && !lnext()) return (0); while (isspace(*wcursor) || (*wcursor == 0 && *parens)) if (!lnext()) return (0); if (any(*wcursor, parens) || dir > 0) return (1); for (cp = wcursor; cp > linebuf; cp--) if (isspace(cp[-1]) || any(cp[-1], parens)) break; wcursor = cp; return (1); } lskipbal(parens) register char *parens; { register int level = dir; register int c; do { if (!lnext()) { wdot = NOLINE; return (0); } c = *wcursor; if (c == parens[1]) level--; else if (c == parens[0]) level++; } while (level); return (1); } lskipatom() { return (lskipa1("()")); } lskipa1(parens) register char *parens; { register int c; for (;;) { if (dir < 0 && wcursor == linebuf) { if (!lnext()) return (0); break; } c = *wcursor; if (c && (isspace(c) || any(c, parens))) break; if (!lnext()) return (0); if (dir > 0 && wcursor == linebuf) break; } return (ltosol1(parens)); } lnext() { if (dir > 0) { if (*wcursor) wcursor++; if (*wcursor) return (1); if (wdot >= llimit) { if (lf == vmove && wcursor > linebuf) wcursor--; return (0); } wdot++; getline(*wdot); wcursor = linebuf; return (1); } else { --wcursor; if (wcursor >= linebuf) return (1); #ifdef LISPCODE if (lf == lindent && linebuf[0] == '(') llimit = wdot; #endif if (wdot <= llimit) { wcursor = linebuf; return (0); } wdot--; getline(*wdot); wcursor = linebuf[0] == 0 ? linebuf : strend(linebuf) - 1; return (1); } } lbrack(c, f) register int c; int (*f)(); { register line *addr; addr = dot; for (;;) { addr += dir; if (addr < one || addr > dol) { addr -= dir; break; } getline(*addr); if (linebuf[0] == '{' || #ifdef LISPCODE value(LISP) && linebuf[0] == '(' || #endif isa(svalue(SECTIONS))) { if (c == ']' && f != vmove) { addr--; getline(*addr); } break; } if (c == ']' && f != vmove && linebuf[0] == '}') break; } if (addr == dot) return (0); if (f != vmove) wcursor = c == ']' ? strend(linebuf) : linebuf; else wcursor = 0; wdot = addr; vmoving = 0; return (1); } isa(cp) register char *cp; { if (linebuf[0] != '.') return (0); for (; cp[0] && cp[1]; cp += 2) if (linebuf[1] == cp[0]) { if (linebuf[2] == cp[1]) return (1); if (linebuf[2] == 0 && cp[1] == ' ') return (1); } return (0); } etline(*addr); } break; } if (c == ']' && f != vmove && linebuf[0] == '}') break; } if (addr == dot) return (0); if (f != vmove) wcursor = c == ']' ? strend(linebuf) : linebuf; else wcursor = 0; wdot = addr; vmoving = 0; return (1); } isa(cp) register char *cp; { if (linebuf[0] != '.') return (0); for (; cp[0] && cp[1]; cp += 2) if (linebuf[1] == cp[0]) { if (linebuf[2] == cp[1]) return (1); if (linebuf[2] == 0 && cp[1] == ' ')cmd/ex/ex_vput.c 444 0 33 73157 2425426313 7104 ((/* Copyright (c) 1980 Regents of the University of California */ static char *sccsid = "@(#)ex_vput.c 6.1 10/18/80"; #include "ex.h" #include "ex_tty.h" #include "ex_vis.h" /* * Deal with the screen, clearing, cursor positioning, putting characters * into the screen image, and deleting characters. * Really hard stuff here is utilizing insert character operations * on intelligent terminals which differs widely from terminal to terminal. */ vclear() { #ifdef ADEBUG if (trace) tfixnl(), fprintf(trace, "------\nvclear\n"); #endif tputs(CL, LINES, putch); destcol = 0; outcol = 0; destline = 0; outline = 0; if (inopen) vclrbyte(vtube0, WCOLS * (WECHO - ZERO + 1)); } /* * Clear memory. */ vclrbyte(cp, i) register char *cp; register int i; { if (i > 0) do *cp++ = 0; while (--i != 0); } /* * Clear a physical display line, high level. */ vclrlin(l, tp) int l; line *tp; { vigoto(l, 0); if ((hold & HOLDAT) == 0) putchar(tp > dol ? ((UPPERCASE || HZ) ? '^' : '~') : '@'); if (state == HARDOPEN) sethard(); vclreol(); } /* * Clear to the end of the current physical line */ vclreol() { register int i, j; register char *tp; if (destcol == WCOLS) return; destline += destcol / WCOLS; destcol %= WCOLS; if (destline < 0 || destline > WECHO) error("Internal error: vclreol"); i = WCOLS - destcol; tp = vtube[destline] + destcol; if (CE) { if (IN && *tp || !ateopr()) { vcsync(); vputp(CE, 1); } vclrbyte(tp, i); return; } if (*tp == 0) return; while (i > 0 && (j = *tp & (QUOTE|TRIM))) { if (j != ' ' && (j & QUOTE) == 0) { destcol = WCOLS - i; vputchar(' '); } --i, *tp++ = 0; } } /* * Clear the echo line. * If didphys then its been cleared physically (as * a side effect of a clear to end of display, e.g.) * so just do it logically. * If work here is being held off, just remember, in * heldech, if work needs to be done, don't do anything. */ vclrech(didphys) bool didphys; { if (Peekkey == ATTN) return; if (hold & HOLDECH) { heldech = !didphys; return; } if (!didphys && (CD || CE)) { splitw++; /* * If display is retained below, then MUST use CD or CE * since we don't really know whats out there. * Vigoto might decide (incorrectly) to do nothing. */ if (DB) { vgoto(WECHO, 0); vputp(CD ? CD : CE, 1); } else { if (XT) { /* * This code basically handles the t1061 * where positioning at (0, 0) won't work * because the terminal won't let you put * the cursor on it's magic cookie. * * Should probably be XS above, or even a * new X? glitch, but right now t1061 is the * only terminal with XT. */ vgoto(WECHO, 0); vputp(DL, 1); } else { vigoto(WECHO, 0); vclreol(); } } splitw = 0; didphys = 1; } if (didphys) vclrbyte(vtube[WECHO], WCOLS); heldech = 0; } /* * Fix the echo area for use, setting * the state variable splitw so we wont rollup * when we move the cursor there. */ fixech() { splitw++; if (state != VISUAL && state != CRTOPEN) { vclean(); vcnt = 0; } vgoto(WECHO, 0); flusho(); } /* * Put the cursor ``before'' cp. */ vcursbef(cp) register char *cp; { if (cp <= linebuf) vgotoCL(value(NUMBER) << 3); else vgotoCL(column(cp - 1) - 1); } /* * Put the cursor ``at'' cp. */ vcursat(cp) register char *cp; { if (cp <= linebuf && linebuf[0] == 0) vgotoCL(value(NUMBER) << 3); else vgotoCL(column(cp - 1)); } /* * Put the cursor ``after'' cp. */ vcursaft(cp) register char *cp; { vgotoCL(column(cp)); } /* * Fix the cursor to be positioned in the correct place * to accept a command. */ vfixcurs() { vsetcurs(cursor); } /* * Compute the column position implied by the cursor at ``nc'', * and move the cursor there. */ vsetcurs(nc) register char *nc; { register int col; col = column(nc); if (linebuf[0]) col--; vgotoCL(col); cursor = nc; } /* * Move the cursor invisibly, i.e. only remember to do it. */ vigoto(y, x) int y, x; { destline = y; destcol = x; } /* * Move the cursor to the position implied by any previous * vigoto (or low level hacking with destcol/destline as in readecho). */ vcsync() { vgoto(destline, destcol); } /* * Goto column x of the current line. */ vgotoCL(x) register int x; { if (splitw) vgoto(WECHO, x); else vgoto(LINE(vcline), x); } /* * Invisible goto column x of current line. */ vigotoCL(x) register int x; { if (splitw) vigoto(WECHO, x); else vigoto(LINE(vcline), x); } /* * Move cursor to line y, column x, handling wraparound and scrolling. */ vgoto(y, x) register int y, x; { register char *tp; register int c; /* * Fold the possibly too large value of x. */ if (x >= WCOLS) { y += x / WCOLS; x %= WCOLS; } if (y < 0) error("Internal error: vgoto"); if (outcol >= WCOLS) { if (AM) { outline += outcol / WCOLS; outcol %= WCOLS; } else outcol = WCOLS - 1; } /* * In a hardcopy or glass crt open, print the stuff * implied by a motion, or backspace. */ if (state == HARDOPEN || state == ONEOPEN) { if (y != outline) error("Line too long for open"); if (x + 1 < outcol - x || (outcol > x && !BS)) destcol = 0, fgoto(); tp = vtube[WBOT] + outcol; while (outcol != x) if (outcol < x) { if (*tp == 0) *tp = ' '; c = *tp++ & TRIM; vputc(c && (!OS || EO) ? c : ' '), outcol++; } else { if (BC) vputp(BC, 0); else vputc('\b'); outcol--; } destcol = outcol = x; destline = outline; return; } /* * If the destination position implies a scroll, do it. */ destline = y; if (destline > WBOT && (!splitw || destline > WECHO)) { endim(); vrollup(destline); } /* * If there really is a motion involved, do it. * The check here is an optimization based on profiling. */ destcol = x; if ((destline - outline) * WCOLS != destcol - outcol) { if (!MI) endim(); fgoto(); } } /* * This is the hardest code in the editor, and deals with insert modes * on different kinds of intelligent terminals. The complexity is due * to the cross product of three factors: * * 1. Lines may display as more than one segment on the screen. * 2. There are 2 kinds of intelligent terminal insert modes. * 3. Tabs squash when you insert characters in front of them, * in a way in which current intelligent terminals don't handle. * * The two kinds of terminals are typified by the DM2500 or HP2645 for * one and the CONCEPT-100 or the FOX for the other. * * The first (HP2645) kind has an insert mode where the characters * fall off the end of the line and the screen is shifted rigidly * no matter how the display came about. * * The second (CONCEPT-100) kind comes from terminals which are designed * for forms editing and which distinguish between blanks and ``spaces'' * on the screen, spaces being like blank, but never having had * and data typed into that screen position (since, e.g. a clear operation * like clear screen). On these terminals, when you insert a character, * the characters from where you are to the end of the screen shift * over till a ``space'' is found, and the null character there gets * eaten up. * * * The code here considers the line as consisting of several parts * the first part is the ``doomed'' part, i.e. a part of the line * which is being typed over. Next comes some text up to the first * following tab. The tab is the next segment of the line, and finally * text after the tab. * * We have to consider each of these segments and the effect of the * insertion of a character on them. On terminals like HP2645's we * must simulate a multi-line insert mode using the primitive one * line insert mode. If we are inserting in front of a tab, we have * to either delete characters from the tab or insert white space * (when the tab reaches a new spot where it gets larger) before we * insert the new character. * * On a terminal like a CONCEPT our strategy is to make all * blanks be displayed, while trying to keep the screen having ``spaces'' * for portions of tabs. In this way the terminal hardward does some * of the hacking for compression of tabs, although this tends to * disappear as you work on the line and spaces change into blanks. * * There are a number of boundary conditions (like typing just before * the first following tab) where we can avoid a lot of work. Most * of them have to be dealt with explicitly because performance is * much, much worse if we don't. * * A final thing which is hacked here is two flavors of insert mode. * Datamedia's do this by an insert mode which you enter and leave * and by having normal motion character operate differently in this * mode, notably by having a newline insert a line on the screen in * this mode. This generally means it is unsafe to move around * the screen ignoring the fact that we are in this mode. * This is possible on some terminals, and wins big (e.g. HP), so * we encode this as a ``can move in insert capability'' mi, * and terminals which have it can do insert mode with much less * work when tabs are present following the cursor on the current line. */ /* * Routine to expand a tab, calling the normal Outchar routine * to put out each implied character. Note that we call outchar * with a QUOTE. We use QUOTE internally to represent a position * which is part of the expansion of a tab. */ vgotab() { register int i = tabcol(destcol, value(TABSTOP)) - destcol; do (*Outchar)(QUOTE); while (--i); } /* * Variables for insert mode. */ int linend; /* The column position of end of line */ int tabstart; /* Column of start of first following tab */ int tabend; /* Column of end of following tabs */ int tabsize; /* Size of the following tabs */ int tabslack; /* Number of ``spaces'' in following tabs */ int inssiz; /* Number of characters to be inserted */ int inscol; /* Column where insertion is taking place */ int shft; /* Amount tab expansion shifted rest of line */ int slakused; /* This much of tabslack will be used up */ /* * This routine MUST be called before insert mode is run, * and brings all segments of the current line to the to((p * of the screen image buffer so it is easier for us to * maniuplate them. */ vprepins() { register int i; register char *cp = vtube0; for (i = 0; i < DEPTH(vcline); i++) { vmaktop(LINE(vcline) + i, cp); cp += WCOLS; } } vmaktop(p, cp) register int p; char *cp; { register int i; char temp[TUBECOLS]; if (p < 0 || vtube[p] == cp) return; for (i = ZERO; i <= WECHO; i++) if (vtube[i] == cp) { copy(temp, vtube[i], WCOLS); copy(vtube[i], vtube[p], WCOLS); copy(vtube[p], temp, WCOLS); vtube[i] = vtube[p]; vtube[p] = cp; return; } error("Line too long"); } /* * Insert character c at current cursor position. * Multi-character inserts occur only as a result * of expansion of tabs (i.e. inssize == 1 except * for tabs) and code assumes this in several place * to make life simpler. */ vinschar(c) char c; { register int i; register char *tp; if ((!IM || !EI) && ((hold & HOLDQIK) || !value(REDRAW) || value(SLOWOPEN))) { /* * Don't want to try to use terminal * insert mode, or to try to fake it. * Just put the character out; the screen * will probably be wrong but we will fix it later. */ if (c == '\t') { vgotab(); return; } vputchar(c); if (DEPTH(vcline) * WCOLS + !value(REDRAW) > (destline - LINE(vcline)) * WCOLS + destcol) return; /* * The next line is about to be clobbered * make space for another segment of this line * (on an intelligent terminal) or just remember * that next line was clobbered (on a dumb one * if we don't care to redraw the tail. */ if (AL) { vnpins(0); } else { c = LINE(vcline) + DEPTH(vcline); if (c < LINE(vcline + 1) || c > WBOT) return; i = destcol; vinslin(c, 1, vcline); DEPTH(vcline)++; vigoto(c, i); vprepins(); } return; } /* * Compute the number of positions in the line image of the * current line. This is done from the physical image * since that is faster. Note that we have no memory * from insertion to insertion so that routines which use * us don't have to worry about moving the cursor around. */ if (*vtube0 == 0) linend = 0; else { /* * Search backwards for a non-null character * from the end of the displayed line. */ i = WCOLS * DEPTH(vcline); if (i == 0) i = WCOLS; tp = vtube0 + i; while (*--tp == 0) if (--i == 0) break; linend = i; } /* * We insert at a position based on the physical location * of the output cursor. */ inscol = destcol + (destline - LINE(vcline)) * WCOLS; if (c == '\t') { /* * Characters inserted from a tab must be * remembered as being part of a tab, but we can't * use QUOTE here since we really need to print blanks. * QUOTE|' ' is the representation of this. */ inssiz = tabcol(inscol, value(TABSTOP)) - inscol; c = ' ' | QUOTE; } else inssiz = 1; /* * If the text to be inserted is less than the number * of doomed positions, then we don't need insert mode, * rather we can just typeover. */ if (inssiz <= doomed) { endim(); if (inscol != linend) doomed -= inssiz; do vputchar(c); while (--inssiz); return; } /* * Have to really do some insertion, thus * stake out the bounds of the first following * group of tabs, computing starting position, * ending position, and the number of ``spaces'' therein * so we can tell how much it will squish. */ tp = vtube0 + inscol; for (i = inscol; i < linend; i++) if (*tp++ & QUOTE) { --tp; break; } tabstart = tabend = i; tabslack = 0; while (tabend < linend) { i = *tp++; if ((i & QUOTE) == 0) break; if ((i & TRIM) == 0) tabslack++; tabsize++; tabend++; } tabsize = tabend - tabstart; /* * For HP's and DM's, e.g. tabslack has no meaning. */ if (!IN) tabslack = 0; #ifdef IDEBUG if (trace) { fprintf(trace, "inscol %d, inssiz %d, tabstart %d, ", inscol, inssiz, tabstart); fprintf(trace, "tabend %d, tabslack %d, linend %d\n", tabend, tabslack, linend); } #endif /* * The real work begins. */ slakused = 0; shft = 0; if (tabsize) { /* * There are tabs on this line. * If they need to expand, then the rest of the line * will have to be shifted over. In this case, * we will need to make sure there are no ``spaces'' * in the rest of the line (on e.g. CONCEPT-100) * and then grab another segment on the screen if this * line is now deeper. We then do the shift * implied by the insertion. */ if (inssiz >= doomed + tabcol(tabstart, value(TABSTOP)) - tabstart) { if (IN) vrigid(); vneedpos(value(TABSTOP)); vishft(); } } else if (inssiz > doomed) /* * No tabs, but line may still get deeper. */ vneedpos(inssiz - doomed); /* * Now put in the inserted characters. */ viin(c); /* * Now put the cursor in its final resting place. */ destline = LINE(vcline); destcol = inscol + inssiz; vcsync(); } /* * Rigidify the rest of the line after the first * group of following tabs, typing blanks over ``spaces''. */ vrigid() { register int col; register char *tp = vtube0 + tabend; for (col = tabend; col < linend; col++) if ((*tp++ & TRIM) == 0) { endim(); vgotoCL(col); vputchar(' ' | QUOTE); } } /* * We need cnt more positions on this line. * Open up new space on the screen (this may in fact be a * screen rollup). * * On a dumb terminal we may infact redisplay the rest of the * screen here brute force to keep it pretty. */ vneedpos(cnt) int cnt; { register int d = DEPTH(vcline); register int rmdr = d * WCOLS - linend; if (cnt <= rmdr - IN) return; endim(); vnpins(1); } vnpins(dosync) int dosync; { register int d = DEPTH(vcline); register int e; e = LINE(vcline) + DEPTH(vcline); if (e < LINE(vcline + 1)) { vigoto(e, 0); vclreol(); return; } DEPTH(vcline)++; if (e < WECHO) { e = vglitchup(vcline, d); vigoto(e, 0); vclreol(); if (dosync) { int (*Ooutchar)() = Outchar; Outchar = vputchar; vsync(e + 1); Outchar = Ooutchar; } } else { vup1(); vigoto(WBOT, 0); vclreol(); } vprepins(); } /* * Do the shift of the next tabstop implied by * insertion so it expands. */ vishft() { int tshft = 0; int j; register int i; register char *tp = vtube0; register char *up; short oldhold = hold; shft = value(TABSTOP); hold |= HOLDPUPD; if (!IM && !EI) { /* * Dumb terminals are easy, we just have * to retype the text. */ vigotoCL(tabend + shft); up = tp + tabend; for (i = tabend; i < linend; i++) vputchar(*up++); } else if (IN) { /* * CONCEPT-like terminals do most of the work for us, * we don't have to muck with simulation of multi-line * insert mode. Some of the shifting may come for free * also if the tabs don't have enough slack to take up * all the inserted characters. */ i = shft; slakused = inssiz - doomed; if (slakused > tabslack) { i -= slakused - tabslack; slakused -= tabslack; } if (i > 0 && tabend != linend) { tshft = i; vgotoCL(tabend); goim(); do vputchar(' ' | QUOTE); while (--i); } } else { /* * HP and Datamedia type terminals have to have multi-line * insert faked. Hack each segment after where we are * (going backwards to where we are.) We then can * hack the segment where the end of the first following * tab group is. */ for (j = DEPTH(vcline) - 1; j > (tabend + shft) / WCOLS; j--) { vgotoCL(j * WCOLS); goim(); up = tp + j * WCOLS - shft; i = shft; do { if (*up) vputchar(*up++); else break; } while (--i); } vigotoCL(tabstart); i = shft - (inssiz - doomed); if (i > 0) { tabslack = inssiz - doomed; vcsync(); goim(); do vputchar(' '); while (--i); } } /* * Now do the data moving in the internal screen * image which is common to all three cases. */ tp += linend; up = tp + shft; i = linend - tabend; if (i > 0) do *--up = *--tp; while (--i); if (IN && tshft) { i = tshft; do *--up = ' ' | QUOTE; while (--i); } hold = oldhold; } /* * Now do the insert of the characters (finally). */ viin(c) char c; { register char *tp, *up; register int i, j; register bool noim = 0; int remdoom; short oldhold = hold; hold |= HOLDPUPD; if (tabsize && (IM && EI) && inssiz - doomed > tabslack) /* * There is a tab out there which will be affected * by the insertion since there aren't enough doomed * characters to take up all the insertion and we do * have insert mode capability. */ if (inscol + doomed == tabstart) { /* * The end of the doomed characters sits right at the * start of the tabs, then we don't need to use insert * mode; unless the tab has already been expanded * in which case we MUST use insert mode. */ slakused = 0; noim = !shft; } else { /* * The last really special case to handle is case * where the tab is just sitting there and doesn't * have enough slack to let the insertion take * place without shifting the rest of the line * over. In this case we have to go out and * delete some characters of the tab before we start * or the answer will be wrong, as the rest of the * line will have been shifted. This code means * that terminals with only insert chracter (no * delete character) won't work correctly. */ i = inssiz - doomed - tabslack - slakused; i %= value(TABSTOP); if (i > 0) { vgotoCL(tabstart); godm(); for (i = inssiz - doomed - tabslack; i > 0; i--) vputp(DC, DEPTH(vcline)); enddm(); } } /* * Now put out the characters of the actual insertion. */ vigotoCL(inscol); remdoom = doomed; for (i = inssiz; i > 0; i--) { if (remdoom > 0) { remdoom--; endim(); } else if (noim) endim(); else if (IM && EI) { vcsync(); goim(); } vputchar(c); } if (!IM || !EI) { /* * We are a dumb terminal; brute force update * the rest of the line; this is very much an n^^2 process, * and totally unreasonable at low speed. * * You asked for it, you get it. */ tp = vtube0 + inscol + doomed; for (i = inscol + doomed; i < tabstart; i++) vputchar(*tp+((+); hold = oldhold; vigotoCL(tabstart + inssiz - doomed); for (i = tabsize - (inssiz - doomed) + shft; i > 0; i--) vputchar(' ' | QUOTE); } else { if (!IN) { /* * On terminals without multi-line * insert in the hardware, we must go fix the segments * between the inserted text and the following * tabs, if they are on different lines. * * Aaargh. */ tp = vtube0; for (j = (inscol + inssiz - 1) / WCOLS + 1; j <= (tabstart + inssiz - doomed - 1) / WCOLS; j++) { vgotoCL(j * WCOLS); i = inssiz - doomed; up = tp + j * WCOLS - i; goim(); do vputchar(*up++); while (--i && *up); } } else { /* * On terminals with multi line inserts, * life is simpler, just reflect eating of * the slack. */ tp = vtube0 + tabend; for (i = tabsize - (inssiz - doomed); i >= 0; i--) { if ((*--tp & (QUOTE|TRIM)) == QUOTE) { --tabslack; if (tabslack >= slakused) continue; } *tp = ' ' | QUOTE; } } /* * Blank out the shifted positions to be tab positions. */ if (shft) { tp = vtube0 + tabend + shft; for (i = tabsize - (inssiz - doomed) + shft; i > 0; i--) if ((*--tp & QUOTE) == 0) *tp = ' ' | QUOTE; } } /* * Finally, complete the screen image update * to reflect the insertion. */ hold = oldhold; tp = vtube0 + tabstart; up = tp + inssiz - doomed; for (i = tabstart; i > inscol + doomed; i--) *--up = *--tp; for (i = inssiz; i > 0; i--) *--up = c; doomed = 0; } /* * Go into ``delete mode''. If the * sequence which goes into delete mode * is the same as that which goes into insert * mode, then we are in delete mode already. */ godm() { if (insmode) { if (eq(DM, IM)) return; endim(); } vputp(DM, 0); } /* * If we are coming out of delete mode, but * delete and insert mode end with the same sequence, * it wins to pretend we are now in insert mode, * since we will likely want to be there again soon * if we just moved over to delete space from part of * a tab (above). */ enddm() { if (eq(DM, IM)) { insmode = 1; return; } vputp(ED, 0); } /* * In and out of insert mode. * Note that the code here demands that there be * a string for insert mode (the null string) even * if the terminal does all insertions a single character * at a time, since it branches based on whether IM is null. */ goim() { if (!insmode) vputp(IM, 0); insmode = 1; } endim() { if (insmode) { vputp(EI, 0); insmode = 0; } } /* * Put the character c on the screen at the current cursor position. * This routine handles wraparound and scrolling and understands not * to roll when splitw is set, i.e. we are working in the echo area. * There is a bunch of hacking here dealing with the difference between * QUOTE, QUOTE|' ', and ' ' for CONCEPT-100 like terminals, and also * code to deal with terminals which overstrike, including CRT's where * you can erase overstrikes with some work. CRT's which do underlining * implicitly which has to be erased (like CONCEPTS) are also handled. */ vputchar(c) register int c; { register char *tp; register int d; c &= (QUOTE|TRIM); #ifdef TRACE if (trace) tracec(c); #endif /* Fix problem of >79 chars on echo line. */ if (destcol >= WCOLS-1 && splitw && destline == WECHO) pofix(); if (destcol >= WCOLS) { destline += destcol / WCOLS; destcol %= WCOLS; } if (destline > WBOT && (!splitw || destline > WECHO)) vrollup(destline); tp = vtube[destline] + destcol; switch (c) { case '\t': vgotab(); return; case ' ': /* * We can get away without printing a space in a number * of cases, but not always. We get away with doing nothing * if we are not in insert mode, and not on a CONCEPT-100 * like terminal, and either not in hardcopy open or in hardcopy * open on a terminal with no overstriking, provided, * in all cases, that nothing has ever been displayed * at this position. Ugh. */ if (!insmode && !IN && (state != HARDOPEN || OS) && (*tp&TRIM) == 0) { *tp = ' '; destcol++; return; } goto def; case QUOTE: if (insmode) { /* * When in insert mode, tabs have to expand * to real, printed blanks. */ c = ' ' | QUOTE; goto def; } if (*tp == 0) { /* * A ``space''. */ if ((hold & HOLDPUPD) == 0) *tp = QUOTE; destcol++; return; } /* * A ``space'' ontop of a part of a tab. */ if (*tp & QUOTE) { destcol++; return; } c = ' ' | QUOTE; /* fall into ... */ def: default: d = *tp & TRIM; /* * Now get away with doing nothing if the characters * are the same, provided we are not in insert mode * and if we are in hardopen, that the terminal has overstrike. */ if (d == (c & TRIM) && !insmode && (state != HARDOPEN || OS)) { if ((hold & HOLDPUPD) == 0) *tp = c; destcol++; return; } /* * Backwards looking optimization. * The low level cursor motion routines will use * a cursor motion right sequence to step 1 character * right. On, e.g., a DM3025A this is 2 characters * and printing is noticeably slower at 300 baud. * Since the low level routines are not allowed to use * spaces for positioning, we discover the common * case of a single space here and force a space * to be printed. */ if (destcol == outcol + 1 && tp[-1] == ' ' && outline == destline) { vputc(' '); outcol++; } /* * This is an inline expansion a call to vcsync() dictated * by high frequency in a profile. */ if (outcol != destcol || outline != destline) vgoto(destline, destcol); /* * Deal with terminals which have overstrike. * We handle erasing general overstrikes, erasing * underlines on terminals (such as CONCEPTS) which * do underlining correctly automatically (e.g. on nroff * output), and remembering, in hardcopy mode, * that we have overstruct something. */ if (!insmode && d && d != ' ' && d != (c & TRIM)) { if (EO && (OS || UL && (c == '_' || d == '_'))) { vputc(' '); outcol++, destcol++; back1(); } else rubble = 1; } /* * Unless we are just bashing characters around for * inner working of insert mode, update the display. */ if ((hold & HOLDPUPD) == 0) *tp = c; /* * In insert mode, put out the IC sequence, padded * based on the depth of the current line. * A terminal which had no real insert mode, rather * opening a character position at a time could do this. * Actually should use depth to end of current line * but this rarely matters. */ if (insmode) vputp(IC, DEPTH(vcline)); vputc(c & TRIM); /* * In insert mode, IP is a post insert pad. */ if (insmode) vputp(IP, DEPTH(vcline)); destcol++, outcol++; /* * CONCEPT braindamage in early models: after a wraparound * the next newline is eaten. It's hungry so we just * feed it now rather than worrying about it. */ if (XN && outcol % WCOLS == 0) vputc('\n'); } } /* * Delete display positions stcol through endcol. * Amount of use of special terminal features here is limited. */ physdc(stcol, endcol) int stcol, endcol; { register char *tp, *up; char *tpe; register int i; register int nc = endcol - stcol; #ifdef IDEBUG if (trace) tfixnl(), fprintf(trace, "physdc(%d, %d)\n", stcol, endcol); #endif if (!DC || nc <= 0) return; if (IN) { /* * CONCEPT-100 like terminal. * If there are any ``spaces'' in the material to be * deleted, then this is too hard, just retype. */ vprepins(); up = vtube0 + stcol; i = nc; do if ((*up++ & (QUOTE|TRIM)) == QUOTE) return; while (--i); i = 2 * nc; do if (*up == 0 || (*up++ & QUOTE) == QUOTE) return; while (--i); vgotoCL(stcol); } else { /* * HP like delete mode. * Compute how much text we are moving over by deleting. * If it appears to be faster to just retype * the line, do nothing and that will be done later. * We are assuming 2 output characters per deleted * characters and that clear to end of line is available. */ i = stcol / WCOLS; if (i != endcol / WCOLS) return; i += LINE(vcline); stcol %= WCOLS; endcol %= WCOLS; up = vtube[i]; tp = up + endcol; tpe = up + WCOLS; while (tp < tpe && *tp) tp++; if (tp - (up + stcol) < 2 * nc) return; vgoto(i, stcol); } /* * Go into delete mode and do the actual delete. * Padding is on DC itself. */ godm(); for (i = nc; i > 0; i--) vputp(DC, DEPTH(vcline)); vputp(ED, 0); /* * Straighten up. * With CONCEPT like terminals, characters are pulled left * from first following null. HP like terminals shift rest of * this (single physical) line rigidly. */ if (IN) { up = vtube0 + stcol; tp = vtube0 + endcol; while (i = *tp++) { if ((i & (QUOTE|TRIM)) == QUOTE) break; *up++ = i; } do *up++ = i; while (--nc); } else { copy(up + stcol, up + endcol, WCOLS - endcol); vclrbyte(tpe - nc, nc); } } #ifdef TRACE tfixnl() { if (trubble || techoin) fprintf(trace, "\n"); trubble = 0, techoin = 0; } tvliny() { register int i; if (!trace) return; tfixnl(); fprintf(trace, "vcnt = %d, vcline = %d, vliny = ", vcnt, vcline); for (i = 0; i <= vcnt; i++) { fprintf(trace, "%d", LINE(i)); if (FLAGS(i) & VDIRT) fprintf(trace, "*"); if (DEPTH(i) != 1) fprintf(trace, "<%d>", DEPTH(i)); if (i < vcnt) fprintf(trace, " "); } fprintf(trace, "\n"); } tracec(c) char c; { if (!techoin) trubble = 1; if (c == ESCAPE) fprintf(trace, "$"); else if (c < ' ' || c == DELETE) fprintf(trace, "^%c", ctlof(c)); else fprintf(trace, "%c", c); } #endif /* * Put a character with possible tracing. */ vputch(c) int c; { #ifdef TRACE if (trace) tracec(c); #endif vputc(c); } )); if (FLAGS(i) & VDIRT) fprintf(trace, "*"); if (DEPTH(i) != 1) fprintf(trace, "<%d>", DEPTH(i)); if (i < vcnt) fprintf(trace, " "); } fprintf(trace, "\n"); } tracec(c) char c; { if (!techoin) trubble = 1; if (c == ESCAPE) fprintf(trace, "$"); else if (c < ' ' || c == DELETE) fprintf(trace, "^%c", ctlof(c)); else fprintf(trace, "%c", c); } #endif /* * Put a chara((cmd/ex/ex_vwind.c 444 0 33 17641 2425426323 7232 /* Copyright (c) 1980 Regents of the University of California */ static char *sccsid = "@(#)ex_vwind.c 6.1 10/18/80"; #include "ex.h" #include "ex_tty.h" #include "ex_vis.h" /* * Routines to adjust the window, showing specified lines * in certain positions on the screen, and scrolling in both * directions. Code here is very dependent on mode (open versus visual). */ /* * Move in a nonlocal way to line addr. * If it isn't on screen put it in specified context. * New position for cursor is curs. * Like most routines here, we vsave(). */ vmoveto(addr, curs, context) register line *addr; char *curs; char context; { markit(addr); vsave(); vjumpto(addr, curs, context); } /* * Vjumpto is like vmoveto, but doesn't mark previous * context or save linebuf as current line. */ vjumpto(addr, curs, context) register line *addr; char *curs; char context; { noteit(0); if (context != 0) vcontext(addr, context); else vshow(addr, NOLINE); noteit(1); vnline(curs); } /* * Go up or down cnt (negative is up) to new position curs. */ vupdown(cnt, curs) register int cnt; char *curs; { if (cnt > 0) vdown(cnt, 0, 0); else if (cnt < 0) vup(-cnt, 0, 0); if (vcnt == 0) vrepaint(curs); else vnline(curs); } /* * Go up cnt lines, afterwards preferring to be ind * logical lines from the top of the screen. * If scroll, then we MUST use a scroll. * Otherwise clear and redraw if motion is far. */ vup(cnt, ind, scroll) register int cnt, ind; bool scroll; { register int i, tot; if (dot == one) { beep(); return; } vsave(); i = lineDOT() - 1; if (cnt > i) { ind -= cnt - i; if (ind < 0) ind = 0; cnt = i; } if (!scroll && cnt <= vcline) { vshow(dot - cnt, NOLINE); return; } cnt -= vcline, dot -= vcline, vcline = 0; if (hold & HOLDWIG) goto contxt; if (state == VISUAL && !AL && !SR && cnt <= WTOP - ZERO && vfit(dot - cnt, cnt) <= WTOP - ZERO) goto okr; tot = WECHO - ZERO; if (state != VISUAL || (!AL && !SR) || (!scroll && (cnt > tot || vfit(dot - cnt, cnt) > tot / 3 + 1))) { if (ind > basWLINES / 2) ind = basWLINES / 3; contxt: vcontext(dot + ind - cnt, '.'); return; } okr: vrollR(cnt); if (scroll) { vcline += ind, dot += ind; if (vcline >= vcnt) dot -= vcline - vcnt + 1, vcline = vcnt - 1; getDOT(); } } /* * Like vup, but scrolling down. */ vdown(cnt, ind, scroll) register int cnt, ind; bool scroll; { register int i, tot; if (dot == dol) { beep(); return; } vsave(); i = dol - dot; if (cnt > i) { ind -= cnt - i; if (ind < 0) ind = 0; cnt = i; } i = vcnt - vcline - 1; if (!scroll && cnt <= i) { vshow(dot + cnt, NOLINE); return; } cnt -= i, dot += i, vcline += i; if (hold & HOLDWIG) goto dcontxt; if (!scroll) { tot = WECHO - ZERO; if (state != VISUAL || cnt - tot > 0 || vfit(dot, cnt) > tot / 3 + 1) { dcontxt: vcontext(dot + cnt, '.'); return; } } if (cnt > 0) vroll(cnt); if (state == VISUAL && scroll) { vcline -= ind, dot -= ind; if (vcline < 0) dot -= vcline, vcline = 0; getDOT(); } } /* * Show line addr in context where on the screen. * Work here is in determining new top line implied by * this placement of line addr, since we always draw from the top. */ vcontext(addr, where) register line *addr; char where; { register line *top; getline(*addr); if (state != VISUAL) top = addr; else switch (where) { case '^': addr = vback(addr, basWLINES - vdepth()); getline(*addr); /* fall into ... */ case '-': top = vback(addr, basWLINES - vdepth()); getline(*addr); break; case '.': top = vback(addr, basWLINES / 2 - vdepth()); getline(*addr); break; default: top = addr; break; } if (state == ONEOPEN && LINE(0) == WBOT) vup1(); vcnt = vcline = 0; vclean(); if (state == CRTOPEN) vup1(); vshow(addr, top); } /* * Get a clean line. If we are in a hard open * we may be able to reuse the line we are on * if it is blank. This is a real win. */ vclean() { if (state != VISUAL && state != CRTOPEN) { destcol = 0; if (!ateopr()) vup1(); vcnt = 0; } } /* * Show line addr with the specified top line on the screen. * Top may be 0; in this case have vcontext compute the top * (and call us recursively). Eventually, we clear the screen * (or its open mode equivalent) and redraw. */ vshow(addr, top) line *addr, *top; { #ifndef CBREAK register bool fried = 0; #endif register int cnt = addr - dot; register int i = vcline + cnt; short oldhold = hold; if (state != HARDOPEN && state != ONEOPEN && i >= 0 && i < vcnt) { dot = addr; getDOT(); vcline = i; return; } if (state != VISUAL) { dot = addr; vopen(dot, WBOT); return; } if (top == 0) { vcontext(addr, '.'); return; } dot = top; #ifndef CBREAK if (vcookit(2)) fried++, vcook(); #endif oldhold = hold; hold |= HOLDAT; vclear(); vreset(0); vredraw(WTOP); /* error if vcline >= vcnt ! */ vcline = addr - top; dot = addr; getDOT(); hold = oldhold; vsync(LASTLINE); #ifndef CBREAK if (fried) flusho(), vraw(); #endif } /* * reset the state. * If inecho then leave us at the beginning of the echo * area; we are called this way in the middle of a :e escape * from visual, e.g. */ vreset(inecho) bool inecho; { vcnt = vcline = 0; WTOP = basWTOP; WLINES = basWLINES; if (inecho) splitw = 1, vgoto(WECHO, 0); } /* * Starting from which line preceding tp uses almost (but not more * than) cnt physical lines? */ line * vback(tp, cnt) register int cnt; register line *tp; { register int d; if (cnt > 0) for (; tp > one; tp--) { getline(tp[-1]); d = vdepth(); if (d > cnt) break; cnt -= d; } return (tp); } /* * How much scrolling will it take to roll cnt lines starting at tp? */ vfit(tp, cnt) register line *tp; int cnt; { register int j; j = 0; while (cnt > 0) { cnt--; getline(tp[cnt]); j += vdepth(); } if (tp > dot) j -= WBOT - LASTLINE; return (j); } /* * Roll cnt lines onto the screen. */ vroll(cnt) register int cnt; { #ifndef CBREAK register bool fried = 0; #endif short oldhold = hold; #ifdef ADEBUG if (trace) tfixnl(), fprintf(trace, "vroll(%d)\n", cnt); #endif if (state != VISUAL) hold |= HOLDAT|HOLDROL; if (WBOT == WECHO) { vcnt = 0; if (state == ONEOPEN) vup1(); } #ifndef CBREAK if (vcookit(cnt)) fried++, vcook(); #endif for (; cnt > 0 && Peekkey != ATTN; cnt--) { dot++, vcline++; vopen(dot, LASTLINE); vscrap(); } hold = oldhold; if (state == HARDOPEN) sethard(); vsyncCL(); #ifndef CBREAK if (fried) flusho(), vraw(); #endif } /* * Roll backwards (scroll up). */ vrollR(cnt) register int cnt; { register bool fried = 0; short oldhold = hold; #ifdef ADEBUG if (trace) tfixnl(), fprintf(trace, "vrollR(%d), dot=%d\n", cnt, lineDOT()); #endif #ifndef CBREAK if (vcookit(cnt)) fried++, vcook(); #endif if (WBOT == WECHO) vcnt = 0; heldech = 0; hold |= HOLDAT|HOLDECH; for (; cnt > 0 && Peekkey != ATTN; cnt--) { dot--; vopen(dot, WTOP); vscrap(); } hold = oldhold; if (heldech) vclrech(0); vsync(LINE(vcnt-1)); #ifndef CBREAK if (fried) flusho(), vraw(); #endif } /* * Go into cooked mode (allow interrupts) during * a scroll if we are at less than 1200 baud and not * a 'vi' command, of if we are in a 'vi' command and the * scroll is more than 2 full screens. * * BUG: An interrupt during a scroll in this way * dumps to command mode. */ vcookit(cnt) register int cnt; { return (cnt > 1 && (ospeed < B1200 && !initev || cnt > LINES * 2)); } /* * Determine displayed depth of current line. */ vdepth() { register int d; d = (column(NOSTR) + WCOLS - 1 + (Putchar == listchar) + IN) / WCOLS; #ifdef ADEBUG if (trace) tfixnl(), fprintf(trace, "vdepth returns %d\n", d == 0 ? 1 : d); #endif return (d == 0 ? 1 : d); } /* * Move onto a new line, with cursor at position curs. */ vnline(curs) char *curs; { if (curs) wcursor = curs; else if (vmoving) wcursor = vfindcol(vmovcol); else wcursor = vskipwh(linebuf); cursor = linebuf; vmove(); } etermine displayed depth of current line. */ vdepth() { register int d; d = (column(NOSTR) cmd/ex/expreserve.c 444 0 33 16437 2425426330 7577 /* Copyright (c) 1980 Regents of the University of California */ static char *sccsid = "@(#)expreserve.c 6.1 10/18/80"; #include #include #include #include #include #include #include "local/uparm.h" #ifdef VMUNIX #define HBLKS 2 #else #define HBLKS 1 #endif /* * Expreserve - preserve a file in usrpath(preserve) * Bill Joy UCB November 13, 1977 * * This routine is very naive - it doesn't remove anything from * usrpath(preserve)... this may mean that we will be unable to preserve * stuff there... the danger in doing anything with usrpath(preserve) * is that the clock may be screwed up and we may get confused. * * We are called in two ways - first from the editor with no argumentss * and the standard input open on the temp file. Second with an argument * to preserve the entire contents of /tmp (root only). * * BUG: should do something about preserving Rx... (register contents) * temporaries. */ #ifndef VMUNIX #define LBLKS ((125 #else #define LBLKS 900 #endif #define FNSIZE 128 struct header { time_t Time; /* Time temp file last updated */ short Uid; /* This users identity */ #ifndef VMUNIX short Flines; /* Number of lines in file */ #else int Flines; #endif char Savedfile[FNSIZE]; /* The current file name */ short Blocks[LBLKS]; /* Blocks where line pointers stashed */ } H; #ifdef lint #define ignore(a) Ignore(a) #define ignorl(a) Ignorl(a) #else #define ignore(a) a #define ignorl(a) a #endif struct passwd *getpwuid(); off_t lseek(); FILE *popen(); #define eq(a, b) strcmp(a, b) == 0 main(argc) int argc; { register FILE *tf; struct direct dirent; struct stat stbuf; /* * If only one argument, then preserve the standard input. */ if (argc == 1) { if (copyout((char *) 0)) exit(1); exit(0); } /* * If not super user, then can only preserve standard input. */ if (getuid()) { fprintf(stderr, "NOT super user\n"); exit(1); } /* * ... else preserve all the stuff in /tmp, removing * it as we go. */ if (chdir("/tmp") < 0) { perror("/tmp"); exit(1); } tf = fopen(".", "r"); if (tf == NULL) { perror("/tmp"); exit(1); } while (fread((char *) &dirent, sizeof dirent, 1, tf) == 1) { if (dirent.d_ino == 0) continue; /* * Ex temporaries must begin with Ex; * we check that the 10th character of the name is null * so we won't have to worry about non-null terminated names * later on. */ if (dirent.d_name[0] != 'E' || dirent.d_name[1] != 'x' || dirent.d_name[10]) continue; if (stat(dirent.d_name, &stbuf)) continue; if ((stbuf.st_mode & S_IFMT) != S_IFREG) continue; /* * Save the bastard. */ ignore(copyout(dirent.d_name)); } exit(0); } char pattern[] = usrpath(preserve/Exaa`XXXXX); /* * Copy file name into usrpath(preserve)/... * If name is (char *) 0, then do the standard input. * We make some checks on the input to make sure it is * really an editor temporary, generate a name for the * file (this is the slowest thing since we must stat * to find a unique name), and finally copy the file. */ copyout(name) char *name; { int i; static int reenter; char buf[BUFSIZ]; /* * The first time we put in the digits of our * process number at the end of the pattern. */ if (reenter == 0) { mkdigits(pattern); reenter++; } /* * If a file name was given, make it the standard * input if possible. */ if (name != 0) { ignore(close(0)); /* * Need read/write access for arcane reasons * (see below). */ if (open(name, 2) < 0) return (-1); } /* * Get the header block. */ ignorl(lseek(0, 0l, 0)); if (read(0, (char *) &H, sizeof H) != sizeof H) { format: if (name == 0) fprintf(stderr, "Buffer format error\t"); return (-1); } /* * Consistency checsks so we don't copy out garbage. */ if (H.Flines < 0) { #ifdef DEBUG fprintf(stderr, "Negative number of lines\n"); #endif goto format; } if (H.Blocks[0] != HBLKS || H.Blocks[1] != HBLKS+1) { #ifdef DEBUG fprintf(stderr, "Blocks %d %d\n", H.Blocks[0], H.Blocks[1]); #endif goto format; } if (name == 0 && H.Uid != getuid()) { #ifdef DEBUG fprintf(stderr, "Wrong user-id\n"); #endif goto format; } if (lseek(0, 0l, 0)) { #ifdef DEBUG fprintf(stderr, "Negative number of lines\n"); #endif goto format; } /* * If no name was assigned to the file, then give it the name * LOST, by putting this in the header. */ if (H.Savedfile[0] == 0) { strcpy(H.Savedfile, "LOST"); ignore(write(0, (char *) &H, sizeof H)); H.Savedfile[0] = 0; lseek(0, 0l, 0); } /* * File is good. Get a name and create a file for the copy. */ mknext(pattern); ignore(close(1)); if (creat(pattern, 0600) < 0) { if (name == 0) perror(pattern); return (1); } /* * Make the target be owned by the owner of the file. */ ignore(chown(pattern, H.Uid, 0)); /* * Copy the file. */ for (;;) { i = read(0, buf, BUFSIZ); if (i < 0) { if (name) perror("Buffer read error"); ignore(unlink(pattern)); return (-1); } if (i == 0) { if (name) ignore(unlink(name)); notify(H.Uid, H.Savedfile, (int) name); return (0); } if (write(1, buf, i) != i) { if (name == 0) perror(pattern); unlink(pattern); return (-1); } } } /* * Blast the last 5 characters of cp to be the process number. */ mkdigits(cp) char *cp; { register int i, j; for (i = getpid(), j = 5, cp += strlen(cp); j > 0; i /= 10, j--) *--cp = i % 10 | '0'; } /* * Make the name in cp be unique by clobbering up to * three alphabetic characters into a sequence of the form 'aab', 'aac', etc. * Mktemp gets weird names too quickly to be useful here. */ mknext(cp) char *cp; { char *dcp; struct stat stb; dcp = cp + strlen(cp) - 1; while (isdigit(*dcp)) dcp--; whoops: if (dcp[0] == 'z') { dcp[0] = 'a'; if (dcp[-1] == 'z') { dcp[-1] = 'a'; if (dcp[-2] == 'z') fprintf(stderr, "Can't find a name\t"); dcp[-2]++; } else dcp[-1]++; } else dcp[0]++; if (stat(cp, &stb) == 0) goto whoops; } /* * Notify user uid that his file fname has been saved. */ notify(uid, fname, flag) int uid; char *fname; { struct passwd *pp = getpwuid(uid); register FILE *mf; char cmd[BUFSIZ]; if (pp == NULL) return; sprintf(cmd, "mail %s", pp->pw_name); mf = popen(cmd, "w"); if (mf == NULL) return; setbuf(mf, cmd); if (fname[0] == 0) { fprintf(mf, "A copy of an editor buffer of yours was saved when %s.\n", flag ? "the system went down" : "the editor was killed"); fprintf(mf, "No name was associated with this buffer so it has been named \"LOST\".\n"); } else fprintf(mf, "A copy of an editor buffer of your file \"%s\"\nwas saved when %s.\n", fname, /* * "the editor was killed" is perhaps still not an ideal * error message. Usually, either it was forcably terminated * or the phone was hung up, but we don't know which. */ flag ? "the system went down" : "the editor was killed"); fprintf(mf, "This buffer can be retrieved using the \"recover\" command of the editor.\n"); fprintf(mf, "An easy way to do this is to give the command \"ex -r %s\".\n",fname); fprintf(mf, "This works for \"edit\" and \"vi\" also.\n"); pclose(mf); } /* * people making love * never exactly the same * just like a snowflake */ #ifdef lint Ignore(a) int a; { a = a; } Ignorl(a) long a; { a = a; } #endif , but we don't know which. */ flag ? "the system went down" : "the editor was killed"); fprintf(mf, "This buffer can be retrieved using the \"recover\" command of the editor.\n"); fprintf(mf, "An easy way to do this iscmd/ex/exrecover.c 444 0 33 36134 2425426337 7414 /* Copyright (c) 1980 Regents of the University of California */ static char *sccsid = "@(#)exrecover.c 6.1 10/18/80"; #include "ex.h" #include "ex_temp.h" #include "ex_tty.h" #include "local/uparm.h" #undef BUFSIZ #undef EOF #undef NULL #include #include /* * Ex recovery program * exrecover dir name * exrecover -r * * This program searches through the specified directory and then * the directory usrpath(preserve) looking for an instance of the specified * file from a crashed editor or a crashed system. * If this file is found, it is unscrambled and written to * the standard output. * * If this program terminates without a "broken pipe" diagnostic * (i.e. the editor doesn't die right away) then the buffer we are * writing from is removed when we finish. This is potentially a mistake * as there is not enough handshaking to guarantee that the file has actually * been recovered, but should suffice for most cases. */ /* * For lint's sake... */ #ifndef lint #define ignorl(a) a #endif /* * This directory definition also appears (obviously) in expreserve.c. * Change both if you change either. */ char mydir[] = usrpath(preserve); /* * Limit on the number of printed entries * when an, e.g. ``ex -r'' command is given. */ #define NENTRY 50 char *ctime(); char nb[BUFSIZ]; int vercnt; /* Count number of versions of file found */ main(argc, argv) int argc; char *argv[]; { register char *cp; register int b, i; /* * Initialize as though the editor had just started. */ fendcore = (line *) sbrk(0); dot = zero = dol = fendcore; one = zero + 1; endcore = fendcore - 2; iblock = oblock = -1; /* * If given only a -r argument, then list the saved files. */ if (argc == 2 && eq(argv[1], "-r")) { listfiles(mydir); exit(0); } if (argc != 3) error(" Wrong number of arguments to exrecover", 0); CP(file, argv[2]); /* * Search for this file. */ findtmp(argv[1]); /* * Got (one of the versions of) it, write it back to the editor. */ cp = ctime(&H.Time); cp[19] = 0; fprintf(stderr, " [Dated: %s", cp); fprintf(stderr, vercnt > 1 ? ", newest of %d saved]" : "]", vercnt); H.Flines++; /* * Allocate space for the line pointers from the temp file. */ if ((int) sbrk((int) (H.Flines * sizeof (line))) == -1) /* * Good grief. */ error(" Not enough core for lines", 0); #ifdef DEBUG fprintf(stderr, "%d lines\n", H.Flines); #endif /* * Now go get the blocks of seek pointers which are scattered * throughout the temp file, reconstructing the incore * line pointers at point of crash. */ b = 0; while (H.Flines > 0) { ignorl(lseek(tfile, (long) blocks[b] * BUFSIZ, 0)); i = H.Flines < BUFSIZ / sizeof (line) ? H.Flines * sizeof (line) : BUFSIZ; if (read(tfile, (char *) dot, i) != i) { perror(nb); exit(1); } dot += i / sizeof (line); H.Flines -= i / sizeof (line); b++; } dot--; dol = dot; /* * Sigh... due to sandbagging some lines may really not be there. * Find and discard such. This shouldn't happen much((. */ scrapbad(); /* * Now if there were any lines in the recovered file * write them to the standard output. */ if (dol > zero) { addr1 = one; addr2 = dol; io = 1; putfile(); } /* * Trash the saved buffer. * Hopefully the system won't crash before the editor * syncs the new recovered buffer; i.e. for an instant here * you may lose if the system crashes because this file * is gone, but the editor hasn't completed reading the recovered * file from the pipe from us to it. * * This doesn't work if we are coming from an non-absolute path * name since we may have chdir'ed but what the hay, noone really * ever edits with temporaries in "." anyways. */ if (nb[0] == '/') ignore(unlink(nb)); /* * Adieu. */ exit(0); } /* * Print an error message (notably not in error * message file). If terminal is in RAW mode, then * we should be writing output for "vi", so don't print * a newline which would screw up the screen. */ /*VARARGS2*/ error(str, inf) char *str; int inf; { fprintf(stderr, str, inf); #ifndef USG3TTY gtty(2, &tty); if ((tty.sg_flags & RAW) == 0) #else ioctl(2, TCGETA, &tty); if (tty.c_lflag & ICANON) #endif fprintf(stderr, "\n"); exit(1); } /* * Here we save the information about files, when * you ask us what files we have saved for you. * We buffer file name, number of lines, and the time * at which the file was saved. */ struct svfile { char sf_name[FNSIZE + 1]; int sf_lines; char sf_entry[DIRSIZ + 1]; time_t sf_time; }; listfiles(dirname) char *dirname; { register FILE *dir; struct direct dirent; int ecount, qucmp(); register int f; char *cp; struct svfile *fp, svbuf[NENTRY]; /* * Open usrpath(preserve), and go there to make things quick. */ dir = fopen(dirname, "r"); if (dir == NULL) { perror(dirname); return; } if (chdir(dirname) < 0) { perror(dirname); return; } /* * Look at the candidate files in usrpath(preserve). */ fp = &svbuf[0]; ecount = 0; while (fread((char *) &dirent, sizeof dirent, 1, dir) == 1) { if (dirent.d_ino == 0) continue; if (dirent.d_name[0] != 'E') continue; #ifdef DEBUG fprintf(stderr, "considering %s\n", dirent.d_name); #endif /* * Name begins with E; open it and * make sure the uid in the header is our uid. * If not, then don't bother with this file, it can't * be ours. */ f = open(dirent.d_name, 0); if (f < 0) { #ifdef DEBUG fprintf(stderr, "open failed\n"); #endif continue; } if (read(f, (char *) &H, sizeof H) != sizeof H) { #ifdef DEBUG fprintf(stderr, "culdnt read hedr\n"); #endif ignore(close(f)); continue; } ignore(close(f)); if (getuid() != H.Uid) { #ifdef DEBUG fprintf(stderr, "uid wrong\n"); #endif continue; } /* * Saved the day! */ enter(fp++, dirent.d_name, ecount); ecount++; #ifdef DEBUG fprintf(stderr, "entered file %s\n", dirent.d_name); #endif } ignore(fclose(dir)); /* * If any files were saved, then sort them and print * them out. */ if (ecount == 0) { fprintf(stderr, "No files saved.\n"); return; } qsort(&svbuf[0], ecount, sizeof svbuf[0], qucmp); for (fp = &svbuf[0]; fp < &svbuf[ecount]; fp++) { cp = ctime(&fp->sf_time); cp[10] = 0; fprintf(stderr, "On %s at ", cp); cp[16] = 0; fprintf(stderr, &cp[11]); fprintf(stderr, " saved %d lines of file \"%s\"\n", fp->sf_lines, fp->sf_name); } } /* * Enter a new file into the saved file information. */ enter(fp, fname, count) struct svfile *fp; char *fname; { register char *cp, *cp2; register struct svfile *f, *fl; time_t curtime, itol(); f = 0; if (count >= NENTRY) { /* * My god, a huge number of saved files. * Would you work on a system that crashed this * often? Hope not. So lets trash the oldest * as the most useless. * * (I wonder if this code has ever run?) */ fl = fp - count + NENTRY - 1; curtime = fl->sf_time; for (f = fl; --f > fp-count; ) if (f->sf_time < curtime) curtime = f->sf_time; for (f = fl; --f > fp-count; ) if (f->sf_time == curtime) break; fp = f; } /* * Gotcha. */ fp->sf_time = H.Time; fp->sf_lines = H.Flines; for (cp2 = fp->sf_name, cp = savedfile; *cp;) *cp2++ = *cp++; for (cp2 = fp->sf_entry, cp = fname; *cp && cp-fname < 14;) *cp2++ = *cp++; *cp2++ = 0; } /* * Do the qsort compare to sort the entries first by file name, * then by modify time. */ qucmp(p1, p2) struct svfile *p1, *p2; { register int t; if (t = strcmp(p1->sf_name, p2->sf_name)) return(t); if (p1->sf_time > p2->sf_time) return(-1); return(p1->sf_time < p2->sf_time); } /* * Scratch for search. */ char bestnb[BUFSIZ]; /* Name of the best one */ long besttime; /* Time at which the best file was saved */ int bestfd; /* Keep best file open so it dont vanish */ /* * Look for a file, both in the users directory option value * (i.e. usually /tmp) and in usrpath(preserve). * Want to find the newest so we search on and on. */ findtmp(dir) char *dir; { /* * No name or file so far. */ bestnb[0] = 0; bestfd = -1; /* * Search usrpath(preserve) and, if we can get there, /tmp * (actually the users "directory" option). */ searchdir(dir); if (chdir(mydir) == 0) searchdir(mydir); if (bestfd != -1) { /* * Gotcha. * Put the file (which is already open) in the file * used by the temp file routines, and save its * name for later unlinking. */ tfile = bestfd; CP(nb, bestnb); ignorl(lseek(tfile, 0l, 0)); /* * Gotta be able to read the header or fall through * to lossage. */ if (read(tfile, (char *) &H, sizeof H) == sizeof H) return; } /* * Extreme lossage... */ error(" File not found", 0); } /* * Search for the file in directory dirname. * * Don't chdir here, because the users directory * may be ".", and we would move away before we searched it. * Note that we actually chdir elsewhere (because it is too slow * to look around in usrpath(preserve) without chdir'ing there) so we * can't win, because we don't know the name of '.' and if the path * name of the file we want to unlink is relative, rather than absolute * we won't be able to find it again. */ searchdir(dirname) char *dirname; { struct direct dirent; register FILE *dir; char dbuf[BUFSIZ]; dir = fopen(dirname, "r"); if (dir == NULL) return; setbuf(dir, dbuf); while (fread((char *) &dirent, sizeof dirent, 1, dir) == 1) { if (dirent.d_ino == 0) continue; if (dirent.d_name[0] != 'E' || dirent.d_name[DIRSIZ - 1] != 0) continue; /* * Got a file in the directory starting with E... * Save a consed up name for the file to unlink * later, and check that this is really a file * we are looking for. */ ignore(strcat(strcat(strcpy(nb, dirname), "/"), dirent.d_name)); if (yeah(nb)) { /* * Well, it is the file we are looking for. * Is it more recent than any version we found before? */ if (H.Time > besttime) { /* * A winner. */ ignore(close(bestfd)); bestfd = dup(tfile); besttime = H.Time; CP(bestnb, nb); } /* * Count versions so user can be told there are * ``yet more pages to be turned''. */ vercnt++; } ignore(close(tfile)); } ignore(fclose(dir)); } /* * Given a candidate file to be recovered, see * if its really an editor temporary and of this * user and the file specified. */ yeah(name) char *name; { tfile = open(name, 2); if (tfile < 0) return (0); if (read(tfile, (char *) &H, sizeof H) != sizeof H) { nope: ignore(close(tfile)); return (0); } if (!eq(savedfile, file)) goto nope; if (getuid() != H.Uid) goto nope; /* * This is old and stupid code, which * puts a word LOST in the header block, so that lost lines * can be made to point at it. */ ignorl(lseek(tfile, (long)(BUFSIZ*HBLKS-8), 0)); ignore(write(tfile, "LOST", 5)); return (1); } preserve() { } /* * Find the true end of the scratch file, and ``LOSE'' * lines which point into thin air. This lossage occurs * due to the sandbagging of i/o which can cause blocks to * be written in a non-obvious order, different from the order * in which the editor tried to write them. * * Lines which are lost are replaced with the text LOST so * they are easy to find. We work hard at pretty formatting here * as lines tend to be lost in blocks. * * This only seems to happen on very heavily loaded systems, and * not very often. */ scrapbad() { register line *ip; struct stat stbuf; off_t size, maxt; int bno, cnt, bad, was; char bk[BUFSIZ]; ignore(fstat(tfile, &stbuf)); size = stbuf.st_size; maxt = (size >> SHFT) | (BNDRY-1); bno = (maxt >> OFFBTS) & BLKMSK; #ifdef DEBUG fprintf(stderr, "size %ld, maxt %o, bno %d\n", size, maxt, bno); #endif /* * Look for a null separating two lines in the temp file; * if last line was split across blocks, then it is lost * if the last block is. */ while (bno > 0) { ignorl(lseek(tfile, (long) BUFSIZ * bno, 0)); cnt = read(tfile, (char *) bk, BUFSIZ); while (cnt > 0) if (bk[--cnt] == 0) goto null; bno--; } null: /* * Magically calculate the largest valid pointer in the temp file, * consing it up from the block number and the count. */ maxt = ((bno << OFFBTS) | (cnt >> SHFT)) & ~1; #ifdef DEBUG fprintf(stderr, "bno %d, cnt %d, maxt %o\n", bno, cnt, maxt); #endif /* * Now cycle through the line pointers, * trashing the Lusers. */ was = bad = 0; for (ip = one; ip <= dol; ip++) if (*ip > maxt) { #ifdef DEBUG fprintf(stderr, "%d bad, %o > %o\n", ip - zero, *ip, maxt); #endif if (was == 0) was = ip - zero; *ip = ((HBLKS*BUFSIZ)-8) >> SHFT; } else if (was) { if (bad == 0) fprintf(stderr, " [Lost line(s):"); fprintf(stderr, " %d", was); if ((ip - 1) - zero > was) fprintf(stderr, "-%d", (ip - 1) - zero); bad++; was = 0; } if (was != 0) { if (bad == 0) fprintf(stderr, " [Lost line(s):"); fprintf(stderr, " %d", was); if (dol - zero != was) fprintf(stderr, "-%d", dol - zero); bad++; } if (bad) fprintf(stderr, "]"); } /* * Aw shucks, if we only had a (void) cast. */ #ifdef lint Ignorl(a) long a; { a = ((a; } Ignore(a) char *a; { a = a; } Ignorf(a) int (*a)(); { a = a; } ignorl(a) long a; { a = a; } #endif int cntch, cntln, cntodd, cntnull; /* * Following routines stolen mercilessly from ex. */ putfile() { line *a1; register char *fp, *lp; register int nib; a1 = addr1; clrstats(); cntln = addr2 - a1 + 1; if (cntln == 0) return; nib = BUFSIZ; fp = genbuf; do { getline(*a1++); lp = linebuf; for (;;) { if (--nib < 0) { nib = fp - genbuf; if (write(io, genbuf, nib) != nib) wrerror(); cntch += nib; nib = 511; fp = genbuf; } if ((*fp++ = *lp++) == 0) { fp[-1] = '\n'; break; } } } while (a1 <= addr2); nib = fp - genbuf; if (write(io, genbuf, nib) != nib) wrerror(); cntch += nib; } wrerror() { syserror(); } clrstats() { ninbuf = 0; cntch = 0; cntln = 0; cntnull = 0; cntodd = 0; } #define READ 0 #define WRITE 1 getline(tl) line tl; { register char *bp, *lp; register int nl; lp = linebuf; bp = getblock(tl, READ); nl = nleft; tl &= ~OFFMSK; while (*lp++ = *bp++) if (--nl == 0) { bp = getblock(tl += INCRMT, READ); nl = nleft; } } int read(); int write(); char * getblock(atl, iof) line atl; int iof; { register int bno, off; bno = (atl >> OFFBTS) & BLKMSK; off = (atl << SHFT) & LBTMSK; if (bno >= NMBLKS) error(" Tmp file too large"); nleft = BUFSIZ - 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) short b; char *buf; int (*iofcn)(); { lseek(tfile, (long) (unsigned) b * BUFSIZ, 0); if ((*iofcn)(tfile, buf, BUFSIZ) != BUFSIZ) syserror(); } syserror() { extern int sys_nerr; extern char *sys_errlist[]; dirtcnt = 0; write(2, " ", 1); if (errno >= 0 && errno <= sys_nerr) error(sys_errlist[errno]); else error("System error %d", errno); exit(1); } d); return (ibuff + off); } if (oblock >= 0) blkio(oblock, obuff, write); oblock = bno; return (obuff + off); } blkio(b, buf, iofcn) short b; char *buf; int (*iofcn)(); { lseek(tfile, (long) (unsigned) b * BUFSIZ, 0); if ((*iofcn)(tfile, buf, BUFSIZ) != BUFSIZ) syserror(); } syserror() { extern int sys_nerr; extern char *sys_errlist[]; dirtcnt = 0; write(2, " ", 1); if (errno >= 0 && errno <= cmd/ex/bcopy.c 444 0 33 457 2425426347 6466 /* block copy from from to to, count bytes */ static char *sccsid = "@(#)bcopy.c 6.1 10/18/80"; bcopy(from, to, count) #ifdef vax char *from, *to; int count; { asm(" movc3 12(ap),*4(ap),*8(ap)"); } #else register char *from, *to; register int count; { while (count--) *to++ = *from++; } #endif ned) b * BUFSIZ, 0); if ((*iofcn)(tfile, buf, BUFSIZ) != BUFSIZ) syserror(); } syserror() { extern int sys_nerr;/,5< /,"cmd/ex/makefile 444 0 33 13262 2431052143 6726 VERSION=3.6 # # Ex skeletal makefile for VAX VM/Unix version 7 # # NB: This makefile doesn't indicate any dependencies on header files. # # Ex is very large - this version will not fit on PDP-11's without overlay # software. Things that can be turned off to save # space include LISPCODE (-l flag, showmatch and lisp options), UCVISUAL # (visual \ nonsense on upper case only terminals), CHDIR (the undocumented # chdir command.) CRYPT includes the code to edit encrypted files (the -x # option, like ed.) VMUNIX makes ex considerably larger, raising many limits # and improving speed and simplicity of maintenance. It is suitable only # for a VAX or other large machine, and then probably only in a paged system. # # Don't define VFORK unless your system has the VFORK system call, # which is like fork but the two processes have only one data space until the # child execs. This speeds up ex by saving the memory copy. # # If your system expands tabs to 4 spaces you should -DTABS=4 below # BINDIR= /usr/ucb NBINDIR=/usr/new LIBDIR= /usr/lib FOLD= ${BINDIR}/fold CTAGS= ${BINDIR}/ctags XSTR= ${BINDIR}/xstr DEBUGFLAGS= -DTRACE -g NONDEBUGFLAGS= -O DEB= ${NONDEBUGFLAGS} # or ${DEBUGFLAGS} to to debug CFLAGS= -DTABS=8 -DCRYPT -DLISPCODE -DCHDIR -DUCVISUAL -DVFORK -DVMUNIX ${DEB} LDFLAGS= -z # or -i or -n TERMLIB= -ltermcap MKSTR= ${BINDIR}/mkstr CXREF= ${BINDIR}/cxref INCLUDE=/usr/include PR= pr OBJS= ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o \ ex_data.o ex_get.o ex_io.o ex_put.o ex_re.o \ ex_set.o ex_subr.o ex_temp.o ex_tty.o ex_unix.o \ ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voper.o \ ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \ printf.o bcopy.o strings.o HDRS= ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h SRC1= ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c SRC2= ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c SRC3= ex_set.c ex_subr.c ex_temp.c ex_tty.c ex_unix.c SRC4= ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voper.c SRC5= ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c SRC6= printf.c bcopy.c expreserve.c exrecover.c MISC= makefile READ_ME :rofix VGRIND= csh /usr/ucb/vgrind VHDR= "Ex Version ${VERSION}" .c.o: # ifdef VMUNIX ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c - # else # ${MKSTR} - ex${VERSION}strings x $*.c # ${CC} -E ${CFLAGS} x$*.c | ${XSTR} -c - # rm -f x$*.c # endif ${CC} ${CFLAGS} -c x.c mv x.o $*.o a.out: ${OBJS} ${CC} ${LDFLAGS} ${OBJS} ${TERMLIB} all: a.out exrecover expreserve tags tags: /tmp ${CTAGS} -w ex.[hc] ex_*.[hc] ${OBJS}: ex_vars.h # ex_vars.h: # csh makeoptions ${CFLAGS} bcopy.o: bcopy.c ${CC} -c ${CFLAGS} bcopy.c # xstr: hands off! strings.o: strings ${XSTR} ${CC} -c -S xs.c ed - <:rofix xs.s ${AS} -o strings.o xs.s rm xs.s exrecover: exrecover.o ${CC} ${CFLAGS} exrecover.o -o exrecover exrecover.o: exrecover.c ${CC} ${CFLAGS} -c -O exrecover.c expreserve: expreserve.o ${CC} expreserve.o -o expreserve expreserve.o: ${CC} ${CFLAGS} -c -O expreserve.c clean: # If we dont have ex we cant make it so dont rm ex_vars.h -rm -f a.out exrecover expreserve strings core errs trace -rm -f *.o x*.[cs] # install a new version for testing in /usr/new ninstall: a.out -rm -f ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi ${DESTDIR}${NBINDIR}/view cp a.out ${DESTDIR}${NBINDIR}/ex # -cp ex${VERSION}strings ${LIBDIR}/ex${VERSION}strings ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/view chmod 1755 ${DESTDIR}${NBINDIR}/ex # install in standard place (/usr/ucb) install: a.out exrecover expreserve strip a.out -rm -f ${DESTDIR}${BINDIR}/ex -rm -f ${DESTDIR}${BINDIR}/vi -rm -f ${DESTDIR}${BINDIR}/view -rm -f ${DESTDIR}${BINDIR}/edit -rm -f ${DESTDIR}${BINDIR}/e -rm -f ${DESTDIR}/usr/bin/ex cp a.out ${DESTDIR}${BINDIR}/ex # cp ex${VERSION}strings ${DESTDIR}/${LIBDIR}/ex${VERSION}strings ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/view ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex chmod 1755 ${DESTDIR}${BINDIR}/ex cp exrecover ${DESTDIR}${LIBDIR}/ex${VERSION}recover cp expreserve ${DESTDIR}${LIBDIR}/ex${VERSION}preserve chmod 4755 ${DESTDIR}${LIBDIR}/ex${VERSION}recover ${DESTDIR}${LIBDIR}/ex${VERSION}preserve # The following line normally fails. This is OK. -mkdir ${DESTDIR}/usr/preserve # move from /usr/new to /usr/ucb newucb: a.out -rm -f ${DESTDIR}${BINDIR}/ex -rm -f ${DESTDIR}${BINDIR}/vi -rm -f ${DESTDIR}${BINDIR}/edit -rm -f ${DESTDIR}${BINDIR}/e -rm -f ${DESTDIR}/usr/bin/ex mv ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/ex -rm -f ${DESTDIR}${NBINDIR}/vi ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex chmod 1755 ${DESTDIR}${BINDIR}/ex lint: lint ${CFLAGS} ex.c ex_?*.c lint ${CFLAGS} -u exrecover.c lint ${CFLAGS} expreserve.c print: @${PR} READ* BUGS @${PR} makefile* @${PR} /etc/termcap @(size -l a.out ; size *.o) | ${PR} -h sizes @${PR} -h errno.h ${INCLUDE}/errno.h @${PR} -h setjmp.h ${INCLUDE}/setjmp.h @${PR} -h sgtty.h ${INCLUDE}/sgtty.h @${PR} -h signal.h ${INCLUDE}/signal.h @${PR} -h sys/stat.h ${INCLUDE}/sys/stat.h @${PR} -h sys/types.h ${INCLUDE}/sys/types.h @ls -ls | ${PR} @${CXREF} *.c | ${PR} -h XREF @${PR} *.h *.c vgrind: tee index < /dev/null ${VGRIND} -h ${VHDR} ${HDRS} ${VGRIND} -h ${VHDR} ${SRC1} ${VGRIND} -h ${VHDR} ${SRC2} ${VGRIND} -h ${VHDR} ${SRC3} ${VGRIND} -h ${VHDR} ${SRC4} ${VGRIND} -h ${VHDR} ${SRC5} ${VGRIND} -h ${VHDR} ${SRC6} ${VGRIND} -n -h ${VHDR} ${MISC} ${VGRIND} -i -h ${VHDR} index UDE}/sgtty.h @${PR} -h signal.h ${INCLUDE}/signal.h @${PR} -h sys/stat.h ${INCLUDE}/sys/stat.h @${PR} -h sys/types.h ${INCLUDE}/sys/types.h @ls -ls | ${PR} @${CXREF} *.c | ${PR} -h XREF @${PR} *.h *.c vgrind: tee index < /dev/null ${VGRIND} -h ${VHDR} ${HDRS} ${VGRIND} -h ${VHDR} ${SRC1} ${VGRIND} -h ${VHDR} ${SRC2} ${VGR((cmd/ex/makeoptions 444 0 33 1651 2425426362 7474 # # remake options -- this isn't necessary unless you add/delete options # onintr ifintr cp ex_data.c /tmp/$$.c ex - /tmp/$$.c <<'%' g/^#include/d w q '%' cc -E $* /tmp/$$.c >/tmp/foo.c ex - /tmp/foo.c <<'X' " delete all preprocessor output (# line, etc) g/^# /d set sh=/bin/csh " delete junk (all but data lines) g/^[ ]*$/d 1,/option options/d /}/-1,$d " get rid of all of line but option name 1,$s/ "// 1,$s/".*// 1m$ " kludge since options start at 0 but num at 1 %!num $t0 " unkludge 1s/......../ 0 / " unkludge " make #define lines 1,$s/\(......\)\(.*\)/#define \U\2\L \1/ " get rid of extra blanks, turning into (single) tabs. 1,$s/ */ /g g/ */s// /g " filter through expand to make it line up nice %!expand -8\,24 " blank line and number of options. $i . $s/e[ ].*[ ]/e NOPTS / 0a /* sccs id @(#) ex_vars.h @(#)makeoptions 6.1 10/18/80 */ . w! ex_vars.h q 'X' ifintr: rm /tmp/foo.c .*// 1m$ " kludge since options start at 0 but num at 1 %!num $t0 " unkludge 1s/...cmd/ex/printf.c 444 0 33 16724 2425426367 6722 /* The pwb version this is based on */ static char *printf_id = "@(#) printf.c:2.2 6/5/79"; /* The local sccs version within ex */ static char *sccsid = "@(#)printf.c 6.1 10/18/80"; #include "varargs.h" /* * This version of printf is compatible with the Version 7 C * printf. The differences are only minor except that this * printf assumes it is to print through putchar. Version 7 * printf is more general (and is much larger) and includes * provisions for floating point. */ #define MAXOCT 11 /* Maximum octal digits in a long */ #define MAXINT 32767 /* largest normal length positive integer */ #define BIG 1000000000 /* largest power of 10 less than an unsigned long */ #define MAXDIGS 10 /* number of digits in BIG */ static int width, sign, fill; char *_p_dconv(); printf(va_alist) va_dcl { va_list ap; register char *fmt; char fcode; int prec; int length,mask1,nbits,n; long int mask2, num; register char *bptr; char *ptr; char buf[134]; va_start(ap); fmt = va_arg(ap,char *); for (;;) { /* process format string first */ while ((fcode = *fmt++)!='%') { /* ordinary (non-%) character */ if (fcode=='\0') return; putchar(fcode); } /* length modifier: -1 for h, 1 for l, 0 for none */ length = 0; /* check for a leading - sign */ sign = 0; if (*fmt == '-') { sign++; fmt++; } /* a '0' may follow the - sign */ /* this is the requested fill character */ fill = 1; if (*fmt == '0') { fill--; fmt++; } /* Now comes a digit string which may be a '*' */ if (*fmt == '*') { width = va_arg(ap, int); if (width < 0) { width = -width; sign = !sign; } fmt++; } else { width = 0; while (*fmt>='0' && *fmt<='9') width = width * 10 + (*fmt++ - '0'); } /* maybe a decimal point followed by more digits (or '*') */ if (*fmt=='.') { if (*++fmt == '*') { prec = va_arg(ap, int); fmt++; } else { prec = 0; while (*fmt>='0' && *fmt<='9') prec = prec * 10 + (*fmt++ - '0'); } } else prec = -1; /* * At this point, "sign" is nonzero if there was * a sign, "fill" is 0 if there was a leading * zero and 1 otherwise, "width" and "prec" * contain numbers corresponding to the digit * strings before and after the decimal point, * respectively, and "fmt" addresses the next * character after the whole mess. If there was * no decimal point, "prec" will be -1. */ switch (*fmt) { case 'L': case 'l': length = 2; /* no break!! */ case 'h': case 'H': length--; fmt++; break; } /* * At exit from the following switch, we will * emit the characters starting at "bptr" and * ending at "ptr"-1, unless fcode is '\0'. */ switch (fcode = *fmt++) { /* process characters and strings first */ case 'c': buf[0] = va_arg(ap, int); ptr = bptr = &buf[0]; if (buf[0] != '\0') ptr++; break; case 's': bptr = va_arg(ap,char *); if (bptr==0) bptr = "(null pointer)"; if (prec < 0) prec = MAXINT; for (n=0; *bptr++ && n < prec; n++) ; ptr = --bptr; bptr -= n; break; case 'O': length = 1; fcode = 'o'; /* no break */ case 'o': case 'X': case 'x': if (length > 0) num = va_arg(ap,long); else num = (unsigned)va_arg(ap,int); if (fcode=='o') { mask1 = 0x7; mask2 = 0x1fffffffL; nbits = 3; } else { mask1 = 0xf; mask2 = 0x0fffffffL; nbits = 4; } n = (num!=0); bptr = buf + MAXOCT + 3; /* shift and mask for speed */ do if (((int) num & mask1) < 10) *--bptr = ((int) num & mask1) + 060; else *--bptr = ((int) num & mask1) + 0127; while (num = (num >> nbits) & mask2); if (fcode=='o') { if (n) *--bptr = '0'; } else if (!sign && fill <= 0) { putchar('0'); putchar(fcode); width -= 2; } else { *--bptr = fcode; *--bptr = '0'; } ptr = buf + MAXOCT + 3; break; case 'D': case 'U': case 'I': length = 1; fcode = fcode + 'a' - 'A'; /* no break */ case 'd': case 'i': case 'u': if (length > 0) num = va_arg(ap,long); else { n = va_arg(ap,int); if (fcode=='u') num = (unsigned) n; else num = (long) n; } if (n = (fcode != 'u' && num < 0)) num = -num; /* now convert to digits */ bptr = _p_dconv(num, buf); if (n) *--bptr = '-'; if (fill == 0) fill = -1; ptr = buf + MAXDIGS + 1; break; default: /* not a control character, * print it. */ ptr = bptr = &fcode; ptr++; break; } if (fcode != '\0') _p_emit(bptr,ptr); } va_end(ap); } /* _p_dconv converts the unsigned long integer "value" to * printable decimal and places it in "buffer", right-justified. * The value returned is the address of the first non-zero character, * or the address of the last character if all are zero. * The result is NOT null terminated, and is MAXDIGS characters long, * starting at buffer[1] (to allow for insertion of a sign). * * This program assumes it is running on 2's complement machine * with reasonable overflow treatment. */ char * _p_dconv(value, buffer) long value; char *buffer; { register char *bp; register int svalue; int n; long lval; bp = buffer; /* zero is a special case */ if (value == 0) { bp += MAXDIGS; *bp = '0'; return(bp); } /* develop the leading digit of the value in "n" */ n = 0; while (value < 0) { value -= BIG; /* will eventually underflow */ n++; } while ((lval = value - BIG) >= 0) { value = lval; n++; } /* stash it in buffer[1] to allow for a sign */ bp[1] = n + '0'; /* * Now develop the rest of the digits. Since speed counts here, * we do it in two loops. The first gets "value" down until it * is no larger than MAXINT. The second one uses integer divides * rather than long divides to speed it up. */ bp += MAXDIGS + 1; while (value > MAXINT) { *--bp = (int)(value % 10) + '0'; value /= 10; } /* cannot lose precision */ svalue = value; while (svalue > 0) { *--bp = (svalue % 10) + '0'; svalue /= 10; } /* fill in intermediate zeroes if needed */ if (buffer[1] != '0') { while (bp > buffer + 2) *--bp = '0'; --bp; } return(bp); } /* * This program sends string "s" to putchar. The character after * the end of "s" is given by "send". This allows the size of the * field to be computed; it is stored in "alen". "width" contains the * user specified length. If width width) width = alen; cfill = fill>0? ' ': '0'; /* we may want to print a leading '-' before anything */ if (*s == '-' && fill < 0) { putchar(*s++); alen--; width--; } npad = width - alen; /* emit any leading pad characters */ if (!sign) while (--npad >= 0) putchar(cfill); /* emit the string itself */ while (--alen >= 0) putchar(*s++); /* emit trailing pad characters */ if (sign) while (--npad >= 0) putchar(cfill); } alen; int npad; alen = send - s; if (acmd/ex/:rofix 644 0 33 35 2424337732 6322 ((g/^[ ]*\.data/s//.text/ w q cfill = fill>0? ' ': '0'; /* we may want to print a leading '-' before anything */ if (*s == '-' && fill < 0) { putchar(*s++); alen--; width--; } npad = width - alen; /* emit any leading pad characters */ if (!sign) while (--npad >= 0) putchar(cfill); /* emit the string itself */ while (--alen >= 0) putchar(*s++); /* emit trailing pad characters */ if (s/,5؈< /,"cmd/ex/READ_ME 644 0 33 4244 2371746605 6247 This is version 3.1 of the editor. It is too large to fit on a pdp-11 unless you have overlay code. (Such code is expected to be available for v7 unix soon.) Version 2.9 corresponds to version 3.1 without the enhancements in 3.1. There is no reason to use 2.9 unless you have a pdp-11 that does not have overlay software, since 3.1 contains all the bug fixes and some new features. Special installation notes for this version. 1) If on a V6 system using -lretro, be sure to remove the line in /usr/include/retrofit/sgtty.h that defines CBREAK. If you have added a line defining TIOCSETN or TIOCGETC these should be removed. 2) The include file varargs.h should be installed, as the new printf needs it. 3) The include file local/uparm.h should be installed, as ex_tune.h needs it. The contents of this include file can be modified if you wish to place the editor in a nonstandard location. 4) Be sure not to use the -t1 compiler (which puts switches in I space and hence makes larger I segments. This will causes the editor not to fit in 64K on an 11. 5) Use the -t0 compiler which has a large enough symbol table. (V6 only) 6) Be sure to use the new termlib that goes with this version of the editor. 7) Be sure to use the new termcap. 8) Make sure the programs setenv and printenv are installed, and that setenv is able to write /etc/htmp. (V6 only) Conditional compilation flags: -DTRACE for debugging (wont then fit on an 11) -DV6 for version 6, using raw (v7 uses cbreak) -DVFORK for UCB Vax/Unix with the vfork system call. -DCHDIR compile in undocumented old chdir (cd) command -DLISP compile in lisp hacks -DUCVISUAL compile in code to handle \ escapes for visual on upper case only terminals. gross. Ex means to avoid stdio like the plague. If any of stdio other than the ctype.h functions or str* get pulled in, it is a mistake. Ex is very large, but should fit (barely) on an 11/70. There are only a few bytes of room left in version 2.9 unless you take out some of CHDIR, LISP, or UCVISUAL. This assumes the new termlib (which knows about the tc= capability, 1024 byte entries, and @ cancellation of capabilities); and that -t1 is NOT used for compilation. visual on upper case only terminals. gross. Ex means to avoid stdio like the plague. If any of stdio other than the ctype.h functions or str* get pulled in, it is a mistake. Ex is very large, but should fit (barely) on an 11/70. There are only a few bytes of room left in version 2.9 unless you take out some of CHDIR, LISP, or UCVISUAL. Thcmd/ex/makefile.70 444 0 33 14232 2432343742 7162 VERSION=3.6 # # Ex skeletal makefile for version 7, USGS Overlay 11/70 system # # NB: This makefile doesn't indicate any dependencies on header files. # # Ex is very large - this version will not fit on PDP-11's without overlay # software. Things that can be turned off to save # space include LISPCODE (-l flag, showmatch and lisp options), UCVISUAL # (visual \ nonsense on upper case only terminals), CHDIR (the undocumented # chdir command.) CRYPT includes code to handle the -x option to allow # encrypted files. Defining CRYPT drags in most of stdio (from the call # to getpass) and makes vi about 4k text and 4k data bigger). # VMUNIX makes ex considerably larger, raising many limits # and improving speed and simplicity of maintenance. It is suitable only # for a VAX or other large machine, and then probably only in a paged system. # # Don't define VFORK unless your system has the VFORK system call, # which is like fork but the two processes have only one data space until the # child execs. This speeds up ex by saving the memory copy. # # If your system expands tabs to 4 spaces you should -DTABS=4 below # BINDIR= /usr/ucb/bin NBINDIR=/usr/new/bin LIBDIR= /usr/ucb/lib FOLD= ${BINDIR}/fold CTAGS= ${BINDIR}/ctags XSTR= ${BINDIR}/xstr CC= cc -V AS= ovas LD= ovld DEBUGFLAGS= -DTRACE NONDEBUGFLAGS= -O DEB= ${NONDEBUGFLAGS} # or ${DEBUGFLAGS} to to debug CFLAGS= -DTABS=8 -DLISPCODE -DCHDIR -DUCVISUAL ${DEB} TERMLIB= -lovtermlib MKSTR= ${BINDIR}/mkstr CXREF= ${BINDIR}/cxref # PRINTF= printf.o; PRINTFS=printf.c PRINTF= ovprintf.o ovdoprnt.o PRINTFS=ovprintf.c ovdoprnt.s FMT= -i # 11/45, 70 # FMT= -n # 11/23, 34, 40 INCLUDE=/usr/include PR= pr GET= sccs get OBJS= ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o \ ex_data.o ex_get.o ex_io.o ex_put.o ex_re.o \ ex_set.o ex_subr.o ex_temp.o ex_tty.o ex_unix.o \ ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voper.o \ ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \ ${PRINTF} bcopy.o strings.o SRCS= ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h\ ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c \ ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c \ ex_set.c ex_subr.c ex_temp.c ex_tty.c ex_unix.c \ ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voper.c \ ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c \ ${PRINTFS} bcopy.c .c.o: ${MKSTR} - ex${VERSION}strings x $*.c ${CC} -E ${CFLAGS} x$*.c | ${XSTR} -c - rm -f x$*.c ${CC} ${CFLAGS} -c x.c mv x.o $*.o # 11/23, 34, 40 and other non split I/D machines # each of the 5 overlays must stay less than 16K. # a.out: ${OBJS} # ${LD} -X /lib/crt0.o ${FMT}\ # -Z ex_cmds.o ex_cmds2.o ex_cmdsub.o ex_re.o \ # -Z ex_vadj.o ex_vmain.o ex_voper.o ex_vwind.o ex_vops3.o\ # -Z ex_v.o ex_vget.o ex_vops.o ex_vops2.o ex_vput.o\ # -Z ex_get.o ex_io.o ex_temp.o ex_tty.o ex_unix.o ex_addr.o ex.o ex_set.o \ # -L ex_put.o ex_subr.o ${PRINTF} strings.o \ # ex_data.o ${TERMLIB} -lovc a.out: ${OBJS} ${LD} -X /lib/crt0.o ${FMT}\ -Z ex_voper.o ex_vget.o ex_vops.o ex_vops2.o ex_vops3.o \ -Z ex_set.o ex_re.o ex_io.o ex_tty.o ex_unix.o ex.o\ -L ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o ex_get.o ex_temp.o\ ex_v.o ex_vadj.o ex_vmain.o ex_vwind.o\ ex_vput.o ex_put.o ex_subr.o ${PRINTF} strings.o \ ex_data.o ${TERMLIB} -lovc all: a.out exrecover expreserve tags: /tmp ${CTAGS} -w ex.[hc] ex_*.[hc] # ex_vars.h: # csh makeoptions ${CFLAGS} strings.o: strings ${XSTR} ${CC} -c -S xs.c # ed - <:rofix xs.s ${AS} -o strings.o xs.s rm xs.s exrecover: exrecover.o ${CC} ${CFLAGS} exrecover.o -o exrecover exrecover.o: exrecover.c ${CC} ${CFLAGS} -c -O exrecover.c expreserve: expreserve.o ${CC} expreserve.o -o expreserve expreserve.o: ${CC} ${CFLAGS} -c -O expreserve.c clean: # If we dont have ex we cant make it so dont rm ex_vars.h -rm -f a.out exrecover expreserve strings core errs trace -rm -f *.o x*.[cs] # install a new version for testing in /usr/new ninstall: a.out -rm -f ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi ${DESTDIR}${NBINDIR}/view cp a.out ${DESTDIR}${NBINDIR}/ex # -cp ex${VERSION}strings ${LIBDIR}/ex${VERSION}strings ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/view chmod 1755 ${DESTDIR}${NBINDIR}/ex # install in standard place (/usr/ucb) install: a.out exrecover expreserve -rm -f ${DESTDIR}${BINDIR}/ex -rm -f ${DESTDIR}${BINDIR}/vi -rm -f ${DESTDIR}${BINDIR}/view -rm -f ${DESTDIR}${BINDIR}/edit -rm -f ${DESTDIR}${BINDIR}/e -rm -f ${DESTDIR}/usr/bin/ex cp a.out ${DESTDIR}${BINDIR}/ex # cp ex${VERSION}strings ${DESTDIR}/${LIBDIR}/ex${VERSION}strings ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/view ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex chmod 1755 ${DESTDIR}${BINDIR}/ex cp exrecover ${DESTDIR}${LIBDIR}/ex${VERSION}recover cp expreserve ${DESTDIR}${LIBDIR}/ex${VERSION}preserve chmod 4755 ${DESTDIR}${LIBDIR}/ex${VERSION}recover ${DESTDIR}${LIBDIR}/ex${VERSION}preserve # The following line normally fails. This is OK. mkdir ${DESTDIR}/usr/preserve # move from /usr/new to /usr/ucb newucb: a.out -rm -f ${DESTDIR}${BINDIR}/ex -rm -f ${DESTDIR}${BINDIR}/vi -rm -f ${DESTDIR}${BINDIR}/edit -rm -f ${DESTDIR}${BINDIR}/e -rm -f ${DESTDIR}/usr/bin/ex mv ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/ex -rm -f ${DESTDIR}${NBINDIR}/vi ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex chmod 1755 ${DESTDIR}${BINDIR}/ex lint: lint ${CFLAGS} ex.c ex_?*.c lint ${CFLAGS} -u exrecover.c lint ${CFLAGS} expreserve.c print: @${PR} READ* BUGS @${PR} makefile* @${PR} /etc/termcap @(size -l a.out ; size *.o) | ${PR} -h sizes @${PR} -h errno.h ${INCLUDE}/errno.h @${PR} -h setjmp.h ${INCLUDE}/setjmp.h @${PR} -h sgtty.h ${INCLUDE}/sgtty.h @${PR} -h signal.h ${INCLUDE}/signal.h (( @${PR} -h sys/stat.h ${INCLUDE}/sys/stat.h @${PR} -h sys/types.h ${INCLUDE}/sys/types.h @ls -ls | ${PR} @${CXREF} *.c | ${PR} -h XREF @${PR} *.h *.c lint ${CFLAGS} ex.c ex_?*.c lint ${CFLAGS} -u exrecover.c lint ${CFLAGS} expreserve.c print: @${PR} READ* BUGS @${PR} makefile* @${PR} /etc/termcap @(size -l a.out ; size *.o) | ${PR} -h sizes @${PR} -h errno.h ${INCLUDE}/errno.h @${PR} -h setjmp.h ${INCLUDE}/setjmp.h @${PR} -h sgtty.h ${INCLUDE}/sgtty.h @${PR} -h signal.h ${INCLUDE}/signal.h cmd/f77/ 775 0 33 0 2552543061 5120 cmd/f77/main.c 644 0 33 7044 2477646412 6312 char *xxxvers[] = "\n@(#) FORTRAN 77 PASS 1, VERSION 2.10, 16 AUGUST 1980\n"; #include "defs" #include #ifdef SDB # include # ifndef N_SO # include # endif #endif main(argc, argv) int argc; char **argv; { char *s; int k, retcode, *ip; FILEP opf(); int flovflo(); #define DONE(c) { retcode = c; goto finis; } signal(SIGFPE, flovflo); /* catch overflows */ #if HERE == PDP11 ldfps(01200); /* trap on overflow */ #endif --argc; ++argv; while(argc>0 && argv[0][0]=='-') { for(s = argv[0]+1 ; *s ; ++s) switch(*s) { case 'w': if(s[1]=='6' && s[2]=='6') { ftn66flag = YES; s += 2; } else nowarnflag = YES; break; case 'U': shiftcase = NO; break; case 'u': undeftype = YES; break; case 'O': optimflag = YES; if( isdigit(s[1]) ) { k = *++s - '0'; if(k > MAXREGVAR) { warn1("-O%d: too many register variables", k); maxregvar = MAXREGVAR; } else maxregvar = k; } break; case 'd': debugflag = YES; break; case 'p': profileflag = YES; break; case 'C': checksubs = YES; break; case '6': no66flag = YES; noextflag = YES; break; case '1': onetripflag = YES; break; #ifdef SDB case 'g': sdbflag = YES; break; #endif case 'N': switch(*++s) { case 'q': ip = &maxequiv; goto getnum; case 'x': ip = &maxext; goto getnum; case 's': ip = &maxstno; goto getnum; case 'c': ip = &maxctl; goto getnum; case 'n': ip = &maxhash; goto getnum; default: fatali("invalid flag -N%c", *s); } getnum: k = 0; while( isdigit(*++s) ) k = 10*k + (*s - '0'); if(k <= 0) fatal("Table size too small"); *ip = k; break; case 'I': if(*++s == '2') tyint = TYSHORT; else if(*s == '4') { shortsubs = NO; tyint = TYLONG; } else if(*s == 's') shortsubs = YES; else fatali("invalid flag -I%c\n", *s); tylogical = tyint; break; default: fatali("invalid flag %c\n", *s); } --argc; ++argv; } if(argc != 4) fatali("arg count %d", argc); asmfile = opf(argv[1]); initfile = opf(argv[2]); textfile = opf(argv[3]); initkey(); if(inilex( copys(argv[0]) )) DONE(1); fprintf(diagfile, "%s:\n", argv[0]); #ifdef SDB #ifndef UCBPASS2 for(s = argv[0] ; ; s += 8) { prstab(s,N_SO,0,0); if( strlen(s) < 8 ) break; } #else prstab(argv[0],N_SO,0,0); #endif #endif fileinit(); procinit(); if(k = yyparse()) { fprintf(diagfile, "Bad parse, return code %d\n", k); DONE(1); } if(nerr > 0) DONE(1); if(parstate != OUTSIDE) { warn("missing END statement"); endproc(); } doext(); preven(ALIDOUBLE); prtail(); #if FAMILY==PCC puteof(); #endif if(nerr > 0) DONE(1); DONE(0); finis: done(retcode); return(retcode); } done(k) int k; { static int recurs = NO; if(recurs == NO) { recurs = YES; clfiles(); } exit(k); } LOCAL FILEP opf(fn) char *fn; { FILEP fp; if( fp = fopen(fn, "w") ) return(fp); fatalstr("cannot open intermediate file %s", fn); /* NOTREACHED */ } LOCAL clfiles() { clf(&textfile); clf(&asmfile); clf(&initfile); } clf(p) FILEP *p; { if(p!=NULL && *p!=NULL && *p!=stdout) { if(ferror(*p)) fatal("writing error"); fclose(*p); } *p = NULL; } flovflo() { err("floating exception during constant evaluation"); #if HERE == VAX fatal("vax cannot recover from floating exception"); /* vax returns a reserved operand that generates an illegal operand fault on next instruction, which if ignored causes an infinite loop. */ #endif signal(SIGFPE, flovflo); } s() { clf(&textfile); clf(&asmfile); clf(&initfile); } clf(p) FILEP *p; { if(p!=NULL && *p!=NULL && *p!=stdout) { if(ferror(*p)) fatal("writing error"); fclose(*p); } *p = NULL; } flovflo() { err("floating exception during constant evaluation"); #if HERE == VAX fatal("vax cannot recover from floating exception"); /* vax returns a reserved operand that generates an illegal operand fault on next instruction, which if ignored causes an infinite loop. *cmd/f77/Makefile 644 0 33 2711 2412644104 6637 # Makefile for a Fortran 77 compiler # running on the VAX, generating code for the VAX, # using the second pass of the Portable C compiler as code generator. CFL = -DHERE=VAX -DTARGET=VAX -DFAMILY=PCC -DUCBVAXASM -DUCBPASS2 CFLAGS = -O $(CFL) DESTDIR = OBJECTS = main.o init.o gram.o lex.o proc.o equiv.o data.o \ expr.o exec.o intr.o io.o misc.o error.o put.o \ putpcc.o vax.o vaxx.o compiler : f77 f77pass1 touch compiler f77 : driver.o vaxx.o cc -n driver.o vaxx.o -o f77 @size f77 f77pass1 : $(OBJECTS) @echo LOAD @$(CC) $(LDFLAGS) $(OBJECTS) -o f77pass1 @size f77pass1 gram.c: gram.head gram.dcl gram.expr gram.exec gram.io tokdefs ( sed gram.in $(YACC) $(YFLAGS) gram.in @echo "(expect 4 shift/reduce)" mv y.tab.c gram.c rm gram.in tokdefs: tokens grep -n . tokdefs lex.o : tokdefs driver.o $(OBJECTS) : defs defines machdefs ftypes driver.o : drivedefs io.o : fio.h machdefs : vaxdefs cp vaxdefs machdefs put.o putpcc.o vax.o : pccdefs install : ${DESTDIR}/usr/bin/f77 ${DESTDIR}/usr/lib/f77pass1 ${DESTDIR}/usr/bin/f77 : f77 strip f77 @size f77 ${DESTDIR}/usr/bin/f77 cp f77 ${DESTDIR}/usr/bin/f77 ${DESTDIR}/usr/lib/f77pass1 : f77pass1 strip f77pass1 @size f77pass1 ${DESTDIR}/usr/lib/f77pass1 cp f77pass1 ${DESTDIR}/usr/lib/f77pass1 clean: -rm gram.c *.o f77 f77pass1 tokdefs compiler du ECTS) : defs defines machdefs ftypes driver.o : drivedcmd/f77/drivedefs 644 0 33 1030 2411243472 7070 /* Definitions for Fortran 77 Compiler driver For the VAX, Running on the VAX, using the second pass of the Portable C compiler as code generator. */ #if HERE!=VAX || TARGET!=VAX || FAMILY!=PCC Wrong Definitions File! #endif #define PASS1NAME "/usr/lib/f77pass1" #define PASS2NAME "/lib/f1" #define PASS2OPT "/lib/c2" #define ASMNAME "/bin/as" #define LDNAME "/bin/ld" #define FOOTNAME "/lib/crt0.o" #define PROFFOOT "/lib/mcrt0.o" #define TEMPPREF "fort" static char *liblist [ ] = { "-lF77", "-lI77", "-lm", "-lc", NULL }; tran 77 Compiler driver For the VAX, Running on the VAX, using the second pass of the Portable C compiler as code generator. */ #if HERE!=VAX || TARGET!=VAX || FAMILY!=PCC Wrong Definitions File! #endif #define PASS1NAME "/usr/lib/f77pass1" #define PASS2NAME "/lib/f1" #define PASS2OPT "/lib/c2" #define ASMNAME "/bin/as" #define LDNAME "/bin/ld" #define FOOTNAME "/lib/crt0.o" #define PROFFOOT "/lib/mcrt0.o" #define TEMPPREF "fort" static char *liblist [ ] = { "-lF77", "-lI77"cmd/f77/defs 644 0 33 17312 2411243473 6071 #include #ifdef unix # include #endif #include "ftypes" #include "defines" #include "machdefs" #define VL 6 #define MAXDIM 20 #define MAXINCLUDES 10 #define MAXLITERALS 20 #define MAXCTL 20 #define MAXHASH 401 #define MAXSTNO 201 #define MAXEXT 200 #define MAXEQUIV 150 #define MAXLABLIST 125 typedef union Expression *expptr; typedef union Taggedblock *tagptr; typedef struct Chain *chainp; typedef struct Addrblock *Addrp; typedef struct Constblock *Constp; typedef struct Exprblock *E((xprp; typedef struct Nameblock *Namep; extern FILEP infile; extern FILEP diagfile; extern FILEP textfile; extern FILEP asmfile; extern FILEP initfile; extern long int headoffset; extern char token [ ]; extern int toklen; extern int lineno; extern char *infname; extern int needkwd; extern struct Labelblock *thislabel; extern int maxctl; extern int maxequiv; extern int maxstno; extern int maxhash; extern int maxext; extern flag profileflag; extern flag optimflag; extern flag nowarnflag; extern flag ftn66flag; extern flag no66flag; extern flag noextflag; extern flag shiftcase; extern flag undeftype; extern flag shortsubs; extern flag onetripflag; extern flag checksubs; extern flag debugflag; extern int nerr; extern int nwarn; extern int ndata; extern int parstate; extern flag headerdone; extern int blklevel; extern flag saveall; extern flag substars; extern int impltype[ ]; extern int implleng[ ]; extern int implstg[ ]; extern int tyint; extern int tylogical; extern ftnint typesize[]; extern int typealign[]; extern int procno; extern int proctype; extern char * procname; extern int rtvlabel[ ]; extern int fudgelabel; /* to confuse the pdp11 optimizer */ extern Addrp typeaddr; extern Addrp retslot; extern int cxslot; extern int chslot; extern int chlgslot; extern int procclass; extern ftnint procleng; extern int nentry; extern flag multitype; extern int blklevel; extern int lastlabno; extern int lastvarno; extern int lastargslot; extern int argloc; extern ftnint autoleng; extern ftnint bssleng; extern int retlabel; extern int ret0label; extern int dorange; extern int regnum[ ]; extern Namep regnamep[ ]; extern int maxregvar; extern int highregvar; extern int nregvar; extern chainp templist; extern int maxdim; extern chainp holdtemps; extern struct Entrypoint *entries; extern struct Rplblock *rpllist; extern struct Chain *curdtp; extern ftnint curdtelt; extern flag toomanyinit; extern flag inioctl; extern int iostmt; extern Addrp ioblkp; extern int nioctl; extern int nequiv; extern int eqvstart; /* offset to eqv number to guarantee uniqueness */ extern int nintnames; #ifdef SDB extern int dbglabel; extern flag sdbflag; #endif struct Chain { chainp nextp; tagptr datap; }; extern chainp chains; struct Headblock { field tag; field vtype; field vclass; field vstg; expptr vleng; } ; struct Ctlframe { unsigned ctltype:8; unsigned dostepsign:8; int ctlabels[4]; int dolabel; Namep donamep; expptr domax; expptr dostep; }; #define endlabel ctlabels[0] #define elselabel ctlabels[1] #define dobodylabel ctlabels[1] #define doposlabel ctlabels[2] #define doneglabel ctlabels[3] extern struct Ctlframe *ctls; extern struct Ctlframe *ctlstack; extern struct Ctlframe *lastctl; struct Extsym { char extname[XL]; field extstg; unsigned extsave:1; unsigned extinit:1; chainp extp; ftnint extleng; ftnint maxleng; }; extern struct Extsym *extsymtab; extern struct Extsym *nextext; extern struct Extsym *lastext; struct Labelblock { int labelno; unsigned blklevel:8; unsigned labused:1; unsigned labinacc:1; unsigned labdefined:1; unsigned labtype:2; ftnint stateno; }; extern struct Labelblock *labeltab; extern struct Labelblock *labtabend; extern struct Labelblock *highlabtab; struct Entrypoint { struct Entrypoint *entnextp; struct Extsym *entryname; chainp arglist; int entrylabel; int typelabel; Namep enamep; }; struct Primblock { field tag; field vtype; Namep namep; struct Listblock *argsp; expptr fcharp; expptr lcharp; }; struct Hashentry { int hashval; Namep varp; }; extern struct Hashentry *hashtab; extern struct Hashentry *lasthash; struct Intrpacked /* bits for intrinsic function description */ { unsigned f1:3; unsigned f2:4; unsigned f3:7; }; struct Nameblock { field tag; field vtype; field vclass; field vstg; expptr vleng; char varname[VL]; unsigned vdovar:1; unsigned vdcldone:1; unsigned vadjdim:1; unsigned vsave:1; unsigned vprocclass:3; unsigned vregno:4; union { int varno; struct Intrpacked intrdesc; /* bits for intrinsic function*/ } vardesc; struct Dimblock *vdim; ftnint voffset; union { chainp namelist; /* points to chain of names in */ chainp vstfdesc; /* points to (formals, expr) pair */ } varxptr; }; struct Paramblock { field tag; field vtype; field vclass; field vstg; expptr vleng; char varname[VL]; expptr paramval; } ; struct Exprblock { field tag; field vtype; field vclass; field vstg; expptr vleng; unsigned opcode:6; expptr leftp; expptr rightp; }; union Constant { char *ccp; ftnint ci; double cd[2]; }; struct Constblock { field tag; field vtype; field vclass; field vstg; expptr vleng; union Constant const; }; struct Listblock { field tag; field vtype; chainp listp; }; struct Addrblock { field tag; field vtype; field vclass; field vstg; expptr vleng; int memno; expptr memoffset; unsigned istemp:1; unsigned ntempelt:10; ftnint varleng; }; struct Errorblock { field tag; field vtype; }; union Expression { field tag; struct Headblock headblock; struct Exprblock exprblock; struct Addrblock addrblock; struct Constblock constblock; struct Errorblock errorblock; struct Listblock listblock; struct Primblock primblock; } ; struct Dimblock { int ndim; expptr nelt; expptr baseoffset; expptr basexpr; struct { expptr dimsize; expptr dimexpr; } dims[1]; }; struct Impldoblock { field tag; unsigned isactive:1; unsigned isbusy:1; Namep varnp; Constp varvp; chainp impdospec; expptr implb; expptr impub; expptr impstep; ftnint impdiff; ftnint implim; struct Chain *datalist; }; struct Rplblock /* name replacement block */ { struct Rplblock *rplnextp; Namep rplnp; expptr rplvp; expptr rplxp; int rpltag; }; struct Equivblock { struct Eqvchain *equivs; flag eqvinit; long int eqvtop; long int eqvbottom; } ; #define eqvleng eqvtop extern struct Equivblock *eqvclass; struct Eqvchain { struct Eqvchain *eqvnextp; union { struct Primblock *eqvlhs; Namep eqvname; } eqvitem; long int eqvoffset; } ; union Taggedblock { field tag; struct Headblock headblock; struct Nameblock nameblock; struct Paramblock paramblock; struct Exprblock exprblock; struct Constblock constblock; struct Listblock listblock; struct Addrblock addrblock; struct Errorblock errorblock; struct Primblock primblock; struct Impldoblock impldoblock; } ; struct Literal { short littype; short litnum; union { ftnint litival; double litdval; struct { char litclen; /* small integer */ char litcstr[XL]; } litcval; } litval; }; extern struct Literal litpool[ ]; extern int nliterals; /* popular functions with non integer return values */ int *ckalloc(); char *varstr(), *nounder(), *varunder(); char *copyn(), *copys(); chainp hookup(), mkchain(); ftnint convci(); char *convic(); char *setdoto(); double convcd(); Namep mkname(); struct Labelblock *mklabel(), *execlab(); struct Extsym *mkext(), *newentry(); expptr addrof(), call1(), call2(), call3(), call4(); Addrp builtin(), mktemp(), mktmpn(), autovar(); Addrp mkplace(), mkaddr(), putconst(), memversion(); expptr mkprim(), mklhs(), mkexpr(), mkconv(), mkfunct(), fixexpr(), fixtype(); expptr errnode(), mkintcon(); tagptr cpexpr(); ftnint lmin(), lmax(), iarrlen(); opys(); chainp hookup(), mkchain(); ftnint convci(); char *convic(); char *setdoto(); double convcd(); Namep mkname(); struct Labelblock *mklabel(), *execlab(); struct Extsym *mkext(), *newentry(); expptr addrof(), call1(), call2(), call3(), call4(); Addrp builtin(), mktemp(), mktmpn(), autovar(); Addrp mkplacmd/f77/defines 644 0 33 10313 2411243473 6557 #define INTERDATA 2 #define GCOS 3 #define PDP11 4 #define IBM 5 #define CMACH 6 #define VAX 7 #define DMR 2 #define PCC 3 #ifndef FAMILY FAMILY NOT DEFINED !!! Family = FAMILY #endif #ifndef HERE HERE NOT DEFINED !!!! Here = HERE #endif #define M(x) (1<tag==TCONST && ISINT(z->constblock.vtype)) #define ISCHAR(z) (z->headblock.vtype==TYCHAR) #define ISINT(z) ONEOF(z, MSKINT) #define ISCONST(z) (z->tag==TCONST) #define ISERROR(z) (z->tag==TERROR) #define ISPLUSOP(z) (z->tag==TEXPR && z->exprblock.opcode==OPPLUS) #define ISSTAROP(z) (z->tag==TEXPR && z->exprblock.opcode==OPSTAR) #define ISONE(z) (ISICON(z) && z->constblock.const.ci==1) #define INT(z) ONEOF(z, MSKINT|MSKCHAR) #define ICON(z) mkintcon( (ftnint)(z) ) #define NO66(s) if(no66flag) err66(s) #define NOEXT(s) if(noextflag) errext(s) /* round a up to a multiple of b */ #define roundup(a,b) ( b * ( (a+b-1)/b) ) KINT) #define ISCONST(z) (z->tag==TCONST) #define ISERROR(z) (z->tag==TERROR) #define ISPLUSOP(z) (z->tag==TEXPR && z->exprblock.opcode==OPPLUS) #define ISSTAROP(z) (z->tag==TEXPR && z->exprblock.opcode==OPSTAR) #define ISONE(z) (ISICON(z) && z->constblock.const.ci==1) #define INT(z) ONEOF(z, MSKINT|MSKCHAR)cmd/f77/ftypes 644 0 33 605 2411243473 6417 /* variable types * numeric assumptions: * int < reals < complexes * TYDREAL-TYREAL = TYDCOMPLEX-TYCOMPLEX */ #define TYUNKNOWN 0 #define TYADDR 1 #define TYSHORT 2 #define TYLONG 3 #define TYREAL 4 #define TYDREAL 5 #define TYCOMPLEX 6 #define TYDCOMPLEX 7 #define TYLOGICAL 8 #define TYCHAR 9 #define TYSUBR 10 #define TYERROR 11 #define NTYPES (TYERROR+1) #define TYBLANK TYSUBR exprblock.opcode==OPSTAR) #defi/,5< /,"cmd/f77/tokens 644 0 33 1301 2411243474 6423 SEOS SCOMMENT SLABEL SUNKNOWN SHOLLERITH SICON SRCON SDCON SBITCON SOCTCON SHEXCON STRUE SFALSE SNAME SNAMEEQ SFIELD SSCALE SINCLUDE SLET SASSIGN SAUTOMATIC SBACKSPACE SBLOCK SCALL SCHARACTER SCLOSE SCOMMON SCOMPLEX SCONTINUE SDATA SDCOMPLEX SDIMENSION SDO SDOUBLE SELSE SELSEIF SEND SENDFILE SENDIF SENTRY SEQUIV SEXTERNAL SFORMAT SFUNCTION SGOTO SASGOTO SCOMPGOTO SARITHIF SLOGIF SIMPLICIT SINQUIRE SINTEGER SINTRINSIC SLOGICAL SNAMELIST SOPEN SPARAM SPAUSE SPRINT SPROGRAM SPUNCH SREAD SREAL SRETURN SREWIND SSAVE SSTATIC SSTOP SSUBROUTINE STHEN STO SUNDEFINED SWRITE SLPAR SRPAR SEQUALS SCOLON SCOMMA SCURRENCY SPLUS SMINUS SSTAR SSLASH SPOWER SCONCAT SAND SOR SNEQV SEQV SNOT SEQ SLT SGT SLE SGE SNE CLOSE SCOMMON SCOMPLEX SCONTINUE SDATA SDCOMPLEX SDIMENSION SDO SDOUBLE SELSE SELSEIF SEND SENDFILE SENDIF SENTRY SEQUIV SEXTERNAL SFORMAT SFUNCTION SGOTO SASGOTO SCOMPGOTO SARITHIF SLOGIF SIMPLICIT SINQUIRE SINTEGER SINTRINSIC SLOGICAL SNAMELIST SOPEN SPARAM SPAUSE SPRINT SPROGRAM SPUNCH SREAD SREAL SRETURN SREWIND Scmd/f77/fio.h 644 0 33 3475 2411243474 6141 #include typedef long ftnint; typedef ftnint flag; typedef long ftnlen; /*external read, write*/ typedef struct { flag cierr; ftnint ciunit; flag ciend; char *cifmt; ftnint cirec; } cilist; /*internal read, write*/ typedef struct { flag icierr; char *iciunit; flag iciend; char *icifmt; ftnint icirlen; ftnint icirnum; } icilist; /*open*/ typedef struct { flag oerr; ftnint ounit; char *ofnm; ftnlen ofnmlen; char *osta; char *oacc; char *ofm; ftnint orl; char *oblnk; } olist; /*close*/ typedef struct { flag cerr; ftnint cunit; char *csta; } cllist; /*rewind, backspace, endfile*/ typedef struct { flag aerr; ftnint aunit; } alist; /*units*/ typedef struct { FILE *ufd; /*0=unconnected*/ char *ufnm; long uinode; int url; /*0=sequential*/ flag useek; /*true=can backspace, use dir, ...*/ flag ufmt; flag uprnt; flag ublnk; flag uend; flag uwrt; /*last io was write*/ flag uscrtch; } unit; typedef struct { flag inerr; ftnint inunit; char *infile; ftnlen infilen; ftnint *inex; /*parameters in standard's order*/ ftnint *inopen; ftnint *innum; ftnint *innamed; char *inname; ftnlen innamlen; char *inacc; ftnlen inacclen; char *inseq; ftnlen inseqlen; char *indir; ftnlen indirlen; char *infmt; ftnlen infmtlen; char *inform; ftnint informlen; char *inunf; ftnlen inunflen; ftnint *inrecl; ftnint *innrec; char *inblank; ftnlen inblanklen; } inlist; extern int errno; extern flag init; extern cilist *elist; /*active external io list*/ extern flag reading,external,sequential,formatted; extern int (*getn)(),(*putn)(); /*for formatted io*/ extern FILE *cf; /*current file*/ extern unit *curunit; /*current unit*/ extern unit units[]; #define err(f,n,s) {if(f) errno= n; else fatal(n,s); return(n);} /*Table sizes*/ #define MXUNIT 10 extern int recpos; /*position in current record*/ int *inrecl; ftnint *innrec; char *inblank; ftnlen inblanklen; } inlist; extern int errno; extern flag init; extern cilist *elist; /*active external io list*/ extern flag reading,external,seqcmd/f77/driver.c 644 0 33 44200 2500266433 6660 char *xxxvers[] = "\n@(#) FORTRAN 77 DRIVER, VERSION 2.03.5, 7 NOVEMBER 1980\n"; #include #include #include "defines" #include "machdefs" #include "drivedefs" #include "ftypes" #include static FILEP diagfile = {stderr} ; static int pid; static int sigivalue = 0; static int sigqvalue = 0; static int sighvalue = 0; static int sigtvalue = 0; static char *pass1name = PASS1NAME ; static char *pass2name = PASS2NAME ; static char *asmname = ASMNAME ; static char *ldname = LDNAME ; static char *footname = FOOTNAME; static char *proffoot = PROFFOOT; static char *macroname = "m4"; static char *shellname = "/bin/sh"; static char *aoutname = "a.out" ; static char *temppref = TEMPPREF; static char *infname; static char textfname[44]; static char asmfname[44]; static char asmpass2[44]; static char initfname[44]; static char sortfname[44]; static char prepfname[44]; static char objfdefault[44]; static char optzfname[44]; static char setfname[44]; static char fflags[50] = "-"; static char cflags[50] = "-c"; #if TARGET == GCOS static char eflags[30] = "system=gcos "; #else static char eflags[30] = "system=unix "; #endif static char rflags[30] = ""; static char lflag[3] = "-x"; static char *fflagp = fflags+1; static char *cflagp = cflags+2; static char *eflagp = eflags+12; static char *rflagp = rflags; static char **loadargs; static char **loadp; static flag erred = NO; static flag loadflag = YES; static flag saveasmflag = NO; static flag profileflag = NO; static flag optimflag = NO; static flag debugflag = NO; static flag verbose = NO; static flag nofloating = NO; static flag fortonly = NO; static flag macroflag = NO; static flag sdbflag = NO; main(argc, argv) int argc; char **argv; { int i, c, status; char *setdoto(), *lastchar(), *lastfield(), *copys(); ptr ckalloc(); register char *s; char fortfile[20], *t; char buff[100]; int intrupt(); sigivalue = (int) signal(SIGINT, SIG_IGN) & 01; sigqvalue = (int) signal(SIGQUIT,SIG_IGN) & 01; sighvalue = (int) signal(SIGHUP, SIG_IGN) & 01; sig((tvalue = (int) signal(SIGTERM,SIG_IGN) & 01; enbint(intrupt); pid = getpid(); crfnames(); loadargs = (char **) ckalloc( (argc+20) * sizeof(*loadargs) ); loadargs[1] = "-X"; loadargs[2] = "-u"; #if HERE==PDP11 || HERE==VAX loadargs[3] = "_MAIN__"; #endif #if HERE == INTERDATA loadargs[3] = "main"; #endif loadp = loadargs + 4; --argc; ++argv; while(argc>0 && argv[0][0]=='-' && argv[0][1]!='\0') { for(s = argv[0]+1 ; *s ; ++s) switch(*s) { case 'T': /* use special passes */ switch(*++s) { case '1': pass1name = s+1; goto endfor; case '2': pass2name = s+1; goto endfor; case 'a': asmname = s+1; goto endfor; case 'l': ldname = s+1; goto endfor; case 'F': footname = s+1; goto endfor; case 'm': macroname = s+1; goto endfor; case 't': temppref = s+1; goto endfor; default: fatali("bad option -T%c", *s); } break; case '6': if(s[1]=='6') { *fflagp++ = *s++; goto copyfflag; } else { fprintf(diagfile, "invalid flag 6%c\n", s[1]); done(1); } case 'w': if(s[1]=='6' && s[2]=='6') { *fflagp++ = *s++; *fflagp++ = *s++; } copyfflag: case 'u': case 'U': case '1': case 'C': *fflagp++ = *s; break; case 'O': optimflag = YES; #if TARGET == INTERDATA *loadp++ = "-r"; *loadp++ = "-d"; #endif *fflagp++ = 'O'; if( isdigit(s[1]) ) *fflagp++ = *++s; break; case 'N': *fflagp++ = 'N'; if( oneof(*++s, "qxscn") ) *fflagp++ = *s++; else { fprintf(diagfile, "invalid flag -N%c\n", *s); done(1); } while( isdigit(*s) ) *fflagp++ = *s++; *fflagp++ = 'X'; goto endfor; case 'm': if(s[1] == '4') ++s; macroflag = YES; break; case 'S': strcat(cflags, " -S"); saveasmflag = YES; case 'c': loadflag = NO; break; case 'v': verbose = YES; break; case 'd': debugflag = YES; goto copyfflag; case 'M': *loadp++ = "-M"; break; case 'g': strcat(cflags," -g"); sdbflag = YES; goto copyfflag; case 'p': profileflag = YES; strcat(cflags," -p"); goto copyfflag; case 'o': if( ! strcmp(s, "onetrip") ) { *fflagp++ = '1'; goto endfor; } aoutname = *++argv; --argc; break; #if TARGET == PDP11 case 'f': nofloating = YES; pass2name = NOFLPASS2; break; #endif case 'F': fortonly = YES; loadflag = NO; break; case 'I': if(s[1]=='2' || s[1]=='4' || s[1]=='s') { *fflagp++ = *s++; goto copyfflag; } fprintf(diagfile, "invalid flag -I%c\n", s[1]); done(1); case 'l': /* letter ell--library */ s[-1] = '-'; *loadp++ = s-1; goto endfor; case 'E': /* EFL flag argument */ while( *eflagp++ = *++s) ; *eflagp++ = ' '; goto endfor; case 'R': while( *rflagp++ = *++s ) ; *rflagp++ = ' '; goto endfor; default: lflag[1] = *s; *loadp++ = copys(lflag); break; } endfor: --argc; ++argv; } *fflagp = '\0'; loadargs[0] = ldname; #if TARGET == PDP11 if(nofloating) *loadp++ = (profileflag ? NOFLPROF : NOFLFOOT); else #endif *loadp++ = (profileflag ? proffoot : footname); for(i = 0 ; i%s", macroname, infname, prepfname); if( sys(buff) ) { rmf(prepfname); erred = YES; break; } infname = prepfname; } if(c == 'e') sprintf(buff, "efl %s %s >%s", eflags, infname, fortfile); else sprintf(buff, "ratfor %s %s >%s", rflags, infname, fortfile); status = sys(buff); if(macroflag) rmf(infname); if(status) { erred = YES; rmf(fortfile); break; } if( ! fortonly ) { infname = argv[i] = lastfield(argv[i]); *lastchar(infname) = 'f'; if( dofort(argv[i]) ) erred = YES; else { if( nodup(t = setdoto(argv[i])) ) *loadp++ = t; rmf(fortfile); } } break; case 'f': /* Fortran file */ case 'F': if( unreadable(argv[i]) ) erred = YES; else if( dofort(argv[i]) ) erred = YES; else if( nodup(t=setdoto(argv[i])) ) *loadp++ = t; break; case 'c': /* C file */ case 's': /* Assembler file */ if( unreadable(argv[i]) ) { erred = YES; break; } #if HERE==PDP11 || HERE==VAX fprintf(diagfile, "%s:\n", argv[i]); #endif sprintf(buff, "cc %s %s", cflags, argv[i] ); if( sys(buff) ) erred = YES; else if( nodup(t = setdoto(argv[i])) ) *loadp++ = t; break; case 'o': if( nodup(argv[i]) ) *loadp++ = argv[i]; break; default: if( ! strcmp(argv[i], "-o") ) aoutname = argv[++i]; else *loadp++ = argv[i]; break; } if(loadflag && !erred) doload(loadargs, loadp); done(erred); } dofort(s) char *s; { int retcode; char buff[200]; infname = s; sprintf(buff, "%s %s %s %s %s %s", pass1name, fflags, s, asmfname, initfname, textfname); switch( sys(buff) ) { case 1: goto error; case 0: break; default: goto comperror; } if(content(initfname) > 0) if( dodata() ) goto error; if( dopass2() ) goto comperror; doasm(s); retcode = 0; ret: rmf(asmfname); rmf(initfname); rmf(textfname); return(retcode); error: fprintf(diagfile, "\nError. No assembly.\n"); retcode = 1; goto ret; comperror: fprintf(diagfile, "\ncompiler error.\n"); retcode = 2; goto ret; } dopass2() { char buff[100]; if(verbose) fprintf(diagfile, "PASS2."); #if FAMILY==DMR sprintf(buff, "%s %s - %s", pass2name, textfname, asmpass2); return( sys(buff) ); #endif #if FAMILY == PCC # if TARGET==INTERDATA sprintf(buff, "%s -A%s <%s >%s", pass2name, setfname, textfname, asmpass2); # else sprintf(buff, "%s %s >%s", pass2name, textfname, asmpass2); # endif return( sys(buff) ); #endif } doasm(s) char *s; { register char *lastc; char *obj; char buff[200]; char *lastchar(), *setdoto(); if(*s == '\0') s = objfdefault; lastc = lastchar(s); obj = setdoto(s); #if TARGET==PDP11 || TARGET==VAX # ifdef PASS2OPT if(optimflag) { sprintf(buff, "%s %s %s", PASS2OPT, asmpass2, optzfname); if( sys(buff) ) rmf(optzfname); else { sprintf(buff,"mv %s %s", optzfname, asmpass2); sys(buff); } } # endif #endif if(saveasmflag) { *lastc = 's'; #if TARGET == INTERDATA sprintf(buff, "cat %s %s %s >%s",asmfname, setfname, asmpass2, obj); #else sprintf(buff, "cat %s %s >%s", asmfname, asmpass2, obj); #endif sys(buff); *lastc = 'o'; } else { if(verbose) fprintf(diagfile, " ASM."); #if TARGET == INTERDATA sprintf(buff, "%s -o %s %s %s %s", asmname, obj, asmfname, setfname, asmpass2); #endif #if TARGET == VAX /* vax assembler currently accepts only one input file */ sprintf(buff, "cat %s >>%s", asmpass2, asmfname); sys(buff); sprintf(buff, "%s -o %s %s", asmname, obj, asmfname); #endif #if TARGET == PDP11 sprintf(buff, "%s -u -o %s %s %s", asmname, obj, asmfname, asmpass2); #endif #if TARGET!=INTERDATA && TARGET!=PDP11 && TARGET!=VAX sprintf(buff, "%s -o %s %s %s", asmname, obj, asmfname, asmpass2); #endif if( sys(buff) ) fatal("assembler error"); if(verbose) fprintf(diagfile, "\n"); #if HERE==PDP11 && TARGET!=PDP11 rmf(obj); #endif } rmf(asmpass2); } doload(v0, v) register char *v0[], *v[]; { char **p; int waitpid; if(sdbflag) *v++ = "-lg"; for(p = liblist ; *p ; *v++ = *p++) ; *v++ = "-o"; *v++ = aoutname; *v = NULL; if(verbose) fprintf(diagfile, "LOAD."); if(debugflag) { for(p = v0 ; p') { if(t[1] == '>') { append = YES; outname = t+2; } else { append = NO; outname = t+1; } } else argv[argc++] = t; while( !isspace(*t) && *t!='\0' ) ++t; if(*t) { *t++ = '\0'; while( isspace(*t) ) ++t; } } if(argc == 1) /* no command */ return(-1); argv[argc] = 0; s = path; t = "/usr/bin/"; while(*t) *s++ = *t++; for(t = argv[1] ; *s++ = *t++ ; ) ; if((waitpid = fork()) == 0) { if(inname) freopen(inname, "r", stdin); if(outname) freopen(outname, (append ? "a" : "w"), stdout); enbint(SIG_DFL); texec(path+9, argv); /* command */ texec(path+4, argv); /* /bin/command */ texec(path , argv); /* /usr/bin/command */ fatalstr("Cannot load %s",path+9); } return( await(waitpid) ); } #include "errno.h" /* modified version from the Shell */ texec(f, av) char *f; char **av; { extern int errno; execv(f, av+1); if (errno==ENOEXEC) { av[1] = f; execv(shellname, av); fatal("No shell!"); } if (errno==ENOMEM) fatalstr("%s: too large", f); } done(k) int k; { static int recurs = NO; if(recurs == NO) { recurs = YES; rmfiles(); } exit(k); } enbint(k) int (*k)(); { if(sigivalue == 0) signal(SIGINT,k); if(sigqvalue == 0) signal(SIGQUIT,k); if(sighvalue == 0) signal(SIGHUP,k); if(sigtvalue == 0) signal(SIGTERM,k); } intrupt() { done(2); } await(waitpid) int waitpid; { int w, status; enbint(SIG_IGN); while ( (w = wait(&status)) != waitpid) if(w == -1) fatal("bad wait code"); enbint(intrupt); if(status & 0377) { if(status != SIGINT) (( fprintf(diagfile, "Termination code %d", status); done(3); } return(status>>8); } /* File Name and File Manipulation Routines */ unreadable(s) register char *s; { register FILE *fp; if(fp = fopen(s, "r")) { fclose(fp); return(NO); } else { fprintf(diagfile, "Error: Cannot read file %s\n", s); return(YES); } } clf(p) FILEP *p; { if(p!=NULL && *p!=NULL && *p!=stdout) { if(ferror(*p)) fatal("writing error"); fclose(*p); } *p = NULL; } rmfiles() { rmf(textfname); rmf(asmfname); rmf(initfname); rmf(asmpass2); #if TARGET == INTERDATA rmf(setfname); #endif } /* return -1 if file does not exist, 0 if it is of zero length and 1 if of positive length */ content(filename) char *filename; { #ifdef VERSION6 struct stat { char cjunk[9]; char size0; int size1; int ijunk[12]; } buf; #else # include # include struct stat buf; #endif if(stat(filename,&buf) < 0) return(-1); #ifdef VERSION6 return(buf.size0 || buf.size1); #else return( buf.st_size > 0 ); #endif } crfnames() { fname(textfname, "x"); fname(asmfname, "s"); fname(asmpass2, "a"); fname(initfname, "d"); fname(sortfname, "S"); fname(objfdefault, "o"); fname(prepfname, "p"); fname(optzfname, "z"); fname(setfname, "A"); } rmf(fn) register char *fn; { if(!debugflag && fn!=NULL && *fn!='\0') unlink(fn); } LOCAL fname(name, suff) char *name, *suff; { sprintf(name, "/tmp/%s%d.%s", temppref, pid, suff); } dotchar(s) register char *s; { for( ; *s ; ++s) if(s[0]=='.' && s[1]!='\0' && s[2]=='\0') return( s[1] ); return(NO); } char *lastfield(s) register char *s; { register char *t; for(t = s; *s ; ++s) if(*s == '/') t = s+1; return(t); } char *lastchar(s) register char *s; { while(*s) ++s; return(s-1); } char *setdoto(s) register char *s; { *lastchar(s) = 'o'; return( lastfield(s) ); } badfile(s) char *s; { fatalstr("cannot open intermediate file %s", s); } ptr ckalloc(n) int n; { ptr p, calloc(); if( p = calloc(1, (unsigned) n) ) return(p); fatal("out of memory"); /* NOTREACHED */ } char *copyn(n, s) register int n; register char *s; { register char *p, *q; p = q = (char *) ckalloc(n); while(n-- > 0) *q++ = *s++; return(p); } char *copys(s) char *s; { return( copyn( strlen(s)+1 , s) ); } oneof(c,s) register c; register char *s; { while( *s ) if(*s++ == c) return(YES); return(NO); } nodup(s) char *s; { register char **p; for(p = loadargs ; p < loadp ; ++p) if( !strcmp(*p, s) ) return(NO); return(YES); } static fatal(t) char *t; { fprintf(diagfile, "Compiler error in file %s: %s\n", infname, t); if(debugflag) abort(); done(1); exit(1); } static fatali(t,d) char *t; int d; { char buff[100]; sprintf(buff, t, d); fatal(buff); } static fatalstr(t, s) char *t, *s; { char buff[100]; sprintf(buff, t, s); fatal(buff); } err(s) char *s; { fprintf(diagfile, "Error in file %s: %s\n", infname, s); } /* Code to generate initializations for DATA statements */ LOCAL int nch = 0; LOCAL FILEP asmfile; LOCAL FILEP sortfile; #include "ftypes" static ftnint typesize[NTYPES] = { 1, SZADDR, SZSHORT, SZLONG, SZLONG, 2*SZLONG, 2*SZLONG, 4*SZLONG, SZLONG, 1, 1, 1}; static int typealign[NTYPES] = { 1, ALIADDR, ALISHORT, ALILONG, ALILONG, ALIDOUBLE, ALILONG, ALIDOUBLE, ALILONG, 1, 1, 1}; dodata() { char buff[50]; char varname[XL+1], ovarname[XL+1]; int status; flag erred; ftnint offset, vlen, type; register ftnint ooffset, ovlen; ftnint nblank, vchar; int size, align; int vargroup; ftnint totlen, doeven(); erred = NO; ovarname[0] = '\0'; ooffset = 0; ovlen = 0; totlen = 0; nch = 0; sprintf(buff, "sort %s >%s", initfname, sortfname); if(status = sys(buff)) fatali("call sort status = %d", status); if( (sortfile = fopen(sortfname, "r")) == NULL) badfile(sortfname); if( (asmfile = fopen(asmfname, "a")) == NULL) badfile(asmfname); pruse(asmfile, USEINIT); while( rdname(&vargroup, varname) && rdlong(&offset) && rdlong(&vlen) && rdlong(&type) ) { size = typesize[type]; if( strcmp(varname, ovarname) ) { prspace(ovlen-ooffset); strcpy(ovarname, varname); ooffset = 0; totlen += ovlen; ovlen = vlen; if(vargroup == 0) align = (type==TYCHAR || type==TYBLANK ? SZLONG : typealign[type]); else align = ALIDOUBLE; totlen = doeven(totlen, align); if(vargroup == 2) prcomblock(asmfile, varname); else fprintf(asmfile, LABELFMT, varname); } if(offset < ooffset) { erred = YES; err("overlapping initializations"); ooffset = offset; } if(offset > ooffset) { prspace(offset-ooffset); ooffset = offset; } if(type == TYCHAR) { if( rdlong(&vchar) ) prch( (int) vchar ); else fatal("bad intermediate file format"); } else if(type == TYBLANK) { if( rdlong(&nblank) ) { size = nblank; while( --nblank >= 0) prch( ' ' ); } else fatal("bad intermediate file format"); } else { putc('\t', asmfile); while ( putc( getc(sortfile), asmfile) != '\n') ; } if( (ooffset += size) > ovlen) { erred = YES; err("initialization out of bounds"); } } prspace(ovlen-ooffset); totlen = doeven(totlen+ovlen, (ALIDOUBLE>SZLONG ? ALIDOUBLE : SZLONG) ); clf(&sortfile); clf(&asmfile); clf(&sortfile); rmf(sortfname); return(erred); } prspace(n) register ftnint n; { register ftnint m; while(nch>0 && n>0) { --n; prch(0); } m = SZSHORT * (n/SZSHORT); if(m > 0) prskip(asmfile, m); for(n -= m ; n>0 ; --n) prch(0); } ftnint doeven(tot, align) register ftnint tot; int align; { ftnint new; new = roundup(tot, align); prspace(new - tot); return(new); } rdname(vargroupp, name) int *vargroupp; register char *name; { register int i, c; if( (c = getc(sortfile)) == EOF) return(NO); *vargroupp = c - '0'; for(i = 0 ; i char *stabline(); # ifdef UCBVAXASM char *stabdline(); # endif # ifndef N_SO # include # endif #endif static int nstars; static int ndim; static int vartype; static ftnint varleng; static struct { expptr lb, ub; } dims[MAXDIM+1]; static struct Labelblock *labarray[MAXLABLIST]; static int lastwasbranch = NO; static int thiswasbranch = NO; extern ftnint yystno; extern flag intonly; ftnint convci(); double convcd(); Addrp nextdata(); expptr mklogcon(), mkaddcon(), mkrealcon(), mkstrcon(), mkbitcon(); expptr mkcxcon(); struct Listblock *mklist(); struct Listblock *mklist(); struct Impldoblock *mkiodo(); struct Extsym *comblock(); %} /* Specify precedences and associativities. */ %union { int ival; char *charpval; chainp chval; tagptr tagval; expptr expval; struct Labelblock *labval; struct Nameblock *namval; struct Eqvchain *eqvval; struct Extsym *extval; } %left SCOMMA %nonassoc SCOLON %right SEQUALS %left SEQV SNEQV %left SOR %left SAND %left SNOT %nonassoc SLT SGT SLE SGE SEQ SNE %left SCONCAT %left SPLUS SMINUS %left SSTAR SSLASH %right SPOWER %start program %type thislabel label assignlabel %type other inelt %type lengspec type typespec typename dcl letter addop relop stop nameeq %type filename %type datavar datavarlist namelistlist funarglist funargs dospec %type callarglist arglist args exprlist inlist outlist out2 substring %type name arg call var %type lhs expr uexpr opt_expr fexpr unpar_fexpr %type ubound simple value callarg complex_const simple_const bit_const %type common comblock entryname progname %type equivlist %% program: | program stat SEOS ; stat: thislabel entry { lastwasbranch = NO; } | thislabel spec | thislabel exec { if($1 && ($1->labelno==dorange)) enddo($1->labelno); if(lastwasbranch && thislabel==NULL) warn("statement cannot be reached"); lastwasbranch = thiswasbranch; thiswasbranch = NO; if($1) { if($1->labtype == LABFORMAT) err("label already that of a format"); else $1->labtype = LABEXEC; } } | thislabel SINCLUDE filename { doinclude( $3 ); } | thislabel SEND end_spec { lastwasbranch = NO; endproc(); } | thislabel SUNKNOWN { execerr("unclassifiable statement", CNULL); flline(); }; | error { flline(); needkwd = NO; inioctl = NO; yyerrok; yyclearin; } ; thislabel: SLABEL { #ifdef SDB char buff[10]; if( sdbflag ) { # ifdef UCBVAXASM p2pass( stabdline(N_SLINE, lineno) ); # else sprintf(buff,"LL%d", ++dbglabel); p2pass( stabline(0, N_SLINE, lineno, buff) ); p2pi("LL%d:\n", dbglabel); # endif } #endif if(yystno != 0) { $$ = thislabel = mklabel(yystno); if( ! headerdone ) puthead(CNULL, procclass); if(thislabel->labdefined) execerr("label %s already defined", convic(thislabel->stateno) ); else { if(thislabel->blklevel!=0 && thislabel->blklevellabt((ype!=LABFORMAT) warn1("there is a branch to label %s from outside block", convic( (ftnint) (thislabel->stateno) ) ); thislabel->blklevel = blklevel; thislabel->labdefined = YES; if(thislabel->labtype != LABFORMAT) putlabel(thislabel->labelno); } } else $$ = thislabel = NULL; } ; entry: SPROGRAM new_proc progname {startproc($3, CLMAIN); } | SBLOCK new_proc progname { if($3) NO66("named BLOCKDATA"); startproc($3, CLBLOCK); } | SSUBROUTINE new_proc entryname arglist { entrypt(CLPROC, TYSUBR, (ftnint) 0, $3, $4); } | SFUNCTION new_proc entryname arglist { entrypt(CLPROC, TYUNKNOWN, (ftnint) 0, $3, $4); } | type SFUNCTION new_proc entryname arglist { entrypt(CLPROC, $1, varleng, $4, $5); } | SENTRY entryname arglist { if(parstate==OUTSIDE || procclass==CLMAIN || procclass==CLBLOCK) execerr("misplaced entry statement", CNULL); entrypt(CLENTRY, 0, (ftnint) 0, $2, $3); } ; new_proc: { newproc(); } ; entryname: name { $$ = newentry($1); } ; name: SNAME { $$ = mkname(toklen, token); } ; progname: { $$ = NULL; } | entryname ; arglist: { $$ = 0; } | SLPAR SRPAR { NO66(" () argument list"); $$ = 0; } | SLPAR args SRPAR {$$ = $2; } ; args: arg { $$ = ($1 ? mkchain($1,CHNULL) : CHNULL ); } | args SCOMMA arg { if($3) $1 = $$ = hookup($1, mkchain($3,CHNULL)); } ; arg: name { if($1->vstg!=STGUNKNOWN && $1->vstg!=STGARG) dclerr("name declared as argument after use", $1); $1->vstg = STGARG; } | SSTAR { NO66("altenate return argument"); $$ = 0; substars = YES; } ; filename: SHOLLERITH { char *s; s = copyn(toklen+1, token); s[toklen] = '\0'; $$ = s; } ; 0; } | SLPAR args SRPAR {$$ = $2; } ; args: arg { $$ = ($1 ? mkchain($1,CHNULL) : CHNULL ); } | args SCOMMA arg { if($3) $1 = $$ = hookup($1, mkchain($3,CHNULL)); } ; arg: name { if($1->vstg!=STGUNKNOWN && $1->vstg!=STGARG) dclerr("name declared as argument after use", $1); $1->vstg = STGARcmd/f77/gram.dcl 644 0 33 15331 2412324733 6636 spec: dcl | common | external | intrinsic | equivalence | data | implicit | namelist | SSAVE { NO66("SAVE statement"); saveall = YES; } | SSAVE savelist { NO66("SAVE statement"); } | SFORMAT { fmtstmt(thislabel); setfmt(thislabel); } | SPARAM in_dcl SLPAR paramlist SRPAR { NO66("PARAMETER statement"); } ; dcl: type opt_comma name in_dcl dims lengspec { settype($3, $1, $6); if(ndim>0) setbound($3,ndim,dims); } | dcl SCOMMA name dims lengspec { settype($3, $1, $5); if(ndim>0) setbound($3,ndim,dims); } ; type: typespec lengspec { varleng = $2; } ; typespec: typename { varleng = ($1<0 || $1==TYLONG ? 0 : typesize[$1]); } ; typename: SINTEGER { $$ = TYLONG; } | SREAL { $$ = TYREAL; } | SCOMPLEX { $$ = TYCOMPLEX; } | SDOUBLE { $$ = TYDREAL; } | SDCOMPLEX { NOEXT("DOUBLE COMPLEX statement"); $$ = TYDCOMPLEX; } | SLOGICAL { $$ = TYLOGICAL; } | SCHARACTER { NO66("CHARACTER statement"); $$ = TYCHAR; } | SUNDEFINED { $$ = TYUNKNOWN; } | SDIMENSION { $$ = TYUNKNOWN; } | SAUTOMATIC { NOEXT("AUTOMATIC statement"); $$ = - STGAUTO; } | SSTATIC { NOEXT("STATIC statement"); $$ = - STGBSS; } ; lengspec: { $$ = varleng; } | SSTAR intonlyon expr intonlyoff { expptr p; p = $3; NO66("length specification *n"); if( ! ISICON(p) || p->constblock.const.ci<0 ) { $$ = 0; dclerr("length must be a positive integer constant", PNULL); } else $$ = p->constblock.const.ci; } | SSTAR intonlyon SLPAR SSTAR SRPAR intonlyoff { NO66("length specification *(*)"); $$ = -1; } ; common: SCOMMON in_dcl var { incomm( $$ = comblock(0, CNULL) , $3 ); } | SCOMMON in_dcl comblock var { $$ = $3; incomm($3, $4); } | common opt_comma comblock opt_comma var { $$ = $3; incomm($3, $5); } | common SCOMMA var { incomm($1, $3); } ; comblock: SCONCAT { $$ = comblock(0, CNULL); } | SSLASH SNAME SSLASH { $$ = comblock(toklen, token); } ; external: SEXTERNAL in_dcl name { setext($3); } | external SCOMMA name { setext($3); } ; intrinsic: SINTRINSIC in_dcl name { NO66("INTRINSIC statement"); setintr($3); } | intrinsic SCOMMA name { setintr($3); } ; equivalence: SEQUIV in_dcl equivset | equivalence SCOMMA equivset ; equivset: SLPAR equivlist SRPAR { struct Equivblock *p; if(nequiv >= maxequiv) many("equivalences", 'q'); p = & eqvclass[nequiv++]; p->eqvinit = NO; p->eqvbottom = 0; p->eqvtop = 0; p->equivs = $2; } ; equivlist: lhs { $$=ALLOC(Eqvchain); $$->eqvitem.eqvlhs = (struct Primblock *)$1; } | equivlist SCOMMA lhs { $$=ALLOC(Eqvchain); $$->eqvitem.eqvlhs = (struct Primblock *) $3; $$->eqvnextp = $1; } ; data: SDATA in_data datalist | data opt_comma datalist ; in_data: { if(parstate == OUTSIDE) { newproc(); startproc(PNULL, CLMAIN); } if(parstate < INDATA) { enddcl(); parstate = INDATA; } } ; datalist: datavarlist SSLASH vallist SSLASH { ftnint junk; if(nextdata(&junk,&junk) != NULL) { err("too few initializers"); curdtp = NULL; } frdata($1); frrpl(); } ; vallist: { toomanyinit = NO; } val | vallist SCOMMA val ; val: value { dataval(PNULL, $1); } | simple SSTAR value { dataval($1, $3); } ; value: simple | addop simple { if( $1==OPMINUS && ISCONST($2) ) consnegop($2); $$ = $2; } | complex_const | bit_const ; savelist: saveitem | savelist SCOMMA saveitem ; saveitem: name { int k; $1->vsave = YES; k = $1->vstg; if( ! ONEOF(k, M(STGUNKNOWN)|M(STGBSS)|M(STGINIT)) ) dclerr("can only save static variables", $1); } | comblock { $1->extsave = 1; } ; paramlist: paramitem | paramlist SCOMMA paramitem ; paramitem: name SEQUALS expr { if($1->vclass == CLUNKNOWN) { $1->vclass = CLPARAM; ( (struct Paramblock *) ($1) )->paramval = $3; } else dclerr("cannot make %s parameter", $1); } ; var: name dims { if(ndim>0) setbound($1, ndim, dims); } ; datavar: lhs { Namep np; np = ( (struct Primblock *) $1) -> namep; vardcl(np); if(np->vstg == STGCOMMON) extsymtab[np->vardesc.varno].extinit = YES; else if(np->vstg==STGEQUIV) eqvclass[np->vardesc.varno].eqvinit = YES; else if(np->vstg!=STGINIT && np->vstg!=STGBSS) dclerr("inconsistent storage classes", np); $$ = mkchain($1, CHNULL); } | SLPAR datavarlist SCOMMA dospec SRPAR { chainp p; struct Impldoblock *q; q = ALLOC(Impldoblock); q->tag = TIMPLDO; q->varnp = (Namep) ($4->datap); p = $4->nextp; if(p) { q->implb = (expptr)(p->datap); p = p->nextp; } if(p) { q->impub = (expptr)(p->datap); p = p->nextp; } if(p) { q->impstep = (expptr)(p->datap); p = p->nextp; } frchain( & ($4) ); $$ = mkchain(q, CHNULL); q->datalist = hookup($2, $$); } ; datavarlist: datavar { curdtp = $1; curdtelt = 0; } | datavarlist SCOMMA datavar { $$ = hookup($1, $3); } ; dims: { ndim = 0; } | SLPAR dimlist SRPAR ; dimlist: { ndim = 0; } dim | dimlist SCOMMA dim ; dim: ubound { if(ndim == maxdim) err("too many dimensions"); else if(ndim < maxdim) { dims[ndim].lb = 0; dims[ndim].ub = $1; } ++ndim; } | expr SCOLON ubound { if(ndim == maxdim) err("too many dimensions"); else if(ndim < maxdim) { dims[ndim].lb = $1; dims[ndim].ub = $3; } ++ndim; } ; ubound: SSTAR { $$ = 0; } | expr ; labellist: label { nstars = 1; labarray[0] = $1; } | labellist SCOMMA label { if(nstars < MAXLABLIST) labarray[nstars++] = $3; } ; label: SICON { $$ = execlab( convci(toklen, token) ); } ; implicit: SIMPLICIT in_dcl implist { NO66("IMPLICIT statement"); } | implicit SCOMMA implist ; implist: imptype SLPAR letgroups SRPAR ; imptype: { needkwd = 1; } type { vartype = $2; } ; letgroups: letgroup | letgroups SCOMMA letgroup ; letgroup: letter { setimpl(vartype, varleng, $1, $1); } | letter SMINUS letter { setimpl(vartype, varleng, $1, $3); } ; letter: SNAME { if(toklen!=1 || token[0]<'a' || token[0]>'z') { dclerr("implicit item must be single letter", PNULL); $$ = 0; } else $$ = token[0]; } ; namelist: SNAMELIST | namelist namelistentry ; namelistentry: SSLASH name SSLASH namelistlist { if($2->vclass == CLUNKNOWN) { $2->vclass = CLNAMELIST; $2->vtype = TYINT; $2->vstg = STGINIT; $2->varxptr.namelist = $4; $2->vardesc.varno = ++lastvarno; } else dclerr("cannot be a namelist name", $2); } ; namelistlist: name { $$ = mkchain($1, CHNULL); } | namelistlist SCOMMA name { $$ = hookup($1, mkchain($3, CHNULL)); } ; in_dcl: { switch(parstate) { case OUTSIDE: newproc(); startproc(PNULL, CLMAIN); case INSIDE: parstate = INDCL; case INDCL: break; default: dclerr("declaration among executables", PNULL); } } ; TYINT; $2->vstg = STGINIT; $2->varxptr.namelist = $4; $2->vardesc.varno = ++lastvarno; } else dclerr("cannot be a namelist name", $2); } ; namelistlist: name { $$ = mkchain($1, CHNULL); } | namelistlist SCOMMA name { $$ = hookup($1, mkchain($3, CHNULL)); } ; in_dcl: cmd/f77/gram.expr 644 0 33 5761 2411243502 7031 ((funarglist: { $$ = 0; } | funargs ; funargs: expr { $$ = mkchain($1, CHNULL); } | funargs SCOMMA expr { $$ = hookup($1, mkchain($3,CHNULL) ); } ; expr: uexpr | SLPAR expr SRPAR { $$ = $2; } | complex_const ; uexpr: lhs | simple_const | expr addop expr %prec SPLUS { $$ = mkexpr($2, $1, $3); } | expr SSTAR expr { $$ = mkexpr(OPSTAR, $1, $3); } | expr SSLASH expr { $$ = mkexpr(OPSLASH, $1, $3); } | expr SPOWER expr { $$ = mkexpr(OPPOWER, $1, $3); } | addop expr %prec SSTAR { if($1 == OPMINUS) $$ = mkexpr(OPNEG, $2, ENULL); else $$ = $2; } | expr relop expr %prec SEQ { $$ = mkexpr($2, $1, $3); } | expr SEQV expr { NO66(".EQV. operator"); $$ = mkexpr(OPEQV, $1,$3); } | expr SNEQV expr { NO66(".NEQV. operator"); $$ = mkexpr(OPNEQV, $1, $3); } | expr SOR expr { $$ = mkexpr(OPOR, $1, $3); } | expr SAND expr { $$ = mkexpr(OPAND, $1, $3); } | SNOT expr { $$ = mkexpr(OPNOT, $2, ENULL); } | expr SCONCAT expr { NO66("concatenation operator //"); $$ = mkexpr(OPCONCAT, $1, $3); } ; addop: SPLUS { $$ = OPPLUS; } | SMINUS { $$ = OPMINUS; } ; relop: SEQ { $$ = OPEQ; } | SGT { $$ = OPGT; } | SLT { $$ = OPLT; } | SGE { $$ = OPGE; } | SLE { $$ = OPLE; } | SNE { $$ = OPNE; } ; lhs: name { $$ = mkprim($1, PNULL, CHNULL); } | name substring { NO66("substring operator :"); $$ = mkprim($1, PNULL, $2); } | name SLPAR funarglist SRPAR { $$ = mkprim($1, mklist($3), CHNULL); } | name SLPAR funarglist SRPAR substring { NO66("substring operator :"); $$ = mkprim($1, mklist($3), $5); } ; substring: SLPAR opt_expr SCOLON opt_expr SRPAR { $$ = mkchain($2, mkchain($4,CHNULL)); } ; opt_expr: { $$ = 0; } | expr ; simple: name { if($1->vclass == CLPARAM) $$ = (expptr) cpexpr( ( (struct Paramblock *) ($1) ) -> paramval); } | simple_const ; simple_const: STRUE { $$ = mklogcon(1); } | SFALSE { $$ = mklogcon(0); } | SHOLLERITH { $$ = mkstrcon(toklen, token); } | SICON = { $$ = mkintcon( convci(toklen, token) ); } | SRCON = { $$ = mkrealcon(TYREAL, convcd(toklen, token)); } | SDCON = { $$ = mkrealcon(TYDREAL, convcd(toklen, token)); } ; complex_const: SLPAR uexpr SCOMMA uexpr SRPAR { $$ = mkcxcon($2,$4); } ; bit_const: SHEXCON { NOEXT("hex constant"); $$ = mkbitcon(4, toklen, token); } | SOCTCON { NOEXT("octal constant"); $$ = mkbitcon(3, toklen, token); } | SBITCON { NOEXT("binary constant"); $$ = mkbitcon(1, toklen, token); } ; fexpr: unpar_fexpr | SLPAR fexpr SRPAR { $$ = $2; } ; unpar_fexpr: lhs | simple_const | fexpr addop fexpr %prec SPLUS { $$ = mkexpr($2, $1, $3); } | fexpr SSTAR fexpr { $$ = mkexpr(OPSTAR, $1, $3); } | fexpr SSLASH fexpr { $$ = mkexpr(OPSLASH, $1, $3); } | fexpr SPOWER fexpr { $$ = mkexpr(OPPOWER, $1, $3); } | addop fexpr %prec SSTAR { if($1 == OPMINUS) $$ = mkexpr(OPNEG, $2, ENULL); else $$ = $2; } | fexpr SCONCAT fexpr { NO66("concatenation operator //"); $$ = mkexpr(OPCONCAT, $1, $3); } ; fexpr SRPAR {cmd/f77/gram.exec 644 0 33 5142 2412322706 6775 exec: iffable | SDO end_spec intonlyon label intonlyoff dospec { if($4->labdefined) execerr("no backward DO loops", CNULL); $4->blklevel = blklevel+1; exdo($4->labelno, $6); } | logif iffable { exendif(); thiswasbranch = NO; } | logif STHEN | SELSEIF end_spec SLPAR expr SRPAR STHEN { exelif($4); lastwasbranch = NO; } | SELSE end_spec { exelse(); lastwasbranch = NO; } | SENDIF end_spec { exendif(); lastwasbranch = NO; } ; logif: SLOGIF end_spec SLPAR expr SRPAR { exif($4); } ; dospec: name SEQUALS exprlist { $$ = mkchain($1, $3); } ; iffable: let lhs SEQUALS expr { exequals($2, $4); } | SASSIGN end_spec assignlabel STO name { exassign($5, $3); } | SCONTINUE end_spec | goto | io { inioctl = NO; } | SARITHIF end_spec SLPAR expr SRPAR label SCOMMA label SCOMMA label { exarif($4, $6, $8, $10); thiswasbranch = YES; } | call { excall($1, PNULL, 0, labarray); } | call SLPAR SRPAR { excall($1, PNULL, 0, labarray); } | call SLPAR callarglist SRPAR { if(nstars < MAXLABLIST) excall($1, mklist($3), nstars, labarray); else err("too many alternate returns"); } | SRETURN end_spec opt_expr { exreturn($3); thiswasbranch = YES; } | stop end_spec opt_expr { exstop($1, $3); thiswasbranch = $1; } ; assignlabel: SICON { $$ = mklabel( convci(toklen, token) ); } ; let: SLET { if(parstate == OUTSIDE) { newproc(); startproc(PNULL, CLMAIN); } } ; goto: SGOTO end_spec label { exgoto($3); thiswasbranch = YES; } | SASGOTO end_spec name { exasgoto($3); thiswasbranch = YES; } | SASGOTO end_spec name opt_comma SLPAR labellist SRPAR { exasgoto($3); thiswasbranch = YES; } | SCOMPGOTO end_spec SLPAR labellist SRPAR opt_comma expr { if(nstars < MAXLABLIST) putcmgo(fixtype($7), nstars, labarray); else err("computed GOTO list too long"); } ; opt_comma: | SCOMMA ; call: SCALL end_spec name { nstars = 0; $$ = $3; } ; callarglist: callarg { $$ = ($1 ? mkchain($1,CHNULL) : CHNULL); } | callarglist SCOMMA callarg { if($3) if($1) $$ = hookup($1, mkchain($3,CHNULL)); else $$ = mkchain($3,CHNULL); else $$ = $1; } ; callarg: expr | SSTAR label { if(nstarsheadblock.vtype == TYCHAR) { ioclause(IOSUNIT, PNULL); ioclause(IOSFMT, $2); } else ioclause(IOSUNIT, $2); endioctl(); } | SLPAR ctllist SRPAR { endioctl(); } ; ctllist: ioclause | ctllist SCOMMA ioclause ; ioclause: fexpr { ioclause(IOSPOSITIONAL, $1); } | SSTAR { ioclause(IOSPOSITIONAL, PNULL); } | SPOWER { ioclause(IOSPOSITIONAL, IOSTDERR); } | nameeq expr { ioclause($1, $2); } | nameeq SSTAR { ioclause($1, PNULL); } | nameeq SPOWER { ioclause($1, IOSTDERR); } ; nameeq: SNAMEEQ { $$ = iocname(); } ; read: SREAD end_spec in_ioctl { iostmt = IOREAD; } ; write: SWRITE end_spec in_ioctl { iostmt = IOWRITE; } ; print: SPRINT end_spec fexpr in_ioctl { iostmt = IOWRITE; ioclause(IOSUNIT, PNULL); ioclause(IOSFMT, $3); endioctl(); } | SPRINT end_spec SSTAR in_ioctl { iostmt = IOWRITE; ioclause(IOSUNIT, PNULL); ioclause(IOSFMT, PNULL); endioctl(); } ; inlist: inelt { $$ = mkchain($1, CHNULL); } | inlist SCOMMA inelt { $$ = hookup($1, mkchain($3, CHNULL)); } ; inelt: lhs { $$ = (tagptr) $1; } | SLPAR inlist SCOMMA dospec SRPAR { $$ = (tagptr) mkiodo($4,$2); } ; outlist: uexpr { $$ = mkchain($1, CHNULL); } | other { $$ = mkchain($1, CHNULL); } | out2 ; out2: uexpr SCOMMA uexpr { $$ = mkchain($1, mkchain($3, CHNULL) ); } | uexpr SCOMMA other { $$ = mkchain($1, mkchain($3, CHNULL) ); } | other SCOMMA uexpr { $$ = mkchain($1, mkchain($3, CHNULL) ); } | other SCOMMA other { $$ = mkchain($1, mkchain($3, CHNULL) ); } | out2 SCOMMA uexpr { $$ = hookup($1, mkchain($3, CHNULL) ); } | out2 SCOMMA other { $$ = hookup($1, mkchain($3, CHNULL) ); } ; other: complex_const { $$ = (tagptr) $1; } | SLPAR uexpr SCOMMA dospec SRPAR { $$ = (tagptr) mkiodo($4, mkchain($2, CHNULL) ); } | SLPAR other SCOMMA dospec SRPAR { $$ = (tagptr) mkiodo($4, m((kchain($2, CHNULL) ); } | SLPAR out2 SCOMMA dospec SRPAR { $$ = (tagptr) mkiodo($4, $2); } ; in_ioctl: { startioctl(); } ; $ = mkchain($1, mkchain($3, CHNULL) ); } | out2 SCOMMA uexpr { $$ = hookup($1, mkchain($3, CHNULL) ); } | out2 SCOMMA other { $$ = hookup($1, mkchain($3, CHNULL) ); } ; other: complex_const { $$ = (tagptr) $1; } | SLPAR uexpr SCOMMA dospec SRPAR { $$ = (tagptr) mkiodo($4, mkchain($2, CHNULL) ); } | SLPAR other SCOMMA dospec SRPAR { $$ = (tagptr) mkiodo($4, mcmd/f77/lex.c 644 0 33 41115 2412323277 6161 #include "defs" #include "tokdefs" # define BLANK ' ' # define MYQUOTE (2) # define SEOF 0 /* card types */ # define STEOF 1 # define STINITIAL 2 # define STCONTINUE 3 /* lex states */ #define NEWSTMT 1 #define FIRSTTOKEN 2 #define OTHERTOKEN 3 #define RETEOS 4 LOCAL int stkey; LOCAL int lastend = 1; ftnint yystno; flag intonly; LOCAL long int stno; LOCAL long int nxtstno; LOCAL int parlev; LOCAL int expcom; LOCAL int expeql; LOCAL char *nextch; LOCAL char *lastch; LOCAL char *nextcd = NULL; LOCAL char *endcd; LOCAL int prevlin; LOCAL int thislin; LOCAL int code; LOCAL int lexstate = NEWSTMT; LOCAL char s[1390]; LOCAL char *send = s+20*66; LOCAL int nincl = 0; struct Inclfile { struct Inclfile *inclnext; FILEP inclfp; char *inclname; int incllno; char *incllinp; int incllen; int inclcode; ftnint inclstno; } ; LOCAL struct Inclfile *inclp = NULL; LOCAL struct Keylist { char *keyname; int keyval; char notinf66; } ; LOCAL struct Punctlist { char punchar; int punval; }; LOCAL struct Fmtlist { char fmtchar; int fmtval; }; LOCAL struct Dotlist { char *dotname; int dotval; }; LOCAL struct Keylist *keystart[26], *keyend[26]; inilex(name) char *name; { nincl = 0; inclp = NULL; doinclude(name); lexstate = NEWSTMT; return(NO); } /* throw away the rest of the current line */ flline() { lexstate = RETEOS; } char *lexline(n) int *n; { *n = (lastch - nextch) + 1; return(nextch); } doinclude(name) char *name; { FILEP fp; struct Inclfile *t; char temp[100]; register char *lastslash, *s; if(inclp) { inclp->incllno = thislin; inclp->inclcode = code; inclp->inclstno = nxtstno; if(nextcd) inclp->incllinp = copyn(inclp->incllen = endcd-nextcd , nextcd); else inclp->incllinp = 0; } nextcd = NULL; if(++nincl >= MAXINCLUDES) fatal("includes nested too deep"); if(name[0] == '\0') fp = stdin; else if(name[0]=='/' || inclp==NULL) fp = fopen(name, "r"); else { lastslash = NULL; for(s = inclp->inclname ; *s ; ++s) if(*s == '/') lastslash = s; if(lastslash) { *lastslash = '\0'; sprintf(temp, "%s/%s", inclp->inclname, name); *lastslash = '/'; } else strcpy(temp, name); if( (fp = fopen(temp, "r")) == NULL ) { sprintf(temp, "/usr/include/%s", name); fp = fopen(temp, "r"); } if(fp) name = copys(temp); } if( fp ) { t = inclp; inclp = ALLOC(Inclfile); inclp->inclnext = t; prevlin = thislin = 0; infname = inclp->inclname = name; infile = inclp->inclfp = fp; } else { fprintf(diagfile, "Cannot open file %s", name); done(1); } } LOCAL popinclude() { struct Inclfile *t; register char *p; register int k; if(infile != stdin) clf(&infile); free(infname); --nincl; t = inclp->inclnext; free( (charptr) inclp); inclp = t; if(inclp == NULL) return(NO); infile = inclp->inclfp; infname = inclp->inclname; prevlin = thislin = inclp->incllno; code = inclp->inclcode; stno = nxtstno = inclp->inclstno; if(inclp->incllinp) { endcd = nextcd = s; k = inclp->incllen; p = inclp->incllinp; while(--k >= 0) *endcd++ = *p++; free( (charptr) (inclp->incllinp) ); } else nextcd = NULL; return(YES); } yylex() { static int tokno; switch(lexstate) { case NEWSTMT : /* need a new statement */ if(getcds() == STEOF) return(SEOF); lastend = stkey == SEND; crunch(); tokno = 0; lexstate = FIRSTTOKEN; yystno = stno; stno = nxtstno; toklen = 0; return(SLABEL); first: case FIRSTTOKEN : /* first step on a statement */ analyz(); lexstate = OTHERTOKEN; tokno = 1; return(stkey); case OTHERTOKEN : /* return next token */ if(nextch > lastch) goto reteos; ++tokno; if( (stkey==SLOGIF || stkey==SELSEIF) && parlev==0 && tokno>3) goto first; if(stkey==SASSIGN && tokno==3 && nextch s) { q = nextcd; p = s; while(q < endcd) *p++ = *q++; endcd = p; } for(nextcd = endcd ; nextcd+66<=send && (code = getcd(nextcd))==STCONTINUE ; nextcd = endcd ) ; nextch = s; lastch = nextcd - 1; if(nextcd >= send) nextcd = NULL; lineno = prevlin; prevlin = thislin; return(STINITIAL); } LOCAL getcd(b) register char *b; { register int c; register char *p, *bend; int speclin; static char a[6]; static char *aend = a+6; top: endcd = b; bend = b+66; speclin = NO; if( (c = getc(infile)) == '&') { a[0] = BLANK; a[5] = 'x'; speclin = YES; bend = send; } else if(c=='c' || c=='C' || c=='*') { while( (c = getc(infile)) != '\n') if(c == EOF) return(STEOF); ++thislin; goto top; } else if(c != EOF) { /* a tab in columns 1-6 skips to column 7 */ ungetc(c, infile); for(p=a; p lastch) { err("unbalanced quotes; closing quote supplied"); break; } if(*i == quote) if(iprvstr) /* test for Hollerith strings */ { if( ! isdigit(j[-1])) goto copychar; nh = j[-1] - '0'; ten = 10; j1 = prvstr - 1; if (j1j1; -- j0) { if( ! isdigit(*j0 ) ) break; nh += ten * (*j0-'0'); ten*=10; } if(j0 <= j1) goto copychar; /* a hollerith must be preceded by a punctuation mark. '*' is possible only as repetition factor in a data statement not, in particular, in character*2h */ if( !(*j0=='*'&&s[0]=='d') && *j0!='/' && *j0!='(' && *j0!=',' && *j0!='=' && *j0!='.') goto copychar; if(i+nh > lastch) { erri("%dH too big", nh); nh = lastch - i; } j0[1] = MYQUOTE; /* special marker */ j = j0 + 1; while(nh-- > 0) { if(*++i == '\\') switch(*++i) { case 't': *i = '\t'; break; case 'b': *i = '\b'; break; case 'n': *i = '\n'; break; case 'f': *i = '\f'; break; case '0': *i = '\0'; break; default: break; } *++j = *i; } j[1] = MYQUOTE; j+=2; prvstr = j; } else { if(*i == '(') ++parlev; else if(*i == ')') --parlev; else if(parlev == 0) if(*i == '=') expeql = 1; else if(*i == ',') expcom = 1; copychar: /*not a string or space -- copy, shifting case if necessary */ if(shiftcase && isupper(*i)) *j++ = tolower(*i); else *j++ = *i; } } lastch = j - 1; nextch = s; } LOCAL analyz() { register char *i; if(parlev != 0) { err("unbalanced parentheses, statement skipped"); stkey = SUNKNOWN; return; } if(nextch+2<=lastch && nextch[0]=='i' && nextch[1]=='f' && nextch[2]=='(') { /* assignment or if statement -- look at character after balancing paren */ parlev = 1; for(i=nextch+3 ; i<=lastch; ++i) if(*i == (MYQUOTE)) { while(*++i != MYQUOTE) ; } else if(*i == '(') ++parlev; else if(*i == ')') { if(--parlev == 0) break; } if(i >= lastch) stkey =(( SLOGIF; else if(i[1] == '=') stkey = SLET; else if( isdigit(i[1]) ) stkey = SARITHIF; else stkey = SLOGIF; if(stkey != SLET) nextch += 2; } else if(expeql) /* may be an assignment */ { if(expcom && nextch=nextch) if(nextch[0]=='(') stkey = SCOMPGOTO; else if(isalpha(nextch[0])) stkey = SASGOTO; } parlev = 0; } LOCAL getkwd() { register char *i, *j; register struct Keylist *pk, *pend; int k; if(! isalpha(nextch[0]) ) return(SUNKNOWN); k = nextch[0] - 'a'; if(pk = keystart[k]) for(pend = keyend[k] ; pk<=pend ; ++pk ) { i = pk->keyname; j = nextch; while(*++i==*++j && *i!='\0') ; if(*i=='\0' && j<=lastch+1) { nextch = j; if(no66flag && pk->notinf66) errstr("Not a Fortran 66 keyword: %s", pk->keyname); return(pk->keyval); } } return(SUNKNOWN); } initkey() { extern struct Keylist keys[]; register struct Keylist *p; register int i,j; for(i = 0 ; i<26 ; ++i) keystart[i] = NULL; for(p = keys ; p->keyname ; ++p) { j = p->keyname[0] - 'a'; if(keystart[j] == NULL) keystart[j] = p; keyend[j] = p; } } LOCAL gettok() { int havdot, havexp, havdbl; int radix, val; extern struct Punctlist puncts[]; struct Punctlist *pp; extern struct Fmtlist fmts[]; extern struct Dotlist dots[]; struct Dotlist *pd; char *i, *j, *n1, *p; if(*nextch == (MYQUOTE)) { ++nextch; p = token; while(*nextch != MYQUOTE) *p++ = *nextch++; ++nextch; toklen = p - token; *p = '\0'; return (SHOLLERITH); } /* if(stkey == SFORMAT) { for(pf = fmts; pf->fmtchar; ++pf) { if(*nextch == pf->fmtchar) { ++nextch; if(pf->fmtval == SLPAR) ++parlev; else if(pf->fmtval == SRPAR) --parlev; return(pf->fmtval); } } if( isdigit(*nextch) ) { p = token; *p++ = *nextch++; while(nextch<=lastch && isdigit(*nextch) ) *p++ = *nextch++; toklen = p - token; *p = '\0'; if(nextch<=lastch && *nextch=='p') { ++nextch; return(SSCALE); } else return(SICON); } if( isalpha(*nextch) ) { p = token; *p++ = *nextch++; while(nextch<=lastch && (*nextch=='.' || isdigit(*nextch) || isalpha(*nextch) )) *p++ = *nextch++; toklen = p - token; *p = '\0'; return(SFIELD); } goto badchar; } /* Not a format statement */ if(needkwd) { needkwd = 0; return( getkwd() ); } for(pp=puncts; pp->punchar; ++pp) if(*nextch == pp->punchar) { if( (*nextch=='*' || *nextch=='/') && nextchpunval; if(val==SLPAR) ++parlev; else if(val==SRPAR) --parlev; ++nextch; } return(val); } if(*nextch == '.') if(nextch >= lastch) goto badchar; else if(isdigit(nextch[1])) goto numconst; else { for(pd=dots ; (j=pd->dotname) ; ++pd) { for(i=nextch+1 ; i<=lastch ; ++i) if(*i != *j) break; else if(*i != '.') ++j; else { nextch = i+1; return(pd->dotval); } } goto badchar; } if( isalpha(*nextch) ) { p = token; *p++ = *nextch++; while(nextch<=lastch) if( isalpha(*nextch) || isdigit(*nextch) ) *p++ = *nextch++; else break; toklen = p - token; *p = '\0'; if(inioctl && nextch<=lastch && *nextch=='=') { ++nextch; return(SNAMEEQ); } if(toklen>8 && eqn(8,token,"function") && isalpha(token[8]) && nextch VL) { char buff[30]; sprintf(buff, "name %s too long, truncated to %d", token, VL); err(buff); toklen = VL; token[VL] = '\0'; } if(toklen==1 && *nextch==MYQUOTE) { switch(token[0]) { case 'z': case 'Z': case 'x': case 'X': radix = 16; break; case 'o': case 'O': radix = 8; break; case 'b': case 'B': radix = 2; break; default: err("bad bit identifier"); return(SNAME); } ++nextch; for(p = token ; *nextch!=MYQUOTE ; ) if( hextoi(*p++ = *nextch++) >= radix) { err("invalid binary character"); break; } ++nextch; toklen = p - token; return( radix==16 ? SHEXCON : (radix==8 ? SOCTCON : SBITCON) ); } return(SNAME); } if( ! isdigit(*nextch) ) goto badchar; numconst: havdot = NO; havexp = NO; havdbl = NO; for(n1 = nextch ; nextch<=lastch ; ++nextch) { if(*nextch == '.') if(havdot) break; else if(nextch+2<=lastch && isalpha(nextch[1]) && isalpha(nextch[2])) break; else havdot = YES; else if( !intonly && (*nextch=='d' || *nextch=='e') ) { p = nextch; havexp = YES; if(*nextch == 'd') havdbl = YES; if(nextchstateno = 0; for(hp = hashtab ; hp < lasthash ; ++hp) if(p = hp->varp) { frexpr(p->vleng); if(q = p->vdim) { for(i = 0 ; i < q->ndim ; ++i) { frexpr(q->dims[i].dimsize); frexpr(q->dims[i].dimexpr); } frexpr(q->nelt); frexpr(q->baseoffset); frexpr(q->basexpr); free( (charptr) q); } if(p->vclass == CLNAMELIST) frchain( &(p->varxptr.namelist) ); free( (charptr) p); hp->varp = NULL; } nintnames = 0; highlabtab = labeltab; ctlstack = ctls - 1; for(cp = templist ; cp ; cp = cp->nextp) free( (charptr) (cp->datap) ); frchain(&templist); holdtemps = NULL; dorange = 0; nregvar = 0; highregvar = 0; entries = NULL; rpllist = NULL; inioctl = NO; ioblkp = NULL; eqvstart += nequiv; nequiv = 0; for(i = 0 ; i c2) { sprintf(buff, "characters out of order in implicit:%c-%c", c1, c2); err(buff); } else if(type < 0) for(i = c1 ; i<=c2 ; ++i) implstg[i-'a'] = - type; else { type = lengtype(type, (int) length); if(type != TYCHAR) length = 0; for(i = c1 ; i<=c2 ; ++i) { impltype[i-'a'] = type; implleng[i-'a'] = length; } } } * set class */ setlog(); } setimpl(type, length, c1, c2) int type; ftnint length; int c1, c2; { int i; char buff[100]; if(c1==0 cmd/f77/proc.c 644 0 33 50654 2477607044 6354 #include "defs" #include "machdefs" #ifdef SDB # include char *stabline(); # ifndef N_SO # include # endif #endif /* start a new procedure */ newproc() { if(parstate != OUTSIDE) { execerr("missing end statement", CNULL); endproc(); } parstate = INSIDE; procclass = CLMAIN; /* default */ } /* end of procedure. generate variables, epilogs, and prologs */ endproc() { struct Labelblock *lp; if(parstate < INDATA) enddcl(); if(ctlstack >= ctls) err("DO loop or BLOCK IF not closed"); for(lp = labeltab ; lp < labtabend ; ++lp) if(lp->stateno!=0 && lp->labdefined==NO) errstr("missing statement number %s", convic(lp->stateno) ); epicode(); procode(); donmlist(); dobss(); prdbginfo(); #if FAMILY == PCC putbracket(); #endif fixlwm(); procinit(); /* clean up for next procedure */ } /* End of declaration section of procedure. Allocate storage. */ enddcl() { register struct Entrypoint *ep; parstate = INEXEC; docommon(); doequiv(); docomleng(); for(ep = entries ; ep ; ep = ep->entnextp) doentry(ep); } /* ROUTINES CALLED WHEN ENCOUNTERING ENTRY POINTS */ /* Main program or Block data */ startproc(progname, class) struct Extsym * progname; int class; { register struct Entrypoint *p; p = ALLOC(Entrypoint); if(class == CLMAIN) puthead("MAIN__", CLMAIN); else puthead(CNULL, CLBLOCK); if(class == CLMAIN) newentry( mkname(5, "MAIN_") ); p->entryname = progname; p->entrylabel = newlabel(); entries = p; procclass = class; retlabel = newlabel(); fprintf(diagfile, " %s", (class==CLMAIN ? "MAIN" : "BLOCK DATA") ); if(progname) fprintf(diagfile, " %s", nounder(XL, procname = progname->extname) ); fprintf(diagfile, ":\n"); #ifdef SDB if(sdbflag && class==CLMAIN) { char buff[10]; sprintf(buff, "L%d", p->entrylabel); prstab("MAIN_", N_FUN, lineno, buff); p2pass( stabline("MAIN_", N_FNAME, 0, 0) ); if(progname) { prstab(nounder(XL,progname->extname), N_ENTRY, lineno,buff); /* p2pass(stabline(nounder(XL,progname->extname),N_FNAME,0,0)); */ } } #endif } /* subroutine or function statement */ struct Extsym *newentry(v) register Namep v; { register struct Extsym *p; p = mkext( varunder(VL, v->varname) ); if(p==NULL || p->extinit || ! ONEOF(p->extstg, M(STGUNKNOWN)|M(STGEXT)) ) { if(p == 0) dclerr("invalid entry name", v); else dclerr("external name already used", v); return(0); } v->vstg = STGAUTO; v->vprocclass = PTHISPROC; v->vclass = CLPROC; p->extstg = STGEXT; p->extinit = YES; return(p); } entrypt(class, type, length, entry, args) int class, type; ftnint length; struct Extsym *entry; chainp args; { register Namep q; register struct Entrypoint *p, *ep; if(class != CLENTRY) puthead( varstr(XL, procname = entry->extname), class); if(class == CLENTRY) fprintf(diagfile, " entry "); fprintf(diagfile, " %s:\n", nounder(XL, entry->extname)); q = mkname(VL, nounder(XL,entry->extname) ); if( (type = lengtype(type, (int) length)) != TYCHAR) length = 0; if(class == CLPROC) { procclass = CLPROC; proctype = type; procleng = length; retlabel = newlabel(); if(type == TYSUBR) ret0label = newlabel(); } p = ALLOC(Entrypoint); if(entries) /* put new block at end of entries list */ { for(ep = entries; ep->entnextp; ep = ep->entnextp) ; ep->entnextp = p; } else entries = p; p->entryname = entry; p->arglist = args; p->entrylabel = newlabel(); p->enamep = q; #ifdef SDB if(sdbflag) { char buff[10]; sprintf(buff, "L%d", p->entrylabel); prstab(nounder(XL, entry->extname), (class==CLENTRY ? N_ENTRY : N_FUN), lineno, buff); if(class != CLENTRY) p2pass( stabline( nounder(XL,entry->extname), N_FNAME, 0, 0) ); } #endif if(class == CLENTRY) { class = CLPROC; if(proctype == TYSUBR) type = TYSUBR; } q->vclass = class; q->vprocclass = PTHISPROC; settype(q, type, (int) length); /* hold all initial entry points till end of declarations */ if(parstate >= INDATA) doentry(p); } /* generate epilogs */ LOCAL epicode() { register int i; if(procclass==CLPROC) { if(proctype==TYSUBR) { putlabel(ret0label); if(substars) putforce(TYINT, ICON(0) ); putlabel(retlabel); goret(TYSUBR); } else { putlabel(retlabel); if(multitype) { typeaddr = autovar(1, TYADDR, PNULL); putbranch( cpexpr(typeaddr) ); for(i = 0; i < NTYPES ; ++i) if(rtvlabel[i] != 0) { putlabel(rtvlabel[i]); retval(i); } } else retval(proctype); } } else if(procclass != CLBLOCK) { putlabel(retlabel); goret(TYSUBR); } } /* generate code to return value of type t */ LOCAL retval(t) register int t; { register Addrp p; switch(t) { case TYCHAR: case TYCOMPLEX: case TYDCOMPLEX: break; case TYLOGICAL: t = tylogical; case TYADDR: case TYSHORT: case TYLONG: p = (Addrp) cpexpr(retslot); p->vtype = t; putforce(t, p); break; case TYREAL: case TYDREAL: p = (Addrp) cpexpr(retslot); p->vtype = t; putforce(t, p); break; default: badtype("retval", t); } goret(t); } /* Allocate extra argument array if needed. Generate prologs. */ LOCAL procode() { register struct Entrypoint *p; Addrp argvec; #if TARGET==GCOS argvec = autovar(lastargslot/SZADDR, TYADDR, PNULL); #else if(lastargslot>0 && nentry>1) #if TARGET == VAX argvec = autovar(1 + lastargslot/SZADDR, TYADDR, PNULL); #else argvec = autovar(lastargslot/SZADDR, TYADDR, PNULL); #endif else argvec = NULL; #endif #if TARGET == PDP11 /* for the optimizer */ if(fudgelabel) putlabel(fudgelabel); #endif for(p = entries ; p ; p = p->entnextp) prolog(p, argvec); #if FAMILY == PCC putrbrack(procno); #endif prendproc(); } /* manipulate argument lists (allocate argument slot positions) * keep track of return types and labels */ LOCAL doentry(ep) struct Entrypoint *ep; { register int type; register Namep np; chainp p; register Namep q; Addrp mkarg(); ++nentry; if(procclass == CLMAIN) { putlabel(ep->entrylabel); return; } else if(procclass == CLBLOCK) return; impldcl( np = mkname(VL, nounder(XL, ep->entryname->extname) ) ); type = np->vtype; if(proctype == TYUNKNOWN) if( (proctype = type) == TYCHAR) procleng = (np->vleng ? np->vleng->((constblock.const.ci : (ftnint) (-1)); if(proctype == TYCHAR) { if(type != TYCHAR) err("noncharacter entry of character function"); else if( (np->vleng ? np->vleng->constblock.const.ci : (ftnint) (-1)) != procleng) err("mismatched character entry lengths"); } else if(type == TYCHAR) err("character entry of noncharacter function"); else if(type != proctype) multitype = YES; if(rtvlabel[type] == 0) rtvlabel[type] = newlabel(); ep->typelabel = rtvlabel[type]; if(type == TYCHAR) { if(chslot < 0) { chslot = nextarg(TYADDR); chlgslot = nextarg(TYLENG); } np->vstg = STGARG; np->vardesc.varno = chslot; if(procleng < 0) np->vleng = (expptr) mkarg(TYLENG, chlgslot); } else if( ISCOMPLEX(type) ) { np->vstg = STGARG; if(cxslot < 0) cxslot = nextarg(TYADDR); np->vardesc.varno = cxslot; } else if(type != TYSUBR) { if(nentry == 1) retslot = autovar(1, TYDREAL, PNULL); np->vstg = STGAUTO; np->voffset = retslot->memoffset->constblock.const.ci; } for(p = ep->arglist ; p ; p = p->nextp) if(! (( q = (Namep) (p->datap) )->vdcldone) ) q->vardesc.varno = nextarg(TYADDR); for(p = ep->arglist ; p ; p = p->nextp) if(! (( q = (Namep) (p->datap) )->vdcldone) ) { impldcl(q); q->vdcldone = YES; #ifdef SDB if(sdbflag) prstab(varstr(VL,q->varname), N_PSYM, stabtype(q), convic(q->vardesc.varno + ARGOFFSET) ); #endif if(q->vtype == TYCHAR) { if(q->vleng == NULL) /* character*(*) */ q->vleng = (expptr) mkarg(TYLENG, nextarg(TYLENG) ); else if(nentry == 1) nextarg(TYLENG); } else if(q->vclass==CLPROC && nentry==1) nextarg(TYLENG) ; } putlabel(ep->entrylabel); } LOCAL nextarg(type) int type; { int k; k = lastargslot; lastargslot += typesize[type]; return(k); } /* generate variable references */ LOCAL dobss() { register struct Hashentry *p; register Namep q; register int i; int align; ftnint leng, iarrl; char *memname(); int qstg, qclass, qtype; pruse(asmfile, USEBSS); for(p = hashtab ; pvarp) { qstg = q->vstg; qtype = q->vtype; qclass = q->vclass; #ifdef SDB if(sdbflag && qclass==CLVAR) switch(qstg) { case STGAUTO: prstab(varstr(VL,q->varname), N_LSYM, stabtype(q), convic( - q->voffset)) ; prstleng(q, iarrlen(q)); break; case STGBSS: prstab(varstr(VL,q->varname), N_LCSYM, stabtype(q), memname(qstg,q->vardesc.varno) ); prstleng(q, iarrlen(q)); break; case STGINIT: prstab(varstr(VL,q->varname), N_STSYM, stabtype(q), memname(qstg,q->vardesc.varno) ); prstleng(q, iarrlen(q)); break; } #endif if( (qclass==CLUNKNOWN && qstg!=STGARG) || (qclass==CLVAR && qstg==STGUNKNOWN) ) warn1("local variable %s never used", varstr(VL,q->varname) ); else if(qclass==CLVAR && qstg==STGBSS) { align = (qtype==TYCHAR ? ALILONG : typealign[qtype]); if(bssleng % align != 0) { bssleng = roundup(bssleng, align); preven(align); } prlocvar(memname(STGBSS,q->vardesc.varno), iarrl = iarrlen(q) ); bssleng += iarrl; } else if(qclass==CLPROC && q->vprocclass==PEXTERNAL && qstg!=STGARG) mkext(varunder(VL, q->varname)) ->extstg = STGEXT; if(qclass==CLVAR && qstg!=STGARG) { if(q->vdim && !ISICON(q->vdim->nelt) ) dclerr("adjustable dimension on non-argument", q); if(qtype==TYCHAR && (q->vleng==NULL || !ISICON(q->vleng))) dclerr("adjustable leng on nonargument", q); } } for(i = 0 ; i < nequiv ; ++i) if(eqvclass[i].eqvinit==NO && (leng = eqvclass[i].eqvleng)!=0 ) { bssleng = roundup(bssleng, ALIDOUBLE); preven(ALIDOUBLE); prlocvar( memname(STGEQUIV, i), leng); bssleng += leng; } } donmlist() { register struct Hashentry *p; register Namep q; pruse(asmfile, USEINIT); for(p=hashtab; pvarp) && q->vclass==CLNAMELIST) namelist(q); } doext() { struct Extsym *p; for(p = extsymtab ; pextname), p->maxleng, p->extinit); } ftnint iarrlen(q) register Namep q; { ftnint leng; leng = typesize[q->vtype]; if(leng <= 0) return(-1); if(q->vdim) if( ISICON(q->vdim->nelt) ) leng *= q->vdim->nelt->constblock.const.ci; else return(-1); if(q->vleng) if( ISICON(q->vleng) ) leng *= q->vleng->constblock.const.ci; else return(-1); return(leng); } /* This routine creates a static block representing the namelist. An equivalent declaration of the structure produced is: struct namelist { char namelistname[16]; struct namelistentry { char varname[16]; char *varaddr; int type; # negative means -type= number of chars struct dimensions *dimp; # null means scalar } names[]; }; struct dimensions { int numberofdimensions; int numberofelements int baseoffset; int span[numberofdimensions]; }; where the namelistentry list terminates with a null varname If dimp is not null, then the corner element of the array is at varaddr. However, the element with subscripts (i1,...,in) is at varaddr - dimp->baseoffset + sizeoftype * (i1+span[0]*(i2+span[1]*...) */ namelist(np) Namep np; { register chainp q; register Namep v; register struct Dimblock *dp; char *memname(); int type, dimno, dimoffset; flag bad; preven(ALILONG); fprintf(asmfile, LABELFMT, memname(STGINIT, np->vardesc.varno)); putstr(asmfile, varstr(VL, np->varname), 16); dimno = ++lastvarno; dimoffset = 0; bad = NO; for(q = np->varxptr.namelist ; q ; q = q->nextp) { vardcl( v = (Namep) (q->datap) ); type = v->vtype; if( ONEOF(v->vstg, MSKSTATIC) ) { preven(ALILONG); putstr(asmfile, varstr(VL,v->varname), 16); praddr(asmfile, v->vstg, v->vardesc.varno, v->voffset); prconi(asmfile, TYINT, type==TYCHAR ? -(v->vleng->constblock.const.ci) : (ftnint) type); if(v->vdim) { praddr(asmfile, STGINIT, dimno, (ftnint)dimoffset); dimoffset += 3 + v->vdim->ndim; } else praddr(asmfile, STGNULL,0,(ftnint) 0); } else { dclerr("may not appear in namelist", v); bad = YES; } } if(bad) return; putstr(asmfile, "", 16); if(dimoffset > 0) { fprintf(asmfile, LABELFMT, memname(STGINIT,dimno)); for(q = np->varxptr.namelist ; q ; q = q->nextp) if(dp = q->datap->nameblock.vdim) { int i; prconi(asmfile, TYINT, (ftnint) (dp->ndim) ); prconi(asmfile, TYINT, (ftnint) (dp->nelt->constblock.const.ci) ); prconi(asmfile, TYINT, (ftnint) (dp->baseoffset->constblock.const.ci)); for(i=0; indim ; ++i) prconi(asmfile, TYINT, dp->dims[i].dimsize->constblock.const.ci); } } } LOCAL docommon() { register struct Extsym *p; register chainp q; struct Dimblock *t; expptr neltp; register Namep v; ftnint size; int type; for(p = extsymtab ; pextstg==STGCOMMON) { #ifdef SDB if(sdbflag) prstab(CNULL, N_BCOMM, 0, 0); #endif for(q = p->extp ; q ; q = q->nextp) { v = (Namep) (q->datap); if(v->vdcldone == NO) vardcl(v); type = v->vtype; if(p->extleng % typealign[type] != 0) { dclerr("common alignment", v); p->extleng = roundup(p->extleng, typealign[type]); } v->voffset = p->extleng; v->vardesc.varno = p - extsymtab; if(type == TYCHAR) size = v->vleng->constblock.const.ci; else size = typesize[type]; if(t = v->vdim) if( (neltp = t->nelt) && ISCONST(neltp) ) size *= neltp->constblock.const.ci; else dclerr("adjustable array in common", v); p->extleng += size; #ifdef SDB if(sdbflag) { prstssym(v); prstleng(v, size); } #endif } frchain( &(p->extp) ); #ifdef SDB if(sdbflag) prstab(varstr(XL,p->extname), N_ECOMM, 0, 0); #endif } } LOCAL docomleng() { register struct Extsym *p; for(p = extsymtab ; p < nextext ; ++p) if(p->extstg == STGCOMMON) { if(p->maxleng!=0 && p->extleng!=0 && p->maxleng!=p->extleng && !eqn(XL,"_BLNK__ ",p->extname) ) warn1("incompatible lengths for common block %s", nounder(XL, p->extname) ); if(p->maxleng < p->extleng) p->maxleng = p->extleng; p->extleng = 0; } } /* ROUTINES DEALING WITH AUTOMATIC AND TEMPORARY STORAGE */ frtemp(p) Addrp p; { /* restore clobbered character string lengths */ if(p->vtype==TYCHAR && p->varleng!=0) { frexpr(p->vleng); p->vleng = ICON(p->varleng); } /* put block on chain of temps to be reclaimed */ holdtemps = mkchain(p, holdtemps); } /* allocate an automatic variable slot */ Addrp autovar(nelt, t, lengp) register int nelt, t; expptr lengp; { ftnint leng; register Addrp q; if(t == TYCHAR) if( ISICON(lengp) ) leng = lengp->constblock.const.ci; else { fatal("automatic variable of nonconstant length"); } else leng = typesize[t]; autoleng = roundup( autoleng, typealign[t]); q = ALLOC(Addrblock); q->tag = TADDR; q->vtype = t; if(t == TYCHAR) { q->vleng = ICON(leng); q->varleng = leng; } q->vstg = STGAUTO; q->ntempelt = nelt; #if TARGET==PDP11 || TARGET==VAX /* stack grows downward */ autoleng += nelt*leng; q->memoffset = ICON( - autoleng ); #else q->memoffset = ICON( autoleng ); autoleng += nelt*leng; #endif return(q); } Addrp mktmpn(nelt, type, lengp) int nelt; register int type; expptr lengp; { ftnint leng; chainp p, oldp; register Addrp q; if(type==TYUNKNOWN || type==TYERROR) badtype("mktmpn", type); if(type==TYCHAR) if( ISICON(lengp) ) leng = lengp->constblock.const.ci; else { err("adjustable length"); return( errnode() ); } /* * if an temporary of appropriate shape is on the templist, * remove it from the list and return it */ for(oldp=CHNULL, p=templist ; p ; oldp=p, p=p->nextp) { q = (Addrp) (p->datap); if(q->vtype==type && q->ntempelt==nelt && (type!=TYCHAR || q->vlen((g->constblock.const.ci==leng) ) { if(oldp) oldp->nextp = p->nextp; else templist = p->nextp; free( (charptr) p); return(q); } } q = autovar(nelt, type, lengp); q->istemp = YES; return(q); } Addrp mktemp(type, lengp) int type; expptr lengp; { return( mktmpn(1,type,lengp) ); } /* VARIOUS ROUTINES FOR PROCESSING DECLARATIONS */ struct Extsym *comblock(len, s) register int len; register char *s; { struct Extsym *p; if(len == 0) { s = BLANKCOMMON; len = strlen(s); } p = mkext( varunder(len, s) ); if(p->extstg == STGUNKNOWN) p->extstg = STGCOMMON; else if(p->extstg != STGCOMMON) { errstr("%s cannot be a common block name", s); return(0); } return( p ); } incomm(c, v) struct Extsym *c; Namep v; { if(v->vstg != STGUNKNOWN) dclerr("incompatible common declaration", v); else { v->vstg = STGCOMMON; c->extp = hookup(c->extp, mkchain(v,CHNULL) ); } } settype(v, type, length) register Namep v; register int type; register int length; { if(type == TYUNKNOWN) return; if(type==TYSUBR && v->vtype!=TYUNKNOWN && v->vstg==STGARG) { v->vtype = TYSUBR; frexpr(v->vleng); } else if(type < 0) /* storage class set */ { if(v->vstg == STGUNKNOWN) v->vstg = - type; else if(v->vstg != -type) dclerr("incompatible storage declarations", v); } else if(v->vtype == TYUNKNOWN) { if( (v->vtype = lengtype(type, length))==TYCHAR && length>=0) v->vleng = ICON(length); } else if(v->vtype!=type || (type==TYCHAR && v->vleng->constblock.const.ci!=length) ) dclerr("incompatible type declarations", v); } lengtype(type, length) register int type; register int length; { switch(type) { case TYREAL: if(length == 8) return(TYDREAL); if(length == 4) goto ret; break; case TYCOMPLEX: if(length == 16) return(TYDCOMPLEX); if(length == 8) goto ret; break; case TYSHORT: case TYDREAL: case TYDCOMPLEX: case TYCHAR: case TYUNKNOWN: case TYSUBR: case TYERROR: goto ret; case TYLOGICAL: if(length == typesize[TYLOGICAL]) goto ret; break; case TYLONG: if(length == 0) return(tyint); if(length == 2) return(TYSHORT); if(length == 4) goto ret; break; default: badtype("lengtype", type); } if(length != 0) err("incompatible type-length combination"); ret: return(type); } setintr(v) register Namep v; { register int k; if(v->vstg == STGUNKNOWN) v->vstg = STGINTR; else if(v->vstg!=STGINTR) dclerr("incompatible use of intrinsic function", v); if(v->vclass==CLUNKNOWN) v->vclass = CLPROC; if(v->vprocclass == PUNKNOWN) v->vprocclass = PINTRINSIC; else if(v->vprocclass != PINTRINSIC) dclerr("invalid intrinsic declaration", v); if(k = intrfunct(v->varname)) v->vardesc.varno = k; else dclerr("unknown intrinsic function", v); } setext(v) register Namep v; { if(v->vclass == CLUNKNOWN) v->vclass = CLPROC; else if(v->vclass != CLPROC) dclerr("invalid external declaration", v); if(v->vprocclass == PUNKNOWN) v->vprocclass = PEXTERNAL; else if(v->vprocclass != PEXTERNAL) dclerr("invalid external declaration", v); } /* create dimensions block for array variable */ setbound(v, nd, dims) register Namep v; int nd; struct { expptr lb, ub; } dims[ ]; { register expptr q, t; register struct Dimblock *p; int i; if(v->vclass == CLUNKNOWN) v->vclass = CLVAR; else if(v->vclass != CLVAR) { dclerr("only variables may be arrays", v); return; } v->vdim = p = (struct Dimblock *) ckalloc( sizeof(int) + (3+2*nd)*sizeof(expptr) ); p->ndim = nd; p->nelt = ICON(1); for(i=0 ; inelt); p->nelt = NULL; } else err("only last bound may be asterisk"); p->dims[i].dimsize = ICON(1);; p->dims[i].dimexpr = NULL; } else { if(dims[i].lb) { q = mkexpr(OPMINUS, q, cpexpr(dims[i].lb)); q = mkexpr(OPPLUS, q, ICON(1) ); } if( ISCONST(q) ) { p->dims[i].dimsize = q; p->dims[i].dimexpr = (expptr) PNULL; } else { p->dims[i].dimsize = (expptr) autovar(1, tyint, PNULL); p->dims[i].dimexpr = q; } if(p->nelt) p->nelt = mkexpr(OPSTAR, p->nelt, cpexpr(p->dims[i].dimsize) ); } } q = dims[nd-1].lb; if(q == NULL) q = ICON(1); for(i = nd-2 ; i>=0 ; --i) { t = dims[i].lb; if(t == NULL) t = ICON(1); if(p->dims[i].dimsize) q = mkexpr(OPPLUS, t, mkexpr(OPSTAR, cpexpr(p->dims[i].dimsize), q) ); } if( ISCONST(q) ) { p->baseoffset = q; p->basexpr = NULL; } else { p->baseoffset = (expptr) autovar(1, tyint, PNULL); p->basexpr = q; } } tyint, PNULL); p->dims[i].dimexpr = q; } if(p->nelt) p->nelt = mkexpr(OPScmd/f77/equiv.c 644 0 33 13143 2411250574 6520 #include "defs" #ifdef SDB # include # ifndef N_SO # include # endif #endif /* ROUTINES RELATED TO EQUIVALENCE CLASS PROCESSING */ /* called at end of declarations section to process chains created by EQUIVALENCE statements */ doequiv() { register int i; int inequiv, comno, ovarno; ftnint comoffset, offset, leng; register struct Equivblock *p; register struct Eqvchain *q; struct Primblock *itemp; register Namep np; expptr offp, suboffset(); int ns, nsubs(); chainp cp; char *memname(); for(i = 0 ; i < nequiv ; ++i) { p = &eqvclass[i]; p->eqvbottom = p->eqvtop = 0; comno = -1; for(q = p->equivs ; q ; q = q->eqvnextp) { offset = 0; itemp = q->eqvitem.eqvlhs; vardcl(np = itemp->namep); if(itemp->argsp || itemp->fcharp) { if(np->vdim!=NULL && np->vdim->ndim>1 && nsubs(itemp->argsp)==1 ) { if(! ftn66flag) warn("1-dim subscript in EQUIVALENCE"); cp = NULL; ns = np->vdim->ndim; while(--ns > 0) cp = mkchain( ICON(1), cp); itemp->argsp->listp->nextp = cp; } offp = suboffset(itemp); if(ISICON(offp)) offset = offp->constblock.const.ci; else { dclerr("nonconstant subscript in equivalence ", np); np = NULL; } frexpr(offp); } frexpr(itemp); if(np && (leng = iarrlen(np))<0) { dclerr("adjustable in equivalence", np); np = NULL; } if(np) switch(np->vstg) { case STGUNKNOWN: case STGBSS: case STGEQUIV: break; case STGCOMMON: comno = np->vardesc.varno; comoffset = np->voffset + offset; break; default: dclerr("bad storage class in equivalence", np); np = NULL; break; } if(np) { q->eqvoffset = offset; p->eqvbottom = lmin(p->eqvbottom, -offset); p->eqvtop = lmax(p->eqvtop, leng-offset); } q->eqvitem.eqvname = np; } if(comno >= 0) eqvcommon(p, comno, comoffset); else for(q = p->equivs ; q ; q = q->eqvnextp) { if(np = q->eqvitem.eqvname) { inequiv = NO; if(np->vstg==STGEQUIV) if( (ovarno = np->vardesc.varno) == i) { if(np->voffset + q->eqvoffset != 0) dclerr("inconsistent equivalence", np); } else { offset = np->voffset; inequiv = YES; } np->vstg = STGEQUIV; np->vardesc.varno = i; np->voffset = - q->eqvoffset; if(inequiv) eqveqv(i, ovarno, q->eqvoffset + offset); } } } for(i = 0 ; i < nequiv ; ++i) { p = & eqvclass[i]; if(p->eqvbottom!=0 || p->eqvtop!=0) /* a live chain */ { #ifdef SDB if(sdbflag) prstab(CNULL, N_BCOMM, 0, 0); #endif for(q = p->equivs ; q; q = q->eqvnextp) { np = q->eqvitem.eqvname; np->voffset -= p->eqvbottom; if(np->voffset % typealign[np->vtype] != 0) dclerr("bad alignment forced by equivalence", np); #ifdef SDB if(sdbflag) { prstssym(np); prstleng(np, iarrlen(np)); } #endif } p->eqvtop -= p->eqvbottom; p->eqvbottom = 0; #ifdef SDB if(sdbflag) prstab(CNULL, N_ECOML, 0, memname(STGEQUIV,i) ); #endif } freqchain(p); } } /* put equivalence chain p at common block comno + comoffset */ LOCAL eqvcommon(p, comno, comoffset) struct Equivblock *p; int comno; ftnint comoffset; { int ovarno; ftnint k, offq; register Namep np; register struct Eqvchain *q; if(comoffset + p->eqvbottom < 0) { errstr("attempt to extend common %s backward", nounder(XL, extsymtab[comno].extname) ); freqchain(p); return; } if( (k = comoffset + p->eqvtop) > extsymtab[comno].extleng) extsymtab[comno].extleng = k; #ifdef SDB if(sdbflag) prstab( varstr(XL,extsymtab[comno].extname), N_BCOMM,0,0); #endif for(q = p->equivs ; q ; q = q->eqvnextp) if(np = q->eqvitem.eqvname) { switch(np->vstg) { case STGUNKNOWN: case STGBSS: np->vstg = STGCOMMON; np->vardesc.varno = comno; np->voffset = comoffset - q->eqvoffset; #ifdef SDB if(sdbflag) { prstssym(np); prstleng(np, iarrlen(np)); } #endif break; case STGEQUIV: ovarno = np->vardesc.varno; offq = comoffset - q->eqvoffset - np->voffset; np->vstg = STGCOMMON; np->vardesc.varno = comno; np->voffset = comoffset - q->eqvoffset; if(ovarno != (p - eqvclass)) eqvcommon(&eqvclass[ovarno], comno, offq); break; case STGCOMMON: if(comno != np->vardesc.varno || comoffset != np->voffset+q->eqvoffset) dclerr("inconsistent common usage", np); break; default: badstg("eqvcommon", np->vstg); } } #ifdef SDB if(sdbflag) prstab( varstr(XL,extsymtab[comno].extname), N_ECOMM,0,0); #endif freqchain(p); p->eqvbottom = p->eqvtop = 0; } /* put all items on ovarno chain on front of nvarno chain * adjust offsets of ovarno elements and top and bottom of nvarno chain */ LOCAL eqveqv(nvarno, ovarno, delta) int ovarno, nvarno; ftnint delta; { register struct Equivblock *p0, *p; register Namep np; struct Eqvchain *q, *q1; p0 = eqvclass + nvarno; p = eqvclass + ovarno; p0->eqvbottom = lmin(p0->eqvbottom, p->eqvbottom - delta); p0->eqvtop = lmax(p0->eqvtop, p->eqvtop - delta); p->eqvbottom = p->eqvtop = 0; for(q = p->equivs ; q ; q = q1) { (( q1 = q->eqvnextp; if( (np = q->eqvitem.eqvname) && np->vardesc.varno==ovarno) { q->eqvnextp = p0->equivs; p0->equivs = q; q->eqvoffset -= delta; np->vardesc.varno = nvarno; np->voffset -= delta; } else free( (charptr) q); } p->equivs = NULL; } LOCAL freqchain(p) register struct Equivblock *p; { register struct Eqvchain *q, *oq; for(q = p->equivs ; q ; q = oq) { oq = q->eqvnextp; free( (charptr) q); } p->equivs = NULL; } LOCAL nsubs(p) register struct Listblock *p; { register int n; register chainp q; n = 0; if(p) for(q = p->listp ; q ; q = q->nextp) ++n; return(n); } p0->equivs; p0->equivs = q; q->eqvoffset -= delta; np->vardesc.varno = nvarno; np->voffset -= delta; } else free( (charptr) q); } p->equivs = NULL; } LOCAL freqchain(p) register struct Equivblock *p; { register struct Eqvchain *q, *oq; for(q = p->equivs ; q ; q = oq) { oq = q->eqvnextp; free( (charptr) q); } p->equivs = NULL; } LOCAL nsubs(p) register struct Listblock *p; { register cmd/f77/data.c 644 0 33 14663 2411243510 6300 #include "defs" /* ROUTINES CALLED DURING DATA STATEMENT PROCESSING */ static char datafmt[] = "%s\t%05ld\t%05ld\t%d" ; /* another initializer, called from parser */ dataval(repp, valp) register expptr repp, valp; { int i, nrep; ftnint elen, vlen; register Addrp p; Addrp nextdata(); if(repp == NULL) nrep = 1; else if (ISICON(repp) && repp->constblock.const.ci >= 0) nrep = repp->constblock.const.ci; else { err("invalid repetition count in DATA statement"); frexpr(repp); goto ret; } frexpr(repp); if( ! ISCONST(valp) ) { err("non-constant initializer"); goto ret; } if(toomanyinit) goto ret; for(i = 0 ; i < nrep ; ++i) { p = nextdata(&elen, &vlen); if(p == NULL) { err("too many initializers"); toomanyinit = YES; goto ret; } setdata(p, valp, elen, vlen); frexpr(p); } ret: frexpr(valp); } Addrp nextdata(elenp, vlenp) ftnint *elenp, *vlenp; { register struct Impldoblock *ip; struct Primblock *pp; register Namep np; register struct Rplblock *rp; tagptr p; expptr neltp; register expptr q; int skip; ftnint off; while(curdtp) { p = curdtp->datap; if(p->tag == TIMPLDO) { ip = &(p->impldoblock); if(ip->implb==NULL || ip->impub==NULL || ip->varnp==NULL) fatali("bad impldoblock 0%o", (int) ip); if(ip->isactive) ip->varvp->const.ci += ip->impdiff; else { q = fixtype(cpexpr(ip->implb)); if( ! ISICON(q) ) goto doerr; ip->varvp = (Constp) q; if(ip->impstep) { q = fixtype(cpexpr(ip->impstep)); if( ! ISICON(q) ) goto doerr; ip->impdiff = q->constblock.const.ci; frexpr(q); } else ip->impdiff = 1; q = fixtype(cpexpr(ip->impub)); if(! ISICON(q)) goto doerr; ip->implim = q->constblock.const.ci; frexpr(q); ip->isactive = YES; rp = ALLOC(Rplblock); rp->rplnextp = rpllist; rpllist = rp; rp->rplnp = ip->varnp; rp->rplvp = (expptr) (ip->varvp); rp->rpltag = TCONST; } if( (ip->impdiff>0 && (ip->varvp->const.ci <= ip->implim)) || (ip->impdiff<0 && (ip->varvp->const.ci >= ip->implim)) ) { /* start new loop */ curdtp = ip->datalist; goto next; } /* clean up loop */ if(rpllist) { rp = rpllist; rpllist = rpllist->rplnextp; free( (charptr) rp); } else fatal("rpllist empty"); frexpr(ip->varvp); ip->isactive = NO; curdtp = curdtp->nextp; goto next; } pp = (struct Primblock *) p; np = pp->namep; skip = YES; if(p->primblock.argsp==NULL && np->vdim!=NULL) { /* array initialization */ q = (expptr) mkaddr(np); off = typesize[np->vtype] * curdtelt; if(np->vtype == TYCHAR) off *= np->vleng->constblock.const.ci; q->addrblock.memoffset = mkexpr(OPPLUS, q->addrblock.memoffset, mkintcon(off) ); if( (neltp = np->vdim->nelt) && ISCONST(neltp)) { if(++curdtelt < neltp->constblock.const.ci) skip = NO; } else err("attempt to initialize adjustable array"); } else q = mklhs( cpexpr(pp) ); if(skip) { curdtp = curdtp->nextp; curdtelt = 0; } if(q->headblock.vtype == TYCHAR) if(ISICON(q->headblock.vleng)) *elenp = q->headblock.vleng->constblock.const.ci; else { err("initialization of string of nonconstant length"); continue; } else *elenp = typesize[q->headblock.vtype]; if(np->vstg == STGCOMMON) *vlenp = extsymtab[np->vardesc.varno].maxleng; else if(np->vstg == STGEQUIV) *vlenp = eqvclass[np->vardesc.varno].eqvleng; else { *vlenp = (np->vtype==TYCHAR ? np->vleng->constblock.const.ci : typesize[np->vtype]); if(np->vstg==STGBSS && *vlenp>0) np->vstg = STGINIT; if(np->vdim) *vlenp *= np->vdim->nelt->constblock.const.ci; } return( (Addrp) q ); doerr: err("nonconstant implied DO parameter"); frexpr(q); curdtp = curdtp->nextp; next: curdtelt = 0; } return(NULL); } setdata(varp, valp, elen, vlen) register Addrp varp; ftnint elen, vlen; register Constp valp; { union Constant con; register int type; int i, k, valtype; ftnint offset; char *dataname(), *varname; varname = dataname(varp->vstg, varp->memno); offset = varp->memoffset->constblock.const.ci; type = varp->vtype; valtype = valp->vtype; if(type!=TYCHAR && valtype==TYCHAR) { if(! ftn66flag) warn("non-character datum initialized with character string"); varp->vleng = ICON(typesize[type]); varp->vtype = type = TYCHAR; } else if( (type==TYCHAR && valtype!=TYCHAR) || (cktype(OPASSIGN,type,valtype) == TYERROR) ) { err("incompatible types in initialization"); return; } if(type == TYADDR) con.ci = valp->const.ci; else if(type != TYCHAR) { if(valtype == TYUNKNOWN) con.ci = valp->const.ci; else consconv(type, &con, valtype, &valp->const); } k = 1; switch(type) { case TYLOGICAL: type = tylogical; case TYSHORT: case TYLONG: dataline(varname, offset, vlen, type); prconi(initfile, type, con.ci); break; case TYADDR: dataline(varname, offset, vlen, type); prcona(initfile, con.ci); break; case TYCOMPLEX: k = 2; type = TYREAL; case TYREAL: goto flpt; case TYDCOMPLEX: k = 2; type = TYDREAL; case TYDREAL: flpt: for(i = 0 ; i < k ; ++i) { dataline(varname, offset, vlen, type); prconr(initfile, type, con.cd[i]); offset += typesize[type]; } break; case TYCHAR: k = valp->vleng->constblock.const.ci; if(elen < k) k = elen; for(i = 0 ; i < k ; ++i) { dataline(varname, offset++, vlen, TYCHAR); fprintf(initfile, "\t%d\n", valp->const.ccp[i]); } k = elen - valp->vleng->constblock.const.ci; if(k > 0) { dataline(varname, offset, vlen, TYBLANK); fprintf(initfile, "\t%d\n", k); offset += k; } break; default: badtype("setdata", type); } } /* output form of name is padded with blanks and preceded with a storage class digit */ char *dataname(stg,memno) int stg, memno; { static char varname[XL+2]; register char *s, *t; char *memname(); varname[0] = (stg==STGCOMMON ? '2' : (stg==STGEQUIV ? '1' : '0') ); s = memname(stg, memno); for(t = varname+1 ; *s ; ) *t++ = *s++; while(t < varname+XL+1) *t++ = ' '; varname[XL+1] = '\0'; return(varname); } frdata(p0) chainp p0; { register struct Chain *p; register tagptr q; for(p = p0 ; p ; p = p->nextp) { q = p->datap; if(q->tag == TIMPLDO) { if(q->impldoblock.isbusy) return; /* circular chain completed */ q->impldoblock.isbusy = YES; frdata(q->impldoblock.datalist); free( (charptr) q); } else frexpr(q); } frchain( &p0); } dataline(varname, offset, vlen, type) char *varname; ftnint offset, vlen; int type; { fprintf(initfile, datafmt, varname, offset, vlen, type); } arname); } frdata(p0) chainp p0; { register struct Chain *p; register tacmd/f77/expr.c 644 0 33 116232 2411243513 6363 #include "defs" /* little routines to create constant blocks */ Constp mkconst(t) register int t; { register Constp p; p = ALLOC(Constblock); p->tag = TCONST; p->vtype = t; return(p); } expptr mklogcon(l) register int l; { register Constp p; p = mkconst(TYLOGICAL); p->const.ci = l; return( (expptr) p ); } expptr mkintcon(l) ftnint l; { register Constp p; p = mkconst(TYLONG); p->const.ci = l; #ifdef MAXSHORT if(l >= -MAXSHORT && l <= MAXSHORT) p->vtype = TYSHORT; #endif return( (expptr) p ); } expptr mkaddcon(l) register int l; { register Constp p; p = mkconst(TYADDR); p->const.ci = l; return( (expptr) p ); } expptr mkrealcon(t, d) register int t; double d; { register Constp p; p = mkconst(t); p->const.cd[0] = d; return( (expptr) p ); } expptr mkbitcon(shift, leng, s) int shift; int leng; char *s; { register Constp p; p = mkconst(TYUNKNOWN); p->const.ci = 0; while(--leng >= 0) if(*s != ' ') p->const.ci = (p->const.ci << shift) | hextoi(*s++); return( (expptr) p ); } expptr mkstrcon(l,v) int l; register char *v; { register Constp p; register char *s; p = mkconst(TYCHAR); p->vleng = ICON(l); p->const.ccp = s = (char *) ckalloc(l); while(--l >= 0) *s++ = *v++; return( (expptr) p ); } expptr mkcxcon(realp,imagp) register expptr realp, imagp; { int rtype, itype; register Constp p; rtype = realp->headblock.vtype; itype = imagp->headblock.vtype; if( ISCONST(realp) && ISNUMERIC(rtype) && ISCONST(imagp) && ISNUMERIC(itype) ) { p = mkconst( (rtype==TYDREAL||itype==TYDREAL) ? TY((DCOMPLEX : TYCOMPLEX); if( ISINT(rtype) ) p->const.cd[0] = realp->constblock.const.ci; else p->const.cd[0] = realp->constblock.const.cd[0]; if( ISINT(itype) ) p->const.cd[1] = imagp->constblock.const.ci; else p->const.cd[1] = imagp->constblock.const.cd[0]; } else { err("invalid complex constant"); p = errnode(); } frexpr(realp); frexpr(imagp); return( (expptr) p ); } expptr errnode() { struct Errorblock *p; p = ALLOC(Errorblock); p->tag = TERROR; p->vtype = TYERROR; return( (expptr) p ); } expptr mkconv(t, p) register int t; register expptr p; { register expptr q; register int pt; expptr opconv(); if(t==TYUNKNOWN || t==TYERROR) badtype("mkconv", t); pt = p->headblock.vtype; if(t == pt) return(p); else if( ISCONST(p) && pt!=TYADDR) { q = (expptr) mkconst(t); consconv(t, &(q->constblock.const), p->constblock.vtype, &(p->constblock.const) ); frexpr(p); } #if TARGET == PDP11 else if(ISINT(t) && pt==TYCHAR) { q = mkexpr(OPBITAND, opconv(p,TYSHORT), ICON(255)); if(t == TYLONG) q = opconv(q, TYLONG); } #endif else q = opconv(p, t); if(t == TYCHAR) q->constblock.vleng = ICON(1); return(q); } expptr opconv(p, t) expptr p; int t; { register expptr q; q = mkexpr(OPCONV, p, PNULL); q->headblock.vtype = t; return(q); } expptr addrof(p) expptr p; { return( mkexpr(OPADDR, p, PNULL) ); } tagptr cpexpr(p) register tagptr p; { register tagptr e; int tag; register chainp ep, pp; tagptr cpblock(); static int blksize[ ] = { 0, sizeof(struct Nameblock), sizeof(struct Constblock), sizeof(struct Exprblock), sizeof(struct Addrblock), sizeof(struct Primblock), sizeof(struct Listblock), sizeof(struct Errorblock) }; if(p == NULL) return(NULL); if( (tag = p->tag) == TNAME) return(p); e = cpblock( blksize[p->tag] , p); switch(tag) { case TCONST: if(e->constblock.vtype == TYCHAR) { e->constblock.const.ccp = copyn(1+strlen(e->constblock.const.ccp), e->constblock.const.ccp); e->constblock.vleng = (expptr) cpexpr(e->constblock.vleng); } case TERROR: break; case TEXPR: e->exprblock.leftp = (expptr) cpexpr(p->exprblock.leftp); e->exprblock.rightp = (expptr) cpexpr(p->exprblock.rightp); break; case TLIST: if(pp = p->listblock.listp) { ep = e->listblock.listp = mkchain( cpexpr(pp->datap), CHNULL); for(pp = pp->nextp ; pp ; pp = pp->nextp) ep = ep->nextp = mkchain( cpexpr(pp->datap), CHNULL); } break; case TADDR: e->addrblock.vleng = (expptr) cpexpr(e->addrblock.vleng); e->addrblock.memoffset = (expptr)cpexpr(e->addrblock.memoffset); e->addrblock.istemp = NO; break; case TPRIM: e->primblock.argsp = (struct Listblock *) cpexpr(e->primblock.argsp); e->primblock.fcharp = (expptr) cpexpr(e->primblock.fcharp); e->primblock.lcharp = (expptr) cpexpr(e->primblock.lcharp); break; default: badtag("cpexpr", tag); } return(e); } frexpr(p) register tagptr p; { register chainp q; if(p == NULL) return; switch(p->tag) { case TCONST: if( ISCHAR(p) ) { free( (charptr) (p->constblock.const.ccp) ); frexpr(p->constblock.vleng); } break; case TADDR: if(p->addrblock.istemp) { frtemp(p); return; } frexpr(p->addrblock.vleng); frexpr(p->addrblock.memoffset); break; case TERROR: break; case TNAME: return; case TPRIM: frexpr(p->primblock.argsp); frexpr(p->primblock.fcharp); frexpr(p->primblock.lcharp); break; case TEXPR: frexpr(p->exprblock.leftp); if(p->exprblock.rightp) frexpr(p->exprblock.rightp); break; case TLIST: for(q = p->listblock.listp ; q ; q = q->nextp) frexpr(q->datap); frchain( &(p->listblock.listp) ); break; default: badtag("frexpr", p->tag); } free( (charptr) p ); } /* fix up types in expression; replace subtrees and convert names to address blocks */ expptr fixtype(p) register tagptr p; { if(p == 0) return(0); switch(p->tag) { case TCONST: if(ONEOF(p->constblock.vtype,MSKINT|MSKLOGICAL|MSKADDR) ) return( (expptr) p); #if TARGET == VAX if(ONEOF(p->constblock.vtype,MSKREAL) && p->constblock.const.cd[0]==0) return( (expptr) p); #endif return( (expptr) putconst(p) ); case TADDR: p->addrblock.memoffset = fixtype(p->addrblock.memoffset); return( (expptr) p); case TERROR: return( (expptr) p); default: badtag("fixtype", p->tag); case TEXPR: return( fixexpr(p) ); case TLIST: return( (expptr) p ); case TPRIM: if(p->primblock.argsp && p->primblock.namep->vclass!=CLVAR) { if(p->primblock.namep->vtype == TYSUBR) { err("function invocation of subroutine"); return( errnode() ); } else return( mkfunct(p) ); } else return( mklhs(p) ); } } /* special case tree transformations and cleanups of expression trees */ expptr fixexpr(p) register Exprp p; { expptr lp; register expptr rp; register expptr q; int opcode, ltype, rtype, ptype, mtype; expptr mkpower(); if( ISERROR(p) ) return( (expptr) p ); else if(p->tag != TEXPR) badtag("fixexpr", p->tag); opcode = p->opcode; lp = p->leftp = fixtype(p->leftp); ltype = lp->headblock.vtype; if(opcode==OPASSIGN && lp->tag!=TADDR) { err("left side of assignment must be variable"); frexpr(p); return( errnode() ); } if(p->rightp) { rp = p->rightp = fixtype(p->rightp); rtype = rp->headblock.vtype; } else { rp = NULL; rtype = 0; } if(ltype==TYERROR || rtype==TYERROR) { frexpr(p); return( errnode() ); } /* force folding if possible */ if( ISCONST(lp) && (rp==NULL || ISCONST(rp)) ) { q = mkexpr(opcode, lp, rp); if( ISCONST(q) ) return(q); free( (charptr) q ); /* constants did not fold */ } if( (ptype = cktype(opcode, ltype, rtype)) == TYERROR) { frexpr(p); return( errnode() ); } switch(opcode) { case OPCONCAT: if(p->vleng == NULL) p->vleng = mkexpr(OPPLUS, cpexpr(lp->headblock.vleng), cpexpr(rp->headblock.vleng) ); break; case OPASSIGN: case OPPLUSEQ: case OPSTAREQ: if(ltype == rtype) break; if( ! ISCONST(rp) && ISREAL(ltype) && ISREAL(rtype) ) break; if( ISCOMPLEX(ltype) || ISCOMPLEX(rtype) ) break; if( ONEOF(ltype, MSKADDR|MSKINT) && ONEOF(rtype, MSKADDR|MSKINT) #if FAMILY==PCC && typesize[ltype]>=typesize[rtype] ) #else && typesize[ltype]==typesize[rtype] ) #endif break; p->rightp = fixtype( mkconv(ptype, rp) ); break; case OPSLASH: if( ISCOMPLEX(rtype) ) { p = (Exprp) call2(ptype, ptype==TYCOMPLEX? "c_div" : "z_div", mkconv(ptype, lp), mkconv(ptype, rp) ); break; } case OPPLUS: case OPMINUS: case OPSTAR: case OPMOD: if(ptype==TYDREAL && ( (ltype==TYREAL && ! ISCONST(lp) ) || (rtype==TYREAL && ! ISCONST(rp) ) )) break; if( ISCOMPLEX(ptype) ) break; if(ltype != ptype) p->leftp = fixtype(mkconv(ptype,lp)); if(rtype != ptype) p->rightp = fixtype(mkconv(ptype,rp)); break; case OPPOWER: return( mkpower(p) ); case OPLT: case OPLE: case OPGT: case OPGE: case OPEQ: case OPNE: if(ltype == rtype) break; mtype = cktype(OPMINUS, ltype, rtype); if(mtype==TYDREAL && ( (ltype==TYREAL && ! ISCONST(lp)) || (rtype==TYREAL && ! ISCONST(rp)) )) break; if( ISCOMPLEX(mtype) ) break; if(ltype != mtype) p->leftp = fixtype(mkconv(mtype,lp)); if(rtype != mtype) p->rightp = fixtype(mkconv(mtype,rp)); break; case OPCONV: ptype = cktype(OPCONV, p->vtype, ltype); if(lp->tag==TEXPR && lp->exprblock.opcode==OPCOMMA) { lp->exprblock.rightp = fixtype( mkconv(ptype, lp->exprblock.rightp) ); free( (charptr) p ); p = (Exprp) lp; } break; case OPADDR: if(lp->tag==TEXPR && lp->exprblock.opcode==OPADDR) fatal("addr of addr"); break; case OPCOMMA: case OPQUEST: case OPCOLON: break; case OPMIN: case OPMAX: ptype = p->vtype; break; default: break; } p->vtype = ptype; return((expptr) p); } #if SZINT < SZLONG /* for efficient subscripting, replace long ints by shorts in easy places */ expptr shorten(p) register expptr p; { register expptr q; if(p->headblock.vtype != TYLONG) return(p); switch(p->tag) { case TERROR: case TLIST: return(p); case TCONST: case TADDR: return( mkconv(TYINT,p) ); case TEXPR: break; default: badtag("shorten", p->tag); } switch(p->exprblock.opcode) { case OPPLUS: case OPMINUS: case OPSTAR: q = shorten( cpexpr(p->exprblock.rightp) ); if(q->headblock.vtype == TYINT) { p->exprblock.leftp = shorten(p->exprblock.leftp); if(p->exprblock.leftp->headblock.vtype == TYLONG) frexpr(q); else { frexpr(p->exprblock.rightp); p->exprblock.rightp = q; p->exprblock.vtype = TYINT; } } break; case OPNEG: p->exprblock.leftp = shorten(p->exprblock.leftp); if(p->exprblock.leftp->headblock.vtype == TYINT) p->exprblock.vtype = TYINT; break; case OPCALL: case OPCCALL: p = mkconv(TYINT,p); break; default: break; } return(p); } #endif /* fix an argument list, taking due care for special first level cases */ fixargs(doput, p0) int doput; /* doput is true if the function is not intrinsic */ struct Listblock *p0; { register chainp p; register tagptr q, t; register int qtag; int nargs; Addrp mkscalar(); nargs = 0; if(p0) for(p = p0->listp ; p ; p = p->nextp) { ++nargs; q = p->datap; qtag = q->tag; if(qtag == TCONST) { if(q->constblock.vtype == TYSHORT) q = (tagptr) mkconv(tyint, q); /* leave constant arguments of intrinsics alone -- * the expression might still simplify. */ p->datap = doput ? (tagptr) putconst(q) : q ; } else if(qtag==TPRIM && q->primblock.argsp==0 && q->primblock.namep->vclass==CLPROC) p->datap = (tagptr) mkaddr(q->primblock.namep); else if(qtag==TPRIM && q->primblock.argsp==0 && q->primblock.namep->vdim!=NULL) p->datap = (tagptr) mkscalar(q->primblock.namep); else if(qtag==TPRIM && q->primblock.argsp==0 && q->primblock.namep->vdovar && (t = (tagptr) memversion(q->primblock.namep)) ) p->datap = (tagptr) fixtype(t); else p->datap = (tagptr) fixtype(q); } return(nargs); } Addrp mkscalar(np) register Namep np; { register Addrp ap; vardcl(np); ap = mkaddr(np); #if TARGET == VAX /* on the VAX, prolog causes array arguments to point at the (0,..((.,0) element, except when subscript checking is on */ if( !checksubs && np->vstg==STGARG) { register struct Dimblock *dp; dp = np->vdim; frexpr(ap->memoffset); ap->memoffset = mkexpr(OPSTAR, (np->vtype==TYCHAR ? cpexpr(np->vleng) : (tagptr)ICON(typesize[np->vtype]) ), cpexpr(dp->baseoffset) ); } #endif return(ap); } expptr mkfunct(p) register struct Primblock *p; { struct Entrypoint *ep; Addrp ap; struct Extsym *extp; register Namep np; register expptr q; expptr intrcall(), stfcall(); int k, nargs; int class; if(p->tag != TPRIM) return( errnode() ); np = p->namep; class = np->vclass; if(class == CLUNKNOWN) { np->vclass = class = CLPROC; if(np->vstg == STGUNKNOWN) { if(np->vtype!=TYSUBR && (k = intrfunct(np->varname)) ) { np->vstg = STGINTR; np->vardesc.varno = k; np->vprocclass = PINTRINSIC; } else { extp = mkext( varunder(VL,np->varname) ); extp->extstg = STGEXT; np->vstg = STGEXT; np->vardesc.varno = extp - extsymtab; np->vprocclass = PEXTERNAL; } } else if(np->vstg==STGARG) { if(np->vtype!=TYCHAR && !ftn66flag) warn("Dummy procedure not declared EXTERNAL. Code may be wrong."); np->vprocclass = PEXTERNAL; } } if(class != CLPROC) fatali("invalid class code %d for function", class); if(p->fcharp || p->lcharp) { err("no substring of function call"); goto error; } impldcl(np); nargs = fixargs( np->vprocclass!=PINTRINSIC, p->argsp); switch(np->vprocclass) { case PEXTERNAL: ap = mkaddr(np); call: q = mkexpr(OPCALL, ap, p->argsp); if( (q->exprblock.vtype = np->vtype) == TYUNKNOWN) { err("attempt to use untyped function"); goto error; } if(np->vleng) q->exprblock.vleng = (expptr) cpexpr(np->vleng); break; case PINTRINSIC: q = intrcall(np, p->argsp, nargs); break; case PSTFUNCT: q = stfcall(np, p->argsp); break; case PTHISPROC: warn("recursive call"); for(ep = entries ; ep ; ep = ep->entnextp) if(ep->enamep == np) break; if(ep == NULL) fatal("mkfunct: impossible recursion"); ap = builtin(np->vtype, varstr(XL, ep->entryname->extname) ); goto call; default: fatali("mkfunct: impossible vprocclass %d", (int) (np->vprocclass) ); } free( (charptr) p ); return(q); error: frexpr(p); return( errnode() ); } LOCAL expptr stfcall(np, actlist) Namep np; struct Listblock *actlist; { register chainp actuals; int nargs; chainp oactp, formals; int type; expptr q, rhs, ap; Namep tnp; register struct Rplblock *rp; struct Rplblock *tlist; if(actlist) { actuals = actlist->listp; free( (charptr) actlist); } else actuals = NULL; oactp = actuals; nargs = 0; tlist = NULL; if( (type = np->vtype) == TYUNKNOWN) { err("attempt to use untyped statement function"); q = errnode(); goto ret; } formals = (chainp) (np->varxptr.vstfdesc->datap); rhs = (expptr) (np->varxptr.vstfdesc->nextp); /* copy actual arguments into temporaries */ while(actuals!=NULL && formals!=NULL) { rp = ALLOC(Rplblock); rp->rplnp = tnp = (Namep) (formals->datap); ap = fixtype(actuals->datap); if(tnp->vtype==ap->headblock.vtype && tnp->vtype!=TYCHAR && (ap->tag==TCONST || ap->tag==TADDR) ) { rp->rplvp = (expptr) ap; rp->rplxp = NULL; rp->rpltag = ap->tag; } else { rp->rplvp = (expptr) mktemp(tnp->vtype, tnp->vleng); rp->rplxp = fixtype( mkexpr(OPASSIGN, cpexpr(rp->rplvp), ap) ); if( (rp->rpltag = rp->rplxp->tag) == TERROR) err("disagreement of argument types in statement function call"); } rp->rplnextp = tlist; tlist = rp; actuals = actuals->nextp; formals = formals->nextp; ++nargs; } if(actuals!=NULL || formals!=NULL) err("statement function definition and argument list differ"); /* now push down names involved in formal argument list, then evaluate rhs of statement function definition in this environment */ if(tlist) /* put tlist in front of the rpllist */ { for(rp = tlist; rp->rplnextp; rp = rp->rplnextp) ; rp->rplnextp = rpllist; rpllist = tlist; } q = (expptr) mkconv(type, fixtype(cpexpr(rhs)) ); /* now generate the tree ( t1=a1, (t2=a2,... , f))))) */ while(--nargs >= 0) { if(rpllist->rplxp) q = mkexpr(OPCOMMA, rpllist->rplxp, q); rp = rpllist->rplnextp; frexpr(rpllist->rplvp); free(rpllist); rpllist = rp; } ret: frchain( &oactp ); return(q); } Addrp mkplace(np) register Namep np; { register Addrp s; register struct Rplblock *rp; int regn; /* is name on the replace list? */ for(rp = rpllist ; rp ; rp = rp->rplnextp) { if(np == rp->rplnp) { if(rp->rpltag == TNAME) { np = (Namep) (rp->rplvp); break; } else return( (Addrp) cpexpr(rp->rplvp) ); } } /* is variable a DO index in a register ? */ if(np->vdovar && ( (regn = inregister(np)) >= 0) ) if(np->vtype == TYERROR) return( errnode() ); else { s = ALLOC(Addrblock); s->tag = TADDR; s->vstg = STGREG; s->vtype = TYIREG; s->memno = regn; s->memoffset = ICON(0); return(s); } vardcl(np); return(mkaddr(np)); } expptr mklhs(p) register struct Primblock *p; { expptr suboffset(); register Addrp s; Namep np; if(p->tag != TPRIM) return( (expptr) p ); np = p->namep; s = mkplace(np); if(s->tag!=TADDR || s->vstg==STGREG) { free( (charptr) p ); return( (expptr) s ); } /* compute the address modified by subscripts */ s->memoffset = mkexpr(OPPLUS, s->memoffset, suboffset(p) ); frexpr(p->argsp); p->argsp = NULL; /* now do substring part */ if(p->fcharp || p->lcharp) { if(np->vtype != TYCHAR) errstr("substring of noncharacter %s", varstr(VL,np->varname)); else { if(p->lcharp == NULL) p->lcharp = (expptr) cpexpr(s->vleng); if(p->fcharp) s->vleng = mkexpr(OPMINUS, p->lcharp, mkexpr(OPMINUS, p->fcharp, ICON(1) )); else { frexpr(s->vleng); s->vleng = p->lcharp; } } } s->vleng = fixtype( s->vleng ); s->memoffset = fixtype( s->memoffset ); free( (charptr) p ); return( (expptr) s ); } deregister(np) Namep np; { if(nregvar>0 && regnamep[nregvar-1]==np) { --nregvar; #if FAMILY == DMR putnreg(); #endif } } Addrp memversion(np) register Namep np; { register Addrp s; if(np->vdovar==NO || (inregister(np)<0) ) return(NULL); np->vdovar = NO; s = mkplace(np); np->vdovar = YES; return(s); } inregister(np) register Namep np; { register int i; for(i = 0 ; i < nregvar ; ++i) if(regnamep[i] == np) return( regnum[i] ); return(-1); } enregister(np) Namep np; { if( inregister(np) >= 0) return(YES); if(nregvar >= maxregvar) return(NO); vardcl(np); if( ONEOF(np->vtype, MSKIREG) ) { regnamep[nregvar++] = np; if(nregvar > highregvar) highregvar = nregvar; #if FAMILY == DMR putnreg(); #endif return(YES); } else return(NO); } expptr suboffset(p) register struct Primblock *p; { int n; expptr size; chainp cp; expptr offp, prod; expptr subcheck(); struct Dimblock *dimp; expptr sub[MAXDIM+1]; register Namep np; np = p->namep; offp = ICON(0); n = 0; if(p->argsp) for(cp = p->argsp->listp ; cp ; cp = cp->nextp) { sub[n++] = fixtype(cpexpr(cp->datap)); if(n > maxdim) { erri("more than %d subscripts", maxdim); break; } } dimp = np->vdim; if(n>0 && dimp==NULL) err("subscripts on scalar variable"); else if(dimp && dimp->ndim!=n) errstr("wrong number of subscripts on %s", varstr(VL, np->varname) ); else if(n > 0) { prod = sub[--n]; while( --n >= 0) prod = mkexpr(OPPLUS, sub[n], mkexpr(OPSTAR, prod, cpexpr(dimp->dims[n].dimsize)) ); #if TARGET == VAX if(checksubs || np->vstg!=STGARG) prod = mkexpr(OPMINUS, prod, cpexpr(dimp->baseoffset)); #else prod = mkexpr(OPMINUS, prod, cpexpr(dimp->baseoffset)); #endif if(checksubs) prod = subcheck(np, prod); size = np->vtype == TYCHAR ? (expptr) cpexpr(np->vleng) : ICON(typesize[np->vtype]); prod = mkexpr(OPSTAR, prod, size); offp = mkexpr(OPPLUS, offp, prod); } if(p->fcharp && np->vtype==TYCHAR) offp = mkexpr(OPPLUS, offp, mkexpr(OPMINUS, cpexpr(p->fcharp), ICON(1) )); return(offp); } expptr subcheck(np, p) Namep np; register expptr p; { struct Dimblock *dimp; expptr t, checkvar, checkcond, badcall; dimp = np->vdim; if(dimp->nelt == NULL) return(p); /* don't check arrays with * bounds */ checkvar = NULL; checkcond = NULL; if( ISICON(p) ) { if(p->constblock.const.ci < 0) goto badsub; if( ISICON(dimp->nelt) ) if(p->constblock.const.ci < dimp->nelt->constblock.const.ci) return(p); else goto badsub; } if(p->tag==TADDR && p->addrblock.vstg==STGREG) { checkvar = (expptr) cpexpr(p); t = p; } else { checkvar = (expptr) mktemp(p->headblock.vtype, ENULL); t = mkexpr(OPASSIGN, cpexpr(checkvar), p); } checkcond = mkexpr(OPLT, t, cpexpr(dimp->nelt) ); if( ! ISICON(p) ) checkcond = mkexpr(OPAND, checkcond, mkexpr(OPLE, ICON(0), cpexpr(checkvar)) ); badcall = call4(p->headblock.vtype, "s_rnge", mkstrcon(VL, np->varname), mkconv(TYLONG, cpexpr(checkvar)), mkstrcon(XL, procname), ICON(lineno) ); badcall->exprblock.opcode = OPCCALL; p = mkexpr(OPQUEST, checkcond, mkexpr(OPCOLON, checkvar, badcall)); return(p); badsub: frexpr(p); errstr("subscript on variable %s out of range", varstr(VL,np->varname)); return ( ICON(0) ); } Addrp mkaddr(p) register Namep p; { struct Extsym *extp; register Addrp t; Addrp intraddr(); switch( p->vstg) { case STGUNKNOWN: if(p->vclass != CLPROC) break; extp = mkext( varunder(VL, p->varname) ); extp->extstg = STGEXT; p->vstg = STGEXT; p->vardesc.varno = extp - extsymtab; p->vprocclass = PEXTERNAL; case STGCOMMON: case STGEXT: case STGBSS: case STGINIT: case STGEQUIV: case STGARG: case STGLENG: case STGAUTO: t = ALLOC(Addrblock); t->tag = TADDR; if(p->vclass==CLPROC && p->vprocclass==PTHISPROC) t->vclass = CLVAR; else t->vclass = p->vclass; t->vtype = p->vtype; t->vstg = p->vstg; t->memno = p->vardesc.varno; t->memoffset = ICON(p->voffset); if(p->vleng) { t->vleng = (expptr) cpexpr(p->vleng); if( ISICON(t->vleng) ) t->varleng = t->vleng->constblock.const.ci; } return(t); case STGINTR: return( intraddr(p) ); } /*debug*/fprintf(diagfile,"mkaddr. vtype=%d, vclass=%d\n", p->vtype, p->vclass); badstg("mkaddr", p->vstg); /* NOTREACHED */ } Addrp mkarg(type, argno) int type, argno; { register ((Addrp p; p = ALLOC(Addrblock); p->tag = TADDR; p->vtype = type; p->vclass = CLVAR; p->vstg = (type==TYLENG ? STGLENG : STGARG); p->memno = argno; return(p); } expptr mkprim(v, args, substr) register union { struct Paramblock paramblock; struct Nameblock nameblock; struct Headblock headblock; } *v; struct Listblock *args; chainp substr; { register struct Primblock *p; if(v->headblock.vclass == CLPARAM) { if(args || substr) { errstr("no qualifiers on parameter name %s", varstr(VL,v->paramblock.varname)); frexpr(args); if(substr) { frexpr(substr->datap); frexpr(substr->nextp->datap); frchain(&substr); } frexpr(v); return( errnode() ); } return( (expptr) cpexpr(v->paramblock.paramval) ); } p = ALLOC(Primblock); p->tag = TPRIM; p->vtype = v->nameblock.vtype; p->namep = (Namep) v; p->argsp = args; if(substr) { p->fcharp = (expptr) (substr->datap); p->lcharp = (expptr) (substr->nextp->datap); frchain(&substr); } return( (expptr) p); } vardcl(v) register Namep v; { int nelt; struct Dimblock *t; Addrp p; expptr neltp; if(v->vdcldone) return; if(v->vclass == CLNAMELIST) return; if(v->vtype == TYUNKNOWN) impldcl(v); if(v->vclass == CLUNKNOWN) v->vclass = CLVAR; else if(v->vclass!=CLVAR && v->vprocclass!=PTHISPROC) { dclerr("used as variable", v); return; } if(v->vstg==STGUNKNOWN) v->vstg = implstg[ letter(v->varname[0]) ]; switch(v->vstg) { case STGBSS: v->vardesc.varno = ++lastvarno; break; case STGAUTO: if(v->vclass==CLPROC && v->vprocclass==PTHISPROC) break; nelt = 1; if(t = v->vdim) if( (neltp = t->nelt) && ISCONST(neltp) ) nelt = neltp->constblock.const.ci; else dclerr("adjustable automatic array", v); p = autovar(nelt, v->vtype, v->vleng); v->voffset = p->memoffset->constblock.const.ci; frexpr(p); break; default: break; } v->vdcldone = YES; } impldcl(p) register Namep p; { register int k; int type, leng; if(p->vdcldone || (p->vclass==CLPROC && p->vprocclass==PINTRINSIC) ) return; if(p->vtype == TYUNKNOWN) { k = letter(p->varname[0]); type = impltype[ k ]; leng = implleng[ k ]; if(type == TYUNKNOWN) { if(p->vclass == CLPROC) return; dclerr("attempt to use undefined variable", p); type = TYERROR; leng = 1; } settype(p, type, leng); } } LOCAL letter(c) register int c; { if( isupper(c) ) c = tolower(c); return(c - 'a'); } #define ICONEQ(z, c) (ISICON(z) && z->constblock.const.ci==c) #define COMMUTE { e = lp; lp = rp; rp = e; } expptr mkexpr(opcode, lp, rp) int opcode; register expptr lp, rp; { register expptr e, e1; int etype; int ltype, rtype; int ltag, rtag; expptr fold(); ltype = lp->headblock.vtype; ltag = lp->tag; if(rp && opcode!=OPCALL && opcode!=OPCCALL) { rtype = rp->headblock.vtype; rtag = rp->tag; } else rtype = 0; etype = cktype(opcode, ltype, rtype); if(etype == TYERROR) goto error; switch(opcode) { /* check for multiplication by 0 and 1 and addition to 0 */ case OPSTAR: if( ISCONST(lp) ) COMMUTE if( ISICON(rp) ) { if(rp->constblock.const.ci == 0) goto retright; goto mulop; } break; case OPSLASH: case OPMOD: if( ICONEQ(rp, 0) ) { err("attempted division by zero"); rp = ICON(1); break; } if(opcode == OPMOD) break; mulop: if( ISICON(rp) ) { if(rp->constblock.const.ci == 1) goto retleft; if(rp->constblock.const.ci == -1) { frexpr(rp); return( mkexpr(OPNEG, lp, PNULL) ); } } if( ISSTAROP(lp) && ISICON(lp->exprblock.rightp) ) { if(opcode == OPSTAR) e = mkexpr(OPSTAR, lp->exprblock.rightp, rp); else if(ISICON(rp) && (lp->exprblock.rightp->constblock.const.ci % rp->constblock.const.ci) == 0) e = mkexpr(OPSLASH, lp->exprblock.rightp, rp); else break; e1 = lp->exprblock.leftp; free( (charptr) lp ); return( mkexpr(OPSTAR, e1, e) ); } break; case OPPLUS: if( ISCONST(lp) ) COMMUTE goto addop; case OPMINUS: if( ICONEQ(lp, 0) ) { frexpr(lp); return( mkexpr(OPNEG, rp, ENULL) ); } if( ISCONST(rp) ) { opcode = OPPLUS; consnegop(rp); } addop: if( ISICON(rp) ) { if(rp->constblock.const.ci == 0) goto retleft; if( ISPLUSOP(lp) && ISICON(lp->exprblock.rightp) ) { e = mkexpr(OPPLUS, lp->exprblock.rightp, rp); e1 = lp->exprblock.leftp; free( (charptr) lp ); return( mkexpr(OPPLUS, e1, e) ); } } break; case OPPOWER: break; case OPNEG: if(ltag==TEXPR && lp->exprblock.opcode==OPNEG) { e = lp->exprblock.leftp; free( (charptr) lp ); return(e); } break; case OPNOT: if(ltag==TEXPR && lp->exprblock.opcode==OPNOT) { e = lp->exprblock.leftp; free( (charptr) lp ); return(e); } break; case OPCALL: case OPCCALL: etype = ltype; if(rp!=NULL && rp->listblock.listp==NULL) { free( (charptr) rp ); rp = NULL; } break; case OPAND: case OPOR: if( ISCONST(lp) ) COMMUTE if( ISCONST(rp) ) { if(rp->constblock.const.ci == 0) if(opcode == OPOR) goto retleft; else goto retright; else if(opcode == OPOR) goto retright; else goto retleft; } case OPEQV: case OPNEQV: case OPBITAND: case OPBITOR: case OPBITXOR: case OPBITNOT: case OPLSHIFT: case OPRSHIFT: case OPLT: case OPGT: case OPLE: case OPGE: case OPEQ: case OPNE: case OPCONCAT: break; case OPMIN: case OPMAX: case OPASSIGN: case OPPLUSEQ: case OPSTAREQ: case OPCONV: case OPADDR: case OPCOMMA: case OPQUEST: case OPCOLON: break; default: badop("mkexpr", opcode); } e = (expptr) ALLOC(Exprblock); e->exprblock.tag = TEXPR; e->exprblock.opcode = opcode; e->exprblock.vtype = etype; e->exprblock.leftp = lp; e->exprblock.rightp = rp; if(ltag==TCONST && (rp==0 || rtag==TCONST) ) e = fold(e); return(e); retleft: frexpr(rp); return(lp); retright: frexpr(lp); return(rp); error: frexpr(lp); if(rp && opcode!=OPCALL && opcode!=OPCCALL) frexpr(rp); return( errnode() ); } #define ERR(s) { errs = s; goto error; } cktype(op, lt, rt) register int op, lt, rt; { char *errs; if(lt==TYERROR || rt==TYERROR) goto error1; if(lt==TYUNKNOWN) return(TYUNKNOWN); if(rt==TYUNKNOWN) if(op!=OPNOT && op!=OPBITNOT && op!=OPNEG && op!=OPCALL && op!=OPCCALL && op!=OPADDR) return(TYUNKNOWN); switch(op) { case OPPLUS: case OPMINUS: case OPSTAR: case OPSLASH: case OPPOWER: case OPMOD: if( ISNUMERIC(lt) && ISNUMERIC(rt) ) return( maxtype(lt, rt) ); ERR("nonarithmetic operand of arithmetic operator") case OPNEG: if( ISNUMERIC(lt) ) return(lt); ERR("nonarithmetic operand of negation") case OPNOT: if(lt == TYLOGICAL) return(TYLOGICAL); ERR("NOT of nonlogical") case OPAND: case OPOR: case OPEQV: case OPNEQV: if(lt==TYLOGICAL && rt==TYLOGICAL) return(TYLOGICAL); ERR("nonlogical operand of logical operator") case OPLT: case OPGT: case OPLE: case OPGE: case OPEQ: case OPNE: if(lt==TYCHAR || rt==TYCHAR || lt==TYLOGICAL || rt==TYLOGICAL) { if(lt != rt) ERR("illegal comparison") } else if( ISCOMPLEX(lt) || ISCOMPLEX(rt) ) { if(op!=OPEQ && op!=OPNE) ERR("order comparison of complex data") } else if( ! ISNUMERIC(lt) || ! ISNUMERIC(rt) ) ERR("comparison of nonarithmetic data") return(TYLOGICAL); case OPCONCAT: if(lt==TYCHAR && rt==TYCHAR) return(TYCHAR); ERR("concatenation of nonchar data") case OPCALL: case OPCCALL: return(lt); case OPADDR: return(TYADDR); case OPCONV: if(rt == 0) return(0); if(lt==TYCHAR && ISINT(rt) ) return(TYCHAR); case OPASSIGN: case OPPLUSEQ: case OPSTAREQ: if( ISINT(lt) && rt==TYCHAR) return(lt); if(lt==TYCHAR || rt==TYCHAR || lt==TYLOGICAL || rt==TYLOGICAL) if(op!=OPASSIGN || lt!=rt) { /* debug fprintf(diagfile, " lt=%d, rt=%d, op=%d\n", lt, rt, op); */ /* debug fatal("impossible conversion. possible compiler bug"); */ ERR("impossible conversion") } return(lt); case OPMIN: case OPMAX: case OPBITOR: case OPBITAND: case OPBITXOR: case OPBITNOT: case OPLSHIFT: case OPRSHIFT: return(lt); case OPCOMMA: case OPQUEST: case OPCOLON: return(rt); default: badop("cktype", op); } error: err(errs); error1: return(TYERROR); } LOCAL expptr fold(e) register expptr e; { Constp p; register expptr lp, rp; int etype, mtype, ltype, rtype, opcode; int i, ll, lr; char *q, *s; union Constant lcon, rcon; opcode = e->exprblock.opcode; etype = e->exprblock.vtype; lp = e->exprblock.leftp; ltype = lp->headblock.vtype; rp = e->exprblock.rightp; if(rp == 0) switch(opcode) { case OPNOT: lp->constblock.const.ci = ! lp->constblock.const.ci; return(lp); case OPBITNOT: lp->constblock.const.ci = ~ lp->constblock.const.ci; return(lp); case OPNEG: consnegop(lp); return(lp); case OPCONV: case OPADDR: return(e); default: badop("fold", opcode); } rtype = rp->headblock.vtype; p = ALLOC(Constblock); p->tag = TCONST; p->vtype = etype; p->vleng = e->exprblock.vleng; switch(opcode) { case OPCOMMA: case OPQUEST: case OPCOLON: return(e); case OPAND: p->const.ci = lp->constblock.const.ci && rp->constblock.const.ci; break; case OPOR: p->const.ci = lp->constblock.const.ci || rp->constblock.const.ci; break; case OPEQV: p->const.ci = lp->constblock.const.ci == rp->constblock.const.ci; break; case OPNEQV: p->const.ci = lp->constblock.const.ci != rp->constblock.const.ci; break; case OPBITAND: p->const.ci = lp->constblock.const.ci & rp->constblock.const.ci; break; case OPBITOR: p->const.ci = lp->constblock.const.ci | rp->constblock.const.ci; break; case OPBITXOR: p->const.ci = lp->constblock.const.ci ^ rp->constblock.const.ci; break; case OPLSHIFT: p->const.ci = lp->constblock.const.ci << rp->constblock.const.ci; break; case OPRSHIFT: p->const.ci = lp->constblock.const.ci >> rp->constblock.const.ci; break; case OPCONCAT: ll = lp->constblock.vleng->constblock.const.ci; lr = rp->constblock.vleng->constblock.const.ci; p->const.ccp = q = (char *) ckalloc(ll+lr); p->vleng = ICON(ll+lr); s = lp->constblock.const.ccp; for(i = 0 ; i < ll ; ++i) (( *q++ = *s++; s = rp->constblock.const.ccp; for(i = 0; i < lr; ++i) *q++ = *s++; break; case OPPOWER: if( ! ISINT(rtype) ) return(e); conspower(&(p->const), lp, rp->constblock.const.ci); break; default: if(ltype == TYCHAR) { lcon.ci = cmpstr(lp->constblock.const.ccp, rp->constblock.const.ccp, lp->constblock.vleng->constblock.const.ci, rp->constblock.vleng->constblock.const.ci); rcon.ci = 0; mtype = tyint; } else { mtype = maxtype(ltype, rtype); consconv(mtype, &lcon, ltype, &(lp->constblock.const) ); consconv(mtype, &rcon, rtype, &(rp->constblock.const) ); } consbinop(opcode, mtype, &(p->const), &lcon, &rcon); break; } frexpr(e); return( (expptr) p ); } /* assign constant l = r , doing coercion */ consconv(lt, lv, rt, rv) int lt, rt; register union Constant *lv, *rv; { switch(lt) { case TYCHAR: *(lv->ccp = (char *) ckalloc(1)) = rv->ci; break; case TYSHORT: case TYLONG: if(rt == TYCHAR) lv->ci = rv->ccp[0]; else if( ISINT(rt) ) lv->ci = rv->ci; else lv->ci = rv->cd[0]; break; case TYCOMPLEX: case TYDCOMPLEX: switch(rt) { case TYSHORT: case TYLONG: /* fall through and do real assignment of first element */ case TYREAL: case TYDREAL: lv->cd[1] = 0; break; case TYCOMPLEX: case TYDCOMPLEX: lv->cd[1] = rv->cd[1]; break; } case TYREAL: case TYDREAL: if( ISINT(rt) ) lv->cd[0] = rv->ci; else lv->cd[0] = rv->cd[0]; break; case TYLOGICAL: lv->ci = rv->ci; break; } } consnegop(p) register Constp p; { switch(p->vtype) { case TYSHORT: case TYLONG: p->const.ci = - p->const.ci; break; case TYCOMPLEX: case TYDCOMPLEX: p->const.cd[1] = - p->const.cd[1]; /* fall through and do the real parts */ case TYREAL: case TYDREAL: p->const.cd[0] = - p->const.cd[0]; break; default: badtype("consnegop", p->vtype); } } LOCAL conspower(powp, ap, n) register union Constant *powp; Constp ap; ftnint n; { register int type; union Constant x; switch(type = ap->vtype) /* pow = 1 */ { case TYSHORT: case TYLONG: powp->ci = 1; break; case TYCOMPLEX: case TYDCOMPLEX: powp->cd[1] = 0; case TYREAL: case TYDREAL: powp->cd[0] = 1; break; default: badtype("conspower", type); } if(n == 0) return; if(n < 0) { if( ISINT(type) ) { err("integer ** negative power "); return; } n = - n; consbinop(OPSLASH, type, &x, powp, &(ap->const)); } else consbinop(OPSTAR, type, &x, powp, &(ap->const)); for( ; ; ) { if(n & 01) consbinop(OPSTAR, type, powp, powp, &x); if(n >>= 1) consbinop(OPSTAR, type, &x, &x, &x); else break; } } /* do constant operation cp = a op b */ LOCAL consbinop(opcode, type, cp, ap, bp) int opcode, type; register union Constant *ap, *bp, *cp; { int k; double temp; switch(opcode) { case OPPLUS: switch(type) { case TYSHORT: case TYLONG: cp->ci = ap->ci + bp->ci; break; case TYCOMPLEX: case TYDCOMPLEX: cp->cd[1] = ap->cd[1] + bp->cd[1]; case TYREAL: case TYDREAL: cp->cd[0] = ap->cd[0] + bp->cd[0]; break; } break; case OPMINUS: switch(type) { case TYSHORT: case TYLONG: cp->ci = ap->ci - bp->ci; break; case TYCOMPLEX: case TYDCOMPLEX: cp->cd[1] = ap->cd[1] - bp->cd[1]; case TYREAL: case TYDREAL: cp->cd[0] = ap->cd[0] - bp->cd[0]; break; } break; case OPSTAR: switch(type) { case TYSHORT: case TYLONG: cp->ci = ap->ci * bp->ci; break; case TYREAL: case TYDREAL: cp->cd[0] = ap->cd[0] * bp->cd[0]; break; case TYCOMPLEX: case TYDCOMPLEX: temp = ap->cd[0] * bp->cd[0] - ap->cd[1] * bp->cd[1] ; cp->cd[1] = ap->cd[0] * bp->cd[1] + ap->cd[1] * bp->cd[0] ; cp->cd[0] = temp; break; } break; case OPSLASH: switch(type) { case TYSHORT: case TYLONG: cp->ci = ap->ci / bp->ci; break; case TYREAL: case TYDREAL: cp->cd[0] = ap->cd[0] / bp->cd[0]; break; case TYCOMPLEX: case TYDCOMPLEX: zdiv(cp,ap,bp); break; } break; case OPMOD: if( ISINT(type) ) { cp->ci = ap->ci % bp->ci; break; } else fatal("inline mod of noninteger"); default: /* relational ops */ switch(type) { case TYSHORT: case TYLONG: if(ap->ci < bp->ci) k = -1; else if(ap->ci == bp->ci) k = 0; else k = 1; break; case TYREAL: case TYDREAL: if(ap->cd[0] < bp->cd[0]) k = -1; else if(ap->cd[0] == bp->cd[0]) k = 0; else k = 1; break; case TYCOMPLEX: case TYDCOMPLEX: if(ap->cd[0] == bp->cd[0] && ap->cd[1] == bp->cd[1] ) k = 0; else k = 1; break; } switch(opcode) { case OPEQ: cp->ci = (k == 0); break; case OPNE: cp->ci = (k != 0); break; case OPGT: cp->ci = (k == 1); break; case OPLT: cp->ci = (k == -1); break; case OPGE: cp->ci = (k >= 0); break; case OPLE: cp->ci = (k <= 0); break; } break; } } conssgn(p) register expptr p; { if( ! ISCONST(p) ) fatal( "sgn(nonconstant)" ); switch(p->headblock.vtype) { case TYSHORT: case TYLONG: if(p->constblock.const.ci > 0) return(1); if(p->constblock.const.ci < 0) return(-1); return(0); case TYREAL: case TYDREAL: if(p->constblock.const.cd[0] > 0) return(1); if(p->constblock.const.cd[0] < 0) return(-1); return(0); case TYCOMPLEX: case TYDCOMPLEX: return(p->constblock.const.cd[0]!=0 || p->constblock.const.cd[1]!=0); default: badtype( "conssgn", p->constblock.vtype); } /* NOTREACHED */ } char *powint[ ] = { "pow_ii", "pow_ri", "pow_di", "pow_ci", "pow_zi" }; LOCAL expptr mkpower(p) register expptr p; { register expptr q, lp, rp; int ltype, rtype, mtype; lp = p->exprblock.leftp; rp = p->exprblock.rightp; ltype = lp->headblock.vtype; rtype = rp->headblock.vtype; if(ISICON(rp)) { if(rp->constblock.const.ci == 0) { frexpr(p); if( ISINT(ltype) ) return( ICON(1) ); else return( (expptr) putconst( mkconv(ltype, ICON(1))) ); } if(rp->constblock.const.ci < 0) { if( ISINT(ltype) ) { frexpr(p); err("integer**negative"); return( errnode() ); } rp->constblock.const.ci = - rp->constblock.const.ci; p->exprblock.leftp = lp = fixexpr(mkexpr(OPSLASH, ICON(1), lp)); } if(rp->constblock.const.ci == 1) { frexpr(rp); free( (charptr) p ); return(lp); } if( ONEOF(ltype, MSKINT|MSKREAL) ) { p->exprblock.vtype = ltype; return(p); } } if( ISINT(rtype) ) { if(ltype==TYSHORT && rtype==TYSHORT && (!ISCONST(lp) || tyint==TYSHORT) ) q = call2(TYSHORT, "pow_hh", lp, rp); else { if(ltype == TYSHORT) { ltype = TYLONG; lp = mkconv(TYLONG,lp); } q = call2(ltype, powint[ltype-TYLONG], lp, mkconv(TYLONG, rp)); } } else if( ISREAL( (mtype = maxtype(ltype,rtype)) )) q = call2(mtype, "pow_dd", mkconv(TYDREAL,lp), mkconv(TYDREAL,rp)); else { q = call2(TYDCOMPLEX, "pow_zz", mkconv(TYDCOMPLEX,lp), mkconv(TYDCOMPLEX,rp)); if(mtype == TYCOMPLEX) q = mkconv(TYCOMPLEX, q); } free( (charptr) p ); return(q); } /* Complex Division. Same code as in Runtime Library */ struct dcomplex { double dreal, dimag; }; LOCAL zdiv(c, a, b) register struct dcomplex *a, *b, *c; { double ratio, den; double abr, abi; if( (abr = b->dreal) < 0.) abr = - abr; if( (abi = b->dimag) < 0.) abi = - abi; if( abr <= abi ) { if(abi == 0) fatal("complex division by zero"); ratio = b->dreal / b->dimag ; den = b->dimag * (1 + ratio*ratio); c->dreal = (a->dreal*ratio + a->dimag) / den; c->dimag = (a->dimag*ratio - a->dreal) / den; } else { ratio = b->dimag / b->dreal ; den = b->dreal * (1 + ratio*ratio); c->dreal = (a->dreal + a->dimag*ratio) / den; c->dimag = (a->dimag - a->dreal*ratio) / den; } } ouble abr, abi; if( (abr = b->dreal) < 0.) abr = - abr; if( (abi = b->dimag) < 0.) abi = - abi; if( abr <= abi ) { if(abi == 0) fatal("complex division by zero"); ratio = b->dreal / b->dimag ; den = b->dimag * (1 + ratio*ratio); c->dreal = (a->dreal*ratio + a->dimag) / den; c->dimag = (a->dimag*ratio - a->dreal) / den; } else { ratio = b->dicmd/f77/exec.c 644 0 33 23004 2411243515 6305 #include "defs" /* Logical IF codes */ exif(p) expptr p; { pushctl(CTLIF); ctlstack->elselabel = newlabel(); putif(p, ctlstack->elselabel); } exelif(p) expptr p; { if(ctlstack->ctltype == CTLIF) { if(ctlstack->endlabel == 0) ctlstack->endlabel = newlabel(); putgoto(ctlstack->endlabel); putlabel(ctlstack->elselabel); ctlstack->elselabel = newlabel(); putif(p, ctlstack->elselabel); } else execerr("elseif out of place", CNULL); } exelse() { if(ctlstack->ctltype==CTLIF) { if(ctlstack->endlabel == 0) ctlstack->endlabel = newlabel(); putgoto( ctlstack->endlabel ); putlabel(ctlstack->elselabel); ctlstack->ctltype = CTLELSE; } else execerr("else out of place", CNULL); } exendif() { if(ctlstack->ctltype == CTLIF) { putlabel(ctlstack->elselabel); if(ctlstack->endlabel) putlabel(ctlstack->endlabel); popctl(); } else if(ctlstack->ctltype == CTLELSE) { putlabel(ctlstack->endlabel); popctl(); } else execerr("endif out of place", CNULL); } LOCAL pushctl(code) int code; { register int i; if(++ctlstack >= lastctl) many("loops or if-then-elses", 'c'); ctlstack->ctltype = code; for(i = 0 ; i < 4 ; ++i) ctlstack->ctlabels[i] = 0; ++blklevel; } LOCAL popctl() { if( ctlstack-- < ctls ) fatal("control stack empty"); --blklevel; } LOCAL poplab() { register struct Labelblock *lp; for(lp = labeltab ; lp < highlabtab ; ++lp) if(lp->labdefined) { /* mark all labels in inner blocks unreachable */ if(lp->blklevel > blklevel) lp->labinacc = YES; } else if(lp->blklevel ((> blklevel) { /* move all labels referred to in inner blocks out a level */ lp->blklevel = blklevel; } } /* BRANCHING CODE */ exgoto(lab) struct Labelblock *lab; { putgoto(lab->labelno); } exequals(lp, rp) register struct Primblock *lp; register expptr rp; { if(lp->tag != TPRIM) { err("assignment to a non-variable"); frexpr(lp); frexpr(rp); } else if(lp->namep->vclass!=CLVAR && lp->argsp) { if(parstate >= INEXEC) err("statement function amid executables"); else mkstfunct(lp, rp); } else { if(parstate < INDATA) enddcl(); puteq(mklhs(lp), fixtype(rp)); } } mkstfunct(lp, rp) struct Primblock *lp; expptr rp; { register struct Primblock *p; register Namep np; chainp args; np = lp->namep; if(np->vclass == CLUNKNOWN) np->vclass = CLPROC; else { dclerr("redeclaration of statement function", np); return; } np->vprocclass = PSTFUNCT; np->vstg = STGSTFUNCT; impldcl(np); args = (lp->argsp ? lp->argsp->listp : CHNULL); np->varxptr.vstfdesc = mkchain(args , rp ); for( ; args ; args = args->nextp) if( args->datap->tag!=TPRIM || (p = (struct Primblock *) (args->datap) )->argsp || p->fcharp || p->lcharp ) err("non-variable argument in statement function definition"); else { args->datap = (tagptr) (p->namep); vardcl(p->namep); free(p); } } excall(name, args, nstars, labels) Namep name; struct Listblock *args; int nstars; struct Labelblock *labels[ ]; { register expptr p; settype(name, TYSUBR, ENULL); p = mkfunct( mkprim(name, args, CHNULL) ); p->exprblock.vtype = p->exprblock.leftp->headblock.vtype = TYINT; if(nstars > 0) putcmgo(p, nstars, labels); else putexpr(p); } exstop(stop, p) int stop; register expptr p; { char *q; int n; expptr mkstrcon(); if(p) { if( ! ISCONST(p) ) { execerr("pause/stop argument must be constant", CNULL); frexpr(p); p = mkstrcon(0, CNULL); } else if( ISINT(p->constblock.vtype) ) { q = convic(p->constblock.const.ci); n = strlen(q); if(n > 0) { p->constblock.const.ccp = copyn(n, q); p->constblock.vtype = TYCHAR; p->constblock.vleng = (expptr) ICON(n); } else p = (expptr) mkstrcon(0, CNULL); } else if(p->constblock.vtype != TYCHAR) { execerr("pause/stop argument must be integer or string", CNULL); p = (expptr) mkstrcon(0, CNULL); } } else p = (expptr) mkstrcon(0, CNULL); putexpr( call1(TYSUBR, (stop ? "s_stop" : "s_paus"), p) ); } /* DO LOOP CODE */ #define DOINIT par[0] #define DOLIMIT par[1] #define DOINCR par[2] #define VARSTEP 0 #define POSSTEP 1 #define NEGSTEP 2 exdo(range, spec) int range; chainp spec; { register expptr p, q; expptr q1; register Namep np; chainp cp; register int i; int dotype, incsign; Addrp dovarp, dostgp; expptr par[3]; pushctl(CTLDO); dorange = ctlstack->dolabel = range; np = (Namep) (spec->datap); ctlstack->donamep = NULL; if(np->vdovar) { errstr("nested loops with variable %s", varstr(VL,np->varname)); ctlstack->donamep = NULL; return; } dovarp = mkplace(np); if( ! ONEOF(dovarp->vtype, MSKINT|MSKREAL) ) { err("bad type on do variable"); return; } ctlstack->donamep = np; np->vdovar = YES; if( enregister(np) ) { /* stgp points to a storage version, varp to a register version */ dostgp = dovarp; dovarp = mkplace(np); } else dostgp = NULL; dotype = dovarp->vtype; for(i=0 , cp = spec->nextp ; cp!=NULL && i<3 ; cp = cp->nextp) { p = par[i++] = fixtype(cp->datap); if( ! ONEOF(p->headblock.vtype, MSKINT|MSKREAL) ) { err("bad type on DO parameter"); return; } } frchain(&spec); switch(i) { case 0: case 1: err("too few DO parameters"); return; default: err("too many DO parameters"); return; case 2: DOINCR = (expptr) ICON(1); case 3: break; } ctlstack->endlabel = newlabel(); ctlstack->dobodylabel = newlabel(); if( ISCONST(DOLIMIT) ) ctlstack->domax = mkconv(dotype, DOLIMIT); else ctlstack->domax = (expptr) mktemp(dotype, PNULL); if( ISCONST(DOINCR) ) { ctlstack->dostep = mkconv(dotype, DOINCR); if( (incsign = conssgn(ctlstack->dostep)) == 0) err("zero DO increment"); ctlstack->dostepsign = (incsign > 0 ? POSSTEP : NEGSTEP); } else { ctlstack->dostep = (expptr) mktemp(dotype, PNULL); ctlstack->dostepsign = VARSTEP; ctlstack->doposlabel = newlabel(); ctlstack->doneglabel = newlabel(); } if( ISCONST(ctlstack->domax) && ISCONST(DOINIT) && ctlstack->dostepsign!=VARSTEP) { puteq(cpexpr(dovarp), cpexpr(DOINIT)); if( onetripflag ) frexpr(DOINIT); else { q = mkexpr(OPPLUS, ICON(1), mkexpr(OPMINUS, cpexpr(ctlstack->domax), cpexpr(DOINIT)) ); if(incsign != conssgn(q)) { warn("DO range never executed"); putgoto(ctlstack->endlabel); } frexpr(q); } } else if(ctlstack->dostepsign!=VARSTEP && !onetripflag) { if( ISCONST(ctlstack->domax) ) q = (expptr) cpexpr(ctlstack->domax); else q = mkexpr(OPASSIGN, cpexpr(ctlstack->domax), DOLIMIT); q1 = mkexpr(OPASSIGN, cpexpr(dovarp), DOINIT); q = mkexpr( (ctlstack->dostepsign==POSSTEP ? OPLE : OPGE), q1, q); putif(q, ctlstack->endlabel); } else { if(! ISCONST(ctlstack->domax) ) puteq( cpexpr(ctlstack->domax), DOLIMIT); q = DOINIT; if( ! onetripflag ) q = mkexpr(OPMINUS, q, mkexpr(OPASSIGN, cpexpr(ctlstack->dostep), DOINCR) ); puteq( cpexpr(dovarp), q); if(onetripflag && ctlstack->dostepsign==VARSTEP) puteq( cpexpr(ctlstack->dostep), DOINCR); } if(ctlstack->dostepsign == VARSTEP) { if(onetripflag) putgoto(ctlstack->dobodylabel); else putif( mkexpr(OPGE, cpexpr(ctlstack->dostep), ICON(0)), ctlstack->doneglabel ); putlabel(ctlstack->doposlabel); putif( mkexpr(OPLE, mkexpr(OPPLUSEQ, cpexpr(dovarp), cpexpr(ctlstack->dostep)), cpexpr(ctlstack->domax) ), ctlstack->endlabel); } putlabel(ctlstack->dobodylabel); if(dostgp) puteq(dostgp, cpexpr(dovarp)); frexpr(dovarp); } enddo(here) int here; { register struct Ctlframe *q; register expptr t; Namep np; Addrp ap; register int i; while(here == dorange) { if(np = ctlstack->donamep) { t = mkexpr(OPPLUSEQ, mkplace(ctlstack->donamep), cpexpr(ctlstack->dostep) ); if(ctlstack->dostepsign == VARSTEP) { putif( mkexpr(OPLE, cpexpr(ctlstack->dostep), ICON(0)), ctlstack->doposlabel); putlabel(ctlstack->doneglabel); putif( mkexpr(OPLT, t, ctlstack->domax), ctlstack->dobodylabel); } else putif( mkexpr( (ctlstack->dostepsign==POSSTEP ? OPGT : OPLT), t, ctlstack->domax), ctlstack->dobodylabel); putlabel(ctlstack->endlabel); if(ap = memversion(np)) puteq(ap, mkplace(np)); for(i = 0 ; i < 4 ; ++i) ctlstack->ctlabels[i] = 0; deregister(ctlstack->donamep); ctlstack->donamep->vdovar = NO; frexpr(ctlstack->dostep); } popctl(); poplab(); dorange = 0; for(q = ctlstack ; q>=ctls ; --q) if(q->ctltype == CTLDO) { dorange = q->dolabel; break; } } } exassign(vname, labelval) Namep vname; struct Labelblock *labelval; { Addrp p; expptr mkaddcon(); p = mkplace(vname); if( ! ONEOF(p->vtype, MSKINT|MSKADDR) ) err("noninteger assign variable"); else puteq(p, mkaddcon(labelval->labelno) ); } exarif(expr, neglab, zerlab, poslab) expptr expr; struct Labelblock *neglab, *zerlab, *poslab; { register int lm, lz, lp; lm = neglab->labelno; lz = zerlab->labelno; lp = poslab->labelno; expr = fixtype(expr); if( ! ONEOF(expr->headblock.vtype, MSKINT|MSKREAL) ) { err("invalid type of arithmetic if expression"); frexpr(expr); } else { if(lm == lz) exar2(OPLE, expr, lm, lp); else if(lm == lp) exar2(OPNE, expr, lm, lz); else if(lz == lp) exar2(OPGE, expr, lz, lm); else prarif(expr, lm, lz, lp); } } LOCAL exar2(op, e, l1, l2) int op; expptr e; int l1, l2; { putif( mkexpr(op, e, ICON(0)), l2); putgoto(l1); } exreturn(p) register expptr p; { if(procclass != CLPROC) warn("RETURN statement in main or block data"); if(p && (proctype!=TYSUBR || procclass!=CLPROC) ) { err("alternate return in nonsubroutine"); p = 0; } if(p) { putforce(TYINT, p); putgoto(retlabel); } else putgoto(proctype==TYSUBR ? ret0label : retlabel); } exasgoto(labvar) struct Hashentry *labvar; { register Addrp p; p = mkplace(labvar); if( ! ISINT(p->vtype) ) err("assigned goto variable must be integer"); else putbranch(p); } } exreturn(p) register expptr p; { if(procclass != CLPROC) warn("RETURN statement in main or block data"); if(p && (proctype!=TYSUBR || procclass!=CLPROC) ) { err("alternate return in nonsubroutine"); p = 0; } if(p) { putforce(TYINT, p); putgoto(retlabel); } else putgoto(proctype==TYSUBR ? ret0label : retlabel); } exasgoto(labvar) struct Hashentry *labvar; { register Addrp p; p = mkplace(labvar); if( ! ISINT(p->vtype) ) err("assigned goto variable must be integer"); else putbranch(p)cmd/f77/intr.c 644 0 33 35363 2417774221 6361 #include "defs" extern ftnint intcon[14]; extern double realcon[6]; union { int ijunk; struct Intrpacked bits; } packed; struct Intrbits { int intrgroup /* :3 */; int intrstuff /* result type or number of generics */; int intrno /* :7 */; }; LOCAL struct Intrblock { char intrfname[VL]; struct Intrbits intrval; } intrtab[ ] = { "int", { INTRCONV, TYLONG }, "real", { INTRCONV, TYREAL }, "dble", { INTRCONV, TYDREAL }, "cmplx", { INTRCONV, TYCOMPLEX }, "dcmplx", { INTRCONV, TYDCOMPLEX }, "ifix", { INTRCONV, TYLONG }, "idint", { INTRCONV, TYLONG }, "float", { INTRCONV, TYREAL }, "dfloat", { INTRCONV, TYDREAL }, "sngl", { INTRCONV, TYREAL }, "ichar", { INTRCONV, TYLONG }, "iachar", { INTRCONV, TYLONG }, "char", { INTRCONV, TYCHAR }, "achar", { INTRCONV, TYCHAR }, "max", { INTRMAX, TYUNKNOWN }, "max0", { INTRMAX, TYLONG }, "amax0", { INTRMAX, TYREAL }, "max1", { INTRMAX, TYLONG }, "amax1", { INTRMAX, TYREAL }, "dmax1", { INTRMAX, TYDREAL }, "and", { INTRBOOL, TYUNKNOWN, OPBIT((AND }, "or", { INTRBOOL, TYUNKNOWN, OPBITOR }, "xor", { INTRBOOL, TYUNKNOWN, OPBITXOR }, "not", { INTRBOOL, TYUNKNOWN, OPBITNOT }, "lshift", { INTRBOOL, TYUNKNOWN, OPLSHIFT }, "rshift", { INTRBOOL, TYUNKNOWN, OPRSHIFT }, "min", { INTRMIN, TYUNKNOWN }, "min0", { INTRMIN, TYLONG }, "amin0", { INTRMIN, TYREAL }, "min1", { INTRMIN, TYLONG }, "amin1", { INTRMIN, TYREAL }, "dmin1", { INTRMIN, TYDREAL }, "aint", { INTRGEN, 2, 0 }, "dint", { INTRSPEC, TYDREAL, 1 }, "anint", { INTRGEN, 2, 2 }, "dnint", { INTRSPEC, TYDREAL, 3 }, "nint", { INTRGEN, 4, 4 }, "idnint", { INTRGEN, 2, 6 }, "abs", { INTRGEN, 6, 8 }, "iabs", { INTRGEN, 2, 9 }, "dabs", { INTRSPEC, TYDREAL, 11 }, "cabs", { INTRSPEC, TYREAL, 12 }, "zabs", { INTRSPEC, TYDREAL, 13 }, "mod", { INTRGEN, 4, 14 }, "amod", { INTRSPEC, TYREAL, 16 }, "dmod", { INTRSPEC, TYDREAL, 17 }, "sign", { INTRGEN, 4, 18 }, "isign", { INTRGEN, 2, 19 }, "dsign", { INTRSPEC, TYDREAL, 21 }, "dim", { INTRGEN, 4, 22 }, "idim", { INTRGEN, 2, 23 }, "ddim", { INTRSPEC, TYDREAL, 25 }, "dprod", { INTRSPEC, TYDREAL, 26 }, "len", { INTRSPEC, TYLONG, 27 }, "index", { INTRSPEC, TYLONG, 29 }, "imag", { INTRGEN, 2, 31 }, "aimag", { INTRSPEC, TYREAL, 31 }, "dimag", { INTRSPEC, TYDREAL, 32 }, "conjg", { INTRGEN, 2, 33 }, "dconjg", { INTRSPEC, TYDCOMPLEX, 34 }, "sqrt", { INTRGEN, 4, 35 }, "dsqrt", { INTRSPEC, TYDREAL, 36 }, "csqrt", { INTRSPEC, TYCOMPLEX, 37 }, "zsqrt", { INTRSPEC, TYDCOMPLEX, 38 }, "exp", { INTRGEN, 4, 39 }, "dexp", { INTRSPEC, TYDREAL, 40 }, "cexp", { INTRSPEC, TYCOMPLEX, 41 }, "zexp", { INTRSPEC, TYDCOMPLEX, 42 }, "log", { INTRGEN, 4, 43 }, "alog", { INTRSPEC, TYREAL, 43 }, "dlog", { INTRSPEC, TYDREAL, 44 }, "clog", { INTRSPEC, TYCOMPLEX, 45 }, "zlog", { INTRSPEC, TYDCOMPLEX, 46 }, "log10", { INTRGEN, 2, 47 }, "alog10", { INTRSPEC, TYREAL, 47 }, "dlog10", { INTRSPEC, TYDREAL, 48 }, "sin", { INTRGEN, 4, 49 }, "dsin", { INTRSPEC, TYDREAL, 50 }, "csin", { INTRSPEC, TYCOMPLEX, 51 }, "zsin", { INTRSPEC, TYDCOMPLEX, 52 }, "cos", { INTRGEN, 4, 53 }, "dcos", { INTRSPEC, TYDREAL, 54 }, "ccos", { INTRSPEC, TYCOMPLEX, 55 }, "zcos", { INTRSPEC, TYDCOMPLEX, 56 }, "tan", { INTRGEN, 2, 57 }, "dtan", { INTRSPEC, TYDREAL, 58 }, "asin", { INTRGEN, 2, 59 }, "dasin", { INTRSPEC, TYDREAL, 60 }, "acos", { INTRGEN, 2, 61 }, "dacos", { INTRSPEC, TYDREAL, 62 }, "atan", { INTRGEN, 2, 63 }, "datan", { INTRSPEC, TYDREAL, 64 }, "atan2", { INTRGEN, 2, 65 }, "datan2", { INTRSPEC, TYDREAL, 66 }, "sinh", { INTRGEN, 2, 67 }, "dsinh", { INTRSPEC, TYDREAL, 68 }, "cosh", { INTRGEN, 2, 69 }, "dcosh", { INTRSPEC, TYDREAL, 70 }, "tanh", { INTRGEN, 2, 71 }, "dtanh", { INTRSPEC, TYDREAL, 72 }, "lge", { INTRSPEC, TYLOGICAL, 73}, "lgt", { INTRSPEC, TYLOGICAL, 75}, "lle", { INTRSPEC, TYLOGICAL, 77}, "llt", { INTRSPEC, TYLOGICAL, 79}, "epbase", { INTRCNST, 4, 0 }, "epprec", { INTRCNST, 4, 4 }, "epemin", { INTRCNST, 2, 8 }, "epemax", { INTRCNST, 2, 10 }, "eptiny", { INTRCNST, 2, 12 }, "ephuge", { INTRCNST, 4, 14 }, "epmrsp", { INTRCNST, 2, 18 }, "fpexpn", { INTRGEN, 4, 81 }, "fpabsp", { INTRGEN, 2, 85 }, "fprrsp", { INTRGEN, 2, 87 }, "fpfrac", { INTRGEN, 2, 89 }, "fpmake", { INTRGEN, 2, 91 }, "fpscal", { INTRGEN, 2, 93 }, "" }; LOCAL struct Specblock { char atype; char rtype; char nargs; char spxname[XL]; char othername; /* index into callbyvalue table */ } spectab[ ] = { { TYREAL,TYREAL,1,"r_int" }, { TYDREAL,TYDREAL,1,"d_int" }, { TYREAL,TYREAL,1,"r_nint" }, { TYDREAL,TYDREAL,1,"d_nint" }, { TYREAL,TYSHORT,1,"h_nint" }, { TYREAL,TYLONG,1,"i_nint" }, { TYDREAL,TYSHORT,1,"h_dnnt" }, { TYDREAL,TYLONG,1,"i_dnnt" }, { TYREAL,TYREAL,1,"r_abs" }, { TYSHORT,TYSHORT,1,"h_abs" }, { TYLONG,TYLONG,1,"i_abs" }, { TYDREAL,TYDREAL,1,"d_abs" }, { TYCOMPLEX,TYREAL,1,"c_abs" }, { TYDCOMPLEX,TYDREAL,1,"z_abs" }, { TYSHORT,TYSHORT,2,"h_mod" }, { TYLONG,TYLONG,2,"i_mod" }, { TYREAL,TYREAL,2,"r_mod" }, { TYDREAL,TYDREAL,2,"d_mod" }, { TYREAL,TYREAL,2,"r_sign" }, { TYSHORT,TYSHORT,2,"h_sign" }, { TYLONG,TYLONG,2,"i_sign" }, { TYDREAL,TYDREAL,2,"d_sign" }, { TYREAL,TYREAL,2,"r_dim" }, { TYSHORT,TYSHORT,2,"h_dim" }, { TYLONG,TYLONG,2,"i_dim" }, { TYDREAL,TYDREAL,2,"d_dim" }, { TYREAL,TYDREAL,2,"d_prod" }, { TYCHAR,TYSHORT,1,"h_len" }, { TYCHAR,TYLONG,1,"i_len" }, { TYCHAR,TYSHORT,2,"h_indx" }, { TYCHAR,TYLONG,2,"i_indx" }, { TYCOMPLEX,TYREAL,1,"r_imag" }, { TYDCOMPLEX,TYDREAL,1,"d_imag" }, { TYCOMPLEX,TYCOMPLEX,1,"r_cnjg" }, { TYDCOMPLEX,TYDCOMPLEX,1,"d_cnjg" }, { TYREAL,TYREAL,1,"r_sqrt", 1 }, { TYDREAL,TYDREAL,1,"d_sqrt", 1 }, { TYCOMPLEX,TYCOMPLEX,1,"c_sqrt" }, { TYDCOMPLEX,TYDCOMPLEX,1,"z_sqrt" }, { TYREAL,TYREAL,1,"r_exp", 2 }, { TYDREAL,TYDREAL,1,"d_exp", 2 }, { TYCOMPLEX,TYCOMPLEX,1,"c_exp" }, { TYDCOMPLEX,TYDCOMPLEX,1,"z_exp" }, { TYREAL,TYREAL,1,"r_log", 3 }, { TYDREAL,TYDREAL,1,"d_log", 3 }, { TYCOMPLEX,TYCOMPLEX,1,"c_log" }, { TYDCOMPLEX,TYDCOMPLEX,1,"z_log" }, { TYREAL,TYREAL,1,"r_lg10" }, { TYDREAL,TYDREAL,1,"d_lg10" }, { TYREAL,TYREAL,1,"r_sin", 4 }, { TYDREAL,TYDREAL,1,"d_sin", 4 }, { TYCOMPLEX,TYCOMPLEX,1,"c_sin" }, { TYDCOMPLEX,TYDCOMPLEX,1,"z_sin" }, { TYREAL,TYREAL,1,"r_cos", 5 }, { TYDREAL,TYDREAL,1,"d_cos", 5 }, { TYCOMPLEX,TYCOMPLEX,1,"c_cos" }, { TYDCOMPLEX,TYDCOMPLEX,1,"z_cos" }, { TYREAL,TYREAL,1,"r_tan", 6 }, { TYDREAL,TYDREAL,1,"d_tan", 6 }, { TYREAL,TYREAL,1,"r_asin", 7 }, { TYDREAL,TYDREAL,1,"d_asin", 7 }, { TYREAL,TYREAL,1,"r_acos", 8 }, { TYDREAL,TYDREAL,1,"d_acos", 8 }, { TYREAL,TYREAL,1,"r_atan", 9 }, { TYDREAL,TYDREAL,1,"d_atan", 9 }, { TYREAL,TYREAL,2,"r_atn2", 10 }, { TYDREAL,TYDREAL,2,"d_atn2", 10 }, { TYREAL,TYREAL,1,"r_sinh", 11 }, { TYDREAL,TYDREAL,1,"d_sinh", 11 }, { TYREAL,TYREAL,1,"r_cosh", 12 }, { TYDREAL,TYDREAL,1,"d_cosh", 12 }, { TYREAL,TYREAL,1,"r_tanh", 13 }, { TYDREAL,TYDREAL,1,"d_tanh", 13 }, { TYCHAR,TYLOGICAL,2,"hl_ge" }, { TYCHAR,TYLOGICAL,2,"l_ge" }, { TYCHAR,TYLOGICAL,2,"hl_gt" }, { TYCHAR,TYLOGICAL,2,"l_gt" }, { TYCHAR,TYLOGICAL,2,"hl_le" }, { TYCHAR,TYLOGICAL,2,"l_le" }, { TYCHAR,TYLOGICAL,2,"hl_lt" }, { TYCHAR,TYLOGICAL,2,"l_lt" }, { TYREAL,TYSHORT,1,"hr_expn" }, { TYREAL,TYLONG,1,"ir_expn" }, { TYDREAL,TYSHORT,1,"hd_expn" }, { TYDREAL,TYLONG,1,"id_expn" }, { TYREAL,TYREAL,1,"r_absp" }, { TYDREAL,TYDREAL,1,"d_absp" }, { TYREAL,TYDREAL,1,"r_rrsp" }, { TYDREAL,TYDREAL,1,"d_rrsp" }, { TYREAL,TYREAL,1,"r_frac" }, { TYDREAL,TYDREAL,1,"d_frac" }, { TYREAL,TYREAL,2,"r_make" }, { TYDREAL,TYDREAL,2,"d_make" }, { TYREAL,TYREAL,2,"r_scal" }, { TYDREAL,TYDREAL,2,"d_scal" } } ; LOCAL struct Incstblock { char atype; char rtype; char constno; } consttab[ ] = { { TYSHORT, TYLONG, 0 }, { TYLONG, TYLONG, 1 }, { TYREAL, TYLONG, 2 }, { TYDREAL, TYLONG, 3 }, { TYSHORT, TYLONG, 4 }, { TYLONG, TYLONG, 5 }, { TYREAL, TYLONG, 6 }, { TYDREAL, TYLONG, 7 }, { TYREAL, TYLONG, 8 }, { TYDREAL, TYLONG, 9 }, { TYREAL, TYLONG, 10 }, { TYDREAL, TYLONG, 11 }, { TYREAL, TYREAL, 0 }, { TYDREAL, TYDREAL, 1 }, { TYSHORT, TYLONG, 12 }, { TYLONG, TYLONG, 13 }, { TYREAL, TYREAL, 2 }, { TYDREAL, TYDREAL, 3 }, { TYREAL, TYREAL, 4 }, { TYDREAL, TYDREAL, 5 } }; /* For each machine, two arrays must be initialized. intcon contains radix for short int radix for long int radix for single precision radix for double precision precision for short int precision for long int precision for single precision precision for double precision emin for single precision emin for double precision emax for single precision emax for double prcision largest short int largest long int realcon contains tiny for single precision tiny for double precision huge for single precision huge for double precision mrsp (epsilon) for single precision mrsp (epsilon) for double precision the realcons should probably be filled in in binary if TARGET==HERE */ char callbyvalue[ ][XL] = { "sqrt", "exp", "log", "sin", "cos", "tan", "asin", "acos", "atan", "atan2", "sinh", "cosh", "tanh" }; expptr intrcall(np, argsp, nargs) Namep np; struct Listblock *argsp; int nargs; { int i, rettype; Addrp ap; register struct Specblock *sp; register struct Chain *cp; expptr inline(), mkcxcon(), mkrealcon(); register struct Incstblock *cstp; expptr q, ep; int mtype; int op; int f1field, f2field, f3field; packed.ijunk = np->vardesc.varno; f1field = packed.bits.f1; f2field = packed.bits.f2; f3field = packed.bits.f3; if(nargs == 0) goto badnargs; mtype = 0; for(cp = argsp->listp ; cp ; cp = cp->nextp) { /* TEMPORARY */ ep = (expptr) (cp->datap); /* TEMPORARY */ if( ISCONST(ep) && ep->headblock.vtype==TYSHORT ) /* TEMPORARY */ cp->datap = (tagptr) mkconv(tyint, ep); mtype = maxtype(mtype, ep->headblock.vtype); } switch(f1field) { case INTRBOOL: op = f3field; if( ! ONEOF(mtype, MSKINT|MSKLOGICAL) ) goto badtype; if(op == OPBITNOT) { if(nargs != 1) goto badnargs; q = mkexpr(OPBITNOT, argsp->listp->datap, ENULL); } else { if(nargs != 2) goto badnargs; q = mkexpr(op, argsp->listp->datap, argsp->listp->nextp->datap); } frchain( &(argsp->listp) ); free( (charptr) argsp); return(q); case INTRCONV: rettype = f2field; if(rettype == TYLONG) rettype = tyint; if( ISCOMPLEX(rettype) && nargs==2) { expptr qr, qi; qr = (expptr) (argsp->listp->datap); qi = (expptr) (argsp->listp->nextp->datap); if(ISCONST(qr) && ISCONST(qi)) q = mkcxcon(qr,qi); else q = mkexpr(OPCONV,mkconv(rettype-2,qr), mkconv(rettype-2,qi)); } else if(nargs == 1) q = mkconv(rettype, argsp->listp->datap); else goto badnargs; q->headblock.vtype = rettype; frchain(&(argsp->listp)); free( (charptr) argsp); return(q); case INTRCNST: cstp = consttab + f3field; for(i=0 ; iatype == mtype) goto foundconst; else ++cstp; goto badtype; foundconst: switch(cstp->rtype) { case TYLONG: return(mkintcon(intcon[cstp->constno])); case TYREAL: case TYDREAL: return(mkrealcon(cstp->rtype, realcon[cstp->constno]) ); default: fatal("impossible intrinsic constant"); } ca((se INTRGEN: sp = spectab + f3field; if(no66flag) if(sp->atype == mtype) goto specfunct; else err66("generic function"); for(i=0; iatype == mtype) goto specfunct; else ++sp; goto badtype; case INTRSPEC: sp = spectab + f3field; specfunct: if(tyint==TYLONG && ONEOF(sp->rtype,M(TYSHORT)|M(TYLOGICAL)) && (sp+1)->atype==sp->atype) ++sp; if(nargs != sp->nargs) goto badnargs; if(mtype != sp->atype) goto badtype; fixargs(YES, argsp); if(q = inline(sp-spectab, mtype, argsp->listp)) { frchain( &(argsp->listp) ); free( (charptr) argsp); } else if(sp->othername) { ap = builtin(sp->rtype, varstr(XL, callbyvalue[sp->othername-1]) ); q = fixexpr( mkexpr(OPCCALL, ap, argsp) ); } else { ap = builtin(sp->rtype, varstr(XL, sp->spxname) ); q = fixexpr( mkexpr(OPCALL, ap, argsp) ); } return(q); case INTRMIN: case INTRMAX: if(nargs < 2) goto badnargs; if( ! ONEOF(mtype, MSKINT|MSKREAL) ) goto badtype; argsp->vtype = mtype; q = mkexpr( (f1field==INTRMIN ? OPMIN : OPMAX), argsp, ENULL); q->headblock.vtype = mtype; rettype = f2field; if(rettype == TYLONG) rettype = tyint; else if(rettype == TYUNKNOWN) rettype = mtype; return( mkconv(rettype, q) ); default: fatali("intrcall: bad intrgroup %d", f1field); } badnargs: errstr("bad number of arguments to intrinsic %s", varstr(VL,np->varname) ); goto bad; badtype: errstr("bad argument type to intrinsic %s", varstr(VL, np->varname) ); bad: return( errnode() ); } intrfunct(s) char s[VL]; { register struct Intrblock *p; char nm[VL]; register int i; for(i = 0 ; iintrval.intrgroup!=INTREND ; ++p) { if( eqn(VL, nm, p->intrfname) ) { packed.bits.f1 = p->intrval.intrgroup; packed.bits.f2 = p->intrval.intrstuff; packed.bits.f3 = p->intrval.intrno; return(packed.ijunk); } } return(0); } Addrp intraddr(np) Namep np; { Addrp q; register struct Specblock *sp; int f3field; if(np->vclass!=CLPROC || np->vprocclass!=PINTRINSIC) fatalstr("intraddr: %s is not intrinsic", varstr(VL,np->varname)); packed.ijunk = np->vardesc.varno; f3field = packed.bits.f3; switch(packed.bits.f1) { case INTRGEN: /* imag, log, and log10 arent specific functions */ if(f3field==31 || f3field==43 || f3field==47) goto bad; case INTRSPEC: sp = spectab + f3field; if(tyint==TYLONG && sp->rtype==TYSHORT) ++sp; q = builtin(sp->rtype, varstr(XL,sp->spxname) ); return(q); case INTRCONV: case INTRMIN: case INTRMAX: case INTRBOOL: case INTRCNST: bad: errstr("cannot pass %s as actual", varstr(VL,np->varname)); return( errnode() ); } fatali("intraddr: impossible f1=%d\n", (int) packed.bits.f1); /* NOTREACHED */ } expptr inline(fno, type, args) int fno; int type; struct Chain *args; { register expptr q, t, t1; switch(fno) { case 8: /* real abs */ case 9: /* short int abs */ case 10: /* long int abs */ case 11: /* double precision abs */ if( addressable(q = (expptr) (args->datap)) ) { t = q; q = NULL; } else t = (expptr) mktemp(type,PNULL); t1 = mkexpr(OPQUEST, mkexpr(OPLE, mkconv(type,ICON(0)), cpexpr(t)), mkexpr(OPCOLON, cpexpr(t), mkexpr(OPNEG, cpexpr(t), ENULL) )); if(q) t1 = mkexpr(OPCOMMA, mkexpr(OPASSIGN, cpexpr(t),q), t1); frexpr(t); return(t1); case 26: /* dprod */ q = mkexpr(OPSTAR, mkconv(TYDREAL,args->datap), args->nextp->datap); return(q); case 27: /* len of character string */ q = (expptr) cpexpr(args->datap->headblock.vleng); frexpr(args->datap); return(q); case 14: /* half-integer mod */ case 15: /* mod */ return( mkexpr(OPMOD, (expptr) (args->datap), (expptr) (args->nextp->datap) )); } return(NULL); } cpexpr(t), ENULL) )); if(q) t1 = mkexpr(OPCOMMA, mkexpr(OPASSIGN, cpexpr(t),q), t1); frexpr(t); return(t1); case 26: /* dprod */ q = mkexpr(OPSTAR, mkconv(TYDREAL,args->datap), args->nextp->datap); return(q); case 27: /* len of character string */ q cmd/f77/io.c 644 0 33 42553 2411243522 6000 /* Routines to generate code for I/O statements. Some corrections and improvements due to David Wasley, U. C. Berkeley */ /* TEMPORARY */ #define TYIOINT TYLONG #define SZIOINT SZLONG #include "defs" LOCAL char ioroutine[XL+1]; LOCAL int ioendlab; LOCAL int ioerrlab; LOCAL int endbit; LOCAL int errbit; LOCAL int jumplab; LOCAL int skiplab; LOCAL int ioformatted; LOCAL int statstruct = NO; LOCAL ftnint blklen; #define UNFORMATTED 0 #define FORMATTED 1 #define LISTDIRECTED 2 #define NAMEDIRECTED 3 #define V(z) ioc[z].iocval #define IOALL 07777 LOCAL struct Ioclist { char *iocname; int iotype; expptr iocval; } ioc[ ] = { { "", 0 }, { "unit", IOALL }, { "fmt", M(IOREAD) | M(IOWRITE) }, { "err", IOALL }, { "end", M(IOREAD) }, { "iostat", IOALL }, { "rec", M(IOREAD) | M(IOWRITE) }, { "recl", M(IOOPEN) | M(IOINQUIRE) }, { "file", M(IOOPEN) | M(IOINQUIRE) }, { "status", M(IOOPEN) | M(IOCLOSE) }, { "access", M(IOOPEN) | M(IOINQUIRE) }, { "form", M(IOOPEN) | M(IOINQUIRE) }, { "blank", M(IOOPEN) | M(IOINQUIRE) }, { "exist", M(IOINQUIRE) }, { "opened", M(IOINQUIRE) }, { "number", M(IOINQUIRE) }, { "named", M(IOINQUIRE) }, { "name", M(IOINQUIRE) }, { "sequential", M(IOINQUIRE) }, { "direct", M(IOINQUIRE) }, { "formatted", M(IOINQUIRE) }, { "unformatted", M(IOINQUIRE) }, { "nextrec", M(IOINQUIRE) } } ; #define NIOS (sizeof(ioc)/sizeof(struct Ioclist) - 1) #define MAXIO SZFLAG + 10*SZIOINT + 15*SZADDR #define IOSUNIT 1 #define IOSFMT 2 #define IOSERR 3 #define IOSEND 4 #define IOSIOSTAT 5 #define IOSREC 6 #define IOSRECL 7 #define IOSFILE 8 #define IOSSTATUS 9 #define IOSACCESS 10 #define IOSFORM 11 #define IOSBLANK 12 #define IOSEXISTS 13 #define IOSOPENED 14 #define IOSNUMBER 15 #define IOSNAMED 16 #define IOSNAME 17 #define IOSSEQUENTIAL 18 #define IOSDIRECT 19 #define IOSFORMATTED 20 #define IOSUNFORMATTED 21 #define IOSNEXTREC 22 #define IOSTP V(IOSIOSTAT) /* offsets in generated structures */ #define SZFLAG SZIOINT /* offsets for external READ and WRITE statements */ #define XERR 0 #define XUNIT SZFLAG #define XEND SZFLAG + SZIOINT #define XFMT 2*SZFLAG + SZIOINT #define XREC 2*SZFLAG + SZIOINT + SZADDR #define XRLEN 2*SZFLAG + 2*SZADDR #define XRNUM 2*SZFLAG + 2*SZADDR + SZIOINT /* offsets for internal READ and WRITE statements */ #define XIERR 0 #define XIUNIT SZFLAG #define XIEND SZFLAG + SZADDR #define XIFMT 2*SZFLAG + SZADDR #define XIRLEN 2*SZFLAG + 2*SZADDR #define XIRNUM 2*SZFLAG + 2*SZADDR + SZIOINT #define XIREC 2*SZFLAG + 2*SZADDR + 2*SZIOINT /* offsets for OPEN statements */ #define XFNAME SZFLAG + SZIOINT #define XFNAMELEN SZFLAG + SZIOINT + SZADDR #define XSTATUS SZFLAG + 2*SZIOINT + SZADDR #define XACCESS SZFLAG + 2*SZIOINT + 2*SZADDR #define XFORMATTED SZFLAG + 2*SZIOINT + 3*SZADDR #define XRECLEN SZFLAG + 2*SZIOINT + 4*SZADDR #define XBLANK SZFLAG + 3*SZIOINT + 4*SZADDR /* offset for CLOSE statement */ #define XCLSTATUS SZFLAG + SZIOINT /* offsets for INQUIRE statement */ #define XFILE SZFLAG + SZIOINT #define XFILELEN SZFLAG + SZIOINT + SZADDR #define XEXISTS SZFLAG + 2*SZIOINT + SZADDR #define XOPEN SZFLAG + 2*SZIOINT + 2*SZADDR #define XNUMBER SZFLAG + 2*SZIOINT + 3*SZADDR #define XNAMED SZFLAG + 2*SZIOINT + 4*SZADDR #define XNAME SZFLAG + 2*SZIOINT + 5*SZADDR #define XNAMELEN SZFLAG + 2*SZIOINT + 6*SZADDR #define XQACCESS SZFLAG + 3*SZIOINT + 6*SZADDR #define XQACCLEN SZFLAG + 3*SZIOINT + 7*SZADDR #define XSEQ SZFLAG + 4*SZIOINT + 7*SZADDR #define XSEQLEN SZFLAG + 4*SZIOINT + 8*SZADDR #define XDIRECT SZFLAG + 5*SZIOINT + 8*SZADDR #define XDIRLEN SZFLAG + 5*SZIOINT + 9*SZADDR #define XFORM SZFLAG + 6*SZIOINT + 9*SZADDR #define XFORMLEN SZFLAG + 6*SZIOINT + 10*SZADDR #define XFMTED SZFLAG + 7*SZIOINT + 10*SZADDR #define XFMTEDLEN SZFLAG + 7*SZIOINT + 11*SZADDR #define XUNFMT SZFLAG + 8*SZIOINT + 11*SZADDR #define XUNFMTLEN SZFLAG + 8*SZIOINT + 12*SZADDR #define XQRECL SZFLAG + 9*SZIOINT + 12*SZADDR #define XNEXTREC SZFLAG + 9*SZIOINT + 13*SZADDR #define XQBLANK SZFLAG + 9*SZIOINT + 14*SZADDR #define XQBLANKLEN SZFLAG + 9*SZIOINT + 15*SZADDR fmtstmt(lp) register struct Labelblock *lp; { if(lp == NULL) { execerr("unlabeled format statement" , CNULL); return(-1); } if(lp->labtype == LABUNKNOWN) { lp->labtype = LABFORMAT; lp->labelno = newlabel(); } else if(lp->labtype != LABFORMAT) { execerr("bad format number", CNULL); return(-1); } return(lp->labelno); } setfmt(lp) struct Labelblock *lp; { int n; char *s, *lexline(); s = lexline(&n); preven(ALILONG); prlabel(asmfile, lp->labelno); putstr(asmfile, s, n); flline(); } startioctl() { register int i; inioctl = YES; nioctl = 0; ioformatted = UNFORMATTED; for(i = 1 ; i<=NIOS ; ++i) V(i) = NULL; } endioctl() { int i; expptr p; inioctl = NO; /* set up for error recovery */ ioerrlab = ioendlab = skiplab = jumplab = 0; if(p = V(IOSEND)) if(ISICON(p)) ioendlab = execlab(p->constblock.const.ci) ->labelno; else err("bad end= clause"); if(p = V(IOSERR)) if(ISICON(p)) ioerrlab = execlab(p->constblock.const.ci) ->labelno; else err("bad err= clause"); if(IOSTP) if(IOSTP->tag!=TADDR || ! ISINT(IOSTP->addrblock.vtype) ) { err("iostat must be an integer variable"); frexpr(IOSTP); IOSTP = NULL; } if(iostmt == IOREAD) { if(IOSTP) { if(ioerrlab && ioendlab && ioerrlab==ioendlab) jumplab = ioerrlab; else skiplab = jumplab = newlabel(); } else { if(ioerrlab && ioendlab && ioerrlab!=ioendlab) { IOSTP = (expptr) mktemp(TYINT, PNULL); skiplab = jumplab = newlabel(); } else jumplab = (ioerrlab ? ioerrlab : ioendlab); } } els((e if(iostmt == IOWRITE) { if(IOSTP && !ioerrlab) skiplab = jumplab = newlabel(); else jumplab = ioerrlab; } else jumplab = ioerrlab; endbit = IOSTP!=NULL || ioendlab!=0; /* for use in startrw() */ errbit = IOSTP!=NULL || ioerrlab!=0; if(iostmt!=IOREAD && iostmt!=IOWRITE) { if(ioblkp == NULL) ioblkp = autovar( (MAXIO+SZIOINT-1)/SZIOINT , TYIOINT, PNULL); ioset(TYIOINT, XERR, ICON(errbit)); } switch(iostmt) { case IOOPEN: dofopen(); break; case IOCLOSE: dofclose(); break; case IOINQUIRE: dofinquire(); break; case IOBACKSPACE: dofmove("f_back"); break; case IOREWIND: dofmove("f_rew"); break; case IOENDFILE: dofmove("f_end"); break; case IOREAD: case IOWRITE: startrw(); break; default: fatali("impossible iostmt %d", iostmt); } for(i = 1 ; i<=NIOS ; ++i) if(i!=IOSIOSTAT && V(i)!=NULL) frexpr(V(i)); } iocname() { register int i; int found, mask; found = 0; mask = M(iostmt); for(i = 1 ; i <= NIOS ; ++i) if(toklen==strlen(ioc[i].iocname) && eqn(toklen, token, ioc[i].iocname)) if(ioc[i].iotype & mask) return(i); else found = i; if(found) errstr("invalid control %s for statement", ioc[found].iocname); else errstr("unknown iocontrol %s", varstr(toklen, token) ); return(IOSBAD); } ioclause(n, p) register int n; register expptr p; { struct Ioclist *iocp; ++nioctl; if(n == IOSBAD) return; if(n == IOSPOSITIONAL) { if(nioctl > IOSFMT) { err("illegal positional iocontrol"); return; } n = nioctl; } if(p == NULL) { if(n == IOSUNIT) p = (expptr) (iostmt==IOREAD ? IOSTDIN : IOSTDOUT); else if(n != IOSFMT) { err("illegal * iocontrol"); return; } } if(n == IOSFMT) ioformatted = (p==NULL ? LISTDIRECTED : FORMATTED); iocp = & ioc[n]; if(iocp->iocval == NULL) { if(n!=IOSFMT && ( n!=IOSUNIT || (p!=NULL && p->headblock.vtype!=TYCHAR) ) ) p = fixtype(p); iocp->iocval = p; } else errstr("iocontrol %s repeated", iocp->iocname); } /* io list item */ doio(list) chainp list; { expptr call0(); if(ioformatted == NAMEDIRECTED) { if(list) err("no I/O list allowed in NAMELIST read/write"); } else { doiolist(list); ioroutine[0] = 'e'; putiocall( call0(TYINT, ioroutine) ); } } LOCAL doiolist(p0) chainp p0; { chainp p; register tagptr q; register expptr qe; register Namep qn; Addrp tp, mkscalar(); int range; for (p = p0 ; p ; p = p->nextp) { q = p->datap; if(q->tag == TIMPLDO) { exdo(range=newlabel(), q->impldoblock.impdospec); doiolist(q->impldoblock.datalist); enddo(range); free( (charptr) q); } else { if(q->tag==TPRIM && q->primblock.argsp==NULL && q->primblock.namep->vdim!=NULL) { vardcl(qn = q->primblock.namep); if(qn->vdim->nelt) putio( fixtype(cpexpr(qn->vdim->nelt)), mkscalar(qn) ); else err("attempt to i/o array of unknown size"); } else if(q->tag==TPRIM && q->primblock.argsp==NULL && (qe = (expptr) memversion(q->primblock.namep)) ) putio(ICON(1),qe); else if( (qe = fixtype(cpexpr(q)))->tag==TADDR) putio(ICON(1), qe); else if(qe->headblock.vtype != TYERROR) { if(iostmt == IOWRITE) { ftnint lencat(); expptr qvl; qvl = NULL; if( ISCHAR(qe) ) { qvl = (expptr) cpexpr(qe->headblock.vleng); tp = mktemp(qe->headblock.vtype, ICON(lencat(qe))); } else tp = mktemp(qe->headblock.vtype, qe->headblock.vleng); puteq( cpexpr(tp), qe); if(qvl) /* put right length on block */ { frexpr(tp->vleng); tp->vleng = qvl; } putio(ICON(1), tp); } else err("non-left side in READ list"); } frexpr(q); } } frchain( &p0 ); } LOCAL putio(nelt, addr) expptr nelt; register expptr addr; { int type; register expptr q; type = addr->headblock.vtype; if(ioformatted!=LISTDIRECTED && ISCOMPLEX(type) ) { nelt = mkexpr(OPSTAR, ICON(2), nelt); type -= (TYCOMPLEX-TYREAL); } /* pass a length with every item. for noncharacter data, fake one */ if(type != TYCHAR) { if( ISCONST(addr) ) addr = (expptr) putconst(addr); addr->headblock.vtype = TYCHAR; addr->headblock.vleng = ICON( typesize[type] ); } nelt = fixtype( mkconv(TYLENG,nelt) ); if(ioformatted == LISTDIRECTED) q = call3(TYINT, "do_lio", mkconv(TYLONG, ICON(type)), nelt, addr); else q = call2(TYINT, (ioformatted==FORMATTED ? "do_fio" : "do_uio"), nelt, addr); putiocall(q); } endio() { if(skiplab) { putlabel(skiplab); if(ioendlab) putif( mkexpr(OPGE, cpexpr(IOSTP), ICON(0)), ioendlab); if(ioerrlab) putif( mkexpr( ( (iostmt==IOREAD||iostmt==IOWRITE) ? OPLE : OPEQ), cpexpr(IOSTP), ICON(0)) , ioerrlab); } if(IOSTP) frexpr(IOSTP); } LOCAL putiocall(q) register expptr q; { if(IOSTP) { q->headblock.vtype = TYINT; q = fixexpr( mkexpr(OPASSIGN, cpexpr(IOSTP), q)); } if(jumplab) putif( mkexpr(OPEQ, q, ICON(0) ), jumplab); else putexpr(q); } startrw() { register expptr p; register Namep np; register Addrp unitp, fmtp, recp, tioblkp; register expptr nump; Addrp mkscalar(); expptr mkaddcon(); int k; flag intfile, sequential, ok, varfmt; /* First look at all the parameters and determine what is to be done */ ok = YES; statstruct = YES; intfile = NO; if(p = V(IOSUNIT)) { if( ISINT(p->headblock.vtype) ) unitp = (Addrp) cpexpr(p); else if(p->headblock.vtype == TYCHAR) { intfile = YES; if(p->tag==TPRIM && p->primblock.argsp==NULL && (np = p->primblock.namep)->vdim!=NULL) { vardcl(np); if(np->vdim->nelt) { nump = (expptr) cpexpr(np->vdim->nelt); if( ! ISCONST(nump) ) statstruct = NO; } else { err("attempt to use internal unit array of unknown size"); ok = NO; nump = ICON(1); } unitp = mkscalar(np); } else { nump = ICON(1); unitp = fixtype(cpexpr(p)); } if(! isstatic(unitp) ) statstruct = NO; } } else { err("bad unit specifier"); ok = NO; } sequential = YES; if(p = V(IOSREC)) if( ISINT(p->headblock.vtype) ) { recp = (Addrp) cpexpr(p); sequential = NO; } else { err("bad REC= clause"); ok = NO; } else recp = NULL; varfmt = YES; fmtp = NULL; if(p = V(IOSFMT)) { if(p->tag==TPRIM && p->primblock.argsp==NULL) { np = p->primblock.namep; if(np->vclass == CLNAMELIST) { ioformatted = NAMEDIRECTED; fmtp = (Addrp) fixtype(p); goto endfmt; } vardcl(np); if(np->vdim) { if( ! ONEOF(np->vstg, MSKSTATIC) ) statstruct = NO; fmtp = mkscalar(np); goto endfmt; } if( ISINT(np->vtype) ) /* ASSIGNed label */ { statstruct = NO; varfmt = NO; fmtp = (Addrp) fixtype(p); goto endfmt; } } p = V(IOSFMT) = fixtype(p); if(p->headblock.vtype == TYCHAR) { if( ! isstatic(p) ) statstruct = NO; fmtp = (Addrp) cpexpr(p); } else if( ISICON(p) ) { if( (k = fmtstmt( mklabel(p->constblock.const.ci) )) > 0 ) { fmtp = (Addrp) mkaddcon(k); varfmt = NO; } else ioformatted = UNFORMATTED; } else { err("bad format descriptor"); ioformatted = UNFORMATTED; ok = NO; } } else fmtp = NULL; endfmt: if(intfile && ioformatted==UNFORMATTED) { err("unformatted internal I/O not allowed"); ok = NO; } if(!sequential && ioformatted==LISTDIRECTED) { err("direct list-directed I/O not allowed"); ok = NO; } if(!sequential && ioformatted==NAMEDIRECTED) { err("direct namelist I/O not allowed"); ok = NO; } if( ! ok ) return; /* Now put out the I/O structure, statically if all the clauses are constants, dynamically otherwise */ if(statstruct) { tioblkp = ioblkp; ioblkp = ALLOC(Addrblock); ioblkp->tag = TADDR; ioblkp->vtype = TYIOINT; ioblkp->vclass = CLVAR; ioblkp->vstg = STGINIT; ioblkp->memno = ++lastvarno; ioblkp->memoffset = ICON(0); blklen = (intfile ? XIREC+SZIOINT : (sequential ? XFMT+SZADDR : XRNUM+SZIOINT) ); } else if(ioblkp == NULL) ioblkp = autovar( (MAXIO+SZIOINT-1)/SZIOINT , TYIOINT, PNULL); ioset(TYIOINT, XERR, ICON(errbit)); if(iostmt == IOREAD) ioset(TYIOINT, (intfile ? XIEND : XEND), ICON(endbit) ); if(intfile) { ioset(TYIOINT, XIRNUM, nump); ioset(TYIOINT, XIRLEN, cpexpr(unitp->vleng) ); ioseta(XIUNIT, unitp); } else ioset(TYIOINT, XUNIT, (expptr) unitp); if(recp) ioset(TYIOINT, (intfile ? XIREC : XREC) , (expptr) recp); if(varfmt) ioseta( intfile ? XIFMT : XFMT , fmtp); else ioset(TYADDR, intfile ? XIFMT : XFMT, (expptr) fmtp); ioroutine[0] = 's'; ioroutine[1] = '_'; ioroutine[2] = (iostmt==IOREAD ? 'r' : 'w'); ioroutine[3] = (sequential ? 's' : 'd'); ioroutine[4] = "ufln" [ioformatted]; ioroutine[5] = (intfile ? 'i' : 'e'); ioroutine[6] = '\0'; putiocall( call1(TYINT, ioroutine, cpexpr(ioblkp) )); if(statstruct) { frexpr(ioblkp); ioblkp = tioblkp; statstruct = NO; } } LOCAL dofopen() { register expptr p; if( (p = V(IOSUNIT)) && ISINT(p->headblock.vtype) ) ioset(TYIOINT, XUNIT, cpexpr(p) ); else err("bad unit in open"); if( (p = V(IOSFILE)) ) if(p->headblock.vtype == TYCHAR) ioset(TYIOINT, XFNAMELEN, cpexpr(p->headblock.vleng) ); else err("bad file in open"); iosetc(XFNAME, p); if(p = V(IOSRECL)) if( ISINT(p->headblock.vtype) ) ioset(TYIOINT, XRECLEN, cpexpr(p) ); else err("bad recl"); else ioset(TYIOINT, XRECLEN, ICON(0) ); iosetc(XSTATUS, V(IOSSTATUS)); iosetc(XACCESS, V(IOSACCESS)); iosetc(XFORMATTED, V(IOSFORM)); iosetc(XBLANK, V(IOSBLANK)); putiocall( call1(TYINT, "f_open", cpexpr(ioblkp) )); } LOCAL dofclose() { register expptr p; if( (p = V(IOSUNIT)) && ISINT(p->headblock.vtype) ) { ioset(TYIOINT, XUNIT, cpexpr(p) ); iosetc(XCLSTATUS, V(IOSSTATUS)); putiocall( call1(TYINT, "f_clos", cpexpr(ioblkp)) ); } else err("bad unit in close statement"); } LOCAL dofinquire() { register expptr p; if(p = V(IOSUNIT)) { if( V(IOSFILE) ) err("inquire by unit or by file, not both"); ioset(TYIOINT, XUNIT, cpexpr(p) ); } else if( ! V(IOSFILE) ) err("must inquire by unit or by file"); iosetlc(IOSFILE, XFILE, XFILELEN); iosetip(IOSEXISTS, XEXISTS); iosetip(IOSOPENED, XOPEN); iosetip(IOSNUMBER, XNUMBER); iosetip(IOSNAMED, XNAMED); iosetlc(IOSNAME, XNAME, XNAMELEN); iosetlc(IOSACCESS, XQACCESS, XQACCLEN); iosetlc(IOSSEQUENTIAL, XSEQ, XSEQLEN); iosetlc(IOSDIRECT, XDIRECT, XDIRLEN); iosetlc(IOSFORM, XFORM, XFORMLEN); iosetlc(IOSFORMAT((TED, XFMTED, XFMTEDLEN); iosetlc(IOSUNFORMATTED, XUNFMT, XUNFMTLEN); iosetip(IOSRECL, XQRECL); iosetip(IOSNEXTREC, XNEXTREC); iosetlc(IOSBLANK, XQBLANK, XQBLANKLEN); putiocall( call1(TYINT, "f_inqu", cpexpr(ioblkp) )); } LOCAL dofmove(subname) char *subname; { register expptr p; if( (p = V(IOSUNIT)) && ISINT(p->headblock.vtype) ) { ioset(TYIOINT, XUNIT, cpexpr(p) ); putiocall( call1(TYINT, subname, cpexpr(ioblkp) )); } else err("bad unit in I/O motion statement"); } LOCAL ioset(type, offset, p) int type, offset; register expptr p; { register Addrp q; q = (Addrp) cpexpr(ioblkp); q->vtype = type; q->memoffset = fixtype( mkexpr(OPPLUS, q->memoffset, ICON(offset)) ); if(statstruct && ISCONST(p)) { setdata(q, p, 0L, blklen); frexpr(q); frexpr(p); } else puteq(q, p); } LOCAL iosetc(offset, p) int offset; register expptr p; { if(p == NULL) ioset(TYADDR, offset, ICON(0) ); else if(p->headblock.vtype == TYCHAR) ioset(TYADDR, offset, addrof(cpexpr(p) )); else err("non-character control clause"); } LOCAL ioseta(offset, p) int offset; register Addrp p; { char *dataname(); if(statstruct) { dataline(dataname(STGINIT,ioblkp->memno), (ftnint) offset, blklen, TYADDR); if(p) praddr(initfile, p->vstg, p->memno, p->memoffset->constblock.const.ci); else praddr(initfile, STGNULL, 0, (ftnint) 0); } else ioset(TYADDR, offset, p ? addrof(p) : ICON(0) ); } LOCAL iosetip(i, offset) int i, offset; { register expptr p; if(p = V(i)) if(p->tag==TADDR && ONEOF(p->addrblock.vtype, M(TYLONG)|M(TYLOGICAL)) ) ioset(TYADDR, offset, addrof(cpexpr(p)) ); else errstr("impossible inquire parameter %s", ioc[i].iocname); else ioset(TYADDR, offset, ICON(0) ); } LOCAL iosetlc(i, offp, offl) int i, offp, offl; { register expptr p; if( (p = V(i)) && p->headblock.vtype==TYCHAR) ioset(TYIOINT, offl, cpexpr(p->headblock.vleng) ); iosetc(offp, p); } ICON(0) ); } LOCAL iosetip(i, offset) int i, offset; { register expptr p; if(p = V(i)) if(p->tag==TADDR && ONEOF(p->addrblock.vtype, M(TYLcmd/f77/misc.c 644 0 33 20404 2411243523 6314 #include "defs" cpn(n, a, b) register int n; register char *a, *b; { while(--n >= 0) *b++ = *a++; } eqn(n, a, b) register int n; register char *a, *b; { while(--n >= 0) if(*a++ != *b++) return(NO); return(YES); } cmpstr(a, b, la, lb) /* compare two strings */ register char *a, *b; ftnint la, lb; { register char *aend, *bend; aend = a + la; bend = b + lb; if(la <= lb) { while(a < aend) if(*a != *b) return( *a - *b ); else { ++a; ++b; } while(b < bend) if(*b != ' ') return(' ' - *b); else ++b; } else { while(b < bend) if(*a != *b) return( *a - *b ); else { ++a; ++b; } while(a < aend) if(*a != ' ') return(*a - ' '); else ++a; } return(0); } chainp hookup(x,y) register chainp x, y; { register chainp p; if(x == NULL) return(y); for(p = x ; p->nextp ; p = p->nextp) ; p->nextp = y; return(x); } struct Listblock *mklist(p) chainp p; { register struct Listblock *q; q = ALLOC(Listblock); q->tag = TLIST; q->listp = p; return(q); } chainp mkchain(p,q) register tagptr p; register chainp q; { register chainp r; if(chains) { r = chains; chains = chains->nextp; } else r = ALLOC(Chain); r->datap = p; r->nextp = q; return(r); } char * varstr(n, s) register int n; register char *s; { register int i; static char name[XL+1]; for(i=0; i= 0) *q++ = *s++; return(p); } char *copys(s) char *s; { return( copyn( strlen(s)+1 , s) ); } ftnint convci(n, s) register int n; register char *s; { ftnint sum; sum = 0; while(n-- > 0) sum = 10*sum + (*s++ - '0'); return(sum); } char *convic(n) ftnint n; { static char s[20]; register char *t; s[19] = '\0'; t = s+19; do { *--t = '0' + n%10; n /= 10; } while(n > 0); return(t); } double convcd(n, s) int n; register char *s; { double atof(); char v[100]; register char *t; if(n > 90) { err("too many digits in floating constant"); n = 90; } for(t = v ; n-- > 0 ; s++) *t++ = (*s=='d' ? 'e' : *s); *t = '\0'; return( atof(v) ); } Namep mkname(l, s) int l; register char *s; { struct Hashentry *hp; int hash; register Namep q; register int i; char n[VL]; hash = 0; for(i = 0 ; ivarp) if( hash==hp->hashval && eqn(VL,n,q->varname) ) return(q); else if(++hp >= lasthash) hp = hashtab; if(++nintnames >= maxhash-1) many("names", 'n'); hp->varp = q = ALLOC(Nameblock); hp->hashval = hash; q->tag = TNAME; cpn(VL, n, q->varname); return(q); } struct Labelblock *mklabel(l) ftnint l; { register struct Labelblock *lp; if(l <= 0) return(NULL); for(lp = labeltab ; lp < highlabtab ; ++lp) if(lp->stateno == l) return(lp); if(++highlabtab > labtabend) many("statement numbers", 's'); lp->stateno = l; lp->labelno = newlabel(); lp->blklevel = 0; lp->labused = NO; lp->labdefined = NO; lp->labinacc = NO; lp->labtype = LABUNKNOWN; return(lp); } newlabel() { return( ++lastlabno ); } /* this label appears in a branch context */ struct Labelblock *execlab(stateno) ftnint stateno; { register struct Labelblock *lp; if(lp = mklabel(stateno)) { if(lp->labinacc) warn1("illegal branch to inner block, statement %s", convic(stateno) ); else if(lp->labdefined == NO) lp->blklevel = blklevel; lp->labused = YES; if(lp->labtype == LABFORMAT) err("may not branch to a format"); else lp->labtype = LABEXEC; } else execerr("illegal label %s", convic(stateno)); return(lp); } /* find or put a name in the external symbol table */ struct Extsym *mkext(s) char *s; { int i; register char *t; char n[XL]; struct Extsym *p; i = 0; t = n; while(iextname)) return( p ); if(nextext >= lastext) many("external symbols", 'x'); cpn(XL, n, nextext->extname); nextext->extstg = STGUNKNOWN; nextext->extsave = NO; nextext->extp = 0; nextext->extleng = 0; nextext->maxleng = 0; nextext->extinit = NO; return( nextext++ ); } Addrp builtin(t, s) int t; char *s; { register struct Extsym *p; register Addrp q; p = mkext(s); if(p->extstg == STGUNKNOWN) p->extstg = STGEXT; else if(p->extstg != STGEXT) { errstr("improper use of builtin %s", s); return(0); } q = ALLOC(Addrblock); q->tag = TADDR; q->vtype = t; q->vclass = CLPROC; q->vstg = STGEXT; q->memno = p - extsymtab; return(q); } frchain(p) register chainp *p; { register chainp q; if(p==0 || *p==0) return; for(q = *p; q->nextp ; q = q->nextp) ; q->nextp = chains; chains = *p; *p = 0; } tagptr cpblock(n,p) register int n; register char * p; { register char *q; ptr q0; q0 = ckalloc(n); q = (char *) q0; while(n-- > 0) *q++ = *p++; return( (tagptr) q0); } max(a,b) int a,b; { return( a>b ? a : b); } ftnint lmax(a, b) ftnint a, b; { return( a>b ? a : b); } ftnint lmin(a, b) ftnint a, b; { return(a < b ? a : b); } maxtype(t1, t2) int t1, t2; { int t; t = max(t1, t2); if(t==TYCOMPLEX && (t1==TYDREAL || t2==TYDREAL) ) t = TYDCOMPLEX; return(t); } /* return log base 2 of n if n a power of 2; otherwise -1 */ #if FAMILY == PCC log2(n) ftnint n; { int k; /* trick based on binary representation */ if(n<=0 || (n & (n-1))!=0) return(-1); for(k = 0 ; n >>= 1 ; ++k) ; return(k); } #endif frrpl() { struct Rplblock *rp; while(rpllist) { rp = rpllist->rplnextp; free( (charptr) rpllist); rpllist = rp; } } expptr callk(type, name, args) int type; char *name; chainp args; { register expptr p; p = mkexpr(OPCALL, builtin(type,name), args); p->exprblock.vtype = type; return(p); } expptr call4(type, name, arg1, arg2, arg3, arg4) int type; char *name; expptr arg1, arg2, arg3, arg4; { struct Listblock *args; args = mklist( mkchain(arg1, mkchain(arg2, mkchain(arg3, mkchain(arg4, CHNULL)) ) ) ); return( callk(type, name, args) ); } expptr call3(type, name, arg1, arg2, arg3) int type; char *name; expptr arg1, arg2, arg3; { struct Listblock *args; args = mklist( mkchain(arg1, mkchain(arg2, mkchain(arg3, CHNULL) ) ) ); return( callk(type, name, args) ); } expptr call2(type, name, arg1, arg2) int type; char *name; expptr arg1, arg2; { struct Listblock *args; args = mklist( mkchain(arg1, mkchain(arg2, CHNULL) ) ); return( callk(type,name, args) ); } expptr call1(type, name, arg) int type; char *name; expptr arg; { return( callk(type,name, mklist(mkchain(arg,CHNULL)) )); } expptr call0(type, name) int type; char *name; { return( callk(type, name, PNULL) ); } struct Impldoblock *mkiodo(dospec, list) chainp dospec, list; { register struct Impldoblock *q; q = ALLOC(Impldoblock); q->tag = TIMPLDO; q->impdospec = dospec; q->datalist = list; return(q); } ptr ckalloc(n) register int n; { register ptr p; ptr calloc(); if( p = calloc(1, (unsigned) n) ) return(p); fatal("out of memory"); /* NOTREACHED */ } isaddr(p) register expptr p; { if(p->tag == TADDR) return(YES); if(p->tag == TEXPR) switch(p->exprblock.opcode) { case OPCOMMA((: return( isaddr(p->exprblock.rightp) ); case OPASSIGN: case OPPLUSEQ: return( isaddr(p->exprblock.leftp) ); } return(NO); } isstatic(p) register expptr p; { if(p->headblock.vleng && !ISCONST(p->headblock.vleng)) return(NO); switch(p->tag) { case TCONST: return(YES); case TADDR: if(ONEOF(p->addrblock.vstg,MSKSTATIC) && ISCONST(p->addrblock.memoffset)) return(YES); default: return(NO); } } addressable(p) register expptr p; { switch(p->tag) { case TCONST: return(YES); case TADDR: return( addressable(p->addrblock.memoffset) ); default: return(NO); } } hextoi(c) register int c; { register char *p; static char p0[17] = "0123456789abcdef"; for(p = p0 ; *p ; ++p) if(*p == c) return( p-p0 ); return(16); } { case TCONST: return(YES); case TADDR: if(ONEOF(p->addrblock.vstg,MSKSTATIC) && ISCONST(p->addrblock.memoffset)) return(YES); default: return(NO); } } addressable(p) register expptr p; { switch(p->tag) { case TCONST: returcmd/f77/put.c 644 0 33 12661 2411243524 6200 /* * INTERMEDIATE CODE GENERATION PROCEDURES COMMON TO BOTH * JOHNSON (PORTABLE) AND RITCHIE FAMILIES OF SECOND PASSES */ #include "defs" #if FAMILY == PCC # include "pccdefs" #else # include "dmrdefs" #endif /* char *ops [ ] = { "??", "+", "-", "*", "/", "**", "-", "OR", "AND", "EQV", "NEQV", "NOT", "CONCAT", "<", "==", ">", "<=", "!=", ">=", " of ", " ofC ", " = ", " += ", " *= ", " CONV ", " << ", " % ", " , ", " ? ", " : " " abs ", " min ", " max ", " addr ", " indirect ", " bitor ", " bitand ", " bitxor ", " bitnot ", " >> ", }; */ int ops2 [ ] = { P2BAD, P2PLUS, P2MINUS, P2STAR, P2SLASH, P2BAD, P2NEG, P2OROR, P2ANDAND, P2EQ, P2NE, P2NOT, P2BAD, P2LT, P2EQ, P2GT, P2LE, P2NE, P2GE, P2CALL, P2CALL, P2ASSIGN, P2PLUSEQ, P2STAREQ, P2CONV, P2LSHIFT, P2MOD, P2COMOP, P2QUEST, P2COLON, P2BAD, P2BAD, P2BAD, P2BAD, P2BAD, P2BITOR, P2BITAND, P2BITXOR, P2BITNOT, P2RSHIFT }; int types2 [ ] = { P2BAD, P2INT|P2PTR, P2SHORT, P2LONG, P2REAL, P2DREAL, #if TARGET == INTERDATA P2BAD, P2BAD, P2LONG, P2CHAR, P2INT, P2BAD #else P2REAL, P2DREAL, P2LONG, P2CHAR, P2INT, P2BAD #endif }; setlog() { types2[TYLOGICAL] = types2[tylogical]; typesize[TYLOGICAL] = typesize[tylogical]; typealign[TYLOGICAL] = typealign[tylogical]; } putex1(p) expptr p; { putx( fixtype(p) ); templist = hookup(templist, holdtemps); holdtemps = NULL; } putassign(lp, rp) expptr lp, rp; { putx( fixexpr( mkexpr(OPASSIGN, lp, rp) )); } puteq(lp, rp) expptr lp, rp; { putexpr( mkexpr(OPASSIGN, lp, rp) ); } /* put code for a *= b */ putsteq(a, b) expptr a, b; { putx( fixexpr( mkexpr(OPSTAREQ, cpexpr(a), cpexpr(b)) )); } Addrp realpart(p) register Addrp p; { register Addrp q; q = (Addrp) cpexpr(p); if( ISCOMPLEX(p->vtype) ) q->vtype += (TYREAL-TYCOMPLEX); return(q); } expptr imagpart(p) register Addrp p; { register Addrp q; expptr mkrealcon(); if( ISCOMPLEX(p->vtype) ) { q = (Addrp) cpexpr(p); q->vtype += (TYREAL-TYCOMPLEX); q->memoffset = mkexpr(OPPLUS, q->memoffset, ICON(typesize[q->vtype])); return( (expptr) q ); } else return( mkrealcon( ISINT(p->vtype) ? TYDREAL : p->vtype , 0.0)); } ncat(p) register expptr p; { if(p->tag==TEXPR && p->exprblock.opcode==OPCONCAT) return( ncat(p->exprblock.leftp) + ncat(p->exprblock.rightp) ); else return(1); } ftnint lencat(p) register expptr p; { if(p->tag==TEXPR && p->exprblock.opcode==OPCONCAT) return( lencat(p->exprblock.leftp) + lencat(p->exprblock.rightp) ); else if( p->headblock.vleng!=NULL && ISICON(p->headblock.vleng) ) return(p->headblock.vleng->constblock.const.ci); else if(p->tag==TADDR && p->addrblock.varleng!=0) return(p->addrblock.varleng); else { err("impossible element in concatenation"); return(0); } } Addrp putconst(p) register Constp p; { register Addrp q; struct Literal *litp, *lastlit; int i, k, type; int litflavor; if( p->tag != TCONST ) badtag("putconst", p->tag); q = ALLOC(Addrblock); q->tag = TADDR; type = p->vtype; q->vtype = ( type==TYADDR ? TYINT : type ); q->vleng = (expptr) cpexpr(p->vleng); q->vstg = STGCONST; q->memno = newlabel(); q->memoffset = ICON(0); /* check for value in literal pool, and update pool if necessary */ switch(type = p->vtype) { case TYCHAR: if(p->vleng->constblock.const.ci > XL) break; /* too long for literal table */ litflavor = 1; goto loop; case TYREAL: case TYDREAL: litflavor = 2; goto loop; case TYLOGICAL: type = tylogical; case TYSHORT: case TYLONG: litflavor = 3; loop: lastlit = litpool + nliterals; for(litp = litpool ; litplittype) switch(litflavor) { case 1: if(p->vleng->constblock.const.ci != litp->litval.litcval.litclen) break; if(! eqn( (int) p->vleng->constblock.const.ci, p->const.ccp, litp->litval.litcval.litcstr) ) break; ret: q->memno = litp->litnum; frexpr(p); return(q); case 2: if(p->const.cd[0] == litp->litval.litdval) goto ret; break; case 3: if(p->const.ci == litp->litval.litival) goto ret; break; } if(nliterals < MAXLITERALS) { ++nliterals; litp->littype = type; litp->litnum = q->memno; switch(litflavor) { case 1: litp->litval.litcval.litclen = p->vleng->constblock.const.ci; cpn( (int) litp->litval.litcval.litclen, p->const.ccp, litp->litval.litcval.litcstr); break; case 2: litp->litval.litdval = p->const.cd[0]; break; case 3: litp->litval.litival = p->const.ci; break; } } default: break; } preven(typealign[ type==TYCHAR ? TYLONG : type ]); prlabel(asmfile, q->memno); k = 1; switch(type) { case TYLOGICAL: case TYSHORT: case TYLONG: prconi(asmfile, type, p->const.ci); break; case TYCOMPLEX: k = 2; case TYREAL: type = TYREAL; goto flpt; case TYDCOMPLEX: k = 2; case TYDREAL: type = TYDREAL; flpt: for(i = 0 ; i < k ; ++i) prconr(asmfile, type, p->const.cd[i]); break; case TYCHAR: putstr(asmfile, p->const.ccp, (int) (p->vleng->constblock.const.ci) ); break; case TYADDR: prcona(asmfile, p->const.ci); break; default: badtype("putconst", p->vtype); } frexpr(p); return( q ); } /* * put out a character string constant. begin every one on * a long integer boundary, and pad with nulls */ putstr(fp, s, n) FILEP fp; char *s; int n; { int b[SZSHORT]; int i; i = 0; while(--n >= 0) { b[i++] = *s++; if(i == SZSHORT) { prchars(fp, b); i = 0; } } while(i < SZSHORT) b[i++] = '\0'; prchars(fp, b); } (p->vleng->constblock.const.ci) ); break; case TYADDR: prcona(asmfile, pcmd/f77/error.c 644 0 33 3427 2411243526 6503 #include "defs" warn1(s,t) char *s, *t; { char buff[100]; sprintf(buff, s, t); warn(buff); } warn(s) char *s; { if(nowarnflag) return; fprintf(diagfile, "Warning on line %d of %s: %s\n", lineno, infname, s); ++nwarn; } errstr(s, t) char *s, *t; { char buff[100]; sprintf(buff, s, t); err(buff); } erri(s,t) char *s; int t; { char buff[100]; sprintf(buff, s, t); err(buff); } err(s) char *s; { fprintf(diagfile, "Error on line %d of %s: %s\n", lineno, infname, s); ++nerr; } yyerror(s) char *s; { err(s); } dclerr(s, v) char *s; Namep v; { char buff[100]; if(v) { sprintf(buff, "Declaration error for %s: %s", varstr(VL, v->varname), s); err(buff); } else errstr("Declaration error %s", s); } execerr(s, n) char *s, *n; { char buf1[100], buf2[100]; sprintf(buf1, "Execution error %s", s); sprintf(buf2, buf1, n); err(buf2); } fatal(t) char *t; { fprintf(diagfile, "Compiler error line %d of %s: %s\n", lineno, infname, t); if(debugflag) abort(); done(3); exit(3); } fatalstr(t,s) char *t, *s; { char buff[100]; sprintf(buff, t, s); fatal(buff); } fatali(t,d) char *t; int d; { char buff[100]; sprintf(buff, t, d); fatal(buff); } badthing(thing, r, t) char *thing, *r; int t; { char buff[50]; sprintf(buff, "Impossible %s %d in routine %s", thing, t, r); fatal(buff); } badop(r, t) char *r; int t; { badthing("opcode", r, t); } badtag(r, t) char *r; int t; { badthing("tag", r, t); } badstg(r, t) char *r; int t; { badthing("storage class", r, t); } badtype(r, t) char *r; int t; { badthing("type", r, t); } many(s, c) char *s, c; { char buff[25]; sprintf(buff, "Too many %s. Try the -N%c option", s, c); fatal(buff); } err66(s) char *s; { errstr("Fortran 77 feature used: %s", s); } errext(s) char *s; { errstr("F77 compiler extension used: %s", s); } ); } badop(r, t) char *r; int t; { badthing("opcode", r, t); } badtag(r, t) char *r; int t; { badthing("tag", r, t); } badstg(r, t) char *r; int t; { badthing("storage class", r, t); } badtype(r, t) char *r; int t; { bcmd/f77/vaxdefs 644 0 33 1601 2411243527 6562 ((#ifndef TARGET TARGET NOT DEFINED !!! #endif #if TARGET!=VAX Target= TARGET OUT OF RANGE!! #endif #ifndef FAMILY FAMILY NOT DEFINED!!! #endif #if FAMILY!=PCC && FAMILY!=DMR Family = FAMILY OUT OF RANGE #endif #define SDB 1 #define TYLENG TYLONG #define TYINT TYLONG #define SZADDR 4 #define SZSHORT 2 #define SZINT 4 #define SZLONG 4 #define SZLENG SZLONG #define ALIADDR SZADDR #define ALISHORT SZSHORT #define ALILONG 4 #define ALIDOUBLE 4 #define ALIINT ALILONG #define ALILENG ALILONG #define AUTOREG 13 #define ARGREG 12 #define CARGREG 12 #define ARGOFFSET 4 #define SAVESPACE 40 #define FUDGEOFFSET 1 #define BITSPERCHAR 8 #define XL 8 #define USETEXT ".text" #define USECONST ".data\t0" #define USEBSS ".data\t1" #define USEINIT ".data\t2" #define BLANKCOMMON "_BLNK_" #define LABELFMT "%s:\n" #define MAXREGVAR 4 #define TYIREG TYLONG #define MSKIREG (M(TYSHORT)|M(TYLONG)) #define ALISHORT SZSHORT #define ALILONG 4 #define ALIDOUBLE 4 #define ALIINT ALILONG #define ALILENG ALILONG #define AUTOREG cmd/f77/vaxx.c 644 0 33 555 2411243531 6313 #include #include "defines" #include "machdefs" prchars(fp, s) FILEP fp; int *s; { fprintf(fp, ".byte 0%o,0%o\n", s[0], s[1]); } pruse(fp, s) FILEP fp; char *s; { fprintf(fp, "\t%s\n", s); } prskip(fp, k) FILEP fp; ftnint k; { fprintf(fp, "\t.space\t%ld\n", k); } prcomblock(fp, name) FILEP fp; char *name; { fprintf(fp, LABELFMT, name); } TYSHORT)|M(TYLONG)) #define ALISHORT SZSHORT #define AL/,5< /,"cmd/f77/pccdefs 644 0 33 2244 2411243532 6531 #define P2BAD -1 #define P2NAME 2 #define P2ICON 4 #define P2PLUS 6 #define P2PLUSEQ 7 #define P2MINUS 8 #define P2NEG 10 #define P2STAR 11 #define P2STAREQ 12 #define P2INDIRECT 13 #define P2BITAND 14 #define P2BITOR 17 #define P2BITXOR 19 #define P2QUEST 21 #define P2COLON 22 #define P2ANDAND 23 #define P2OROR 24 #define P2GOTO 37 #define P2LISTOP 56 #define P2ASSIGN 58 #define P2COMOP 59 #define P2SLASH 60 #define P2MOD 62 #define P2LSHIFT 64 #define P2RSHIFT 66 #define P2CALL 70 #define P2CALL0 72 #define P2NOT 76 #define P2BITNOT 77 #define P2EQ 80 #define P2NE 81 #define P2LE 82 #define P2LT 83 #define P2GE 84 #define P2GT 85 #define P2REG 94 #define P2OREG 95 #define P2CONV 104 #define P2FORCE 108 #define P2CBRANCH 109 /* special operators included only for fortran's use */ #define P2PASS 200 #define P2STMT 201 #define P2SWITCH 202 #define P2LBRACKET 203 #define P2RBRACKET 204 #define P2EOF 205 #define P2ARIF 206 #define P2LABEL 207 #if TARGET==PDP11 # define P2SHORT 4 # define P2INT 4 # define P2LONG 5 #else # define P2SHORT 3 # define P2INT 4 # define P2LONG 4 #endif #define P2CHAR 2 #define P2REAL 6 #define P2DREAL 7 #define P2PTR 020 #define P2FUNCT 040 #define P2CONV 104 #define P2FORCE 108 #define P2CBRANCH 109 /* special operators included only for fortran's use */ #define P2PASS 200 #define P2STMT 201 #define P2SWITCH 202 #define P2LBRACKET 203 #define P2RBRACKET 204 #define P2EOF 205 #define P2ARIF 206 #define P2LABEL 207 #if TARGET==PDP11 # define P2SHORT 4 # define P2INT 4 # define P2Lcmd/f77/machdefs 644 0 33 1601 2411243542 6671 #ifndef TARGET TARGET NOT DEFINED !!! #endif #if TARGET!=VAX Target= TARGET OUT OF RANGE!! #endif #ifndef FAMILY FAMILY NOT DEFINED!!! #endif #if FAMILY!=PCC && FAMILY!=DMR Family = FAMILY OUT OF RANGE #endif #define SDB 1 #define TYLENG TYLONG #define TYINT TYLONG #define SZADDR 4 #define SZSHORT 2 #define SZINT 4 #define SZLONG 4 #define SZLENG SZLONG #define ALIADDR SZADDR #define ALISHORT SZSHORT #define ALILONG 4 #define ALIDOUBLE 4 #define ALIINT ALILONG #define ALILENG ALILONG #define AUTOREG 13 #define ARGREG 12 #define CARGREG 12 #define ARGOFFSET 4 #define SAVESPACE 40 #define FUDGEOFFSET 1 #define BITSPERCHAR 8 #define XL 8 #define USETEXT ".text" #define USECONST ".data\t0" #define USEBSS ".data\t1" #define USEINIT ".data\t2" #define BLANKCOMMON "_BLNK_" #define LABELFMT "%s:\n" #define MAXREGVAR 4 #define TYIREG TYLONG #define MSKIREG (M(TYSHORT)|M(TYLONG)) #define ALISHORT SZSHORT #define ALILONG 4 #define ALIDOUBLE 4 #define ALIINT ALILONG #define ALILENG ALILONG #define AUTOREG cmd/f77/putpcc.c 644 0 33 64207 2431222666 6677 /* INTERMEDIATE CODE GENERATION FOR S. C. JOHNSON C COMPILERS */ /* NEW VERSION USING BINARY POLISH POSTFIX INTERMEDIATE */ #if FAMILY != PCC WRONG put FILE !!!! #endif #include "defs" #include "pccdefs" Addrp putcall(), putcxeq(), putcx1(), realpart(); expptr imagpart(); ftnint lencat(); #define FOUR 4 extern int ops2[]; extern int types2[]; #define P2BUFFMAX 128 static long int p2buff[P2BUFFMAX]; static long int *p2bufp = &p2buff[0]; static long int *p2bufend = &p2buff[P2BUFFMAX]; puthead(s, class) char *s; int class; { char buff[100]; #if TARGET == VAX if(s) p2ps("\t.globl\t_%s", s); #endif /* put out fake copy of left bracket line, to be redone later */ if( ! headerdone ) { #if FAMILY == PCC p2flush(); #endif headoffset = ftell(textfile); prhead(textfile); headerdone = YES; p2triple(P2STMT, (strlen(infname)+FOUR-1)/FOUR, 0); p2str(infname); #if TARGET == PDP11 /* fake jump to start the optimizer */ if(class != CLBLOCK) putgoto( fudgelabel = newlabel() ); #endif #if TARGET == VAX /* jump from top to bottom */ if(s!=CNULL && class!=CLBLOCK) { int proflab = newlabel(); p2ps("_%s:", s); p2pi("\t.word\tLWM%d", procno); prsave(proflab); p2pi("\tjmp\tL%d", fudgelabel = newlabel()); } } } /* It is necessary to precede each procedure with a "left bracket" * line that tells pass 2 how many register variables and how * much automatic space is required for the function. This compiler * does not know how much automatic space is needed until the * entire procedure has been processed. Therefore, "puthead" * is called at the begining to record the current location in textfile, * then to put out a placeholder left bracket line. This procedure * repositions the file and rewrites that line, then puts the * file pointer back to the end of the file. */ putbracket() { long int hereoffset; #if FAMILY == PCC p2flush(); #endif hereoffset = ftell(textfile); if(fseek(textfile, headoffset, 0)) fatal("fseek failed"); prhead(textfile); if(fseek(textfile, hereoffset, 0)) fatal("fseek failed 2"); } putrbrack(k) int k; { p2op(P2RBRACKET, k); } putnreg() { } puteof() { p2op(P2EOF, 0); p2flush(); } putstmt() { p2triple(P2STMT, 0, lineno); } /* put out code for if( ! p) goto l */ putif(p,l) register expptr p; int l; { register int k; if( ( k = (p = fixtype(p))->headblock.vtype) != TYLOGICAL) { if(k != TYERROR) err("non-logical expression in IF statement"); frexpr(p); } else { putex1(p); p2icon( (long int) l , P2INT); p2op(P2CBRANCH, 0); putstmt(); } } /* put out code for goto l */ putgoto(label) int label; { p2triple(P2GOTO, 1, label); putstmt(); } /* branch to address constant or integer variable */ putbranch(p) register Addrp p; { putex1(p); p2op(P2GOTO, P2INT); putstmt(); } /* put out label l: */ putlabel(label) int label; { p2op(P2LABEL, label); } putexpr(p) expptr p; { putex1(p); putstmt(); } putcmgo(index, nlab, labs) expptr index; int nlab; struct Labelblock *labs[]; { int i, labarray, skiplabel; if(! ISINT(index->headblock.vtype) ) { execerr("computed goto index must be integer", CNULL); return; } #if TARGET == VAX /* use special case instruction */ vaxgoto(index, nlab, labs); #else labarray = newlabel(); preven(ALIADDR); prlabel(asmfile, labarray); prcona(asmfile, (ftnint) (skiplabel = newlabel()) ); for(i = 0 ; i < nlab ; ++i) if( labs[i] ) prcona(asmfile, (ftnint)(labs[i]->labelno) ); prcmgoto(index, nlab, skiplabel, labarray); putlabel(skiplabel); #endif } putx(p) expptr p; { char *memname(); int opc; int ncomma; int type, k; switch(p->tag) { case TERROR: free( (charptr) p ); break; case TCONST: switch(type = p->constblock.vtype) { case TYLOGICAL: type = tyint; case TYLONG: case TYSHORT: p2icon(p->constblock.const.ci, types2[type]); free( (charptr) p ); break; case TYADDR: p2triple(P2ICON, 1, P2INT|P2PTR); p2word(0L); p2name(memname(STGCONST, (int) p->constblock.const.ci) ); free( (charptr) p ); break; default: putx( putco((nst(p) ); break; } break; case TEXPR: switch(opc = p->exprblock.opcode) { case OPCALL: case OPCCALL: if( ISCOMPLEX(p->exprblock.vtype) ) putcxop(p); else putcall(p); break; case OPMIN: case OPMAX: putmnmx(p); break; case OPASSIGN: if(ISCOMPLEX(p->exprblock.leftp->headblock.vtype) || ISCOMPLEX(p->exprblock.rightp->headblock.vtype) ) frexpr( putcxeq(p) ); else if( ISCHAR(p) ) putcheq(p); else goto putopp; break; case OPEQ: case OPNE: if( ISCOMPLEX(p->exprblock.leftp->headblock.vtype) || ISCOMPLEX(p->exprblock.rightp->headblock.vtype) ) { putcxcmp(p); break; } case OPLT: case OPLE: case OPGT: case OPGE: if(ISCHAR(p->exprblock.leftp)) { putchcmp(p); break; } goto putopp; case OPPOWER: putpower(p); break; case OPSTAR: #if FAMILY == PCC /* m * (2**k) -> m<exprblock.leftp->headblock.vtype) && ISICON(p->exprblock.rightp) && ( (k = log2(p->exprblock.rightp->constblock.const.ci))>0) ) { p->exprblock.opcode = OPLSHIFT; frexpr(p->exprblock.rightp); p->exprblock.rightp = ICON(k); goto putopp; } #endif case OPMOD: goto putopp; case OPPLUS: case OPMINUS: case OPSLASH: case OPNEG: if( ISCOMPLEX(p->exprblock.vtype) ) putcxop(p); else goto putopp; break; case OPCONV: if( ISCOMPLEX(p->exprblock.vtype) ) putcxop(p); else if( ISCOMPLEX(p->exprblock.leftp->headblock.vtype) ) { ncomma = 0; putx( mkconv(p->exprblock.vtype, realpart(putcx1(p->exprblock.leftp, &ncomma)))); putcomma(ncomma, p->exprblock.vtype, NO); free( (charptr) p ); } else goto putopp; break; case OPNOT: case OPOR: case OPAND: case OPEQV: case OPNEQV: case OPADDR: case OPPLUSEQ: case OPSTAREQ: case OPCOMMA: case OPQUEST: case OPCOLON: case OPBITOR: case OPBITAND: case OPBITXOR: case OPBITNOT: case OPLSHIFT: case OPRSHIFT: putopp: putop(p); break; default: badop("putx", opc); } break; case TADDR: putaddr(p, YES); break; default: badtag("putx", p->tag); } } LOCAL putop(p) expptr p; { int k; expptr lp, tp; int pt, lt; int comma; switch(p->exprblock.opcode) /* check for special cases and rewrite */ { case OPCONV: pt = p->exprblock.vtype; lp = p->exprblock.leftp; lt = lp->headblock.vtype; while(p->tag==TEXPR && p->exprblock.opcode==OPCONV && ( (ISREAL(pt)&&ISREAL(lt)) || (INT(pt)&&(ONEOF(lt,MSKINT|MSKADDR|MSKCHAR|M(TYSUBR)))) )) { #if SZINT < SZLONG if(lp->tag != TEXPR) { if(pt==TYINT && lt==TYLONG) break; if(lt==TYINT && pt==TYLONG) break; } #endif #if TARGET == VAX if(pt==TYDREAL && lt==TYREAL) { if(lp->tag==TEXPR && lp->exprblock.opcode==OPCONV && lp->exprblock.leftp->headblock.vtype==TYDREAL) { putx(lp->exprblock.leftp); p2op(P2CONV, P2REAL); p2op(P2CONV, P2DREAL); free( (charptr) p ); return; } else break; } #endif if(lt==TYCHAR && lp->tag==TEXPR && lp->exprblock.opcode==OPCALL) { p->exprblock.leftp = (expptr) putcall(lp); putop(p); putcomma(1, pt, NO); free( (charptr) p ); return; } free( (charptr) p ); p = lp; pt = lt; lp = p->exprblock.leftp; lt = lp->headblock.vtype; } if(p->tag==TEXPR && p->exprblock.opcode==OPCONV) break; putx(p); return; case OPADDR: comma = NO; lp = p->exprblock.leftp; if(lp->tag != TADDR) { tp = (expptr) mktemp(lp->headblock.vtype,lp->headblock.vleng); putx( mkexpr(OPASSIGN, cpexpr(tp), lp) ); lp = tp; comma = YES; } putaddr(lp, NO); if(comma) putcomma(1, TYINT, NO); free( (charptr) p ); return; #if TARGET == VAX /* take advantage of a glitch in the code generator that does not check the type clash in an assignment or comparison of an integer zero and a floating left operand, and generates optimal code for the correct type. (The PCC has no floating-constant node to encode this correctly.) */ case OPASSIGN: case OPLT: case OPLE: case OPGT: case OPGE: case OPEQ: case OPNE: if(ISREAL(p->exprblock.leftp->headblock.vtype) && ISREAL(p->exprblock.rightp->headblock.vtype) && ISCONST(p->exprblock.rightp) && p->exprblock.rightp->constblock.const.cd[0]==0) { p->exprblock.rightp->constblock.vtype = TYINT; p->exprblock.rightp->constblock.const.ci = 0; } #endif } if( (k = ops2[p->exprblock.opcode]) <= 0) badop("putop", p->exprblock.opcode); putx(p->exprblock.leftp); if(p->exprblock.rightp) putx(p->exprblock.rightp); p2op(k, types2[p->exprblock.vtype]); if(p->exprblock.vleng) frexpr(p->exprblock.vleng); free( (charptr) p ); } putforce(t, p) int t; expptr p; { p = mkconv(t, fixtype(p)); putx(p); p2op(P2FORCE, (t==TYSHORT ? P2SHORT : (t==TYLONG ? P2LONG : P2DREAL)) ); putstmt(); } LOCAL putpower(p) expptr p; { expptr base; Addrp t1, t2; ftnint k; int type; int ncomma; if(!ISICON(p->exprblock.rightp) || (k = p->exprblock.rightp->constblock.const.ci)<2) fatal("putpower: bad call"); base = p->exprblock.leftp; type = base->headblock.vtype; t1 = mktemp(type, PNULL); t2 = NULL; ncomma = 1; putassign(cpexpr(t1), cpexpr(base) ); for( ; (k&1)==0 && k>2 ; k>>=1 ) { ++ncomma; putsteq(t1, t1); } if(k == 2) putx( mkexpr(OPSTAR, cpexpr(t1), cpexpr(t1)) ); else { t2 = mktemp(type, PNULL); ++ncomma; putassign(cpexpr(t2), cpexpr(t1)); for(k>>=1 ; k>1 ; k>>=1) { ++ncomma; putsteq(t1, t1); if(k & 1) { ++ncomma; putsteq(t2, t1); } } putx( mkexpr(OPSTAR, cpexpr(t2), mkexpr(OPSTAR, cpexpr(t1), cpexpr(t1)) )); } putcomma(ncomma, type, NO); frexpr(t1); if(t2) frexpr(t2); frexpr(p); } LOCAL Addrp intdouble(p, ncommap) Addrp p; int *ncommap; { register Addrp t; t = mktemp(TYDREAL, PNULL); ++*ncommap; putassign(cpexpr(t), p); return(t); } LOCAL Addrp putcxeq(p) register expptr p; { register Addrp lp, rp; int ncomma; if(p->tag != TEXPR) badtag("putcxeq", p->tag); ncomma = 0; lp = putcx1(p->exprblock.leftp, &ncomma); rp = putcx1(p->exprblock.rightp, &ncomma); putassign(realpart(lp), realpart(rp)); if( ISCOMPLEX(p->exprblock.vtype) ) { ++ncomma; putassign(imagpart(lp), imagpart(rp)); } putcomma(ncomma, TYREAL, NO); frexpr(rp); free( (charptr) p ); return(lp); } LOCAL putcxop(p) expptr p; { Addrp putcx1(); int ncomma; ncomma = 0; putaddr( putcx1(p, &ncomma), NO); putcomma(ncomma, TYINT, NO); } LOCAL Addrp putcx1(p, ncommap) register expptr p; int *ncommap; { expptr q; Addrp lp, rp; register Addrp resp; int opcode; int ltype, rtype; expptr mkrealcon(); if(p == NULL) return(NULL); switch(p->tag) { case TCONST: if( ISCOMPLEX(p->constblock.vtype) ) p = (expptr) putconst(p); return( (Addrp) p ); case TADDR: if( ! addressable(p) ) { ++*ncommap; resp = mktemp(tyint, PNULL); putassign( cpexpr(resp), p->addrblock.memoffset ); p->addrblock.memoffset = (expptr)resp; } return( (Addrp) p ); case TEXPR: if( ISCOMPLEX(p->exprblock.vtype) ) break; ++*ncommap; resp = mktemp(TYDREAL, NO); putassign( cpexpr(resp), p); return(resp); default: badtag("putcx1", p->tag); } opcode = p->exprblock.opcode; if(opcode==OPCALL || opcode==OPCCALL) { ++*ncommap; return( putcall(p) ); } else if(opcode == OPASSIGN) { ++*ncommap; return( putcxeq(p) ); } resp = mktemp(p->exprblock.vtype, PNULL); if(lp = putcx1(p->exprblock.leftp, ncommap) ) ltype = lp->vtype; if(rp = putcx1(p->exprblock.rightp, ncommap) ) rtype = rp->vtype; switch(opcode) { case OPCOMMA: frexpr(resp); resp = rp; rp = NULL; break; case OPNEG: putassign( realpart(resp), mkexpr(OPNEG, realpart(lp), ENULL) ); putassign( imagpart(resp), mkexpr(OPNEG, imagpart(lp), ENULL) ); *ncommap += 2; break; case OPPLUS: case OPMINUS: putassign( realpart(resp), mkexpr(opcode, realpart(lp), realpart(rp) )); if(rtype < TYCOMPLEX) putassign( imagpart(resp), imagpart(lp) ); else if(ltype < TYCOMPLEX) { if(opcode == OPPLUS) putassign( imagpart(resp), imagpart(rp) ); else putassign( imagpart(resp), mkexpr(OPNEG, imagpart(rp), ENULL) ); } else putassign( imagpart(resp), mkexpr(opcode, imagpart(lp), imagpart(rp) )); *ncommap += 2; break; case OPSTAR: if(ltype < TYCOMPLEX) { if( ISINT(ltype) ) lp = intdouble(lp, ncommap); putassign( realpart(resp), mkexpr(OPSTAR, cpexpr(lp), realpart(rp) )); putassign( imagpart(resp), mkexpr(OPSTAR, cpexpr(lp), imagpart(rp) )); } else if(rtype < TYCOMPLEX) { if( ISINT(rtype) ) rp = intdouble(rp, ncommap); putassign( realpart(resp), mkexpr(OPSTAR, cpexpr(rp), realpart(lp) )); putassign( imagpart(resp), mkexpr(OPSTAR, cpexpr(rp), imagpart(lp) )); } else { putassign( realpart(resp), mkexpr(OPMINUS, mkexpr(OPSTAR, realpart(lp), realpart(rp)), mkexpr(OPSTAR, imagpart(lp), imagpart(rp)) )); putassign( imagpart(resp), mkexpr(OPPLUS, mkexpr(OPSTAR, realpart(lp), imagpart(rp)), mkexpr(OPSTAR, imagpart(lp), realpart(rp)) )); } *ncommap += 2; break; case OPSLASH: /* fixexpr has already replaced all divisions * by a complex by a function call */ if( ISINT(rtype) ) rp = intdouble(rp, ncommap); putassign( realpart(resp), mkexpr(OPSLASH, realpart(lp), cpexpr(rp)) ); putassign( imagpart(resp), mkexpr(OPSLASH, imagpart(lp), cpexpr(rp)) ); *ncommap += 2; break; case OPCONV: putassign( realpart(resp), realpart(lp) ); if( ISCOMPLEX(lp->vtype) ) q = imagpart(lp); else if(rp != NULL) q = (expptr) realpart(rp); else q = mkrealcon(TYDREAL, 0.0); putassign( imagpart(resp), q); *ncommap += 2; break; default: badop("putcx1", opcode); } frexpr(lp); frexpr(rp); free( (charptr) p ); return(resp); } LOCAL putcxcmp(p) register expptr p; { int opcode; int ncomma; register Addrp lp, rp; expptr q; if(p->tag != TEXPR) badtag("putcxcmp", p->tag); ncomma = 0; opcode = p->exprblock.opcode; lp = putcx1(p->exprblock.leftp, &ncomma); rp =(( putcx1(p->exprblock.rightp, &ncomma); q = mkexpr( opcode==OPEQ ? OPAND : OPOR , mkexpr(opcode, realpart(lp), realpart(rp)), mkexpr(opcode, imagpart(lp), imagpart(rp)) ); putx( fixexpr(q) ); putcomma(ncomma, TYINT, NO); free( (charptr) lp); free( (charptr) rp); free( (charptr) p ); } LOCAL Addrp putch1(p, ncommap) register expptr p; int * ncommap; { register Addrp t; Addrp mktemp(); Addrp putconst(); switch(p->tag) { case TCONST: return( putconst(p) ); case TADDR: return( (Addrp) p ); case TEXPR: ++*ncommap; switch(p->exprblock.opcode) { expptr q; case OPCALL: case OPCCALL: t = putcall(p); break; case OPCONCAT: t = mktemp(TYCHAR, ICON(lencat(p)) ); q = (expptr) cpexpr(p->headblock.vleng); putcat( cpexpr(t), p ); /* put the correct length on the block */ frexpr(t->vleng); t->vleng = q; break; case OPCONV: if(!ISICON(p->exprblock.vleng) || p->exprblock.vleng->constblock.const.ci!=1 || ! INT(p->exprblock.leftp->headblock.vtype) ) fatal("putch1: bad character conversion"); t = mktemp(TYCHAR, ICON(1) ); putop( mkexpr(OPASSIGN, cpexpr(t), p) ); break; default: badop("putch1", p->exprblock.opcode); } return(t); default: badtag("putch1", p->tag); } /* NOTREACHED */ } LOCAL putchop(p) expptr p; { int ncomma; ncomma = 0; putaddr( putch1(p, &ncomma) , NO ); putcomma(ncomma, TYCHAR, YES); } LOCAL putcheq(p) register expptr p; { int ncomma; expptr lp, rp; if(p->tag != TEXPR) badtag("putcheq", p->tag); ncomma = 0; lp = p->exprblock.leftp; rp = p->exprblock.rightp; if( rp->tag==TEXPR && rp->exprblock.opcode==OPCONCAT ) putcat(lp, rp); else if( ISONE(lp->headblock.vleng) && ISONE(rp->headblock.vleng) ) { putaddr( putch1(lp, &ncomma) , YES ); putaddr( putch1(rp, &ncomma) , YES ); putcomma(ncomma, TYINT, NO); p2op(P2ASSIGN, P2CHAR); } else { putx( call2(TYINT, "s_copy", lp, rp) ); putcomma(ncomma, TYINT, NO); } frexpr(p->exprblock.vleng); free( (charptr) p ); } LOCAL putchcmp(p) register expptr p; { int ncomma; expptr lp, rp; if(p->tag != TEXPR) badtag("putchcmp", p->tag); ncomma = 0; lp = p->exprblock.leftp; rp = p->exprblock.rightp; if(ISONE(lp->headblock.vleng) && ISONE(rp->headblock.vleng) ) { putaddr( putch1(lp, &ncomma) , YES ); putaddr( putch1(rp, &ncomma) , YES ); p2op(ops2[p->exprblock.opcode], P2CHAR); free( (charptr) p ); putcomma(ncomma, TYINT, NO); } else { p->exprblock.leftp = call2(TYINT,"s_cmp", lp, rp); p->exprblock.rightp = ICON(0); putop(p); } } LOCAL putcat(lhs, rhs) register Addrp lhs; register expptr rhs; { int n, ncomma; Addrp lp, cp; ncomma = 0; n = ncat(rhs); lp = mktmpn(n, TYLENG, PNULL); cp = mktmpn(n, TYADDR, PNULL); n = 0; putct1(rhs, lp, cp, &n, &ncomma); putx( call4(TYSUBR, "s_cat", lhs, cp, lp, mkconv(TYLONG, ICON(n)) ) ); putcomma(ncomma, TYINT, NO); } LOCAL putct1(q, lp, cp, ip, ncommap) register expptr q; register Addrp lp, cp; int *ip, *ncommap; { int i; Addrp lp1, cp1; if(q->tag==TEXPR && q->exprblock.opcode==OPCONCAT) { putct1(q->exprblock.leftp, lp, cp, ip, ncommap); putct1(q->exprblock.rightp, lp, cp , ip, ncommap); frexpr(q->exprblock.vleng); free( (charptr) q ); } else { i = (*ip)++; lp1 = (Addrp) cpexpr(lp); lp1->memoffset = mkexpr(OPPLUS,lp1->memoffset, ICON(i*SZLENG)); cp1 = (Addrp) cpexpr(cp); cp1->memoffset = mkexpr(OPPLUS, cp1->memoffset, ICON(i*SZADDR)); putassign( lp1, cpexpr(q->headblock.vleng) ); putassign( cp1, addrof(putch1(q,ncommap)) ); *ncommap += 2; } } LOCAL putaddr(p, indir) register Addrp p; int indir; { int type, type2, funct; ftnint offset, simoffset(); expptr offp, shorten(); if( p->tag==TERROR || (p->memoffset!=NULL && ISERROR(p->memoffset)) ) { frexpr(p); return; } type = p->vtype; type2 = types2[type]; funct = (p->vclass==CLPROC ? P2FUNCT<<2 : 0); offp = (p->memoffset ? (expptr) cpexpr(p->memoffset) : (expptr)NULL ); #if (FUDGEOFFSET != 1) if(offp) offp = mkexpr(OPSTAR, ICON(FUDGEOFFSET), offp); #endif offset = simoffset( &offp ); #if SZINT < SZLONG if(offp) if(shortsubs) offp = shorten(offp); else offp = mkconv(TYINT, offp); #else if(offp) offp = mkconv(TYINT, offp); #endif switch(p->vstg) { case STGAUTO: if(indir && !offp) { p2oreg(offset, AUTOREG, type2); break; } if(!indir && !offp && !offset) { p2reg(AUTOREG, type2 | P2PTR); break; } p2reg(AUTOREG, type2 | P2PTR); if(offp) { putx(offp); if(offset) p2icon(offset, P2INT); } else p2icon(offset, P2INT); if(offp && offset) p2op(P2PLUS, type2 | P2PTR); p2op(P2PLUS, type2 | P2PTR); if(indir) p2op(P2INDIRECT, type2); break; case STGARG: p2oreg( #ifdef ARGOFFSET ARGOFFSET + #endif (ftnint) (FUDGEOFFSET*p->memno), ARGREG, type2 | P2PTR | funct ); based: if(offp) putx(offp); if(offset) { p2icon(offset, P2INT); p2op(P2PLUS, type2 | P2PTR); } if(offp) p2op(P2PLUS, type2 | P2PTR); if(indir) p2op(P2INDIRECT, type2); break; case STGLENG: if(indir) { p2oreg( #ifdef ARGOFFSET ARGOFFSET + #endif (ftnint) (FUDGEOFFSET*p->memno), ARGREG, type2 ); } else { p2reg(ARGREG, type2 | P2PTR ); p2icon( #ifdef ARGOFFSET ARGOFFSET + #endif (ftnint) (FUDGEOFFSET*p->memno), P2INT); p2op(P2PLUS, type2 | P2PTR ); } break; case STGBSS: case STGINIT: case STGEXT: case STGCOMMON: case STGEQUIV: case STGCONST: if(offp) { putx(offp); putmem(p, P2ICON, offset); p2op(P2PLUS, type2 | P2PTR); if(indir) p2op(P2INDIRECT, type2); } else putmem(p, (indir ? P2NAME : P2ICON), offset); break; case STGREG: if(indir) p2reg(p->memno, type2); else fatal("attempt to take address of a register"); break; /* for possible future use -- register based arrays case STGPREG: if(indir && !offp) p2oreg(offset, p->memno, type2); else { p2reg(p->memno, type2 | P2PTR); goto based; } break; */ default: badstg("putaddr", p->vstg); } frexpr(p); } LOCAL putmem(p, class, offset) expptr p; int class; ftnint offset; { int type2; int funct; char *name, *memname(); funct = (p->headblock.vclass==CLPROC ? P2FUNCT<<2 : 0); type2 = types2[p->headblock.vtype]; if(p->headblock.vclass == CLPROC) type2 |= (P2FUNCT<<2); name = memname(p->addrblock.vstg, p->addrblock.memno); if(class == P2ICON) { p2triple(P2ICON, name[0]!='\0', type2|P2PTR); p2word(offset); if(name[0]) p2name(name); } else { p2triple(P2NAME, offset!=0, type2); if(offset != 0) p2word(offset); p2name(name); } } LOCAL Addrp putcall(p) register Exprp p; { chainp arglist, charsp, cp; int n, first; Addrp t; register expptr q; Addrp fval; int type, type2, ctype, qtype, indir; type2 = types2[type = p->vtype]; charsp = NULL; indir = (p->opcode == OPCCALL); n = 0; first = YES; if(p->rightp) { arglist = p->rightp->listblock.listp; free( (charptr) (p->rightp) ); } else arglist = NULL; for(cp = arglist ; cp ; cp = cp->nextp) if(indir) ++n; else { q = (expptr) (cp->datap); if( ISCONST(q) ) { q = (expptr) putconst(q); cp->datap = (tagptr) q; } if( ISCHAR(q) && q->headblock.vclass!=CLPROC ) { charsp = hookup(charsp, mkchain(cpexpr(q->headblock.vleng), CHNULL)); n += 2; } else n += 1; } if(type == TYCHAR) { if( ISICON(p->vleng) ) { fval = mktemp(TYCHAR, p->vleng); n += 2; } else { err("adjustable character function"); return; } } else if( ISCOMPLEX(type) ) { fval = mktemp(type, PNULL); n += 1; } else fval = NULL; ctype = (fval ? P2INT : type2); putaddr(p->leftp, NO); if(fval) { first = NO; putaddr( cpexpr(fval), NO); if(type==TYCHAR) { putx( mkconv(TYLENG,p->vleng) ); p2op(P2LISTOP, type2); } } for(cp = arglist ; cp ; cp = cp->nextp) { q = (expptr) (cp->datap); if(q->tag==TADDR && (indir || q->addrblock.vstg!=STGREG) ) putaddr(q, indir && q->addrblock.vtype!=TYCHAR); else if( ISCOMPLEX(q->headblock.vtype) ) putcxop(q); else if (ISCHAR(q) ) putchop(q); else if( ! ISERROR(q) ) { if(indir) putx(q); else { t = mktemp(qtype = q->headblock.vtype, q->headblock.vleng); putassign( cpexpr(t), q ); putaddr(t, NO); putcomma(1, qtype, YES); } } if(first) first = NO; else p2op(P2LISTOP, type2); } if(arglist) frchain(&arglist); for(cp = charsp ; cp ; cp = cp->nextp) { putx( mkconv(TYLENG,cp->datap) ); p2op(P2LISTOP, type2); } frchain(&charsp); p2op(n>0 ? P2CALL : P2CALL0 , ctype); free( (charptr) p ); return(fval); } LOCAL putmnmx(p) register expptr p; { int op, type; int ncomma; expptr qp; chainp p0, p1; Addrp sp, tp; if(p->tag != TEXPR) badtag("putmnmx", p->tag); type = p->exprblock.vtype; op = (p->exprblock.opcode==OPMIN ? OPLT : OPGT ); p0 = p->exprblock.leftp->listblock.listp; free( (charptr) (p->exprblock.leftp) ); free( (charptr) p ); sp = mktemp(type, PNULL); tp = mktemp(type, PNULL); qp = mkexpr(OPCOLON, cpexpr(tp), cpexpr(sp)); qp = mkexpr(OPQUEST, mkexpr(op, cpexpr(tp),cpexpr(sp)), qp); qp = fixexpr(qp); ncomma = 1; putassign( cpexpr(sp), p0->datap ); for(p1 = p0->nextp ; p1 ; p1 = p1->nextp) { ++ncomma; putassign( cpexpr(tp), p1->datap ); if(p1->nextp) { ++ncomma; putassign( cpexpr(sp), cpexpr(qp) ); } else putx(qp); } putcomma(ncomma, type, NO); frtemp(sp); frtemp(tp); frchain( &p0 ); } LOCAL putcomma(n, type, indir) int n, type, indir; { type = types2[type]; if(indir) type |= P2PTR; while(--n >= 0) p2op(P2COMOP, type); } ftnint simoffset(p0) expptr *p0; { ftnint offset, prod; register expptr p, lp, rp; offset = 0; p = *p0; if(p == NULL) return(0); if( ! ISINT(p->headblock.vtype) ) return(0); if(p->tag==TEXPR && p->exprblock.opcode==OPSTAR) { lp = p->exprblock.leftp; rp = p->exprblock.rightp; if(ISICON(rp) && lp->tag==TEXPR && lp->exprblock.opcode==OPPLUS && ISICON(lp->exprblock.rightp)) { p->exprblock.opcode = OPPLUS; lp->exprblock.opcode = OPSTAR; prod = rp->constblock.const.ci * lp->exprblock.rightp->constblock.const.ci; lp->exprblock.rightp->constblock.const.ci = rp->constblock.const.ci; rp->constblock.const.ci = prod; } } if(p->tag==TEXPR && p->exprblock((.opcode==OPPLUS && ISICON(p->exprblock.rightp)) { rp = p->exprblock.rightp; lp = p->exprblock.leftp; offset += rp->constblock.const.ci; frexpr(rp); free( (charptr) p ); *p0 = lp; } if( ISCONST(p) ) { offset += p->constblock.const.ci; frexpr(p); *p0 = NULL; } return(offset); } p2op(op, type) int op, type; { p2triple(op, 0, type); } p2icon(offset, type) ftnint offset; int type; { p2triple(P2ICON, 0, type); p2word(offset); } p2oreg(offset, reg, type) ftnint offset; int reg, type; { p2triple(P2OREG, reg, type); p2word(offset); p2name(""); } p2reg(reg, type) int reg, type; { p2triple(P2REG, reg, type); } p2pi(s, i) char *s; int i; { char buff[100]; sprintf(buff, s, i); p2pass(buff); } p2pij(s, i, j) char *s; int i, j; { char buff[100]; sprintf(buff, s, i, j); p2pass(buff); } p2ps(s, t) char *s, *t; { char buff[100]; sprintf(buff, s, t); p2pass(buff); } p2pass(s) char *s; { p2triple(P2PASS, (strlen(s) + FOUR-1)/FOUR, 0); p2str(s); } p2str(s) register char *s; { union { long int word; char str[FOUR]; } u; register int i; i = 0; u.word = 0; while(*s) { u.str[i++] = *s++; if(i == FOUR) { p2word(u.word); u.word = 0; i = 0; } } if(i > 0) p2word(u.word); } p2triple(op, var, type) int op, var, type; { register long word; word = op | (var<<8); word |= ( (long int) type) <<16; p2word(word); } p2name(s) register char *s; { register int i; #ifdef UCBPASS2 /* arbitrary length names, terminated by a null, padded to a full word */ # define WL sizeof(long int) union { long int word; char str[WL]; } w; w.word = 0; i = 0; while(w.str[i++] = *s++) if(i == WL) { p2word(w.word); w.word = 0; i = 0; } if(i > 0) p2word(w.word); #else /* standard intermediate, names are 8 characters long */ union { long int word[2]; char str[8]; } u; u.word[0] = u.word[1] = 0; for(i = 0 ; i<8 && *s ; ++i) u.str[i] = *s++; p2word(u.word[0]); p2word(u.word[1]); #endif } p2word(w) long int w; { *p2bufp++ = w; if(p2bufp >= p2bufend) p2flush(); } p2flush() { if(p2bufp > p2buff) write(fileno(textfile), p2buff, (p2bufp-p2buff)*sizeof(long int)); p2bufp = p2buff; } w.word); w.word = 0; i = 0; } if(i > 0) p2word(w.word); #else /* standard intermediate, names are 8 characters long */ union { long int word[2]; char str[8]; } u; u.word[0] = u.word[1] = 0; for(i = 0 ; i<8 && *s ; ++i) u.str[i] = *s++; p2word(u.word[0]); p2word(u.word[1]); #endif } p2word(w) long int w; { *p2bufp++ = w; if(p2bufp >= p2bufend) cmd/f77/vax.c 644 0 33 21464 2477607045 6205 #include "defs" #ifdef SDB # include extern int types2[]; # ifndef N_SO # include # endif #endif #include "pccdefs" /* VAX-11/780 - SPECIFIC ROUTINES */ int maxregvar = MAXREGVAR; int regnum[] = { 11, 10, 9, 8, 7, 6 } ; static int regmask[] = { 0, 0x800, 0xc00, 0xe00, 0xf00, 0xf80, 0xfc0 }; ftnint intcon[14] = { 2, 2, 2, 2, 15, 31, 24, 56, -128, -128, 127, 127, 32767, 2147483647 }; #if HERE == VAX /* then put in constants in octal */ long realcon[6][2] = { { 0200, 0 }, { 0200, 0 }, { 037777677777, 0 }, { 037777677777, 037777777777 }, { 032200, 0 }, { 022200, 0 } }; #else double realcon[6] = { 2.9387358771e-39, 2.938735877055718800e-39 1.7014117332e+38, 1.701411834604692250e+38 5.960464e-8, 1.38777878078144567e-17, }; #endif prsave(proflab) int proflab; { if(profileflag) { fprintf(asmfile, "L%d:\t.space\t4\n", proflab); p2pi("\tmovab\tL%d,r0", proflab); p2pass("\tjsb\tmcount"); } p2pi("\tsubl2\t$LF%d,sp", procno); } goret(type) int type; { p2pass("\tret"); } /* * move argument slot arg1 (relative to ap) * to slot arg2 (relative to ARGREG) */ mvarg(type, arg1, arg2) int type, arg1, arg2; { p2pij("\tmovl\t%d(ap),%d(fp)", arg1+ARGOFFSET, arg2+argloc); } prlabel(fp, k) FILEP fp; int k; { fprintf(fp, "L%d:\n", k); } prconi(fp, type, n) FILEP fp; int type; ftnint n; { fprintf(fp, "\t%s\t%ld\n", (type==TYSHORT ? ".word" : ".long"), n); } prcona(fp, a) FILEP fp; ftnint a; { fprintf(fp, "\t.long\tL%ld\n", a); } #ifndef vax prconr(fp, type, x) FILEP fp; int type; float x; { fprintf(fp, "\t%s\t0f%e\n", (type==TYREAL ? ".float" : ".double"), x); } #endif #ifdef vax prconr(fp, type, x) FILEP fp; int type; double x; { /* non-portable cheat to preserve bit patterns */ union { double xd; long int xl[2]; } cheat; cheat.xd = x; if(type == TYREAL) {float y = x; fprintf(fp, "\t.long\t0x%X\n", *(long *) &y); } else fprintf(fp, "\t.long\t0x%X,0x%X\n", cheat.xl[0], cheat.xl[1]); } #endif praddr(fp, stg, varno, offset) FILE *fp; int stg, varno; ftnint offset; { char *memname(); if(stg == STGNULL) fprintf(fp, "\t.long\t0\n"); else { fprintf(fp, "\t.long\t%s", memname(stg,varno)); if(offset) fprintf(fp, "+%ld", offset); fprintf(fp, "\n"); } } preven(k) int k; { register int lg; if(k > 4) lg = 3; else if(k > 2) lg = 2; else if(k > 1) lg = 1; else return; fprintf(asmfile, "\t.align\t%d\n", lg); } vaxgoto(index, nlab, labs) expptr index; register int nlab; struct Labelblock *labs[]; { register int i; register int arrlab; putforce(TYINT, index); p2pi("\tcasel\tr0,$1,$%d", nlab-1); p2pi("L%d:", arrlab = newlabel() ); for(i = 0; i< nlab ; ++i) if( labs[i] ) p2pij("\t.word\tL%d-L%d", labs[i]->labelno, arrlab); } prarif(p, neg, zer, pos) expptr p; int neg, zer, pos; { putforce(p->headblock.vtype, p); if( ISINT(p->headblock.vtype) ) p2pass("\ttstl\tr0"); else p2pass("\ttstd\tr0"); p2pi("\tjlss\tL%d", neg); p2pi("\tjeql\tL%d", zer); p2pi("\tjbr\tL%d", pos); } char *memname(stg, mem) int stg, mem; { static char s[20]; switch(stg) { case STGCOMMON: case STGEXT: sprintf(s, "_%s", varstr(XL, extsymtab[mem].extname) ); break; case STGBSS: case STGINIT: sprintf(s, "v.%d", mem); break; case STGCONST: sprintf(s, "L%d", mem); break; case STGEQUIV: sprintf(s, "q.%d", mem+eqvstart); break; default: badstg("memname", stg); } return(s); } prlocvar(s, len) char *s; ftnint len; { fprintf(asmfile, "\t.lcomm\t%s,%ld\n", s, len); } prext(name, leng, init) char *name; ftnint leng; int init; { if(leng == 0) fprintf(asmfile, "\t.globl\t_%s\n", name); else fprintf(asmfile, "\t.comm\t_%s,%ld\n", name, leng); } prendproc() { } prtail() { } prolog(ep, argvec) struct Entrypoint *ep; Addrp argvec; { int i, argslot, proflab; int size; register chainp p; register Namep q; register struct Dimblock *dp; expptr tp; p2pass("\t.align\t1"); if(procclass == CLMAIN) { if(fudgelabel) { if(ep->entryname) { p2ps("_%s:", varstr(XL, ep->entryname->extname)); p2pi("\t.word\tLWM%d", procno); } putlabel(fudgelabel); fudgelabel = 0; fixlwm(); } else { p2pass( "_MAIN__:" ); if(ep->entryname == NULL) p2pi("\t.word\tLWM%d", procno); } } else if(ep->entryname) if(fudgelabel) { putlabel(fudgelabel); fudgelabel = 0; fixlwm(); } else { p2ps("_%s:", varstr(XL, ep->entryname->extname)); p2pi("\t.word\tLWM%d", procno); prsave(newlabel()); } if(procclass == CLBLOCK) return; if(argvec) { argloc = argvec->memoffset->constblock.const.ci + SZINT; /* first slot holds count */ if(proctype == TYCHAR) { mvarg(TYADDR, 0, chslot); mvarg(TYLENG, SZADDR, chlgslot); argslot = SZADDR + SZLENG; } else if( ISCOMPLEX(proctype) ) { mvarg(TYADDR, 0, cxslot); argslot = SZADDR; } else argslot = 0; for(p = ep->arglist ; p ; p =p->nextp) { q = (Namep) (p->datap); mvarg(TYADDR, argslot, q->vardesc.varno); argslot += SZADDR; } for(p = ep->arglist ; p ; p = p->nextp) { q = (Namep) (p->datap); if(q->vtype==TYCHAR && q->vclass!=CLPROC) { if(q->vleng && ! ISCONST(q->vleng) ) mvarg(TYLENG, argslot, q->vleng->addrblock.memno); argslot += SZLENG; } } p2pi("\taddl3\t$%d,fp,ap", argloc-ARGOFFSET); p2pi("\tmovl\t$%d,(ap)\n", lastargslot/SZADDR); } for(p = ep->arglist ; p ; p = p->nextp) { q = (Namep) (p->datap); if(dp = q->vdim) { for(i = 0 ; i < dp->ndim ; ++i) if(dp->dims[i].dimexpr) puteq( fixtype(cpexpr(dp->dims[i].dimsize)), fixtype(cpexpr(dp->dims[i].dimexpr))); size = typesize[ q->vtype ]; if(q->vtype == TYCHAR) if( ISICON(q->vleng) ) size *= q->vleng->constblock.const.ci; else size = -1; /* on VAX, get more efficient subscripting if subscripts have zero-base, so fudge the argument pointers for arrays. Not done if array bounds are being checked. */ if(dp->basexpr) puteq( cpexpr(fixtype(dp->baseoffset)), cpexpr(fixtype(dp->basexpr))); if(! checksubs) { if(dp->basexpr) { if(size > 0) tp = (expptr) ICON(size); else tp = (expptr) cpexpr(q->vleng); putforce(TYINT, fixtype( mkexpr(OPSTAR, tp, cpexpr(dp->baseoffset)) )); p2pi("\tsubl2\tr0,%d(ap)", p->datap->nameblock.vardesc.varno + ARGOFFSET); } else if(dp->baseoffset->constblock.const.ci != 0) { char buff[25]; if(size > 0) { sprintf(buff, "\tsubl2\t$%ld,%d(ap)", dp->baseoffset->constblock.const.ci * size, p->datap->nameblock.vardesc.varno + ARGOFFSET); } else { putforce(TYINT, mkexpr(OPSTAR, cpexpr(dp->baseoffset), cpexpr(q->vleng) )); sprintf(buff, "\tsubl2\tr0,%d(ap)", p->datap->nameblock.vardesc.varno + ARGOFFSET); } p2pass(buff); } } } } if(typeaddr) puteq( cpexpr(typeaddr), mkaddcon(ep->typelabel) ); /* replace to avoid long jump problem putgoto(ep->entrylabel); */ p2pi("\tjmp\tL%d", ep->entrylabel); } fixlwm() { extern lwmno; if (lwmno == procno) return; fprintf(asmfile, "\t.set\tLWM%d,0x%x\n", procno, regmask[highregvar]); lwmno = procno; } ((prhead(fp) FILEP fp; { #if FAMILY==PCC p2triple(P2LBRACKET, ARGREG-highregvar, procno); p2word( (long) (BITSPERCHAR*autoleng) ); p2flush(); #endif } prdbginfo() { } #ifdef SDB # ifdef UCBVAXASM char *stabdline(code, type) int code; int type; { static char buff[30]; sprintf(buff, "\t.stabd\t0%o,0,0%o\n", code, type); return(buff); } # endif prstab(s, code, type, loc) char *s, *loc; int code, type; { char * stabline(); if(sdbflag) fprintf(asmfile, stabline(s,code,type,loc) ); } char *stabline(s, code, type, loc) register char *s; int code; int type; char *loc; { static char buff[512] = "\t.stab\t\t"; register char *t; register int i = 0; #ifdef UCBVAXASM t = buff + 8; if(s == NULL) buff[6] = 'n'; /* .stabn line */ else { buff[6] = 's'; /* .stabs line */ *t++ = '"'; while(*s!='\0' && *s!=' ') { #ifndef UCBPASS2 if (i == 8) break; #endif *t++ = *s++; ++i; } *t++ = '"'; *t++ = ','; } #else t = buff + 7; if(s) while( *s!='\0' && *s!=' ' && i<8 ) { *t++ = '\''; *t++ = *s++; *t++ = ','; ++i; } for( ; i<8 ; ++i) { *t++ = '0'; *t++ = ','; } #endif sprintf(t, "0%o,0,0%o,%s\n", code, type, (loc? loc : "0") ); return(buff); } prstleng(np, leng) register Namep np; ftnint leng; { ftnint iarrlen(); prstab( varstr(VL,np->varname), N_LENG, 0, convic(leng) ); } stabtype(p) register Namep p; { register int type; register int shift; type = types2[p->vtype]; if(p->vdim) { type |= 060; /* .stab code for array */ shift = 2; } else if(p->vclass == CLPROC) { type |= 040; /* .stab code for function */ shift = 2; } else shift = 0; if(p->vstg == STGARG) type |= (020 << shift); /* code for pointer-to */ return(type); } prstssym(np) register Namep np; { prstab(varstr(VL,np->varname), N_SSYM, stabtype(np), convic(np->voffset) ); } #endif convic(leng) ); } stabtype(p) register Namep p; { register int type; register int shift; type = types2[p->vtype]; if(p->vdim) { type |= 060; /* .stab code for array */ shift = 2; } else if(p->vclacmd/graph/ 775 0 33 0 2552545102 5614 cmd/graph/Makefile 644 0 33 235 2254256615 7326 CFLAGS=-O graph: graph.c cc $(CFLAGS) -o graph graph.c /usr/lib/libplot.a -lm install: graph install -s graph $(DESTDIR)/usr/bin clean: rm -f *.o graph ter02552545102rn(typ< a9ssym00000005614r Namep np; { prstab(varstr(VL,np->varname), N_SSYM, stabtype(np), convic(np->voffset) ); } #endif convic(leng) ); } stabtype(p) register Namep p; { register int type; register int sh type = / C. /,"cmd/graph/graph.c 644 0 33 25040 2111463452 7163 #include #include #include #define INF 1.e+37 #define F .25 struct xy { int xlbf; /*flag:explicit lower bound*/ int xubf; /*flag:explicit upper bound*/ int xqf; /*flag:explicit quantum*/ double (*xf)(); /*transform function, e.g. log*/ float xa,xb; /*scaling coefficients*/ float xlb,xub; /*lower and upper bound*/ float xquant; /*quantum*/ float xoff; /*screen offset fraction*/ float xsize; /*screen fraction*/ int xbot,xtop; /*screen coords of border*/ float xmult; /*scaling constant*/ } xd,yd; struct val { float xv; float yv; int lblptr; } *xx; char *labs; int labsiz; int tick = 50; int top = 4000; int bot = 200; float absbot; int n; int erasf = 1; int gridf = 2; int symbf = 0; int absf = 0; int transf; int brkf; float dx; char *plotsymb; double atof(); #define BSIZ 80 char labbuf[BSIZ]; char titlebuf[BSIZ]; char *modes[] = { "disconnected", "solid", "dotted", "dotdashed", "shortdashed", "longdashed" }; int mode = 1; char *realloc(); char *malloc(); double ident(x) double x; { return(x); } main(argc,argv) char *argv[]; { space(0,0,4096,4096); init(&xd); init(&yd); xd.xsize = yd.xsize = 1.; xx = (struct val *)malloc((unsigned)sizeof(struct val)); labs = malloc(1); labs[labsiz++] = 0; setopt(argc,argv); if(erasf) erase(); readin(); transpose(); scale(&xd,(struct val *)&xx->xv); scale(&yd,(struct val *)&xx->yv); axes(); title(); plot(); move(1,1); closevt(); return(0); } init(p) struct xy *p; { p->xf = ident; p->xmult = 1; } setopt(argc,argv) char *argv[]; { char *p1, *p2; float temp; xd.xlb = yd.xlb = INF; xd.xub = yd.xub = -INF; while(--argc > 0) { argv++; again: switch(argv[0][0]) { case '-': argv[0]++; goto again; case 'l': /* label for plot */ p1 = titlebuf; if (argc>=2) { argv++; argc--; p2 = argv[0]; while (*p1++ = *p2++); } break; case 'd': /*disconnected,obsolete option*/ case 'm': /*line mode*/ mode = 0; if(!numb(&temp,&argc,&argv)) break; if(temp>=sizeof(modes)/sizeof(*modes)) mode = 1; else if(temp>=0) mode = temp; break; case 'a': /*automatic abscissas*/ absf = 1; dx = 1; if(!numb(&dx,&argc,&argv)) break; if(numb(&absbot,&argc,&argv)) absf = 2; break; case 's': /*save screen, overlay plot*/ erasf = 0; break; case 'g': /*grid style 0 none, 1 ticks, 2 full*/ gridf = 0; if(!numb(&temp,&argc,&argv)) temp = argv[0][1]-'0'; /*for caompatibility*/ if(temp>=0&&temp<=2) gridf = temp; break; case 'c': /*character(s) for plotting*/ if(argc >= 2) { symbf = 1; plotsymb = argv[1]; argv++; argc--; } break; case 't': /*transpose*/ transf = 1; break; case 'b': /*breaks*/ brkf = 1; break; case 'x': /*x limits */ limread(&xd,&argc,&argv); break; case 'y': limread(&yd,&argc,&argv); break; case 'h': /*set height of plot */ if(!numb(&yd.xsize, &argc,&argv)) badarg(); break; case 'w': /*set width of plot */ if(!numb(&xd.xsize, &argc, &argv)) badarg(); break; case 'r': /* set offset to right */ if(!numb(&xd.xoff, &argc, &argv)) badarg(); break; case 'u': /*set offset up the screen*/ if(!numb(&yd.xoff,&argc,&argv)) badarg(); break; default: badarg(); } } } limread(p, argcp, argvp) register struct xy *p; int *argcp; char ***argvp; { if(*argcp>1 && (*argvp)[1][0]=='l') { (*argcp)--; (*argvp)++; p->xf = log10; } if(!numb(&p->xlb,argcp,argvp)) return; p->xlbf = 1; if(!numb(&p->xub,argcp,argvp)) return; p->xubf = 1; if(!numb(&p->xquant,argcp,argvp)) return; p->xqf = 1; } numb(np, argcp, argvp) int *argcp; float *np; register char ***argvp; { register char c; if(*argcp <= 1) return(0); while((c=(*argvp)[1][0]) == '+') (*argvp)[1]++; if(!(isdigit(c) || c=='-'&&(*argvp)[1][1]<'A' || c=='.')) return(0); *np = atof((*argvp)[1]); (*argcp)--; (*argvp)++; return(1); } readin() { register t; struct val *temp; if(absf==1) { if(xd.xlbf) absbot = xd.xlb; else if(xd.xf==log10) absbot = 1; } for(;;) { temp = (struct val *)realloc((char*)xx, (unsigned)(n+1)*sizeof(struct val)); if(temp==0) return; xx = temp; if(absf) xx[n].xv = n*dx + absbot; else if(!getfloat(&xx[n].xv)) return; if(!getfloat(&xx[n].yv)) return; xx[n].lblptr = -1; t = getstring(); if(t>0) xx[n].lblptr = copystring(t); n++; if(t<0) return; } } transpose() { register i; float f; struct xy t; if(!transf) return; t = xd; xd = yd; yd = t; for(i= 0;ixlbf && p->xlb>v[i].xv) p->xlb = v[i].xv; if(!p->xubf && p->xubxub = v[i].xv; i++; } while(i < n); } struct z { float lb,ub,mult,quant; } setloglim(), setlinlim(); setlim(p) register struct xy *p; { float t,delta,sign; struct z z; int mark[50]; float lb,ub; int lbf,ubf; lb = p->xlb; ub = p->xub; delta = ub-lb; if(p->xqf) { if(delta*p->xquant <=0 ) badarg(); return; } sign = 1; lbf = p->xlbf; ubf = p->xubf; if(delta < 0) { sign = -1; t = lb; lb = ub; ub = t; t = lbf; lbf = ubf; ubf = t; } else if(delta == 0) { if(ub > 0) { ub = 2*ub; lb = 0; } else if(lb < 0) { lb = 2*lb; ub = 0; } else { ub = 1; lb = -1; } } if(p->xf==log10 && lb>0 && ub>lb) { z = setloglim(lbf,ubf,lb,ub); p->xlb = z.lb; p->xub = z.ub; p->xmult *= z.mult; p->xquant = z.quant; if(setmark(mark,p)<2) { p->xqf = lbf = ubf = 1; lb = z.lb; ub = z.ub; } else return; } z = setlinlim(lbf,ubf,lb,ub); if(sign > ((0) { p->xlb = z.lb; p->xub = z.ub; } else { p->xlb = z.ub; p->xub = z.lb; } p->xmult *= z.mult; p->xquant = sign*z.quant; } struct z setloglim(lbf,ubf,lb,ub) float lb,ub; { float r,s,t; struct z z; for(s=1; lb*s<1; s*=10) ; lb *= s; ub *= s; for(r=1; 10*r<=lb; r*=10) ; for(t=1; t= 5*z.lb) z.lb *= 5; else if(lb >= 2*z.lb) z.lb *= 2; } if(!ubf) { if(ub*5 <= z.ub) z.ub /= 5; else if(ub*2 <= z.ub) z.ub /= 2; } } z.mult = s; z.quant = r; return(z); } struct z setlinlim(lbf,ubf,xlb,xub) int lbf,ubf; float xlb,xub; { struct z z; float r,s,delta; float ub,lb; loop: ub = xub; lb = xlb; delta = ub - lb; /*scale up by s, a power of 10, so range (delta) exceeds 1*/ /*find power of 10 quantum, r, such that delta/10<=r=delta/2) r /= 2; else if(r0) { xlb = 0; goto loop; } else if(!ubf && z.ub>=-r && z.ub<0) { xub = 0; goto loop; } z.quant = r; z.mult = s; return(z); } scale(p,v) register struct xy *p; struct val *v; { float edge; getlim(p,v); setlim(p); edge = top-bot; p->xa = p->xsize*edge/((*p->xf)(p->xub) - (*p->xf)(p->xlb)); p->xbot = bot + edge*p->xoff; p->xtop = p->xbot + (top-bot)*p->xsize; p->xb = p->xbot - (*p->xf)(p->xlb)*p->xa + .5; } axes() { register i; int mark[50]; int xn, yn; if(gridf==0) return; line(xd.xbot,yd.xbot,xd.xtop,yd.xbot); cont(xd.xtop,yd.xtop); cont(xd.xbot,yd.xtop); cont(xd.xbot,yd.xbot); xn = setmark(mark,&xd); for(i=0; ixf==log10&&!p->xqf) { for(x=p->xquant; xxub; x*=10) { submark(xmark,&xn,x,p); if(p->xub/p->xlb<=100) { submark(xmark,&xn,2*x,p); submark(xmark,&xn,5*x,p); } } } else { xn = 0; q = p->xquant; if(q>0) { xl = modceil(p->xlb+q/6,q); xu = modfloor(p->xub-q/6,q)+q/2; } else { xl = modceil(p->xub-q/6,q); xu = modfloor(p->xlb+q/6,q)-q/2; } for(x=xl; x<=xu; x+=fabs(p->xquant)) xmark[xn++] = (*p->xf)(x)*p->xa + p->xb; } return(xn); } submark(xmark,pxn,x,p) int *xmark; int *pxn; float x; struct xy *p; { if(1.001*p->xlb < x && .999*p->xub > x) xmark[(*pxn)++] = log10(x)*p->xa + p->xb; } plot() { int ix,iy; int i; int conn; conn = 0; if(mode!=0) linemod(modes[mode]); for(i=0; ixa*(*p->xf)(xv*p->xmult) + p->xb; if(ixxbot || ix>p->xtop) return(0); *ip = ix; return(1); } getfloat(p) float *p; { register i; i = scanf("%f",p); return(i==1); } getstring() { register i; char junk[20]; i = scanf("%1s",labbuf); if(i==-1) return(-1); switch(*labbuf) { default: if(!isdigit(*labbuf)) { ungetc(*labbuf,stdin); i = scanf("%s",labbuf); break; } case '.': case '+': case '-': ungetc(*labbuf,stdin); return(0); case '"': i = scanf("%[^\"\n]",labbuf); scanf("%[\"]",junk); break; } if(i==-1) return(-1); return(strlen(labbuf)); } symbol(ix,iy,k) { if(symbf==0&&k<0) { if(mode==0) point(ix,iy); return(1); } else { move(ix,iy); label(k>=0?labs+k:plotsymb); move(ix,iy); return(!brkf|k<0); } } title() { move(xd.xbot,yd.xbot-60); if (titlebuf[0]) { label(titlebuf); label(" "); } if(erasf&&gridf) { axlab('x',&xd); label(" "); axlab('y',&yd); } } axlab(c,p) char c; struct xy *p; { char buf[50]; sprintf(buf,"%g -%s%c- %g", p->xlb/p->xmult, p->xf==log10?"log ":"", c, p->xub/p->xmult); label(buf); } badarg() { fprintf(stderr,"graph: error in arguments\n"); exit(1); } n(1); } else { move(ix,iy); label(k>=0?labs+k:plotsymb); move(ix,iy); return(!brkf|k<0); } } title() { move(xd.xbot,yd.xbot-60); if (titlebuf[0]) { label(titlebuf); label(" "); } if(erasf&&gridf) { axlab('x',&xd); label(" "); axlab('y',&yd); } } axlab(c,p) char c; struct xy *p; { char buf[50]; sprintf(buf,"%g -%s%c- %g", p->xlb/p->xmult, p->xf==log10?"log ":"", c, p->xub/p->xmult); label(buf); } badarg() { fprintf(stderr,"graph: errocmd/grep/ 775 0 33 0 2552545262 5457 cmd/grep/ucbgrep.c 644 0 33 13465 2421563244 7361 #include /* * grep -- print lines matching (or not matching) a pattern */ #define CCHR 2 #define CDOT 4 #define CCL 6 #define NCCL 8 #define CDOL 10 #define CEOF 11 #define CBRC 14 #define CLET 15 #define STAR 01 #define LBSIZE BUFSIZ #define ESIZE 256 char expbuf[ESIZE]; long lnum; char linebuf[LBSIZE+1]; int bflag; int nflag; int cflag; int vflag; int nfile; int iflag; int lflag; int wflag; int sflag; int nsucc; int circf; int blkno; char ibuf[BUFSIZ]; long tln; main(argc, argv) char **argv; { char obuf[BUFSIZ]; setbuf(stdout, obuf); while (--argc > 0 && (++argv)[0][0]=='-') { char *cp = argv[0] + 1; while (*cp) switch (*cp++) { case 'v': vflag++; continue; case 'b': bflag++; continue; case 'i': case 'y': /* -y for compatibility with btl grep */ iflag++; continue; case 'l': lflag++; case 'c': cflag++; continue; case 'w': wflag++; continue; case 's': sflag++; continue; case 'n': nflag++; continue; case 'e': --argc; ++argv; goto out; default: fprintf(stderr, "Unknown flag\n"); continue; } } out: if (argc<=0) exit(2); compile(*argv); nfile = --argc; if (argc<=0) { if (lflag) exit(1); execute(0); } else while (--argc >= 0) { argv++; execute(*argv); } exit(nsucc == 0); } compile(astr) char *astr; { register c; register char *ep, *sp; char *lastep; int cclcnt; ep = expbuf; sp = astr; 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) goto defchar; *lastep |= STAR; continue; case '$': if (*sp != '\0') goto defchar; *ep++ = CDOL; continue; case '[': *ep++ = CCL; *ep++ = 0; cclcnt = 1; if ((c = *sp++) == '^') { c = *sp++; ep[-2] = NCCL; } do { *ep++ = c; cclcnt++; if (c=='\0' || ep >= &expbuf[ESIZE]) goto cerror; } while ((c = *sp++) != ']'); lastep[1] = cclcnt; continue; case '\\': if ((c = *sp++) == '\0') goto cerror; if (c == '<') { *ep++ = CBRC; continue; } if (c == '>') { *ep++ = CLET; continue; } defchar: default: *ep++ = CCHR; *ep++ = c; } } cerror: fprintf(stderr, "RE error\n"); } same(a, b) register int a, b; { return (a == b || iflag && (a ^ b) == ' ' && letter(a) == letter(b)); } letter(c) register int c; { if (c >= 'a' && c <= 'z') return (c); if (c >= 'A' && c <= 'Z') return (c + 'a' - 'A'); return (0); } execute(file) { register char *p1, *p2; register c; int f; char *ebp, *cbp; if (file) { if ((f = open(file, 0)) < 0) { fprintf(stderr, "Can't open %s\n", file); } } else f = 0; ebp = ibuf; cbp = ibuf; lnum = 0; tln = 0; blkno = -1; for (;;) { lnum++; if((lnum&0377) == 0) fflush(stdout); p1 = linebuf; p2 = cbp; for (;;) { if (p2 >= ebp) { if ((c = read(f, ibuf, BUFSIZ)) <= 0) { close(f); if (cflag) { if (lflag) { if (tln) printf("%s\n", file); } else { if (nfile > 1) printf("%s:", file); printf("%ld\n", tln); } } return; } blkno++; p2 = ibuf; ebp = ibuf+c; } if ((c = *p2++) == '\n') break; if(c) if (p1 < &linebuf[LBSIZE-1]) *p1++ = c; } *p1++ = 0; cbp = p2; 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 && (!iflag || (c ^ *p1) != ' ' || letter(c) != letter(*p1))) 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(fi((le); } } advance(alp, aep) char *alp, *aep; { register char *lp, *ep, *curlp; char *nextep; lp = alp; ep = aep; for (;;) switch (*ep++) { case CCHR: if (!same(*ep, *lp)) return (0); ep++, lp++; continue; case CDOT: if (*lp++) continue; return(0); case CDOL: if (*lp==0) continue; return(0); case CEOF: return(1); case CCL: if (cclass(ep, *lp++, 1)) { ep += *ep; continue; } return(0); case NCCL: if (cclass(ep, *lp++, 0)) { ep += *ep; continue; } return(0); case CDOT|STAR: curlp = lp; while (*lp++); goto star; case CCHR|STAR: curlp = lp; while (same(*lp, *ep)) lp++; lp++; 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 (advance(lp, ep)) return(1); } while (lp > curlp); return(0); case CBRC: if (lp == expbuf) continue; #define uletter(c) (letter(c) || c == '_') if ( ( uletter(*lp) || digit ( * lp ) ) && !uletter(lp[-1]) && !digit(lp[-1])) continue; return (0); case CLET: if (!uletter(*lp) && !digit(*lp)) continue; return (0); default: fprintf(stderr, "RE botch\n"); } } cclass(aset, ac, af) char *aset; { register char *set, c; register n; set = aset; if ((c = ac) == 0) return(0); n = *set++; while (--n) if (n > 2 && set[1] == '-') { if (c >= (set[0] & 0177) && c <= (set[2] & 0177)) return (af); set += 3; n -= 2; } else if ((*set++ & 0177) == c) return(af); return(!af); } succeed(f) { nsucc = 1; if (sflag) return; if (cflag) { tln++; return; } if (nfile > 1) printf("%s:", f); if (bflag) printf("%d:", blkno); if (nflag) printf("%ld:", lnum); printf("%s\n", linebuf); } digit(c) char c; { return (c>='0' && c<='9'); } == 0) return(0); n = *set++; while (--n) if (n > 2 && set[1] == '-') { if (c >= (set[0] & 0177) && c <= (set[2] & 0177)) return (af); set += 3; n -= 2; } else if ((*set++ & 0177) cmd/grep/btlgrep.c 644 0 33 15334 2314361626 7367 /* * 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 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 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; { extern char _sobuf[]; setbuf(stdout, _sobuf); while (--argc > 0 && (++argv)[0][0]=='-') switch (argv[0][1]) { case 'y': yflag++; continue; case 'h': hflag = 0; continue; case 's': sflag++; continue; case 'v': vflag++; continue; case 'b': bflag++; continue; case 'l': lflag++; continue; case 'c': cflag++; continue; case 'n': nflag++; continue; case 'e': --argc; ++argv; goto out; default: errexit("grep: unknown flag\n", (char *)NULL); continue; } out: if (argc<=0) exit(2); if (yflag) { register char *p, *s; for (s = ybuf, p = *argv; *p; ) { if (*p == '\\') { *s++ = *p++; if (*p) *s++ = *p++; } else if (*p == '[') { while (*p != '\0' && *p != ']') *s++ = *p++; } else if (islower(*p)) { *s++ = '['; *s++ = toupper(*p); *s++ = *p++; *s++ = ']'; } else *s++ = *p++; if (s >= ybuf+ESIZE-5) errexit("grep: argument too long\n", (char *)NULL); } *s = '\0'; *argv = ybuf; } compile(*argv); nfile = --argc; if (argc<=0) { if (lflag) exit(1); execute((char *)NULL); } else while (--argc >= 0) { argv++; execute(*argv); } exit(nsucc == 0); } compile(astr) char *astr; { register c; register char *ep, *sp; char *cstart; char *lastep; int cclcnt; char bracket[NBRA], *bracketp; int closed; char numbra; char neg; ep = expbuf; sp = astr; lastep = 0; bracketp = bracket; closed = numbra = 0; if (*sp == '^') { circf++; sp++; } for (;;) { if (ep >= &expbuf[ESIZE]) goto cerror; if ((c = *sp++) != '*') lastep = ep; switch (c) { case '\0': *ep++ = CEOF; return; case '.': *ep++ = CDOT; continue; case '*': if (lastep==0 || *lastep==CBRA || *lastep==CKET) goto defchar; *lastep |= STAR; continue; case '$': if (*sp != '\0') goto defchar; *ep++ = CDOL; continue; case '[': if(&ep[17] >= &expbuf[ESIZE]) goto cerror; *ep++ = CCL; neg = 0; if((c = *sp++) == '^') { neg = 1; c = *sp++; } cstart = sp; do { if (c=='\0') goto cerror; if (c=='-' && sp>cstart && *sp!=']') { for (c = sp[-2]; c<*sp; c++) ep[c>>3] |= bittab[c&07]; sp++; } ep[c>>3] |= bittab[c&07]; } while((c = *sp++) != ']'); if(neg) { for(cclcnt = 0; cclcnt < 16; cclcnt++) ep[cclcnt] ^= -1; ep[0] &= 0376; } ep += 16; continue; case '\\': if((c = *sp++) == '(') { if(numbra >= NBRA) { goto cerror; } *bracketp++ = numbra; *ep++ = CBRA; *ep++ = numbra++; continue; } if(c == ')') { if(bracketp <= bracket) { goto cerror; } *ep++ = CKET; *ep++ = *--bracketp; closed++; continue; } if(c >= '1' && c <= '9') { if((c -= '1') >= closed) goto cerror; *ep++ = CBACK; *ep++ = c; continue; } defchar: default: *ep++ = CCHR; *ep++ = c; } } cerror: errexit("grep: RE error\n", (char *)NULL); } execute(file) char *file; { register char *p1, *p2; register c; if (file) { if (freopen(file, "r", stdin) == NULL) errexit("grep: can't open %s\n", file); } lnum = 0; tln = 0; for (;;) { lnum++; p1 = linebuf; while ((c = getchar()) != '\n') { if (c == EOF) { if (cflag) { if (nfile>1) printf("%s:", file); printf("%D\n", tln); 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); 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); } 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); pricmd/grep/makefile 644 0 33 421 2256376076 7225 ((CFLAGS=-O all: btlgrep ucbgrep btlgrep: btlgrep.o cc btlgrep.o -o btlgrep ucbgrep: ucbgrep.o cc ucbgrep.o -o ucbgrep install: btlgrep ucbgrep strip btlgrep ucbgrep mv btlgrep ${DESTDIR}/bin/grep mv ucbgrep ${DESTDIR}/usr/ucb/grep clean: rm -f *.o btlgrep ucbgrep lag) { tln++; return; } if (lflag) { printf("%s\n", f); fflush(stdout); fseek(stdin, 0l, 2); return; } if (nfile > 1 && hflag) pr/,5x< /,"cmd/px/ 775 0 33 0 2574143231 5143 cmd/px/READ_ME 644 0 33 2600 2552606501 6243 Copyright (c) 1979 Regents of the University of California sccsid = "@(#)READ_ME 1.1 1/7/81" This directory contains the source code for the Version 7 VAX interpreter for Pascal. Following standard convensions, the makefile contains four commands: px - compile px install - compile and install px in /usr/ucb clean - clean out directory print - print out a listing of px Bugs and Limitations: Runtime error messages could give far more information than they currently do. (eg the actual value of a subscript which is out of range) It should be possible to resume execution following many of the runtime errors. (eg fixed overflow, interrupt, etc) Comparison of Pascal with C compiler In an attempt to compare compiled versus interpreted execution speeds the 'Tower of Hanoi' benchmark (see hanoi.p, hanoi.c) was run with the following results: Data: number of disks: 16 number of moves required: 65535 Compiler, Flags Compile Compile Run Run Time Factor Time Factor Pi, full tests 0.4u+0.4s 1.0 42.7u 1.0 Pi, no tests 0.3u+0.3s 0.7 35.2u 1.2 Pc, unoptimized 3.8u+2.4s 7.7 5.3u 8.1 Pc, optimized 4.4u+2.3s 8.4 4.6u 9.3 C, unoptimized 1.7u+1.8s 4.4 2.8u 15.3 C, optimized 2.0u+2.0s 5.0 2.5u 17.1 Note: The times for Pc and C were obtained by running larger problems and scaling the run times down appropriately. 16 number of moves required: 65535 Compiler, Flags Compile Compile Run Run Time Factor Time Factor Pi, fcmd/px/Version.c 644 0 33 35 2572603502 6755 long createtime = 367724353; 42.7u 1.0 Pi, no tests 0.3u+0.3s 0.7 35.2u 1.2 Pc, unoptimized 3.8u+2.4s 7.7 5.3u 8.1 Pc, optimized 4.4u+2.3s 8.4 4.6u 9.3 C, unoptimized 1.7u+1.8s 4.4 2.8u 15.3 C, optimized 2.0u+2.0s 5.0 2.5u 17.1 Note: The times for Pc and C were obtained by running larger problems and scaling the run times down appropriately. 16 number of moves required: /,5h< /,"cmd/px/clean.sed 644 0 33 64 2552606501 6745 s,"@(#)clean.sed 1.2 1/8/81",&, s/^[^L]/ &/ s/:/: / s 0.3u+0.3s 0.7 35.2u 1.2 Pc, unoptimized 3.8u+2.4s 7.7 5.3u 8.1 Pc, optimized 4.4u+2.3s 8.4 4.6u 9.3 C, unoptimized 1.7u+1.8s 4.4 2.8u 15.3 C, optimized 2.0u+2.0s 5.0 2.5u 17.1 Note: The times for Pc and C were obtained by running larger problems and scaling the run times down appropriately. 16 number of moves required: /,5x< /,"cmd/px/except.c 644 0 33 3116 2552606501 6663 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)except.c 1.6 6/10/81"; #include #include "whoami.h" #include "panics.h" #include "vars.h" /* * Routine panic is called from the interpreter when a runtime panic occurs. * Its argument is the internal number of the panic which occurred. */ panic(errnum) int errnum; { signal(SIGINT,SIG_IGN); signal(SIGSEGV,SIG_DFL); signal(SIGFPE,SIG_DFL); signal(SIGTRAP,SIG_DFL); signal(SIGILL,SIG_DFL); signal(SIGBUS,SIG_DFL); signal(SIGSYS,SIG_DFL); PFLUSH(); fputs("\n\n",stderr); switch (errnum) { case PINTR: case PLIBERR: break; case PNUMOVFLO: fputs("Overflow arithmetic operation\n",stderr); break; case PHALT: if (_nodump == TRUE) psexit(0); fputs("Call to procedure halt\n",stderr); backtrace(errnum); /* pfree(objprog); */ psexit(0); case PSTKOVFLO: fputs("Run time stack overflow\n",stderr); break; case PSYSTEM: fputs("Panic: Computational error in interpreter\n", stderr); break; case PSTKNEMP: fputs("Panic: stack not empty between statements\n", stderr); break; case PBADOP: fputs("Panic: bad op code\n",stderr); break; default: fputs("Panic: unknown error\n",stderr); } backtrace(errnum); /* pfree(objprog); */ psexit(errnum); } liberr() { panic(PLIBERR); } intr() { signal(SIGINT, intr); panic(PINTR); } memsize() { signal(SIGSEGV, memsize); panic(PSTKOVFLO); } syserr(signum) int signum; { signal(signum, syserr); panic(PSYSTEM); } except() { signal(SIGFPE, except); panic(PNUMOVFLO); } mpty between statements\n", stderr); break; case PBADOP: fputs("Panic: bad op code\n",stderr); break; default: fputs("Panic: unknown error\n",stderr); } backtrace(errnum); /* pfree(objprog); */ psexit(errnum); } liberr() { panic(PLIBERR); } intr() { signal(SIGINT, intr); panic(PINTR); } memsize() { signal(SIGSEGV, memsize); panic(PSTKOVFLO); } syserr(signum) int signum; { signal(signum, syserr);cmd/px/h01errs.h 644 0 33 1261 2552606502 6664 #define EARGV 1 #define EASRT 2 #define EBADFNUM 3 #define EBADINUM 4 #define ECASE 5 #define ECHR 6 #define ECLOSE 7 #define ECREATE 8 #define ECTLWR 9 #define ECTSNG 10 #define ECTUPR 11 #define EFMTSIZE 12 #define EGOTO 13 #define EHALT 14 #define ELLIMIT 15 #define ELN 16 #define ENAMESIZE 17 #define ENAMRNG 18 #define ENILPTR 20 #define ENOFILE 21 #define ENUMNTFD 22 #define EOPEN 23 #define EOUTOFMEM 24 #define EPACK 25 #define EPASTEOF 26 #define ERANGE 27 #define EREADIT 28 #define EREFINAF 29 #define EREMOVE 30 #define ESEEK 31 #define ESQRT 32 #define ESTLIM 33 #define ESUBSC 34 #define EUNPACK 35 #define EWRITE 36 #define EWRITEIT 37 ECTSNG 10 #define ECTUPR 11 #define EFMTSIZE 12 #define EGOTO 13 #define EHALT 14 #define ELLIMIT 15 #define ELN 16 #define ENAMESIZE 17 #define ENAMRNG 18 #define ENILPTR 20 #define ENOFILE 21 #define ENUMNTFD 22 #define EOPEN 23 #define EOUTOFMEM 24 #define EPACK 25 #define EPASTEOF 26 #define ERANGE 27 #define EREADIT cmd/px/int.c 644 0 33 5565 2552606502 6200 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)int.c 1.4 6/21/81"; /* * px - interpreter for Berkeley Pascal * Version 3.0 Winter 1979 * * Original version for the PDP 11/70 authored by: * Bill Joy, Charles Haley, Ken Thompson * * Rewritten for VAX 11/780 by Kirk McKusick */ #include #include "whoami.h" #include "vars.h" #include "objfmt.h" main(ac,av) int ac; char **av; { register char *objprog, *file; register long bytesread, bytes((toread, block; register FILE *prog; struct pxhdr pxhd; # define pipe 3 /* * Initialize everything */ _argc = ac; _argv = av; _nodump = FALSE; /* * Determine how PX was invoked, and how to process the program */ if (_argv[0][0] == '-' && _argv[0][1] == 'o') { file = &_argv[0][2]; _mode = PIX; } else if (_argc <= 1) { file = "obj"; _mode = PX; } else if (_argv[1][0] != '-') { file = _argv[1]; _mode = PX; } else if (_argv[1][1] == 0) { file = _argv[0]; _mode = PIPE; _argc -= 1; _argv[1] = _argv[0]; _argv = &_argv[1]; } else { fputs("Improper specification of object file to PX\n",stderr); exit(1); } /* * Process program header information */ if (_mode == PIPE) { read(pipe,&pxhd,sizeof(struct pxhdr)); } else { prog = fopen(file,"r"); if (prog == NULL) { perror(file); exit(1); } fseek(prog,(long)(HEADER_BYTES-sizeof(struct pxhdr)),0); fread(&pxhd,sizeof(struct pxhdr),1,prog); } if (pxhd.maketime < createtime) { fprintf(stderr,"%s is obsolete and must be recompiled\n",file); exit(1); } if (pxhd.magicnum != MAGICNUM) { fprintf(stderr,"%s is not a Pascal interpreter file\n",file); exit(1); } /* * Load program into memory */ objprog = malloc((int)pxhd.objsize); if (_mode == PIPE) { bytestoread = pxhd.objsize; bytesread = 0; do { block = read(pipe,(int)(objprog+bytesread),bytestoread); if (block > 0) { bytesread += block; bytestoread -= block; } } while (block > 0); } else { bytesread = fread(objprog,1,(int)pxhd.objsize,prog); fclose(prog); if (_mode == PIX) unlink(file); } if (bytesread != pxhd.objsize) { fprintf(stderr,"Read error occurred while loading %s\n",file); exit(1); } if (_mode == PIX) fputs("Execution begins...\n",stderr); /* * set interpreter to catch expected signals and begin interpretation */ signal(SIGILL,syserr); signal(SIGBUS,syserr); signal(SIGSYS,syserr); if (signal(SIGINT,SIG_IGN) != SIG_IGN) signal(SIGINT,intr); signal(SIGSEGV,memsize); signal(SIGFPE,except); signal(SIGTRAP,liberr); /* * do it */ interpreter(objprog); /* * reset signals, deallocate memory, and exit normally */ signal(SIGINT,SIG_IGN); signal(SIGSEGV,SIG_DFL); signal(SIGFPE,SIG_DFL); signal(SIGTRAP,SIG_DFL); signal(SIGILL,SIG_DFL); signal(SIGBUS,SIG_DFL); signal(SIGSYS,SIG_DFL); PFLUSH(); /* pfree(objprog); */ psexit(0); } l(SIGBUS,syserr); signal(SIGSYS,syserr); if (signal(SIGINT,SIG_IGN) != SIG_IGN) signal(SIGINT,intr); signal(SIGSEGV,memsize); signal(cmd/px/interp.c 644 0 33 102710 2552606503 6736 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)interp.c 1.14 6/10/81"; #include #include "whoami.h" #include "objfmt.h" #include "vars.h" #include "panics.h" #include "h02opcs.h" #include "machdep.h" #include "libpc.h" /* * program variables */ union disply _display; struct disp *_dp; long _lino = 0; int _argc; char **_argv; long _mode; bool _runtst = TRUE; bool _nodump = FALSE; long _stlim = 500000; long _stcnt = 0; long _seed = 1; #ifdef VAX char *_minptr = (char *)0x7fffffff; #else char *_minptr = (char *)0xffff; #endif VAX char *_maxptr = (char *)0; long *_pcpcount = (long *)0; long _cntrs = 0; long _rtns = 0; /* * standard files */ char _inwin, _outwin, _errwin; struct iorechd _err = { &_errwin, /* fileptr */ 0, /* lcount */ 0x7fffffff, /* llimit */ &_iob[2], /* fbuf */ FILNIL, /* fchain */ STDLVL, /* flev */ "Message file", /* pfname */ FTEXT | FWRITE | EOFF, /* funit */ 2, /* fblk */ 1 /* fsize */ }; struct iorechd output = { &_outwin, /* fileptr */ 0, /* lcount */ 0x7fffffff, /* llimit */ &_iob[1], /* fbuf */ ERR, /* fchain */ STDLVL, /* flev */ "standard output", /* pfname */ FTEXT | FWRITE | EOFF, /* funit */ 1, /* fblk */ 1 /* fsize */ }; struct iorechd input = { &_inwin, /* fileptr */ 0, /* lcount */ 0x7fffffff, /* llimit */ &_iob[0], /* fbuf */ OUTPUT, /* fchain */ STDLVL, /* flev */ "standard input", /* pfname */ FTEXT | FREAD | SYNC, /* funit */ 0, /* fblk */ 1 /* fsize */ }; /* * file record variables */ long _filefre = PREDEF; struct iorechd _fchain = { 0, 0, 0, 0, /* only use fchain field */ INPUT /* fchain */ }; struct iorec *_actfile[MAXFILES] = { INPUT, OUTPUT, ERR }; /* * Px profile array */ #ifdef PROFILE long _profcnts[NUMOPS]; #endif PROFILE /* * debugging variables */ #ifdef DEBUG char opc[10]; long opcptr = 9; #endif DEBUG interpreter(base) char *base; { union progcntr pc; /* interpreted program cntr */ register char *vpc; /* register used for "pc" */ struct iorec *curfile; /* active file */ register struct stack *stp; /* active stack frame ptr */ /* * the following variables are used as scratch */ register char *tcp; register long tl, tl1, tl2; double td, td1; struct sze8 t8; long *tlp; register short *tsp, *tsp1, ts; bool tb; char *tcp1; struct stack *tstp; struct formalrtn *tfp; union progcntr tpc; struct iorec **ip; /* * Setup sets up any hardware specific parameters before * starting the interpreter. Typically this is inline replaced * by interp.sed to utilize specific machine instructions. */ setup(); /* * necessary only on systems which do not initialize * memory to zero */ for (ip = &_actfile[3]; ip < &_actfile[MAXFILES]; *ip++ = FILNIL) /* void */; /* * set up global environment, then ``call'' the main program */ _display.frame[0].locvars = pushsp((long)(2 * sizeof(struct iorec *))); _display.frame[0].locvars += 2 * sizeof(struct iorec *); *(struct iorec **)(_display.frame[0].locvars + OUTPUT_OFF) = OUTPUT; *(struct iorec **)(_display.frame[0].locvars + INPUT_OFF) = INPUT; stp = (struct stack *)pushsp((long)(sizeof(struct stack))); _dp = &_display.frame[0]; pc.cp = base; for(;;) { # ifdef DEBUG if (++opcptr == 10) opcptr = 0; opc[opcptr] = *pc.ucp; # endif DEBUG # ifdef PROFILE _profcnts[*pc.ucp]++; # endif PROFILE switch (*pc.ucp++) { case O_NODUMP: _nodump = TRUE; /* and fall through */ case O_BEG: _dp += 1; /* enter local scope */ stp->odisp = *_dp; /* save old display value */ tl = *pc.ucp++; /* tl = name size */ stp->entry = pc.hdrp; /* pointer to entry info */ tl1 = pc.hdrp->framesze;/* tl1 = size of frame */ _lino = pc.hdrp->offset; _runtst = pc.hdrp->tests; disableovrflo(); if (_runtst) enableovrflo(); pc.cp += (int)tl; /* skip over proc hdr info */ stp->file = curfile; /* save active file */ tcp = pushsp(tl1); /* tcp = new top of stack */ if (_runtst) /* zero stack frame */ blkclr(tl1, tcp); tcp += (int)tl1; /* offsets of locals are neg */ _dp->locvars = tcp; /* set new display pointer */ _dp->stp = stp; stp->tos = pushsp((long)0); /* set tos pointer */ continue; case O_END: PCLOSE(_dp->locvars); /* flush & close local files */ stp = _dp->stp; curfile = stp->file; /* restore old active file */ *_dp = stp->odisp; /* restore old display entry */ if (_dp == &_display.frame[1]) return; /* exiting main proc ??? */ _lino = stp->lino; /* restore lino, pc, dp */ pc.cp = stp->pc.cp; _dp = stp->dp; _runtst = stp->entry->tests; disableovrflo(); if (_runtst) enableovrflo(); popsp(stp->entry->framesze + /* pop local vars */ sizeof(struct stack) + /* pop stack frame */ stp->entry->nargs); /* pop parms */ continue; case O_CALL: tl = *pc.cp++; tcp = base + *pc.lp++;/* calc new entry point */ tcp += sizeof(short); tcp = base + *(long *)tcp; stp = (struct stack *) pushsp((long)(sizeof(struct stack))); stp->lino = _lino; /* save lino, pc, dp */ stp->pc.cp = pc.cp; stp->dp = _dp; _dp = &_display.frame[tl]; /* set up new display ptr */ pc.cp = tcp; continue; case O_FCALL: pc.cp++; tfp = (struct formalrtn *)popaddr(); stp = (struct stack *) pushsp((long)(sizeof(struct stack))); stp->lino = _lino; /* save lino, pc, dp */ stp->pc.cp = pc.cp; stp->dp = _dp; pc.cp = tfp->fentryaddr;/* calc new entry point */ _dp = &_display.frame[tfp->fbn];/* new display ptr */ blkcpy(tfp->fbn * sizeof(struct disp), &_display.frame[1], &tfp->fdisp[tfp->fbn]); blkcpy(tfp->fbn * sizeof(struct disp), &tfp->fdisp[0], &_display.frame[1]); continue; case O_FRTN: tl = *pc.cp++; /* tl = size of return obj */ if (tl == 0) tl = *pc.usp++; tcp = pushsp((long)(0)); tfp = *(struct formalrtn **)(tcp + tl); if (tl != 0) { blkcpy(tl, tcp, tcp + sizeof(struct formalrtn *)); } popsp((long)(sizeof(struct formalrtn *))); blkcpy(tfp->fbn * sizeof(struct disp), &tfp->fdisp[tfp->fbn], &_display.frame[1]); continue; case O_FSAV: tfp = (struct formalrtn *)popaddr(); tfp->fbn = *pc.cp++; /* blk number of routine */ tcp = base + *pc.lp++; /* calc new entry point */ tcp += sizeof(short); tfp->fentryaddr = base + *(long *)tcp; blkcpy(tfp->fbn * sizeof(struct disp), &_display.frame[1], &tfp->fdisp[0]); pushaddr(tfp); continue; case O_SDUP2: pc.cp++; tl = pop2(); push2((short)(tl)); push2((short)(tl)); continue; case O_SDUP4: pc.cp++; tl = pop4(); push4(tl); push4(tl); continue; case O_TRA: pc.cp++; pc.cp += *pc.sp; continue; case O_TRA4: pc.cp++; pc.cp = base + *pc.lp; continue; case O_GOTO: tstp = _display.frame[*pc.cp++].stp; /* ptr to exit frame */ pc.cp = base + *pc.lp; stp = _dp->stp; while (tstp != stp) { if (_dp == &_display.frame[1]) ERROR("Active frame not found in non-local goto\n", ((0); /* exiting prog ??? */ PCLOSE(_dp->locvars); /* close local files */ curfile = stp->file; /* restore active file */ *_dp = stp->odisp; /* old display entry */ _dp = stp->dp; /* restore dp */ stp = _dp->stp; } /* pop locals, stack frame, parms, and return values */ popsp((long)(stp->tos - pushsp((long)(0)))); continue; case O_LINO: if (_dp->stp->tos != pushsp((long)(0))) panic(PSTKNEMP); _lino = *pc.cp++; /* set line number */ if (_lino == 0) _lino = *pc.sp++; if (_runtst) { LINO(); /* inc statement count */ continue; } _stcnt++; continue; case O_PUSH: tl = *pc.cp++; if (tl == 0) tl = *pc.usp++; tl = (-tl + 1) & ~1; tcp = pushsp(tl); if (_runtst) blkclr(tl, tcp); continue; case O_IF: pc.cp++; if (pop2()) { pc.sp++; continue; } pc.cp += *pc.sp; continue; case O_REL2: tl = pop2(); tl1 = pop2(); goto cmplong; case O_REL24: tl = pop2(); tl1 = pop4(); goto cmplong; case O_REL42: tl = pop4(); tl1 = pop2(); goto cmplong; case O_REL4: tl = pop4(); tl1 = pop4(); cmplong: tl2 = *pc.cp++; switch (tl2) { case releq: push2(tl1 == tl); continue; case relne: push2(tl1 != tl); continue; case rellt: push2(tl1 < tl); continue; case relgt: push2(tl1 > tl); continue; case relle: push2(tl1 <= tl); continue; case relge: push2(tl1 >= tl); continue; default: panic(PSYSTEM); continue; } case O_RELG: tl2 = *pc.cp++; /* tc has jump opcode */ tl = *pc.usp++; /* tl has comparison length */ tl1 = (tl + 1) & ~1; /* tl1 has arg stack length */ tcp = pushsp((long)(0));/* tcp pts to first arg */ switch (tl2) { case releq: tb = RELEQ(tl, tcp + tl1, tcp); break; case relne: tb = RELNE(tl, tcp + tl1, tcp); break; case rellt: tb = RELSLT(tl, tcp + tl1, tcp); break; case relgt: tb = RELSGT(tl, tcp + tl1, tcp); break; case relle: tb = RELSLE(tl, tcp + tl1, tcp); break; case relge: tb = RELSGE(tl, tcp + tl1, tcp); break; default: panic(PSYSTEM); break; } popsp(tl1 << 1); push2((short)(tb)); continue; case O_RELT: tl2 = *pc.cp++; /* tc has jump opcode */ tl1 = *pc.usp++; /* tl1 has comparison length */ tcp = pushsp((long)(0));/* tcp pts to first arg */ switch (tl2) { case releq: tb = RELEQ(tl1, tcp + tl1, tcp); break; case relne: tb = RELNE(tl1, tcp + tl1, tcp); break; case rellt: tb = RELTLT(tl1, tcp + tl1, tcp); break; case relgt: tb = RELTGT(tl1, tcp + tl1, tcp); break; case relle: tb = RELTLE(tl1, tcp + tl1, tcp); break; case relge: tb = RELTGE(tl1, tcp + tl1, tcp); break; default: panic(PSYSTEM); break; } popsp(tl1 << 1); push2((short)(tb)); continue; case O_REL28: td = pop2(); td1 = pop8(); goto cmpdbl; case O_REL48: td = pop4(); td1 = pop8(); goto cmpdbl; case O_REL82: td = pop8(); td1 = pop2(); goto cmpdbl; case O_REL84: td = pop8(); td1 = pop4(); goto cmpdbl; case O_REL8: td = pop8(); td1 = pop8(); cmpdbl: switch (*pc.cp++) { case releq: push2(td1 == td); continue; case relne: push2(td1 != td); continue; case rellt: push2(td1 < td); continue; case relgt: push2(td1 > td); continue; case relle: push2(td1 <= td); continue; case relge: push2(td1 >= td); continue; default: panic(PSYSTEM); continue; } case O_AND: pc.cp++; push2(pop2() & pop2()); continue; case O_OR: pc.cp++; push2(pop2() | pop2()); continue; case O_NOT: pc.cp++; push2(pop2() ^ 1); continue; case O_AS2: pc.cp++; tl = pop2(); *(short *)popaddr() = tl; continue; case O_AS4: pc.cp++; tl = pop4(); *(long *)popaddr() = tl; continue; case O_AS24: pc.cp++; tl = pop2(); *(long *)popaddr() = tl; continue; case O_AS42: pc.cp++; tl = pop4(); *(short *)popaddr() = tl; continue; case O_AS21: pc.cp++; tl = pop2(); *popaddr() = tl; continue; case O_AS41: pc.cp++; tl = pop4(); *popaddr() = tl; continue; case O_AS28: pc.cp++; tl = pop2(); *(double *)popaddr() = tl; continue; case O_AS48: pc.cp++; tl = pop4(); *(double *)popaddr() = tl; continue; case O_AS8: pc.cp++; t8 = popsze8(); *(struct sze8 *)popaddr() = t8; continue; case O_AS: tl = *pc.cp++; if (tl == 0) tl = *pc.usp++; tl1 = (tl + 1) & ~1; tcp = pushsp((long)(0)); blkcpy(tl, tcp, *(char **)(tcp + tl1)); popsp(tl1 + sizeof(char *)); continue; case O_INX2P2: tl = *pc.cp++; /* tl has shift amount */ tl1 = (pop2() - *pc.sp++) << tl; pushaddr(popaddr() + tl1); continue; case O_INX4P2: tl = *pc.cp++; /* tl has shift amount */ tl1 = (pop4() - *pc.sp++) << tl; pushaddr(popaddr() + tl1); continue; case O_INX2: tl = *pc.cp++; /* tl has element size */ if (tl == 0) tl = *pc.usp++; tl1 = pop2(); /* index */ tl2 = *pc.sp++; pushaddr(popaddr() + (tl1 - tl2) * tl); tl = *pc.usp++; if (_runtst) SUBSC(tl1, tl2, tl); /* range check */ continue; case O_INX4: tl = *pc.cp++; /* tl has element size */ if (tl == 0) tl = *pc.usp++; tl1 = pop4(); /* index */ tl2 = *pc.sp++; pushaddr(popaddr() + (tl1 - tl2) * tl); tl = *pc.usp++; if (_runtst) SUBSC(tl1, tl2, tl); /* range check */ continue; case O_OFF: tl = *pc.cp++; if (tl == 0) tl = *pc.usp++; pushaddr(popaddr() + tl); continue; case O_NIL: pc.cp++; NIL(); continue; case O_ADD2: pc.cp++; push4((long)(pop2() + pop2())); continue; case O_ADD4: pc.cp++; push4(pop4() + pop4()); continue; case O_ADD24: pc.cp++; tl = pop2(); push4(pop4() + tl); continue; case O_ADD42: pc.cp++; tl = pop4(); push4(pop2() + tl); continue; case O_ADD28: pc.cp++; tl = pop2(); push8(pop8() + tl); continue; case O_ADD48: pc.cp++; tl = pop4(); push8(pop8() + tl); continue; case O_ADD82: pc.cp++; td = pop8(); push8(pop2() + td); continue; case O_ADD84: pc.cp++; td = pop8(); push8(pop4() + td); continue; case O_SUB2: pc.cp++; tl = pop2(); push4(pop2() - tl); continue; case O_SUB4: pc.cp++; tl = pop4(); push4(pop4() - tl); continue; case O_SUB24: pc.cp++; tl = pop2(); push4(pop4() - tl); continue; case O_SUB42: pc.cp++; tl = pop4(); push4(pop2() - tl); continue; case O_SUB28: pc.cp++; tl = pop2(); push8(pop8() - tl); continue; case O_SUB48: pc.cp++; tl = pop4(); push8(pop8() - tl); continue; case O_SUB82: pc.cp++; td = pop8(); push8(pop2() - td); continue; case O_SUB84: pc.cp++; td = pop8(); push8(pop4() - td); continue; case O_MUL2: pc.cp++; push4((long)(pop2() * pop2())); continue; case O_MUL4: pc.cp++; push4(pop4() * pop4()); continue; case O_MUL24: pc.cp++; tl = pop2(); push4(pop4() * tl); continue; case O_MUL42: pc.cp++; tl = pop4(); push4(pop2() * tl); continue; case O_MUL28: pc.cp++; tl = pop2(); push8(pop8() * tl); continue; case O_MUL48: pc.cp++; tl = pop4(); push8(pop8() * tl); continue; case O_MUL82: pc.cp++; td = pop8(); push8(pop2() * td); continue; case O_MUL84: pc.cp++; td = pop8(); push8(pop4() * td); continue; case O_ABS2: case O_ABS4: pc.cp++; tl = pop4(); push4(tl >= 0 ? tl : -tl); continue; case O_ABS8: pc.cp++; td = pop8(); push8(td >= 0.0 ? td : -td); continue; case O_NEG2: pc.cp++; push4((long)(-pop2())); continue; case O_NEG4: pc.cp++; push4(-pop4()); continue; case O_NEG8: pc.cp++; push8(-pop8()); continue; case O_DIV2: pc.cp++; tl = pop2(); push4(pop2() / tl); continue; case O_DIV4: pc.cp++; tl = pop4(); push4(pop4() / tl); continue; case O_DIV24: pc.cp++; tl = pop2(); push4(pop4() / tl); continue; case O_DIV42: pc.cp++; tl = pop4(); push4(pop2() / tl); continue; case O_MOD2: pc.cp++; tl = pop2(); push4(pop2() % tl); continue; case O_MOD4: pc.cp++; tl = pop4(); push4(pop4() % tl); continue; case O_MOD24: pc.cp++; tl = pop2(); push4(pop4() % tl); continue; case O_MOD42: pc.cp++; tl = pop4(); push4(pop2() % tl); continue; case O_ADD8: pc.cp++; push8(pop8() + pop8()); continue; case O_SUB8: pc.cp++; td = pop8(); push8(pop8() - td); continue; case O_MUL8: pc.cp++; push8(pop8() * pop8()); continue; case O_DVD8: pc.cp++; td = pop8(); push8(pop8() / td); continue; case O_STOI: pc.cp++; push4((long)(pop2())); continue; case O_STOD: pc.cp++; td = pop2(); push8(td); continue; case O_ITOD: pc.cp++; td = pop4(); push8(td); continue; case O_ITOS: pc.cp++; push2((short)(pop4())); continue; case O_DVD2: pc.cp++; td = pop2(); push8(pop2() / td); continue; case O_DVD4: pc.cp++; td = pop4(); push8(pop4() / td); continue; case O_DVD24: pc.cp++; td = pop2(); push8(pop4() / td); continue; case O_DVD42: pc.cp++; td = pop4(); push8(pop2() / td); continue; case O_DVD28: pc.cp++; td = pop2(); push8(pop8() / td); continue; case O_DVD48: pc.cp++; td = pop4(); push8(pop8() / td); continue; case O_DVD82: pc.cp++; td = pop8(); push8(pop2() / td); continue; case O_DVD84: pc.cp++; td = pop8(); push8(pop4() / td); continue; case O_RV1: tcp = _display.raw[*pc.ucp++]; push2((short)(*(tcp + *pc.sp++))); continue; case O_RV14: tcp = _display.raw[*pc.ucp++]; push4((long)(*(tcp + *pc.sp++))); continue; case O_RV2: tcp = _display.raw[*pc.ucp++]; push2(*(short *)(tcp + *pc.sp++)); continue; case O_RV24: tcp = _display.raw[*pc.ucp++]; push4((long(()(*(short *)(tcp + *pc.sp++))); continue; case O_RV4: tcp = _display.raw[*pc.ucp++]; push4(*(long *)(tcp + *pc.sp++)); continue; case O_RV8: tcp = _display.raw[*pc.ucp++]; pushsze8(*(struct sze8 *)(tcp + *pc.sp++)); continue; case O_RV: tcp = _display.raw[*pc.ucp++]; tcp += *pc.sp++; tl = *pc.usp++; tcp1 = pushsp((tl + 1) & ~1); blkcpy(tl, tcp, tcp1); continue; case O_LV: tcp = _display.raw[*pc.ucp++]; pushaddr(tcp + *pc.sp++); continue; case O_LRV1: tcp = _display.raw[*pc.ucp++]; push2((short)(*(tcp + *pc.lp++))); continue; case O_LRV14: tcp = _display.raw[*pc.ucp++]; push4((long)(*(tcp + *pc.lp++))); continue; case O_LRV2: tcp = _display.raw[*pc.ucp++]; push2(*(short *)(tcp + *pc.lp++)); continue; case O_LRV24: tcp = _display.raw[*pc.ucp++]; push4((long)(*(short *)(tcp + *pc.lp++))); continue; case O_LRV4: tcp = _display.raw[*pc.ucp++]; push4(*(long *)(tcp + *pc.lp++)); continue; case O_LRV8: tcp = _display.raw[*pc.ucp++]; pushsze8(*(struct sze8 *)(tcp + *pc.lp++)); continue; case O_LRV: tcp = _display.raw[*pc.ucp++]; tcp += (int)*pc.lp++; tl = *pc.usp++; tcp1 = pushsp((tl + 1) & ~1); blkcpy(tl, tcp, tcp1); continue; case O_LLV: tcp = _display.raw[*pc.ucp++]; pushaddr(tcp + *pc.lp++); continue; case O_IND1: pc.cp++; push2((short)(*popaddr())); continue; case O_IND14: pc.cp++; push4((long)(*popaddr())); continue; case O_IND2: pc.cp++; push2(*(short *)(popaddr())); continue; case O_IND24: pc.cp++; push4((long)(*(short *)(popaddr()))); continue; case O_IND4: pc.cp++; push4(*(long *)(popaddr())); continue; case O_IND8: pc.cp++; pushsze8(*(struct sze8 *)(popaddr())); continue; case O_IND: tl = *pc.cp++; if (tl == 0) tl = *pc.usp++; tcp = popaddr(); tcp1 = pushsp((tl + 1) & ~1); blkcpy(tl, tcp, tcp1); continue; case O_CON1: push2((short)(*pc.cp++)); continue; case O_CON14: push4((long)(*pc.cp++)); continue; case O_CON2: pc.cp++; push2(*pc.sp++); continue; case O_CON24: pc.cp++; push4((long)(*pc.sp++)); continue; case O_CON4: pc.cp++; push4(*pc.lp++); continue; case O_CON8: pc.cp++; push8(*pc.dbp++); continue; case O_CON: tl = *pc.cp++; if (tl == 0) tl = *pc.usp++; tl = (tl + 1) & ~1; tcp = pushsp(tl); blkcpy(tl, pc.cp, tcp); pc.cp += (int)tl; continue; case O_CONG: tl = *pc.cp++; if (tl == 0) tl = *pc.usp++; tl1 = (tl + 1) & ~1; tcp = pushsp(tl1); blkcpy(tl1, pc.cp, tcp); pc.cp += (int)((tl + 2) & ~1); continue; case O_LVCON: tl = *pc.cp++; if (tl == 0) tl = *pc.usp++; tl = (tl + 1) & ~1; pushaddr(pc.cp); pc.cp += (int)tl; continue; case O_RANG2: tl = *pc.cp++; if (tl == 0) tl = *pc.sp++; tl1 = pop2(); push2((short)(RANG4(tl1, tl, *pc.sp++))); continue; case O_RANG42: tl = *pc.cp++; if (tl == 0) tl = *pc.sp++; tl1 = pop4(); push4(RANG4(tl1, tl, *pc.sp++)); continue; case O_RSNG2: tl = *pc.cp++; if (tl == 0) tl = *pc.sp++; tl1 = pop2(); push2((short)(RSNG4(tl1, tl))); continue; case O_RSNG42: tl = *pc.cp++; if (tl == 0) tl = *pc.sp++; tl1 = pop4(); push4(RSNG4(tl1, tl)); continue; case O_RANG4: pc.cp++; tl = *pc.lp++; tl1 = pop4(); push4(RANG4(tl1, tl, *pc.lp++)); continue; case O_RANG24: pc.cp++; tl = *pc.lp++; tl1 = pop2(); push2((short)(RANG4(tl1, tl, *pc.lp++))); continue; case O_RSNG4: pc.cp++; tl = pop4(); push4(RSNG4(tl, *pc.lp++)); continue; case O_RSNG24: pc.cp++; tl = pop2(); push2((short)(RSNG4(tl, *pc.lp++))); continue; case O_STLIM: pc.cp++; STLIM(); popsp((long)(sizeof(long))); continue; case O_LLIMIT: pc.cp++; LLIMIT(); popsp((long)(sizeof(char *)+sizeof(long))); continue; case O_BUFF: BUFF((long)(*pc.cp++)); continue; case O_HALT: pc.cp++; panic(PHALT); continue; case O_PXPBUF: pc.cp++; _cntrs = *pc.lp++; _rtns = *pc.lp++; NEWZ(&_pcpcount, (_cntrs + 1) * sizeof(long)); continue; case O_COUNT: pc.cp++; _pcpcount[*pc.usp++]++; continue; case O_CASE1OP: tl = *pc.cp++; /* tl = number of cases */ if (tl == 0) tl = *pc.usp++; tsp = pc.sp + tl; /* ptr to end of jump table */ tcp = (char *)tsp; /* tcp = ptr to case values */ tl1 = pop2(); /* tl1 = element to find */ for(; tl > 0; tl--) /* look for element */ if (tl1 == *tcp++) break; if (tl == 0) /* default case => error */ ERROR("Label of %D not found in case\n", tl1); pc.cp += *(tsp - tl); continue; case O_CASE2OP: tl = *pc.cp++; /* tl = number of cases */ if (tl == 0) tl = *pc.usp++; tsp = pc.sp + tl; /* ptr to end of jump table */ tsp1 = tsp; /* tsp1 = ptr to case values */ tl1 = (unsigned short)pop2();/* tl1 = element to find */ for(; tl > 0; tl--) /* look for element */ if (tl1 == *tsp1++) break; if (tl == 0) /* default case => error */ ERROR("Label of %D not found in case\n", tl1); pc.cp += *(tsp - tl); continue; case O_CASE4OP: tl = *pc.cp++; /* tl = number of cases */ if (tl == 0) tl = *pc.usp++; tsp = pc.sp + tl; /* ptr to end of jump table */ tlp = (long *)tsp; /* tlp = ptr to case values */ tl1 = pop4(); /* tl1 = element to find */ for(; tl > 0; tl--) /* look for element */ if (tl1 == *tlp++) break; if (tl == 0) /* default case => error */ ERROR("Label of %D not found in case\n", tl1); pc.cp += *(tsp - tl); continue; case O_ADDT: tl = *pc.cp++; /* tl has comparison length */ if (tl == 0) tl = *pc.usp++; tcp = pushsp((long)(0));/* tcp pts to first arg */ ADDT(tcp + tl, tcp + tl, tcp, tl >> 2); popsp(tl); continue; case O_SUBT: tl = *pc.cp++; /* tl has comparison length */ if (tl == 0) tl = *pc.usp++; tcp = pushsp((long)(0));/* tcp pts to first arg */ SUBT(tcp + tl, tcp + tl, tcp, tl >> 2); popsp(tl); continue; case O_MULT: tl = *pc.cp++; /* tl has comparison length */ if (tl == 0) tl = *pc.usp++; tcp = pushsp((long)(0));/* tcp pts to first arg */ MULT(tcp + tl, tcp + tl, tcp, tl >> 2); popsp(tl); continue; case O_INCT: tl = *pc.cp++; /* tl has number of args */ if (tl == 0) tl = *pc.usp++; tb = INCT(); popsp(tl*sizeof(long)); push2((short)(tb)); continue; case O_CTTOT: tl = *pc.cp++; /* tl has number of args */ if (tl == 0) tl = *pc.usp++; tl1 = tl * sizeof(long); tcp = pushsp((long)(0)) + tl1; /* tcp pts to result */ CTTOT(tcp); popsp(tl*sizeof(long)); continue; case O_CARD: tl = *pc.cp++; /* tl has comparison length */ if (tl == 0) tl = *pc.usp++; tcp = pushsp((long)(0));/* tcp pts to set */ tl1 = CARD(tcp, tl); popsp(tl); push2((short)(tl1)); continue; case O_IN: tl = *pc.cp++; /* tl has comparison length */ if (tl == 0) tl = *pc.usp++; tl1 = pop4(); /* tl1 is the element */ tcp = pushsp((long)(0));/* tcp pts to set */ tl2 = *pc.usp++; /* lower bound */ tb = IN(tl1, tl2, (long)(*pc.usp++), tcp); popsp(tl); push2((short)(tb)); continue; case O_ASRT: pc.cp++; ts = pop2(); ASRT(ts, ""); continue; case O_FOR1U: pc.cp++; tcp = popaddr(); /* tcp = ptr to index var */ if (*tcp < pop4()) { /* still going up */ tl = *tcp + 1; /* inc index var */ tl1 = *pc.sp++; /* index lower bound */ tl2 = *pc.sp++; /* index upper bound */ if (_runtst) RANG4(tl, tl1, tl2); *tcp = tl; /* update index var */ pc.cp += *pc.sp;/* return to top of loop */ continue; } pc.sp += 3; /* else fall through */ continue; case O_FOR2U: pc.cp++; tsp = (short *)popaddr(); /* tsp = ptr to index var */ if (*tsp < pop4()) { /* still going up */ tl = *tsp + 1; /* inc index var */ tl1 = *pc.sp++; /* index lower bound */ tl2 = *pc.sp++; /* index upper bound */ if (_runtst) RANG4(tl, tl1, tl2); *tsp = tl; /* update index var */ pc.cp += *pc.sp;/* return to top of loop */ continue; } pc.sp += 3; /* else fall through */ continue; case O_FOR4U: pc.cp++; tlp = (long *)popaddr(); /* tlp = ptr to index var */ if (*tlp < pop4()) { /* still going up */ tl = *tlp + 1; /* inc index var */ tl1 = *pc.lp++; /* index lower bound */ tl2 = *pc.lp++; /* index upper bound */ if (_runtst) RANG4(tl, tl1, tl2); *tlp = tl; /* update index var */ pc.cp += *pc.sp;/* return to top of loop */ continue; } pc.sp += 5; /* else fall through */ continue; case O_FOR1D: pc.cp++; tcp = popaddr(); /* tcp = ptr to index var */ if (*tcp > pop4()) { /* still going down */ tl = *tcp - 1; /* inc index var */ tl1 = *pc.sp++; /* index lower bound */ tl2 = *pc.sp++; /* index upper bound */ if (_runtst) RANG4(tl, tl1, tl2); *tcp = tl; /* update index var */ pc.cp += *pc.sp;/* return to top of loop */ continue; } pc.sp += 3; /* else fall through */ continue; case O_FOR2D: pc.cp++; tsp = (short *)popaddr(); /* tsp = ptr to index var */ if (*tsp > pop4()) { /* still going down */ tl = *tsp - 1; /* inc index var */ tl1 = *pc.sp++; /* index lower bound */ tl2 = *pc.sp++; /* index upper bound */ if (_runtst) RANG4(tl, tl1, tl2); *tsp = tl; /* update index var */ pc.cp += *pc.sp;/* return to top of loop */ continue; } pc.sp += 3; /* else fall through */ continue; case O_FOR4D: pc.cp++; tlp = (long *)popaddr(); /* tlp = ptr to index var */ if (*tlp > pop4()) { /* still going down */ tl = *tlp - 1; /* inc index var */ tl1 = *pc.lp++; /* index lower bound */ tl2 = *pc.lp++; /* index upper bound */ if (_runtst) RANG4(tl, tl1, tl2); *tlp = tl; /* update index var */ pc.cp += *pc.sp;/* return to top of loop */ continue; } pc.sp += 5; /* else fall through */ continue; case O_READE: pc.cp++; push2((short)(READE(curfile, bas((e + *pc.lp++))); continue; case O_READ4: pc.cp++; push4(READ4(curfile)); continue; case O_READC: pc.cp++; push2((short)(READC(curfile))); continue; case O_READ8: pc.cp++; push8(READ8(curfile)); continue; case O_READLN: pc.cp++; READLN(curfile); continue; case O_EOF: pc.cp++; push2((short)(TEOF(popaddr()))); continue; case O_EOLN: pc.cp++; push2((short)(TEOLN(popaddr()))); continue; case O_WRITEC: if (_runtst) { WRITEC(curfile); popsp((long)(*pc.cp++)); continue; } fputc(); popsp((long)(*pc.cp++)); continue; case O_WRITES: if (_runtst) { WRITES(curfile); popsp((long)(*pc.cp++)); continue; } fwrite(); popsp((long)(*pc.cp++)); continue; case O_WRITEF: if (_runtst) { WRITEF(curfile); popsp((long)(*pc.cp++)); continue; } fprintf(); popsp((long)(*pc.cp++)); continue; case O_WRITLN: pc.cp++; if (_runtst) { WRITLN(curfile); continue; } fputc('\n', ACTFILE(curfile)); continue; case O_PAGE: pc.cp++; if (_runtst) { PAGE(curfile); continue; } fputc(' ', ACTFILE(curfile)); continue; case O_NAM: pc.cp++; tl = pop4(); pushaddr(NAM(tl, base + *pc.lp++)); continue; case O_MAX: tl = *pc.cp++; if (tl == 0) tl = *pc.usp++; tl1 = pop4(); if (_runtst) { push4(MAX(tl1, tl, (long)(*pc.usp++))); continue; } tl1 -= tl; tl = *pc.usp++; push4(tl1 > tl ? tl1 : tl); continue; case O_MIN: tl = *pc.cp++; if (tl == 0) tl = *pc.usp++; tl1 = pop4(); push4(tl1 < tl ? tl1 : tl); continue; case O_UNIT: pc.cp++; curfile = UNIT(popaddr()); continue; case O_UNITINP: pc.cp++; curfile = INPUT; continue; case O_UNITOUT: pc.cp++; curfile = OUTPUT; continue; case O_MESSAGE: pc.cp++; PFLUSH(); curfile = ERR; continue; case O_PUT: pc.cp++; PUT(curfile); continue; case O_GET: pc.cp++; GET(curfile); continue; case O_FNIL: pc.cp++; pushaddr(FNIL(popaddr())); continue; case O_DEFNAME: pc.cp++; DEFNAME(); popsp((long)(2*sizeof(char *)+2*sizeof(long))); continue; case O_RESET: pc.cp++; RESET(); popsp((long)(2*sizeof(char *)+2*sizeof(long))); continue; case O_REWRITE: pc.cp++; REWRITE(); popsp((long)(2*sizeof(char *)+2*sizeof(long))); continue; case O_FILE: pc.cp++; pushaddr(ACTFILE(curfile)); continue; case O_REMOVE: pc.cp++; REMOVE(); popsp((long)(sizeof(char *)+sizeof(long))); continue; case O_FLUSH: pc.cp++; FLUSH(); popsp((long)(sizeof(char *))); continue; case O_PACK: pc.cp++; PACK(); popsp((long)(5*sizeof(long)+2*sizeof(char*))); continue; case O_UNPACK: pc.cp++; UNPACK(); popsp((long)(5*sizeof(long)+2*sizeof(char*))); continue; case O_ARGC: pc.cp++; push4((long)_argc); continue; case O_ARGV: tl = *pc.cp++; /* tl = size of char array */ if (tl == 0) tl = *pc.usp++; tcp = popaddr(); /* tcp = addr of char array */ tl1 = pop4(); /* tl1 = argv subscript */ ARGV(tl1, tcp, tl); continue; case O_CLCK: pc.cp++; push4(CLCK()); continue; case O_WCLCK: pc.cp++; push4(time(0)); continue; case O_SCLCK: pc.cp++; push4(SCLCK()); continue; case O_DISPOSE: tl = *pc.cp++; /* tl = size being disposed */ if (tl == 0) tl = *pc.usp++; tcp = popaddr(); /* ptr to ptr being disposed */ DISPOSE(tcp, tl); *(char **)tcp = (char *)0; continue; case O_NEW: tl = *pc.cp++; /* tl = size being new'ed */ if (tl == 0) tl = *pc.usp++; tcp = popaddr(); /* ptr to ptr being new'ed */ if (_runtst) { NEWZ(tcp, tl); continue; } NEW(tcp, tl); continue; case O_DATE: pc.cp++; DATE(popaddr()); continue; case O_TIME: pc.cp++; TIME(popaddr()); continue; case O_UNDEF: pc.cp++; pop8(); push2((short)(0)); continue; case O_ATAN: pc.cp++; push8(atan(pop8())); continue; case O_COS: pc.cp++; push8(cos(pop8())); continue; case O_EXP: pc.cp++; push8(exp(pop8())); continue; case O_LN: pc.cp++; if (_runtst) { push8(LN(pop8())); continue; } push8(log(pop8())); continue; case O_SIN: pc.cp++; push8(sin(pop8())); continue; case O_SQRT: pc.cp++; if (_runtst) { push8(SQRT(pop8())); continue; } push8(sqrt(pop8())); continue; case O_CHR2: case O_CHR4: pc.cp++; if (_runtst) { push2((short)(CHR(pop4()))); continue; } push2((short)(pop4())); continue; case O_ODD2: case O_ODD4: pc.cp++; push2((short)(pop4() & 1)); continue; case O_SUCC2: tl = *pc.cp++; if (tl == 0) tl = *pc.sp++; tl1 = pop4(); if (_runtst) { push2((short)(SUCC(tl1, tl, (long)(*pc.sp++)))); continue; } push2((short)(tl1 + 1)); pc.sp++; continue; case O_SUCC24: tl = *pc.cp++; if (tl == 0) tl = *pc.sp++; tl1 = pop4(); if (_runtst) { push4(SUCC(tl1, tl, (long)(*pc.sp++))); continue; } push4(tl1 + 1); pc.sp++; continue; case O_SUCC4: tl = *pc.cp++; if (tl == 0) tl = *pc.lp++; tl1 = pop4(); if (_runtst) { push4(SUCC(tl1, tl, (long)(*pc.lp++))); continue; } push4(tl1 + 1); pc.lp++; continue; case O_PRED2: tl = *pc.cp++; if (tl == 0) tl = *pc.sp++; tl1 = pop4(); if (_runtst) { push2((short)(PRED(tl1, tl, (long)(*pc.sp++)))); continue; } push2((short)(tl1 - 1)); pc.sp++; continue; case O_PRED24: tl = *pc.cp++; if (tl == 0) tl = *pc.sp++; tl1 = pop4(); if (_runtst) { push4(PRED(tl1, tl, (long)(*pc.sp++))); continue; } push4(tl1 - 1); pc.sp++; continue; case O_PRED4: tl = *pc.cp++; if (tl == 0) tl = *pc.lp++; tl1 = pop4(); if (_runtst) { push4(PRED(tl1, tl, (long)(*pc.lp++))); continue; } push4(tl1 - 1); pc.lp++; continue; case O_SEED: pc.cp++; push4(SEED(pop4())); continue; case O_RANDOM: pc.cp++; push8(RANDOM(pop8())); continue; case O_EXPO: pc.cp++; push4(EXPO(pop8())); continue; case O_SQR2: case O_SQR4: pc.cp++; tl = pop4(); push4(tl * tl); continue; case O_SQR8: pc.cp++; td = pop8(); push8(td * td); continue; case O_ROUND: pc.cp++; push4(ROUND(pop8())); continue; case O_TRUNC: pc.cp++; push4(TRUNC(pop8())); continue; default: panic(PBADOP); continue; } } } sh4(SEED(pop4())); continue; case O_RANDOM: pc.ccmd/px/interp.sed 644 0 33 1034 2552606503 7224 s,"@(#)interp.sed 1.4 1/26/81",&, s/calls.\$0,_setup/.data\ .align 2\ .comm Ll1,8\ .text/ s/calls.\$1,_push2/movw (sp)+,(sp)/ /calls.\$1,_push4/d /calls.\$2,_push8/d /calls.\$2,_pushsze8/d s/calls.\$1,_pushsp/subl2 (sp)+,sp\ movl sp,r0/ s/calls.\$0,_pop2/cvtwl (sp)+,r0/ s/calls.\$0,_pop4/movl (sp)+,r0/ s/calls.\$0,_pop8/movq (sp)+,r0/ s/calls.\$0,_popsze8/movq (sp)+,Ll1\ movaq Ll1,r0/ s/calls.\$1,_popsp/addl2 (sp)+,sp/ s/calls.\$0,_enableovrflo/bispsw $0xe0/ s/calls.\$0,_disableovrflo/bicpsw $0xe0/ s/*-4(fp)/(r11)/ s/-4(fp)/r11/ 1",&, s/calls.\$0,_setup/.data\ .align 2\ .comm Ll1,8\ .text/ s/calls.\$1,_push2/movw (sp)+,(sp)/ /calls.\$1,_push4/d /calls.\$2,_push8/d /calls.\$2,_pushsze8/d s/calls.\$1,_pushsp/subl2 (sp)+,sp\ movl sp,r0/ s/calls.\$0,_pop2/cvtwl (sp)+,r0/ s/calls.\$0,_pop4/movl (sp)+,r0/ s/calls.\$0,_pop8/movq (sp)+,r0/ s/calls.\$0,_popsze8/movq (sp)+,Ll1\ movaq Ll1,r0/ s/calls.\$1,_popsp/addl2 (sp)+,sp/ s/calls.\$0,_enableovrflo/bispsw $0xe0/ s/calls.\$0,_disableovrflo/bicpsw $0xe0/ s/*cmd/px/machdep.h 644 0 33 400 2552606503 6754 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)machdep.h 1.2 3/6/81"; */ #ifdef VAX #define pushaddr push4 #define popaddr (char *)pop4 #else #define pushaddr push2 #define popaddr (char *)pop2 #endif VAX p2/cvtwl (sp)+,r0/ s/calls.\$0,_pop4/movl (sp)+,r0/ s/calls.\$0,_pop8/movq (sp)+,r0/ s/calls.\$0,_popsze8/movq (sp)+,Ll1\ movaq Ll1,r0/ s/calls.\$1,_popsp/addl2 (s/,5؆< /,"cmd/px/make.ed1 644 0 33 115 2552606503 6515 e panics g,"@(#)make.ed1 1.3 3/6/81",s//&/ 1d 1,$s/^/#define / w! panics.h q har sccsid[] = "@(#)machdep.h 1.2 3/6/81"; */ #ifdef VAX #define pushaddr push4 #define popaddr (char *)pop4 #else #define pushaddr push2 #define popaddr (char *)pop2 #endif VAX p2/cvtwl (sp)+,r0/ s/calls.\$0,_pop4/movl (sp)+,r0/ s/calls.\$0,_pop8/movq (sp)+,r0/ s/calls.\$0,_popsze8/movq (sp)+,Ll1\ movaq Ll1,r0/ s/calls.\$1,_popsp/addl2 (s/,5< /,"((cmd/px/makefile 644 0 33 5066 2552606503 6737 SCCSID = "@(#)makefile 1.9 6/10/81" CFLAGS = -O DESTDIR = SRCDIR = /usr/ucb LIBDIR = /usr/lib PASCALDIR = /usr/src/cmd/pascal LIBPCDIR = /usr/src/lib/libpc CC = cc OPT = /lib/c2 AS = as RM = rm -f PSHDR = OPnames.h whoami.h objfmt.h opc.c pic.c PCHDR = libpc.h PXHDR = vars.h machdep.h PXSRC = int.c interp.c except.c utilities.c PXOBJ = int.o interp.o except.o utilities.o PXUTL = make.ed1 panics interp.sed clean.sed version.c sources: ${PXHDR} ${PXSRC} ${PXUTL} ${PSHDR}: cp ${PASCALDIR}/$@ $@ ${PCHDR}: cp ${LIBPCDIR}/$@ $@ .c.o: ${CC} ${CFLAGS} -c $*.c px: Version.c ${PXOBJ} ${CC} ${CFLAGS} -o px Version.c ${PXOBJ} -lpc -lm Version.c: version.c ${CC} ${CFLAGS} -o version version.c ./version >Version.c ${RM} version interp.o interp.s: interp.c ${CC} -S interp.c sed -f interp.sed tmp ${OPT} tmp interp.s /usr/lib/pc2 tmp mv tmp interp.s as -o interp.o interp.s panics.h: panics make.ed1 ex - h02opcs.h ${RM} opc install: px cp px ${DESTDIR}/usr/ucb/px clean: ${RM} *.o *.s px version opc* pic* OPnames.h objfmt.h libpc.h\ panics.h h02opcs.h errs lpr core tmp prt: interp.s sed -f clean.sed index ${SRCDIR}/vgrind -t -x index >lpr ${CC} ${CFLAGS} -o pic pic.c ${SRCDIR}/vgrind -t -n READ_ME makefile lst >>lpr ${SRCDIR}/vgrind -t ${PCHDR} ${PXHDR} objfmt.h panics.h whoami.h >>lpr ${SRCDIR}/vgrind -t ${PXSRC} >>lpr ./pic >lst ${SRCDIR}/vpr lst ${SRCDIR}/vpr -t lpr ${RM} index pic lst depend: sources /bin/grep '^#[ ]*include' *.c \ | sed '/<.*>/d' \ | sed 's/:[^"]*"\([^"]*\)".*/: \1/' \ | sed 's/\.c/.o/' >makedep 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 # DO NOT DELETE THIS LINE -- make depend uses it # DEPENDENCIES MUST END AT END OF FILE except.o: whoami.h except.o: panics.h except.o: vars.h int.o: whoami.h int.o: vars.h int.o: objfmt.h interp.o: whoami.h interp.o: objfmt.h interp.o: vars.h interp.o: panics.h interp.o: h02opcs.h interp.o: machdep.h interp.o: libpc.h opc.o: OPnames.h pic.o: OPnames.h utilities.o: whoami.h utilities.o: vars.h utilities.o: panics.h utilities.o: h02opcs.h # DEPENDENCIES MUST END AT END OF FILE # IF YOU PUT STUFF HERE IT WILL GO AWAY # see make depend above depend uses it # DEPENDENCIES MUST END AT END OF FILE except.o: whoami.h except.o: panics.h except.o: vars.h int.o: whoami.h int.o: vars.h int.o: objfmt.h interp.o: whoami.h interp.o: objfmt.h interp.o: vars.h interp.o: panics.h interp.o: h02opcs.h interp.o: machdep.h interp.o: libpc.h opc.o: OPnames.h pic.o: OPnames.h utilities.o: whoami.h utilities.o: vars.h utilities.o: panics.h utilities.o: h02opcs.h # DEPENDENCIES MUST END AT END OF FILE # IF YOU Pcmd/px/panics 644 0 33 155 2552606503 6411 "@(#)panics 1.1 1/7/81" PINTR 1 PHALT 2 PLIBERR 3 PSTKOVFLO 4 PSYSTEM 5 PNUMOVFLO 6 PSTKNEMP 7 PBADOP 8 except.o: whoami.h except.o: panics.h except.o: vars.h int.o: whoami.h int.o: vars.h int.o: objfmt.h interp.o: whoami.h interp.o: objfmt.h interp.o: vars.h interp.o: panics.h interp.o: h02opcs.h interp.o: machdep.h interp.o: libpc.h opc.o: OPnames.h pic.o: OPnames.h utilities.o: whoami.h utilities.o: vars.h ut/,5< /,"cmd/px/utilities.c 644 0 33 5215 2552606503 7412 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)utilities.c 1.4 3/6/81"; #include "whoami.h" #include "vars.h" #include "panics.h" #include "h02opcs.h" stats() { struct { long usr_time; long sys_time; long child_usr_time; long child_sys_time; } tbuf; register double l; register long count; # ifdef PROFILE # define proffile "/vb/grad/mckusick/px/profile/pcnt.out" struct cntrec { double counts[NUMOPS]; /* instruction counts */ long runs; /* number of interpreter runs */ long startdate; /* date profile started */ long usrtime; /* total user time consumed */ long systime; /* total system time consumed */ double stmts; /* number of pascal stmts executed */ } profdata; FILE *datafile; # endif PROFILE if (_nodump) return(0); times(&tbuf); # ifdef PROFILE datafile = fopen(proffile,"r"); if (datafile == NULL) goto skipprof; count = fread(&profdata,1,sizeof(profdata),datafile); if (count != sizeof(profdata)) goto skipprof; for (count = 0; count < NUMOPS; count++) profdata.counts[count] += _profcnts[count]; profdata.runs += 1; profdata.stmts += _stcnt; profdata.usrtime += tbuf.usr_time; profdata.systime += tbuf.sys_time; datafile = freopen(proffile,"w",datafile); if (datafile == NULL) goto skipprof; count = fwrite(&profdata,1,sizeof(profdata),datafile); if (count != sizeof(profdata)) goto skipprof; fclose(datafile); skipprof: # endif PROFILE l = tbuf.usr_time; l = l / HZ; fprintf(stderr, "\n%1ld statements executed in %04.2f seconds cpu time.\n", _stcnt,l); } backtrace(errnum) int errnum; { register struct disp *mydp; register struct stack *ap; register char *cp; register long i, linum; struct disply disp; if (_lino <= 0) { fputs("Program was not executed.\n",stderr); return; } disp = _display; if (errnum == PINTR) fputs("\n\tInterrupted in \"",stderr); else if (errnum == PHALT) fputs("\n\tHalted in \"",stderr); else fputs("\n\tError in \"",stderr); mydp = _dp; linum = _lino; for (;;) { ap = mydp->stp; i = linum - (((ap)->entry)->offset & 0177777); fprintf(stderr,"%s\"",(ap->entry)->name); if (_nodump == FALSE) fprintf(stderr,"+%D near line %D.",i,linum); fputc('\n',stderr); *mydp = (ap)->odisp; if (mydp <= &_display.frame[1]){ _display = disp; psexit(errnum); } mydp = (ap)->dp; linum = (ap)->lino; fputs("\tCalled by \"",stderr); } } psexit(code) int code; { if (_pcpcount != 0) PMFLUSH(_cntrs, _rtns, _pcpcount); if (_mode == PIX) { fputs("Execution terminated",stderr); if (code) fputs(" abnormally",stderr); fputc('.',stderr); fputc('\n',stderr); } stats(); exit(code); } fprintf(stderr,"+%D near line %D.",i,linum); fputc('\n',stderr); *mydp = (ap)->odisp; if (mydp <= &_display.frame[1]){ _display = disp; psexit(errnum); } mydp = (ap)->dp; linum = (ap)->lino; fputs("\tCalled by \"",stderr); } } psexit(code) int code; { if (_pcpcount != 0) PMFLUSH(_cntrs, _rtns, _pcpcount); if (_mode == PIX) { fputs("Execucmd/px/vars.h 644 0 33 17575 2552606504 6414 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)vars.h 1.7 4/1/81"; */ #include /* * px - Berkeley Pascal interpreter * * Version 4.0, January 1981 * * Original version by Ken Thompson * * Substantial revisions by Bill Joy and Chuck Haley * November-December 1976 * * Rewritten for VAX 11/780 by Kirk McKusick * Fall 1978 * * Rewritten in ``C'' using libpc by Kirk McKusick * Winter 1981 * * Px is described in detail in the "PX 4.0 Implementation Notes" * The source code for px is in several major pieces: * * int.c C main program which reads in interpreter code * interp.c Driver including main interpreter loop and * the interpreter instructions grouped by their * positions in the interpreter table. * except.c Handlers for interpreter specific errors not * included in libpc. * utilities.c Interpreter exit, backtrace, and runtime statistics. * * In addition there are several headers defining mappings for panic * names into codes, and a definition of the interpreter transfer * table. These are made by the script make.ed1 in this directory and * the routine opc.c from ${PASCALDIR}. (see the makefile for details) */ #define PXPFILE "pmon.out" #define BITSPERBYTE 8 #define BITSPERLONG (BITSPERBYTE * sizeof(long)) #define HZ 60 #define MAXLVL 20 #define NAMSIZ 76 #define MAXFILES 32 #define PREDEF 2 #ifdef VAX #define STDLVL ((struct iorec *)(0x7ffffff1)) #define GLVL ((struct iorec *)(0x7ffffff0)) #else #define STD((LVL ((struct iorec *)(0xfff1)) #define GLVL ((struct iorec *)(0xfff0)) #endif VAX #define FILNIL ((struct iorec *)(0)) #define INPUT ((struct iorec *)(&input)) #define OUTPUT ((struct iorec *)(&output)) #define ERR ((struct iorec *)(&_err)) #define PX 0 /* normal run of px */ #define PIX 1 /* load and go */ #define PIPE 2 /* bootstrap via a pipe */ #define releq 0 #define relne 2 #define rellt 4 #define relgt 6 #define relle 8 #define relge 10 typedef enum {FALSE, TRUE} bool; /* * interrupt and allocation routines */ extern long createtime; extern char *PALLOC(); extern char *malloc(); extern long time(); extern intr(); extern memsize(); extern except(); extern syserr(); extern liberr(); /* * stack routines and structures */ struct sze8 { char element[8]; }; extern short pop2(); extern long pop4(); extern double pop8(); extern struct sze8 popsze8(); extern char *pushsp(); /* * emulated pc types */ union progcntr { char *cp; unsigned char *ucp; short *sp; unsigned short *usp; long *lp; double *dbp; struct hdr *hdrp; }; /* * THE RUNTIME DISPLAY * * The entries in the display point to the active static block marks. * The first entry in the display is for the global variables, * then the procedure or function at level one, etc. * Each display entry points to a stack frame as shown: * * base of stack frame * --------------- * | | * | block mark | * | | * --------------- <-- display entry "stp" points here * | | <-- display entry "locvars" points here * | local | * | variables | * | | * --------------- * | | * | expression | * | temporary | * | storage | * | | * - - - - - - - - * * The information in the block mark is thus at positive offsets from * the display.stp pointer entries while the local variables are at negative * offsets from display.locvars. The block mark actually consists of * two parts. The first part is created at CALL and the second at entry, * i.e. BEGIN. Thus: * * ------------------------- * | | * | Saved lino | * | Saved lc | * | Saved dp | * | | * ------------------------- * | | * | Saved (dp) | * | | * | Pointer to current | * | routine header info | * | | * | Saved value of | * | "curfile" | * | | * | Empty tos value | * | | * ------------------------- */ /* * runtime display structure */ struct disp { char *locvars; /* pointer to local variables */ struct stack *stp; /* pointer to local stack frame */ }; struct stack { char *tos; /* pointer to top of stack frame */ struct iorec *file; /* pointer to active file name */ struct hdr { long framesze; /* number of bytes of local vars */ long nargs; /* number of bytes of arguments */ bool tests; /* TRUE => perform runtime tests */ short offset; /* offset of procedure in source file */ char name[1]; /* name of active procedure */ } *entry; struct disp odisp; /* previous display value for this level */ struct disp *dp; /* pointer to active display entry */ union progcntr pc; /* previous location counter */ long lino; /* previous line number */ }; union disply { struct disp frame[MAXLVL]; char *raw[2*MAXLVL]; }; /* * formal routine structure */ struct formalrtn { char *fentryaddr; /* formal entry point */ long fbn; /* block number of function */ struct disp fdisp[ MAXLVL ]; /* saved at first passing */ }; /* * program variables */ extern union disply _display; /* runtime display */ extern struct disp *_dp; /* ptr to active frame */ extern long _lino; /* current line number */ extern int _argc; /* number of passed args */ extern char **_argv; /* values of passed args */ extern bool _nodump; /* TRUE => no post mortum dump */ extern bool _runtst; /* TRUE => runtime tests */ extern long _mode; /* execl by PX, PIPE, or PIX */ extern long _stlim; /* statement limit */ extern long _stcnt; /* statement count */ extern long _seed; /* random number seed */ extern char *_maxptr; /* maximum valid pointer */ extern char *_minptr; /* minimum valid pointer */ extern long *_pcpcount; /* pointer to pxp buffer */ extern long _cntrs; /* number of counters */ extern long _rtns; /* number of routine cntrs */ /* * The file i/o routines maintain a notion of a "current file". * A pointer to this file structure is kept in "curfile". * * file structures */ struct iorechd { char *fileptr; /* ptr to file window */ long lcount; /* number of lines printed */ long llimit; /* maximum number of text lines */ FILE *fbuf; /* FILE ptr */ struct iorec *fchain; /* chain to next file */ struct iorec *flev; /* ptr to associated file variable */ char *pfname; /* ptr to name of file */ short funit; /* file status flags */ short fblk; /* index into active file table */ long fsize; /* size of elements in the file */ char fname[NAMSIZ]; /* name of associated UNIX file */ }; struct iorec { char *fileptr; /* ptr to file window */ long lcount; /* number of lines printed */ long llimit; /* maximum number of text lines */ FILE *fbuf; /* FILE ptr */ struct iorec *fchain; /* chain to next file */ struct iorec *flev; /* ptr to associated file variable */ char *pfname; /* ptr to name of file */ short funit; /* file status flags */ short fblk; /* index into active file table */ long fsize; /* size of elements in the file */ char fname[NAMSIZ]; /* name of associated UNIX file */ char buf[BUFSIZ]; /* I/O buffer */ char window[1]; /* file window element */ }; /* * unit flags */ #define FDEF 0x80 /* 1 => reserved file name */ #define FTEXT 0x40 /* 1 => text file, process EOLN */ #define FWRITE 0x20 /* 1 => open for writing */ #define FREAD 0x10 /* 1 => open for reading */ #define TEMP 0x08 /* 1 => temporary file */ #define SYNC 0x04 /* 1 => window is out of sync */ #define EOLN 0x02 /* 1 => at end of line */ #define EOFF 0x01 /* 1 => at end of file */ /* * file routines */ extern struct iorec *GETNAME(); extern char *MKTEMP(); /* * file record variables */ extern struct iorechd _fchain; /* head of active file chain */ extern struct iorec *_actfile[]; /* table of active files */ extern long _filefre; /* last used entry in _actfile */ /* * standard files */ extern struct iorechd input; extern struct iorechd output; extern struct iorechd _err; /* * Px execution profile array */ #ifdef PROFILE #define NUMOPS 256 extern long _profcnts[NUMOPS]; #endif PROFILE utines */ extern struct iorec *GETNAME(); extern char *MKTEMP(); /* * file record variables */ extern struct iorechd _fchain; cmd/px/version.c 644 0 33 565 2552606504 7050 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)version.c 1.2 3/6/81"; /* * this writes the declaration of the current time stamp * onto standard output. * useful for making Version.c to give the creation date for px. */ extern long time(); main() { printf( "long createtime = %D;\n" , time(0) ); } PROFILE utines */ extern struct iorec *GETNAME/,58< /,"cmd/px/whoami.h 644 0 33 1041 2552606504 6662 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)piwhoami.h 1.2 3/6/81"; */ /* * am i generating an obj file (OBJ), * postfix binary input to the 2nd pass of the portable c compiler (PC), * or pTrees (PTREE)? */ #define OBJ #undef PC #undef PTREE /* * am i the vax or the pdp11 version */ #define VAX #undef PDP11 #define DEC11 /* * am i pi or pxp? */ #define PI #undef PXP /* * am i both passes, or am i only one of the two passes pi0 or pi1? */ #define PI01 #undef PI0 #undef PI1 the University of California */ /* static char sccsid[] = "@(#)piwhoami.h 1.2 3/6/81"; */ /* * am i generating an obj file (OBJ), * postfix binary input to the 2nd pass of the portable c compiler (PC), * or pTrees (PTREE)? */ #define OBJ #undef PC #undef PTREE /* * am i the vax or the pdp11 version */ #define VAX #undef PDP11 #define DEC11 /* * am i pi or pxp? */ #define PI #undef PXP /* * am i both passes, or am i only one of the two passes pi0 or pi1? */ #decmd/lex/ 775 0 33 0 2552547267 5321 cmd/lex/Makefile 644 0 33 1013 2254261765 7032 ((CFLAGS = -O all: lex lex: lmain.o y.tab.o sub1.o sub2.o header.o cc lmain.o y.tab.o sub1.o sub2.o header.o -o lex smallex: cc -DSMALL -O lmain.c y.tab.c sub1.c sub2.c header.c -o smallex y.tab.c: parser.y yacc parser.y lmain.o:lmain.c ldefs.c once.c cc -c -O lmain.c sub1.o: sub1.c ldefs.c cc -c -O sub1.c sub2.o: sub2.c ldefs.c cc -c -O sub2.c header.o: header.c ldefs.c cc -c -O header.c install: all install -s lex $(DESTDIR)/usr/bin install -c ncform $(DESTDIR)/usr/lib/lex clean: rm -f *.o lex y.tab.c all: lex lex: lmain.o y.tab.o sub1.o sub2.o header.o cc lmain.o y.tab.o sub1.o sub2.o header.o -o lex smallex: cc -DSMALL -O lmain.c y.tab.c sub1.c sub2.c header.c -o smallex y.tab.c: parser.y yacc parser.y lmain.o:lmain.c ldefs.c once.c cc -c -O lmain.c sub1.o: sub1.c ldefs.c cc -c -O sub1.c sub2.o: sub2.c ldefs.c cc -c -O sub2.c header.o: header.c ldefs.c cc -c -O header.c install: all install -s lex $(DESTDIR)/usr/bin install -c ncform $(DESTDIR)/usr/lib/lex clean: rm -f *.o lcmd/lex/header.c 644 0 33 7251 2111463455 6770 # include "ldefs.c" phead1(){ ratfor ? rhd1() : chd1(); } chd1(){ fprintf(fout,"# include \"stdio.h\"\n"); if (ZCH>NCH) fprintf(fout, "# define U(x) ((x)&0377)\n"); else fprintf(fout, "# define U(x) x\n"); fprintf(fout, "# define NLSTATE yyprevious=YYNEWLINE\n"); fprintf(fout,"# define BEGIN yybgin = yysvec + 1 +\n"); fprintf(fout,"# define INITIAL 0\n"); fprintf(fout,"# define YYLERR yysvec\n"); fprintf(fout,"# define YYSTATE (yyestate-yysvec-1)\n"); if(optim) fprintf(fout,"# define YYOPTIM 1\n"); # ifdef DEBUG fprintf(fout,"# define LEXDEBUG 1\n"); # endif fprintf(fout,"# define YYLMAX 200\n"); fprintf(fout,"# define output(c) putc(c,yyout)\n"); fprintf(fout, "%s%d%s\n", "# define input() (((yytchar=yysptr>yysbuf?U(*--yysptr):getc(yyin))==", ctable['\n'], "?(yylineno++,yytchar):yytchar)==EOF?0:yytchar)"); fprintf(fout, "# define unput(c) {yytchar= (c);if(yytchar=='\\n')yylineno--;*yysptr++=yytchar;}\n"); fprintf(fout,"# define yymore() (yymorfg=1)\n"); fprintf(fout,"# define ECHO fprintf(yyout, \"%%s\",yytext)\n"); fprintf(fout,"# define REJECT { nstr = yyreject(); goto yyfussy;}\n"); fprintf(fout,"int yyleng; extern char yytext[];\n"); fprintf(fout,"int yymorfg;\n"); fprintf(fout,"extern char *yysptr, yysbuf[];\n"); fprintf(fout,"int yytchar;\n"); fprintf(fout,"FILE *yyin ={stdin}, *yyout ={stdout};\n"); fprintf(fout,"extern int yylineno;\n"); fprintf(fout,"struct yysvf { \n"); fprintf(fout,"\tstruct yywork *yystoff;\n"); fprintf(fout,"\tstruct yysvf *yyother;\n"); fprintf(fout,"\tint *yystops;};\n"); fprintf(fout,"struct yysvf *yyestate;\n"); fprintf(fout,"extern struct yysvf yysvec[], *yybgin;\n"); } rhd1(){ fprintf(fout,"integer function yylex(dummy)\n"); fprintf(fout,"define YYLMAX 200\n"); fprintf(fout,"define ECHO call yyecho(yytext,yyleng)\n"); fprintf(fout,"define REJECT nstr = yyrjct(yytext,yyleng);goto 30998\n"); fprintf(fout,"integer nstr,yylook,yywrap\n"); fprintf(fout,"integer yyleng, yytext(YYLMAX)\n"); fprintf(fout,"common /yyxel/ yyleng, yytext\n"); fprintf(fout,"common /yyldat/ yyfnd, yymorf, yyprev, yybgin, yylsp, yylsta\n"); fprintf(fout,"integer yyfnd, yymorf, yyprev, yybgin, yylsp, yylsta(YYLMAX)\n"); fprintf(fout,"for(;;){\n"); fprintf(fout,"\t30999 nstr = yylook(dummy)\n"); fprintf(fout,"\tgoto 30998\n"); fprintf(fout,"\t30000 k = yywrap(dummy)\n"); fprintf(fout,"\tif(k .ne. 0){\n"); fprintf(fout,"\tyylex=0; return; }\n"); fprintf(fout,"\t\telse goto 30998\n"); } phead2(){ if(!ratfor)chd2(); } chd2(){ fprintf(fout,"while((nstr = yylook()) >= 0)\n"); fprintf(fout,"yyfussy: switch(nstr){\n"); fprintf(fout,"case 0:\n"); fprintf(fout,"if(yywrap()) return(0); break;\n"); } ptail(){ if(!pflag) ratfor ? rtail() : ctail(); pflag = 1; } ctail(){ fprintf(fout,"case -1:\nbreak;\n"); /* for reject */ fprintf(fout,"default:\n"); fprintf(fout,"fprintf(yyout,\"bad switch yylook %%d\",nstr);\n"); fprintf(fout,"} return(0); }\n"); fprintf(fout,"/* end of yylex */\n"); } rtail(){ register int i; fprintf(fout,"\n30998 if(nstr .lt. 0 .or. nstr .gt. %d)goto 30999\n",casecount); fprintf(fout,"nstr = nstr + 1\n"); fprintf(fout,"goto(\n"); for(i=0; i # define PP 1 # ifdef unix # define CWIDTH 7 # define CMASK 0177 # define ASCII 1 # endif # ifdef gcos # define CWIDTH 9 # define CMASK 0777 # define ASCII 1 # endif # ifdef ibm # define CWIDTH 8 # define CMASK 0377 # define EBCDIC 1 # endif # ifdef ASCII # define NCH 128 # endif # ifdef EBCDIC # define NCH 256 # endif # define TOKENSIZE 1000 # define DEFSIZE 40 # define DEFCHAR 1000 # define STARTCHAR 100 # define STARTSIZE 256 # define CCLSIZE 1000 # ifdef SMALL # define TREESIZE 600 # define NTRANS 1500 # define NSTATES 300 # define MAXPOS 1500 # define NOUTPUT 1500 # endif # ifndef SMALL # define TREESIZE 1000 # define NSTATES 500 # define MAXPOS 2500 # define NTRANS 2000 # define NOUTPUT 3000 # endif # define NACTIONS 100 # define ALITTLEEXTRA 30 # define RCCL NCH+90 # define RNCCL NCH+91 # define RSTR NCH+92 # define RSCON NCH+93 # define RNEWE NCH+94 # define FINAL NCH+95 # define RNULLS NCH+96 # define RCAT NCH+97 # define STAR NCH+98 # define PLUS NCH+99 # define QUEST NCH+100 # define DIV NCH+101 # define BAR NCH+102 # define CARAT NCH+103 # define S1FINAL NCH+104 # define S2FINAL NCH+105 # define DEFSECTION 1 # define RULESECTION 2 # define ENDSECTION 5 # define TRUE 1 # define FALSE 0 # define PC 1 # define PS 1 # ifdef DEBUG # define LINESIZE 110 extern int yydebug; extern int debug; /* 1 = on */ extern int charc; # endif # ifndef DEBUG # define freturn(s) s # endif extern int sargc; extern char **sargv; extern char buf[520]; extern int ratfor; /* 1 = ratfor, 0 = C */ extern int yyline; /* line number of file */ extern int sect; extern int eof; extern int lgatflg; extern int divflg; extern int funcflag; extern int pflag; extern int casecount; extern int chset; /* 1 = char set modified */ extern FILE *fin, *fout, *fother, *errorf; extern int fptr; extern char *ratname, *cname; extern int prev; /* previous input character */ extern int pres; /* present input character */ extern int peek; /* next input character */ extern int *name; extern int *left; extern int *right; extern int *parent; extern char *nullstr; extern int tptr; extern char pushc[TOKENSIZE]; extern char *pushptr; extern char slist[STARTSIZE]; extern char *slptr; extern char **def, **subs, *dchar; extern char **sname, *schar; extern char *ccl; extern char *ccptr; extern char *dp, *sp; extern int dptr, sptr; extern char *bptr; /* store input position */ extern char *tmpstat; extern int count; extern int **foll; extern int *nxtpos; extern int *positions; extern int *gotof; extern int *nexts; extern char *nchar; extern int **state; extern int *sfall; /* fallback state num */ extern char *cpackflg; /* true if state has been character packed */ extern int *atable, aptr; extern int nptr; extern char symbol[NCH]; extern char cindex[NCH]; extern int xstate; extern int stnum; extern int ctable[]; extern int ZCH; extern int ccount; extern char match[NCH]; extern char extra[NACTIONS]; extern char *pcptr, *pchar; extern int pchlen; extern int nstates, maxpos; extern int yytop; extern int report; extern int ntrans, treesize, outsize; extern long rcount; extern int optim; extern int *verify, *advance, *stoff; extern int scon; extern char *psave; extern char *calloc(), *myalloc(); extern int buserr(), segviol(); mbol[NCH]; extern char cindex[NCH]; extern int xstate; extern int stnum; extern int ctable[]; extern int ZCH; extern int ccount; extern char match[NCH]; extern char extra[NACTIONS]; extern char *pcptr, *pchar; extern int pchlen; extern int nstates, maxpos; extern int yytop; extern int report; extern int ntrans, tcmd/lex/lmain.c 644 0 33 13143 2111463455 6655 ((# include "ldefs.c" # include "once.c" /* lex [-[drcyvntf]] [file] ... [file] */ /* Copyright 1976, Bell Telephone Laboratories, Inc., written by Eric Schmidt, August 27, 1976 */ main(argc,argv) int argc; char **argv; { register int i; # ifdef DEBUG #include signal(SIGBUS,buserr); signal(SIGSEGV,segviol); # endif while (argc > 1 && argv[1][0] == '-' ){ i = 0; while(argv[1][++i]){ switch (argv[1][i]){ # ifdef DEBUG case 'd': debug++; break; case 'y': yydebug = TRUE; break; # endif case 'r': case 'R': ratfor=TRUE; break; case 'c': case 'C': ratfor=FALSE; break; case 't': case 'T': fout = stdout; errorf = stderr; break; case 'v': case 'V': report = 1; break; case 'f': case 'F': optim = FALSE; break; case 'n': case 'N': report = 0; break; default: warning("Unknown option %c",argv[1][i]); } } argc--; argv++; } sargc = argc; sargv = argv; if (argc > 1){ fin = fopen(argv[++fptr], "r"); /* open argv[1] */ sargc--; sargv++; } else fin = stdin; if(fin == NULL) error ("Can't read input file %s",argc>1?argv[1]:"standard input"); gch(); /* may be gotten: def, subs, sname, schar, ccl, dchar */ get1core(); /* may be gotten: name, left, right, nullstr, parent */ scopy("INITIAL",sp); sname[0] = sp; sp += slength("INITIAL") + 1; sname[1] = 0; if(yyparse(0)) exit(1); /* error return code */ /* may be disposed of: def, subs, dchar */ free1core(); /* may be gotten: tmpstat, foll, positions, gotof, nexts, nchar, state, atable, sfall, cpackflg */ get2core(); ptail(); mkmatch(); # ifdef DEBUG if(debug) pccl(); # endif sect = ENDSECTION; if(tptr>0)cfoll(tptr-1); # ifdef DEBUG if(debug)pfoll(); # endif cgoto(); # ifdef DEBUG if(debug){ printf("Print %d states:\n",stnum+1); for(i=0;i<=stnum;i++)stprt(i); } # endif /* may be disposed of: positions, tmpstat, foll, state, name, left, right, parent, ccl, schar, sname */ /* may be gotten: verify, advance, stoff */ free2core(); get3core(); layout(); /* may be disposed of: verify, advance, stoff, nexts, nchar, gotof, atable, ccpackflg, sfall */ # ifdef DEBUG free3core(); # endif if (ZCH>NCH) cname="/usr/lib/lex/ebcform"; fother = fopen(ratfor?ratname:cname,"r"); if(fother == NULL) error("Lex driver missing, file %s",ratfor?ratname:cname); while ( (i=getc(fother)) != EOF) putc(i,fout); fclose(fother); fclose(fout); if( # ifdef DEBUG debug || # endif report == 1)statistics(); fclose(stdout); fclose(stderr); exit(0); /* success return code */ } get1core(){ register int i, val; register char *p; ccptr = ccl = myalloc(CCLSIZE,sizeof(*ccl)); pcptr = pchar = myalloc(pchlen, sizeof(*pchar)); def = myalloc(DEFSIZE,sizeof(*def)); subs = myalloc(DEFSIZE,sizeof(*subs)); dp = dchar = myalloc(DEFCHAR,sizeof(*dchar)); sname = myalloc(STARTSIZE,sizeof(*sname)); sp = schar = myalloc(STARTCHAR,sizeof(*schar)); if(ccl == 0 || def == 0 || subs == 0 || dchar == 0 || sname == 0 || schar == 0) error("Too little core to begin"); } free1core(){ cfree(def,DEFSIZE,sizeof(*def)); cfree(subs,DEFSIZE,sizeof(*subs)); cfree(dchar,DEFCHAR,sizeof(*dchar)); } get2core(){ register int i, val; register char *p; gotof = myalloc(nstates,sizeof(*gotof)); nexts = myalloc(ntrans,sizeof(*nexts)); nchar = myalloc(ntrans,sizeof(*nchar)); state = myalloc(nstates,sizeof(*state)); atable = myalloc(nstates,sizeof(*atable)); sfall = myalloc(nstates,sizeof(*sfall)); cpackflg = myalloc(nstates,sizeof(*cpackflg)); tmpstat = myalloc(tptr+1,sizeof(*tmpstat)); foll = myalloc(tptr+1,sizeof(*foll)); nxtpos = positions = myalloc(maxpos,sizeof(*positions)); if(tmpstat == 0 || foll == 0 || positions == 0 || gotof == 0 || nexts == 0 || nchar == 0 || state == 0 || atable == 0 || sfall == 0 || cpackflg == 0 ) error("Too little core for state generation"); for(i=0;i<=tptr;i++)foll[i] = 0; } free2core(){ cfree(positions,maxpos,sizeof(*positions)); cfree(tmpstat,tptr+1,sizeof(*tmpstat)); cfree(foll,tptr+1,sizeof(*foll)); cfree(name,treesize,sizeof(*name)); cfree(left,treesize,sizeof(*left)); cfree(right,treesize,sizeof(*right)); cfree(parent,treesize,sizeof(*parent)); cfree(nullstr,treesize,sizeof(*nullstr)); cfree(state,nstates,sizeof(*state)); cfree(sname,STARTSIZE,sizeof(*sname)); cfree(schar,STARTCHAR,sizeof(*schar)); cfree(ccl,CCLSIZE,sizeof(*ccl)); } get3core(){ register int i, val; register char *p; verify = myalloc(outsize,sizeof(*verify)); advance = myalloc(outsize,sizeof(*advance)); stoff = myalloc(stnum+2,sizeof(*stoff)); if(verify == 0 || advance == 0 || stoff == 0) error("Too little core for final packing"); } # ifdef DEBUG free3core(){ cfree(advance,outsize,sizeof(*advance)); cfree(verify,outsize,sizeof(*verify)); cfree(stoff,stnum+1,sizeof(*stoff)); cfree(gotof,nstates,sizeof(*gotof)); cfree(nexts,ntrans,sizeof(*nexts)); cfree(nchar,ntrans,sizeof(*nchar)); cfree(atable,nstates,sizeof(*atable)); cfree(sfall,nstates,sizeof(*sfall)); cfree(cpackflg,nstates,sizeof(*cpackflg)); } # endif char *myalloc(a,b) int a,b; { register int i; i = calloc(a, b); if(i==0) warning("OOPS - calloc returns a 0"); else if(i == -1){ # ifdef DEBUG warning("calloc returns a -1"); # endif return(0); } return(i); } # ifdef DEBUG buserr(){ fflush(errorf); fflush(fout); fflush(stdout); fprintf(errorf,"Bus error\n"); if(report == 1)statistics(); fflush(errorf); } segviol(){ fflush(errorf); fflush(fout); fflush(stdout); fprintf(errorf,"Segmentation violation\n"); if(report == 1)statistics(); fflush(errorf); } # endif yyerror(s) char *s; { fprintf(stderr, "%s\n", s); } ng("OOPS - calloc returns a 0"); else if(i == -1){ # ifdef DEBUG warning("calloc returns a -1"); # endif return(0); } return(i); } # ifdef DEBUG buserr(){ fflush(errorf); fflush(fout); fflush(stdout); fprintf(errorf,"Bus error\n"); if(report == 1)statistics(); fflush(errorf); } segviol(){ fflush(errorf); fflush(fout); fflush(stdout); fprintf(errorf,"Segmentation violation\n"); if(report ==cmd/lex/ncform 644 0 33 7515 2111463455 6606 int yylineno =1; # define YYU(x) x # define NLSTATE yyprevious=YYNEWLINE char yytext[YYLMAX]; struct yysvf *yylstate [YYLMAX], **yylsp, **yyolsp; char yysbuf[YYLMAX]; char *yysptr = yysbuf; int *yyfnd; extern struct yysvf *yyestate; int yyprevious = YYNEWLINE; yylook(){ register struct yysvf *yystate, **lsp; register struct yywork *yyt; struct yysvf *yyz; int yych; struct yywork *yyr; # ifdef LEXDEBUG int debug; # endif char *yylastch; /* start off machines */ # ifdef LEXDEBUG debug = 0; # endif if (!yymorfg) yylastch = yytext; else { yymorfg=0; yylastch = yytext+yyleng; } for(;;){ lsp = yylstate; yyestate = yystate = yybgin; if (yyprevious==YYNEWLINE) yystate++; for (;;){ # ifdef LEXDEBUG if(debug)fprintf(yyout,"state %d\n",yystate-yysvec-1); # endif yyt = yystate->yystoff; if(yyt == yycrank){ /* may not be any transitions */ yyz = yystate->yyother; if(yyz == 0)break; if(yyz->yystoff == yycrank)break; } *yylastch++ = yych = input(); tryagain: # ifdef LEXDEBUG if(debug){ fprintf(yyout,"char "); allprint(yych); putchar('\n'); } # endif yyr = yyt; if ( (int)yyt > (int)yycrank){ yyt = yyr + yych; if (yyt <= yytop && yyt->verify+yysvec == yystate){ if(yyt->advance+yysvec == YYLERR) /* error transitions */ {unput(*--yylastch);break;} *lsp++ = yystate = yyt->advance+yysvec; goto contin; } } # ifdef YYOPTIM else if((int)yyt < (int)yycrank) { /* r < yycrank */ yyt = yyr = yycrank+(yycrank-yyt); # ifdef LEXDEBUG if(debug)fprintf(yyout,"compressed state\n"); # endif yyt = yyt + yych; if(yyt <= yytop && yyt->verify+yysvec == yystate){ if(yyt->advance+yysvec == YYLERR) /* error transitions */ {unput(*--yylastch);break;} *lsp++ = yystate = yyt->advance+yysvec; goto contin; } yyt = yyr + YYU(yymatch[yych]); # ifdef LEXDEBUG if(debug){ fprintf(yyout,"try fall back character "); allprint(YYU(yymatch[yych])); putchar('\n'); } # endif if(yyt <= yytop && yyt->verify+yysvec == yystate){ if(yyt->advance+yysvec == YYLERR) /* error transition */ {unput(*--yylastch);break;} *lsp++ = yystate = yyt->advance+yysvec; goto contin; } } if ((yystate = yystate->yyother) && (yyt= yystate->yystoff) != yycrank){ # ifdef LEXDEBUG if(debug)fprintf(yyout,"fall back to state %d\n",yystate-yysvec-1); # endif goto tryagain; } # endif else {unput(*--yylastch);break;} contin: # ifdef LEXDEBUG if(debug){ fprintf(yyout,"state %d char ",yystate-yysvec-1); allprint(yych); putchar('\n'); } # endif ; } # ifdef LEXDEBUG if(debug){ fprintf(yyout,"stopped at %d with ",*(lsp-1)-yysvec-1); allprint(yych); putchar('\n'); } # endif while (lsp-- > yylstate){ *yylastch-- = 0; if (*lsp != 0 && (yyfnd= (*lsp)->yystops) && *yyfnd > 0){ yyolsp = lsp; if(yyextra[*yyfnd]){ /* must backup */ while(yyback((*lsp)->yystops,-*yyfnd) != 1 && lsp > yylstate){ lsp--; unput(*yylastch--); } } yyprevious = YYU(*yylastch); yylsp = lsp; yyleng = yylastch-yytext+1; yytext[yyleng] = 0; # ifdef LEXDEBUG if(debug){ fprintf(yyout,"\nmatch "); sprint(yytext); fprintf(yyout," action %d\n",*yyfnd); } # endif return(*yyfnd++); } unput(*yylastch); } if (yytext[0] == 0 /* && feof(yyin) */) { yysptr=yysbuf; return(0); } yyprevious = yytext[0] = input(); if (yyprevious>0) output(yyprevious); yylastc((h=yytext; # ifdef LEXDEBUG if(debug)putchar('\n'); # endif } } yyback(p, m) int *p; { if (p==0) return(0); while (*p) { if (*p++ == m) return(1); } return(0); } /* the following are only used in the lex library */ yyinput(){ return(input()); } yyoutput(c) int c; { output(c); } yyunput(c) int c; { unput(c); } } if (yytext[0] == 0 /* && feof(yyin) */) { yysptr=yysbuf; return(0); } yyprevious = yytext[0] = input(); if (yyprevious>0) output(yyprevious); yylastccmd/lex/once.c 644 0 33 6534 2111463456 6470 /* because of external definitions, this code should occur only once */ # ifdef ASCII int ctable[2*NCH] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,101,102,103,104,105,106,107,108,109, 110,111,112,113,114,115,116,117,118,119, 120,121,122,123,124,125,126,127}; # endif # ifdef EBCDIC int ctable[2*NCH] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,101,102,103,104,105,106,107,108,109, 110,111,112,113,114,115,116,117,118,119, 120,121,122,123,124,125,126,127,128,129, 130,131,132,133,134,135,136,137,138,139, 140,141,142,143,144,145,146,147,148,149, 150,151,152,153,154,155,156,157,158,159, 160,161,162,163,164,165,166,167,168,169, 170,171,172,173,174,175,176,177,178,179, 180,181,182,183,184,185,186,187,188,189, 190,191,192,193,194,195,196,197,198,199, 200,201,202,203,204,205,206,207,208,209, 210,211,212,213,214,215,216,217,218,219, 220,221,222,223,224,225,226,227,228,229, 230,231,232,233,234,235,236,237,238,239, 240,241,242,243,244,245,246,247,248,249, 250,251,252,253,254,255}; # endif int ZCH = NCH; FILE *fout = NULL, *errorf = {stdout}; int sect = DEFSECTION; int prev = '\n'; /* previous input character */ int pres = '\n'; /* present input character */ int peek = '\n'; /* next input character */ char *pushptr = pushc; char *slptr = slist; # if (unix || ibm) char *cname = "/usr/lib/lex/ncform"; char *ratname = "/usr/lib/lex/nrform"; # endif # ifdef gcos char *cname = "pounce/lexcform"; char *ratname = "pounce/lexrform"; # endif int ccount = 1; int casecount = 1; int aptr = 1; int nstates = NSTATES, maxpos = MAXPOS; int treesize = TREESIZE, ntrans = NTRANS; int yytop; int outsize = NOUTPUT; int sptr = 1; int optim = TRUE; int report = 2; int debug; /* 1 = on */ int charc; int sargc; char **sargv; char buf[520]; int ratfor; /* 1 = ratfor, 0 = C */ int yyline; /* line number of file */ int eof; int lgatflg; int divflg; int funcflag; int pflag; int chset; /* 1 = char set modified */ FILE *fin, *fother; int fptr; int *name; int *left; int *right; int *parent; char *nullstr; int tptr; char pushc[TOKENSIZE]; char slist[STARTSIZE]; char **def, **subs, *dchar; char **sname, *schar; char *ccl; char *ccptr; char *dp, *sp; int dptr; char *bptr; /* store input position */ char *tmpstat; int count; int **foll; int *nxtpos; int *positions; int *gotof; int *nexts; char *nchar; int **state; int *sfall; /* fallback state num */ char *cpackflg; /* true if state has been character packed */ int *atable; int nptr; char symbol[NCH]; char cindex[NCH]; int xstate; int stnum; char match[NCH]; char extra[NACTIONS]; char *pchar, *pcptr; int pchlen = TOKENSIZE; long rcount; int *verify, *advance, *stoff; int scon; char *psave; int buserr(), segviol(); *bptr; /* store input position */ char *tmpstat; int count; int **foll; int *nxtpos; int *positions; int *gotof; int *nexts; char *nchar; int **state; int *sfall; cmd/lex/parser.y 644 0 33 36127 2111463456 7107 %token CHAR CCL NCCL STR DELIM SCON ITER NEWE NULLS %left SCON '/' NEWE %left '|' %left '$' '^' %left CHAR CCL NCCL '(' '.' STR NULLS %left ITER %left CAT %left '*' '+' '?' %{ # include "ldefs.c" %} %% %{ int i; int j,k; int g; char *p; %} acc : lexinput ={ # ifdef DEBUG if(debug) sect2dump(); # endif } ; lexinput: defns delim prods end | defns delim end ={ if(!funcflag)phead2(); funcflag = TRUE; } | error ={ # ifdef DEBUG if(debug) { sect1dump(); sect2dump(); } # endif } ; end: delim | ; defns: defns STR STR ={ scopy($2,dp); def[dptr] = dp; dp += slength($2) + 1; scopy($3,dp); subs[dptr++] = dp; if(dptr >= DEFSIZE) error("Too many definitions"); dp += slength($3) + 1; if(dp >= dchar+DEFCHAR) error("Definitions too long"); subs[dptr]=def[dptr]=0; /* for lookup - require ending null */ } | ; delim: DELIM ={ # ifdef DEBUG if(sect == DEFSECTION && debug) sect1dump(); # endif sect++; } ; prods: prods pr ={ $$ = mn2(RNEWE,$1,$2); } | pr ={ $$ = $1;} ; pr: r NEWE ={ if(divflg == TRUE) i = mn1(S1FINAL,casecount); else i = mn1(FINAL,casecount); $$ = mn2(RCAT,$1,i); divflg = FALSE; casecount++; } | error NEWE ={ # ifdef DEBUG if(debug) sect2dump(); # endif } r: CHAR ={ $$ = mn0($1); } | STR ={ p = $1; i = mn0(*p++); while(*p) i = mn2(RSTR,i,*p++); $$ = i; } | '.' ={ symbol['\n'] = 0; if(psave == FALSE){ p = ccptr; psave = ccptr; for(i=1;i<'\n';i++){ symbol[i] = 1; *ccptr++ = i; } for(i='\n'+1;i ccl+CCLSIZE) error("Too many large character classes"); } else p = psave; $$ = mn1(RCCL,p); cclinter(1); } | CCL ={ $$ = mn1(RCCL,$1); } | NCCL ={ $$ = mn1(RNCCL,$1); } | r '*' ={ $$ = mn1(STAR,$1); } | r '+' ={ $$ = mn1(PLUS,$1); } | r '?' ={ $$ = mn1(QUEST,$1); } | r '|' r ={ $$ = mn2(BAR,$1,$3); } | r r %prec CAT ={ $$ = mn2(RCAT,$1,$2); } | r '/' r ={ if(!divflg){ j = mn1(S2FINAL,-casecount); i = mn2(RCAT,$1,j); $$ = mn2(DIV,i,$3); } else { $$ = mn2(RCAT,$1,$3); warning("Extra slash removed"); } divflg = TRUE; } | r ITER ',' ITER '}' ={ if($2 > $4){ i = $2; $2 = $4; $4 = i; } if($4 <= 0) warning("Iteration range must be positive"); else { j = $1; for(k = 2; k<=$2;k++) j = mn2(RCAT,j,dupl($1)); for(i = $2+1; i<=$4; i++){ g = dupl($1); for(k=2;k<=i;k++) g = mn2(RCAT,g,dupl($1)); j = mn2(BAR,j,g); } $$ = j; } } | r ITER '}' ={ if($2 < 0)warning("Can't have negative iteration"); else if($2 == 0) $$ = mn0(RNULLS); else { j = $1; for(k=2;k<=$2;k++) j = mn2(RCAT,j,dupl($1)); $$ = j; } } | r ITER ',' '}' ={ /* from n to infinity */ if($2 < 0)warning("Can't have negative iteration"); else if($2 == 0) $$ = mn1(STAR,$1); else if($2 == 1)$$ = mn1(PLUS,$1); else { /* >= 2 iterations minimum */ j = $1; for(k=2;k<$2;k++) j = mn2(RCAT,j,dupl($1)); k = mn1(PLUS,dupl($1)); $$ = mn2(RCAT,j,k); } } | SCON r ={ $$ = mn2(RSCON,$2,$1); } | '^' r ={ $$ = mn1(CARAT,$2); } | r '$' ={ i = mn0('\n'); if(!divflg){ j = mn1(S2FINAL,-casecount); k = mn2(RCAT,$1,j); $$ = mn2(DIV,k,i); } else $$ = mn2(RCAT,$1,i); divflg = TRUE; } | '(' r ')' ={ $$ = $2; } | NULLS ={ $$ = mn0(RNULLS); } ; %% yylex(){ register char *p; register int c, i; char *t, *xp; int n, j, k, x; static int sectbegin; static char token[TOKENSIZE]; static int iter; # ifdef DEBUG yylval = 0; # endif if(sect == DEFSECTION) { /* definitions section */ while(!eof) { if(prev == '\n'){ /* next char is at beginning of line */ getl(p=buf); switch(*p){ case '%': switch(c= *(p+1)){ case '%': lgate(); if(!ratfor)fprintf(fout,"# "); fprintf(fout,"define YYNEWLINE %d\n",ctable['\n']); if(!ratfor)fprintf(fout,"yylex(){\nint nstr; extern int yyprevious;\n"); sectbegin = TRUE; i = treesize*(sizeof(*name)+sizeof(*left)+ sizeof(*right)+sizeof(*nullstr)+sizeof(*parent))+ALITTLEEXTRA; c = myalloc(i,1); if(c == 0) error("Too little core for parse tree"); p = c; cfree(p,i,1); name = myalloc(treesize,sizeof(*name)); left = myalloc(treesize,sizeof(*left)); right = myalloc(treesize,sizeof(*right)); nullstr = myalloc(treesize,sizeof(*nullstr)); parent = myalloc(treesize,sizeof(*parent)); if(name == 0 || left == 0 || right == 0 || parent == 0 || nullstr == 0) error("Too little core for parse tree"); return(freturn(DELIM)); case 'p': case 'P': /* has overridden number of positions */ while(*p && !digit(*p))p++; maxpos = siconv(p); # ifdef DEBUG if (debug) printf("positions (%%p) now %d\n",maxpos); # endif if(report == 2)report = 1; continue; case 'n': case 'N': /* has overridden number of states */ while(*p && !digit(*p))p++; nstates = siconv(p); # ifdef DEBUG if(debug)printf( " no. sta((tes (%%n) now %d\n",nstates); # endif if(report == 2)report = 1; continue; case 'e': case 'E': /* has overridden number of tree nodes */ while(*p && !digit(*p))p++; treesize = siconv(p); # ifdef DEBUG if (debug) printf("treesize (%%e) now %d\n",treesize); # endif if(report == 2)report = 1; continue; case 'o': case 'O': while (*p && !digit(*p))p++; outsize = siconv(p); if (report ==2) report=1; continue; case 'a': case 'A': /* has overridden number of transitions */ while(*p && !digit(*p))p++; if(report == 2)report = 1; ntrans = siconv(p); # ifdef DEBUG if (debug)printf("N. trans (%%a) now %d\n",ntrans); # endif continue; case 'k': case 'K': /* overriden packed char classes */ while (*p && !digit(*p))p++; if (report==2) report=1; cfree(pchar, pchlen, sizeof(*pchar)); pchlen = siconv(p); # ifdef DEBUG if (debug) printf( "Size classes (%%k) now %d\n",pchlen); # endif pchar=pcptr=myalloc(pchlen, sizeof(*pchar)); continue; case 't': case 'T': /* character set specifier */ ZCH = atoi(p+2); if (ZCH < NCH) ZCH = NCH; if (ZCH > 2*NCH) error("ch table needs redeclaration"); chset = TRUE; for(i = 0; i ZCH){ warning("Character value %d out of range",n); continue; } while(!space(*p) && *p) p++; while(space(*p)) p++; t = p; while(*t){ c = ctrans(&t); if(ctable[c]){ if (printable(c)) warning("Character '%c' used twice",c); else warning("Character %o used twice",c); } else ctable[c] = n; t++; } p = buf; } { char chused[2*NCH]; int kr; for(i=0; i= 0) p++; t = p; while(*p && index(*p," \t,") < 0)p++; if(!*p) n = FALSE; *p++ = 0; if (*t == 0) continue; i = sptr*2; if(!ratfor)fprintf(fout,"# "); fprintf(fout,"define %s %d\n",t,i); scopy(t,sp); sname[sptr++] = sp; sname[sptr] = 0; /* required by lookup */ if(sptr >= STARTSIZE) error("Too many start conditions"); sp += slength(sp) + 1; if(sp >= schar+STARTCHAR) error("Start conditions too long"); } continue; default: warning("Invalid request %s",p); continue; } /* end of switch after seeing '%' */ case ' ': case '\t': /* must be code */ lgate(); fprintf(fout, "%s\n",p); continue; default: /* definition */ while(*p && !space(*p)) p++; if(*p == 0) continue; prev = *p; *p = 0; bptr = p+1; yylval = buf; if(digit(buf[0])) warning("Substitution strings may not begin with digits"); return(freturn(STR)); } } /* still sect 1, but prev != '\n' */ else { p = bptr; while(*p && space(*p)) p++; if(*p == 0) warning("No translation given - null string assumed"); scopy(p,token); yylval = token; prev = '\n'; return(freturn(STR)); } } /* end of section one processing */ } else if(sect == RULESECTION){ /* rules and actions */ while(!eof){ switch(c=gch()){ case '\0': return(freturn(0)); case '\n': if(prev == '\n') continue; x = NEWE; break; case ' ': case '\t': if(sectbegin == TRUE){ cpyact(); while((c=gch()) && c != '\n'); continue; } if(!funcflag)phead2(); funcflag = TRUE; if(ratfor)fprintf(fout,"%d\n",30000+casecount); else fprintf(fout,"case %d:\n",casecount); if(cpyact()){ if(ratfor)fprintf(fout,"goto 30997\n"); else fprintf(fout,"break;\n"); } while((c=gch()) && c != '\n'); if(peek == ' ' || peek == '\t' || sectbegin == TRUE){ warning("Executable statements should occur right after %%"); continue; } x = NEWE; break; case '%': if(prev != '\n') goto character; if(peek == '{'){ /* included code */ getl(buf); while(!eof && getl(buf) && scomp("%}",buf) != 0) fprintf(fout,"%s\n",buf); continue; } if(peek == '%'){ c = gch(); c = gch(); x = DELIM; break; } goto character; case '|': if(peek == ' ' || peek == '\t' || peek == '\n'){ if(ratfor)fprintf(fout,"%d\n",30000+casecount++); else fprintf(fout,"case %d:\n",casecount++); continue; } x = '|'; break; case '$': if(peek == '\n' || peek == ' ' || peek == '\t' || peek == '|' || peek == '/'){ x = c; break; } goto character; case '^': if(prev != '\n' && scon != TRUE) goto character; /* valid only at line begin */ x = c; break; case '?': case '+': case '.': case '*': case '(': case ')': case ',': case '/': x = c; break; case '}': iter = FALSE; x = c; break; case '{': /* either iteration or definition */ if(digit(c=gch())){ /* iteration */ iter = TRUE; ieval: i = 0; while(digit(c)){ token[i++] = c; c = gch(); } token[i] = 0; yylval = siconv(token); munput('c',c); x = ITER; break; } else { /* definition */ i = 0; while(c && c!='}'){ token[i++] = c; c = gch(); } token[i] = 0; i = lookup(token,def); if(i < 0) warning("Definition %s not found",token); else munput('s',subs[i]); continue; } case '<': /* start condition ? */ if(prev != '\n') /* not at line begin, not start */ goto character; t = slptr; do { i = 0; c = gch(); while(c != ',' && c && c != '>'){ token[i++] = c; c = gch(); } token[i] = 0; if(i == 0) goto character; i = lookup(token,sname); if(i < 0) { warning("Undefined start condition %s",token); continue; } *slptr++ = i+1; } while(c && c != '>'); *slptr++ = 0; /* check if previous value re-usable */ for (xp=slist; xp slist+STARTSIZE) /* note not packed ! */ error("Too many start conditions used"); yylval = t; x = SCON; break; case '"': i = 0; while((c=gch()) && c != '"' && c != '\n'){ if(c == '\\') c = usescape(c=gch()); token[i++] = c; if(i > TOKENSIZE){ warning("String too long"); i = TOKENSIZE-1; break; } } if(c == '\n') { yyline--; warning("Non-terminated string"); yyline++; } token[i] = 0; if(i == 0)x = NULLS; else if(i == 1){ yylval = token[0]; x = CHAR; } else { yylval = token; x = STR; } break; case '[': for(i=1;i k) { n = j; j = k; k = n; } if(!(('A' <= j && k <= 'Z') || ('a' <= j && k <= 'z') || ('0' <= j && k <= '9'))) warning("Non-portable Character Class"); for(n=j+1;n<=k;n++) symbol[n] = 1; /* implementation dependent */ c = gch(); } } /* try to pack ccl's */ i = 0; for(j=0;j= ccl+CCLSIZE) error("Too many large character classes"); } cclinter(x==CCL); break; case '\\': c = usescape(c=gch()); default: character: if(iter){ /* second part of an iteration */ iter = FALSE; if('0' <= c && c <= '9') goto ieval; } if(alpha(peek)){ i = 0; yylval = token; token[i++] = c; while(alpha(peek)) token[i++] = gch(); if(peek == '?' || peek == '*' || peek == '+') munput('c',token[--i]); token[i] = 0; if(i == 1){ yylval = token[0]; x = CHAR; } else x = STR; } else { yylval = c; x = CHAR; } } scon = FALSE; if(x == SCON)scon = TRUE; sectbegin = FALSE; return(freturn(x)); } } /* section three */ ptail(); # ifdef DEBUG if(debug) fprintf(fout,"\n/*this comes from section three - debug */\n"); # endif while(getl(buf) && !eof) fprintf(fout,"%s\n",buf); return(freturn(0)); } /* end of yylex */ # ifdef DEBUG freturn(i) int i; { if(yydebug) { printf("now return "); if(i < NCH) allprint(i); else printf("%d",i); printf(" yylval = "); switch(i){ case STR: case CCL: case NCCL: strpt(yylval); break; case CHAR: allprint(yylval); break; default((: printf("%d",yylval); break; } putchar('\n'); } return(i); } # endif rom section three - debug */\n"); # endif while(getl(buf) && !eof) fprintf(fout,"%s\n",buf); return(freturn(0)); } /* end of yylex */ # ifdef DEBUG freturn(i) int i; { if(yydebug) { printf("now return "); if(i < NCH) allprint(i); else printf("%d",i); printf(" yylval = "); switch(i){ case STR: case CCL: case NCCL: strpt(yylval); break; case CHAR: allprint(yylval); break; defaultcmd/lex/sub1.c 644 0 33 27661 2111463456 6442 # include "ldefs.c" char * getl(p) /* return next line of input, throw away trailing '\n' */ /* returns 0 if eof is had immediately */ char *p; { register int c; register char *s, *t; t = s = p; while(((c = gch()) != 0) && c != '\n') *t++ = c; *t = 0; if(c == 0 && s == t) return(0); prev = '\n'; pres = '\n'; return(s); } space(ch) { switch(ch) { case ' ': case '\t': case '\n': return(1); } return(0); } digit(c) { return(c>='0' && c <= '9'); } error(s,p,d) { if(!eof)fprintf(errorf,"%d: ",yyline); fprintf(errorf,"(Error) "); fprintf(errorf,s,p,d); putc('\n',errorf); # ifdef DEBUG if(debug && sect != ENDSECTION) { sect1dump(); sect2dump(); } # endif if( # ifdef DEBUG debug || # endif report == 1) statistics(); exit(1); /* error return code */ } warning(s,p,d) { if(!eof)fprintf(errorf,"%d: ",yyline); fprintf(errorf,"(Warning) "); fprintf(errorf,s,p,d); putc('\n',errorf); fflush(errorf); fflush(fout); fflush(stdout); } index(a,s) char *s; { register int k; for(k=0; s[k]; k++) if (s[k]== a) return(k); return(-1); } alpha(c) int c; { # ifdef ASCII return('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z'); # endif # ifdef EBCDIC return(index(c,"abcdefghijklmnopqrstuvxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") >= 0); # endif } printable(c) { # ifdef ASCII return( c>040 && c < 0177); # endif # ifdef EBCDIC return(index(c, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,;:><+*)('&%!-=\"")>=0); # endif } lgate() { char fname[20]; if (lgatflg) return; lgatflg=1; if(fout == NULL){ sprintf(fname, "lex.yy.%c", ratfor ? 'r' : 'c' ); fout = fopen(fname, "w"); } if(fout == NULL) error("Can't open %s",fname); if(ratfor) fprintf( fout, "#\n"); phead1(); } /* scopy(ptr to str, ptr to str) - copy first arg str to second */ /* returns ptr to second arg */ scopy(s,t) char *s, *t; { register char *i; i = t; while(*i++ = *s++); return; } siconv(t) /* convert string t, return integer value */ char *t; { register int i,sw; register char *s; s = t; while(!(('0' <= *s && *s <= '9') || *s == '-') && *s) s++; sw = 0; if(*s == '-'){ /* neg */ sw = 1; s++; } i = 0; while('0' <= *s && *s <= '9') i = i * 10 + (*(s++)-'0'); return(sw ? -i : i); } /* slength(ptr to str) - return integer length of string arg */ /* excludes '\0' terminator */ slength(s) char *s; { register int n; register char *t; t = s; for (n = 0; *t++; n++); return(n); } /* scomp(x,y) - return -1 if x < y, 0 if x == y, return 1 if x > y, all lexicographically */ scomp(x,y) char *x,*y; { register char *a,*d; a = x; d = y; while(*a || *d){ if(*a > *d) return(1); /* greater */ if(*a < *d) return(-1); /* less */ a++; d++; } return(0); /* equal */ } ctrans(ss) char **ss; { register int c, k; if ((c = **ss) != '\\') return(c); switch(c= *++*ss) { case 'n': c = '\n'; break; case 't': c = '\t'; break; case 'r': c = '\r'; break; case 'b': c = '\b'; break; case 'f': c = 014; break; /* form feed for ascii */ case '\\': c = '\\'; break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': c -= '0'; while ((k = *(*ss+1)) >= '0' && k <= '7') { c = c*8 + k - '0'; (*ss)++; } break; } return(c); } cclinter(sw) int sw; { /* sw = 1 ==> ccl */ register int i, j, k; int m; if(!sw){ /* is NCCL */ for(i=1;i= NCH) return; i = cindex[i]; /* see if ccl is already in our table */ j = 0; if(i){ for(j=1;j= NCH) return; /* already in */ m = 0; k = 0; for(i=1;i pushc ? *--pushptr : getc(fin); if(peek == EOF && sargc > 1){ fclose(fin); fin = fopen(sargv[++fptr],"r"); if(fin == NULL) error("Cannot open file %s",sargv[fptr]); peek = getc(fin); sargc--; sargv++; } if(c == EOF) { eof = TRUE; fclose(fin); return(0); } if(c == '\n')yyline++; return(c); } mn2(a,d,c) int a,d,c; { name[tptr] = a; left[tptr] = d; right[tptr] = c; parent[tptr] = 0; nullstr[tptr] = 0; switch(a){ case RSTR: parent[d] = tptr; break; case BAR: case RNEWE: if(nullstr[d] || nullstr[c]) nullstr[tptr] = TRUE; parent[d] = parent[c] = tptr; break; case RCAT: case DIV: if(nullstr[d] && nullstr[c])nullstr[tptr] = TRUE; parent[d] = parent[c] = tptr; break; case RSCON: parent[d] = tptr; nullstr[tptr] = nullstr[d]; break; # ifdef DEBUG default: warning("bad switch mn2 %d %d",a,d); break; # endif } if(tptr > treesize) error("Parse tree too big %s",(treesize == TREESIZE?"\nTry using %e num":"")); return(tptr++); } mn1(a,d) int a,d; { name[tptr] = a; left[tptr] = d; parent[tptr] = 0; nullstr[tptr] = 0; switch(a){ case RCCL: case RNCCL: if(slength(d) == 0) nullstr[tptr] = TRUE; break; case STAR: case QUEST: nullstr[tptr] = TRUE; parent[d] = tptr; break; case PLUS: case CARAT: nullstr[tptr] = nullstr[d]; parent[d] = tptr; break; case S2FINAL: nullstr[tptr] = TRUE; break; # ifdef DEBUG case FINAL: case S1FINAL: break; default: warning("bad switch mn1 %d %d",a,d); break; # endif } if(tptr > treesize) error("Parse tree too big %s",(treesize == TREESIZE?"\nTry using %e num":"")); return(tptr++); } mn0(a) int a; { name[tptr] = a; parent[tptr] = 0; nullstr[tptr] = 0; if(a >= NCH) switch(a){ case RNULLS: nullstr[tptr] = TRUE; break; # ifdef DEBUG default: warning("bad switch mn0 %d",a); break; # endif } if(tptr > treesize) error("Parse tree too big %s",(treesize == TREESIZE?"\nTry using %e num":"")); return(tptr++); } munput(t,p) /* implementation dependent */ char *p; int t; { register int i,j; if(t == 'c'){ *pushptr++ = peek; /* watch out for this */ peek = p; } else if(t == 's'){ *pushptr++ = peek; peek = p[0]; i = slength(p); for(j = i-1; j>=1; j--) *pushptr++ = p[j]; } # ifdef DEBUG else error("Unrecognized munput option %c",t); # endif if(pushptr >= pushc+TOKENSIZE) error("Too many characters pushed"); return; } dupl(n) int n; { /* duplicate the subtree whose root is n, return ptr to it */ register int i; i = name[n]; if(i < NCH) return(mn0(i)); switch(i){ case RNULLS: return(mn0(i)); case RCCL: case RNCCL: case FINAL: case S1FINAL: case S2FINAL: return(mn1(((i,left[n])); case STAR: case QUEST: case PLUS: case CARAT: return(mn1(i,dupl(left[n]))); case RSTR: case RSCON: return(mn2(i,dupl(left[n]),right[n])); case BAR: case RNEWE: case RCAT: case DIV: return(mn2(i,dupl(left[n]),dupl(right[n]))); # ifdef DEBUG default: warning("bad switch dupl %d",n); # endif } return(0); } # ifdef DEBUG allprint(c) char c; { switch(c){ case 014: printf("\\f"); charc++; break; case '\n': printf("\\n"); charc++; break; case '\t': printf("\\t"); charc++; break; case '\b': printf("\\b"); charc++; break; case ' ': printf("\\\bb"); break; default: if(!printable(c)){ printf("\\%-3o",c); charc =+ 3; } else putchar(c); break; } charc++; return; } strpt(s) char *s; { charc = 0; while(*s){ allprint(*s++); if(charc > LINESIZE){ charc = 0; printf("\n\t"); } } return; } sect1dump(){ register int i; printf("Sect 1:\n"); if(def[0]){ printf("str trans\n"); i = -1; while(def[++i]) printf("%s\t%s\n",def[i],subs[i]); } if(sname[0]){ printf("start names\n"); i = -1; while(sname[++i]) printf("%s\n",sname[i]); } if(chset == TRUE){ printf("char set changed\n"); for(i=1;i= pcptr)*pcptr++ = cindex[j]; } *pcptr++ = 0; if(pcptr > pchar + pchlen) error("Too many packed character classes"); left[v] = p; name[v] = RCCL; /* RNCCL eliminated */ # ifdef DEBUG if(debug && *p){ printf("ccl %d: %d",v,*p++); while(*p) printf(", %d",*p++); putchar('\n'); } # endif } break; case CARAT: cfoll(left[v]); break; case STAR: case PLUS: case QUEST: case RSCON: cfoll(left[v]); break; case BAR: case RCAT: case DIV: case RNEWE: cfoll(left[v]); cfoll(right[v]); break; # ifdef DEBUG case FINAL: case S1FINAL: case S2FINAL: break; default: warning("bad switch cfoll %d",v); # endif } return; } # ifdef DEBUG pfoll() { register int i,k,*p; int j; /* print sets of chars which may follow positions */ printf("pos\tchars\n"); for(i=0;i= 1){ printf("%d:\t%d",i,*p++); for(k=2;k<=j;k++) printf(", %d",*p++); putchar('\n'); } } return; } # endif add(array,n) int **array; int n; { register int i, *temp; register char *ctemp; temp = nxtpos; ctemp = tmpstat; array[n] = nxtpos; /* note no packing is done in positions */ *temp++ = count; for(i=0;i= positions+maxpos) error("Too many positions %s",(maxpos== MAXPOS?"\nTry using %p num":"")); return; } follow(v) int v; { register int p; if(v >= tptr-1)return; p = parent[v]; if(p == 0) return; switch(name[p]){ /* will not be CHAR RNULLS FINAL S1FINAL S2FINAL RCCL RNCCL */ case RSTR: if(tmpstat[p] == FALSE){ count++; tmpstat[p] = TRUE; } break; case STAR: case PLUS: first(v); follow(p); break; case BAR: case QUEST: case RNEWE: follow(p); break; case RCAT: case DIV: if(v == left[p]){ if(nullstr[right[p]]) follow(p); first(right[p]); } else follow(p); break; case RSCON: case CARAT: follow(p); break; # ifdef DEBUG default: warning("bad switch follow %d",p); # endif } return; } first(v) /* calculate set of positions with v as root which can be active initially */ int v; { register int i; register char *p; i = name[v]; if(i < NCH)i = 1; switch(i){ case 1: case RCCL: case RNCCL: case RNULLS: case FINAL: case S1FINAL: case S2FINAL: if(tmpstat[v] == FALSE){ count++; tmpstat[v] = TRUE; } break; case BAR: case RNEWE: first(left[v]); first(right[v]); break; case CARAT: if(stnum % 2 == 1) first(left[v]); break; case RSCON: i = stnum/2 +1; p = right[v]; while(*p) if(*p++ == i){ first(left[v]); break; } break; case STAR: case QUEST: case PLUS: case RSTR: first(left[v]); break; case RCAT: case DIV: first(left[v]); if(nullstr[left[v]]) first(right[v]); break; # ifdef DEBUG default: warning("bad switch first %d",v); # endif } return; } cgoto(){ register int i, j, s; int npos, curpos, n; int tryit; char tch[NCH]; int tst[NCH]; char *q; /* generate initial state, for each start condition */ if(ratfor){ fprintf(fout,"blockdata\n"); fprintf(fout,"common /Lvstop/ vstop\n"); fprintf(fout,"define Svstop %d\n",nstates+1); fprintf(fout,"integer vstop(Svstop)\n"); } else fprintf(fout,"int yyvstop[] ={\n0,\n"); while(stnum < 2 || stnum/2 < sptr){ for(i = 0; i 0)first(tptr-1); add(state,stnum); # ifdef DEBUG if(debug){ if(stnum > 1) printf("%s:\n",sname[stnum/2]); pstate(stnum); } # endif stnum++; } stnum--; /* even stnum = might not be at line begin */ /* odd stnum = must be at line begin */ /* even states can occur anywhere, odd states only at line begin */ for(s = 0; s <= stnum; s++){ tryit = FALSE; cpackflg[s] = FALSE; sfall[s] = -1; acompute(s); for(i=0;i LINESIZE){ charc = 0; printf("\n\t"); } } putchar('\n'); } # endif /* for each char, calculate next state */ n = 0; for(i = 1; i= nstates) error("Too many states %s",(nstates == NSTATES ? "\nTry using %n num":"")); add(state,++stnum); # ifdef DEBUG if(debug)pstate(stnum); # endif tch[n] = i; tst[n++] = stnum; } else { /* xstate >= 0 ==> state exists */ tch[n] = i; tst[n++] = xstate; } } } tch[n] = 0; tst[n] = -1; /* pack transitions into permanent array */ if(n > 0) packtrans(s,tch,tst,n,tryit); else gotof[s] = -1; } ratfor ? fprintf(fout,"end\n") : fprintf(fout,"0};\n"); return; } /* Beware -- 70% of total CPU time is spent in this subroutine - if you don't believe me - try it yourself ! */ nextstate(s,c) int s,c; { register int j, *newpos; register char *temp, *tz; int *pos, i, *f, num, curpos, number; /* state to goto from state s on char c */ num = *state[s]; temp(( = tmpstat; pos = state[s] + 1; for(i = 0; i=0;i--){ /* for each state */ j = state[i]; if(count == *j++){ for(k=0;k= count) return(i); } } return(-1); } packtrans(st,tch,tst,cnt,tryit) int st, *tst, cnt,tryit; char *tch; { /* pack transitions into nchar, nexts */ /* nchar is terminated by '\0', nexts uses cnt, followed by elements */ /* gotof[st] = index into nchr, nexts for state st */ /* sfall[st] = t implies t is fall back state for st */ /* == -1 implies no fall back */ int cmin, cval, tcnt, diff, p, *ast; register int i,j,k; char *ach; int go[NCH], temp[NCH], c; int swork[NCH]; char cwork[NCH]; int upper; rcount += cnt; cmin = -1; cval = NCH; ast = tst; ach = tch; /* try to pack transitions using ccl's */ if(!optim)goto nopack; /* skip all compaction */ if(tryit){ /* ccl's used */ for(i=1;i cnt) continue; diff = 0; k = 0; j = 0; upper = p + tcnt; while(ach[j] && p < upper){ while(ach[j] < nchar[p] && ach[j]){diff++; j++; } if(ach[j] == 0)break; if(ach[j] > nchar[p]){diff=NCH;break;} /* ach[j] == nchar[p] */ if(ast[j] != nexts[++p] || ast[j] == -1 || (cpackflg[st] && ach[j] != match[ach[j]]))diff++; j++; } while(ach[j]){ diff++; j++; } if(p < upper)diff = NCH; if(diff < cval && diff < tcnt){ cval = diff; cmin = i; if(cval == 0)break; } } /* cmin = state "most like" state st */ # ifdef DEBUG if(debug)printf("select st %d for st %d diff %d\n",cmin,st,cval); # endif # ifdef PS if(cmin != -1){ /* if we can use st cmin */ gotof[st] = nptr; k = 0; sfall[st] = cmin; p = gotof[cmin]+1; j = 0; while(ach[j]){ /* if cmin has a transition on c, then so will st */ /* st may be "larger" than cmin, however */ while(ach[j] < nchar[p-1] && ach[j]){ k++; nchar[nptr] = ach[j]; nexts[++nptr] = ast[j]; j++; } if(nchar[p-1] == 0)break; if(ach[j] > nchar[p-1]){ warning("bad transition %d %d",st,cmin); goto nopack; } /* ach[j] == nchar[p-1] */ if(ast[j] != nexts[p] || ast[j] == -1 || (cpackflg[st] && ach[j] != match[ach[j]])){ k++; nchar[nptr] = ach[j]; nexts[++nptr] = ast[j]; } p++; j++; } while(ach[j]){ nchar[nptr] = ach[j]; nexts[++nptr] = ast[j++]; k++; } nexts[gotof[st]] = cnt = k; nchar[nptr++] = 0; } else { # endif nopack: /* stick it in */ gotof[st] = nptr; nexts[nptr] = cnt; for(i=0;i ntrans) error("Too many transitions %s",(ntrans==NTRANS?"\nTry using %a num":"")); return; } # ifdef DEBUG pstate(s) int s; { register int *p,i,j; printf("State %d:\n",s); p = state[s]; i = *p++; if(i == 0) return; printf("%4d",*p++); for(j = 1; j= 0) printf("%d\t",nexts[p+1]); else printf("err\t"); allprint(nchar[p++]); while(nexts[p] == nexts[p+1] && nchar[p]){ if(charc > LINESIZE){ charc = 0; printf("\n\t"); } allprint(nchar[p++]); } putchar('\n'); } putchar('\n'); return; } # endif acompute(s) /* compute action list = set of poss. actions */ int s; { register int *p, i, j; int cnt, m; int temp[300], k, neg[300], n; k = 0; n = 0; p = state[s]; cnt = *p++; if(cnt > 300) error("Too many positions for one state - acompute"); for(i=0;iNACTIONS) error("Too many right contexts"); extra[left[*p]] = 1; } else if(name[*p] == S2FINAL)neg[n++] = left[*p]; p++; } atable[s] = -1; if(k < 1 && n < 1) return; # ifdef DEBUG if(debug) printf("final %d actions:",s); # endif /* sort action list */ for(i=0; i LINESIZE){ printf("\n\t"); charc = 0; } } putchar('\n'); } charc = 0; printf("match:\n"); for(i=0;i LINESIZE){ putchar('\n'); charc = 0; } } putchar('\n'); return; } # endif mkmatch(){ register int i; char tab[NCH]; for(i=0; i outsize - ZCH) error("output table overflow"); for(j = bot; j<= top; j++){ k=startup+ctable[nchar[j]]; if(verify[k])break; } } while (j <= top); # if DEBUG if (debug) printf(" startup will be %d\n",startup); # endif /* have found place */ for(j = bot; j<= top; j++){ k = startup + ctable[nchar[j]]; if (ctable[nchar[j]]<=0) printf("j %d nchar %d ctable.nch %d\n",j,nchar[j],ctable[nchar[k]]); verify[k] = i+1; /* state number + 1*/ advance[k] = nexts[j+1]+1; /* state number + 1*/ if(yytop < k) yytop = k; } } else { do { ++startup; if(startup > outsize - ZCH) error("output table overflow"); for(j = bot; j<= top; j++){ k = startup + nchar[j]; if(verify[k])break; } } while (j <= top); /* have found place */ # if DEBUG if (debug) printf(" startup going to be %d\n", startup); # endif for(j = bot; j<= top; j++){ k = startup + nchar[j]; verify[k] = i+1; /* state number + 1*/ advance[k] = nexts[j+1]+1; /* state number + 1*/ if(yytop < k) yytop = k; } } stoff[i] = startup; } /* stoff[i] = offset into verify, advance for trans for state i */ /* put out yywork */ if(ratfor){ fprintf(fout, "define YYTOPVAL %d\n", yytop); rprint(verify,"verif",yytop+1); rprint(advance,"advan",yytop+1); shiftr(stoff, stnum); rprint(stoff,"stoff",stnum+1); shiftr(sfall, stnum); upone(sfall, stnum+1); rprint(((sfall,"sfall",stnum+1); bprint(extra,"extra",casecount+1); bprint(match,"match",NCH); shiftr(atable, stnum); rprint(atable,"atable",stnum+1); return; } fprintf(fout,"# define YYTYPE %s\n",stnum+1 > NCH ? "int" : "char"); fprintf(fout,"struct yywork { YYTYPE verify, advance; } yycrank[] ={\n"); for(i=0;i<=yytop;i+=4){ for(j=0;j<4;j++){ k = i+j; if(verify[k]) fprintf(fout,"%d,%d,\t",verify[k],advance[k]); else fprintf(fout,"0,0,\t"); } putc('\n',fout); } fprintf(fout,"0,0};\n"); /* put out yysvec */ fprintf(fout,"struct yysvf yysvec[] ={\n"); fprintf(fout,"0,\t0,\t0,\n"); for(i=0;i<=stnum;i++){ /* for each state */ if(cpackflg[i])stoff[i] = -stoff[i]; fprintf(fout,"yycrank+%d,\t",stoff[i]); if(sfall[i] != -1) fprintf(fout,"yysvec+%d,\t", sfall[i]+1); /* state + 1 */ else fprintf(fout,"0,\t\t"); if(atable[i] != -1) fprintf(fout,"yyvstop+%d,",atable[i]); else fprintf(fout,"0,\t"); # ifdef DEBUG fprintf(fout,"\t\t/* state %d */",i); # endif putc('\n',fout); } fprintf(fout,"0,\t0,\t0};\n"); /* put out yymatch */ fprintf(fout,"struct yywork *yytop = yycrank+%d;\n",yytop); fprintf(fout,"struct yysvf *yybgin = yysvec+1;\n"); if(optim){ fprintf(fout,"char yymatch[] ={\n"); if (chset==0) /* no chset, put out in normal order */ { for(i=0; i=0; i--) a[i+1]=a[i]; } upone(a,n) int *a; { int i; for(i=0; i<=n ; i++) a[i]++; } bprint(a,s,n) char *s, *a; int n; { register int i, j, k; fprintf(fout,"block data\n"); fprintf(fout,"common /L%s/ %s\n",s,s); fprintf(fout,"define S%s %d\n",s,n); fprintf(fout,"integer %s (S%s)\n",s,s); for(i=1;i=0;i--){ j = array[i]; if(j && *j++ == count){ for(k=0;k= count){ array[n] = array[i]; return; } } } add(array,n); return; } # endif ]); for(j=1;j<8;j++){ k = i+j; if(k < n)cmd/pcc/ 775 0 33 0 2552557373 5275 cmd/pcc/:rofix 755 0 33 51 2333400415 6440 ed $1 <=0;i--){ j = array[i]; if(j && *j++ == count){ for(k=0;k= count){ array[n] = arra ; re/ C. /,"cmd/pcc/:yyfix 755 0 33 226 2333400416 6506 >rodata.c for i in $* do ed - y.tab.c <=0;i--){ j = array[i]; if(j && *j++ == count){ for(k=0;k= count){ array[n] = arra ; re//,5h< /,"cmd/pcc/INDEX 644 0 33 326 2333400416 6111 This directory contains the machine-dependent files for the pcc compiler, which is a PDP-11 C compiler based on the portable C compiler. The machine-independent files are obtained from directory /usr/src/cmd/mip. os++ = 0; return; } for(i=tptr-1;i>=0;i--){ j = array[i]; if(j && *j++ == count){ for(k=0;k= count){ array[n] = arra ; re//,5x< /,"cmd/pcc/code.c 644 0 33 24411 2443263213 6442 static char *sccsid ="%W% (Berkeley) %G%"; # include "mfile1" # include # include # include int proflg = 0; /* are we generating profiling code? */ int strftn = 0; /* is the current function one which returns a value */ int gdebug; int fdefflag; /* are we within a function definition ? */ char NULLNAME[8]; int labelno; branch( n ){ /* output a branch to label n */ /* exception is an ordinary function branching to retlab: then, return */ if( n == retlab && !strftn ){ printf( " ret\n" ); } else printf( " jbr L%d\n", n ); } int lastloc = { -1 }; short log2tab[] = {0, 0, 1, 2, 2, 3, 3, 3, 3}; #define LOG2SZ 9 defalign(n) { /* cause the alignment to become a multiple of n */ n /= SZCHAR; if( lastloc != PROG && n > 1 ) printf( " .align %d\n", n >= 0 && n < LOG2SZ ? log2tab[n] : 0 ); } locctr( l ){ register temp; /* l is PROG, ADATA, DATA, STRNG, ISTRNG, or STAB */ if( l == lastloc ) return(l); temp = lastloc; lastloc = l; switch( l ){ case PROG: printf( " .text\n" ); psline(); break; case DATA: case ADATA: printf( " .data\n" ); break; case STRNG: printf( " .data 1\n" ); break; case ISTRNG: printf( " .data 2\n" ); break; case STAB: printf( " .stab\n" ); break; default: cerror( "illegal location counter" ); } return( temp ); } deflab( n ){ /* output something to define the current position as label n */ printf( "L%d:\n", n ); } int crslab = 10; getlab(){ /* return a number usable for a label */ return( ++crslab ); } int ent_mask[] = { 0,0,0,0,0, 0xfc0, 0xf80, 0xf00, 0xe00, 0xc00, 0x800, 0}; int reg_use = 11; efcode(){ /* code for the end of a function */ if( strftn ){ /* copy output (in R2) to caller */ register NODE *l, *r; register struct symtab *p; register TWORD t; register int j; int i; p = &stab[curftn]; t = p->stype; t = DECREF(t); deflab( retlab ); i = getlab(); /* label for return area */ #ifndef LCOMM printf(" .data\n" ); printf(" .align 2\n" ); printf("L%d: .space %d\n", i, tsize(t, p->dimoff, p->sizoff)/SZCHAR ); printf(" .text\n" ); #else { int sz = tsize(t, p->dimoff, p->sizoff) / SZCHAR; if (sz % sizeof (int)) sz += sizeof (int) - (sz % sizeof (int)); printf(" .lcomm L%d,%d\n", i, sz); } #endif psline(); printf(" movab L%d,r1\n", i); reached = 1; l = block( REG, NIL, NIL, PTR|t, p->dimoff, p->sizoff ); l->tn.rval = 1; /* R1 */ l->tn.lval = 0; /* no offset */ r = block( REG, NIL, NIL, PTR|t, p->dimoff, p->sizoff ); r->tn.rval = 0((; /* R0 */ r->tn.lval = 0; l = buildtree( UNARY MUL, l, NIL ); r = buildtree( UNARY MUL, r, NIL ); l = buildtree( ASSIGN, l, r ); l->in.op = FREE; ecomp( l->in.left ); printf( " movab L%d,r0\n", i ); /* turn off strftn flag, so return sequence will be generated */ strftn = 0; } branch( retlab ); #ifndef VMS printf( " .set L%d,0x%x\n", ftnno, ent_mask[reg_use] ); #else printf( " .set L%d,%d # Hex = 0x%x\n", ftnno, 0x3c| ent_mask[reg_use], ent_mask[reg_use] ); /* KLS kludge, under VMS if you use regs 2-5, you must save them. */ #endif reg_use = 11; p2bend(); fdefflag = 0; } int ftlab1, ftlab2; bfcode( a, n ) int a[]; { /* code for the beginning of a function; a is an array of indices in stab for the arguments; n is the number */ register i; register temp; register struct symtab *p; int off; char *toreg(); locctr( PROG ); p = &stab[curftn]; printf( " .align 1\n"); defnam( p ); temp = p->stype; temp = DECREF(temp); strftn = (temp==STRTY) || (temp==UNIONTY); retlab = getlab(); /* routine prolog */ printf( " .word L%d\n", ftnno); if (gdebug) { #ifdef STABDOT pstabdot(N_SLINE, lineno); #else pstab(NULLNAME, N_SLINE); printf("0,%d,LL%d\n", lineno, labelno); printf("LL%d:\n", labelno++); #endif } ftlab1 = getlab(); ftlab2 = getlab(); printf( " jbr L%d\n", ftlab1); printf( "L%d:\n", ftlab2); if( proflg ) { /* profile code */ i = getlab(); printf(" movab L%d,r0\n", i); printf(" jsb mcount\n"); printf(" .data\n"); printf(" .align 2\n"); printf("L%d: .long 0\n", i); printf(" .text\n"); psline(); } off = ARGINIT; for( i=0; isclass == REGISTER ){ temp = p->offset; /* save register number */ p->sclass = PARAM; /* forget that it is a register */ p->offset = NOOFFSET; oalloc( p, &off ); /*tbl*/ printf( " %s %d(ap),r%d\n", toreg(p->stype), p->offset/SZCHAR, temp ); p->offset = temp; /* remember register number */ p->sclass = REGISTER; /* remember that it is a register */ } else if( p->stype == STRTY || p->stype == UNIONTY ) { p->offset = NOOFFSET; if( oalloc( p, &off ) ) cerror( "bad argument" ); SETOFF( off, ALSTACK ); } else { if( oalloc( p, &off ) ) cerror( "bad argument" ); } } fdefflag = 1; } bccode(){ /* called just before the first executable statment */ /* by now, the automatics and register variables are allocated */ SETOFF( autooff, SZINT ); /* set aside store area offset */ p2bbeg( autooff, regvar ); reg_use = (reg_use > regvar ? regvar : reg_use); } ejobcode( flag ){ /* called just before final exit */ /* flag is 1 if errors, 0 if none */ } aobeg(){ /* called before removing automatics from stab */ } aocode(p) struct symtab *p; { /* called when automatic p removed from stab */ } aoend(){ /* called after removing all automatics from stab */ } defnam( p ) register struct symtab *p; { /* define the current location as the name p->sname */ if( p->sclass == EXTDEF ){ printf( " .globl %s\n", exname( p->sname ) ); } if( p->sclass == STATIC && p->slevel>1 ) deflab( p->offset ); else printf( "%s:\n", exname( p->sname ) ); } bycode( t, i ){ #ifdef ASSTRINGS static int lastoctal = 0; #endif /* put byte i+1 in a string */ #ifdef ASSTRINGS i &= 077; if ( t < 0 ){ if ( i != 0 ) printf( "\"\n" ); } else { if ( i == 0 ) printf("\t.ascii\t\""); if ( t == '\\' || t == '"'){ lastoctal = 0; printf("\\%c", t); } /* * We escape the colon in strings so that * c2 will, in its infinite wisdom, interpret * the characters preceding the colon as a label. * If we didn't escape the colon, c2 would * throw away any trailing blanks or tabs after * the colon, but reconstruct a assembly * language semantically correct program. * C2 hasn't been taught about strings. */ else if ( t == ':' || t < 040 || t >= 0177 ){ lastoctal++; printf("\\%o",t); } else if ( lastoctal && '0' <= t && t <= '9' ){ lastoctal = 0; printf("\"\n\t.ascii\t\"%c", t ); } else { lastoctal = 0; putchar(t); } if ( i == 077 ) printf("\"\n"); } #else i &= 07; if( t < 0 ){ /* end of the string */ if( i != 0 ) printf( "\n" ); } else { /* stash byte t into string */ if( i == 0 ) printf( " .byte " ); else printf( "," ); printf( "0x%x", t ); if( i == 07 ) printf( "\n" ); } #endif } zecode( n ){ /* n integer words of zeros */ OFFSZ temp; if( n <= 0 ) return; printf( " .space %d\n", (SZINT/SZCHAR)*n ); temp = n; inoff += temp*SZINT; } fldal( t ) unsigned t; { /* return the alignment of field of type t */ uerror( "illegal field type" ); return( ALINT ); } fldty( p ) struct symtab *p; { /* fix up type of field p */ ; } where(c){ /* print location of error */ /* c is either 'u', 'c', or 'w' */ /* GCOS version */ fprintf( stderr, "%s, line %d: ", ftitle, lineno ); } /* tbl - toreg() returns a pointer to a char string which is the correct "register move" for the passed type */ struct type_move {TWORD fromtype; char tostrng[8];} toreg_strs[] = { CHAR, "cvtbl", SHORT, "cvtwl", INT, "movl", LONG, "movl", FLOAT, "movf", DOUBLE, "movd", UCHAR, "movzbl", USHORT, "movzwl", UNSIGNED, "movl", ULONG, "movl", -1, "" }; char *toreg(type) TWORD type; { struct type_move *p; for ( p=toreg_strs; p->fromtype > 0; p++) if (p->fromtype == type) return(p->tostrng); /* type not found, must be a pointer type */ return("movl"); } /* tbl */ main( argc, argv ) char *argv[]; { #ifdef BUFSTDERR char errbuf[BUFSIZ]; setbuf(stderr, errbuf); #endif return(mainp1( argc, argv )); } struct sw heapsw[SWITSZ]; /* heap for switches */ genswitch(p,n) register struct sw *p;{ /* p points to an array of structures, each consisting of a constant value and a label. The first is >=0 if there is a default label; its value is the label number The entries p[1] to p[n] are the nontrivial cases */ register i; register CONSZ j, range; register dlab, swlab; range = p[n].sval-p[1].sval; if( range>0 && range <= 3*n && n>=4 ){ /* implement a direct switch */ swlab = getlab(); dlab = p->slab >= 0 ? p->slab : getlab(); /* already in r0 */ printf(" casel r0,$%ld,$%ld\n", p[1].sval, range); printf("L%d:\n", swlab); for( i=1,j=p[1].sval; i<=n; j++) { printf(" .word L%d-L%d\n", (j == p[i].sval ? ((j=p[i++].sval), p[i-1].slab) : dlab), swlab); } if( p->slab >= 0 ) branch( dlab ); else printf("L%d:\n", dlab); return; } if( n>8 ) { /* heap switch */ heapsw[0].slab = dlab = p->slab >= 0 ? p->slab : getlab(); makeheap(p, n, 1); /* build heap */ walkheap(1, n); /* produce code */ if( p->slab >= 0 ) branch( dlab ); else printf("L%d:\n", dlab); return; } /* debugging code */ /* out for the moment if( n >= 4 ) werror( "inefficient switch: %d, %d", n, (int) (range/n) ); */ /* simple switch code */ for( i=1; i<=n; ++i ){ /* already in r0 */ printf( " cmpl r0,$" ); printf( CONFMT, p[i].sval ); printf( "\n jeql L%d\n", p[i].slab ); } if( p->slab>=0 ) branch( p->slab ); } makeheap(p, m, n) register struct sw *p; { register int q; q = select(m); heapsw[n] = p[q]; if( q>1 ) makeheap(p, q-1, 2*n); if( q m ) break; l = ((k = i/2 - 1) + 1)/2; return( l + (m-k < l ? m-k : l)); } walkheap(start, limit) { int label; if( start > limit ) return; printf(" cmpl r0,$%d\n", heapsw[start].sval); printf(" jeql L%d\n", heapsw[start].slab); if( (2*start) > limit ) { printf(" jbr L%d\n", heapsw[0].slab); return; } if( (2*start+1) <= limit ) { label = getlab(); printf(" jgtr L%d\n", label); } else printf(" jgtr L%d\n", heapsw[0].slab); walkheap( 2*start, limit); if( (2*start+1) <= limit ) { printf("L%d:\n", label); walkheap( 2*start+1, limit); } } l ? m-k : l)); } walkheap(start, limit) { int label; if( start > limit ) return; printf(" cmpl r0,$%d\n", heapsw[start].sval); printf(" jeql L%d\n", heapsw[start].slab); if( (2*start) > limit ) { printf(" jbr L%d\n", heapsw[0].slab); cmd/pcc/fort.h 644 0 33 165 2416241511 6444 /* machine dependent file */ label( n ){ printf( "L%d:\n", n ); } tlabel(){ lccopy( 2 ); printf( ":\n" ); } r L%d\n", heapsw[0].slab); walkheap( 2*start, limit); if( (2*start+1) <= limit ) { printf("L%d:\n", label); walkheap( 2*start+1, limit); } } l ? m-k : l)); } walkheap(start, limit) { int label; if( start > limit ) return; printf(" cmpl r0,$%d\n", heapsw[start].sval); printf(" jeql L%d\n/,5< /,"cmd/pcc/local.c 644 0 33 30010 2416241320 6605 static char *sccsid ="%W% (Berkeley) %G%"; # include "mfile1" /* this file contains code which is dependent on the target machine */ NODE * cast( p, t ) register NODE *p; TWORD t; { /* cast node p to type t */ p = buildtree( CAST, block( NAME, NIL, NIL, t, 0, (int)t ), p ); p->in.left->in.op = FREE; p->in.op = FREE; return( p->in.right ); } NODE * clocal(p) NODE *p; { /* this is called to do local transformations on an expression tree preparitory to its being written out in intermediate ((code. */ /* the major essential job is rewriting the automatic variables and arguments in terms of REG and OREG nodes */ /* conversion ops which are not necessary are also clobbered here */ /* in addition, any special features (such as rewriting exclusive or) are easily handled here as well */ register struct symtab *q; register NODE *r; register o; register m, ml; switch( o = p->in.op ){ case NAME: if( p->tn.rval < 0 ) { /* already processed; ignore... */ return(p); } q = &stab[p->tn.rval]; switch( q->sclass ){ case AUTO: case PARAM: /* fake up a structure reference */ r = block( REG, NIL, NIL, PTR+STRTY, 0, 0 ); r->tn.lval = 0; r->tn.rval = (q->sclass==AUTO?STKREG:ARGREG); p = stref( block( STREF, r, p, 0, 0, 0 ) ); break; case ULABEL: case LABEL: case STATIC: if( q->slevel == 0 ) break; p->tn.lval = 0; p->tn.rval = -q->offset; break; case REGISTER: p->in.op = REG; p->tn.lval = 0; p->tn.rval = q->offset; break; } break; case PCONV: /* do pointer conversions for char and longs */ ml = p->in.left->in.type; if( ( ml==CHAR || ml==UCHAR || ml==SHORT || ml==USHORT ) && p->in.left->in.op != ICON ) break; /* pointers all have the same representation; the type is inherited */ inherit: p->in.left->in.type = p->in.type; p->in.left->fn.cdim = p->fn.cdim; p->in.left->fn.csiz = p->fn.csiz; p->in.op = FREE; return( p->in.left ); case SCONV: m = (p->in.type == FLOAT || p->in.type == DOUBLE ); ml = (p->in.left->in.type == FLOAT || p->in.left->in.type == DOUBLE ); if( m != ml ) break; /* now, look for conversions downwards */ m = p->in.type; ml = p->in.left->in.type; if( p->in.left->in.op == ICON ){ /* simulate the conversion here */ CONSZ val; val = p->in.left->tn.lval; switch( m ){ case CHAR: p->in.left->tn.lval = (char) val; break; case UCHAR: p->in.left->tn.lval = val & 0XFF; break; case USHORT: p->in.left->tn.lval = val & 0XFFFFL; break; case SHORT: p->in.left->tn.lval = (short)val; break; case UNSIGNED: p->in.left->tn.lval = val & 0xFFFFFFFFL; break; case INT: p->in.left->tn.lval = (int)val; break; } p->in.left->in.type = m; } else { /* meaningful ones are conversion of int to char, int to short, and short to char, and unsigned version of them */ if( m==CHAR || m==UCHAR ){ if( ml!=CHAR && ml!= UCHAR ) break; } else if( m==SHORT || m==USHORT ){ if( ml!=CHAR && ml!=UCHAR && ml!=SHORT && ml!=USHORT ) break; } } /* clobber conversion */ if( tlen(p) == tlen(p->in.left) ) goto inherit; p->in.op = FREE; return( p->in.left ); /* conversion gets clobbered */ case PVCONV: case PMCONV: if( p->in.right->in.op != ICON ) cerror( "bad conversion", 0); p->in.op = FREE; return( buildtree( o==PMCONV?MUL:DIV, p->in.left, p->in.right ) ); case RS: case ASG RS: /* convert >> to << with negative shift count */ /* only if type of left operand is not unsigned */ if( ISUNSIGNED(p->in.left->in.type) ) break; p->in.right = buildtree( UNARY MINUS, p->in.right, NIL ); if( p->in.op == RS ) p->in.op = LS; else p->in.op = ASG LS; break; case FLD: /* make sure that the second pass does not make the descendant of a FLD operator into a doubly indexed OREG */ if( p->in.left->in.op == UNARY MUL && (r=p->in.left->in.left)->in.op == PCONV) if( r->in.left->in.op == PLUS || r->in.left->in.op == MINUS ) if( ISPTR(r->in.type) ) { if( ISUNSIGNED(p->in.left->in.type) ) p->in.left->in.type = UCHAR; else p->in.left->in.type = CHAR; } break; } return(p); } andable( p ) NODE *p; { return(1); /* all names can have & taken on them */ } cendarg(){ /* at the end of the arguments of a ftn, set the automatic offset */ autooff = AUTOINIT; } cisreg( t ) TWORD t; { /* is an automatic variable of type t OK for a register variable */ #ifdef TRUST_REG_CHAR_AND_REG_SHORT if( t==INT || t==UNSIGNED || t==LONG || t==ULONG /* tbl */ || t==CHAR || t==UCHAR || t==SHORT /* tbl */ || t==USHORT || ISPTR(t)) return(1); /* tbl */ #else if( t==INT || t==UNSIGNED || t==LONG || t==ULONG /* wnj */ || ISPTR(t)) return (1); /* wnj */ #endif return(0); } NODE * offcon( off, t, d, s ) OFFSZ off; TWORD t; { /* return a node, for structure references, which is suitable for being added to a pointer of type t, in order to be off bits offset into a structure */ register NODE *p; /* t, d, and s are the type, dimension offset, and sizeoffset */ /* in general they are necessary for offcon, but not on H'well */ p = bcon(0); p->tn.lval = off/SZCHAR; return(p); } static inwd /* current bit offsed in word */; static word /* word being built from fields */; incode( p, sz ) register NODE *p; { /* generate initialization code for assigning a constant c to a field of width sz */ /* we assume that the proper alignment has been obtained */ /* inoff is updated to have the proper final value */ /* we also assume sz < SZINT */ if((sz+inwd) > SZINT) cerror("incode: field > int"); word |= ((unsigned)(p->tn.lval<<(32-sz))) >> (32-sz-inwd); inwd += sz; inoff += sz; if(inoff%SZINT == 0) { printf( " .long 0x%x\n", word); word = inwd = 0; } } fincode( d, sz ) double d; { /* output code to initialize space of size sz to the value d */ /* the proper alignment has been obtained */ /* inoff is updated to have the proper final value */ /* on the target machine, write it out in octal! */ printf(" %s 0%c%.20e\n", sz == SZDOUBLE ? ".double" : ".float", sz == SZDOUBLE ? 'd' : 'f', d); inoff += sz; } cinit( p, sz ) NODE *p; { /* arrange for the initialization of p into a space of size sz */ /* the proper alignment has been opbtained */ /* inoff is updated to have the proper final value */ ecode( p ); inoff += sz; } vfdzero( n ){ /* define n bits of zeros in a vfd */ if( n <= 0 ) return; inwd += n; inoff += n; if( inoff%ALINT ==0 ) { printf( " .long 0x%x\n", word ); word = inwd = 0; } } char * exname( p ) char *p; { /* make a name look like an external name in the local machine */ #ifndef FLEXNAMES static char text[NCHNAM+1]; #else static char text[BUFSIZ+1]; #endif register i; text[0] = '_'; #ifndef FLEXNAMES for( i=1; *p&&isname ) ); off = tsize( q->stype, q->dimoff, q->sizoff ); printf( CONFMT, off/SZCHAR ); printf( "\n" ); } isitlong( cb, ce ){ /* is lastcon to be long or short */ /* cb is the first character of the representation, ce the last */ if( ce == 'l' || ce == 'L' || lastcon >= (1L << (SZINT-1) ) ) return (1); return(0); } isitfloat( s ) char *s; { double atof(); dcon = atof(s); return( FCON ); } ecode( p ) NODE *p; { /* walk the tree and write out the nodes.. */ if( nerrors ) return; p2tree( p ); p2compile( p ); } #include #include #include extern int ddebug; extern int gdebug; fixarg(p) struct symtab *p; { pstab(p->sname, N_PSYM); if (gdebug) printf("0,%d,%d\n", p->stype, argoff/SZCHAR); poffs(p); } int stabLCSYM; outstab(p) struct symtab *p; { register TWORD ptype; register char *pname; register char pclass; register int poffset; if (!gdebug) return; ptype = p->stype; pname = p->sname; pclass = p->sclass; poffset = p->offset; if (ISFTN(ptype)) { return; } switch (pclass) { case AUTO: pstab(pname, N_LSYM); printf("0,%d,%d\n", ptype, (-poffset)/SZCHAR); poffs(p); return; case EXTDEF: case EXTERN: pstab(pname, N_GSYM); printf("0,%d,0\n", ptype); poffs(p); return; case STATIC: #ifdef LCOMM /* stabLCSYM is 1 during nidcl so we can get stab type right */ pstab(pname, stabLCSYM ? N_LCSYM : N_STSYM); #else pstab(pname, N_STSYM); #endif if (p->slevel > 1) { printf("0,%d,L%d\n", ptype, poffset); } else { printf("0,%d,%s\n", ptype, exname(pname)); } poffs(p); return; case REGISTER: pstab(pname, N_RSYM); printf("0,%d,%d\n", ptype, poffset); poffs(p); return; case MOS: case MOU: pstab(pname, N_SSYM); printf("0,%d,%d\n", ptype, poffset/SZCHAR); poffs(p); return; case PARAM: /* parameter stab entries are processed in dclargs() */ return; default: #ifndef FLEXNAMES if (ddebug) printf(" No .stab for %.8s\n", pname); #else if (ddebug) printf(" No .stab for %s\n", pname); #endif } } pstab(name, type) char *name; int type; { register int i; register char c; if (!gdebug) return; /* locctr(PROG); /* .stabs must appear in .text for c2 */ #ifdef ASSTRINGS if ( name[0] == '\0') printf("\t.stabn\t"); else #ifndef FLEXNAMES printf("\t.stabs\t\"%.8s\", ", name); #else printf("\t.stabs\t\"%s\", ", name); #endif #else printf(" .stab "); for(i=0; i<8; i++) if (c = name[i]) printf("'%c,", c); else printf("0,"); #endif printf("0%o,", type); } #ifdef STABDOT pstabdot(type, value) int type; int value; { if ( ! gdebug) return; /* locctr(PROG); /* .stabs must appear in .text for c2 */ printf("\t.stabd\t"); printf("0%o,0,0%o\n",type, value); } #endif poffs(p) register struct symtab *p; { int s; if (!gdebug) return; if ((s = dimtab[p->sizoff]/SZCHAR) > 1) { pstab(p->sname, N_LENG); printf("1,0,%d\n", s); } } extern char NULLNAME[8]; extern int labelno; extern int fdefflag; psline() { static int lastlineno; register char *cp, *cq; register int i; if (!gdebug) return; cq ((= ititle; cp = ftitle; while ( *cq ) if ( *cp++ != *cq++ ) goto neq; if ( *cp == '\0' ) goto eq; neq: for (i=0; i<100; i++) ititle[i] = '\0'; cp = ftitle; cq = ititle; while ( *cp ) *cq++ = *cp++; *cq = '\0'; *--cq = '\0'; #ifndef FLEXNAMES for ( cp = ititle+1; *(cp-1); cp += 8 ) { pstab(cp, N_SOL); if (gdebug) printf("0,0,LL%d\n", labelno); } #else pstab(ititle+1, N_SOL); if (gdebug) printf("0,0,LL%d\n", labelno); #endif *cq = '"'; printf("LL%d:\n", labelno++); eq: if (lineno == lastlineno) return; lastlineno = lineno; if (fdefflag) { #ifdef STABDOT pstabdot(N_SLINE, lineno); #else pstab(NULLNAME, N_SLINE); printf("0,%d,LL%d\n", lineno, labelno); printf("LL%d:\n", labelno++); #endif } } plcstab(level) { if (!gdebug) return; #ifdef STABDOT pstabdot(N_LBRAC, level); #else pstab(NULLNAME, N_LBRAC); printf("0,%d,LL%d\n", level, labelno); printf("LL%d:\n", labelno++); #endif } prcstab(level) { if (!gdebug) return; #ifdef STABDOT pstabdot(N_RBRAC, level); #else pstab(NULLNAME, N_RBRAC); printf("0,%d,LL%d\n", level, labelno); printf("LL%d:\n", labelno++); #endif } pfstab(sname) char *sname; { if (!gdebug) return; pstab(sname, N_FUN); #ifndef FLEXNAMES printf("0,%d,_%.7s\n", lineno, sname); #else printf("0,%d,_%s\n", lineno, sname); #endif } #ifndef ONEPASS tlen(p) NODE *p; { switch(p->in.type) { case CHAR: case UCHAR: return(1); case SHORT: case USHORT: return(2); case DOUBLE: return(8); default: return(4); } } #endif (NULLNAME, N_RBRAC); printf("0,%d,LL%d\n", level, labelno); printf("LL%d:\n", labelno++); #endif } pfstab(sname) char *sname; { if (!gdebug) return; pstab(sname, N_FUN); #ifndef FLEXNAMES printf("0,%d,_%.7s\n", lineno, sname); #else printf("0,%d,_%s\n", lineno, sname); #endif } #ifndef ONEPASS tlen(p) NODE *p; { switch(p->in.type) { case CHAR: case UCHAR: return(1); case SHORT: case USHORT: return(2); case DOUBLE: return(8); default: return(4); } }cmd/pcc/local2.c 644 0 33 53530 2551473632 6720 static char *sccsid ="%W% (Berkeley) %G%"; # include "mfile2" # include "ctype.h" # ifdef FORT int ftlab1, ftlab2; # endif /* a lot of the machine dependent parts of the second pass */ # define BITMASK(n) ((1L<= AUTOINIT ) spoff -= AUTOINIT; spoff /= SZCHAR; SETOFF(spoff,4); #ifndef FLEXNAMES printf( " .set .F%d,%ld\n", ftnno, spoff ); #else /* SHOULD BE L%d ... ftnno but must change pc/f77 */ printf( " .set LF%d,%ld\n", ftnno, spoff ); #endif #else extern int ftlab1, ftlab2; spoff = maxoff; if( spoff >= AUTOINIT ) spoff -= AUTOINIT; spoff /= SZCHAR; SETOFF(spoff,4); printf( "L%d:\n", ftlab1); if( spoff!=0 ) if( spoff < 64 ) printf( " subl2 $%ld,sp\n", spoff); else printf( " movab -%ld(sp),sp\n", spoff); printf( " jbr L%d\n", ftlab2); #endif maxargs = -1; } struct hoptab { int opmask; char * opstring; } ioptab[] = { ASG PLUS, "add", ASG MINUS, "sub", ASG MUL, "mul", ASG DIV, "div", ASG OR, "bis", ASG ER, "xor", ASG AND, "bic", PLUS, "add", MINUS, "sub", MUL, "mul", DIV, "div", OR, "bis", ER, "xor", AND, "bic", -1, "" }; hopcode( f, o ){ /* output the appropriate string from the above table */ register struct hoptab *q; for( q = ioptab; q->opmask>=0; ++q ){ if( q->opmask == o ){ printf( "%s", q->opstring ); /* tbl if( f == 'F' ) printf( "e" ); else if( f == 'D' ) printf( "d" ); tbl */ /* tbl */ switch( f ) { case 'L': case 'W': case 'B': case 'D': case 'F': printf("%c", tolower(f)); break; } /* tbl */ return; } } cerror( "no hoptab for %s", opst[o] ); } char * rnames[] = { /* keyed to register number tokens */ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "ap", "fp", "sp", "pc", }; int rstatus[] = { SAREG|STAREG, SAREG|STAREG, SAREG|STAREG, SAREG|STAREG, SAREG|STAREG, SAREG|STAREG, SAREG, SAREG, SAREG, SAREG, SAREG, SAREG, SAREG, SAREG, SAREG, SAREG, }; tlen(p) NODE *p; { switch(p->in.type) { case CHAR: case UCHAR: return(1); case SHORT: case USHORT: return(2); case DOUBLE: return(8); default: return(4); } } mixtypes(p, q) NODE *p, *q; { register tp, tq; tp = p->in.type; tq = q->in.type; return( (tp==FLOAT || tp==DOUBLE) != (tq==FLOAT || tq==DOUBLE) ); } prtype(n) NODE *n; { switch (n->in.type) { case DOUBLE: printf("d"); return; case FLOAT: printf("f"); return; case LONG: case ULONG: case INT: case UNSIGNED: printf("l"); return; case SHORT: case USHORT: printf("w"); return; case CHAR: case UCHAR: printf("b"); return; default: if ( !ISPTR( n->in.type ) ) cerror("zzzcode- bad type"); else { printf("l"); return; } } } zzzcode( p, c ) register NODE *p; { register m; CONSZ val; switch( c ){ case 'N': /* logical ops, turned into 0-1 */ /* use register given by register 1 */ cbgen( 0, m=getlab(), 'I' ); deflab( p->bn.label ); printf( " clrl %s\n", rnames[getlr( p, '1' )->tn.rval] ); deflab( m ); return; case 'I': case 'P': cbgen( p->in.op, p->bn.label, c ); return; case 'A': { register NODE *l, *r; if (xdebug) eprint(p, 0, &val, &val); r = getlr(p, 'R'); if (optype(p->in.op) == LTYPE || p->in.op == UNARY MUL) { l = resc; l->in.type = (r->in.type==FLOAT || r->in.type==DOUBLE ? DOUBLE : INT); } else l = getlr(p, 'L'); if (r->in.op == ICON) if(r->in.name[0] == '\0') { if (r->tn.lval == 0) { printf("clr"); prtype(l); printf(" "); adrput(l); return; } if (r->tn.lval < 0 && r->tn.lval >= -63) { printf("mneg"); prtype(l); r->tn.lval = -r->tn.lval; goto ops; } r->in.type = (r->tn.lval < 0 ? (r->tn.lval >= -128 ? CHAR : (r->tn.lval >= -32768 ? SHORT : INT )) : r->in.type); r->in.type = (r->tn.lval >= 0 ? (r->tn.lval <= 63 ? INT : ( r->tn.lval <= 127 ? CHAR : (r->tn.lval <= 255 ? UCHAR : (r->tn.lval <= 32767 ? SHORT : (r->tn.lval <= 65535 ? USHORT : INT ))))) : r->in.type ); } else { printf("moval"); printf(" "); acon(r); printf(","); adrput(l); return; } if (l->in.op == REG && l->in.type != FLOAT && l->in.type != DOUBLE) { if( tlen(l) < tlen(r) ) { if (!mixtypes(l,r)) { !ISUNSIGNED(l->in.type)? printf("cvt"): printf("movz"); prtype(l); printf("l"); goto ops; } else { printf("cvt"); prtype(r); prtype(l); printf(" "); adrput(r); printf(","); adrput(l); printf("cvt"); prtype(l); printf("l"); printf(" "); adrput(l); printf(","); adrput(l); return; } } else { l->in.type = INT; } } if (!mixtypes(l,r)) { if (tlen(l) == tlen(r)) { printf("mov"); prtype(l); goto ops; } else if (tlen(l) > tlen(r) && ISUNSIGNED(r->in.type)) { printf("movz"); } else { printf("cvt"); } } else { printf("cvt"); } prtype(r); prtype(l); ops: printf(" "); adrput(r); printf(","); adrput(l); return; } case 'B': /* get oreg value in temp register for left shift */ { register NODE *r; if (xdebug) eprint(p, 0, &val, &val); r = p->in.right; if( tlen(r) == sizeof(int) && r->in.type != FLOAT ) printf("movl"); else { printf("cvt"); prtype(r); printf("l"); } return; } case 'C': /* num words pushed on arg stack */ { extern int gc_numbytes; extern int xdebug; if (xdebug) printf("->%d<-",gc_numbytes); printf("$%d", gc_numbytes/(SZLONG/SZCHAR) ); return; } case 'D': /* INCR and DECR */ zzzcode(p->in.left, 'A'); printf("\n "); case 'E': /* INCR and DECR, FOREFF */ if (p->in.right->tn.lval == 1) { printf("%s", (p->in.op == INCR ? "inc" : "dec") ); prtype(p->in.left); printf(" "); adrput(p->in.left); return; } printf("%s", (p->in.op == INCR ? "add" : "sub") ); prtype(p->in.left); printf("2 "); adrput(p->in.right); printf(","); adrput(p->in.left); return; case 'F': /* register type of right operand */ { register NODE *n; extern int xdebug; register int ty; n = getlr( p, 'R' ); ty = n->in.type; if (xdebug) printf("->%d<-", ty); if ( ty==DOUBLE) printf("d"); else if ( ty==FLOAT ) printf("f"); else printf("l"); return; } case 'L': /* type of left operand */ case 'R': /* type of right operand */ { register NODE *n; extern int xdebug; n = getlr ( p, c); if (xdebug) printf("->%d<-", n->in.type); prtype(n); return; } case 'Z': /* complement mask for bit instr */ printf("$%ld", ~p->in.right->tn.lval); return; case 'U': /* 32 - n, for unsigned right shifts */ printf("$%d", 32 - p->in.right->tn.lval ); return; case 'T': /* rounded structure length for arguments */ { int size; size = p->stn.stsize; SETOFF( size, 4); printf("$%d", size); return; } case 'S': /* structure assignment */ { register NODE *l, *r; register size; if( p->in.op == STASG ){ l = p->in.left; r = p->in.right; } else if( p->in.op == STARG ){ /* store an arg into a temporary */ l = getlr( p, '3' ); r = p->in.left; } else cerror( "STASG bad" ); if( r->in.op == ICON ) r->in.op(( = NAME; else if( r->in.op == REG ) r->in.op = OREG; else if( r->in.op != OREG ) cerror( "STASG-r" ); size = p->stn.stsize; if( size <= 0 || size > 65535 ) cerror("structure size <0=0 or >65535"); switch(size) { case 1: printf(" movb "); break; case 2: printf(" movw "); break; case 4: printf(" movl "); break; case 8: printf(" movq "); break; default: printf(" movc3 $%d,", size); break; } adrput(r); printf(","); adrput(l); printf("\n"); if( r->in.op == NAME ) r->in.op = ICON; else if( r->in.op == OREG ) r->in.op = REG; } break; default: cerror( "illegal zzzcode" ); } } rmove( rt, rs, t ){ printf( " %s %s,%s\n", (t==FLOAT ? "movf" : (t==DOUBLE ? "movd" : "movl")), rnames[rs], rnames[rt] ); } struct respref respref[] = { INTAREG|INTBREG, INTAREG|INTBREG, INAREG|INBREG, INAREG|INBREG|SOREG|STARREG|STARNM|SNAME|SCON, INTEMP, INTEMP, FORARG, FORARG, INTEMP, INTAREG|INAREG|INTBREG|INBREG|SOREG|STARREG|STARNM, 0, 0 }; setregs(){ /* set up temporary registers */ fregs = 6; /* tbl- 6 free regs on VAX (0-5) */ ; } szty(t){ /* size, in registers, needed to hold thing of type t */ return( (t==DOUBLE||t==FLOAT) ? 2 : 1 ); } rewfld( p ) NODE *p; { return(1); } callreg(p) NODE *p; { return( R0 ); } base( p ) register NODE *p; { register int o = p->in.op; if( (o==ICON && p->in.name[0] != '\0')) return( 100 ); /* ie no base reg */ if( o==REG ) return( p->tn.rval ); if( (o==PLUS || o==MINUS) && p->in.left->in.op == REG && p->in.right->in.op==ICON) return( p->in.left->tn.rval ); if( o==OREG && !R2TEST(p->tn.rval) && (p->in.type==INT || p->in.type==UNSIGNED || ISPTR(p->in.type)) ) return( p->tn.rval + 0200*1 ); if( o==INCR && p->in.left->in.op==REG ) return( p->in.left->tn.rval + 0200*2 ); if( o==ASG MINUS && p->in.left->in.op==REG) return( p->in.left->tn.rval + 0200*4 ); if( o==UNARY MUL && p->in.left->in.op==INCR && p->in.left->in.left->in.op==REG && (p->in.type==INT || p->in.type==UNSIGNED || ISPTR(p->in.type)) ) return( p->in.left->in.left->tn.rval + 0200*(1+2) ); return( -1 ); } offset( p, tyl ) register NODE *p; int tyl; { if( tyl==1 && p->in.op==REG && (p->in.type==INT || p->in.type==UNSIGNED) ) return( p->tn.rval ); if( (p->in.op==LS && p->in.left->in.op==REG && (p->in.left->in.type==INT || p->in.left->in.type==UNSIGNED) && (p->in.right->in.op==ICON && p->in.right->in.name[0]=='\0') && (1<in.right->tn.lval)==tyl)) return( p->in.left->tn.rval ); return( -1 ); } makeor2( p, q, b, o) register NODE *p, *q; register int b, o; { register NODE *t; register int i; NODE *f; p->in.op = OREG; f = p->in.left; /* have to free this subtree later */ /* init base */ switch (q->in.op) { case ICON: case REG: case OREG: t = q; break; case MINUS: q->in.right->tn.lval = -q->in.right->tn.lval; case PLUS: t = q->in.right; break; case INCR: case ASG MINUS: t = q->in.left; break; case UNARY MUL: t = q->in.left->in.left; break; default: cerror("illegal makeor2"); } p->tn.lval = t->tn.lval; #ifndef FLEXNAMES for(i=0; iin.name[i] = t->in.name[i]; #else p->in.name = t->in.name; #endif /* init offset */ p->tn.rval = R2PACK( (b & 0177), o, (b>>7) ); tfree(f); return; } canaddr( p ) NODE *p; { register int o = p->in.op; if( o==NAME || o==REG || o==ICON || o==OREG || (o==UNARY MUL && shumul(p->in.left)) ) return(1); return(0); } shltype( o, p ) register NODE *p; { return( o== REG || o == NAME || o == ICON || o == OREG || ( o==UNARY MUL && shumul(p->in.left)) ); } flshape( p ) register NODE *p; { return( p->in.op == REG || p->in.op == NAME || p->in.op == ICON || (p->in.op == OREG && (!R2TEST(p->tn.rval) || tlen(p) == 1)) ); } shtemp( p ) register NODE *p; { if( p->in.op == STARG ) p = p->in.left; return( p->in.op==NAME || p->in.op ==ICON || p->in.op == OREG || (p->in.op==UNARY MUL && shumul(p->in.left)) ); } shumul( p ) register NODE *p; { register o; extern int xdebug; if (xdebug) { printf("\nshumul:op=%d,lop=%d,rop=%d", p->in.op, p->in.left->in.op, p->in.right->in.op); printf(" prname=%s,plty=%d, prlval=%D\n", p->in.right->in.name, p->in.left->in.type, p->in.right->tn.lval); } o = p->in.op; if( o == NAME || (o == OREG && !R2TEST(p->tn.rval)) || o == ICON ) return( STARNM ); if( ( o == INCR || o == ASG MINUS ) && ( p->in.left->in.op == REG && p->in.right->in.op == ICON ) && p->in.right->in.name[0] == '\0' ) { switch (p->in.left->in.type) { case CHAR|PTR: case UCHAR|PTR: o = 1; break; case SHORT|PTR: case USHORT|PTR: o = 2; break; case INT|PTR: case UNSIGNED|PTR: case LONG|PTR: case ULONG|PTR: case FLOAT|PTR: o = 4; break; case DOUBLE|PTR: o = 8; break; default: if ( ISPTR(p->in.left->in.type) ) { o = 4; break; } else return(0); } return( p->in.right->tn.lval == o ? STARREG : 0); } return( 0 ); } adrcon( val ) CONSZ val; { printf( "$" ); printf( CONFMT, val ); } conput( p ) register NODE *p; { switch( p->in.op ){ case ICON: acon( p ); return; case REG: printf( "%s", rnames[p->tn.rval] ); return; default: cerror( "illegal conput" ); } } insput( p ) register NODE *p; { cerror( "insput" ); } upput( p ) register NODE *p; { cerror( "upput" ); } adrput( p ) register NODE *p; { register int r; /* output an address, with offsets, from p */ if( p->in.op == FLD ){ p = p->in.left; } switch( p->in.op ){ case NAME: acon( p ); return; case ICON: /* addressable value of the constant */ printf( "$" ); acon( p ); return; case REG: printf( "%s", rnames[p->tn.rval] ); return; case OREG: r = p->tn.rval; if( R2TEST(r) ){ /* double indexing */ register int flags; flags = R2UPK3(r); if( flags & 1 ) printf("*"); if( flags & 4 ) printf("-"); if( p->tn.lval != 0 || p->in.name[0] != '\0' ) acon(p); if( R2UPK1(r) != 100) printf( "(%s)", rnames[R2UPK1(r)] ); if( flags & 2 ) printf("+"); printf( "[%s]", rnames[R2UPK2(r)] ); return; } if( r == AP ){ /* in the argument region */ if( p->tn.lval <= 0 || p->in.name[0] != '\0' ) werror( "bad arg temp" ); printf( CONFMT, p->tn.lval ); printf( "(ap)" ); return; } if( p->tn.lval != 0 || p->in.name[0] != '\0') acon( p ); printf( "(%s)", rnames[p->tn.rval] ); return; case UNARY MUL: /* STARNM or STARREG found */ if( tshape(p, STARNM) ) { printf( "*" ); adrput( p->in.left); } else { /* STARREG - really auto inc or dec */ register NODE *q; /* tbl p = p->in.left; p->in.left->in.op = OREG; if( p->in.op == INCR ) { adrput( p->in.left ); printf( "+" ); } else { printf( "-" ); adrput( p->in.left ); } tbl */ printf("%s(%s)%s", (p->in.left->in.op==INCR ? "" : "-"), rnames[p->in.left->in.left->tn.rval], (p->in.left->in.op==INCR ? "+" : "") ); p->in.op = OREG; p->tn.rval = p->in.left->in.left->tn.rval; q = p->in.left; p->tn.lval = (p->in.left->in.op == INCR ? -p->in.left->in.right->tn.lval : 0); #ifndef FLEXNAMES p->in.name[0] = '\0'; #else p->in.name = ""; #endif tfree(q); } return; default: cerror( "illegal address" ); return; } } acon( p ) register NODE *p; { /* print out a constant */ if( p->in.name[0] == '\0' ){ printf( CONFMT, p->tn.lval); } else if( p->tn.lval == 0 ) { #ifndef FLEXNAMES printf( "%.8s", p->in.name ); #else printf( "%s", p->in.name ); #endif } else { #ifndef FLEXNAMES printf( "%.8s+", p->in.name ); #else printf( "%s+", p->in.name ); #endif printf( CONFMT, p->tn.lval ); } } /* aacon( p ) register NODE *p; { /* print out a constant */ /* if( p->in.name[0] == '\0' ){ printf( CONFMT, p->tn.lval); return( 0 ); } else if( p->tn.lval == 0 ) { #ifndef FLEXNAMES printf( "$%.8s", p->in.name ); #else printf( "$%s", p->in.name ); #endif return( 1 ); } else { printf( "$(" ); printf( CONFMT, p->tn.lval ); printf( "+" ); #ifndef FLEXNAMES printf( "%.8s)", p->in.name ); #else printf( "%s)", p->in.name ); #endif return(1); } } */ genscall( p, cookie ) register NODE *p; { /* structure valued call */ return( gencall( p, cookie ) ); } /* tbl */ int gc_numbytes; /* tbl */ gencall( p, cookie ) register NODE *p; { /* generate the call given by p */ register NODE *p1, *ptemp; register temp, temp1; register m; if( p->in.right ) temp = argsize( p->in.right ); else temp = 0; if( p->in.op == STCALL || p->in.op == UNARY STCALL ){ /* set aside room for structure return */ if( p->stn.stsize > temp ) temp1 = p->stn.stsize; else temp1 = temp; } if( temp > maxargs ) maxargs = temp; SETOFF(temp1,4); if( p->in.right ){ /* make temp node, put offset in, and generate args */ ptemp = talloc(); ptemp->in.op = OREG; ptemp->tn.lval = -1; ptemp->tn.rval = SP; #ifndef FLEXNAMES ptemp->in.name[0] = '\0'; #else ptemp->in.name = ""; #endif ptemp->in.rall = NOPREF; ptemp->in.su = 0; genargs( p->in.right, ptemp ); ptemp->in.op = FREE; } p1 = p->in.left; if( p1->in.op != ICON ){ if( p1->in.op != REG ){ if( p1->in.op != OREG || R2TEST(p1->tn.rval) ){ if( p1->in.op != NAME ){ order( p1, INAREG ); } } } } /* if( p1->in.op == REG && p->tn.rval == R5 ){ cerror( "call register overwrite" ); } */ /* tbl setup gc_numbytes so reference to ZC works */ gc_numbytes = temp&(0x3ff); /* tbl */ p->in.op = UNARY CALL; m = match( p, INTAREG|INTBREG ); /* compensate for deficiency in 'ret' instruction ... wah,kre */ /* (plus in assignment to gc_numbytes above, for neatness only) */ if (temp >= 1024) printf(" addl2 $%d,sp\n", (temp&(~0x3ff))); /* tbl switch( temp ) { case 0: break; case 2: printf( " tst (sp)+\n" ); break; case 4: printf( " cmp (sp)+,(sp)+\n" ); break; default: printf( " add $%d,sp\n", temp); } tbl */ return(m != MDONE); } /* tbl */ char * ccbranches[] = { " jeql L%d\n", " jneq L%d\n", " jleq L%d\n", " jlss L%d\n", " jgeq L%d\n", " jgtr L%d\n", " jlequ L%d\n"((, " jlssu L%d\n", " jgequ L%d\n", " jgtru L%d\n", }; /* tbl */ cbgen( o, lab, mode ) { /* printf conditional and unconditional branches */ /* tbl */ if( o == 0 ) printf( " jbr L%d\n", lab ); /* tbl */ else { if( o > UGT ) cerror( "bad conditional branch: %s", opst[o] ); printf( ccbranches[o-EQ], lab ); } } nextcook( p, cookie ) NODE *p; { /* we have failed to match p with cookie; try another */ if( cookie == FORREW ) return( 0 ); /* hopeless! */ if( !(cookie&(INTAREG|INTBREG)) ) return( INTAREG|INTBREG ); if( !(cookie&INTEMP) && asgop(p->in.op) ) return( INTEMP|INAREG|INTAREG|INTBREG|INBREG ); return( FORREW ); } lastchance( p, cook ) NODE *p; { /* forget it! */ return(0); } optim2( p ) register NODE *p; { /* do local tree transformations and optimizations */ register NODE *r; switch( p->in.op ) { case AND: /* commute L and R to eliminate compliments and constants */ if( (p->in.left->in.op==ICON&&p->in.left->in.name[0]==0) || p->in.left->in.op==COMPL ) { r = p->in.left; p->in.left = p->in.right; p->in.right = r; } case ASG AND: /* change meaning of AND to ~R&L - bic on pdp11 */ r = p->in.right; if( r->in.op==ICON && r->in.name[0]==0 ) { /* compliment constant */ r->tn.lval = ~r->tn.lval; } else if( r->in.op==COMPL ) { /* ~~A => A */ r->in.op = FREE; p->in.right = r->in.left; } else { /* insert complement node */ p->in.right = talloc(); p->in.right->in.op = COMPL; p->in.right->in.rall = NOPREF; p->in.right->in.type = r->in.type; p->in.right->in.left = r; p->in.right->in.right = NULL; } break; } } NODE * addroreg(l) /* OREG was built in clocal() * for an auto or formal parameter * now its address is being taken * local code must unwind it * back to PLUS/MINUS REG ICON * according to local conventions */ { cerror("address of OREG taken"); } # ifndef ONEPASS main( argc, argv ) char *argv[]; { return( mainp2( argc, argv ) ); } # endif /* added by jwf */ struct functbl { int fop; TWORD ftype; char *func; } opfunc[] = { DIV, TANY, "udiv", MOD, TANY, "urem", ASG DIV, TANY, "udiv", ASG MOD, TANY, "urem", 0, 0, 0 }; hardops(p) register NODE *p; { /* change hard to do operators into function calls. */ register NODE *q; register struct functbl *f; register o; register TWORD t; o = p->in.op; t = p->in.type; if( t!=UNSIGNED && t!=ULONG ) return; for( f=opfunc; f->fop; f++ ) { if( o==f->fop ) goto convert; } return; /* need to rewrite tree for ASG OP */ /* must change ASG OP to a simple OP */ convert: if( asgop( o ) ) { q = talloc(); switch( p->in.op ) { case ASG DIV: q->in.op = DIV; break; case ASG MOD: q->in.op = MOD; break; } q->in.rall = NOPREF; q->in.type = p->in.type; q->in.left = tcopy(p->in.left); q->in.right = p->in.right; p->in.op = ASSIGN; p->in.right = q; zappost(q->in.left); /* remove post-INCR(DECR) from new node */ fixpre(q->in.left); /* change pre-INCR(DECR) to +/- */ p = q; } /* build comma op for args to function */ q = talloc(); q->in.op = CM; q->in.rall = NOPREF; q->in.type = INT; q->in.left = p->in.left; q->in.right = p->in.right; p->in.op = CALL; p->in.right = q; /* put function name in left node of call */ p->in.left = q = talloc(); q->in.op = ICON; q->in.rall = NOPREF; q->in.type = INCREF( FTN + p->in.type ); #ifndef FLEXNAMES strcpy( q->in.name, f->func ); #else q->in.name = f->func; #endif q->tn.lval = 0; q->tn.rval = 0; return; } zappost(p) NODE *p; { /* look for ++ and -- operators and remove them */ register o, ty; register NODE *q; o = p->in.op; ty = optype( o ); switch( o ){ case INCR: case DECR: q = p->in.left; p->in.right->in.op = FREE; /* zap constant */ ncopy( p, q ); q->in.op = FREE; return; } if( ty == BITYPE ) zappost( p->in.right ); if( ty != LTYPE ) zappost( p->in.left ); } fixpre(p) NODE *p; { register o, ty; o = p->in.op; ty = optype( o ); switch( o ){ case ASG PLUS: p->in.op = PLUS; break; case ASG MINUS: p->in.op = MINUS; break; } if( ty == BITYPE ) fixpre( p->in.right ); if( ty != LTYPE ) fixpre( p->in.left ); } myreader(p) register NODE *p; { walkf( p, hardops ); /* convert ops to function calls */ canon( p ); /* expands r-vals for fileds */ walkf( p, optim2 ); /* jwf toff = 0; /* stack offset swindle */ } ) zappost( p->in.left ); } fixpre(p) NODE *p; { register o, ty; o = p->in.op; ty = optype( o ); switch( o ){ case ASG PLUS: p->in.op = PLUS; break; cascmd/pcc/mac2defs 644 0 33 1761 2447231667 6772 /* VAX-11/780 Registers */ /* scratch registers */ # define R0 0 # define R1 1 # define R2 2 # define R3 3 # define R4 4 # define R5 5 /* register variables */ # define R6 6 # define R7 7 # define R8 8 # define R9 9 # define R10 10 # define R11 11 /* special purpose */ # define AP 12 /* argument pointer */ # define FP 13 /* frame pointer */ # define SP 14 /* stack pointer */ # define PC 15 /* program counter */ /* floating registers */ /* there are no floating point registers on the VAX */ extern int fregs; extern int maxargs; # define BYTEOFF(x) ((x)&03) # define wdal(k) (BYTEOFF(k)==0) # define BITOOR(x) ((x)>>3) /* bit offset to oreg offset */ # define REGSZ 16 # define TMPREG FP # define R2REGS /* permit double indexing */ # define STOARG(p) /* just evaluate the arguments, and be done with it... */ # define STOFARG(p) # define STOSTARG(p) # define genfcall(a,b) gencall(a,b) # define NESTCALLS # define MYREADER(p) myreader(p) int optim2(); # define special(a, b) 0 he VAX */ extecmd/pcc/macdefs 644 0 33 2530 2416241417 6671 # define makecc(val,i) lastcon = (lastcon<<8)|((val<<24)>>24); # define ARGINIT 32 # define AUTOINIT 0 # define SZCHAR 8 # define SZINT 32 # define SZFLOAT 32 # define SZDOUBLE 64 # define SZLONG 32 # define SZSHORT 16 # define SZPOINT 32 # define ALCHAR 8 # define ALINT 32 # define ALFLOAT 32 # define ALDOUBLE 32 # define ALLONG 32 # define ALSHORT 16 # define ALPOINT 32 # define ALSTRUCT 8 # define ALSTACK 32 /* size in which constants are converted */ /* should be long if feasable */ # define CONSZ long # define CONFMT "%ld" /* size in which offsets are kept /* should be large enough to cover address space in bits */ # define OFFSZ long /* character set macro */ # define CCTRANS(x) x /* register cookie for stack poINTer */ # define STKREG 13 # define ARGREG 12 /* maximum and minimum register variables */ # define MAXRVAR 11 # define MINRVAR 6 /* various standard pieces of code are used */ # define STDPRTREE # define LABFMT "L%d" /* show stack grows negatively */ #define BACKAUTO #define BACKTEMP /* show field hardware support on VAX */ #define FIELDOPS /* bytes are numbered from right to left */ #define RTOLBYTES /* we want prtree included */ # define STDPRTREE # ifndef FORT # define ONEPASS #endif # define ENUMSIZE(high,low) INT # define ADDROREG # define FIXDEF(p) outstab(p) # define FIXARG(p) fixarg(p) MAXRVAR 11 # define MINRVAR 6 /* various standard pieces of code are used */ # define STDPRTREE # define LABFMT "L%d" /* show stack grows negatively */ #define BACKcmd/pcc/makefile 644 0 33 6273 2447246000 7051 TESTDIR = . FRC = CFLAGS = -O -DASSTRINGS -DSTABDOT -DLCOMM -DBUFSTDERR -DFLEXNAMES M=../mip all: comp fort comp: rodata.o cgram.o xdefs.o scan.o pftn.o trees.o optim.o code.o local.o \ reader.o local2.o order.o match.o allo.o comm1.o table.o $(CC) $(LDFLAGS) -z rodata.o cgram.o xdefs.o scan.o pftn.o trees.o \ optim.o code.o local.o reader.o local2.o order.o match.o \ allo.o comm1.o table.o -o $(TESTDIR)/comp trees.o: $M/manifest macdefs $M/mfile1 $M/trees.c $(CC) -c $(CFLAGS) -I$M -I. $M/trees.c optim.o: $M/manifest macdefs $M/mfile1 $M/optim.c $(CC) -c $(CFLAGS) -I$M -I. $M/optim.c pftn.o: $M/manifest macdefs $M/mfile1 $M/pftn.c $(CC) -c $(CFLAGS) -I$M -I. $M/pftn.c code.o: $M/manifest macdefs $M/mfile1 $(CC) -c $(CFLAGS) -I$M -I. code.c local.o: $M/manifest macdefs $M/mfile1 $(CC) -c $(CFLAGS) -I$M -I. local.c scan.o: $M/manifest macdefs $M/mfile1 $M/scan.c $(CC) -c $(CFLAGS) -I$M -I. $M/scan.c xdefs.o: $M/manifest $M/mfile1 macdefs $M/xdefs.c $(CC) -c $(CFLAGS) -I$M -I. $M/xdefs.c cgram.o: $M/manifest $M/mfile1 macdefs cgram.c $(CC) -c $(CFLAGS) -I$M -I. cgram.c rodata.o: rodata.c $(CC) $(CFLAGS) -S rodata.c ./:rofix rodata.s $(AS) -o rodata.o rodata.s rm -f rodata.s rodata.c cgram.c: $M/cgram.y $(YACC) $M/cgram.y rm -f rodata.c ./:yyfix yyexca yyact yypact yypgo yyr1 yyr2 yychk yydef mv y.tab.c cgram.c comm1.o: $M/manifest $M/mfile1 $M/common macdefs $M/comm1.c $(CC) -c $(CFLAGS) -I$M -I. $M/comm1.c table.o: $M/manifest $M/mfile2 mac2defs macdefs table.c $(CC) $(CFLAGS) -S -I$M -I.(( table.c ./:rofix table.s $(AS) -o table.o table.s rm -f table.s reader.o: $M/manifest $M/mfile2 mac2defs macdefs $M/reader.c $(CC) -c $(CFLAGS) -I$M -I. $M/reader.c local2.o: $M/manifest $M/mfile2 mac2defs macdefs $(CC) -c $(CFLAGS) -I$M -I. local2.c order.o: $M/manifest $M/mfile2 mac2defs macdefs $(CC) -c $(CFLAGS) -I$M -I. order.c match.o: $M/manifest $M/mfile2 mac2defs macdefs $M/match.c $(CC) -c $(CFLAGS) -I$M -I. $M/match.c allo.o: $M/manifest $M/mfile2 mac2defs macdefs $M/allo.c $(CC) -c $(CFLAGS) -I$M -I. $M/allo.c shrink: rm *.o comp clean: rm -f *.o comp fort cgram.c rodata.c lintall: lint -hpv -I. -I$M $M/cgram.c $M/xdefs.c $M/scan.c $M/pftn.c \ $M/trees.c $M/optim.c code.c local.c $M/reader \ local2.c order.c $M/match.c $M/allo.c $M/comm1.c table.c fort: comp fort.o freader.o fallo.o fmatch.o ftable.o forder.o flocal2.o \ fcomm2.o $(CC) -z $(CFLAGS) fort.o freader.o fallo.o fmatch.o ftable.o \ forder.o flocal2.o fcomm2.o -o $(TESTDIR)/fort fort.o: fort.h $M/fort.c $(CC) -c $(CFLAGS) -I$M -I. $M/fort.c freader.o: reader.o $(CC) -c $(CFLAGS) -I$M -I. $M/freader.c fallo.o: allo.o $(CC) -c $(CFLAGS) -I$M -I. $M/fallo.c fmatch.o: match.o $(CC) -c $(CFLAGS) -I$M -I. $M/fmatch.c ftable.o: table.o $(CC) -c -R $(CFLAGS) -I$M -I. $M/ftable.c forder.o: order.o $(CC) -c $(CFLAGS) -I$M -I. $M/forder.c flocal2.o: local2.o $(CC) -c $(CFLAGS) -I$M -I. $M/flocal2.c fcomm2.o: $M/common $(CC) -c $(CFLAGS) -I$M -I. $M/fcomm2.c fort.o freader.o fallo.o fmatch.o ftable.o forder.o flocal2.o fcomm2.o: \ $M/mfile2 $M/manifest macdefs mac2defs install: all strip fort comp rm -f ${DESTDIR}/lib/ccom cp comp ${DESTDIR}/lib/ccom rm -f ${DESTDIR}/lib/f1 cp fort ${DESTDIR}/lib/f1 -I. $M/fmatch.c ftable.o: table.o $(CC) -c -R $(CFLAGS) -I$M -I. $M/ftable.c forder.o: order.o $(CC) -c $(CFLAGS) -I$M -I. $M/forder.c flocal2.o: local2.o $(CC) -c $(CFLAGS) -I$M -I. $M/flocal2.c fcomm2.o: $M/common $(CC) -c $(CFLAGS) -I$M -I. $M/fcomm2.c fort.o freader.o fallo.o fmatch.o ftable.o forder.o flocal2.o fcocmd/pcc/order.c 644 0 33 26141 2416241456 6652 static char *sccsid ="%W% (Berkeley) %G%"; # include "mfile2" int maxargs = { -1 }; stoasg( p, o ) register NODE *p; { /* should the assignment op p be stored, given that it lies as the right operand of o (or the left, if o==UNARY MUL) */ /* if( p->in.op == INCR || p->in.op == DECR ) return; if( o==UNARY MUL && p->in.left->in.op == REG && !isbreg(p->in.left->tn.rval) ) SETSTO(p,INAREG); */ } deltest( p ) register NODE *p; { /* should we delay the INCR or DECR operation p */ p = p->in.left; return( p->in.op == REG || p->in.op == NAME || p->in.op == OREG ); } autoincr( p ) NODE *p; { register NODE *q = p->in.left, *r; if( q->in.op == INCR && (r=q->in.left)->in.op == REG && ISPTR(q->in.type) && p->in.type == DECREF(q->in.type) && tlen(p) == q->in.right->tn.lval ) return(1); return(0); } mkadrs(p) register NODE *p; { register o; o = p->in.op; if( asgop(o) ){ if( p->in.left->in.su >= p->in.right->in.su ){ if( p->in.left->in.op == UNARY MUL ){ SETSTO( p->in.left->in.left, INTEMP ); } else if( p->in.left->in.op == FLD && p->in.left->in.left->in.op == UNARY MUL ){ SETSTO( p->in.left->in.left->in.left, INTEMP ); } else { /* should be only structure assignment */ SETSTO( p->in.left, INTEMP ); } } else SETSTO( p->in.right, INTEMP ); } else { if( p->in.left->in.su > p->in.right->in.su ){ SETSTO( p->in.left, INTEMP ); } else { SETSTO( p->in.right, INTEMP ); } } } notoff( t, r, off, cp) CONSZ off; char *cp; { /* is it legal to make an OREG or NAME entry which has an /* offset of off, (from a register of r), if the /* resulting thing had type t */ /* if( r == R0 ) return( 1 ); /* NO */ return(0); /* YES */ } # define max(x,y) ((x)<(y)?(y):(x)) sucomp( p ) register NODE *p; { /* set the su field in the node to the sethi-ullman number, or local equivalent */ register o, ty, sul, sur, r; o = p->in.op; ty = optype( o ); p->in.su = szty( p->in.type ); /* 2 for float or double, else 1 */; if( ty == LTYPE ){ if( o == OREG ){ r = p->tn.rval; /* oreg cost is (worst case) 1 + number of temp registers used */ if( R2TEST(r) ){ if( R2UPK1(r)!=100 && istreg(R2UPK1(r)) ) ++p->in.su; if( istreg(R2UPK2(r)) ) ++p->in.su; } else { if( istreg( r ) ) ++p->in.su; } } if( p->in.su == szty(p->in.type) && (p->in.op!=REG || !istreg(p->tn.rval)) && (p->in.type==INT || p->in.type==UNSIGNED || p->in.type==DOUBLE) ) p->in.su = 0; return; } else if( ty == UTYPE ){ switch( o ) { case UNARY CALL: case UNARY STCALL: p->in.su = fregs; /* all regs needed */ return; default: p->in.su = p->in.left->in.su + (szty( p->in.type ) > 1 ? 2 : 0) ; return; } } /* If rhs needs n, lhs needs m, regular su computation */ sul = p->in.left->in.su; sur = p->in.right->in.su; if( o == ASSIGN ){ /* computed by doing right, then left (if not in mem), then doing it */ p->in.su = max(sur,sul+1); return; } if( o == CALL || o == STCALL ){ /* in effect, takes all free registers */ p->in.su = fregs; return; } if( o == STASG ){ /* right, then left */ p->in.su = max( max( 1+sul, sur), fregs ); return; } if( asgop(o) ){ /* computed by doing right, doing left address, doing left, op, and store */ p->in.su = max(sur,sul+2); /* if( o==ASG MUL || o==ASG DIV || o==ASG MOD) p->in.su = max(p->in.su,fregs); */ return; } switch( o ){ case ANDAND: case OROR: case QUEST: case COLON: case COMOP: p->in.su = max( max(sul,sur), 1); return; case PLUS: case OR: case ER: /* commutative ops; put harder on left */ if( p->in.right->in.su > p->in.left->in.su && !istnode(p->in.left) ){ register NODE *temp; temp = p->in.left; p->in.left = p->in.right; p->in.right = temp; } break; } /* binary op, computed by left, then right, then do op */ p->in.su = max(sul,szty(p->in.right->in.type)+sur); /* if( o==MUL||o==DIV||o==MOD) p->in.su = max(p->in.su,fregs); */ } int radebug = 0; rallo( p, down ) NODE *p; { /* do register allocation */ register o, type, down1, down2, ty; if( radebug ) printf( "rallo( %o, %d )\n", p, down ); down2 = NOPREF; p->in.rall = down; down1 = ( down &= ~MUSTDO ); ty = optype( o = p->in.op ); type = p->in.type; if( type == DOUBLE || type == FLOAT ){ if( o == FORCE ) down1 = R0|MUSTDO; } else switch( o ) { case ASSIGN: down1 = NOPREF; down2 = down; break; /* case MUL: case DIV: case MOD: down1 = R3|MUSTDO; down2 = R5|MUSTDO; break; case ASG MUL: case ASG DIV: case ASG MOD: p->in.left->in.rall = down1 = R3|MUSTDO; if( p->in.left->in.op == UNARY MUL ){ rallo( p->in.left->in.left, R4|MUSTDO ); } else if( p->in.left->in.op == FLD && p->in.left->in.left->in.op == UNARY MUL ){ rallo( p->in.left->in.left->in.left, R4|MUSTDO ); } else rallo( p->in.left, R3|MUSTDO ); rallo( p->in.right, R5|MUSTDO ); return; */ case CALL: case STASG: case EQ: case NE: case GT: case GE: case LT: case LE: case NOT: case ANDAND: case OROR: down1 = NOPREF; break; case FORCE: down1 = R0|MUSTDO; break; } if( ty != LTYPE ) rallo( p->in.left, down1 ); if( ty == BITYPE ) rallo( p->in.right, down2 ); } offstar( p ) register NODE *p; { if( p->in.op == PLUS ) { if( p->in.left->in.su == fregs ) { order( p->in.left, INTAREG|INAREG ); return; } else if( p->in.right->in.su == fregs ) { order( p->in.right, INTAREG|INAREG ); return; } if( p->in.left->in.op==LS && (p->in.left->in.left->in.op!=REG || tlen(p->in.left->in.left)!=sizeof(int) ) ) { order( p->in.left->in.left, INTAREG|INAREG ); return; } if( p->in.right->in.op==LS && (p->in.right->in.left->in.op!=REG || tlen(p->in.right->in.left)!=sizeof(int) ) ) { order( p->in.right->in.left, INTAREG|INAREG ); return; } if( p->in.type == (PTR|CHAR) || p->in.type == (PTR|UCHAR) ) { if( p->in.left->in.op!=REG || tlen(p->in.left)!=sizeof(int) ) { order( p->in.left, INTAREG|INAREG ); return; } else if( p->in.right->in.op!=REG || tlen(p->in.right)!=sizeof(int) ) { order(p->in.right, INTAREG|INAREG); return; } } } if( p->in.op == PLUS || p->in.op == MINUS ){ if( p->in.right->in.op == ICON ){ p = p->in.left; order( p , INTAREG|INAREG); return; } } if( p->in.op == UNARY MUL && !canaddr(p) ) { offstar( p->in.left ); return; } order( p, INTAREG|INAREG ); } setincr( p ) register NODE *p; { p = p->in.left; if( p->in.op == UNARY MUL ){ offstar( p ); return( 1 ); } return( 0 ); } setbin( p ) register NODE *p; { register ro, rt; rt = p->in.right->in.type; ro = p->in.right->in.op; if( canaddr( p->in.left ) && !canaddr( p->in.right ) ) { /* address rhs */ if( ro == UNARY MUL ) { offstar( p->in.right->in.left ); return(1); } else { order( p->in.right, INAREG|INTAREG|SOREG ); return(1); } } if( !istnode( p->in.left) ) { /* try putting LHS into a reg */ /* order( p->in.left, logop(p->in.op)?(INAREG|INBREG|INTAREG|INTBREG|SOREG):(INTAREG|INTBREG|SOREG) );*/ order( p->in.left, INAREG|INTAREG|INBREG|INTBREG|SOREG ); return(1); } else if( ro == UNARY MUL && rt != CHAR && rt != UCHAR ){ offstar( p->in.right->in.left ); return(1); } else if( rt == CHAR || rt == UCHAR || rt == SHORT || rt == USHORT || (ro != REG && ro != NAME && ro != OREG && ro != ICON ) ){ order( p->in.right, INAREG|INBREG ); return(1); } /* else if( logop(p->in.op) && rt==USHORT ){ /* must get rhs into register */ /* order( p->in.right, INAREG ); return( 1 ); } */ return(0); } setstr( p ) registe((r NODE *p; { /* structure assignment */ if( p->in.right->in.op != REG ){ order( p->in.right, INTAREG ); return(1); } p = p->in.left; if( p->in.op != NAME && p->in.op != OREG ){ if( p->in.op != UNARY MUL ) cerror( "bad setstr" ); order( p->in.left, INTAREG ); return( 1 ); } return( 0 ); } setasg( p ) register NODE *p; { /* setup for assignment operator */ if( !canaddr(p->in.right) ) { if( p->in.right->in.op == UNARY MUL ) offstar(p->in.right->in.left); else order( p->in.right, INAREG|INBREG|SOREG ); return(1); } if( p->in.left->in.op == UNARY MUL ) { offstar( p->in.left->in.left ); return(1); } if( p->in.left->in.op == FLD && p->in.left->in.left->in.op == UNARY MUL ){ offstar( p->in.left->in.left->in.left ); return(1); } /* FLD patch */ if( p->in.left->in.op == FLD && !(p->in.right->in.type==INT || p->in.right->in.type==UNSIGNED)) { order( p->in.right, INAREG); return(1); } /* end of FLD patch */ return(0); } setasop( p ) register NODE *p; { /* setup for =ops */ register rt, ro; rt = p->in.right->in.type; ro = p->in.right->in.op; if( ro == UNARY MUL && rt != CHAR ){ offstar( p->in.right->in.left ); return(1); } if( ( rt == CHAR || rt == SHORT || rt == UCHAR || rt == USHORT || ( ro != REG && ro != ICON && ro != NAME && ro != OREG ) ) ){ order( p->in.right, INAREG|INBREG ); return(1); } /* if( (p->in.op == ASG LS || p->in.op == ASG RS) && ro != ICON && ro != REG ){ order( p->in.right, INAREG ); return(1); } */ p = p->in.left; if( p->in.op == FLD ) p = p->in.left; switch( p->in.op ){ case REG: case ICON: case NAME: case OREG: return(0); case UNARY MUL: if( p->in.left->in.op==OREG ) return(0); else offstar( p->in.left ); return(1); } cerror( "illegal setasop" ); } int crslab = 9999; /* Honeywell */ getlab(){ return( crslab-- ); } deflab( l ){ printf( "L%d:\n", l ); } genargs( p, ptemp ) register NODE *p, *ptemp; { register NODE *pasg; register align; register size; register TWORD type; /* generate code for the arguments */ /* first, do the arguments on the right */ while( p->in.op == CM ){ genargs( p->in.right, ptemp ); p->in.op = FREE; p = p->in.left; } if( p->in.op == STARG ){ /* structure valued argument */ size = p->stn.stsize; align = p->stn.stalign; if( p->in.left->in.op == ICON ){ p->in.op = FREE; p= p->in.left; } else { /* make it look beautiful... */ p->in.op = UNARY MUL; canon( p ); /* turn it into an oreg */ if( p->in.op != OREG ){ offstar( p->in.left ); canon( p ); if( p->in.op != OREG ){ offstar( p->in.left ); canon( p ); if( p->in.op != OREG ) cerror( "stuck starg" ); } } } ptemp->tn.lval = 0; /* all moves to (sp) */ pasg = talloc(); pasg->in.op = STASG; pasg->stn.stsize = size; pasg->stn.stalign = align; pasg->in.right = p; pasg->in.left = tcopy( ptemp ); /* the following line is done only with the knowledge that it will be undone by the STASG node, with the offset (lval) field retained */ if( p->in.op == OREG ) p->in.op = REG; /* only for temporaries */ order( pasg, FORARG ); ptemp->tn.lval += size; return; } /* ordinary case */ order( p, FORARG ); } argsize( p ) register NODE *p; { register t; t = 0; if( p->in.op == CM ){ t = argsize( p->in.left ); p = p->in.right; } if( p->in.type == DOUBLE || p->in.type == FLOAT ){ SETOFF( t, 4 ); return( t+8 ); } else if( p->in.op == STARG ){ SETOFF( t, 4 ); /* alignment */ return( t + ((p->stn.stsize+3)/4)*4 ); /* size */ } else { SETOFF( t, 4 ); return( t+4 ); } } order( pasg, FORARG ); ptemp->tn.lval += size; return; } /* ordinary case */ order( p, FORARG ); } argsize( p ) register NODE *p; { register t; t = 0; if( p->in.op == CM ){ t = argsize( p->in.left ); p = p->in.right; } if( p->in.type == DOUBLE || p->in.type == FLOAT ){ SETOFF( t, 4 ); return( t+8 ); } else if( p->in.op == STARG ){ SETOFF( t, 4 ); /* alignment */ return( t cmd/pcc/VMS/ 775 0 33 0 2527315234 5730 cmd/pcc/VMS/README 644 0 33 1211 2423041435 6660 These are files needed to producing a VMS C compiler. The program filter translates unix assembly language into something that the VMS assembler will accept assuming the file jeql.mar is transported to VMS and made into a macro library to reside in "db0:[c]jeql.mlb". PLEASE NOTE THAT the most recent mit version of stdio.h for VMS has been revised, due to alignment problems. (The code produced by the compilers is not wholly compatible since that of the unix/32V compiler attempts to allign longword members of structures on longword boundaries and the mit/Ritchie compiler only aligns to 2 byte boundaries.) The revised stdio.h is given here. ssembler will accept assuming the file jeql.mar is transported to VMS and made into a macro library to reside in "db0:[c]jeql.mlb". PLEASE NOTE THAT the most recent mit version of stdio.h for VMS has been revised, due to alignment problems. (The code produced by the compilers is not wholly compatible since that of the unix/32V compiler attempts to allign longword members cmd/pcc/VMS/as.yh 644 0 33 1656 2323566473 6777 # define COLON 257 # define PLUS 258 # define MINUS 259 # define MUL 260 # define DIV 261 # define IOR 262 # define XOR 263 # define AND 264 # define TILDE 265 # define LSH 266 # define RSH 267 # define LITOP 268 # define REGOP 269 # define CM 270 # define NL 271 # define LB 272 # define RB 273 # define LP 274 # define RP 275 # define MP 276 # define SEMI 277 # define INT 278 # define NAME 279 # define REG 280 # define NOCHAR 281 # define SP 282 # define ALPH 283 # define DIG 284 # define SQ 285 # define SH 286 # define INST0 287 # define INSTn 288 # define IJXXX 289 # define ISPACE 290 # define IBYTE 291 # define IWORD 292 # define IINT 293 # define ILONG 294 # define IDATA 295 # define IGLOBAL 296 # define ISET 297 # define ITEXT 298 # define ICOMM 299 # define ILCOMM 300 # define IALIGN 301 # define IFLOAT 302 # define IDOUBLE 303 # define IORG 304 # define ISTAB 305 # define ILSYM 306 # define FLTNUM 307 # define NOTYET 308 281 # define SP 282 # define ALPH 283 # define DIG 284 # define SQ 285 # define SHcmd/pcc/VMS/filter.c 644 0 33 13323 2323566527 7475 #include #include "as.yh" #define NCPS 24 #define LIBNAME " .LIBRARY /DB0:[C]JEQL.MLB/\n" #define TRUE 1 #define FALSE 0 #define clearl() (*strpnt=0,fputs(strbuf,stdout),strpnt=strbuf) FILE *tmpfil; FILE *relfil; FILE *txtfil; char yytext[NCPS+2]; char sname[8]; char strbuf[512]; char *strpnt = strbuf; int pending; int index; int lineno; int curval; int skipspace; int coffset; int yylval; long intval; int anyerrs; int sawname; int saveit; /*define yylex() (fprintf(stderr,"yylex returns %d\n",saveit=oyylex()),saveit)*/ #define yylex() oyylex() main(argc,argv) register char **argv; { int nameflag = 0;char namebuf[16]; register int i; if(--argc>0) { freopen(*++argv,"r",stdin); nameflag = 1; } if(--argc>0) freopen(argv[1],"w",stdout); if(nameflag) { register char *base = *argv; while(*base++); /* Find end */ while(--base>=*argv && *base!='/'); /* find last slash */ base++; /* set base */ for(i = 0; i < 16 && base[i] && base[i]!='.';) namebuf[i++]=((base[i] >= 'a' && base[i] <= 'z') ? (base[i] + 'A' -'a') : base[i]); namebuf[i] = 0; printf("\t.TITLE\t%s\n",namebuf); printf(LIBNAME); } loop: for(;;) { i = yylex(); again: switch(i) { case NL: clearl(); break; case NAME: sawname = 1; break; case CM: case SP: sawname = 0; case LP: fixlength(); break; case 0: goto done; } } done: printf(" .END\n"); } fixlength(){ register char *cp = strpnt; if(sawname==0) return; while(*--cp != ' ' && *cp != '\t' && *cp != ',' && *cp!='@') { cp[2] = *cp; if(cp <= strbuf) yyerror("Bad ( construction"); } cp++; *cp++ = 'L'; *cp++ = '^'; strpnt += 2; } static long mask[] = { 0xffffffff, 0xfffffffe, 0xfffffffc, 0xfffffff8, 0xfffffff0, 0xffffffe0, 0xffffffc0, 0xffffff80, 0xffffff00, 0xfffffe00, 0xfffffc00, 0xfffff800, 0xfffff000, 0xffffe000, 0xffffc000, 0xffff8000, 0xffff0000, 0xfffe0000, 0xfffc0000, 0xfff80000, 0xfff00000, 0xffe00000, 0xffc00000, 0xff800000, 0xff000000, 0xfe000000, 0xfc000000, 0xf8000000, 0xf000((0000, 0xe0000000, 0xc0000000, 0x80000000, }; short type[] = { EOF, SP, 0, 0, 0, 0, 0, 0, 0, 0, SP, NL, 0, 0, SP, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, SP, 0, 0, SH, LITOP, REG, AND, SQ, LP, RP, MUL, PLUS, CM, MINUS, ALPH, DIV, DIG, DIG, DIG, DIG, DIG, DIG, DIG, DIG, DIG, DIG, COLON, SEMI, LSH, 0, RSH, 0, 0, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, LB, 0, RB, XOR, ALPH, 0, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, 0, IOR, 0, TILDE, 0, }; oyylex() { register val; register base; register char *cp; struct symtab *op; static double fltval; char fltchr[64]; int minflag = FALSE; loop: switch(yylval = (type+1)[val = getchar()]) { case SH: copy(';'); while ((val = getchar()) != '\n' && val>0) copy(val); copy(val); val = NL; goto ret; case EOF: val = 0; goto ret; case ALPH: cp = yytext; if(val=='_') val = getchar(); do { if (cp <= &yytext[NCPS]) *cp++ = val; copy(val); } while ((type+1)[val=getchar()]==ALPH || (type+1)[val]==DIG || (type+1)[val]==LITOP); *cp = '\0'; if(skipspace) for(;(type+1)[val]==SP; val = getchar()) copy(val); ungetc(val, stdin); if(*yytext!='.') return(val=NAME); else if(strcmp(yytext,".byte")==0) return(IBYTE); else if(strcmp(yytext,".word")==0) return(IWORD); else if(strcmp(yytext,".long")==0) return(ILONG); else return(NAME); case MINUS: copy(val); switch ((type+1)[val = getchar()]) { case LP: copy(val); return(val = MP); case DIG: break; default: ungetc(val,stdin); return(val = MINUS); } minflag = TRUE; case DIG: intval = val-'0'; if (val=='0') { val = getchar(); if (val=='x' || val=='X') { base = 16; copy('^'); copy('X'); } else if (val=='d' || val=='D' || val=='f' || val=='F') { char *p = fltchr; double atof(); while (p < &fltchr[63] && ((val=getchar())=='.' || val=='e' || val=='d' || val=='E' || val=='D' || val=='-' || val=='+' || (type+1)[val]==DIG)) copy(val),*p++ = val; ungetc(val, stdin); *p++ = '\0'; fltval = atof(fltchr); val = FLTNUM; goto ret; } else { ungetc(val, stdin); base = 8; if((type+1)[val]!=DIG) { copy('0'); val = INT; yylval = 0; goto ret; } copy('^'); copy('O'); } } else copy(val),base = 10; while ((type+1)[val=getchar()]==DIG || (base==16 && (val>='a' && val<='f'||val>='A' && val<='F'))) { copy(val); if (base==8) intval <<= 3; else if (base==10) intval *= 10; else intval <<= 4; if (val>='a' && val<='f') val -= 'a' - 10 - '0'; else if (val>='A' && val<='F') val -= 'A' - 10 - '0'; intval += val-'0'; } ungetc(val, stdin); val = INT; if(minflag) intval = -intval; goto ret; case MUL: copy('@'); goto ret; case LITOP: copy('#'); goto ret; case SQ: if ((yylval = getchar()) == '\n') lineno++; intval = yylval; sprintf(strpnt,"%d",intval); for(;(strpnt<&strbuf[512])&& *strpnt; strpnt++); val = INT; goto ret; case 0: yyerror("Illegal character"); val = NOCHAR; goto ret; case SP: if(skipspace) { copy(val); goto loop; } default: copy(val); val = yylval; goto ret; } ret: return(val); } yyerror(s, a) char *s; { if (anyerrs==0) fprintf(stderr, "Assembler:\n"); anyerrs++; fprintf(stderr, "line %d: ", lineno); fprintf(stderr, s, a); fprintf(stderr, "\n"); } copy(p) register p; { if(p>='a'&&p<='z') p += 'A' - 'a'; if(strpnt_cnt>=0? *(p)->_ptr++&0377:_filbuf(p)) #define getchar() getc(stdin) #define putchar(x) putc(x,stdout) #define feof(p) (((p)->_flag&_IOEOF)!=0) #define ferror(p) (((p)->_flag&_IOERR)!=0) #define fileno(p) p->_file FILE *fopen(); FILE *freopen(); extern struct io$head { int initzd; int lobr; FILE *ufiles[_NFILE]; int hibr; int mxbr; int lopg; int hipg; int mxpg; char stinrms[RMSSIZ]; char storms[RMSSIZ]; char sterrms[RMSSIZ]; char stinbuf[BUFSIZ]; char stobuf[BUFSIZ]; char sterbuf[BUFSIZ]; } io_com ; #define check(c,s); if (c) {errno = s; return(-1);} #define EBADF 9 #define EINVAL 22 #define EMFILE 24 extern int errno; _IOEOF)!=0) #define ferror(p) (((p)->_flag&_IOERR)!=0) #define fileno(p) p->_file FILE *fopen(); FILE *freopen(); extern struct io$head { int initzd; int lobr; FILE *ufiles[_NFILE]; int hibrcmd/pcc/table.c 644 0 33 35111 2447524411 6622 static char *sccsid ="%W% (Berkeley) %G%"; # include "mfile2" # define WPTR TPTRTO|TINT|TLONG|TFLOAT|TDOUBLE|TPOINT|TUNSIGNED|TULONG # define AWD SNAME|SOREG|SCON|STARNM|STARREG /* tbl */ # define ANYSIGNED TPOINT|TINT|TLONG|TSHORT|TCHAR # define ANYUSIGNED TUNSIGNED|TULONG|TUSHORT|TUCHAR # define ANYFIXED ANYSIGNED|ANYUSIGNED # define TWORD TINT|TUNSIGNED|TPOINT|TLONG|TULONG # define NIAWD SNAME|SCON|STARNM /* tbl */ struct optab table[] = { PCONV, INAREG|INTAREG, SAREG|AWD, TCHAR|TSHORT, SANY, TPOIN((T, NAREG|NASL, RESC1, " cvtZLl AL,A1\n", PCONV, INAREG|INTAREG, SAREG|AWD, TUCHAR|TUSHORT, SANY, TPOINT, NAREG|NASL, RESC1, " movzZLl AL,A1\n", /* the following entry is to fix a problem with the manner that the first pass handles the type of a shift expression */ PCONV, INAREG|INTAREG, SAREG|AWD, TINT|TUNSIGNED, SANY, TPOINT, NAREG|NASL, RLEFT, "", SCONV, INTAREG|FORCC, SAREG, TDOUBLE, SANY, TDOUBLE, 0, RLEFT, "", #ifdef FORT SCONV, INTAREG|FORCC, SAREG|AWD, ANYSIGNED|TUNSIGNED|TULONG|TFLOAT, SANY, TFLOAT, NAREG|NASL, RESC1|RESCC, " cvtZLf AL,TA1\n", SCONV, INTAREG|FORCC, SAREG|AWD, TUCHAR|TUSHORT, SANY, TFLOAT, NAREG|NASL, RESC1|RESCC, " movzZLl AL,A1\n cvtlf A1,TA1\n", #endif SCONV, INTAREG|FORCC, SAREG|AWD, ANYSIGNED|TUNSIGNED|TULONG|TFLOAT, SANY, TFLOAT|TDOUBLE, NAREG|NASL, RESC1|RESCC, " cvtZLd AL,A1\n", SCONV, INTAREG|FORCC, SAREG|AWD, TUCHAR|TUSHORT, SANY, TFLOAT|TDOUBLE, NAREG|NASL, RESC1|RESCC, " movzZLl AL,A1\n cvtld A1,A1\n", SCONV, INTAREG|FORCC, SAREG|AWD, TFLOAT|TDOUBLE, SANY, ANYFIXED, NAREG|NASL, RESC1|RESCC, " cvtZLZF AL,A1\n", SCONV, INTAREG|FORCC, SAREG|SNAME|SCON|STARNM, TANY, SANY, ANYUSIGNED, NAREG|NASL, RESC1|RESCC, " movzZRl AL,A1\n", SCONV, INTAREG|FORCC, SSOREG, TANY, SANY, ANYUSIGNED, NAREG|NASL, RESC1|RESCC, " movzZRl AL,A1\n", SCONV, INTAREG|FORCC, SAREG|SNAME|SCON|STARNM, TANY, SANY, TANY, NAREG|NASL, RESC1|RESCC, " cvtZRl AL,A1\n", SCONV, INTAREG|FORCC, SSOREG, TANY, SANY, TANY, NAREG|NASL, RESC1|RESCC, " cvtZRl AL,A1\n", INIT, FOREFF, SCON, TANY, SANY, TWORD, 0, RNOP, " .long CL\n", INIT, FOREFF, SCON, TANY, SANY, TSHORT|TUSHORT, 0, RNOP, " .word CL\n", INIT, FOREFF, SCON, TANY, SANY, TCHAR|TUCHAR, 0, RNOP, " .byte CL\n", /* for the use of fortran only */ GOTO, FOREFF, SCON, TANY, SANY, TANY, 0, RNOP, " jbr CL\n", GOTO, FOREFF, AWD, TANY, SANY, TANY, 0, RNOP, " jmp *AL\n", GOTO, FOREFF, SAREG, TANY, SANY, TANY, 0, RNOP, " jmp (AL)\n", STARG, FORARG, SCON|SOREG, TANY, SANY, TANY, NTEMP+2*NAREG, RESC3, "ZS", STASG, FORARG, SNAME|SOREG, TANY, SCON|SAREG, TANY, 0, RNULL, " subl2 ZT,sp\nZS", STASG, FOREFF, SNAME|SOREG, TANY, SCON|SAREG, TANY, 0, RNOP, "ZS", STASG, INAREG, SNAME|SOREG, TANY, SCON, TANY, NAREG, RESC1, "ZS movl AR,A1\n", STASG, INAREG, SNAME|SOREG, TANY, SAREG, TANY, 0, RRIGHT, " pushl AR\nZS movl (sp)+,AR\n", FLD, INAREG|INTAREG, SANY, TANY, SFLD, ANYSIGNED, NAREG|NASR, RESC1, " extv $H,$S,AR,A1\n", FLD, INAREG|INTAREG, SANY, TANY, SFLD, ANYUSIGNED, NAREG|NASR, RESC1, " extzv $H,$S,AR,A1\n", FLD, FORARG, SANY, TANY, SFLD, ANYSIGNED, 0, RNULL, " extv $H,$S,AR,-(sp)\n", FLD, FORARG, SANY, TANY, SFLD, ANYUSIGNED, 0, RNULL, " extzv $H,$S,AR,-(sp)\n", OPLOG, FORCC, SAREG|AWD, TWORD, SAREG|AWD, TWORD, 0, RESCC, " cmpl AL,AR\nZP", OPLOG, FORCC, SAREG|AWD, TSHORT|TUSHORT, SAREG|AWD, TSHORT|TUSHORT, 0, RESCC, " cmpw AL,AR\nZP", OPLOG, FORCC, SAREG|AWD, TCHAR|TUCHAR, SAREG|AWD, TCHAR|TUCHAR, 0, RESCC, " cmpb AL,AR\nZP", OPLOG, FORCC, SAREG|AWD, TSHORT|TUSHORT, SSCON, TANY, 0, RESCC, " cmpw AL,AR\nZP", OPLOG, FORCC, SAREG|AWD, TCHAR|TUCHAR, SCCON, TANY, 0, RESCC, " cmpb AL,AR\nZP", OPLOG, FORCC, SAREG|AWD, TDOUBLE, SAREG|AWD, TDOUBLE, 0, RESCC, " cmpd AL,AR\nZP", OPLOG, FORCC, SAREG|AWD, TDOUBLE, SAREG|AWD, TFLOAT, NAREG|NASR, RESCC, " cvtfd AR,A1\n cmpd AL,A1\nZP", OPLOG, FORCC, SAREG|AWD, TFLOAT, SAREG|AWD, TDOUBLE, NAREG|NASL, RESCC, " cvtfd AL,A1\n cmpd A1,AR\nZP", OPLOG, FORCC, SAREG|AWD, TFLOAT, SAREG|AWD, TFLOAT, 0, RESCC, " cmpf AL,AR\nZP", CCODES, INAREG|INTAREG, SANY, TANY, SANY, TANY, NAREG, RESC1, " movl $1,A1\nZN", UNARY CALL, INTAREG, SCON, TANY, SANY, TWORD|TCHAR|TUCHAR|TSHORT|TUSHORT|TFLOAT|TDOUBLE, NAREG|NASL, RESC1, /* should be register 0 */ " calls ZC,CL\n", UNARY CALL, INTAREG, SAREG, TANY, SANY, TWORD|TCHAR|TUCHAR|TSHORT|TUSHORT|TFLOAT|TDOUBLE, NAREG|NASL, RESC1, /* should be 0 */ " calls ZC,(AL)\n", UNARY CALL, INAREG|INTAREG, SNAME, TANY, SANY, TANY, NAREG|NASL, RESC1, /* really reg 0 */ " calls ZC,*AL\n", UNARY CALL, INAREG|INTAREG, SSOREG, TANY, SANY, TANY, NAREG|NASL, RESC1, /* really reg 0 */ " calls ZC,*AL\n", ASG RS, INAREG|FOREFF|FORCC, SAREG, TWORD, SCON, TINT, 0, RLEFT|RESCC, " extzv AR,ZU,AL,AL\n", ASG RS, INAREG|FOREFF|FORCC, SAREG, TWORD, SAREG, ANYFIXED, NAREG, RLEFT|RESCC, " subl3 AR,$32,A1\n extzv AR,A1,AL,AL\n", ASG RS, INAREG|FOREFF|FORCC, SAREG, TWORD, SAREG|AWD, TWORD, NAREG, RLEFT|RESCC, " subl3 AR,$32,A1\n extzv AR,A1,AL,AL\n", RS, INAREG|INTAREG|FORCC, SAREG, TWORD, SCON, TINT, NAREG|NASL, RESC1|RESCC, " extzv AR,ZU,AL,A1\n", ASG LS, INAREG|FOREFF|FORCC, SAREG|AWD, TWORD, SAREG|NIAWD, ANYSIGNED|ANYUSIGNED, 0, RLEFT|RESCC, " ashl AR,AL,AL\n", ASG LS, INAREG|FOREFF|FORCC, SAREG|AWD, TWORD, SSOREG, ANYSIGNED|ANYUSIGNED, 0, RLEFT|RESCC, " ashl AR,AL,AL\n", ASG LS, INAREG|FOREFF|FORCC, SAREG|AWD, TWORD, SOREG, ANYSIGNED|ANYUSIGNED, NAREG, RLEFT|RESCC, " ZB AR,A1\n ashl A1,AL,AL\n", LS, INAREG|INTAREG|FORCC, SAREG|AWD, TWORD, SAREG|NIAWD, ANYSIGNED|ANYUSIGNED, NAREG|NASL|NASR, RESC1|RESCC, " ashl AR,AL,A1\n", LS, INAREG|INTAREG|FORCC, SAREG|AWD, TWORD, SSOREG, ANYSIGNED|ANYUSIGNED, NAREG|NASL|NASR, RESC1|RESCC, " ashl AR,AL,A1\n", LS, INAREG|INTAREG|FORCC, SAREG|AWD, TWORD, SOREG, ANYSIGNED|ANYUSIGNED, NAREG|NASR, RESC1|RESCC, " ZB AR,A1\n ashl A1,AL,A1\n", INCR, FOREFF, AWD, TANY, SCON, TANY, 0, RLEFT, " ZE\n", DECR, FOREFF, AWD, TANY, SCON, TANY, 0, RLEFT, " ZE\n", INCR, FOREFF, SAREG, TWORD, SCON, TANY, 0, RLEFT, " ZE\n", DECR, FOREFF, SAREG, TWORD, SCON, TANY, 0, RLEFT, " ZE\n", /* jwf INCR and DECR for SAREG TCHAR|TSHORT matched by ASG PLUS etc */ INCR, INAREG|INTAREG, AWD, TANY, SCON, TANY, NAREG, RESC1, " ZD\n", DECR, INAREG|INTAREG, AWD, TANY, SCON, TANY, NAREG, RESC1, " ZD\n", INCR, INAREG|INTAREG, SAREG, TWORD, SCON, TANY, NAREG, RESC1, " ZD\n", DECR, INAREG|INTAREG, SAREG, TWORD, SCON, TANY, NAREG, RESC1, " ZD\n", ASSIGN, INAREG|FOREFF|FORCC, SAREG|AWD, TANY, SAREG|AWD, TANY, 0, RLEFT|RRIGHT|RESCC, " ZA\n", ASSIGN, INAREG|FOREFF, SFLD, TANY, SAREG|AWD, TWORD, 0, RRIGHT, " insv AR,$H,$S,AL\n", ASSIGN, INAREG|FOREFF|FORCC, SAREG|AWD, TWORD, SFLD, ANYSIGNED, 0, RLEFT|RESCC, " extv $H,$S,AR,AL\n", ASSIGN, INAREG|FOREFF|FORCC, SAREG|AWD, TWORD, SFLD, ANYUSIGNED, 0, RLEFT|RESCC, " extzv $H,$S,AR,AL\n", /* dummy UNARY MUL entry to get U* to possibly match OPLTYPE */ UNARY MUL, FOREFF, SCC, TANY, SCC, TANY, 0, RNULL, " HELP HELP HELP\n", REG, INTEMP, SANY, TANY, SAREG, TDOUBLE, 2*NTEMP, RESC1, " movd AR,A1\n", REG, INTEMP, SANY, TANY, SAREG, TANY, NTEMP, RESC1, " movZF AR,A1\n", #ifdef FORT REG, FORARG, SANY, TANY, SAREG, TFLOAT, 0, RNULL, " cvtfd AR,-(sp)\n", REG, FORARG, SANY, TANY, SAREG, TDOUBLE, 0, RNULL, " movZR AR,-(sp)\n", #endif OPLEAF, FOREFF, SANY, TANY, SAREG|AWD, TANY, 0, RLEFT, "", OPLTYPE, INAREG|INTAREG, SANY, TANY, SANY, TFLOAT|TDOUBLE, 2*NAREG|NASR, RESC1, " ZA\n", OPLTYPE, INAREG|INTAREG, SANY, TANY, SANY, TANY, NAREG|NASR, RESC1, " ZA\n", OPLTYPE, FORCC, SANY, TANY, SANY, TANY, 0, RESCC, " tstZR AR\n", OPLTYPE, FORARG, SANY, TANY, SANY, TWORD, 0, RNULL, " pushl AR\n", OPLTYPE, FORARG, SANY, TANY, SANY, TCHAR|TSHORT, 0, RNULL, " cvtZRl AR,-(sp)\n", OPLTYPE, FORARG, SANY, TANY, SANY, TUCHAR|TUSHORT, 0, RNULL, " movzZRl AR,-(sp)\n", OPLTYPE, FORARG, SANY, TANY, SANY, TDOUBLE, 0, RNULL, " movd AR,-(sp)\n", OPLTYPE, FORARG, SANY, TANY, SANY, TFLOAT, 0, RNULL, " cvtfd AR,-(sp)\n", UNARY MINUS, INTAREG|FORCC, SAREG|AWD, TINT|TUNSIGNED|TLONG|TULONG|TDOUBLE, SANY, TANY, NAREG|NASL, RESC1|RESCC, " mnegZL AL,A1\n", COMPL, INTAREG|FORCC, SAREG|AWD, TINT|TUNSIGNED, SANY, TANY, NAREG|NASL, RESC1|RESCC, " mcomZL AL,A1\n", COMPL, INTAREG|FORCC, SAREG|AWD, ANYSIGNED|ANYUSIGNED, SANY, TANY, NAREG|NASL, RESC1|RESCC, " cvtZLl AL,A1\n mcoml A1,A1\n", AND, FORCC, SAREG|AWD, TWORD, SCON, TWORD, 0, RESCC, " bitl ZZ,AL\n", AND, FORCC, SAREG|AWD, TSHORT|TUSHORT, SSCON, TWORD, 0, RESCC, " bitw ZZ,AL\n", AND, FORCC, SAREG|AWD, TCHAR|TUCHAR, SCCON, TWORD, 0, RESCC, " bitb ZZ,AL\n", ASG AND, INAREG|FOREFF|FORCC, SAREG, TWORD, SCON, TWORD, 0, RLEFT|RESCC, " bicl2 AR,AL\n", ASG OPMUL, INAREG|FOREFF|FORCC, SAREG|AWD, TINT|TUNSIGNED|TLONG|TULONG, SAREG|AWD, TINT|TUNSIGNED|TLONG|TULONG, 0, RLEFT|RESCC, " OL2 AR,AL\n", OPMUL, INAREG|INTAREG|FORCC, STAREG, TINT|TUNSIGNED|TLONG|TULONG, SAREG|AWD, TINT|TUNSIGNED|TLONG|TULONG, 0, RLEFT|RESCC, " OL2 AR,AL\n", OPMUL, INAREG|INTAREG|FORCC, SAREG|AWD, TINT|TUNSIGNED|TLONG|TULONG, SAREG|AWD, TINT|TUNSIGNED|TLONG|TULONG, NAREG|NASL|NASR, RESC1|RESCC, " OL3 AR,AL,A1\n", ASG MOD, INAREG|INTAREG|FOREFF|FORCC, SAREG, TINT|TUNSIGNED|TLONG|TULONG, SAREG|AWD, TINT|TUNSIGNED|TLONG|TULONG, NAREG, RLEFT|RESCC, " divl3 AR,AL,A1\n mull2 AR,A1\n subl2 A1,AL\n", MOD, INAREG|INTAREG, SAREG|AWD, TINT|TUNSIGNED|TLONG|TULONG, SAREG|AWD, TINT|TUNSIGNED|TLONG|TULONG, NAREG, RESC1, " divl3 AR,AL,A1\n mull2 AR,A1\n subl3 A1,AL,A1\n", ASG PLUS, INAREG|FOREFF|FORCC, SAREG, TPOINT|TINT|TLONG|TUNSIGNED|TULONG, SONE, TINT|TLONG, 0, RLEFT|RESCC, " incZL AL\n", ASG PLUS, INAREG|FOREFF|FORCC, AWD, ANYSIGNED|ANYUSIGNED, SONE, TINT|TLONG, 0, RLEFT|RESCC, " incZL AL\n", ASG PLUS, INAREG|FOREFF|FORCC, SAREG, TSHORT|TCHAR, SONE, TINT|TLONG, 0, RLEFT|RESCC, " incZL AL\n cvtZLl AL,AL\n", ASG PLUS, INAREG|FOREFF|FORCC, SAREG, TUSHORT|TUCHAR, SONE, TINT|TLONG, 0, RLEFT|RESCC, " incZL AL\n movzZLl AL,AL\n", ASG MINUS, INAREG|FOREFF|FORCC, SAREG, TPOINT|TINT|TLONG|TUNSIGNED|TULONG, SONE, TINT|TLONG, 0, RLEFT|RESCC, " decZL AL\n", ASG MINUS, INAREG|FOREFF|FORCC, AWD, ANYSIGNED|ANYUSIGNED, SONE, TINT|TLONG, 0, RLEFT|RESCC, " decZL AL\n", ASG MINUS, INAREG|FOREFF|FORCC, SAREG, TSHORT|TCHAR, SONE, TINT((|TLONG, 0, RLEFT|RESCC, " decZL AL\n cvtZLl AL,AL\n", ASG MINUS, INAREG|FOREFF|FORCC, SAREG, TUSHORT|TUCHAR, SONE, TINT|TLONG, 0, RLEFT|RESCC, " decZL AL\n movzZLl AL,AL\n", PLUS, INAREG|INTAREG|FORCC, STAREG, TWORD, SONE, TWORD, 0, RLEFT|RESCC, " incZL AL\n", PLUS, INAREG|INTAREG|FORCC, STAREG, TSHORT|TCHAR, SONE, TWORD, 0, RLEFT|RESCC, " incZL AL\n cvtZLl AL,AL\n", PLUS, INAREG|INTAREG|FORCC, STAREG, TUSHORT|TUCHAR, SONE, TWORD, 0, RLEFT|RESCC, " incZL AL\n movzZLl AL,AL\n", MINUS, INAREG|INTAREG|FORCC, STAREG, TWORD, SONE, TWORD, 0, RLEFT|RESCC, " decZL AL\n", MINUS, INAREG|INTAREG|FORCC, STAREG, TSHORT|TCHAR, SONE, TWORD, 0, RLEFT|RESCC, " decZL AL\n cvtZLl AL,AL\n", MINUS, INAREG|INTAREG|FORCC, STAREG, TUSHORT|TUCHAR, SONE, TWORD, 0, RLEFT|RESCC, " decZL AL\n movzZLl AL,AL\n", ASG OPSIMP, INAREG|FOREFF|FORCC, SAREG|AWD, TWORD, SAREG|AWD, TWORD, 0, RLEFT|RESCC, " OL2 AR,AL\n", ASG OPSIMP, INAREG|FOREFF|FORCC, SAREG, TWORD, SAREG, TSHORT|TUSHORT|TCHAR|TUCHAR, 0, RLEFT|RESCC, " OL2 AR,AL\n", ASG OPSIMP, INAREG|FOREFF|FORCC, AWD, TSHORT|TUSHORT, SAREG|AWD, TSHORT|TUSHORT, 0, RLEFT|RESCC, " OW2 AR,AL\n", ASG OPSIMP, INAREG|FOREFF|FORCC, AWD, TSHORT|TUSHORT, SSCON, TWORD, 0, RLEFT|RESCC, " OW2 AR,AL\n", ASG OPSIMP, INAREG|FOREFF|FORCC, AWD, TCHAR|TUCHAR, SAREG|AWD, TCHAR|TUCHAR, 0, RLEFT|RESCC, " OB2 AR,AL\n", ASG OPSIMP, INAREG|FOREFF|FORCC, AWD, TCHAR|TUCHAR, SCCON, TWORD, 0, RLEFT|RESCC, " OB2 AR,AL\n", ASG OPSIMP, INAREG|FOREFF|FORCC, SAREG, TSHORT, SAREG|AWD, ANYFIXED, 0, RLEFT|RESCC, " OW2 AR,AL\n cvtZLl AL,AL\n", ASG OPSIMP, INAREG|FOREFF|FORCC, SAREG, TUSHORT, SAREG|AWD, ANYFIXED, 0, RLEFT|RESCC, " OW2 AR,AL\n movzZLl AL,AL\n", ASG OPSIMP, INAREG|FOREFF|FORCC, SAREG, TCHAR, SAREG|AWD, ANYFIXED, 0, RLEFT|RESCC, " OB2 AR,AL\n cvtZLl AL,AL\n", ASG OPSIMP, INAREG|FOREFF|FORCC, SAREG, TUCHAR, SAREG|AWD, ANYFIXED, 0, RLEFT|RESCC, " OB2 AR,AL\n movzZLl AL,AL\n", OPSIMP, INAREG|INTAREG|FORCC, STAREG, ANYFIXED, SAREG|AWD, TWORD, 0, RLEFT|RESCC, " OL2 AR,AL\n", OPSIMP, INAREG|INTAREG|FORCC, SAREG|AWD, TWORD, SAREG|AWD, TWORD, NAREG|NASL|NASR, RESC1|RESCC, " OL3 AR,AL,A1\n", ASG OPFLOAT, INAREG|FOREFF|FORCC, SAREG|AWD, TDOUBLE, SAREG|AWD, TDOUBLE, 0, RLEFT|RESCC, " OD2 AR,AL\n", ASG OPFLOAT, INAREG|FOREFF|FORCC, SAREG|AWD, TFLOAT, SAREG|AWD, TFLOAT, 0, RLEFT|RESCC, " OF2 AR,AL\n", ASG OPFLOAT, INAREG|FOREFF|FORCC, SAREG|AWD, TDOUBLE, SAREG|AWD, TFLOAT, NAREG|NASR, RLEFT|RESCC, " cvtfd AR,A1\n OD2 A1,AL\n", ASG OPFLOAT, INAREG|INTAREG|FOREFF|FORCC, SAREG|AWD, TFLOAT, SAREG|AWD, TDOUBLE, NAREG, RLEFT|RESC1|RESCC, " cvtfd AL,A1\n OD2 AR,A1\n cvtdf A1,AL\n", OPFLOAT, INAREG|INTAREG|FORCC, STAREG, TDOUBLE, SAREG|AWD, TDOUBLE, 0, RLEFT|RESCC, " OD2 AR,AL\n", OPFLOAT, INAREG|INTAREG|FORCC, SAREG|AWD, TDOUBLE, SAREG|AWD, TDOUBLE, NAREG|NASL|NASR, RESC1|RESCC, " OD3 AR,AL,A1\n", OPFLOAT, INAREG|INTAREG|FORCC, SAREG|AWD, TFLOAT, SAREG|AWD, TDOUBLE, NAREG|NASL, RESC1|RESCC, " cvtfd AL,A1\n OD2 AR,A1\n", OPFLOAT, INAREG|INTAREG|FORCC, SAREG|AWD, TDOUBLE, SAREG|AWD, TFLOAT, NAREG|NASR, RESC1|RESCC, " cvtfd AR,A1\n OD3 A1,AL,A1\n", #ifdef FORT OPFLOAT, INAREG|INTAREG|FORCC, STAREG, TFLOAT, SAREG|AWD, TFLOAT, 0, RLEFT|RESCC, " OF2 TAR,AL\n", OPFLOAT, INAREG|INTAREG|FORCC, SAREG|AWD, TFLOAT, SAREG|AWD, TFLOAT, NAREG|NASL|NASR, RESC1|RESCC, " OF3 AR,AL,TA1\n", #else OPFLOAT, INAREG|INTAREG|FORCC, SAREG|AWD, TFLOAT, SAREG|AWD, TFLOAT, NAREG|NASL|NASR, RESC1|RESCC, " OF3 AR,AL,A1\n cvtfd A1,A1\n", #endif /* Default actions for hard trees ... */ # define DF(x) FORREW,SANY,TANY,SANY,TANY,REWRITE,x,"" UNARY MUL, DF( UNARY MUL ), INCR, DF(INCR), DECR, DF(INCR), ASSIGN, DF(ASSIGN), STASG, DF(STASG), FLD, DF(FLD), OPLEAF, DF(NAME), OPLOG, FORCC, SANY, TANY, SANY, TANY, REWRITE, BITYPE, "", OPLOG, DF(NOT), COMOP, DF(COMOP), INIT, DF(INIT), OPUNARY, DF(UNARY MINUS), ASG OPANY, DF(ASG PLUS), OPANY, DF(BITYPE), FREE, FREE, FREE, FREE, FREE, FREE, FREE, FREE, "help; I'm in trouble\n" }; endif /* Default actions for hard trees ... */ # define DF(x) FORREW,SANY,TANY,SANY,TANY,REWRITE,x,"" UNARY MUL, DF( UNARY MUL ), INCR, DF(INCR), DECR, DF(INCR), ASSIGN, DF(ASSIGN), STASG, DF(STASG), FLD, DF(FLD), OPLEAF, DF(NAME), OPLOG, FORCC, SANY, TANY, SANY, TANY, REWRITE, BITYPE, "", OPLOG, DF(NOT), COMOP, DF(COMOP), INIT, DF(INIT), OPUNARY, DF(UNARY MINUS), ASG OPANY, DF(ASG PLUS), OPANY, DF(BITYPE), FREcmd/pcc/ERRS 664 0 33 5205 2527233057 6052 yacc ../mip/cgram.y conflicts: 7 shift/reduce rm -f rodata.c ./:yyfix yyexca yyact yypact yypgo yyr1 yyr2 yychk yydef mv y.tab.c cgram.c cc -O -DASSTRINGS -DSTABDOT -DLCOMM -DBUFSTDERR -DFLEXNAMES -S rodata.c ./:rofix rodata.s 2135 2135 as -o rodata.o rodata.s rm -f rodata.s cc -c -O -DASSTRINGS -DSTABDOT -DLCOMM -DBUFSTDERR -DFLEXNAMES -I../mip -I. cgram.c cc -c -O -DASSTRINGS -DSTABDOT -DLCOMM -DBUFSTDERR -DFLEXNAMES -I../mip -I. ../mip/xdefs.c cc -c -O -DASSTRINGS -DSTABDOT -DLCOMM -DBUFSTDERR -DFLEXNAMES -I../mip -I. ../mip/scan.c cc -c -O -DASSTRINGS -DSTABDOT -DLCOMM -DBUFSTDERR -DFLEXNAMES -I../mip -I. ../mip/pftn.c cc -c -O -DASSTRINGS -DSTABDOT -DLCOMM -DBUFSTDERR -DFLEXNAMES -I../mip -I. ../mip/trees.c cc -c -O -DASSTRINGS -DSTABDOT -DLCOMM -DBUFSTDERR -DFLEXNAMES -I../mip -I. ../mip/optim.c cc -c -O -DASSTRINGS -DSTABDOT -DLCOMM -DBUFSTDERR -DFLEXNAMES -I../mip -I. code.c cc -c -O -DASSTRINGS -DSTABDOT -DLCOMM -DBUFSTDERR -DFLEXNAMES -I../mip -I. local.c cc -c -O -DASSTRINGS -DSTABDOT -DLCOMM -DBUFSTDERR -DFLEXNAMES -I../mip -I. ../mip/reader.c cc -c -O -DASSTRINGS -DSTABDOT -DLCOMM -DBUFSTDERR -DFLEXNAMES -I../mip -I. local2.c cc -c -O -DASSTRINGS -DSTABDOT -DLCOMM -DBUFSTDERR -DFLEXNAMES -I../mip -I. order.c cc -c -O -DASSTRINGS -DSTABDOT -DLCOMM -DBUFSTDERR -DFLEXNAMES -I../mip -I. ../mip/match.c cc -c -O -DASSTRINGS -DSTABDOT -DLCOMM -DBUFSTDERR -DFLEXNAMES -I../mip -I. ../mip/allo.c cc -c -O -DASSTRINGS -DSTABDOT -DLCOMM -DBUFSTDERR -DFLEXNAMES -I../mip -I. ../mip/comm1.c cc -O -DASSTRINGS -DSTABDOT -DLCOMM -DBUFSTDERR -DFLEXNAMES -S -I../mip -I. table.c ./:rofix table.s 19068 19068 as -o table.o table.s rm -f table.s cc -z rodata.o cgram.o xdefs.o scan.o pftn.o trees.o optim.o code.o local.o reader.o local2.o order.o match.o allo.o comm1.o table.o -o ./comp cc -c -O -DASSTRINGS -DSTABDOT -DLCOMM -DBUFSTDERR -DFLEXNAMES -I../mip -I. ../mip/fort.c cc -c -O -DASSTRINGS -DSTABDOT -DLCOMM -DBUFSTDERR -DFLEXNAMES -I../mip -I. ../mip/freader.c cc -c -O -DASSTRINGS -DSTABDOT -DLCOMM -DBUFSTDERR -DFLEXNAMES -I../mip -I. ../mip/fallo.c cc -c -O -DASSTRINGS -DSTABDOT -DLCOMM -DBUFSTDERR -DFLEXNAMES -I../mip -I. ../mip/fmatch.c cc -c -R -O -DASSTRINGS -DSTABDOT -DLCOMM -DBUFSTDERR -DFLEXNAMES -I../mip -I. ../mip/ftable.c cc -c -O -DASSTRINGS -DSTABDOT -DLCOMM -DBUFSTDERR -DFLEXNAMES -I../mip -I. ../mip/forder.c cc -c -O -DASSTRINGS -DSTABDOT -DLCOMM -DBUFSTDERR -DFLEXNAMES -I../mip -I. ../mip/flocal2.c cc -c -O -DASSTRINGS -DSTABDOT -DLCOMM -DBUFSTDERR -DFLEXNAMES -I../mip -I. ../mip/fcomm2.c cc -z -O -DASSTRINGS -DSTABDOT -DLCOMM -DBUFSTDERR -DFLEXNAMES fort.o freader.o fallo.o fmatch.o ftable.o forder.o flocal2.o fcomm2.o -o ./fort -R -O -DASSTRINGS -DSTABDOT -DLCOMM -DBUFSTDERR -DFLEXNAMES -I../mip -I. ../mip/ftable.c cc -c -O -DASSTRINGS -DSTABDOT -DLCOMM -DBUFSTDERR -DFLEXNAMES -I../mip -I. ../mip/forder.c cc -c -O -DASSTRINGS -DSTABDOT -DLCOMM -DBUFSTDERR -DFLEXNAMES -I../mip -I. ../mip/flocal2.c cc -c -O -DASSTRINGS -DSTABDOT -DLCOMM -DBUFSTDERR -DFLEXNAMES -I../mip -I. ../mip/fcomm2.c cc -z -O -DAcmd/shutdown.c 444 0 33 16342 2552437604 6650 static char *sccsid = "@(#)shutdown.c 4.10 (Berkeley) 81/06/12"; #include #include #include #include #include #include /* * /etc/shutdown when [messages] * * allow super users to tell users and remind users * of iminent shutdown of unix * and shut it down automatically * and even reboot or halt the machine if they desire * * Ian Johnstone, Sydney, 1977 * Robert Elz, Melbourne, 1978 * Peter Lamb, Melbourne, 1980 * William Joy, Berkeley, 1981 * Michael Toy, Berkeley, 1981 * Dave Presotto, Berkeley, 1981 */ #ifdef DEBUG #define LOGFILE "shutdown.log" #else #define LOGFILE "/usr/adm/shutdownlog" #endif #define REBOOT "/etc/reboot" #define HALT "/etc/halt" #define MAXINTS 20 #define HOURS *3600 #define MINUTES *60 #define SECONDS #define NLOG 20 /* no of args possible for message */ #define NOLOGTIME 5 MINUTES #define IGNOREUSER "sleeper" int do_nothing(); time_t getsdt(); extern char *ctime(); extern struct tm *localtime(); struct utmp utmp; int sint; int stogo; char tpath[] = "/dev/"; int nlflag = 1; /* nolog yet to be done */ int killflg = 1; int reboot = 0; int halt = 0; char term[sizeof tpath + sizeof utmp.ut_line]; char tbuf[BUFSIZ]; char nolog1[] = "\n\nNO LOGINS: System going down at %5.5s\n\n"; char *nolog2[NLOG+1]; #ifdef DEBUG char nologin[] = "nologin"; #else char nologin[] = "/etc/nologin"; #endif int slots; struct interval { int stogo; int sint; } interval[] = { 4 HOURS, 1 HOURS, 2 HOURS, 30 MINUTES, 1 HOURS,(( 15 MINUTES, 30 MINUTES, 10 MINUTES, 15 MINUTES, 5 MINUTES, 10 MINUTES, 5 MINUTES, 5 MINUTES, 3 MINUTES, 2 MINUTES, 30 SECONDS, 40 SECONDS, 10 SECONDS, 0 SECONDS, 0 SECONDS }; char *shutter, *getlogin(); main(argc,argv) int argc; char **argv; { register i, ufd; register char **mess, *f; char *ts; long sdt; int h, m; long nowtime; FILE *termf; shutter = getlogin(); argc--, argv++; while (argc > 0 && (f = argv[0], *f++ == '-')) { while (i = *f++) switch (i) { case 'k': killflg = 0; continue; case 'r': reboot = 1; continue; case 'h': halt = 1; continue; default: fprintf(stderr, "shutdown: '%c' - unknown flag\n", i); exit(1); } argc--, argv++; } if (argc < 1) { printf("Usage: %s [ -krh ] shutdowntime [ message ]\n", argv[0]); finish(); } if (geteuid()) { fprintf(stderr, "NOT super-user\n"); finish(); } sdt = getsdt(argv[0]); argc--, argv++; i = 0; while (argc-- > 0) if (i < NLOG) nolog2[i++] = *argv++; nolog2[i] = NULL; nowtime = time((long *)0); m = ((stogo = sdt - nowtime) + 30)/60; h = m/60; m %= 60; ts = ctime(&sdt); printf("Shutdown at %5.5s (in ", ts+11); if (h > 0) printf("%d hour%s ", h, h != 1 ? "s" : ""); printf("%d minute%s) ", m, m != 1 ? "s" : ""); #ifndef DEBUG signal(SIGHUP, SIG_IGN); signal(SIGQUIT, SIG_IGN); signal(SIGINT, SIG_IGN); #endif signal(SIGTERM, finish); signal(SIGALRM, do_nothing); nice(-20); fflush(stdout); #ifndef DEBUG if (i = fork()) { printf("[pid %d]\n", i); exit(0); } #endif sint = 1 HOURS; f = ""; for (;;) { for (i = 0; stogo <= interval[i].stogo && interval[i].sint; i++) sint = interval[i].sint; if (stogo <= NOLOGTIME && nlflag) { nlflag = 0; nolog(sdt); } if (sint >= stogo || sint == 0) f = "FINAL "; ufd = open("/etc/utmp",0); nowtime = time((long *) 0); while (read(ufd,&utmp,sizeof utmp)==sizeof utmp) if (utmp.ut_name[0] && strncmp(utmp.ut_name, IGNOREUSER, sizeof(utmp.ut_name))) { strcpy(term, tpath); strncat(term, utmp.ut_line, sizeof utmp.ut_line); alarm(3); #ifdef DEBUG if ((termf = stdout) != NULL) #else if ((termf = fopen(term, "w")) != NULL) #endif { alarm(0); setbuf(termf, tbuf); fprintf(termf, "\n\n"); warn(termf, sdt, nowtime); if (sdt - nowtime > 1 MINUTES) for (mess = nolog2; *mess; mess++) fprintf(termf, "%s ", *mess); fputc('\n', termf); alarm(5); #ifdef DEBUG fflush(termf); #else fclose(termf); #endif alarm(0); } } if (stogo < 0) { printf("\n\007\007System shutdown time has arrived\007\007\n"); log_entry(sdt); unlink(nologin); if (!killflg) { printf("but you'll have to do it yourself\n"); finish(); } #ifndef DEBUG if (reboot) execle(REBOOT, "reboot", 0, 0); if (halt) execle(HALT, "halt", 0, 0); kill(1, SIGTERM); /* sync */ kill(1, SIGTERM); /* sync */ sleep(20); #else printf("EXTERMINATE EXTERMINATE\n"); #endif finish(); } stogo = sdt - time((long *) 0); if (stogo > 0) sleep(sint 2 && isdigit(*s)) t = t * 10 + *s++ - '0'; if (*s == ':') s++; if (t > 23) goto badform; tim = t*60; t = 0; while (isdigit(*s)) t = t * 10 + *s++ - '0'; if (t > 59) goto badform; tim += t; tim *= 60; t1 = time((long *) 0); lt = localtime(&t1); t = lt->tm_sec + lt->tm_min*60 + lt->tm_hour*3600; if (tim < t || tim >= (24*3600)) { /* before now or after midnight */ printf("That must be tomorrow\nCan't you wait till then?\n"); finish(); } return (t1 + tim -t); badform: printf("Bad time format\n"); finish(); } warn(term, sdt, nowtime) FILE *term; long sdt, nowtime; { char *ts; register delay = sdt - nowtime; if (delay > 8) while (delay % 5) delay++; if (shutter) fprintf(term, "\007\007*** System shutdown message from %s ***\n", shutter); else fprintf(term, "\007\007*** System shutdown message ***\n"); ts = ctime(&sdt); if (delay> 10 MINUTES) fprintf(term, "System going down at %5.5s\n", ts+11); else if ( delay > 60 SECONDS ) { fprintf(term, "System going down in %d minute%s\n", (delay+30)/60, (delay+30)/60 != 1 ? "s" : ""); } else if ( delay > 0 ) { fprintf(term, "System going down in %d second%s\n", delay, delay != 1 ? "s" : ""); } else fprintf(term, "System going down IMMEDIATELY\n"); } nolog(sdt) long sdt; { FILE *nologf; register char **mess; if ((nologf = fopen(nologin, "w")) != NULL) { fprintf(nologf, nolog1, (ctime(&sdt)) + 11); putc('\t', nologf); for (mess = nolog2; *mess; mess++) fprintf(nologf, " %s", *mess); putc('\n', nologf); fclose(nologf); } } finish() { signal(SIGTERM, SIG_IGN); unlink(nologin); exit(0); } do_nothing() { signal(SIGALRM, do_nothing); } /* * make an entry in the shutdown log */ char *days[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; log_entry(now) time_t now; { register FILE *fp; register char **mess; struct tm *tm, *localtime(); tm = localtime(&now); fp = fopen(LOGFILE, "a"); if (fp==0) return; fseek(fp, 0L, 2); fprintf(fp, "%02d:%02d %s %s %2d, %4d. Shutdown:", tm->tm_hour, tm->tm_min, days[tm->tm_wday], months[tm->tm_mon], tm->tm_mday, tm->tm_year + 1900); for (mess = nolog2; *mess; mess++) fprintf(fp, " %s", *mess); if (shutter) fprintf(fp, " (by %s)", shutter); fputc('\n', fp); fclose(fp); } v", "Dec" }; log_entry(now) time_t now; { register FILE *fp; register char **mess; struct tm *tm, *localtime(); tm = localtime(&now); fp = fopen(LOGFILE, "a"); if (fp==0) return; fseek(fp, 0L, 2); fprintf(fp, "%02d:%02d %s %s %2d, %4d. Shutdown:", tm->tm_hour, tm->tm_micmd/xstr.c 444 0 33 15215 2526160615 5767 static char *sccsid = "@(#)xstr.c 4.2 (Berkeley) 5/7/81"; #include #include #include #include /* * xstr - extract and hash strings in a C program * * Bill Joy UCB * November, 1978 */ #define ignore(a) Ignore((char *) a) char *calloc(); off_t tellpt; off_t hashit(); char *mktemp(); int onintr(); char *savestr(); char *strcat(); char *strcpy(); off_t yankstr(); off_t mesgpt; char *strings = "strings"; int cflg; int vflg; int readstd; main(argc, argv) int argc; char *argv[]; { argc--, argv++; while (argc > 0 && argv[0][0] == '-') { register char *cp = &(*argv++)[1]; argc--; if (*cp == 0) { readstd++; continue; } do switch (*cp++) { case 'c': cflg++; continue; case 'v': vflg++; continue; default: fprintf(stderr, "usage: xstr [ -v ] [ -c ] [ - ] [ name ... ]\n"); } while (*cp); } if (signal(SIGINT, SIG_IGN) == SIG_DFL) signal(SIGINT, onintr); if (cflg || argc == 0 && !readstd) inithash(); else strings = mktemp(savestr("/tmp/xstrXXXXXX")); while (readstd || argc > 0) { if (freopen("x.c", "w", stdout) == NULL) perror("x.c"), exit(1); if (!readstd && freopen(argv[0], "r", stdin) == NULL) perror(argv[0]), exit(2); process("x.c"); if (readstd == 0) argc--, argv++; else readstd = 0; }; flushsh(); if (cflg == 0) xsdotc(); if (strings[0] == '/') ignore(unlink(strings)); exit(0); } process(name) char *name; { char *cp; char linebuf[BUFSIZ]; register int c; register int incomm = 0; printf("char\txstr[];\n"); for (;;) { if (fgets(linebuf, sizeof linebuf, stdin) == NULL) { if (ferror(stdin)) { perror(name); exit(3); } break; } if (linebuf[0] == '#') { if (linebuf[1] == ' ' && isdigit(linebuf[2])) printf("#line%s", &linebuf[1]); else printf("%s", linebuf); continue; } for (cp = linebuf; c = *cp++;) switch (c) { case '"': if (incomm) goto def; printf("(&xstr[%d])", (int) yankstr(&cp)); break; case '\'': if (incomm) goto def; putchar(c); if (*cp) putchar(*cp++); break; case '/': if (incomm || *cp != '*') goto def; incomm = 1; cp++; printf("/*"); continue; case '*': if (incomm && *cp == '/') { incomm = 0; cp++; printf("*/"); continue; } goto def; def: default: putchar(c); break; } } if (ferror(stdout)) perror("x.c"), onintr(); } off_t yankstr(cpp) register char **cpp; { register char *cp = *cpp; register int c, ch; char dbuf[BUFSIZ]; register char *dp = dbuf; register char *tp; while (c = *cp++) { switch (c) { case '"': cp++; goto out; case '\\': c = *cp++; if (c == 0) break; if (c == '\n') continue; for (tp = "b\bt\tr\rn\nf\f\\\\\"\""; ch = *tp++; tp++) if (c == ch) { c = *tp; goto gotc; } if (!octdigit(c)) { *dp++ = '\\'; break; } c -= '0'; if (!octdigit(*cp)) break; c <<= 3, c += *cp++ - '0'; if (!octdigit(*cp)) break; c <<= 3, c += *cp++ - '0'; break; } gotc: *dp++ = c; } out: *cpp = --cp; *dp = 0; return (hashit(dbuf, 1)); } octdigit(c) char c; { return (isdigit(c) && c != '8' && c != '9'); } inithash() { char buf[BUFSIZ]; register FILE *mesgread = fopen(strings, "r"); if (mesgread == NULL) return; for (;;) { mesgpt = tellpt; if (fgetNUL(buf, sizeof buf, mesgread) == NULL) break; ignore(hashit(buf, 0)); } ignore(fclose(mesgread)); } fgetNUL(obuf, rmdr, file) char *obuf; register int rmdr; FILE *file((; { register c; register char *buf = obuf; while (--rmdr > 0 && (c = xgetc(file)) != 0 && c != EOF) *buf++ = c; *buf++ = 0; return ((feof(file) || ferror(file)) ? NULL : 1); } xgetc(file) FILE *file; { tellpt++; return (getc(file)); } #define BUCKETS 128 struct hash { off_t hpt; char *hstr; struct hash *hnext; short hnew; } bucket[BUCKETS]; off_t hashit(str, new) char *str; int new; { int i; register struct hash *hp, *hp0; hp = hp0 = &bucket[lastchr(str) & 0177]; while (hp->hnext) { hp = hp->hnext; i = istail(str, hp->hstr); if (i >= 0) return (hp->hpt + i); } hp = (struct hash *) calloc(1, sizeof (*hp)); hp->hpt = mesgpt; hp->hstr = savestr(str); mesgpt += strlen(hp->hstr) + 1; hp->hnext = hp0->hnext; hp->hnew = new; hp0->hnext = hp; return (hp->hpt); } flushsh() { register int i; register struct hash *hp; register FILE *mesgwrit; register int old = 0, new = 0; for (i = 0; i < BUCKETS; i++) for (hp = bucket[i].hnext; hp != NULL; hp = hp->hnext) if (hp->hnew) new++; else old++; if (new == 0 && old != 0) return; mesgwrit = fopen(strings, old ? "r+" : "w"); for (i = 0; i < BUCKETS; i++) for (hp = bucket[i].hnext; hp != NULL; hp = hp->hnext) { found(hp->hnew, hp->hpt, hp->hstr); if (hp->hnew) { fseek(mesgwrit, hp->hpt, 0); ignore(fwrite(hp->hstr, strlen(hp->hstr) + 1, 1, mesgwrit)); if (ferror(mesgwrit)) perror(strings), exit(4); } } ignore(fclose(mesgwrit)); } found(new, off, str) int new; off_t off; char *str; { register char *cp; if (vflg == 0) return; if (!new) fprintf(stderr, "found at %d:", (int) off); else fprintf(stderr, "new at %d:", (int) off); prstr(str); fprintf(stderr, "\n"); } prstr(cp) register char *cp; { register int c; while (c = (*cp++ & 0377)) if (c < ' ') fprintf(stderr, "^%c", c + '`'); else if (c == 0177) fprintf(stderr, "^?"); else if (c > 0200) fprintf(stderr, "\\%03o", c); else fprintf(stderr, "%c", c); } xsdotc() { register FILE *strf = fopen(strings, "r"); register FILE *xdotcf; if (strf == NULL) perror(strings), exit(5); xdotcf = fopen("xs.c", "w"); if (xdotcf == NULL) perror("xs.c"), exit(6); fprintf(xdotcf, "char\txstr[] = {\n"); for (;;) { register int i, c; for (i = 0; i < 8; i++) { c = getc(strf); if (ferror(strf)) { perror(strings); onintr(); } if (feof(strf)) { fprintf(xdotcf, "\n"); goto out; } fprintf(xdotcf, "0x%02x,", c); } fprintf(xdotcf, "\n"); } out: fprintf(xdotcf, "};\n"); ignore(fclose(xdotcf)); ignore(fclose(strf)); } char * savestr(cp) register char *cp; { register char *dp = (char *) calloc(1, strlen(cp) + 1); return (strcpy(dp, cp)); } Ignore(a) char *a; { a = a; } ignorf(a) int (*a)(); { a = a; } lastchr(cp) register char *cp; { while (cp[0] && cp[1]) cp++; return (*cp); } istail(str, of) register char *str, *of; { register int d = strlen(of) - strlen(str); if (d < 0 || strcmp(&of[d], str) != 0) return (-1); return (d); } onintr() { ignorf(signal(SIGINT, SIG_IGN)); if (strings[0] == '/') ignore(unlink(strings)); ignore(unlink("x.c")); ignore(unlink("xs.c")); exit(7); } ) + 1); return (strcpy(dp, cp)); } Ignore(a) char *a; { a = a; } ignorf(a) int (*a)(); { a = a; } lastchr(cp) register char *cp; { while (cp[0] && cp[1]) cp++; return (*cp); } istail(str, of) register char *str, *of; { register int d = strlen(of) - strlen(str); if (d < 0 || strcmp(&of[d], str) != 0) return (-1); return (d); } onintr() { ignocmd/lpr/ 775 0 33 0 2552553160 5313 cmd/lpr/lpd.c 444 0 33 11135 2550326332 6335 static char *sccsid = "@(#)lpd.c 4.5 (Berkeley) 7/2/81"; /* * Line-printer daemon */ #include #include #include #include #include #include char line[128]; char banbuf[64]; char middle[64]; int linel; FILE *dfb; char dfname[50] = "/usr/spool/lpd/"; char *SPOOL_DIR = "/usr/spool/lpd/"; char *LOCK = "/usr/spool/lpd/lock"; int waittm = 60; struct dir dbuf; int onalrm(); main(argc, argv) { register char *p1, *p2; register int df; register FILE *dp; struct stat stb; char *file_name, *get_file(); umask(022); signal(SIGHUP, SIG_IGN); signal(SIGINT, SIG_IGN); signal(SIGQUIT, SIG_IGN); signal(SIGTERM, SIG_IGN); /* * Close all files, open root as 0, 1, 2 * to assure standard environment */ for (df=0; df<=15; df++) close(df); open("/", 0); dup(0); dup(0); if (stat(LOCK, &stb) >= 0) exit(0); if ((df=creat(LOCK, 0)) < 0) exit(0); close(df); if (fork()) exit(0); again: file_name = get_file(); strcpy(dfname, SPOOL_DIR); strcatn(dfname, file_name, DIRSIZ); if (trysend(dfname) == 0) goto again; sleep(waittm); goto again; } struct files { char file_name[DIRSIZ]; long time; struct files *next; } ; char *get_file() { FILE *fp; static struct files *top = NULL; struct files *ptr; extern char *calloc(); static char sp[DIRSIZ+1]; struct stat Stat; if ( top == NULL ) { top = (struct files *)calloc(1,sizeof (struct files)); ptr = top; top->next = top; if ( (fp = fopen(SPOOL_DIR,"r")) == NULL ) exit(1); while (fread(&dbuf, sizeof dbuf, 1, fp) == 1) { if (dbuf.d_ino==0 || dbuf.d_name[0]!='d' || dbuf.d_name[1]!='f') continue; ptr = ptr->next; stat(dbuf.d_name,&Stat); ptr->time = Stat.st_ctime; strcatn(ptr->file_name, dbuf.d_name, DIRSIZ); if ( ptr != top ) sort(top,ptr); ptr->next = (struct files *)calloc(1,sizeof (struct files)); } if ( ptr->next == top ) { feedpage(); unlink(LOCK); exit(0); } cfree(ptr->next); ptr->next = NULL; } sp[0] = '\0'; strcatn(sp, top->file_name, DIRSIZ); sp[DIRSIZ] = '\0'; ptr = top; top = top->next; cfree(ptr); return(sp); } sort(top,add) register struct files *top, *add; { register struct files *ptr; for ( ptr = top ; ptr != NULL ; ptr = ptr->next) { if (ptr->next == NULL || (ptr->next)->time > add->time) { add->next = ptr->next; ptr->next = add; return; } } } trysend(file) char *file; { register char *p1, *p2; register int i; extern int badexit(); dfb = fopen(file, "r"); if (dfb == NULL) return(0); banbuf[0] = 0; middle[0] = 0; while (getline()) switch (line[0]) { case 'L': p1 = line+1; p2 = banbuf; while (*p2++ = *p1++); continue; case 'B': p1 = line+1; p2 = middle; while ( *p2++ = *p1++) continue; continue; case 'F': if (send()) return(1); continue; case 'U': continue; case 'M': continue; } /* * Second pass. * Unlink files and send mail. */ fseek(dfb, 0L, 0); while (getline()) switch (line[0]) { default: continue; case 'U': unlink(&line[1]); continue; case 'M': sendmail(); continue; } fclose(dfb); unlink(file); } sendmail() { static int p[2]; register i; int stat; pipe(p); if (fork()==0) { alarm(0); if (p[0] != 0) { close(0); dup(p[0]); close(p[0]); } close(p[1]); for (i=3; i<=15; i++) close(i); execl("/bin/mail", "mail", &line[1], 0); exit(0); } write(p[1], "Your printer job is done\n", 25); close(p[0]); close(p[1]); wait(&stat); } getline() { register char *lp; register int c; lp = line; linel = 0; while ((c = getc(dfb)) != '\n') { if (c<0) return(0); if (c=='\t') { do { *lp++ = ' '; linel++; } while ((linel & 07) != 0); continue; } *lp++ = c; linel++; } *lp++ = 0; return(1); } int pid; send() { int p; if (pid = fork()) { if (pid == -1) return(1); setexit(); signal(SIGALRM, onalrm); alarm(30); wait(&p); alarm(0); return(p); } if (banbuf[0]) { if (middle[0]) execl("/usr/lib/lpf","lpf","-b",banbuf, "-m",middle,line+1,0); else execl("/usr/lib/lpf", "lpf", "-b", banbuf, line+1, 0); return(1); } execl("/usr/lib/lpf", "lpf", line, 0); return(1); } onalrm() { struct stat stb; signal(SIGALRM, onalrm); if (stat(dfname, &stb) < 0) kill(pid, SIGEMT); reset(); } struct sgttyb ttyb = { B1200, B1200, 0, 0, CRMOD|XTABS|ANYP }; FILE *out; feedpage() { register int i = 66; FILE *lp; int retry = 0; out = fopen("/dev/lp", "w"); if (out == NULL) return; stty(fileno(out), &ttyb); putc('\f', out); fclose(out); } #define ACK 06 #define NAK 025 #define STX 2 #define ETX 3 nothing() { ; } execl("/usr/lib/lpf", "lpf", line, 0); return(1); } onalrm() { struct stat stb; signal(SIGALRM, onalrm); if (stat(dfname, &stb) < 0) kill(pid, SIGEMT); reset(); } struct sgttyb ttyb = { B1200, B1200, 0, 0, CRMOD|XTABS|ANYP }; FILE *out; feedpage() { register int i = 66; FILE *lp; int retry = 0; out = fopen("/dev/lp", "w"); if (out == NULL) return; stty(fileno(out), &ttyb); putc('\f', out); cmd/lpr/lpf.c 444 0 33 12553 2552466230 6350 ((static char *sccsid = "@(#)lpf.c 4.5 (Berkeley) 81/06/10"; /* * lpf -- Line printer filter */ #include #include #include #define LINELN 132 #define EJLINE 66 #define SKPLINE 0 int anydone; char linebuf[LINELN+2]; int ov; char ovbuf[LINELN]; FILE *in = {stdin}; FILE *out; char *ban; int npages = 1; char chrtab[][16]; int lineno; struct sgttyb ttyb = { B1200,B1200, 0, 0, CRMOD|XTABS|ANYP, }; char obuf[BUFSIZ]; int onemt(); main(argc, argv) char **argv; { if ((out = fopen("/dev/lp", "w")) == NULL) { fprintf(stderr, "Can't open printer\n"); exit(1); } setbuf(out, obuf); stty(fileno(out), &ttyb); fprintf(stderr, "%d\n", fileno(out)); signal(SIGEMT, onemt); if (argc > 2 && argv[1][0]=='-' && argv[1][1]=='b' ) { argc -= 2; ban = argv[2]; argv += 2; if ( argc > 2 && argv[1][0] == '-' && argv[1][1] == 'm') { argc -= 2; banner(ban,argv[2]); argv += 2; } else banner(ban,"\0"); } if (argc<=1) { anydone |= send(); if (lineno > 0) feedpage(); } else while (argc>1) { if ((in = fopen(argv[1], "r")) == NULL) { fprintf(stderr, "Can't find %s\n", argv[1]); argv++; argc--; anydone |= 01; continue; } anydone |= send(); argc--; argv++; fclose(in); feedpage(); } fflush(out); stty(fileno(out), &ttyb); if (anydone==0) exit(1); if (ferror(out)) { fprintf(out, "Printer IO error\n"); exit(1); } fclose(out); if (ban && access("/usr/adm/lpacct", 02)>=0 && (out = fopen("/usr/adm/lpacct", "a"))!=NULL) { fprintf(out, "%4d %s\n", npages, ban); } return(0); } send() { register int nskipped; lineno = 0; nskipped = 0; while (getline()) { if (lineno==0 && linebuf[0]==0 && nskipped<=SKPLINE+3) { nskipped++; continue; } if (lineno >= EJLINE) { nskipped = 0; putline(1); lineno = 0; } else { if (lineno == 0) while (lineno++ < SKPLINE) putline(-1); putline(0); lineno++; } } if (lineno>0) npages++; return(1); } getline() { register int col, maxcol, c; ov = 0; for (col=0; col=' ') { if (col < LINELN) { if (linebuf[col]=='_') { ov++; ovbuf[col] = '_'; } linebuf[col++] = c; if (col > maxcol) maxcol = col; } } continue; case '\f': lineno = EJLINE; continue; case ' ': col++; continue; case '\t': col = (col|07) + 1; if (col>maxcol) maxcol = col; continue; case '\r': col = 0; continue; case '_': if (col>=LINELN) { col++; continue; } if (linebuf[col]!=' ') { ovbuf[col] = '_'; ov++; } else linebuf[col] = c; col++; if (col>maxcol) maxcol = col; continue; case '\n': if (maxcol>=LINELN) maxcol = LINELN; linebuf[maxcol] = 0; return(1); case '\b': if (col>0) col--; continue; } } putline(ff) { register char *lp, *ep; register int c; extern errno; int i, j; errno = 0; /* if (ov) do { for (ep= &ovbuf[LINELN-1]; *ep == 0; ep--) continue; for (lp=ovbuf; lp <= ep; lp++) output(*lp ? *lp : ' ', out); }; */ again: if (ff >= 0) { lp = linebuf; while (c = *lp++) output(c,out); } if (ff > 0) { putc('\014', out); putc('\r', out); npages++; } else putc('\n', out); if (ferror(out)) { printf("Printer IO error\n"); exit(1); } } banner(real,m) char *real, *m; { long timeb; register char *sp; register char *s; int i, j, t; putc ('\n', out); s = real; /* 6 -> 5 */ fprintf(out,"%s\t%s\t%s\t\t\t%s\t%s\t%s\t\t\t%s\t%s\t%s\n",s,s,s,s,s,s,s,s,s); fprintf(out,"%s\t%s\t%s\t\t\t%s\t%s\t%s\t\t\t%s\t%s\t%s\n",s,s,s,s,s,s,s,s,s); fprintf(out,"%s\t%s\t%s\t\t\t%s\t%s\t%s\t\t\t%s\t%s\t%s\n",s,s,s,s,s,s,s,s,s); fprintf(out,"%s\t%s\t%s\t\t\t%s\t%s\t%s\t\t\t%s\t%s\t%s\n",s,s,s,s,s,s,s,s,s); fprintf(out,"%s\t%s\t%s\t\t\t%s\t%s\t%s\t\t\t%s\t%s\t%s\n",s,s,s,s,s,s,s,s,s); fprintf(out,"%s\t%s\t%s\t\t\t%s\t%s\t%s\t\t\t%s\t%s\t%s\n",s,s,s,s,s,s,s,s,s); for (i = 0; i < 10; i++) putc ('\n', out); for (i=0; i<16; i++) { fprintf(out, " "); for (sp = ((*m != '\0')? m:real); *sp; sp++) { /* { */ if (*sp<=' '|| *sp >'}') continue; fprintf(out, " "); t = chrtab[*sp - ' '][i]; for (j=7; j>=0; j--) if ((t>>j) & 01) putc('X', out); else putc(' ', out); } putc('\n', out); } for (i = 0; i < 8; i++) putc ('\n', out); fprintf(out, " "); fprintf(out, (time(&timeb), ctime(&timeb))); fprintf(out, "\n"); for ( i = 0 ; i < 10 ; i++) putc('\n',out); fprintf(out,"%s\t%s\t%s\t\t\t%s\t%s\t%s\t\t\t%s\t%s\t%s\n",s,s,s,s,s,s,s,s,s); fprintf(out,"%s\t%s\t%s\t\t\t%s\t%s\t%s\t\t\t%s\t%s\t%s\n",s,s,s,s,s,s,s,s,s); fprintf(out,"%s\t%s\t%s\t\t\t%s\t%s\t%s\t\t\t%s\t%s\t%s\n",s,s,s,s,s,s,s,s,s); fprintf(out,"%s\t%s\t%s\t\t\t%s\t%s\t%s\t\t\t%s\t%s\t%s\n",s,s,s,s,s,s,s,s,s); fprintf(out,"%s\t%s\t%s\t\t\t%s\t%s\t%s\t\t\t%s\t%s\t%s\n",s,s,s,s,s,s,s,s,s); fprintf(out, "\014"); /*????? */ } onemt() { feedpage(); exit(0); } feedpage() { int retry = 0; fprintf(out, "\014"); } output(c,fp) register char c; register FILE *fp; { if (c == -1) return; c &= 0177; if (c == 0177) putc('^',fp), c = '?'; if (c == 033) c = '$'; if (c < ' ') switch (c) { case '\n': break; case '\f': case '\b': case '\t': case '\r': break; default: putc('^',fp); c |= 0100; } putc(c,fp); } s\t%s\t\t\t%s\t%s\t%s\t\t\t%s\t%s\t%s\n",s,s,s,s,s,s,s,s,s); fprintf(out, "\014"); /*????? */ } onemt() { feedpage(); exit(0); } feedpage() { cmd/lpr/lpq.c 444 0 33 3177 2520535671 6346 static char *sccsid = "@(#)lpq.c 4.4 (Berkeley) 81/04/21"; /* * Line printer queue */ #include #include #include #include #define MAXJOBS 100 struct dir dirent; struct stat stbuf; char lpddir[] = "/usr/spool/lpd"; int nextflag; int linecnt; FILE *df; FILE *jf; char line[100]; char username[10]; int cnt; int isdown; main() { if (access("/usr/bin/lpr", 1) && access("/bin/lpr", 1) && access("/usr/ucb/lpr", 1)) isdown++; if (chdir(lpddir) < 0) { perror(lpddir); exit(1); } oloop: df = fopen(".", "r"); if (df == NULL) { perror(lpddir); exit(1); } loop: fseek(df, 0l, 0); linecnt = 0; cnt = 0; while (fread(&dirent, sizeof dirent, 1, df) == 1) { if (dirent.d_ino == 0) continue; if (dirent.d_name[0] != 'd') continue; if (dirent.d_name[1] != 'f') continue; if (stat(dirent.d_name, &stbuf) < 0) continue; if (cnt == 0) printf("Owner\t Id Chars Filename\n"); cnt++; process(); } if (cnt == 0) { if (isdown) printf("Line printer is down.\n"); else printf("Line printer queue is empty.\n"); } exit(0); } process() { jf = fopen(dirent.d_name, "r"); if (jf == NULL) return; while (getline()) { switch (line[0]) { case 'L': strcpy(username, line+1); break; case 'B': case 'F': if (stat(line+1, &stbuf) < 0) stbuf.st_size = 0; printf("%-10s%5s%8d %s\n", username, dirent.d_name+3, stbuf.st_size, line+1); break; } } fclose(jf); } getline() { register int i, c; i = 0; while ((c = getc(jf)) != '\n') { if (c <= 0) return(0); if (i < 100) line[i++] = c; } line[i++] = 0; return (1); } ent.d_name, "r"); if (jf == NULL) return; while (getline()) { switch (line[0]) { case 'L': strcpy(username, line+1); break; case 'B': case 'F': if (stat(line+1, &stbuf) < 0) stbuf.st_size = 0; printf("%-10s%5s%8d %s\n", username, dirent.d_name+3, stbuf.st_size, line+1); break; } } fclose(jf); } getline() { register int i, c; i = 0; wcmd/lpr/lpr.c 444 0 33 10365 2552466234 6367 static char *sccsid = "@(#)lpr.c 4.4 (Berkeley) 81/05/21"; #include #include #define BUFSIZ BSIZE /* * lpr -- on-line printer spooler */ char tfname[] = "/usr/spool/lpd/tfaXXXXX"; char cfname[] = "/usr/spool/lpd/cfaXXXXX"; char lfname[] = "/usr/spool/lpd/lfaXXXXX"; char dfname[] = "/usr/spool/lpd/dfaXXXXX"; int nact; int tff; int mailflg; char person[10]; int inchar; int maxrec = 400; char *prnt_ban; main(argc, argv) int argc; char *argv[]; { register char *arg, *remote; int c, f, flag; int out(); pidfn(); if (signal(SIGINT, SIG_IGN) == SIG_DFL) signal(SIGINT, out); if (signal(SIGQUIT, SIG_IGN) == SIG_DFL) signal(SIGQUIT, out); if (signal(SIGHUP, SIG_IGN) == SIG_DFL) signal(SIGHUP, out); if (signal(SIGTERM, SIG_IGN) == SIG_DFL) signal(SIGTERM, out); remote = "$ remote **,onl"; flag = 0; tff = nfile(tfname); while (argc>1 && (arg = argv[1])[0]=='-') { if (arg[1] && arg[2]) { remote[12] = arg[1]; remote[13] = arg[2]; remote[14] = 0; } else switch (arg[1]) { case '-': remote[12] = 'r'; remote[13] = '1'; remote[14] = '\0'; break; case 'b': prnt_ban = &argv[2][0]; argv++; argc--; break; case 'c': flag = '+'; break; case 'r': flag = '-'; break; case 'm': mailflg = 1; break; } argc--; argv++; } ident(); if(argc == 1) copy(0); while(--argc) { arg = *++argv; if(flag == '+') goto cf; /* * This may not work because the daemon runs as someone else, so don't bother if(*arg == '/' && fl((ag != '-') { card('F', arg); nact++; continue; } */ if(link(arg, lfname) < 0) goto cf; card('F', lfname); card('U', lfname); lfname[inchar]++; nact++; goto df; cf: f = open(arg, 0); if(f < 0) { printf("Cannot open %s\n", arg); continue; } copy(f); close(f); df: if(flag == '-') { f = unlink(arg); if(f < 0) printf("Cannot remove %s\n", arg); } } if(nact) { tfname[inchar]--; f = link(tfname, dfname); if(f < 0) { printf("Cannot rename %s\n", dfname); tfname[inchar]++; out(); } unlink(tfname); execl("/usr/lib/lpd", "lpd", 0); dfname[inchar]++; printf("Daemon doesn't exist\n"); exit(0); } out(); } copy(f) int f; { int ff, i, j, nr, nc; static char buf[BUFSIZ]; card('F', cfname); card('U', cfname); ff = nfile(cfname); nc = 0; nr = 0; while((i = read(f, buf, BUFSIZ)) > 0) { /* Avoid premature trunction of files */ for (j=0; j= BUFSIZ) { nc -= BUFSIZ; nr++; if(nr > maxrec) { printf("Copy file is too large\n"); break; } } } close(ff); nact++; } card(c, s) int c; char s[]; { char *p1, *p2; static char buf[BUFSIZ]; int col; p1 = buf; p2 = s; col = 0; *p1++ = c; while((c = *p2++) != '\0') { *p1++ = c; col++; } *p1++ = '\n'; write(tff, buf, col+2); } ident() { int c, n; register char *b1p, *pp, *b2p; static char b1[100], b2[100]; b1p = b1; if(getpw(getuid(), b1p)) { b1p = "pdp::::m0000,m000:"; } n = 0; b2p = b2; while(*b2p++ = "$ ident "[n++]); b2p--; n = 5; while(--n) while(*b1p++ != ':'); while((*b2p++ = *b1p++) != ':'); b2p[-1] = ','; b1p = b1; pp = person; while((c = *b1p++) != ':') { *b2p++ = c; *pp++ = c; } *b2p++ = 0; *pp++ = 0; card('L', person); if (prnt_ban != 0 ) card('B',prnt_ban); if (mailflg) card('M', person); } pidfn() { register i, j, c; int s; int p; s = p = getpid(); p &= 077777; i = 0; while(tfname[i] != 'X') i++; i += 4; for(j=0; j<5; j++) { c = (p%10) + '0'; if(s<0 && j==4) c += 4; p /= 10; tfname[i] = c; cfname[i] = c; lfname[i] = c; dfname[i] = c; i--; } inchar = i; } nfile(name) char *name; { register f; f = creat(name, 0644); if(f < 0) { printf("Cannot create %s\n", name); out(); } name[inchar]++; return(f); } out() { register i; signal(SIGINT, SIG_IGN); signal(SIGQUIT, SIG_IGN); signal(SIGHUP, SIG_IGN); signal(SIGTERM, SIG_IGN); i = inchar; while(tfname[i] != 'a') { tfname[i]--; unlink(tfname); } while(cfname[i] != 'a') { cfname[i]--; unlink(cfname); } while(lfname[i] != 'a') { lfname[i]--; unlink(lfname); } while(dfname[i] != 'a') { dfname[i]--; unlink(dfname); } exit(0); } ame, 0644); if(f < 0) { printf("Cannot create %s\n", name); out(); } name[inchar]++; return(f); } out() { register i; signal(SIGINT, SIG_IGN); signal(SIGQUIT, SIG_IGN); signal(SIGHUP, SIG_IGN); signal(SIGTERM, SIG_IGN); i = inchar; while(tfname[i] !=cmd/lpr/lprm.c 444 0 33 4234 2520535714 6515 static char *sccsid = "@(#)lprm.c 4.3 (Berkeley) 81/04/21"; #include #include #include #include char line[128]; int linel; int all; char lpddir[] = "/usr/spool/lpd"; FILE *df; FILE *dfb; main(argc, argv) int argc; char *argv[]; { register int i; register char *ap, *cp; int cnt; if (chdir(lpddir) < 0) perror(lpddir), exit(1); df = fopen(".", "r"); if (df == NULL) perror(lpddir), exit(1); argc--, argv++; if (argc == 0) { printf("usage: lprm [ id ... ] [ filename ... ] [ user ... ]\n"); exit(1); } do { if (strcmp(*argv, "-a") == 0) all++; clobber(*argv++); } while (--argc); } clobber(cp) char *cp; { struct dir dirent; int did = 0; rewind(df); while (fread(&dirent, sizeof dirent, 1, df) == 1) { if (dirent.d_ino == 0) continue; if (dirent.d_name[0] != 'd' || dirent.d_name[1] != 'f') continue; if (dirent.d_name[7] == 0 || dirent.d_name[8] != 0) continue; if (chkclob(cp, dirent.d_name)) { did++; printf("removing %s\n", dirent.d_name+3); drop(dirent.d_name); dirent.d_name[0] = 'c'; drop(dirent.d_name); dirent.d_name[0] = 'l'; drop(dirent.d_name); dirent.d_name[0] = 't'; drop(dirent.d_name); dirent.d_name[0] = 'd'; } } if (did == 0) fprintf(stderr, "%s: nothing to remove\n", cp); } chkclob(pattern, file) char *pattern, *file; { register char *id = pattern; /* * Quick check for matching id */ if (any(id[0], "cd") && id[1] == 'f' && id[2] == 'a') id += 3; if (strcmp(file+3, id) == 0) return (1); /* * Now check for matching filename 'B', 'F' or id 'L' */ dfb = fopen(file, "r"); if (dfb == NULL) return (0); while (getline()) switch (line[0]) { case 'L': case 'B': case 'F': if (strcmp(line+1, pattern) == 0) { fclose(dfb); return (1); } continue; } fclose(dfb); return (0); } drop(file) char *file; { close(creat(file, 0666)); unlink(file); } any(c, cp) char c; register char *cp; { while (*cp) if (c == *cp++) return (1); return (0); } getline() { register int i, c; i = 0; while ((c = getc(dfb)) != '\n') { if (c <= 0) return(0); if (i < 100) line[i++] = c; } line[i++] = 0; return (1); } (line[0]) { case 'L': case 'B': case 'F': if (strcmp(line+1, pattern) == 0) { fclose(dfb); return (1); } continue; } fclose(dfb); return (0); } drop(file) char *file; { close(creat(file, 0666)); unlink(file); } any(c, cp) char c; register char *cp; { while (*cp) if (c == *cp++) return (1); return (0); } getline() { recmd/lpr/makefile 755 0 33 661 2477640547 7100 all: lpd lpf lpr lpq lprm lpd: lpd.c cc -O lpd.c -o lpd lpf: lpf.c cc -O lpf.c -o lpf lpq: lpq.c cc -O lpq.c -o lpq lpr: lpr.c cc -O lpr.c -o lpr lprm: lprm.c cc -O lprm.c -o lprm install: install -s lpd ${DESTDIR}/usr/lib/lpd install -s lpf ${DESTDIR}/usr/lib/lpf install -s lpq ${DESTDIR}/usr/ucb/lpq install -s lpr ${DESTDIR}/usr/ucb/lpr install -s lprm ${DESTDIR}/usr/ucb/lprm clean: rm -f lpd lpf lpq lpr lprm ,5< /,"cmd/ls/ 775 0 33 0 2552553356 5143 cmd/ls/ls.c 644 0 33 16103 2111463406 6014 /* * list file or directory */ #include #include #include #include #define NFILES 1024 FILE *pwdf, *dirf; char stdbuf[BUFSIZ]; struct lbuf { union { char lname[15]; char *namep; } ln; char ltype; short lnum; short lflags; short lnl; short luid; short lgid; long lsize; long lmtime; }; int aflg, dflg, lflg, sflg, tflg, uflg, iflg, fflg, gflg, cflg; int rflg = 1; long year; int flags; int lastuid = -1; char tbuf[16]; long tblocks; int statreq; struct lbuf *flist[NFILES]; struct lbuf **lastp = flist; struct lbuf **firstp = flist; char *dotp = "."; char *makename(); struct lbuf *gstat(); char *ctime(); long nblock(); #define ISARG 0100000 main(argc, argv) char *argv[]; { int i; register struct lbuf *ep, **ep1; register struct lbuf **slastp; struct lbuf **epp; struct lbuf lb; char *t; int compar(); setbuf(stdout, stdbuf); time(&lb.lmtime); year = lb.lmtime - 6L*30L*24L*60L*60L; /* 6 months ago */ if (--argc > 0 && *argv[1] == '-') { argv++; while (*++*argv) switch (**argv) { case 'a': aflg++; continue; case 's': sflg++; statreq++; continue; case 'd': dflg++; continue; case 'g': gflg++; continue; case 'l': lflg++; statreq++; continue; case 'r': rflg = -1; continue; case 't': tflg++; statreq++; continue; case 'u': uflg++; continue; case 'c': cflg++; continue; case 'i': iflg++; continue; case 'f': fflg++; continue; default: continue; } argc--; } if (fflg) { aflg++; lflg = 0; sflg = 0; tflg = 0; statreq = 0; } if(lflg) { t = "/etc/passwd"; if(gflg) t = "/etc/group"; pwdf = fopen(t, "r"); } if (argc==0) { argc++; argv = &dotp - 1; } for (i=0; i < argc; i++) { if ((ep = gstat(*++argv, 1))==NULL) continue; ep->ln.namep = *argv; ep->lflags |= ISARG; } qsort(firstp, lastp - firstp, sizeof *lastp, compar); slastp = lastp; for (epp=firstp; eppl((type=='d' && dflg==0 || fflg) { if (argc>1) printf("\n%s:\n", ep->ln.namep); lastp = slastp; readdir(ep->ln.namep); if (fflg==0) qsort(slastp,lastp - slastp,sizeof *lastp,compar); if (lflg || sflg) printf("total %D\n", tblocks); for (ep1=slastp; ep1lnum == -1) return; if (iflg) printf("%5d ", p->lnum); if (sflg) printf("%4D ", nblock(p->lsize)); if (lflg) { putchar(p->ltype); pmode(p->lflags); printf("%2d ", p->lnl); t = p->luid; if(gflg) t = p->lgid; if (getname(t, tbuf)==0) printf("%-6.6s", tbuf); else printf("%-6d", t); if (p->ltype=='b' || p->ltype=='c') printf("%3d,%3d", major((int)p->lsize), minor((int)p->lsize)); else printf("%7ld", p->lsize); cp = ctime(&p->lmtime); if(p->lmtime < year) printf(" %-7.7s %-4.4s ", cp+4, cp+20); else printf(" %-12.12s ", cp+4); } if (p->lflags&ISARG) printf("%s\n", p->ln.namep); else printf("%.14s\n", p->ln.lname); } getname(uid, buf) int uid; char buf[]; { int j, c, n, i; if (uid==lastuid) return(0); if(pwdf == NULL) return(-1); rewind(pwdf); lastuid = -1; do { i = 0; j = 0; n = 0; while((c=fgetc(pwdf)) != '\n') { if (c==EOF) return(-1); if (c==':') { j++; c = '0'; } if (j==0) buf[i++] = c; if (j==2) n = n*10 + c - '0'; } } while (n != uid); buf[i++] = '\0'; lastuid = uid; return(0); } long nblock(size) long size; { return((size+511)>>9); } int m1[] = { 1, S_IREAD>>0, 'r', '-' }; int m2[] = { 1, S_IWRITE>>0, 'w', '-' }; int m3[] = { 2, S_ISUID, 's', S_IEXEC>>0, 'x', '-' }; int m4[] = { 1, S_IREAD>>3, 'r', '-' }; int m5[] = { 1, S_IWRITE>>3, 'w', '-' }; int m6[] = { 2, S_ISGID, 's', S_IEXEC>>3, 'x', '-' }; int m7[] = { 1, S_IREAD>>6, 'r', '-' }; int m8[] = { 1, S_IWRITE>>6, 'w', '-' }; int m9[] = { 2, S_ISVTX, 't', S_IEXEC>>6, 'x', '-' }; int *m[] = { m1, m2, m3, m4, m5, m6, m7, m8, m9}; pmode(aflag) { register int **mp; flags = aflag; for (mp = &m[0]; mp < &m[sizeof(m)/sizeof(m[0])];) select(*mp++); } select(pairp) register int *pairp; { register int n; n = *pairp++; while (--n>=0 && (flags&*pairp++)==0) pairp++; putchar(*pairp); } char * makename(dir, file) char *dir, *file; { static char dfile[100]; register char *dp, *fp; register int i; dp = dfile; fp = dir; while (*fp) *dp++ = *fp++; *dp++ = '/'; fp = file; for (i=0; ilnum != -1) ep->lnum = dentry.d_ino; for (j=0; jln.lname[j] = dentry.d_name[j]; } fclose(dirf); } struct lbuf * gstat(file, argfl) char *file; { struct stat statb; register struct lbuf *rep; static int nomocore; if (nomocore) return(NULL); rep = (struct lbuf *)malloc(sizeof(struct lbuf)); if (rep==NULL) { fprintf(stderr, "ls: out of memory\n"); nomocore = 1; return(NULL); } if (lastp >= &flist[NFILES]) { static int msg; lastp--; if (msg==0) { fprintf(stderr, "ls: too many files\n"); msg++; } } *lastp++ = rep; rep->lflags = 0; rep->lnum = 0; rep->ltype = '-'; if (argfl || statreq) { if (stat(file, &statb)<0) { printf("%s not found\n", file); statb.st_ino = -1; statb.st_size = 0; statb.st_mode = 0; if (argfl) { lastp--; return(0); } } rep->lnum = statb.st_ino; rep->lsize = statb.st_size; switch(statb.st_mode&S_IFMT) { case S_IFDIR: rep->ltype = 'd'; break; case S_IFBLK: rep->ltype = 'b'; rep->lsize = statb.st_rdev; break; case S_IFCHR: rep->ltype = 'c'; rep->lsize = statb.st_rdev; break; } rep->lflags = statb.st_mode & ~S_IFMT; rep->luid = statb.st_uid; rep->lgid = statb.st_gid; rep->lnl = statb.st_nlink; if(uflg) rep->lmtime = statb.st_atime; else if (cflg) rep->lmtime = statb.st_ctime; else rep->lmtime = statb.st_mtime; tblocks += nblock(statb.st_size); } return(rep); } compar(pp1, pp2) struct lbuf **pp1, **pp2; { register struct lbuf *p1, *p2; p1 = *pp1; p2 = *pp2; if (dflg==0) { if (p1->lflags&ISARG && p1->ltype=='d') { if (!(p2->lflags&ISARG && p2->ltype=='d')) return(1); } else { if (p2->lflags&ISARG && p2->ltype=='d') return(-1); } } if (tflg) { if(p2->lmtime == p1->lmtime) return(0); if(p2->lmtime > p1->lmtime) return(rflg); return(-rflg); } return(rflg * strcmp(p1->lflags&ISARG? p1->ln.namep: p1->ln.lname, p2->lflags&ISARG? p2->ln.namep: p2->ln.lname)); } **pp2; { register struct lbuf *p1, *p2; p1 = *pp1; p2 = *pp2; if (dflg==0) { if (p1->lflags&ISARG && p1->ltype=='d') { if (!(p2->lflags&ISARG && p2->ltype=='d')) return(1); } else { if (p2->lflags&ISARG && p2->ltype=='d') return(-1); } } if (tflg) { if(p2->lmtime == p1->lmtime) return(0); if(p2->lmtime > p1->lmtime) return(rflg); return(-rflg); } return(rflg * strcmp(p1->lflags&ISARG? p1->ln.namep: pcmd/ls/ucbls.c 444 0 33 61602 2450764675 6532 #define UCB /* Controls output format for -F */ /* #define UCB_PWHASH /* If have hashed password file */ /* * ls - list file or directory * * Modified by Bill Joy UCB May/August 1977 * Modified by Dave Presotto BTL Feb/80 * Modified by Bill Joy and Mark Horton Summer 1980 * * this version of ls is designed for graphic terminals and to * list directories with lots of files in them compactly. * It supports three variants for listings: * * 1) Columnar output. * 2) Stream output. * 3) Old one per line format. * * Columnar output is the default. * If, however, the standard output is not a teletype, the default * is one-per-line. * * With columnar output, the items are sorted down the columns. * We use columns only for a directory we are interpreting. * Thus, in particular, we do not use columns for * * ls /usr/bin/p* * * This version of ls also prints non-printing characters as '?' if * the standard output is a teletype. * * Flags relating to these and other new features are: * * -m force stream output. * * -1 force one entry per line, e.g. to a teletype * * -q force non-printings to be '?'s, e.g. to a file * * -C force columnar output, e.g. into a file * * -n like -l, but user/group id's in decimal rather than * looking in /etc/passwd to save time * * -F turns on the "flagging" of executables and directories * * -R causes ls to recurse through the branches of the subtree * ala find */ #include #include #include #include #include #include #include #include struct utmp utmp; #define NMAX (sizeof utmp.ut_name) #define MAXFILEWIDTH 14 #define NFILES 1024 FILE *pwdf, *dirf; struct lbuf { union { char lname[15]; char *namep; } ln; char ltype; ino_t lnum; short lflags; short lnl; short luid; short lgid; long lsize; long lmtime; }; struct dchain { char *dc_name; /* the path name */ struct dchain *dc_next; /* the next directory on the chain */ }; struct dchain *dfirst; /* the start of the directory chain */ struct dchain *cdfirst; /* the start of the current directory chain */ struct dchain *dtemp; /* temporary used when linking */ char *curdir; /* the current directory */ int aflg, bflg, dflg, lflg, sflg, tflg, uflg, iflg, fflg, gflg, cflg; int Aflg, nflg, qflg, Fflg, Rflg, across, Cflg; int nopad; int tabflg; int rflg = 1; long year; int flags; long tblocks; int statreq; int xtraent; /* for those switches which print out a total */ struct lbuf *flist[NFILES]; struct lbuf **lastp = flist; struct lbuf **firstp = flist; char *dotp = "."; char *makename(); struct lbuf *gstat(); char *ctime(); long nblock(); char *getname(); #define ISARG 0100000 int colwidth; int filewidth; int fixedwidth; int outcol; char obuf[BUFSIZ]; main(argc, argv) int argc; char *argv[]; { #include int i, width; register struct lbuf *ep; register struct lbuf **slastp; struct lbuf **epp; struct lbuf lb; char *t; char *cp; int compar(); struct sgttyb sgbuf; Fflg = 0; tabflg = 0; Aflg = getuid() == 0; setbuf(stdout, obuf); lb.lmtime = time((long *) 0); year = lb.lmtime - 6L*30L*24L*60L*60L; /* 6 months ago */ qflg = gtty(1, &sgbuf) == 0; /* guarantee at least on column width */ fixedwidth = 2; /* * If the standard output is not a teletype, * then we default to one-per-line format * otherwise decide between stream and * columnar based on our name. */ if (qflg) { Cflg = 1; if ((sgbuf.sg_flags & XTABS) == 0) tabflg++; for (cp = argv[0]; cp[0] && cp[1]; cp++) continue; /* * Certain kinds of links (l, ll, lr, lf, lx) cause some * various options to be turned on. */ switch (cp[0]) { case 'l': if (cp[-1] == 'l') { /* ll => -l */ lflg = 1; statreq++; xtraent++; } else { /* l => -m */ nopad = 1; Cflg = 0; } break; case 'x': /* lx => -x */ across = 1; break; case 'f': /* lf => -F */ Fflg = 1; break; case 'r': /* lr => -R */ Rflg = 1; break; } } else { tabflg++; } while (((--argc > 0 && *argv[1] == '-') { argv++; while (*++*argv) switch (**argv) { /* * C - force columnar output */ case 'C': Cflg = 1; nopad = 0; continue; /* * m - force stream output */ case 'm': Cflg = 0; nopad = 1; continue; /* * x - force sort across */ case 'x': across = 1; nopad = 0; Cflg = 1; continue; /* * q - force ?'s in output */ case 'q': qflg = 1; bflg = 0; continue; /* * b - force octal value in output */ case 'b': bflg = 1; qflg = 0; continue; /* * 1 - force 1/line in output */ case '1': Cflg = 0; nopad = 0; continue; /* STANDARD FLAGS */ case 'a': aflg++; continue; case 'A': Aflg = !Aflg; continue; case 'c': cflg++; continue; case 's': fixedwidth += 5; sflg++; statreq++; xtraent++; continue; case 'd': dflg++; continue; /* * n - don't look in password file */ case 'n': nflg++; case 'l': lflg++; statreq++; xtraent++; continue; case 'r': rflg = -1; continue; case 't': tflg++; statreq++; continue; case 'u': uflg++; continue; case 'i': fixedwidth += 6; iflg++; continue; case 'f': fflg++; continue; case 'g': gflg++; continue; case 'F': Fflg++; continue; case 'R': Rflg++; continue; default: fprintf (stderr, "usage: ls [-1ACFRabcdfgilmnqrstux] [files]\n"); exit(1); } } if (Fflg) #ifdef UCB fixedwidth++; #else fixedwidth += 2; #endif if (fflg) { aflg++; lflg = 0; sflg = 0; tflg = 0; statreq = 0; xtraent = 0; } if(lflg) { Cflg = 0; t = "/etc/passwd"; if (gflg) t = "/etc/group"; nopad = 0; fixedwidth = 70; pwdf = fopen(t, "r"); } if (argc==0) { argc++; argv = &dotp - 1; } for (i=0; i < argc; i++) { argv++; if (Cflg) { width = strlen (*argv); if (width > filewidth) filewidth = width; } if ((ep = gstat(*argv, 1))==NULL) continue; ep->ln.namep = *argv; ep->lflags |= ISARG; } if (!Cflg) filewidth = MAXFILEWIDTH; else colwidth = fixedwidth + filewidth; qsort(firstp, lastp - firstp, sizeof *lastp, compar); slastp = lastp; /* For each argument user typed */ for (epp=firstp; eppltype=='d' && dflg==0 || fflg) pdirectory(ep->ln.namep, (argc>1), slastp); else pentry(ep); /* -R: print subdirectories found */ while (dfirst || cdfirst) { /* Place direct subdirs on front in right order */ while (cdfirst) { /* reverse cdfirst onto front of dfirst */ dtemp = cdfirst; cdfirst = cdfirst -> dc_next; dtemp -> dc_next = dfirst; dfirst = dtemp; } /* take off first dir on dfirst & print it */ dtemp = dfirst; dfirst = dfirst->dc_next; pdirectory (dtemp->dc_name, 1, firstp); cfree (dtemp->dc_name); cfree (dtemp); } } if (outcol) putc('\n', stdout); fflush(stdout); } /* * pdirectory: print the directory name, labelling it if title is * nonzero, using lp as the place to start reading in the dir. */ pdirectory (name, title, lp) char *name; int title; struct lbuf **lp; { register struct dchain *dp; register struct lbuf *ap; register char *pname; struct lbuf **app; filewidth = 0; curdir = name; if (title) printf("\n%s:\n", name); lastp = lp; readdir(name); if (!Cflg) filewidth = MAXFILEWIDTH; colwidth = fixedwidth + filewidth; #ifdef notdef /* Taken out because it appears this is done below in pem. */ if (tabflg) { if (colwidth <= 8) colwidth = 8; else if (colwidth <= 16) colwidth = 16; } #endif if (fflg==0) qsort(lp,lastp - lp,sizeof *lastp,compar); if (Rflg) for (app=lastp-1; app>=lp; app--) { ap = *app; if (ap->ltype == 'd' && strcmp(ap->ln.lname, ".") && strcmp(ap->ln.lname, "..")) { dp = (struct dchain *) calloc(1, sizeof(struct dchain)); pname = makename (curdir, ap->ln.lname); dp->dc_name = (char *) calloc(1, strlen(pname)+1); strcpy(dp->dc_name, pname); dp -> dc_next = dfirst; dfirst = dp; } } if (lflg || sflg) printf("total %D", tblocks); pem(lp, lastp); newline(); } /* * pem: print 'em. Print a list of files (e.g. a directory) bounded * by slp and lp. */ pem(slp, lp) register struct lbuf **slp, **lp; { int ncols, nrows, row, col; register struct lbuf **ep; if (tabflg) { if (colwidth <= 9) colwidth = 8; else if (colwidth <= 17) colwidth = 16; } ncols = 80 / colwidth; if (ncols == 1 || Cflg == 0) { for (ep = slp; ep < lp; ep++) pentry(*ep); return; } if (across) { for (ep = slp; ep < lp; ep++) pentry(*ep); return; } if (xtraent) slp--; nrows = (lp - slp - 1) / ncols + 1; for (row = 0; row < nrows; row++) { col = row == 0 && xtraent; for (; col < ncols; col++) { ep = slp + (nrows * col) + row; if (ep < lp) pentry(*ep); } if (outcol) printf("\n"); } } /* * pputchar: like putchar but knows how to handle control chars. * CAUTION: if you make ctrl chars print in ^x notation, or any * other notation which is wider than one character, the column * nature of things (such as files with 14 letter names) will be * messed up. Weigh this carefully! */ pputchar(c) char c; { char cc; switch (c) { case '\t': outcol = (outcol + 8) &~ 7; break; case '\n': outcol = 0; break; default: if (c < ' ' || c >= 0177) { if (qflg) c = '?'; else if (bflg) { outcol += 3; putc ('\\', stdout); cc = '0' + (c>>6 & 07); putc (cc, stdout); cc = '0' + (c>>3 & 07); putc (cc, stdout); c = '0' + (c & 07); } } outcol++; break; } putc(c, stdout); } newline() { if (outcol) putc('\n', stdout); outcol = 0; } /* * column: get to the beginning of the next column. */ column() { if (outcol == 0) return; if (nopad) { putc(',', stdout); outcol++; if (outcol + colwidth + 2 > 80) { putc('\n', stdout); outcol = 0; return; } putc(' ', stdout); outcol++; return; } if (Cflg == 0) { putc('\n', stdout); return; } if ((outcol / colwidth + 2) * colwidth > 80) { putc('\n', stdout); outcol = 0; return; } if (tabflg && (colwidth <= 16)) { if (colwidth > 8) if ((outcol % 16) < 8) { outcol += 8 - (outcol % 8); putc ('\t', stdout); } outcol += 8 - (outcol % 8); putc ('\t', stdout); return; } do { outcol++; putc(' ', stdout); } while (outcol % colwidth); } /* * nblock: the number of 512 byte blocks a size byte file takes up. * (Note: the number stays 512 no matter what BUFSIZ or the filesystem uses.) */ long nblock(size) long size; { return((size+511)>>9); } /* * This code handles the rwx- business. * You figure it out. */ int m1[] = { 1, S_IREAD>>0, 'r', '-' }; int m2[] = { 1, S_IWRITE>>0, 'w', '-' }; int m3[] = { 2, S_ISUID, 's', S_IEXEC>>0, 'x', '-' }; int m4[] = { 1, S_IREAD>>3, 'r', '-' }; int m5[] = { 1, S_IWRITE>>3, 'w', '-' }; int m6[] = { 2, S_ISGID, 's', S_IEXEC>>3, 'x', '-' }; int m7[] = { 1, S_IREAD>>6, 'r', '-' }; int m8[] = { 1, S_IWRITE>>6, 'w', '-' }; int m9[] = { 2, S_ISVTX, 't', S_IEXEC>>6, 'x', '-' }; int *m[] = { m1, m2, m3, m4, m5, m6, m7, m8, m9}; pmode(aflag) { register int **mp; flags = aflag; for (mp = &m[0]; mp < &m[sizeof(m)/sizeof(m[0])];) select(*mp++); } select(pairp) register int *pairp; { register int n; n = *pairp++; while (--n>=0 && (flags&*pairp++)==0) pairp++; pputchar(*pairp); } /* * returns cat(dir, "/", file), unless dir ends in /, when it doesn't // */ char * makename(dir, file) char *dir, *file; { static char dfile[100]; register char *dp, *fp; register int i; dp = dfile; fp = dir; while (*fp) *dp++ = *fp++; if (*(dp-1) != '/') *dp++ = '/'; fp = file; for (i=0; i filewidth) filewidth = width; } ep = gstat(makename(dir, dentry.d_name), Fflg || Rflg); if (ep==NULL) continue; if (ep->lnum != -1) ep->lnum = dentry.d_ino; for (j=0; jln.lname[j] = dentry.d_name[j]; } fclose(dirf); } /* * stat the given file and return an lbuf containing it. * argfl is nonzero if a stat is required because the file is * an argument, rather than having been found in a directory. */ struct lbuf * gstat(file, argfl) char *file; { struct stat statb; register struct lbuf *rep; static int nomocore; if (nomocore) return(NULL); rep = (struct lbuf *)malloc(sizeof(struct lbuf)); if (rep==NULL) { fprintf(stderr, "ls: out of memory\n"); nomocore = 1; return(NULL); } if (lastp >= &flist[NFILES]) { static int msg; lastp--; if (msg==0) { fprintf(stderr, "ls: too many files\n"); msg++; } } *lastp++ = rep; rep->lflags = 0; rep->lnum = 0; rep->ltype = '-'; if (argfl || statreq) { if (stat(file, &statb)<0) { printf("%s not found\n", file); statb.st_ino = -1; statb.st_size = 0; statb.st_mode = 0; if (argfl) { lastp--; return(0); } } rep->lnum = statb.st_ino; rep->lsize = statb.st_size; switch(statb.st_mode&S_IFMT) { case S_IFDIR: rep->ltype = 'd'; break; case S_IFBLK: rep->ltype = 'b'; rep->lsize = statb.st_rdev; break; case S_IFCHR: rep->ltype = 'c'; rep->lsize = statb.st_rdev; break; case S_IFMPB: rep->ltype = 'M'; rep->lsize = statb.st_rdev; break; case S_IFMPC: rep->ltype = 'm'; rep->lsize = statb.st_rdev; break; } rep->lflags = statb.st_mode & ~S_IFMT; rep->luid = statb.st_uid; rep->lgid = statb.st_gid; rep->lnl = statb.st_nlink; if(uflg) rep->lmtime = statb.st_ati((me; else if (cflg) rep->lmtime = statb.st_ctime; else rep->lmtime = statb.st_mtime; tblocks += nblock(statb.st_size); } return(rep); } /* * decide whether to print pp1 before or after pp2, based on their * names, various times, and the r flag. */ compar(pp1, pp2) struct lbuf **pp1, **pp2; { register struct lbuf *p1, *p2; p1 = *pp1; p2 = *pp2; if (dflg==0) { if (p1->lflags&ISARG && p1->ltype=='d') { if (!(p2->lflags&ISARG && p2->ltype=='d')) return(1); } else { if (p2->lflags&ISARG && p2->ltype=='d') return(-1); } } if (tflg) { if(p2->lmtime == p1->lmtime) return(0); if(p2->lmtime > p1->lmtime) return(rflg); return(-rflg); } return(rflg * strcmp(p1->lflags&ISARG? p1->ln.namep: p1->ln.lname, p2->lflags&ISARG? p2->ln.namep: p2->ln.lname)); } /* * print the entry pointed at by ap */ pentry(ap) struct lbuf *ap; { struct { char dminor, dmajor;}; register struct lbuf *p; register char *cp; char fname[100]; char *pname; struct passwd *getpwuid(); struct passwd *pwptr; struct group *getgrgid(); struct group *grptr; fname[0] = 0; p = ap; if (p->lnum == -1) return; column(); if (iflg) if (nopad && !lflg) printf("%d ", p->lnum); else printf("%5d ", p->lnum); if (sflg) switch (p->ltype) { case 'b': case 'c': case 'm': case 'M': if (nopad && !lflg) printf("%D ", 0); else printf("%4D ", 0); break; default: if (nopad && !lflg) printf("%D ", nblock(p->lsize)); else printf("%4D ", nblock(p->lsize)); break; } if (lflg) { pputchar(p->ltype); pmode(p->lflags); printf("%2d ", p->lnl); if(gflg) { grptr = getgrgid(p->lgid); if (nflg == 0 && grptr != 0) printf("%-8.8s", grptr->gr_name); else printf("%-8d", p->lgid); } else { #ifndef UCB_PWHASH char *name; if (nflg == 0 && (name = getname(p->luid))) { printf("%-8.8s", name); } #else pwptr = getpwuid(p->luid); if (nflg == 0 && pwptr != 0) printf("%-8.8s", pwptr->pw_name); #endif else printf("%-8d", p->luid); } switch (p->ltype) { case 'b': case 'c': case 'm': case 'M': printf("%3d,%3d", major((int)p->lsize), minor((int)p->lsize)); break; default: printf("%7ld", p->lsize); } cp = ctime(&p->lmtime); if(p->lmtime < year) printf(" %-7.7s %-4.4s ", cp+4, cp+20); else printf(" %-12.12s ", cp+4); } #ifndef UCB if (Fflg) { if (p->ltype == 'd') strcat (fname, "["); else if (p->lflags & 0111) strcat (fname, "*"); else if (!nopad) strcat (fname, " "); } #endif if (p->lflags & ISARG) strncat (fname, p->ln.namep, 98); else strncat (fname, p->ln.lname, 14); #ifndef UCB if (Fflg) { if (p->ltype == 'd') strcat (fname, "]"); else if (!nopad) strcat (fname, " "); } #else if (Fflg) { if (p->ltype == 'd') strcat (fname, "/"); else if (p->lflags & 0111) strcat (fname, "*"); else if (!nopad) strcat (fname, " "); } #endif printf ("%s", fname); free(ap); } /* char printf_id[] = "@(#) printf.c:2.2 6/5/79";*/ #include "varargs.h" /* * This version of printf is compatible with the Version 7 C * printf. The differences are only minor except that this * printf assumes it is to print through pputchar. Version 7 * printf is more general (and is much larger) and includes * provisions for floating point. */ #define MAXOCT 11 /* Maximum octal digits in a long */ #define MAXINT 32767 /* largest normal length positive integer */ #define BIG 1000000000 /* largest power of 10 less than an unsigned long */ #define MAXDIGS 10 /* number of digits in BIG */ static int width, sign, fill; char *b_dconv(); printf(va_alist) va_dcl { va_list ap; register char *fmt; char fcode; int prec; int length,mask1,nbits,n; long int mask2, num; register char *bptr; char *ptr; char buf[134]; va_start(ap); fmt = va_arg(ap,char *); for (;;) { /* process format string first */ while ((fcode = *fmt++)!='%') { /* ordinary (non-%) character */ if (fcode=='\0') return; pputchar(fcode); } /* length modifier: -1 for h, 1 for l, 0 for none */ length = 0; /* check for a leading - sign */ sign = 0; if (*fmt == '-') { sign++; fmt++; } /* a '0' may follow the - sign */ /* this is the requested fill character */ fill = 1; if (*fmt == '0') { fill--; fmt++; } /* Now comes a digit string which may be a '*' */ if (*fmt == '*') { width = va_arg(ap, int); if (width < 0) { width = -width; sign = !sign; } fmt++; } else { width = 0; while (*fmt>='0' && *fmt<='9') width = width * 10 + (*fmt++ - '0'); } /* maybe a decimal point followed by more digits (or '*') */ if (*fmt=='.') { if (*++fmt == '*') { prec = va_arg(ap, int); fmt++; } else { prec = 0; while (*fmt>='0' && *fmt<='9') prec = prec * 10 + (*fmt++ - '0'); } } else prec = -1; /* * At this point, "sign" is nonzero if there was * a sign, "fill" is 0 if there was a leading * zero and 1 otherwise, "width" and "prec" * contain numbers corresponding to the digit * strings before and after the decimal point, * respectively, and "fmt" addresses the next * character after the whole mess. If there was * no decimal point, "prec" will be -1. */ switch (*fmt) { case 'L': case 'l': length = 2; /* no break!! */ case 'h': case 'H': length--; fmt++; break; } /* * At exit from the following switch, we will * emit the characters starting at "bptr" and * ending at "ptr"-1, unless fcode is '\0'. */ switch (fcode = *fmt++) { /* process characters and strings first */ case 'c': buf[0] = va_arg(ap, int); ptr = bptr = &buf[0]; if (buf[0] != '\0') ptr++; break; case 's': bptr = va_arg(ap,char *); if (bptr==0) bptr = "(null pointer)"; if (prec < 0) prec = MAXINT; for (n=0; *bptr++ && n < prec; n++) ; ptr = --bptr; bptr -= n; break; case 'O': length = 1; fcode = 'o'; /* no break */ case 'o': case 'X': case 'x': if (length > 0) num = va_arg(ap,long); else num = (unsigned)va_arg(ap,int); if (fcode=='o') { mask1 = 0x7; mask2 = 0x1fffffffL; nbits = 3; } else { mask1 = 0xf; mask2 = 0x0fffffffL; nbits = 4; } n = (num!=0); bptr = buf + MAXOCT + 3; /* shift and mask for speed */ do if (((int) num & mask1) < 10) *--bptr = ((int) num & mask1) + 060; else *--bptr = ((int) num & mask1) + 0127; while (num = (num >> nbits) & mask2); if (fcode=='o') { if (n) *--bptr = '0'; } else if (!sign && fill <= 0) { pputchar('0'); pputchar(fcode); width -= 2; } else { *--bptr = fcode; *--bptr = '0'; } ptr = buf + MAXOCT + 3; break; case 'D': case 'U': case 'I': length = 1; fcode = fcode + 'a' - 'A'; /* no break */ case 'd': case 'i': case 'u': if (length > 0) num = va_arg(ap,long); else { n = va_arg(ap,int); if (fcode=='u') num = (unsigned) n; else num = (long) n; } if (n = (fcode != 'u' && num < 0)) num = -num; /* now convert to digits */ bptr = b_dconv(num, buf); if (n) *--bptr = '-'; if (fill == 0) fill = -1; ptr = buf + MAXDIGS + 1; break; default: /* not a control character, * print it. */ ptr = bptr = &fcode; ptr++; break; } if (fcode != '\0') b_emit(bptr,ptr); } va_end(ap); } /* b_dconv converts the unsigned long integer "value" to * printable decimal and places it in "buffer", right-justified. * The value returned is the address of the first non-zero character, * or the address of the last character if all are zero. * The result is NOT null terminated, and is MAXDIGS characters long, * starting at buffer[1] (to allow for insertion of a sign). * * This program assumes it is running on 2's complement machine * with reasonable overflow treatment. */ char * b_dconv(value, buffer) long value; char *buffer; { register char *bp; register int svalue; int n; long lval; bp = buffer; /* zero is a special case */ if (value == 0) { bp += MAXDIGS; *bp = '0'; return(bp); } /* develop the leading digit of the value in "n" */ n = 0; while (value < 0) { value -= BIG; /* will eventually underflow */ n++; } while ((lval = value - BIG) >= 0) { value = lval; n++; } /* stash it in buffer[1] to allow for a sign */ bp[1] = n + '0'; /* * Now develop the rest of the digits. Since speed counts here, * we do it in two loops. The first gets "value" down until it * is no larger than MAXINT. The second one uses integer divides * rather than long divides to speed it up. */ bp += MAXDIGS + 1; while (value > MAXINT) { *--bp = (int)(value % 10) + '0'; value /= 10; } /* cannot lose precision */ svalue = value; while (svalue > 0) { *--bp = (svalue % 10) + '0'; svalue /= 10; } /* fill in intermediate zeroes if needed */ if (buffer[1] != '0') { while (bp > buffer + 2) *--bp = '0'; --bp; } return(bp); } /* * This program sends string "s" to pputchar. The character after * the end of "s" is given by "send". This allows the size of the * field to be computed; it is stored in "alen". "width" contains the * user specified length. If width width) width = alen; cfill = fill>0? ' ': '0'; /* we may want to print a leading '-' before anything */ if (*s == '-' && fill < 0) { pputc((har(*s++); alen--; width--; } npad = width - alen; /* emit any leading pad characters */ if (!sign) while (--npad >= 0) pputchar(cfill); /* emit the string itself */ while (--alen >= 0) pputchar(*s++); /* emit trailing pad characters */ if (sign) while (--npad >= 0) pputchar(cfill); } #ifndef UCB_PWHASH #define NUID 2048 char names[NUID][NMAX+1]; char * getname(uid) { register struct passwd *pw; static init; struct passwd *getpwent(); if (uid >= 0 && uid < NUID && names[uid][0]) return (&names[uid][0]); if (init == 2) return (0); if (init == 0) setpwent(), init = 1; while (pw = getpwent()) { if (pw->pw_uid < 0 || pw->pw_uid >= NUID) continue; if (names[pw->pw_uid][0]) continue; strncpy(names[pw->pw_uid], pw->pw_name, NMAX); if (pw->pw_uid == uid) return (&names[uid][0]); } init = 2; endpwent(); return (0); } #endif har * getname(uid) { register struct passwd *pw; static init; struct passwd *getpwent(); if (uid >= 0 && uid < NUID && nacmd/ls/makefile 644 0 33 355 2361511221 6670 all: cc -O -z -d2 ls.c -o ls cc -O -z ucbls.c -o ucbls install: install -s ls ${DESTDIR}/bin/ls install -s ucbls ${DESTDIR}/usr/ucb/ls rm -f ${DESTDIR}/usr/ucb/l ln ${DESTDIR}/usr/ucb/ls ${DESTDIR}/usr/ucb/l clean: rm -f ls ucbls strncpy(names[pw->pw_uid], pw->pw_name, NMAX); if (pw->pw_uid == uid) return (&names[uid][0]); } init = 2; endpwent(); return (0); } #endif har * getname(uid) { register str/,5x< /,"cmd/m4/ 775 0 33 0 2552553540 5040 cmd/m4/Makefile 644 0 33 161 2254360007 6532 CFLAGS=-O m4: m4.o m4y.o $(CC) -o m4 m4.o m4y.o install: install -s m4 $(DESTDIR)/usr/bin clean: rm -f *.o bls ${DESTDIR}/usr/uc< < a9/usr02552553540{DESTD< a9 ${D00000005040ucb/l clean: rm -f ls ucbls strncpy(names[pw->pw_uid], pw->pw_name, NMAX); if (pw->pw_uid == uid) return (&names[uid][0]); } init = 2; endpwent(); return (0); } #endif har * getn uid) { / C. /,"cmd/m4/m4.c 644 0 33 35767 2111463460 5641 #include #include #define ERROR NULL #define READ "r" #define WRITE "w" #define EOS 0 int lpar = '('; #define LPAR lpar #define RPAR ')' #define COMMA ',' #define GRAVE '`' #define ACUTE '\'' #define LBRAK '[' #define RBRAK ']' #ifdef M4 char lquote LBRAK; char rquote RBRAK; #endif #ifndef M4 char lquote = GRAVE; char rquote = ACUTE; #endif #define COMMENT '#' #define ALPH 1 #define DIG 2 #define HSHSIZ 199 /* prime */ #define STACKS 50 #define SAVS 4096 #define TOKS 128 #define putbak(c) *ip++ = c; #define getchr() (ip>cur_ip?*--ip: getc(infile[infptr])) #define putchr(c) if (cp==NULL) {if (curfile)putc(c,curfile);} else *op++ = c char type[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, DIG, DIG, DIG, DIG, DIG, DIG, DIG, DIG, DIG, DIG, 0, 0, 0, 0, 0, 0, 0, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, 0, 0, 0, 0, ALPH, 0, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, 0, 0, 0, 0, 0, }; char token[TOKS]; char eoa[] = "\0"; struct nlist { char *name; char *def; struct nlist *next; }; struct nlist *hshtab[HSHSIZ]; char ibuf[SAVS+TOKS]; char obuf[SAVS+TOKS]; char *op = obuf; char *ip = ibuf; char *ip_stk[10] = {ibuf}; char *cur_ip = ibuf; struct call { char **argp; int plev; }; struct call *cp = NULL; char *makeloc; char *ifdefloc; char *lenloc; char *undefloc; char *shiftloc; char *cqloc; char *defloc; char *evaloc; char *incrloc; char *substrloc; char *indexloc; char *transloc; char *ifloc; char *divloc; char *divnumloc; char *undivloc; char *dnlloc; char *inclloc; char *sinclloc; char *syscmdloc; char *dumploc; char *errploc; char *tempname; struct nlist *lookup(); char *install(); char *malloc(); char *mktemp(); char *copy(); long ctol(); int hshval; FILE *olist[11] = { stdout }; int okret; int curout = 0; FILE *curfile = { stdout }; FILE *infile[10] = { stdin }; int infptr = 0; main(argc, argv) char **argv; { char *argstk[STACKS+10]; struct call callst[STACKS]; register char *tp, **ap; int delexit(), catchsig(); register t; int i; #ifdef gcos #ifdef M4 install("GCOS", eoa); #endif #ifndef M4 install("gcos", eoa); #endif #endif #ifdef unix #ifdef M4 install("UNIX", eoa); #endif #ifndef M4 install("unix", eoa); #endif #endif #ifdef M4 makeloc = install("MAKETEMP", eoa); ifdefloc = install("IFDEF", eoa); lenloc = install("LEN", eoa); undefloc = install("UNDEFINE", eoa); shiftloc = install("SHIFT", eoa); cqloc = install("CHANGEQUOTE", eoa); defloc = install("DEFINE", eoa); evaloc = install("EVAL", eoa); inclloc = install("INCLUDE", eoa); sinclloc = install("SINCLUDE", eoa); syscmdloc = install("SYSCMD", eoa); dumploc = install("DUMPDEF", eoa); errploc = install("ERRPRINT", eoa); incrloc = install("INCR", eoa); substrloc = install("SUBSTR", eoa); indexloc = install("INDEX", eoa); transloc = install("TRANSLIT", eoa); ifloc = install("IFELSE", eoa); divloc = install("DIVERT", eoa); divnumloc = install("DIVNUM", eoa); undivloc = install("UNDIVERT", eoa); dnlloc = install("DNL", eoa); #endif #ifndef M4 makeloc = install("maketemp", eoa); ifdefloc = install("ifdef", eoa); lenloc = install("len", eoa); undefloc = install("undefine", eoa); shiftloc = install("shift", eoa); cqloc = install("changequote", eoa); defloc = install("define", eoa); evaloc = install("eval", eoa); inclloc = install("include", eoa); sinclloc = install("sinclude", eoa); syscmdloc = install("syscmd", eoa); dumploc = install("dumpdef", eoa); errploc = install("errprint", eoa); incrloc = install("incr", eoa); substrloc = install("substr", eoa); indexloc = install("index", eoa); transloc = install("translit", eoa); ifloc = install("ifelse", eoa); divloc = install("divert", eoa); divnumloc = install("divnum", eoa); undivloc = install("undivert", eoa); dnlloc = install("dnl", eoa); #endif ap = argstk; #ifndef gcos if (signal(SIGHUP, SIG_IGN) != SIG_IGN) signal(SIGHUP, catchsig); if (signal(SIGINT, SIG_IGN) != SIG_IGN) signal(SIGINT, catchsig); tempname = mktemp("/tmp/m4aXXXXX"); close(creat(tempname, 0)); #endif #ifdef gcos tempname = "m4.tempa"; #endif if (argc>1) putbak(0); for (;;) { tp = token; *tp++ = t = getchr(); *tp = EOS; if (t<=0) { if (infptr > 0) { fclose(infile[infptr]); infptr--; cur_ip = ip_stk[infptr]; continue; } if (argc<=1) break; argc--; argv++; if (infile[infptr]!=stdin) fclose(infile[infptr]); if (**argv=='-') infile[infptr] = stdin; else if ((infile[infptr]=fopen(argv[0], READ))==ERROR) { fprintf(stderr, "m4: file not found: %s\n", argv[0]); delexit(); } continue; } if (type[t]==ALPH) { while ((t=type[*tp++=getchr()])==ALPH||t==DIG); putbak(*--tp); *tp = EOS; if (*ap = lookup(token)->def) { if (++ap >= &argstk[STACKS]) { fprintf(stderr, "m4: arg stack overflow\n"); delexit(); } if (cp==NULL) cp = callst; else if (++cp > &callst[STACKS]) { fprintf(stderr, "m4: call stack overflow\n"); delexit(); } cp->argp = ap; *ap++ = op; puttok(); *op++ = '\0'; t = getchr(); putbak(t); if (t!=LPAR) { /* if (t!=' ' && t!='\t') */ putbak(')'); putbak('('); } else /* try to fix arg count */ *ap++ = op; cp->plev = 0; } else puttok(); } else if (t==lquote) { i = 1; for (;;) { t = getchr(); if (t==rquote) { i--; if (i==0) break; } else if (t==lquote) i++; else if (t<0) { fprintf(stderr, "m4: EOF in string\n"); delexit(); } putchr(t); } } else if (t==COMMENT) { putbak(t); while ((t = getchr())!='\n'&& t>=0) if (cp==NULL) putchr(t); putbak(t); } else if (cp==NULL) { puttok(); } else if (t==LPAR) { if (cp->plev) *op++ = t; cp->plev++; (( while ( (t=getchr())==' ' || t=='\t' || t=='\n') ; /* skip leading white space during arg collection */ putbak(t); /* } else if (t==' ' || t=='\t' || t=='\n') { continue; */ } else if (t==RPAR) { cp->plev--; if (cp->plev==0) { *op++ = '\0'; expand(cp->argp, ap-cp->argp-1); op = *cp->argp; ap = cp->argp-1; cp--; if (cp < callst) cp = NULL; } else *op++ = t; } else if (t==COMMA && cp->plev<=1) { *op++ = '\0'; *ap++ = op; while ((t=getchr())==' ' || t=='\t' || t=='\n') ; /* skip leading white space during arg collection */ putbak(t); } else *op++ = t; } if (cp!=NULL) { fprintf(stderr, "m4: unexpected EOF\n"); delexit(); } okret = 1; delexit(); } catchsig() { okret = 0; delexit(); } delexit() { register FILE *fp; register i, c; if (!okret) { signal(SIGHUP, SIG_IGN); signal(SIGINT, SIG_IGN); } for (i=1; i<10; i++) { if (olist[i]==NULL) continue; fclose(olist[i]); tempname[7] = 'a'+i; if (okret) { fp = fopen(tempname, READ); while ((c = getc(fp)) > 0) putchar(c); fclose(fp); } unlink(tempname); } tempname[7] = 'a'; unlink(tempname); exit(1-okret); } puttok() { register char *tp; tp = token; if (cp) { if (op >= &obuf[SAVS]) { fprintf(stderr, "m4: argument overflow\n"); delexit(); } while (*tp) *op++ = *tp++; } else if (curfile) while (*tp) putc(*tp++, curfile); } pbstr(str) register char *str; { register char *p; p = str; while (*p++); --p; if (ip >= &ibuf[SAVS]) { fprintf(stderr, "m4: pushback overflow\n"); delexit(); } while (p > str) putbak(*--p); } expand(a1, c) register char **a1; { register char *dp; register n; dp = a1[-1]; if (dp==defloc) dodef(a1, c); else if (dp==evaloc) doeval(a1, c); else if (dp==inclloc) doincl(a1, c, 1); else if (dp==sinclloc) doincl(a1, c, 0); else if (dp==makeloc) domake(a1, c); else if (dp==syscmdloc) dosyscmd(a1, c); else if (dp==incrloc) doincr(a1, c); else if (dp==substrloc) dosubstr(a1, c); else if (dp==indexloc) doindex(a1, c); else if (dp==transloc) dotransl(a1, c); else if (dp==ifloc) doif(a1, c); else if (dp==divloc) dodiv(a1, c); else if (dp==divnumloc) dodivnum(a1, c); else if (dp==undivloc) doundiv(a1, c); else if (dp==dnlloc) dodnl(a1, c); else if (dp==dumploc) dodump(a1, c); else if (dp==errploc) doerrp(a1, c); else if (dp==lenloc) dolen(a1, c); else if (dp==ifdefloc) doifdef(a1, c); else if (dp==undefloc) doundef(a1, c); else if (dp==shiftloc) doshift(a1, c); else if (dp==cqloc) docq(a1, c); else { while (*dp++); for (dp--; dp>a1[-1]; ) { if (--dp>a1[-1] && dp[-1]=='$') { n = *dp-'0'; if (n>=0 && n<=9) { if (n <= c) pbstr(a1[n]); dp--; } else putbak(*dp); } else putbak(*dp); } } } struct nlist *lookup(str) char *str; { register char *s1, *s2; register struct nlist *np; static struct nlist nodef; s1 = str; for (hshval = 0; *s1; ) hshval += *s1++; hshval %= HSHSIZ; for (np = hshtab[hshval]; np!=NULL; np = np->next) { s1 = str; s2 = np->name; while (*s1++ == *s2) if (*s2++ == EOS) return(np); } return(&nodef); } char *install(nam, val) char *nam, *val; { register struct nlist *np; if ((np = lookup(nam))->name == NULL) { np = (struct nlist *)malloc(sizeof(*np)); if (np == NULL) { fprintf(stderr, "m4: no space for alloc\n"); exit(1); } np->name = copy(nam); np->def = copy(val); np->next = hshtab[hshval]; hshtab[hshval] = np; return(np->def); } free(np->def); np->def = copy(val); return(np->def); } doundef(ap, c) char **ap; { register struct nlist *np, *tnp; if (c < 1 || (np = lookup(ap[1]))->name == NULL) return; tnp = hshtab[hshval]; /* lookup sets hshval */ if (tnp == np) /* it's in first place */ hshtab[hshval] = np->next; else { for ( ; tnp->next != np; tnp = tnp->next) ; tnp->next = np->next; } free(np->name); free(np->def); free((char *)np); } char *copy(s) register char *s; { register char *p, *s1; p = s1 = malloc((unsigned)strlen(s)+1); if (p == NULL) { fprintf(stderr, "m4: no space for alloc\n"); exit(1); } while (*s1++ = *s++); return(p); } dodef(ap, c) char **ap; { if (c >= 2) { if (strcmp(ap[1], ap[2]) == 0) { fprintf(stderr, "m4: %s defined as itself\n", ap[1]); delexit(); } install(ap[1], ap[2]); } else if (c == 1) install(ap[1], ""); } doifdef(ap, c) char **ap; { register struct nlist *np; if (c < 2) return; if (lookup(ap[1])->name != NULL) pbstr(ap[2]); else if (c >= 3) pbstr(ap[3]); } dolen(ap, c) char **ap; { putnum((long) strlen(ap[1])); } docq(ap, c) char **ap; { if (c > 1) { lquote = *ap[1]; rquote = *ap[2]; } else if (c == 1) { lquote = rquote = *ap[1]; } else { #ifndef M4 lquote = GRAVE; rquote = ACUTE; #endif #ifdef M4 lquote = LBRAK; rquote = RBRAK; #endif } } doshift(ap, c) char **ap; { fprintf(stderr, "m4: shift not yet implemented\n"); } dodump(ap, c) char **ap; { int i; register struct nlist *np; if (c > 0) while (c--) { if ((np = lookup(*++ap))->name != NULL) fprintf(stderr, "`%s' `%s'\n", np->name, np->def); } else for (i=0; inext) fprintf(stderr, "`%s' `%s'\n", np->name, np->def); } doerrp(ap, c) char **ap; { if (c > 0) { fprintf(stderr, ap[1], ap[2], ap[3], ap[4], ap[5], ap[6]); fprintf(stderr, "\n"); } } long evalval; /* return value from yacc stuff */ char *pe; /* used by grammar */ doeval(ap, c) char **ap; { if (c > 0) { pe = ap[1]; if (yyparse() == 0) putnum(evalval); else fprintf(stderr, "m4: invalid expression in eval: %s\n", ap[1]); } } doincl(ap, c, noisy) char **ap; { if (c > 0 && strlen(ap[1]) > 0) { infptr++; ip_stk[infptr] = cur_ip = ip; if ((infile[infptr] = fopen(ap[1], READ))==ERROR) { if (noisy) { fprintf(stderr, "m4: file not found: %s\n", ap[1]); delexit(); } else infptr--; } } } dosyscmd(ap, c) char **ap; { if (c > 0) system(ap[1]); } domake(ap, c) char **ap; { if (c > 0) pbstr(mktemp(ap[1])); } doincr(ap, c) char **ap; { if (c >= 1) putnum(ctol(ap[1])+1); } putnum(num) long num; { register sign; sign = (num < 0) ? '-' : '\0'; if (num < 0) num = -num; do { putbak(num%10+'0'); num = num/10; } while (num!=0); if (sign == '-') putbak('-'); } dosubstr(ap, c) char **ap; { int nc; register char *sp, *fc; if (c<2) return; if (c<3) nc = TOKS; else nc = ctoi(ap[3]); fc = ap[1] + max(0, min(ctoi(ap[2]), strlen(ap[1]))); sp = fc + min(nc, strlen(fc)); while (sp > fc) putbak(*--sp); } doindex(ap, c) char **ap; { if (c >= 2) putnum((long) strindex(ap[1], ap[2])); } strindex(p1, p2) char *p1, *p2; { register m; register char *s, *t, *p; for (p=p1; *p; p++) { s = p; m = 1; for (t=p2; *t; ) if (*t++ != *s++) m = 0; if (m == 1) return(p-p1); } return(-1); } dotransl(ap, c) char **ap; { register char *s, *fr, *to; if (c <= 1) return; if (c == 2) { register int i; to = ap[1]; for (s = ap[1]; *s; s++) { i = 0; for (fr = ap[2]; *fr; fr++) if (*s == *fr) { i++; break; } if (i == 0) *to++ = *s; } *to = '\0'; } if (c >= 3) { for (s = ap[1]; *s; s++) for (fr = ap[2], to = ap[3]; *fr && *to; fr++, to++) if (*s == *fr) *s = *to; } pbstr(ap[1]); } doif(ap, c) register char **ap; { if (c < 3) return; while (c >= 3) { if (strcmp(ap[1], ap[2]) == 0) { pbstr(ap[3]); return; } c -= 3; ap += 3; } if (c > 0) pbstr(ap[1]); } dodiv(ap, c) register char **ap; { register int f; if (c<1) f = 0; else f = ctoi(ap[1]); if (f>=10 || f<0) { curfile = NULL; return; } tempname[7] = 'a' + f; if (olist[f] || (olist[f]=fopen(tempname, WRITE))) { curout = f; curfile = olist[f]; } } doundiv(ap, c) char **ap; { register FILE *fp; register int i, ch; int j; if (c == 0) { for (i=1; i<10; i++) { if (i==curout || olist[i]==NULL) continue; fclose(olist[i]); tempname[7] = 'a'+i; fp = fopen(tempname, READ); if (curfile != NULL) while ((ch = getc(fp)) > 0) putc(ch, curfile); fclose(fp); unlink(tempname); olist[i] = NULL; } } else { for (j = 1; j <= c; j++) { i = ctoi(*++ap); if (i<1 || i>9 || i==curout || olist[i]==NULL) continue; fclose(olist[i]); tempname[7] = 'a'+i; fp = fopen(tempname, READ); if (curfile != NULL) while ((ch = getc(fp)) > 0) putc(ch, curfile); fclose(fp); unlink(tempname); olist[i] = NULL; } } } dodivnum(ap, c) char **ap; { putnum((long) curout); } dodnl(ap, c) char **ap; { register t; while ((t=getchr())!='\n' && t>=0) ; } long ctol(str) register char *str; { register sign; long num; while (*str==' ' || *str=='\t' || *str=='\n') str++; num = 0; if (*str == '-') { sign = -1; str++; } else sign = 1; while (*str>='0' && *str<='9') num = num*10 + *str++ - '0'; return(sign * num); } ctoi(s) char *s; { return(ctol(s)); } min(a, b) { if (a>b) return(b); return(a); } max(a, b) { if (a>b) return(a); return(b); } out); } cmd/m4/m4y.y 644 0 33 3137 2111463460 6022 %{ extern long evalval; #define YYSTYPE long %} %term DIGITS %left '|' %left '&' %right '!' %nonassoc GT GE LT LE NE EQ %left '+' '-' %left '*' '/' '%' %right POWER %right UMINUS %% s : e ={ evalval = $1; } | ={ evalval = 0; } ; e : e '|' e ={ $$ = ($1!=0 || $3!=0) ? 1 : 0; } | e '&' e ={ $$ = ($1!=0 && $3!=0) ? 1 : 0; } | '!' e ={ $$ = $2 == 0; } | e EQ e ={ $$ = $1 == $3; } | e NE e ={ $$ = $1 != $3; } | e GT e ={ $$ = $1 > $3; } | e GE e ={ $$ = $1 >= $3; } | e LT e ={ $$ = $1 < $3; } | e L((E e ={ $$ = $1 <= $3; } | e '+' e ={ $$ = ($1+$3); } | e '-' e ={ $$ = ($1-$3); } | e '*' e ={ $$ = ($1*$3); } | e '/' e ={ $$ = ($1/$3); } | e '%' e ={ $$ = ($1%$3); } | '(' e ')' ={ $$ = ($2); } | e POWER e ={ for ($$=1; $3-->0; $$ *= $1); } | '-' e %prec UMINUS ={ $$ = $2-1; $$ = -$2; } | '+' e %prec UMINUS ={ $$ = $2-1; $$ = $2; } | DIGITS ={ $$ = evalval; } ; %% yylex() { extern char *pe; while (*pe==' ' || *pe=='\t' || *pe=='\n') pe++; switch(*pe) { case '\0': case '+': case '-': case '/': case '%': case '(': case ')': return(*pe++); case '^': pe++; return(POWER); case '*': return(peek('*', POWER, '*')); case '>': return(peek('=', GE, GT)); case '<': return(peek('=', LE, LT)); case '=': return(peek('=', EQ, EQ)); case '|': return(peek('|', '|', '|')); case '&': return(peek('&', '&', '&')); case '!': return(peek('=', NE, '!')); default: evalval = 0; while (*pe >= '0' && *pe <= '9') evalval = evalval*10 + *pe++ - '0'; return(DIGITS); } } peek(c, r1, r2) { if (*++pe != c) return(r2); ++pe; return(r1); } yyerror(s) char *s; { } R); case '*': return(peek('*', POWER, '*')); case '>': return(peek('=', GE, GT)); case '<': return(peek('=', LE, LT)); case '=': return(peek('=', EQ, EQ)); case '|': return(peek('|', '|', '|')); case '&': return(peek('&', '&', '&')); case '!': return(peek('=', NE, '!')); default: evalval = 0; while (*pe >= '0' && *pe <= '9') evalval = evalval*10 + *pe++ - '0'; return(DIGITS); } } pcmd/make/ 775 0 33 0 2552554101 5427 cmd/make/Makefile 444 0 33 2342 2477636713 7171 # Description file for the Make command # Makefile 4.1 81/02/28 P = und -3 | opr -r2 T = FILES = Makefile ident.c defs main.c doname.c misc.c files.c dosys.c\ gram.y gcos.c OBJECTS = ident.o main.o doname.o misc.o files.o dosys.o gram.o LIBES= LINT = lint -ps CFLAGS = -O -DASCARCH GCOSFILES = defs ident.c main.c doname.c misc.c gram.c gcos.c all: make cmp: make cmp make /bin/make rm *.o gram.c make cp: make cp make /bin/make rm *.o gram.c make make: $(OBJECTS) $(CC) -n -s $(CFLAGS) $(OBJECTS) $(LIBES) -o make $(OBJECTS): defs clean: -rm *.o gram.c install: install make $(DESTDIR)/bin/make printall: # Print files off line. -pr $(FILES) | $P touch print print: $(FILES) # print recently changed files -pr $? | $P touch print save: # Write files on Spider store. -nfs -ucv make $(FILES) test: 1zap 2zap diff 1zap 2zap rm 1zap 2zap 1zap: ./make -dp | grep -v TIME >1zap 2zap: /bin/make -dp | grep -v TIME >2zap time: time1 time2 ; time1 time2 : time ./make $T time /bin/make $T lint : dosys.c doname.c files.c main.c misc.c ident.c gram.c $(LINT) dosys.c doname.c files.c main.c misc.c ident.c gram.c rm gram.c src: cp $(FILES) /usr/src/cmd/make gcos: $(GCOSFILES) fsend -c -u sif $? touch gcos $? | $P touch print save: # Write files on Spider store. -nfs -ucv make $(FILES) test: 1zap 2zap diff 1zap 2zap rm 1zap 2zap 1zap: ./make -dp | grep -v TIME >1zap 2zap: /bin/make -dp | grep -v TIME >2zap time: time1 time2 ; time1 time2 : time ./make $T time /bin/make $T cmd/make/defs 444 0 33 4256 2504334454 6367 /* defs 4.2 81/03/14 */ #include #include #define SHELLCOM "/bin/sh" typedef long int TIMETYPE; #ifdef unix /* to install metering, add a statement like */ #define METERFILE "/usr/sif/make/Meter" /* to turn metering on, set external variable meteron to 1 */ #endif /* define FSTATIC to be static on systems with C compilers supporting file-static; otherwise define it to be null */ #define FSTATIC static #define NO 0 #define YES 1 #define unequal strcmp #define HASHSIZE 1021 #define NLEFTS 512 #define NCHARS 500 #define NINTS 250 #define INMAX 2500 #define OUTMAX 3500 #define QBUFMAX 2500 #define MAXDIR 10 #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; struct lineblock *linep; int done:3; int septype:3; TIMETYPE modtime; }; extern struct nameblock *mainname ; extern struct nameblock *firstname; struct lineblock { struct lineblock *nxtlineblock; struct depblock *depp; struct shblock *shp; }; extern struct lineblock *sufflist; struct depblock { struct depblock *nxtdepblock; struct nameblock *depname; }; struct shblock { struct shblock *nxtshblock; char *shbp; }; struct varblock { struct varblock *nxtvarblock; char *varname; char *varval; int noreset:1; int used:1; }; extern struct varblock *firstvar; struct pattern { struct pattern *nxtpattern; char *patval; }; extern struct pattern *firstpat; struct opendir { struct opendir *nxtopendir; FILE * dirfc; char *dirn; }; extern struct opendir *firstod; struct chain { struct chain *nextp; char *datap; }; char *copys(), *concat(), *subst(); int *ckalloc(); struct nameblock *srchname(), *makename(); TIMETYPE exists(); truct varblock *nxtvarblock; char *varname; char *varval; int noreset:1; int used:1; }; extern struct varblock *firstvar; struct pattern { struct pattern *nxtpattern; char *patval; }; extern struct pattern *firstpat; struct opendir { struct opendir *nxtopendir; FILE * dirfc; char *dirn; }; extern struct opendir *firstod;cmd/make/doname.c 444 0 33 13437 2477636715 7171 static char *sccsid = "@(#)doname.c 4.1 (Berkeley) 81/02/28"; #include "defs" /* BASIC PROCEDURE. RECURSIVE. */ /* p->done = 0 don't know what to do yet p->done = 1 file in process of being updated p->done = 2 file already exists in current state p->done = 3 file make failed */ doname(p, reclevel, tval) register struct nameblock *p; int reclevel; TIMETYPE *tval; { int errstat; int okdel1; int didwork; TIMETYPE td, td1, tdep, ptime, ptime1, prestime(); register struct depblock *q; struct depblock *qtemp, *srchdir(), *suffp, *suffp1; struct nameblock *p1, *p2; struct shblock *implcom, *explcom; register struct lineblock *lp; struct lineblock *lp1, *lp2; char sourcename[100], prefix[100], temp[100], concsuff[20]; char *pnamep, *p1namep; char *mkqlist(); struct chain *qchain, *appendq(); if(p == 0) { *tval = 0; return(0); } if(dbgflag) { printf("doname(%s,%d)\n",p->namep,reclevel); fflush(stdout); } if(p->done > 0) { *tval = p->modtime; return(p->done == 3); } errstat = 0; tdep = 0; implcom = 0; explcom = 0; ptime = exists(p->namep); ptime1 = 0; didwork = NO; p->done = 1; /* avoid infinite loops */ qchain = NULL; /* Expand any names that have embedded metacharaters */ for(lp = p->linep ; lp ; lp = lp->nxtlineblock) for(q = lp->depp ; q ; q=qtemp ) { qtemp = q->nxtdepblock; expand(q); } /* make sure all dependents are up to date */ for(lp = p->linep ; lp ; lp = lp->nxtlineblock) { td = 0; for(q = lp->depp ; q ; q = q->nxtdepblock) { errstat += doname(q->depname, reclevel+1, &td1); if(dbgflag) printf("TIME(%s)=%ld\n", q->depname->namep, td1); if(td1 > td) td = td1; if(ptime < td1) qchain = appendq(qchain, q->depname->namep); } if(p->septype == SOMEDEPS) { if(lp->shp!=0) if( 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 */ for(lp = sufflist ; lp ; lp = lp->nxtlineblock) for(suffp = lp->depp ; suffp ; suffp = suffp->nxtdepblock) { pnamep = suffp->depname->namep; if(suffix(p->namep , pnamep , prefix)) { srchdir( concat(prefix,"*",t((emp) , NO, (struct depblock *) NULL); for(lp1 = sufflist ; lp1 ; lp1 = lp1->nxtlineblock) for(suffp1=lp1->depp ; suffp1 ; suffp1 = suffp1->nxtdepblock) { p1namep = suffp1->depname->namep; if( (p1=srchname(concat(p1namep, pnamep ,concsuff))) && (p2=srchname(concat(prefix, p1namep ,sourcename))) ) { errstat += doname(p2, reclevel+1, &td); if(ptime < td) qchain = appendq(qchain, p2->namep); if(dbgflag) printf("TIME(%s)=%ld\n", p2->namep, td); if(td > tdep) tdep = td; setvar("*", prefix); setvar("<", copys(sourcename)); for(lp2=p1->linep ; lp2 ; lp2 = lp2->nxtlineblock) if(implcom = lp2->shp) break; goto endloop; } } } } endloop: if(errstat==0 && (ptime0 ? tdep : prestime() ); setvar("@", p->namep); setvar("?", mkqlist(qchain) ); if(explcom) errstat += docom(explcom); else if(implcom) errstat += docom(implcom); else if(p->septype == 0) if(p1=srchname(".DEFAULT")) { setvar("<", p->namep); for(lp2 = p1->linep ; lp2 ; lp2 = lp2->nxtlineblock) if(implcom = lp2->shp) { errstat += docom(implcom); break; } } else if(keepgoing) { printf("Don't know how to make %s\n", p->namep); ++errstat; } else fatal1(" Don't know how to make %s", p->namep); setvar("@", (char *) NULL); if(noexflag || (ptime = exists(p->namep)) == 0) ptime = prestime(); } else if(errstat!=0 && reclevel==0) printf("`%s' not remade because of errors\n", p->namep); else if(!questflag && reclevel==0 && didwork==NO) printf("`%s' is up to date.\n", p->namep); if(questflag && reclevel==0) exit(ndocoms>0 ? -1 : 0); p->done = (errstat ? 3 : 2); if(ptime1 > ptime) ptime = ptime1; p->modtime = ptime; *tval = ptime; return(errstat); } docom(q) struct shblock *q; { char *s; struct varblock *varptr(); int ign, nopr; char string[OUTMAX]; ++ndocoms; if(questflag) return(NO); if(touchflag) { s = varptr("@")->varval; if(!silflag) printf("touch(%s)\n", s); if(!noexflag) touch(YES, s); } else for( ; q ; q = q->nxtshblock ) { subst(q->shbp,string); ign = ignerr; nopr = NO; for(s = string ; *s=='-' || *s=='@' ; ++s) if(*s == '-') ign = YES; else nopr = YES; if( docom1(s, ign, nopr) && !ign) if(keepgoing) return(YES); else fatal( (char *) NULL); } return(NO); } docom1(comstring, nohalt, noprint) register char *comstring; int nohalt, noprint; { register int status; if(comstring[0] == '\0') return(0); if(!silflag && (!noprint || noexflag) ) { printf("%s%s\n", (noexflag ? "" : prompt), comstring); fflush(stdout); } if(noexflag) return(0); if( status = dosys(comstring, nohalt) ) { if( status>>8 ) printf("*** Error code %d", status>>8 ); else printf("*** Termination code %d", status ); if(nohalt) printf(" (ignored)\n"); else printf("\n"); fflush(stdout); } return(status); } /* If there are any Shell meta characters in the name, expand into a list, after searching directory */ expand(q) register struct depblock *q; { register char *s; char *s1; struct depblock *p, *srchdir(); s1 = q->depname->namep; for(s=s1 ; ;) switch(*s++) { case '\0': return; case '*': case '?': case '[': if( p = srchdir(s1 , YES, q->nxtdepblock) ) { q->nxtdepblock = p; q->depname = 0; } return; } } 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;cmd/make/dosys.c 444 0 33 5011 2477636716 7035 static char *sccsid = "@(#)dosys.c 4.1 (Berkeley) 81/02/28"; #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); } doclose() /* Close open directory files before exec'ing */ { register struct opendir *od; for (od = firstod; od; od = od->nxtopendir) if (od->dirfc != NULL) /* fclose(od->dirfc); */ close(od->dirfc->_file); } doexec(str) register char *str; { register char *t; char *argv[200]; register char **p; while( *str==' ' || *str=='\t' ) ++str; if( *str == '\0' ) return(-1); /* no command */ p = argv; for(t = str ; *t ; ) { *p++ = t; while(*t!=' ' && *t!='\t' && *t!='\0') ++t; if(*t) for( *t++ = '\0' ; *t==' ' || *t=='\t' ; ++t) ; } *p = NULL; if((waitpid = vfork()) == 0) { enbint(SIG_DFL); doclose(); enbint(intrupt); execvp(str, argv); fatal1("Cannot load %s",str); } return( await() ); } #include #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); } 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; closcmd/make/files.c 444 0 33 20561 2477637017 7020 static char *sccsid = "@(#)files.c 4.2 (Berkeley) 81/02/28"; /* UNIX DEPENDENT PROCEDURES */ /* DEFAULT RULES FOR UNIX */ char *builtin[] = { #ifdef pwb ".SUFFIXES : .L .out .o .c .f .e .r .y .yr .ye .l .s .z .x .t .h .cl", #else ".SUFFIXES : .out .o .c .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", #ifdef vax "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.o :", "\t$(CC) $(CFLAGS) -c $<", ".p.o :", "\t$(PC) $(PFLAGS) -c $<", ".cl.o :", "\tclass -c $<", ".e.o .r.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 .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(filename) char *filename; { #include struct stat buf; register char *s; TIMETYPE lookarch(); for(s = filename ; *s!='\0' && *s!='(' ; ++s) ; if(*s == '(') return(lookarch(filename)); if(stat(filename,&buf) < 0) return(0); else return(buf.st_mtime); } TIMETYPE prestime() { TIMETYPE t; time(&t); ret((urn(t); } #include FSTATIC char n15[15]; FSTATIC char *n15end = &n15[14]; struct depblock *srchdir(pat, mkchain, nextdbl) register char *pat; /* pattern to be matched in directory */ int mkchain; /* nonzero if results to be remembered */ struct depblock *nextdbl; /* final value for chain */ { FILE * dirf; register int i; int nread, cldir; char *dirname, *dirpref, *endir, *filepat, *p, temp[100]; char fullname[100], *p1, *p2; struct nameblock *q; struct depblock *thisdbl; struct opendir *od; struct pattern *patp; struct direct entry[32]; thisdbl = 0; if(mkchain == NO) for(patp=firstpat ; patp ; patp = patp->nxtpattern) if(! unequal(pat, patp->patval)) return(0); patp = ALLOC(pattern); patp->nxtpattern = firstpat; firstpat = patp; patp->patval = copys(pat); endir = 0; for(p=pat; *p!='\0'; ++p) if(*p=='/') endir = p; if(endir==0) { dirname = "."; dirpref = ""; filepat = pat; } else { dirname = pat; *endir = '\0'; dirpref = concat(dirname, "/", temp); filepat = endir+1; } dirf = NULL; cldir = NO; for(od = firstod; od; od = od->nxtopendir) if(! unequal(dirname, od->dirn) ) { dirf = od->dirfc; fseek(dirf, 0L, 0); /* start over at the beginning */ break; } if(dirf == NULL) { dirf = fopen(dirname, "r"); if(nopdir >= MAXDIR) cldir = YES; else { ++nopdir; od = ALLOC(opendir); od->nxtopendir = firstod; firstod = od; od->dirfc = dirf; od->dirn = copys(dirname); } } if(dirf == NULL) { fprintf(stderr, "Directory %s: ", dirname); fatal("Cannot open"); } else do { nread = fread( (char *) &entry[0], sizeof(struct direct), 32, dirf) ; for(i=0; inxtdepblock = nextdbl; thisdbl->depname = q; nextdbl = thisdbl; } } } } while(nread==32); if(endir != 0) *endir = '/'; if(cldir) fclose(dirf); 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 archives for notations a(b) and a((b)) a(b) is file member b in archive a a((b)) is entry point _b in object archive a */ #ifdef ASCARCH # include #else # include #endif #include static long arflen; static long arfdate; static char arfname[16]; FILE *arfd; long int arpos, arlen; static struct exec objhead; static struct nlist objentry; TIMETYPE lookarch(filename) char *filename; { char *p, *q, *send, s[15]; int i, nc, nsym, objarch; for(p = filename; *p!= '(' ; ++p) ; *p = '\0'; openarch(filename); *p++ = '('; if(*p == '(') { objarch = YES; nc = 8; ++p; } else { objarch = NO; nc = 14; } send = s + nc; for( q = s ; q struct stat buf; stat(f, &buf); arlen = buf.st_size; arfd = fopen(f, "r"); if(arfd == NULL) fatal1("cannot open %s", f); fread( (char *) &word, sizeof(word), 1, arfd); #ifdef ASCARCH fseek(arfd, 0L, 0); fread(magic, SARMAG, 1, arfd); arpos = SARMAG; if( ! eqstr(magic, ARMAG, SARMAG) ) #else arpos = sizeof(word); if(word != ARMAG) #endif fatal1("%s is not an archive", f); arflen = 0; } getarch() { struct ar_hdr arhead; long atol(); arpos += (arflen + 1) & ~1L; /* round archived file length up to even */ if(arpos >= arlen) return(0); fseek(arfd, arpos, 0); fread( (char *) &arhead, sizeof(arhead), 1, arfd); arpos += sizeof(arhead); #ifdef ASCARCH arflen = atol(arhead.ar_size); arfdate = atol(arhead.ar_date); #else arflen = arhead.ar_size; arfdate = arhead.ar_date; #endif strncpy(arfname, arhead.ar_name, sizeof(arhead.ar_name)); return(1); } getobj() { long int skip; fread( (char *) &objhead, sizeof(objhead), 1, arfd); if (N_BADMAG(objhead)) fatal1("%s is not an object module", arfname); skip = objhead.a_text + objhead.a_data; #ifdef vax skip += objhead.a_trsize + objhead.a_drsize; #else if(! objhead.a_flag ) skip *= 2; #endif fseek(arfd, skip, 1); } eqstr(a,b,n) register char *a, *b; int n; { register int i; for(i = 0 ; i < n ; ++i) if(*a++ != *b++) return(NO); return(YES); } me, arhead.ar_name, sizeof(arhead.ar_name)); return(1); } getobj() { long int skip; fread( (char *) &objhead, sizeof(objhead), 1, arfd); if cmd/make/gcos.c 444 0 33 13043 2477636722 6650 static char *sccsid = "@(#)gcos.c 4.1 (Berkeley) 81/02/28"; /* 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( cp ) char *cp; { char *s, 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 */ 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); } ase '*': 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 imcmd/make/gram.y 444 0 33 11772 2477636724 6702 %{#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 ex((ec'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. */ 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 definiticmd/make/main.c 444 0 33 14453 2477636727 6654 static char *sccsid = "@(#)main.c 4.1 (Berkeley) 81/02/28"; # include "defs" /* command make to update programs. Flags: 'd' print out debugging comments 'p' print out a version of the input graph 's' silent mode--don't print out commands 'f' the next argument is the name of the description file; "makefile" is the default 'i' ignore error codes from the shell 'S' stop after any command fails (normally do parallel work) 'n' don't issue, just print, commands 't' touch (update time of) files but don't issue command 'q' don't do anything, but check if object is up to date; returns exit code 0 if up to date, -1 if not */ struct nameblock *mainname = NULL; struct nameblock *firstname = NULL; struct lineblock *sufflist = NULL; struct varblock *firstvar = NULL; struct pattern *firstpat = NULL; struct opendir *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 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]; main(argc,argv) int argc; char *argv[]; { register struct nameblock *p; int i, j; int descset, nfargs; TIMETYPE tjunk; char c, *s; static char onechar[2] = "X"; #ifdef unix int intrupt(); #endif #ifdef METERFILE meter(METERFILE); #endif descset = 0; funny['\0'] = (META | TERMINAL); for(s = "=|^();&<>*?[]:$`'\"\\\n" ; *s ; ++s) funny[*s] |= META; for(s = "\n\t :;&>|" ; *s ; ++s) funny[*s] |= TERMINAL; inarglist = 1; for(i=1; i= argc-1) fatal("No description argument after -f flag"); if( rddescf(argv[i+1]) ) fatal1("Cannot open %s", argv[i+1]); argv[i+1] = 0; ++descset; break; default: onechar[0] = c; /* to make lint happy */ fatal1("Unknown flag argument %s", onechar); } argv[i] = 0; } if( !descset ) #ifdef unix if( rddescf("makefile") ) rddescf("Makefile"); #endif #ifdef gcos rddescf("makefile"); #endif if(prtrflag) printdesc(NO); if( srchname(".IGNORE") ) ++ignerr; if( srchname(".SILENT") ) silflag = 1; if(p=srchname(".SUFFIXES")) sufflist = p->linep; if( !sufflist ) fprintf(stderr,"No suffix list.\n"); #ifdef unix sigivalue = (int) signal(SIGINT, SIG_IGN) & 01; sigqvalue = (int) signal(SIGQUIT, SIG_IGN) & 01; enbint(intrupt); #endif nfargs = 0; for(i=1; ivarval) && exists(p)>0 && !isprecious(p) ) { fprintf(stderr, "\n*** %s removed.", p); unlink(p); } if(junkname[0]) unlink(junkname); fprintf(stderr, "\n"); exit(2); } isprecious(p) char *p; { register struct lineblock *lp; register struct depblock *dp; register struct nameblock *np; if(np = srchname(".PRECIOUS")) for(lp = np->linep ; lp ; lp = lp->nxtlineblock) for(dp = lp->depp ; dp ; dp = dp->nxtdepblock) if(! unequal(p, dp->depname->namep)) return(YES); return(NO); } enbint(k) int (*k)(); { if(sigivalue == 0) signal(SIGINT,k); if(sigqvalue == 0) signal(SIGQUIT,k); } #endif 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); #ifdef pwb { char *nlog, s[100]; nlog = logdir(); if ( (k=fopen( concat(nlog,"/makecomm",s), "r")) != NULL) rdd1(k); else if ( (k=fopen( concat(nlog,"/Makecomm",s), "r")) != NULL) rdd1(k); if ( (k=fopen("makecomm", "r")) != NULL) rdd1(k); else if ( (k=fopen("Makecomm", "r")) != NULL) rdd1(k); } #endif } if(! unequal(descfile, "-")) return( rdd1(stdin) ); if( (k = fopen(descfile,"r")) != NULL) return( rdd1(k) ); return(1); } rdd1(k) FILE * k; { extern int yylineno; extern char *zznextc; fin = k; yylineno = 0; zznextc = 0; if( yyparse() ) fatal("Description file error"); if(fin != NULL) fclose(fin); return(0); } printdesc(prntflag) int prntflag; { struct nameblock *p; struct depblock *dp; struct varblock *vp; struct opendir *od; struct shblock *sp; struct lineblock *lp; #ifdef unix if(prntflag) { printf("Open directories:\n"); for (od = firstod; od; od = od->nxtopendir) printf("\t%d: %s\n", fileno(od->dirfc), od->dirn); } #endif if(firstvar != 0) printf("Macros:\n"); for(vp = firstvar; vp ; vp = vp->nxtvarblock) printf("\t%s = %s\n" , vp->varname , vp->varval); for(p = firstname; p; p = p->nxtnameblock) { printf("\n\n%s",p->namep); if(p->linep != 0) printf(":"); if(prntflag) printf(" done=%d",p->done); if(p==mainname) printf(" (MAIN NAME)"); for(lp = p->linep ; lp ; lp = lp->nxtlineblock) { if( dp = lp->depp ) { printf("\n depends on:"); for(; dp ; dp = dp->nxtdepblock) if(dp->depname != 0) printf(" %s ", dp->depname->namep); } if(sp = lp->shp) { printf("\n commands:\n"); for( ; sp!=0 ; sp = sp->nxtshblock) printf("\t%s\n", sp->shbp); } } } printf("\n"); fflush(stdout); } >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 ) { princmd/make/misc.c 444 0 33 10766 2477636730 6660 ((static char *sccsid = "@(#)misc.c 4.1 (Berkeley) 81/02/28"; #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; while(*a == ' ') ++a; for(s=a ; *s!='\0' && *s!=':' ; ++s) if(*s == '=') { for(t = a ; *t!='=' && *t!=' ' && *t!='\t' ; ++t ); *t = '\0'; for(++s; *s==' ' || *s=='\t' ; ++s); setvar(a, copys(s)); return(YES); } return(NO); } struct varblock *varptr(v) char *v; { register struct varblock *vp; for(vp = firstvar; vp ; vp = vp->nxtvarblock) if(! unequal(v , vp->varname)) return(vp); vp = ALLOC(varblock); vp->nxtvarblock = firstvar; firstvar = vp; vp->varname = copys(v); vp->varval = 0; return(vp); } fatal1(s, t) char *s, *t; { char buf[100]; 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); } ); p->datacmd/man/ 775 0 33 0 2552554203 5270 cmd/man/man.sh 755 0 33 1330 2111463406 6455 cmd= sec= fil= opt= i= all= cmd=n sec=\? cd /usr/man for i do case $i in [1-8]) sec=$i ;; -n) cmd=n ;; -t) cmd=t ;; -k) cmd=k ;; -e | -et | -te) cmd=e ;; -ek | -ke) cmd=ek ;; -ne | -en) cmd=ne ;; -w) cmd=where ;; -*) opt="$opt $i" ;; *) fil=`echo man$sec/$i.*` case $fil in man7/eqnchar.7) all="$all /usr/pub/eqnchar $fil" ;; *\*) echo $i not found 1>&2 ;; *) all="$all $fil" ;; esac esac done case $all in "") exit ;; esac case $cmd in n) nroff $opt -man $all ;; ne) neqn $all | nroff $opt -man ;; t) troff $opt -man $all ;; k) troff -t $opt -man $all | tc ;; e) eqn $all | troff $opt -man ;; ek) eqn $all | troff -t $opt -man | tc ;; where) echo $all ;; esac ;; -w) cmd=where ;; -*) opt="$opt $i" ;; *) fil=`echo man$sec/$i.*` case $fil in man7/eqnchar.7) all="$all /usr/pub/eqnchar $fil" ;; *\*) echo $i not found 1>&2 ;; *) all="$all $fil" ;; esac esac done case $all in "") exit ;; esac case $cmd in n) nroff $opt -cmd/man/man.c 644 0 33 17577 2550607754 6343 #include #include #include #include #include #include /* * man */ int nomore; int cflag; char *strcpy(); char *strcat(); char *trim(); int remove(); int section; int subsec; int troffit; int killtmp; #define eq(a,b) (strcmp(a,b) == 0) main(argc, argv) int argc; char *argv[]; { if (signal(SIGINT, SIG_IGN) == SIG_DFL) { signal(SIGINT, remove); signal(SIGQUIT, remove); signal(SIGTERM, remove); } umask(0); if (argc <= 1) { fprintf(stderr, "Usage: man [ section ] name ...\n"); fprintf(stderr, "or: man -k keyword ...\n"); fprintf(stderr, "or: man -f file ...\n"); exit(1); } if (chdir("/usr/man") < 0) { fprintf(stderr, "Can't chdir to /usr/man.\n"); exit(1); } argc--, argv++; while (argc > 0 && argv[0][0] == '-') { switch(argv[0][1]) { case 0: nomore++; break; case 't': troffit++; break; case 'k': apropos(argc-1, argv+1); exit(0); case 'f': whatis(argc-1, argv+1); exit(0); } argc--, argv++; } if (troffit == 0 && nomore == 0 && !isatty(1)) nomore++; section = 0; do { if (eq(argv[0], "local")) { section = 'l'; goto sectin; } else if (eq(argv[0], "new")) { section = 'n'; goto sectin; } else if (eq(argv[0], "public")) { section = 'p'; goto sectin; } else if (argv[0][0] >= '0' && argv[0][0] <= '9' && (argv[0][1] == 0 || argv[0][2] == 0)) { section = argv[0][0]; subsec = argv[0][1]; sectin: argc--, argv++; if (argc == 0) { fprintf(stderr, "But what do you want from section %s?\n", argv[-1]); exit(1); } continue; } manual(section, argv[0]); argc--, argv++; } while (argc > 0); exit(0); } manual(sec, name) char sec; char *name; { char section = sec; char work[100], work2[100], cmdbuf[100]; int ss; struct stat stbuf, stbuf2; int last; char *sp = "1nl6823457p"; strcpy(work, "manx/"); strcat(work, name); strcat(work, ".x"); last = strlen(work) - 1; if (section == '1') { sp = "1nl"; section = 0; } if (section == 0) { ss = 0; for (section = *sp++; section; section = *sp++) { work[3] = section; work[last] = section; work[last+1] = 0; if (stat(work, &stbuf) >= 0) break; if (work[last] >= '1' && work[last] <= '3') { char *cp; search: switch (work[last]) { case '1': cp = "mcg"; break; case '2': cp = "jv"; break; case '3': cp = "jxmsf"; break; } while (*cp) { work[last+1] = *cp++; if (stat(work, &stbuf) >= 0) { ss = work[last+1]; goto found; } } if (ss = 0) work[last+1] = 0; } } if (section == 0) { if (sec == 0) printf("No manual entry for %s.\n", name); else printf("No entry for %s in section %c of the manual.\n", name, sec); return; } } else { work[3] = section; work[last] = section; work[last+1] = subsec; if (stat(work, &stbuf) < 0) { if ((section >= '1' && section <= '3') && subsec == 0) { sp = "\0"; goto search; } printf("No entry for %s in section %c", name, section); (( if (subsec) putchar(subsec); printf(" of the manual.\n"); return; } } found: if (troffit) troff(work); else { FILE *it; char abuf[BUFSIZ]; if (!nomore) { if ((it = fopen(work, "r")) == NULL) { perror(work); exit(1); } if (fgets(abuf, BUFSIZ-1, it) && abuf[0] == '.' && abuf[1] == 's' && abuf[2] == 'o' && abuf[3] == ' ') { register char *cp = abuf+strlen(".so "); char *dp; while (*cp && *cp != '\n') cp++; *cp = 0; while (cp > abuf && *--cp != '/') ; dp = ".so /usr/man/man"; if (cp != abuf+strlen(dp)+1) { tohard: nomore = 1; strcpy(work, abuf+4); goto hardway; } for (cp = abuf; *cp == *dp && *cp; cp++, dp++) ; if (*dp) goto tohard; strcpy(work, cp-3); } fclose(it); strcpy(work2, "cat"); strcpy(work2+3, work+3); work2[4] = 0; if (stat(work2, &stbuf2) < 0) goto hardway; strcpy(work2+3, work+3); if (stat(work2, &stbuf2) < 0 || stbuf2.st_mtime < stbuf.st_mtime) { printf("Reformatting page. Wait..."); fflush(stdout); unlink(work2); sprintf(cmdbuf, "nroff -h -man %s > /tmp/man%d; trap '' 1 15; mv /tmp/man%d %s", work, getpid(), getpid(), work2); if (system(cmdbuf)) { printf(" aborted (sorry)\n"); remove(); /*NOTREACHED*/ } printf(" done\n"); } strcpy(work, work2); } hardway: nroff(work); } } nroff(cp) char *cp; { char cmd[BUFSIZ]; sprintf(cmd, nomore ? "%s %s" : "%s %s|/usr/ucb/ul|/usr/ucb/more -f", cp[0] == 'c' ? "cat -s" : "nroff -man", cp); system(cmd); } troff(cp) char *cp; { char cmdbuf[BUFSIZ]; sprintf(cmdbuf, "troff -t -man /usr/lib/tmac/tmac.vcat %s|/usr/lib/rvsort|/usr/ucb/vpr -t", cp); system(cmdbuf); } any(c, sp) register int c; register char *sp; { register int d; while (d = *sp++) if (c == d) return (1); return (0); } remove() { char name[15]; sprintf(name, "/tmp/man%d", getpid()); unlink(name); exit(1); } apropos(argc, argv) int argc; char **argv; { char buf[BUFSIZ]; char *gotit; register char **vp; if (argc == 0) { fprintf(stderr, "man: -k what?\n"); exit(1); } if (freopen("/usr/lib/whatis", "r", stdin) == NULL) { perror("/usr/lib/whatis"); exit (1); } gotit = (char *) calloc(1, blklen(argv)); while (fgets(buf, sizeof buf, stdin) != NULL) for (vp = argv; *vp; vp++) if (match(buf, *vp)) { printf("%s", buf); gotit[vp - argv] = 1; for (vp++; *vp; vp++) if (match(buf, *vp)) gotit[vp - argv] = 1; break; } for (vp = argv; *vp; vp++) if (gotit[vp - argv] == 0) printf("%s: nothing apropriate\n", *vp); } match(buf, str) char *buf, *str; { register char *bp, *cp; bp = buf; for (;;) { if (*bp == 0) return (0); if (amatch(bp, str)) return (1); bp++; } } amatch(cp, dp) register char *cp, *dp; { while (*cp && *dp && lmatch(*cp, *dp)) cp++, dp++; if (*dp == 0) return (1); return (0); } lmatch(c, d) char c, d; { if (c == d) return (1); if (!isalpha(c) || !isalpha(d)) return (0); if (islower(c)) c = toupper(c); if (islower(d)) d = toupper(d); return (c == d); } blklen(ip) register int *ip; { register int i = 0; while (*ip++) i++; return (i); } whatis(argc, argv) int argc; char **argv; { register char **avp; if (argc == 0) { fprintf(stderr, "man: -f what?\n"); exit(1); } if (freopen("/usr/lib/whatis", "r", stdin) == NULL) { perror("/usr/lib/whatis"); exit (1); } for (avp = argv; *avp; avp++) *avp = trim(*avp); whatisit(argv); exit(0); } whatisit(argv) char **argv; { char buf[BUFSIZ]; register char *gotit; register char **vp; gotit = (char *)calloc(1, blklen(argv)); while (fgets(buf, sizeof buf, stdin) != NULL) for (vp = argv; *vp; vp++) if (wmatch(buf, *vp)) { printf("%s", buf); gotit[vp - argv] = 1; for (vp++; *vp; vp++) if (wmatch(buf, *vp)) gotit[vp - argv] = 1; break; } for (vp = argv; *vp; vp++) if (gotit[vp - argv] == 0) printf("%s: not found\n", *vp); } wmatch(buf, str) char *buf, *str; { register char *bp, *cp; bp = buf; again: cp = str; while (*bp && *cp && lmatch(*bp, *cp)) bp++, cp++; if (*cp == 0 && (*bp == '(' || *bp == ',' || *bp == '\t' || *bp == ' ')) return (1); while (isalpha(*bp) || isdigit(*bp)) bp++; if (*bp != ',') return (0); bp++; while (isspace(*bp)) bp++; goto again; } char * trim(cp) register char *cp; { register char *dp; for (dp = cp; *dp; dp++) if (*dp == '/') cp = dp + 1; if (cp[0] != '.') { if (cp + 3 <= dp && dp[-2] == '.' && any(dp[-1], "cosa12345678npP")) dp[-2] = 0; if (cp + 4 <= dp && dp[-3] == '.' && any(dp[-2], "13") && isalpha(dp[-1])) dp[-3] = 0; } return (cp); } system(s) char *s; { int status, pid, w; if ((pid = vfork()) == 0) { execl("/bin/sh", "sh", "-c", s, 0); _exit(127); } while ((w = wait(&status)) != pid && w != -1) ; if (w == -1) status = -1; return (status); } *dp; for (dp = cp; *dp; dp++) if (*dp == '/') cp = dp + 1; if (cp[0] != '.') { if (cp + 3 <= dp && dp[-2] == '.' && anycmd/man/makefile 644 0 33 231 2247652067 7037 all: cc -O man.c -o man install: cp man.sh ${DESTDIR}/usr/bin/man chmod 755 ${DESTDIR}/usr/bin/man cp man ${DESTDIR}/usr/ucb/man clean: rm -f man } system(s) char *s; { int status, pid, w; if ((pid = vfork()) == 0) { execl("/bin/sh", "sh", "-c", s, 0); _exit(127); } while ((w = wait(&status)) != pid && w != -1) ; if (w == -1) status = -1; return (status); } *dp; for (dp = cp; *dp; dp++) if /,5x< /,"cmd/lint/ 775 0 33 0 2552550644 5470 cmd/lint/Makefile 644 0 33 3156 2423762211 7210 M=../mip LOAD1=-s LOAD2=-s CFLAGS=-O -DFLEXNAMES head: lpass1 lpass2 llib-port.ln llib-lc.ln; lpass1: cgram.o xdefs.o scan.o comm1.o pftn.o trees.o optim.o lint.o cc $(LOAD1) cgram.o xdefs.o scan.o comm1.o pftn.o trees.o optim.o lint.o mv a.out lpass1 trees.o: $M/manifest macdefs $M/mfile1 $M/trees.c cc -c $(CFLAGS) -I$M -I. $M/trees.c optim.o: $M/manifest macdefs $M/mfile1 $M/optim.c cc -c $(CFLAGS) -I$M -I. $M/optim.c pftn.o: $M/manifest macdefs $M/mfile1 $M/pftn.c cc -c $(CFLAGS) -I$M -I. $M/pftn.c lint.o: $M/manifest macdefs $M/mfile1 lmanifest cc -c $(CFLAGS) -I$M -I. lint.c scan.o: $M/manifest macdefs $M/mfile1 $M/scan.c cc -c $(CFLAGS) -I$M -I. $M/scan.c xdefs.o: $M/manifest $M/mfile1 macdefs $M/xdefs.c cc -c $(CFLAGS) -I$M -I. $M/xdefs.c cgram.o: $M/manifest $M/mfile1 macdefs cgram.c cc -c $(CFLAGS) -I$M -I. cgram.c cgram.c: $M/cgram.y yacc $M/cgram.y mv y.tab.c cgram.c comm1.o: $M/manifest $M/mfile1 $M/common macdefs $M/comm1.c cc -c $(CFLAGS) -I. -I$M $M/comm1.c llib-port.ln: llib-port lpass1 -(/lib/cpp -C -Dlint llib-port | lpass1 -puv > llib-port.ln ) llib-lc.ln: llib-lc lpass1 -(/lib/cpp -C -Dlint llib-lc | lpass1 -v > llib-lc.ln ) shrink: rm *.o clean: shrink rm lpass1 lpass2 cgram.c llib-lc.ln llib-port.ln lpass2: lpass2.o cc $(LOAD2) lpass2.o mv a.out lpass2 lpass2.o: $M/manifest lmanifest cc $(CFLAGS) -c -I$M -I. lpass2.c lintall: lint -hpv -I. -I$M $M/cgram.c $M/xdefs.c $M/scan.c $M/pftn.c $M/trees.c $M/optim.c lint.c install: head cp lpass1 ${DESTDIR}/usr/lib/lint/lint1 cp lpass2 ${DESTDIR}/usr/lib/lint/lint2 cp llib-* ${DESTDIR}/usr/lib/lint cp SHELL ${DESTDIR}/usr/bin/lint -Dlint llib-lc | lpass1 -v > llib-lc.ln ) shrink: rm *.o clean: shrink rm lpass1 lpass2 cgram.c llib-lc.ln llib-port.ln lpass2: lpass2.o cc $(LOAD2) lpass2.o mv a.out lpass2 lpass2.o: $M/manifest lmanifest cc $(CFLAGS) -c -I$M -I. lpass2.c lintall: lint -hpv -I. -I$M $M/cgram.c $M/xdefs.c $M/scan.c $M/pftn.c $M/trees.c $M/optim.c lint.c install: head cp lpass1 ${DESTDIR}/usr/lib/lint/lint1 cmd/lint/llib-lc 644 0 33 7415 2416445067 7024 /* LINTLIBRARY */ #include #include #include #include #include #include int errno; int alarm(s) unsigned s; { return(s); } char *brk(a) char *a; { return(a); } int chdir(s) char *s; { return(0); } int chmod(s, m) char *s; { return(0); } int chown(s, u, g) char *s; { return(0); } int close(f) { return(0); } int creat(s, m) char *s; { return(0); } int dup(f) { return(f); } /* VARARGS */ execl(f, a) char *f, *a; {;} execv(s, v) char *s, *v[((]; {;} exit(s) {;} int fork() { return(0); } int fstat(f, b) struct stat *b; { return(0); } int getgid() { return(1); } int getegid() { return(1); } int getpid() { return(1); } int getuid() { return(1); } int geteuid() { return(1); } int gtty(f, b) struct sgttyb *b; { return(0); } int kill(p, s) { return(0); } int link(a, b) char *a, *b; { return(0); } long lseek(f, o, d) long o; { return(0); } int mknod(n, m, a) char *n; { return(0); } char *mktemp(p) char *p; { return(p);} int mount(s, n, f) char *s, *n; { return(0); } int nice(p) { return(0); } int open(f, m) char *f; { return(0); } pause() {;} int pipe(f) int f[2]; { return(0); } profil(b, s, o, i) char *b; {;} int ptrace(r, p, a, d) { return(0); } int read(f, b, l) char *b; { return(l); } char *sbrk(i) { return((char *)0); } int setgid(g) { return(0); } int setuid(u) { return(0); } int (*signal(c, f))() int (*f)(); { return(f); } int stat(s, b) char *s; struct stat *b; { return(0); } char *strcat(a, b) char *a, *b; { ; } int strcmp(a, b) char *a, *b; { return(1); } char *strcpy(a, b) char *a, *b; { ; } int strlen(s) char *s; { return(1); } int stty(f, b) struct sgttyb *b; { return(0); } long tell(f) { return((long)0); } int system(s) char *s; { return(0); } time_t time(t) time_t *t; { return( 0 );} int unlink(s) char *s; { return(0); } int wait(s) int *s; { return(1); } int write(f, b, l) char *b; { return(l); } char *calloc(n,s) unsigned n, s; { static char c[1]; return(c); } char *malloc(n) unsigned n; {static char c; return(&c);} char *realloc(p, n) char *p; unsigned n; { static char c; return(&c);} free(p) char *p; {;} fclose(f) FILE *f; {return(0);} fflush(f) FILE *f; {return(0);} char *fgets( s, l, f ) char *s; FILE *f; { return(s); } FILE *fopen(s,m) char *s, *m; { return(stdin); } FILE *freopen(s, m, f) char *s, *m; FILE *f; { return(stdin); } FILE *fdopen(fd, m) char *m; { return(stdin);} /* VARARGS */ fprintf( f, s ) FILE *f; char *s; {;} fputs(s,f) char *s; FILE *f; {;} fread( p, s, n, f ) char *p; FILE *f; {return(1);} /* VARARGS */ fscanf( f, s ) FILE *f; char *s; {return(1);} int fwrite( p, s, n, f ) char *p; FILE *f; {return(0);} intss(){return(1); } /* VARARGS */ printf( s ) char *s; {;} rewind(f) FILE *f; {;} long ftell(f) FILE *f; { return(0L); } fseek(f, o, p) FILE *f; long o; { return(0); } /* VARARGS */ scanf( f ) char *f; {return(1); } setbuf( f, b ) FILE *f; char *b; {;} /* VARARGS */ char *sprintf( s, f ) char *s, *f; { return(s);} /* VARARGS */ sscanf( s, f ) char *s, *f; { return(1); } ungetc( c, f ) FILE *f; { return(c); } char *ctime(c) time_t *c;{ return(""); } struct tm *localtime(c) time_t *c; { return localtime(c); } struct tm *gmtime(c) time_t *c; { return gmtime(c); } char *asctime(t) struct tm *t; { return(""); } abort() {} int abs(i) int i; { return(i); } double atof(s) char *s; { return(1.); } char *crypt(k,s) char *k, *s; { return(""); } setkey(k) char *k; {} encrypt(s, i) char *s; {} char *ecvt(v, n, d, s) double v; int *d, *s; { return(""); } char *fcvt(v, n, d, s) double v; int *d, *s; { return(""); } char *gcvt(v, n, b) double v; char *b; { return(""); } monitor(l, h, b, s, n) int (*l)(), (*h)(); short *b; {} perror(s) char *s; {} #include setjmp(e) jmp_buf e; { return(0); } sleep(i) unsigned i; {} struct _iobuf _iob[_NFILE]; char _ctype_[]; atof(s) char *s; { return(1.); } char *crypt(k,s) char *k, *s; { return(""); } setkey(k) char *k; {} encrypt(s, i) char *s; {} char *ecvt(v, n, d, s) double v; int *d, *s; { return(""); } char *fcvt(v, n, d, s) double v; int *d, *s; { returncmd/lint/READ_ME 644 0 33 240 2351312307 6533 Most of lint's source files are shared with the portable compiler: they are found in /usr/src/cmd/mip. The files here are only those which are unique to lint. h> setjmp(e) jmp_buf e; { return(0); } sleep(i) unsigned i; {} struct _iobuf _iob[_NFILE]; char _ctype_[]; atof(s) char *s; { return(1.); } char *crypt(k,s) char *k, *s; { return(""); } setkey(k) char *k; {} encrypt(s, i) char *s; {} char *ecvt(v, n, d, s)/,5x< /,"cmd/lint/SHELL 755 0 33 773 2420745324 6332 L=/usr/lib/lint/lint T=/usr/tmp/lint.$$ PATH=/bin:/usr/bin O="-C -Dlint" X= P=unix LL=/usr/lib/lint trap "rm -f $T; exit" 1 2 15 for A in $* do case $A in -*n*) P= ;; -*p*) P=port ;; esac case $A in *.ln) cat $A >>$T ;; -l*) cat $LL/llib$A.ln >>$T ;; -[IDOU]*) O="$O $A" ;; -X) LL=/usr/scj/lint L=/usr/scj/lint/lpass ;; -*) X="$X$A" ;; *) (/lib/cpp $O $A | ${L}1 $X >>$T)2>&1 esac done case $P in unix) cat $LL/llib-lc.ln >>$T ;; port) cat $LL/llib-port.ln >>$T ;; esac ${L}2 $T $X rm -f $T "cmd/lint/lint.c 644 0 33 50340 2407224443 6701 # include "mfile1" # include "lmanifest" # include # define VAL 0 # define EFF 1 /* these are appropriate for the -p flag */ int SZCHAR = 8; int SZINT = 16; int SZFLOAT = 32; int SZDOUBLE = 64; int SZLONG = 32; int SZSHORT = 16; int SZPOINT = 16; int ALCHAR = 8; int ALINT = 16; int ALFLOAT = 32; int ALDOUBLE = 64; int ALLONG = 32; int ALSHORT = 16; int ALPOINT = 16; int ALSTRUCT = 16; int vflag = 1; /* tell about unused argments */ int xflag = 0; /* tell about unused externals */ int argflag = 0; /* used to turn off complaints about arguments */ int libflag = 0; /* used to generate library descriptions */ int vaflag = -1; /* used to signal functions with a variable number of args */ int aflag = 0; /* used to check precision of assignments */ /* flags for the "outdef" function */ # define USUAL (-101) # define DECTY (-102) # define NOFILE (-103) # define SVLINE (-104) # define LNAMES 250 struct lnm { short lid, flgs; } lnames[LNAMES], *lnp; contx( p, down, pl, pr ) register NODE *p; register *pl, *pr; { *pl = *pr = VAL; switch( p->in.op ){ case ANDAND: case OROR: case QUEST: *pr = down; break; case SCONV: case PCONV: case COLON: *pr = *pl = down; break; case COMOP: *pl = EFF; *pr = down; case FORCE: case INIT: case UNARY CALL: case STCALL: case UNARY STCALL: case CALL: case UNARY FORTCALL: case FORTCALL: case CBRANCH: break; default: if( asgop(p->in.op) ) break; if( p->in.op == UNARY MUL && ( p->in.type == STRTY || p->in.type == UNIONTY || p->in.type == UNDEF) ) { /* struct x f( ); main( ) { (void) f( ); } * the the cast call appears as U* UNDEF */ break; /* the compiler does this... */ } if( down == EFF && hflag ) werror( "null effect" ); } } ecode( p ) NODE *p; { /* compile code for p */ fwalk( p, contx, EFF ); lnp = lnames; lprt( p, EFF, 0 ); } ejobcode( flag ){ /* called after processing each job */ /* flag is nonzero if errors were detected */ register k; register struct symtab *p; for( p=stab; p< &stab[SYMTSZ]; ++p ){ if( p->stype != TNULL ) { if( p->stype == STRTY || p->stype == UNIONTY ){ if( dimtab[p->sizoff+1] < 0 ){ /* never defined */ #ifndef FLEXNAMES if( hflag ) werror( "struct/union %.8s never defined", p->sname ); #else if( hflag ) werror( "struct/union %s never defined", p->sname ); #endif } } switch( p->sclass ){ case STATIC: if( p->suse > 0 ){ k = lineno; lineno = p->suse; #ifndef FLEXNAMES uerror( "static variable %.8s unused", #else uerror( "static variable %s unused", #endif p->sname ); lineno = k; break; } case EXTERN: case USTATIC: /* with the xflag, worry about externs not used */ /* the filename may be wrong here... */ if( xflag && p->suse >= 0 && !libflag ){ outdef( p, LDX, NOFILE ); } case EXTDEF: if( p->suse < 0 ){ /* used */ outdef( p, LUM, SVLINE ); } break; } } } exit( 0 ); } astype( t, i ) ATYPE *t; { TWORD tt; int j, k=0; if( (tt=BTYPE(t->aty))==STRTY || tt==UNIONTY ){ if( i<0 || i>= DIMTABSZ-3 ){ werror( "lint's little mind is blown" ); } else { j = dimtab[i+3]; if( j<0 || j>SYMTSZ ){ k = ((-j)<<5)^dimtab[i]|1; } else { if( stab[j].suse <= 0 ) { #ifndef FLEXNAMES werror( "no line number for %.8s", #else werror( "no line number for %s", #endif stab[j].sname ); } else k = (stab[j].suse<<5) ^ dimtab[i]; } } t->extra = k; return( 1 ); } else return( 0 ); } bfcode( a, n ) int a[]; { /* code for the beginning of a function; a is an array of indices in stab for the arguments; n is the number */ /* this must also set retlab */ register i; register struct symtab *cfp; static ATYPE t; retlab = 1; cfp = &stab[curftn]; /* if variable number of arguments, only print the ones which will be checked */ if( vaflag > 0 ){ if( n < vaflag ) werror( "declare the VARARGS arguments you want checked!" ); else n = vaflag; } fsave( ftitle ); outde((f( cfp, libflag?LIB:LDI, vaflag>=0?-n:n ); vaflag = -1; /* output the arguments */ if( n ){ for( i=0; iin.op == CM ){ ++c; p = p->in.left; } return( c ); } lpta( p ) NODE *p; { static ATYPE t; if( p->in.op == CM ){ lpta( p->in.left ); p = p->in.right; } t.aty = p->in.type; t.extra = (p->in.op==ICON); if( !astype( &t, p->in.csiz ) ) { switch( t.aty ){ case CHAR: case SHORT: t.aty = INT; case LONG: case ULONG: case INT: case UNSIGNED: break; case UCHAR: case USHORT: t.aty = UNSIGNED; break; case FLOAT: t.aty = DOUBLE; t.extra = 0; break; default: t.extra = 0; break; } } fwrite( (char *)&t, sizeof(ATYPE), 1, stdout ); } # define VALSET 1 # define VALUSED 2 # define VALASGOP 4 # define VALADDR 8 lprt( p, down, uses ) register NODE *p; { register struct symtab *q; register id; register acount; register down1, down2; register use1, use2; register struct lnm *np1, *np2; /* first, set variables which are set... */ use1 = use2 = VALUSED; if( p->in.op == ASSIGN ) use1 = VALSET; else if( p->in.op == UNARY AND ) use1 = VALADDR; else if( asgop( p->in.op ) ){ /* =ops */ use1 = VALUSED|VALSET; if( down == EFF ) use1 |= VALASGOP; } /* print the lines for lint */ down2 = down1 = VAL; acount = 0; switch( p->in.op ){ case EQ: case NE: case GT: case GE: case LT: case LE: if( p->in.left->in.type == CHAR && p->in.right->in.op==ICON && p->in.right->tn.lval < 0 ){ werror( "nonportable character comparison" ); } if( (p->in.op==EQ || p->in.op==NE ) && ISUNSIGNED(p->in.left->in.type) && p->in.right->in.op == ICON ){ if( p->in.right->tn.lval < 0 && p->in.right->tn.rval == NONAME && !ISUNSIGNED(p->in.right->in.type) ){ werror( "comparison of unsigned with negative constant" ); } } break; case UGE: case ULT: if( p->in.right->in.op == ICON && p->in.right->tn.lval == 0 && p->in.right->tn.rval == NONAME ){ werror( "unsigned comparison with 0?" ); break; } case UGT: case ULE: if( p->in.right->in.op == ICON && p->in.right->tn.lval <= 0 && !ISUNSIGNED(p->in.right->in.type) && p->in.right->tn.rval == NONAME ){ werror( "degenerate unsigned comparison" ); } break; case COMOP: down1 = EFF; case ANDAND: case OROR: case QUEST: down2 = down; /* go recursively left, then right */ np1 = lnp; lprt( p->in.left, down1, use1 ); np2 = lnp; lprt( p->in.right, down2, use2 ); lmerge( np1, np2, 0 ); return; case SCONV: case PCONV: case COLON: down1 = down2 = down; break; case CALL: case STCALL: case FORTCALL: acount = ctargs( p->in.right ); case UNARY CALL: case UNARY STCALL: case UNARY FORTCALL: if( p->in.left->in.op == ICON && (id=p->in.left->tn.rval) != NONAME ){ /* used to be &name */ struct symtab *sp = &stab[id]; int lty; /* if a function used in an effects context is * cast to type void then consider its value * to have been disposed of properly * thus a call of type undef in an effects * context is construed to be used in a value * context */ if ((down == EFF) && (p->in.type != UNDEF)) { lty = LUE; } else if (down == EFF) { lty = LUV | LUE; } else { lty = LUV; } fsave( ftitle ); outdef(sp, lty, acount); if( acount ) { lpta( p->in.right ); } } break; case ICON: /* look for &name case */ if( (id = p->tn.rval) >= 0 && id != NONAME ){ q = &stab[id]; q->sflags |= (SREF|SSET); q->suse = -lineno; } return; case NAME: if( (id = p->tn.rval) >= 0 && id != NONAME ){ q = &stab[id]; if( (uses&VALUSED) && !(q->sflags&SSET) ){ if( q->sclass == AUTO || q->sclass == REGISTER ){ if( !ISARY(q->stype ) && !ISFTN(q->stype) && q->stype!=STRTY ){ #ifndef FLEXNAMES werror( "%.8s may be used before set", q->sname ); #else werror( "%s may be used before set", q->sname ); #endif q->sflags |= SSET; } } } if( uses & VALASGOP ) break; /* not a real use */ if( uses & VALSET ) q->sflags |= SSET; if( uses & VALUSED ) q->sflags |= SREF; if( uses & VALADDR ) q->sflags |= (SREF|SSET); if( p->tn.lval == 0 ){ lnp->lid = id; lnp->flgs = (uses&VALADDR)?0:((uses&VALSET)?VALSET:VALUSED); if( ++lnp >= &lnames[LNAMES] ) --lnp; } } return; } /* recurse, going down the right side first if we can */ switch( optype(p->in.op) ){ case BITYPE: np1 = lnp; lprt( p->in.right, down2, use2 ); case UTYPE: np2 = lnp; lprt( p->in.left, down1, use1 ); } if( optype(p->in.op) == BITYPE ){ if( p->in.op == ASSIGN && p->in.left->in.op == NAME ){ /* special case for a = .. a .. */ lmerge( np1, np2, 0 ); } else lmerge( np1, np2, p->in.op != COLON ); /* look for assignments to fields, and complain */ if( p->in.op == ASSIGN && p->in.left->in.op == FLD && p->in.right->in.op == ICON ) fldcon( p ); } } lmerge( np1, np2, flag ) struct lnm *np1, *np2; { /* np1 and np2 point to lists of lnm members, for the two sides * of a binary operator * flag is 1 if commutation is possible, 0 otherwise * lmerge returns a merged list, starting at np1, resetting lnp * it also complains, if appropriate, about side effects */ register struct lnm *npx, *npy; for( npx = np2; npx < lnp; ++npx ){ /* is it already there? */ for( npy = np1; npy < np2; ++npy ){ if( npx->lid == npy->lid ){ /* yes */ if( npx->flgs == 0 || npx->flgs == (VALSET|VALUSED) ) ; /* do nothing */ else if( (npx->flgs|npy->flgs)== (VALSET|VALUSED) || (npx->flgs&npy->flgs&VALSET) ){ #ifndef FLEXNAMES if( flag ) werror( "%.8s evaluation order undefined", stab[npy->lid].sname ); #else if( flag ) werror( "%s evaluation order undefined", stab[npy->lid].sname ); #endif } if( npy->flgs == 0 ) npx->flgs = 0; else npy->flgs |= npx->flgs; goto foundit; } } /* not there: update entry */ np2->lid = npx->lid; np2->flgs = npx->flgs; ++np2; foundit: ; } /* all finished: merged list is at np1 */ lnp = np2; } efcode(){ /* code for the end of a function */ register struct symtab *cfp; cfp = &stab[curftn]; if( retstat & RETVAL ) outdef( cfp, LRV, DECTY ); if( !vflag ){ vflag = argflag; argflag = 0; } if( retstat == RETVAL+NRETVAL ) #ifndef FLEXNAMES werror( "function %.8s has return(e); and return;", cfp->sname); #else werror( "function %s has return(e); and return;", cfp->sname); #endif } aocode(p) struct symtab *p; { /* called when automatic p removed from stab */ register struct symtab *cfs; cfs = &stab[curftn]; if(p->suse>0 && !(p->sflags&(SMOS|STAG)) ){ if( p->sclass == PARAM ){ #ifndef FLEXNAMES if( vflag ) werror( "argument %.8s unused in function %.8s", #else if( vflag ) werror( "argument %s unused in function %s", #endif p->sname, cfs->sname ); } else { #ifndef FLEXNAMES if( p->sclass != TYPEDEF ) werror( "%.8s unused in function %.8s", #else if( p->sclass != TYPEDEF ) werror( "%s unused in function %s", #endif p->sname, cfs->sname ); } } if( p->suse < 0 && (p->sflags & (SSET|SREF|SMOS)) == SSET && !ISARY(p->stype) && !ISFTN(p->stype) ){ #ifndef FLEXNAMES werror( "%.8s set but not used in function %.8s", p->sname, cfs->sname ); #else werror( "%s set but not used in function %s", p->sname, cfs->sname ); #endif } if( p->stype == STRTY || p->stype == UNIONTY || p->stype == ENUMTY ){ #ifndef FLEXNAMES if( dimtab[p->sizoff+1] < 0 ) werror( "structure %.8s never defined", p->sname ); #else if( dimtab[p->sizoff+1] < 0 ) werror( "structure %s never defined", p->sname ); #endif } } defnam( p ) register struct symtab *p; { /* define the current location as the name p->sname */ if( p->sclass == STATIC && p->slevel>1 ) return; if( !ISFTN( p->stype ) ) outdef( p, libflag?LIB:LDI, USUAL ); } zecode( n ){ /* n integer words of zeros */ OFFSZ temp; temp = n; inoff += temp*SZINT; ; } andable( p ) NODE *p; { /* p is a NAME node; can it accept & ? */ register r; if( p->in.op != NAME ) cerror( "andable error" ); if( (r = p->tn.rval) < 0 ) return(1); /* labels are andable */ if( stab[r].sclass == AUTO || stab[r].sclass == PARAM ) return(0); #ifndef FLEXNAMES if( stab[r].sclass == REGISTER ) uerror( "can't take & of %.8s", stab[r].sname ); #else if( stab[r].sclass == REGISTER ) uerror( "can't take & of %s", stab[r].sname ); #endif return(1); } NODE * clocal(p) NODE *p; { /* this is called to do local transformations on an expression tree preparitory to its being written out in intermediate code. */ /* the major essential job is rewriting the automatic variables and arguments in terms of REG and OREG nodes */ /* conversion ops which are not necessary are also clobbered here */ /* in addition, any special features (such as rewriting exclusive or) are easily handled here as well */ register o; register unsigned t, tl; switch( o = p->in.op ){ case SCONV: case PCONV: if( p->in.left->in.type==ENUMTY ){ p->in.left = pconvert( p->in.left ); } /* assume conversion takes place; type is inherited */ t = p->in.type; tl = p->in.left->in.type; if( aflag && (tl==LONG||tl==ULONG) && (t!=LONG&&t!=ULONG) ){ werror( "long assignment may lose accuracy" ); } if( aflag>=2 && (tl!=LONG&&tl!=ULONG) && (t==LONG||t==ULONG) && p->in.left->in.op != ICON ){ werror( "assignment to long may sign-extend incorrectly" ); } if( ISPTR(tl) && ISPTR(t) ){ tl = DECREF(tl); t = DECREF(t); switch( ISFTN(t) + ISFTN(tl) ){ case 0: /* neither is a function pointer */ if( talign(t,p->fn.((csiz) > talign(tl,p->in.left->fn.csiz) ){ if( hflag||pflag ) werror( "possible pointer alignment problem" ); } break; case 1: werror( "questionable conversion of function pointer" ); case 2: ; } } p->in.left->in.type = p->in.type; p->in.left->fn.cdim = p->fn.cdim; p->in.left->fn.csiz = p->fn.csiz; p->in.op = FREE; return( p->in.left ); case PVCONV: case PMCONV: if( p->in.right->in.op != ICON ) cerror( "bad conversion"); p->in.op = FREE; return( buildtree( o==PMCONV?MUL:DIV, p->in.left, p->in.right ) ); } return(p); } NODE * offcon( off, t, d, s ) OFFSZ off; TWORD t;{ /* make a structure offset node */ register NODE *p; p = bcon(0); p->tn.lval = off/SZCHAR; return(p); } noinit(){ /* storage class for such as "int a;" */ return( pflag ? EXTDEF : EXTERN ); } cinit( p, sz ) NODE *p; { /* initialize p into size sz */ inoff += sz; if( p->in.op == INIT ){ if( p->in.left->in.op == ICON ) return; if( p->in.left->in.op == NAME && p->in.left->in.type == MOE ) return; } uerror( "illegal initialization" ); } char * exname( p ) char *p; { /* make a name look like an external name in the local machine */ static char aa[8]; register int i; if( !pflag ) return(p); for( i=0; i<6; ++i ){ if( isupper(*p ) ) aa[i] = tolower( *p ); else aa[i] = *p; if( *p ) ++p; } aa[6] = '\0'; return( aa ); } char * strip(s) char *s; { #ifndef FLEXNAMES static char x[LFNM+1]; #else static char x[BUFSIZ]; #endif register char *p; for( p=x; *s; ++s ){ if( *s == '/' ) p=x; else if( *s != '"' ){ #ifndef FLEXNAMES /* PATCHED by ROBERT HENRY on 8Jul80 to fix 14 character file name bug */ if( p >= &x[LFNM] ) cerror( "filename too long" ); #endif *p++ = *s; } } *p = '\0'; #ifndef FLEXNAMES return( x ); #else return( hash(x) ); #endif } fsave( s ) char *s; { static union rec fsname; s = strip( s ); #ifndef FLEXNAMES if( strncmp( s, fsname.f.fn, LFNM ) ){ #else if( strcmp(s, fsname.f.fn)) { #endif /* new one */ #ifndef FLEXNAMES strncpy( fsname.f.fn, s, LFNM ); #else fsname.f.fn = s; #endif fsname.f.decflag = LFN; fwrite( (char *)&fsname, sizeof(fsname), 1, stdout ); #ifdef FLEXNAMES fwrite( fsname.f.fn, strlen(fsname.f.fn)+1, 1, stdout ); #endif } } where(f){ /* print true location of error */ if( f == 'u' && nerrors>1 ) --nerrors; /* don't get "too many errors" */ fprintf( stderr, "%s(%d): ", (f == 'c') ? ftitle : strip(ftitle), lineno ); } /* a number of dummy routines, unneeded by lint */ branch(n){;} defalign(n){;} deflab(n){;} bycode(t,i){;} cisreg(t) TWORD t; {return(1);} /* everyting is a register variable! */ fldty(p) struct symtab *p; { ; /* all types are OK here... */ } fldal(t) unsigned t; { /* field alignment... */ if( t == ENUMTY ) return( ALCHAR ); /* this should be thought through better... */ if( ISPTR(t) ){ /* really for the benefit of honeywell (and someday IBM) */ if( pflag ) uerror( "nonportable field type" ); } else uerror( "illegal field type" ); return(ALINT); } main( argc, argv ) char *argv[]; { char *p; /* handle options */ for( p=argv[1]; argc>1 && *p; ++p ){ switch( *p ){ case '-': continue; case '\0': break; case 'b': brkflag = 1; continue; case 'p': pflag = 1; continue; case 'c': cflag = 1; continue; case 's': /* for the moment, -s triggers -h */ case 'h': hflag = 1; continue; case 'L': libflag = 1; case 'v': vflag = 0; continue; case 'x': xflag = 1; continue; case 'a': ++aflag; case 'u': /* done in second pass */ case 'n': /* done in shell script */ continue; case 't': werror( "option %c now default: see `man 6 lint'", *p ); continue; default: uerror( "illegal option: %c", *p ); continue; } } if( !pflag ){ /* set sizes to sizes of target machine */ # ifdef gcos SZCHAR = ALCHAR = 9; # else SZCHAR = ALCHAR = 8; # endif SZINT = ALINT = sizeof(int)*SZCHAR; SZFLOAT = ALFLOAT = sizeof(float)*SZCHAR; SZDOUBLE = ALDOUBLE = sizeof(double)*SZCHAR; SZLONG = ALLONG = sizeof(long)*SZCHAR; SZSHORT = ALSHORT = sizeof(short)*SZCHAR; SZPOINT = ALPOINT = sizeof(int *)*SZCHAR; ALSTRUCT = ALINT; /* now, fix some things up for various machines (I wish we had "alignof") */ # ifdef pdp11 ALLONG = ALDOUBLE = ALFLOAT = ALINT; #endif # ifdef ibm ALSTRUCT = ALCHAR; #endif } return( mainp1( argc, argv ) ); } ctype( type ) unsigned type; { /* are there any funny types? */ return( type ); } commdec( i ){ /* put out a common declaration */ outdef( &stab[i], libflag?LIB:LDC, USUAL ); } isitfloat ( s ) char *s; { /* s is a character string; if floating point is implemented, set dcon to the value of s */ /* lint version */ dcon = atof( s ); return( FCON ); } fldcon( p ) register NODE *p; { /* p is an assignment of a constant to a field */ /* check to see if the assignment is going to overflow, or otherwise cause trouble */ register s; CONSZ v; if( !hflag & !pflag ) return; s = UPKFSZ(p->in.left->tn.rval); v = p->in.right->tn.lval; switch( p->in.left->in.type ){ case CHAR: case INT: case SHORT: case LONG: case ENUMTY: if( v>=0 && (v>>(s-1))==0 ) return; werror( "precision lost in assignment to (possibly sign-extended) field" ); default: return; case UNSIGNED: case UCHAR: case USHORT: case ULONG: if( v<0 || (v>>s)!=0 ) werror( "precision lost in field assignment" ); return; } } outdef( p, lty, mode ) struct symtab *p; { /* output a definition for the second pass */ /* if mode is > USUAL, it is the number of args */ char *fname; TWORD t; int line; static union rec rc; if( mode == NOFILE ){ fname = "???"; line = p->suse; } else if( mode == SVLINE ){ fname = ftitle; line = -p->suse; } else { fname = ftitle; line = lineno; } fsave( fname ); #ifndef FLEXNAMES strncpy( rc.l.name, exname(p->sname), LCHNM ); #endif rc.l.decflag = lty; t = p->stype; if( mode == DECTY ) t = DECREF(t); rc.l.type.aty = t; rc.l.type.extra = 0; astype( &rc.l.type, p->sizoff ); rc.l.nargs = (mode>USUAL) ? mode : 0; rc.l.fline = line; fwrite( (char *)&rc, sizeof(rc), 1, stdout ); #ifdef FLEXNAMES rc.l.name = exname(p->sname); fwrite( rc.l.name, strlen(rc.l.name)+1, 1, stdout ); #endif } int proflg; int gdebug; = ftitle; line = lineno; } fsave( fname ); #ifndef FLEXNAMES strncpy( rc.l.name, exname(p->sname), LCHNM ); #endif rc.l.decflag = lty; t = p->stype; if( mode == DECTY ) t = DECREF(t); rc.l.type.aty = t; rc.l.type.extra = 0; astype( &rc.l.type, p->sizoff ); rc.l.nargs = (modcmd/lint/lpass2.c 644 0 33 31202 2551527136 7140 # include "manifest" # include "lmanifest" # define USED 01 # define VUSED 02 # define EUSED 04 # define RVAL 010 # define VARARGS 0100 # define NSZ 2048 # define TYSZ 3500 # define FSZ 250 # define NTY 50 typedef struct sty STYPE; struct sty { ATYPE t; STYPE *next; }; typedef struct sym { #ifndef FLEXNAMES char name[LCHNM]; #else char *name; #endif short nargs; int decflag; int fline; STYPE symty; int fno; int use; } STAB; STAB stab[NSZ]; STAB *find(); STYPE tary[TYSZ]; STYPE *tget(); #ifndef FLEXNAMES char fnm[FSZ][LFNM]; #else char *fnm[FSZ]; #endif #ifdef FLEXNAMES char *getstr(); #endif int tfree; /* used to allocate types */ int ffree; /* used to save filenames */ struct ty atyp[NTY]; /* r is where all the input ends up */ union rec r; int hflag = 0; int pflag = 0; int xflag = 0; int uflag = 1; int ddddd = 0; int cfno; /* current file number */ main( argc, argv ) char *argv[]; { register char *p; /* first argument is intermediate file */ /* second argument is - options */ for( ; argc>2 && argv[argc-1][0] == '-' ; --argc ){ for( p=argv[argc-1]; *p; ++p ){ switch( *p ){ case 'h': hflag = 1; break; case 'p': pflag = 1; break; case 'x': xflag = 1; break; case 'X': ddddd = 1; break; case 'u': uflag = 0; break; } } } if( argc < 2 || !freopen( argv[1], "r", stdin ) ){ error( "cannot open intermediate file" ); exit( 1 ); } mloop( LDI|LIB ); rewind( stdin ); mloop( LDC|LDX ); rewind( stdin ); mloop( LRV|LUV|LUE|LUM ); cleanup(); return(0); } mloop( m ){ /* do the main loop */ register STAB *q; while( lread(m) ){ q = find(); if( q->decflag ) chkcompat(q); else setuse(q); } } lread(m){ /* read a line into r.l */ register n; for(;;) { if( fread( (char *)&r, sizeof(r), 1, stdin ) <= 0 ) return(0); if( r.l.decflag & LFN ){ /* new filename */ #ifdef FLEXNAMES r.f.fn = getstr(); #endif setfno( r.f.fn ); continue; } #ifdef FLEXNAMES r.l.name = getstr(); #endif n = r.l.nargs; if( n<0 ) n = -n; if( n ){ if( n>=NTY ) error( "more than %d args?", n ); fread( (char *)atyp, sizeof(ATYPE), n, stdin ); } if( ( r.l.decflag & m ) ) return( 1 ); } } setfno( s ) char *s; { /* look up current file names */ /* first, strip backwards to the beginning or to the first / */ int i; /* now look up s */ for( i=0; i= FSZ ) error( "more than %d files", FSZ ); #ifndef FLEXNAMES strncpy( fnm[ffree], s, LFNM ); #else fnm[ffree] = s; #endif cfno = ffree++; } /* VARARGS */ error( s, a ) char *s; { #ifndef FLEXNAMES fprintf( stderr, "pass 2 error:(file %.*s) ", LFNM, fnm[cfno] ); #else fprintf( stderr, "pass 2 error:(file %s) ", fnm[cfno] ); #endif fprintf( stderr, s, a ); fprintf( stderr, "\n" ); exit(1); } STAB * find(){ /* for this to work, NSZ should be a power of 2 */ register h=((0; #ifndef FLEXNAMES { register char *p, *q; for( h=0,p=r.l.name,q=p+LCHNM; *p&&p=NSZ ){ h = (h+1)&(NSZ-1); } } } #else h = ((int)r.l.name)%NSZ; #endif { register STAB *p, *q; for( p=q= &stab[h]; q->decflag; ){ /* this call to strncmp should be taken out... */ #ifndef FLEXNAMES if( !strncmp( r.l.name, q->name, LCHNM)) return(q); #else if (r.l.name == q->name) return (q); #endif if( ++q >= &stab[NSZ] ) q = stab; if( q == p ) error( "too many names defined" ); } #ifndef FLEXNAMES strncpy( q->name, r.l.name, LCHNM ); #else q->name = r.l.name; #endif return( q ); } } STYPE * tget(){ if( tfree >= TYSZ ){ error( "too many types needed" ); } return( &tary[tfree++] ); } chkcompat(q) STAB *q; { /* are the types, etc. in r.l and q compatible */ register int i; STYPE *qq; setuse(q); /* argument check */ if( q->decflag & (LDI|LIB|LUV|LUE) ){ if( r.l.decflag & (LUV|LIB|LUE) ){ if( q->nargs != r.l.nargs ){ if( !(q->use&VARARGS) ){ #ifndef FLEXNAMES printf( "%.8s: variable # of args.", q->name ); #else printf( "%s: variable # of args.", q->name ); #endif viceversa(q); } if( r.l.nargs > q->nargs ) r.l.nargs = q->nargs; if( !(q->decflag & (LDI|LIB) ) ) { q->nargs = r.l.nargs; q->use |= VARARGS; } } for( i=0,qq=q->symty.next; inext){ if( chktype( &qq->t, &atyp[i] ) ){ #ifndef FLEXNAMES printf( "%.8s, arg. %d used inconsistently", #else printf( "%s, arg. %d used inconsistently", #endif q->name, i+1 ); viceversa(q); } } } } if( (q->decflag&(LDI|LIB|LUV)) && r.l.decflag==LUV ){ if( chktype( &r.l.type, &q->symty.t ) ){ #ifndef FLEXNAMES printf( "%.8s value used inconsistently", q->name ); #else printf( "%s value used inconsistently", q->name ); #endif viceversa(q); } } /* check for multiple declaration */ if( (q->decflag&LDI) && (r.l.decflag&(LDI|LIB)) ){ #ifndef FLEXNAMES printf( "%.8s multiply declared", q->name ); #else printf( "%s multiply declared", q->name ); #endif viceversa(q); } /* do a bit of checking of definitions and uses... */ if( (q->decflag & (LDI|LIB|LDX|LDC|LUM)) && (r.l.decflag & (LDX|LDC|LUM)) && q->symty.t.aty != r.l.type.aty ){ #ifndef FLEXNAMES printf( "%.8s value declared inconsistently", q->name ); #else printf( "%s value declared inconsistently", q->name ); #endif viceversa(q); } /* better not call functions which are declared to be structure or union returning */ if( (q->decflag & (LDI|LIB|LDX|LDC)) && (r.l.decflag & LUE) && q->symty.t.aty != r.l.type.aty ){ /* only matters if the function returns union or structure */ TWORD ty; ty = q->symty.t.aty; if( ISFTN(ty) && ((ty = DECREF(ty))==STRTY || ty==UNIONTY ) ){ #ifndef FLEXNAMES printf( "%.8s function value type must be declared before use", q->name ); #else printf( "%s function value type must be declared before use", q->name ); #endif viceversa(q); } } if( pflag && q->decflag==LDX && r.l.decflag == LUM && !ISFTN(q->symty.t.aty) ){ /* make the external declaration go away */ /* in effect, it was used without being defined */ } } viceversa(q) STAB *q; { /* print out file comparison */ #ifndef FLEXNAMES printf( " %.*s(%d) :: %.*s(%d)\n", LFNM, fnm[q->fno], q->fline, LFNM, fnm[cfno], r.l.fline ); #else printf( " %s(%d) :: %s(%d)\n", fnm[q->fno], q->fline, fnm[cfno], r.l.fline ); #endif } /* messages for defintion/use */ char * mess[2][2] ={ "", #ifndef FLEXNAMES "%.8s used( %.*s(%d) ), but not defined\n", "%.8s defined( %.*s(%d) ), but never used\n", "%.8s declared( %.*s(%d) ), but never used or defined\n" #else "%s used( %s(%d) ), but not defined\n", "%s defined( %s(%d) ), but never used\n", "%s declared( %s(%d) ), but never used or defined\n" #endif }; lastone(q) STAB *q; { register nu, nd, uses; if( ddddd ) pst(q); nu = nd = 0; uses = q->use; if( !(uses&USED) && q->decflag != LIB ) { #ifndef FLEXNAMES if( strncmp(q->name,"main",7) ) #else if (strcmp(q->name, "main")) #endif nu = 1; } if( !ISFTN(q->symty.t.aty) ){ switch( q->decflag ){ case LIB: nu = nd = 0; /* don't complain about uses on libraries */ break; case LDX: if( !xflag ) break; case LUV: case LUE: /* 01/04/80 */ case LUV | LUE: case LUM: nd = 1; } } if( uflag && ( nu || nd ) ) printf( mess[nu][nd], #ifndef FLEXNAMES q->name, LFNM, fnm[q->fno], q->fline ); #else q->name, fnm[q->fno], q->fline ); #endif if( (uses&(RVAL+EUSED)) == (RVAL+EUSED) ){ #ifndef FLEXNAMES printf( "%.8s returns value which is %s ignored\n", q->name, #else printf( "%s returns value which is %s ignored\n", q->name, #endif uses&VUSED ? "sometimes" : "always" ); } if( (uses&(RVAL+VUSED)) == (VUSED) && (q->decflag&(LDI|LIB)) ){ #ifndef FLEXNAMES printf( "%.8s value is used, but none returned\n", q->name ); #else printf( "%s value is used, but none returned\n", q->name ); #endif } } cleanup(){ /* call lastone and die gracefully */ STAB *q; for( q=stab; q< &stab[NSZ]; ++q ){ if( q->decflag ) lastone(q); } exit(0); } setuse(q) STAB *q; { /* check new type to ensure that it is used */ if( !q->decflag ){ /* new one */ q->decflag = r.l.decflag; q->symty.t = r.l.type; if( r.l.nargs < 0 ){ q->nargs = -r.l.nargs; q->use = VARARGS; } else { q->nargs = r.l.nargs; q->use = 0; } q->fline = r.l.fline; q->fno = cfno; if( q->nargs ){ int i; STYPE *qq; for( i=0,qq= &q->symty; inargs; ++i,qq=qq->next ){ qq->next = tget(); qq->next->t = atyp[i]; } } } switch( r.l.decflag ){ case LRV: q->use |= RVAL; return; case LUV: q->use |= VUSED+USED; return; case LUE: q->use |= EUSED+USED; return; /* 01/04/80 */ case LUV | LUE: case LUM: q->use |= USED; return; } } chktype( pt1, pt2 ) register ATYPE *pt1, *pt2; { TWORD t; /* check the two type words to see if they are compatible */ /* for the moment, enums are turned into ints, and should be checked as such */ if( pt1->aty == ENUMTY ) pt1->aty = INT; if( pt2->aty == ENUMTY ) pt2->aty = INT; if( (t=BTYPE(pt1->aty)==STRTY) || t==UNIONTY ){ return( pt1->aty!=pt2->aty || ( pt1->extra!=pt2->extra ) ); } if( pt2->extra ){ /* constant passed in */ if( pt1->aty == UNSIGNED && pt2->aty == INT ) return( 0 ); else if( pt1->aty == ULONG && pt2->aty == LONG ) return( 0 ); } else if( pt1->extra ){ /* for symmetry */ if( pt2->aty == UNSIGNED && pt1->aty == INT ) return( 0 ); else if( pt2->aty == ULONG && pt1->aty == LONG ) return( 0 ); } return( pt1->aty != pt2->aty ); } struct tb { int m; char * nm }; ptb( v, tp ) struct tb *tp; { /* print a value from the table */ int flag; flag = 0; for( ; tp->m; ++tp ){ if( v&tp->m ){ if( flag++ ) putchar( '|' ); printf( "%s", tp->nm ); } } } pst( q ) STAB *q; { /* give a debugging output for q */ static struct tb dfs[] = { LDI, "LDI", LIB, "LIB", LDC, "LDC", LDX, "LDX", LRV, "LRV", LUV, "LUV", LUE, "LUE", LUM, "LUM", 0, "" }; static struct tb us[] = { USED, "USED", VUSED, "VUSED", EUSED, "EUSED", RVAL, "RVAL", VARARGS, "VARARGS", 0, 0, }; #ifndef FLEXNAMES printf( "%.8s (", q->name ); #else printf( "%s (", q->name ); #endif ptb( q->decflag, dfs ); printf( "), use= " ); ptb( q->use, us ); printf( ", line %d, nargs=%d\n", q->fline, q->nargs ); } #ifdef FLEXNAMES char * getstr() { char buf[BUFSIZ]; register char *cp = buf; register int c; if (feof(stdin) || ferror(stdin)) return(""); while ((c = getchar()) > 0) *cp++ = c; if (c < 0) { fprintf(stderr, "pass 2 error: intermediate file format error (getstr)"); exit(1); } *cp++ = 0; return (hash(buf)); } #define NSAVETAB 4096 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, "pass 2 error: ran out of memory (savestr)"); exit(1); } } strncpy(savetab, cp, len); cp = savetab; savetab += len; saveleft -= len; return (cp); } /* * The definition for the segmented hash tables. */ #define MAXHASH 20 #define HASHINC 1013 struct ht { char **ht_low; char **ht_high; int ht_used; } htab[MAXHASH]; char * hash(s) char *s; { register char **h; register i; register char *cp; struct ht *htp; int sh; /* * The hash function is a modular hash of * the sum of the characters with the sum * doubled before each successive character * is added. */ cp = s; i = 0; while (*cp) i = i*2 + *cp++; sh = (i&077777) % HASHINC; cp = s; /* * There are as many as MAXHASH active * hash tables at any given point in time. * The search starts with the first table * and continues through the active tables * as necessary. */ for (htp = htab; htp < &htab[MAXHASH]; htp++) { if (htp->ht_low == 0) { register char **hp = (char **) calloc(sizeof (char **), HASHINC); if (hp == 0) { fprintf(stderr, "pass 2 error: ran out of memory (hash)"); exit(1); } htp->ht_low = hp; htp->ht_high = htp->ht_low + HASHINC; } h = htp->ht_low + sh; /* * quadratic rehash increment * starts at 1 and incremented * by two each rehash. */ i = 1; do { if (*h == 0) { if (htp->ht_used > (HASHINC * 3)/4) break; htp->ht_used++; *h = savestr(cp); return (*h); } if (**h == *cp && strcmp(*h, cp) == 0) return (*h); h += i; i += 2; if (h >= htp->ht_high) h -= HASHINC; } while (i < HASHINC); } fprintf(stderr, "pass 2 error: ran out of hash tables"); exit(1); } char *tstrbuf[1]; #endif ht_low + sh; /* * quadratic rehash increment * starts at 1 and incremented * by two each rehash. */ i = 1; do { if (*h == 0) { if (htp->ht_used > (HASHINC * 3)/4) break; htp->ht_used++; *h = savestr(cp); return (*h); } if (**h == *cp && strcmp(*h, cp) == 0) return (*h); h += i; i += 2; if (h >= htp->ht_high) h -= HA((cmd/lint/llib-port 644 0 33 3050 2340331624 7366 /* LINTLIBRARY */ #include exit(s) {;} long lseek(f, o, d) long o; { return(0); } char *mktemp(p) char *p; { return(p);} int (*signal(c, f))() int (*f)(); { return(f); } char *strcat(a, b) char *a, *b; { ; } int strcmp(a, b) char *a, *b; { return(1); } char *strcpy(a, b) char *a, *b; { ; } int strlen(s) char *s; { return(1); } long tell(f) { return((long)0); } long time(t) long *t; { return(0);} char *calloc(n,s) unsigned n, s; { static char c[1]; return(c); } char *malloc(n) unsigned n; {static char c; return(&c);} char *realloc(p, n) char *p; unsigned n; { static char c; return(&c);} free(p) char *p; {;} fclose(f) FILE *f; {return(0);} fflush(f) FILE *f; {return(0);} char *fgets( s, l, f ) char *s; FILE *f; { return(s); } FILE *fopen(s,m) char *s, *m; { return(stdin); } FILE *freopen(s, m, f) char *s, *m; FILE *f; { return(stdin); } FILE *fdopen(fd, m) char *m; { return(stdin);} /* VARARGS */ fprintf( f, s ) FILE *f; char *s; {;} fputs(s,f) char *s; FILE *f; {;} fread( p, s, n, f ) char *p; FILE *f; {return(1);} /* VARARGS */ fscanf( f, s ) FILE *f; char *s; {return(1);} int fwrite( p, s, n, f ) char *p; FILE *f; {return(0);} intss(){return(1); } /* VARARGS */ printf( s ) char *s; {;} rewind(f) FILE *f; {;} /* VARARGS */ scanf( f ) char *f; {return(1); } setbuf( f, b ) FILE *f; char *b; {;} /* VARARGS */ char *sprintf( s, f ) char *s, *f; { return(s);} /* VARARGS */ sscanf( s, f ) char *s, *f; { return(1); } ungetc( c, f ) FILE *f; { return(c); } wdleng(){return(0); } struct _iobuf _iob[_NFILE]; char _ctype_[129]; fscanf( f, s ) FILE *f; char *s; {return(1);} int fwrite( p, s, n, f ) char *p; FILE *f; {return(0);} intss(){return(1); } /* VARARGS */ printf( s ) char *s; {;} rewind(f) FILE *f; {;} /* VARARGS */ scanf( f ) char *f; {return(1); } setbuf( f, b ) FILE *f; char *b; {;} /* VARARGS */ char *sprintf( s, f ) char *s, *f; { return(s);} /* VARARGS */ sscanf( s, f ) char *s, *f; { return(1); } ungetc( c, f ) FILE *f; { return(c); } wdleng(){return(0); } struct cmd/lint/lmanifest 644 0 33 1700 2374470641 7456 /* the key: LDI defined and initialized: storage set aside LIB defined on a library LDC defined as a common region on UNIX LDX defined by an extern: if ! pflag, same as LDI LRV function returns a value LUV function used in a value context LUE function used in effects context LUM mentioned somewhere other than at the declaration */ # define LDI 01 # define LIB 02 # define LDC 04 # define LDX 010 # define LRV 020 # define LUV 040 # define LUE 0100 # define LUM 0200 # define LFN 0400 /* filename record */ /* number of chars in NAME, and filename */ #ifndef FLEXNAMES # define LCHNM 8 # define LFNM 14 #endif typedef struct ty { TWORD aty; short extra; } ATYPE; typedef struct line { short decflag; #ifndef FLEXNAMES char name[LCHNM]; #else char *name; #endif short nargs; short fline; ATYPE type; } LINE; union rec { struct line l; struct { short decflag; #ifndef FLEXNAMES char fn[LFNM]; #else char *fn; #endif } f; }; e LUE 0100 # define LUM 0200 # define LFN 0400 /* filename reccmd/lint/macdefs 644 0 33 3072 2351313020 7060 # define makecc(val,i) lastcon |= val<<(8*i); /* pdp-11 womp next char */ # define ARGINIT 288 /* initial offset for arguments */ # define AUTOINIT 0 /* initial automatic offset */ extern int SZCHAR; extern int SZINT; extern int SZFLOAT; extern int SZDOUBLE; extern int SZLONG; extern int SZSHORT; extern int SZPOINT; extern int ALCHAR; extern int ALINT; extern int ALFLOAT; extern int ALDOUBLE; extern int ALLONG; extern int ALSHORT; extern int ALPOINT; extern int ALSTRUCT; # define SAVEADJUST 0 /* bits of adjustment required for stackframe */ /* type (INT OR LONG) big enough to hold pointers */ /* size in which constants are converted */ /* should be long if feasable */ # define CONSZ long # define CONFMT "%Ld" # define CONOFMT "%Lo" /* size in which offsets are kept /* should be large enough to cover address space in bits */ # define OFFSZ long /* character set macro */ # define CCTRANS(x) x /* register cookie for stack pointer */ # define STKREG 9 /* maximum and minimum register variable values */ # define MAXRVAR 1000 # define MINRVAR 1 /* many macro definitions for functions irrelevant to lint */ # define locctr(n) 0 # define getlab() 10 # define genswitch( x,y) # define bccode() # define cendarg() # define incode(a,s) (inoff += (s)) # define fincode(a,s) (inoff += (s) ) # define vfdzero(n) (inoff += (n)) # define aobeg() # define aoend() # ifndef unix # define NOFORTRAN {extern int pflag; if(pflag) werror( "fortran keyword nonportable" );} # else # define NOFORTRAN { werror( "fortran keyword nonportable" ); } # endif # define LINT /* many macro definitions for functions irrelevant to lint */ # define locctr(n) 0 # define getlab() 10 # define genswitch( x,y) # define bccode() # define cendarg() # define incode(a,s) (inoff += (s)) # define fincode(a,s) (inoff += (s) ) # define vfdzero(n) (inoff += (n)) # define aobeg() # define aoend() # ifndef unix # define NOFORTRAN {extern int pflag; if(pflag) werror( "fortran keyword nonportable" );} # else # define NOFORTRAN { werror( cmd/neqn/ 775 0 33 0 2552555541 5464 cmd/neqn/Makefile 644 0 33 1234 2254360023 7173 CFLAGS=-O -DNEQN -d2 YFLAGS=-d SOURCE = e.y e.h diacrit.c eqnbox.c font.c fromto.c funny.c glob.c integral.c \ io.c lex.c lookup.c mark.c matrix.c move.c over.c paren.c \ pile.c shift.c size.c sqrt.c text.c FILES = e.o diacrit.o eqnbox.o font.o fromto.o funny.o glob.o integral.o \ io.o lex.o lookup.o mark.o matrix.o move.o over.o paren.o \ pile.o shift.o size.o sqrt.o text.o neqn: $(FILES) cc $(CFLAGS) $(FILES) -o neqn e.c: e.def e.def: e.y yacc -d e.y mv y.tab.c e.c mv y.tab.h e.def $(FILES): e.h e.def install: neqn install -s neqn $(DESTDIR)/usr/bin clean: rm -f *.o e.c e.def list: pr TODO $(SOURCE) makefile lint: y.tab.c lint -spb *.c over.c paren.c \ pile.c shift.c size.c sqrt.c text.c FILES = e.o diacrit.o eqnbox.o font.o fromto.o funny.o glob.o integral.o \ io.o lex.o lookup.o mark.o matrix.o move.o over.o paren.o \ pile.o shift.o size.o sqrt.o text.o neqn: $(FILES) cc $(CFLAGS) $(FILES) -o neqn e.c: e.def e.def: e.y yacc -d e.y mv y.tab.c e.c mv y.tab.h e.def $(FILES):cmd/neqn/diacrit.c 644 0 33 1750 2111463466 7330 # include "e.h" # include "e.def" diacrit(p1, type) int p1, type; { int c, t; c = oalloc(); t = oalloc(); nrwid(p1, ps, p1); printf(".nr 10 %du\n", max(eht[p1]-ebase[p1]-VERT(2),0)); switch(type) { case VEC: /* vec */ case DYAD: /* dyad */ printf(".ds %d \\v'-1'_\\v'1'\n", c); break; case HAT: printf(".ds %d ^\n", c); break; case TILDE: printf(".ds %d ~\n", c); break; case DOT: printf(".ds %d \\v'-1'.\\v'1'\n", c); break; case DOTDOT: printf(".ds %d \\v'-1'..\\v'1'\n", c); break; case BAR: printf(".ds %d \\v'-1'\\l'\\n(%du'\\v'1'\n", c, p1); break; case UNDER: printf(".ds %d \\l'\\n(%du'\n", c, p1); break; } nrwid(c, ps, c); printf(".as %d \\h'-\\n(%du-\\n(%du/2u'\\v'0-\\n(10u'\\*(%d", p1, p1, c, c); printf("\\v'\\n(10u'\\h'-\\n(%du+\\n(%du/2u'\n", c, p1); if (type != UNDER) eht[p1] += VERT(1); if (dbg) printf(".\tdiacrit: %c over S%d, h=%d, b=%d\n", type, p1, eht[p1], ebase[p1]); ofree(c); ofree(t); } intf(".ds %d \\v'-1'..\\((cmd/neqn/e.h 644 0 33 2033 2111463466 6135 #include #define FATAL 1 #define ROM '1' #define ITAL '1' #define BLD '1' #define VERT(n) (20 * (n)) #define EFFPS(p) ((p) >= 6 ? (p) : 6) extern int dbg; extern int ct; extern int lp[]; extern int used[]; /* available registers */ extern int ps; /* dflt init pt size */ extern int deltaps; /* default change in ps */ extern int gsize; /* global size */ extern int gfont; /* global font */ extern int ft; /* dflt font */ extern FILE *curfile; /* current input file */ extern int ifile; /* input file number */ extern int linect; /* line number in current file */ extern int eqline; /* line where eqn started */ extern int svargc; extern char **svargv; extern int eht[]; extern int ebase[]; extern int lfont[]; extern int rfont[]; extern int yyval; extern int *yypv; extern int yylval; extern int eqnreg, eqnht; extern int lefteq, righteq; extern int lastchar; /* last character read by lex */ extern int markline; /* 1 if this EQ/EN contains mark or lineup */ typedef struct s_tbl { char *name; char *defn; struct s_tbl *next; } tbl; t; /* line number in current file */ extern int eqline; /* line where eqn started */ extern int svargc; extern char **svargv; extern int eht[]; extern int ebase[]; extern int lfont[]; extern int rfont[]; extern int yyval; extern int *yypv; extern int yylval; extern int eqnreg, eqnht; extern int lefteq, righteq; extern int lastchar; /* last character read by lex */ extern int markline; /* 1 if this EQ/EN contains mark or lineup */ typedef struct s_tbl { char *name; char *defn; cmd/neqn/e.y 644 0 33 7625 2111463466 6172 %{# #include "e.h" # int fromflg; %} %term CONTIG QTEXT SPACE THIN TAB %term MATRIX LCOL CCOL RCOL COL %term MARK LINEUP %term SUM INT PROD UNION INTER %term LPILE PILE CPILE RPILE ABOVE %term DEFINE TDEFINE NDEFINE DELIM GSIZE GFONT INCLUDE %right FROM TO %left OVER SQRT %right SUP SUB %right SIZE FONT ROMAN ITALIC BOLD FAT %right UP DOWN BACK FWD %left LEFT RIGHT %right DOT DOTDOT HAT TILDE BAR UNDER VEC DYAD %% stuff : eqn { putout($1); } | error { error(!FATAL, "syntax error"); } | { eqnreg = 0; } ; eqn : box | eqn box { eqnbox($1, $2, 0); } | eqn lineupbox { eqnbox($1, $2, 1); } | LINEUP { lineup(0); } ; lineupbox: LINEUP box { $$ = $2; lineup(1); } ; matrix : MATRIX { $$ = ct; } ; collist : column | collist column ; column : lcol '{' list '}' { column('L', $1); } | ccol '{' list '}' { column('C', $1); } | rcol '{' list '}' { column('R', $1); } | col '{' list '}' { column('-', $1); } ; lcol : LCOL { $$ = ct++; } ; ccol : CCOL { $$ = ct++; } ; rcol : RCOL { $$ = ct++; } ; col : COL { $$ = ct++; } ; sbox : sup box %prec SUP { $$ = $2; } ; tbox : to box %prec TO { $$ = $2; } | %prec FROM { $$ = 0; } ; box : box OVER box { boverb($1, $3); } | MARK box { mark($2); } | size box %prec SIZE { size($1, $2); } | font box %prec FONT { font($1, $2); } | FAT box { fatbox($2); } | SQRT box { sqrt($2); } | lpile '{' list '}' { lpile('L', $1, ct); ct = $1; } | cpile '{' list '}' { lpile('C', $1, ct); ct = $1; } | rpile '{' list '}' { lpile('R', $1, ct); ct = $1; } | pile '{' list '}' { lpile('-', $1, ct); ct = $1; } | box sub box sbox %prec SUB { shift2($1, $3, $4); } | box sub box %prec SUB { bshiftb($1, $2, $3); } | box sup box %prec SUP { bshiftb($1, $2, $3); } | int sub box sbox %prec SUB { integral($1, $3, $4); } | int sub box %prec SUB { integral($1, $3, 0); } | int sup box %prec SUP { integral($1, 0, $3); } | int { integral($1, 0, 0); } | left eqn right { paren($1, $2, $3); } | pbox | box from box tbox %prec FROM { fromto($1, $3, $4); fromflg=0; } | box to box %prec TO { fromto($1, 0, $3); } | box diacrit { diacrit($1, $2); } | fwd box %prec UP { move(FWD, $1, $2); } | up box %prec UP { move(UP, $1, $2); } | back box %prec UP { move(BACK, $1, $2); } | down box %prec UP { move(DOWN, $1, $2); } | matrix '{' collist '}' { matrix($1); } ; int : INT { setintegral(); } ; fwd : FWD text { $$ = atoi((char *) $1); } ; up : UP text { $$ = atoi((char *) $1); } ; back : BACK text { $$ = atoi((char *) $1); } ; down : DOWN text { $$ = atoi((char *) $1); } ; diacrit : HAT { $$ = HAT; } | VEC { $$ = VEC; } | DYAD { $$ = DYAD; } | BAR { $$ = BAR; } | UNDER { $$ = UNDER; } /* under bar */ | DOT { $$ = DOT; } | TILDE { $$ = TILDE; } | DOTDOT { $$ = DOTDOT; } /* umlaut = double dot */ ; from : FROM { $$=ps; ps -= 3; fromflg = 1; if(dbg)printf(".\tfrom: old ps %d, new ps %d, fflg %d\n", $$, ps, fromflg); } ; to : TO { $$=ps; if(fromflg==0)ps -= 3; if(dbg)printf(".\tto: old ps %d, new ps %d\n", $$, ps); } ; left : LEFT text { $$ = ((char *)$2)[0]; } | LEFT '{' { $$ = '{'; } ; right : RIGHT text { $$ = ((char *)$2)[0]; } | RIGHT '}' { $$ = '}'; } | { $$ = 0; } ; list : eqn { lp[ct++] = $1; } | list ABOVE eqn { lp[ct++] = $3; } ; lpile : LPILE { $$ = ct; } ; cpile : CPILE { $$ = ct; } ; pile : PILE { $$ = ct; } ; rpile : RPILE { $$ = ct; } ; size : SIZE text { $$ = ps; setsize((char *) $2); } ; font : ROMAN { setfont(ROM); } | ITALIC { setfont(ITAL); } | BOLD { setfont(BLD); } | FONT text { setfont(((char *)$2)[0]); } ; sub : SUB { shift(SUB); } ; sup : SUP { shift(SUP); } ; pbox : '{' eqn '}' { $$ = $2; } | QTEXT { text(QTEXT, (char *) $1); } | CONTIG { text(CONTIG, (char *) $1); } | SPACE { text(SPACE, 0); } | THIN { text(THIN, 0); } | TAB { text(TAB, 0); } | SUM { funny(SUM); } | PROD { funny(PROD); } | UNION { funny(UNION); } | INTER { funny(INTER); } /* intersection */ ; text : CONTIG | QTEXT ; %% IC { setfont(ITAL); } | BOLD { setfont(BLD); } | FONT text { setfont(((char *)$2)[0]); } ; sub : SUB {cmd/neqn/eqnbox.c 644 0 33 1067 2111463466 7206 # include "e.h" eqnbox(p1, p2, lu) { int b, h; char *sh; yyval = p1; b = max(ebase[p1], ebase[p2]); eht[yyval] = h = b + max(eht[p1]-ebase[p1], eht[p2]-ebase[p2]); ebase[yyval] = b; if(dbg)printf(".\te:eb: S%d <- S%d S%d; b=%d, h=%d\n", yyval, p1, p2, b, h); if (rfont[p1] == ITAL && lfont[p2] == ROM) sh = "\\|"; else sh = ""; if (lu) { printf(".nr %d \\w'\\s%d\\*(%d%s'\n", p1, ps, p1, sh); printf(".ds %d \\h'|\\n(97u-\\n(%du'\\*(%d\n", p1, p1, p1); } printf(".as %d \"%s\\*(%d\n", yyval, sh, p2); rfont[p1] = rfont[p2]; ofree(p2); } *sh; yyval = p1; b = max(ebase[p1], ebase[p2]); eht[yyval] = h = b + max(eht[p1]-ebase[p1], eht[p2]-ebase[p2]); ebase[yyval] = b; if(dbg)printf(".\te:eb: S%d <- S%d S%d; b=%d, h=%d\n", yyval, p1, p2, b, h); if (rfont[p1] == ITAL && lfont[p2] == ROM) sh = "\\|"; else sh = ""; if (lu) { printf(".nr %d \\w'\\s%d\\*(%d%s'\n", p1, ps, p1, sh); printf(".ds %d \\h'|\\n(97u-\\n(%du'\\*(%d\n", p1, p1, p1); } printf(".as %d \"%s\\*(%d\n",cmd/neqn/font.c 644 0 33 2244 2111463466 6656 # include "e.h" setfont(ch1) char ch1; { /* use number '1', '2', '3' for roman, italic, bold */ yyval = ft; if (ch1 == 'r' || ch1 == 'R') ft = ROM; else if (ch1 == 'i' || ch1 == 'I') ft = ITAL; else if (ch1 == 'b' || ch1 == 'B') ft = BLD; else ft = ch1; printf(".ft %c\n", ft); if(dbg)printf(".\tsetfont %c\n", ft); } font(p1, p2) int p1, p2; { /* old font in p1, new in ft */ yyval = p2; lfont[yyval] = rfont[yyval] = ft==ITAL ? ITAL : ROM; if(dbg)printf(".\tb:fb: S%d <- \\f%c S%d \\f%c b=%d,h=%d,lf=%c,rf=%c\n", yyval, ft, p2, p1, ebase[yyval], eht[yyval], lfont[yyval], rfont[yyval]); printf(".ds %d \\f%c\\*(%d\\f%c\n", yyval, ft, p2, p1); ft = p1; printf(".ft %c\n", ft); } fatbox(p) int p; { int sh; yyval = p; sh = ps / 4; nrwid(p, ps, p); printf(".ds %d \\*(%d\\h'-\\n(%du+%du'\\*(%d\n", p, p, p, sh, p); if(dbg)printf(".\tfat %d, sh=%d\n", p, sh); } globfont() { char temp[20]; getstr(temp, 20); yyval = eqnreg = 0; gfont = temp[0]; switch (gfont) { case 'r': case 'R': gfont = '1'; break; case 'i': case 'I': gfont = '2'; break; case 'b': case 'B': gfont = '3'; break; } printf(".ft %c\n", gfont); ft = gfont; } ft = p1; printf(".ft %c\n", ft); } fatbox(p) int p; { int sh; yyval = p; sh = ps / 4; nrwid(p, ps, p); printf(".ds %d \\*(%d\\h'-\\n(%du+%du'\\*(%d\n", p, p, p, sh, p); if(dbg)printf(".\tfat %d, sh=%d\n", p, sh); } globfont() { char temp[20]; getstr(temp, 20); yyval = eqnreg = 0; gfont = temp[0]; switch (gfont) { case 'r': case '((cmd/neqn/fromto.c 644 0 33 2473 2111463466 7222 # include "e.h" fromto(p1, p2, p3) int p1, p2, p3; { int b, h1, b1, pss; yyval = oalloc(); lfont[yyval] = rfont[yyval] = 0; h1 = eht[yyval] = eht[p1]; b1 = ebase[p1]; b = 0; pss = EFFPS(ps); ps += 3; nrwid(p1, ps, p1); printf(".nr %d \\n(%d\n", yyval, p1); if( p2>0 ) { nrwid(p2, pss, p2); printf(".if \\n(%d>\\n(%d .nr %d \\n(%d\n", p2, yyval, yyval, p2); eht[yyval] += eht[p2]; b = eht[p2]; } if( p3>0 ) { nrwid(p3, pss, p3); printf(".if \\n(%d>\\n(%d .nr %d \\n(%d\n", p3, yyval, yyval, p3); eht[yyval] += eht[p3]; } printf(".ds %d ", yyval); /* bottom of middle box */ if( p2>0 ) { printf("\\v'%du'\\h'\\n(%du-\\n(%du/2u'\\s%d\\*(%d\\s%d", eht[p2]-ebase[p2]+b1, yyval, p2, pss, p2, EFFPS(ps)); printf("\\h'-\\n(%du-\\n(%du/2u'\\v'%du'\\\n", yyval, p2, -(eht[p2]-ebase[p2]+b1)); } printf("\\h'\\n(%du-\\n(%du/2u'\\*(%d\\h'\\n(%du-\\n(%du+2u/2u'\\\n", yyval, p1, p1, yyval, p1); if( p3>0 ) { printf("\\v'%du'\\h'-\\n(%du-\\n(%du/2u'\\s%d\\*(%d\\s%d\\h'\\n(%du-\\n(%du/2u'\\v'%du'\\\n", -(h1-b1+ebase[p3]), yyval, p3, pss, p3, EFFPS(ps), yyval, p3, (h1-b1+ebase[p3])); } printf("\n"); ebase[yyval] = b + b1; if(dbg)printf(".\tfrom to: S%d <- %d f %d t %d; h=%d b=%d\n", yyval, p1, p2, p3, eht[yyval], ebase[yyval]); ofree(p1); if( p2>0 ) ofree(p2); if( p3>0 ) ofree(p3); } printf("\\h'\\n(%du-\\n(%du/2u'\\*(%d\\h'\\n(%du-\\n(%du+2u/2u'\\\n", yyval, p1, p1, yyval, p1); if( p3>0 ) { printf("\\v'%du'\\h'-\\n(%du-\\n(%du/2u'\\s%d\\*(%d\\s%d\\h'\\n(%du-\\n(%du/2u'cmd/neqn/funny.c 644 0 33 1003 2111463466 7037 # include "e.h" # include "e.def" funny(n) int n; { char *f; yyval = oalloc(); switch(n) { case SUM: f = "\\(*S"; break; case UNION: f = "\\(cu"; break; case INTER: /* intersection */ f = "\\(ca"; break; case PROD: f = "\\(*P"; break; default: error(FATAL, "funny type %d in funny", n); } printf(".ds %d %s\n", yyval, f); eht[yyval] = VERT(2); ebase[yyval] = 0; if(dbg)printf(".\tfunny: S%d <- %s; h=%d b=%d\n", yyval, f, eht[yyval], ebase[yyval]); lfont[yyval] = rfont[yyval] = ROM; } nclude "e.h" # include "e.def" funny(n) int n; { char *f; yyval = oalloc(); switch(n) { case SUM: f = "\\(*S"; break; case UNION: f = "\\(cu"; break; case INTER: /* intersection */ f = "\\(ca"; break; case PROD: f = "\\(*P"; break; default: error(FATAL, "funny type %d in funny", n); } printf(".ds %d %s\n", yyval, f); eht[yyval] = VERT(2); ebase[yyval] = 0; if(dbg)printf(".\tfunny: S%d <- %s; h=%d b=%d\n", yyval, f, eht[yyval], ebase[yyval]); lfont[yyval] = rfont[yyval] = ROM;cmd/neqn/glob.c 644 0 33 1603 2111463466 6631 #include "e.h" int dbg; /* debugging print if non-zero */ int lp[80]; /* stack for things like piles and matrices */ int ct; /* pointer to lp */ int used[100]; /* available registers */ int ps; /* default init point size */ int deltaps = 3; /* default change in ps */ int gsize = 10; /* default initial point size */ int gfont = ITAL; /* italic */ int ft; /* default font */ FILE *curfile; /* current input file */ int ifile; int linect; /* line number in file */ int eqline; /* line where eqn started */ int svargc; char **svargv; int eht[100]; int ebase[100]; int lfont[100]; int rfont[100]; int eqnreg; /* register where final string appears */ int eqnht; /* inal height of equation */ int lefteq = '\0'; /* left in-line delimiter */ int righteq = '\0'; /* right in-line delimiter */ int lastchar; /* last character read by lex */ int markline = 0; /* 1 if this EQ/EN contains mark or lineup */ le; /* current input file */ int ifile; int linect; /* line number in file */ int eqline; /* line where eqn started */ int svcmd/neqn/integral.c 644 0 33 1160 2111463466 7511 # include "e.h" # include "e.def" integral(p, p1, p2) { #ifndef NEQN if (p1 != 0) printf(".ds %d \\h'-0.4m'\\v'0.4m'\\*(%d\\v'-0.4m'\n", p1, p1); if (p2 != 0) printf(".ds %d \\v'-0.3m'\\*(%d\\v'0.3m'\n", p2, p2); #endif if (p1 != 0 && p2 != 0) shift2(p, p1, p2); else if (p1 != 0) bshiftb(p, SUB, p1); else if (p2 != 0) bshiftb(p, SUP, p2); if(dbg)printf(".\tintegral: S%d; h=%d b=%d\n", p, eht[p], ebase[p]); lfont[p] = ROM; } setintegral() { char *f; yyval = oalloc(); f = "\\(is"; printf(".ds %d %s\n", yyval, f); eht[yyval] = VERT(2); ebase[yyval] = 0; lfont[yyval] = rfont[yyval] = ROM; } \v'0.4m'\\*(%d\\v'-0.4m'\n", p1, p1); if (p2 != 0) printf(".ds %d \\v'-0.3m'\\*(%d\\v'0.3m'\n", p2, p2); #endif if (p1 != 0 && p2 != 0) shift2(p, p1, p2); else if (p1 != 0) bshiftb(p, SUB, p1); else if (p2 != 0) bshiftb(p, SUP, p2); if(dbg)printf(".\tintegral: S%d; h=%d b=%d\n", p, eht[p], ebase[p]); lfont[p] = ROM; } setintegral() { char *f; yyval = oalloc(); f = "\\(is"; pcmd/neqn/io.c 644 0 33 10125 2111463466 6334 # include "e.h" #define MAXLINE 1200 /* maximum input line */ char in[MAXLINE]; /* input buffer */ int eqnexit(); int noeqn; main(argc,argv) int argc; char *argv[];{ eqnexit(eqn(argc, argv)); } eqnexit(n) { #ifdef gcos if (n) fprintf(stderr, "run terminated due to eqn error\n"); exit(0); #endif exit(n); } eqn(argc,argv) int argc; char *argv[];{ int i, type; setfile(argc,argv); init_tbl(); /* install keywords in tables */ while ((type=getline(in)) != EOF) { eqline = linect; if (in[0]=='.' && in[1]=='E' && in[2]=='Q') { for (i=11; i<100; used[i++]=0); printf("%s",in); printf(".nr 99 \\n(.s\n.nr 98 \\n(.f\n"); markline = 0; init(); yyparse(); if (eqnreg>0) { printf(".nr %d \\w'\\*(%d'\n", eqnreg, eqnreg); /* printf(".if \\n(%d>\\n(.l .tm too-long eqn, file %s, between lines %d-%d\n", */ /* eqnreg, svargv[ifile], eqline, linect); */ printf(".nr MK %d\n", markline); /* for -ms macros */ printf(".if %d>\\n(.v .ne %du\n", eqnht, eqnht); printf(".rn %d 10\n", eqnreg); if(!noeqn)printf("\\*(10\n"); } printf(".ps \\n(99\n.ft \\n(98\n"); printf(".EN"); if (lastchar == EOF) { putchar('\n'); break; } if (putchar(lastchar) != '\n') while (putchar(gtc()) != '\n'); } else if (type == lefteq) inline(); else printf("%s",in); } return(0); } getline(s) register char *s; { register c; while((*s++=c=gtc())!='\n' && c!=EOF && c!=lefteq) if (s >= in+MAXLINE) { error( !FATAL, "input line too long: %.20s\n", in); in[MAXLINE] = '\0'; break; } if (c==lefteq) s--; *s++ = '\0'; return(c); } inline() { int ds; printf(".nr 99 \\n(.s\n.nr 98 \\n(.f\n"); ds = oalloc(); printf(".rm %d \n", ds); do{ if (*in) printf(".as %d \"%s\n", ds, in); init(); yyparse(); if (eqnreg > 0) { printf(".as %d \\*(%d\n", ds, eqnreg); ofree(eqnreg); } printf(".ps \\n(99\n.ft \\n(98\n"); } while (getline(in) == lefteq); if (*in) printf(".as %d \"%s", ds, in); printf(".ps \\n(99\n.ft \\n(98\n"); printf("\\*(%d\n", ds); ofree(ds); } putout(p1) int p1; { extern int gsize, gfont; int before, after; if(dbg)printf(".\tanswer <- S%d, h=%d,b=%d\n",p1, eht[p1], ebase[p1]); eqnht = eht[p1]; printf(".ds %d \\x'0'", p1); /* suppposed to leave room for a subscript or superscript */ before = eht[p1] - ebase[p1] - VERT(3); /* 3 = 1.5 lines */ if (before > 0) printf("\\x'0-%du'", before); printf("\\f%c\\s%d\\*(%d%s\\s\\n(99\\f\\n(98", gfont, gsize, p1, rfont[p1] == ITAL ? "\\|" : ""); after = ebase[p1] - VERT(1); if (after > 0) printf("\\x'%du'", after); putchar('\n'); eqnreg = p1; } max(i,j) int i,j; { return (i>j ? i : j); } oalloc() { int i; for (i=11; i<100; i++) if (used[i]++ == 0) return(i); error( FATAL, "no eqn strings left", i); return(0); } ofree(n) int n; { used[n] = 0; } setps(p) int p; { printf(".ps %d\n", EFFPS(p)); } nrwid(n1, p, n2) int n1, p, n2; { printf(".nr %d \\w'\\s%d\\*(%d'\n", n1, EFFPS(p), n2); } setfile(argc, argv) int argc; char *argv[]; { static char *nullstr(( = "-"; svargc = --argc; svargv = argv; while (svargc > 0 && svargv[1][0] == '-') { switch (svargv[1][1]) { case 'd': lefteq=svargv[1][2]; righteq=svargv[1][3]; break; case 's': gsize = atoi(&svargv[1][2]); break; case 'p': deltaps = atoi(&svargv[1][2]); break; case 'f': gfont = svargv[1][2]; break; case 'e': noeqn++; break; default: dbg = 1; } svargc--; svargv++; } ifile = 1; linect = 1; if (svargc <= 0) { curfile = stdin; svargv[1] = nullstr; } else if ((curfile = fopen(svargv[1], "r")) == NULL) error( FATAL,"can't open file %s", svargv[1]); } yyerror() {;} init() { ct = 0; ps = gsize; ft = gfont; setps(ps); printf(".ft %c\n", ft); } error(fatal, s1, s2) int fatal; char *s1, *s2; { if (fatal>0) printf("eqn fatal error: "); printf(s1,s2); printf("\nfile %s, between lines %d and %d\n", svargv[ifile], eqline, linect); fprintf(stderr, "eqn: "); if (fatal>0) fprintf(stderr, "fatal error: "); fprintf(stderr, s1, s2); fprintf(stderr, "\nfile %s, between lines %d and %d\n", svargv[ifile], eqline, linect); if (fatal > 0) eqnexit(1); } () {;} init() { ct = 0; ps = gsize; ft = gfont; setps(ps); printf(".ft %c\n", ft); } error(fatal, s1, s2) int fatal; char *s1, *s2; { if (fatal>0) printf("eqn fatal error: "); printf(s1,s2); printf("\nfile %s, between lines %d and %d\n", svargv[ifile], eqline, linect); fprintf(stderr, "eqn: "); if (fatal>0) fprintf(stderr, "fatal error: "); fprintf(stderr, s1, s2); fprintf(stderr, "\nfile %s, between licmd/neqn/lex.c 644 0 33 10240 2111463467 6514 #include "e.h" #include "e.def" #define SSIZE 400 char token[SSIZE]; int sp; #define putbak(c) *ip++ = c; #define PUSHBACK 300 /* maximum pushback characters */ char ibuf[PUSHBACK+SSIZE]; /* pushback buffer for definitions, etc. */ char *ip = ibuf; gtc() { loop: if (ip > ibuf) return(*--ip); /* already present */ lastchar = getc(curfile); if (lastchar=='\n') linect++; if (lastchar != EOF) return(lastchar); if (++ifile > svargc) { return(EOF); } fclose(curfile); linect = 1; if ((curfile=fopen(svargv[ifile], "r")) != NULL) goto loop; error(FATAL, "can't open file %s", svargv[ifile]); return(EOF); } pbstr(str) register char *str; { register char *p; p = str; while (*p++); --p; if (ip >= &ibuf[PUSHBACK]) error( FATAL, "pushback overflow"); while (p > str) putbak(*--p); } yylex() { register int c; tbl *tp, *lookup(); extern tbl **keytbl, **deftbl; beg: while ((c=gtc())==' ' || c=='\n') ; yylval=c; switch(c) { case EOF: return(EOF); case '~': return(SPACE); case '^': return(THIN); case '\t': return(TAB); case '{': return('{'); case '}': return('}'); case '"': for (sp=0; (c=gtc())!='"' && c != '\n'; ) { if (c == '\\') if ((c = gtc()) != '"') token[sp++] = '\\'; token[sp++] = c; if (sp>=SSIZE) error(FATAL, "quoted string %.20s... too long", token); } token[sp]='\0'; yylval = (int) &token[0]; if (c == '\n') error(!FATAL, "missing \" in %.20s", token); return(QTEXT); } if (c==righteq) return(EOF); putbak(c); getstr(token, SSIZE); if (dbg)printf(".\tlex token = |%s|\n", token); if ((tp = lookup(&deftbl, token, NULL)) != NULL) { putbak(' '); pbstr(tp->defn); putbak(' '); if (dbg) printf(".\tfound %s|=%s|\n", token, tp->defn); } else if ((tp = lookup(&keytbl, token, NULL)) == NULL) { if(dbg)printf(".\t%s is not a keyword\n", token); return(CONTIG); } else if (tp->defn == (char *) DEFINE || tp->defn == (char *) NDEFINE || tp->defn == (char *) TDEFINE) define(tp->defn); else if (tp->defn == (char *) DELIM) delim(); else if (tp->defn == (char *) GSIZE) globsize(); else if (tp->defn == (char *) GFONT) globfont(); else if (tp->defn == (char *) INCLUDE) include(); else { return((int) tp->defn); } goto beg; } getstr(s, n) char *s; register int n; { register int c; register char *p; p = s; while ((c = gtc()) == ' ' || c == '\n') ; if (c == EOF) { *s = 0; return; } while (c != ' ' && c != '\t' && c != '\n' && c != '{' && c != '}' && c != '"' && c != '~' && c != '^' && c != righteq) { if (c == '\\') if ((c = gtc()) != '"') *p++ = '\\'; *p++ = c; if (--n <= 0) error(FATAL, "token %.20s... too long", s); c = gtc(); } if (c=='{' || c=='}' || c=='"' || c=='~' || c=='^' || c=='\t' || c==righteq) putbak(c); *p = '\0'; yylval = (int) s; } cstr(s, quote, maxs) char *s; int quote; { int del, c, i; while((del=gtc()) == ' ' || del == '\t' || del == '\n'); if (quote) for (i=0; (c=gtc()) != del && c != EOF;) { s[i++] = c; if (i >= maxs) return(1); /* disaster */ } else { s[0] = del; for (i=1; (c=gtc())!=' ' && c!= '\t' && c!='\n' && c!=EOF;) { s[i++]=c; if (i >= maxs) return(1); /* disaster */ } } s[i] = '\0'; if (c == EOF) error(FATAL, "Unexpected end of input at %.20s", s); return(0); } define(type) int type; { char *strsave(), *p1, *p2; tbl *lookup(); extern tbl **deftbl; getstr(token, SSIZE); /* get name */ if (type != DEFINE) { cstr(token, 1, SSIZE); /* skip the definition too */ return; } p1 = strsave(token); if (cstr(token, 1, SSIZE)) error(FATAL, "Unterminated definition at %.20s", token); p2 = strsave(token); lookup(&deftbl, p1, p2); if (dbg)printf(".\tname %s defined as %s\n", p1, p2); } char *strsave(s) char *s; { char *malloc(); register char *q; q = malloc(strlen(s)+1); if (q == NULL) error(FATAL, "out of space in strsave on %s", s); strcpy(q, s); return(q); } include() { error(!FATAL, "Include not yet implemented"); } delim() { yyval = eqnreg = 0; if (cstr(token, 0, SSIZE)) error(FATAL, "Bizarre delimiters at %.20s", token); lefteq = token[0]; righteq = token[1]; if (lefteq == 'o' && righteq == 'f') lefteq = righteq = '\0'; } \tname %s defined as %s\n", p1, p2); } char *strsave(s) char *s; { char *malloc(); register char *q; q = malloc(strlen(s)+1); if (q == NULL) error(FATAL, "out of space in strsave on %s", s); strcpy(q, s); return(q); } include() { error(!FATAL, "Include not yet implemented"); } delim() { yyval = eqnreg = 0; if (cstr(token, 0, SSIZE)) cmd/neqn/lookup.c 644 0 33 7753 2111463467 7234 # include "e.h" #include "e.def" #define TBLSIZE 100 tbl *keytbl[TBLSIZE]; /* key words */ tbl *restbl[TBLSIZE]; /* reserved words */ tbl *deftbl[TBLSIZE]; /* user-defined names */ struct { char *key; int keyval; } keyword[] ={ "sub", SUB, "sup", SUP, ".EN", EOF, "from", FROM, "to", TO, "sum", SUM, "hat", HAT, "vec", VEC, "dyad", DYAD, "dot", DOT, "dotdot", DOTDOT, "bar", BAR, "tilde", TILDE, "under", UNDER, "prod", PROD, "int", INT, "integral", INT, "union", UNION, "inter", INTER, "pile", PILE, "lpile", LPILE, "cpile", CPILE, "rpile", RPILE, "over", OVER, "sqrt", SQRT, "above", ABOVE, "size", SIZE, "font", FONT, "fat", FAT, "roman", ROMAN, "italic", ITALIC, "bold", BOLD, "left", LEFT, "right", RIGHT, "delim", DELIM, "define", DEFINE, #ifdef NEQN /* make ndefine synonym for define, tdefine a no-op */ "tdefine", TDEFINE, "ndefine", DEFINE, #else /* tdefine = define, ndefine = no-op */ "tdefine", DEFINE, "ndefine", NDEFINE, #endif "gsize", GSIZE, ".gsize", GSIZE, "gfont", GFONT, "include", INCLUDE, "up", UP, "down", DOWN, "fwd", FWD, "back", BACK, "mark", MARK, "lineup", LINEUP, "matrix", MATRIX, "col", COL, "lcol", LCOL, "ccol", CCOL, "rcol", RCOL, 0, 0 }; struct { char *res; char *resval; } resword[] ={ ">=", "\\(>=", "<=", "\\(<=", "==", "\\(==", "!=", "\\(!=", "+-", "\\(+-", "->", "\\(->", "<-", "\\(<-", "inf", "\\(if", "infinity", "\\(if", "partial", "\\(pd", "half", "\\f1\\(12\\fP", "prime", "\\f1\\(fm\\fP", "dollar", "\\f1$\\fP", "nothing", "", "times", "\\(mu", "del", "\\(gr", "grad", "\\(gr", #ifdef NEQN "<<", "<<", ">>", ">>", "approx", "~\b\\d~\\u", "cdot", "\\v'-.5'.\\v'.5'", "...", "...", ",...,", ",...,", #else "<<", "<\\h'-.3m'<", ">>", ">\\h'-.3m'>", "approx", "\\v'-.2m'\\z\\(ap\\v'.25m'\\(ap\\v'-.05m'", "cdot", "\\v'-.3m'.\\v'.3m'", "...", "\\v'-.3m'\\ .\\ .\\ .\\ \\v'.3m'", ",...,", ",\\ .\\ .\\ .\\ ,\\|", #endif "alpha", "\\(*a", "beta", "\\(*b", "gamma", "\\(*g", "GAMMA", "\\(*G", "delta", "\\(*d", "DELTA", "\\(*D", "epsilon", "\\(*e", "EPSILON", "\\f1E\\fP", "omega", "\\(*w", "OMEGA", "\\(*W", "lambda", "\\(*l", "LAMBDA", "\\(*L", "mu", "\\(*m", "nu", "\\(*n", "theta", "\\(*h", "THETA", "\\(*H", "phi", "\\(*f", "PHI", "\\(*F", "pi", "\\(*p", "PI", "\\(*P", "sigma", "\\(*s", "SIGMA", "\\(*S", "xi", "\\(*c", "XI", "\\(*C", "zeta", "\\(*z", "iota", "\\(*i", "eta", "\\(*y", "kappa", "\\(*k", "rho", "\\(*r", "tau", "\\(*t", "omicron", "\\(*o", "upsilon", "\\(*u", "UPSILON", "\\(*U", "psi", "\\(*q", "PSI", "\\(*Q", "chi", "\\(*x", "and", "\\f1and\\fP", "for", "\\f1for\\fP", "if", "\\f1if\\fP", "Re", "\\f1Re\\fP", "Im", "\\f1Im\\fP", "sin", "\\f1sin\\fP", "cos", "\\f1cos\\fP", "tan", "\\f1tan\\fP", "arc", "\\f1arc\\fP", "sinh", "\\f1sinh\\fP", "coth", "\\f1coth\\fP", "tanh", "\\f1tanh\\fP", "cosh", "\\f1cosh\\fP", "lim", "\\f1lim\\fP", "log", "\\f1log\\f((P", "max", "\\f1max\\fP", "min", "\\f1min\\fP", "ln", "\\f1ln\\fP", "exp", "\\f1exp\\fP", "det", "\\f1det\\fP", 0, 0 }; tbl *lookup(tblp, name, defn) /* find name in tbl. if defn non-null, install */ tbl **tblp; char *name, *defn; { register tbl *p; register int h; register char *s = name; char *malloc(); for (h = 0; *s != '\0'; ) h += *s++; h %= TBLSIZE; for (p = tblp[h]; p != NULL; p = p->next) if (strcmp(name, p->name) == 0) { /* found it */ if (defn != NULL) p->defn = defn; return(p); } /* didn't find it */ if (defn == NULL) return(NULL); p = (tbl *) malloc(sizeof (tbl)); if (p == NULL) error(FATAL, "out of space in lookup"); p->name = name; p->defn = defn; p->next = tblp[h]; tblp[h] = p; return(p); } init_tbl() /* initialize all tables */ { int i; for (i = 0; keyword[i].key != NULL; i++) lookup(keytbl, keyword[i].key, keyword[i].keyval); for (i = 0; resword[i].res != NULL; i++) lookup(restbl, resword[i].res, resword[i].resval); } p->defn = defn; cmd/neqn/mark.c 644 0 33 446 2111463467 6625 #include "e.h" mark(p1) int p1; { markline = 1; printf(".ds %d \\k(97\\*(%d\n", p1, p1); yyval = p1; if(dbg)printf(".\tmark %d\n", p1); } lineup(p1) { markline = 1; if (p1 == 0) { yyval = oalloc(); printf(".ds %d \\h'|\\n(97u'\n", yyval); } if(dbg)printf(".\tlineup %d\n", p1); } i; for (i = 0; keyword[i].key != NULL; i++) lookup(keytbl, keyword[i].key, keyword[i].keyval); for (i = 0; resword[i].re/,5(< /,"cmd/neqn/matrix.c 644 0 33 2442 2111463467 7215 #include "e.h" column(type, p1) int type, p1; { int i; lp[p1] = ct - p1 - 1; if( dbg ){ printf(".\t%d column of", type); for( i=p1+1; i\\n(%d .nr %d \\n(%d\n", p2, treg, treg, p2); printf(".ds %d \\v'%du'\\h'\\n(%du-\\n(%du/2u'\\*(%d\\\n", yyval, eht[p2]-ebase[p2]-d, treg, p2, p2); printf("\\h'-\\n(%du-\\n(%du/2u'\\v'%du'\\*(%d\\\n", p2, p1, -eht[p2]+ebase[p2]-ebase[p1], p1); printf("\\h'-\\n(%du-\\n(%du-2u/2u'\\v'%du'\\l'\\n(%du'\\v'%du'\n", treg, p1, ebase[p1], treg, d); ebase[yyval] = b; eht[yyval] = h; lfont[yyval] = rfont[yyval] = 0; ofree(p2); ofree(treg); } printf(".nr %d \\n(%d\n", treg, p1); printf(".if \\n(%d>\\n(%d .nr %d \\n(%d\n", p2, treg, treg, p2); printf(".ds %d \\v'%du'\\h'\\n(%du-\\n(%du/2u'\\*(%d\\\n", yyval, eht[p2]-ebase[p2]-d, treg, p2, p2); printf("\\h'-\\n(%ducmd/neqn/paren.c 644 0 33 4425 2111463467 7021 # include "e.h" paren(leftc, p1, rightc) int p1, leftc, rightc; { int n, m, h1, j, b1, v; h1 = eht[p1]; b1 = ebase[p1]; yyval = p1; n = max(b1+VERT(1), h1-b1-VERT(1)) / VERT(1); if( n<2 ) n = 1; m = n-2; if (leftc=='{' || rightc == '}') { n = n%2 ? n : ++n; if( n<3 ) n=3; m = n-3; } eht[yyval] = VERT(2 * n); ebase[yyval] = (n)/2 * VERT(2); if (n%2 == 0) ebase[yyval] -= VERT(1); v = b1 - h1/2 + VERT(1); printf(".ds %d \\|\\v'%du'", yyval, v); switch( leftc ) { case 'n': /* nothing */ case '\0': break; case 'f': /* floor */ if (n <= 1) printf("\\(lf"); else brack(m, "\\(bv", "\\(bv", "\\(lf"); break; case 'c': /* ceiling */ if (n <= 1) printf("\\(lc"); else brack(m, "\\(lc", "\\(bv", "\\(bv"); break; case '{': printf("\\b'\\(lt"); for(j = 0; j < m; j += 2) printf("\\(bv"); printf("\\(lk"); for(j = 0; j < m; j += 2) printf("\\(bv"); printf("\\(lb'"); break; case '(': brack(m, "\\(lt", "\\(bv", "\\(lb"); break; case '[': brack(m, "\\(lc", "\\(bv", "\\(lf"); break; case '|': brack(m, "|", "|", "|"); break; default: brack(m, (char *) &leftc, (char *) &leftc, (char *) &leftc); break; } printf("\\v'%du'\\*(%d", -v, p1); if( rightc ) { printf("\\|\\v'%du'", v); switch( rightc ) { case 'f': /* floor */ if (n <= 1) printf("\\(rf"); else brack(m, "\\(bv", "\\(bv", "\\(rf"); break; case 'c': /* ceiling */ if (n <= 1) printf("\\(rc"); else brack(m, "\\(rc", "\\(bv", "\\(bv"); break; case '}': printf("\\b'\\(rt"); for(j = 0; j< m; j += 2)printf("\\(bv"); printf("\\(rk"); for(j = 0; j< m; j += 2) printf("\\(bv"); printf("\\(rb'"); break; case ']': brack(m, "\\(rc", "\\(bv", "\\(rf"); break; case ')': brack(m, "\\(rt", "\\(bv", "\\(rb"); break; case '|': brack(m, "|", "|", "|"); break; default: brack(m, (char *) &rightc, (char *) &rightc, (char *) &rightc); break; } printf("\\v'%du'", -v); } printf("\n"); if(dbg)printf(".\tcurly: h=%d b=%d n=%d v=%d l=%c, r=%c\n", eht[yyval], ebase[yyval], n, v, leftc, rightc); } brack(m, t, c, b) int m; char *t, *c, *b; { int j; printf("\\b'%s", t); for( j=0; jmid; i-- ) b += eht[lp[i]] + gap; ebase[yyval] = (nlist%2) ? b + ebase[lp[mid]] : b - VERT(1) - gap; if(dbg) { printf(".\tS%d <- %c pile of:", yyval, type); for( i=p1; i\\n(%d .nr %d \\n(%d\n", lp[i], yyval, yyval, lp[i]); } printf(".ds %d \\v'%du'\\h'%du*\\n(%du'\\\n", yyval, ebase[yyval], type=='R' ? 1 : 0, yyval); for(i = p2-1; i >=p1; i--) { hi = eht[lp[i]]; bi = ebase[lp[i]]; switch(type) { case 'L': printf("\\v'%du'\\*(%d\\h'-\\n(%du'\\v'0-%du'\\\n", -bi, lp[i], lp[i], hi-bi+gap); continue; case 'R': printf("\\v'%du'\\h'-\\n(%du'\\*(%d\\v'0-%du'\\\n", -bi, lp[i], lp[i], hi-bi+gap); continue; case 'C': case '-': printf("\\v'%du'\\h'\\n(%du-\\n(%du/2u'\\*(%d", -bi, yyval, lp[i], lp[i]); printf("\\h'-\\n(%du-\\n(%du/2u'\\v'0-%du'\\\n", yyval, lp[i], hi-bi+gap); continue; } } printf("\\v'%du'\\h'%du*\\n(%du'\n", eht[yyval]-ebase[yyval]+gap, type!='R' ? 1 : 0, yyval); for( i=p1; i h2 ) /* move little sub down */ shval = b1-b2; ebase[yyval] = b1 + max(0, h2-b1-d1); eht[yyval] = h1 + max(0, h2-b1-d1); } else { /* superscript */ d1 = VERT(1); ebase[yyval] = b1; shval = -VERT(1) - b2; if( VERT(1) + h2 < h1-b1 ) /* raise little super */ shval = -(h1-b1) + h2-b2 - d1; eht[yyval] = h1 + max(0, h2 - VERT(1)); } if(dbg)printf(".\tb:b shift b: S%d <- S%d vert %d S%d vert %d; b=%d, h=%d\n", yyval, p1, shval, p2, -shval, ebase[yyval], eht[yyval]); printf(".as %d \\v'%du'\\*(%d\\v'%du'\n", yyval, shval, p2, -shval); ofree(p2); } shift(p1) int p1; { ps -= deltaps; yyval = p1; if(dbg)printf(".\tshift: %d;ps=%d\n", yyval, ps); } shift2(p1, p2, p3) int p1, p2, p3; { int effps, h1, h2, h3, b1, b2, b3, subsh, d1, d2, supsh; int treg; treg = oalloc(); yyval = p1; if(dbg)printf(".\tshift2 s%d <- %d %d %d\n", yyval, p1, p2, p3); effps = EFFPS(ps+deltaps); h1 = eht[p1]; b1 = ebase[p1]; h2 = eht[p2]; b2 = ebase[p2]; h3 = eht[p3]; b3 = ebase[p3]; d1 = VERT(1); subsh = -d1+h2-b2; if( d1+b1 > h2 ) /* move little sub down */ subsh = b1-b2; supsh = - VERT(1) - b3; d2 = VERT(1); if( VERT(1)+h3 < h1-b1 ) supsh = -(h1-b1) + (h3-b3) - d2; eht[yyval] = h1 + max(0, h3-VERT(1)) + max(0, h2-b1-d1); ebase[yyval] = b1+max(0, h2-b1-d1); nrwid(p2, effps, p2); nrwid(p3, effps, p3); printf(".nr %d \\n(%d\n", treg, p3); printf(".if \\n(%d>\\n(%d .nr %d \\n(%d\n", p2, treg, treg, p2); printf(".as %d \\v'%du'\\*(%d\\h'-\\n(%du'\\v'%du'\\\n", p1, subsh, p2, p2, -subsh+supsh); printf("\\*(%d\\h'-\\n(%du+\\n(%du'\\v'%du'\n", p3, p3, treg, -supsh); ps += deltaps; ofree(p2); ofree(p3); ofree(treg); } h1-b1 ) supsh = -(h1-b1) + (h3-b3) - d2; eht[yyval] = h1 + max(0, h3-VERT(1)) + max(0, h2-b1-d1);cmd/neqn/size.c 644 0 33 1546 2111463467 6667 # include "e.h" setsize(p) /* set size as found in p */ char *p; { if (*p == '+') ps += atoi(p+1); else if (*p == '-') ps -= atoi(p+1); else ps = atoi(p); if(dbg)printf(".\tsetsize %s; ps = %d\n", p, ps); } size(p1, p2) int p1, p2; { /* old size in p1, new in ps */ int effps, effp1; yyval = p2; if(dbg)printf(".\tb:sb: S%d <- \\s%d S%d \\s%d; b=%d, h=%d\n", yyval, ps, p2, p1, ebase[yyval], eht[yyval]); effps = EFFPS(ps); effp1 = EFFPS(p1); printf(".ds %d \\s%d\\*(%d\\s%d\n", yyval, effps, p2, effp1); ps = p1; } globsize() { char temp[20]; getstr(temp, 20); if (temp[0] == '+') gsize += atoi(temp+1); else if (temp[0] == '-') gsize -= atoi(temp+1); else gsize = atoi(temp); yyval = eqnreg = 0; setps(gsize); ps = gsize; if (gsize >= 12) /* sub and sup size change */ deltaps = gsize / 4; else deltaps = gsize / 3; } %d; b=%d, h=%d\n", yyval, ps, p2, p1, ebase[yyval], eht[yyval]); effps = EFFPS(ps); effp1 = EFFPS(p1); printf(".ds %d \\s%d\\*(%d\\s%d\n", yyval,cmd/neqn/sqrt.c 644 0 33 506 2111463467 6661 # include "e.h" sqrt(p2) int p2; { yyval = p2; nrwid(p2, ps, p2); printf(".ds %d \\v'%du'\\e\\L'%du'\\l'\\n(%du'", p2, ebase[p2], -eht[p2], p2); printf("\\v'%du'\\h'-\\n(%du'\\*(%d\n", eht[p2]-ebase[p2], p2, p2); eht[p2] += VERT(1); if(dbg)printf(".\tsqrt: S%d <- S%d;b=%d, h=%d\n", p2, p2, ebase[p2], eht[p2]); } else deltaps = gsize / 3; } %d; b=%d, h=%d\n", yyval, ps, p2, p1, ebase[yyval], eht[yyv/,5< /,"cmd/neqn/text.c 644 0 33 6300 2111463467 6672 # include "e.h" # include "e.def" int csp; int psp; #define CSSIZE 400 char cs[420]; int lf, rf; /* temporary spots for left and right fonts */ text(t,p1) int t; char *p1; { int c; char *p; tbl *tp, *lookup(); extern tbl *restbl; yyval = oalloc(); ebase[yyval] = 0; eht[yyval] = VERT(2); /* 2 half-spaces */ lfont[yyval] = rfont[yyval] = ROM; if (t == QTEXT) p = p1; else if ( t == SPACE ) p = "\\ "; else if ( t == THIN ) p = "\\|"; else if ( t == TAB ) p = "\\t"; else if ((tp = lookup(&restbl, p1, NULL)) != NULL) p = tp->defn; else { lf = rf = 0; for (csp=psp=0; (c=p1[psp++])!='\0';) { rf = trans(c, p1); if (lf == 0) lf = rf; /* save first */ if (csp>CSSIZE) error(FATAL,"converted token %.25s... too long",p1); } cs[csp] = '\0'; p = cs; lfont[yyval] = lf; rfont[yyval] = rf; } if(dbg)printf(".\t%dtext: S%d <- %s; b=%d,h=%d,lf=%c,rf=%c\n", t, yyval, p, ebase[yyval], eht[yyval], lfont[yyval], rfont[yyval]); printf(".ds %d \"%s\n", yyval, p); } trans(c,p1) int c; char *p1; { int f; f = ROM; switch( c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case ':': case ';': case '!': case '%': case '(': case '[': case ')': case ']': case ',': if (rf == ITAL) shim(); roman(c); break; case '.': if (rf == ROM) roman(c); else cs[csp++] = c; f = rf; break; case '|': if (rf == ITAL) shim(); shim(); roman(c); shim(); break; case '=': if (rf == ITAL) shim(); name4('e','q'); break; case '+': if (rf == ITAL) shim(); name4('p', 'l'); break; case '>': case '<': if (rf == ITAL) shim(); if (p1[psp]=='=') { /* look ahead for == <= >= */ name4(c,'='); psp++; } else { cs[csp++] = c; } break; case '-': if (rf == ITAL) shim(); if (p1[psp]=='>') { name4('-','>'); psp++; } else { name4('m','i'); } break; case '/': if (rf == ITAL) shim(); name4('s','l'); break; case '~': case ' ': shim(); shim(); break; case '^': ((shim(); break; case '\\': /* troff - pass 2 or 3 more chars */ if (rf == ITAL) shim(); cs[csp++] = c; cs[csp++] = c = p1[psp++]; cs[csp++] = p1[psp++]; if (c=='(') cs[csp++] = p1[psp++]; if (c=='*' && cs[csp-1] == '(') { cs[csp++] = p1[psp++]; cs[csp++] = p1[psp++]; } break; case '\'': cs[csp++] = '\\'; cs[csp++] = 'f'; cs[csp++] = rf==ITAL ? ITAL : ROM; name4('f','m'); cs[csp++] = '\\'; cs[csp++] = 'f'; cs[csp++] = 'P'; f = rf==ITAL ? ITAL : ROM; break; case 'f': if (ft == ITAL) { cs[csp++] = '\\'; cs[csp++] = '^'; cs[csp++] = 'f'; cs[csp++] = '\\'; cs[csp++] = '|'; /* trying | instead of ^ */ f = ITAL; } else cs[csp++] = 'f'; break; case 'j': if (ft == ITAL) { cs[csp++] = '\\'; cs[csp++] = '^'; cs[csp++] = 'j'; f = ITAL; } else cs[csp++] = 'j'; break; default: cs[csp++] = c; f = ft==ITAL ? ITAL : ROM; break; } return(f); } shim() { cs[csp++] = '\\'; cs[csp++] = '|'; } roman(c) int c; { cs[csp++] = '\\'; cs[csp++] = 'f'; cs[csp++] = ROM; cs[csp++] = c; cs[csp++] = '\\'; cs[csp++] = 'f'; cs[csp++] = 'P'; } name4(c1,c2) int c1,c2; { cs[csp++] = '\\'; cs[csp++] = '('; cs[csp++] = c1; cs[csp++] = c2; } se 'j': if (ft == ITAL) { cs[csp++] = '\\'; cs[csp++] = '^'; cs[csp++] = 'j'; f = ITAL; } else cs[csp++] = 'j'; break; default: cs[csp++] = c; f = ft==ITAL ? ITAL : ROM; break; } return(f); } shim() { cs[csp++] = '\\'; cs[csp++] = '|'; } roman(c) int c; { cs[csp++] = '\\'; cs[csp++] = 'cmd/eyacc/ 775 0 33 0 2552540073 5601 cmd/eyacc/makefile 444 0 33 627 2500310504 7332 SCCSID = "@(#)makefile 4.1 (Berkeley) 3/1/81" INSTALLDIR = ${DESTDIR}/usr/ucb eyacc: ey0.o ey1.o ey2.o ey3.o ey4.o ey5.o cc -o eyacc -z ey0.o ey1.o ey2.o ey3.o ey4.o ey5.o .c.o: cc -O -c $*.c clean: -rm -f *.o eyacc install: eyacc cp eyacc ${INSTALLDIR}/eyacc print: @ls -l | pr @pr READ_ME makefile @pr ey.h ey0.c ey1.c ey2.c ey3.c ey4.c ey5.c ey1.o: ey.h ey2.o: ey.h ey3.o: ey.h ey4.o: ey.h f/ C. /,"cmd/eyacc/READ_ME 444 0 33 1764 2500310466 6703 sccsid : "@(#)READ_ME 4.1 (Berkeley) 3/1/81" August 28, 1977 This directory contains source for a version of yacc needed by the Pascal parser. The differences between this yacc and a stadard version 6 yacc are indicated in a comment in y1.c. Note that the standard yacc parser will not work on the tables produced by "eyacc" and also that these changes are really useful only with a fairly large set of error recovery routines which are part of both "pi" and "pxp". The routines are language independent, but the method will only work on languages which have some redundancy in them... it is probably ill suited for C, but would work fine in ALGOL-60, ALGOL-W, EUCLID, LIS, SP/K, PL/1, ALPHARD, CLU, ... Sun Apr 8 21:43:08 PST 1979 A paper describing the method used by eyacc will appear in August in the SIGPLAN Boulder conference. Mon May 5, 1980 The eyacc in this directory has been modified to work for version 7. This involved syntax fixes and changing the I/O calls to standard version 7 calls. pendent, butcmd/eyacc/ey.h 444 0 33 10715 2500310470 6461 /* static char *sccsid = "@(#)ey.h 4.1 (Berkeley) 3/1/81"; */ /* (c) 1979 Regents of the University of California */ #include /* MANIFEST CONSTANT DEFINITIONS */ # define NTBASE 010000 /* internal codes for error and accept actions */ # define ERRCODE 8190 # define ACCEPTCODE 8191 # define errfileno stderr /* file number for erros and reduction message */ # define _tbitset 6 /* 16*_tbitset - 1 >= _nterms */ extern int tbitset; /* number of wds of lookahead vector */ extern int nolook; /* flag to turn off lookahed computations */ struct looksets { int lset[ _tbitset ]; } ; struct item { int *pitem; struct looksets *look; } ; /* output actions */ # define ERRACT 4096 # define SHIFTACT 8192 # define REDUCACT 12288 # define ACCEPTACT 16384 # define _REGISTER register extern int nstate ; /* number of states */ extern struct item *pstate[]; /* pointers to the descriptions of the states */ extern int apstate[]; /* index to actions in amem by state */ extern int actsiz; /* size of the action table array */ extern int tystate[]; /* contains type information about the states */ /* 0 = simple state, completely generated 1 = state awaiting generation 2 = state with an empty production in closure */ extern int stsize ; /* maximum number of states, at present */ extern int memsiz ; /* maximum size for productions and states */ extern int mem0[] ; /* added production */ extern int *mem ; extern int amem[]; /* action table storage */ extern int actsiz; /* action table size */ extern int memact ; /* next free action table position */ extern int nprod ; /* number of productions */ extern int *prdptr[]; /* pointers to descriptions of productions */ extern int prdlim; /* the number of productions allowed */ extern int levprd[] ; /* contains production levels to break conflicts */ /* last two bits code associativity: 0 = no definition 1 = left associative 2 = binary 3 = right associative bit 04 is 1 if the production has an action the high 13 bits have the production level */ extern int nterms ; /* number of terminals */ extern int nerrors; /* number of errors */ extern int fatfl; /* if on, error is fatal */ /* the ascii representations of the terminals */ extern int extval; /* start of output values */ extern struct sxxx1 {char *name; int value;} trmset[]; extern char cnames[]; extern int cnamsz; extern char *cnamp; extern int maxtmp ; /* the size of the temp arrays */ /* temporary vectors, indexable by states, terms, or nterms */ extern int temp1[]; extern int temp2[]; extern int trmlev[]; /* vector with the precedence of the terminals */ /* The levels are the same as for levprd, but bit 04 is always 0 */ /* the ascii representations of the nonterminals */ extern struct sxxx2 { char *name; } nontrst[]; extern int indgo[]; /* index to the stored goto table */ extern int ***pres; /* vector of pointers to the productions yielding each nonterminal */ extern struct looksets **pfirst; /* vector of pointers to first sets for each nonterminal */ extern int *pempty ; /* table of nonterminals nontrivially deriving e */ extern int nnonter ; /* the number of nonterminals */ extern int lastred ; /* the number of the last reduction of a state */ extern FILE *ftable; /* y.tab.c file */ extern FILE *foutput; /* y.output file */ extern FILE *cin; /* current input file */ extern FILE *cout; /* current output file */ extern int arrndx; extern int zzcwset; extern int zzpairs ; extern int zzgoent ; extern int zzgobest ; extern int zzacent ; extern int zzacsave ; extern int zznsave ; extern int zzclose ; extern int zzrrconf ; extern int zzsrconf ; extern char *ctokn; struct {int **ppi;} ; extern int ntlim ; /* maximum number of nonterminals */ extern int tlim ; /* maximum number of terminals */ extern int lineno; /* current line number */ extern int peekc; /* look-ahead character */ extern int tstates[]; extern int ntstates[]; extern int mstates[]; extern struct looksets clset; extern struct looksets lkst[]; extern int nlset; /* next lookahead set index */ extern int lsetsz; /* number of lookahead sets */ extern struct wset { int *pitem, flag, ws[ _tbitset ]; } wsets[]; extern int cwset; extern int wssize; extern int numbval; /* the value of an input number */ extern int rflag; /* ratfor flag */ extern int oflag; /* optimization flag */ extern int ndefout; /* number of defined symbols output */ extern int machine; # define UNIX 1 # define GCOS 2 # define IBM 3 struct looksets *flset(); oksets lkst[]; extern int nlset; /* next lookaheadcmd/eyacc/ey0.c 444 0 33 10137 2512176450 6545 ((static char *sccsid = "@(#)ey0.c 4.1 (Berkeley) 3/1/81"; /* (c) 1979 Regents of the University of California */ #include # define _actsize 2500 # define _memsize 3000 # define _nstates 700 # define _nterms 95 # define _nprod 300 # define _nnonterm 150 # define _tempsize 700 # define _cnamsz 3500 # define _lsetsize 600 # define _wsetsize 400 # define _tbitset 6 int tbitset; /* size of lookahed sets */ int nolook = 0; /* flag to suppress lookahead computations */ struct looksets { int lset[ _tbitset ]; } ; struct item { int *pitem; } ; /* this file contains the definitions for most externally known data */ int nstate = 0; /* number of states */ struct item *pstate[_nstates]; /* pointers to the descriptions of the states */ int apstate[_nstates]; /* index to the actions for the states */ int tystate[_nstates]; /* contains type information about the states */ int stsize = _nstates; /* maximum number of states, at present */ int memsiz = _memsize; /* maximum size for productions and states */ int mem0[_memsize] ; /* production storage */ int *mem = mem0; int amem[_actsize]; /* action table storage */ int actsiz = _actsize; /* action table size */ int memact = 0; /* next free action table position */ int nprod = 1; /* number of productions */ int *prdptr[_nprod]; /* pointers to descriptions of productions */ int prdlim = _nprod ; /* the maximum number of productions */ /* levprd - productions levels to break conflicts */ int levprd[_nprod] = {0,0}; /* last two bits code associativity: 0 = no definition 1 = left associative 2 = binary 3 = right associative bit 04 is 1 if the production has an action the high 13 bits have the production level */ int nterms = 0; /* number of terminals */ int tlim = _nterms ; /* the maximum number of terminals */ /* the ascii representations of the terminals */ int extval = 0; /* start of output values */ struct sxxx1 {char *name; int value;} trmset[_nterms]; char cnames[_cnamsz]; int cnamsz = _cnamsz; char *cnamp; int maxtmp = _tempsize; /* the size of the temp1 array */ int temp1[_tempsize]; /* temporary storage, indexed by terms + nterms or states */ int temp2[_nnonterm]; /* temporary storage indexed by nonterminals */ int trmlev[_nterms]; /* vector with the precedence of the terminals */ /* The levels are the same as for levprd, but bit 04 is always 0 */ /* the ascii representations of the nonterminals */ struct sxxx2 { char *name; } nontrst[_nnonterm]; int ntlim = _nnonterm ; /* limit to the number of nonterminals */ int indgo[_nstates]; /* index to the stored goto table */ int ***pres; /* vector of pointers to the productions yielding each nonterminal */ struct looksets **pfirst; /* vector of pointers to first sets for each nonterminal */ int *pempty = 0 ; /* table of nonterminals nontrivially deriving e */ int nnonter = -1; /* the number of nonterminals */ int lastred = 0; /* the number of the last reduction of a state */ FILE *ftable; /* y.tab.c file */ FILE *foutput; /* y.output file */ int arrndx; /* used in the output of arrays on y.tab.c */ int zzcwset = 0; int zzpairs = 0; int zzgoent = 0; int zzgobest = 0; int zzacent = 0; int zzacsave = 0; int zznsave = 0; int zzclose = 0; int zzsrconf = 0; int zzrrconf = 0; char *ctokn; int lineno = 1; /* current input line number */ int peekc = -1; /* look-ahead character */ int tstates[ _nterms ]; /* states generated by terminal gotos */ int ntstates[ _nnonterm ]; /* states generated by nonterminal gotos */ int mstates[ _nstates ]; /* chain of overflows of term/nonterm generation lists */ struct looksets clset; struct looksets lkst [ _lsetsize ]; int nlset = 0; /* next lookahead set index */ int lsetsz = _lsetsize; /* number of lookahead sets */ struct wset { int *pitem, flag, ws[_tbitset]; } wsets[ _wsetsize ]; int cwset; int wssize = _wsetsize; int numbval; /* the value of an input number */ int rflag = 0; /* ratfor flag */ int oflag = 0; /* optimization flag */ int ndefout = 3; /* number of defined symbols output */ int nerrors = 0; /* number of errors */ int fatfl = 1; /* if on, error is fatal */ int machine; /* has a number describing the machine */ next lookahead set index */ int lsetsz = _lsetsize; /* number of lookahead sets */ struct wset { int *pitem, flag, ws[_tbitset]; } wsets[ _wsetsize ]; int cwset; int wssize = _wsetsize; int numbval; /* the value of an input number */ int rflag = 0; /* ratfor flag */ int oflag = 0; /* optimization flag */ int ndefout = 3; /* number of defined symbols output */ int nerrors = 0; /* number of errors */ int fatfcmd/eyacc/ey1.c 444 0 33 20435 2500310472 6537 static char *sccsid = "@(#)ey1.c 4.1 (Berkeley) 3/1/81"; /* (c) 1979 Regents of the University of California */ # include "ey.h" /* * * * * e y a c c * * * * */ /**** NB ----- * * This version of yacc, known as "eyacc" has been slightly but * importantly modified to allow error recovery in the UNIX Pascal * translator "pi" and also in "pix". * * Changes here include: * * 1) Enumeration of test actions when "error" is an input token. * * 2) Change to the encoding of the action entries. Test entries * are encoded as the arithmetic inverse of the symbol being tested * for. This is an optimization that makes the parser run at the * same speed even though, with error productions and enumerated * lookaheads, it would normally be much slower. Of course the * same thing could be done to the regular yacc... * * 3) Different table sizes * * 4) Recognizes form feeds * * 5) Also most of the numbers for the sizes of the tables have been * increased, to an extent to allow for "eyacc"ing of the Pascal grammar * and of a grammar which I have for "EUCLID". * * There seem to be subtle dependencies between the various magic * numbers... I found some of them but to be safe most of the limits * are very generous... for this reason "eyacc" will most likely * have to run separate i/d... no matter. * * Bill Joy * Computer Science Division * EECS Department * University of California, Berkeley * Berkeley, California 94704 * * Office: (415) 642-4948 * Home: (415) 524-4510 ****/ /* features to be fixed up ... *** Print estimate of total space needed for parser *** Either list inputs on y.output, or list empty prdn's in states *** Mention nonterms not used (or, rules. not reduced) as nonfatal error *** Output states where conflicts were found by default on y.output *** Engage in newspeak: production=>grammar rules, term=>token, etc. *** handle # define, #ifdef, etc., in yacc actions, %{ %} */ /* new features to be added *** reductions by single productions ( by request ) *** follow sets for start symbol *** option to only do slr(1) *** easily changed array names on output *** allocate core, rather than predefined *** input controlled by a grammar *** support multiple choices for conflicts *** better conflict diagnostics */ extern char *symnam(); main(argc,argv) int argc; char *argv[]; { auto int n; whereami(); setup(argc,argv); /* initialize and read productions */ tbitset = (nterms+16)/16; cpres(); /* make table of which productions yield a given nonterminal */ cempty(); /* make a table of which nonterminals can match the empty string */ cpfir(); /* make a table of e free first lists */ stagen(); /* generate the states */ output(); /* write the states and the tables */ go2out(); summary(); windup(); } whereami(){ /* sets the variable machine to UNIX, GCOS, or IBM */ int i; i = 1; i = i << 30; if( i == 0 ) { machine = UNIX; return; } i = i << 4; if( i == 0 ){ machine = IBM; return; } machine = GCOS; } windup(){ /* no errors, do the optimization if appropriate */ char *cp; int i; if( !oflag ) cexit(0); switch( machine ){ case GCOS: if( rflag ){ if( foutput<0 ) system( "./yopt -r" ); else system( "./yopt -rv" ); } else { if( foutput<0 ) system( "./yopt" ); else system( "./yopt -v" ); } cexit(0); /* terminate */ case UNIX: cp = "/usr/nlib/yaccopt"; if( rflag ) execl( cp, cp, (foutput<0)?"-r":"-rv", 0 ); else if( foutput<0 ) execl( cp, cp, 0 ); else execl( cp, cp, "-v", 0 ); error( "optimization execl call fails" ); case IBM: if( rflag ){ if( foutput<0 ) system( "MH2019.yaccopt -r" ); else system( "MH2019.yaccopt -rv" ); } else { if( foutput<0 ) system( "MH2019.yaccopt" ); else system( "MH2019.yaccopt -v" ); } cexit(0); } } settty() /* sets the output file to y.output */ { cflush( foutput ); /* a bit of a cheat */ cout = foutput; } settab(){ /* sets the output file to y.tab.c */ cflush( ftable ); cout = ftable; } char *chcopy( p, q ) char *p, *q; { /* copies string q into p, returning next free char ptr */ while( *p = *q++ ) ++p; return( p ); } char *writem(pp) struct item *pp; { /* creates output string for item pointed to by pp */ int i,*p; static char sarr[100]; char *q; for( p=pp->pitem; *p>0 ; ++p ) ; p = prdptr[-*p]; q = chcopy( sarr, nontrst[*p-NTBASE].name ); q = chcopy( q, " : " ); for(;;){ *q++ = ++p==(pp->pitem) ? '_' : ' '; if((i = *p) <= 0) break; q = chcopy( q, symnam(i) ); } *q = '\0' ; return( sarr ); } char *symnam(i){ /* return a pointer to the name of symbol i */ char *cp; cp = (i>=NTBASE) ? nontrst[i-NTBASE].name : trmset[i].name ; if( *cp == ' ' ) ++cp; return( cp ); } summary(){ /* output the summary on the tty */ int i, s, *pn; if((( !rflag ){ settab(); fprintf( cout , "\nint nterms %d;",nterms); fprintf( cout , "\nint nnonter %d;", nnonter); fprintf( cout , "\nint nstate %d;", nstate); fprintf( cout , "\nchar *yysterm[] {"); for (i=1;i<=nterms;i++) if( trmset[i].value >= 0400 ) fprintf( cout , "\n\"%s\",",symnam(i)); fprintf( cout , "\n0 };\n" ); fprintf( cout , "\nchar *yysnter[] {"); for (i=0;i= memsiz) error("memory overflow"); return(omem); } aryfil( v, n, c ) int *v,n,c; { /* set elements 0 through n-1 to c */ int i; for( i=0; ilset; if( pp == 0 ) fprintf( cout , "\tNULL"); else { fprintf( cout , " { " ); for( j=1; j<=nterms; ++j ){ if( (pp[j>>4]>>(j&017) )&01 != 0 ) fprintf( cout , "%s ", symnam(j) ); } fprintf( cout , "}" ); } } d c */ /* a may equal b */ /* return 1 if c is not a subset of b, 0 otherwise */ _REGISTER int i, x, sub; sub = 0; for( i=0; i= 2 && argv[1][0] == '-' ) { while( *++(argv[1]) ){ switch( *argv[1] ){ case 'v': case 'V': foutput = copen("y.output", 'w' ); if( foutput == 0 ) error( "cannot open y.output"); continue; case 'o': case 'O': oflag = 1; continue; case 'r': case 'R': oflag = 1; rflag = 1; continue; default: error( "illegal option: %c", *argv[1]); } } argv++; argc--; } ftable = copen( oflag ? "yacc.tmp" : "y.tab.c" , 'w' ); if( ftable==0 ) error( "cannot open table file" ); if( argc > 1 ) { cin = copen( argv[1], 'r' ); if( cin == 0 ) error( "cannot open input" ); } settab(); fprintf( cout , "#\n"); ctokn = "$end"; defin(0); /* eof */ extval = 0400; /* beginning of assigned values */ ctokn = "error"; defin(0); ctokn = "$accept"; defin(1); mem=mem0; cnamp = cnames; lev=0; i=0; while( ( t = gettok() ) != EOF ) { switch( t ){ case IDENTIFIER: j = chfind(0); trmlev[j] = lev; continue; case ',': case ';': continue; case TERM: lev=0; continue; case LEFT: lev=(++i<<3)|01; continue; case BINARY: lev=(++i<<3)|02; continue; case RIGHT: lev=(++i<<3)|03; continue; case MARK: defout(); if( rflag ){ /* RATFOR */ fprintf( cout , "define yyerrok yyerrf = 0\n" ); fprintf( cout , "define yyclearin yychar = -1\n" ); fprintf( cout , "subroutine yyactr(yyprdn)\n"); fprintf( cout , "common/yycomn/yylval,yyval,yypv,yyvalv(150)\n" ); fprintf( cout , "common/yylcom/yychar,yyerrf,yydebu\n" ); fprintf( cout , "integer yychar, yyerrf, yydebu\n" ); fprintf( cout , "integer yyprdn,yyval,yylval,yypv,yyvalv\n" ); } else { fprintf( cout , "#define yyclearin yychar = -1\n" ); fprintf( cout , "#define yyerrok yyerrflag = 0\n" ); fprintf( cout , "extern int yychar, yyerrflag;\n" ); fprintf( cout , "\nint yyval 0;\nint *yypv;\nint yylval 0;"); fprintf( cout , "\nyyactr(__np__){\n"); } break; case LCURLY: defout(); cpycode(); continue; case NUMBER: trmset[j].value = numbval; if( j < ndefout && j>2 ) error("please define type # of %s earlier", trmset[j].name ); continue; default: error("bad precedence syntax, input %d", t ); } break; } prdptr[0]=mem; /* added production */ *mem++ = NTBASE; *mem++ = NTBASE+1; *mem++ = 1; *mem++ = 0; prdptr[1]=mem; i=0; /* i is 0 when a rule can begin, 1 otherwise */ for(;;) switch( t=gettok() ) { case C_IDENTIFIER: if( mem == prdptr[1] ) { /* first time */ if( rflag ){ fprintf( cout , "goto 1000\n" ); } else fprintf( cout , "\nswitch(__np__){\n"); } if( i != 0 ) error( "previous rule not terminated" ); *mem = chfind(1); if( *mem < NTBASE )error( "token illegal on lhs of grammar rule" ); i=1; ++mem; continue; case IDENTIFIER: *mem=chfind(1); if(*mem < NTBASE)levprd[nprod]=trmlev[*mem]; mem++; if(i==0) error("missing :"); continue; case '=': levprd[nprod] |= 04; if( i==0 ) error("semicolon preceeds action"); fprintf( cout , rflag?"\n%d ":"\ncase %d:", nprod ); cpyact(); fprintf( cout , rflag ? " return" : " break;" ); case '|': case ';': if(i){ *mem++ = -nprod; prdptr[++nprod] = mem; levprd[nprod]=0; i=0;} if (t=='|'){i=1;*mem++ = *prdptr[nprod-1];} continue; case 0: /* End Of File */ case EOF: case MARK: if( i != 0 ) error( "rule not terminated before %%%% or EOF" ); settab(); finact(); /* copy the programs which follow the rules */ if( t == MARK ){ while (( c=fgetc( cin)) != EOF ) fputc(c,cout); } return; case PREC: if( i==0 ) error( "%%prec must appear inside rule" ); if( gettok()!=IDENTIFIER)error("illegal %%prec syntax" ); j=chfind(2); if(j>=NTBASE)error("nonterminal %s illegal after %%prec", nontrst[j-NTBASE].name); levprd[nprod]=trmlev[j]; continue; case LCURLY: if( i!=0 ) error( "%%{ appears within a rule" ); cpycode(); continue; default: error( "syntax error, input %d", t ); } } finact(){ /* finish action routine */ register i; if( rflag ){ fprintf( cout , "\n1000 goto(" ); for( i=1; i= ntlim ) error("too many nonterminals, limit %d",ntlim); nontrst[nnonter].name = ctokn; return( NTBASE + nnonter ); } else { if( ++nterms >= tlim ) error("too many terminals, limit %d",tlim ); trmset[nterms].name = ctokn; if( ctokn[0]==' ' && ctokn[2]=='\0' ) /* single character literal */ trmset[nterms].value = ctokn[1]; else if ( ctokn[0]==' ' && ctokn[1]=='\\' ) { /* escape sequence */ if( ctokn[3] == '\0' ){ /* single character escape sequence */ switch ( ctokn[2] ){ /* character which is escaped */ case 'n': trmset[nterms].value = '\n'; break; case 'r': trmset[nterms].value = '\r'; break; case 'b': trmset[nterms].value = '\b'; break; case 't': trmset[nterms].value = '\t'; break; case '\'': trmset[nterms].value = '\''; break; case '"': trmset[nterms].value = '"'; break; case '\\': trmset[nterms].value = '\\'; break; default: error( "invalid escape" ); } } else if( ctokn[2((] <= '7' && ctokn[2]>='0' ){ /* \nnn sequence */ if( ctokn[3]<'0' || ctokn[3] > '7' || ctokn[4]<'0' || ctokn[4]>'7' || ctokn[5] != '\0' ) error("illegal \\nnn construction" ); trmset[nterms].value = 64*(ctokn[2]-'0')+8*(ctokn[3]-'0')+ctokn[4]-'0'; if( trmset[nterms].value == 0 ) error( "'\\000' is illegal" ); } } else { trmset[nterms].value = extval++; } trmlev[nterms] = 0; return( nterms ); } } defout(){ /* write out the defines (at the end of the declaration section) */ _REGISTER int i, c; _REGISTER char *cp; for( i=ndefout; i<=nterms; ++i ){ cp = trmset[i].name; if( *cp == ' ' ) ++cp; /* literals */ for( ; (c= *cp)!='\0'; ++cp ){ if( c>='a' && c<='z' || c>='A' && c<='Z' || c>='0' && c<='9' || c=='_' ) ; /* VOID */ else goto nodef; } /* define it */ fprintf( cout , "%c define %s %d\n", rflag?' ':'#', trmset[i].name, trmset[i].value ); nodef: ; } ndefout = nterms+1; } chstash( c ){ /* put character away into cnames */ if( cnamp >= &cnames[cnamsz] ) error("too many characters in id's and literals" ); else *cnamp++ = c; } int gettok() { int j, base; static int peekline; /* number of '\n' seen in lookahead */ auto int c, match, reserve; begin: reserve = 0; if( peekc>=0 ) { c = peekc; lineno += peekline; peekc = -1; peekline = 0; } else c = fgetc( cin); while( c==' ' || c=='\n' || c=='\t' || c == '\014'){ if( c == '\n' ) ++lineno; c=fgetc( cin); } if (c=='/') {if (fgetc( cin)!='*')error("illegal /"); c=fgetc( cin); while(c != EOF) { if( c == '\n' ) ++lineno; if (c=='*') {if((c=fgetc( cin))=='/')break;} else c=fgetc( cin);} if (!c) return(0); goto begin;} j=0; switch(c){ case '"': case '\'': match = c; ctokn = cnamp; chstash( ' ' ); while(1){ c = fgetc( cin); if( c == '\n' || c == '\0' ) error("illegal or missing ' or \""); if( c == '\\' ){ c = fgetc( cin); chstash( '\\' ); } else if( c == match ) break; chstash( c ); } break; case '%': case '\\': switch(c=fgetc( cin)) {case '0': return(TERM); case '<': return(LEFT); case '2': return(BINARY); case '>': return(RIGHT); case '%': case '\\': return(MARK); case '=': return(PREC); case '{': return(LCURLY); default: reserve = 1; } default: if( c >= '0' && c <= '9' ){ /* number */ numbval = c-'0' ; base = (c=='0') ? 8 : 10 ; for( c=fgetc( cin); c>='0' && c<='9'; c=fgetc( cin) ){ numbval = numbval*base + c - '0'; } peekc = c; return(NUMBER); } else if( (c>='a'&&c<='z')||(c>='A'&&c<='Z')||c=='_'||c=='.'||c=='$'){ ctokn = cnamp; while( (c>='a'&&c<='z') || (c>='A'&&c<='Z') || (c>='0'&&c<='9') || c=='_' || c=='.' || c=='$' ) { chstash( c ); if( peekc>=0 ) { c = peekc; peekc = -1; } else c = fgetc( cin); } } else return(c); peekc=c; } chstash( '\0' ); if( reserve ){ /* find a reserved word */ if( compare("term")) return( TERM ); if( compare("TERM")) return( TERM ); if( compare("token")) return( TERM ); if( compare("TOKEN")) return( TERM ); if( compare("left")) return( LEFT ); if( compare("LEFT")) return( LEFT ); if( compare("nonassoc")) return( BINARY ); if( compare("NONASSOC")) return( BINARY ); if( compare("binary")) return( BINARY ); if( compare("BINARY")) return( BINARY ); if( compare("right")) return( RIGHT ); if( compare("RIGHT")) return( RIGHT ); if( compare("prec")) return( PREC ); if( compare("PREC")) return( PREC ); error("invalid escape, or illegal reserved word: %s", ctokn ); } /* look ahead to distinguish IDENTIFIER from C_IDENTIFIER */ look: while( peekc==' ' || peekc=='\t' || peekc == '\n' || peekc == '\014' ) { if( peekc == '\n' ) ++peekline; peekc = fgetc( cin); } if( peekc != ':' ) return( IDENTIFIER ); peekc = -1; lineno += peekline; peekline = 0; return( C_IDENTIFIER ); } chfind(t) { int i,j; if (ctokn[0]==' ')t=0; for(i=1;i<=nterms;i++) if(compare(trmset[i].name)){ cnamp = ctokn; return( i ); } for(i=1;i<=nnonter;i++) if(compare(nontrst[i].name)) { cnamp = ctokn; return( i+NTBASE ); } /* cannot find name */ if( t>1 && ctokn[0] != ' ' ) error( "%s should have been defined earlier", ctokn ); return( defin( t ) ); } cpycode(){ /* copies code between \{ and \} */ int c; c = fgetc( cin); if( c == '\n' ) { c = fgetc( cin); lineno++; } while( c != EOF ){ if( c=='\\' ) if( (c=fgetc( cin)) == '}' ) return; else fputc('\\',cout); if( c=='%' ) if( (c=fgetc( cin)) == '}' ) return; else fputc('%',cout); fputc( c, cout ); if( c == '\n' ) ++lineno; c = fgetc( cin); } error("eof before %%}"); } cpyact(){ /* copy C action to the next ; or closing } */ int brac, c, match, *i, j, s; brac = 0; loop: c = fgetc( cin); swt: switch( c ){ case ';': if( brac == 0 ){ fputc( c, cout ); return; } goto lcopy; case '{': brac++; goto lcopy; case '$': s = 1; c = fgetc( cin); if( c == '$' ){ fprintf( cout , "yyval"); goto loop; } if( c == '-' ){ s = -s; c = fgetc( cin); } if( c>='0' && c <= '9' ){ j=0; while( c>='0' && c<= '9' ){ j= j*10+c-'0'; c = fgetc( cin); } if( rflag ) fprintf( cout , "yyvalv(yypv%c%d)", s==1?'+':'-', j ); else fprintf( cout , "yypv[%d]", s*j ); goto swt; } fputc( '$' , cout); if( s<0 ) fputc('-', cout); goto swt; case '}': brac--; if( brac == 0 ){ fputc( c , cout); return; } goto lcopy; case '/': /* look for comments */ fputc( c ,cout); c = fgetc( cin); if( c != '*' ) goto swt; /* it really is a comment */ fputc( c , cout); while( (c=fgetc( cin)) != EOF ){ if( c=='*' ){ fputc( c , cout); if( (c=fgetc( cin)) == '/' ) goto lcopy; } fputc( c , cout); } error( "EOF inside comment" ); case '\'': /* character constant */ match = '\''; goto string; case '"': /* character string */ match = '"'; string: fputc( c , cout); while( (c=fgetc( cin)) != EOF ){ if( c=='\\' ){ fputc( c , cout); c=fgetc( cin); } else if( c==match ) goto lcopy; fputc( c , cout); } error( "EOF in string or character constant" ); case '\0': error("action does not terminate"); case '\n': ++lineno; goto lcopy; } lcopy: fputc( c , cout); goto loop; } inside comment" ); case '\'': /* character constant */ match = '\''; goto string; case '"': /* character string */ match = '"'; string: fputc( c , cout); while( (c=fgetc( cin))cmd/eyacc/ey3.c 444 0 33 23216 2500310476 6545 static char *sccsid = "@(#)ey3.c 4.1 (Berkeley) 3/1/81"; /* (c) 1979 Regents of the University of California */ # include "ey.h" cpres(){ /* conpute an array with the beginnings of productions yielding given nonterminals The array pres points to these lists */ int i,j,c; pres = yalloc(nnonter+1); for(i=0;i<=nnonter;i++){ c = i+NTBASE; pres[i] = mem; fatfl = 0; /* make undefined symbols nonfatal */ for(j=0;j 0 ; ++p ) { if( ch < NTBASE ) { wsets[i].ws[ch>>4] |= (1 << (ch&017) ); break; } else if( !pempty[ch-NTBASE] ) break; } } } /* now, reflect transitivity */ changes = 1; while( changes ){ changes = 0; for( i=0; i<=nnonter; ++i ){ t = pres[i+1]; for( s=pres[i]; s= 0; ++p ) { changes |= UNION( wsets[i].ws, wsets[i].ws, wsets[ch].ws ); if( !pempty[ch] ) break; } } } } for( i=0; i<=nnonter; i++ ) pfirst[i] = flset( wsets[i].ws ); if( !indebug ) return; settty(); for( i=0; i<=nnonter; i++ ){ fprintf( cout , "\n%s: ", nontrst[i].name ); prlook( pfirst[i] ); fprintf( cout , " %d\n", pempty[i] ); } } state(c){ /* sorts last state,and sees if it equals earlier ones. returns state number */ int s,size1,size2; _REGISTER i; struct item *p1, *p2, *k, *l, *q1, *q2; p1 = pstate[nstate]; p2 = pstate[nstate+1]; if(p1==p2) return(0); /* null state */ /* sort the items */ for(k=p2-1;k>p1;k--) { /* make k the biggest */ for(l=k-1;l>=p1;--l)if( l->pitem > k->pitem ){ s = k->pitem; k->pitem = l->pitem; l->pitem = s; s = k->look; k->look = l->look; l->look = s; } } size1 = p2 - p1; /* size of state */ for( i= (c>=NTBASE)?ntstates[c-NTBASE]:tstates[c]; i != 0; i = mstates[i] ) { /* get ith state */ q1 = pstate[i]; q2 = pstate[i+1]; size2 = q2 - q1; if (size1 != size2) continue; k=p1; for(l=q1;lpitem != k->pitem ) break; ++k; } if (l != q2) continue; /* found it */ pstate[nstate+1] = pstate[nstate]; /* delete last state */ /* fix up lookaheads */ k=p1; for( l=q1; llook->lset, k->look->lset ) ) { tystate[i] = 1; /* register the new set */ l->look = flset( &clset ); } ++k; } return (i); } /* state is new */ pstate[nstate+2] = p2; if(nstate+1 >= stsize) error("too many states"); if( c >= NTBASE ){ mstates[(( nstate ] = ntstates[ c-NTBASE ]; ntstates[ c-NTBASE ] = nstate; } else { mstates[ nstate ] = tstates[ c ]; tstates[ c ] = nstate; } tystate[nstate]=1; return(nstate++); } int pidebug = 0; /* debugging flag for putitem */ putitem ( ptr, lptr ) int *ptr; struct looksets *lptr;{ int *jip, k; struct item *i, *j; if( pidebug ) { settty(); fprintf( cout , "putitem(%s), state %d\n", writem(&ptr), nstate ); } /* see if it's there */ j = pstate[nstate+1]; for( i=pstate[nstate]; ipitem == ptr) { error("yacc error--duplicate item"); } /* not there */ j->pitem = ptr; j->look = flset( lptr ); pstate[nstate+1] = ++j; jip = j; if(jip-mem0 >= memsiz) error("out of state space"); } cempty(){ /* mark nonterminals which derive the empty string */ int i, *p; /* set pempty to 0 */ pempty = yalloc( nnonter ); aryfil( pempty, nnonter+1, 0 ); for( i=1; i=NTBASE && pempty[*p-NTBASE]!=0 ; ++p ) ; if( *p < 0 ){ /* we have a nontrivially empty nonterminal */ pempty[*prdptr[i]-NTBASE] = 1; goto again; /* got one ... try for another */ } } } } int gsdebug = 0; stagen(){ /* generate the states */ int i, j, k, c; /* initialize */ nstate = 0; pstate[0] = pstate[1] = mem; aryfil( clset.lset, tbitset, 0 ); putitem( prdptr[0]+1, &clset ); tystate[0] = 1; nstate = 1; pstate[2] = pstate[1]; memact = 0; aryfil( amem, actsiz, 0 ); /* now, the main state generation loop */ more: for( i=0; ipitem; wsets[cwset].flag = 1; /* this item must get closed */ for( k=0; klook->lset[k]; ++cwset; } /* now, go through the loop, closing each item */ work = 1; while( work ){ work = 0; for( j=0; j0 ){ if( ch < NTBASE ){ /* terminal symbol */ clset.lset[ch>>4] |= (1<<(ch&017)); break; } /* nonterminal symbol */ UNION( clset.lset, clset.lset, pfirst[ch-NTBASE] ); if( !pempty[ch-NTBASE] ) break; } if( ch<=0 ) UNION( clset.lset, clset.lset, wsets[k].ws ); } } /* now loop over productions derived from c */ c -= NTBASE; /* c is now nonterminal number */ t = pres[c+1]; for( s=pres[c]; s= wssize ) error( "working set overflow" ); wsets[cwset].pitem = *s; wsets[cwset].flag = 1; if( nolook ){ cwset++; goto nexts; } work = 1; for( k=0; k zzcwset ) zzcwset = cwset; if( !cldebug ) return; settty(); fprintf( cout , "\nState %d, nolook = %d\n", i, nolook ); for( j=0; jlset; v = lkst[i].lset; w = & v[tbitset]; while( v= lsetsz )error("too many lookahead sets"); for( j=0; jlset[j]; } return( & lkst[nlset++]); } ide if the lookahead set pointed to by p is known */ /* return pointer to a perminent location for the set */ int j, *w; _REGISTER *u, *v, i; for( i=0; ilset; v = lkst[i].lset; w = & v[tbitset]; while( v=cmd/eyacc/ey4.c 444 0 33 24435 2500310500 6536 static char *sccsid = "@(#)ey4.c 4.1 (Berkeley) 3/1/81"; /* (c) 1979 Regents of the University of California */ # include "ey.h" output(){ /* print the output for the states */ int i, j, k, c; settab(); arrset("yyact"); for( i=0; i0 && c>4])&(1<<(k&017))) != 0 ) { if( temp1[k] == 0 ) temp1[k] = c; else if( temp1[k]<0 ){ /* reduce/reduce conflict */ settty(); fprintf( cout , "\n%d: reduce/reduce conflict (red'ns %d and %d ) on %s", i, -temp1[k], lastred, symnam(k) ); if( -temp1[k] > lastred ) temp1[k] = -lastred; ++zzrrconf; settab(); } else { /* potential shift/reduce conflict */ switch( precftn( lastred, k ) ) { case 0: /* precedence does not apply */ settty(); fprintf( cout , "\n%d: shift/reduce conflict (shift %d, red'n %d) on %s", i, temp1[k], lastred, symnam(k) ); ++zzsrconf; settab(); break; case 1: /* reduce */ temp1[k] = -lastred; break; case 2: /* error, binary operator */ temp1[k] = ERRCODE; break; case 3: /* shift ... leave the entry alone */ break; } } } } } } wract(i); } settab(); arrdone(); /* now, output the pointers to the action array */ /* also output the info about reductions */ prred(); } prred(){ /* print the information about the actions and the reductions */ int index, i; arrset("yypact"); index = 1; /* position in the output table */ for( i=0; i0 ){ /* the state is real */ temp1[i] = index; arrval( index ); index += tystate[i]; } else { arrval( temp1[-((tystate[i]] ); } } arrdone(); arrset("yyr1"); for( i=1; i j ){ /* no actions */ return(0); } j -= off; for( k=0; k= actsiz ) error("action table overflow"); if( k+l >= memact ) memact = k+l; amem[k+l] = p[off+l]; } } if( pkdebug ){ for( k=0; k times ){ best = cbest; times = count; } } /* best is now the default entry */ zzgobest += (times-1)*2; settab(); for( j=0; j<=nstate; ++j ){ if( tystate[j] != 0 && tystate[j]!=best ){ arrval( j ); arrval( tystate[j] ); offset += 2; zzgoent += 2; } } /* now, the default */ zzgoent += 2; arrval( -1 ); arrval( best ); offset += 2; } arrdone(); arrset("yypgo"); for( i=1; i<=nnonter; ++i ) arrval( temp2[i] ); arrdone(); } int g2debug = 0; go2gen(c){ /* output the gotos for nonterminal c */ int i, work, cc; struct item *p, *q; /* first, find nonterminals with gotos on c */ aryfil( temp1, nnonter+1, 0 ); temp1[c] = 1; work = 1; while( work ){ work = 0; for( i=0; i= 0 ){ /* cc is a nonterminal */ if( temp1[cc] != 0 ){ /* cc has a goto on c */ cc = *prdptr[i]-NTBASE; /* thus, the left side of production i does too */ if( temp1[cc] == 0 ){ work = 1; temp1[cc] = 1; } } } } } /* now, we have temp1[c] = 1 if a goto on c in closure of cc */ if( g2debug ){ settty(); fprintf( cout , "%s: gotos on ", nontrst[c].name ); for( i=0; i<=nnonter; ++i ) if( temp1[i]) fprintf( cout , "%s ", nontrst[i].name); fprintf( cout , "\n"); } /* now, go through and put gotos into tystate */ aryfil( tystate, nstate, 0 ); settty(); fprintf( cout , "\nnonterminal %s\n", nontrst[c].name ); for( i=0; ipitem) >= NTBASE ){ if( temp1[cc -= NTBASE] ){ /* goto on c is possible */ tystate[i] = amem[indgo[i]+c]; break; } } } if( tystate[i] ) fprintf( cout , "\t%d\t%d\n", i, tystate[i]); } } precftn(r,t){ /* decide a shift/reduce conflict by precedence. Returns 0 if action is 'do nothing',1 if action is reduce, 2 if the action is 'error,binary operator' and 3 if the action is 'reduce'. */ int lp,lt; lp = levprd[r]; lt = trmlev[t]; if ((lt==0)||((lp&03)==0))return(0); if((lt>>3) == (lp>>3)){ return(lt&03); } if((lt>>3) > (lp>>3)) return(3); return(1); } int cdebug = 0; /* debug for common states */ wract(i){ /* output state i */ /* temp1 has the actions, lastred the default */ int p, p0, p1, size; int ntimes, tred, count, j; struct item *q0, *q1; /* find the best choice for lastred */ lastred = 0; ntimes = 0; /***** UCB MOD - full state spec if shift on error *****/ if (temp1[2] <= 0) for( j=1; j<=nterms; ++j ){ if( temp1[j] >= 0 ) continue; if( temp1[j]+lastred == 0 ) continue; /* count the number of appearances of temp1[j] */ count = 0; tred = -temp1[j]; for( p=1; p<=nterms; ++p ){ if( temp1[p]+tred == 0 ) ++count; } if( count >ntimes ){ lastred = tred; ntimes = count; } } /* clear out entries in temp1 which equal lastred */ for( p=1; p<= nterms; ++p ) if( temp1[p]+lastred == 0 )temp1[p]=0; /* write out the state */ /* first, check for equality with another state */ /* see if there is a nonterminal with all dots before it. */ p0 = 0; q1 = pstate[i+1]; for( q0=pstate[i]; q0pitem) ) < NTBASE ) goto standard; if( p0 == 0 ) p0 = p1; else if( p0 != p1 ) goto standard; } /* now, all items have dots before p0 */ if( cdebug ){ settty(); fprintf( cout , "state %d, pre-nonterminal %s\n",i,nontrst[p0-NTBASE].name); } for( j=0; jpitem) != p0 ) goto nextj; } /* we have a match with state j ! */ tystate[i] = -j; zzacsave += tystate[j]; zznsave++; wrstate(i); return; nextj: ; } standard: tystate[i] = 2; wrstate(i); size = 0; for( p0=1; p0<=nterms; ++p0 ) if( (p1=temp1[p0])!=0 ) { /***** UCB MOD - test actions are negative of symbol to be tested this speeds up the parser as it is easy to check for *****/ arrval( -trmset[p0].value ); if( p1 < 0 ) arrval( REDUCACT - p1 ); else if( p1 == ACCEPTCODE ) arrval( ACCEPTACT ); else if( p1 == ERRCODE ) arrval( ERRACT ); else arrval( SHIFTACT + p1 ); size += 2; } if( lastred ) arrval( REDUCACT + lastred ); else arrval( ERRACT ); tystate[i] = size+1; /* store entry size in tystate */ zzacent += (size+1); return; } wrstate(i){ /* writes state i */ int j0,j1,s; struct item *pp, *qq; settty(); fprintf( cout , "\nstate %d\n",i); qq = pstate[i+1]; for( pp=pstate[i]; pp0 ){ /* shift, error, or accept */ if( j1 == ACCEPTCODE ) fprintf( cout , "accept" ); else if( j1 == ERRCODE ) fprintf( cout , "error" ); else fprintf( cout , "shift %d", j1 ); } else fprintf( cout , "reduce %d",-j1 ); } /* output the final production */ if( lastred ) fprintf( cout , "\n\t. reduce %d\n\n", lastred ); else fprintf( cout , "\n\t. error\n\n" ); ret: settab(); } out , "\n\t%s ", symnam(j0) ); if( j1>0 ){ /* shift, error, or accept */ if( j1 == ACCEPTCODE ) fprintf( cout , "accept" ); else if( j1 == ERRCODE ) fprintf( cout , "error" ); cmd/eyacc/ey5.c 444 0 33 1511 2500310503 6510 static char *sccsid = "@(#)ey5.c 4.1 (Berkeley) 3/1/81"; /* (c) 1979 Regents of the University of California */ /* fake portable I/O routines, for those sites so backward as to not have the port. library */ /* munged for standard i/o library: peter and louise 5 may 80 */ #include FILE *cin, *cout; FILE *copen( s, c ) char *s; char c; { FILE *f; if( c == 'r' ){ f = fopen( s, "r" ); } else if( c == 'a' ){ f = fopen( s, "a" ); fseek( f, 0L, 2 ); } else { /* c == w */ f = fopen( s, "w" ); } return( f ); } cflush(x) FILE *x; { /* fake! sets file to x */ fflush( cout ); cout = x; } system(){ error( "The function \"system\" is called" ); } cclose(i) FILE *i; { fclose(i); } cexit(i){ fflush( cout ); if ( i != 0 ) { abort(); } exit(i); } en( s, c ) char *s; char c; { FILE *f; if( c == 'r' ){ f = fopen( s, "r" ); } else if( c == 'a' ){ f = fopen( s, "a" ); fseek( f, 0L, 2 ); } else {cmd/what.c 444 0 33 1463 2423060000 5671 ((static char *sccsid = "@(#)what.c 4.1 (Berkeley) 10/15/80"; #include /* * what */ char *infile = "Standard input"; main(argc, argv) int argc; char *argv[]; { argc--, argv++; do { if (argc > 0) { if (freopen(argv[0], "r", stdin) == NULL) { perror(argv[0]); exit(1); } infile = argv[0]; printf("%s\n", infile); argc--, argv++; } fseek(stdin, (long) 0, 0); find(); } while (argc > 0); } find() { static char buf[BUFSIZ]; register char *cp; register int c, cc; register char *pat; contin: while ((c = getchar()) != EOF) if (c == '@') { for (pat = "(#)"; *pat; pat++) if ((c = getchar()) != *pat) goto contin; putchar('\t'); while ((c = getchar()) != EOF && c && c != '"' && c != '>' && c != '\n') putchar(c); putchar('\n'); } } nfile = argv[0]; printf("%s\n", infile); argc--, argv++; } fseek(stdin, (long) 0, 0); find(); } while (argc > 0); } find() { static char buf[BUFSIZ]; register char *cp; register int c, cc;cmd/as/ 775 0 33 0 2552521152 5115 cmd/as/:rofix 755 0 33 51 2376052310 6302 ed $1 < #include #include "as.h" #include "asscan.h" #include "assyms.h" /* * Managers for chunks of symbols allocated from calloc() * We maintain a linked list of such chunks. * */ struct allocbox *allochead; /*head of chunk list*/ struct allocbox *alloctail; /*tail*/ struct allocbox *newbox; /*for creating a new chunk*/ struct symtab *nextsym; /*next symbol free*/ int symsleft; /*slots left in current chunk*/ struct symtab **symptrs; struct symtab **symdelim[NLOC + NLOC +1]; struct symtab **symptrub; /* * Managers for the dynamically extendable hash table */ struct hashdallop *htab; struct instab *itab[NINST]; /*maps opcodes to instructions*/ /* * Counts what went into the symbol table, so that the * size of the symbol table can be computed. */ int nsyms; /* total number in the symbol table */ int njxxx; /* number of jxxx entrys */ int nforgotten; /* number of symbols erroneously entered */ int nlabels; /* number of label entries */ int hshused; /* number of hash slots used */ /* * Managers of the symbol literal storage. * If we have flexible names, then we allocate BUFSIZ long * string, and pack strings into that. Otherwise, we allocate * symbol storage in fixed hunks NCPS long when we allocate space * for other symbol attributes. */ #ifdef FLEXNAMES struct strpool *strplhead = 0; #endif FLEXNAMES symtabinit() { allochead = 0; alloctail = 0; nextsym = 0; symsleft = 0; #ifdef FLEXNAMES strpoolalloc(); /* get the first strpool storage area */ #endif FLEXNAMES htab = 0; htaballoc(); /* get the first part of the hash table */ } /* * Install all known instructions in the symbol table */ syminstall() { register struct instab *ip; register struct symtab **hp; register char *p1, *p2; #ifdef FLEXNAMES for (ip = (struct instab *)instab; ip->s_name != 0; ip++) { #else not FLEXNAMES for (ip = (struct instab *)instab; ip->s_name[0] != '\0'; ip++){ #endif not FLEXNAMES p1 = ip->s_name; p2 = yytext; while (*p2++ = *p1++); hp = lookup(0); /* 0 => don't install this*/ if (*hp==NULL) { *hp = (struct symtab *)ip; if ( (ip->s_tag!=INSTn) && (ip->s_tag!=INST0) && (ip->s_tag!=0)) continue; /* was pseudo-op */ itab[ip->i_opcode & 0xFF] = ip; } } } /*end of syminstall*/ /* * Assign final values to symbols, * and overwrite the index field with its relative position in * the symbol table we give to the loader. */ extern struct exec hdr; freezesymtab() { register struct symtab *sp; long bs; register int relpos = 0; register struct symtab *ubsp; register struct allocbox *allocwalk; DECLITERATE(allocwalk, sp, ubsp) { if (sp->s_tag >= IGNOREBOUND) continue; /*totally ignore jxxx entries */ /* * Ignore stabs, but give them a symbol table index */ if (sp->s_type & STABFLAG) goto assignindex; if ((sp->s_type&XTYPE)==XUNDEF) sp->s_type = XXTRN+XUNDEF; else if ((sp->s_type&XTYPE)==XDATA) sp->s_value += usedot[sp->s_index].e_xvalue; else if ((sp->s_type&XTYPE)==XTEXT) sp->s_value += usedot[sp->s_index].e_xvalue; else if ((sp->s_type&XTYPE)==XBSS) { bs = sp->s_value; sp->s_value = hdr.a_bss + datbase; hdr.a_bss += bs; } assignindex: if ( (sp->s_name[0] != 'L') || (sp->s_tag != LABELID) || savelabels ) /*then, we will write it later on*/ sp->s_index = relpos++; } } /* * For all of the stabs that had their final value undefined during pass 1 * and during pass 2 assign a final value. * We have already given stab entrys a initial approximation * when we constsructed the sorted symbol table. * Iteration order doesn't matter. */ stabfix() { register struct symtab *sp, **cosp; register struct symtab *p; SYMITERATE(cosp, sp){ if(sp->s_ptype && (sp->s_type & STABFLAG)) { p = sp->s_dest; sp->s_value = p->s_value; sp->s_index = p->s_index; sp->s_type = p->s_type; } } } char *Calloc(number, size) int num((ber, size; { register char *newstuff; newstuff = (char *)sbrk(number*size); if ((int)newstuff == -1){ yyerror("Ran out of Memory"); delexit(); } return(newstuff); } char *ClearCalloc(number, size) int number, size; { register char *newstuff; /* r11 */ register int length = number * size; /* r10 */ newstuff = Calloc(number, size); asm("movc5 $0, (r0), $0, r10, (r11)"); return(newstuff); } struct symtab *symalloc() { if (symsleft == 0){ newbox = (struct allocbox *)ClearCalloc(1,ALLOCQTY); symsleft = SYMDALLOP; nextsym = &newbox->symslots[0]; if (alloctail == 0){ allochead = alloctail = newbox; } else { alloctail->nextalloc = newbox; alloctail = newbox; } } --symsleft; ++nsyms; return(nextsym++); } #ifdef FLEXNAMES strpoolalloc() { register struct strpool *new; new = (struct strpool *)Calloc(1, sizeof (struct strpool)); new->str_nalloc = 0; new->str_next = strplhead; strplhead = new; } #endif FLEXNAMES symcmp(Pptr, Qptr) struct symtab **Pptr, **Qptr; { register struct symtab *p = *Pptr; register struct symtab *q = *Qptr; if (p->s_index < q->s_index) return(-1); if (p->s_index > q->s_index) return(1); if (p->s_value < q->s_value) return(-1); if (p->s_value > q->s_value) return(1); /* * Force jxxx entries to virtually preceed labels defined * to follow the jxxxx instruction, so that bumping the * jxxx instruction correctly fixes up the following labels */ if (p->s_tag >= IGNOREBOUND) /*p points to a jxxx*/ return(-1); if (q->s_tag >= IGNOREBOUND) return(1); /* * both are now just plain labels; the relative order doesn't * matter. Both can't be jxxxes, as they would have different * values. */ return(0); } /*end of symcmp*/ /* * We construct the auxiliary table of pointers, symptrs and * symdelim * We also assign preliminary values to stab entries that did not yet * have an absolute value (because they initially referred to * forward references). We don't worry about .stabds, as they * already have an estimated final value */ sortsymtab() { register struct symtab *sp; register struct symtab **cowalk; register struct allocbox *allocwalk; struct symtab *ubsp; int segno; int slotno; int symsin; /*number put into symptrs*/ symptrs = (struct symtab **)Calloc(nsyms + 2, sizeof *symptrs); /* * Allocate one word at the beginning of the symptr array * so that backwards scans through the symptr array will * work correctly while scanning through the zeroth segment */ *symptrs++ = 0; cowalk = symptrs; symsin = 0; DECLITERATE(allocwalk, sp, ubsp) { if (sp->s_ptype && (sp->s_type &STABFLAG)){ sp->s_value = sp->s_dest->s_value; sp->s_index = sp->s_dest->s_index; } if (symsin >= nsyms) yyerror("INTERNAL ERROR: overfilled symbol table indirection table"); *cowalk++ = sp; symsin++; } if (symsin != nsyms) yyerror("INTERNAL ERROR: installed %d syms, should have installed %d", symsin, nsyms); symptrub = &symptrs[nsyms ]; qsort(symptrs, nsyms, sizeof *symptrs, symcmp); symdelim[0] = symptrs; for (cowalk = symptrs, sp = *cowalk, segno = 0, slotno = 1; segno < NLOC + NLOC; segno++, slotno++){ for (; sp && sp->s_index == segno; sp = *++cowalk); symdelim[slotno] = cowalk; /*forms the ub delimeter*/ } } /*end of sortsymtab*/ #ifdef DEBUG dumpsymtab() { register int segno; register struct symtab *sp, **cosp, *ub; char *tagstring(); printf("Symbol Table dump:\n"); for (segno = 0; segno < NLOC + NLOC; segno++){ printf("Segment number: %d\n", segno); SEGITERATE(segno, 0, 0, cosp, sp, ub, ++){ #ifdef FLEXNAMES printf("\tSeg: %d \"%s\" value: %d index: %d tag %s\n", segno, sp->s_name, sp->s_value, sp->s_index, tagstring(sp->s_tag)); #else not FLEXNAMES printf("\tSeg: %d \"%*.*s\" value: %d index: %d tag %s\n", segno, NCPS, NCPS, sp->s_name, sp->s_value, sp->s_index, tagstring(sp->s_tag)); #endif not FLEXNAMES printf("\t\ttype: %d jxbump %d jxfear: %d\n", sp->s_type, sp->s_jxbump, sp->s_jxfear); } printf("\n\n"); } } static char tagbuff[4]; char *tagstring(tag) unsigned char tag; { switch(tag){ case JXACTIVE: return("active"); case JXNOTYET: return("notyet"); case JXALIGN: return("align"); case JXQUESTIONABLE: return("jxquestionable"); case JXINACTIVE: return("inactive"); case JXTUNNEL: return("tunnel"); case OBSOLETE: return("obsolete"); case IGNOREBOUND: return("ignorebound"); case STABFLOATING: return("stabfloating"); case STABFIXED: return("stabfixed"); case LABELID: return("labelid"); case OKTOBUMP: return("oktobump"); case ISET: return("iset"); case ILSYM: return("ilsym"); default: sprintf(tagbuff,"%d", tag); return(tagbuff); } } #endif DEBUG htaballoc() { register struct hashdallop *new; new = (struct hashdallop *)ClearCalloc(1, sizeof (struct hashdallop)); if (htab == 0) htab = new; else { /* add AFTER the 1st slot */ new->h_next = htab->h_next; htab->h_next = new; } } #define HASHCLOGGED (NHASH / 2) /* * Lookup a symbol stored in extern yytext. * All strings passed in via extern yytext had better have * a trailing null. Strings are placed in yytext for hashing by * syminstall() and by yylex(); * * We take pains to avoid function calls; this functdion * is called quite frequently, and the calls overhead * in the vax contributes significantly to the overall * execution speed of as. */ struct symtab **lookup(instflg) int instflg; /* 0: don't install */ { static int initialprobe; register struct symtab **hp; register char *from; register char *to; register int len; register int nprobes; static struct hashdallop *hdallop; static struct symtab **emptyslot; static struct hashdallop *emptyhd; static struct symtab **hp_ub; emptyslot = 0; for (nprobes = 0, from = yytext; *from; nprobes <<= 2, nprobes += *from++) continue; nprobes += from[-1] << 5; nprobes %= NHASH; if (nprobes < 0) nprobes += NHASH; initialprobe = nprobes; for (hdallop = htab; hdallop != 0; hdallop = hdallop->h_next){ for (hp = &(hdallop->h_htab[initialprobe]), nprobes = 1, hp_ub = &(hdallop->h_htab[NHASH]); (*hp) && (nprobes < NHASH); hp += nprobes, hp -= (hp >= hp_ub) ? NHASH:0, nprobes += 2) { from = yytext; to = (*hp)->s_name; #ifndef FLEXNAMES for (len = 0; (len= NCPS) /*both are maximal length*/ return(hp); if (*to == 0) /*assert *from == 0*/ return(hp); #else FLEXNAMES while (*from && *to) if (*from++ != *to++) goto nextprobe; if (*to == *from) /*assert both are == 0*/ return(hp); #endif FLEXNAMES nextprobe: ; } if (*hp == 0 && emptyslot == 0 && hdallop->h_nused < HASHCLOGGED) { emptyslot = hp; emptyhd = hdallop; } } if (emptyslot == 0) { htaballoc(); hdallop = htab->h_next; /* aren't we smart! */ hp = &hdallop->h_htab[initialprobe]; } else { hdallop = emptyhd; hp = emptyslot; } if (instflg) { *hp = symalloc(); hdallop->h_nused++; #ifndef FLEXNAMES for(len = 0, from = yytext, to = (*hp)->s_name; (len= (STRPOOLDALLOP - strplhead->str_nalloc)) strpoolalloc(); for ( (*hp)->s_name = to = strplhead->str_names + strplhead->str_nalloc, from = yytext; ( (*to++ = *from++) != '\0'); ) continue; strplhead->str_nalloc += len; #endif FLEXNAMES } return(hp); } /*end of lookup*/ #ifdef FLEXNAMES char *savestr(str) char *str; { register int len; register char *from, *to; char *res; for (from = str, len = 1; *from++; len++) continue; if (len >= (STRPOOLDALLOP - strplhead->str_nalloc)) strpoolalloc(); for ( res = to = strplhead->str_names + strplhead->str_nalloc, from = str; ( (*to++ = *from++) != '\0'); ) continue; strplhead->str_nalloc += len; return (res); } #endif FLEXNAMES /* * The relocation information is saved internally in an array of * lists of relocation buffers. The relocation buffers are * exactly the same size as a token buffer; if we use VM for the * temporary file we reclaim this storage, otherwise we create * them by mallocing. */ #define RELBUFLG TOKBUFLG #define NRELOC ((TOKBUFLG - \ (sizeof (int) + sizeof (struct relbufdesc *)) \ ) / (sizeof (struct relocation_info))) struct relbufdesc{ int rel_count; struct relbufdesc *rel_next; struct relocation_info rel_reloc[NRELOC]; }; extern struct relbufdesc *tok_free; #define rel_free tok_free static struct relbufdesc *rel_temp; struct relocation_info r_can_1PC; struct relocation_info r_can_0PC; initoutrel() { r_can_0PC.r_address = 0; r_can_0PC.r_symbolnum = 0; r_can_0PC.r_pcrel = 0; r_can_0PC.r_length = 0; r_can_0PC.r_extern = 0; r_can_1PC = r_can_0PC; r_can_1PC.r_pcrel = 1; } outrel(xp, reloc_how) register struct exp *xp; int reloc_how; /* TYPB..TYPD + (possibly)RELOC_PCREL */ { struct relocation_info reloc; register int x_type_mask; int pcrel; x_type_mask = xp->e_xtype & ~XFORW; pcrel = reloc_how & RELOC_PCREL; reloc_how &= ~RELOC_PCREL; if (bitoff&07) yyerror("Padding error"); if (x_type_mask == XUNDEF) yyerror("Undefined reference"); if ( (x_type_mask != XABS) || pcrel ) { if (ty_NORELOC[reloc_how]) yyerror("Illegal Relocation of float, double or quad."); reloc = pcrel ? r_can_1PC : r_can_0PC; reloc.r_address = dotp->e_xvalue - ( (dotp < &usedot[NLOC] || readonlydata) ? 0 : datbase ); reloc.r_length = ty_nlg[reloc_how]; switch(x_type_mask){ case XXTRN | XUNDEF: reloc.r_symbolnum = xp->e_xname->s_index; reloc.r_extern = 1; break; default: if (readonlydata && (x_type_mask&~XXTRN) == XDATA) x_type_mask = XTEXT | (x_type_mask&XXTRN); reloc.r_symbolnum = x_type_mask; break; } if ( (relfil == 0) || (relfil->rel_count >= NRELOC) ){ if (rel_free){ rel_temp = rel_free; rel_free = rel_temp->rel_next; } else { rel_temp = (struct relbufdesc *) Calloc(1,sizeof (struct relbufdesc)); } rel_temp->r((el_count = 0; rel_temp->rel_next = relfil; relfil = rusefile[dotp - &usedot[0]] = rel_temp; } relfil->rel_reloc[relfil->rel_count++] = reloc; } /* * write the unrelocated value to the text file */ dotp->e_xvalue += ty_nbyte[reloc_how]; if (pcrel) xp->e_xvalue -= dotp->e_xvalue; bwrite((char *)&(xp->e_xvalue), ty_nbyte[reloc_how], txtfil); } /* * Flush out all of the relocation information. * Note that the individual lists of buffers are in * reverse order, so we must reverse them */ off_t closeoutrel(relocfile) BFILE *relocfile; { int locindex; u_long Closeoutrel(); trsize = 0; for (locindex = 0; locindex < NLOC; locindex++){ trsize += Closeoutrel(rusefile[locindex], relocfile); } drsize = 0; for (locindex = 0; locindex < NLOC; locindex++){ drsize += Closeoutrel(rusefile[NLOC + locindex], relocfile); } return(trsize + drsize); } u_long Closeoutrel(relfil, relocfile) struct relbufdesc *relfil; BFILE *relocfile; { u_long tail; if (relfil == 0) return(0L); tail = Closeoutrel(relfil->rel_next, relocfile); bwrite((char *)&relfil->rel_reloc[0], relfil->rel_count * sizeof (struct relocation_info), relocfile); return(tail + relfil->rel_count * sizeof (struct relocation_info)); } #define NOUTSYMS (nsyms - njxxx - nforgotten - (savelabels ? 0 : nlabels)) int sizesymtab() { return (sizeof (struct nlist) * NOUTSYMS); } #ifdef FLEXNAMES /* * We write out the flexible length character strings for names * in two stages. * 1) We have always! maintain a fixed sized name list entry; * the string is indexed by a four byte quantity from the beginning * of the string pool area. Index 0 is reserved, and indicates * that there is no associated string. The first valid index is 4. * 2) We concatenate together and write all of the strings * in the string pool at the end of the name list. The first * four bytes in the string pool are indexed only by 0 (see above); * they contain the total number of bytes in the string pool. */ #endif FLEXNAMES /* * Write out n symbols to file f, beginning at p * ignoring symbols that are obsolete, jxxx instructions, and * possibly, labels */ int symwrite(symfile) BFILE *symfile; { int symsout; /*those actually written*/ int symsdesired = NOUTSYMS; register struct symtab *sp, *ub; #ifdef FLEXNAMES char *name; /* temp to save the name */ long stroff = sizeof (stroff); /* * We use sp->s_index to hold the length of the * name; it isn't used for anything else */ #endif FLEXNAMES register struct allocbox *allocwalk; symsout = 0; DECLITERATE(allocwalk, sp, ub) { if (sp->s_tag >= IGNOREBOUND) continue; if ((sp->s_name[0] == 'L') && (sp->s_tag == LABELID) && !savelabels) continue; symsout++; #ifdef FLEXNAMES name = sp->s_name; /* save pointer */ if ( (sp->s_index = strlen(sp->s_name)) != 0){ sp->s_nmx = stroff; /* clobber pointer */ stroff += sp->s_index + 1; } else { sp->s_nmx = 0; /* clobber pointer */ } #endif sp->s_type = (sp->s_ptype != 0) ? sp->s_ptype : (sp->s_type & (~XFORW)); if (readonlydata && (sp->s_type&~N_EXT) == N_DATA) sp->s_type = N_TEXT | (sp->s_type & N_EXT); bwrite(&sp->s_nm, sizeof (struct nlist), symfile); #ifdef FLEXNAMES sp->s_name = name; /* restore pointer */ #endif FLEXNAMES } if (symsout != symsdesired) yyerror("INTERNAL ERROR: Wrote %d symbols, wanted to write %d symbols\n", symsout, symsdesired); #ifdef FLEXNAMES /* * Pass 2 through the string pool */ symsout = 0; bwrite(&stroff, sizeof (stroff), symfile); stroff = sizeof (stroff); symsout = 0; DECLITERATE(allocwalk, sp, ub) { if (sp->s_tag >= IGNOREBOUND) continue; if ((sp->s_name[0] == 'L') && (sp->s_tag == LABELID) && !savelabels) continue; sp->s_index = strlen(sp->s_name); if (sp->s_index) bwrite(sp->s_name, sp->s_index + 1, symfile); } #endif FLEXNAMES } ls, wanted to write %d symbols\n", symsout, symsdesired); #ifdef FLEXNAMES /* * Pass 2 through the string pool */ symsout = 0; bwrite(&stroff, sizeof (stroff), symfile); stroff = sizeof (stroff);cmd/as/asexpr.c 444 0 33 22701 2431567742 6701 /* Copyright (c) 1980 Regents of the University of California */ static char sccsid[] = "@(#)asexpr.c 4.2 8/15/80"; #include #include "as.h" #include "asexpr.h" /* * Tables for combination of operands. */ #define XTXRN 5<<1 /* indexes last row/column when right shifted */ /* * table for + */ readonly char pltab[6][6] = { /* UND ABS TXT DAT BSS EXT */ /*UND*/ XUNDEF, XUNDEF, XUNDEF, XUNDEF, XUNDEF, XUNDEF, /*ABS*/ XUNDEF, XABS, XTEXT, XDATA, XBSS, XXTRN, /*TXT*/ XUNDEF, XTEXT, ERR, ERR, ERR, ERR, /*DAT*/ XUNDEF, XDATA, ERR, ERR, ERR, ERR, /*BSS*/ XUNDEF, XBSS, ERR, ERR, ERR, ERR, /*EXT*/ XUNDEF, XXTRN, ERR, ERR, ERR, ERR, }; /* * table for - */ readonly char mintab[6][6] = { /* UND ABS TXT DAT BSS EXT */ /*UND*/ XUNDEF, XUNDEF, XUNDEF, XUNDEF, XUNDEF, XUNDEF, /*ABS*/ XUNDEF, XABS, ERR, ERR, ERR, ERR, /*TXT*/ XUNDEF, XTEXT, XABS, ERR, ERR, ERR, /*DAT*/ XUNDEF, XDATA, ERR, XABS, ERR, ERR, /*BSS*/ XUNDEF, XBSS, ERR, ERR, XABS, ERR, /*EXT*/ XUNDEF, XXTRN, ERR, ERR, ERR, ERR, }; /* * table for other operators */ readonly char othtab[6][6] = { /* UND ABS TXT DAT BSS EXT */ /*UND*/ XUNDEF, XUNDEF, XUNDEF, XUNDEF, XUNDEF, XUNDEF, /*ABS*/ XUNDEF, XABS, ERR, ERR, ERR, ERR, /*TXT*/ XUNDEF, ERR, ERR, ERR, ERR, ERR, /*DAT*/ XUNDEF, ERR, ERR, ERR, ERR, ERR, /*BSS*/ XUNDEF, ERR, ERR, ERR, ERR, ERR, /*EXT*/ XUNDEF, ERR, ERR, ERR, ERR, ERR, }; struct exp * combine(op, exp1, exp2) register struct exp *exp1, *exp2; { register e1_type, e2_type; register back_type; lastnam=0; /* kludge for jxxx instructions */ e1_type = exp1->e_xtype&XTYPE; e2_type = exp2->e_xtype&XTYPE; if (exp1->e_xtype==XXTRN+XUNDEF) e1_type = XTXRN; if (exp2->e_xtype==XXTRN+XUNDEF) e2_type = XTXRN; if (passno==1) if (exp1->e_xloc!=exp2->e_xloc && e1_type==e2_type) e1_type = e2_type = XTXRN; /* error on != loc ctrs */ e1_type >>= 1; /*dispose of the external (XXTRN) bit*/ e2_type >>= 1; switch (op) { case PLUS: exp1->e_xvalue += exp2->e_xvalue; back_type = pltab[e1_type][e2_type]; break; case MINUS: exp1->e_xvalue -= exp2->e_xvalue; back_type = mintab[e1_type][e2_type]; break; case IOR: exp1->e_xvalue |= exp2->e_xvalue; goto comm; case XOR: exp1->e_xvalue ^= exp2->e_xvalue; goto comm; case AND: exp1->e_xvalue &= exp2->e_xvalue; goto comm; case ORNOT: exp1->e_xvalue |= ~exp2->e_xvalue; goto comm; case LSH: exp1->e_xvalue <<= exp2->e_xvalue; goto comm; case RSH: exp1->e_xvalue >>= exp2->e_xvalue; goto comm; case TILDE: exp1->e_xvalue |= ~ exp2->e_xvalue; goto comm; case MUL: exp1->e_xvalue *= exp2->e_xvalue; goto comm; case DIV: if (exp2->e_xvalue == 0) yyerror("Divide check"); else exp1->e_xvalue /= exp2->e_xvalue; goto comm; case REGOP: if (exp2->e_xvalue == 0) yyerror("Divide check (modulo)"); else exp1->e_xvalue %= exp2->e_xvalue; goto comm; comm: back_type = othtab[e1_type][e2_type]; break; default: yyerror("Internal error: unknown operator"); } if (e2_type==(XTXRN>>1)) exp1->e_xname = exp2->e_xname; exp1->e_xtype = back_type | ( (exp1->e_xtype|exp2->e_xtype) & (XFORW|XXTRN) ); if (back_type==ERR) yyerror("Relocation error"); return(exp1); } buildtokensets() { #define clobber(val, set) tokensets[(val)] |= (set) clobber(SEMI, LINSTBEGIN); clobber(NL, LINSTBEGIN); clobber(INT, LINSTBEGIN); clobber(NAME, YUKKYEXPRBEG + LINSTBEGIN); clobber(INSTn, YUKKYEXPRBEG); clobber(INST0, YUKKYEXPRBEG); clobber(REG, YUKKYEXPRBEG); clobber(BFINT, YUKKYEXPRBEG); clobber(INT, SAFEEXPRBEG); clobber(FLTNUM, SAFEEXPRBEG); clobber(PLUS, ADDOPS); clobber(MINUS, ADDOPS + EBEGOPS); clobber(LP, EBEGOPS); clobber(IOR, BOOLOPS); clobber(XOR, BOOLOPS); clobber(AND, BOOLOPS); clobber(ORNOT, BOOLOPS); clobber(TILDE, MULOPS + EBEGOPS); clobber(LSH, MULOPS); clobber(RSH, MULOPS); clobber(MUL, MULOPS); clobber(DIV, MULOPS); clobber(REGOP, MULOPS); /* % */ } /* * We keep the current token class in this global variable, so * the recursive descent expression analyzers can talk amongst * themselves, and so that we may use the macros shift and shift over */ extern int yylval; /*the value of the lexical value*/ extern struct exp *xp; /*the next free expression slot*/ static int val; int exprparse(inval, backexpr) /*return the value the read head is sitting on*/ int inval; struct exp **backexpr; { register struct exp *lexpr; int op; val = inval; lexpr = boolterm(); while (INTOKSET(val, ADDOPS)){ op = val; shift; lexpr = combine(op, lexpr, boolterm()); } *backexpr = lexpr; return(val); } struct exp *boolterm() { register struct exp *lexpr; int op; lexpr = term(); while(INTOKSET(val, BOOLOPS)){ op = val; shift; lexpr = combine(op, lexpr, term()); } return(lexpr); } struct exp *term() { register struct exp *lexpr; int op; lexpr = factor(); while(INTOKSET(val, MULOPS)){ op = val; shift; lexpr = combine(op, lexpr, factor()); } return(lexpr); } struct exp *factor() { struct exp *lexpr; int op; extern int droppedLP; /*called exprparse after consuming an LP*/ if (val == LP || droppedLP){ if (droppedLP) droppedLP = 0; else shift; /*the LP*/ val = exprparse(val, &lexpr); if (val != RP) yyerror("right parenthesis expected"); else shift; } else if (INTOKSET(val, YUKKYEXPRBEG)){ lexpr = yukkyexpr(val, yylval); shift; } else if (INTOKSET(val, SAFEEXPRBEG)){ lexpr = (struct exp *)yylval; shift; } else if ( (val == TILDE) || (val == MINUS) ){ op = val; shift; lexpr = xp++; lexpr->e_xtype = XABS; lexpr->e_xvalue = 0((; lexpr = combine(op, lexpr, factor()); } else { yyerror("Bad expression syntax"); lexpr = xp++; lexpr->e_xtype = XABS; lexpr->e_xvalue = 0; } return(lexpr); } struct exp *yukkyexpr(val, np) int val; register np; { register struct exp *locxp; extern int exprisname; /*last factor is a name*/ exprisname = 0; locxp = xp++; if (val == NAME || val == BFINT){ if (val == BFINT) { int off = 0; yylval = ((struct exp *)np)->e_xvalue; if (yylval < 0) { yylval = -yylval; yylval--; off = -1; if (lgensym[yylval] == 1) yyerror("Reference to undefined local label %db", yylval); } else { yylval--; genref[yylval] = 1; } sprintf(yytext, "L%d\001%d", yylval, lgensym[yylval] + off); yylval = np = (int)*lookup(passno == 1); lastnam = (struct symtab *)np; } exprisname++; locxp->e_xtype = ((struct symtab *)np)->s_type; if (( ((struct symtab *)np)->s_type&XTYPE)==XUNDEF) { /*forward*/ locxp->e_xname = (struct symtab *)np; locxp->e_xvalue = 0; if (passno==1) ((struct symtab *)np)->s_type |= XFORW; } else { /*otherwise, just get the value*/ locxp->e_xvalue = ((struct symtab *)np)->s_value; locxp->e_xname = NULL; } } else { /*INSTn or INST0 or REG*/ locxp->e_xtype = XABS; locxp->e_xvalue = ( (int)np) & 0xFF; locxp->e_xloc = 0; locxp->e_xname = NULL; } return(locxp); } #ifdef DEBUG char *tok_name[LASTTOKEN - FIRSTTOKEN + 1]; struct Tok_Desc{ int tok_which; char *tok_name; } tok_desc[] = { FIRSTTOKEN, "firsttoken", /* 0 */ ISPACE, "ispace", /* 1 */ IBYTE, "ibyte", /* 2 */ IWORD, "iword", /* 3 */ IINT, "iint", /* 4 */ ILONG, "ilong", /* 5 */ IDATA, "idata", /* 6 */ IGLOBAL, "iglobal", /* 7 */ ISET, "iset", /* 8 */ ITEXT, "itext", /* 9 */ ICOMM, "icomm", /* 10 */ ILCOMM, "ilcomm", /* 11 */ IFLOAT, "ifloat", /* 12 */ IDOUBLE, "idouble", /* 13 */ IORG, "iorg", /* 14 */ IASCII, "iascii", /* 15 */ IASCIZ, "iasciz", /* 16 */ ILSYM, "ilsym", /* 17 */ IFILE, "ifile", /* 18 */ ILINENO, "ilineno", /* 19 */ IABORT, "iabort", /* 20 */ ISTAB, "istab", /* 23 */ ISTABSTR, "istabstr", /* 24 */ ISTABNONE, "istabnone", /* 25 */ ISTABDOT, "istabdot", /* 26 */ IJXXX, "ijxxx", /* 27 */ IALIGN, "ialign", /* 28 */ INST0, "inst0", /* 29 */ INSTn, "instn", /* 30 */ BFINT, "bfint", /* 31 */ PARSEEOF, "parseeof", /* 32 */ ILINESKIP, "ilineskip", /* 33 */ VOID, "void", /* 34 */ SKIP, "skip", /* 35 */ INT, "int", /* 36 */ FLTNUM, "fltnum", /* 37 */ NAME, "name", /* 38 */ STRING, "string", /* 39 */ QUAD, "quad", /* 40 */ SIZESPEC, "sizespec", /* 41 */ REG, "reg", /* 42 */ MUL, "mul", /* 43 */ LITOP, "litop", /* 44 */ LP, "lp", /* 45 */ MP, "mp", /* 46 */ NEEDSBUF, "needsbuf", /* 48 */ REGOP, "regop", /* 49 */ NL, "nl", /* 50 */ SCANEOF, "scaneof", /* 51 */ BADCHAR, "badchar", /* 52 */ SP, "sp", /* 53 */ ALPH, "alph", /* 54 */ DIG, "dig", /* 55 */ SQ, "sq", /* 56 */ DQ, "dq", /* 57 */ SH, "sh", /* 58 */ LSH, "lsh", /* 59 */ RSH, "rsh", /* 60 */ MINUS, "minus", /* 61 */ SIZEQUOTE, "sizequote", /* 62 */ XOR, "xor", /* 64 */ DIV, "div", /* 65 */ SEMI, "semi", /* 66 */ COLON, "colon", /* 67 */ PLUS, "plus", /* 68 */ IOR, "ior", /* 69 */ AND, "and", /* 70 */ TILDE, "tilde", /* 71 */ ORNOT, "ornot", /* 72 */ CM, "cm", /* 73 */ LB, "lb", /* 74 */ RB, "rb", /* 75 */ RP, "rp", /* 76 */ LASTTOKEN, "lasttoken" /* 80 */ }; /* * turn a token type into a string */ static int fixed = 0; char *tok_to_name(token) { if (!fixed){ int i; for (i = FIRSTTOKEN; i <= LASTTOKEN; i++) tok_name[i] = "NOT ASSIGNED"; for (i = FIRSTTOKEN; i <= sizeof(tok_desc)/sizeof(struct Tok_Desc); i++){ tok_name[tok_desc[i].tok_which] = tok_desc[i].tok_name; } fixed = 1; } if (FIRSTTOKEN <= token && token <= LASTTOKEN) return(tok_name[token]); else panic("Unknown token number, %d\n", token); /*NOTREACHED*/ } #endif DEBUG 0 */ }; /* * turn a token type into a string */ static int ficmd/as/asexpr.h 444 0 33 4462 2431567743 6673 /* Copyright (c) 1980 Regents of the University of California */ /* "@(#)asexpr.h 4.2 8/15/80" */ /* * Definitions to parse tokens */ #define ERROR(string) yyerror(string); goto errorfix #define peekahead (*tokptr) #define shift val = yylex() #define advance shift #define shiftover(token) if (val != token) { \ yyerror("token expected"); \ goto errorfix; \ } \ shift #define advanceover shiftover /* * To speed up the expression processing, we class the input tokens * into various sets. * * We don't call the recursive descent expression analyzer if we can * determine by looking at the next token after the first token in * an expression that the expression is simple (name, integer or floating * point value). Expressions with operators are parsed using the recursive * descent method. */ /* * Functional forwards for expression utility routines */ struct exp *combine(); struct exp *boolterm(); struct exp *term(); struct exp *factor(); struct exp *yukkyexpr(); /* * The set definitions */ extern char tokensets[(LASTTOKEN) - (FIRSTTOKEN) + 1]; #define LINSTBEGIN 01 /*SEMI, NL, NAME*/ #define EBEGOPS 02 /*LP, MINUS, TILDE*/ #define YUKKYEXPRBEG 04 /*NAME, INSTn, INST0, REG, BFINT*/ #define SAFEEXPRBEG 010 /*INT, FLTNUM*/ #define ADDOPS 020 /*PLUS, MINUS*/ #define BOOLOPS 040 /*IOR, XOR, AND*/ #define MULOPS 0100 /*LSH, RSH, MUL, DIV, TILDE*/ #define INTOKSET(val, set) (tokensets[(val)] & (set) ) #define expr(xp, val) { \ if ( (!INTOKSET(val, EBEGOPS)) && (!INTOKSET(peekahead, ADDOPS+BOOLOPS+MULOPS))) { \ if (INTOKSET(val, YUKKYEXPRBEG)) xp = yukkyexpr(val, yylval); \ else xp = (struct exp *) yylval; \ shift; \ } else { \ val = exprparse(val, ptrloc1xp); \ xp = loc1xp; \ } \ } /* * Registers can be either of the form r0...pc, or * of the form % * NOTE: Reizers documentation on the assembler says that it * can be of the form r0 + .. That's not true. * * NOTE: Reizer's yacc grammar would seem to allow an expression * to be: (This is undocumented) * a) a register * b) an Instruction (INSTn or INST0) */ #define findreg(regno) \ if (val == REG) { \ regno = yylval; \ shift; \ } else \ if (val == REGOP) { \ shift; /*over the REGOP*/ \ val = funnyreg(val, ptrregno); \ } \ else { ERROR ("register expected"); } pression> * NOTE: Reizers documentation on the assembler says that it * can be of the form r0 + .. That's not true. * * NOTE: Reizer's yacc grammar would seem to allow an expression * to becmd/as/instrs 444 0 33 31237 2377071107 6476 /* Copyright(c) 1980 Regents of the University of California */ /* "@(#)instrs 4.1 8/16/80" */ OP("acbb",0x9d,4,ACCR+TYPB,ACCR+TYPB,ACCM+TYPB,ACCB+TYPW,0,0), OP("acbd",0x6f,4,ACCR+TYPD,ACCR+TYPD,ACCM+TYPD,ACCB+TYPW,0,0), OP("acbf",0x4f,4,ACCR+TYPF,ACCR+TYPF,ACCM+TYPF,ACCB+TYPW,0,0), OP("acbl",0xf1,4,ACCR+TYPL,ACCR+TYPL,ACCM+TYPL,ACCB+TYPW,0,0), OP("acbw",0x3d,4,ACCR+TYPW,ACCR+TYPW,ACCM+TYPW,ACCB+TYPW,0,0), OP("adawi",0x58,2,ACCR+TYPW,ACCM+TYPW,0,0,0,0), OP("addb2",0x80,2,ACCR+TYPB,ACCM+TYPB,0,0,0,0), OP("addb3",0x81,3,ACCR+TYPB,ACCR+TYPB,ACCW+TYPB,0,0,0), OP("addd2",0x60,2,ACCR+TYPD,ACCM+TYPD,0,0,0,0), OP("addd3",0x61,3,ACCR+TYPD,ACCR+TYPD,ACCW+TYPD,0,0,0), OP("addf2",0x40,2,ACCR+TYPF,ACCM+TYPF,0,0,0,0), OP("addf3",0x41,3,ACCR+TYPF,ACCR+TYPF,ACCW+TYPF,0,0,0), OP("addl2",0xc0,2,ACCR+TYPL,ACCM+TYPL,0,0,0,0), OP("addl3",0xc1,3,ACCR+TYPL,ACCR+TYPL,ACCW+TYPL,0,0,0), OP("addp4",0x20,4,ACCR+TYPW,ACCA+TYPB,ACCR+TYPW,ACCA+TYPB,0,0), OP("addp6",0x21,6,ACCR+TYPW,ACCA+TYPB,ACCR+TYPW,ACCA+TYPB,ACCR+TYPW,ACCA+TYPB), OP("addw2",0xa0,2,ACCR+TYPW,ACCM+TYPW,0,0,0,0), OP("addw3",0xa1,3,ACCR+TYPW,ACCR+TYPW,ACCW+TYPW,0,0,0), OP("adwc",0xd8,2,ACCR+TYPL,ACCM+TYPL,0,0,0,0), OP("aobleq",0xf3,3,ACCR+TYPL,ACCM+TYPL,ACCB+TYPB,0,0,0), OP("aoblss",0xf2,3,ACCR+TYPL,ACCM+TYPL,ACCB+TYPB,0,0,0), OP("ashl",0x78,3,ACCR+TYPB,ACCR+TYPL,ACCW+TYPL,0,0,0), OP("ashp",0xf8,6,ACCR+TYPB,ACCR+TYPW,ACCA+TYPB,ACCR+TYPB,ACCR+TYPW,ACCA+TYPB), OP("ashq",0x79,3,ACCR+TYPB,ACCR+TYPQ,ACCW+TYPQ,0,0,0), OP("bbc",0xe1,3,ACCR+TYPL,ACCR+TYPB,ACCB+TYPB,0,0,0), OP("bbcc",0xe5,3,ACCR+TYPL,ACCR+TYPB,ACCB+TYPB,0,0,0), OP("bbcci",0xe7,3,ACCR+TYPL,ACCR+TYPB,ACCB+TYPB,0,0,0), OP("bbcs",0xe3,3,ACCR+TYPL,ACCR+TYPB,ACCB+TYPB,0,0,0), OP("bbs",0xe0,3,ACCR+TYPL,ACCR+TYPB,ACCB+TYPB,0,0,0), OP("bbsc",0xe4,3,ACCR+TYPL,ACCR+TYPB,ACCB+TYPB,0,0,0), OP("bbss",0xe2,3,ACCR+TYPL,ACCR+TYPB,ACCB+TYPB,0,0,0), OP("bbssi",0xe6,3,ACCR+TYPL,ACCR+TYPB,ACCB+TYPB,0,0,0), OP("bcc",0x1e,1,ACCB+TYPB,0,0,0,0,0), OP("bcs",0x1f,1,ACCB+TYPB,0,0,0,0,0), OP("beql",0x13,1,ACCB+TYPB,0,0,0,0,0), OP("beqlu",0x13,1,ACCB+TYPB,0,0,0,0,0), OP("bgeq",0x18,1,ACCB+TYPB,0,0,0,0,0), OP("bgequ",0x1e,1,ACCB+TYPB,0,0,0,0,0), OP("bgtr",0x14,1,ACCB+TYPB,0,0,0,0,0), OP("bgtru",0x1a,1,ACCB+TYPB,0,0,0,0,0), OP("bicb2",0x8a,2,ACCR+TYPB,ACCM+TYPB,0,0,0,0), OP("bicb3",0x8b,3,ACCR+TYPB,ACCR+TYPB,ACCW+TYPB,0,0,0), OP("bicl2",0xca,2,ACCR+TYPL,ACCM+TYPL,0,0,0,0), OP("bicl3",0xcb,3,ACCR+TYPL,ACCR+TYPL,ACCW+TYPL,0,0,0), OP("bicpsw",0xb9,1,ACCR+TYPW,0,0,0,0,0), OP("bicw2",0xaa,2,ACCR+TYPW,ACCM+TYPW,0,0,0,0), OP("bicw3",0xab,3,ACCR+TYPW,ACCR+TYPW,((ACCW+TYPW,0,0,0), OP("bisb2",0x88,2,ACCR+TYPB,ACCM+TYPB,0,0,0,0), OP("bisb3",0x89,3,ACCR+TYPB,ACCR+TYPB,ACCW+TYPB,0,0,0), OP("bisl2",0xc8,2,ACCR+TYPL,ACCM+TYPL,0,0,0,0), OP("bisl3",0xc9,3,ACCR+TYPL,ACCR+TYPL,ACCW+TYPL,0,0,0), OP("bispsw",0xb8,1,ACCR+TYPW,0,0,0,0,0), OP("bisw2",0xa8,2,ACCR+TYPW,ACCM+TYPW,0,0,0,0), OP("bisw3",0xa9,3,ACCR+TYPW,ACCR+TYPW,ACCW+TYPW,0,0,0), OP("bitb",0x93,2,ACCR+TYPB,ACCR+TYPB,0,0,0,0), OP("bitl",0xd3,2,ACCR+TYPL,ACCR+TYPL,0,0,0,0), OP("bitw",0xb3,2,ACCR+TYPW,ACCR+TYPW,0,0,0,0), OP("blbs",0xe8,2,ACCR+TYPL,ACCB+TYPB,0,0,0,0), OP("blbc",0xe9,2,ACCR+TYPL,ACCB+TYPB,0,0,0,0), OP("bleq",0x15,1,ACCB+TYPB,0,0,0,0,0), OP("blequ",0x1b,1,ACCB+TYPB,0,0,0,0,0), OP("blss",0x19,1,ACCB+TYPB,0,0,0,0,0), OP("blssu",0x1f,1,ACCB+TYPB,0,0,0,0,0), OP("bneq",0x12,1,ACCB+TYPB,0,0,0,0,0), OP("bnequ",0x12,1,ACCB+TYPB,0,0,0,0,0), OP("bpt",0x03,0,0,0,0,0,0,0), OP("brb",0x11,1,ACCB+TYPB,0,0,0,0,0), OP("brw",0x31,1,ACCB+TYPW,0,0,0,0,0), OP("bsbb",0x10,1,ACCB+TYPB,0,0,0,0,0), OP("bsbw",0x30,1,ACCB+TYPW,0,0,0,0,0), OP("bvc",0x1c,1,ACCB+TYPB,0,0,0,0,0), OP("bvs",0x1d,1,ACCB+TYPB,0,0,0,0,0), OP("callg",0xfa,2,ACCA+TYPB,ACCA+TYPB,0,0,0,0), OP("calls",0xfb,2,ACCR+TYPL,ACCA+TYPB,0,0,0,0), OP("caseb",0x8f,3,ACCR+TYPB,ACCR+TYPB,ACCR+TYPB,0,0,0), OP("casel",0xcf,3,ACCR+TYPL,ACCR+TYPL,ACCR+TYPL,0,0,0), OP("casew",0xaf,3,ACCR+TYPW,ACCR+TYPW,ACCR+TYPW,0,0,0), OP("chme",0xbd,1,ACCR+TYPW,0,0,0,0,0), OP("chmk",0xbc,1,ACCR+TYPW,0,0,0,0,0), OP("chms",0xbe,1,ACCR+TYPW,0,0,0,0,0), OP("chmu",0xbf,1,ACCR+TYPW,0,0,0,0,0), OP("clrb",0x94,1,ACCW+TYPB,0,0,0,0,0), OP("clrd",0x7c,1,ACCW+TYPD,0,0,0,0,0), OP("clrf",0xd4,1,ACCW+TYPF,0,0,0,0,0), OP("clrl",0xd4,1,ACCW+TYPL,0,0,0,0,0), OP("clrq",0x7c,1,ACCW+TYPQ,0,0,0,0,0), OP("clrw",0xb4,1,ACCW+TYPW,0,0,0,0,0), OP("cmpb",0x91,2,ACCR+TYPB,ACCR+TYPB,0,0,0,0), OP("cmpc3",0x29,3,ACCR+TYPW,ACCA+TYPB,ACCA+TYPB,0,0,0), OP("cmpc5",0x2d,5,ACCR+TYPW,ACCA+TYPB,ACCR+TYPB,ACCR+TYPW,ACCA+TYPB,0), OP("cmpd",0x71,2,ACCR+TYPD,ACCR+TYPD,0,0,0,0), OP("cmpf",0x51,2,ACCR+TYPF,ACCR+TYPF,0,0,0,0), OP("cmpl",0xd1,2,ACCR+TYPL,ACCR+TYPL,0,0,0,0), OP("cmpp3",0x35,3,ACC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7,2,ACCR+TYPL,ACCW+TYPW,0,0,0,0), OP("cvtpl",0x36,3,ACCR+TYPW,ACCA+TYPB,ACCW+TYPL,0,0,0), OP("cvttp",0x26,5,ACCR+TYPW,ACCA+TYPB,ACCA+TYPB,ACCR+TYPW,ACCA+TYPB,0), OP("cvtpt",0x24,5,ACCR+TYPW,ACCA+TYPB,ACCA+TYPB,ACCR+TYPW,ACCA+TYPB,0), OP("cvtps",0x08,4,ACCR+TYPW,ACCA+TYPB,ACCR+TYPW,ACCA+TYPB,0,0), OP("cvtrdl",0x6b,2,ACCR+TYPD,ACCW+TYPL,0,0,0,0), OP("cvtrfl",0x4b,2,ACCR+TYPF,ACCW+TYPL,0,0,0,0), OP("cvtsp",0x09,4,ACCR+TYPW,ACCA+TYPB,ACCR+TYPW,ACCA+TYPB,0,0), OP("cvtwb",0x33,2,ACCR+TYPW,ACCW+TYPB,0,0,0,0), OP("cvtwd",0x6d,2,ACCR+TYPW,ACCW+TYPD,0,0,0,0), OP("cvtwf",0x4d,2,ACCR+TYPW,ACCW+TYPF,0,0,0,0), OP("cvtwl",0x32,2,ACCR+TYPW,ACCW+TYPL,0,0,0,0), OP("decb",0x97,1,ACCM+TYPB,0,0,0,0,0), OP("decl",0xd7,1,ACCM+TYPL,0,0,0,0,0), OP("decw",0xb7,1,ACCM+TYPW,0,0,0,0,0), OP("divb2",0x86,2,ACCR+TYPB,ACCM+TYPB,0,0,0,0), OP("divb3",0x87,3,ACCR+TYPB,ACCR+TYPB,ACCW+TYPB,0,0,0), OP("divd2",0x66,2,ACCR+TYPD,ACCM+TYPD,0,0,0,0), OP("divd3",0x67,3,ACCR+TYPD,ACCR+TYPD,ACCR+TYPD,0,0,0), OP("divf2",0x46,2,ACCR+TYPF,ACCM+TYPF,0,0,0,0), OP("divf3",0x47,3,ACCR+TYPF,ACCR+TYPF,ACCW+TYPF,0,0,0), OP("divl2",0xc6,2,ACCR+TYPL,ACCM+TYPL,0,0,0,0), OP("divl3",0xc7,3,ACCR+TYPL,ACCR+TYPL,ACCW+TYPL,0,0,0), OP("divp",0x27,6,ACCR+TYPW,ACCA+TYPB,ACCR+TYPW,ACCA+TYPB,ACCR+TYPW,ACCA+TYPB), OP("divw2",0xa6,2,ACCR+TYPW,ACCM+TYPW,0,0,0,0), OP("divw3",0xa7,3,ACCR+TYPW,ACCR+TYPW,ACCW+TYPW,0,0,0), OP("editpc",0x38,4,ACCR+TYPW,ACCA+TYPB,ACCA+TYPB,ACCA+TYPB,0,0), OP("ediv",0x7b,4,ACCR+TYPL,ACCR+TYPQ,ACCW+TYPL,ACCW+TYPL,0,0), OP("emodd",0x74,5,ACCR+TYPD,ACCR+TYPB,ACCR+TYPD,ACCW+TYPL,ACCW+TYPD,0), OP("emodf",0x54,5,ACCR+TYPF,ACCR+TYPB,ACCR+TYPF,ACCW+TYPL,ACCW+TYPF,0), OP("emul",0x7a,4,ACCR+TYPL,ACCR+TYPL,ACCR+TYPL,ACCW+TYPQ,0,0), OP("extv",0xee,4,ACCR+TYPL,ACCR+TYPB,ACCR+TYPB,ACCW+TYPL,0,0), OP("extzv",0xef,4,ACCR+TYPL,ACCR+TYPB,ACCR+TYPB,ACCW+TYPL,0,0), OP("ffc",0xeb,4,ACCR+TYPL,ACCR+TYPB,ACCR+TYPB,ACCW+TYPL,0,0), OP("ffs",0xea,4,ACCR+TYPL,ACCR+TYPB,ACCR+TYPB,ACCW+TYPL,0,0), OP("halt",0x00,0,0,0,0,0,0,0), OP("incb",0x96,1,ACCM+TYPB,0,0,0,0,0), OP("incl",0xd6,1,ACCM+TYPL,0,0,0,0,0), OP("incw",0xb6,1,ACCM+TYPW,0,0,0,0,0), OP("index",0x0a,6,ACCR+TYPL,ACCR+TYPL,ACCR+TYPL,ACCR+TYPL,ACCR+TYPL,ACCW+TYPL), OP("insque",0x0e,2,ACCA+TYPB,ACCA+TYPB,0,0,0,0), OP("insv",0xf0,4,ACCR+TYPL,ACCR+TYPL,ACCR+TYPB,ACCW+TYPB,0,0), OP("jmp",0x17,1,ACCA+TYPB,0,0,0,0,0), OP("jsb",0x16,1,ACCA+TYPB,0,0,0,0,0), OP("ldpctx",0x06,0,0,0,0,0,0,0), OP("locc",0x3a,3,ACCR+TYPB,ACCR+TYPW,ACCA+TYPB,0,0,0), OP("matchc",0x39,4,ACCR+TYPW,ACCA+TYPB,ACCR+TYPW,ACCA+TYPB,0,0), OP("mcomb",0x92,2,ACCR+TYPB,ACCW+TYPB,0,0,0,0), OP("mcoml",0xd2,2,ACCR+TYPL,ACCW+TYPL,0,0,0,0), OP("mcomw",0xb2,2,ACCR+TYPW,ACCW+TYPW,0,0,0,0), OP("mfpr",0xdb,2,ACCR+TYPL,ACCW+TYPL,0,0,0,0), OP("mnegb",0x8e,2,ACCR+TYPB,ACCW+TYPB,0,0,0,0), OP("mnegd",0x72,2,ACCR+TYPD,ACCW+TYPD,0,0,0,0), OP("mnegf",0x52,2,ACCR+TYPF,ACCW+TYPF,0,0,0,0), OP("mnegl",0xce,2,ACCR+TYPL,ACCW+TYPL,0,0,0,0), OP("mnegw",0xae,2,ACCR+TYPW,ACCW+TYPL,0,0,0,0), OP("movab",0x9e,2,ACCA+TYPB,ACCW+TYPL,0,0,0,0), OP("movad",0x7e,2,ACCA+TYPD,ACCW+TYPL,0,0,0,0), OP("movaf",0xde,2,ACCA+TYPF,ACCW+TYPL,0,0,0,0), OP("moval",0xde,2,ACCA+TYPL,ACCW+TYPL,0,0,0,0), OP("movaq",0x7e,2,ACCA+TYPQ,ACCW+TYPL,0,0,0,0), OP("movaw",0x3e,2,ACCA+TYPW,ACCW+TYPL,0,0,0,0), OP("movb",0x90,2,ACCR+TYPB,ACCW+TYPB,0,0,0,0), OP("movc3",0x28,3,ACCR+TYPW,ACCA+TYPB,ACCA+TYPB,0,0,0), OP("movc5",0x2c,5,ACCR+TYPW,ACCA+TYPB,ACCR+TYPB,ACCR+TYPW,ACCA+TYPB,0), OP("movd",0x70,2,ACCR+TYPD,ACCW+TYPD,0,0,0,0), OP("movf",0x50,2,ACCR+TYPF,ACCW+TYPF,0,0,0,0), OP("movl",0xd0,2,ACCR+TYPL,ACCW+TYPL,0,0,0,0), OP("movp",0x34,3,ACCR+TYPW,ACCA+TYPB,ACCA+TYPB,0,0,0), OP("movpsl",0xdc,1,ACCW+TYPL,0,0,0,0,0), OP("movq",0x7d,2,ACCR+TYPQ,ACCW+TYPQ,0,0,0,0), OP("movtc",0x2e,6,ACCR+TYPW,ACCA+TYPB,ACCR+TYPB,ACCA+TYPB,ACCR+TYPW,ACCA+TYPB), OP("movtuc",0x2f,6,ACCR+TYPW,ACCA+TYPB,ACCR+TYPB,ACCA+TYPB,ACCR+TYPW,ACCA+TYPB), OP("movw",0xb0,2,ACCR+TYPW,ACCW+TYPW,0,0,0,0), OP("movzbl",0x9a,2,ACCR+TYPB,ACCW+TYPL,0,0,0,0), OP("movzbw",0x9b,2,ACCR+TYPB,ACCW+TYPW,0,0,0,0), OP("movzwl",0x3c,2,ACCR+TYPW,ACCW+TYPL,0,0,0,0), OP("mtpr",0xda,2,ACCR+TYPL,ACCR+TYPL,0,0,0,0), OP("mulb2",0x84,2,ACCR+TYPB,ACCM+TYPB,0,0,0,0), OP("mulb3",0x85,3,ACCR+TYPB,ACCR+TYPB,ACCW+TYPB,0,0,0), OP("muld2",0x64,2,ACCR+TYPD,ACCM+TYPD,0,0,0,0), OP("muld3",0x65,3,ACCR+TYPD,ACCR+TYPD,ACCW+TYPD,0,0,0), OP("mulf2",0x44,2,ACCR+TYPF,ACCM+TYPF,0,0,0,0), OP("mulf3",0x45,3,ACCR+TYPF,ACCR+TYPF,ACCW+TYPF,0,0,0), OP("mull2",0xc4,2,ACCR+TYPL,ACCM+TYPL,0,0,0,0), OP("mull3",0xc5,3,ACCR+TYPL,ACCR+TYPL,ACCW+TYPL,0,0,0), OP("mulp",0x25,6,ACCR+TYPW,ACCA+TYPB,ACCR+TYPW,ACCA+TYPB,ACCR+TYPW,ACCA+TYPB), OP("mulw2",0xa4,2,ACCR+TYPW,ACCM+TYPW,0,0,0,0), OP("mulw3",0xa5,3,ACCR+TYPW,ACCR+TYPW,ACCW+TYPW,0,0,0), OP("nop",0x01,0,0,0,0,0,0,0), OP("polyd",0x75,3,ACCR+TYPD,ACCR+TYPW,ACCA+TYPB,0,0,0), OP("polyf",0x55,3,ACCR+TYPF,ACCR+TYPW,ACCA+TYPB,0,0,0), OP("popr",0xba,1,ACCR+TYPW,0,0,0,0,0), OP("prober",0x0c,3,ACCR+TYPB,ACCR+TYPW,ACCA+TYPB,0,0,0), OP("probew",0x0d,3,ACCR+TYPB,ACCR+TYPW,ACCA+TYPB,0,0,0), OP("pushab",0x9f,1,ACCA+TYPB,0,0,0,0,0), OP("pushad",0x7f,1,ACCA+TYPD,0,0,0,0,0), OP("pushaf",0xdf,1,ACCA+TYPF,0,0,0,0,0), OP("pushal",0xdf,1,ACCA+TYPL,0,0,0,0,0), OP("pushaq",0x7f,1,ACCA+TYPQ,0,0,0,0,0), OP("pushaw",0x3f,1,ACCA+TYPW,0,0,0,0,0), OP("pushl",0xdd,1,ACCR+TYPL,0,0,0,0,0), OP("pushr",0xbb,1,ACCR+TYPW,0,0,0,0,0), OP("rei",0x02,0,0,0,0,0,0,0), OP("remque",0x0f,2,ACCA+TYPB,ACCW+TYPL,0,0,0,0), OP("ret",0x04,0,0,0,0,0,0,0), OP("rotl",0x9c,3,ACCR+TYPB,ACCR+TYPL,ACCW+TYPL,0,0,0), OP("rsb",0x05,0,0,0,0,0,0,0), OP("sbwc",0xd9,2,ACCR+TYPL,ACCM+TYPL,0,0,0,0), OP("scanc",0x2a,4,ACCR+TYPW,ACCA+TYPB,ACCA+TYPB,ACCR+TYPB,0,0), OP("skpc",0x3b,3,ACCR+TYPB,ACCR+TYPW,ACCA+TYPB,0,0,0), OP("sobgeq",0xf4,2,ACCM+TYPL,ACCB+TYPB,0,0,0,0), OP("sobgtr",0xf5,2,ACCM+TYPL,ACCB+TYPB,0,0,0,0), OP("spanc",0x2b,4,ACCR+TYPW,ACCA+TYPB,ACCA+TYPB,ACCR+TYPB,0,0), OP("subb2",0x82,2,ACCR+TYPB,ACCM+TYPB,0,0,0,0), OP("subb3",0x83,3,ACCR+TYPB,ACCR+TYPB,ACCW+TYPB,0,0,0), OP("subd2",0x62,2,ACCR+TYPD,ACCM+TYPD,0,0,0,0), OP("subd3",0x63,3,ACCR+TYPD,ACCR+TYPD,ACCW+TYPD,0,0,0), OP("subf2",0x42,2,ACCR+TYPF,ACCM+TYPF,0,0,0,0), OP("subf3",0x43,3,ACCR+TYPF,ACCR+TYPF,ACCW+TYPF,0,0,0), OP("subl2",0xc2,2,ACCR+TYPL,ACCM+TYPL,0,0,0,0), OP("subl3",0xc3,3,ACCR+TYPL,ACCR+TYPL,ACCW+TYPL,0,0,0), OP("subp4",0x22,4,ACCR+TYPW,ACCA+TYPB,ACCR+TYPW,ACCA+TYPB,0,0), OP("subp6",0x23,6,ACCR+TYPW,ACCA+TYPB,ACCR+TYPW,ACCA+TYPB,ACCR+TYPW,ACCA+TYPB), OP("subw2",0xa2,2,ACCR+TYPW,ACCM+TYPW,0,0,0,0), OP("subw3",0xa3,3,ACCR+TYPW,ACCR+TYPW,ACCW+TYPW,0,0,0), OP("svpctx",0x07,0,0,0,0,0,0,0), OP("tstb",0x95,1,ACCR+TYPB,0,0,0,0,0), OP("tstd",0x73,1,ACCR+TYPD,0,0,0,0,0), OP("tstf",0x53,1,ACCR+TYPF,0,0,0,0,0), OP("tstl",0xd5,1,ACCR+TYPL,0,0,0,0,0), OP("tstw",0xb5,1,ACCR+TYPW,0,0,0,0,0), OP("xfc",0xfc,1,ACCI+TYPB,0,0,0,0,0), OP("xorb2",0x8c,2,ACCR+TYPB,ACCM+TYPB,0,0,0,0), OP("xorb3",0x8d,3,ACCR+TYPB,ACCR+TYPB,ACCW+TYPB,0,0,0), OP("xorl2",0xcc,2,ACCR+TYPL,ACCM+TYPL,0,0,0,0), OP("xorl3",0xcd,3,ACCR+TYPL,ACCR+TYPL,ACCW+TYPL,0,0,0), OP("xorw2",0xac,2,ACCR+TYPW,ACCM+TYPW,((0,0,0,0), OP("xorw3",0xad,3,ACCR+TYPW,ACCR+TYPW,ACCW+TYPW,0,0,0), OP("escd",0xfd,0,0,0,0,0,0,0), OP("esce",0xfe,0,0,0,0,0,0,0), OP("escf",0xff,0,0,0,0,0,0,0), ,0xd5,1,ACCR+TYPL,0,0,0,0,0), OP("tstw",0xb5,1,ACCR+TYPW,0,0,0,0,0), OP("xfc",0xfc,1,ACCI+TYPB,0,0,0,0,0), OP("xorb2",0x8c,2,ACCR+TYPB,ACCM+TYPB,0,0,0,0), OP("xorb3",0x8d,3,ACCR+TYPB,ACCR+TYPB,ACCW+TYPB,0,0,0), OP("xorl2",0xcc,2,ACCR+TYPL,ACCM+TYPL,0,0,0,0), OP("xorl3",0xcd,3,ACCR+TYPL,ACCR+TYPL,ACCW+TYPL,0,0,0), OP("xorw2",0xac,2,ACCR+TYPW,ACCM+TYPW,cmd/as/asio.c 444 0 33 4106 2431567744 6313 /* Coypright (c) 1980 Regents of the University of California */ static char sccsid[] = "@(#)asio.c 4.3 8/16/80"; #include #include "as.h" /* * Block I/O routines for logical I/O concurrently in * more than one place in the same file. */ int biofd; /* file descriptor for block I/O file */ off_t boffset; /* physical position in logical file */ BFILE *biobufs; /* the block I/O buffers */ #define error(severity, message) \ {yyerror(message); if (severity) delexit();} Flushfield(n) register int n; { while (n>0) { outb(bitfield); bitfield >>= 8; n -= 8; } bitoff=0; bitfield=0; } /* * Block I/O Routines */ bopen(bp, off) struct biobuf *bp; off_t off; { bp->b_ptr = bp->b_buf; bp->b_nleft = BUFSIZ - off % BUFSIZ; bp->b_off = off; bp->b_link = biobufs; biobufs = bp; } int bwrerror; bwrite(p, cnt, bp) register char *p; register int cnt; register struct biobuf *bp; { register int put; register char *to; top: if (cnt == 0) return; if (bp->b_nleft) { put = bp->b_nleft; if (put > cnt) put = cnt; bp->b_nleft -= put; to = bp->b_ptr; asm("movc3 r8,(r11),(r7)"); bp->b_ptr += put; p += put; cnt -= put; goto top; } if (cnt >= BUFSIZ) { if (bp->b_ptr != bp->b_buf) bflush1(bp); put = cnt - cnt % BUFSIZ; if (boffset != bp->b_off) lseek(biofd, bp->b_off, 0); if (write(biofd, p, put) != put) { bwrerror = 1; error(1, "Output write error"); } bp->b_off += put; boffset = bp->b_off; p += put; cnt -= put; goto top; } bflush1(bp); goto top; } bflush() { register struct biobuf *bp; if (bwrerror) return; for (bp = biobufs; bp; bp = bp->b_link) bflush1(bp); } bflush1(bp) register struct biobuf *bp; { register int cnt = bp->b_ptr - bp->b_buf; if (cnt == 0) return; if (boffset != bp->b_off) lseek(biofd, bp->b_off, 0); if (write(biofd, bp->b_buf, cnt) != cnt) { bwrerror = 1; error(1, "Output write error"); } bp->b_off += cnt; boffset = bp->b_off; bp->b_ptr = bp->b_buf; bp->b_nleft = BUFSIZ; } bflushc(bp, c) register struct biobuf *bp; char c; { bflush1(bp); bputc(c, bp); } return; for (bp = biobufs; bp; bp = bp->b_link) bflush1(bp); } bflush1(bp) register struct biobuf *bp; { register int cnt = bp->b_ptr - bp->b_buf; if (cnt == 0) return; if (boffset != bp->b_off) lseek(biofd, bp->b_off, 0); if (write(biofd, bp->b_buf, cnt) != cnt) { bwrerror = 1; error(1, "Output write error"); } bp->b_off += cnt; boffset = bp->b_off; bp->b_ptr = bp->b_buf; bp->b_nleft = BUFSIZ; } bflushc(bp, c) rcmd/as/asjxxx.c 444 0 33 32730 2431567747 6734 /* Copyright (c) 1980 Regents of the University of California */ static char sccsid[] = "@(#)asjxxx.c 4.5 8/20/80"; #include #include "as.h" #include "assyms.h" #define JBR 0x11 #define BRW 0x31 #define JMP 0x17 /* * The number of bytes to add if the jxxx must be "exploded" * into the long form */ #define JBRDELTA 1 /* brb ==> brw */ #define JXXXDELTA 3 /* brb ==> brb brw */ #define JBRJDELTA d124 /* brb ==> jmp L^(pc) *d124 */ #define JXXXJDELTA d124+2 /* brb ==> brb jmp L^(pc) *d124 */ int jbrfsize = JBRDELTA; int jxxxfsize = JXXXDELTA; /* * These variables are filled by asscan.c with the * last name encountered (a pointer buried in the intermediate file), * and the last jxxx symbol table entry encountered. */ struct symtab *lastnam; struct symtab *lastjxxx; initijxxx() { jbrfsize = jxxxJUMP ? JBRJDELTA : JBRDELTA; jxxxfsize = jxxxJUMP ? JXXXJDELTA : JXXXDELTA; /* * Note: ifjxxxJUMP is set, then we do NOT do any tunnelling; * this was too complicated to figure out, and in the first * version of the assembler, tunnelling proved to be the hardest * to get to work! */ } /* * Handle jxxx instructions */ ijxout(op,ap,nact) struct arg *ap; { if (passno == 1){ /* * READ THIS BEFORE LOOKING AT jxxxfix() * * Record the jxxx in a special symbol table entry */ register struct symtab *jumpfrom; /* * We assume the MINIMAL length */ putins(op,ap,nact); jumpfrom = lastjxxx; jumpfrom->s_tag = JXACTIVE; jumpfrom->s_jxbump = 0; if (op == JBR) jumpfrom->s_jxfear = jbrfsize; else jumpfrom->s_jxfear = jxxxfsize; if (lastnam == 0) yyerror("jxxx destination not a label"); jumpfrom->s_dest = lastnam; jumpfrom->s_type = dotp->e_xtype; /*only TEXT or DATA*/ jumpfrom->s_index = dotp-usedot; /* * value ALWAYS (ALWAYS!!!) indexes the next instruction * after the jump, even in the jump must be exploded * (bumped) */ jumpfrom->s_value = dotp->e_xvalue; njxxx++; } else {/* pass2, resolve */ /* * READ THIS AFTER LOOKING AT jxxxfix() */ register long oxvalue; register struct exp *xp; register struct symtab *tunnel; register struct arg *aplast; aplast = ap + nact - 1; xp = aplast->a_xp; if (lastjxxx->s_tag == JXTUNNEL){ lastjxxx->s_tag = JXINACTIVE; tunnel = lastjxxx->s_dest; xp->e_xvalue = tunnel->s_value /*index of instruction following*/ - 3 /* size of brw + word*/ + ( ( (tunnel->s_jxfear == jbrfsize) && (tunnel->s_jxbump == 0))?1:0); /*non bumped branch byteis only 2 back*/ } if (lastjxxx->s_jxbump == 0){ /*wasn't bumped, so is short form*/ putins(op, ap, nact); } else { if (op != JBR){ /*branch reverse conditional byte over branch unconditional word*/ oxvalue = xp->e_xvalue; xp->e_xvalue = lastjxxx->s_value; putins(op^1, ap, nact); xp->e_xvalue = oxvalue; } putins(jxxxJUMP ? JMP : BRW, aplast, 1); } } } /*end of ijxout*/ jalign(xp, sp) register struct exp *xp; register struct symtab *sp; { register int mask; /* * Problem with .align * * When the loader constructs an executable file from * a number of objects, it effectively concatnates * together all of the text segments from all objects, * and then all of the data segments. * * If we do an align by a large value, we can align * within the a.out this assembly produces, but * after the loader concatnates, the alignment can't * be guaranteed if the objects preceding this one * in the load are also aligned to the same size. * * Currently, the loader guarantees full word alignment. * So, ridiculous aligns are caught here and converted * to a .align 2, if possible. */ if ( (xp->e_xtype != XABS) || (xp->e_xvalue < 0) || (xp->e_xvalue > 16) ) { yyerror("Illegal `align' argument"); return; } if (xp->e_xvalue > 2){ if (passno == 1){ yywarning(".align %d in any segment is NOT preserved by the loader", xp->e_xvalue); yywarning(".align %d converted to .align 2", xp->e_xvalue); } xp->e_xvalue = 2; } flushfield(NBPW/4); if (passno == 1) { sp->s_tag = JXALIGN; sp->s_jxfear = (1 << xp->e_xvalue) - 1; sp->s_type = dotp->e_xtype; sp->s_index = dotp-usedot; /* * We guess that the align will take up at least one * byte in the code output. We will correct for this * initial high guess when we explode (bump) aligns * when we fix the jxxxes. We must do this guess * so that the symbol table is sorted correctly * and labels declared to fall before the align * really get their, instead of guessing zero size * and have the label (incorrectly) fall after the jxxx. * This is a quirk of our requirement that indices into * the code stream point to the next byte following * the logical entry in the symbol table */ dotp->e_xvalue += 1; sp->s_value = dotp->e_xvalue; njxxx++; } else { mask = (1 << xp->e_xvalue) - 1; while (dotp->e_xvalue & mask){ #ifdef UNIX outb(0); #endif UNIX #ifdef VMS *vms_obj_ptr++ = -1; *vms_obj_ptr++ = 0; dotp->e_xvalue += 1; #endif VMS } } } /* * Pass 1.5, resolve jxxx instructions and .align in .text */ jxxxfix() { register struct symtab *jumpfrom; struct symtab **cojumpfrom, *ubjumpfrom; register struct symtab *dest; register struct symtab *intdest; /*intermediate dest*/ register struct symtab **cointdest, *ubintdest; register struct symtab *tunnel; int displ,nchange; int badjxalign; /*if jump across an align*/ int stillactives; /*if still active jxxxes*/ int segno; /*current segment number*/ int topono; /*which iteration in the topo sort*/ register unsigned char tag; /* * consider each segment in turn... */ for (segno = 0; segno < NLOC + NLOC; segno++){ badjxalign = 0; /*done on a per segment basis*/ /* * Do a lazy topological sort. */ for (topono = 1, nchange = 1; nchange != 0; topono++){ #ifdef DEBUG if (debug) printf("\nSegment %d, topo iteration %d\n", segno, topono)((; #endif nchange = 0; stillactives = 0; /* * We keep track of one possible tunnel location. * A tunnel will eventually be an unconditional * branch to the same place that another jxxx * will want to branch to. We will turn a * branch conditional/unconditional (word) that would * have to get bumped because its destination is too * far away, into a branch conditional/unconditional * byte to the tunnel branch conditional/unconditional. * Of course, the tunnel must branch to the same place * as we want to go. */ tunnel = 0; /*initially, no tunnel*/ SEGITERATE(segno, 0, 0, cojumpfrom, jumpfrom, ubjumpfrom, ++){ tag = jumpfrom->s_tag; if (tag <= IGNOREBOUND) continue; /*just an ordinary symbol*/ if (tag == JXALIGN){ tunnel = 0; /*avoid tunneling across a flex alocation*/ continue; /*we take care of these later*/ } if ( jumpfrom->s_jxfear == jbrfsize /*unconditional*/ || ( tag == JXINACTIVE /*inactive bumped*/ && (jumpfrom->s_jxbump != 0) ) ) tunnel = jumpfrom; if (tag != JXACTIVE) continue; dest = jumpfrom->s_dest; if (jumpfrom->s_index != dest->s_index){ yyerror("Intersegment jxxx"); continue; } displ = dest->s_value - jumpfrom->s_value; if (displ < MINBYTE || displ > MAXBYTE) { /* * This is an immediate lose! * * We first attempt to tunnel * by finding an intervening jump that * has the same destination. * The tunnel is always the first preceeding * jxxx instruction, so the displacement * to the tunnel is less than zero, and * its relative position will be unaffected * by future jxxx expansions. * * No tunnels if doing jumps... */ if ( (!jxxxJUMP) && (jumpfrom->s_jxfear > jbrfsize) && (tunnel) && (tunnel->s_dest == jumpfrom->s_dest) && (tunnel->s_index == jumpfrom->s_index) && (tunnel->s_value - jumpfrom->s_value >= MINBYTE + jxxxfsize) ) { /* * tunnelling is OK */ jumpfrom->s_dest = tunnel; /* * no bumping needed, this * is now effectively inactive * but must be remembered */ jumpfrom->s_tag = JXTUNNEL; #ifdef DEBUG if(debug) printf("Tunnel from %s from line %d\n", jumpfrom->s_name, lineno); #endif continue; } else { /*tunneling not possible*/ /* * since this will be turned * into a bumped jump, we can * use the unconditional jump * as a tunnel */ tunnel = jumpfrom; jumpfrom->s_tag = JXNOTYET; ++nchange; continue; } } /*end of immediate lose*/ /* * Do a forward search for an intervening jxxx */ if (displ >= 0) { SEGITERATE(segno, cojumpfrom + 1,0,cointdest, intdest, ubintdest, ++){ if (intdest->s_value > dest->s_value) break; /* beyond destination */ if (intdest->s_tag <= JXQUESTIONABLE) continue; /*frozen solid*/ if (intdest->s_tag == JXALIGN){ jumpfrom->s_jxoveralign = 1; badjxalign++; } /* * we assume the worst case * for unfrozen jxxxxes */ displ += intdest->s_jxfear; } if (displ <= MAXBYTE){ /* * the worst possible conditions * can't hurt us, so forget about * this jump */ jumpfrom->s_tag = JXINACTIVE; } else { stillactives++; } } else { /* * backward search for intervening jxxx */ SEGITERATE(segno, cojumpfrom - 1,1,cointdest, intdest, ubintdest, --){ if (intdest->s_value <= dest->s_value) break; /* beyond destination */ if (intdest->s_tag <= JXQUESTIONABLE) continue; /*frozen solid*/ if (intdest->s_tag == JXALIGN){ jumpfrom->s_jxoveralign = 1; badjxalign++; } displ -= intdest->s_jxfear; } if (displ >= MINBYTE) { jumpfrom->s_tag = JXINACTIVE; } else { stillactives++; } } /*end of backwards search*/ } /*end of iterating through all symbols in this seg*/ if (nchange == 0) { /* * Now, if there are still active jxxx entries, * we are partially deadlocked. We can leave * these jxxx entries in their assumed short jump * form, as all initial displacement calcualtions * are hanging on unresolved jxxx instructions * that might explode into a long form, causing * other jxxxes jumping across the first set of * jxxxes to explode, etc. * However, if a jxxx jumps across a .align, * we assume the worst for the deadlock cycle, * and resolve all of them towards the long * jump. * Currently, the C compiler does not produce * jumps across aligns, as aligns are only used * in data segments, or in text segments to align * functions. */ if (stillactives){ SEGITERATE(segno, 0, 0, cojumpfrom, jumpfrom, ubjumpfrom, ++){ if (jumpfrom->s_tag == JXACTIVE){ jumpfrom->s_tag = badjxalign?JXNOTYET:JXINACTIVE; } } if (badjxalign){ jxxxbump(segno, (struct symtab **)0); } } /* * Handle all of the .align s */ SEGITERATE(segno, 0, 0, cojumpfrom, jumpfrom, ubjumpfrom, ++){ if (jumpfrom->s_tag == JXALIGN){ /* * Predict the true displacement * needed, irregardless of the * fact that we guessed 1 */ displ = (jumpfrom->s_value - 1) & (unsigned)jumpfrom->s_jxfear; if (displ == 0){ /*no virtual displacement*/ jumpfrom->s_jxfear = -1; } else { jumpfrom->s_jxfear = (jumpfrom->s_jxfear + 1) - displ; /* * assert jumpfrom->s_jxfear > 0 */ if (jumpfrom->s_jxfear == 1){ /*our prediction was correct*/ continue; } /* * assert jumpfrom->s_jxfear > 1 */ jumpfrom->s_jxfear -= 1; /*correct guess*/ } /* * assert jumpfrom->s_jxfear = -1, +1...2**n-1 */ jumpfrom->s_tag = JXNOTYET; /*signal*/ jxxxbump(segno, cojumpfrom); jumpfrom->s_tag = JXINACTIVE; /* * Assert jxfrom->jxvalue indexes the first * code byte after the added bytes, and * has n low order zeroes. */ } } /*end of walking through each segment*/ } /*end of no changes */ else { /*changes, and still have to try another pass*/ jxxxbump(segno, (struct symtab **)0); } } /*end of doing the topologic sort*/ } /*end of iterating through all segments*/ } /*end of jxxxfix*/ /* * Go through the symbols in a given segment number, * and see which entries are jxxx entries that have * been logically "exploded" (expanded), but for which * the value of textually following symbols has not been * increased */ jxxxbump(segno, starthint) int segno; struct symtab **starthint; { register struct symtab **cosp, *sp; register struct symtab *ub; register int cum_bump; register unsigned char tag; cum_bump = 0; SEGITERATE(segno, starthint, 0, cosp, sp, ub, ++){ tag = sp->s_tag; if (tag == JXNOTYET){ #ifdef DEBUG if (debug){ if (sp->s_dest != 0) printf("Explode jump to %s on line %d\n", sp->s_dest->s_name, lineno); else printf("Explode an align!\n"); } #endif sp->s_tag = JXINACTIVE; sp->s_jxbump = 1; cum_bump += sp->s_jxfear; } /* * Only bump labels and jxxxes. Ignored entries can * be incremented, as they are thrown away later on. * Stabds are given their final value in the second * pass. */ if (tag >= OKTOBUMP) /*only bump labels and jxxxes and floating stabs*/ sp->s_value += cum_bump; } usedot[segno].e_xvalue += cum_bump; } line %d\n", sp->s_dest->s_name, lincmd/as/asmain.c 444 0 33 34322 2431710064 6634 /* Copyright (c) 1980 Regents of the University of California */ static char sccsid[] = "@(#)asmain.c 4.8 8/20/80"; #include #include #include #include "as.h" #include "assyms.h" #include "asexpr.h" #include "asscan.h" #ifdef UNIX #define unix_lang_name "VAX/UNIX Assembler V8/20/80 4.8" #endif #ifdef VMS #define vms_lang_name "VAX/VMS C Assembler V1.00" #endif VMS /* * variables to manage reading the assembly source files */ char *dotsname; /*the current file name; managed by the parser*/ int lineno; /*current line number; managed by the parser*/ char **innames; /*names of the files being assembled*/ int ninfiles; /*how many interesting files there are*/ /* * Flags settable from the argv process argument list */ int silent = 0; /*don't complain about any errors*/ int savelabels = 0; /*write the labels to the a.out file*/ int d124 = 4; /*default allocate 4 bytes for unknown pointers*/ int anyerrs = 0; /*no errors yet*/ int orgwarn = 0; /*Bad origins*/ int passno = 1; /* current pass*/ int jxxxJUMP = 0; /* in jxxxes that branch too far, use jmp instead of brw */ int readonlydata = 0; /* initialzed data -> text space */ #ifdef DEBUG int debug = 0; int toktrace = 0; #endif int useVM = /*put the temp file in virtual memory*/ #ifdef VMS 1; /*VMS has virtual memory (duh)*/ #endif VMS #ifdef UNIX 0; #endif char *endcore; /*where to get more symbol space*/ /* * Managers of the a.out file. */ struct exec hdr; #define MAGIC 0407 u_long tsize; /* total text size */ u_long dsize; /* total data size */ u_long datbase; /* base of the data segment */ u_long trsize; /* total text relocation size */ u_long drsize; /* total data relocation size */ /* * Information about the current segment is accumulated in * usedot; the most important information stored is the * accumulated size of each of the text and data segments * * dotp points to the correct usedot expression for the current segment */ struct exp usedot[NLOC+NLOC]; /* info about all segments */ struct exp *dotp; (( /* data/text location pointer */ /* * The inter pass temporary file is opened and closed by stdio, but * is written to using direct read/write, as the temporary file * is composed of buffers exactly BUFSIZ long. */ FILE *tmpfil; /* interpass communication file */ /* * a.out is created during the second pass. * It is opened by stdio, but is filled with the parallel * block I/O library */ char *outfile = "a.out"; FILE *a_out_file; off_t a_out_off; /* cumulative offsets for segments */ /* * The logical files containing the assembled data for each of * the text and data segments are * managed by the parallel block I/O library. * a.out is logically opened in many places at once to * receive the assembled data from the various segments as * it all trickles in, but is physically opened only once * to minimize file overhead. */ BFILE *usefile[NLOC+NLOC]; /* text/data files */ BFILE *txtfil; /* current text/data file */ /* * Relocation information is accumulated seperately for each * segment. This is required by the old loader (from BTL), * but not by the new loader (Bill Joy). * * However, the size of the relocation information can not be computed * during or after the 1st pass because the ''absoluteness' of values * is unknown until all locally declared symbols have been seen. * Thus, the size of the relocation information is only * known after the second pass is finished. * This obviates the use of the block I/O * library, which requires knowing the exact offsets in a.out. * * So, we save the relocation information internally (we don't * go to internal files to minimize overhead). * * Empirically, we studied 259 files composing the system, * two compilers and a compiler generator: (all of which have * fairly large source files) * * Number of files = 259 * Number of non zero text reloc files: 233 * Number of non zero data reloc files: 53 * Average text relocation = 889 * Average data relocation = 346 * Number of files > BUFSIZ text relocation = 71 * Number of files > BUFSIZ data relocation = 6 * * For compiled C code, there is usually one text segment and two * data segments; we see that allocating our own buffers and * doing our internal handling of relocation information will, * on the average, not use more memory than taken up by the buffers * allocated for doing file I/O in parallel to a number of file. * * If we are assembling with the -V option, we * use the left over token buffers from the 2nd pass, * otherwise, we create our own. * * When the 2nd pass is complete, closeoutrel flushes the token * buffers out to a BFILE. * * The internals to relbufdesc are known only in assyms.c * * outrel constructs the relocation information. * closeoutrel flushes the relocation information to relfil. */ struct relbufdesc *rusefile[NLOC+NLOC]; struct relbufdesc *relfil; /* un concatnated relocation info */ BFILE *relocfile; /* concatnated relocation info */ /* * Once the relocation information has been written, * we can write out the symbol table using the Block I/O * mechanisms, as we once again know the offsets into * the a.out file. * * We use relfil to output the symbol table information. */ char *tmpdirprefix = #ifdef UNIX "/tmp/"; #else VMS "/usr/tmp/"; #endif #define TMP_SUFFIX "asXXXXXX" char tmpn1[TNAMESIZE]; int delexit(); main(argc, argv) int argc; char **argv; { tmpn1[0] = 0; endcore = (char *)sbrk(0); argprocess(argc, argv); /* process argument lists */ if (anyerrs) exit(1); initialize(); zeroorigins(); /* set origins to zero */ zerolocals(); /* fix local label counters */ i_pass1(); /* open temp files, etc */ pass1(); /* first pass through .s files */ testlocals(); /* check for undefined locals */ if (anyerrs) delexit(); pass1_5(); /* resolve jxxx */ if (anyerrs) delexit(); open_a_out(); /* open a.out */ roundsegments(); /* round segments to FW */ build_hdr(); /* build initial header, and output */ i_pass2(); /* reopen temporary file, etc */ pass2(); /* second pass through the virtual .s */ if (anyerrs) delexit(); fillsegments(); /* fill segments with 0 to FW */ reloc_syms(); /* dump relocation and symbol table */ delete(); /* remove tmp file */ bflush(); /* close off block I/O view of a.out */ fix_a_out(); /* add in text and data reloc counts */ if (anyerrs == 0 && orgwarn) yyerror("Caution: absolute origins.\n"); exit(anyerrs != 0); } /*end of UNIX main*/ argprocess(argc, argv) int argc; char *argv[]; { register char *cp; ninfiles = 0; silent = 0; #ifdef DEBUG debug = 0; #endif innames = (char **)ClearCalloc(argc+1, sizeof (innames[0])); dotsname = ""; while (argc > 1) { if (argv[1][0] != '-') innames[ninfiles++] = argv[1]; else { cp = argv[1] + 1; /* * We can throw away single minus signs, so * that make scripts for the PDP 11 assembler work * on this assembler too */ while (*cp){ switch(*cp++){ default: yyerror("Unknown flag: %c", *--cp); cp++; break; case 'd': d124 = *cp++ - '0'; if ( (d124 != 1) && (d124 != 2) && (d124 != 4)){ yyerror("-d[124] only"); exit(1); } break; case 'o': if (argc < 3){ yyerror("-o what???"); exit(1); } outfile = argv[2]; bumpone: argc -= 2; argv += 2; goto nextarg; case 't': if (argc < 3){ yyerror("-t what???"); exit(1); } tmpdirprefix = argv[2]; goto bumpone; case 'V': useVM = 1; break; case 'W': silent = 1; break; case 'L': savelabels = 1; break; case 'J': jxxxJUMP = 1; break; #ifdef DEBUG case 'D': debug = 1; break; case 'T': toktrace = 1; break; #endif case 'R': readonlydata = 1; break; } /*end of the switch*/ } /*end of pulling out all arguments*/ } /*end of a flag argument*/ --argc; ++argv; nextarg:; } /* innames[ninfiles] = 0; */ } initialize() { if (signal(SIGINT, SIG_IGN) != SIG_IGN) signal(SIGINT, delexit); /* * Install symbols in the table */ symtabinit(); syminstall(); /* * Build the expression parser accelerator token sets */ buildtokensets(); } zeroorigins() { register int locindex; /* * Mark usedot: the first NLOC slots are for named text segments, * the next for named data segments. */ for (locindex = 0; locindex < NLOC; locindex++){ usedot[locindex].e_xtype = XTEXT; usedot[NLOC + locindex].e_xtype = XDATA; usedot[locindex].e_xvalue = 0; usedot[NLOC + locindex].e_xvalue = 0; usedot[locindex].e_yvalue = 0; usedot[NLOC + locindex].e_yvalue = 0; } } zerolocals() { register int i; for (i = 0; i <= 9; i++) { lgensym[i] = 1; genref[i] = 0; } } i_pass1() { if (useVM == 0){ strcat(tmpn1, tmpdirprefix); if (tmpdirprefix[strlen(tmpdirprefix)-1] != '/') strcat(tmpn1, "/"); strcat(tmpn1, TMP_SUFFIX); mktemp(tmpn1); tmpfil = fopen(tmpn1, "w"); if (tmpfil==NULL) { yyerror("Bad pass 1 temporary file for writing %s", tmpn1); delexit(); } } inittmpfile(); initijxxx(); } pass1() { register int i; passno = 1; dotp = &usedot[0]; txtfil = (BFILE *)0; relfil = (struct relbufdesc *)0; if (ninfiles == 0){ /*take the input from stdin directly*/ lineno = 1; dotsname = ""; yyparse(); } else { /*we have the names tanked*/ for (i = 0; i < ninfiles; i++){ new_dot_s(innames[i]); if (freopen(innames[i], "r", stdin) == NULL) { yyerror( "Can't open source file %s\n", innames[i]); exit(2); } /* stdio is NOT used to read the input characters */ /* we use read directly, into our own buffers */ yyparse(); } } closetmpfile(); /*kick out the last buffered intermediate text*/ } testlocals() { register int i; for (i = 0; i <= 9; i++) { if (genref[i]) yyerror("Reference to undefined local label %df", i); lgensym[i] = 1; genref[i] = 0; } } pass1_5() { sortsymtab(); #ifdef DEBUG if (debug) dumpsymtab(); #endif jxxxfix(); #ifdef DEBUG if (debug) dumpsymtab(); #endif } open_a_out() { /* * Open up the a.out file now, and get set to build * up offsets into it for all of the various text,data * text relocation and data relocation segments. */ a_out_file = fopen(outfile, "w"); if (a_out_file == NULL) { yyerror("Cannot create %s", outfile); delexit(); } biofd = a_out_file->_file; a_out_off = 0; } roundsegments() { register int locindex; register long v; /* * round and assign text segment origins * the exec header always goes in usefile[0] */ tsize = 0; for (locindex=0; locindex_file, 0L, 0) < 0) yyerror("Reposition for header rewrite fails"); if (write(a_out_file->_file, (char *)&hdr, sizeof (struct exec)) < 0) yyerror("Rewrite of header fails"); } delexit() { delete(); if (passno == 2){ unlink(outfile); } exit(1); } delete() { if (useVM == 0 || tmpn1[0]) unlink(tmpn1); } sawabort() { char *fillinbuffer(); while (fillinbuffer() != (char *)0) continue; delete(); exit(1); /*although the previous pass will also exit non zero*/ } panic(fmt, a1, a2, a3, a4) char *fmt; /*VARARGS 1*/ { yyerror("Assembler panic: bad internal data structure."); yyerror(fmt, a1, a2, a3, a4); delete(); abort(); } yyerror("Rewrite of header fails"); } delexit() { delete(); if (passno == 2){ unlink(outfile); } exit(1); } delete() { if (useVM == 0 || tmpn1[0]) unlink(tmpn1); } sawabort() { char *fillinbuffer(); while (fillinbuffer() != (char *)0) continue; delete(); exit(1); /*although the prcmd/as/asparse.c 444 0 33 57615 2431713336 7041 /* Copyright (c) 1980 Regents of the University of California */ static char sccsid[] = "@(#)asparse.c 4.7 8/20/80"; #include #include "as.h" #include "asexpr.h" #include "asscan.h" #include "assyms.h" int lgensym[10]; char genref[10]; long bitfield; int bitoff; int curlen; /* current length of literals */ /* * The following three variables are communication between various * modules to special case a number of things. They are properly * categorized as hacks. */ extern struct symtab *lastnam;/*last name seen by the lexical analyzer*/ int exprisname; /*last factor in an expression was a name*/ int droppedLP; /*one is analyzing an expression beginning with*/ /*a left parenthesis, which has already been*/ /*shifted. (Used to parse ()(rn)*/ char yytext[NCPS+2]; /*the lexical image*/ int yylval; /*the lexical value; sloppy typing*/ /* * Expression and argument managers */ struct exp *xp; /*next free expression slot, used by expr.c*/ struct exp explist[NEXP]; /*max of 20 expressions in one opcode*/ struct arg arglist[NARG]; /*building up operands in instructions*/ /* * Sets to accelerate token discrimination */ char tokensets[(LASTTOKEN) - (FIRSTTOKEN) + 1]; static char UDotsname[32]; /*name of the assembly source*/ int yyparse() { register struct exp *locxp; /* * loc1xp and ptrloc1xp are used in the * expression lookahead */ struct exp *loc1xp; /*must be non register*/ struct exp **ptrloc1xp = & loc1xp; struct exp *pval; /*hacking expr:expr*/ register struct symtab *np; register int argcnt; register int val; /*what yylex gives*/ register int auxval; /*saves val*/ register struct arg *ap; /*first free argument*/ struct symtab *p; register struct symtab *stpt; struct strdesc *stringp; /*handles string lists*/ int regno; /*handles arguments*/ int *ptrregno = ®no; int sawmul; /*saw * */ int sawindex; /*saw [rn]*/ int sawsize; int seg_type; /*the kind of segment: data or text*/ int seg_number; /*the segment number*/ int space_value; /*how much .space needs*/ int fill_rep; /*how many reps for .fill */ int fill_size; /*how many bytes for .fill */ int field_width; /*how wide a field is to be*/ int field_value; /*the value to stuff in a field*/ char *stabname; /*name of stab dealing with*/ ptrall stabstart; /*where the stab starts in the buffer*/ int reloc_how; /* how to relocate expressions */ xp = explist; ap = arglist; val = yylex(); while (val != PARSEEOF){ /* primary loop */ while (INTOKSET(val, LINSTBEGIN)){ if (val == INT) { int i = ((struct exp *)yylval)->e_xvalue; shift; if (val != COLON) goto nocolon; if (i < 0 || i > 9) { yyerror("Local labels are 0-9"); goto errorfix; } sprintf(yytext, "L%d\001%d", i, lgensym[i]); lgensym[i]++; genref[i] = 0; yylval = (int)*lookup(passno == 1); val = NAME; np = (struct symtab *)yylval; goto restlab; } if (val == NL){ lineno++; shift; } else if (val == SEMI) shift; else { /*its a name, so we have a label or def */ if (val != NAME){ ERROR("Name expected for a label"); } np = (struct symtab *)yylval; shiftover(NAME); nocolon: if (val != COLON) { #ifdef FLEXNAMES yyerror("\"%s\" is not followed by a ':' for a label definition", #else not FLEXNAMES yyerror("\"%.*s\" is not followed by a ':' for a label definition", NCPS, #endif not FLEXNAMES np->s_name); goto errorfix; } restlab: shift; flushfield(NBPW/4); if ((np->s_type&XTYPE)!=XUNDEF) { if( (np->s_type&XTYPE)!=dotp->e_xtype || np->s_value!=dotp->e_xvalue || ( (passno==1) &&(np->s_index != dotp->e_xloc) ) ){ #ifndef DEBUG if (np->s_name[0] != 'L') #endif not DEBUG { if (passno == 1) #ifdef FLEXNAMES yyerror("%s redefined", #else not FLEXNAMES yyerror("%.*s redefined", NCPS, #endif not FLEXNAMES np->s_name); else #ifdef FLEXNAMES yyerror("%s redefined: PHASE ERROR, 1st: %d, 2nd: %d", #else not FLEXNAMES yyerror("%.*s redefined: PHASE ERROR, 1st: %d, 2nd: %d", NCPS, #endif not FLEXNAMES np->s_name, np->s_value, dotp->e_xvalue); } } } np->s_type &= ~(XTYPE|XFORW); np->s_type |= dotp->e_xtype; np->s_value = dotp->e_xvalue; if (passno == 1){ np->s_index = dotp-usedot; if (np->s_name[0] == 'L'){ nlabels++; } np->s_tag = LABELID; } } /*end of this being a label*/ } /*end of to consuming all labels, NLs and SEMIS */ xp = explist; ap = arglist; /* * process the INSTRUCTION body */ switch(val){ default: ERROR("Unrecognized instruction or directive"); case IABORT: shift; sawabort(); /*NOTREACHED*/ break; case PARSEEOF: tokptr -= sizeof(toktype); *tokptr++ = VOID; tokptr[1] = VOID; tokptr[2] = PARSEEOF; break; case IFILE: shift; stringp = (struct strdesc *)yylval; shiftover(STRING); dotsname = &UDotsname[0]; movestr(dotsname, stringp->str, stringp->str_lg >= 32? 32 :stringp->str_lg); dotsname[stringp->str_lg] = '\0'; break; case ILINENO: shift; /*over the ILINENO*/ expr(locxp, val); lineno = locxp->e_xvalue; break; case ISET: /* .set , */ shift; np = (struct symtab *)yylval; shiftover(NAME); shiftover(CM); expr(locxp, val); np->s_type &= (XXTRN|XFORW); np->s_type |= locxp->e_xtype&(XTYPE|XFORW); np->s_value = locxp->e_xvalue; if (passno==1) np->s_index = locxp->e_xloc; if ((locxp->e_xtype&XTYPE) == XUNDEF) yyerror("Illegal set?"); break; case ILSYM: /*.lsym name , expr */ shift; np = (struct symtab *)yylval; shiftover(NAME); shiftover(CM); expr(locxp, val); /* * Build the unique occurance of the * symbol. * The character scanner will have * already entered it into the symbol * table, but we should remove it */ if (passno == 1){ stpt = (struct symtab *)symalloc(); #ifdef FLEXNAMES stpt->s_name = np->s_name; #else movestr(stpt->s_name, np->s_name, NCPS); #endif np->s_tag = OBSOLETE; /*invalidate original */ nforgotten++; np = stpt; if (locxp->e_xtype != XABS) ("Illegal lsym"); np->s_value=locxp->e_xvalue; np->s_type=XABS; np->s_tag = ILSYM; } break; case IGLOBAL: /*.globl */ shift; np = (struct symtab *)yylval; shiftover(NAME); np->s_type |= XXTRN; break; case IDATA: /*.data [ ] */ case ITEXT: /*.text [ ] */ seg_type = -val; shift; if (INTOKSET(val, EBEGOPS+YUKKYEXPRBEG+SAFEEXPRBEG)){ expr(locxp, val); seg_type = -seg_type; /*now, it is positive*/ } if (seg_type < 0) { /*there wasn't an associated expr*/ seg_number = 0; seg_type = -seg_type; } else { if (locxp->e_xtype != XABS || (seg_number=locxp->e_xvalue) >= NLOC) { yyerror("illegal location counter"); seg_number = 0; } } if (seg_type == IDATA) seg_number += NLOC; flushfield(NBPW/4); dotp = &usedot[seg_number]; #ifdef UNIX if (passno==2) { /* go salt away in pass 2*/ txtfil = usefile[seg_number]; relfil = rusef((ile[seg_number]; } #endif UNIX #ifdef VMS if (passno==2) { puchar(vms_obj_ptr,6); /* setpl */ puchar(vms_obj_ptr,seg_number); /* psect # */ plong(vms_obj_ptr,dotp->e_xvalue);/* offset */ puchar(vms_obj_ptr,80); /* setrb */ if((vms_obj_ptr-sobuf) > 400){ write(objfil,sobuf,vms_obj_ptr-sobuf); vms_obj_ptr=sobuf+1; /*flush buf*/ } } #endif VMS break; /* * Storage filler directives: * * .byte [] * * exprlist: empty | exprlist outexpr * outexpr: | : */ case IBYTE: curlen = NBPW/4; goto elist; case IINT: case ILONG: curlen = NBPW; goto elist; case IWORD: curlen = NBPW/2; elist: seg_type = val; shift; /* * Expression List processing */ if (INTOKSET(val, EBEGOPS+YUKKYEXPRBEG+SAFEEXPRBEG)){ do{ /* * expression list consists of a list of : * * : * (pack expr2 into expr1 bits */ expr(locxp, val); /* * now, pointing at the next token */ if (val == COLON){ shiftover(COLON); expr(pval, val); if (locxp->e_xtype != XABS) yyerror("Width not absolute"); field_width = locxp->e_xvalue; locxp = pval; if (bitoff + field_width > curlen) flushfield(curlen); if (field_width > curlen) yyerror("Expression crosses field boundary"); } else { field_width = curlen; flushfield(curlen); } if ((locxp->e_xtype&XTYPE)!=XABS) { if (bitoff) yyerror("Illegal relocation in field"); switch(curlen){ case NBPW/4: reloc_how = TYPB; break; case NBPW/2: reloc_how = TYPW; break; case NBPW: reloc_how = TYPL; break; } if (passno == 1){ dotp->e_xvalue += ty_nbyte[reloc_how]; } else { outrel(locxp, reloc_how); } } else { field_value = locxp->e_xvalue & ( (1L << field_width)-1); bitfield |= field_value << bitoff; bitoff += field_width; } if ( auxval = (val == CM)) shift; xp = explist; } while (auxval); } /*existed an expression at all*/ flushfield(curlen); if ( ( curlen == NBPW/4) && bitoff) dotp->e_xvalue ++; break; /*end of case IBYTE, IWORD, ILONG, IINT*/ case ISPACE: /* .space */ shift; expr(locxp, val); if (locxp->e_xtype != XABS) yyerror("Space size not absolute"); space_value = locxp->e_xvalue; ospace: flushfield(NBPW/4); #ifdef UNIX while (space_value > 96){ outs(strbuf[2].str, 96); space_value -= 96; } outs(strbuf[2].str, space_value); #endif UNIX #ifdef VMS dotp->e_xvalue += space_value; /*bump pc*/ if (passno==2){ if(*(strbuf[2].str)==0) { puchar(vms_obj_ptr,81); /* AUGR */ pulong(vms_obj_ptr,space_value);/* incr */ } else yyerror("VMS, encountered non-0 .space"); if ((vms_obj_ptr-sobuf) > 400) { write(objfil,sobuf,vms_obj_ptr-sobuf); vms_obj_ptr=sobuf+1; /*pur buf*/ } } #endif VMS break; #ifdef UNIX /* * .fill rep, size, value * repeat rep times: fill size bytes with (truncated) value * size must be between 1 and 8 */ case IFILL: shift; expr(locxp, val); if (locxp->e_xtype != XABS) yyerror("Fill repetition count not absolute"); fill_rep = locxp->e_xvalue; shiftover(CM); expr(locxp, val); if (locxp->e_xtype != XABS) yyerror("Fill size not absolute"); fill_size = locxp->e_xvalue; if (fill_size <= 0 || fill_size > 8) yyerror("Fill count not in in 1..8"); shiftover(CM); expr(locxp, val); if (passno == 2 && locxp->e_xtype != XABS) yyerror("Fill value not absolute"); flushfield(NBPW/4); if (passno == 1) { locxp->e_xvalue += fill_rep * fill_size; } else { while(fill_rep-- > 0) bwrite(&locxp->e_xvalue, fill_size, txtfil); } break; #endif UNIX case IASCII: /* .ascii [ ] */ case IASCIZ: /* .asciz [ ] */ auxval = val; shift; /* * Code to consume a string list * * stringlist: empty | STRING | stringlist STRING */ while (val == STRING){ flushfield(NBPW/4); if (bitoff) dotp->e_xvalue++; stringp = (struct strdesc *)yylval; #ifdef UNIX outs(stringp->str, stringp->str_lg); #endif UNIX #ifdef VMS { register int i; for (i=0; i < stringp->str_lg; i++){ dotp->e_xvalue += 1; if (passno==2){ puchar(vms_obj_ptr,-1); puchar(vms_obj_ptr,stringp->str[i]); if (vms_obj_ptr-sobuf > 400) { write(objfil,sobuf,vms_obj_ptr-sobuf); vms_obj_ptr = sobuf + 1; } } } } #endif VMS shift; /*over the STRING*/ if (val == CM) /*could be a split string*/ shift; } if (auxval == IASCIZ){ flushfield(NBPW/4); #ifdef UNIX outb(0); #endif UNIX #ifdef VMS if (passno == 2) { puchar(vms_obj_ptr,-1); puchar(vms_obj_ptr,0); } dotp->e_xvalue += 1; #endif VMS } break; case IORG: /* .org */ shift; expr(locxp, val); if (locxp->e_xtype==XABS) orgwarn++; else if ((locxp->e_xtype & ~XXTRN) != dotp->e_xtype) yyerror("Illegal expression to set origin"); space_value = locxp->e_xvalue - dotp->e_xvalue; if (space_value < 0) yyerror("Backwards 'org'"); goto ospace; break; /* * * Process stabs. Stabs are created only by the f77 * and the C compiler with the -g flag set. * We only look at the stab ONCE, during pass 1, and * virtually remove the stab from the intermediate file * so it isn't seen during pass2. This makes for some * hairy processing to handle labels occuring in * stab entries, but since most expressions in the * stab are integral we save lots of time in the second * pass by not looking at the stabs. * A stab that is tagged floating will be bumped during * the jxxx resolution phase. A stab tagged fixed will * not be be bumped. * * .stab: Old fashioned stabs * .stabn: For stabs without names * .stabs: For stabs with string names * .stabd: For stabs for line numbers or bracketing, * without a string name, without * a final expression. The value of the * final expression is taken to be the current * location counter, and is patched by the 2nd pass * * .stab{,}*NCPS,, , , * .stabn , , , * .stabs STRING, , , , * .stabd , , # . */ case ISTAB: #ifndef FLEXNAMES stabname = ".stab"; if (passno == 2) goto errorfix; stpt = (struct symtab *)yylval; /* * Make a pointer to the .stab slot. * There is a pointer in the way (stpt), and * tokptr points to the next token. */ stabstart = tokptr; (char *)stabstart -= sizeof(struct symtab *); (char *)stabstart -= sizeof(toktype); shift; for (argcnt = 0; argcnt < NCPS; argcnt++){ expr(locxp, val); stpt->s_name[argcnt] = locxp->e_xvalue; xp = explist; shiftover(CM); } goto tailstab; #else FLEXNAMES yyerror(".stab directive not supported in; report this compiler bug to system administrator"); goto errorfix; #endif FLEXNAMES tailstab: expr(locxp, val); if (! (locxp->e_xvalue & STABTYPS)){ yyerror("Invalid type in %s",stabname); goto errorfix; } stpt->s_ptype = locxp->e_xvalue; shiftover(CM); expr(locxp, val); stpt->s_other = locxp->e_xvalue; shiftover(CM); expr(locxp, val); stpt->s_desc = locxp->e_xvalue; shiftover(CM); exprisname = 0; expr(locxp, val); p = locxp->e_xname; if (p == NULL) { /*absolute expr to begin with*/ stpt->s_value = locxp->e_xvalue; stpt->s_index = dotp - usedot; if (exprisname){ switch(stpt->s_ptype){ case N_GSYM: case N_FNAME: case N_RSYM: case N_SSYM: case N_LSYM: case N_PSYM: case N_BCOMM: case N_ECOMM: case N_LENG: stpt->s_tag = STABFIXED; break; default: stpt->s_tag = STABFLOATING; break; } } else stpt->s_tag = STABFIXED; } else { /*really have a name*/ stpt->s_dest = locxp->e_xname; stpt->s_index = p->s_index; stpt->s_type = p->s_type | STABFLAG; /* * We will assign a more accruate * guess of locxp's location when * we sort the symbol table * The final value of value is * given by stabfix() */ stpt->s_tag = STABFLOATING; } /* * tokptr now points at one token beyond * the current token stored in val and yylval, * which are the next tokens after the end of * this .stab directive. This next token must * be either a SEMI or NL, so is of width just * one. Therefore, to point to the next token * after the end of this stab, just back up one.. */ buildskip(stabstart, (char *)tokptr - sizeof(toktype)); break; /*end of the .stab*/ case ISTABDOT: stabname = ".stabd"; stpt = (struct symtab *)yylval; /* * We clobber everything after the * .stabd and its pointer... we MUST * be able to get back to this .stabd * so that we can resolve its final value */ stabstart = tokptr; shift; /*over the ISTABDOT*/ if (passno == 1){ expr(locxp, val); if (! (locxp->e_xvalue & STABTYPS)){ yyerror("Invalid type in .stabd"); goto errorfix; } stpt->s_ptype = locxp->e_xvalue; shiftover(CM); expr(locxp, val); stpt->s_other = locxp->e_xvalue; shiftover(CM); expr(locxp, val); stpt->s_desc = locxp->e_xvalue; /* * * Now, clobber everything but the * .stabd pseudo and the pointer * to its symbol table entry * tokptr points to the next token, * build the skip up to this */ buildskip(stabstart, (toktype *)tokptr - sizeof(toktype)); } /* * pass 1: Assign a good guess for its position * (ensures they are sorted into right place)/ * pass 2: Fix the actual value */ stpt->s_value = dotp->e_xvalue; stpt->s_index = dotp - usedot; stpt->s_tag = STABFLOATING; /*although it has no effect in pass 2*/ break; case ISTABNONE: stabname = ".stabn"; goto shortstab; case ISTABSTR: stabname = ".stabs"; shortstab: auxval = val; if (passno == 2) goto errorfix; stpt = (struct symtab *)yylval; stabstart = tokptr; (char *)stabstart -= sizeof(struct symtab *); (char *)stabstart -= sizeof(toktype); shift; if (auxval == ISTABSTR){ stringp = (struct strdesc *)yylval; shiftover(STRING); #ifndef FLEXNAMES auxval = stringp->str_lg > NCPS ? NCPS : stringp->str_lg; #else stringp->str[stringp->str_lg] = 0; #endif shiftover(CM); } else { stringp = &(strbuf[2]); #ifndef FLEXNAMES auxval = NCPS; #endif } #ifndef FLEXNAMES movestr(stpt->s_name, stringp->str,(( auxval); #else stpt->s_name = savestr(stringp->str); #endif goto tailstab; break; case ICOMM: /* .comm , */ case ILCOMM: /* .lcomm , */ auxval = val; shift; np = (struct symtab *)yylval; shiftover(NAME); shiftover(CM); expr(locxp, val); if (locxp->e_xtype != XABS) yyerror("comm size not absolute"); if (passno==1 && (np->s_type&XTYPE)!=XUNDEF) #ifdef FLEXNAMES yyerror("Redefinition of %s", #else not FLEXNAMES yyerror("Redefinition of %.*s", NCPS, #endif not FLEXNAMES np->s_name); if (passno==1) { np->s_value = locxp->e_xvalue; if (auxval == ICOMM) np->s_type |= XXTRN; else { np->s_type &= ~XTYPE; np->s_type |= XBSS; } } break; case IALIGN: /* .align */ stpt = (struct symtab *)yylval; shift; expr(locxp, val); jalign(locxp, stpt); break; case INST0: /* instructions w/o arguments*/ insout(yylval, (struct arg *)0, 0); shift; break; case INSTn: /* instructions with arguments*/ case IJXXX: /* UNIX style jump instructions */ auxval = val; seg_type = yylval; /* * Code to process an argument list */ ap = arglist; xp = explist; shift; /* bring in the first token for the arg list*/ for (argcnt = 1; argcnt <= 6; argcnt++, ap++){ /* * code to process an argument proper */ sawindex = sawmul = sawsize = 0; { switch(val) { default: disp: if( !(INTOKSET(val, EBEGOPS +YUKKYEXPRBEG +SAFEEXPRBEG)) ) { ERROR("expression expected"); } expr(ap->a_xp,val); overdisp: if ( val == LP || sawsize){ shiftover(LP); findreg(regno); shiftover(RP); ap->a_atype = ADISP; ap->a_areg1 = regno; } else { ap->a_atype = AEXP; ap->a_areg1 = 0; } goto index; case SIZESPEC: sizespec: sawsize = yylval; shift; goto disp; case REG: case REGOP: findreg(regno); ap->a_atype = AREG; ap->a_areg1 = regno; break; case MUL: sawmul = 1; shift; if (val == LP) goto base; if (val == LITOP) goto imm; if (val == SIZESPEC) goto sizespec; if (INTOKSET(val, EBEGOPS +YUKKYEXPRBEG +SAFEEXPRBEG)) goto disp; ERROR("expression, '(' or '$' expected"); break; case LP: base: shift; /*consume the LP*/ /* * hack the ambiguity of * movl (expr) (rn), ... * note that (expr) could also * be (rn) (by special hole in the * grammar), which we ensure * means register indirection, instead * of an expression with value n */ if (val != REG && val != REGOP){ droppedLP = 1; val = exprparse(val, &(ap->a_xp)); droppedLP = 0; goto overdisp; } findreg(regno); shiftover(RP); if (val == PLUS){ shift; ap->a_atype = AINCR; } else ap->a_atype = ABASE; ap->a_areg1 = regno; goto index; case LITOP: imm: shift; expr(locxp, val); ap->a_atype = AIMM; ap->a_areg1 = 0; ap->a_xp = locxp; goto index; case MP: shift; /* -(reg) */ findreg(regno); shiftover(RP); ap->a_atype = ADECR; ap->a_areg1 = regno; index: /*look for [reg] */ if (val == LB){ shift; findreg(regno); shiftover(RB); sawindex = 1; ap->a_areg2 = regno; } break; } /*end of the switch to process an arg*/ } /*end of processing an argument*/ if (sawmul){ /* * Make a concession for *(%r) * meaning *0(%r) */ if (ap->a_atype == ABASE) { ap->a_atype = ADISP; xp->e_xtype = XABS; xp->e_xvalue = 0; xp->e_xloc = 0; ap->a_xp = xp++; } ap->a_atype |= ASTAR; sawmul = 0; } if (sawindex){ ap->a_atype |= AINDX; sawindex = 0; } ap->a_dispsize = sawsize == 0 ? d124 : sawsize; if (val != CM) break; shiftover(CM); } /*processing all the arguments*/ if (argcnt > 6){ yyerror("More than 6 arguments"); goto errorfix; } insout(seg_type, arglist, auxval == INSTn ? argcnt : - argcnt); break; case IFLOAT: curlen = 4; goto floatlist; case IQUAD: case IDOUBLE: curlen = 8; floatlist: /* * eat a list of floating point numbers */ shift; if (val == FLTNUM){ /* KLS MOD */ float flocal; do{ if (val == CM) shift; if (val != FLTNUM) { ERROR("floating number expected"); } dotp->e_xvalue += curlen; #ifdef UNIX if (passno == 2) { if(curlen == 8) bwrite((char *)&(((union Double *)yylval)->dvalue), curlen, txtfil); else { flocal = ((union Double *)yylval)->dvalue; bwrite((char *)&flocal, curlen, txtfil); } } #endif UNIX #ifdef VMS if (passno == 2) { puchar(vms_obj_ptr,-4); pulong(vms_obj_ptr, ((struct exp *)yylval) ->doub_MSW); if (curlen==8) { puchar(vms_obj_ptr,-4); pulong(vms_obj_ptr, ((struct exp *)yylval) ->doub_LSW); } if((vms_obj_ptr-sobuf) > 400) { write(objfil,sobuf,vms_obj_ptr-sobuf); vms_obj_ptr = sobuf + 1; } } #endif VMS shift; xp = explist; } while (val == CM); } break; } /*end of the switch for looking at each reserved word*/ continue; errorfix: /* * got here by either requesting to skip to the * end of this statement, or by erroring out and * wanting to apply panic mode recovery */ while ( (val != NL) && (val != SEMI) && (val != PARSEEOF) ){ shift; } if (val == NL) lineno++; shift; } /*end of the loop to read the entire file, line by line*/ } /*end of yyparse*/ /* * Process a register declaration of the form * % * * Note: * The scanner has already processed funny registers of the form * %dd[+-]*, where dd is a decimal number in the range 00 to 15 (optional * preceding zero digit). If there was any space between the % and * the digit, the scanner wouldn't have recognized it, so we * hack it out here. */ int funnyreg(val, regnoback) /*what the read head will sit on*/ int val; /*what the read head is sitting on*/ int *regnoback; /*call by return*/ { register struct exp *locxp; struct exp *loc1xp; struct exp **ptrloc1xp = & loc1xp; expr(locxp, val); /*and leave the current read head with value*/ if ( (passno == 2) && ( locxp->e_xtype & XTYPE != XABS || locxp->e_xvalue < 0 || locxp->e_xvalue >= 16 ) ){ yyerror("Illegal register"); return(0); } *regnoback = locxp->e_xvalue; return(val); } /*VARARGS1*/ yyerror(s, a1, a2,a3,a4,a5) char *s; { #define sink stdout if (anyerrs == 0 && ! silent) fprintf(sink, "Assembler:\n"); anyerrs++; if (silent) return; fprintf(sink, "\"%s\", line %d: ", dotsname, lineno); fprintf(sink, s, a1, a2,a3,a4,a5); fprintf(sink, "\n"); } /*VARARGS1*/ yywarning(s, a1, a2,a3,a4,a5) char *s; { #define sink stdout if (anyerrs == 0 && ! silent) fprintf(sink, "Assembler:\n"); if (silent) return; fprintf(sink, "\"%s\", line %d: WARNING: ", dotsname, lineno); fprintf(sink, s, a1, a2,a3,a4,a5); fprintf(sink, "\n"); } tdout if (anyerrs == 0 && ! silent) fprintf(sink, "Assembler:\n"); anyerrs++; if (silent) return; fprintfcmd/as/ascode.c 444 0 33 22165 2431713377 6636 /* Copyright (c) 1980 Regents of the University of California */ static char sccsid[] = "@(#)ascode.c 4.7 11/5/80"; #include #include "as.h" #include "assyms.h" /* * Loader reference types (plust PCREL) to bytes and lg bytes */ /* LEN1 LEN1+PC LEN2 LEN2+PC LEN4 LEN4+PC LEN8 LEN8+PC*/ int reflen[] = /* {LEN*+PCREL} ==> number of bytes */ {0, 0, 1, 1, 2, 2, 4, 4, 8, 8}; int lgreflen[] = /* {LEN*+PCREL} ==> lg number of bytes */ {-1, -1, 0, 0, 1, 1, 2, 2, 3, 3}; /* * Sizes to Loader reference types and type flags */ /*0 1 2 3 4 5 6 7 8*/ int len124[] = /* {1,2,4,8} ==> {LEN1, LEN2, LEN4, LEN8} */ {0, LEN1, LEN2, 0, LEN4, 0, 0, 0, LEN8}; char mod124[] = /* {1,2,4,8} ==> {bits to construct operands */ {0, 0x00, 0x20, 0, 0x40, 0, 0, 0, 0}; int type_124[] = /* {1,2,4,8} ==> {TYPB, TYPW, TYPL, TYPQ} */ {0, TYPB, TYPW, 0, TYPL, 0, 0, 0, TYPQ}; /* * type flags to Loader reference and byte lengths */ /*TYPB TYPW TYPL TYPQ TYPF TYPD*/ int ty_NORELOC[] = /* {TYPB..TYPD} ==> {1 if relocation not OK */ {0, 0, 0, 1, 1, 1}; int ty_LEN[] = /* {TYPB..TYPD} ==> {LEN1..LEN8} */ {LEN1, LEN2, LEN4, LEN8, LEN4, LEN8}; int ty_nbyte[] = /* {TYPB..TYPD} ==> {1,2,4,8} */ {1, 2, 4, 8, 4, 8}; int ty_nlg[] = /* {TYPB..TYPD} ==> lg{1,2,4,8} */ {0, 1, 2, 3, 2, 3}; insout(op, ap, nact) struct arg *ap; { int jxxflg; register struct instab *ip; /* the instruction */ register struct arg *ap_walk; /* actual param walk */ register int i; register int ap_type; /* actual param type */ register int ap_type_mask; /* masked actual param */ op &= 0xFF; jxxflg = nact; if (nact < 0) nact = -nact; if (passno == 1) { ip = itab[op]; if (nact < ip->i_nargs) yyerror("Too few arguments"); if (nact > ip->i_nargs) { yyerror("Too many arguments"); nact = ip->i_nargs; } /* * Check argument compatability with instruction template */ for (ap_walk = ap, i = 1; i <= nact; ap_walk++, i++){ ap_type = ap_walk->a_atype; ap_type_mask = ap_type & AMASK; /* * The switch value is >> by 3 so that the switch * code is dense, not implemented as a sequence * of branches but implemented as a casel. * In addition, cases ACCI and ACCR are added to force * dense switch code. */ switch( ((fetcharg(ip, i-1)) & ACCESSMASK)>>3){ /* type of fp */ case ACCI >> 3: case ACCR >> 3: break; case ACCB >> 3: if ( !((ap_type_mask == AEXP) || (ap_type_mask == AIMM)) ){ yyerror("arg %d, branch displacement must be an expression",i); return; } break; case A((CCA >> 3: switch(ap_type_mask){ case AREG: yyerror("arg %d, addressing a register",i); return; case AIMM: if ( !(ap_type & ASTAR) ){ yyerror("arg %d, addressing an immediate operand",i); return; } } break; case ACCM >> 3: case ACCW >> 3: switch(ap_type_mask){ case AIMM: if (!(ap_type&ASTAR)) { yyerror("arg %d, modifying a constant",i); return; } } break; } /* end of the switch on fp_type */ if (ap_type & AINDX) { if (ap_walk->a_areg2==0xF) { yyerror("arg %d, PC used as index",i); return; } switch(ap_type_mask){ case AREG: yyerror("arg %d, indexing the register file",i); return; case AIMM: yyerror("arg %d, indexing a constant",i); return; case ADECR: case AINCR: if (ap_walk->a_areg1==ap_walk->a_areg2) { yyerror("arg %d, indexing with modified register",i); return; } break; } /* end of switch on ap_type_mask */ } /* end of AINDX */ } } /* both passes here */ if (jxxflg < 0) ijxout(op, ap, nact); else putins(op, ap, nact); } extern int d124; putins(op, ap, n) /* * n had better be positive */ register struct arg *ap; { register struct exp *xp; register int argtype; int i; int reloc_how; #ifdef DEBUG fflush(stdout); #endif if (passno == 2) goto PASS2; dotp->e_xvalue += n+1; /* 1 for the opcode, at least 1 per arg */ for (i=0; ia_atype; if (argtype & AINDX) dotp->e_xvalue++; /* * This switch has been fixed by enumerating the no action * alternatives (those that have 1 one byte of code) * so that a casel instruction is emitted. */ switch (argtype&~(AINDX|ASTAR)) { case AREG: case ABASE: case ADECR: case AINCR: break; case AEXP: argtype = fetcharg(itab[op], i); if (argtype == ACCB+TYPB) break; if (argtype==ACCB+TYPW){ dotp->e_xvalue++; break; } /* * Reduces to PC relative */ dotp->e_xvalue += ap->a_dispsize; break; case ADISP: xp=ap->a_xp; if ((xp->e_xtype&XTYPE)!=XABS || xp->e_xtype&XFORW){ dotp->e_xvalue += ap->a_dispsize; break; } if (xp->e_xvalue==0 && !(argtype&ASTAR)) break; dotp->e_xvalue++; if ((xp->e_xvaluee_xvalue>MAXBYTE)) dotp->e_xvalue++; if ((xp->e_xvaluee_xvalue>MAXWORD)) dotp->e_xvalue += 2; break; case AIMM: if (ap->a_atype&ASTAR) argtype=TYPL; else { argtype = fetcharg(itab[op], i); if (argtype&ACCA) argtype = TYPL; else argtype &= TYPMASK; xp = ap->a_xp; if ( ((xp->e_xtype&XTYPE)==XABS) && (!(xp->e_xtype&XFORW)) && (xp->e_xvalue>=0) && (xp->e_xvalue<=63) && (xp->e_yvalue == 0) && (argtype != TYPD) && (argtype != TYPF) ) break; } switch (argtype) { case TYPD: case TYPF: if ( !(((xp->e_xtype&XTYPE)==XABS) && (!(xp->e_xtype&XFORW)) && (slitflt(xp))) ){ /* it is NOT short */ dotp->e_xvalue += ((argtype==TYPF)? 4 : 8); } break; case TYPQ: dotp->e_xvalue += 8;break; case TYPL: dotp->e_xvalue += 4;break; case TYPW: dotp->e_xvalue += 2;break; case TYPB: dotp->e_xvalue += 1;break; } /*end of the switch on argtype*/ } /*end of the switch on the type*/ } /*end of looping for all arguments*/ return; PASS2: #ifdef UNIX outb(op); /* the opcode */ #endif UNIX #ifdef VMS *vms_obj_ptr++ = -1; *vms_obj_ptr++ = (char)op; dotp->e_xvalue += 1; #endif VMS for (i=0; ia_atype; xp=ap->a_xp; reloc_how = TYPNONE; if (argtype&AINDX) { #ifdef UNIX { outb(0x40 | ap->a_areg2); } #endif UNIX #ifdef VMS { *vms_obj_ptr++ = -1; *vms_obj_ptr++ = (0x40 | ap->a_areg2); dotp->e_xvalue += 1; } #endif VMS argtype &= ~AINDX; } if (argtype&ASTAR) { ap->a_areg1 |= 0x10; argtype &= ~ASTAR; } switch (argtype) { case AREG: /* %r */ ap->a_areg1 |= 0x50; break; case ABASE: /* (%r) */ ap->a_areg1 |= 0x60; break; case ADECR: /* -(%r) */ ap->a_areg1 |= 0x70; break; case AINCR: /* (%r)+ */ ap->a_areg1 |= 0x80; break; case AEXP: /* expr */ argtype = fetcharg(itab[op], i); if (argtype == ACCB+TYPB) { ap->a_areg1 = argtype = xp->e_xvalue - (dotp->e_xvalue + 1); if (argtypeMAXBYTE) yyerror("Branch too far"); break; } if (argtype == ACCB+TYPW) { ap->a_areg1 = argtype = xp->e_xvalue -= dotp->e_xvalue + 2; xp->e_xtype = XABS; if (argtypeMAXWORD) yyerror("Branch too far"); xp->e_xvalue = argtype>>8; reloc_how = TYPB; break; } /* reduces to expr(pc) mode */ ap->a_areg1 |= (0xAF + mod124[ap->a_dispsize]); reloc_how = type_124[ap->a_dispsize] + RELOC_PCREL; break; case ADISP: /* expr(%r) */ ap->a_areg1 |= 0xA0; if ((xp->e_xtype&XTYPE)!=XABS || xp->e_xtype&XFORW){ ap->a_areg1 += mod124[ap->a_dispsize]; reloc_how = type_124[ap->a_dispsize]; break; } if (xp->e_xvalue==0 && !(ap->a_areg1&0x10)) { ap->a_areg1 ^= 0xC0; break; } reloc_how = TYPB; if ((xp->e_xvaluee_xvalue>MAXBYTE)){ ap->a_areg1 += 0x20; reloc_how = TYPW; } if ((xp->e_xvaluee_xvalue>MAXWORD)){ ap->a_areg1 += 0x20; reloc_how = TYPL; } break; case AIMM: /* $expr */ if (ap->a_atype&ASTAR) argtype=TYPL; else { argtype = fetcharg(itab[op], i); if (argtype&ACCA) argtype=TYPL; else argtype &= TYPMASK; if ( ( (xp->e_xtype&XTYPE) == XABS) && !(xp->e_xtype&XFORW) && (xp->e_xvalue >= 0) && (xp->e_xvalue <= 63) && (xp->e_yvalue == 0) && (argtype != TYPF) && (argtype != TYPD) ) { ap->a_areg1 = xp->e_xvalue; break; } } ap->a_areg1 |= 0x8F; reloc_how = argtype; if (reloc_how == TYPD || reloc_how == TYPF){ if ( ((xp->e_xtype&XTYPE)==XABS) && (!(xp->e_xtype&XFORW)) && (slitflt(xp)) ){ reloc_how = TYPNONE; ap->a_areg1=extlitflt(xp); } } break; } /*end of the switch on argtype*/ /* * use the first byte to describe the argument */ #ifdef UNIX outb(ap->a_areg1); #endif UNIX #ifdef VMS *vms_obj_ptr++ = -1; *vms_obj_ptr++ = (char)(ap->a_areg1); dotp->e_xvalue += 1; if ((vms_obj_ptr-sobuf) > 400) { write(objfil,sobuf,vms_obj_ptr-sobuf); vms_obj_ptr=sobuf+1; } #endif VMS if (reloc_how != TYPNONE) outrel(xp, reloc_how); } /*end of the for to pick up all arguments*/ } ap->a_areg1=extlitflt(xp); } } break; } /*end of the switch on argtype*/ /* * use the first byte to describe the argument */ #ifdef UNIX outb(ap->a_areg1); #endif UNIX #ifdef VMS *vms_obj_ptr++ = -1; *vms_obj_ptr++ = (char)(ap->a_areg1); dotp->e_xvalue += 1; if ((vms_obj_ptr-sobuf) > 400) { write(objfil,sobuf,vms_obj_ptr-sobuf); vms_obj_ptr=sobuf+1; cmd/as/aspseudo.c 444 0 33 4654 2431567757 7217 /* Copyright (c) 1980 Regents of the University of California */ static char sccsid[] = "@(#)aspseudo.c 4.3 8/16/80"; #include #include "as.h" #define OP(name, opcode, nargs, arg1, arg2, arg3, arg4, arg5, arg6) \ { \ name, opcode, nargs, arg1, arg2, arg3, arg4, arg5, arg6, \ (nargs == 0 ? INST0:INSTn) \ } #define PSEUDO(name, type, tag) \ { \ name, type, 0, 0, 0, 0, 0, 0, 0, \ tag \ } readonly struct Instab instab[] = { PSEUDO(".space", 0, ISPACE), PSEUDO(".fill", 0, IFILL), PSEUDO(".byte", 0, IBYTE), PSEUDO(".word", 0, IWORD), PSEUDO(".long", 0, ILONG), PSEUDO(".int", 0, IINT), PSEUDO(".quad", 0, IQUAD), PSEUDO(".data", 0, IDATA), PSEUDO(".globl", 0, IGLOBAL), PSEUDO(".set", 0, ISET), PSEUDO(".text", 0, ITEXT), PSEUDO(".comm", 0, ICOMM), PSEUDO(".lcomm", 0, ILCOMM), PSEUDO(".lsym", 0, ILSYM), PSEUDO(".align", 0, IALIGN), PSEUDO(".float", 0, IFLOAT), PSEUDO(".double", 0, IDOUBLE), PSEUDO(".org", 0, IORG), PSEUDO(".stab", 0, ISTAB), PSEUDO(".stabs", 0, ISTABSTR), PSEUDO(".stabn", 0, ISTABNONE), PSEUDO(".stabd", 0, ISTABDOT), PSEUDO(".ascii", 0, IASCII), PSEUDO(".asciz", 0, IASCIZ), PSEUDO(".file", 0, IFILE), PSEUDO(".line", 0, ILINENO), PSEUDO(".ABORT", 0, IABORT), PSEUDO("r0", 0, REG), PSEUDO("r1", 1, REG), PSEUDO("r2", 2, REG), PSEUDO("r3", 3, REG), PSEUDO("r4", 4, REG), PSEUDO("r5", 5, REG), PSEUDO("r6", 6, REG), PSEUDO("r7", 7, REG), PSEUDO("r8", 8, REG), PSEUDO("r9", 9, REG), PSEUDO("r10", 10, REG), PSEUDO("r11", 11, REG), PSEUDO("r12", 12, REG), PSEUDO("r13", 13, REG), PSEUDO("r14", 14, REG), PSEUDO("r15", 15, REG), PSEUDO("ap", 12, REG), PSEUDO("fp", 13, REG), PSEUDO("sp", 14, REG), PSEUDO("pc", 15, REG), PSEUDO("jcc", 0x1e, IJXXX), PSEUDO("jcs", 0x1f, IJXXX), PSEUDO("jeql", 0x13, IJXXX), PSEUDO("jeqlu", 0x13, IJXXX), PSEUDO("jgeq", 0x18, IJXXX), PSEUDO("jgequ", 0x1e, IJXXX), PSEUDO("jgtr", 0x14, IJXXX), PSEUDO("jgtru", 0x1a, IJXXX), PSEUDO("jleq", 0x15, IJXXX), PSEUDO("jlequ", 0x1b, IJXXX), PSEUDO("jlss", 0x19, IJXXX), PSEUDO("jlssu", 0x1f, IJXXX), PSEUDO("jneq", 0x12, IJXXX), PSEUDO("jnequ", 0x12, IJXXX), PSEUDO("jvc", 0x1c, IJXXX), PSEUDO("jvs", 0x1d, IJXXX), PSEUDO("jbr", 0x11, IJXXX), PSEUDO("jbc", 0xe1, IJXXX), PSEUDO("jbs", 0xe0, IJXXX), PSEUDO("jbcc", 0xe5, IJXXX), PSEUDO("jbsc", 0xe4, IJXXX), PSEUDO("jbcs", 0xe3, IJXXX), PSEUDO("jbss", 0xe2, IJXXX), PSEUDO("jlbc", 0xe9, IJXXX), PSEUDO("jlbs", 0xe8, IJXXX), #include "instrs" 0 }; IJXXX), PSEUDO("jlequ", 0x1b, IJXXX), PSEUDO("jlss", 0x19, IJXXX), PSEUDO("jlssu"((cmd/as/asscan.c 444 0 33 71022 2431567765 6654 /* Copyright (c) 1980 Regents of the University of California */ static char sccsid[] = "@(#)asscan.c 4.6 9/8/80"; #include #include "as.h" #include "asscan.h" /* * NOTE: * This version of the assembler does not use fread and fwrite * for the token buffering. The token buffers are integrals of BUFSIZ * at all times, so we use direct read and write. fread and fwrite * as supplied from BTL in stdio are HORRENDOUSLY inefficient, * as they use putchar for each character, nested two deep in loops. */ #define writeTEST(pointer, size, nelements, ioptr) \ write(ioptr->_file, pointer, nelements * size) != nelements * size #define readTEST(pointer, size, nelements, ioptr) \ read(ioptr->_file, pointer, nelements * size) != nelements * size /* * Variables to manage the token buffering. * We scan (lexically analyze) a large number of tokens, and * then parse all of the tokens in the scan buffer. * This reduces procedure call overhead when the parser * demands a token, allows for an efficient reread during * the second pass, and confuses the line number reporting * for errors encountered in the scanner and in the parser. */ #define TOKDALLOP 8 struct tokbufdesc *bufstart; /*where the buffer list begins*/ struct tokbufdesc *buftail; /*last one on the list*/ struct tokbufdesc *emptybuf; /*the one being filled*/ /* * If we are using VM, during the second pass we reclaim the used * token buffers for saving the relocation information */ struct tokbufdesc *tok_free; /* free pool */ struct tokbufdesc *tok_temp; /* temporary for doing list manipulation */ /* * Other token buffer managers */ int bufno; /*which buffer number: 0,1 for tmp file*/ struct tokbufdesc tokbuf[2]; /*our initial increment of buffers*/ ptrall tokptr; /*where the current token comes from*/ ptrall tokub; /*the last token in the current token buffer*/ /* * Variables to manage the string buffering * declared in asscan.h. */ int strno; /*the current string being filled*/ struct strdesc strbuf[3]; /*the string buffers; the first for nulls*/ struct strdesc *strptr; /*current string buffer being filled*/ inittmpfile() { if (passno == 1){ if (useVM){ bufstart = &tokbuf[0]; buftail = &tokbuf[1]; bufstart->tok_next = buftail; buftail->tok_next = 0; } tokbuf[0].tok_count = -1; tokbuf[1].tok_count = -1; } tok_temp = 0; tok_free = 0; bufno = 0; emptybuf = &tokbuf[bufno]; tokptr = 0; tokub = 0; } closetmpfile() { if (passno == 1){ if (useVM){ emptybuf->toks[emptybuf->tok_count++] = PARSEEOF; } else { /* * Clean up the buffers that haven't been * written out yet */ if (tokbuf[bufno ^ 1].tok_count >= 0){ if (writeTEST((char *)&tokbuf[bufno ^ 1], sizeof *emptybuf, 1, tmpfil)){ badwrite: yyerror("Unexpected end of file writing the interpass tmp file"); exit(2); } } /* * Ensure that we will read an End of file, * if there are more than one file names * in the argument list */ tokbuf[bufno].toks[tokbuf[bufno].tok_count++] = PARSEEOF; if (writeTEST((char *)&tokbuf[bufno], sizeof *emptybuf, 1, tmpfil)) goto badwrite; } } /*end of being pass 1*/ } #define bstrlg(from, length) \ *(lgtype *)from = length; \ (char *)from += sizeof(lgtype) + length #define bstrfromto(from,to) \ *(lgtype *)from = (char *)to - (char *)from - sizeof(lgtype); \ (char *)from += sizeof(lgtype) + (char *)to - (char *)from #define eatstrlg(from) \ (char *)from += sizeof(lgtype) + *(lgtype *)from #define bskiplg(from, length) \ *(lgtype *)from = length; \ (char *)from += sizeof(lgtype) + length #define bskipfromto(from, to) \ *(lgtype *)from = (toktype *)to - (toktype *)from - sizeof(lgtype); \ (char *)from += sizeof (lgtype) + (toktype *)to - (toktype *)from #define eatskiplg(from) \ (toktype *)from += sizeof(lgtype) + *(lgtype *)from #ifdef DEBUG ptrall firsttoken; #endif DEBUG extern int yylval; /*global communication with parser*/ static int Lastjxxx; /*this ONLY shuts up cc; see below*/ toktype yylex() { register ptrall bufptr; register toktype val; register struct exp *locxp; bufptr = tokptr; /*copy in the global value*/ top: if (bufptr < tokub){ gtoken(val, bufptr); switch(yylval = val){ case PARSEEOF : yylval = val = PARSEEOF; break; case BFINT: case INT: if (xp >= &explist[NEXP]) yyerror("Too many expressions; try simplyfing"); else locxp = xp++; glong(locxp->e_xvalue, bufptr); locxp->e_yvalue = 0; makevalue: locxp->e_xtype = XABS; locxp->e_xloc = 0; locxp->e_xname = NULL; yylval = (int)locxp; break; case FLTNUM: if (xp >= &explist[NEXP]) yyerror("Too many expressions; try simplyfing"); else locxp = xp++; gdouble( ( (union Double *)locxp)->dvalue, bufptr); goto makevalue; case QUAD: if (xp >= &explist[NEXP]) yyerror("Too many expressions; try simplyfing"); else locxp = xp++; glong(locxp->e_xvalue, bufptr); glong(locxp->e_yvalue, bufptr); yylval = val = INT; goto makevalue; case NAME: gptr(yylval, bufptr); lastnam = (struct symtab *)yylval; break; case SIZESPEC: case REG: case INSTn: case INST0: gchar(yylval, bufptr); break; case IJXXX: gchar(yylval, bufptr); /* We can't cast Lastjxxx into (int *) here.. */ gptr(Lastjxxx, bufptr); lastjxxx = (struct symtab *)Lastjxxx; break; case ILINESKIP: gint(yylval, bufptr); lineno += yylval; goto top; case SKIP: eatskiplg(bufptr); goto top; case VOID: goto top; case STRING: strptr = &strbuf[strno ^= 1]; strptr->str_lg = *((lgtype *)bufptr); movestr(&strptr->str[0], (char *)bufptr + sizeof(lgtype), strptr->str_lg); eatstrlg(bufptr); yylval = (int)strptr; break; case ISTAB: case ISTABSTR: case ISTABNONE: case ISTABDOT: case IALIGN: gptr(yylval, bufptr); break; } #ifdef DEBUG if (toktrace){ char *tok_to_name(); printf("P: %d T#: %4d, %s ", passno, bufptr - firsttoken, tok_to_name(val)); switch(val){ case INT: printf("val %d", ((struct exp *)yylval)->e_xvalue); break; case BFINT: printf("val %d", ((struct exp *)yylval)->e_xvalue); break; case QUAD: printf("val[msd] = 0x%x, val[lsd] = 0x%x.", ((struct exp *)yylval)->e_xvalue, ((struct exp *)yylval)->e_yvalue); break; case FLTNUM: printf("value %20.17f", ((union Double *)yylval)->dvalue); break; case NAME: printf("\"%.8s\"", ((struct symtab *)yylval)->s_name); break; case REG: printf(" r%d", yylval); break; case IJXXX: case INST0: case INSTn: printf("%.8s", itab[0xFF &yylval]->s_name); break; case STRING: printf("length %d ", ((struct strdesc *)yylval)->str_lg); printf("value\"%s\"", ((struct strdesc *)yylval)->str); break; } /*end of the debug switch*/ printf("\n"); } #endif DEBUG } else { /* start a new buffer */ if (useVM){ if (passno == 2){ tok_temp = emptybuf->tok_next; emptybuf->tok_next = tok_free; tok_free = emptybuf; emptybuf = tok_temp; } else { emptybuf = emptybuf->tok_next; } bufno += 1; if (emptybuf == 0){ struct tokbufdesc *newdallop; int i; if (passno == 2) goto badread; emptybuf = newdallop = (struct tokbufdesc *) Calloc(TOKDALLOP, sizeof (struct tokbufdesc)); for (i=0; i < TOKDALLOP; i++){ buftail->tok_next = newdallop; buftail = newdallop; newdallop += 1; } buftail->tok_next = 0; } /*end of need to get more buffers*/ (toktype *)bufptr = &(emptybuf->toks[0]); if (passno == 1) scan_dot_s(emptybuf); } else { /*don't use VM*/ bufno ^= 1; emptybuf = &tokbuf[bufno]; ((toktype *)bufptr) = &(emptybuf->toks[0]); if (passno == 1){ /* * First check if there are things to write * out at all */ if (emptybuf->tok_count >= 0){ if (writeTEST((char *)emptybuf, sizeof *emptybuf, 1, tmpfil)){ badwrite: yyerror("Unexpected end of file writing the interpass tmp file"); exit(2); } } scan_dot_s(emptybuf); } else { /*pass 2*/ if (readTEST((char *)emptybuf, sizeof *emptybuf, 1, tmpfil)){ badread: yyerror("Unexpected end of file while reading the interpass tmp file"); exit(1); } } } /*end of using a real live file*/ (char *)tokub = (char *)bufptr + emptybuf->tok_count; #ifdef DEBUG firsttoken = bufptr; if (debug) printf("created buffernumber %d with %d tokens\n", bufno, emptybuf->tok_count); #endif DEBUG goto top; } /*end of reading/creating a new buffer*/ tokptr = bufptr; /*copy back the global value*/ return(val); } /*end of yylex*/ buildskip(from, to) register ptrall from, to; { int diff; register int frombufno; register struct tokbufdesc *middlebuf; /* * check if from and to are in the same buffer * from and to DIFFER BY AT MOST 1 buffer and to is * always ahead of from, with to being in the buffer emptybuf * points to. * The hard part here is accounting for the case where the * skip is to cross a buffer boundary; we must construct * two skips. * * Figure out where the buffer boundary between from and to is * It's easy in VM, as buffers increase to high memory, but * w/o VM, we alternate between two buffers, and want * to look at the exact middle of the contiguous buffer region. */ middlebuf = useVM ? emptybuf : &tokbuf[1]; if ( ( (toktype *)from > (toktype *)middlebuf) ^ ( (toktype *)to > (toktype *)middlebuf) ){ /*split across a buffer boundary*/ ptoken(from, SKIP); /* * S((et the skip so it lands someplace beyond * the end of this buffer. * When we pull this skip out in the second pass, * we will temporarily move the current pointer * out beyond the end of the buffer, but immediately * do a compare and fail the compare, and then reset * all the pointers correctly to point into the next buffer. */ bskiplg(from, TOKBUFLG + 1); /* * Now, force from to be in the same buffer as to */ (toktype *)from = (toktype *)&(emptybuf->toks[0]); } /* * Now, to and from are in the same buffer */ if (from > to) yyerror("Internal error: bad skip construction"); else { if ( (diff = (toktype *)to - (toktype *)from) >= (sizeof(toktype) + sizeof(lgtype) + 1)) { ptoken(from, SKIP); bskipfromto(from, to); } else { for ( ; diff > 0; --diff) ptoken(from, VOID); } } } movestr(to, from, lg) register char *to, *from; register int lg; { if (lg <= 0) return; do *to++ = *from++; while (--lg); } static int newfflag = 0; static char *newfname; int scanlineno; /*the scanner's linenumber*/ new_dot_s(namep) char *namep; { newfflag = 1; newfname = namep; dotsname = namep; lineno = 1; scanlineno = 1; } /* * Maps characters to their use in assembly language */ #define EOFCHAR (-1) #define NEEDCHAR (-2) readonly short type[] = { NEEDSBUF, /*fill up the input buffer*/ SCANEOF, /*hit the hard end of file*/ SP, BADCHAR,BADCHAR,BADCHAR,BADCHAR,BADCHAR,BADCHAR,BADCHAR, /*\0..^G*/ BADCHAR,SP, NL, BADCHAR,BADCHAR,SP, BADCHAR,BADCHAR, /*BS..SI*/ BADCHAR,BADCHAR,BADCHAR,BADCHAR,BADCHAR,BADCHAR,BADCHAR,BADCHAR, /*DLE..ETB*/ BADCHAR,BADCHAR,BADCHAR,BADCHAR,BADCHAR,BADCHAR,BADCHAR,BADCHAR, /*CAN..US*/ SP, ORNOT, DQ, SH, LITOP, REGOP, AND, SQ, /*sp .. '*/ LP, RP, MUL, PLUS, CM, MINUS, ALPH, DIV, /*( .. /*/ DIG, DIG, DIG, DIG, DIG, DIG, DIG, DIG, /*0 .. 7*/ DIG, DIG, COLON, SEMI, LSH, BADCHAR,RSH, BADCHAR, /*8 .. ?*/ BADCHAR,ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH,/*@ .. G*/ ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH,/*H .. BADCHAR*/ ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH,/*P .. V*/ ALPH, ALPH, ALPH, LB, BADCHAR,RB, XOR, ALPH,/*W .. _*/ SIZEQUOTE,ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH,/*` .. g*/ ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH,/*h .. o*/ ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH, ALPH,/*p .. v*/ ALPH, ALPH, ALPH, BADCHAR,IOR, BADCHAR,TILDE, BADCHAR,/*x .. del*/ }; /* * The table of possible uses for each character to test set inclusion. * Different than the above table, which knows about tokens yylex * is to return. */ #define HEXFLAG 01 /* 'x' or 'X' */ #define HEXLDIGIT 02 /* 'a' .. 'f' */ #define HEXUDIGIT 04 /* 'A' .. 'F' */ #define ALPHA 010 /* 'A' .. 'Z', 'a' .. 'z', '_'*/ #define DIGIT 020 /* '0' .. '9' */ #define FLOATEXP 040 /* 'd' 'e' 'D' 'E' */ #define SIGN 0100 /* '+' .. '-'*/ #define REGDIGIT 0200 /* '0' .. '5' */ #define SZSPECBEGIN 0400 /* 'b', 'B', 'l', 'L', 'w', 'W' */ #define POINT 01000 /* '.' */ #define SPACE 02000 /* '\t' or ' ' */ #define BSESCAPE 04000 /* bnrtf */ #define STRESCAPE 010000 /* '"', '\\', '\n' */ #define OCTDIGIT 020000 /* '0' .. '7' */ #define FLOATFLAG 040000 /* 'd', 'D', 'f', 'F' */ /*after leading 0*/ readonly short charsets[] = { 0, 0, 0, 0, 0, 0, 0, 0, /*\0..^G*/ 0, SPACE, STRESCAPE,0, 0, 0, 0, 0, /*BS..SI*/ 0, 0, 0, 0, 0, 0, 0, 0, /*DLE..ETB*/ 0, 0, 0, 0, 0, 0, 0, 0, /*CAN..US*/ /* dollar is an alpha character */ SPACE, 0, STRESCAPE,0, ALPHA, 0, 0, 0, /*sp.. '*/ 0, 0, 0, SIGN, 0, SIGN, POINT+ALPHA,0, /*( .. /*/ DIGIT+REGDIGIT+OCTDIGIT, DIGIT+REGDIGIT+OCTDIGIT, /*0..1*/ DIGIT+REGDIGIT+OCTDIGIT, DIGIT+REGDIGIT+OCTDIGIT, /*2..3*/ DIGIT+REGDIGIT+OCTDIGIT, DIGIT+REGDIGIT+OCTDIGIT, /*4..5*/ DIGIT+OCTDIGIT, DIGIT+OCTDIGIT, /*6..7*/ DIGIT, DIGIT, 0, 0, 0, 0, 0, 0, /*8..?*/ 0, /*@*/ ALPHA+HEXUDIGIT,ALPHA+HEXUDIGIT+SZSPECBEGIN, /*A..B*/ ALPHA+HEXUDIGIT,ALPHA+HEXUDIGIT+FLOATEXP+FLOATFLAG, /*C..D*/ ALPHA+HEXUDIGIT+FLOATEXP,ALPHA+HEXUDIGIT+FLOATFLAG, /*E..F*/ ALPHA, /*G*/ ALPHA, ALPHA, ALPHA, ALPHA, /*H..K*/ ALPHA+SZSPECBEGIN, ALPHA, ALPHA, ALPHA, /*L..O*/ ALPHA, ALPHA, ALPHA, ALPHA, /*P..S*/ ALPHA, ALPHA, ALPHA, ALPHA+SZSPECBEGIN, /*T..W*/ ALPHA+HEXFLAG, ALPHA, ALPHA, 0,STRESCAPE,0, 0, ALPHA,/*X.._*/ 0, ALPHA+HEXLDIGIT,ALPHA+HEXLDIGIT+BSESCAPE+SZSPECBEGIN, /*a..b*/ ALPHA+HEXLDIGIT,ALPHA+HEXLDIGIT+FLOATEXP+FLOATFLAG, /*c..d*/ ALPHA+HEXLDIGIT+FLOATEXP,ALPHA+HEXLDIGIT+BSESCAPE+FLOATFLAG, /*e..f*/ ALPHA, /*g*/ ALPHA, ALPHA, ALPHA, ALPHA, /*h..k*/ ALPHA+SZSPECBEGIN, ALPHA, ALPHA+BSESCAPE, ALPHA, /*l..o*/ ALPHA, ALPHA, ALPHA+BSESCAPE, ALPHA, /*p..s*/ ALPHA+BSESCAPE, ALPHA, ALPHA, ALPHA+SZSPECBEGIN,/*t..w*/ ALPHA+HEXFLAG, ALPHA, ALPHA, 0,0, 0, 0, 0, /*x..del*/ 0}; #define INCHARSET(val, kind) (charsets[val] & (kind) ) static toktype oval = NL; #define NINBUFFERS 2 #define INBUFLG NINBUFFERS*BUFSIZ + 2 /* * We have two input buffers; the first one is reserved * for catching the tail of a line split across a buffer * boundary; the other one are used for snarfing a buffer * worth of .s source. */ static char inbuffer[INBUFLG]; static char *InBufPtr = 0; #ifdef getchar #undef getchar #endif #define getchar() *inbufptr++ #ifdef ungetc #undef ungetc #endif #define ungetc(char) *--inbufptr = char /* * fill the inbuffer from the standard input. * Assert: there are always n COMPLETE! lines in the buffer area. * Assert: there is always a \n terminating the last line * in the buffer area. * Assert: after the \n, there is an EOFCHAR (hard end of file) * or a NEEDCHAR (end of buffer) * Assert: fgets always null pads the string it reads. * Assert: no ungetc's are done at the end of a line or at the * beginning of a line. * * We read a complete buffer of characters in one single read. * We then back scan within this buffer to find the end of the * last complete line, and force the assertions, and save a pointer * to the incomplete line. * The next call to fillinbuffer will move the unread characters * to the end of the first buffer, and then read another two buffers, * completing the cycle. */ static char p_swapped = '\0'; static char *p_start = &inbuffer[NINBUFFERS * BUFSIZ]; static char *p_stop = &inbuffer[NINBUFFERS * BUFSIZ]; char *fillinbuffer() { register char *to; register char *from; char *inbufptr; int nread; *p_start = p_swapped; inbufptr = &inbuffer[1*BUFSIZ] - (p_stop - p_start); for (to = inbufptr, from = p_start; from < p_stop;) *to++ = *from++; /* * Now, go read two full buffers (hopefully) */ nread = read(stdin->_file, &inbuffer[1*BUFSIZ], (NINBUFFERS - 1)*BUFSIZ); if (nread == 0) return(0); p_stop = from = &inbuffer[1*BUFSIZ + nread]; *from = '\0'; while (*--from != '\n') /* back over the partial line */ continue; from++; /* first char of partial line */ p_start = from; p_swapped = *p_start; *p_start = NEEDCHAR; /* force assertion */ return(inbufptr); } scan_dot_s(bufferbox) struct tokbufdesc *bufferbox; { register int yylval;/*lexical value*/ register toktype val; /*the value returned; the character read*/ register int base; /*the base of the number also counter*/ register char *cp; register char *inbufptr; register struct symtab *op; register unsigned char tag; int forb; register ptrall bufptr; /*where to stuff tokens*/ ptrall lgbackpatch; /*where to stuff a string length*/ ptrall bufub; /*where not to stuff tokens*/ register int maxstrlg; /*how long a string can be*/ long intval; /*value of int*/ char fltchr[64]; /*buffer for floating values*/ union Double fltval; /*floating value returned*/ struct Quad quadval; /*quad returned from immediate constant */ int linescrossed; /*when doing strings and comments*/ (toktype *)bufptr = (toktype *) & (bufferbox->toks[0]); (toktype *)bufub = &(bufferbox->toks[AVAILTOKS]); inbufptr = InBufPtr; if (inbufptr == 0){ inbufptr = fillinbuffer(); if (inbufptr == 0){ /*end of file*/ endoffile: inbufptr = 0; ptoken(bufptr, PARSEEOF); goto done; } } if (newfflag){ ptoken(bufptr, IFILE); ptoken(bufptr, STRING); val = strlen(newfname) + 1; movestr( (char *)&( ( (lgtype *)bufptr)[1]), newfname, val); bstrlg(bufptr, val); ptoken(bufptr, ILINENO); ptoken(bufptr, INT); pint(bufptr, 1); newfflag = 0; } while (bufptr < bufub){ loop: switch(yylval = (type+2)[val = getchar()]) { case SCANEOF: inbufptr = 0; goto endoffile; case NEEDSBUF: inbufptr = fillinbuffer(); if (inbufptr == 0) goto endoffile; goto loop; case DIV: /*process C style comments*/ if ( (val = getchar()) == '*') { /*comment prelude*/ int incomment; linescrossed = 0; incomment = 1; val = getchar(); /*skip over the * */ do{ while ( (val != '*') && (val != '\n') && (val != EOFCHAR) && (val != NEEDCHAR)) val = getchar(); if (val == '\n'){ scanlineno++; linescrossed++; } else if (val == EOFCHAR) goto endoffile; if (val == NEEDCHAR){ inbufptr = fillinbuffer(); if (inbufptr == 0) goto endoffile; lineno++; incomment = 1; val = getchar(); /*pull in the new char*/ } else { /*its a star */ val = getchar(); incomment = val != '/'; } } while (incomment); val = ILINESKIP; yylval = linescrossed; goto ret; } else { /*just an ordinary DIV*/ ungetc(val); val = yylval = DIV; goto ret; } case SH: if (oval == NL){ /* * Attempt to recognize a C preprocessor * style comment '^#[ \t]*[0-9]*[ \t]*".*" */ val = getchar(); /*bump the #*/ while (INCHARSET(val, SPACE)) val = getchar();/*bump white */ if (INCHARSET(val, DIGIT)){ intval = 0; while(INCHARSET(val, DIGIT)){ intval = intval *10 + val - '0'; val = getchar(); } while (INCHARSET(val, SPACE)) val = getchar(); if (val == '"'){ ptoken(bufptr, ILINENO); ptoken(bufptr, INT); pint(bufptr, intval - 1); ptoken(bufptr, IFILE); /* *(( The '"' has already been * munched * * eatstr will not eat * the trailing \n, so * it is given to the parser * and counted. */ goto eatstr; } } } /* * Well, its just an ordinary decadent comment */ while ((val != '\n') && (val != EOFCHAR)) val = getchar(); if (val == EOFCHAR) goto endoffile; val = yylval = oval = NL; scanlineno++; goto ret; case NL: scanlineno++; val = yylval; goto ret; case SP: oval = SP; /*invalidate ^# meta comments*/ goto loop; case REGOP: /* % , could be used as modulo, or register*/ val = getchar(); if (INCHARSET(val, DIGIT)){ yylval = val-'0'; if (val=='1') { if (INCHARSET( (val = getchar()), REGDIGIT)) yylval = 10+val-'0'; else ungetc(val); } /* * God only knows what the original author * wanted this undocumented feature to * do. * %5++ is really r7 */ while(INCHARSET( (val = getchar()), SIGN)) { if (val=='+') yylval++; else yylval--; } ungetc(val); val = REG; } else { ungetc(val); val = REGOP; } goto ret; case ALPH: yylval = val; if (INCHARSET(val, SZSPECBEGIN)){ if( (val = getchar()) == '`' || val == '^'){ yylval |= 0100; /*convert to lower*/ if (yylval == 'b') yylval = 1; else if (yylval == 'w') yylval = 2; else if (yylval == 'l') yylval = 4; else yylval = d124; val = SIZESPEC; goto ret; } else { ungetc(val); val = yylval; /*restore first character*/ } } cp = yytext; do { if (cp < &yytext[NCPS]) *cp++ = val; } while (INCHARSET ( (val = getchar()), ALPHA | DIGIT)); *cp = '\0'; while (INCHARSET(val, SPACE)) val = getchar(); ungetc(val); doit: tag = (op = *lookup(1))->s_tag; if (tag && tag != LABELID){ yylval = ( (struct instab *)op)->i_opcode; val = op->s_tag ; goto ret; } else { /* * Its a name... (Labels are subsets ofname) */ yylval = (int)op; val = NAME; goto ret; } case DIG: base = 10; cp = fltchr; intval = 0; if (val=='0') { val = getchar(); if (val == 'b') { yylval = -1; val = BFINT; goto ret; } if (val == 'f') { /* * Well, it appears to be a local label * reference, but check to see if * the next character makes it a floating * point constant. */ forb = getchar(); ungetc(forb); if (!(INCHARSET(forb,(DIGIT|SIGN|FLOATEXP|POINT)))){ yylval = 1; val = BFINT; goto ret; } } if (INCHARSET(val, HEXFLAG)){ base = 16; } else if (INCHARSET(val, FLOATFLAG)){ double atof(); while ( (cp < &fltchr[63]) && INCHARSET( (val=getchar()), (DIGIT|SIGN|FLOATEXP|POINT) ) ) *cp++ = val; if (cp == fltchr) { yylval = 1; val = BFINT; goto ret; } ungetc(val); *cp++ = '\0'; fltval.dvalue = atof(fltchr); val = FLTNUM; goto ret; } else { ungetc(val); base = 8; } } else { forb = getchar(); if (forb == 'f' || forb == 'b') { yylval = val - '0' + 1; if (forb == 'b') yylval = -yylval; val = BFINT; goto ret; } ungetc(forb); /* put back non zero */ goto middle; } while ( (val = getchar()) == '0') continue; ungetc(val); while ( INCHARSET( (val = getchar()), DIGIT) || (base==16 && (INCHARSET(val, HEXLDIGIT|HEXUDIGIT) ) ) ){ if (base==8) intval <<= 3; else if (base==10) intval *= 10; else { intval <<= 4; if (INCHARSET(val, HEXLDIGIT)) val -= 'a' - 10 - '0'; else if (INCHARSET(val, HEXUDIGIT)) val -= 'A' - 10 - '0'; } middle: *cp++ = (val -= '0'); intval += val; } ungetc(val); *cp = 0; maxstrlg = cp - fltchr; if ( (maxstrlg > 8) && ( ( (base == 8) && ( (maxstrlg>11) || ( (maxstrlg == 11) && (*fltchr > 3) ) ) ) || ( (base == 16) && (maxstrlg > 8) ) || ( (base == 10) && (maxstrlg >= 10) ) ) ) { val = QUAD; get_quad(base, fltchr, cp, &quadval); } else val = INT; goto ret; case LSH: case RSH: /* * We allow the C style operators * << and >>, as well as < and > */ if ( (base = getchar()) != val) ungetc(base); val = yylval; goto ret; case MINUS: if ( (val = getchar()) =='(') yylval=val=MP; else { ungetc(val); val=MINUS; } goto ret; case SQ: if ((yylval = getchar()) == '\n') scanlineno++; /*not entirely correct*/ intval = yylval; val = INT; goto ret; case DQ: eatstr: linescrossed = 0; maxstrlg = (char *)bufub - (char *)bufptr; if (maxstrlg < MAXSTRLG) { ungetc('"'); *(toktype *)bufptr = VOID ; bufub = bufptr; goto done; } if (maxstrlg > MAXSTRLG) maxstrlg = MAXSTRLG; ptoken(bufptr, STRING); lgbackpatch = bufptr; /*this is where the size goes*/ bufptr += sizeof(lgtype); /* * bufptr is now set to * be stuffed with characters from * the input */ while ( (maxstrlg > 0) && !(INCHARSET( (val = getchar()), STRESCAPE)) ){ stuff: maxstrlg-= 1; pchar(bufptr, val); } if (maxstrlg <= 0){ /*enough characters to fill a string buffer*/ ungetc('"'); /*will read it next*/ } else if (val == '"'); /*done*/ else if (val == '\n'){ yywarning("New line embedded in a string constant."); scanlineno++; linescrossed++; val = getchar(); if (val == EOFCHAR){ do_eof: pchar(bufptr, '\n'); ungetc(EOFCHAR); } else if (val == NEEDCHAR){ if ( (inbufptr = fillinbuffer()) == 0) goto do_eof; val = '\n'; goto stuff; } else { /* simple case */ ungetc(val); val = '\n'; goto stuff; } } else { val = getchar(); /*skip the '\\'*/ if ( INCHARSET(val, BSESCAPE)){ switch (val){ case 'b': val = '\b'; goto stuff; case 'f': val = '\f'; goto stuff; case 'n': val = '\n'; goto stuff; case 'r': val = '\r'; goto stuff; case 't': val = '\t'; goto stuff; } } if ( !(INCHARSET(val,OCTDIGIT)) ) goto stuff; base = 0; intval = 0; while ( (base < 3) && (INCHARSET(val, OCTDIGIT))){ base++;intval <<= 3;intval += val - '0'; val = getchar(); } ungetc(val); val = (char)intval; goto stuff; } /* * bufptr now points at the next free slot */ bstrfromto(lgbackpatch, bufptr); if (linescrossed){ val = ILINESKIP; yylval = linescrossed; goto ret; } else goto builtval; case BADCHAR: linescrossed = lineno; lineno = scanlineno; yyerror("Illegal character mapped: %d, char read:(octal) %o", yylval, val); lineno = linescrossed; val = BADCHAR; goto ret; default: val = yylval; goto ret; } /*end of the switch*/ /* * here with one token, so stuff it */ ret: oval = val; ptoken(bufptr, val); switch(val){ case ILINESKIP: pint(bufptr, yylval); break; case SIZESPEC: pchar(bufptr, yylval); break; case BFINT: plong(bufptr, yylval); break; case INT: plong(bufptr, intval); break; case QUAD: plong(bufptr, quadval.quad_low_long); plong(bufptr, quadval.quad_high_long); break; case FLTNUM: pdouble(bufptr, fltval.dvalue); break; case NAME: pptr(bufptr, (int)(struct symtab *)yylval); break; case REG: pchar(bufptr, yylval); break; case INST0: case INSTn: pchar(bufptr, yylval); break; case IJXXX: pchar(bufptr, yylval); pptr(bufptr, (int)(struct symtab *)symalloc()); break; case ISTAB: case ISTABSTR: case ISTABNONE: case ISTABDOT: case IALIGN: pptr(bufptr, (int)(struct symtab *)symalloc()); break; /* * default: */ } builtval: ; } /*end of the while to stuff the buffer*/ done: bufferbox->tok_count = (toktype *)bufptr - &(bufferbox->toks[0]); /* * This is a real kludge: * * We put the last token in the buffer to be a MINUS * symbol. This last token will never be picked up * in the normal way, but can be looked at during * a peekahead look that the short circuit expression * evaluator uses to see if an expression is complicated. * * Consider the following situation: * * .word 45 + 47 * buffer 1 | buffer 0 * the peekahead would want to look across the buffer, * but will look in the buffer end zone, see the minus, and * fail. */ ptoken(bufptr, MINUS); InBufPtr = inbufptr; /*copy this back*/ } struct Quad _quadtemp; get_quad(radix, cp_start, cp_end, quadptr) int radix; char *cp_start, *cp_end; struct Quad *quadptr; { register char *cp = cp_start; /* r11 */ register struct Quad *qp = quadptr; /* r10 */ register long temp; /* r9 */ asm("clrq (r10)"); for (; cp < cp_end; cp++){ switch (radix) { case 8: asm ("ashq $3, (r10), (r10)"); break; case 16: asm ("ashq $4, (r10), (r10)"); break; case 10: asm ("ashq $1, (r10), __quadtemp"); asm ("ashq $3, (r10), (r10)"); asm ("addl2 __quadtemp, (r10)"); asm ("adwc __quadtemp+4, 4(r10)"); break; } asm ("cvtbl (r11), r9"); asm ("addl2 r9, (r10)"); asm ("adwc $0, 4(r10)"); } } ct Quad *qp = quadptr; /* r10 */ register long temp; /* r9 */ asm("clrq (r10)"); for (; cp < cp_end; cp++){ switch (radix) { case 8: asm ("ashq $3, (r10), (r10)"); break; case 16: asm ("ashq $4, (r10), (r10)"); break; case 10: asm ("ashq $1, (r10), __quadtemp"); asm ("ashq $3, (r10), (r10)"); asm ("addl2 __quadtemp, (r10)"); asm ("adwc __quadtemp+4, 4(r10)"); break; } asm ("cvtbl (r11), r9"); asm ("addl2 r9, (r10)"); asm ("adwc $cmd/as/asscan.h 444 0 33 7520 2431567767 6645 ((/* Copyright (c) 1980 Regents of the University of California */ /* "@(#)asscan.h 4.3 8/15/80" */ /* * The character scanner is called to fill up one token buffer * * However, once the tokens are filled up by the * character scanner, they are used in both the first and the second * pass. Holes created by .stab removal are replaced * with 'skip' tokens that direct the second pass to ignore the * following tokens. */ #define TOKBUFLG BUFSIZ #define MAXVAX 32 #define SAFETY 16 #define AVAILTOKS TOKBUFLG -\ sizeof(int) -\ sizeof (struct tokbufdesc *) -\ MAXVAX - SAFETY struct tokbufdesc{ int tok_count; /*absolute byte length*/ struct tokbufdesc *tok_next; char toks[AVAILTOKS]; char bufovf[MAXVAX + SAFETY]; }; /* * Definitions for handling tokens in the intermediate file * buffers. * * We want to have the compiler produce the efficient auto increment * instruction for stepping through the buffer of tokens. We must * fool the type checker into thinking that a pointer can point * to various size things. */ typedef char toktype; typedef char *ptrall; /*all uses will be type cast*/ typedef short lgtype; /*for storing length of strings or skiping*/ /* * defintions for putting various typed values * into the intermediate buffers * ptr will ALWAYS be of type ptrall */ #define pchar(ptr,val) *ptr++ = val #define puchar(ptr,val) *ptr++ = val #define pshort(ptr,val) *(short *)ptr=val, ptr += sizeof(short) #define pushort(ptr,val) *(unsigned short *)ptr=val, ptr += sizeof(short) #define pint(ptr,val) *(int *)ptr = val, ptr += sizeof(int) #define puint(ptr,val) *(unsigned int *)ptr=val, ptr += sizeof(int) #define plong(ptr,val) *(long *)ptr = val, ptr += sizeof(long) #define pulong(ptr,val) *(unsigned long *)ptr=val, ptr += sizeof(long) #define pfloat(ptr,val) *(float *)ptr = val, ptr += sizeof (float) #define pdouble(ptr,val) *(double *)ptr = val, ptr += sizeof (double) #define pptr(ptr,val) *(int *)ptr = (val), ptr += sizeof(ptrall) #define ptoken(ptr,val) *ptr++ = val #define pstrlg(ptr,val) *(lgtype *)ptr = val, ptr += sizeof(short) #define pskiplg(ptr,val) *(lgtype *)ptr = val, ptr += sizeof(short) #define gchar(val, ptr) val = *ptr++ #define guchar(val, ptr) val = *ptr++ #define gshort(val, ptr) val = *(short *)ptr , ptr += sizeof (short) #define gushort(val, ptr) val = *(unsigned short *)ptr , ptr += sizeof (short) #define gint(val, ptr) val = *(int *)ptr, ptr += sizeof (int) #define guint(val, ptr) val = *(unsigend int *)ptr, ptr += sizeof (int) #define glong(val, ptr) val = *(long *)ptr, ptr += sizeof (long) #define gulong(val, ptr) val = *(unsigned long *)ptr, ptr += sizeof (long) #define gfloat(val, ptr) val = *(float *)ptr, ptr += sizeof (float) #define gdouble(val, ptr) val = *(double *)ptr, ptr += sizeof (double) #define gptr(val, ptr) val = *(int *)ptr, ptr += sizeof (ptrall) #define gtoken(val, ptr) val = *ptr++ #define gstrlg(val, ptr) val = *(lgtype *)ptr, ptr += sizeof (short) #define gskiplg(val, ptr) val = *(lgtype *)ptr, ptr += sizeof (short) extern ptrall tokptr; /*the next token to consume, call by copy*/ extern ptrall tokub; /*current upper bound in the current buffer*/ /* * Strings are known for their characters and for their length. * We cannot use a normal zero termination byte, because strings * can contain anything. * * We have two "strings", so that an input string that is too long can be * split across two string buffers, and not confuse the yacc grammar. * (This is probably superflous) * * We have a third string of nulls so that the .skip can be * handled in the same way as strings. */ #define MAXSTRLG 127 struct strdesc{ char str_lg; char str[MAXSTRLG]; }; extern struct strdesc strbuf[3]; extern struct strdesc *strptr; /*points to the current string*/ extern int strno; /*the current string being filled*/ char *savestr(); so that an input string that is too long can be * split across two string buffers, and not confuse the yacc grammar. * (This is probably superflous) * * We have a third strcmd/as/as.h 444 0 33 33034 2431711154 5774 /* Copyright (c) 1980 Regents of the University of California */ /* "@(#)as.h 4.8 11/5/80" */ #ifdef VMS # define vax 1 # define VAX 1 #endif VMS #include #ifdef UNIX #ifdef FLEXNAMES # include # include #else not FLEXNAMES # define ONLIST # include "a.out.h" # include #endif FLEXNAMES #endif UNIX #ifdef VMS #ifdef UNIXDEVEL # include #else not UNIXDEVEL # include #endif not UNIXDEVEL #endif VMS #define readonly #define NINST 300 #define NEXP 20 /* max number of expr. terms per instruction */ #define NARG 6 /* max number of args per instruction */ #define NHASH 1103 /* hash table is dynamically extended */ #define TNAMESIZE 32 /* maximum length of temporary file names */ #define NLOC 4 /* number of location ctrs */ #ifdef UNIX # ifndef FLEXNAMES # ifndef NCPS # define NCPS 8 /* number of characters per symbol*/ # endif # else # ifdef NCPS # undef NCPS # endif # define NCPS BUFSIZ /* needed to allocate yytext */ # endif # endif UNIX # ifdef VMS # ifdef NCPS # undef NCPS # endif NCPS # define NCPS 15 # endif VMS /* * Symbol types */ #define XUNDEF 0x0 #define XABS 0x2 #define XTEXT 0x4 #define XDATA 0x6 #define XBSS 0x8 #define XXTRN 0x1 #define XTYPE 0x1E #define XFORW 0x20 /* Was forward-referenced when undefined */ #define ERR (-1) #define NBPW 32 /* Bits per word */ #define AMASK 017 /* * Actual argument syntax types */ #define AREG 1 /* %r */ #define ABASE 2 /* (%r) */ #define ADECR 3 /* -(%r) */ #define AINCR 4 /* (%r)+ */ #define ADISP 5 /* expr(%r) */ #define AEXP 6 /* expr */ #define AIMM 7 /* $ expr */ #define ASTAR 8 /* * */ #define AINDX 16 /* [%r] */ /* * Argument access types used to test validity of operands to operators */ #define ACCR (1<<3) /* read */ #define ACCW (2<<3) /* write */ #define ACCB (4<<3) /* branch displacement */ #define ACCA (8<<3) /* address only */ #define ACCM (ACCR | ACCW) /* modify */ #define ACCI (ACCB | ACCR) /* XFC code */ #define ACCESSMASK (ACCA | ACCR | ACCW | ACCB) /* the mask */ /* * Argument data types * Also used to tell outrel what it is relocating * (possibly in combination with RELOC_PCREL and TYPNONE) */ #define TYPB 0 /* byte */ #define TYPW 1 /* word */ #define TYPL 2 /* long */ #define TYPQ 3 /* quad */ #define TYPF 4 /* floating */ #define TYPD 5 /* double floating */ #define TYPNONE 6 /* when nothing */ #define RELOC_PCREL 8 /* implicit argument to outrel; ==> PCREL */ #define TYPMASK 7 /* * reference types for loader */ #define PCREL 1 #define LEN1 2 #define LEN2 4 #define LEN4 6 #define LEN8 8 extern int reflen[]; /* {LEN*+PCREL} ==> number of bytes */ extern int lgreflen[]; /* {LEN*+PCREL} ==> lg number of bytes */ extern int len124[]; /* {1,2,4,8} ==> {LEN1, LEN2, LEN4, LEN8} */ extern char mod124[]; /* {1,2,4,8} ==> {bits to construct operands */ extern int type_124[]; /* {1,2,4,8} ==> {TYPB, TYPW, TYPL, TYPQ} */ extern int ty_NORELOC[]; /* {TYPB..TYPD} ==> {1 if relocation not OK */ extern int ty_LEN[]; /* {TYPB..TYPD} ==> {LEN1..LEN8} */ extern int ty_nbyte[]; /* {TYPB..TYPD} ==> {1,2,4,8} */ extern int ty_nlg[]; /* {TYPB..TYPD} ==> lg{1,2,4,8} */ #define TMPC 7 #define HW 01 #define FW 03 #define DW 07 #ifdef UNIX # include #endif UNIX #ifdef VMS # define PAGRND 0x1FFL #endif VMS #define round(x,y) (((x)+(y)) & ~(y)) #define STABTYPS 0340 #define STABFLAG 0200 /* * Follows are the definitions for the symbol table tags, which are * all unsigned characters.. * High value tags are generated by the asembler for internal * use. * Low valued tags are the parser coded tokens the scanner returns. * There are several pertinant bounds in this ordering: * a) Symbols greater than JXQUESTIONABLE * are used by the jxxx bumper, indicating that * the symbol table entry is a jxxx entry * that has yet to be bumped. * b) Symbols greater than IGNOREBOUND are not * bequeathed to the loader; they are truly * for assembler internal use only. * c) Symbols greater than OKTOBUMP represent * indices into the program text that should * be changed in preceeding jumps or aligns * must get turned into their long form. */ #define TAGMASK 0xFF # define JXACTIVE 0xFF /*jxxx size unknown*/ # define JXNOTYET 0xFE /*jxxx size known, but not yet expanded*/ # define JXALIGN 0xFD /*align jxxx entry*/ # define JXINACTIVE 0xFC /*jxxx size known and expanded*/ #define JXQUESTIONABLE 0xFB # define JXTUNNEL 0xFA /*jxxx that jumps to another*/ # define OBSOLETE 0xF9 /*erroneously entered symbol*/ #define IGNOREBOUND 0xF8 /*symbols greater than this are ignored*/ # define STABFLOATING 0xF7 # define LABELID 0xF6 #define OKTOBUMP 0xF5 # define STABFIXED 0xF4 /* * astoks.h contains reserved word codings the parser should * know about */ #include "astoks.h" /* * The structure for one symbol table entry. * Symbol table entries are used for both user defined symbols, * and symbol slots generated to create the jxxx jump from * slots. * Caution: the instructions are stored in a shorter version * of the struct symtab, using all fields in sym_nm and * tag. The fields used in sym_nm are carefully redeclared * in struct Instab and struct instab (see below). * If struct nlist gets changed, then Instab and instab may * have to be changed. */ struct symtab{ struct nlist s_nm; u_char s_tag; /* assembler tag */ u_char s_ptype; /* if tag == NAME */ u_char s_jxoveralign; /* if a JXXX, jumped over align */ short s_index; /* which segment */ struct symtab *s_dest; /* if JXXX, where going to */ #ifdef DJX((XX short s_jxline; /* source line of the jump from */ #endif }; /* * Redefinitions of the fields in symtab for * use when the symbol table entry marks a jxxx instruction. */ #define s_jxbump s_ptype /* tag == JX..., how far to expand */ #define s_jxfear s_desc /* how far needs to be bumped */ /* * Redefinitions of fields in the struct nlist for symbols so that * one saves typing, and so that they conform * with the old naming conventions. */ #ifdef FLEXNAMES #define s_name s_nm.n_un.n_name /* name pointer */ #define s_nmx s_nm.n_un.n_strx /* string table index */ #else not FLEXNAMES #define s_name s_nm.n_name #endif #define s_type s_nm.n_type /* type of the symbol */ #define s_other s_nm.n_other /* other information for sdb */ #define s_desc s_nm.n_desc /* type descriptor */ #define s_value s_nm.n_value /* value of the symbol, or sdb delta */ struct instab{ struct nlist s_nm; /* instruction name, type (opcode) */ u_char s_tag; char s_pad[3]; /* round to 20 bytes */ }; /* * The fields nm.n_desc and nm.n_value total 6 bytes; this is * just enough for the 6 bytes describing the argument types. * We use a macro to define access to these 6 bytes, assuming that * they are allocated adjacently. * IF THE FORMAT OF STRUCT nlist CHANGES, THESE MAY HAVE TO BE CHANGED. * * Instab is cleverly declared to look very much like the combination of * a struct symtab and a struct nlist. */ struct Instab{ #ifdef FLEXNAMES char *I_name; #else not FLEXNAMES char I_name[NCPS]; #endif u_char I_opcode; char I_nargs; char I_args[6]; u_char I_s_tag; char I_pad[3]; /* round to 20 bytes */ }; /* * Redefinitions of fields in the struct nlist for instructions so that * one saves typing, and conforms to the old naming conventions */ #define i_opcode s_nm.n_type /* use the same field as symtab.type */ #define i_nargs s_nm.n_other /* number of arguments */ #define fetcharg(ptr, n) ((struct Instab *)ptr)->I_args[n] struct arg { /*one argument to an instruction*/ char a_atype; char a_areg1; char a_areg2; char a_dispsize; /*usually d124, unless have B^, etc*/ struct exp *a_xp; }; struct exp { long e_xvalue; /* MUST be the first field (look at union Double) */ long e_yvalue; /* MUST be second field; least sig word of a double */ char e_xtype; char e_xloc; struct symtab *e_xname; }; #define doub_MSW e_xvalue #define doub_LSW e_yvalue union Double { struct{ long doub_MSW; long doub_LSW; } dis_dvalue; double dvalue; }; struct Quad { long quad_low_long; long quad_high_long; }; /* * Magic layout macros */ #define MINBYTE -128 #define MAXBYTE 127 #define MINWORD -32768 #define MAXWORD 32767 #define LITFLTMASK 0x000043F0 /*really magic*/ /* * Is the floating point double word in xp a * short literal floating point number? */ #define slitflt(xp) \ ( (xp->doub_LSW == 0) \ && ( (xp->doub_MSW & LITFLTMASK) \ == xp->doub_MSW) ) /* * If it is a slitflt, then extract the 6 interesting bits */ #define extlitflt(xp) \ xp->doub_MSW >> 4 extern struct arg arglist[NARG]; /*building operands in instructions*/ extern struct exp explist[NEXP]; /*building up a list of expressions*/ extern struct exp *xp; /*current free expression*/ /* * Communication between the scanner and the jxxx handlers. * lastnam: the last name seen on the input * lastjxxx: pointer to the last symbol table entry for * a jump from */ extern struct symtab *lastnam; extern struct symtab *lastjxxx; #ifdef VMS extern char *vms_obj_ptr; /* object buffer pointer */ extern char sobuf[]; /* object buffer */ extern int objfil; /* VMS object file descriptor */ #endif VMS /* * Lgensym is used to make up funny names for local labels. * lgensym[i] is the current funny number to put after * references to if, lgensym[i]-1 is for ib. * genref[i] is set when the label is referenced before * it is defined (i.e. 2f) so that we can be sure these * labels are always defined to avoid weird diagnostics * from the loader later. */ extern int lgensym[10]; extern char genref[10]; extern char tmpn1[TNAMESIZE]; /* Interpass temporary */ extern struct exp *dotp; /* the current dot location */ extern int loctr; extern struct exec hdr; /* a.out header */ extern u_long tsize; /* total text size */ extern u_long dsize; /* total data size */ extern u_long trsize; /* total text relocation size */ extern u_long drsize; /* total data relocation size */ extern u_long datbase; /* base of the data segment */ /* * Bitoff and bitfield keep track of the packing into * bytes mandated by the expression syntax ':' */ extern int bitoff; extern long bitfield; /* * The lexical analyzer builds up symbols in yytext. Lookup * expects its argument in this buffer */ extern char yytext[NCPS+2]; /* text buffer for lexical */ /* * Variables to manage the input assembler source file */ extern int lineno; /*the line number*/ extern char *dotsname; /*the name of the as source*/ extern FILE *tmpfil; /* interpass communication*/ extern int passno; /* 1 or 2 */ extern int anyerrs; /*errors assembling arguments*/ extern int silent; /*don't mention the errors*/ extern int savelabels; /*save labels in a.out*/ extern int orgwarn; /* questionable origin ? */ extern int useVM; /*use virtual memory temp file*/ extern int jxxxJUMP; /*use jmp instead of brw for jxxx */ extern int readonlydata; /*initialized data into text space*/ #ifdef DEBUG extern int debug; extern int toktrace; #endif /* * Information about the instructions */ extern struct instab *itab[NINST]; /*maps opcodes to instructions*/ extern readonly struct Instab instab[]; extern int curlen; /*current literal storage size*/ extern int d124; /*current pointer storage size*/ struct symtab **lookup(); /*argument in yytext*/ struct symtab *symalloc(); #define outb(val) {dotp->e_xvalue++; if (passno==2) bputc((val), (txtfil));} #define outs(cp, lg) dotp->e_xvalue += (lg); if (passno == 2) bwrite((cp), (lg), (txtfil)) /* * Most of the time, the argument to flushfield is a power of two constant, * the calculations involving it can be optimized to shifts. */ #define flushfield(n) if (bitoff != 0) Flushfield( ( (bitoff+n-1) /n ) * n) /* * The biobuf structure and associated routines are used to write * into one file at several places concurrently. Calling bopen * with a biobuf structure sets it up to write ``biofd'' starting * at the specified offset. You can then use ``bwrite'' and/or ``bputc'' * to stuff characters in the stream, much like ``fwrite'' and ``fputc''. * Calling bflush drains all the buffers and MUST be done before exit. */ struct biobuf { short b_nleft; /* Number free spaces left in b_buf */ /* Initialize to be less than BUFSIZ initially, to boundary align in file */ char *b_ptr; /* Next place to stuff characters */ char b_buf[BUFSIZ]; /* The buffer itself */ off_t b_off; /* Current file offset */ struct biobuf *b_link; /* Link in chain for bflush() */ }; #define bputc(c,b) ((b)->b_nleft ? (--(b)->b_nleft, *(b)->b_ptr++ = (c)) \ : bflushc(b, c)) #define BFILE struct biobuf extern BFILE *biobufs; /* head of the block I/O buffer chain */ extern int biofd; /* file descriptor for block I/O file */ extern off_t boffset; /* physical position in logical file */ /* * For each of the named .text .data segments * (introduced by .text ), we maintain * the current value of the dot, and the BFILE where * the information for each of the segments is placed * during the second pass. */ extern struct exp usedot[NLOC + NLOC]; extern BFILE *usefile[NLOC + NLOC]; extern BFILE *txtfil;/* file for text and data: into usefile */ /* * Relocation information for each segment is accumulated * seperately from the others. Writing the relocation * information is logically viewed as writing to one * relocation saving file for each segment; physically * we have a bunch of buffers allocated internally that * contain the relocation information. */ struct relbufdesc *rusefile[NLOC + NLOC]; struct relbufdesc *relfil; OC]; extern BFILE *usefile[NLOC + NLOC]; extern BFILE *txtfil;/* file for text and data: into usefile */ /* * Relocation information for each segment is accumulated * seperately from the others. Writing the relocation * information is logically viewed as writing to one * relocation saving file for each segment; physically * we have a bunch of buffers allocated internally that * contain the relocation information. */ struct relbufdesc *rusefile[NLOC + NLOC]; cmd/as/assyms.h 444 0 33 6471 2431567772 6714 /* Copyright (c) 1980 Regents of the University of California */ /* "@(#)assyms.h 4.2 8/15/80" */ /* * To speed up walks through symbols defined in a particular * segment, we buil up a table of pointers into the symbol table * and a table of delimiters for each segment. The delimiter for * the particular segment points to the first word in that segment. */ extern struct symtab **symptrs; /*dynamically allocated*/ extern struct symtab **symdelim[NLOC + NLOC + 1]; extern struct symtab **symptrub; extern int nsyms; /*number in the symbol table*/ extern int njxxx; /*the number of jxxx entries in the table*/ extern int nforgotten; /*how many entries erroneously entered*/ extern int nlabels; /*how many labels in the symbol table*/ extern int hshused; /*how many hash slots used*/ #define SEGITERATE(segno, start, end, copointer, walkpointer, ubpointer, direction) \ for(copointer = start == 0? symdelim[segno]:start,\ ubpointer = end == 0 ? *symdelim[segno+1] : *(symdelim[segno]-1),\ walkpoin((ter = *copointer;\ walkpointer != ubpointer;\ walkpointer = * direction copointer) #define SYMITERATE(copointer, walkpointer) \ for(copointer = symptrs, \ walkpointer = *copointer; \ copointer < symptrub; \ walkpointer = * ++ copointer) /* * Symbols are allocated in non contiguous chunks by extending * the data area. This way, it is extremely easy to * allow virtual memory temporary files, change the length * of NCPS, and allows for a much more flexible storage * allocation */ #define SYMDALLOP 200 struct allocbox{ struct allocbox *nextalloc; struct symtab symslots[SYMDALLOP]; }; #ifdef FLEXNAMES /* * Names are allocated in a string pool. String pools are linked * together and are allocated dynamically by Calloc. */ #define STRPOOLDALLOP NCPS struct strpool{ struct strpool *str_next; int str_nalloc; char str_names[STRPOOLDALLOP]; }; extern struct strpool *strplhead; #endif extern struct allocbox *allochead; extern struct allocbox *alloctail; extern struct symtab *nextsym; extern struct allocbox *newbox; extern char *namebuffer; extern int symsleft; #define ALLOCQTY sizeof (struct allocbox) /* * Iterate through all symbols in the symbol table in declaration * order */ #define DECLITERATE(allocwalk, walkpointer, ubpointer) \ for(allocwalk = allochead; \ allocwalk != 0; \ allocwalk = allocwalk->nextalloc) \ for (walkpointer = &allocwalk->symslots[0],\ ubpointer = &allocwalk->symslots[SYMDALLOP], \ ubpointer = ubpointer > ( (struct symtab *)alloctail) \ ? nextsym : ubpointer ;\ walkpointer < ubpointer; \ walkpointer++ ) /* * The hash table is segmented, and dynamically extendable. * We have a linked list of hash table segments; within each * segment we use a quadratic rehash that touches no more than 1/2 * of the buckets in the hash table when probing. * If the probe does not find the desired symbol, it moves to the * next segment, or allocates a new segment. * * Hash table segments are kept on the linked list with the first * segment always first (that contains the reserved words) and * the last added segment immediately after the first segment * to hopefully gain something by locality of reference. */ struct hashdallop { int h_nused; struct hashdallop *h_next; struct symtab *h_htab[NHASH]; }; * of the buckets in the hash table when probing. * If the probe does not find the desired symbol, it moves to the * next segment, or allocates a new segment. * * Hash table segments are kept on tcmd/as/astoks.h 444 0 33 5050 2431567774 6673 /* Copyright (c) 1980 Regents of the University of California */ /* "@(#)astoks.h 4.2 8/16/80" */ /* * Message to the wary: The order of tokens has been * hand optimized and assigned to that all switch statements * are implemented by a casel instruction on the VAX. * there are 4 switch statements that have to be worried about: * l) Per character switch in the character scanner (scan_dot_s) * 2) Per token switch in the buffer manager (yylex) * 3) Per keyword switch in the parser (yyparse) * 4) Leading token switch for argments to opcodes * * You can't just add new tokens willy-nilly; make sure that you * add them into the proper order! */ # define FIRSTTOKEN 0 /* * Tokens between ISPACE and INSTn are used by the per keyword switch */ # define ISPACE 1 # define IBYTE 2 # define IWORD 3 # define IINT 4 # define ILONG 5 # define IDATA 6 # define IGLOBAL 7 # define ISET 8 # define ITEXT 9 # define ICOMM 10 # define ILCOMM 11 # define IFLOAT 12 # define IDOUBLE 13 # define IORG 14 # define IASCII 15 # define IASCIZ 16 # define ILSYM 17 # define IFILE 18 # define ILINENO 19 # define IABORT 20 # define IFILL 21 # define IQUAD 22 /* * Tokens between ISTAB and REG are used in the per token switch */ # define ISTAB 23 # define ISTABSTR 24 # define ISTABNONE 25 # define ISTABDOT 26 # define IJXXX 27 # define IALIGN 28 # define INST0 29 # define INSTn 30 # define BFINT 31 # define PARSEEOF 32 # define ILINESKIP 33 # define VOID 34 # define SKIP 35 # define INT 36 # define FLTNUM 37 # define NAME 38 # define STRING 39 # define QUAD 40 /* * Tokens between SIZESPEC and REGOP are used in the instruction * argument switch */ # define SIZESPEC 41 # define REG 42 # define MUL 43 # define LITOP 44 # define LP 45 # define MP 46 /* * Tokens between REGOP and DIV are used in the per character switch */ # define NEEDSBUF 48 /*signal refilling the input buffer*/ # define REGOP 49 /*the percent sign*/ # define NL 50 # define SCANEOF 51 # define BADCHAR 52 # define SP 53 # define ALPH 54 # define DIG 55 # define SQ 56 # define DQ 57 # define SH 58 # define LSH 59 # define RSH 60 # define MINUS 61 # define SIZEQUOTE 62 /* * Tokens between XOR and RP are used at random (primarily by the * expression analyzer), and not used in any switch */ # define XOR 64 # define DIV 65 # define SEMI 66 # define COLON 67 # define PLUS 68 # define IOR 69 # define AND 70 # define TILDE 71 # define ORNOT 72 # define CM 73 # define LB 74 # define RB 75 # define RP 76 # define LASTTOKEN 80 efine DIG 55 # define SQ 56 # define DQ 57 # define SH 58 # define LSH 59 # define RSH 60 # define MINUS 61 # define SIZEQUOTE 62 /* * Tokens between XOR and RP are used at random (primarily by the * expression analyzer), and not used in any switch */ # define XOR 64 # define DIV 65 # define SEMI 66 # define COLON 67 # define PLUS 68 # define IOR 69 # define AND 70 # define TILDE 71 # define ORNOT 72 # define CM 73 # define LB 74 # define RB 75cmd/lisp/ 775 0 33 0 2553440026 5462 cmd/lisp/franz/ 775 0 12 0 2574150752 6606 cmd/lisp/franz/h/ 775 0 12 0 2552742774 7044 cmd/lisp/franz/h/catchfram.h 644 0 12 1024 2552725342 11215 /* sccs id @(#)catchfram.h 35.1 5/6/81 */ struct catchfr { /* catch and errset frame */ struct catchfr *link; /* link to next catchframe */ lispval flag; /* Do we print ? */ lispval labl; /* label caught at this point */ struct nament *svbnp; /* saved bnp */ lispval retenv[11]; /* reset environment - actually a savblock */ lispval rs[4]; /* regis 6-11 and 13 */ lispval (*retadr)(); /* address to continue execution */ }; struct savblock { lispval envir[10]; struct savblock *savlnk; }; hfram.h 35.1 5/6/81 */ struct catchfr { /* catch and errset frame */ struct catchfr *link; /* link to next catchframe */ lispval flag; /* Do we print ? */ lispval labl; /* label caught at this point */ struct nament *svbnp; /* saved bnp */ lispval retenv[11]; /* reset environment - actually a savblock */ lispval rs[4]; /* regis 6-11 and 13 */ lispval (*retadr)(); /* address to continue execution */ }; struct savblock { lispval envir[10]; struct scmd/lisp/franz/h/chars.h 644 0 12 1654 2552725342 10376 /* sccs id @(#)chars.h 35.1 5/6/81 */ /* lexical table for input and output ***********************************/ /* the format of the entries are: ab..xxxx */ /* */ /* where a is set iff the atom containing the symbol must be quoted */ /* where b is set iff the character separates atoms normally */ /* where xxxx is a number unique to the class of symbol */ #define VNUM 0000 #define VMINUS 0001 #define VSIGN 0001 #define VCHAR 0002 #define VSCA 0102 #define VLPARA 0303 #define VRPAR((A 0304 #define VPERD 0205 #define VLBRCK 0306 #define VRBRCK 0307 #define VEOF 0310 #define VSQ 0311 #define VDQ 0212 #define VSD 0211 #define VERR 0313 #define VSEP 0314 #define VSPL 0315 #define VMAC 0316 #define VESC 0217 #define VQUO 0326 #define QUTMASK 0200 #define SEPMASK 0100 #define TSCA 1 #define TLPARA 2 #define TRPARA 3 #define TPERD 4 #define TEOF 5 #define TSPL 6 #define TMAC 7 #define TSQ 8 #define TLBKT 9 VSIGN 0001 #define VCHAR 0002 #define VSCA 0102 #define VLPARA 0303 #define VRPARcmd/lisp/franz/h/chkrtab.h 644 0 12 337 2552725343 10672 /* sccs id @(#)chkrtab.h 35.2 6/17/81 */ #define chkrtab(p); \ if(p!=lastrtab){ if(TYPE(p)!=ARRAY && TYPE(p->ar.data)!=INT) rtaberr();\ else {lastrtab=p;ctable=(unsigned char*)p->ar.data;}} extern lispval lastrtab; 7 #define VQUO 0326 #define QUTMASK 0200 #define SEPMASK 0100 #define TSCA 1 #define TLPARA 2 #define TRPARA 3 #define TPERD 4 #define TEOF 5 #define TSPL 6 #define TMAC 7 #define TSQ 8 #define /P4,P45x< /h,l"cmd/lisp/franz/h/dfuncs.h 644 0 12 1764 2552725343 10563 /* sccs id @(#)dfuncs.h 35.1 5/6/81 */ char *brk(); char *getsp(); char *inewstr(); char *mkmsg(); char *newstr(); char *rstore(); char *sbrk(); char *xsbrk(); char *ysbrk(); int csizeof(); int finterp(); lispval Iget(); lispval Imkrtab(); lispval Iputprop(); lispval Lfuncal(); lispval Lnegp(); lispval Lsub(); lispval alloc(); lispval copval(); lispval csegment(); lispval error(); lispval errorh(); lispval eval(); lispval gc(); lispval getatom(); lispval inewint(); lispval inewval(); lispval linterp(); lispval matom(); lispval mfun(); lispval mstr(); lispval newarray(); lispval newdot(); lispval newdoub(); lispval newfunct(); lispval newint(); lispval newsdot(); lispval newval(); lispval newhunk(); lispval pnewdot(); lispval pnewdoub(); lispval pnewhunk(); lispval pnewint(); lispval pnewsdot(); lispval pnewval(); lispval popnames(); lispval r(); lispval ratomr(); lispval readr(); lispval readrx(); lispval readry(); lispval typred(); lispval unprot(); lispval verify(); struct atom * newatom(); linterp(); cmd/lisp/franz/h/frame.h 644 0 12 1665 2552725343 10373 /* sccs id @(#)frame.h 35.2 7/2/81 */ /* * frame.h :: evaluation frame. */ /* classes of frames: */ #define F_PROG 1 #define F_CATCH 2 #define F_RESET 3 #define F_EVAL 4 #define F_FUNCALL 5 /* classes of things thrown up */ #define C_INITIAL 0 #define C_GO 1 #define C_RET 2 #define C_THROW 3 #define C_RESET 4 #define C_FRETURN 5 /* the evaluation frame sits on the C runtime stack. the global variable errp points to the newest frame. The base of the frame points in the middle of the frame, but in such a way that above the frame base the contents are the same for all implementation, and below it there are different saved registers for each machine. */ struct frame { struct argent *svlbot, *svnp; struct nament *svbnp; struct frame *olderrp; lispval retaddr; long class; lispval larg1; /* optional */ lispval larg2; /* optional */ }; extern struct frame *errp,*Pushframe(); points to the newest frame. The base of the frame points in the middle ocmd/lisp/franz/h/global.h 644 0 12 22472 2552725344 10561 /* sccs id @(#)global.h 35.3 7/2/81 */ /**********************************************************************/ /* */ /* file: global.h */ /* contents: */ /* GLOBAL STUFF *******************************************************/ #include #include #include "config.h" #ifdef UNIXTS #include "tsfix.h" #endif #define AD 0 #define peekc(p) (p->_cnt>0? *(p)->_ptr&0377:_filbuf(p)==-1?-1:((p)->_cnt++,*--(p)->_ptr&0377)) #define FALSE 0 #define TRUE 1 #define EVER ;; #define CNIL ((lispval) -4) #define nil ((lispval) 0) #define eofa ((lispval) 20) #define NOTNIL(a) ((int)a) #define ISNIL(a) (!(int)a) #define STRBLEN 512 #define NULL_CHAR 0 #define LF '\n' #define WILDCHR '\0177' /* type flags and the macros to get them ********************************/ #define UNBO -1 #define STRNG 0 #define ATOM 1 #define INT 2 #define DTPR 3 #define DOUB 4 #define BCD 5 #define PORT 6 #define ARRAY 7 #define SDOT 9 #define VALUE 10 #define HUNK2 11 /* The hunks */ #define HUNK4 12 #define HUNK8 13 #define HUNK16 14 #define HUNK32 15 #define HUNK64 16 #define HUNK128 17 /* the numbers per page of the different data objects *******************/ #define NUMSPACES 16 #define ATOMSPP 25 #define STRSPP NBPG #define INTSPP 128 #define DTPRSPP 64 #define DOUBSPP 64 #define ARRAYSPP 25 #define SDOTSPP 64 #define VALSPP 128 #define BCDSPP 64 #define HUNK2SPP 64 /* hunk page sizes */ #define HUNK4SPP 32 #define HUNK8SPP 16 #define HUNK16SPP 8 #define HUNK32SPP 4 #define HUNK64SPP 2 #define HUNK128SPP 1 extern char typetable[]; /* the table with types for each page */ #define TYPL(a1) ((typetable+1)[(int)(a1) >> 9]) #define SETTYPE(a1,b) {if((itemp = ((int)a1) >> 9) >= fakettsize) \ { if(fakettsize >= TTSIZE) \ {\ printf(" all space exausted, goodbye\n");\ exit(1);\ }\ fakettsize++; badmem();\ }\ (typetable + 1)[itemp] = (b); } #define TYPE(a1) ((typetable+1)[(int)(a1) >> 9]) #define HUNKP(a1) ((TYPE(a1)+5) & 16) #define HUNKSIZE(a1) ((TYPE(a1)+5) & 15) #define VALID(a) (a >= CNIL && a < datalim) /* * macros for saving state and restoring state * * Savestack and Restorestack are required at the beginning and end of * functions which modify the stack pointers np and lbot. * The Savestack(n) should appear at the end of the variable declarations * The n refers to the number of register variables declared in this routine. * The information is required for the Vax version only. */ #if vax #define Savestack(n) snpand(n) #define Restorestack() #endif #if vax #define Popframe() (errp->olderrp) #endif /* some types ***********************************************************/ #define lispint long #define MAX10LNG 200000000 /* max long divided by 10 */ typedef union lispobj *lispval ; struct dtpr { lispval cdr, car; }; struct sdot { int I; lispval CDR; }; struct atom { lispval clb; /* current level binding*/ lispval plist; /* pointer to prop list */ #ifndef WILD lispval fnbnd; /* function binding */ #endif struct atom *hshlnk; /* hash link to next */ char *pname; /* print name */ }; #ifdef WILD #define fnbnd clb #endif struct array { lispval accfun, /* access function--may be anything */ aux; /* slot for dimensions or auxilliary data */ char *data; /* pointer to first byte of array */ lispval length, delta; /* length in items and length of one item */ }; struct bfun { lispval (*entry)(); /* entry point to routine */ lispval discipline, /* argument-passing discipline */ language, /* language coded in */ params, /* parameter list if relevant */ loctab; /* local table */ }; struct Hunk { lispval hunk[1]; }; union lispobj { struct atom a; FILE *p; struct dtpr d; long int i; long int *j; double r; lispval (*f)(); struct array ar; struct sdot s; char c; lispval l; struct bfun bcd; struct Hunk h; }; #include "sigtab.h" /* table of all pointers to lisp data */ /* Port definitions *****************************************************/ extern FILE *piport, /* standard input port */ *poport, /* standard output port */ *errport, /* port for error messages */ *rdrport; /* temporary port for readr */ extern FILE *xports[]; /* page of file *'s for lisp */ extern int lineleng ; /* line length desired */ extern char rbktf; /* logical flag: ] mode */ extern unsigned char *ctable; /* Character table in current use */ #define Xdqc ctable[131] #define Xesc ctable[130] #define Xsdc ctable[129] /* name stack ***********************************************************/ #define NAMESIZE 3072 /* the name stack limit is raised by NAMINC every namestack overflow to allow a user function to handle the error */ #define NAMINC 25 extern struct nament { lispval val, atm; } *bnp, /* first free bind entry*/ *bnplim; /* limit of bindstack */ struct argent { lispval val; }; extern struct argent *lbot, *np, *namptr; extern struct nament *bnp; /* first free bind entry*/ extern struct argent(( *nplim; /* don't have this = np */ extern struct argent *orgnp; /* used by top level to reset to start */ extern struct nament *orgbnp; /* used by top level to reset to start */ extern struct nament *bnplim; /* limit of bindstack */ extern struct argent *np, /* top entry on stack */ *lbot, /* bottom of cur frame */ *namptr; /* temporary pointer */ extern lispval sigacts[16]; extern lispval hunk_pages[7], hunk_items[7], hunk_name[7]; #define TNP if(np >= nplim) namerr(); #define TNP if(np >= nplim) namerr(); #define INRNP if (np++ >= nplim) namerr(); #define protect(p) (np++->val = (p)) #define chkarg(p,x); if((p)!=np-lbot) argerr(x); /** status codes **********************************************/ /* */ /* these define how status and sstatus should service probes */ /* into the lisp data base */ /* common status codes */ #define ST_NO 0 /* status codes */ #define ST_READ 1 #define ST_FEATR 2 #define ST_SYNT 3 #define ST_RINTB 4 #define ST_NFETR 5 #define ST_DMPR 6 #define ST_CTIM 7 #define ST_LOCT 8 #define ST_ISTTY 9 #define ST_UNDEF 10 /* sstatus codes */ #define ST_SET 1 #define ST_FEATW 2 #define ST_TOLC 3 #define ST_CORE 4 #define ST_INTB 5 #define ST_NFETW 6 #define ST_DMPW 7 #define ST_AUTR 8 #define ST_TRAN 9 #define ST_BCDTR 10 /* number of counters for fasl to use in a profiling lisp */ #define NMCOUNT 5000 /* hashing things *******************************************************/ #define HASHTOP 1024 /* we handle 8-bit characters by dropping top bit */ extern struct atom *hasht[HASHTOP]; extern int hash; /* set by ratom */ extern int atmlen; /* length of atom including final null */ /** exception handling ***********************************************/ extern int exception; /* if TRUE then an exception is pending, one of */ /* the below */ extern int sigintcnt; /* if > 0 then there is a SIGINT pending */ /* big string buffer for whomever needs it ******************************/ extern char strbuf[STRBLEN]; extern char *endstrb; /* break and error declarations *****************************************/ #define SAVSIZE 44 /* number of bytes saved by setexit */ #define BRRETB 1 #define BRCONT 2 #define BRGOTO 3 #define BRRETN 4 #define INTERRUPT 5 #define THROW 6 extern int depth; /* depth of nested breaks */ extern lispval contval; /* the value being returned up */ extern int retval; /* used by each error/prog call */ extern lispval lispretval; /* used by non-local go */ extern int rsetsw; /* used by *rset mode */ extern int evalhcallsw; /* used by evalhook */ extern int funhcallsw; /* used by evalhook */ extern lispval Vevalframe;; /* used by evalframe */ /* other stuff **********************************************************/ extern lispval ftemp,vtemp,argptr,ttemp; /* temporaries: use briefly */ extern int itemp; /* for pointer type conversion */ #include "dfuncs.h" #define NUMBERP 2 #define BCDP 5 #define PORTP 6 #define ARRAYP 7 #define ABSVAL 0 #define MINUS 1 #define ADD1 2 #define SUB1 3 #define NOT 4 #define LNILL 5 #define ZEROP 6 #define ONEP 7 #define PLUS 8 #define TIMES 9 #define DIFFERENCE 10 #define QUOTIENT 11 #define MOD 12 #define LESSP 13 #define GREATERP 14 #define SUM 15 #define PRODUCT 16 #define AND 17 #define OR 18 #define XOR 19 interpt(); handler(); extern sigdelay, sigstruck; /* limit of valid data area **************************************/ extern lispval datalim; /** macros to push and pop the value of an atom on the stack ******/ #define PUSHDOWN(atom,value)\ {bnp->atm=(atom);bnp++->val=(atom)->a.clb;(atom)->a.clb=value;\ if(bnp>bnplim) binderr();} #define POP\ {--bnp;bnp->atm->a.clb=bnp->val;} /** macro for evaluating atoms in eval and interpreter ***********/ #define EVALATOM(x) vtemp = x->a.clb;\ if( vtemp == CNIL ) {\ printf("%s: ",(x)->a.pname);\ vtemp = error("UNBOUND VARIABLE",TRUE);} /* having to do with small integers */ #define SMALL(i) ((lispval)(1024 + (i<<2))) #define P(p) ((lispval) (xports +((p)-_iob))) #define PN(p) ((int) ((p)-_iob)) #define okport(arg,default) (vtemp = arg,((TYPE((vtemp))!=PORT)?default:(vtemp)->p)) extern lispval ioname[]; /* names of open files */ /* interpreter globals */ extern int lctrace; /* register lisp macros for registers */ #define saveonly(n) asm("#save n") #define snpand(n) asm("#protect n") temp = error("UNBOUND VARIABLE",TRUE);} /* having to do with small integers */ #define SMALL(i) ((lispval)(1024 + (i<<2))) #define P(p) ((lispval) (xports +((p)-_iob))) #define PN(p) ((int)cmd/lisp/franz/h/gtabs.h 644 0 12 435 2552725344 10354 /* sccs id @(#)gtabs.h 35.1 5/6/81 */ /* these are the tables of global lispvals known to the interpreter */ /* and compiler. They are not used by the garbage collector. */ #define GFTABLEN 200 #define GCTABLEN 8 extern lispval gftab[GFTABLEN]; extern lispval gctab[GCTABLEN]; snpand(n) asm("#protect n") temp = error("UNBOUND VARIABLE",TRUE);} /* having to do with small integers */ #define SMALL(i) ((l/P4,P45< /h,l"cmd/lisp/franz/h/lfuncs.h 644 0 12 11370 2552725344 10606 /* sccs id @(#)lfuncs.h 35.5 7/2/81 */ Lcont(); Lexit(); Lreturn(); Ngo(); Nreset(); Nthrow(); Ntpl(); lispval Lalfalp(); lispval Lfseek(); lispval LDivide(); lispval LEmuldiv(); lispval LMakhunk(); lispval LstarMod(); lispval Lstarrpx(); lispval Labsval(); lispval Lacos(); lispval Ladd(); lispval Ladd1(); lispval Lalloc(); lispval Lapply(); lispval Larg(); lispval Largv(); lispval Larrayp(); lispval Larrayref(); lispval Lascii(); lispval Lasin(); lispval Lassq(); lispval Latan(); lispval Latom(); lispval Lbaktrace(); lispval Lbcdad(); lispval Lbcdp(); lispval Lbigtol(); lispval Lbiglsh(); lispval Lbind(); lispval Lboole(); lispval Lboundp(); lispval Lc02r(); lispval Lc03r(); /* cdddr */ lispval Lc04r(); /* cddddr */ lispval Lc12r(); /* caddr */ lispval Lc13r(); /* cadddr */ lispval Lc14r(); /* caddddr */ lispval Lcaar(); lispval Lcadr(); lispval Lcar(); lispval Lcdr(); lispval Lcfasl(); lispval Lchdir(); lispval Lclose(); lispval Lconcat(); lispval Lcons(); lispval Lcopyint(); /* actually copyint* */ lispval Lcos(); lispval Lcprintf(); lispval Lcpy1(); lispval Lctcherr(); /* function def of ER%unwind-protect */ lispval Lcxr(); lispval Ldiff(); lispval Ldrain(); lispval Ldtpr(); lispval Leq(); lispval Lequal(); lispval Lerr(); lispval Leval(); lispval Leval1(); lispval Levalf(); lispval Levalhook(); lispval Lexece(); lispval Lexp(); lispval Lexplda(); lispval Lexpldc(); lispval Lexpldn(); lispval Lfact(); lispval Lfake(); lispval Lfasl(); lispval Lfileopen(); lispval Lfix(); lispval Lfm(); lispval Lfp(); lispval Lfd(); lispval Lft(); lispval Lflatsi(); lispval Lfloat(); lispval Lfork(); lispval Lforget(); lispval Lfrexp(); lispval Lfuncal(); lispval Lfunhook(); lispval Lgcstat(); lispval Lgcpar(); lispval Lgetaddress(); lispval Lfretn(); lispval Lgensym(); lispval Lget(); lispval Lgeta(); lispval Lgetaux(); lispval Lgetd(); lispval Lgetdata(); lispval Lgetdel(); lispval Lgetdim(); lispval Lgetdisc(); lispval Lgetentry(); lispval Lgetenv(); lispval Lgetl(); lispval Lgetlang(); lispval Lgetloc(); lispval Lgetparams(); lispval Lgreaterp(); lispval Lhaipar(); lispval Lhashst(); lispval Lhau(); lispval Lhunkp(); lispval Lhunksize(); lispval Limplode(); lispval Linfile(); lispval Lintern(); lispval Lkilcopy(); lispval Llctrace(); lispval Llessp(); lispval Llist(); lispval Lload(); lispval Llog(); lispval Llsh(); lispval Lmakertbl(); lispval Lmaknam(); lispval Lmaknum(); lispval Lmakunb(); lispval Lmap(); lispval Lmapc(); lispval Lmapcan(); lispval Lmapcar(); lispval Lmapcon(); lispval Lmaplist(); lispval Lmarray(); lispval Lmfunction(); lispval Lminus(); lispval Lmod(); lispval Lmonitor(); lispval Lncons(); lispval Lnegp(); lispval Lnfasl(); lispval Lnthelem(); lispval Lnull(); lispval Lnumberp(); lispval Lnwritn(); lispval Loblist(); lispval Lod(); lispval Lonep(); lispval Lopval(); lispval Loutfile(); lispval Lpatom(); lispval Lplist(); lispval Lpurcopy(); lispval Lpurep(); lispval Lpname(); lispval Lpntlen(); lispval Lpolyev(); lispval Lportp(); lispval Lprint(); lispval Lprname(); lispval Lprobef(); lispval Lptime(); lispval Lptr(); lispval Lputa(); lispval Lputaux(); lispval Lputd(); lispval Lputdata(); lispval Lputdel(); lispval Lputdim(); lispval Lputdisc(); lispval Lputl(); lispval Lputlang(); lispval Lputloc(); lispval Lputparams(); lispval Lputprop(); lispval Lquo(); lispval Lrandom(); lispval Lratom(); lispval Lread(); lispval Lreadc(); lispval Lreadli(); lispval Lrematom(); lispval Lremprop(); lispval Lreplace(); #ifdef VMS lispval Lrestlsp(); #endif lispval Lretbrk(); lispval Lrfasl(); lispval Lrmadd(); lispval Lrot(); lispval Lrplaca(); lispval Lrplacd(); lispval Lrplaci(); lispval Lrplacx(); lispval Lrset(); #ifdef VMS lispval Lsavelsp(); #endif lispval Lsbiglsh(); lispval Lscons(); lispval Lsegment(); lispval Lset(); lispval Lsetarg(); lispval Lsetpli(); lispval Lsetsyn(); lispval Lshostk(); lispval Lsignal(); lispval Lsimpld(); lispval Lsin(); lispval Lsizeof(); lispval Lslevel(); lispval Lsqrt(); lispval Lstringp(); lispval Lsub(); lispval Lsub1(); lispval Lsubstring(); lispval Lsubstringn(); lispv((al Lsymbolp(); lispval Lsyscall(); lispval Lterpr(); lispval Ltimes(); lispval Ltyi(); lispval Ltyipeek(); lispval Ltyo(); lispval Ltype(); lispval Luconcat(); lispval Lvaluep(); lispval Lvbind(); lispval Lwait(); lispval Lzapline(); lispval Lzerop(); lispval Nand(); lispval Nbreak(); lispval Ncatch(); lispval Ncond(); lispval Ndef(); lispval Ndo(); lispval Ndumplisp(); lispval Nndumplisp(); lispval Nerrset(); lispval Nevwhen(); lispval Nfunction(); lispval Ngc(); lispval Ngcafter(); lispval Nlist(); lispval Nopval(); lispval Nor(); lispval Nprocess(); lispval Nprod(); lispval Nprog(); lispval Nprog2(); lispval Nprogn(); lispval Nprogv(); lispval Nquote(); lispval Nresetio(); lispval Nsetq(); lispval Nsstatus(); lispval Nstatus(); lispval Zequal(); (); lispval Nand(); lispval Nbreak(); lispval Ncatch(); lispval Ncond(); lispval Ndef(); lispval Ndo(); lispval Ndumplisp(); lispval Nndumplisp(); lispval Nerrset(); lispval Nevwhen(); lispval Nfunction(); lispval Ngc(); lispval Ngcafter(); lispval Nlist(); lispvcmd/lisp/franz/h/naout.h 644 0 12 5111 2552725345 10417 /* sccs id @(#)naout.h 35.1 5/6/81 */ /* u_* types come from */ /* PAGSIZ comes from */ /* * Header prepended to each a.out file. */ struct exec { long a_magic; /* magic number */ u_long a_text; /* size of text segment */ u_long a_data; /* size of initialized data */ u_long a_bss; /* size of uninitialized data */ u_long a_syms; /* size of symbol table */ u_long a_entry; /* entry point */ u_long a_trsize; /* size of text relocation */ u_long a_drsize; /* size of data relocation */ }; #define OMAGIC 0407 /* old impure format */ #define NMAGIC 0410 /* read-only text */ #define ZMAGIC 0413 /* demand load format */ /* * Macros which take exec structures as arguments and tell whether * the file has a reasonable magic number or offsets to text|symbols|strings. */ #define N_BADMAG(x) \ (((x).a_magic)!=OMAGIC && ((x).a_magic)!=NMAGIC && ((x).a_magic)!=ZMAGIC) #define N_TXTOFF(x) \ ((x).a_magic==ZMAGIC ? PAGSIZ : sizeof (struct exec)) #define N_SYMOFF(x) \ (N_TXTOFF(x) + (x).a_text+(x).a_data + (x).a_trsize+(x).a_drsize) #define N_STROFF(x) \ (N_SYMOFF(x) + (x).a_syms) /* * Format of a relocation datum. */ struct relocation_info { int r_address; /* address which is relocated */ u_int r_symbolnum:24, /* local symbol ordinal */ r_pcrel:1, /* was relocated pc relative already */ r_length:2, /* 0=byte, 1=word, 2=long */ r_extern:1, /* does not include value of sym referenced */ :4; /* nothing, yet */ }; /* * Format of a symbol table entry; this file is included by * and should be used if you aren't interested the a.out header * or relocation information. */ struct nlist { union { char *n_name; /* for use when in-core */ long n_strx; /* index into file string table */ } n_un; u_char n_type; /* type flag, i.e. N_TEXT etc; see below */ char n_other; /* unused */ short n_desc; /* see */ u_long n_value; /* value of this symbol (or sdb offset) */ }; #define n_hash n_desc /* used internally by ld */ /* * Simple values for n_type. */ #define N_UNDF 0x0 /* undefined */ #define N_ABS 0x2 /* absolute */ #define N_TEXT 0x4 /* text */ #define N_DATA 0x6 /* data */ #define N_BSS 0x8 /* bss */ #define N_COMM 0x12 /* common (internal to ld) */ #define N_FN 0x1f /* file name symbol */ #define N_EXT 01 /* external bit, or'ed in */ #define N_TYPE 0x1e /* mask for all the type bits */ /* * Sdb entries have some of the N_STAB bits set. * These are given in */ #define N_STAB 0xe0 /* if any of these bits set, a SDB entry */ /* * Format for namelist values. */ #define N_FORMAT "%08x" solute */ #define N_TEXT 0x4 /* text */ #define N_DATA 0x6 /* data */ #define N_BSS 0x8 /* bss */ #define N_COMM 0x12 /* common (internal to ld) */ #define N_FN 0x1f /* file name symbol */ #define N_EXT 01 /* external bit, or'ed in */ #define N_TYPE 0x1e /* mask for all the type bits */ /* * Sdb entries have some of the N_STAB bits set. * These are given in */ #define N_STAB 0xe0 /* if any of these bits set, a SDBcmd/lisp/franz/h/oaout.h 644 0 12 5611 2552725345 10425 /* sccs id @(#)oaout.h 35.1 5/6/81 */ /* * Format of an a.out header */ struct exec { /* a.out header */ int a_magic; /* magic number */ unsigned a_text; /* size of text segment */ unsigned a_data; /* size of initialized data */ unsigned a_bss; /* size of uninitialized data */ unsigned a_syms; /* size of symbol table */ unsigned a_entry; /* entry point */ unsigned a_trsize; /* size of text relocation */ unsigned a_drsize; /* size of data relocation */ }; #define A_MAGIC1 0407 /* normal */ #define A_MAGIC2 0410 /* read-only text */ #define A_MAGIC3 0411 /* separated I&D (not on VAX) */ #define A_MAGIC4 0405 /* overlay */ #define A_MAGIC5 0413 /* demand page read-only text */ struct relocation_info { long r_address; /* relative to current segment */ long r_symbolnum:24, /* if extern then symbol table */ /* ordinal (0, 1, 2, ...) else */ /* segment number (same as symbol types) */ r_pcrel:1, /* if so, segment offset has already */ /* been subtracted */ r_length:2, /* 0=byte, 1=word, 2=long */ r_extern:1, /* does not include value */ /* of symbol referenced */ r_offset:1, /* already includes origin */ /* of this segment (?) */ r_pad:3; /* nothing, yet */ }; #ifndef NCPS #define NCPS 8 #endif struct nlist { /* symbol table entry */ char n_name[NCPS]; /* symbol name */ char n_type; /* type flag */ char n_other; short n_desc; unsigned n_value; /* value */ }; /* values for type flag */ #define N_UNDF 0 /* undefined */ #define N_ABS 02 /* absolute */ #define N_TEXT 04 /* text */ #define N_DATA 06 /* data */ #define N_BSS 08 #define N_TYPE 037 #define N_FN 037 /* file name symbol */ #define N_GSYM 0040 /* global sym: name,,type,0 */ #define N_FNAME 0042 /* procedure name (f77 kludge): name,,,0 */ #define N_FUN 0044 /* procedure: name,,linenumber,address */ #define N_STSYM 0046 /* static symbol: name,,type,address */ #define N_LCSYM 0048 /* .lcomm symbol: name,,type,address */ #define N_RSYM 0100 /* register sym: name,,register,offset */ #define N_SLINE 0104 /* src line: ,,linenumber,address */ #define N_SSYM 0140 /* structure elt: name,,type,struct_offset */ #define N_SO 0144 /* source file name: name,,,address */ #define N_LSYM 0200 /* local sym: name,,type,offset */ #define N_SOL 0204 /* #line source filename: name,,,address */ #define N_PSYM 0240 /* parameter: name,,type,offset */ #define N_ENTRY 0244 /* alternate entry: name,,linenumber,address */ #define N_LBRAC 0300 /* left bracket: ,,nesting level,address */ #define N_RBRAC 0340 /* right bracket: ,,nesting level,address */ #define N_BCOMM 0342 /* begin common: name,,, */ #define N_ECOMM 0344 /* end common: name,,, */ #define N_ECOML 0348 /* end common (local name): ,,,address */ #define N_LENG 0376 /* second stab entry with length information */ #define N_EXT 01 /* external bit, or'ed in */ #define FORMAT "%08x" #define STABTYPES 0340 244 /* alternate entry: name,,linenumber,address */ #define N_LBRAC 0300 /* left bracket: ,,nesting level,address */ cmd/lisp/franz/h/sigtab.h 644 0 12 7374 2552725346 10560 /* sccs id @(#)sigtab.h 35.2 7/2/81 */ /* * lispvals in use by the program should be in this table. * Otherwise they may get garbage-collected. */ #define SIGNIF 119 extern lispval lispsys[SIGNIF]; #define tatom (lispsys[1]) #define lambda (lispsys[2]) #define nlambda (lispsys[3]) #define perda (lispsys[4]) #define lpara (lispsys[5]) #define rpara (lispsys[6]) #define lbkta (lispsys[7]) #define rbkta (lispsys[8]) #define Eofa (lispsys[9]) #define snqta (lispsys[10]) #define exclpa (lispsys[11]) #define quota (lispsys[12]) #define xatom (lispsys[13]) #define cara (lispsys[14]) #define cdra (lispsys[15]) #define gcafter (lispsys[16]) #define noptop (lispsys[17]) #define gcthresh (lispsys[18]) #define int_name (lispsys[19]) #define str_name (lispsys[20]) #define atom_name (lispsys[21]) #define doub_name (lispsys[22]) #define dtpr_name (lispsys[23]) #define int_items (lispsys[24]) #define int_pages (lispsys[25]) #define str_items (lispsys[26]) #define str_pages (lispsys[27]) #define dtpr_items (lispsys[28]) #define dtpr_pages (lispsys[29]) #define doub_items (lispsys[30]) #define doub_pages (lispsys[31]) #define atom_items (lispsys[32]) #define atom_pages (lispsys[33]) #define gccall1 (lispsys[34]) #define gccall2 (lispsys[35]) #define sysa (lispsys[36]) #define plima (lispsys[37]) #define macro (lispsys[38]) #define startup (lispsys[39]) #define rcomms (lispsys[40]) #define commta (lispsys[41]) #define plimit (lispsys[44]) #define array_items (lispsys[45]) #define array_pages (lispsys[46]) #define arra((y_name (lispsys[47]) #define sdot_items (lispsys[48]) #define sdot_pages (lispsys[49]) #define sdot_name (lispsys[50]) #define val_items (lispsys[51]) #define val_pages (lispsys[52]) #define val_name (lispsys[53]) #define splice (lispsys[54]) #define rdrsdot (lispsys[55]) #define funct_items (lispsys[56]) #define funct_pages (lispsys[57]) #define funct_name (lispsys[58]) #define nstack (lispsys[59]) #define rdrint (lispsys[63]) #define nilplist (lispsys[64]) #define badst (lispsys[65]) #define gccheck (lispsys[66]) #define gcport (lispsys[67]) #define gcdis (lispsys[68]) #define gcload (lispsys[69]) #define loading (lispsys[70]) #define noautot (lispsys[71]) #define lcode (lispsys[72]) #define ccode (lispsys[73]) #define odform (lispsys[74]) #define bcdst (lispsys[75]) #define listst (lispsys[76]) #define macrost (lispsys[77]) #define protst (lispsys[78]) #define argst (lispsys[79]) #define arrayst (lispsys[80]) #define proga (lispsys[81]) #define progma (lispsys[82]) #define bstack (lispsys[83]) #define lexpr_atom (lispsys[84]) #define lexpr (lispsys[85]) #define ibase (lispsys[86]) #define Vpiport (lispsys[87]) #define Vpoport (lispsys[88]) #define Veval (lispsys[89]) #define Vererr (lispsys[90]) #define Vertpl (lispsys[91]) #define Verall (lispsys[92]) #define Vermisc (lispsys[93]) #define Vlerall (lispsys[94]) #define stlist (lispsys[95]) #define Vreadtable (lispsys[96]) #define strtab (lispsys[97]) #define Verbrk (lispsys[98]) #define Vnogbar (lispsys[99]) #define rdrsdot2 (lispsys[100]) #define Veruwpt (lispsys[101]) #define hunkfree (lispsys[102]) #define port_name (lispsys[103]) #define reseta (lispsys[104]) #define rsetatom (lispsys[105]) #define bptr_atom (lispsys[106]) #define evalhatom (lispsys[107]) #define funhatom (lispsys[108]) #define Vptport (lispsys[109]) #define Vcntlw (lispsys[110]) #define Verrset (lispsys[111]) #define Verundef (lispsys[112]) #define Vsubrou (lispsys[113]) #define Vprinlevel (lispsys[114]) #define Vprinlength (lispsys[115]) #define Vfloatformat (lispsys[116]) #define Vldprt (lispsys[117]) #define Verdepth (lispsys[118]) /* various status switches */ #ifndef CONTORT extern lispval stattab[16] ; #define Schainp (stattab[0]) #define Sautor (stattab[1]) #define Strans (stattab[2]) #define evalhsw (stattab[3]) #endif port (lispsys[109]) #define Vcntlw (lispsys[110]) #define Verrset (lispsys[111]) #define Verundef (lispsys[112]) #define Vsubrou (lispsys[113]) #define Vprinlevel (lispsys[114]) #define Vprinlength (lispsys[115]) #define Vfloatformat (lispsys[116]) #define Vlcmd/lisp/franz/h/types.h 644 0 12 1004 2552725350 10426 /* sccs id @(#)types.h 35.1 5/6/81 */ typedef struct { int rrr[1]; } * physadr; typedef long daddr_t; typedef char * caddr_t; typedef unsigned short ino_t; typedef long time_t; typedef int label_t[10]; typedef short dev_t; typedef long off_t; # ifdef UNIXTS typedef unisgned short ushort; # endif /* major part of a device */ #define major(x) (int)(((unsigned)x>>8)&0377) /* minor part of a device */ #define minor(x) (int)(x&0377) /* make a device number */ #define makedev(x,y) (dev_t)(((x)<<8) | (y)) ccs id @(#)types.h 35.1 5/6/81 */ typedef struct { int rrr[1]; } * physadr; typedef long daddr_t; typedef char * caddr_t; typedef unsigned short ino_t; typedef long time_t; typedef int label_t[10]; typedef short dev_t; typedef long off_t; # ifdef UNIXTS typedef unisgned short ushort; # endif /* major part of a device */ #define major(x) (int)(((unsigned)x>>8)&0377) /* minor part of a device */ #define minor(x) (int)(x&0377) /* make a device number */ #define makedev(x,y) (dev_t)(((x)<<8) | (cmd/lisp/franz/h/structs.h 664 0 12 1450 2552725347 11006 /* sccs id %W% %G% */ /* * this file contains auxiliary structure definitions which are used by * just a few files. */ /* transfer table structures. */ #define TRENTS 510 struct trent { lispval (*fcn)(); /* function to call */ lispval name; /* symbol which is the function to call */ }; struct trtab { struct trtab *nxtt; /* pointer to next transfer table */ struct trent trentrs[TRENTS]; /* entries */ int sentinal; /* must be zero */ }; struct heads { struct heads *link; char *pntr; }; struct types { char *next_free; int space_left, space, type, type_len; /* note type_len is in units of int */ lispval *items, *pages, *type_name; struct heads *first; char *next_pure_free; }; struct str_x { char *next_free; int space_left; }; call */ }; struct trtab { struct trtab *nxtt; /* pointer to next transfer table */ struct trent trentrs[TRENTS]; /* entries */ int sentinal; /* must be zero */ }; struct heads { struct hecmd/lisp/franz/h/config.h 444 0 12 1216 2552725343 10534 /* sccs id @(#)config.h 35.1 5/6/81 */ /* * this file contains parameters which each site is likely to modify * to create (and describe) their own configuration. * The following names will be stored in the (status features) list. * */ #define OS "unix" #define MACHINE "vax" #define SITE "ucbvax" /* TTSIZ is the absolute limit, in pages, * both text and data, of the * size to which the lisp system may grow. * If you change this, you must recompile * alloc.c and data.c */ #ifdef HOLE #define TTSIZE 10216 #else #define TTSIZE 6120 #endif #ifdef VMS #undef TTSIZE #define TTSIZE 10216 #define FREESIZE 512 * 10000 #endif heir own configuration. * The following names will be stored in the (status features) list. * */ #define OS "unix" #define MACHINE "vax" #define SITE "ucbvax" /* TTSIZ is the absolute limit, in pages, * both text and data, of the * size to which the lisp system may grow. * If you change this, you must recompile * alloc.c and data.c */ #ifdef HOLE cmd/lisp/franz/h/gc.h 664 0 12 423 2552725343 7643 /* gc.h structures used by the gc analysis routines * this is a temporary file */ struct gchead { int version; /* version number of this dump file */ int lowdata; /* low address of sharable lisp data */ int dummy,dummy2,dummy3; /* to be used later */ }; ACHINE "vax" #define SITE "ucbvax" /* TTSIZ is the absolute limit, in pages, * both text and data, of the * size to which the lisp syste/P4,P458< /h,l"cmd/lisp/franz/h/vaxframe.h 664 0 12 236 2552725350 11063 /* sccs id %W% %G% */ struct frame { lispval (*handler)(); long mask; lispval *ap; struct frame *fp; lispval (*pc)(); lispval *r6; lispval *r7; }; / int lowdata; /* low address of sharable lisp data */ int dummy,dummy2,dummy3; /* to be used later */ }; ACHINE "vax" #define SITE "ucbvax" /* TTSIZ is the absolute limit, in pages, * both text and data, of the * size to which the lisp syste/P4,P45H< /h,l"cmd/lisp/franz/Makefile 644 0 12 5060 2552756044 10334 # # Evans Vax 11/780 # Caution: this make file will not work on unix TS systems! # HOLE= 2097152 #if you change this you must recompile rlc.c TOBJS = crt0.o Orderit.o lisp.o eval.o eval2.o Talloc.o inits.o io.o \ frame.o error.o sysat.o data.o\ lam1.o lam2.o lam3.o lam4.o lam5.o lam6.o lam7.o lam8.o lamr.o lamnop.o\ fex1.o fex2.o fex3.o fex4.o fexr.o\ reset.o fpipe.o dmcount.o bigmath.o\ subbig.o pbignum.o divbig.o inewint.o ffasl.o nfasl.o vsyscall.o\ qfuncl.o trace.o evalf.o # backquote.o auxfns0.o(( HOBJS = hcrt0.o rlc.o Orderit.o lisp.o eval.o eval2.o Salloc.o inits.o io.o \ frame.o error.o sysat.o Sdata.o\ lam1.o lam2.o lam3.o lam4.o lam5.o lam6.o lam7.o lam8.o lamr.o lamnop.o\ fex1.o fex2.o fex3.o fex4.o fexr.o\ reset.o fpipe.o bigmath.o dmcount.o\ subbig.o pbignum.o divbig.o inewint.o nfasl.o ffasl.o vsyscall.o\ qfuncl.o trace.o evalf.o GLOB = h/global.h h/sigtab.h CFLAGS = -O -Ih # -p # -g T = $(DESTDIR) LLIB = $T/usr/lib/lisp LOBJS = $(LLIB)/auxfns0.o $(LLIB)/auxfns1.o $(LLIB)/backquote.o \ $(LLIB)/toplevel.o $(LLIB)/tackon .SUFFIXES : .c.l .c.o : @echo cc -c -O $*.c;\ /lib/cpp $< -Ih | /lib/ccom | fixmask | sed -f fixpbig.e |\ /lib/c2 | as -o $*.o .l.o : liszt $< > #resc @echo liszt $< done tlisp: fixmask ${TOBJS} ${LLIB}/nld rm -f tlisp ld -x -o tlisp -e start ${TOBJS} -lm -lc ls -l tlisp hlisp: fixmask ${HOBJS} ${LLIB}/nld rm -f hlisp ld -x -H $(HOLE) -o hlisp -e hstart ${HOBJS} -lm -lc ls -l hlisp # ${OBJS}: ${GLOB} data.o: h/sigtab.h rlc.o: rlc.c cc -c -O -DHOLE=${HOLE} rlc.c Salloc.o: Talloc.c (echo "# define HOLE"; cat Talloc.c) > Zalloc.c ; make Zalloc.o;\ rm Zalloc.c; mv Zalloc.o Salloc.o Sdata.o: data.c (echo "# define HOLE"; cat data.c) > Zdata.c ; make Zdata.o;\ rm Zdata.c; mv Zdata.o Sdata.o fixmask: fixmask.c cc -O -o fixmask fixmask.c clean: rm -f *.o tlisp hlisp map ?resc fixmask print: @pr READ* @pr *akefile* @(size lisp ; size *.o) | pr -h sizes @ls -ls | pr @pr *.h *.c *.s lint: lint *.h *.c tape: tar crv Makefile [a-z]*.[cshxe] /usr/lib/lisp install: mylisp mv mylisp $T/usr/ucb/lisp chmod 1755 $T/usr/ucb/lisp @echo lisp installed mylisp: tlisp $(LOBJS) -rm -f mylisp -echo "(fasl '$(LLIB)/auxfns0 'map)(sstatus appendmap t)\ (fasl '$(LLIB)/auxfns1 'map)\ (fasl '$(LLIB)/toplevel 'map)\ (sstatus appendmap nil)\ (dumplisp mylisp)" | tlisp $(LLIB)/tackon map mylisp @echo mylisp built tags: $(GLOB) $(TCFILES) ctags $(GLOB) $(TCFILES) $(LLIB)/nld: cp /bin/ld $(LLIB)/nld $(LLIB)/tackon: tackon.c $(CC) -O tackon.c -o $(LLIB)/tackon -s /usr/ucb/lisp chmod 1755 $T/usr/ucb/lisp @echo lisp installed mylisp: tlisp $(LOBJS) -rm -f mylisp -echo "(fasl '$(LLIB)/auxfns0 'map)(sstatus appendmap t)\ (fasl '$(LLIB)/auxfns1 'map)\ (fasl '$(LLIB)/toplevel 'map)\ (sstatus appendmap nil)\ (dumplisp mylisp)" | tlisp $(LLIB)/tackon map mylisp @echo mylisp built tags: $(GLOB) $(TCFILES) ctags $(GLOB) $(TCFILES) $(LLIB)/nld: cp /bin/ld $(LLIB)/nld $(LLIB)/tackon: tcmd/lisp/franz/Orderit.s 444 0 12 2010 2552701412 10443 .data .asciz "@(#)Orderit.s 35.1 5/6/81" .text .long _Xargc .long _Xargv .long __sobuf .long _retval .long _orgbnp .long _orgnp .long _rlevel .long _errp .long _piport .long _poport .long _vtemp .long _bnp .long _sigintcnt .long _rsetsw .long _lispsys .long _stattab .long _bnplim .long _nplim .long _chkport .long _zeroq .long _atmlen .long _hunk_items .long _hunk_pages .long _hunk_name .long _itemp .long _purepage .long _strbuf .long _GCtime .long _datalim .long _beginsweep .long _usehole .long _curhbeg .long _hasht .long _exception .long _hash .long _sigstruck .long _sigacts .long _sigdelay .long _keywait .long _atomval .long _lastrtab .long _rbktf .long _rdrport .long _contval .long _errport .long _tint .long _gftab .long _proport .long _namptr .long _bcdtrsw .long _ftemp .long _argptr .long _ttemp .long _lctrace .long _trcur .long _end .long _pbuf .long _mcounts .long _globtag .long _syml .long _errno .long __sibuf .long _zfreespace .long _bitmapi .data .globl _firstalloc _firstalloc: .long 0x78 .space 508 asht .long _exception .long _hash .long _sigstruck .long _sigacts .long _sigdelay .long _keywait .long _atomval .long _lastrtab .long _rbktf .long _rdrport .long _contval .long _errport .long _tint .long _gftab .long _proport .long _namptr .long _bcdtrsw .long _ftemp .long _argptr .long _ttemp .long _lctrace .long _trcur .long _end .long _pbuf .long _mcounts .long _globtag .long _syml .long _errno .long __sibuf .long _zfreespace .long _bitmapi .data .globl _firstalloc _firstalloc: .long 0x78 .spcmd/lisp/franz/Talloc.c 644 2 33 71031 2552701413 10272 static char *sccsid = "@(#)Talloc.c 35.5 6/28/81"; # include "global.h" # include "structs.h" # ifndef UNIXTS # include # endif # define NUMWORDS TTSIZE * 128 /* max number of words in P0 space */ # define BITQUADS TTSIZE * 2 /* length of bit map in quad words */ # define BITLONGS TTSIZE * 4 /* length of bit map in long words */ # define ftstbit asm(" ashl $-2,r11,r3");\ asm(" bbcs r3,_bitmapi,$1");\ asm(" .byte 4"); /* setbit is a fast way of setting a bit, it is like ftstbit except it * always continues on to the next instruction */ # define setbit asm(" ashl $-2,r11,r0"); \ asm(" bbcs r0,_bitmapi,$0"); /* define ftstbit if( readbit(p) ) return; oksetbit; */ # define readbit(p) ((int)bitmap[r=(int)p>>5] & (s=bitmsk[((int)p>>2)&7])) # define lookbit(p) (bitmap[(int)p>>5] & bitmsk[((int)p>>2) & 7]) /* # define setbit(p) {bitmap[(int)p>>5] |= bitmsk[((int)p >> 2) & 7];} */ # define oksetbit {bitmap[r] |= s;} # define readchk(p) ((int)bitfre[(int)p>>5] & bitmsk[((int)p>>2)&7]) # define setchk(p) {bitfre[(int)p>>5] |= bitmsk[((int)p >> 2) & 7];} # define roundup(x,l) (((x - 1) | (l - 1)) + 1) # define MARKVAL(v) if((v) >= (lispval)beginsweep) markdp(v); /* the Vax hardware only allows 2^16-1 bytes to be accessed with one * movc5 instruction. We use the movc5 instruction to clear the * bitmaps. */ # define MAXCLEAR ((1<<16)-1) /* METER denotes something added to help meter storage allocation. */ extern int *beginsweep; /* first sweepable data */ extern char purepage[]; extern int fakettsize; FILE * chkport; /* garbage collection dump file */ extern lispval datalim; /* end of data space */ int bitmapi[BITLONGS]; /* the bit map--one bit per long */ double zeroq; /* a quad word of zeros */ char *bitmap = (char *) bitmapi; /* byte version of bit map array */ double *bitmapq = (double *) bitmapi; /* integer version of bit map array */ #ifdef METER extern int gcstat; extern int premark,presweep,alldone; /* actually struct tbuffer's */ extern int markdpcount; extern int conssame, consdiff,consnil; /* count of cells whose cdr point * to the same page and different * pages respectively */ #endif char bitmsk[8]={1,2,4,8,16,32,64,128}; /* used by bit-marking macros */ extern int *bind_lists ; /* lisp data for compiled code */ char *xsbrk(); char *gethspace(); extern struct types atom_str, strng_str, int_str, dtpr_str, doub_str, array_str, sdot_str, val_str, funct_str, hunk_str[]; lispval hunk_items[7], hunk_pages[7], hunk_name[7]; extern int initflag; /* starts off TRUE: initially gc not allowed */ int gcflag = FALSE; /* TRUE during garbage collection */ int current = 0; /* number of pages currently allocated */ static struct types *(spaces[NUMSPACES]) = {&atom_str, &strng_str, &int_str, &dtpr_str, &doub_str, &array_str, &sdot_str, &val_str, &funct_str, &hunk_str[0], &hunk_str[1], &hunk_str[2], &hunk_str[3], &hunk_str[4], &hunk_str[5], &hunk_str[6]}; /* this is a table of pointers to collectable struct types objects * the index is the type number. */ struct types *gcableptr[] = { (struct types *) 0, /* strings not collectable */ &atom_str, &int_str, &dtpr_str, &doub_str, (struct types *) 0, /* binary objects not collectable */ (struct types *) 0, /* port objects not collectable */ &array_str, (struct types *) 0, /* gap in the type number sequence */ &sdot_str,&val_str, &hunk_str[0], &hunk_str[1], &hunk_str[2], &hunk_str[3], &hunk_str[4], &hunk_str[5], &hunk_str[6]}; /** get_more_space(type_struct,purep) ***********************************/ /* */ /* Allocates and structures a new page, returning 0. */ /* If no space is available, returns 1. */ /* If purep is TRUE, then pure space is allocated. */ get_more_space(type_struct,purep) struct types *type_struct; { int cntr; char *start; int *loop, *temp; lispval p, plim; struct heads *next; extern char holend[]; if(initflag == FALSE) /* mustn't look at plist of plima too soon */ { while( plim=copval(plima,(lispval)CNIL), TYPE(plim)!=INT ) copval(plima,error("BAD PAGE LIMIT",TRUE)); if( plim->i <= current ) return(1); /* Can't allocate */ } if( current >= TTSIZE ) return(2); #ifdef HOLE if(purep || type_struct==&strng_str || (type_struct==&funct_str)) start = gethspace(NBPG,type_struct->type); else #endif start = xsbrk(1); /* get new page */ SETTYPE(start, type_struct->type); /* set type of page */ purepage[(int)start>>9] = (char)purep; /* remember if page was pure */ /* bump the page counter for this space if not pure */ ++((*(type_struct->pages))->i); type_struct->space_left = type_struct->space; if(type_struct==&strng_str) { type_struct->next_free = start; return(0); /* space was available */ } temp = loop = (int *) start; for(cntr=1; cntr < type_struct->space; cntr++) loop = (int *) (*loop = (int) (loop + type_struct->type_len)); /* attach new cells to either the pure space free list or the * s((tandard free list */ if(purep) { *loop = (int) (type_struct->next_pure_free); type_struct->next_pure_free = (char *) temp; } else { *loop = (int) (type_struct->next_free); type_struct->next_free = (char *) temp; } /* if type atom, set pnames to CNIL */ if( type_struct == &atom_str ) for(cntr=0, p=(lispval) temp; cntra.pname = (char *) CNIL; p = (lispval) ((int *)p + atom_str.type_len); } return(0); /* space was available */ } /** next_one(type_struct) ************************************************/ /* */ /* Allocates one new item of each kind of space, except STRNG. */ /* If there is no space, calls gc, the garbage collector. */ /* If there is still no space, allocates a new page using */ /* get_more_space(type_struct,FALSE) */ lispval next_one(type_struct) struct types *type_struct; { register char *temp; snpand(1); while(type_struct->next_free == (char *) CNIL) { int g; if((type_struct->type != ATOM) && /* can't collect atoms */ (type_struct->type != STRNG) && /* can't collect strings */ (type_struct->type != BCD) && /* nor function headers */ (gcthresh->i <= current) && /* threshhold for gc */ gcdis->a.clb == nil && /* gc not disabled */ (NOTNIL(copval(gcload,CNIL)) || (loading->a.clb != tatom)) && /* not to collect during load */ (initflag == FALSE) && /* dont gc during init */ (gcflag == FALSE)) /* don't recurse gc */ { /* fputs("Collecting",poport); dmpport(poport);*/ gc(type_struct); /* collect */ } if( type_struct->next_free != (char *) CNIL ) break; if(! (g=get_more_space(type_struct,FALSE))) break; if( g==1 ) { plimit->i = current+NUMSPACES; /* allow a few more pages */ copval(plima,plimit); /* restore to reserved reg */ error("PAGE LIMIT EXCEEDED--EMERGENCY PAGES ALLOCATED", TRUE); } else error("SORRY, ABSOLUTE PAGE LIMIT HAS BEEN REACHED", TRUE); } temp = type_struct->next_free; type_struct->next_free = * (char **)(type_struct->next_free); return((lispval) temp); } /* allocate an element of a pure structure. Pure structures will * be ignored by the garbage collector. */ lispval next_pure_one(type_struct) struct types *type_struct; { register char *temp; snpand(1); while(type_struct->next_pure_free == (char *) CNIL) { int g; if(! (g=get_more_space(type_struct,TRUE))) break; if( g==1 ) { plimit->i = current+NUMSPACES; /* allow a few more pages */ copval(plima,plimit); /* restore to reserved reg */ error("PAGE LIMIT EXCEEDED--EMERGENCY PAGES ALLOCATED", TRUE); } else error("SORRY, ABSOLUTE PAGE LIMIT HAS BEEN REACHED", TRUE); } temp = type_struct->next_pure_free; type_struct->next_pure_free = * (char **)(type_struct->next_pure_free); return((lispval) temp); } lispval newint() { ++(int_items->i); return(next_one(&int_str)); } lispval pnewint() { return(next_pure_one(&int_str)); } lispval newdot() { lispval temp; ++(dtpr_items->i); temp = next_one(&dtpr_str); temp->d.car = temp->d.cdr = nil; return(temp); } lispval pnewdot() { lispval temp; temp = next_pure_one(&dtpr_str); temp->d.car = temp->d.cdr = nil; return(temp); } lispval newdoub() { ++(doub_items->i); return(next_one(&doub_str)); } lispval pnewdoub() { return(next_pure_one(&doub_str)); } lispval newsdot() { register lispval temp; ++(sdot_items->i); temp = next_one(&sdot_str); temp->d.car = temp->d.cdr = 0; return(temp); } lispval pnewsdot() { register lispval temp; temp = next_pure_one(&sdot_str); temp->d.car = temp->d.cdr = 0; return(temp); } struct atom * newatom() { struct atom *save; ++(atom_items->i); save = (struct atom *) next_one(&atom_str) ; save->plist = save->fnbnd = nil; save->hshlnk = (struct atom *)CNIL; save->clb = CNIL; save->pname = newstr(); return (save); } char *newstr() { char *save; int atmlen2,atmlen; ++(str_items->i); atmlen = strlen(strbuf)+1; if(atmlen > strng_str.space_left) while(get_more_space(&strng_str,FALSE)) error("YOU HAVE RUN OUT OF SPACE",TRUE); strcpy((save = strng_str.next_free), strbuf); atmlen2 = atmlen; while(atmlen2 & 3) ++atmlen2; /* even up length of string */ strng_str.next_free += atmlen2; strng_str.space_left -= atmlen2; return(save); } char *inewstr(s) char *s; { strbuf[STRBLEN-1] = '\0'; strcpyn(strbuf,s,STRBLEN-1); return(newstr()); } lispval newarray() { register lispval temp; ++(array_items->i); temp = next_one(&array_str); temp->ar.data = (char *)nil; temp->ar.accfun = nil; temp->ar.aux = nil; temp->ar.length = SMALL(0); temp->ar.delta = SMALL(0); return(temp); } /* * Ipurep :: routine to check for pureness of a data item * */ lispval Ipurep(element) lispval element; { if(purepage[(int)element >> 9]) return(tatom) ; else return(nil); } /* routines to return space to the free list. These are used by the * arithmetic routines which tend to create large intermediate results * which are know to be garbage after the calculation is over. * * There are jsb callable versions of these routines in qfuncl.s */ /* pruneb - prune bignum. A bignum is an sdot followed by a list of * dtprs. The dtpr list is linked by car instead of cdr so when we * put it in the free list, we have to change the links. */ pruneb(bignum) lispval bignum; { /* the error messages in this routine shouldn't print out the * value since it is probably junk */ register lispval temp, save; --(sdot_items->i); if(TYPE(bignum) != SDOT) errorh(Vermisc,"value to pruneb not a sdot",nil,FALSE,0,bignum); bignum->s.I = (int) sdot_str.next_free; sdot_str.next_free = (char *) bignum; if((save = bignum->s.CDR) != nil) { for(temp = save ; temp != nil ; temp = temp->d.car) { if(TYPE(temp) != DTPR) errorh(Vermisc,"value to pruneb not a list", nil,FALSE,0,temp); --(dtpr_items->i); temp->d.cdr = temp->d.car; if(temp->d.cdr == nil) { temp->d.cdr = (lispval) dtpr_str.next_free; dtpr_str.next_free = (char *)save; break; } } } } lispval badcall() { error("BAD FUNCTION DESCRIPTOR USED IN CALL",FALSE); } lispval newfunct() { register lispval temp; ++(funct_items->i); temp = next_one(&funct_str); temp->bcd.entry = badcall; temp->bcd.discipline = nil; return(temp); } lispval newval() { register lispval temp; ++(val_items->i); temp = next_one(&val_str); temp->l = nil; return(temp); } lispval pnewval() { register lispval temp; temp = next_pure_one(&val_str); temp->l = nil; return(temp); } lispval newhunk(hunknum) int hunknum; { register lispval temp; ++(hunk_items[hunknum]->i); /* Update used hunks count */ temp = next_one(&hunk_str[hunknum]); /* Get a hunk */ return(temp); } lispval pnewhunk(hunknum) int hunknum; { register lispval temp; temp = next_pure_one(&hunk_str[hunknum]); /* Get a hunk */ return(temp); } lispval inewval(arg) lispval arg; { lispval temp; ++(val_items->i); temp = next_one(&val_str); temp->l = arg; return(temp); } /** Ngc *****************************************************************/ /* */ /* LISP interface to gc. */ lispval Ngc() { lispval temp; if( ISNIL(lbot->val) ) return(gc(CNIL)); if( TYPE(lbot->val) != DTPR ) error("BAD CALL TO GC",FALSE); chkport = poport; if( NOTNIL(lbot->val->d.car) ) { temp = eval(lbot->val->d.car); if( TYPE(temp) == PORT ) chkport = temp->p; } gc1(TRUE); return(nil); } /** gc(type_struct) *****************************************************/ /* */ /* garbage collector: Collects garbage by mark and sweep algorithm. */ /* After this is done, calls the Nlambda, gcafter. */ /* gc may also be called from LISP, as a lambda of no arguments. */ lispval gc(type_struct) struct types *type_struct; { lispval save; struct { long mytime; long allelse[3]; } begin, finish; extern int GCtime; save = copval(gcport,CNIL); if(GCtime) times(&begin); while( (TYPE(save) != PORT) && NOTNIL(save)) save = error("NEED PORT FOR GC",TRUE); chkport = (ISNIL(save) ? poport : save->p); gc1(NOTNIL(copval(gccheck,CNIL)) || (chkport!=poport)); /* mark&sweep */ /* Now we call gcafter--special case if gc called from LISP */ if( type_struct == (struct types *) CNIL ) gccall1->d.cdr = nil; /* make the call "(gcafter)" */ else { gccall1->d.cdr = gccall2; gccall2->d.car = *(type_struct->type_name); } {lispval temp;temp = rdrsdot, rdrsdot = rdrsdot2, rdrsdot2 = temp; /*KLUDGE*/} gcflag = TRUE; /* flag to indicate in garbage collector */ save = eval(gccall1); /* call gcafter */ gcflag = FALSE; /* turn off flag */ {lispval temp;temp = rdrsdot, rdrsdot = rdrsdot2, rdrsdot2 = temp; /*KLUDGE*/} if(GCtime) { times(&finish); GCtime += (finish.mytime - begin.mytime); } return(save); /* return result of gcafter */ } /* gc1() **************************************************************/ /* */ /* Mark-and-sweep phase */ gc1(chkflag) int chkflag; { int j, typep,k; register int *start,bvalue,type_len; register struct types *s; int *point,i,freecnt,itemstogo,bits,bindex,type,enddat; int bytestoclear; char *pindex; struct heads *loop; struct argent *loop2; struct nament *loop3; struct atom *symb; int markdp(); extern int hashtop; int debugin = FALSE; /* temp debug flag */ #define ERDB(s) { printf(s); fflush(stdout); } #ifndef UNIXTS vadvise(VA_ANOM); /* decide whether to check LISP structure or not */ #endif #ifdef METER vtimes(&premark,0); markdpcount = 0; conssame = consdiff = consnil = 0; #endif /* first set all bit maps to zero */ if(debugin) ERDB("Begin gc\n"); /* enddat = (int)datalim >> 8; for(bvalue=0; bvalue < (int)enddat ; ++bvalue) { bitmapq[bvalue] = zeroq; } */ /* try the movc5 to clear the bit maps */ /* the maximum number of bytes we can clear in one sweep is * 2^16 (or 1<<16 in the C lingo) */ bytestoclear = ((((int)datalim)-((int)beginsweep)) >> 9) * 16; if(bytestoclear > MAXCLEAR) { blzero(((int)&bitmapi[((int)beginsweep>>7)]) + MAXCLEAR, bytestoclear - M((AXCLEAR); bytestoclear = MAXCLEAR; } blzero(&bitmapi[((int)beginsweep)>>7],bytestoclear); /* mark all atoms in the oblist */ for( bvalue=0 ; bvalue <= hashtop-1 ; bvalue++ ) /* though oblist */ { for( symb = hasht[bvalue] ; symb != (struct atom *) CNIL ; symb = symb-> hshlnk) markdp(symb); } /* Mark all the atoms and ints associated with the hunk data types */ for(i=0; i<8; i++) { markdp(hunk_items[i]); markdp(hunk_name[i]); markdp(hunk_pages[i]); } /* next run up the name stack */ if(debugin) ERDB("name stack\n"); for(loop2 = np - 1; loop2 >= orgnp; --loop2) MARKVAL(loop2->val); /* now the bindstack (vals only, atoms are marked elsewhere ) */ for(loop3 = bnp - 1; loop3 >= orgbnp; --loop3)MARKVAL(loop3->val); if(debugin) ERDB("compiler stuff\n"); /* from TBL 29july79 */ /* next mark all compiler linked data */ /* dont mark these, they are pure *point = bind_lists; *while((start = point) != (int *)CNIL) { * if(debugin) ERDB("once "); * while( *start != -1 ) * { * markdp(*start); * start++; * } * point = (int *)*(point-1); *} */ /* end from TBL */ if(debugin) ERDB("signif stuff\n"); /* next mark all system-significant lisp data */ for(i=0; iitems))->i = 0; s->space_left = 0; s->next_free = (char *) CNIL; } } /* sweep up in memory looking at gcable pages */ for(start = beginsweep, bindex = (int)start >> 7, pindex = &purepage[(int)start>>9]; start < (int *)datalim; start += 128, pindex++) { /* printf(" start %x, bindex %x\n",start,bindex); */ if(!(s=gcableptr[type = TYPE(start)]) || *pindex) { bindex += 4; /* and 4 words of 32 bit bitmap words */ continue; } freecnt = 0; /* number of free items found */ point = start; /* sweep dtprs as a special case, since * 1) there will (usually) be more dtpr pages than any other type * 2) most dtpr pages will be empty so we can really win by special * caseing the sweeping of massive numbers of free cells */ /* since sdot's have the same structure as dtprs, this code will work for them too */ if((type == DTPR) || (type == SDOT)) { int *head,*lim; head = (int *) s->next_free; /* first value on free list*/ for(i=0; i < 4; i++) /* 4 bit map words per page */ { bvalue = bitmapi[bindex++]; /* 32 bits = 16 dtprs */ if(bvalue == 0) /* if all are free */ { *point = (int)head; lim = point + 32; /* 16 dtprs = 32 ints */ for(point += 2; point < lim ; point += 2) { *point = (int)(point - 2); } head = point - 2; freecnt += 16; } else for(j = 0; j < 16 ; j++) { if(!(bvalue & 1)) { freecnt++; *point = (int)head; head = point; } #ifdef METER /* check if the page address of this cell is the * same as the address of its cdr */ else if(FALSE && gcstat && (type == DTPR)) { if(((int)point & ~511) == ((int)(*point) & ~511)) conssame++; else consdiff++; } #endif point += 2; bvalue = bvalue >> 2; } } s->next_free = (char *) head; } else { /* general sweeper, will work for all types */ itemstogo = s->space; /* number of items per page */ bits = 32; /* number of bits per word */ type_len = s->type_len; /* printf(" s %d, itemstogo %d, len %d\n",s,itemstogo,type_len);*/ bvalue = bitmapi[bindex++]; while(TRUE) { /*printf(" bv: %08x, ",bvalue);*/ if(!(bvalue & 1)) /* if data element is not marked */ { freecnt++; *point = (int) (s->next_free) ; s->next_free = (char *) point; } if( --itemstogo <= 0 ) { if(type_len >= 64) { bindex++; if(type_len >=128) bindex += 2; } break; } point += type_len; /* shift over mask by number of words in data type */ if( (bits -= type_len) > 0) { bvalue = bvalue >> type_len; } else if( bits == 0 ) { bvalue = bitmapi[bindex++]; bits = 32; } else { bits = -bits; while( bits >= 32) { bindex++; bits -= 32; } bvalue = bitmapi[bindex++]; bvalue = bvalue >> bits; bits = 32 - bits;; } } } /* printf(" t %d,fr %d ",type,freecnt); */ s->space_left += freecnt; (*(s->items))->i += s->space - freecnt; } #ifdef METER vtimes(&alldone,0); if(gcstat) gcdump(); #endif #ifndef UNIXTS vadvise(VA_NORM); #endif } /** alloc() *************************************************************/ /* */ /* This routine tries to allocate one more page of the space named */ /* by the argument. If no more space is available returns 1, else 0. */ lispval alloc(tname,npages) lispval tname; int npages; { int ii, jj; ii = typenum(tname); if(((int)datalim >> 9) + npages > TTSIZE) error("Space request would exceed maximum memory allocation",FALSE); for( jj=0; jjtype_len; /* find c-length of space */ nitems = roundup(nitems,512); /* round up to right length */ #ifdef HOLE if((tname==str_name) && useholeflag) charadd = gethspace(nitems,ii); else #endif { current += nitems/512; charadd = sbrk(nitems); datalim = (lispval)(charadd+nitems); } if( (int) charadd == 0 ) error("NOT ENOUGH SPACE FOR ARRAY",FALSE); if((((int)datalim) >> 9) > fakettsize) { datalim = (lispval) (fakettsize << 9); if(fakettsize >= TTSIZE) { printf("There isn't room enough to continue, goodbye\n"); franzexit(1); } fakettsize++; badmem(53); } for(jj=0; jjtype); } blzero(charadd,nitems); return((lispval)charadd); } int csizeof(tname) lispval tname; { return( spaces[typenum(tname)]->type_len * 4 ); } int typenum(tname) lispval tname; { int ii; chek: for(ii=0; iitype_name)) break; if(ii == NUMSPACES) { tname = error("BAD TYPE NAME",TRUE); goto chek; } return(ii); } char * gethspace(segsiz,type) { extern usehole; extern char holend[]; extern char *curhbeg; register char *value; if(usehole) { curhbeg = (char *) roundup(((int)curhbeg),NBPG); if((holend - curhbeg) < segsiz) { printf("[fasl hole filled up]\n"); usehole = FALSE; } else { value = curhbeg; curhbeg = curhbeg + segsiz; /*printf("start %d, finish %d, size %d\n",value, curhbeg,segsiz);*/ return(value); } } value = (ysbrk(segsiz/NBPG,type)); datalim = (lispval)(value + segsiz); return(value); } gcrebear() { int i; #ifdef HOLE /* this gets done upon rebirth */ strng_str.space_left = 0; funct_str.space_left = 0; funct_str.next_free = (char *) CNIL; /* clear pure space pointers */ for(i = 0; i < NUMSPACES; i++) { spaces[i]->next_pure_free = (char *) CNIL; } #endif } /** markit(p) ***********************************************************/ /* just calls markdp */ markit(p) lispval *p; { markdp(*p); } /** markdp(p) ***********************************************************/ /* */ /* markdp is the routine which marks each data item. If it is a */ /* dotted pair, the car and cdr are marked also. */ /* An iterative method is used to mark list structure, to avoid */ /* excessive recursion. */ markdp(p) register lispval p; { /* register int r, s; (goes with non-asm readbit, oksetbit) */ /* register hsize, hcntr; */ int hsize, hcntr; #ifdef METER markdpcount++; #endif ptr_loop: if(p <= (lispval) 0) return; /* do not mark special data types or nil=0 */ switch( TYPE(p) ) { case ATOM: ftstbit; MARKVAL(p->a.clb); MARKVAL(p->a.plist); MARKVAL(p->a.fnbnd); return; case INT: case DOUB: ftstbit; return; case VALUE: ftstbit; p = p->l; goto ptr_loop; case DTPR: ftstbit; MARKVAL(p->d.car); #ifdef METER /* if we are metering , then check if the cdr is * nil, or if the cdr is on the same page, and if * it isn't one of those, then it is on a different * page */ if(gcstat) { if(p->d.cdr == nil) consnil++; else if(((int)p & ~511) == (((int)(p->d.cdr)) & ~511)) conssame++; else consdiff++; } #endif p = p->d.cdr; goto ptr_loop; case ARRAY: ftstbit; /* mark array itself */ MARKVAL(p->ar.accfun); /* mark access function */ MARKVAL(p->ar.aux); /* mark aux data */ MARKVAL(p->ar.length); /* mark length */ MARKVAL(p->ar.delta); /* mark delta */ if(TYPE(p->ar.aux)==DTPR && p->ar.aux->d.car==Vnogbar) { /* a non garbage collected array must have its * array space marked but the value of the array * space is not marked */ int l; int cnt,d; l = p->ar.length->i; /* number of elements */ d = p->ar.delta->i; /* bytes per element */ for(cnt = 0, p=(lispval)(p->ar.data) ; cntar.data; */ int i,l,d; char *dataptr = p->ar.data; for(i=0, l=p->ar.length->i, d=p->ar.delta->i; is.CDR; } while (p!=0); return; case BCD: ftstbit; markdp(p->bcd.discipline); return; case HUNK2: case HUNK4: case HUNK8: case HUNK16: case HUNK((32: case HUNK64: case HUNK128: { hsize = 2 << HUNKSIZE(p); ftstbit; for (hcntr = 0; hcntr < hsize; hcntr++) MARKVAL(p->h.hunk[hcntr]); return; } } return; } /* xsbrk allocates space in large chunks (currently 16 pages) * xsbrk(1) returns a pointer to a page * xsbrk(0) returns a pointer to the next page we will allocate (like sbrk(0)) */ char * xsbrk(n) { static char *xx; /* pointer to next available blank page */ extern int xcycle; /* number of blank pages available */ lispval u; /* used to compute limits of bit table */ if( (xcycle--) <= 0 ) { xcycle = 15; xx = sbrk(16*NBPG); /* get pages 16 at a time */ if( (int)xx== -1 ) lispend("For sbrk from lisp: no space... Goodbye!"); } else xx += NBPG; if(n == 0) { xcycle++; /* don't allocate the page */ xx -= NBPG; return(xx); /* just return its address */ } if( (u = (lispval)(xx+NBPG)) > datalim ) datalim = u; return(xx); } char *ysbrk(pages,type) int pages, type; { char *xx; /* will point to block of storage */ int i; xx = sbrk(pages*NBPG); if((int)xx == -1) error("OUT OF SPACE FOR ARRAY REQUEST",FALSE); datalim = (lispval)(xx+pages*NBPG); /* compute bit table limit */ /* set type for pages */ for(i = 0; i < pages; ++i) { SETTYPE((xx + i*NBPG),type); } return(xx); /* return pointer to block of storage */ } #ifdef VMS /* sbrk - * this function is used by the VMS franz to allocate space. * It allocates space in the zfreespace array. * The single argument passed to sbrk is the number of bytes to allocate * */ extern char zfreespace[]; extern char *lsbrkpnt; char * sbrk(n) { char *result; if(lsbrkpnt == (char *)0) { lsbrkpnt = (char *) roundup((int)zfreespace,NBPG); } result = lsbrkpnt; /* printf("lispbrk: %x \n",lsbrkpnt); fflush(stdout); */ lsbrkpnt += n; if(lsbrkpnt > &zfreespace[FREESIZE]) error("sbrk: out of space ",FALSE); return(result); } #endif /* getatom **************************************************************/ /* returns either an existing atom with the name specified in strbuf, or*/ /* if the atom does not already exist, regurgitates a new one and */ /* returns it. */ lispval getatom() { register lispval aptr; register char *name, *endname; register int hash; register struct argent *lbot, *np; lispval b; char c; name = strbuf; if (*name == (char)0377) return (eofa); hash = hashfcn(name); atmlen = strlen(name) + 1; aptr = (lispval) hasht[hash]; while (aptr != CNIL) if (strcmp(name,aptr->a.pname)==0) return (aptr); else aptr = (lispval) aptr->a.hshlnk; aptr = (lispval) newatom(); aptr->a.hshlnk = hasht[hash]; hasht[hash] = (struct atom *) aptr; endname = name + atmlen - 2; if ((atmlen != 4) && (*name == 'c') && (*endname == 'r')) { b = newdot(); protect(b); b->d.car = lambda; b->d.cdr = newdot(); b = b->d.cdr; b->d.car = newdot(); (b->d.car)->d.car = xatom; while(TRUE) { b->d.cdr = newdot(); b= b->d.cdr; if(++name == endname) { b->d.car= (lispval) xatom; aptr->a.fnbnd = unprot(); break; } b->d.car= newdot(); b= b->d.car; if((c = *name) == 'a') b->d.car = cara; else if (c == 'd') b->d.car = cdra; else{ unprot(); break; } } } return(aptr); } /* our hash function */ hashfcn(symb) char *symb; { register int i; for (i=0 ; *symb ; i += i + *symb++); return(i & (HASHTOP-1)); } extern struct atom *hasht[HASHTOP]; #ifdef VMS vadvise(){} #endif b->d.cdr; if(++name == endname) { b->d.car= (lispval) xatom; aptr->a.fnbnd = unprot(); break; } b->d.car= newdot(); b= b->d.car; if((c = *name) == 'a') b->d.car = cara; else if (c == 'd') b->d.car = cdra; else{ unprot(); break; } } } return(aptr); } /* our hash function */ hashfcn(symb) char *symb; { register int i; for (i=0 ; *symb ; i += i + *symb++); return(i & (HASHTOP-1)); } extern struct atom *hasht[HASHTOP]; #ifdecmd/lisp/franz/bigmath.s 644 0 12 24320 2552701414 10502 .asciz "@(#)bigmath.s 35.2 5/19/81" .globl _dmlad # # routine for destructive multiplication and addition to a bignum by # two fixnums. # # from C, the invocation is dmlad(sdot,mul,add); # where sdot is the address of the first special cell of the bignum # mul is the multiplier, add is the fixnum to be added (The latter # being passed by value, as is the usual case. # # # Register assignments: # # r11 = current sdot # r10 = carry # r9 = previous sdot, for relinking. # _dmlad: .word 0x0e00 movl 4(ap),r11 #initialize cell pointer movl 12(ap),r10 #initialize carry loop: emul 8(ap),(r11),r10,r0 #r0 gets cell->car times mul + carry # ediv $0x40000000,r0,r10,(r11)#cell->car gets prod % 2**30 # #carry gets quotient extzv $0,$30,r0,(r11) extv $30,$32,r0,r10 movl r11,r9 #save last cell for fixup at end. movl 4(r11),r11 #move to next cell bneq loop #done indicated by 0 for next sdot tstl r10 #if carry zero no need to allocate beql done #new bigit mcoml r10,r3 #test to see if neg 1. bneq alloc #if not must allocate new cell. tstl (r9) #make sure product isn't -2**30 beql alloc movl r0,(r9) #save old lower half of product. brb done alloc: jsb _qnewdot #otherwise allocate new bigit movl r10,(r0) #store carry movl r0,4(r9) #save new link cell done: movl 4(ap),r0 ret .globl _dodiv # # routine to destructively divide array representation of a bignum by # 1000000000 # # invocation: # remainder = dodiv(top,bottom) # int *top, *bottom; # where *bottom is the address of the biggning of the array, *top is # the top of the array. # # register assignments: # r0 = carry # r1 & r2 = 64bit temporary # r3 = pointer # _dodiv: .word 0 clrl r0 #no carry to begin. movl 8(ap),r3 #get pointer to array. loop2: emul $0x40000000,r0,(r3),r1 ediv $1000000000,r1,(r3),r0 acbl 4(ap),$4,r3,loop2 ret .globl _dsneg # # dsneg(top, bot); # int *top, *bot; # # routine to destructively negate a bignum stored in array format # lower order stuff at higher addresses. It is assume that the # result will be positive. # _dsneg: .word 0 movl 4(ap),r1 #load up address. clrl r2 #set carry loop3: mnegl (r1),r0 #negate and take carry into account. addl2 r2,r0 extzv $0,$30,r0,(r1) extv $30,$2,r0,r2 acbl 8(ap),$-4,r1,loop3 #decrease r1, and branch back if appropriate. ret # bignum add routine # basic data representation is each bigit is a positive number # less than 2^30, except for the leading bigit, which is in # the range -2^30 < x < 2^30. .globl _adbig .globl Bexport .globl backfr # # Initialization section # _adbig: .word 0x0fc0 #save registers 6-11 movl 4(ap),r1 #arg1 = addr of 1st bignum movl 8(ap),r2 #arg2 = addr of 2nd bignum clrl r5 #r5 = carry movl $0xC0000000,r4 #r4 = clear constant. movl sp,r10 #save start address of bignum on stack. #note well that this is 4 above the actual #low order word. # # first loop is to waltz through both bignums adding # bigits, pushing them onto stack. # loop4: addl3 (r1),(r2),r0 #add bigits addl2 r5,r0 #add carry bicl3 r4,r0,-(sp) #save sum, no overflow possible extv $30,$2,r0,r5 #sign extend two high order bits #to be next carry. movl 4(r1),r1 #get cdr bleq out1 #negative indicates end of list. movl 4(r2),r2 #get cdr of second bignum bgtr loop4 #if neither list at end, do it again # # second loop propagates carries through higher order words. # It assumes remaining list in r1. # loop5: addl3 (r1),r5,r0 #add bigits and carry bicl3 r4,r0,-(sp) #save sum, no overflow possible extv $30,$2,r0,r5 #sign extend two high order bits #to be next carry. movl 4(r1),r1 #get cdr out2: bgtr loop5 #negative indicates end of list. out2a: pushl r5 # # suppress unnecessary leading zeroes and -1's # iexport:movl sp,r11 #more set up for output routine ckloop: Bexport:tstl (r11) #look at leading bigit bgtr copyit #if positive, can allocate storage etc. blss negchk #if neg, still a chance we can get by cmpl r11,r10 #check to see that bgeq copyit #we don't pop everything off of stack tstl (r11)+ #incr r11 brb ckloop #examine next negchk: mcoml (r11),r3 #r3 is junk register bneq copyit #short test for -1 tstl 4(r11) #examine next bigit beql copyit #if zero must must leave as is. cmpl r11,r10 #check to see that bgeq copyit #we don't pop everything off of stack tstl (r11)+ #incr r11 bisl2 r4,(r11) #set high order two bits brb negchk #try to supress more leading -1's # # The following code is an error exit from the first loop # and is out of place to avoid a jump around a jump. # out1: movl 4(r2),r1 #get next addr of list to continue. brb out2 #if second list simult. exhausted, do #right thing. # # loop6 is a faster version of loop5 when carries are no # longer necessary. # loop6a: pushl (r1) #get datum loop6: movl 4(r1),r1 #get cdr bgtr loop6a #if not at end get next cell brb out2a # # create linked list representation of bignum # copyit: subl3 r11,r10,r2 #see if we can get away with allocating an int bneq on1 #test for having popped everything subl3 $4,r10,r11 #if so, fix up pointer to bottom brb intout #and allocate int. on1: cmpl r2,$4 #if = 4, then can do beql intout calls $0,_newsdot #get new cell for new bignum backfr: movl r0,(r6)+ #push address of cell on #arg stack to save from garbage collection. #There is guaranteed to be slop for a least one #push without checking. loop7: movl -(r10),(r0) #save bigit movl r0,r9 #r9 = old cell, to link cmpl r10,r11 #have we copy'ed all the bigits? bleq Edone jsb _qnewdot #get new cell for new bignum movl r0,4(r9) #link new cell to o((ld brb loop7 Edone: clrl 4(r9) #indicate end of list with 0 movl -(r6),r0 #give resultant address. ret # # export integer # intout: pushl (r11) calls $1,_inewint ret .globl _mulbig # # bignum multiplication routine # # Initialization section # _mulbig:.word 0x0fc0 #save regs 6-11 movl 4(ap),r1 #get address of first bignum movl sp,r11 #save top of 1st bignum mloop1: pushl (r1) #get bigit movl 4(r1),r1 #get cdr bgtr mloop1 #repeat if not done movl sp,r10 #save bottom of 1st bignum, top of 2nd bignum movl 8(ap),r1 #get address of 2nd bignum mloop2: pushl (r1) #get bigit movl 4(r1),r1 #get cdr bgtr mloop2 #repeat if not done movl sp,r9 #save bottom of 2nd bignum subl3 r9,r11,r6 #r6 contains sum of lengths of bignums subl2 r6,sp movl sp,r8 #save bottom of product bignum # # Actual multiplication # m1: movc5 $0,(r8),$0,r6,(r8)#zap out stack space movl r9,r7 #r7 = &w[j +n] (+4 for a.d.) through calculation subl3 $4,r10,r4 #r4 = &v[j] m3: movl r7,r5 #r7 = &w[j+n] subl3 $4,r11,r3 #r3 = &u[i] clrl r2 #clear carry. m4: addl2 -(r5),r2 #add w[i + j] to carry (no ofl poss) emul (r3),(r4),r2,r0 #r0 = u[i] * v[j] + sext(carry) extzv $0,$30,r0,(r5) #get new bigit extv $30,$32,r0,r2 #get new carry m5: acbl r10,$-4,r3,m4 #r3 =- 4; if(r3 >= r10) goto m4; r10 = &[u1]; movl r2,-(r5) #save w[j] = carry m6: subl2 $4,r7 #add just &w[j+n] (+4 for autodec) acbl r9,$-4,r4,m3 #r4 =- 4; if(r4>=r9) goto m5; r9 = &v[1] movl r9,r10 #set up for output routine movl $0xC0000000,r4 #r4 = clear constant. movq 20(fp),r6 #restor _np and _lbot ! brw iexport #do it! # # The remainder of this file are routines used in bignum division. # Interested parties should consult Knuth, Vol 2, and divbig.c. # These files are here only due to an optimizer bug. # .align 1 .globl _calqhat _calqhat: .word .R1 movl 4(ap),r11 movl 8(ap),r10 movl $0x3fffffff,r0 cmpl (r10),(r11) beql on3 emul (r11),$0x40000000,4(r11),r1 ediv (r10),r1,r0,r5 on3: emul r0,4(r10),$0,r1 emul r5,$0x40000000,8(r11),r3 subl2 r3,r1 sbwc r4,r2 bleq out4 decl r0 out4: ret .set .R1,0xc00 .align 1 .globl _mlsb _mlsb: .word .R2 movl 4(ap),r11 movl 8(ap),r10 movl 12(ap),r9 movl 16(ap),r8 clrl r0 loop8: addl2 (r11),r0 emul r8,-(r9),r0,r2 extzv $0,$30,r2,(r11) extv $30,$32,r2,r0 acbl r10,$-4,r11,loop8 ret .set .R2,0xf00 .align 1 .globl _adback _adback: .word .R3 movl 4(ap),r11 movl 8(ap),r10 movl 12(ap),r9 clrl r0 loop9: addl2 -(r9),r0 addl2 (r11),r0 extzv $0,$30,r0,(r11) extv $30,$2,r0,r0 acbl r10,$-4,r11,loop9 ret .set .R3,0xe00 .align 1 .globl _dsdiv _dsdiv: .word .R4 movl 8(ap),r11 clrl r0 loopa: emul r0,$0x40000000,(r11),r1 ediv 12(ap),r1,(r11),r0 acbl 4(ap),$4,r11,loopa ret .set .R4,0x800 .align 1 .globl _dsmult _dsmult: .word .R5 movl 4(ap),r11 clrl r0 loopb: emul 12(ap),(r11),r0,r1 extzv $0,$30,r1,(r11) extv $30,$32,r1,r0 acbl 8(ap),$-4,r11,loopb movl r1,4(r11) ret .set .R5,0x800 .align 1 .globl _export _export: .word .R6 movl 8(ap),r11 movl 4(ap),r10 movl $0xC0000000,r4 jmp Bexport ret .set .R6,0xfc0 .align 1 .globl _dsrsh _dsrsh: .word .R7 movl 8(ap),r11 # bot movl 16(ap),r5 # mask movl 12(ap),r4 # shift count clrl r0 1: emul r0,$0x40000000,(r11),r1 bicl3 r5,r1,r0 ashq r4,r1,r1 movl r1,(r11) acbl 4(ap),$4,r11,1b ret .set .R7,0x800 .align 1 .globl _dsadd1 _dsadd1: .word .R8 movl 4(ap),r11 movl $1,r0 1: emul $1,(r11),r0,r1 extzv $0,$30,r1,(r11) extv $30,$32,r1,r0 acbl 8(ap),$-4,r11,1b movl r1,4(r11) ret .set .R8,0x800 # # myfrexp (value, exp, hi, lo) # double value; # int *exp, *hi, *lo; # # myfrexp returns three values, exp, hi, lo, # Such that value = 2**exp*tmp, where tmp = (hi*2**-23+lo*2**-53) # is uniquely determined subect to .5< abs(tmp) <= 1.0 # # # Entry point # .text .globl _myfrexp _myfrexp: .word 0x0000 # We use r2, but do not save it clrl *12(ap) # Make for easy exit later clrl *16(ap) # clrl *20(ap) # movd 4(ap),r0 # Fetch "value" bneq 1f # if zero return zero exponent + mantissa ret 1: extzv $7,$8,r0,r2 # r2 := biased exponent movab -129(r2),*12(ap)# subtract bias, store exp insv $154,$7,$8,r0 # lie about exponent to get out # high 24 bits easily with emodd. # This instruction does the following: # # Extend the long floating value in r0 with 0, and # multiply it by 1.0. Store the integer part of the result # in hi, and the fractional part of the result in r0-r1. # emodd r0,$0,$0f1.0,*16(ap),r0 # How did you like # THAT, sports fans? [jfr's comment] tstd r0 # if zero, exit; bneq 1f ret 1: insv $158,$7,$8,r0 # lie about exponent to get out # next 30 bits easily with emodd. # (2^29 takes 30 bits). emodd r0,$0,$0f1.0,*20(ap),r0 # Get last bits out likewise! ret # (r0 should be zero by now!) ong floating value in r0 with 0, and # multiply it by 1.0. Store the integer part of the result # in hi, and the fractional part of the result in r0-r1. # emodd r0,$0,$0f1.0,*16(ap),r0 # How did you like # THAT, sports fans? [jfr's comment] tstd r0 # if zero, exit; bneq 1f ret 1: insv $15cmd/lisp/franz/bind.c 444 2 33 7427 2512604010 7745 static char *sccsid = "@(#)bind.c 34.1 10/3/80"; #include "global.h" #include "a.out.h" #define STRLIM 1024 static lispval mkptr(); static struct exec header; static struct nlist nlist; static lispval *linkaddr; static int *bindaddr; static int fildes; static lispval currtab; static lispval curibase; extern int fvirgin; extern int initflag; lispval Lbind(){ register struct argent *mlbot = lbot; register lispval work; char *sbrk(), *tfile, cbuf[512], *mytemp(), *gstab(); snpand(2); strcpy(cbuf, gstab()); printf("getting symbol table from %s\n",cbuf); fflush(stdout); if((fildes = open(cbuf,0))<0) return(nil); /* * Read a.out header to find out where symbol table is. */ if(read(fildes,(char *)&header,sizeof(header)) <= 0) { close(fildes); return(nil); } lseek(fildes, header.a_text+header.a_data+header.a_trsize +header.a_drsize, 1); currtab = Vreadtable->a.clb; Vreadtable->a.clb = strtab; curibase = ibase->a.clb; ibase->a.clb = inewint(10); while((sizeof nlist)==read(fildes,&nlist,sizeof nlist)) { if( nlist.n_name[0]!='.' || nlist.n_name[1]!='.') continue; linkaddr = (lispval *)*(int *)nlist.n_value; bindaddr = (int *)*(int *)(nlist.n_value+sizeof(int)); do_linker(); do_binder(); } ibase->a.clb = curibase; Vreadtable->a.clb = currtab; return(tatom); } static do_linker() { register int *i, *end, temp; char array[STRLIM]; extern lispval *bind_lists; /* first link this linkage table to the garbage collector's list. We will try to be tricky so that if the garbage collector is invoked by mkptr we will not cause markdp() to go off the deep end. */ *(linkaddr-1) = (lispval) bind_lists; bind_lists = linkaddr; i = (int *)linkaddr; initflag = TRUE; for(; *i!=-1; i++) { temp = *i; *i = -1; /* clobber to short circuit gc */ findstr(temp, array); *i = (int)mkptr(array); } initflag = FALSE; } static do_binder() { char array[STRLIM]; register lispval handy; struct binder {lispval (*b_entry)(); int b_atmlnk; int b_type;} bindage, *pos; pos = (struct binder *)bindaddr; initflag = TRUE; for(bindage= *pos++; bindage.b_atmlnk!=-1; bindage = *pos++) { if( bindage.b_type == 99) { struct argent *olbot; /* we must evaluate this form for effect */ findstr(bindage.b_atmlnk, array); /* garbage collection appears to cause problems at this point */ /* if(ISNIL(copval(gcload,CNIL)) && loading->a.clb != tatom) gc(CNIL); /* do a gc if gc will be off */ handy = mkptr(array); olbot = lbot; lbot = np; ibase->a.clb=curibase; Vreadtable->a.clb = currtab; (np++)->val = handy; Leval(); Vreadtable->a.clb = strtab; curibase = ibase->a.clb; ibase->a.clb = inewint(10); np = lbot; lbot = olbot; } else { handy = newfunct(); handy->bcd.entry = bindage.b_entry; handy->bcd.discipline = (bindage.b_type == 0 ? lambda : bindage.b_type == 1 ? nlambda : macro); findstr(bindage.b_atmlnk, array); protect(handy); mkptr(array)->a.fnbnd = handy; } } initflag = FALSE; } static findstr(ptr,array) int ptr; char *array; { int cnt = 0; char *cp; cp = ptr + (char *)bindaddr; while(cnt_flag&(_IOREAD|_IOWRT);p++) if(p >= _iob + _NFILE) error("Too many open files to do readlist",FALSE); p->_flag = _IOREAD | _IOSTRG; p->_base = p->_ptr = str; p->_cnt = strlen(str) + 1; olbot = lbot; lbot = np; piport = p; protect(P(p)); work = Lread(); piport = opiport; lbot = olbot; p->_cnt = 0; p->_ptr = p->_base = 0; p->_file = 0; p->_flag=0; return(work); } *opiport = piport; register FILE *p=stdin; struct argent *olbot; snpand(2); /* find free file descriptor */ for(;p->_flag&(_IOREAD|_IOWRT);p++) if(p >= _iob + _NFILE) error("Too many open files to do readlist",FALSE); p->cmd/lisp/franz/crt0.s 644 0 12 27652 2552701414 7752 ((# C runtime startoff # sccs id @(#)crt0.s 35.1 5/6/81 .set exit,1 .globl _exit .globl start .globl _main .globl _environ .globl _xports .globl _gstart .globl _proflush .globl _holbeg .globl _holend .globl Fixzero # # C language startup routine # # special 512 byte area for nil (and possibly other atoms) # and special block of smallnums. # .long 0 .long 0 .long 0 .long -4 .long 20 .byte 'n,'i,'l,0 .long 0 .long 0 .long -4 .long 40 .byte 'e,'o,'f,0 .space 512-44 _xports: .long __iob+0 .long __iob+16 .long __iob+32 .long __iob+48 .long __iob+64 .long __iob+80 .long __iob+96 .long __iob+112 .long __iob+128 .long __iob+144 .long __iob+160 .long __iob+176 .long __iob+192 .long __iob+208 .long __iob+224 .long __iob+240 .long __iob+256 .long __iob+272 .long __iob+288 .long __iob+304 .space 512 - (20 * 4) .long -1024,-1023,-1022,-1021,-1020,-1019,-1018,-1017 .long -1016,-1015,-1014,-1013,-1012,-1011,-1010,-1009 .long -1008,-1007,-1006,-1005,-1004,-1003,-1002,-1001 .long -1000,-999,-998,-997,-996,-995,-994,-993 .long -992,-991,-990,-989,-988,-987,-986,-985 .long -984,-983,-982,-981,-980,-979,-978,-977 .long -976,-975,-974,-973,-972,-971,-970,-969 .long -968,-967,-966,-965,-964,-963,-962,-961 .long -960,-959,-958,-957,-956,-955,-954,-953 .long -952,-951,-950,-949,-948,-947,-946,-945 .long -944,-943,-942,-941,-940,-939,-938,-937 .long -936,-935,-934,-933,-932,-931,-930,-929 .long -928,-927,-926,-925,-924,-923,-922,-921 .long -920,-919,-918,-917,-916,-915,-914,-913 .long -912,-911,-910,-909,-908,-907,-906,-905 .long -904,-903,-902,-901,-900,-899,-898,-897 .long -896,-895,-894,-893,-892,-891,-890,-889 .long -888,-887,-886,-885,-884,-883,-882,-881 .long -880,-879,-878,-877,-876,-875,-874,-873 .long -872,-871,-870,-869,-868,-867,-866,-865 .long -864,-863,-862,-861,-860,-859,-858,-857 .long -856,-855,-854,-853,-852,-851,-850,-849 .long -848,-847,-846,-845,-844,-843,-842,-841 .long -840,-839,-838,-837,-836,-835,-834,-833 .long -832,-831,-830,-829,-828,-827,-826,-825 .long -824,-823,-822,-821,-820,-819,-818,-817 .long -816,-815,-814,-813,-812,-811,-810,-809 .long -808,-807,-806,-805,-804,-803,-802,-801 .long -800,-799,-798,-797,-796,-795,-794,-793 .long -792,-791,-790,-789,-788,-787,-786,-785 .long -784,-783,-782,-781,-780,-779,-778,-777 .long -776,-775,-774,-773,-772,-771,-770,-769 .long -768,-767,-766,-765,-764,-763,-762,-761 .long -760,-759,-758,-757,-756,-755,-754,-753 .long -752,-751,-750,-749,-748,-747,-746,-745 .long -744,-743,-742,-741,-740,-739,-738,-737 .long -736,-735,-734,-733,-732,-731,-730,-729 .long -728,-727,-726,-725,-724,-723,-722,-721 .long -720,-719,-718,-717,-716,-715,-714,-713 .long -712,-711,-710,-709,-708,-707,-706,-705 .long -704,-703,-702,-701,-700,-699,-698,-697 .long -696,-695,-694,-693,-692,-691,-690,-689 .long -688,-687,-686,-685,-684,-683,-682,-681 .long -680,-679,-678,-677,-676,-675,-674,-673 .long -672,-671,-670,-669,-668,-667,-666,-665 .long -664,-663,-662,-661,-660,-659,-658,-657 .long -656,-655,-654,-653,-652,-651,-650,-649 .long -648,-647,-646,-645,-644,-643,-642,-641 .long -640,-639,-638,-637,-636,-635,-634,-633 .long -632,-631,-630,-629,-628,-627,-626,-625 .long -624,-623,-622,-621,-620,-619,-618,-617 .long -616,-615,-614,-613,-612,-611,-610,-609 .long -608,-607,-606,-605,-604,-603,-602,-601 .long -600,-599,-598,-597,-596,-595,-594,-593 .long -592,-591,-590,-589,-588,-587,-586,-585 .long -584,-583,-582,-581,-580,-579,-578,-577 .long -576,-575,-574,-573,-572,-571,-570,-569 .long -568,-567,-566,-565,-564,-563,-562,-561 .long -560,-559,-558,-557,-556,-555,-554,-553 .long -552,-551,-550,-549,-548,-547,-546,-545 .long -544,-543,-542,-541,-540,-539,-538,-537 .long -536,-535,-534,-533,-532,-531,-530,-529 .long -528,-527,-526,-525,-524,-523,-522,-521 .long -520,-519,-518,-517,-516,-515,-514,-513 .long -512,-511,-510,-509,-508,-507,-506,-505 .long -504,-503,-502,-501,-500,-499,-498,-497 .long -496,-495,-494,-493,-492,-491,-490,-489 .long -488,-487,-486,-485,-484,-483,-482,-481 .long -480,-479,-478,-477,-476,-475,-474,-473 .long -472,-471,-470,-469,-468,-467,-466,-465 .long -464,-463,-462,-461,-460,-459,-458,-457 .long -456,-455,-454,-453,-452,-451,-450,-449 .long -448,-447,-446,-445,-444,-443,-442,-441 .long -440,-439,-438,-437,-436,-435,-434,-433 .long -432,-431,-430,-429,-428,-427,-426,-425 .long -424,-423,-422,-421,-420,-419,-418,-417 .long -416,-415,-414,-413,-412,-411,-410,-409 .long -408,-407,-406,-405,-404,-403,-402,-401 .long -400,-399,-398,-397,-396,-395,-394,-393 .long -392,-391,-390,-389,-388,-387,-386,-385 .long -384,-383,-382,-381,-380,-379,-378,-377 .long -376,-375,-374,-373,-372,-371,-370,-369 .long -368,-367,-366,-365,-364,-363,-362,-361 .long -360,-359,-358,-357,-356,-355,-354,-353 .long -352,-351,-350,-349,-348,-347,-346,-345 .long -344,-343,-342,-341,-340,-339,-338,-337 .long -336,-335,-334,-333,-332,-331,-330,-329 .long -328,-327,-326,-325,-324,-323,-322,-321 .long -320,-319,-318,-317,-316,-315,-314,-313 .long -312,-311,-310,-309,-308,-307,-306,-305 .long -304,-303,-302,-301,-300,-299,-298,-297 .long -296,-295,-294,-293,-292,-291,-290,-289 .long -288,-287,-286,-285,-284,-283,-282,-281 .long -280,-279,-278,-277,-276,-275,-274,-273 .long -272,-271,-270,-269,-268,-267,-266,-265 .long -264,-263,-262,-261,-260,-259,-258,-257 .long -256,-255,-254,-253,-252,-251,-250,-249 .long -248,-247,-246,-245,-244,-243,-242,-241 .long -240,-239,-238,-237,-236,-235,-234,-233 .long -232,-231,-230,-229,-228,-227,-226,-225 .long -224,-223,-222,-221,-220,-219,-218,-217 .long -216,-215,-214,-213,-212,-211,-210,-209 .long -208,-207,-206,-205,-204,-203,-202,-201 .long -200,-199,-198,-197,-196,-195,-194,-193 .long -192,-191,-190,-189,-188,-187,-186,-185 .long -184,-183,-182,-181,-180,-179,-178,-177 .long -176,-175,-174,-173,-172,-171,-170,-169 .long -168,-167,-166,-165,-164,-163,-162,-161 .long -160,-159,-158,-157,-156,-155,-154,-153 .long -152,-151,-150,-149,-148,-147,-146,-145 .long -144,-143,-142,-141,-140,-139,-138,-137 .long -136,-135,-134,-133,-132,-131,-130,-129 .long -128,-127,-126,-125,-124,-123,-122,-121 .long -120,-119,-118,-117,-116,-115,-114,-113 .long -112,-111,-110,-109,-108,-107,-106,-105 .long -104,-103,-102,-101,-100,-99,-98,-97 .long -96,-95,-94,-93,-92,-91,-90,-89 .long -88,-87,-86,-85,-84,-83,-82,-81 .long -80,-79,-78,-77,-76,-75,-74,-73 .long -72,-71,-70,-69,-68,-67,-66,-65 .long -64,-63,-62,-61,-60,-59,-58,-57 .long -56,-55,-54,-53,-52,-51,-50,-49 .long -48,-47,-46,-45,-44,-43,-42,-41 .long -40,-39,-38,-37,-36,-35,-34,-33 .long -32,-31,-30,-29,-28,-27,-26,-25 .long -24,-23,-22,-21,-20,-19,-18,-17 .long -16,-15,-14,-13,-12,-11,-10,-9 .long -8,-7,-6,-5,-4,-3,-2,-1 Fixzero: .long 0,1,2,3,4,5,6,7 .long 8,9,10,11,12,13,14,15 .long 16,17,18,19,20,21,22,23 .long 24,25,26,27,28,29,30,31 .long 32,33,34,35,36,37,38,39 .long 40,41,42,43,44,45,46,47 .long 48,49,50,51,52,53,54,55 .long 56,57,58,59,60,61,62,63 .long 64,65,66,67,68,69,70,71 .long 72,73,74,75,76,77,78,79 .long 80,81,82,83,84,85,86,87 .long 88,89,90,91,92,93,94,95 .long 96,97,98,99,100,101,102,103 .long 104,105,106,107,108,109,110,111 .long 112,113,114,115,116,117,118,119 .long 120,121,122,123,124,125,126,127 .long 128,129,130,131,132,133,134,135 .long 136,137,138,139,140,141,142,143 .long 144,145,146,147,148,149,150,151 .long 152,153,154,155,156,157,158,159 .long 160,161,162,163,164,165,166,167 .long 168,169,170,171,172,173,174,175 .long 176,177,178,179,180,181,182,183 .long 184,185,186,187,188,189,190,191 .long 192,193,194,195,196,197,198,199 .long 200,201,202,203,204,205,206,207 .long 208,209,210,211,212,213,214,215 .long 216,217,218,219,220,221,222,223 .long 224,225,226,227,228,229,230,231 .long 232,233,234,235,236,237,238,239 .long 240,241,242,243,244,245,246,247 .long 248,249,250,251,252,253,254,255 .long 256,257,258,259,260,261,262,263 .long 264,265,266,267,268,269,270,271 .long 272,273,274,275,276,277,278,279 .long 280,281,282,283,284,285,286,287 .long 288,289,290,291,292,293,294,295 .long 296,297,298,299,300,301,302,303 .long 304,305,306,307,308,309,310,311 .long 312,313,314,315,316,317,318,319 .long 320,321,322,323,324,325,326,327 .long 328,329,330,331,332,333,334,335 .long 336,337,338,339,340,341,342,343 .long 344,345,346,347,348,349,350,351 .long 352,353,354,355,356,357,358,359 .long 360,361,362,363,364,365,366,367 .long 368,369,370,371,372,373,374,375 .long 376,377,378,379,380,381,382,383 .long 384,385,386,387,388,389,390,391 .long 392,393,394,395,396,397,398,399 .long 400,401,402,403,404,405,406,407 .long 408,409,410,411,412,413,414,415 .long 416,417,418,419,420,421,422,423 .long 424,425,426,427,428,429,430,431 .long 432,433,434,435,436,437,438,439 .long 440,441,442,443,444,445,446,447 .long 448,449,450,451,452,453,454,455 .long 456,457,458,459,460,461,462,463 .long 464,465,466,467,468,469,470,471 .long 472,473,474,475,476,477,478,479 .long 480,481,482,483,484,485,486,487 .long 488,489,490,491,492,493,494,495 .long 496,497,498,499,500,501,502,503 .long 504,505,506,507,508,509,510,511 .long 512,513,514,515,516,517,518,519 .long 520,521,522,523,524,525,526,527 .long 528,529,530,531,532,533,534,535 .long 536,537,538,539,540,541,542,543 .long 544,545,546,547,548,549,550,551 .long 552,553,554,555,556,557,558,559 .long 560,561,562,563,564,565,566,567 .long 568,569,570,571,572,573,574,575 .long 576,577,578,579,580,581,582,583 .long 584,585,586,587,588,589,590,591 .long 592,593,594,595,596,597,598,599 .long 600,601,602,603,604,605,606,607 .long 608,609,610,611,612,613,614,615 .long 616,617,618,619,620,621,622,623 .long 624,625,626,627,628,629,630,631 .long 632,633,634,635,636,637,638,639 .long 640,641,642,643,644,645,646,647 .long 648,649,650,651,652,653,654,655 .long 656,657,658,659,660,661,662,663 .long 664,665,666,667,668,669,670,671 .long 672,673,674,675,676,677,678,679 .long 680,681,682,683,684,685,686,687 .long 688,689,690,691,692,693,694,695 .long 696,697,698,699,700,701,702,703 .long 704,705,706,707,708,709,710,711 .long 712,713,714,715,716,717,718,719 .long 720,721,722,723,724,725,726,727 .long 728,((729,730,731,732,733,734,735 .long 736,737,738,739,740,741,742,743 .long 744,745,746,747,748,749,750,751 .long 752,753,754,755,756,757,758,759 .long 760,761,762,763,764,765,766,767 .long 768,769,770,771,772,773,774,775 .long 776,777,778,779,780,781,782,783 .long 784,785,786,787,788,789,790,791 .long 792,793,794,795,796,797,798,799 .long 800,801,802,803,804,805,806,807 .long 808,809,810,811,812,813,814,815 .long 816,817,818,819,820,821,822,823 .long 824,825,826,827,828,829,830,831 .long 832,833,834,835,836,837,838,839 .long 840,841,842,843,844,845,846,847 .long 848,849,850,851,852,853,854,855 .long 856,857,858,859,860,861,862,863 .long 864,865,866,867,868,869,870,871 .long 872,873,874,875,876,877,878,879 .long 880,881,882,883,884,885,886,887 .long 888,889,890,891,892,893,894,895 .long 896,897,898,899,900,901,902,903 .long 904,905,906,907,908,909,910,911 .long 912,913,914,915,916,917,918,919 .long 920,921,922,923,924,925,926,927 .long 928,929,930,931,932,933,934,935 .long 936,937,938,939,940,941,942,943 .long 944,945,946,947,948,949,950,951 .long 952,953,954,955,956,957,958,959 .long 960,961,962,963,964,965,966,967 .long 968,969,970,971,972,973,974,975 .long 976,977,978,979,980,981,982,983 .long 984,985,986,987,988,989,990,991 .long 992,993,994,995,996,997,998,999 .long 1000,1001,1002,1003,1004,1005,1006,1007 .long 1008,1009,1010,1011,1012,1013,1014,1015 .long 1016,1017,1018,1019,1020,1021,1022,1023 start: .word 0x0000 subl2 $8,sp movl 8(sp),(sp) # argc movab 12(sp),r0 movl r0,4(sp) # argv L1: tstl (r0)+ # null args term ? bneq L1 cmpl r0,*4(sp) # end of 'env' or 'argv' ? blss L2 tstl -(r0) # envp's are in list L2: movl r0,8(sp) # env # movl r0,_environ # indir is 0 if no env ; not 0 if env calls $3,_main pushl r0 calls $1,_exit chmk $exit _gstart: .word 0 moval start,r0 ret _proflush: .word 0 ret # .data _holbeg: # dummy locations _holend: _environ: .space 4 ,1023 start: .word 0x0000 subl2 $8,sp movl 8(sp),(sp) # argc movab 12(sp),r0 mcmd/lisp/franz/data.c 644 0 12 15354 2552701415 7770 static char *sccsid = "@(#)data.c 35.5 7/1/81"; #include "global.h" #include "gtabs.h" #include "structs.h" #include "frame.h" #include /*char firstalloc[NBPG] = { 'x' }; /* first thing allocated in file */ lispval lispsys[SIGNIF]; /* lisp data used by system */ lispval gftab[GFTABLEN]; /* global function table for interpreter */ lispval gctab[GCTABLEN] = /* global constant table for interpreter */ {nil,0,SMALL(-1),SMALL(0),SMALL(1),SMALL(2),SMALL(3),SMALL(4)}; /* Port definitions *****************************************************/ FILE *piport, /* standard input port */ *poport, /* standard output port */ *errport, /* port for error messages */ *rdrport, /* temporary port for readr */ *proport; /* port for protocal */ int lineleng = 80; /* line length desired */ int rlevel; /* used to indicate depth of recursion in reader. No longer really necessary */ char keybin = FALSE; /* logical flag: using keyboard */ char protflag = FALSE; /* logical flag: want protocall */ char rbktf; /* logical flag: ] mode */ lispval ioname[_NFILE]; /* strings of names of files currently open */ /* name stack ***********************************************************/ struct argent *orgnp; /* used by top level to reset to start */ struct argent *namptr, /* temporary pointer */ *nplim; /* don't have this = np */ struct nament *bnp, /* top of bind stack */ *orgbnp, /* absolute bottom of ""*/ *bnplim; /* absolute top of "" */ /* hashing things *******************************************************/ int hash; /* set by ratom */ int atmlen; /* length of atom including final null */ /* big string buffer for whomever needs it ******************************/ char strbuf[STRBLEN]; char *endstrb = strbuf + STRBLEN - 1 ; /* set by sstatus commands */ int uctolc = 0; /* when set, uc chars in atoms go to lc */ int dmpmode = 413; /* default mode for dumplisp (note this is decimal not octal) */ /* break and error declarations *****************************************/ int depth = 0; /* depth of nested breaks */ lispval contval; /* the value being returned up */ int retval; /* used by each error/prog call */ lispval lispretval; /* used by non-local goto's */ int rsetsw; /* when set, trace frames built */ int bcdtrsw; /* when set with rsetsw, trace bcd too */ int evalhcallsw; /* when set will not evalhook next eval */ int funhcallsw; /* when set will not funcallhook next eval */ lispval Vevalframe; /* pointer to lisp atom 'evalframe' */ /* exception handling stuff *********************************************/ int exception; /* true if an exception is pending */ int sigintcnt; /* number of SIGINT's pending */ /* current state of the hole (for fasling into) *************************/ int curhbeg; /* next location to fasl into */ int usehole; /* if TRUE, fasl tries to use hole */ /* other stuff **********************************************************/ lispval ftemp,vtemp,argptr,ttemp; /* temporaries: use briefly */ int itemp; lispval sigacts[16]; /* for catching interrupts */ int sigstruck,sigdelay; /* for catching interrupts */ lispval stattab[16]; /* miscelleneous options */ /* interpreter globals */ int lctrace; int fvirgin = 1; /* set to 1 initially */ int GCtime; struct frame *errp; /* stack of error frames */ /* global pointers to the transfer tables */ struct trtab *trhead= /* first in list of transfer tables */ (struct trtab *) 0; struct trent *trcur; /* next entry to allocate */ int trleft = 0; /* number of entries left in current table */ /* globals from sysat.c */ int *beginsweep; /* place for sweeper to begin */ int initflag = TRUE; /* inhibit gcing initially */ int tgcthresh = 15; /* globals from rlc */ int usehole; /* TRUE if allocator should consider the hole for allocation */ /* global used in io.c */ lispval lastrtab; /* globals from [VT]alloc.c */ char purepage[TTSIZE]; int fakettsize = TTSIZE - 8; int *bind_lists = (int *) CNIL; /* lisp data for compiled code */ struct types atom_str = { (char *)CNIL, 0, ATOMSPP, ATOM, 5, &atom_items, &atom_pages, &atom_name, (struct heads *) CNIL, (char *)CNIL }, strng_str = { (char *) CNIL, 0, STRSPP, STRNG, 1, &str_items, &str_pages, &str_name, (struct heads *) CNIL, (char *)CNIL }, int_str = { (char *) CNIL, 0, INTSPP, INT, 1, &int_items, &int_pages, &int_name, (struct heads *) CNIL, (char *)CNIL }, dtpr_str = { (char *) CNIL, 0, DTPRSPP, DTPR, 2, &dtpr_items, &dtpr_pages, &dtpr_name, (struct heads *) CNIL, (char *)CNIL }, doub_str = { (char *) CNIL, 0, DOUBSPP, DOUB, 2, &doub_items, &doub_pages, &doub_name, (struct heads *) CNIL, (char *)CNIL }, array_str = { (char *) CNIL, 0, ARRAYSPP, ARRAY, 5, &array_items, &array_pages, &array_name, (struct heads *) CNIL, (char *)CNIL }, sdot_str = { (char *) CNIL, 0, SDOTSPP, SDOT, 2, &sdot_items, &sdot_pages, &sdot_name, (struct heads *) CNIL, (char *)CNIL }, val_str = { (char *) CNIL, 0, VALSPP, VALUE, 1, &val_items, &val_pages, &val_name, (struct heads *) CNIL, (char *)CNIL }, funct_str = { (char *) CNIL, 0, BCDSPP, BCD, 2, &funct_items, &funct_pages, &funct_name, (struct heads *) CNIL, (char *)CNIL }, hunk_str[7] = { { (char *) CNIL, 0, HUNK2SPP, HUNK2, 2, &hunk_items[0], &hunk_pages[0], &hunk_name[0], (struct heads *) CNIL, (char *)CNIL }, { (char *) CNIL, 0, HUNK4SPP, HUNK4, 4, &hunk_items[1], &hunk_pages[1], &hunk_name[1], (struct heads *) CNIL, (char *)CNIL }, { (char *) CNIL, 0, HUNK8SPP, HUNK8, 8, &hunk_items[2], &hunk_pages[2], &hunk_name[2], (struct heads *) CNIL, (char *)CNIL }, { (char *) CNIL, 0, HUNK16SPP, HUNK16, 16, &hunk_items[3], &hunk_pages[3], &hunk_name[3], (struct heads *) CNIL, (char *)CNIL }, { (char *) CNIL, 0, HUNK32SPP, HUNK32, 32, &hunk_items[4], &hunk_pages[4], &hunk_name[4], (struct heads *) CNIL, (char *)CNIL }, { (char *) CNIL, 0, HUNK64SPP, HUNK64, 64, &hunk_items[5], &hunk_pages[5], &hunk_name[5], (struct heads *) CNIL, (char *)CNIL }, { (char *) CNIL, 0, HUNK128SPP, HUNK128, 128, &hunk_items[6], &hunk_pages[6], &hunk_name[6], (struct heads *) CNIL, (char *)CNIL } }; extern struct readtable { unsigned char ctable[132]; } initread; unsigned char *ctable = initread.ctable; int hashtop = HASHTOP; int xcycle = 0; /* used by xsbrk */ struct atom *hasht[HASHTOP]; lispval datalim; /* pointer to next location to allocate */ char typetable[TTSIZE] = {UNBO,ATOM,PORT,INT,INT,INT,INT,INT,INT,INT,INT,INT,INT,INT,INT,INT,INT,INT,INT}; /* this must be the last thing allocated in this file */ #ifdef VMS char *lsbrkpnt = (char *)0; char zfreespace[FREESIZE]; #else char lsbrkpnt,zfreespace; #endif table { unsigned char ctable[132]; } initread; unsigned char *ctable = initread.ctable; int hashtop = HASHTOP; int xcycle = 0; /* used by xsbrk */ struct atom *hasht[HASHTOP]; lispval datalim; /* pointer to next location to allocate */ char typetable[TTSIZE] = {UNBO,ATOMcmd/lisp/franz/divbig.c 644 0 12 17065 2552701415 10324 (( static char *sccsid = "@(#)divbig.c 35.3 5/29/81"; #include "global.h" #define b 0x40000000 #define toint(p) ((int) (p)) divbig(dividend, divisor, quotient, remainder) lispval dividend, divisor, *quotient, *remainder; { register *ujp, *vip; int *sp(), *alloca(), d, negflag = 0, m, n, carry, rem, qhat, j; int borrow, negrem = 0; int *utop = sp(), *ubot, *vbot, *qbot; register lispval work; lispval export(); snpand(3); /* copy dividend */ for(work = dividend; work; work = work ->s.CDR) stack(work->s.I); ubot = sp(); if(*ubot < 0) { /* knuth's division alg works only for pos bignums */ negflag ^= 1; negrem = 1; dsmult(utop-1,ubot,-1); } stack(0); ubot = sp(); /*copy divisor */ for(work = divisor; work; work = work->s.CDR) stack(work->s.I); vbot = sp(); stack(0); if(*vbot < 0) { negflag ^= 1; dsmult(ubot-1,vbot,-1); } /* check validity of data */ n = ubot - vbot; m = utop - ubot - n - 1; if (n == 1) { /* do destructive division by a single. */ rem = dsdiv(utop-1,ubot,*vbot); if(negrem) rem = -rem; if(negflag) dsmult(utop-1,ubot,-1); if(remainder) *remainder = inewint(rem); if(quotient) *quotient = export(utop,ubot); return; } if (m < 0) { if (remainder) *remainder = dividend; if(quotient) *quotient = inewint(0); return; } qbot = alloca(toint(utop) + toint(vbot) - 2 * toint(ubot)); d1: d = b /(*vbot +1); dsmult(utop-1,ubot,d); dsmult(ubot-1,vbot,d); d2: for(j=0,ujp=ubot; j <= m; j++,ujp++) { d3: qhat = calqhat(ujp,vbot); d4: if((borrow = mlsb(ujp + n, ujp, ubot, -qhat)) < 0) { adback(ujp + n, ujp, ubot); qhat--; } qbot[j] = qhat; } d8: if(remainder) { dsdiv(utop-1, utop - n, d); if(negrem) dsmult(utop-1,utop-n,-1); *remainder = export(utop,utop-n); } if(quotient) { if(negflag) dsmult(qbot+m,qbot,-1); *quotient = export(qbot + m + 1, qbot); } } /* * asm code commented out due to optimizer bug calqhat(ujp,v1p) register int *ujp, *v1p; { asm(" movl $0x3fffffff,r0"); asm(" cmpl (r10),(r11)"); asm(" beql on1"); asm(" emul (r11),$0x40000000,4(r11),r1"); asm(" ediv (r10),r1,r0,r5"); asm("on1:"); asm(" emul r0,4(r10),$0,r1"); asm(" emul r5,$0x40000000,8(r11),r3"); asm(" subl2 r3,r1"); asm(" sbwc r4,r2"); asm(" bleq out1"); asm(" decl r0"); asm("out1:"); } mlsb(utop,ubot,vtop,nqhat) register int *utop, *ubot, *vtop; register int nqhat; { asm(" clrl r0"); asm("loop2: addl2 (r11),r0"); asm(" emul r8,-(r9),r0,r2"); asm(" extzv $0,$30,r2,(r11)"); asm(" extv $30,$32,r2,r0"); asm(" acbl r10,$-4,r11,loop2"); } adback(utop,ubot,vtop) register int *utop, *ubot, *vtop; { asm(" clrl r0"); asm("loop3: addl2 -(r9),r0"); asm(" addl2 (r11),r0"); asm(" extzv $0,$30,r0,(r11)"); asm(" extv $30,$2,r0,r0"); asm(" acbl r10,$-4,r11,loop3"); } dsdiv(top,bot,div) register int* bot; { asm(" clrl r0"); asm("loop4: emul r0,$0x40000000,(r11),r1"); asm(" ediv 12(ap),r1,(r11),r0"); asm(" acbl 4(ap),$4,r11,loop4"); } dsmult(top,bot,mult) register int* top; { asm(" clrl r0"); asm("loop5: emul 12(ap),(r11),r0,r1"); asm(" extzv $0,$30,r1,(r11)"); asm(" extv $30,$32,r1,r0"); asm(" acbl 8(ap),$-4,r11,loop5"); asm(" movl r1,4(r11)"); } lispval export(top,bot) register lispval bot; { register r10, r9, r8, r7, r6; asm(" movl 4(ap),r10"); asm(" movl $0xC0000000,r4"); asm(" jmp Bexport"); } */ #define MAXINT 0x80000000L Ihau(fix) register int fix; { register count; if(fix==MAXINT) return(32); if(fix < 0) fix = -fix; for(count = 0; fix; count++) fix /= 2; return(count); } lispval Lhau() { register count; register lispval handy; register dum1,dum2; register struct argent *lbot, *np; lispval Labsval(); handy = lbot->val; top: switch(TYPE(handy)) { case INT: count = Ihau(handy->i); break; case SDOT: handy = Labsval(); for(count = 0; handy->s.CDR!=((lispval) 0); handy = handy->s.CDR) count += 30; count += Ihau(handy->s.I); break; default: handy = errorh(Vermisc,"Haulong: bad argument",nil, TRUE,997,handy); goto top; } return(inewint(count)); } lispval Lhaipar() { int *sp(); register lispval work; register n; register int *top = sp() - 1; register int *bot; register struct argent *lbot, *np; int mylen; /*chkarg(2);*/ work = lbot->val; /* copy data onto stack */ on1: switch(TYPE(work)) { case INT: stack(work->i); break; case SDOT: for(; work!=((lispval) 0); work = work->s.CDR) stack(work->s.I); break; default: work = errorh(Vermisc,"Haipart: bad first argument",nil, TRUE,996,work); goto on1; } bot = sp(); if(*bot < 0) { stack(0); dsmult(top,bot,-1); bot--; } for(; *bot==0 && bot < top; bot++); /* recalculate haulong internally */ mylen = (top - bot) * 30 + Ihau(*bot); /* get second argument */ work = lbot[1].val; while(TYPE(work)!=INT) work = errorh(Vermisc,"Haipart: 2nd arg not int",nil, TRUE,995,work); n = work->i; if(n >= mylen || -n >= mylen) goto done; if(n==0) return(inewint(0)); if(n > 0) { /* Here we want n most significant bits so chop off mylen - n bits */ stack(0); n = mylen - n; for(n; n >= 30; n -= 30) top--; if(top < bot) error("Internal error in haipart #1",FALSE); dsdiv(top,bot,1<i; if(n==0) return(bignum); for(; n >= 30; n -= 30) {/* Here we want to multiply by 2^n so start by copying n/30 zeroes onto stack */ stack(0); } work = bignum; /* copy data onto stack */ on1: switch(TYPE(work)) { case INT: stack(work->i); break; case SDOT: for(; work!=((lispval) 0); work = work->s.CDR) stack(work->s.I); break; default: work = errorh(Vermisc,"Bignum-shift: bad bignum argument",nil, TRUE,996,work); goto on1; } stack(0); /* leave room for dsmult and dsadd1 */ bot = sp(); /* to spill into, export will prune */ /* any unnecessary leading zeroes */ if(n >= 0) { dsmult(top,bot,1< 30; n -= 30) { if(guard) sticky |= 1; guard = round; if(top > bot) { round = *top; top --; } else round = 0; } if(n > 0) { if(guard) sticky |= 1; guard = round; round = dsrsh(top,bot,-n,-1<val,lbot[1].val,STICKY)); } lispval Lbiglsh() { register struct argent *mylbot = lbot; chkarg(2,"bignum-leftshift"); return(Ibiglsh(lbot->val,lbot[1].val,TOEVEN)); } lispval HackHex() /* this is a one minute function so drb and kls can debug biglsh */ /* (HackHex i) returns a string which is the result of printing i in hex */ { register struct argent *mylbot = lbot; char buf[32]; sprintf(buf,"%lx",lbot->val->i); return((lispval)inewstr(buf)); } arg(2,"sticky-bignum-leftshift"); return(Ibiglsh(lbot->val,lbot[1].val,STICKY)); } lispval Lbiglsh() { register struct argent *mylbot = lbot; chkarg(2,"bignum-leftshift"); return(Ibiglsh(lbot->val,lbot[1].val,TOEVEN)); } lispval HackHex() /* this is a one minute function so drb and kls can debug biglsh */ /* (HackHex i) returns a string which is the result of printing i in hex */ { register struct argent *mylbot = lbot; char buf[32]; sprintf(buf,"%cmd/lisp/franz/dmcount.s 644 0 12 421 2552701416 10476 .asciz "@(#)dmcount.s 35.1 5/6/81" # dummy count subroutine called during profiling # this is what is called if there is any residual profiled code # which wants to do profiling in a non profiled system. .globl mcount .globl _mcount _mcount: mcount: rsb # just leave ); } lispval HackHex() /* this is a one minute function so drb and kls can debug biglsh */ /* (HackHex i) returns a string which is the result of p/|,|5< /,"cmd/lisp/franz/dummyb.s 644 0 12 140 2552701416 10320 # this is a table of all forms we will bind in with vbind. .globl _fstbind _fstbind: .long -1 what is called if there is any residual profiled code # which wants to do profiling in a non profiled system. .globl mcount .globl _mcount _mcount: mcount: rsb # just leave ); } lispval HackHex() /* this is a one minute function so drb and kls can debug biglsh */ /* (HackHex i) returns a string which is the result of p/|,|5< /,"((cmd/lisp/franz/dvadvise.c 444 0 12 303 2552701417 10610 static char *sccsid = "@(#)dvadvise.c 35.1 5/6/81"; /* dummy vadvise function - used when creating a lisp which will run on an operating system without vadvise. */ vadvise() { return(0); } ed system. .globl mcount .globl _mcount _mcount: mcount: rsb # just leave ); } lispval HackHex() /* this is a one minute function so drb and kls can debug biglsh */ /* (HackHex i) returns a string which is the result of p/|,|5< /,"cmd/lisp/franz/error.c 644 2 33 20475 2552701417 10217 static char *sccsid = "@(#)error.c 35.4 7/1/81"; #include "global.h" #include "frame.h" /* error ****************************************************************/ /* this routine is always called on a non-fatal error. The first argu- */ /* ment is printed out. The second a boolean flag indicating if the */ /* error routine is permitted to return a pointer to a lisp value if */ /* the "cont" command is executed. */ /* error from lisp C code, this temporarily replaces the old error * allowing us to interface with the new errset scheme with minimum * difficulty. We assume that an error which comes to this routine * is of an "undefined error type" ER%misc . Soon all calls to this * routine will be removed. * */ lispval error(mesg,contvl) char *mesg; lispval contvl; { lispval errorh(); return(errorh(Vermisc,mesg,nil,contvl,0)); } /* new error handler, works with errset * * call is errorh(type,message,valret,contuab) where * type is an atom which classifys the error, and whose clb, if not nil * is the name of a function to call to handle the error. * message is a character string to print to describe the error * valret is the value to return to an errset if one is found, * and contuab is non nil if this error is continuable. */ #include "catchfram.h" lispval errorh(type,message,valret,contuab,uniqid) lispval type,valret; int uniqid,contuab; char *message; { register struct frame *curp, *uwpframe = (struct frame *)0; register lispval handy; lispval *work = 1 + (lispval *) &uniqid; int limit = nargs() - 5; int pass, curdepth; lispval Lread(), calhan(); lispval contatm; lispval handy2; extern struct frame *errp; Savestack(2); contatm = (contuab == TRUE ? tatom : nil); /* if there is a catch every error handler */ if((handy = Verall->a.clb) != nil) { handy = Verall->a.clb; Verall->a.clb = nil; /* turn off before calling */ handy = calhan(limit,work,type,uniqid,contatm,message,handy); if(contuab && (TYPE(handy) == DTPR)) return(handy->d.car); } if((handy = type->a.clb) != nil) /* if there is an error handler */ { handy = calhan(limit,work,type,uniqid,contatm,message,handy); if(contuab && (TYPE(handy) == DTPR)) return(handy->d.car); } pass = 1; /* search stack for error catcher */ ps2: for (curp = errp ; curp != (struct frame *) 0 ; curp = curp->olderrp) { if(curp->class == F_CATCH) { /* * interesting catch tags are ER%unwind-protect, generated * by unwind-protect and ER%all, generated by errset */ if((pass == 1) && (curp->larg1 == Veruwpt)) { uwpframe = curp; pass = 2; goto ps2; } else if(curp->larg1 == Verall) { /* * have found an errset to jump to. If there is an * errset handler, first call that. */ if((handy=Verrset->a.clb) != nil) { calhan(limit,work,type,uniqid,contatm,message,handy); } /* * if there is an unwind-protect then go to that first. * The unwind protect will return to errorh after * it has processed its cleanup forms. * assert: if pass == 2 * then there is a pending unwind-protect */ if(uwpframe != (struct frame *)0) { /* * generate form to return to unwind-protect */ protect(handy2 = newdot()); handy2->d.car = Veruwpt; handy = handy2->d.cdr = newdot(); handy->d.car = nil; /* indicates error */ handy = handy->d.cdr = newdot(); handy->d.car = type; handy = handy->d.cdr = newdot(); handy->d.car = matom(message); handy = handy->d.cdr = newdot(); handy->d.car = valret; handy = handy->d.cdr = newdot(); handy->d.car = inewint(uniqid); handy = handy->d.cdr = newdot(); handy->d.car = inewint(contuab); while (limit-- > 0) /* put in optional args */ { handy = handy->d.cdr = newdot(); handy->d.car = *work++; } lispretval = handy2; /* return this as value */ retval = C_THROW; Iretfromfr(uwpframe); /* NOT REACHED */ } /* * Will return to errset * print message if flag on this frame is non nil * and we are not executing an 'err' function. */ if((curp->larg2 != nil) && (type != Vererr)) { printf("%s ",message); while(limit-->0) { printr(*work++,stdout); fflush(stdout); } fputc('\n',stdout); fflush(stdout); } lispretval = valret; retval = C_THROW; /* looks like a throw */ Iretfromfr(curp); } } } /* no one will catch this error, we must see if there is an error-goes-to-top-level catcher */ if (Vertpl->a.clb != nil) { handy = calhan(limit,work,type,uniqid,contatm,message,Vertpl->a.clb); if( contuab && (TYPE(handy) == DTPR)) return(handy->d.car); } /* at this point, print error message and break, just like the current error scheme */ printf("%s ",message); while(limit-->0) { printr(*work++,stdout); fflush(stdout); } /* If automatic-reset is set * we will now jump to top level, calling the reset function * if it exists, or using the c rest function if it does not */ if(Sautor) { if ((handy = reseta->a.fnbnd) != nil) { lbot = np; protect(reseta); protect(nil); Lapply(); } Inonlocalgo(C_RESET,inewint(0),nil); /* NOT REACHED */ } /* * no one wants the error. We set up another read-eval-print * loop. The user can get out of this error by typing (return 'val) * if the error is continuable. Normally this code be replaced * by more clever lisp code, when the full lisp is built */ errp = Pushframe(F_PROG); if(TYPE(Verdepth->a.clb) != INT) { curdepth = 1; } else curdepth = 1 + Verdepth->a.clb->i; PUSHDOWN(Verdepth,inewint(curdepth)); switch(retval) { case C_RET: /* * attempt to return from error */ if(!contuab) error("Can't continue from this error", FALSE); popnames(errp->svbnp); errp = Popframe(); return(lispretval); case C_GO: /* * this may look like a valid prog, but it really * isn't, since go's are not allowed. Let the * user know. */ error("Can't 'go' through an error break",FALSE); /* NOT REACHED */ case C_INITIAL: /* * normal case, just fall through into read-eval-print * loop */ break; } lbot = np; protect(P(stdin)); protect(eofa); while(TRUE) { fprintf(stdout,"\n%d:>",curdepth); dmpport(stdout); vtemp = Lread(); if(vtemp == eofa) franzexit(0); printr(eval(vtemp),stdout); } } lispval calhan(limit,work,type,uniqid,contuab,message,handler) register lispval *work; lispval handler,type,contuab; register limit; register char *message; int uniqid; { register lispval handy; register struct argent *lbot, *np; lbot = np; protect(handler); /* funcall the handler */ protect(handy = newdot()); /* with a list consisting of */ handy->d.car = type; /* type, */ handy = (handy->d.cdr = newdot()); handy->d.car = inewint(uniqid); /* identifying number, */ handy = (handy->d.cdr = newdot()); handy->d.car = contuab; handy = (handy->d.cdr = newdot()); handy->d.car = matom(message); /* message to be typed out, */ while(limit-- > 0) { /* any other args. */ handy = handy->d.cdr = newdot(); handy->d.car = *work++; } handy->d.cdr = nil; handy = Lfuncal(); np=lbot; return(handy); } /* lispend **************************************************************/ /* Fatal errors come here, with their epitaph. */ lispend(mesg) char mesg[]; { dmpport(poport); fprintf(errport,"%s\n",mesg); dmpport(errport); franzexit(0); } /* namerr ***************************************************************/ /* handles namestack overflow, at present by simply giving a message */ namerr() { if((nplim = np + NAMINC) > orgnp + NAMESIZE) { printf("Unrecoverable Namestack Overflow, (reset) is forced\n"); fflush(stdout); nplim = orgnp + NAMESIZE - 4*NAMINC; lbot = np = nplim - NAMINC; protect(matom("reset")); Lfuncal(); } error("NAMESTACK OVERFLOW",FALSE); /* NOT REACHED */ } binderr() { bnp -= 10; error("Bindstack overflow.",FALSE); } rtaberr() { bindfix(Vreadtable,strtab,nil); error("Illegal read table.",FALSE); } badmem() { error("Attempt to allocate beyond static structures.",FALSE); } argerr(msg) char *msg; { errorh(Vermisc,"incorrect number of args to", nil,FALSE,0,matom(msg)); } h(stdout); nplim = orgnp + NAMESIZE - 4*NAMINC; lbot = np = nplim - NAMINC; protect(matom("reset")); Lfuncal(); } error("NAMESTACK OVERFLOW",FALSE); /* NOT REACHED */ } binderr() {((cmd/lisp/franz/eval.c 644 0 12 47776 2552701421 10020 static char *sccsid = "@(#)eval.c 35.3 7/9/81"; #include "global.h" #include #include "frame.h" /************************************************************************/ /* */ /* file: eval.c */ /* contents: evaluator and namestack maintenance routines */ /* */ /************************************************************************/ /* eval *****************************************************************/ /* returns the value of the pointer passed as the argument. */ lispval eval(actarg) lispval actarg; { #define argptr handy register lispval a = actarg; register lispval handy; register struct nament *namptr; register struct argent *workp; struct nament *oldbnp = bnp; int dopopframe = FALSE; lispval Ifcall(), Iarray(); Savestack(4); /*debugging if (rsetsw && rsetatom->a.clb != nil) { printf("Eval:"); printr(a,stdout); printf("\nrsetsw: %d evalhsw: %d\n", rsetsw, evalhsw); printf("*rset: "); printr(rsetatom->a.clb,stdout); printf(" evalhook: "); printr(evalhatom->a.clb,stdout); printf(" evalhook call flag^G: %d\n", evalhcallsw); fflush(stdout); }; */ /* check if an interrupt is pending and handle if so */ if(sigintcnt > 0) sigcall(SIGINT); if (rsetsw && rsetatom->a.clb != nil) /* if (*rset t) has been done */ { if (evalhsw != nil && evalhatom->a.clb != nil) { /*if (sstatus evalhook t) and evalhook non-nil */ if (evalhcallsw) /*if this is a call to evalhook, don't call evalhook function, but clear evalhcallsw , so recursive calls to eval cause evalhook function to fire. */ evalhcallsw = FALSE; else { /* setup equivalent of (funcall evalhook ) */ (np++)->val = a; /* push form on namestack */ lbot=np; /* set up args to funcall */ (np++)->val = evalhatom->a.clb; /* push evalhook's clb */ (np++)->val = a; /* eval's arg becomes 2nd arg to funcall */ PUSHDOWN(evalhatom, nil); /* lambda-bind evalhook to nil*/ PUSHDOWN(funhatom, nil); /* lambda-bind evalhook to nil*/ funhcallsw = TRUE; /* skip any funcall hook */ handy = Lfuncal(); /* now call funcall */ funhcallsw = FALSE; POP; POP; Restorestack(); return(handy); }; } errp = Pushframe(F_EVAL,a); dopopframe = TRUE; /* remember to pop later */ if(retval == C_FRETURN) { Restorestack(); errp = Popframe(); return(lispretval); } }; switch (TYPE(a)) { case ATOM: if (rsetsw && rsetatom->a.clb != nil && bptr_atom->a.clb != nil) { struct nament *bpntr, *eval1bptr; /* Both rsetsw and rsetatom for efficiency*/ /* bptr_atom set by second arg to eval1 */ eval1bptr = (struct nament *) bptr_atom->a.clb->d.cdr; /* eval1bptr is bnp when eval1 was called; if an atom was bound after this, then its clb is valid */ for (bpntr = eval1bptr; bpntr < bnp; bpntr++) if (bpntr->atm==a) { handy = a->a.clb; goto gotatom; }; /* Value saved in first binding of a, if any, after pointer to eval1, is the valid value, else use its clb */ for (bpntr = (struct nament *)bptr_atom->a.clb->d.car; bpntr < eval1bptr; bpntr++) if (bpntr->atm==a) { handy=bpntr->val; goto gotatom; /* Simply no way around goto here */ }; }; handy = a->a.clb; gotatom: if(handy==CNIL) { handy = errorh(Vermisc,"Unbound Variable:",nil,TRUE,0,a); } if(dopopframe) errp = Popframe(); Restorestack(); return(handy); case VALUE: if(dopopframe) errp = Popframe(); Restorestack(); return(a->l); case DTPR: (np++)->val = a; /* push form on namestack */ lbot = np; /* define beginning of argstack */ /* oldbnp = bnp; redundant - Mitch Marcus */ a = a->d.car; /* function name or lambda-expr */ for(EVER) { switch(TYPE(a)) { case ATOM: /* get function binding */ if(a->a.fnbnd==nil && a->a.clb!=nil) { a=a->a.clb; if(TYPE(a)==ATOM) a=a->a.fnbnd; } else a = a->a.fnbnd; break; case VALUE: a = a->l; /* get value */ break; } vtemp = (CNIL-1); /* sentinel value for error test */ funcal: switch (TYPE(a)) { case BCD: /* function */ argptr = actarg->d.cdr; /* decide whether lambda, nlambda or macro and push args onto argstack accordingly. */ if(a->bcd.discipline==nlambda) { (np++)->val = argptr; TNP; } else if(a->bcd.discipline==macro) { (np++)->val = actarg; TNP; } else for(;argptr!=nil; argptr = argptr->d.cdr) { (np++)->val = eval(argptr->d.car); TNP; } /* go for it */ if(TYPE(a->bcd.discipline)==STRNG) vtemp = Ifcall(a); else vtemp = (*(lispval (*)())(a->bcd.entry))(); break; case ARRAY: vtemp = Iarray(a,actarg->d.cdr,TRUE); break; case DTPR: /* push args on argstack according to type */ argptr = a->d.car; if (argptr==lambda) { for(argptr = actarg->d.cdr; argptr!=nil; argptr=argptr->d.cdr) { (np++)->val = eval(argptr->d.car); TNP; } } else if (argptr==nlambda) { (np++)->val = actarg->d.cdr; TNP; } else if (argptr==macro) { (np++)->val = actarg; TNP; } else if (argptr==lexpr) { for(argptr = actarg->d.cdr; argptr!=nil; argptr=argptr->d.cdr) { (np++)->val = eval(argptr->d.car); TNP; } handy = newdot(); handy->d.car = (lispval)lbot; handy->d.cdr = (lispval)np; PUSHDOWN(lexpr_atom,handy); lbot = np; (np++)->val = inewint(((lispval *)handy->d.cdr) - (lispval *)handy->d.car); } else break; /* something is wrong - this isn't a proper function */ argptr = (a->d.cdr)->d.car; namptr = bnp; workp = lbot; if(bnp + (np - lbot)> bnplim) binderr(); for(;argptr != (lispval)nil; workp++,argptr = argptr->d.cdr) /* rebind formal names (shallow) */ { if(argptr->d.car==nil) continue; /*if(((namptr)->atm = argptr->d.car)==nil) error("Attempt to lambda bind nil",FALSE);*/ namptr->atm = argptr->d.car; if (workp < np) { namptr->val = namptr->atm->a.clb; namptr->atm->a.clb = workp->val; } else bnp = namptr, error("Too few actual parameters",FALSE); namptr++; } bnp = namptr; if (workp < np) error("Too many actual parameters",FALSE); /* execute body, implied prog allowed */ for (handy = a->d.cdr->d.cdr; handy != nil; handy = handy->d.cdr) { vtemp = eval(handy->d.car); } } if (vtemp != (CNIL-1)) { /* if we get here with a believable value, */ /* we must have executed a function. */ popnames(oldbnp); /* in case some clown trashed t */ tatom->a.clb = (lispval) tatom; if(a->d.car==macro) vtemp = eval(vtemp); /* It is of the most wonderful coincidence that the offset for car is the same as for discipline so we get bcd macros for free here ! */ if(dopopframe) errp = Popframe(); Restorestack(); return(vtemp); } popnames(oldbnp); a = (lispval) errorh(Verundef,"eval: Undefined function ",nil,TRUE,0,actarg->d.car); } } if(dopopframe) errp = Popframe(); Restorestack(); return(a); /* other data types are considered constants */ } /* popnames *************************************************************/ /* removes from the name stack all entries above the first argument. */ /* routine should usually be used to clean up the name stack as it */ /* knows about the special cases. np is returned pointing to the */ /* same place as the argument passed. */ lispval popnames(llimit) register struct nament *llimit; { register struct nament *rnp; for(rnp = bnp; --rnp >= llimit;) rnp->atm->a.clb = rnp->val; bnp = llimit; } /***************************************************************((*********/ /* */ /* file: apply.c */ /* Caveat -- Work in Progress -- not guaranteed! not tested! */ /* */ /* apply ***************************************************************/ lispval Lapply() { register lispval a; register lispval handy; register struct argent *workp; register struct nament *namptr; register struct argent *lbot; register struct argent *np; lispval vtemp; struct nament *oldbnp = bnp; struct argent *oldlbot = lbot; /* Bottom of my frame! */ a = lbot->val; argptr = lbot[1].val; if(np-lbot!=2) errorh(Vermisc,"Apply: Wrong number of args.",nil,FALSE, 999,a,argptr); if(TYPE(argptr)!=DTPR && argptr!=nil) argptr = errorh(Vermisc,"Apply: non-list of args",nil,TRUE, 998,argptr); (np++)->val = a; /* push form on namestack */ TNP; lbot = np; /* bottom of current frame */ for(EVER) { if (TYPE(a) == ATOM) a = a->a.fnbnd; /* get function definition (unless calling form is itself a lambda- expression) */ vtemp = CNIL; /* sentinel value for error test */ switch (TYPE(a)) { case BCD: /* push arguments - value of a */ if(a->bcd.discipline==nlambda || a->bcd.discipline==macro) { (np++)->val=argptr; TNP; } else for (; argptr!=nil; argptr = argptr->d.cdr) { (np++)->val=argptr->d.car; TNP; } if(TYPE(a->bcd.discipline) == STRNG) vtemp = Ifcall(a); /* foreign function */ else vtemp = (*(lispval (*)())(a->bcd.entry))(); /* go for it */ break; case ARRAY: vtemp = Iarray(a,argptr,FALSE); break; case DTPR: if (a->d.car==nlambda || a->d.car==macro) { (np++)->val = argptr; TNP; } else if (a->d.car==lambda) for (; argptr!=nil; argptr = argptr->d.cdr) { (np++)->val = argptr->d.car; TNP; } else if(a->d.car==lexpr) { for (; argptr!=nil; argptr = argptr->d.cdr) { (np++)->val = argptr->d.car; TNP; } handy = newdot(); handy->d.car = (lispval)lbot; handy->d.cdr = (lispval)np; PUSHDOWN(lexpr_atom,handy); lbot = np; (np++)->val = inewint(((lispval *)handy->d.cdr) - (lispval *)handy->d.car); } else break; /* something is wrong - this isn't a proper function */ rebind(a->d.cdr->d.car,lbot); np = lbot; for (handy = a->d.cdr->d.cdr; handy != nil; handy = handy->d.cdr) { vtemp = eval(handy->d.car); /* go for it */ } } if (vtemp != CNIL) /* if we get here with a believable value, */ /* we must have executed a function. */ { popnames(oldbnp); /* in case some clown trashed t */ tatom->a.clb = (lispval) tatom; return(vtemp); } popnames(oldbnp); a = (lispval) errorh(Verundef,"apply: Undefined Function ", nil,TRUE,0,oldlbot->val); } /*NOT REACHED*/ } /* * Rebind -- rebind formal names */ rebind(argptr,workp) register lispval argptr; /* argptr points to list of atoms */ register struct argent * workp; /* workp points to position on stack where evaluated args begin */ { register lispval vtemp; register struct nament *namptr = bnp; register struct argent *lbot; register struct argent *np; for(;argptr != (lispval)nil; workp++,argptr = argptr->d.cdr) /* rebind formal names (shallow) */ { if(argptr->d.car==nil) continue; namptr->atm = argptr->d.car; if (workp < np) { namptr->val = namptr->atm->a.clb; namptr->atm->a.clb = workp->val; } else bnp = namptr, error("Too few actual parameters",FALSE); namptr++; if(namptr > bnplim) binderr(); } bnp = namptr; if (workp < np) error("Too many actual parameters",FALSE); } /* the argument to Lfuncal is optional, if it is given then it is * the name of the function to call and lbot points to the first arg. * if it is not given, then lbot points to the function to call */ lispval Lfuncal(fcn) lispval fcn; { register lispval a; register lispval handy; register struct nament **namptr; struct nament *oldbnp = bnp; /* MUST be first local for evalframe */ lispval fcncalled; lispval Ifcall(),Llist(),Iarray(); lispval vtemp; int typ, dopopframe = FALSE; extern lispval end[]; Savestack(3); if(nargs()==1) /* function I am evaling. */ a = fcncalled = fcn; else { a = fcncalled = lbot->val; lbot++; } /*debugging if (rsetsw && rsetatom->a.clb != nil) { printf("funcall:"); printr(a,stdout); printf("\nrsetsw: %d evalhsw: %d\n", rsetsw, evalhsw); printf("*rset: "); printr(rsetatom->a.clb,stdout); printf(" funhook: "); printr(funhatom->a.clb,stdout); printf(" funhook call flag^G: %d\n",funhcallsw); fflush(stdout); }; */ /* check if exception pending */ if(sigintcnt > 0 ) sigcall(SIGINT); if (rsetsw && rsetatom->a.clb != nil) /* if (*rset t) has been done */ { if (evalhsw != nil && funhatom->a.clb != nil) { /*if (sstatus evalhook t) and evalhook non-nil */ if (funhcallsw) /*if this is a call to evalhook, don't call evalhook function, but clear evalhcallsw , so recursive calls to eval cause evalhook function to fire. */ funhcallsw = FALSE; else { /* setup equivalent of (funcall funcallhook ) */ protect(a); a = fcncalled = funhatom->a.clb; /* new function to funcall */ PUSHDOWN(funhatom, nil); /* lambda-bind * funcallhook to nil */ PUSHDOWN(evalhatom, nil); /* printf(" now will funcall "); printr(a,stdout); putchar('\n'); fflush(stdout); */ }; } errp = Pushframe(F_FUNCALL,a); dopopframe = TRUE; /* remember to pop later */ if(retval == C_FRETURN) { Restorestack(); popnames(oldbnp); errp = Popframe(); return(lispretval); } }; for(EVER) { top: typ = TYPE(a); if (typ == ATOM) a = a->a.fnbnd, typ = TYPE(a); /* get function defn (unless calling form */ /* is itself a lambda-expr) */ vtemp = CNIL-1; /* sentinel value for error test */ switch (typ) { case ARRAY: protect(a); /* stack array descriptor on top */ a = a->ar.accfun; /* now funcall access function */ goto top; case BCD: if(a->bcd.discipline==nlambda) { if(np==lbot) protect(nil); /* default is nil */ while(np-lbot!=1 || (lbot->val != nil && TYPE(lbot->val)!=DTPR)) { lbot->val = errorh(Vermisc,"Bad funcall arg(s) to fexpr.", nil,TRUE,0,lbot->val); np = lbot+1; } } /* go for it */ if(TYPE(a->bcd.discipline)==STRNG) vtemp = Ifcall(a); else vtemp = (*(lispval (*)())(a->bcd.entry))(); if(a->bcd.discipline==macro) vtemp = eval(vtemp); break; case DTPR: if (a->d.car == lambda) { ;/* VOID */ } else if (a->d.car == nlambda || a->d.car==macro) { if( np==lbot ) protect(nil); /* default */ while(np-lbot!=1 || (lbot->val != nil && TYPE(lbot->val)!=DTPR)) { lbot->val = error("Bad funcall arg(s) to fexpr.",TRUE); np = lbot+1; } } else if (a->d.car == lexpr) { handy = newdot(); handy->d.car = (lispval) lbot; handy->d.cdr = (lispval) np; PUSHDOWN(lexpr_atom,handy); lbot = np; (np++)->val = inewint(((lispval *)handy->d.cdr) - (lispval *)handy->d.car); } else break; /* something is wrong - this isn't a proper function */ rebind(a->d.cdr->d.car,lbot); np = lbot; for (handy = a->d.cdr->d.cdr; handy != nil; handy = handy->d.cdr) { vtemp = eval(handy->d.car); /* go for it */ } if(a->d.car==macro) vtemp = eval(vtemp); } if (vtemp != CNIL-1) /* if we get here with a believable value, */ /* we must have executed a function. */ { popnames(oldbnp); /* in case some clown trashed t */ tatom->a.clb = (lispval) tatom; if(dopopframe) errp = Popframe(); return(vtemp); } popnames(oldbnp); a = fcncalled = (lispval) errorh(Verundef,"funcall: Bad function", nil,TRUE,0,fcncalled); } /*NOT REACHED*/ } /* The following must be the next "function" after Lfuncal, for the sake of Levalf. */ fchack () {} #undef protect /* protect **************************************************************/ /* pushes the first argument onto namestack, thereby protecting from gc */ lispval protect(a) lispval a; { (np++)->val = a; if (np >= nplim) namerr(); } /* unprot ****************************************************************/ /* returns the top thing on the name stack. Underflow had better not */ /* occur. */ lispval unprot() { return((--np)->val); } lispval linterp() { error("BYTE INTERPRETER CALLED ERRONEOUSLY",FALSE); } /* Undeff - called from qfuncl when it detects a call to a undefined func((tion from compiled code, we print out a message and dont allow continuation */ lispval Undeff(atmn) lispval atmn; { return(errorh(Verundef,"Undefined function called from compiled code ", nil,TRUE,0,atmn)); } bindfix(firstarg) lispval firstarg; { register lispval *argp = &firstarg; register struct nament *mybnp = bnp; while(*argp != nil) { mybnp->atm = *argp++; mybnp->val = mybnp->atm->a.clb; mybnp->atm->a.clb = *argp++; bnp = mybnp++; } } nccmd/lisp/franz/eval2.c 644 0 12 6005 2552701421 10036 static char *sccsid = "@(#)eval2.c 35.2 5/18/81"; #include "global.h" /* Iarray - handle array call. * fun - array object * args - arguments to the array call , most likely subscripts. * evalp - flag, if TRUE then the arguments should be evaluated when they * are stacked. */ lispval Iarray(fun,args,evalp) register lispval fun,args; { register lispval reg, temp; register struct argent *lbot, *np; lbot = np; protect(fun->ar.accfun); for ( ; args != nil ; args = args->d.cdr) /* stack subscripts */ if(evalp) protect(eval(args->d.car)); else protect(args->d.car); protect(fun); return(vtemp = Lfuncal()); } /* Ifcall :: call foreign function/subroutine * Ifcall is handed a binary object which is the function to call. * This function has already been determined to be a foreign function * by noticing that its discipline field is a string. * The arguments to pass have already been evaluated and stacked. We * create on the stack a 'callg' type argument list to give to the * function. What is passed to the foreign function depends on the * type of argument. Certain args are passes directly, others must be * copied since the foreign function my want to change them. * When the foreign function returns, we may have to box the result, * depending on the type of foreign function. */ lispval Ifcall(a) lispval a; { int *alloca(); register int *arglist; register int index; register struct argent *mynp; register lispval ltemp; register struct argent *lbot; register struct argent *np; int itemp; int nargs = np - lbot; arglist = alloca((nargs + 1) * sizeof(int)); mynp = lbot; *arglist = nargs; for(index = 1; index <= nargs; index++) { switch(TYPE(ltemp=mynp->val)) { /* fixnums and flonums must be reboxed */ case INT: arglist[index] = sp(); stack(0); *(int *) arglist[index] = ltemp->i; break; case DOUB: stack(0); arglist[index] = sp(); stack(0); *(double *) arglist[index] = ltemp->r; break; /* these can all be sent directly */ case HUNK2: case HUNK4: case HUNK8: case HUNK16: case HUNK32: case HUNK64: case HUNK128: case DTPR: case ATOM: case SDOT: case STRNG: arglist[index] = (int) ltemp; break; /* these cause only part of the structure to be sent */ case ARRAY: arglist[index] = (int) ltemp->ar.data; break; case BCD: arglist[index] = (int) ltemp->bcd.entry; break; default: error("foreign call: illegal argument ",FALSE); break; } mynp++; } switch(((char *)a->bcd.discipline)[0]) { case 'i': /* integer-function */ ltemp = inewint(callg(a->bcd.entry,arglist)); break; case 'r': /* real-function*/ ltemp = newdoub(); ltemp->r = (* ((double (*)()) callg))(a->bcd.entry,arglist); break; case 'f': /* function */ ltemp = (lispval) callg(a->bcd.entry,arglist); break; default: case 's': /* subroutine */ callg(a->bcd.entry,arglist); ltemp = tatom; } return(ltemp); } callg(funct,arglist) lispval (*funct)(); int *arglist; { asm(" callg *8(ap),*4(ap)"); } case 'i': /* integer-function */ ltemp = inewint(callg(a->bcd.entry,arglist)); break; case 'r': /* real-function*/ ltemp = newdoub(); ltemp->r = (* ((double (*)()) callg))(a->bcd.entry,arglist); break; case 'f': /* function */ ltemp = (lispval) callg(a->bcd.entry,arglist); break; default: case 's': /* subroutine */ callg(a->bcd.entry,arglist); ltemp = tatom; } return(ltemp); } callg(funct,arglist) lispval (*funct)(); int *arglist; { asm(" callg *8(ap),*4(ap)"cmd/lisp/franz/evalf.c 644 0 12 11303 2552701422 10140 static char *sccsid = "@(#)evalf.c 35.2 7/1/81"; #include "global.h" #include "frame.h" lispval Levalf () { register struct frame *myfp; register lispval handy, result; struct frame *searchforpdl(); int evaltype; Savestack(3); if(lbot==np) handy = nil; else if((np-lbot) == 1) handy = lbot->val; else argerr("evalf"); if (handy == nil) /* Arg of nil means start at the top */ { myfp = searchforpdl(errp); /* * myfp may be nil, if *rset t wasn't done. In that case we * just return nil */ if(myfp == (struct frame *) 0) return(nil); /* * myfp may point to the call to evalframe, in which case we * want to go to the next frame down. myfp will not point * to the call to evalframe if for example the translink tables * are turned on and the call came from compiled code */ if( ((myfp->class == F_EVAL) && TYPE(myfp->larg1) == DTPR && myfp->larg1->d.car == Vevalframe) || ((myfp->class == F_FUNCALL) && (myfp->larg1 = Vevalframe))) myfp = searchforpdl(myfp->olderrp); /* advance to next frame */ } else { if( TYPE(handy) != INT ) error("Arg to evalframe must be integer",TRUE); /* * Interesting artifact: A pdl pointer will be an INT, but if * read in, the Franz reader produces a bignum, thus giving some * protection from being hacked. */ myfp = (struct frame *)(handy->i); verifypdlp(myfp); /* make sure we are given valid pointer */ myfp = searchforpdl(myfp); if (myfp == (struct frame *) 0 ) return(nil); /* end of frames */ myfp = searchforpdl(myfp->olderrp); /* advance to next one */ }; if (myfp == (struct frame *) 0 ) return(nil); /* end of frames */ if(myfp->class == F_EVAL) evaltype = TRUE; else evaltype = FALSE; /* return ( ) */ protect(result = newdot()); /* * See maclisp manual for difference between eval frames and apply * frames, or else see the code below. */ result->d.car = matom (evaltype ? "eval" : "apply"); result->d.cdr = (handy = newdot()); handy->d.car = inewint(myfp); /* The frame pointer as a lisp int */ handy->d.cdr = newdot(); handy = handy->d.cdr; if (evaltype) handy->d.car = myfp->larg1; /* eval type - simply the arg to eval */ else { /* * apply type ; must build argument list. The form will look like * * ( ( ....)) * i.e. the function name followed by a list of evaluated args */ lispval form, handy1, arglist; struct argent *pntr; (form = newdot())->d.car = myfp->larg1; handy->d.car = form; /* link in to save from gc */ (form->d.cdr = newdot())->d.cdr = nil; for (arglist = nil, pntr = myfp->svlbot; pntr < myfp->svnp; pntr++) { if(arglist == nil) { protect(arglist = newdot()); form->d.cdr->d.car = arglist; /* save from gc */ } else arglist = (arglist->d.cdr = newdot()); arglist->d.car = pntr->val; }; }; handy->d.cdr = newdot(); handy = handy->d.cdr; /* Next is index into bindstack lisp pseudo-array, for maximum usefulness */ handy->d.car = inewint( myfp->svbnp - orgbnp); handy->d.cdr = newdot(); handy = handy->d.cdr; handy->d.car = inewint(myfp->svnp - orgnp); /* index of np in namestack*/ handy->d.cdr = newdot(); handy = handy->d.cdr; handy->d.car = inewint(myfp->svlbot - orgnp);/* index of lbot in namestack*/ return(result); } struct frame *searchforpdl (myfp) struct frame *myfp; { /* * for safety sake, we verify that this is a real pdl pointer by * tracing back all pdl pointers from the start * then after we find it, we just advance to next F_EVAL or F_FUNCALL */ verifypdlp(myfp); for( ; myfp != (struct frame *)0 ; myfp= myfp->olderrp) { if((myfp->class == F_EVAL) || (myfp->class == F_FUNCALL)) return(myfp); } return((struct frame *)0); } /* * verifypdlp :: verify pdl pointer as existing, do not return unless * it is valid */ verifypdlp(curfp) register struct frame *curfp; { register struct frame *myfp; for (myfp = errp; myfp != (struct frame *)0 ; myfp = myfp->olderrp) if(myfp == curfp) return; errorh(Vermisc,"Invalid pdl pointer given: ",nil,FALSE,0,inewint(curfp)); } lispval Lfretn () { struct frame *myfp; chkarg(2,"freturn"); if( TYPE(lbot->val) != INT ) error("freturn: 1st arg not pdl pointer",FALSE); myfp = (struct frame *) (lbot->val->i); verifypdlp(myfp); /* make sure pdlp is valid */ retval = C_FRETURN; /* signal coming from freturn */ lispretval = (lbot+1)->val; /* value to return */ Iretfromfr(myfp); /* NOT REACHED */ } == curfp) return; errorh(Vermisc,"Invalid pdl pointer given: ",nil,FALSE,0,inewint(curfp)); } lispval Lfretn () { struct frame *myfp; chkarg(2,"freturn"); if( TYPE(lbot->val) != INT ) error("freturn: 1st arg not pdl pointer",FALSE); myfp = (struct frame *) (lbot->val->i); verifypdlp(myf((cmd/lisp/franz/fex1.c 644 0 12 22644 2574143770 7732 static char *sccsid = "@(#)fex1.c 35.2 7/1/81"; #include "global.h" #include "frame.h" /* Nprog ****************************************************************/ /* This first sets the local variables to nil while saving their old */ /* values on the name stack. Then, pointers to various things are */ /* saved as this function may be returned to by an "Ngo" or by a */ /* "Lreturn". At the end is the loop that cycles through the contents */ /* of the prog. */ lispval Nprog() { register lispval where, temp; struct nament *savedbnp = bnp; extern struct frame *errp; extern int retval; extern lispval lispretval; if((np-lbot) < 1) chkarg(1,"prog"); /* shallow bind the local variables to nil */ if(lbot->val->d.car != nil) { for( where = lbot->val->d.car ; where != nil; where = where->d.cdr ) { if(TYPE(where) != DTPR || TYPE(temp=where->d.car) != ATOM) errorh(Vermisc, "Illegal local variable list in prog ",nil,FALSE, 1,where); PUSHDOWN(temp,nil); } } /* put a frame on the stack which can be 'return'ed to or 'go'ed to */ errp = Pushframe(F_PROG); where = lbot->val->d.cdr; /* first thing in the prog body */ switch (retval) { case C_RET: /* * returning from this prog, value to return * is in lispretval */ errp = Popframe(); popnames(savedbnp); return(lispretval); case C_GO: /* * going to a certain label, label to go to in * in lispretval */ where = (lbot->val)->d.cdr; while ((TYPE(where) == DTPR) && (where->d.car != lispretval)) where = where->d.cdr; if (where->d.car == lispretval) { popnames(errp->svbnp); break; } /* label not found in this prog, must * go up to higher prog */ errp = Popframe(); /* go to next frame */ Inonlocalgo(C_GO,lispretval,nil); /* NOT REACHED */ case C_INITIAL: break; } while (TYPE(where) == DTPR) { temp = where->d.car; if((TYPE(temp))!=ATOM) eval(temp); where = where->d.cdr; } if((where != nil) && (TYPE(where) != DTPR)) errorh(Vermisc,"Illegal form in prog body ", nil,FALSE,0,where); errp = Popframe(); popnames(savedbnp); /* pop off locals */ return(nil); } lispval globtag; /* Ncatch is now linked to the lisp symbol *catch , which has the form (*catch tag form) tag is evaluated and then the catch entry is set up. then form is evaluated finally the catch entry is removed. *catch is still an nlambda since its arguments should not be evaluated before this routine is called. (catch form [tag]) is translated to (*catch 'tag form) by a macro. */ lispval Ncatch() { register lispval tag; Savestack(3); /* save stack pointers */ if((TYPE(lbot->val))!=DTPR) return(nil); protect(tag = eval(lbot->val->d.car)); /* protect tag from gc */ errp = Pushframe(F_CATCH,tag); switch(retval) { case C_THROW: /* * value thrown is in lispretval */ break; case C_INITIAL: /* * calculate value of expression */ lispretval = eval(lbot->val->d.cdr->d.car); } errp = Popframe(); Restorestack(); return(lispretval); } /* (errset form [flag]) if present, flag determines if the error message will be printed if an error reaches the errset. if no error occurs, errset returns a list of one element, the value returned from form. if an error occurs, nil is usually returned although it could be non nil if err threw a non nil value */ lispval Nerrset() { lispval temp,flag; Savestack(0); if(TYPE(lbot->val) != DTPR) return(nil); /* no form */ /* evaluate and save flag first */ flag = lbot->val->d.cdr; if(TYPE(flag) == DTPR) flag = eval(flag->d.car); else flag = tatom; /* if not present , assume t */ protect(flag); errp = Pushframe(F_CATCH,Verall,flag); switch(retval) { case C_THROW: /* * error thrown to this routine, value thrown is * in lispretval */ break; case C_INITIAL: /* * normally just evaluate expression and listify it. */ temp = eval(lbot->val->d.car); protect(temp); (lispretval = newdot())->d.car = temp; break; } errp = Popframe(); Restorestack(); return(lispretval); } /* this was changed from throw to *throw 21nov79 it is now a lambda and really should be called Lthrow */ Nthrow() { switch(np-lbot) { case 0: protect(nil); case 1: protect(nil); case 2: break; default: argerr("throw"); } Inonlocalgo(C_THROW,lbot->val,(lbot+1)->val); /* NOT REACHED */ } /* Ngo ******************************************************************/ /* First argument only is checked - and must be an atom or evaluate */ /* to one. */ Ngo() { register lispval temp; chkarg(1,"go"); temp = (lbot->val)->d.car; if (TYPE(temp) != ATOM) { temp = eval(temp); while(TYPE(temp) != ATOM) temp = errorh(Vermisc,"Illegal tag to go to",nil,TRUE, 0,lbot->val); } Inonlocalgo(C_GO,temp,nil); /* NOT REACHED */ } /* Nreset ***************************************************************/ /* All arguments are ignored. This just returns-from-break to depth 0. */ Nreset() { Inonlocalgo(C_RESET,inewint(0),nil); } /* Nresetio *************************************************************/ lispval Nresetio() { register FILE *p; for(p = &_iob[3]; p < _iob + _NFILE; p++) { if(p->_flag & (_IOWRT | _IOREAD)) fclose(p); } return(nil); } /* Nbreak ***************************************************************/ /* If first argument is not nil, this is evaluated and printed. Then */ /* error is called with the "breaking" message. */ lispval Nbreak() { register lispval hold; register FILE *port; port = okport(Vpoport->a.clb,stdout); fprintf(port,"Breaking:"); if ((hold = lbot->val) != nil && ((hold = hold->d.car) != nil)) { printr(hold,port); } putc('\n',port); dmpport(port); return(errorh(Verbrk,"",nil,TRUE,0)); } /* Nexit ****************************************************************/ /* Just calls lispend with no message. */ Nexit() { lispend(""); } /* Nsys *****************************************************************/ /* Just calls lispend with no message. */ lispval Nsys() { lispend(""); } lispval Ndef() { register lispval arglist, body, name, form; snpand(4); form = lbot->val; name = form->d.car; body = form->d.cdr->d.car; arglist = body->d.cdr->d.car; if((TYPE(arglist))!=DTPR && arglist != nil) error("Warning: defining function with nonlist of args", TRUE); name->a.fnbnd = body; return(name); } lispval Nquote() { snpand(0); return((lbot->val)->d.car); } lispval Nsetq() { register lispval handy, where, value; register int lefttype; register struct argent *lbot, *np; for(where = lbot->val; where != nil; where = handy->d.cdr) { handy = where->d.cdr; if((TYPE(handy))!=DTPR) error("odd number of args to setq",FALSE); if((lefttype=TYPE(where->d.car))==ATOM) { if(where->d.car==nil) error("Attempt to set nil",FALSE); where->d.car->a.clb = value = eval(handy->d.car); }else if(lefttype==VALUE) where->d.car->l = value = eval(handy->d.car); else error("CAN ONLY SETQ ATOMS OR VALUES",FALSE); } return(value); } lispval Ncond() { register lispval where, last; snpand(2); where = lbot->val; last = nil; for(;;) { if ((TYPE(where))!=DTPR) break; if ((TYPE(where->d.car))!=DTPR) break; if ((last=eval((where->d.car)->d.car)) != nil) break; where = where->d.cdr; } if ((TYPE(where)) != DTPR) return(nil); where = (where->d.car)->d.cdr; while ((TYPE(where))==DTPR) { last = eval(where->d.car); where = where->d.cdr; } return(last); } lispval Nand() { register lispval current, temp; snpand(2); current = lbot->val; temp = tatom; while (current != nil) if ( (temp = current->d.car)!=nil && (temp = eval(temp))!=nil) current = current->d.cdr; else { current = nil; temp = nil; } return(temp); } lispval Nor() { register lispval current, temp; snpand(2); current = lbot->val; temp = nil; while (current != nil) if ( (temp = eval(current->d.car)) == nil) current = current->d.cdr; else break; return(temp); } lispval Nprocess() { int wflag , childsi , childso , childnum, child; register lispval current, temp; char * sharg; int handler; int itemp; FILE *bufs[2],*obufs[2]; wflag = 1; childsi = 0; childso = 1; current = lbot->val; if( (TYPE(current))!=DTPR ) return(nil); temp = current->d.car; if( (TYPE(temp))!=ATOM ) return(nil); sharg = temp->a.pname; if( (current = current->d.cdr)!=nil && (TYPE((temp = current->d.car)))==ATOM ) { if (temp == tatom) { wflag = 0; childsi = 0; } else if (temp != nil) { fpipe(bufs); wflag = 0; temp->a.clb = P(bufs[1]); childsi = fileno(bufs[0]); } if( (current = current->d.cdr)!=nil && (TYPE((temp = current->d.car)))==ATOM ) { if (temp != nil) { fpipe(obufs); temp->a.clb = P(obufs[0]); childso = fileno(obufs[1]); } } } handler = signal(2,1); if((child = vfork()) == 0 ) { if(wflag!=0 && handler !=1) signal(2,0); else signal(2,1); if(childsi != 0) { close(0); dup(childsi); } if (childso !=1) { close(1); dup(childso); } execlp("csh", "csh", "-c",sharg,0); execlp("sh", "sh", "-c",sharg,0); _exit(-1); /* if exec fails, signal problems*/ } if(childsi != 0) fclose(bufs[0]); if(childso != 1) fclose(obufs[1]); if(wflag && child!= -1) { int status=0; while(wait(&status)!=child) {} itemp = status >> 8; } else itemp = child; signal(2,handler); return(inewint(itemp)); } al(2,0); else signal(2,1); if(childsi != 0) { close(0); dup(childsi); } if ((cmd/lisp/franz/fex2.c 644 0 12 15667 2552701423 7731 static char *sccsid = "@(#)fex2.c 35.3 7/1/81"; #include "global.h" #define NDOVARS 30 #include #include "frame.h" /* * Ndo maclisp do function. */ lispval Ndo() { register lispval current, where, handy; register struct nament *mybnp; lispval temp, atom; lispval body, endtest, endform, varstuff, renewals[NDOVARS] ; struct argent *getem, *startnp; struct nament *savedbnp = bnp; int count, repeatdo, index, virgin = 1; extern struct frame *errp; Savestack(3); current = lbot->val; varstuff = current->d.car; switch( TYPE(varstuff) ) { case ATOM: /* This is old style maclisp do; atom is var, cadr(current) = init; caddr(current) = repeat etc. */ if(varstuff==nil) goto newstyle; current = current->d.cdr; /* car(current) is now init */ PUSHDOWN(varstuff,eval(current->d.car)); /* Init var. */ *renewals = (current = current->d.cdr)->d.car; /* get repeat form */ endtest = (current = current->d.cdr)->d.car; body = current->d.cdr; errp = Pushframe(F_PROG); switch (retval) { case C_RET: /* * returning from this prog, value to return * is in lispretval */ errp = Popframe(); popnames(savedbnp); return(lispretval); case C_GO: /* * going to a certain label, label to go to in * in lispretval */ where = body; while ((TYPE(where) == DTPR) & (where->d.car != lispretval)) where = where->d.cdr; if (where->d.car == lispretval) { popnames(errp->svbnp); break; } /* label not found in this prog, must * go up to higher prog */ Inonlocalgo(C_GO,lispretval,nil); /* NOT REACHED */ case C_INITIAL: break; /* fall through */ } while(TRUE) { if(eval(endtest)!=nil) { errp = Popframe(); popnames(savedbnp); return(nil); } where = body; while (TYPE(where) == DTPR) { temp = where->d.car; if((TYPE(temp))!=ATOM) eval(temp); where = where->d.cdr; } varstuff->a.clb = eval(*renewals); } newstyle: case DTPR: /* New style maclisp do; atom is list of things of the form (var init repeat) */ count = 0; startnp = np; for(where = varstuff; where != nil; where = where->d.cdr) { /* do inits and count do vars. */ /* requires "simultaneous" eval of all inits */ handy = where->d.car->d.cdr; temp = nil; if(handy !=nil) temp = eval(handy->d.car); protect(temp); count++; } if(count > NDOVARS) error("More than 15 do vars",FALSE); where = varstuff; getem = startnp; /* base of stack of init forms */ for(index = 0; index < count; index++) { handy = where->d.car; /* get var name from group */ atom = handy->d.car; while(TYPE(atom) != ATOM) atom = errorh(Vermisc,"do variable must be a symbol ", nil,TRUE,0,atom); PUSHDOWN(atom,getem->val); getem++; handy = handy->d.cdr->d.cdr; if(handy==nil) handy = CNIL; /* be sure not to rebind later */ else handy = handy->d.car; renewals[index] = handy; /* more loop "increments" */ where = where->d.cdr; } np = startnp; /* pop off all init forms */ /* Examine End test and End form */ current = current->d.cdr; handy = current->d.car; body = current->d.cdr; /* * a do form with a test of nil just does the body once * and returns nil */ if (handy == nil) repeatdo = 1; /* just do it once */ else repeatdo = -1; /* do it forever */ endtest = handy->d.car; endform = handy->d.cdr; where = body; errp = Pushframe(F_PROG); while(TRUE) { switch (retval) { case C_RET: /* * returning from this prog, value to return * is in lispretval */ errp = Popframe(); popnames(savedbnp); Restorestack(); return(lispretval); case C_GO: /* * going to a certain label, label to go to in * in lispretval */ where = body; while ((TYPE(where) == DTPR) & (where->d.car != lispretval)) where = where->d.cdr; if (where->d.car == lispretval) { popnames(errp->svbnp); break; } /* label not found in this prog, must * go up to higher prog */ Inonlocalgo(C_GO,lispretval,nil); /* NOT REACHED */ case C_INITIAL: break; /* fall through */ } loop: np = startnp; /* is bumped when doing repeat forms */ if((repeatdo-- == 0) || (eval(endtest) !=nil)) { for(handy = nil; endform!=nil; endform = endform->d.cdr) { handy = eval(endform->d.car); } errp = Popframe(); popnames(savedbnp); Restorestack(); return(handy); } while (TYPE(where) == DTPR) { temp = where->d.car; if((TYPE(temp))!=ATOM) eval(temp); where = where->d.cdr; } where = body; getem = np = startnp; /* Simultaneously eval repeat forms */ for(index = 0; index < count; index++) { temp = renewals[index]; if (temp == nil || temp == CNIL) protect(temp); else protect(eval(temp)); } /* now simult. rebind all the atoms */ mybnp = savedbnp; for(index = 0; index < count; index++) { if( getem->val != CNIL ) /* if this atom has a repeat */ mybnp->atm->a.clb = (getem)->val; /* rebind */ mybnp++; getem++; } goto loop; } } } lispval Nprogv() { register lispval where, handy; register struct nament *namptr; register struct argent *vars, *lbot, *np; struct argent *start; struct nament *oldbnp = bnp; where = lbot->val; protect(eval(where->d.car)); /* list of vars = lbot[1].val */ protect(eval((where = where->d.cdr)->d.car)); /* list of vals */ handy = lbot[2].val; start = np; namptr = oldbnp; /* simultaneous eval of all args */ for(;handy!=nil; handy = handy->d.cdr) { (np++)->val = (handy->d.car); /* Note, each element should not be reevaluated like it * was before. - dhl */ /* Before: (np++)->val = eval(handy->d.car);*/ TNP; } asm("# Here is where rebinding is done"); /* very cute */ for(handy=lbot[1].val,vars=lbot+3; handy!=nil; handy=handy->d.cdr) { namptr->atm = handy->d.car; ++namptr; /* protect against interrupts while re-lambda binding */ bnp = namptr; namptr[-1].atm = handy->d.car; namptr[-1].val = handy->d.car->a.clb; if(vars < np) handy->d.car->a.clb = vars++->val; else handy->d.car->a.clb = nil; } handy = nil; for(where = where->d.cdr; where != nil; where = where->d.cdr) handy = eval(where->d.car); popnames(oldbnp); return(handy); } lispval Nprogn() { register lispval result, where; snpand(2); result = nil; for(where = lbot->val; where != nil; where = where->d.cdr) result = eval(where->d.car); return(result); } lispval Nprog2() { register lispval result, where; snpand(2); where = lbot->val; eval(where->d.car); result = eval((where = where->d.cdr)->d.car); protect(result); for(where = where->d.cdr; where != nil; where = where->d.cdr) eval(where->d.car); return(result); } car); popnames(oldbnp); return(handy); } lispval Nprogn() { register cmd/lisp/franz/fex3.c 644 0 12 13336 2552701423 7721 static char *sccsid = "@(#)fex3.c 35.1 5/6/81"; #include "global.h" #include /* chkarg ***************************************************************/ /* This insures that there are at least expnum arguments passed to the */ /* BCD function that calls this. If there are fewer, nil arguments */ /* are pushed onto the name stack and np adjusted accordingly. */ #ifdef chkarg #undef chkarg #endif chkarg(expnum,string) int expnum; /* expected number of args */ char string[]; { register struct argent *work; register r10,r9,r8; register struct argent *lbot, *np; saveonly(1); for(work = np,np = lbot + expnum; work < np; ) work++->val = nil; } /* *Ndumplisp -- create executable version of current state of this lisp. */ #include "a.out.h" asm(" .globl Dlast") lispval Ndumplisp() { register struct exec *workp; register lispval argptr, temp; register char *fname; extern lispval reborn; struct exec work, old; extern etext; extern int dmpmode,holend,curhbeg,usehole; extern int end; int descrip, des2, count, ax,mode; char tbuf[BUFSIZ]; snpand(4); #ifndef UNIXTS vadvise(VA_ANOM); #endif /* dump mode is kept in decimal (which looks like octal in dmpmode) and is changeable via (sstatus dumpmode n) where n is 413 or 410 base 10 */ if(dmpmode == 413) mode = 0413; else mode = 0410; workp = &work; workp->a_magic = mode; if(usehole) workp->a_text = curhbeg & (~PAGRND); else workp->a_text = ((((unsigned) (&holend)) - 1) & (~PAGRND)) + PAGSIZ; #ifndef VMS workp->a_data = (unsigned) sbrk(0) - workp->a_text; #else workp->a_data = ((int)&end) - workp->a_text; #endif workp->a_bss = 0; workp->a_syms = 0; workp->a_entry = (unsigned) gstart(); workp->a_trsize = 0; workp->a_drsize = 0; fname = "savedlisp"; /*set defaults*/ reborn = CNIL; argptr = lbot->val; if (argptr != nil) { temp = argptr->d.car; if((TYPE(temp))==ATOM) fname = temp->a.pname; } des2 = open(gstab(),0); if(des2 >= 0) { if(read(des2,&old,sizeof(old))>=0) work.a_syms = old.a_syms; } (( descrip=creat(fname,0777); /*doit!*/ if(-1==write(descrip,workp,sizeof(work))) { close(descrip); error("Dumplisp failed",FALSE); } if(mode == 0413) lseek(descrip,PAGSIZ,0); if( -1==write(descrip,0,workp->a_text) || -1==write(descrip,workp->a_text,workp->a_data) ) { close(descrip); error("Dumplisp failed",FALSE); } if(des2>0 && work.a_syms) { count = old.a_text + old.a_data + sizeof(old); if(-1==lseek(des2,count,0)) error("Could not seek to stab",FALSE); asm("Dlast:"); for(count = old.a_syms;count > 0; count -=BUFSIZ) { ax = read(des2,tbuf,BUFSIZ); if(ax==0) { printf("Unexpected end of syms",count); fflush(stdout); break; } if(ax > 0) write(descrip,tbuf,ax); else error("Failure to write dumplisp stab",FALSE); } } close(descrip); if(des2>0) close(des2); reborn = 0; #ifndef UNIXTS vadvise(VA_NORM); #endif return(nil); } lispval Nndumplisp() { register struct exec *workp; register lispval argptr, temp; register char *fname; extern lispval reborn; struct exec work, old; extern etext; extern int dmpmode,holend,curhbeg,usehole; int descrip, des2, count, ax,mode; char tbuf[BUFSIZ]; snpand(4); #ifndef UNIXTS vadvise(VA_ANOM); #endif /* dump mode is kept in decimal (which looks like octal in dmpmode) and is changeable via (sstatus dumpmode n) where n is 413 or 410 base 10 */ if(dmpmode == 413) mode = 0413; else mode = 0410; workp = &work; workp->a_magic = mode; if(usehole) workp->a_text = curhbeg & (~PAGRND); else workp->a_text = ((((unsigned) (&holend)) - 1) & (~PAGRND)) + PAGSIZ; workp->a_data = (unsigned) sbrk(0) - workp->a_text; workp->a_bss = 0; workp->a_syms = 0; workp->a_entry = (unsigned) gstart(); workp->a_trsize = 0; workp->a_drsize = 0; fname = "savedlisp"; /*set defaults*/ reborn = CNIL; argptr = lbot->val; if (argptr != nil) { temp = argptr->d.car; if((TYPE(temp))==ATOM) fname = temp->a.pname; } des2 = open(gstab(),0); if(des2 >= 0) { if(read(des2,&old,sizeof(old))>=0) work.a_syms = old.a_syms; } descrip=creat(fname,0777); /*doit!*/ if(-1==write(descrip,workp,sizeof(work))) { close(descrip); error("Dumplisp failed",FALSE); } if(mode == 0413) lseek(descrip,PAGSIZ,0); if( -1==write(descrip,0,workp->a_text) || -1==write(descrip,workp->a_text,workp->a_data) ) { close(descrip); error("Dumplisp failed",FALSE); } if(des2>0 && work.a_syms) { count = old.a_text + old.a_data + (old.a_magic == 0413 ? PAGSIZ : sizeof(old)); if(-1==lseek(des2,count,0)) error("Could not seek to stab",FALSE); for(count = old.a_syms;count > 0; count -=BUFSIZ) { ax = read(des2,tbuf,(count < BUFSIZ ? count : BUFSIZ)); if(ax==0) { printf("Unexpected end of syms",count); fflush(stdout); break; } else if(ax > 0) write(descrip,tbuf,ax); else error("Failure to write dumplisp stab",FALSE); } if(-1 == lseek(des2, (old.a_magic == 0413 ? PAGSIZ : sizeof(old)) + old.a_text + old.a_data + old.a_trsize + old.a_drsize + old.a_syms, 0)) error(" Could not seek to string table ",FALSE); for( ax = 1 ; ax > 0;) { ax = read(des2,tbuf,BUFSIZ); if(ax > 0) write(descrip,tbuf,ax); else if (ax < 0) error("Error in string table read ",FALSE); } } close(descrip); if(des2>0) close(des2); reborn = 0; #ifndef UNIXTS vadvise(VA_NORM); #endif return(nil); } lispval typred(typ,ptr) int typ; lispval ptr; { int tx; if ((tx = TYPE(ptr)) == typ) return(tatom); if ((tx == INT) && (typ == ATOM)) return(tatom); return(nil); } lispval Nfunction() { register lispval handy; snpand(1); handy = lbot->val->d.car; if(TYPE(handy)==ATOM && handy->a.fnbnd!=nil) return(handy->a.fnbnd); else return(handy); } Error in string table read ",FALSE); } } close(descrip); if(des2>0) close(des2); reborn = 0; #ifndef UNIXTS vadvise(VA_NORM); #endif return(nil); } lispval typred(typ,ptr) int typ; lispval ptr; { int tx; if ((tx = TYPE(ptr)) == typ) return(tatom); if ((tx == INT) && (typ == cmd/lisp/franz/fex4.c 644 0 12 24142 2552701426 7722 static char *sccsid = "@(#)fex4.c 35.2 5/22/81"; #include "global.h" #include "lfuncs.h" #include "chkrtab.h" #include /* this is now a lambda function instead of a nlambda. the only reason that it wasn't a lambda to begin with is that the person who wrote it didn't know how to write a lexpr - jkf */ lispval Lsyscall() { register lispval temp; register struct argent *aptr; register int acount = 0; int args[50]; snpand(3); /* there must be at least one argument */ if (np==lbot) { chkarg(1,"syscall"); } aptr = lbot; temp = lbot->val; if (TYPE(temp) != INT) return(error("syscall: bad first argument ", FALSE)); args[acount++] = temp->i; while( ++aptr < np && acount < 49) { temp = aptr->val; switch(TYPE(temp)) { case ATOM: args[acount++] = (int)temp->a.pname; break; case STRNG: args[acount++] = (int) temp; break; case INT: args[acount++] = (int)temp->i; break; default: return(error("syscall: arg not symbol, string or fixnum", FALSE)); } } temp = newint(); temp->i = vsyscall(args); return(temp); } /* eval-when: this has the form (eval-when ...) where the list may contain any combination of `eval', `load', `compile'. The interpreter (us) looks for the atom `eval', if it is present we treat the rest of the forms as a progn. */ lispval Nevwhen() { register lispval handy; snpand(1); for(handy=(lbot->val)->d.car ; handy != nil ; handy = handy->d.cdr) if (handy->d.car == (lispval) Veval) { lbot=np ; protect(((lbot-1)->val)->d.cdr); return(Nprogn()); } ; return(nil); /* eval not seen */ } /* Status functions. * These operate on the statuslist stlist which has the form: * ( status_elem_1 status_elem_2 status_elem_3 ...) * where each status element has the form: * ( name readcode setcode . readvalue) * where * name - name of the status feature (the first arg to the status * function). * readcode - fixnum which tells status how to read the value of * this status name. The codes are #defined. * setcode - fixnum which tells sstatus how to set the value of * this status name * readvalue - the value of the status feature is usually stored * here. * * Readcodes: * * ST_READ - if no second arg, return readvalue. * if the second arg is given, we return t if it is eq to * the readvalue. * ST_FEATR - used in (status feature xxx) where we test for xxx being * in the status features list * ST_SYNT - used in (status syntax c) where we return c's syntax code * ST_INTB - read stattab entry * ST_NFETR - used in (status nofeature xxx) where we test for xxx not * being in the status features list * ST_DMPR - read the dumpmode * ST_UNDEF - return the undefined functions in the transfer table * * Setcodes: * ST_NO - if not allowed to set this status through sstatus. * ST_SET - if the second arg is made the readvalue. * ST_FEATW - for (sstatus feature xxx), we add xxx to the * (status features) list. * ST_TOLC - if non nil, map upper case chars in atoms to lc. * ST_CORE - if non nil, have bus errors and segmentation violations * dump core, if nil have them produce a bad-mem err msg * ST_INTB - set stattab table entry * ST_NFETW - use in (sstatus nofeature xxx) where we wish to remove xxx * from the status feature list. * ST_DMPW - set the dumpmode * ST_BCDTR - (ifdef RSET) if non nil, creat trace stack entries for * calls from BCD functions to BCD functions */ #include lispval Nstatus() { register lispval handy,curitm,valarg; int indx,ctim; int typ; char *cp; char *ctime(); struct tm *lctime,*localtime(); extern unsigned char *ctable; extern int dmpmode; extern lispval chktt(); lispval Istsrch(); snpand(3); if(lbot->val == nil) return(nil); handy = lbot->val; /* arg list */ while(TYPE(handy) != DTPR) handy = error("status: bad arg list",TRUE); curitm = Istsrch(handy->d.car); /* look for feature */ if( curitm == nil ) return(nil); /* non existant */ if( handy->d.cdr == nil ) valarg = (lispval) CNIL; else valarg = handy->d.cdr->d.car; /* now do the processing with curitm pointing to the requested item in the status list */ switch( typ = curitm->d.cdr->d.car->i ) { /* look at readcode */ case ST_READ: curitm = Istsrch(handy->d.car); /* look for name */ if(curitm == nil) return(nil); if( valarg != (lispval) CNIL) error("status: Second arg not allowed.",FALSE); else return(curitm->d.cdr->d.cdr->d.cdr); case ST_NFETR: /* look for feature present */ case ST_FEATR: /* look for feature */ curitm = Istsrch(matom("features")); if( valarg == (lispval) CNIL) error("status: need second arg",FALSE); for( handy = curitm->d.cdr->d.cdr->d.cdr; handy != nil; handy = handy->d.cdr) if(handy->d.car == valarg) return(typ == ST_FEATR ? tatom : nil); return(typ == ST_FEATR ? nil : tatom); case ST_SYNT: /* want character syntax */ handy = Vreadtable->a.clb; chkrtab(handy); if( valarg == (lispval) CNIL) error("status: need second arg",FALSE); while (TYPE(valarg) != ATOM) valarg = error("status: second arg must be atom",TRUE); indx = valarg->a.pname[0]; /* get first char */ if(valarg->a.pname[1] != '\0') error("status: only one character atom allowed",FALSE); handy = inewint(ctable[indx]); return(handy); case ST_RINTB: return(stattab[curitm->d.cdr->d.cdr->d.cdr->i]); case ST_DMPR: return(inewint(dmpmode)); case ST_CTIM: ctim = time(0); cp = ctime(&ctim); cp[24] = '\0'; r((eturn(matom(cp)); case ST_LOCT: ctim = time(0); lctime = localtime(&ctim); (handy = newdot())->d.car = inewint(lctime->tm_sec); protect(handy); handy->d.cdr = (valarg = newdot()); valarg->d.car = inewint(lctime->tm_min); valarg->d.cdr = (curitm = newdot()); curitm->d.car = inewint(lctime->tm_hour); curitm->d.cdr = (valarg = newdot()); valarg->d.car = inewint(lctime->tm_mday); valarg->d.cdr = (curitm = newdot()); curitm->d.car = inewint(lctime->tm_mon); curitm->d.cdr = (valarg = newdot()); valarg->d.car = inewint(lctime->tm_year); valarg->d.cdr = (curitm = newdot()); curitm->d.car = inewint(lctime->tm_wday); curitm->d.cdr = (valarg = newdot()); valarg->d.car = inewint(lctime->tm_yday); valarg->d.cdr = (curitm = newdot()); valarg->d.car = inewint(lctime->tm_isdst); return(handy); case ST_ISTTY: return( (isatty(0) == TRUE ? tatom : nil)); case ST_UNDEF: return(chktt()); } } lispval Nsstatus() { register lispval handy; lispval Isstatus(); handy = lbot->val; while( TYPE(handy) != DTPR || TYPE(handy->d.cdr) != DTPR) handy = error("sstatus: Bad args",TRUE); return(Isstatus(handy->d.car,handy->d.cdr->d.car)); } /* Isstatus - internal routine to do a set status. */ lispval Isstatus(curnam,curval) lispval curnam,curval; { register lispval curitm,head; lispval Istsrch(),Iaddstat(); int badmemr(),clrtt(); extern int uctolc, dmpmode, bcdtrsw; curitm = Istsrch(curnam); /* if doesnt exist, make one up */ if(curitm == nil) curitm = Iaddstat(curnam,ST_READ,ST_SET,nil); switch (curitm->d.cdr->d.cdr->d.car->i) { case ST_NO: error("sstatus: cannot set this status",FALSE); case ST_SET: goto setit; case ST_FEATW: curitm = Istsrch(matom("features")); (curnam = newdot())->d.car = curval; curnam->d.cdr = curitm->d.cdr->d.cdr->d.cdr; /* old val */ curitm->d.cdr->d.cdr->d.cdr = curnam; return(curval); case ST_NFETW: /* remove from features list */ curitm = Istsrch(matom("features"))->d.cdr->d.cdr; for(head = curitm->d.cdr; head != nil; head = head->d.cdr) { if(head->d.car == curval) curitm->d.cdr = head->d.cdr; else curitm = head; } return(nil); case ST_TOLC: if(curval == nil) uctolc = FALSE; else uctolc = TRUE; goto setit; case ST_CORE: if(curval == nil) { signal(SIGBUS,badmemr); /* catch bus errors */ signal(SIGSEGV,badmemr); /* and segmentation viols */ } else { signal(SIGBUS,SIG_DFL); /* let them core dump */ signal(SIGSEGV,SIG_DFL); } goto setit; case ST_INTB: stattab[curitm->d.cdr->d.cdr->d.cdr->i] = curval; return(curval); case ST_DMPW: if(TYPE(curval) != INT || (curval->i != 413 && curval->i != 410)) errorh(Vermisc,"sstatus: bad dump mode:", nil,FALSE,0,curval); dmpmode= curval->i; return(curval); case ST_AUTR: if(curval != nil) Sautor = (lispval) TRUE; else Sautor = FALSE; goto setit; case ST_TRAN: if(curval != nil) { Strans = (lispval) TRUE; /* the atom `on' set to set up all table * to their bcd fcn if possible */ if(curval == matom("on")) clrtt(1); } else { Strans = (lispval) FALSE; clrtt(0); /* clear all transfer tables */ } goto setit; case ST_BCDTR: if(curval == nil) bcdtrsw = FALSE; else bcdtrsw = TRUE; goto setit; } setit: /* store value in status list */ curitm->d.cdr->d.cdr->d.cdr = curval; return(curval); } /* Istsrch - utility routine to search the status list for the name given as an argument. If such an entry is not found, we return nil */ lispval Istsrch(nam) lispval nam; { register lispval handy; for(handy = stlist ; handy != nil ; handy = handy->d.cdr) if(handy->d.car->d.car == nam) return(handy->d.car); return(nil); } /* Iaddstat - add a status entry to the status list */ /* return new entry in status list */ lispval Iaddstat(name,readcode,setcode,valu) lispval name,valu; int readcode,setcode; { register lispval handy,handy2; snpand(2); protect(handy=newdot()); /* build status list here */ (handy2 = newdot())->d.car = name; handy->d.car = handy2; ((handy2->d.cdr = newdot())->d.car = newint())->i = readcode; handy2 = handy2->d.cdr; ((handy2->d.cdr = newdot())->d.car = newint())->i = setcode; handy2->d.cdr->d.cdr = valu; /* link this one in */ handy->d.cdr = stlist; stlist = handy; return(handy->d.car); /* return new item in stlist */ } val name,valu; int readcode,setcode; { register lispval handy,handy2; snpand(2); protect(handy=newdot()); /* build status list here */ (handy2 = newdot())->d.car = name; handy->d.car = handy2; ((handy2->d.cdr = newdot())->d.car = newint())->i = readcode; handy2 = handy2->d.cdr; ((handy2->d.cdr = newdot())->d.car = newint())->i = setcode; handy2->d.cdr->d.cdr = valu; /* link this one in */ hcmd/lisp/franz/fexr.c 644 0 12 4626 2552701426 10005 static char *sccsid = "@(#)fexr.c 35.1 5/6/81"; #include "global.h" /* Ngcafter *************************************************************/ /* */ /* Default garbage collector routine which does nothing. */ lispval Ngcafter() { return(nil); } /* Nopval *************************************************************/ /* */ /* Routine which allows system registers and options to be examined */ /* and modified. Calls copval, the routine which is called by c code */ /* to do the same thing from inside the system. */ lispval Nopval() { lispval quant; snpand(0); if( TYPE(lbot->val) != DTPR ) return(error("BAD CALL TO OPVAL",TRUE)); quant = eval(lbot->val->d.car); /* evaluate name of sys variable */ while( TYPE(quant) != ATOM ) quant = error("FIRST ARG TO OPVAL MUST BE AN ATOM",TRUE); if( (vtemp=lbot->val->d.cdr) != nil && TYPE(lbot->val->d.cdr) != DTPR ) return(error("BAD ARG LIST FOR OPVAL",TRUE)); return(copval( quant, vtemp==nil ? (lispval)CNIL : eval(vtemp->d.car) )); } /* copval *************************************************************/ /* This routine keeps track of system quantities, and is called from */ /* C code. If the second argument is CNIL, no change is made in the */ /* quantity. */ /* Since this routine may call newdot() if the second argument is not */ /* CNIL, the arguments should be protected somehow in that case. */ lispval copval(option,value) lispval option, value; { struct dtpr fake; lispval rval; snpand(0); if( option->a.plist == nil && value != (lispval) CNIL) { protect(option); protect(value); option->a.plist = newdot(); option->a.plist->d.car = sysa; option->a.plist->d.cdr = newdot(); option->a.plist->d.cdr->d.car = value; unprot(); unprot(); return(nil); } if( option->a.plist == nil ) return(nil); fake.cdr = option->a.plist; option = (lispval) (&fake); while( option->d.cdr != nil ) /* can't be nil first time through */ { option = option->d.cdr; if( option->d.car == sysa ) { rval = option->d.cdr->d.car; if( value != (lispval)CNIL ) option->d.cdr->d.car = value; return(rval); } option = option->d.cdr; } if( value != (lispval)CNIL ) { protect(option); protect(value); option->d.cdr = newdot(); option->d.cdr->d.car = sysa; option->d.cdr->d.cdr = newdot(); option->d.cdr->d.cdr->d.car = value; unprot(); unprot(); } return(nil); } != nil ) /* can't be nil first time through */ { option = option->d.cdr; if( option->d.car == sysacmd/lisp/franz/ffasl.c 644 0 12 30453 2552701427 10152 static char *sccsid = "@(#)ffasl.c 35.1 5/6/81"; #include "global.h" #include #include #include #include "naout.h" #define round(x,s) ((((x)-1) & ~((s)-1)) + (s)) char *stabf = 0; extern int fvirgin; static seed=0, mypid = 0; static char myname[100]; lispval verify(); /* dispget - get discipline of function * this is used to handle the tricky defaulting of the discipline * field of such functions as cfasl and getaddress. * dispget is given the value supplied by the caller, * the error message to print if something goes wrong, * the default to use if nil was supplied. * the discipline can be an atom or string. If an atom it is supplied * it must be lambda, nlambda or macro. Otherwise the atoms pname * is used. */ lispval dispget(given,messg,defult) lispval given,defult; char *messg; { int typ; while(TRUE) { if(given == nil) return(defult); if((typ=TYPE(given)) == ATOM) { if(given == lambda || given == nlambda || given == macro) return(given); else return((lispval) given->a.pname); } else if(typ == STRNG) return(given); given = errorh(Vermisc,messg,nil,TRUE,0,given); } } lispval Lcfasl(){ register struct argent *mlbot = lbot; register lispval work; register int fildes, totsize; int readsize; register struct argent *lbot, *np; lispval csegment(); char *sbrk(), *currend, *tfile, cbuf[6000], *mytemp(), *gstab(); char ostabf[128]; struct exec header; char *largs; snpand(4); switch(np-lbot) { case 3: pro((tect(nil); /* no discipline given */ case 4: protect(nil); /* no library given */ } chkarg(5,"cfasl"); mlbot[0].val = verify(mlbot[0].val,"Incorrect .o file specification"); mlbot[1].val = verify(mlbot[1].val,"Incorrect entry specification for cfasl"); mlbot[3].val = dispget(mlbot[3].val,"Incorrect discipline specification for cfasl",Vsubrou->a.pname); while(TYPE(mlbot[2].val)!= ATOM) mlbot[2].val = errorh(Vermisc,"Bad associated atom name for fasl", nil,TRUE,0,mlbot[2].val); work = mlbot[4].val; if(work==nil) largs = 0; else largs = (char *) verify(work,"Bad loader flags"); /* * Invoke loader. */ strcpy(ostabf,gstab()); currend = sbrk(0); #ifndef VMS /*** UNIX cfasl code ***/ tfile = mytemp(); sprintf(cbuf, "/usr/lib/lisp/nld -N -x -A %s -T %x %s -e %s -o %s %s -lc", ostabf, currend, mlbot[0].val, mlbot[1].val, tfile, largs); /* if nil don't print cfasl/nld message */ if ( Vldprt->a.clb != nil ) { printf(cbuf); putchar('\n'); fflush(stdout); } if(system(cbuf)!=0) { unlink(tfile); ungstab(); fprintf(stderr,"Ld returns error status\n"); return(nil); } if(fvirgin) fvirgin = 0; else unlink(ostabf); stabf = tfile; if((fildes = open(tfile,0))<0) { fprintf(stderr,"Couldn't open temporary file: %s\n",tfile); return(nil); } /* * Read a.out header to find out how much room to * allocate and attempt to do so. */ if(read(fildes,(char *)&header,sizeof(header)) <= 0) { close(fildes); return(nil); } readsize = round(header.a_text,4) + round(header.a_data,4); totsize = readsize + header.a_bss; totsize = round(totsize,512); /* * Fix up system indicators, typing info, etc. */ currend = (char *)csegment(str_name,totsize,FALSE); if(readsize!=read(fildes,currend,readsize)) return(nil); work = newfunct(); work->bcd.entry = (lispval (*)())header.a_entry; work->bcd.discipline = mlbot[3].val; return(mlbot[2].val->a.fnbnd = work); #else /*** VMS cfasl code ***/ { int pid = getpid() & 0xffff; /* Our process ID number */ char objfil[100]; /* Absolute object file name */ char symfil[100]; /* Old symbol table file */ char filename[100]; /* Random filename buffer */ int strlen(); /* String length function */ int Cvt_Unix_To_VMS(); /* Convert UNIX to VMS filename */ lispval Lgetaddress(),matom(); struct stat stbuf; struct VMS_string_descriptor { int string_length; char *string_pointer; }; static struct VMS_string_descriptor link_command; static struct VMS_string_descriptor noverify_command = {17,"$ V='F$VERIFY(0)'"}; static struct VMS_string_descriptor stop_command = {20,"$ STOP 'F$PROCESS()'"}; if (largs == 0) largs = " "; sprintf(objfil,"tmp:cfasl%d.tmp",pid); symfil[Cvt_Unix_To_VMS(ostabf,symfil)] = 0; sprintf(cbuf, /* Create link cmd. */ "$ link/exe=%s/nom/syst=%%X%x/sym=tmp:sym%d.new %s,%s.stb%s", objfil, currend, pid, mlbot[0].val, symfil, largs); printf( /* Echo link cmd. */ "$ link/exe=%s/nomap/system=%%X%x/symbol_table=tmp:sym%d.new %s,%s.stb%s\n", objfil, currend, pid, mlbot[0].val, symfil, largs); fflush(stdout); link_command.string_length=strlen(cbuf); link_command.string_pointer=cbuf; lib$execute_cli(&noverify_command,&link_command,&stop_command); if ((fildes = open(objfil,0)) < 0) return(nil);/* Open abs file */ fstat(fildes,&stbuf); /* Get its size */ readsize=stbuf.st_size; currend = (char *)csegment(str_name,readsize,FALSE); readsize = read(fildes,currend,10000000); close(fildes); /* * Delete the absolute object file */ unlink(objfil); /* * Delete the old symbol table (if temporary) */ unlink(sprintf(filename,"tmp:sym%d.stb",pid)); /* * Rename the new symbol table so it is now the old symbol table */ link(sprintf(symfil,"tmp:sym%d.new",pid),filename); unlink(symfil); sprintf(myname,"tmp:sym%d",pid); stabf = myname; /* * Return Lgetaddress(entry,function_name,discipline) */ { struct argent *oldlbot, *oldnp; lispval result; oldlbot = lbot; oldnp = np; lbot = np; np++->val = matom(mlbot[1].val); np++->val = mlbot[2].val; np++->val = matom(mlbot[3].val); result = Lgetaddress(); lbot = oldlbot; np = oldnp; return(result); } } #endif } #ifdef VMS #define M 4 #else #define M 1 #endif #define oktox(n) \ (0==stat(n,&stbuf)&&(stbuf.st_mode&S_IFMT)==S_IFREG&&0==access(n,M)) char * gstab() { register char *cp, *cp2; char *getenv(); struct stat stbuf; extern char **Xargv; if(stabf==0) { cp = getenv("PATH"); if(cp==0) cp=":/usr/ucb:/bin:/usr/bin"; if(*cp==':'||*Xargv[0]=='/') { cp++; if(oktox(Xargv[0])) { strcpy(myname,Xargv[0]); return(stabf = myname); } } for(;*cp;) { /* copy over current directory and then append argv[0] */ for(cp2=myname;(*cp)!=0 && (*cp)!=':';) *cp2++ = *cp++; *cp2++ = '/'; strcpy(cp2,Xargv[0]); if(*cp) cp++; if(!oktox(myname)) continue; return(stabf = myname); } error("Could not find which file is being executed.",FALSE); } else return (stabf); } static char mybuff[40]; char * mytemp() { if(mypid==0) mypid = (getpid() & 0xffff); sprintf(mybuff,"/tmp/Li%d.%d",mypid,seed++); return(mybuff); } ungstab() { seed--; sprintf(mybuff,"/tmp/Li%d.%d",mypid,seed-1); if(seed==0) { stabf = 0; fvirgin = 1; } } lispval verify(in,error) register lispval in; char *error; { for(EVER) { switch(TYPE(in)) { case STRNG: return(in); case ATOM: return((lispval)in->a.pname); } in = errorh(Vermisc,error,nil,TRUE,0,in); } } /* extern int fvirgin; */ /* declared in ffasl.c tells if this is original * lisp symbol table. * if fvirgin is 1 then we must copy the symbol * table, else we can overwrite it, since * it is a temporary file which only * one user could be using(was not created * as an original lisp or by a (dumplisp) * or a (savelisp)). */ /* copy a block of data from one file to another of size size */ copyblock(f1,f2,size) FILE *f1, *f2; int size; { char block[BUFSIZ]; while ( size > BUFSIZ ) { size -= BUFSIZ; fread(block,BUFSIZ,1,f1); fwrite(block,BUFSIZ,1,f2); } if (size > 0 ) { fread(block,size,1,f1); fwrite(block,size,1,f2); } } /* removeaddress -- * * (removeaddress '|_entry1| '|_entry2| ...) * * removes the given entry points from the run time symbol table, * so that later cfasl'd files can have these label names. * */ lispval Lrmadd(){ register struct argent *mlbot = lbot; register struct nlist *p, *q; register int i; register struct argent *lbot, *np; int numberofargs, strsize; char *gstab(); char ostabf[128]; char *nstabf,*mytemp(); char *strtbl,*alloca(); int i2, n, m, nargleft, savem; FILE *f, *fa; FILE *fnew; off_t savesymadd,symadd; /* symbol address */ struct exec buf; struct nlist nlbuf[BUFSIZ/sizeof (struct nlist)]; int maxlen; int change; snpand(2); numberofargs = (np - lbot); maxlen = 0; for ( i=0; ival = verify(mlbot->val,"Incorrect entry specification."); n = strlen((char *)mlbot->val); if (n > maxlen) maxlen = n; } /* * Must not disturb object file if it an original file which * other users can execute(signified by the variable fvirgin). * so the entire symbol table is copied to a new file. */ if (fvirgin) { strcpyn(ostabf,gstab(),128); nstabf = mytemp(); /* * copy over symbol table into a temporary file first * */ f = fopen(ostabf, "r"); fnew = fopen(nstabf, "w"); if (( f == NULL ) || (fnew == NULL)) return ( nil ); /* read exec header on file */ fread((char *)&buf, sizeof buf, 1, f); /* Is this a legitimate a.out file? */ if (N_BADMAG(buf)) { unlink(nstabf); ungstab(); fclose(f); fclose(fnew); errorh(Vermisc,"Removeaddress: Bad file",nil,FALSE,0,inewstr(ostabf)); return(nil); } /* set pointer on read file to symbol table */ /* must be done before the structure buf is reassigned * so that it will be accurate for the read file */ fseek(f,N_SYMOFF(buf),0); /* reset up exec header structure for new file */ buf.a_magic = OMAGIC; buf.a_text = 0; buf.a_data = 0; buf.a_bss = 0; buf.a_entry = 0; buf.a_trsize = 0; buf.a_drsize = 0; fwrite((char *)&buf, sizeof buf,1,fnew); /* write out exec header */ copyblock(f,fnew,buf.a_syms); /* copy symbol table */ fread((char *)&strsize, sizeof (int),1,f); /* find size of string table */ fwrite((char *)&strsize, sizeof (int),1,fnew); /* find size of string table */ strsize -= 4; strtbl = alloca(strsize); fread(strtbl,strsize,1,f); /* read and save string table*/ fwrite(strtbl,strsize,1,fnew); /* copy out string table */ fclose(f);fclose(fnew); } else { nstabf = gstab(); } /* * now unset the external bits it the entry points specified. */ f = fopen(nstabf, "r"); fa = fopen(nstabf, "a"); if (( f == NULL ) || (fa == NULL)) { unlink(nstabf); ungstab(); if (f != NULL ) fclose(f); if (fa != NULL ) fclose(fa); return ( nil ); } /* read exec header on file */ fread((char *)&buf, sizeof buf, 1, f); /* Is this a legitimate a.out file? */ if (N_BADMAG(buf)) { if (fvirgin) { unlink(nstabf); ungstab(); } fclose(f); fclose(fa); errorh(Vermisc,"Removeaddress: Bad file",nil,FALSE,0,inewstr(ostabf)); return(nil); } else { symadd = N_SYMOFF(buf); /* * read in string table if not done during copying */ if (fvirgin==0){ fseek(f,N_STROFF(buf),0); fread((char *)&strsize,sizeof (int),1,f); strsize -= 4; strtbl = alloca(strsize); fread(strtbl,strsize,1,f); } n = buf.a_syms; fseek(f, symadd, 0); while (n) { m = sizeof (nlbuf); if (n < m) m = n; /* read next block of symbols from a.out file */ fread((char *)nlbuf, m, 1, f); savem = m; savesymadd = symadd; symadd += m; n -= m; change = 0; /* compare block of symbols against list of entry point * names given, if a match occurs, clear the N_EXT bit * for that given sym((bol and signal a change. */ for (q = nlbuf; (m -= sizeof(struct nlist)) >= 0; q++) { if (q->n_un.n_strx == 0 || q->n_type & N_STAB /* make sure it is external */ || ((q->n_type & N_EXT)==0)) continue; for (mlbot=lbot,i2 = 0;i2val)[i]) { if (((char *)mlbot->val)[i] != strtbl[i-4+q->n_un.n_strx]) goto cont; i++; } if (strtbl[q->n_un.n_strx+i-4]) goto cont; change = 1; q->n_type &= ~N_EXT; break; cont: ; } } if ( change ) { fseek(fa,savesymadd,0); fwrite((char *)nlbuf, savem, 1, fa); } if (--nargleft == 0) goto alldone; } } alldone: fclose(f); fclose(fa); if(fvirgin) fvirgin = 0; stabf = nstabf; return (tatom); } i = 0; while (((char *)mlbot->val)[i]) { if (((char *)mlbot->val)[i] != strtbl[i-4+q->n_un.n_strx]) goto cont; i++; } if (strtbl[q->n_un.n_strx+i-4]) goto cont; changcmd/lisp/franz/filbuf.c 644 0 12 1460 2552701430 10274 static char *sccsid = "@(#)filbuf.c 35.1 5/6/81"; #include char *malloc(); _filbuf(iop) register FILE *iop; { static char smallbuf[_NFILE]; if ((iop->_flag&_IOREAD) == 0) return(EOF); if (iop->_flag&_IOSTRG) return(EOF); tryagain: if (iop->_base==NULL) { if (iop->_flag&_IONBF) { iop->_base = &smallbuf[fileno(iop)]; goto tryagain; } if ((iop->_base = malloc(BUFSIZ)) == NULL) { iop->_flag |= _IONBF; goto tryagain; } iop->_flag |= _IOMYBUF; } if (iop == stdin && (stdout->_flag&_IOLBF)) fflush(stdout); iop->_cnt = read(fileno(iop), iop->_base, iop->_flag&_IONBF?1:BUFSIZ); iop->_ptr = iop->_base; if (--iop->_cnt < 0) { if (iop->_cnt == -1) iop->_flag |= _IOEOF; else iop->_flag |= _IOERR; iop->_cnt = 0; return(-1); } return(*iop->_ptr++&0377); } iop->_base = &smallbuf[fileno(iop)]; goto tryagain; } if ((iop->_base = malloc(BUFSIZ)) == NULL) { iop->_flag |= _IONBF; goto tryagain; } iop->_flag |= _IOMYBUF; } if (iop == stdin && (stcmd/lisp/franz/fixmask.c 644 0 12 1246 2552701430 10471 static char *sccsid = "@(#)fixmask.c 35.1 5/6/81"; #include char mybuf[BUFSIZ]; extern unsigned short mask[]; main(){ register savesize = 0; char *cp; while(fgets(mybuf,BUFSIZ,stdin)!=NULL) { if(*mybuf=='#') { if(strcmpn(mybuf,"#save ",6)==0){ savesize = mybuf[6]-'0'; } else if (strcmpn(mybuf,"#protect ",9)==0){ savesize = '0'-1-mybuf[9]; } } if(savesize && strcmpn(mybuf," .set L",7)==0) { for(cp=mybuf;*cp++!=',';); sprintf(cp,"0x%X\n",mask[savesize + 10]); savesize = 0; } fputs(mybuf,stdout); } } unsigned short mask[] = { 0,0,0,0xfc0,0xfc0,0xfc0,0xec0,0xcc0,0x8c0,0x0c0,0, 0x800,0xc00,0xe00,0xf00,0xf80,0xfc0,0,0,0,0}; ile(fgets(mybuf,BUFSIZ,stdin)!=NULL) { if(*mybuf=='#') { if(strcmpn(mybuf,"#save ",6)==0){ savesize = mybuf[6]-'0'; } else if (strcmpn(mybuf,"#protect ",9)==0){ savesize = '0'-1-mybuf[9]; } } if(savesize && strcmpn(mybuf," .set L",7)==0) { for(cp=mybuf;*cp++!=',';); sprintf(cp,"0x%X\n",mask[savesize + 10]); savescmd/lisp/franz/fixpbig.e 644 0 12 1152 2552701431 10456 /calls $[0-9]*,_stack/d /calls $0,_unstack/s//movl (sp)+,r0/ /calls $0,_sp/s//movl sp,r0/ /calls $1,_inewint/s//movl (sp)+,r5\ jsb _qnewint/ /calls $0,_newdot/s//jsb _qnewdot/ /calls $0,_nargs/s//movl (ap),r0/ /calls $1,_popname/s//jsb _qpopname/ /calls $5,_exarith/s//jsb _qexarith/ /calls $1,_prunei/s//jsb _qprunei/ /calls $1,_pruneb/s//jsb _qpruneb/ /calls $0,_qretfromfr/s//jsb _qretfromfr/ /calls $[123],_Pushframe/s//jsb _qpushframe/ /\*_np\([ , ]\)/s//(r6)\1/g /\*_lbot\([ , ]\)/s//(r7)\1/g /_np\([ , ]\)/s//r6\1/g /_lbot\([ , ]\)/s//r7\1/g /\*_np$/s//(r6)/g /\*_lbot$/s//(r7)/g /_np$/s//r6/g /_lbot$/s//r7/g nt/s//movl (sp)+,r5\ jsb _qnewint/ /calls $0,_newdot/s//jsb _qnewdot/ /calls $0,_nargs/s//movl (ap),r0/ /calls $1,_popname/s//jsb _qpopname/ /calls $5,_exarith/s//jsb _qexarith/ /calls $1,_prunei/s//jsb _qprunei/ /calls $1,_pruneb/s//jsb _qpruneb/ /calls $0,_qretfromfr/s//jsb _qretfromfr/ /calls $[123],_Pushframe/s//jsb _qpushframe/ /\*_np\([ , ]\)/s//(r6)\1/g /\*_lbot\([ , ]\)/s//(r7)\1/g /_np\([ , ]\cmd/lisp/franz/fpipe.c 644 0 12 3625 2552701431 10136 static char *sccsid = "@(#)fpipe.c 35.1 5/6/81"; #include "global.h" #include FILE *_dofpip(iodes) int iodes; { register FILE *p; for(p=_iob; (p->_flag&(_IOWRT|_IOREAD))!=0; p++) if (p >= _iob+_NFILE) return(NULL); p->_file = iodes; p->_cnt = 0; p->_base = p->_ptr = NULL; return(p); } FILE * fpipe(info) FILE *info[2]; { register FILE *p; int descrips[2]; if(0 > pipe(descrips)) return( (FILE *) -1); if(NULL==(p = _dofpip(descrips[0]))) return( (FILE *) -1); p->_flag = (_IONBF|_IOREAD); info[0] = p; if(NULL==(p = _dofpip(descrips[1]))) return( (FILE *) -1); p->_flag = _IOWRT; info[1] = p; return((FILE *) 2); /*indicate sucess*/ } #ifndef VMS /*C library -- write nwritten = write(file, buffer, count); nwritten == -1 means error */ write(file, buffer, count) char *buffer; { register lispval handy; int retval; if((file != 1) || (Vcntlw->a.clb == nil)) goto top; /* since ^w is non nil, we do not want to print to the terminal, but we must be sure to return a correct value from the write in case there is no write to ptport */ asm(" movl 12(ap),-4(fp) ") /* retval = count */ goto skipit; top: asm(" .set write,4 "); asm(" chmk $write "); asm(" bcc noerror "); asm(" jmp cerror "); asm("noerror: "); asm(" movl r0,-4(fp)"); skipit: if(file==1) { handy = Vptport->a.clb; if(handy!=nil && TYPE(handy)==PORT && handy->p->_file!=1) { fflush(handy->p); file = handy->p->_file; goto top; } } return(retval); } /* # C library -- read # nread = read(file, buffer, count); # # nread ==0 means eof; nread == -1 means error */ read(file,buffer,count) { asm(" .set read,3 "); asm(" .set eintr,4 "); /* from /usr/include/errno.h */ again: asm(" chmk $read "); asm(" bcs error "); asm(" ret "); asm("error: "); asm(" cmpl r0,$eintr "); asm(" jeql intseen "); asm(" jmp cerror "); asm(" intseen: "); if(sigintcnt > 0) sigcall(SIGINT); goto again; } #endif file = handy->p->_file; goto top; } } return(retval); } /* # C library -- read # nread = readcmd/lisp/franz/hcrt0.s 644 0 12 31347 2552701432 10116 # C runtime startoff # sccs id @(#)hcrt0.s 35.1 5/6/81 .set exit,1 .globl _exit .globl start .globl hstart .globl _main .globl _environ .globl _xports .globl _gstart .globl _proflush .globl _holbeg .globl _holend .globl Fixzero # # C language startup routine # # special 512 byte area for nil (and possibly other atoms) # and special block of smallnums. # .long 0 .long 0 .long 0 .long -4 .long 20 .byte 'n,'i,'l,0 .long 0 .long 0 .long -4 .long 40 .byte 'e,'o,'f,0 .space 512-44 _xports: .long __iob+0 .long __iob+16 .long __iob+32 .long __iob+48 .long __iob+64 .long __iob+80 .long __iob+96 .long __iob+112 .long __iob+128 .long __iob+144 .long __iob+160 .long __iob+176 .long __iob+192 .long __iob+208 .long __iob+224 .long __iob+240 .long __iob+256 .long __iob+272 .long __iob+288 .long __iob+304 .space 512 - (20 * 4) .globl Negint Negint: .long -1024,-1023,-1022,-1021,-1020,-1019,-1018,-1017 .long -1016,-1015,-1014,-1013,-1012,-1011,-1010,-1009 .long -1008,-1007,-1006,-1005,-1004,-1003,-1002,-1001 .long -1000,-999,-998,-997,-996,-995,-994,-993 .long -992,-991,-990,-989,-988,-987,-986,-985 .long -984,-983,-982,-981,-980,-979,-978,-977 .long -976,-975,-974,-973,-972,-971,-970,-969 .long -968,-967,-966,-965,-964,-963,-962,-961 .long -960,-959,-958,-957,-956,-955,-954,-953 .long -952,-951,-950,-949,-948,-947,-946,-945 .long -944,-943,-942,-941,-940,-939,-938,-937 .long -936,-935,-934,-933,-932,-931,-930,-929 .long -928,-927,-926,-925,-924,-923,-922,-921 .long -920,-919,((-918,-917,-916,-915,-914,-913 .long -912,-911,-910,-909,-908,-907,-906,-905 .long -904,-903,-902,-901,-900,-899,-898,-897 .long -896,-895,-894,-893,-892,-891,-890,-889 .long -888,-887,-886,-885,-884,-883,-882,-881 .long -880,-879,-878,-877,-876,-875,-874,-873 .long -872,-871,-870,-869,-868,-867,-866,-865 .long -864,-863,-862,-861,-860,-859,-858,-857 .long -856,-855,-854,-853,-852,-851,-850,-849 .long -848,-847,-846,-845,-844,-843,-842,-841 .long -840,-839,-838,-837,-836,-835,-834,-833 .long -832,-831,-830,-829,-828,-827,-826,-825 .long -824,-823,-822,-821,-820,-819,-818,-817 .long -816,-815,-814,-813,-812,-811,-810,-809 .long -808,-807,-806,-805,-804,-803,-802,-801 .long -800,-799,-798,-797,-796,-795,-794,-793 .long -792,-791,-790,-789,-788,-787,-786,-785 .long -784,-783,-782,-781,-780,-779,-778,-777 .long -776,-775,-774,-773,-772,-771,-770,-769 .long -768,-767,-766,-765,-764,-763,-762,-761 .long -760,-759,-758,-757,-756,-755,-754,-753 .long -752,-751,-750,-749,-748,-747,-746,-745 .long -744,-743,-742,-741,-740,-739,-738,-737 .long -736,-735,-734,-733,-732,-731,-730,-729 .long -728,-727,-726,-725,-724,-723,-722,-721 .long -720,-719,-718,-717,-716,-715,-714,-713 .long -712,-711,-710,-709,-708,-707,-706,-705 .long -704,-703,-702,-701,-700,-699,-698,-697 .long -696,-695,-694,-693,-692,-691,-690,-689 .long -688,-687,-686,-685,-684,-683,-682,-681 .long -680,-679,-678,-677,-676,-675,-674,-673 .long -672,-671,-670,-669,-668,-667,-666,-665 .long -664,-663,-662,-661,-660,-659,-658,-657 .long -656,-655,-654,-653,-652,-651,-650,-649 .long -648,-647,-646,-645,-644,-643,-642,-641 .long -640,-639,-638,-637,-636,-635,-634,-633 .long -632,-631,-630,-629,-628,-627,-626,-625 .long -624,-623,-622,-621,-620,-619,-618,-617 .long -616,-615,-614,-613,-612,-611,-610,-609 .long -608,-607,-606,-605,-604,-603,-602,-601 .long -600,-599,-598,-597,-596,-595,-594,-593 .long -592,-591,-590,-589,-588,-587,-586,-585 .long -584,-583,-582,-581,-580,-579,-578,-577 .long -576,-575,-574,-573,-572,-571,-570,-569 .long -568,-567,-566,-565,-564,-563,-562,-561 .long -560,-559,-558,-557,-556,-555,-554,-553 .long -552,-551,-550,-549,-548,-547,-546,-545 .long -544,-543,-542,-541,-540,-539,-538,-537 .long -536,-535,-534,-533,-532,-531,-530,-529 .long -528,-527,-526,-525,-524,-523,-522,-521 .long -520,-519,-518,-517,-516,-515,-514,-513 .long -512,-511,-510,-509,-508,-507,-506,-505 .long -504,-503,-502,-501,-500,-499,-498,-497 .long -496,-495,-494,-493,-492,-491,-490,-489 .long -488,-487,-486,-485,-484,-483,-482,-481 .long -480,-479,-478,-477,-476,-475,-474,-473 .long -472,-471,-470,-469,-468,-467,-466,-465 .long -464,-463,-462,-461,-460,-459,-458,-457 .long -456,-455,-454,-453,-452,-451,-450,-449 .long -448,-447,-446,-445,-444,-443,-442,-441 .long -440,-439,-438,-437,-436,-435,-434,-433 .long -432,-431,-430,-429,-428,-427,-426,-425 .long -424,-423,-422,-421,-420,-419,-418,-417 .long -416,-415,-414,-413,-412,-411,-410,-409 .long -408,-407,-406,-405,-404,-403,-402,-401 .long -400,-399,-398,-397,-396,-395,-394,-393 .long -392,-391,-390,-389,-388,-387,-386,-385 .long -384,-383,-382,-381,-380,-379,-378,-377 .long -376,-375,-374,-373,-372,-371,-370,-369 .long -368,-367,-366,-365,-364,-363,-362,-361 .long -360,-359,-358,-357,-356,-355,-354,-353 .long -352,-351,-350,-349,-348,-347,-346,-345 .long -344,-343,-342,-341,-340,-339,-338,-337 .long -336,-335,-334,-333,-332,-331,-330,-329 .long -328,-327,-326,-325,-324,-323,-322,-321 .long -320,-319,-318,-317,-316,-315,-314,-313 .long -312,-311,-310,-309,-308,-307,-306,-305 .long -304,-303,-302,-301,-300,-299,-298,-297 .long -296,-295,-294,-293,-292,-291,-290,-289 .long -288,-287,-286,-285,-284,-283,-282,-281 .long -280,-279,-278,-277,-276,-275,-274,-273 .long -272,-271,-270,-269,-268,-267,-266,-265 .long -264,-263,-262,-261,-260,-259,-258,-257 .long -256,-255,-254,-253,-252,-251,-250,-249 .long -248,-247,-246,-245,-244,-243,-242,-241 .long -240,-239,-238,-237,-236,-235,-234,-233 .long -232,-231,-230,-229,-228,-227,-226,-225 .long -224,-223,-222,-221,-220,-219,-218,-217 .long -216,-215,-214,-213,-212,-211,-210,-209 .long -208,-207,-206,-205,-204,-203,-202,-201 .long -200,-199,-198,-197,-196,-195,-194,-193 .long -192,-191,-190,-189,-188,-187,-186,-185 .long -184,-183,-182,-181,-180,-179,-178,-177 .long -176,-175,-174,-173,-172,-171,-170,-169 .long -168,-167,-166,-165,-164,-163,-162,-161 .long -160,-159,-158,-157,-156,-155,-154,-153 .long -152,-151,-150,-149,-148,-147,-146,-145 .long -144,-143,-142,-141,-140,-139,-138,-137 .long -136,-135,-134,-133,-132,-131,-130,-129 .long -128,-127,-126,-125,-124,-123,-122,-121 .long -120,-119,-118,-117,-116,-115,-114,-113 .long -112,-111,-110,-109,-108,-107,-106,-105 .long -104,-103,-102,-101,-100,-99,-98,-97 .long -96,-95,-94,-93,-92,-91,-90,-89 .long -88,-87,-86,-85,-84,-83,-82,-81 .long -80,-79,-78,-77,-76,-75,-74,-73 .long -72,-71,-70,-69,-68,-67,-66,-65 .long -64,-63,-62,-61,-60,-59,-58,-57 .long -56,-55,-54,-53,-52,-51,-50,-49 .long -48,-47,-46,-45,-44,-43,-42,-41 .long -40,-39,-38,-37,-36,-35,-34,-33 .long -32,-31,-30,-29,-28,-27,-26,-25 .long -24,-23,-22,-21,-20,-19,-18,-17 .long -16,-15,-14,-13,-12,-11,-10,-9 .long -8,-7,-6,-5,-4,-3,-2,-1 Fixzero: .long 0,1,2,3,4,5,6,7 .long 8,9,10,11,12,13,14,15 .long 16,17,18,19,20,21,22,23 .long 24,25,26,27,28,29,30,31 .long 32,33,34,35,36,37,38,39 .long 40,41,42,43,44,45,46,47 .long 48,49,50,51,52,53,54,55 .long 56,57,58,59,60,61,62,63 .long 64,65,66,67,68,69,70,71 .long 72,73,74,75,76,77,78,79 .long 80,81,82,83,84,85,86,87 .long 88,89,90,91,92,93,94,95 .long 96,97,98,99,100,101,102,103 .long 104,105,106,107,108,109,110,111 .long 112,113,114,115,116,117,118,119 .long 120,121,122,123,124,125,126,127 .long 128,129,130,131,132,133,134,135 .long 136,137,138,139,140,141,142,143 .long 144,145,146,147,148,149,150,151 .long 152,153,154,155,156,157,158,159 .long 160,161,162,163,164,165,166,167 .long 168,169,170,171,172,173,174,175 .long 176,177,178,179,180,181,182,183 .long 184,185,186,187,188,189,190,191 .long 192,193,194,195,196,197,198,199 .long 200,201,202,203,204,205,206,207 .long 208,209,210,211,212,213,214,215 .long 216,217,218,219,220,221,222,223 .long 224,225,226,227,228,229,230,231 .long 232,233,234,235,236,237,238,239 .long 240,241,242,243,244,245,246,247 .long 248,249,250,251,252,253,254,255 .long 256,257,258,259,260,261,262,263 .long 264,265,266,267,268,269,270,271 .long 272,273,274,275,276,277,278,279 .long 280,281,282,283,284,285,286,287 .long 288,289,290,291,292,293,294,295 .long 296,297,298,299,300,301,302,303 .long 304,305,306,307,308,309,310,311 .long 312,313,314,315,316,317,318,319 .long 320,321,322,323,324,325,326,327 .long 328,329,330,331,332,333,334,335 .long 336,337,338,339,340,341,342,343 .long 344,345,346,347,348,349,350,351 .long 352,353,354,355,356,357,358,359 .long 360,361,362,363,364,365,366,367 .long 368,369,370,371,372,373,374,375 .long 376,377,378,379,380,381,382,383 .long 384,385,386,387,388,389,390,391 .long 392,393,394,395,396,397,398,399 .long 400,401,402,403,404,405,406,407 .long 408,409,410,411,412,413,414,415 .long 416,417,418,419,420,421,422,423 .long 424,425,426,427,428,429,430,431 .long 432,433,434,435,436,437,438,439 .long 440,441,442,443,444,445,446,447 .long 448,449,450,451,452,453,454,455 .long 456,457,458,459,460,461,462,463 .long 464,465,466,467,468,469,470,471 .long 472,473,474,475,476,477,478,479 .long 480,481,482,483,484,485,486,487 .long 488,489,490,491,492,493,494,495 .long 496,497,498,499,500,501,502,503 .long 504,505,506,507,508,509,510,511 .long 512,513,514,515,516,517,518,519 .long 520,521,522,523,524,525,526,527 .long 528,529,530,531,532,533,534,535 .long 536,537,538,539,540,541,542,543 .long 544,545,546,547,548,549,550,551 .long 552,553,554,555,556,557,558,559 .long 560,561,562,563,564,565,566,567 .long 568,569,570,571,572,573,574,575 .long 576,577,578,579,580,581,582,583 .long 584,585,586,587,588,589,590,591 .long 592,593,594,595,596,597,598,599 .long 600,601,602,603,604,605,606,607 .long 608,609,610,611,612,613,614,615 .long 616,617,618,619,620,621,622,623 .long 624,625,626,627,628,629,630,631 .long 632,633,634,635,636,637,638,639 .long 640,641,642,643,644,645,646,647 .long 648,649,650,651,652,653,654,655 .long 656,657,658,659,660,661,662,663 .long 664,665,666,667,668,669,670,671 .long 672,673,674,675,676,677,678,679 .long 680,681,682,683,684,685,686,687 .long 688,689,690,691,692,693,694,695 .long 696,697,698,699,700,701,702,703 .long 704,705,706,707,708,709,710,711 .long 712,713,714,715,716,717,718,719 .long 720,721,722,723,724,725,726,727 .long 728,729,730,731,732,733,734,735 .long 736,737,738,739,740,741,742,743 .long 744,745,746,747,748,749,750,751 .long 752,753,754,755,756,757,758,759 .long 760,761,762,763,764,765,766,767 .long 768,769,770,771,772,773,774,775 .long 776,777,778,779,780,781,782,783 .long 784,785,786,787,788,789,790,791 .long 792,793,794,795,796,797,798,799 .long 800,801,802,803,804,805,806,807 .long 808,809,810,811,812,813,814,815 .long 816,817,818,819,820,821,822,823 .long 824,825,826,827,828,829,830,831 .long 832,833,834,835,836,837,838,839 .long 840,841,842,843,844,845,846,847 .long 848,849,850,851,852,853,854,855 .long 856,857,858,859,860,861,862,863 .long 864,865,866,867,868,869,870,871 .long 872,873,874,875,876,877,878,879 .long 880,881,882,883,884,885,886,887 .long 888,889,890,891,892,893,894,895 .long 896,897,898,899,900,901,902,903 .long 904,905,906,907,908,909,910,911 .long 912,913,914,915,916,917,918,919 .long 920,921,922,923,924,925,926,927 .long 928,929,930,931,932,933,934,935 .long 936,937,938,939,940,941,942,943 .long 944,945,946,947,948,949,950,951 .long 952,953,954,955,956,957,958,959 .long 960,961,962,963,964,965,966,967 .long 968,969,970,971,972,973,974,975 .long 976,977,978,979,980,981,982,983 .long 984,985,986,987,988,989,990,991 .long 992,993,994,995,996,997,998,999 .long 1000,1001,1002,1003,1004,1005,1006,1007 .long 1008,1009,1010,1011,1012,1013,1014,1015 .long 1016,1017,1018,1019,1020,1021,1022,1023 start: .word 0x0000 subl2 $8,sp movl 8(sp((),(sp) # argc movab 12(sp),r0 movl r0,4(sp) # argv L1: tstl (r0)+ # null args term ? bneq L1 cmpl r0,*4(sp) # end of 'env' or 'argv' ? blss L2 tstl -(r0) # envp's are in list L2: movl r0,8(sp) # env movl r0,_environ # indir is 0 if no env ; not 0 if env calls $3,_main pushl r0 calls $1,_exit chmk $exit hstart: # This routine is exactly the same as # start except there is a call to _rlc # before the call to _main. One could # arrange a switch by putting different # addresses in a register and jumping # indirect through the register but # it seems worth the cost of 80 bytes # for the gain in clarity by having the # routines EXACTLY the same except for # that one difference. .word 0x0000 subl2 $8,sp calls $0,_rlc movl 8(sp),(sp) # argc movab 12(sp),r0 movl r0,4(sp) # argv L3: tstl (r0)+ # null args term ? bneq L3 cmpl r0,*4(sp) # end of 'env' or 'argv' ? blss L4 tstl -(r0) # envp's are in list L4: movl r0,8(sp) # env movl r0,_environ # indir is 0 if no env ; not 0 if env calls $0,_rlc calls $3,_main pushl r0 calls $1,_exit chmk $exit _gstart: .word 0 moval start,r0 ret _proflush: .word 0 ret # .data _holbeg: _holend: _environ: .space 4 nce. .word 0x0000 subl2 $8,sp calls $0,_rlc movl 8(sp),(sp) # argc movab 12(sp),r0 movl r0,4(sp) # argv L3: tstl (r0)+ # null args term ? bneq L3 cmpl r0,*4(sp) # end of 'env' or 'argv' ? blss L4 tstl -(r0) # envp's are in list L4: movl r0,8(sp) # env movl cmd/lisp/franz/inewint.s 644 0 12 1053 2552701433 10523 .asciz "@(#)inewint.s 35.1 5/6/81" .globl _inewint .globl _blzero .data 0 cntloc: .long 0 .text _inewint:.word 0 # movab cntloc,r0 # used when profiling # jsb mcount movl 4(ap),r0 # cvtlb r0,r0 # bvs nottiny # moval Fixzero[r0],r0 # ret # nottiny: cmpl r0,$1024 jgeq alloc cmpl r0,$-1024 jlss alloc moval Fixzero[r0],r0 ret alloc: calls $0,_newint movl 4(ap),0(r0) ret _blzero: # blzero(where,howmuch) # char *where; # zeroes a block of length howmuch # beginning at where. .word 0 movc5 $0,*4(ap),$0,8(ap),*4(ap) ret _inewint .globl _blzero .data 0 cntloc: .long 0 .text _inewint:.word 0 # movab cntloc,r0 # used when profiling # jsb mcount movl 4(ap),r0 # cvtlb r0,r0 # bvs nottiny # moval Fixzero[r0],r0 # ret # nottiny: cmpl r0,$1024 jgeq alloc cmpl r0,$-1024 jlss alloc moval Fixzero[r0],r0 ret alloc: calls $0,_newint movl 4(ap),0(r0) ret _blzero: # blzero(where,howmuch) # char *where; # zeroes a block of length howmuch # beginning at where. .wocmd/lisp/franz/inits.c 644 0 12 10653 2552701433 10202 static char *sccsid = "@(#)inits.c 35.1 5/6/81"; #include "global.h" #include /************************************************************************/ /* */ /* file: inits.i */ /* contents: initialization routines */ /* */ /* initial **************************************************************/ /* initializes the parts of the system that cannot be automatically */ /* accomplished in the declarations. */ int reborn=0; /* flag to tell whether we are in fast-load version */ extern char *stabf; extern int fvirgin; extern int keywait; extern sigstruck, sigdelay; initial() { int sigalrmh(), sigfpeh(), siginth(); lispval Isstatus(),Istsrch(); extern int hashtop; /* clear any memory of pending SIGINT's */ exception = FALSE; sigintcnt = 0; if( signal(SIGINT,SIG_IGN) != SIG_IGN) signal(SIGINT,siginth); if( signal(SIGHUP,SIG_IGN) != SIG_IGN) signal(SIGHUP,siginth); signal(SIGFPE,siginth); signal(SIGALRM,siginth); signal(SIGPIPE,siginth); /* signals SIGBUS and SIGSEGV will be set up when the status list is set up when the lisp is virgin, and will be set up according to the current value on the status list if the lisp is reborn */ if( reborn ) { register FILE *p = _iob + 3; static FILE empty; for(; p < _iob + _NFILE; p++) *p = empty; np = lbot = orgnp; stabf = 0; fvirgin = 1; loading->a.clb = nil; gcrebear(); /* set up SIGBUS and SIGSEGV from current value of status flag dumpcore */ Isstatus(matom("dumpcore"), (Istsrch(matom("dumpcore")))->d.cdr->d.cdr->d.cdr); makenv(); return; } for (hash=0;hashval = env; for (envp=environ; *envp!=NULL; envp++) ; while (--envp >= environ) { for(p= *envp,q=envstr; *p!='=' ; p++) if(q < envstr + STRBLEN) *q++ = *p; *q = 0; p++; /* at this point lbot->val==env, so it is protected from gc */ lbot->val = temp = newdot(); temp->d.cdr = env; env = temp; temp = newdot(); temp->d.car = matom(envstr); temp->d.cdr = matom(p); env->d.car = temp; } matom("environment")->a.clb = env; } siginth(signo){ signal(signo,siginth); sigstruck |= (1 << signo); /* handle SIGINT differently since it is the only asychronous interrupt we handle */ if( signo == SIGINT) { if( ++sigintcnt == 1) { /* if this is the first interrupt, we just set a flag which will be checked in qfuncl and eval. This will allow us to handle these interrupts when we are ready. */ exception = TRUE; /*putchar('A');*/ fflush(stdout); sigstruck &= ~(1 << signo); return; } else if (sigintcnt == 2) { /* the setting of exception was ignored, we better make sure that all calls from compiled code go through qlinker */ signal(SIGINT,SIG_IGN); /* this may take a while, dont allow ints*/ clrtt(0); /*putchar('B');*/ fflush(stdout); signal(SIGINT,siginth); /* ok to interrupt again */ sigstruck &= ~(1 << signo); return; } else { /*putchar('C');*/ fflush(stdout); } } sigcall(signo); } sigcall(which) register which; { extern lispval Lfuncal(); snpand(1); if(which == SIGINT) { sigintcnt = 0; exception = 0; } if(sigacts[which]!=((lispval) 0)) { lbot = np; np -> val = sigacts[which]; INRNP; np -> val = inewint(which); INRNP; {lispval temp;temp = rdrsdot, rdrsdot = rdrsdot2, rdrsdot2 = temp; /*KLUDGE*/} Lfuncal(); {lispval temp;temp = rdrsdot, rdrsdot = rdrsdot2, rdrsdot2 = temp; /*KLUDGE*/} } sigstruck &= ~ (1< #include "chars.h" struct readtable { unsigned char ctable[132]; } initread = { /* ^@ nul ^A soh ^B stx ^C etx ^D eot ^E eng ^F ack ^G bel */ VERR, VERR, VERR, VERR, VERR, VERR, VERR, VERR, /* ^H bs ^I ht ^J nl ^K vt ^L np ^M cr ^N so ^O si */ VCHAR, VSEP, VSEP, VSEP, VSEP, VSEP, VERR, VERR, /* ^P dle ^Q dc1 ^R dc2 ^S dc3 ^T dc4 ^U nak ^V syn ^W etb */ VERR, VERR, VERR, VERR, VERR, VERR, VERR, VERR, /* ^X can ^Y em ^Z sub ^[ esc ^\ fs ^] gs ^^ rs ^_ us */ VERR, VERR, VERR, VSEP, VERR, VERR, VERR, VERR, /* sp ! " # $ % & ' */ VSEP, VCHAR, VSD, VCHAR, VCHAR, VCHAR, VCHAR, VSQ, /* ( ) * + , - . / */ VLPARA, VRPARA, VCHAR, VSIGN, VCHAR, VSIGN, VPERD, VCHAR, /* 0 1 2 3 4 5 6 7 */ VNUM, VNUM, VNUM, VNUM, VNUM, VNUM, VNUM, VNUM, /* 8 9 : ; < = > ? */ VNUM, VNUM, VCHAR, VCHAR, VCHAR, VCHAR, VCHAR, VCHAR, /* @ A B C D E F G */ VCHAR, VCHAR, VCHAR, VCHAR, VCHAR, VCHAR, VCHAR, VCHAR, /* H I J K L M N O */ VCHAR, VCHAR, VCHAR, VCHAR, VCHAR, VCHAR, VCHAR, VCHAR, /* P Q R S T U V W */ VCHAR, VCHAR, VCHAR, VCHAR, VCHAR, VCHAR, VCHAR, VCHAR, /* X Y Z [ \ ] ^ _ */ VCHAR, VCHAR, VCHAR, VLBRCK, VESC, VRBRCK, VCHAR, VCHAR, /* ` a b c d e f g */ VCHAR, VCHAR, VCHAR, VCHAR, VCHAR, VCHAR, VCHAR, VCHAR, /* h i j k l m n o */ VCHAR, VCHAR, VCHAR, VCHAR, VCHAR, VCHAR, VCHAR, VCHAR, /* p q r s t u v w */ VCHAR, VCHAR, VCHAR, VCHAR, VCHAR, VCHAR, VCHAR, VCHAR, /* x y z { | } ~ del */ VCHAR, VCHAR, VCHAR, VCHAR, VDQ, VCHAR, VCHAR, VEOF,(( /* unused Xsdc Xesc Xdqc */ 0, '"', '\\', '|' }; extern unsigned char *ctable; lispval atomval; /* external varaible containing atom returned from internal atom reading routine */ lispval readrx(); lispval readr(); lispval readry(); int keywait; int prinlevel = -1; /* contains maximum list recursion count */ int prinlength = -1; /* maximum number of list elements printed */ static int dbqflag; static int macflag; static int splflag; static int mantisfl = 0; extern lispval lastrtab; /* external variable designating current reader table */ static char baddot1[]= "Bad reader construction: (. )\nShould be (nil . )\n"; static char baddot2[]= "Bad reader construction: ( .)\n\ Should be ( . ), assumed to be ()"; static char baddot3[]= "Bad reader construction: ( . not followed by )"; #include "chkrtab.h" /* readr ****************************************************************/ /* returns a s-expression read in from the port specified as the first */ /* argument. Handles superbrackets, reader macros. */ lispval readr(useport) FILE *useport; { register lispval handy = Vreadtable->a.clb; chkrtab(handy); rbktf = FALSE; rdrport = (FILE *) useport; if(useport==stdin) keywait = TRUE; handy = readrx(Iratom()); if(useport==stdin) keywait = FALSE; return(handy); } /* readrx **************************************************************/ /* returns a s-expression beginning with the syntax code of an atom */ /* passed in the first */ /* argument. Does the actual work for readr, including list, dotted */ /* pair, and quoted atom detection */ lispval readrx(code) register int code; { register lispval work; register lispval *current; register struct argent *result; register struct argent *lbot, *np; int inlbkt = FALSE; lispval errorh(); top: switch(code) { case TLBKT: inlbkt = TRUE; case TLPARA: result = np; current = (lispval *)np; np++->val = nil; /*protect(nil);*/ for(EVER) { switch(code = Iratom()) { case TRPARA: if(rbktf && inlbkt) rbktf = FALSE; return(result->val); default: atomval = readrx(code); case TSCA: np++->val=atomval; *current = work = newdot(); work->d.car = atomval; np--; current = (lispval *) &(work->d.cdr); break; case TSPL: macrox(); /* input and output in atomval */ *current = atomval; while(*current!=nil) { if(TYPE(*current)!=DTPR) errorh(Vermisc,"Non-list returned from splicing macro",nil,FALSE,7,*current); current=(lispval *)&((*current)->d.cdr); } break; case TPERD: if(result->val==nil) { work = result->val=newdot(); current = (lispval *) &(work->d.cdr); fprintf(stderr,baddot1); } code = Iratom(); if(code==TRPARA) { return(errorh(Vermisc,baddot2,nil,TRUE,58,result->val)); } *current = readrx(code); /* there is the possibility that the expression following the dot is terminated with a "]" and thus needs no closing lparens to follow */ if(!rbktf && ((code = Iratom()))!=TRPARA) { errorh(Vermisc,baddot3,nil,TRUE,59,result->val,atomval); } if(rbktf && inlbkt) rbktf = FALSE; return(result->val); case TEOF: errorh(Vermisc,"Premature end of file after ", nil,FALSE,0,result->val); } if(rbktf) { if(inlbkt) rbktf = FALSE; return(result->val); } } case TSCA: return(atomval); case TEOF: return(eofa); case TMAC: macrox(); return(atomval); case TSPL: macrox(); if((work = atomval)!=nil) { if(TYPE(work)==DTPR && work->d.cdr==nil) return(work->d.car); else errorh(Vermisc, "Improper value returned from splicing macro at top-level",nil,FALSE,9,work); } code = Iratom(); goto top; /* return(readrx(Iratom())); */ case TSQ: result = np; protect(newdot()); (work = result->val)->d.car = quota; work = work->d.cdr = newdot(); work->d.car = readrx(Iratom()); return(result->val); default: return(errorh(Vermisc,"Readlist error, code ",nil,FALSE,0,inewint(code))); } } macrox() { lispval Lapply(); snpand(0); lbot = np; protect(Iget(atomval,lastrtab)); protect(nil); atomval = Lapply(); chkrtab(Vreadtable->a.clb); /* the macro could have changed the readtable */ return; } /* ratomr ***************************************************************/ /* this routine returns a pointer to an atom read in from the port given*/ /* by the first argument */ lispval ratomr(useport) register FILE *useport; { rdrport = useport; switch(Iratom()) { case TEOF: return(eofa); case TSQ: case TRPARA: case TLPARA: case TLBKT: case TPERD: strbuf[1]=0; return(getatom()); default: return(atomval); } } Iratom() { register FILE *useport = rdrport; register char c, marker, *name; extern lispval finatom(), calcnum(), getnum(); char positv = TRUE; int code; int strflag = FALSE; name = strbuf; again: c = getc(useport) & 0177; *name = c; switch(ctable[c] & 0377) { default: goto again; case VNUM: case VSIGN: *name++ = c; atomval = (getnum(name)); return(TSCA); case VESC: dbqflag = TRUE; *name++ = getc(useport) & 0177; atomval = (finatom(name)); return(TSCA); case VCHAR: *name++ = c; atomval = (finatom(name)); return(TSCA); case VLPARA: return(TLPARA); case VRPARA: return(TRPARA); case VPERD: c = peekc(useport) & 0177; if(VNUM!=ctable[c]) { if(SEPMASK & ctable[c]) return(TPERD); else { *name++ = '.'; /* this period begins an atm */ atomval = finatom(name); return(TSCA); } } *name++ = '.'; mantisfl = 1; atomval = (getnum(name)); return(TSCA); case VLBRCK: return(TLBKT); case VRBRCK: rbktf = TRUE; return(TRPARA); case VEOF: /*printf("returning eof atom\n");*/ clearerr(useport); return(TEOF); case VSQ: return(TSQ); case VSD: strflag = TRUE; case VDQ: name = strbuf; marker = c; while ((c = getc(useport)) != marker) { if(VESC==ctable[c]) c = getc(useport) & 0177; *name++ = c; if (name >= endstrb) error("ATOM TOO LONG",FALSE); if (feof(useport)) { clearerr(useport); error("EOF encountered while reading atom", FALSE); } } *name = NULL_CHAR; if(strflag) atomval = (lispval) inewstr(strbuf); else atomval = (getatom(name)); return(TSCA); case VERR: if (c == '\0') { fprintf(stderr,"[read: null read and ignored]\n"); goto again; /* null pname */ } fprintf(stderr,"%c (%o): ",c,(int) c); error("ILLEGAL CHARACTER IN ATOM",TRUE); case VSPL: code = TSPL; goto same; case VMAC: code = TMAC; goto same; case VSCA: code = TSCA; same: strbuf[0] = c; strbuf[1] = 0; atomval = (getatom()); return(code); } } static char toobig[]="Number exceeds parse buffer"; #define push(); if(name==endstrb) error(toobig,FALSE); else *name++=c; #define next() (stats = ctable[c=getc(useport) & 0177]) lispval getnum(name) register char *name; { unsigned char c; register lispval result; register FILE *useport=rdrport; unsigned char stats; int sawdigit = 0; double realno; extern lispval finatom(), calcnum(), newdoub(), dopow(); if(mantisfl) { mantisfl = 0; next(); goto mantissa; } if(VNUM==ctable[*(unsigned char*)(name-1)]) sawdigit = 1; while(VNUM==next()) { push(); /* recognize [0-9]*, in "ex" parlance */ sawdigit = 1; } if(stats==VPERD) { push(); /* continue */ } else if(stats & SEPMASK) { ungetc(c,useport); return(calcnum(strbuf,name,ibase->a.clb->i)); } else if(c=='^') { push(); return(dopow(name,ibase->a.clb->i)); } else if(c=='_') { push(); return(dopow(name,2)); } else if(c=='e' || c=='E' || c=='d' ||c=='D') { if(sawdigit) goto expt; else goto backout; } else { backout: ungetc(c,useport); return(finatom(name)); } /* at this point we have [0-9]*\. , which might be a decimal int or the leading part of a float */ if(next()!=VNUM) { if(c=='e' || c=='E' || c=='d' ||c=='D') goto expt; else if(c=='^') { push(); return(dopow(name,ibase->a.clb->i)); } else if(c=='_') { push(); return(dopow(name,2)); } else { /* Here we have 1.x where x not num, not sep */ /* Here we have decimal int. NOT FORTRAN! */ ungetc(c,useport); return(calcnum(strbuf,name-1,10)); } } mantissa: do { push(); } while (VNUM==next()); /* Here we have [0-9]*\.[0-9]* */ if(stats & SEPMASK) goto last; else if(c!='e' && c!='E' && c!='d' && c!='D') { ungetc(c,useport); goto verylast; } expt: c = 'e'; /* Scanf doesn't recognize 1.0d0, z.B. */ push(); next(); if(c=='+' || c =='-') { push(); next(); } while (VNUM==stats) { push(); next(); } last: ungetc(c,useport); if(! (stats & SEPMASK) ) return(finatom(name)); verylast: *name=0; sscanf(strbuf,"%F",&realno); (result = newdoub())->r = realno; return(result); } lispval dopow(part2,base) lispval base; register char *part2; { register char *name = part2; register FILE *useport = rdrport; register int power; register struct argent *lbot, *np; unsigned char stats,c; char *end1 = part2 - 1; lispval Ltimes(); while(VNUM==next()) { push(); } if(c!='.') { ungetc(c,useport); } if(c!='.' && !(stats & SEPMASK)) { return(finatom(name)); } lbot = np; np++->val = inewint(base); /* calculate "mantissa"*/ if(*end1=='.') np++->val = calcnum(strbuf,end1-1,10); else np++->val = calcnum(strbuf,end1,ibase->a.clb->i); /* calculate exponent */ if(c=='.') power = calcnum(part2,name,10)->i; else power = calcnum(part2,name,ibase->a.clb->i)->i; while(power-- > 0) lbot[1].val = Ltimes(); return(lbot[1].val); } lispval calcnum(strbuf,name,base) register char *name; char *strbuf; { register char *p; register lispval result, temp; int negflag = 0; result = temp = newsdot(); /* initialize sdot cell */ protect(temp); p = strbuf; if(*p=='+') p++; else if(*p=='-') {negflag = 1; p++;} *name = 0; if(p>=name) return(getatom()); for(;p < name; p++) dmlad(temp,base,*p-'0'); if(negflag) dmlad(temp,-1,0); if(temp->s.CDR==0) { result = inewint(((temp->i); pruneb(np[-1].val); } np--; return(result); } lispval finatom(name) register char *name; { extern int uctolc; register FILE *useport = rdrport; unsigned char c, stats; register char *savenm; savenm = name - 1; /* remember start of name */ while(!(next()&SEPMASK)) { if(stats == VESC) c = getc(useport) & 0177; *name++=c; if (name >= endstrb) error("ATOM TOO LONG",FALSE); } *name = NULL_CHAR; ungetc(c,useport); if (uctolc) for(; *savenm ; savenm++) if( isupper(*savenm) ) *savenm = tolower(*savenm); return(getatom()); } /* printr ***************************************************************/ /* prints the first argument onto the port specified by the second */ /* * Last modified Mar 21, 1980 for hunks */ printr(a,useport) register lispval a; register FILE *useport; { register lispval temp; register hsize, i; char strflag = 0; char Idqc = 0; int curprinlength = prinlength; val_loop: if( ! VALID(a) ) { /* error("Bad lisp data encountered by printr", TRUE); a = badst; */ printf("",a); return; } switch (TYPE(a)) { case UNBO: fputs("",useport); break; case VALUE: fputs("(ptr to)",useport); a = a->l; goto val_loop; case INT: fprintf(useport,"%d",a->i); break; case DOUB: { char buf[64]; lfltpr(buf,a->r); fputs(buf,useport); } break; case PORT: { lispval cp; if((cp = ioname[PN(a->p)]) == nil) fputs("%$unopenedport",useport); else fprintf(useport,"%%%s",cp); } break; case HUNK2: case HUNK4: case HUNK8: case HUNK16: case HUNK32: case HUNK64: case HUNK128: if(prinlevel == 0) { fputs("%",useport); break; } hsize = 2 << HUNKSIZE(a); fputs("{", useport); prinlevel--; printr(a->h.hunk[0], useport); curprinlength--; for (i=1; i < hsize; i++) { if (a->h.hunk[i] == hunkfree) break; if (curprinlength-- == 0) { fputs(" ...",useport); break; } else { fputs(" ", useport); printr(a->h.hunk[i], useport); } } fputs("}", useport); prinlevel++; break; case ARRAY: fputs("array[",useport); printr(a->ar.length,useport); fputs("]",useport); break; case BCD: fprintf(useport,"#%X-",a->bcd.entry); printr(a->bcd.discipline,useport); break; case SDOT: pbignum(a,useport); break; case DTPR: if(prinlevel==0) { fputs("&",useport); break; } prinlevel--; if(a->d.car==quota && a->d.cdr!=nil && a->d.cdr->d.cdr==nil) { putc('\'',useport); printr(a->d.cdr->d.car,useport); prinlevel++; break; } putc('(',useport); curprinlength--; morelist: printr(a->d.car,useport); if ((a = a->d.cdr) != nil) { if(curprinlength-- == 0) { fputs(" ...",useport); goto out; } putc(' ',useport); if (TYPE(a) == DTPR) goto morelist; fputs(". ",useport); printr(a,useport); } out: fputc(')',useport); prinlevel++; break; case STRNG: strflag = TRUE; Idqc = Xsdc; case ATOM: { char *front, *temp; int clean; temp = front = (strflag ? ((char *) a) : a->a.pname); if(Idqc==0) Idqc = Xdqc; if(Idqc) { clean = *temp; if (*temp=='-'||*temp=='+') temp++; clean = clean && (ctable[*temp] != VNUM); while (clean && *temp) clean = (!(ctable[*temp++] & QUTMASK)); if (clean & !strflag) fputs(front,useport); else { putc(Idqc,useport); for(temp=front;*temp;temp++) { if( *temp==Idqc || ctable[*temp] == VESC) putc(Xesc,useport); putc(*temp,useport); } putc(Idqc,useport); } } else { register char *cp = front; if(ctable[*cp]==VNUM) putc(Xesc,useport); for(; *cp; cp++) { if(ctable[*cp]& QUTMASK) putc(Xesc,useport); putc(*cp,useport); } } } } } lfltpr(buf,val) /* lisp floating point printer */ char *buf; double val; { register char *cp1; sprintf(buf,Vfloatformat->a.clb,val); for(cp1 = buf; *cp1; cp1++) if(*cp1=='.'|| *cp1=='E') return; /* if we are here, there was no dot, so the number was an integer. Furthermore, cp1 already points to the end of the string. */ *cp1++ = '.'; *cp1++ = '0'; *cp1++ = 0; } /* dmpport ****************************************************************/ /* outputs buffer indicated by first argument whether full or not */ dmpport(useport) register lispval useport; { fflush(useport); } /* protect and unprot moved to eval.c (whr) */ p1 = bcmd/lisp/franz/lam1.c 644 0 12 41331 2552701435 7705 static char *sccsid = "@(#)lam1.c 35.3 7/8/81"; # include "global.h" # include # include "chkrtab.h" # include "frame.h" /**************************************************************************/ /* */ /* file: ccdfns.i */ /* contents: LISP functions coded in C */ /* */ /* These include LISP primitives, numeric and boolean functions and */ /* predicates, some list-processing functions, i/o support functions */ /* and control flow functions (e.g. cont, break). */ /* There are two types of functions: lambda (prefixed "L") and nlambda */ /* (prefixed "N"). */ /* Lambda's all call chkarg to insure that at least the minimum number */ /* of necessary arguments are on the namestack. */ /* All functions take their arguments from the namestack in a read- */ /* only manner, and return their results via the normal C value */ /* return mechanism. */ /* */ lispval Leval() { register lispval temp; chkarg(1,"eval"); temp = lbot->val; return(eval(temp)); } lispval Lxcar() { register int typ; register lispval temp, result; chkarg(1,"xcar"); temp = lbot->val; if (((typ = TYPE(temp)) == DTPR) || (typ == ATOM) || HUNKP(temp)) return(temp->d.car); else if(typ == SDOT) { result = inewint(temp->i); return(result); } else if(Schainp!=nil && typ==ATOM) return(nil); else return(error("Bad arg to car",FALSE)); } lispval Lxcdr() { register int typ; register lispval temp, result; chkarg(1,"xcdr"); temp = lbot->val; if(temp==nil) return (nil); if (((typ = TYPE(temp)) == DTPR) || HUNKP(temp)) return(temp->d.cdr); else if(typ==SDOT) { if(temp->s.CDR==0) return(nil); temp = temp->s.CDR; if(TYPE(temp)==DTPR) errorh(Vermisc,"Fell of the end of a bignum",nil,FALSE,5,lbot->val); return(temp); } else if(Schainp!=nil && typ==ATOM) return(nil); else return(error("Bad arg to cdr", FALSE)); } lispval cxxr(as,ds) register int as,ds; { register lispval temp, temp2; int i, typ; lispval errorh(); chkarg(1,"c{ad}+r"); temp = lbot->val; for( i=0 ; id.cdr; else if(typ==SDOT) { if(temp->s.CDR==0) temp = nil; else temp = temp->s.CDR; if(TYPE(temp)==DTPR) errorh(Vermisc,"Fell of the end of a bignum",nil,FALSE,5,lbot->val); } else if(Schainp!=nil && typ==ATOM) return(nil); else return(errorh(Vermisc,"Bad arg to cdr",nil,FALSE,5,temp)); } } for( i=0 ; id.car; else if(typ == SDOT) temp2 = inewint(temp->i), temp = temp2; else if(Schainp!=nil && typ==ATOM) return(nil); else return(errorh(Vermisc,"Bad arg to car",nil,FALSE,5,temp)); } } return(temp); } lispval Lcar() { return(cxxr(1,0)); } lispval Lcdr() { return(cxxr(0,1)); } lispval Lcadr() { return(cxxr(1,1)); } lispval Lcaar() { return(cxxr(2,0)); } lispval Lc02r() { return(cxxr(0,2)); } /* cddr */ lispval Lc12r() { return(cxxr(1,2)); } /* caddr */ lispval Lc03r() { return(cxxr(0,3)); } /* cdddr */ lispval Lc13r() { return(cxxr(1,3)); } /* cadddr */ lispval Lc04r() { return(cxxr(0,4)); } /* cddddr */ lispval Lc14r() { return(cxxr(1,4)); } /* caddddr */ /* * * (nthelem num list) * * Returns the num'th element of the list, by doing a caddddd...ddr * where there are num-1 d's. If num<=0 or greater than the length of * the list, we return nil. * */ lispval Lnthelem() { register lispval temp; register int i; chkarg(2,"nthelem"); if( TYPE(temp = lbot->val) != INT) return (error ("First arg to nthelem must be a fixnum",FALSE)); i = temp->i; /* pick up the first arg */ if( i <= 0) return(nil); ++lbot; /* fix lbot for call to cxxr() 'cadddd..r' */ temp = cxxr(1,i-1); --lbot; return(temp); } lispval Lscons() { register struct argent *argp = lbot; register lispval retp, handy; register int typ; chkarg(2,"scons"); retp = newsdot(); handy = (argp) -> val; if(TYPE(handy)!=INT) error("First arg to scons must be an int.",FALSE); retp->s.I = handy->i; handy = (argp+1)->val; if(handy==nil) retp->s.CDR = (lispval) 0; else { if(TYPE(handy)!=SDOT) error("Currently you may only link sdots to sdots.",FALSE); retp->s.CDR = handy; } return(retp); } lispval Lbigtol(){ register lispval handy,newp; chkarg(1,"Bignum-to-lisp"); handy = lbot->val; while(TYPE(handy)!=SDOT) handy = error(Vermisc,"Non bignum argument to Bignum-to-list", nil,TRUE,5755,handy); protect(newp = newdot()); for(; handy != nil; ) { newp->d.car = inewint(handy->s.I); if(handy->s.CDR==nil) break; newp->d.cdr = newdot(); newp = newp->d.cdr; handy = handy->s.CDR;(( } handy = (--np)->val; return(handy); } lispval Lcons() { register lispval retp; register struct argent *argp; chkarg(2,"cons"); retp = newdot(); retp->d.car = ((argp = lbot) -> val); retp->d.cdr = argp[1].val; return(retp); } #define CA 0 #define CD 1 lispval rpla(what) int what; { register struct argent *argp; register int typ; register lispval first, second; chkarg(2,"rplac[ad]"); argp = np-1; first = (argp-1)->val; while(first==nil) first = error("Attempt to rplac[ad] nil.",TRUE); second = argp->val; if (((typ = TYPE(first)) == DTPR) || (typ == ATOM) || HUNKP(first)) { if (what == CA) first->d.car = second; else first->d.cdr = second; return(first); } if (typ==SDOT) { if(what == CA) { typ = TYPE(second); if(typ!=INT) error("Rplacca of a bignum will only replace INTS",FALSE); first->s.I = second->i; } else { if(second==nil) first->s.CDR = (lispval) 0; else first->s.CDR = second; } return(first); } return(error("Bad arg to rpla",FALSE)); } lispval Lrplaca() { return(rpla(CA)); } lispval Lrplacd() { return(rpla(CD)); } lispval Leq() { register struct argent *mynp = lbot + AD; int itemp, flag; chkarg(2,"eq"); if(mynp->val==(mynp+1)->val) return(tatom); return(nil); } lispval Lnull() { chkarg(1,"null"); return ((lbot->val == nil) ? tatom : nil); } /* Lreturn **************************************************************/ /* Returns the first argument - which is nill if not specified. */ Lreturn() { if(lbot==np) protect (nil); Inonlocalgo(C_RET,lbot->val,nil); /* NOT REACHED */ } lispval Linfile() { FILE *port; register lispval name; int typ; chkarg(1,"infile"); name = lbot->val; loop: name = verify(name,"infile: file name must be atom or string"); /* return nil if file couldnt be opened if ((port = fopen((char *)name,"r")) == NULL) return(nil); */ if ((port = fopen((char *)name,"r")) == NULL) { name = errorh(Vermisc,"Unable to open file for reading.",nil,TRUE,31,name); goto loop; } ioname[PN(port)] = (lispval) inewstr(name); /* remember name */ return(P(port)); } /* outfile - open a file for writing. * 27feb81 [jkf] - modifed to accept two arguments, the second one being a * string or atom, which if it begins with an `a' tells outfile to open the * file in append mode */ lispval Loutfile() { FILE *port; register lispval name; char *mode ="w"; /* mode is w for create new file, a for append */ char *given; if(lbot+1== np) protect(nil); chkarg(2,"outfile"); name = lbot->val; given = (char *)verify((lbot+1)->val,"Illegal file open mode."); if(*given == 'a') mode = "a"; loop: name = verify(name,"Please supply atom or string name for port."); if ((port = fopen(name,mode)) == NULL) { name = errorh(Vermisc,"Unable to open file for writing.",nil,TRUE,31,name); goto loop; } ioname[PN(port)] = (lispval) inewstr(name); return(P(port)); } lispval Lterpr() { register lispval handy; FILE *port; if(lbot==np) handy = nil; else { chkarg(1,"terpr"); handy = lbot->val; } port = okport(handy,okport(Vpoport->a.clb,stdout)); putc('\n',port); fflush(port); return(nil); } lispval Lclose() { lispval port; chkarg(1,"close"); port = lbot->val; if((TYPE(port))==PORT) fclose(port->p); ioname[PN(port->p)] = nil; return(tatom); } lispval Lnwritn() { register FILE *port; register value; register lispval handy; if(lbot==np) handy = nil; else { chkarg(1,"nwritn"); handy = lbot->val; } port = okport(handy,okport(Vpoport->a.clb,stdout)); value = port->_ptr - port->_base; return(inewint(value)); } lispval Ldrain() { register FILE *port; register int iodes; register lispval handy; struct sgttyb arg; if(lbot==np) handy = nil; else { chkarg(1,"nwritn"); handy = lbot->val; } port = okport(handy, okport(Vpoport->a.clb,stdout)); if(port->_flag & _IOWRT) { fflush(port); return(nil); } if(! port->_flag & _IOREAD) return(nil); port->_cnt = 0; port->_ptr = port->_base; iodes = fileno(port); if(gtty(iodes,&arg) != -1) stty(iodes,&arg); return((lispval)(xports + (port - _iob))); } lispval Llist() { /* added for the benefit of mapping functions. */ register struct argent *ulim, *namptr; register lispval temp, result; Savestack(4); ulim = np; namptr = lbot + AD; temp = result = (lispval) np; protect(nil); for(; namptr < ulim;) { temp = temp->l = newdot(); temp->d.car = (namptr++)->val; } temp->l = nil; Restorestack(); return(result->l); } lispval Lnumberp() { chkarg(1,"numberp"); switch(TYPE(lbot->val)) { case INT: case DOUB: case SDOT: return(tatom); } return(nil); } lispval Latom() { register struct argent *lb = lbot; chkarg(1,"atom"); if(TYPE(lb->val)==DTPR || (HUNKP(lb->val))) return(nil); else return(tatom); } lispval Ltype() { chkarg(1,"type"); switch(TYPE(lbot->val)) { case INT: return(int_name); case ATOM: return(atom_name); case SDOT: return(sdot_name); case DOUB: return(doub_name); case DTPR: return(dtpr_name); case STRNG: return(str_name); case ARRAY: return(array_name); case BCD: return(funct_name); case HUNK2: return(hunk_name[0]); case HUNK4: return(hunk_name[1]); case HUNK8: return(hunk_name[2]); case HUNK16: return(hunk_name[3]); case HUNK32: return(hunk_name[4]); case HUNK64: return(hunk_name[5]); case HUNK128: return(hunk_name[6]); case VALUE: return(val_name); case PORT: return(port_name); } return(nil); } lispval Ldtpr() { chkarg(1,"dtpr"); return(typred(DTPR, lbot->val)); } lispval Lbcdp() { chkarg(1,"bcdp"); return(typred(BCD, lbot->val)); } lispval Lportp() { chkarg(1,"portp"); return(typred(PORT, lbot->val)); } lispval Larrayp() { chkarg(1,"arrayp"); return(typred(ARRAY, lbot->val)); } /* * (hunkp 'g_arg1) * Returns t if g_arg1 is a hunk, otherwise returns nil. */ lispval Lhunkp() { chkarg(1,"hunkp"); if (HUNKP(lbot->val)) return(tatom); /* If a hunk, return t */ else return(nil); /* else nil */ } lispval Lset() { lispval varble; chkarg(2,"set"); varble = lbot->val; switch(TYPE(varble)) { case ATOM: return(varble->a.clb = lbot[1].val); case VALUE: return(varble->l = lbot[1].val); } error("IMPROPER USE OF SET",FALSE); } lispval Lequal() { register lispval first, second; register type1, type2; register struct argent *lbot, *np; lispval Lsub(),Lzerop(), *stack(), unstack(), *sp(); lispval *oldsp; int mustloop = FALSE, result; chkarg(2,"equal"); if(lbot->val==lbot[1].val) return(tatom); for((oldsp=sp(), stack(lbot->val,lbot[1].val)); oldsp > sp();) { first = unstack(); second = unstack(); again: if(first==second) continue; type1=TYPE(first); type2=TYPE(second); if(type1!=type2) { if((type1==SDOT&&type2==INT)||(type1==INT&&type2==SDOT)) goto dosub; return(nil); } switch(type1) { case DTPR: stack(first->d.cdr,second->d.cdr); first = first->d.car; second = second->d.car; goto again; case DOUB: if(first->r!=second->r) return(nil); continue; case INT: if(first->i!=second->i) return(nil); continue; dosub: case SDOT: lbot = np; np++->val = first; np++->val = second; lbot->val = Lsub(); if(TYPE(lbot->val)!=INT || lbot->val->i!=0) return(nil); np = lbot; continue; case VALUE: if(first->l!=second->l) return(nil); continue; case STRNG: if(strcmp(first,second)!=0) return(nil); continue; default: return(nil); } } return(tatom); } lispval oLequal() { chkarg(2,"equal"); if( lbot[1].val == lbot->val ) return(tatom); if(Iequal(lbot[1].val,lbot->val)) return(tatom); else return(nil); } Iequal(first,second) register lispval first, second; { register type1, type2; register struct argent *lbot, *np; lispval Lsub(),Lzerop(); if(first==second) return(1); type1=TYPE(first); type2=TYPE(second); if(type1!=type2) { if((type1==SDOT&&type2==INT)||(type1==INT&&type2==SDOT)) goto dosub; return(0); } switch(type1) { case DTPR: return( Iequal(first->d.car,second->d.car) && Iequal(first->d.cdr,second->d.cdr) ); case DOUB: return(first->r==second->r); case INT: return( (first->i==second->i)); dosub: case SDOT: lbot = np; np++->val = first; np++->val = second; lbot->val = Lsub(); np = lbot + 1; return(TYPE(lbot->val)==INT&& lbot->val->i==0); case VALUE: return( first->l==second->l ); case STRNG: return(strcmp(first,second)==0); } return(0); } lispval Zequal() { register lispval first, second; register type1, type2; register struct argent *lbot, *np; lispval Lsub(),Lzerop(), *stack(), unstack(), *sp(); lispval *oldsp; int mustloop = FALSE, result; chkarg(2,"equal"); if(lbot->val==lbot[1].val) return(tatom); for((oldsp=sp(), stack(lbot->val,lbot[1].val)); oldsp > sp();) { first = unstack(); second = unstack(); again: if(first==second) continue; type1=TYPE(first); type2=TYPE(second); if(type1!=type2) { if((type1==SDOT&&type2==INT)||(type1==INT&&type2==SDOT)) goto dosub; return(nil); } switch(type1) { case DTPR: stack(first->d.cdr,second->d.cdr); first = first->d.car; second = second->d.car; goto again; case DOUB: if(first->r!=second->r) return(nil); continue; case INT: if(first->i!=second->i) return(nil); continue; dosub: case SDOT: lbot = np; np++->val = first; np++->val = second; lbot->val = Lsub(); if(TYPE(lbot->val)!=INT || lbot->val->i!=0) return(nil); np = lbot; continue; case VALUE: if(first->l!=second->l) return(nil); continue; case STRNG: if(strcmp(first,second)!=0) return(nil); continue; } } return(tatom); } /* * (print 'expression ['port]) prints the given expression to the given * port or poport if no port is given. The amount of structure * printed is a function of global lisp variables prinlevel and * prinlength. */ lispval Lprint() { register lispval handy; extern int prinlevel,prinlength; handy = nil; /* port is optional, default nil */ switch(np-lbot) { case 2: handy = lbot[1].val; case 1: break; defa((ult: argerr("print"); } chkrtab(Vreadtable->a.clb); if(TYPE(Vprinlevel->a.clb) == INT) { prinlevel = Vprinlevel->a.clb->i; } else prinlevel = -1; if(TYPE(Vprinlength->a.clb) == INT) { prinlength = Vprinlength->a.clb->i; } else prinlength = -1; printr(lbot->val,okport(handy,okport(Vpoport->a.clb,poport))); return(nil); } /* patom does not use prinlevel or prinlength * * form is (patom 'value ['port]) */ lispval Lpatom() { register lispval temp; register lispval handy; register int typ; FILE *port; extern int prinlevel,prinlength; handy = nil; /* port is optional, default nil */ switch(np-lbot) { case 2: handy = lbot[1].val; case 1: break; default: argerr("patom"); } temp = Vreadtable->a.clb; chkrtab(temp); port = okport(handy, okport(Vpoport->a.clb,stdout)); if ((typ= TYPE((temp = (lbot)->val))) == ATOM) fputs(temp->a.pname, port); else if(typ == STRNG) fputs(temp,port); else { printr(temp, port); } return(temp); } /* * (pntlen thing) returns the length it takes to print out * an atom or number. */ lispval Lpntlen() { register lispval temp; return(inewint(Ipntlen())); } Ipntlen() { register lispval temp; register char *handy; temp = np[-1].val; loop: switch(TYPE(temp)) { case ATOM: handy = temp->a.pname; break; case STRNG: handy = (char *) temp; break; case INT: sprintf(strbuf,"%d",temp->i); handy =strbuf; break; case DOUB: sprintf(strbuf,"%g",temp->r); handy =strbuf; break; default: temp = error("Non atom or number to pntlen\n",TRUE); goto loop; } return( strlen(handy)); } #undef okport FILE * okport(arg,proper) lispval arg; FILE *proper; { if(TYPE(arg)!=PORT) return(proper); else return(arg->p); } al; loop: switch(TYPE(temp)) { case ATOM: handy = temp->a.pname; break; case STRNG: handy = (char *) temp; break; case INT: sprintf(strbuf,"%d",temp->i); handy =strbuf; break; case DOUB: sprintf(strbuf,"%g",temp->r); handy =strbuf; break; default: temp = error("Ncmd/lisp/franz/lam2.c 644 0 12 33367 2552701436 7721 static char *sccsid = "@(#)lam2.c 35.3 7/8/81"; # include "global.h" # include /* * (flatc 'thing ['max]) returns the smaller of max and the number of chars * required to print thing linearly. * if max argument is not given, we assume the second arg is infinity */ static flen; /*Internal to this module, used as a running counter of flatsize*/ static fmax; /*used for maximum for quick reference */ lispval Lflatsi() { register lispval current; Savestack(1); /* fixup entry mask */ fmax = 0x7fffffff; /* biggest integer by default */ switch(np-lbot) { case 2: current = lbot[1].val; while(TYPE(current) != INT) current = errorh(Vermisc, "flatsize: second arg not integer", nil,TRUE,0,current); fmax = current->i; case 1: break; default: argerr("flatsize"); } flen = 0; current = lbot->val; protect(nil); /*create space for argument to pntlen*/ Iflatsi(current); Restorestack(); return(inewint(flen)); } /* * Iflatsi does the real work of the calculation for flatc */ Iflatsi(current) register lispval current; { register lispval handy; register int temp; if(flen > fmax) return(fmax); switch(TYPE(current)) { patom: case INT: case ATOM: case DOUB: case STRNG: np[-1].val = current; flen += Ipntlen(); return; pthing: case DTPR: flen++; Iflatsi(current->d.car); current = current->d.cdr; if(current == nil) { flen++; return; } if(flen > fmax) return; switch(TYPE(current)) { case INT: case ATOM: case DOUB: flen += 4; goto patom; case DTPR: goto pthing; } } } #define EADC -1 #define EAD -2 lispval Lread() { return (r(EAD)); } lispval Lratom() { return (r(ATOM)); } lispval Lreadc() { return (r(EADC)); } #include "chars.h" #include "chkrtab.h" extern unsigned char *ctable; /* r *********************************************************************/ /* this function maps the desired read function into the system-defined */ /* reading functions after testing for a legal port. */ lispval r(op) int op; { unsigned char c; register lispval result; int orlevel; extern int rlevel; FILE *ttemp; struct nament *oldbnp = bnp; Savestack(1); switch(np-lbot) { case 0: protect(nil); case 1: protect(nil); case 2: break; default: argerr("read or ratom or readc"); } result = Vreadtable->a.clb; chkrtab(result); orlevel = rlevel; rlevel = 0; ttemp = okport(Vpiport->a.clb,stdin); ttemp = okport(lbot->val,ttemp); /*printf("entering switch\n");*/ if(ttemp == stdin) fflush(stdout); /* flush any pending * characters if reading stdin * there should be tests to see * if this is a tty or pipe */ switch (op) { case EADC: rlevel = orlevel; switch (ctable[c = getc(ttemp) & 0177] & 0377) { case VEOF: Restorestack(); return(lbot[1].val); default: strbuf[0] = hash = c; strbuf[1] = 0; atmlen = 2; Restorestack(); return((lispval)getatom()); } case ATOM: rlevel = orlevel; result = (ratomr(ttemp)); goto out; case EAD: PUSHDOWN(Vpiport,P(ttemp)); /* rebind Vpiport */ result = readr(ttemp); out: if(result==eofa) { if(sigintcnt > 0) sigcall(SIGINT); result = lbot[1].val; } rlevel = orlevel; popnames(oldbnp); /* unwind bindings */ Restorestack(); return(result); } } /* Lload *****************************************************************/ /* Reads in and executes forms from the specified file. This should */ /* really be an nlambda taking multiple arguments, but the error */ /* handling gets funny in that case (one file out of several not */ /* openable, for instance). */ lispval Lload() { register FILE *port; register char *p, *ttemp; register lispval vtemp; register struct argent *lbot, *np; struct nament *oldbnp = bnp; int orlevel,typ; char longname[100]; char *shortname, *end2; chkarg(1,"load"); if((typ = TYPE(lbot->val)) == ATOM) ttemp = lbot->val->a.pname ; /* ttemp will point to name */ else if(typ == STRNG) ttemp = (char *) lbot->val; else return(error("FILENAME MUST BE ATOMIC",FALSE)); strcpy(longname,"/usr/lib/lisp/" ); for(p = longname; *p; p++); shortname = p; strcpy(p,ttemp); for(; *p; p++); end2 = p; strcpy(p,".l"); if ((port = fopen(shortname,"r")) == NULL && (port = fopen(longname, "r")) == NULL) { *end2 = 0; if ((port = fopen(shortname,"r")) == NULL && (port = fopen(longname, "r")) == NULL) errorh(Vermisc,"Can't open file: ", nil,FALSE,0,lbot->val); } orlevel = rlevel; rlevel = 0; if(ISNIL(copval(gcload,CNIL)) && loading->a.clb != tatom && ISNIL(copval(gcdis,CNIL))) gc(CNIL); /* do a gc if gc will be off */ /* shallow bind the value of lisp atom piport */ /* so readmacros will work */ PUSHDOWN(Vpiport,P(port)); PUSHDOWN(loading,tatom); /* set indication of loading status */ while ((vtemp = readr(port)) != eofa) { eval(vtemp); } popnames(oldbnp); /* unbind piport, loading */ rlevel = orlevel; fclose(port); return(nil); } /* concat ************************************************** - - use: (concat arg1 arg2 ... ) - - concatenates the print names of all of its arguments. - the arguments may be atoms, integers or real numbers. - - *********************************************************/ lispval Iconcat(unintern) { register struct argent *temnp; register int atmlen; /* Passt auf! atmlen in the external sense calculated by newstr */ int i; lispval cur; char lstrbf[200]; /* local string buffer needed if sdot seen */ atmlen = 0 ; strbuf[0] = NULL_CHAR ; /* loop for each argument */ for(temnp = lbot + AD ; temnp < np ; temnp++) { cur = temnp->val; loop: if(atmlen > 200) error("concat: string buffer overflow",FALSE); switch(TYPE(cur)) { case ATOM: strcpy(&strbuf[atmlen], ((struct atom *) cur) -> pname) ; break; case STRNG: strcpy(&strbuf[atmlen], cur); break; case INT: sprintf(&strbuf[atmlen],"%d",cur->i); break; case DOUB: sprintf(&strbuf[atmlen],"%f",cur->f); break; case SDOT: { struct _iobuf _myiob; _myiob._flag = _IOWRT+_IOSTRG; _myiob._ptr = &strbuf[atmlen]; _myiob._cnt = STRBLEN - 1 - atmlen; pbignum(cur,&_myiob); putc(0,&_myiob); break; } default: cur = error("Non atom or number to concat",TRUE); goto loop; /* if returns value, try it */ } atmlen = strlen(strbuf); } if(unintern) return( (lispval) newatom()); else return( (lispval) getatom()) ; } lispval Lconcat(){ return(Iconcat(FALSE)); } lispval Luconcat(){ return(Iconcat(TRUE)); } lispval Lputprop() { lispval Iputprop(); chkarg(3,"putprop"); return(Iputprop(lbot->val,lbot[1].val,lbot[2].val)); } lispval Iputprop(atm,prop,ind) register lispval prop, ind, atm; { register lispval pptr; lispval *tack; /* place to begin property list */ lispval errorh(); top: switch (TYPE(atm)) { case ATOM: if(atm == nil) tack = &nilplist; else tack = &(atm->a.plist); break; case DTPR: for (pptr = atm->d.cdr ; pptr != nil ; pptr = pptr->d.cdr->d.cdr) if(TYPE(pptr) != DTPR || TYPE(pptr->d.cdr) != DTPR) break; if(pptr != nil) { atm = errorh(Vermisc, "putprop: bad disembodied property list", nil,TRUE,0,atm); goto top; } tack = (lispval *) &(atm->d.cdr); break; default: errorh(Vermisc,"putprop: Bad first argument: ",nil,FALSE,0,atm); } pptr = *tack; /* start of property list */ findit: for (pptr = *tack ; pptr != nil ; pptr = pptr->d.cdr->d.cdr) if (pptr->d.car == ind) { (pptr->d.cdr)->d.car = prop; return(prop); ((} else tack = &(pptr->d.cdr->d.cdr) ; *tack = pptr = newdot(); pptr->d.car = ind; pptr = pptr->d.cdr = (lispval) newdot(); pptr->d.car = prop; return(prop); } /* get from property list * there are three routines to accomplish this * Lget - lisp callable, the first arg can be a symbol or a disembodied * property list. In the latter case we check to make sure it * is a real one (as best we can). * Iget - internal routine, the first arg must be a symbol, no disembodied * plists allowed * Igetplist - internal routine, the first arg is the plist to search. */ lispval Lget() { register lispval ind, atm; register lispval dum1, dum2; lispval Igetplist(); chkarg(2,"get"); ind = lbot[1].val; atm = lbot[0].val; top: switch(TYPE(atm)) { case ATOM: if(atm==nil) atm = nilplist; else atm = atm->a.plist; break; case DTPR: for (dum1 = atm->d.cdr; dum1 != nil; dum1 = dum1->d.cdr->d.cdr) if((TYPE(dum1) != DTPR) || (TYPE(dum1->d.cdr) != DTPR)) break; /* bad prop list */ if(dum1 != nil) { atm = errorh(Vermisc, "get: bad disembodied property list", nil,TRUE,0,atm); goto top; } atm = atm->d.cdr; break; default: /* remove since maclisp doesnt treat this as an error, ugh return(errorh(Vermisc,"get: bad first argument: ", nil,FALSE,0,atm)); */ return(nil); } while (atm != nil) { if (atm->d.car == ind) return ((atm->d.cdr)->d.car); atm = (atm->d.cdr)->d.cdr; } return(nil); } /* * Iget - the first arg must be a symbol. */ lispval Iget(atm,ind) register lispval atm, ind; { lispval Igetplist(); if(atm==nil) atm = nilplist; else atm = atm->a.plist; return(Igetplist(atm,ind)); } /* * Igetplist * pptr is a plist * ind is the indicator */ lispval Igetplist(pptr,ind) register lispval pptr,ind; { while (pptr != nil) { if (pptr->d.car == ind) return ((pptr->d.cdr)->d.car); pptr = (pptr->d.cdr)->d.cdr; } return(nil); } lispval Lgetd() { register lispval typ; chkarg(1,"getd"); typ = lbot->val; if (TYPE(typ) != ATOM) errorh(Vermisc, "getd: Only symbols have function definitions", nil, FALSE, 0, typ); return(typ->a.fnbnd); } lispval Lputd() { register lispval atom, list; register lispval dum1, dum2; chkarg(2,"putd"); list = lbot[1].val; atom = lbot->val; if (TYPE(atom) != ATOM) error("only symbols have function definitions", FALSE); atom->a.fnbnd = list; return(list); } /* =========================================================== - mapping functions which return a list of the answers - mapcar applies the given function to successive elements - maplist applies the given function to successive sublists - ===========================================================*/ lispval Lmapcrx(maptyp,join) int maptyp; /* 0 = mapcar, 1 = maplist */ int join; /* 0 = the above, 1 = s/car/can/ */ { register struct argent *namptr; register index; register lispval temp; register lispval current; register struct argent *lbot; register struct argent *np; struct argent *first, *last; int count; lispval lists[25], result; namptr = lbot + 1; count = np - namptr; if (count <= 0) return (nil); /*oldlbot = lbot; /* lbot saved by virtue of entry mask */ result = current = (lispval) np; protect(nil); /* set up space for returned list */ protect(lbot->val); /*copy funarg for call to funcall */ lbot = np -1; first = np; last = np += count; for(index = 0; index < count; index++) { temp =(namptr++)->val; if (TYPE (temp ) != DTPR && temp!=nil) error ( "bad list argument to map",FALSE); lists[index] = temp; } for(;;) { for(namptr=first,index=0; indexval = temp->d.car; else (namptr++)->val = temp; lists[index] = temp->d.cdr; } if (join == 0) { current->l = newdot(); current->l->d.car = Lfuncal(); current = (lispval) ¤t->l->d.cdr; } else { current->l = Lfuncal(); if ( TYPE ( current -> l) != DTPR && current->l != nil) error("bad type returned from funcall inside map",FALSE); else while ( current -> l != nil ) current = (lispval) & (current ->l ->d.cdr); } np = last; } done: if (join == 0)current->l = nil; /*lbot = oldlbot;*/ return(result->l); } /* ============================ - - Lmapcar - =============================*/ lispval Lmapcar() { return(Lmapcrx(0,0)); /* call general routine */ } /* ============================ - - - Lmaplist - ==============================*/ lispval Lmaplist() { return(Lmapcrx(1,0)); /* call general routine */ } /* ================================================ - mapping functions which return the value of the last function application. - mapc and map - ===================================================*/ lispval Lmapcx(maptyp) int maptyp; /* 0= mapc , 1= map */ { register struct argent *namptr; register index; register lispval temp; register lispval result; int count; struct argent *first; lispval lists[25], errorh(); Savestack(4); namptr = lbot + 1; count = np - namptr; if(count <= 0) return(nil); result = lbot[1].val; /*This is what macsyma wants so ... */ /*copy funarg for call to funcall */ lbot = np; protect((namptr - 1)->val); first = np; np += count; for(index = 0; index < count; index++) { temp = (namptr++)->val; while(temp!=nil && TYPE(temp)!=DTPR) temp = errorh(Vermisc,"Inappropriate list argument to mapc",nil,TRUE,0,temp); lists[index] = temp; } for(;;) { for(namptr=first,index=0; indexval = temp->d.car; else (namptr++)->val = temp; lists[index] = temp->d.cdr; } Lfuncal(); } done: Restorestack(); return(result); } /* ================================== - - mapc map the car of the lists - - ==================================*/ lispval Lmapc() { return( Lmapcx(0) ); } /* ================================= - - map map the cdr of the lists - - ===================================*/ lispval Lmap() { return( Lmapcx(1) ); } lispval Lmapcan() { lispval Lmapcrx(); return ( Lmapcrx ( 0,1 ) ); } lispval Lmapcon() { lispval Lmapcrx(); return ( Lmapcrx ( 1,1 ) ); } e: Restorestack(); return(result); } /* ================================== - - mapc map the car of the lists - - ==================================*/ lispval Lmapc() { return( Lmapcx(0) ); } /* ================================= - - map map the cdr of cmd/lisp/franz/lam3.c 644 0 12 26541 2552701437 7717 static char *sccsid = "@(#)lam3.c 35.4 7/8/81"; # include "global.h" lispval Lalfalp() { register char *first, *second; chkarg(2,"alphalessp"); first = (char *) verify(lbot->val,"alphalessp: non symbol or string arg"); second = (char *) verify((lbot+1)->val,"alphalessp: non symbol or string arg"); if(strcmp(first,second) < 0) return(tatom); else return(nil); } lispval Lncons() { register lispval handy; chkarg(1,"ncons"); handy = newdot(); handy->d.cdr = nil; handy->d.car = lbot->val; return(handy); } lispval Lzerop() { register lispval handy; chkarg(1,"zerop"); handy = lbot->val; switch(TYPE(handy)) { case INT: return(handy->i==0?tatom:nil); case DOUB: return(handy->r==0.0?tatom:nil); } return(nil); } lispval Lonep() { register lispval handy; lispval Ladd(); handy = lbot->val; switch(TYPE(handy)) { case INT: return(handy->i==1?tatom:nil); case DOUB: return(handy->r==1.0?tatom:nil); case SDOT: protect(inewint(0)); handy = Ladd(); if(TYPE(handy)!=INT || handy->i !=1) return(nil); else return(tatom); } return(nil); } lispval cmpx(lssp) { register struct argent *argp; register struct argent *outarg; register struct argent *handy; register count; struct argent *onp = np; Savestack(4); argp = lbot + 1; outarg = np; while(argp < onp) { np = outarg + 2; lbot = outarg; if(lssp) *outarg = argp[-1], outarg[1] = *argp++; else outarg[1] = argp[-1], *outarg = *argp++; lbot->val = Lsub(); np = lbot + 1; if(Lnegp()==nil) { Restorestack(); return(nil); } } Restorestack(); return(tatom); } lispval Lgreaterp() { register int typ; /* do the easy cases first */ if(np-lbot == 2) { if((typ=TYPE(lbot->val)) == INT) { if((typ=TYPE(lbot[1].val)) == INT) return((lbot[0].val->i - lbot[1].val->i) > 0 ? tatom : nil); else if(typ == DOUB) return((lbot[0].val->i - lbot[1].val->r) > 0.0 ? tatom : nil); } else if(typ == DOUB) { if((typ=TYPE(lbot[1].val)) == INT) return((lbot[0].val->r - lbot[1].val->i) > 0.0 ? tatom : nil); else if(typ == DOUB) return((lbot[0].val->r - lbot[1].val->r) > 0.0 ? tatom : nil); } } return(cmpx(FALSE)); } lispval Llessp() { register int typ; /* do the easy cases first */ if(np-lbot == 2) { if((typ=TYPE(lbot->val)) == INT) { if((typ=TYPE(lbot[1].val)) == INT) return((lbot[0].val->i - lbot[1].val->i) < 0 ? tatom : nil); else if(typ == DOUB) return((lbot[0].val->i - lbot[1].val->r) < 0.0 ? tatom : nil); } else if(typ == DOUB) { if((typ=TYPE(lbot[1].val)) == INT) return((lbot[0].val->r - lbot[1].val->i) < 0.0 ? tatom : nil); else if(typ == DOUB) return((lbot[0].val->r - lbot[1].val->r) < 0.0 ? tatom : nil); } } return(cmpx(TRUE)); } lispval Ldiff() { register lispval arg1,arg2; register handy = 0; chkarg(2,"Ldiff"); arg1 = lbot->val; arg2 = (lbot+1)->val; if(TYPE(arg1)==INT && TYPE(arg2)==INT) { handy=arg1->i - arg2->i; } else error("non-numeric argument",FALSE);(( return(inewint(handy)); } lispval Lmod() { register lispval arg1,arg2; lispval handy; struct sdot fake1, fake2; fake2.CDR = 0; fake1.CDR = 0; chkarg(2,"mod"); handy = arg1 = lbot->val; arg2 = (lbot+1)->val; switch(TYPE(arg1)) { case SDOT: switch(TYPE(arg2)) { case SDOT: /* both are already bignums */ break; case INT: /* convert arg2 to bignum */ fake2.I = arg2->i; arg2 =(lispval) &fake2; break; default: error("non-numeric argument",FALSE); } break; case INT: switch(TYPE(arg2)) { case SDOT: /* convert arg1 to bignum */ fake1.I = arg1->i; arg1 =(lispval) &fake1; break; case INT: /* both are fixnums */ return( inewint ((arg1->i) % (arg2->i)) ); default: error("non-numeric argument",FALSE); } break; default: error("non-numeric argument",FALSE); } if(TYPE((lbot+1)->val)==INT && lbot[1].val->i==0) return(handy); divbig(arg1,arg2,0,&handy); if(handy==((lispval)&fake1)) handy = inewint(fake1.I); if(handy==((lispval)&fake2)) handy = inewint(fake2.I); return(handy); } lispval Ladd1() { register lispval handy; lispval Ladd(); Savestack(1); /* fixup entry mask */ handy = rdrint; handy->i = 1; protect(handy); handy=Ladd(); Restorestack(); return(handy); } lispval Lsub1() { register lispval handy; lispval Ladd(); Savestack(1); /* fixup entry mask */ handy = rdrint; handy->i = - 1; protect(handy); handy=Ladd(); Restorestack(); return(handy); } lispval Lminus() { register lispval arg1, handy; register temp; lispval subbig(); chkarg(1,"minus"); arg1 = lbot->val; handy = nil; switch(TYPE(arg1)) { case INT: handy= inewint(0 - arg1->i); break; case DOUB: handy = newdoub(); handy->r = -arg1->r; break; case SDOT: { struct sdot dummyb; handy = (lispval) &dummyb; handy->s.I = 0; handy->s.CDR = (lispval) 0; handy = subbig(handy,arg1); break; } default: error("non-numeric argument",FALSE); } return(handy); } lispval Lnegp() { register lispval handy = np[-1].val, work; register flag = 0; loop: switch(TYPE(handy)) { case INT: if(handy->i < 0) flag = TRUE; break; case DOUB: if(handy->r < 0) flag = TRUE; break; case SDOT: for(work = handy; work->s.CDR!=(lispval) 0; work = work->s.CDR) {;} if(work->s.I < 0) flag = TRUE; break; default: handy = errorh(Vermisc, "minusp: Non-(int,real,bignum) arg: ", nil, TRUE, 0, handy); goto loop; } if(flag) return(tatom); return(nil); } lispval Labsval() { register lispval arg1, handy; register temp; chkarg(1,"absval"); arg1 = lbot->val; if(Lnegp()!=nil) return(Lminus()); return(arg1); } #include "vaxframe.h" /* new version of showstack, We will set fp to point where the register fp points. Then fp+2 = saved ap fp+4 = saved pc fp+3 = saved fp ap+1 = first arg If we find that the saved pc is somewhere in the routine eval, then we print the first argument to that eval frame. This is done by looking one beyond the saved ap. */ lispval Lshostk() { lispval isho(); return(isho(1)); } static lispval isho(f) int f; { register struct frame *myfp; register lispval handy; int **fp; /* this must be the first local */ int virgin=1; lispval linterp(); lispval _qfuncl(),tynames(); /* locations in qfuncl */ extern int prinlevel,prinlength; if(TYPE(Vprinlevel->a.clb) == INT) { prinlevel = Vprinlevel->a.clb->i; } else prinlevel = -1; if(TYPE(Vprinlength->a.clb) == INT) { prinlength = Vprinlength->a.clb->i; } else prinlength = -1; if(f==1) printf("Forms in evaluation:\n"); else printf("Backtrace:\n\n"); myfp = (struct frame *) (&fp +1); /* point to current frame */ while(TRUE) { if( (myfp->pc > eval && /* interpreted code */ myfp->pc < popnames) || (myfp->pc > Lfuncal && /* compiled code */ myfp->pc < linterp) ) { if(((int) myfp->ap[0]) == 1) /* only if arg given */ { handy = (myfp->ap[1]); if(f==1) printr(handy,stdout), putchar('\n'); else { if(virgin) virgin = 0; else printf(" -- "); printr((TYPE(handy)==DTPR)?handy->d.car:handy,stdout); } } } if(myfp > myfp->fp) break; /* end of frames */ else myfp = myfp->fp; } putchar('\n'); return(nil); } /* * * (baktrace) * * baktrace will print the names of all functions being evaluated * from the current one (baktrace) down to the first one. * currently it only prints the function name. Planned is a * list of local variables in all stack frames. * written by jkf. * */ lispval Lbaktrace() { isho(0); } /* * * (oblist) * * oblist returns a list of all symbols in the oblist * * written by jkf. */ lispval Loblist() { int indx; lispval headp, tailp ; struct atom *symb ; extern int hashtop; Savestack(0); headp = tailp = newdot(); /* allocate first DTPR */ protect(headp); /*protect the list from garbage collection*/ /*line added by kls */ for( indx=0 ; indx <= hashtop-1 ; indx++ ) /* though oblist */ { for( symb = hasht[indx] ; symb != (struct atom *) CNIL ; symb = symb-> hshlnk) { if(TYPE(symb) != ATOM) { printf(" non symbol in hasht[%d] = %x: ",indx,symb); printr(symb,stdout); printf(" \n"); fflush(stdout); } tailp->d.car = (lispval) symb ; /* remember this atom */ tailp = tailp->d.cdr = newdot() ; /* link to next DTPR */ } } tailp->d.cdr = nil ; /* close the list unfortunately throwing away the last DTPR */ Restorestack(); return(headp); } /* * Maclisp setsyntax function: * (setsyntax c s x) * c represents character either by fixnum or atom * s is the atom "macro" or the atom "splicing" (in which case x is the * macro to be invoked); or nil (meaning don't change syntax of c); or * (well thats enough for now) if s is a fixnum then we modify the bits * for c in the readtable. */ #include "chars.h" #include "chkrtab.h" lispval Lsetsyn() { register lispval s, c; register struct argent *mynp; register index; lispval x,debugmode; extern unsigned char *ctable; extern lispval Istsrch(); int value; switch(np-lbot) { case 2: x= nil; /* only 2 args given */ case 3: x = lbot[2].val; /* all three args given */ break; default: argerr("setsyntax"); } s = Vreadtable->a.clb; chkrtab(s); /* debugging code debugmode = Istsrch(matom("debugging"))->d.cdr->d.cdr->d.cdr; if(debugmode) printf("Readtable addr: %x\n",ctable); end debugging code */ mynp = lbot; c = (mynp++)->val; s = (mynp++)->val; switch(TYPE(c)) { default: error("neither fixnum, atom or string as char to setsyntax",FALSE); case ATOM: index = *(c->a.pname); if((c->a.pname)[1])error("Only 1 char atoms to setsyntax",FALSE); break; case INT: index = c->i; break; case STRNG: index = (int) *((char *) c); } switch(TYPE(s)) { case INT: if(s->i == VESC) Xesc = (char) index; else if(s->i == VDQ) Xdqc = (char) index; else if(s->i == VSD) Xsdc = (char) index; /* string */ if(ctable[index] == VESC /* if we changed the current esc */ && s->i != VESC /* to something else, pick current */ && Xesc == (char) index) { ctable[index] = s->i; rpltab(VESC,&Xesc); } else if(ctable[index] == VDQ /* likewise for double quote */ && s->i != VDQ && Xdqc == (char) index) { ctable[index] = s->i; rpltab(VDQ,&Xdqc); } else if(ctable[index] == VSD /* and for string delimiter */ && s->i != VSD && Xsdc == (char) index) { ctable[index] = s->i; rpltab(VSD,&Xsdc); } else ctable[index] = s->i; break; case ATOM: if(s==splice) ctable[index] = VSPL; else if(s==macro) ctable[index] = VMAC; if(TYPE(c)!=ATOM) { strbuf[0] = index; strbuf[1] = 0; c = (getatom()); } Iputprop(c,x,lastrtab); } return(tatom); } /* * this aux function is used by setsyntax to determine the new current * escape or double quote character. It scans the character table for * the first character with the given class (either VESC or VDQ) and * puts that character in Xesc or Xdqc (whichever is pointed to by * addr). */ rpltab(cclass,addr) char cclass; char *addr; { register int i; extern unsigned char *ctable; for(i=0; i<=127 && ctable[i] != cclass; i++); if(i<=127) *addr = (char) i; else *addr = '\0'; } lispval Lzapline() { register FILE *port; extern FILE * rdrport; port = rdrport; while (!feof(port) && (getc(port)!='\n') ); return(nil); } character table for * the first character with the given class (either VESC or VDQ) and * puts that character in Xesc or Xdqc (whichever is pointed to by *cmd/lisp/franz/lam4.c 644 0 12 37375 2552701440 7721 static char *sccsid = "@(#)lam4.c 35.2 7/8/81"; #include "global.h" typedef struct argent *ap; lispval adbig(),subbig(),mulbig(); double Ifloat(); lispval Ladd() { register lispval work; register ap result, mynp, oldnp, lbot, np; int restype,prunep,hi,lo=0; struct sdot dummybig; double flacc; oldnp = result = np; restype = INT; /* now start as integers */ protect(nil); for(mynp = lbot; mynp < oldnp; mynp++) { work = mynp->val; switch(TYPE(work)) { case INT: switch(restype) { case SDOT: dmlad(result->val,1,work->i); prunep = TRUE; /* In adding the fixnum to the sdot we may make it possible for the bignum to be represented as a fixnum */ break; case INT: if(exarith(lo,1,work->i,&hi,&lo)) { work = result->val = newsdot(); work->s.I = lo; work = work->s.CDR = newdot(); work->s.I = hi; work->s.CDR = nil; restype = SDOT; prunep = FALSE; } break; case DOUB: result->val->r += work->i; break; default:(( goto urk; } break; case SDOT: switch(restype) { case INT: dummybig.I = lo; dummybig.CDR = nil; work=adbig(work,&dummybig); goto code1; case SDOT: work=adbig(work,result->val); /* previous result is no longer needed */ pruneb(result->val); code1: restype = TYPE(work); /* SDOT or INT */ if(restype==INT) { lo = work->i; prunei(work); } else { prunep = FALSE; /* sdot is cannonical */ result->val = work; } break; case DOUB: result->val->r += Ifloat(work); break; default: goto urk; } break; case DOUB: switch(restype) { case SDOT: if(prunep) { lispval handy; dummybig.I = 0; dummybig.CDR = (lispval) 0; handy = adbig(&dummybig,result->val); pruneb(result->val); result->val = handy; } flacc = Ifloat(result->val) + work->r; pruneb(result->val); scrimp: (result->val = newdoub())->r = flacc; restype = DOUB; break; case INT: flacc = work->r + lo; goto scrimp; case DOUB: result->val->r += work->r; break; default: goto urk; } break; default: errorh(Vermisc,"Non-number to add",nil,0,FALSE,work); } } work = result->val; switch(restype){ case DOUB: return(work); case INT: return(inewint(lo)); case SDOT: if(prunep==FALSE) return(work); else { /* wouldn't (copy result->val) be faster ? -dhl */ /* It might, but isn't guaranteed to canonicalize */ dummybig.I = 0; dummybig.CDR = (lispval) 0; return(adbig(&dummybig,work)); } urk: error("Internal error in add ",FALSE); } } /* exarith exact arithmetic * calculates x=a*b+c where a,b and c are 32 bit 2's complement integers * whose top two bits must be the same (i.e. the are members of the set * of valid fixnum values for Franz Lisp). The result, x, will be 64 bits * long but since each of a, b and c had only 31 bits of precision, the * result x only has 62 bits of precision. The lower 30 bits are returned * in *plo and the high 32 bits are returned in *phi. If *phi is 0 or -1 then * x doesn't need any more than 31 bits plus sign to describe, so we * place the sign in the high two bits of *plo and return 0 from this * routine. A non zero return indicates that x requires more than 31 bits * to describe. */ exarith(a,b,c,phi,plo) int *phi, *plo; { asm(" emul 4(ap),8(ap),12(ap),r2 #r2 = a*b + c to 64 bits"); asm(" extzv $0,$30,r2,*20(ap) #get new lo"); asm(" extv $30,$32,r2,r0 #get new carry"); asm(" beql out # hi = 0, no work necessary"); asm(" movl r0,*16(ap) # save hi"); asm(" mcoml r0,r0 # Is hi = -1 (it'll fit in one word)"); asm(" bneq out # it doesn't"); asm(" bisl2 $0xc0000000,*20(ap) # alter low so that it is ok."); asm("out: ret"); } lispval Lsub() { register lispval work; register ap result, mynp, oldnp, lbot, np; int prunep,restype,hi,lo=0; struct sdot dummybig; double flacc; lispval Lminus(); oldnp = result = np; mynp = lbot + 1; restype = INT; prunep = TRUE; if(oldnp==lbot) goto out; if(oldnp==mynp) { return(Lminus()); } protect(nil); work = lbot->val; /* examine the first argument and perhaps set restype to the * correct type. If restype (result type) is INT, then the * fixnum value is stored in lo. Otherwise, if restype is * SDOT or DOUB, then the value is stored in result->val. */ switch(TYPE(work)) { case INT: lo = work->i; restype = INT; break; case SDOT: /* we want to copy the sdot we are given as an argument since * the bignum arithmetic routine dmlad clobbers the values it * is given. */ dummybig.I = 0; /* create a zero sdot */ dummybig.CDR = nil; work = adbig(work,&dummybig); /* the resulting value may have been reduced from an * sdot to a fixnum. This should never happen though * but if it does, we simplify things. */ restype = TYPE(work); if(restype==INT) { lo = work->i; /* has turned into an fixnum */ prunei(work); /* return fixnum cell */ } else { prunep = FALSE; /* sdot is cannonical */ result->val = work; } break; case DOUB: (result->val = newdoub())->r = work->r; restype = DOUB; } /* now loop through the rest of the arguments subtracting them * from the running result in result or lo */ for(; mynp < oldnp; mynp++) { work = mynp->val; switch(TYPE(work)) { case INT: switch(restype) { case SDOT: /* subtracting a fixnum from an bignum * use the distructive multiply (by 1) * and add the negative of the work value. * The result will still be pointed to * by result->val */ dmlad(result->val,1, -work->i); prunep = TRUE; /* check up on exiting break; /* that it didn't collapse */ case INT: /* subtracting a fixnum from a fixnum, * the result could turn into a bignum */ if(exarith(lo,1,-work->i,&hi,&lo)) { work = result->val = newsdot(); work->s.I = lo; work = work->s.CDR = newdot(); work->s.I = hi; work->s.CDR = nil; restype = SDOT; prunep = TRUE; } break; case DOUB: /* subtracting a fixnum from a flonum */ result->val->r -= work->i; break; default: goto urk; } break; case SDOT: switch(restype) { case INT: /* subtracting a bignum from an integer * first make a bignum of the integer and * then fall into the next case */ dummybig.I = lo; dummybig.CDR = (lispval) 0; work = subbig((lispval)&dummybig,work); goto on1; case SDOT: /* subtracting one bignum from another. The * routine to do this ends up calling addbig * and should probably be written specifically * for subtraction. */ work = subbig(result->val,work); pruneb(result->val); on1: /* check if the result has turned into a fixnum */ restype = TYPE(work); if(restype==INT) { lo = work->i; /* it has */ prunei(work); } else { prunep = FALSE; /* sdot is cannonical */ result->val = work; } break; case DOUB: /* Subtract bignum from float */ /* Death on overflow */ result->val->r -= Ifloat(work); break; default: goto urk; } break; case DOUB: switch(restype) { case SDOT: /* subtracting a flonum from a bignum. */ if(prunep) { lispval handy; dummybig.I = 0; dummybig.CDR = (lispval) 0; handy = adbig(&dummybig,result->val); pruneb(result->val); result->val = handy; } flacc = Ifloat(result->val) - work->r; pruneb(result->val); scrimp: (result->val = newdoub())->r = flacc; restype = DOUB; break; case INT: /* subtracting a flonum from an fixnum. * The result will be an flonum. */ flacc = lo - work->r; goto scrimp; case DOUB: /* subtracting a flonum from a flonum, what * could be easier? */ result->val->r -= work->r; break; default: goto urk; } break; default: errorh(Vermisc,"Non-number to minus",nil,FALSE,0,work); } } out: work = result->val; switch(restype){ case DOUB: return(work); case INT: return(inewint(lo)); case SDOT: if(prunep==FALSE) return(work); else { dummybig.I = 0; dummybig.CDR = (lispval) 0; return(adbig(&dummybig,work)); } urk: error("Internal error in difference",FALSE); } } lispval Ltimes() { register lispval work; register ap result, mynp, oldnp, lbot, np; int itemp,restype,prunep,hi,lo=1; struct sdot dummybig; double flacc; oldnp = result = np; restype = INT; /* now start as integers */ prunep = TRUE; protect(nil); for(mynp = lbot; mynp < oldnp; mynp++) { work = mynp->val; switch(TYPE(work)) { case INT: switch(restype) { case SDOT: dmlad(result->val,work->i,0); prunep = TRUE; /* In adding the fixnum to the sdot we may make it possible for the bignum to be represented as a fixnum */ break; case INT: if(exarith(lo,work->i,0,&hi,&lo)) { work = result->val = newsdot(); work->s.I = lo; work = work->s.CDR = newdot(); work->s.I = hi; work->s.CDR = nil; restype = SDOT; prunep = TRUE; } break; case DOUB: result->val->r *= work->i; break; default: goto urk; } break; case SDOT: switch(restype) { case INT: dummybig.I = lo; dummybig.CDR = nil; work=mulbig(work,&dummybig); goto code1; case SDOT: work=mulbig(work,result->val); /* previous result is no longer needed */ pruneb(result->val); code1: restype = TYPE(work); /* SDOT or INT */ if(restype==INT) { lo = work->i; prunei(work); } else { prunep = FALSE; /* sdot is cannonical */ result->val = work; } break; case DOUB: result->val->r *= Ifloat(work); break; default: goto urk; } break; case DOUB: switch(restype) { case SDOT: if(prunep) { lispval handy; dummybig.I = 0; dummybig.CDR = (lispval) 0; handy = adbig(&dummybig,result->val); pruneb(result->val); result->val = handy; } flacc = Ifloat(result->val) * work->r; pruneb(result->val); scrimp: (result->val = newdoub())->r = flacc; restype = DOUB; break; case INT: flacc = work->r * lo; goto scrimp; case DOUB: result->val->r *= work->r; break; default: goto urk; } break; default: errorh(Vermisc,"Non-number to add",nil,0,FALSE,work); } } work = result->val; switch(restype){ case DOUB: return(work); case INT: return(inewint(lo)); case SDOT: if(prunep==FALSE) return(work); else { /* wouldn't (copy result->val) be faster ? -dhl */ /* It might, but isn't guaranteed to canonicalize */ dummybig.I = 0; dummybig.CDR = (lispval) 0; return(adbig(&dummybig,work)); } urk: error("Internal error in times",FALSE); } } lispval Lquo() { register lispval work; register ap result, mynp, oldnp, lbot, np; int restype; lispval quotient; double flacc; struc((t sdot dummybig; oldnp = result = np; protect(nil); mynp = lbot + 1; restype = INT; dummybig.I = 1; dummybig.CDR = (lispval) 0; if(oldnp==mynp) mynp = lbot; else { /* examine the first argument and perhaps set restype to the * correct type. If restype (result type) is INT, then the * fixnum value is stored in lo. Otherwise, if restype is * SDOT or DOUB, then the value is stored in result->val. */ work = lbot->val; switch(TYPE(work)) { case INT: dummybig.I = work->i; break; case SDOT: /* we want to copy the sdot we are given as an argument since * the bignum divide routine divbig expects an argument in * canonical form. */ dummybig.I = 0; /* create a zero sdot */ work = adbig(work,&dummybig); restype = TYPE(work); if(restype==INT) { /* Either INT or SDOT */ dummybig.I=work->i; /* has turned into an fixnum */ prunei(work); /* return fixnum cell */ } else { result->val = work; } break; case DOUB: (result->val = newdoub())->r = work->r; restype = DOUB; break; default: errorh(Vermisc,"Internal quotient error #1: ",nil,FALSE,0, work); goto urk; } } /* now loop through the rest of the arguments dividing them * into the running result in result or dummybig.I */ for(; mynp < oldnp; mynp++) { work = mynp->val; switch(TYPE(work)) { case INT: if (work->i==0) kill(getpid(),8); switch(restype) { case SDOT: /* there is no fast routine to destructively divide a bignum by an int, so do it the hard way. */ dummybig.I = work->i; divbig(result->val,&dummybig,"ient,0); pruneb(result->val); on1: /* check if the result has turned into a fixnum */ restype = TYPE(quotient); if(restype==INT) { /* Either INT or SDOT */ dummybig.I=quotient->i; /* has turned into an fixnum */ prunei(quotient); /* return fixnum cell */ } else result->val = quotient; break; case INT: /* divide int by int */ dummybig.I /= work->i; break; case DOUB: result->val->r /= work->i; break; default: errorh(Vermisc,"Internal quotient error #2: ",nil,FALSE,0, result->val); goto urk; } break; case SDOT: switch(restype) { case INT: /* Although it seems that dividing an int * by a bignum can only lead to zero, it is * concievable that the bignum is improperly boxed, * i.e. actually an int. */ divbig((lispval)&dummybig,work,"ient,0); goto on1; case SDOT: /* dividing one bignum by another. */ divbig(result->val,work,"ient,0); pruneb(result->val); goto on1; case DOUB: /* dividing a bignum into a flonum. */ result->val->r /= Ifloat(work); break; default: errorh(Vermisc,"Internal quotient error #3: ",nil,FALSE,0, result->val); goto urk; } break; case DOUB: switch(restype) { case SDOT: /* Divide bignum by flonum converting to flonum * May die due to overflow */ flacc = Ifloat(result->val) / work->r; pruneb(result->val); scrimp: (result->val = newdoub())->r = flacc; restype = DOUB; break; case INT: /* dividing a flonum into a fixnum. * The result will be a flonum. */ flacc = ((double) dummybig.I) / work->r; goto scrimp; case DOUB: /* dividing a flonum into a flonum, what * could be easier? */ result->val->r /= work->r; break; default: errorh(Vermisc,"Internal quotient error #4: ",nil, FALSE,0, result->val); goto urk; } break; default: errorh(Vermisc,"Non-number to quotient ",nil,FALSE,0,work); } } out: work = result->val; switch(restype){ case SDOT: case DOUB: return(work); case INT: return(inewint(dummybig.I)); default: urk: errorh(Vermisc,"Internal quotient error #5: ",nil,FALSE,0, work); } } lispval Lfp() { register temp = 0, x, y; register struct argent *argp; for(argp = lbot; argp < np; argp++) temp += argp->val->i; return(inewint(temp)); } lispval Lfm() { register temp, x, y; register struct argent *argp; if(lbot==np)return(inewint(0)); temp = lbot->val->i; if(lbot+1==np) return(inewint(-temp)); for(argp = lbot+1; argp < np; argp++) temp -= argp->val->i; return(inewint(temp)); } lispval Lft() { register temp = 1, x, y; register struct argent *argp; for(argp = lbot; argp < np; argp++) temp *= argp->val->i; return(inewint(temp)); } lispval Lfd() { register temp = 0, x, y; register struct argent *argp; if(lbot==np)return(inewint(1)); temp = lbot->val->i; if(lbot+1==np) return(inewint(1/temp)); for(argp = lbot+1; argp < np; argp++) temp /= argp->val->i; return(inewint(temp)); } for(argp = lbot+1; argp < np; argp++) temp -= argp->val->i; return(inewint(temp)); } lispval Lft() { register temp = 1, x, y; register struct argent *argp; for(argp = lbot; argp < np; argp++) temp *= argp->val->i; return(inewint(temp)); } lispvacmd/lisp/franz/lam5.c 644 0 12 26344 2552701441 7715 static char *sccsid = "@(#)lam5.c 35.5 7/8/81"; #include "global.h" #include "chkrtab.h" /*=========================================== - - explode functions: aexplode , aexplodec, aexploden - The following function partially implement the explode functions for atoms. - The full explode functions are written in lisp and call these for atom args. - -===========================================*/ #include "chars.h" lispval Lexpldx(kind,slashify) int kind, slashify; /* kind = 0 => explode to characters = 1 => explode to fixnums (aexploden) slashify = 0 => do not quote bizarre characters = 1 => quote bizarre characters */ { int typ, i; char ch, *strb, strbb[BUFSIZ]; /* temporary string buffer */ register lispval last, handy; register char *cp; char Idqc = Xdqc; Savestack(3); /* kludge register save mask */ chkarg(1,"expldx"); handy = Vreadtable->a.clb; chkrtab(handy); handy = lbot->val; *strbuf = 0; typ=TYPE(handy); /* we only work for a few types */ /* put the characters to return in the string buffer strb */ switch(typ) { case STRNG: if(slashify && !Xsdc) errorh(Vermisc,"Can't explode without string delimiter",nil ,FALSE,0,handy); strb = strbb; if(slashify) *strb++ = Xsdc; /* copy string into buffer, escape only occurances of the double quoting character if in slashify mode */ for(cp = (char *) handy; *cp; cp++) { if(slashify && (*cp == Xsdc || ctable[*cp]==VESC)) *strb++ = Xesc; *strb++ = *cp; } if(slashify) *strb++ = Xsdc; *strb = NULL_CHAR ; strb = strbb; break; case ATOM: strb = handy->a.pname; if(slashify && (strb[0]==0)) { strb = strbb; strbb[0] = Xdqc; strbb[1] = Xdqc; strbb[2] = 0; } else common: if(slashify != 0) { char *out = strbb; cp = strb; strb = strbb; if(ctable[(*cp)&0177]==VNUM) *out++ = Xesc; for(; *cp; cp++) { if(ctable[*cp]& QUTMASK) *out++ = Xesc; *out++ = *cp; } *out = 0; } break; case INT: strb = strbb; sprintf(strb, "%d", lbot->val->i); break; case DOUB: strb = strbb; lfltpr(strb, lbot->val->r); break; case SDOT: { struct _iobuf _strbuf; int count; for((handy = lbot->val), count = 12; handy->s.CDR!=(lispval) 0; (handy = handy->s.CDR), count += 12); strb = (char *) alloca(count); _strbuf._flag = _IOWRT+_IOSTRG; _strbuf._ptr = strb; _strbuf._cnt = count; pbignum(lbot->val,&_strbuf); putc(0,&_strbuf); break; } default: errorh(Vermisc,"EXPLODE ARG MUST BE STRING, SYMBOL, FIXNUM, OR FLONUM",nil,FALSE,0,handy); Restorestack(); return(nil); } if( strb[0] != NULL_CHAR ) /* if there is something to do */ { lispval prev; protect(handy = last = newdot()); strbuf[1] = NULL_CHAR ; /* set up for getatom */ atmlen = 2; for(i=0; ch = strb[i++]; ) { switch(kind) { case 0: strbuf[0] = hash = ch; /* character explode */ last->d.car = (lispval) getatom(); /* look in oblist */ break; case 1: last->d.car = inewint(ch); break; } /* advance pointers */ prev = last; last->d.cdr = newdot(); last = last->d.cdr; } /* end list with a nil pointer */ prev->d.cdr = nil; Restorestack(); return(handy); } Restorestack(); return(nil); /* return nil if no characters */ } /*=========================== - - (aexplodec 'atm) returns (a t m) - (aexplodec 234) returns (\2 \3 \4) -===========================*/ lispval Lexpldc() { return(Lexpldx(0,0)); } /*=========================== - - (aexploden 'abc) returns (65 66 67) - (aexploden 123) returns (49 50 51) -=============================*/ lispval Lexpldn() { return(Lexpldx(1,0)); } /*=========================== - - (aexplode "123") returns (\\ \1 \2 \3); - (aexplode 123) returns (\1 \2 \3); -=============================*/ lispval Lexplda() { return(Lexpldx(0,1)); } /* * (argv) returns how many arguments where on the command line which invoked * lisp; (argv i) returns the i'th argument made into an atom; */ lispval Largv() { register lispval handy; register index; register char *base; char c; extern int Xargc; extern char **Xargv; if(lbot-np==0)handy = nil; else handy = lbot->val; if(TYPE(handy)==INT && handy->i>=0 && handy->ii]); return(getatom()); } else { return(inewint(Xargc)); } } /* * (chdir ) executes a chdir command * if successful, return t otherwise returns nil */ lispval Lchdir(){ register char *filenm; chkarg(1,"chdir"); filenm = (char *) veri((fy(lbot->val,"chdir - non symbol or string arg"); if(chdir(filenm)>=0) return(tatom); else return(nil); } /* ========================================================== - - ascii - convert from number to ascii character - - form:(ascii number) - - the number is checked so that it is in the range 0-255 - then it is made a character and returned - =========================================================*/ lispval Lascii() { register lispval handy; handy = lbot->val; /* get argument */ if(TYPE(handy) != INT) /* insure that it is an integer */ { error("argument not an integer",FALSE); return(nil); } if(handy->i < 0 || handy->i > 0377) /* insure that it is in range*/ { error("argument is out of ascii range",FALSE); return(nil); } strbuf[0] = handy->i ; /* ok value, make into a char */ strbuf[1] = NULL_CHAR; /* lookup and possibly intern the atom given in strbuf */ return( (lispval) getatom() ); } /* * boole - maclisp bitwise boolean function * (boole k x y) where k determines which of 16 possible bitwise * truth tables may be applied. Common values are 1 (and) 6 (xor) 7 (or) * the result is mapped over each pair of bits on input */ lispval Lboole(){ register x, y; register lispval result; register struct argent *mynp; int k; if(np - lbot < 3) error("Boole demands at least 3 args",FALSE); mynp = lbot+AD; k = mynp->val->i & 15; x = (mynp+1)->val->i; for(mynp += 2; mynp < np; mynp++) { y = mynp->val->i; switch(k) { case 0: x = 0; break; case 1: x = x & y; break; case 2: x = y & ~x; break; case 3: x = y; break; case 4: x = x & ~y; break; /* case 5: x = x; break; */ case 6: x = x ^ y; break; case 7: x = x | y; break; case 8: x = ~(x | y); break; case 9: x = ~(x ^ y); break; case 10: x = ~x; break; case 11: x = ~x | y; break; case 12: x = ~y; break; case 13: x = x | ~y; break; case 14: x = ~x | ~y; break; case 15: x = -1; } } return(inewint(x)); } lispval Lfact() { register lispval result, handy; register itemp; Savestack(3); /* fixup entry mask */ result = lbot->val; if(TYPE(result)!=INT) error("Factorial of Non-fixnum. If you want me\ to calculate fact of > 2^30 We will be here till doomsday!.",FALSE); itemp = result->i; protect(result = newsdot()); result->s.CDR=(lispval)0; result->i = 1; for(; itemp > 1; itemp--) dmlad(result,itemp,0); if(result->s.CDR) { Restorestack(); return(result); } handy = inewint(result->s.I); pruneb(result); Restorestack(); return(handy); } /* * fix -- maclisp floating to fixnum conversion * for the moment, mereley convert floats to ints. * eventual convert to bignum if too big to fit. */ lispval Lfix() { register lispval result, handy; double floor(); chkarg(1,"fix"); handy = lbot->val; switch(TYPE(handy)) { default: error("innaproriate arg to fix.",FALSE); case INT: case SDOT: return(handy); case DOUB: return(inewint((int)floor(handy->r))); } } /* * (frexp ) * returns a dotted pair (. ) * such that bignum is 56 bits long, and if you think of the binary * point occuring after the high order bit, = 2^ * * * myfrexp is an assembly language routine found in bigmath.s to do exactly * what is necessary to accomplish this. * this routine is horribly vax specific. * * Lfix should probably be rewritten to take advantage of myfrexp */ lispval Lfrexp() { register lispval handy, result; int exp, hi, lo; Savestack(2); chkarg(1,"frexp"); myfrexp(lbot->val->r, &exp, &hi, &lo); if(lo < 0) { /* normalize for bignum */ lo &= ~ 0xC0000000; hi += 1; } result = handy = newdot(); protect(handy); handy->d.car = inewint(exp); if(hi==0&&lo==0) { handy->d.cdr = inewint(0); } else { handy = handy->d.cdr = newsdot(); handy->s.I = lo; handy = handy->s.CDR = newdot(); handy->s.I = hi; } np--; Restorestack(); return(result); } #define SIGFPE 8 #define B 1073741824.0 static double table[] = { 1.0, B, B*B, B*B*B, B*B*B*B, 0.0}; lispval Lfloat() { register lispval handy,result; register double sum = 0; register int count; chkarg(1,"float"); handy = lbot->val; switch(TYPE(handy)) { case DOUB: return(handy); case INT: result = newdoub(); result->r = (double) handy->i; return(result); case SDOT: { for(handy = lbot->val, count = 0; count < 5; count++, handy = handy->s.CDR) { sum += handy->s.I * table[count]; if(handy->s.CDR==(lispval)0) goto done; } kill(getpid(),SIGFPE); done: result = newdoub(); result->r = sum; return(result); } default: errorh(Vermisc,"Bad argument to float",nil,FALSE,0,handy); } } double Ifloat(handy) register lispval handy; { register double sum = 0.0; register int count=0; for(; count < 5; count++, handy = handy->s.CDR) { sum += handy->s.I * table[count]; if(handy->s.CDR==(lispval)0) goto done; } kill(getpid(),SIGFPE); done: return(sum); } /* Lbreak ***************************************************************/ /* If first argument is not nil, this is evaluated and printed. Then */ /* error is called with the "breaking" message. */ lispval Lbreak() { register lispval hold; if (np > lbot) { printr(lbot->val,poport); dmpport(poport); } return(error("",TRUE)); } lispval LDivide() { register lispval result, work, temp; register struct argent *mynp; lispval quo, rem, arg1, arg2; struct sdot dummy, dum2; Savestack(4); chkarg(2,"Divide"); mynp = lbot; work = mynp++->val; switch(TYPE(work)) { case INT: arg1 = (lispval) &dummy; dummy.I = work->i; dummy.CDR = (lispval) 0; break; case SDOT: arg1 = work; break; urk: default: error("First arg to divide neither a bignum nor int.",FALSE); } work = mynp->val; switch(TYPE(work)) { case INT: arg2 = (lispval) &dum2; dum2.I = work->i; dum2.CDR = (lispval) 0; break; case SDOT: arg2 = work; break; default: goto urk; } divbig(arg1,arg2, &quo, &rem); protect(quo); if(rem==((lispval)&dummy)) rem = inewint(dummy.I); protect(rem); protect(result = work = newdot()); work->d.car = quo; (work->d.cdr = newdot())->d.car = rem; Restorestack(); return(result); } lispval LEmuldiv(){ register struct argent * mynp = lbot+AD; register lispval work, result; int quo, rem; Savestack(3); /* fix register mask */ /* (Emuldiv mul1 mult2 add quo) => temp = mul1 + mul2 + sext(add); result = (list temp/quo temp%quo); to mix C and lisp a bit */ Imuldiv(mynp[0].val->i, mynp[1].val->i, mynp[2].val->i, mynp[3].val->i, &quo, &rem); protect(result=newdot()); (result->d.car=inewint(quo)); work = result->d.cdr = newdot(); (work->d.car=inewint(rem)); Restorestack(); return(result); } static Imuldiv() { asm(" emul 4(ap),8(ap),12(ap),r0"); asm(" ediv 16(ap),r0,*20(ap),*24(ap)"); } (3); /* fix register mask */ /* (Emuldiv mul1 mult2 add quo) => temp = mul1 + mul2 + sext(add); result = (list temp/quo temp%quo); to mix C and lisp a bit */ Imuldiv(mynp[0].val->i, mynp[1].val->i, mynp[2].val->i, mynp[3].val->i, &quo, &rem); protect(result=newdot()); cmd/lisp/franz/lam6.c 644 0 12 22247 2552701441 7714 static char *sccsid = "@(#)lam6.c 35.3 7/8/81"; #include "global.h" #include FILE * mkstFI(base,count,flag) char *base; char flag; { register FILE *p = stderr; /* find free file descriptor */ for(;p->_flag&(_IOREAD|_IOWRT);p++) if(p >= _iob + _NFILE) error("Too many open files to do readlist",FALSE); p->_flag = _IOSTRG | flag; p->_cnt = count; p->_base = base; p->_ptr = base; p->_file = -1; return(p); } lispval Lreadli() { register lispval work, handy; register FILE *p; register char *string; struct argent *olbot; FILE *opiport = piport; lispval Lread(); int count; Savestack(4); if(lbot->val==nil) { /*effectively, return(matom(""));*/ strbuf[0] = 0; return(getatom()); } chkarg(1,"readlist"); count = 1; /* compute length of list */ for(work = lbot->val; TYPE(work)==DTPR; work=work->d.cdr) count++; string = (char *) alloca(count); p = mkstFI(string, count - 1, _IOREAD); for(work = lbot->val; TYPE(work)==DTPR; work=work->d.cdr) { handy = work->d.car; switch(TYPE(handy)) { case SDOT: case INT: *string++=handy->i; break; case ATOM: *string++ = *(handy->a.pname); break; case STRNG: *string++ = *(char *)handy; break; default: error("Non atom or int to readlist",FALSE); } } *string = 0; olbot = lbot; lbot = np; protect(P(p)); work = Lread(); lbot = olbot; frstFI(p); Restorestack(); return(work); } frstFI(p) register FILE *p; { p->_flag=0; p->_base=0; p->_cnt = 0; p->_ptr = 0; p->_file = 0; } lispval Lgetenv() { chkarg(1,"getenv"); if((TYPE(lbot->val))!=ATOM) error("argument to getenv must be atom",FALSE); strcpy(strbuf,getenv(lbot->val->a.pname)); return(getatom()); } lispval Lboundp() { register lispval result, handy; chkarg(1,"boundp"); if((TYPE(lbot->val))!=ATOM) error("argument to boundp must be symbol",FALSE); if( (handy = lbot->val)->a.clb==CNIL) result = nil; else (result = newdot())->d.cdr = handy->a.clb; return(result); } lispval Lplist() { register lispval atm; /* get property list of an atom or disembodied property list */ chkarg(1,"plist"); atm = lbot->val; switch(TYPE(atm)) { case ATOM: case DTPR: break; default: error("Only Atoms and disembodied property lists allowed for plist",FALSE); } if(atm==nil) return(nilplist); return(atm->a.plist); } lispval Lsetpli() { /* set the property list of the given atom to the given list */ register lispval atm, vall; register lispval dum1, dum2; chkarg(2,"setplist"); atm = lbot->val; if (TYPE(atm) != ATOM) error("s((etplist: First argument must be an symbol",FALSE); vall = (np-1)->val; if (TYPE(vall)!= DTPR && vall !=nil) error("setplist: Second argument must be a list",FALSE); if (atm==nil) nilplist = vall; else atm->a.plist = vall; return(vall); } lispval Lsignal() { register lispval handy, old, routine; int i; switch(np-lbot) { case 1: routine = nil; /* second arg defaults to nil */ break; case 2: routine = lbot[1].val; break; /* both args given */ default: argerr("signal"); } handy = lbot->val; if(TYPE(handy)!=INT) error("First arg to signal must be an int",FALSE); i = handy->i & 15; if(TYPE(routine)!=ATOM) error("Second arg to signal must be an atom",FALSE); old = sigacts[i]; if(old==0) old = nil; if(routine==nil) sigacts[i]=((lispval) 0); else sigacts[i]=routine; return(old); } lispval Lassq() { register lispval work, handy; chkarg(2,"assq"); for(work = lbot[1].val, handy = lbot[0].val; (work->d.car->d.car != handy) && (work != nil); work = work->d.cdr); return(work->d.car); } lispval Lkilcopy() { if(fork()==0) { asm(".byte 0"); } } lispval Larg() { register lispval handy; register offset, count; handy = lexpr_atom->a.clb; if(handy==CNIL || TYPE(handy)!=DTPR) error("Arg: not in context of Lexpr.",FALSE); count = ((long *)handy->d.cdr) -1 - (long *)handy->d.car; if(np==lbot || lbot->val==nil) return(inewint(count+1)); if(TYPE(lbot->val)!=INT || (offset = lbot->val->i - 1) > count || offset < 0 ) error("Out of bounds: arg to \"Arg\"",FALSE); return( ((struct argent *)handy->d.car)[offset].val); } lispval Lsetarg() { register lispval handy, work; register limit, index; chkarg(2,"setarg"); handy = lexpr_atom->a.clb; if(handy==CNIL || TYPE(handy)!=DTPR) error("Arg: not in context of Lexpr.",FALSE); limit = ((long *)handy->d.cdr) - 1 - (long *)(work = handy->d.car); handy = lbot->val; if(TYPE(handy)!=INT) error("setarg: first argument not integer",FALSE); if((index = handy->i - 1) < 0 || index > limit) error("setarg: index out of range"); return(((struct argent *) work)[index].val = lbot[1].val); } lispval Lptime(){ extern int GCtime; int lgctime = GCtime; static struct tbuf { long mytime; long allelse[3]; } current; register lispval result, handy; Savestack(2); times(¤t); result = newdot(); handy = result; protect(result); result->d.cdr = newdot(); result->d.car = inewint(current.mytime); handy = result->d.cdr; handy->d.car = inewint(lgctime); handy->d.cdr = nil; if(GCtime==0) GCtime = 1; Restorestack(); return(result); } /* (err [value] [flag]) where if value is present, it is the value to throw to the errset. flag if present must evaluate to nil, as we always evaluate value before unwinding stack */ lispval Lerr() { register lispval handy; lispval errorh(); char *mesg = "call to err"; /* default message */ Savestack(1); if(np==lbot) protect(nil); if ((np >= lbot + 2) && ((lbot+1)->val != nil)) error("Second arg to err must be nil",FALSE); if ((lbot->val != nil) && (TYPE(lbot->val) == ATOM)) mesg = lbot->val->a.pname; /* new message if atom */ return(errorh(Vererr,mesg,lbot->val,nil)); } lispval Ltyi() { register FILE *port; register lispval handy; char val; switch(np-lbot) { case 0: handy = nil; /* default port */ break; case 1: handy = lbot->val; break; default: argerr("tyi"); } port = okport(handy,okport(Vpiport->a.clb,stdin)); fflush(stdout); /* flush any pending output characters */ val = getc(port); if(val==EOF) { clearerr(port); if(sigintcnt > 0) sigcall(SIGINT); /* eof might mean int */ } return(inewint(val)); } lispval Ltyipeek() { register FILE *port; register lispval handy; char val; switch(np-lbot) { case 0: handy = nil; /* default port */ break; case 1: handy = lbot->val; break; default: argerr("tyipeek"); } port = okport(handy,okport(Vpiport->a.clb,stdin)); fflush(stdout); /* flush any pending output characters */ val = getc(port); if(val==EOF) clearerr(port); ungetc(val,port); return(inewint(val)); } lispval Ltyo() { register FILE *port; register lispval handy, where; char val; switch(np-lbot) { case 1: where = nil; /* default port */ break; case 2: where = lbot[1].val; break; default: argerr("tyo"); } handy = lbot->val; if(TYPE(handy)!=INT) error("Tyo demands number for 1st arg",FALSE); val = handy->i; port = (FILE *) okport(where,okport(Vpoport->a.clb,stdout)); putc(val,port); return(handy); } #include "chkrtab.h" #include "chars.h" lispval Imkrtab(current) { extern struct rtab { unsigned char ctable[132]; } initread; register lispval handy; extern lispval lastrtab; static int cycle = 0; static char *nextfree; if((cycle++)%3==0) { nextfree = (char *) csegment(str_name,512,FALSE); } handy = newarray(); handy->ar.data = nextfree; if(current == 0) *(struct rtab *)nextfree = initread; else { register index = 0; register char *cp = nextfree; unsigned char code; lispval c; *(struct rtab *)cp = *(struct rtab *)ctable; for(; index < 128; index++) { code = cp[index]; if(code==VSPL || code==VMAC) { strbuf[0] = index; strbuf[1] = 0; c = (getatom()); Iputprop(c,Iget(c,lastrtab),handy); } } } handy->ar.delta = inewint(4); handy->ar.length = inewint(sizeof(struct rtab)/sizeof(int)); handy->ar.accfun = handy->ar.aux = nil; nextfree += sizeof(struct rtab); return(handy); } /* makereadtable - arg : t or nil returns a readtable, t means return a copy of the initial readtable nil means return a copy of the current readtable */ lispval Lmakertbl() { lispval handy = Vreadtable->a.clb; chkrtab(handy); if(lbot==np) error("makereadtable: wrong number of args",FALSE); if(TYPE(lbot->val) != ATOM) error("makereadtable: arg must be atom",FALSE); if(lbot->val == nil) return(Imkrtab(1)); else return(Imkrtab(0)); } lispval Lcpy1() { register lispval handy = lbot->val, result = handy; top: switch(TYPE(handy)) { case INT: result = inewint(handy->i); break; case VALUE: (result = newval())->l = handy->l; break; case DOUB: (result = newdoub())->r = handy->r; break; default: lbot->val = errorh(Vermisc,"Bad arg to cpy1",nil,TRUE,67,handy); goto top; } return(result); } /* copyint* . This returns a copy of its integer argument. The copy will * be a fresh integer cell, and will not point into the read only * small integer table. */ lispval Lcopyint() { register lispval handy = lbot->val; register lispval ret; while (TYPE(handy) != INT) { handy=errorh(Vermisc,"copyint* : non integer arg",nil,TRUE,0,handy);} (ret = newint())->i = handy->i; return(ret); } lbot->val = errorh(Vermisc,"Bad arg to cpy1",nil,TRUE,67,handy); goto top; } return(result); } /* copyint* . This returns a copy of its integer argument. The copy will * be a fresh integer cell, and will not point into the read only * small integer table. */ lispval Lcopyint() { register lispval handy = lbot->val; register lcmd/lisp/franz/lam7.c 644 2 33 16340 2552701442 7720 static char *sccsid = "@(#)lam7.c 35.4 7/8/81"; #include "global.h" lispval Lfork() { register lispval temp; int pid; chkarg(0,"fork"); if ((pid=fork())) { return(inewint(pid)); } else return(nil); } lispval Lwait() { register lispval ret, temp; int status = -1, pid; Savestack(2); chkarg(0,"wait"); pid = wait(&status); ret = newdot(); protect(ret); temp = inewint(pid); ret->d.car = temp; temp = inewint(status); ret->d.cdr = temp; Restorestack(); return(ret); } lispval Lpipe() { register lispval ret, temp; int pipes[2]; Savestack(2); chkarg(0,"pipe"); pipes[0] = -1; pipes[1] = -1; pipe(pipes); ret = newdot(); protect(ret); temp = inewint(pipes[0]); ret->d.car = temp; temp = inewint(pipes[1]); ret->d.cdr = temp; Restorestack(); return(ret); } lispval Lfdopen() { register lispval fd, type; FILE *ptr; chkarg(2,"fdopen"); type = (np-1)->val; fd = lbot->val; if( TYPE(fd)!=INT ) return(nil); if ( (ptr=fdopen((int)fd->i, (char *)type->a.pname))==NULL) return(nil); return(P(ptr)); } lispval Lexece() { lispval fname, arglist, envlist, temp; char *args[100], *envs[100], estrs[1024]; char *p, *cp, **sp; fname = nil; arglist = nil; envlist = nil; switch(np-lbot) { case 3: envlist = lbot[2].val; case 2: arglist = lbot[1].val; case 1: fname = lbot[0].val; case 0: break; default: argerr("exece"); } while (TYPE(fname)!=ATOM) fname = error("exece: non atom function name",TRUE); while (TYPE(arglist)!=DTPR && arglist!=nil) arglist = error("exece: non list arglist",TRUE); for (sp=args; arglist!=nil; arglist=arglist->d.cdr) { temp = arglist->d.car; if (TYPE(temp)!=ATOM) error("exece: non atom argument seen",FALSE); *sp++ = temp->a.pname; } *sp = 0; if (TYPE(envlist)!=DTPR && envlist!=nil) return(nil); for (sp=envs,cp=estrs; envlist!=nil; envlist=envlist->d.cdr) { temp = envlist->d.car; if (TYPE(temp)!=DTPR || TYPE(temp->d.car)!=ATOM || TYPE(temp->d.cdr)!=ATOM) error("exece: Bad enviroment list",FALSE); *sp++ = cp; for (p=temp->d.car->a.pname; (*cp++ = *p++);) ; *(cp-1) = '='; for (p=temp->d.cdr->a.pname; (*cp++ = *p++);) ; } *sp = 0; return(inewint(execve(fname->a.pname, args, envs))); } int gensymcounter = 0; /* should really be in data.c */ lispval Lgensym() { lispval arg; char leader; switch(np-lbot) { case 0: arg = nil; break; case 1: arg = lbot->val; break; default: argerr("gensym"); } leader = 'g'; if (arg != nil && TYPE(arg)==ATOM) leader = arg->a.pname[0]; ((sprintf(strbuf, "%c%05d", leader, gensymcounter++); atmlen = 7; return((lispval)newatom()); } extern struct types { char *next_free; int space_left, space, type, type_len; /* note type_len is in units of int */ lispval *items, *pages, *type_name; struct heads *first; } atom_str ; lispval Lremprop() { register struct argent *argp; register lispval pptr, ind, opptr; lispval atm; int disemp = FALSE; chkarg(2,"remprop"); argp = lbot; ind = argp[1].val; atm = argp->val; switch (TYPE(atm)) { case DTPR: pptr = atm->d.cdr; disemp = TRUE; break; case ATOM: if((lispval)atm==nil) pptr = nilplist; else pptr = atm->a.plist; break; default: errorh(Vermisc, "remprop: Illegal first argument :", nil, FALSE, 0, atm); } opptr = nil; if (pptr==nil) return(nil); while(TRUE) { if (TYPE(pptr->d.cdr)!=DTPR) errorh(Vermisc, "remprop: Bad property list", nil, FALSE, 0,atm); if (pptr->d.car == ind) { if( opptr != nil) opptr->d.cdr = pptr->d.cdr->d.cdr; else if(disemp) atm->d.cdr = pptr->d.cdr->d.cdr; else if(atm==nil) nilplist = pptr->d.cdr->d.cdr; else atm->a.plist = pptr->d.cdr->d.cdr; return(pptr->d.cdr); } if ((pptr->d.cdr)->d.cdr == nil) return(nil); opptr = pptr->d.cdr; pptr = (pptr->d.cdr)->d.cdr; } } lispval Lbcdad() { lispval ret, temp; chkarg(1,"bcdad"); temp = lbot->val; if (TYPE(temp)!=ATOM) error("ONLY ATOMS HAVE FUNCTION BINDINGS", FALSE); temp = temp->a.fnbnd; if (TYPE(temp)!=BCD) return(nil); ret = newint(); ret->i = (int)temp; return(ret); } lispval Lstringp() { chkarg(1,"stringp"); if (TYPE(lbot->val)==STRNG) return(tatom); return(nil); } lispval Lsymbolp() { chkarg(1,"symbolp"); if (TYPE(lbot->val)==ATOM) return(tatom); return(nil); } lispval Lrematom() { register lispval temp; chkarg(1,"rematom"); temp = lbot->val; if (TYPE(temp)!=ATOM) return(nil); temp->a.fnbnd = nil; temp->a.pname = (char *)CNIL; temp->a.plist = nil; (atom_items->i)--; (atom_str.space_left)++; temp->a.clb=(lispval)atom_str.next_free; atom_str.next_free=(char *) temp; return(tatom); } #define QUTMASK 0200 #define VNUM 0000 lispval Lprname() { lispval a, ret; register lispval work, prev; char *front, *temp; int clean; char ctemp[100]; extern unsigned char *ctable; Savestack(2); chkarg(1,"prname"); a = lbot->val; switch (TYPE(a)) { case INT: sprintf(ctemp,"%d",a->i); break; case DOUB: sprintf(ctemp,"%f",a->r); break; case ATOM: temp = front = a->a.pname; clean = *temp; if (*temp == '-') temp++; clean = clean && (ctable[*temp] != VNUM); while (clean && *temp) clean = (!(ctable[*temp++] & QUTMASK)); if (clean) strcpyn(ctemp, front, 99); else sprintf(ctemp,"\"%s\"",front); break; default: error("prname does not support this type", FALSE); } temp = ctemp; protect(ret = prev = newdot()); while (*temp) { prev->d.cdr = work = newdot(); strbuf[0] = *temp++; strbuf[1] = 0; work->d.car = getatom(); work->d.cdr = nil; prev = work; } Restorestack(); return(ret->d.cdr); } Lexit() { register lispval handy; if(np-lbot==0) franzexit(0); handy = lbot->val; if(TYPE(handy)==INT) franzexit(handy->i); franzexit(-1); } lispval Iimplode(unintern) { register lispval handy, work; register char *cp = strbuf; extern int atmlen; /* used by newatom and getatom */ chkarg(1,"implode"); for(handy = lbot->val; handy!=nil; handy = handy->d.cdr) { work = handy->d.car; if(cp >= endstrb) errorh(Vermisc,"maknam/impode argument exceeds buffer",nil,FALSE,43,lbot->val); again: switch(TYPE(work)) { case ATOM: *cp++ = work->a.pname[0]; break; case SDOT: case INT: *cp++ = work->i; break; case STRNG: *cp++ = * (char *) work; break; default: work = errorh(Vermisc,"implode/maknam: Illegal type for this arg:",nil,FALSE,44,work); goto again; } } *cp = 0; if(unintern) return((lispval)newatom()); else return((lispval) getatom()); } lispval Lmaknam() { return(Iimplode(TRUE)); /* unintern result */ } lispval Limplode() { return(Iimplode(FALSE)); /* intern result */ } lispval Lintern() { register int hash; register lispval handy,atpr; register char *name; chkarg(1,"intern"); if(TYPE(handy=lbot->val) != ATOM) errorh(Vermisc,"non atom to intern ",nil,FALSE,0,handy); /* compute hash of pname of arg */ hash = hashfcn(handy->a.pname); /* search for atom with same pname on hash list */ atpr = (lispval) hasht[hash]; for(atpr = (lispval) hasht[hash] ; atpr != CNIL ; atpr = (lispval)atpr->a.hshlnk) { if(strcmp(atpr->a.pname,handy->a.pname) == 0) return(atpr); } /* not there yet, put the given one on */ handy->a.hshlnk = hasht[hash]; hasht[hash] = (struct atom *)handy; return(handy); } ATOM) errorh(Vermisc,"non atom to intern ",nil,FALSE,0,handy); /* compute hash of pname of arg */ hash = hashfcn(handy->a.pname); /* search for atom with same pname on hash list */ atpr = (lispval) hasht[hash]; for(atpr = (lispval) hasht[hash] ; atpr != CNIL ; atpr = (lcmd/lisp/franz/lam8.c 644 0 12 53217 2552701443 7721 static char *sccsid = "@(#)lam8.c 35.7 7/8/81"; #include "global.h" #include #include #include "naout.h" #include "frame.h" /* various functions from the c math library */ double sin(),cos(),asin(),acos(),atan2(),sqrt(), log(), exp(); extern int current; lispval Imath(func) double (*func)(); { register lispval handy; register double res; chkarg(1,"Math functions"); switch(TYPE(handy=lbot->val)) { case INT: res = func((double)handy->i); break; case DOUB: res = func(handy->r); break; default: error("Non fixnum or flonum to math function",FALSE); } handy = newdoub(); handy->r = res; return(handy); } lispval Lsin() { return(Imath(sin)); } lispval Lcos() { return(Imath(cos)); } lispval Lasin() { return(Imath(asin)); } lispval Lacos() { return(Imath(acos)); } lispval Lsqrt() { return(Imath(sqrt)); } lispval Lexp() { return(Imath(exp)); } lispval Llog() { return(Imath(log)); } /* although we call this atan, it is really atan2 to the c-world, that is, it takes two args */ lispval Latan() { register lispval arg; register double arg1v; register double res; chkarg(2,"arctan"); switch(TYPE(arg=lbot->val)) { case INT: arg1v = (double) arg->i; break; case DOUB: arg1v = arg->r; break; default: error("Non fixnum or flonum arg to atan2",FALSE); } switch(TYPE(arg = (lbot+1)->val)) { case INT: res = atan2(arg1v,(double) arg->i); break; case DOUB: res = atan2(arg1v, arg->r); break; default: error("Non fixnum or flonum to atan2",FALSE); } arg = newdoub(); arg->r = res; return(arg); } /* (random) returns a fixnum in the range -2**30 to 2**30 -1 (random fixnum) returns a fixnum in the range 0 to fixnum-1 */ lispval Lrandom() { register int curval; float pow(); curval = rand(); /* get numb from 0 to 2**31-1 */ if(np==lbot) return(inewint(curval-(int)pow((double)2,(double)30))); if((TYPE(lbot->val) != INT) || (lbot->val->i <= 0)) errorh(Vermisc,"random: non fixnum arg:", nil, FALSE, 0, lbot->val); return(inewint(curval % lbot->val->i )); } lispval Lmakunb() { register lispval work; chkarg(1,"makunbound"); work = lbot->val; if(work==nil || (TYPE(work)!=ATOM)) return(work); work->a.clb = CNIL; return(work); } lispval Lpolyev() { register int count; register double *handy, *base; register struct argent *argp; lispval result; int type; count = 2 * (((int) np) - (int) lbot); if(count == 0) return(inewint(0)); if(count == 8) return(lbot->val); base = handy = (double *) alloca(count); for(argp = lbot; argp < np; argp++) { while((type = TYPE(argp->val))!=DOUB && type!=INT) argp->val = (lispval) errorh(Vermisc,"%%machine-polyev:non-real arg",nil,TRUE,73,lbot,argp->val); if(TYPE(argp->val)==INT) { *handy++ = argp->val->i; } else *handy++ = argp->val->r; } count = count/sizeof(double) - 2; asm("polyd (r9),r11,8(r9)"); asm("movd r0,(r9)"); result = newdoub(); result->r = *base; return(result); } typedef struct doub { unsigned short f1:7,expt:8,sign:1; unsigned short f2,f3p1:14,f3p2:2,f4; } *dp; typedef struct quad2 { unsigned long g4:16,g3p1:14; } *qp2; typedef struct quad1 { unsigned long g3p2:2,g2:16,g1:7,hide:1; } *qp1; static long workbuf[2]; static int exponent; static Idebig() { register lispval work; register dp rdp; register qp1 rqp1; register qp2 rqp2; register struct argent *lbot,np; workbuf[1] = workbuf[0] = 0; work = lbot->val; /* Unfold mantissa */ rqp2 = (qp2) workbuf + 1; rqp1 = (qp1) workbuf; rdp = (dp) work; rqp2->g4 = rdp->f4; rqp2->g3p1 = rdp->f3p1; rqp1->g3p2 = rdp->f3p2; rqp1->g2 = rdp->f2; rqp1->g1 = rdp->f1; rqp1->hide = 1; if(rdp->sign) { workbuf[0] = (- workbuf[0]); if(workbuf[1] = (- workbuf[1]) & 0xC0000000) workbuf[0]--; } /* calcuate exponent and adjustment */ exponent = -129 - 55 + (int) rdp->expt; } lispval Lfdecom() { register lispval result, handy; register dum1,dum2; chkarg(1,"Decompose-float"); while(TYPE(lbot->val)!=DOUB) lbot->val = error("Decompose-float: Non-real argument",TRUE); Idebig(); np++->val = result = handy = newdot(); handy->d.car = inewint(exponent); handy = handy->d.cdr = newdot(); handy = handy->d.car = newsdot(); handy->s.I = workbuf[1]; handy = handy->s.CDR = newsdot(); handy->s.I = workbuf[0]; } lispval Lfseek() { register lispval result, handy; register dum1,dum2; FILE *f; long disk_addr, offset, whence; lispval retp; chkarg(3,"fseek"); /* Make sure there are three arguments*/ f = lbot->val->p; /* Get first argument into f */ if (TYPE(lbot->val(()!=PORT) /* Check type of first */ error("fseek: First argument must be a port.",FALSE); offset = lbot[1].val->i; /* Get second argument */ if (TYPE(lbot[1].val)!=INT) error("fseek: Second argument must be an integer.",FALSE); whence = lbot[2].val->i; /* Get last arg */ if (TYPE(lbot[2].val)!=INT) error("fseek: Third argument must be an integer.",FALSE); if (fseek(f, offset, whence) == -1) error("fseek: Illegal parameters.",FALSE); retp = inewint(ftell(f)); return((lispval) retp); } /* function hashtabstat : return list of number of members in each bucket */ lispval Lhashst() { register lispval handy,cur; register struct atom *pnt; int i,cnt; extern int hashtop; Savestack(3); handy = newdot(); protect(handy); cur = handy; for(i = 0; i < hashtop; i++) { pnt = hasht[i]; for(cnt = 0; pnt != (struct atom *) CNIL ; pnt=pnt->hshlnk , cnt++); cur->d.cdr = newdot(); cur = cur->d.cdr; cur->d.car = inewint(cnt); } cur->d.cdr = nil; Restorestack(); return(handy->d.cdr); } /* Lctcherr this routine should only be called by the unwind protect simulation lisp code It is called after an unwind-protect frame has been entered and evalated and we want to get on with the error or throw We only handle the case where there are 0 to 2 extra arguments to the error call. */ lispval Lctcherr() { register lispval handy; lispval type,messg,valret,contuab,uniqid,datum1,datum2; chkarg(1,"I-throw-err"); if(handy->d.car == tatom) { /* continuing a throw */ Inonlocalgo(C_THROW, handy->d.cdr->d.car, handy->d.cdr->d.cdr->d.car); /* NOT REACHED */ } /* decode the arg list */ handy = handy->d.cdr; type = handy->d.car; handy = handy->d.cdr; messg = handy->d.car; handy = handy->d.cdr; valret = handy->d.car; handy = handy->d.cdr; contuab = handy->d.car; handy = handy->d.cdr; uniqid = handy->d.car; handy = handy->d.cdr; /* if not extra args */ if(handy == nil) { errorh(type,messg->a.pname,valret,contuab->i,uniqid->i); } datum1 = handy->d.car; handy = handy->d.cdr; /* if one extra arg */ if(handy == nil) { errorh(type,messg->a.pname,valret,contuab->i,uniqid->i,datum1); } /* if two or more extra args, just use first 2 */ datum2 = handy->d.car; errorh(type,messg->a.pname,valret,contuab->i,uniqid->i,datum1,datum2); } /* * (*makhunk ') * * Create a hunk of size 2 . must be between 0 and 6. * */ lispval LMakhunk() { register int hsize, hcntr; register lispval result; chkarg(1,"Makehunk"); if (TYPE(lbot->val)==INT) { hsize = lbot->val->i; /* size of hunk (0-6) */ if ((hsize >= 0) && (hsize <= 6)) { result = newhunk(hsize); hsize = 2 << hsize; /* size of hunk (2-128) */ for (hcntr = 0; hcntr < hsize; hcntr++) result->h.hunk[hcntr] = hunkfree; } else error("*makhunk: Illegal hunk size", FALSE); return(result); } else error("*makhunk: First arg must be an fixnum",FALSE); } /* * (cxr ' ') * Returns the 'th element of * */ lispval Lcxr() { register lispval temp; chkarg(2,"cxr"); if (TYPE(lbot->val)!=INT) error("cxr: First arg must be a fixnum", FALSE); else { if (! HUNKP(lbot[1].val)) error("cxr: Second arg must be a hunk", FALSE); else if ( (lbot->val->i >= 0) && (lbot->val->i < (2 << HUNKSIZE(lbot[1].val))) ) { temp = lbot[1].val->h.hunk[lbot->val->i]; if (temp != hunkfree) return(temp); else error("cxr: Arg outside of hunk range", FALSE); } else error("cxr: Arg outside of hunk range", FALSE); } } /* * (rplacx ' ' ') * Replaces the 'th element of with . * */ lispval Lrplacx() { lispval *handy; chkarg(3,"rplacx"); if (TYPE(lbot->val)!=INT) error("rplacx: First arg must be a fixnum", FALSE); else { if (! HUNKP(lbot[1].val)) error("rplacx: Second arg must be a hunk", FALSE); else { if ( (lbot->val->i >= 0) && (lbot->val->i < (2 << HUNKSIZE(lbot[1].val))) ) { if (*(handy = &(lbot[1].val->h.hunk[lbot->val->i])) != hunkfree) *handy = lbot[2].val; else error("rplacx: Arg outside hunk range", FALSE); } else error("rplacx: Arg outside hunk range", FALSE); } } return(lbot[1].val); } /* * (*rplacx ' ' ') * Replaces the 'th element of with . This is the * same as (rplacx ...) except with this function you can replace EMPTY's. * */ lispval Lstarrpx() { chkarg(3,"*rplacx"); if (TYPE(lbot->val)!=INT) error("*rplacx: First arg must be a fixnum", FALSE); else { if (! HUNKP(lbot[1].val)) error("*rplacx: Second arg must be a hunk", FALSE); else { if ( (lbot->val->i >= 0) && (lbot->val->i < (2 << HUNKSIZE(lbot[1].val))) ) lbot[1].val->h.hunk[lbot->val->i] = lbot[2].val; else error("*rplacx: Arg outside hunk range", FALSE); } } return(lbot[1].val); } /* * (hunksize ') * Returns the size of * */ lispval Lhunksize() { register int size,i; chkarg(1,"hunksize"); if (HUNKP(lbot->val)) { size = 2 << HUNKSIZE(lbot->val); for (i = size-1; i >= 0; i--) { if (lbot->val->h.hunk[i] != hunkfree) { size = i + 1; break; } } return( inewint(size) ); } else error("hunksize: First argument must me a hunk", FALSE); } /* * (fileopen filename mode) * open a file for read, write, or append the arguments can be either * strings or atoms. */ lispval Lfileopen() { FILE *port; register lispval name; register lispval mode; register char *namech; register char *modech; int typ; chkarg(2,"fileopen"); name = lbot->val; mode = lbot[1].val; namech = (char *) verify(name,"fileopen:args must be atoms or strings"); modech = (char *) verify(mode,"fileopen:args must be atoms or strings"); while (modech[0] != 'r' && modech[0] != 'w' && modech[0] != 'a') { mode = errorh(Vermisc,"Modes are only r, w, a.",nil,TRUE,31,(char *) 0); modech = (char *) verify(mode,"fileopen:args must be atoms or strings"); } while ((port = fopen(namech, modech)) == NULL) { name = errorh(Vermisc,"Unable to open file.",nil,TRUE,31,name); namech = (char *) verify(name,"fileopen:args must be atoms or strings"); } /* xports is a FILE *, cc complains about adding pointers */ return( (lispval) (xports + (port - _iob))); } /* * (*mod ' ') * This function returns mod (for balanced modulus). * It is used in vaxima as a speed enhancement. */ lispval LstarMod() { register int mod_div_2, number, modulus; chkarg(2,"*mod"); if ((TYPE(lbot->val) == INT) && (TYPE(lbot[1].val) == INT)) { modulus = lbot[1].val->i; number = lbot->val->i % modulus; mod_div_2 = modulus / 2; if (number < 0) { if (number < (-mod_div_2)) number += modulus; } else { if (number > mod_div_2) number -= modulus; } return( inewint(number) ); } else error("*mod: Arguments must be fixnums", FALSE); } lispval Llsh() { register struct argent *mylbot = lbot; int val,shift; chkarg(2,"lsh"); if((TYPE(mylbot->val) != INT) || (TYPE(mylbot[1].val) != INT)) errorh(Vermisc, "Non ints to lsh", nil,FALSE,0,mylbot->val,mylbot[1].val); val = mylbot[0].val->i; shift = mylbot[1].val->i; if(shift < -32 || shift > 32) return(inewint(0)); val = val << shift; /* do the shift */ if((val < 0) && (shift < 0)) { /* special case: the vax doesn't have a logical shift instruction, so we must zero out the ones which will propogate from the sign position */ return(inewint ( val & ~(0x80000000 << (shift+1)))); } else return( inewint(val)); } lispval Lrot() { register rot,val; /* these must be the first registers */ register struct argent *mylbot = lbot; chkarg(2,"rot"); if((TYPE(mylbot->val) != INT) || (TYPE(mylbot[1].val) != INT)) errorh(Vermisc, "Non ints to rot", nil,FALSE,0,mylbot->val,mylbot[1].val); val = mylbot[0].val->i; rot = mylbot[1].val->i; rot = rot % 32 ; /* bring it down below one byte in size */ asm(" rotl r11,r10,r10 "); /* rotate val by rot and put back in val */ return( inewint(val)); } /*----------------- vms routines to simulate dumplisp -------------------- */ #ifdef VMS extern char firstalloc[]; extern int lsbrkpnt; extern char zfreespace[]; extern int end; extern char *stabf; /* Name of symbol table */ static char newstabf[100]; /* Buffer to hold new name */ #define roundup(a,b) (((a-1)|(b-1))+1) lispval Lsavelsp() { char *filnm; int fp,fp1,i,num,start; char stabname[100], buf[5000]; char *gstab(); int strcmpn(); chkarg(1,"savelisp"); filnm = (char *) verify(lbot->val, "savelisp: non atom arg"); if((fp=creat(filnm,0666)) < 0) errorh(Vermisc,"savelisp: can't open file",nil,FALSE,0, lbot->val); start = roundup((int)firstalloc,PAGSIZ); num = roundup(((int)lsbrkpnt)-start,PAGSIZ); if((num = write(fp,start,num)) <= 0) error("savelisp: write failed ",FALSE); printf(" %x bytes written from %x to %x \n",num,start,start+num-1); close(fp); sprintf(buf,"%s.stb",gstab()); sprintf(stabname,"%s.stb",filnm); if (!strcmpn(gstab(),"tmp:",4)) if ( link(buf,stabname) >= 0) if (unlink(buf) >= 0) { strcpy(newstabf,filnm); stabf = newstabf; return(tatom); } fp1 = creat(stabname,0666,"var"); fp = open(buf,0); while ( (i=read(fp,buf,5000)) > 0) write(fp1,buf,i); close(fp); close(fp1); if (!strcmpn(gstab(),"tmp:",4)) unlink(sprintf(buf,"%s.stb",gstab())); strcpy(newstabf,filnm); stabf = newstabf; return(tatom); } lispval Lrestlsp() { char *filnm; int fp,i,num,start; extern int xcycle; chkarg(1,"restorelisp"); filnm = (char *) verify(lbot->val,"restorelisp: non atom arg"); if((fp=open(filnm,0)) < 0) errorh(Vermisc,"restorelisp: can't open file",nil,FALSE,0, lbot->val); strcpy(newstabf,filnm); /* Mark the new symbol table */ start = roundup((int)firstalloc,PAGSIZ); if((num = vread(fp,start,((int)&end)-start)) <= 0) error("restorelisp: read failed " ,FALSE); printf(" %x bytes read into %x to %x\n",num,start,start+num-1); xcycle = 0; /* indicate no saved pages to xsbrk */ close(fp)((; stabf = newstabf; /* Make this our new symbol table */ bnp = orgbnp; lbot = np = orgnp; Inonlocalgo(C_RESET,nil,nil); } #endif /*----------------------------------------------------------- */ /* getaddress -- * * (getaddress '|_entry1| 'fncname1 '|_entry2| 'fncname2 ...) * * binds value of symbol |_entry1| to function defition of atom fncname1, etc. * * returns fnc-binding of fncname1. * */ lispval Lgetaddress(){ register struct argent *mlbot = lbot; register lispval work; register int numberofargs, i; char *gstab(); char ostabf[128]; struct nlist NTABLE[100]; lispval dispget(); Savestack(4); if(np-lbot == 2) protect(nil); /* allow 2 args */ numberofargs = (np - lbot)/3; if(numberofargs * 3 != np-lbot) error("getaddress: arguments must come in triples ",FALSE); for ( i=0; ia.pname); } NTABLE[(numberofargs)].n_un.n_name = ""; strcpyn(ostabf,gstab(),128); if ( nlist(ostabf,NTABLE) == -1 ) { errorh(Vermisc,"Getaddress: Bad file",nil,FALSE,0,inewstr(ostabf)); } else for (i=0,mlbot=lbot+1; ibcd.entry = (lispval (*) ())NTABLE[i].n_value; work->bcd.discipline = mlbot[1].val; mlbot->val->a.fnbnd = work; } }; Restorestack(); return(lbot[1].val->a.fnbnd); }; /* very temporary function to test the validity of the bind stack */ bndchk() { register struct nament *npt; register lispval in2; in2 = inewint(200); for(npt=orgbnp; npt < bnp; npt++) { if((int) npt->atm < (int) in2) asm(" halt "); } } /* * formatted printer for lisp data * use: (cprintf formatstring datum [port]) */ lispval Lcprintf() { FILE *p; char *fstrng; lispval v; if(np-lbot == 2) protect(nil); /* write to standard output port */ chkarg(3,"cprintf"); fstrng = (char *)verify(lbot->val,"cprintf: first arg not string or symbol"); p = okport(lbot[2].val,okport(Vpoport->a.clb,poport)); switch(TYPE(v=lbot[1].val)) { case INT: fprintf(p,fstrng,v->i); break; case DOUB: fprintf(p,fstrng,v->r); break; case ATOM: fprintf(p,fstrng,v->a.pname); break; case STRNG:fprintf(p,fstrng,v); break; default: error("cprintf: Illegal second argument",FALSE); }; return(lbot[1].val); } lispval Lprobef() { char *name; chkarg(1,"probef"); name = (char *)verify(lbot->val,"probef: not symbol or string arg "); if(access(name,0) == 0) return(tatom); else return(nil); } lispval Lsubstring() { register char *name; register lispval index,length; int restofstring = FALSE; int len,ind,reallen; extern char strbuf[]; switch (np-lbot) { case 2: restofstring = TRUE; break; case 3: break; default: chkarg(3,"substring"); } name = (char *)verify(lbot[0].val,"substring: not symbol or string arg "); while (TYPE(index = lbot[1].val) != INT) { lbot[1].val = errorh(Vermisc,"substring: non integer index ",nil, TRUE,0,index); } len = strlen(name); ind = index->i; if(ind < 0) ind = len+1 + ind; if(ind < 1 || ind > len) return(nil); /*index out of bounds*/ if(restofstring) return((lispval)inewstr(name+ind-1)); while (TYPE(length = lbot[2].val) != INT) { lbot[2].val = errorh(Vermisc,"substring: not integer length ",nil, TRUE,0,length); } if((reallen = length->i ) < 0 || (reallen + ind) > len) return((lispval)inewstr(name+ind-1)); strncpy(strbuf,name+ind-1,reallen); strbuf[reallen] = '\0'; return((lispval)newstr()); } lispval Lsubstringn() { register char *name; register int len,ind,reallen; lispval index,length; int restofstring = FALSE; Savestack(4); if((np-lbot) == 2) restofstring = TRUE; else { chkarg(3,"substringn");} name = (char *) verify(lbot[0].val,"substringn: non symbol or string arg "); while (TYPE(index = lbot[1].val) != INT) { lbot[1].val = errorh(Vermisc,"substringn: non integer index ",nil, TRUE,0,index); } if(!restofstring) { while (TYPE(length = lbot[2].val) != INT) { lbot[2].val = errorh(Vermisc,"substringn: not integer length ", nil, TRUE,0,length); } reallen = length->i; } else reallen = -1; len = strlen(name); ind = index->i; if(ind < 0) ind = len + 1 + ind; if( ind < 1 || ind > len) return(nil); if(reallen == 0) return((lispval)inewint(*(name + ind - 1))); else { char *pnt = name + ind - 1; char *last = name + len -1; lispval cur,start; protect(cur = start = newdot()); cur->d.car = inewint(*pnt); while(++pnt <= last && --reallen != 0) { cur->d.cdr = newdot(); cur = cur->d.cdr; cur->d.car = inewint(*pnt); } Restorestack(); return(start); } } lispval Ipurcopy(); lispval Lpurcopy() { chkarg(1,"purcopy"); return(Ipurcopy(lbot[0].val)); } lispval Ipurcopy(handy) lispval handy; { extern int *beginsweep; register lispval retv, curv, lv; int i,size; switch(TYPE(handy)) { case DTPR: retv = curv = pnewdot(); lv = handy; while(TRUE) { curv->d.car = Ipurcopy(lv->d.car); if(TYPE(lv = lv->d.cdr) == DTPR) { curv->d.cdr = pnewdot(); curv = curv->d.cdr; } else { curv->d.cdr = Ipurcopy(lv); break; } } return(retv); case SDOT: retv = curv = pnewsdot(); lv = handy; while(TRUE) { curv->s.I = lv->s.I; if(lv->s.CDR == nil) break; lv = lv->s.CDR; curv->s.CDR = pnewdot(); curv = curv->s.CDR; } return(retv); case INT: if((int *)handy < beginsweep) return(handy); retv = pnewint(); retv->i = handy->i; return(retv); case DOUB: retv = pnewdoub(); retv->r = handy->r; return(retv); case HUNK2: i = 0; goto hunkit; case HUNK4: i = 1; goto hunkit; case HUNK8: i = 2; goto hunkit; case HUNK16: i = 3; goto hunkit; case HUNK32: i = 4; goto hunkit; case HUNK64: i = 5; goto hunkit; case HUNK128: i = 6; hunkit: retv = pnewhunk(i); size = 2 << i ; /* number of elements to copy over */ for( i = 0; i < size ; i++) { retv->h.hunk[i] = Ipurcopy(handy->h.hunk[i]); } return(retv); case ATOM: case STRNG: case BCD: case PORT: return(handy); /* We don't want to purcopy these, yet * it won't hurt if we don't mark them * since they either aren't swept or * will be marked in a special way */ case ARRAY: error("purcopy: can't purcopy array structures",FALSE); default: error(" bad type to purcopy ",FALSE); } } /* * Lpurep returns t if the given arg is in pure space */ lispval Lpurep() { lispval Ipurep(); chkarg(1,"purep"); return(Ipurep(lbot->val)); } STRNG: case BCD: case PORT: return(handy); /* We don't want to purcopy these, yet * it won't hurt if we don't mark them * since they either aren't swept or * will be marked in a special way */ case ARRAY: error("purcopy: can't purcopy array structures",FALSE); default: error(" bad type to purcopy ",FALSE); } } /* * Lpurep retcmd/lisp/franz/lamnop.c 644 0 12 372 2552701444 10301 static char *sccsid = "@(#)lamnop.c 35.1 5/6/81"; #include "global.h" short pbuf[8]; /* data space for fasl to put counters */ int mcounts[1]; int mcountp = (int) mcounts; int doprof = FALSE; Lmonitor() { error("Profiling not enabled",FALSE); } rt if we don't mark them * since they either aren't swept or * will be marked in a special way */ case ARRAY: error("purcopy: can't purcopy array stru/|,|5< /,"cmd/lisp/franz/lamp.c 644 0 12 1045 2552701444 7762 static char *sccsid = "@(#)lamp.c 35.1 5/6/81"; #include "global.h" #define PBUFSZ 100000 short pbuf[PBUFSZ]; /* data space for fasl to put counters */ int mcounts[NMCOUNT]; int mcountp = (int) mcounts; int doprof = TRUE; lispval Lmonitor() { extern etext, countbase; if (np==lbot) { monitor(0); countbase = 0; } else if (TYPE(lbot->val)==INT) { monitor(2, lbot->val->i, pbuf, 200000, 7000); countbase = ((int)pbuf) +12; } else { monitor(2, sbrk(0), pbuf, 200000, 7000); countbase = ((int)pbuf) + 12; } return(tatom); } 1 5/6/81"; #include "global.h" #define PBUFSZ 100000 short pbuf[PBUFSZ]; /* data space for fasl to put counters */ int mcounts[NMCOUNT]; int mcountp = (int) mcounts; int doprof = TRUE; lispval Lmonitor() { extern etext, countbase; if (np==lbot) { monitor(0); countbase = 0; } else if (TYPE(lbot->val)==INT) { monitor(2, lbot->val->i, pbuf, 200000, 7000); countbase = ((int)pbuf) +12; } else { monitor(2, sbrk(0), pbuf, 200000, 7000); countbase = (((cmd/lisp/franz/lamr.c 644 0 12 24344 2552701445 10014 static char *sccsid = "@(#)lamr.c 35.2 7/8/81"; # include "global.h" /************************************************************************/ /* */ /* Lalloc */ /* */ /* This lambda allows allocation of pages from lisp. The first */ /* argument is the name of a space, n pages of which are allocated, */ /* if possible. Returns the number of pages allocated. */ lispval Lalloc() { int n; chkarg(2,"alloc"); if(TYPE((lbot+1)->val) != INT && (lbot+1)->val != nil ) error("2nd argument to allocate must be an integer",FALSE); n = 1; if((lbot+1)->val != nil) n = (lbot+1)->val->i; return(alloc((lbot)->val,n)); /* call alloc to do the work */ } lispval Lsizeof() { chkarg(1,"sizeof"); return(inewint(csizeof(lbot->val))); } lispval Lsegment() { chkarg(2,"segment"); chek: while(TYPE(np[-1].val) != INT ) np[-1].val=error("LENGTH ARG TO SEGMENT MUST BE INTEGER",TRUE); if( np[-1].val->i < 0 ) { np[-1].val = error("LENGTH ARG TO SEGMENT MUST BE POSITIVE",TRUE); goto chek; } return(csegment((lbot)->val,np[-1].val->i,FALSE)); } /* Lforget *************************************************************/ /* */ /* This function removes an atom from the hash table. */ lispval Lforget() { char c,*name; struct atom *buckpt; int hash; chkarg(1,"forget"); if(TYPE(lbot->val) != ATOM) error("remob: non-atom argument",FALSE); name = lbot->val->a.pname; hash = hashfcn(name); /* We have found the hash bucket for the atom, now we remove it */ if( hasht[hash] == (struct atom *)lbot->val ) { hasht[hash] = lbot->val->a.hshlnk; lbot->val->a.hshlnk = (struct atom *)CNIL; return(lbot->val); } buckpt = hasht[hash]; while(buckpt != (struct atom *)CNIL) { if(buckpt->hshlnk == (struct atom *)lbot->val) { buckpt->hshlnk = lbot->val->a.hshlnk; lbot->val->a.hshlnk = (struct atom *)CNIL; return(lbot->val); } buckpt = buckpt->hshlnk; } /* Whoops! Guess it wasn't in the hash table after all. */ return(lbot->val); } lispval Lgetl() { chkarg(1,"getlength"); if(TYPE(lbot->val) != ARRAY) error("ARG TO GETLENGTH MUST BE AN ARRAY",TRUE); return(lbot->val->ar.length); } lispval Lputl() { chkarg(2,"putlength"); if(TYPE((lbot)->val) != ARRAY) error("ARG TO PUTLENGTH MUST BE AN ARRAY",FALSE); chek: while(TYPE(np[-1].val) != INT) np[-1].val = error("ARRAY LENGTH MUST BE AN INTEGER",FALSE); if(np[-1].val->i <= 0) { np[-1].val = error("ARRAY LENGTH MUST BE POSITIVE",TRUE); goto chek; } return((lbot)->val->ar.length = np[-1].val); } lispval Lgetdel() { chkarg(1,"getdelta"); if(TYPE(lbot->val) != ARRAY) error("ARG TO GETDELTA MUST BE AN ARRAY",FALSE); return(lbot->val->ar.delta); } lispval Lputdel() { chkarg(2,"putdelta"); if(TYPE((np-2)->val) != ARRAY) error("ARG TO PUTDELTA MUST BE AN ARRAY",FALSE); chek: while(TYPE(np[-1].val) != INT) np[-1].val = error("ARRAY LENGTH MUST BE AN INTEGER",TRUE); if(np[-1].val->i <= 0) { np[-1].val = error("Array delta must be positive",TRUE); goto chek; } return((lbot)->val->ar.delta = np[-1].val); } lispval Lgetaux() { chkarg(1,"getaux"); if(TYPE(lbot->val)!=ARRAY) error("Arg to getaux must be an array", FALSE); return(lbot->val->ar.aux); } lispval Lputaux() { chkarg(2,"putaux"); if(TYPE((lbot)->val)!=ARRAY) error("1st Arg to putaux must be array", FALSE); return((lbot)->val->ar.aux = np[-1].val); } lispval Lgetdata() { chkarg(1,"getdata"); if(TYPE(lbot->val)!=ARRAY) error("Arg to getdata must be an array", FALSE); return((lispval)lbot->val->ar.data); } lispval Lputdata() { chkarg(2,"putdata"); if(TYPE(lbot->val)!=ARRAY) error("1st Arg to putaux must be array", FALSE); return((lispval)(lbot->val->ar.data = (char *)(lbot[1].val))); } lispval Lgeta() { chkarg(1,"getaccess"); if(TYPE(lbot->val) != ARRAY) error("ARG TO GETACCESS MUST BE AN ARRAY",FALSE); return(lbot->val->ar.accfun); } lispval Lputa() { chkarg(2,"putaccess"); if(TYPE((lbot)->val) != ARRAY) error("ARG TO PUTACCESS MUST BE ARRAY",FALSE); return((lbot)->val->ar.accfun = np[-1].val); } lispval Lmarray() { register lispval handy; chkarg(5,"marray"); (handy = newarray()); /* get a new array cell */ handy->ar.data=(char *)lbot->val;/* insert data address */ handy->ar.accfun = lbot[1].val; /* insert access function */ handy->ar.aux = lbot[2].val; /* insert aux data */ handy->ar.length = lbot[3].val; /* insert length */ handy->ar.delta = lbot[4].val; /* push delta arg */ return(handy); } lispval Lgetentry() { chkarg(1,"getentry"); if( TYPE(lbot->val) != BCD ) error("ARG TO GETENTRY MUST BE FUNCTION",FALSE); return((lispval)(lbot->val->bcd.entry)); } lispval Lgetlang() { chkarg(1,"getlang"); while(TYPE(lbot->val)!=BCD) lbot->val = error("ARG TO GETLANG MUST BE FUNCTION DESCRIPTOR",TRUE); return(lbot->val->bcd.language); } lispval Lputlang() { chkarg(2,"putlang"); while(TYPE((lbot)->val)!=BCD) lbot->val = error("FIRST ARG TO PUTLANG MUST BE FUNCTION DESCRIPTOR",TRUE); (lbot)->val->bcd.language = np[-1].val; return(np[-1].val); } lispval Lgetparams() { chkarg(1,"getparams"); if(TYPE(np[-1].val)!=BCD) error("ARG TO GETPARAMS MUST BE A FUNCTION DESCRIPTOR",FALSE); return(np[-1].val->bcd.params); } lispval Lputparams() { chkarg(2,"putparams"); if(TYPE((lbot)->val)!=BCD) error("1st ARG TO PUTPARAMS MUST BE FUNCTION DESCRIPTOR",FALSE); return((lbot)->val->bcd.params = np[-1].val); } lispval Lgetdisc() { chkarg(1,"getdisc"); if(TYPE(np[-1].val) != BCD) error("ARGUMENT OF GETDISC MUST BE FUNCTION",FALSE); return(np[-1].val->bcd.discipline); } lispval Lputdisc() { chkarg(2,"putdisc"); if(TYPE(np[-2].val) != BCD) error("ARGUMENT OF PUTDISC MUST BE FUNCTION",FALSE); return((np-2)->val->bcd.discipline = np[-1].val); } lispval Lgetloc() { chkarg(1,"getloc"); if(TYPE(lbot->val)!=BCD) error("ARGUMENT TO GETLOC MUST BE FUNCTION",FALSE); return(lbot->val->bcd.loctab); } lispval Lputloc() { chkarg(2,"putloc"); if(TYPE((lbot+1)->val)!=BCD); error("FIRST ARGUMENT TO PUTLOC MUST BE FUNCTION",FALSE); (lbot)->val->bcd.loctab = (lbot+1)->val; return((lbot+1)->val); } lispval Lmfunction() { register lispval handy; chkarg(2,"mfunction"); handy = (newfunct()); /* get a new function cell */ handy->bcd.entry = (lispval (*)())((np-5)->val); /* insert entry point */ handy->bcd.discipline = ((np-4)->val); /* insert discipline */ #ifdef ROWAN handy->language = (np-3)->val; /* insert language */ handy->params = ((np-2)->val); /* insert parameters */ handy->loctab = ((np-1)->val); /* insert local table */ #endif return(handy); } /** Lreplace ************************************************************/ /* */ /* Destructively modifies almost any kind of data. */ lispval Lreplace() { register lispval a1, a2; register int t; chkarg(2,"replace"); if((t = TYPE(a1 = (lbot)->val)) != TYPE(a2 = np[-1].val)) error("REPLACE ARGS MUST BE SAME TYPE",FALSE); switch( t ) { case VALUE: a1->l = a2->l; return( a1 ); case INT: a1->i = a2->i; return( a1 ); case ARRAY: a1->ar.data = a2->ar.data; a1->ar.accfun = a2->ar.accfun; a1->ar.length = a2->ar.length; a1->ar.delta = a2->ar.delta; return( a1 ); case DOUB: a1->r = a2->r; return( a1 ); case SDOT: case DTPR: a1->d.car = a2->d.car; a1->d.cdr = a2->d.cdr; return( a1 ); case BCD: a1->bcd.entry = a2->bcd.entry; a1->bcd.discipline = a2->bcd.discipline; return( a1 ); default: errorh(Vermisc,"Replace: cannot handle the type of this arg", nil,FALSE,0,a1); } /* NOT REACHED */ } /* Lvaluep */ lispval Lvaluep() { chkarg(1,"valuep"); if( TYPE(lbot->val) == VALUE ) return(tatom); else return(nil); } CNTTYP() { return; /* HI! COUNT ONE TYPE CALL! */ } lispval Lod() { int i; chkarg(2,"od"); while( TYPE(np[-1].val) != INT ) np[-1].val = error("2nd ARG TO OD MUST BE INTEGER",TRUE); for( i = 0; i < np->val->i; ++i ) printf(copval(odform,CNIL)->a.pname,((int *)(np[-2].val))[i]); dmpport(poport); return(nil); } lispval Lfake() { chkarg(1,"fake"); if( TYPE(lbot->val) != INT ) error("ARG TO FAKE MUST BE INTEGER",TRUE); return((lispval)(lbot->val->i)); } /* this used to be Lwhat, but was changed to Lmaknum for maclisp compatiblity */ lispval Lmaknum() { chkarg(1,"maknum"); return(inewint((int)(lbot->val))); } lispval Lpname() { chkarg(1,"pname"); if(TYPE(lbot->val) != ATOM) error("ARG TO PNAME MUST BE AN ATOM",FALSE); return((lispval)(lbot->val->a.pname)); } lispval Larrayref() { chkarg(2,"arrayref"); if(TYPE((lbot)->val) != ARRAY) error("FIRST ARG TO ARRAYREF MUST BE ARRAY",FALSE); vtemp = (lbot + 1)->val; chek: while(TYPE(vtemp) != INT) vtemp = error("SECOND ARG TO ARRAYREF MUST BE INTEGER",TRUE); if( vtemp->i < 0 ) { vtemp = error("NEGATIVE ARRAY OFFSET",TRUE); goto chek; } if( vtemp->i >= (np-2)->val->ar.length->i ) { vtemp = error("ARRAY OFFSET TOO LARGE",TRUE); goto chek; } vtemp = (lispval)((np-2)->val->ar.data + ((np-2)->val->ar.delta->i)*(vtemp->i)); /* compute address of desired item */ return(vtemp); } lispval Lptr() { chkarg(1,"ptr"); return(inewval(lbot->val)); } lispval Llctrace() { chkarg(1,"lctrace"); lctrace = (int)(lbot->val->a.clb); return((lispval)lctrace); } lispval Lslevel() { return(inewint(np-orgnp-2)); } lispval Lsimpld() { register lispval pt; register char *cpt = strbuf; chkarg(1,"simpld"); for(atmlen=1, pt=np->val; NOTNIL(pt); ++atmlen, pt = pt->d.cdr); if( atmlen > STRBLEN ) { error("LCODE WAS TOO LONG",TRUE); return((lispval)inewstr("")); } for(((pt=np->val; NOTNIL(pt); pt = pt->d.cdr) *(cpt++) = pt->d.car->i; *cpt = 0; return((lispval)newstr()); } /* Lopval *************************************************************/ /* */ /* Routine which allows system registers and options to be examined */ /* and modified. Calls copval, the routine which is called by c code */ /* to do the same thing from inside the system. */ lispval Lopval() { lispval quant; if( lbot == np ) return(error("bad call to opval",TRUE)); quant = lbot->val; /* get name of sys variable */ while( TYPE(quant) != ATOM ) quant = error("first arg to opval must be an atom",TRUE); if(np > lbot+1) vtemp = (lbot+1)->val ; else vtemp = CNIL; return(copval(quant,vtemp)); } ystem registers and options to be examined */ /* and modified. Calls copval, the routine which is called by c code */ /* to do the same thing from inside the system. */ lispval Lopval() { lispval quant; if( lbot == np ) return(error("bad call to opval",TRUE)); quant = lbcmd/lisp/franz/lisp.c 644 2 33 4544 2552701445 10015 static char *sccsid = "@(#)lisp.c 35.5 7/1/81"; #include "global.h" #include "frame.h" /* main *****************************************************************/ /* Execution of the lisp system begins here. This is the top level */ /* executor which is an infinite loop. The structure is similar to */ /* error. */ extern char _sobuf[]; extern lispval reborn; extern int rlevel; static int virgin = 0; int Xargc; char **Xargv; extern int environ; main(argc,argv,arge) char **argv; { lispval temp, matom(); extern struct frame *errp; extern int holbeg,holend,usehole; extern int *curhbeg; environ = arge; setbuf(stdout,_sobuf); Xargc = argc; Xargv = argv; virgin = 0; errp = (struct frame *)0; initial(); errp = Pushframe(F_RESET); switch(retval) { case C_RESET: break; /* what to do? */ case C_INITIAL: break; /* first time */ } for(EVER) { lbot = np = orgnp; rlevel = 0; depth = 0; clearerr(piport = stdin); clearerr(poport = stdout); vmsautors(); np++->val = matom("top-level"); np++->val = nil; Lapply(); } } Ntpl() { lispval Lread(),Istsrch(); snpand(0); if (virgin == 0) { fputs(Istsrch(matom("version"))->d.cdr->d.cdr->d.cdr,poport); virgin = 1; } lbot = np; np++->val = P(stdin); np++->val = eofa; while (TRUE) { fputs("\n-> ",stdout); dmpport(stdout); vtemp = Lread(); if(vtemp == eofa) exit(0); printr(eval(vtemp),stdout); } } /* franzexit :: give up the ghost * this function is called whenever one decides to kill this process. * We clean up a bit then call then standard exit routine. C code * in franz should never call exit() directly. */ franzexit(code) { extern int fvirgin; extern char *stabf; if(!fvirgin) unlink(stabf); /* give up any /tmp symbol tables */ exit(code); /* is this something special?? _cleanup(); * proflush(); * _exit(code); */ } /* * This code implements the VMS autorestore feature: * Specifying lisp -r name will cause name to be * restorelisp'd and both -r and name to be deleted * from the lisp argv list. */ static vmsautors() { #ifdef VMS static int VMSrestore_done = 0; if (VMSrestore_done == 0){ VMSrestore_done = 1; if ( (Xargc > 2) && (strcmp(Xargv[1],"-r") == 0) ) { np++->val = matom(Xargv[2]); Xargv[2] = Xargv[0]; Xargv++; Xargv++; Xargc -= 2; Lrestlsp(); } } #endif } code implements the VMS autorestore feature: * Specifying lisp -r name will cause name to be * restorelisp'd and both -r and name to be deleted * from tcmd/lisp/franz/mcount.s 644 0 12 456 2552701445 10344 .asciz "@(#)mcount.s 35.1 5/6/81" # count subroutine called during profiling .globl mcount .globl _mcount .comm _countbase,4 _mcount: mcount: movl (r0),r1 beql init incr: incl (r1) return: rsb init: movl _countbase,r1 beql return addl2 $8,_countbase movl (sp),(r1)+ movl r1,(r0) brb incr Xargc -= 2; Lrestlsp(); } } #endif } code implements the VMS autorestore feature: * Specifying lisp/|,|5< /,"cmd/lisp/franz/nfasl.c 644 0 12 47735 2552701446 10176 static char *sccsid = "@(#)nfasl.c 35.2 7/7/81"; #include "global.h" #include #include #include "naout.h" #include "chkrtab.h" #include "structs.h" /* fasl - fast loader j.k.foderaro * this loader is tuned for the lisp fast loading application * any changes in the system loading procedure will require changes * to this file * * The format of the object file we read as input: * text segment: * 1) program text - this comes first. * 2) binder table - one word entries, see struct bindage * begins with symbol: bind_org * 3) litterals - exploded lisp objects. * begins with symbol: lit_org * ends with symbol: lit_end * data segment: * not used * * * these segments are created permanently in memory: * code segment - contains machine codes to evaluate lisp functions. * linker segment - a list of pointers to lispvals. This allows the * compiled code to reference constant lisp objects. * The first word of the linker segment is a gc link * pointer and does not point to a literal. The * symbol binder is assumed to point to the second * longword in this segment. The last word in the * table is -1 as a sentinal to the gc marker. * The number of real entries in the linker segment * is given as the value of the linker_size symbol. * Taking into account the 2 words required for the * gc, there are 4*linker_size + 8 bytes in this segment. * transfer segment - this is a transfer table block. It is used to * allow compiled code to call other functions * quickly. The number of entries in the transfer table is * given as the value of the trans_size symbol. * * the following segments are set up in memory temporarily then flushed * binder segment - a list of struct bindage entries. They describe * what to do with the literals read from the literal * table. The binder segment begins in the file * following the bindorg symbol. * literal segment - a list of characters which _Lread will read to * create the lisp objects. The order of the literals * is: * linker literals - used to fill the linker segment. * transfer table literals - used to fill the * transfer segment * binder literals - these include names of functions * to bind interspersed with forms to evaluate. * The meanings of the binder literals is given by * the values in the binder segment. * string segment - this is the string table from the file. We have * to allocate space for it in core to speed up * symbol referencing. * */ /* external functions called or referenced */ lispval qcons(),qlinker(),qget(); int _qf0(), _qf1(), _qf2(), _qf3(), _qf4(), _qfuncl(), svkludg(),qnewint(); int qnewdoub(),qoneplus(),qoneminus(); lispval Lread(), Lcons(), Lminus(), Ladd1(), Lsub1(), Lplist(), Lputprop(); lispval Lprint(), Lpatom(), Lconcat(), Lget(), Lmapc(), Lmapcan(); lispval Llist(), Ladd(), Lgreaterp(), Lequal(), Ltimes(), Lsub(); lispval Lncons(); lispval Inonlocalgo(),error(); lispval Istsrch(); int mcount(), qpushframe(); extern int mcounts[],mcountp,doprof; extern lispval *tynames[]; extern long errp; extern char _erthrow[]; extern char setsav[]; extern int initflag; /* when TRUE, inhibits gc */ char *alloca(); /* stack space allocator */ /* mini symbol table, contains the only external symbols compiled code is allowed to reference */ #define SYMMAX 21 struct ssym { char *fnam; /* pointer to string containing name */ int floc; /* address of symbol */ int ord; /* ordinal number within cur sym tab */ } Symbtb[SYMMAX] = { "trantb", 0, -1, /* must be first */ "linker", 0, -1, /* must be second */ "mcount", (int) mcount, -1, "mcounts", (int) mcounts, -1, "_qnewint", (int) qnewint, -1, "_qnewdoub", (int) qnewdoub, -1, "_qcons", (int) qcons, -1, "_qoneplus", (int) qoneplus, -1, "_qoneminus", (int) qoneminus, -1, "_typetable", (int) typetable, -1, "_tynames", (int) tynames, -1, "_qget", (int) qget, -1, "_errp", (int) &errp, -1, "_Inonlocalgo", (int) Inonlocalgo, -1, "__erthrow", (int) _erthrow, -1, "_error", (int) error, -1, "_setsav", (int) setsav, -1, "_qpushframe", (int) qpushframe, -1, "_retval", (int)&retval, -1, "_lispretval", (int)&lispretval,-1, "_bnp", (int) &bnp, -1, }; struct nlist syml; /* ((to read a.out symb tab */ extern lispval *bind_lists; /* gc binding lists */ /* bindage structure: * the bindage structure describes the linkages of functions and name, * and tells which functions should be evaluated. It is mainly used * for the non-fasl'ing of files, we only use one of the fields in fasl */ struct bindage { int b_type; /* type code, as described below */ }; /* the possible values of b_type * -1 - this is the end of the bindage entries * 0 - this is a lambda function * 1 - this is a nlambda function * 2 - this is a macro function * 99 - evaluate the string * */ extern struct trtab *trhead; /* head of list of transfer tables */ extern struct trent *trcur; /* next entry to allocate */ extern int trleft; /* # of entries left in this transfer table */ struct trent *gettran(); /* function to allocate entries */ /* maximum number of functions */ #define MAXFNS 500 lispval Lnfasl() { extern int holend,usehole; extern int uctolc; extern char *curhbeg; struct argent *svnp; struct exec exblk; /* stores a.out header */ FILE *filp, *p, *map; /* file pointer */ int domap,note_redef; lispval handy,debugmode; struct relocation_info reloc; struct trent *tranloc; int trsize; lispval disp; int i,j,times, *iptr; int funloc[MAXFNS]; /* addresses of functions rel to txt org */ int funcnt = 0; /* symbols whose values are taken from symbol table of .o file */ int bind_org = 0; /* beginning of bind table */ int lit_org = 0; /* beginning of literal table */ int lit_end; /* end of literal table */ int trans_size = 0; /* size in entries of transfer table */ int linker_size; /* size in bytes of linker table (not counting gc ptr) */ /* symbols which hold the locations of the segments in core and * in the file */ char *code_core_org, /* beginning of code segment */ *linker_core_org, /* beginning of linker segment */ *linker_core_end, /* last word in linker segment */ *literal_core_org, /* beginning of literal table */ *binder_core_org, /* beginning of binder table */ *string_core_org; int string_file_org, /* location of string table in file */ string_size, /* number of chars in string table */ segsiz; /* size of permanent incore segment */ char *symbol_name; struct bindage *bindorg, *curbind; int linkerloc, typer; lispval rdform, *linktab; int ouctolc; int debug = 0; lispval currtab,curibase; char ch,*filnm,*nfilnm; char tempfilbf[100]; switch(np-lbot) { case 0: protect(nil); case 1: protect(nil); case 2: protect(nil); case 3: break; default: argerr("fasl"); } filnm = (char *) verify(lbot->val,"fasl: non atom arg"); domap = FALSE; /* debugging */ debugmode = Istsrch(matom("debugging"))->d.cdr->d.cdr->d.cdr; /* end debugging */ /* insure that the given file name ends in .o if it doesnt, copy to a new buffer and add a .o but Allow non .o file names (5mar80 jkf) */ tempfilbf[0] = '\0'; nfilnm = filnm; /* same file name for now */ if( (i = strlen(filnm)) < 2 || strcmp(filnm+i-2,".o") != 0) { strcatn(tempfilbf,filnm,96); strcat(tempfilbf,".o"); nfilnm = tempfilbf; } if ( (filp = fopen(nfilnm,"r")) == NULL) if ((filnm != nfilnm) && ((filp = fopen(filnm,"r")) == NULL)) errorh(Vermisc,"Can't open file",nil,FALSE,9797,lbot->val); if ((handy = (lbot+1)->val) != nil ) { if((TYPE(handy) != ATOM ) || (map = fopen(handy->a.pname, (Istsrch(matom("appendmap"))->d.cdr->d.cdr->d.cdr == nil ? "w" : "a"))) == NULL) error("fasl: can't open map file",FALSE); else { domap = TRUE; /* fprintf(map,"Map of file %s\n",lbot->val->a.pname); */ } } /* set the note redefinition flag */ if((lbot+2)->val != nil) note_redef = TRUE; else note_redef = FALSE; /* if nil don't print fasl message */ if ( Vldprt->a.clb != nil ) { printf("[fasl %s]",filnm); fflush(stdout); } svnp = np; lbot = np; /* set up base for later calls */ /* clear the ords in the symbol table */ for(i=0 ; i < SYMMAX ; i++) Symbtb[i].ord = -1; if( read(fileno(filp),&exblk,sizeof(struct exec)) != sizeof(struct exec)) error("fasl: header read failed",FALSE); /* check that the magic number is valid */ if(exblk.a_magic != 0407) error("fasl: bad magic number in fasl file",FALSE); /* read in string table */ lseek(fileno(filp),(string_file_org = N_STROFF(exblk)),0); if( read(fileno(filp), &string_size , 4) != 4) error("fasl: string table read error, probably old fasl format", FALSE); /* allocate space for string table on the stack */ string_core_org = alloca(string_size - 4); if( read(fileno(filp), string_core_org , string_size - 4) != string_size -4) error("fasl: string table read error ",FALSE); /* read in symbol table and set the ordinal values */ fseek(filp,N_SYMOFF(exblk),0); times = exblk.a_syms/sizeof(struct nlist); if(debug) printf(" %d symbols in symbol table\n",times); for(i=0; i < times ; i++) { if( fread(&syml,sizeof(struct nlist),1,filp) != 1) error("fasl: Symb tab read error",FALSE); symbol_name = syml.n_un.n_strx - 4 + string_core_org; if (syml.n_type == N_EXT) { for(j=0; j< SYMMAX; j++) { if((Symbtb[j].ord < 0) && strcmp(Symbtb[j].fnam,symbol_name)==0) { Symbtb[j].ord = i; if(debug)printf("symbol %s ord is %d\n",symbol_name,i); break; }; }; if( j>=SYMMAX ) printf("Unknown symbol %s\n",symbol_name); } else if (((ch = symbol_name[0]) == 's') || (ch == 'L') || (ch == '.') ) ; /* skip this */ else if (symbol_name[0] == 'F') funloc[funcnt++] = syml.n_value; /* seeing function */ else if (!bind_org && (strcmp(symbol_name, "bind_org") == 0)) bind_org = syml.n_value; else if (strcmp(symbol_name, "lit_org") == 0) lit_org = syml.n_value; else if (strcmp(symbol_name, "lit_end") == 0) lit_end = syml.n_value; else if (strcmp(symbol_name, "trans_size") == 0) trans_size = syml.n_value; else if (strcmp(symbol_name, "linker_size") == 0) linker_size = syml.n_value; } /* check to make sure we are working with the right format */ if((lit_org == 0) || (lit_end == 0)) errorh(Vermisc,"File not in new fasl format",nil,FALSE,0,lbot->val); /*----------------*/ /* read in text segment up to beginning of binder table */ segsiz = bind_org + 4*linker_size + 8 + 3; /* size is core segment size * plus linker table size * plus 2 for gc list * plus 3 to round up to word */ lseek(fileno(filp),(long)sizeof(struct exec),0); code_core_org = (char *) csegment(str_name,segsiz/(sizeof(int)),TRUE); if(read(fileno(filp),code_core_org,bind_org) != bind_org) error("Read error in text ",FALSE); if(debug) { printf("Read %d bytes of text into 0x%x\n",bind_org,code_core_org); printf(" incore segment size: %d (0x%x)\n",segsiz,segsiz); } /* linker table is 2 entries (8 bytes) larger than the number of * entries given by linker_size . There must be a gc word at * the beginning and a -1 at the end */ linker_core_org = code_core_org + bind_org; linker_core_end = linker_core_org + 4*linker_size + 4; /* address of gc sentinal last */ if(debug)printf("lin_cor_org: %x, link_cor_end %x\n", linker_core_org, linker_core_end); Symbtb[1].floc = (int) (linker_core_org + 4); /* set the linker table to all -1's so we can put in the gc table */ for( iptr = (int *)(linker_core_org + 4 ); iptr <= (int *)(linker_core_end); iptr++) *iptr = -1; /* link our table into the gc tables */ *(int *)linker_core_org = (int)bind_lists; /* point to current */ bind_lists = (lispval *) (linker_core_org + 4); /* point to first item */ /* read the binder table and literals onto the stack */ binder_core_org = alloca(lit_end - bind_org); read(fileno(filp),binder_core_org,lit_end-bind_org); literal_core_org = binder_core_org + lit_org - bind_org; /* check if there is a transfer table required for this * file, and if so allocate one of the necessary size */ if(trans_size > 0) { tranloc = gettran(trans_size); Symbtb[0].floc = (int) tranloc; } /* now relocate the necessary symbols in the text segment */ fseek(filp,(long)(sizeof(struct exec) + exblk.a_text + exblk.a_data),0); times = (exblk.a_trsize)/sizeof(struct relocation_info); /* the only symbols we will relocate are references to external symbols. They are recognized by extern and pcrel set. */ for( i=1; i<=times ; i++) { if( fread(&reloc,sizeof(struct relocation_info),1,filp) != 1) error("Bad text reloc read",FALSE); if(reloc.r_extern && reloc.r_pcrel) { for(j=0; j < SYMMAX; j++) { if(Symbtb[j].ord == reloc.r_symbolnum) /* look for this sym */ { if(debug && FALSE) printf("Relocating %d (ord %d) at %x\n", j, Symbtb[j].ord, reloc.r_address); if (Symbtb[j].floc == (int) mcounts) { *(int *)(code_core_org+reloc.r_address) += mcountp - (int)code_core_org; if(doprof){ if (mcountp == (int) &mcounts[NMCOUNT-2]) printf("Ran out of counters; increas NMCOUNT in fasl.c\n"); if (mcountp < (int) &mcounts[NMCOUNT-1]) mcountp += 4; } } else *(int *)(code_core_org+reloc.r_address) += Symbtb[j].floc - (int)code_core_org; break; } }; if( j >= SYMMAX) if(debug) printf("Couldnt find ord # %d\n", reloc.r_symbolnum); } } if ( Vldprt->a.clb != nil ) { putchar('\n'); fflush(stdout); } /* set up a fake port so we can read from core */ /* first find a free port */ p = stdin; for( ; p->_flag & (_IOREAD|_IOWRT) ; p++) if( p >= _iob + _NFILE) error(" No free file descriptor for fasl ",FALSE); p->_flag = _IOREAD | _IOSTRG; p->_base = p->_ptr = (char *) literal_core_org; /* start at beginning of lit */ p->_cnt = lit_end - lit_org; if(debug)printf("lit_org %d, c((harstrt %d\n",lit_org, p->_base); /* the first forms we wish to read are those literals in the * literal table, that is those forms referenced by an offset * from r8 in compiled code */ /* to read in the forms correctly, we must set up the read table */ currtab = Vreadtable->a.clb; Vreadtable->a.clb = strtab; /* standard read table */ curibase = ibase->a.clb; ibase->a.clb = inewint(10); /* read in decimal */ ouctolc = uctolc; /* remember value of uctolc flag */ PUSHDOWN(gcdis,tatom); /* turn off gc */ i = 1; linktab = (lispval *)(linker_core_org +4); while (linktab < (lispval *)linker_core_end) { np = svnp; protect(P(p)); uctolc = FALSE; handy = Ipurcopy(Lread()); uctolc = ouctolc; getc(p); /* eat trailing blank */ if(debugmode) { printf("form %d read: ",i++); printr(handy,stdout); putchar('\n'); fflush(stdout); } *linktab++ = handy; } /* process the transfer table if one is used */ trsize = trans_size; while(trsize--) { np = svnp; protect(P(p)); uctolc = FALSE; handy = Lread(); /* get function name */ uctolc = ouctolc; getc(p); tranloc->name = handy; tranloc->fcn = qlinker; /* initially go to qlinker */ tranloc++; } /* now process the binder table, which contains pointers to functions to link in and forms to evaluate. */ funcnt = 0; curbind = (struct bindage *) binder_core_org; for( ; curbind->b_type != -1 ; curbind++) { np = svnp; protect(P(p)); uctolc = FALSE; /* inhibit uctolc conversion */ rdform = Lread(); /* debugging */ if(debugmode) { printf("link form read: "); printr(rdform,stdout); printf(" ,type: %d\n", curbind->b_type); fflush(stdout); } /* end debugging */ uctolc = ouctolc; /* restore previous state */ getc(p); /* eat trailing null */ protect(rdform); if(curbind->b_type <= 2) /* if function type */ { handy = newfunct(); if (note_redef && (rdform->a.fnbnd != nil)) { printr(rdform,stdout); printf(" redefined\n"); } rdform->a.fnbnd = handy; handy->bcd.entry = (lispval (*)())(code_core_org + funloc[funcnt++]); handy->bcd.discipline = (curbind->b_type == 0 ? lambda : curbind->b_type == 1 ? nlambda : macro); if(domap) fprintf(map,"%s\n%x\n",rdform->a.pname,handy->bcd.entry); } else { Vreadtable->a.clb = currtab; ibase->a.clb = curibase; /* debugging */ if(debugmode) { printf("Eval: "); printr(rdform,stdout); printf("\n"); fflush(stdout); }; /* end debugging */ eval(rdform); /* otherwise eval it */ if(uctolc) ouctolc = TRUE; /* if changed by eval, remember */ curibase = ibase->a.clb; ibase->a.clb = inewint(10); Vreadtable->a.clb = strtab; } }; p->_cnt = p->_file = p->_flag = 0; /* give up file descriptor */ p->_ptr = p-> _base = (char *) 0; POP; /* restore state of gcdisable variable */ Vreadtable->a.clb = currtab; chkrtab(currtab); ibase->a.clb = curibase; fclose(filp); if(domap) fclose(map); return(tatom); } /* gettran :: allocate a segment of transfer table of the given size */ struct trent * gettran(size) { struct trtab *trp; struct trent *retv; int ousehole; extern int usehole; if(size > TRENTS) error("transfer table too large",FALSE); if(size > trleft) { /* allocate a new transfer table */ /* must not allocate in the hole or we cant modify it */ ousehole = usehole; /* remember old value */ usehole = FALSE; trp = (struct trtab *)csegment(str_name,sizeof(struct trtab),FALSE); usehole = ousehole; trp->sentinal = 0; /* make sure the sentinal is 0 */ trp->nxtt = trhead; /* link at beginning of table */ trhead = trp; trcur = &(trp->trentrs[0]); /* begin allocating here */ trleft = TRENTS; } trleft = trleft - size; retv = trcur; trcur = trcur + size; return(retv); } /* clrtt :: clear transfer tables, or link them all up; * this has two totally opposite functions: * 1) all transfer tables are reset so that all function calls will go * through qlinker * 2) as many transfer tables are set up to point to bcd functions * as possible */ clrtt(flag) { /* flag = 0 :: set to qlinker * flag = 1 :: set to function bcd binding if possible */ register struct trtab *temptt; register struct trent *tement; register lispval fnb; for (temptt = trhead; temptt != 0 ; temptt = temptt->nxtt) { for(tement = &temptt->trentrs[0] ; tement->fcn != 0 ; tement++) { if(flag == 0 || TYPE(fnb=tement->name->a.fnbnd) != BCD || TYPE(fnb->bcd.discipline) == STRNG) tement->fcn = qlinker; else tement->fcn = fnb->bcd.entry; } } } /* chktt - builds a list of transfer table entries which don't yet have a function associated with them, i.e if this transfer table entry were used, an undefined function error would result */ lispval chktt() { register struct trtab *temptt; register struct trent *tement; register lispval retlst,curv; snpand(4); retlst = newdot(); /* build list of undef functions */ protect(retlst); for (temptt = trhead; temptt != 0 ; temptt = temptt->nxtt) { for(tement = &temptt->trentrs[0] ; tement->fcn != 0 ; tement++) { if(tement->name->a.fnbnd == nil) { curv= newdot(); curv->d.car = tement->name; curv->d.cdr = retlst->d.cdr; retlst->d.cdr = curv; } } } return(retlst->d.cdr); } temptt; register struct trent *temcmd/lisp/franz/pbignum.c 644 0 12 1576 2552701446 10505 static char *sccsid = "@(#)pbignum.c 35.1 5/6/81"; #include "global.h" pbignum(current, useport) register lispval current; register FILE *useport; { int *top, *bot, *work, negflag = 0, *sp(), *alloca(); register int *digitp, *binp; register lispval last; /* copy bignum onto stack */ top = sp() - 1; do { stack(current->s.I); } while(current = current->s.CDR); bot = sp(); if (top==bot) { fprintf(useport,"%d",*bot); return; } /* save space for printed digits*/ work = alloca((top-bot)*2*sizeof(int)); if( *bot < 0) { negflag = 1; dsneg(top,bot); } /* figure out nine digits at a time by destructive division*/ for(digitp = work; bot <= top; digitp++) { *digitp = dodiv(top,bot); if(*bot==0) bot += 1; } /* print them out */ if(negflag) putc('-',useport); fprintf(useport,"%d",*--digitp); while ( digitp > work) fprintf(useport,"%09d",*--digitp); } sp(); if (top==bot) { fprintf(useport,"%d",*bot); return; } /* save space for printed digits*/ work = alloca((top-bot)*2*cmd/lisp/franz/qfuncl.s 644 0 12 30136 2552701447 10367 .asciz "@(#)qfuncl.s 35.2 7/7/81" # lisp to C or lisp interface code # constants from the lisp system # types .set strng,0 .set atom,1 .set bcd,5 .set array,7 # important offsets withing data types # for atoms .set atomclb,0 .set atomfnbnd,8 # for arrays .set araccfun,0 .globl __qf0 __qf0: subl3 $4,r6,r7 jbr __qfuncl .globl __qf1 __qf1: subl3 $8,r6,r7 jbr __qfuncl .globl __qf2 __qf2: subl3 $12,r6,r7 jbr __qfuncl .globl __qf3 __qf3: subl3 $16,r6,r7 jbr __qfuncl .globl __qf4 __qf4: subl3 $20,r6,r7 jbr __qfuncl .data qfunbuf: .long 0 qlinbuf: .long 0 .text .globl __qfuncl __qfuncl: # quick function call # movab qfunbuf,r0 # profiling # jsb mcount # profiling cmpl r6,_nplim # make sure stack ok blss on1 calls $0,_namerr on1: movl (r7),r0 # bring in addr of atom addl2 $4,r7 # inc lbot by one nament pushl r0 # stack addr of atom of fcn to call movl 8(r0),r0 # bring in fcn binding addr jleq nonexf # jump if fcn non existant tstl _rsetsw # see if in *rset mode jeql norset # if not, call function tstl _bcdtrsw # if (*rset t) & (sstatus bcdtrace t) jneq hackit # then have Lfuncal do the work norset: ashl $-9,r0,r1 # see if bcd cmpb $5,_typetable+1[r1] # we are calling jeql gotbcd hackit: calls $1,_Lfuncal # call lisp stuff movab -4(r7),r6 # restore np to top rsb # return to callee gotbcd: calls $1,*(r0) # call code movab -4(r7),r6 # restore np to top rsb # return nonexf: # non existant function, call c function to take care of it, # we could process it here but wish to minimize assembly language # code. # we should never return from this call # the addr of the atom is already stacked # addl2 $4,r7 # inc lbot by one nament for evalframe calls $1,_Undeff # call handler clrl r0 # return nil to compiled code rsb # if ever should return here # transfer table linkage routine # .globl _qlinker _qlinker: .word 0xfc0 # save all possible registers # movab qlinbuf,r0 # profiling # jsb mcount # profiling tstl _exception # any pending exceptions jeql noexc tstl _sigintcnt # is it because of SIGINT jeql noexc # if not, just leave pushl $2 # else push SIGINT calls $1,_sigcall noexc: movl 16(fp),r0 # get return pc addl2 -4(r0),r0 # get pointer to table movl 4(r0),r1 # get atom pointer retry: # come here after undef func error movl atomfnbnd(r1),r2 # get function binding jleq nonex # if none, leave tstl _stattab+2*4 # see if linking possible (Strans) jeql nolink # no, ((it isn't ashl $-9,r2,r3 # check type of function cmpb $bcd,_typetable+1[r3] jeql linkin # bcd, link it in! cmpb $array,_typetable+1[r3] # how about array? jeql doarray # yep nolink: pushl r1 # non, bcd, call interpreter calls $1,_Lfuncal ret # handle arrays by pushing the array descriptor on the table and checking # for a bcd array handler doarray: ashl $-9,araccfun(r2),r3 # get access function addr shifted cmpb $bcd,_typetable+1[r3] # bcd?? jneq nolink # no, let funcal handle it movl r2,(r6)+ # store array header on stack movl *(r2),r2 # get in func addr jmp 2(r2) # jump in beyond calls header linkin: ashl $-9,4(r2),r3 # check type of function discipline cmpb $0,_typetable+1[r3] # is it string? jeql nolink # yes, it is a c call, so dont link in movl (r2),r2 # get function addr movl r2,(r0) # put fcn addr in table jmp 2(r2) # enter fcn after mask nonex: pushl r1 # non existant fcn calls $1,_Undeff # call processor movl r0,r1 # back in r1 jbr retry # for the retry. .globl __erthrow # errmessage for uncaught throws __erthrow: .byte 'U,'n,'c,'a,'u,'g,'h,'t,' ,'t,'h,'r,'o,'w .byte ' ,'f,'r,'o,'m,' ,'c,'o,'m,'p,'i,'l,'e,'d .byte ' ,'c,'o,'d,'e,0 .globl _tynames _tynames: .long 0 # nothing here .long _lispsys+20*4 # str_name .long _lispsys+21*4 # atom_name .long _lispsys+19*4 # int_name .long _lispsys+23*4 # dtpr_name .long _lispsys+22*4 # doub_name .long _lispsys+58*4 # funct_name .long _lispsys+83*4 # port_name .long _lispsys+47*4 # array_name .long 0 # nothing here .long _lispsys+50*4 # sdot_name .long _lispsys+53*4 # val_nam # # Quickly allocate small fixnums # .globl _qnewint _qnewint: cmpl r5,$1024 jgeq alloc cmpl r5,$-1024 jlss alloc moval Fixzero[r5],r0 rsb alloc: movl _int_str,r0 # move next cell addr to r0 jlss callnewi # if no space, allocate incl *_lispsys+24*4 # inc count of ints movl (r0),_int_str # advance free list movl r5,(r0) # put baby to bed. rsb callnewi: pushl r5 calls $0,_newint movl (sp)+,(r0) rsb # _qoneplus adds one to the boxed fixnum in r0 and returns a boxed fixnum. # .globl _qoneplus _qoneplus: addl3 (r0),$1,r5 jbr _qnewint # _qoneminus subtracts one from the boxes fixnum in r0 and returns a # boxed fixnum .globl _qoneminus _qoneminus: subl3 $1,(r0),r5 jbr _qnewint # # _qnewdoub quick allocation of a initialized double (float) cell. # This entry point is required by the compiler for symmetry reasons. # Passed to _qnewdoub in r4,r5 is a double precision floating point # number. This routine allocates a new cell, initializes it with # the given value and then returns the cell. # .globl _qnewdoub _qnewdoub: movl _doub_str,r0 # move next cell addr to r0 jlss callnewd # if no space, allocate incl *_lispsys+30*4 # inc count of doubs movl (r0),_doub_str # advance free list movq r4,(r0) # put baby to bed. rsb callnewd: movq r4,-(sp) # stack initial value calls $0,_newdoub movq (sp)+,(r0) # restore initial value rsb .globl _qcons # quick cons call, the car and cdr are stacked on the namestack # and this function is jsb'ed to. _qcons: movl _dtpr_str,r0 # move next cell addr to r0 jlss getnew # if ran out of space jump incl *_lispsys+28*4 # inc count of dtprs movl (r0),_dtpr_str # advance free list storit: movl -(r6),(r0) # store in cdr movl -(r6),4(r0) # store in car rsb getnew: calls $0,_newdot # must gc to get one jbr storit # now initialize it. # # Fast equivalent of newdot, entered by jsb # .globl _qnewdot _qnewdot: movl _dtpr_str,r0 # mov next cell addr t0 r0 jlss mustallo # if ran out of space incl *_lispsys+28*4 # inc count of dtprs movl (r0),_dtpr_str # advance free list clrq (r0) rsb mustallo: calls $0,_newdot rsb # prunel - return a list of dtpr cells to the free list # this is called by the pruneb after it has discarded the top bignum # the dtpr cells are linked through their cars not their cdrs. # this returns with an rsb # method of operation: the dtpr list we get is linked by car's so we # go through the list and link it by cdr's, then have the last dtpr # point to the free list and then make the free list begin at the # first dtpr. qprunel: ##### rsb # punt this for now movl r0,r2 # remember first dtpr location rep: decl *_lispsys+28*4 # decrement used dtpr count movl 4(r0),r1 # put link value into r1 jeql endoflist # if nil, then end of list movl r1,(r0) # replace cdr with save value as car movl r1,r0 # advance to next dtpr jbr rep # and loop around endoflist: movl _dtpr_str,(r0) # make last one point to free list movl r2,_dtpr_str # and free list begin at first one rsb # qpruneb - called by the arithmetic routines to free an sdot and the dtprs # which hang on it. # called by # pushl sdotaddr # jsb _qpruneb # .globl _qpruneb _qpruneb: movl 4(sp),r0 # get address decl *_lispsys+48*4 # decr count of used sdots movl _sdot_str,(r0) # have new sdot point to free list movl r0,_sdot_str # start free list at new sdot movl 4(r0),r0 # get address of first dtpr jneq qprunel # if exists, prune it rsb # else return. # _qprunei # called by the arithmetic routines to free a fixnum cell # calling sequence # pushl fixnumaddr # jsb _qprunei # .globl _qprunei _qprunei: movl 4(sp),r0 # get address of fixnum cmpl r0,start # is it a small fixnum jlss skipit # if so, leave decl *_lispsys+24*4 # decr count of used ints movl _int_str,(r0) # link the fixnum into the free list movl r0,_int_str skipit: rsb .globl _qpopnames _qpopnames: # equivalent of C-code popnames, entered by jsb. movl (sp)+,r0 # return address movl (sp)+,r1 # Lower limit movl _bnp,r2 # pointer to bind stack entry qploop: subl2 $8,r2 # for(; (--r2) > r1;) { cmpl r2,r1 # test for done jlss qpdone movl (r2),*4(r2) # r2->atm->a.clb = r2 -> val; brb qploop # } qpdone: movl r1,_bnp # restore bnp jmp (r0) # return # _qget : fast get subroutine # (get 'atom 'ind) # called with -8(r6) equal to the atom # -4(r6) equal to the indicator # no assumption is made about r7 # unfortunately, the atom may not in fact be an atom, it may # be a list or nil, which are special cases. # For nil, we grab the nil property list (stored in a special place) # and for lists we punt and call the C routine since it is most likely # and error and we havent put in error checks yet. # .data qgtbf: .word 0 # for profiling .text .globl _qget _qget: # movab qgtbf,r0 # these instructions are for profiling # jsb mcount movl -4(r6),r1 # put indicator in r1 movl -8(r6),r0 # and atom into r0 jeql nilpli # jump if atom is nil ashl $-9,r0,r2 # check type cmpb _typetable+1[r2],$1 # is it a symbol?? jneq notsymb # nope movl 4(r0),r0 # yes, put prop list in r1 to begin scan jeql fail # if no prop list, we lose right away lp: cmpl r1,4(r0) # is car of list eq to indicator? jeql good # jump if so movl *(r0),r0 # else cddr down list jneq lp # and jump if more list to go. fail: subl2 $8,r6 # unstack args rsb # return with r0 eq to nil good: movl (r0),r0 # return cadr of list movl 4(r0),r0 subl2 $8,r6 #unstack args rsb nilpli: movl _lispsys+64*4,r0 # want nil prop list, get it specially jneq lp # and process if anything there subl2 $8,r6 #unstack args rsb # else fail notsymb: movab -8(r6),r7 # must set up r7 before calling calls $0,_Lget # not a symbol, call C routine to error check subl2 $8,r6 #unstack args rsb # and return what it returned. # _qexarith exact arithmetic # calculates x=a*b+c where a,b and c are 32 bit 2's complement integers # whose top two bits must be the same (i.e. the are members of the set # of valid fixnum values for Franz Lisp). The result, x, will be 64 bits # long but since each of a, b and c had only 31 bits of precision, the # result x only has 62 bits of precision. The lower 30 bits are returned # in *plo and the high 32 bits are returned in *phi. If *phi is 0 or -1 then # x doesn't need any more than 31 bits plus sign to describe, so we # place the sign in the high two bits of *plo and return 0 from this # routine. A non zero return indicates that x requires more than 31 bits # to describe. # .globl _qexarith # qexarith(a,b,c,phi,plo) # int *phi, *plo; _qexarith: emul 4(sp),8(sp),12(sp),r2 #r2 = a*b + c to 64 bits extzv $0,$30,r2,*20(sp) #get new lo extv $30,$32,r2,r0 #get new carry beql out # hi = 0, no work necessary movl r0,*16(sp) # save hi mcoml r0,r0 # Is hi = -1 (it'll fit in one word) bneq out # it doesn't bisl2 $0xc0000000,*20(sp) # alter low so that it is ok. out: rsb # pushframe : stack a frame # When this is called, the optional arguments and class have already been # pushed on the stack as well as the return address (by virtue of the jsb) # , we push on the rest of the stuff (see h/frame.h) # for a picture of the save frame .globl _qpushframe _qpushframe: movl _errp,-(sp) movl _bnp,-(sp) movl r6,-(sp) movl r7,-(sp) pushr $0x3f00 # save r13(fp), r12(ap),r11,r10,r9,r8 movab 6*4(sp),r0 # return addr of lbot on stack clrl _retval # set retval to C_INITIAL jmp *40(sp) # return through return address # qretfromfr # called with frame to ret to in r11. The popnames has already been done. # we must restore all registers, and jump to the ret addr. the popping # must be done without reducing the stack pointer since an interrupt # could come in at any time and this frame must remain on the stack. # thus we can't use popr. # .globl _qretfromfr _qretfromfr: movl r11,r0 # return error frame location subl3 $24,r11,sp # set up sp at bottom of frame movl sp,r1 # prepare to pop off movq (r1)+,r8 # r8,r9 movq (r1)+,r10 # r10,r11 movq (r1)+,r12 # r12,r13 movl (r1)+,r7 # r7 (lbot) movl (r1)+,r6 # r6 (np) jmp *40(sp) # jump out of frame ret addr. the popping # must be done without reducing the stack pointer since an interrupt # could come in at any time and this frame must remain on the stack. # thus we can't use popr. # .globl _qretfromfr _qretfromfr: movl r11,r0 # return error frame location subl3 $24,r11,sp # set up sp at bottom of frame movl sp,r1 # prepare to pop off movq (r1)+,r8 # r8,r9 movq (r1)+,r10 # r10,r11 movq (r1)+,r12 # r1((cmd/lisp/franz/reset.s 644 0 12 3205 2552701447 10176 .asciz "@(#)reset.s 35.1 5/6/81" # C library -- reset, setexit # reset(x) # will generate a "return" from # the last call to # setexit() # by restoring r6 - r12, ap, fp # and doing a return. # The returned value is x; on the original # call the returned value is 0. # # useful for going back to the main loop # after a horrible error in a lowlevel # routine. # Changed by M. Marcus (4/4/80) to chain saved frames. Should be rewritten # to only use the stack, avoiding need for resexit and getexit. # Setexit works as before, but getexit adds pointer # to the saved block when it pushes saved state onto stack. # resexit restores this link by moving back extra word. # getexit and setexit are to be thought of as an (almost) unitary action. .globl _setexit .globl _getexit .globl _reset .globl _resexit .globl _setsav .globl _exitlnk .globl _svkludg _setexit: .word 0x0000 movab _setsav,r0 movq r6,(r0)+ movq r8,(r0)+ movq r10,(r0)+ movq 8(fp),(r0)+ # ap, fp movab 4(ap),(r0)+ # sp movl 16(fp),(r0) # pc clrl r0 ret _reset: .word 0x0000 movl 4(ap),r0 # returned value movab _setsav,r1 movq (r1)+,r6 movq (r1)+,r8 movq (r1)+,r10 movq (r1)+,r12 movl (r1)+,sp jmp *(r1) _resexit: .word 0x0000 movc3 $44,*4(ap),_setsav ret _svkludg: movl (sp)+,out movq r0,myregs movq r2,myregs+8 movq r4,myregs+16 subl2 $44,sp movc3 $44,_setsav,(sp) movq myregs,r0 movq myregs+8,r2 movq myregs+16,r4 jmp *out _getexit: .word 0x0000 movc3 $44,_setsav,*4(ap) movl 4(ap), _exitlnk ret #exitlnk is to be thought of as the last word of the setsav area (11 longs long) .data _setsav:.space 10*4 _exitlnk:.space 4 out: .space 4 myregs: .space 6*4 (r1)+,r12 movl (r1)+,sp jmp *(r1) _resexit: .word 0x0000 movc3 $44,*4(ap),_setsav ret _svkludg: movl (sp)+,out movq r0,myregs movq r2,myregs+8 movq r4,myregs+16 subl2 $44,sp movc3 $44,_setsav,(sp) movq myregs,r0 movq myregs+8,r2 movq myregs+16,r4 jmp *out _getexit: .word 0x0000 movc3 $44,_setsav,*4(ap) movl 4(ap), _exitlnk ret #exitlnk is to be thought ocmd/lisp/franz/rlc.c 644 0 12 461 2552701450 7567 static char *sccsid = "@(#)rlc.c 35.1 5/6/81"; #define TRUE 1 extern char holend[], end[]; extern int usehole; extern char *curhbeg; rlc() { char *cp, *dp; brk(end); dp = holend; cp = dp - HOLE; while (dp < end) *dp++ = *cp++; curhbeg = holend - HOLE; /* set up the hole */ usehole = TRUE; } subl2 $44,sp movc3 $44,_setsav,(sp) movq myregs,r0 movq myregs+8,r2 movq myregs+16,r4 jmp *out _getexit: .w/|,|5H< /,"cmd/lisp/franz/subbig.c 644 0 12 1361 2552701450 10302 static char *sccsid = "@(#)subbig.c 35.1 5/6/81"; #include "global.h" lispval subbig(pos,neg) lispval pos, neg; { register lispval work; int *sp(); lispval adbig(); register int *mysp = sp() - 2; register int *ersatz = mysp; snpand(3); for(work = neg; work!=0; work = work->s.CDR) { stack(-work->i, (mysp -= 2)); } mysp[3] = 0; return(adbig(pos,ersatz)); } /* * subbig -- subtract one bignum from another. * * What this does is it negates each coefficient of a copy of the bignum * which is just pushed on the stack for convenience. This may give rise * to a bignum which is not in canonical form, but is nonetheless a repre * sentation of a bignum. Addbig then adds it to a bignum, and produces * a result in canonical form. */ ; for(work = neg; work!=0; work = work->s.CDR) { stack(-work->i, (mysp -= 2)); } mysp[3] = 0; return(adbig(pos,ersatz)); } /* * subbig -- subtract one bignum from another. * * What this does is it negates each coefficient of a copy of the bignum * which is juscmd/lisp/franz/sysat.c 644 0 12 51344 2552701452 10222 static char *sccsid = "@(#)sysat.c 35.7 7/9/81"; #include "global.h" #include "lfuncs.h" #define MK(x,y,z) mfun(x,y,z) #define FIDDLE(z,b,c,y) z->a.clb=newdot(); (z->a.clb->d.car=newint())->i=b->i; \ z->a.clb->d.cdr=newdot(); (z->a.clb->d.cdr->d.car=newint())->i=c->i; \ z->a.clb->d.cdr->d.cdr=newdot(); (z->a.clb->d.cdr->d.cdr->d.car=newint())->i=y; \ b = z->a.clb->d.car; c = z->a.clb->d.cdr->d.car; \ copval(z,z->a.clb); z->a.clb = nil; #define cforget(x) protect(x); Lforget(); unprot(); /* The following array serves as the temporary counters of the items */ /* and pages used in each space. */ long int tint[2*NUMSPACES]; extern int tgcthresh; extern int initflag; /* starts off TRUE to indicate unsafe to gc */ extern int *beginsweep; /* place for garbage collector to begin sweeping */ #define PAGE_LIMIT 3800 extern Iaddstat(); makevals() { int i; lispval temp; /* system list structure and atoms are initialized. */ /* Before any lisp data can be created, the space usage */ /* counters must be set up, temporarily in array tint. */ atom_items = (lispval) &tint[0]; atom_pages = (lispval) &tint[1]; str_items = (lispval) &tint[2]; str_pages = (lispval) &tint[3]; int_items = (lispval) &tint[4]; int_pages = (lispval) &tint[5]; dtpr_items = (lispval) &tint[6]; dtpr_pages = (lispval) &tint[7]; doub_items = (lispval) &tint[8]; doub_pages = (lispval) &tint[9]; sdot_items = (lispval) &tint[10]; sdot_pages = (lispval) &tint[11]; array_items = (lispval) &tint[12]; array_pages = (lispval) &tint[13]; val_items = (lispval) &tint[14]; val_pages = (lispval) &tint[15]; funct_items = (lispval) &tint[16]; funct_pages = (lispval) &tint[17]; for (i=0; i < 8; i++) { hunk_pages[i] = (lispval) &tint[18+i*2]; hunk_items[i] = (lispval) &tint[19+i*2]; } /* This also applies to the garbage collection threshhold */ gcthresh = (lispval) &tgcthresh; /* Now we commence constructing system lisp structures. */ /* nil is a special case, constructed especially at location zero */ hasht[hashfcn("nil")] = (struct atom *)nil; /* allocate space for namestack and bindstack first * then set up beginsweep variable so that the sweeper will * ignore these `always in use' pages */ lbot = orgnp = np = ((struct argent *)csegment(val_name,NAMESIZE,FALSE)); orgbnp = bnp = ((struct nament *)csegment(dtpr_name,NAMESIZE,FALSE)); beginsweep = (int *) xsbrk(0); /* * Names of various spaces and things */ atom_name = matom("symbol"); str_name = matom("string"); int_name = matom("fixnum"); dtpr_name = matom("list"); doub_name = matom("flonum"); sdot_name = matom("bignum"); array_name = matom("array"); val_name = matom("value"); funct_name = matom("binary"); port_name = matom("port"); /* not really a space */ { char name[6]; strcpy(name, "hunk0"); for (i=0; i< 8; i++) { hunk_name[i] = matom(name); name[4]++; } } /* set up the name stack as an array of pointers */ nplim = orgnp+NAMESIZE-6*NAMINC; temp = matom("namestack"); nstack = temp->a.fnbnd = newarray(); nstack->ar.data = (char *) (np); (nstack->ar.length = newint())->i = NAMESIZE; (nstack->ar.delta = newint())->i = sizeof(struct argent); Vnogbar = matom("unmarked_array"); /* marking of the namestack will be done explicitly in gc1 */ (nstack->ar.aux = newdot())->d.car = Vnogbar; /* set up the binding stack as an array of dotted pairs */ bnplim = orgbnp+NAMESIZE-5; temp = matom("bindstack"); bstack = temp->a.fnbnd = newarray(); bstack->ar.data = (char *) (bnp); (bstack->ar.length = newint())->i = NAMESIZE; (bstack->ar.delta = newint())->i = sizeof(struct nament); /* marking of the bindstack will be done explicitly in gc1 */ (bstack->ar.aux = newdot())->d.car = Vnogbar; /* more atoms */ tatom = matom("t"); tatom->a.clb = tatom; lambda = matom("lambda"); nlambda = matom("nlambda"); macro = matom("macro"); ibase = matom("ibase"); /* base for input conversion */ ibase->a.clb = inewint(10); rsetatom = matom("*rset"); rsetatom->a.clb = nil; Vsubrou = matom("subroutine"); Vpiport = matom("piport"); Vpiport->a.clb = P(piport = stdin); /* standard input */ Vpoport = matom("poport"); Vpoport->a.clb = P(poport = stdout); /* stand. output */ matom("errport")->a.clb = (P(errport = stderr));/* stand. err. */ ioname[PN(stdin)] = (lispval) inewstr("$stdin"); ioname[PN(stdout)] = (lispval) inewstr("$stdout"); ioname[PN(stderr)] = (lispval) inewstr("$stderr"); (Vreadtable = matom("readtable"))->a.clb = Imkrtab(0); strtab = Imkrtab(0); Vptport = matom("ptport"); ((Vptport->a.clb = nil; /* protocal port */ Vcntlw = matom("^w"); /* when non nil, inhibits output to term */ Vcntlw->a.clb = nil; Vldprt = matom("$ldprint"); /* when nil, inhibits printing of fasl/autoload */ /* cfasl messages to term */ Vldprt->a.clb = tatom; Vprinlevel = matom("prinlevel"); /* printer recursion count */ Vprinlevel->a.clb = nil; /* infinite recursion */ Vprinlength = matom("prinlength"); /* printer element count */ Vprinlength->a.clb = nil; /* infinite elements */ Vfloatformat = matom("float-format"); Vfloatformat->a.clb = (lispval) inewstr("%.16G"); Verdepth = matom("Error-Depth"); Verdepth->a.clb = inewint(0); /* depth of error */ /* The following atoms are used as tokens by the reader */ perda = matom("."); lpara = matom("("); rpara = matom(")"); lbkta = matom("["); rbkta = matom("]"); snqta = matom("'"); exclpa = matom("!"); (Eofa = matom("eof"))->a.clb = eofa; cara = MK("car",Lcar,lambda); cdra = MK("cdr",Lcdr,lambda); /* The following few atoms have values the reader tokens. */ /* Perhaps this is a kludge which should be abandoned. */ /* On the other hand, perhaps it is an inspiration. */ matom("perd")->a.clb = perda; matom("lpar")->a.clb = lpara; matom("rpar")->a.clb = rpara; matom("lbkt")->a.clb = lbkta; matom("rbkt")->a.clb = rbkta; noptop = matom("noptop"); /* atoms used in connection with comments. */ commta = matom("comment"); rcomms = matom("readcomments"); /* the following atoms are used for lexprs */ lexpr_atom = matom("last lexpr binding\7"); lexpr = matom("lexpr"); /* the following atom is used to reference the bind stack for eval */ bptr_atom = matom("eval1 binding pointer\7"); bptr_atom->a.clb = nil; /* the following atoms are used for evalhook hackery */ evalhatom = matom("evalhook"); evalhatom->a.clb = nil; evalhcallsw = FALSE; funhatom = matom("funcallhook"); funhatom->a.clb = nil; funhcallsw = FALSE; Vevalframe = matom("evalframe"); sysa = matom("sys"); plima = matom("pagelimit"); /* max number of pages */ Veval = MK("eval",Leval1,lambda); MK("asin",Lasin,lambda); MK("acos",Lacos,lambda); MK("atan",Latan,lambda); MK("cos",Lcos,lambda); MK("sin",Lsin,lambda); MK("sqrt",Lsqrt,lambda); MK("exp",Lexp,lambda); MK("log",Llog,lambda); MK("lsh",Llsh,lambda); MK("bignum-leftshift",Lbiglsh,lambda); MK("sticky-bignum-leftshift",Lsbiglsh,lambda); MK("frexp",Lfrexp,lambda); MK("rot",Lrot,lambda); MK("random",Lrandom,lambda); MK("atom",Latom,lambda); MK("apply",Lapply,lambda); MK("funcall",Lfuncal,lambda); MK("return",Lreturn,lambda); /* MK("cont",Lreturn,lambda); */ MK("cons",Lcons,lambda); MK("scons",Lscons,lambda); MK("bignum-to-list",Lbigtol,lambda); MK("cadr",Lcadr,lambda); MK("caar",Lcaar,lambda); MK("cddr",Lc02r,lambda); MK("caddr",Lc12r,lambda); MK("cdddr",Lc03r,lambda); MK("cadddr",Lc13r,lambda); MK("cddddr",Lc04r,lambda); MK("caddddr",Lc14r,lambda); MK("nthelem",Lnthelem,lambda); MK("eq",Leq,lambda); MK("equal",Lequal,lambda); MK("zqual",Zequal,lambda); MK("numberp",Lnumberp,lambda); MK("dtpr",Ldtpr,lambda); MK("bcdp",Lbcdp,lambda); MK("portp",Lportp,lambda); MK("arrayp",Larrayp,lambda); MK("valuep",Lvaluep,lambda); MK("get_pname",Lpname,lambda); MK("ptr",Lptr,lambda); MK("arrayref",Larrayref,lambda); MK("marray",Lmarray,lambda); MK("getlength",Lgetl,lambda); MK("putlength",Lputl,lambda); MK("getaccess",Lgeta,lambda); MK("putaccess",Lputa,lambda); MK("getdelta",Lgetdel,lambda); MK("putdelta",Lputdel,lambda); MK("getaux",Lgetaux,lambda); MK("putaux",Lputaux,lambda); MK("getdata",Lgetdata,lambda); MK("putdata",Lputdata,lambda); MK("mfunction",Lmfunction,lambda); MK("getentry",Lgetentry,lambda); MK("getdisc",Lgetdisc,lambda); MK("putdisc",Lputdisc,lambda); MK("segment",Lsegment,lambda); MK("rplaca",Lrplaca,lambda); MK("rplacd",Lrplacd,lambda); MK("set",Lset,lambda); MK("replace",Lreplace,lambda); MK("infile",Linfile,lambda); MK("outfile",Loutfile,lambda); MK("terpr",Lterpr,lambda); MK("print",Lprint,lambda); MK("close",Lclose,lambda); MK("patom",Lpatom,lambda); MK("pntlen",Lpntlen,lambda); MK("read",Lread,lambda); MK("ratom",Lratom,lambda); MK("readc",Lreadc,lambda); MK("implode",Limplode,lambda); MK("maknam",Lmaknam,lambda); MK("concat",Lconcat,lambda); MK("uconcat",Luconcat,lambda); MK("putprop",Lputprop,lambda); MK("monitor",Lmonitor,lambda); MK("get",Lget,lambda); MK("getd",Lgetd,lambda); MK("putd",Lputd,lambda); MK("prog",Nprog,nlambda); quota = MK("quote",Nquote,nlambda); MK("function",Nfunction,nlambda); MK("go",Ngo,nlambda); MK("*catch",Ncatch,nlambda); MK("errset",Nerrset,nlambda); MK("status",Nstatus,nlambda); MK("sstatus",Nsstatus,nlambda); MK("err",Lerr,lambda); MK("*throw",Nthrow,lambda); /* this is a lambda now !! */ reseta = MK("reset",Nreset,nlambda); MK("break",Nbreak,nlambda); MK("exit",Lexit,lambda); MK("def",Ndef,nlambda); MK("null",Lnull,lambda); /* debugging, remove when done */ { lispval Lframedump(); MK("framedump",Lframedump,lambda); } MK("and",Nand,nlambda); MK("or",Nor,nlambda); MK("setq",Nsetq,nlambda); MK("cond",Ncond,nlambda); MK("list",Llist,lambda); MK("load",Lload,lambda); MK("nwritn",Lnwritn,lambda); MK("process",Nprocess,nlambda); /* execute a shell command */ MK("allocate",Lalloc,lambda); /* allocate a page */ MK("sizeof",Lsizeof,lambda); /* size of one item of a data type */ MK("odumplisp",Ndumplisp,nlambda); /* OLD save the world */ MK("dumplisp",Nndumplisp,nlambda); /* NEW save the world */ #ifdef VMS MK("savelisp",Lsavelsp,lambda); /* save lisp data */ MK("restorelisp",Lrestlsp,lambda); #endif MK("top-level",Ntpl,nlambda); /* top level eval-print read loop */ startup = matom("startup"); /* used by save and restore */ MK("mapcar",Lmapcar,lambda); MK("maplist",Lmaplist,lambda); MK("mapcan",Lmapcan,lambda); MK("mapcon",Lmapcon,lambda); MK("assq",Lassq,lambda); MK("mapc",Lmapc,lambda); MK("map",Lmap,lambda); MK("flatc",Lflatsi,lambda); MK("alphalessp",Lalfalp,lambda); MK("drain",Ldrain,lambda); MK("killcopy",Lkilcopy,lambda); /* forks aand aborts for adb */ MK("opval",Lopval,lambda); /* sets and retrieves system variables */ MK("ncons",Lncons,lambda); sysa = matom("sys"); /* sys indicator for system variables */ MK("remob",Lforget,lambda); /* function to take atom out of hash table */ splice = matom("splicing"); MK("not",Lnull,lambda); MK("plus",Ladd,lambda); MK("add",Ladd,lambda); MK("times",Ltimes,lambda); MK("difference",Lsub,lambda); MK("quotient",Lquo,lambda); MK("+",Lfp,lambda); MK("-",Lfm,lambda); MK("*",Lft,lambda); MK("/",Lfd,lambda); MK("mod",Lmod,lambda); MK("minus",Lminus,lambda); MK("absval",Labsval,lambda); MK("add1",Ladd1,lambda); MK("sub1",Lsub1,lambda); MK("greaterp",Lgreaterp,lambda); MK("lessp",Llessp,lambda); MK("any-zerop",Lzerop,lambda); /* used when bignum arg possible */ MK("zerop",Lzerop,lambda); MK("minusp",Lnegp,lambda); MK("onep",Lonep,lambda); MK("sum",Ladd,lambda); MK("product",Ltimes,lambda); MK("do",Ndo,nlambda); MK("progv",Nprogv,nlambda); MK("progn",Nprogn,nlambda); MK("prog2",Nprog2,nlambda); MK("oblist",Loblist,lambda); MK("baktrace",Lbaktrace,lambda); MK("tyi",Ltyi,lambda); MK("tyipeek",Ltyipeek,lambda); MK("tyo",Ltyo,lambda); MK("setsyntax",Lsetsyn,lambda); MK("makereadtable",Lmakertbl,lambda); MK("zapline",Lzapline,lambda); MK("aexplode",Lexplda,lambda); MK("aexplodec",Lexpldc,lambda); MK("aexploden",Lexpldn,lambda); MK("hashtabstat",Lhashst,lambda); #ifdef METER MK("gcstat",Lgcstat,lambda); #endif MK("argv",Largv,lambda); MK("arg",Larg,lambda); MK("setarg",Lsetarg,lambda); MK("showstack",Lshostk,lambda); MK("freturn",Lfretn,lambda); MK("*rset",Lrset,lambda); MK("eval1",Leval1,lambda); MK("evalframe",Levalf,lambda); MK("evalhook",Levalhook,lambda); MK("funcallhook",Lfunhook,lambda); MK("resetio",Nresetio,nlambda); MK("chdir",Lchdir,lambda); MK("ascii",Lascii,lambda); MK("boole",Lboole,lambda); MK("type",Ltype,lambda); /* returns type-name of argument */ MK("fix",Lfix,lambda); MK("float",Lfloat,lambda); MK("fact",Lfact,lambda); MK("cpy1",Lcpy1,lambda); MK("Divide",LDivide,lambda); MK("Emuldiv",LEmuldiv,lambda); MK("readlist",Lreadli,lambda); MK("plist",Lplist,lambda); /* gives the plist of an atom */ MK("setplist",Lsetpli,lambda); /* get plist of an atom */ MK("eval-when",Nevwhen,nlambda); MK("syscall",Lsyscall,lambda); MK("intern",Lintern,lambda); MK("ptime",Lptime,lambda); /* return process user time */ MK("fork",Lfork,lambda); /* turn on fork and wait */ MK("wait",Lwait,lambda); /* MK("pipe",Lpipe,lambda); MK("fdopen",Lfdopen,lambda); */ MK("exece",Lexece,lambda); MK("gensym",Lgensym,lambda); MK("remprop",Lremprop,lambda); MK("bcdad",Lbcdad,lambda); MK("symbolp",Lsymbolp,lambda); MK("stringp",Lstringp,lambda); MK("rematom",Lrematom,lambda); MK("prname",Lprname,lambda); MK("getenv",Lgetenv,lambda); MK("I-throw-err",Lctcherr,lambda); /* directly force a throw or error */ MK("makunbound",Lmakunb,lambda); MK("haipart",Lhaipar,lambda); MK("haulong",Lhau,lambda); MK("signal",Lsignal,lambda); MK("fasl",Lnfasl,lambda); /* NEW - new fasl loader */ MK("cfasl",Lcfasl,lambda); /* read in compiled C file */ MK("getaddress",Lgetaddress,lambda); /* bind symbols without doing cfasl */ MK("removeaddress",Lrmadd,lambda); /* unbind symbols */ MK("boundp",Lboundp,lambda); /* tells if an atom is bound */ MK("fake",Lfake,lambda); /* makes a fake lisp pointer */ MK("od",Lod,lambda); /* dumps info */ MK("maknum",Lmaknum,lambda); /* converts a pointer to an integer */ MK("*mod",LstarMod,lambda); /* return fixnum modulus */ MK("fseek",Lfseek,lambda); /* seek to a specific byte in a file */ MK("fileopen", Lfileopen, lambda); /* open a file for read/write/append */ MK("pv%",Lpolyev,lambda); /* polynomial evaluation instruction */ MK("cprintf",Lcprintf,lambda); /* formatted print */ MK("copyint*",Lcopyint,lambda); /* copyint* */ MK("purcopy",Lpurcopy,lambda); /* pure copy */ MK("purep",Lpurep,lambda); /* check if pure */ /* * Hunk stuff */ MK("*makhunk",LMakhunk,lambda); ((/* special hunk creater */ MK("hunkp",Lhunkp,lambda); /* test a hunk */ MK("cxr",Lcxr,lambda); /* cxr of a hunk */ MK("rplacx",Lrplacx,lambda); /* replace element of a hunk */ MK("*rplacx",Lstarrpx,lambda); /* rplacx used by hunk */ MK("hunksize",Lhunksize,lambda); /* size of a hunk */ MK("probef",Lprobef,lambda); /* test file existance */ MK("substring",Lsubstring,lambda); MK("substringn",Lsubstringn,lambda); odform = matom("odformat"); /* format for printf's used in od */ rdrsdot = newsdot(); /* used in io conversions of bignums */ rdrsdot2 = newsdot(); /* used in io conversions of bignums */ rdrint = newint(); /* used as a temporary integer */ (nilplist = newdot())->d.cdr = newdot(); /* used as property list for nil, since nil will eventually be put at 0 (consequently in text and not writable) */ /* error variables */ (Vererr = matom("ER%err"))->a.clb = nil; (Vertpl = matom("ER%tpl"))->a.clb = nil; (Verall = matom("ER%all"))->a.clb = nil; (Vermisc = matom("ER%misc"))->a.clb = nil; (Verbrk = matom("ER%brk"))->a.clb = nil; (Verundef = matom("ER%undef"))->a.clb = nil; (Vlerall = newdot())->d.car = Verall; /* list (ER%all) */ (Veruwpt = matom("ER%unwind-protect"))->a.clb = nil; (Verrset = matom("errset"))->a.clb = nil; /* set up the initial status list */ stlist = nil; /* initially nil */ Iaddstat(matom("features"),ST_READ,ST_NO,nil); Iaddstat(matom("feature"),ST_FEATR,ST_FEATW,nil); Isstatus(matom("feature"),matom("franz")); Isstatus(matom("feature"),matom(OS)); Isstatus(matom("feature"),matom("string")); Isstatus(matom("feature"),matom(MACHINE)); Isstatus(matom("feature"),matom(SITE)); Iaddstat(matom("nofeature"),ST_NFETR,ST_NFETW,nil); Iaddstat(matom("syntax"),ST_SYNT,ST_NO,nil); Iaddstat(matom("uctolc"),ST_READ,ST_TOLC,nil); Iaddstat(matom("dumpcore"),ST_READ,ST_CORE,nil); Isstatus(matom("dumpcore"),nil); /*set up signals*/ Iaddstat(matom("chainatom"),ST_RINTB,ST_INTB,inewint(0)); Iaddstat(matom("dumpmode"),ST_DMPR,ST_DMPW,nil); Iaddstat(matom("appendmap"),ST_READ,ST_SET,nil); /* used by fasl */ Iaddstat(matom("debugging"),ST_READ,ST_SET,nil); Iaddstat(matom("evalhook"),ST_RINTB,ST_INTB,inewint(3)); Isstatus(matom("evalhook"),nil); /*evalhook switch off */ Iaddstat(matom("bcdtrace"),ST_READ,ST_BCDTR,nil); Iaddstat(matom("ctime"),ST_CTIM,ST_NO,nil); Iaddstat(matom("localtime"),ST_LOCT,ST_NO,nil); Iaddstat(matom("isatty"),ST_ISTTY,ST_NO,nil); Iaddstat(matom("ignoreeof"),ST_READ,ST_SET,nil); Iaddstat(matom("version"),ST_READ,ST_NO,mstr("Franz Lisp, Opus 36")); Iaddstat(matom("automatic-reset"),ST_READ,ST_AUTR,nil); Iaddstat(matom("translink"),ST_READ,ST_TRAN,nil); Isstatus(matom("translink"),tatom); /* turn on tran links */ Iaddstat(matom("undeffunc"),ST_UNDEF,ST_NO,nil); /* list undef funcs */ /* garbage collector things */ MK("gc",Ngc,nlambda); gcafter = MK("gcafter",Ngcafter,nlambda); /* garbage collection wind-up */ gcport = matom("gcport"); /* port for gc dumping */ gccheck = matom("gccheck"); /* flag for checking during gc */ gcdis = matom("gcdisable"); /* variable for disabling the gc */ gcdis->a.clb = nil; gcload = matom("gcload"); /* option for gc while loading */ loading = matom("loading"); /* flag--in loader if = t */ noautot = matom("noautotrace"); /* option to inhibit auto-trace */ (gcthresh = newint())->i = tgcthresh; gccall1 = newdot(); gccall2 = newdot(); /* used to call gcafter */ gccall1->d.car = gcafter; /* start constructing a form for eval */ arrayst = mstr("ARRAY"); /* array marker in name stack */ bcdst = mstr("BINARY"); /* binary function marker */ listst = mstr("INTERPRETED"); /* interpreted function marker */ macrost = mstr("MACRO"); /* macro marker */ protst = mstr("PROTECTED"); /* protection marker */ badst = mstr("BADPTR"); /* bad pointer marker */ argst = mstr("ARGST"); /* argument marker */ hunkfree = mstr("EMPTY"); /* empty hunk cell value */ /* type names */ FIDDLE(atom_name,atom_items,atom_pages,ATOMSPP); FIDDLE(str_name,str_items,str_pages,STRSPP); FIDDLE(int_name,int_items,int_pages,INTSPP); FIDDLE(dtpr_name,dtpr_items,dtpr_pages,DTPRSPP); FIDDLE(doub_name,doub_items,doub_pages,DOUBSPP); FIDDLE(sdot_name,sdot_items,sdot_pages,SDOTSPP); FIDDLE(array_name,array_items,array_pages,ARRAYSPP); FIDDLE(val_name,val_items,val_pages,VALSPP); FIDDLE(funct_name,funct_items,funct_pages,BCDSPP); FIDDLE(hunk_name[0], hunk_items[0], hunk_pages[0], HUNK2SPP); FIDDLE(hunk_name[1], hunk_items[1], hunk_pages[1], HUNK4SPP); FIDDLE(hunk_name[2], hunk_items[2], hunk_pages[2], HUNK8SPP); FIDDLE(hunk_name[3], hunk_items[3], hunk_pages[3], HUNK16SPP); FIDDLE(hunk_name[4], hunk_items[4], hunk_pages[4], HUNK32SPP); FIDDLE(hunk_name[5], hunk_items[5], hunk_pages[5], HUNK64SPP); FIDDLE(hunk_name[6], hunk_items[6], hunk_pages[6], HUNK128SPP); (plimit = newint())->i = PAGE_LIMIT; copval(plima,plimit); /* default value */ /* the following atom is used when reading caar, cdar, etc. */ xatom = matom("??"); /* now it is OK to collect garbage */ initflag = FALSE; } /* matom("name") ******************************************************/ /* */ /* simulates an atom being read in from the reader and returns a */ /* pointer to it. */ /* */ /* BEWARE: if an atom becomes "truly worthless" and is collected, */ /* the pointer becomes obsolete. */ /* */ lispval matom(string) char *string; { strbuf[0] = 0; strcatn(strbuf,string,STRBLEN); return(getatom()); } /* mstr ***************************************************************/ /* */ /* Makes a string. Uses matom. */ /* Not the most efficient but will do until the string from the code */ /* itself can be used as a lispval. */ lispval mstr(string) char *string; { return((lispval)(inewstr(string))); } /* mfun("name",entry) *************************************************/ /* */ /* Same as matom, but entry point to c code is associated with */ /* "name" as function binding. */ /* A pointer to the atom is returned. */ /* */ lispval mfun(string,entry,discip) char *string; lispval (*entry)(), discip; { lispval v; v = matom(string); v->a.fnbnd = newfunct(); v->a.fnbnd->bcd.entry = entry; v->a.fnbnd->bcd.discipline = discip; return(v); } (lispval)(inewstr(string))); } /* mfun("name",entry) *************************************************/ /* */ /* Same as matom, but entry point to c code is associated with */ /* "name" as function binding. */ /* A pointer to the atom is returned. */ /* cmd/lisp/franz/tackon.c 644 0 12 3522 2423771152 10312 #include #include #include #include FILE *map; int aout; #define NEWSIZ 50000 char newstrb[NEWSIZ]; main(argc, argv) int argc; char *argv[]; { char sym[50], svalue[50]; char *strb,*newstr,*malloc(); char *curstr; int value; int cnt; int strsiz; int strcnt; int size; struct nlist a; struct exec e; argc--, argv++; if (argc == 0 || argc > 2) { usage: fprintf(stderr, "usage: tackon map [ a.out ]\n"); exit(1); } map = fopen(argv[0], "r"); if (map == NULL) { perror(argv[0]); exit(1); } aout = open(argc == 2 ? argv[1] : "a.out", 2); if (aout < 0) { printf(" No object file to tackon or text busy\n"); exit(1); } read(aout,&e, sizeof(e)); /* read current string table into buffer */ lseek(aout, N_STROFF(e), 0); /* seek to string table beginning */ read(aout,&strsiz,4); /* read in string table size */ strb = malloc(strsiz); read(aout,strb,strsiz); /* read in string table */ lseek(aout, N_STROFF(e), 0); /* now write at end of symbols */ cnt = 0; strcnt = 4 + strsiz; curstr = newstrb; /* point to new string buffer */ for (;;) { if (fgets(sym, 50, map) == NULL) break; sym[size=strlen(sym)-1] = 0; if (fgets(svalue, 50, map) == NULL) { fprintf(stderr, "missing value\n"); break; } strcpy(curstr,sym); sscanf(svalue, "%x", &a.n_value); a.n_un.n_strx = strcnt; a.n_type = N_EXT|N_TEXT; write(aout, &a, sizeof (a)); curstr += size+1; strcnt += size+1; cnt++; if( curstr >= &newstrb[NEWSIZ]) { printf(" Tackon; string buffer overflow \n"); exit(1); } } write(aout, &strcnt, 4); /* new character count */ write(aout, strb, strsiz); /* write out old string table */ write(aout, newstrb, strcnt - ( 4 + strsiz)); lseek(aout, 0, 0); e.a_syms += cnt*sizeof(struct nlist); lseek(aout, 0, 0); write(aout, &e, sizeof (e)); exit(0); } .n_strx = strcnt; a.n_type = N_EXT|N_TEXT; write(aout, &a, sizeof (a)); curstr += size+1; strcnt += size+1; cnt++; if( curstr >= &newstrb[NEWSIZ]) { printf("cmd/lisp/franz/trace.c 644 0 12 6326 2552701452 10135 static char *sccsid = "@(#)trace.c 35.2 7/7/81"; #include "global.h" lispval Leval1(){ register struct nament *bindptr; register lispval handy; snpand(2); if (np-lbot == 2) { /*if two arguments to eval */ if (TYPE((lbot+1)->val) != INT) error("Eval: 2nd arg not legal alist pointer", FALSE); bindptr = orgbnp + (lbot+1)->val->i; if (rsetsw == 0 || rsetatom->a.clb == nil) error("Not in *rsetmode; second arg is useless - eval", TRUE); if (bptr_atom->a.clb != nil) error("WARNI((NG - Nesting 2nd args to eval will give spurious values", TRUE); if (bindptr < orgbnp || bindptr >bnplim) error("Illegal pdl pointer as 2nd arg - eval", FALSE); handy = newdot(); handy->d.car = (lispval)bindptr; handy->d.cdr = (lispval)bnp; PUSHDOWN(bptr_atom, handy); handy = eval(lbot->val); POP; return(handy); } else { /* normal case - only one arg */ chkarg(1,"eval"); handy = eval(lbot->val); return(handy); }; } lispval Levalhook() { register lispval handy; register lispval funhval = CNIL; switch (np-lbot) { case 2: break; case 3: funhval = (lbot+2)->val; break; default: argerr("evalhook"); } if (evalhsw == 0) error("evalhook called before doing sstatus-evalhook", TRUE); if (rsetsw == 0 || rsetatom->a.clb == nil) error("evalhook called while not in *rset mode", TRUE); if(funhval != CNIL) { PUSHDOWN(funhatom,funhval); } PUSHDOWN(evalhatom,(lispval)(lbot+1)->val); /* eval checks evalhcall to see if this is a LISP call to evalhook in which case it avoids call to evalhook function, but clobbers value to nil so recursive calls will check. */ evalhcallsw = TRUE; handy = eval(lbot->val); POP; if(funhval != CNIL) { POP; } return(handy); } lispval Lfunhook() { register lispval handy; register lispval evalhval = CNIL; Savestack(2); switch (np-lbot) { case 2: break; case 3: evalhval = (lbot+2)->val; break; default: argerr("funcallhook"); } if (evalhsw == 0) error("funcallhook called before doing sstatus-evalhook", TRUE); if (rsetsw == 0 || rsetatom->a.clb == nil) error("funcallhook called while not in *rset mode", TRUE); handy = lbot->val; while (TYPE(handy) != DTPR) handy = errorh(Vermisc,"funcallhook: first arg must be a list",nil,TRUE, 0,handy); if(evalhval != CNIL) { PUSHDOWN(evalhatom,evalhval); } PUSHDOWN(funhatom,(lispval)(lbot+1)->val); /* funcall checks funcallhcall to see if this is a LISP call to evalhook in which case it avoids call to evalhook function, but clobbers value to nil so recursive calls will check. */ funhcallsw = TRUE; /* * the first argument to funhook is a list of already evaluated expressions * which we just stack can call funcall on */ lbot = np; /* base of new args */ for ( ; handy != nil ; handy = handy->d.cdr) { protect(handy->d.car); } handy = Lfuncal(); POP; if(evalhval != CNIL) { POP; } Restorestack(); return(handy); } lispval Lrset () { chkarg(1,"rset"); rsetsw = (lbot->val == nil) ? 0 : 1; rsetatom->a.clb = (lbot->val == nil) ? nil: tatom; evalhcallsw = FALSE; return(lbot->val); } already evaluated expressions * which we just stack can call funcall on */ lbot = np; /* base of new args */ for ( ; handy != nil ; handy = handy->d.cdr) { protect(handy->d.car); } handy = Lfuncal(); POP; if(evalhval != CNIL) { POP; } Restorestack(); cmd/lisp/franz/vsyscall.s 644 0 12 556 2552701452 10676 .asciz "@(#)vsyscall.s 35.1 5/6/81" .globl _vsyscall .globl cerror _vsyscall: .word 0x0000 movl 4(ap),r0 # point at arg array movl (r0)+,r1 # syscall number movl $10,r2 Loop: pushl (r0)[r2] # push argument sobgeq r2,Loop # push 10 arguments pushl $10 # arg count movl sp,ap # point at args chmk r1 # do it bcs L1 ret L1: jmp cerror andy = handy->d.cdr) { protect(handy->d.car); /|,|5< /,"cmd/lisp/franz/VMS/ 775 0 12 0 2527315327 7252 cmd/lisp/franz/VMS/Makefile 644 0 12 4673 2505515335 11004 # # Evans Vax 11/780 # Caution: this make file will not work on unix TS systems! # HOLE= 2097152 #if you change this you must recompile rlc.c TOBJS = crt0.o lisp.o eval.o eval2.o Talloc.o inits.o io.o error.o sysat.o data.o\ lam1.o lam2.o lam3.o lam4.o lam5.o lam6.o lam7.o lam8.o lamr.o lamnop.o\ fex1.o fex2.o fex3.o fex4.o fexr.o\ reset.o fpipe.o dmcount.o bigmath.o\ subbig.o pbignum.o divbig.o inewint.o ffasl.o nfasl.o vsyscall.o\ qfuncl.o trace.o evalf.o filbuf.o lamgc.o # backquote.o auxfns0.o HOBJS = hcrt0.o rlc.o lisp.o eval.o eval2.o Salloc.o inits.o io.o error.o sysat.o data.o\ lam1.o lam2.o lam3.o lam4.o lam5.o lam6.o lam7.o lam8.o lamr.o lamnop.o\ fex1.o fex2.o fex3.o fex4.o fexr.o\ reset.o fpipe.o bigmath.o dmcount.o\ subbig.o pbignum.o divbig.o inewint.o nfasl.o ffasl.o vsyscall.o\ qfuncl.o trace.o evalf.o filbuf.o lamgc.o GLOB = h/global.h h/sigtab.h CFLAGS = -O -Ih -DVMS# -p # -g D = /tmp T = $(DESTDIR) LLIB = $T/usr/lib/lisp .SUFFIXES : .c.l .c.o : @echo cc -c -O $*.c;\ /lib/cpp $< -Ih -DVMS | /lib/ccom | fixmask | sed -f fixpbig.e |\ /lib/c2 > VMS/S/$*.s ;\ as -o $*.o VMS/S/$*.s .l.o : liszt $< > #resc @echo liszt $< done tlisp: fixmask ${TOBJS} ${LLIB}/nld rm -f tlisp ld -x -o tlisp -e start ${TOBJS} -lnm -lc ls -l tlisp hlisp: fixmask ${HOBJS} ${LLIB}/nld rm -f hlisp ld -x -H $(HOLE) -o hlisp -e hstart ${HOBJS} -lnm -lc ls -l hlisp # ${OBJS}: ${GLOB} data.o: h/sigtab.h rlc.o: rlc.c cc -c -O -DHOLE=${HOLE} rlc.c Salloc.o: Talloc.c (echo "# define HOLE"; cat Talloc.c) > Zalloc.c ; make Zalloc.o;\ rm Zalloc.c; mv Zalloc.o Salloc.o fixmask: fixmask.c cc -O -o fixmask fixmask.c clean: rm -f *.o tlisp hlisp map ?resc fixmask print: @pr READ* @pr *akefile* @(size lisp ; size *.o) | pr -h sizes @ls -ls | pr @pr *.h *.c *.s lint: lint *.h *.c tape: tar crv Makefile [a-z]*.[cshxe] /usr/lib/lisp install: mylisp mv mylisp $T/usr/ucb/lisp chmod 1755 $T/usr/ucb/lisp @echo lisp installed mylisp: $(LLIB)/auxfns0.o $(LLIB)/auxfns1.o $(LLIB)/toplevel.o tlisp $(LLIB)/tackon -rm -f mylisp -echo "(fasl '$(LLIB)/auxfns0 'map)(sstatus appendmap t)\ (fasl '$(LLIB)/auxfns1 'map)\ (fasl '$(LLIB)/toplevel 'map)\ (sstatus appendmap nil)\ (dumplisp mylisp)" | tlisp $(LLIB)/tackon map mylisp @echo mylisp built tags: $(GLOB) $(TCFILES) ctags $(GLOB) $(TCFILES) $(LLIB)/nld: cp /bin/ld $(LLIB)/nld $(LLIB)/tackon: tackon.c $(CC) -O tackon.c -o $(LLIB)/tackon -s led mylisp: $(LLIB)/auxfns0.o $(LLIB)/auxfns1.o $(LLIB)/toplevel.o tcmd/lisp/franz/VMS/S/ 775 0 12 0 2527315326 7453 cmd/lisp/franz/VMS/lisp.opt 664 2 12 4114 2507760015 11030 ! ! Franz lisp link options file: ! ! trickiness required: ! For Franz to work at all, crt0.s must start at virtual address 0. ! This is assumed in the code. To accomplish this there is a cluster ! called CRT0 which forces crt0.s to start at virtual address 0. ! ! For savelisp/restorelisp to work properly data in data.c must be ! contiguous. With the initial data being FirstAlloc and the last ! data being ZFreeSpace. This is accomplished by declaring a cluster ! called DATA to hold the contiguous data. data.c is put in this ! cluster as is the special psect $000_FIRSTALLOC, which is defined ! in VMSHACKS.MAR and forces FirstAlloc to be the 1st thing in the ! cluster. ZFreeSpace is the last thing by virtue of its name being ! last alphabetically. We also declare everything mentioned in ! orderit.s to be in this cluster (just in case). ! It turns out that malloc requires its internal variables to be ! before ZFreeSpace in memory, so we put it in a cluster (MALLOC) ! all by itself. ! ! ! optional trickiness: ! To keep the various nice DEMAND ZERO sections together, i have a ! cluster called DATA_DZERO in which i can stuff any obviously demand ! zero psects. ! !- --- lisp.o,eval.o,eval2.o,inits.o,io.o,error.o,sysat.o,talloc.o,- lam1.o,lam2.o,lam3.o,lam4.o,lam5.o,lam6.o,lam7.o,lam8.o,lamr.o,- lamnop.o,fex1.o,fex2.o,fex3.o,fex4.o,fexr.o,reset.o,fpipe.o,dmcount.o,- bigmath.o,subbig.o,pbignum.o,divbig.o,inewint.o,ffasl.o,nfasl.o,vmssys,- qfuncl.o,bind.o,trace.o,evalf.o,filbuf.o,dvadvise.o,vmshacks,fopen.o cluster((=CRT0,0,,crt0.o cluster=MALLOC,,,malloc.o cluster=DATA,,,data.o collect=DATA,$000_FIRSTALLOC,retval,orgbnp,orgnp,rlevel,errp,- piport,poport,vtemp,bnp,sigintcnt,rsetsw,lispsys,stattab,bnplim,- nplim,chkport,zeroq,atmlen,hunk_items,hunk_pages,hunk_name,- itemp,header,strbuf,GCtime,datalim,beginsweep,usehole,curhbeg,- hasht,exception,hash,sigstruck,sigacts,sigdelay,keywait,- atomval,lastrtab,rbktf,rdrport,contval,errport,tint,gftab,- proport,namptr,bcdtrsw,ftemp,argptr,ttemp,lctrace,trcur,- pbuf,mcounts,globtag,syml,fakenp,fakelbot,zfreespace collect=DATA_DZERO,BITMAPQ,_SIBUF,_SOBUF ,$000_FIRSTALLOC,retval,orgbnp,orgnp,rlevel,errp,- piport,poport,vtemp,bnp,sigintcnt,rsetsw,lispsys,stattab,bnplim,- nplim,chkport,zeroq,atmlen,hunk_items,hunk_pages,hunk_name,- itemp,header,strbuf,GCtime,datalim,beginsweep,usehole,curhbeg,- hasht,exception,hash,sigstruck,sigacts,sigdelay,keywait,- atomval,lastrtab,rbktf,rdrport,contval,errport,tint,gftab,- proport,namptr,bcdtrsw,ftemp,argptr,ttemp,lctrace,trcur,- pbuf,mcounts,globtcmd/lisp/franz/VMS/vmshacks.mar 664 2 12 1267 2506230077 11662 .TITLE VMSHACKS Special stuff for VMS franz ;+ --- ; ; We put the special PSECT hacking here: ; ;- --- .PSECT ZZZZZZZZZEND,Long,Exe,Rd,Nowrt End:: ;Put "End" at end of image .PSECT $000_FIRSTALLOC,Long,Noexe,Rd,Wrt,Ovr,Gbl FirstAlloc:: ;Define $000_Firstalloc PSECT .LONG ^X78 ;This all comes from orderit.s .BLKB 508 ;+ --- ; There are still some routines not yet defined in ; EUNICE. Until they are, we make those calls go to ; a dummy system call routine which does nothing but ; return an error. ;- --- .PSECT UNIX_CODE,Long,Exe,Rd,Nowrt Alarm:: Kill:: Pause:: .Entry $$$Undef_Subrs,^M<> MNEGL #1,R0 RET .END ;Put "End" at end of image .PSECT $000_FIRSTALLOC,Long,Noexe,Rd,Wrt,Ovr,Gbl FirstAlloc:: ;Define $000_Firstalloc PSECT .LONG ^X78 ;This all comes from orderit.s .BLKB 508 ;+ --- ; There are still some routines not yet defined in ; EUNICE. Until they are, we make those calls go to ; a dummy sycmd/lisp/franz/VMS/vmssys.mar 664 2 12 2664 2506230564 11412 .globl _vsyscall _vsyscall: .word 0x0000 movl 4(ap),r0 # point at arg array movl (r0)+,r1 # syscall number cmpl r1,$50 # legal syscall? bgequ error+2 # yes: error return movl $10,r2 Loop: pushl (r0)[r2] # push argument sobgeq r2,Loop # push 10 arguments movl dispatch[r1],r1 # get dispatch address calls $10,(r1) # do it ret error: .word 0 # dummy system call (returns error) mnegl $1,r0 ret dispatch: .long error # 0 indir (error) .long exit # 1 exit .long fork # 2 fork .long read # 3 read .long write # 4 write .long open .long close .long wait .long creat .long link .long unlink .long execve .long chdir .long time .long error # 14 mknod .long error # 15 chmod .long error # 16 chown .long sbrk .long stat .long lseek .long getpid .long error # 21 mount .long error # 22 umount .long error # 23 setuid .long getuid .long error # 25 stime .long error # 26 ptrace .long error # 27 alarm .long fstat .long error # 29 pause .long error # 30 utime .long stty # 31 stty .long gtty .long access .long error # 34 nice .long ftime .long error # 36 sync .long error # 37 kill .long error # 38 switch .long error # 39 setpgrp .long error # 40 tell .long dup # 41 dup .long pipe .long times .long error # 44 prof .long error # 45 tiu .long error # 46 setgid .long signal # 47 signal .long error # 48 ioctl .long error # 49 trace .long error # 27 alarm .long fstat .long error # 29 pause .loncmd/lisp/franz/VMS/vmsnlist.c 664 2 12 6336 2507754450 11376 /* * This is the VMS version of the UNIX nlist function. It will open * the specifed linker symbol table file (produced by the /SYMBOL_TABLE= * linker option) and return the addresses of the specified global * variables just like the UNIX nlist function. */ #include /* * Define VMS object file (symbol table) global symbol stuff */ #define OBJ$C_GSD 1 /* GSD record type */ #define OBJ$C_GSD_PSC 0 /* PSECT definition */ #define OBJ$C_GSD_SYM 1 /* GLOBAL symbol */ #define OBJ$C_GSD_EPM 2 /* ENTRY mask */ #define OBJ$C_GSD_PRO 3 /* FORMAL procedure */ #define SPACE_SIZE 2048 /* Size of read Buffer */ nlist(name, list) char *name; struct nlist *list; { register struct nlist *p; /* Pointer to user's nlist list */ register int f, i, nreq, offset; int read_size; /* Size of last read request */ char space[SPACE_SIZE]; /* Read buffer */ char real_name[100]; /* Possibly changed symtab filename */ char *cp; char code; /* * Clear out the type and value parts of the user's nlist list */ for(p = list, nreq = 0; p->n_un.n_name[0] ; p++, nreq++) { p->n_type = 0; p->n_value = 0; } /* * Open the symtab file. If there is no extension, use ".stb" */ for(i=0,cp=name;*cp && (*cp != '.');i++) real_name[i] = *cp++; real_name[i] = '.'; real_name[i+1] = 's'; real_name[i+2] = 't'; real_name[i+3] = 'b'; real_name[i+4] = 0; f = open( *cp == '.' ? name : real_name, 0); if(f < 0) return(-1); /* * Cycle through the symtab file decoding the object records. * When you hit a global symbol definition, check it against * the list of requested symbols. */ while (read_size=read(f,space,SPACE_SIZE)){ if(space[0] != OBJ$C_GSD) continue; /* looking for GSD */ for (i=1;in_un.n_name[0]; p++) { cp = p->n_un.n_name; /* * Strip off a leading '_' */ if (*cp == '_') cp++; for(j=0;j= 'a') && (*cp <= 'z') ? *cp++ -'a'+'A' : *cp++) != space[i+j+offset+1]) goto cont; /* * GOT IT! Extract its value */ val = (int *)&space[i+5]; p->n_value = *val; p->n_type = 0; if(--nreq == 0) goto alldone; break; cont: ; } } i += offset+1 + space[i+offset]; if (code == OBJ$C_GSD_PRO){ /* Dump the PRO arguments */ register int n; n = space[i+1]; i += 2; while (n-- > 0) i += 2 + space[i+1]; } break; default: printf("%d is an invalid GSD type\n", space[i]); return(-1); } } alldone: close(f); return(0); } _value = *val; p->n_type = 0; if(--nreq == 0) goto alldone; break; cont: ; } } i += offset+1 + space[i+offset]; if (code == OBJ$C_GSD_PRO){ /* Dump the PRO arguments */ register int n; n = space[i+1]; cmd/lisp/franz/VMS/crt0.s 664 2 12 26617 2507753273 10435 .set exit,1 .globl _exit .globl _main .globl _environ .globl _xports .globl _gstart .globl _proflush .globl _holbeg .globl _holend .globl Fixzero # # C language startup routine # # special 512 byte area for nil (and possibly other atoms) # and special block of smallnums. # .long 0 .long 0 .long 0 .long -4 .long 20 .byte 'n,'i,'l,0 .long 0 .long 0 .long -4 .long 40 .byte 'e,'o,'f,0 .space 512-44 _xports: .long __iob+0 .long __iob+16 .long __iob+32 .long __iob+48 .long __iob+64 .long __iob+80 .long __iob+96 .long __iob+112 .long __iob+128 .long __iob+144 .long __iob+160 .long __iob+176 .long __iob+192 .long __iob+208 .long __iob+224 .long __iob+240 .long __iob+256 .long __iob+272 .long __iob+288 .long __iob+304 .space 512 - (20 * 4) .long -1024,-1023,-1022,-1021,-1020,-1019,-1018,-1017 .long -1016,-1015,-1014,-1013,-1012,-1011,-1010,-1009 .long -1008,-1007,-1006,-1005,-1004,-1003,-1002,-1001 .long -1000,-999,-998,-997,-996,-995,-994,-993 .long -992,-991,-990,-989,-988,-9((87,-986,-985 .long -984,-983,-982,-981,-980,-979,-978,-977 .long -976,-975,-974,-973,-972,-971,-970,-969 .long -968,-967,-966,-965,-964,-963,-962,-961 .long -960,-959,-958,-957,-956,-955,-954,-953 .long -952,-951,-950,-949,-948,-947,-946,-945 .long -944,-943,-942,-941,-940,-939,-938,-937 .long -936,-935,-934,-933,-932,-931,-930,-929 .long -928,-927,-926,-925,-924,-923,-922,-921 .long -920,-919,-918,-917,-916,-915,-914,-913 .long -912,-911,-910,-909,-908,-907,-906,-905 .long -904,-903,-902,-901,-900,-899,-898,-897 .long -896,-895,-894,-893,-892,-891,-890,-889 .long -888,-887,-886,-885,-884,-883,-882,-881 .long -880,-879,-878,-877,-876,-875,-874,-873 .long -872,-871,-870,-869,-868,-867,-866,-865 .long -864,-863,-862,-861,-860,-859,-858,-857 .long -856,-855,-854,-853,-852,-851,-850,-849 .long -848,-847,-846,-845,-844,-843,-842,-841 .long -840,-839,-838,-837,-836,-835,-834,-833 .long -832,-831,-830,-829,-828,-827,-826,-825 .long -824,-823,-822,-821,-820,-819,-818,-817 .long -816,-815,-814,-813,-812,-811,-810,-809 .long -808,-807,-806,-805,-804,-803,-802,-801 .long -800,-799,-798,-797,-796,-795,-794,-793 .long -792,-791,-790,-789,-788,-787,-786,-785 .long -784,-783,-782,-781,-780,-779,-778,-777 .long -776,-775,-774,-773,-772,-771,-770,-769 .long -768,-767,-766,-765,-764,-763,-762,-761 .long -760,-759,-758,-757,-756,-755,-754,-753 .long -752,-751,-750,-749,-748,-747,-746,-745 .long -744,-743,-742,-741,-740,-739,-738,-737 .long -736,-735,-734,-733,-732,-731,-730,-729 .long -728,-727,-726,-725,-724,-723,-722,-721 .long -720,-719,-718,-717,-716,-715,-714,-713 .long -712,-711,-710,-709,-708,-707,-706,-705 .long -704,-703,-702,-701,-700,-699,-698,-697 .long -696,-695,-694,-693,-692,-691,-690,-689 .long -688,-687,-686,-685,-684,-683,-682,-681 .long -680,-679,-678,-677,-676,-675,-674,-673 .long -672,-671,-670,-669,-668,-667,-666,-665 .long -664,-663,-662,-661,-660,-659,-658,-657 .long -656,-655,-654,-653,-652,-651,-650,-649 .long -648,-647,-646,-645,-644,-643,-642,-641 .long -640,-639,-638,-637,-636,-635,-634,-633 .long -632,-631,-630,-629,-628,-627,-626,-625 .long -624,-623,-622,-621,-620,-619,-618,-617 .long -616,-615,-614,-613,-612,-611,-610,-609 .long -608,-607,-606,-605,-604,-603,-602,-601 .long -600,-599,-598,-597,-596,-595,-594,-593 .long -592,-591,-590,-589,-588,-587,-586,-585 .long -584,-583,-582,-581,-580,-579,-578,-577 .long -576,-575,-574,-573,-572,-571,-570,-569 .long -568,-567,-566,-565,-564,-563,-562,-561 .long -560,-559,-558,-557,-556,-555,-554,-553 .long -552,-551,-550,-549,-548,-547,-546,-545 .long -544,-543,-542,-541,-540,-539,-538,-537 .long -536,-535,-534,-533,-532,-531,-530,-529 .long -528,-527,-526,-525,-524,-523,-522,-521 .long -520,-519,-518,-517,-516,-515,-514,-513 .long -512,-511,-510,-509,-508,-507,-506,-505 .long -504,-503,-502,-501,-500,-499,-498,-497 .long -496,-495,-494,-493,-492,-491,-490,-489 .long -488,-487,-486,-485,-484,-483,-482,-481 .long -480,-479,-478,-477,-476,-475,-474,-473 .long -472,-471,-470,-469,-468,-467,-466,-465 .long -464,-463,-462,-461,-460,-459,-458,-457 .long -456,-455,-454,-453,-452,-451,-450,-449 .long -448,-447,-446,-445,-444,-443,-442,-441 .long -440,-439,-438,-437,-436,-435,-434,-433 .long -432,-431,-430,-429,-428,-427,-426,-425 .long -424,-423,-422,-421,-420,-419,-418,-417 .long -416,-415,-414,-413,-412,-411,-410,-409 .long -408,-407,-406,-405,-404,-403,-402,-401 .long -400,-399,-398,-397,-396,-395,-394,-393 .long -392,-391,-390,-389,-388,-387,-386,-385 .long -384,-383,-382,-381,-380,-379,-378,-377 .long -376,-375,-374,-373,-372,-371,-370,-369 .long -368,-367,-366,-365,-364,-363,-362,-361 .long -360,-359,-358,-357,-356,-355,-354,-353 .long -352,-351,-350,-349,-348,-347,-346,-345 .long -344,-343,-342,-341,-340,-339,-338,-337 .long -336,-335,-334,-333,-332,-331,-330,-329 .long -328,-327,-326,-325,-324,-323,-322,-321 .long -320,-319,-318,-317,-316,-315,-314,-313 .long -312,-311,-310,-309,-308,-307,-306,-305 .long -304,-303,-302,-301,-300,-299,-298,-297 .long -296,-295,-294,-293,-292,-291,-290,-289 .long -288,-287,-286,-285,-284,-283,-282,-281 .long -280,-279,-278,-277,-276,-275,-274,-273 .long -272,-271,-270,-269,-268,-267,-266,-265 .long -264,-263,-262,-261,-260,-259,-258,-257 .long -256,-255,-254,-253,-252,-251,-250,-249 .long -248,-247,-246,-245,-244,-243,-242,-241 .long -240,-239,-238,-237,-236,-235,-234,-233 .long -232,-231,-230,-229,-228,-227,-226,-225 .long -224,-223,-222,-221,-220,-219,-218,-217 .long -216,-215,-214,-213,-212,-211,-210,-209 .long -208,-207,-206,-205,-204,-203,-202,-201 .long -200,-199,-198,-197,-196,-195,-194,-193 .long -192,-191,-190,-189,-188,-187,-186,-185 .long -184,-183,-182,-181,-180,-179,-178,-177 .long -176,-175,-174,-173,-172,-171,-170,-169 .long -168,-167,-166,-165,-164,-163,-162,-161 .long -160,-159,-158,-157,-156,-155,-154,-153 .long -152,-151,-150,-149,-148,-147,-146,-145 .long -144,-143,-142,-141,-140,-139,-138,-137 .long -136,-135,-134,-133,-132,-131,-130,-129 .long -128,-127,-126,-125,-124,-123,-122,-121 .long -120,-119,-118,-117,-116,-115,-114,-113 .long -112,-111,-110,-109,-108,-107,-106,-105 .long -104,-103,-102,-101,-100,-99,-98,-97 .long -96,-95,-94,-93,-92,-91,-90,-89 .long -88,-87,-86,-85,-84,-83,-82,-81 .long -80,-79,-78,-77,-76,-75,-74,-73 .long -72,-71,-70,-69,-68,-67,-66,-65 .long -64,-63,-62,-61,-60,-59,-58,-57 .long -56,-55,-54,-53,-52,-51,-50,-49 .long -48,-47,-46,-45,-44,-43,-42,-41 .long -40,-39,-38,-37,-36,-35,-34,-33 .long -32,-31,-30,-29,-28,-27,-26,-25 .long -24,-23,-22,-21,-20,-19,-18,-17 .long -16,-15,-14,-13,-12,-11,-10,-9 .long -8,-7,-6,-5,-4,-3,-2,-1 Fixzero: .long 0,1,2,3,4,5,6,7 .long 8,9,10,11,12,13,14,15 .long 16,17,18,19,20,21,22,23 .long 24,25,26,27,28,29,30,31 .long 32,33,34,35,36,37,38,39 .long 40,41,42,43,44,45,46,47 .long 48,49,50,51,52,53,54,55 .long 56,57,58,59,60,61,62,63 .long 64,65,66,67,68,69,70,71 .long 72,73,74,75,76,77,78,79 .long 80,81,82,83,84,85,86,87 .long 88,89,90,91,92,93,94,95 .long 96,97,98,99,100,101,102,103 .long 104,105,106,107,108,109,110,111 .long 112,113,114,115,116,117,118,119 .long 120,121,122,123,124,125,126,127 .long 128,129,130,131,132,133,134,135 .long 136,137,138,139,140,141,142,143 .long 144,145,146,147,148,149,150,151 .long 152,153,154,155,156,157,158,159 .long 160,161,162,163,164,165,166,167 .long 168,169,170,171,172,173,174,175 .long 176,177,178,179,180,181,182,183 .long 184,185,186,187,188,189,190,191 .long 192,193,194,195,196,197,198,199 .long 200,201,202,203,204,205,206,207 .long 208,209,210,211,212,213,214,215 .long 216,217,218,219,220,221,222,223 .long 224,225,226,227,228,229,230,231 .long 232,233,234,235,236,237,238,239 .long 240,241,242,243,244,245,246,247 .long 248,249,250,251,252,253,254,255 .long 256,257,258,259,260,261,262,263 .long 264,265,266,267,268,269,270,271 .long 272,273,274,275,276,277,278,279 .long 280,281,282,283,284,285,286,287 .long 288,289,290,291,292,293,294,295 .long 296,297,298,299,300,301,302,303 .long 304,305,306,307,308,309,310,311 .long 312,313,314,315,316,317,318,319 .long 320,321,322,323,324,325,326,327 .long 328,329,330,331,332,333,334,335 .long 336,337,338,339,340,341,342,343 .long 344,345,346,347,348,349,350,351 .long 352,353,354,355,356,357,358,359 .long 360,361,362,363,364,365,366,367 .long 368,369,370,371,372,373,374,375 .long 376,377,378,379,380,381,382,383 .long 384,385,386,387,388,389,390,391 .long 392,393,394,395,396,397,398,399 .long 400,401,402,403,404,405,406,407 .long 408,409,410,411,412,413,414,415 .long 416,417,418,419,420,421,422,423 .long 424,425,426,427,428,429,430,431 .long 432,433,434,435,436,437,438,439 .long 440,441,442,443,444,445,446,447 .long 448,449,450,451,452,453,454,455 .long 456,457,458,459,460,461,462,463 .long 464,465,466,467,468,469,470,471 .long 472,473,474,475,476,477,478,479 .long 480,481,482,483,484,485,486,487 .long 488,489,490,491,492,493,494,495 .long 496,497,498,499,500,501,502,503 .long 504,505,506,507,508,509,510,511 .long 512,513,514,515,516,517,518,519 .long 520,521,522,523,524,525,526,527 .long 528,529,530,531,532,533,534,535 .long 536,537,538,539,540,541,542,543 .long 544,545,546,547,548,549,550,551 .long 552,553,554,555,556,557,558,559 .long 560,561,562,563,564,565,566,567 .long 568,569,570,571,572,573,574,575 .long 576,577,578,579,580,581,582,583 .long 584,585,586,587,588,589,590,591 .long 592,593,594,595,596,597,598,599 .long 600,601,602,603,604,605,606,607 .long 608,609,610,611,612,613,614,615 .long 616,617,618,619,620,621,622,623 .long 624,625,626,627,628,629,630,631 .long 632,633,634,635,636,637,638,639 .long 640,641,642,643,644,645,646,647 .long 648,649,650,651,652,653,654,655 .long 656,657,658,659,660,661,662,663 .long 664,665,666,667,668,669,670,671 .long 672,673,674,675,676,677,678,679 .long 680,681,682,683,684,685,686,687 .long 688,689,690,691,692,693,694,695 .long 696,697,698,699,700,701,702,703 .long 704,705,706,707,708,709,710,711 .long 712,713,714,715,716,717,718,719 .long 720,721,722,723,724,725,726,727 .long 728,729,730,731,732,733,734,735 .long 736,737,738,739,740,741,742,743 .long 744,745,746,747,748,749,750,751 .long 752,753,754,755,756,757,758,759 .long 760,761,762,763,764,765,766,767 .long 768,769,770,771,772,773,774,775 .long 776,777,778,779,780,781,782,783 .long 784,785,786,787,788,789,790,791 .long 792,793,794,795,796,797,798,799 .long 800,801,802,803,804,805,806,807 .long 808,809,810,811,812,813,814,815 .long 816,817,818,819,820,821,822,823 .long 824,825,826,827,828,829,830,831 .long 832,833,834,835,836,837,838,839 .long 840,841,842,843,844,845,846,847 .long 848,849,850,851,852,853,854,855 .long 856,857,858,859,860,861,862,863 .long 864,865,866,867,868,869,870,871 .long 872,873,874,875,876,877,878,879 .long 880,881,882,883,884,885,886,887 .long 888,889,890,891,892,893,894,895 .long 896,897,898,899,900,901,902,903 .long 904,905,906,907,908,909,910,911 .long 912,913,914,915,916,917,918,919 .long 920,921,922,923,924,925,926,927 .long 928,929,930,931,932,933,934,935 .long 936,937,938,939,940,941,942,943 .long 944,945,946,947,948,949,950,951 .long 952,953((,954,955,956,957,958,959 .long 960,961,962,963,964,965,966,967 .long 968,969,970,971,972,973,974,975 .long 976,977,978,979,980,981,982,983 .long 984,985,986,987,988,989,990,991 .long 992,993,994,995,996,997,998,999 .long 1000,1001,1002,1003,1004,1005,1006,1007 .long 1008,1009,1010,1011,1012,1013,1014,1015 .long 1016,1017,1018,1019,1020,1021,1022,1023 _holbeg: # dummy locations _holend: ,931,932,933,934,935 .long 936,937,938,939,940,941,942,943 .long 944,945,946,947,948,949,950,951 .long 952,953cmd/lisp/franz/lamgc.c 664 0 12 5314 2552701443 10120 #include "global.h" #include "gc.h" #include #include /* this file is temporary and will contain routines to meter the garbage collector */ /* gcstat - temporary routine used to report on gc statistics. if this causes variables to be undefined,then it should be removed */ extern int beginsweep,gensymcounter; int gcstat; int markdpcount; int gccount; int conssame; int consdiff; int consnil; /* * gcstat - initiate and record gc statistics * calls: * (gcstat 0) -- initiate gc statistics by creating gc.out * and writing header. * (gcstat 1) -- finish off gc statistics file by writing typetable * and closing file. */ lispval Lgcstat() { register lispval handy,retval; int nbytes; struct gchead hhh; chkarg(1,"gcstat"); if(TYPE(handy=lbot->val) != INT) { error("gcstat: non integer arg ",FALSE); } switch(handy->i) { case 0: if((gcstat = creat("gc.out",0644)) < 0) error("cant open gc.out",FALSE); hhh.version = 5; hhh.lowdata = (int)beginsweep; printf("writing %d bytes \n",sizeof(hhh)); write(gcstat,&hhh,sizeof(hhh)); gccount = 0; return(tatom); case 1: /* first write out the type table */ nbytes = 0; /* 0 means type table follows */ printf("gc's %d, writing %d bytes \n",gccount, sizeof(nbytes)); write(gcstat,&nbytes,sizeof(nbytes)); write(gcstat,&typetable[((int)beginsweep>>9)+1], nbytes = ((int)datalim - (int)beginsweep)>>9); printf("writing %d bytes \n",nbytes+sizeof(nbytes)); write(gcstat,&nbytes,sizeof(nbytes)); close(gcstat); gcstat = 0; return(inewint(nbytes)); default: error("Bad value to gcstat ",TRUE); } } extern char bitmapi[]; /* a bit of a lie it is really a double array*/ char *bitmapc = bitmapi; struct vtimes premark,presweep,alldone; /* called in the garbage collector after the bit maps have been made only if gcstat is non zero */ gcdump() { int nbytes, recsize; /* 16 bytes/page in the bitmap */ nbytes = (((int) datalim - (int) beginsweep) >> 9) * 16; recsize = nbytes + 6*sizeof(int) + 3*sizeof(struct vtimes); write(gcstat,&recsize,sizeof(recsize)); /* whole record size */ write(gcstat,&premark,sizeof(premark)); write(gcstat,&presweep,sizeof(presweep)); write(gcstat,&alldone,sizeof(alldone)); write(gcstat,&gensymcounter,sizeof(int)); write(gcstat,&conssame,sizeof(int)); write(gcstat,&consdiff,sizeof(int)); write(gcstat,&consnil,sizeof(int)); write(gcstat,&markdpcount,sizeof(int)); write(gcstat,&nbytes,sizeof(nbytes)); /* bit table size */ write(gcstat,&bitmapc[((int)beginsweep>>9) * 16],nbytes); printf("gc: %d, written %d bytes\n",++gccount,nbytes); } cord size */ write(gcstat,&premark,sizeof(premark)); write(gcstat,&presweep,sizeof(presweep)); write(gcstat,&alldone,sizeof(alldone)); write(gcstat,&gensymcounter,sizeof(int)); write(gcstat,&conssame,sizeof(int)); write(gcstat,&consdiff,sizeof(int)); write(gcstat,&consnil,sizeof(int)); write(gcstat,cmd/lisp/franz/x 644 0 33 44 2573624771 7032 { } END { printf "hello\n" > "t1" } stat,&nbytes,sizeof(nbytes)); /* bit table size */ write(gcstat,&bitmapc[((int)beginsweep>>9) * 16],nbytes); printf("gc: %d, written %d bytes\n",++gccount,nbytes); } cord size */ write(gcstat,&premark,sizeof(premark)); write(gcstat,&presweep,sizeof(presweep)); write(gcstat,&alldone,sizeof(alldone)); write(gcstat,&gensymcounter,sizeof(int)); write(gcstat,&conssame,sizeof(int)/|,|5ȉ< /,"cmd/lisp/franz/errs 664 0 33 2403 2574150423 7566 cc -O -o fixmask fixmask.c as -o crt0.o crt0.s as -o Orderit.o Orderit.s cc -c -O lisp.c cc -c -O eval.c cc -c -O eval2.c cc -c -O Talloc.c cc -c -O inits.c cc -c -O io.c cc -c -O frame.c cc -c -O error.c cc -c -O sysat.c cc -c -O data.c cc -c -O lam1.c cc -c -O lam2.c cc -c -O lam3.c cc -c -O lam4.c cc -c -O lam5.c cc -c -O lam6.c cc -c -O lam7.c cc -c -O lam8.c cc -c -O lamr.c cc -c -O lamnop.c cc -c -O fex1.c cc -c -O fex2.c cc -c -O fex3.c cc -c -O fex4.c cc -c -O fexr.c as -o reset.o reset.s cc -c -O fpipe.c as -o dmcount.o dmcount.s as -o bigmath.o bigmath.s cc -c -O subbig.c cc -c -O pbignum.c cc -c -O divbig.c as -o inewint.o inewint.s cc -c -O ffasl.c cc -c -O nfasl.c "nfasl.c", line 490: warning: illegal combination of pointer and integer, op = as -o vsyscall.o vsyscall.s as -o qfuncl.o qfuncl.s cc -c -O trace.c cc -c -O evalf.c rm -f tlisp ld -x -o tlisp -e start crt0.o Orderit.o lisp.o eval.o eval2.o Talloc.o inits.o io.o frame.o error.o sysat.o data.o lam1.o lam2.o lam3.o lam4.o lam5.o lam6.o lam7.o lam8.o lamr.o lamnop.o fex1.o fex2.o fex3.o fex4.o fexr.o reset.o fpipe.o dmcount.o bigmath.o subbig.o pbignum.o divbig.o inewint.o ffasl.o nfasl.o vsyscall.o qfuncl.o trace.o evalf.o -lm -lc ls -l tlisp -rwxrwxr-x 1 root 143807 Aug 31 04:01 tlisp vsyscall.o vsyscall.s as -o qfuncl.o qfuncl.s cc -c -O trace.c cc -c -O evalf.c rm -f tlisp ld -x -o tlisp -e start crt0.o Orderit.o lisp.o eval.o eval2.o Talloc.o inits.o io.o frame.o error.o sysat.o data.o lam1.o lam2.o lam3.o lam4.o lam5.o lam6.o lacmd/lisp/franz/frame.c 444 0 12 15772 2552701444 10155 static char *sccsid = "@(#)frame.c 1.1 7/1/81"; #include "global.h" #include "frame.h" /* * frame.c :: a collection of routines for manipulating evaluation frames. * Such frames are generated to mark the state of execution at a certain * spot. They are created upon entry to prog, do, catch, errset and * other misc. functions (such as eval when in *rset mode). * * As described in h/frame.h, each frame is identified by a class, which * says who created the frame. The global variable errp points to the * first (newest) frame on the stack. * The standard way to create a frame is to say * * errp = Pushframe(class); create and link in new frame of give class * * If the frame has arguments, then the the call should be: * errp = Pushframe1(class,arg); * - or - * errp = Pushframe2(class,arg1,arg2); * * poping the frame must be done explicity if the routine was not exited by * a non-local goto. This is done by * errp = Popframe(); * * When a frame is created, it marks the current state on the runtime stack. * Execution will continues after the Pushframe call with the value of the * global variable 'retval' set to 0. Some time later control may be thrown * up the stack and it will seem that Pushframe returned again. This time * retval will contain a non-zero value indicating what caused the non-local * jump. retval will have one of the values from C_???? in h/frame.h . * It will not have just of the C_???? values, it will only have a value * which makes sense. For example, coming out of a Pushframe1(F_CATCH,tag); * retval will either be 0 (initially) or C_THROW, [and in addition it will * already have been determined that the tag of the catch matches the tag * being thrown, [[ this does not apply to GO's and PROG tags]] ]. * * In doing throws, goto's, returns, or errors up the stack we are always * conscious of the possiblity of unwind-protect sitting between where * control starts and where it wants to get. Thus it may be necessary * to save the state of the non-local jump, give control to the unwind-protect * and have it continue the non-local jump. */ /* * Inonlocalgo(class, arg1, arg2) :: do a general non-local goto. * class - one of the C_???? in h/frame.h * arg1 - tag in C_THROW, C_GO; value in C_RETURN * arg2 - value in C_THROW; * this handles GO's, THROW's, RETURN's but not errors, which have more * state to throw and a lot of different things to do if there is no one * to catch the error. * * This routine never returns. */ (( Inonlocalgo(class, arg1, arg2) lispval arg1,arg2; { struct frame *uwpframe, *Inlthrow(); lispval handy; /* * scan for something to match 'class', return if nothing found, or * if we must first handle an unwind protect. */ while( uwpframe = Inlthrow(class,arg1,arg2) ) { /* build error frame description to be use to continue this throw */ protect(lispretval = handy = newdot()); handy->d.car = Veruwpt; handy = handy->d.cdr = newdot(); handy->d.car = tatom; /* t for throw */ handy = handy->d.cdr = newdot(); handy->d.car = arg1; handy = handy->d.cdr = newdot(); handy->d.car = arg2; retval = C_THROW; Iretfromfr(uwpframe); /* NOT REACHED */ } /* * nothing to go to, signal the appropriate error */ switch(class) { case C_GO: errorh(Vermisc, "No prog to go to with this tag ", nil,FALSE,0,arg1); /* NOT REACHED */ case C_RET: errorh(Vermisc, "No prog to return from", nil, FALSE, 0); /* NOT REACHED */ case C_THROW: errorh(Vermisc, "No catch for this tag ", nil, FALSE , 0, arg1); /* NOT REACHED */ default: error("Internal Inonlocalgoto error" ,FALSE); /* NOT REACHED */ } } /* * Inlthrow(class,arg1,arg2) :: look up the stack for a form to handle * a value of 'class' being thrown. If found, do the throw. If an * unwind-protect must be done, then return a pointer to that frame * first. If there is nothing to catch this throw, we return 0. */ struct frame * Inlthrow(class, arg1, arg2) lispval arg1, arg2; { struct frame *uwpframe = (struct frame *)0; struct frame *curp; int pass = 1; restart: for(curp = errp; curp != (struct frame *) 0; curp = curp->olderrp) { switch(curp->class) { case F_PROG: if(class == C_RET || class == C_GO) { if(pass == 2) return(uwpframe); else { lispretval = arg1; retval = class; Iretfromfr(curp); /* NOT REACHED */ } } break; case F_CATCH: if((pass == 1) && (curp->larg1 == Veruwpt)) { uwpframe = curp; pass = 2; goto restart; } else if(class == C_THROW && matchtags(arg1,curp->larg1)) { if(pass == 2) return(uwpframe); else { lispretval = arg2; /* value thrown */ retval = class; Iretfromfr(curp); /* NOT REACHED */ } } break; case F_RESET: if(class == C_RESET) { if(pass == 2) return(uwpframe); else { retval = class; Iretfromfr(curp); /* NOT REACHED */ } } break; } } return((struct frame *)0); /* nobody wants it */ } Iretfromfr(fram) register struct frame *fram; { popnames(fram->svbnp); qretfromfr(); /* modified in sed script to point to real function */ /* NOT REACHED */ } /* matchtags :: return TRUE if there is any atom in common between the * two tags. Either tag may be an atom or an list of atoms. */ matchtags(tag1,tag2) lispval tag1, tag2; { int repeat1 = FALSE; int repeat2 = FALSE; lispval temp1 = tag1; lispval temp2 = tag2; lispval t1,t2; if(TYPE(tag1) == ATOM) { t1 = tag1; } else { t1 = tag1->d.car; repeat1 = TRUE; } if(TYPE(tag2) == ATOM) { t2 = tag2; } else { t2 = tag2->d.car; repeat2 = TRUE; } loop: if(t1 == t2) return(TRUE); if(repeat2) { if((temp2 = temp2->d.cdr) != nil) { t2 = temp2->d.car; goto loop; } } if(repeat1) { if((temp1 = temp1->d.cdr) != nil) { t1 = temp1->d.car; if(repeat2) { temp2 = tag2; t2 = temp2->d.car; goto loop; } else t2 = tag2; goto loop; } } return(FALSE); } /* * framedump :: debugging routine to print the contents of the error * frame * */ lispval Lframedump() { struct frame *curp; printf("Frame dump\n"); for(curp = errp ; curp != (struct frame *)0 ; curp=curp->olderrp) { printf("at %x is ",curp); switch(curp->class) { case F_PROG: printf(" prog\n"); break; case F_CATCH:printf(" catching "); printr(curp->larg1,stdout); putchar('\n'); break; case F_RESET:printf(" reset \n"); break; case F_EVAL: printf(" eval: "); printr(curp->larg1,stdout); putchar('\n'); break; case F_FUNCALL: printf(" funcall: "); printr(curp->larg1,stdout); putchar('\n'); break; default: printf(" unknown: %d \n",curp->class); } fflush(stdout); } printf("End of stack\n"); return(nil); } reak; cmd/lisp/liszt/ 775 0 12 0 2552767510 6635 cmd/lisp/liszt/Makefile 664 0 12 3233 2552756462 10367 # Makefile for liszt v4.0 # Copyright (c) 1980 , The Regents of the University of California. # All rights reserved. # author: j. foderaro (Made somewhat more cryptic by K. sklower) # files required: # caspecs - special declarations for whole file (included in all) # camacs - macros used by whole file # car.l - source file: startup code # cadr.l - actual compilation code # cddr.l - smart compilation code # # other files: # uctolc.c - converts uppercase to lower case in first field of # tags file. # ltags - awk script for finding function defs # # /usr/lib/lisp/machacks.l - maclisp compatibility functions # MCROS = camacs.l MOBJ = camacs.o FILES = car.l cadr.l cddr.l OBJS = car.o cadr.o cddr.o LLIB = $(DESTDIR)/usr/lib/lisp/ LSRC = /usr/src/cmd/lisp LFILES = ${LLIB}machacks.l LOBJS = ${LLIB}machacks.o LISP = $(DESTDIR)/usr/ucb/lisp .SUFFIXES: .l .l.o: liszt $* > $*.blat nliszt : ${MOBJ} ${OBJS} ${LOBJS} ${LLIB}/tackon echo "(progn (fasl 'car 'map)(sstatus appendmap t)\ (fasl 'cadr 'map)\ (fasl 'cddr 'map)\ (dumplisp nliszt))" | ${LISP} $(LLIB)/tackon map nliszt @echo nliszt done lxref: ${LLIB}jkfmacs.o liszt -r lxref.l > lxref.blat mv lxref.o lxref tags: /dev/tty uctolc awk -f ltags ${MCROS} ${FILES} | uctolc | sort > tags install: nliszt lxref ${LLIB}/as mv nliszt ${DESTDIR}/usr/ucb/liszt mv lxref ${DESTDIR}/usr/ucb chmod 1755 ${DESTDIR}/usr/ucb/liszt @echo liszt installed ${LLIB}machacks.o : ${LLIB}machacks.l liszt -m ${LLIB}machacks > ${LLIB}machacks.blat ${LLIB}/as: cp /bin/as ${LLIB} uctolc: uctolc.c cc -O uctolc.c -o uctolc clean: rm -f *.o *.blat map tags uctolc ${LLIB}jkfmacs.o liszt -r lxref.l > lxref.blat mv lxref.o lxref tags: /dev/tty uctolc awk -f ltags ${MCROS} ${FILES} | uctolc | sort > tags install: nliszt lxref ${LLIB}/as mv nliszt ${DESTDIR}/usr/ucb/liszt mv lxref ${DESTDIR}/usr/ucb chmod 1755 ${DESTDIR}/usr/ucb/liszt @echo liszt installed ${LLIB}machacks.o : ${LLIB}machacks.l liszt -m ${Lcmd/lisp/liszt/cadr.l 644 0 12 130126 2552702335 10043 ; l i s z t v 4 ; Copyright (c) 1980 , The Regents of the University of California. ; All rights reserved. ; author: j. foderaro ; Section EXPR -- general expression compiler (include "caspecs.l") (eval-when (compile eval) (cond ((not (getd 'If)) (fasl 'camacs)))) (setq sectioncadrid "@(#)cadr.l 5.20 7/8/81") ; id for SCCS ;--- d-exp :: compile a lisp expression = d-exp = ; v-form : a lisp expression to compile ; returns an IADR which tells where the value was located. ; (defun d-exp (v-form) (prog (first resloc tmp ftyp) begin (If (atom v-form) then (setq tmp (d-loc v-form)) ;locate vrble (If (null g-loc) then (If g-cc then (d-tst tmp)) else (d-move tmp g-loc)) (d-handlecc) (return tmp) elseif (atom (setq first (car v-form))) then (If (and fl-xref (not (get first g-refseen))) then (Push g-reflst first) (putprop first t g-refseen)) (setq ftyp (d-functyp first)) (If (eq 'macro ftyp) then (setq v-form (apply first v-form)) (go begin) elseif (setq tmp (get first 'fl-exprcc)) then (return (funcall tmp)) elseif (setq tmp (get first 'fl-exprm)) then (setq v-form (funcall tmp)) (go begin) elseif (setq tmp (get first 'fl-expr)) then (funcall tmp) elseif (setq tmp (or (and (eq 'car first) '( a )) (and (eq 'cdr first) '( d )) (d-cxxr first))) then (return (cc-cxxr (cadr v-form) tmp)) elseif (eq 'nlambda ftyp) then (d-callbig first `(',(cdr v-form)) nil) elseif (or (eq 'lambda ftyp) (eq 'lexpr ftyp)) then (setq tmp (length v-form)) (d-callbig first (cdr v-form) nil) elseif (eq 'array ftyp) then (d-handlearrayref)) elseif (eq 'lambda (car first)) then (c-lambexp) elseif (or (eq 'quote (car first)) (eq 'function (car first))) then (comp-warn "bizzare function name " (or first)) (setq v-form (cons (cadr first) (cdr v-form))) (go begin) else (comp-err "bad e((xpression" (or v-form))) (If (null g-loc) then (If g-cc then (d-tst 'reg)) elseif (memq g-loc '(reg r0)) then (If g-cc then (d-tst 'reg)) else (d-move 'reg g-loc)) (If g-cc then (d-handlecc)))) ;--- d-functyp :: return the type of function ; - name : function name ; ; If name had a macro function definition, we return `macro'. Otherwise ; we see if name as a declared type, if so we return that. Otherwise ; we see if name is defined and we return that if so, and finally if ; we have no idea what this function is, we return lambda. ; This is not really satisfactory, but will handle most cases. (defun d-functyp (name) (let (func ftyp) (If (atom name) then (setq func (getd name)) (setq ftyp (If (bcdp func) then (getdisc func) elseif (dtpr func) then (car func))) (If (eq ftyp 'macro) then 'macro elseif (get name g-functype) thenret ; check if declared first elseif ftyp thenret else 'lambda) else 'lambda))) ; default is lambda ;--- d-exps :: compile a list of expressions ; - exps : list of expressions ; the last expression is evaluated according to g-loc and g-cc, the others ; are evaluated with g-loc and g-cc nil. ; (defun d-exps (exps) (d-exp (do ((ll exps (cdr ll)) (g-loc nil) (g-cc nil) (g-ret nil)) ((null (cdr ll)) (car ll)) (d-exp (car ll))))) ;--- d-pushargs :: compile and push a list of expressions ; - exps : list of expressions ; compiles and stacks a list of expressions ; (defun d-pushargs (args) (If args then (do ((ll args (cdr ll)) (g-loc 'stack) (g-cc nil) (g-ret nil)) ((null ll)) (d-exp (car ll)) (Push g-locs nil) (incr g-loccnt)))) ;--- d-cxxr :: split apart a cxxr function name ; - name : a possible cxxr function name ; returns the a's and d's between c and r in reverse order, or else ; returns nil if this is not a cxxr name ; (defun d-cxxr (name) (let ((expl (explodec name))) (If (eq 'c (car expl)) ; must begin with c then (do ((ll (cdr expl) (cdr ll)) (tmp) (res)) (nil) (setq tmp (car ll)) (If (null (cdr ll)) then (If (eq 'r tmp) ; must end in r then (return res) else (return nil)) elseif (or (eq 'a tmp) ; and contain only a's and d's (eq 'd tmp)) then (setq res (cons tmp res)) else (return nil)))))) ;--- d-call :: call another function ; - name : name of funtion to call ; - nargs : number of args stacked (including the function name) ; (defun d-call (name nargs) (prog (tmp) (forcecomment `(calling ,name)) (If (null (setq tmp (cdr (assoc nargs '( (1 . (* -8 #.bind-reg)) (2 . (* -12 #.bind-reg)) (3 . (* -16 #.bind-reg)) (4 . (* -20 #.bind-reg)) (5 . (* -24 #.bind-reg))))))) then ; lbot will not be set up automatically (e-write3 'movab ; must set up lbot `(,(* -4 nargs) #.Np-reg) '#.Lbot-reg) (setq tmp '(* -28 #.bind-reg))) (e-write2 'jsb tmp))) ;--- d-callbig :: call a local, global or bcd function ; ; name is the name of the function we are to call ; args are the arguments to evaluate and call the function with ; if bcdp is t then we are calling through a binary object and thus ; name is ingored. ; (defun d-callbig (name args bcdp) (let ((tmp (get name g-localf)) c) (forcecomment `(calling ,name)) (If (d-dotailrecursion name args) thenret elseif tmp then ;-- local function call (d-pushargs args) (e-write2 'jsb (car tmp)) (setq g-locs (nthcdr (setq c (length args)) g-locs)) (setq g-loccnt (- g-loccnt c)) else (If bcdp ;-- bcdcall then (d-pushargs args) (setq c (length args)) (d-bcdcall c) elseif fl-tran ;-- transfer table linkage then (d-pushargs args) (setq c (length args)) (d-calltran name c) else ;--- standard function call (d-pushargs `(',name ,@args)) (d-call name (setq c (1+ (length args))))) (setq g-locs (nthcdr c g-locs)) (setq g-loccnt (- g-loccnt c))) (d-clearreg))) ;--- d-calltran :: call a function through the transfer table = d-calltran = ; name - name of function to call ; c - number of arguments to the function ; (defun d-calltran (name c) (e-write3 'movab `(,(* -4 c) #.Np-reg) '#.Lbot-reg) (e-write3 'calls '$0 (concat "*trantb+" (d-tranloc name))) (e-write3 'movl '#.Lbot-reg '#.Np-reg)) ;--- d-tranloc :: locate a function in the transfer table = d-tranloc = ; ; return the offset we should use for this function call ; (defun d-tranloc (fname) (cond ((get fname g-tranloc)) (t (Push g-tran fname) (let ((newval (* 8 g-trancnt))) (putprop fname newval g-tranloc) (incr g-trancnt) newval)))) ;--- d-bcdcall :: call a function through a binary data object ; ; at this point the stack contains n-1 arguments and a binary object which ; is the address of the compiled lambda expression to go to. We set ; up lbot right above the binary on the stack and call the function. ; (defun d-bcdcall (n) (e-write3 'movab `(,(* -4 (- n 1)) #.Np-reg) '#.Lbot-reg) (e-write3 'movl '(* -4 #.Lbot-reg) 'r0) ; get address to call to (e-write3 'calls '$0 "(r0)") (e-write3 'movab '(-4 #.Lbot-reg) '#.Np-reg) ; set up np after call ) ;--- d-dotailrecursion :: do tail recursion if possible ; name - function name we are to call ; args - arguments to give to function ; ; return t iff we were able to do tail recursion ; We can do tail recursion if: ; g-ret is set indicating that the result of this call will be returned ; as the value of the function we are compiling ; the function we are calling, name, is the same as the function we are ; compiling, g-fname ; there are no variables shallow bound, since we would have to unbind ; them, which may cause problems in the function. ; (defun d-dotailrecursion (name args) (If (and g-ret (eq name g-fname) (do ((loccnt 0) (ll g-locs (cdr ll))) ((null ll) (return t)) (If (dtpr (car ll)) then (If (or (eq 'catcherrset (caar ll)) (greaterp (cdar ll) 0)) then (return nil)) else (incr loccnt)))) then ; evalate the arguments and pop them back to the location of ; the original args. (makecomment '(tail merging)) (comp-note g-fname ": Tail merging being done: " v-form) (let ((g-locs g-locs) (g-loccnt g-loccnt)) (d-pushargs args)) ; push then forget about (let (base-reg nargs) (If (eq g-ftype 'lexpr) then ; the beginning of the local variables ;has been stacked (e-write3 'addl2 '$4 'sp) ; pop off arg count (e-write4 'addl3 '$4 "(sp)" Lbot-reg) (setq base-reg Lbot-reg) ; will push from bot else (setq base-reg oLbot-reg)) ; will push from olbot (setq nargs (length args)) (do ((i nargs (1- i)) (top (* nargs -4) (+ top 4)) (bot 0 (+ bot 4))) ((zerop i)) (e-write3 'movl `(,top ,Np-reg) `(,bot ,base-reg))) (e-write3 'movab `(,(* 4 nargs) ,base-reg) Np-reg) (e-goto g-topsym)) t)) ; return t to indicate that tailrecursion was successful ; Section xxx -- specific function compilers ; ;--- cc-and :: compile an and expression ; We evaluate forms from left to right as long as they evaluate to ; a non nil value. We only have to worry about storing the value of ; the last expression in g-loc. ; (defun cc-and nil (let ((finlab (d-genlab)) (finlab2) (exps (If (cdr v-form) thenret else '(t)))) ; (and) ==> t (If (null (cdr g-cc)) then (d-exp (do ((g-cc (cons nil finlab)) (g-loc) (g-ret) (ll exps (cdr ll))) ((null (cdr ll)) (car ll)) (d-exp (car ll)))) (If g-loc then (setq finlab2 (d-genlab)) (e-goto finlab2) (e-label finlab) (d-move 'Nil g-loc) (e-label finlab2) else (e-label finlab)) else ;--- cdr g-cc is non nil, thus there is ; a quick escape possible if one of the ; expressions evals to nil (If (null g-loc) then (setq finlab (cdr g-cc))) (d-exp (do ((g-cc (cons nil finlab)) (g-loc) (g-ret) (ll exps (cdr ll))) ((null (cdr ll)) (car ll)) (d-exp (car ll)))) ; if g-loc is non nil, then we have evaled the and ; expression to yield nil, which we must store in ; g-loc and then jump to where the cdr of g-cc takes us (If g-loc then (setq finlab2 (d-genlab)) (e-goto finlab2) (e-label finlab) (d-move 'Nil g-loc) (e-goto (cdr g-cc)) (e-label finlab2)))) (d-clearreg)) ; we cannot predict the state of the registers ;--- cc-arg :: get the nth arg from the current lexpr = cc-arg = ; ; the syntax for Franz lisp is (arg i) ; for interlisp the syntax is (arg x i) where x is not evaluated and is ; the name of the variable bound to the number of args. We can only handle ; the case of x being the variable for the current lexpr we are compiling ; (defun cc-arg nil (let ((nillab (d-genlab)) (finlab (d-genlab))) (If (not (eq 'lexpr g-ftype)) then (comp-err " arg only allowed in lexprs")) (If (and (eq (length (cdr v-form)) 2) fl-inter) then (If (not (eq (car g-args) (cadr v-form))) then (comp-err " arg expression is for non local lexpr " v-form) else (setq v-form (cdr v-form)))) (If (or g-loc g-cc) then (If (and (fixp (cadr v-form)) (greaterp (cadr v-form) 0)) then ; simple case (arg n) for positive n (d-move `(immed ,(cadr v-form)) 'reg) (d-clearreg 'r0) (If g-loc then (d-move '"*-4(fp)[r0]" g-loc) else (e-tst '"*-4(fp)[r0]")) (d-handlecc) elseif (or (null (cadr v-form)) (zerop (cadr v-form))) then ; get number of arguments (arg nil) or (arg) or (arg 0) (If g-loc then (d-move "-8(fp)" g-loc)) ; (arg) will always return a non nil value, we ; don't even have to test it. (If (car g-cc) then (e-goto (car g-cc))) else ; general (arg ) (let ((g-loc 'reg) (g-cc (cons nil nillab)) (g-ret)) (d-exp `(cdr ,(cadr v-form)))) ; calc the numeric arg (If g-loc then (d-((move '"*-4(fp)[r0]" g-loc) else (e-tst '"*-4(fp)[r0]")) (d-handlecc) (e-goto finlab) (e-label nillab) ; here we are doing (arg nil) which returns the number ; of args ; which is always true if anyone is testing (If g-loc then (d-move '"-8(fp)" g-loc) (d-handlecc) elseif (car g-cc) then (e-goto (car g-cc))) ;always true (e-label finlab))))) ;--- cm-assq :: assoc with eq for testing = cm-assq = ; ; form: (assq val list) ; (defun cm-assq nil `(do ((xx-val ,(cadr v-form)) (xx-lis ,(caddr v-form) (cdr xx-lis))) ((null xx-lis)) (cond ((eq xx-val (caar xx-lis)) (return (car xx-lis)))))) ;--- cc-atom :: test for atomness = cc-atom = ; (defun cc-atom nil (d-typecmplx (cadr v-form) '#.(concat '$ (plus 1_0 1_1 1_2 1_4 1_5 1_6 1_7 1_9 1_10)))) ;--- c-bcdcall :: do a bcd call = c-bcdcall = ; ; a bcdcall is the franz equivalent of the maclisp subrcall. ; it is called with ; (bcdcall 'b_obj 'arg1 ...) ; where b_obj must be a binary object. no type checking is done. ; (defun c-bcdcall nil (d-callbig 1 (cdr v-form) t)) ;--- cc-bcdp :: check for bcdpness = cc-bcdp = ; (defun cc-bcdp nil (d-typesimp (cadr v-form) '$5)) ;--- cc-bigp :: check for bignumness = cc-bigp = ; (defun cc-bigp nil (d-typesimp (cadr v-form) '$9)) ;--- c-*catch :: compile a *catch expression = c-*catch = ; ; the form of *catch is (*catch 'tag 'val) ; we evaluate 'tag and set up a catch frame, and then eval 'val ; (defun c-*catch nil (let ((g-loc 'reg) (g-cc nil) (g-ret nil) (finlab (d-genlab)) (beglab (d-genlab))) (d-exp (cadr v-form)) ; calculate tag into r0 (d-pushframe #.F_CATCH 'reg nil) ; retval will be non 0 if we were thrown to, in which case the value ; thrown is in _lispretval. ; If we weren't thrown-to the value should be calculated in r0. (e-write2 'tstl '_retval) (e-write2 'jeql beglab) (e-write3 'movl '_lispretval 'r0) (e-write2 'jbr finlab) (e-label beglab) (d-exp (caddr v-form)) (e-label finlab) (d-popframe) (unpush g-locs) ; remove (catcherrset . 0) (d-clearreg))) ;--- d-pushframe :: put an evaluation frame on the stack ; ; This is equivalant in the C system to 'errp = Pushframe(class,arg1,arg2);' ; We stack a frame which describes the class (will always be F_CATCH) ; and the other option args. ; (defun d-pushframe (class arg1 arg2) (If arg2 then (e-write2 'pushl (e-cvt arg2))) (If arg1 then (e-write2 'pushl (e-cvt arg1))) (e-write2 'pushl (concat '$ class)) (e-write2 'jsb '_qpushframe) (e-write3 'movl 'r0 '_errp) (Push g-locs '(catcherrset . 0))) ;--- d-popframe :: remove an evaluation frame from the stack ; ; This is equivalent in the C system to 'errp = Popframe();' ; (defun d-popframe nil (e-write3 'movl '_errp 'r1) (e-write3 'movl `(,OF_olderrp r1) '_errp)) ;--- c-cond :: compile a "cond" expression = c-cond = ; ; not that this version of cond is a 'c' rather than a 'cc' . ; this was done to make coding this routine easier and because ; it is believed that it wont harm things much if at all ; (defun c-cond nil (makecomment '(beginning cond)) (do ((clau (cdr v-form) (cdr clau)) (finlab (d-genlab)) (nxtlab) (save-reguse) (seent)) ((or (null clau) seent) ; end of cond ; if haven't seen a t must store a nil in r0 (If (null seent) then (d-move 'Nil 'reg)) (e-label finlab)) ; case 1 - expr (If (atom (car clau)) then (comp-err "bad cond clause " (car clau)) ; case 2 - (expr) elseif (null (cdar clau)) then (let ((g-loc (If (or g-cc g-loc) then 'reg)) (g-cc (cons finlab nil)) (g-ret (and g-ret (null (cdr clau))))) (d-exp (caar clau))) ; case 3 - (t expr1 expr2 ...) elseif (or (eq t (caar clau)) (equal ''t (caar clau))) then (let ((g-loc (If (or g-cc g-loc) then 'reg)) g-cc) (d-exps (cdar clau))) (setq seent t) ; case 4 - (expr1 expr2 ...) else (let ((g-loc nil) (g-cc (cons nil (setq nxtlab (d-genlab)))) (g-ret nil)) (d-exp (caar clau))) (setq save-reguse (copy g-reguse)) (let ((g-loc (If (or g-cc g-loc) then 'reg)) g-cc) (d-exps (cdar clau))) (If (or (cdr clau) (null seent)) then (e-goto finlab)) (e-label nxtlab) (setq g-reguse save-reguse))) (d-clearreg)) ;--- c-cons :: do a cons instruction quickly = c-cons = ; (defun c-cons nil (d-pushargs (cdr v-form)) ; there better be 2 args (e-write2 'jsb '_qcons) (setq g-locs (cddr g-locs)) (setq g-loccnt (- g-loccnt 2)) (d-clearreg)) ;--- c-cxr :: compile a cxr instruction = c-cxr = ; ; (defun cc-cxr nil (d-supercxr t nil)) ;--- d-supercxr :: do a general struture reference ; type - one of fixnum-block,flonum-block, ; the type is that of an array, so could be t, nil ; or anything else, since anything except *-block is treated the same ; ; the form of a cxr is (cxr index hunk) but supercxr will handle ; arrays too, so hunk could be (getdata (getd 'arrayname)) ; ; offsetonly is t if we only care about the offset of this element from ; the beginning of the data structure. If offsetonly is t then type ; will be nil. ; ; Note: this takes care of g-loc and g-cc (defun d-supercxr (type offsetonly) (let ((arg1 (cadr v-form)) (arg2 (caddr v-form)) lop rop semisimple) (If (fixp arg1) then (setq lop `(immed ,arg1)) else (d-fixnumexp arg1) ; calculate index into r5 (setq lop 'r5)) ; and remember that it is there ; before we calculate the second expression, we may have to save ; the value just calculated into r5. To be safe we stack away ; r5 if the expression is not simple or semisimple. (If (not (setq rop (d-simple arg2))) then (If (and (eq lop 'r5) (not (setq semisimple (d-semisimple arg2)))) then (d-move lop Cstack)) (let ((g-loc 'reg) g-cc) (d-exp arg2)) (setq rop 'r0) (If (and (eq lop 'r5) (not semisimple)) then (d-move unCstack lop))) (If (eq type 'flonum-block) then (setq lop (d-structgen lop rop 8)) (e-write3 'movq lop 'r4) (e-write2 'jsb '"_qnewdoub") ; box number (d-clearreg) ; clobbers all regs (If (and g-loc (not (eq g-loc 'reg))) then (d-move 'reg g-loc)) (If (car g-cc) then (e-goto (car g-cc))) else (setq lop (d-structgen lop rop 4) rop (If g-loc then (If (eq type 'fixnum-block) then 'r5 else (e-cvt g-loc)))) (If rop then (If offsetonly then (e-write3 'moval lop rop) else (e-write3 'movl lop rop)) (If (eq type 'fixnum-block) then (e-write2 'jsb '"_qnewint") (d-clearreg) (If (not (eq g-loc 'reg)) then (d-move 'reg g-loc)) ; result is always non nil. (If (car g-cc) then (e-goto (car g-cc))) else (If (car g-cc) then (e-gotot (car g-cc)))) elseif g-cc then (If (eq type 'fixnum-block) then (If (car g-cc) then (e-goto (car g-cc))) else (e-write2 'tstl lop) (d-handlecc)))))) ;--- d-semisimple :: check if result is simple enough not to clobber r5 ; currently we look for the case of (getdata (getd 'foo)) ; since we know that this will only be references to r0. ; More knowledge can be added to this routine. ; (defun d-semisimple (form) (or (d-simple form) (and (dtpr form) (eq 'getdata (car form)) (dtpr (cadr form)) (eq 'getd (caadr form)) (dtpr (cadadr form)) (eq 'quote (caadadr form))))) ;--- d-structgen :: generate appropriate address for indexed access ; index - index address, must be (immed n) or r5 (which contains int) ; base - address of base ; width - width of data element ; want to calculate appropriate address for base[index] ; may require emitting instructions to set up registers ; returns the address of the base[index] suitable for setting or reading ; ; the code sees the base as a stack value as a special case since it ; can generate (perhaps) better code for that case. (defun d-structgen (index base width) (If (and (dtpr base) (eq (car base) 'stack)) then (If (dtpr index) ; i.e if index = (immed n) then (d-move index 'r5)) ; get immed in register ; the result is always *n(r6)[r5] (append (e-cvt `(vstack ,(cadr base))) '(r5)) else (If (not (atom base)) ; i.e if base is not register then (d-move base 'r0) ; (if nil gets here we will fail) (d-clearreg 'r0) (setq base 'r0)) (If (dtpr index) then `(,(* width (cadr index)) ;immed index ,base) else `(0 ,base r5)))) ;--- c-rplacx :: complile a rplacx expression = c-rplacx = ; ; This simple calls the general structure hacking function, d-superrplacx ; The argument, hunk, means that the elements stored in the hunk are not ; fixum-block or flonum-block arrays. (defun c-rplacx nil (d-superrplacx 'hunk)) ;--- d-superrplacx :: handle general setting of things in structures ; type - one of fixnum-block, flonum-block, hunk ; see d-supercxr for comments ; form of rplacx is (rplacx index hunk valuetostore) (defun d-superrplacx (type) (let ((arg1 (cadr v-form)) (arg2 (caddr v-form)) (arg3 (cadddr v-form)) lop rop semisimple) ; calulate index and put it in r5 if it is not an immediate ; set lop to the location of the index (If (fixp arg1) then (setq lop `(immed ,arg1)) else (d-fixnumexp arg1) (setq lop 'r5)) ; set rop to the location of the hunk. If we have to ; calculate the hunk, we may have to save r5. ; If we are doing a rplacx (type equals hunk) then we must ; return the hunk in r0. (If (or (eq type 'hunk) (not (setq rop (d-simple arg2)))) then (If (and (eq lop 'r5) (not (setq semisimple (d-semisimple arg2)))) then (d-move lop Cstack)) (let ((g-loc 'r0) g-cc) (d-exp arg2)) (setq rop 'r0) (If (and (eq lop 'r5) (not semisimple)) then (d-move unCstack lop))) (( ; now that the index and data block locations are known, we ; caclulate the location of the index'th element of hunk (setq rop (d-structgen lop rop (If (eq type 'flonum-block) then 8 else 4))) ; the code to calculate the value to store and the actual ; storing depends on the type of data block we are storing in. (If (eq type 'flonum-block) then (If (setq lop (d-simple `(cdr ,arg3))) then (e-write3 'movq (e-cvt lop) rop) else ; preserve rop since it may be destroyed ; when arg3 is calculated (e-write3 'movaq rop "-(sp)") (let ((g-loc 'r0) g-cc) (d-exp arg3)) (d-clearreg 'r0) (e-write3 'movq '(0 r0) "*(sp)+")) elseif (and (eq type 'fixnum-block) (setq arg3 `(cdr ,arg3)) nil) ; fixnum-block is like hunk except we must grab the ; fixnum value out of its box, hence the (cdr arg3) thenret else (If (setq lop (d-simple arg3)) then (e-write3 'movl (e-cvt lop) rop) else ; if we are dealing with hunks, we must save ; r0 since that contains the value we want to ; return. (If (eq type 'hunk) then (d-move 'reg 'stack) (Push g-locs nil) (incr g-loccnt)) (e-write3 'moval rop "-(sp)") (let ((g-loc "*(sp)+") g-cc) (d-exp arg3)) (If (eq type 'hunk) then (d-move 'unstack 'reg) (unpush g-locs) (decr g-loccnt)) (d-clearreg 'r0))))) ;--- cc-cxxr :: compile a "c*r" instr where * = c-cxxr = ; is any sequence of a's and d's ; - arg : argument of the cxxr function ; - pat : a list of a's and d's in the reverse order of that ; which appeared between the c and r ; (defun cc-cxxr (arg pat) (prog (resloc loc qloc sofar togo keeptrack) ; check for the special case of nil, since car's and cdr's ; are nil anyway (If (null arg) then (If g-loc then (d-move 'Nil g-loc) (d-handlecc) elseif (cdr g-cc) then (e-goto (cdr g-cc))) (return)) (If (and (symbolp arg) (setq qloc (d-bestreg arg pat))) then (setq resloc (car qloc) loc resloc sofar (cadr qloc) togo (caddr qloc)) else (setq resloc (If (d-simple arg) thenret else (let ((g-loc 'reg) (g-cc nil) (g-ret nil)) (d-exp arg)) 'r0)) (setq sofar nil togo pat)) (If (and arg (symbolp arg)) then (setq keeptrack t)) ; if resloc is a global variable, we must move it into a register ; right away to be able to do car's and cdr's (If (and (dtpr resloc) (or (eq (car resloc) 'bind) (eq (car resloc) 'vstack))) then (d-move resloc 'reg) (setq resloc 'r0)) ; now do car's and cdr's . Values are placed in r0. We stop when ; we can get the result in one machine instruction. At that point ; we see whether we want the value or just want to set the cc's. ; If the intermediate value is in a register, ; we can do : car cdr cddr cdar ; If the intermediate value is on the local vrbl stack or lbind ; we can do : cdr (do ((curp togo newp) (newp)) ((null curp) (If g-loc then (d-movespec loc g-loc) elseif g-cc then (e-tst loc)) (d-handlecc)) (If (symbolp resloc) then (If (eq 'd (car curp)) then (If (or (null (cdr curp)) (eq 'a (cadr curp))) then (setq newp (cdr curp) ; cdr loc `(0 ,resloc) sofar (append sofar (list 'd))) else (setq newp (cddr curp) ; cddr loc `(* 0 ,resloc) sofar (append sofar (list 'd 'd)))) else (If (or (null (cdr curp)) (eq 'a (cadr curp))) then (setq newp (cdr curp) ; car loc `(4 ,resloc) sofar (append sofar (list 'a))) else (setq newp (cddr curp) ; cdar loc `(* 4 ,resloc) sofar (append sofar (list 'a 'd))))) elseif (and (eq 'd (car curp)) (not (eq '* (car (setq loc (e-cvt resloc)))))) then (setq newp (cdr curp) ; (cdr ) loc (cons '* loc) sofar (append sofar (list 'd))) else (setq loc (e-cvt resloc) newp curp)) (If newp ; if this is not the last move then (setq resloc (d-allocreg (If keeptrack then nil else 'r0))) (d-movespec loc resloc) (If keeptrack then (d-inreg resloc (cons arg sofar))))))) ;--- c-declare :: handle the "declare" form ; if a declare is seen inside a function definition, we just ; ignore it. We probably should see what it is declareing, as it ; might be declaring a special. ; (defun c-declare nil) ;--- c-do :: compile a "do" expression = c-do = ; ; a do has this form: ; (do vrbls tst . body) ; we note the special case of tst being nil, in which case the loop ; is evaluated only once, and thus acts like a let with labels allowed. ; The do statement is a cross between a prog and a lambda. It is like ; a prog in that labels are allowed. It is like a lambda in that ; we stack the values of all init forms then bind to the variables, just ; like a lambda expression (that is the initial values of even specials ; are stored on the stack, and then copied into the value cell of the ; atom during the binding phase. From then on the stack location is ; not used). ; (defun c-do nil (prog (b-vrbls b-tst b-body chklab bodylab x-repeat x-vrbs x-fst g-loc g-cc oldreguse) (forcecomment '(beginning do)) (setq g-loc 'reg chklab (d-genlab) bodylab (d-genlab)) (If (and (cadr v-form) (atom (cadr v-form))) then (setq v-form (d-olddo-to-newdo (cdr v-form)))) (Push g-locs (cons 'do 0 )) ; begin our frame (setq b-vrbls (cadr v-form) b-tst (caddr v-form) b-body (cdddr v-form)) ; push value of init forms on stack (d-pushargs (mapcar '(lambda (x) (If (atom x) then nil ; no init form => nil else (cadr x))) b-vrbls)) ; now bind to the variables in the vrbls form (d-bindlamb (mapcar '(lambda (x) (If (atom x) then x else (car x))) b-vrbls)) ; search through body for all labels and assign them gensymed labels (Push g-labs (cons (d-genlab) (do ((ll b-body (cdr ll)) (res)) ((null ll) res) (If (and (car ll) (symbolp (car ll))) then (Push res (cons (car ll) (d-genlab))))))) ; if the test is non nil, we do the test ; another strange thing, a test form of (pred) will not return ; the value of pred if it is not nil! it will return nil (in this ; way, it is not like a cond clause) (d-clearreg) (If b-tst then (e-label chklab) (let ((g-cc (cons nil bodylab)) g-loc g-ret) (d-exp (car b-tst))) ; eval test ; if false, do body (If (cdr b-tst) then (setq oldreguse (copy g-reguse)) (d-exps (cdr b-tst)) (setq g-reguse oldreguse) else (d-move 'Nil 'reg)) (e-goto (caar g-labs)) ; leave do (e-label bodylab)) ; begin body ; process body (do ((ll b-body (cdr ll)) (g-cc) (g-loc)(g-ret)) ((null ll)) (If (or (null (car ll)) (not (symbolp (car ll)))) then (d-exp (car ll)) else (e-label (cdr (assoc (car ll) (cdar g-labs)))) (d-clearreg))) (If b-tst then ; determine all repeat forms which must be ; evaluated, and all the variables affected. ; store the results in x-repeat and x-vrbs ; if there is just one repeat form, we calculate ; its value directly into where it is stored, ; if there is more than one, we stack them ; and then store them back at once. (do ((ll b-vrbls (cdr ll))) ((null ll)) (If (and (dtpr (car ll)) (cddar ll)) then (Push x-repeat (caddar ll)) (Push x-vrbs (caar ll)))) (If x-vrbs then (If (null (cdr x-vrbs)) ; if just one repeat.. then (let ((g-loc (d-locv (car x-vrbs))) (g-cc nil)) (d-exp (car x-repeat))) else (setq x-fst (car x-repeat)) (d-pushargs (nreverse (cdr x-repeat))) (let ((g-loc (d-locv (car x-vrbs))) (g-cc) (g-ret)) (d-exp x-fst)) (do ((ll (cdr x-vrbs) (cdr ll))) ((null ll)) (d-move 'unstack (d-locv (car ll))) (setq g-locs (cdr g-locs)) (decr g-loccnt)))) (e-goto chklab)) (e-label (caar g-labs)) ; end of do label (d-clearreg) (d-unbind) (setq g-labs (cdr g-labs)))) ;--- d-olddo-to-newdo :: map old do to new do ; ; form of old do is (do var tst . body) ; where var is a symbol, not nil ; (defun d-olddo-to-newdo (v-l) `(do ((,(car v-l) ,(cadr v-l) ,(caddr v-l))) (,(cadddr v-l)) ,@(cddddr v-l))) ;--- cc-dtpr :: check for dtprness = cc-dtpr = ; (defun cc-dtpr nil (d-typesimp (cadr v-form) '$3)) ;--- cc-eq :: compile an "eq" expression = cc-eq = ; (defun cc-eq nil (let ((arg1 (cadr v-form)) (arg2 (caddr v-form)) arg1loc arg2loc) (If (setq arg2loc (d-simple arg2)) then (If (setq arg1loc (d-simple arg1)) then ; eq (d-cmp arg1loc arg2loc) else ; eq (let ((g-loc 'reg) ; put in r0 g-cc g-ret) (d-exp arg1)) (d-cmp 'reg arg2loc)) else ; since second is nonsimple, must stack first ; arg out of harms way (let ((g-loc 'stack) g-cc g-ret) (d-exp arg1) (Push g-locs nil) (incr g-loccnt) (setq g-loc 'reg) ; second arg to r0 (d-exp arg2)) (d-cmp 'unstack 'reg) (setq g-locs (cdr g-locs)) (decr g-loccnt))) (d-invert)) (defun cc-equal nil (let ((lab1 (d-genlab)) (lab11 (d-genlab)) lab2) (d-pushargs (cdr v-form)) (e-write3 'cmpl "-8(r6)" "-4(r6)") (e-gotonil lab1) (d-calltran 'equal '2) ; not eq, try equal. (d-clearreg) (e-write2 'tstl 'r0) (e-gotot lab11) (If g-loc then (d-move 'Nil g-loc)) (If (cdr g-cc) then (e-goto (cdr g-cc)) else (e-goto (setq lab2 (d-genlab)))) (e-writel lab1) (e-dropnp 2) (e-writel lab11) (If g-loc then (d-move 'T g-loc)) (If (car g-cc) then (e-goto (car g-cc))) (If lab2 then (e-((writel lab2)) (setq g-locs (cddr g-locs)) (setq g-loccnt (- g-loccnt 2)))) ;--- c-errset :: compile an errset expression = c-errset = ; ; the errset has this form: (errset 'value ['tag]) ; where tag defaults to t. ; (defun c-errset nil (let ((g-loc 'reg) (g-cc nil) (g-ret nil) (finlab (d-genlab)) (beglab (d-genlab))) (d-exp (If (cddr v-form) then (caddr v-form) else t)) (d-pushframe #.F_CATCH (d-loclit 'ER%all nil) 'reg) ; If retval is non zero then an error has throw us here so we ; must recover the value thrown (from _lispretval) and leave ; If retval is zero then we shoud calculate the expression ; into r0 and put a cons cell around it (e-write2 'tstl '_retval) (e-write2 'jeql beglab) (e-write3 'movl '_lispretval 'r0) (e-write2 'jbr finlab) (e-label beglab) (let ((g-loc 'stack) (g-cc nil)) (d-exp (cadr v-form))) (d-move 'Nil 'stack) ; haven't updated g-loc, g-loccnt but it ; shouldn't hurt (famous last words) (e-write2 'jsb '_qcons) (e-label finlab) (d-popframe) (unpush g-locs) ; remove (catcherrset . 0) (d-clearreg))) ;--- cm-fixnum-cxr :: open code a fixnum-cxr expression. ; ; fixnum-cxr is a compile only hacky function which accesses an element ; of a fixnum space and boxes the resulting fixnum. It can be used ; for rapid access to user defined structures. ; (defun cm-fixnum-cxr () `(internal-fixnum-box (cxr ,@(cdr v-form)))) (defun c-internal-fixnum-box () (let ((g-cc nil) (g-ret nil) (g-loc 'r5)) (d-exp (cadr v-form)) (e-write2 'jsb '_qnewint))) ;--- cc-offset-cxr (defun cc-offset-cxr nil (d-supercxr nil t)) ;--- cc-fixp :: check for a fixnum or bignum = cc-fixp = ; (defun cc-fixp nil (d-typecmplx (cadr v-form) '#.(concat '$ (plus 1_2 1_9)))) ;--- cc-floatp :: check for a flonum = cc-floatp = ; (defun cc-floatp nil (d-typesimp (cadr v-form) '$4)) ;--- c-get :: do a get from the prop list ; (defun c-get nil (If (not (eq 2 (length (cdr v-form)))) then (comp-err "Wrong number of args to get " v-form)) (d-pushargs (cdr v-form)) ; there better be 2 args (e-write2 'jsb '_qget) (d-clearreg) (setq g-locs (cddr g-locs)) (setq g-loccnt (- g-loccnt 2))) ;--- cm-getd :: compile a getd instruction = cm-getd = ; ; the getd function is open coded to look in the third part of a symbol ; cell ; (defun cm-getd nil `(cxr 2 ,(cadr v-form))) ;--- cm-getdata :: compile a getdata instruction = cm-getdata = ; ; the getdata function is open coded to look in the third part of an ; array header. (defun cm-getdata nil `(cxr 2 ,(cadr v-form))) ;--- c-go :: compile a "go" expression = c-go = ; ; we only compile the (go symbol)type expression, we do not ; allow symbol to be anything by a non null symbol. ; (defun c-go nil ; find number of frames we have to go down to get to the label (do ((labs g-labs (cdr labs)) (locs g-locs) (locals 0) (specials 0) (catcherrset 0) (label)) ((null labs) (comp-err "go label not found for expression: " (or v-form))) ; if there are any enclosing *catches or errsets, they will be ; first in g-locs (do nil ((not (and (dtpr (car locs)) (eq (caar locs) 'catcherrset)))) (incr catcherrset) (unpush locs)) (If (car labs) then (If (setq label (do ((lbs (cdar labs) (cdr lbs))) ((null lbs)) (If (eq (caar lbs) (cadr v-form)) then (return (cdar lbs))))) then (If (not (eq labs g-labs)) then (comp-note g-fname ": non local go used : " (or v-form))) (If (greaterp catcherrset 0) then (comp-note g-fname ": Go through a catch or errset " v-form) (do ((i 0 (1+ i))) ((equal catcherrset i)) (d-popframe))) (e-pop locals) (If (greaterp specials 0) then (e-unshallowbind specials)) (e-goto label) (return))) ; tally all locals and specials used in this frame (do () ((dtpr (car locs)) (setq specials (+ specials (cdar locs)) locs (cdr locs))) (setq locs (cdr locs)) (incr locals)))) ;--- cc-ingnore :: just ignore this code ; (defun cc-ignore nil nil) ;--- c-lambexp :: compile a lambda expression = c-lambexp = ; (defun c-lambexp nil (let ((g-loc (If (or g-loc g-cc) then 'reg)) (g-cc nil)) (Push g-locs (cons 'lambda 0)) ; add null lambda header (d-pushargs (cdr v-form)) ; then push vals (d-lambbody (car v-form)) (d-clearreg))) ;--- d-lambbody :: do a lambda body ; - body : body of lambda expression, eg (lambda () dld) ; (defun d-lambbody (body) (d-bindlamb (cadr body)) ; bind locals (setq g-labs (cons nil g-labs)) ; no labels allowed (d-clearreg) (d-exp (do ((ll (cddr body) (cdr ll)) (g-loc) (g-cc) (g-ret)) ((null (cdr ll)) (car ll)) (d-exp (car ll)))) (setq g-labs (cdr g-labs)) (d-unbind)) ; unbind this frame ;--- d-bindlamb :: bind variables in lambda list ; - vrbs : list of lambda variables, may include nil meaning ignore ; (defun d-bindlamb (vrbs) (let ((res (d-bindlrec (reverse vrbs) g-locs 0 g-loccnt))) (If res then (e-setupbind) (mapc '(lambda (vrb) (e-shallowbind (car vrb) (cdr vrb))) res) (e-unsetupbind)))) ;--- d-bindlrec :: recusive routine to bind lambda variables ; - vrb : list of variables yet to bind ; - locs : current location in g-loc ; - specs : number of specials seen so far ; - lev : how far up from the bottom of stack we are. ; returns: list of elements, one for each special, of this form: ; ( stack ) ; where specialvrbname is the name of the special variable, and n is ; the distance from the top of the stack where its initial value is ; located ; also: puts the names of the local variables in the g-locs list, as well ; as placing the number of special variables in the lambda header. ; (defun d-bindlrec (vrb locs specs lev) (If vrb then (let ((spcflg (d-specialp (car vrb))) retv) (If spcflg then (setq specs (1+ specs))) (If (cdr vrb) ; if more vrbls to go ... then (setq retv (d-bindlrec (cdr vrb) (cdr locs) specs (1- lev))) else (rplacd (cadr locs) specs)) ; else fix up lambda hdr (If (not spcflg) then (rplaca locs (car vrb)) else (Push retv `(,(car vrb) stack ,lev))) retv))) ;--- c-list :: compile a list expression = c-list = ; ; this is compiled as a bunch of conses with a nil pushed on the ; top for good measure ; (defun c-list nil (prog (nargs) (setq nargs (length (cdr v-form))) (makecomment '(list expression)) (If (zerop nargs) then (d-move 'Nil 'reg) ; (list) ==> nil (return)) (d-pushargs (cdr v-form)) (e-write2 'clrl '(+ #.Np-reg)) ; stack one nil ; now do the consing (do ((i (max 1 nargs) (1- i))) ((zerop i)) (e-write2 'jsb '_qcons) (d-clearreg) (If (> i 1) then (d-move 'reg 'stack))) (setq g-locs (nthcdr nargs g-locs) g-loccnt (- g-loccnt nargs)))) ;--- d-mapconvert - access : function to access parts of lists ; - join : function to join results ; - resu : function to apply to result ; - form : mapping form ; This function converts maps to an equivalent do form. ; ; in this function, the variable vrbls contains a list of forms, one form ; per list we are mapping over. The form of the form is ; (dummyvariable realarg (cdr dummyvariable)) ; realarg may be surrounded by (setq realarg) ; in the case that the result is the list to be mapped over (this only occurs ; with the function mapc). ; (defun d-mapconvert (access join resu form ) (prog (vrbls finvar acc accform compform tmp testform tempvar lastvar) (setq finvar (gensym 'X) ; holds result vrbls (reverse (maplist '(lambda (arg) ((lambda (temp) (cond ((or resu (cdr arg)) `(,temp ,(car arg) (cdr ,temp))) (t `(,temp (setq ,finvar ,(car arg)) (cdr ,temp))))) (gensym 'X))) (reverse (cdr form)))) ; the access form will either be nil or car. If it is ; nil, then we are doing something like a maplist, ; if the access form is car, then we are doing something ; like a mapcar. acc (mapcar '(lambda (tem) (cond (access `(,access ,(car tem))) (t (car tem)))) vrbls) accform (cond ((or (atom (setq tmp (car form))) (null (setq tmp (d-macroexpand tmp))) (not (member (car tmp) '(quote function)))) `(funcall ,tmp ,@acc)) (t `(,(cadr tmp) ,@acc))) ; the testform checks if any of the lists we are mapping ; over is nil, in which case we quit. testform (cond ((null (cdr vrbls)) `(null ,(caar vrbls))) (t `(or ,@(mapcar '(lambda (x) `(null ,(car x))) vrbls)))) ) ; in the case of mapcans and mapcons, you need two ; extra variables to simulate the nconc. ; testvar gets intermediate results and lastvar ; points to then end of the list (If (eq join 'nconc) then (setq tempvar (gensym 'X) lastvar (gensym 'X) vrbls `((,tempvar) (,lastvar) ,@vrbls))) (return `((lambda (,finvar) (liszt-internal-do ( ,@vrbls) (,testform) ,(cond ((eq join 'nconc) `(cond ((setq ,tempvar ,accform) (cond (,lastvar (liszt-internal-do () ((null (cdr ,lastvar))) (setq ,lastvar (cdr ,lastvar))) (rplacd ,lastvar ,tempvar)) (t (setq ,finvar (setq ,lastvar ,tempvar))))))) (join `(setq ,finvar (,join ,accform ,finvar))) (t accform))) ,(cond ((eq resu 'identity) finvar) (resu `(,resu ,finvar)) (t finvar))) nil )))) ; apply to successive elements, return second arg (defun cm-mapc nil (d-mapconvert 'car nil nil (cdr v-form))) ; apply to successive elements, return list of results (defun cm-mapcar nil (d-mapconvert 'car 'cons 'nreverse (cdr v-form))) ; apply to successive ele((ments, returned nconc of results (defun cm-mapcan nil (d-mapconvert 'car 'nconc 'identity (cdr v-form))) ; apply to successive sublists, return second arg (defun cm-map nil (d-mapconvert nil nil nil (cdr v-form))) ; apply to successive sublists, return list of results (defun cm-maplist nil (d-mapconvert nil 'cons 'reverse (cdr v-form))) ; apply to successive sublists, return nconc of results (defun cm-mapcon nil (d-mapconvert nil 'nconc 'identity (cdr v-form))) ;--- cc-memq :: compile a memq expression = cc-memq = ; (defun cc-memq nil (let ((loc1 (d-simple (cadr v-form))) (loc2 (d-simple (caddr v-form))) looploc finlab) (If loc2 then (d-clearreg 'r1) (If loc1 then (d-move loc1 'r1) else (let ((g-loc 'r1) g-cc g-ret) (d-exp (cadr v-form)))) (d-move loc2 'reg) else (let ((g-loc 'stack) g-cc g-ret) (d-exp (cadr v-form))) (Push g-locs nil) (incr g-loccnt) (let ((g-loc 'reg) g-cc g-ret) (d-exp (caddr v-form))) (d-move 'unstack 'r1) (d-clearreg 'r1) (unpush g-locs) (decr g-loccnt)) ; now set up the jump addresses (If (null g-loc) then (setq loc1 (If (car g-cc) thenret else (d-genlab)) loc2 (If (cdr g-cc) thenret else (d-genlab))) else (setq loc1 (d-genlab) loc2 (d-genlab))) (setq looploc (d-genlab)) (e-write2 'tstl 'r0) (e-write2 'jeql loc2) (e-label looploc) (e-write3 'cmpl 'r1 "4(r0)") (e-write2 'jeql loc1) (e-write3 'movl "(r0)" 'r0) (e-write2 'jneq looploc) (If g-loc then (e-label loc2) ; nil result (d-move 'reg g-loc) (If (cdr g-cc) then (e-goto (cdr g-cc)) else (e-goto (setq finlab (d-genlab)))) else (If (cdr g-cc) then (e-goto (cdr g-cc)) else (e-label loc2))) (If g-loc then (e-label loc1) ; non nil result (d-move 'reg g-loc) (If (car g-cc) then (e-goto (car g-cc))) else (If (null (car g-cc)) then (e-label loc1))) (If finlab then (e-label finlab)))) (e-write2 'jneq looploc) (If g-loc then (e-label loc2) ; nil result (d-move 'reg g-loc) (If (cdr g-cc) then (e-goto (cdr g-cc)) else (e-goto (setq finlab (d-genlab)))) else (If (cdr g-cc) then (e-goto (cdr g-cc)) else (e-label loc2))) (If g-loc then (e-label loc1) ; non nil result (d-move 'reg g-loc) (If (car g-cc) then (e-goto (car g-cc))) else (Icmd/lisp/liszt/camacs.l 644 0 12 7321 2552702335 10321 ;----------- macros for the compiler ------------- (setq sectioncamacsid "@(#)camacs.l 5.4 5/13/81") ; id for SCCS ; Copyright (c) 1980 , The Regents of the University of California. ; All rights reserved. ; author: j. foderaro (declare (macros t)) ; compile and save macros ;--- comp-err ; comp-warn ; comp-note ; comp-gerr ; these are the compiler message producing macros. The form is ; (comp-xxxx val1 val2 val3 ... valn) , all values are printed according ; to this scheme. If vali is an atom, it is patomed, if vali is a ; list, it is evaluated and printed. If vali is N a newline is printed ; ; furthermore ; the name of the current function is printed first ; after comp-err prints the message, it does a throw to Comp-err . ; errors are preceeded by Error: ; warnings by %Warning: and ; notes by %Note: ; The message is sent to the message file ; (def comp-err (macro (l) `(progn (comp-msg "?Error: " v-ifile ": " g-fname ": " ,@(cdr l) ) (setq er-fatal (1+ er-fatal)) (throw nil Comp-error)))) (def comp-warn (macro (l) `(progn (cond (fl-warn (comp-msg "%Warning: " v-ifile ": " g-fname ": " ,@(cdr l))))))) (def comp-note (macro (l) `(progn (cond (fl-verb (comp-msg "%Note: " v-ifile ": " ,@(cdr l))))))) (def comp-gerr (macro (l) `(progn (comp-msg "?Error: " v-ifile ": " g-fname ": ",@(cdr l)) (setq er-fatal (1+ er-fatal))))) ;--- comp-msg - port ; - lst ; prints the lst to the given port. The lst is printed in the manner ; described above, that is atoms are patomed, and lists are evaluated ; and printed, and N prints a newline. The output is always drained. ; (def comp-msg (macro (lis) (do ((xx (cdr lis) (cdr xx)) (res nil)) ((null xx) `(progn ,@(nreverse (cons '(terpri) res)))) (setq res (cons (cond ((atom (car xx)) (cond ((eq (car xx) 'N) '(terpr)) ((stringp (car xx)) `(patom ,(car xx))) (t `(niceprint ,(car xx))))) (t `(niceprint ,(car xx)))) res))))) (def niceprint (macro (l) `((lambda (float-format) (patom ,(cadr l))) "%.2f"))) ;--- super if macro (defun If macro (lis) (prog (majlis minlis revl) (do ((revl (reverse lis) (cdr revl))) ((null revl)) (cond ((eq (car revl) 'else) (setq majlis `((t ,@minlis) ,@majlis) minlis nil)) ((or (eq (car revl) 'then) (eq (car revl) 'thenret)) (setq revl (cdr revl) majlis `((,(car revl) ,@minlis) ,@majlis) minlis nil)) ((eq (car revl) 'elseif)) ((eq (car revl) 'If) (setq majlis `(cond ,@majlis))) (t (setq minlis `( ,(car revl) ,@minlis))))) ; we displace the previous macro, that is we actually replace ; the if list structure with the corresponding cond, meaning ; that the expansion is done only once (rplaca lis (car majlis)) (rplacd lis (cdr majlis)) (return majlis))) ;--- standard push macro ; (Push stackname valuetoadd) (defmacro Push (atm val) `(setq ,atm (cons ,val ,atm))) ;--- pop macro (defmacro Pop (val) `(prog1 (car ,val) (setq ,val (cdr ,val)))) ;--- unpush macro - like pop except top value is thrown away (defmacro unpush (atm) `(setq ,atm (cdr ,atm))) ;--- and an increment macro (defmacro incr (atm) `(setq ,atm (1+ ,atm))) (defmacro decr (atm) `(setq ,atm (1- ,atm))) ;--- add a comment (defmacro makecomment (arg) `(cond (fl-comments (setq g-comments (cons ,arg g-comments))))) ;--- add a comment irregardless of the fl-comments flag (defmacro forcecomment (arg) `(setq g-comments (cons ,arg g-comments))) ;--- write to the .s file (defmacro sfilewrite (arg) `(patom ,arg vp-sfile)) (putprop 'camacs t 'version) ; flag that this file has been loaded d an increment macro (defmacro incr (atm) `(setq ,atm (1+ ,atm))) (defmacro decr (atm) `(setq ,atm (1- ,atm))) ;--- add a comment (defmacro makecomment (arg) `(cond (fl-comments (setq g-comments (cons ,arg g-comments))))) ;--- add a comment irregardless of the fl-comments flag (defmacro forcecmd/lisp/liszt/car.l 644 0 12 66736 2552702336 7677 ; l i s z t v 4 ; ; ; ; A compiler for Franz lisp ; ; Copyright (c) 1980 , The Regents of the University of California. ; All rights reserved. ; author: j. foderaro ; ; Section INIT -- initialization and macros (include "caspecs.l") (eval-when (compile eval) (or (get 'camacs 'version) (load 'camacs)) (or (get 'syscall 'version) (load 'syscall))) ;the version number is maintained by hand, and is written twice ; once for the benefit of the user (setq compiler-name "Lisp Compiler 6.0") ; and the other time for SCCS's what command (setq sccs-compiler-name "@(#)Liszt version 6.0") (setq sectioncarid "@(#)car.l 5.22 7/9/81") ; id for SCCS (setq original-readtable readtable) (setq raw-readtable (makereadtable t)) ;--- special handlers (putprop 'and 'cc-and 'fl-exprcc) (putprop 'arg 'cc-arg 'fl-exprcc) (putprop 'assq 'cm-assq 'fl-exprm) (putprop 'atom 'cc-atom 'fl-exprcc) (putprop 'bigp 'cc-bigp 'fl-exprcc) (putprop 'bcdcall 'c-bcdcall 'fl-expr) (putprop 'bcdp 'cc-bcdp 'fl-exprcc) (putprop '*catch 'c-*catch 'fl-expr) (putprop 'comment 'cc-ignore 'fl-exprcc) (putprop 'cond 'c-cond 'fl-expr) (putprop 'cons 'c-cons 'fl-expr) (putprop 'cxr 'cc-cxr 'fl-exprcc) (putprop 'declare 'c-declare 'fl-expr) (putprop 'do 'c-do 'fl-expr) (putprop 'liszt-internal-do 'c-do 'fl-expr) (putprop 'dtpr 'cc-dtpr 'fl-exprcc) (putprop 'eq 'cc-eq 'fl-exprcc) (putprop 'equal 'cc-equal 'fl-exprcc) (putprop '= 'cc-equal 'fl-exprcc) (putprop 'errset 'c-errset 'fl-expr) (putprop 'fixp 'cc-fixp 'fl-exprcc) (putprop 'floatp 'cc-floatp 'fl-exprcc) (putprop 'get 'c-get 'fl-expr) (putprop 'getd 'cm-getd 'fl-exprm) (putprop 'getdata 'cm-getdata 'fl-exprm) (putprop 'go 'c-go 'fl-expr) (putprop 'list 'c-list 'fl-expr) (putprop 'map 'cm-map 'fl-exprm) (putprop 'mapc 'cm-mapc 'fl-exprm) (putprop 'mapcan 'cm-mapcan 'fl-exprm) (putprop 'mapcar 'cm-mapcar 'fl-exprm) (putprop 'mapcon 'cm-mapcon 'fl-exprm) (putprop 'maplist 'cm-maplist 'fl-exprm) (putprop 'memq 'cc-memq 'fl-exprcc) (putprop 'ncons 'cm-ncons 'fl-exprm) (putprop 'not 'cc-not 'fl-exprcc) (putprop 'null 'cc-not 'fl-exprcc) (putprop 'numberp 'cc-numberp 'fl-exprcc) (putprop 'or 'cc-or 'fl-exprcc) (putprop 'prog 'c-prog 'fl-expr) (putprop 'progn 'cm-progn 'fl-exprm) (putprop 'prog1 'cm-prog1 'fl-exprm) (putprop 'prog2 'cm-prog2 'fl-exprm) (putprop 'quote 'cc-quote 'fl-exprcc) (putprop 'return 'c-return 'fl-expr) (putprop 'rplaca 'c-rplaca 'fl-expr) (putprop 'rplacd 'c-rplacd 'fl-expr) (putprop 'rplacx 'c-rpla((cx 'fl-expr) (putprop '*rplacx 'c-rplacx 'fl-expr) (putprop 'setarg 'c-setarg 'fl-expr) (putprop 'setq 'cc-setq 'fl-exprcc) (putprop 'stringp 'cc-stringp 'fl-exprcc) (putprop 'symbolp 'cc-symbolp 'fl-exprcc) (putprop 'symeval 'cm-symeval 'fl-exprm) (putprop '*throw 'c-*throw 'fl-expr) (putprop 'typep 'cc-typep 'fl-exprcc) (putprop 'zerop 'cm-zerop 'fl-exprm) ; functions which expect fixnum operands (putprop '+ 'c-fixnumop 'fl-expr) (putprop '+ 'addl3 'fixop) (putprop '- 'c-fixnumop 'fl-expr) (putprop '- 'subl3 'fixop) (putprop '* 'c-fixnumop 'fl-expr) (putprop '* 'mull3 'fixop) (putprop '/ 'c-fixnumop 'fl-expr) (putprop '/ 'divl3 'fixop) (putprop '1+ 'cc-oneplus 'fl-exprcc) (putprop '1- 'cc-oneminus 'fl-exprcc) (putprop '\\ 'c-\\ 'fl-expr) ; done in the old way, should be modified ; these have typically fixnum operands, but not always ; there should be some checking here for flonums. ; (putprop '< 'cc-< 'fl-exprcc) (putprop '> 'cc-> 'fl-exprcc) ; functions which can only be compiled (putprop 'assembler-code 'c-assembler-code 'fl-expr) (putprop 'fixnum-cxr 'cm-fixnum-cxr 'fl-exprm) (putprop 'internal-fixnum-box 'c-internal-fixnum-box 'fl-expr) (putprop 'offset-cxr 'cc-offset-cxr 'fl-exprcc) ; Section INTERF -- user interface ;--- lisztinit : called upon compiler startup. If there are any args ; on the command line, we build up a call to liszt, which ; will do the compile. Afterwards we exit. ; (def lisztinit (lambda nil (cond ((greaterp (argv -1) 1) ; build up list of args (do ((i (1- (argv -1)) (1- i)) (arglis)) ((lessp i 1) (setq user-top-level nil) (exit (apply 'liszt arglis))) (setq arglis (cons (argv i) arglis)))) (t (patom compiler-name) (terpr poport) (setq user-top-level nil))))) (setq user-top-level 'lisztinit) ;--- liszt - v-x : list containing file name to compile and optionaly ; and output file name for the assembler source. ; (def liszt (nlambda (v-x) (prog (piport v-root v-ifile v-sfile v-ofile vp-ifile vp-sfile vps-crap vps-include vns-include tmp ntem temgc temcp rootreal g-arrayspecs g-fname g-trueop g-falseop tem temr starttime startptime startgccount fl-asm fl-warn fl-verb fl-inter fl-xref fl-uci fl-run fl-case g-skipcode g-dropnpcnt) ; turn on monitoring if it exists #+monitoring (errset (progn (monitor t) ; turn it on (print 'monitor-on) (terpr)) nil) (setq starttime (sys_time) ; real time in seconds startptime (ptime) startgccount $gccount$) (cond ((null (boundp 'internal-macros)) (setq internal-macros nil))) (cond ((null (boundp 'macros)) (setq macros nil))) (setq er-fatal 0) (setq vps-include nil vns-include nil) ;stack of ports and names (setq twa-list nil) (setq liszt-eof-forms nil) ; set up once only g variables (setq g-comments nil g-current nil ; current function name g-funcs nil g-lits nil g-trueloc nil g-tran nil g-allf nil ; used in xrefs g-reguse '((r4 0 . nil) (r3 0 . nil) (r2 0 . nil) (r7 0 . nil) (r1 0 . nil)) g-trancnt 0 g-ignorereg nil g-trueop 'jneq ; used in e-gotot g-falseop 'jeql ; used in e-gotonil g-litcnt 0) (setq g-spec (gensym 'S)) ; flag for special atom (setq g-fname "") ; no function yet (setq special nil) ; t if all vrbs are special (setq g-functype (gensym) g-bindloc (gensym) g-localf (gensym) g-arrayspecs (gensym) g-tranloc (gensym)) ; declare these special (sstatus feature complr) (d-makespec 't) ; always special ; process input form (setq fl-asm t ; assembler file assembled fl-warn t ; print warnings fl-verb t ; be verbose fl-macl nil ; compile maclisp file fl-inter nil ; do interlisp compatablity fl-tty nil ; put .s on tty fl-comments nil ; put in comments fl-profile nil ; profiling fl-tran t ; use transfer tables fl-vms nil ; vms hacks fl-case nil ; trans uc to lc fl-xref nil ; xrefs fl-run nil ; autorun capability fl-uci nil ; uci lisp compatibility ) ; look in the environment for a LISZT variable ; if it exists, make it the first argument (If (not (eq '|| (setq tem (getenv 'LISZT)))) then (setq v-x (cons (concat "-" tem) v-x))) (do ((i v-x (cdr i))) ; for each argument ((null i)) (setq tem (aexplodec (car i))) (cond ((eq '- (car tem)) ; if switch (do ((j (cdr tem) (cdr j))) ((null j)) (cond ((eq 'S (car j)) (setq fl-asm nil)) ((eq 'C (car j)) (setq fl-comments t)) ((eq 'm (car j)) (setq fl-macl t)) ((eq 'o (car j)) (setq v-ofile (cadr i) i (cdr i))) ((eq 'w (car j)) (setq fl-warn nil)) ((eq 'q (car j)) (setq fl-verb nil)) ((eq 'Q (car j)) (setq fl-verb t)) ((eq 'T (car j)) (setq fl-tty t)) ((eq 'i (car j)) (setq fl-inter t)) ((eq 'p (car j)) (setq fl-profile t)) ((eq 'F (car j)) (setq fl-tran nil)) ((eq 'v (car j)) (setq fl-vms t)) ((eq 'r (car j)) (setq fl-run t)) ((eq 'x (car j)) (setq fl-xref t)) ((eq 'c (car j)) (setq fl-case t)) ((eq 'u (car j)) (setq fl-uci t)) ((eq '- (car j))) ; ignore extra -'s (t (comp-gerr "Unknown switch: " (car j)))))) ((null v-root) (setq temr (reverse tem)) (cond ((and (eq 'l (car temr)) (eq '\. (cadr temr))) (setq rootreal nil) (setq v-root (apply 'concat (reverse (cddr temr))))) (t (setq v-root (car i) rootreal t)))) (t (comp-gerr "Extra input file name: " (car i))))) (cond (fl-vms (setq fl-tran nil))) ; no transfer tables in vms ; if verbose mode, print out the gc messages and ; fasl messages, else turn them off. (cond (fl-verb (setq $gcprint t $ldprint t)) (t (setq $gcprint nil $ldprint nil))) ; -c says set reader to xlate uc to lc (cond (fl-case (sstatus uctolc t))) ; now see what the arguments have left us (cond ((null v-root) (comp-gerr "No file for input")) ((or (portp (setq vp-ifile (car (errset (infile (setq v-ifile (concat v-root '".l"))) nil)))) (and rootreal (portp (setq vp-ifile (car (errset (infile (setq v-ifile v-root)) nil))))))) (t (comp-gerr "Couldn't open the source file :" (or v-ifile)))) ; determine the name of the .s file ; strategy: if fl-asm is t (only assemble) use (v-root).s ; else use /tmp/(PID).s ; ; direct asm to tty temporarily (setq v-sfile '"tty") (setq vp-sfile nil) (If (null fl-tty) then (cond (fl-asm (setq v-sfile (concat '"/tmp/jkf" (boole 1 65535 (sys_getpid)) '".s"))) (t (setq v-sfile (concat v-root '".s")))) (cond ((not (portp (setq vp-sfile (car (errset (outfile v-sfile) nil))))) (comp-gerr "Couldn't open the .s file: " (or v-sfile))))) ; determine the name of the .o file (object file) ; strategy: if we aren't supposed to assemble the .s file ; don't worry about a name ; else if a name is given, use it ; else if use (v-root).o ; if profiling, use .o (cond ((or v-ofile (null fl-asm))) ;ignore ((null fl-profile) (setq v-ofile (concat v-root '".o"))) (t (setq v-ofile (concat v-root ".o")))) ; determine the name of the .x file (xref file) ; strategy: if fl-xref is true, then use (v-root).x ; (cond (fl-xref (cond ((not (portp (setq vp-xfile (car (errset (outfile (setq v-xfile (concat v-root ".x")))))))) (comp-gerr "Can't open the .x file" (or v-xfile)))))) (cond ((checkfatal) (return 1))) (setq readtable (makereadtable nil)) ; use new readtable ; if the macsyma flag is set, change the syntax to the ; maclisp standard syntax. We must be careful that we ; dont clobber any syntax changes made by files preloaded ; into the compiler. (cond (fl-macl (setsyntax '\/ 143) ; 143 = vesc (cond ((equal 143 (status syntax \\)) (setsyntax '\\ 2))) (setsyntax '\| 138) ; 138 = vdq (cond ((equal 198 (status syntax \[)) (setsyntax '\[ 2) (setsyntax '\] 2))) (setq ibase 8.) (sstatus uctolc t) (d-makespec 'ibase) ; to be special (d-makespec 'base) (d-makespec 'tty) (errset (cond ((null (getd 'macsyma-env)) (fasl '/usr/lib/lisp/machacks))) nil)) (fl-uci (load "/usr/lib/lisp/ucifnc") (cvttoucilisp))) (cond (fl-inter (putprop '* 'cc-ignore 'fl-exprcc) ;comment (remprop '* 'fl-expr) )) (cond ((checkfatal) (return 1))) ; leave if fatal errors (If fl-verb then (comp-msg "Compilation begins with " compiler-name ) (comp-msg "source: " v-ifile ", result: " (cond (fl-asm v-ofile) (t v-sfile)))) (setq piport vp-ifile) ; set to standard input (setq liszt-root-name v-root liszt-file-name v-ifile) (If fl-run then (d-printautorun)) (If fl-profile then (e-write1 '".globl mcount")) loop (cond ((atom (errset ; list for debugging, ; errset for production. (do ((i (read piport '<>) (read piport '<>))) ((eq i '<>) nil) (catch (liszt-form i) Comp-error)))) (catch (comp-err "Lisp error during compilation") Comp-error) (setq piport nil) (setq er-fatal (1+ er-fatal)) (return 1))) (close piport) ; if doing special character stuff (maclisp) reassert ; the state (cond (vps-include (comp-note " done include") (setq piport (car vps-include) vps-include (cdr vps-include) v-ifile (car vns-include) (( vns-include (cdr vns-include)) (go loop))) (cond (liszt-eof-forms (do ((ll liszt-eof-forms (cdr ll))) ((null ll)) (cond ((atom (errset (liszt-form (car ll)))) (catch (comp-note "Lisp error during eof forms") Comp-error) (setq piport nil) (return 1)))))) ; reset input base (setq ibase 10.) (setq readtable (makereadtable t)) (d-bindtab) (close vp-sfile) ; close assembler language file ; check for fatal errors and don't leave if so (cond ((checkfatal) (If fl-asm ; unlink .s file then (sys_unlink v-sfile)) ; if it is a tmp (return 1))) ; and ret with error status (comp-note "Compilation complete") (setq tem (Divide (difference (sys_time) starttime) 60)) (setq ntem (ptime)) (setq temcp (Divide (difference (car ntem) (car startptime)) 3600)) (setq temgc (Divide (difference (cadr ntem) (cadr startptime)) 3600)) (comp-note " Time: Real: " (car tem) ":" (cadr tem) ", CPU: " (car temcp) ":" (quotient (cadr temcp) 60.0) ", GC: " (car temgc) ":" (quotient (cadr temgc) 60.0) " for " (difference $gccount$ startgccount) " gcs") (cond (fl-xref (comp-note "Cross reference being generated") (print (list 'File v-ifile) vp-xfile) (terpr vp-xfile) (do ((ii g-allf (cdr ii))) ((null ii)) (print (car ii) vp-xfile) (terpr vp-xfile)) (close vp-xfile))) ; the assember we use must generate the new a.out format ; with a string table. We will assume that the assembler ; is in /usr/lib/lisp/as so that other sites can run ; the new assembler without installing the new assembler ; as /bin/as (cond (fl-asm ; assemble file (comp-note "Assembly begins") (cond ((not (zerop (setq tmp (apply 'process (ncons (concat "/usr/lib/lisp/as -o " v-ofile '" " v-sfile)))))) (comp-gerr "Assembler detected error, code: " tmp) (comp-note "Assembler temp file " v-sfile " is not unlinked")) (t (comp-note "Assembly completed successfully") (sys_unlink v-sfile); unlink tmp file (If fl-run then (sys_chmod v-ofile #O775)))))) (setq readtable original-readtable) #+monitoring (errset (progn (monitor) ; turn off monitoring (print 'monitor-off)) nil) (return 0)))) (def checkfatal (lambda nil (cond ((greaterp er-fatal 0) (catch (comp-err "Compilation aborted due to previous errors") Comp-error) t)))) ;--- liszt-form - i : form to compile ; This compiles one form. ; (def liszt-form (lambda (i) (prog (tmp v-x) ; macro expand loop (If (and (dtpr i) (eq 'macro (d-functyp (car i)))) then (setq i (apply (car i) i)) (go loop)) ; now look at what is left (cond ((eq (car i) 'def) ; jkf mod (cond (fl-verb (print (cadr i)) (terpr)(drain))) (d-dodef i)) ((eq (car i) 'declare) (funcall 'complr-declare (cdr i))) ((eq (car i) 'eval-when) (doevalwhen i)) ((and (eq (car i) 'progn) (equal (cadr i) '(quote compile))) ((lambda (internal-macros) ; compile macros too (mapc 'liszt-form (cddr i))) t)) ((or (and (eq (car i) 'includef) (setq tmp (eval (cadr i)))) (and (eq (car i) 'include ) (setq tmp (cadr i)))) (cond ((or (portp (setq v-x (car (errset (infile tmp) nil)))) (portp (setq v-x (car (errset (infile (concat '"/usr/lib/lisp" tmp)) nil)))) (portp (setq v-x (car (errset (infile (concat tmp '".l")) nil))))) (setq vps-include (cons piport vps-include)) (setq piport v-x) (comp-note " INCLUDEing file: " tmp) (setq vns-include (cons v-ifile vns-include) v-ifile tmp)) (t (comp-gerr "Cannot open include file: " tmp)))) ((eq (car i) 'comment) nil) ; just ignore comments (t (Push g-funcs `(eval ,i))))))) ;--- d-dodef :: handle the def form ; - form : a def form: (def name (type args . body)) ; (defun d-dodef (form) (prog (g-fname g-ftype g-args body lambdaform symlab) loop ; extract the components of the def form (setq g-fname (cadr form)) (If (dtpr (caddr form)) then (setq g-ftype (caaddr form) g-args (cadaddr form) body (cddaddr form) lambdaform (caddr form) symlab (gensym 'F)) else (comp-gerr "bad def form " form)) ; check for a def which uses the mit hackish &xxx forms. ; if seen, convert to a standard form and reexamine (If (or (memq '&rest g-args) (memq '&optional g-args) (memq '&aux g-args)) then (setq form `(def ,(cadr form) ,(lambdacvt (cdr lambdaform)))) (go loop)) ; check for legal function name. ; then look at the type of the function and update the data base. (If (null (atom g-fname)) then (comp-err "bad function name") else (setq g-flocal (get g-fname g-localf)) ; check local decl. ; macros are special, they are always evaluated ; and sometimes compiled. (If (eq g-ftype 'macro) then (eval form) (If (and (null macros) (null internal-macros)) then (comp-note g-fname " macro will not be compiled") (return nil)) (Push g-funcs `(macro ,symlab ,g-fname)) elseif g-flocal then (If (null (or (eq g-ftype 'lambda) (eq g-ftype 'nlambda))) then (comp-err "bad type for local fcn" g-ftype)) elseif (or (eq g-ftype 'lambda) (eq g-ftype 'lexpr)) then (Push g-funcs `(lambda ,symlab ,g-fname)) (putprop g-fname 'lambda g-functype) elseif (eq g-ftype 'nlambda) then (Push g-funcs `(nlambda ,symlab ,g-fname)) (putprop g-fname 'nlambda g-functype) else (comp-err " bad function type " g-ftype))) (setq g-skipcode nil) ;make sure we aren't skipping code (forcecomment `(fcn ,g-ftype ,g-fname)) (If g-flocal then (comp-note g-fname " is a local function") (e-writel (car g-flocal)) else (If (null fl-vms) then (e-write2 '".globl" symlab)) (e-writel symlab)) (setq g-locs nil g-loccnt 0 g-labs nil g-loc 'reg g-cc nil g-ret t g-topsym (d-genlab)) (If fl-xref then (setq g-refseen (gensym) g-reflst nil)) (d-clearreg) ; set up global variables which maintain knowledge about ; the stack. these variables are set up as if the correct ; number of args were passed. (Push g-locs (cons 'lambda 0)) (setq g-currentargs (length g-args)) (mapc '(lambda (x) (Push g-locs nil) (incr g-loccnt)) g-args) (d-prelude) ; do beginning stuff (d-lambbody lambdaform) ; emit code (d-fini) (If fl-xref then (Push g-allf (cons g-fname (cons (cond (g-flocal (cons g-ftype 'local)) (t g-ftype)) g-reflst)))))) ;--- d-prelude :: emit code common to beginning of all functions ; (defun d-prelude nil (If g-flocal then (e-write3 'movl 'r10 '"-(sp)") ; (faster than pushl) (e-write3 'movab `(,(* -4 g-currentargs) r6) 'r10) (e-writel g-topsym) else (e-write2 '".word" '0x5c0) (If fl-profile then (e-write3 'movab 'mcounts 'r0) (e-write2 'jsb 'mcount)) (e-write3 'movab 'linker '#.bind-reg) (If (eq g-ftype 'lexpr) then (e-write4 'subl3 '$4 Lbot-reg '"-(sp)") ; set up base for (arg) (e-writel g-topsym) (e-write3 'movl Np-reg oLbot-reg) ; will stack num of args (e-write4 'subl3 Lbot-reg Np-reg 'r0) ; arg cnt again (e-write3 'movab '"0x1400(r0)" np-plus) ; stack lispval (e-write3 'movl '(0 #.oLbot-reg) '"-(sp)") ; also on runtime stk else ; set up old lbot register, base register for variable ; references (e-write3 'movl '#.Lbot-reg '#.oLbot-reg) ; make sure the np register points where it should since ; the caller might have given too few or too many args (e-write3 'movab `(,(* 4 g-currentargs) #.oLbot-reg) '#.Np-reg) (e-writel g-topsym)))) ;--- d-fini :: emit code at end of function (defun d-fini nil (If g-flocal then (e-write3 'movl '"(sp)+" 'r10) (e-write1 'rsb) else (e-return))) ;--- d-bindtab :: emit binder table when all functions compiled ; (defun d-bindtab nil (setq g-skipcode nil) ; make sure this isnt ignored (e-writel "bind_org") (e-write2 ".set linker_size," (length g-lits)) (e-write2 ".set trans_size," (length g-tran)) (do ((ll (setq g-funcs (nreverse g-funcs)) (cdr ll))) ((null ll)) (If (memq (caar ll) '(lambda nlambda macro eval)) then (e-write2 '".long" (cdr (assoc (caar ll) '((lambda . 0) (nlambda . 1) (macro . 2) (eval . 99))))) else (comp-err " bad type in lit list " (car ll)))) (e-write1 ".long -1") (e-write1 '"lit_org:") (d-asciiout (nreverse g-lits)) (If g-tran then (d-asciiout (nreverse g-tran))) (d-asciiout (mapcar '(lambda (x) (If (eq (car x) 'eval) then (cadr x) else (caddr x))) g-funcs)) (e-write1 '"lit_end:")) ;--- d-asciiout :: print a list of asciz strings ; (defun d-asciiout (args) (do ((lits args (cdr lits)) (form)) ((null lits)) (setq form (explode (car lits)) formsiz (length form)) (do ((remsiz formsiz) (curform form) (thissiz)) ((zerop remsiz)) (If (greaterp remsiz 60) then (sfilewrite '".ascii \"") else (sfilewrite '".asciz \"")) (setq thissiz (min 60 remsiz)) (do ((count thissiz (1- count))) ((zerop count) (sfilewrite (concat '\" (ascii 10))) (setq remsiz (difference remsiz thissiz))) (If (eq ch-newline (car curform)) then (sfilewrite '\\012) else (If (or (eq '\\ (car curform)) (eq '\" (car curform))) then (sfilewrite '\\)) (sfilewrite (car curform))) (setq curform (cdr curform)))))) ;--- doevalwhen, process evalwhen directive. This is inadequate. ; (def doevalwhen (lambda (v-f) (prog (docom dolod) (setq docom (memq 'compile (cadr v-f)) dolod (memq 'load (cadr v-f))) (mapc '(lambda (frm) (cond (docom(( (eval frm))) (cond (dolod ((lambda (internal-macros) (liszt-form frm)) t)))) (cddr v-f))))) ;---- dodcl - forms declare form ; process the declare form given. We evaluate each arg ; (defun complr-declare fexpr (forms) (do ((i forms (cdr i))) ((null i)) (cond ((and (atom (caar i)) (getd (caar i))) (eval (car i))) ; if this is a function (t (comp-warn "Unknown declare attribute: " (car i)))))) ;---> handlers for declare forms ; (def *fexpr (nlambda (args) (mapc '(lambda (v-a) (putprop v-a 'nlambda g-functype)) args))) (def nlambda (nlambda (args) (mapc '(lambda (v-a) (putprop v-a 'nlambda g-functype)) args))) (def special (nlambda (v-l) (mapc '(lambda (v-a) (putprop v-a t g-spec) ) v-l) t)) (def unspecial (nlambda (v-l) (mapc '(lambda (v-a) (putprop v-a nil g-spec)) v-l) t)) (def *expr (nlambda (args) (mapc '(lambda (v-a) (cond ((atom v-a) (putprop v-a 'lambda g-functype)) (t (comp-warn "Bad declare form " v-a " in list " args)))) args) t)) (def *lexpr (nlambda (args) (mapc '(lambda (v-a) (putprop v-a 'lexpr g-functype)) args) t)) ; ignore (def fixnum (nlambda (args) nil)) ; ignore (def macarray (nlambda (v-l) (mapc '(lambda (x) (If (dtpr x) then (putprop (car x) (cdr x) g-arrayspecs) (putprop (car x) 'array g-functype) else (comp-err "Bad macerror form" x))) v-l))) (def flonum (nlambda (args) nil)) ; ignore (def macros (nlambda (args) (setq macros (car args)))) (def specials (nlambda (args) (setq special (car args)))) (def localf (nlambda (args) (mapc '(lambda (ar) (If (null (get ar g-localf)) then (putprop ar (cons (d-genlab) -1) g-localf))) args))) ;---> end declare form handlers ;--- lambdacvt ; converts a lambda expression with &optional, &rest and &aux forms in ; the argument list into a lexpr which will do the desired function. ; method of operation ; the argument list is examined and the following lists are made: ; vbs - list of variables to be lambda bound ; opl - list of optional forms ; vals - list of values to be assigned to the vbs ; (def lambdacvt (lambda (exp) (prog (arg vbs vals opl rest opflg restflg narg narg2 narg3 auxflg avbs) (do ((ll (car exp) (cdr ll)) (count 1 (1+ count))) ((null ll)) (cond ((eq '&rest (car ll)) (setq restflg t opflg nil count (1- count))) ((eq '&optional (car ll)) (setq opflg t count (1- count))) ((eq '&aux (car ll)) (setq auxflg t opflg nil restflg nil count (1- count))) (opflg (cond ((atom (setq arg (car ll))) (setq opl (cons (cons (ncons arg) count) opl) vbs (cons arg vbs) vals (cons nil vals))) ((cddr arg) (setq vbs (cons (car arg) (cons (caddr arg) vbs)) vals (cons nil (cons nil vals)) opl (cons (cons arg count) opl))) (t (setq vbs (cons (car arg) vbs) vals (cons nil vals) opl (cons (cons arg count) opl))))) (restflg (setq vbs (cons (car ll) vbs) vals (cons nil vals) rest (cons (car ll) count))) (auxflg (setq count (1- count)) (cond ((atom (setq arg (car ll))) (setq avbs (cons (ncons arg) avbs))) (t (setq avbs (cons arg avbs))))) (t (setq vbs (cons (car ll) vbs) vals (cons `(arg ,count) vals))))) (setq narg (gensym)) (return `(lexpr (,narg) ((lambda ,(nreverse vbs) ,@(mapcar '(lambda (arg) `(cond ((greaterp ,(cdr arg) ,narg) ,@(cond ((cadar arg) `((setq ,(caar arg) ,(cadar arg)))))) (t (setq ,(caar arg) (arg ,(cdr arg))) ,@(cond ((cddar arg) `((setq ,(caddar arg) t))))))) (nreverse opl)) ,@(cond (rest (setq narg2 (gensym) narg3 (gensym)) `((do ((,narg2 ,narg (1- ,narg2)) (,narg3 nil (cons (arg ,narg2) ,narg3))) ((lessp ,narg2 ,(cdr rest)) (setq ,(car rest) ,narg3)))))) ,@(cond (auxflg `((let* ,(nreverse avbs) ,@(cdr exp)))) (t (cdr exp)))) ,@(nreverse vals))))))) ; this routine is copied from ccb.l so we can make it a local function ; in both files ;--- d-genlab :: generate a pseudo label ; (defun d-genlab nil (gensym 'L)) ;--- d-autorunhead ; (defun d-printautorun nil (sfilewrite ".set exit,1 .word 0x0000 subl2 $8,sp movl 8(sp),(sp) # argc movab 12(sp),r0 movl r0,4(sp) # argv QL1: tstl (r0)+ # null args term ? bneq QL1 cmpl r0,*4(sp) # end of 'env' or 'argv' ? blss QL2 tstl -(r0) # envp's are in list QL2: movab dr,8(sp) movab ln,4(sp) movab 4(sp),r1 movl sp,r2 pushl r0 #stack environment pushl r1 pushab ln calls $3,_execve chmk $exit ln: .asciz \"/usr/ucb/lisp\" dr: .asciz \"-f\" .set exece,59 _execve: .word 0x0000 chmk $exece chmk $exit ret ")) ntautorun nil (sfilewrite ".set cmd/lisp/liszt/caspecs.l 644 0 12 4251 2552702337 10514 ;------ special variables -------- ;sccs id: @(#)caspecs.l 5.6 7/1/81 ; Copyright (c) 1980 , The Regents of the University of California. ; All rights reserved. ; author: j. foderaro ; global franz special variables (declare (special $gcprint ; t means print stats when gc occurs. $ldprint ; t means print fasl messages $gccount$ ; incremented every gc float-format ; printf string used to print flonums )) (declare (special v-form g-loc g-cc g-locs g-loccnt g-labs g-args g-ret g-skipcode g-dropnpcnt v-ifile g-bindloc fl-comments g-tran g-trancnt g-tranloc g-topsym g-reguse g-ignorereg g-arrayspecs fl-inter fl-xref g-trueop g-falseop g-lits g-litcnt g-funcs g-spec Np-reg Lbot-reg bind-reg np-plus bNp-reg oLbot-reg Bnp-val ch-newline compiler-name internal-macros old-top-level poport piport compiler-name readtable original-readtable er-fatal ibase fl-macl fl-tty g-functype g-spec g-litcnt g-trueloc g-lits g-funcs g-fname g-comments g-localf g-flocal g-ftype twa-list old-declare-fcn vps-include vns-include fl-verb user-top-level $gccount$ macros g-current fl-profile fl-tran g-allf fl-vms vp-xfile v-xfile vms-pointers g-refseen g-reflst fl-warn g-currentargs $gc-count$ special liszt-eof-forms liszt-root-name liszt-file-name k-ftype vp-sfile formsiz Cstack unCstack ; should be constants arithequiv ) ;local functions in car.l (localf lcfform dodef d-prelude d-fini d-bindtab d-asciiout doevalwhen lambdacvt) ;local functions for cadr and cddr must be calculated ) ;--- parameters: these must be evaluated at compile time so readmacros will ; work (eval-when (compile load eval) (setq Np-reg 'r6 Lbot-reg 'r7 bind-reg 'r8 np-plus '(+ r6) bNp-reg 'r5 oLbot-reg 'r10 ch-newline (ascii #\lf))) (eval-when (compile load eval) (setq Bnp-val '_bnp)) ;--- evaluation frame parameters. These must correspond to what is ; in h/frame.h in the C system (eval-when (compile load eval) (setq C_GO 1 C_RET 2 C_THROW 3 C_RESET 4) (setq F_PROG 1 F_CATCH 2 F_RESET 3)) ; offsets in frame (setq OF_olderrp 12) ; 12 bytes from base of error frame (eval-when (compile load eval) (setq Np-reg 'r6 Lbot-reg 'r7 bind-reg 'r8 np-plus '(+ r6) bNp-reg 'r5 oLbot-reg 'r10 ch-newline (ascii #\lf))) (eval-when (compile load eval) (setq Bnp-val '_bnp)) ;--- evaluation frame parameters. These must correspond to what is ; in h/frame.h in the C system (eval-when (compile load eval) cmd/lisp/liszt/cddr.l 644 0 12 132425 2552702340 10046 (include "caspecs.l") (eval-when (compile) (fasl 'camacs)) (setq sectioncddrid "@(#)cddr.l 5.14 7/1/81") ; id for SCCS ; cm-ncons :: macro out an ncons expression = cm-ncons = ; (defun cm-ncons nil `(cons ,(cadr v-form) nil)) ; cc-not :: compile a "not" or "null" expression = cc-not = ; (defun cc-not nil (makecomment '(beginning not)) (If (null g-loc) then (let ((g-cc (cons (cdr g-cc) (car g-cc))) (g-ret nil)) (d-exp (cadr v-form))) else (let ((finlab (d-genlab)) (finlab2 (d-genlab)) (g-ret nil)) ; eval arg and jump to finlab if nil (let ((g-cc (cons finlab nil)) g-loc) (d-exp (cadr v-form))) ; didn't jump, answer must be t (d-move 'T g-loc) (If (car g-cc) then (e-goto (car g-cc)) else (e-goto finlab2)) (e-label finlab) ; answer is nil (d-move 'Nil g-loc) (If (cdr g-cc) then (e-goto (cdr g-cc))) (e-label finlab2)))) ;--- cc-numberp :: check for numberness = cc-numberp = ; (defun cc-numberp nil (d-typecmplx (cadr v-form) '#.(concat '$ (plus 1_2 1_4 1_9)))) ;--- cc-or :: compile an "or" expression = cc-or = ; (defun cc-or nil (let ((finlab (d-genlab)) (finlab2) (exps (If (cdr v-form) thenret else '(nil)))) ; (or) => nil (If (null (car g-cc)) then (d-exp (do ((g-cc (cons finlab nil)) (g-loc (If g-loc then 'reg)) (g-ret nil) (ll exps (cdr ll))) ((null (cdr ll)) (car ll)) (d-exp (car ll)))) (If g-loc then (setq finlab2 (d-genlab)) (e-goto finlab2) (( (e-label finlab) (d-move 'reg g-loc) (e-label finlab2) else (e-label finlab)) else (If (null g-loc) then (setq finlab (car g-cc))) (d-exp (do ((g-cc (cons finlab nil)) (g-loc (If g-loc then 'reg)) (g-ret nil) (ll exps (cdr ll))) ((null (cdr ll)) (car ll)) (d-exp (car ll)))) (If g-loc then (setq finlab2 (d-genlab)) (e-goto finlab2) (e-label finlab) (d-move 'reg g-loc) (e-goto (car g-cc)) ; result is t (e-label finlab2))) (d-clearreg))) ; we are not sure of the state due to possible branches. ;--- c-prog :: compile a "prog" expression = c-prog = ; ; for interlisp compatibility, we allow the formal variable list to ; contain objects of this form (vrbl init) which gives the initial value ; for that variable (instead of nil) ; (defun c-prog nil (let (g-loc g-cc seeninit initf ((spcs locs initsv . initsn) (d-classify (cadr v-form))) (p-rettrue g-ret) (g-ret nil)) (e-pushnil (length locs)) ; locals initially nil (d-bindprg spcs locs) ; bind locs and specs (cond (initsv (d-pushargs initsv) (mapc '(lambda (x) (d-move 'unstack (d-loc x)) (decr g-loccnt) (unpush g-locs)) (nreverse initsn)))) ; determine all possible labels (do ((ll (cddr v-form) (cdr ll)) (labs nil)) ((null ll) (setq g-labs `((,(d-genlab) ,@labs) ,@g-labs))) (If (and (car ll) (symbolp (car ll))) then (If (assq (car ll) labs) then (comp-err "label is mulitiply defined " (car ll)) else (setq labs (cons (cons (car ll) (d-genlab)) labs))))) ; compile each form which is not a label (d-clearreg) ; unknown state after binding (do ((ll (cddr v-form) (cdr ll))) ((null ll)) (If (or (null (car ll)) (not (symbolp (car ll)))) then (d-exp (car ll)) else (e-label (cdr (assq (car ll) (cdar g-labs)))) (d-clearreg)))) ; dont know state after label ; result is nil if fall out and care about value (If (or g-cc g-loc) then (d-move 'Nil 'reg)) (e-label (caar g-labs)) ; return to label (setq g-labs (cdr g-labs)) (d-unbind)) ; unbind our frame ;--- d-bindprg :: do binding for a prog expression ; - spcs : list of special variables ; - locs : list of local variables ; - specinit : init values for specs (or nil if all are nil) ; (defun d-bindprg (spcs locs) ; place the local vrbls and prog frame entry on the stack (setq g-loccnt (+ g-loccnt (length locs)) g-locs (nconc locs `((prog . ,(length spcs)) ,@g-locs))) ; now bind the specials, if any, to nil (If spcs then (e-setupbind) (mapc '(lambda (vrb) (e-shallowbind vrb 'Nil)) spcs) (e-unsetupbind))) ;--- d-unbind :: remove one frame from g-locs ; (defun d-unbind nil (do ((count 0 (1+ count))) ((dtpr (car g-locs)) (If (not (zerop (cdar g-locs))) then (e-unshallowbind (cdar g-locs))) (cond ((not (zerop count)) (e-dropnp count) (setq g-loccnt (- g-loccnt count)))) (setq g-locs (cdr g-locs))) (setq g-locs (cdr g-locs)))) ;--- d-classify :: seperate variable list into special and non-special ; - lst : list of variables ; returns ( xxx yyy zzz . aaa) ; where xxx is the list of special variables and ; yyy is the list of local variables ; zzz are the non nil initial values for prog variables ; aaa are the names corresponding to the values in zzz ; (defun d-classify (lst) (do ((ll lst (cdr ll)) (locs) (spcs) (init) (initsv) (initsn) (name)) ((null ll) (cons spcs (cons locs (cons initsv initsn)))) (If (atom (car ll)) then (setq name (car ll)) else (setq name (caar ll)) (Push initsn name) (Push initsv (cadar ll))) (If (d-specialp name) then (Push spcs name) else (Push locs name)))) ; cm-progn :: compile a "progn" expression = cm-progn = ; (defun cm-progn nil `((lambda nil ,@(cdr v-form)))) ; cm-prog1 :: compile a "prog1" expression = cm-prog1 = ; (defun cm-prog1 nil (let ((gl (d-genlab))) `((lambda (,gl) ,@(cddr v-form) ,gl) ,(cadr v-form)))) ; cm-prog2 :: compile a "prog2" expression = cm-prog2 = ; (defun cm-prog2 nil (let ((gl (d-genlab))) `((lambda (,gl) ,(cadr v-form) (setq ,gl ,(caddr v-form)) ,@(cdddr v-form) ,gl) nil))) ;--- cc-quote : compile a "quote" expression = cc-quote = ; ; if we are just looking to set the ; cc, we just make sure ; we set the cc depending on whether the expression quoted is ; nil or not. (defun cc-quote nil (let ((arg (cadr v-form)) argloc) (If (null g-loc) then (If (and (null arg) (cdr g-cc) then (e-goto (cdr g-cc)) elseif (and arg (car g-cc)) then (e-goto (car g-cc))) elseif (null g-cc) then (comp-warn "losing the value of this expression " (or v-form))) else (d-move (d-loclit arg nil) g-loc) (d-handlecc)))) ;--- d-loc :: return the location of the variable or value in IADR form ; - form : form whose value we are to locate ; ; if we are given a xxx as form, we check yyy; ; xxx yyy ; -------- --------- ; nil Nil is always returned ; symbol return the location of the symbols value, first looking ; in the registers, then on the stack, then the bind list. ; If g-ingorereg is t then we don't check the registers. ; We would want to do this if we were interested in storing ; something in the symbol's value location. ; number always return the location of the number on the bind ; list (as a (lbind n)) ; other always return the location of the other on the bind ; list (as a (lbind n)) ; (defun d-loc (form) (If (null form) then 'Nil elseif (numberp form) then (If (and (fixp form) (greaterp form -1025) (lessp form 1024)) then `(fixnum ,form) ; small fixnum else (d-loclit form nil)) elseif (symbolp form) then (If (and (null g-ignorereg) (car (d-bestreg form nil))) thenret else (If (d-specialp form) then (d-loclit form t) else (do ((ll g-locs (cdr ll)) ; check stack (n g-loccnt)) ((null ll) (comp-warn (or form) " declared special by compiler") (d-makespec form) (d-loclit form t)) (If (atom (car ll)) then (If (eq form (car ll)) then (return `(stack ,n)) else (setq n (1- n))))))) else (d-loclit form nil))) ;--- d-loclit :: locate or add litteral to bind list ; - form : form to check for and add if not present ; - flag : if t then if we are given a symbol, return the location of ; its value, else return the location of the symbol itself ; ; scheme: we share the locations of atom (symbols,numbers,string) but always ; create a fresh copy of anything else. (defun d-loclit (form flag) (prog (loc onplist symboltype) (If (null form) then (return 'Nil) elseif (symbolp form) then (setq symboltype t) (cond ((setq loc (get form g-bindloc)) (setq onplist t))) elseif (atom form) then (do ((ll g-lits (cdr ll)) ; search for atom on list (n g-litcnt (1- n))) ((null ll)) (If (eq form (car ll)) then (setq loc n) ; found it (return)))) ; leave do (If (null loc) then (Push g-lits form) (setq g-litcnt (1+ g-litcnt) loc g-litcnt) (cond ((and symboltype (null onplist)) (putprop form loc g-bindloc)))) (return (If (and flag symboltype) then `(bind ,loc) else `(lbind ,loc))))) ;--- d-locv :: find the location of a value cell, and dont return a register ; (defun d-locv (sm) (let ((g-ignorereg t)) (d-loc sm))) ;--- c-setarg :: set a lexpr's arg = cc-setarg = ; form is (setarg index value) ; (defun c-setarg nil (If (not (eq 'lexpr g-ftype)) then (comp-err "setarg only allowed in lexprs")) (If (and fl-inter (eq (length (cdr v-form)) 3)) ; interlisp setarg then (If (not (eq (cadr v-form) (car g-args))) then (comp-err "setarg: can only compile local setargs " v-form) else (setq v-form (cdr v-form)))) (d-pushargs (list (cadr v-form))) ; stack index (let ((g-loc 'reg) (g-cc nil) (g-ret nil)) (d-exp (caddr v-form))) (d-clearreg 'r1) ; indicate we are clobbering r1 (e-write3 'movl `(* -4 #.Np-reg) 'r1) ; actual number to r1 (e-write3 'movl 'r0 "*-4(fp)[r1]") ; store value in (e-pop 1) (unpush g-locs) (decr g-loccnt)) ;--- cc-stringp :: check for string ness = cc-stringp = ; (defun cc-stringp nil (d-typesimp (cadr v-form) '$0)) ;--- cc-symbolp :: check for symbolness = cc-symbolp = ; (defun cc-symbolp nil (d-typesimp (cadr v-form) '$1)) ;--- c-return :: compile a "return" statement = c-return = ; (defun c-return nil ; value is always put in r0 (let ((g-loc 'reg) g-cc g-ret) (d-exp (cadr v-form))) ; if we are doing a non local return, compute number of specials to unbind ; and locals to pop (If (car g-labs) then (e-goto (caar g-labs)) else (do ((loccnt 0) (speccnt 0) (ll g-labs (cdr ll)) (locs g-locs)) ((null ll) (comp-err "return used not within a prog or do")) (If (car ll) then (comp-note g-fname ": non local return used ") ; unbind down to but not including ; this frame. (If (greaterp loccnt 0) then (e-pop loccnt)) (If (greaterp speccnt 0) then (e-unshallowbind speccnt)) (e-goto (caar ll)) (return) else ; determine number of locals and special on ; stack for this frame, add to running ; totals (do () ((dtpr (car locs)) (setq speccnt (+ speccnt (cdar locs)) locs (cdr locs))) (incr loccnt) (setq locs (cdr locs))))))) ; c-rplaca :: compile a "rplaca" expression = c-rplaca = ; (defun c-rplaca nil (let ((ssimp (d-simple (caddr v-form))) (g-ret nil)) (let ((g-loc (If ssimp then 'reg else 'stack)) (g-cc nil)) (d-exp (cadr v-form))) (If (null ssimp) then (Push g-locs nil) (incr g-loccnt) (let ((((g-loc 'r1) (g-cc nil)) (d-exp (caddr v-form))) (d-move 'unstack 'reg) (unpush g-locs) (decr g-loccnt) (e-move 'r1 '(4 r0)) else (e-move (e-cvt ssimp) '(4 r0))) (d-clearreg))) ; cant tell what we are clobbering ; c-rplacd :: compile a "rplacd" expression = c-rplacd = ; (defun c-rplacd nil (let ((ssimp (d-simple (caddr v-form))) (g-ret nil)) (let ((g-loc (If ssimp then 'reg else 'stack)) (g-cc nil)) (d-exp (cadr v-form))) (If (null ssimp) then (Push g-locs nil) (incr g-loccnt) (let ((g-loc 'r1) (g-cc nil)) (d-exp (caddr v-form))) (d-move 'unstack 'reg) (unpush g-locs) (decr g-loccnt) (e-move 'r1 '(0 r0)) else (e-move (e-cvt ssimp) '(0 r0))) (d-clearreg))) ; c-set :: compile a "set" expression = c-set = ;--- cc-setq :: compile a "setq" expression = c-setq = ; (defun cc-setq nil (let (tmp) (If (oddp (length (cdr v-form))) then (comp-err "wrong number of args to setq " (or v-form)) elseif (cdddr v-form) ; if multiple setq's then (do ((ll (cdr v-form) (cddr ll)) (g-loc) (g-cc nil)) ((null (cddr ll)) (setq tmp ll)) (setq g-loc (d-locv (car ll))) (d-exp (cadr ll)) (d-clearuse (car ll))) else (setq tmp (cdr v-form))) ; do final setq (let ((g-loc (d-locv (car tmp))) (g-cc (If g-loc then nil else g-cc)) (g-ret nil)) (d-exp (cadr tmp)) (d-clearuse (car tmp))) (If g-loc then (d-move (d-locv (car tmp)) g-loc) (If g-cc then (d-handlecc))))) ; cc-typep :: compile a "typep" expression = cc-typep = ; ; this returns the type of the expression, it is always non nil ; (defun cc-typep nil (let ((argloc (d-simple (cadr v-form))) (g-ret)) (If (null argloc) then (let ((g-loc 'reg) g-cc) (d-exp (cadr v-form))) (setq argloc 'reg)) (If g-loc then (e-write4 'ashl '$-9 (e-cvt argloc) 'r0) (e-write3 'cvtbl "_typetable+1[r0]" 'r0) (e-write3 'movl "_tynames+4[r0]" 'r0) (e-write3 'movl "(r0)" (e-cvt g-loc))) (If (car g-cc) then (e-goto (car g-cc))))) ; cm-symeval :: compile a symeval expression. ; the symbol cell in franz lisp is just the cdr. ; (defun cm-symeval nil `(cdr ,(cadr v-form))) ; c-*throw :: compile a "*throw" expression =c-*throw = ; ; the form of *throw is (*throw 'tag 'val) . ; we calculate and stack the value of tag, then calculate val ; we call Idothrow to do the actual work, and only return if the ; throw failed. ; (defun c-*throw nil (let ((arg2loc (d-simple (caddr v-form))) g-cc g-ret arg1loc) ; put on the C runtime stack ; value to throw, ; tag to throw to (If arg2loc then (If (setq arg1loc (d-simple (cadr v-form))) then (e-write2 'pushl (e-cvt arg2loc)) (e-write2 'pushl (e-cvt arg1loc)) else (let ((g-loc 'reg)) (d-exp (cadr v-form)) ; calc tag (e-write2 'pushl (e-cvt arg2loc)) (e-write2 'pushl (e-cvt 'reg)))) else (let ((g-loc 'stack)) (d-exp (cadr v-form)) ; calc tag to stack (Push g-locs nil) (incr g-loccnt) (setq g-loc 'reg) (d-exp (caddr v-form)) ; calc value into r0 (e-write2 'pushl (e-cvt 'reg)) (e-write2 'pushl (e-cvt 'unstack)) (unpush g-locs) (decr g-loccnt))) ; now push the type of non local go we are doing, in this case ; it is a C_THROW (e-write2 'pushl '#.(concat '$ C_THROW)) (e-write3 'calls '$3 '_Inonlocalgo) ; never returns )) ;--- cm-zerop :: convert zerop to a quick test = cm-zerop = ; zerop is only allowed on fixnum and flonum arguments. In both cases, ; if the value of the first 32 bits is zero, then we have a zero. ; thus we can define it as a macro: (defun cm-zerop nil (cond ((atom (cadr v-form)) `(and (null (cdr ,(cadr v-form))) (not (bigp ,(cadr v-form))))) (t (let ((gnsy (gensym))) `((lambda (,gnsy) (and (null (cdr ,gnsy)) (not (bigp ,gnsy)))) ,(cadr v-form)))))) ;------ Array hacking section ------ ;--- d-handlearrayref :: general array handler ; this function is called from d-exp when the car is an array (declare macarray) ; In the current array scheme, stores look like array references with one ; extra argument. Thus we must determine if we are accessing or storing in ; the array. ; Note that we must turn g-loc to reg and g-cc to nil since, even though ; d-supercxr handles g-loc and g-cc, d-superrplacx does not and we cannot ; know ahead of time which one we will use. If this seems important, ; we can beef up d-superrplacx ; (defun d-handlearrayref nil (let ((spec (get (car v-form) g-arrayspecs)) expr (g-loc 'reg) g-cc) (makecomment '(array ref)) (If (eq (1+ (length (cdr spec))) (length (cdr v-form))) then (d-dostore spec (cadr v-form) (cddr v-form)) else (setq expr (d-arrayindexcomp (cdr v-form) (cdr spec))) (let ((v-form `(cxr ,expr (getdata (getd ',(car v-form)))))) (d-supercxr (car spec) nil))))) ;--- d-dostore :: store value in array. ; spec - array descriptor from declare, e.g. (foo t 12 3 4) ; value - expression to calculate value to be stored. ; indexes - list of expressions which are the actual indicies. ; (defun d-dostore (spec value indexes) (let (expr gen) (makecomment '(doing store)) ; create an expression for doing index calculation. (setq expr (d-arrayindexcomp indexes (cdr spec)) gen (gensym)) ; calculate value to store and stack it. (d-pushargs (ncons value)) (rplaca g-locs gen) ; name just stacked varib ; do the store operation. (let ((v-form `(rplacx ,expr (getdata (getd ',(car v-form))) ,gen))) (d-superrplacx (car spec))) ; move the value we stored into r0 (d-move 'unstack 'reg) (setq g-locs (cdr g-locs)) (decr g-loccnt))) (defun d-arrayindexcomp (actual formal) (If (null (cdr actual)) then (car actual) ; always allow one arg elseif (eq (length actual) (length formal)) then (do ((ac actual (cdr ac)) (fo formal (cdr fo)) (res)) ((null ac) (cons '+ res)) (setq res (cons (If (null (cdr fo)) then (car ac) else `(* ,(car ac) ,(apply 'times (cdr fo)))) res))) else (comp-err "Wrong number of subscripts to array " actual))) ;------- FIXNUM arithmetic section --------- ; There are a few functions in lisp which are only permitted to take ; fixnum operands and produce fixnum results. The compiler recognizes ; these functions and open codes them. ; ;--- d-fixnumexp :: compute a fixnum from an expression ; x - a lisp expression which must return a fixnum ; ; This is an almost equivalent to d-exp, except that ; 1] it will do clever things if the expression can be open coded in a ; fixnum way. ; 2] the result must be a fixnum, and is left in r5 unboxed. ; (defun d-fixnumexp (x) (d-fixnumcode (d-fixexpand x))) ;--- c-fixnumop :: compute a fixnum result = c-fixnumop = ; This is the extry point into this code from d-exp. The form to evaluate ; is in v-form. The only way we could get here is if the car of v-form ; is a function which we've stated is a fixnum returning function. ; (defun c-fixnumop nil (d-fixnumexp v-form) (e-write2 "jsb" "_qnewint") (d-clearreg)) ;--- d-fixexpand :: pass over a fixnum expression doing local optimizations ; ; This code gets the first look at the operands of a fixnum expression. ; It handles the strange cases, like (+) or (/ 3), and it also insures ; that constants are folded (or collapsed as we call it here). ; ; things to watch out for: ; (+ x y z) we can fold x,y,z , likewise in the case of * ; (- x y z) we can only fold y and z since they are negated but x is not, ; likewise for / (defun d-fixexpand (x) (prog nil (setq x (d-toplevmacroexpand x)) loop (If (and (dtpr x) (symbolp (car x)) (get (car x) 'fixop)) then (If (memq (car x) '(+ *)) then (setq x (cons (car x) (d-collapse (cdr x) (car x)))) else (setq x (cons (car x) (cons (cadr x) (d-collapse (cddr x) (car x)))))) (If (null (cdr x)) then ; (- or +) => 0 (* or /) => 1 (setq x (cdr (assq (car x) '((+ . 0) (- . 0) (* . 1) (/ . 1))))) (go loop) elseif (null (cddr x)) then ; (+ n) => n, (- n) => (- 0 n), (* n) => n, ; (/ n) => (/ 1 n) (setq x (If (memq (car x) '(* +)) then (cadr x) elseif (eq (car x) '-) then `(- 0 ,(cadr x)) elseif (eq (car x) '/) then `(/ 1 ,(cadr x)) else (comp-err "Internal fixexpand error "))) (go loop))) (return x))) ;--- d-toplevmacroexpand :: expand top level form if macro ; a singe level of macro expansion is done. this is a nice general ; routine and should be used by d-exp. ; (defun d-toplevmacroexpand (x) (let ((fnbnd (and (dtpr x) (symbolp (car x)) (getd (car x))))) (If (and fnbnd (or (and (bcdp fnbnd) (eq (getdisc fnbnd) 'macro)) (and (dtpr fnbnd) (eq (car fnbnd) 'macro)))) then (d-toplevmacroexpand (apply fnbnd x)) else x))) ;--- d-collapse :: collapse (fold) constants ; ; this is used to reduce the number of operations. since we know that ; fixnum operations are commutative. ; (defun d-collapse (form op) (let (const res conlist) ; generate list of constants (conlist) and non constants (res) (do ((xx form (cdr xx))) ((null xx)) (If (numberp (car xx)) then (If (fixp (car xx)) then (setq conlist (cons (car xx) conlist)) else (comp-err "Illegal operand in fixnum op " (car xx))) else (setq res (cons (car xx) res)))) ; if no constants found thats ok, but if we found some, ; then collapse and return the form with the collapsed constant ; at the end. (If (null conlist) then form ; no change else (setq res (nreverse (cons (apply (cond ((or (eq op '/) (eq op '*)) 'times) (t 'plus)) (cons (cond ((or (eq op '/) (eq op '*)) 1) (( (t 0)) conlist)) res)))))) (setq Cstack '|-(sp)| unCstack '|(sp)+|) ;---- d-fixnumcode :: emit code for prescanned fixnum expression ; expr - a expression which should return an unboxed fixnum value ; in r5. ; This function checks if the expression is indeed a guaranteed fixnum ; arithmetic expression, and if so , generates code for the operation. ; If the expression is not a fixnum operation, then a normal evaluation ; of the cdr of the expression is done, which will grab the fixnum value ; and put it in r5. ; (defun d-fixnumcode (expr) (let ((operator (and (dtpr expr) (symbolp (car expr)) (get (car expr) 'fixop))) (g-ret nil) tmp) ; the existance of a fixop property on a function says that it is a ; special fixnum only operation. (If (null operator) then (let ((g-loc 'r5) g-cc) ; non fixnum op, do normal (d-exp `(cdr ,expr))) ; eval to get unboxed number else (do ((xx (cdr expr) (cdr xx)) ; fixnum op, scan all args (lop) (rop) (res) (opnd)) ((null xx)) (setq opnd (car xx)) (If (fixp opnd) then (setq rop `(immed ,opnd)) elseif (and (symbolp opnd) (setq rop (d-simple `(cdr ,opnd)))) thenret else (If (and lop (not (eq lop unCstack))) then (d-move lop Cstack) (setq lop unCstack)) (d-fixnumcode (d-fixexpand opnd)) (setq rop 'r5)) (If (null lop) then (If (cdr xx) then (setq lop rop) else (e-write3 'movl (e-cvt rop) 'r5)) else (If (cdr xx) then (setq res Cstack) else (setq res 'r5)) (If (setq tmp (d-shiftcheck operator rop)) then (e-write4 'ashl (e-cvt (list 'immed tmp)) (e-cvt lop) (e-cvt res)) else (e-write4 operator (e-cvt rop) (e-cvt lop) (e-cvt res))) (If (cdr xx) then (setq lop unCstack) else (setq lop 'r5))))))) ;--- d-shiftcheck :: check if we can shift instead of multiply ; return t if the operator is a multiply and the operand is an ; immediate whose value is a power of two. (defun d-shiftcheck (operator operand) (and (eq operator 'mull3) (dtpr operand) (eq (car operand) 'immed) (cdr (assoc (cadr operand) arithequiv)))) ; this table is incomplete ; (setq arithequiv '((1 . 0) (2 . 1) (4 . 2) (8 . 3) (16 . 4) (32 . 5) (64 . 6) (128 . 7) (256 . 8) (512 . 9) (1024 . 10) (2048 . 11) (4096 . 12) (8192 . 13) (16384 . 14) (32768 . 15) (65536 . 16) (131072 . 17))) ;--- cc-oneplus :: compile 1+ form = cc-oneplus = ; 1+ increments a fixnum only. We generate code to check if the number ; to be incremented is a small fixnum less than or equal to 1022. This ; check is done by checking the address of the fixnum's box. If the ; number is in that range, we just increment the box pointer by 4. ; otherwise we call we call _qoneplus which does the add and calls ; _qnewint ; (defun cc-oneplus nil (If (null g-loc) then (If (car g-cc) then (e-goto (car g-cc))) else (let ((argloc (d-simple (cadr v-form))) (lab1 (d-genlab)) (lab2 (d-genlab))) (If (null argloc) then (let ((g-loc 'r0) g-cc g-ret) (d-exp (cadr v-form))) (setq argloc 'reg)) (e-write3 'cmpl (e-cvt argloc) '($ #.(+ 5120 (* 4 1022)))) (e-write2 'jleq lab1) (If (not (eq argloc 'r0)) then (d-move argloc 'reg)) (e-write2 'jsb '_qoneplus) (If (and g-loc (not (eq g-loc 'reg))) then (d-move 'reg g-loc)) (If (car g-cc) then (e-goto (car g-cc)) else (e-goto lab2)) (e-label lab1) (e-write4 'addl3 '$4 (e-cvt argloc) (e-cvt g-loc)) (If (car g-cc) then (e-goto (car g-cc))) (e-label lab2)))) ;--- cc-oneminus :: compile the 1- form = cc-oneminus = ; just like 1+ we check to see if we are decrementing an small fixnum. ; and if we are we just decrement the pointer to the fixnum and save ; a call to qinewint. The valid range of fixnums we can decrement are ; 1023 to -1023. This requires two range checks (as opposed to one for 1+). ; (defun cc-oneminus nil (If (null g-loc) then (If (car g-cc) then (e-goto (car g-cc))) else (let ((argloc (d-simple (cadr v-form))) (lab1 (d-genlab)) (lab2 (d-genlab)) (lab3 (d-genlab))) (If (null argloc) then (let ((g-loc 'r0) g-cc) (d-exp (cadr v-form))) (setq argloc 'reg)) (e-write3 'cmpl (e-cvt argloc) '($ #.(- 5120 (* 4 1024)))) (e-write2 'jleq lab1) ; not within range (e-write3 'cmpl (e-cvt argloc) '($ #.(+ 5120 (* 4 1023)))) (e-write2 'jleq lab2) ; within range ; not within range, must do it the hard way. (e-label lab1) (If (not (eq argloc 'r0)) then (d-move argloc 'reg)) (e-write2 'jsb '_qoneminus) (If (and g-loc (not (eq g-loc 'reg))) then (d-move 'reg g-loc)) (If (car g-cc) then (e-goto (car g-cc)) else (e-goto lab3)) (e-label lab2) ; we are within range, just decrement the pointer by the ; size of a word (4 bytes). (e-write4 'subl3 '$4 (e-cvt argloc) (e-cvt g-loc)) (If (car g-cc) then (e-goto (car g-cc))) (e-label lab3)))) ; fixnum > and < ;--- cc-< :: compile a < expression = cc-< = ; ; the operands to this form can either be fixnum or flonums but they ; must be of the same type. We currently assume that they are ; fixnums, this must be fixed. ; We can compile the form just like an eq form since all we want is ; a compare and a jump. The comparisons are inverted since that is ; the way eq expects it. (defun cc-< nil (let ((g-trueop 'jgeq) (g-falseop 'jlss) (v-form `(eq (cdr ,(cadr v-form)) (cdr ,(caddr v-form))))) (cc-eq))) ;--- cc-> :: compile a > expression = cc-> = ; ; the operands to this form can either be fixnum or flonums but they ; must be of the same type. We currently assume that they are ; fixnums, this must be fixed. ; We can compile the form just like an eq form since all we want is ; a compare and a jump. The comparisons are inverted since that is ; the way eq expects it. (defun cc-> nil (let ((g-trueop 'jleq) (g-falseop 'jgtr) (v-form `(eq (cdr ,(cadr v-form)) (cdr ,(caddr v-form))))) (cc-eq))) ; this should be converted (defun c-\\ nil (d-fixop 'ediv 'remainder)) (defun d-fixop (opcode lispopcode) (prog (op1 op2 rop1 rop2 simpleop1) (If (not (eq 3 (length v-form))) ; only handle two ops for now then (d-callbig lispopcode (cdr v-form) nil) else (setq op1 (cadr v-form) op2 (caddr v-form)) (If (fixp op1) then (setq rop1 (concat '$ op1) ; simple int simpleop1 t) else (If (setq rop1 (d-simple `(cdr ,op1))) then (setq rop1 (e-cvt rop1)) else (let ((g-loc 'reg) g-cc g-ret) (d-exp op1)) (setq rop1 '|(r0)|))) (If (fixp op2) then (setq rop2 (concat '$ op2)) else (If (setq rop2 (d-simple `(cdr ,op2))) then (setq rop2 (e-cvt rop2)) else (e-write3 'movl rop1 "-(sp)") (setq rop1 "(sp)+") (let ((g-loc 'reg) g-cc g-ret) (d-exp op2)) (setq rop2 '|(r0)|))) (If (eq opcode 'ediv) then (If (not simpleop1) then (e-write3 'movl rop1 'r2) ; need quad (e-write4 'ashq '$-32 'r1 'r1) (setq rop1 'r1)) ; word div. (e-write5 'ediv rop2 rop1 'r0 'r5) else (e-write4 opcode rop2 rop1 'r5)) (e-write2 'jsb "_qnewint") (d-clearreg)))) ;--- c-assembler-code ; the args to assembler-code are a list of assembler language ; statements. This statements are put directly in the code ; stream produced by the compiler. Beware: The interpreter cannot ; interpret the assembler-code function. ; (defun c-assembler-code nil (setq g-skipcode nil) ; turn off code skipping (makecomment '(assembler code start)) (do ((xx (cdr v-form) (cdr xx))) ((null xx)) (e-write1 (car xx))) (makecomment '(assembler code end))) ;---- d routines (general ones, others are near function using them) ;--- d-cmp :: compare two IADR values ; (defun d-cmp (arg1 arg2) (e-write3 'cmpl (e-cvt arg1) (e-cvt arg2))) ;--- d-handlecc :: handle g-cc ; at this point the Z condition code has been set up and if g-cc is ; non nil, we must jump on condition to the label given in g-cc ; (defun d-handlecc nil (If (car g-cc) then (e-gotot (car g-cc)) elseif (cdr g-cc) then (e-gotonil (cdr g-cc)))) ;--- d-invert :: handle inverted condition codes ; this routine is called if a result has just be computed which alters ; the condition codes such that Z=1 if the result is t, and Z=0 if the ; result is nil (this is the reverse of the usual sense). The purpose ; of this routine is to handle g-cc and g-loc. That is if g-loc is ; specified, we must convert the value of the Z bit of the condition ; code to t or nil and store that in g-loc. After handling g-loc we ; must handle g-cc, that is if the part of g-cc is non nil which matches ; the inverse of the current condition code, we must jump to that. ; (defun d-invert nil (If (null g-loc) then (If (car g-cc) then (e-gotonil (car g-cc)) elseif (cdr g-cc) then (e-gotot (cdr g-cc))) else (let ((lab1 (d-genlab)) (lab2 (If (cdr g-cc) thenret else (d-genlab)))) (e-gotonil lab1) ; Z=1, but remember that this implies nil due to inversion (d-move 'Nil g-loc) (e-goto lab2) (e-label lab1) ; Z=0, which means t (d-move 'T g-loc) (If (car g-cc) then (e-goto (car g-cc))) (If (null (cdr g-cc)) then (e-label lab2))))) ;--- d-noninvert :: handle g-cc and g-loc assuming cc non inverted ; ; like d-invert except Z=0 implies nil, and Z=1 implies t ; (defun d-noninvert nil (If (null g-loc) then (If (car g-cc) then (e-gotot (car g-cc)) elseif (cdr g-cc) then (e-gotonil (cdr g-cc))) else (let ((lab1 (d-genlab)) (lab2 (If (cdr g-cc) thenret else (d-genlab)))) (e-gotot lab1) ; Z=0, this implies nil (d-move 'Nil g-loc) (e-goto lab2) (e-label lab1) ; Z=1, which means t (d-move 'T g-loc) (If (car g-cc) then (e-goto (car g-cc))) (If (null (cdr g-cc)) then (e-label lab2))))) ;--- d-macroexpand :: macro expand a form as much as possible ; (defun d-macroexpand (form) (prog nil loop (If (and (dtpr form) (symbolp (car form)) (eq 'macro (d-functyp (car form)))) (( then (setq form (apply (car form) form)) (go loop)) (return form))) ;--- d-makespec :: declare a variable to be special ; (defun d-makespec (vrb) (putprop vrb t g-spec)) ;--- d-move :: emit instructions to move value from one place to another ; (defun d-move (from to) (makecomment `(from ,(e-uncvt from) to ,(e-uncvt to))) (cond ((eq 'Nil from) (e-write2 'clrl (e-cvt to))) (t (e-write3 'movl (e-cvt from) (e-cvt to))))) ;--- d-simple :: see of arg can be addresses in one instruction ; we define simple and really simple as follows ; ::= number ; quoted anything ; local symbol ; t ; nil ; ::= ; (cdr ) ; global symbol ; (defun d-simple (arg) (let (tmp) (If (d-rsimple arg) thenret elseif (symbolp arg) then (d-loc arg) elseif (and (memq (car arg) '(cdr car cddr cdar)) (setq tmp (d-rsimple (cadr arg)))) then (If (eq 'Nil tmp) then tmp elseif (atom tmp) then (If (eq 'car (car arg)) then `(racc 4 ,tmp) elseif (eq 'cdr (car arg)) then `(racc 0 ,tmp) elseif (eq 'cddr (car arg)) then `(racc * 0 ,tmp) elseif (eq 'cdar (car arg)) then `(racc * 4 ,tmp)) elseif (not (eq 'cdr (car arg))) then nil elseif (eq 'lbind (car tmp)) then `(bind ,(cadr tmp)) elseif (eq 'stack (car tmp)) then `(vstack ,(cadr tmp)) elseif (eq 'fixnum (car tmp)) then `(immed ,(cadr tmp)) elseif (atom (car tmp)) then `(0 ,(cadr tmp)) else (comp-err "bad arg to d-simple: " (or arg)))))) (defun d-rsimple (arg) (If (atom arg) then (If (null arg) then 'Nil elseif (eq t arg) then 'T elseif (or (numberp arg) (memq arg g-locs)) then (d-loc arg) else (car (d-bestreg arg nil))) elseif (eq 'quote (car arg)) then (d-loclit (cadr arg) nil))) ;--- d-movespec :: move from loc to loc where the first addr given is ; an EIADR ; - from : EIADR ; - to : IADR ; (defun d-movespec (from to) (makecomment `(fromspec ,from to ,(e-uncvt to))) (e-write3 'movl from (e-cvt to))) ;--- d-specialp :: check if a variable is special ; a varible is special if it has been declared as such, or if ; the variable special is t (defun d-specialp (vrb) (or special (get vrb g-spec))) ;--- d-tst :: test the given value (set the cc) ; (defun d-tst (arg) (e-write2 'tstl (e-cvt arg))) ;--- d-typesimp :: determine the type of the argument ; (defun d-typesimp (arg val) (let ((argloc (d-simple arg))) (If (null argloc) then (let ((g-loc 'reg) g-cc g-ret) (d-exp arg)) (setq argloc 'reg)) (e-write4 'ashl '$-9 (e-cvt argloc) 'r0) (e-write3 'cmpb '"_typetable+1[r0]" val) (d-invert))) ;--- d-typecmplx :: determine if arg has one of many types ; - arg : lcode argument to be evaluated and checked ; - vals : fixnum with a bit in position n if we are to check type n ; (defun d-typecmplx (arg vals) (let ((argloc (d-simple arg)) (reg)) (If (null argloc) then (let ((g-loc 'reg) g-cc g-ret) (d-exp arg)) (setq argloc 'reg)) (setq reg 'r0) (e-write4 'ashl '$-9 (e-cvt argloc) reg) (e-write3 'cvtbl (concat "_typetable+1[" reg "]") reg) (e-write4 'ashl reg '$1 reg) (e-write3 'bitw vals reg) (d-noninvert))) ;---- register handling routines. ;--- d-allocreg :: allocate a register ; name - the name of the register to allocate or nil if we should ; allocate the least recently used. ; (defun d-allocreg (name) (If name then (let ((av (assoc name g-reguse))) (If av then (rplaca (cdr av) (1+ (cadr av)))) ; inc used count name) else ; find smallest used count (do ((small (car g-reguse)) (smc (cadar g-reguse)) (lis (cdr g-reguse) (cdr lis))) ((null lis) (rplaca (cdr small) (1+ smc)) (car small)) (If (< (cadar lis) smc) then (setq small (car lis) smc (cadr small)))))) ;--- d-bestreg :: determine the register which is closest to what we have ; name - name of variable whose subcontents we want ; pat - list of d's and a's which tell which part we want ; (defun d-bestreg (name pat) (do ((ll g-reguse (cdr ll)) (val) (best) (tmp) (bestv -1)) ((null ll) (If best then (rplaca (cdr best) (1+ (cadr best))) (list (car best) (If (> bestv 0) then (rplacd (nthcdr (1- bestv) (setq tmp (copy pat))) nil) tmp else nil) (nthcdr bestv pat)))) (If (and (setq val (cddar ll)) (eq name (car val))) then (If (> (setq tmp (d-matchcnt pat (cdr val))) bestv) then (setq bestv tmp best (car ll)))))) ;--- d-matchcnt :: determine how many parts of a pattern match ; want - pattern we want to achieve ; have - pattern whose value exists in a register ; ; we return a count of the number of parts of the pattern match. ; If this pattern will be any help at all, we return a value from ; 0 to the length of the pattern. ; If this pattern will not work at all, we return a number smaller ; than -1. ; For `have' to be useful for `want', `have' must be a substring of ; `want'. If it is a substring, we return the length of `have'. ; (defun d-matchcnt (want have) (let ((length 0)) (If (do ((hh have (cdr hh)) (ww want (cdr ww))) ((null hh) t) (If (or (null ww) (not (eq (car ww) (car hh)))) then (return nil) else (incr length))) then length else -2))) ;--- d-clearreg :: clear all values in registers or just one ; if no args are given, clear all registers. ; if an arg is given, clear that register ; (defun d-clearreg n (cond ((zerop n) (mapc '(lambda (x) (rplaca (cdr x) 0) (rplacd (cdr x) nil)) g-reguse)) (t (let ((av (assoc (arg 1) g-reguse))) (If av then (rplaca (cdr av) 0) (rplacd (cdr av) nil)))))) ;--- d-clearuse :: clear all register which reference a given variable ; (defun d-clearuse (varib) (mapc '(lambda (x) (If (eq (caddr x) varib) then (rplacd (cdr x) nil))) g-reguse)) ;--- d-inreg :: declare that a value is in a register ; name - register name ; value - value in a register ; (defun d-inreg (name value) (let ((av (assoc name g-reguse))) (If av then (rplacd (cdr av) value)) name)) ;---- e routines (defun e-cvt (arg) (If (eq 'reg arg) then 'r0 elseif (eq 'Nil arg) then '$0 elseif (eq 'T arg) then (If g-trueloc thenret else (setq g-trueloc (e-cvt (d-loclit t nil)))) elseif (eq 'stack arg) then '(+ #.Np-reg) elseif (eq 'unstack arg) then '(- #.Np-reg) elseif (atom arg) then arg elseif (dtpr arg) then (If (eq 'stack (car arg)) then `(,(* 4 (1- (cadr arg))) #.oLbot-reg) elseif (eq 'vstack (car arg)) then `(* ,(* 4 (1- (cadr arg))) #.oLbot-reg) elseif (eq 'bind (car arg)) then `(* ,(* 4 (1- (cadr arg))) #.bind-reg) elseif (eq 'lbind (car arg)) then `( ,(* 4 (1- (cadr arg))) #.bind-reg) elseif (eq 'fixnum (car arg)) then `(\# ,(cadr arg)) elseif (eq 'immed (car arg)) then `($ ,(cadr arg)) elseif (eq 'racc (car arg)) then (cdr arg) else (comp-err " bad arg to e-cvt : " (or arg))) else (comp-warn "bad arg to e-cvt : " (or arg)))) ;--- e-uncvt :: inverse of e-cvt, used for making comments pretty ; (defun e-uncvt (arg) (If (atom arg) then (If (eq 'Nil arg) then nil else arg) elseif (eq 'stack (car arg)) then (do ((i g-loccnt) (ll g-locs)) ((and (equal i (cadr arg)) (atom (car ll))) (car ll)) (If (atom (car ll)) then (setq ll (cdr ll) i (1- i)) else (setq ll (cdr ll)))) elseif (or (eq 'bind (car arg)) (eq 'lbind (car arg))) then (do ((i g-litcnt (1- i)) (ll g-lits (cdr ll))) ((equal i (cadr arg)) (cond ((eq 'lbind (car arg)) (list 'quote (car ll))) (t (car ll))))) else arg)) ;--- e-cvtas :: convert an EIADR to vax unix assembler fmt and print it ; - form : an EIADR form ; (defun e-cvtas (form) (If (atom form) then (sfilewrite form) else (If (eq '* (car form)) then (If (eq '\# (cadr form)) then (setq form `($ ,(caddr form))) else (sfilewrite "*") (setq form (cdr form)))) (If (numberp (car form)) then (sfilewrite (car form)) (sfilewrite "(") (sfilewrite (cadr form)) (sfilewrite ")") (If (caddr form) then (sfilewrite "[") (sfilewrite (caddr form)) (sfilewrite "]")) elseif (eq '+ (car form)) then (sfilewrite '"(") (sfilewrite (cadr form)) (sfilewrite '")+") elseif (eq '- (car form)) then (sfilewrite '"-(") (sfilewrite (cadr form)) (sfilewrite '")") elseif (eq '\# (car form)) ; 5120 is base of small fixnums then (sfilewrite (concat "$" (+ (* (cadr form) 4) 5120))) elseif (eq '$ (car form)) then (sfilewrite '"$") (sfilewrite (cadr form))))) ;--- e-cmp :: emit code to compare the two given args ; - arg1, arg2 : EIADRs ; (defun e-cmp (arg1 arg2) (e-write3 'cmpl arg1 arg2)) ;--- e-docomment :: print any comment lines ; (defun e-docomment nil (If g-comments then (do ((ll (nreverse g-comments) (cdr ll))) ((null ll)) (sfilewrite '" #") (sfilewrite (car ll)) (terpr vp-sfile)) (setq g-comments nil) else (terpr vp-sfile))) ;--- e-goto :: emit code to jump to the location given ; (defun e-goto (lbl) (e-jump lbl)) ;--- e-gotonil :: emit code to jump if nil was last computed ; (defun e-gotonil (lbl) (e-write2 g-falseop lbl)) ;--- e-gotot :: emit code to jump if t was last computed (defun e-gotot (lbl) (e-write2 g-trueop lbl)) ;--- e-label :: emit a label (defun e-label (lbl) (setq g-skipcode nil) (e-writel lbl)) ;--- e-move :: move value from one place to anther ; this corresponds to d-move except the args are EIADRS ; (defun e-move (from to) (If (equal 0 from) then (e-write2 'clrl to) else (e-write3 'movl from to))) ;--- e-pop :: pop the given number of args from the stack ; g-locs is not! fixed ; (defun e-pop (nargs) (If (greaterp nargs 0) then (e-dropnp nargs))) ;--- e-pushnil :: push a given number of nils on the stack ; (defun ((e-pushnil (nargs) (do ((i nargs)) ((zerop i)) (If (greaterp i 1) then (e-write2 'clrq np-plus) (setq i (- i 2)) elseif (equal i 1) then (e-write2 'clrl np-plus) (setq i (1- i))))) ;--- e-tst :: test a value, arg is an EIADR ; (defun e-tst (arg) (e-write2 'tstl arg)) ;--- e-setupbind :: setup for shallow binding ; (defun e-setupbind nil (e-write3 'movl '#.Bnp-val '#.bNp-reg)) ;--- e-unsetupbind :: restore temp value of bnp to real loc ; (defun e-unsetupbind nil (e-write3 'movl '#.bNp-reg '#.Bnp-val)) ;--- e-shallowbind :: shallow bind value of variable and initialize it ; - name : variable name ; - val : IADR value for variable ; (defun e-shallowbind (name val) (let ((vloc (d-loclit name t))) (e-write3 'movl (e-cvt vloc) '(+ #.bNp-reg)) ; store old val (e-write3 'movl (e-cvt `(lbind ,@(cdr vloc))) '(+ #.bNp-reg)) ; now name (d-move val vloc))) ;--- e-unshallowbind :: un shallow bind n variable from top of stack ; (defun e-unshallowbind (n) (e-setupbind) ; set up binding register (do ((i 1 (1+ i))) ((greaterp i n)) (e-write3 'movl `(,(* -8 i) ,bNp-reg) `(* ,(+ 4 (* -8 i)) ,bNp-reg))) (e-write4 'subl3 `($ ,(* 8 n)) bNp-reg Bnp-val)) ;----------- very low level routines ; all output to the assembler file goes through these routines. ; They filter out obviously extraneous instructions as well as ; combine sequential drops of np. ;--- e-dropnp :: unstack n values from np. ; rather than output the instruction now, we just remember that it ; must be done before any other instructions are done. This will ; enable us to catch sequential e-dropnp's ; (defun e-dropnp (n) (If (not g-skipcode) then (setq g-dropnpcnt (+ n (If g-dropnpcnt thenret else 0))))) ;--- em-checknpdrop :: check if we have a pending npdrop ; and do it if so. ; (defmacro em-checknpdrop nil `(If g-dropnpcnt then (let ((dr g-dropnpcnt)) (setq g-dropnpcnt nil) (e-write3 'subl2 `($ ,(* dr 4)) Np-reg)))) ;--- em-checkskip :: check if we are skipping this code due to jump ; (defmacro em-checkskip nil '(If g-skipcode then (sfilewrite "# "))) ;--- e-jump :: jump to given label ; and set g-skipcode so that all code following until the next label ; will be skipped. ; (defun e-jump (l) (em-checknpdrop) (e-write2 'jbr l) (setq g-skipcode t)) ;--- e-return :: do return, and dont check for np drop ; (defun e-return nil (setq g-dropnpcnt nil) ; we dont need to worry about nps (e-write1 'ret)) ;--- e-writel :: write out a label ; (defun e-writel (label) (setq g-skipcode nil) (em-checknpdrop) (sfilewrite label) (sfilewrite '":") (e-docomment)) ;--- e-write1 :: write out one litteral ; (defun e-write1 (lit) (em-checkskip) (em-checknpdrop) (sfilewrite lit) (e-docomment)) ;--- e-write2 :: write one one litteral, and one operand ; (defun e-write2 (lit frm) (em-checkskip) (em-checknpdrop) (sfilewrite lit) (sfilewrite '" ") (e-cvtas frm) (e-docomment)) ;--- e-write3 :: write one one litteral, and two operands ; (defun e-write3 (lit frm1 frm2) (em-checkskip) (em-checknpdrop) (sfilewrite lit) (sfilewrite '" ") (e-cvtas frm1) (sfilewrite '",") (e-cvtas frm2) (e-docomment)) ;--- e-write4 :: write one one litteral, and three operands ; (defun e-write4 (lit frm1 frm2 frm3) (em-checkskip) (em-checknpdrop) (sfilewrite lit) (sfilewrite '" ") (e-cvtas frm1) (sfilewrite '",") (e-cvtas frm2) (sfilewrite '",") (e-cvtas frm3) (e-docomment)) ;--- e-write5 :: write one one litteral, and four operands ; (defun e-write5 (lit frm1 frm2 frm3 frm4) (em-checkskip) (em-checknpdrop) (sfilewrite lit) (sfilewrite '" ") (e-cvtas frm1) (sfilewrite '",") (e-cvtas frm2) (sfilewrite '",") (e-cvtas frm3) (sfilewrite '",") (e-cvtas frm4) (e-docomment)) m3) (em-checkskip) (em-checknpdrop) (sfilewrite lit) (sfilewrite '" ") (e-cvtas frm1) (sfilewrite '",") (e-cvtas frm2) (sfilewrite '",") (e-cvtas frm3) (e-docomment)) ;--- e-write5 :: write one one litteral, and fcmd/lisp/liszt/lxref.l 664 0 12 14623 2512707363 10241 ;------ lxref: lisp cross reference program ;-- author: j foderaro ; This program generates a cross reference listing of a set of one or ; more lisp files. It reads the output of cross reference files ; generated by the compiler. These files usually have the extension .x . ; the .x files are lisp readable. There format is: ; The first s-expression is (File ) where is the ; name of the lisp source file. ; Then there is one s-expression for each function (including macros) ; which is defined in the file. The car of each expression is the function ; name, the cadr is the function type and the cddr is a list of those ; functions called ; ; lxref can be run from the command level ; % lxref foo.x bar.x ; or in this way ; % lxref ; -> (lxref foo.x bar.x) ; ; There is one option, that is changing the ignorelevel. If a function ; is called by more than ignorelevel functions then all those functions ; are listed, instead a summary of the number of calls is printed. This ; is useful for preventing the printing of massive lists for common ; system functions such as setq. ; To change the ignorelevel to 40 you would type: ; ; % lxref -40 foo.x bar.x ; ; load in the macro package (eval-when (eval compile) (cond ((null (get 'jkfmacs 'version)) (load 'jkfmacs)))) (defmacro Push (atm val) `(setq ,atm (cons ,val ,atm))) ; insure we have plenty of space to grow into (opval 'pagelimit 9999) (declare (special width ignorefuncs ignorelevel readtable user-top-level poport )) (setq ignorelevel 50) (def xrefinit (lambda nil (let ((argbase 1)) (cond ((and (> (argv -1) 2) (eq (argv 1) '-f)) (setq argbase 3))) (setq readtable (makereadtable t)) (cond ((> (argv -1) argbase) ; build up list of args (do ((i (1- (argv -1)) (1- i)) (arglis)) ((< i argbase) (signal 2 'exit) ; die on interrupt (setq user-top-level nil) (exit (apply 'lxref arglis))) (setq arglis (cons (argv i) arglis)))) (t (patom "Lxref - lisp cross reference program") (terpr poport) (setq user-top-level nil)))))) (setq user-top-level 'xrefinit) (defun lxref fexpr (files) (prog (p funcs i-seen i-home i-type i-callers filenm caller callee name home type caller tmp fname callers clength) (setq i-seen (gensym) i-home (gensym) i-type (gensym) i-callers (gensym)) ; check for the only option permitted, that of changing the ignorelevel ; (If (and files (eq '- (car (setq tmp (explode (car files)))))) then (If (not (fixp (setq ignorelevel (readlist (cdr tmp))))) then (patom "bad ignorelevel count") (exit 1)) (setq files (cdr files))) (do ((ii files (cdr ii))) ((null ii)) ; open up xref file (setq fname (nreverse (explodec (car ii)))) (If (and (eq 'l (car fname)) (eq '|.| (cadr fname))) then (setq fname (implode (nreverse (cons 'x (cons '|.| (cddr fname)))))) else (setq fname (car ii))) (If (and (not (portp (setq p (car (errset (infile fname) nil))))) (not (portp (setq p (car (errset (infile (concat fname ".x")))))))) then (patom "Couldn't open ") (patom (car ii)) (terpr) (go bottom)) ; first record should be (File filename) (setq filenm (car (errset (read p)))) (If (and (dtpr filenm) (eq 'File (car filenm))) then (setq filenm (cadr filenm)) else (patom "File ") (patom (car ii)) (patom " is not a xref file") (terpr) (close p) (go bottom)) ;(patom "Processing ") (patom (car ii)) (terpr) (drain) ; for each function in the file (do ((jj (read p) (read p))) ((null jj) (close p)) (setq caller (car jj)) (If (not (get caller i-seen)) then (putprop caller t i-seen) (Push funcs caller)) ; add to global list ; remember home of this function (and allow multiple homes) (putprop caller (cons filenm (get caller i-home)) i-home) ; remember type of this function (and allow multiple types) (putprop caller (cons (cadr jj) (get caller i-type)) i-type) ; for each function the caller calls (do ((kk (cddr jj) (cdr kk))) ((null kk)) (setq callee (car kk)) (If (not (get callee i-seen)) then (putprop callee t i-seen) (Push funcs callee)) (putprop callee (cons (cons caller filenm) (get callee i-callers)) i-callers))) bottom ) ; sort alphabetically ; (patom "There are ") (print (length funcs)) (patom " functions ") ; (terpr) (setq funcs (sort funcs 'alphalessp)) ;(patom "To sort required ") (print sort-compares) (patom "comparisons") ; (terpr) ; now print out the cross reference (do ((ii funcs (cdr ii))) ((null ii)) (setq name (car ii) home (get name i-home) type (get name i-type) callers (get name i-callers)) (If (lessp (setq clength (length callers)) ignorelevel) then (setq callers (sortcar callers 'alphalessp))) (If (null home) then (setq home (If (getd name) then (setq type (ncons (typeit (getd name)))) '(Franz-initial) else '(Undefined)))) (patom name) (patom " ") (If (null (cdr type)) then (patom (car type)) (patom " ") (patom (car home)) else (patom "Mult def: ") (mapcar '(lambda (typ hom) (patom typ) (patom " in ") (patom hom) (patom ", ")) type home)) (terpr) (patom " ") (cond ((null callers) (patom (("*** Unreferenced ***")) ((not (lessp clength ignorelevel)) (patom "Called by ") (print clength) (patom " functions")) (t (do ((jj callers (cdr jj)) (calle) (width 8)) ((null jj)) ; only print name if in same file (setq calle (caar jj)) (cond ((memq (cdar jj) home) (terprchk (+ (flatc calle) 2)) (patom calle)) (t (terprchk (+ (flatc calle) 6 (flatc (cdar jj)))) (patom calle) (patom " in ") (patom (cdar jj)))) (If (cdr jj) then (patom ", "))))) (terpr) (terpr) botloop ) (return 0))) (defun terprchk (wid) (cond ((> (setq width (+ wid width)) 80.) (terpr) (patom " ") (setq width (+ 8 wid))))) ; determine type of function (defun typeit (fcn) (cond ((bcdp fcn) (getdisc fcn)) ((dtpr fcn) (car fcn)))) ; set up read table to be the same as when liszt wrote the file (setq readtable (makereadtable t)) alle) 6 (flatc (cdar jj)))) (patom calle) (patom " in ") (patom (cdar jj)))) (If (cdr jj) tcmd/lisp/liszt/ltags 644 0 12 134 2434475474 7737 /^\(DEF/ { print $2, FILENAME, "?^" $0 "$?" } /^\(def/ { print $2, FILENAME, "?^" $0 "$?" } (cond ((> (setq width (+ wid width)) 80.) (terpr) (patom " ") (setq width (+ 8 wid))))) ; determine type of function (defun typeit (fcn) (cond ((bcdp fcn) (getdisc fcn)) ((dtpr fcn) (car fcn)))) ; set up read table to be the same as when liszt wrote the file (setq readtable (makereadtable t)) alle) 6 (flatc (c/|,|5Ȇ< /,"cmd/lisp/liszt/uctolc.c 644 0 12 753 2434475475 10347 #include #include /* uctolc j foderaro convert upper case to lower case in the first field of a tags file */ #define TRUE -1 main() { register char c; while(TRUE) { pt1: while( (c=getchar()) != EOF) { if(isupper(c))putchar( c + ('a' - 'A')); else if(c == ' ') goto pt2; else putchar(c); } exit(); pt2: putchar(c); while( (c=getchar()) != EOF) { putchar(c); if(c == '\n') goto pt1; } exit(); } } ,"cmd/lisp/liszt/doc/ 775 0 12 0 2527315340 7372 cmd/lisp/liszt/doc/liszt.doc 644 0 12 7601 2512705633 11317 ; Liszt documentation Addresses There are four types of addresses used internally in Franz. Symbolic: These are the names of lisp objects, such as `a', `foo', 34, or 3.234234. A name is either a local variable, a special variable or a number. A number is either a small fixnum, large fixnum, bignum or floating point number. IADR (intermediate address) This type of address is generated from a symbolic address by d-loc, d-loclit and the routines d-simple, d-rsimple which call them. The forms are Nil - the location or value of nil. T - the location or value of t. reg - register r0, which is where the result of function calls are stored. stack - the address pointed to by np with np incremented after the value is stored. I.E. this is (r6)+ unstack - the address one word below np (np is decremented before accessing. I.E this is -(r6) - this is just . This allows strange forms to be passed directly. (stack n) - The n'th value on the namestack for this function. The first value 0(r10) is (stack 1). (vstack n) - The cdr of the n'th value on the namestack. That is, (stack 1) is *0(r10) (bind n) - The value of the n'th value on the bindstack. If we are talking about a symbol, then this is the value of the symbol, if we are talking about a list this this is the cdr of the list (although this is a rare use). (bind 1) corresponds to *0(r8). (lbind n) - The n'th value on the bindstack. If we are talking about object foo then this is the address of foo in memory. (fixnum n) - This is the address of small fixnum n in memory. A small fixnum is in the range -1024 to 1023. (immed n) - The is the immediate constant n. EIADR (extended intermediate address) This address is generated from an IADR by e-cvt. It represents symbolically a vax address. - This corresponds to . (n ) - This corresponds to n() (stack n+1) and (lbind n+1) are converted to these forms. (n ) - This corresponds to n()[] There is currently no IADR which generates this. (* n ) - This corresponds to *n() (vstack n+1) and (bind n+1) are converted to these forms. (+ ) - This corresponds to ()+ stack is converted to this form. (- ) - This corresponds to -() unstack is converted to this form. ($ ) - This corresponds to $ (immed ) is converted to this form. (# ) - This corresponds to $ where equals the base of the fixnums (0x1400) plus 4 * (fixnum ) is converted to this form (* # ) - This corresponds to $. It is generated by d-rsimple occasionally when you ask for the cdr of a number (which you do sometimes when you are compiling fixnum operators). Vax Unix assembler addresses The addresses are printed from a EIADR by e-cvtas. The conversions are shown in the above section. -------------- The main compiling function in liszt is d-exp. It is passed an expression to compile which is bound to the special variable v-form. d-exp is also passes implicitly two special variables, g-loc and g-cc. g-loc is either nil or an IADR. If g-loc is nil then the value of v-form is not required, but we still must execute it to get any side effects. If g-loc is non nil, then it tell where the value of the v-form should be placed. g g-cc controls jumping on condition. If g-cc is non nil, then its value has either a non-null car or non-null cdr but not both. If the car is non-nil then if the value of v-form is non-nil, a branch should be done to the symbol stored in (car g-cc). If the cdr is non-nil then then if the value of v-form is nil, a branch should be done to the symbol stored in (cdr g-cc). Since at every conditional branch you either jump or continue, the car and cdr will never both be specified. form should be placed. g g-cc controls jumping on condition. If g-cc is non nil, then its value has either a non-null car ocmd/lisp/liszt/doc/calret.doc 664 0 12 3023 2512705633 11420 There are two possible calling sequences from compiled code. Arguments are stored on the `namestack', the bottom argument is pointed at by r7 and r6 points one above the top argument. Calling sequence when transfer tables are used: foreach arg compute and stack using (r6)+ for example: movl r0,(r6)+ movab -n(r6),r7 where n = 4*number of args to fcn calls $0,*trantb+m where m is the index of the function in the transfer table. movl r7,r6 restore r6 Local functions: these are functions only accessable within a file. foreach arg compute and stack using (r6)+ jsb LOCALNAME go directly to the function, it will restore r6 before it returns. Header code for functions: Through a transfer table: topsim is the label jumped to when tail merging. For non lexprs: .word 0x5c0 # save r6, r7, r8, r10 [ movab mcounts,r0 # if profiling, mcounts replaced by fasl jsb mcount ] movab linker,r8 # set up r8 movl r7,r10 # set up oldlbot movab n(r10),r6 # n = 4*Number of args expected. topsim: For lexprs: .word 0x5c0 [ movab mcounts,r0 # if profiling. [mcounts replaced by fasl] jsb mcount ] movab linker,r8 # set up r8 subl3 $4,r7,-(sp) # address one word below bottom of args topsim: movl r6,r10 # first free addr to arg base subl3 r7,r6,r0 # number of args * 4 into r0 movab 0x1400(r0),(r6)+ # stack boxed number of args movl 0(r10),-(sp) # also store on stack so user can't clobber For local functions: movl r10,-(sp) # save r10 movab -n(r6),r10 # set up arg base usi((ng arg top topsim: exprs: .word 0x5c0 [ movab mcounts,r0 # if profiling. [mcounts replaced by fasl] jsb mcount ] movab linker,r8 # set up r8 subl3 $4,r7,-(sp) # address one word below bottom of args topsim: movl r6,r10 # first free addr to arg base subl3 r7,r6,r0 # number of args * 4 into r0 movab 0x1400(r0),(r6)+ # stack boxed number of args movl 0(r10),-(sp) # also store on stack so user can't clobber For local functions: movl r10,-(sp) # save r10 movab -n(r6),r10 # set up arg base usicmd/lisp/lib/ 775 0 12 0 2552767476 6251 cmd/lisp/lib/auxfns0.l 444 0 12 176543 2552720222 10125 (setq SCCS-auxfns0 "@(#)auxfns0.l 1.29 7/9/81") (setsyntax '\; 'splicing 'zapline) ; vi: set lisp : ;---------------- auxfns0 --------------- ; this file contains the definitions of the most common functions. ; It should only be loaded in Opus 30 Franz Lisp. ; These functions should be loaded into every lisp. ; ;------------------------------------------------ ; preliminaries: (eval-when (eval load) (cond ((null (getd 'back=quotify)) (cond ((atom (errset (fasl '/usr/lib/lisp/backquote))) (load 'backquote)))))) (eval-when (compile) (setq macros t)) ;---- Table of Contents. ; ; I. Functions required to be defined right away ; declare append concatl max ; memq ; ; II. Macros ; catch throw defmacro (defmacrosrch,defmcroopption) ; defun desetq let (de-compose) ; let* listify sassoc unwind-protect ; ; III. Interrupt functions ; FPEINT INT ; ; IV. garbage collection functions ; prtpagesused gcafter ; ; V. the functions ; append1 assoc bigp ; comment copy copysymbol cvttomaclisp ; defprop delete delq evenp ; ex (exvi) exec exl explode ; explodec exploden expt ffasl ; filepos fixp ; flatsize floatp getchar getcharn ; getl help hunk ; last include includef ; length macroexpand makhunk member ; min ; nconc nreverse oddp plusp ; prog1 ; reverse shell sload ; sort (sorthelp,exchange2) sortcar (sortcarhelp) ; sublis (sublishelp) subst vi ; vil xcons ; ; VI. array functions ; array [macro] arracfun *array ; arraycall [macro] (ev-arraycall) ; arrcomputeint ; store [macro] (storeintern) arracfcnsimp ; arraydims fillarray ; ; VII. equivalences ; abs add chrct diff ; numbp princ remainder terpri ; typep symeval ; < = > - ; / + - *diff ; \ 1+ 1+$ 1- ; 1-$ * *$ /$ ; +$ -$ ; ;--- Section I - functions which must be declared immediately ;--- declare - ignore whatever is given, this is for the compiler ; (def declare (nlambda (x) nil)) ;--- append - x : list ; - y : list ; (declare (localf append2args)) (def append2args (lambda (x y) (prog (l l*) (cond ((null x) (return y)) ((atom x) (err (list '"Non-list to append:" x)))) (setq l* (setq l (cons (car x) nil))) loop (cond ((atom x) (err (list '"Non-list to append:" x))) ((setq x (cdr x)) (setq l* (cdr (rplacd l* (cons (car x) nil)))) (go loop))) (rplacd l* y) (return l)))) (def append (lexpr (nargs) (cond ((eq nargs 2) (append2args (arg 1) (arg 2))) ((zerop nargs) nil) (t (do ((i (1- nargs) (1- i)) (res (arg nargs))) ((zerop i) res) (setq res (append2args (arg i) res))))))) ;--- concatl - l : list of atoms ; returns the list of atoms concatentated ; (def concatl (lambda (x) (apply 'concat x))) ;--- max - arg1 arg2 ... : sequence of numbe ; returns the maximum ; (def max (lexpr (nargs) (do ((i nargs (1- i)) (max (arg 1))) ((< i 2) max) (cond ((greaterp (arg i) max) (setq max (arg i))))))) ;--- memq - arg : (probably a symbol) ; - lis : list ; returns part of lis beginning with arg if arg is in lis ; (def memq (lambda ($a$ $l$) (do ((ll $l$ (cdr ll))) ((null ll) nil) (cond ((eq $a$ (car ll)) (return ll)))))) ; ---Section II - macros ; ;--- catch form [tag] ; catch is now a macro which translates to (*catch 'tag form) ; (def catch (macro (l) `(*catch ',(caddr l) ,(cadr l)))) ;--- throw form [tag] ; throw isnow a macro ; (def throw (macro (l) `(*throw ',(caddr l) ,(cadr l)))) ; defmacro for franz, written 20sep79 by jkf (declare (special defmacrooptlist protect-list protect-evform)) ;--- defmacro - name - name of macro being defined ; - pattrn - formal arguments plus other fun stuff ; - body - body of the macro ; This is an intellegent macro creator. The pattern may contain ; symbols which are formal paramters, lists which show how the ; actual paramters will appear in the args, and these key words ; &rest name - the rest of the args (or nil if there are no other args) ; is bound to name ; &optional name - bind the next arg to name if it exists, otherwise ; bind it to nil ; &optional (name init) - bind the next arg to name if it exists, otherwise ; bind it to init evaluted. (the evaluation is done left ; to right for optional forms) ; &optional (name init given) - bind the next arg to name and given to t ; if the arg exists, else bind name to the value of ; init and given to nil. ; &aux name ; &aux (name init) ; ; Method of operation: ; the list returned from defmcrosrc has the form ((cxxr name) ...) ; where cxxr is the loc of the macro arg and name is it formal name ; defmcrooptlist has the form ((initv cxxr name) ...) ; which is use for &optional args with an initial value. ; here cxxr looks like cdd..dr which will test of the arg exists. ; ; the variable defmacro-for-compiling determines if the defmacro forms ; will be compiled. If it is t, then we return (progn 'compile (def xx..)) ; to insure that it is compiled ; (declare (special defmacro-for-compiling)) (cond ((null (boundp 'defmacro-for-compiling)) ; insure it has a value (setq defmacro-for-compiling nil))) (def defmacro (macro (args) ((lambda (tmp tmp2 defmacrooptlist body protect-evform protect-list gutz) (setq tmp (defmcrosrch (caddr args) '(d r) nil) body `(def ,(cadr args) (macro (defmacroarg) ((lambda ,(mapcar 'cdr tmp) ,@(mapcar '(lambda (arg) `(cond ((setq ,(caddr arg) (,(cadr arg) defmacroarg)) ,@(cond ((setq tmp2 (cadddr arg)) `((setq ,tmp2 t)))) (setq ,(caddr arg) (car ,(caddr arg)))) (t (setq ,(caddr arg) ,(car arg))))) defmacrooptlist) ,@(cond (protect-evform (setq gutz (eval `((lambda ,(mapcar 'cdr tmp) ,@(cdddr args)) ,@(mapcar '(lambda (x) `',(cdr x)) tmp)))) (ncons `(cond (,protect-evform `((lambda ,',(mapcar 'cdr tmp) ,',gutz) ,,@(mapcar 'cdr tmp))) (t ,@(cdddr args))))) (t (cdddr args)))) ,@(mapcar '(lambda (arg) (cond ((dtpr (car arg)) (caar arg)) ((car arg) `(,(car arg) defmacroarg)))) tmp))))) (cond (defmacro-for-compiling `(progn 'compile ,body)) (t body))) nil nil nil nil nil nil nil))) (def defmcrosrch (lambda (pat form sofar) (cond ((null pat) sofar) ((atom pat) (cons (cons (concatl `(c ,@form)) pat) sofar)) ((eq (car pat) '&rest) (append (defmcrosrch (cadr pat) form nil) (defmcrosrch (cddr pat) form sofar))) ((eq (car pat) '&optional) (defmcrooption (cdr pat) form sofar)) ((eq (car pat) '&protect) (setq protect-list (cond ((atom (cadr pat)) (ncons (cadr pat))) (t (cadr pat))) protect-evform (cons 'or (mapcar '(lambda (x) `(dtpr ,x)) protect-list))) (defmcrosrch (cddr pat) form sofar)) ((eq (car pat) '&aux) (mapcar '(lambda (frm) (cond ((atom frm) `((nil) . ,frm)) (t `((,(cadr frm)) . ,(car frm))))) (cdr pat))) (t (append (defmcrosrch (car pat) (cons 'a form) nil) (defmcrosrch (cdr pat) (cons 'd form) sofar)))))) (def defmcrooption (lambda (pat form sofar) ((lambda (tmp tmp2) (cond ((null pat) sofar) ((eq (car pat) '&rest) (defmcrosrch (cadr pat) form sofar)) (t (cond ((atom (car pat)) (setq tmp (car pat))) (t (setq tmp (caar pat)) (setq defmacrooptlist `((,(cadar pat) ,(concatl `(c ,@form)) ,tmp ,(setq tmp2 (caddar pat))) . ,defmacrooptlist)))) (defmcrooption (cdr pat) (cons 'd form) `( (,(concatl `(ca ,@form)) . ,tmp) ,@(cond (tmp2 `((nil . ,tmp2)))) . ,sofar))))) nil nil))) ;--- defun - standard maclisp function definition form. ; (def defun (macro (l) (prog (name type arglist body specind specnam) (setq name (cadr l) l (cddr l)) (cond ((dtpr name) (cond ((memq (cadr name) '(macro expr fexpr lexpr)) (setq l (cons (cadr name) l) name (car name))) (t (setq specnam (car name) specind (cadr name) name (concat (gensym) "::" specnam)))))) (cond ((null (car l)) (setq type 'lambda)) ((eq 'fexpr (car l)) (setq type 'nlambda l (cdr l))) ((eq 'expr (car l)) (setq type 'lambda l (cdr l))) ((eq 'macro (car l)) (setq type 'macro l (cdr l))) ((atom (car l)) (setq type 'lexpr l `((,(car l)) ,@(cdr l)))) (t (setq type 'lambda(())) (cond ((and (eq 'lambda type) (or (memq '&aux (car l)) (memq '&optional (car l)) (memq '&rest (car l)))) (setq l (lambdacvt l) type (car l) l (cdr l)))) (setq body `(def ,name (,type ,@l))) (cond (specnam (return `(progn 'compile ,body (putprop ',specnam (getd ',name) ',specind)))) (t (return body)))))) ;--- lambdacvt ; converts a lambda expression with &optional, &rest and &aux forms in ; the argument list into a lexpr which will do the desired function. ; method of operation ; the argument list is examined and the following lists are made: ; vbs - list of variables to be lambda bound ; opl - list of optional forms ; vals - list of values to be assigned to the vbs ; (def lambdacvt (lambda (exp) (prog (arg vbs vals opl rest opflg restflg narg narg2 narg3 auxflg avbs) (do ((ll (car exp) (cdr ll)) (count 1 (1+ count))) ((null ll)) (cond ((eq '&rest (car ll)) (setq restflg t opflg nil count (1- count))) ((eq '&optional (car ll)) (setq opflg t count (1- count))) ((eq '&aux (car ll)) (setq auxflg t opflg nil restflg nil count (1- count))) (opflg (cond ((atom (setq arg (car ll))) (setq opl (cons (cons (ncons arg) count) opl) vbs (cons arg vbs) vals (cons nil vals))) ((cddr arg) (setq vbs (cons (car arg) (cons (caddr arg) vbs)) vals (cons nil (cons nil vals)) opl (cons (cons arg count) opl))) (t (setq vbs (cons (car arg) vbs) vals (cons nil vals) opl (cons (cons arg count) opl))))) (restflg (setq vbs (cons (car ll) vbs) vals (cons nil vals) rest (cons (car ll) count))) (auxflg (setq count (1- count)) (cond ((atom (setq arg (car ll))) (setq avbs (cons (ncons arg) avbs))) (t (setq avbs (cons arg avbs))))) (t (setq vbs (cons (car ll) vbs) vals (cons `(arg ,count) vals))))) (setq narg (gensym)) (return `(lexpr (,narg) ((lambda ,(nreverse vbs) ,@(mapcar '(lambda (arg) `(cond ((greaterp ,(cdr arg) ,narg) ,@(cond ((cadar arg) `((setq ,(caar arg) ,(cadar arg)))))) (t (setq ,(caar arg) (arg ,(cdr arg))) ,@(cond ((cddar arg) `((setq ,(caddar arg) t))))))) (nreverse opl)) ,@(cond (rest (setq narg2 (gensym) narg3 (gensym)) `((do ((,narg2 ,narg (1- ,narg2)) (,narg3 nil (cons (arg ,narg2) ,narg3))) ((lessp ,narg2 ,(cdr rest)) (setq ,(car rest) ,narg3)))))) ,@(cond (auxflg `((let* ,(nreverse avbs) ,@(cdr exp)))) (t (cdr exp)))) ,@(nreverse vals))))))) ;--- desetq ; - pattern - pattern containing vrbl names ; - expr - expression to be evaluated ; (defmacro desetq (&rest forms &aux newgen destrs) (do ((xx forms (cddr xx)) (res) (patt) (expr)) ((null xx) (cond ((null (cdr res)) (car res)) (t (cons 'progn (nreverse res))))) (setq patt (car xx) expr (cadr xx)) (setq res (cons (cond ((atom patt) `(setq ,patt ,expr)) ;trivial case (t (setq newgen (gensym) destrs (de-compose patt '(r))) `((lambda (,newgen) ,@(mapcar '(lambda (frm) `(setq ,(cdr frm) (,(car frm) ,newgen))) destrs)) ,expr))) res)))) ; let for franz (with destructuring) ;--- let ; - binds - binding forms ; - . body - forms to execute ; the binding forms may have these forms ; a local variable a, initially nil ; (a x) local variable a, x is evaled and a gets its value initially ; ((a . (b . c)) x) three local variables, a,b and c which are given ; values corresponding to the location in the value ; of x. Any structure is allowed here. ; (defmacro let (binds &rest body &aux vrbls vals destrs newgen) (mapc '(lambda (form) (cond ((atom form) (setq vrbls (cons form vrbls) vals (cons nil vals))) ((atom (car form)) (setq vrbls (cons (car form) vrbls) vals (cons (cadr form) vals))) (t (setq newgen (gensym) destrs `((,newgen ,@(de-compose (car form) '(r))) ,@destrs) vrbls (cons newgen vrbls) vals (cons (cadr form) vals))))) binds) (mapc '(lambda (frm) (do ((ll (cdr frm) (cdr ll))) ((null ll)) (setq vrbls (cons (cdar ll) vrbls) vals (cons nil vals)))) destrs) (setq vals (nreverse vals) vrbls (nreverse vrbls) destrs (nreverse destrs)) `((lambda ,vrbls ,@(mapcan '(lambda (frm) (mapcar '(lambda (vrb) `(setq ,(cdr vrb) (,(car vrb) ,(car frm)))) (cdr frm))) destrs) ,@body) ,@vals)) ;--- de-compose ; form - pattern to de-compose ; sofar - the sequence of cxxr's needed to get to this part ; of the pattern ; de-compose returns a list of this form ; ; ((cxxr . a) (cyyr . b) ... ) ; which tells how to get to the value for a and b ..etc.. ; (def de-compose (lambda (form sofar) (cond ((null form ) nil) ((atom form) (ncons (cons (apply 'concat (cons 'c sofar)) form))) (t (nconc (de-compose (car form) (cons 'a sofar)) (de-compose (cdr form) (cons 'd sofar))))))) ;--- let* ; - binds - binding forms (like let) ; - body - forms to eval (like let) ; this is the same as let, except forms are done in a left to right manner ; in fact, all we do is generate nested lets ; (defmacro let* (binds &rest body) (do ((ll (reverse binds) (cdr ll))) ((null ll) (car body)) (setq body `((let (,(car ll)) ,@body))))) ;--- listify : n - integer ; returns a list of the first n args to the enclosing lexpr if ; n is positive, else returns the last -n args to the lexpr if n is ; negative. ; (def listify (macro (lis) `(let ((n ,(cadr lis))) (cond ((minusp n) (do ((i (arg nil) (1- i)) (result nil (cons (arg i) result))) ((< i (+ (arg nil) n 1)) result) )) (t (do ((i n (1- i)) (result nil (cons (arg i) result))) ((< i 1) result) )))))) ;--- sassoc ; - x : form ; - y : assoc list ; - fcn : function or lambda expression ; If (assoc x y) is non nil, then we apply the function fcn to nil. ; This must be written as a macro if we expect to handle the case of ; a lambda expression as fcn in the compiler. ; (defmacro sassoc (x y fcn) (cond ((or (atom fcn) (not (eq 'quote (car fcn)))) `(or (assoc ,x ,y) (apply ,fcn nil))) (t `(or (assoc ,x ,y) (,(cadr fcn) nil))))) ;--- sassq ; - x : form ; - y : assoc list ; - fcn : function or lambda expression ; like sassoc above except it uses assq instead of assoc. ; (defmacro sassq (x y fcn) (cond ((or (atom fcn) (not (eq 'quote (car fcn)))) `(or (assq ,x ,y) (apply ,fcn nil))) (t `(or (assq ,x ,y) (,(cadr fcn) nil))))) ;--- signp - test - unevaluated atom ; - value - evaluated value ; test can be l, le, e, n, ge or g with the obvious meaning ; we return t if value compares to 0 by test '(def signp (macro (l) `(signphelpfcn ',(cadr l) ,(caddr l)))) (defmacro signp (tst val) (setq tst (cond ((eq 'l tst) `(minusp signp-arg)) ((eq 'le tst) `(not (greaterp signp-arg 0))) ((eq 'e tst) `(zerop signp-arg)) ((eq 'n tst) `(not (zerop signp-arg))) ((eq 'ge tst) `(not (minusp signp-arg))) ((eq 'g tst) `(greaterp signp-arg 0)) (t (error "bad arg to signp " tst)))) (cond ((atom val) `(and (numberp ,val) ,(subst val 'signp-arg tst))) (t `((lambda (signp-arg) (and (numberp signp-arg) ,tst)) ,val)))) ;-- signphelpfcn ; not needed for new code anymore (def signphelpfcn (lambda (tst val) (cond ((eq 'l tst) (minusp val)) ((eq 'le tst) (or (zerop val) (minusp val))) ((eq 'e tst) (zerop val)) ((eq 'n tst) (not (zerop val))) ((eq 'ge tst) (not (minusp val))) ((eq 'g tst) (greaterp val 0))))) ;--- unwind-protect ; The form of a call to unwind-protect is ; (unwind-protect pform ; form1 form2 ...) ; and it works as follows: ; pform is evaluated, if nothing unusual happens, form1 form2 etc are ; then evaluated and unwind-protect returns the value of pform. ; if while evaluating pform, a throw or error caught by an errset which ; would cause control to pass through the unwind-protect, then ; form1 form2 etc are evaluated and then the error or throw continues. ; Thus, no matter what happens, form1, form2 etc will be evaluated. ; (defmacro unwind-protect (protected &rest conseq &aux (localv (gensym 'G))) `((lambda (,localv) (setq ,localv (*catch 'ER%unwind-protect ,protected)) ,@conseq (cond ((and (dtpr ,localv) (eq 'ER%unwind-protect (car ,localv))) (I-throw-err (cdr ,localv))) (t ,localv))) nil)) ;----Section III -- Interrupt handlers ; (def FPEINT (lambda (x$) (error "Floating Exception "))) (def INT (lambda (dummy) (patom '"Interrupt: ") (drain) (break))) (signal 8 'FPEINT) (signal 2 'INT) ;---- Section IV - interrupt handlers ; (cond ((null (boundp '$gcprint)) (setq $gcprint nil))) ; dont print gc stats by default (cond ((null (boundp '$gccount$)) (setq $gccount$ 0))) ;--- prtpagesused - [arg] : type of page allocated last time. ; prints a summary of pages used for certain selected types ; of pages. If arg is given we put a star beside that type ; of page. This is normally called after a gc. ; (def prtpagesused (lambda (space tottime gctime) (patom "[") (do ((curtypl (cond ((memq space '(list fixnum )) '(list fixnum)) (t (cons space '(list fixnum)))) (cdr curtypl)) (temp)) ((null curtypl) (print 'ut:) (print (max 0 (quotient (times 100 (diff tottime gctime)) tottime))) (patom "%]") (terpr)) (setq temp (car curtypl)) (cond ((greaterp (cadr (opval temp)) 0) (cond ((eq space temp) (patom '*))) (patom temp) (patom '":") (print (cadr (opval temp))) (patom '"{") (print (fix (quotient (times 100.0 (( (car (opval temp))) (* (cadr (opval temp)) (caddr (opval temp)))))) (patom '"%}") (patom '"; ")))))) (declare (special gcafter-panic-mode $gccount$ $gc_midlim $gc_minalloc $gc_pct $gc_lowlim $gcprint ptimeatlastgc)) (setq gcafter-panic-mode nil) (setq $gc_minalloc 10) (setq $gc_lowlim 60) (setq $gc_midlim 85) (setq $gc_pct .10) (setq ptimeatlastgc (ptime)) ;--- gcafter - [s] : type of item which ran out forcing garbage collection. ; This is called after each gc. ; the form of an opval element is (number_of_items_in_use ; number_of_pages_allocated ; number_of_items_per_page) ; ; (def gcafter (nlambda (s) (prog (x pct amt-to-allocate thisptime diffptime difftottime diffgctime) (cond ((null s) (return))) (cond ((null (boundp '$gccount$)) (setq $gccount$ 0))) (setq $gccount$ (1+ $gccount$)) (setq x (opval (car s))) (setq thisptime (ptime) difftottime (max (diff (car thisptime) (car ptimeatlastgc)) 1) diffgctime (diff (cadr thisptime) (cadr ptimeatlastgc)) ptimeatlastgc thisptime) ; pct is the percentage of space used (setq pct (quotient (times 100 (car x)) (max 1 (times (cadr x) (caddr x))))) (setq amt-to-allocate (cond (gcafter-panic-mode (cond ((greaterp pct 95) (patom "[Storage space totally exausted]") (terpr) (error "Space exausted when allocating " (car s))) (t 0))) ((greaterp pct $gc_midlim) (max $gc_minalloc (fix (times $gc_pct (cadr x))))) ((greaterp pct $gc_lowlim) $gc_minalloc) ((lessp (cadr x) 100) $gc_minalloc) (t 0))) (cond ((and (null gcafter-panic-mode) (greaterp amt-to-allocate 0)) (cond ((atom (errset (allocate (car s) amt-to-allocate))) (cond ($gcprint (patom "[Now in storage allocation panic mode]") (terpr))) (setq gcafter-panic-mode t))))) (cond ($gcprint (prtpagesused (car s) difftottime diffgctime) (comment (cond ((and (getd 'gcstat) (eq $gcprint '$all)) (print (gcstat)) (terpr))))))))) ;----Section V - the functions ; ;--- append - x : list ; - y : list ; [ must appear at the beginning to allow backquote to work ] ;--- append1 - x : list ; - y : lispval ; puts y at the end of list x ; (def append1 (lambda (x y) (append x (list y)))) ;--- assoc - x : lispval ; - l : list ; l is a list of lists. The list is examined and the first ; sublist whose car equals x is returned. ; (def assoc (lambda (val alist) (do ((al alist (cdr al))) ((null al) nil) (cond ((null (car al))) ((not (dtpr (car al))) (error "bad arg to assoc" al)) ((equal val (caar al)) (return (car al))))))) ;--- bigp - x : lispval ; returns t if x is a bignum ; (def bigp (lambda (arg) (equal (type arg) 'bignum))) ;--- comment - any ; ignores the rest of the things in the list (def comment (nlambda (x) 'comment)) ;--- concatl - l : list of atoms ; returns the list of atoms concatentated ; [ must appear at top to allow defmacro to work ] ;--- copy - l : list (will work if atom but will have no effect) ; makes a copy of the list. ; FIX THIS UP TO REMOVE RECURSION ON TAIL ; (def copy (lambda (l) (cond ((atom l) l) (t (cons (copy (car l)) (copy (cdr l))))))) ;--- copysymbol - sym : symbol to copy ; - flag : t or nil ; generates an uninterned symbol with the same name as sym. If flag is t ; then the value, function binding and property list of sym are placed ; in the uninterned symbol. ; (def copysymbol (lambda (sym flag) ((lambda (newsym) (cond (flag (cond ((boundp sym) (set newsym (eval sym)))) (putd newsym (getd sym)) (setplist newsym (plist sym)))) newsym) (uconcat sym)))) ;--- cvttointlisp -- convert reader syntax to conform to interlisp ; (def cvttointlisp (lambda nil (setsyntax '\% 143.) ; escape character (setsyntax '\\ 2.) ; normal character (setsyntax '\` 2.) ; normal character (setsyntax '\, 2.) ; normal character (sstatus uctolc t) ; one case )) ;--- cvttomaclisp - converts the readtable to a maclisp character syntax ; (def cvttomaclisp (lambda nil (setsyntax '\| 138.) ; double quoting char (setsyntax '\/ 143.) ; escape (setsyntax '\\ 2) ; normal char ; not needed in new lisp (setsyntax '\" 2) ; normal char (setsyntax '\[ 2) ; normal char (setsyntax '\] 2) ; normal char (sstatus uctolc t))) ;--- cvttoucilisp - converts the readtable to a ucilisp character syntax ; (def cvttoucilisp (lambda nil (sstatus uctolc t) ; upper case to lower case ; change backquote character. ; to ` and ! and !@ from ` , and ,@ ; undo comma. (cond ((eq (status syntax \,) 205) (setsyntax '\! 'splicing (get '\, 'macro)))) (setsyntax '\, 2) ; ; ~ as comment character, not ; and / instead of \ for escape (setsyntax '\~ 'splicing 'zapline) (setsyntax '\; 2) (setsyntax '\/ 143) (setsyntax '\\ 2))) ;--- defprop - like putprop except args are not evaled ; (def defprop (nlambda (argl) (putprop (car argl) (cadr argl) (caddr argl) ))) ;--- delete ; - val - lispval ; - lst - list ; - n - Optional arg, number of occurances to delete ; removes up to n occurances of val from the top level of lst. ; if n is not given, all occurances will be removed. ; (def delete (lexpr (nargs) (prog (val lst cur ret nmb) (cond ((< nargs 2) (error " too few args to delete " nargs)) ((= nargs 3) (setq nmb (arg 3)) (cond ((not (greaterp nmb 0)) (return (arg 2)))))) (setq val (arg 1) lst (arg 2)) (cond ((and (atom lst) (not (null lst))) (error " non list arg to delete " lst))) (setq cur (cons nil lst) ret cur) loop (cond ((null lst) (return (cdr ret))) ((equal val (car lst)) (rplacd cur (cdr lst)) (cond ((and nmb (zerop (setq nmb (1- nmb)))) (return (cdr ret))))) (t (setq cur (cdr cur)))) (setq lst (cdr lst)) (go loop)))) ;--- delq ; same as delete except eq is used for testing. ; (def delq (lexpr (nargs) (prog (val lst cur ret nmb) (cond ((< nargs 2) (error " too few args to delete " nargs)) ((= nargs 3) (setq nmb (arg 3)) (cond ((not (greaterp nmb 0)) (return (arg 2)))))) (setq val (arg 1) lst (arg 2)) (cond ((and (atom lst) (not (null lst))) (error " non list arg to delete " lst))) (setq cur (cons nil lst) ret cur) loop (cond ((null lst) (return (cdr ret))) ((eq val (car lst)) (rplacd cur (cdr lst)) (cond ((and nmb (zerop (setq nmb (1- nmb)))) (return (cdr ret))))) (t (setq cur (cdr cur)))) (setq lst (cdr lst)) (go loop)))) ;--- delete - val - s-expression ; - list - list to delete fromm ; -[n] optional count , if not specified, it is infinity ; delete removes every thing in the top level of list which equals val ; the list structure is modified ; ;(def delete ; (lexpr (nargs) ; ((lambda (val list n) ; (cond ((or (null list) (zerop n)) list) ; ((atom list) (error "Bad arg to delete " list)) ; ((equal val (car list)) ; (delete val (cdr list) (1- n))) ; (t (rplacd list (delete val (cdr list) n))))) ; (arg 1) ; (arg 2) ; (cond ((equal nargs 3) (arg 3)) ; (t 99999999))))) ; ; ;--- delq - val - s-expression ; - list - list to delete fromm ; -[n] optional count , if not specified, it is infinity ; delq removes every thing in the top level of list which eq's val ; the list structure is modified ; ;(def delq ; (lexpr (nargs) ; ((lambda (val list n) ; (cond ((or (atom list) (zerop n)) list) ; ((eq val (car list)) ; (delq val (cdr list) (1- n))) ; (t (rplacd list (delq val (cdr list) n))))) ; (arg 1) ; (arg 2) ; (cond ((equal nargs 3) (arg 3)) ; (t -1))))) ; ;--- evenp : num - return ; ; (def evenp (lambda (n) (cond ((not (zerop (boole 4 1 n))) t)))) ;--- ex [name] : unevaluated name of file to edit. ; the ex editor is forked to edit the given file, if no ; name is given the previous name is used ; (def ex (nlambda (x) (exvi 'ex x nil))) (declare (special edit_file)) (def exvi (lambda (cmd x doload) (prog (handy handyport bigname) (cond ((null x) (setq x (list edit_file))) (t (setq edit_file (car x)))) (setq bigname (concat (car x) '".l")) (cond ((setq handyport (car (errset (infile bigname) nil))) (close handyport) (setq handy bigname)) (t (setq handy (car x)))) (setq handy (concat cmd '" " handy)) (setq handy (list 'process handy)) (eval handy) (cond (doload (load edit_file)))))) ;--- exec - arg1 [arg2 [arg3 ...] ] unevaluated atoms ; A string of all the args concatenated together seperated by ; blanks is forked as a process. ; (def exec (nlambda ($list) (prog ($handy) (setq $handy (quote "")) loop (cond ((null $list) (return (eval (list (quote process) $handy)))) (t (setq $handy (concat (concat $handy (car $list)) (quote " "))) (setq $list (cdr $list)) (go loop)))))) ;--- exl - [name] : unevaluated name of file to edit and load. ; If name is not given the last file edited will be used. ; After the file is edited it will be `load'ed into lisp. ; (def exl (nlambda (x) (exvi 'ex x t))) ;----- explode functions ------- ; These functions, explode , explodec and exploden, implement the ; maclisp explode functions completely. ; They have a similar structure and are written with efficiency, not ; beauty in mind (and as a result they are quite ugly) ; The basic idea in all of them is to keep a pointer to the last ; thing added to the list, and rplacd the last cons cell of it each time. ; ;--- explode - arg : lispval ; explode returns a list of characters which print would use to ; print out arg. Slashification is included. ; (def explode (lambda (arg) (cond ((atom arg) (aexpl((ode arg)) (t (do ((ll (cdr arg) (cdr ll)) (sofar (setq arg (cons '"(" (explode (car arg))))) (xx)) ((cond ((null ll) (rplacd (last sofar) (ncons '")" )) t) ((atom ll) (rplacd (last sofar) `(" " "." " " ,@(explode ll) ,@(ncons '")"))) t)) arg) (setq xx (last sofar) sofar (cons '" " (explode (car ll)))) (rplacd xx sofar)))))) ;--- explodec - arg : lispval ; returns the list of character which would be use to print arg assuming that ; patom were used to print all atoms. ; that is, no slashification would be used. ; (def explodec (lambda (arg) (cond ((atom arg) (aexplodec arg)) (t (do ((ll (cdr arg) (cdr ll)) (sofar (setq arg (cons '"(" (explodec (car arg))))) (xx)) ((cond ((null ll) (rplacd (last sofar) (ncons '")" )) t) ((atom ll) (rplacd (last sofar) `(" " "." " " ,@(explodec ll) ,@(ncons '")"))) t)) arg) (setq xx (last sofar) sofar (cons '" " (explodec (car ll)))) (rplacd xx sofar)))))) ;--- exploden - arg : lispval ; returns a list just like explodec, except we return fixnums instead ; of characters. ; (def exploden (lambda (arg) (cond ((atom arg) (aexploden arg)) (t (do ((ll (cdr arg) (cdr ll)) (sofar (setq arg (cons 40. (exploden (car arg))))) (xx)) ((cond ((null ll) (rplacd (last sofar) (ncons 41.)) t) ((atom ll) (rplacd (last sofar) `(32. 46. 32. ,@(exploden ll) ,@(ncons 41.))) t)) arg) (setq xx (last sofar) sofar (cons 32. (exploden (car ll)))) (rplacd xx sofar)))))) ;-- expt - x ; - y ; ; y ; returns x ; (defun expt (x y) (cond ((equal x 1) x) ((zerop x) x) ; Maclisp does this ((lessp y 0) (quotient 1.0 (expt x (times -1 y)))) ((floatp y) (exp (times y (log x)))) ; bomb out for (-3)^4 or (-3)^4.0 or 0^y. (t ; y is integer, y>= 0 (prog (res) (setq res 1) loop (cond ((equal y 0) (return res)) ((oddp y)(setq res (times res x) y (1- y))) (t (setq x (times x x) y (/ y 2)))) (go loop))))) ;--- expt ; old '(defun expt(x y) (prog (res) (setq res 1) loop (cond ((equal y 0) (return res)) (t (setq res (times x res) y (1- y)))) (go loop))) ;--- ffasl :: fasl in a fortran file ; arg # ; 1 - fnam : file name ; 2 - entry : entry point name ; 3 - fcn : entry name ; 4 - disc : optional discipline (defun ffasl (fnam entry fcn &optional (disc 'subroutine)) (cfasl fnam entry fcn disc "-lI77 -lF77 -lm")) ; ; filepos function (maclisp compatibility) ; (defun filepos n (cond ((zerop n) nil) ((onep n) (fseek (arg 1) 0 1)) ((equal n 2) (fseek (arg 1) (arg 2) 0)))) ;--- fixp - l : lispval ; returns t if l is a fixnum or bignum ; (defun fixp (x) (or (equal (type x) 'fixnum) (equal (type x) 'bignum))) ;--- flatsize - l : lispval ; the second arg should be: ; - n : limit for what we care about ; but we dont care about this at present, since we have ; to explode the whole thing anyway. ; returns the number of characters which print would ; use to print l ; (defun flatsize n (length (explode (arg 1)))) ;--- floatp - l : lispval ; returns t if l is a flonum ; (defun floatp (x) (equal 'flonum (type x))) ;--- getchar,getcharn - x : atom ; - n : fixnum ; returns the n'th character of x's pname (the first corresponds to n=1) ; if n is negative then it counts from the end of the pname ; if n is out of bounds, nil is returned (def getchar (lambda (x n) (concat (substring x n 1)))) (def getcharn (lambda (x n) (substringn x n 0))) (def getl (lambda (atm lis) (do ((ll (cond ((atom atm) (plist atm)) (t (cdr atm))) (cddr ll))) ((null ll) nil) (cond ((memq (car ll) lis) (return ll)))))) ;--- help ; retrive selected portions of the Franz Lisp manual. ; There are four types of help offered: ; (help) prints a description of the other three options ; (help tc) prints a table of contents. ; (help n) {where n is a number or b or c} prints the whole chapter. ; (help fcn) prints info on function fcn ; ; An index to the functions is kept in the documentation directory. ; The index has entries like (append ch2.r). ; When asked to print info on a function, it locates the chapter ; using the index then asks more to locate the definition. ; (declare (localf locatefunction)) (defun help fexpr (lis) (cond ((null lis) (patom "type (help fnc) for info on function fnc")(terpr) (patom "type (help n) to see chapter n")(terpr) (patom "type (help tc) for a table of contents")(terpr)) (t (do ((ll lis (cdr ll)) (fcn)) ((null ll)) (cond ((not (atom (setq fcn (car ll)))) (patom "Bad option to help ")(print fcn)(terpr)) ((and (stringp fcn) (setq fcn (concat fcn)) nil)) ((eq fcn 'tc) (patom "Table of contents")(terpr) (patom "1 - intro; 2 - data structure; 3 - arithmetic; 4 - special")(terpr) (patom "5 - i/o; 6 - system; 7 - reader; 8 - functions; 9 - arrays")(terpr) (patom "10 - exceptions; 11 - trace package; 12 - Liszt;")(terpr) (patom "14 - step package; 15 - fixit package") (terpr) (patom "b - special symbols; c - gc & debugging & top level ")(terpr)) ((or (and (numberp fcn) (lessp fcn 16) (greaterp fcn -1)) (memq fcn '(b c))) (apply 'process (ncons (concat "/usr/ucb/ul /usr/lib/lisp/manual/ch" fcn ".r | /usr/ucb/more -f" )))) ((locatefunction fcn)) (t (patom "Unknown function: ")(print fcn)(terpr))))))) (declare (special readtable)) (defun locatefunction (fc) (let (x inf ) (cond ((null (get 'append 'helplocation)) (patom "[Reading help index]")(drain) (setq inf (infile "/usr/lib/lisp/manual/helpindex")) (do ((readtable (makereadtable t)) (x (read inf) (read inf))) ((null x) (close inf) (terpr)) (cond ((null (cddr x)) (putprop (car x) (cadr x) 'helplocation)) (t (putprop (concat (car x) " " (cadr x)) (caddr x) 'helplocation)))))) (cond ((setq x (get fc 'helplocation)) (apply 'process (ncons (concat "/usr/ucb/ul /usr/lib/lisp/manual/" x " | /usr/ucb/more -f \"+/(" fc "\""))) t)))) ; ; (hunk 'g_arg1 [...'g_argn]) ; ; This function makes a hunk. The hunk is preinitialized to the ; arguments present. The size of the hunk is determined by the ; number of arguments present. ; (defun hunk n (prog (size) (setq size -1) (cond ((> n 128) (error "hunk: size is too big" n)) ((eq n 1) (setq size 0)) ((eq n 0) (return nil)) ; hunk of zero length (t (setq size (1- (haulong (1- n)))))) (setq size (*makhunk size)) (do ((argnum 0 (1+ argnum))) ((eq argnum n)) (*rplacx argnum size (arg (1+ argnum)))) (return size))) ;--- last - l : list ; returns the last cons cell of the list, NOT the last element ; (def last (lambda (a) (do ((ll a (cdr ll))) ((null (cdr ll)) ll)))) ;---- load (declare (localf load-a-file)) (declare (special gcdisable)) (defun load (filename &rest fasl-args) (cond ((not (or (symbolp filename) (stringp filename))) (error "load: illegal filename " filename))) (let ( load-only fasl-only no-ext len search-path name pred shortname explf) ; determine the length of the filename, ignoring the possible ; list of directories. set explf to the reversed exploded filename (setq len (do ((xx (setq explf (nreverse (exploden filename))) (cdr xx)) (i 0 (1+ i))) ((null xx) i) (cond ((eq #// (car xx)) (return i))))) (cond ((> len 2) (cond ((eq (cadr explf) #/.) (cond ((eq (car explf) #/o) (setq fasl-only t)) ((eq (car explf) #/l) (setq load-only t)) (t (setq no-ext t)))) (t (setq no-ext t)))) (t (setq no-ext t))) ; a short name is less or equal 12 characters. If a name is not ; short, then load will not try to append .l or .o (cond ((< len 12) (setq shortname t))) (cond ((and (> len 0) (eq (getchar filename 1) '/)) (setq search-path '(||))) (t (setq search-path (status load-search-path)))) (do ((xx search-path (cdr xx))) ((null xx) (error "load: file not found " filename)) (setq pred (cond ((memq (car xx) '(|| |.|)) '||) (t (concat (car xx) "/")))) (cond (no-ext (cond ((and shortname (probef (setq name (concat pred filename ".o")))) (return (fasl name (car fasl-args) (cadr fasl-args)))) ((and shortname (probef (setq name (concat pred filename ".l")))) (return (load-a-file name))) ((probef (setq name (concat pred filename))) (cond (fasl-args (return (fasl name (car fasl-args) (cadr fasl-args)))) (t (return (load-a-file name))))))) (fasl-only (cond ((probef (setq name (concat pred filename))) (return (fasl name (car fasl-args) (cadr fasl-args)))))) (load-only (cond ((probef (setq name (concat pred filename))) (return (load-a-file name))))))))) (defun load-a-file (name) (let ((piport (infile name)) (gcdisable t) ; don't gc when loading, it slows things down (eof (list nil))) (do ((form (read piport eof) (read piport eof))) ((eq eof form) (close piport) t) (eval form)))) (sstatus load-search-path (|.| /usr/lib/lisp)) ;--- include - read in the file name given, the name not evaluated ; (def include (nlambda (l) (load (car l)))) ;--- includef - read in the file name given and eval the first arg ; (def includef (lambda (l) (load l))) ;--- length - l : list ; returns the number of elements in the list. ; (def length (lambda ($l$) (cond ((null $l$) 0) (t (do ((ll (cdr $l$) (cdr ll)) (i 1 (1+ i))) ((null ll) i)))))) ;--- list-to-bignum ; convert a list of fixnums to a bignum. ; there is a function bignum-to-list but it is written in C ; ;(author: kls) ; (def list-to-bignum (lambda (x) (cond (x (scons (car x) (list-to-bignum (cdr x)))) (t nil)))) ;--- macroexpand - form ; expands out all macros it can ; (def ma((croexpand (lambda (form) (prog nil top (cond ((atom form) (return form)) ((atom (car form)) (return (let ((nam (car form)) def disc) (setq def (getd nam)) (setq disc (cond ((bcdp def) (getdisc def)) ((arrayp def) 'array) ((dtpr def) (car def)))) (cond ((memq disc '(array lambda lexpr nil)) (cons nam (mapcar 'macroexpand (cdr form)))) ((eq disc 'macro) (setq form (apply nam form)) (go top)) (t form))))) (t (return (cons (macroexpand (car form)) (mapcar 'macroexpand (cdr form))))))))) ; ; (makhunk 'n) ; ; This function is similar to hunk, except that: ; ; n can be a fixnum, which specifies the length of the hunk. ; The hunk is preinitialized to nil's ; n can be a list which is used to preinitialize the hunk. ; (defun makhunk (n) (prog (size Hunk) (setq size -1) (cond ((numberp n) ; ; If n is a number then build a nil hunk of the right size ; (cond ((greaterp n 128) (error "makhunk: size is too big" n)) (t (setq size (1- (haulong n))))) (cond ((minusp size) (return nil))) (setq Hunk (*makhunk size)) (do ((i 0 (1+ i))) ((= i n)) (*rplacx i Hunk nil)) (return Hunk)) ; ; If it isn't a number, then try hunk on it ; (t (return (apply 'hunk n)))))) ;--- member - VAL : lispval ; - LIS : list ; returns that portion of LIS beginning with the first occurance ; of VAL if VAL is found at the top level of list LIS. ; uses equal for comparisons. ; (def member (lambda ($a$ $l$) (do ((ll $l$ (cdr ll))) ((null ll) nil) (cond ((equal $a$ (car ll)) (return ll)))))) ;--- memq - arg : (probably a symbol) ; - lis : list ; returns part of lis beginning with arg if arg is in lis ; ; [ defintion moved to top of file to allow backquote macro to work ] ;--- min - arg1 ... numbers ; ; returns minimum of n numbers. ; (def min (lexpr (nargs) (do ((i nargs (1- i)) (min (arg 1))) ((lessp i 2) min) (cond ((lessp (arg i) min) (setq min (arg i))))))) ;--- nconc - x1 x2 ...: lists ; The cdr of the last cons cell of xi is set to xi+1. This is the ; structure modification version of append ; (def nconc (lexpr (nargs) (cond ((eq nargs '2) (cond ((null (arg 1)) (arg 2)) (t (do ((tmp (arg 1) (cdr tmp))) ((null (cdr tmp)) (rplacd tmp (arg 2)) (arg 1)))))) ((zerop nargs) nil) (t (do ((i 1 nxt) (nxt 2 (1+ nxt)) (res (cons nil (arg 1)))) ((eq i nargs) (cdr res)) (cond ((arg i) (rplacd (last (arg i)) (arg nxt))) (t (rplacd (last res) (arg nxt))))))))) (declare (localf nreverse1)) ; quick fcn shared by nreverse and nreconc ;--- nreconc :: nreverse and nconc ; (nreconc list elemt) is equiv to (nconc (nreverse list) element) ; (defun nreconc (list element) (cond ((null list) element) (t (nreverse1 list element)))) ;--- nreverse - l : list ; reverse the list in place ; (defun nreverse (x) (cond ((null x) x) (t (nreverse1 x nil)))) ;--- nreverse1 ; common local function to nreconc and nreverse. [This can just be ; nreconc when I get local global functions allow in the compiler -jkf] ; (defun nreverse1 (x ele) (prog (nxt) loop (setq nxt (cdr x)) (rplacd x ele) (setq ele x) (cond (nxt (setq x nxt) (go loop))) (return x))) ; (def oddp (lambda (n) (cond ((not (zerop (boole 1 1 n))) t)))) ;--- plusp : x - number ; returns t iff x is greater than zero (def plusp (lambda (x) (greaterp x 0))) ;--- princ : l - any s-expression ; [p] - port to write to ; prints using patom for atoms (unslashified) ; (def princ (lexpr (n) (prog (port val) (cond ((eq n 2) (setq port (arg 2)))) (cond ((dtpr (setq val (arg 1))) (cond ((and (eq 'quote (car val)) (dtpr (cdr val)) (null (cddr val))) (patom "'" port) (princ (cadr val) port)) (t (patom "(" port) (do ((xx val)) ((null xx) (patom ")" port)) (princ (car xx) port) (cond ((null (setq xx (cdr xx)))) ((not (dtpr xx)) (patom " . " port) (princ xx port) (setq xx nil)) (t (patom " " port))))))) (t (patom val port))) (return t)))) ;--- prog1 : return the first value computed in a list of forms ; (def prog1 (lexpr (n) (arg 1))) ;--- reverse : l - list ; returns the list reversed using cons to create new list cells. ; (def reverse (lambda (x) (cond ((null x) nil) (t (do ((cur (cons (car x) nil) (cons (car res) cur)) (res (cdr x) (cdr res))) ((null res) cur)))))) ;--- shell - invoke a new c shell ; (def shell (lambda nil ((lambda (shellname) (cond ((lessp (flatc shellname) 1) (setq shellname 'csh))) (apply 'process (ncons shellname))) (getenv 'SHELL)))) ;--- sload : fn - file name (must include the .l) ; loads in the file printing each result as it is seen ; (def sload (lambda (fn) (prog (por eof) (cond ((setq por (infile fn))) (t (patom "bad file name")(terpr)(return nil))) (setq eof (gensym)) (do ((x (read por eof) (read por eof))) ((eq eof x) (close por)) (cond ((dtpr x) (print (cadr x))) (t (print x))) (terpr) (eval x))))) ; these is the old sort functions (comment (defun sort(a fun) (prog (n) (cond ((null a) (return nil)) ;no elements (t (setq n (length a)) (do i 1 (1+ i) (greaterp i n)(sorthelp a fun)) (return a) )))) (defun sorthelp (a fun) (do ((ii a (cdr ii))) ((null (cdr ii))) (cond ((funcall fun (cadr ii) (car ii)) (exchange2 ii))))) ) ;---- bubble merge sort ; it recursively splits the list to sort until the list is small. At that ; point it uses a bubble sort. Finally the sorted lists are merged. (declare (special sort-function)) ;--- sort :: sort a lisp list ; args: lst - list of items ; fcn - function to compare two items. ; returns: the list with such that for each pair of adjacent elements, ; either the elements are equal, or fcn applied to the two ; args returns a non nil value. ; (defun sort (lst fcn) (setq sort-function fcn) ; store function name in global cell ; (setq sort-compares 0) ; count number of comparisons (sortmerge lst (length lst))) ;--- sortmerge :: utility routine to sort ; args: lst - list of items to sort ; nitems - a rough idea of how many items are in the list ; ; result - sorted list (see the result of sort above) ; (defun sortmerge (lst nitems) (prog (tmp tmp2) (cond ((greaterp nitems 7) ; do a split and merge (setq tmp (splitlist lst (setq tmp2 (quotient nitems 2)))) (return (mergelists (sortmerge (car tmp) tmp2) (sortmerge (cdr tmp) tmp2)))) (t ; do a bubble sort (do ((l lst (cdr l)) (fin)) ((null l)) (do ((ll lst (cdr ll))) ((eq fin (cdr ll)) (setq fin ll)) ;(setq sort-compares (1+ sort-compares)) (cond ((not (funcall sort-function (car ll) (cadr ll))) (rplaca ll (prog1 (cadr ll) (rplaca (cdr ll) (car ll)))))))) (return lst))))) ;--- splitlist :: utility routine to split a list ; args : lst - list to split ; spliton - number of items to put in the first list ; ; returns: a cons cell whose car is the first part of the list ; and whose cdr is the second part. ; (defun splitlist (lst spliton) (prog (second) (do ((i spliton (sub1 i)) (l lst)) ((or (null (cdr l)) (zerop i)) (setq second (cdr l)) (rplacd l nil)) (setq l (cdr l))) (return (cons lst second)))) ;--- mergelists ::utility routine to merge two lists based on predicate function ; args: ls1 - lisp list ; ls2 - lisp list ; sort-function (global) - compares items of the lists ; ; returns: a sorted list containing the elements of the two lists. ; (defun mergelists (ls1 ls2) (prog (result current) ; initialize (setq current (setq result (cons nil nil))) loop (cond ((null ls1) (rplacd current ls2) (return (cdr result))) ((null ls2) (rplacd current ls1) (return (cdr result))) ((funcall sort-function (car ls1) (car ls2)) ;(setq sort-compares (1+ sort-compares)) (rplacd current ls1) (setq current ls1 ls1 (cdr ls1))) (t ;(setq sort-compares (1+ sort-compares)) (rplacd current ls2) (setq current ls2 ls2 (cdr ls2)))) (go loop))) ;--- end bubble merge sort (defun sortcar (a fun) (prog (n) (cond ((null a) (return nil)) ;no elements (t (setq n (length a)) (do i 1 (1+ i) (greaterp i n)(sortcarhelp a fun)) (return a) )))) (defun sortcarhelp (a fun) (cond ((null (cdr a)) a) ((funcall fun (caadr a) (caar a)) (exchange2 a) (sortcarhelp (cdr a) fun)) (t (sortcarhelp (cdr a) fun)))) (defun exchange2 (a) (prog (temp) (setq temp (cadr a)) (rplaca (cdr a) (car a)) (rplaca a temp))) ;--- sublis: alst - assoc list ((a . val) (b . val2) ...) ; exp - s-expression ; for each atom in exp which corresponds to a key in alst, the associated ; value from alst is substituted. The substitution is done by adding ; list cells, no struture mangling is done. Only the minimum number ; of list cells will be created. ; (def sublis (lambda (alst exp) (let (tmp) (cond ((atom exp) (cond ((setq tmp (assoc exp alst)) (cdr tmp)) (t exp))) ((setq tmp (sublishelp alst exp)) (car tmp)) (t exp))))) ;--- sublishelp : alst - assoc list ; exp - s-expression ; this function helps sublis work. it is different from sublis in that ; it return nil if no change need be made to exp, or returns a list of ; one element which is the changed exp. ; (def sublishelp (lambda (alst exp) (let (carp cdrp) (cond ((atom exp) (cond ((setq carp (assoc exp alst)) (list (cdr carp))) (t nil))) (t (setq carp (sublishelp alst (car exp)) cdrp (sublishelp alst (cdr exp))) (cond ((not (or carp cdrp)) nil) ; no change ((and carp (not cdrp)) ; car change (list (cons (car carp) (cdr exp)))) ((and (not carp) cdrp) ; cdr change (list (cons (car exp) (car cdrp)))) (t ; both change (( (list (cons (car carp) (car cdrp)))))))))) ;--- subst : new - sexp ; old - sexp ; pat - sexp ; substitutes in patrn all occurrences equal to old with new and returns the ; result ; MUST be put in the manual (declare (special new old)) (def subst (lambda (new old pat) (cond ((symbolp old) (substeq pat)) (t (substequal pat))))) ;use this function for substituting for symbols (def substeq (lambda (pat) (cond ((eq old pat) new) ((atom pat) pat) (t (cons (substeq (car pat))(substeq (cdr pat))))))) (def substequal (lambda (pat) (cond ((equal old pat) new) ((atom pat) pat) (t (cons (substequal (car pat)) ; in interlisp, the next line would be ;(substeq (cdr pat)) ; for maclisp compatibility, we do this. (substequal (cdr pat))))))) (declare (unspecial new old)) ;--- vi: arg is unevaluated name of function to run vi on ; (def vi (nlambda (x) (exvi 'vi x nil))) ;--- vil : arg is unevaluated, edits file and then loads it ; (def vil (nlambda (x) (exvi 'vi x t))) ;--- xcons : a - sexp ; b - sexp ; returns (b . a) that is, it is an exchanged cons ; (def xcons (lambda (a b) (cons b a))) ;--- Section VI - ARRAY functions . ; (def array (macro ($lis$) `(*array ',(cadr $lis$) ',(caddr $lis$) ,@(cdddr $lis$)))) ;--OLD array stuff. new stuff to follow ; array access function ; ; (def arracfun ; (lambda (actlst ardisc) ; (prog (diml ind val) ; ; (setq actlst (mapcar 'eval actlst) ; diml (getaux ardisc)) ; ; (cond ((null (equal (length actlst) ; (length (cdr diml)))) ; (break '"Wrong number of indexes to array ref")) ; ; (t (setq ind (arrcomputeind (cdr actlst) ; (cddr diml) ; (car actlst)) ; val (arrayref ardisc ind)) ; (cond ((or (eq (car diml) t) ; (eq (car diml) 'unmarked_array)) ; (setq val (eval val))) ; (t (setq val (cpy1 val)))) ; (return val)))))) ; ; ; ; ;(def *array ; (lexpr (nargs) ; (prog (name type rtype dims size tname) ; ; (setq name (arg 1) ; type (arg 2) ; rtype (cond ((null type) (setq type 'unmarked_array) ; 'value) ; ((equal type t) ; 'value) ; (t type)) ; dims (do ((i 3 (1+ i)) ; (res nil (cons (arg i) res))) ; ((greaterp i nargs) (nreverse res))) ; size (apply 'times dims)) ; ; (setq tname (marray (segment rtype size) ; (getd 'arracfun) ; (cons type dims) ; size ; (sizeof rtype))) ; (cond (name (set name tname) ; (putd name tname))) ; '(fillarray tname (cond ((eq type 'fixnum) '(0)) ; ((eq type 'flonum) '(0.0)) ; (t '(nil)))) ; (return tname)))) ; ;(defmacro arraycall (type name &rest indexs) ; `(ev-arraycall ',type ,name (list ,@ indexs))) ; ; ;(def ev-arraycall ; (lambda (type ardisc indexs) ; ; form (arraycall type name sub1 sub2 ... subn) ; (cond ((or (not (equal (car (getaux ardisc)) type)) ; (and (eq (car (getaux ardisc)) 'unmarked_array) ; type)) ; ; (patom '" Type given arraycall:") ; (patom type) ; (patom '" doesn't match array type:") ; (patom (car (getaux ardisc))) ; (break nil))) ; (apply (getaccess ardisc) ; (list indexs ardisc)))) ; ; ; ; ;; function to compute the raw array index ; ;(def arrcomputeind ; (lambda (indl diml res) ; (cond ((null diml) res) ; (t (arrcomputeind (cdr indl) ; (cdr diml) ; (+ (* res (car diml)) ; (car indl))))))) ; ;; store ;; we make store a macro to insure that all parts are evaluated at the ;; right time even if it is compiled. ;; (store (foo 34 i) (plus r f)) ;; gets translated to ;; (storeintern foo (plus r f) (list 34 i)) ;; and storeintern is a lambda, so when foo is evaluated it will pass the ;; array descriptor to storeintern, so storeintern can look at the ;; aux part to determine the type of array. ;; ;(defmacro store ( (arrname . indexes) value) ; (prog nil ; ; loop ; (cond ; ((eq 'funcall arrname) ; (setq arrname `(getd ,(car indexes)) ; indexes (cdr indexes))) ; ((eq 'arraycall arrname) ; (setq arrname (cadr indexes) ; indexes (cddr indexes))) ; ((and ((lambda (fnd) ; (cond ((or (and (dtpr fnd) (eq 'macro (car fnd))) ; (and (bcdp fnd) (eq 'macro (getdisc fnd)))) ; (setq fnd (apply arrname (cons arrname indexes))) ; (setq arrname (car fnd) ; indexes (cdr fnd))))) ; (getd arrname)) ; (go loop))) ; (t (setq arrname `(getd ',arrname)))) ; (return `(storeintern ,arrname ,value (list ,@indexes))))) ; ;;-- storeintern - internal store function ;; - arrnam : array descriptor ;; - vl : value to store ;; - actlst : list of actual variable values ;; ;(def storeintern ; (lambda (arrnam vl actlst) ; (prog (loc) ; (cond ((or (eq t (car (getaux arrnam))) ; (eq 'unmarked_array (car (getaux arrnam)))) ; (setq loc (arracfcnsimp actlst arrnam)) ; (set loc vl)) ; ; (t (replace (arracfcnsimp actlst arrnam) vl))) ; (return vl)))) ; ; ;(def arracfcnsimp ; (lambda (indexes adisc) ; (prog (dims) ; (setq dims (cdr (getaux adisc))) ; (cond ((null (equal (length indexes) ; (length dims))) ; (break '"wrong number of indexes to array")) ; (t (setq dims (arrcomputeind (cdr indexes) ; (cdr dims) ; (car indexes))))) ; (return (arrayref adisc dims))))) ; ; ;; new array package (jkf 9/24/80) ; features of the new package: ; Most array will be notype arrays. This is because they are the most ; efficient in Franz. What used to be fixnum and flonums arrays are ; now fixnum-block and flonum-block arrays. ; The array access functions are more specialized and much faster now. ; The array access functions have different semantics. Now they are ; responsible for both accessing and storing in an array. ; When an access function is asked to access a value, it will be given ; the subscripts already evaluated and the array object. These will ; be stacked, so the array access function should be a lexpr to read them. ; When an access function is asked to store a value that value will be ; the first argument, the subscripts will follow and finally there will ; be the array object. ; It is up to the access function to determine if it is being asked to ; store or retrieve a value, and this determination will probably ; be made by looking at the number of arguments. (declare (special gcdisable)) (def *array (lexpr (nargs) (prog (name type rtype dims size tname numdims) (cond ((lessp (setq numdims (- nargs 2)) 1) (error "no bounds to array declaration "))) (setq name (arg 1) type (arg 2) rtype (cond ((memq type '(t nil fixnum flonum)) 'value) ((eq type 'fixnum-block) 'fixnum) ((eq type 'flonum-block) 'flonum) (t (error "array: bad type: " type))) dims (do ((i nargs (1- i)) (res nil (cons (arg i) res))) ((eq i 2) res)) size (apply 'times dims)) (cond ((null type) (setq type 'unmarked_array))) ; we disable gc during the next calculation since ; the data returned from small-segment is unprotected ; and a gc would cause its data to be put on the ; free list. (let ((gcdisable t)) (setq tname (marray (small-segment rtype size) (cond ((eq rtype 'value) (cond ((eq numdims 1) (getd 'arrac-oneD)) ((eq numdims 2) (getd 'arrac-twoD)) (t (getd 'arrac-nD)))) (t (getd 'arrac-nD))) (cons type dims) size (sizeof rtype)))) ; if type is fixnum or flonum ; we must intialize to 0 or 0.0 (cond ((or (and (eq 'fixnum type) (setq rtype 0)) (and (eq 'flonum type) (setq rtype 0.0))) (do ((i size)) ((zerop i)) (set (arrayref tname (setq i (1- i))) rtype)))) (cond (name (putd name tname))) (return tname)))) (defmacro arraycall (type array &rest indexes) `(funcall ,array ,@indexes)) ; this is used by the old array scheme. Keep this around until ; everything is recompiled (defun ev-arraycall (type array indexes) (apply array indexes)) ;;;---- array access functions. ; we first define a macro to evaluate a value cell. In compiled code cdr ; is the fastest way to do this, in interpreted code the type checker ; would not let us use cdr so we have to use eval. (eval-when (compile) (defmacro value-eval (x) `(cdr ,x))) ; one level of indirection (eval-when (eval) (defun value-eval (x) (eval x))) ;- one dimensional (defun arrac-oneD n (cond ((eq n 2) (value-eval (arrayref (arg 2) (arg 1)))) ((eq n 3) (set (arrayref (arg 3) (arg 2)) (arg 1))) (t (error " wrong number of subscripts to array: " (arg n))))) (defun arrac-twoD n (let ((aux (getaux (arg n)))) (cond ((eq n 3) (value-eval (arrayref (arg n) (+ (* (arg 1) (caddr aux)) (arg 2))))) ((eq n 4) (set (arrayref (arg n) (+ (* (arg 2) (caddr aux)) (arg 3))) (arg 1))) (t (error " wrong number of subscripts to array: " (arg n)))))) ;-- n dimensional array access function. (defun arrac-nD n (let ((aux (getaux (arg n))) firstsub subs store (index 0)) (setq subs (length (cdr aux))) (cond ((eq n (1+ subs)) (setq firstsub 1)) ((eq n (+ 2 subs)) (setq firstsub 2 store t)) (t (error "wrong number of subscripts to array: " (arg n)))) (setq index (arg firstsub)) (do ((bounds (cddr aux) (cdr bounds)) (i firstsub)) ((null bounds)) (setq index (+ (* index (car bounds)) (arg (setq i (1+ i)))))) (setq subs (arrayref (arg n) index)) ; get cell requested (cond ((memq (car aux) '(fixnum-block flonum-block)) (cond (store (replace subs (arg 1))) (t (cpy1 subs)))) (t (cond (store (set subs (arg 1))) (t (value-eval subs))))))) (defmacro store ( (arrname . indexes) value) (prog (defered) loop (cond ((eq 'funcall arrname) (setq arrname (car indexes) indexes (cdr indexes) defered t)) ((eq 'arraycall arrname) (setq arrname (cadr indexes) indexes (cddr indexes) defered t)) (( ((arrayp arrname) (setq arrname `',arrname defered t)) ((and ((lambda (fnd) (cond ((or (and (dtpr fnd) (eq 'macro (car fnd))) (and (bcdp fnd) (eq 'macro (getdisc fnd)))) (setq fnd (apply arrname (cons arrname indexes))) (setq arrname (car fnd) indexes (cdr fnd))))) (getd arrname)) (go loop)))) (return (cond (defered `(funcall ,arrname ,value . ,indexes)) (t `(,arrname ,value . ,indexes)))))) ;-- storeintern - there may be residual calls to storeintern from ; old code, we handle it here. this routine can be eliminated when ; code is recompiled (defun storeintern (arrnam value indexes) (apply arrnam (cons value indexes))) ;--- small segment storage allocators. ; this function allocates segments of storage and attempt to use the whole ; block instead of throwing away what isnt used ; (declare (special gcdisable)) (defun small-segment (type n) (prog (lastseg retv elementsize itemsperpage-1 gcdisable tmp) (setq gcdisable t) ; its not a good idea to gc while we are ; handling pointers to things segment returns. (desetq (elementsize . itemsperpage-1) (get 'segment-sizes type)) (cond ((null elementsize) (error "small-segment: bad type " type))) (setq lastseg (get 'segment-types type)) (cond ((and lastseg (not (lessp (car lastseg) n)))) (t ; must allocate a block of storage, want to the least number of ; pages which includes n elements ; there are elementsize elements per page, and ; itemsperpage-1 is the number of elements on a page minus 1 (setq retv (boole 4 (+ n itemsperpage-1) itemsperpage-1)) ; 4 is x & ~y (setq lastseg (cons retv (maknum (segment type retv)))))) (setq retv (cdr lastseg)) (rplaca lastseg (- (car lastseg) n)) (rplacd lastseg (+ (cdr lastseg) (* elementsize n))) (cond ((greaterp (car lastseg) 0) (putprop 'segment-types lastseg type) (cond ((null (setq tmp (get 'segment-arrays type))) (putprop 'segment-arrays (setq tmp (marray nil nil nil nil nil)) type))) (putdata tmp (fake (cdr lastseg))) (putlength tmp (car lastseg)) (putdelta tmp elementsize)) (t ; remove all counters since we no longer have any space ; left and we can't have a zero length array (remprop 'segment-types type) (remprop 'segment-arrays type))) (return (fake retv)))) ; data base for small-segment (putprop 'segment-sizes '( 4 . 127) 'value) (putprop 'segment-sizes '( 4 . 127) 'fixnum) (putprop 'segment-sizes '( 8 . 63) 'flonum) (def arraydims (lambda (arg) (cond ((symbolp arg) (getaux (getd arg))) ((arrayp arg) (getaux arg)) (t (break '"non array arg to arraydims"))))) ; fill array from list or array (def fillarray (lambda (arr lis) (prog (maxv typept) (cond ((symbolp arr) (setq arr (getd arr)))) (cond ((symbolp lis) (setq lis (getd lis)) (return (fillarrayarray arr lis))) ((arrayp lis) (return (fillarrayarray arr lis)))) (setq maxv (1- (getlength arr)) typept (cond ((memq (car (getaux arr)) '(t fixnum flonum unmarked_array)) t) (t nil))) (do ((ls lis) (i 0 (1+ i))) ((greaterp i maxv)) (cond (typept (set (arrayref arr i) (car ls))) (t (replace (arrayref arr i) (car ls)))) (cond ((cdr ls) (setq ls (cdr ls)))))))) (def fillarrayarray (lambda (arrto arrfrom) (prog (maxv) (setq maxv (1- (min (getlength arrto) (getlength arrfrom)))) (do ((i 0 (1+ i))) ((greaterp i maxv)) (replace (arrayref arrto i) (arrayref arrfrom i)))))) (def listarray (lexpr (n) (prog (arr size typ ret newv) (setq arr (arg 1)) (cond ((and (symbolp arr) (arrayp (setq arr (getd arr))))) (t (error "Non array to listarray " arr))) (setq size (cond ((eq n 2) (arg 2)) (t (apply '* (cdr (arraydims arr)))))) (setq typ (car (getaux arr))) (cond ((memq typ '(t fixnum flonum unmarked_array)) (setq typ t)) (t (setq typ nil))) (do ((i (1- size) (1- i))) ((lessp i 0)) (setq newv (arrayref arr i)) (setq ret (cons (cond (typ (eval newv)) (t (cpy1 newv))) ret))) (return ret)))) ;---Section VII - equivalances------------------- ; (putd 'abs (getd 'absval)) (putd 'add (getd 'sum)) (putd 'bcdcall (getd 'funcall)) (putd 'chrct (getd 'charcnt)) (putd 'diff (getd 'difference)) (putd 'numbp (getd 'numberp)) (putd 'remainder (getd 'mod)) (putd 'terpri (getd 'terpr)) (putd 'typep (getd 'type)) (putd 'symeval (getd 'eval)) (putd '< (getd 'lessp)) (putd '= (getd 'equal)) (putd '> (getd 'greaterp)) (putd '*dif (getd 'difference)) (putd '\\ (getd 'mod)) (putd '\1+ (getd 'add1)) (putd '\1+$ (getd 'add1)) (putd '\1- (getd 'sub1)) (putd '\1-$ (getd 'sub1)) (putd '*$ (getd 'times)) (putd '/$ (getd 'quotient)) (putd '+$ (getd 'add)) (putd '-$ (getd 'difference)) 'diff (getd 'difference)) (putd 'numbp (getd 'numberp)) (putd 'remainder (getd 'mod)) (putd 'terpri (getd 'terpr)) (putd 'typep (getd 'type)) (putd 'symevalcmd/lisp/lib/auxfns1.l 444 0 12 21453 2552720224 10075 (setq SCCS-auxfns1 "@(#)auxfns1.l 1.1 10/3/80") ;--- msg - arg1 ... arguments of the form described below ; B - print out a blank ; N - print out a newline (terpr) ; (B n) - print out n blanks ; (P p) - henceforth print on port p ; atom - patom this exactly (no evaluation) ; other - evaluate and patom this expression. ; (def msg (macro (lis) `(progn ,@(msgmake (cdr lis) 'nil)))) (eval-when (eval compile load) (def msgmake (lambda (forms outport) ((lambda (thisform) (cond ((null forms) `((drain ,@outport))) ((and (eq 'B thisform) (setq thisform '" ") nil)) ((eq 'N thisform) (cons `(terpr ,@outport) (msgmake (cdr forms) outport))) ((atom thisform) (cons `(patom ',thisform ,@outport) (msgmake (cdr forms) outport))) ((eq 'P (car thisform)) (msgmake (cdr forms) `(,@(cdr thisform)))) ((eq 'B (car thisform)) (cons `(printblanks ,@(cdr thisform) ,outport) (msgmake (cdr forms) outport))) (t (cons `(patom ,thisform ,@outport) (msgmake (cdr forms) outport))))) (car forms))))) (def printblanks (lambda (n prt) (do ((i n (1- i))) ((lessp i 1)) (patom '" " prt)))) ; ============================================== ; ; (linelength [numb]) ; ; sets the linelength (actually just varib linel) to the ; number given: numb ; if numb is not given, the current line length is returned ; ================================================= (setq linel 80) (def linelength (nlambda (form) (cond ((null form) linel ) ((numberp (car form)) (setq linel (car form))) (t linel)))) ; ======================================== ; ; (charcnt port) ; returns the number of characters left on the current line ; on the given port ; ; ======================================= (def charcnt (lambda (port) (- linel (nwritn port)))) (def nthcdr (lambda (n x) (cond ((zerop n) x) ((lessp n 0) (cons nil x)) (t (nthcdr (1- n) (cdr x) ))))) (def nth (lambda (n x) (car (nthcdr n x)))) ;r lambda: (nthrest numb list) ;- args: numb - integer ;- list - list ;- returns:the rest of the list beginning at the numb'th element. ;- for convience, (nthrest 0 list) equals (nthrest 1 list) ;- equals list. This is designed to be similar to nthelem ;- which returns the nth element of a list. (def nthrest (lambda (number list) (cond ((lessp number 2) list) (t (nthrest (1- number) (cdr list)))))) ;;============================== ; (assqr val alist) ; acts much like assq, it looks for val in the cdr of elements of ; the alist and returns the element if found. ; fix this when the compiler works (eval-when nil (def assqr (lambda (val alist) (do ((al alist (cdr al))) ((null al) nil) (cond ((eq val (cdar al)) (return (car al)))))))) ; ==================== ; (listp 'x) is t if x is a non-atom or nil ; ==================== (def listp (lambda (val) (or (dtpr val) (null val)))) ;--- memcar - VAL : lispval ; - LIS : list ; returns t if VAL found as the car of a top level element. ;temporarily turn this off till the compiler can handle it. (eval-when nil (def memcar (lambda (a l) (do ((ll l (cdr ll))) ((null ll) nil) (cond ((equal (caar ll) a) (return (cdar ll)))))))) ; ================================= ; ; (memcdr 'val 'listl) ; ; the list listl is searched for a list ; with cdr equal to val. if found, the ; car of that list is returned. ; ================================== ;fix this when compiler works ok (eval-when nil (def memcdr (lambda (a l) (do ((ll l (cdr ll))) ((null ll) nil) (cond ((equal (cdar ll) a) (return (caar l)))))))) ;this looks like funcall, so we will just use it '(def apply* (nlambda ($x$) (eval (cons (eval (car $x$)) (cdr $x$))))) (putd 'apply* (getd 'funcall)) ; ======================================= ; pretty printer top level routine pp ; ; calling form- (pp arg1 arg2 ... argn) ; the args may be names of functions, atoms with associated values ; or output descriptors. ; if argi is: ; an atom - it is assumed to be a function name, if there is no ; function property associated with it,then it is assumed ; to be an atom with a value ; (P port)- port is the output port where the results of the ; pretty printing will be sent. ; poport is the default if no (P port) is given. ; (F fname)- fname is a file name to write the results in ; (A atmname) - means, treat this as an atom with a value, dont ; check if ((it is the name of a function. ; (declare (special $outport$ $fileopen$ )) ; printret is like print yet it returns the value printed, this is used ; by pp (def printret (macro ($l$) `(progn (print ,@(cdr $l$)) ,(cadr $l$)))) (def pp (nlambda ($xlist$) (prog ($outport$ $cur$ $fileopen$ $prl$ $atm$ funcdef) (setq $outport$ poport) ; default port ; check if more to do, if not close output file if it is ; open and leave toploop (cond ((null (setq $cur$ (car $xlist$))) (condclosefile) (return t))) (cond ((dtpr $cur$) (cond ((equal 'P (car $cur$)) ; specifying a port (condclosefile) ; close file if open (setq $outport$ (eval (cadr $cur$)))) ((equal 'F (car $cur$)) ; specifying a file (condclosefile) ; close file if open (setq $outport$ (outfile (cadr $cur$)) $fileopen$ t)) ((equal 'A (car $cur$)) ; declaring atomness (setq $atm$ t) (setq $cur$ (cadr $cur$)) (go midstuff)) ((eq 'V (car $cur$)) ; print value only (setq $atm$ 'value) (setq $cur$ (cadr $cur$)) (go midstuff)) (t (msg N "bad arg to pp: " (or $cur$)))) (go botloop))) midstuff ; process the atom or function (cond ((eq 'value $atm$) (setq $prl$ (eval $cur$))) ((or $atm$ (null (getd $cur$))) ; check if is atom (cond ((boundp $cur$) ; yes, see if bound (setq $prl$ (list 'setq $cur$ (list 'quote (eval $cur$))))) (t (msg N "pp: atom " (or $cur$) " is unbound") (go botloop)))) ((bcdp (setq funcdef (getd $cur$))) ; is a fcn, see if bcd (msg N "pp: function " (or $cur$) " is machine coded (bcd) ") (go botloop)) ((and (dtpr funcdef) (dtpr (cadr funcdef)) (memq (caadr funcdef) '(T-nargs T-arglist)) (setq $prl$ (list 'def $cur$ (get $cur$ 'original))))) (t (setq $prl$ (list 'def $cur$ funcdef)))) ; now print it ($prpr $prl$) (terpr $outport$) (setq $atm$ nil) ; clear flag botloop (setq $xlist$ (cdr $xlist$)) (go toploop)))) (def condclosefile (lambda nil (cond ($fileopen$ (terpr $outport$) (close $outport$) (setq $fileopen$ nil))))) ; ; these routines are meant to be used by pp but since ; some people insist on using them we will set $outport$ to nil ; as the default (setq $outport$ nil) (def $prpr (lambda (x) (cond ((not (boundp '$outport$)) (setq $outport$ poport))) (terpr $outport$) ($prdf x 0 0))) (declare (special m)) (def $prdf (lambda (l n m) (prog () ($tocolumn n) a (cond ((or (atom l) (lessp (+ m (flatc l (charcnt $outport$))) (charcnt $outport$))) (return (printret l $outport$))) ((and ($patom1 lpar) (lessp 2 (length l)) (atom (car l))) (prog (c f g h) (setq g (cond ((member (car l) '(lambda nlambda)) -7) (t 0))) (setq f (equal (printret (car l) $outport$) 'prog)) ($patom1 ' " ") (setq c ($dinc)) a ($prd1 (cdr l) (+ c (cond ((setq h (and f (cadr l) (atom (cadr l)))) -5) (t g)))) (cond ((cdr (setq l (cdr l))) (cond ((or (null h) (atom (cadr l))) (terpr $outport$))) (go a))))) ((prog (c) (setq c ($dinc)) a ($prd1 l c) (cond ((setq l (cdr l)) (terpr $outport$) (go a)))))) b ($patom1 rpar)))) (def $prd1 (lambda (l n) (prog () ($prdf (car l) n (cond ((null (setq l (cdr l))) (1+ m)) ((atom l) (setq n nil) (plus 4 m (pntlen l))) (t m))) (cond ((null n) ($patom1 ' " . ") (return (printret l $outport$))))))) (def $dinc (lambda () (- (linelength $outport$) (charcnt $outport$)))) (def $tocolumn (lambda (n) (cond ((greaterp (setq n (- n (nwritn $outport$))) 0) (do ((i 0 (1+ i))) ((eq i n)) (patom '" " $outport$)))))) ; ======================================== ; ; (charcnt port) ; returns the number of characters left on the current line ; on the given port ; ; ======================================= (def charcnt (lambda (port) (- linel (nwritn port)))) (def $patom1 (lambda (x) (patom x $outport$))) ) (- (linelength $outport$) (charcnt $outport$)))) (def $tocolumn (lambda (n) (cond ((greaterp (setq n (- n (nwritn $outport$))) 0) (do ((i 0 (1+ i))) ((eq i n)) (patom '" " $outport$))))))cmd/lisp/lib/backquote.l 444 0 12 10735 2512712355 10471 (setq SCCS-backquote "@(#)backquote.l 1.4 3/7/81") (setsyntax '\; 'splicing 'zapline) ;---- This file contains the definitions of the backquote and sharpsign ; character macros. [The backquote macro actually uses two characters, ; ` and ,] (setq **backquote** 1) (eval-when (eval) (cond ((null (getd 'declare)) (def declare (nlambda (l) nil))))) (declare (special **backquote**)) (def back-quote-ch-macro (lambda nil (back=quotify ((lambda (**backquote**) (read)) (1+ **backquote**))))) (def back-quote-comma-macro (lambda nil ((lambda (**backquote**) (cond ((zerop **backquote**) (error "comma not inside a backquote.")) ((eq (tyipeek) 64) (tyi) (cons '\,@ (read))) ((eq (tyipeek) 46) (tyi) (cons '\,\. (read))) (t (cons '\, (read))))) (1- **backquote**)))) (def back=quotify (lambda (x) ((lambda (a d aa ad dqp) (cond ((atom x) (list 'quote x)) ((eq (car x) '\,) (cdr x)) ((or (atom (car x)) (not (memq (caar x) '( \,@ \,\.)))) (setq a (back=quotify (car x)) d (back=quotify (cdr x)) ad (atom d) aa (atom a) dqp (and (not ad) (eq (car d) 'quote))) (cond ((and dqp (not (atom a)) (eq (car a) 'quote)) (list 'quote (cons (cadr a) (cadr d)))) ((and dqp (null (cadr d))) (list 'list a)) ((and (not ad) (eq (car d) 'list)) (cons 'list (cons a (cdr d)))) (t (list 'cons a d)))) ((eq (caar x) '\,@) (list 'append (cdar x) (back=quotify (cdr x)))) ((eq (caar x) '\,\.) (list 'nconc (cdar x)(back=quotify (cdr x)))) )) nil nil nil nil nil))) (putd '1+ (getd 'add1)) (putd '1- (getd 'sub1)) (setsyntax '\` 'macro 'back-quote-ch-macro) (setsyntax '\, 'macro 'back-quote-comma-macro) ;------- sharpsign macro, used for conditional assembly ;#O or #o reads sexp with ibase bound to 8. ;#+ makes exist if (STATUS FEATURE ) is T ;#- makes exist if (STATUS FEATURE ) is NIL ;#+(OR F1 F2 ...) makes exist of any one of F1,F2,... are in ; the (STATUS FEATURES) list. ;#+(AND F1 F2 ...) works similarly except all must be present in the list. ;#+(NOT ) is the same as #-. ;#/CHAR returns the numerical character code of CHAR. ;#\SYMBOL gets the numerical character code of non-printing characters. ;#' is to FUNCTION as ' is to QUOTE. ;#. evaluates at read time and leaves the result. ;#, evaluates at load time. Here it is the same as "#.". (declare (special franz-symbolic-character-names ibase)) (setsyntax '\# 'splicing 'sharp-sign-macro) (def sharp-sign-macro (lambda () ((lambda (char frob) (setq char (tyi)) (cond ((or (eq char 79.) ;O (eq char 111.)) ;o ((lambda (ibase) (list (read))) 8.)) ((eq char 43.) ;+ (setq frob (read)) (cond ((not (feature-present frob)) (read))) nil) ((eq char 45.) ;- (setq frob (read)) (cond ((feature-present frob) (read))) nil) ((eq char 47.) ;/ (list (tyi))) ;return numeric value of CHAR ;list because splicing ((eq char 94.) ; ^ returns following char (list (boole 1 31. (tyi)))) ; made into a control char ((eq char 39.) ;' (list (list 'function (read)))) ((or (eq char 44.) (eq char 46.)) ;, or . (list (eval (read)))) ((eq char 92.) ;\ (setq frob (read)) ;get symbolic name of character (setq char (cdr (assq frob franz-symbolic-character-names))) (or char (error '|Illegal character name in #\\| frob)) (list char)) (t (error '|Bad character after #| (ascii char))))) nil nil))) (defun feature-present (feature) (cond ((atom feature) (memq feature (status features))) ;damn fsubrs ((eq (car feature) 'not) (not (feature-present (cadr feature)))) ((eq (car feature) 'and) (do ((list (cdr feature) (cdr list))) ((null list) t) (cond ((not (feature-present (car list))) (return nil))))) ((eq (car feature) 'or) (do ((list (cdr feature) (cdr list))) ((null list) nil) (cond ((feature-present (car list)) (return t))))) (t (error '|Unknown form after #+ or #-| feature)))) (setq franz-symbolic-character-names '((eof . -1) (bs . 8.) (backspace . 8.) (tab . 9.) (lf . 10.) (linefeed . 10.) (ff . 12.) (form . 12.) (return . 13.) (cr . 13.) (newline . 10.) (vt . 9.) (alt . 27.) (esc . 27.) (sp . 32.) (space . 32.) (rubout . 127.))) (return nil))))) ((eq (car fecmd/lisp/lib/editor.l 444 0 12 34457 2552720227 10011 (((setq SCCS-editor "@(#)editor.l 1.1 10/2/80") ; editor from bbn-lisp c. 1968 ; (transcribed by R. Fateman for UNIX LISP, Oct., 1977) ; (modified and enhanced by P. Pifer, May, 1978) ; (corrected again by R. Fateman for VAX Unix Lisp, Dec., 1978) ; (cleaned up, commented and compiled by J. Foderaro, Aug., 1979) ; ( ... fixed bug in ^ command) ; (declare (special edok em pf pl l)) (setq printflag t) ; print on by default (setq printlevel 3) (setq maxlevel 100) (setq findflag nil) (setq supereditflg t)(setq printflag t)(setq edrptcnt nil) ;--- remedit - removes all traces of the editor from the oblist. ; Note that if the editor is compiled, the code space ; will not be reclaimed ; (def remedit (lambda nil (prog nil (mapc (function (lambda (x) (set x nil))) '(editmacros findflag supereditflg edrptcnt printflag printlevel maxlevel)) (mapc (function (lambda (x) (putd x nil))) '(editf editv tconc eprint eprint1 printlevel dsubst editcoms edit1f edit2f edit2af edit4e editqf edit4e edit4f edit4f1 editnth bpnt bpnt0 subpair subpr ri ro li lo bi bo ldiff nthcdr attach edite editcom editdefault remedit)) (return 'gone)))) ;--- subst - a - newval ; - b : oldvall ; - c : string ; substitute a for b in c ; (def subst (lambda (a b c) (cond ((equal b c) a) ((atom c) c) (t (cons (subst a b (car c)) (subst a b (cdr c))))))) (def tconc (lambda (x p) (cond ((null (car p)) (rplacd p (car (rplaca p (list x))))) (t (rplacd p (cdr (rplacd (cdr p) (list x)))))))) ;--- printlevel - x : new value ; set the printlevel to x and return the old value ; [change this to prog1 ] ; (def printlevel (lambda (x) (prog (a) (setq a printlevel) (setq printlevel x) (return a)))) ;--- editf - funcname : name of function to edit ; - [cmds] : commands to apply right away ; This is the starting point in the editor. You specify the ; file you wish to edit and perhaps some initial commands to ; the editor. If the function is not machine coded you ; enter the editor. ; (def editf (nlambda (x) (prog (a c) (setq a (getd (car x))) (cond ((or (null a) (bcdp a)) (return '(not editable)))) (putd (car x) (car (edite a (cdr x) nil))) (return (car x))))) '(def dsubst (lambda (x y z) (prog nil (cond ((null z) (return z)) ((equal y (car z)) (rplaca z x) (go l))) (cond ((null (atom (car z))) (dsubst x y (car z)))) l (dsubst x y (cdr z)) (return z)))) ;--- dsubst - x : oldval ; - y : newval ; - z : form ; directly substitutes all occurances of x in form z with y. ; It uses rplaca and does not copy the structure. ; (def dsubst (lambda (x y z) (cond ((dptr z) (cond ((equal y (car z)) (rplaca (car z) x)) (t (dsubst x y (car z))))) (t z)) (dsubst x y (cdr z)) z)) (def editcoms (lambda (c) (mapc (function editcom) c))) (def edit1f (lambda (c l) (cond ((equal c 0) (cond ((null (cdr l)) (err nil)) (t (cdr l)))) ((greaterp c 0) (cond ((greaterp c (length (car l))) (err nil)) (t (cons (car (nthcdr (sub1 c) (car l) )) l)))) ((greaterp (times c -1) (length (car l))) (err nil)) (t (cons (car (nthcdr (plus (length (car l)) c) (car l) )) l))))) (def edit2f (lambda (c) (cond ((greaterp (car c) 0) (cond ((greaterp (car c) (length (car l))) (err nil)) (t (rplaca l (edit2af (sub1 (car c)) (car l) (cdr c) nil))))) ((or (equal (car c) 0) (null (cdr c)) (greaterp (times -1 (car c)) (length (car l)))) (err nil)) (t (rplaca l (edit2af (sub1 (times -1 (car c))) (car l) (cdr c) t)))))) (def edit2af (lambda (n x r d) (prog nil (cond ((null (equal n 0)) (rplacd (nthcdr (sub1 n) x) (nconc r (cond (d (nthcdr n x)) (t (nthcdr (add1 n) x )))))) (d (attach (car r) x) (rplacd x (nconc (cdr r) (cdr x)))) (r (rplaca x (car r)) (rplacd x (nconc (cdr r) (cdr x)))) (t (print (list 'aha x)) (rplaca x (cadr x)) (rplacd x (cddr x)))) (return x)))) (def edit4e (lambda (x y) (cond ((equal x y) t) ((atom x) (eq x '&)) ((atom y) nil) ((edit4e (car x) (car y)) (or (eq (cadr x) '-) (edit4e (cdr x) (cdr y))))))) (def editqf (lambda (s) (prog (q1) (return (cond ((setq q1 (member s (cdar l))) (setq l (cons q1 l))) (t (edit4f s 'n) (cond ((not (atom s)) (setq l (cons (caar l) l)))))))))) (def edit4f (lambda (s n) (prog (ff ll x) (setq ll (cond ((eq n 'n) (cons (caar l) l)) (t l))) (setq x (car ll)) (setq ff (cons nil nil)) (cond ((and n (not (numberp n))) (setq n 1))) lp (cond ((edit4f1 s x maxlevel) (setq l (nconc (car ff) ll)) (return (car l))) ((null n) (err nil))) lp1 (setq x (car ll)) (cond ((null (setq ll (cdr ll))) (err nil)) ((and (setq x (member x (car ll))) (null (atom (setq x (cdr x))))) (go lp))) (go lp1)))) (def edit4f1 (lambda (s a lvl) (prog nil (cond ((null (greaterp lvl 0)) (return nil))) lp (cond ((atom a) (return nil)) ((and (edit4e s (car a)) (or (null n) (equal 0 (setq n (sub1 n))))) (return (tconc a ff))) ((and s (equal s (cdr a)) (or (null n) (equal 0 (setq n (sub1 n))))) (return (tconc a ff))) ((and n (edit4f1 s (car a) (sub1 lvl)) (equal 0 n)) (return (tconc (car a) ff)))) (setq a (cdr a)) (go lp)))) (def editnth (lambda (x n) (cond ((null (setq n (cond ((or (null (lessp n 0)) (greaterp (setq n (plus (length x) n 1)) 0)) (nthcdr (sub1 n) x))))) (err nil)) (t n)))) (def bpnt (lambda (x) (prog (y n) (cond ((equal 0 (car x)) (setq y (car l))) (t (setq y (car (editnth (car l) (car x)))))) (cond ((null (cdr x)) (setq n 3)) ((null (numberp (cadr x))) (go b1)) ((lessp (cadr x) 0) (setq n (plus (cadr x) 2))) (t (setq n (cadr x)))) (return (bpnt0 y 1 n)) b1 (err nil)))) (def bpnt0 (lambda (l n d) (prog (oldl) (setq oldl (printlevel (difference d n))) (cond ((atom (errset (eprint l) t)) (terpri) (terpri))) (printlevel oldl) (return nil)))) (def ro (lambda (n x) (prog (a) (setq a (editnth x n)) (cond ((or (null a) (atom (car a))) (err nil))) (rplacd (last (car a)) (cdr a)) (rplacd a nil)))) (def ri (lambda (m n x) (prog (a b) (setq a (editnth x m)) (setq b (editnth (car a) n)) (cond ((or (null a) (null b)) (err nil))) (rplacd a (nconc (cdr b) (cdr a))) (rplacd b nil)))) (def li (lambda (n x) (prog (a) (setq a (editnth x n)) (cond ((null a) (err nil))) (rplaca a (cons (car a) (cdr a))) (rplacd a nil)))) (def lo (lambda (n x) (prog (a) (setq a (editnth x n)) (cond ((or (null a) (atom (car a))) (err nil))) (rplacd a (cdar a)) (rplaca a (caar a))))) (def bi (lambda (m n x) (prog (a b) (setq b (cdr (setq a (editnth x n)))) (setq x (editnth x m)) (cond ((and a (null (greaterp (length a) (length x)))) (rplacd a nil) (rplaca x (cons (car x) (cdr x))) (rplacd x b)) (t (err nil)))))) (def bo (lambda (n x) (prog nil (setq x (editnth x n)) (cond ((atom (car x)) (err nil))) (rplacd x (nconc (cdar x) (cdr x))) (return (rplaca x (caar x)))))) (def subpair (lambda (x y z fl) (cond (fl (subpr x y (copy z))) ((subpr x y z))))) (def subpr (lambda (x y z) (prog (c d) (setq c x) (setq d y) loop (cond ((or (null c) (null d)) (return z)) (t (dsubst (car d) (car c) z) (setq c (cdr c)) (setq d (cdr d)) (go loop)))))) (def ldiff (lambda (x y) (prog (a b) (setq a x) (setq b nil) loop (cond ((equal a y) (return (reverse b))) ((null a) (return (err nil))) (t (setq b (cons (car a) b)) (setq a (cdr a)) (go loop)))))) (def editv (nlambda (editvx) (prog nil (set (car editvx) (car (edite (eval (car editvx)) (cdr editvx) nil))) (return (car editvx))))) (def nthcdr (lambda (n x) (cond ((equal n 0) x) ((lessp n 0) (cons nil x)) (t (nthcdr (sub1 n)(cdr x)))))) (def attach (lambda (x y) (prog (a) (setq a (cons (car y) (cdr y))) (rplaca y x) (rplacd y a) (return y)))) (def eprint (lambda (x) (print (eprint1 x printlevel)))) (def edite (lambda (x ops l) (prog (c m em edok copied pf pl) (cond ((null l) (setq l (list x)))) (setq em editmacros) (setq pf printflag) (setq pl 3) (cond (ops (cond ((dtpr (errset (mapc (function (lambda (x) (editcom (setq c x)))) ops) t)) (return (car (last l)))) (t (go b))))) (print 'edit) (cond (pf (terpri) (editcom 'p))) (setq pf printflag) ct (setq findflag nil) a (cond (edok (return (cdr edok)))) (terpri) (patom '*) (drain) (cond ((atom (errset (setq c (read)) t)) (go ct))) (cond ((dtpr (errset (editcom c) t)) (cond (pf (editcom 'p))) (setq pf printflag) (go a))) b (terpri) (print c) (patom '?) (terpri) (go ct)))) (def editdefault (lambda (x) (editcom (list 'f x 't)))) (def editcom (lambda (c) (prog (cc c2 c3 cl) a (cond (findflag (setq findflag nil) (editqf c)) ((numberp c) (setq l (edit1f c l))) ((atom c) (cond ((eq c 'ok) (setq ersetflg t) (setq edok (cons t (last l))) (return (setq pf nil))) ((eq c 'e) (setq ersetflg t) (print (eval (read))) (terpri)) ((eq c 'p) (setq pf nil) (bpnt0 (car l) 1 pl)) ((eq c 'pp) (setq pf nil) (terpri) (errset ($prpr (car l)) t) (terpri)) ((eq c 'mark) (setq m (cons l m))) ((eq c '^) (setq l (list (last l)))) ((eq c 'copy) (setq copied (copy l))) ((eq c 're((store) (setq l copied)) ((eq c '<) (cond (m (setq l (car m))) (t (err '"no marks")))) ((eq c '<<) (cond (m (setq l (car m)) (setq m (cdr m))) (t (err '"no marks")))) ((eq c 'poff) (setq pf nil) (setq printflag nil)) ((eq c 'pon) (setq pf t) (setq printflag t)) (t (cond ((and (setq cc (cond ((null (setq cc (assoc c em))) nil) ((cdr cc)))) (null (car cc))) (editcoms (copy cc))) (t (return (editdefault c))))))) ((numberp (setq cc (car c))) (edit2f c)) (t (setq c2 (cadr c)) (setq c3 (cond ((null (cddr c)) nil) ((car (cddr c))))) (setq cl (car l)) (cond ((eq cc 's) (set c2 (car (cond ((null (setq c c3)) l) ((equal c 0) l) (t (editnth cl c)))))) ((eq cc 'r) (dsubst c3 c2 cl)) ((eq cc 'e) (setq cc (eval c2)) (cond ((null (cddr c)) (print cc) (terpri))) (return cc)) ((eq cc 'i) (setq c (cons (cond ((atom c2) c2) (t (eval c2))) (mapcar (function eval) (cddr c)))) (go a)) ((eq cc 'n) (nconc cl (cdr c))) ((eq cc 'p) (bpnt (cdr c)) (setq pf nil)) ((eq cc 'f) (edit4f c2 c3)) ((eq cc 'nth) (setq l (cons (editnth cl c2) l))) ((member cc '(ri ro li lo bi bo)) (apply1 cc (append (cdr c) (list cl)))) ((member cc '(m d)) (setq cc (cond ((atom (setq cc c2)) (cons cc (cons nil (cddr c)))) (t (cons (car cc) (cddr c))))) (setq em (cons cc em)) (cond ((eq (car c) 'm) (setq editmacros (cons cc editmacros))))) ((eq cc 'pl) (cond ((lessp c2 1) (err nil)) (t (setq pl (add 1 c2))))) (t (cond ((or (null (setq cc (cond ((null (setq cc (assoc cc em))) nil) (t (cdr cc))))) (null (cond ((null cc) nil) (t (car cc))))) (return (editdefault c))) ((atom (car cc)) (editcoms (subst (cond ((null c) nil) ((cdr c))) (car cc) (cdr cc)))) (t (editcoms (subpair (car cc) (cdr c) (cdr cc) t)))))))) (return (car l))))) (def eprint1 (lambda (x lev) (cond ((atom x) x) ((equal 0 lev) '&) ((and (atom (cdr x)) (cdr x)) x) (t (mapcar (function (lambda (y) (eprint1 y (sub1 lev)))) x))))) (def assoc (lambda (e l) (cond ((null l) nil) ((equal e (caar l)) (car l)) (t (assoc e (cdr l)))))) (def apply1 (lambda (f l) (eval (cons f (mapcar '(lambda (z) (list 'quote z)) l))))) (def editp (nlambda (x) (prog (a b) (setq a (car x)) (edite (caar x)) (return a)))) (def makefile (nlambda (x) (prog (poport n f ff l df) (setq l (cons nil (cadr x))) (setq ff (eval (car x))) (setq poport (outfile (setq n (concatp 'mkfl)))) l1 (cond ((null (setq l (cdr l))) (go e1))) (setq f (car l)) (cond ((null f) (go l1)) ((null (setq df (getd f))) (go l1)) (t (setq df (list 'def f df)) ($prpr df) (terpri) (go l1))) e1 (close poport) (null (eval (cons 'exec (cons '/bin/mv (cons n (cons ff nil))))))))) (def appfile (nlambda (x) (prog (i poport n f ff l df) (setq l (cons nil (cadr x))) (setq ff (eval (car x))) (setq i (infile ff)) (setq poport (outfile (setq n (concatp 'apfl)))) l1 (cond ((eq (setq f (read i poport)) 'eof) (go l2)) (t ($prpr f) (terpri))) (go l1) l2 (cond ((null (setq l (cdr l))) (go e1))) (setq f (car l)) (cond ((null f) (go l2)) ((null (setq df (getd f))) (go l2)) (t (setq df (list 'def f df)) ($prpr df) (terpri) (go l2))) e1 (close poport) (null (eval (cons 'exec (cons '/bin/mv (cons n (cons ff nil))))))))) (def exec (nlambda ($list) (prog ($handy) (setq $handy '"") loop (cond ((null $list) (return (eval (list 'process $handy)))) (t (setq $handy (concat (concat $handy (car $list)) '" ")) (setq $list (cdr $list)) (go loop)))))) (setq editmacros nil) ((null (setq df (getd f))) (go l2)) (t (setq df (list 'def f df)) ($prpr df) (terpri) (go l2))) e1 (close poport) (null (eval (cons 'exec (cons '/bin/mv (cons n (cons ff nilcmd/lisp/lib/fix.l 444 0 12 54472 2552720232 7304 (setq SCCS-fix "@(#)fix.l 1.2 7/9/81") ; vi: set lisp : (eval-when (compile eval) (or (get 'cmumacs 'version) (load 'cmumacs))) ; LWE 1/11/81 Hack hack.... ; ; LWE 1/11/81 Bet you didn't know this, but this won't work INTERPRETED, ; but Dave assures me it works compiled. (In MACLisp...) ; (declare (special cmd frame x cnt var init label part incr limit selectq)) (dv fixfns ((*** This is FIXIT written by David Touretzky and adapted to Franz by Don Cohen) (declare (special framelist rframelist interrupt-handlers handler-labels) (special prinlevel prinlength evalhook-switch traced-stuff) (special lastword piport hush-debug) (*fexpr editf step type)) (sstatus feature fixit) (*rset t) ER%tpl fixit debug debug-iter debug1 debug-bktrace debug-print debug-print1 debug-findcall debug-scanflist debug-scanstk debug-getframes debug-nextframe debug-upframe debug-dnframe debug-upfn debug-dnfn debug-showvar debug-nedit debug-insidep debug-findusrfn debug-findexpr debug-pop debug-where debug-sysp interrupt-handlers handler-labels (or (boundp 'traced-stuff) (setq traced-stuff nil)) (or (boundp 'evalhook-switch) (setq evalhook-switch nil)) (setq hush-debug nil))) (or (boundp 'traced-stuff) (setq traced-stuff nil)) (or (boundp 'evalhook-switch) (setq evalhook-switch nil)) (or (boundp 'debug-sysmode) (setq debug-sysmode nil)) (setq hush-debug nil) ; macro which should go somewhere else (*** This is FIXIT written by David Touretzky and adapted to Franz by Don Cohen) (declare (special framelist rframelist interrupt-handlers handler-labels) (special prinlevel prinlength evalhook-switch traced-stuff) (special lastword piport hush-debug debug-sysmode) (*fexpr editf step type)) (sstatus feature fixit) (*rset t) ; (jkf) it is not clear that you want this to take over on all errors, ; but the cmu people seem to want that. #+cmu (progn 'compile (dv ER%tpl fixit) (dv ER%all fixit) ; LWE 1/17/81 MAYBE THIS WILL FIX THIS code ) (def fixit (nlambda (l) (prog (piport) (do nil (nil) (eval (cons 'debug l)))))) (def debug (nlambda (params) (prog (cmd frame framelist rframelist nframe val infile) (setq infile t) (and evalhook-switch (step nil)) (setq rframelist (reverse (setq framelist (or (debug-getframes) (list (debug-scanstk '(nil) '(debug))))))) (setq frame (debug-findexpr (car framelist))) ;(tab 0) (cond ((and (car params) (not (eq (car params) 'edit))) (terpri) (princ '|;debug |) (princ params) (terpri) (go loop))) (debug-print1 frame nil) (terpri) (cond (hush-debug (setq hush-debug nil) (go loop)) ((not (memq 'edit params)) (go loop))) (drain nil) (princ '|type e to edit, to debug: |) (setq val (tyi)) (cond ((or (= val 69) (= val 101)) (and (errset (debug-nedit frame)) (setq cmd '(ok)) (go cmdr))) ((or (= val 78) (= val 110)) (terpri) (debug-pop))) loop (terpri) (princ ':) (cond ((null (setq cmd (lineread))) (reset))) cmdr (cond ((dtpr (car cmd)) (setq val (eval (car cmd) (cadddr frame))) (print val) (terpri) (go loop))) (setq nframe (debug1 cmd frame)) (and (not (atom nframe)) (setq frame nframe) (go loop)) (print (or nframe (car cmd))) (princ '" Huh? - type h for help") (go loop)))) (def debug-iter (macro (x) (cons 'prog (cons 'nil (cons 'loop (cons (list 'setq 'nframe (cadr x)) '((setq cnt (|1-| cnt)) (and (or (null nframe) (zerop cnt)) (return nframe)) (setq frame nframe) (go loop)))))))) (def debug1 (lambda (cmd frame) (prog (nframe val topframe cnt item) (setq topframe (car framelist)) (or (eq (typep (car cmd)) 'symbol) (return nil)) (and (eq (getchar (car cmd) 1) 'b) (eq (getchar (car cmd) 2) 'k) (return (debug-bktrace cmd frame))) (setq cnt (cond ((fixp (cadr cmd)) (cadr cmd)) ((fixp (caddr cmd)) (caddr cmd)) (t 1))) (and (< cnt 1) (setq cnt 1)) (setq item (cond ((symbolp (cadr cmd)) (cadr cmd)) ((symbolp (caddr cmd)) (caddr cmd)))) (and item (cond ((memq (car cmd) '(u up)) (( (setq cmd (cons 'ups (cdr cmd)))) ((memq (car cmd) '(d dn)) (setq cmd (cons 'dns (cdr cmd)))))) (selectq (car cmd) (top (debug-print1 (setq frame topframe) nil)) (bot (debug-print1 (setq frame (car rframelist)) nil)) (p (debug-print1 frame nil)) (pp ($prpr (caddr frame))) (where (debug-where frame)) (help (cond ((cdr cmd) (eval cmd)) (t (ty |/usr/lisp/doc/fixit.ref|)))) ((? h) (ty |/usr/lisp/doc/fixit.ref|)) ((go ok) (setq frame (debug-findexpr topframe)) (cond ((eq (caaddr frame) 'debug) (freturn (cadr frame) t)) (t (fretry (cadr frame) frame)))) (pop (debug-pop)) (step (setq frame (debug-findexpr frame)) (step t) (fretry (cadr (debug-dnframe frame)) frame)) (redo (and item (setq frame (debug-findcall item frame framelist))) (and frame (fretry (cadr frame) frame))) (return (setq val (eval (cadr cmd))) (freturn (cadr frame) val)) (edit (debug-nedit frame)) (editf (cond ((null item) (setq frame (or (debug-findusrfn (debug-nedit frame)) (car rframelist)))) ((dtpr (getd item)) (errset (funcall 'editf (list item)))) (t (setq frame nil)))) (u (debug-iter (debug-upframe frame)) (cond ((null nframe) (terpri) (princ '||))) (debug-print1 (setq frame (or nframe frame)) nil)) (d (setq nframe (or (debug-iter (debug-dnframe frame)) frame)) (debug-print1 nframe nil) (cond ((eq frame nframe) (terpri) (princ '||)) (t (setq frame nframe)))) (up (setq nframe (debug-iter (debug-upfn frame))) (cond ((null nframe) (terpri) (princ '|top of stack|))) (setq frame (or nframe topframe)) (debug-print1 frame nil)) (dn (setq frame (or (debug-iter (debug-dnfn frame)) (car rframelist))) (debug-print1 frame nil) (cond ((not (eq frame nframe)) (terpri) (princ '||)))) (ups (setq frame (debug-iter (debug-findcall item frame rframelist))) (and frame (debug-print1 frame nil))) (dns (setq frame (debug-iter (debug-findcall item frame framelist))) (and frame (debug-print1 frame nil))) (sys (setq debug-sysmode (not debug-sysmode)) (patom "sysmode now ")(patom debug-sysmode) (terpr)) (cond ((not (dtpr (car cmd))) (*** should there also be a boundp test here) (debug-showvar (car cmd) frame)) (t (setq frame (car cmd))))) (return (or frame item))))) (def debug-bktrace (lambda (cmd oframe) (prog (sel cnt item frame nframe) (mapc '(lambda (x) (setq sel (cons (selectq x (f 'fns) (a 'sysp) (v 'bind) (e 'expr) (c 'current) 'bogus) sel))) (cddr (explodec (car cmd)))) (setq item (cond ((eq (typep (cadr cmd)) 'symbol) (cadr cmd)) ((eq (typep (caddr cmd)) 'symbol) (caddr cmd)))) (cond ((debug-sysp item) (setq sel (cons 'sysp sel))) ((not (memq 'sysp sel)) (setq sel (cons 'user sel)))) (setq cnt (cond ((fixp (cadr cmd)) (cadr cmd)) ((fixp (caddr cmd)) (caddr cmd)) (item 1))) (cond ((null cnt) (setq frame (cond ((memq 'current sel) oframe) (t (car rframelist)))) (go dbpr)) ((null item) (setq frame (car framelist)) (and (or (not (memq 'user sel)) (atom (caddr (car framelist))) (not (debug-sysp (caaddr (car framelist))))) (setq cnt (|1-| cnt))) (setq frame (cond ((zerop cnt) frame) ((memq 'user sel) (debug-iter (debug-dnfn frame))) (t (debug-iter (debug-dnframe frame))))) (setq frame (or frame (car rframelist))) (go dbpr)) (t (setq frame (car framelist)))) (setq frame (cond ((and (= cnt 1) (not (atom (caddr (car framelist)))) (eq item (caaddr (car framelist)))) (car framelist)) ((debug-iter (debug-findcall item frame framelist))) (t (car rframelist)))) dbpr (debug-print frame sel oframe) (cond ((eq frame (car rframelist)) (terpri) (princ '||) (terpri)) (t (terpri))) (cond ((memq 'bogus sel) (terpri) (princ (car cmd)) (princ '| contains an invalid bk modifier|))) (return oframe)))) (def debug-print (lambda (frame sel ptr) (prog (curframe) (setq curframe (car framelist)) loop (cond ((not (and (memq 'user sel) (not (atom (caddr curframe))) (debug-sysp (caaddr curframe)))) (debug-print1 curframe sel) (and (eq curframe ptr) (princ '| <--- you are here|))) ((eq curframe ptr) (terpri) (princ '| <--- you are somewhere in here|))) (and (eq curframe frame) (return frame)) (setq curframe (debug-dnframe curframe)) (or curframe (return frame)) (go loop)))) (def debug-print1 (lambda (frame sel) (prog (prinlevel prinlength varlist) (and (not (memq 'expr sel)) (setq prinlevel 2) (setq prinlength 5)) (cond ((atom (caddr frame)) (terpri) (princ '| |) (print (caddr frame)) (princ '| <- eval error|) (return t))) (and (memq 'bind sel) (cond ((memq (caaddr frame) '(prog lambda)) (setq varlist (cadr (caddr frame)))) ((and (atom (caaddr frame)) (dtpr (getd (caaddr frame)))) (setq varlist (cadr (getd (caaddr frame)))))) (mapc (function (lambda (v) (debug-showvar v (or (debug-upframe frame) frame)))) (cond ((and varlist (atom varlist)) (ncons varlist)) (t varlist)))) (and (memq 'user sel) (debug-sysp (caaddr frame)) (return nil)) (cond ((memq (caaddr frame) interrupt-handlers) (terpri) (princ '<------------) (print (cadr (assq (caaddr frame) handler-labels))) (princ '-->)) ((eq (caaddr frame) 'debug) (terpri) (princ '<------debug------>)) ((memq 'fns sel) (terpri) (and (debug-sysp (caaddr frame)) (princ '| |)) (print (caaddr frame))) (t (terpri) (print (cond ((eq (car frame) 'eval) (caddr frame)) (t (cons (caaddr frame) (cadr (caddr frame)))))))) (or (not (symbolp (caaddr frame))) (eq (caaddr frame) (concat (caaddr frame))) (princ '| |)) (return t)))) (def debug-findcall (lambda (fn frame flist) (prog nil loop (setq frame (debug-nextframe frame flist nil)) (or frame (return nil)) (cond ((atom (caddr frame)) (cond ((eq (caddr frame) fn) (return frame)) (t (go loop)))) ((eq (caaddr frame) fn) (return frame)) (t (go loop)))))) (def debug-scanflist (lambda (frame fnset) (prog nil loop (or frame (return nil)) (and (not (atom (caddr frame))) (memq (caaddr frame) fnset) (return frame)) (setq frame (debug-dnframe frame)) (go loop)))) (def debug-scanstk (lambda (frame fnset) (prog nil loop (or frame (return nil)) (and (not (atom (caddr frame))) (memq (caaddr frame) fnset) (return frame)) (setq frame (evalframe (cadr frame))) (( (go loop)))) (def debug-getframes (lambda nil (prog (flist fnew) (setq fnew (debug-scanstk '(nil) (cons 'debug interrupt-handlers))) loop (and (not debug-sysmode) (not (atom (caddr fnew))) (eq (caaddr fnew) 'debug) (eq (car (evalframe (cadr fnew))) 'apply) (memq (caaddr (evalframe (cadr fnew))) interrupt-handlers) (setq fnew (evalframe (cadr fnew)))) (and (not debug-sysmode) (null flist) (eq (car fnew) 'apply) (memq (caaddr fnew) interrupt-handlers) (setq fnew (evalframe (cadr fnew)))) (and (not debug-sysmode) (eq (car fnew) 'apply) (eq (typep (caaddr fnew)) 'symbol) (not (eq (caaddr fnew) (concat (caaddr fnew)))) (setq fnew (evalframe (cadr fnew))) (setq fnew (evalframe (cadr fnew))) (setq fnew (evalframe (cadr fnew))) (setq fnew (evalframe (cadr fnew))) (go loop)) (and (not debug-sysmode) (not (atom (caddr fnew))) (memq (caaddr fnew) '(evalhook* evalhook)) (setq fnew (evalframe (cadr fnew))) (go loop)) (and (not debug-sysmode) (eq (car fnew) 'apply) (eq (caaddr fnew) 'eval) (cadadr (caddr fnew)) (or (not (fixp (cadadr (caddr fnew)))) (= (cadadr (caddr fnew)) -1)) (setq fnew (evalframe (cadr fnew))) (go loop)) (and fnew (setq flist (cons fnew flist)) (setq fnew (evalframe (cadr fnew))) (go loop)) (return (nreverse flist))))) (def debug-nextframe (lambda (frame flist sel) (prog nil (setq flist (cdr (memq frame flist))) (and (not (memq 'user sel)) (return (car flist))) loop (or flist (return nil)) (cond ((or (atom (caddr (car flist))) (not (debug-sysp (caaddr (car flist))))) (return (car flist)))) (setq flist (cdr flist)) (go loop)))) (def debug-upframe (lambda (frame) (debug-nextframe frame rframelist nil))) (def debug-dnframe (lambda (frame) (debug-nextframe frame framelist nil))) (def debug-upfn (lambda (frame) (debug-nextframe frame rframelist '(user)))) (def debug-dnfn (lambda (frame) (debug-nextframe frame framelist '(user)))) (def debug-showvar (lambda (var frame) (terpri) (princ '| |) (princ var) (princ '| = |) (print ((lambda (val) (cond ((atom val) '?) (t (car val)))) (errset (eval var (cadddr frame)) nil))))) (def debug-nedit (lambda (frame) (prog (val body elem nframe) (setq elem (caddr frame)) (setq val frame) scan (setq val (debug-findusrfn val)) (or val (go nofn)) (setq body (getd (caaddr val))) (cond ((debug-insidep elem body) (princ '=) (print (caaddr val)) (edite body (list 'f (cons '== elem) 'tty:) (caaddr val)) (return frame)) ((or (eq elem (caddr val)) (debug-insidep elem (caddr val))) (setq val (debug-dnframe val)) (go scan))) nofn (setq nframe (debug-dnframe frame)) (or nframe (go doit)) (and (debug-insidep elem (caddr nframe)) (setq frame nframe) (go nofn)) doit (edite (caddr frame) (and (debug-insidep elem (caddr frame)) (list 'f (cons '== elem) 'tty:)) nil) (return frame)))) (def debug-insidep (lambda (elem expr) (car (errset (edite expr (list 'f (cons '== elem)) nil))))) (def debug-findusrfn (lambda (frame) (cond ((null frame) nil) ((and (dtpr (caddr frame)) (symbolp (caaddr frame)) (dtpr (getd (caaddr frame)))) frame) (t (debug-findusrfn (debug-dnframe frame)))))) (def debug-findexpr (lambda (frame) (cond ((null frame) nil) ((and (eq (car frame) 'eval) (not (atom (caddr frame)))) frame) (t (debug-findexpr (debug-dnframe frame)))))) (def debug-pop (lambda nil (prog (frame) (setq frame (car framelist)) l (cond ((null (setq frame (evalframe (cadr frame))))(reset))) (cond ((and (dtpr (caddr frame))(eq (caaddr frame) 'debug)) (freturn (cadr frame) nil))) (go l)))) (def debug-where (lambda (frame) (prog (lev diff nframe) (setq lev (- (length framelist) (length (memq frame rframelist)))) (setq diff (- (length framelist) lev 1)) (debug-print1 frame nil) (terpri) (cond ((zerop diff) (princ '|you are at top of stack.|)) ((zerop lev) (princ '|you are at bottom of stack.|)) (t (princ '|you are |) (princ diff) (cond ((= diff 1) (princ '| frame from the top.|)) (t (princ '| frames from the top.|))))) (terpri) (and (or (atom (caddr frame)) (not (eq (car frame) 'eval))) (return nil)) (setq lev 0) (setq nframe frame) lp (and (setq nframe (debug-findcall (caaddr nframe) nframe framelist)) (setq lev (|1+| lev)) (go lp)) (princ '|there are |) (princ lev) (princ '| |) (princ (caaddr frame)) (princ '|'s below.|) (terpri)))) (def debug-sysp (lambda (x) (and (sysp x) (symbolp x) (not (dtpr (getd x)))))) (dv interrupt-handlers (fixit)) (dv handler-labels ((fixit error) (debug-ubv-handler ubv) (debug-udf-handler udf) (debug-fac-handler fac) (debug-ugt-handler ugt) (debug-wta-handler wta) (debug-wna-handler wna) (debug-iol-handler iol) (debug-*rset-handler rst) (debug-mer-handler mer) (debug-gcd-handler gcd) (debug-gcl-handler gcl) (debug-gco-handler gco) (debug-pdl-handler pdl))) (or (boundp 'traced-stuff) (setq traced-stuff nil)) (or (boundp 'evalhook-switch) (setq evalhook-switch nil)) (setq hush-debug nil) ;; other functions grabbed from other cmu files to make this file complete ;; unto itself ;- from sysfunc.l (defun build-sysp nil (do ((temp (oblist) (cdr temp)) (sysfuncs)) ((null temp)(setq system-functions\ sysfuncs));atom has ^G at end (cond ((getd (car temp)) (setq sysfuncs (cons (car temp) sysfuncs)))))) (defun sysp (x) ; (cond ((memq x system-functions\)t)) nil) ; lets assume nothing is a system function. (or (boundp 'system-functions\) (build-sysp)) (defun fretry (pdlpnt frame) (freturn pdlpnt (cond ((eq (car frame) 'eval) (eval (caddr frame) (cadddr frame))) ((eq (car frame) 'apply) (eval `(apply ',(caaddr frame) ',(cadaddr frame)) (cadddr frame)))))) ; - from cmu.l (def %lineread (lambda (chan) (prog (ans) loop (setq ans (cons (read chan 'EOF) ans)) (cond ((eq (car ans) 'EOF) (return (reverse (cdr ans))))) loop2(cond ((eq 10 (tyipeek chan)) (return (reverse ans))) ((memq (tyipeek chan) '(41 93)) (tyi chan) (go loop2)) (t (go loop)))))) d ((eq (car frame) 'eval) (eval (caddr frame) (cadddr frame))) ((eq (car frame) 'apply) (eval `(apply ',(caaddr frame) ',(cadaddr frame)) (cadddr frame)))))) ; - from cmu.l (def %linercmd/lisp/lib/jkfmacs.l 444 0 12 5573 2552720232 10112 (setq SCCS-jkfmacs "@(#)jkfmacs.l 1.3 7/9/81") ;------ jkfmacs :: common and useful macros ; (declare (macros t)) ; contents: ; If macro ; ;--- super if macro ; This macro allow the following forms: ; (If a then b) ==> (cond (a b)) ; (If a thenret) ==> (cond (a)) ; (If a then b else c) ==> (cond (a b) (t c)) ; (If a then b b2 ==> (cond (a b b2) (c d d2) (t e)) ; elseif c then d d2 ; else e) ; ; (defun If macro (lis) (prog (majlis minlis revl) (do ((revl (reverse lis) (cdr revl))) ((null revl)) (cond ((eq (car revl) 'else) (setq majlis `((t ,@minlis) ,@majlis) minlis nil)) ((or (eq (car revl) 'then) (eq (car revl) 'thenret)) (setq revl (cdr revl) majlis `((,(car revl) ,@minlis) ,@majlis) minlis nil)) ((eq (car revl) 'elseif)) ((eq (car revl) 'If) (setq majlis `(cond ,@majlis))) (t (setq minlis `( ,(car revl) ,@minlis))))) ; we displace the previous macro, that is we actually replace ; the if list structure with the corresponding cond, meaning ; that the expansion is done only once (rplaca lis (car majlis)) (rplacd lis (cdr majlis)) (return majlis))) ;--- msg : print a message consisting of strings and values ; arguments are: ; N - print a newline ; (N foo) - print foo newlines (foo is evaluated) ; B - print a blank ; (B foo) - print foo blanks (foo is evaluated) ; (P foo) - print following args to port foo (foo is evaluated) ; D - drain ; other - evaluate a princ the result (remember strings eval to themselves) (defmacro msg (&rest msglist) (do ((ll msglist (cdr ll)) (result) (cur nil nil) (curport nil) (current)) ((null ll) `(progn ,@(nreverse result))) (setq current (car ll)) (If (dtpr current) then (If (eq (car current) 'N) then (setq cur `(msg-tyo-char 10 ,(cadr current))) elseif (eq (car current) 'B) then (setq cur `(msg-tyo-char 32 ,(cadr current))) elseif (eq (car cu((rrent) 'P) then (setq curport (cadr current)) else (setq cur `(princ ,current))) elseif (eq current 'N) then (setq cur (list 'tyo 10)) ; (can't use backquote elseif (eq current 'B) ; since must have new then (setq cur (list 'tyo 32)) ; dtpr cell at end) elseif (eq current 'D) then (setq cur '(drain)) else (setq cur `(princ ,current))) (If cur then (setq result (cons (If curport then (nconc cur (ncons curport)) else cur) result))))) (defun msg-tyo-char (ch n) (do ((i n (1- n))) ((< n 1)) (tyo ch))) ;--- standard push, unpush and pop macros ; (defmacro push (stack value) `(setq ,stack (cons ,value ,stack))) (defmacro unpush (stack) `(setq ,stack (cdr ,stack))) (defmacro pop (stack) `(prog1 (car stack) (setq ,stack (cdr ,stack)))) (putprop 'jkfmacs 1 'version) urrent))) (If cur then (setq result (cons (If curport then (nconc cur (ncons curport)) else cur) cmd/lisp/lib/loop.l 444 0 12 107647 2552720236 7516 (setq |SCCS-loop| "@(#)loop.l 1.2 7/9/81") ;-*- Mode:LISP; Package:System-Internals; Base:8; Lowercase:T -*- ;The master copy of this file is on ML:LSB1;LOOP > ;The current Lisp machine copy is on AI:LISPM2;LOOP > ;The FASL and QFASL should also be accessible from LIBLSP; on all machines. ; Bugs/complaints/suggestions/solicitations-for-documentation to BUG-LOOP ; at any ITS site. ;; the file was franzified by JKF. ; ;;;; LOOP Iteration Macro ; Hack up the stuff for data-types. DATA-TYPE? will always be a macro ; so that it will not require the data-type package at run time if ; all uses of the other routines are conditionalized upon that value. (defmacro data-type? (x) `(get ,x ':data-type)) (declare (*lexpr variable-declarations) (*expr initial-value form-wrapper)) ;Loop macro (eval-when (eval compile) (defun lexpr-funcall macro (x) `(apply ,(cadr x) (list* . ,(cddr x))))) (defun loop-displace (x y) ((lambda (val) (rplaca x (car val)) (rplacd x (cdr val)) x) (cond ((atom y) (list 'progn y)) (t y)))) (defmacro loop-finish () '(go end-loop)) (defun neq macro (x) `(not (eq . ,(cdr x)))) (defun loop-make-psetq (frobs) (loop-make-setq (car frobs) (cond ((null (cddr frobs)) (cadr frobs)) (t `(prog1 ,(cadr frobs) ,(loop-make-psetq (cddr frobs))))))) (defmacro loop-psetq (&rest frobs) (loop-make-psetq frobs)) (defvar loop-keyword-alist ;clause introducers '( (initially loop-do-initially) (finally loop-do-finally) (do loop-do-do) (doing loop-do-do) (return loop-do-return) (collect loop-do-collect list) (collecting loop-do-collect list) (append loop-do-collect append) (appending loop-do-collect append) (nconc loop-do-collect nconc) (nconcing loop-do-collect nconc) (count loop-do-collect count) (counting loop-do-collect count) (sum loop-do-collect sum) (summing loop-do-collect sum) (maximize loop-do-collect max) (minimize loop-do-collect min) (always loop-do-always t) (never loop-do-always nil) (thereis loop-do-thereis) (while loop-do-while or) (until loop-do-while and) (when loop-do-when nil) (unless loop-do-when t) (with loop-do-with) (for loop-do-for) (as loop-do-for))) (defvar loop-for-keyword-alist ;Types of FOR '( (= loop-for-equals) (in loop-for-in) (on loop-for-on) (from loop-for-arithmetic nil) (downfrom loop-for-arithmetic down) (upfrom loop-for-arithmetic up) (being loop-for-being))) (defvar loop-path-keyword-alist nil) ; PATH functions (defvar loop-variables) ;Variables local to the loop (defvar loop-declarations) ; Local dcls for above (defvar loop-variable-stack) (defvar loop-declaration-stack) (defvar loop-prologue) ;List of forms in reverse order (defvar loop-body) ;.. (defvar loop-after-body) ;.. for FOR steppers (defvar loop-epilogue) ;.. (defvar loop-after-epilogue) ;So COLLECT's RETURN comes after FINALLY (defvar loop-conditionals) ;If non-NIL, condition for next form in body ;The above is actually a list of entries of the form ;(condition forms...) ;When it is output, each successive condition will get ;nested inside the previous one, but it is not built up ;that way because you wouldn't be able to tell a WHEN-generated ;COND from a user-generated COND. (defvar loop-when-it-variable) ;See LOOP-DO-WHEN (defvar loop-collect-cruft) ; for multiple COLLECTs (etc) (defvar loop-source-code) (defvar loop-attachment-transformer ; see attachment definition (cond ((status feature lms) 'progn) (t nil))) (defun loop-lookup-keyword macro (x) `(assq . ,(cdr x))) (defun loop-add-keyword (cruft alist-name) (let ((val (symeval alist-name)) (known?)) (and (setq known? (loop-lookup-keyword (car cruft) val)) (set alist-name (delq known? val))) (set alist-name (cons cruft val)))) (defmacro define-loop-macro (keyword) (or (eq keyword 'loop) (loop-lookup-keyword keyword loop-keyword-alist) (error "lisp: Not a loop keyword -- " keyword)) `(eval-when (compile load eval) (putd ',keyword '(macro (macroarg) (loop-translate macroarg))))) (define-loop-macro loop) (defun loop-translate (x) (loop-displace x (loop-translate-1 x))) (defun loop-translate-1 (loop-source-code) (and (eq (car loop-source-code) 'loop) (setq loop-source-code (cdr loop-source-code))) (do ((loop-variables nil) (loop-declarations nil) (loop-variable-stack nil) (loop-declaration-stack nil) (loop-prologue nil) (loop-body nil) (loop-after-body nil) (loop-epilogue nil) (loop-after-epilogue nil) (loop-conditionals nil) (loop-when-it-variable nil) (loop-collect-cruft nil) (keyword) (tem)) ((null loop-source-code) (and loop-conditionals (error "lisp: hanging conditional in loop macro -- " (caar loop-conditionals))) (cond (loop-variables (push loop-variables loop-variable-stack) (push loop-declarations loop-declaration-stack))) (setq tem `(prog () ,@(nreverse loop-prologue) next-loop ,@(nreverse loop-body) ,@(nreverse loop-after-body) (go next-loop) end-loop ,@(nreverse loop-epilogue) ,@(nreverse loop-after-epilogue))) (do ((vars) (dcls)) ((null loop-variable-stack)) (setq vars (pop loop-variable-stack) dcls (pop loop-declaration-stack)) (and dcls (setq dcls `((declare . ,(nreverse dcls))))) (setq tem `(,@dcls ,tem)) (cond ((do ((l vars (cdr l))) ((null l) nil) (and (not (atom (car l))) (not (atom (caar l))) (return t))) (setq tem `(let ,(nreverse vars) ,.tem))) (t (let ((lambda-vars nil) (lambda-vals nil)) (do ((l vars (cdr l)) (v)) ((null l)) (cond ((atom (setq v (car l))) (push v lambda-vars) (push nil lambda-vals)) (t (push (car v) lambda-vars) (push (cadr v) lambda-vals)))) (setq tem `((lambda ,(nreverse lambda-vars) ,.tem) ,.(nreverse lambda-vals)))))) ) tem) (if (symbolp (setq keyword (pop loop-source-code))) (if (setq tem (loop-lookup-keyword keyword loop-keyword-alist)) (apply (cadr tem) (cddr tem)) (error "lisp: unknown keyword in loop macro -- " keyword)) (error "lisp: loop found object where keyword expected -- " keyword)))) (defun loop-bind-block () (cond ((not (null loop-variables)) (push loop-variables loop-variable-stack) (push loop-declarations loop-declaration-stack) (setq loop-variables nil loop-declarations nil)) (loop-declarations (break barf)))) ;Get FORM argument to a keyword. Read up to atom. PROGNify if necessary. (defun loop-get-form () (do ((forms (list (pop loop-source-code)) (cons (pop loop-source-code) forms)) (nextform (car loop-source-code) (car loop-source-code))) ((atom nextform) (if (null (cdr forms)) (car forms) (cons 'progn (nreverse forms)))))) (defun loop-make-setq (var-or-pattern value) (list (if (atom var-or-pattern) 'setq 'desetq) var-or-pattern value)) (defun loop-imply-type (expression type &aux (frob (and (data-type? type) (form-wrapper type expression)))) (cond ((not (null frob)) frob) (t expression))) (defun loop-make-variable (name initialization dtype) (cond ((null name) (and initialization (push (list nil initialization) loop-variables))) ((atom name) (cond ((data-type? dtype) (setq loop-declarations (append (variable-declarations dtype name) loop-declarations)) (or initialization (setq initialization (initial-value dtype)))) ((memq dtype '(fixnum flonum number)) (or initialization (setq initialization (if (eq dtype 'flonum) 0.0 0))))) (push (if initialization (list name initialization) name) loop-variables)) (initialization (push (list name initialization) loop-variables) (loop-declare-variable name dtype)) (t (let ((tcar) (tcdr)) (cond ((atom dtype) (setq tcar (setq tcdr dtype))) (t (setq tcar (car dtype) tcdr (cdr dtype)))) (loop-make-variable (car name) nil tcar) (loop-make-variable (cdr name) nil tcdr)))) name) (defun loop-declare-variable (name dtype) (cond ((or (null name) (null dtype)) nil) ((atom name) (cond ((data-type? dtype) (setq loop-declarations (append (variable-declarations dtype name) loop-declarations))) )) ((atom dtype) (loop-declare-variable (car name) dtype) (loop-declare-variable (cdr name) dtype)) (t (loop-declare-variable (car name) (car dtype)) (loop-declare-variable (cdr name) (cdr dtype))))) (defun(( loop-maybe-bind-form (form data-type?) (cond ((or (numberp form) (memq form '(t nil)) (and (not (atom form)) (eq (car form) 'quote))) form) (t (loop-make-variable (gensym) form data-type?)))) (defun loop-optional-type () (let ((token (car loop-source-code))) (and (not (null token)) (or (not (atom token)) (data-type? token) (memq token '(fixnum flonum number))) (pop loop-source-code)))) ;Compare two "tokens". The first is the frob out of LOOP-SOURCE-CODE, ;the second a string (lispm) or symbol (maclisp) to check against. (defmacro loop-tequal (x1 x2) `(eq ,x1 ,x2)) ;Incorporates conditional if necessary (defun loop-emit-body (form) (cond (loop-conditionals (rplacd (last (car (last loop-conditionals))) (cond ((and (not (atom form)) ;Make into list of forms (eq (car form) 'progn)) (append (cdr form) nil)) (t (list form)))) (cond ((loop-tequal (car loop-source-code) "and") (pop loop-source-code)) (t ;Nest up the conditionals and output them (do ((prev (car loop-conditionals) (car l)) (l (cdr loop-conditionals) (cdr l))) ((null l)) (rplacd (last prev) `((cond ,(car l))))) (push `(cond ,(car loop-conditionals)) loop-body) (setq loop-conditionals nil)))) (t (push form loop-body)))) (defun loop-do-initially () (push (loop-get-form) loop-prologue)) (defun loop-do-finally () (push (loop-get-form) loop-epilogue)) (defun loop-do-do () (loop-emit-body (loop-get-form))) (defun loop-do-return () (loop-emit-body `(return ,(loop-get-form)))) (defun loop-do-collect (type) (let ((var) (form) (tem) (tail) (dtype) (cruft) (rvar) (ctype (cond ((memq type '(max min)) 'maxmin) ((memq type '(nconc list append)) 'list) ((memq type '(count sum)) 'sum) (t (error "lisp: unrecognized loop collecting keyword -- " type))))) (setq form (loop-get-form) dtype (loop-optional-type)) (cond ((loop-tequal (car loop-source-code) 'into) (pop loop-source-code) (setq rvar (setq var (pop loop-source-code))))) ; CRUFT will be (varname ctype dtype var tail (optional tem)) (cond ((setq cruft (assq var loop-collect-cruft)) (cond ((not (eq ctype (car (setq cruft (cdr cruft))))) (error "lisp: incompatible loop collections -- " (list ctype (car cruft)))) ((and dtype (not (eq dtype (cadr cruft)))) (error "lisp: loop found unequal types in collector -- " (list type (list dtype (cadr cruft)))))) (setq dtype (car (setq cruft (cdr cruft))) var (car (setq cruft (cdr cruft))) tail (car (setq cruft (cdr cruft))) tem (cadr cruft)) (and (eq ctype 'maxmin) (not (atom form)) (null tem) (rplaca (cdr cruft) (setq tem (loop-make-variable (gensym) nil dtype))))) (t (and (null dtype) (setq dtype (cond ((eq type 'count) 'fixnum) ((memq type '(min max sum)) 'number)))) (or var (push `(return ,(setq var (gensym))) loop-after-epilogue)) (loop-make-variable var nil dtype) (setq tail (cond ((eq ctype 'list) (setq tem (loop-make-variable (gensym) nil nil)) (loop-make-variable (gensym) nil nil)) ((eq ctype 'maxmin) (or (atom form) (setq tem (loop-make-variable (gensym) nil dtype))) (loop-make-variable (gensym) nil nil)))) (push (list rvar ctype dtype var tail tem) loop-collect-cruft))) (loop-emit-body (selectq type (count (setq tem `(setq ,var (1+ ,var))) (cond ((eq form t) tem) (t `(and ,form ,tem)))) (sum `(setq ,var (plus ,(loop-imply-type form dtype) ,var))) ((max min) `(setq ,@(and tem (prog1 `(,tem ,form) (setq form tem))) ,var (cond (,tail (,type ,(loop-imply-type form dtype) ,var)) (t (setq ,tail t) ,form)))) (list `(setq ,tem (ncons ,form) ,tail (cond (,tail (cdr (rplacd ,tail ,tem))) ((setq ,var ,tem)))) ) (nconc `(setq ,tem ,form ,tail (last (cond (,tail (rplacd ,tail ,tem)) ((setq ,var ,tem)))))) (append `(setq ,tem (append ,form nil) ,tail (last (cond (,tail (rplacd ,tail ,tem)) ((setq ,var ,tem)))))))))) (defun loop-do-while (cond) (loop-emit-body `(,cond ,(loop-get-form) (go end-loop)))) (defun loop-do-when (negate?) (let ((form (loop-get-form)) (cond)) (cond ((loop-tequal (cadr loop-source-code) 'it) ;WHEN foo RETURN IT and the like (or loop-when-it-variable (setq loop-when-it-variable (loop-make-variable (gensym) nil nil))) (setq cond `(setq ,loop-when-it-variable ,form)) (setq loop-source-code ;Plug in variable for IT (list* (car loop-source-code) loop-when-it-variable (cddr loop-source-code)))) (t (setq cond form))) (and negate? (setq cond `(not ,cond))) (setq loop-conditionals (nconc loop-conditionals (ncons (list cond)))))) (defun loop-do-with () (do ((var) (equals) (val) (dtype)) (nil) (setq var (pop loop-source-code) equals (car loop-source-code)) (cond ((loop-tequal equals '=) (pop loop-source-code) (setq val (pop loop-source-code) dtype nil)) ((or (loop-tequal equals 'and) (loop-lookup-keyword equals loop-keyword-alist)) (setq val nil dtype nil)) (t (setq dtype (pop loop-source-code) equals (car loop-source-code)) (cond ((loop-tequal equals '=) (pop loop-source-code) (setq val (pop loop-source-code))) ((and (not (null loop-source-code)) (not (loop-lookup-keyword equals loop-keyword-alist)) (not (loop-tequal equals 'and))) (error "lisp: loop was expecting = but found " equals)) (t (setq val nil))))) (loop-make-variable var val dtype) (cond ((not (loop-tequal (car loop-source-code) 'and)) (return nil)) ((pop loop-source-code)))) (loop-bind-block)) (defun loop-do-always (true) (let ((form (loop-get-form))) (or true (setq form `(not ,form))) (loop-emit-body `(or ,form (return nil))) (push '(return t) loop-after-epilogue))) ;THEREIS expression ;If expression evaluates non-nil, return that value. (defun loop-do-thereis () (let ((var (loop-make-variable (gensym) nil nil)) (expr (loop-get-form))) (loop-emit-body `(and (setq ,var ,expr) (return ,var))))) ;FOR variable keyword ..args.. {AND more-clauses} ;For now AND only allowed with the = keyword (defun loop-do-for () (and loop-conditionals (error "lisp: loop for or as starting inside of conditional")) (do ((var) (data-type?) (keyword) (first-arg) (tem) (pretests) (posttests) (inits) (steps)) (nil) (setq var (pop loop-source-code) data-type? (loop-optional-type) keyword (pop loop-source-code) first-arg (pop loop-source-code)) (and (or (not (symbolp keyword)) (null (setq tem (loop-lookup-keyword keyword loop-for-keyword-alist)))) (error "lisp: unknown keyword in for or as loop clause -- " keyword)) (setq tem (lexpr-funcall (cadr tem) var first-arg data-type? (cddr tem))) (and (car tem) (push (car tem) pretests)) (setq inits (nconc inits (append (car (setq tem (cdr tem))) nil))) (and (car (setq tem (cdr tem))) (push (car tem) posttests)) (setq steps (nconc steps (append (car (setq tem (cdr tem))) nil))) (cond ((not (loop-tequal (car loop-source-code) 'and)) (cond ((cdr (setq pretests (nreverse pretests))) (push 'or pretests)) (t (setq pretests (car pretests)))) (cond ((cdr (setq posttests (nreverse posttests))) (push 'or posttests)) (t (setq posttests (car posttests)))) (and pretests (push `(and ,pretests (go end-loop)) loop-body)) (and inits (push (loop-make-psetq inits) loop-body)) (and posttests (push `(and ,posttests (go end-loop)) loop-after-body)) (and steps (push (loop-make-psetq steps) loop-after-body)) (loop-bind-block) (return nil)) (t (pop loop-source-code))))) (defun loop-for-equals (var val data-type?) (cond ((loop-tequal (car loop-source-code) 'then) ;FOR var = first THEN next (pop loop-source-code) (loop-make-variable var val data-type?) (list nil nil nil `(,var ,(loop-get-form)))) (t (loop-make-variable var nil data-type?) (list nil `(,var ,val) nil nil)))) (defun loop-for-on (var val data-type?) (let ((step (if (loop-tequal (car loop-source-code) 'by) (progn (pop loop-source-code) (pop loop-source-code)) '(function cdr))) (var1 (cond ((not (atom var)) ; Destructuring? Then we can't use VAR as the ; iteration variable. (loop-make-variable var nil nil) (loop-make-variable (gensym) val nil)) (t (loop-make-variable var val nil) var)))) (setq step (cond ((or (atom step) (not (memq (car step) '(quote function)))) `(funcall ,(loop-make-variable (gensym) step nil) ,var1)) (t (list (cadr step) var1)))) (list `(null ,var1) (and (not (eq var var1)) `(,var ,var1)) nil `(,var1 ,step)))) (defun loop-for-in (var val data-type?) (let ((var1 (gensym)) ;VAR1 is list, VAR is element (step (if (loop-tequal (car loop-source-code) 'by) (progn (pop loop-source-code) (pop loop-source-code)) '(function cdr)))) (loop-make-variable var1 val nil) (loop-make-variable var nil data-type?) (setq step (cond ((or (atom step) (not (memq (car step) '(quote function)))) `(funcall (loop-make-variable (gensym) step nil) var1)) (t (list (cadr step) var1)))) (list `(null ,var1) `(,var (car ,var1)) nil `(,var1 ,step)))) (defun loop-for-arithmetic (var val data-type? forced-direction) (let ((limit) (step 1) (test) (direction) (eval-to-first t) (inclusive)) (do () (nil) (cond ((not (symbolp (car loop-source-code))) (return nil)) ((loop-tequal (car loop-source-code) 'by) (pop loop-source-code) (setq step (loop-get-form) eval-to-first t)) ((loop-tequal (car loop-source-code) 'to) (pop loop-source-code) (setq limit (loop-get-form) inclusive t eval-to-first nil)) ((loop-tequal (car loop-source-code) 'downto) (pop loop-source-code) (( (setq limit (loop-get-form) inclusive t eval-to-first nil direction 'down)) ((loop-tequal (car loop-source-code) 'below) (pop loop-source-code) (setq limit (loop-get-form) direction 'up eval-to-first nil)) ((loop-tequal (car loop-source-code) 'above) (pop loop-source-code) (setq limit (loop-get-form) direction 'down eval-to-first nil)) (t (return nil)))) (cond ((null direction) (setq direction (or forced-direction 'up))) ((and forced-direction (not (eq forced-direction direction))) (error "lisp: loop variable stepping lossage with " var))) (or data-type? (setq data-type? 'fixnum)) (and (eq data-type? 'flonum) (fixp step) (setq step (float step))) (loop-make-variable var val data-type?) (cond ((and limit eval-to-first) (setq limit (loop-maybe-bind-form limit data-type?)))) (setq step (loop-maybe-bind-form step data-type?)) (cond ((and limit (not eval-to-first)) (setq limit (loop-maybe-bind-form limit data-type?)))) (cond ((not (null limit)) (let ((z (list var limit))) (setq test (cond ((eq direction 'up) (cond (inclusive `(greaterp . ,z)) (t `(not (lessp . ,z))))) (t (cond (inclusive `(lessp . ,z)) (t `(not (greaterp . ,z)))))))))) (setq step (cond ((eq direction 'up) (cond ((equal step 1) `(add1 ,var)) (t `(plus ,var ,step)))) ((equal step 1) `(sub1 ,var)) (t `(difference ,var ,step)))) ;; The object of the following crock is to get the INTERPRETER to ;; do error checking. This is only correct for data-type of FIXNUM, ;; since floating-point arithmetic is contagious. #+Maclisp (and (eq data-type? 'fixnum) (rplaca step (cdr (assq (car step) '((sub1 . 1-) (add1 . 1+) (plus . +) (difference . -)))))) (list test nil nil `(,var ,step)))) (defun loop-for-being (var val data-type?) ; FOR var BEING something ... - var = VAR, something = VAL. ; If what passes syntactically for a pathname isn't, then ; we trap to the ATTACHMENTS path; the expression which looked like ; a path is given as an argument to the IN preposition. If ; LOOP-ATTACHMENT-TRANSFORMER is not NIL, then we call that on the ; "form" to get the actual form; otherwise, we quote it. Thus, ; by default, FOR var BEING EACH expr OF expr-2 ; ==> FOR var BEING ATTACHMENTS IN 'expr OF expr-2. (let ((tem) (inclusive?) (ipps) (each?) (attachment)) (cond ((loop-tequal val "each") (setq each? t val (car loop-source-code))) (t (push val loop-source-code))) (cond ((and (setq tem (loop-lookup-keyword val loop-path-keyword-alist)) (or each? (not (loop-tequal (cadr loop-source-code) 'and)))) ;; FOR var BEING {each} path {prep expr}..., but NOT ;; FOR var BEING var-which-looks-like-path AND {ITS} ... (pop loop-source-code)) (t (setq val (loop-get-form)) (cond ((loop-tequal (car loop-source-code) 'and) ;; FOR var BEING value AND ITS path-or-ar (or (null each?) (error "lisp: malformed being clause in loop of var " var)) (setq ipps `((of ,val)) inclusive? t) (pop loop-source-code) (or (loop-tequal (setq tem (pop loop-source-code)) 'its) (loop-tequal tem 'his) (loop-tequal tem 'her) (loop-tequal tem 'their) (loop-tequal tem 'each) (error "lisp: loop expected its or each but found " tem)) (cond ((setq tem (loop-lookup-keyword (car loop-source-code) loop-path-keyword-alist)) (pop loop-source-code)) (t (push (setq attachment `(in ,(loop-get-form))) ipps)))) ((not (setq tem (loop-lookup-keyword (car loop-source-code) loop-path-keyword-alist))) ; FOR var BEING {each} a-r ... (setq ipps (list (setq attachment (list 'in val))))) (t ; FOR var BEING {each} pathname ... ; Here, VAL should be just PATHNAME. (pop loop-source-code))))) (cond ((not (null tem))) ((not (setq tem (loop-lookup-keyword 'attachments loop-path-keyword-alist))) (error "lisp: loop trapped to attachments path illegally")) (t (or attachment (break barf)) (rplaca (cdr attachment) (cond (loop-attachment-transformer (funcall loop-attachment-transformer (cadr attachment))) (t (list 'quote (cadr attachment))))))) (setq tem (funcall (cadr tem) (car tem) var data-type? (nreconc ipps (loop-gather-preps (caddr tem))) inclusive? (caddr tem) (cdddr tem))) ;; TEM is now (bindings prologue-forms endtest setups steps) (mapc '(lambda (x) (let (var val dtype) (cond ((atom x) (setq var x)) (t (setq var (car x) val (cadr x) dtype (caddr x)))) (loop-make-variable var val dtype))) (car tem)) (setq loop-prologue (nconc (reverse (cadr tem)) loop-prologue)) (cddr tem))) (defun loop-gather-preps (preps-allowed) (do ((list nil (cons (list (pop loop-source-code) (loop-get-form)) list)) (token (car loop-source-code) (car loop-source-code))) ((not (memq token preps-allowed)) (nreverse list)))) (defun loop-add-path (name data) (loop-add-keyword (cons name data) 'loop-path-keyword-alist)) (defmacro define-loop-path (names &rest cruft &aux forms) (setq forms (mapcar '(lambda (name) `(loop-add-path ',name ',cruft)) (cond ((atom names) (list names)) (t names)))) `(eval-when (eval load compile) ,@forms)) (defun loop-path-carcdr (name var dtype pps inclusive? preps data) preps dtype ;Prevent unused arguments error (let ((vars) (step) (endtest `(,(cadr data) ,var)) (tem)) (or (setq tem (loop-lookup-keyword 'of pps)) (error "lisp: loop path has no initialization -- " name)) (setq vars `((,var ,(cond (inclusive? (cadr tem)) (t `(,(car data) ,(cadr tem)))) ,dtype))) (setq step `(,var (,(car data) ,var))) (list vars nil nil nil endtest step))) (defun loop-interned-symbols-path (path variable data-type prep-phrases inclusive? allowed-preps data) path data-type allowed-preps data ; unused vars ; data-type should maybe be error-checked..... (let ((bindings) (presteps) (pretest) (poststeps) (posttest) (prologue) (indexv) (listv) (ob) (test) (step)) (push variable bindings) (and (not (null prep-phrases)) (or (cdr prep-phrases) (and (not (loop-tequal (caar prep-phrases) 'in)) (not (loop-tequal (caar prep-phrases) 'of)))) (error "Illegal prep phrase(s) in interned-symbols path --" (list* variable 'being path prep-phrases))) (push (list (setq ob (gensym)) (cond ((null prep-phrases) 'obarray ) (t (cadar prep-phrases)))) bindings) ; Multics lisp does not store single-char-obs in the obarray buckets. ; Thus, we need to iterate over the portion of the obarray ; containing them also. (511. = (ascii 0)) (push `(,(setq indexv (gensym)) #+Multics 639. #+(and Maclisp (not Multics)) 511. #+Lispm 0 fixnum) bindings) #+Maclisp (push `(,(setq listv (gensym)) nil) bindings) #+Lispm (push `(setq ,indexv (array-dimension-n 2 ,ob)) prologue) (setq test `(and #-Multics (null ,listv) #+Multics (or (> ,indexv 510.) (null ,listv)) (prog () lp (cond ((< (setq ,indexv (1- ,indexv)) 0) (return t)) ((setq ,listv (arraycall #+Multics obarray #-Multics t ,ob ,indexv)) (return nil)) (t (go lp))))) ) (setq step `(,variable #+Multics (cond ((> ,indexv 510.) ,listv) (t (prog2 nil (car ,listv) (setq ,listv (cdr ,listv))))) #+(and Maclisp (not Multics)) (car ,listv) #+Lispm (ar-2 ,ob 1 ,indexv))) (cond (inclusive? (setq posttest test poststeps step prologue `((setq ,variable ,ob)))) (t (setq pretest test presteps step))) #+(and Maclisp (not Multics)) (setq poststeps `(,@poststeps ,listv (cdr ,listv))) (list bindings prologue pretest presteps posttest poststeps))) ; We don't want these defined in the compilation environment because ; the appropriate environment hasn't been set up. So, we just bootstrap ; them up. (mapc '(lambda (x) (mapc '(lambda (y) (loop-add-path y (cdr x))) (car x))) '(((car cars) loop-path-carcdr (of) car atom) ((cdr cdrs) loop-path-carcdr (of) cdr atom) ((cddr cddrs) loop-path-carcdr (of) cddr null) ((interned-symbols interned-symbol) loop-interned-symbols-path (in)) )) (or (status feature loop) (sstatus feature loop)) ;Loop macro blathering. ; ; This doc is totally wrong. Complete documentation (nice looking ; hardcopy) is available from GSB, or from ML:LSBDOC;LPDOC (which ; needs to be run through BOLIO). ; ;This is intended to be a cleaned-up version of PSZ's FOR package ;which is a cleaned-up version of the Interlisp CLisp FOR package. ;Note that unlike those crocks, the order of evaluation is the ;same as the textual order of the code, always. ; ;The form is introduced by the word LOOP followed by a series of clauses, ;each of which is introduced by a keyword which however need not be ;in any particular package. Certain keywords may be made "major" ;which means they are global and macros themselves, so you could put ;them at the front of the form and omit the initial "LOOP". ; ;Each clause can generate: ; ; Variables local to the loop. ; ; Prologue Code. ; ; Main Code. ; ; Epilogue Code. ; ;Within each of the three code sections, code is always executed strictly ;in the order that the clauses were written by the user. For parallel assignments ;and such there are special syntaxes within a clause. The prologue is executed ;once to set up. The main code is executed several times as the loop. The epilogue ;is executed once after the loop terminates. ; ;The term expression means any Lisp form. The term expression(s) means any number ;of Lisp forms, where only the first may be atomic. It stops at the first atom ;after the first form. ; ;The following clauses exist: ; ;Prologue: ; INITIALLY expression(s) ; This expli((citly inserts code into the prologue. More commonly ; code comes from variable initializations. ; ;Epilogue: ; FINALLY expression(s) ; This is the only way to explicitly insert code into the epilogue. ; ;Side effects: ; DO expression(s) ; The expressions are evaluated. This is how you make a "body". ; DOING is synonymous with DO. ; ;Return values: ; RETURN expression(s) ; The last expression is returned immediately as the value of the form. ; This is equivalent to DO (RETURN expression) which you will ; need to use if you want to return multiple values. ; COLLECT expression(s) ; The return value of the form will be a list (unless over-ridden ; with a RETURN). The list is formed out of the values of the ; last expression. ; COLLECTING is synonymous with COLLECT. ; APPEND (or APPENDING) and NCONC (or NCONCING) can be used ; in place of COLLECT, forming the list in the appropriate ways. ; COUNT expression(s) ; The return value of the form will be the number of times the ; value of the last expression was non-NIL. ; SUM expression(s) ; The return value of the form will be the arithmetic sum of ; the values of the last expression. ; The following are a bit wierd syntactically, but Interlisp has them ; so they must be good. ; ALWAYS expression(s) ; The return value will be T if the last expression is true on ; every iteration, NIL otherwise. ; NEVER expressions(s) ; The return value will be T if the last expression is false on ; every iteration, NIL otherwise. ; THEREIS expression(s) ; This is wierd, I'm not sure what it really does. ; You probably want WHEN (NUMBERP X) RETURN X ; or maybe WHEN expression RETURN IT ; ;Conditionals: (these all affect only the main code) ; ; WHILE expression ; The loop terminates at this point if expression is false. ; UNTIL expression ; The loop terminates at this point if expression is true. ; WHEN expression clause ; Clause is performed only if expression is true. ; This affects only the main-code portion of a clause ; such as COLLECT. Use with FOR is a little unclear. ; IF is synonymous with WHEN. ; WHEN expression RETURN IT (also COLLECT IT, COUNT IT, SUM IT) ; This is a special case, the value of expression is returned if non-NIL. ; This works by generating a temporary variable to hold ; the value of the expression. ; UNLESS expression clause ; Clause is performed only if expression is false. ; ;Variables and iterations: (this is the hairy part) ; ; WITH variable = expression {AND variable = expression}... ; The variable is set to the expression in the prologue. ; If several variables are chained together with AND ; the setq's happen in parallel. Note that all variables ; are bound before any expressions are evaluated (unlike DO). ; ; FOR variable = expression {AND variable = expression}... ; At this point in the main code the variable is set to the expression. ; Equivalent to DO (PSETQ variable expression variable expression...) ; except that the variables are bound local to the loop. ; ; FOR variable FROM expression TO expression {BY expression} ; Numeric iteration. BY defaults to 1. ; BY and TO may be in either order. ; If you say DOWNTO instead of TO, BY defaults to -1 and ; the end-test is reversed. ; If you say BELOW instead of TO or ABOVE instead of DOWNTO ; the iteration stops before the end-value instead of after. ; The expressions are evaluated in the prologue then the ; variable takes on its next value at this point in the loop; ; hair is required to win the first time around if this FOR is ; not the first thing in the main code. ; FOR variable IN expression ; Iteration down members of a list. ; FOR variable ON expression ; Iteration down tails of a list. ; FOR variable IN/ON expression BY expression ; This is an Interlisp crock which looks useful. ; FOR var ON list BY expression[var] ; is the same as FOR var = list THEN expression[var] ; FOR var IN list BY expression[var] ; is similar except that var gets tails of the list ; and, kludgiferously, the internal tail-variable ; is substituted for var in expression. ; FOR variable = expression THEN expression ; General DO-type iteration. ; Note that all the different types of FOR clauses can be tied together ; with AND to achieve parallel assignment. Is this worthwhile? ; [It's only implemented for = mode.] ; AS is synonymous with FOR. ; ; FOR variable BEING expression(s) AND ITS pathname ; FOR variable BEING expression(s) AND ITS a-r ; FOR variable BEING {EACH} pathname {OF expression(s)} ; FOR variable BEING {EACH} a-r {OF expression(s)} ; Programmable iteration facility. Each pathname has a ; function associated with it, on LOOP-PATH-KEYWORD-ALIST; the ; alist has entries of the form (pathname function prep-list). ; prep-list is a list of allowed prepositions; after either of ; the above formats is parsed, then pairs of (preposition expression) ; are collected, while preposition is in prep-list. The expression ; may be a progn if there are multiple prepositions before the next ; keyword. The function is then called with arguments of: ; pathnname variable prep-phrases inclusive? prep-list ; Prep-phrases is the list of pairs collected, in order. Inclusive? ; is T for the first format, NIL otherwise; it says that the init ; value of the form takes on expression. For the first format, the ; list (OF expression) is pushed onto the fromt of the prep-phrases. ; In the above examples, a-r is a form to be evaluated to get an ; attachment-relationship. In this case, the pathname is taken as ; being ATTACHMENTS, and a-r is passed in by being treated as if it ; had been used with the preposition IN. The function should return ; a list of the form (bindings init-form step-form end-test); bindings ; are stuffed onto loop-variables, init-form is initialization code, ; step-form is step-code, and end-test tells whether or not to exit. ; ;Declarations? Not needed by Lisp machine. For Maclisp these will be done ;by a reserved word in front of the variable name as in PSZ's macro. ; ;The implementation is as a PROG. No initial values are given for the ;PROG-variables. PROG1 is used for parallel assignment. ; ;The iterating forms of FOR present a special problem. The problem is that ;you must do everything in the order that it was written by the user, but the ;FOR-variable gets its value in a different way in the first iteration than ;in the subsequent iterations. Note that the end-tests created by FOR have ;to be done in the appropriate order, since otherwise the next clause might get ;an error. ; ;The most general way is to introduce a flag, !FIRST-TIME, and compile the ;clause "FOR var = first TO last" as "INITIALLY (SETQ var first) ;WHEN (NOT !FIRST-TIME) DO (SETQ var (1+ var)) WHILE (<= var last)". ;However we try to optimize this by recognizing a special case: ;The special case is recognized where all FOR clauses are at the front of ;the main code; in this case if there is only one its stepping and ;endtest are moved to the end, and a jump to the endtest put at the ;front. If there are more than one their stepping and endtests are moved ;to the end, with duplicate endtests at the front except for the last ;which doesn't need a duplicate endtest. If FORs are embedded in the ;main code it can only be implemented by either a first-time flag or ;starting the iteration variable at a special value (initial minus step ;in the numeric iteration case). This could probably just be regarded as ;an error. The important thing is that it never does anything out of ;order. he ;front. If there are more than one their stepping and endtests are moved ;to the end,cmd/lisp/lib/machacks.l 444 0 12 25014 2512712370 10256 (setq |SCCS-machacks| "@(#)machacks.l 1.4 2/27/81") ;; machacks - maclisp compatibility package. ;; When this file is fasl'ed into a lisp, it will change the syntax to ;; maclisp's syntax and will define functions know to the standard maclisp. ; ; this file will be fasled whenever the -m switch is set for compilation. ; ;; Vaxima installation note: ; * each site which runs vaxima should set the following symbol to ; the location of the Vaxima main directory (setq vaxima-main-dir "//vb//mac//") (declare (macros t)) ;-- macsyma-env ; This really isn't part of the maclisp compatibility package but we put ; it here to allow us to bootstrap the macsyma macro packages. ; (def macsyma-env ; put at the beginning of each macsyma file (macro (l) `(include |libmax//prelud.l|))) (def coutput (lambda (msg) (print msg) ; should go to unfasl port (terpr))) ;--- displace ; This is useful after a macro has been expanded and you want to save the ; interpreter the trouble of expanding the macro again. ; [This is really only useful for interpretation] (defun displace (old-form new-form) (cond ((atom old-form) (error '|Not able to displace this form| old-form)) ((atom new-form) (rplaca old-form 'progn) (rplacd old-form (list new-form))) (t (rplaca old-form (car new-form)) (rplacd old-form (cdr new-form))))) ;--- caseq ; use is ; (caseq expr ; (match1 do1) ; (match2 do2) ; (t doifallelsefails)) (def caseq (macro (form) ((lambda (x) `((lambda (,x) (cond ,@(mapcar '(lambda (ff) (cond ((eq (car ff) 't) `(t ,(cadr ff))) (t `((eq ,x ',(car ff)) ,(cadr ff))))) (cddr form)))) ,(cadr form))) (gensym 'Z)))) ;A winning macro to store things anywhere: (stolen from AI:ALAN;LSPENV) ;(SETF (CADR X) 3) --> (RPLACA (CDR X) 3) (DEFMACRO SETF (EXPR VAL) (COND ((ATOM EXPR) (OR (SYMBOLP EXPR) (ERROR '|-- SETF can't handle this.| EXPR)) `(SETQ ,EXPR ,VAL)) (T (DO ((Y))(( (()) (OR (SYMBOLP (CAR EXPR)) (ERROR '|-- SETF can't handle this.| EXPR)) (AND (SETQ Y (GET (CAR EXPR) 'SETF-EXPAND)) (RETURN (FUNCALL Y EXPR VAL))) (OR (and (SETQ Y (GETd (CAR EXPR))) (or (and (dtpr y) (eq (car y) 'macro)) (and (bcdp y) (eq (getdisc y) 'macro)))) (ERROR '|-- SETF can't handle this.| EXPR)) (SETQ EXPR (apply Y EXPR)))))) (DEFMACRO DEFSETF (NAME VARS &REST BODY) `(eval-when (compile load eval) (DEFPROP ,NAME (LAMBDA ,VARS . ,BODY) SETF-EXPAND))) (DEFSETF CAR (E V) `(RPLACA ,(CADR E) ,V)) (DEFSETF CAAR (E V) `(RPLACA (CAR ,(CADR E)) ,V)) (DEFSETF CADR (E V) `(RPLACA (CDR ,(CADR E)) ,V)) (DEFSETF CAAAR (E V) `(RPLACA (CAAR ,(CADR E)) ,V)) (DEFSETF CADAR (E V) `(RPLACA (CDAR ,(CADR E)) ,V)) (DEFSETF CAADR (E V) `(RPLACA (CADR ,(CADR E)) ,V)) (DEFSETF CADDR (E V) `(RPLACA (CDDR ,(CADR E)) ,V)) (DEFSETF CAAAAR (E V) `(RPLACA (CAAAR ,(CADR E)) ,V)) (DEFSETF CADAAR (E V) `(RPLACA (CDAAR ,(CADR E)) ,V)) (DEFSETF CAADAR (E V) `(RPLACA (CADAR ,(CADR E)) ,V)) (DEFSETF CADDAR (E V) `(RPLACA (CDDAR ,(CADR E)) ,V)) (DEFSETF CAAADR (E V) `(RPLACA (CAADR ,(CADR E)) ,V)) (DEFSETF CADADR (E V) `(RPLACA (CDADR ,(CADR E)) ,V)) (DEFSETF CAADDR (E V) `(RPLACA (CADDR ,(CADR E)) ,V)) (DEFSETF CADDDR (E V) `(RPLACA (CDDDR ,(CADR E)) ,V)) (DEFSETF CDR (E V) `(RPLACD ,(CADR E) ,V)) (DEFSETF CDAR (E V) `(RPLACD (CAR ,(CADR E)) ,V)) (DEFSETF CDDR (E V) `(RPLACD (CDR ,(CADR E)) ,V)) (DEFSETF CDAAR (E V) `(RPLACD (CAAR ,(CADR E)) ,V)) (DEFSETF CDDAR (E V) `(RPLACD (CDAR ,(CADR E)) ,V)) (DEFSETF CDADR (E V) `(RPLACD (CADR ,(CADR E)) ,V)) (DEFSETF CDDDR (E V) `(RPLACD (CDDR ,(CADR E)) ,V)) (DEFSETF CDAAAR (E V) `(RPLACD (CAAAR ,(CADR E)) ,V)) (DEFSETF CDDAAR (E V) `(RPLACD (CDAAR ,(CADR E)) ,V)) (DEFSETF CDADAR (E V) `(RPLACD (CADAR ,(CADR E)) ,V)) (DEFSETF CDDDAR (E V) `(RPLACD (CDDAR ,(CADR E)) ,V)) (DEFSETF CDAADR (E V) `(RPLACD (CAADR ,(CADR E)) ,V)) (DEFSETF CDDADR (E V) `(RPLACD (CDADR ,(CADR E)) ,V)) (DEFSETF CDADDR (E V) `(RPLACD (CADDR ,(CADR E)) ,V)) (DEFSETF CDDDDR (E V) `(RPLACD (CDDDR ,(CADR E)) ,V)) (DEFSETF CXR (E V) `(RPLACX ,(CADR E) ,(CADDR E) ,V)) (DEFSETF NTH (E V) `(RPLACA (NTHCDR ,(CADR E) ,(CADDR E)) ,V)) (DEFSETF ARRAYCALL (E V) `(STORE ,E ,V)) (DEFSETF GET (E V) `(PUTPROP ,(CADR E) ,V ,(CADDR E))) (DEFSETF PLIST (E V) `(SETPLIST ,(CADR E) ,V)) (DEFSETF SYMEVAL (E V) `(SET ,(CADR E) ,V)) (DEFSETF ARG (E V) `(SETARG ,(CADR E) ,V)) (DEFSETF ARGS (E V) `(ARGS ,(CADR E) ,V)) (DEFSETF SFA-GET (E V) `(SFA-STORE ,(CADR E) ,(CADDR E) ,V)) (DEFSETF EXAMINE (E V) `(DEPOSIT ,(CADR E) ,V)) (defmacro list* (&rest forms) (cond ((null forms) nil) ((null (cdr forms)) (car forms)) (t (construct-list* forms)))) (defmacro ttf (&rest l) `(list* . , l)) (defun construct-list* (forms) (setq forms (reverse forms)) (do ((forms (cddr forms) (cdr forms)) (return-form `(cons ,(cadr forms) ,(car forms)) `(cons ,(car forms) ,return-form))) ((null forms) return-form))) ;; lexpr-funcall is a cross between apply and funcall. The last arguments ;; is a list of the rest of the arguments (defmacro lexpr-funcall (func &rest args) `(apply ,func (list* ,@args))) ; contents of the file libmax;macros all of these functions are ; (by default) in maclisp ;; (IF X P Q1 Q2 ...) --> (COND (X P) (T Q1 Q2 ...)) ;; It is important that (IF NIL ) returns NIL as Macsyma code depends ;; upon this in places. See also IFN in LIBMAX;MAXMAC. (DEFMACRO IF (PREDICATE THEN &REST ELSE) (COND ((NULL ELSE) `(COND (,PREDICATE ,THEN))) (T `(COND (,PREDICATE ,THEN) (T . ,ELSE))))) ;; LET, LET*, LIST* are now a part of Multics Lisp. Nobody should miss ;; the code commented out below. ;; (LET ((A 3) (B) C) STUFF) --> ((LAMBDA (A B C) STUFF) 3 NIL NIL) ;; (LET* ((A 3) (B 4)) STUFF) --> ((LAMBDA (A) ((LAMBDA (B) STUFF) 4)) 3) ;; (PUSH X S) --> (SETQ S (CONS X S)) (DEFMACRO PUSH (OBJECT LIST) `(SETF ,LIST (CONS ,OBJECT ,LIST))) ;; (POP S) --> (PROG1 (CAR S) (SETF S (CDR S))) ;; (POP S V) --> (PROG1 (SETF V (CAR S)) (SETF S (CDR S))) ;; This relies on the fact that SETF returns the value stored. (DEFMACRO POP (LIST &OPTIONAL (INTO NIL INTO-P)) (COND (INTO-P `(PROG1 (SETF ,INTO (CAR ,LIST)) (SETF ,LIST (CDR ,LIST)))) (T `(PROG1 (CAR ,LIST) (SETF ,LIST (CDR ,LIST)))))) ;; (FOR I m n . BODY) will evaluate BODY with I bound to m,m+1,...,n-1 ;; sequentially. (FOR I 0 n . BODY) --> (DOTIMES (I n) . BODY) (DEFMACRO FOR (VAR START STOP . BODY) `(DO ,VAR ,START (1+ ,VAR) (= ,VAR ,STOP) ,@BODY)) (DEFMACRO EVENP (X) `(NOT (ODDP ,X))) ; these were grabbed from lspsrc;umlmac.5 (DEFMACRO WHEN (P . C) `(COND (,P . ,C))) (DEFMACRO UNLESS (P . C) `(COND ((NOT ,P) . ,C))) (defmacro DOLIST ((var form index) &rest body &aux (dummy (gensym)) decls) (setq decls (cond ((and body (not (atom (car body))) (eq (caar body) 'DECLARE)) (prog2 () (cdar body) (pop body))))) (cond (index (setq index (ncons `(,INDEX 0 (1+ ,INDEX)) )) (push `(FIXNUM ,INDEX) decls))) (and decls (setq decls (ncons `(DECLARE ,.decls)))) `(DO ((,DUMMY ,FORM (CDR ,DUMMY)) (,VAR) ,.index ) ((NULL ,DUMMY)) ,@decls (SETQ ,VAR (CAR ,DUMMY)) ,.BODY)) ;Repeat a number of times. evaluates to the number of times, ;and is executed with bound to 0, 1, ... ;Don't generate dummy variable if is an integer. We could also do this ;if were a symbol, but the symbol may get clobbered inside the body, ;so the behavior of the macro would change. (DEFMACRO DOTIMES (SPEC &REST BODY) (LET (VAR COUNT DUMMY DECLS) (SETQ DECLS `(DECLARE (FIXNUM ,var ) ;LOOP VARIABLE TO BE FILLED IN HERE ,.(cond ((and body (not (atom (car body))) (eq (caar body) 'DECLARE)) (prog2 () (cdar body) (pop body)))))) (COND ((ATOM SPEC) (SETQ VAR (GENSYM) COUNT SPEC)) ('T (DESETQ (VAR COUNT) SPEC) (COND ((NULL VAR) (SETQ VAR (GENSYM)))) (COND ((NOT (FIXP COUNT)) (SETQ DUMMY `((,(gensym) ,count)) COUNT (CAAR DUMMY)))))) (SETF (CADADR DECLS) VAR) `(DO ((,var 0 (1+ ,var)) ,.dummy) ((NOT (< ,var ,count))) ,decls ,.body))) ;; The following is NOT courtesy AI: LISPM2; LMMAC 118 ;; Theirs is buggy! ;; PSETQ looks like SETQ but does its work in parallel. (DEFMACRO PSETQ (&REST REST) (COND ((CDDR REST) `(SETQ ,(CAR REST) (PROG1 ,(CADR REST) (PSETQ . ,(CDDR REST))))) ;; The last pair. Keep it simple; no superfluous ;; (PROG1 (SETQ...) (PSETQ)). ((CDR REST) `(SETQ . ,REST)) (T (error '|Odd number of args to PSETQ| rest 'wrng-no-args)))) (defmacro if-for-maclisp-else-lispm (&rest ll) (car ll)) (PROGN 'COMPILE (DEFMACRO LOGAND (&REST FORMS) `(BOOLE 1 . ,FORMS)) (DEFMACRO LOGIOR (&REST FORMS) `(BOOLE 7 . ,FORMS)) (DEFMACRO LOGXOR (&REST FORMS) `(BOOLE 6 . ,FORMS)) ) (DEFMACRO DEFVAR (VARIABLE &OPTIONAL (INITIAL-VALUE NIL IV-P) DOCUMENTATION) DOCUMENTATION ;; Ignored for now. (IF IV-P `(PROGN 'COMPILE (DECLARE (SPECIAL ,VARIABLE)) (OR (BOUNDP ',VARIABLE) (SETQ ,VARIABLE ,INITIAL-VALUE))) `(DECLARE (SPECIAL ,VARIABLE)))) (DEFMACRO PSETQ (VAR VALUE . REST) (COND (REST `(SETQ ,VAR (PROG1 ,VALUE (PSETQ . ,REST)))) (T `(SETQ ,VAR ,VALUE)))) ;; (DOTIMES (I N) BODY) evaluates BODY N times, with I bound to 0, 1, ..., N-1. ;; (DOLIST (X L) BODY) successively binds X to the elements of L, and evaluates ;; BODY each time. ;; Things to beware of: ;; [1] This won't work for COUNT being a bignum. ;; [2] If COUNT is a symbol, somebody could clobber its value inside the body. ;; [3] Somebody inside of BODY could reference **COUNT**. (DEFMACRO DOTIMES ((VAR COUNT) . BODY) (IF (OR (FIXP COUNT) (SYMBOLP COUNT)) `(DO ((,VAR 0 (1+ ,VAR))) ((>= ,VAR ,COUNT)) (DECLARE (FIXNUM ,VAR)) . ,BODY) `(DO ((,VAR 0 (1+ ,VAR)) (**COUNT** ,COUNT)) ((>= ,VAR **COUNT**)) (DECLARE (FIXNUM ,VAR **COUNT**)) . ,BODY))) (DEFMACRO DOLIST ((VAR LIST) . BODY) `(DO ((**LIST** ,LIST (CDR **LIST**)) (,VAR)) ((NULL **LIST**)) (SETQ ,VAR (CAR **LIST**)) . ,BODY)) ;; CASE is apparently missing from ITS MacLisp. ;; (DEFMACRO SELECT (KEY . FORMS) ;; (SETQ FORMS ;; (MAPCAR #'(LAMBDA (FORM) (IF (EQ (CAR FORM) 'OTHERWISE) ;; (CONS T (CDR FORM)) FORM)) ;; FORMS)) ;; `(CASE ,KEY . ,FORMS)) (DEFMACRO SELECTQ (KEY . FORMS) (SETQ FORMS (MAPCAR '(LAMBDA (FORM) (IF (EQ (CAR FORM) 'OTHERWISE) (CONS T (CDR FORM)) FORM)) FORMS)) `(CASEQ ,KEY . ,FORMS)) (,VAR)) ((NULL **LIST**)) (SETQ ,VAR (CAR **LIST**)) . ,BODY)) ;; CASE is apparently missing from ITS MacLisp. ;; (DEFMACRO SELECT (KEY . FORMS) ;; (SETQ FORMS ;; (MAPCAR #'(LAMBDA (FORM) (IF (EQ (CAR FORM) 'OTHERWISE) ;; (CONS T (CDR FORM)) FORM)) ;; FORMS)) ;; `(CASE ,KEY . ,FORMS)) (DEFMACRO SELECTQ (KEY . FORMS) (SETQ FORMS (MAPCAR '(LAMBDA (FORM) (IF (EQ (CAR FORM) 'OTHERWISE) (CONS T (CDR FORM)) FORM)) FORMS)) `(CASEQ ,KEY cmd/lisp/lib/step.l 444 0 12 16614 2552720241 7465 (setq SCCS-step "@(#)step.l 1.3 7/9/81") ; vi: set lisp : ;;; LISP Stepping Package ;;; ;;; Adapted by Mitch Marcus for Franz Lisp from Chuck Rich's MACLISP ;;; package. ;;; ;;; ;;; Adapted 2/80 from the Maclisp version of 11/03/76 ;;; Further modified 5/80 by Don Cohen (DNC) ;;; ;;; modified by jkf 6/81 to handle funcallhook. ;;; ;;; User Interface Function ;;; ;;; Valid Forms: ;;; (step) or (step nil) :: turn off stepping ;;; (step t) :: turn(( on stepping right away. ;;; (step e) :: turn on stepping of eval only ;;; (step foo1 foo2 ...) :: turn on stepping when one of fooi is ;;; :: called ;;; ;------ implementation: ; evalhook* is nil meaning no stepping, or t meaning always step ; or is a list of forms which will start continuous stepping. ; ; The hook functions are evalhook* and funcallhook*. ; (declare (special evalhook-switch piport hookautolfcount funcallhook evalhook evalhook* |evalhook#| prinlevel prinlength fcn-evalhook fcn-funcallhook) (macros nil)) ;; First Some Macros (defun 7bit macro (s) ;; (7BIT n c) tests if n is ascii for c (list '= (list 'boole 1 127. (cadr s)) (caddr s))) ;--- print* ; indent based on current evalhook recursion level then print the ; arg in form ; (defun print* macro (s) ;; print with indentation '(do ((i 1 (1+ i)) (indent (* 2 |evalhook#|)) (prinlevel 3) (prinlength 5)) ((> i indent) (cond ((eq type 'funcall) (patom "f:"))) (print form)) (tyo 32.))) (defun step fexpr (arg) (cond ((or (null arg) (car arg)) (setq evalhook-switch t) ; for fixit package (setq |evalhook#| 0.) ;initialize depth count (setq hookautolfcount 0) ; count if auto lfs at break (setq evalhook nil) ;for safety (setq funcallhook nil) ; (step e) means just step eval things, else step eval and funcal (cond ((eq (car arg) 'e) (setq fcn-evalhook 'evalhook* fcn-funcallhook nil)) (t (setq fcn-evalhook 'evalhook* fcn-funcallhook 'funcallhook*))) (setq evalhook* (cond ((null arg) nil) ((or (eq (car arg) t) (eq (car arg) 'e))) (arg))) (setq evalhook fcn-evalhook) ;turn system hook to my function (setq funcallhook fcn-funcallhook) (sstatus translink nil) (*rset t) ;must be on for hook to work (sstatus evalhook t)) ;arm it (t (setq evalhook* nil) (setq evalhook nil) (setq hookautolfcount 0) ; count if auto lfs at break (setq evalhook-switch nil) (sstatus evalhook nil)))) ;---- funcall-evalhook* ; ; common function to handle evalhook's and funcallhook's. ; the form to be evaluated is given as form and the type (eval or funcall) ; is given as type. ; (defun funcall-evalhook* (form type) (cond (evalhook* ;; see if selective feature kicks in here (and (not (atom form)) (not (eq evalhook* t)) (memq (car form) evalhook*) (setq evalhook* t)) ; yes, begin stepping always (cond ((eq evalhook* t) ;; print out form before evaluation (print*) (cond ((atom form) ;; since form is atom, we just eval it and print ;; out its value, no need to ask user what to do (cond ((not (or (numberp form)(null form)(eq form t))) (princ '" = ") ((lambda (prinlevel prinlength) (setq form (evalhook form nil nil)) (print form)) 3 5))) (terpri)) (t ; s-expression (prog (cmd ehookfn fhookfcn) cmdlp (cond ((greaterp hookautolfcount 0) (setq hookautolfcount (sub1 hookautolfcount)) (terpr) (setq cmd #\lf)) (t (setq cmd(let ((piport nil)) (drain piport) (tyi piport))))) ;; uppercase alphabetics ;; dispatch on command character (cond ((eq cmd #\lf) ; \n so continue (setq ehookfn fcn-evalhook fhookfcn fcn-funcallhook)) ((memq cmd '(#/p #/P)) ; "P" print in full (drain piport) (print form) (go cmdlp)) ; "G" ((memq cmd '(#/g #/G)) (drain piport) (setq evalhook* nil ;stop everything ehookfn nil fhookfcn nil)) ((memq cmd '(#/c #/C)) ;"C" no deeper (drain piport) (setq ehookfn nil fhookfcn nil)) ((memq cmd '(#/d #/D)) ;"D" call debug (setq evalhook-switch nil) (sstatus evalhook nil) (debug) (setq evalhook-switch t) (sstatus evalhook t) (go cmdlp)) ((memq cmd '(#/b #/B)) ; "B" give breakpoint (drain piport) (break step) (print*) (go cmdlp)) ((memq cmd '(#/q #/Q)) ; "Q" stop stepping (step nil) (reset)) ((memq cmd '(#/n #/N)) (setq hookautolfcount (let ((piport nil)) (read))) (cond ((not (numberp hookautolfcount)) (patom "arg to n should be number") (terpr) (setq hookautolfcount 0)))) ; "e" step eval only ((memq cmd '(#/e #/E)) (setq fcn-funcallhook nil)) ; "?", "H" show the options ((memq cmd '(72 104 63.)) #+cmu (ty /usr/lisp/doc/step\.ref) #-cmu(stephelpform) (terpri) (drain piport) (go cmdlp)) (t (princ '"Try one of ?BCDGMPQ or ") (drain piport) (go cmdlp))) ;; evaluate form ((lambda (|evalhook#|) (setq form (continue-evaluation form type ehookfn fhookfcn))) (1+ |evalhook#|)) ;; print out evaluated form (cond ((and evalhook* (or (eq type 'funcall) (not (zerop |evalhook#|)))) (let ((type nil)) (print*)) (terpri) ))))) ;;return evaluated form form) (t (continue-evaluation form type fcn-evalhook fcn-funcallhook)))) (t (continue-evaluation form type fcn-evalhook fcn-funcallhook)))) ;--- stephelpform ; ; print a summary of the functions of step ; (defun stephelpform nil (patom " - single step; n - step times")(terpr) (patom "b - break; q - quit stepping; d - call debug;") (terpri) (patom "c - turn off step for deeper levels; e - stop at eval forms only") (terpri) (patom "h,? - print this") (terpr)) ;--- funcallhook* ; ; automatically called when a funcall is done and funcallhook*'s ; value is the name of this function (funcallhook*). When this is ; called, a function with n-1 args is being funcalled, the args ; to the function are (arg 1) through (arg (sub1 n)), the name of ; the function is (arg n) ; (defun funcallhook* n (let ((name (arg n)) (args (listify (sub1 n)))) (funcall-evalhook* (cons name args) 'funcall))) ;--- evalhook* ; ; called whenever an eval is done and evalhook*'s value is the ; name of this function (evalhook*). arg is the thing being ; evaluated. ; (defun evalhook* (arg) (funcall-evalhook* arg 'eval)) (defun continue-evaluation (form type evalhookfcn funcallhookfcn) (cond ((eq type 'eval) (evalhook form evalhookfcn funcallhookfcn)) (t (funcallhook form funcallhookfcn evalhookfcn)))) (or (boundp 'prinlength) (setq prinlength nil)) (or (boundp 'prinlevel) (setq prinlevel nil)) uncall))) ;--- evalhook* ; ; called whenever an eval is done and evalhook*'s value is the ; name of this functioncmd/lisp/lib/syscall.l 444 0 12 4125 2552720241 10136 (setq SCCS-syscall "@(#)syscall.l 1.3 5/15/81") ; ; syscall ; ; This file contains macro definitions of some of the Unix system calls. ; The documentation for these system calls can be found in the Unix ; manual. ; ; It is believed that all of these system calls can be executed by the ; Unix emulator Eunice under VMS. ; ; Unix system calls which return values in registers other than r0 cannot ; be called in this way. An example of this is fork, for which there is ; a seperate lisp function. (declare (macros t)) (defmacro sys_access (name mode) `(syscall 33 ,name ,mode)) (defmacro sys_alarm (secs) `(syscall 27 ,secs)) (defmacro sys_brk (addr) `(syscall 17 ,addr)) (defmacro sys_chdir (dir) `(syscall 12 ,dir)) (defmacro sys_chmod (name mode) `(syscall 15 ,name ,mode)) (defmacro sys_chown (name ownerid groupid) `(syscall 16 name ownerid groupid)) (defmacro sys_close (filedes) `(syscall 6 ,filedes)) (defmacro sys_creat (name mode) `(syscall 8 ,name ,mode)) (defmacro sys_exit (status) `(syscall 1 ,status)) (defmacro sys_getpid nil `(syscall 20)) (defmacro sys_getuid nil `(syscall 24)) (defmacro sys_getgid nil `(syscall 47)) ; sys_kill - need to get value into r0 (defmacro sys_kill (pid) `(syscall 37 ,pid)) (defmacro sys_link (name newname) `(syscall 9 ,name ,newname)) (defmacro sys_nice (value) `(syscall 34 ,value)) ; sys_lseek this may not be correct the explanation is given for a pdp-11 ; where certain values must be stored in two words. ; also need to get value into r0 (defmacro sys_open (name how) `(syscall 5 ,name ,how)) (defmacro sys_pause nil `(syscall 29)) (defmacro sys_setuid (uid) `(syscall 23 ,uid)) (defmacro sys_setgid (gid) `(syscall 46 ,gid)) (defmacro sys_sync nil `(syscall 36)) (defmacro sys_time nil `(syscall 13)) (defmacro sys_umask (complementmode) `(syscall 60 ,complementmode)) (defmacro sys_unlink (name) `(syscall 10 ,name)) (defmacro sys_wait nil `(syscall 7)) (defmacro sys_ioctl (portnumber arg) `(syscall 54 ,portnumber ,arg)) (putprop 'syscall t 'version) ; flag that this file has been loaded se nil `(syscall 29)) (defmacro sys_setuid (uid) `(syscall 23 ,uid)) (defmacro sys_setgid (gid) `(syscall 46 ,gid)) (defmacro sys_sync nil `(syscall 36)) (defmacro sys_time nil `(syscall 13)) (defmacro sys_umask (complementmode) `(syscall 60 ,complementmode)) (defmacro sys_unlink (name) `(syscall 10 ,name)) (defmacro sys_wait nil `(syscall 7)) (defmacro sys_ioctl (portnumber arg) `(syscall 54 ,por((cmd/lisp/lib/toplevel.l 444 0 12 25114 2552720242 10340 (setq SCCS-toplevel "@(#)toplevel.l 1.5 7/9/81") ; vi: set lisp : ; special atoms: (declare (special debug-level-count break-level-count errlist tpl-errlist user-top-level franz-not-virgin piport ER%tpl ER%all $ldprint evalhook funcallhook top-level-eof * ** *** + ++ +++ ^w) (macros t)) (setq top-level-eof (gensym 'Q) tpl-errlist nil errlist nil user-top-level nil ) ;------------------------------------------------------ ; Top level function for franz jkf, march 1980 ; ; The following function contains the top-level read, eval, print ; loop. With the help of the error handling functions, ; break-err-handler and debug-err-handler, franz-top-level provides ; a reasonable enviroment for working with franz lisp. ; (def franz-top-level (lambda nil (cond ((or (not (boundp 'franz-not-virgin)) (null franz-not-virgin)) (setq franz-not-virgin t + nil ++ nil +++ nil * nil ** nil *** nil) (setq ER%tpl 'break-err-handler) (putd 'reset (getd 'franz-reset)) (cond ((not (autorunlisp)) (patom (status version)) (terpr) (read-in-lisprc-file))))) ; loop forever (do ((+*) (-) (retval)) (nil) (setq retval (*catch '(top-level-catch break-catch) ; begin or return to top level (progn (setq debug-level-count 0 break-level-count 0 evalhook nil funcallhook nil) (cond (tpl-errlist (mapc 'eval tpl-errlist))) (do ((^w nil nil)) (nil) (cond (user-top-level (funcall user-top-level)) (t (patom "-> ") (cond ((eq top-level-eof (setq - (car (errset (read nil top-level-eof))))) (cond ((not (status isatty)) (exit))) (cond ((null (status ignoreeof)) (terpr) (print 'Goodbye) (terpr) (exit)) (t (terpr) (setq - ''EOF))))) (setq +* (eval -)) ; update list of old forms (let ((val -)) (let ((o+ +) (o++ ++)) (setq + val ++ o+ +++ o++))) ; update list of old values (let ((val +*)) (let ((o* *) (o** **)) (setq * val ** o* *** o**))) (print +*) (terpr))))))) (terpr) (patom "[Return to top level]") (terpr) (cond ((eq 'reset retval) (old-reset-function)))))) ; debug-err-handler is the clb of ER%all when we are doing debugging ; and we want to catch all errors. ; It is just a read eval print loop with errset. ; the only way to leave is: ; (reset) just back to top level ; (return x) return the value to the error checker. ; if nil is returned then we will continue as if the error ; didn't occur. Otherwise if the returned value is a list, ; then if the error is continuable, the car of that list ; will be returned to recontinue computation. ; ^D continue as if this handler wasn't called. ; the form of errmsgs is: ; (error_type unique_id continuable message_string other_args ...) ; (def debug-err-handler (lexpr (n) ((lambda (message debug-level-count retval ^w piport evalhook funcallhook) (cond ((greaterp n 0) (print 'Error:) (mapc '(lambda (a) (patom " ") (patom a) ) (cdddr (arg 1))) (terpr))) (setq ER%all 'debug-err-handler) (do (retval) (nil) (cond ((dtpr (setq retval (errset (do ((form)) (nil) (patom "D<") (patom debug-level-count) (patom ">: ") (cond ((eq top-level-eof (setq form (read nil top-level-eof))) (cond ((null (status isatty)) (exit))) (return nil)) ((and (dtpr form) (eq 'return (car form))) (return (eval (cadr form)))) (t (print (eval form)) (terpr))))))) (return (car retval)))))) nil (add1 debug-level-count) nil nil nil nil nil))) ; this is the break handler, it should be tied to ; ER%tpl always. ; it is entered if there is an error which no one wants to handle. ; We loop forever, printing out our error level until someone ; types a ^D which goes to the next break level above us (or the ; top-level if there are no break levels above us. ; a (return n) will return that value to the error message ; which called us, if that is possible (that is if the error is ; continuable) ; (def break-err-handler (lexpr (n) ((lambda (message break-level-count retval rettype ^w piport evalhook funcallhook) (cond ((greaterp n 0) (print 'Error:) (mapc '(lambda (a) (patom " ") (patom a) ) (cdddr (arg 1))) (terpr) (cond ((caddr (arg 1)) (setq rettype 'contuab)) (t (setq rettype nil)))) (t (setq rettype 'localcall))) (do nil (nil) (cond ((dtpr (setq retval (*catch 'break-catch (do ((form)) (nil) (patom "<") (patom break-level-count) (patom ">: ") (cond ((eq top-level-eof (setq form (read nil top-level-eof))) (cond ((null (status isatty)) (exit))) (eval 1) ; force interrupt check (return (sub1 break-level-count))) ((and (dtpr form) (eq 'return (car form))) (cond ((or (eq rettype 'contuab) (eq rettype 'localcall)) (return (ncons (eval (cadr form))))) (t (patom "Can't continue from this error") (terpr)))) ((and (dtpr form) (eq 'retbrk (car form))) (cond ((numberp (setq form (eval (cadr form)))) (return form)) (t (return (sub1 break-level-count))))) (t (print (eval form)) (terpr))))))) (return (cond ((eq rettype 'localcall) (car retval)) (t retval)))) ((lessp retval break-level-count) (setq tpl-errlist errlist) (*throw 'break-catch retval)) (t (terpr))))) nil (add1 break-level-count) nil nil nil nil nil nil))) (def debugging (lambda (val) (cond (val (setq ER%all 'debug-err-handler) (*rset t)) (t (setq ER%all nil))))) ; the problem with this definition for break is that we are ; forced to put an errset around the break-err-handler. This means ; that we will never get break errors, since all errors will be ; caught by our errset (better ours than one higher up though). ; perhaps the solution is to automatically turn debugmode on. ; (defmacro break (message &optional (pred t)) `(*break ,pred ',message)) (def *break (lambda (pred message) (let ((^w nil)) (cond ((not (boundp 'break-level-count)) (setq break-level-count 1))) (cond (pred (terpr) (patom "Break ") (patom message) (terpr) (do ((form)) (nil) (cond ((dtpr (setq form (errset (break-err-handler)))) (return (car form)))))))))) ; this reset function is designed to work with the franz-top-level. ; When franz-top-level begins, it makes franz-reset be reset. ; when a reset occurs now, we set the global variable tpl-errlist to ; the current value of errlist and throw to top level. At top level, ; then tpl-errlist will be evaluated. ; (def franz-reset (lambda nil (setq tpl-errlist errlist) (errset (*throw 'top-level-catch 'reset) nil) (old-reset-function))) ; this definition will have to do until we have the ability to ; cause and error on any channel in franz (def error (lexpr (n) (cond ((greaterp n 0) (patom (arg 1)) (cond ((greaterp n 1) (patom " ") (patom (arg 2)))) (terpr))) (err))) ; this file is read in just before dumplisping if you want .lisprc ; from your home directory read in before the lisp begins. (def read-in-lisprc-file (lambda nil ((lambda (hom prt) (setq break-level-count 0 ; do this in case break debug-level-count 0) ; occurs during readin (*catch '(break-catch top-level-catch) (cond (hom (cond ((and (errset (progn (setq prt (infile (concat hom '"/.lisprc"))) (close prt)) nil) (null (errset (load (concat hom '"/.lisprc"))))) (patom '"Error in .lisprc file detected") (terpr))))))) (getenv 'HOME) nil))) (putd 'top-level (getd 'franz-top-level)) ; if this is the first time this file has been read in, then ; make franz-reset be the reset function, but remember the original ; reset function as old-reset-function. We need the old reset function ; if we are going to allow the user to change top-levels, for in ; order to do that we really have to jump all the way up to the top. (cond ((null (getd 'old-reset-function)) (putd 'old-reset-function (getd 'reset)))) ;---- autoloader functions (def undef-func-handler (lambda (args) (prog (funcnam file) (setq funcnam (caddddr args)) (cond ((symbolp funcnam) (cond ((setq file (get funcnam 'autoload)) (cond ($ldprint (patom "[autoload ") (patom file) (patom "]")(terpr))) (load file)) (t (return nil))) (cond ((getd funcnam) (return (ncons funcnam))) (t (patom "Autoload file does not contain func ") (return nil)))))))) (setq ER%undef 'undef-func-handler) (declare (special $ldprint)) ;--- autorunlisp :: check if this lisp is supposed to run a program right ; away. ; (defun autorunlisp nil (cond ((and (> (argv -1) 2) (equal (argv 1) '-f)) (let ((progname (argv 2)) ($ldprint nil) (searchlist nil)) ; don't give fasl messages (setq searchlist (cvtsearchpathtolist (getenv 'PATH))) ; give two args to load to insure that a fasl is done. (cond ((null (errset (load-autorunobject progname searchli((st))) (exit 0)) (t t)))))) (defun cvtsearchpathtolist (path) (do ((x (explodec path) (cdr x)) (names nil) (cur nil)) ((null x) (nreverse names)) (cond ((or (eq ': (car x)) (and (null (cdr x)) (setq cur (cons (car x) cur)))) (cond (cur (setq names (cons (implode (nreverse cur)) names)) (setq cur nil)) (t (setq names (cons '|.| names))))) (t (setq cur (cons (car x) cur)))))) (defun load-autorunobject (name search) (cond ((memq (getchar name 1) '(/ |.|)) (cond ((probef name) (fasl name)) (t (error "From lisp autorun: can't find file to load")))) (t (do ((xx search (cdr xx)) (fullname)) ((null xx) (error "Can't find file to execute ")) (cond ((probef (setq fullname (concat (car xx) "/" name))) (return (fasl fullname)))))))) (defun debug fexpr (args) (load 'fix) ; load in fix package (eval (cons 'debug args))) ; enter debug through eval ;-- default autoloader properties (putprop 'trace '/usr/lib/lisp/trace 'autoload) (putprop 'step '/usr/lib/lisp/step 'autoload) error "From lisp autorun: can't find file to load")))) (t (do ((xx search (cdr xx)) (fullname)) ((null xx) (error "Can't find file to execute ")) (cond ((probef (setq fullname (concat (car xx) "/" name))) (return (fasl fullname)))))))) (defun debug fexpr (args) (load 'fix) ; load in fix package (eval (cons 'debug args))) ; enter debug through eval ;-- default autoloader properties (putprop 'trace '/cmd/lisp/lib/trace.l 444 0 12 31442 2552720244 7607 (setq SCCS-trace "@(#)trace.l 1.9 4/24/81") ;---- The Joseph Lister Trace Package, v1 ; John Foderaro, Sept 1979 ;------------------------------------------------------------------; ; Copyright (c) 1979 The Regents of the University of California ; ; All rights reserved. ; ;------------------------------------------------------------------; (eval-when (eval) (setq old-read-table-trace readtable) (setq readtable (makereadtable t)) (setq old-uctolc-value (status uctolc)) (sstatus uctolc nil) ; turn off case conversion (load 'backquote) ) (declare (nlambda T-status T-sstatus) (special piport if ifnot evalin evalout printargs printres evfcn traceenter traceexit prinlevel prinlength $$functions-in-trace$$ ; active functions $$funcargs-in-trace$$ ; arguments to active functions. $tracemute ; if t, then enters and exits ; are quiet, but info is still ; kept so (tracedump) will work )) (cond ((null (boundp '$$traced-functions$$)) (setq $$traced-functions$$ nil))) (cond ((null (boundp '$$functions-in-trace$$)) (setq $$functions-in-trace$$ nil))) (cond ((null (boundp '$$funcargs-in-trace$$)) (setq $$funcargs-in-trace$$ nil))) (cond ((null (boundp '$tracemute)) (setq $tracemute nil))) ;----> It is important that the trace package not use traced functions ; thus we give the functions the trace package uses different ; names and make them equivalent at this time to their ; traceable counterparts. (defun trace-startup-func nil (do ((i '( (add1 T-add1)(append T-append) (and T-and) (apply T-apply) (cond T-cond) (cons T-cons) (delq T-delq) (def T-def) (do T-do) (drain T-drain) (dtpr T-dtpr) (eval T-eval)(funcall T-funcall) (get T-get) (getd T-getd)(getdisc T-getdisc) (greaterp T-greaterp)(lessp T-lessp) (mapc T-mapc) (not T-not)(nreverse T-nreverse) (patom T-patom) (print T-print) (prog T-prog) (patom T-patom)(putd T-putd) (putprop T-putprop) (read T-read)(remprop T-remprop) (reverse T-reverse) (return T-return) (set T-set) (setq T-setq) (status T-status) (sstatus T-sstatus) (sub1 T-sub1) (terpr T-terpr) (zerop T-zerop)) (cdr i))) ((null i)) (putd (cadar i) (getd (caar i))) (putprop (cadar i) t 'Untraceable))) (trace-startup-func) (putprop 'quote t 'Untraceable) ; this prevents the common error ; of (trace 'foo) from causing big ; problems. ;--- trace - arg1,arg2, ... names of functions to trace ; This is the main user callable trace routine. ; work in progress, documentation incomplete since im not sure exactly ; where this is going. ; (def trace (nlambda (argl) (prog (if ifnot evalin evalout funnm funcd did break printargs printres evfcn traceenter traceexit) ; turn off transfer table linkages if they are on (cond ((T-status translink) (T-sstatus translink nil))) ; process each argument (do ((ll argl (cdr ll)) (funnm) (funcd)) ((null ll)) (setq funnm (car ll) if t break nil ifnot nil evalin nil evalout nil printargs nil printres nil evfcn nil traceenter 'T-traceenter traceexit 'T-traceexit) ; a list as an argument means that the user is specifying ; conditions on the trace (cond ((not (atom funnm)) (cond ((not (atom (setq funnm (car funnm)))) (T-print (car funnm)) (T-patom '" is non an function name") (go botloop))) (do ((rr (cdar ll) (cdr rr))) ((null rr)) (cond ((memq (car rr) '(if ifnot evalin evalout printargs printres evfcn traceenter traceexit)) (T-set (car rr) (cadr rr)) (setq rr (cdr rr))) ((eq (car rr) 'evalinout) (setq evalin (setq evalout (cadr rr)) rr (cdr rr))) ((eq (car rr) 'break) (setq break t)) ((eq (car rr) 'lprint) (setq printargs 'T-levprint printres 'T-levprint)) (t (T-patom '"bad request: ") (T-print (car rr)) (T-terpr)))))) ; if function is untraceable, print error message and skip (cond ((get funnm 'Untraceable) (setq did (cons `(,funnm untraceable) did)) (go botloop))) ; if function is already traced, untrace it first (cond ((get funnm 'original) (apply 'untrace `(,funnm)) (setq did (cons `(,funnm untraced) did)))) ; store the names of the arg printing routines if they are ; different than print (cond (printargs (T-putprop funnm printargs 'trace-printargs))) (cond (printres (T-putprop funnm printres 'trace-printres))) ; we must determine the type of function being traced ; in order to create the correct replacement function (cond ((setq funcd (T-getd funnm)) (cond ((bcdp funcd) ; machine code (cond ((or (eq 'lambda (T-getdisc funcd)) (eq 'nlambda (T-getdisc funcd)) (eq 'macro (T-getdisc funcd))) (setq typ (T-getdisc funcd))) ((stringp (T-getdisc funcd)) ; foreign func (setq typ 'lambda)) ; close enough (t (T-patom '"Unknown type of compiled function") (T-print funnm) (setq typ nil)))) ((dtpr funcd) ; lisp coded (cond ((or (eq 'lambda (car funcd)) (eq 'lexpr (car funcd))) (setq typ 'lambda)) ((or (eq 'nlambda (car funcd)) (eq 'macro (car funcd))) (setq typ (car funcd))) (t (T-patom '"Bad function definition: ") (T-print funnm) (setq typ nil)))) ((arrayp funcd) ; array (setq typ 'lambda)) (t (T-patom '"Bad function defintion: ") (T-print funnm))) ; now that the arguments have been examined for this ; function, do the tracing stuff. ; First save the old function on the property list (T-putprop funnm funcd 'original) ; now build a replacement (cond ((eq typ 'lambda) (T-eval `(T-def ,funnm (lexpr (T-nargs) ((lambda (T-arglst T-res T-rslt $$functions-in-trace$$ $$funcargs-in-trace$$) (T-do ((i T-nargs (T-sub1 i))) ((T-zerop i)) (T-setq T-arglst (T-cons (arg i) T-arglst))) (T-setq $$funcargs-in-trace$$ (T-cons T-arglst $$funcargs-in-trace$$)) (T-cond ((T-setq T-res (T-and ,if (T-not ,ifnot))) (,traceenter ',funnm T-arglst) ,@(cond (evalin `((T-patom ,'":in: ") ,evalin (T-terpr)))) (T-cond (,break (trace-break))))) (T-setq T-rslt ,(cond (evfcn) (t `(T-apply ',funcd T-arglst)))) (T-cond (T-res ,@(cond (evalout `((T-patom ,'":out: ") ,evalout (T-terpr)))) (,traceexit ',funnm T-rslt))) T-rslt) nil nil nil (T-cons ',funnm $$functions-in-trace$$) $$funcargs-in-trace$$)))) (setq did (cons funnm did) $$traced-functions$$ (cons funnm $$traced-functions$$))) ((or (eq typ 'nlambda) (eq typ 'macro)) (T-eval `(T-def ,funnm (,typ (T-arglst) ((lambda (T-res T-rslt $$functions-in-trace$$ $$funcargs-in-trace$$) (T-setq $$funcargs-in-trace$$ (T-cons T-arglst $$funcargs-in-trace$$)) (T-cond ((T-setq T-res (T-and ,if (not ,ifnot))) (,traceenter ',funnm T-arglst) ,evalin (T-cond (,break (trace-break))))) (T-setq T-rslt ,(cond (evfcn `(,evfcn ',funcd T-arglst)) (t `(T-apply ',funcd T-arglst)))) (T-cond (T-res ,evalout (,traceexit ',funnm T-rslt))) T-rslt) nil nil (cons ',funnm $$functions-in-trace$$) $$funcargs-in-trace$$)))) (setq did (cons funnm did) $$traced-functions$$ (cons funnm $$traced-functions$$))) (t (T-patom '"No such function as: ") (T-print funnm) (T-terpr))))) botloop ) ; if given no args, just return the function currently being traced (return (cond ((null argl) $$traced-function((s$$) (t (T-nreverse did))))))) ;--- untrace ; (untrace foo bar baz) ; untraces foo, bar and baz. ; (untrace) ; untraces all functions being traced. ; (def untrace (nlambda (argl) (cond ((null argl) (setq argl $$traced-functions$$))) (do ((i argl (cdr i)) (curf) (res)) ((null i) (cond ((null $$traced-functions$$) (setq $$functions-in-trace$$ nil) (setq $$funcargs-in-trace$$ nil))) res) (cond ((setq tmp (T-get (setq curf (car i)) 'original)) ; we only want to restore the original definition ; if this function has not been redefined! ; we can check if it has been redefined by seeing ; if its current definition is one the trace package ; would generate. (let ((funcdef (T-getd curf))) (cond ((and (dtpr funcdef) (dtpr (cadr funcdef)) (memq (caadr funcdef) '(T-nargs T-arglst))) (T-putd curf tmp)))) (T-remprop curf 'original) (T-remprop curf 'entercount) (setq $$traced-functions$$ (T-delq curf $$traced-functions$$)) (setq res (cons curf res))) (t (setq res (cons `(,curf not traced) res))))))) ;--- tracedump :: dump the currently active trace frames ; (def tracedump (lambda nil (let (($tracemute nil)) (T-tracedump-recursive $$functions-in-trace$$ $$funcargs-in-trace$$)))) ;--- traceargs :: return list of args to currently entered traced functions ; call is: ; (traceargs foo) returns first call to foo starting at most current ; (traceargs foo 3) returns args to third call to foo, starting at ; most current ; (def traceargs (nlambda (args) (cond ((and args $$functions-in-trace$$) (let ((name (car args)) (amt (cond ((numberp (cadr args)) (cadr args)) (t 1)))) (do ((fit $$functions-in-trace$$ (cdr fit)) (fat $$funcargs-in-trace$$ (cdr fat))) ((null fit)) (cond ((eq name (car fit)) (cond ((zerop (setq amt (1- amt))) (return (car fat)))))))))))) ;--- T-tracedump-recursive ; since the lists of functions being traced and arguments are in the reverse ; of the order we want to print them, we recurse down the lists and on the ; way back we print the information. ; (def T-tracedump-recursive (lambda ($$functions-in-trace$$ $$funcargs-in-trace$$) (cond ((null $$functions-in-trace$$)) (t (T-tracedump-recursive (cdr $$functions-in-trace$$) (cdr $$funcargs-in-trace$$)) (T-traceenter (car $$functions-in-trace$$) (car $$funcargs-in-trace$$)))))) ;--- T-traceenter - funnm : name of function just entered ; - count : count to print out ; This routine is called to print the entry banner for a ; traced function. ; (def T-traceenter (lambda (name args) (prog (count indent) (cond ((not $tracemute) (setq count 0 indent 0) (do ((ll $$functions-in-trace$$ (cdr ll))) ((null ll)) (cond ((eq (car ll) name) (setq count (1+ count)))) (setq indent (1+ indent))) (T-traceindent indent) (T-print count) (T-patom '" ") (T-print name) (T-patom '" ") (cond ((setq count (T-get name 'trace-printargs)) (T-funcall count args)) (t (T-print args))) (T-terpr)))))) (def T-traceexit (lambda (name res) (prog (count indent) (cond ((not $tracemute) (setq count 0 indent 0) (do ((ll $$functions-in-trace$$ (cdr ll))) ((null ll)) (cond ((eq (car ll) name) (setq count (1+ count)))) (setq indent (1+ indent))) (T-traceindent indent) (T-print count) (T-patom " ") (T-print name) (T-patom " ") (cond ((setq count (T-get name 'trace-printres)) (T-funcall count res)) (t (T-print res))) (T-terpr)))))) ; T-traceindent ; - n : indent to column n (def T-traceindent (lambda (col) (do ((i col (1- i)) (char '| |)) ((< i 2)) (T-patom (cond ((eq char '| |) (setq char '\|)) (t (setq char '| |))))))) ; trace-break - this is the trace break loop (def trace-break (lambda nil (prog (tracevalread piport) (T-terpr) (T-patom '"[tracebreak]") loop (T-terpr) (T-patom '"T>") (T-drain) (cond ((or (eq ' (setq tracevalread (car (errset (T-read nil '))))) (and (dtpr tracevalread) (eq 'tracereturn (car tracevalread)))) (T-terpr) (return nil))) (T-print (car (errset (T-eval tracevalread)))) (go loop)))) (def T-levprint (lambda (x) ((lambda (prinlevel prinlength) (print x)) 3 10))) (eval-when (eval) (apply 'sstatus `(uctolc ,old-uctolc-value)) (setq readtable old-read-table-trace) ) drain) (cond ((or (eq ' (setq tracevalread (car (errset (T-read nil '))))) (and (dtpr tracevalread) (eq 'tracereturn (car tracevalread)))) (T-terpr) (return nil)))cmd/lisp/lib/ucifnc.l 644 0 12 34375 2552720247 7775 (setq SCCS-ucifnc "@(#)ucifnc.l 1.16 7/4/81") ; ; There is problems with the ucilisp do being ; incompatible with maclisp/franz do, ; The problems with compiling do are gone, but ; due to these possible problems, the ucilisp do function ; is in a seperate file ucido.l and users of it ; should also load that file in at compile time before ; any call to do (since do is a macro) (and ; at runtime if do is to be interpreted). ; ; This file is meant to be fasl'd or used with liszt -u ; not to be read in interpretively (the syntax changes ; will not work in that case. ; ; to compile this file do liszt ucifnc.l ; ; one who wants to use these functions or compile and run ; a ucilisp program should do both ; liszt -u file.l when compiling. ; and ; (fasl '/usr/lib/lisp/ucifnc) ; before loading in and running them ; programs in lisp. ; This is because some functions are macros and others are too ; complicated and need other functions around. ; Note this file will not load in directly and when fasl'd in will ; cause the syntax of lisp to change to ucilisp syntax. ; (declare (macros t)) ; ; ucilisp (de df dm) declare function macros. ; ; (de name args body) -> declare exprs and lexprs. ; (defun de macro (l) `(defun ,@(cdr l))) ; ; (df name args body) -> declare fexprs. ; (defun df macro (l) `(defun ,(cadr l) fexpr ,@(cddr l))) ; ; macro's are not compiled except under the same ; conditions as in franz lisp. ; (usually just do (declare (macros t)) ; to have macros also compiled). ; ; ; (dm name args body) -> declare macros. same as (defun name 'macro body) ; (defun dm macro (l) `(defun ,(cadr l) macro ,@(cddr l))) ; ; ucilisp let macro. ; (eval-when (compile load eval) (defun let1 (l vars vals body) (cond ((null l) (cons (cons 'lambda (cons vars body)) vals)) (t (let1 (cddr l) (cons (car l) vars) (cons (cadr l) vals) body))))) (defun let macro (l) (let1 (cadr l) nil nil (cddr l))) (defun nconc1 macro (l) `(nconc ,(cadr l) (list ,(caddr l)))) (putd 'expandmacro (getd 'macroexpand)) ; ; ucilisp selectq function. (written by jkf) ; (def selectq (macro (form) ((lambda (x) `((lambda (,x) (cond ,@(maplist '(lambda (ff) (cond ((null (cdr ff)) `(t ,(car ff))) ((atom (caar ff)) `((eq ,x ',(caar ff)) . ,(cdar ff))) (t `((memq ,x ',(caar ff)) . ,(cdar ff))))) (cddr form)))) ,(cadr form))) (gensym 'Z)))) ; ; ucilisp functions which declare read macros. ; ; dsm - declare splicing read macro. ; (defun dsm macro (l) `(eval-when (compile load eval) (setsyntax ',(cadr l) 'splicing ',(caddr l)))) ; ; drm - declare read macro. ; (defun drm macro (l) `(eval-when (compile load eval) (setsyntax ',(cadr l) 'macro ',(caddr l)))) ; ;(:= a b) -> ucilisp assignment macro. ; (defun := macro (expression) (let (lft (macroexpand (cadr expression)) rgt (caddr expression)) (cond ((atom lft) `(setq ,lft ,(subst lft '*-* rgt))) ((get (car lft) 'set-program) (cons (get (car lft) 'set-program) (append (cdr lft) (list (subst lft '*-* rgt)))))))) (defprop car rplaca set-program) (defprop cdr rplacd set-program) (defprop cadr rplacad set-program) (defprop cddr rplacdd set-program) (defprop caddr rplacadd set-program) (defprop cadddr rplacaddd set-program) (defprop get get-set-program set-program) (defun get-set-program (atm prop val) (putprop atm val prop)) (defun rplacad (exp1 exp2) (rplaca (cdr exp1) exp2)) (defun rplacdd (exp1 exp2) (rplacd (cdr exp1) exp2)) (defun rplacadd (exp1 exp2) (rplaca (cddr exp1) exp2)) (defun rplacaddd (exp1 exp2) (rplaca (cdddr exp1) exp2)) ; ; ucilisp record-type package to declare records and field extraction ; macros. ; (declare (special *type*)) (defun record-type macro (l) (let (*type* (cadr l) *flag* (caddr l) slots (car (last l))) `(progn 'compile (defun ,*type* ,(slot-funs-extract slots (and *flag* '(d))) ,(cond ((null *flag*) (struc-cons-form slots)) (t (append `(cons ',*flag*) (list (struc-cons-form slots)))))) ,(cond (*flag* (cond ((dtpr *flag*) (setq *flag* *type*))) `(defun ,(concat 'is- *type*) macro (l) (list 'and (list 'dtpr (cadr l)) (list 'eq (list 'car (cadr l)) '',*flag*)))))))) (defun slot-funs-extract (slots path) (cond ((null slots) nil) ((atom slots) (eval `(defun ,(concat slots ': *type*) macro (l) (list ((',(readlist `(c ,@path r)) (cadr l)))) (list slots)) ((nconc (slot-funs-extract (car slots) (cons 'a path)) (slot-funs-extract (cdr slots) (cons 'd path)))))) (defun struc-cons-form (struc) (cond ((null struc) nil) ((atom struc) struc) (t `(cons ,(struc-cons-form (car struc)) ,(struc-cons-form (cdr struc)))))) (defun some macro (l) `((lambda (f a) (prog () loop (cond ((null a) (return nil)) ((funcall f (car a)) (return a)) (t (setq a (cdr a)) (go loop))))) ,(cadr l) ,(caddr l))) (declare (special vars)) (defun for macro (*l*) (let (vars (vars:for *l*) args (args:for *l*) test (test:for *l*) type (type:for *l*) body (body:for *l*)) (cons (make-mapfn vars test type body) (cons (list 'quote (make-lambda vars (add-test test (make-body vars test type body)))) args)))) (defun type:for (*l*) (let (item (item:for '(do save splice filter) *l*)) (cond (item (car item)) ((error '"No body in for loop"))))) (defun error (l x) (cond (x (terpri) (patom l) (terpri) (drain) (break) l) (t l))) (defun vars:for (*m*) (mapcan '(lambda (x) (cond ((is-var-form x) (list (var:var-form x))))) *m*)) (defun args:for (*n*) (mapcan '(lambda (x) (cond ((is-var-form x) (list (args:var-form x))))) *n*)) (defun is-var-form (x) (and (eq (length x) 3) (eq (cadr x) 'in))) (defun var:var-form (x) (car x)) (defun args:var-form (x) (caddr x)) (defun test:for (*o*) (let (item (item:for '(when) *o*)) (cond (item (cadr item))))) (defun body:for (*p*) (let (item (item:for '(do save splice filter) *p*)) (cond ((not item) (error '"NO body in for loop")) ((eq (length (cdr item)) 1) (cadr item)) ((cons 'progn (cdr item)))))) (declare (special *l* item)) (defun item:for (keywords *l*) (let (item nil) (some '(lambda (key) (setq item (assoc key (cdr *l*)))) keywords) item)) (defun make-mapfn (vars test type body) (cond ((equal type 'do) 'mapc) ((not (equal type 'save)) 'mapcan) ((null test) 'mapcar) ((subset-test vars body) 'subset) ('mapcan))) (defun subset-test (vars body) (and (equal (length vars) 1) (equal (car vars) body))) (defun make-body (vars test type body) (cond ((equal type 'filter) (list 'let (list 'x body) '(cond (x (list x))))) ((or (not (equal type 'save)) (null test)) body) ((subset-test vars body) nil) ((list 'list body)))) (defun add-test (test body) (cond ((null test) body) ((null body) test) (t (list 'cond (cond ((eq (car body) 'progn) (cons test (cdr body))) ((list test body))))))) (defun make-lambda (var body) (cond ((equal var (cdr body)) (car body)) ((eq (car body) 'progn) (cons 'lambda (cons vars (cdr body)))) ((list 'lambda vars body)))) (defun pop macro (q) `(prog (*q*) (setq *q* (car ,(cadr q))) (setq ,(cadr q) (cdr ,(cadr q))) (return *q*))) (defun length (*u*) (cond ((null *u*) 0) ((atom *u*) 0) ((add1 (length (cdr *u*)))))) (declare (special l)) (defun every macro (l) `(prog ($$k $v) (setq $$k ,(caddr l)) loop (cond ((null $$k) (return t)) ((apply ,(cadr l) (list (car $$k))) (setq $$k (cdr $$k)) (go loop))) (return nil))) (defun timer fexpr (request) (prog (timein timeout result cpu garbage) (setq timein (ptime)) (prog () loop (setq result (eval (car request))) (setq request (cdr request)) (cond ((null request) (return result)) ((go loop)))) (setq timeout (ptime)) (setq cpu (quotient (times 1000.0 (quotient (difference (car timeout) (car timein)) 60.0)) 1000.0)) (setq garbage (quotient (times 1000.0 (quotient (difference (cadr timeout) (cadr timein)) 60.0)) 1000.0)) (print (cons cpu garbage)) (terpri) (return result))) (defun addprop (id value prop) (putprop id (enter value (get id prop)) prop)) (defun enter (v l) (cond ((member v l) l) (t (cons v l)))) (defmacro subset (fun lis) `(mapcan '(lambda (ele) (cond ((funcall ,fun ele) (ncons ele)))) ,lis)) (defun push macro (varval) `(setq ,(cadr varval) (cons ,(caddr varval) ,(cadr varval)))) (putd 'consp (getd 'dtpr)) (defun prelist (a b) (cond ((null a) nil) ((eq b 0) nil) ((cons (car a) (prelist (cdr a) (sub1 b)))))) (defun suflist (a b) (cond ((null a) nil) ((eq b 0) a) ((suflist (cdr a) (sub1 b))))) (defun loop macro (l) `(prog ,(var-list (get-keyword 'initial l)) ,@(subset (function caddr) (setq-steps (get-keyword 'initial l))) loop ,@(apply (function append) (mapcar (function do-clause) (cdr l))) (go loop) exit (return ,@(get-keyword 'result l)))) (defun do-clause (clause) (cond ((memq (car clause) '(initial result)) nil) ((eq (car clause) 'while) (list (list 'or (cadr clause) '(go exit)))) ((eq (car clause) 'do) (cdr clause)) ((eq (car clause) 'next) (setq-steps (cdr clause))) ((eq (car clause) 'until) (list (list 'and (cadr clause) '(go exit)))) (t (terpri) (patom '"unknown keyword clause") (patom (car clause)) (terpri)))) (defun get-keyword (key l) (cdr (assoc key (cdr l)))) (defun var-list (r) (and r (cons (car r) (var-list (cddr r))))) (defun setq-steps (s) (and s (cons (list 'setq (car s) (cadr s)) (setq-steps (cddr s))))) (putd 'readch (getd 'readc)) ; ; ucilisp msg function. (written by jkf) ; (defmacro msg ( &rest body) `(progn ,@(mapcar '(lambda (form) (cond ((eq form t) '(line-feed 1)) ((numberp form) (cond ((greaterp form 0) `(msg-space ,form)) (t `(line-feed ,(minus form))))) ((atom form) `(patom ,form)) ((eq (car form) t) '(patom '/ )) ((eq (car form) 'e) `(patom ,(cadr form))) (t `(patom ,form)))) body))) ; ; this must be fixed to not use do. ; (defmacro msg-space (n) (cond ((eq 1 n) '(patom '" ")) (t `(do i ,n (sub1 i) (lessp i 1) (patom '/ ))))) (defmacro line-feed (n) (cond ((eq 1 n) '(terpr)) (t `(do i ,n (sub1 i) (lessp i 1) (terpr))))) (defmacro prog1 ( first &rest rest &aux (foo (gensym))) `((lambda (,foo) ,@rest ,foo) ,first)) (defun append1 (l x) (append l (list x))) ; compatability functions: functions required by uci lisp but not ; present in franz ; ; union uses the franz do loop (not the ucilisp one defined in this file). ; (def union (lexpr (n) (do ((res (arg n)) (i (sub1 n) (sub1 i))) ((zerop i) res) (mapc '(lambda (arg) (cond ((not (member arg res)) (setq res (cons arg res))))) (arg i))))) (putd 'newsym (getd 'gensym)) ; this is not exactly correct. ; it only uses the first letter of the arg. (putd 'remove (getd 'delete)) ; ignore column count (def sprint (lambda (form column) ($prpr form))) (def save (lambda (f) (putprop f (getd f) 'olddef))) (def unsave (lambda (f) (putd f (get f 'olddef)))) (putd 'atcat (getd 'concat)) (putd 'consp (getd 'dtpr)) (defun neq macro (x) `(not (eq ,@(cdr x)))) (putd 'gt (getd '>)) (putd 'lt (getd '<)) (defun le macro (x) `(not (> ,@(cdr x)))) (defun ge macro (x) `(not (< ,@(cdr x)))) (defun litatom macro (x) `(and (atom ,@(cdr x)) (not (numberp ,@(cdr x))))) (putd 'apply\# (getd 'apply)) (defun tconc (ptr x) (cond ((null ptr) (prog (temp) (setq temp (list x)) (return (setq ptr (cons temp (last temp)))))) ((null (car ptr)) (rplaca ptr (list x)) (rplacd ptr (last (car ptr))) ptr) (t (prog (temp) (setq temp (cdr ptr)) (rplacd (cdr ptr) (list x)) (rplacd ptr (cdr temp)) (return ptr))))) ; ; unbound - (setq x (unbound)) will unbind x. ; "this [code] is sick" - jkf. ; (defun unbound macro (l) `(fake -4)) ; ; ; due to problems with franz do in the compiler, this ; has been commented out and is left in a seperate ; file called /usr/lib/lisp/ucido.l ; ;(defun do macro (l) ; ((lambda (dotype alist) ; (selectq dotype ; (while (dowhile (car alist) (cdr alist))) ; (until (dowhile (list 'not (car alist)) ; (cdr alist))) ; (for (dofor (car alist) ; (cadr alist) ; (caddr alist) ; (cdddr alist))) ; `((lambda () ; ,@alist)))) ; (cadr l) ; (cddr l))) ; ;(defun dowhile (expr alist) ; `(prog (returnvar) ; loop ; (cond (,expr ; (setq returnvar ((lambda () ; ,@alist))) ; (go loop)) ; (t (return returnvar))))) ; ;(defun dofor (var fortype varlist stmlist) ; (selectq fortype ; (in `(prog (returnvar l1 l2) ; (setq l2 ',varlist) ; loop ; (setq l1 (car l2)) ; (setq l2 (cdr l2)) ; (cond ((null l1) ; (return returnvar))) ; (setq returnvar ; ((lambda (,var) ; ,@stmlist) ; (l1))) ; (go loop))) ; (on `(prog (returnvar l1 l2) ; (setq l2 ',varlist) ; loop ; (cond ((null l2) ; (return returnvar))) ; (setq returnvar ; ((lambda (,var) ; ,@stmlist) ; (l2))) ; (setq l2 (cdr l2)) ; (go loop))) ; (rpt `(prog (returnvar ,var) ; (setq ,var 1) ; loop ; (cond ((not (> ,var ,varlist)) ; (setq returnvar ((lambda () ; ,@stmlist))) ; (setq ,var (1+ ,var)) ; (go loop)) ; (t (return returnvar))))) ; nil)) ; (putd 'dddd* (getd 'boundp)) (defun boundp (l) (cond ((arrayp l)) ((dddd* l)))) ; ; now change to ucilisp syntax. ; (sstatus uctolc t) ; ; Leave backquote macro in for now. ; These characters should be declared as follows for real ; ucilisp syntax though. ;(setsyntax '\` 2) ;(setsyntax '\, 2) ;(setsyntax '\@ 201) ;(setsyntax '\@ 'macro '(lambda () (list 'quote (read)))) ; ; ~ as comment character, not ; and / instead of \ for escape (setsyntax '\~ 'splicing 'zapline) (setsyntax '\; 2) (setsyntax '\# 2) (setsyntax '\/ 143) (setsyntax '\\ 2) (setsyntax '\! 2) yp l)) ((dddd* l)))) ; ; now change to ucilisp syntax. ; (sstatus uctolc t) ; ; Leave backquote macro in for now. ; These characters should be declared as follows for real ; ucilisp syntax though. ;(setsyntax '\` 2) ;(setsyntax '\, 2) ;(setsyntax '\@ 201)((cmd/lisp/lib/Makefile 664 2 12 1273 2552755200 7761 # Makefile for /usr/lib/lisp SRCS= backquote.l auxfns0.l auxfns1.l toplevel.l machacks.l syscall.l\ ucifnc.l fix.l step.l trace.l jkfmacs.l editor.l ucido.l loop.l OBJS= backquote.o auxfns0.o auxfns1.o toplevel.o machacks.o \ ucifnc.o trace.o jkfmacs.o ucido.o step.o fix.o .SUFFIXES: .l .l.o: liszt $* > $*.blat 2>&1 all: ${OBJS} date > all ${OBJS}:/usr/lib/lisp/as /usr/lib/lisp/as: cp /bin/as /usr/lib/lisp echo WARNING: THIS MUST BE UCB AS TO WORK install: all cp $(SRCS) $(DESTDIR)/usr/lib/lisp cp $(OBJS) $(DESTDIR)/usr/lib/lisp loop.o: loop.l liszt -m loop > loop.blat 2>&1 machacks.o: machacks.l liszt -m machacks > machacks.blat 2>&1 clean: rm -f *.o *.blat all auxfns0.o auxfns1.o toplevel.o machacks.o \ ucifnc.o trace.o jkfmacs.o ucido.o step.o fix.o .SUFFIXES: .l .l.o: liszt $* > $*.blat 2>&1 all: ${OBJS} date > all ${OBJS}:/usr/lib/lisp/as /usr/lib/lisp/as: cp /bin/as /usr/lib/lisp echo WARNING: THIS MUST BE UCB AS TO WORK install: all cp $(SRCS) $(DESTDIR)/usr/licmd/lisp/lib/cs284.l 444 0 33 26271 2522750634 7366 (setq SCCS-cs284 "@(#)cs284.l 1.1 4/20/81") ; this file contains functions which were taught in cs 284 class ; and which are in the book Artificial Intelligence Programming ; Techniques by Charniak, Reisneck, and McDermott.(1980). ; ; for a detailed desciption of how they work and how to use them ; please see that book. ; ; bascially they do retrieve and insertions of patterns into ; a discrimination net. The discrimination net serves as ; a database. ; (fetch pattern database) will retrieve all patterns that ; are in the database and match pattern. ; (index pattern database) will insert the given pattern into ; the data base if it is not already there. ; (retrieve pattern database) will do the same as fetch except ; will search the database for (<- a b) rules and use these ; to match pattern a to pattern b. ; ; Also, one can put properties on property lists using the functions ; e-get and e-put. ; ; (e-get list property database) ; and (e-put list value property database) ; ; this were all the function i used outside this file for ; my plan understanding program. And all that needs to be ; understood in order to understand the file plan.l ; ; Databases are initialized by (setq databasename (link nil nil)) ; ; This file is compiled liszt cs284.l ; (-u flag is not needed since ucifnc is loaded explicitly) ; and will generally be fasl'd into a system which ; uses it. ; (declare (macros t)) (eval-when (compile eval) (fasl 'ucifnc)) (record-type pcvar *var* (sym)) (drm /? (lambda () (list '*var* (read)))) (record-type bdg nil (sym val)) (de unify (pat1 pat2) (unify1 pat1 pat2 nil)) (de unify1 (pat1 pat2 subst-so-far) (cond ((is-pcvar pat1) (var-unify pat1 pat2 subst-so-far)) ((is-pcvar pat2) (var-unify pat2 pat1 subst-so-far)) ((atom pat1) (and (equal pat1 pat2) (list subst-so-far))) ((atom pat2) nil) ((for (subst-from-car in (unify1 (car pat1) (car pat2) subst-so-far)) (splice (unify1 (cdr pat1) (cdr pat2) subst-from-car)))))) (de var-unify (v p sub) (let (bdg (sym-lookup (sym:pcvar v) sub)) (cond (bdg (unify1 (val:bdg bdg) p sub)) ((equal v p) (list sub)) ((is-pcvar v) (list (subcons (bdg (sym:pcvar v) p) sub))) ((is-pcvar p) (list (subcons (bdg (sym:pcvar p) v) sub))) ((not (occurs-in v p sub)) (list (subcons (bdg (sym:pcvar v) p) sub)))))) (de occurs-in (v p sub) (cond ((atom p) nil) ((is-pcvar p) (or (equal v p) (let (b (sym-lookup (sym:pcvar p) sub)) (and b (occurs-in v (val:bdg b) sub))))) ((some '(lambda (y) (occurs-in v y sub)) p)))) (de sym-lookup (sym sub) (assoc sym sub)) (de subcons (bdg sub) (cons bdg sub)) (record-type link nil (key . alist )) (record-type terminal nil (key . datum )) (de traverse-links (item link) (cond ((null link) nil) ((atom item) (traverse-link item link)) ((traverse-links (cdr item) (traverse-links (car item) (traverse-links '*cons* link)))))) (de traverse-link (key link) (let (temp (assoc key (alist:link link))) (cond (temp (list temp))))) (de index-off (pattern link) (for (terminal in (traverse-links2 pattern link)) (splice (:= (datum:terminal terminal) nil)))) (de index (item link) (let (terminal-link (establish-links item link)) (cond ((datum:terminal terminal-link)) (t (let (newdatum (terminal item nil)) (:= (datum:terminal terminal-link) newdatum) newdatum))))) (de e-put (exp v p database) (cond ((atom exp) (putprop exp v p)) ((putprop (index exp database) v p)))) (de e-get (exp p database) (cond ((atom exp) (list (get exp p))) (t ((lambda (y) (cond ((equal y '(nil)) nil) (t y))) (for (x in (fetch-all exp database)) (splice (list (get x p)))))))) (de establish-links (item link) (cond ((atom item) (establish-link item link)) ((is-pcvar item) (establish-link '*var* link)) ((establish-links (cdr item) (establish-links (car item) (establish-link '*cons* link)))))) (dm add-to-alist (exp) (cons 'cons (cdr exp))) (de establish-link (key link) (cond ((assoc key (alist:link link))) ((let (new-link (link key nil)) (:= (alist:link link) (add-to-alist new-link *-*)) new-link)))) (de fetch (pattern link) (for (x in (fetch-all pattern link)) (splice (copy (list (key:terminal x)))))) (de fetch-all (pattern link) (for (y in (for (terminal in (traverse-links2 pattern link)) (splice (copy (list (datum:terminal terminal)))))) (splice (cond ((unify (key:terminal y) pattern) (list y)))))) (de traverse-links2 (pattern link) (cond ((is-mvar pattern) (skip-exp link)) ((nconc (cond ((atom pattern) (traverse-link pattern link)) ((for (sub-sub in (for (sub-link in (traverse-link '*cons* link)) (splice (traverse-links2 (car pattern) sub-link)))) (splice (traverse-links2 (cdr pattern) sub-sub))))) (traverse-link '*var* link))))) (de is-mvar (l) (and (not (atom l)) (symbolp (cadr l)) (equal (car l) '*var*))) (de skip-exp (link) (for (lower-link in (alist:link link)) (splice (cond ((not (eq (key:link lower-link) '*cons*)) (list lower-link)) (t (for (l-link in (skip-exp lower-link)) (splice (skip-exp l-link)))))))) (record-type db (assertions)) (de clean-up-bdgs (request answer) (for (bdg in answer) (filter (and (occurs-in (pcvar (sym:bdg bdg)) request nil) (bdg (sym:bdg bdg) (varsubst (val:bdg bdg) answer)))))) (declare (special dis-tree)) (de retrieve (request dis-tree) (retrieve1 request)) (declare (special goal and or not eval)) (defprop and conj-retrieve retriever) (defprop or disj-retrieve retriever) (defprop not not-retrieve retriever) (defprop eval eval-retrieve retriever) (de not-retrieve (request) (cond ((retrieve1 (car request)) nil) (t '(nil)))) (de eval-retrieve (request) (cond ((eval (car request)) '(nil)))) (de disj-retrieve (disjuncts) (for (pattern in disjuncts) (splice (retrieve1 pattern)))) (de pcvar-val (pcvar sub) (let (bdg (sym-lookup (sym:pcvar pcvar) sub)) (cond (bdg (varsubst (val:bdg bdg) sub)) (t pcvar)))) (declare (special *assoclist*)) (de vars-rename (pattern) ((lambda (*assoclist*) (var-rename2 pattern)) nil)) (de var-rename2 (pat) (cond ((atom pat) pat) ((is-pcvar pat) (pick-new-var (val:bdg pat))) (t (cons (var-rename2 (car pat)) (var-rename2 (cdr pat)))))) (de pick-new-var (variable) (let (temp (assoc variable *assoclist*)) (cond ((not (symbolp variable)) nil) (temp (cadr temp)) (t (setq *assoclist* (cons (bdg variable (newvar)) *assoclist*)) (val:bdg (sym-lookup variable *assoclist*)))))) (de newvar () (list '*var* (gensym '*var*))) (de varsubst (*pattern* *sub*) (cond ((atom *pattern*) *pattern*) ((is-pcvar *pattern*) (let (temp (sym-lookup (sym:pcvar *pattern*) *sub*)) (cond (temp (varsubst (val:bdg temp) *sub*)) (t *pattern*)))) (t (cons (varsubst (car *pattern*) *sub*) (varsubst (cdr *pattern*) *sub*))))) (de retrieve1 (request) (for (temp in (cond ((null request) nil) ((and (atom (car request)) (get (car request) 'retriever)) (funcall (get (car request) 'retriever) (cdr request))) ((nconc (for (a in (fetch request dis-tree)) (splice (unify request (vars-rename a)))) (let (implpat (list '<- request '?subreq)) (for (a in (fetch implpat dis-tree)) (splice (chain implpat a)))))))) (save (clean-up-bdgs request temp)))) (de chain (implpat possibilities) (for (sub in (unify (vars-rename possibilities) implpat)) (splice (for (answer in (retrieve1 (pcvar-val '?subreq sub))) (save (append answer sub)))))) (de conj-retrieve (conjuncts) (conj-retrieve1 conjuncts nil)) (de conj-retrieve1 (conjuncts answer-so-far) (cond ((null conjuncts) (list answer-so-far)) ((for (answer in (retrieve1 (varsubst (car conjuncts) answer-so-far))) (splice (conj-retrieve1 (cdr conjuncts) (append answer (varsubst answer-so-far answer)))))))) (df mesg (l) (( (for (a in l) (do (cond ((eq a 'nl) (terpri)) ((patom (eval a))))))) ~ Here we have the form/match functions. ~ These have not been carefully debugged yet, ~ but are offered as a possible start to the user ~ and suggestions of what can be done. The user ~ should read other examples. ~ (declare (*fexpr form2 addspec)) (defun form macro (exp) `(progn 'compile (form2 ,@(cdr exp)) (dm ,(cadr exp) (l) (append (list 'form (cadr l) 'always ',(cadr exp)) (cddr l))))) (df form2 (exp) (let (name (car exp) isa (caddr exp) slots (cddddr exp)) (:= (get name 'type) 'form) (addspec-e name 'isa (cond ((eq (cadr exp) 'always) 'always) ('=)) isa) (for (slot in slots) (do (loop (initial slot-name (car slot) aspects (cdr slot)) (while aspects) (do (addspec-e name slot-name (car aspects) (cadr aspects))) (next aspects (cddr aspects))))))) (df addspec (exp) (apply 'addspec-e exp)) (de addspec-e (name slot aspect val) (:= (get slot 'slot-name) t) (let (aspect-val (assoc aspect (get name slot))) (cond (aspect-val (:= (cdr aspect-val) val)) (t (addprop name (cons aspect val) slot))))) (de slot-name-p (name) (get name 'slot-name)) (de form-p (name) (eq (get name 'type) 'form)) (declare (special *form*)) (de slot-val (*form* slot) (slot-val2 *form* slot)) (de slot-val2 (name slot) (loop (initial answer nil an-isa name) (while an-isa) (do (:= answer (cond ((get-val an-isa slot)) ((eval (get-aspect an-isa slot 'if-needed)))))) (next an-isa (get-isa an-isa)) (until answer) (result answer))) (de get-aspect (name slot aspect) (let (val (assoc aspect (get name slot))) (cond (val (cdr val))))) (de get-val (name slot) (cond ((get-aspect name slot 'always)) ((get-aspect name slot '=)))) (de get-isa (name) (get-val name 'isa)) (de match (inst pat) (cond ((equal inst pat)) ((not (and (form-p inst) (form-p pat))) nil) ((isa-p inst pat)) ((slot-by-slot-match inst pat)))) (de compatible (inst pat slot) (let (inst-val (slot-val inst slot) pat-always (slot-always pat slot)) (or (null inst-val) (null pat-always) (match inst-val pat-always)))) (declare (special inst pat)) (de slot-by-slot-match (inst pat) (every '(lambda (an-isa) (loop (initial p-list (plist an-isa) prop nil value nil p2 nil mismatch-flag nil) (while (:= prop (pop p-list))) (do (pop p-list) (cond ((and (slot-name-p prop) (not (eq prop 'isa))) (setq value (getproperty an-isa prop)) (setq p2 (getproperty inst prop)) (cond ((and p2 value (not (equal value p2))) (:= mismatch-flag t)))))) (until mismatch-flag) (result (not mismatch-flag)))) (isas pat))) (de get-p-list (atm) (plist atm)) (de isa-p (form1 form2) (member form2 (isas form1))) (de slot-always (form slot) (let (ans (some '(lambda (an-isa) (get-aspect an-isa slot 'always)) (isas form))) (cond (ans (get-aspect (car ans) slot 'always))))) (de isas (f) (loop (initial answer nil) (while f) (do (push f answer)) (next f (get-isa f)) (result (reverse answer)))) lue p2))) (:= mismatch-flag t)))))) (until mismatch-flag) (result (not mismatch-flag)))) (isas pat))) (de get-p-list (atm) (plist atm)) (de isa-p (form1 form2) (member form2 (isas form1))) (de slot-always (form slot) (let (ans (some '(lambda (an-isa) (get-aspect an-isa slot 'always)) (isas form))) cmd/lisp/lib/ucido.l 444 0 12 3517 2552720244 7576 (setq SCCS-ucido "@(#)ucido.l 1.3 6/29/81") ; ; ucilisp do loop, this is a seperate file due to conflicts with ; the franz lisp do function. To use this, one needs ; to load this file in at run time. (And have calls to ; do be close compiled in compiled code). ; ; NOTE: do is a macro and must be declared before calls to it ; in code to be compiled! ; ; to compile this file: liszt ucido.l ; (declare (macros t)) (eval-when (compile) (load 'ucifnc)) (defun do macro (l) ((lambda (dotype alist) (cond ((eq dotype 'while) (dowhile (car alist) (cdr alist))) ((eq dotype 'until) (dowhile (list 'not (car alist)) (cdr alist))) ((eq dotype 'for) (dofor (car alist) (cadr alist) (caddr alist) (cdddr alist))) (t `((lambda () ,@alist))))) (cadr l) (cddr l))) (defun dowhile (expr alist) `(prog (returnvar) loop (cond (,expr (setq returnvar ((lambda () ,@alist))) (go loop)) (t (return returnvar))))) (defun dofor (var fortype varlist stmlist) (selectq fortype (in `(prog (returnvar l1 l2) (setq l2 ',varlist) loop (setq l1 (car l2)) (setq l2 (cdr l2)) (cond ((null l1) (return returnvar))) (setq returnvar ((lambda (,var) ,@stmlist) (l1))) (go loop))) (on `(prog (returnvar l1 l2) (setq l2 ',varlist) loop (cond ((null l2) (return returnvar))) (setq returnvar ((lambda (,var) ,@stmlist) (l2))) (setq l2 (cdr l2)) (go loop))) (rpt `(prog (returnvar ,var) (setq ,var 1) loop (cond ((not (> ,var ,varlist)) (setq returnvar ((lambda () ,@stmlist))) (setq ,var (1+ ,var)) (go loop)) (t (return returnvar))))) nil)) (returnvar l1 l2) (setq l2 ',varlist) loop (cond ((null l2) (return returnvar))) (setq returnvar ((lambda (,var) ,@stmlcmd/lisp/lib/wholine.l 664 0 12 1320 2531672175 10140 ;; programs to send information to the who line of a h19 terminal ; ; call is (whofilewrite '(list of stuff to print out)) ; (setq whofilename nil wholineexists nil) (defun whofilewrite (stuff) (cond ((null wholineexists) (cond ((equal "19" (substring (getenv 'TERM) 2 2)) (setq wholineexists t)) (t (setq wholineexists 'nope))))) (cond ((eq wholineexists t) (cond ((null whofilename) (setq whofilename (concat (getenv 'HOME) "/.who")))) (cond ((errset (progn (setq whooutport (outfile whofilename)) (do ((xx stuff (cdr xx))) ((null xx) (close whooutport)) (patom (car xx) whooutport) (cond ((cdr xx) (patom " " whooutport))))))))))) (putprop 'wholine t 'version) wholineexists) (cond ((equal "19" (substring (getenv 'TERM) 2 2)) (setq wholineexists t)) (t (setq wholineexists 'nope))))) (cond ((eq wholineexists t) (cond ((null whofilename) (setq whofilename (concat (getenv 'HOME) "/.who")))) (cond ((errset (progn (setq whooutport (outfile whcmd/lisp/lib/cmulisp/ 775 0 12 0 2552745470 7713 cmd/lisp/lib/cmulisp/atest.l 644 321 12 46350 2552717554 11373 (setsyntax "#" 2) (setq playfns (quote (MyMenu MainProgram MakeWindow Get-A-String GetMouseKey YesNo Printable DoMB))) (setq MyMenu (quote (|Window Hackery| (|Play with Window| . MakeWindow) (|Draw Lines| . DrawLines) (|Save Data| . SaveData) (|| . $I$) (Quit . $R$)))) (def MainProgram (lambda nil (setq Event (ATEventAlloc)) (ATConnect 2) (ATCreateWindow -5 20 600 800 600 800 17) (ATTransmitEnable 'NULLS nil) (ATTransmitEnable 'INK nil) (ATTransmitEnable 'BOUNDS nil) (ATSetTrigger 'REPORTING nil 'NOW nil nil) (ATSetTrigger 'INKING nil 'NOW nil nil) (ATWindowHeader nil) (ATTextHome) (setq screen (ATGetWindow)) (ATSelectCaret 'CARET 50) (ATSelectFont 'HELV10B) (makemenu 'MyMenu 5 300 400) (setq saved nil) (activate) (ATCloseConnection) (exit))) (def MakeWindow (lambda nil (prog (oldwindow ans lrx ury) (setq oldwindow (ATGetWindow)) (cond ((and (boundp 'playwindow) playwindow) (ATSetWindow playwindow) (ATDeleteWindow) (setq playwindow nil) (ATSetWindow oldwindow) (return))) (ATSetWindow screen) nexy (ATPutChar 12) (ATPutString (q((uote |Click Mouse Where you want Lower Left Hand Corner of Window|)) (GetMouseKey Event) (setq x (ATGetEventX Event)) (setq y (ATGetEventY Event)) (ATPutPoint x y 'MARKCIRCLE 'BLACK 'REPLACE) (ATPutString (concat crlf 'OK?)) (cond ((not (YesNo Event)) (ATPutPoint x y 'MARKCIRCLE 'WHITE 'REPLACE) (ATPutString (concat '|...try again| crlf)) (go nexy))) (ATPutString (concat '|...Good| crlf)) nelr (ATPutString '|Click Mouse for Lower Right Hand Corner|) (GetMouseKey Event) (setq lrx (ATGetEventX Event)) (cond ((not (< x lrx)) (ATPutString (concat '|...Too much to the left, try again| crlf)) (go nelr))) (ATPutRectangle x lrx y y 'BLACK 'REPLACE) (ATPutString (concat crlf 'OK?)) (cond ((not (YesNo Event)) (ATPutRectangle x lrx y y 'WHITE 'REPLACE) (ATPutString (concat '|...try again| crlf)) (go nelr))) (ATPutString (concat '|...Good| crlf)) neur (ATPutString '|Click Mouse for Upper Right Hand Corner|) (GetMouseKey Event) (setq ury (ATGetEventY Event)) (cond ((not (< y ury)) (ATPutString (concat '|...Too low, try again| crlf)) (go neur))) (ATPutRectangle lrx lrx y ury 'BLACK 'REPLACE) (ATPutString (concat crlf 'OK?)) (cond ((not (YesNo Event)) (ATPutRectangle lrx lrx y ury 'WHITE 'REPLACE) (ATPutString (concat '|...try again| crlf)) (go neur))) (ATPutString (concat '|...Good| crlf)) (ATPutRectangle x x y ury 'BLACK 'REPLACE) (ATPutRectangle x lrx ury ury 'BLACK 'REPLACE) (ATPutString '|Still OK?|) (cond ((not (YesNo Event)) (ATPutRectangle x lrx y y 'WHITE 'REPLACE) (ATPutRectangle lrx lrx y ury 'WHITE 'REPLACE) (ATPutRectangle x x y ury 'WHITE 'REPLACE) (ATPutRectangle x lrx ury ury 'WHITE 'REPLACE) (ATPutPoint x y 'MARKCIRCLE 'WHITE 'REPLACE) (ATPutString (concat '|...back to the old drawing board!| crlf)) (go nexy))) (ATPutString (concat '|...Good| crlf)) (setq length (- ury y)) (setq width (- lrx x)) newh (ATPutString '|Click Mouse Button for Header Height|) (GetMouseKey Event) (setq headerheight (- (ATGetEventY Event) ury)) (cond ((not (plusp headerheight)) (ATPutString (concat '|...too low, try again| crlf)) (go newh))) (ATPutString (concat '|...Good| crlf)) (ATPutRectangle lrx lrx ury (+ ury headerheight) 'BLACK 'REPLACE) (ATPutRectangle x lrx (+ ury headerheight) (+ ury headerheight) 'BLACK 'REPLACE) (ATPutRectangle x x ury (+ ury headerheight) 'BLACK 'REPLACE) (ATPutString 'OK?) (cond ((not (YesNo Event)) (ATPutRectangle lrx lrx ury (+ ury headerheight) 'WHITE 'REPLACE) (ATPutRectangle x lrx (+ ury headerheight) (+ ury headerheight) 'WHITE 'REPLACE) (ATPutRectangle x x ury (+ ury headerheight) 'WHITE 'REPLACE) (ATPutString (concat '|...try again| crlf)) (go newh))) (ATPutRectangle x lrx y y 'WHITE 'REPLACE) (ATPutRectangle lrx lrx y ury 'WHITE 'REPLACE) (ATPutRectangle x x y ury 'WHITE 'REPLACE) (ATPutRectangle x lrx ury ury 'WHITE 'REPLACE) (ATPutRectangle lrx lrx ury (+ ury headerheight) 'WHITE 'REPLACE) (ATPutRectangle x lrx (+ ury headerheight) (+ ury headerheight) 'WHITE 'REPLACE) (ATPutRectangle x x ury (+ ury headerheight) 'WHITE 'REPLACE) (ATPutString (concat '|...Good| crlf)) (ATPutPoint x y 'MARKCIRCLE 'WHITE 'REPLACE) (ATTextHome) (ATCreateWindow x y width length width length headerheight) (setq playwindow (ATGetWindow)) (ATSetWindow oldwindow)))) (def Get-A-String (lambda nil (prog (temp evtype evcode lastchar xpos ypos charwidth fnth fntd event) more-chars(setq event (ATEventAlloc)) (ATGetEvent event t) (setq evtype (ATGetEventType event)) (cond ((not (equal evtype 'KEY)) (go more-chars))) (setq evcode (ATGetEventCode event)) (cond ((equal 13 evcode) (ATEventFree event) (return (implode (nreverse temp))))) (cond ((or (equal evcode 8) (equal evcode 127)) (cond ((null temp) (go more-chars))) (setq lastchar (car temp)) (setq temp (cdr temp)) (setq xpos (car (ATGetTextPos)) ypos (cdr (ATGetTextPos)) charwidth (ATGetCharWidth lastchar)) (ATSetTextPos (- xpos charwidth) ypos) (ATPutRectangle (- xpos charwidth) xpos (- ypos (or fntd (setq fntd (ATGetFntDescent)))) (+ ypos (or fnth (setq fnth (ATGetFntHeight)))) 'WHITE 'REPLACE))) (cond ((not (Printable event)) (go more-chars))) (setq temp (cons evcode temp)) (ATPutChar evcode) (go more-chars)))) (def GetMouseKey (lambda (event) (prog nil more (ATGetEvent Event t) (cond ((not (equal 'KEY (ATGetEventType event))) (go more)) ((not (< 131 (ATGetEventCode event) 135)) (go more)))))) (def YesNo (lambda (event) (prog (ans1 ans2) (setq ans1 (Get-A-String)) (setq ans2 (getchar ans1 1)) (cond ((not (or (equal ans2 'Y) (equal ans2 'y) (equal '|| ans1))) (return nil)) (t (return t)))))) (def Printable (lambda (event) (< 31 (ATGetEventCode event) 127))) (def DoMB (lambda (event minx defaultx maxx miny defaulty maxy) (prog (ansx ansy) (cond ((equal (ATGetEventMouseLeft event) 1) (setq ansx defaultx ansy defaulty)) ((equal (ATGetEventMouseMiddle event) 1) (setq ansx (ATGetEventX event) ansy (ATGetEventY event)) (cond ((not (< (|1-| minx)) (t (go hairy) nil (return (cons ansx (list ansy))) hairy X (ATPutString (concat '|Enter an X Value: (| minx '| to | maxx '|) [| defaultx '|] ?|)) (setq ansx (Get-A-String)) (cond ((not (numberp ansx)) (ATPutString (concat (quote |<-- is not a number, try again|) crlf)) (go X)) ((not (< (|1-| minx) ansx (|1+| maxx))) (ATPutString (concat (quote |<-- is not in range, try again|) crlf)) (go X))) (ATPutString crlf) Y (ATPutString (concat '|Enter a Y Value: (| miny '| to | maxy '|) [| defaulty '|] ?|)) (( (setq ansy (Get-A-String)) (cond ((not (numberp ansy)) (ATPutString (concat (quote |<-- is not a number, try again|) crlf)) (go Y)) ((not (< (|1-| miny) ansy (|1+| maxy))) (ATPutString (concat (quote |<-- is not in range, try again|) crlf)) (go Y))) (return (cons ansx (list ansy)))))))))))) (dv menufns (makemenu activate refresh killmenu massacremenus ATSoakUpEvents clear cls crlf)) (def makemenu (lambda (firstmenu length xpos ypos) (prog (oldwindow tall breadth header newwindow menu-item oldfont) (or (boundp '%MenuMap) (setq %MenuMap nil)) (setq oldwindow (ATGetWindow)) (setq oldfont (ATGetFont)) (ATSelectFont 'ASM6) (setq tall (* (ATGetFntHeight) length)) (or (boundp 'ASM6ht) (setq ASM6ht (ATGetFntHeight))) (setq breadth (+ (* (ATGetFntWidth) 20) 4)) (or (boundp 'ASM6wd) (setq ASM6wd breadth)) (ATSelectFont 'HELV10B) (setq header (+ (ATGetFntHeight) 4)) (ATSelectFont oldfont) (ATCreateWindow xpos ypos breadth tall breadth tall header) (ATTransmitEnable 'NULLS nil) (ATTransmitEnable 'INK nil) (ATTransmitEnable 'BOUNDS nil) (ATSetTrigger 'REPORTING nil 'NOW nil nil) (ATSetTrigger 'INKING nil 'NOW nil nil) (setq newwindow (ATGetWindow)) (setq %MenuMap (nconc %MenuMap (list (list newwindow firstmenu length)))) (setq menu-item (eval firstmenu)) (refresh t menu-item) (refresh nil menu-item) (ATSetWindow oldwindow) (return newwindow) ) ) ) (def activate (lambda nil (prog (oldwindow hdr win# evtype menu# itemcnt menu y menuln line# item# thingtodo newmenu) (cond ((not (boundp '%MenuMap)) (princ '|Error no Menus exist!|) (terpri) (return) ) ((null %MenuMap) (princ '|Error no Menus exist!|) (terpri) (return) ) ) (setq event (ATEventAlloc)) (ATSoakUpEvents event) loop (ATGetEvent event t) (setq evtype (ATGetEventType event)) (setq win# (ATGetEventWindow event)) (setq menu# (assoc win# %MenuMap)) (cond ((not menu#) (go loop) ) ) (setq menu (eval (cadr menu#))) (cond ((equal evtype 'EXPOSED) (cond ((not (equal 0 (ATGetEventMoreToCome event))) (go loop) ) ) (setq oldwindow (ATGetWindow)) (ATSetWindow win#) (cond ((equal 0 (ATGetEventHeader event)) (refresh nil menu) ) (t (refresh t menu) ) ) ) ((not (equal evtype 'KEY)) (go loop) ) ) (cond ((> 126 (ATGetEventCode event)) (go loop) ) ) (setq y (ATGetEventY event)) (setq menuln (|1-| (length menu))) (setq line# (/ y ASM6ht)) (setq item# (- (caddr menu#) line#)) (cond ((< item# 1) (go loop) (*** clicked in the header) ) ) (cond ((> item# menuln) (go loop) (*** below last line used) ) ) (setq oldwindow (ATGetWindow)) (ATSetWindow win#) (setq thingtodo (cdr (nth item# menu))) (cond ((equal '$I$ thingtodo) (go loop) ) ((equal '$R$ thingtodo) (return) ) ((getd thingtodo) (ATPutRectangle 0 ASM6wd (* line# ASM6ht) (* (|1+| line#) ASM6ht) 'BLACK 'INVERT) (apply (getd thingtodo) nil) (ATPutRectangle 0 ASM6wd (* line# ASM6ht) (* (|1+| line#) ASM6ht) 'BLACK 'INVERT) ) ((boundp thingtodo) (setq newmenu (list (car menu#) thingtodo (caddr menu#))) (setq %MenuMap (delete menu# %MenuMap)) (setq %MenuMap (nconc %MenuMap (list newmenu))) (refresh t (eval thingtodo)) (refresh nil (eval thingtodo)) ) ) (ATSetWindow oldwindow) (go loop) ) ) ) (def refresh (lambda (header menu) (prog (len) (cond (header (ATWindowHeader t) (ATSelectFont 'HELV10B) (ATTextHome) (clear) (ATCenterString (car menu) (/ ASM6wd 2)) (ATWindowHeader nil) ) (t (ATWindowHeader nil) (setq len (length menu)) (ATSelectFont 'ASM6) (ATTextHome) (clear) (cond ((> len 2) (for x = 1 to (- len 2) (ATPutString (concat (car (nth x menu)) crlf))) ) ) (ATPutString (car (nth (|1-| len) menu))) ) ) ) ) ) (def killmenu (lambda (menunumber) (prog (menudescr) (or (boundp '%MenuMap) (return nil)) (setq menudescr (assoc menunumber %MenuMap)) (cond ((null menudescr) (return nil) ) ) (setq %MenuMap (delete menudescr %MenuMap)) (ATSetWindow menunumber) (ATDeleteWindow) (return t) ) ) ) (def massacremenus (lambda nil (prog nil (or (boundp '%MenuMap) (return nil)) (for-each x %MenuMap (ATSetWindow (car x)) (ATDeleteWindow)) (return t) ) ) ) (def ATSoakUpEvents (lambda (event) (prog (count success) (setq count 0) loop (setq success (ATGetEvent event nil)) (cond ((equal 1 success) (setq count (|1+| count)) (go loop) ) ) (return count) ) ) ) (def clear (lambda nil (ATPutString cls) ) ) (dv cls | |) (dv crlf | |) (for-each x %MenuMap (ATSetWindow (car x)) (ATDeleteWindow)) (return t) ) ) ) (def ATSoakUpEvents (lambda (event) (prog (count success) (setq count 0) loop (setq success (ATGetEvent event nil)) (cond ((equal 1 success) cmd/lisp/lib/cmulisp/atlinks0.l 644 321 12 17547 2552717555 12007 (dv %AT-Cursor-AList ((SCROLLTRIANGLE . 1) (SCROLLDOWN . 2) (HOURGLASS . 3) (SCROLLUP . 4) (DOUBLEARROW . 5) (MARKCIRCLE . 6) (GRID . 7) (CARET . 8) (OSARROW . 9) (QUESTIONMARK . 10) (NULLCURSOR . 11) (HEAVYARROW . 12) (TRIDENT . 13) (BLOCK . 14) (POINT . 15) (HEAVYPOINT . 16) (UNDERBAR . 17) (MAXBICURSOR . 17) (DEFAULT . -1))) (dv %AT-CursorIndex-AList ((1 . SCROLLTRIANGLE) (2 . SCROLLDOWN) (3 . HOURGLASS) (4 . SCROLLUP) (5 . DOUBLEARROW) (6 . MARKCIRCLE) (7 . GRID) (8 . CARET) (9 . OSARROW) (10 . QUESTIONMARK) (11 . NULLCURSOR) (12 . HEAVYARROW) (13 . TRIDENT) (14 . BLOCK) (15 . POINT) (16 . HEAVYPOINT) (17 . UNDERBAR) (17 . MAXBICURSOR) (-1 . DEFAULT))) (dv %AT-Font-AList ((HELV10 . 1) (HELV10B . 2) (HELV18 . 3) (ASM6 . 4) (GACHA10 . 5) (MAXBIFONT . 5) (DEFAULT . -1))) (def ATCopyRectangle (lambda (left right bottom top destleft destbottom inkpattern inkmode) (%ATCopyRectangle left right bottom top destleft destbottom (cdr (assq inkpattern %AT-Ink-AList)) (cdr (assq inkmode %AT-InkMode-AList))))) (def ATCreateWindow (lambda (leftx bottomy width height minwidth minheight headheight) (%ATCreateWindow leftx bottomy width heig((ht minwidth minheight headheight))) (def ATGetBrush (lambda nil (cdr (assq (%ATGetBrush) %AT-CursorIndex-AList)))) (def ATGetCursor (lambda nil (cdr (assq (%ATGetCursor) %AT-CursorIndex-AList)))) (def ATGetEvent (lambda (event wait) (cond (wait (%ATGetEvent event 1)) ((%ATGetEvent event 0))))) (def ATGetEventType (lambda (event) (cdr (assq (%ATGetEventType event) %AT-EventTypeIndex-AList)))) (def ATGetFont (lambda nil (cdr (assq (%ATGetFont) %AT-FontIndex-AList)))) (def ATGetMode (lambda nil (cdr (assq (%ATGetMode) %AT-InkModeIndex-AList)))) (def ATPutData (lambda (left right bottom top dataarray arraylen inkmode) (%ATPutData left right bottom top dataarray arraylen (cdr (assq inkmode %AT-InkMode-AList))))) (def ATPutPoint (lambda (x y brush inkpattern inkmode) (%ATPutPoint x y (cdr (assq brush %AT-Cursor-AList)) (cdr (assq inkpattern %AT-Ink-AList)) (cdr (assq inkmode %AT-InkMode-AList))))) (def ATPutRectangle (lambda (left right bottom top inkpattern inkmode) (%ATPutRectangle left right bottom top (cdr (assq inkpattern %AT-Ink-AList)) (cdr (assq inkmode %AT-InkMode-AList))))) (def ATSelCursor (lambda (cursor) (%ATSelCursor (cdr (assq cursor %AT-Cursor-AList))))) (def ATSelectBrush (lambda (cursor) ((lambda (cursor-index) (%ATSelectBrush cursor-index)) (cdr (assq cursor %AT-Cursor-AList))))) (def ATSelectCaret (lambda (cursor millisec_rate) ((lambda (cursor_index) (%ATSelectCaret cursor_index millisec_rate)) (cdr (assq cursor %AT-Cursor-AList))))) (def ATSelectFont (lambda (font) ((lambda (fontindex) (%ATSelectFont fontindex)) (cdr (assq font %AT-Font-AList))))) (def ATSelectInk (lambda (ink) ((lambda (ink-index) (%ATSelectInk ink-index)) (cdr (assq ink %AT-Ink-AList))))) (def ATSetCurData (lambda (x y xoff yoff oldindex newindex) (%ATSetCurData x y xoff yoff (cdr (assq oldindex %AT-Cursor-AList)) (cdr (assq newindex %AT-Cursor-AList))))) (def ATSetCurPos (lambda (x y bool) (cond (bool (%ATSetCurPos x y 1)) ((%ATSetCurPos x y 0))))) (def ATSetInkData (lambda (x y oldindex) (cdr (assq (%ATSetInkData x y oldindex))))) (def ATSetMode (lambda (inkmode) ((lambda (mode-index) (%ATSetMode mode-index)) (cdr (assq inkmode %AT-InkMode-AList))))) (def ATSetScrolling (lambda (bool) (cond (bool (%ATSetScrolling 1)) ((%ATSetScrolling 0))))) (def ATSetTracking (lambda (bool) (cond (bool (%ATSetTracking 1)) ((%ATSetTracking 0))))) (def ATSetTrigger (lambda (type start key down enable) (%ATSetTrigger (cdr (assq type %AT-TriggerType-AList)) (cond (start 1) (0)) (cond ((cdr (assq key %AT-Key-AList))) (key)) (cond (down 1) (0)) (cond (enable 1) (0))))) (def ATTransmitEnable (lambda (type enable) (%ATTransmitEnable (cdr (assq type %AT-EventType-AList)) (cond (enable 1) (0))))) (def ATWindowHeader (lambda (bool) (%ATWindowHeader (cond (bool 1) (0))))) (dv DispXMax 639) (dv DispXMin 0) (dv DispYMax 807) (dv DispYMin 0) (dv FrameYMax 1615) (dv %AT-Ink-AList ((WHITE . 0) (BLACK . 1) (LIGHTGRAY . 2) (GRAY . 3) (DARKGRAY . 4) (CHECK2 . 5) (CHECK4 . 6) (VERT1 . 7) (VERT2 . 8) (VERT4 . 9) (HORIZ1 . 10) (HORIZ2 . 11) (LEFTDIAG2 . 12) (LEFTCHECK4 . 13) (RIGHTDIAG2 . 14) (RIGHTCHECK4 . 15) (MAXGRAY . 15) (HERRINGBONE . 16) (HORIZ4 . 17) (MAXBIINK . 17))) (dv %AT-InkIndex-AList ((0 . WHITE) (1 . BLACK) (2 . LIGHTGRAY) (3 . GRAY) (4 . DARKGRAY) (5 . CHECK2) (6 . CHECK4) (7 . VERT1) (8 . VERT2) (9 . VERT4) (10 . HORIZ1) (11 . HORIZ2) (12 . LEFTDIAG2) (13 . LEFTCHECK4) (14 . RIGHTDIAG2) (15 . RIGHTCHECK4) (15 . MAXGRAY) (16 . HERRINGBONE) (17 . HORIZ4) (17 . MAXBIINK))) (dv %AT-FontIndex-AList ((1 . HELV10) (2 . HELV10B) (3 . HELV18) (4 . ASM6) (5 . GACHA10) (5 . MAXBIFONT) (-1 . DEFAULT))) (dv %AT-InkMode-AList ((REPLACE . 0) (PAINT . 1) (INVERT . 2) (ERASE . 3) (DEFAULT . -1))) (def ATPutLine (lambda (endx endy brush inkpattern inkmode) (%ATPutLine endx endy (cdr (assq brush %AT-Cursor-AList)) (cdr (assq inkpattern %AT-Ink-AList)) (cdr (assq inkmode %AT-InkMode-AList))))) (def ATPutCurve (lambda (fdx fdy fddx fddy numpts inkpattern inkmode) (%ATPutCurve fdx fdy fddx fddy numpts (cdr (assq inkpattern %AT-Ink-AList)) (cdr (assq inkmode %AT-InkMode-AList))))) (def ATCopyMaskedRectangle (lambda (left right bottom top destleft destbottom inkpattern inkmode) (%ATCopyRectangle left right bottom top destleft destbottom (cdr (assq inkpattern %AT-Ink-AList)) (cdr (assq inkmode %AT-InkMode-AList))))) (dv %AT-EventType-AList ((KEY . 1) (REPORT . 2) (BOUNDS . 3) (TIMEOUT . 4) (EVENTTIMEOUT . 5) (WINDOWBOUNDS . 6) (EXPOSED . 7) (INK . 8) (NULLS . 9) (CHARS . 10) (POSITION . 11) (DESELECT . 12) (PROBE . 13))) (dv %AT-TriggerType-AList ((TIMER . 1) (INKING . 2) (REPORTING . 3))) (dv %AT-Key-AList ((IMOUSELEFT . 77) (IMOUSEMIDDLE . 79) (IMOUSERIGHT . 78) (IBLANKBOTTOM . 61) (IBLANKMIDDLE . 30) (IBLANKTOP . 31) (ICONTROL . 36) (ISHIFTLEFT . 41) (ISHIFTRIGHT . 60) (ILOCK . 56) (ANYCHAR . 80) (ANYKEY . 81) (NOW . 82))) (dv %AT-EventTypeIndex-AList ((1 . KEY) (2 . REPORT) (3 . BOUNDS) (4 . TIMEOUT) (5 . EVENTTIMEOUT) (6 . WINDOWBOUNDS) (7 . EXPOSED) (8 . INK) (9 . NULLS) (10 . CHARS) (11 . POSITION) (12 . DESELECT) (13 . PROBE))) IMOUSERIGHT . 78) (IBLANKBOTTOM . 61) (IBLANKMIDDLE . 30) (IBLANKTOP . 31) (ICONTROL . 36) (ISHIFTLEFT . 41) (ISHIFTRIGHT .cmd/lisp/lib/cmulisp/atlinks1.l 644 321 12 17631 2552717555 12002 ; This is the set of low-level links to AT functions. ; (c) Copyright 1981 Lars Ericson ; Linking functions to AT Package for LISP. ; ATConnect "i_connectno" (cfasl 'atlinker.o '_LATConnect 'ATConnect "integer-function" "-lipc -lxat -lc -lcmu") ; ATCloseConnection (getaddress '_CloseConnection 'ATCloseConnection "integer-function") ; ATSetBounds (getaddress '_LATSetBounds 'ATSetBounds "function") ; ATGetBounds (getaddress '_LATGetBounds 'ATGetBounds "function") ; ATSetTextPos (getaddress '_LATSetTextPos 'ATSetTextPos "function") ; ATGetTextPos (array ATGetTextPos-textx fixnum 1) (array ATGetTextPos-texty fixnum 1) (getaddress '_GetTextPos '%ATGetTextPos "integer-function") ; ATTextHome (getaddress '_TextHome 'ATTextHome "integer-function") ; ATSetGraphicsPos (getaddress '_LATSetGraphicsPos 'ATSetGraphicsPos "function") ; ATGetGraphicsPos (array ATGetGraphicsPos-textx fixnum 1) (array ATGetGraphicsPos-texty fixnum 1) (getaddress '_GetGraphicsPos '%ATGetGraphicsPos "integer-function") ; %ATSelectFont (getaddress '_LATSelectFont '%ATSelectFont "function") ; ATGetFont (array ATGetFontResult fixnum 1) (getaddress '_GetFont '%ATGetFont "integer-function") ; ATGetFontHeight (array ATGetFntHeightResult fixnum 1) (getaddress '_GetFntHeight '%ATGetFntHeight "integer-function") ; ATGetFontDescent (array ATGetFntDescentResult fixnum 1) (getaddress '_GetFntDescent '%ATGetFntDescent "integer-function") ; ATGetFntWidth (array ATGetFntWidthResult fixnum 1) (getaddress '_GetFntWidth '%ATGetFntWidth "integer-function") ; ATGetCharWidth (array ATGetCharWidthResult fixnum 1) (getaddress '_GetCharWidth '%ATGetCharWidth "integer-function") ; ATSelectCaret (getaddress '_LATSelectCaret '%ATSelectCaret "function") ; ATSetLeftMargin (getaddress '_LATSetLeftMargin '%ATSetLeftMargin "function") ; ATGetLeftMargin (array ATGetLeftMarginResult fixnum 1) (getaddress '_GetLeftMargin '%ATGetLeftMargin "integer-function") ; ATSetTabSpacing (getaddress '_LATSetTabSpacing '%ATSetTabSpacing "function") ; ATGetTabSpacing (getaddress '_LATGetTabSpacing '%ATGetTabSpacing "function") ; ATSetScrolling (getaddress '_LATSetScrolling '%ATSetScrolling "function") ; %ATSelectBrush (getaddress '_LATSelectBrush '%ATSelectBrush "function") ; %ATGetBrush (array %ATGetBrushResult fixnum 1) (getaddress '_GetBrush '%ATGetBrush "integer-function") ; %ATSelectInk (getaddress '_LATSelectInk '%ATSelectInk "function") ; %ATGetInk (array %ATGetInkResult fixnum 1) (getaddress '_GetInk '%ATGetInk "integer-function") ; %ATSetInkData (getaddress '_LATSetInkData '%ATSetInkData "function") ; %ATSetMode (getaddress '_LATSetMode '%ATSetMode "function") ; %ATGetMode (array %ATGetModeResult fixnum 1) (getaddress '_GetMode '%ATGetMode "integer-function") ; ATPutChar (getaddress '_LATPutChar 'ATPutChar "function") ; ATPutString (getaddress '_LATPutString 'ATPutString "function") ; ATCenterString (getaddress '_LATCenterString 'ATCenterString "function") ; ATRightJustify (getaddress '_LATRightJustify 'ATRightJustify "function") ; %ATPutPoint (getaddress '_LATPutPoint(( '%ATPutPoint "function") ; %ATPutLine (getaddress '_LATPutLine '%ATPutLine "function") ; %ATPutCurve (getaddress '_LATPutCurve '%ATPutCurve "function") ; %ATPutData (getaddress '_LATPutData '%ATPutData "function") ; %ATPutRectangle (getaddress '_LATPutRectangle '%ATPutRectangle "function") ; %ATCopyRectangle (getaddress '_LATCopyRectangle '%ATCopyRectangle "function") ; %ATCopyMaskedRectangle -- NIY ; (getaddress '_LATCopyMaskedRectangle '%ATCopyMaskedRectangle "function") ; ATAllocateExtendedScreen (getaddress '_LATAllocateExtendedScreen 'ATAllocateExtendedScreen "function") ; %ATSelCursor (getaddress '_LATSelCursor '%ATSelCursor "function") ; %ATGetCursor (array %ATGetCursorResult fixnum 1) (getaddress '_GetCursor '%ATGetCursor "integer-function") ; %ATSetCurData (getaddress '_LATSetCurData '%ATSetCurData "function") ; %ATSetCurPos (getaddress '_LATSetCurPos '%ATSetCurPos "function") ; %ATGetCurPos (array %ATGetCurPosResultX fixnum 1) (array %ATGetCurPosResultY fixnum 1) (getaddress '_GetCurPos '%ATGetCurPos "integer-function") ; %ATSetTracking (getaddress '_LATSetTracking '%ATSetTracking "function") ; ATEventAlloc (getaddress '_LATEventAlloc 'ATEventAlloc "function") ; ATEventFree (getaddress '_LATEventFree 'ATEventFree "function") ; %ATGetEventType (getaddress '_LATGetEventType '%ATGetEventType "function") ; ATGetEventWindow (getaddress '_LATGetEventWindow 'ATGetEventWindow "function") ; ATGetEventTime -- Not Implemented Yet. ; (getaddress '_LATGetEventTime 'ATGetEventTime "function") ; ATGetEventX (getaddress '_LATGetEventX 'ATGetEventX "function") ; ATGetEventY (getaddress '_LATGetEventY 'ATGetEventY "function") ; ATGetEventBlankTop (getaddress '_LATGetEventBlankTop 'ATGetEventBlankTop "function") ; ATGetEventBlankMiddle (getaddress '_LATGetEventBlankMiddle 'ATGetEventBlankMiddle "function") ; ATGetEventBlankBottom (getaddress '_LATGetEventBlankBottom 'ATGetEventBlankBottom "function") ; ATGetEventShiftRight (getaddress '_LATGetEventShiftRight 'ATGetEventShiftRight "function") ; ATGetEventControl (getaddress '_LATGetEventControl 'ATGetEventControl "function") ; ATGetEventShiftLeft (getaddress '_LATGetEventShiftLeft 'ATGetEventShiftLeft "function") ; ATGetEventLock (getaddress '_LATGetEventLock 'ATGetEventLock "function") ; ATGetEventMouseMiddle (getaddress '_LATGetEventMouseMiddle 'ATGetEventMouseMiddle "function") ; ATGetEventMouseRight (getaddress '_LATGetEventMouseRight 'ATGetEventMouseRight "function") ; ATGetEventMouseLeft (getaddress '_LATGetEventMouseLeft 'ATGetEventMouseLeft "function") ; ATGetEventReported (getaddress '_LATGetEventReported 'ATGetEventReported "function") ; ATGetEventInked (getaddress '_LATGetEventInked 'ATGetEventInked "function") ; ATGetEventGoingDown (getaddress '_LATGetEventGoingDown 'ATGetEventGoingDown "function") ; ATGetEventKeyIndex (getaddress '_LATGetEventKeyIndex 'ATGetEventKeyIndex "function") ; ATGetEventCode (getaddress '_LATGetEventCode 'ATGetEventCode "function") ; ATGetEventHeader (getaddress '_LATGetEventHeader 'ATGetEventHeader "function") ; ATGetEventMoreToCome (getaddress '_LATGetEventMoreToCome 'ATGetEventMoreToCome "function") ; ATGetEventMinX (getaddress '_LATGetEventMinX 'ATGetEventMinX "function") ; ATGetEventMaxX (getaddress '_LATGetEventMaxX 'ATGetEventMaxX "function") ; ATGetEventMinY (getaddress '_LATGetEventMinY 'ATGetEventMinY "function") ; ATGetEventMaxY (getaddress '_LATGetEventMaxY 'ATGetEventMaxY "function") ; ATGetEventMovement (getaddress '_LATGetEventMovement 'ATGetEventMovement "function") ; ATGetEventLeftX (getaddress '_LATGetEventLeftX 'ATGetEventLeftX "function") ; ATGetEventBottomY (getaddress '_LATGetEventBottomY 'ATGetEventBottomY "function") ; ATGetEventWidth (getaddress '_LATGetEventWidth 'ATGetEventWidth "function") ; ATGetEventHeight (getaddress '_LATGetEventHeight 'ATGetEventHeight "function") ; %ATGetEvent (getaddress '_LATGetEvent '%ATGetEvent "function") ; ATSetIntervalLength (getaddress '_LATSetIntervalLength 'ATSetIntervalLength "function") ; ATStartTimer (getaddress '_LATStartTimer 'ATStartTimer "function") ; %ATSetTrigger (getaddress '_LATSetTrigger '%ATSetTrigger "function") ; ATSetEventTimer (getaddress '_LATSetEventTimer 'ATSetEventTimer "function") ; ATNotifyBounds (getaddress '_LATNotifyBounds 'ATNotifyBounds "function") ; %ATTransmitEnable (getaddress '_LATTransmitEnable '%ATTransmitEnable "function") ; ATWindowProbe (getaddress '_WindowProbe 'ATWindowProbe "integer-function") ; %ATCreateWindow (getaddress '_LATCreateWindow '%ATCreateWindow "function") ; ATSetWindow (getaddress '_LATSetWindow 'ATSetWindow "function") ; ATGetWindow (array ATGetWindowResult fixnum 1) (getaddress '_GetWindow '%ATGetWindow "integer-function") ; %ATWindowHeader (getaddress '_LATWindowHeader '%ATWindowHeader "function") ; ATDeleteWindow (getaddress '_DeleteWindow 'ATDeleteWindow "integer-function") ; ATCreateConcept (getaddress '_LATCreateConcept 'ATCreateConcept "function") ; ATSetClearLine (getaddress '_LATSetClearLine 'ATSetClearLine "function") %ATCreateWindow "function") ; ATSetWindow (getaddress '_LATSetWindow 'ATSetWindow "function") ; ATGetWicmd/lisp/lib/cmulisp/atlinks2.l 644 321 12 3354 2552717555 11760 (defun ATGetTextPos () (%ATGetTextPos (getd 'ATGetTextPos-textx) (getd 'ATGetTextPos-texty)) (cons ; Forgive me, father, I know not what I do.. (maknum (ATGetTextPos-textx 0)) (maknum (ATGetTextPos-texty 0)))) (defun ATGetGraphicsPos () (%ATGetGraphicsPos (getd 'ATGetGraphicsPos-textx) (getd 'ATGetGraphicsPos-texty)) (cons ; Forgive me... (maknum (ATGetGraphicsPos-textx 0)) (maknum (ATGetGraphicsPos-texty 0)))) (defun ATGetFont () (%ATGetFont (getd 'ATGetFontResult)) (maknum (ATGetFontResult 0))) (defun ATGetFntHeight () (%ATGetFntHeight (getd 'ATGetFntHeightResult)) (maknum (ATGetFntHeightResult 0))) (defun ATGetFntDescent () (%ATGetFntDescent (getd 'ATGetFntDescentResult)) (maknum (ATGetFntDescentResult 0))) (defun ATGetFntWidth () (%ATGetFntWidth (getd 'ATGetFntWidthResult)) (maknum (ATGetFntWidthResult 0))) (defun ATGetCharWidth () (%ATGetCharWidth (getd 'ATGetCharWidthResult)) (maknum (ATGetCharWidthResult 0))) (defun ATGetLeftMargin () (%ATGetLeftMargin (getd 'ATGetLeftMarginResult)) (maknum (ATGetLeftMarginResult 0))) (defun %ATGetBrush () (%ATGetBrush (getd '%ATGetBrushResult)) (maknum (%ATGetBrushResult 0))) (defun %ATGetInk () (%ATGetInk (getd '%ATGetInkResult)) (maknum (%ATGetInkResult 0))) (defun %ATGetMode () (%ATGetMode (getd '%ATGetModeResult)) (maknum (%ATGetModeResult 0))) (defun %ATGetCursor () (%ATGetCursor (getd '%ATGetCursorResult)) (maknum (%ATGetCursorResult 0))) (defun %ATGetCurPos () (%ATGetCurPos (getd '%ATGetCurPosResultX) (getd '%ATGetCurPosResultY)) (cons ; Sow-wee... (maknum (%ATGetCurPosResultX 0)) (maknum (%ATGetCurPosResultY 0)))) (defun ATGetWindow () (%ATGetWindow (getd 'ATGetWindowResult)) (maknum (ATGetWindowResult 0))) sult 0))) (defun %ATGetMode () (%ATGetMode (getd '%ATGetModeResult)) (maknum (%ATGetModeResult 0))) (defun %ATGetCursor () (%ATGetCursor (getd '%ATGetCursorResult)) (maknum (%ATGetCursorResult 0))) (defun %ATGetCurPos () (%ATGetCurPos (getd '%ATGetCurPosResultX) cmd/lisp/lib/cmulisp/autoloader.l 644 321 12 1222 2552717556 12361 ; LWE 11/28/80 Simple function reads lists of function names from ; a list of file.l root names, with extensions file.al. It places ; each function in the list under (putprop ' ' 'autoload) (defun autoloadify (file-list) (mapc '(lambda (file) ((lambda (file-fns) (mapc '(lambda (fn) (cond ((get fn 'autoload) (princ "[") (princ fn) (princ " re-autoloadified from ") (princ (get fn 'autoload)) (princ " to ") (princ file) (princ "]")(terpri))) (putprop fn file 'autoload) ) file-fns) ) (read (infile (concat file ".al")))) ) file-list )) on in the list under (putprop ' ' 'autoload) (defun autoloadify (file-list) (mapc '(lambda (file) ((lambda (file-fns) (mapc '(lambda (fn) (cond ((get fn 'autoload) (princ "[") (princ fn) (princ " re-autoloadified from ") (princ (get fn 'autoload)) (princ " to ") (princ file) (princ cmd/lisp/lib/cmulisp/auxfns0.l 644 321 12 174777 2552717563 11676 (setq SCCS-auxfns0 "@(#)auxfns0.l 1.10 11/7/80") (setsyntax '\; 'splicing 'zapline) ; LWE 1/10/80 I put this here because it is a pain in the ass. ;--- nreverse - l : list ; reverse the list in place ; (def nreverse (lambda (x) (cond ((null x) x) (t (prog (back nxt) loop (setq nxt (cdr x)) (rplacd x back) (setq back x) (cond (nxt (setq x nxt) (go loop))) (return x)))))) ;---------------- auxfns0 --------------- ; this file contains the definitions of the most common functions. ; It sho((uld only be loaded in Opus 30 Franz Lisp. ; These functions should be loaded into every lisp. ; ;------------------------------------------------ ; preliminaries: (eval-when (eval load) (cond ((null (getd 'back=quotify)) (cond ((atom (errset (fasl '/usr/lib/lisp/backquote))) (load 'backquote)))))) (eval-when (compile) (setq macros t)) ;---- Table of Contents. ; ; I. Functions required to be defined right away ; declare append concatl max ; memq ; ; II. Macros ; catch throw defmacro (defmacrosrch,defmcroopption) ; defun desetq let (de-compose) ; let* listify sassoc unwind-protect ; ; III. Interrupt functions ; FPEINT INT ; ; IV. garbage collection functions ; prtpagesused gcafter ; ; V. the functions ; append1 assoc bigp ; comment copy copysymbol cvttomaclisp ; defprop delete delq evenp ; ex (exvi) exec exl explode ; explodec exploden expt ffasl ; filepos fixp ; flatsize floatp getchar getcharn ; getl help hunk ; last include includef ; length macroexpand makhunk member ; min ; nconc nreverse oddp plusp ; prog1 ; reverse shell sload ; sort (sorthelp,exchange2) sortcar (sortcarhelp) ; sublis (sublishelp) subst vi ; vil xcons ; ; VI. array functions ; array [macro] arracfun *array ; arraycall [macro] (ev-arraycall) ; arrcomputeint ; store [macro] (storeintern) arracfcnsimp ; arraydims fillarray ; ; VII. equivalences ; abs add chrct diff ; numbp princ remainder terpri ; typep symeval ; < = > - ; / + - *diff ; \ 1+ 1+$ 1- ; 1-$ * *$ /$ ; +$ -$ ; ;--- Section I - functions which must be declared immediately ;--- declare - ignore whatever is given, this is for the compiler ; (def declare (nlambda (x) nil)) ;--- append - x : list ; - y : list ; (declare (localf append2args)) (def append2args (lambda (x y) (prog (l l*) (cond ((null x) (return y)) ((atom x) (err (list '"Non-list to append:" x)))) (setq l* (setq l (cons (car x) nil))) loop (cond ((atom x) (err (list '"Non-list to append:" x))) ((setq x (cdr x)) (setq l* (cdr (rplacd l* (cons (car x) nil)))) (go loop))) (rplacd l* y) (return l)))) (def append (lexpr (nargs) (cond ((eq nargs 2) (append2args (arg 1) (arg 2))) ((zerop nargs) nil) (t (do ((i (1- nargs) (1- i)) (res (arg nargs))) ((zerop i) res) (setq res (append2args (arg i) res))))))) ;--- concatl - l : list of atoms ; returns the list of atoms concatentated ; (def concatl (lambda (x) (apply 'concat x))) ;--- max - arg1 arg2 ... : sequence of numbe ; returns the maximum ; (def max (lexpr (nargs) ;LWE 1/11/81 Mod after DNC. (cond ((zerop nargs)(err '"max - no args"))) (do ((i nargs (1- i)) (max (arg 1))) ((lessp i 2) max) (cond ((greaterp (arg i) max) (setq max (arg i))))))) ;--- memq - arg : (probably a symbol) ; - lis : list ; returns part of lis beginning with arg if arg is in lis ; (def memq ; LWE 1/11/81 Added DNC error test. (lambda ($a$ $l$) (do ((ll $l$ (cdr ll))) ((null ll) nil) (cond ((atom ll)(err '"memq - not a proper list")) ((eq $a$ (car ll)) (return ll)))))) ; ---Section II - macros ; ;--- catch form [tag] ; catch is now a macro which translates to (*catch 'tag form) ; (def catch (macro (l) `(*catch ',(caddr l) ,(cadr l)))) ;--- throw form [tag] ; throw isnow a macro ; (def throw (macro (l) `(*throw ',(caddr l) ,(cadr l)))) ; defmacro for franz, written 20sep79 by jkf (declare (special defmacrooptlist protect-list protect-evform)) ;--- defmacro - name - name of macro being defined ; - pattrn - formal arguments plus other fun stuff ; - body - body of the macro ; This is an intellegent macro creator. The pattern may contain ; symbols which are formal paramters, lists which show how the ; actual paramters will appear in the args, and these key words ; &rest name - the rest of the args (or nil if there are no other args) ; is bound to name ; &optional name - bind the next arg to name if it exists, otherwise ; bind it to nil ; &optional (name init) - bind the next arg to name if it exists, otherwise ; bind it to init evaluted. (the evaluation is done left ; to right for optional forms) ; &optional (name init given) - bind the next arg to name and given to t ; if the arg exists, else bind name to the value of ; init and given to nil. ; &aux name ; &aux (name init) ; ; Method of operation: ; the list returned from defmcrosrc has the form ((cxxr name) ...) ; where cxxr is the loc of the macro arg and name is it formal name ; defmcrooptlist has the form ((initv cxxr name) ...) ; which is use for &optional args with an initial value. ; here cxxr looks like cdd..dr which will test of the arg exists. ; ; the variable defmacro-for-compiling determines if the defmacro forms ; will be compiled. If it is t, then we return (progn 'compile (def xx..)) ; to insure that it is compiled ; (cond ((null (boundp 'defmacro-for-compiling)) ; insure it has a value (setq defmacro-for-compiling nil))) (def defmacro (macro (args) ((lambda (tmp tmp2 defmacrooptlist body protect-evform protect-list) (setq tmp (defmcrosrch (caddr args) '(d r) nil) body `(def ,(cadr args) (macro (defmacroarg) ((lambda ,(mapcar 'cdr tmp) ,@(mapcar '(lambda (arg) `(cond ((setq ,(caddr arg) (,(cadr arg) defmacroarg)) ,@(cond ((setq tmp2 (cadddr arg)) `((setq ,tmp2 t)))) (setq ,(caddr arg) (car ,(caddr arg)))) (t (setq ,(caddr arg) ,(car arg))))) defmacrooptlist) ,@(cond (protect-evform (setq gutz (eval `((lambda ,(mapcar 'cdr tmp) ,@(cdddr args)) ,@(mapcar '(lambda (x) `',(cdr x)) tmp)))) (ncons `(cond (,protect-evform `((lambda ,',(mapcar 'cdr tmp) ,',gutz) ,,@(mapcar 'cdr tmp))) (t ,@(cdddr args))))) (t (cdddr args)))) ,@(mapcar '(lambda (arg) (cond ((dtpr (car arg)) (caar arg)) ((car arg) `(,(car arg) defmacroarg)))) tmp))))) (cond (defmacro-for-compiling `(progn 'compile ,body)) (t body))) nil nil nil nil nil nil))) (def defmcrosrch (lambda (pat form sofar) (cond ((null pat) sofar) ((atom pat) (cons (cons (concatl `(c ,@form)) pat) sofar)) ((eq (car pat) '&rest) (append (defmcrosrch (cadr pat) form nil) (defmcrosrch (cddr pat) form sofar))) ((eq (car pat) '&optional) (defmcrooption (cdr pat) form sofar)) ((eq (car pat) '&protect) (setq protect-list (cond ((atom (cadr pat)) (ncons (cadr pat))) (t (cadr pat))) protect-evform (cons 'or (mapcar '(lambda (x) `(dtpr ,x)) protect-list))) (defmcrosrch (cddr pat) form sofar)) ((eq (car pat) '&aux) (mapcar '(lambda (frm) (cond ((atom frm) `((nil) . ,frm)) (t `((,(cadr frm)) . ,(car frm))))) (cdr pat))) (t (append (defmcrosrch (car pat) (cons 'a form) nil) (defmcrosrch (cdr pat) (cons 'd form) sofar)))))) (def defmcrooption (lambda (pat form sofar) ((lambda (tmp tmp2) (cond ((null pat) sofar) ((eq (car pat) '&rest) (defmcrosrch (cadr pat) form sofar)) (t (cond ((atom (car pat)) (setq tmp (car pat))) (t (setq tmp (caar pat)) (setq defmacrooptlist `((,(cadar pat) ,(concatl `(c ,@form)) ,tmp ,(setq tmp2 (caddar pat))) . ,defmacrooptlist)))) (defmcrooption (cdr pat) (cons 'd form) `( (,(concatl `(ca ,@form)) . ,tmp) ,@(cond (tmp2 `((nil . ,tmp2)))) . ,sofar))))) nil nil))) ;--- defun - standard maclisp function definition form. ; (def defun (macro (l) (prog (name type arglist body specind specnam) (setq name (cadr l) l (cddr l)) (cond ((dtpr name) (cond ((memq (cadr name) '(macro expr fexpr lexpr)) (setq l (cons (cadr name) l) name (car name))) (t (setq specnam (car name) specind (cadr name) name (concat (gensym) "::" specnam)))))) (cond ((null (car l)) (setq type 'lambda)) ((eq 'fexpr (car l)) (setq type 'nlambda l (cdr l))) ((eq 'expr (car l)) (setq type 'lambda l (cdr l))) ((eq 'macro (car l)) (setq type 'macro l (cdr l))) ((atom (car l)) (setq type 'lexpr l `((,(car l)) ,@(cdr l)))) (t (setq type 'lambda))) (cond ((and (eq 'lambda type) (or (memq '&aux (car l)) (memq '&optional (car l)) (memq '&rest (car l)))) (setq l (lambdacvt l) type (car l) l (cdr l)))) (setq body `(def ,name (,type ,@l))) (cond (specnam (return `(progn 'compile ,body (putprop ',specnam (getd ',name) ',specind)))) (t (return body)))))) ;--- lambdacvt ; converts a lambda expression with &optional, &rest and &aux forms in ; the argument list into a lexpr which will do the desired function. ; method of operation ; the argument list is examined and the following lists are made: ; vbs - list of variables to be lambda bound ; opl - list of optional forms ; vals - list of values to be assigned to the vbs ; (def lambdacvt (lambda (exp) (prog (arg vbs vals opl rest opflg restflg narg narg2 narg3 auxflg avbs) (do ((ll (car exp) (cdr ll)) (count 1 (1+ count))) ((null ll)) (cond ((eq '&rest (car ll)) (setq restflg t opflg nil count (1- count))) ((eq '&optional (car ll)) (setq opflg t count (1- count))) ((eq '&aux (car ll)) (setq auxflg t opflg nil restflg nil count (1- count))) (opflg (cond ((atom (setq arg (car ll))) (setq opl (cons (cons (ncons arg) count) opl) vbs (cons arg vbs) vals (cons nil vals))) ((cddr arg) (setq vbs (cons (car arg) (cons (caddr arg) vbs)) vals (cons nil (cons nil vals)) opl (cons (cons arg count) opl))) (t (setq vbs (cons (car arg) vbs) vals (c((ons nil vals) opl (cons (cons arg count) opl))))) (restflg (setq vbs (cons (car ll) vbs) vals (cons nil vals) rest (cons (car ll) count))) (auxflg (setq count (1- count)) (cond ((atom (setq arg (car ll))) (setq avbs (cons (ncons arg) avbs))) (t (setq avbs (cons arg avbs))))) (t (setq vbs (cons (car ll) vbs) vals (cons `(arg ,count) vals))))) (setq narg (gensym)) (return `(lexpr (,narg) ((lambda ,(nreverse vbs) ,@(mapcar '(lambda (arg) `(cond ((greaterp ,(cdr arg) ,narg) ,@(cond ((cadar arg) `((setq ,(caar arg) ,(cadar arg)))))) (t (setq ,(caar arg) (arg ,(cdr arg))) ,@(cond ((cddar arg) `((setq ,(caddar arg) t))))))) (nreverse opl)) ,@(cond (rest (setq narg2 (gensym) narg3 (gensym)) `((do ((,narg2 ,narg (1- ,narg2)) (,narg3 nil (cons (arg ,narg2) ,narg3))) ((lessp ,narg2 ,(cdr rest)) (setq ,(car rest) ,narg3)))))) ,@(cond (auxflg `((let* ,(nreverse avbs) ,@(cdr exp)))) (t (cdr exp)))) ,@(nreverse vals))))))) ;--- desetq ; - pattern - pattern containing vrbl names ; - expr - expression to be evaluated ; (defmacro desetq (&rest forms &aux newgen destrs) (do ((xx forms (cddr xx)) (res) (patt) (expr)) ((null xx) (cond ((null (cdr res)) (car res)) (t (cons 'progn (nreverse res))))) (setq patt (car xx) expr (cadr xx)) (setq res (cons (cond ((atom patt) `(setq ,patt ,expr)) ;trivial case (t (setq newgen (gensym) destrs (de-compose patt '(r))) `((lambda (,newgen) ,@(mapcar '(lambda (frm) `(setq ,(cdr frm) (,(car frm) ,newgen))) destrs)) ,expr))) res)))) ; let for franz (with destructuring) ;--- let ; - binds - binding forms ; - . body - forms to execute ; the binding forms may have these forms ; a local variable a, initially nil ; (a x) local variable a, x is evaled and a gets its value initially ; ((a . (b . c)) x) three local variables, a,b and c which are given ; values corresponding to the location in the value ; of x. Any structure is allowed here. ; (defmacro let (binds &rest body &aux vrbls vals destrs newgen) (mapc '(lambda (form) (cond ((atom form) (setq vrbls (cons form vrbls) vals (cons nil vals))) ((atom (car form)) (setq vrbls (cons (car form) vrbls) vals (cons (cadr form) vals))) (t (setq newgen (gensym) destrs `((,newgen ,@(de-compose (car form) '(r))) ,@destrs) vrbls (cons newgen vrbls) vals (cons (cadr form) vals))))) binds) (mapc '(lambda (frm) (do ((ll (cdr frm) (cdr ll))) ((null ll)) (setq vrbls (cons (cdar ll) vrbls) vals (cons nil vals)))) destrs) (setq vals (nreverse vals) vrbls (nreverse vrbls) destrs (nreverse destrs)) `((lambda ,vrbls ,@(mapcan '(lambda (frm) (mapcar '(lambda (vrb) `(setq ,(cdr vrb) (,(car vrb) ,(car frm)))) (cdr frm))) destrs) ,@body) ,@vals)) ;--- de-compose ; form - pattern to de-compose ; sofar - the sequence of cxxr's needed to get to this part ; of the pattern ; de-compose returns a list of this form ; ; ((cxxr . a) (cyyr . b) ... ) ; which tells how to get to the value for a and b ..etc.. ; (def de-compose (lambda (form sofar) (cond ((null form ) nil) ((atom form) (ncons (cons (apply 'concat (cons 'c sofar)) form))) (t (nconc (de-compose (car form) (cons 'a sofar)) (de-compose (cdr form) (cons 'd sofar))))))) ;--- let* ; - binds - binding forms (like let) ; - body - forms to eval (like let) ; this is the same as let, except forms are done in a left to right manner ; in fact, all we do is generate nested lets ; (defmacro let* (binds &rest body) (do ((ll (reverse binds) (cdr ll))) ((null ll) (car body)) (setq body `((let (,(car ll)) ,@body))))) ;--- listify : n - integer ; returns a list of the first n args to the enclosing lexpr if ; n is positive, else returns the last -n args to the lexpr if n is ; negative. ; (def listify (macro (lis) `(let ((n ,(cadr lis))) (cond ((minusp n) (do ((i (arg nil) (1- i)) (result nil (cons (arg i) result))) ((< i (+ (arg nil) n 1)) result) )) (t (do ((i n (1- i)) (result nil (cons (arg i) result))) ((< i 1) result) )))))) ;--- sassoc ; - x : form ; - y : assoc list ; - fcn : function or lambda expression ; If (assoc x y) is non nil, then we apply the function fcn to nil. ; This must be written as a macro if we expect to handle the case of ; a lambda expression as fcn in the compiler. ; (defmacro sassoc (x y fcn) (cond ((or (atom fcn) (not (eq 'quote (car fcn)))) `(or (assoc ,x ,y) (apply ,fcn nil))) (t `(or (assoc ,x ,y) (,(cadr fcn) nil))))) ;--- sassq ; - x : form ; - y : assoc list ; - fcn : function or lambda expression ; like sassoc above except it uses assq instead of assoc. ; (defmacro sassq (x y fcn) (cond ((or (atom fcn) (not (eq 'quote (car fcn)))) `(or (assq ,x ,y) (apply ,fcn nil))) (t `(or (assq ,x ,y) (,(cadr fcn) nil))))) ;--- signp - test - unevaluated atom ; - value - evaluated value ; test can be l, le, e, n, ge or g with the obvious meaning ; we return t if value compares to 0 by test '(def signp (macro (l) `(signphelpfcn ',(cadr l) ,(caddr l)))) (defmacro signp (tst val) (setq tst (cond ((eq 'l tst) `(minusp signp-arg)) ((eq 'le tst) `(not (greaterp signp-arg 0))) ((eq 'e tst) `(any-zerop signp-arg)) ((eq 'n tst) `(not (any-zerop signp-arg))) ((eq 'ge tst) `(not (minusp signp-arg))) ((eq 'g tst) `(greaterp signp-arg 0)) (t (error |bad arg to signp | tst)))) (cond ((atom val) `(and (numberp ,val) ,(subst val 'signp-arg tst))) (t `((lambda (signp-arg) (and (numberp signp-arg) ,tst)) ,val)))) ;-- signphelpfcn ; not needed for new code anymore (def signphelpfcn (lambda (tst val) (cond ((eq 'l tst) (minusp val)) ((eq 'le tst) (or (zerop val) (minusp val))) ((eq 'e tst) (zerop val)) ((eq 'n tst) (not (zerop val))) ((eq 'ge tst) (not (minusp val))) ((eq 'g tst) (greaterp val 0))))) ;--- unwind-protect ; The form of a call to unwind-protect is ; (unwind-protect pform ; form1 form2 ...) ; and it works as follows: ; pform is evaluated, if nothing unusual happens, form1 form2 etc are ; then evaluated and unwind-protect returns the value of pform. ; if while evaluating pform, a throw or error caught by an errset which ; would cause control to pass through the unwind-protect, then ; form1 form2 etc are evaluated and then the error or throw continues. ; Thus, no matter what happens, form1, form2 etc will be evaluated. ; (defmacro unwind-protect (protected &rest conseq &aux (localv (gensym 'G))) `((lambda (,localv) (setq ,localv (*catch 'ER%unwind-protect ,protected)) ,@conseq (cond ((and (dtpr ,localv) (eq 'ER%unwind-protect (car ,localv))) (I-throw-err (cdr ,localv))) (t ,localv))) nil)) ;----Section III -- Interrupt handlers ; (def FPEINT (lambda (x$) (error "Floating Exception "))) (def INT (lambda (dummy) (patom '"Interrupt: ") (drain poport) (break))) (signal 8 'FPEINT) (signal 2 'INT) ;---- Section IV - interrupt handlers ; (cond ((null (boundp '$gcprint)) (setq $gcprint t))) ; dont print gc stats by default ; Changed LWE 1/11/81 for newlisp. (cond ((null (boundp '$gccount$)) (setq $gccount$ 0))) ;--- prtpagesused - [arg] : type of page allocated last time. ; prints a summary of pages used for certain selected types ; of pages. If arg is given we put a star beside that type ; of page. This is normally called after a gc. ; (def prtpagesused (nlambda (arg) (patom '"[") (do ((curtypl (cond ((memq (car arg) '(list fixnum nil)) ; LWE 1/11/81 DNC claims nil is needed in case ; no arg is given. '(list fixnum)) (t (cons (car arg) '(list fixnum)))) (cdr curtypl)) (temp)) ((null curtypl) (patom '"]") (terpr poport)) (setq temp (car curtypl)) (cond ((greaterp (cadr (opval temp)) 0) (cond ((eq (car arg) temp) (patom '*))) (patom temp) (patom '":") (print (cadr (opval temp))) (patom '"{") (print (fix (quotient (times 100.0 (car (opval temp))) (* (cadr (opval temp)) (caddr (opval temp)))))) (patom '"%}") (patom '"; ")))))) (declare (special gcafter-panic-mode)) (setq gcafter-panic-mode nil) ;--- gcafter - [s] : type of item which ran out forcing garbage collection. ; This is called after each gc. ; the form of an opval element is (number_of_items_in_use ; number_of_pages_allocated ; number_of_items_per_page) ; ; (def gcafter (nlambda (s) (prog (x pct amt-to-allocate) (cond ((null s) (return))) (cond ((null (boundp '$gccount$)) (setq $gccount$ 0))) (setq $gccount$ (1+ $gccount$)) (setq x (opval (car s))) ; pct is the percentage of space used (setq pct (quotient (car x) (max .00001 (times 1.0 (cadr x) (caddr x))))) (setq amt-to-allocate (cond (gcafter-panic-mode (cond ((greaterp pct .95) (patom "[Storage space totally exausted]") (terpr) (error "Space exausted when allocating " (car s))) (t 0))) ((greaterp pct .80) (max 15 (fix (times .10 (cadr x))))) ((and (greaterp pct .30) (lessp (cadr x) 100)) 15) (t 10))) (cond ((null gcafter-panic-mode) (cond ((atom (errset (allocate (car s) amt-to-allocate))) (cond ($gcprint (patom "[Now in storage allocation panic mode]") (terpr))) (setq gcafter-panic-mode t))))) (cond ($gcprint (apply 'prtpagesused s) (comment (cond ((and (getd 'gcstat) (eq $gcprint '$all)) (print (gcstat)) (terpr))))))))) ;----Section V -(( the functions ; ;--- append - x : list ; - y : list ; [ must appear at the beginning to allow backquote to work ] ;--- append1 - x : list ; - y : lispval ; puts y at the end of list x ; (def append1 (lambda (x y) (append x (list y)))) ;--- assoc - x : lispval ; - l : list ; l is a list of lists. The list is examined and the first ; sublist whose car equals x is returned. ; (def assoc (lambda (val alist) (do ((al alist (cdr al))) ((null al) nil) (cond ((null (car al))) ((or (not (dtpr (car al))) (atom al)) ; LWE 1/11/81 Added extra type checking. (error "bad arg to assoc" al)) ((equal val (caar al)) (return (car al))))))) ;--- bigp - x : lispval ; returns t if x is a bignum ; (def bigp (lambda (arg) (equal (type arg) 'bignum))) ;--- comment - any ; ignores the rest of the things in the list (def comment (nlambda (x) 'comment)) ;--- concatl - l : list of atoms ; returns the list of atoms concatentated ; [ must appear at top to allow defmacro to work ] ;--- copy - l : list (will work if atom but will have no effect) ; makes a copy of the list. ; FIX THIS UP TO REMOVE RECURSION ON TAIL ; (def copy (lambda (l) (cond ((atom l) l) (t (cons (copy (car l)) (copy (cdr l))))))) ;--- copysymbol - sym : symbol to copy ; - flag : t or nil ; generates an uninterned symbol with the same name as sym. If flag is t ; then the value, function binding and property list of sym are placed ; in the uninterned symbol. ; (def copysymbol (lambda (sym flag) ((lambda (newsym) (cond (flag (cond ((boundp sym) (set newsym (eval sym)))) (putd newsym (getd sym)) (setplist newsym (plist sym)))) newsym) (uconcat sym)))) ;--- cvttointlisp -- convert reader syntax to conform to interlisp ; (def cvttointlisp (lambda nil (setsyntax '\% 143.) ; escape character (setsyntax '\\ 2.) ; normal character (setsyntax '\` 2.) ; normal character (setsyntax '\, 2.) ; normal character (sstatus uctolc t) ; one case )) ;--- cvttomaclisp - converts the readtable to a maclisp character syntax ; (def cvttomaclisp (lambda nil (setsyntax '\| 138.) ; double quoting char (setsyntax '\/ 143.) ; escape (setsyntax '\\ 2) ; normal char ; not needed in new lisp (setsyntax '\" 2) ; normal char (setsyntax '\[ 2) ; normal char (setsyntax '\] 2) ; normal char (sstatus uctolc t))) ;--- cvttoucilisp - converts the readtable to a ucilisp character syntax ; ; LWE 1/11/80 The mere thought of this makes me cringe. I am having ; trouble finding out who is zapping my setting of ;, so this has to go. ;(def cvttoucilisp ; (lambda nil ; (sstatus uctolc t) ; upper case to lower case ; ; change backquote character. ; ; to ` and ! and !@ from ` , and ,@ ; ; undo comma. ; (cond ((eq (status syntax \,) 205) ; (setsyntax '\! 'splicing (get '\, 'macro)))) ; (setsyntax '\, 2) ; ; ; ; ~ as comment character, not ; and / instead of \ for escape ; (setsyntax '\~ 'splicing 'zapline) ; (setsyntax '\; 2) ; (setsyntax '\/ 143) ; (setsyntax '\\ 2))) ;--- defprop - like putprop except args are not evaled ; (def defprop (nlambda (argl) (putprop (car argl) (cadr argl) (caddr argl) ))) ;--- delete ; - val - lispval ; - lst - list ; - n - Optional arg, number of occurances to delete ; removes up to n occurances of val from the top level of lst. ; if n is not given, all occurances will be removed. ; (def delete (lexpr (nargs) (prog (val lst cur ret nmb) (cond ((< nargs 2) (error " too few args to delete " nargs)) ((= nargs 3) (setq nmb (arg 3)) (cond ((not (greaterp nmb 0)) (return (arg 2)))))) (setq val (arg 1) lst (arg 2)) (cond ((and (atom lst) (not (null lst))) (error " non list arg to delete " lst))) (setq cur (cons nil lst) ret cur) loop (cond ((null lst) (return (cdr ret))) ((equal val (car lst)) (rplacd cur (cdr lst)) (cond ((and nmb (zerop (setq nmb (1- nmb)))) (return (cdr ret))))) (t (setq cur (cdr cur)))) (setq lst (cdr lst)) (go loop)))) ;--- delq ; same as delete except eq is used for testing. ; (def delq (lexpr (nargs) (prog (val lst cur ret nmb) (cond ((< nargs 2) (error " too few args to delete " nargs)) ((= nargs 3) (setq nmb (arg 3)) (cond ((not (greaterp nmb 0)) (return (arg 2)))))) (setq val (arg 1) lst (arg 2)) (cond ((and (atom lst) (not (null lst))) (error " non list arg to delete " lst))) (setq cur (cons nil lst) ret cur) loop (cond ((null lst) (return (cdr ret))) ((eq val (car lst)) (rplacd cur (cdr lst)) (cond ((and nmb (zerop (setq nmb (1- nmb)))) (return (cdr ret))))) (t (setq cur (cdr cur)))) (setq lst (cdr lst)) (go loop)))) ;--- delete - val - s-expression ; - list - list to delete fromm ; -[n] optional count , if not specified, it is infinity ; delete removes every thing in the top level of list which equals val ; the list structure is modified ; ;(def delete ; (lexpr (nargs) ; ((lambda (val list n) ; (cond ((or (null list) (zerop n)) list) ; ((atom list) (error "Bad arg to delete " list)) ; ((equal val (car list)) ; (delete val (cdr list) (1- n))) ; (t (rplacd list (delete val (cdr list) n))))) ; (arg 1) ; (arg 2) ; (cond ((equal nargs 3) (arg 3)) ; (t 99999999))))) ; ; ;--- delq - val - s-expression ; - list - list to delete fromm ; -[n] optional count , if not specified, it is infinity ; delq removes every thing in the top level of list which eq's val ; the list structure is modified ; ;(def delq ; (lexpr (nargs) ; ((lambda (val list n) ; (cond ((or (atom list) (zerop n)) list) ; ((eq val (car list)) ; (delq val (cdr list) (1- n))) ; (t (rplacd list (delq val (cdr list) n))))) ; (arg 1) ; (arg 2) ; (cond ((equal nargs 3) (arg 3)) ; (t -1))))) ; ;--- evenp : num - return ; ; (def evenp (lambda (n) (cond ((not (zerop (boole 4 1 n))) t)))) ;--- ex [name] : unevaluated name of file to edit. ; the ex editor is forked to edit the given file, if no ; name is given the previous name is used ; (def ex (nlambda (x) (exvi 'ex x nil))) (def exvi (lambda (cmd x doload) (prog (handy handyport bigname) (cond ((null x) (setq x (list edit_file))) (t (setq edit_file (car x)))) (setq bigname (concat (car x) '".l")) (cond ((setq handyport (car (errset (infile bigname) nil))) (close handyport) (setq handy bigname)) (t (setq handy (car x)))) (setq handy (concat cmd '" " handy)) (setq handy (list 'process handy)) (eval handy) (cond (doload (load edit_file)))))) ;--- exec - arg1 [arg2 [arg3 ...] ] unevaluated atoms ; A string of all the args concatenated together seperated by ; blanks is forked as a process. ; (def exec (nlambda ($list) (prog ($handy) (setq $handy (quote "")) loop (cond ((null $list) (return (eval (list (quote process) $handy)))) (t (setq $handy (concat (concat $handy (car $list)) (quote " "))) (setq $list (cdr $list)) (go loop)))))) ;--- exl - [name] : unevaluated name of file to edit and load. ; If name is not given the last file edited will be used. ; After the file is edited it will be `load'ed into lisp. ; (def exl (nlambda (x) (exvi 'ex x t))) ;----- explode functions ------- ; These functions, explode , explodec and exploden, implement the ; maclisp explode functions completely. ; They have a similar structure and are written with efficiency, not ; beauty in mind (and as a result they are quite ugly) ; The basic idea in all of them is to keep a pointer to the last ; thing added to the list, and rplacd the last cons cell of it each time. ; ;--- explode - arg : lispval ; explode returns a list of characters which print would use to ; print out arg. Slashification is included. ; (def explode (lambda (arg) (cond ((atom arg) (aexplode arg)) (t (do ((ll (cdr arg) (cdr ll)) (sofar (setq arg (cons '"(" (explode (car arg))))) (xx)) ((cond ((null ll) (rplacd (last sofar) (ncons '")" )) t) ((atom ll) (rplacd (last sofar) `(" " "." " " ,@(explode ll) ,@(ncons '")"))) t)) arg) (setq xx (last sofar) sofar (cons '" " (explode (car ll)))) (rplacd xx sofar)))))) ;--- explodec - arg : lispval ; returns the list of character which would be use to print arg assuming that ; patom were used to print all atoms. ; that is, no slashification would be used. ; (def explodec (lambda (arg) (cond ((atom arg) (aexplodec arg)) (t (do ((ll (cdr arg) (cdr ll)) (sofar (setq arg (cons '"(" (explodec (car arg))))) (xx)) ((cond ((null ll) (rplacd (last sofar) (ncons '")" )) t) ((atom ll) (rplacd (last sofar) `(" " "." " " ,@(explodec ll) ,@(ncons '")"))) t)) arg) (setq xx (last sofar) sofar (cons '" " (explodec (car ll)))) (rplacd xx sofar)))))) ;--- exploden - arg : lispval ; returns a list just like explodec, except we return fixnums instead ; of characters. ; (def exploden (lambda (arg) (cond ((atom arg) (aexploden arg)) (t (do ((ll (cdr arg) (cdr ll)) (sofar (setq arg (cons 40. (exploden (car arg))))) (xx)) ((cond ((null ll) (rplacd (last sofar) (ncons 41.)) t) ((atom ll) (rplacd (last sofar) `(32. 46. 32. ,@(exploden ll) ,@(ncons 41.))) t)) arg) (setq xx (last sofar) sofar (cons 32. (exploden (car ll)))) (rplacd xx sofar)))))) ;-- expt - x ; - y ; ; y ; returns x ; (defun expt (x y) (cond ((equal x 1) x) ((zerop x) x) ; Maclisp does this ((lessp y 0) (quotient 1.0 (expt x (times -1 y)))) ((floatp y) (exp (times y (log x)))) ; bomb out for (-3)^4 or (-3)^4.0 or 0^y. (t ; y is integer, y>= 0 (prog (res) (setq res 1(() loop (cond ((equal y 0) (return res)) ((oddp y)(setq res (times res x) y (1- y))) (t (setq x (times x x) y (/ y 2)))) (go loop))))) ;--- expt ; old '(defun expt(x y) (prog (res) (setq res 1) loop (cond ((equal y 0) (return res)) (t (setq res (times x res) y (1- y)))) (go loop))) ;--- ffasl :: fasl in a fortran file ; arg # ; 1 - fnam : file name ; 2 - entry : entry point name ; 3 - fcn : entry name ; 4 - disc : optional discipline (defun ffasl (fnam entry fcn &optional (disc 'subroutine)) (cfasl fnam entry fcn disc "-lI77 -lF77 -lm")) ; ; filepos function (maclisp compatibility) ; (defun filepos n (cond ((zerop n) nil) ((onep n) (fseek (arg 1) 0 1)) ((equal n 2) (fseek (arg 1) (arg 2) 0)))) ;--- fixp - l : lispval ; returns t if l is a fixnum or bignum ; (defun fixp (x) (or (equal (type x) 'fixnum) (equal (type x) 'bignum))) ;--- flatsize - l : lispval ; the second arg should be: ; - n : limit for what we care about ; but we dont care about this at present, since we have ; to explode the whole thing anyway. ; returns the number of characters which print would ; use to print l ; (defun flatsize n (length (explode (arg 1)))) ;--- floatp - l : lispval ; returns t if l is a flonum ; (defun floatp (x) (equal 'flonum (type x))) ;--- getchar,getcharn - x : atom ; - n : fixnum ; returns the n'th character of x's pname (the first corresponds to n=1) ; if n is negative then it counts from the end of the pname ; if n is out of bounds, nil is returned (def getchar (lambda (x n) (concat (substring x n 1)))) (def getcharn (lambda (x n) (substringn x n 0))) (def getl (lambda (atm lis) (do ((ll (cond ((atom atm) (plist atm)) (t (cdr atm))) (cddr ll))) ((null ll) nil) (cond ((memq (car ll) lis) (return ll)))))) ;--- help ; retrive selected portions of the Franz Lisp manual. ; There are four types of help offered: ; (help) prints a description of the other three options ; (help tc) prints a table of contents. ; (help n) {where n is a number or b or c} prints the whole chapter. ; (help fcn) prints info on function fcn ; ; An index to the functions is kept in the documentation directory. ; The index has entries like (append ch2.r). ; When asked to print info on a function, it locates the chapter ; using the index then asks more to locate the definition. ; (declare (localf locatefunction)) (defun help fexpr (lis) (cond ((null lis) (patom "type (help fnc) for info on function fnc")(terpr) (patom "type (help n) to see chapter n")(terpr) (patom "type (help tc) for a table of contents")(terpr)) (t (do ((ll lis (cdr ll)) (fcn)) ((null ll)) (cond ((not (atom (setq fcn (car ll)))) (patom "Bad option to help ")(print fcn)(terpr)) ((and (stringp fcn) (setq fcn (concat fcn)) nil)) ((eq fcn 'tc) (patom "Table of contents")(terpr) (patom "1 - intro; 2 - data structure; 3 - arithmetic; 4 - special")(terpr) (patom "5 - i/o; 6 - system; 7 - reader; 8 - functions; 9 - arrays")(terpr) (patom "10 - exceptions; 11 - trace package; 12 - Liszt;")(terpr) ; LWE 1/19/81 Some new stuff!... (patom "13 - toplevel and files; 14 - stepper; 15 - debugger;")(terpri) (patom "16 - editor; 17 - alto as terminal; 18 - ipc facility;")(terpri) (patom "b - special symbols; c - gc & debugging & top level ")(terpr)) ((or (and (numberp fcn) (lessp fcn 19) (greaterp fcn -1)) (memq fcn '(b c))) (apply 'process (ncons (concat '|/usr/ucb/more /usr/lisp/manual/ch| fcn '|.r|)))) ((locatefunction fcn)) (t (patom "Unknown function: ")(print fcn)(terpr))))))) (declare (special readtable)) (defun locatefunction (fc) (let (x inf ) (cond ((null (get 'append 'helplocation)) (patom "[Reading help index]")(drain) (setq inf (infile "/usr/lisp/manual/helpindex")) (do ((readtable (makereadtable t)) (x (read inf) (read inf))) ((null x) (close inf) (terpr)) (cond ((null (cddr x)) (putprop (car x) (cadr x) 'helplocation)) (t (putprop (concat (car x) " " (cadr x)) (caddr x) 'helplocation)))))) (cond ((setq x (get fc 'helplocation)) (apply 'process (ncons (concat '|/usr/ucb/more "+/(| fc '|" /usr/lisp/manual/| x))) t)))) ; ; (hunk 'g_arg1 [...'g_argn]) ; ; This function makes a hunk. The hunk is preinitialized to the ; arguments present. The size of the hunk is determined by the ; number of arguments present. ; (defun hunk n (prog (size) (setq size -1) (cond ((greaterp n 128) (error "hunk: size is too big" n)) (t (setq size (1- (haulong n))))) (cond ((minusp size) (return nil))) ;Hunk of zero length (setq size (*makhunk size)) (do ((argnum 1)) ((greaterp argnum n)) (*rplacx (1- argnum) size (arg argnum)) (setq argnum (1+ argnum))) (return size))) ;--- last - l : list ; returns the last cons cell of the list, NOT the last element ; ;(def last ; (lambda (a) ; (do ((ll a (cdr ll))) ; ((null (cdr ll)) ll)))) ; LWE 1/11/80 Added DNC's better version. (def last (lambda (a) (prog (ll) (cond ((null a)(return nil)) ((atom (setq ll a))(err '"atomic arg to last"))) lp (cond ((atom (cdr ll))(return ll)) (t (setq ll (cdr ll))(go lp] ;---- load ; LWE 1/10/80 load is a pain in the ass. ; (declare (localf load-a-file)) nuked, in case this was nuking piport (declare (special name piport)) (defun load (filename &rest fasl-args) (cond ((not (or (symbolp filename) (stringp filename))) (error "load: illegal filename " filename))) (let ( load-only fasl-only no-ext len search-path name pred) (setq len (flatc filename)) (cond ((> len 2) (cond ((eq (getchar filename (1- len)) '|.|) (cond ((eq (getchar filename len) '|o|) (setq fasl-only t)) (t (setq load-only t)))) (t (setq no-ext t)))) (t (setq no-ext t))) (cond ((and (> len 0) (eq (getchar filename 1) '/)) (setq search-path '(||))) (t (setq search-path (status load-search-path)))) (do ((xx search-path (cdr xx))) ((null xx) (error "load: file not found " filename)) (setq pred (cond ((memq (car xx) '(|| |.|)) '||) (t (concat (car xx) "/")))) (cond (no-ext (cond ((probef (setq name (concat pred filename ".o"))) (return (fasl name (car fasl-args) (cadr fasl-args)))) ((probef (setq name (concat pred filename ".l"))) (return (load-a-file name))) ((probef (setq name (concat pred filename))) (return (load-a-file name))))) (fasl-only (cond ((probef (setq name (concat pred filename))) (return (fasl name (car fasl-args) (cadr fasl-args)))))) (load-only (cond ((probef (setq name (concat pred filename))) (return (load-a-file name))))))))) (defun load-a-file (name) ; Fixed, because we LIKE our piport. (prog (piport eof) (setq piport (infile name)) (setq eof (list nil)) (do ((form (read piport eof) (read piport eof))) ((eq eof form) (close piport) t) (eval form)))) (sstatus load-search-path (|.| /usr/lib/lisp)) ;--- include - read in the file name given, the name not evaluated ; (def include (nlambda (l) (load (car l)))) ;--- includef - read in the file name given and eval the first arg ; (def includef (lambda (l) (load l))) ;--- length - l : list ; returns the number of elements in the list. ; ; (def length ; (lambda ($l$) ; (cond ((null $l$) 0) ; (t (do ((ll (cdr $l$) (cdr ll)) ; (i 1 (1+ i))) ; ((null ll) i)))))) ; LWE 1/11/81 DNC's imported hack to catch atoms like Maclisp. (def length (lambda ($l$) (do ((ll $l$ (cdr ll)) (i 0 (add1 i))) ((null ll) i) (cond ((atom ll)(err '"non-list to length"] ;--- macroexpand - form ; expands out all macros it can ; (def macroexpand (lambda (form) (prog nil top (cond ((atom form) (return form)) ((atom (car form)) (return (let ((nam (car form)) def disc) (setq def (getd nam)) (setq disc (cond ((bcdp def) (getdisc def)) (t (car def)))) (cond ((memq disc '(nlambda lambda lexpr nil)) (cons nam (mapcar 'macroexpand (cdr form)))) ((eq disc 'macro) (setq form (apply nam form)) (go top)))))) (t (return (cons (macroexpand (car form)) (mapcar 'macroexpand (cdr form))))))))) ; ; (makhunk 'n) ; ; This function is similar to hunk, except that: ; ; n can be a fixnum, which specifies the length of the hunk. ; The hunk is preinitialized to nil's ; n can be a list which is used to preinitialize the hunk. ; (defun makhunk (n) (prog (size Hunk) (setq size -1) (cond ((numberp n) ; ; If n is a number then build a nil hunk of the right size ; (cond ((greaterp n 128) (error "makhunk: size is too big" n)) (t (setq size (1- (haulong n))))) (cond ((minusp size) (return nil))) (setq Hunk (*makhunk size)) (do ((i 0 (1+ i))) ((equal i n)) (*rplacx i Hunk nil)) (return Hunk)) ; ; If it isn't a number, then try hunk on it ; (t (apply 'hunk n))))) ;--- member - VAL : lispval ; - LIS : list ; returns that portion of LIS beginning with the first occurance ; of VAL if VAL is found at the top level of list LIS. ; uses equal for comparisons. ; ; LWE 1/11/81 Added DNC's error checking. (def member (lambda ($a$ $l$) (do ((ll $l$ (cdr ll))) ((null ll) nil) (cond ((atom ll)(err '"member - not a proper list")) ((equal $a$ (car ll)) (return ll)))))) ;--- memq - arg : (probably a symbol) ; - lis : list ; returns part of lis beginning with arg if arg is in lis ; ; [ defintion moved to top of file to allow backquote macro to work ] ;--- min - arg1 ... numbers ; ; returns minimum of n numbers. ; ; LWE 1/11/81 Added DNC's error check. (def min (lexpr (nargs) (cond ((zerop nargs)(err '"min - no args"))) (do ((i nargs (1- i)) (min (arg 1))) ((lessp i 2) min) (cond ((lessp (arg i) min) (setq min (arg i))))))) ;--- nconc - x1 x2 ...: lists ; The cdr of the last cons cell of xi is set to xi+1. This is(( the ; structure modification version of append ; (def nconc (lexpr (nargs) (cond ((eq nargs '2) (cond ((null (arg 1)) (arg 2)) (t (do ((tmp (arg 1) (cdr tmp))) ((null (cdr tmp)) (rplacd tmp (arg 2)) (arg 1)))))) ((zerop nargs) nil) (t (do ((i 1 nxt) (nxt 2 (1+ nxt)) (res (cons nil (arg 1)))) ((eq i nargs) (cdr res)) (cond ((arg i) (rplacd (last (arg i)) (arg nxt))) (t (rplacd (last res) (arg nxt))))))))) ; (def oddp (lambda (n) (cond ((not (zerop (boole 1 1 n))) t)))) ;--- plusp : x - number ; returns t iff x is greater than zero (def plusp (lambda (x) (greaterp x 0))) ;--- princ : l - any s-expression ; [p] - port to write to ; prints using patom for atoms (unslashified) ; (def princ (lexpr (n) (prog (port val) (cond ((eq n 2) (setq port (arg 2)))) (cond ((dtpr (setq val (arg 1))) (cond ((and (eq 'quote (car val)) (dtpr (cdr val)) (null (cddr val))) (patom "'") (princ (cadr val))) (t (patom "(" port) (do ((xx val)) ((null xx) (patom ")" port)) (princ (car xx) port) (cond ((null (setq xx (cdr xx)))) ((not (dtpr xx)) (patom " . " port) (princ xx port) (setq xx nil)) (t (patom " " port))))))) (t (patom val port))) (return t)))) ;--- prog1 : return the first value computed in a list of forms ; (def prog1 (lexpr (n) (arg 1))) ;--- reverse : l - list ; returns the list reversed using cons to create new list cells. ; (def reverse (lambda (x) (cond ((null x) nil) (t (do ((cur (cons (car x) nil) (cons (car res) cur)) (res (cdr x) (cdr res))) ((null res) cur)))))) ;--- shell - invoke a new c shell ; (def shell (lambda nil ((lambda (shellname) (cond ((lessp (flatc shellname) 1) (setq shellname 'csh))) (apply 'process (ncons shellname))) (getenv 'SHELL)))) ;--- sload : fn - file name (must include the .l) ; loads in the file printing each result as it is seen ; (def sload (lambda (fn) (prog (por) (cond ((setq por (infile fn))) (t (patom '"bad file name")(terpr)(return nil))) (do ((x (read por) (read por))) ((eq 'eof x)) (print x) (eval x))))) ; these is the old sort functions (comment (defun sort(a fun) (prog (n) (cond ((null a) (return nil)) ;no elements (t (setq n (length a)) (do i 1 (1+ i) (greaterp i n)(sorthelp a fun)) (return a) )))) (defun sorthelp (a fun) (do ((ii a (cdr ii))) ((null (cdr ii))) (cond ((funcall fun (cadr ii) (car ii)) (exchange2 ii))))) ) ;---- bubble merge sort ; it recursively splits the list to sort until the list is small. At that ; point it uses a bubble sort. Finally the sorted lists are merged. (declare (special sort-function)) ;--- sort :: sort a lisp list ; args: lst - list of items ; fcn - function to compare two items. ; returns: the list with such that for each pair of adjacent elements, ; either the elements are equal, or fcn applied to the two ; args returns a non nil value. ; (defun sort (lst fcn) (setq sort-function fcn) ; store function name in global cell ; (setq sort-compares 0) ; count number of comparisons (sortmerge lst (length lst))) ;--- sortmerge :: utility routine to sort ; args: lst - list of items to sort ; nitems - a rough idea of how many items are in the list ; ; result - sorted list (see the result of sort above) ; (defun sortmerge (lst nitems) (prog (tmp tmp2) (cond ((greaterp nitems 7) ; do a split and merge (setq tmp (splitlist lst (setq tmp2 (quotient nitems 2)))) (return (mergelists (sortmerge (car tmp) tmp2) (sortmerge (cdr tmp) tmp2)))) (t ; do a bubble sort (do ((l lst (cdr l)) (fin)) ((null l)) (do ((ll lst (cdr ll))) ((eq fin (cdr ll)) (setq fin ll)) ;(setq sort-compares (1+ sort-compares)) (cond ((not (funcall sort-function (car ll) (cadr ll))) (rplaca ll (prog1 (cadr ll) (rplaca (cdr ll) (car ll)))))))) (return lst))))) ;--- splitlist :: utility routine to split a list ; args : lst - list to split ; spliton - number of items to put in the first list ; ; returns: a cons cell whose car is the first part of the list ; and whose cdr is the second part. ; (defun splitlist (lst spliton) (prog (second) (do ((i spliton (sub1 i)) (l lst)) ((or (null (cdr l)) (zerop i)) (setq second (cdr l)) (rplacd l nil)) (setq l (cdr l))) (return (cons lst second)))) ;--- mergelists ::utility routine to merge two lists based on predicate function ; args: ls1 - lisp list ; ls2 - lisp list ; sort-function (global) - compares items of the lists ; ; returns: a sorted list containing the elements of the two lists. ; (defun mergelists (ls1 ls2) (prog (result current) ; initialize (setq current (setq result (cons nil nil))) loop (cond ((null ls1) (rplacd current ls2) (return (cdr result))) ((null ls2) (rplacd current ls1) (return (cdr result))) ((funcall sort-function (car ls1) (car ls2)) ;(setq sort-compares (1+ sort-compares)) (rplacd current ls1) (setq current ls1 ls1 (cdr ls1))) (t ;(setq sort-compares (1+ sort-compares)) (rplacd current ls2) (setq current ls2 ls2 (cdr ls2)))) (go loop))) ;--- end bubble merge sort (defun sortcar (a fun) (prog (n) (cond ((null a) (return nil)) ;no elements (t (setq n (length a)) (do i 1 (1+ i) (greaterp i n)(sortcarhelp a fun)) (return a) )))) (defun sortcarhelp (a fun) (cond ((null (cdr a)) a) ((funcall fun (caadr a) (caar a)) (exchange2 a) (sortcarhelp (cdr a) fun)) (t (sortcarhelp (cdr a) fun)))) (defun exchange2 (a) (prog (temp) (setq temp (cadr a)) (rplaca (cdr a) (car a)) (rplaca a temp))) ;--- sublis: alst - assoc list ((a . val) (b . val2) ...) ; exp - s-expression ; for each atom in exp which corresponds to a key in alst, the associated ; value from alst is substituted. The substitution is done by adding ; list cells, no struture mangling is done. Only the minimum number ; of list cells will be created. ; (def sublis (lambda (alst exp) (let (tmp) (cond ((atom exp) (cond ((setq tmp (assoc exp alst)) (cdr tmp)) (t exp))) ((setq tmp (sublishelp alst exp)) (car tmp)) (t exp))))) ;--- sublishelp : alst - assoc list ; exp - s-expression ; this function helps sublis work. it is different from sublis in that ; it return nil if no change need be made to exp, or returns a list of ; one element which is the changed exp. ; (def sublishelp (lambda (alst exp) (let (carp cdrp) (cond ((atom exp) (cond ((setq carp (assoc exp alst)) (list (cdr carp))) (t nil))) (t (setq carp (sublishelp alst (car exp)) cdrp (sublishelp alst (cdr exp))) (cond ((not (or carp cdrp)) nil) ; no change ((and carp (not cdrp)) ; car change (list (cons (car carp) (cdr exp)))) ((and (not carp) cdrp) ; cdr change (list (cons (car exp) (car cdrp)))) (t ; both change (list (cons (car carp) (car cdrp)))))))))) ;--- subst : new - sexp ; old - sexp ; pat - sexp ; substitutes in patrn all occurrences equal to old with new and returns the ; result ; MUST be put in the manual (declare (special new old)) (def subst (lambda (new old pat) (cond ((symbolp old) (substeq pat)) (t (substequal pat))))) ;use this function for substituting for symbols (def substeq (lambda (pat) (cond ((eq old pat) new) ((atom pat) pat) (t (cons (substeq (car pat))(substeq (cdr pat))))))) (def substequal (lambda (pat) (cond ((equal old pat) new) ((atom pat) pat) (t (cons (substequal (car pat)) ; in interlisp, the next line would be ;(substeq (cdr pat)) ; for maclisp compatibility, we do this. (substequal (cdr pat))))))) (declare (unspecial new old)) ;--- vi: arg is unevaluated name of function to run vi on ; (def vi (nlambda (x) (exvi 'vi x nil))) ;--- vil : arg is unevaluated, edits file and then loads it ; (def vil (nlambda (x) (exvi 'vi x t))) ;--- xcons : a - sexp ; b - sexp ; returns (b . a) that is, it is an exchanged cons ; (def xcons (lambda (a b) (cons b a))) ;--- Section VI - ARRAY functions . ; (def array (macro ($lis$) `(*array ',(cadr $lis$) ',(caddr $lis$) ,@(cdddr $lis$)))) ;--OLD array stuff. new stuff to follow ; array access function ; ; (def arracfun ; (lambda (actlst ardisc) ; (prog (diml ind val) ; ; (setq actlst (mapcar 'eval actlst) ; diml (getaux ardisc)) ; ; (cond ((null (equal (length actlst) ; (length (cdr diml)))) ; (break '"Wrong number of indexes to array ref")) ; ; (t (setq ind (arrcomputeind (cdr actlst) ; (cddr diml) ; (car actlst)) ; val (arrayref ardisc ind)) ; (cond ((or (eq (car diml) t) ; (eq (car diml) 'unmarked_array)) ; (setq val (eval val))) ; (t (setq val (cpy1 val)))) ; (return val)))))) ; ; ; ; ;(def *array ; (lexpr (nargs) ; (prog (name type rtype dims size tname) ; ; (setq name (arg 1) ; type (arg 2) ; rtype (cond ((null type) (setq type 'unmarked_array) ; 'value) ; ((equal type t) ; 'value) ; (t type)) ; dims (do ((i 3 (1+ i)) ; (res nil (cons (arg i) res))) ; ((greaterp i nargs) (nreverse res))) ; size (apply 'times dims)) ; ; (setq tname (marray (segment rtype size) ; (getd 'arracfun) ; (cons type dims) ; size ; (sizeof rtype))) ; (cond (name (set name tname) ; (putd name tname))) ; '(fillarray tname (cond ((eq type 'fixnum) '(0)) ; ((eq type 'flonum) '(0.0)) ; (t '(nil)))) ; (return tname)))) ; ;(defmacro arraycall (type name &rest indexs) ; `(ev-arraycall ',type ,name (list ,@ indexs))) ; ; ;(def ev-arraycall ; (lambda (type ardisc indexs) ; ; form (arraycall type name sub1 sub2 ... subn) ; (cond ((or (not (equa((l (car (getaux ardisc)) type)) ; (and (eq (car (getaux ardisc)) 'unmarked_array) ; type)) ; ; (patom '" Type given arraycall:") ; (patom type) ; (patom '" doesn't match array type:") ; (patom (car (getaux ardisc))) ; (break nil))) ; (apply (getaccess ardisc) ; (list indexs ardisc)))) ; ; ; ; ;; function to compute the raw array index ; ;(def arrcomputeind ; (lambda (indl diml res) ; (cond ((null diml) res) ; (t (arrcomputeind (cdr indl) ; (cdr diml) ; (+ (* res (car diml)) ; (car indl))))))) ; ;; store ;; we make store a macro to insure that all parts are evaluated at the ;; right time even if it is compiled. ;; (store (foo 34 i) (plus r f)) ;; gets translated to ;; (storeintern foo (plus r f) (list 34 i)) ;; and storeintern is a lambda, so when foo is evaluated it will pass the ;; array descriptor to storeintern, so storeintern can look at the ;; aux part to determine the type of array. ;; ;(defmacro store ( (arrname . indexes) value) ; (prog nil ; ; loop ; (cond ; ((eq 'funcall arrname) ; (setq arrname `(getd ,(car indexes)) ; indexes (cdr indexes))) ; ((eq 'arraycall arrname) ; (setq arrname (cadr indexes) ; indexes (cddr indexes))) ; ((and ((lambda (fnd) ; (cond ((or (and (dtpr fnd) (eq 'macro (car fnd))) ; (and (bcdp fnd) (eq 'macro (getdisc fnd)))) ; (setq fnd (apply arrname (cons arrname indexes))) ; (setq arrname (car fnd) ; indexes (cdr fnd))))) ; (getd arrname)) ; (go loop))) ; (t (setq arrname `(getd ',arrname)))) ; (return `(storeintern ,arrname ,value (list ,@indexes))))) ; ;;-- storeintern - internal store function ;; - arrnam : array descriptor ;; - vl : value to store ;; - actlst : list of actual variable values ;; ;(def storeintern ; (lambda (arrnam vl actlst) ; (prog (loc) ; (cond ((or (eq t (car (getaux arrnam))) ; (eq 'unmarked_array (car (getaux arrnam)))) ; (setq loc (arracfcnsimp actlst arrnam)) ; (set loc vl)) ; ; (t (replace (arracfcnsimp actlst arrnam) vl))) ; (return vl)))) ; ; ;(def arracfcnsimp ; (lambda (indexes adisc) ; (prog (dims) ; (setq dims (cdr (getaux adisc))) ; (cond ((null (equal (length indexes) ; (length dims))) ; (break '"wrong number of indexes to array")) ; (t (setq dims (arrcomputeind (cdr indexes) ; (cdr dims) ; (car indexes))))) ; (return (arrayref adisc dims))))) ; ; ;; new array package (jkf 9/24/80) ; features of the new package: ; Most array will be notype arrays. This is because they are the most ; efficient in Franz. What used to be fixnum and flonums arrays are ; now fixnum-block and flonum-block arrays. ; The array access functions are more specialized and much faster now. ; The array access functions have different semantics. Now they are ; responsible for both accessing and storing in an array. ; When an access function is asked to access a value, it will be given ; the subscripts already evaluated and the array object. These will ; be stacked, so the array access function should be a lexpr to read them. ; When an access function is asked to store a value that value will be ; the first argument, the subscripts will follow and finally there will ; be the array object. ; It is up to the access function to determine if it is being asked to ; store or retrieve a value, and this determination will probably ; be made by looking at the number of arguments. (declare (special gcdisable)) (def *array (lexpr (nargs) (prog (name type rtype dims size tname numdims) (cond ((lessp (setq numdims (- nargs 2)) 1) (error "no bounds to array declaration "))) (setq name (arg 1) type (arg 2) rtype (cond ((memq type '(t nil fixnum flonum)) 'value) ((eq type 'fixnum-block) 'fixnum) ((eq type 'flonum-block) 'flonum) (t (error "array: bad type: " type))) dims (do ((i nargs (1- i)) (res nil (cons (arg i) res))) ((eq i 2) res)) size (apply 'times dims)) (cond ((null type) (setq type 'unmarked_array))) ; we disable gc during the next calculation since ; the data returned from small-segment is unprotected ; and a gc would cause its data to be put on the ; free list. (let ((gcdisable t)) (setq tname (marray (small-segment rtype size) (cond ((eq rtype 'value) (cond ((eq numdims 1) (getd 'arrac-oneD)) ((eq numdims 2) (getd 'arrac-twoD)) (t (getd 'arrac-nD)))) (t (getd 'arrac-nD))) (cons type dims) size (sizeof rtype)))) ; if type is fixnum or flonum ; we must intialize to 0 or 0.0 (cond ((or (and (eq 'fixnum type) (setq rtype 0)) (and (eq 'flonum type) (setq rtype 0.0))) (do ((i size)) ((zerop i)) (set (arrayref tname (setq i (1- i))) rtype)))) (cond (name (putd name tname))) (return tname)))) (defmacro arraycall (type array &rest indexes) `(funcall ,array ,@indexes)) ; this is used by the old array scheme. Keep this around until ; everything is recompiled (defun ev-arraycall (type array indexes) (apply array indexes)) ;;;---- array access functions. ; we first define a macro to evaluate a value cell. In compiled code cdr ; is the fastest way to do this, in interpreted code the type checker ; would not let us use cdr so we have to use eval. (eval-when (compile) (defmacro value-eval (x) `(cdr ,x))) ; one level of indirection (eval-when (eval) (defun value-eval (x) (eval x))) ;- one dimensional (defun arrac-oneD n (cond ((eq n 2) (value-eval (arrayref (arg 2) (arg 1)))) ((eq n 3) (set (arrayref (arg 3) (arg 2)) (arg 1))) (t (error " wrong number of subscripts to array: " (arg n))))) (defun arrac-twoD n (let ((aux (getaux (arg n)))) (cond ((eq n 3) (value-eval (arrayref (arg n) (+ (* (arg 1) (caddr aux)) (arg 2))))) ((eq n 4) (set (arrayref (arg n) (+ (* (arg 2) (caddr aux)) (arg 3))) (arg 1))) (t (error " wrong number of subscripts to array: " (arg n)))))) ;-- n dimensional array access function. (defun arrac-nD n (let ((aux (getaux (arg n))) firstsub subs store (index 0)) (setq subs (length (cdr aux))) (cond ((eq n (1+ subs)) (setq firstsub 1)) ((eq n (+ 2 subs)) (setq firstsub 2 store t)) (t (error "wrong number of subscripts to array: " (arg n)))) (setq index (arg firstsub)) (do ((bounds (cddr aux) (cdr bounds)) (i firstsub)) ((null bounds)) (setq index (+ (* index (car bounds)) (arg (setq i (1+ i)))))) (setq subs (arrayref (arg n) index)) ; get cell requested (cond ((memq (car aux) '(fixnum-block flonum-block)) (cond (store (replace subs (arg 1))) (t (cpy1 subs)))) (t (cond (store (set subs (arg 1))) (t (value-eval subs))))))) (defmacro store ( (arrname . indexes) value) (prog (defered) loop (cond ((eq 'funcall arrname) (setq arrname (car indexes) indexes (cdr indexes) defered t)) ((eq 'arraycall arrname) (setq arrname (cadr indexes) indexes (cddr indexes) defered t)) ((and ((lambda (fnd) (cond ((or (and (dtpr fnd) (eq 'macro (car fnd))) (and (bcdp fnd) (eq 'macro (getdisc fnd)))) (setq fnd (apply arrname (cons arrname indexes))) (setq arrname (car fnd) indexes (cdr fnd))))) (getd arrname)) (go loop)))) (return (cond (defered `(funcall ,arrname ,value . ,indexes)) (t `(,arrname ,value . ,indexes)))))) ;-- storeintern - there may be residual calls to storeintern from ; old code, we handle it here. this routine can be eliminated when ; code is recompiled (defun storeintern (arrnam value indexes) (apply arrnam (cons value indexes))) ;--- small segment storage allocators. ; this function allocates segments of storage and attempt to use the whole ; block instead of throwing away what isnt used ; (declare (special gcdisable)) (defun small-segment (type n) (prog (lastseg retv elementsize itemsperpage-1 gcdisable tmp) (setq gcdisable t) ; its not a good idea to gc while we are ; handling pointers to things segment returns. (desetq (elementsize . itemsperpage-1) (get 'segment-sizes type)) (cond ((null elementsize) (error "small-segment: bad type " type))) (setq lastseg (get 'segment-types type)) (cond ((and lastseg (not (lessp (car lastseg) n)))) (t ; must allocate a block of storage, want to the least number of ; pages which includes n elements ; there are elementsize elements per page, and ; itemsperpage-1 is the number of elements on a page minus 1 (setq retv (boole 4 (+ n itemsperpage-1) itemsperpage-1)) ; 4 is x & ~y (setq lastseg (cons retv (maknum (segment type retv)))))) (setq retv (cdr lastseg)) (rplaca lastseg (- (car lastseg) n)) (rplacd lastseg (+ (cdr lastseg) (* elementsize n))) (cond ((greaterp (car lastseg) 0) (putprop 'segment-types lastseg type) (cond ((null (setq tmp (get 'segment-arrays type))) (putprop 'segment-arrays (setq tmp (marray nil nil nil nil nil)) type))) (putdata tmp (fake (cdr lastseg))) (putlength tmp (car lastseg)) (putdelta tmp elementsize)) (t ; remove all counters since we no longer have any space ; left and we can't have a zero length array (remprop 'segment-types type) (remprop 'segment-arrays type))) (return (fake retv)))) ; data base for small-segment (putprop 'segment-sizes '( 4 . 127) 'value) (putprop 'segment-sizes '( 4 . 127) 'fixnum) (putprop 'segment-sizes '( 8 . 63) 'flonum) (def arraydims (lambda (arg) (cond ((symbolp arg) (getaux (getd arg))) ((arrayp arg) (getaux arg)) (t (break '"non array arg to arraydims"))))) ; fill array from list or array (def fillarray (lambda (arr lis) (prog (maxv typept) (cond ((symbolp arr) (setq arr (getd arr)))) (cond ((symbolp lis) (setq lis (getd lis)) (return (fillarrayarray arr lis))) ((arrayp lis) (return (fillarrayarray arr lis)))) (((setq maxv (1- (getlength arr)) typept (cond ((memq (car (getaux arr)) '(t fixnum flonum unmarked_array)) t) (t nil))) (do ((ls lis) (i 0 (1+ i))) ((greaterp i maxv)) (cond (typept (set (arrayref arr i) (car ls))) (t (replace (arrayref arr i) (car ls)))) (cond ((cdr ls) (setq ls (cdr ls)))))))) (def fillarrayarray (lambda (arrto arrfrom) (prog (maxv) (setq maxv (1- (min (getlength arrto) (getlength arrfrom)))) (do ((i 0 (1+ i))) ((greaterp i maxv)) (replace (arrayref arrto i) (arrayref arrfrom i)))))) (def listarray (lexpr (n) (prog (arr size typ ret) (setq arr (arg 1)) (cond ((and (symbolp arr) (arrayp (setq arr (getd arr))))) ((arrayp arr)) ;; LWE fix 1/24/81 for Marty Herman (t (error "Non array to listarray " arr))) (setq size (cond ((eq n 2) (arg 2)) (t (apply '* (cdr (arraydims arr)))))) (setq typ (car (getaux arr))) (cond ((memq typ '(t fixnum flonum unmarked_array)) (setq typ t)) (t (setq typ nil))) (do ((i (1- size) (1- i))) ((lessp i 0)) (setq newv (arrayref arr i)) (setq ret (cons (cond (typ (eval newv)) (t (cpy1 newv))) ret))) (return ret)))) ;---Section VII - equivalances------------------- ; (putd 'abs (getd 'absval)) (putd 'add (getd 'sum)) (putd 'chrct (getd 'charcnt)) (putd 'diff (getd 'difference)) (putd 'numbp (getd 'numberp)) (putd 'remainder (getd 'mod)) (putd 'terpri (getd 'terpr)) (putd 'typep (getd 'type)) (putd 'symeval (getd 'eval)) (putd '< (getd 'lessp)) (putd '= (getd 'equal)) (putd '> (getd 'greaterp)) (putd '- (getd 'difference)) (putd '\/ (getd 'quotient)) (putd '\+ (getd 'add)) (putd '*dif (getd 'difference)) (putd '\\ (getd 'mod)) (putd '\1+ (getd 'add1)) (putd '\1+$ (getd 'add1)) (putd '\1- (getd 'sub1)) (putd '\1-$ (getd 'sub1)) (putd '* (getd 'times)) (putd '*$ (getd 'times)) (putd '/$ (getd 'quotient)) (putd '+$ (getd 'add)) (putd '-$ (getd 'difference)) ecmd/lisp/lib/cmulisp/auxfns1.l 644 321 12 23733 2552717563 11640 (setq SCCS-auxfns1 "@(#)auxfns1.l 1.1 10/2/80") ; LWE 1/20/81 Restoring old definition of msg. ; LWE 1/17/81 Hack for old users of msg. ;(def N (lambda (x) (cond ((lessp x 1))(t (terpri)(N (1- x] ; LWE 1/17/81 More hacking for compiler happiness. ;--- msg - arg1 ... arguments of the form described below ; B - print out a blank ; N - print out a newline (terpr) ; (B n) - print out n blanks ; (P p) - henceforth print on port p ; atom - patom this exactly (no evaluation) ; other - evaluate and patom this expression. ; ;(def msg ; (macro (lis) ; `(progn ,@(msgmake (cdr lis) 'nil)))) ; ;(eval-when (eval compile load) ; (def msgmake ; (lambda (forms outport) ; ((lambda (thisform) ; ; (cond ((null forms) `((drain ,@outport))) ; ((and (eq 'B thisform) (setq thisform '" ") nil)) ; ((eq 'N thisform) (cons `(terpr ,@outport) ; (msgmake (cdr forms) outport))) ; ((atom thisform) (cons `(patom ',thisform ; ,@outport) ; (msgmake (cdr forms) outport))) ; ((eq 'P (car thisform)) (msgmake (cdr forms) ; `(,@(cdr thisform)))) ; ; ((eq 'B (car thisform)) (cons `(printblanks ,@(cdr thisform) ; ,outport) ; (msgmake (cdr forms) outport))) ; (t (cons `(patom ,thisform ,@outport) ; (msgmake (cdr forms) outport))))) ; (car forms))))) (declare (special $cur$ $outport$ linel poport lpar rpar)) ; LWE 1/20/81 Here is the CMU version: ;================================================================= ;-DNC : now we will try to provide a msg function for the users. ; (E exp) - eval exp and don't print ; (T n) - tab to col n ; (N n) - n terpris ; (B n) - n blanks ; string - princ the string ; other - eval and print ; ; The printing is all done to port $outport$ ; (def msg (nlambda(l) (mapc (function (lambda (exp) (cond ((stringp exp)(princ exp $outport$)) ((not (dtpr exp))(princ (eval exp) $outport$)) ((eq (car exp) 'E) (eval (cadr exp))) ((eq (car exp) 'T) (tab (eval (cadr exp)) $outport$)) ((eq (car exp) 'N) (do ((i (eval (cadr exp)) (sub1 i))) ((lessp i 1)) (terpri $outport$))) ((eq (car exp) 'B) (printblanks (eval (cadr exp)) $outport$)) (t (princ (eval exp) $outport$))))) l) nil)) (def printblanks (lambda (n prt) (do ((i n (1- i))) ((lessp i 1)) (patom '" " prt)))) ; ============================================== ; ; (linelength [numb]) ; ; sets the linelength (actually just varib linel) to the ; number given: numb ; if numb is not given, the current line length is returned ; ================================================= (setq linel 80) (def linelength (nlambda (form) (cond ((null form) linel ) ((numberp (car form)) (setq linel (car form))) (t linel)))) ; ======================================== ; ; (charcnt port) ; returns the number of characters left on the current line ; on the given port ; ; ======================================= (def charcnt (lambda (port) (- linel (nwritn port)))) (def nthcdr (lambda (n x) (cond ((zerop n) x) ((lessp n 0) (cons nil x)) (t (nthcdr (1- n) (cdr x) ))))) (def nth (lambda (n x) (car (nthcdr n x)))) ;r lambda: (nthrest numb list) ;- args: numb - integer ;- list - list ;- returns:the rest of the list beginning at the numb'th element. ;- for convience, (nthrest 0 list) equals (nthrest 1 list) ;- equals list. This is designed to be similar to nthelem ;- which returns the nth element of a list. (def nthrest (lambda (number list) (cond ((lessp number 2) list) (t (nthrest (1- number) (cdr list)))))) ;;============================== ; (assqr val alist) ; acts much like assq, it looks for val in the cdr of elements of ; the alist and returns the element if found. ; fix this when the compiler works (eval-when nil (def assqr (lambda (val alist) (do ((al alist (cdr al))) ((null al) nil) (cond ((eq val (cdar al)) (return (car al)))))))) ; ==================== ; (listp 'x) is t if x is a non-atom or nil ; ==================== (def listp (lambda (val) (or (dtpr val) (null val)))) ;--- memcar - VAL : lispval ; - LIS : list ; returns t if VAL found as the car of a top level element. ;temporarily turn this off till the compiler can handle it. (eval-when nil (def memcar (lambda (a l) (do ((ll l (cdr ll))) ((null ll) nil) (cond ((equal (caar ll) a) (return (cdar ll)))))))) ; ================================= ; ; (memcdr 'val 'listl) ; ; the list listl is searched for a list ; with cdr equal to val. if found, the ; car of that list is returned. ; ================================== ;fix this when compiler works ok (eval-when nil (def memcdr (lambda (a l) (do ((ll l (cdr ll))) ((null ll) nil) (cond ((equal (cdar ll) a) (return (caar l)))))))) ;this looks like funcall, so we will just use it '(def apply* (nlambda ($x$) (eval (cons (eval (car $x$)) (cdr $x$))))) (putd 'apply* (getd 'funcall)) ; ======================================= ; pretty printer top level routine pp ; ; calling form- (pp arg1 arg2 ... argn) ; the args may be names of functions, atoms with associated values ; or output descriptors. ; if argi is: ; an atom - it is assumed to be a function name, if there is no ; function property associated with it,then it is assumed ; to be an atom with a value ; (P port)- port is the output port where the results of the ; pretty printing will be sent. ; poport is the default if no (P port) is given. ; (F fname)- fname is a file name to write the results in ; (A atmname) - means, treat this as an atom with a value, dont ; check if it is the name of a function. ; (declare (special $outport$ $fileopen$ )) ; printret is like print yet it returns the value printed, this is used ; by pp (def printret (macro ($l$) `(progn (print ,@(cdr $l$)) ,(cadr $l$)))) (def pp (nlambda ($xlist$) (prog ($outport$ $cur$ $fileopen$ $prl$ $atm$ funcdef) (setq $outport$ poport) ; default port ; check if more to do, if not close output file if it is ; open and leave toploop (cond ((null (setq $cur$ (car $xlist$))) (condclosefile) (return t))) (cond ((dtpr $cur$) (cond ((equal 'P (car $cur$)) ; specifying a port (condclosefile) ; close file if open (setq $outport$ (eval (cadr $cur$)))) ((equal 'F (car $cur$)) ; specifying a file (condclosefile) ; close file if open (setq $outport$ (outfile (cadr $cur$)) $fileopen$ t)) ((equal 'A (car $cur$)) ; declaring atomness (setq $atm$ t) (setq $cur$ (cadr $cur$)) (go midstuff)) ((eq 'V (car $cur$)) ; print value only (setq $atm$ 'value) (setq $cur$ (cadr $cur$)) (go midstuff)) (t (msg (N 1) "bad arg to pp: " (or $cur$)))) (go botloop))) midstuff ; process the atom or function (cond ((eq 'value $atm$) (setq $prl$ (eval $cur$))) ((or $atm$ (null (getd $cur$))) ; check if is atom (cond ((boundp $cur$) ; yes, see if bound (setq $prl$ (list 'setq $cur$ (list 'quote (eval $cur$))))) (t (msg (N 1) "pp: atom " (or $cur$) " is unbound") (go botloop)))) ((bcdp (setq funcdef (getd $cur$))) ; is a fcn, see if bcd (msg (N 1) "pp: function " (or $cur$) " is machine coded (bcd) ") (go botloop)) ((and (dtpr funcdef) (dtpr (cadr funcdef)) (memq (caadr funcdef) '(T-nargs T-arglist)) (((setq $prl$ (list 'def $cur$ (get $cur$ 'original))))) (t (setq $prl$ (list 'def $cur$ funcdef)))) ; now print it ($prpr $prl$) (terpr $outport$) (setq $atm$ nil) ; clear flag botloop (setq $xlist$ (cdr $xlist$)) (go toploop)))) (def condclosefile (lambda nil (cond ($fileopen$ (terpr $outport$) (close $outport$) (setq $fileopen$ nil))))) ; ; these routines are meant to be used by pp but since ; some people insist on using them we will set $outport$ to nil ; as the default (setq $outport$ nil) (def $prpr (lambda (x) (cond ((not (boundp '$outport$)) (setq $outport$ poport))) (terpr $outport$) ($prdf x 0 0))) (declare (special m)) (def $prdf (lambda (l n m) (prog () ($tocolumn n) a (cond ((or (atom l) (lessp (+ m (flatc l (charcnt $outport$))) (charcnt $outport$))) (return (printret l $outport$))) ((and ($patom1 lpar) (lessp 2 (length l)) (atom (car l))) (prog (c f g h) (setq g (cond ((member (car l) '(lambda nlambda)) -7) (t 0))) (setq f (equal (printret (car l) $outport$) 'prog)) ($patom1 ' " ") (setq c ($dinc)) a ($prd1 (cdr l) (+ c (cond ((setq h (and f (cadr l) (atom (cadr l)))) -5) (t g)))) (cond ((cdr (setq l (cdr l))) (cond ((or (null h) (atom (cadr l))) (terpr $outport$))) (go a))))) ((prog (c) (setq c ($dinc)) a ($prd1 l c) (cond ((setq l (cdr l)) (terpr $outport$) (go a)))))) b ($patom1 rpar)))) (def $prd1 (lambda (l n) (prog () ($prdf (car l) n (cond ((null (setq l (cdr l))) (1+ m)) ((atom l) (setq n nil) (plus 4 m (pntlen l))) (t m))) (cond ((null n) ($patom1 ' " . ") (return (printret l $outport$))))))) (def $dinc (lambda () (- (linelength $outport$) (charcnt $outport$)))) (def $tocolumn (lambda (n) (cond ((greaterp (setq n (- n (nwritn $outport$))) 0) (do ((i 0 (1+ i))) ((eq i n)) (patom '" " $outport$)))))) ; ======================================== ; ; (charcnt port) ; returns the number of characters left on the current line ; on the given port ; ; ======================================= (def charcnt (lambda (port) (- linel (nwritn port)))) (def $patom1 (lambda (x) (patom x $outport$))) ) (- (linelength $outport$) (charcnt cmd/lisp/lib/cmulisp/backquote.l 644 321 12 10741 2552717564 12225 (setq SCCS-backquote "@(#)backquote.l 1.2 10/22/80") (setsyntax '\; 'splicing 'zapline) ;---- This file contains the definitions of the backquote and sharpsign ; character macros. [The backquote macro actually uses two characters, ; ` and ,] (setq **backquote** 1) (eval-when (eval) (cond ((null (getd 'declare)) (def declare (nlambda (l) nil))))) (declare (special **backquote**)) (def back-quote-ch-macro (lambda nil (back=quotify ((lambda (**backquote**) (read)) (1+ **backquote**))))) (def back-quote-comma-macro (lambda nil ((lambda (**backquote**) (cond ((zerop **backquote**) (break "comma not inside a backquote.")) ((eq (tyipeek) 64) (tyi) (cons '\,@ (read))) ((eq (tyipeek) 46) (tyi) (cons '\,\. (read))) (t (cons '\, (read))))) (1- **backquote**)))) (def back=quotify (lambda (x) ((lambda (a d aa ad dqp) (cond ((atom x) (list 'quote x)) ((eq (car x) '\,) (cdr x)) ((or (atom (car x)) (not (memq (caar x) '( \,@ \,\.)))) (setq a (back=quotify (car x)) d (back=quotify (cdr x)) ad (atom d) aa (atom a) dqp (and (not ad) (eq (car d) 'quote))) (cond ((and dqp (not (atom a)) (eq (car a) 'quote)) (list 'quote (cons (cadr a) (cadr d)))) ((and dqp (null (cadr d))) (list 'list a)) ((and (not ad) (eq (car d) 'list)) (cons 'list (cons a (cdr d)))) (t (list 'cons a d)))) ((eq (caar x) '\,@) (list 'append (cdar x) (back=quotify (cdr x)))) ((eq (caar x) '\,\.) (list 'nconc (cdar x)(back=quotify (cdr x)))) )) nil nil nil nil nil))) (putd '1+ (getd 'add1)) (putd '1- (getd 'sub1)) (setsyntax '\` 'macro 'back-quote-ch-macro) (setsyntax '\, 'macro 'back-quote-comma-macro) ;------- sharpsign macro, used for conditional assembly ;#O or #o reads sexp with ibase bound to 8. ;#+ makes exist if (STATUS FEATURE ) is T ;#- makes exist if (STATUS FEATURE ) is NIL ;#+(OR F1 F2 ...) makes exist of any one of F1,F2,... are in ; the (STATUS FEATURES) list. ;#+(AND F1 F2 ...) works similarly except all must be present in the list. ;#+(NOT ) is the same as #-. ;#/CHAR returns the numerical character code of CHAR. ;#\SYMBOL gets the numerical character code of non-printing characters. ;#' is to FUNCTION as ' is to QUOTE. ;#. evaluates at read time and leaves the result. ;#, evaluates at load time. Here it is the same as "#.". (declare (special franz-symbolic-character-names)) ; (setsyntax '\# 'splicing 'sharp-sign-macro) (def sharp-sign-macro (lambda () ((lambda (char frob) (setq char (tyi)) (cond ((or (eq char 79.) ;O (eq char 105.)) ;o ((lambda (ibase) (list (read))) 8.)) ((eq char 43.) ;+ (setq frob (read)) (cond ((not (feature-present frob)) (read))) nil) ((eq char 45.) ;- (setq frob (read)) (cond ((feature-present frob) (read))) nil) ((eq char 47.) ;/ (list (tyi))) ;return numeric value of CHAR ;list because splicing ((eq char 94.) ; ^ returns following char (list (boole 1 31. (tyi)))) ; made into a control char ((eq char 39.) ;' (list (list 'function (read)))) ((or (eq char 44.) (eq char 46.)) ;, or . (list (eval (read)))) ((eq char 92.) ;\ (setq frob (read)) ;get symbolic name of character (setq char (cdr (assq frob franz-symbolic-character-names))) (or char (error '|Illegal character name in #\\| frob)) (list char)) (t (error '|Bad character after #| (ascii char))))) nil nil))) (def feature-present (lambda(feature) (cond ((atom feature) (memq feature (status features))) ;damn fsubrs ((eq (car feature) 'not) (not (feature-present (cadr feature)))) ((eq (car feature) 'and) (do ((list (cdr feature) (cdr list))) ((null list) t) (cond ((not (feature-present (car list))) (return nil))))) ((eq (car feature) 'or) (do ((list (cdr feature) (cdr list))) ((null list) nil) (cond ((feature-present (car list)) (return t))))) (t (error '|Unknown form after #+ or #-| feature))))) (setq franz-symbolic-character-names '((eof . -1) (bs . 8.) (backspace . 8.) (tab . 9.) (lf . 10.) (linefeed . 10.) (ff . 12.) (form . 12.) (return . 13.) (cr . 13.) (newline . 10.) (vt . 9.) (alt . 27.) (esc . 27.) (sp . 32.) (space . 32.) (rubout . 127.))) return nil))))) ((eq (carcmd/lisp/lib/cmulisp/cmu.l 644 321 12 51132 2552717566 11034 ; LWE 1/11/81 Here's a piece of bogosity for while and others: (declare (special l init label var incr limit part fn form vars x selectq)) ; LWE 1/11/81 And here's something we need that went away from auxfns1.l: (def tab (lexpr (n) (prog (nn prt) (setq nn (arg 1)) (cond ((> n 1)(setq prt (arg 2)))) (cond ((> (nwritn prt) nn) (terpri prt))) (printblanks (- nn (nwritn prt)) prt)))) (dv cmufns ((setq macros t) (declare (special filelst %changes $%dotflg %prevfn% %%cfn part %%l lastword %trcflg form fn)) $%dotflg %lineread %prevfn% %trcflg *quo attach %changes de def df dm Cdo dremove dreverse dsubst dv eqstr every exists expand-do expand-ex expand-fe expand-set-of filelst for for-each forall insert kwote lconc ldiff lineread lsubst mark!changed memcdr merge merge1 notany notevery Cnth nthchar prinlev printlev prog1 quote! quote!-expr remove selectq selectq1 set-of some sort sort1 subpair subpr tailp tconc ttyesno ty until while yesno)) (setq macros t) (declare (special filelst %changes $%dotflg %prevfn% %%cfn part %%l lastword %trcflg form fn)) (dv $%dotflg nil) (def %lineread (lambda (chan) (prog (ans) loop (setq ans (cons (read chan 'EOF) ans)) (cond ((eq (car ans) 'EOF) (return (reverse (cdr ans))))) loop2(cond ((eq 10 (tyipeek chan)) (return (reverse ans))) ((memq (tyipeek chan) '(41 93)) (tyi chan) (go loop2)) (t (go loop)))))) (dv %prevfn% " ") (dv %trcflg t) (def *quo (lambda (x y) (quotient x y))) (def attach (lambda (x y) (cond ((dtpr y) (rplacd y (cons (car y) (cdr y))) (rplaca y x)) (t (eprint y) (error '"IS AN ATOM, CAN(('T BE ATTACHED TO"))))) (dv %changes ()) (def de (nlambda (l) (prog (defn) (cond ((equal (getd (car l)) (setq defn (cons 'lambda (cdr l)))) (return (cons (car l) '(equal)))) (t (putd (car l) defn) (return (mark!changed (car l)))))))) (def def (nlambda (l) (cond ((equal (getd (car l)) (cadr l)) (cons (car l) '(equal))) (t (putd (car l) (cadr l)) (mark!changed (car l)))))) (def df (nlambda (l) (prog (defn) (cond ((equal (getd (car l)) (setq defn (cons 'nlambda (cdr l)))) (return (cons (car l) '(equal)))) (t (putd (car l) defn) (return (mark!changed (car l)))))))) (def dm (nlambda (l) (prog (defn) (cond ((equal (getd (car l)) (setq defn (cons 'macro (cdr l)))) (return (cons (car l) '(equal)))) (t (putd (car l) defn) (return (mark!changed (car l)))))))) (def Cdo (macro (l) (expand-do l))) (def dremove (lambda (x l) (cond ((atom l) nil) ((eq x (car l)) (cond ((cdr l) (rplaca l (cadr l)) (rplacd l (cddr l)) (dremove x l)))) (t (prog (z) (setq z l) lp (cond ((atom (cdr l)) (return z)) ((eq x (cadr l)) (rplacd l (cddr l))) (t (setq l (cdr l)))) (go lp)))))) (def dreverse (lambda (l) (prog (l1 y z) (setq l1 l) l1 (cond ((atom (setq y l)) (cond ((or (null z) (null (cdr z))) (return z)) ((null (cddr z)) (setq y (car l1)) (rplaca l1 (car z)) (rplaca z y) (rplacd l1 z) (rplacd z nil) (return l1)) (t (rplacd (Cnth z (sub1 (length z))) z) (setq y (car l1)) (rplaca l1 (car z)) (rplaca z y) (rplacd l1 (cdr z)) (rplacd z nil) (return l1))))) (setq l (cdr l)) (setq z (rplacd y z)) (go l1)))) (def dsubst (lambda (x y z) (prog (b) (cond ((eq y (setq b z)) (return (copy x)))) lp (cond ((atom z) (return b)) ((cond ((symbolp y) (eq y (car z))) (t (equal y (car z)))) (rplaca z (copy x))) (t (dsubst x y (car z)))) (cond ((and y (eq y (cdr z))) (rplacd z (copy x)) (return b))) (setq z (cdr z)) (go lp)))) (def dv (nlambda (l) (cond ((and (boundp (car l)) (equal (eval (car l)) (cadr l))) (cons (car l) '(equal))) (t (set (car l) (cadr l)) (mark!changed (car l)))))) (def eqstr (lambda (x y) (equal x y))) (def every (lambda (everyx everyfn1 everyfn2) (prog nil a (cond ((null everyx) (return t)) ((funcall everyfn1 (car everyx)) (setq everyx (cond ((null everyfn2) (cdr everyx)) (t (funcall everyfn2 everyx)))) (go a)) (t (return nil)))))) (def exists (macro (l) (expand-ex 'some l))) ; LWE 1/11/81 This mother is giving me some headaches, so qua: (declare (special var)) (def expand-do (lambda (l) (prog (label var init incr limit part) (cond ((setq part (memq 'for l)) (setq var (cadr part)) (setq l (append (ldiff l part) (cddr part))))) (cond ((setq part (exists w l (memq w '(gets = _ :=)))) (setq init (cadr part)) (setq l (append (ldiff l part) (cddr part))))) (cond ((setq part (exists w l (memq w '(step by)))) (setq incr (cadr part)) (setq l (append (ldiff l part) (cddr part))))) (cond ((setq part (memq 'to l)) (setq limit (cadr part)) (setq l (append (ldiff l part) (cddr part))))) (return (quote! prog ! (cond (var (ncons var))) !! (cond (var (ncons (list 'setq var (cond (init) (t 1)))))) ! (setq label (gensym)) !! (mapcan (function (lambda (exp) (cond ((eq part 'while) (setq part nil) (quote! (cond ((not ! exp) (return nil))))) ((eq part 'until) (setq part nil) (quote! (cond (! exp (return nil))))) ((memq (setq part exp) '(while until do Cdo)) nil) (t (ncons exp))))) l) !! (cond (var (quote! (setq ! var (+ ! var ! (cond (incr) (t 1))))))) !! (cond ((and var limit) (quote! (cond ((> ! var ! limit) (return nil)))))) (go ! label)))))) (def expand-ex (lambda (fn form) (quote! ! fn ! (caddr form) (function (lambda ! (cond ((atom (cadr form)) (ncons (cadr form))) (t (cadr form))) ! (car (setq form (cdddr form))))) ! (cond ((cdr form) (list 'function (cadr form))))))) (def expand-fe (lambda (form) (prog (vars body) (return (cons (cond ((memq (cadr form) (quote (map mapc mapcan mapcar mapcon mapconc maplist))) (setq form (cdr form)) (car form)) (t 'mapc)) (progn (setq vars (cadr form)) (cond ((atom vars) (setq vars (list vars)))) (cons (cons 'function (ncons (cons 'lambda (cons vars (setq body (Cnth (cdddr form) (length vars))))))) (ldiff (cddr form) body)))))))) (def expand-set-of (lambda (form) (prog (vars body) (setq vars (cadr form)) (cond ((atom vars) (setq vars (list vars)))) (setq form (cddr form)) (return (quote! mapcan (function (lambda ! vars (cond (! (car (setq body (Cnth (cdr form) (length vars)))) (list ! (car vars)))))) !! (ldiff form body)))))) (dv filelst nil) (def for (macro (l) (expand-do l))) (def for-each (macro (l) (expand-fe l))) (def forall (macro (l) (expand-ex 'every l))) (def insert (lambda (x l comparefn nodups) (cond ((null l) (list x)) ((atom l) (eprint l) (error '"is an atom, can't be inserted into")) (t (cond ((null comparefn) (setq comparefn (function alphalessp)))) (prog (l1 n n1 y) (setq l1 l) (setq n (length l)) a (setq n1 (*quo (add1 n) 2)) (setq y (Cnth l1 n1)) (cond ((< n 3) (cond ((funcall comparefn x (car y)) (cond ((not (and nodups (equal x (car y)))) (rplacd y (cons (car y) (cdr y))) (rplaca y x)))) ((eq n 1) (rplacd y (cons x (cdr y)))) ((funcall comparefn x (cadr y)) (cond ((not (and nodups (equal x (cadr y)))) (rplacd (cdr y) (cons (cadr y) (cddr y))) (rplaca (cdr y) x)))) (t (rplacd (cdr y) (cons x (cddr y)))))) ((funcall comparefn x (car y)) (cond ((not (and nodups (equal x (car y)))) (setq n (sub1 n1)) (( (go a)))) (t (setq l1 (cdr y)) (setq n (- n n1)) (go a)))) l)))) (def kwote (lambda (x) (list 'quote x))) (def lconc (lambda (ptr x) (prog (xx) (return (cond ((atom x) ptr) (t (setq xx (last x)) (cond ((atom ptr) (cons x xx)) ((dtpr (cdr ptr)) (rplacd (cdr ptr) x) (rplacd ptr xx)) (t (rplaca (rplacd ptr xx) x))))))))) (def ldiff (lambda (x y) (cond ((eq x y) nil) ((null y) x) (t (prog (v z) (setq z (setq v (ncons (car x)))) loop (setq x (cdr x)) (cond ((eq x y) (return z)) ((null x) (error '"NOT A TAIL - LDIFF"))) (setq v (cdr (rplacd v (ncons (car x))))) (go loop)))))) (def lineread (nlambda (x) (%lineread (eval (car x))))) (def lsubst (lambda (x y z) (cond ((null z) nil) ((atom z) (cond ((eq y z) x) (t z))) ((equal y (car z)) (nconc (copy x) (lsubst x y (cdr z)))) (t (cons (lsubst x y (car z)) (lsubst x y (cdr z))))))) (def mark!changed (lambda (x) (cond ((not (memq x %changes)) (setq %changes (cons x %changes)))) (setq lastword x))) (def memcdr (lambda (%x% %y%) (prog nil l1 (cond ((eq %x% (cdr %y%)) (return t)) ((eq %x% %y%) (return nil))) (setq %x% (cdr %x%)) (go l1)))) (def merge (lambda (a b %%cfn) (cond ((null %%cfn) (setq %%cfn (function alphalessp)))) (merge1 a b))) (def merge1 (lambda (a b) (cond ((null a) b) ((null b) a) (t (prog (val end) (setq val (setq end (cond ((funcall %%cfn (car a) (car b)) (prog1 a (setq a (cdr a)))) (t (prog1 b (setq b (cdr b))))))) loop (cond ((null a) (rplacd end b) (return val)) ((null b) (rplacd end a) (return val)) ((funcall %%cfn (car a) (car b)) (rplacd end a) (setq a (cdr a))) (t (rplacd end b) (setq b (cdr b)))) (setq end (cdr end)) (go loop)))))) (def notany (lambda (somex somefn1 somefn2) (not (some somex somefn1 somefn2)))) (def notevery (lambda (everyx everyfn1 everyfn2) (not (every everyx everyfn1 everyfn2)))) (def Cnth (lambda (x n) (cond ((> 1 n) (cons nil x)) (t (prog nil lp (cond ((or (atom x) (eq n 1)) (return x))) (setq x (cdr x)) (setq n (sub1 n)) (go lp)))))) (def nthchar (lambda (x n) (cond ((plusp n) (car (Cnth (explodec x) n))) ((minusp n) (car (Cnth (reverse (explodec x)) (minus n)))) ((zerop n) nil)))) (def prinlev (lambda ($%x $%n) (cond ((not (dtpr $%x)) (print $%x)) ((and %trcflg (eq (car $%x) 'evl-trace) (dtpr (cdr $%x))) (prinlev (cadr $%x) $%n)) ((and %trcflg (eq (car $%x) '\#) (dtpr (cdr $%x)) (dtpr (cddr $%x))) (prinlev (caddr $%x) $%n)) ((eq %prevfn% $%x) (princ '//\#//)) ((eq $%n 0) (princ '"& ")) (t (prog ($%kk $%cl) (princ (cond ($%dotflg (setq $%dotflg nil) '"... ") (t '"("))) (prinlev (car $%x) (sub1 $%n)) (setq $%kk $%x) lp (cond ((memcdr $%x $%kk) (cond ($%cl (princ '" ...]") (return nil)) (t (setq $%cl t))))) (cond ((not (*** eq (cdr $%kk) (unbound))) (setq $%kk (cdr $%kk))) (t (princ '" . unbound)") (return nil))) (cond ((null $%kk) (princ '")") (return nil)) ((atom $%kk) (princ '" . ") (patom $%kk) (princ '")") (return nil))) (princ '" ") (prinlev (car $%kk) (sub1 $%n)) (go lp)))))) (def printlev (lambda ($%x $%n) (terpri) (prinlev $%x $%n) $%x)) (def prog1 (lexpr (n) (arg 1))) (def quote! (nlambda (a) (quote!-expr a))) (def quote!-expr (lambda (x) (cond ((atom x) x) ((eq (car x) '!) (cons (eval (cadr x)) (quote!-expr (cddr x)))) ((eq (car x) '!!) (cond ((cddr x) (append (eval (cadr x)) (quote!-expr (cddr x)))) (t (eval (cadr x))))) (t (prog (u v) (setq u (quote!-expr (car x))) (setq v (quote!-expr (cdr x))) (cond ((and (eq u (car x)) (eq v (cdr x))) (return x))) (return (cons u v))))))) (def remove (lambda (elt list) (cond ((atom list) list) ((equal (car list) elt) (remove elt (cdr list))) ((cons (car list) (remove elt (cdr list))))))) (def selectq (nlambda (selcq) (apply 'progn (selectq1 (eval (car selcq)) (cdr selcq))))) (dv selectq e) (def selectq1 (lambda (m l) (prog (c) lp (setq c l) (cond ((null (setq l (cdr l))) (return c)) ((or (eq (car (setq c (car c))) m) (and (dtpr (car c)) (memq m (car c)))) (return (cdr c)))) (go lp)))) (def set-of (macro (l) (expand-set-of l))) (def some (lambda (somex somefn1 somefn2) (prog nil a (cond ((null somex) (return nil)) ((funcall somefn1 (car somex)) (return somex)) (t (setq somex (cond ((null somefn2) (cdr somex)) (t (funcall somefn2 somex)))) (go a)))))) (def sort (lambda (%%l %%cfn) (prog (val n) (cond ((null %%cfn) (setq %%cfn (function alphalessp)))) (setq n 0) (setq val (sort1 0)) loop (cond ((null %%l) (return val)) (t (setq val (merge1 val (sort1 n))) (setq n (add1 n)) (go loop)))))) (def sort1 (lambda (n) (cond ((null %%l) nil) ((zerop n) (prog (run end) (setq run %%l) loop (setq end %%l) (setq %%l (cdr %%l)) (cond ((or (null %%l) (not (funcall %%cfn (car end) (car %%l)))) (rplacd end nil) (return run)) (t (go loop))))) (t (merge1 (sort1 (sub1 n)) (sort1 (sub1 n))))))) (def subpair (lambda (old new expr) (cond (old (subpr expr old (or new '(nil)))) (t expr)))) (def subpr (lambda (expr l1 l2) (prog (d a) (cond ((atom expr) (go lp)) ((setq d (cdr expr)) (setq d (subpr d l1 l2)))) (setq a (subpr (car expr) l1 l2)) (return (cond ((or (neq a (car expr)) (neq d (cdr expr))) (cons a d)) (t expr))) lp (cond ((null l1) (return expr)) (l2 (cond ((eq expr (car l1)) (return (car l2))))) (t (cond ((eq expr (caar l1)) (return (cdar l1)))))) (setq l1 (cdr l1)) (and l2 (setq l2 (or (cdr l2) '(nil)))) (go lp)))) (def tailp (lambda (x y) (and x (prog nil lp (cond ((atom y) (return nil)) ((eq x y) (return x))) (setq y (cdr y)) (go lp))))) (def tconc (lambda (p x) (cond ((atom p) (cons (setq x (ncons x)) x)) ((dtpr (cdr p)) (rplacd p (cdr (rplacd (cdr p) (ncons x))))) (t (rplaca p (cdr (rplacd p (ncons x)))))))) (def ttyesno (lambda nil (yesno (read)))) (def ty (macro (f) (append '(exec cat) (cdr f)))) (def until (macro (l) (expand-do l))) (def while (macro (l) (expand-do l))) (def yesno (lambda (x) (selectq x ((t y yes) t) ((nil n no) nil) x))) (setq y (cdr y)) (go lp))))) (def tconc (lambda (p x) (cond ((atom p) (cons (setq x (ncons x)) x)) ((dtpr (cdr p)) (rplacd p (cdr (rplacd (cdr p) (ncons x))))) (t (rplaca p (cdr (rplacd p (ncons x)))))))) (def ttyesno (lambda nil (yesno (read)))) (def ty (macro (f) (append '(exec cat) (cdr f)))) (def until (macro (l) (expand-do l))) (def while (macro (lcmd/lisp/lib/cmulisp/cmu2.l 644 321 12 56433 2552717570 11122 ; LWE 1/18/81 Hack hack hack. (declare (special $cur$ dc-switch piport %indent dc-switch vars body form var init label part incr limit getdeftable $outport$ tlmacros f tmp)) (declare (nlambda msg)) (dv cmu2fns ((declare (special %changes def-comment filelst found getdefchan getdefprops history historylength args i l lasthelp (( prop special special tlbuffer z)) %indent *digits *letters changes changes1 dc dc-define dc-dskin dc-help dskin dskout dskouts evl-trace file get-comment getdef getdefact getdefprops getdeftable help helpfilter historylength matchq matchq1 pp-comment showevents tleval tlgetevent tlmacros tlprint tlquote tlread top-level transprint valueof zap dc-switch)) (declare (special %changes def-comment filelst found getdefchan getdefprops history historylength args i l lasthelp prop special special tlbuffer z)) (dv dc-switch dc-define) (dv %indent 0) (dv *digits ("0" "1" "2" "3" "4" "5" "6" "7" "8" "9")) (dv *letters (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)) (def changes (lambda nil (changes1) (for-each f filelst (cond ((get f 'changes) (terpri) (princ f) (tab 15) (princ (get f 'changes))))) (cond (%changes (terpri) (princ ') (tab 15) (princ %changes))) nil)) (def changes1 (lambda nil (cond ((null %changes) nil) (t (prog (found prop) (for-each f filelst (setq found (cons (set-of fn (cons (concat f 'fns) (eval (concat f 'fns))) (memq fn %changes)) found)) (setq prop (get f 'changes)) (for-each fn (car found) (setq prop (insert fn prop nil t))) (putprop f prop 'changes)) (setq found (apply 'append found)) (setq %changes (set-of fn %changes (not (memq fn found))))))))) (def dc (nlambda (args) (eval (cons dc-switch args] (def dc-define (nlambda (args) (msg "Enter comment followed by " (N 1)) (drain piport) (eval (cons 'dc-dskin args] (def dc-help (nlambda (args) (cond ((eval (cons 'helpfilter (cons (car args) (caddr args)))) (transprint getdefchan))))) (def dskin (nlambda (files) (mapc (function (lambda (f) (prog nil (setq dc-switch 'dc-dskin) (file f) (load f) (changes1) (putprop f nil 'changes) (setq dc-switch 'dc-define) ))) files] (*** The new version of dskout (7/26/80) tries to keep backup versions It returns the setof its arguments that were successfully written If it can not write a file (typically because of protection restrictions) it offers to (try to) write a copy to /tmp A file written to /tmp is not considered to have been successfully written (and changes will not consider it to be up-to-date) ) (def dskout (nlambda (files) (changes1) (set-of f files (prog (ffns p tmp) (cond ((atom (errset (setq p (infile f)) nil)) (msg "creating " (eval 'f) (N 1))) (t (close p) (cond ((zerop (eval (list 'exec 'mv f (setq tmp (concat f '|.back|))))) (msg "old version moved to " (eval 'tmp) (N 1))) (t (msg "Unable to back up " (eval 'f) " - continue? (y/n) ") (cond ((not (ttyesno)) (return nil))))))) (cond ((atom (errset (apply (function pp) (cons (list 'F f) (cons (setq ffns (concat f 'fns)) (eval ffns)))) nil)) (msg "Unable to write " (eval 'f) " - try to put it on /tmp? (y/n) ") (cond ((ttyesno) (setq f (explode f)) (while (memq '/ f) (setq f (cdr (memq '/ f)))) (setq f (apply (function concat) (cons '/tmp/ f))) (cond ((atom (errset (apply (function pp) (cons (list 'F f) (cons ffns (eval ffns)))))) (msg "Unable to create " (eval 'f) " - I give up! " (N 1) )) (t (msg (eval 'f) " written " (N 1) ))))) (return nil))) (putprop f nil 'changes) (return t))))) (def dskouts (lambda nil (changes1) (apply (function dskout) (set-of f filelst (get f 'changes))))) (def evl-trace (nlambda (exp) (prog (val) (tab %indent) (prinlev (car exp) 2) ((lambda (%indent) (setq val (eval (car exp)))) (+ 2 %indent)) (tab %indent) (prinlev val 2) (return val)))) (def file (lambda (name) (setq filelst (insert name filelst nil t)) (cond ((not (boundp (concat name 'fns))) (set (concat name 'fns) nil))) name)) (def getdef (nlambda (%%l) (prog (x u getdefchan found) (setq getdefchan (infile (car %%l))) l (cond ((atom (setq u (errset (prog (x y z) (cond ((eq (tyipeek getdefchan) -1) (err 'EOF))) (cond ((memq (tyipeek getdefchan) '(12 13)) (tyi getdefchan))) (return (cond ((memq (tyipeek getdefchan) '(40 91)) (tyi getdefchan) (cond ((and (symbolp (setq y (ratom getdefchan))) (cond (t (comment - what about intern?) (setq x y) t) ((neq y (setq x (intern y))) t) (t (remob1 x) nil)) (assoc x getdeftable) (or (setq z (ratom getdefchan)) t) (some (cdr %%l) (function (lambda (x) (matchq x z))) nil) (cond ((symbolp z) (setq y z) t) (t (setq y z) t)) (cond ((memq y found)) ((setq found (cons y found)))) (not (cond ((memq (tyipeek getdefchan) '(40 91)) (print x) (terpri) (princ y) (tyo 32) (princ '" -- bad format") t)))) (cons x (cons y (cond ((memq (tyipeek getdefchan) '(41 93)) (tyi (( getdefchan) nil) (t (untyi 40 getdefchan) (read getdefchan)))))))))))))) (close getdefchan) (return found)) (t (setq x (car u)) (*** free u) (setq u nil) (cond ((not (atom x)) (apply (cdr (assoc (car x) getdeftable)) (ncons x)))))) (cond ((not (eq (tyi getdefchan) 10)) (zap getdefchan))) (go l)))) (def getdefact (lambda (i p exp) (prog nil (cond ((or (null getdefprops) (memq p getdefprops)) (terpri) (print (eval exp)) (princ '" ") (prin1 p)) (t (terpri) (print i) (princ '" ") (prin1 p) (princ '" ") (princ 'bypassed)))))) (dv getdefprops (function value expr fexpr macro)) (dv getdeftable ((defprop lambda (x) (getdefact (cadr x) (cadddr x) x)) (dc lambda (x) (cond ((or (null getdefprops) (memq 'comment getdefprops)) (eval x)))) (de lambda (x) (getdefact (cadr x) 'expr x)) (df lambda (x) (getdefact (cadr x) 'fexpr x)) (dm lambda (x) (getdefact (cadr x) 'macro x)) (setq lambda (x) (getdefact (cadr x) 'value x)) (dv lambda (x) (getdefact (cadr x) 'value x)) (def lambda (x) (getdefact (cadr x) 'function x)))) ; LWE 1/11/81 I am flushing this in favor of a help system everybody ; can use -- the manual printer. From now on, additions to the system ; everybody uses should be made at a sufficiently sedate pace that they ; can be documented by additions to the manual. This is necessary for ; a system to be used by large numbers of people. ; ; (def help ; (nlambda (l) ; ((lambda (getdefprops dc-switch) ; (prog (lets files) ; (cond ((null l) (setq l (ncons 'overview)))) ; (setq lasthelp '(@ . 84)) ; (setq lets ; (for-each mapcan ; name ; l ; (prog (x char) ; (setq x 1) ; loop (cond ((null ; (setq char ; (nthchar name x))) ; (return ; (cond ((eq '@ ; (nthchar name ; (sub1 ; x))) ; (cons nil ; *letters)) ; (t (list nil))))) ; ((memq char *letters) ; (return (ncons char))) ; (t (setq x (add1 x)) ; (go loop)))))) ; (for-each i lets (setq files (insert i files nil t))) ; (for-each i ; files ; (prog (def-comment) ; (setq def-comment 'dc-help) ; (eval ; (quote! getdef ; ! ; (concat '/usr/lisp/help/ ; i) ; !! ; l)))))) ; (ncons 'comment) ; 'dc-help))) ; ;(def helpfilter ; (nlambda (l) ; (cond ; ((not (boundp 'lasthelp)) (setq lasthelp (cons '@ 65)))) ; (cond ((or (memq 'see l) (memq 'under l)) ; (terpri) ; (princ ; (cond ((memq 'under l) '"for explanation of ") ; ((memq 'see l) '"for information related to "))) ; (princ (car l)) ; (princ '" see") ; (cond ; ((neq (car l) (car lasthelp)) (setq lasthelp (cons (car l) 84)))) ; t) ; ((memq 'obsolete l) ; (terpri) ; (princ (car l)) ; (princ '" is obsolete. for replacement see ") ; (cond ; ((neq (car l) (car lasthelp)) (setq lasthelp (cons (car l) 84)))) ; t) ; ((memq 'xref l) ; (prog (ans) ; (setq ans (apply (function append) (read getdefchan))) ; (cond ((null ans) (return nil))) ; (cond ; ((neq lasthelp (car l)) (print (car l)) (princ '": "))) ; (terpri) ; (princ '" pointed to by these other helps: ") ; (princ ans)) ; (cond ; ((neq (car l) (car lasthelp)) (setq lasthelp (cons (car l) 84)))) ; nil) ; ((and (eq (car l) (car lasthelp)) ; (memq (cdr lasthelp) '(65 97))) ; (terpri) ; (princ '" - - - - - ") ; (princ l) ; (princ '" - - - - - ") ; t) ; ((and (eq (car l) (car lasthelp)) ; (memq (cdr lasthelp) '(70 102))) ; nil) ; ((or (memq 'standard l) ; (memq 'top-level-command l) ; (memq 'break-command l) ; (memq 'edit-command l) ; (memq 'long l) ; (eq (car lasthelp) (car l))) ; (prog (char) ; (*** ddtin t) ; l: (*** talk) ; (drain piport) ; (terpri) ; (princ l) ; (princ '"display? (all, type, skip, flush) ") ; (cond ; ((dtpr (setq char (errset (tyi)))) (setq char (car char)))) ; (cond ; ((not (memq char '(65 97 84 116 83 115 70 102))) ; (terpri) ; (princ ; '"type a to see the rest of the help for this word, ; t to see this message and decide again for the next one, ; s to skip this message and decide again for the next one or ; f to skip the rest of the messages for this word.") ; (go l:))) ; (*** ddtin nil) ; (setq lasthelp (cons (car l) char)) ; (return (memq char '(65 97 84 116)))) ; (memq (cdr lasthelp) '(65 97 84 116))) ; (t (terpri) ; (princ '" - - - - - ") ; (princ l) ; (princ '" - - - - - ") ; (setq lasthelp (cons (car l) 84)) ; t)))) (dv historylength 25) (def matchq (lambda (x y) (prog (xx yy) (return (cond ((and (atom x) (atom y)) (cond ((matchq1 (setq xx (explode x)) (setq yy (explode y))) (*** freelist xx) (*** freelist yy) t) (t (*** freelist xx) (*** freelist yy))))))))) (def matchq1 (lambda (x y) (prog nil l1 (cond ((eq x y) (return t)) ((or (equal y '(@)) (equal x '(@))) (return t)) ((or (null x) (null y)) (return nil)) ((eq (car x) (car y)) (setq x (cdr x)) (setq y (cdr y)) (go l1)) (t (return nil)))))) (def showevents (lambda (evs) (for-each ev evs (terpri) (princ (car ev)) (princ '".") (tlprint (cadr ev)) (cond ((cddr ev) (terpri) (tlprint (caddr ev))))))) (def tleval (lambda (exp) (prog (val) (setq val (eval exp)) (rplacd (cdar history) (ncons val)) (return val)))) (def tlgetevent (lambda (x) (cond ((null x) (car history)) ((and (fixp x) (plusp x)) (assoc x history)) ((and (fixp x) (minusp x)) (car (Cnth history (minus x))))))) (dv tlmacros ((ed lambda (x) (prog (exp) (cond ((setq exp (copy (cadr (tlgetevent (cadr x))))) (edite exp nil nil) (return (ncons exp))) (t (princ '"No such event"))))) (redo lambda (x) (prog (exp) (cond ((setq exp (tlgetevent (cadr x))) (return (ncons (cadr exp)))) (t (princ '"No such event"))))) (?? lambda (x) (prog (e1 e2 rest) (cond ((null (cdr x)) (showevents (reverse history))) ((null (setq e1 (tlgetevent (cadr x)))) (princ '"No such event as ") (princ (cadr x))) ((null (cddr x)) (showevents (ncons e1))) ((null (setq e2 (tlgetevent (caddr x)))) (princ '"No such event as ") (princ (caddr x))) (t (setq e1 (memq e1 history)) (cond ((setq rest (memq e2 e1)) (showevents (cons e2 (reverse (ldiff e1 rest))))) (t (showevents (cons (car e1) (reverse (ldiff (memq e2 history) e1)))))))))))) (def tlprint (lambda (x) (prinlev x 4))) (def tlquote (lambda (x) (prog (ans) l (cond ((null x) (return (reverse ans))) ((eq (car x) '!) (s((etq ans (cons (cadr x) ans)) (setq x (cddr x))) (t (setq ans (cons (kwote (car x)) ans)) (setq x (cdr x)))) (go l)))) (def tlread (lambda nil (prog (cmd tmp) top (cond ((not (boundp 'history)) (setq history nil))) (cond ((null tlbuffer) (terpri) (princ (add1 (cond (history (caar history)) (t 0)))) (princ '".") (cond ((null (setq tlbuffer (lineread))) (princ 'Bye) (terpri) (exit))))) (cond ((not (atom (setq cmd (car tlbuffer)))) (setq tlbuffer (cdr tlbuffer)) (go record)) ((setq cmd (assoc cmd tlmacros)) (setq tmp tlbuffer) (setq tlbuffer nil) (setq cmd (apply (cdr cmd) (ncons tmp))) (cond ((atom cmd) (go top)) (t (setq cmd (car cmd)) (go record)))) ((and (null (cdr tlbuffer)) (or (numberp (car tlbuffer)) (stringp (car tlbuffer)) (hunkp (car tlbuffer)) (boundp (car tlbuffer)))) (setq cmd (car tlbuffer)) (setq tlbuffer nil) (go record)) ((or (and (dtpr (getd (car tlbuffer))) (memq (car (getd (car tlbuffer))) '(lexpr lambda))) (and (bcdp (getd (car tlbuffer))) (eq (getdisc (getd (car tlbuffer))) 'lambda))) (setq cmd (cons (car tlbuffer) (tlquote (cdr tlbuffer)))) (setq tlbuffer nil) (go record))) (setq cmd tlbuffer) (setq tlbuffer nil) record (setq history (cons (list (add1 (cond (history (caar history)) (t 0))) cmd) history)) (cond ((dtpr (cdr (setq tmp (Cnth history historylength)))) (rplacd tmp nil))) (return cmd)))] (def cmu-top-level (lambda nil (prog (tlbuffer) l (tlprint (tleval (tlread))) (go l)))] ; LWE 1/11/81 The following might make this sucker work after resets: (setq user-top-level 'cmu-top-level) (putd 'user-top-level (getd 'cmu-top-level)) (setq top-level 'cmu-top-level) (putd 'top-level (getd 'cmu-top-level)) (def transprint (lambda (prt) (prog nil l (cond ((memq (tyipeek prt) '(27 -1)) (return nil)) (t (tyo (tyi prt)) (go l)))))) (def valueof (lambda (x) (caddr (tlgetevent x)))) (def zap (lambda (prt) (prog nil l (cond ((memq (tyi prt) '(10 -1)) (return nil)) (t (go l)))))) (dv dc-switch dc-define) resets: (setq user-top-level 'cmu-top-level) (putd 'user-top-level (getd 'cmu-top-level)) (setq top-level 'cmu-top-level) (putd 'top-level (getd 'cmu-top-level)) (def transprint (lambda (prt) (prog nil l (cond ((mcmd/lisp/lib/cmulisp/cmu3.l 644 321 12 3306 2552717572 11074 ; VIII. Additions from CMU (-DNC) ; *** list* neq ; nreconc nth push pop ; munkam (def *** (nlambda (arg) nil)) ; the CMU comment function (def list* (lexpr (n) (cond ((zerop n) (err '"no args to list*"))) (do ((left (sub1 n) (sub1 left)) (tail (arg n) (cons (arg left) tail))) ((< left 1) tail) nil))) ; -DNC (written by LWE) - ; (list* 'a 'b 'c) = (a b .c) (def neq ; -DNC inserted (cause CMU lisp uses it) (lambda (x y) (not (eq x y)))) (def nreconc (lambda (x y) (nconc (nreverse x) y))) ; -DNC (LWE) added to correspond to maclisp ;----nth[N,L] returns the Nth element of list L, with 0 being the first ; element ;----LWE 1/29/80 ; (defun nth (N L) (cond ((null L)nil) (t(do ((LCDR L (cdr LCDR)) (COUNT N (1- COUNT))) ((or (and (atom LCDR) LCDR (err '"non-proper list passed to nth")) (or (lessp COUNT 0)(zerop COUNT))) (car LCDR)) nil)))) ;---push[X,L] is like (SETQ L (CONS X L)). Use where L is like a stack. ; ;---LWE 1/29/80 (def push (nlambda (nargs) (set (cadr nargs) (cons (eval (car nargs)) (eval (cadr nargs)))))) ;---pop[L,X] returns CAR of L, sets L to CDR of L, and optionally assigns ; the popped value to X. ; ;---LWE 1/29/80 (def pop (nlambda (nargs) ((lambda (top-of-stack) (cond ((cadr nargs) (set (cadr nargs) top-of-stack)) (top-of-stack))) (prog2 nil (car (eval (car nargs))) (set (car nargs)(cdr (eval (car nargs] ; the following has been added for Maclisp compatibility ; LWE 1/29/80 (putd 'munknam (getd 'fake)) ; added for CMULisp compatibilty (used by editor etc) (putd 'prin1 (getd 'print)) ts L to CDR of L, and optionally assigns ; the popped value to X. ; ;---LWE 1/29/80 (def pop (nlambda (nargs) ((lambda (top-of-stack) (cond ((cadr nargs) (set (cadr nargs) top-of-stack)) (top-of-stack))) (prog2 nil (car (eval (car nargs))) (set (car nargs)(cdr (eval (cmd/lisp/lib/cmulisp/cmu4.l 644 321 12 3204 2552717573 11073 (declare (special args c)) ; LWE This grossness is necessary for the macro ; exists to work properly. (Maybe.) (declare (special piport)) (def dc-dskin ; LWE Hacking to compile OK (nlambda (args) (prog (tmp tmp1 tmp2) [setq tmp (prog (c cc) (setq cc (get (car args) 'comment)) loop (cond ((not cc)(return nil))) (setq c (car cc)) (cond ((eq (car c)(cadr args)) (return nil))) (setq cc (cdr cc)) (go loop] (setq tmp2 piport) (setq tmp1 (get-comment 27 tmp2)) (cond (tmp (disgusting tmp (cons (cadr args) (cons (caddr args) tmp1)))) ; (rplaca tmp ; (cons (cadr args) ; (cons (caddr args) tmp1 )))) (t (putprop (car args) (cons (cons (cadr args) (cons (caddr args) tmp1)) (get (car args) 'comment)) 'comment))) (mark!changed (car args)) (return nil] (def disgusting (lambda (a b) ; (rplaca a b))) b)) (def get-comment (lambda (stopper piport) (prog (ans line) (cond ((eq 10 (tyipeek piport)) (tyi piport))) l: (setq line nil) ; (until (member (car line) (list 10 stopper)) ; (setq line (cons (tyi piport) line))) (prog nil loop (cond ((member (car line)(list 10 stopper)) (return nil))) (setq line (cons (tyi piport) line)) (go loop)) (setq ans (cons (implode (dreverse (cdr line))) ans)) (cond ((eq (car line) 10) (go l:)) (t (return (dreverse ans))))))) iport) (prog (ans line) (cond ((eq 10 (tyipeek piport)) (tyi piport))) l: (setq line nil) ; (until (member (car line) (list 10 stopper)) ; (setq line (cons (tyi piport) line))) (prog nil loop (cond ((member (car line)(list 10 stopper)) (return nil))) (setq line (cons (tyi piport) line)) (go loop)) cmd/lisp/lib/cmulisp/comment.l 644 321 12 4032 2552717573 11665 (dc dc 1 (basic)) (dc word {id} {attribute-list}) Dc (for "define comment") allows the association of comments with atoms in much the same way as de or dv associate function definitions and values. It is very similar to the CMULisp dc from which it was copied. The first argument is the atom with which you want to associate the comment. The optional id identifies the comment - you are allowed to give an atom multiple comments. The attribute list is supposed to describe the comment in the same way as the help messages are described. This could be used by helpfilter to decide whether to print the comment. Both of the optional arguments default to nil.  (dc dc 2 (general)) Dc actually calls a function named by (the value of) dc-switch. The normal value of dc-switch is dc-define, which prints a message, reads text from the terminal and stores a comment property. Dc-switch is rebound by the help function to dc-help, a function that decides whether to print the comment (by asking helpfilter) and then either does or does not. Dskin rebinds dc-switch to dc-dskin which is like dc-define without the prompt. From this it follows that (1) unlike CMULisp, all comments are stored in core, and (2) you can program dc yourself just by setting dc-switch to the name of a function that you supply. (dc dc 3 (detail)) Comments are stored in a format similar to that of CMULisp. The comment property of an atom is a list of comments, each consisting of an id, an attribute list and text. However, due to a restriction ((on the size of strings or atoms that Franz can read, the text is stored as a list of lines. As in CMULisp, a comment can be changed just by redefining it (i.e. creating another comment for the same atom with the same id). In order to delete comments or change the order in which they are printed it is necessary to edit the comment property. Comments are pretty-printed (by pp-comment) in the reverse of their order in the comment property. (New comments are added to the front, so this keeps them in the order of their definition.) atoms that Franz can read, the text is stored as a list of lines. As in CMULisp, a comment can be changed just by redefining it (i.e. creating another comment for the same atom with the same id). In order to delete comments or change the order in which they are printed it is necessary to edit the comment property. Comments are pretty-printed (by pp-comment) in the reverse of their order in the comment property. (New comments are added to the front, so this keeps them in the ordcmd/lisp/lib/cmulisp/compl.l 644 321 12 4055 2552717573 11342 ;; This file contains macros for the compiler to use to expand CMULisp ;; functions. In particular, it should be included in order to compile ;; functions which use: ;; ***, selectq, quote! ;; - DNC ;; LWE 1/11/80 Added prin1 to this nasty motherfucker because the CMU ;; stuff needs it, but it ain't around anywhere. (def prin1 (lambda (x) (print x))) ; doesn't take into account ; possible file arg, but that's the ; breaks. (declare (special selectq) (macros t)) (def *** (macro (l) nil)) (def selectq (macro(l) (prog (firstcl restcl rslt) (setq rslt (ncons (quote cond))) (cond ((atom (car (setq l (cdr l)))) (setq firstcl (setq restcl (car l)))) ((eq (caar l) (quote setq)) (setq firstcl (car l)) (setq restcl (cadar l))) (t (setq firstcl (list (quote setq) (setq restcl (quote selectq)) (car l))))) lp (cond ((cdr (setq l (cdr l))) (nconc rslt (ncons (cons (list (cond ((atom (caar l)) (quote eq)) (t (quote memq))) firstcl (list (quote quote) (caar l))) (cdar l)))) (setq firstcl restcl) (go lp))) (nconc rslt (ncons (cons t l))) (return rslt))) ] (def quote!x (lambda(x) (prog (y z) (return (cond ((atom x) x) ((and (eq (car x) (quote !)) (cdr x)) (setq y (quote!x (cddr x))) (cond ((cddr x) (list (quote cons) (cadr x) (cond ((and y (eq y (cddr x))) (kwote y)) (t y)))) (t (list (quote ncons) (cadr x))))) ((and (eq (car x) (quote !!)) (cdr x)) (setq y (quote!x (cddr x))) (cond ((cddr x) (list (quote append) (cadr x) (cond ((and y (eq y (cddr x))) (kwote y)) (t y)))) (t (cadr x)))) (t (setq y (quote!x (car x))) (setq z (quote!x (cdr x))) (cond ((eq y (car x)) (cond ((eq z (cdr x)) x) (y (list (quote cons) (kwote y) z)) (t (list (quote cons) y z)))) ((and z (eq z (cdr x))) (list (quote cons) y (kwote z))) (t (list (quote cons) y z)))))))) ) (def quote! (macro (l) (prog (x) (setq x (quote!x (cdr l))) (return (cond ((eq x (cdr l)) (kwote x)) (t x))))) ) end) (cadr x) (cond ((and y (eq y (cddr x))) (kwote y)) (t y)))) (t (cadr x)))) (t (setq y (quote!x (car x))) (setq z (quote!x (cdr x))) (cond ((eq y (car x)) (cond ((eq z (cdr x)) x) (y (list (quote cons) (kwote y) z)) (t (list (quote cons) y z)))) ((and z (eq z (cdr x))) (list (quote cons) y (kwote z))) (t (list (quote cons) y z)))))))) ) (def quote! (macro (l) (prog (x) (setq x (quote!x (cdr l))) (return cmd/lisp/lib/cmulisp/dc-dskin.l 644 321 12 0 2552717573 11626 cmd/lisp/lib/cmulisp/dv.l 444 321 12 515 2552717575 10616 ;;; This is a bootstrap file to allow the true defns to be read in. (comment dv dvfns (dv %changes mark!changed)) (def dv (nlambda (l) (set (car l) (cadr l)) (mark!changed (car l)))) (setq %changes nil) (def mark!changed (lambda (x) (cond ((not (memq x %changes)) (setq %changes (cons x %changes)))) x)) ) y z)))) ((and z (eq z (cdr x))) (list (quote cons) y (kwote z))) (t (list (quot/P4,P45H< /h,l"cmd/lisp/lib/cmulisp/edits.l 644 321 12 153014 2552717605 11374 (declare (special c2 c3 tem nopr)) (dv editsfns ((declare (special |#1| |#2| |#3| $%dotflg %lookdpth %prevfn% atm autop com com0 coms copyflg editcomsl editracefn %%w findflag l l0 lastail lastp1 lastp2 lastword lcflg marklst maxlevel maxloop mess noprint oldprompt readbuf %%x toflg topflg undolst undolst1 unfind upfindflg usermacros findarg commentflg changed)) |##| editfns editf editv editp edite editl editl0 edval editread (declare (*expr editracefn)) editcom editcoma editcoml editmac editcoms edith edit!undo undoeditcom editsmash editnconc editdsubst edit1f edit2f edit4e editqf edit4f editfpat edit4f1 editfindp editbf editbf1 editnth bpnt0 bpnt editri editro editli editlo editbi editbo editdefault edup edit*l edit* edor errcom edrpt edloc edlocl edit: editmbd editxtr editelt editcont editsw editmv editto editbelow editran edit!0 editrepack editmakefn usermacros editracefn lastword maxlevel maxloop editcomsl autop upfindflg)) (declare (special |#1| |#2| |#3| $%dotflg %lookdpth %prevfn% atm autop com com0 coms copyflg editcomsl editracefn %%w findflag l l0 lastail lastp1 lastp2 lastword lcflg marklst maxlevel maxloop mess noprint oldprompt readbuf %%x toflg topflg undolst undolst1 unfind upfindflg usermacros findarg commentflg changed)) (declare (special c nopr)) ; LWE 1/11/80 Hacks for new compiler. (def |##| (nlambda (coms) ((lambda (l undolst1) (editcoms coms)) l nil))) (def editfns (nlambda (x) (prog (y) (setq y (eval (car x))) l1 (cond (y (print (car y)) (eval (list 'errset (cons 'editf (cons (car y) (cdr x))))) (setq y (cdr y)) (go l1)))))) (def editf (nlambda (x) (prog (y fn changed) (cond ((null x) (print '=) (prin1 lastword) (setq x (ncons lastword)))) (cond ((symbolp (car x)) (setq fn (car x)) (cond ((*** setq y (get fn 'trace)) (setq fn (cdr y)))) (cond ((setq y (getd fn)) (edite y (cdr x) (car x)) (cond (changed (*** cond ((eq (car x) fn) (*** move property to front) (remprop (car x) (car y)) (putprop (car x) (cadr y) (car y))) ((setq y (cdr (get fn 'funtype))) (*** move the *right* property of the original word to the front) (setq fn (get (car x) y)) (( (remprop (car x) y) (putprop (car x) fn y))))) (return (setq lastword (car x)))) ((and (boundp fn) (dtpr (cdr y))) (go l1)))) ((dtpr (car x)) (go l1))) (print (car x)) (princ '" not editable") (err nil) l1 (print '=editv) (return (eval (cons 'editv x)))))) (def editv (nlambda (x) (prog (y) (cond ((null x) (print '=) (prin1 lastword) (setq x (ncons lastword)))) (cond ((dtpr (car x)) (edite (eval (car x)) (cdr x) nil) (return t)) ((and (symbolp (car x)) (boundp (car x)) (setq y (eval (car x)))) (edite y (cdr x) (car x)) (return (setq lastword (car x)))) (t (print (car x)) (princ '" not editable") (err nil)))))) (def editp (nlambda (x) (cond ((null x) (print '=) (prin1 lastword) (setq x (ncons lastword)))) (cond ((dtpr (car x)) (print '=editv) (eval (cons 'editv x))) ((symbolp (car x)) (edite (plist (car x)) (cdr x) (car x)) (setq lastword (car x))) (t (print (car x)) (princ '" not editable") (err nil))))) (def edite (lambda (expr coms atm) (cond ((atom expr) (print expr) (princ '" not editable") (err nil)) (t (car (last (editl (ncons expr) coms atm nil nil))))))) (def editl (lambda (l coms atm marklst mess) (prog (com lastail undolst undolst1 findflag lcflg unfind lastp1 lastp2 readbuf l0 com0 oldprompt upfindflg noprint findarg) (makunbound 'findarg) (setq upfindflg t) (cond ((dtpr (setq l (catch (eval '(editl0)) edit-abort))) (return l)) (t (err nil)))))) (def editl0 (lambda nil (prog nil (cond (coms (cond ((eq (car coms) 'start) (setq readbuf (append (cdr coms) (list nil))) (setq coms nil) (*** don 't quit if command fails)) (t (editcoms (append coms (list 'ok))) (return l))))) (cond ((or (null coms) (eq (car coms) 'start)) (print (or mess 'edit)))) (cond ((or (eq (car l) (car (last (car (cond ((setq com (get 'edit 'lastvalue))) (t '((nil)))))))) (and atm (eq (car l) (car (last (car (cond ((setq com (get atm 'edit-save))) (t '((nil)))))))))) (setq l (car com)) (setq marklst (cadr com)) (setq undolst (caddr com)) (cond ((car undolst) (setq undolst (cons nil undolst)))) (setq unfind (cdddr com)))) (*** setq oldprompt (cons (sub1 (stkcount 'editl0 (add1 (spdlpt)) 0)) (prompt 35))) ct (setq noprint t) (setq findflag nil) a (setq undolst1 nil) (cond ((and autop (null readbuf) (not noprint)) (bpnt (list 0 autop)))) (setq com (editread)) (setq l0 l) (setq com0 (cond ((atom com) com) (t (car com)))) (cond ((dtpr (prog1 (errset (editcom com t)) (cond (undolst1 (setq undolst1 (cons com0 (cons l0 undolst1))) (setq undolst (cons undolst1 undolst)))))) (go a))) (setq readbuf nil) (cond (coms (err nil))) (terpri) (cond (com (prin1 com) (princ '" ?") (terpri))) (go ct)))) (def edval (lambda (%%x) (errset (eval %%x)))) (def editread (lambda nil (prog (x) (cond ((null readbuf) (prog nil l1 (terpri) (princ '|#|) (*** cond ((neq (car oldprompt) 0) (princ (car oldprompt)))) (*** prompt 35) (cond ((atom (setq readbuf (errset (lineread)))) (terpri) (go l1))) (setq readbuf (car readbuf))))) (setq x (car readbuf)) (setq readbuf (cdr readbuf)) (return x)))) (declare (*expr editracefn)) (def editcom (lambda (c topflg) (setq com c) (cond (editracefn (editracefn c))) (cond (findflag (cond ((eq findflag 'bf) (setq findflag nil) (editbf c nil)) (t (setq findflag nil) (editqf c)))) ((numberp c) (setq l (edit1f c l)) (setq noprint nil)) ((atom c) (editcoma c (null topflg))) (t (editcoml c (null topflg)))) (car l))) (def editcoma (lambda (c copyflg) (prog (tem nopr) (selectq c (help (setq nopr t) (eval (cons 'help readbuf)) (setq readbuf nil) (*** inserted dec 78 by don cohen)) (!0 (edit!0)) (!nx (setq l ((lambda (l) (prog (uf) (setq uf l) lp (cond ((or (null (setq l (cdr l))) (null (cdr l))) (err nil)) ((or (null (setq tem (memq (car l) (cadr l)))) (null (cdr tem))) (go lp))) (edit* 1) (setq unfind uf) (return l))) l))) (!undo (edit!undo t t nil)) (? (bpnt0 (car l) 64) (setq nopr t)) (?? (edith undolst) (setq nopr t)) (bk (edit* -1)) (delete (setq c '(delete)) (edit: ': nil nil)) (mark (setq marklst (cons l marklst)) (setq nopr t)) (nex (setq l ((lambda (l) (editbelow '_ 1) (edit* 1) l) l))) ((f bf) (cond ((null topflg) (setq findflag c)) (t (setq findarg (cond ((or readbuf (not (boundp 'findarg))) (editread)) (t findarg))) (selectq c (f (editqf findarg)) (bf (editbf findarg nil)) (err nil))))) (nil (setq nopr t)) (autop nil) (nx (edit* 1)) (ok (cond (atm (cond ((and (dtpr undolst) (car undolst)) (setq changed t) (*** bound in editf) (mark!changed atm))) (remprop atm 'edit-save))) (putprop 'edit (cons (last l) (cons marklst (cons undolst l))) 'lastvalue) (throw l edit-abort) (*** prompt (cdr oldprompt)) (*** retfrom 'editl0 l)) (p (bpnt0 (car l) 2) (setq nopr t)) (pp (bpnt0 (car l) nil) (setq nopr t)) (pp* ((lambda (commentflg) (bpnt0 (car l) nil)) t) (setq nopr t)) (repack (editrepack)) (save (cond (atm (cond ((and (dtpr undolst) (car undolst)) (mark!changed atm))) (putprop 'edit (putprop atm (cons l (cons marklst (cons undolst unfind))) 'edit-save) 'lastvalue))) (*** prompt (cdr oldprompt)) (*** retfrom 'editl0 l) (throw l edit-abort)) (stop (*** prompt (cdr oldprompt)) (*** spreval (stksrch 'editl0 (spdlpt) nil) '(err nil)) (throw nil edit-abort)) (test (setq undolst (cons nil undolst)) (setq nopr t)) (tty: (setq com com0) (setq l (editl l nil atm nil 'tty:))) (unblock (cond ((setq tem (memq nil undolst)) (editsmash tem (ncons nil) (cdr tem))) (t (terpri) (princ '"not blocked"))) (setq nopr t)) (undo (edit!undo topflg nil (cond (readbuf (editread))))) (up (edup)) (/ (( (cond (unfind (setq c l) (setq l unfind) (and (cdr c) (setq unfind c))) (t (err nil)))) (/p (cond ((and lastp1 (neq lastp1 l)) (setq l lastp1)) ((and lastp2 (neq lastp2 l)) (setq l lastp2)) (t (err nil)))) (^ (and (cdr l) (setq unfind l)) (setq l (last l))) (_ (cond (marklst (and (cdr l) (setq unfind l)) (setq l (car marklst))) (t (err nil)))) (__ (cond (marklst (and (cdr l) (setq unfind l) (setq l (car marklst)) (setq marklst (cdr marklst)))) (t (err nil)))) (tl (top-level) (setq nopr t)) (cond ((null (setq tem (editmac c usermacros nil))) (editdefault c) (setq nopr noprint)) (t (editcoms (copy (cdr tem))) (setq nopr noprint)))) (setq noprint nopr)))) (def editcoml (lambda (c copyflg) (prog (c2 c3 tem nopr) lp (cond ((dtpr (cdr c)) (setq c2 (cadr c)) (cond ((dtpr (cddr c)) (setq c3 (caddr c))) (t (setq c3 nil)))) (t (setq c2 (setq c3 nil)))) (cond ((and lcflg (selectq c2 ((to thru through) (cond ((null (cddr c)) (setq c3 -1) (setq c2 'thru))) t) nil)) (editto (car c) c3 c2) (return nil)) ((numberp (car c)) (edit2f (car c) (cdr c)) (setq noprint nil) (return nil)) ((eq c2 '::) (editcont (car c) (cddr c)) (setq noprint nil) (return nil))) (selectq (car c) ((a b :) (edit: (car c) nil (cdr c))) (below (editbelow c2 (cond ((cddr c) c3) (t 1)))) (bf (editbf c2 c3)) (bi (editbi c2 (cond ((cddr c) c3) (t c2)) (and (cdr c) (car l)))) (bind (prog (|#1| |#2| |#3|) (editcoms (cdr c))) (setq nopr noprint)) (bk (edit* (minus c2))) (bo (editbo c2 (and (cdr c) (car l)))) (change (editran c '((to) (edit: : |#1| |#3|)))) (coms (prog nil l1 (cond ((setq c (cdr c)) (editcom (setq com (eval (car c))) nil) (go l1)))) (setq nopr noprint)) (comsq (editcoms (cdr c)) (setq nopr noprint)) (copy (editran c '((to) (editmv |#1| (car |#3|) (cdr |#3|) t)))) (cp (editmv nil (cadr c) (cddr c) t)) (delete (editran c '(nil (edit: : |#1| nil)))) (e (setq tem (eval c2)) (cond ((null (cddr c)) (print tem))) (setq nopr t)) (embed (editran c '((in with) (editmbd |#1| |#3|)))) (extract (editran c '((from) (editxtr |#3| |#1|)))) (f (edit4f c2 c3)) (f= (edit4f (cons '== c2) c3)) (fs (prog nil l1 (cond ((setq c (cdr c)) (editqf (setq com (car c))) (go l1))))) (help (eval c) (setq nopr t) (*** inserted dec 78 by don cohen)) (i (setq c (cons (cond ((atom c2) c2) (t (eval c2))) (mapcar (function (lambda (x) (cond (topflg (print (setq x (eval x))) x) (t (eval x))))) (cddr c)))) (setq copyflg nil) (go lp)) (if (cond ((and (dtpr (setq tem (edval c2))) (car tem)) (cond ((cdr c) (editcoms c3)))) ((and (cddr c) (cdddr c)) (editcoms (cadddr c))) (t (err nil))) (setq nopr noprint)) (insert (editran c '((before after for) (edit: |#2| |#3| |#1|)))) (lc (edloc (cdr c))) (lcl (edlocl (cdr c))) (li (editli c2 (and (cdr c) (car l)))) (lo (editlo c2 (and (cdr c) (car l)))) ((lp lpq) (edrpt (cdr c) (eq (car c) 'lpq)) (setq nopr noprint)) (m (cond ((atom c2) (cond ((setq tem (editmac c2 usermacros nil)) (rplacd tem (cddr c))) (t (setq usermacros (cons (cons c2 (cons nil (cddr c))) usermacros))))) (t (cond ((setq tem (editmac (car c2) usermacros t)) (rplaca tem (caddr c)) (rplacd tem (cdddr c))) (t (nconc editcomsl (ncons (car c2))) (mark!changed 'editcomsl) (setq usermacros (cons (cons (car c2) (cddr c)) usermacros)))))) (mark!changed 'usermacros) (setq nopr t)) (makefn (cond ((or (null c2) (null c3) (null (cdddr c))) (err nil)) (t (editmakefn c2 c3 (cadddr c) (cond ((null (cddddr c)) (cadddr c)) (t (car (cddddr c)))))))) (mbd (editmbd nil (cdr c))) (move (editran c '((to) (editmv |#1| (car |#3|) (cdr |#3|) nil)))) (mv (editmv nil (cadr c) (cddr c) nil)) (n (cond ((atom (car l)) (err nil))) (editnconc (car l) (cond (copyflg (copy (cdr c))) (t (append (cdr c) nil))))) (nex (setq l ((lambda (l) (editbelow c2 (cond ((cddr c) c3) (t 1))) (edit* 1) l) l))) (nth (cond ((neq (setq tem (editnth (car l) c2)) (car l)) (setq l (cons tem l))))) (nx (edit* c2)) (orf (edit4f (cons '*any* (cdr c)) 'n)) (orr (edor (cdr c)) (setq nopr noprint)) (p (cond ((neq lastp1 l) (setq lastp2 lastp1) (setq lastp1 l))) (bpnt (cdr c)) (setq nopr t)) (r ((lambda (l) (edit4f c2 t) (setq unfind l) (setq c2 (cond ((and (atom c2) upfindflg (dtpr (car l))) (caar l)) (t (car l))))) (ncons (car l))) (editdsubst c3 c2 (car l))) (repack (edloc (cdr c)) (editrepack)) (replace (editran c '((with by) (edit: : |#1| |#3|)))) (ri (editri c2 c3 (and (cdr c) (cddr c) (car l)))) (ro (editro c2 (and (cdr c) (car l)))) (s (set c2 (cond ((null c2) (err nil)) (t ((lambda (l) (edloc (cddr c))) l)))) (setq nopr t)) (second (edloc (append (cdr c) (cdr c)))) (surround (editran c '((with in) (editmbd |#1| |#3|)))) (sw (editsw (cadr c) (caddr c))) (third (edloc (append (cdr c) (cdr c) (cdr c)))) ((thru to) (editto nil c2 (car c))) (undo (edit!undo topflg nil c2)) (xtr (editxtr nil (cdr c))) (_ (setq l ((lambda (l) (prog (uf) (setq uf l) (( (setq c2 (editfpat c2)) lp (cond ((cond ((and (atom c2) (dtpr (car l))) (eq c2 (caar l))) ((eq (car c2) 'if) (cond ((atom (setq tem (edval (cadr c2)))) nil) (t tem))) (t (edit4e c2 (cond ((eq (car c2) '@) (caar l)) (t (car l)))))) (setq unfind uf) (return l)) ((setq l (cdr l)) (go lp))) (err nil))) l))) (cond ((null (setq tem (editmac (car c) usermacros t))) (editdefault c) (setq nopr noprint)) ((not (atom (setq c3 (car tem)))) (editcoms (subpair c3 (cdr c) (cdr tem))) (setq nopr noprint)) (t (editcoms (subst (cdr c) c3 (cdr tem))) (setq nopr noprint)))) (setq noprint nopr)))) (def editmac (lambda (c lst flg) (prog (x y) lp (cond ((null lst) (return nil)) ((eq c (car (setq x (car lst)))) (setq y (cdr x)) (cond ((cond (flg (car y)) (t (null (car y)))) (return y))))) (setq lst (cdr lst)) (go lp)))) (def editcoms (lambda (coms) (prog nil l1 (cond ((atom coms) (return (car l)))) (editcom (car coms) nil) (setq coms (cdr coms)) (go l1)))) (def edith (lambda (lst) (prog nil (terpri) l1 (cond ((null lst) (return nil)) ((null (car lst)) (prin1 'block) (go l2)) ((null (caar lst)) (go l3)) ((numberp (caar lst)) (prin1 (list (caar lst) '--)) (go l2))) (prin1 (caar lst)) l2 (princ '" ") l3 (setq lst (cdr lst)) (go l1)))) (def edit!undo (lambda (printflg !undoflg undop) (prog (lst flg) (setq lst undolst) lp (cond ((or (null lst) (null (car lst))) (go out))) (cond ((null undop) (selectq (caar lst) ((nil !undo unblock) (go lp1)) (undo (cond ((null !undoflg) (go lp1)))) nil)) ((neq undop (caar lst)) (go lp1))) (undoeditcom (car lst) printflg) (cond ((null !undoflg) (return nil))) (setq flg t) lp1 (setq lst (cdr lst)) (go lp) out (cond (flg (return nil)) ((and lst (cdr lst)) (print 'blocked)) (t (terpri) (princ '"nothing saved")))))) (def undoeditcom (lambda (x flg) (prog (c) (cond ((atom x) (err nil)) ((neq (car (last l)) (car (last (cadr x)))) (terpri) (princ '"different expression") (setq com nil) (err nil))) (setq c (car x)) (setq l (cadr x)) (prog (y z) (setq y (cdr x)) l1 (cond ((setq y (cdr y)) (setq z (car y)) (cond ((eq (car z) 'r) ((lambda (l) (editcom (list 'r (cadr z) (caddr z)) nil)) (cadddr z))) (t (editsmash (car z) (cadr z) (cddr z)))) (go l1)))) (editsmash x nil (cons (car x) (cdr x))) (and flg (setq flg (cond ((not (numberp c)) c) (t (cons c '(--))))) (print flg) (princ 'undone)) (return t)))) (def editsmash (lambda (old a d) (cond ((atom old) (err nil))) (setq undolst1 (cons (cons old (cons (car old) (cdr old))) undolst1)) (rplaca old a) (rplacd old d))) (def editnconc (lambda (x y) (prog (tem) (return (cond ((null x) y) ((atom x) (err nil)) (t (editsmash (setq tem (last x)) (car tem) y) x)))))) (def editdsubst (lambda (x y z) (prog nil lp (cond ((atom z) (return nil)) ((cond ((symbolp y) (or (eq y (car z)) (and (stringp (car z)) (eqstr y (car z))))) (t (equal y (car z)))) (editsmash z (copy x) (cdr z))) (t (editdsubst x y (car z)))) (cond ((and y (eq y (cdr z))) (editsmash z (car z) (copy x)) (return nil))) (setq z (cdr z)) (go lp)))) (def edit1f (lambda (c l) (cond ((eq c 0) (cond ((null (cdr l)) (err nil)) (t (cdr l)))) ((atom (car l)) (err nil)) ((> c 0) (cond ((> c (length (car l))) (err nil)) (t (cons (car (setq lastail (Cnth (car l) c))) l)))) ((> (minus c) (length (car l))) (err nil)) (t (cons (car (setq lastail (Cnth (car l) (+ (length (car l)) (add1 c))))) l))))) (def edit2f (lambda (n x) (prog (cl) (setq cl (car l)) (cond ((atom cl) (err nil)) (copyflg (setq x (copy x))) (t (setq x (append x nil)))) (cond ((> n 0) (cond ((> n (length cl)) (err nil)) ((null x) (go delete)) (t (go replace)))) ((or (eq n 0) (null x) (> (minus n) (length cl))) (err nil)) (t (cond ((neq n -1) (setq cl (Cnth cl (minus n))))) (editsmash cl (car x) (cons (car cl) (cdr cl))) (cond ((cdr x) (editsmash cl (car cl) (nconc (cdr x) (cdr cl))))) (return nil))) delete (cond ((eq n 1) (or (dtpr (cdr cl)) (err nil)) (editsmash cl (cadr cl) (cddr cl))) (t (setq cl (Cnth cl (sub1 n))) (editsmash cl (car cl) (cddr cl)))) (return nil) replace (cond ((neq n 1) (setq cl (Cnth cl n)))) (editsmash cl (car x) (cdr cl)) (cond ((cdr x) (editsmash cl (car cl) (nconc (cdr x) (cdr cl)))))))) (def edit4e (lambda (pat y) (cond ((eq pat y) t) ((atom pat) (or (eq pat '&) (equal pat y) (and (stringp y) (stringp pat) (eqstr pat y)))) ((eq (car pat) '*any*) (prog nil lp (cond ((null (setq pat (cdr pat))) (return nil)) ((edit4e (car pat) y) (return t))) (go lp))) ((and (eq (car pat) '@) (atom y)) (prog (z) (setq pat (cdr pat)) (setq z (explodec y)) lp (cond ((eq (car pat) '@) (*** freelist z) (print '=) (prin1 y) (return t)) ((null z) (return nil)) ((neq (car pat) (car z)) (*** freelist z) (return nil))) (setq pat (cdr pat)) (setq z (cdr z)) (go lp))) ((eq (car pat) '--) (or (null (setq pat (cdr pat))) (prog nil lp (cond ((edit4e pat y) (return t)) ((atom y) (return nil))) (setq y (cdr y)) (go lp)))) ((eq (car pat) '==) (eq (cdr pat) y)) ((atom y) nil) ((edit4e (car pat) (car y)) (edit4e (cdr pat) (cdr y)))))) (def editqf (lambda (pat) (prog (q1) (cond ((and (dtpr (car l)) (dtpr (setq q1 (cdar l))) (setq q1 (memq pat q1))) (setq l (cons (cond (upfindflg q1) (t (setq lastail q1) (car q1))) l))) (t (edit4f pat 'n)))))) (def edit4f (lambda (pat %%x) (prog (ll x %%w) (setq %%w (ncons nil)) (setq com pat) (setq pat (editfpat pat)) (setq ll l) (cond ((eq %%x 'n) (setq %%x 1) (cond ((atom (car l)) (go lp1)) ((and (atom (caar l)) upfindflg) (setq ll (cons (caar l) l)) (go lp1)) (t (setq ll (cons (caar l) l)))))) (cond ((and %%x (not (numberp %%x))) (setq %%x 1))) (cond ((and (edit4e (co((nd ((and (dtpr pat) (eq (car pat) ':::)) (cdr pat)) (t pat)) (car ll)) (or (null %%x) (eq (setq %%x (sub1 %%x)) 0))) (return (setq l ll)))) (setq x (car ll)) lp (cond ((edit4f1 pat x maxlevel) (and (cdr l) (setq unfind l)) (return (car (setq l (nconc (car %%w) (cond ((eq (cadr %%w) (car ll)) (cdr ll)) (t ll))))))) ((null %%x) (err nil))) lp1 (setq x (car ll)) (cond ((null (setq ll (cdr ll))) (err nil)) ((and (setq x (memq x (car ll))) (dtpr (setq x (cdr x)))) (go lp))) (go lp1)))) (def editfpat (lambda (pat) (cond ((dtpr pat) (cond ((or (eq (car pat) '==) (eq (car pat) '@)) pat) (t (mapcar (function editfpat) pat)))) ((eq (nthchar pat -1) '@) (cons '@ (explodec pat))) (t pat)))) (def edit4f1 (lambda (pat x lvl) (prog nil lp (cond ((not (> lvl 0)) (terpri) (princ '"maxlevel exceeded") (return nil)) ((atom x) (return nil)) ((and (dtpr pat) (eq (car pat) ':::) (edit4e (cdr pat) x) (or (null %%x) (eq (setq %%x (sub1 %%x)) 0)))) ((and (or (atom pat) (neq (car pat) ':::)) (edit4e pat (car x)) (or (null %%x) (eq (setq %%x (sub1 %%x)) 0))) (cond ((or (null upfindflg) (dtpr (car x))) (setq lastail x) (setq x (car x))))) ((and pat (eq pat (cdr x)) (or (null %%x) (eq (setq %%x (sub1 %%x)) 0))) (setq x (cdr x))) ((and %%x (dtpr (car x)) (edit4f1 pat (car x) (sub1 lvl)) (eq %%x 0)) (setq x (car x))) (t (setq x (cdr x)) (setq lvl (sub1 lvl)) (go lp))) (cond ((and %%w (neq x (cadr %%w))) (tconc %%w x))) (return (or %%w t))))) (def editfindp (lambda (x pat flg) (prog (%%x lastail %%w) (setq %%x 1) (and (null flg) (setq pat (editfpat pat))) (return (or (edit4e pat x) (edit4f1 pat x maxlevel)))))) (def editbf (lambda (pat n) (prog (ll x y %%w) (setq ll l) (setq %%w (ncons nil)) (setq com pat) (setq pat (editfpat pat)) (cond ((and (null n) (cdr ll)) (go lp1))) lp (cond ((editbf1 pat (car ll) maxlevel y) (setq unfind l) (return (car (setq l (nconc (car %%w) (cond ((eq (car ll) (cadr %%w)) (cdr ll)) (t ll)))))))) lp1 (setq x (car ll)) (cond ((null (setq ll (cdr ll))) (err nil)) ((or (setq y (memq x (car ll))) (setq y (tailp x (car ll)))) (go lp))) (go lp1)))) (def editbf1 (lambda (pat x lvl tail) (prog (y) lp (cond ((not (> lvl 0)) (terpri) (princ '"maxlevel exceeded") (return nil)) ((eq tail x) (return (cond ((edit4e (cond ((and (dtpr pat) (eq (car pat) ':::)) (cdr pat)) (t pat)) x) (tconc %%w x)))))) (setq y x) lp1 (cond ((null (or (eq (cdr y) tail) (atom (cdr y)))) (setq y (cdr y)) (go lp1))) (setq tail y) (cond ((and (dtpr (car tail)) (editbf1 pat (car tail) (sub1 lvl) nil)) (setq tail (car tail))) ((and (dtpr pat) (eq (car pat) ':::) (edit4e (cdr pat) tail))) ((and (or (atom pat) (neq (car pat) ':::)) (edit4e pat (car tail))) (cond ((or (null upfindflg) (dtpr (car tail))) (setq lastail tail) (setq tail (car tail))))) ((and pat (eq pat (cdr tail))) (setq x (cdr x))) (t (setq lvl (sub1 lvl)) (go lp))) (cond ((neq tail (cadr %%w)) (tconc %%w tail))) (return %%w)))) (def editnth (lambda (x n) (cond ((atom x) (err nil)) ((not (numberp n)) (or (memq n x) (memq (setq n (editelt n (ncons x))) x) (tailp n x))) ((eq n 0) (err nil)) ((null (setq n (cond ((or (not (minusp n)) (> (setq n (plus (length x) n 1)) 0)) (Cnth x n))))) (err nil)) (t n)))) (def bpnt0 (lambda (y n) (cond ((neq lastp1 l) (setq lastp2 lastp1) (setq lastp1 l))) (cond (n (setq $%dotflg (tailp (car l) (cadr l))) (setq %prevfn% '" ") (printlev y n)) (t (terpri) (*** sprint y 1) ($prpr y) (terpri))))) (def bpnt (lambda (x) (prog (y n) (cond ((eq (car x) 0) (setq y (car l)) (setq $%dotflg (tailp (car l) (cadr l)))) (t (setq y (car (editnth (car l) (car x)))))) (cond ((null (cdr x)) (setq n 2)) ((not (numberp (setq n (cadr x)))) (err nil)) ((minusp n) (err nil))) (setq %prevfn% '" ") (return (printlev y n))))) (def editri (lambda (m n x) (prog (a b) (setq a (editnth x m)) (setq b (editnth (car a) n)) (cond ((or (null a) (null b)) (err nil))) (editsmash a (car a) (editnconc (cdr b) (cdr a))) (editsmash b (car b) nil)))) (def editro (lambda (n x) (setq x (editnth x n)) (cond ((or (null x) (atom (car x))) (err nil))) (editsmash (setq n (last (car x))) (car n) (cdr x)) (editsmash x (car x) nil))) (def editli (lambda (n x) (setq x (editnth x n)) (cond ((null x) (err nil))) (editsmash x (cons (car x) (cdr x)) nil))) (def editlo (lambda (n x) (setq x (editnth x n)) (cond ((or (null x) (atom (car x))) (err nil))) (editsmash x (caar x) (cdar x)))) (def editbi (lambda (m n x) (prog (a b) (setq b (cdr (setq a (editnth x n)))) (setq x (editnth x m)) (cond ((and a (not (> (length a) (length x)))) (editsmash a (car a) nil) (editsmash x (cons (car x) (cdr x)) b)) (t (err nil)))))) (def editbo (lambda (n x) (setq x (editnth x n)) (cond ((atom (car x)) (err nil))) (editsmash x (caar x) (editnconc (cdar x) (cdr x))))) (def editdefault (lambda (editx) (prog nil (cond (lcflg (return (cond ((eq lcflg t) (editqf editx)) (t (editcom (list lcflg editx) topflg))))) ((null topflg) (err nil)) ((memq editx editcomsl) (cond (readbuf (setq editx (cons editx readbuf)) (setq readbuf nil)) (t (err nil)))) (t (err nil))) (return (editcom (setq com editx) topflg))))) (def edup (lambda nil (prog (c-exp l1 x y) (setq c-exp (car l)) lp (cond ((null (setq l1 (cdr l))) (err nil)) ((tailp c-exp (car l1)) (return nil)) ((not (setq x (memq c-exp (car l1)))) (err nil)) ((or (eq x lastail) (not (setq y (memq c-exp (cdr x)))))) ((and (eq c-exp (car lastail)) (tailp lastail y)) (setq x lastail)) (t (terpri) (princ c-exp) (princ '"- location uncertain"))) (cond ((eq x (car l1)) (setq l l1)) (t (setq l (cons x l1)))) (return nil)))) (def edit*l (lambda (l) (edup) (length (car l)))) (def edit* (lambda (n) (car (setq l ((lambda (com l m) (cond ((not (> m n)) (err nil))) (edit!0) (edit1f (difference n m) l)) nil l (edit*l l)))))) (def edor (lambda (coms) (prog nil lp (cond ((null coms) (err nil)) ((dtpr (errset (setq l ((lambda (l) (cond ((atom (car coms)) (editcom (car coms))) (t (editcoms (car coms)))) l) l)))) (return (car l)))) (setq coms (cdr coms)) (go lp)))) (def errcom (lambda (coms) (errset (editcoms coms)))) (def edrpt (lambda (edrx quiet) (prog (edrl edrptcnt) (setq edrl l) (setq edrptcnt 0) lp (cond ((> edrptcnt maxloop) (terpri) (princ '"maxloop exceeded")) ((dtpr (errcom edrx)) (setq edrl l) (setq edrptcnt (add1 edrptcnt)) (go lp)) ((null quiet) (print edrptcnt) (princ 'occurrences))) (setq l edrl)))) (def edloc (lambda (edx) (prog (oldl oldf lcflg edl) (setq oldl l) (setq oldf unfind) (setq lcflg t) (cond ((atom edx) (editcom edx nil)) ((and (null (cdr edx)) (atom (car edx))) (editcom (car edx) nil)) (t (go lp))) (setq unfind oldl) (return (car l)) lp (setq edl l) (cond ((dtpr (errcom edx)) (setq unfind oldl) (return (car l)))) (cond ((equal edl l) (setq l oldl) (setq unf((ind oldf) (err nil))) (go lp)))) (def edlocl (lambda (coms) (car (setq l (nconc ((lambda (l unfind) (edloc coms) l) (ncons (car l)) nil) (cdr l)))))) (def edit: (lambda (type lc x) (prog (toflg l0) (setq l0 l) (setq x (mapcar (function (lambda (x) (cond ((and (dtpr x) (eq (car x) '|##|)) ((lambda (l undolst1) (copy (editcoms (cdr x)))) l nil)) (t x)))) x)) (cond (lc (cond ((eq (car lc) 'here) (setq lc (cdr lc)))) (edloc lc))) (edup) (cond ((eq l0 l) (setq lc nil))) (selectq type ((b before) (edit2f -1 x)) ((a after) (cond ((cdar l) (edit2f -2 x)) (t (editcoml (cons 'n x) copyflg)))) ((: for) (cond ((or x (cdar l)) (edit2f 1 x)) ((memq (car l) (cadr l)) (edup) (edit2f 1 (ncons nil))) (t (editcoms '(0 (nth -2) (2))))) (return (cond ((null lc) l)))) (err nil)) (return nil)))) (def editmbd (lambda (lc x) (prog (y toflg) (cond (lc (edloc lc))) (edup) (setq y (cond (toflg (caar l)) (t (ncons (caar l))))) (edit2f 1 (ncons (cond ((or (atom (car x)) (cdr x)) (append x y)) (t (lsubst y '* (car x)))))) (setq l (cons (caar l) (cond ((tailp (car l) (cadr l)) (cdr l)) (t l)))) (return (cond ((null lc) l)))))) (def editxtr (lambda (lc x) (prog (toflg) (cond (lc (edloc lc))) ((lambda (l unfind) (edloc x) (setq x (cond ((tailp (car l) (cadr l)) (caar l)) (t (car l))))) (ncons (cond ((tailp (car l) (cadr l)) (caar l)) (t (car l)))) nil) (edup) (edit2f 1 (cond (toflg (append x nil)) (t (ncons x)))) (and (null toflg) (dtpr (caar l)) (setq l (cons (caar l) (cond ((tailp (car l) (cadr l)) (cdr l)) (t l)))))))) (def editelt (lambda (lc l) (prog (y) (edloc lc) lp (setq y l) (cond ((cdr (setq l (cdr l))) (go lp))) (return (car y))))) (def editcont (lambda (lc1 %%x) (setq l ((lambda (l) (prog nil (setq lc1 (editfpat lc1)) lp (cond ((null (edit4f lc1 'n)) (err nil)) ((atom (errset (edlocl %%x))) (go lp))) lp1 (cond ((null (setq l (cdr l))) (err nil)) ((cond ((atom lc1) (eq lc1 (caar l))) ((eq (car lc1) '@) (edit4e lc1 (caar l))) (t (edit4e lc1 (car l)))) (return l))) (go lp1))) l)))) (def editsw (lambda (m n) (prog (y z tem) (setq y (editnth (car l) m)) (setq z (editnth (car l) n)) (setq tem (car y)) (editsmash y (car z) (cdr y)) (editsmash z tem (cdr z))))) (def editmv (lambda (lc op x cp) (prog (l0 l1 z toflg) (setq l0 l) (and lc (edloc lc)) (cond ((eq op 'here) (cond ((null lc) (edloc x) (setq x nil))) (setq op ':)) ((eq (car x) 'here) (cond ((null lc) (edloc (cdr x)) (setq x nil)) (t (setq x (cdr x)))))) (edup) (setq l1 l) (setq z (cond (cp (copy (caar l))) (t (caar l)))) (setq l l0) (and x (edloc x)) (cond ((eq op 'after) (setq op 'a)) ((eq op 'before) (setq op 'b))) (editcoml (cond (toflg (cons op (append z nil))) (t (list op z))) nil) (prog (l) (setq l l1) (cond ((not cp) (editcoms '(1 delete))) (toflg (editcoml '(bo 1) nil)))) (return (cond ((null lc) (setq unfind l1) l) ((null x) (setq unfind l1) l0) (t (setq unfind l) l0)))))) (def editto (lambda (lc1 lc2 flg) (setq l ((lambda (l) (cond (lc1 (edloc lc1) (edup))) (editbi 1 (cond ((and (numberp lc1) (numberp lc2) (> lc2 lc1)) (difference (add1 lc2) lc1)) (t lc2)) (car l)) (cond ((and (eq flg 'to) (cdaar l)) (editri 1 -2 (car l)))) (editcom 1 nil) l) l)) (setq toflg t))) (def editbelow (lambda (place depth) (cond ((minusp (setq depth (eval depth))) (err nil))) (prog (n1 n2) (setq n1 (length ((lambda (l lcflg) (editcom place nil) l) l '_))) (setq n2 (length l)) (cond ((< n2 (+ n1 depth)) (err nil))) (setq unfind l) (setq l (Cnth l (difference (add1 n2) n1 depth)))))) (def editran (lambda (c def) (setq l (or ((lambda (l) (prog (z w) (cond ((null def) (err nil)) ((null (setq z (car def))) (go out))) lp (cond ((null z) (err nil)) ((null (setq w (memq (car z) c))) (setq z (cdr z)) (go lp))) out (setq z (apply (car (setq def (cadr def))) (prog (|#1| |#2| |#3|) (setq |#1| (cdr (ldiff c w))) (setq |#2| (car z)) (setq |#3| (cdr w)) (return (mapcar (function (lambda (x) (cond ((atom x) (selectq x (|#1| |#1|) (|#2| |#2|) (|#3| |#3|) x)) (t (eval x))))) (cdr def)))))) (return (cond ((null z) (setq unfind l) nil) (t z))))) l) l)))) (def edit!0 (lambda nil (cond ((null (cdr l)) (err nil))) (prog nil lp (setq l (cdr l)) (cond ((tailp (car l) (cadr l)) (go lp)))))) (def editrepack (lambda nil (cond ((dtpr (car l)) (setq l (edit1f 1 l)))) (edit: ': nil (ncons (readlist (edite (explode (car l)) nil nil)))))) (def editmakefn (lambda (ex args n m) (editbi n m (car l)) (edloc n) (editbelow '/ 1) (mapc (function (lambda (x y) (editdsubst x y (car l)))) args (cdr ex)) (putprop (car ex) (cons 'lambda (cons args (car l))) 'expr) (mark!changed (car ex)) (edup) (edit2f 1 (ncons ex)))) (dv usermacros nil) (dv editracefn nil) (dv lastword editsfns) (dv maxlevel 192) (dv maxloop 24) (dv editcomsl (: a b below bf bi bind bk bo change coms comsq copy cp delete e embed extract f f= fs help i if insert lc lcl li lo lp lpq m makefn mbd move mv n nex nth nx orf orr p r repack replace ri ro s second surround sw third thru to undo xtr _)) (dv autop 2) (dv upfindflg t) te e embed extract f f= fs help i if insert lc lcl li lo lp lpq m makefn mbd move mv n nex nth nx orf orr p r repack replace ri ro s second surround sw third thru to undo xtr _)) (dv autop 2) (dv u((cmd/lisp/lib/cmulisp/fix.l 644 321 12 51065 2552717613 11034 (setq SCCS-fix "@(#)fix.l 1.1 10/2/80") ; LWE 1/11/81 Hack hack.... ; ; LWE 1/11/81 Bet you didn't know this, but this won't work INTERPRETED, ; but Dave assures me it works compiled. (In MACLisp...) ; (declare (special cmd frame x cnt var init label part incr limit selectq)) (dv fixfns ((*** This is FIXIT written by David Touretzky and adapted to Franz by Don Cohen) (declare (special framelist rframelist interrupt-handlers handler-labels) (special prinlevel prinlength evalhook-switch traced-stuff) (special lastword piport hush-debug) (*fexpr editf step type)) (sstatus feature fixit) (*rset t) ER%tpl fixit debug debug-iter debug1 debug-bktrace debug-print debug-print1 debug-findcall debug-scanflist debug-scanstk debug-getframes debug-nextframe debug-upframe debug-dnframe debug-upfn debug-dnfn debug-showvar debug-nedit debug-insidep debug-findusrfn debug-findexpr debug-pop debug-where debug-sysp interrupt-handlers handler-labels (or (boundp 'traced-stuff) (setq traced-stuff nil)) (or (boundp 'evalhook-switch) (setq evalhook-switch nil)) (setq hush-debug nil))) (*** This is FIXIT written by David Touretzky and adapted to Franz by Don Cohen) (declare (special framelist rframelist interrupt-handlers handler-labels) (special prinlevel prinlength evalhook-switch traced-stuff) (special lastword piport hush-debug) (*fexpr editf step type)) (sstatus feature fixit) (*rset t) (dv ER%tpl fixit) (dv ER%all fixit) ; LWE 1/17/81 MAYBE THIS WILL FIX THIS FUCKER. (def fixit (nlambda (l) (prog (piport) (while t (eval (cons 'debug l)))))) (def debug (nlambda (params) (prog (cmd frame framelist rframelist nframe val infile) (setq infile t) (and evalhook-switch (step nil)) (setq rframelist (reverse (setq framelist (or (debug-getframes) (list (debug-scanstk '(nil) '(debug))))))) (setq frame (debug-findexpr (car framelist))) (tab 0) (cond ((and (car params) (not (eq (car params) 'edit))) (terpri) (princ '|;debug |) (princ params) (terpri) (go loop))) (debug-print1 frame nil) (terpri) (cond (hush-debug (setq hush-debug nil) (go loop)) ((not (memq 'edit params)) (go loop))) (drain nil) (princ '|type e to edit, to debug: |) (setq val (tyi)) (cond ((or (= val 69) (= val 101)) (and (errset (debug-nedit frame)) (setq cmd '(ok)) (go cmdr))) ((or (= val 78) (= val 110)) (terpri) (debug-pop))) loop (terpri) (princ ':) (cond ((null (setq cmd (lineread))) (reset))) cmdr (cond ((dtpr (car cmd)) (setq val (eval (car cmd) (cadddr frame))) ($prin1 val) (terpri) (go loop))) (setq nframe (debug1 cmd frame)) (and (not (atom nframe)) (setq frame nframe) (go loop)) ($prin1 (or nframe (car cmd))) (princ '" Huh? - type h for help") (go loop)))) (def debug-iter (macro (x) (cons 'prog (cons 'nil (cons 'loop (cons (list 'setq 'nframe (cadr x)) '((setq cnt (|1-| cnt)) (and (or (null nframe) (zerop cnt)) (return nframe)) (setq frame nframe) (go loop)))))))) (def debug1 (lambda (cmd frame) (prog (nframe val topframe cnt item) (setq topframe (car framelist)) (or (eq (typep (car cmd)) 'symbol) (return nil)) (and (eq (getchar (car cmd) 1) 'b) (eq (getchar (car cmd) 2) 'k) (return (debug-bktrace cmd frame))) (setq cnt (cond ((fixp (cadr cmd)) (cadr cmd)) ((fixp (caddr cmd)) (caddr cmd)) (t 1))) (and (< cnt 1) (setq cnt 1)) (setq item (cond ((symbolp (cadr cmd)) (cadr cmd)) ((symbolp (caddr cmd)) (caddr cmd)))) (and item (cond ((memq (car cmd) '(u up)) (setq cmd (cons 'ups (cdr cmd)))) ((memq (car cmd) '(d dn)) (setq cmd (cons 'dns (cdr cmd)))))) (selectq (car cmd) (top (debug-print1 (setq frame topframe) nil)) (bot (debug-print1 (setq frame (car rframelist)) nil)) (p (debug-print1 frame nil)) (pp ($prpr (caddr frame))) (where (debug-where frame)) (help (cond ((cdr cmd) (eval cmd)) (t (ty |/usr/lisp/doc/fixit.ref|)))) ((? h) (ty |/usr/lisp/doc/fixit.ref|)) ((go ok) (setq frame (debug-findexpr topframe)) (cond ((eq (caaddr frame) 'debug) (freturn (cadr frame) t)) (t (fretry (cadr frame) frame)))) (pop (debug-pop)) (step (setq frame (debug-findexpr frame)) (step t) (fretry (cadr (debug-dnframe frame)) frame)) (redo (and item (setq frame (debug-findcall item frame framelist))) (and frame (fretry (cadr frame) frame))) (return (setq val (eval (cadr cmd))) (freturn (cadr frame) val)) (edit (debug-nedit frame)) (editf (cond ((null item) (setq frame (or (debug-findusrfn (debug-nedit frame)) (car rframelist)))) ((dtpr (getd item)) (errset (funcall 'editf (list item)))) (t (setq frame nil)))) (u (debug-iter (debug-upframe frame)) (cond ((null nframe) (terpri) (princ '||))) (debug-print1 (setq frame (or nframe frame)) nil)) (d (setq nframe (or (debug-iter (debug-dnframe frame)) frame)) (debug-print1 nframe nil) (cond ((eq frame nframe) (terpri) (princ '||)) (t (setq frame nframe)))) (up (setq nframe (debug-iter (debug-upfn frame))) (cond ((null nframe) (terpri) (princ '|top of stack|))) (setq frame (or nframe topframe)) (debug-print1 frame nil)) (dn (setq frame (or (debug-iter (debug-dnfn frame)) (car rframelist))) (debug-print1 frame nil) (cond ((not (eq frame nframe)) (terpri) (princ '||)))) (ups (setq frame (debug-iter (debug-findcall item frame rframelist))) (and frame (debug-print1 frame nil))) (dns (setq frame (debug-iter (debug-findcall item frame framelist))) (and frame (debug-print1 frame nil))) (cond ((not (dtpr (car cmd))) (*** should there also be a boundp test here) (debug-showvar (car cmd) frame)) (t (setq frame (car cmd))))) (return (or frame item))))) (def debug-bktrace (lambda (cmd oframe) (prog (sel cnt item frame nframe) (mapc '(lambda (x) (setq sel (cons (selectq x (f 'fns) (a 'sysp) (v 'bind) (e 'expr) (c 'current) 'bogus) sel))) (cddr (explodec (car cmd)))) (setq item (cond ((eq (typep (cadr cmd)) 'symbol) (cadr cmd)) ((eq (typep (caddr cmd)) 'symbol) (caddr cmd)))) (cond ((debug-sysp item) (setq sel (cons 'sysp sel))) ((not (memq 'sysp sel)) (setq sel (cons 'user sel)))) (setq cnt (cond ((fixp (cadr cmd)) (cadr cmd)) ((fixp (caddr cmd)) (caddr cmd)) (item 1))) (cond ((null cnt) (setq frame (cond ((memq 'current sel) oframe) (t (car rframelist)))) (go dbpr)) (( ((null item) (setq frame (car framelist)) (and (or (not (memq 'user sel)) (atom (caddr (car framelist))) (not (debug-sysp (caaddr (car framelist))))) (setq cnt (|1-| cnt))) (setq frame (cond ((zerop cnt) frame) ((memq 'user sel) (debug-iter (debug-dnfn frame))) (t (debug-iter (debug-dnframe frame))))) (setq frame (or frame (car rframelist))) (go dbpr)) (t (setq frame (car framelist)))) (setq frame (cond ((and (= cnt 1) (not (atom (caddr (car framelist)))) (eq item (caaddr (car framelist)))) (car framelist)) ((debug-iter (debug-findcall item frame framelist))) (t (car rframelist)))) dbpr (debug-print frame sel oframe) (cond ((eq frame (car rframelist)) (terpri) (princ '||) (terpri)) (t (terpri))) (cond ((memq 'bogus sel) (terpri) (princ (car cmd)) (princ '| contains an invalid bk modifier|))) (return oframe)))) (def debug-print (lambda (frame sel ptr) (prog (curframe) (setq curframe (car framelist)) loop (cond ((not (and (memq 'user sel) (not (atom (caddr curframe))) (debug-sysp (caaddr curframe)))) (debug-print1 curframe sel) (and (eq curframe ptr) (princ '| <--- you are here|))) ((eq curframe ptr) (terpri) (princ '| <--- you are somewhere in here|))) (and (eq curframe frame) (return frame)) (setq curframe (debug-dnframe curframe)) (or curframe (return frame)) (go loop)))) (def debug-print1 (lambda (frame sel) (prog (prinlevel prinlength varlist) (and (not (memq 'expr sel)) (setq prinlevel 2) (setq prinlength 5)) (cond ((atom (caddr frame)) (terpri) (princ '| |) ($prin1 (caddr frame)) (princ '| <- eval error|) (return t))) (and (memq 'bind sel) (cond ((memq (caaddr frame) '(prog lambda)) (setq varlist (cadr (caddr frame)))) ((and (atom (caaddr frame)) (dtpr (getd (caaddr frame)))) (setq varlist (cadr (getd (caaddr frame)))))) (mapc (function (lambda (v) (debug-showvar v (or (debug-upframe frame) frame)))) (cond ((and varlist (atom varlist)) (ncons varlist)) (t varlist)))) (and (memq 'user sel) (debug-sysp (caaddr frame)) (return nil)) (cond ((memq (caaddr frame) interrupt-handlers) (terpri) (princ '<------------) ($prin1 (cadr (assq (caaddr frame) handler-labels))) (princ '-->)) ((eq (caaddr frame) 'debug) (terpri) (princ '<------debug------>)) ((memq 'fns sel) (terpri) (and (debug-sysp (caaddr frame)) (princ '| |)) ($prin1 (caaddr frame))) (t (terpri) ($prin1 (cond ((eq (car frame) 'eval) (caddr frame)) (t (cons (caaddr frame) (cadr (caddr frame)))))))) (or (not (symbolp (caaddr frame))) (eq (caaddr frame) (concat (caaddr frame))) (princ '| |)) (return t)))) (def debug-findcall (lambda (fn frame flist) (prog nil loop (setq frame (debug-nextframe frame flist nil)) (or frame (return nil)) (cond ((atom (caddr frame)) (cond ((eq (caddr frame) fn) (return frame)) (t (go loop)))) ((eq (caaddr frame) fn) (return frame)) (t (go loop)))))) (def debug-scanflist (lambda (frame fnset) (prog nil loop (or frame (return nil)) (and (not (atom (caddr frame))) (memq (caaddr frame) fnset) (return frame)) (setq frame (debug-dnframe frame)) (go loop)))) (def debug-scanstk (lambda (frame fnset) (prog nil loop (or frame (return nil)) (and (not (atom (caddr frame))) (memq (caaddr frame) fnset) (return frame)) (setq frame (evalframe (cadr frame))) (go loop)))) (def debug-getframes (lambda nil (prog (flist fnew) (setq fnew (debug-scanstk '(nil) (cons 'debug interrupt-handlers))) loop (and (not (atom (caddr fnew))) (eq (caaddr fnew) 'debug) (eq (car (evalframe (cadr fnew))) 'apply) (memq (caaddr (evalframe (cadr fnew))) interrupt-handlers) (setq fnew (evalframe (cadr fnew)))) (and (null flist) (eq (car fnew) 'apply) (memq (caaddr fnew) interrupt-handlers) (setq fnew (evalframe (cadr fnew)))) (and (eq (car fnew) 'apply) (eq (typep (caaddr fnew)) 'symbol) (not (eq (caaddr fnew) (concat (caaddr fnew)))) (setq fnew (evalframe (cadr fnew))) (setq fnew (evalframe (cadr fnew))) (setq fnew (evalframe (cadr fnew))) (setq fnew (evalframe (cadr fnew))) (go loop)) (and (not (atom (caddr fnew))) (memq (caaddr fnew) '(evalhook* evalhook)) (setq fnew (evalframe (cadr fnew))) (go loop)) (and (eq (car fnew) 'apply) (eq (caaddr fnew) 'eval) (cadadr (caddr fnew)) (or (not (fixp (cadadr (caddr fnew)))) (= (cadadr (caddr fnew)) -1)) (setq fnew (evalframe (cadr fnew))) (go loop)) (and fnew (setq flist (cons fnew flist)) (setq fnew (evalframe (cadr fnew))) (go loop)) (return (nreverse flist))))) (def debug-nextframe (lambda (frame flist sel) (prog nil (setq flist (cdr (memq frame flist))) (and (not (memq 'user sel)) (return (car flist))) loop (or flist (return nil)) (cond ((or (atom (caddr (car flist))) (not (debug-sysp (caaddr (car flist))))) (return (car flist)))) (setq flist (cdr flist)) (go loop)))) (def debug-upframe (lambda (frame) (debug-nextframe frame rframelist nil))) (def debug-dnframe (lambda (frame) (debug-nextframe frame framelist nil))) (def debug-upfn (lambda (frame) (debug-nextframe frame rframelist '(user)))) (def debug-dnfn (lambda (frame) (debug-nextframe frame framelist '(user)))) (def debug-showvar (lambda (var frame) (terpri) (princ '| |) (princ var) (princ '| = |) ($prin1 ((lambda (val) (cond ((atom val) '?) (t (car val)))) (errset (eval var (cadddr frame)) nil))))) (def debug-nedit (lambda (frame) (prog (val body elem nframe) (setq elem (caddr frame)) (setq val frame) scan (setq val (debug-findusrfn val)) (or val (go nofn)) (setq body (getd (caaddr val))) (cond ((debug-insidep elem body) (princ '=) ($prin1 (caaddr val)) (edite body (list 'f (cons '== elem) 'tty:) (caaddr val)) (return frame)) ((or (eq elem (caddr val)) (debug-insidep elem (caddr val))) (setq val (debug-dnframe val)) (go scan))) nofn (setq nframe (debug-dnframe frame)) (or nframe (go doit)) (and (debug-insidep elem (caddr nframe)) (setq frame nframe) (go nofn)) doit (edite (caddr frame) (and (debug-insidep elem (caddr frame)) (list 'f (cons '== elem) 'tty:)) nil) (return frame)))) (def debug-insidep (lambda (elem expr) (car (errset (edite expr (list 'f (cons '== elem)) nil))))) (def debug-findusrfn (lambda (frame) (cond ((null frame) nil) ((and (dtpr (caddr frame)) (symbolp (caaddr frame)) (dtpr (getd (caaddr frame)))) frame) (t (debug-findusrfn (debug-dnframe frame)))))) (def debug-findexpr (lambda (frame) (cond ((null frame) nil) ((and (eq (car frame) 'eval) (not (atom (caddr frame)))) frame) (t (debug-findexpr (debug-dnframe frame)))))) (def debug-pop (lambda nil (prog (frame) (setq frame (car framelist)) l (cond ((null (setq frame (evalframe (cadr frame))))(reset))) (cond ((and (dtpr (caddr frame))(eq (caaddr frame) 'debug)) (freturn (cadr frame) nil))) (go l)))) (def debug-where (lambda (frame) (prog (lev diff nframe) (setq lev (- (length framelist) (length (memq frame rframelist)))) (setq diff (- (length framelist) lev 1)) (debug-print1 frame nil) (terpri) (cond ((zerop diff) (princ '|you are at top of stack.|)) ((zerop lev) (princ '|you are at bottom of stack.|)) (t (princ '|you are |) (princ diff) (cond ((= diff 1) (princ '| frame from the top.|)) (t (princ '| frames from the top.|))))) (terpri) (and (or (atom (caddr frame)) (not (eq (car(( frame) 'eval))) (return nil)) (setq lev 0) (setq nframe frame) lp (and (setq nframe (debug-findcall (caaddr nframe) nframe framelist)) (setq lev (|1+| lev)) (go lp)) (princ '|there are |) (princ lev) (princ '| |) (princ (caaddr frame)) (princ '|'s below.|) (terpri)))) (def debug-sysp (lambda (x) (and (sysp x) (symbolp x) (not (dtpr (getd x)))))) (dv interrupt-handlers (fixit)) (dv handler-labels ((fixit error) (debug-ubv-handler ubv) (debug-udf-handler udf) (debug-fac-handler fac) (debug-ugt-handler ugt) (debug-wta-handler wta) (debug-wna-handler wna) (debug-iol-handler iol) (debug-*rset-handler rst) (debug-mer-handler mer) (debug-gcd-handler gcd) (debug-gcl-handler gcl) (debug-gco-handler gco) (debug-pdl-handler pdl))) (or (boundp 'traced-stuff) (setq traced-stuff nil)) (or (boundp 'evalhook-switch) (setq evalhook-switch nil)) (setq hush-debug nil) (debug-ubv-handler ubv) (debug-udf-handler udf) (debug-fac-handler fac) (debug-ugt-handler ugt) (debug-wta-handler wta) (debug-wna-handler wna) (debug-iol-handler iol) (debug-*rset-handler rst) (debug-mer-handler mer) (debug-gcd-handler gcd) (debug-gcl-handler gcl) (debug-gco-handler gco) (debug-pdl-handler pdl))) (or (boundp 'traced-stuff) (setq traced-stuff nil)) (or (boundp 'evalhook-switch)cmd/lisp/lib/cmulisp/ipclencode.l 644 321 12 26156 2552717616 12361 (dv ipclencodefns ((declare (special descr_index data_index)) GetType IPCGetDNumElts IPCGetDOffset IPCGetDType IPCInitLSMsg IPCPutDNumElts IPCPutDOffset IPCPutDType IPCPutLSDescriptor IPCSExprConstruct IPCSExprDecode IPCSExprDecode1 IPCSExprEncode IPCSExprExtract PutType)) (declare (special descr_index data_index)) (def GetType (lambda (index array) (cdr ((lambda (type_atom) (cond ((not type_atom) (err '|Bad type code encountered by GetType|)) (type_atom))) (assq (GetInteger index array) '((0 . UNSTRUCTURED) (1 . LINEARSTRUCTURE) (2 . INTEGER) (3 . PTOWNERSHIP) (4 . PTRECEIVERIGHTS) (5 . PTALLRIGHTS) (6 . PT) (7 . DESCRIPTOR) (8 . CHAR) (9 . LIST) (10 . NIL) (11 . REAL] (def IPCGetDNumElts (lambda (index array) (GetInteger (|1+| (times 3 index)) array))) (def IPCGetDOffset (lambda (index array) (GetInteger (plus 2 (times 3 index)) array))) (def IPCGetDType (lambda (index array) (GetType (times 3 index) array))) (def IPCInitLSMsg (lambda (locpt ltyp rempt rtyp id mtyp msg ls descr data) (IPCSetLocalPort locpt msg) (IPCSetLPType ltyp msg) (IPCSetRemotePort rempt msg) (IPCSetRPType rtyp msg) (IPCSetID id msg) (IPCSetNumElts 1 msg) (IPCSetMsgType mtyp msg) (IPCSetType 'LINEARSTRUCTURE msg) (IPCSetDataPtr ls msg) (IPCSetLSPtr descr ls) (IPCSetLSDataPtr data ls) (IPCSetLSSize (times (getlength descr) (getdelta descr)) ls) (IPCSetLSDataSize (times (getlength data) (getdelta data)) ls))) (def IPCPutDNumElts (lambda (index num_elts array) (PutInteger (|1+| (times 3 index)) num_elts array))) (def IPCPutDOffset (lambda (index offset array) (PutInteger (plus 2 (times 3 index)) offset array))) (def IPCPutDType (lambda (index type array) (PutType (times 3 index) type array))) (def IPCPutLSDescriptor (lambda (index dtype dnumelts doffset array) (IPCPutDType index dtype array) (IPCPutDNumElts index dnumelts array) (IPCPutDOffset index doffset array) t)) (def IPCSExprConstruct (lexpr (nargs) ((lambda (x locpt ltyp rempt rtyp id mtyp msg ls descr data port_atom) (IPCInitLSMsg locpt ltyp rempt rtyp id mtyp msg ls descr data) (cond (port_atom (IPCSExprEncode x descr data 0 0 port_atom)) ((IPCSExprEncode x descr data 0 0)))) (arg 1) (arg 2) (arg 3) (arg 4) (arg 5) (arg 6) (arg 7) (arg 8) (arg 9) (arg 10) (arg 11) (cond ((greaterp nargs 11) (arg 12)))))) (def IPCSExprDecode (lambda (descr data descr_index data_index) (IPCSExprDecode1 descr data))) (def IPCSExprDecode1 (lambda (descr data) ((lambda (data_type) (cond ((member data_type '(REAL INTEGER CHAR NIL PT PTOWNERSHIP PTRECEIVERIGHTS PTALLRIGHTS)) (cond ((eq data_type 'REAL) (prog1 (GetReal data_index data) (setq data_index (plus 2 data_index)) (setq descr_index (|1+| descr_index)))) ((member data_type '(INTEGER PT PTOWNERSHIP PTRECEIVERIGHTS PTALLRIGHTS)) (prog1 (GetInteger data_index data) (setq data_index (add1 data_index)) (setq descr_index (|1+| descr_index)))) ((eq data_type 'NIL) (setq descr_index (|1+| descr_index)) nil) ((eq data_type 'CHAR) (prog1 (GetAtom1 (times 4 data_index) data) (setq data_index (plus data_index (car (Divide (plus (IPCGetDNumElts descr_index descr) 3) 4)))) (setq descr_index (|1+| descr_index)))))) ((eq data_type 'LIST) (prog (result temp num_elts) (setq num_elts (IPCGetDNumElts descr_index descr)) (setq descr_index (|1+| descr_index)) (setq result (cons (IPCSExprDecode1 descr data) nil)) (setq temp result) (setq num_elts (|1-| num_elts)) loop (cond ((eq num_elts 1) (rplacd temp (IPCSExprDecode1 descr data)) (return result)) (t (rplacd temp (cons (IPCSExprDecode1 descr data) nil)) (setq temp (cdr temp)) (setq num_elts (|1-| num_elts)) (go loop))))))) (IPCGetDType descr_index descr)))) (def IPCSExprEncode (lexpr (args) ((lambda (x descr data descr_index data_index port_atom) (cond ((or (atom x) (and (car x) (equal (car x) port_atom))) (cond ((floatp x) (IPCPutLSDescriptor descr_index 'REAL 1 data_index descr) (PutReal data_index x data) (cons (|1+| descr_index) (plus 2 data_index))) ((dtpr x) (IPCPutLSDescriptor descr_index (cadr x) 1 data_index descr) (PutInteger data_index (caddr x) data) (cons (|1+| descr_index) (|1+| data_index))) ((fixp x) (IPCPutLSDescriptor descr_index 'INTEGER 1 data_index descr) (PutInteger data_index x data) (cons (|1+| descr_index) (|1+| data_index))) ((not x) (IPCPutLSDescriptor descr_index 'NIL 0 data_index descr) (cons (|1+| descr_index) data_index)) ((symbolp x) ((lambda (atom_length) (IPCPutLSDescriptor descr_index 'CHAR atom_length data_index (( descr) (cons (|1+| descr_index) (plus (car (Divide (plus atom_length 3) 4)) data_index))) (PutAtom1 (times 4 data_index) x data))) (t (err (concat '|Unknown type to IPCSExprEncode -- | (type x)))))) ((dtpr x) (IPCPutLSDescriptor descr_index 'LIST (do ((num_elts 0 (|1+| num_elts)) (list x (cdr list))) ((atom list) (|1+| num_elts))) data_index descr) (prog (index_list) (setq index_list (cons (|1+| descr_index) data_index)) loop (cond ((atom x) (return (IPCSExprEncode x descr data (car index_list) (cdr index_list) port_atom)))) (setq index_list (IPCSExprEncode (car x) descr data (car index_list) (cdr index_list) port_atom)) (setq x (cdr x)) (go loop))) (t (err (concat '|Unknown type to IPCSExprEncode -- | (type x)))))) (arg 1) (arg 2) (arg 3) (arg 4) (arg 5) (cond ((greaterp args 5) (arg 6)))))) (def IPCSExprExtract (lambda (message) ((lambda (LS) (IPCSExprDecode (IPCGetLSPtr LS) (IPCGetLSDataPtr LS) 0 0)) (IPCGetDataPtr message)))) (def PutType (lambda (index type array) ((lambda (type_integer) (cond ((not type_integer) (err '|Bad type atom to PutType|)) ((PutInteger index type_integer array)))) (cdr (assq type '((UNSTRUCTURED . 0) (LINEARSTRUCTURE . 1) (INTEGER . 2) (PTOWNERSHIP . 3) (PTRECEIVERIGHTS . 4) (PTALLRIGHTS . 5) (PT . 6) (DESCRIPTOR . 7) (CHAR . 8) (LIST . 9) (NIL . 10) (REAL . 11))))))) (cond ((not type_integer) (err '|Bad type atom to PutType|)) ((PutInteger index type_integer array)))) (cdr (assq type '((UNSTRUCTURED . 0) (LINEARSTRUCTURE . 1) (INTEGER . 2) (PTOWNERSHIP . 3) (PTRECEIVERIGHTS . 4) (PTALLRIGHTS . 5) (PT . 6) (DESCRIPTOR . cmd/lisp/lib/cmulisp/ipclinks.l 644 321 12 10545 2552717617 12064 (cfasl 'ipcfuncs.o '_IPCAllocatePort 'IPCAllocatePort "integer-function" "-lipc -lcmu -lc") (getaddress '_IPCDeallocatePort 'IPCDeallocatePort "integer-function") (getaddress '_IPCIncrementUseCount 'IPCIncrementUseCount "integer-function") (getaddress '_IPCDecrementUseCount 'IPCDecrementUseCount "integer-function") (getaddress '_IPCSetBacklog 'IPCSetBacklog "integer-function") (getaddress '_IPCSend 'IPCSend "integer-function") (getaddress '_IPCReceive 'IPCRecieve "integer-function") (getaddress '_IPCPreview 'IPCPreview "integer-function") (getaddress '_IPCMessageWait 'IPCMessageWait "integer-function") (getaddress '_IPCPortsWithMessagesWaiting 'IPCPortsWithMessagesWaiting "integer-function") (getaddress '_IPCDefineSignal 'IPCDefineSignal "integer-function") (getaddress '_IPCGetSignal 'IPCGetSignal "integer-function") (getaddress '_IPCDismissSignal 'IPCDismissSignal "integer-function") (getaddress '_IPCClearSignal 'IPCClearSignal "integer-function") (getaddress '_IPCAssertName 'IPCAssertName "integer-function") (getaddress '_IPCLocate 'IPCLocate "integer-function") (getaddress '_IPCRemoveName 'IPCRemoveName "integer-function") (getaddress '_IPCGetMsgType 'IPCGetMsgType "integer-function") (getaddress '_IPCSetLPType 'IPCSetLPType "integer-function") (getaddress '_IPCSetLocPT 'IPCSetLocalPort "integer-function") (getaddress '_IPCGetLocPT 'IPCGetLocalPort "integer-function") (getaddress '_IPCSetRPType 'IPCSetRPType "integer-function") (getaddress '_IPCGetRPType 'IPCGetRPType "integer-function") (getaddress '_IPCSetRemPT 'IPCSetRemotePort "integer-function") (getaddress '_IPCGetRemPT 'IPCGetRemotePort "integer-function") (getaddress '_IPCSetID 'IPCSetID "integer-function") (getaddress '_IPCGetID 'IPCGetID "integer-function") (getaddress '_IPCSetType 'IPCSetType "integer-function") (getaddress '_IPCGetType 'IPCGetType "integer-function") (getaddress '_IPCSetNumElts 'IPCSetNumElts "integer-function") (getaddress '_IPCGetNumElts 'IPCGetNumElts "integer-function") (getaddress '_IPCSetDataPtr 'IPCSetDataPtr "integer-function") (getaddress '_IPCGetDataPtr 'IPCGetDataPtr "integer-function") (getaddress '_IPCMsgAlloc 'IPCMsgAlloc "integer-function") (getaddress '_IPCMsgFree 'IPCMsgFree "integer-function") (getaddress '_IPCSetLSSize 'IPCSetLSSize "integer-function") (getaddress '_IPCGetLSSize 'IPCGetLSSize "integer-function") (getaddress '_IPCSetLSPtr 'IPCSetLSPtr "integer-function") (getaddress '_IPCGetLSPtr 'IPCGetLSPtr "integer-function") (getaddress '_IPCSetLSDataSize 'IPCSetLSDataSize "integer-function") (getaddress '_IPCGetLSDataSize 'IPCGetLSDataSize "integer-function") (getaddress '_IPCSetLSDataPtr 'IPCSetLSDataPtr "integer-function") (getaddress '_IPCGetLSDataPtr 'IPCGetLSDataPtr "integer-function") (getaddress '_IPCLSAlloc 'IPCLSAlloc "integer-function") (getaddress '_IPCLSFree 'IPCLSFree "integer-function") (getaddress '_IPCPtSetAlloc 'IPCPortSetAlloc "integer-function") (getaddress '_IPCPtSetFree 'IPCPortSetFree "integer-function") (getaddress '_IPCClearPort 'IPCClearPortSet "integer-function") (getaddress '_IPCCopyPort 'IPCCopyPortSet "integer-function") (getaddress '_IPCUnionPort 'IPCUnionPortSet "integer-function") (getaddress '_IPCIntersectPort 'IPCIntersectPortSet "integer-function") (getaddress '_IPCMemberPort 'IPCMemberPortSet? "integer-function") (getaddress '_IPCSizeOfPortSet 'IPCSizeOfPortSet "integer-function") (getaddress '_bitcount 'bitcount "integer-function") (getaddress '_IPCFullPortSet 'IPCFullPortSet? "integer-function") (getaddress '_IPCEmptyPortSet 'IPCEmptyPortSet? "integer-function") (getaddress '_IPCAddToPortSet 'IPCAddToPortSet "integer-function") (getaddress '_IPCDelFromPortSet 'IPCDelFromPortSet "integer-function") (getaddress '_IPCNameDataArray 'IPCNameDataArray "integer-function") (getaddress '_putbyte 'PutByte "integer-function") (getaddress '_putatom 'PutAtom "integer-function") (getaddress '_GetAtom 'GetAtom "function") (getaddress '_PutAtom1 'PutAtom1 "integer-function") (getaddress '_GetAtom1 'GetAtom1 "function") (getaddress '_GetBits 'GetBits "integer-function") (getaddress '_LeftShift 'LeftShift "integer-function") (getaddress '_RightShift 'RightShift "integer-function") (getaddress '_GetByte 'GetByte "integer-function") (getaddress '_GetInteger 'GetInteger "integer-function") (getaddress '_PutInteger 'PutInteger "integer-function") (getaddress '_IPCGetReal 'GetReal "real-function") (getaddress '_IPCPutReal 'PutReal "real-function") tAtom1 'PutAtom1 "integer-function") (getaddress '_GetAtom1 'GetAtom1 "function") (getaddress '_GetBits 'GetBits "integer-function") (getaddress '_LeftShifcmd/lisp/lib/cmulisp/ipclistener.l 644 321 12 1643 2552717617 12550 (dv ipclistenerfns (IPCListener)) (def IPCListener (lambda nil (setq message (IPCMsgAlloc)) (setq receive_port (IPCAllocatePort 1)) (IPCAssertName 'larswe receive_port) (setq descr (array descr fixnum 100)) (setq data (array data fixnum 100)) (setq ls (IPCLSAlloc)) (prog nil loop (IPCInitLSMsg receive_port 'PT 0 'PT -10 'NORMALMSG message ls descr data) (setq received (IPCReceive -1 message 10000)) (cond ((eq received t) (princ (concat '"[" (IPCGetID message) '"]")) (princ (IPCSExprExtract message)) (terpri)) (t (princ '"Timeout. ") (princ received) (terpri))) (go loop)))) 'PT -10 'NORMALMSG ((cmd/lisp/lib/cmulisp/ipcsender.l 755 321 12 2057 2552717617 12206 (dv ipcsenderfns (IPCSender)) (def IPCSender (lambda nil (setq message (IPCMsgAlloc)) (setq ls (IPCLSAlloc)) (setq descr (array descr fixnum 100)) (setq data (array data fixnum 100)) (setq localport (IPCAllocatePort 1)) (setq remoteport (IPCLocate 'larswe)) (cond (remoteport (print '"Located listener.") (terpri))) (setq local_port_type 'PT) (setq remote_port_type 'PT) (setq i 0) (prog nil loop (setq i (|1+| i)) (princ 'Send>) (setq input (read)) (princ (concat '"Sending message " i '".")) (terpri) (IPCSExprConstruct input localport local_port_type remoteport remote_port_type i 'NORMALMSG message ls descr data) (IPCSend message 0 'WAIT) (go loop)))) message " i '".")) (terpri) (IPCSExprConstruct input localport local_port_type remoteport remote_port_type i 'NORMALMSG message ls descr data) (Icmd/lisp/lib/cmulisp/lload.l 644 321 12 2311 2552717617 11313 (dv lloadfns ((declare (special dc-switch)) load)) (declare (special dc-switch)) (def load (lambda (file) (prog (port oldswitch piport loading) (setq oldswitch (or (and (boundp 'dc-switch) dc-switch) 'dc-define)) (setq dc-switch 'dc-dskin) (setq loading t) (cond ((null (setq port (car (errset (infile file) nil)))) (setq port (car (errset (infile (concat file ".l")) nil))))) (cond ((null port) (err '|load: file not found|))) (setq piport port) (prog (form) loop (setq form (read port '%#%#%#%#%EOF)) (cond ((eq '%#%#%#%#%EOF form) (return file)) ((atom form) (eval form)) ((and (member (car form) '(def defun dv putprop defprop)) (getd (cadr form))) (princ "[Redefining ") (princ (cadr form)) (princ "]") (terpri) (eval form)) (t (eval form))) (go loop)) (setq dc-switch oldswitch)))) ) ((atom form) (eval form)) ((and (member (car form) '(def defun dv putprop defprop)) (getd (cadr form))) (princ "[Redefining ") (princ (cadr form)) cmd/lisp/lib/cmulisp/newtrace.l 644 321 12 27247 2552717621 12062 (setq SCCS-trace "@(#)trace.l 1.5 11/7/80") ; LWE 11/25/80: Maybe this will make it behave like interpreted: (declare (special tmp typ $$traced-functions$$)) ;---- The Joseph Lister Trace Package, v1 ; John Foderaro, Sept 1979 ;------------------------------------------------------------------; ; Copyright (c) 1979 The Regents of the University of California ; ; All rights reserved. ; ;------------------------------------------------------------------; (eval-when (eval) (setq old-read-table-trace readtable) ; LWE 1/11/81 DNC didn't like this, so I don't either. ; He says: "because we LIKE our readtable -- it allows us to read this file." ; (setq readtable (makereadtable t)) (setq old-uctolc-value (status uctolc)) (sstatus uctolc nil) ; turn off case conversion ; LWE 1/11/81 DNC didn't like this one, either. ; He says: "we have our own backquote." ; (load 'backquote) ) (declare (nlambda T-status T-sstatus) (special piport if ifnot evalin evalout printargs printres evfcn traceenter traceexit prinlevel prinlength $$functions-in-trace$$ ; active functions $$funcargs-in-trace$$ ; arguments to active functions. )) (cond ((null (boundp '$$traced-functions$$)) (setq $$traced-functions$$ nil))) (cond ((null (boundp '$$functions-in-trace$$)) (setq $$functions-in-trace$$ nil))) (cond ((null (boundp '$$funcargs-in-trace$$)) (setq $$funcargs-in-trace$$ nil))) ;----> It is important that the trace package not use traced functions ; thus we give the functions the trace package uses different ; names and make them equivalent at this time to their ; traceable counterparts. (do ((i '( (add1 T-add1)(append T-append) (and T-and) (apply T-apply) (cond T-cond) (cons T-cons) (delq T-delq) (def T-def) (do T-do) (drain T-drain) (dtpr T-dtpr) (eval T-eval)(funcall T-funcall) (get T-get) (getd T-getd)(getdisc T-getdisc) (greaterp T-greaterp)(lessp T-lessp) (mapc T-mapc) (not T-not) (patom T-patom) (print T-print) (prog T-prog) (patom T-patom)(putd T-putd) (putprop T-putprop) (read T-read)(remprop T-remprop) (reverse T-reverse) (return T-return) (set T-set) (setq T-setq) (status T-status) (sstatus T-sstatus) (sub1 T-sub1) (terpr T-terpr) (zerop T-zerop)) (cdr i))) ((null i)) (putd (cadar i) (getd (caar i))) (putprop (cadar i) t 'Untraceable)) (putprop 'quote t 'Untraceable) ; this prevents the common error ; of (trace 'foo) from causing big ; problems. ;--- trace - arg1,arg2, ... names of functions to trace ; This is the main user callable trace routine. ; work in progress, documentation incomplete since im not sure exactly ; where this is going. ; (def trace (nlambda (argl) (prog (if ifnot evalin evalout funnm funcd did break printargs printres evfcn traceenter traceexit) ; turn off transfer table linkages if they are on (cond ((T-status translink) (T-sstatus translink nil))) ; process each argument (do ((ll argl (cdr ll)) (funnm) (funcd)) ((null ll)) (setq funnm (car ll) if t break nil ifnot nil evalin nil evalout nil printargs nil printres nil evfcn nil traceenter 'T-traceenter traceexit 'T-traceexit) ; a list as an argument means that the user is specifying ; conditions on the trace (cond ((not (atom funnm)) (cond ((not (atom (setq funnm (car funnm)))) (T-print (car funnm)) (T-patom '" is non an function name") (go botloop))) (do ((rr (cdar ll) (cdr rr))) ((null rr)) (cond ((memq (car rr) '(if ifnot evalin evalout printargs printres evfcn traceenter traceexit)) (T-set (car rr) (cadr rr)) (setq rr (cdr rr))) ((eq (car rr) 'evalinout) (setq evalin (setq evalout (cadr rr)) rr (cdr rr))) ((eq (car rr) 'break) (setq break t)) ((eq (car rr) 'lprint) (setq printargs 'T-levprint printres 'T-levprint)) (t (T-patom '"bad request: ") (T-print (car rr)) (T-terpr)))))) ; if function is untraceable, print error message and skip (cond ((get funnm 'Untraceable) (setq did (cons `(,funnm untraceable) did)) (go botloop))) ; if function is already traced, untrace it first (cond ((get funnm 'original) (apply 'untrace `(,funnm)) (setq did (cons `(,funnm untraced) did)))) ; store the names of the arg printing routines if they are ; different than print (cond (printargs (T-putprop funnm printargs 'trace-printargs))) (cond (printres (T-putprop funnm printres 'trace-printres))) ; we must determine the type of function being traced ; in order to create the correct replacement function (cond ((setq funcd (T-getd funnm)) (cond ((bcdp funcd) ; machine code (cond ((or (eq 'lambda (T-getdisc funcd)) (eq 'nlambda (T-getdisc funcd)) (eq 'macro (T-getdisc funcd))) (setq typ (T-getdisc funcd))) ((stringp (T-getdisc funcd)) ; foreign func (setq typ 'lambda)) ; close enough (t (T-patom '"Unknown type of compiled function") (T-print funnm) (setq typ nil)))) ((dtpr funcd) ; lisp coded (cond ((or (eq 'lambda (car funcd)) (eq 'lexpr (car funcd))) (setq typ 'lambda)) ((or (eq 'nlambda (car funcd)) (eq 'macro (car funcd))) (setq typ (car funcd))) (t (T-patom '"Bad function definition: ") (T-print funnm) (setq typ nil)))) ((arrayp funcd) ; array (setq typ 'lambda)) (t (T-patom '"Bad function defintion: ") (T-print fun((nm))) ; now that the arguments have been examined for this ; function, do the tracing stuff. ; First save the old function on the property list (T-putprop funnm funcd 'original) ; now build a replacement (cond ((eq typ 'lambda) (T-eval `(T-def ,funnm (lexpr (T-nargs) ((lambda (T-arglst T-res T-rslt $$functions-in-trace$$ $$funcargs-in-trace$$) (T-do ((i T-nargs (T-sub1 i))) ((T-zerop i)) (T-setq T-arglst (T-cons (arg i) T-arglst))) (T-setq $$funcargs-in-trace$$ (T-cons T-arglst $$funcargs-in-trace$$)) (T-cond ((T-setq T-res (T-and ,if (T-not ,ifnot))) (,traceenter ',funnm T-arglst) ,evalin (T-cond (,break (trace-break))))) (T-setq T-rslt ,(cond (evfcn) (t `(T-apply ',funcd T-arglst)))) (T-cond (T-res ,evalout (,traceexit ',funnm T-rslt))) T-rslt) nil nil nil (cons ',funnm $$functions-in-trace$$) $$funcargs-in-trace$$)))) (setq did (cons funnm did) $$traced-functions$$ (cons funnm $$traced-functions$$))) ((or (eq typ 'nlambda) (eq typ 'macro)) (T-eval `(T-def ,funnm (,typ (T-arglst) ((lambda (T-res T-rslt $$functions-in-trace$$ $$funcargs-in-trace$$) (T-setq $$funcargs-in-trace$$ (T-cons T-arglst $$funcargs-in-trace$$)) (T-cond ((T-setq T-res (T-and ,if (not ,ifnot))) (,traceenter ',funnm T-arglst) ,evalin (T-cond (,break (trace-break))))) (T-setq T-rslt ,(cond (evfcn `(,evfcn ',funcd T-arglst)) (t `(T-apply ',funcd T-arglst)))) (T-cond (T-res ,evalout (,traceexit ',funnm T-rslt))) T-rslt) nil nil (cons ',funnm $$functions-in-trace$$) $$funcargs-in-trace$$)))) (setq did (cons funnm did) $$traced-functions$$ (cons funnm $$traced-functions$$))) (t (T-patom '"No such function as: ") (T-print funnm) (T-terpr))))) botloop ) (return (nreverse did))))) ;--- untrace ; (untrace foo bar baz) ; untraces foo, bar and baz. ; (untrace) ; untraces all functions being traced. ; (def untrace (nlambda (argl) (cond ((null argl) (setq argl $$traced-functions$$))) (do ((i argl (cdr i)) (curf) (res)) ((null i) (cond ((null $$traced-functions$$) (setq $$functions-in-trace$$ nil) (setq $$funcargs-in-trace$$ nil))) res) (cond ((setq tmp (T-get (setq curf (car i)) 'original)) ; we only want to restore the original definition ; if this function has not been redefined! ; we can check if it has been redefined by seeing ; if its current definition is one the trace package ; would generate. (let ((funcdef (T-getd curf))) (cond ((and (dtpr funcdef) (dtpr (cadr funcdef)) (memq (caadr funcdef) '(T-nargs T-arglst))) (T-putd curf tmp)))) (T-remprop curf 'original) (T-remprop curf 'entercount) (setq $$traced-functions$$ (T-delq curf $$traced-functions$$)) (setq res (cons curf res))) (t (setq res (cons `(,curf not traced) res))))))) ;--- tracedump :: dump the currently active trace frames ; (def tracedump (lambda nil (T-tracedump-recursive $$functions-in-trace$$ $$funcargs-in-trace$$))) ;--- T-tracedump-recursive ; since the lists of functions being traced and arguments are in the reverse ; of the order we want to print them, we recurse down the lists and on the ; way back we print the information. ; (def T-tracedump-recursive (lambda ($$functions-in-trace$$ $$funcargs-in-trace$$) (cond ((null $$functions-in-trace$$)) (t (T-tracedump-recursive (cdr $$functions-in-trace$$) (cdr $$funcargs-in-trace$$)) (T-traceenter (car $$functions-in-trace$$) (car $$funcargs-in-trace$$)))))) ;--- T-traceenter - funnm : name of function just entered ; - count : count to print out ; This routine is called to print the entry banner for a ; traced function. ; (def T-traceenter (lambda (name args) (prog (count indent) (setq count 0 indent 0) (do ((ll $$functions-in-trace$$ (cdr ll))) ((null ll)) (cond ((eq (car ll) name) (setq count (1+ count)))) (setq indent (1+ indent))) (T-traceindent indent) (T-print count) (T-patom '" ") (T-print name) (T-patom '" ") (cond ((setq count (T-get name 'trace-printargs)) (T-funcall count args)) (t (T-print args))) (T-terpr)))) (def T-traceexit (lambda (name res) (prog (count indent) (setq count 0 indent 0) (do ((ll $$functions-in-trace$$ (cdr ll))) ((null ll)) (cond ((eq (car ll) name) (setq count (1+ count)))) (setq indent (1+ indent))) (T-traceindent indent) (T-print count) (T-patom " ") (T-print name) (T-patom " ") (cond ((setq count (T-get name 'trace-printres)) (T-funcall count res)) (t (T-print res))) (T-terpr)))) ; T-traceindent ; - n : indent to column n (def T-traceindent (lambda (col) (do ((i col (1- i)) (char '| |)) ((< i 2)) (T-patom (cond ((eq char '| |) (setq char '\|)) (t (setq char '| |))))))) ; trace-break - this is the trace break loop (def trace-break (lambda nil (prog (tracevalread piport) (T-terpr) (T-patom '"[tracebreak]") loop (T-terpr) (T-patom '"T>") (T-drain) (cond ((or (eq ' (setq tracevalread (car (errset (T-read nil '))))) (and (dtpr tracevalread) (eq 'tracereturn (car tracevalread)))) (T-terpr) (return nil))) (T-print (car (errset (T-eval tracevalread)))) (go loop)))) (def T-levprint (lambda (x) ((lambda (prinlevel prinlength) (print x)) 3 10))) (eval-when (eval) (apply 'sstatus `(uctolc ,old-uctolc-value)) (setq readtable old-read-table-trace) ) drain) (cond ((or (eq ' (setq tracevalread (car (errset (T-read nil '))))) (and (dtpr tracevalread) (eq 'tracereturn (car tracevalread)))) (T-terpr) (return nil))) (T-print (car (errset (T-eval tracevalread)))) (go loop)))) (def T-levprint (lambda (x) ((lambda (prcmd/lisp/lib/cmulisp/oldloader.l 644 321 12 2126 2552717624 12167 '(LWE 1/28/80 This is the file to load newlisp from new cmutlisp) (load 'backquote) (fasl 'auxfns0) (load 'dv) (load 'ipclinks) (load 'atlinks0) (load 'atlinks1) (load 'atlinks2) (cfasl 'getwdir.o '_Mygetwd 'getwd "function" "-lcmu") ; (cfasl 'untyi.o '_Luntyi 'untyi "function" "-lcmu") (load 'compl) (load 'auxfns1) (load 'toplevel) (load 'cmu2.l) (load 'cmu3) (load 'edits) (load 'cmu4) (print "error test") (errset (mumble) nil) (load 'step) (print "error test") (errset (mumble) nil) (load 'newtrace) (print "error test") (errset (mumble) nil) (load 'sysfunc) (print "error test") (errset (mumble) nil) (load 'fix) (print "error test") (errset (mumble) nil) (load 'ipclencode) (load 'cmu) (load 'pp) (load 'pcom) (print "error test") (errset (mumble) nil) (setq top-level (getd 'top-level)) (defun top-level nil (prog nil (putd 'top-level top-level) (setq %changes nil) (princ '"/usr/lisp/newlisp 3-8-81. pp works on *** and comment. " nil) (errset (read-in-lisprc-file) nil) (reset] (setq %changes nil) (gc) (print "error test") (errset (mumble) nil) (sstatus dumpmode 413) (dumplisp newlisp) ble) nil) (load 'fix) (print "error test") (errset (mumble) nil) (load 'ipclencode) (load 'cmu) (load 'pp) (load 'pcom) (print "error test") (errset (mumble) nil) (setq top-level (getd 'top-level)) (defun top-level nil (prog nil (putd 'top-level top-level) (setq %changes nil) (princ '"/usr/lisp/newlisp 3-8-81. pp works on *** and comment. " nil) (errset (read-in-lisprc-file) nil) (reset] (setq %changes nil) (gc)cmd/lisp/lib/cmulisp/oldloader0.l 644 321 12 441 2552717625 12226 '(LWE 1/28/80 This is the file to load newlisp from new cmutlisp) (load 'backquote) (fasl 'auxfns0) (load 'compl) (load 'auxfns1) (load 'dv) (load 'toplevel) (load 'cmu2 ) (load 'cmu3) (load 'edits) (load 'step) (load 'newtrace) (load 'sysfunc) (load 'fix) (load 'ipclencode) (load 'cmu) n top-level nil (prog nil (putd 'top-level top-level) (setq %changes nil) (princ '"/usr/lisp/newlisp 3-8-81. pp works on ***/P4,P45< /h,l"cmd/lisp/lib/cmulisp/oldloader1.l 644 321 12 1107 2552717625 12247 (( (load 'atlinks0) (load 'atlinks1) (load 'atlinks2) (cfasl '/usr/lwe/interp/c/getwdir.o '_Mygetwd 'getwd "function" "-lcmu") (setq top-level (getd 'top-level)) (defun top-level nil (prog nil (putd 'top-level top-level) (setq %changes nil) (princ '"/usr/lisp/newlisp 1-28-81. Interpreter purification. " nil) (errset(read-in-lisprc-file) nil) (reset] (setq %changes nil) (gc) (print "If you get an error now, things are wedged.") (errset (mumble) nil) (sstatus dumpmode 413) '(LWE 1/28/81 Changing to C directory) (chdir '\.\./c) (dumplisp newlisp) terp/c/getwdir.o '_Mygetwd 'getwd "function" "-lcmu") (setq top-level (getd 'top-level)) (defun top-level nil (prog nil (putd 'top-level top-level) (setq %changes nil) (princ '"/usr/lisp/newlisp 1-28-81. Interpreter purification. " nil) (errset(read-in-lisprc-file) nil) (reset] (setq %changes nil) (gc) (print "If you get an error now, things are wedged.") (errset (mumble) nil) (sstatus dumpmode 413) '(Lcmd/lisp/lib/cmulisp/pcom.l 644 321 12 466 2552717625 11146 (declare (special $outport$)) (defun pp-comment (i v p) (mapcar '(lambda (c) (terpri $outport$) (terpri $outport$) (print (list 'dc i (car c) (cadr c)) $outport$) (mapcar '(lambda (line) (terpri $outport$) (princ line $outport$)) (cddr c)) (tyo 27 $outport$)) (reverse v))) urification. " nil) (errset(read-in-lisprc-file) nil) (reset] (setq %changes nil) (gc) (print "If/P4,P45< /h,l"cmd/lisp/lib/cmulisp/pp.l 644 321 12 30366 2552717630 10665 (declare (special poport pparm1 pparm2 lpar rpar form linel)) ; ======================================= ; pretty printer top level routine pp ; ; calling form- (pp arg1 arg2 ... argn) ; the args may be names of functions, atoms with associated values ; or output descriptors. ; if argi is: ; an atom - it is assumed to be a function name, if there is no ; function property associated with it,then it is assumed ; to be an atom with a value ; (P port)- port is the output port where the results of the ; pretty printing will be sent. ; poport is the default if no (P port) is given. ; (F fname)- fname is a file name to write the results in ; (A atmname) - means, treat this as an atom with a value, dont ; check if it is the name of a function. ; ;-------- -DNC : This is altered to fit better with CMULisp as follows ----- ; (E exp)- evaluate exp without printing anything ; other - pretty-print the expression as is - no longer an error ; ; Also, rather than printing only a function defn or only a value, we will ; let prettyprops decide which props to print. Finally, prettyprops will ; follow the CMULisp format where each element is either a property ; or a dotted pair of the form (prop . fn) where in order to print the ; given property we call (fn id val prop). The special properties ; function and value are used to denote those "properties" which ; do not actually appear on the plist. (declare (special $outport$ $fileopen$ prettyprops)) (setq prettyprops '((comment . pp-comment) (function . pp-function) (value . pp-value))) ; printret is like print yet it returns the value printed, this is used ; by pp - DNC : That's what print should have done all along!!! (def printret (macro ($l$) `(progn (print ,@(cdr $l$)) ,(cadr $l$)))) (def pp (nlambda ($xlist$) (prog ($outport$ $cur$ $fileopen$ $prl$ $atm$) (setq $outport$ poport) ; default port ; check if more to do, if not close output file if it is ; open and leave toploop (cond ((null (setq $cur$ (car $xlist$))) (condclosefile) (return t))) (cond ((dtpr $cur$) (cond ((equal 'P (car $cur$)) ; specifying a port (condclosefile) ; close file if open (setq $outport$ (eval (cadr $cur$)))) ((equal 'F (car $cur$)) ; specifying a file (condclosefile) ; close file if open (setq $outport$ (outfile (cadr $cur$)) $fileopen$ t)) ; -DNC : inserted ((equal 'E (car $cur$)) (eval (cadr $cur$))) ; -DNC :see doc above ((equal 'A (car $cur$)) ; declaring atomness ; (setq $atm$ t) ; (setq $cur$ (cadr $cur$)) ; (go midstuff)) ; ; ((eq 'V (car $cur$)) ; print value only ; (setq $atm$ 'value) ; (setq $cur$ (cadr $cur$)) ; (go midstuff)) ; ; (t (msg N "bad arg to pp: " (or $cur$)))) (t (terpri $outport$) ($prpr $cur$))) ;-DNC inserted (go botloop))) ; midstuff ; process the atom or function ; (cond ((eq 'value $atm$) ; (setq $prl$ (eval $cur$))) ; ; ((or $atm$ (null (getd $cur$))) ; check if is atom ; (cond ((boundp $cur$) ; yes, see if bound ; (setq $prl$ (list 'setq $cur$ (list 'quote ; (eval $cur$))))) ; (t (msg N "pp: atom " (or $cur$) " is unbound") ; (go botloop)))) ; ; ((bcdp (getd $cur$)) ; is a fcn, see if bcd ; (msg N "pp: function " (or $cur$) " is machine coded (bcd) ") ; (go botloop)) ; ; (t (setq $prl$ (list 'def $cur$ (getd $cur$))))) ; ; ; now print it ; ; ($prpr $prl$) ; (terpr $outport$) ; (setq $atm$ nil) ; clear flag ; ------ That was the old code, here comes the new -DNC ------- (mapc (function (lambda(prop) (prog (printer) (cond ((dtpr prop) (setq printer (cdr prop)) (setq prop (car prop))) (t (setq printer 'pp-prop))) (cond ((eq 'value prop) (cond ((boundp $cur$) (apply printer (list $cur$ (eval $cur$) 'value))))) ((eq 'function prop) (cond ((and (getd $cur$) (not (bcdp (getd $cur$)))) (apply printer (list $cur$ (getd $cur$) 'function))))) ((get $cur$ prop) (apply printer (list $cur$ (get $cur$ prop) prop))))))) prettyprops) botloop (setq $xlist$ (cdr $xlist$)) (go toploop)))) (setq pparm1 50 pparm2 100) ; -DNC These "prettyprinter parameters" are used to decide when we should ; quit printing down the right margin and move back to the left - ; Do it when the leftmargin > pparm1 and there are more than pparm2 ; more chars to print in the expression (def pp-value (lambda (i v p) (terpri $outport$) ($prpr (list 'dv i v)))) (def pp-function (lambda (i v p) (terpri $outport$) ($prpr (list 'def i v)))) (def pp-prop (lambda (i v p) (terpri $outport$) ($prpr (list 'defprop i v p)))) (def condclosefile (lambda nil (cond ($fileopen$ (terpr $outport$) (close $outport$) (setq $fileopen$ nil))))) ; ; these routines are meant to be used by pp but since ; some people insist on using them we will set $outport$ to nil ; as the default (setq $outport$ nil) (def $prpr (lambda (x) (cond ((not (boundp '$outport$)) (setq $outport$ poport))) (terpr $outport$) ($prdf x 0 0))) (declare (special rmar)) ; -DNC this used to be m - I've tried to ; to fix up the pretty printer a bit. It ; used to mess up regularly on (a b .c) types ; of lists. Also printmacros have been added. (def $prdf (lambda (l lmar rmar) (prog nil ; ; - DNC - Here we try to fix the tendency to print a ; thin column down the right margin by allowing it ; to move back to the left if necessary. ; (cond ((and (> lmar pparm1) (> (flatc l (add1 pparm2)) pparm2)) (terpri $outport$) (princ '"; <<<<< start back on the left <<<<<" $outport$) ($prdf l 5 0) (terpri $outport$) (princ '"; >>>>> continue on the right >>>>>" $outport$) (terpri $outport$) (return nil))) (tab lmar $outport$) a (cond ((and (dtpr l) (atom (car l)) (get (car l) 'printmacro) (apply (get (car l) 'printmacro) (list l lmar rmar))) (return nil)) ; ; -DNC - a printmacro is a lambda (l lmar rmar) ; attached to the atom. If it returns nil then ; we assume it did not apply and we continue. ; Otherwise we assume it did the job. ; ((or (not (dtpr l)) ; (*** at the moment we just punt hunks etc) (and (atom (car l)) (atom (cdr l)))) (return (printret l $outport$))) ((lessp (add rmar (flatc l (chrct $outport$))) (chrct $outport$)) ; ; This is just a heuristic - if print can fit it in then figure that ; the printmacros won't hurt. Note that despite the pretentions there ; is no guarantee that everything will fit in before rmar - for example ; atoms (and now even hunks) are just blindly printed. - DNC ; (printaccross l lmar rmar)) ((and ($patom1 lpar) (atom (car l)) (not (atom (cdr l))) (not (atom (cddr l)))) (prog (c) (printret (car l) $outport$) ($patom1 '" ") (setq c (nwritn $outport$)) a ($prd1 (cdr l) c) (cond ((not (atom (cdr (setq l (cdr l))))) (((terpr $outport$) (go a))))) (t (prog (c) (setq c (nwritn $outport$)) a ($prd1 l c) (cond ((not (atom (setq l (cdr l)))) (terpr $outport$) (go a)))))) b ($patom1 rpar)))) (def $prd1 (lambda (l n) (prog nil ($prdf (car l) n (cond ((null (setq l (cdr l))) (|1+| rmar)) ((atom l) (setq n nil) (plus 4 rmar (pntlen l))) (t rmar))) (cond ((null n) ($patom1 '" . ") (return (printret l $outport$)))) ; (*** setting n is pretty disgusting) ; (*** the last arg to $prdf is the space needed for the suffix) ; ;Note that this is still not really right - if the prefix ; takes several lines one would like to use the old rmar ; until the last line where the " . mumble)" goes. ))) ; -DNC here's the printmacro for progs - it replaces some hackery that ; used to be in the guts of $prdf. (def printprog (lambda (l lmar rmar) (prog (col) (cond ((cdr (last l)) (return nil))) (setq col (add1 lmar)) (princ '|(| $outport$) (princ (car l) $outport$) (princ '| | $outport$) (print (cadr l) $outport$) (for-each x (cddr l) (cond ((atom x) (tab col $outport$) (print x $outport$)) (t ($prdf x (+ lmar 6) rmar)))) (princ '|)| $outport$) (return t)))) (putprop 'prog 'printprog 'printmacro) ; Here's the printmacro for def. The original $prdf had some special code ; for lambda and nlambda. (def printdef (lambda (l lmar rmar) (cond ((and (zerop lmar) ; only if we're really printing a defn (zerop rmar) (cadr l) (atom (cadr l)) (caddr l) (null (cdddr l)) (memq (caaddr l) '(lambda nlambda macro lexpr)) (null (cdr (last (caddr l))))) (princ '|(| $outport$) (princ 'def $outport$) (princ '| | $outport$) (princ (cadr l) $outport$) (terpri $outport$) (princ '| (| $outport$) (princ (caaddr l) $outport$) (princ '| | $outport$) (princ (cadaddr l) $outport$) (terpri $outport$) (for-each x (cddaddr l) ($prdf x 4 0)) (princ '|))| $outport$) t)))) (putprop 'def 'printdef 'printmacro) ; There's a version of this hacked into the printer (where it don't belong!) ; Note that it must NOT apply to things like (quote a b). (def printquote (lambda (l lmar rmar) (cond ((or (null (cdr l)) (cddr l)) nil) (t (princ '|'| $outport$) ($prdf (cadr l) (add1 lmar) rmar) t)))) (putprop 'quote 'printquote 'printmacro) ; This one is nuked till I have time to fix it... LWE 3/8/81 (def print*** (lambda (l lmar rmar) (cond ((and (null (cdr (last l))) (forall x l (atom x))) (patom '|(| $outport$) (print (car l) $outport$) (for-each x (cdr l) (cond ((< (chrct $outport$) (+ (flatc x 20) rmar)) (tab lmar $outport$))) (patom '| | $outport$) (print x $outport$)) (patom '|)| $outport$) t)))) ; (putprop '*** 'print*** 'printmacro) LWE Nuked because of macro ; (putprop 'comment 'print*** 'printmacro) bugs 3/8/81. Will fix. (def printaccross (lambda (l lmar rmar) (prog nil (*** this is needed to make sure the printmacros are executed) (princ '|(| $outport$) l: (cond ((null l)) ((atom l) (princ '|. | $outport$) (princ l $outport$)) (t ($prdf (car l) (nwritn $outport$) rmar) (setq l (cdr l)) (cond (l (princ '| | $outport$))) (go l:)))))) ;(def $dinc (lambda () (- (linelength $outport$) (chrct $outport$)))) ; ; -DNC : This was wrong and stupid - it's replaced by (nwritn $outport) ;$tocolumn is replaced by tab ;(def $tocolumn ; (lambda (n) ; (cond ((greaterp (setq n (- n (nwritn $outport$))) 0) ; (do ((i 0 (1+ i))) ; ((eq i n)) ; (patom '" " $outport$)))))) (def tab (lexpr (n) (prog (nn prt) (setq nn (arg 1)) (cond ((> n 1)(setq prt (arg 2)))) (cond ((> (nwritn prt) nn) (terpri prt))) (printblanks (- nn (nwritn prt)) prt)))) ; ======================================== ; ; (charcnt port) ; returns the number of characters left on the current line ; on the given port ; ; ======================================= (def charcnt (lambda (port) (- linel (nwritn port)))) (putd 'chrct (getd 'charcnt)) (def $patom1 (lambda (x) (patom x $outport$))) ))) (def tab (lexpr (n) (prog (nn prt) (setq nn (arg 1)) (cond ((> n 1)(setq prt (arg 2)))) (cond ((> (nwritn prt) nn) (terpri prt))) (printblanks (- nn (nwritn prt)) prt)))) ; ======================================== ; ; (charcnt port) ; returns the numbcmd/lisp/lib/cmulisp/readhunks.l 444 321 12 766 2552717631 12172 (dv readhunksfns ((setsyntax 125 66) readhunk (setsyntax 123 'macro 'readhunk))) (setsyntax 125 66) (def readhunk (lambda nil (prog (l x) l: (cond ((eq (setq x (read)) '}) (setq l (reverse l)) (setq x (makhunk (length l))) (for i = 0 while l (rplacx i x (car l)) (setq l (cdr l))) (return x)) (t (setq l (cons x l)) (go l:)))))) (setsyntax 123 'macro 'readhunk) l"cmd/lisp/lib/cmulisp/step.l 644 321 12 16555 2552717632 11227 ;;; LISP Stepping Package ;;; ;;; Adapted by Mitch Marcus for Franz Lisp from Chuck Rich's MACLISP ;;; package. ;;; ;;; ;;; Adapted 2/80 from the Maclisp version of 11/03/76 ;;; Further modified 5/80 by Don Cohen (DNC) ;;; ;;; User Interface Function ;;; ;;; Valid Forms: set EVALHOOK* ;;; (STEP) NIL ;;; (STEP T) T ;;; (STEP NIL) NIL ;;; (STEP FOO1 FOO2 ...) (FOO1 FOO2) ;;; (declare (special evalhook-switch piport ; LWE 1/11/81 So the compiler ; doesn't have to. evalhook evalhook* |evalhook#| prinlevel prinlength) (macros nil)) ;; First Some Macros (defun 7bit macro (s) ;; (7BIT n c) tests if n is ascii for c (list '= (list 'boole 1 127. (cadr s)) (caddr s))) (defun print* macro (s) ;; print with indentation '(do ((i 1 (1+ i)) (indent (* 2 |evalhook#|)) (prinlevel 3) (prinlength 5)) ((> i indent) ($prin1 form)) (tyo 32.))) (defun step fexpr (arg) (cond ((or (null arg) (car arg)) (*rset t) ;must be on for hook to work (setq evalhook-switch t) ; for fixit package (setq |evalhook#| 0.) ;initialize depth count (setq evalhook nil) ;for safety (setq evalhook* (cond ((null arg) nil) ((eq (car arg) t)) (arg))) (setq evalhook 'evalhook*) ;turn system hook to my function (sstatus evalhook t)) ;arm it (t (setq evalhook* nil) (setq evalhook nil) (setq evalhook-switch nil) (sstatus evalhook nil)))) ;;; ;;; LISP evaluator comes here whenever EVALHOOK is Non-NIL and points here ;;; It expects me to do the evaluation and return the value. ;;; (defun evalhook* (form) ;; returns evaluation of form (cond (evalhook* ;; see if selective feature kicks in here (and (not (atom form)) (not (eq evalhook* t)) (memq (car form) evalhook*) (setq evalhook* t)) (cond ((eq evalhook* t) (and (= |evalhook#| 0) (drain piport)) ;; print out form before evaluation (print*) (cond ((atom form) (cond ((not (or (numberp form)(null form)(eq form t))) (princ '" = ") ((lambda (prinlevel prinlength) (setq form (evalhook form nil)) ($prin1 form)) 3 5)) (t )) (terpri)) (t ; s-expression (prog (cmd hookfn) cmdlp (setq cmd (tyi piport)) ;; uppercase alphabetics ;; deleted (-DNC) (cond (((lambda (n)(and (> n 64.)(< n 91.))) ;; this is ridiculous (boole 2. 32. (boole 1 127. cmd))) ;; (setq cmd (boole 2 32. cmd)))) ;; dispatch on command character (cond ((eq cmd 10.) ; \n so continue (cond (nil ;MUST ADAPT OR ELIMINATE (and (not (atom form)) (eq (car (getl (car form) '(expr fexpr lexpr subr fsubr lsubr macro))) (( 'macro)) ;; do macro expansion (setq form (funcall (get (car form) 'macro) form)) (print*) (go cmdlp)) (t (setq hookfn 'evalhook*)))) ((memq cmd '(80. 112.)) ; "P" print in full (drain piport) (print form) (go cmdlp)) ; "G" ((memq cmd '(71. 103.)) (drain piport) (setq evalhook* nil ;stop everything hookfn nil)) ((memq cmd '(67. 99.)) ;"C" no deeper (drain piport) (setq hookfn nil)) ((memq cmd '(68. 100.)) ;"D" call debug (setq evalhook-switch nil) (sstatus evalhook nil) (debug) (setq evalhook-switch t) (sstatus evalhook t) (go cmdlp)) ((memq cmd '(77. 109.)) ; "M" continue including macro expansion (drain piport) (setq hookfn 'evalhook*)) ((memq cmd '(66. 98.)) ; "B" give breakpoint (drain piport) (break step) (print*) (go cmdlp)) ((memq cmd '(81. 113.)) ; "Q" stop stepping (step nil) (reset)) ; "?", "H" show the options ((memq cmd '(72 104 63.)) (ty /usr/lisp/doc/step\.ref) (drain piport) (go cmdlp)) (t (princ '"Try one of ?BCDGMPQ or ") (drain piport) (go cmdlp))) ;; evaluate form ((lambda (|evalhook#|) (setq form (evalhook form hookfn))) (1+ |evalhook#|)) ;; print out evaluated form (cond ((and evalhook* (not (zerop |evalhook#|))) (print*) (terpri) ))))) ;;return evaluated form form) (t (evalhook form 'evalhook*)))) ; keep looking (t (evalhook form 'evalhook*)))) ; skip out quick (defun $prin1 (arg) (print (trim arg (cond (prinlevel) (t -1)) (cond (prinlength) (t -1))))) ;;new $prin1 - DNC (trim replaces $prinutil) (defun trim (arg depth length) (cond ((not (dtpr arg)) arg) ; should worry about hunks ((zerop depth) '&) ((zerop length) '()) (t (cons (trim (car arg) (sub1 depth) length) (trim (cdr arg) depth (sub1 length)))))) ;(defun $prinutil (arg pdepth) ; (cond ((not (dtpr arg)) ; there really ought to be code for hunks ; (princ arg)) ; ((eq (car arg) 'quote) ; (princ '"'") ; ($prinutil (cadr arg) pdepth)) ; (t (princ '"(") ; (do ((rest arg (cdr rest)) (plngth 0 (1+ plngth))) ; ((null rest) (princ '|)|)) ; (cond ((= plngth prinlength) (princ '|...)|) (return)) ; ;;; code for (a b .c) added - DNC ; ((and (cdr rest) (atom (cdr rest))) ; ($prinutil (car rest) (1+ pdepth)) ; (princ '| . |) (princ (cdr rest)) (return)) ; ((= pdepth prinlevel) (princ '&)) ; (t ($prinutil (car rest) (1+ pdepth)))) ; (cond ((cdr rest) (princ '| |))))))) (or (boundp 'prinlength) (setq prinlength nil)) ;;; - DNC prin1 is reserved for other things in CMULisp ;;; we just use $prin1 instead ;;;(or (boundp 'prin1) (setq prin1 nil)) (or (boundp 'prinlevel) (setq prinlevel nil)) - DNC ; ((and (cdr rest) (atom (cdr rest))) ; ($prinutil (car rest) (1+ pdepth)) ; (princ '| . |) (princ (cdr rest)) (return)cmd/lisp/lib/cmulisp/sysfunc.l 444 321 12 1051 2552717632 11705 (defun build-sysp nil (do ((temp (oblist) (cdr temp))(sysfuncs)) ((null temp)(setq system-functions\ sysfuncs));atom has ^G at end (cond ((getd (car temp)) (setq sysfuncs (cons (car temp) sysfuncs)))))) (defun sysp (x) (cond ((memq x system-functions\)t))) (or (boundp 'system-functions\) (build-sysp)) (defun fretry (pdlpnt frame) (freturn pdlpnt (cond ((eq (car frame) 'eval) (eval (caddr frame) (cadddr frame))) ((eq (car frame) 'apply) (eval `(apply ',(caaddr frame) ',(cadaddr frame)) (cadddr frame)))))) t) (cdr temp))(sysfuncs)) ((null temp)(setq system-functions\ sysfuncs));atom has ^G at end (cond ((getd (car temp)) (setq sysfuncs (cons (car temp) sysfuncs)))))) (defun sysp (x) (cond ((memq x system-functions\)t))) (or (boundp 'system-functions\) (build-sysp)) (defun fretry (pdlpnt frame) (freturn pdlpnt (cond ((eq (car frame) 'eval) (eval (caddr frame) (cadddr frame))) ((eq (car frame) 'apply) (eval `(apply ',(caaddr frame) ',(cmd/lisp/lib/cmulisp/toplevel.l 644 321 12 22062 2552717633 12075 ; LWE 1/11/81 NOTE: This should be loaded BEFORE cmu2!!! (setq SCCS-toplevel "@(#)toplevel.l 1.2 10/29/80") ; special atoms: (declare (special debug-level-count break-level-count errlist tpl-errlist user-top-level franz-not-virgin piport ER%tpl ER%all top-level-eof * ** *** + ++ +++ ^w) (macros t)) (setq top-level-eof (gensym 'Q) tpl-errlist nil errlist nil user-top-level nil ) ;------------------------------------------------------ ; Top level function for franz jkf, march 1980 ; ; The following function contains the top-level read, eval, print ; loop. With the help of the error handling functions, ; break-err-handler and debug-err-handler, franz-top-level provides ; a reasonable enviroment for working with franz lisp. ; ; LWE 1/23/80 We've got our own one of these. Im also nuking ; break-err-handler. ;(def franz-top-level ; (lambda nil ; (cond ((or (not (boundp 'franz-not-virgin)) ; (null franz-not-virgin)) ; (patom (status version)) ; (setq franz-not-virgin t ; + nil ++ nil +++ nil ; * nil ** nil *** nil) ; (setq ER%tpl 'break-err-handler) ; (putd 'reset (getd 'franz-reset)) ; (terpr) ; (read-in-lisprc-file))) ; ; ; loop forever ; (do ((+*) (-) (retval)) ; (nil) ; (setq retval ; (*catch ; '(top-level-catch break-catch) ; ; begin or return to top level ; (progn ; (setq debug-level-count 0 break-level-count 0) ; (cond (tpl-errlist (mapc 'eval tpl-errlist))) ; (do ((^w nil nil)) ; (nil) ; (cond (user-top-level (funcall user-top-level)) ; (t (patom "-> ") ; (cond ((eq top-level-eof ; (setq - ; (car (errset (read nil ; top-level-eof))))) ; (cond ((not (status isatty)) ; (exit))) ; (cond ((null (status ignoreeof)) ; (terpr) ; (print 'Goodbye) ; (terpr) ; (exit)) ; (t (terpr) ; (setq - ''EOF))))) ; (setq +* (eval -)) ; (updateplusses -) ; (updatestars +*) ; (print +*) ; (terpr))))))) ; (terpr) ; (patom "[Return to top level]") ; (terpr) ; (cond ((eq 'reset retval) (old-reset-function)))))) (def updateplusses (lambda (val) (let ((o+ +) (o++ ++)) (setq + val ++ o+ +++ o++)))) (def updatestars (lambda (val) (let ((o* *) (o** **)) (setq * val ** o* *** o**)))) ; debug-err-handler is the clb of ER%all when we are doing debugging ; and we want to catch all errors. ; It is just a read eval print loop with errset. ; the only way to leave is: ; (reset) just back to top level ; (return x) return the value to the error checker. ; if nil is returned then we will continue as if the error ; didn't occur. Otherwise if the returned value is a list, ; then if the error is continuable, the car of that list ; will be returned to recontinue computation. ; ^D continue as if this handler wasn't called. ; the form of errmsgs is: ; (error_type unique_id continuable message_string other_args ...) ; (def debug-err-handler (lexpr (n) ((lambda (message debug-level-count retval ^w) (cond ((greaterp n 0) (print 'Error:) (mapc '(lambda (a) (patom " ") (patom a) ) (cdddr (arg 1))) (terpr))) (setq ER%all 'debug-err-handler) (do (retval) (nil) (cond ((dtpr (setq retval (errset (do ((form)) (nil) (patom "D<") (patom debug-level-count) (patom ">: ") (cond ((eq top-level-eof (setq form (read nil top-level-eof))) (cond ((null (status isatty)) (exit))) (return nil)) ((and (dtpr form) (eq 'return (car form))) (return (eval (cadr form)))) (t (print (eval form)) (terpr))))))) (return (car retval)))))) nil (add1 debug-level-count) nil nil))) ; LWE 1/23/80 This is going away in favor of FIXIT... ; this is the break handler, it should be tied to ; ER%tpl always. ; it is entered if there(( is an error which no one wants to handle. ; We loop forever, printing out our error level until someone ; types a ^D which goes to the next break level above us (or the ; top-level if there are no break levels above us. ; a (return n) will return that value to the error message ; which called us, if that is possible (that is if the error is ; continuable) ; ;(def break-err-handler ; (lexpr (n) ; ((lambda (message break-level-count retval rettype ^w) ; (setq piport nil) ; (cond ((greaterp n 0) ; (print 'Error:) ; (mapc '(lambda (a) (patom " ") (patom a) ) ; (cdddr (arg 1))) ; (terpr) ; (cond ((caddr (arg 1)) (setq rettype 'contuab)) ; (t (setq rettype nil)))) ; (t (setq rettype 'localcall))) ; ; (do nil (nil) ; (cond ((dtpr ; (setq retval ; (*catch 'break-catch ; (do ((form)) (nil) ; (patom "<") ; (patom break-level-count) ; (patom ">: ") ; (cond ((eq top-level-eof ; (setq form (read nil top-level-eof))) ; (cond ((null (status isatty)) ; (exit))) ; (eval 1) ; force interrupt check ; (return (sub1 break-level-count))) ; ((and (dtpr form) (eq 'return (car form))) ; (cond ((or (eq rettype 'contuab) ; (eq rettype 'localcall)) ; (return (ncons (eval (cadr form))))) ; (t (patom "Can't continue from this error") ; (terpr)))) ; ((and (dtpr form) (eq 'retbrk (car form))) ; (cond ((numberp (setq form (eval (cadr form)))) ; (return form)) ; (t (return (sub1 break-level-count))))) ; (t (print (eval form)) ; (terpr))))))) ; (return (cond ((eq rettype 'localcall) ; (car retval)) ; (t retval)))) ; ((lessp retval break-level-count) ; (setq tpl-errlist errlist) ; (*throw 'break-catch retval)) ; (t (terpr))))) ; nil ; (add1 break-level-count) ; nil ; nil ; nil))) (def debugging (lambda (val) (cond (val (setq ER%all 'debug-err-handler)) (t (setq ER%all nil))))) ; the problem with this definition for break is that we are ; forced to put an errset around the break-err-handler. This means ; that we will never get break errors, since all errors will be ; caught by our errset (better ours than one higher up though). ; perhaps the solution is to automatically turn debugmode on. ; (defmacro break (message &optional (pred t)) `(*break ,pred ',message)) (def *break (lambda (pred message) (let ((^w nil)) (cond ((not (boundp 'break-level-count)) (setq break-level-count 1))) (cond (pred (terpr) (patom "Break ") (patom message) (terpr) (do ((form)) (nil) ; LWE 1/24/81 break-err-handler is changed to "debug". (cond ((dtpr (setq form (errset (debug)))) (return (car form)))))))))) ; this reset function is designed to work with the franz-top-level. ; When franz-top-level begins, it makes franz-reset be reset. ; when a reset occurs now, we set the global variable tpl-errlist to ; the current value of errlist and throw to top level. At top level, ; then tpl-errlist will be evaluated. ; LWE 1/23/81 Nuked. ; (def franz-reset ; (lambda nil ; (setq tpl-errlist errlist) ; (errset (*throw 'top-level-catch 'reset) ; nil) ; (old-reset-function))) ; ; this definition will have to do until we have the ability to ; cause and error on any channel in franz (def error (lexpr (n) (cond ((greaterp n 0) (patom (arg 1)) (cond ((greaterp n 1) (patom " ") (patom (arg 2)))) (terpr))) (err))) ; this file is read in just before dumplisping if you want .lisprc ; from your home directory read in before the lisp begins. (def read-in-lisprc-file (lambda nil ; LWE 1/11/81 Hacked a little to read in alternate directory .lisprc's. [prog (current home p) (setq current (getwd)) (setq home (getenv 'HOME)) (cond ((probef (concat home '/\.lisprc)) (load (concat home '/\.lisprc)))) (cond ((not (equal current home)) (cond ((probef '\.lisprc) (load '\.lisprc]] (putd 'top-level (getd 'franz-top-level)) ; if this is the first time this file has been read in, then ; make franz-reset be the reset function, but remember the original ; reset function as old-reset-function. We need the old reset function ; if we are going to allow the user to change top-levels, for in ; order to do that we really have to jump all the way up to the top. (cond ((null (getd 'old-reset-function)) (putd 'old-reset-function (getd 'reset)))) ;---- autoloader functions (def undef-func-handler (lambda (args) (prog (funcnam file) (setq funcnam (caddddr args)) (cond ((symbolp funcnam) (cond ((setq file (get funcnam 'autoload)) (patom "[autoload ") (patom file)(patom "]")(terpr) (load file)) (t (return nil))) (cond ((getd funcnam) (return (ncons funcnam))) (t (patom "Autoload file does not contain func ") (return nil)))))))) (setq ER%undef 'undef-func-handler) ;-- default autoloader properties ; (putprop 'trace '/usr/lib/lisp/trace 'autoload) dler (lambda (args) (prog (funcnam file) (setq funcnam (caddddr args)) (cond ((symbolp funcnam) (cond ((setq file (get funcnam 'autoload)) (patom "[autoload ") (patom file)(patom "]")(terpr) (load file)) (t (return nil))) (cond ((getd funcnam) (return (ncons funcnam))) (t (patom "Autoload file does not contain func ") (return nil)))))))) (setq ER%undef 'undef-func-handler) ;-- default autoloader properties ;cmd/lisp/lib/cmu3m.l 644 0 12 5402 2552720224 7512 ;;(jkf) Some of these should be written as macros to make them compilable. ;; (declare (macros t)) ; VIII. Additions from CMU (-DNC) ; *** list* neq ; nreconc nth push pop ; munkam ;(def *** (nlambda (arg) nil)) ; the CMU comment function (defmacro *** (&rest junk) nil) ; macroized by jkf ;(jkf)- CMU version of list* ;(def list* ; (lexpr (n) ; (cond ((zerop n) (err '"no args to list*"))) ; (do ((left (sub1 n) (sub1 left)) ; (tail (arg n) (cons (arg left) tail))) ; ((< left 1) tail) ; nil))) ; -DNC (written by LWE) - ; (list* 'a 'b 'c) = (a b .c) ;(jkf)- ucb list* macro. ; (defmacro list* (&rest forms) (cond ((null forms) nil) ((null (cdr forms)) (car forms)) (t (construct-list* forms)))) (defun construct-list* (forms) (setq forms (reverse forms)) (do ((forms (cddr forms) (cdr forms)) (return-form `(cons ,(cadr forms) ,(car forms)) `(cons ,(car forms) ,return-form))) ((null forms) return-form))) ;(jkf)- cmu neq ;(def neq ; -DNC inserted (cause CMU lisp uses it) ; (lambda (x y) ; (not (eq x y)))) (defmacro neq (a b) `(not (eq ,a ,b))) ;(jkf) nreconc in auxfns0.l now ;(def nreconc ; (lambda (x y) (nconc (nreverse x) y))) ; ; -DNC (LWE) added to correspond to maclisp ;----nth[N,L] returns the Nth element of list L, with 0 being the first ; element ;----LWE 1/29/80 ; (defun nth (N L) (cond ((null L)nil) (t(do ((LCDR L (cdr LCDR)) (COUNT N (1- COUNT))) ((or (and (atom LCDR) LCDR (err '"non-proper list passed to nth")) (or (lessp COUNT 0)(zerop COUNT))) (car LCDR)) nil)))) ;---push[X,L] is like (SETQ L (CONS X L)). Use where L is like a stack. ; ;---LWE 1/29/80 ;--- macroized by jkf, 25jun81 ;(def push ; (nlambda (nargs) ; (set (cadr nargs) ; (cons (eval (car nargs)) ; (eval (cadr nargs)))))) (defmacro push (value stack) `(setq ,stack (cons ,value ,stack))) ;---pop[L,X] returns CAR of L, sets L to CDR of L, and optionally assigns ; the popped value to X. ; ;---LWE 1/29/80 ;--- macroized by jkf, ;(def pop ; (nlambda (nargs) ; ((lambda (top-of-stack) ; (cond ((cadr nargs) ; (set (cadr nargs) top-of-stack)) ; (top-of-stack))) ; (prog2 nil ; (car (eval (car nargs))) ; (set (car nargs)(cdr (eval (car nargs)))))))) (defmacro pop (stack &optional (storeit nil storeit-p)) (cond ((storeit-p) `(setq ,storeit (prog1 (car ,stack) (setq ,stack (cdr ,stack))))) (t (prog1 (car ,stack) (setq ,stack (cdr ,stack)))))) ; the following has been added for Maclisp compatibility ; LWE 1/29/80 ;(jkf) this is actually maknum is the maclisp terminology (putd 'munknam (getd 'maknum)) ; added for CMULisp compatibilty (used by editor etc) (putd 'prin1 (getd 'print)) rgs))) ; (set (car nargs)(cdr (eval (car nargs)))))))) (defmacro pop (stack &optional (storeit nil storeit-p)) (cond ((storeit-p) `(setq ,storeit (prog1 (car ,stack) (setq ,stack (cdr ,stack))))) (t (prog1 (car ,stack) (setq ,stack (cdr ,stcmd/lisp/lib/cmumacs.l 644 0 12 4677 2552720225 10134 ;; file of common cmu functions which should be macros ;; I hope that by just loading in the file an environment will be ;; created which will permit the cmu files to be compiled. ;;; This is a bootstrap file to allow the true defns to be read in. (declare (macros t)) ;--- dv :: set variable to value and remember it was changed ; (dv name value) name is setq'ed to value (no evaluation) and ; the fact that it was done is remembered ; (defmacro dv (name value) `(progn 'compile (setq ,name ',value(() (mark!changed ',name))) (defmacro mark!changed (name) `(let ((atomname ,name)) (and (boundp '%changes) (setq %changes (cons form %changes)) name) atomname)) ;--- *** :: comment macro ; (defmacro *** (&rest x) nil) ;--- the following are macroizations from cmu3.l ;(jkf)- ucb list* macro. ; (defmacro list* (&rest forms) (cond ((null forms) nil) ((null (cdr forms)) (car forms)) (t (construct-list* forms)))) (defun construct-list* (forms) (setq forms (reverse forms)) (do ((forms (cddr forms) (cdr forms)) (return-form `(cons ,(cadr forms) ,(car forms)) `(cons ,(car forms) ,return-form))) ((null forms) return-form))) (defmacro neq (a b) `(not (eq ,a ,b))) (defmacro push (value stack) `(setq ,stack (cons ,value ,stack))) (defmacro pop (stack &optional (storeit nil storeit-p)) (cond ((storeit-p `(setq ,storeit (prog1 (car ,stack) (setq ,stack (cdr ,stack)))))) (t `(prog1 (car ,stack) (setq ,stack (cdr ,stack)))))) ;(jkf) this is actually maknum is the maclisp terminology (putd 'munknam (getd 'maknum)) ; added for CMULisp compatibilty (used by editor etc) (putd 'prin1 (getd 'print)) ;--- selectq :: case statement type construct ; ; (selectq ; ( ...) ; ( ...) ; ... ; ( ...) ; ( ...)) ; is evaluated and then compared with the tagi, if it matches ; the expri are evaluated. If it doesn't match, then are ; evaluated. ; (def selectq (macro (form) ((lambda (x) `((lambda (,x) (cond ,@(maplist '(lambda (ff) (cond ((null (cdr ff)) `(t ,(car ff))) ((atom (caar ff)) `((eq ,x ',(caar ff)) . ,(cdar ff))) (t `((memq ,x ',(caar ff)) . ,(cdar ff))))) (cddr form)))) ,(cadr form))) (gensym 'Z)))) (defmacro lineread (&optional (x nil)) `(%lineread ,x)) (putprop 'cmumacs t 'version) , then are ; evaluated. ; (def selectq (macro (formcmd/lisp/lib/ReadMe 664 0 12 6610 2552725153 7403 ==== /usr/lib/lisp directory ==== This directory contains a number of different kinds of files. The meanings of the file suffixes are: .l - lisp source .o - compiled lisp .x - lisp cross reference .blat - messages from liszt -- Contents -- Makefile: Input for make program. Can compile foo.l files by saying 'make foo.o' SCCS Directory for checkpointing source. as: Berkeley assembler. Probably a copy of /bin/as except in those places whose internal politics prevent the berkeley assembler from being the standard one. This assembler is called from liszt. auxfns0.l Most lisp coded lisp functions are in here. * Loaded into the standard lisp. auxfns1.l Other lisp coded lisp functions. contains the pretty printer. * Loaded into the standard lisp. backquote.l Contains the ever popular backquote macro and the sharp sign macro Also sets ; to be a comment character * Loaded into the standard lisp. cmu This is a directory of lisp functions written at cmu that worked with the standard 4bsd distribution. We are in the process of integrating this with opus 36. cmu3m.l this is cmu3.l with many functions turned into macros. this is work in progress. cmumacs.l This is a collection of macros which are the equivalents of nlambda's found in the cmu files. This file is incomplete but when finished it should allow us to create a 'cmu' environment for compiling. It is currently loaded by fix.l cs284.l A set of functions for a discrimination net written by dhl at berkeley. These are written in a ucilisp form and load in the ucifnc compatibility package automatically. editor.l Interlisp-like editor. It will eventually be phased out in favor of cmu's version. fix.l fixit package from cmu. It has been modified to allow it to compile with only the macros in cmumacs. this is autoloaded when the function (debug) is invoked. jkfmacs.l Some addition macros such as a nice 'If' macro and a msg macro for printing multiple values in one call. loop.l loop package from mit. Must be compiled with -m. machacks.l a list of macros for generating a maclisp environment. manual directory containing nroff output form of manual pages. nld berkeley loader. Probably a copy of /bin/ld. step.l Step package from cmu (and from mit). It has been modified for the new evalhook and funcallhook in Franz. Will autoload when the function step is referenced. syscall.l A set of macros for doing syscall's. very unix dependent at this point. sysfunc.l file from cmu. Probably should be removed and functions put elsewhere. tackon program to put a 'fasl' type map onto an object file. use is: 'tackon map objectfile' toplevel.l standard berkeley franz top level. Contains top-level and break handlers as well as startup function for liszt -r and autoloads. trace.l Joseph Lister Trace package from Berekeley. ucido.l do function from ucilisp. should be in ucifnc but isn't due to supposed compiler problems (which I don't believe still exist). ucifnc.l set of macros and functions for generating a ucilisp environment. automatically loaded when -u is done. wholine.l a simple function for putting a line of text in the .who file to be read later on by h19sys. This should probably be put somewhere else. liszt -r and autoloads. trace.l Joseph Lister Trace package from Berekeley. ucido.l do function from ucilisp.cmd/lisp/Makefile 664 0 12 1261 2552757004 7212 all: llib franz/mylisp liszt/nliszt tryhelpman franz/mylisp: cd franz; make DESTDIR=$(DESTDIR) mylisp liszt/nliszt: cd liszt; make DESTDIR=$(DESTDIR) LISP=../franz/mylisp nliszt llib: cd lib; make DESTDIR=$(DESTDIR) all install tryhelpman: -make helpman; date > helpman helpman: cd /usr/doc/lisp; rm -fr $(DESTDIR)/usr/lib/lisp/manual mkdir $(DESTDIR)/usr/lib/lisp/manual make DESTDIR=$(DESTDIR) all install: cd franz; make DESTDIR=$(DESTDIR) install cd liszt; make DESTDIR=$(DESTDIR) install -(cd /usr/doc/lisp; make DESTDIR=$(DESTDIR) install) clean: cd lib; make clean cd franz; make clean cd liszt; make clean -(cd /; cd /usr/doc/lisp; make clean) rm -f helpman iszt llib: cd lib; make DESTDIR=$(DESTDIR) all install tryhelpman: -make helpman; date > helpman helpman: cd /usr/doc/lisp; rm -fr $(DESTDIR)/usr/lib/lisp/manual mkdir $(DESTDIR)/usr/lib/lisp/manual make DESTDIR=$(DESTDIR) all install: cd franz; make DESTDIR=$(DESTDIR) install cd liszt; make DESTDIR=$(DESTDIR) install -cmd/plot/ 775 0 33 0 2552557515 5504 cmd/plot/Makefile 644 0 33 1045 2254362167 7223 all: tek t300 t300s t450 vplot tek: driver.o cc -o tek driver.o -l4014 -lm t300: driver.o cc -o t300 driver.o -l300 -lm t300s: driver.o cc -o t300s driver.o -l300s -lm t450: driver.o cc -o t450 driver.o -l450 -lm vplot: chrtab.o vplot.o cc -o vplot vplot.o chrtab.o install: install -s tek $(DESTDIR)/usr/bin install -s t300 $(DESTDIR)/usr/bin install -s t300s $(DESTDIR)/usr/bin install -s t450 $(DESTDIR)/usr/bin install -s vplot $(DESTDIR)/usr/bin install -c plot.sh $(DESTDIR)/usr/bin/plot clean: rm -f *.o tek t300 t300s t450 driver.o cc -o tek driver.o -l4014 -lm t300: driver.o cc -o t300 driver.o -l300 -lm t300s: driver.o cc -o t300s driver.o -l300s -lm t450: driver.o cc -o t450 driver.o -l450 -lm vplot: chrtab.o vplot.o cc -o vplot vplot.o chrtab.o install: install -s tek $(DESTDIR)/usr/bin install -s t300 $(DESTDIR)/usr/bin install -s t300s $(DESTDIR)/usr/bin install -s t450 $(DESTDIR)/usr/bin install -s vplot $(DESTDIR)/usr/bin install -c plot.sh $(DESTDIR)/usr/bin/plot ccmd/plot/driver.c 644 0 33 4010 2111463472 7206 ((#include float deltx; float delty; main(argc,argv) char **argv; { int std=1; FILE *fin; while(argc-- > 1) { if(*argv[1] == '-') switch(argv[1][1]) { case 'l': deltx = atoi(&argv[1][2]) - 1; break; case 'w': delty = atoi(&argv[1][2]) - 1; break; } else { std = 0; if ((fin = fopen(argv[1], "r")) == NULL) { fprintf(stderr, "can't open %s\n", argv[1]); exit(1); } fplt(fin); } argv++; } if (std) fplt( stdin ); exit(0); } fplt(fin) FILE *fin; { int c; char s[256]; int xi,yi,x0,y0,x1,y1,r,dx,n,i; int pat[256]; openpl(); while((c=getc(fin)) != EOF){ switch(c){ case 'm': xi = getsi(fin); yi = getsi(fin); move(xi,yi); break; case 'l': x0 = getsi(fin); y0 = getsi(fin); x1 = getsi(fin); y1 = getsi(fin); line(x0,y0,x1,y1); break; case 't': gets(s,fin); label(s); break; case 'e': erase(); break; case 'p': xi = getsi(fin); yi = getsi(fin); point(xi,yi); break; case 'n': xi = getsi(fin); yi = getsi(fin); cont(xi,yi); break; case 's': x0 = getsi(fin); y0 = getsi(fin); x1 = getsi(fin); y1 = getsi(fin); space(x0,y0,x1,y1); break; case 'a': xi = getsi(fin); yi = getsi(fin); x0 = getsi(fin); y0 = getsi(fin); x1 = getsi(fin); y1 = getsi(fin); arc(xi,yi,x0,y0,x1,y1); break; case 'c': xi = getsi(fin); yi = getsi(fin); r = getsi(fin); circle(xi,yi,r); break; case 'f': gets(s,fin); linemod(s); break; case 'd': xi = getsi(fin); yi = getsi(fin); dx = getsi(fin); n = getsi(fin); for(i=0; i, */ 0000,0030,0044,0102,0001,0002,0004,0010,0010,0000,0010,0000,0000,0000,0000,0000, /*, ?, */ 0000,0074,0102,0101,0115,0123,0121,0121,0121,0111,0046,0000,0000,0000,0000,0000, /*, @, */ 0000,0010,0024,0042,0101,0101,0177,0101,0101,0101,0101,0000,0000,0000,0000,0000, /*, A, */ 0000,0176,0101,0101,0101,0176,0101,0101,0101,0101,0176,0000,0000,0000,0000,0000, /*, B, */ 0000,0076,0101,0100,0100,0100,0100,0100,0100,0101,0076,0000,0000,0000,0000,0000, /*, C, */ 0000,0176,0101,0101,0101,0101,0101,0101,0101,0101,0176,0000,0000,0000,0000,0000, /*, D, */ 0000,0176,0100,0100,0100,0170,0100,0100,0100,0100,0177,0000,0000,0000,0000,0000, /*, E, */ 0000,0177,0100,0100,0100,0174,0100,0100,0100,0100,0100,0000,0000,0000,0000,0000, /*, F, */ 0000,0076,0101,0100,0100,0117,0101,0101,0101,0101,0076,0000,0000,0000,0000,0000, /*, G, */ 0000,0101,0101,0101,0101,0176,0101,0101,0101,0101,0101,0000,0000,0000,0000,0000, /*, H, */ 0000,0034,0010,0010,0010,0010,0010,0010,0010,0010,0034,0000,0000,0000,0000,0000, /*, I, */ 0000,0016,0004,0004,0004,0004,0004,0004,0104,0104,0070,0000,0000,0000,0000,0000, /*, J, */ 0000,0101,0102,0104,0110,0120,0160,0110,0104,0102,0101,0000,0000,0000,0000,0000, /*, K, */ 0000,0100,0100,0100,0100,0100,0100,0100,0100,0100,0177,0000,0000,0000,0000,0000, /*, L, */ 0000,0101,0143,0125,0111,0101,0101,0101,0101,0101,0101,0000,0000,0000,0000,0000, /*, M, */ 0000,0101,0141,0121,0111,0105,0103,0101,0101,0101,0101,0000,0000,0000,0000,0000, /*, N, */ 0000,0076,0101,0101,0101,0101,0101,0101,0101,0101,0076,0000,0000,0000,0000,0000, /*, O, */ 0000,0176,0101,0101,0101,0176,0100,0100,0100,0100,0100,0000,0000,0000,0000,0000, /*, P, */ 0000,0076,0101,0101,0101,0101,0101,0101,0131,0105,0076,0002,0001,0000,0000,0000, /*, Q, */ 0000,0176,0101,0101,0101,0176,0104,0102,0101,0101,0101,0000,0000,0000,0000,0000, /*, R, */ 0000,0076,0101,0100,0100,0076,0001,0001,0001,0101,0076,0000,0000,0000,0000,0000, /*, S, */ 0000,0177,0010,0010,0010,0010,0010,0010,0010,0010,0010,0000,0000,0000,0000,0000, /*, T, */ 0000,0101,0101,0101,0101,0101,0101,0101,0101,0101,0076,0000,0000,0000,0000,0000, /*, U, */ 0000,0101,0101,0101,0101,0101,0101,0101,0042,0024,0010,0000,0000,0000,0000,0000, /*, V, */ 0000,0101,0101,0101,0101,0111,0111,0125,0143,0101,0101,0000,0000,0000,0000,0000, /*, W, */ 0000,0101,0101,0042,0024,0010,0024,0042,0101,0101,0101,0000,0000,0000,0000,0000, /*, X, */ 0000,0101,0042,0024,0010,0010,0010,0010,0010,0010,0010,0000,0000,0000,0000,0000, /*, Y, */ 0000,0177,0001,0002,0004,0010,0020,0040,0100,0100,0177,0000,0000,0000,0000,0000, /*, Z, */ 0000,0034,0020,0020,0020,0020,0020,0020,0020,0020,0020,0034,0000,0000,0000,0000, /*, [, */ 0000,0000,0100,0040,0020,0010,0010,0010,0004,0002,0001,0000,0000,0000,0000,0000, /*, , \, */ 0000,0070,0010,0010,0010,0010,0010,0010,0010,0010,0010,0070,0000,0000,0000,0000, /*, ], */ 0010,0024,0042,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, ^, */ 0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0377,0000,0000, /*, _, */ 0040,0020,0010,0004,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, `, */ 0000,0000,0000,0000,0000,0074,0002,0076,0102,0102,0076,0000,0000,0000,0000,0000, /*, a, */ 0000,0100,0100,0100,0100,0174,0102,0102,0102,0102,0174,0000,0000,0000,0000,0000, /*, b, */ 0000,0000,0000,0000,0000,0074,0102,0100,0100,0102,0074,0000,0000,0000,0000,0000, /*, c, */ 0002,0002,0002,0002,0002,0076,0102,0102,0102,0102,0076,0000,0000,0000,0000,0000, /*, d, */ 0000,0000,0000,0000,0000,0074,0102,0174,0100,0102,0074,0000,0000,0000,0000,0000, /*, e, */ 0000,0016,0020,0020,0020,0176,0020,0020,0020,0020,0020,0000,0000,0000,0000,0000, /*, f, */ 0000,0000,0000,0000,0000,0076,0102,0102,0102,0102,0076,0002,0002,0102,0076,0000, /*, g, */ 0000,0100,0100,0100,0100,0174,0102,0102,0102,0102,0102,0000,0000,0000,0000,0000, /*, h, */ 0000,0000,0000,0010,0000,0030,0010,0010,0010,0010,0034,0000,0000,0000,0000,0000, /*, i, */ 0000,0000,0000,0010,0000,0030,0010,0010,0010,0010,0010,0010,0010,0050,0020,0000, /*, j, */ 0000,0100,0100,0100,0100,0106,0110,0120,0160,0110,0106,0000,0000,0000,0000,0000, /*, k, */ 0000,0030,0010,0010,0010,0010,0010,0010,0010,0010,0034,0000,0000,0000,0000,0000, /*, l, */ 0000,0000,0000,0000,0000,0166,0111,0111,0111,0111,0111,0000,0000,0000,0000,0000, /*, m, */ 0000,0000,0000,0000,0100,0174,0102,0102,0102,((0102,0102,0000,0000,0000,0000,0000, /*, n, */ 0000,0000,0000,0000,0000,0074,0102,0102,0102,0102,0074,0000,0000,0000,0000,0000, /*, o, */ 0000,0000,0000,0000,0000,0174,0102,0102,0102,0102,0174,0100,0100,0100,0100,0000, /*, p, */ 0000,0000,0000,0000,0000,0076,0102,0102,0102,0102,0076,0002,0002,0002,0002,0000, /*, q, */ 0000,0000,0000,0000,0000,0134,0142,0100,0100,0100,0100,0000,0000,0000,0000,0000, /*, r, */ 0000,0000,0000,0000,0000,0076,0100,0074,0002,0102,0074,0000,0000,0000,0000,0000, /*, s, */ 0000,0020,0020,0020,0020,0176,0020,0020,0020,0020,0014,0000,0000,0000,0000,0000, /*, t, */ 0000,0000,0000,0000,0000,0102,0102,0102,0102,0102,0075,0000,0000,0000,0000,0000, /*, u, */ 0000,0000,0000,0000,0000,0101,0101,0101,0042,0024,0010,0000,0000,0000,0000,0000, /*, v, */ 0000,0000,0000,0000,0000,0111,0111,0111,0111,0111,0066,0000,0000,0000,0000,0000, /*, w, */ 0000,0000,0000,0000,0000,0102,0044,0030,0030,0044,0102,0000,0000,0000,0000,0000, /*, x, */ 0000,0000,0000,0000,0000,0102,0102,0102,0042,0024,0010,0020,0040,0100,0000,0000, /*, y, */ 0000,0000,0000,0000,0000,0176,0004,0010,0020,0040,0176,0000,0000,0000,0000,0000, /*, z, */ 0000,0014,0020,0020,0020,0020,0040,0020,0020,0020,0020,0014,0000,0000,0000,0000, /*, {, */ 0000,0010,0010,0010,0010,0000,0000,0010,0010,0010,0010,0000,0000,0000,0000,0000, /*, |, */ 0000,0030,0010,0010,0010,0010,0004,0010,0010,0010,0010,0030,0000,0000,0000,0000, /*, }, */ 0020,0052,0004,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, ~, */ 0000,0176,0176,0176,0176,0176,0176,0176,0176,0176,0176,0000,0000,0000,0000,0000, /*, del, */ }; ,0020,0040,0176,0000,0000,0000,0000,0000, /*, z, */ 0000,0014,0020,0020,0020,0020,0040,0020,0020,0020,0020,0014,0000,0000,0000,0000, /*, {, */ 0000,0010,0010,0010,0010,0000,0000,0010,0010,0010,0010,0000,0000,0000,0000,0000, /*, |, */ 0000,0030,0010,0010,0010,0010,0004,0010,0010,0010,0010,0030,0000,0000,0000,0000, /*, }, */ 0020,0052,0004,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, ~, */ 0000,0176,0176,0176,0176,0176,0176cmd/plot/vplot.c 644 0 33 14235 2111463472 7111 /* * Reads standard graphics input * Makes a plot on a 200 dot-per-inch 11" wide * Versatek plotter. * * Creates and leaves /usr/tmp/raster (1000 blocks) * which is the bitmap */ #include "stdio.h" #include #define NB 88 #define BSIZ 512 #define mapx(x) ((1536*((x)-botx)/del)+centx) #define mapy(y) ((1536*(del-(y)+boty)/del)-centy) #define SOLID -1 #define DOTTED 014 #define SHORTDASHED 034 #define DOTDASHED 054 #define LONGDASHED 074 #define SETSTATE (('v'<<8)+1) int linmod = SOLID; int again; int done1; char chrtab[][16]; int plotcom[] = { 0200, 0, 0}; int eotcom[] = { 0210, 0, 0}; char blocks [NB][BSIZ]; int obuf[264]; int lastx; int lasty; double topx = 1536; double topy = 1536; double botx = 0; double boty = 0; int centx; int centy; double delx = 1536; double dely = 1536; double del = 1536; struct buf { int bno; char *block; }; struct buf bufs[NB]; int in, out; char *picture = "/usr/tmp/raster"; main(argc, argv) char **argv; { extern int onintr(); register i; if (argc>1) { in = open(argv[1], 0); putpict(); exit(0); } signal(SIGTERM, onintr); if (signal(SIGINT, SIG_IGN) != SIG_IGN) signal(SIGINT, onintr); another: for (i=0; i 1536./2048.) del = dely; else del = delx * (1566./2048.); centx = 0; centx = (2048 - mapx(topx)) / 2; centy = 0; centy = mapy(topy) / 2; continue; case 'l': done1 |= 01; x1 = mapx(getw(stdin)); y1 = mapy(getw(stdin)); lastx = mapx(getw(stdin)); lasty = mapy(getw(stdin)); line(x1, y1, lastx, lasty); continue; case 'm': lastx = mapx(getw(stdin)); lasty = mapy(getw(stdin)); continue; case 't': done1 |= 01; while ((x1 = getc(stdin)) != '\n') plotch(x1); continue; case 'e': if (done1) { again++; return; } continue; case 'p': done1 |= 01; lastx = mapx(getw(stdin)); lasty = mapy(getw(stdin)); point(lastx, lasty); point(lastx+1, lasty); point(lastx, lasty+1); point(lastx+1, lasty+1); continue; case 'n': done1 |= 01; x1 = mapx(getw(stdin)); y1 = mapy(getw(stdin)); line(lastx, lasty, x1, y1); lastx = x1; lasty = y1; continue; case 'f': getw(stdin); getc(stdin); switch(getc(stdin)) { case 't': linmod = DOTTED; break; default: case 'i': linmod = SOLID; break; case 'g': linmod = LONGDASHED; break; case 'r': linmod = SHORTDASHED; break; case 'd': linmod = DOTDASHED; break; } while((x1=getc(stdin))!='\n') if(x1==-1) return; continue; case 'd': getw(stdin); getw(stdin); getw(stdin); x1 = getw(stdin); while (--x1 >= 0) getw(stdin); continue; case -1: return; default: printf("Botch\n"); return; } } plotch(c) register c; { register j; register char *cp; int i; if (c<' ' || c >0177) return; cp = chrtab[c-' ']; for (i = -16; i<16; i += 2) { c = *cp++; for (j=7; j>=0; --j) if ((c>>j)&1) { point(lastx+6-j*2, lasty+i); point(lastx+7-j*2, lasty+i); point(lastx+6-j*2, lasty+i+1); point(lastx+7-j*2, lasty+i+1); } } lastx += 16; } int f; /* versatec file number */ putpict() { register x, *ip, *op; int y; if (f==0){ f = open("/dev/vp0", 1); if (f < 0) { printf("Cannot open vp\n"); exit(1); } ioctl(f, SETSTATE, plotcom); } op = obuf; lseek(in, 0L, 0); for (y=0; y<2048; y++) { if ((y&077) == 0) read(in, blocks[0], 32*BSIZ); for (x=0; x<32; x++) { ip = (int *)&blocks[x][(y&077)<<3]; *op++ = *ip++; *op++ = *ip++; *op++ = *ip++; *op++ = *ip++; } *op++ = 0; *op++ = 0; *op++ = 0; *op++ = 0; if (y&1) { write(f, (char *)obuf, sizeof(obuf)); op = obuf; } } } line(x0, y0, x1, y1) register x0, y0; { int dx, dy; int xinc, yinc; register res1; int res2; int slope; xinc = 1; yinc = 1; if ((dx = x1-x0) < 0) { xinc = -1; dx = -dx; } if ((dy = y1-y0) < 0) { yinc = -1; dy = -dy; } slope = xinc*yinc; res1 = 0; res2 = 0; if (dx >= dy) while (x0 != x1) { if((x0+slope*y0)&linmod) if (((x0>>6) + ((y0&~077)>>1)) == bufs[0].bno) bufs[0].block[((y0&077)<<3)+((x0>>3)&07)] |= 1 << (7-(x0&07)); else point(x0, y0); if (res1 > res2) { res2 += dx - res1; res1 = 0; y0 += yinc; } res1 += dy; x0 += xinc; } else while (y0 != y1) { if((x0+slope*y0)&linmod) if (((x0>>6) + ((y0&~077)>>1)) == bufs[0].bno) bufs[0].block[((y0&077)<<3)+((x0>>3)&07)] |= 1 << (7-(x0&07)); else point(x0, y0); if (res1 > res2) { res2 += dy - res1; res1 = 0; x0 += xinc; } res1 += dx; y0 += yinc; } if((x1+slope*y1)&linmod) if (((x1>>6) + ((y1&~077)>>1)) == bufs[0].bno) bufs[0].block[((y1&077)<<3)+((x1>>3)&07)] |= 1 << (7-(x1&07)); else point(x1, y1); } point(x, y) register x, y; { register bno; bno = ((x&03700)>>6) + ((y&03700)>>1); if (bno != bufs[0].bno) { if (bno < 0 || bno >= 1024) return; getblk(bno); } bufs[0].block[((y&077)<<3)+((x>>3)&07)] |= 1 << (7-(x&07)); } getblk(b) register b; { register struct buf *bp1, *bp2; register char *tp; loop: for (bp1 = bufs; bp1 < &bufs[NB]; bp1++) { if (bp1->bno == b || bp1->bno == -1) { tp = bp1->block; for (bp2 = bp1; bp2>bufs; --bp2) { bp2->bno = (bp2-1)->bno; bp2->block = (bp2-1)->block; } bufs[0].bno = b; bufs[0].block = tp; return; } } zseek(out, bufs[NB-1].bno); write(out, bufs[NB-1].block, BSIZ); zseek(in, b); read(in, bufs[NB-1].block, BSIZ); bufs[NB-1].bno = b; goto loop; } onintr() { exit(1); } zseek(a, b) { return(lseek(a, (long)b*512, 0)); } r *tp; loop: for (bp1 = bufs; bp1 < &bufs[NB]; bp1++) { if (bp1->bno == b || bp1->bno == -1) { tp = bp1->block; for (bp2 = bp1; bp2>bufs; --bp2) { bp2->bno = (bp2-1)->bno; bp2->block = (bp2-1)->block; } bufs[0].bno = b; bufs[0].block = tp; return; } } zseek(out, bufs[NB-1].bno); write(out, bufs[NB-1].block, BSIZ); zsecmd/plot/plot.sh 755 0 33 415 2254362175 7057 PATH=/bin:/usr/bin case $1 in -T*) t=$1 shift ;; *) t=-T$TERM esac case $t in -T450) exec t450 $*;; -T300) exec t300 $*;; -T300S|-T300s) exec t300s $*;; -Tver) exec vplot $*;; -Ttek|-T4014|-T) exec tek $* ;; *) echo plot: terminal type $t not known 1>&2; exit 1 esac block; for (bp2 = bp1; bp2>bufs; --bp2) { bp2->bno = (bp2-1)->bno; bp2->block = (bp2-1)->block; } bufs[0].bno = b; bufs[0].block = /,5< /,"((cmd/prof/ 775 0 33 0 2552557661 5476 cmd/prof/Makefile 644 0 33 412 2550302520 7152 # If you don't want to plot, take out the -Dplot and the ref. to plot.a PLOT = -lplot -Dplot CFLAGS=-O prof: prof.o $(CC) -o prof prof.o $(PLOT) prof.o: prof.c cc -c $(CFLAGS) $(PLOT) prof.c install: install -s prof $(DESTDIR)/usr/bin clean : rm -f *.o prof ac block; for (bp2 = bp1; bp2>bufs; --bp2) { bp2->bno = (bp2-1)->bno; bp2->block = (bp2-1)->block; } bufs[0].bno bufs/ C. /,"cmd/prof/prof.c 444 0 33 27401 2550302520 6671 static char *sccsid = "@(#)prof.c 4.5 (Berkeley) 81/07/02"; /* * prof */ #include #include #include #include #include typedef short UNIT; /* unit of profiling */ #define A_OUTNAME "a.out" #define MON_OUTNAME "mon.out" #define MON_SUMNAME "mon.sum" /* * The symbol table; * for each external in the specified file we gather * its address, the number of calls and compute its share of cpu time. */ struct nl { char *name; unsigned value; float time; long ncall; } *nl; int nname; struct nl *np; struct nl *npe; /* * The header on the mon.out file. * Mon.out consists of one of these headers, an array of ncount * cnt structures (as below) and then an array of samples * representing the discretized program counter values. */ struct hdr { UNIT *lowpc, *highpc; int ncount; } h; /* * Each counter has an address and a number of calls. */ struct cnt { unsigned cvalue; long cncall; } *cbuf; /* * Each discretized pc sample has * a count of the number of samples in its range */ unsigned UNIT *samples; FILE *pfile, *nfile; unsigned lowpc, highpc; /* range profiled */ double ransca, ranoff; /* scaling for blowing up plots */ unsigned sampbytes; /* number of bytes of samples */ int nsamples; /* number of samples */ double totime; /* total time for all routines */ double maxtime; /* maximum time of any routine (for plot) */ double scale; /* scale factor converting samples to pc values: each sample covers scale bytes */ char *strtab; /* string table in core */ off_t ssiz; /* size of the string table */ struct exec xbuf; /* exec header of a.out */ int aflg; int nflg; int vflg; int lflg; int zflg; int sflag; char *namfil; int timcmp(), valcmp(), cntcmp(); main(argc, argv) char **argv; { int lowpct, highpct; /* * Use highpct and lowpc as percentages, temporarily * for graphing options involving blow-up */ lowpct = -1; highpct = -1; argv++; while ( *argv != 0 && **argv == '-' ) { *argv += 1; if (**argv == 'l') lflg++; else if (**argv == 'a') aflg++; else if (**argv == 'n') nflg++; else if (**argv == 'z') zflg++; else if (**argv == 'v') vflg++; else if ( **argv == 's' ) sflag++; else if (**argv >= '0' && **argv <= '9') { int i = atoi(*argv); if (lowpct == -1) lowpct = i; else highpct = i; } argv++; } if ( *argv != 0 ) { namfil = *argv; argv++; } else { namfil = A_OUTNAME; } if (lowpct >= 100) lowpct = 0; if (highpct <= lowpct || highpct > 100) highpct = 100; ransca = 100./(highpct-lowpct); ranoff = 2040. + 40.8*lowpc*ransca; /* * get information about a.out file. */ getnfile(); /* * get information about mon.out file(s). */ if ( *argv == 0 ) { getpfile( MON_OUTNAME ); } else { do { getpfile( *argv ); argv++; } while ( *argv != 0 ); } asgnsamples(); /* assign samples to procedures */ #ifdef plot if (vflg) plotprof(); /* a plotted or ... */ else #endif printprof(); /* a printed profile */ if ( sflag != 0 ) { putprof(); } done(); } printprof() { double time, actime; actime = 0; printf(" %%time cumsecs #call ms/call name\n"); if (!lflg) qsort(nl, nname, sizeof(struct nl), timcmp); for (np = nl; nptime == 0 && np->ncall == 0) continue; time = np->time/totime; actime += np->time; printf("%6.1f%9.2f", 100*time, actime/60); if (np->ncall != 0) printf("%7ld %8.2f", np->ncall, np->time/(np->ncall*.06)); else printf("%7.7s %8.8s", "", ""); printf(" %s\n", np->name); } } /* * Set up string and symbol tables from a.out. * On return symbol table is sorted by value. */ getnfile() { nfile = fopen(namfil,"r"); if (nfile == NULL) { perror(namfil); done(); } fread(&xbuf, 1, sizeof(xbuf), nfile); if (N_BADMAG(xbuf)) { fprintf(stderr, "%s: bad format\n", namfil); done(); } getstrtab(); getsymtab(); qsort(nl, nname, sizeof(struct nl), valcmp); } getstrtab() { fseek(nfile, N_SYMOFF(xbuf) + xbuf.a_syms, 0); if (fread(&ssiz, sizeof (ssiz), 1, nfile) == 0) { fprintf(stderr, "%s: no string table (old format?)\n", namfil); done(); } strtab = (char *)calloc(ssiz, 1); if (strtab == NULL) { fprintf(stderr, "%s: no room for %d bytes of string table", namfil, ssiz); done(); } if (fread(strtab+sizeof(ssiz), ssiz-sizeof(ssiz), 1, nfile) != 1) { fprintf(stderr, "%s: error reading string table\n", namfil); done(); } } /* * Read in symbol table */ getsymtab() { register int i; /* pass1 - count symbols */ fseek(nfile, N_SYMOFF(xbuf), 0); nname = 0; for (i = xbuf.a_syms; i > 0; i -= sizeof(struct nlist)) { struct nlist nbuf; fread(&nbuf, sizeof(nbuf), 1, nfile); if (nbuf.n_type!=N_TEXT && nbuf.n_type!=N_TEXT+N_EXT) continue; if (aflg==0 && nbuf.n_type!=N_TEXT+N_EXT) continue; nname++; } if (nname == 0) { fprintf(stderr, "%s: no symbols\n", namfil); done(); } nl = (struct nl *)calloc((nname+1), sizeof (struct nl)); if (nl == 0) { fprintf(stderr, "prof: No room for %d bytes of symbol table\n", (nname+1) * sizeof (struct nlist)); done(); } /* pass2 - read symbols */ fseek(nfile, N_SYMOFF(xbuf), 0); npe = nl; nname = 0; for (i = xbuf.a_syms; i > 0; i -= sizeof(struct nlist)) { struct nlist nbuf; fread(&nbuf, sizeof(nbuf), 1, nfile); if (nbuf.n_type!=N_TEXT && nbuf.n_type!=N_TEXT+N_EXT) continue; if (aflg==0 && nbuf.n_type!=N_TEXT+N_EXT) continue; npe->value = nbuf.n_value/sizeof(UNIT); npe->name = strtab+nbuf.n_un.n_strx; npe++; nname++; } npe->value = -1; npe++; } /* * information from a mon.out file is in two parts: * the counters of how many times each procedure was called, * if it was called at all; * and an array of sampling hits within pc ranges. * the counters must be dealt with on a file-by-file basis, * since which procedures are represented may vary. * the samples ranges are fixed, but must be summed across * files, and then distributed among procedures, because * of the wierd way the plotting is done. */ getpfile(filename) char *filename; { openpfile(filename); readcntrs(); asgncntrs(); /* assign counts to procedures */ readsamples(); closepfile(); } openpfile(filename) char *filename; { struct stat stb; if((pfile = fopen(filename, "r")) == NULL) { perror(filename); done(); } fstat(fileno(pfile), &stb); fread(&h, sizeof(struct hdr), 1, pfile); lowpc = h.lowpc - (UNIT *)0; highpc = h.highpc - (UNIT *)0; sampbytes = stb.st_size - sizeof(struct hdr) - h.ncount*sizeof(struct cnt); nsamples = sampbytes / sizeof (unsigned UNIT); } closepfile() { fclose(pfile); free(cbuf); } readcntrs() { struct cnt *kp; cbuf = (struct cnt *)calloc((h.ncount+1), sizeof (struct cnt)); if (cbuf == 0) { fprintf(stderr, "prof: No room for %d bytes of count buffer\n", (h.ncount+1) * sizeof (struct cnt)); exit(1); } fread(cbuf, sizeof(struct cnt), h.ncount, pfile); /* eliminate zero counters and scale counter pc values */ if (h.ncount) { kp = &cbuf[h.ncount - 1]; for (;;) { if (kp->cvalue==0) { h.ncount=kp-cbuf; ++kp; break; } if (kp == cbuf) { h.ncount = 0; break; } --kp; } for (; --kp>=cbuf; ) kp->cvalue /= sizeof(UNIT); } /* sort counters */ qsort(cbuf, h.ncount, sizeof(struct cnt), cntcmp); } /* * Assign counters to the procedures to which they belong */ asgncntrs() { register int i; struct cnt *kp; kp = &cbuf[h.ncount-1]; np = npe; while (--np>=nl) { if (kpvalue > kp->cvalue) continue; /* skip ``static'' functions */ while (kp >= cbuf && kp->cvalue > np->value + 11) --kp; if (kp->cvalue >= np->value) { np->ncall += kp->cncall; --kp; } } } readsamples() { register i; unsigned UNIT sample; int totalt; if (samples == 0) { samples = (unsigned UNIT *) calloc(sampbytes, sizeof (unsigned UNIT)); if (samples == 0) { printf("prof: No room for %d sample pc's\n", sampbytes / sizeof (unsigned UNIT)); done(); } } for (i = 0; ; i++) { fread(&sample, sizeof (unsigned UNIT), 1, pfile); if (feof(pfil((e)) break; samples[i] += sample; totalt += sample; } if (i != nsamples) { fprintf(stderr, "prof: unexpected EOF after reading %d/%d samples\n", --i, nsamples); done(); } } /* * Assign samples to the procedures to which they belong. */ asgnsamples() { register j; unsigned UNIT ccnt; double time; unsigned pcl, pch; register int i; int overlap; /* read samples and assign to namelist symbols */ scale = highpc - lowpc; scale /= nsamples; for (i=0; i < nsamples; i++) { ccnt = samples[i]; if (ccnt == 0) continue; pcl = lowpc + scale*i; pch = lowpc + scale*(i+1); time = ccnt; totime += time; if(time > maxtime) maxtime = time; for (j=0; j= nl[j+1].value) continue; overlap=(min(pch,nl[j+1].value)-max(pcl,nl[j].value)); if (overlap>0) nl[j].time += overlap*time/scale; } } if (totime==0.0) { fprintf(stderr, "No time accumulated\n"); /* done(); */ totime=1.0; } } /* * dump what you have out to a mon.out style file. */ putprof() { FILE *sfile; struct nl *np; struct cnt kp; int i; sfile = fopen(MON_SUMNAME, "w"); if (sfile == NULL) { perror(MON_SUMNAME); done(); } /* * build a new header. * h.lowpc and h.highpc are already fine. * fix h.ncount to count non-zero calls, * and the one zero call which marks the end. */ h.ncount = 0; for (np = nl; np < npe-1 ; np++) if (np->ncall > 0) h.ncount++; h.ncount++; fwrite(&h, sizeof (struct hdr), 1, sfile); for (np = nl; np < npe-1; np++) { if (np->ncall > 0) { kp.cvalue = np->value * sizeof (unsigned UNIT); kp.cncall = np->ncall; fwrite(&kp, sizeof (struct cnt), 1, sfile); } } kp.cvalue = 0; kp.cncall = 0; fwrite(&kp, sizeof (struct cnt), 1, sfile); fwrite(samples, sizeof (unsigned UNIT), nsamples, sfile); fclose(sfile); } min(a, b) { if (ab) return(a); return(b); } valcmp(p1, p2) struct nl *p1, *p2; { return(p1->value - p2->value); } timcmp(p1, p2) struct nl *p1, *p2; { float d; if (nflg && p2->ncall != p1->ncall) return (p2->ncall - p1->ncall); d = p2->time - p1->time; if (d > 0.0) return(1); if (d < 0.0) return(-1); return(strcmp(p1->name,p2->name)); } cntcmp(p1, p2) struct cnt *p1, *p2; { return(p1->cvalue - p2->cvalue); } done() { #ifdef plot if(vflg) { point(0, -2040); closepl(); } #endif exit(0); } #ifdef plot plotprof() { double time, lastx, lasty, lastsx; register i; openpl(); erase(); space(-2048, -2048, 2048, 2048); line(-2040, -2040, -2040, 2040); line(0, 2040, 0, -2040); for(i=0; i<11; i++) line(-2040, 2040-i*408, 0, 2040-i*408); lastx = 0.; lasty = ranoff; scale = (4080.*ransca)/(sampbytes/sizeof(UNIT)); lastsx = 0.0; for(i = 0; i < nsamples; i++) { unsigned UNIT ccnt; double tx, ty; ccnt = samples[i]; time = ccnt; tx = lastsx; ty = lasty; lastsx =- 2000.*time/totime; lasty =- scale; if(lasty >= -2040. && ty <= 2040.) { line((int)tx, (int)ty, (int)lastsx, (int)lasty); if (ccnt!=0 || lastx!=0.0) { tx = lastx; lastx = -time*2000./maxtime; ty =+ scale/2; line(0, (int)ty, (int)tx, (int)ty); } } } scale = (4080.*ransca)/(highpc-lowpc); lastx = 50.; for(np = nl; npvalue < lowpc) continue; if(np->value >= highpc) continue; time = np->time/totime; lasty = ranoff - (np->value - lowpc)*scale; if(lasty >= -2040. && lasty <= 2040.) { char bufl[BUFSIZ], *namp; register j; line(0, (int)lasty, 50, (int)lasty); line((int)(lastx-50),(int)lasty,(int)lastx,(int)lasty); move((int)(lastx+30), (int)(lasty+10)); sprintf(bufl, "%s", np->name + (np->name[0] == '_')); label(bufl); } lastx =+ 500.; if(lastx > 2000.) lastx = 50.; } } #endif p->value < lowpc) continue; if(np->value >= highpc) continue; time = np->time/totime; lasty = ranoff - (np->value - lowpc)*scale; if(lasty >= -2040. && lasty <= 2040.) { char bufl[BUFSIZ], *namp; register j; line(0, (int)lasty, 50, cmd/write.c 444 0 33 7015 2445320145 6074 static char *sccsid = "@(#)write.c 4.3 (Berkeley) 12/10/80"; /* * write to another user */ #include #include #include #include #include #include #define NMAX sizeof(ubuf.ut_name) #define LMAX sizeof(ubuf.ut_line) char *strcat(); char *strcpy(); struct utmp ubuf; int signum[] = {SIGHUP, SIGINT, SIGQUIT, 0}; char me[10] = "???"; char *him; char *mytty; char histty[32]; char *histtya; char *ttyname(); char *rindex(); int logcnt; int eof(); int timout(); FILE *tf; char *getenv(); main(argc, argv) char *argv[]; { struct stat stbuf; register i; register FILE *uf; int c1, c2; long clock = time( 0 ); struct tm *localtime(); struct tm *localclock = localtime( &clock ); if(argc < 2) { printf("usage: write user [ttyname]\n"); exit(1); } him = argv[1]; if(argc > 2) histtya = argv[2]; if ((uf = fopen("/etc/utmp", "r")) == NULL) { printf("cannot open /etc/utmp\n"); goto cont; } mytty = ttyname(2); if (mytty == NULL) { printf("Can't find your tty\n"); exit(1); } if (stat (mytty, &stbuf) < 0) { printf ("Can't stat your tty\n"); exit (1); } if ((stbuf.st_mode&02) == 0) { printf ("You have write permission turned off.\n"); 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) { printf("%s logged more than once\nwriting to %s\n", him, histty+5); } if(histty[0] == 0) { printf(him); if(logcnt) printf(" not on that tty\n"); else printf(" not logged in\n"); exit(1); } if (access(histty, 0) < 0) { printf("No such tty\n"); exit(1); } signal(SIGALRM, timout); alarm(5); if ((tf = fopen(histty, "w")) == NULL) goto perm; alarm(0); if (fstat(fileno(tf), &stbuf) < 0) goto perm; if ((stbuf.st_mode&02) == 0) goto perm; sigs(eof); fprintf(tf, "\r\nMessage from "); #ifdef interdata fprintf(tf, "(Interdata) " ); #endif fprintf(tf, "%s on %s at %d:%02d ...\r\n" , me, mytty , localclock -> tm_hour , localclock -> tm_min ); fflush(tf); for(;;) { char buf[128]; i = read(0, buf, 128); if(i <= 0) eof(); if(buf[0] == '!') { buf[i] = 0; ex(buf); continue; } write(fileno(tf), buf, i); if ( buf[ i - 1 ] == '\n' ) write( fileno( tf ) , "\r" , 1 ); } perm: printf("Permission denied\n"); exit(1); } timout() { printf("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) { 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); } ut() { printf("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) { 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(signucmd/pxp/ 775 0 33 0 2552606525 5331 cmd/pxp/0.h 444 0 33 16044 2552606512 5743 /* static char *sccsid = "@(#)0.h 1.1 (Berkeley) 3/2/81";*/ /* Copyright (c) 1979 Regents of the University of California */ /* #define DEBUG */ #define CHAR #define STATIC /* * pxp - Pascal execution profiler * * Bill Joy * University of California, Berkeley (UCB) * Version 1.1 February 1978 */ /* * Option flags * * The following options are recognized on the command line by pxp. * Only the u, w, and z options here have effect in comments in the * program; the others are command line only, and ((unrelated * to the options with the same designations in comments. * * a Print all routines in a profile; normally, routines * which have never been executed have their bodies suppressed. * * c Extract profile data from the file core, or the file * named after the last argument rather than the file 'pmon.out'. * Must be used with z to have an effect. * * d Suppress declarations * * f Fully parenthesize expressions. * * j Left justify all procedures and functions rather than * indenting them. * * n Eject a new page in the listing as each 'include' file * is incorporated into the profile. * * o Put output prettyprint in first argument file * * p Pretty print a main program without processing * the include statements. * * t Print a table summarizing procedure and function call counts. * * u Card image mode; only the first 72 chars on a line count. * * w Suppress certain warning diagnostics. * * z Generate an execution profile of the program. * May also be followed by a list of procedure and function * names mixed, if desired, with include file names. * Only these procedures and functions, and the contents * of the specified include files will then be profiled. * * [23456789] Use the specified number of spaces for the basic * indenting unit in the program. * * _ Underline keywords in the output. */ char all, core, nodecl, full, justify, pmain, stripcomm, table, underline; char profile, onefile; char *firstname, *stdoutn; #ifdef DEBUG char fulltrace, errtrace, testtrace, yyunique, typetest; #endif int unit; /* * The flag nojunk means that header lines * of procedures and functions are to be suppressed * when the z option is off. * It is the default when command line z option * control is specified. * * The flag noinclude indicates that include statements are not * to be processed since we are pretty-printing the contents * of a single file. * * The flag bracket indicates that the source code should be * bracketed with lines of the form * program x(output); * and * begin end. * so that an include will pretty print without syntax errors. */ char nojunk, noinclude, bracket; /* * IMPORTANT NOTE * * Many of the following globals are shared by pi and pxp. * For more discussion of these see the available documentation * on the structure of pi. */ /* * Each option has a stack of 17 option values, with opts giving * the current, top value, and optstk the value beneath it. * One refers to option `l' as, e.g., opt('l') in the text for clarity. */ char opts[26]; int optstk[26]; #define opt(c) opts[c-'a'] /* * NOTES ON THE DYNAMIC NATURE OF THE DATA STRUCTURES * * Pxp uses expandable tables for its string table * hash table, and parse tree space. The following * definitions specify the size of the increments * for these items in fundamental units so that * each uses approximately 1024 bytes. */ #define STRINC 1024 /* string space increment */ #define TRINC 512 /* tree space increment */ #define HASHINC 509 /* hash table size in words, each increment */ /* * The initial sizes of the structures. * These should be large enough to profile * an "average" sized program so as to minimize * storage requests. * On a small system or and 11/34 or 11/40 * these numbers can be trimmed to make the * profiler smaller. */ #define ITREE 2000 #define IHASH 509 /* * The following limits on hash and tree tables currently * allow approximately 1200 symbols and 20k words of tree * space. The fundamental limit of 64k total data space * should be exceeded well before these are full. */ #define MAXHASH 4 #define MAXTREE 30 #define MAXDEPTH 150 /* * ERROR RELATED DEFINITIONS */ /* * Exit statuses to pexit * * AOK * ERRS Compilation errors inhibit obj productin * NOSTART Errors before we ever got started * DIED We ran out of memory or some such */ #define AOK 0 #define ERRS 1 #define NOSTART 2 #define DIED 3 char Recovery; /* * The flag eflg is set whenever we have a hard error. * The character in errpfx will precede the next error message. */ int eflg; char errpfx; #define setpfx(x) errpfx = x #define standard() setpfx('s') #define warning() setpfx('w') #define recovered() setpfx('e') #define quit() setpfx('Q') /* * SEMANTIC DEFINITIONS */ #define NIL 0 /* * NOCON and SAWCON are flags in the tree telling whether * a constant set is part of an expression. */ #define NOCON 0 #define SAWCON 1 /* * The variable cbn gives the current block number. * The variable lastbn gives the block number before * it last changed and is used to know that we were * in a nested procedure so that we can print * begin { solve } * when solve has nested procedures or functions in it. */ int cbn, lastbn; /* * The variable line is the current semantic * line and is set in stat.c from the numbers * embedded in statement type tree nodes. */ int line; /* * The size of the display * which defines the maximum nesting * of procedures and functions allowed. */ #define DSPLYSZ 20 /* * Routines which need types * other than "integer" to be * assumed by the compiler. */ int *tree(); int *hash(); char *alloc(); long cntof(); long nowcnt(); /* * Funny structures to use * pointers in wild and wooly ways */ struct { char pchar; }; struct { int pint; int pint2; }; struct { long plong; }; struct { double pdouble; }; #define OCT 1 #define HEX 2 /* * MAIN PROGRAM GLOBALS, MISCELLANY */ /* * Variables forming a data base referencing * the command line arguments with the "z" option. */ char **pflist; int pflstc; int pfcnt; char *filename; /* current source file name */ char *lastname; /* last file name printed */ long tvec; /* mod time of the source file */ long ptvec; /* time profiled */ char printed; /* current file has been printed */ char hadsome; /* had some output */ /* * PROFILING AND FORMATTING DEFINITIONS */ /* * The basic counter information recording structure. * This is global only because people outside * the cluster in pmon.c need to know its size. */ struct pxcnt { long ntimes; /* the count this structure is all about */ int counter; /* a unique counter number for us */ int gos; /* global goto count when we hatched */ int printed; /* are we considered to have been printed? */ } pfcnts[DSPLYSZ]; /* * The pieces we divide the output line indents into: * line# PRFN label: STAT 999.---| DECL text */ #define STAT 0 #define DECL 1 #define PRFN 2 /* * Gocnt records the total number of goto's and * cnts records the current counter for generating * COUNT operators. */ int gocnt; int cnts; #include #undef putchar /* a unique counter number for us */ int gos; /* global goto count when we hatched */ int printed; /* are we considered to have been printed? */ } pfcnts[DSPLYSZ]; /* * The pieces we divide the output line indents into: * line# PRFN label: STAT 999.---| DECL text */ #define STAT 0 #define DECL 1 #define PRFN 2 /* * Gocnt records the total number of goto's and * cnts records the current counter for generating * COUNT operators. */ int gocnt; int cnts; cmd/pxp/READ_ME 444 0 33 255 2552606512 6407 @(#)READ_ME 1.1 (Berkeley) 3/2/81 Fri Oct 19 17:59:49 PDT 1979 Pxp was quick and dirty brought up on the vax today. It seems to work, but has not been extensively tested. printed? */ } pfcnts[DSPLYSZ]; /* * The pieces we divide the output line indents into: * line# PRFN label: STAT 999.---| DECL text */ #define STAT 0 #define DECL 1 #define PRFN 2 /* * Gocnt records the total number of goto's and * c/,5h< /,"cmd/pxp/TRdata.c 444 0 33 3350 2552606512 6732 static char *sccsid = "@(#)TRdata.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ #include "whoami" #include "0.h" #ifdef PI1 #ifdef DEBUG char *trnames[] { 0, "MINUS", "MOD", "DIV", "DIVD", "MULT", "ADD", "SUB", "EQ", "NE", "LT", "GT", "LE", "GE", "NOT", "AND", "OR", "ASGN", "PLUS", "IN", "LISTPP", "PDEC", "FDEC", "PVAL", "PVAR", "PFUNC", "PPROC", "NIL", "STRNG", "CSTRNG", "PLUSC", "MINUSC", "ID", "INT", "FINT", "CINT", "CFINT", "TYPTR", "TYPACK", "TYSCAL", "TYRANG", "TYARY", "TYFILE", "TYSET", "TYREC", "TYFIELD", "TYVARPT", "TYVARNT", "CSTAT", "BLOCK", "BSTL", "LABEL", "PCALL", "FCALL", "CASE", "WITH", "WHILE", "REPEAT", "FORU", "FORD", "GOTO", "IF", "ASRT", "CSET", "RANG", "VAR", "ARGL", "ARY", "FIELD", "PTR", "WEXP", "PROG", "BINT", "CBINT", "IFEL", "IFX", "TYID", "COPSTR", "BOTTLE", "RFIELD", "FLDLST", "LAST" }; #endif #endif char *trdesc[] { 0, "dp", "dpp", "dpp", "dpp", "dpp", "dpp", "dpp", "dpp", "dpp", "dpp", "dpp", "dpp", "dpp", "dp", "dpp", "dpp", "npp", "dp", "dpp", "pp", "n\"pp", "n\"pp", "pp", "pp", "pp", "p", "d", "dp", "p", "p", "p", "p", "dp", "dp", "p", "p", "np", "np", "np", "npp", "npp", "np", "np", "np", "pp", "nppp", "npp", "npp", "np", "np", "n\"p", "n\"p", "n\"p", "npp", "npp", "npp", "npp", "nppp", "nppp", "n\"", "nppp", "np", "dp", "pp", "n\"p", "p", "p", "pp", "", "ppp", "n\"pp", "dp", "p((", "nppp", "nppp", "np", "s", "nnnnn", "npp", "npp", "x" }; char *opnames[] { 0, "unary -", "mod", "div", "/", "*", "+", "-", "=", "<>", "<", ">", "<=", ">=", "not", "and", "or", ":=", "unary +", "in" }; "np", "np", "np", "npp", "npp", "np", "np", "np", "pp", "nppp", "npp", "npp", "np", "np", "n\"p", "n\"p", "n\"p", "npp", "npp", "npp", "npp", "nppp", "nppp", "n\"", "nppp", "np", "dp", "pp", "n\"p", "p", "p", "pp", "", "ppp", "n\"pp", "dp", "pcmd/pxp/Version.c 444 0 33 234 2552606512 7156 static char *sccsid = "@(#)Version.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ char version[] "May 7, 1979"; "<", ">", "<=", ">=", "not", "and", "or", ":=", "unary +", "in" }; "np", "np", "np", "npp", "npp", "np", "np", "np", "pp", "nppp", "npp", "npp", "np", "np", "n\"p", "n\"p", "n\"p", "npp", "npp", "npp", "npp", "nppp", "nppp", "n\"",/,5< /,"cmd/pxp/call.c 444 0 33 1541 2552606513 6467 static char *sccsid = "@(#)call.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 January 1979 */ #include "0.h" #include "tree.h" /* * Procedure or function call */ call(p, argv) register int *argv; { register *al; ppid(p); if (argv != NIL) { ppbra("(("+1); /* xaproposstrange */ for (;;) { al = argv[1]; if (al[0] == T_WEXP) { rvalue(al[1], NIL); if (al[2] != NIL) { ppsep(": "); rvalue(al[2], NIL); } if (al[3] == OCT || al[3] == HEX) { ppspac(); ppkw(al[3] == OCT ? "oct" : "hex"); } else if (al[3] != NIL) { ppsep(": "); rvalue(al[3], NIL); } } else rvalue(argv[1], NIL); argv = argv[2]; if (argv == NIL) break; ppsep(", "); } ppket(")"); } } (argv != NIL) { ppbra("(("+1); /* xaproposstrange */ for (;;) { al = argv[1]; if (al[0] == T_WEXP) { rvalue(al[1], NIL); if (al[2] != NIL)cmd/pxp/case.c 444 0 33 2355 2552606513 6473 static char *sccsid = "@(#)case.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 January 1979 */ #include "0.h" #include "tree.h" /* * Case statement */ caseop(r) int *r; { register *cl, *cs, i; struct pxcnt scnt; savecnt(&scnt); ppkw("case"); ppspac(); rvalue(r[2], NIL); ppspac(); ppkw("of"); for (cl = r[3]; cl != NIL;) { cs = cl[1]; if (cs == NIL) continue; baroff(); ppgoin(DECL); setline(cs[1]); ppnl(); indent(); ppbra(NIL); cs = cs[2]; if (cs != NIL) { i = 0; for (;;) { gconst(cs[1]); cs = cs[2]; if (cs == NIL) break; i++; if (i == 7) { ppsep(","); ppitem(); i = 0; } else ppsep(", "); } } else ppid("{case label list}"); ppket(":"); cs = cl[1]; cs = cs[3]; getcnt(); ppgoin(STAT); if (cs != NIL && cs[0] == T_BLOCK) { ppnl(); indent(); baron(); ppstbl1(cs, STAT); baroff(); ppstbl2(); baron(); } else { baron(); statement(cs); } ppgoout(STAT); ppgoout(DECL); cl = cl[2]; if (cl == NIL) break; ppsep(";"); } if (rescnt(&scnt)) getcnt(); ppnl(); indent(); ppkw("end"); } ppitem(); i = 0; } else ppsep(", "); } } else ppid("{case label list}"); ppket(":"); cs = cl[1]; cs = cs[3]; getcnt(); ppgoin(STAT); if (cs != NIL && cs[0] == T_BLOCK) { ppnl(); indent(); baron(); ppstbl1(cs, STAT); barocmd/pxp/const.c 444 0 33 2571 2552606513 6706 static char *sccsid = "@(#)const.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 January 1979 */ #include "0.h" #include "tree.h" STATIC int constcnt -1; /* * The const declaration part */ constbeg(l, cline) int l, cline; { line = l; if (nodecl) printoff(); puthedr(); putcm(); ppnl(); indent(); ppkw("const"); ppgoin(DECL); constcnt = 0; setline(cline); } const(cline, cid, cdecl) int cline; char *cid; int *cdecl; { if (constcnt) putcm(); setline(cline); ppitem(); ppid(cid); ppsep(" = "); gconst(cdecl); ppsep(";"); constcnt++; setinfo(cline); putcml(); } constend() { if (constcnt == -1) return; if (nodecl) return; if (constcnt == 0) ppid("{const decls}"); ppgoout(DECL); constcnt = -1; } /* * A constant in an expression * or a declaration. */ gconst(r) int *r; { register *cn; cn = r; loop: if (cn == NIL) { ppid("{constant}"); return; } switch (cn[0]) { default: panic("gconst"); case T_PLUSC: ppop("+"); cn = cn[1]; goto loop; case T_MINUSC: ppop("-"); cn = cn[1]; goto loop; case T_ID: ppid(cn[1]); return; case T_CBINT: case T_CINT: case T_CFINT: ppnumb(cn[1]); if (cn[0] == T_CBINT) ppsep("b"); return; case T_CSTRNG: ppstr(cn[1]); return; } } ession * or a declaration. */ gconst(r) int *r; { register *cn; cn = r; loop: if (cn == NIL) { ppid("{constant}"); return; cmd/pxp/cset.c 444 0 33 1137 2552606513 6513 static char *sccsid = "@(#)cset.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 January 1979 */ #include "0.h" #include "tree.h" /* * Constant sets */ cset(r) int *r; { register *e, *el; ppbra("["); el = r[2]; if (el != NIL) for (;;) { e = el[1]; el = el[2]; if (e == NIL) continue; if (e[0] == T_RANG) { rvalue(e[1], NIL); ppsep(".."); rvalue(e[2], NIL); } else rvalue(e, NIL); if (el == NIL) break; ppsep(", "); } ppket("]"); } University of California */ # /* * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 January 1979 */ #include "0.h" #include "tree.h" /* * Constant sets */ cset(r) int *r; { register *e, *el; ppbra("["); el = r[2]; if (el != NIL) for (;;) { e = el[1]; el = el[2]; if (e == NIL) continue; if (e[0] == T_RANG) { rvalue(e[1], NIL); ppsep(".."); rvalue(e[2], NIL);cmd/pxp/doprnt.c 444 0 33 27717 2552606513 7117 # sccsid = "@(#)doprnt.c 1.1 (Berkeley) 3/2/81"; # 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: blb((c 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 lea((ding 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 3 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 0lp: jbc r4,r2,el1 # want this power? muld2 (rcmd/pxp/error.c 444 0 33 3650 2552606513 6710 static char *sccsid = "@(#)error.c 1.2 (Berkeley) 3/5/81"; /* Copyright (c) 1979 Regents of the University of California */ /* * pi - Pascal interpreter code translator * * Charles Haley, Bill Joy UCB * Version 1.2 January 1979 * * * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 January 1979 */ #include "0.h" #include "yy.h" #ifdef PXP extern int yyline; extern char errout; #endif char errpfx 'E'; extern int yyline; /* * Panic is called when impossible * (supposedly, anyways) situations * are encountered. #ifdef PI * Panic messages should be short * as they do not go to the message * file. #endif */ panic(s) char *s; { #ifdef DEBUG fprintf(stderr, "Snark (%s) line=%d yyline=%d\n", s, line, yyline); #endif #ifdef PXP Perror( "Snark in pxp", s); #endif #ifdef PI Perror( "Snark in pi", s); #endif pexit(DIED); } extern char *errfile; /* * Error is called for * semantic errors and * prints the error and * a line number. */ error(a1, a2, a3, a4) { #ifdef PI char buf[256]; register int i; #endif #ifdef PXP /* int ofout; */ #endif if (errpfx == 'w' && opt('w') != 0) { errpfx = 'E'; return; } #ifdef PXP /* flush(); ofout = fout[0]; fout[0] = errout; */ #endif #ifdef PI Enocascade = 0; geterr(a1, buf); a1 = buf; #endif if (line < 0) line = -line; yySsync(); yysetfile(filename); #ifdef PI if (errpfx == ' ') { printf(" "); for (i = line; i >= 10; i =/ 10) putchar(' '); printf("... "); } else if (Enoline) printf(" %c - ", errpfx); else #endif fprintf(stderr, "%c %d - ", errpfx, line); fprintf(stderr, a1, a2, a3, a4); if (errpfx == 'E') #ifdef PI eflg++, cgenflg++; #endif #ifdef PXP eflg++; #endif errpfx = 'E'; #ifdef PI if (Eholdnl) Eholdnl = 0; else #endif putc('\n', stderr); #ifdef PXP /* flush(); fout[0] = ofout; */ #endif } #ifdef PI cerror(a1, a2, a3, a4) { if (Enocascade) return; setpfx(' '); error(a1, a2, a3, a4); } #endif tchar(' '); printf("... "); } else if (Enoline) printf(" %c - ", errpfx); else #ecmd/pxp/fdec.c 444 0 33 7131 2552606514 6457 static char *sccsid = "@(#)fdec.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 January 1979 */ #include "0.h" #include "tree.h" /* * Program, procedure or function "header", i.e.: * * function sin: real; */ funchdr(r) int *r; { register **rl, *il; if (inpflist(r[2])) { optstk['z'-'a'] =<< 1; optstk['z'-'a'] =| opts['z'-'a']; opts['z'-'a'] = 1; } cbn++; lastbn = cbn; getcnt(); if (nojunk && !inpflist(r[2])) setprint(); else printon(); if (r[0] == T_PROG && noinclude && bracket) printoff(); if (cbn > 1 && !justify) ppgoin(PRFN); puthedr(); if (noblank(setline(r[1]))) ppnl(); cnttab(r[2], pfcnt++); ppnl(); indent(); switch (r[0]) { case T_PROG: ppkw("program"); break; case T_PDEC: ppkw("procedure"); break; case T_FDEC: ppkw("function"); break; default: panic("funchdr"); } ppspac(); ppid(r[2]); if (r[0] != T_PROG) { rl = r[3]; if (rl != NIL) { ppbra("("); for (;;) { if (rl[1] == NIL) { rl = rl[2]; continue; } switch (rl[1][0]) { case T_PVAR: ppkw("var"); ppspac(); break; case T_PPROC: ppkw("procedure"); ppspac(); break; case T_PFUNC: ppkw("function"); ppspac(); break; } il = rl[1][1]; if (il != NIL) for (;;) { ppid(il[1]); il = il[2]; if (il == NIL) break; ppsep(", "); } else ppid("{identifier list}"); if (rl[1][0] != T_PPROC) { ppsep(":"); gtype(rl[1][2]); } rl = rl[2]; if (rl == NIL) break; ppsep(";"); ppspac(); } ppket(")"); } if (r[0] == T_FDEC && r[4] != NIL) { ppsep(":"); gtype(r[4]); } ppsep(";"); } else { rl = r[3]; if (rl != NIL) { ppbra("("); for (;;) { ppid(rl[1]); rl = rl[2]; if (rl == NIL) break; ppsep(", "); } ppket(")"); } ppsep(";"); } fhout: setline(r[1]); putcml(); savecnt(&pfcnts[cbn]); setprint(); --cbn; if (cbn && !justify) ppgoout(PRFN); return (r[2]); } /* * Forward declaration i.e. the second line of * * procedure fum(var i: integer); * forward; */ funcfwd(fp) char *fp; { baroff(); ppgoin(DECL); ppnl(); indent(); ppkw("forward"); ppsep(";"); ppgoout(DECL); baron(); return (fp); } /* * The "body" of a procedure, function, or program declaration, * i.e. a non-forward definition encounter. */ funcbody(fp) char *fp; { if (cbn && !justify) ppgoin(PRFN); cbn++; lastbn = cbn; return (fp); } /* * The guts of the procedure, function or program, i.e. * the part between the begin and the end. */ funcend(fp, bundle, binfo) char *fp; int *bundle, *binfo; { int *blk; extern int cntstat; cntstat = 0; blk = bundle[2]; rescnt(&pfcnts[cbn]); setprint(); if (cbn == 1 && noinclude && bracket) printoff(); if (lastbn > cbn) unprint(); if (cbn == 1) puthedr(); if (noblank(setline(bundle[1])) && lastbn > cbn) ppnl(); ppnl(); indent(); ppkw("begin"); setline(bundle[1]); if (putcml() == 0 && lastbn > cbn) ppsname(fp); ppgoin(DECL); statlist(blk); setinfo(bundle[1]); putcmp(); ppgoout(DECL); ppnl(); indent(); ppkw("end"); ppsep(cbn == 1 ? "." : ";"); setinfo(binfo); if (putcml() == 0) ppsname(fp); cbn--; if (cbn && !justify) ppgoout(PRFN); if (inpflist(fp)) { opts['z'-'a'] = optstk['z'-'a'] & 1; optstk['z'-'a'] =>> 1; } if (cbn == 0) { flushcm(); printon(); ppnl(); } } ppsname(fp) char *fp; { if (fp == NIL) return; ppsep(" { "); ppid(fp); ppsep(" }"); } lastbn > cbn) ppsname(fp); ppgoin(DECL); statlist(blk); setinfo(bundle[1]); putcmp(); ppgoout(DECL); ppnl(); indent(); ppkw("end"); ppsep(cbn == 1 ? "." : ";"); setinfo(binfo); if (putcml() == 0) ppsname(fp); cbn--; if (cbn && !justify) ppgoout(PRFN); if (inpflist(fp)) { opts['z'-'a'] = optstk['z'-'a'] & 1; optstk['z'-'a'] =>> 1; } if (cbn == 0) { flushcm(); printon(); ppnl(); } } ppsncmd/pxp/func.c 444 0 33 510 2552606514 6463 static char *sccsid = "@(#)func.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 January 1979 */ #include "0.h" #include "tree.h" /* * A function call */ funccod(r) register int *r; { call(r[2], r[3]); } bn && !justify) ppgoout(PRFN); if (inpflist(fp)) { opts['z'-'a'] = optstk['z'-'a'] & 1;/,5< /,"cmd/pxp/gram 444 0 33 765 2552606514 6251 "@(#)gram 1.1 (Berkeley) 3/2/81" /yyval/s//*&/ /\*yysterm\[]/,$d 1;/yyactr/ka 'a,$s/yypv/yyYpv/g 'aa register int **yyYpv; register int *p, *q; yyYpv = yypv; . 1;/^##/-w y.tab.h /^int yylval 0/d /extern int yychar,/s//extern/ /yyclearin/d /yyerrok/d 1;/^##/d $a yyEactr(__np__, var) int __np__; char *var; { switch(__np__) { default: return (1); . g/case.*@/s/@//\ .m$ g/@/ka\ 'a;?case?,?case?t$\ 'am$\ a\ }\ break; $a } } . 1,$s/@// /int nterms/d /int nnonter/d /int nstate/d /int yyerrval/d w q "((cmd/pxp/hash.c 444 0 33 7171 2552606514 6505 static char *sccsid = "@(#)hash.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pi - Pascal interpreter code translator * * Charles Haley, Bill Joy UCB * Version 1.2 November 1978 * * * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 November 1978 */ #include "0.h" #include "yy.h" /* * The definition for the segmented hash tables. */ struct ht { int *ht_low; int *ht_high; int ht_used; } htab[MAXHASH]; /* * This is the array of keywords and their * token values, which are hashed into the table * by inithash. */ struct kwtab yykey[] = { "and", YAND, "array", YARRAY, "assert", YASSERT, "begin", YBEGIN, "case", YCASE, "const", YCONST, "div", YDIV, "do", YDO, "downto", YDOWNTO, "else", YELSE, "end", YEND, "file", YFILE, "for", YFOR, "forward", YFORWARD, "function", YFUNCTION, "goto", YGOTO, "if", YIF, "in", YIN, "label", YLABEL, "mod", YMOD, "nil", YNIL, "not", YNOT, "of", YOF, "or", YOR, "packed", YPACKED, "procedure", YPROCEDURE, "program", YPROG, "record", YRECORD, "repeat", YREPEAT, "set", YSET, "then", YTHEN, "to", YTO, "type", YTYPE, "until", YUNTIL, "var", YVAR, "while", YWHILE, "with", YWITH, "oct", YOCT, /* non-standard Pascal */ "hex", YHEX, /* non-standard Pascal */ 0 }; char *lastkey = &yykey[sizeof yykey/sizeof yykey[0]]; /* * Inithash initializes the hash table routines * by allocating the first hash table segment using * an already existing memory slot. */ #ifndef PI0 inithash() #else inithash(hshtab) int *hshtab; #endif { register int *ip; #ifndef PI0 static int hshtab[HASHINC]; #endif htab[0].ht_low = hshtab; htab[0].ht_high = &hshtab[HASHINC]; for (ip = yykey; *ip; ip += 2) hash(ip[0], 0)[0] = ip; } /* * Hash looks up the s(ymbol) argument * in the string table, entering it if * it is not found. If save is 0, then * the argument string is already in * a safe place. Otherwise, if hash is * entering the symbol for the first time * it will save the symbol in the string * table using savestr. */ int *hash(s, save) char *s; int save; { register int *h; register i; register char *cp; int *sym; struct ht *htp; int sh; /* * The hash function is a modular hash of * the sum of the characters with the sum * doubled before each successive character * is added. */ cp = s; if (cp == NIL) cp = token; /* default symbol to be hashed */ i = 0; while (*cp) i = i*2 + *cp++; sh = (i&077777) % HASHINC; cp = s; if (cp == NIL) cp = token; /* * There are as many as MAXHASH active * hash tables at any given point in time. * The search starts with the first table * and continues through the active tables * as necessary. */ for (htp = htab; htp < &htab[MAXHASH]; htp++) { if (htp->ht_low == NIL) { cp = (char *) calloc(sizeof ( int * ), HASHINC); if (cp == -1) { yerror("Ran out of memory (hash)"); pexit(DIED); } htp->ht_low = cp; htp->ht_high = htp->ht_low + HASHINC; cp = s; if (cp == NIL) cp = token; } h = htp->ht_low + sh; /* * quadratic rehash increment * starts at 1 and incremented * by two each rehash. */ i = 1; do { if (*h == 0) { if (htp->ht_used > (HASHINC * 3)/4) break; htp->ht_used++; if (save != 0) { *h = (int) savestr(cp); } else *h = s; return (h); } sym = *h; if (sym < lastkey && sym >= yykey) sym = *sym; if (sym->pchar == *cp && strcmp(sym, cp) == 0) return (h); h += i; i += 2; if (h >= htp->ht_high) h -= HASHINC; } while (i < HASHINC); } yerror("Ran out of hash tables"); pexit(DIED); } d * by two each rehash. */ i = 1; do { if (*h == 0) { if (htp->ht_used > (HASHINC * 3)/4) break; htp->ht_used++; if (save != 0) { *h = (int) savestr(cp); } else *h = s; return (h); } sym = *h; if (sym < lastkey && sym >= yykey) sym = *sym; if (sym->pchar == *cp && strcmp(sym, cp) == 0) return (h); h += i; i += 2; cmd/pxp/lab.c 444 0 33 1507 2552606514 6315 static char *sccsid = "@(#)lab.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 January 1979 */ #include "0.h" /* * Label declaration part */ label(r, l) int *r, l; { register *ll; if (nodecl) printoff(); puthedr(); setline(l); ppnl(); indent(); ppkw("label"); ppgoin(DECL); ppnl(); indent(); ppbra(NIL); ll = r; if (ll != NIL) for (;;) { pplab(ll[1]); ll = ll[2]; if (ll == NIL) break; ppsep(", "); } else ppid("{label list}"); ppket(";"); putcml(); ppgoout(DECL); } /* * Goto statement */ gotoop(s) char *s; { gocnt++; ppkw("goto"); ppspac(); pplab(s); } /* * A label on a statement */ labeled(s) char *s; { linopr(); indentlab(); pplab(s); ppsep(":"); } f(); puthedr(); setline(l); ppnl(); indent(); ppkw("label"); ppgoin(DECL); ppnl(); indent(); ppbra(NIL); ll = r; if (ll != NIL) for (;;) { pplab(ll[1]); ll = ll[2]; cmd/pxp/lval.c 444 0 33 1635 2552606514 6517 static char *sccsid = "@(#)lval.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 January 1979 */ #include "0.h" #include "tree.h" /* * A "variable" */ lvalue(r) register int *r; { register *c, *co; ppid(r[2]); for (c = r[3]; c != NIL; c = c[2]) { co = c[1]; if (co == NIL) continue; switch (co[0]) { case T_PTR: ppop("^"); continue; case T_ARY: arycod(co[1]); continue; case T_FIELD: ppop("."); ppid(co[1]); continue; case T_ARGL: ppid("{unexpected argument list}"); break; default: panic("lval2"); } } } /* * Subscripting */ arycod(el) register int *el; { ppbra("["); if (el != NIL) for (;;) { rvalue(el[1], NIL); el = el[2]; if (el == NIL) break; ppsep(", "); } else rvalue(NIL, NIL); ppket("]"); } e; switch (co[0]) { case T_PTR: ppop("^"); continue; case T_ARY: arycod(co[1]);cmd/pxp/main.c 444 0 33 11107 2552606514 6520 static char *sccsid = "@(#)main.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 January 1979 */ #include "0.h" /* * This program is described in detail in the "PXP 1.0 Implementation Notes" * * The structure of pxp is very similar to that of the translator pi. * The major new pieces here are a set of profile data maintenance * routines in the file pmon.c and a set of pretty printing utility * routines in the file pp.c. * The semantic routines of pi have been rewritten to do a simple * reformatting tree walk, the parsing and scanning remains * the same. * * This version does not place more than one statement per line and * is not very intelligent about folding long lines, with only * an ad hoc way of folding case label list and enumerated type * declarations being implemented. */ char usagestr[] = "pxp [ -acdefjntuw_ ] [ -23456789 ] [ -z [ name ... ] ] name.p"; char *howfile = "/usr/lib/how_pxp"; char *stdoutn = "Standard output"; int unit = 4; FILE *ibuf; extern char errout; /* * Main program for pxp. * Process options, then call yymain * to do all the real work. */ FILE *ibp; main(argc, argv) int argc; char *argv[]; { register char *cp; register c; if (argv[0][0] == 'a') howfile =+ 9; argc--, argv++; if (argc == 0) { execl("/bin/cat", "cat", howfile, 0); goto usage; } while (argc > 0) { cp = argv[0]; if (*cp++ != '-') break; while (c = *cp++) switch (c) { #ifdef DEBUG case 'T': typetest++; continue; case 'A': testtrace++; case 'F': fulltrace++; case 'E': errtrace++; continue; case 'C': yycosts(); pexit(NOSTART); case 'U': yyunique++; continue; #endif case 'a': all++; continue; case 'c': core++; continue; case 'd': nodecl++; continue; case 'e': noinclude = -1; continue; case 'f': full++; continue; case 'j': justify++; continu((e; case 'l': case 'n': togopt(c); continue; case 'o': onefile++; continue; case 's': stripcomm++; continue; case 't': table++; continue; case 'u': case 'w': togopt(c); continue; case 'z': profile++; pflist = argv + 1; pflstc = 0; while (argc > 1) { if (dotted(argv[1], 'p')) break; pflstc++, argc--, argv++; } if (pflstc == 0) togopt(c); else nojunk++; continue; case '_': underline++; continue; default: if (c >= '2' && c <= '9') { unit = c - '0'; continue; } usage: Perror("Usage", usagestr); exit(1); } argc--, argv++; } if (core && !profile && !table) profile++; if (argc == 0 || argc > 2) goto usage; if (profile || table) { noinclude = 0; if (argc == 2) { argc--; getit(argv[1]); } else getit(core ? "core" : "pmon.out"); } else noinclude++; if (argc != 1) goto usage; firstname = filename = argv[0]; if (dotted(filename, 'i')) { if (profile || table) goto usage; noinclude = 1; bracket++; } else if (!dotted(filename, 'p')) { Perror(filename, "Name must end in '.p'"); exit(1); } if ((ibuf = fopen(filename, "r")) == NULL) perror(filename), pexit(NOSTART); ibp = ibuf; if (onefile) { int onintr(); cp = (stdoutn = "/tmp/pxp00000") + 13; signal(2, onintr); for (c = getpid(); c; c =/ 10) *--cp =| (c % 10); if (freopen(stdoutn, "w", stdout) == NULL) bad: perror(stdoutn), exit(1); } else { extern char _sobuf[BUFSIZ]; setbuf(stdout, _sobuf); } if (profile || opt('l')) { opt('n')++; yysetfile(filename); opt('n')--; } else lastname = filename; errout = 2; yymain(); /* No return */ } /* * Put a header on a top of a page */ header() { extern char version[]; static char reenter; extern int outcol; gettime(); if (reenter) { if (outcol) putchar('\n'); putchar('\f'); } reenter++; if (profile || table) { printf("Berkeley Pascal PXP -- Version 1.1 (%s)\n\n%s %s\n\n", version, myctime(&tvec), filename); printf("Profiled %s\n\n", myctime(&ptvec)); } } char ugh[] = "Fatal error in pxp\n"; /* * Exit from the Pascal system. * We throw in an ungraceful termination * message if c > 1 indicating a severe * error such as running out of memory * or an internal inconsistency. */ pexit(c) int c; { register char *cp; extern int outcol; if (stdoutn[0] == '/') unlink(stdoutn); if (outcol) putchar('\n'); flush(); if (c == DIED) write(2, ugh, sizeof ugh); exit(c); } onintr() { pexit(DIED); } puthedr() { yysetfile(filename); } &ptvec)); } } char ugh[] = "Fatal error in pxp\n"; /* * Exit from the Pascal system. * We throw in an ungraceful termination * message if c > 1 indicating a severe * error such as running out of memory * or an internal inconsistency. */ pexit(c) int c; { register char *cp; extern int outcol; if (stdoutn[0] == '/') unlink(stdoutn); if (outcol) putchar('\n'); flush(); if (c == DIED) write(2, ugh, sizeof ugh); exit(c)cmd/pxp/makefile 444 0 33 2063 2552606515 7112 SCCSID = "@(#)makefile 1.2 (Berkeley) 3/5/81" DESTDIR= ED= -ed AS= -as VERSION= version EYACC= /usr/ucb/eyacc CFLAGS= -O -DPXP -w OBJS= call.o case.o const.o cset.o \ error.o fdec.o func.o hash.o lab.o lval.o \ main.o nl.o pmon.o pp.o proc.o rec.o rval.o \ stat.o string.o subr.o tree.o type.o var.o y.tab.o \ yycomm.o yycosts.o yyerror.o yyget.o yyid.o yylex.o yymain.o \ yypanic.o yyparse.o yyprint.o yyput.o yyrecover.o \ yyseman.o yytree.o OBJS2= doprnt.o printf.o treen.o yycopy.o TRdata.o Version.o all: a.out a.out: ${OBJS} ${OBJS2} ${CC} ${CFLAGS} -i ${OBJS} ${OBJS2} doprnt.o: doprnt.c ${CC} ${CFLAGS} -E doprnt.c > doprnt.s ${AS} -o doprnt.o doprnt.s -rm -f doprnt.s #y.tab.c: pas.y # ${EYACC} pas.y # ${ED} - y.tab.c < gram clean: -rm -f pi1:2strings a.out core -echo dont rm y.tab.c -rm -f *.o x* install: a.out cp a.out ${DESTDIR}/usr/ucb/pxp # cp a.outNOID /usr/ucb/pxp34 print: @pr makefile READ_ME @ls -ls | pr @size a.out *.o | pr # @cxref *.c | pr @pr 0.h main.c pas.y @pr yy.h yy*.c @pr [a-ln-x]*.c # @pr putn.s treen.s yycopy.s } -i ${OBJS} ${OBJS2} doprnt.o: doprnt.c ${CC} ${CFLAGS} -E doprnt.c > doprnt.s ${AS} -o doprnt.o doprnt.s -rm -f doprnt.s #y.tab.c: pas.y # ${EYACC} pas.y # ${ED} - y.tab.c < gram clean: -rm -f pi1:2strings a.out core -echo dont rm y.tab.c -rm -f *.o x* install: a.out cp a.out ${DESTDIR}/usr/ucb/pxp # cp a.outNOID /usr/ucb/pxp34 print: @pr makefile READ_ME @ls -ls | pr @size a.out *.o | pr # @cxref *.c | pr @pr 0.h main.c pas.y @pr yy.h yycmd/pxp/nl.c 444 0 33 26141 2552606515 6212 static char *sccsid = "@(#)nl.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pi - Pascal interpreter code translator * * Charles Haley, Bill Joy UCB * Version 1.2 January 1979 */ #include "0.h" #include "opcode.h" #ifdef PI /* * Array of information about pre-defined, block 0 symbols. */ int *biltins[] { /* * Types */ "boolean", "char", "integer", "real", "_nil", /* dummy name */ 0, /* * Ranges */ TINT, 0177777, 0177600, 0, 0177, TINT, 0177777, 0100000, 0, 077777, TINT, 0100000, 0, 077777, 0177777, TCHAR, 0, 0, 0, 127, TBOOL, 0, 0, 0, 1, TDOUBLE, 0, 0, 0, 0, /* fake for reals */ 0, /* * Built-in composite types */ "Boolean", "intset", "alfa", "text", "input", "output", /* * Built-in constants */ "true", TBOOL, 1, 0, "false", TBOOL, 0, 0, "minchar", T1CHAR, 0, 0, "maxchar", T1CHAR, 0177, 0, "bell", T1CHAR, 07, 0, "tab", T1CHAR, 011, 0, "minint", T4INT, 0100000, 0, /* Must be last 2! */ "maxint", T4INT, 077777, 0177777, 0, /* * Built-in functions */ #ifndef PI0 "abs", O_ABS2, "arctan", O_ATAN, "card", O_CARD|NSTAND, "chr", O_CHR2, "clock", O_CLCK|NSTAND, "cos", O_COS, "eof", O_EOF, "eoln", O_EOLN, "eos", 0, "exp", O_EXP, "expo", O_EXPO|NSTAND, "ln", O_LN, "odd", O_ODD2, "ord", O_ORD2, "pred", O_PRED2, "round", O_ROUND, "sin", O_SIN, "sqr", O_SQR2, "sqrt", O_SQRT, "succ", O_SUCC2, "trunc", O_TRUNC, "undefined", O_UNDEF|NSTAND, /* * Extensions */ "argc", O_ARGC|NSTAND, "random", O_RANDOM|NSTAND, "seed", O_SEED|NSTAND, "wallclock", O_WCLCK|NSTAND, "sysclock", O_SCLCK|NSTAND, 0, /* * Built-in procedures */ "date", O_DATE|NSTAND, "flush", O_FLUSH|NSTAND, "get", O_GET, "getseg", 0, "halt", O_HALT|NSTAND, "linelimit", O_LLIMIT|NSTAND, "message", O_MESSAGE|NSTAND, "new", O_NEW, "pack", O_PACK, "page", O_PAGE, "put", O_PUT, "putseg", 0, "read", O_READ4, "readln", O_READLN, "remove", O_REMOVE|NSTAND, "reset", O_RESET, "rewrite", O_REWRITE, "time", O_TIME|NSTAND, "unpack", O_UNPACK, "write", O_WRIT2, "writeln", O_WRITLN, /* * Extensions */ "argv", O_ARGV|NSTAND, "null", O_NULL|NSTAND, "stlimit", O_STLIM|NSTAND, 0, #else "abs", "arctan", "card", "chr", "clock", "cos", "eof", "eoln", "eos", "exp", "expo", "ln", "odd", "ord", "pred", "round", "sin", "sqr", "sqrt", "succ", "trunc", "undefined", /* * Extensions */ "argc", "random", "seed", "wallclock", "sysclock", 0, /* * Built-in procedures */ "date", "flush", "get", "getseg", "halt", "linelimit", "message", "new", "pack", "page", "put", "putseg", "read", "readln", "remove", "reset", "rewrite", "time", "unpack", "write", "writeln", /* * Extensions */ "argv", "null", "stlimit", 0, #endif }; /* * NAMELIST SEGMENT DEFINITIONS */ struct nls { struct nl *nls_low; struct nl *nls_high; } ntab[MAXNL], *nlact; struct nl nl[INL]; struct nl *nlp nl; struct nls *nlact ntab; /* * Initnl initializes the first namelist segment and then * uses the array biltins to initialize the name list for * block 0. */ initnl() { register int *q; register struct nl *p; register int i; #ifdef DEBUG if (hp21mx) { MININT = -32768.; MAXINT = 32767.; #ifndef PI0 genmx(); #endif } #endif ntab[0].nls_low = nl; ntab[0].nls_high = &nl[INL]; defnl(0, 0, 0, 0); /* * Fundamental types */ for (q = biltins; *q != 0; q++) hdefnl(*q, TYPE, nlp, 0); q++; /* * Ranges */ while (*q) { p = defnl(0, RANGE, nl+*q, 0); nl[*q++].type = p; for (i = 0; i < 4; i++) p->value[i] = *q++; } q++; #ifdef DEBUG if (hp21mx) { nl[T4INT].range[0] = MININT; nl[T4INT].range[1] = MAXINT; } #endif /* * Pre-defined composite types */ hdefnl(*q++, TYPE, nl+T1BOOL, 0); enter(defnl((intset = *q++), TYPE, nlp+1, 0)); defnl(0, SET, nlp+1, 0); defnl(0, RANGE, nl+TINT, 0)->value[3] = 127; p= defnl(0, RANGE, nl+TINT, 0); p->value[1] = 1; p->value[3] = 10; defnl(0, ARRAY, nl+T1CHAR, 1)->chain = p; hdefnl(*q++, TYPE, nlp-1, 0); /* "alfa" */ hdefnl(*q++, TYPE, nlp+1, 0); /* "text" */ p= defnl(0, FILE, nl+T1CHAR, 0); p->nl_flags =| NFILES; #ifndef PI0 input = hdefnl(*q++, VAR, p, -2); /* "input" */ output = hdefnl(*q++, VAR, p, -4); /* "output" */ #else input = hdefnl(*q++, VAR, p, 0); /* "input" */ output = hdefnl(*q++, VAR, p, 0); /* "output" */ #endif /* * Pre-defined constants */ for (; *q; q =+ 4) hdefnl(q[0], CONST, nl+q[1], q[2])->value[1] = q[3]; #ifdef DEBUG if (hp21mx(() { nlp[-2].range[0] = MININT; nlp[-1].range[0] = MAXINT; } #endif /* * Built-in procedures and functions */ #ifndef PI0 for (q++; *q; q =+ 2) hdefnl(q[0], FUNC, 0, q[1]); for (q++; *q; q =+ 2) hdefnl(q[0], PROC, 0, q[1]); #else for (q++; *q;) hdefnl(*q++, FUNC, 0, 0); for (q++; *q;) hdefnl(*q++, PROC, 0, 0); #endif } hdefnl(sym, cls, typ, val) { register struct nl *p; #ifndef PI1 if (sym) hash(sym, 0); #endif p = defnl(sym, cls, typ, val); if (sym) enter(p); return (p); } /* * Free up the name list segments * at the end of a statement/proc/func * All segments are freed down to the one in which * p points. */ nlfree(p) struct nl *p; { nlp = p; while (nlact->nls_low > nlp || nlact->nls_high < nlp) { free(nlact->nls_low); nlact->nls_low = NIL; nlact->nls_high = NIL; --nlact; if (nlact < &ntab[0]) panic("nlfree"); } } #endif char VARIABLE[] "variable"; char *classes[] { "undefined", "constant", "type", VARIABLE, "array", "pointer or file", "record", "field", "procedure", "function", VARIABLE, VARIABLE, "pointer", "file", "set", "subrange", "label", "withptr", "scalar", "string", "program", "improper", #ifdef DEBUG "variant", #endif }; char snark[] "SNARK"; #ifdef PI #ifdef DEBUG char *ctext[] { "BADUSE", "CONST", "TYPE", "VAR", "ARRAY", "PTRFILE", "RECORD", "FIELD", "PROC", "FUNC", "FVAR", "REF", "PTR", "FILE", "SET", "RANGE", "LABEL", "WITHPTR", "SCAL", "STR", "PROG", "IMPROPER", "VARNT" }; char *stars "\t***"; /* * Dump the namelist from the * current nlp down to 'to'. * All the namelist is dumped if * to is NIL. */ dumpnl(to, rout) struct nl *to; { register struct nl *p; register int j; struct nls *nlsp; int i, v, head; if (opt('y') == 0) return; if (to != NIL) printf("\n\"%s\" Block=%d\n", rout, cbn); nlsp = nlact; head = NIL; for (p = nlp; p != to;) { if (p == nlsp->nls_low) { if (nlsp == &ntab[0]) break; nlsp--; p = nlsp->nls_high; } p--; if (head == NIL) { printf("\tName\tClass Bn+Flags\tType\tVal\tChn\n"); head++; } printf("%3d:", nloff(p)); if (p->symbol) printf("\t%.7s", p->symbol); else printf(stars); if (p->class) printf("\t%s", ctext[p->class]); else printf(stars); if (p->nl_flags) { putchar('\t'); if (p->nl_flags & 037) printf("%d ", p->nl_flags & 037); #ifndef PI0 if (p->nl_flags & NMOD) putchar('M'); if (p->nl_flags & NUSED) putchar('U'); #endif if (p->nl_flags & NFILES) putchar('F'); } else printf(stars); if (p->type) printf("\t[%d]", nloff(p->type)); else printf(stars); v = p->value[0]; switch (p->class) { case TYPE: break; case VARNT: goto con; case CONST: switch (nloff(p->type)) { default: printf("\t%d", v); break; case TDOUBLE: printf("\t%f", p->real); break; case TINT: con: printf("\t%ld", p->range[0]); break; case TSTR: printf("\t'%s'", v); break; } break; case VAR: case REF: case WITHPTR: printf("\t%d,%d", cbn, v); break; case SCAL: case RANGE: printf("\t%ld..%ld", p->range[0], p->range[1]); break; case RECORD: printf("\t%d(%d)", v, p->value[NL_FLDSZ]); break; case FIELD: printf("\t%d", v); break; case STR: printf("\t\"%s\"", p->value[1]); goto casedef; case FVAR: case FUNC: case PROC: case PROG: if (cbn == 0) { printf("\t<%o>", p->value[0] & 0377); #ifndef PI0 if (p->value[0] & NSTAND) printf("\tNSTAND"); #endif break; } v = p->value[1]; default: casedef: if (v) printf("\t<%d>", v); else printf(stars); } if (p->chain) printf("\t[%d]", nloff(p->chain)); switch (p->class) { case RECORD: if (p->value[NL_VARNT]) printf("\tVARNT=[%d]", nloff(p->value[NL_VARNT])); if (p->value[NL_TAG]) printf(" TAG=[%d]", nloff(p->value[NL_TAG])); break; case VARNT: printf("\tVTOREC=[%d]", nloff(p->value[NL_VTOREC])); break; } putchar('\n'); } if (head == 0) printf("\tNo entries\n"); } #endif /* * Define a new name list entry * with initial symbol, class, type * and value[0] as given. A new name * list segment is allocated to hold * the next name list slot if necessary. */ defnl(sym, cls, typ, val) char *sym; int cls; struct nl *typ; int val; { register struct nl *p; register int *q, i; char *cp; p = nlp; /* * Zero out this entry */ q = p; i = (sizeof *p)/2; do *q++ = 0; while (--i); /* * Insert the values */ p->symbol = sym; p->class = cls; p->type = typ; p->nl_block = cbn; p->value[0] = val; /* * Insure that the next namelist * entry actually exists. This is * really not needed here, it would * suffice to do it at entry if we * need the slot. It is done this * way because, historically, nlp * always pointed at the next namelist * slot. */ nlp++; if (nlp >= nlact->nls_high) { i = NLINC; cp = alloc(NLINC * sizeof *nlp); if (cp == -1) { i = NLINC / 2; cp = alloc((NLINC / 2) * sizeof *nlp); } if (cp == -1) { error("Ran out of memory (defnl)"); pexit(DIED); } nlact++; if (nlact >= &ntab[MAXNL]) { error("Ran out of name list tables"); pexit(DIED); } nlp = cp; nlact->nls_low = nlp; nlact->nls_high = nlact->nls_low + i; } return (p); } /* * Make a duplicate of the argument * namelist entry for, e.g., type * declarations of the form 'type a = b' * and array indicies. */ nlcopy(p) struct nl *p; { register int *p1, *p2, i; p1 = p; p = p2 = defnl(0, 0, 0, 0); i = (sizeof *p)/2; do *p2++ = *p1++; while (--i); return (p); } /* * Compute a namelist offset */ nloff(p) struct nl *p; { return (p - nl); } /* * Enter a symbol into the block * symbol table. Symbols are hashed * 64 ways based on low 6 bits of the * character pointer into the string * table. */ enter(np) struct nl *np; { register struct nl *rp, *hp; register struct nl *p; int i; rp = np; if (rp == NIL) return (NIL); #ifndef PI1 if (cbn > 0) if (rp->symbol == input->symbol || rp->symbol == output->symbol) error("Pre-defined files input and output must not be redefined"); #endif i = rp->symbol; i =& 077; hp = disptab[i]; if (rp->class != BADUSE && rp->class != FIELD) for (p = hp; p != NIL && (p->nl_block & 037) == cbn; p = p->nl_next) if (p->symbol == rp->symbol && p->class != BADUSE && p->class != FIELD) { #ifndef PI1 error("%s is already defined in this block", rp->symbol); #endif break; } rp->nl_next = hp; disptab[i] = rp; return (rp); } #endif double MININT -2147483648.; double MAXINT 2147483647.; ned files input and output must not be redefined"); #endif i = rp->symbol; i =& 077; hp = disptab[i]; if (rp->class != BADUSE && rp->class != FIELD) for (p = hp; p != NIL && (p->nl_block & 037) == cbn; p = p->nl_next) if (p->symbol == rp->symbol && p->class != BADUSE && p->class != FIELD) { #ifndef PI1 error("%s is already defined in this block", rp->symbol); #endif break; } rp->nl_next = hp; dcmd/pxp/opcode.h 444 0 33 222 2552606515 7007 /* static char *sccsid = "@(#)opcode.h 1.1 (Berkeley) 3/2/81";*/ /* Copyright (c) 1979 Regents of the University of California */ /* surrogate */ ); #endif i = rp->symbol; i =& 077; hp = disptab[i]; if (rp->class != BADUSE && rp->class != FIELD) for (p = hp; p != NIL && (p->nl_block & 037) == cbn; p = p->nl_next) if (p->symbol == rp->symbol && p->class != BADUSE && p->class != FIELD) { #ifndef PI1 error("%s/,5< /,"cmd/pxp/pas.y 444 0 33 36440 2552606516 6416 /* static char *sccsid = "@(#)pas.y 1.1 (Berkeley) 3/2/81";*/ /* * pi - Pascal interpreter code translator * * Charles Haley, Bill Joy UCB * Version 1.0 August 1977 * * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.0 August 1977 */ /* * Yacc grammar for UNIX Pascal * * This grammar is processed by the commands in the shell script * "gram" to yield parse tables and semantic routines in the file * "y.tab.c" and a header defining the lexical tokens in "yy.h". * * In order for the syntactic error recovery possible with this * grammar to work, the grammar must be processed by a yacc which * has been modified to fully enumerate possibilities in states * which involve the symbol "error". * The parser used for Pascal also uses a different encoding of * the test entries in the action table which speeds the parse. * A version of yacc which will work for Pascal is included on * the distribution table as "eyacc". * * The "gram" script also makes the following changes to the "y.tab.c" * file: * * 1) Causes yyval to be declared int *. * * 2) Loads the variable yypv into a register as yyYpv so that * the arguments $1, ... are available as yyYpv[1] etc. * This produces much smaller code in the semantic actions. * * 3) Deletes the unused array yysterm. * * 4) Moves the declarations up to the flag line containing * '##' to the file yy.h so that the routines which use * these "magic numbers" don't have to all be compiled at * the same time. * * 5) Creates th((e semantic restriction checking routine yyEactr * by processing action lines containing `@'. * * This compiler uses a different version of the yacc parser, a * different yyerror which is called yerror, and requires more * lookahead sets than normally provided by yacc. * * Source for the yacc used with this grammar is included on * distribution tapes. */ /* * TERMINAL DECLARATIONS * * Some of the terminal declarations are out of the most natural * alphabetic order because the error recovery * will guess the first of equal cost non-terminals. * This makes, e.g. YTO preferable to YDOWNTO. */ %term YAND YARRAY YBEGIN YCASE YCONST YDIV YDO YDOTDOT YTO YELSE YEND YFILE YFOR YFORWARD YFUNCTION YGOTO YID YIF YIN YINT YLABEL YMOD YNOT YNUMB YOF YOR YPACKED YNIL YPROCEDURE YPROG YRECORD YREPEAT YSET YSTRING YTHEN YDOWNTO YTYPE YUNTIL YVAR YWHILE YWITH YBINT YOCT YHEX YASSERT YCASELAB YILLCH YLAST /* * PRECEDENCE DECLARATIONS * * Highest precedence is the unary logical NOT. * Next are the multiplying operators, signified by '*'. * Lower still are the binary adding operators, signified by '+'. * Finally, at lowest precedence and non-associative are the relationals. */ %binary '<' '=' '>' YIN %left '+' '-' YOR '|' %left UNARYSIGN %left '*' '/' YDIV YMOD YAND '&' %left YNOT %{ /* * GLOBALS FOR ACTIONS */ /* * The following line marks the end of the yacc * Constant definitions which are removed from * y.tab.c and placed in the file y.tab.h. */ ## #include "0.h" #include "yy.h" #include "tree.h" #ifdef PI #define lineof(l) l #define line2of(l) l #endif %} %% /* * PRODUCTIONS */ goal: prog_hedr decls procs block '.' = funcend($1, $4, lineof($5)); ; prog_hedr: YPROG YID '(' id_list ')' ';' = $$ = funcbody(funchdr(tree5(T_PROG, lineof($1), $2, fixlist($4), NIL))); | YPROG error = { yyPerror("Malformed program statement", PPROG); /* * Should make a program statement * with "input" and "output" here. */ $$ = funcbody(funchdr(tree5(T_PROG, lineof($1), NIL, NIL, NIL))); } ; block: YBEGIN stat_list YEND = { $$ = tree3(T_BSTL, lineof($1), fixlist($2)); if ($3.pint < 0) brerror($1, "begin"); } ; /* * DECLARATION PART */ decls: decls decl = trfree(); | decls error = { Derror: constend(), typeend(), varend(), trfree(); yyPerror("Malformed declaration", PDECL); } | /* lambda */ = trfree(); ; decl: labels | const_decl = constend(); | type_decl = typeend(); | var_decl = varend(); ; /* * LABEL PART */ labels: YLABEL label_decl ';' = label(fixlist($2), lineof($1)); ; label_decl: YINT = $$ = newlist($1 == NIL ? NIL : *hash($1, 1)); | label_decl ',' YINT = $$ = addlist($1, $3 == NIL ? NIL : *hash($3, 1)); ; /* * CONST PART */ const_decl: YCONST YID '=' const ';' = constbeg($1, line2of($2)), const(lineof($3), $2, $4); | const_decl YID '=' const ';' = const(lineof($3), $2, $4); | YCONST error = { constbeg($1, line2of($1)); Cerror: yyPerror("Malformed const declaration", PDECL); } | const_decl error = goto Cerror; ; /* * TYPE PART */ type_decl: YTYPE YID '=' type ';' = typebeg($1, line2of($2)), type(lineof($3), $2, $4); | type_decl YID '=' type ';' = type(lineof($3), $2, $4); | YTYPE error = { typebeg($1, line2of($1)); Terror: yyPerror("Malformed type declaration", PDECL); } | type_decl error = goto Terror; ; /* * VAR PART */ var_decl: YVAR id_list ':' type ';' = varbeg($1, line2of($3)), var(lineof($3), fixlist($2), $4); | var_decl id_list ':' type ';' = var(lineof($3), fixlist($2), $4); | YVAR error = { varbeg($1, line2of($1)); Verror: yyPerror("Malformed var declaration", PDECL); } | var_decl error = goto Verror; ; /* * PROCEDURE AND FUNCTION DECLARATION PART */ procs: /* lambda */ | procs proc = trfree(); ; proc: phead YFORWARD ';' = funcfwd($1); | pheadres decls procs block ';' = funcend($1, $4, lineof($5)); ; pheadres: phead = funcbody($1); ; phead: porf YID params ftype ';' = $$ = funchdr(tree5($1, lineof($5), $2, $3, $4)); ; porf: YPROCEDURE = $$ = T_PDEC; | YFUNCTION = $$ = T_FDEC; ; params: '(' param_list ')' = $$ = fixlist($2); | /* lambda */ = $$ = NIL; ; /* * PARAMETERS */ param: id_list ':' type = $$ = tree3(T_PVAL, fixlist($1), $3); | YVAR id_list ':' type = $$ = tree3(T_PVAR, fixlist($2), $4); | YFUNCTION id_list ':' type = $$ = tree3(T_PFUNC, fixlist($2), $4); | YPROCEDURE id_list = $$ = tree2(T_PPROC, fixlist($2)); ; ftype: ':' type = $$ = $2; | /* lambda */ = $$ = NIL; ; param_list: param = $$ = newlist($1); | param_list ';' param = $$ = addlist($1, $3); ; /* * CONSTANTS */ const: YSTRING = $$ = tree2(T_CSTRNG, $1); | number | '+' number = $$ = tree2(T_PLUSC, $2); | '-' number = $$ = tree2(T_MINUSC, $2); ; number: const_id = $$ = tree2(T_ID, $1); | YINT = $$ = tree2(T_CINT, $1); | YBINT = $$ = tree2(T_CBINT, $1); | YNUMB = $$ = tree2(T_CFINT, $1); ; const_list: const = $$ = newlist($1); | const_list ',' const = $$ = addlist($1, $3); ; /* * TYPES */ type: simple_type | '^' YID = $$ = tree3(T_TYPTR, lineof($1), tree2(T_ID, $2)); | struct_type | YPACKED struct_type = $$ = tree3(T_TYPACK, lineof($1), $2); ; simple_type: type_id | '(' id_list ')' = $$ = tree3(T_TYSCAL, lineof($1), fixlist($2)); | const YDOTDOT const = $$ = tree4(T_TYRANG, lineof($2), $1, $3); ; struct_type: YARRAY '[' simple_type_list ']' YOF type = $$ = tree4(T_TYARY, lineof($1), fixlist($3), $6); | YFILE YOF type = $$ = tree3(T_TYFILE, lineof($1), $3); | YSET YOF simple_type = $$ = tree3(T_TYSET, lineof($1), $3); | YRECORD field_list YEND = { $$ = tree3(T_TYREC, lineof($1), $2); if ($3.pint < 0) brerror($1, "record"); } ; simple_type_list: simple_type = $$ = newlist($1); | simple_type_list ',' simple_type = $$ = addlist($1, $3); ; /* * RECORD TYPE */ field_list: fixed_part variant_part = $$ = tree4(T_FLDLST, lineof(NIL), fixlist($1), $2); ; fixed_part: field = $$ = newlist($1); | fixed_part ';' field = $$ = addlist($1, $3); | fixed_part error = yyPerror("Malformed record declaration", PDECL); ; field: /* lambda */ = $$ = NIL; | id_list ':' type = $$ = tree4(T_RFIELD, lineof($2), fixlist($1), $3); ; variant_part: /* lambda */ = $$ = NIL; | YCASE type_id YOF variant_list = $$ = tree5(T_TYVARPT, lineof($1), NIL, $2, fixlist($4)); | YCASE YID ':' type_id YOF variant_list = $$ = tree5(T_TYVARPT, lineof($1), $2, $4, fixlist($6)); ; variant_list: variant = $$ = newlist($1); | variant_list ';' variant = $$ = addlist($1, $3); | variant_list error = yyPerror("Malformed record declaration", PDECL); ; variant: /* lambda */ = $$ = NIL; | const_list ':' '(' field_list ')' = $$ = tree4(T_TYVARNT, lineof($2), fixlist($1), $4); | const_list ':' '(' ')' = $$ = tree4(T_TYVARNT, lineof($2), fixlist($1), NIL); ; /* * STATEMENT LIST */ stat_list: stat = $$ = newlist($1); | stat_lsth stat = { if ((p = $1) != NIL && (q = p[1])[0] == T_IFX) { q[0] = T_IFEL; q[4] = $2; } else $$ = addlist($1, $2); } ; stat_lsth: stat_list ';' = if ((q = $1) != NIL && (p = q[1]) != NIL && p[0] == T_IF) { if (yychar < 0) yychar = yylex(); if (yyshifts >= 2 && yychar == YELSE) { recovered(); copy(&Y, &OY, sizeof Y); yerror("Deleted ';' before keyword else"); yychar = yylex(); p[0] = T_IFX; } } ; /* * CASE STATEMENT LIST */ cstat_list: cstat = $$ = newlist($1); | cstat_list ';' cstat = $$ = addlist($1, $3); | error = { $$ = NIL; Kerror: yyPerror("Malformed statement in case", PSTAT); } | cstat_list error = goto Kerror; ; cstat: const_list ':' stat = $$ = tree4(T_CSTAT, lineof($2), fixlist($1), $3); | YCASELAB stat = $$ = tree4(T_CSTAT, lineof($1), NIL, $2); | /* lambda */ = $$ = NIL; ; /* * STATEMENT */ stat: /* lambda */ = $$ = NIL; | YINT ':' stat = $$ = tree4(T_LABEL, lineof($2), $1 == NIL ? NIL : *hash($1, 1), $3); | proc_id = $$ = tree4(T_PCALL, lineof(yyline), $1, NIL); | proc_id '(' wexpr_list ')' = $$ = tree4(T_PCALL, lineof($2), $1, fixlist($3)); | YID error = goto NSerror; | assign | YBEGIN stat_list YEND = { $$ = tree3(T_BLOCK, lineof($1), fixlist($2)); if ($3.pint < 0) brerror($1, "begin"); } | YCASE expr YOF cstat_list YEND = { $$ = tree4(T_CASE, lineof($1), $2, fixlist($4)); if ($5.pint < 0) brerror($1, "case"); } | YWITH var_list YDO stat = $$ = tree4(T_WITH, lineof($1), fixlist($2), $4); | YWHILE expr YDO stat = $$ = tree4(T_WHILE, lineof($1), $2, $4); | YREPEAT stat_list YUNTIL expr = $$ = tree4(T_REPEAT, lineof($3), fixlist($2), $4); | YFOR assign YTO expr YDO stat = $$ = tree5(T_FORU, lineof($1), $2, $4, $6); | YFOR assign YDOWNTO expr YDO stat = $$ = tree5(T_FORD, lineof($1), $2, $4, $6); | YGOTO YINT = $$ = tree3(T_GOTO, lineof($1), *hash($2, 1)); | YIF expr YTHEN stat = $$ = tree5(T_IF, lineof($1), $2, $4, NIL); | YIF expr YTHEN stat YELSE stat = $$ = tree5(T_IFEL, lineof($1), $2, $4, $6); | YIF expr YTHEN stat YELSE = $$ = tree5(T_IFEL, lineof($1), $2, $4, NIL); | YASSERT '(' expr ')' = $$ = tree3(T_ASRT, lineof($1), $3); | error = { NSerror: $$ = NIL; Serror: yyPerror("Malformed statement", PSTAT); } ; assign: variable ':' '=' expr = $$ = tree4(T_ASGN, lineof($2), $1, $4); ; /* * EXPRESSION */ expr: error = { NEerror: $$ = NIL; Eerror: yyPerror("Missing/malformed expression", PEXPR); } | expr relop expr %prec '<' = $$ = tree4($2, $1[1] == SAWCON ? $3[1] : $1[1], $1, $3); | '+' expr %prec UNARYSIGN = $$ = tree3(T_PLUS, $2[1], $2); | '-' expr %prec UNARYSIGN = $$ = tree3(T_MINUS, $2[1], $2); | expr addop expr %prec '+' = $$ = tree4($2, $1[1] == SAWCON ? $3[1] : $1[1], $1, $3); | expr(( divop expr %prec '*' = $$ = tree4($2, $1[1] == SAWCON ? $3[1] : $1[1], $1, $3); | YNIL = $$ = tree2(T_NIL, NOCON); | YSTRING = $$ = tree3(T_STRNG, SAWCON, $1); | YINT = $$ = tree3(T_INT, NOCON, $1); | YBINT = $$ = tree3(T_BINT, NOCON, $1); | YNUMB = $$ = tree3(T_FINT, NOCON, $1); | variable | YID error = goto NEerror; | func_id '(' wexpr_list ')' = $$ = tree4(T_FCALL, NOCON, $1, fixlist($3)); | '(' expr ')' = $$ = $2; | negop expr %prec YNOT = $$ = tree3(T_NOT, NOCON, $2); | '[' element_list ']' = $$ = tree3(T_CSET, SAWCON, fixlist($2)); | '[' ']' = $$ = tree3(T_CSET, SAWCON, NIL); ; element_list: element = $$ = newlist($1); | element_list ',' element = $$ = addlist($1, $3); ; element: expr | expr YDOTDOT expr = $$ = tree3(T_RANG, $1, $3); ; /* * QUALIFIED VARIABLES */ variable: YID = { @ return (identis(var, VAR)); $$ = setupvar($1, NIL); } | qual_var = $1[3] = fixlist($1[3]); ; qual_var: array_id '[' expr_list ']' = $$ = setupvar($1, tree2(T_ARY, fixlist($3))); | qual_var '[' expr_list ']' = $1[3] = addlist($1[3], tree2(T_ARY, fixlist($3))); | record_id '.' field_id = $$ = setupvar($1, tree3(T_FIELD, $3, NIL)); | qual_var '.' field_id = $1[3] = addlist($1[3], tree3(T_FIELD, $3, NIL)); | ptr_id '^' = $$ = setupvar($1, tree1(T_PTR)); | qual_var '^' = $1[3] = addlist($1[3], tree1(T_PTR)); ; /* * Expression with write widths */ wexpr: expr | expr ':' expr = $$ = tree4(T_WEXP, $1, $3, NIL); | expr ':' expr ':' expr = $$ = tree4(T_WEXP, $1, $3, $5); | expr octhex = $$ = tree4(T_WEXP, $1, NIL, $2); | expr ':' expr octhex = $$ = tree4(T_WEXP, $1, $3, $4); ; octhex: YOCT = $$ = OCT; | YHEX = $$ = HEX; ; expr_list: expr = $$ = newlist($1); | expr_list ',' expr = $$ = addlist($1, $3); ; wexpr_list: wexpr = $$ = newlist($1); | wexpr_list ',' wexpr = $$ = addlist($1, $3); ; /* * OPERATORS */ relop: '=' = $$ = T_EQ; | '<' = $$ = T_LT; | '>' = $$ = T_GT; | '<' '>' = $$ = T_NE; | '<' '=' = $$ = T_LE; | '>' '=' = $$ = T_GE; | YIN = $$ = T_IN; ; addop: '+' = $$ = T_ADD; | '-' = $$ = T_SUB; | YOR = $$ = T_OR; | '|' = $$ = T_OR; ; divop: '*' = $$ = T_MULT; | '/' = $$ = T_DIVD; | YDIV = $$ = T_DIV; | YMOD = $$ = T_MOD; | YAND = $$ = T_AND; | '&' = $$ = T_AND; ; negop: YNOT | '~' ; /* * LISTS */ var_list: variable = $$ = newlist($1); | var_list ',' variable = $$ = addlist($1, $3); ; id_list: YID = $$ = newlist($1); | id_list ',' YID = $$ = addlist($1, $3); ; /* * Identifier productions with semantic restrictions * * For these productions, the character @ signifies * that the associated C statement is to provide * the semantic restriction for this reduction. * These lines are made into a procedure yyEactr, similar to * yyactr, which determines whether the corresponding reduction * is permitted, or whether an error is to be signaled. * A zero return from yyEactr is considered an error. * YyEactr is called with an argument "var" giving the string * name of the variable in question, essentially $1, although * $1 will not work because yyEactr is called from loccor in * the recovery routines. */ const_id: YID = @ return (identis(var, CONST)); ; type_id: YID = { @ return (identis(var, TYPE)); $$ = tree3(T_TYID, lineof(yyline), $1); } ; var_id: YID = @ return (identis(var, VAR)); ; array_id: YID = @ return (identis(var, ARRAY)); ; ptr_id: YID = @ return (identis(var, PTRFILE)); ; record_id: YID = @ return (identis(var, RECORD)); ; field_id: YID = @ return (identis(var, FIELD)); ; proc_id: YID = @ return (identis(var, PROC)); ; func_id: YID = @ return (identis(var, FUNC)); ; identis(var, CONST)); ; type_id: YID = { @ return (identis(var, TYPE)); $$ = tree3(T_TYID, lineof(yyline), $1); } ; var_id: YID = @ return (identis(var, VAR)); ; array_id: YID = @ return (identis(varcmd/pxp/pmon.c 444 0 33 13215 2552606516 6551 static char *sccsid = "@(#)pmon.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 January 1979 */ #include "0.h" /* * Profile counter processing cluster * * This file contains all routines which do the hard work in profiling. * * The first group of routines (getit, getpmon, getcore, and pmread) * deal with extracting data from the pmon.out and (with more difficulty) * core files. * * The routines cnttab and prttab collect counters for * and print the summary table respectively. * * The routines "*cnt*" deal with manipulation of counters, * especially the "current" counter px. */ STATIC struct pxcnt px; /* * Table to record info * for procedure/function summary */ STATIC struct pftab { long pfcnt; short pfline; char *pfname; short pflev; } *zpf; /* * Global variables */ STATIC long *zbuf; /* Count buffer */ STATIC short zcnt; /* Number of counts */ STATIC short zpfcnt; /* Number of proc/funcs's */ STATIC short gcountr; /* Unique name generator */ STATIC short zfil; /* I/o unit for count data reads */ STATIC short lastpf; /* Total # of procs and funcs for consistency chk */ getit(fp) register char *fp; { if (core) getcore(fp); else getpmon(fp); } /* * Setup monitor data buffer from pmon.out * style file whose name is fp. */ getpmon(fp) char *fp; { register char *cp; short garbage; zfil = open(fp, 0); if (zfil < 0) { perror(fp); pexit(NOSTART); } if (pmread() < 0 || read(zfil, &garbage, 1) == 1) { Perror(fp, "Bad format for pmon.out style file"); exit(1); } close(zfil); return; } STATIC char nospcm[] "Not enough memory for count buffers\n"; pmnospac() { write(2, nospcm, sizeof nospcm); pexit(NOSTART); } /* * Structure of the first few * items of a px core dump. */ STATIC struct info { char *off; /* Self-reference for pure text */ short type; /* 0 = non-pure text, 1 = pure text */ char *bp; /* Core address of pxps struct */ } inf; /* * First few words of the px * information structure. */ STATIC struct pxps { char *buf; short cnt; } pxp; getcore(fp) char *fp; { write(2, "-c: option not supported\n", sizeof("-c: option not supported\n")); pexit(ERRS); /* short pm; zfil = open(fp, 0); if (zfil < 0) { perror(fp); pexit(NOSTART); } if (lseek(zfil, 02000, 0) < 0) goto format; if (read(zfil, &inf, sizeof inf) < 0) goto format; if (inf.type != 0 && inf.type != 1) goto format; if (inf.type) inf.bp =- inf.off; if (lseek(zfil, inf.bp + 02000, 0) < 0) goto format; if (read(zfil, &pxp, sizeof pxp) != sizeof pxp) goto format; if (pxp.buf == NIL) { Perror(fp, "No profile data in file"); exit(1); } if (inf.type) pxp.buf =- inf.off; if (lseek(zfil, pxp.buf + 02000, 0) < 0) goto format; if (pmread() < 0) goto format; close(zfil); return; format: Perror(fp, "Not a Pascal system core file"); exit(1); */ } pmread() { register i; register char *cp; struct { long no; long tim; long cntrs; long rtns; } zmagic; if (read(zfil, &zmagic, sizeof zmagic) != sizeof zmagic) return (-1); if (zmagic.no != 0426) return (-1); ptvec = zmagic.tim; zcnt = zmagic.cntrs; zpfcnt = zmagic.rtns; cp = zbuf = alloc(i = (zcnt + 1) * sizeof *zbuf); if (cp == -1) pmnospac(); cp = zpf = alloc(zpfcnt * sizeof *zpf); if (cp == -1) pmnospac(); i -= sizeof(zmagic); if (read(zfil, zbuf + (sizeof(zmagic) / sizeof(zbuf)), i) != i) return (-1); zbuf++; return (0); } cnttab(s, no) char *s; short no; { register struct pftab *pp; lastpf++; if (table == 0) return; if (no == zpfcnt) cPANIC(); pp = &zpf[no]; pp->pfname = s; pp->pfline = line; pp->pfcnt = nowcnt(); pp->pflev = cbn; } prttab() { register i, j; register struct pftab *zpfp; if (profile == 0 && table == 0) return; if (cnts != zcnt || lastpf != zpfcnt) cPANIC(); if (table == 0) return; if (profile) printf("\f\n"); header(); printf("\n\tLine\t Count\n\n"); zpfp = zpf; for (i = 0; i < zpfcnt; i++) { printf("\t%4d\t%8ld\t", zpfp->pfline, zpfp->pfcnt); if (!justify) for (j = zpfp->pflev * unit; j > 1; j--) putchar(' '); printf("%s\n", zpfp->pfname); zpfp++; } } nowcntr() { return (px.counter); } long nowcnt() { return (px.ntimes); } long cntof(pxc) struct pxcnt *pxc; { if (profile == 0 && table == 0) return; return (pxc->ntimes); } setcnt(l) long l; { if (profile == 0 && table == 0) return; px.counter = --gcountr; px.ntimes = l; px.gos = gocnt; px.printed = 0; } savecnt(pxc) register struct pxcnt *pxc; { if (profile == 0 && table == 0) return; pxc->ntimes = px.ntimes; pxc->counter = px.counter; pxc->gos = px.gos; pxc->printed = 1; } rescnt(pxc) register struct pxcnt *pxc; { if (profile == 0 && table == 0) return; px.ntimes = pxc->ntimes; px.counter = pxc->counter; px.gos = gocnt; px.printed = pxc->printed; return (gocnt != pxc->gos); } getcnt() { if (profile == 0 && table == 0) return; if (cnts == zcnt) cPANIC(); px.counter = cnts; px.ntimes = zbuf[cnts]; px.gos = gocnt; px.printed = 0; ++cnts; } unprint() { px.printed = 0; } /* * Control printing of '|' * when profiling. */ STATIC char nobar; baroff() { nobar = 1; } baron() { nobar = 0; } /* * Do we want cnt and/or '|' on this line ? * 1 = count and '|' * 0 = only '|' * -1 = spaces only */ shudpcnt() { register i; if (nobar) return (-1); i = px.printed; px.printed = 1; return (i == 0); } STATIC char mism[] "Program and counter data do not correspond\n"; cPANIC()(( { printf("cnts %d zcnt %d, lastpf %d zpfcnt %d\n", cnts, zcnt, lastpf, zpfcnt); flush(); write(2, mism, sizeof mism); pexit(ERRS); } STATIC char nobar; baroff() { nobar = 1; } baron() { nobar = 0; } /* * Do we want cnt and/or '|' on this line ? * 1 = count and '|' * 0 = only '|' * -1 = spaces only */ shudpcnt() { register i; if (nobar) return (-1); i = px.printed; px.printed = 1; return (i == 0); } STATIC char mism[] "Program and counter data do not correspond\n"; cPANIC()cmd/pxp/pp.c 444 0 33 7466 2552606516 6212 static char *sccsid = "@(#)pp.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 January 1979 */ #include "0.h" #define noprint() nopflg int pplev[3]; /* STAT, DECL, PRFN */ int nopflg; setprint() { if (profile == 0) { if (table) nopflg = 1; else nopflg = 0; return; } nopflg = !all && nowcnt() == 0 || !opt('z'); } printon() { if (profile == 0) { if (table) nopflg = 1; return; } nopflg = 0; } printoff() { nopflg = 1; } ppkw(s) register char *s; { register char *cp, i; if (noprint()) return; /* * First real thing printed * is always a keyword * or includes an "id" (if a comment) * (See ppnl below) */ hadsome = 1; if (underline) { for (cp = s; *cp; cp++) putchar('_'); for (cp = s; *cp; cp++) putchar('\b'); } printf(s); } ppid(s) register char *s; { if (noprint()) return; hadsome = 1; if (s == NIL) s = "{identifier}"; printf(s); } ppbra(s) char *s; { if (noprint()) return; if (s != NIL) printf(s); } ppsep(s) char *s; { if (noprint()) return; printf(s); } ppket(s) char *s; { if (noprint()) return; if (s != NIL) printf(s); } char killsp; ppunspac() { killsp = 1; } ppspac() { if (killsp) { killsp = 0; return; } if (noprint()) return; putchar(' '); } ppitem() { if (noprint()) return; ppnl(); indent(); } int owenl, owenlb; ppsnlb() { if (nopflg) return; owenlb++; } ppsnl() { if (nopflg) return; owenl++; } pppay() { while (owenl || owenlb) { putchar('\n'); if (owenlb) { putchar(' '); owenlb--; } else owenl--; } } ppnl() { if (noprint()) return; if (hadsome == 0) return; pppay(); putchar('\n'); } indent() { register i; if (noprint()) return; linopr(); if (profile == 0) { indent1(pplev[PRFN] + pplev[DECL] + pplev[STAT]); return; } indent1(pplev[PRFN] + pplev[STAT]); switch (i = shudpcnt()) { case 1: printf("%7.7ld.", nowcnt()); dashes('-'); putchar('|'); break; case 0: case -1: printf(" "); dashes(' '); putchar(i == 0 ? '|' : ' '); break; } indent1(pplev[DECL]); } dashes(c) char c; { register i; for (i = unit - 1; i != 0; i--) putchar(c); } indent1(in) int in; { register i; if (noprint()) return; i = in; if (profile == 0) while (i >= 8) { putchar('\t'); i =- 8; } while (i > 0) { putchar(' '); i--; } } linopr() { if (noprint()) return; if (profile) { if (line < 0) line = -line; printf("%6d ", line); } } indentlab() { indent1(pplev[PRFN]); } ppop(s) char *s; { if (noprint()) return; printf(s); } ppnumb(s) char *s; { if (noprint()) return; if (s == NIL) s = "{number}"; printf(s); } ppgoin(lv) { pplev[lv] =+ unit; } ppgoout(lv) { pplev[lv] =- unit; if (pplev[lv] < 0) panic("pplev"); } ppstr(s) char *s; { register char *cp; if (noprint()) return; if (s == NIL) { printf("{string}"); return; } putchar('\''); cp = s; while (*cp) { putchar(*cp); if (*cp == '\'') putchar('\''); cp++; } putchar('\''); } pplab(s) char *s; { if (noprint()) return; if (s == NIL) s = "{integer label}"; printf(s); } int outcol; putchar(c) char c; { putc(c, stdout); if (ferror(stdout)) outerr(); switch (c) { case '\n': outcol = 0; flush(); break; case '\t': outcol =+ 8; outcol =& ~07; break; case '\b': if (outcol) outcol--; break; default: outcol++; case '\f': break; } } flush() { fflush(stdout); if (ferror(stdout)) outerr(); } pptab() { register int i; if (noprint()) return; i = pplev[PRFN] + profile ? 44 + unit : 28; /* if (outcol > i + 8) { ppnl(); i =+ 8; } */ do putchar('\t'); while (outcol < i); } outerr() { perror(stdoutn); pexit(DIED); } '\n': outcol = 0; flush(); break; case '\t': outcol =+ 8; outcol =& ~07; break; case '\b': if (outcol) outcol--; break; default: outcol++; case '\f': break; }cmd/pxp/printf.c 444 0 33 1447 2552606516 7066 static char *sccsid = "@(#)printf.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ /* * 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; { while (adjust < 0) { if (*string=='-' && fillch=='0') { if (foo) fputc(*string++, foo); else putchar(*string++); count--; } if (foo) fputc(fillch, foo); else putchar(fillch); adjust++; } while (--count>=0) if (foo) fputc(*string++, foo); else putchar(*string++); while (adjust) { if (foo) fputc(fillch, foo); else putchar(fillch); adjust--; } } foo, fillch) register char *string; register int count; int adjust; register struct { int a[6]; } *foo; { while (adjust < 0) { if (*string=='-' && fillch=='0') { if (foo) fputc(*string++, foo); else cmd/pxp/proc.c 444 0 33 442 2552606516 6501 static char *sccsid = "@(#)proc.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 January 1979 */ #include "0.h" #include "tree.h" proc(r) int *r; { call(r[2], r[3]); } } } foo, fillch) register char *string; register int count; int adjust; register struct { int a[6]; } *foo; { while (adjust < 0/,5؇< /,"cmd/pxp/rec.c 444 0 33 3554 2552606516 6336 static char *sccsid = "@(#)rec.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 January 1979 */ #include "0.h" tyrec(r, p0) int *r, p0; { if (r != NIL) setinfo(r[1]); if (p0 == NIL) { ppgoin(DECL); ppnl(); indent(); ppkw("record"); ppspac(); } else { ppspac(); ppbra("("); } ppgoin(DECL); if (r) { field(r[2], r[3]); variant(r[3]); } if (r != NIL) setinfo(r[1]); putcml(); ppgoout(DECL); if (p0 == NIL) { ppnl(); indent(); ppkw("end"); ppgoout(DECL); } else { ppitem(); ppket(")"); } } field(r, v) int *r, *v; { register int *fp, *tp, *ip; fp = r; if (fp != NIL) for (;;) { tp = fp[1]; if (tp != NIL) { setline(tp[1]); ip = tp[2]; ppitem(); if (ip != NIL) for (;;) { ppid(ip[1]); ip = ip[2]; if (ip == NIL) break; ppsep(", "); } else ppid("{field id list}"); ppsep(":"); gtype(tp[3]); setinfo(tp[1]); putcm(); } fp = fp[2]; if (fp == NIL) break; ppsep(";"); } if (v != NIL && r != NIL) ppsep(";"); } variant(r) register int *r; { register int *v, *vc; if (r == NIL) return; setline(r[1]); ppitem(); ppkw("case"); v = r[2]; if (v != NIL) { ppspac(); ppid(v); ppsep(":"); } gtype(r[3]); ppspac(); ppkw("of"); for (vc = r[4]; vc != NIL;) { v = vc[1]; if (v == NIL) continue; ppgoin(DECL); setline(v[1]); ppnl(); indent(); ppbra(NIL); v = v[2]; if (v != NIL) { for (;;) { gconst(v[1]); v = v[2]; if (v == NIL) break; ppsep(", "); } } else ppid("{case label list}"); ppket(":"); v = vc[1]; tyrec(v[3], 1); setinfo(v[1]); putcml(); ppgoout(DECL); vc = vc[2]; if (vc == NIL) break; ppsep(";"); } setinfo(r[1]); putcm(); } ; ppspac(); ppkw("of"); for (vc = r[4]; vc != NIL;) { v = vc[1]; if (v == NIL) continue; ppgoin(DECL); setline(v[1]); ppnl(); inde((cmd/pxp/rval.c 444 0 33 4376 2552606517 6535 static char *sccsid = "@(#)rval.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 January 1979 */ #include "0.h" #include "tree.h" extern char *opnames[]; #define alph(c) ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) /* * Rvalue reformats an expression. * Par is a flag indicating that the expression * should be parenthesized if it is non-atomic. */ rvalue(r, par) register int *r; int par; { register int *al; register char *opname; if (r == NIL) { ppid("{expr}"); return; } if (r[0] <= T_IN) opname = opnames[r[0]]; switch (r[0]) { case T_BINT: case T_INT: case T_FINT: ppnumb(r[2]); if (r[0] == T_BINT) ppsep("b"); return; case T_NIL: ppkw("nil"); return; case T_FCALL: funccod(r); return; case T_VAR: lvalue(r); return; case T_CSET: cset(r); return; case T_STRNG: ppstr(r[2]); return; } if (par) ppbra("("); switch (r[0]) { default: panic("rval"); case T_PLUS: case T_MINUS: ppop(r[0] == T_PLUS ? "+" : "-"); al = r[2]; rvalue(r[2], prec(al) > prec(r) || full); break; case T_NOT: ppkw(opname); ppspac(); rvalue(r[2], 1); break; case T_EQ: case T_NE: case T_GE: case T_LE: case T_GT: case T_LT: al = r[2]; rvalue(al, prec(al) <= prec(r) || full); goto rest; case T_AND: case T_OR: case T_MULT: case T_ADD: case T_SUB: case T_DIVD: case T_MOD: case T_DIV: case T_IN: al = r[2]; rvalue(al, prec(al) < prec(r) || full); rest: ppspac(); if (alph(opname[0])) ppkw(opname); else ppop(opname); ppspac(); al = r[3]; rvalue(al, prec(al) <= prec(r) || full); break; } if (par) ppket(")"); } /* * Prec returns the precedence of an operator, * with larger numbers indicating stronger binding. * This is used to determine when parenthesization * is needed on subexpressions. */ prec(r) register int *r; { if (r == NIL) return; switch (r[0]) { case T_NOT: return (3); case T_MULT: case T_DIVD: case T_DIV: case T_MOD: case T_AND: return (2); case T_ADD: case T_SUB: case T_OR: case T_PLUS: case T_MINUS: return (1); default: return (0); } } ppket(")"); } /* * Prec returns the precedence of an operator, * with larger numbers indicating stronger binding. * This is used to determine when parenthesization * is needed on subexpressions. */ prec(r) register int *r; { if (r == NIL) returcmd/pxp/stat.c 444 0 33 7412 2552606517 6536 static char *sccsid = "@(#)stat.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 January 1979 */ #include "0.h" #include "tree.h" int cntstat; int cnts 3; statlist(r) int *r; { register int *sl; sl = r; if (sl != NIL) for (;;) { statement(sl[1]); sl = sl[2]; if (sl == NIL) break; ppsep(";"); } else statement(NIL); } statement(r) int *r; { register int *s; s = r; top: if (cntstat) { cntstat = 0; getcnt(); } if (s == NIL) { putcm(); ppitem(); ppid("null"); return; } if (s[0] == T_REPEAT) setinfo(s[1]); else setline(s[1]); if (s[0] == T_LABEL) { cntstat = 1; ppnl(); labeled(s[2]); statement(s[3]); return; } switch (s[0]) { default: panic("stat"); case T_PCALL: ppitem(); proc(s); break; case T_IF: case T_IFEL: ppnl(); indent(); ifop(s); break; case T_WHILE: ppnl(); indent(); whilop(s); break; case T_REPEAT: ppnl(); indent(); repop(s); break; case T_FORU: case T_FORD: ppnl(); indent(); forop(s); break; case T_BLOCK: ppnl(); indent(); ppstbl(s, DECL); break; case T_ASGN: ppitem(); asgnop(s); break; case T_GOTO: ppitem(); gotoop(s[2]); cntstat = 1; break; case T_CASE: ppnl(); indent(); caseop(s); break; case T_WITH: ppnl(); indent(); withop(s); break; case T_ASRT: ppitem(); asrtop(s); break; } setinfo(s[1]); putcm(); } withop(s) int *s; { register *p; ppkw("with"); ppspac(); p = s[2]; if (p != NIL) for (;;) { lvalue(p[1]); p = p[2]; if (p == NIL) break; ppsep(", "); } else ppid("{record variable list}"); ppstdo(s[3], DECL); } asgnop(r) int *r; { lvalue(r[2]); ppsep(" := "); rvalue(r[3], NIL); } forop(r) int *r; { struct pxcnt scnt; savecnt(&scnt); ppkw("for"); ppspac(); asgnop(r[2]); ppspac(); ppkw(r[0] == T_FORU ? "to" : "downto"); ppspac(); rvalue(r[3], NIL); getcnt(); ppstdo(r[4], STAT); if (rescnt(&scnt)) getcnt(); } ifop(r) int *r; { register *s; struct pxcnt scnt; ppkw("if"); ppspac(); rvalue(r[2], NIL); ppspac(); ppkw("then"); ppspac(); s = r[3]; savecnt(&scnt); getcnt(); if (s != NIL && s[0] == T_BLOCK) ppstbl1(s, STAT); else { ppgoin(STAT); statement(s); ppgoout(STAT); } if (r[0] == T_IFEL) { setcnt(cntof(&scnt)-nowcnt()); if (s == NIL || s[0] != T_BLOCK) { ppnl(); indent(); } else { ppstbl2(); ppspac(); } s = r[4]; ppkw("else"); unprint(); ppspac(); if (s == NIL) goto burp; if (s[0] == T_BLOCK) ppstbl1(s, STAT); else if (s[0] == T_IF || s[0] == T_IFEL) ifop(s); else { burp: ppgoin(STAT); statement(s); ppgoout(STAT); } } if (rescnt(&scnt)) getcnt(); if (r[4] != NIL) unprint(); if (s != NIL && s[0] == T_BLOCK) ppstbl2(); } whilop(r) int *r; { struct pxcnt scnt; ppkw("while"); ppspac(); rvalue(r[2], NIL); savecnt(&scnt); getcnt(); ppstdo(r[3], STAT); if (rescnt(&scnt)) getcnt(); } repop(r) int *r; { struct pxcnt scnt; ppkw("repeat"); ppgoin(STAT); savecnt(&scnt); getcnt(); statlist(r[2]); ppgoout(DECL); ppnl(); indent(); ppkw("until"); ppspac(); rvalue(r[3], NIL); ppgoin(DECL); ppgoout(STAT); if (rescnt(&scnt)) getcnt(); } ppstbl(r, m) int *r; { ppstbl1(r, m); ppstbl2(); } ppstbl1(r, m) int *r; { ppkw("begin"); ppgoin(m); statlist(r[2]); ppgoout(m); } ppstbl2() { ppnl(); indent(); ppkw("end"); } ppstdo(r, l) int *r; { register *s; ppspac(); ppkw("do"); ppspac(); s = r; if (s != NIL && s[0] == T_BLOCK) ppstbl(s, l); else { ppgoin(l); statement(s); ppgoout(l); } } asrtop(s) int *s; { ppkw("assert"); ppspac(); rvalue(s[2], NIL); } pgoin(DECL); ppgoout(STAT); if (rescnt(&scnt)) getcnt(); } ppstbl(r, m) int *r; { ppstbl1(r, m); ppstbl2(); } ppstbl1(r, m) int *r; { ppkw("begin"); ppgoin(m); statlist(r[2]); ppgoout(m); } ppstbl2() { ppnl(); indent(); ppkw("end"cmd/pxp/string.c 444 0 33 2011 2552606517 7057 static char *sccsid = "@(#)string.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 January 1979 */ #include "0.h" /* * STRING SPACE DECLARATIONS * * Strng is the base of the current * string space and strngp the * base of the free area therein. * No array of descriptors is needed * as string space is never freed. */ STATIC char strings[STRINC]; STATIC char *strng strings; STATIC char *strngp strings; /* initstring() { } */ /* * Copy a string into the string area. */ savestr(cp) register char *cp; { register int i; i = strlen(cp) + 1; if (strngp + i >= strng + STRINC) { strngp = alloc(STRINC); if (strngp == -1) { yerror("Ran out of memory (string)"); pexit(DIED); } strng = strngp; } strcpy(strngp, cp); cp = strngp; strngp = cp + i; return (cp); } esavestr(cp) char *cp; { strngp = (int)(strngp + (sizeof (int) - 1)) &~ (sizeof (int) - 1); return (savestr(cp)); } strings; /* initstring() { } */ /* * Copy a string into the string area. */ savestr(cp) register char *cp; { register int i; i = strlen(cp) + 1; if (strngp + i >= strng + STRINC) { strngp = alloc(STRINC); if (strngp == -1) { yerror("Ran out of memory (string)"); pexit(DIED); } strng = strngp; } strcpy(strngp, cp); cp = strngp; strngp = cp + i; return (cp); } esavestr(cp) char *cp; { strngp = (int)(strngp + (sizeof (int) - 1)) &~ (sizeof (int) - 1); return (savestrcmd/pxp/subr.c 444 0 33 4137 2552606517 6537 ((static char *sccsid = "@(#)subr.c 1.2 (Berkeley) 3/5/81"; /* Copyright (c) 1979 Regents of the University of California */ /* * pi - Pascal interpreter code translator * * Charles Haley, Bill Joy UCB * Version 1.2 January 1979 * * * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 January 1979 */ #include "0.h" #ifndef PI1 /* * Does the string fp end in '.' and the character c ? */ dotted(fp, c) register char *fp; char c; { register int i; i = strlen(fp); return (i > 1 && fp[i - 2] == '.' && fp[i - 1] == c); } /* * Toggle the option c. */ togopt(c) char c; { register char *tp; tp = &opts[c-'a']; *tp = 1 - *tp; } /* * Set the time vector "tvec" to the * modification time stamp of the current file. */ #include #include gettime() { struct stat stb; stat(filename, &stb); tvec = stb.st_mtime; } /* * Convert a "ctime" into a Pascal styple time line */ myctime(tv) long *tv; { register char *cp, *dp; char *cpp; register i; static char mycbuf[26]; cpp = ctime(tv); dp = mycbuf; cp = cpp; cpp[16] = 0; while (*dp++ = *cp++); dp--; cp = cpp+19; cpp[24] = 0; while (*dp++ = *cp++); return (mycbuf); } /* * Is "fp" in the command line list of names ? */ inpflist(fp) char *fp; { register i, *pfp; pfp = pflist; for (i = pflstc; i > 0; i--) if (strcmp(fp, *pfp++) == 0) return (1); return (0); } #endif /* * Boom! */ Perror(file, error) char *file, *error; { fprintf( stderr , "%s: %s\n" , file , error ); } char * alloc(size) int size; { return (calloc(size, 1)); } copy(to, from, bytes) register char *to, *from; register int bytes; { if (bytes != 0) do *to++ = *from++; while (--bytes); } /* * Is ch one of the characters in the string cp ? */ any(cp, ch) register char *cp; char ch; { while (*cp) if (*cp++ == ch) return (1); return (0); } opush(c) register CHAR c; { c =- 'a'; optstk[c] =<< 1; optstk[c] =| opts[c]; opts[c] = 1; #ifdef PI0 send(ROPUSH, c); #endif } opop(c) register CHAR c; { c =- 'a'; opts[c] = optstk[c] & 1; optstk[c] =>> 1; #ifdef PI0 send(ROPOP, c); #endif } m; register int bytes; { if (bytes != 0) do *to++ = *from++; while (--bytes); } /* * Is ch one of the characters in the string cp ? */ any(cp, ch) register char *cp; char ch; { while (*cp) if (*cp++ == ch) return (1); return (0); } opush(c) register CHAR c; { c =- 'a'; optstk[c] =<< 1; optstk[c] =| opts[c]; opts[c] = 1; #ifdef PI0 send(ROPUSH, c); #endif } opop(c) register CHAR c; cmd/pxp/tree.c 444 0 33 7122 2552606517 6520 static char *sccsid = "@(#)tree.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pi - Pascal interpreter code translator * * Charles Haley, Bill Joy UCB * Version 1.1 February 1978 * * * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.1 February 1978 */ #include "0.h" /* * TREE SPACE DECLARATIONS */ struct tr { int *tr_low; int *tr_high; } ttab[MAXTREE], *tract; /* * The variable space is the * absolute base of the tree segments. * (exactly the same as ttab[0].tr_low) * Spacep is maintained to point at the * beginning of the next tree slot to * be allocated for use by the grammar. * Spacep is used "extern" by the semantic * actions in pas.y. * The variable tract is maintained to point * at the tree segment out of which we are * allocating (the active segment). */ int *space, *spacep; /* * TREENMAX is the maximum width * in words that any tree node * due to the way in which the parser uses * the pointer spacep. */ #define TREENMAX 6 int trspace[ITREE]; int *space = trspace; int *spacep = trspace; struct tr *tract = ttab; /* * Inittree allocates the first tree slot * and sets up the first segment descriptor. * A lot of this work is actually done statically * above. */ inittree() { ttab[0].tr_low = space; ttab[0].tr_high = &space[ITREE]; } /* * Tree builds the nodes in the * parse tree. It is rarely called * directly, rather calls are made * to tree[12345] which supplies the * first argument to save space in * the code. Tree also guarantees * that spacep points to the beginning * of the next slot it will return, * a property required by the parser * which was always true before we * segmented the tree space. */ int *tree(cnt, a) int cnt; { register int *p, *q; register int i; i = cnt; p = spacep; q = &a; do *p++ = *q++; while (--i); q = spacep; spacep = p; if (p+TREENMAX >= tract->tr_high) /* * this peek-ahead should * save a great number of calls * to tralloc. */ tralloc(TREENMAX); return (q); } /* * Tralloc preallocates enough * space in the tree to allow * the grammar to use the variable * spacep, as it did before the * tree was segmented. */ tralloc(howmuch) { register char *cp; register i; if (spacep + howmuch >= tract->tr_high) { i = TRINC; cp = malloc(i * sizeof ( int )); if (cp == -1) { yerror("Ran out of memory (tralloc)"); pexit(DIED); } spacep = cp; tract++; if (tract >= &ttab[MAXTREE]) { yerror("Ran out of tree tables"); pexit(DIED); } tract->tr_low = cp; tract->tr_high = tract->tr_low+i; } } extern int yylacnt; extern bottled; #ifdef PXP #endif /* * Free up the tree segments * at the end of a block. * If there is scanner lookahead, * i.e. if yylacnt != 0 or there is bottled output, then we * cannot free the tree space. * This happens only when errors * occur and the forward move extends * across "units". */ trfree() { if (yylacnt != 0 || bottled != NIL) return; #ifdef PXP if (needtree()) return; #endif spacep = space; while (tract->tr_low > spacep || tract->tr_high <= spacep) { free(tract->tr_low); tract->tr_low = NIL; tract->tr_high = NIL; tract--; if (tract < ttab) panic("ttab"); } #ifdef PXP packtree(); #endif } /* * Copystr copies a token from * the "token" buffer into the * tree space. */ copystr(token) register char *token; { register char *cp; register int i; i = (strlen(token) + sizeof ( int )) & ~( ( sizeof ( int ) ) - 1 ); tralloc(i / sizeof ( int )); strcpy(spacep, token); cp = spacep; spacep = cp + i; tralloc(TREENMAX); return (cp); } { free(tract->tr_low); tract->tr_low = NIL; tract->tr_high = NIL; tract--; if (tract < ttab) panic("ttab"); } #ifdef PXP packtree(); #endif } /* * Copystr copies a token from * the "token" buffer into the * tree space. */ copystr(token) register char *token; { register char *cp; register int i; i = (strlen(token) + sizeof ( int )) & ~( ( sizeof ( int ) ) - 1 ); tralloc(i / sizeof ( int )); strcpy(spcmd/pxp/tree.h 444 0 33 3074 2552606517 6527 /* static char *sccsid = "@(#)tree.h 1.1 (Berkeley) 3/2/81";*/ /* Copyright (c) 1979 Regents of the University of California */ #define T_MINUS 1 #define T_MOD 2 #define T_DIV 3 #define T_DIVD 4 #define T_MULT 5 #define T_ADD 6 #define T_SUB 7 #define T_EQ 8 #define T_NE 9 #define T_LT 10 #define T_GT 11 #define T_LE 12 #define T_GE 13 #define T_NOT 14 #define T_AND 15 #define T_OR 16 #define T_ASGN 17 #define T_PLUS 18 #define T_IN 19 #define T_LISTPP 20 #define T_PDEC 21 #define T_FDEC 22 #define T_PVAL 23 #define T_PVAR 24 #define T_PFUNC 25 #define T_PPROC 26 #define T_NIL 27 #define T_STRNG 28 #define T_CSTRNG 29 #define T_PLUSC 30 #define T_MINUSC 31 #define T_ID 32 #define T_INT 33 #define T_FINT 34 #define T_CINT 35 #define T_CFINT 36 #define T_TYPTR 37 #define T_TYPACK 38 #define T_TYSCAL 39 #define T_TYRANG 40 #define T_TYARY 41 #define T_TYFILE 42 #define T_TYSET 43 #define T_TYREC 44 #define T_TYFIELD 45 #define T_TYVARPT 46 #define T_TYVARNT 47 #define T_CSTAT 48 #define T_BLOCK 49 #define T_BSTL 50 #define T_LABEL 51 #define T_PCALL 52 #define T_FCALL 53 #define T_CASE 54 #define T_WITH 55 #define T_WHILE 56 #define T_REPEAT 57 #define T_FORU 58 #define T_FORD 59 #define T_GOTO 60 #define T_IF 61 #define T_ASRT 62 #define T_CSET 63 #define T_RANG 64 #define T_VAR 65 #define T_ARGL 66 #define T_ARY 67 #define T_FIELD 68 #define T_PTR 69 #define T_WEXP 70 #define T_PROG 71 #define T_BINT 72 #define T_CBINT 73 #define T_IFEL 74 #define T_IFX 75 #define T_TYID 76 #define T_COPSTR 77 #define T_BOTTLE 78 #define T_RFIELD 79 #define T_FLDLST 80 #define T_LAST 81 #define T_CASE 54 #define T_WITH 55 #define T_WHILE 56 #define T_REPEAT 57 #define T_FORU 58 #define T_FORD 59 #define T_GOTO 60 #define T_IF 61 #define T_ASRT 62 #define T_CSET 63 #define T_RANG 64 #define T_VAR 65 #define T_ARGL 66 #define T_ARY 67 #define T_FIELD 68 #define T_PTR 69 #define T_WEXP 70 #define T_PROG 71 #define T_BINT 72 #define T_CBINT 73 #define T_IFEL 74 #define T_IFX 75 #define T_TYID 76 #define T_COPSTR 77 #define T_BOTTLE 7cmd/pxp/treen.c 444 0 33 1320 2552606520 6662 ((static char *sccsid = "@(#)treen.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ /* * is there some reason why these aren't #defined? */ tree1 ( arg1 ) int arg1; { tree ( 1 , arg1 ); } tree2 ( arg1 , arg2 ) int arg1 , arg2; { tree ( 2 , arg1 , arg2 ); } tree3 ( arg1 , arg2 , arg3 ) int arg1 , arg2 , arg3; { tree ( 3 , arg1 , arg2 , arg3 ); } tree4 ( arg1 , arg2 , arg3 , arg4 ) int arg1 , arg2 , arg3 , arg4; { tree ( 4 , arg1 , arg2 , arg3 , arg4 ); } tree5 ( arg1 , arg2 , arg3 , arg4 , arg5 ) int arg1 , arg2 , arg3 , arg4 , arg5; { tree ( 5 , arg1 , arg2 , arg3 , arg4 , arg5 ); } ) int arg1; { tree ( 1 , arg1 ); } tree2 ( arg1 , arg2 ) int arg1 , arg2; { tree ( 2 , arg1 , arg2 ); } tree3 ( arg1 , arg2 , arg3 ) int arg1 , arg2 , arg3; { tree ( 3 , arg1 , arg2 , arg3 ); } tree4 ( arg1 , arg2 , arg3 , arg4 ) int arg1 , arg2 , arg3 ,cmd/pxp/treen.s 444 0 33 705 2552606520 6670 .text / static char *sccsid = "@(#)treen.s 1.1 (Berkeley) 3/2/81"; / / Routines to save space on tree calls / .globl _tree, _tree1, _tree2, _tree3, _tree4, _tree5 / _tree1: mov (sp),trret mov $1,(sp) br 1f _tree2: mov (sp),trret mov $2,(sp) br 1f _tree3: mov (sp),trret mov $3,(sp) br 1f _tree4: mov (sp),trret mov $4,(sp) br 1f _tree5: mov (sp),trret mov $5,(sp) 1: mov $1f,-(sp) jmp _tree 1: tst (sp)+ jmp *trret .bss trret: . = .+2 5h< /,"cmd/pxp/type.c 444 0 33 4773 2552606520 6545 static char *sccsid = "@(#)type.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 January 1979 */ #include "0.h" #include "tree.h" STATIC int typecnt -1; /* * Type declaration part */ typebeg(l, tline) int l, tline; { line = l; if (nodecl) printoff(); puthedr(); putcm(); ppnl(); indent(); ppkw("type"); ppgoin(DECL); typecnt = 0; setline(tline); } type(tline, tid, tdecl) int tline; char *tid; int *tdecl; { if (typecnt) putcm(); setline(tline); ppitem(); ppid(tid); ppsep(" ="); gtype(tdecl); ppsep(";"); setinfo(tline); putcml(); typecnt++; } typeend() { if (typecnt == -1) return; if (typecnt == 0) ppid("{type decls}"); ppgoout(DECL); typecnt = -1; } /* * A single type declaration */ gtype(r) register int *r; { if (r == NIL) { ppid("{type}"); return; } if (r[0] != T_ID && r[0] != T_TYPACK) setline(r[1]); switch (r[0]) { default: panic("type"); case T_ID: ppspac(); ppid(r[1]); return; case T_TYID: ppspac(); ppid(r[2]); break; case T_TYSCAL: ppspac(); tyscal(r); break; case T_TYRANG: ppspac(); tyrang(r); break; case T_TYPTR: ppspac(); ppop("^"); gtype(r[2]); break; case T_TYPACK: ppspac(); ppkw("packed"); gtype(r[2]); break; case T_TYARY: ppspac(); tyary(r); break; case T_TYREC: ppspac(); tyrec(r[2], NIL); break; case T_TYFILE: ppspac(); ppkw("file"); ppspac(); ppkw("of"); gtype(r[2]); break; case T_TYSET: ppspac(); ppkw("set"); ppspac(); ppkw("of"); gtype(r[2]); break; } setline(r[1]); putcml(); } /* * Scalar type declaration */ tyscal(r) register int *r; { register int i; ppsep("("); r = r[2]; if (r != NIL) { i = 0; ppgoin(DECL); for (;;) { ppid(r[1]); r = r[2]; if (r == NIL) break; ppsep(", "); i++; if (i == 7) { ppitem(); i = 0; } } ppgoout(DECL); } else ppid("{constant list}"); ppsep(")"); } /* * Subrange type declaration */ tyrang(r) register int *r; { gconst(r[2]); ppsep(".."); gconst(r[3]); } /* * Array type declaration */ tyary(r) register int *r; { register int *tl; ppkw("array"); ppspac(); ppsep("["); tl = r[2]; if (tl != NIL) { ppunspac(); for (;;) { gtype(tl[1]); tl = tl[2]; if (tl == NIL) break; ppsep(","); } } else ppid("{subscr list}"); ppsep("]"); ppspac(); ppkw("of"); gtype(r[3]); } ; } cmd/pxp/var.c 444 0 33 1677 2552606521 6355 static char *sccsid = "@(#)var.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 January 1979 */ #include "0.h" #include "tree.h" STATIC int varcnt -1; /* * Var declaration part */ varbeg(l, vline) int l, vline; { line = l; if (nodecl) printoff(); puthedr(); putcm(); ppnl(); indent(); ppkw("var"); ppgoin(DECL); varcnt = 0; setline(vline); } var(vline, vidl, vtype) int vline; register int *vidl; int *vtype; { if (varcnt) putcm(); setline(vline); ppitem(); if (vidl != NIL) for (;;) { ppid(vidl[1]); vidl = vidl[2]; if (vidl == NIL) break; ppsep(", "); } else ppid("{identifier list}"); ppsep(":"); gtype(vtype); ppsep(";"); setinfo(vline); putcml(); varcnt++; } varend() { if (varcnt == -1) return; if (varcnt == 0) ppid("{variable decls}"); ppgoout(DECL); varcnt = -1; } arcnt = 0; setline(vline); } var(vline, vidl, vtype) int vlinecmd/pxp/whoami 444 0 33 115 2552606521 6572 /* static char *sccsid = "@(#)whoami 1.1 (Berkeley) 3/2/81";*/ #define PXP 1 ); ppitem(); if (vidl != NIL) for (;;) { ppid(vidl[1]); vidl = vidl[2]; if (vidl == NIL) break; ppsep(", "); } else ppid("{identifier list}"); ppsep(":"); gtype(vtype); ppsep(";"); setinfo(vline); putcml(); varcnt++; } varend() { if (varcnt == -1) return; if (varcnt == 0) ppid("{variable decls}"); ppgo/,5< /,"cmd/pxp/y.tab.c 444 0 33 57557 2552606522 6633 static char *sccsid = "@(#)y.tab.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ #include "0.h" #include "yy.h" #include "tree.h" #ifdef PI #define lineof(l) l #define line2of(l) l #endif extern yyerrflag; int *yyval 0; int *yypv; yyactr(__np__){ register int **yyYpv; register int *p, *q; yyYpv = yypv; switch(__np__){ case 1: funcend(yyYpv[1], yyYpv[4], lineof(yyYpv[5])); break; case 2: yyval = funcbody(funchdr(tree5(T_PROG, lineof(yyYpv[1]), yyYpv[2], fixlist(yyYpv[4]), NIL))); break; case 3: { yyPerror("Malformed program statement", PPROG); /* * Should make a program statement * with "input" and "output" here. */ yyval = funcbody(funchdr(tree5(T_PROG, lineof(yyYpv[1]), NIL, NIL, NIL))); } break; case 4: { yyval = tree3(T_BSTL, lineof(yyYpv[1]), fixlist(yyYpv[2])); if (yyYpv[3] < 0) brerror(yyYpv[1], "begin"); } break; case 5: trfree(); break; case 6: { Derror: constend(), typeend(), varend(), trfree(); yyPerror("Malformed declaration", PDECL); } break; case 7: trfree(); break; case 9: constend(); break; case 10: typeend(); break; case 11: varend(); break; case 12: label(fixlist(yyYpv[2]), lineof(yyYpv[1])); break; case 13: yyval = newlist(yyYpv[1] == NIL ? NIL : *hash(yyYpv[1], 1)); break; case 14: yyval = addlist(yyYpv[1], yyYpv[3] == NIL ? NIL : *hash(yyYpv[3], 1)); break; case 15: constbeg(yyYpv[1], line2of(yyYpv[2])), const(lineof(yyYpv[3]), yyYpv[2], yyYpv[4]); break; case 16: const(lineof(yyYpv[3]), yyYpv[2], yyYpv[4]); break; case 17: { constbeg(yyYpv[1], line2of(yyYpv[1])); Cerror: yyPerror("Malformed const declaration", PDECL); } break; case 18: goto Cerror; break; case 19: typebeg(yyYpv[1], line2of(yyYpv[2])), type(lineof(yyYpv[3]), yyYpv[2], yyYpv[4]); break; case 20: type(lineof(yyYpv[3]), yyYpv[2], yyYpv[4]); break; case 21: { typebeg(yyYpv[1], line2of(yyYpv[1])); Terror: yyPerror("Malformed type declaration", PDECL); } break; case 22: goto Terror; break; case 23: varbeg(yyYpv[1]((, line2of(yyYpv[3])), var(lineof(yyYpv[3]), fixlist(yyYpv[2]), yyYpv[4]); break; case 24: var(lineof(yyYpv[3]), fixlist(yyYpv[2]), yyYpv[4]); break; case 25: { varbeg(yyYpv[1], line2of(yyYpv[1])); Verror: yyPerror("Malformed var declaration", PDECL); } break; case 26: goto Verror; break; case 28: trfree(); break; case 29: funcfwd(yyYpv[1]); break; case 30: funcend(yyYpv[1], yyYpv[4], lineof(yyYpv[5])); break; case 31: funcbody(yyYpv[1]); break; case 32: yyval = funchdr(tree5(yyYpv[1], lineof(yyYpv[5]), yyYpv[2], yyYpv[3], yyYpv[4])); break; case 33: yyval = T_PDEC; break; case 34: yyval = T_FDEC; break; case 35: yyval = fixlist(yyYpv[2]); break; case 36: yyval = NIL; break; case 37: yyval = tree3(T_PVAL, fixlist(yyYpv[1]), yyYpv[3]); break; case 38: yyval = tree3(T_PVAR, fixlist(yyYpv[2]), yyYpv[4]); break; case 39: yyval = tree3(T_PFUNC, fixlist(yyYpv[2]), yyYpv[4]); break; case 40: yyval = tree2(T_PPROC, fixlist(yyYpv[2])); break; case 41: yyval = yyYpv[2]; break; case 42: yyval = NIL; break; case 43: yyval = newlist(yyYpv[1]); break; case 44: yyval = addlist(yyYpv[1], yyYpv[3]); break; case 45: yyval = tree2(T_CSTRNG, yyYpv[1]); break; case 47: yyval = tree2(T_PLUSC, yyYpv[2]); break; case 48: yyval = tree2(T_MINUSC, yyYpv[2]); break; case 49: yyval = tree2(T_ID, yyYpv[1]); break; case 50: yyval = tree2(T_CINT, yyYpv[1]); break; case 51: yyval = tree2(T_CBINT, yyYpv[1]); break; case 52: yyval = tree2(T_CFINT, yyYpv[1]); break; case 53: yyval = newlist(yyYpv[1]); break; case 54: yyval = addlist(yyYpv[1], yyYpv[3]); break; case 56: yyval = tree3(T_TYPTR, lineof(yyYpv[1]), tree2(T_ID, yyYpv[2])); break; case 58: yyval = tree3(T_TYPACK, lineof(yyYpv[1]), yyYpv[2]); break; case 60: yyval = tree3(T_TYSCAL, lineof(yyYpv[1]), fixlist(yyYpv[2])); break; case 61: yyval = tree4(T_TYRANG, lineof(yyYpv[2]), yyYpv[1], yyYpv[3]); break; case 62: yyval = tree4(T_TYARY, lineof(yyYpv[1]), fixlist(yyYpv[3]), yyYpv[6]); break; case 63: yyval = tree3(T_TYFILE, lineof(yyYpv[1]), yyYpv[3]); break; case 64: yyval = tree3(T_TYSET, lineof(yyYpv[1]), yyYpv[3]); break; case 65: { yyval = tree3(T_TYREC, lineof(yyYpv[1]), yyYpv[2]); if (yyYpv[3] < 0) brerror(yyYpv[1], "record"); } break; case 66: yyval = newlist(yyYpv[1]); break; case 67: yyval = addlist(yyYpv[1], yyYpv[3]); break; case 68: yyval = tree4(T_FLDLST, lineof(NIL), fixlist(yyYpv[1]), yyYpv[2]); break; case 69: yyval = newlist(yyYpv[1]); break; case 70: yyval = addlist(yyYpv[1], yyYpv[3]); break; case 71: yyPerror("Malformed record declaration", PDECL); break; case 72: yyval = NIL; break; case 73: yyval = tree4(T_RFIELD, lineof(yyYpv[2]), fixlist(yyYpv[1]), yyYpv[3]); break; case 74: yyval = NIL; break; case 75: yyval = tree5(T_TYVARPT, lineof(yyYpv[1]), NIL, yyYpv[2], fixlist(yyYpv[4])); break; case 76: yyval = tree5(T_TYVARPT, lineof(yyYpv[1]), yyYpv[2], yyYpv[4], fixlist(yyYpv[6])); break; case 77: yyval = newlist(yyYpv[1]); break; case 78: yyval = addlist(yyYpv[1], yyYpv[3]); break; case 79: yyPerror("Malformed record declaration", PDECL); break; case 80: yyval = NIL; break; case 81: yyval = tree4(T_TYVARNT, lineof(yyYpv[2]), fixlist(yyYpv[1]), yyYpv[4]); break; case 82: yyval = tree4(T_TYVARNT, lineof(yyYpv[2]), fixlist(yyYpv[1]), NIL); break; case 83: yyval = newlist(yyYpv[1]); break; case 84: { if ((p = yyYpv[1]) != NIL && (q = p[1])[0] == T_IFX) { q[0] = T_IFEL; q[4] = yyYpv[2]; } else yyval = addlist(yyYpv[1], yyYpv[2]); } break; case 85: if ((q = yyYpv[1]) != NIL && (p = q[1]) != NIL && p[0] == T_IF) { if (yychar < 0) yychar = yylex(); if (yyshifts >= 2 && yychar == YELSE) { recovered(); copy(&Y, &OY, sizeof Y); yerror("Deleted ';' before keyword else"); yychar = yylex(); p[0] = T_IFX; } } break; case 86: yyval = newlist(yyYpv[1]); break; case 87: yyval = addlist(yyYpv[1], yyYpv[3]); break; case 88: { yyval = NIL; Kerror: yyPerror("Malformed statement in case", PSTAT); } break; case 89: goto Kerror; break; case 90: yyval = tree4(T_CSTAT, lineof(yyYpv[2]), fixlist(yyYpv[1]), yyYpv[3]); break; case 91: yyval = tree4(T_CSTAT, lineof(yyYpv[1]), NIL, yyYpv[2]); break; case 92: yyval = NIL; break; case 93: yyval = NIL; break; case 94: yyval = tree4(T_LABEL, lineof(yyYpv[2]), yyYpv[1] == NIL ? NIL : *hash(yyYpv[1], 1), yyYpv[3]); break; case 95: yyval = tree4(T_PCALL, lineof(yyline), yyYpv[1], NIL); break; case 96: yyval = tree4(T_PCALL, lineof(yyYpv[2]), yyYpv[1], fixlist(yyYpv[3])); break; case 97: goto NSerror; break; case 99: { yyval = tree3(T_BLOCK, lineof(yyYpv[1]), fixlist(yyYpv[2])); if (yyYpv[3] < 0) brerror(yyYpv[1], "begin"); } break; case 100: { yyval = tree4(T_CASE, lineof(yyYpv[1]), yyYpv[2], fixlist(yyYpv[4])); if (yyYpv[5] < 0) brerror(yyYpv[1], "case"); } break; case 101: yyval = tree4(T_WITH, lineof(yyYpv[1]), fixlist(yyYpv[2]), yyYpv[4]); break; case 102: yyval = tree4(T_WHILE, lineof(yyYpv[1]), yyYpv[2], yyYpv[4]); break; case 103: yyval = tree4(T_REPEAT, lineof(yyYpv[3]), fixlist(yyYpv[2]), yyYpv[4]); break; case 104: yyval = tree5(T_FORU, lineof(yyYpv[1]), yyYpv[2], yyYpv[4], yyYpv[6]); break; case 105: yyval = tree5(T_FORD, lineof(yyYpv[1]), yyYpv[2], yyYpv[4], yyYpv[6]); break; case 106: yyval = tree3(T_GOTO, lineof(yyYpv[1]), *hash(yyYpv[2], 1)); break; case 107: yyval = tree5(T_IF, lineof(yyYpv[1]), yyYpv[2], yyYpv[4], NIL); break; case 108: yyval = tree5(T_IFEL, lineof(yyYpv[1]), yyYpv[2], yyYpv[4], yyYpv[6]); break; case 109: yyval = tree5(T_IFEL, lineof(yyYpv[1]), yyYpv[2], yyYpv[4], NIL); break; case 110: yyval = tree3(T_ASRT, lineof(yyYpv[1]), yyYpv[3]); break; case 111: { NSerror: yyval = NIL; Serror: yyPerror("Malformed statement", PSTAT); } break; case 112: yyval = tree4(T_ASGN, lineof(yyYpv[2]), yyYpv[1], yyYpv[4]); break; case 113: { NEerror: yyval = NIL; Eerror: yyPerror("Missing/malformed expression", PEXPR); } break; case 114: yyval = tree4(yyYpv[2], yyYpv[1][1] == SAWCON ? yyYpv[3][1] : yyYpv[1][1], yyYpv[1], yyYpv[3]); break; case 115: yyval = tree3(T_PLUS, yyYpv[2][1], yyYpv[2]); break; case 116: yyval = tree3(T_MINUS, yyYpv[2][1], yyYpv[2]); break; case 117: yyval = tree4(yyYpv[2], yyYpv[1][1] == SAWCON ? yyYpv[3][1] : yyYpv[1][1], yyYpv[1], yyYpv[3]); break; case 118: yyval = tree4(yyYpv[2], yyYpv[1][1] == SAWCON ? yyYpv[3][1] : yyYpv[1][1], yyYpv[1], yyYpv[3]); break; case 119: yyval = tree2(T_NIL, NOCON); break; case 120: yyval = tree3(T_STRNG, SAWCON, yyYpv[1]); break; case 121: yyval = tree3(T_INT, NOCON, yyYpv[1]); break; case 122: yyval = tree3(T_BINT, NOCON, yyYpv[1]); break; case 123: yyval = tree3(T_FINT, NOCON, yyYpv[1]); break; case 125: goto NEerror; break; case 126: yyval = tree4(T_FCALL, NOCON, yyYpv[1], fixlist(yyYpv[3])); break; case 127: yyval = yyYpv[2]; break; case 128: yyval = tree3(T_NOT, NOCON, yyYpv[2]); break; case 129: yyval = tree3(T_CSET, SAWCON, fixlist(yyYpv[2])); break; case 130: yyval = tree3(T_CSET, SAWCON, NIL); break; case 131: yyval = newlist(yyYpv[1]); break; case 132: yyval = addlist(yyYpv[1], yyYpv[3]); break; case 134: yyval = tree3(T_RANG, yyYpv[1], yyYpv[3]); break; case 135: { yyval = setupvar(yyYpv[1], NIL); } break; case 136: yyYpv[1][3] = fixlist(yyYpv[1][3]); break; case 137: yyval = setupvar(yyYpv[1], tree2(T_ARY, fixlist(yyYpv[3]))); break; case 138: yyYpv[1][3] = addlist(yyYpv[1][3], tree2(T_ARY, fixlist(yyYpv[3]))); break; case 139: yyval = setupvar(yyYpv[1], tree3(T_FIELD, yyYpv[3], NIL)); break; case 140: yyYpv[1][3] = addlist(yyYpv[1][3], tree3(T_FIELD, yyYpv[3], NIL)); break; case 141: yyval = setupvar(yyYpv[1], tree1(T_PTR)); break; case 142: yyYpv[1][3] = addlist(yyYpv[1][3], tree1(T_PTR)); break; case 144: yyval = tree4(T_WEXP, yyYpv[1], yyYpv[3], NIL); break; case 145: yyval = tree4(T_WEXP, yyYpv[1], yyYpv[3], yyYpv[5]); break; case 146: yyval = tree4(T_WEXP, yyYpv[1], NIL, yyYpv[2]); break; case 147: yyval = tree4(T_WEXP, yyYpv[1], yyYpv[3], yyYpv[4]); break; case 148: yyval = OCT; break; case 149: yyval = HEX; break; case 150: yyval = newlist(yyYpv[1]); break; case 151: yyval = addlist(yyYpv[1], yyYpv[3]); break; case 152: yyval = newlist(yyYpv[1]); break; case 153: yyval = addlist(yyYpv[1], yyYpv[3]); break; case 154: yyval = T_EQ; break; case 155: yyval = T_LT; break; case 156: yyval = T_GT; break; case 157: yyval = T_NE; break; case 158: yyval = T_LE; break; case 159: yyval = T_GE; break; case 160: yyval = T_IN; break; case 161: yyval = T_ADD; break; case 162: yyval = T_SUB; break; case 163: yyval = T_OR; break; case 164: yyval = T_OR; break; case 165: yyval = T_MULT; break; case 166: yyval = T_DIVD; break; case 167: yyval = T_DIV; break; case 168: yyval = T_MOD; break; case 169: yyval = T_AND; break; case 170: yyval = T_AND; break; case 173: yyval = newlist(yyYpv[1]); break; case 174: yyval = addlist(yyYpv[1], yyYpv[3]); break; case 175: yyval = newlist(yyYpv[1]); break; case 176: yyval = addlist(yyYpv[1], yyYpv[3]); break; case 178: { yyval = tree3(T_TYID, lineof(yyline), yyYpv[1]); } break; } } int yyact[] {0,-286,8195,4096,0,16384,4096,12295,-256,8198 ,-273,8197,4096,-256,8201,-259,12315,-261,8207,-271 ,12315,-277,8206,-285,12315,-293,8208,-295,8209,4096 ,-40,8210,4096,12291,-259,8213,-271,8218,-285,8217 ,4096,12293,12294,12296,-256,8220,-259,12297,-261,12297 ,-271,12297,-273,8219,-277,12297,-285,12297,-293,12297 ,-295,12297,4096,-256,8222,-259,12298,-261,12298,-271 ,12298,-273,8221,-277,12298,-285,12298,-293,12298,-295 ,12298,4096,-256,8224,-259,12299,-261,12299,-271,12299 ,-273,8225,-277,12299,-285,12299,-293,12299,-295,12299 ,4096,-276,8227,4096,-256,8229,-273,8228,4096,-256 ,8231,-273,8230,4096,-256,8233,-273,8225,4096,-273 ,8225,4096,-46,8235,4096,12316,-256,8252,-259,8243 ,-260,8244,-267,12381,-269,8248,-272,8249,-273,8241 ,-274,8250,-276,8239,-288,8247,-296,8246,-297,8245 ,-301,8251,-59,12381,4096,-270,8258,12319,-273,8260 ,4096,12321,12322,-61,8261,4096,12306,-61,8262,4096 ,12310,-44,8264,-58,8263,4096,12314,12463,-59,8265 ,-44,8266,4096,12301,-61,8267,4096,12305,-61,8268 ,4096,12309,-44,8264,-58,8269,4096,12313,-41,8270 ,-44,8264,4096,12289,-267,8271,-59,8272,4096,12371 ,-256,8252,-259,8243,-260,8244,-267,12381,-269,8248 ,-272,8249,-273((,8241,-274,8250,-276,8239,-288,8247 ,-294,12381,-296,8246,-297,8245,-301,8251,-59,12381 ,4096,-58,8274,4096,-40,8275,12383,-256,8276,-266 ,12472,-267,12472,-294,12472,-46,12470,-40,12472,-59 ,12472,-58,12423,-94,12469,-91,12468,4096,12386,-256 ,8279,-273,8288,-276,8284,-279,8293,-280,8286,-284 ,8282,-290,8283,-298,8285,-43,8280,-45,8281,-40 ,8290,-91,8292,-126,8294,4096,-273,8297,4096,-273 ,8297,4096,-276,8301,4096,-40,8303,4096,12399,-58 ,8304,4096,-46,8306,-94,8307,-91,8305,12424,-91 ,8308,4096,-46,8309,4096,-94,8310,4096,-59,8311 ,4096,-256,8201,-259,12315,-261,8207,-271,12315,-277 ,8206,-285,12315,-293,8208,-295,8209,4096,-40,8314 ,12324,-273,8324,-276,8321,-280,8323,-290,8316,-298 ,8322,-43,8318,-45,8319,4096,-258,8333,-268,8334 ,-273,8337,-276,8321,-280,8323,-283,8329,-287,8336 ,-289,8335,-290,8316,-298,8322,-43,8318,-45,8319 ,-40,8331,-94,8327,4096,-273,8339,4096,12300,-276 ,8340,4096,-59,8344,4096,12292,12373,12372,-256,8279 ,-273,8288,-276,8284,-279,8293,-280,8286,-284,8282 ,-290,8283,-298,8285,-43,8280,-45,8281,-40,8290 ,-91,8292,-126,8294,4096,12385,-267,8349,-59,8272 ,4096,-257,8366,-262,8364,-275,8357,-278,8365,-281 ,8350,-282,8360,-60,8355,-61,8354,-62,8356,-43 ,8358,-45,8359,-124,8361,-42,8362,-47,8363,-38 ,8367,4096,12401,12407,12408,12409,12410,12411,12412,-256 ,8370,-257,12423,-262,12423,-263,12423,-264,12423,-265 ,12423,-266,12423,-267,12423,-275,12423,-278,12423,-281 ,12423,-282,12423,-291,12423,-292,12423,-294,12423,-299 ,12423,-300,12423,-60,12423,-61,12423,-62,12423,-43 ,12423,-45,12423,-124,12423,-42,12423,-47,12423,-38 ,12423,-46,12470,-40,12473,-41,12423,-59,12423,-44 ,12423,-58,12423,-94,12469,-91,12468,-93,12423,4096 ,-40,8371,4096,-256,8279,-273,8288,-276,8284,-279 ,8293,-280,8286,-284,8282,-290,8283,-298,8285,-43 ,8280,-45,8281,-40,8290,-91,8292,-93,8375,-126 ,8294,4096,12459,12460,-263,8378,-44,8379,4096,12461 ,-46,12470,-94,12469,-91,12468,12423,-257,8366,-262 ,8364,-263,8380,-275,8357,-278,8365,-282,8360,-60 ,8355,-61,8354,-62,8356,-43,8358,-45,8359,-124 ,8361,-42,8362,-47,8363,-38,8367,4096,-294,8381 ,-59,8272,4096,-265,8382,-292,8383,4096,12394,-257 ,8366,-262,8364,-275,8357,-278,8365,-282,8360,-291 ,8384,-60,8355,-61,8354,-62,8356,-43,8358,-45 ,8359,-124,8361,-42,8362,-47,8363,-38,8367,4096 ,-61,8386,4096,-256,8279,-273,8288,-276,8284,-279 ,8293,-280,8286,-284,8282,-290,8283,-298,8285,-43 ,8280,-45,8281,-40,8290,-91,8292,-126,8294,4096 ,-273,8390,4096,12430,12429,12317,-259,8213,-271,8218 ,-285,8217,4096,-58,8395,12330,-271,8400,-273,8225 ,-285,8401,-295,8399,4096,-59,8402,4096,12333,12334 ,-273,8324,-276,8321,-280,8323,-298,8322,4096,12337 ,12338,12339,12340,12465,-59,8405,4096,12343,-273,8406 ,4096,12345,-258,8333,-268,8334,-287,8336,-289,8335 ,4096,12347,-264,8409,4096,-91,8410,4096,-281,8411 ,4096,-281,8412,4096,-273,8225,12360,-264,12465,12466 ,-59,8417,4096,12464,12302,-59,8418,4096,-59,8419 ,4096,-59,8420,4096,12290,12382,-41,8421,-44,8422 ,4096,12440,-257,8366,-262,8364,-275,8357,-278,8365 ,-282,8360,-299,8425,-300,8426,-60,8355,-61,8354 ,-62,8356,-43,8358,-45,8359,-124,8361,-42,8362 ,-47,8363,-38,8367,-58,8423,12431,12387,-256,8429 ,-267,12380,-273,8324,-276,8321,-280,8323,-290,8316 ,-298,8322,-302,8431,-43,8318,-45,8319,-59,12380 ,4096,12442,-61,8437,-62,8436,12443,-61,8438,12444 ,12448,12449,12450,12451,12452,12453,12454,12455,12456,12457 ,12458,-257,8366,-262,8364,-278,8365,-42,8362,-47 ,8363,-38,8367,12403,-257,8366,-262,8364,-278,8365 ,-42,8362,-47,8363,-38,8367,12404,12413,-257,8366 ,-262,8364,-275,8357,-278,8365,-282,8360,-60,8355 ,-61,8354,-62,8356,-43,8358,-45,8359,-124,8361 ,-42,8362,-47,8363,-38,8367,-41,8440,4096,12416 ,-44,8442,-93,8441,4096,12418,12419,-257,8366,-262 ,8364,-264,8443,-275,8357,-278,8365,-282,8360,-60 ,8355,-61,8354,-62,8356,-43,8358,-45,8359,-124 ,8361,-42,8362,-47,8363,-38,8367,12421,-273,8297 ,4096,-257,8366,-262,8364,-275,8357,-278,8365,-282 ,8360,-60,8355,-61,8354,-62,8356,-43,8358,-45 ,8359,-124,8361,-42,8362,-47,8363,-38,8367,-41 ,8451,4096,-44,8454,-93,8453,4096,-257,8366,-262 ,8364,-275,8357,-278,8365,-282,8360,-60,8355,-61 ,8354,-62,8356,-43,8358,-45,8359,-124,8361,-42 ,8362,-47,8363,-38,8367,12438,12428,12471,-44,8454 ,-93,8455,4096,12427,-59,8456,4096,-59,8457,4096 ,-41,8459,-59,8460,4096,12331,-44,8264,-58,8461 ,4096,12304,12335,12336,12308,12344,12346,-41,8465,-44 ,8264,4096,-273,8337,-276,8321,-280,8323,-290,8316 ,-298,8322,-43,8318,-45,8319,-40,8331,4096,-273 ,8337,-276,8321,-280,8323,-290,8316,-298,8322,-43 ,8318,-45,8319,-40,8331,4096,-267,8471,4096,-256 ,8474,-260,8475,-267,12362,-41,12362,-59,8473,4096 ,12357,-44,8264,-58,8476,4096,12312,12303,12307,12311 ,12384,-256,8279,-273,8288,-276,8284,-279,8293,-280 ,8286,-284,8282,-290,8283,-298,8285,-43,8280,-45 ,8281,-40,8290,-91,8292,-126,8294,4096,12434,12436 ,12437,-256,8480,-267,8481,-59,8479,4096,12374,12376 ,-44,8482,-58,8483,4096,12341,-257,8366,-262,8364 ,-275,4096,-278,8365,-282,8360,-60,4096,-61,4096 ,-62,4096,-43,8358,-45,8359,-124,8361,-42,8362 ,-47,8363,-38,8367,12402,-257,8366,-262,8364,-278 ,8365,-42,8362,-47,8363,-38,8367,12405,12406,12445 ,12446,12447,-41,8485,-44,8422,4096,12415,12417,-256 ,8279,-273,8288,-276,8284,-279,8293,-280,8286,-284 ,8282,-290,8283,-298,8285,-43,8280,-45,8281,-40 ,8290,-91,8292,-126,8294,4096,12389,12462,12390,-257 ,8366,-262,8364,-275,8357,-278,8365,-282,8360,-60 ,8355,-61,8354,-62,8356,-43,8358,-45,8359,-124 ,8361,-42,8362,-47,8363,-38,8367,12391,-257,8366 ,-262,8364,-263,8488,-275,8357,-278,8365,-282,8360 ,-60,8355,-61,8354,-62,8356,-43,8358,-45,8359 ,-124,8361,-42,8362,-47,8363,-38,8367,4096,-257 ,8366,-262,8364,-263,8489,-275,8357,-278,8365,-282 ,8360,-60,8355,-61,8354,-62,8356,-43,8358,-45 ,8359,-124,8361,-42,8362,-47,8363,-38,8367,4096 ,-266,8490,12395,12398,-257,8366,-262,8364,-275,8357 ,-278,8365,-282,8360,-60,8355,-61,8354,-62,8356 ,-43,8358,-45,8359,-124,8361,-42,8362,-47,8363 ,-38,8367,12400,12426,12425,12318,12320,12329,12323,-271 ,8400,-273,8225,-285,8401,-295,8399,4096,-44,8264 ,-58,8494,4096,-44,8264,-58,8495,4096,-44,8264 ,12328,12348,12349,-44,8497,-93,8496,4096,12354,12351 ,12352,12353,12356,-273,8225,12360,12359,-273,8500,4096 ,12441,-257,8366,-262,8364,-275,8357,-278,8365,-282 ,8360,-299,8425,-300,8426,-60,8355,-61,8354,-62 ,8356,-43,8358,-45,8359,-124,8361,-42,8362,-47 ,8363,-38,8367,-58,8502,12432,-273,8324,-276,8321 ,-280,8323,-290,8316,-298,8322,-302,8431,-43,8318 ,-45,8319,12380,12377,12388,12379,12414,12420,-257,8366 ,-262,8364,-275,8357,-278,8365,-282,8360,-60,8355 ,-61,8354,-62,8356,-43,8358,-45,8359,-124,8361 ,-42,8362,-47,8363,-38,8367,12422,-256,8252,-259 ,8243,-260,8244,-266,12381,-267,12381,-269,8248,-272 ,8249,-273,8241,-274,8250,-276,8239,-288,8247,-294 ,12381,-296,8246,-297,8245,-301,8251,-59,12381,4096 ,-257,8366,-262,8364,-275,8357,-278,8365,-282,8360 ,-60,8355,-61,8354,-62,8356,-43,8358,-45,8359 ,-124,8361,-42,8362,-47,8363,-38,8367,12439,12332 ,12325,-281,8512,4096,12358,-281,8514,4096,-58,8515 ,12466,12361,12435,12375,12342,12378,12392,12393,12396,12326 ,12327,12355,-273,8324,-276,8321,-280,8323,-290,8316 ,-298,8322,-43,8318,-45,8319,12368,-273,8522,4096 ,-257,8366,-262,8364,-275,8357,-278,8365,-282,8360 ,-60,8355,-61,8354,-62,8356,-43,8358,-45,8359 ,-124,8361,-42,8362,-47,8363,-38,8367,12433,12350 ,-256,8524,-267,12363,-41,12363,-59,8523,4096,12365 ,-44,8482,-58,8525,4096,-281,8526,4096,12466,-273 ,8324,-276,8321,-280,8323,-290,8316,-298,8322,-43 ,8318,-45,8319,12368,12367,-40,8528,4096,12366,-273 ,8225,-41,8531,12360,-256,8524,-267,12364,-41,12364 ,-59,8523,4096,-41,8532,4096,12370,12369,-1}; int yypact[] {0,1,4,7,8,13,30,33,34,41 ,42,43,44,63,82,101,104,109,114,119 ,122,125,126,155,7,158,161,162,163,166 ,167,170,171,176,177,178,183,184,187,188 ,191,192,197,198,203,204,209,210,241,244 ,247,268,126,269,296,269,126,299,302,269 ,305,308,309,312,319,322,325,328,331,348 ,351,366,366,395,398,399,351,366,366,402 ,405,406,407,210,408,435,436,441,472,269 ,269,473,474,475,476,477,478,479,550,269 ,269,553,582,583,584,589,590,597,628,633 ,638,639,269,670,673,700,703,673,700,704 ,705,706,713,716,725,728,729,730,730,739 ,740,741,742,743,744,747,748,751,752,761 ,119,762,765,768,771,774,777,780,783,784 ,785,788,791,794,795,796,801,802,837,838 ,269,269,269,861,862,867,870,871,872,873 ,874,875,876,877,878,879,880,881,894,907 ,408,908,939,940,945,946,947,210,978,210 ,269,269,269,210,981,269,1012,1017,1046,1047 ,1048,1053,1054,1057,366,1060,1065,1066,119,119 ,119,1071,1072,1073,1074,1075,1076,1077,351,1082 ,366,1099,1116,1119,1130,1131,1136,1137,1138,1139 ,1140,1141,269,1168,1169,1170,1171,1178,1179,1180 ,210,1185,1186,1215,1228,1229,1230,1231,1232,1237 ,1238,1239,269,1266,1267,1268,1269,1298,1329,1360 ,1363,1364,1393,269,1394,1395,1396,1397,1398,1399 ,366,1408,1413,1418,1421,1422,1423,1428,1429,1430 ,1431,1432,1433,1436,1437,366,1440,1441,1476,1493 ,1494,351,210,1495,1496,1497,1498,210,210,1527 ,1560,1589,1590,366,366,1591,1099,1594,1595,1598 ,1601,269,1602,1603,1604,1605,1606,1607,1608,1609 ,1610,366,1611,1612,1627,1630,1659,1660,1669,1670 ,1675,1678,1679,1694,1695,1612,1698,1699,1704,1713 ,1716,1717,-1}; int yyr1[] {0,1,2,2,5,3,3,3,8,8 ,8,8,9,13,13,10,10,10,10,11 ,11,11,11,12,12,12,12,4,4,16 ,16,18,17,19,19,20,20,23,23,23 ,23,21,21,22,22,14,14,14,14,24 ,24,24,24,26,26,15,15,15,15,27 ,27,27,28,28,28,28,30,30,31,32 ,32,32,34,34,33,33,33,35,35,35 ,36,36,36,7,7,38,39,39,39,39 ,40,40,40,37,37,37,37,37,37,37 ,37,37,37,37,37,37,37,37,37,37 ,37,37,43,44,44,44,44,44,44,44 ,44,44,44,44,44,44,44,44,44,44 ,44,52,52,53,53,46,46,54,54,54 ,54,54,54,60,60,60,60,60,61,61 ,56,56,42,42,47,47,47,47,47,47 ,47,48,48,48,48,49,49,49,49,49 ,49,51,51,45,45,6,6,25,29,62 ,55,59,57,58,41,50,-1}; int yyr2[] {0,5,6,2,3,2,2,0,1,1 ,1,1,3,1,3,5,5,2,2,5 ,5,2,2,5,5,2,2,0,2,3 ,5,1,5,1,1,3,0,3,4,4 ,2,2,0,1,3,1,1,2,2,1 ,1,1,1,1,3,1,2,1,2,1 ,3,3,6,3,3,3,1,3,2,1 ,3,2,0,3,0,4,6,1,3,2 ,0,5,4,1,2,2,1,3,1,2 ,3,2,0,0,3,1,4,2,1,3 ,5,4,4,4,6,6,2,4,6,5 ,4,1,4,1,3,2,2,3,3,1 ,1,1,1,1,1,2,4,3,2,3 ,2,1,3,1,3,1,1,4,4,3 ,3,2,2,1,3,5,2,4,1,1 ,1,3,1,3,1,1,1,2,2,2 ,1,1,1,1,1,1,1,1,1,1 ,1,1,1,1,3,1,3,1,1,1 ,1,1,1,1,1,1,-1}; int yygo[] {0,-1,1,-1,2,23,67,-1,4,67 ,120,-1,7,120,201,-1,19,13,31,17 ,40,18,42,122,206,139,216,207,270,208 ,271,209,272,268,206,-1,224,51,85,55 ,107,-1,44,-1,8,-1,10,-1,11,((-1 ,12,-1,13,-1,34,69,123,75,149,158 ,240,217,274,287,240,290,313,322,240,331 ,240,334,240,-1,140,71,146,76,150,77 ,151,203,266,219,277,269,301,284,309,302 ,318,303,319,320,325,-1,133,-1,20,-1 ,22,-1,23,-1,24,-1,121,-1,202,-1 ,204,268,300,-1,205,126,211,127,212,-1 ,125,-1,128,158,238,287,238,-1,328,218 ,276,220,278,305,321,-1,134,137,215,-1 ,136,283,307,323,329,-1,138,-1,275,336 ,338,-1,221,-1,222,-1,280,281,306,-1 ,223,334,337,-1,326,331,335,-1,327,46 ,81,82,153,186,252,188,254,192,258,239 ,292,291,314,296,315,297,316,298,317,-1 ,45,-1,46,-1,235,287,312,-1,236,-1 ,48,179,247,-1,154,56,108,-1,50,52 ,86,54,106,58,110,88,176,89,177,98 ,180,99,181,100,185,111,193,113,196,116 ,196,159,241,160,242,161,243,189,255,190 ,256,191,257,194,260,231,286,250,185,251 ,295,262,299,310,324,-1,156,-1,103,21 ,61,46,61,51,61,53,104,55,61,56 ,61,82,61,186,61,187,253,188,61,192 ,61,239,61,291,61,296,61,297,61,298 ,61,-1,95,-1,159,-1,160,-1,161,-1 ,97,-1,99,-1,182,250,294,-1,184,-1 ,62,-1,63,116,199,-1,195,-1,64,117 ,200,-1,197,-1,65,230,285,-1,155,286 ,311,-1,232,-1,-1,-1}; int yypgo[] {0,1,3,5,9,13,17,37,43,45 ,47,49,51,53,55,75,97,99,101,103 ,105,107,109,111,115,121,123,129,137,141 ,147,149,153,155,157,161,165,169,191,193 ,195,199,201,205,209,257,259,293,295,297 ,299,301,303,305,309,311,313,317,319,323 ,325,329,333,-1}; yyEactr(__np__, var) int __np__; char *var; { switch(__np__) { default: return (1); case 177: return (identis(var, CONST)); break; case 179: return (identis(var, VAR)); break; case 180: return (identis(var, ARRAY)); break; case 181: return (identis(var, PTRFILE)); break; case 182: return (identis(var, RECORD)); break; case 183: return (identis(var, FIELD)); break; case 184: return (identis(var, PROC)); break; case 185: return (identis(var, FUNC)); break; case 135: { return (identis(var, VAR)); } break; case 178: { return (identis(var, TYPE)); } break; } } ault: return (1); case 177: return (identis(var, CONST)); break; case 179: return (identis(var, VAR)); break; case 180: return (identis(var, Acmd/pxp/y.tab.h 444 0 33 2345 2552606522 6601 /* static char *sccsid = "@(#)y.tab.h 1.1 (Berkeley) 3/2/81";*/ /* Copyright (c) 1979 Regents of the University of California */ # # define YAND 257 # define YARRAY 258 # define YBEGIN 259 # define YCASE 260 # define YCONST 261 # define YDIV 262 # define YDO 263 # define YDOTDOT 264 # define YTO 265 # define YELSE 266 # define YEND 267 # define YFILE 268 # define YFOR 269 # define YFORWARD 270 # define YFUNCTION 271 # define YGOTO 272 # define YID 273 # define YIF 274 # define YIN 275 # define YINT 276 # define YLABEL 277 # define YMOD 278 # define YNOT 279 # define YNUMB 280 # define YOF 281 # define YOR 282 # define YPACKED 283 # define YNIL 284 # define YPROCEDURE 285 # define YPROG 286 # define YRECORD 287 # define YREPEAT 288 # define YSET 289 # define YSTRING 290 # define YTHEN 291 # define YDOWNTO 292 # define YTYPE 293 # define YUNTIL 294 # define YVAR 295 # define YWHILE 296 # define YWITH 297 # define YBINT 298 # define YOCT 299 # define YHEX 300 # define YASSERT 301 # define YCASELAB 302 # define YILLCH 303 # define YLAST 304 # define UNARYSIGN 305 /* * GLOBALS FOR ACTIONS */ /* * The following line marks the end of the yacc * Constant definitions which are removed from * y.tab.c and placed in the file y.tab.h. */ # define YSET 289 # define YSTRING 290 # define YTHEN 291 # define YDOWNTO 292 # define YTYPE 293 # define YUNTIL 294 # define YVAR 295 # define YWHILE 296 # define YWITH 297 # define YBINT 298 # define YOCT 299 # define YHEX 300 # define YASSERT 301 # define YCASELAB 302 # define Ycmd/pxp/yy.h 444 0 33 15360 2552606522 6246 /* static char *sccsid = "@(#)yy.h 1.1 (Berkeley) 3/2/81";*/ /* Copyright (c) 1979 Regents of the University of California */ # /* * pi - Pascal interpreter code translator * * Charles Haley, Bill Joy UCB * Version 1.1 February 1978 * * * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.1 February 1978 */ #include "y.tab.h" /* * INPUT/OUTPUT */ /* * The buffer for the input file is normally "ibuf". * When files are included, however, this may be * pushed down in the stack of currently active * files. For this reason, the pointer ibp always * references the i/o buffer of the current input file. */ FILE *ibuf, *ibp; /* * Line and token buffers. Charbuf is the character buffer for * input lines, token the buffer for tokens returned * by the scanner. CBSIZE defines the maximum line * length allowed on input and is doubtless too small. * The token buffer should be a local array in yylex. */ #define CBSIZE 161 char charbuf[CBSIZE], *bufp, token[CBSIZE]; #define digit(c) (c >= '0' && c <= '9') #define alph(c) ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) /* * Flag to prevent reprinting current line after * an error. */ char yyprtd; /* * The following variables are maintained by * the scanner in the file lex and used in scanning * and in parsing. * * The variable yychar is the current scanner character. * Currently, the scanner must be called as * yychar = yylex() * even though it should set yychar itself. * Yychar has value YEOF at end of file, and negative value if * there is no yychar, e.g. after a shift in the parser. * * The variable yycol is the current column in the line whose number * is given by yyline. Yyecol and yyeline give the position for an * error message to flag, usually the start of an input token. * Yylval is the semantic return from the scanner. * * In fact all of these variables are "per token". * In the usual case, only the copies in the scanner token structure * 'Y' are used, and the #defines below serve to make them look * like variables. * * For the purposes of the error recovery, however, they are copied * and restored quite freely. For the error recovery also, the * file name which the input line this token is on and the seek * pointer of this line in its source file are saved as yyefile * and yyseekp. The global variable yylinpt is the seek pointer * of the current input line. */ int yycol; int yyline; int yyseqid; int yysavc; int yylinpt; /* *** NOTE *** * It would be much better to not have the Yyeline and Yyefile * in the scanner structure and to have a mechanism for mapping * seqid's to these globally. */ struct yytok { int Yychar; int Yylval; int Yyecol; int Yyeline; int Yyseekp; char *Yyefile; int Yyeseqid; } Y, OY; #define yychar Y.Yychar #define yylval Y.Yylval #define yyecol Y.Yyecol #define yyeline Y.Yyeline #define yyseekp Y.Yyseekp #define yyefile Y.Yyefile #define yyeseqid Y.Yyeseqid /* * Yyval is the semantic value returned by a reduction. * It is what "$$" is expanded to by yacc. */ int *Ps, *yyval; /* * N is the length of a reduction. * Used externally by "lineof" to get the left and * right margins for a reduction. */ int N; /* * Definitions for looking up keywords. * The keyword array is called yykey, and * lastkey points at the end of it. */ char *lastkey; struct kwtab { char *kw_str; int kw_val; } yykey[]; /* * ERROR RECOVERY EXTERNALS */ #define CLIMIT 40 /* see yyrecover.c */ char *tokname(); char *charname(); char *classes[]; /* * Tokens which yacc doesn't define */ #define YEOF 0 #define ERROR 256 /* * Limit on the number of syntax errors */ #define MAXSYNERR 100 /* * Big costs */ #define HUGE 50 #define INFINITY 100 /* * Kinds of panics */ #define PDECL 0 #define PSTAT 1 #define PEXPR 2 #define PPROG 3 #define yyresume() yyResume = 1; char yyResume; char dquote; char errout; /* * Yyidwant and yyidhave are the namelist classes * of identifiers associated with a identifier reduce * error, set before the recovery is called. * Since they may be set again during the forward move * they must be saved by yyrecover, which uses them in printing * error messages. */ int yyidhave, yyidwant; /* * The variables yy*shifts are used to prevent looping and the printing * of spurious messages in the parser. Yyshifts gives the number of * true input shifts since the last corrective action. YyOshifts * is the value of yyshifts before it was last cleared, and is used * by yyPerror in yypanic.c to suppress messages. * * Yytshifts counts true input shifts. It is used to prevent looping * inserting unique symbols. If yytshifts == yyTshifts (local to * yyrecover.c) then there has been no shift over true input since * the last unique symbol insertion. We refuse, in this case, * to insert more unique symbols so as to prevent looping. * * The recovery cannot loop because it guarantees the progress of the * parse, i.e.: * * 1) Any insertion guarantees to shift over 2 symbols, a replacement * over one symbol. * * 2) Unique symbol insertions are limited to one for each true * symbol of input, or "safe" insertion of the keywords "end" * and "until" at zero cost (safe since these are know to match * stack that cannot have been generated - e.g. "begin" or "repeat") * * 3) We never panic more than once from a given state without * shifting over input, i.e. we force the parse stack to shrink * after each unsuccessful panic. */ int yyshifts, yyOshifts; unsigned yytshifts; #ifdef PXP /* * Identifier class definitions *((/ #define UNDEF 0 #define CONST 1 #define TYPE 2 #define VAR 3 #define ARRAY 4 #define PTRFILE 5 #define RECORD 6 #define FIELD 7 #define PROC 8 #define FUNC 9 #define FVAR 10 #define REF 11 #define PTR 12 #define FILET 13 #define SET 14 #define RANGE 15 #define LABEL 16 #define WITHPTR 17 #define SCAL 18 #define STR 19 #define PROG 20 #define IMPROPER 21 /* * COMMENT FORMATTING DEFINITIONS */ /* * Count of tokens on this input line * Note that this can be off if input is not syntactically correct. */ int yytokcnt; int yywhcnt; /* * Types of comments */ #define CLMARG 0 #define CALIGN 1 #define CTRAIL 2 #define CRMARG 3 #define CSRMARG 4 #define CNL 5 #define CNLBL 6 #define CFORM 7 #define CINCLUD 8 /* * Comment structure * Cmhp is the head of the current list of comments */ struct comment { struct comment *cmnext; int cmdelim; struct commline *cml; int cmjust; int cmseqid; } *cmhp; /* * Structure for holding a comment line */ struct commline { char *cmtext; int cmcol; /* Only used for first line of comment currently */ struct commline *cml; }; struct W { int Wseqid; int Wcol; } yyw[MAXDEPTH + 1], *yypw; #define commform() quickcomm(CFORM) #define commnl() quickcomm(CNL) #define commnlbl() quickcomm(CNLBL) #endif p is the head of the current list of comments */ struct comment { struct comment *cmnext; int cmdelim; struct commline *cml; int cmjust; int cmseqid; } *cmhp; /* * Structure for holding a comment line */ struct commline { char *cmtext; int cmcol; /* Only used fcmd/pxp/yycomm.c 444 0 33 21212 2552606522 7106 static char *sccsid = "@(#)yycomm.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 January 1979 */ #include "0.h" #include "yy.h" /* * COMMENT PROCESSING CLUSTER * * The global organization of this cluster is as follows. * While parsing the program information is saved in the tree which * tells the source text coordinates (sequence numbers and columns) * bounding each production. The comments from the source program * are also saved, with information about their source text position * and a classification as to their kind. * * When printing the reformatted program we flush out the comments * at various points using the information in the comments and the parse * tree to "resynchronize". A number of special cases are recognized to * deal with the vagarities of producing a true "fixed point" so that * a prettyprinted program will re-prettyprint to itself. */ /* * Save sequence id's and column markers bounding a production * for later use in placing comments. We save the sequence id * and column of the leftmost token and the following token, and * the sequence id of the last token in this reduction. * See putcm, putcml, and putcmp below for motivation. */ line2of(l) int l; { return (lineNof(l, 2)); } lineof(l) int l; { return (lineNof(l, 1)); } lineNof(l, i) int l, i; { return(tree(6, l, yypw[i].Wseqid, yypw[i].Wcol, yyseqid, yycol, yypw[N].Wseqid)); } /* * After a call to setline, Seqid is set to the sequence id * of the symbol which followed the reduction in which the * lineof call was embedded, Col to the associated column, * and LSeqid to the sequence id of the last symbol in the reduction * (Note that this is exact only if the last symbol was a terminal * this is always true when it matters.) */ int Seqid, Col, LSeqid; /* * Retrieve the information from a call to lineof before beginning the * output of a tree from a reduction. First flush to the left margin * of the production, and then set so that later calls to putcm, putcml * and putcmp will deal with the right margin of this comment. * * The routine setinfo is called when the lineof has no embedded line * number to avoid trashing the current "line". * * The routine setinfo is often called after completing the output of * the text of a tree to restore Seqid, Col, and LSeqid which may have * been destroyed by the nested processing calls to setline. * In this case the only effect of the call to setinfo is to * modify the above three variables as a side effect. * * We return a word giving information about the comments which were * actually put out. See putcm for details. */ setline(ip) int *ip; { line = ip[0]; return(setinfo(ip)); } setinfo(ip) register int *ip; { register int i; ip++; Seqid = *ip++; Col = *ip++; i = putcm(); Seqid = *ip++; Col = *ip++; LSeqid = *ip++; return (i); } char cmeof, incomm; /* * Get the text of a comment from the input stream, * recording its type and linking it into the linked * list of comments headed by cmhp. */ getcm(cmdelim) char cmdelim; { int cmjust, col; register struct comment *cp; register struct commline *kp; incomm = 1; if (cmdelim == '*' && yycol == 10 || cmdelim == '{' && yycol == 9) cmjust = CLMARG; else if (yytokcnt <= 1) cmjust = CALIGN; else if (yywhcnt < 2) cmjust = CTRAIL; else cmjust = CRMARG; col = yycol - (cmdelim == '{' ? 1 : 2); cp = tree5(NIL, cmdelim, NIL, cmjust, yyseqid); cmeof = 0; do { kp = getcmline(cmdelim); if (cp->cml == NIL) { kp->cml = kp; kp->cmcol = col; } else { kp->cml = cp->cml->cml; cp->cml->cml = kp; switch (cp->cmjust) { case CTRAIL: case CRMARG: cp->cmjust = CALIGN; } } cp->cml = kp; } while (!cmeof); newcomm(cp); incomm = 0; } /* * Chain the new comment at "cp" onto the linked list of comments. */ newcomm(cp) register struct comment *cp; { if (cmhp == NIL) cp->cmnext = cp; else { cp->cmnext = cmhp->cmnext; cmhp->cmnext = cp; } cmhp = cp; } int nilcml[3]; quickcomm(t) int t; { if (incomm) return; newcomm(tree5(nilcml, NIL, NIL, t, yyseqid)); } commincl(cp, ch) char *cp, ch; { newcomm(tree5(nilcml, savestr(cp), ch, CINCLUD, yyseqid)); } getcmline(cmdelim) char cmdelim; { char lastc; register char *tp; register CHAR c; register struct commline *kp; c = readch(); kp = tree3(NIL, yycol, NIL); tp = token; lastc = 0; for (;;) { switch (c) { case '}': if (cmdelim == '{') goto endcm; break; case ')': if (cmdelim == '*' && lastc == '*') { --tp; goto endcm; } break; case '\n': goto done; case -1: yerror("Comment does not terminate - QUIT"); pexit(ERRS); } lastc = c; *tp++ = c; c = readch(); } endcm: cmeof++; done: *tp = 0; kp->cmtext = copystr(token); return (kp); } /* * Flush through the line this token is on. * Ignore if next token on same line as this one. */ putcml() { register int i, SSeqid, SCol; if (Seqid == LSeqid) return (1); SSeqid = Seqid, SCol = Col; Seqid = LSeqid, Col = 32767; i = putcm(); Seqid = SSeqid, Col = SCol; return (i); } /* * Flush to the beginning of the line this token is on. * Ignore if this token is on the same line as the previous one * (effectively since all such already then flushed.) */ putcmp() { register int i, SSeqid, SCol; SSeqid = Seqid, SCol = Col; Seqid = LSeqid, Col = 0; i = putcm(); Seqid = SSeqid, Col = SCol; return (i); } /* * Put out the comments to the border indicated by Seqid and Col */ putcm() { register struct comment *cp; register int i; cp = cmhp; if (cp == NIL) return (0); i = 0; cp = cp->cmnext; while (cp->cmseqid < Seqid || cp->cmseqid == Seqid && cp->cml->cmcol < Col) { putone(cp); i =| 1 << cp->cmjust; if (cp->cmnext == cp) { cmhp = NIL; break; } cp = cp->cmnext; cmhp->cmnext = cp; } return (i); } /* * Put out one comment. * Note that empty lines, form feeds and #include statements * are treated as comments are regurgitated here. */ putone(cp) register struct comment *cp; { register struct commline *cml, *cmf; align(cp); switch (cp->cmjust) { case CINCLUD: /* ppflush() */ if (noinclude == 0) { putchar('\f'); return; } printf("#include %c%s%c", cp->cml, cp->cmdelim, cp->cml); return; } if (stripcomm) return; switch (cp->cmjust) { case CFORM: ppop("\f"); ppnl(); case CNL: case CNLBL: return; } ppbra(cp->cmdelim == '{' ? "{" : "(*"); cmf = cp->cml->cml; ppid(cmf->cmtext); for (cml = cmf->cml; cml != cmf; cml = cml->cml) { align(cp); oneline(cmf->cmcol, cml); } ppket(cp->cmdelim == '{' ? "}" : "*)"); } /* * Do the preliminary horizontal and vertical * motions necessary before beginning a comment, * or between lines of a mult-line comment. */ align(cp) register struct comment *cp; { switch (cp->cmjust) { case CNL: ppsnl(); break; case CNLBL: ppsnlb(); break; case CFORM: case CINCLUD: ppnl(); break; case CLMARG: ppnl(); if (profile) ppid("\t"); break; case CALIGN: ppnl(); indent(); break; case CTRAIL: ppspac(); break; case CRMARG: case CSRMARG: pptab(); break; } } /* * One line of a multi-line comment * Deal with alignment and initial white space trimming. * The "margin" indicates where the first line of the * comment began... don't print stuff in this comment * which came before this. */ oneline(margin, cml) int margin; struct commline *cml; { register char *tp; register int i; for (i = 8, tp = cml->cmtext; i < margin && *tp; tp++) switch (*tp) { case ' ': i++; continue; case '\t': i =+ 8; i =& ~7; if (i < margin) continue; ppop("\t"); default: goto out; } out: ppid(tp); } /* * Flush all comments */ flushcm() { Seqid = 32767; return(putcm()); } #define BLANKS ((1 << CNL) | (1 << CNLBL) | (1 << CFORM)) noblank(i) int i; { return ((i & BLANKS) == 0); } int needform, neednlbl, neednl, needseqid; needtree() { register st((ruct comment *cp; needform = neednlbl = neednl = 0; cp = cmhp; if (cp == NIL) return (0); do { switch (cp->cmjust) { case CNL: neednl++; goto seq; case CNLBL: neednlbl++; goto seq; case CFORM: needform++; seq: needseqid = cp->cmseqid; break; default: neednl = neednlbl = needform = 0; return (1); } cp = cp->cmnext; } while (cp != cmhp); cmhp = NIL; return (0); } packtree() { int save; save = yyseqid; yyseqid = needseqid; for (; needform > 0; needform--) commform(); for (; neednl > 0; neednl--) commnl(); for (; neednlbl > 0; neednlbl--) commnlbl(); yyseqid = save; } neednl++; goto seq; case CNLBL: neednlbl++; goto seq; case CFORM: needform++; seq: needseqid = cp->cmseqid; break; default: neednl = neednlbl = needform = 0; return (1); } cp = cp->cmnext; } while (cp != cmhp); cmhp = NIL; return (0); } packtree() { int save; save = yyseqid; yyseqid = needseqid; for (; needform > cmd/pxp/yycopy.c 444 0 33 561 2552606523 7072 static char *sccsid = "@(#)yycopy.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ #include "0.h" #include "yy.h" OYcopy () { register int *r0 = & OY; register int *r1 = & Y; register int r2 = ( sizeof ( struct yytok ) ) / ( sizeof ( int ) ); do { * r0 ++ = * r1 ++ ; } while ( -- r2 > 0 ); } cmnext; } while (cp != cmhp); cmhp = NIL; return/,5< /,"cmd/pxp/yycosts.c 444 0 33 11754 2552606523 7321 static char *sccsid = "@(#)yycosts.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pi - Pascal interpreter code translator * * Charles Haley, Bill Joy UCB * Version 1.1 February 1978 * * * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.1 February 1978 */ #include "0.h" #include "yy.h" /* * Symbol costs for Pascal. * * Cost strategy of August 14, 1977. * * The costs determined by the routines in this file are used by * the recovery in choosing appropriate corrections. * The cost vectors and the error productions in the grammar * work together to define the corrective capacity of the grammar. * * The costs here largely derive from those given in Steve Rhode's * thesis for the Pascal-I error correcting parser which he implemented. * Some minor changes have been made to adjust for the fact that * the current error recovery is not as "smart", both because of the * limited forward move and because of the lack of any type information * about identifiers. * * These adjustments largely take the form of increased costs for certain * tokens, noticeably keywords which are major brackets such as "begin" * "label", "procedure", etc. * * The overall weighting strategy is still similar to Rhodes' strategy. * The costs can be considered: * * LOW <= 3 * MEDIUM 4 or 5 * HIGH >= 6 */ /* * Insertion costs * * In addition to the normal symbol insertion costs, * there are zero cost insertions here. * The current error recovery system treats symbols * which have zero insertion cost in a special way, * inserting them but suppressing diagnostics. * This allows the system to hold of on bracketing * error diagnostics about missing end's until the * reduction occurs which knows the line number of the * corresponding "begin", "repeat", etc. * A more intelligent and useful diagnostic can then * be printed. * * Although this routine never allows the insertion * of the keyword begin, it can be inserted after a * procedure or function body starts, if it was omitted * by a special case in the panic routine, which notices * the keywords in the statement body of the procedure * and inserts the begin to recover. * * Similarly, we do not insert end-of-file, but * the fact that end-of-file is the unique input * is noticed by the recovery routines as a special * case and handled there. */ inscost(sy, before) register int sy, before; { switch (before) { case YEND: if (sy == YEND) break; case YPROCEDURE: case YFUNCTION: if (sy == YUNTIL || sy == YEND) return (0); } switch (sy) { case ';': return (1); case ',': case ':': case YOF: case YDO: return (2); case YARRAY: case '+': case '*': return (3); default: return (4); case '^': case YNOT: case YLABEL: case YCONST: case YTYPE: case YVAR: case YUNTIL: case '(': case '[': case YWHILE: case YWITH: case YASSERT: return (5); case YPROCEDURE: case YFUNCTION: case YCASE: return (6); case YEND: return (8); case YBEGIN: case YEOF: case YREPEAT: case YRECORD: return (INFINITY); } } /* * Replacement costs * * Most replacement costs are the same as an insertion * plus a deletion cost. One special case is the replacement * of a large number of keywords by an identifier. * These are given lower costs, especially the keyword "to". */ repcost(what, with) register int what, with; { register int c; if (with == what) return (INFINITY); if (with == YID && what > ERROR) switch (what) { case YID: case YDOTDOT: case YINT: case YBINT: case YSTRING: case YNUMB: break; case YTO: return (3); default: return (5); case YRECORD: case YTHEN: return (6); case YBEGIN: break; } if (what == ';' && (with == ',' || with == '.')) return (CLIMIT - 1); c = delcost(what) + inscost(with); /* * It costs extra to replace something which has * semantics by something which doesn't. */ if (nullsem(what) == NIL && nullsem(with) != NIL) c =+ 4; return (c); } /* * Deletion costs */ delcost(what) int what; { switch (what) { case '.': case ':': case ',': case '=': case '(': return (3); case YELSE: case YTHEN: return (4); default: return (5); case YLABEL: case YCONST: case YTYPE: case YVAR: return (10); case YPROCEDURE: case YFUNCTION: case YBEGIN: case YEND: return ((CLIMIT * 3) / 4); case ';': case YEOF: return (INFINITY); } } #ifdef DEBUG /* * Routine to print out costs with "-C" option. */ char yysyms[] ";,:=*+/-|&()[]<>~^"; yycosts() { register int c; register char *cp; printf("Insert\tDelete\tRep(ID)\tSymbol\n"); for (cp = yysyms; *cp; cp++) yydocost(*cp); for (c = ERROR + 1; c < YLAST; c++) yydocost(c); #ifdef PXP flush(); #endif } yydocost(c) int c; { printf("%4d\t", inscost(c, -1)); printf("%4d\t", delcost(c)); if (repcost(c, YID) != inscost(YID) + delcost(c)) printf("%4d", repcost(c, YID)); printf("\t%s%s\n", charname(c)); } #endif out costs with "-C"cmd/pxp/yyerror.c 444 0 33 3475 2552606523 7300 static char *sccsid = "@(#)yyerror.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ /* * pi - Pascal interpreter code translator * * Charles Haley, Bill Joy UCB * Version 1.2 January 1979 * * * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 January 1979 */ #include "0.h" #include "yy.h" /* * Yerror prints an error * message and then returns * NIL for the tree if needed. * The error is flagged on the * current line which is printed * if the listing is turned off. #ifdef PXP * * As is obvious from the fooling around * with fout below, the Pascal system should * be changed to use the new library "lS". #endif */ yerror(s, a1, a2, a3, a4, a5) char *s; { #ifdef PI char buf[256]; #endif register int i, j; static yySerrs; #ifdef PXP /* int ofout; */ #endif if (errpfx == 'w' && opt('w') != 0) return; #ifdef PXP /* flush(); ofout = fout[0]; fout[0] = errout; */ #endif yyResume = 0; #ifdef PI geterr(s, buf); s = buf; #endif yysync(); putc(errpfx, stderr); putc(' ', stderr); for (i = 3; i < yyecol; i++) putc('-', stderr); fprintf(stderr, "^--- "); /* if (yyecol > 60) printf("\n\t"); */ fprintf(stderr, s, a1, a2, a3, a4, a5); putc('\n', stderr); if (errpfx == 'E') #ifdef PI eflg++, cgenflg++; #endif #ifdef PXP eflg++; #endif errpfx = 'E'; yySerrs++; if (yySerrs >= MAXSYNERR) { yySerrs = 0; yerror("Too many syntax errors - QUIT"); pexit(ERRS); } #ifdef PXP /* flush(); fout[0] = ofout; */ return (0); #endif } /* * A bracketing error message */ brerror(where, what) int where; char *what; { if (where == 0) { line = yyeline; setpfx(' '); error("End matched %s on line %d", what, where); return; } if (where < 0) where = -where; yerror("Inserted keyword end matching %s on line %d", what, where); } ndif errpfx = 'E'; yySerrs++; if (yySerrs >= MAXSYNERR) { yySerrs = 0; yerror("Too many syntax errors - QUIT"); pexit(ERRS); } #ifdef PXP /* flush(); fout[0] = ofout; */ return (0); ((cmd/pxp/yyget.c 444 0 33 13707 2552606523 6745 static char *sccsid = "@(#)yyget.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ /* * pi - Pascal interpreter code translator * * Charles Haley, Bill Joy UCB * Version 1.1 February 1978 * * * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.1 February 1978 */ #include "0.h" #include "yy.h" #ifdef PXP int yytokcnt; #endif /* * Readch returns the next * character from the current * input line or -1 on end-of-file. * It also maintains yycol for use in * printing error messages. */ readch() { register i, c; if (*bufp == '\n' && bufp >= charbuf) { #ifdef PXP yytokcnt = 0; #endif if (getline() < 0) return (-1); } c = *++bufp; if (c == '\t') yycol = ((yycol + 8) & ~7); else yycol++; return (c); } /* * Definitions of the structures used for the * include facility. The variable "ibp" points * to the getc buffer of the current input file. * There are "inclev + 1" current include files, * and information in saved in the incs stack * whenever a new level of include nesting occurs. * * Ibp in the incs structure saves the pointer * to the previous levels input buffer; * filename saves the previous file name; * Printed saves whether the previous file name * had been printed before this nesting occurred; * and yyline is the line we were on on the previous file. */ #define MAXINC 10 struct inc { FILE *ibp; char *filename; int Printed; int yyline; int yyLinpt; } incs[MAXINC]; extern char printed; int inclev = -1; #ifdef PXP /* * These initializations survive only if * pxp is asked to pretty print one file. * Otherwise they are destroyed by the initial * call to getline. */ char charbuf[CBSIZE] = " program x(output);\n"; int yycol = 8; char *bufp = charbuf; #endif /* * YyLinpt is the seek pointer to the beginning of the * next line in the file. */ int yyLinpt; /* * Getline places the next line * from the input stream in the * line buffer, returning -1 at YEOF. */ getline() { register char *cp; register CHAR c; #ifdef PXP static char ateof; #endif register FILE *ib; int i; if (opt('l') && yyprtd == 0) yyoutline(); yyprtd = 0; top: yylinpt = yyLinpt; yyline++; yyseqid++; cp = charbuf; ib = ibp; i = sizeof charbuf - 1; for (;;) { c = getc(ib); if (c == EOF) { if (uninclud()) goto top; #ifdef PXP if (ateof == 0 && bracket) { strcpy(charbuf, "begin end.\n"); ateof = 1; goto out; } #endif bufp = "\n"; yyline--; yyseqid--; yyprtd = 1; return (-1); } *cp++ = c; if (c == '\n') break; if (--i == 0) { line = yyline; error("Input line too long - QUIT"); pexit(DIED); } } *cp = 0; yyLinpt = yylinpt + cp - charbuf; if (includ()) goto top; #ifdef PXP if (cp == &charbuf[1]) commnl(); else if (cp == &charbuf[2]) switch (charbuf[0]) { case ' ': commnlbl(); break; case '\f': commform(); } #endif if (opt('u')) setuflg(); out: bufp = charbuf - 1; yycol = 8; return (1); } /* * Check an input line to see if it is a "#include" pseudo-statement. * We allow arbitrary blanks in the line and the file name * may be delimited by either 's or "s. A single semicolon * may be placed after the name, but nothing else is allowed */ includ() { register char *cp, *dp; char ch; register struct inc *ip; cp = charbuf; if (*cp++ != '#') return (0); cp = skipbl(cp); for (dp = "include"; *dp; dp++) if (*dp != *cp++) return (0); line = yyline; cp = skipbl(cp); ch = *cp++; if (ch != '\'' && ch != '"') { /* * This should be a yerror flagging the place * but its not worth figuring out the column. */ line = yyline; error("Include syntax error - expected ' or \" not found - QUIT"); pexit(DIED); } for (dp = cp; *dp != ch; dp++) if (*dp == 0) { line = yyline; error("Missing closing %c for include file name - QUIT", ch); pexit(DIED); } *dp++ = 0; /* if (*dp == ';') dp++; dp = skipbl(dp); if (*dp != '\n') { line = yyline; error("Garbage after filename in include"); pexit(DIED); } */ if (!dotted(cp, 'i')) { line = yyline; error("Include filename must end in .i"); } #ifdef PXP commincl(cp, ch); if (noinclude) return (1); #endif inclev++; if (inclev > MAXINC) { line = yyline; error("Absurdly deep include nesting - QUIT"); pexit(DIED); } ip = &incs[inclev]; ip->filename = filename; filename = savestr(cp); /* * left over from before stdio * * cp = malloc(518); * if (cp == -1) { * error("Ran out of memory (include)"); * pexit(DIED); * } * */ ip->ibp = ibp; if ( ( ibp = fopen(filename, "r" ) ) == NULL ) { perror(filename); pexit(DIED); } if (inpflist(filename)) { #ifdef PI opush('l'); #endif #ifdef PXP opush('z'); #endif } ip->Printed = printed; printed = 0; ip->yyline = yyline; yyline = 0; ip->yyLinpt = yyLinpt; yyLinpt = 0; /* * left over from before stdio * * ip->ibp = ibp; * ibp = cp; * */ return (1); } skipbl(ocp) char *ocp; { register char *cp; cp = ocp; while (*cp == ' ' || *cp == '\t') cp++; return (cp); } /* * At the end of an include, * close the file, free the input buffer, * and restore the environment before * the "push", including the value of * the z option for pxp and the l option for pi. */ uninclud() { register struct inc *ip; if (inclev < 0) return (0); /* * left over from before stdio: becomes fclose ( ibp ) * * close(ibp[0]); * free(ibp); * */ fclose ( ibp ); ip = &incs[inclev]; ibp = ip->ibp; yyline = ip->yyline; if (inpflist(filename)) { #ifdef PI opop('l'); #endif #ifdef PXP opop('z'); #endif } filename = ip->filename; yyLinpt = ip->yyLinpt; /* * If we printed out the nested name, * then we should print all covered names again. * If we didn't print out the nested name * we print the uncovered name only if it * has not been printed before (unstack). */ if (printed) { printed = 0; while (ip >= incs) { ip->Printed = 0; ip--; } } else printed = ip->Printed; inclev--; return (1); } f (inpflist(filename)) { #ifdef PI opop('l'); #endif #icmd/pxp/yyid.c 444 0 33 11626 2552606523 6560 static char *sccsid = "@(#)yyid.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pi - Pascal interpreter code translator * * Charles Haley, Bill Joy UCB * Version 1.1 February 1978 * * * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.1 February 1978 */ #include "0.h" #include "yy.h" #ifdef PI extern int *yypv; /* * Determine whether the identifier whose name * is "cp" can possibly be a kind, which is a * namelist class. We look through the symbol * table for the first instance of cp as a non-field, * and at all instances of cp as a field. * If any of these are ok, we return true, else false. * It would be much better to handle with's correctly, * even to just know whether we are in a with at all. * * Note that we don't disallow constants on the lhs of assignment. */ identis(cp, kind) register char *cp; int kind; { register struct nl *p; int i; /* * Cp is NIL when error recovery inserts it. */ if (cp == NIL) return (1); /* * Record kind we want for possible later use by yyrecover */ yyidwant = kind; yyidhave = NIL; i = ( (int) cp ) & 077; for (p = disptab[i]; p != NIL; p = p->nl_next) if (p->symbol == cp) { if (yyidok(p, kind)) goto gotit; if (p->class != FIELD && p->class != BADUSE) break; } if (p != NIL) for (p = p->nl_next; p != NIL; p = p->nl_next) if (p->symbol == cp && p->class == FIELD && yyidok(p, kind)) goto gotit; return (0); gotit: if (p->class == BADUSE && !Recovery) { yybadref(p, OY.Yyeline); yypv[0] = NIL; } return (1); } /* * A bad reference to the identifier cp on line * line and use implying the addition of kindmask * to the mask of kind information. */ yybaduse(cp, line, kindmask) register char *cp; int line, kindmask; { register struct nl *p, *oldp; int i; i = ( (int) cp ) & 077; for (p = disptab[i]; p != NIL; p = p->nl_next) if (p->symbol == cp) break; oldp = p; if (p == NIL || p->class != BADUSE) p = enter(defnl(cp, BADUSE, 0, 0)); p->value[NL_KINDS] =| kindmask; yybadref(p, line); return (oldp); } /* * ud is initialized so that esavestr will allocate * sizeof ( struct udinfo ) bytes for the 'real' struct udinfo */ struct udinfo ud = { ~0 , ~0 , 0}; /* * Record a reference to an undefined identifier, * or one which is improperly used. */ yybadref(p, line) register struct nl *p; int line; { register struct udinfo *udp; if (p->chain != NIL && p->chain->ud_line == line) return; udp = esavestr(&ud); udp->ud_line = line; udp->ud_next = p->chain; p->chain = udp; } #define varkinds ((1<class == BADUSE) { if (kind == VAR) return (p->value[0] & varkinds); return (p->value[0] & (1 << kind)); } if (yyidok1(p((, kind)) return (1); if (yyidhave != NIL) yyidhave = IMPROPER; else yyidhave = p->class; return (0); } yyidok1(p, kind) register struct nl *p; int kind; { int i; switch (kind) { case FUNC: if (p->class == FVAR) return(1); case CONST: case TYPE: case PROC: case FIELD: return (p->class == kind); case VAR: return (p->class == CONST || yyisvar(p, NIL)); case ARRAY: case RECORD: return (yyisvar(p, kind)); case PTRFILE: return (yyisvar(p, PTR) || yyisvar(p, FILET)); } } yyisvar(p, class) register struct nl *p; int class; { switch (p->class) { case FIELD: case VAR: case REF: case FVAR: /* * We would prefer to return * parameterless functions only. */ case FUNC: return (class == NIL || (p->type != NIL && p->type->class == class)); } return (0); } #endif #ifdef PXP #ifndef DEBUG identis() { return (1); } #endif #ifdef DEBUG extern char *classes[]; char kindchars[] "UCTVAQRDPF"; /* * Fake routine "identis" for pxp when testing error recovery. * Looks at letters in variable names to answer questions * about attributes. Mapping is * C const_id * T type_id * V var_id also if any of AQRDF * A array_id * Q ptr_id * R record_id * D field_id D for "dot" * P proc_id * F func_id */ identis(cp, kind) register char *cp; int kind; { register char *dp; char kindch; /* * Don't do anything unless -T */ if (!typetest) return (1); /* * Inserted symbols are always correct */ if (cp == NIL) return (1); /* * Set up the names for error messages */ yyidwant = classes[kind]; for (dp = kindchars; *dp; dp++) if (any(cp, *dp)) { yyidhave = classes[dp - kindchars]; break; } /* * U in the name means undefined */ if (any(cp, 'U')) return (0); kindch = kindchars[kind]; if (kindch == 'V') for (dp = "AQRDF"; *dp; dp++) if (any(cp, *dp)) return (1); return (any(cp, kindch)); } #endif #endif eturn (1); /* * Inserted symbols are always correct */ if (cp == NIL) return (1); /* * Set up cmd/pxp/yylex.c 444 0 33 13657 2552606523 6762 static char *sccsid = "@(#)yylex.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pi - Pascal interpreter code translator * * Charles Haley, Bill Joy UCB * Version 1.2 November 1978 * * * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 November 1978 */ #include "0.h" #include "yy.h" /* * Scanner */ int yylacnt; #define YYLASIZ 10 struct yytok Yla[YYLASIZ]; unyylex(y) struct yylex *y; { if (yylacnt == YYLASIZ) panic("unyylex"); copy(&Yla[yylacnt], y, sizeof Yla[0]); yylacnt++; } yylex() { register c; register **ip; register char *cp; int f; char delim; if (yylacnt != 0) { yylacnt--; copy(&Y, &Yla[yylacnt], sizeof Y); return (yychar); } if (c = yysavc) yysavc = 0; else c = readch(); #ifdef PXP yytokcnt++; #endif next: /* * skip white space */ #ifdef PXP yywhcnt = 0; #endif while (c == ' ' || c == '\t') { #ifdef PXP if (c == '\t') yywhcnt++; yywhcnt++; #endif c = readch(); } yyecol = yycol; yyeline = yyline; yyefile = filename; yyeseqid = yyseqid; yyseekp = yylinpt; cp = token; yylval = yyline; switch (c) { case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': case 's': case 't': case 'u': case 'v': case 'w': case 'x': case 'y': case 'z': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z': do { *cp++ = c; c = readch(); } while (alph(c) || digit(c)); *cp = 0; if (opt('s')) for (cp = token; *cp; cp++) if (*cp >= 'A' && *cp <= 'Z') { *cp =| ' '; } yysavc = c; ip = hash(0, 1); if (*ip < yykey || *ip >= lastkey) { yylval = *ip; return (YID); } yylval = yyline; /* * For keywords * the lexical token * is magically retrieved * from the keyword table. */ return ((*ip)[1]); case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': f = 0; do { *cp++ = c; c = readch(); } while (digit(c)); if (c == 'b' || c == 'B') { /* * nonstandard - octal constants */ if (opt('s')) { standard(); yerror("Octal constants are non-standard"); } *cp = 0; yylval = copystr(token); return (YBINT); } if (c == '.') { c = readch(); if (c == '.') { *cp = 0; yysavc = YDOTDOT; yylval = copystr(token); return (YINT); } infpnumb: f++; *cp++ = '.'; if (!digit(c)) { yyset(); recovered(); yerror("Digits required after decimal point"); *cp++ = '0'; } else while (digit(c)) { *cp++ = c; c = readch(); } } if (c == 'e' || c == 'E') { f++; *cp++ = c; if ((c = yysavc) == 0) c = readch(); if (c == '+' || c == '-') { *cp++ = c; c = readch(); } if (!digit(c)) { yyset(); yerror("Digits required in exponent"); *cp++ = '0'; } else while (digit(c)) { *cp++ = c; c = readch(); } } *cp = 0; yysavc = c; yylval = copystr(token); if (f) return (YNUMB); return (YINT); case '"': case '`': if (!any(bufp + 1, c)) goto illch; if (!dquote) { recovered(); dquote++; yerror("Character/string delimiter is '"); } case '\'': case '#': delim = c; do { do { c = readch(); if (c == '\n') { yerror("Unmatched %c for string", delim); if (cp == token) *cp++ = ' ', cp++; break; } *cp++ = c; } while (c != delim); c = readch(); } while (c == delim); *--cp = 0; if (cp == token) { yerror("Null string not allowed"); *cp++ = ' '; *cp++ = 0; } yysavc = c; yylval = copystr(token); return (YSTRING); case '.': c = readch(); if (c == '.') return (YDOTDOT); if (digit(c)) { recovered(); yerror("Digits required before decimal point"); *cp++ = '0'; goto infpnumb; } yysavc = c; return ('.'); case '{': /* * { ... } comment */ #ifdef PXP getcm(c); #endif #ifdef PI c = options(); while (c != '}') { if (c <= 0) goto nonterm; if (c == '{') { warning(); yyset(); yerror("{ in a { ... } comment"); } c = readch(); } #endif c = readch(); goto next; case '(': if ((c = readch()) == '*') { /* * (* ... *) comment */ #ifdef PXP getcm(c); c = readch(); goto next; #endif #ifdef PI c = options(); for (;;) { if (c < 0) { nonterm: yerror("Comment does not terminate - QUIT"); pexit(ERRS); } if (c == '(' && (c = readch()) == '*') { warning(); yyset(); yerror("(* in a (* ... *) comment"); } if (c == '*') { if ((c = readch()) != ')') continue; c = readch(); goto next; } c = readch(); } #endif } yysavc = c; c = '('; case ';': case ',': case ':': case '=': case '*': case '+': case '/': case '-': case '|': case '&': case ')': case '[': case ']': case '<': case '>': case '~': case '^': return (c); default: switch (c) { case YDOTDOT: return (c); case '\n': c = readch(); #ifdef PXP yytokcnt++; #endif goto next; case '\f': c = readch(); goto next; } if (c <= 0) return (YEOF); illch: do yysavc = readch(); while (yysavc == c); yylval = c; return (YILLCH); } } yyset() { yyecol = yycol; yyeline = yyline; yyefile = filename; yyseekp = yylinpt; } /* * Setuflg trims the current * input line to at most 72 chars * for the u option. */ setuflg() { if (charbuf[71] != '\n') { charbuf[72] = '\n'; charbuf[73] = 0; } } ; #ifdef PXP yytokcnt++; #endif goto next; case '\f': c = readcmd/pxp/yymain.c 444 0 33 5347 2552606524 7074 static char *sccsid = "@(#)yymain.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pi - Pascal interpreter code translator * * Charles Haley, Bill Joy UCB * Version 1.2 November 1978 * * * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 November 1978 */ #include "0.h" #include "yy.h" int line = 1; /* * Yymain initializes each of the utility * clusters and then starts the processing * by calling yyparse. */ yymain() { /* * Initialize the scanner */ #ifdef PXP if (bracket == 0) { #endif if (getline() == -1) { Perror(filename, "No lines in file"); pexit(NOSTART); } #ifdef PXP } else yyline = 0; #endif #ifdef PI magic(); #endif /* * Initialize the clusters * initstring(); */ inithash(); inittree(); #ifdef PI initnl(); #endif /* * Process the input */ yyparse(); #ifdef PI magic2(); #ifdef DEBUG dumpnl(0); #endif #endif #ifdef PXP prttab(); if (onefile) { extern int outcol; if (outcol)(( putchar('\n'); flush(); if (eflg) { writef(2, "File not rewritten because of errors\n"); pexit(ERRS); } signal(1, 1); signal(2, 1); copyfile(); } #endif pexit(eflg ? ERRS : AOK); } #ifdef PXP copyfile() { register int c; char buf[BUFSIZ]; if (freopen(stdoutn, "r", stdin) == NULL) { perror(stdoutn); pexit(ERRS); } if (freopen(firstname, "w", stdout) == NULL) { perror(firstname); pexit(ERRS); } while ((c = getchar()) > 0) putchar(c); if (ferror(stdout)) perror(stdout); } #endif static struct { int magic; unsigned txt_size; unsigned data_size; unsigned bss_size; unsigned syms_size; unsigned entry_point; unsigned tr_size; unsigned dr_size; } header; #ifdef PI magic() { /* * this is the size of /usr/lib/npxheader */ #define HEAD_BYTES 1024 short buf[HEAD_BYTES / sizeof ( short )]; unsigned *ubuf = buf; register int hf, i; hf = open("/usr/lib/npx_header", 0); if (hf >= 0 && read(hf, buf, HEAD_BYTES) > sizeof header) { header.magic = ubuf[0]; header.txt_size = ubuf[1]; header.data_size = ubuf[2]; header.bss_size = ubuf[3]; header.syms_size = ubuf[4]; header.entry_point = ubuf[5]; header.tr_size = ubuf[6]; header.dr_size = ubuf[7]; for (i = 0; i < HEAD_BYTES / sizeof ( short ); i++) word(buf[i]); } close(hf); word(0404); } magic2() { short i; if (header.magic != 0407) panic ( "magic2" ); pflush(); lseek(ofil, 0l, 0); header.data_size = ( unsigned ) lc - header.txt_size; header.data_size =- sizeof header; write(ofil, &header, sizeof header); lseek(ofil, ( long ) ( HEAD_BYTES - sizeof ( short ) ) , 0); i = ( ( unsigned ) lc) - HEAD_BYTES; write(ofil, &i, 2); } #endif #ifdef PXP writef(i, cp) { write(i, cp, strlen(cp)); } #endif HEAD_BYTES / sizeof ( short ); i++) word(buf[i]); } close(hf); word(0404); } magic2() { short i; if (header.magic != 0407) panic ( "magic2" ); pflush(); lseek(ofil, 0l, 0); header.data_size = ( unsigned ) lc - header.txt_size; header.data_size =- sizeof header; wcmd/pxp/yypanic.c 444 0 33 6432 2552606524 7236 static char *sccsid = "@(#)yypanic.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pi - Pascal interpreter code translator * * Charles Haley, Bill Joy UCB * Version 1.2 January 1979 * * * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 January 1979 */ #include "0.h" #include "yy.h" struct yytok oldpos; /* * The routine yyPerror coordinates the panic when * the correction routines fail. Three types of panics * are possible - those in a declaration part, those * in a statement part, and those in an expression. * * Declaration part panics consider insertion of "begin", * expression part panics will stop on more symbols. * The panics are otherwise the same. * * ERROR MESSAGE SUPPRESSION STRATEGY: August 11, 1977 * * If the parser has not made at least 2 moves since the last point of * error then we want to suppress the supplied error message. * Otherwise we print it. * We then skip input up to the next solid symbol. */ yyPerror(cp, kind) char *cp; register int kind; { register int ishifts, brlev; copy(&oldpos, &Y, sizeof oldpos); brlev = 0; if (yychar < 0) yychar = yylex(); for (ishifts = yyshifts; ; yychar = yylex(), yyshifts++) switch (yychar) { case YILLCH: yerror("Illegal character"); if (ishifts == yyshifts) yyOshifts = 0; continue; case YEOF: goto quiet; case ';': if (kind == PPROG) continue; if (kind == PDECL) yychar = yylex(); goto resume; case YEND: if (kind == PPROG) continue; case YPROCEDURE: case YFUNCTION: goto resume; case YLABEL: case YTYPE: case YCONST: case YVAR: if (kind == PSTAT) { yerror("Declaration found when statement expected"); goto quiet; } case YBEGIN: goto resume; case YFOR: case YREPEAT: case YWHILE: case YGOTO: case YIF: if (kind != PDECL) goto resume; yerror("Expected keyword begin after declarations, before statements"); unyylex(&Y); yychar = YBEGIN; yylval = nullsem(YBEGIN); goto quiet; case YTHEN: case YELSE: case YDO: if (kind == PSTAT) { yychar = yylex(); goto resume; } if (kind == PEXPR) goto resume; continue; case ')': case ']': if (kind != PEXPR) continue; if (brlev == 0) goto resume; if (brlev > 0) brlev--; continue; case '(': case '[': brlev++; continue; case ',': if (brlev != 0) continue; case YOF: case YTO: case YDOWNTO: if (kind == PEXPR) goto resume; continue; #ifdef PI /* * A rough approximation for now * Should be much more lenient on suppressing * warnings. */ case YID: syneflg++; continue; #endif } resume: if (yyOshifts >= 2) { if (yychar != -1) unyylex(&Y); copy(&Y, &oldpos, sizeof Y); yerror(cp); yychar = yylex(); } quiet: if (yyshifts - ishifts > 2 && opt('r')) { setpfx('r'); yerror("Parsing resumes"); } /* * If we paniced in the statement part, * and didn't stop at a ';', then we insert * a ';' to prevent the recovery from immediately * inserting one and complaining about it. */ if (kind == PSTAT && yychar != ';') { unyylex(&Y); yyshifts--; yytshifts--; yychar = ';'; yylval = nullsem(';'); } } char != -1) unyylex(&Y); copy(&Y, &oldpos, sizeof Y); yerror(cp); yychar = yylex(); } quiet: if (yyshifts - ishifts > 2 && opt('r')) { setpfx('r'); yerror("Parsing resumes"); } /* * If we paniced in the statemencmd/pxp/yyparse.c 444 0 33 6667 2552606524 7270 static char *sccsid = "@(#)yyparse.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pi - Pascal interpreter code translator * * Charles Haley, Bill Joy UCB * Version 1.2 January 1979 * * * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 January 1979 */ #include "0.h" #include "yy.h" /* * Parser for 'yacc' output. * Specifially Modified for Berkeley Pascal */ int yystate; /* Current parser state */ int *yypv; unsigned yytshifts 1; /* Number of "true" shifts */ /* * Parse Tables */ int yygo[]; int yypgo[]; int yyr1[]; int yyr2[]; int yyact[]; int yypact[]; /* * Parse and parallel semantic stack */ int yyv[MAXDEPTH]; int yys[MAXDEPTH]; /* * This routine parses the input stream, and * returns if it accepts, or if an unrecoverable syntax * error is encountered. */ yyparse() { register int *ps, n, *p; int paniced, *panicps, idfail; yystate = 0; yychar = yylex(); OY.Yychar = -1; yyshifts = 3; paniced = 0; ps = &yys[0]-1; yypv = &yyv[0]-1; #ifdef PXP yypw = &yyw[0]-1; #endif stack: /* * Push new state and value. */ if (yypv >= &yyv[MAXDEPTH-1]) { yerror("Parse stack overflow"); pexit(DIED); } *++ps = yystate; *++yypv = yyval; #ifdef PXP yypw++; #endif newstate: /* * Locate parsing actions for the * new parser state. */ p = &yyact[ yypact[yystate+1] ]; actn: /* * Search the parse actions table * for something useful to do. * While n is non-positive, it is the negation * of the token we are testing for. */ #ifdef PI if ((n = *p++) <= 0) { if (yychar < 0) yychar = yylex(); do if ((n =+ yychar) != 0) p++; while ((n = *p++) <= 0); } #else while ((n = *p++) <= 0) if ((n =+ yychar) != 0) p++; #endif switch (n >> 12) { /* * Shift. */ case 2: #ifdef PXP yypw[1].Wseqid = yyseqid; yypw[1].Wcol = yycol; #endif OYcopy(); yystate = n & 07777; yyval = yylval; #ifdef PI yychar = -1; #else yychar = yylex(); #endif yyshifts++; yytshifts++; goto stack; /* * Reduce. */ case 3: n =& 07777; N = yyr2[n]; if (N == 1 && OY.Yychar == YID && !yyEactr(n, yypv[0])) { idfail = 1; goto errin; } OY.Yychar = -1; ps =- N; yypv =- N; #ifdef PXP yypw =- N; #endif yyval = yypv[1]; yyactr(n); /* * Use goto table to find next state. */ p = &yygo[yypgo[yyr1[n]]]; while (*p != *ps && *p >= 0) p =+ 2; yystate = p[1]; goto stack; /* * Accept. */ case 4: return; /* * Error. */ case 1: idfail = 0; errin: if ((paniced || yyshifts != 0) && yyrecover(ps, idfail)) { paniced = 0; ps = Ps; yystate = *ps; goto newstate; } /* * Find a state where 'error' is a * legal shift action. */ if (paniced && yyshifts <= 0 && ps >= panicps) { yypv =- (ps - panicps) + 1; #ifdef PXP yypw =- (ps - panicps) + 1; #endif ps = panicps - 1; } while (ps >= yys) { for (p = &yyact[ yypact[*ps+1] ] ; *p <= 0; p=+ 2) if (*p == -256) { panicps = ps; yystate= p[1] & 07777; yyOshifts = yyshifts; yyshifts = 0; paniced = 1; goto stack; } --ps; --yypv; #ifdef PXP --yypw; #endif #ifdef PI if (OY.Yychar != YID) syneflg++; #endif OY.Yychar = -1; } if (yychar == YEOF) yyunexeof(); if (yystate == 1) yyexeof(); yerror("Unrecoverable syntax error - QUIT"); return; } panic("yyparse"); } for (p = &yyact[ yypact[*ps+1] ] ; *p <= 0; p=+ 2) if (*p == -256)((cmd/pxp/yyprint.c 444 0 33 3737 2552606524 7305 static char *sccsid = "@(#)yyprint.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pi - Pascal interpreter code translator * * Charles Haley, Bill Joy UCB * Version 1.1 February 1978 * * * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.1 February 1978 */ #include "0.h" #include "yy.h" char *tokname(); int bounce; /* * Printing representation of a * "character" - a lexical token * not in a yytok structure. * 'which' indicates which char * you want * should always be called as "charname(...,0),charname(...,1)" */ char * charname(ch , which ) int ch; int which; { struct yytok Ych; Ych.Yychar = ch; Ych.Yylval = nullsem(ch); return (tokname(&Ych , which )); } /* * Printing representation of a token * 'which' as above. */ char * tokname(tp , which ) register struct yytok *tp; int which; { register char *cp; register struct kwtab *kp; char *cp2; cp2 = ""; switch (tp->Yychar) { case YCASELAB: cp = "case-label"; break; case YEOF: cp = "end-of-file"; break; case YILLCH: cp = "illegal character"; break; case 256: /* error token */ cp = "error"; break; case YID: cp = "identifier"; break; case YNUMB: cp = "real number"; break; case YINT: case YBINT: cp = "number"; break; case YSTRING: cp = tp->Yylval; cp = cp == NIL || cp[1] == 0 ? "character" : "string"; break; case YDOTDOT: cp = "'..'"; break; default: if (tp->Yychar < 256) { cp = "'x'\0'x'"; /* * for twice reentrant code! * used to be: * if (bounce = ((bounce + 1) & 1)) * cp += 4; * now: don't bounce unless 0th call */ if ( which == 0 ) bounce = ((bounce + 1) & 1); if (bounce) cp =+ 4; cp[1] = tp->Yychar; break; } for (kp = yykey; kp->kw_str != NIL && kp->kw_val != tp->Yychar; kp++) continue; cp = "keyword "; cp2 = kp->kw_str; } return ( which ? cp2 : cp ); } lt: if (tp->Yychar < 256) { cmd/pxp/yyput.c 444 0 33 12050 2552606524 6765 static char *sccsid = "@(#)yyput.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pi - Pascal interpreter code translator * * Charles Haley, Bill Joy UCB * Version 1.2 January 1979 * * * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 January 1979 */ #include "0.h" #include "tree.h" #include "yy.h" /* * Structure describing queued listing lines during the forward move * of error recovery. These lines will be stroed by yyoutline during * the forward move and flushed by yyoutfl or yyflush when an * error occurs or a program termination. */ struct B { int Bmagic; int Bline; int Bseekp; char *Bfile; int Bseqid; struct B *Bnext; } *bottled; /* * Filename gives the current input file, lastname is * the last filename we printed, and lastid is the seqid of the last line * we printed, to help us avoid printing * multiple copies of lines. */ extern char *filename; char *lastname; int lastid; char hadsome; char holdbl; /* * Print the current line in the input line * buffer or, in a forward move of the recovery, queue it for printing. */ yyoutline() { register struct B *bp; if (Recovery) { bp = tree(6, T_BOTTLE, yyline, yylinpt, filename, yyseqid); if (bottled != NIL) bp->Bnext = bottled->Bnext, bottled->Bnext = bp; else bp->Bnext = bp; bottled = bp; return; } yyoutfl(yyseqid); if (yyseqid != lastid) yyprline(charbuf, yyline, filename, yyseqid); } /* * Flush all the bottled output. */ yyflush() { yyoutfl(32767); } /* * Flush the listing to the sequence id toseqid */ yyoutfl(toseqid) int toseqid; { register struct B *bp; bp = bottled; if (bp == NIL) return; bp = bp->Bnext; while (bp->Bseqid <= toseqid) { yygetline(bp->Bfile, bp->Bseekp, bp->Bline, bp->Bseqid); if (bp->Bnext == bp) { bottled = NIL; break; } bp = bp->Bnext; bottled->Bnext = bp; } } int yygetunit -1; char *yygetfile; /* * Yysync guarantees that the line associated * with the current token was the last line * printed for a syntactic error message. */ yysync() { yyoutfl(yyeseqid); if (lastid != yyeseqid) yygetline(yyefile, yyseekp, yyeline, yyeseqid); } yySsync() { yyoutfl(OY.Yyeseqid); } /* * Yygetline gets a line from a file after we have * lost it. The pointer efile gives the name of the file, * seekp its offset in the file, and eline its line number. * If this routine has been called before the last file * it worked on will be open in yygetunit, with the files * name being given in yygetfile. Note that this unit must * be opened independently of the unit in use for normal i/o * to this file; if it were a dup seeks would seek both files. */ yygetline(efile, seekp, eline, eseqid) char *efile; int seekp, eline, eseqid; { register int cnt; register char *bp; char buf[CBSIZE + 1]; if (lastid == eseqid) return; if (eseqid == yyseqid) { bp = charbuf; yyprtd++; } else { bp = buf; if (efile != yygetfile) { close(yygetunit); yygetfile = efile; yygetunit = open(yygetfile, 0); if (yygetunit < 0) oops: perror(yygetfile), pexit(DIED); } if (lseek(yygetunit, (long)seekp, 0) < 0) goto oops; cnt = read(yygetunit, bp, CBSIZE); if (cnt < 0) goto oops; bp[cnt] = 0; } yyprline(bp, eline, efile, eseqid); } yyretrieve() { yygetline(OY.Yyefile, OY.Yyseekp, OY.Yyeline, OY.Yyeseqid); } /* * Print the line in the character buffer which has * line number line. The buffer may be terminated by a new * line character or a null character. We process * form feed directives, lines with only a form feed character, and * suppress numbering lines which are empty here. */ yyprline(buf, line, file, id) register char *buf; int line; char *file; int id; { lastid = id; if (buf[0] == '\f' && buf[1] == '\n') { printf("\f\n"); hadsome = 0; holdbl = 0; return; } if (holdbl) { putchar('\n'); holdbl = 0; } if (buf[0] == '\n') holdbl = 1; else { yysetfile(file); yyprintf(buf, line); } hadsome = 1; } yyprintf(cp, line) register char *cp; int line; { printf("%6d ", line); while (*cp != 0 && *cp != '\n') putchar(graphic(*cp++)); putchar('\n'); } graphic(ch) register CHAR ch; { switch (ch) { default: if (ch >= ' ') return (ch); case 0177: return ('?'); case '\n': case '\t': return (ch); } } extern int nopflg; char printed 1; /* * Set the current file name to be file, * printing the name, or a header on a new * page if required. */ yysetfile(file) register char *file; { #ifdef PXP if (nopflg == 1) return; #endif if (lastname == file) return; if (file == filename && opt('n') && (printed & 02) == 0) { printed =| 02; header(); } else yyputfn(file); lastname = file; } /* * Put out an include file name * if an error occurs but the name has * not been printed (or if another name * has been printed since it has). */ yyputfn(cp) register char *cp; { extern int outcol; if (cp == lastname && printed) return; lastname = cp; printed = 1; #ifdef PXP if (outcol) putchar('\n'); #endif printf("%s:\n", cp); hadsome = 1; } return; if (file == filename && opt('n') && (printed & 02) == 0) { printed =| 02; header(); } else yyputfn(file); lastname = file; } /* * Put out an include file name * if an error occurs but the name has * not been printed (or if another name * has been printed since it has). */ yyputfn(cp) register char *cp; { extern int outcol; if (cp == lastname && printed) return; lastname = cp; printed = 1; #ifdef PXP if (outcol) putchar('\n'); #endicmd/pxp/yyrecover.c 444 0 33 46727 2552606525 7645 static char *sccsid = "@(#)yyrecover.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pi - Pascal interpreter code translator * * Charles Haley, Bill Joy UCB * Version 1.1 February 1978 * * * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.1 February 1978 */ #include "0.h" #include "yy.h" /* * Very simplified version of Graham-Rhodes error recovery * method for LALR parsers. Backward move is embodied in * default reductions of the yacc parser until an error condition * is reached. Forward move is over a small number of input tokens * and cannot "condense". The basic corrections are: * * 1) Delete the input token. * * 2) Replace the current input with a legal input. * * 3) Insert a legal token. * * All corrections are weighted, considered only if they allow * at least two shifts, and the cost of a correction increases if * it allows shifting over only a part of the lookahead. * * Another error situation is that which(( occurs when an identifier "fails" * a reduction because it is not the required "class". * In this case, we also consider replacing this identifier, which has * already been shifted over, with an identifier of the correct class. * * Another correction performed here is unique symbol insertion. * If the current state admits only one input, and no other alternative * correction presents itself, then that symbol will be inserted. * There is a danger in this of looping, and it is handled * by counting true shifts over input (see below). * * * A final class of corrections, considered only when the error * occurred immediately after a shift over a terminal, involves * the three basic corrections above, but with the point of error * considered to be before this terminal was shifted over, effectively * "unreading" this terminal. This is a feeble attempt at elimination * of the left-right bias and because "if" has a low weight and some * statements are quite simple i.e. * * cse ch of ... * * we can get a small number of errors. The major deficiency of * this is that we back up only one token, and that the forward * move is over a small number of tokens, often not enough to really * tell what the input should be, e.g. in * * a[i] > a[i - 1] ... * * In such cases a bad identifier (misspelled keyword) or omitted * keyword will be change or inserted as "if" as it has the lowest cost. * This is not terribly bad, as "if"s are most common. * This also allows the correction of other errors. * * This recovery depends on the default reductions which delay * noticing the error until the parse reaches a state where the * relevant "alternatives" are visible. Note that it does not * consider tokens which will cause reductions before being * shifted over. This requires the grammar to be written in a * certain way for the recovery to work correctly. * In some sense, also, the recovery suffers because we have * LALR(1) tables rather than LR(1) tables, e.g. in * * if rec.field < rec2,field2 then */ /* * Definitions of possible corrective actions */ #define CPANIC 0 #define CDELETE 1 #define CREPLACE 2 #define CINSERT 3 #define CUNIQUE 4 #define CCHIDENT 5 /* * Multiplicative cost factors for corrective actions. * * When an error occurs we take YCSIZ - 1 look-ahead tokens. * If a correction being considered will shift over only part of * that look-ahead, it is not completely discarded, but rather * "weighted", its cost being multiplied by a weighting factor. * For a correction to be considered its weighted cost must be less * than CLIMIT. * * Non-weighted costs are considered: * * LOW <= 3 * MEDIUM 4,5 * HIGH >= 6 * * CURRENT WEIGHTING STRATEGY: Aug 20, 1977 * * For all kinds of corrections we demand shifts over two symbols. * Corrections have high weight even after two symbol * shifts because the costs for deleting and inserting symbols are actually * quite low; we do not want to change weighty symbols * on inconclusive evidence. * * The weights are the same after the third look ahead. * This prevents later, unrelated errors from causing "funny" * biases of the weights toward one type of correction. * * Current look ahead is 5 symbols. */ /*** CLIMIT is defined in yy.h for yycosts ***/ #define CPRLIMIT 50 #define CCHIDCOST 3 char insmult[8] = {INFINITY, INFINITY, INFINITY, 15, 8, 6, 3, 1}; char repmult[7] = {INFINITY, INFINITY, INFINITY, 8, 6, 3, 1}; char delmult[6] = {INFINITY, INFINITY, INFINITY, 6, 3, 1}; #define NOCHAR -1 #define Eprintf if (errtrace) printf #define Tprintf if (testtrace) printf /* * Action arrays of the parser needed here */ int yyact[], yypact[], *yypv; /* * Yytips is the tip of the stack when using * the function loccor to check for local * syntactic correctness. As we don't want * to copy the whole parser stack, but want * to simulate parser moves, we "split" * the parser stack and keep the tip here. */ #define YYTIPSIZ 16 int yytips[YYTIPSIZ], yytipct; int yytipv[YYTIPSIZ]; /* * The array YC saves the lookahead tokens for the * forward moves. * Yccnt is the number of tokens in the YC array. */ #define YCSIZ 6 int yCcnt; struct yytok YC0[YCSIZ + 1]; struct yytok *YC; /* * YCps gives the top of stack at * the point of error. */ char yyunique = 1; STATIC unsigned yyTshifts; /* * Cact is the corrective action we have decided on * so far, ccost its cost, and cchar the associated token. * Cflag tells if the correction is over the previous input token. */ int cact, ccost, cchar, cflag; /* * ACtok holds the token under * consideration when examining * the lookaheads in a state. */ struct yytok ACtok; #define acchar ACtok.Yychar #define aclval ACtok.Yylval /* * Make a correction to the current stack which has * top of stack pointer Ps. */ yyrecover(Ps0, idfail) int *Ps0, idfail; { register int c, i; int yyrwant, yyrhave; #ifdef PI Recovery = 1; #endif YC = &YC0[1]; #ifdef DEBUG if (errtrace) { setpfx('p'); yerror("Point of error"); printf("States %d %d ...", Ps0[0], Ps0[-1]); if (idfail) printf(" [Idfail]"); putchar('\n'); printf("Input %s%s", tokname(&Y , 0) , tokname(&Y , 1)); } #endif /* * We first save the current input token * and its associated semantic information. */ if (yychar < 0) yychar = yylex(); copy(&YC[0], &Y, sizeof Y); /* * Set the default action and cost */ cact = CPANIC, ccost = CLIMIT, cflag = 0; /* * Peek ahead */ for (yCcnt = 1; yCcnt < YCSIZ; yCcnt++) { yychar = yylex(); copy(&YC[yCcnt], &Y, sizeof YC[0]); #ifdef DEBUG Eprintf(" | %s%s", tokname(&YC[yCcnt] , 0 ) , tokname(&YC[yCcnt] , 1 )); #endif } #ifdef DEBUG Eprintf("\n"); #endif /* * If we are here because a reduction failed, try * correcting that. */ if (idfail) { /* * Save the particulars about * the kind of identifier we want/have. */ yyrwant = yyidwant; yyrhave = yyidhave; #ifdef DEBUG Tprintf(" Try Replace %s identifier with %s identifier cost=%d\n", classes[yyidhave], classes[yyidwant], CCHIDCOST); #endif /* * Save the semantics of the ID on the * stack, and null them out to free * up the reduction in question. */ i = yypv[0]; yypv[0] = nullsem(YID); c = correct(NOCHAR, 0, CCHIDCOST, &repmult[2], Ps0, yypv); yypv[0] = i; #ifdef DEBUG if (c < CPRLIMIT || fulltrace) Eprintf("Cost %2d Replace %s identifier with %s identifier\n", c, classes[yyrhave], classes[yyrwant]); #endif if (c < ccost) cact = CCHIDENT, ccost = c, cchar = YID; } /* * First try correcting the state we are in */ trystate(Ps0, yypv, 0, &insmult[1], &delmult[1], &repmult[1]); /* * Now, if we just shifted over a terminal, try * correcting it. */ if (OY.Yychar != -1 && OY.Yylval != nullsem(OY.Yychar)) { YC--; copy(&YC[0], &OY, sizeof YC[0]); trystate(Ps0 - 1, yypv - 1, 1, insmult, delmult, repmult); if (cflag == 0) YC++; else { yypv--; #ifdef PXP yypw--; #endif Ps0--; yCcnt++; } } /* * Restoring the first look ahead into * the scanner token allows the error message * routine to print the error message with the text * of the correct line. */ copy(&Y, &YC[0], sizeof Y); /* * Unique symbol insertion. * * If there was no reasonable correction found, * but only one input to the parser is acceptable * we report that, and try it. * * Special precautions here to prevent looping. * The number of true inputs shifted over at the point * of the last unique insertion is recorded in the * variable yyTshifts. If this is not less than * the current number in yytshifts, we do not insert. * Thus, after one unique insertion, no more unique * insertions will be made until an input is shifted * over. This guarantees termination. */ if (cact == CPANIC && !idfail) { register int *ap; ap = &yyact[yypact[*Ps0 + 1]]; if (*ap == -ERROR) ap =+ 2; if (ap[0] <= 0 && ap[2] > 0) { cchar = -ap[0]; if (cchar == YEOF) yyexeof(); if (cchar != ERROR && yyTshifts < yytshifts) { cact = CUNIQUE; #ifdef DEBUG Eprintf("Unique symbol %s%s\n", charname(cchar)); #endif /* * Note that the inserted symbol * will not be counted as a true input * (i.e. the "yytshifts--" below) * so that a true shift will be needed * to make yytshifts > yyTshifts. */ yyTshifts = yytshifts; } } } /* * Set up to perform the correction. * Build a token appropriate for replacement * or insertion in the yytok structure ACchar * having the attributes of the input at the * point of error. */ copy(&ACtok, &YC[0], sizeof ACtok); acchar = cchar; aclval = nullsem(acchar); if (aclval != NIL) recovered(); switch (cact) { /* * Panic, just restore the * lookahead and return. */ case CPANIC: setpfx('E'); if (idfail) { copy(&Y, &OY, sizeof Y); if (yyrhave == NIL) { #ifdef PI if (yybaduse(yypv[0], yyeline, ISUNDEF) == NIL) #endif yerror("Undefined identifier"); } else { yerror("Improper %s identifier", classes[yyrhave]); #ifdef PI yybaduse(yypv[0], yyeline, NIL); #endif } /* * Suppress message from panic routine */ yyshifts = 1; } i = 0; /* Note that on one path we dont touch yyshifts ! */ break; /* * Delete the input. * Mark this as a shift over true input. * Restore the lookahead starting at * the second token. */ case CDELETE: if (ccost != 0) yerror("Deleted %s%s", tokname(&YC[0] , 0 ) , tokname(&YC[0] , 1 )); yytshifts++; i = 1; yyshifts = 0; break; /* * Replace the input with a new token. */ case CREPLACE: if (acchar == YEOF) yyexeof(); if (acchar == YEND) aclval = NIL; yerror("Replaced %s%s with a %s%s", tokname(&YC[0] , 0 ), tokname(&YC[0] , 1 ), tokname(&ACtok , 0 ), tokname(&ACtok , 1 )); copy(&YC[0], &ACtok, sizeof YC[0]); i = 0; yyshifts = 0; break; /* * Insert a token. * Don't count this token as a true input shift. * For inserted "end"s pas.y is responsible * for the error message later so suppress it. * Restore all(( the lookahead. */ case CINSERT: if (acchar == YEOF) yyexeof(); if (acchar != YEND) yerror("Inserted %s%s", tokname(&ACtok , 0 ), tokname(&ACtok , 1 )); yytshifts--; i = 0; yyshifts = 0; break; /* * Make a unique symbol correction. * Like an insertion but a different message. */ case CUNIQUE: setpfx('E'); yerror("Expected %s%s", tokname(&ACtok , 0 ), tokname(&ACtok , 1 )); yytshifts--; i = 0; if (ccost == 0 || yyunique) yyshifts = 0; else yyshifts = -1; break; /* * Change an identifier's type * to make it work. */ case CCHIDENT: copy(&Y, &OY, sizeof Y); #ifdef PI i = 1 << yyrwant; #endif if (yyrhave == NIL) { yerror("Undefined %s", classes[yyrwant]); #ifdef PI i =| ISUNDEF; #endif } else yerror("Replaced %s id with a %s id", classes[yyrhave], classes[yyrwant]); #ifdef PI yybaduse(yypv[0], yyeline, i); #endif yypv[0] = nullsem(YID); i = 0; yyshifts = 0; break; } /* * Restore the desired portion of the lookahead, * and possibly the inserted or unique inserted token. */ for (yCcnt--; yCcnt >= i; yCcnt--) unyylex(&YC[yCcnt]); if (cact == CINSERT || cact == CUNIQUE) unyylex(&ACtok); /* * Put the scanner back in sync. */ yychar = yylex(); /* * We succeeded if we didn't "panic". */ Recovery = 0; Ps = Ps0; return (cact != CPANIC); } yyexeof() { yerror("End-of-file expected - QUIT"); pexit(ERRS); } yyunexeof() { yerror("Unexpected end-of-file - QUIT"); pexit(ERRS); } /* * Try corrections with the state at Ps0. * Flag is 0 if this is the top of stack state, * 1 if it is the state below. */ trystate(Ps0, Pv0, flag, insmult, delmult, repmult) int *Ps0, *Pv0, flag; char *insmult, *delmult, *repmult; { /* * C is a working cost, ap a pointer into the action * table for looking at feasible alternatives. */ register int c, *ap; int i, *actions; #ifdef DEBUG Eprintf("Trying state %d\n", *Ps0); #endif /* * Try deletion. * Correct returns a cost. */ #ifdef DEBUG Tprintf(" Try Delete %s%s cost=%d\n", tokname(&YC[0] , 0 ), tokname(&YC[0] , 1 ), delcost(YC[0].Yychar)); #endif c = delcost(YC[0].Yychar); #ifndef DEBUG if (c < ccost) { #endif c = correct(NOCHAR, 1, c, delmult, Ps0, Pv0); #ifdef DEBUG if (c < CPRLIMIT || fulltrace) Eprintf("Cost %2d Delete %s%s\n", c, tokname(&YC[0] , 0 ), tokname(&YC[0] , 1 )); #endif if (c < ccost) cact = CDELETE, ccost = c, cflag = flag; #ifndef DEBUG } #endif /* * Look at the inputs to this state * which will cause parse action shift. */ aclval = NIL; ap = &yyact[yypact[*Ps0 + 1]]; /* * Skip action on error to * detect true unique inputs. * Error action is always first. */ if (*ap == -ERROR) ap=+ 2; /* * Loop through the test actions * for this state. */ for (actions = ap; *ap <= 0; ap =+ 2) { /* * Extract the token of this action */ acchar = -*ap; /* * Try insertion */ #ifdef DEBUG Tprintf(" Try Insert %s%s cost=%d\n", charname(acchar), inscost(acchar)); #endif c = inscost(acchar, YC[0].Yychar); #ifndef DEBUG if (c < ccost) { #endif if (c == 0) { c = correct(acchar, 0, 1, insmult + 1, Ps0, Pv0); #ifdef DEBUG Eprintf("Cost %2d Freebie %s%s\n", c, charname(acchar)); #endif if (c < ccost) cact = CUNIQUE, ccost = 0, cchar = acchar, cflag = flag; } else { c = correct(acchar, 0, c, insmult, Ps0, Pv0); #ifdef DEBUG if (c < CPRLIMIT || fulltrace) Eprintf("Cost %2d Insert %s%s\n", c, charname(acchar)); #endif if (c < ccost) cact = CINSERT, ccost = c, cchar = acchar, cflag = flag; } #ifndef DEBUG } #endif /* * Try replacement */ #ifdef DEBUG Tprintf(" Try Replace %s%s with %s%s cost=%d\n", tokname(&YC[0] , 0 ), tokname(&YC[0] , 1 ), charname(acchar , 0 ), charname(acchar , 1 ), repcost(YC[0].Yychar, acchar)); #endif c = repcost(YC[0].Yychar, acchar); #ifndef DEBUG if (c < ccost) { #endif c = correct(acchar, 1, repcost(YC[0].Yychar, acchar), repmult, Ps0, Pv0); #ifdef DEBUG if (c < CPRLIMIT || fulltrace) Eprintf("Cost %2d Replace %s%s with %s%s\n", c, tokname(&YC[0] , 0 ), tokname(&YC[0] , 1 ), tokname(&ACtok , 0 ), tokname(&ACtok , 1 )); #endif if (c < ccost) cact = CREPLACE, ccost = c, cchar = acchar, cflag = flag; #ifndef DEBUG } #endif } } int *yCpv; char yyredfail; /* * The ntok structure is used to build a * scanner structure for tokens inserted * from the argument "fchar" to "correct" below. */ static struct yytok ntok; /* * Compute the cost of a correction * C is the base cost for it. * Fchar is the first input character from * the current state, NOCHAR if none. * The rest of the inputs come from the array * YC, starting at origin and continuing to the * last character there, YC[yCcnt - 1].Yychar. * * The cost returned is INFINITE if this correction * allows no shifts, otherwise is weighted based * on the number of shifts this allows against the * maximum number possible with the available lookahead. */ correct(fchar, origin, c, multvec, Ps0, Pv0) register int fchar, c; int origin; char *multvec; int *Ps0, *Pv0; { register char *mv; /* * Ps is the top of the parse stack after the most * recent local correctness check. Loccor returns * NIL when we cannot shift. */ register int *ps; yyredfail = 0; /* * Initialize the tip parse and semantic stacks. */ ps = Ps0; yytips[0] = *ps; ps--; yytipv[0] = Pv0[0]; yCpv = Pv0 - 1; yytipct = 1; /* * Shift while possible. * Adjust cost as necessary. */ mv = multvec; do { if (fchar != NOCHAR) { copy(&ntok, &YC[0], sizeof ntok); ntok.Yychar = fchar, ntok.Yylval = nullsem(fchar); fchar = NOCHAR; ps = loccor(ps, &ntok); } else ps = loccor(ps, &YC[origin++]); if (ps == NIL) { if (yyredfail && mv > multvec) mv--; c =* *mv; break; } mv++; } while (*mv != 1); return (c); } extern int yygo[], yypgo[], yyr1[], yyr2[]; /* * Local syntactic correctness check. * The arguments to this routine are a * top of stack pointer, ps, and an input * token tok. Also, implicitly, the contents * of the yytips array which contains the tip * of the stack, and into which the new top * state on the stack will be placed if we shift. * * If we succeed, we return a new top of stack * pointer, else we return NIL. */ loccor(ps, ntok) int *ps; struct yytok *ntok; { register int *p, n; register int nchar; int i; if (ps == NIL) return (NIL); nchar = ntok->Yychar; yyeline = ntok->Yyeline; #ifdef DEBUG Tprintf(" Stack "); for (i = yytipct - 1; i >= 0; i--) Tprintf("%d ", yytips[i]); Tprintf("| %d, Input %s%s\n", *ps, charname(nchar)); #endif /* * As in the yacc parser yyparse, * p traces through the action list * and "n" is the information associated * with the action. */ newstate: p = &yyact[ yypact[yytips[yytipct - 1]+1] ]; actn: /* * Search the parse actions table * for something useful to do. * While n is non-positive, it is the * arithmetic inverse of the token to be tested. * This allows a fast check. */ while ((n = *p++) <= 0) if ((n =+ nchar) != 0) p++; switch (n >> 12) { /* * SHIFT */ case 2: n =& 07777; yyredfail = 0; if (nchar == YID) yyredfail++; if (yytipct == YYTIPSIZ) { tipover: #ifdef DEBUG Tprintf("\tTIP OVFLO\n"); #endif return (NIL); } yytips[yytipct] = n; yytipv[yytipct] = ntok->Yylval; yytipct++; #ifdef DEBUG Tprintf("\tShift to state %d\n", n); #endif return (ps); /* * REDUCE */ case 3: n =& 07777; if (yyEactr(n, yytipv[yytipct - 1]) == 0) { #ifdef DEBUG Tprintf("\tYyEactr objects: have %s id, want %s id\n", classes[yyidhave], classes[yyidwant]); #endif return (NIL); } yyredfail = 0; i = yyr2[n]; #ifdef DEBUG Tprintf("\tReduce, length %d,", i); #endif if (i > yytipct) { i =- yytipct; yytipct = 0; ps =- i; yCpv =- i; } else yytipct =- i; if (yytipct >= YYTIPSIZ) goto tipover; /* * Use goto table to find next state */ p = &yygo[yypgo[yyr1[n]]]; i = yytipct ? yytips[yytipct - 1] : *ps; while (*p != i && *p >= 0) p =+ 2; #ifdef DEBUG Tprintf(" new state %d\n", p[1]); #endif yytips[yytipct] = p[1]; yytipct++; goto newstate; /* * ACCEPT */ case 4: #ifdef DEBUG Tprintf("\tAccept\n"); #endif return (ps); /* * ERROR */ case 1: #ifdef DEBUG Tprintf("\tError\n"); #endif return (0); } panic("loccor"); } goto tipover; /* * Use goto tabcmd/pxp/yyseman.c 444 0 33 1646 2552606525 7252 static char *sccsid = "@(#)yyseman.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pi - Pascal interpreter code translator * * Charles Haley, Bill Joy UCB * Version 1.2 January 1979 * * * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 January 1979 */ #include "0.h" #include "yy.h" /* * Assign semantics to a generated token * * Most terminals have a semantic value the current * input line. If they are generated they are flagged * by having this number negated. * * The terminals which have true semantics such * as identifiers and strings are instead given * semantic value NIL here - we do not attempt * to do repair, e.g. by giving generated integers * the value 1, etc. */ nullsem(ch) int ch; { switch (ch) { case YID: case YINT: case YNUMB: case YBINT: case YSTRING: return (NIL); default: return (-yyeline); } } als have a semantic value the current * input line. If they are generated they are flagg((cmd/pxp/yytree.c 444 0 33 5534 2552606525 7106 static char *sccsid = "@(#)yytree.c 1.1 (Berkeley) 3/2/81"; /* Copyright (c) 1979 Regents of the University of California */ # /* * pxp - Pascal execution profiler * * Bill Joy UCB * Version 1.2 January 1979 */ #include "0.h" #include "tree.h" extern int *spacep; /* * LIST MANIPULATION ROUTINES * * The grammar for Pascal is written left recursively. * Because of this, the portions of parse trees which are to resemble * lists are in the somewhat inconvenient position of having * the nodes built from left to right, while we want to eventually * have as semantic value the leftmost node. * We could carry the leftmost node as semantic value, but this * would be inefficient as to add a new node to the list we would * have to chase down to the end. Other solutions involving a head * and tail pointer waste space. * * The simple solution to this apparent dilemma is to carry along * a pointer to the leftmost node in a list in the rightmost node * which is the current semantic value of the list. * When we have completed building the list, we can retrieve this * left end pointer very easily; neither adding new elements to the list * nor finding the left end is thus expensive. As the bottommost node * has an unused next pointer in it, no space is wasted either. * * The nodes referred to here are of the T_LISTPP type and have * the form: * * T_LISTPP some_pointer next_element * * Here some_pointer points to the things of interest in the list, * and next_element to the next thing in the list except for the * rightmost node, in which case it points to the leftmost node. * The next_element of the rightmost node is of course zapped to the * NIL pointer when the list is completed. * * Thinking of the lists as tree we heceforth refer to the leftmost * node as the "top", and the rightmost node as the "bottom" or as * the "virtual root". */ /* * Make a new list */ newlist(new) register int *new; { if (new == NIL) return (NIL); return (tree3(T_LISTPP, new, spacep)); } /* * Add a new element to an existing list */ addlist(vroot, new) register int *vroot; int *new; { register int *top; if (new == NIL) return (vroot); if (vroot == NIL) return (newlist(new)); top = vroot[2]; vroot[2] = spacep; return (tree3(T_LISTPP, new, top)); } /* * Fix up the list which has virtual root vroot. * We grab the top pointer and return it, zapping the spot * where it was so that the tree is not circular. */ fixlist(vroot) register int *vroot; { register int *top; if (vroot == NIL) return (NIL); top = vroot[2]; vroot[2] = NIL; return (top); } /* * Set up a T_VAR node for a qualified variable. * Init is the initial entry in the qualification, * or NIL if there is none. */ setupvar(var, init) char *var; register int *init; { if (init != NIL) init = newlist(init); return (tree4(T_VAR, NOCON, var, init)); } and return it, zapping the spot * where it was so that the tree is not circular. */ fixlist(vroot) register int *vroot; { register int *top; if (vroot == NIL)cmd/ratfor/ 775 0 33 0 2552560375 6021 cmd/ratfor/Makefile 644 0 33 607 2254361357 7525 CFLAGS = -O ratfor: r0.o r1.o r2.o rio.o rlook.o rlex.o y.tab.o cc r*.o y.tab.o -o ratfor r0.o: r.h y.tab.h r0.c r1.o: r.h y.tab.h r1.c r2.o: r.h y.tab.h r2.c rio.o: r.h y.tab.h rio.c rlook.o: r.h y.tab.h rlook.c rlex.o: r.h y.tab.h rlex.c y.tab.c: r.g yacc -d r.g y.tab.h: r.g yacc -d r.g install: ratfor install -s ratfor $(DESTDIR)/usr/bin clean: rm -f y.tab.c *.o ratfor y.tab.h was hat the / C. /,"cmd/ratfor/r.g 644 0 33 2312 2111463474 6504 %{ extern int transfer; extern int indent; %} %term IF ELSE FOR WHILE BREAK NEXT %term DIGITS DO %term GOK DEFINE INCLUDE %term REPEAT UNTIL %term RETURN %term SWITCH CASE DEFAULT %% statl : statl stat | ; stat : if stat ={ indent--; outcont($1); } | ifelse stat ={ indent--; outcont($1+1); } | switch fullcase '}' ={ endsw($1, $2); } | while stat ={ whilestat($1); } | for stat ={ forstat($1); } | repeat stat UNTIL ={ untils($1,1); } | repeat stat ={ untils($1,0); } | BREAK ={ breakcode(); } | NEXT ={ nextcode(); } | do stat ={ dostat($1); } | GOK ={ gokcode($1); } | RETURN ={ retcode(); } | ';' | '{' statl '}' | label stat | error ={ errcode(); yyclearin; } ; switch : sw '{' ; sw : SWITCH ={ swcode(); } ; fullcase: caselist ={ $$ = 0; } | caselist defpart ={ $$ = 1; } ; caselist: casepart | caselist casepart ; defpart : default statl ; default : DEFAULT ={ getdefault(); } ; casepart: case statl ; case : CASE ={ getcase(); } ; label : DIGITS ={ transfer = 0; outcode($1); } ; if : IF ={ ifcode(); } ; ifelse : if stat ELSE ={ elsecode($1); } ; while : WHILE ={ whilecode(); } ; for : FOR ={ forcode(); } ; repeat : REPEAT ={ repcode(); } ; do : DO ={ docode(); } ; %% : SWITCH ={ swcode(); } ; fullcase: caselist ={ $$ = 0; } | caselist defpart ={ $$ = 1; } ; caselist: casepart | caselist casepart ; defpart : default statl ; default : DEFAULT ={ getdefault(); } ; casepart: case statl ; case : CASE ={ getcase(); } ; label : DIGITS ={ transfer = 0; outcode($1); } ;cmd/ratfor/r.h 644 0 33 2225 2111463474 6510 #include #include "y.tab.h" # #define putbak(c) *ip++ = c /* #define getchr() (ip>ibuf?*--ip: getc(infile[infptr])) */ #define LET 1 #define DIG 2 #define CRAP 3 #define COMMENT '#' #define QUOTE '"' extern int transfer; #define INDENT 3 /* indent delta */ #ifdef gcos #define CONTFLD 6 #endif #ifdef unix #define CONTFLD 1 #endif extern int contfld; /* column for continuation char */ extern int contchar; extern int dbg; extern int yyval; extern int *yypv; extern int yylval; extern int errorflag; extern char comment[]; /* save input comments here */ extern int comptr; /* next free slot in comment */ extern int printcom; /* print comments, etc., if on */ extern int indent; /* level of nesting for indenting */ extern char ibuf[]; extern char *ip; extern FILE *outfil; /* output file id */ extern FILE *infile[]; extern char *curfile[]; extern int infptr; extern int linect[]; extern char fcname[]; extern int svargc; extern char **svargv; #define EOS 0 #define HSHSIZ 101 struct nlist { char *name; char *def; int ydef; struct nlist *next; }; struct nlist *lookup(); char *install(); char *malloc(); extern char *fcnloc; extern char type[]; tc., if on */ extern int indent; /* level of nesting for indenting */ extern char ibuf[]; extern char *ip; extern FILE *outfil; /* output file id */ extern FILE *infile[]; extern char *curfile[]; extern int infptr; extern int linect[]; extern char fcname[]; extern int svargc; extern char **svargv; #define EOS 0 #define HSHSIZ 101 struct nlist { char *namecmd/ratfor/r0.c 644 0 33 2607 2111463474 6567 #include "r.h" int swlevel = -1; int swexit[5]; int nextcase[5]; swcode() { transfer = 0; putcom("switch"); swlevel++; if (swlevel >= 5) error("Switches nested > 5"); swexit[swlevel] = yyval = genlab(1); outcode("\tI"); outnum(yyval); outcode(" = "); balpar(); outdon(); nextcase[swlevel] = 0; indent++; } getcase() { int t, lpar; char token[100]; if (nextcase[swlevel] != 0) { outgoto(swexit[swlevel]); outcont(nextcase[swlevel]); } indent--; outcode("\tif(.not.("); do { outcode((("I"); outnum(swexit[swlevel]); outcode(".eq.("); lpar = 0; do { if ((t=gtok(token)) == ':') break; if (t == '(') lpar++; else if (t == ')') lpar--; else if (t == ',') { if (lpar == 0) break; } outcode(token); } while (lpar >= 0); if (lpar < 0) error("Missing left parenthesis in case"); if (t == ',') outcode(").or."); } while (t != ':'); if (lpar != 0) error("Missing parenthesis in case"); outcode(")))"); nextcase[swlevel] = genlab(1); outgoto(nextcase[swlevel]); indent++; } getdefault() { char token[20]; if (gnbtok(token) != ':') error("Missing colon after default"); outgoto(swexit[swlevel]); outcont(nextcase[swlevel]); indent--; putcom("default"); indent++; } endsw(n, def) { if (def == 0) outcont(nextcase[swlevel]); swlevel--; if (swlevel < -1) error("Switches unwound too far"); indent--; outcont(n); } != ':'); if (lpar != 0) error("Missing parenthesis in case"); outcode(")))"); nextcase[swlevel] = genlab(1); outgotcmd/ratfor/r1.c 644 0 33 14023 2111463474 6603 #include "r.h" #define wasbreak brkused[brkptr]==1 || brkused[brkptr]==3 #define wasnext brkused[brkptr]==2 || brkused[brkptr]==3 int transfer = 0; /* 1 if just finished retrun, break, next */ char fcname[10]; char scrat[500]; int brkptr = -1; int brkstk[10]; /* break label */ int typestk[10]; /* type of loop construct */ int brkused[10]; /* loop contains BREAK or NEXT */ int forptr = 0; char *forstk[10]; repcode() { transfer = 0; outcont(0); putcom("repeat"); yyval = genlab(3); indent++; outcont(yyval); brkstk[++brkptr] = yyval+1; typestk[brkptr] = REPEAT; brkused[brkptr] = 0; } untils(p1,un) int p1,un; { outnum(p1+1); outtab(); if (un > 0) { outcode("if(.not."); balpar(); outcode(")"); } transfer = 0; outgoto(p1); indent--; if (wasbreak) outcont(p1+2); brkptr--; } ifcode() { transfer = 0; outtab(); outcode("if(.not."); balpar(); outcode(")"); outgoto(yyval=genlab(2)); indent++; } elsecode(p1) { outgoto(p1+1); indent--; putcom("else"); indent++; outcont(p1); } whilecode() { transfer = 0; outcont(0); putcom("while"); brkstk[++brkptr] = yyval = genlab(2); typestk[brkptr] = WHILE; brkused[brkptr] = 0; outnum(yyval); outtab(); outcode("if(.not."); balpar(); outcode(")"); outgoto(yyval+1); indent++; } whilestat(p1) int p1; { outgoto(p1); indent--; putcom("endwhile"); outcont(p1+1); brkptr--; } balpar() { register c, lpar; while ((c=gtok(scrat)) == ' ' || c == '\t') ; if (c != '(') { error("missing left paren"); return; } outcode(scrat); lpar = 1; do { c = gtok(scrat); if (c==';' || c=='{' || c=='}' || c==EOF) { pbstr(scrat); break; } if (c=='(') lpar++; else if (c==')') lpar--; else if (c == '\n') { while ((c = gtok(scrat)) == ' ' || c=='\t' || c=='\n') ; pbstr(scrat); continue; } else if (c == '=' && scrat[1] == '\0') error("assigment inside conditional"); outcode(scrat); } while (lpar > 0); if (lpar != 0) error("missing parenthesis"); } int labval = 23000; genlab(n){ labval += n; return(labval-n); } gokcode(p1) { transfer = 0; outtab(); outcode(p1); eatup(); outdon(); } eatup() { int t, lpar; char temp[100]; lpar = 0; do { if ((t = gtok(scrat)) == ';' || t == '\n') break; if (t == '{' || t == '}' || t == EOF) { pbstr(scrat); break; } if (t == ',' || t == '+' || t == '-' || t == '*' || t == '(' || t == '&' || t == '|' || t == '=') { while (gtok(temp) == '\n') ; pbstr(temp); } if (t == '(') lpar++; else if (t==')') { lpar--; if (lpar < 0) { error("missing left paren"); return(1); } } outcode(scrat); } while (lpar >= 0); if (lpar > 0) { error("missing right paren"); return(1); } return(0); } forcode(){ int lpar, t; char *ps, *qs; transfer = 0; outcont(0); putcom("for"); yyval = genlab(3); brkstk[++brkptr] = yyval+1; typestk[brkptr] = FOR; brkused[brkptr] = 0; forstk[forptr++] = malloc(1); if ((t = gnbtok(scrat)) != '(') { error("missing left paren in FOR"); pbstr(scrat); return; } if (gnbtok(scrat) != ';') { /* real init clause */ pbstr(scrat); outtab(); if (eatup() > 0) { error("illegal FOR clause"); return; } outdon(); } if (gnbtok(scrat) == ';') /* empty condition */ outcont(yyval); else { /* non-empty condition */ pbstr(scrat); outnum(yyval); outtab(); outcode("if(.not.("); for (lpar=0; lpar >= 0;) { if ((t = gnbtok(scrat)) == ';') break; if (t == '(') lpar++; else if (t == ')') { lpar--; if (lpar < 0) { error("missing left paren in FOR clause"); return; } } if (t != '\n') outcode(scrat); } outcode("))"); outgoto(yyval+2); if (lpar < 0) error("invalid FOR clause"); } ps = scrat; for (lpar=0; lpar >= 0;) { if ((t = gtok(ps)) == '(') lpar++; else if (t == ')') lpar--; if (lpar >= 0 && t != '\n') while(*ps) ps++; } *ps = '\0'; qs = forstk[forptr-1] = malloc((unsigned)(ps-scrat+1)); ps = scrat; while (*qs++ = *ps++) ; indent++; } forstat(p1) int p1; { char *bp, *q; bp = forstk[--forptr]; if (wasnext) outnum(p1+1); if (nonblank(bp)){ outtab(); outcode(bp); outdon(); } outgoto(p1); indent--; putcom("endfor"); outcont(p1+2); for (q=bp; *q++;); free(bp); brkptr--; } retcode() { register c; if ((c = gnbtok(scrat)) != '\n' && c != ';' && c != '}') { pbstr(scrat); outtab(); outcode(fcname); outcode(" = "); eatup(); outdon(); } else if (c == '}') pbstr(scrat); outtab(); outcode("return"); outdon(); transfer = 1; } docode() { transfer = 0; outtab(); outcode("do "); yyval = genlab(2); brkstk[++brkptr] = yyval; typestk[brkptr] = DO; brkused[brkptr] = 0; outnum(yyval); eatup(); outdon(); indent++; } dostat(p1) int p1; { outcont(p1); indent--; if (wasbreak) outcont(p1+1); brkptr--; } #ifdef gcos #define atoi(s) (*s-'0') /* crude!!! */ #endif breakcode() { int level, t; level = 0; if ((t=gnbtok(scrat)) == DIG) level = atoi(scrat) - 1; else if (t != ';') pbstr(scrat); if (brkptr-level < 0) error("illegal BREAK"); else { outgoto(brkstk[brkptr-level]+1); brkused[brkptr-level] |= 1; } transfer = 1; } nextcode() { int level, t; level = 0; if ((t=gnbtok(scrat)) == DIG) level = atoi(scrat) - 1; else if (t != ';') pbstr(scrat); if (brkptr-level < 0) error("illegal NEXT"); else { outgoto(brkstk[brkptr-level]); brkused[brkptr-level] |= 2; } transfer = 1; } nonblank(s) char *s; { int c; while (c = *s++) if (c!=' ' && c!='\t' && c!='\n') return(1); return(0); } int errorflag = 0; error(s1) char *s1; { if (errorflag == 0) fprintf(stderr, "ratfor:"); fprintf(stderr, "error at line %d, file %s: ",linect[infptr],curfile[infptr]); fprintf(stderr, s1); fprintf(stderr, "\n"); errorflag = 1; } errcode() { int c; if (errorflag == 0) fprintf(stderr, "******\n"); fprintf(stderr, "*****F ratfor:"); fprintf(stderr, "syntax error, line %d, file %s\n", linect[infptr], curfile[infptr]); while ((c=getchr())!=';' && c!='}' && c!='\n' && c!=EOF && c!='\0') ; if (c == EOF || c == '\0') putbak(c); errorflag = 1; } lag == 0) fprintf(stderr, "ratfor:"); fprintf(stderr, "error at line %d, file %s: ",linect[infptr],curfile[infptr]); fprintf(stderr, s1); fprintf(stderr, "\n"); errorflag = 1; } errcode() { int c; if (errorflag == 0) fprintf(stderr, "******\n"); fprintf(stderr, "*****F ratfor:"); fprintf(stderr, "syntax error, line %d, file %s\n", linect[infptr], curfile[infptr]); while ((c=getchr())!=';' && c!='}' && c!='\n' && c!=EOF && c!='\0') ; if (c == EOF || c == '\0') putbak(c);cmd/ratfor/r2.c 644 0 33 5733 2111463474 6574 #include "r.h" extern int hollerith; char outbuf[80]; int outp = 0; int cont = 0; int contchar = '&'; char comment[320]; int comptr = 0; int indent = 0; outdon() { outbuf[outp] = '\0'; if (outp > 0) fprintf(outfil, "%s\n", outbuf); outp = cont = 0; } putcom(s) char *s; { if (printcom) { ptc('c'); outtab(); pts(s); outdon(); } } outcode(xp) char *xp; { register c, c1, j; char *q, *p; p = (char *) xp; /* shut lint up */ if (cont == 0 && comptr > 0) /* flush comment if not on continuation */ flushcom(); while( (c = *p++) ){ c1 = *p; if (type[c] == LET || type[c] == DIG) { pts(p-1); break; } switch(c){ case '"': case '\'': j = 0; for (q=p; *q; q++) { if (*q == '\\') q++; j++; } if (outp+j+2 > 71) contcard(); if (hollerith) { outnum(--j); ptc('h'); } else ptc(c); while (*p != c) { if (*p == '\\') p++; ptc(*p++); } if (!hollerith) ptc(c); p++; break; case '$': case '\\': if (strlen(p-1)+outp > 71) contcard(); if (c1 == '"' || c1 == '\'') { ptc(c1); p++; } else for (p--; *p; p++) ptc(*p); break; case '%': outp = 0; while (*p) ptc(*p++); break; case '>': if( c1=='=' ){ pts(".ge."); p++; } else pts(".gt."); break; case '<': if( c1=='=' ){ pts(".le."); p++; } else if( c1=='>' ){ pts(".ne."); p++; } else pts(".lt."); break; case '=': if( c1=='=' ){ pts(".eq."); p++; } else ptc('='); brea((k; case '!': case '^': if( c1=='=' ){ pts(".ne."); p++; } else pts(".not."); break; case '&': if( c1=='&' ) p++; pts(".and."); break; case '|': if( c1=='|' ) p++; pts(".or."); break; case '\t': outtab(); break; case '\n': ptc(' '); break; default: ptc(c); break; } } } ptc(c) char c; { if( outp > 71 ) contcard(); outbuf[outp++] = c; } pts(s) char *s; { if (strlen(s)+outp > 71) contcard(); while(*s) ptc(*s++); } contcard(){ int n; outbuf[outp] = '\0'; fprintf(outfil, "%s\n", outbuf); n = 6; if (printcom) { n += INDENT * indent + 1; if (n > 35) n = 35; } for( outp=0; outp 19) error("more than 19 continuation cards"); } outtab(){ int n; n = 6; if (printcom) { n += INDENT * indent; if (n > 35) n = 35; } while (outp < n) ptc(' '); } outnum(n) int n; { int a; if( a = n/10 ) outnum(a); ptc(n%10 + '0'); } outcont(n) int n; { transfer = 0; if (n == 0 && outp == 0) return; if( n > 0 ) outnum(n); outcode("\tcontinue"); outdon(); } outgoto(n) int n; { if (transfer != 0) return; outcode("\tgoto "); outnum(n); outdon(); } flushcom() { int i, j; if (printcom == 0) comptr = 0; else if (cont == 0 && comptr > 0) { for (i=j=0; i < comptr; i++) if (comment[i] == '\n') { comment[i] = '\0'; fprintf(outfil, "%s\n", &comment[j]); j = i + 1; } comptr = 0; } } ptc(n%10 + '0'); } outcont(n) int ncmd/ratfor/rio.c 644 0 33 7614 2263362335 7044 #include "r.h" char ibuf[BUFSIZ]; char *ip = ibuf; char type[] = { 0, CRAP, CRAP, CRAP, CRAP, CRAP, CRAP, CRAP, CRAP, '\t', '\n', CRAP, CRAP, CRAP, CRAP, CRAP, CRAP, CRAP, CRAP, CRAP, CRAP, CRAP, CRAP, CRAP, CRAP, CRAP, CRAP, CRAP, CRAP, CRAP, CRAP, CRAP, ' ', '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/', DIG, DIG, DIG, DIG, DIG, DIG, DIG, DIG, DIG, DIG, ':', ';', '<', '=', '>', '?', '@', LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, '[', '\\', ']', '^', '_', '`', LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, LET, '{', '|', '}', '~', 0, }; gtok(s) char *s; { /* get token into s */ register c, t; register char *p; struct nlist *q; for(;;) { p = s; *p++ = c = getchr(); switch(t = type[c]) { case 0: if (infptr > 0) { fclose(infile[infptr]); infptr--; continue; } if (svargc > 1) { svargc--; svargv++; if (infile[infptr] != stdin) fclose(infile[infptr]); if( (infile[infptr] = fopen(*svargv,"r")) == NULL ) cant(*svargv); linect[infptr] = 0; curfile[infptr] = *svargv; continue; } return(EOF); /* real eof */ case ' ': case '\t': while ((c = getchr()) == ' ' || c == '\t') ; /* skip others */ if (c == COMMENT || c == '_') { putbak(c); continue; } if (c != '\n') { putbak(c); *p = '\0'; return(' '); } else { *s = '\n'; *(s+1) = '\0'; return(*s); } case '_': while ((c = getchr()) == ' ' || c == '\t') ; if (c == COMMENT) { putbak(c); gtok(s); /* recursive */ } else if (c != '\n') putbak(c); continue; case LET: case DIG: while ((t=type[*p = getchr()]) == LET || t == DIG) p++; putbak(*p); *p = '\0'; if ((q = lookup(s))->name != NULL && q->ydef == 0) { /* found but not keyword */ if (q->def != fcnloc) { /* not "function" */ pbstr(q->def); continue; } getfname(); /* recursive gtok */ } for (p=s; *p; p++) if (*p>='A' && *p<='Z') *p += 'a' - 'A'; for (p=s; *p; p++) if (*p < '0' || *p > '9') return(LET); return(DIG); case '[': *p = '\0'; return('{'); case ']': *p = '\0'; return('}'); case '$': case '\\': if ((*p = getchr()) == '(' || *p == ')') { putbak(*p=='(' ? '{' : '}'); continue; } if (*p == '"' || *p == '\'') p++; else putbak(*p); *p = '\0'; return('$'); case COMMENT: comment[comptr++] = 'c'; while ((comment[comptr++] = getchr()) != '\n') ; flushcom(); *s = '\n'; *(s+1) = '\0'; return(*s); case '"': case '\'': for (; (*p = getchr()) != c; p++) { if (*p == '\\') *++p = getchr(); if (*p == '\n') { error("missing quote"); putbak('\n'); break; } } *p++ = c; *p = '\0'; return(QUOTE); case '%': while ((*p = getchr()) != '\n') p++; putbak(*p); *p = '\0'; return('%'); case '>': case '<': case '=': case '!': case '^': return(peek(p, '=')); case '&': return(peek(p, '&')); case '|': return(peek(p, '|')); case CRAP: continue; default: *p = '\0'; return(*s); } } } gnbtok(s) char *s; { register c; while ((c = gtok(s)) == ' ' || c == '\t') ; return(c); } getfname() { while (gtok(fcname) == ' ') ; pbstr(fcname); putbak(' '); } peek(p, c1) char *p, c1; { register c; c = *(p-1); if ((*p = getchr()) == c1) p++; else putbak(*p); *p = '\0'; return(c); } pbstr(str) register char *str; { register char *p; p = str; while (*p++); --p; if (ip >= &ibuf[BUFSIZ]) { error("pushback overflow"); exit(1); } while (p > str) putbak(*--p); } getchr() { register c; if (ip > ibuf) return(*--ip); c = getc(infile[infptr]); if (c == '\n') linect[infptr]++; if (c == EOF) return(0); return(c); } me); putbak(' '); } peek(p, c1) char *p, c1; { register c; c = *(p-1); if ((*p = getchr()) == c1) p++; else cmd/ratfor/rlex.c 644 0 33 10112 2111463474 7226 # include "r.h" char *keyword [] = { "do", "if", "else", "for", "repeat", "until", "while", "break", "next", "define", "include", "return", "switch", "case", "default", 0}; int keytran[] = { DO, IF, ELSE, FOR, REPEAT, UNTIL, WHILE, BREAK, NEXT, DEFINE, INCLUDE, RETURN, SWITCH, CASE, DEFAULT, 0}; char *fcnloc; /* spot for "function" */ int svargc; char **svargv; char *curfile[10] = { "" }; int infptr = 0; FILE *outfil = { stdout }; FILE *infile[10] = { stdin }; int linect[10]; int contfld = CONTFLD; /* place to put continuation char */ int printcom = 0; /* print comments if on */ int hollerith = 0; /* convert "..." to 27H... if on */ #ifdef gcos char *ratfor "tssrat"; int bcdrat[2]; char *bwkmeter ". bwkmeter "; int bcdbwk[5]; #endif main(argc,argv) int argc; char **argv; { int i; while(argc>1 && argv[1][0]=='-') { if(argv[1][1]=='6') { contfld=6; if (argv[1][2]!='\0') contchar = argv[1][2]; } else if (argv[1][1] == 'C') printcom++; else if (argv[1][1] == 'h') hollerith++; argc--; argv++; } #ifdef gcos if (!intss()) { _fixup(); ratfor = "batrat"; } ascbcd(ratfor,bcdrat,6); ascbcd(bwkmeter,bcdbwk,24); acdata(bcdrat[0],1); acupdt(bcdbwk[0]); if (!intss()) { if ((infile[infptr]=fopen("s*", "r")) == NULL) cant("s*"); if ((outfil=fopen("*s", "w")) == NULL) cant("*s"); } #endif svargc = argc; svargv = argv; if (svargc > 1) putbak('\0'); for (i=0; keyword[i]; i++) install(keyword[i], "", keytran[i]); fcnloc = install("function", "", 0); yyparse(); #ifdef gcos if (!intss()) bexit(errorflag); #endif exit(errorflag); } #ifdef gcos bexit(status) { /* this is the batch version of exit for gcos tss */ FILE *inf, *outf; char c; fclose(stderr); /* make sure diagnostics get flushed */ if (status) /* abort */ _nogud(); /* good: copy output back to s*, call forty */ fclose(outfil,"r"); fclose(infile[0],"r"); inf = fopen("*s", "r"); outf = fopen("s*", "w"); while ((c=getc(inf)) != EOF) putc(c, outf); fclose(inf,"r"); fclose(outf,"r"); __imok(); } #endif cant(s) char *s; { linect[infptr] = 0; curfile[infptr] = s; error("can't open"); exit(1); } inclstat() { int c; char *ps; char fname[100]; while ((c = getchr()) == ' ' || c == '\t'); if (c == '(') { for (ps=fname; (*ps=getchr()) != ')'; ps++); *ps = '\0'; } else if (c == '"' || c == '\'') { for (ps=fname; (*ps=getchr()) != c; ps++); *ps = '\0'; } else { putbak(c); for (ps=fname; (*ps=getchr()) != ' ' &&*ps!='\t' && *ps!='\n' && *ps!=';'; ps++); *ps = '\0'; } if ((infile[++infptr] = fopen(fname,"r")) == NULL) { cant(fname); exit(1); } linect[infptr] = 0; curfile[infptr] = fname; } char str[500]; int nstr; yylex() { int c, t; for (;;) { while ((c=gtok(str))==' ' || c=='\n' || c=='\t') ; yylval = c; if (c==';' || c=='{' || c=='}') return(c); if (c==EOF) return(0); yylval = (int) str; if (c == DIG) return(DIGITS); t = lookup(str)->ydef; if (t==DEFINE) defstat(); else if (t==INCLUDE) inclstat(); else if (t > 0) return(t); else return(GOK); } } int dbg = 0; yyerror(p) char *p; {;} defstat() { int c,i,val,t,nlp; extern int nstr; extern char str[]; while ((c=getchr())==' ' || c=='\t'); if (c == '(') { t = '('; while ((c=getchr())==' ' || c=='\t'); putbak(c); } else { t = ' '; putbak(c); } for (nstr=0; c=getchr(); nstr++) { if (type[c] != LET && type[c] != DIG) break; str[nstr] = c; } putbak(c); str[nstr] = '\0'; if (c != ' ' && c != '\t' &&(( c != '\n' && c != ',') { error("illegal define statement"); return; } val = nstr+1; if (t == ' ') { while ((c=getchr())==' ' || c=='\t'); putbak(c); for (i=val; (c=getchr())!='\n' && c!='#' && c!='\0'; i++) str[i] = c; putbak(c); } else { while ((c=getchr())==' ' || c=='\t' || c==',' || c=='\n'); putbak(c); nlp = 0; for (i=val; nlp>=0 && (c=str[i]=getchr()); i++) if (c == '(') nlp++; else if (c == ')') nlp--; i--; } for ( ; i>0; i--) if (str[i-1] != ' ' && str[i-1] != '\t') break; str[i] = '\0'; install(str, &str[val], 0); } } val = nstr+1; if (t == ' ') { while ((c=getchr())==' ' || c=='\t'); putbak(c); for (i=val; (c=getchr())!='\n' && c!='#' && c!='\0'; i++) str[i] = c; putbak(c); } else { while ((c=getchr())==' ' || c=='\t' || c==',' || c=='\n'); putbak(c); nlp = 0; for (i=val; nlp>=0 && (c=str[i]=getchr()); i++) if (c == '(') nlp++; else if (c == ')') nlp--; i--; } for ( ; i>0; i--) if (str[i-1] != ' ' && stcmd/ratfor/rlook.c 644 0 33 2135 2111463474 7370 #define NULL 0 #define EOS 0 #define HSHSIZ 101 struct nlist { char *name; char *def; int ydef; struct nlist *next; }; struct nlist *hshtab[HSHSIZ]; struct nlist *lookup(); char *install(); char *malloc(); char *copy(); int hshval; struct nlist *lookup(str) char *str; { register char *s1, *s2; register struct nlist *np; static struct nlist nodef; s1 = str; for (hshval = 0; *s1; ) hshval += *s1++; hshval %= HSHSIZ; for (np = hshtab[hshval]; np!=NULL; np = np->next) { s1 = str; s2 = np->name; while (*s1++ == *s2) if (*s2++ == EOS) return(np); } return(&nodef); } char *install(nam, val, tran) char *nam, *val; int tran; { register struct nlist *np; if ((np = lookup(nam))->name == NULL) { np = (struct nlist *)malloc(sizeof(*np)); np->name = copy(nam); np->def = copy(val); np->ydef = tran; np->next = hshtab[hshval]; hshtab[hshval] = np; return(np->def); } free(np->def); np->def = copy(val); return(np->def); } char *copy(s) register char *s; { register char *p, *s1; p = s1 = (char *) malloc((unsigned)strlen(s)+1); while (*s1++ = *s++); return(p); } install(nam, val, tran) char *nam, *val; int tran; { register struct nlist *np; if ((np = lookup(nam))->name == NULL) { np = (struct nlist *)malloc(sizeof(*np)); np->name = copy(nam); np->def = copy(val); np->ydef = tran; np->next = hshtab[hshval]; hshtab[hshval] = np; return(np->def); } free(np->def); np->def = copy(val); return(np->def); } char *copy(s) register char *s; { register char *p, cmd/refer/ 775 0 33 0 2552561131 5616 cmd/refer/Makefile 644 0 33 3370 2111463476 7350 DESTDIR= CFLAGS = -O all: mkey inv hunt refer mkey: mkey1.o mkey2.o mkey3.o deliv2.o cc mkey?.o deliv2.o -o mkey inv: inv1.o inv2.o inv3.o inv5.o inv6.o deliv2.o cc inv?.o deliv2.o -o inv hunt: hunt1.o hunt2.o hunt3.o hunt5.o hunt6.o hunt7.o glue5.o hunt: refer3.o hunt9.o shell.o deliv2.o hunt8.o glue4.o cc hunt?.o refer3.o glue5.o glue4.o shell.o deliv2.o -o hunt deliv: deliv1.o deliv2.o cc deliv?.o -o deliv refpart: refer0.o refer1.o refer2.o refer3.o refer4.o refer5.o refpart: refer6.o refer7.o refer8.o deliv2.o glue4.o cc refer?.o deliv2.o glue4.o -o refpart refer0.o: refer..c refer1.o: refer..c refer2.o: refer..c refer3.o: refer..c refer4.o: refer..c refer6.o: refer..c refer: glue1.o refer1.o refer2.o refer4.o refer5.o refer6.o mkey3.o refer: refer7.o refer8.o hunt2.o hunt3.o deliv2.o hunt5.o hunt6.o hunt8.o refer: glue3.o hunt7.o hunt9.o glue2.o glue4.o glue5.o refer0.o shell.o cc glue?.o refer[01245678].o hunt[2356789].o mkey3.o shell.o deliv2.o -o refer refer-test: /usr/bin/refer test >junk1a refer test >junk1b if cmp -s junk1a junk1b; then echo ok; else echo bad; fi /usr/bin/refer -e test >junk1a refer -e test >junk1b if cmp -s junk1a junk1b; then echo ok; else echo bad; fi /usr/bin/refer -s test >junk1a refer -s test >junk1b if cmp -s junk1a junk1b; then echo ok; else echo bad; fi /usr/bin/refer -s -l test >junk1a refer -s -l test >junk1b if cmp -s junk1a junk1b; then echo ok; else echo bad; fi rm junk1a junk1b whatabout: what1.o what2.o what3.o what4.o shell.o mkey3.o cc what?.o shell.o mkey3.o -o whatabout install: all install -s refer $(DESTDIR)/usr/bin install -s inv $(DESTDIR)/usr/lib/refer install -s hunt $(DESTDIR)/usr/lib/refer install -s mkey $(DESTDIR)/usr/lib/refer clean: rm -f refer inv hunt mkey *.o if cmp -s junk1a junk1b; then echo ok; else echo bad; fi /usr/bin/refer -s -l test >junk1a refer -s -l test >junk1b if cmp -s junk1a junk1b; then echo ok; else echo bad; fi rm junk1a junk1b whatabout: what1.o what2.o what3.o what4.o shell.o mkey3.o cc what?cmd/refer/deliv1.c 644 0 33 1327 2111463476 7240 # include "stdio.h" main(argc,argv) char *argv[]; { /* goes from file:begin,l to actual characters */ char line[750], *p, name[100]; FILE *fa NULL; long lp; int len; if (argc>1 && argv[1] && argv[1][0]) chdir (argv[1]); name[0]=""; while (gets(line)) { if (line[0]=='$' && line[1]=='$') { chdir(line+2); continue; } for(p=line; *p!= ':'; p++) ; *p++ = 0; sscanf(p, "%ld,%d", &lp, &len); if (p==line) fa = stdin; else if (strcmp (name, line) != 0) { if (fa != NULL) fclose(fa); fa = fopen(line, "r"); if (fa == NULL) err("Can't open %s", line); strcpy(name, line); } if (fa != NULL) { fseek (fa, lp, 0); fread (line, 1, len, fa); line[len] = 0; fputs(line, stdout); } } } gv[1]); name[0]=""; while (gets(line)) { if (line[0]=='$' && line[1]=='$') { chdir(line+2); continue; } for(p=line; *p!= ':'; p++) ; *p++ = 0; sscanf(p, "%ld,%d", &lp, &len); if (p==line) fa = stdin; else if (strcmp (name, line) != 0) { if (fa != NULL) fclose(fa); facmd/refer/deliv2.c 644 0 33 1166 2111463476 7242 # include "stdio.h" hash (s) char *s; { int c, n; for(n=0; c= *s; s++) n += (c*n+ c << (n%4)); return(n>0 ? n : -n); } err (s, a) char *s; { fprintf(stderr, "Error: "); fprintf(stderr, s, a); putc('\n', stderr); exit(1); } prefix(t, s) char *t, *s; { int c, d; while ( (c= *t++) == *s++) if (c==0) return(1); return(c==0 ? 1: 0); } char * mindex(s, c) char *s; { register char *p; for( p=s; *p; p++) if (*p ==c) return(p); return(0); } zalloc(m,n) { int t; # if D1 fprintf(stderr, "calling calloc for %d*%d bytes\n",m,n); # endif t = calloc(m,n); # if D1 fprintf(stderr, "calloc returned %o\n", t); # endif return(t); } } err (s, a) char *s; { fprintf(stderr, "Error: "); fprintf(stderr, s, a); putc('\n', stderr); exit(1); } prefix(t, s) char *t, *s; { int c, d; while ( (c= *t++) == *s++) if (c==0) return(1); return(c==0 ? 1: 0); } char * mindex(s, c) char *s; { register char *p; for( p=s; *p; p++) if (*p ==c) return(p); return(0); } zalloc(m,n) { int t; # if D1 fprintf(stderr, "calling calloc for %cmd/refer/flagger.c 644 0 33 4214 2111463476 7461 # include "stdio.h" char wds[100][40]; int synwd[100]; int mark[100]; int justw 0; extern int comcount; int blank[100]; int wdp, wdf; int bl; int sargc; char **sargv; FILE *inf; main(argc,argv) char *argv[]; { int i; while (--argc && **++argv== '-') switch(argv[0][1]) { case 'w': justw=1; break; case 'c': comcount=atoi(argv[0]+2); break; } wdp=wdf=0; if (argc>0) { argc--; inf = fopen(argv[0], "r"); if (inf==NULL) exit(0); argv++; } else inf=stdin; sargc=argc; sargv= argv; while ( gw (wds[w((dp = next(wdp)], &bl)) { blank[wdp] = bl; mark[wdp]=0; synwd[wdp] = common(upcase(wds[wdp])); if (common(sstrip(upcase(wds[wdp])))) synwd[wdp]=1; if (allpunct(wds[wdp])) synwd[wdp]=1; if (strlen(wds[wdp])<3) synwd[wdp]=1; if (synwd[wdp]==1) { for(i=wdp; i!=wdf; i=prev(i)) { if (synwd[i]>0) continue; mark[i]=1; break; } } } if (wdp<0) return(0); i=wdf -1; i = next(i); while (i != wdp) i= next(i); } next(i) { int j; j = (i+1) % 100; if (j==wdf) { if (justw==0) { if (mark[j] ) putchar('*'); printf("%s",wds[j]); if (blank[j]) putchar(' '); } else if (mark[j]) printf("%s\n", wds[j]); wdf = (wdf+1)%100; } return(j); } prev(i) { i = (i-1)%100; return(i); } allpunct(s) char *s; { int c; while (c = *s++) if (isalpha(c)) return(0); return(1); } gw(s, b) char *s; int *b; { int c, type, nt; c = getc(inf); while (c==EOF) { fclose(inf); inf=NULL; if (sargc-->0) { inf = fopen ( *sargv++, "r"); } if (inf==NULL) return(0); c = getc(inf); } *s++ = c; type = isalpha(c) || isdigit(c); while ( (c = getc(inf)) != EOF ) { nt = isalpha(c) || isdigit(c); if (nt==type) *s++= c; else break; } *s=0; if (c== ' ') { *b = 1; return(1); } while (c==EOF) { fclose(inf); inf=NULL; if (sargc-- > 0) { inf= fopen( *sargv++, "r"); } if (inf==NULL) return(0); c = getc(inf); } ungetc(c, inf); *b=0; return(1); } trimnl(s) char *s; { while (*s) s++; if (*--s=='\n') *s=0; } upcase(s) char *s; { static char buf[100]; strcpy (buf, s); for(s=buf; *s; s++) if (isupper(*s)) *s = *s-'A'+'a'; return(buf); } sstrip(s) char *s; { char *p ; p=s; while (*s) s++; if (*--s=='s') *s=0; return(p); } ; } *s=0; if (c== ' ') { *b = 1; return(1); } while (c==EOF) { fclose(inf); inf=NULL; if (sargc-- > 0) { inf= fopen( *sargv++, "r"); } if (inf==NULL) return(0); c = getc(inf); } ungetc(c, inf); *b=0; return(1); } trimnl(s) char *s; { while (*s) s++; if (*--s=='\n') *s=0; } upcase(s) char *s; { static char buf[100]; strcpy (buf, s); for(s=buf; *s; s++)cmd/refer/glue1.c 644 0 33 12630 2111463476 7110 # include "stdio.h" # define unopen(fil) {if (fil!=NULL) {fclose(fil); fil=NULL;}} extern char refdir[]; int lmaster = 1000; int reached = 0; FILE *fd = 0; int *hfreq, hfrflg; int colevel = 0; static union firetruck {unsigned *a; long *b;} master; int iflong; extern char *fgnames[], **fgnamp; extern FILE *iopen(); char *todir(); int prfreqs = 0; int typeindex = 0; char usedir[100]; static int full = 1000; static int tags = 0; char *sinput, *soutput, *tagout; long indexdate = 0, gdate(); int soutlen = 1000; int taglen = 1000; huntmain(argc,argv) char *argv[]; { /* read query from stdin, expect name of indexes in argv[1] */ static FILE *fa, *fb, *fc; char indexname[100], *qitem[100], *rprog = 0; char grepquery[200]; static char oldname[30] ; static int nhash = 0; static int maxhash = 0; int falseflg = 0, nitem, nfound, frtbl; static long *hpt = 0; # if D1 fprintf(stderr, "in glue1 argc %d argv %o %o\n", argc, argv[0],argv[1]); # endif savedir(); while (argv[1][0] == '-') { # if D1 fprintf(stderr, "argv.1 is %s\n",argv[1]); # endif switch(argv[1][1]) { case 'a': /* all output, incl. false drops */ falseflg = 1; break; case 'r': argc--; argv++; rprog = argv[1]; break; case 'F': /* put out full text */ full = setfrom(argv[1][2]); break; case 'T': /* put out tags */ tags = setfrom(argv[1][2]); break; case 'i': /* input in argument string */ argc--; argv++; sinput = argv[1]; break; case 's': /*text output to string */ case 'o': argc--; argv++; soutput = argv[1]; if (argv[2]<16000) { soutlen = argv[2]; argc--; argv++; } break; case 't': /*tag output to string */ argc--; argv++; tagout = argv[1]; if (argv[2]<16000) { taglen = argv[2]; argc--; argv++; } break; case 'l': /* specify length of lists */ argc--; argv++; lmaster = atoi(argv[1]); # if D1 fprintf(stderr, "lmaster now %d\n",lmaster); # endif break; case 'C': argc--; argv++; colevel = atoi(argv[1]); break; } argc--; argv++; } strcpy (indexname, todir(argv[1])); # if D1 fprintf(stderr, "in huntmain indexname %s typeindex %d\n", indexname, typeindex); # endif if (typeindex == 0 || strcmp (oldname, indexname) !=0) { strcpy (oldname, indexname); unopen(fa); unopen(fb); unopen(fc); if (ckexist(indexname, ".ib")) { # if D1 fprintf(stderr, "found old index\n"); # endif fa = iopen(indexname, ".ia"); fb = iopen(indexname, ".ib"); fc = iopen(indexname, ".ic"); typeindex =1; # if D1 fprintf(stderr, "opened f's as %o %o %o\n",fa,fb,fc); # endif indexdate = gdate(fb); fread (&nhash, sizeof(nhash), 1, fa); fread (&iflong, sizeof(iflong), 1, fa); if (nhash > maxhash) { if (hpt) free (hpt, maxhash, sizeof(*hpt)); hpt=0; if (hfreq) free(hfreq, maxhash, sizeof(*hfreq)); hfreq=0; maxhash=nhash; # if D1 fprintf(stderr, "Freed if needed maxhash %d\n",maxhash); # endif } if (hpt==0) hpt = zalloc(nhash, sizeof(*hpt)); # if D1 fprintf(stderr, "hpt now %o\n",hpt); # endif if (hpt == NULL) err ("No space for hash list (%d)", nhash); fread( hpt, sizeof(*hpt), nhash, fa); if (hfreq==0) hfreq=zalloc(nhash, sizeof(*hfreq)); if (hfreq==NULL) err ("No space for hash frequencies (%d)", nhash); frtbl = fread(hfreq, sizeof(*hfreq), nhash, fa); hfrflg = (frtbl == nhash); # if D1 fprintf(stderr,"Read pointer files\n"); # endif if (master.a == NULL) if (iflong) master.b = zalloc(lmaster, sizeof(long)); else master.a = zalloc(lmaster, sizeof(int)); if (master.a == NULL) err ("no space for answer list",0); } else if (makefgrep(indexname)) typeindex=2; else { err ("No files %s\n",indexname); exit(1); } } # if D1 fprintf(stderr, "typeindex now %d\n",typeindex); # endif tagout[0]=0; if (typeindex==2) { grepcall(sinput, tagout, indexname); # if D1 fprintf(stderr, " back from grepcall\n"); # endif restodir(); return; } nitem = getq(qitem); # if D1 fprintf(stderr, "approaching doquery fb %o\n", fb); # endif nfound = doquery(hpt, nhash, fb, nitem, qitem, master); # ifdef D1 fprintf(stderr, "return from doquery with nfound %d\n", nfound); # endif if (falseflg == 0) nfound = baddrop(master, nfound, fc, nitem, qitem, rprog, full); # ifdef D1 fprintf(stderr, "after baddrop with nfound %d\n",nfound); fprintf(stderr, "tagout is /%s/, sout /%s/\n",tagout, soutput); # endif if (tags) result (master, nfound >tags ? tags : nfound, fc); # if D1 fprintf(stderr, "done with huntmain\n"); fprintf(stderr, "tagout is /%s/\n", tagout); fprintf(stderr, "string out is /%s/\n", soutput); # endif if (fgnamp>fgnames) { char **fgp; int k; # if D1 fprintf(stderr, "were %d bad files\n", fgnamp-fgnames); # endif grepquery[0]=0; for(k=0; k=t && *s != '/') s--; if (s ALEN) err("abuff not big enough %d", strlen(abuff)); argc = 6; huntmain (argc,argv); return(0); } dodeliv(in, out, arg, outlen) char *in, *out, *arg; { # if D1 fprintf(stderr, "in dodeliv, arg /%s/\n", arg?arg:""); # endif if (arg && arg[0]) chdir(arg); findline(in, out, outlen, 0L); restodir(); } "-i"; argv[2] = in; argv[3] = "-t"; argv[4] = out; argv[5] = outlen; argv[6] = "-T"; argv[7] = "-F1";cmd/refer/glue4.c 644 0 33 3441 2111463476 7073 # include "stdio.h" # include "ctype.h" grepcall (in, out, arg) char *in, *out, *arg; { char line[200], *s, argig[100], *cv[50]; char *inp, inb[500]; extern char gfile[]; FILE *qf, *gf; int c, oldc = 0, alph = 0, nv = 0; int sv0, sv1; strcpy (argig, arg); strcat(argig, ".ig"); strcpy (inp=inb, in); if (gfile[0]==0) sprintf(gfile, "/tmp/rj%dg", getpid()); # if D1 fprintf(stderr, "in grepcall, gfile %s in %o out %o\n", gfile,in,out); # endif for(cv[nv++] = "fgrep"; c = *inp; inp++) { if (c== ' ') c = *inp = 0; else if (isupper(c)) *inp = tolower(c); alph = (c==0) ? 0 : alph+1; if (alph == 1) cv[nv++] = inp; if (alph > 6) *inp = 0; oldc=c; } # if D1 fprintf(stderr, "%d args set up\n", nv); # endif { sv0 = dup(0); close(0); if (open (argig, 0) != 0) err("Can't read fgrep index %s", argig); sv1 = dup(1); close(1); if (creat(gfile, 0666) != 1) err("Can't write fgrep output %s", gfile); fgrep(nv, cv); # if D1 fprintf(stderr, "fgrep returned, output is..\n"); # endif close (0); dup(sv0); close(sv0); close (1); dup(sv1); close(sv1); } # if D1 fprintf(stderr, "back from fgrep\n"); # endif gf = fopen(gfile, "r"); if (gf==NULL) err("can't read fgrep output %s", gfile); while (fgets(line, 100, gf) == line) { line[100]=0; # if D1 fprintf(stderr, "read line as //%s//\n",line); # endif for(s=line; *s && (*s != '\t'); s++); if (*s == '\t') { *s++ = '\n'; *s++ = 0; } if (line[0]) strcat(out, line); # if D1 fprintf(stderr, "out now /%s/\n",out); # endif while (*s) s++; # if D1 fprintf(stderr, "line %o s %o s-1 %o\n",line,s,s[-1]); # endif if (s[-1]!= '\n') while (!feof(gf) && getc(gf)!= '\n') ; } fclose(gf); # if D1 fprintf(stderr, "back from reading %, out %s\n",out); # else unlink (gfile); # endif return(0); } clfgrep() { if (gfile[0]) unlink(gfile); } ,line); # endif for(s=line; *s && (*s != '\t'); s++); if (*s == '\t') { *s++ = '\n'; *s++ = 0; } if (line[0]) strcat(out, line); # if D1 fprintf(stderr, "out now /%s/\n",out); # endif while (*s) s++; # if D1 fcmd/refer/glue5.c 644 0 33 14726 2263363007 7121 # include "stdio.h" # include "ctype.h" /* * fgrep -- print all lines containing any of a set of keywords * * status returns: * 0 - ok, and some matches * 1 - ok, but no matches * 2 - some error */ #define MAXSIZ 700 #define QSIZE 400 struct words { char inp; char out; struct words *nst; struct words *link; struct words *fail; } *www, *smax, *q; char buf[2*BUFSIZ]; int nsucc; int need; char *instr; int inct; int rflag; int xargc; char **xargv; int numwords; int nfound; static int flag = 0; fgrep(argc, argv) char **argv; { instr = nsucc = need = inct = rflag = numwords = nfound = 0; flag = 0; if (www==0) www = zalloc(MAXSIZ, sizeof (*www)); if (www==NULL) err("Can't get space for machines", 0); for (q=www; qinp =0; q->out =0; q->nst =0; q->link =0; q->fail =0; } xargc = argc-1; xargv = argv+1; while (xargc>0 && xargv[0][0]=='-') { switch(xargv[0][1]) { case 'r': /* return value only */ rflag++; break; case 'n': /* number of answers needed */ need = xargv[1]; xargv++; xargc--; break; case 'i': instr = xargv[1]; inct = xargv[2]+2; # if D2 fprintf(stderr,"inct %d xargv.2. %o %d\n",inct, xargv[2],xargv[2]); # endif xargv += 2; xargc -= 2; break; } xargv++; xargc--; } if (xargc<=0) { write (2, "bad fgrep call\n", 15); exit(2); } # if D1 fprintf(stderr, "before cgoto\n"); # endif cgotofn(); # if D1 fprintf(stderr, "before cfail\n"); # endif cfail(); # if D1 fprintf(stderr, "before execute instr %.20s\n", instr? instr: ""); fprintf(stderr, "end of string %d %c %c %c\n", inct, instr[inct-3], instr[inct-2], instr[inct-1]); # endif execute(); # if D1 fprintf(stderr, "returning nsucc %d\n", nsucc); fprintf(stderr, "fgrep done www %o\n",www); # endif return(nsucc == 0); } execute() { register char *p; register struct words *c; register ch; register ccount; int f; char *nlp; f=0; ccount = instr ? inct : 0; nfound=0; p = instr ? instr : buf; if (need == 0) need = numwords; nlp = p; c = www; # if D2 fprintf(stderr, "in execute ccount %d inct %d\n",ccount, inct ); # endif for (;;) { # if D3 fprintf(stderr, "down ccount\n"); # endif if (--ccount <= 0) { # if D2 fprintf(stderr, "ex loop ccount %d instr %o\n",ccount, instr); # endif if (instr) break; if (p == &buf[2*BUFSIZ]) p = buf; if (p > &buf[BUFSIZ]) { if ((ccount = read(f, p, &buf[2*BUFSIZ] - p)) <= 0) break; } else if ((ccount = read(f, p, BUFSIZ)) <= 0) break; # if D2 fprintf(stderr, " normal read %d bytres\n", ccount); {char xx[20]; sprintf(xx, "they are %%.%ds\n", ccount); fprintf(stderr, xx, p); } # endif } nstate: ch = *p; # if D2 fprintf(stderr, "roaming along in ex ch %c c %o\n",ch,c); # endif if (isupper(ch)) ch |= 040; if (c->inp == ch) { c = c->nst; } else if (c->link != 0) { c = c->link; goto nstate; } else { c = c->fail; if (c==0) { c = www; istate: if (c->inp == ch) { c = c->nst; } else if (c->link != 0) { c = c->link; goto istate; } } else goto nstate; } if (c->out && new (c)) { # if D2 fprintf(stderr, " found: nfound %d need %d\n",nfound,need); # endif if (++nfound >= need) { # if D1 fprintf(stderr, "found, p %o nlp %o ccount %d buf %o buf[2*BUFSIZ] %o\n",p,nlp,ccount,buf,buf+2*BUFSIZ); # endif if (instr==0) while (*p++ != '\n') { # if D3 fprintf(stderr, "down ccount2\n"); # endif if (--ccount <= 0) { if (p == &buf[2*BUFSIZ]) p = buf; if (p > &buf[BUFSIZ]) { if ((ccount = read(f, p, &buf[2*BUFSIZ] - p)) <= 0) break; } else if ((ccount = read(f, p, BUFSIZ)) <= 0) break; # if D2 fprintf(stderr, " read %d bytes\n",ccount); { char xx[20]; sprintf(xx, "they are %%.%ds\n", ccount); fprintf(stderr, xx, p); } # endif } } nsucc = 1; if (rflag==0) { # if D2 fprintf(stderr, "p %o nlp %o buf %o\n",p,nlp,buf); if (p>nlp) {write (2, "XX\n", 3); write (2, nlp, p-nlp); write (2, "XX\n", 3);} # endif if (p > nlp) write(1, nlp, p-nlp); else { write(1, nlp, &buf[2*BUFSIZ] - nlp); write(1, buf, p-&buf[0]); } if (p[-1]!= '\n') write (1, "\n", 1); } if (instr==0) { nlp = p; c = www; nfound=0; } } else ccount++; continue; } # if D2 fprintf(stderr, "nr end loop p %o\n",p); # endif if (instr) p++; else if (*p++ == '\n') { nlp = p; c = www; nfound=0; } } if (instr==0) close(f); } cgotofn() { register c; register struct words *s; s = smax = www; nword: for(;;) { # if D1 fprintf(stderr, " in for loop c now %o %c\n",c, c>' ' ? c : ' '); # endif if ((c = gch())==0) return; else if (c == '\n') { s->out = 1; s = www; } else { loop: if (s->inp == c) { s = s->nst; continue; } if (s->inp == 0) goto enter; if (s->link == 0) { if (smax >= &www[MAXSIZ - 1]) overflo(); s->link = ++smax; s = smax; goto enter; } s = s->link; goto loop; } } enter: do { s->inp = c; if (smax >= &www[MAXSIZ - 1]) overflo(); s->nst = ++smax; s = smax; } while ((c = gch()) != '\n'); smax->out = 1; s = www; numwords++; goto nword; } gch() { static char *s; if (flag==0) { flag=1; s = *xargv++; # if D1 fprintf(stderr, "next arg is %s xargc %d\n",s,xargc); # endif if (xargc-- <=0) return(0); } if (*s) return(*s++); for(flag=0; flag<2*BUFSIZ; flag++) buf[flag]=0; flag=0; return('\n'); } overflo() { write(2,"wordlist too large\n", 19); exit(2); } cfail() { struct words *queue[QSIZE]; struct words **front, **rear; struct words *state; register char c; register struct words *s; s = www; front = rear = queue; init: if ((s->inp) != 0) { *rear++ = s->nst; if (rear >= &queue[QSIZE - 1]) overflo(); } if ((s = s->link) != 0) { goto init; } while (rear!=front) { s = *front; if (front == &queue[QSIZE-1]) front = queue; else front++; cloop: if ((c = s->inp) != 0) { *rear = (q = s->nst); if (front < rear) if (rear >= &queue[QSIZE-1]) if (front == queue) overflo(); else rear = ((queue; else rear++; else if (++rear == front) overflo(); state = s->fail; floop: if (state == 0) state = www; if (state->inp == c) { q->fail = state->nst; if ((state->nst)->out == 1) q->out = 1; continue; } else if ((state = state->link) != 0) goto floop; } if ((s = s->link) != 0) goto cloop; } } static int seen[50]; new (x) { int i; for(i=0; ifgnames) { char **fgp, tgbuff[100]; int k; # if D1 fprintf(stderr, "were %d bad files\n", fgnamp-fgnames); # endif grepquery[0]=0; for(k=0; ktags ? tags: nfound, fc); } } char * todir(t) char *t; { char *s; s=t; while (*s) s++; while (s>=t && *s != '/') s--; if (stags ? tags: nfound, fc); } } char * todir(t) char *t; { char *s; s=t; while (*s) s++; while (s>=t && *s != '/') s--; if (s0); if (coord==0) coord = zalloc(lmaster, sizeof(lmaster)); if (colevel>0) { prevdrop.a=zalloc(lmaster,iflong?sizeof(long): sizeof(int)); prevcoord = zalloc(lmaster, sizeof(lmaster)); } else { prevdrop.a=master.a; prevcoord=coord; } # if D1 fprintf(stderr, "nitem %d\n",nitem); # endif for(i=0; i0) { for(j=0; j=nf) break; if (j= nterm) { if (iflong) master.b[g]=k; else master.a[g]=k; coord[g++] = 1; } } # if D1 fprintf(stderr,"now have %d items\n",g); # endif if (colevel>0) for ( ; j nterm) { _assert(g0) { best=0; for(j=0; jbest) best = coord[j]; # if D1 fprintf(stderr, "colevel %d best %d\n", colevel, best); # endif reached = best; for(g=j=0; j 0) { if (c== '\n') break; if (isalpha(c) || isdigit(c)) { if (las==0) { v[n++] = p; las=1; } if (las++ <= 6) *p++ = c; } else { if (las>0) *p++ = 0; las=0; } } *p=0; assert(p 0) { if (c== '\n') break; if (isalpha(c) || isdigit(c)) { if (las==0) { v[n++] = p; las=1; } if (las++ <= 6) *p++ = c; } else { if (las>0) *p++ = 0; las=0; } } *p=0; assert(p_file, &sb); return (sb . st_mtime); } fc,lp, 0); fgets(res, 100, fc); for(s=res; c = *s; s++) if (c== ';') { *s=0; break; } if (tagout !=0) { if (res[0]=='/' || usedir[0]==0) sprintf(tagout, "%s", res); else sprintf(tagout, "%s/%s", usedir, res)cmd/refer/hunt6.c 644 0 33 4563 2111463476 7125 # include "stdio.h" # include "assert.h" # define TXTLEN 1000 char *outbuf = 0; extern char *soutput; extern int soutlen, iflong; extern long indexdate; baddrop(master, nf, fc, nitem, qitem, rprog, full) union ptr {unsigned *a; long *b; } master; FILE *fc; char *qitem[], *rprog; { /* checks list of drops for real bad drops; uses "deliv" to find items. */ int i, g, j, need, got, na, len; long lp; char res[100], *ar[50], output[TXTLEN]; extern int colevel, reached; # if D1 if (iflong) fprintf(stderr,"in baddrop, nf %d master %ld %ld %ld\n", nf, master.b[0], master.b[1], master.b[2]); else fprintf(stderr,"in baddrop, nf %d master %d %d %d\n", nf, master.a[0], master.a[1], master.a[2]); # endif for (i=g=0; i= g) if (soutput==0) fputs(output, stdout); else strcpy (soutput, output); } # ifdef D1 fprintf(stderr, "after fgrep\n"); # endif } return(g); } auxil( res, output) char *res, *output; { extern FILE *fd; long lp, c; int len; if (fd==0)return(0); while (c = *res++) { if (c == ';') { sscanf(res, "%ld,%d", &lp, &len); fseek (fd, lp, 0); fgets(output, len, fd); return(1); } } return(0); } long) master.b[g++] = master.b[i]; else master.a[g++] = master.a[i]; if (full >= g) if (soutput==0) fputs(output, stdout); cmd/refer/hunt7.c 644 0 33 4106 2111463476 7117 # include "stdio.h" # define SAME 0 # include "assert.h" # define FGCT 10 # define FGSIZE 150 int keepold = 1; /* keep old things for fgrep search */ char fgspace[FGSIZE]; char *fgp = fgspace; char *fgnames[FGCT]; char **fgnamp = fgnames; findline(in, out, outlen, indexdate) long indexdate; char *in, *out; { static char name[100] = ""; char *p, **ftp; extern long gdate(); static FILE *fa = NULL; long lp, llen; int len, k, nofil; # if D1 fprintf(stderr, "findline: %s\n", in); # endif if (mindex(in, '!')) return(remote(in, out)); nofil = in[0]==0; for(p=in; *p && *p != ':' && *p != ';'; p++) ; if (*p) *p++=0; else p=in; k = sscanf(p, "%ld,%ld", &lp, &llen); # ifdef D1 fprintf(stderr, "p %s k %d lp %ld llen %ld\n",p,k,lp,llen); # endif if (k<2) { lp = 0; llen=outlen; } # ifdef D1 fprintf(stderr, "lp %ld llen %ld\n",lp, llen); # endif # ifdef D1 fprintf(stderr, "fa now %o, p %o in %o %s\n",fa, p,in,in); # endif if (nofil) { # if D1 fprintf(stderr, "set fa to stdin\n"); # endif fa = std((in; } else if (strcmp (name, in) != 0 || 1) { # if D1 fprintf(stderr, "old: %s new %s not equal\n",name,in); # endif if (fa != NULL) fa = freopen(in, "r", fa); else fa = fopen(in, "r"); # if D1 if (fa==NULL) fprintf(stderr, "failed to (re)open *%s*\n",in); # endif if (fa == NULL) return(0); /* err("Can't open %s", in); */ strcpy(name, in); if (gdate(fa) > indexdate && indexdate != 0) { if (keepold) { for(ftp=fgnames; ftp= outlen) ? outlen-1 : llen; len = fread (out, 1, len, fa); out[len] = 0; # ifdef D1 fprintf(stderr, "length as read is %d\n",len); # endif } return(len); } gnamp= outlen) ? outlen-1 : llen; len = fread (out, 1, len, fa); out[len] = 0; # ifdef D1 fprincmd/refer/hunt8.c 644 0 33 2366 2265703316 7126 # include "stdio.h" # include "assert.h" # define unopen(fil) {if (fil!=NULL) {fclose(fil); fil=NULL;}} extern long indexdate, gdate(); extern FILE *iopen(); runbib (s) char *s; { /* make a file suitable for fgrep */ char tmp[200]; sprintf(tmp, "/usr/lib/refer/mkey %s >%s.ig", s,s); system(tmp); } makefgrep(indexname) char *indexname; { FILE *fa, *fb; if (ckexist(indexname, ".ig")) { /* existing gfrep -type index */ # if D1 fprintf(stderr, "found fgrep\n"); # endif fa = iopen(indexname, ".ig"); fb = iopen(indexname, ""); if (gdate(fb)>gdate(fa)) { if (fa!=NULL) fclose(fa); runbib(indexname); fa= iopen(indexname, ".ig"); } indexdate = gdate(fa); unopen(fa); unopen(fb); } else if (ckexist(indexname, "")) { /* make fgrep */ # if D1 fprintf(stderr, "make fgrep\n"); # endif runbib(indexname); time(&indexdate); unopen(fb); } else /* failure */ return(0); return(1); /* success */ } ckexist(s, t) char *s, *t; { char fnam[100]; strcpy (fnam, s); strcat (fnam, t); return (access(fnam, 04) != -1); } FILE * iopen (s, t) char *s, *t; { char fnam[100]; FILE *f; strcpy (fnam, s); strcat (fnam, t); f = fopen (fnam, "r"); if (f == NULL) { err("Missing expected file %s", fnam); exit(1); } return(f); } /* make fgrep */ # if D1 fprintf(stderr, "make fgrep\n"); # endif runbib(indexname); time(&indexdate); unopen(fb); } else /* failure */ return(0); return(1); /* success */ } ckexist(s, t) char *s, *t; { char fnam[100]; strcpy (fnam, s); strcat (fnacmd/refer/hunt9.c 644 0 33 127 2111463476 7100 remote(in, out) char *in, *out; { /* "in" is a long distance file name: get it */ ; } [100]; FILE *f; strcpy (fnam, s); strcat (fnam, t); f = fopen (fnam, "r"); if (f == NULL) { err("Missing expected file %s", fnam); exit(1); } return(f); } /* make fgrep */ # if D1 fprintf(stderr, "make fgrep\n"); # endif runbib(indexname); time(&indexdate); unopen(fb); } else /* failure */ return(0); return(1);/,5X< /,"cmd/refer/inv1.c 644 0 33 6544 2265703232 6734 # include "stdio.h" # include "assert.h" main(argc, argv) char *argv[]; { /* make inverted file indexes. Reads a stream from mkey which gives record pointer items and keys. Generates a set of files a. NHASH pointers to file b. b. lists of record numbers. c. record pointer items. these files are named xxx.ia, xxx.ib, xxx.ic; where xxx is taken from arg1. If the files exist they are updated. */ FILE *fa, *fb, *fc, *fta, *ftb, *ftc, *fd; int nhash = 256; int appflg = 1; int keepkey = 0, pipein = 0; char nma[100], nmb[100], nmc[100], com[100], nmd[100]; char tmpa[20], tmpb[20], tmpc[20]; char *remove = NULL; int chatty = 0, docs, hashes, fp[2], fr, fw, pfork, pwait, status; int i,j,k; long keys; int iflong =0; char *sortdir; sortdir = (access("/crp/tmp", 06)==0) ? "/crp/tmp" : "/usr/tmp"; while (argv[1][0] == '-') { switch(argv[1][1]) { case 'h': /* size of hash table */ nhash = atoi (argv[1]+2); break; case 'n': /* new, don't append */ appflg=0; break; case 'a': /* append to old file */ appflg=1; break; case 'v': /* verbose output */ chatty=1; break; case 'd': /* keep keys on file .id for check on searching */ keepkey=1; break; case 'p': /* pipe into sort (saves space, costs time)*/ pipein = 1; break; case 'i': /* input is on file, not stdin */ close(0); if (open(argv[2], 0) != 0) err("Can't read input %s", argv[2]); if (argv[1][2]=='u') /* unlink */ remove = argv[2]; argc--; argv++; break; } argc--; argv++; } strcpy (nma, argc >= 2 ? argv[1] : "Index"); strcpy (nmb, nma); strcpy (nmc, nma); strcpy (nmd, nma); strcat (nma, ".ia"); strcat (nmb, ".ib"); strcat (nmc, ".ic"); strcat (nmd, ".id"); sprintf(tmpa, "junk%di", getpid()); if (pipein) { pipe(fp); fr=fp[0]; fw=fp[1]; if ( (pfork=fork()) == 0) { close(fw); close(0); _assert(dup(fr)==0); close(fr); execl("/bin/sort", "sort", "-T", sortdir, "-o", tmpa, 0); execl("/usr/bin/sort", "sort", "-T", sortdir, "-o", tmpa, 0); _assert(0); } _assert(pfork!= -1); close(fr); fta = fopen("/dev/null", "w"); close(fta->_file); fta->_file = fw; } else /* use tmp file */ { fta = fopen(tmpa, "w"); _assert (fta != NULL); } fb = 0; if (appflg ) { if (fb = fopen(nmb, "r")) { sprintf(tmpb, "junk%dj", getpid()); ftb = fopen(tmpb, "w"); if (ftb==NULL) err("Can't get scratch file %s",tmpb); nhash = recopy(ftb, fb, fopen(nma, "r")); fclose(ftb); } else appflg=0; } fc = fopen(nmc, appflg ? "a" : "w"); if (keepkey) fd = keepkey ? fopen(nmd, "w") : 0; docs = newkeys(fta, stdin, fc, nhash, fd, &iflong); fclose(stdin); if (remove != NULL) unlink(remove); fclose(fta); if (pipein) { pwait = wait(&status); printf("pfork %o pwait %o status %d\n",pfork,pwait,status); _assert(pwait==pfork); _assert(status==0); } else { sprintf(com, "sort -T %s %s -o %s", sortdir, tmpa, tmpa); system(com); } if (appflg) { sprintf(tmpc, "junk%dk", getpid()); sprintf(com, "mv %s %s", tmpa, tmpc); system(com); sprintf(com, "sort -T %s -m %s %s -o %s", sortdir, tmpb, tmpc, tmpa); system(com); } fta = fopen(tmpa, "r"); fa = fopen(nma, "w"); fb = fopen(nmb, "w"); whash(fta, fa, fb, nhash, iflong, &keys, &hashes); fclose(fta); # ifndef D1 unlink(tmpa); # endif if (appflg) { unlink(tmpb); unlink(tmpc); } if (chatty) printf ("%ld key occurrences, %d hashes, %d docs\n", keys, hashes, docs); } m); } if (appflg) { sprintf(tmpc, "junk%dk", getpid()); sprintf(com, "mv %s %s", tmpa, tmpc); system(com); sprintf(com, "sort -T %s -m %s %s -o %s",cmd/refer/inv2.c 644 0 33 3206 2111463476 6730 # include "stdio.h" # include "assert.h" newkeys (outf, inf, recf, nhash, fd, iflong) FILE *outf, *inf, *recf, *fd; int *iflong; { /* reads key lines from inf; hashes and writes on outf; writes orig key on recf, records pointer on outf too. format of outf is : hash code space record pointer */ # define LINESIZ 1250 long lp, ftell(); long ld = 0; int ll = 0, lt = 0; char line[LINESIZ]; char key[30], bkeys[40]; char *p, *s; char *keyv[500]; int i, nk, ndoc = 0, more = 0, c; lp = ftell (recf); while (fgets(line, LINESIZ, inf)) { p = line; while (*p != '\t') p++; *p++ =0; fputs(line, recf); if (fd) { sprintf(bkeys, ";%ld", ld); ll = strlen(p); lt = strlen(bkeys); fputs(bkeys, recf); sprintf(bkeys, ",%d", ll); lt += strlen(bkeys); fputs(bkeys, recf); ld += ll; fputs(p, fd); } putc('\n',recf); for(s=p; *s; s++); if (*--s == '\n') { more=0; *s=0; } else more=1; _assert (fd==0 || more==0); nk = getargs(p, keyv); if (more) nk--; for(i=0; ikey) fprintf(outf, "%04d %06ld\n",hash(key)%nhash, lp); s = key; } } lp += (strlen(line)+lt+1); ndoc++; } *iflong = (lp>=65536L); if (sizeof(int)>2) *iflong=1; /* force long on VAX */ fclose(recf); return(ndoc); } trimnl(p) char *p; { while (*p) p++; p--; if (*p == '\n') *p=0; } ndif if (more) /* allow more than LINESIZ keys */ { strcpy(key, keyv[nk]); for(s=key; *s; s++); while ( (c=getc(inf)) != '\n') { if (c != ' ') { *s++ = c; continue; } *s=0; if (s>key) fprintf(outf, "%04d %06ld\n",hash(key)%nhash, lp); s = key; } } lp += (strlen(line)+lt+1); ndoc++; } *iflong = (lp>=65536L); if (sizeof(int)>2cmd/refer/inv3.c 644 0 33 335 2111463477 6712 getargs(s, arps) char *s, *arps[]; { int i; i = 0; while (1) { arps[i++]=s; while (*s != 0 && *s!=' '&& *s != '\t')s++; if (*s==0) break; *s++ =0; while (*s==' ' || *s=='\t')s++; if (*s==0)break; } return(i); } =key; *s; s++); while ( (c=getc(inf)) != '\n') { if (c != ' ') { *s++ = c; continue; } *s=0; if (s>key) fprintf(outf, "%04d %06ld\n",hash(key)%nhash, lp); s = key/,5< /,"cmd/refer/inv5.c 644 0 33 1536 2111463477 6740 # include "stdio.h" recopy (ft, fb, fa, nhash) FILE *ft, *fb, *fa; { /* copy fb (old hash items/pointers) to ft (new ones) */ int n, i, iflong; long getl(); int getw(); int *hpt_s; int (*getfun)(); long *hpt_l; long k, lp; if (fa==NULL) { err("No old pointers",0); return; } fread(&n, sizeof(n), 1, fa); fread(&iflong, sizeof(iflong), 1, fa); if (iflong) { hpt_l = calloc(sizeof(*hpt_l), n+1); n =fread(hpt_l, sizeof(*hpt_l), n, fa); } else { hpt_s = calloc(sizeof(*hpt_s), n+1); n =fread(hpt_s, sizeof(*hpt_s), n, fa); } if (n!= nhash) fprintf(stderr, "Changing hash value to old %d\n",n); fclose(fa); if (iflong) getfun = getl; else getfun = getw; for(i=0; i'9' || line[1]<'0') continue; switch(line[0]) { case 'T': if (state > 'T') { book=0; report=0; printf("\n%%T "); } printf("%s\n", line+18); state='T'; na = getargs(line+18, v); for(i=0;i0) { printf("%%A "); corp=0; for(p=vv[1]; *p; p++) if (islower(*p)) corp=1; if (corp==0) { for(p=vv[1]; *p; p++) printf("%c. ", *p); if (na>2 &&strcmp(vv[2], "+")) { printf("%s", vv[0]); if (strcmp(vv[2], "Jr.")==0) printf(","); printf(" %s\n",vv[2]); vv++;na--; } else printf("%s\n", vv[0]); } else printf("%s %s\n",vv[0],vv[1]); vv+=2; na-=2; if (strcmp(vv[0], "+")==0) { vv++;na--; } } continue; case 'U': if (state!='U') ubuff[0]=0; else strcat(ubuff, " "); state = 'U'; strcat(ubuff, line+18); if (line[2]=='.') { /* end of item */ p=ubuff; /*start*/ volume=0; for(s=ubuff; *s; s++) if (s[-1]==' ' && prefix("Vol", s)) { for(q=s-1; q>ubuff; q--) { if (*q==' ' || *q==',') *q=0; else break; } volume=1; break; } if (*s==0) for(s=ubuff; *s && (*s!=',' || sprefix("Inc", s+1)); s++) ; else s++; if (*s==',')*s++=0; if (book) printf("%%I %s\n",ubuff); else if (volume) printf("%%J %s\n", ubuff); else if (substr(ubuff, "Report")!=0) { report=1; printf("%%R %s\n", ubuff); } else printf("%%J %s\n", ubuff); if (volume) { s += 3; /* Vol */ if (*s=='.') s++; while (*s==' ')s++; printf("%%V "); while (*s && *s != ' ' && *s!=',' && *s!=';' && *s!= ':') putchar(*s++); putchar('\n'); if (*s==':') { printf("%%N "); while (*s==' ')s++; while (isdigit(*s)) putchar(*s++); putchar('\n'); } *s++=0; while (*s==' ')*s++=0; if (s[0]=='N' && s[1]=='o' && (s[2]==' '||s[2]=='.')) { s+=2; while (*s==' '||*s=='.')s++; printf("%%N "); while (isdigit(*s)||*s=='-') putchar(*s++); putchar('\n'); } if (*s==',') *s++=0; } for(rr=months; *rr; rr++) { q= substr(s, *rr); if (q) { for(r=q; *r; r++); r--; if (*r=='.')*r=0; printf("%%D %s\n",q); *(q-1)=0; break; } } if (*rr==0) { for(q=s; *q; q++) { if (q[0]=='1' && q[1]=='9' && (q[4]==0 || (q[4]=='.' && q[5]==0))) { if (q[4]=='.') q[4]=0; printf("%%D %s\n",q); rr=months; q[-1]=0; if (q==s) q[0]=0; break; } } } if (*rr==0) /* no date */ printf("%%D 19xx\n"); /* if book bite off next field for city, if report for issuer */ if (book) { for(q=s; *q && *q != ','; q++) ; if (*q==',') { r=q; r++; while (*r==' ')r++; if (isupper(r[0]) && isupper(r[1])) { r+=2; *r++=0; while (*r==' ')r++; } else *q=0; printf("%%C %s\n", s); s=r; } } for(q=s; *q; q++) { if (q[0]==' ' && q[1]=='p' && (q[2]=='p'||q[2]==0)) { for(r=q; r>s; r--) { if (*r==' ' || *r==',') *r=0; } *q=0; q+=2; if (q[0]=='p')q++; while (*q==' '||*q=='.')q++; r=q; while (isdigit(*q)||*q=='.'||*q=='-'||isalpha(*q))q++; *q++=0; while (*q==' ')q++; printf("%%P %s\n",r); (( break; } } s=ispp(s); while (*s==' ')s++; while (*q==' ')q++; if (*s||*q) printf("%%O %s %s\n", *s?s:"", *q?q:""); } continue; } } } getargs(s, arps) char *s, *arps[]; { int i; i = 0; while (1) { arps[i++]=s; while (*s != 0 && *s!=' '&& *s != '\t')s++; if (*s==0) break; *s++ =0; while (*s==' ' || *s=='\t')s++; if (*s==0)break; } return(i); } prefix(small, big) char *small, *big; { int c; while ((c= *small++) == *big++) if (c==0) return(1); return(c==0); } substr(big, small) char *small, *big; { while (*big) if (prefix(small, big)) return(big); else big++; return(0); } sprefix(small, big) char *small, *big; { while (*big==' ') big++; return(prefix(small,big)); } ispp(s) char *s; { static char buff[50]; char *p, *t; p=s; while (*p==' ') p++; if (!isdigit(*p)) return(s); t=p; while (isdigit(*p))p++; if (p[0]!='p' || p[1]!='p') return(s); *p=0; sprintf(buff, "%spp.", t); return(buff); } le ((c= *small++) == *big++) if (c==0) return(1); return(c=cmd/refer/mkey1.c 644 0 33 3111 2265703176 7077 # include "stdio.h" extern char *comname; /* "/usr/lib/eign" */ int wholefile = 0; int keycount = 100; int labels = 1; int minlen = 3; extern int comcount; char *iglist = "XYZ#"; main (argc,argv) char *argv[]; { /* this program expects as its arguments a list of files and generates a set of lines of the form filename:byte-add,length (tab) key1 key2 key3 where the byte addresses give the position within the file and the keys are the strings off the lines which are alphabetic, first six characters only. */ int i; char *name, qn[200]; char *inlist = 0; FILE *f, *ff; while (argc>1 && argv[1][0] == '-') { switch(argv[1][1]) { case 'c': comname = argv[2]; argv++; argc--; break; case 'w': wholefile = 1; break; case 'f': inlist = argv[2]; argv++; argc--; break; case 'i': iglist = argv[2]; argv++; argc--; break; case 'l': minlen = atoi(argv[1]+2); if (minlen<=0) minlen=3; break; case 'n': /* number of common words to use */ comcount = atoi(argv[1]+2); break; case 'k': /* number of keys per file max */ keycount = atoi(argv[1]+2); break; case 's': /* suppress labels, search only */ labels = 0; break; } argc--; argv++; } if (inlist) { ff = fopen(inlist, "r"); while (fgets(qn, 200, ff)) { trimnl(qn); f = fopen (qn, "r"); if (f!=NULL) dofile(f, qn); else fprintf(stderr, "Can't read %s\n",qn); } } else if (argc<=1) dofile(stdin, ""); else for(i=1; i0 && len >= MAXLINE) { fseek (f, 0L, 2); return(ftell(f)); } } eof=1; return(s[0] ? len : 0L); } char * trimnl(ln) char *ln; { register char *p = ln; while (*p) p++; p--; if (*p == '\n') *p=0; return(ln); } chkey (c, name) { if (isalpha(c) || isdigit(c)) { if (alph++ < 6) *p++ = c; } else { *p = 0; for(p=key; *p; p++) *p |= 040; if (outkey(p=key,prevc,c)) { if (used==0) { if (labels) { if (wholefile==0) printf("%s:%ld,%ld\t", name, lp, lim); else printf("%s\t", name); } } else putchar(' '); fputs(key, stdout); used++; } prevc=c; alph=0; } } r char *p = ln; while (*p) p++; p--; if (*p == '\n') *p=0; return(ln); } chkey (c, name) { if (isalpha(c) || isdigit(c)) { if (alph++ < 6) *p++ = c; } else { *p = 0; for(p=key; *p; p++) *p |= 040; if (outkey(p=key,prevc,c)) { if (used==0) { if (labels) { if (wholefile==0) printf("%s:%ld,%ld\t", name, lp, lim); else printf("%s\t", name); } cmd/refer/mkey3.c 644 0 33 1325 2111463477 7103 # include "stdio.h" char *comname = "/usr/lib/eign"; static int cgate = 0; extern char *comname; # define COMNUM 500 # define COMTSIZE 997 int comcount = 100; static char cbuf[COMNUM*9]; static char *cwds[COMTSIZE]; static char *cbp; common (s) char *s; { if (cgate==0) cominit(); return (c_look(s, 1)); } cominit() { int i; FILE *f; cgate=1; f = fopen(comname, "r"); if (f==NULL) return; cbp=cbuf; for(i=0; iNSERCH) err("too many -p options (%d)", NSERCH); break; case 'n': nodeflt=1; break; case 'b': bare = (argv[1][2] == '1') ? 1 : 2; break; case 'c': smallcaps = argv[1]+2; break; case 'a': authrev = atoi (argv[1]+2); if (authrev<=0) authrev = 1000; break; } argc--; argv++; } if (nodeflt==0) *search++ = "/usr/dict/papers/Ind"; if (sort) endpush=1; if (endpush) { sprintf(tfile, "/tmp/rj%da", getpid()); fo = fopen(tfile, "w"); if (fo==NULL) { fo = ftemp; fprintf(stderr,"Can't open scratch file"); } sep = 002; /* separate records without confusing sort..*/ } if (sort && !labels) { sprintf(ofile,"/tmp/rj%db", getpid()); ftemp = fopen(ofile, "w"); if (ftemp==NULL) { fprintf(stderr, "Can't open scratch file\n"); exit(1); } } do { if (argc>1) { fclose(in); Iline=0; in = fopen(Ifile=argv[1], "r"); argc--; argv++; if (in==NULL) { err("Can't read %s", Ifile); continue; } } while (input(line)) { Iline++; # ifdef D1 fprintf(stderr, "line %.20s\n",line); # endif if (!prefix(".[", line)) output(line); else doref(line); # if D1 fprintf(stderr, "past output/doref\n"); # endif } } while (argc>1); if (endpush && fo!=NULL) dumpold(); output("", ftemp); if (sort && !labels) recopy(ofile); clfgrep(); cleanup(); exit(0); } extern int intr(); signals() { int oldint; oldint = signal(SIGINT, &intr); if (oldint==1) signal (SIGINT, 1); signal (SIGHUP, &intr); signal (SIGPIPE, &intr); signal (SIGTERM, &intr); } intr() { int oldsig; signal(SIGINT, 1); cleanup(); exit(1); } cleanup() { if (tfile[0]) unlink(tfile); if (gfile[0]) unlink(gfile); if (ofile[0]) unlink(ofile); if (hidenam[0]) unlink(hidenam); } f (endpush && fo!=NULL) dumpold(); output("", ftemp); if (sort && !labels) recopy(ofile); clfgrep(); cleanup(); exit(0); } extern int intr(); signals() { int oldint; oldint = signal(SIGINT, &intr); if (oldint==1) signal (SIGINT, 1)cmd/refer/refer2.c 644 0 33 7211 2111463477 7240 # include "refer..c" extern FILE *in; # define NFLD 30 # define TLEN 400 char one[ANSLEN]; int onelen = ANSLEN; static char dr [100] = ""; doref(firline) char *firline; { char buff[QLEN], dbuff[3*QLEN], answer[ANSLEN], temp[TLEN]; char line[LLINE]; char *p, **sr, *flds[NFLD], *r; int nf, nr, alph, query = 0, chp, digs; /* get query */ buff[0] = dbuff[0] = 0; while (input(line)) { if (prefix(".]", line)) break; if (control(line[0])) query=1; strcat (query ? dbuff: buff, line); if (strlen(buff)>QLEN) err("buff too big (%d)", strlen(buff)); assert (strlen(dbuff) <3*QLEN); } if (strcmp (buff, "$LIST$\n")==0) { # if D1 fprintf(stderr, "dump sorted list\n"); # endif assert ( dbuff[0]==0); dumpold(); return; } answer[0] = 0; # ifdef D1 fprintf(stderr, "query is %s\n",buff); # endif for( p=buff; *p; p++) { if (isupper(*p)) *p |= 040; } alph = digs =0; for(p=buff; *p; p++) { if (isalpha(chp = *p)) alph++; else if (isdigit(*p)) digs++; else { *p=0; if ( (alph+digs<3) || common(p-alph)) { r = p-alph; while (r < p) *r++ = ' '; } if ( alph==0 && digs >0) { r = p-digs; # if D1 fprintf(stderr, "number, %d long, text is %s\n",digs,r); # endif if (digs != 4 || (atoi(r)/100 != 19)) { while (rLLINE) err("Accumulated answers too large",0); strcat (answer, temp); if (strlen(answer)>LLINE) err("answer too long (%d)", strlen(answer)); if (newline(answer) > 0) break; } # if D1 fprintf(stderr, "answer:\n%s****\n", answer); # endif assert (strlen(one)LLINE) err("one buff too big (%d)!", LLINE); } append(s) char *s; { char *p, *r; int lch; trimnl(buff); for (p=buff; *p; p++) ; lch = *--p; switch (lch) { case '.': case ',': *p=0; r="\\*(<"; while (*r) *p++= *r++; *p++ = lch; *p=0; } strcat(buff,s); switch(lch) { case '.': case ',': for(p=buff; *p; p++) ; if (*--p=='\n')*p=0; r = "\\*(>"; while (*r) *p++ = *r++; *p++ = lch; *p++ = '\n'; *p=0; } if (strlen(buff)>LLINE) err("output buff too long (%d)", LLINE); } flout() { if (gate) fputs(buff,ftemp); gate=0; } char * trimnl(ln) char *ln; { register char *p = ln; while (*p) p++; p--; if (*p == '\n') *p=0; return(ln); } ) { case '.': case ',': *p=0; r="\\*(<"; while (*r) *p++= *r++; *p++ = lch; *p=0; } strcat(buff,s); switch(lch) { case '.': case ',': for(p=buff; *p; p++) ; if (*--p=='\n')*cmd/refer/refer5.c 644 0 33 11501 2111463477 7260 # include "refer..c" # define SAME 0 # define NFLAB 2000 # define NLABC 100 static char sig[NLABC]; static char bflab[NFLAB]; static char *labtab[NLABC]; static char *lbp = bflab; static char labc[NLABC]; static char stbuff[50]; static int prevsig; putsig (nf, flds, nref, nstline, endline) char *flds[], *nstline, *endline; { /* choose signal style */ char t[100], t1[100], t2[100], format[10], *sd; int another = 0; int addon; char *stline; static FILE *fhide = 0; if (labels) { if (nf==0) /* old */ sprintf(t, "%s%c", labtab[nref], labc[nref]); else { *t=0; if (keywant) sprintf(t, "%s", fpar(nf, flds, t1, keywant, 1, 0)); if (t[0]==0) { sprintf(format, nmlen>0 ? "%%.%ds%%s" : "%%s%%s", nmlen); /* format is %s%s for default labels or %.3s%s eg if wanted */ sd = fpar(nf, flds, t2, 'D', 1, 0); if (dtlen>0) { char *sdb; for(sdb=sd; *sd; sd++); sd = sd-dtlen; if (sd0) fprintf(fo,".ds [F %s%c",t,sep); if (bare>0) flout(); # if D1 fprintf(stderr, "sig is now %s\n",sig); # endif } char * fpar (nf, flds, out, c, seq, prepend) char *flds[], *out; { char *p, *s; int i, fnd = 0; for(i=0; i= seq) { if (c=='T' || c == 'J') /* for titles use first word otherwise last */ { p=flds[i]+3; if (prefix("A ", p)) p +=2; if (prefix("An ", p)) p +=3; if (prefix("The ", p)) p+= 4; mycpy2(out, p, 20); return(out); } for(s=p= flds[i]+2; *p; p++); while (p>s && *p != ' ') p--; /* special wart for authors */ if (c=='A' && (p[-1] == ',' || p[1] =='(')) { p--; while (p>s && *p != ' ') p--; mycpy (out, p+1); } else strcpy (out, p+1); if (c=='A' && prepend) initadd(out, flds[i]+2, p); return(out); } return(0); } putkey(nf, flds, nref, keystr) char *flds[], *keystr; { char t1[50], *sf; int ctype, i, count; fprintf(fo, ".\\\""); if (nf <= 0) fprintf(fo, "%s%c%c", labtab[nref], labc[nref], sep); else { while (ctype= *keystr++) { count = atoi(keystr); if (*keystr=='+') count=999; if (count<=0) count=1; for(i=1; i<=count; i++) { sf= fpar(nf, flds, t1, ctype, i, 1); if (sf==0) break; sf = artskp(sf); fprintf(fo, "%s%c", sf, '-'); } } fprintf(fo, "%c%d%c%c", FLAG, nref, FLAG, sep); } } keylet(t, nref) char *t; { int i; int x = 'a'-1; for(i=1; iNFLAB) err("bflab overflow (%d)", NFLAB); if (nref >NLABC) err ("nref in labc overflow (%d)", NLABC); # ifdef D1 fprintf(stderr, "lbp up to %d of 2000\n", lbp-bflab); # endif return (labc[nref] = x+1); } mycpy(s,t) char *s, *t; { while (*t && *t != ',' && *t != ' ') *s++ = *t++; *s=0; } mycpy2 (s, t, n) char *s, *t; { int c; while (n-- && (c= *t++)>0) { if (c==' ')c= '-'; *s++ = c; } *s=0; } initadd(to, from, stop) char *to, *from, *stop; { int c, nalph = 1; while (*to) to++; while (from1) { *b++ = '\\'; *b++ = 's'; *b++ = '+'; *b++ = '2'; } if (this) c &= (~040); *b++ = c; alph = this ? alph+1 : 0; } if (alph>1) { *b++ = '\\'; *b++ = 's'; *b++ = '+'; *b++ = '2'; } *b=0; return (p); } char * revauth(s, b) char *s, *b; { char *init, *name, *jr, *p, *bcop; bcop = b; init=name=s; while (*name)name++; jr=name; while (name>init && *name!= ' ') name--; if (name[-1] == ',' || name[-1]== '(' ) { jr = --name; while (name>init && *name != ' ') name--; } p=name; while (pinit && *name!= ' ') name--; if (name[-1] == ',' || name[-1]== '(' ) { jr = --name; while (name>init && cmd/refer/refer7.c 644 0 33 2765 2265703534 7257 # include "refer..c" int newr[250]; chkdup ( tag ) char *tag; { int i; for(i=1; i<=refnum; i++) { if (strcmp(reftable[i], tag)==0) return(i); } reftable[refnum+1] = rtp; if (refnum>=NRFTBL) err("too many references (%d) for table", refnum); strcpy (rtp, tag); while (*rtp++); if (rtp > reftext + NRFTXT) err("reftext too big (%d)", rtp-reftext); return(0); } dumpold() { FILE *fi; int c, g1 = 0, nr = 1; if (!endpush) return; fclose(fo); fo = NULL; if (sort) { char comm[100]; sprintf(comm, "sort %s -o %s", tfile, tfile); system(comm); } fi = fopen(tfile, "r"); if (fi==NULL) return; flout(); fprintf(ftemp,".]<\n"); while ( (c = getc(fi)) >0) { if (c=='\n') { nr++; g1 = 0; } if (c==sep) c = '\n'; if (c== FLAG) { /* make old-new ref number table */ char tb[20]; char *s = tb; while ( (c=getc(fi)) != FLAG) *s++ = c; *s=0; if (g1++ == 0) newr[atoi(tb)] = nr; # if D1 fprintf(stderr, "nr %d assigned to atoi(tb) %d\n",nr,atoi(tb)); # endif fprintf(ftemp,"%d", nr); continue; } putc(c, ftemp); } fclose(fi); # ifndef D1 unlink(tfile); # endif fprintf(ftemp, ".]>\n"); } recopy (fnam) char *fnam; { int c; fclose(ftemp); ftemp = fopen(fnam, "r"); if (ftemp==NULL) { fprintf(stderr, "Can't reopen %s\n", fnam); exit(1); } while ( (c = getc(ftemp)) != EOF) { if (c == FLAG) { char tb[10]; char *s = tb; while ( (c = getc(ftemp)) != FLAG) *s++ = c; *s=0; printf("%d", newr[atoi(tb)]); continue; } putchar(c); } fclose(ftemp); unlink(fnam); } r); conticmd/refer/refer8.c 644 0 33 611 2111463477 7223 # include "refer..c" static char ahead[1000]; static int peeked = 0; static int noteof = 1; char * input (s) char *s; { if (peeked) { peeked=0; if (noteof==0) return(0); strcpy (s, ahead); return(s); } return(fgets(s, 1000, in)); } char * lookat() { if (peeked) return(ahead); noteof=input(ahead); peeked=1; return(noteof); } addch(s, c) char *s; { while (*s) s++; *s++ = c; *s = 0; } = c; *s=0; printf("%d",/,5< /,"cmd/refer/sample 644 0 33 104760 2111463500 7145 %A A. V. Aho %A C. Beeri %A J. D. Ullman %T The Theory of Joins in Relational Databases %J Proc. 18th IEEE Symp. on Foundations of Computer Science %D 1977 %A A. V. Aho %A Y. Sagiv %A J. D. Ullman %T Equivalence of Relational Expressions %O unpublished %D 1977 %A W. W. Armstrong %T Dependency Structures of Data Base Relationships %J Proc. IFIP 74 %I North Holland %D 1974 %P 580-583 %A P. A. Bernstein %A C. Beeri %T An Algorithmic Approach to Normalization of Relational Database Schemes %R TR CSRG-7B %I Computer Science Research Group, University of Toronto %D September 1976 %A C. Beeri %A R. Fagin %A J. H. Howard %T A Complete Axiomatization for Functional and Multivalued Dependencies %R RJ1977 %I IBM, San Jose, California %D 1977 %A A. K. Chandra %A P. M. Merlin %T Optimal Implementation of Conjunctive Queries in Relational Data Bases %J Proc. 9th ACM Symp. on Theory of Computing %D 1976 %P 77-90 %A E. F. Codd %T A Relational Model for Large Shared Data Bases %J Comm. Assoc. Comp. Mach. %K acm cacm %V 13 %N 6 %D June 1970 %P 377-387 %A E. F. Codd %T Further Normalization of the Data Base Relational Model %B Data Base Systems %E R. Rustin %I Prentice Hall %C Englewood Cliffs, N. J %D 1972 %P 33-64 %A E. F. Codd %T Relational Completeness of Data Base Sublanguages %B Data Base Systems %E R. Rustin %I Prentice-Hall %C Englewood Cliffs, N. J %D May 1971 %P 65-98 %A S. A. Cook %T The Complexity of Theorem Proving Procedures %J Proc. 3rd ACM Symp. on Theory of Computing %D May 1971 %P 151-158 %A C. J. Date %T An Introduction to Database Systems %I Addison-Wesley %C Reading, Mass %D 1975 %A C. Delobel %T Contributions Theoretiques a la Conception d'un Systeme d'informations %O Ph. D. thesis, Univ. of Grenoble, Oct %D 1973 %A R. Fagin %T Multivalued Dependencies and a New Normal Form for Relational Databases %J ACM Trans. Data Base Systems %V 2 %N 3 %D September 1977 %P 262-278 %A P. A. V. Hall %T Optimization of a Single Relational Expression in a Relational Database System %J IBM J. Research and Development %D May 1976 %P 244-257 %A R. M. Karp %T Reducibility Among Combinatorial Problems %B Complexity of Computer Computations %E R. E. Miller and J. W. Thatcher %I Plenum Press %C New York %D 1972 %P 85-104 %A C. L. Lucchesi %A S. L. Osborn %T Candidate Keys for Relations %J J. Comp. Sys. Sci. %O (To appear; available from Department of Computer Science, University of Waterloo). %D 1976 %A J. Minker %T Performing Inferences over Relational Databases %R TR363, Department of Computer Science %I University of Maryland %D March 1975 %A R. M. Pecherer %T Efficient Evaluation of Expressions in a Relational Algebra %J Proc. ACM Pacific Conf. %D April 1975 %P 44-49 %A F. P. Palermo %T A Database Search Problem %B Information Systems COINS IV %E J. T. Tou %I Plenum Press %C New York %D 1974 %A J. Rissanen %T Independent Components of Relations %R RJ1899, IBM, San Jose, California %D 1977 %A Y. Sagiv %A M. Yannakakis %T unpublished %A J. M. Smith %A P. Y.\(hyT. Chang %T Optimizing the Performance of a Relational Algebra Database Interface %J Comm. Assoc. Comp. Mach. %K acm cacm %V 18 %N 10 %D October 1975 %A M. Stonebraker %A L. A. Rowe %T Observations on Data Manipulation Languages and their Embedding in General Purpose Programming Languages %R TR UCB/ERL M77-53 %D July 1977 %I University of California, Berkeley %A E. Wong %A K. Youssefi %T Decomposition \(em a Strategy for Query Processing %J ACM Trans. Data Base Systems %V 1 %N 3 %D September 1976 %P 223-241 %A C. Zaniolo %T Analysis and Design of Relational Schemata for Database Systems %R Tech. Rept. UCLA-ENG-7769 %I Department of Computer Science, UCLA %D July 1976 %A M. M. Zloof %T Query-by-Example: the Invocation and Definition of Tables and Forms %J Proc. ACM International Conf. on Very Large Data Bases %D September 1975 %P 1-24 %A S. K. Abdali %T A lambda calculus model of programming languages \(em I. simple constructs %J J. Comp. Languages %V 1 %D 1976 %P 287-301 %A S. K. Abdali %T A lambda calculus model of programming languages \(em II. jumps and procedures %J J. Comp. Languages %V 1 %D 1976 %P 303-320 %A ADJ (J. A. Goguen, J. W. Thatcher, E. G. Wagner and J. B Wright) %T A junction between category theory and computer science, I: basic concepts and examples (Part 1) %R Report RC 4526 %I IBM Research %C Yorktown Heights, N. Y. %K part1 %D September 1973 %A ADJ (J. A. Goguen, J. W. Thatcher, E. G. Wagner and J. B Wright) %T A junction between category theory and computer science, I: basic concepts and examples (Part 2) %R Report RC 5908 %I IBM Research %K part2 %C Yorktown Heights, N. Y. %D March 1976 %A L. Ammeraal %T How program statements transform predicates %R Report IW 39/75 %I Mathematisch Centrum %C Amsterdam %D December 1975 %A L. Ammeraal %T On forward and backward proof rules for program verification %R Report IW 65/76 %I Mathematisch Centrum %C Amsterdam %D November 1976 %A E. R. Anderson %A F. C. Belz %A E. K. Blum %T Semanol (73) A metalanguage for programming the semantics of programming languages %J Acta Informatica %V 6 %D 1976 %((P 109-131 %A K. R. Apt %T Equivalence of operational and denotational semantics for a fragment of Pascal %R Report IW 71/76 %I Mathematisch Centrum %C Amsterdam %D December 1976 %A K. R. Apt %A J. W. de Bakker %T Exercises in denotational semantics %J Lecture Notes in Computer Science %V 45 %D 1976 %P 1-11 %A K. R. Apt %A J. W. de Bakker %T Semantics and proof theory of Pascal procedures %J Lecture Notes in Computer Science %V 52 %D 1977 %P 30-44 %A K. R. Apt %A L. G. L. T. Meertens %T Completeness with finite systems of intermediate assertions for recursive program schemas %R Report IW 84/77 %I Mathematisch Centrum %C Amsterdam %D September 1977 %A A. Arnold %A M. Nivat %T Non deterministic recursive program schemes %D 1977 %A A. Arnold %A M. Nivat %T On nondeterministic program schemes %D 1977 %A E. A. Ashcroft %A Maurice Clint %A C. A. R. Hoare %T Remarks on ``Program proving: jumps and functions by M. Clint and C. A. R. Hoare'' %J Acta Informatica %V 6 %D 1976 %P 317-318 %A J. W. Backus %A R. J. Beeber %A S. Best %A R. Goldberg %A L. M. Haibt %A H. L. Herrick %A R. A. Nelson %A D. Sayre %A P. B. Sheridan %A H. Stern %A I. Ziller %A R. A. Hughes %A R. Nutt %T The Fortran automatic coding system %J Western Computer Proceedings %D 1957 %P 188-198 %A J. P. Banatre %T Producing optimised code for coercions %J Information Processing Letters %V 6 %N 2 %D April 1977 %P 56-59 %A Henk Barendregt %T A global representation of the recursive functions in the $lambda -$claculus %J Theor. Comp. Sci. %V 3 %D 1976 %P 225-242 %A H. Bekic %T Towards a mathematical theory of processes %R TR 25.125 %I IBM Laboratory %C Vienna %D December 1971 %A G. Berry %T Bottom-up computation of recursive programs %R Rapport de Recherche No 133 %I IRIA %C Rocquencourt, France %D September 1975 %A Gerard Berry %A Bruno Courcelle %T Program equivalence and canonical forms in stable discrete interpretations %E S. Michaelson and R. Milner %B Automata Languages and Programming , Third International Colloquium %I Edinburgh University Press %D July 1976 %P 168-188 %A Gerard Berry %A J. J. Levy %T Minimal and optimal computations of recursive programs %J J. Assoc. Comp. Mach. %K acm jacm %D to appear %A Richard Bird %T Programs and Machines %I John Wiley %C New York, N. Y. %D 1976 %A A. Blikle %T Programs with subscripted variables %J Bulletin de L'Academie Polonaise des Sciences, Serie des sciences math., astr. et phys. %V XIX %N 9 %D 1971 %P 853-857 %A C. Bohm %T The CUCH as a formal and description language %E T. B. Steel, Jr. %B Formal language description languages for computer programming %I North-Holland %C Amsterdam %D 1966 %P 179-197 %A H. J. Boom %T Extended type checking %R Report IW 60/76 %I Mathematisch Centrum %C Amsterdam %D September 1976 %A S. R. Bourne %A A. D. Birrell %A I. Walker %T Algol 68C Reference Manual %I Computer Laboratory, Cambridge University %C Cambridge, England %D 1975 %A R. S. Boyer %A J. S. Moore %T A computer proof of the correctness of a simple optimizing compiler for expressions %R Tech. Rep. 5 %I SRI %C Menlo Park, Ca. %D January 1977 %A J. M. Boyle %A A. A. Grau %T An algorithmic semantics for Algol 60 identifier denotation %J J. Assoc. Comp. Mach. %K acm jacm %V 17 %N 2 %D April 1970 %P 361-382 %A R. M. Burstall %T Semantics of assignment %E Ella Dale and Donald Michie %B Machine Intelligence 2 %I American Elsevier %C New York %D 1968 %P 3-20 %A R. M. Burstall %T Proving properties of programs by structural induction %J Comp. J. %P 41-48 %A R. M. Burstall %T Some techniques for proving properties of programs which alter data structures %B Machine Intelligence %A E. M. Clarke, Jr. %T Program invariants as fixed points %J Proc. 18th IEEE Symp. on Foundations of Computer Science %D October 1977 %P 18-29 %A Maurice Clint %T Program proving: coroutines %J Acta Informatica %V 2 %N 1 %D 1973 %P 50-63 %A Maurice Clint %A C. A. R. Hoare %T Program proving:jumps and functions %J Acta Informatica %V 1 %D 1972 %P 214-224 %O see also Ashcroft, Clint and Hoare (1976) %A S. A. Cook %T Soundness and completeness of an axiom system for program verification %J SIAM J. Computing %D to appear %A S. A. Cook %A D. C. Oppen %T An assertion language for data structures %J Proc. 2nd ACM Symp. on Principles of Programming Languages %D January 1975 %P 160-166 %A D. C. Cooper %T Program scheme equivalences and second-order logic %B Machine Intelligence %P 3-15 %A Bruno Courcelle %T On the definition of classes of interpretations %R Rapport de Recherche No 231 %I IRIA %C Rocquencourt, France %D May 1977 %A B. Courcelle %A I. Guessarian %T On some classes of interpretations %R Rapport de Recherche No 253 %I IRIA %C Rocquencourt, France %D September 1977 %A Bruno Courcelle %A Jean Vuillemin %T Completeness results for the equivalence of recursive schema %J J. Comp. Sys. Sci. %V 12 %D 1976 %P 179-197 %A Karel Culik II %T A model for the formal definition of programming languages %J Int. J. Comp. Math. %V 3 %D 1973 %P 315-345 %A R. J. Cunningham %A M. E. J. Guilford %T A note on the semantic definition of side effects %J Information Processing Letters %V 4 %N 5 %D February 1976 %P 118-120 %A Ole-Johan Dahl %A Bjorn Myhrhaug %A Kristen Nygaard %T Simula 67: common base language %R Publication S-22 %I Norwegian Computing Centre %C Oslo, Norway %D October 1970 %A J. W. de Bakker %T Semantics of programming languages %E J. T. Tou %B Advances in Information Systems Science, Vol. 2 %I Plenum Press %C New York, N. Y. %D 1969 %P 173-227 %A J. W. de Bakker %T Recursive Procedures %I Mathematical Centre Tracts 24, Mathematisch Centrum %C Amsterdam %D 1971 %A J. W. de Bakker %T Recursion, induction and symbol manipulation %B Informatica Symposium 1971 %I Mathematisch Centre Tracts 25, Mathematisch Centrum %D 1971 %A J. W. de Bakker %T Axiom systems for simple assignment statements %J Lecture Notes in Mathematics %V 188 %D 1971 %P 1-22 %A J. W. de Bakker %T A property of linear conditionals %J Lecture Notes in Mathematics %V 188 %D 1971 %P 23-27 %A J. W. de Bakker %T The fixpoint approach in semantics: theory and applications %E J. W. de Bakker %B Foundations of Computer Science %I Mathematical Centre Tracts 63 %C Amsterdam %D 1975 %P 3-53 %A J. W. de Bakker %T Least fixed points revisited %J Theor. Comp. Sci. %V 2 %D 1976 %P 155-181 %A J. W. de Bakker %A J. W. de Bakker %T Fixed point semantics and Dijkstra's fundamental invariance theorem %R Report IW 29/76 %I Mathematisch centrum %C Amsterdam %D January 1976 %A J. W. de Bakker %T Correctness proofs for assignment statements %R Report IW 55/76 %I Mathematisch Centrum %C Amsterdam %D 1976 %A J. W. de Bakker %T Semantics and the foundations of program proving %E B. Gilchrist %B Information Processing 77 %I North-Holland %C Amsterdam %D 1977 %P 279-284 %A J. W. de Bakker %T Recursive programs as predicate transformers %E E. Neuhold %B IFIP Working Conference on the Formal Description of Programming Concepts %I North-Holland %C Amsterdam %D to appear %A J. W. de Bakker %A L. G. L. T. Meertens %T On the completeness of the inductive assertion method %J J. Comp. Sys. Sci. %V 11 %D 1975 %P 323-357 %A J. W. de Bakker %A Dana Scott %T A theory of programs %R unpublished %D August 1969 %A Mariangiola Dezani-Ciancaglini %A Maddalena Zacchi %T Application of Church-Rosser properties to increase the parallelism and efficiency of algorithms %J Lecture Notes in Computer Science %V 14 %D 1974 %A E. W. Dijkstra %T A Discipline of Programming %I Prentice Hall %C Englewood Cliffs, N. J. %D 1976 %A J. E. Donahue %T The mathematical semantics of axiomatically defined programming language constructs %E G. Huet and G. Kahn %B Proving and Improving Programs %I IRIA %C Rocquencourt, France %D July 1975 %P 353-367 %A J. E. Donahue %T Complementary Definitions of Programming Language Semantics %J Lecture Notes in Computer Science %V 42 %D 1976 %A J. E. Donahue %T Locations considered unnecessary %J Acta Informatica %V 8 %D 1977 %P 221-242 %A H. Egli %T A mathematical model for non-deterministic computations %D September 1975 %A Herbert Egli %A Robert L. Constable %T Computability concepts for programming language semantics %J Theor. Comp. Sci. %V 2 %D 1976 %P 133-145 %A G. W. Ernst %T Rules of inference for procedure calls %J Acta Informatica %V 8 %D 1977 %P 145-152 %A R. W. Floyd %T Assigning meanings to programs %E J. T. Schwartz %B Mathematical Aspects of Computer Science, Proceedings of a Symposium in Applied Mathematics, Vol. 19 %I American Math. Soc. %C Providence, R. I. %D 1967 %P 19-32 %A Nissim Francez %A Boris Klebansky %A Amir Pnueli %T Backtracking in recursive computations %J Acta Informatica %V 8 %D 1977 %P 125-144 %A Jan V. Garwick %T The definition of programming languages by their compilers %E T. B. Steel, Jr. %B Formal Language Description Languages for Computer Programming %I North-Holland %C Amsterdam %D 1966 %P 139-147 %A Michael Gordon %T Operational reasoning and denotational semantics %E G. Huet and G. Kahn %B Proving and Improving Programs %I IRIA %C Rocquencourt, France %D July 1975 %P 83-98 %A G. A. Gorelick %T A complete axiomatic system for proving assertions about recursive and nonrecursive programs %R Tech. Rep. 75 %I Department of Computer Science, University of Toronto %D January 1975 %A David Gries %T Assignment to subscripted variables %R TR 77-305 %I Department of Computer Science, Cornell University %D September 1976 %A David Gries %T An illustration of current ideas on the derivation of correctness proofs and correct programs %J IEEE Trans. on Software Engineering %V SE-2 %N 4 %D December 1976 %P 238-244 %A David Gries %A Narain Gehani %T Some ideas on data types in high level languages %J Comm. Assoc. Comp. Mach. %K acm cacm %V 20 %N 6 %D July 1976 %P 414-420 %A D. Grune %T A view of coroutines %R Report IW 63/76 %I Mathematisch Centrum %C Amsterdam %D November 1976 %A Irene Guessarian %T Semantic equivalence of program schemes and its syntactic characterization %E S. Michaelson and R. Milner %B Automata, Languages and Programming, Third International Colloquium %I Edinburgh University Press %D July 1976 %P 189-200 %A I. Guessarian %T Sur quelques applic((ations de la semantique algebrique des schemas recursifs polyadiques %D 1977 %A John Guttag %T Abstract data types and the development of data structures %J Comm. Assoc. Comp. Mach. %K acm cacm %V 20 %N 6 %D July 1976 %P 396-404 %A J. V. Guttag %A Ellis Horowitz %A D. R. Musser %T Abstract data types and software validation %R Report ISI/RR-76-48 %I Information Sciences Institute, University of Southern California %C Los Angeles, Ca. %D August 1976 %A J. V. Guttag %A Ellis Horowitz %A D. R. Musser %T The design of data type specifications %R Report ISI/RR-76-49 %I Information Sciences Institute, Univeristy of Southern California %C Los Angeles, Ca. %D November 1976 %A D. Harel %T Arithmetical completeness in logics of programs %D September 1977 %A David Harel %T On the correctness of regular deterministic programs; a unifying survey %D November 1977 %A D. Harel %T Complete axiomatization of properties of recursive programs (extended abstract) %D November 1977 %A David Harel %A Amir Pnueli %A Jonathan Stavi %T A complete axiomatic system for proving deductions about recursive programs %J Ninth ACM Symp. Theory of Computing %D May 1977 %P 249-260 %A D. Harel %A V. R. Pratt %T Nondeterminism in logics of programs %J Proc. 5th ACM Symp. on Principles of Programming Languages %D January 1978 %A William Harrison %T Formal semantics of a schematic intermediate language %R Report RC 6271 %I IBM Research %C Yorktown Heights, N. Y. %D November 1976 %A R. Haskell %T Efficient implementation of a class of recursively defined functions %J Comp. J. %V 18 %N 1 %D 1975 %P 23-29 %A Peter Henderson %A J. H. Morris, Jr. %T A lazy evaluator %J Proc. 3rd ACM Symp. on Principles of Programming Languages %D January 1976 %P 95-103 %A M. C. B. Hennessy %T Parameter passing mechanisms and non-determinism %A M. C. B. Hennessy %A E. A. Ashcroft %T The semantics of nondeterminism %R Report CS-76-17 %I Department of Computer Science, University of Waterloo %D April 1976 %A C. A. R. Hoare %T An axiomatic basis for computer programming %J Comm. Assoc. Comp. Mach. %K acm cacm %V 12 %N 10 %D October 1969 %P 576-580,583 %A C. A. R. Hoare %T Procedures and parameters: an axiomatic approach %J Lecture Notes in Mathematics %V 188 %D 1971 %P 102-116 %A C. A. R. Hoare %T Proof of correctness of data representations %J Acta Informatica %V 1 %D 1972 %P 271-281 %A C. A. R. Hoare %T Hints on programming language design %O Invited address at ACM Symposium on Principles of Programming Languages. %D October 1973 %A C. A. R. Hoare %T Some properties of non-deterministic computations %A C. A. R. Hoare %A P. E. Lauer %T Consistent and complementary formal theories of the semantics of programming languages %J Acta Informatica %V 3 %D 1974 %P 135-153 %A C. M. Hoffman %T Design and correctness of a compiler for Lucid %R Research Report CS-76-20 %I Computer Science Department, University of Waterloo %D May 1976 %A C. M. Hoffman %A L. H. landweber %T A completeness theorem for straight-line programs with structured variables %J J. Assoc. Comp. Mach. %K acm jacm %V 23 %N 1 %D January 1976 %P 203-220 %A Chiharu Hosono %A Masahiko Sato %T The retracts in $P omega$ do not form a continuous lattice \(em a solution to Scott's problem %J Theor. Comp. Sci. %V 4 %D 1977 %P 137-142 %A Gerard Huet %T Confluent Reductions: Abstract Properties and Applications to Term Rewriting Systems %J Proc. 18th IEEE Symp. on Foundations of Computer Science %D October 1977 %P 30-45 %A Gerard Huet %A Bernard Lang %T Program transformations in classes of interpretations %O Lecture Notes %D May 1976 %A Shigeru Igarashi %T Semantics of Algol-like statements %J Lecture Notes in Mathematics %V 188 %D 1971 %P 117-177 %A Shigeru Igarashi %A R. L. London %A D. C. Luckham %T Automatic program verification I: a logical basis and its implementation %J Acta Informatica %V 4 %D 1975 %P 145-182 %A Kurt Jensen %T An investigation into different semantic approaches %R Report DAIMI PB-61 %I Department of Computer Science, University of Aarhus %D June 1976 %A Gilles Kahn %T An approach to systems correctness %A Gilles Kahn %T The semantics of a simple language for parallel programming %E J. L. Rosenfeld %B Information Processing 74 %I North-Holland %C Amsterdam %D 1974 %P 471-475 %A Gilles Kahn %A D. B. MacQueen %T Coroutines and networks of parallel processes %E B. Gilchrist %B Information Processing 77 %I North-Holland %C Amsterdam %D 1977 %P 993-998 %A D. M. Kaplan %T Some completeness results in the mathematical theory of computation %J J. Assoc. Comp. Mach. %K acm jacm %V 15 %N 1 %D January 1968 %P 124-134 %A R. M. Keller %T Denotational models for parallel programs with indeterminate operators %E E. Neuhold %B IFIP Working Conference on the Formal Description of Programming Concepts %I North-Holland %C Amsterdam %D to appear %A D. E. Knuth %A P. B. Bendix %T Simple word problems in universal algebras %E J. Leech %B Computational Problems in Abstract Algebra %I Pergamon Press %C Oxford %D 1970 %P 263-297 %A D. E. Knuth %A L. Trabb Pardo %T Early development of programming languages %B Encyclopedia of Computer Science and Technology, Vol. 7 %I Marcel Dekker %C New York, N. Y. %D 1977 %P 419-493 %R STAN-CS-76-562 %A J. Kral %T On the equivalence of modes and the equivalence of finite automata %J ALGOL Bulletin %N 35 %D March 1973 %P 34-35 %A P. J. Landin %T The mechanical evaluation of expressions %J Comp. J. %V 6 %N 4 %D January 1964 %P 308-320 %A P. J. Landin %T A correspondence between Algol 60 and Church's lambda-notation %J Comm. Assoc. Comp. Mach. %K acm cacm %V 8 %N 2,3 %D February and March 1965 %P 89-101 and 158-165 %A P. J. Landin %T A formal description of Algol 60 %E T. B. Steel, Jr. %B Formal Language Description Languages for Computer Programming %I North-Holland %C Amsterdam %D 1966 %P 266-294 %A P. J. Landin %T The next 700 programming languages %J Comm. Assoc. Comp. Mach. %K acm cacm %V 9 %N 3 %D March 1966 %P 157-166 %A P. J. Landin %T A $lambda -$calculus approach %E L. Fox %B Advances in Programming and Non-numerical Computation %I Pergammon Press %C Oxford %D 1966 %P 97-141 %A Hans Langmaack %T On correct procedure parameter transmission in higher programming languages %J Acta Informatica %V 2 %D 1973 %P 110-142 %A D. Lankford %T On deciding word problems by rewrite rule simplifiers %D September 1977 %A H. F. Ledgard %T A model for type checking \(em with an application to Algol 60 %J Comm. Assoc. Comp. Mach. %K acm cacm %V 15 %N 11 %D November 1972 %P 956- %A J. A. N. Lee %T The formal definition of the Basic language %J Comp. J. %V 15 %N 1 %D February 1972 %P 37-41 %A D. J. Lehmann %A M. B. Smyth %T Data types %J Proc. 18th IEEE Symp. on Foundations of Computer Science %D October 1977 %P 7-12 %A G. T. Ligler %T Proof rules, mathematical semantics and programming language design %D 1975 %A G. T. Ligler %T Surface properties of programming language constructs %J Theor. Comp. Sci. %D to appear %A R. J. Lipton %T A necessary and sufficient condition for the existence of Hoare logics %J Proc. 18th IEEE Symp. on Foundations of Computer Science %D October 1977 %P 1-6 %A R. L. London %T A bibliography on proving the correctness of programs %E B. Meltzer %E D. Michie %B Machine Intelligence 5 %I Edinburgh University Press, Edinburgh, and American Elsevier, New York, N. Y. %D 1970 %P 569-580 %A R. L. London %A M. Shaw %A W. A. Wulf %T Abstraction and verification in Alphard: a symbol table example %D December 1976 %A Peter Lucas %T On the semantics of programming languages and software devices %E R. Rustin %B Formal Semantics of Programming Languages %I Prentice-Hall %C Englewood Cliffs, N. J. %D 1972 %P 41-57 %A P. Lucas %T Formal definition of programming languages and systems %B Information Processing 71 %I North-Holland %C Amsterdam %D 1971 %P 291-297 %A Peter Lucas %A Kurt Walk %T On the formal definition of PL/I %J Annual Review of Automatic Programming %V 6 %N 3 %D 1970 %P 105-182 %A D. C. Luckham %A D. M. R. Park %A M. S. Paterson %T On formalized computer programs %J J. Comp. Sys. Sci. %V 4 %D 1970 %P 220-249 %A D. C. Luckham %A Norihisa Suzuki %T Automatic program verification V: verification oriented proof rules for arrays, records and pointers %R Report STAN-CS-76-549 %D March 1976 %A D. C. Luckham %A Norihisa Suzuki %T Proof of termination within a weak logic of programs %J Acta Informatica %V 8 %D 1977 %P 21-36 %A M. E. Majster %T Extended data graphs, a formalism for structured data and data structures %J Acta Informatica %V 8 %D 1977 %P 37-59 %A Zohar Manna %A Stephen Ness %A Jean Vuillemin %T Inductive methods for proving properties of programs %J Comm. Assoc. Comp. Mach. %K acm cacm %V 16 %N 8 %D August 1973 %P 491-502 %A Zohar Manna %A Jean Vuillemin %T Fixpoint approach to the theory of computation %J Comm. Assoc. Comp. Mach. %K acm cacm %V 15 %N 7 %D July 1972 %P 528-536 %A George Markowsky %T categories of chain-complete posets %J Theor. Comp. Sci. %V 4 %D 1977 %P 125-135 %A G Markowsky %A B. K. Rosen %T Bases for chain-complete posets %J IBM J. Research and Development %V 20 %N 2 %D March 1976 %P 138-147 %A W. D. Maurer %T Induction principles for context-free languages %J Lecture Notes in Computer Science %V 1 %D 1973 %P 134-143 %A John McCarthy %T Recursive functions of symbolic expressions and their computation by machine, part I %J Comm. Assoc. Comp. Mach. %K acm cacm %V 3 %N 4 %D April 1960 %P 184-195 %A John McCarthy %T Towards a mathematical science of computation %E C. M. Popplewell %B Information Processing 1962 %I North-Holland %C Amsterdam %D 1963 %P 21-28 %A John McCarthy %T A basis for a mathematical theory of computation %E P. Braffort and D. Hirschberg %B Computer Programming and Formal Systems %I North-Holland %C Amsterdam %D 1963 %P 33-70 %A John McCarthy %T A formal description of a subset of Algol %E T. B. Steel, Jr. %B Formal Language Description Languages for Computer Programming %I North-Holland %C Amsterdam %D 1966 %P 1-12 %A John McCarthy %A James Painter %T Correctness of a compiler for arithmetic expressions %E J. T. Schwartz %B Proceedings of Symposia in Applied Mathematics, Volume XIX %I American Math. Society ((%C Providence, R. I. %D 1967 %P 33-41 %A M. D. McIlroy %T Coroutines %D 1968 %A Robert Milne %T Verifying the correctness of implementations %D 1977 %A R. E. Milne %T Transforming predicate transformers %E E. Neuhold %B IFIP Working Conference on the Formal Description of Programming Concepts %I North-Holland %C Amsterdam %D to appear %A Robin Milner %T Models in LCF %R Report STAN-CS-73-332 %I Computer Science Department, Stanford University %D January 1973 %A R. Milner %T Processes; a model of computing agents %A R. Milner %T Program semantics and mechanized proof %I Mathematical Centre Tracts 82 %D 1976 %P 3-44 %A R. Milner %T LCF; a methodology for performing rigorous proofs about programs %B First IBM Symposium on Mathematical Foundations of Computer Science %I Academic and Scientific Programs, IBM Japan %C Tokyo %D October 1976 %A J. H. Morris, Jr. %T Another recursion induction principle %J Comm. Assoc. Comp. Mach. %K acm cacm %V 14 %N 5 %D May 1971 %P 351-354 %A P. D. Mosses %T The mathematical semantics of Algol 60 %R Technical Monograph PRG-12 %I Programming Research Group, Oxford University %D 1974 %A P. D. Mosses %T The semantics of semantic equations %J Lecture Notes in Computer Science %V 28 %D 1975 %P 409-422 %A P. D. Mosses %T Compiler generation using denotational semantics %J Lecture Notes in Computer Science %V 45 %D 1976 %P 436-441 %A P. D. Mosses %T Making denotational semantics less concrete %D 1977 %A Maurice Nivat %T On some families of languages related to the Dyck language %J Proc. 2nd ACM Symp. on Theory of Computing %D May 1970 %P 221-225 %A M. Nivat %T On the interpretation of recursive program schemes %R Rapport de Recherche No 84 %I IRIA %C Rocquencourt, France %D October 1974 %A Mike O'Donnell %T Subtree replacement systems: a unifying theory for recursive equations, Lisp, Lucid and combinatory logic %J Ninth ACM Symp. Theory of Computing %D May 1977 %P 295-305 %A D. C. Oppen %A S. A. Cook %T Proving assertions about programs that manipulate data structures %J Proc. 7th ACM Symp. on Theory of Computing %D May 1975 %P 107-116 %A B. A. Othmer %T Programming language data structures: a comparative study %R Tech. Rep. No. 30 %I Department of Computer Science, Rutgers University %D March 1974 %A G. Pacini %T An optimal fix-point computation rule for a simple recursive language %R Nota Interna B73-10 %I Consiglio Nazionale delle Ricerche, Istituto di Elaborazione della Informazione %C Pisa %D October 1973 %A G. Pacini %A C. Montangero %A F. Turini %T Graph representation and computation rules for typeless recursive languages %J Lecture Notes in Computer Science %V 14 %D 1974 %P 158-169 %A F. G. Pagan %T On interpreter oriented definitions of programming languages %J Comp. J. %V 19 %N 2 %D 1976 %P 151-155 %A David Park %T Some semantics for data structures %E D. Michie %B Machine Intelligence 3 %I American Elsevier %C New York, N. Y. %D 1968 %P 351-371 %A David Park %T Fixpoint induction and proofs of program properties %B Machine Intelligence 5 %D 1970 %P 59-78 %A David Park %T Finiteness is mu-ineffable %J Theor. Comp. Sci. %V 3 %D 1976 %P 173-181 %A Helmut Partsch %A Peter Pepper %T A family of rules for recursion removal %J Information Processing Letters %V 5 %N 6 %D December 1976 %P 174-177 %A G. D. Plotkin %T A set-theoretical definition of application %R Memorandum MIP-R-95 %I School of Artificial Intelligence, University of Edinburgh %D March 1972 %A G. D. Plotkin %T Lambda-definability and logical relations %R Memorandum SAI-RM-4 %I School of Artificial Intelligence, University of Edinburgh %D October 1973 %A G. D. Plotkin %T Call-by-name, call-by-value and the $lambda -$calculus %J Theor. Comp. Sci. %V 1 %D 1975 %P 125-159 %A A. Pnueli %T The temporal logic of programs %J Proc. 18th IEEE Symp. on Foundations of Computer Science %D October 1977 %P 46-57 %A V. R. Pratt %T Semantical considerations in Floyd-Hoare logic %J Proc. 17th IEEE Symp. on Foundations of Computer Science %D October 1976 %P 109-121 %A J. C. Raoult %A J. Vuillemin %T Operational and semantic equivalence between recursive programs %D 1977 %A J. C. Reynolds %T Relational and continuation semantics for a simple imperative language %B Seminaires IRIA: theorie des algorithmes, des langages et de la programmation %D 1974 %P 51-58 %A J. C. Reynolds %T On the relation between direct and continuation semantics %J Lecture Notes in Computer Science %V 14 %D 1974 %P 141-156 %A J. C. Reynolds %T Formal semantics %O preliminary draft for Cosers %D June 1976 %A J. C. Reynolds %T Semantics of the domain of flow diagrams %J J. Assoc. Comp. Mach. %K acm jacm %V 24 %N 3 %D July 1977 %P 484-503 %A H. G. Rice %T Recursion and iteration %J Comm. Assoc. Comp. Mach. %K acm cacm %V 8 %N 2 %D February 1965 %P 114-115 %A J. S. Rohl %T Converting a class of recursive procedures into non-recursive ones %J Software \(em Practice and Experience %V 7 %D 1977 %P 231-238 %A B. D. Russell %T Implementation correctness involving a language with goto statements %J SIAM J. Computing %V 6 %N 3 %D September 1977 %P 403-415 %A Bruce Russell %T On an equivalence between continuation and stack semantics %J Acta Informatica %V 8 %D 1977 %P 113-123 %A Andrzej Salwicki %T Procedures, formal computations and models %J Lecture Notes in Computer Science %V 28 %D 1975 %P 464-484 %A J. G. Sanderson %T The lambda calculus, lattice theory and reflexive domains %D 1973 %A E. Sciore %A A. Tang %T Computability theory in admissible domains %D 1977 %A Dana Scott %T Outline of a mathematical theory of computation %J Proc. 4th Princeton Conf. on Information Sciences and Systems %D March 1970 %P 169-176 %A Dana Scott %T The lattice of flow diagrams %J Lecture Notes in Mathematics %V 188 %D 1971 %P 311-366 %A Dana Scott %T Continuous lattices %E F. W. Lawvere %B Toposes, Algebraic Geometry and Logic %I Lecture Notes in Mathematics 274, Springer Verlag %C Berlin %D 1972 %P 97-136 %A Dana Scott %T Mathematical concepts in programming language semantics %J Proc. AFIPS SJCC %D 1972 %P 225-234 %A Dana Scott %T A simplified construction for $lambda -$calculus models %C Uppsala %D April 1973 %A Dana Scott %T Data types as lattices %J SIAM J. Computing %V 5 %N 3 %D September 1976 %P 522-587 %A Dana Scott %T Logic and programming languages %J Comm. Assoc. Comp. Mach. %K acm cacm %V 20 %N 9 %D September 1977 %P 634-640 %A Dana Scott %A Christopher Strachey %T Towards a mathematical semantics for computer languages %B Proceedings of the Symposium on Computers and Automata %I Polytechnic Press %C Brooklyn, N. Y. %D April 1971 %P 19-46 %A Adi Shamir %A W. W. Wadge %T Data types as objects %J Lecture Notes in Computer Science %V 52 %D 1977 %P 465-479 %A M. Shaw %A W. A. Wulf %A R. L. London %T Abstraction and verification in Alphard: iteration and generators %R Report ISI/RR-76-47 %I Information Sciences Institute, University of Southern California %C Los Angeles %D August 1976 %A M. B. Smyth %T Powerdomains %D 1977 %A M. B. Smyth %A G. D. Plotkin %T The category-theoretic solution of recursive domain equations %J Proc. 18th IEEE Symp. on Foundations of Computer Science %D October 1977 %P 13-17 %A J. E. Stoy %T The congruence of two programming language definitions %J Theor. Comp. Sci. %D to appear %A Christopher Strachey %T Towards a formal semantics %E T. B. Steel, Jr. %B Formal Language Description Languages for Computer Programming %I North-Holland %C Amsterdam %D 1966 %P 198-220 %A Christopher Strachey %T Varieties of programming language %B International Computing Symposium Proceedings %I Cini Foundation %C Venice %D April 1972 %P 222-233 %A Christopher Strachey %A Christopher Wadsworth %T Continuations: a mathematical semantics which can deal with full jumps %R Technical Monograph PRG-11 %I Programming Research Group, Oxford University %D 1974 %A A. Tang %T Chain properties in P$omega$ %D 1977 %A Alfred Tarski %T A lattice-theoretical fixpoint theorem and its applications %J Pacific J. Math. %V 5 %N 2 %D June 1955 %P 285-309 %A R. D. Tennent %T Mathematical semantics of Snobol 4 %J Proc. ACM Symp. on Principles of Programming Languages %D October 1973 %P 95-107 %A R. D. Tennent %T The denotational semantics of programming languages %J Comm. Assoc. Comp. Mach. %K acm cacm %V 19 %N 8 %D August 1976 %P 437-453 %A R. D. Tennent %T Language design methods based on semantic principles %J Acta Informatica %V 8 %D 1977 %P 97-112 %A R. D. Tennent %T A denotational definition of the programming language Pascal %R Tech. Rep. 77-47 %I Department of Computing and Information Science, Queen's University %C Kingston, Ontario %D July 1977 %A A. van Wijngaarden %T Recursive definition of syntax and semantics %E T. B. Steel, Jr. %B Formal Language Description Languages for Computer Programming %I North-Holland %C Amsterdam %D 1966 %P 13-24 %A S. A. Walker %A H. R. Strong, Jr. %T Characterizations of flowchartable recursions %J J. Comp. Sys. Sci. %V 7 %N 4 %D August 1973 %P 404-447 %A Mitchell Wand %T A characterization of weakest preconditions %J J. Comp. Sys. Sci. %V 15 %D 1977 %P 209-212 %A Ben Wegbreit %T Procedure closure in EL1 %J Comp. J. %V 17 %N 1 %D February 1974 %P 38-43 %A Ben Wegbreit %T The treatment of data types in EL1 %J Comm. Assoc. Comp. Mach. %K acm cacm %V 17 %N 5 %D May 1974 %P 251-264 %A Ben Wegbreit %T Constructive methods in program verification %J IEEE Trans. on Software Engineering %V SE-3 %N 3 %D May 1977 %P 193-209 %A W. A. Wulf %A R. L. London %A Mary Shaw %T An introduction to the construction and verification of Alphard programs %J IEEE Trans. on Software Engineering %V SE-2 %N 4 %D December 1976 %P 253-265 . J. %V 17 %N 1 cmd/refer/shell.c 644 0 33 656 2111463500 7133 ((shell (n, comp, exch) int (*comp)(), (*exch)(); /* SORTS UP. IF THERE ARE NO EXCHANGES (IEX=0) ON A SWEEP THE COMPARISON GAP (IGAP) IS HALVED FOR THE NEXT SWEEP */ { int igap, iplusg, iex, i, imax; igap=n; while (igap > 1) { igap /= 2; imax = n-igap; do { iex=0; for(i=0; i0); } } ,5< /,"cmd/refer/test 644 0 33 4156 2111463500 6601 .LP hoboken harrison newark roseville avenue grove street .[ Aho Ullman subsequence 1976 .] east orange brick church orange highland avenue mountain station south orange maplewood millburn short hills .[ Kernighan software tools 1975 .] summit chatham madison convent station morristown new providence murray hill berkeley heights gillette stirling millington lyons basking ridge .[ Kernighan typesetting guide second .] bernardsville far hills peapack gladstone .LP Each person to whom this notice is addressed is entitled to submit, .[ Kernighan tools 1975 .] or request the Department of Labor to submit, to the District Director described above, a comment on the question of whether the Plan meets the requirements for qualification under Part I of Subchapter D of Chapter I of the Internal Revenue Code of 1954. Two or more such persons .[ Blue Cubic spline CSTR .] may join in a single comment or request. If such a person or persons request the Department of Labor to submit a comment and that department declines to do so in respect of one or more matters raised in the request, the person or persons so requesting may submit a comment to the .[ Graham small hexagon .] .[ Blue cubic spline CSTR .] District Director in respect of the matters on which the Department of Labor declines to comment. A comment submitted to the District Director must be received by him on or before June 30, 1977. However, if it is being submitted on a matter on which the Department of Labor was first requested, but declined to comment, the comment .[ Chambers methods linear models .] must be received by the District Director on or before the later of June 30, 1977 or the 15th day after the day on which the Department of Labor notifies such person that it declines to comment, but in no event later than July 15, 1977. A request of the Department of Labor to submit a comment must be received by that department on or before June 10, 1977, or, if the person or persons making the request wish to preserve their right to submit a comment to the District Director in the event the Department of Labor declines to comment, on or before May 30, 1977. .[ $LIST$ .] f June 30, 1977 or the 15th day after the day on which the Department of Labor notifies such person that it declines to comment, but in no event later than July 15, 1977. A request of the Department of Labor to submit a comment must be received by that department on or before June 10, 1977, or, if the person or persons making the request wish to preserve their right to submit a comment to the Districmd/refer/thash.c 644 0 33 3373 2111463500 7152 # include "stdio.h" int nh 500; int saw[6000]; char *comname "/usr/lib/eign"; main (argc,argv) char *argv[]; { int i, z; char *name; FILE *f; while (argc>1 && argv[1][0] == '-') { switch(argv[1][1]) { case 'h': nh = atoi(argv[1]+2); break; } argc--; argv++; } if (argc<=1) dofile(stdin, ""); else for(i=1; i0 ? n : -n); } r(q=n=0; c= *s; s++) n += (c*n + c << (n%4)); return(n); } err (s, a) char *s; { fprintf(stderr, "Error: "); fprintf(stderr, s, a); putc('\n', stderr); } prefix(t, s) char *t, *s; { int c, d; while ( (c= *t++) == *s++) if (c==0) return(1); return(c==0 ? 1: cmd/refer/types.c 644 0 33 351 2111463500 7160 # if LONG # define ptr long # define uptr long # define getp getl # define putp putl # define MONE -1L extern long getl(); # else # define ptr int # define uptr unsigned # define getp getw # define putp putw # define MONE -1 # endif (n>0 ? n : -n); } r(q=n=0; c= *s; s++) n += (c*n + c << (n%4)); return(n); } err (s, a) char *s; { fprintf(stderr, "Error: "); fprintf(stderr, s, a); putc('\n', stderr); } prefix(t, s) /,5؈< /,"cmd/refer/what..c 644 0 33 475 2111463500 7044 # include "stdio.h" # include "ctype.h" # include "sys/types.h" # include "sys/stat.h" # include "assert.h" # define NFILES 100 # define NAMES 2000 extern exch(), comp(); struct filans { char *nm; long fdate; long size; int uid; }; extern struct filans files[NFILES]; extern char fnames[NAMES]; # define NFEED 5 , a) char *s; { fprintf(stderr, "Error: "); fprintf(stderr, s, a); putc('\n', stderr); } prefix(t, s) /,5< /,"cmd/refer/what1.c 644 0 33 4445 2111463500 7070 # include "what..c" struct filans files[NFILES]; char fnames[NAMES]; int relfeed 0; char *rb[NFEED]; char rbb[200], *rbp rbb;; main(argc,argv) char *argv[]; { char *s, *t, *xargv[50], *wd[50]; struct filans *af; int xargc 0, nw, nf, i; while (argc>1 && argv[1][0]=='-') { switch(argv[1][1]) { case 'r': relfeed=1; break; } argc--; argv++; } if (argc<=1) { printf("No query.\n"); return(0); } nf = doclook(argc,argv,0); printf(" %d files\n",nf); if (relfeed && nf>NFEED) { wrdoc(NFEED, argc, argv, 1); nw = freqwd (rb, wd, argc); for(i=0; rb[i]; i++) unlink(rb[i]); } for(i=0; ifdate != p2->fdate) return(p2->fdate > p1->fdate); return(p2->uid >= p1->uid); } wrdoc ( np, argc, argv, relfeed ) { struct filans *af; char *s, *t, buf[200]; int eval, k, pid; FILE *rf NULL; FILE *ans NULL; pid=getpid(); for(af=files; affdate); getpw(af->uid, s=buf); while (*s && *s!=':') s++; *s=0; printf("%s (%.20s) %s, %ld bytes\n"((,af->nm,t+4,buf,af->size); if (relfeed) { k=af-files; _assert (knm, argc,argv, rf); if (relfeed) { printf("You like that one?"); fflush(stdout); fgets(buf, 100, stdin); switch(buf[0]) { case 'y': case 'Y': eval=1; break; case 'n': case 'N': eval = -1; break; default: eval=0; break; } fclose(rf); if (eval<=0) { unlink(rb[k]); rb[k][0]=0; } } } if (relfeed) rb[np]=0; } lfind( wl, n, wds) char *wl, *wds[]; { int i; for(i=0; itext, 0, rf); } int state 0; int oldc '\n'; gsent(buf, bsize, fi) char *buf; FILE *fi; { char *s; int c, leng 0; /* state 0: looking for '.' 1: looking for nl or space aftter '.' 2: looking for nl after line with dot. */ s=buf; if (state==2) *s++='.'; while ( (c = getc(fi)) > 0 ) { switch(state) { case 0: /* normal */ if (c=='.' && oldc == '\n') { *s=0; state=2; oldc='\n'; return(1); } *s++ = (c=='\n'? ' ': c); if (s>=buf+bsize) { *--s = 0; return(1); } if (c=='.' || c == '?' || c=='!') if (leng>1) state=1; leng = (isalpha(c) ? leng+1 : 0); break; case 1: /* found ., want nl or space */ if (c==' ' || c == '\n') { *s=0; state=0; oldc=c; return(1); } *s++ = (c=='\n' ? ' ' : c); state=0; leng = 0; break; case 2: /* found trof line, want nl */ if (c == '\n') { *s=0; state=0; oldc='\n'; return(1); } *s++ = c; break; } oldc=c; } *s=0; return(0); } prefix( p, s) char *p, *s; { int c; while ( (c= *p++) == *s++) if (c==0) return(1); return(c==0); } output (s, ln, rf) char *s; FILE *rf; { char *t; int more 1; t=s; while (more) { while (t(s+25)) t--; *t=0; more=1; } else more=0; printf("%s%s\n",ln++ ? " " : " ", s); if (rf!=NULL) fprintf(rf, "%s\n", s); s= ++t; } } count(isent, nw, wds) char *wds[], *isent; { int saw[50], ct; char sb[BUFSIZ], *s sb; int i, c; for(i=1; itext = stext[ns], line); sp->olap = kov; return(ns+1); } for(sp=sents+ns-1; sp>=sents; sp--) { if (sp->olap < lval) { least = sp; lval = sp->olap; } } if (kov <= lval) return(ns); ob = least->text; while (++least < sents+NS) { (least-1)->text = least->text; (least-1)->olap = least->olap; } sp = sents+NS-1; strcpy (sp->text=ob, line); sp->olap = kov; return(NS); } int lval 100; char *ob; struct sf *sp, *least NULL; if (kov<=0) retucmd/refer/what3.c 644 0 33 3107 2111463500 7064 # include "what..c" doclook(argc, argv, colevel) char *argv[]; { int fpa[2], fpb[2], fpc[2], pid1, pid2, st; int iarg; char *s; FILE *ansf; struct filans *af; struct stat statbuf; # define RD 0 # define WR 1 # define fmv(x,y) close(y); dup(x); close(x); /* we want to run chkbib and then lhunt and pipe in & out */ pipe (fpa); /* from this program to chkbib */ pipe (fpb); /* from chkbib to lhunt */ pipe (fpc); /* from lhunt to us */ if ( (pid1 = fork()) ==0) { fmv(fpa[RD], 0); fmv(fpb[WR], 1); close(fpa[WR]); close(fpb[RD]); close(fpc[RD]); close(fpc[WR]); execl("/usr/lib/refer/mkey", "mkey", "-s", 0); _assert(0); } if ( (pid2 = fork()) == 0) { char coarg[20]; sprintf(coarg, "-C%d", colevel); fmv(fpb[RD], 0); fmv(fpc[WR], 1); close(fpa[RD]); close(fpa[WR]); close(fpb[WR]); close(fpc[RD]); execl("/usr/lib/refer/hunt", "hunt", /* "-P", */ coarg, "-Ty", "-Fn", "/usr/dict/lookall/All", 0); _assert(0); } _assert (pid1 != -1); _assert(pid2 != -1); close(fpb[RD]); close(fpb[WR]); close(fpa[RD]); close(fpc[WR]); ansf = fopen("/dev/null", "r"); fmv (fpc[RD], ansf->_file); for(iarg=1; iargnm=s, NAMES, ansf)==0) break; trimnl(s); if (*s==0) continue; while (*s++); _assert(snm, &statbuf); if (st<0) continue; af->uid = statbuf.st_uid; af->fdate = statbuf.st_mtime; af->size = statbuf.st_size; af++; } fclose(ansf); return(af-files); } prod(f,s) char *s; { write (f, s, strlen(s)); write (f, "\n", 1); } ansf->_file); for(iarg=1; iargnm=s, NAMES, ansf)==0) break; trimnl(s); if (*s==0) continue; while (*s++); _assert(snm, &statbuf); if (st<0) continue; af->uid = statbuf.st_uid; af->fdate = statbuf.st_mtime; af->size = statbuf.st_size; af++; } fclose(ansf); return(af-files); cmd/refer/what4.c 644 0 33 5120 2111463500 7062 # include "what..c" struct wst { char *tx; int ct; } ; # define NW 5 # define ZIPF 10 # define HASHF 3 # define WLEN 10 # define SAME 0 # define TSIZE HASHF*ZIPF*NW int HSIZE; static struct wst word[TSIZE]; static char tbuf[NW*ZIPF*WLEN], *tp tbuf; # define NF 10 freqwd ( fn, wd, nin ) char *fn[], *wd[]; { FILE *fi[NF]; int nw 0, i, any, nf, j, wexch(), wcomp(); char tw[20]; for(HSIZE=TSIZE; !prime(HSIZE); HSIZE--); for(nf=0; fn[nf] && nf0) word[j].ct++; } } while (any>0); shell ( TSIZE, wcomp, wexch ); for(nw=0; word[nw].ct >0 && nw=nin*2 && word[nw].ct != word[0].ct) break; for(i=0; i0 ? k : -k); } gw (f, t) char *t; FILE *f; { int start 1, oldc ' ', c; if (f==NULL) return (0); while ( (c=getc(f)) != EOF) { if (isupper(c)) c= tolower(c); if (start==1) if (!alphanum(c, oldc)) continue; else start=0; if (start==0) if (alphanum(c, oldc)) *t++ = c; else { *t=0; return(1); } oldc=c; } return(0); } alphanum( c, oldc ) { if (isalpha(c) || isdigit(c)) return(1); if (isalpha(oldc)) if (c== '\'' || c == '-') return(1); return(0); } wcomp (n1, n2) { return (word[n1].ct >= word[n2].ct); } wexch (n1, n2) { struct wst tt; tt.tx = word[n1].tx; tt.ct = word[n1].((ct; word[n1].tx = word[n2].tx; word[n1].ct = word[n2].ct; word[n2].tx = tt.tx; word[n2].ct = tt.ct; } prime(n) { /* only executed once- slow is ok */ int i; if (n%2==0) return(0); for(i=3; i*i<=n; i+= 2) if (n%i ==0 ) return(0); return(1); } trimnl(s) char *s; { while (*s)s++; if (*--s=='\n') *s=0; } /* this is the test for what4.c as a standalone prog ... main (argc, argv) char *argv[]; { char *ff[10], *wd[20], **ffp ff; int n, i; while (--argc) *ffp++ = *++argv; *ffp=0; n=freqwd(ff,wd); for(i=0; iinp =0; q->out =0; q->nst =0; q->link =0; q->fail =0; } xargc = argc-1; xargv = argv+1; while (xargc>0 && xargv[0][0]=='-') { switch(xargv[0][1]) { case 'r': /* return value only */ rflag++; break; case 'n': /* number of answers needed */ need = xargv[1]; xargv++; xargc--; break; case 'i': instr = xargv[1]; inct = xargv[2]+2; # if D2 fprintf(stderr,"inct %d xargv.2. %o %d\n",inct, xargv[2],xargv[2]); # endif xargv += 2; xargc -= 2; break; } xargv++; xargc--; } if (xargc<=0) { write (2, "bad fgrep call\n", 15); exit(2); } # if D1 fprintf(stderr, "before cgoto\n"); # endif cgotofn(); # if D1 fprintf(stderr, "before cfail\n"); # endif cfail(); # if D1 fprintf(stderr, "before execute instr %.20s\n", instr? instr: ""); fprintf(stderr, "end of string %d %c %c %c\n", inct, instr[inct-3], instr[inct-2], instr[inct-1]); # endif execute(); # if D1 fprintf(stderr, "returning nsucc %d\n", nsucc); fprintf(stderr, "fgrep done www %o\n",www); # endif return(nsucc == 0); } execute() { register char *p; register struct words *c; register ch; register ccount; int f; char *nlp; f=0; ccount = instr ? inct : 0; nfound=0; p = instr ? instr : buf; if (need == 0) need = numwords; nlp = p; c = www; # if D2 fprintf(stderr, "in execute ccount %d inct %d\n",ccount, inct ); # endif for (;;) { # if D3 fprintf(stderr, "down ccount\n"); # endif if (--ccount <= 0) { # if D2 fprintf(stderr, "ex loop ccount %d instr %o\n",ccount, instr); # endif if (instr) break; if (p == &buf[1024]) p = buf; if (p > &buf[512]) { if ((ccount = read(f, p, &buf[1024] - p)) <= 0) break; } else if ((ccount = read(f, p, 512)) <= 0) break; # if D2 fprintf(stderr, " normal read %d bytres\n", ccount); {char xx[20]; sprintf(xx, "they are %%.%ds\n", ccount); fprintf(stderr, xx, p); } # endif } nstate: ch = *p; # if D2 fprintf(stderr, "roaming along in ex ch %c c %o\n",ch,c); # endif if (isupper(ch)) ch |= 040; if (c->inp == ch) { c = c->nst; } else if (c->link != 0) { c = c->link; goto nstate; } else { c = c->fail; if (c==0) { c = www; istate: if (c->inp == ch) { c = c->nst; } else if (c->link != 0) { c = c->link; goto istate; } } else goto nstate; } if (c->out && new (c)) { # if D2 fprintf(stderr, " found: nfound %d need %d\n",nfound,need); # endif if (++nfound >= need) { # if D1 fprintf(stderr, "found, p %o nlp %o ccount %d buf %o buf[1024] %o\n",p,nlp,ccount,buf,buf+1024); # endif if (instr==0) while (*p++ != '\n') { # if D3 fprintf(stderr, "down ccount2\n"); # endif if (--ccount <= 0) { if (p == &buf[1024]) p = buf; if (p > &buf[512]) { if ((ccount = read(f, p, &buf[1024] - p)) <= 0) break; } else if ((ccount = read(f, p, 512)) <= 0) break; # if D2 fprintf(stderr, " read %d bytes\n",ccount); { char xx[20]; sprintf(xx, "they are %%.%ds\n", ccount); fprintf(stderr, xx, p); } # endif } } nsucc = 1; if (rflag==0) { # if D2 fprintf(stderr, "p %o nlp %o buf %o\n",p,nlp,buf); if (p>nlp) {write (2, "XX\n", 3); write (2, nlp, p-nlp); write (2, "XX\n", 3);} # endif if (p > nlp) write(1, nlp, p-nlp); else { write(1, nlp, &buf[1024] - nlp); write(1, buf, p-&buf[0]); } if (p[-1]!= '\n') write (1, "\n", 1); } if (instr==0) { nlp = p; c = www; nfound=0; } } else ccount++; continue; } # if D2 fprintf(stderr, "nr end loop p %o\n",p); # endif if (instr) p++; else if (*p++ == '\n') { nlp = p; c = www; nfound=0; } } if (instr==0) close(f); } cgotofn() { register c; register struct words *s; s = smax = www; nword: for(;;) { # if D1 fprintf(stderr, " in for loop c now %o %c\n",c, c>' ' ? c : ' '); # endif if ((c = gch())==0) return; else if (c == '\n') { s->out = 1; s = www; } else { loop: if (s->inp == c) { s = s->nst; continue; } if (s->inp == 0) goto enter; if (s->link == 0) { if (smax >= &www[MAXSIZ - 1]) overflo(); s->link = ++smax; s = smax; goto enter; } s = s->link; goto loop; } } enter: do { s->inp = c; if (smax >= &www[MAXSIZ - 1]) overflo(); s->nst = ++smax; s = smax; } while ((c = gch()) != '\n'); smax->out = 1; s = www; numwords++; goto nword; } gch() { static char *s; if (flag==0) { flag=1; s = *xargv++; # if D1 fprintf(stderr, "next arg is %s xargc %d\n",s,xargc); # endif if (xargc-- <=0) return(0); } if (*s) return(*s++); for(flag=0; flag<1024; flag++) buf[flag]=0; flag=0; return('\n'); } overflo() { write(2,"wordlist too large\n", 19); exit(2); } cfail() { struct words *queue[QSIZE]; struct words **front, **rear; struct words *state; register char c; register struct words *s; s = www; front = rear = queue; init: if ((s->inp) != 0) { *rear++ = s->nst; if (rear >= &queue[QSIZE - 1]) overflo(); } if ((s = s->link) != 0) { goto init; } while (rear!=front) { s = *front; if (front == &queue[QSIZE-1]) front = queue; else front++; cloop: if ((c = s->inp) != 0) { *rear = (q = s->nst); if (front < rear) if (rear >= &queue[QSIZE-1]) if (front == queue) overflo(); else rear = queue; else rear++; else if (++rear == front) overflo(); state = s->fail; floop: if (state == 0) state = www; if (state->inp == c) { q->fail = state->nst; if ((state->nst)->out == 1) q->out = 1; continue; } else if ((state = state->link) != 0) goto floop; } if ((s = s->link) != 0) goto cloop; } } static int seen[50]; new (x) { int i; for(i=0; iP߭ 4'ݬ 9߭ݬ 9߭PP9yPP89"P#'u'9A߭."ݬݬ8͸8ݬ͸"8͸P ЬP ͸59͸29&11ݬ<.͸988.i8&b811W8*!8(P68X&O&2G&?&P֠Pʹ``P&&ʹ77P֠P`P 7zPʹP7 !x!84-=!%%XP7S7@PN7P(717P%"%!լ8%߭7-%$[^ԭԭ1BЭP@PPP1)֭ѭѬT ѬJgЭP@ݭV7PݭA7Pݭ-7gPݭݬ Ь PЭP@Э֭  ׭ѭѬA3ЭP,(#׭ѭ~ݬ $ ~ݬ ѬA1vլݭЭP@~ݬ D1W֭ѭ1P^N6#_լ1#4PЬ QA`~Ь P@#36k#$1ݭ5P-P5C#֭ѭ ݭݭ߭ݬݬPPЬP֬`)ݬP+2խ"ݬ {5"|^`,ݬЭP@H2P3PЭQA`֭ѭݬЬP3@2@ 23P3`Ï@v3PPݏ4 Ѭdݏd4 P53QЬRPBa, ЬP֬ЬQ֬`aޔ^"ЬP֬` ѭ -ЬP֬`Ь P׬ PӔ^֬Eխ ЬP֬.`ԭ1ЬP֬`+:PЭQA`ЭP֭P ЬP֬Q`Ѭ Ȕ ^28Ьн֭֭PQQPӏP敽 QЭPսЬPΤ^͸Ͱͨͤ 3 \ͼ1ͼP@1ЭP`~Pc͸ͰZ V3R  ЭP~PЭPʹPͰ!ЭPʹPͰ ͸ʹЭʹ PݭPЭP`~jP1͸1Ͱݭ2Z ݭ͸28͸T)ݭ/Pr2j PPPPͤ͸A1VݭP.PPPͨ18ʹ*2 P͸1ʹA1HݭPPPRͰ)ݭʹ1X1ݭʹ1|51ͼP@PAPPPͬ1Hͬs1( ͬ<ݏA P H1PL1PP31 ݭ,1 ݭP.PPPͨNͰ(ݭʹ0:  nݭʹ0_ ʹP2C-ݭQ PPPP0" ʹ͸ʹT)ݭP~0 PPPPͤͼͼ1<͸ͰE0l ͤ-0O ͨ0y2 ݬݬ[P0U ^ԭЭP֭Ь@Ь PЭQ֭PA֭PݏJݬݬP/PݏBݬݬP/PݏRݬݬqP/PݏGݬݬRPp/PݏIݬݬ3P_/PݏMݬݬPG/PI/P^ԭ1ЭP@P`~PЭP@PPP P֭ѭP^Ьԭ13PЭQA`PP0ѭ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, P+ݬ.'%''xݏcP[PZ߭ PP Pѭ[]ZRЭPݬ ݬݬ;  0  QP^BЬ2߭ \~ݬ&׭ЭP֭``P ߭ЬP^Ь[Ь Ь\[PZY Y%ZZݭPP[QQ~Y!cdefg+l-.o0123456789abcdef^U|YPPQPA2QM..._ekvvvvvvvvvPPs1PxzPu1Pr1TPP*1CP1(null)XPZPЌRR:PbQURQpPPoPxPdHPu1[~RS T RSTSVQЌPRSPQAVRe;0Tn n8 n;  ~Z0nݭQUUYPPZPPPQU1ilPP n4 n  n錪  nPUP^QZ1Z1ZZZZ IiY>I((Y HhX>HXZ1VXZZ1KЌXЌ\Ќ[10ZXXWWVWWWWPPnW3PWPP#VWP֭WP-WxWP@(RnVЭPPX'(AcխXVVVV()cXP%VVX8Wn 1GDeB+B+D.@0RVQPVPQ'խQRVPЎPR QPVPRPQQPRQPRPc0XZXXPPnX.PXPP֭XPP/XxXP@ZlxXPSPQXWQPQ`WWѭ+WPP!PЭWXWPPXWn4WníWX1XWPPXWn4WnWX(nVXP08Xn ׭n8ne QZ+Q; ?a1AZ11pUorUUUR>B€R R RZqPURRRRR dUR R8tPTUPUP  tpUPUP  PpPT~/SRRRRTRdcPSTRgPPRRT BCG@M [u+pЬZЬ[ЬY1Y~ZiЩP֩``P Yݬr֬ լ output buff too long (%d)@,K1K5K%s%c%s%%.%ds%%s%%s%%s%c%d%c%d.[.[ File %s, line %d- punctuation ignored from: %s\*([.\*(.]%s%s%s r,\|/tmp/rj%dcwCan't get scratch file %s.ds [F %s%cA An The .\"%s%c%c%s%c%c%d%c%cbflab overflow (%d)nref in labc overflow (%d)the an a .]-%c..%c%s%c.as [%c " %s%c.;,?XYZ[].de [%c%c%s%c.ds [%c%s%c.as [A ",%s \s-2AND\s+2 and%s%c.de [%c%c%s%c.ds [%c%s%c.nr [P %d%c.;,?..%c.nr [T %d%c.nr [A %d%c.][ %s%c1 journal-article3 article-in-book4 tech-report4 tech-report2 book5 bell-tm0 othertoo many references (%d) for tablereftext too big (%d)sort %s -o %s%s r.]< %d.]> rCan't reopen %s %dError: .ig/tmp/rj%dgfgrepCan't read fgrep index %sCan't write fgrep output %srcan't read fgrep output %s  AAAAAABBBBBB /bin/shsh-cS$+4J%?U\b gx% ,28 ?FPU[ahou}   (.5AIRX^eks{  "(1BIR\ d kq y     ((08?J[agnw#9a   ,7LRX_hs !'-4=H]cipy  4 ; I O U ` k              " ( . 5 > D J R X g m }               $ 2 < E O Y b l v               " ) 2 ; B H O d k w ~       *K.6@NT\es/DPXgq| %,PYax !'/CJ^ek rz    %|.Gp"Afsy5<G%EL^p.5Wg-4>GPV]clry!=EL}IShrT< CR\ci o|     ! ' - 4 > G M S Z j p v }     !!!#!+!C!M!m!!! !!!!!!!!!!!!!""."5"K"U" ["b"j"r"y"""""""""""""###*#4#<#D#K#R#Y#########$$$$$$$$$ $$$ $%&%%%%%%%%% %% %%& &"&-&6&A&L&R&X& _&q& w&~&&'.'F'L' S'^' f' m'''''((((()) $)8)F)}))))))*1*|********** +'+0+=+J+X+h+x+++,U,,0-O---X.n...V///]000$1F111111 22 !2 22c222223333Q33333 4#404@4L4U4Z4a4f4l4q4w4|444444455#5+5>5E5R5Y5h5o5t5555555555_6l666666666 67 7 8 8$808 88 @8D8H8|= >$>(>Q Q S O crt0.oexitrefer0.o<refer1.o<.R1.R2.R3.R4refer2.o_dr8.R1.R2.R3.R4refer3.o .R1refer4.o _gatex;_buff|;.R1.R2.R3.R4refer5.o_sig?_bflab@_labtabG_lbp|I_labcI_stbuffI_prevsigJ.R1.R2.R3.R4.R5.R6.R7_article J.R8refer6.op.R1.R2.R3.R4.R5.R6.R7refer7.o$.R1.R2.R3refer8.o"_aheadL_peekedP_noteofP.R1.R2.R3deliv2.o|#.R1.R2.R3.R4.R5glue4.o$.R1.R2calloc.ot'fork.o'fputs.oI'fprintf.h(atoi.o$(fgets.op(fopen.o(dup.ol)pipe.oI)printf.oI)ctype_.o)filbuf.o)strlen.o`*system.oJt*_exit.oy+execl.o+execv.o8,+execve.oD+creat.oIP+signal.oI`+lseek.oIp+getpid.oI+sprintf.+doprnt.oh+strout.os 1flsbuf.oh1exit.oL3data.oX3strcmp.oX3close.o&x3isatty.oI3open.o3read.oI3strcat.oI3strcpy.oM3stty.oD3ioctl.o(4unlink.oI84malloc.oIH4sbrk.oh6vfork.ow6wait.o56write.oI6cerror.oI7_exit(L3start_main<_environ%8_inV8__iobQ_endpushK8_labels 8_keywant8_sort8_bare8_authrev8_smallca 8_keystr$8_nmlen)(8_dtlen,8_rdataP_search08_refnum48_reftext_reftabl= _rtp88_sep<8_tfile_fo@8_ftemp0D8_ofilem_gfile_hidenam'_IfileH8_Iline[L8_signals_atoi$(_err#_getpidD+_sprintfH+_fopen(_fprintfW(_fclosef2_dumpoldQ_outputE _recopy!_clfgrepZ'_cleanupbX_dorefx_input"_prefix$_intr6_signal`+_unlink84_one_onelen 8_control _strcatM3_strlenJ`*_strcmp&X3__ctype_Q_common(_corout] _newline> _trimnl1_choicesy _chkdup$_putsig_tabs_putkey)_flout _putref9p_pipe)_fork'_closex3_dupu)_execl+_write-6_waity6_read3_fputs'_strcpyD3_appendp _fpar*_keylet5_addchp^#_lookat0#__flsbufh1__filbuf)_mycpy2_mycpy]V_initaddI_artskpM_mindexMV$_caps0B_last _revauth<_classl8_hastype_newr_system8t*_printfE)_fgetsp(_hashH|#_zalloct$_calloc:t'_grepcal$_open83_creatP+_fgrep _mallockH4_cfree'_free5cerrorI7__doprnt+__lastbuS_errno5_lseekp+_dup2l)_vfork6__exit+_execv:,+_execveD+_getppid+__strouts 1_isatty{3__sobufz_fflush2__cleanu2__sibuf_gtty4_stty3_ioctl (4_sbrk2h6_realloc5_endG_brkw6_calloc:t'_grepcal$_open83_creatP+_fgrep _mallockH4_cfree'_free5cerrorI7__doprnt+__lastbuS_errno5_lseekp+_dup2l)_vfork6__exit+_execv:,+_execveD+_getppid+__strouts 1_isatty{3__sobufz_fflush2__cleanu2__sibuf_gtty4_stty3_ioctl (4_sbrk2h6((cmd/diction/ 775 0 33 0 2552527464 6157 cmd/diction/Makefile 644 0 33 3120 2550565216 7671 # make file for STYLE and DICTION # # BIN is the directory for storing the object code # for the 3 programs that make up style # DICT is the full pathname of the file dict.d, the # dictionary file used by DICTION # BIN = ${DESTDIR}/usr/lib DICT= -DDICT=\"/usr/lib/dict.d\" all: diction style explain deroff style: style1 style2 style3 install: style diction install -s style1 ${DESTDIR}/usr/lib install -s style2 ${DESTDIR}/usr/lib install -s style3 ${DESTDIR}/usr/lib install -s dprog ${DESTDIR}/usr/lib install -s deroff ${DESTDIR}/usr/lib rm -f ${DESTDIR}/usr/bin/deroff ln ${DESTDIR}/usr/lib/deroff ${DESTDIR}/usr/bin/deroff install -c style ${DESTDIR}/usr/bin install -c diction ${DESTDIR}/usr/bin install -c explain ${DESTDIR}/usr/bin install -c dict.d ${DESTDIR}/usr/lib install -c explain.d ${DESTDIR}/usr/lib clean: rm -f prtlex.c wdslex.c endlex.c rm -f *.o style1 style2 style3 dprog style3: prtlex.o pscan.o outp.o cc prtlex.o pscan.o outp.o -ll -o style3 prtlex.c: part.l lex part.l mv lex.yy.c prtlex.c prtlex.o: names.h prtlex.c cc -c -O prtlex.c pscan.o: names.h conp.h cc -c -O pscan.c outp.o: names.h conp.h style.h cc -c -O outp.c style1: wdslex.o cc wdslex.o -ll -o style1 wdslex.o: wdslex.c nhash.c dict.c ydict.c names.h cc -c wdslex.c wdslex.c: nwords.l lex nwords.l mv lex.yy.c wdslex.c style2: endlex.o cc endlex.o -ll -o style2 endlex.o: names.h endlex.c ehash.c edict.c cc -c endlex.c endlex.c: end.l lex end.l mv lex.yy.c endlex.c diction: dprog dprog: diction.c cc -O $(DICT) diction.c -i -o dprog deroff: deroff.c cc -O deroff.c -i -o deroff conp.h cc -c -O pscan.c outp.o: names.h conp.h style.h cc -c -O outp.c style1: wdslex.o cc wdslex.o -ll -o style1 wdslex.o: wdslex.c nhash.c dict.c ydict.c names.h cc -c wdslex.c wdslex.c: nwords.l lex nwords.l mv lex.yy.c wdslex.c style2: endlex.o cc endlex.o -ll -o style2 endlex.o: names.h endlex.c ehash.c edict.c cc -c endlex.c endlex.c: end.l lex end.l mv lex.yy.c endlex.c diction: dprog dprog: diction.c cc cmd/diction/nwords.l 644 0 33 13636 2262222031 7740 %{ /* break out words, output cap + word(inverted) */ #include #define OUT() for(i=yyleng-1;i>=0; i--)putchar(yytext[i]); putchar('\n') #define OUT1(nam) printf("%c:%s\n",nam,yytext) #define OUTN(string) printf("%s\n",string) #include "names.h" #include "nhash.c" #include "dict.c" #include "ydict.c" char nt[] = "D:n't"; char qs[] = "c:'s"; char fin[] = "E:."; int i,j; int dot = 0; int first = 1; int qflg,nflg; int cap = 0; %} %p 3000 %a 2500 L [a-z] N [0-9] C [A-Z] %% (St|Dr|Drs|Mr|Mrs|Ms)"." { OUT1(NOUN); } {C}{L}*'[s] { pos(1); if(first==1)first=0; } {C}+['][s]* { OUT1(POS); } (({C}+{L}*)|({C}*{L}+))+([-](({C}*{L}+)|({C}+{L}*))+)+ { OUT1(NOUN_ADJ); } {C}{C}+ { if((i=input()) == 's'){ yytext[yyleng++] = 's'; yytext[yyleng] = '\0'; OUT1(NOUN); } else { unput(i); for(i=0;i0;i--) if(yytext[i] == '.')break; unput(yytext[yyleng-1]); yytext[i] = '\0'; OUT1(NOUN_ADJ); OUTN(fin); first = 1; } [ \t`][a-zA-Z0-9.]*("\/"[a-zA-Z0-9]+"."*)+[']* { if(yytext[yyleng-1] == '.')dot=1; OUT1(NOUN_ADJ); } {N}+([,]{N}+)*("."{N}+)*[']*[s]* { OUT1(NOUN_ADJ); } {N}*([,]{N}+)*("."{N}+)+[']*[s]* { OUT1(NOUN_ADJ); } {N}+([,]{N}+)*("."{N}*)*[']*[s]* { if(yytext[yyleng-1] == '.')dot=1; OUT1(NOUN_ADJ); } {L}+[-]*{N}+ { OUT1(NOUN_ADJ); } {C}+[-]*{N}+ { OUT1(NOUN_ADJ); } {N}+[-]+{C}+ { OUT1(NOUN_ADJ); } {N}+[%] { OUT1(NOUN_ADJ); } "$"{N}+([,]{N}+)*("."{N}*)* { if(yytext[yyleng-1] == '.')dot=1; OUT1(NOUN); } [Aa]"."[ ]*[Mm]"." { OUT1(ADJ_ADV); } [Pp]"."[ ]*[Mm]"." { OUT1(ADJ_ADV); } "a."[ ]*"d." { OUT1(ADJ_ADV); } "b."[ ]*"c." { OUT1(ADJ_ADV); } "i."[ ]*"e." { OUT1(PREP); } "e."[ ]*"g." { OUT1(PREP); } "etc."[ \n]*[,)]* { i = yytext[4]; yytext[4] = '\0'; OUT1(NOUN); yytext[4] = i; yytext[0] = yytext[yyleng-1]; yytext[1] = '\0'; if(yytext[0] == ',' || yytext[0] == ')') OUT1(','); else { OUTN(fin); first = 1; } } "et al." { OUT1(NOUN); } [Nn][Oo][s]*"." { OUT1(NOUN_ADJ); } [Ff]ig[s]*"." { OUT1(NOUN_ADJ); } [Dd]ept[s]*"." { OUT1(NOUN_ADJ); } [Ee]q"." { OUT1(NOUN_ADJ); } dB"." { OUT1(NOUN_ADJ); } vs"." { OUT1(PREP); } in"."[ \n]*{C} { unput(yytext[yyleng-1]); yytext[2] = '\0'; OUT1(PREP); OUTN(fin); first = 1; } (in|ft|yr|ckts|mi)"." { OUT1(NOUN_ADJ); } Ph"."[ ]*[Dd]"." { OUT1(ADJ); } [Jj]r"." { OUT1(ADJ); } [Cc]h"." { OUT1(NOUN_ADJ); } [Rr]ef[s]*"." { OUT1(NOUN_ADJ); } Inc"." { OUT1(ADJ); } [A-Z]"." { dot=1; OUT1(NOUN); } can't { yytext[3]='\0'; yyleng -= 2; nflg=1; goto wd; } won't { OUT1('X'); } {L}+n't { nflg=1; yytext[yyleng-3]='\0'; yyleng -= 3; goto wd; } [A-Z]{L}+n't { yytext[0]+= 'a' - 'A'; nflg=1; yytext[yyleng-3]='\0'; yyleng -= 3; goto wd; } o'clock { OUT1(ADV); } {L}+'[s] { pos(0); } 'll { OUT1(lookup("will",1,0)); } 've { OUT1(lookup("have",1,0)); } 're { OUT1(lookup("are",1,0)); } 'd { OUT1(lookup("had",1,0)); } 'm { OUT1(lookup("am",1,0)); } 'ld { OUT1(lookup("would",1,0)); } {L}+ { wd: if((j = lookup(yytext,1,0)) != 0){ first=0; if(cap){ yytext[0] += 'A' - 'a'; cap = 0; if(dot)OUTN(fin); } dot=0; OUT1(j); if(nflg==1){ nflg=0; OUTN(nt); } } else{ first = dot=0; if(yytext[yyleng-1] == 'y' && cap == 0){ switch(yytext[yyleng-2]){ case 'c': look(cy,yyleng-2,NOUN); break; case 'f': look(fy,yyleng-2,VERB); break; case 'l': look(ly,yyleng-2,ADV); break; case 'g': if(yytext[yyleng-3] == 'o'){ OUT1(NOUN); break; } look(gy,yyleng-2,ADJ); break; case 'r': switch(yytext[yyleng-3]){ case 'a': look(ary,yyleng-3,ADJ); break; case 'o': look(ory,yyleng-3,ADJ); break; case 'e': look(ery,yyleng-3,NOUN); break; default: look(ry,yyleng-2,NOUN); } break; case 't': if(yytext[yyleng-3] == 'i')look(ity,yyleng-3,NOUN); else look(ty,yyleng-2,ADJ); break; default: OUT(); } } else { if(cap){ yytext[0] += 'A' - 'a'; cap = 0; OUT1(NOUN_ADJ); } else { OUT(); } } } } [\n] ; [ ]+ ; [\t]+ ; ";" { OUT1(';'); first=1; } (\"|`|')+ { if(dot){ OUTN(fin); dot=0; } if(qflg==1){ qflg=0; OUT1('"'); } else { qflg=1; first=1; OUT1('"'); } } ".\"" { qflg=0; first=1; OUT1(END); } "..." { OUT1(','); } "/." { first = 1; OUT1(END); } "." { first=1; OUT1(END); } "!\"" { qflg=0; first=1; OUT1(END); } "!" { first=1; OUT1(END); } "?\"" { qflg=0; first=1; OUT1(END); } "?" { first=1; OUT1(END); } ":" { OUT1(','); first=1; } [-]+ { OUT1(','); first=1; } "," { OUT1(','); } (\[|\(|\{|\]|\)|\}) { OUT1(','); } . { /* fprintf(stderr,"nwords funny char: %c\n",yytext[0])*/ ; } %% look(f,n,cc) char (*f)(); int n; char cc; { int nn; char save; save=yytext[n]; yytext[n] = '\0'; nn=(*f)(yytext,1,0); yytext[n] = save; if(nn != 0){ OUT1(nn); } else { OUT1(cc); } } pos(flg){ int ii,j; if(flg==1)yytext[0] += 'a' - 'A'; for(ii=yyleng-1;yytext[ii] != '\''; ii--); yytext[ii] = '\0'; if((j=lookup(yytext,1,0)) != 0){ yyleng = ii; OUT1(j); OUTN(qs); } else{ if(flg==1)yytext[0] += 'A' - 'a'; yytext[ii] = '\''; OUT1(POS); } } char *filename="-"; main(argc,argv) int argc; char *argv[]; { register int rc=0; putchar(':'); putchar('\n'); getd(); ygetd(); if(argc<=1) { yylex(); }else{ while(argc>1) { if(freopen(argv[1],"r",stdin)==NULL) { fprintf(stderr,"%s: cannot open\n", argv[1]); rc++; }else{ filename=argv[1]; yylex(); } argc--; argv++; } } return(rc); } ,0)) != 0){ yyleng = ii; OUT1(j); OUTN(qs); } else{ if(flg==1)yytext[0] += 'A' - 'a'; cmd/diction/end.l 644 0 33 4425 2262222051 7150 ((%{ #include #include "names.h" #include "ehash.c" #include "edict.c" #define OUT1(c) putchar(c); putchar(':'); for(i=yyleng-1;i>=0;)putchar(yytext[i--]) int i; int nomin = 0; %} C [A-Z0-9a-z",;] L [a-zA-Z-] %% ^{C}:.+ { ECHO; } ^ci.+ { look(ic,2,ADJ); } ^de.+ { look(ed,2,ED); } ^draw.+ { OUT1(ADJ_ADV); } ^eca.+ { look(ace,3,NOUN_VERB); } ^eci.+ { look(ice,3,NOUN_VERB); } ^ecne.+ { if(look(ence,4,NOUN))nomin++; } ^ecna.+ { if(look(ance,4,NOUN))nomin++; } ^ee.+ { look(ee,2,NOUN); } ^ega.+ { look(age,3,NOUN); } ^elba.+ { look(able,4,ADJ); } ^elbi.+ { look(ible,4,ADJ); } ^elc.+ { look(cle,3,NOUN); } ^eru.+ { if(look(ure,3,NOUN))nomin++; } ^eti.+ { look(ite,3,NOUN); } ^evi.+ { look(ive,3,ADJ); } ^ezi.+ { look(ize,3,VERB); } ^gni.+ { look(ing,3,ING); } ^hsi.+ { look(ish,3,ADJ); } ^lac.+ { look(cal,3,ADJ); } ^lanoi.+ { look(ional,5,ADJ); } ^luf.+ { look(ful,3,ADJ); } ^msi.+ { OUT1(NOUN); } ^nam.* { look(man,3,NOUN); } ^nem.* { OUT1(NV_PL); } ^noi.+ { if(look(ion,3,NOUN))nomin++; } ^pihs.+ { look(ship,4,NOUN); } ^ral.+ { look(lar,3,ADJ); } ^ronoh { OUT1(NOUN_VERB); } ^ro.+ { OUT1(NOUN); } ^si.+ { look(is,2,NOUN); } ^ssel.+ { look(less,4,ADJ); } ^ssen.+ { look(ness,4,NOUN); } ^sse.+ { look(ess,3,NOUN); } ^ss.+ { look(ss,2,NOUN); } ^suo.+ { look(ous,3,ADJ); } ^su.+ { look(us,2,NOUN); } ^s.+ { if(yytext[yyleng-1] >= 'A' && yytext[yyleng-1]<= 'Z'){ OUT1(NOUN); } else { OUT1(NV_PL); } } ^tna.+ { look(ant,3,NOUN_ADJ); } ^tnem.+ { if(look(ment,4,NOUN))nomin++; } ^tse.+ { look(est,3,ADJ); } ^tsi.+ { look(ist,3,NOUN); } [,\n] { putchar(yytext[0]); } {L}+ { if(yytext[yyleng-1] >= 'A' && yytext[yyleng-1] <= 'Z'){ if((yytext[0] == 'n' || yytext[0] == 'l') && yytext[1] == 'a'){ OUT1(NOUN_ADJ); } else { OUT1(NOUN); } } else { OUT1(UNK); } } : { egetd(); } %% look(f,n,nc) char (*f)(); int n; char nc; { int in,nn,ret; char sch; in=0; sch=yytext[yyleng-1]; if(sch>= 'A' && sch <= 'Z'){ yytext[yyleng-1] = sch -'A' +'a'; in=1; } if((*f)(&yytext[n],1,0) != 0){ nn = (*f)(&yytext[n],1,0); ret = 0; } else { nn = nc; ret = 1; } if(in==1){ if(nn == NOUN_VERB)nn=NOUN; yytext[yyleng-1]=sch; } OUT1(nn); return(ret); } yywrap(){ printf(";%d\n",nomin); return(1); } } else { OUT1(NOUN); } } else { OUT1(UNK); } } : { egetd(); } %% look(f,n,nc) char (*f)(); int n; char nc; { int in,nn,ret; char sch; in=0; sch=yytext[yyleng-1]; if(sch>= 'A' && sch <= 'Z'){ yytext[yyleng-1] = scmd/diction/part.l 644 0 33 14540 2271155753 7405 %{ #include "style.h" #include "names.h" #include "conp.h" int part = 0; int style = 1; int pastyle = 0; int pstyle = 0; int lstyle = 0; int rstyle = 0; int estyle = 0; int lthresh; int rthresh; int nomin; char s[SCHAR]; char *sptr = s; struct ss sent[SLENG]; struct ss *sentp = sent; float wperc(); float sperc(); float typersent(); float vperc(); int numsent = 0; int qcount = 0; int icount = 0; long vowel = 0; long numwds = 0; long twds = 0; long numnonf = 0; long letnonf = 0; int maxsent = 0; int maxindex = 0; int minsent = 30; int minindex = 0; int simple = 0; int compound = 0; int compdx = 0; int prepc = 0; int conjc = 0; int complex = 0; int tobe = 0; int adj = 0; int infin = 0; int pron = 0; int passive = 0; int aux = 0; int adv = 0; int verbc = 0; int tverbc = 0; int noun = 0; long numlet = 0; int beg[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; int sleng[50]; int j,jj,i; int comma = 0; int cflg; int question; int quote = 0; char *st; int initf = 0; int over = 1; %} C [A-DF-Za-z] %% ^{C}:.+ { collect: sentp->cc = sentp->ic = yytext[0]; collect1: sentp->leng = yyleng-2; sentp++->sp = sptr; if(sentp >= &sent[SLENG-1]){ if(over)fprintf(stderr,"sentence %d too many words\n",numsent+2); over=0; sentp--; } if(sptr+yyleng >= &s[SCHAR-1]){ if(over)fprintf(stderr,"sentence %d too many characters\n",numsent+2); over=0; } else { for(i=2;icc=END; sentp->ic = ';'; goto collect1; } ^",:".+ { comma++; goto collect; } ^",:"[:,-]+ { comma++; goto collect; } [\n] ; ^"\":".+ { goto collect; } ^E:"/." { cflg = 1; goto sdone; } ^E:.+ { cflg = 0; sdone: over=1; sentp->cc=sentp->ic=END; sentp++->sp = sptr; for(i=2;i 100.) fgrad = 4.; else if(findex > 70.)fgrad=(100.-findex)/10 +5.; else if(findex > 60.)fgrad =(70.-findex)/10+8.; else if(findex >50.)fgrad=(60.-findex)/5+10; else fgrad=(50.-findex)/6.66 +13.; adjs = 100 * (float)numsent/numwds; cindex = 5.89*avl-.3*adjs-15.8; printf("readability grades:\n (Kincaid) %4.1f (auto) %4.1f (Coleman-Liau) %4.1f (Flesch) %4.1f (%4.1f)\n",kindex,aindex,cindex,fgrad,findex); printf("sentence info:\n"); printf(" no. sent %d no. wds %ld\n",numsent,numwds); printf(" av sent leng %4.1f av word leng %4.2f\n",avw,avl); printf(" no. questions %d no. imperatives %d\n",qcount,icount); if(numnonf != 0){ snonf = (float)(letnonf)/(float)(numnonf); } printf(" no. nonfunc wds %ld %4.1f%% av leng %4.2f\n",numnonf,(float)(numnonf)*100/numwds,snonf); mg = avw + 10.5; if(mg > 49)mg = 49; ml = avw - 4.5; if(ml <= 0)ml = 1; else if(ml > 49)ml = 48; gsum = lsum = 0; for(ii=0;ii<50;ii++){ if(ii < ml)lsum += sleng[ii]; else if(ii > mg)gsum+= sleng[ii]; } printf(" short sent (<%d)%3.0f%% (%d) long sent (>%d) %3.0f%% (%d)\n",ml,sperc(lsum),lsum,mg,sperc(gsum),gsum); printf(" longest sent %d wds at sent %d; shortest sent %d wds at sent %d\n",maxsent,maxindex,minsent,minindex); printf("sentence types:\n"); printf(" simple %3.0f%% (%d) complex %3.0f%% (%d)\n",sperc(simple),simple,sperc(complex),complex); printf(" compound %3.0f%% (%d) compound-complex %3.0f%% (%d)\n",sperc(compound),compound,sperc(compdx),compdx); printf("word usage:\n"); printf(" verb types as %% of total verbs\n"); printf(" tobe %3.0f%% (%d) aux %3.0f%% (%d) inf %3.0f%% (%d)\n",vperc(tobe),tobe,vperc(aux),aux,vperc(infin),infin); if(verbc != 0)adjs = (float)(passive)*100/(float)(verbc); else adjs=0; printf(" passives as %% of non-inf verbs %3.0f%% (%d)\n",adjs,passive); printf(" types as %% of total\n"); printf(" prep %3.1f%% (%d) conj %3.1f%% (%d) adv %3.1f%% (%d)\n",wperc(prepc),prepc,wperc(conjc),conjc,wperc(adv),adv); printf(" noun %3.1f%% (%d) adj %3.1f%% (%d) pron %3.1f%% (%d)\n",wperc(noun),noun, wperc(adj),adj,wperc(pron),pron); printf(" nominalizations %3.0f %% (%d)\n",wperc(nomin),nomin); printf("sentence beginnings:\n"); ii=beg[0]+beg[7]+beg[6]+beg[3]+beg[8]; printf(" subject opener: noun (%d) pron (%d) pos (%d) adj (%d) art (%d) tot %3.0f%%\n", beg[0],beg[7],beg[6],beg[3],beg[8],sperc(ii)); printf(" prep %3.0f%% (%d) adv %3.0f%% (%d) \n",sperc(beg[9]),beg[9],sperc(beg[4]),beg[4]); printf(" verb %3.0f%% (%d) ",sperc(beg[1]+beg[10]+beg[12]),beg[1]+beg[10]+beg[12]); printf(" sub_conj %3.0f%% (%d) conj %3.0f%% (%d)\n",sperc(beg[13]),beg[13],sperc(beg[5]),beg[5]); printf(" expletives %3.0f%% (%d)\n",sperc(beg[14]),beg[14]); } return(1); } float wperc(a) { return((float)(a)*100/numwds); } float sperc(a) { return((float)(a)*100/numsent); } float typersent(a) { return((float)(a)/numsent); } float vperc(a) { if(tverbc == 0)return(0); return((float)(a)*100/tverbc); } main(argc,argv) char **argv; { while(--argc > 0 && (++argv)[0][0] == '-' ){ switch(argv[0][1]){ case 's': style=1; continue; case 'p': pastyle=style=1; continue; case 'a': pstyle=style=1; continue; case 'e': estyle = style = 1; continue; case 'l': style=lstyle=1; lthresh = atoi(*(++argv)); continue; case 'r': style=rstyle=1; rthresh = atoi(*(++argv)); continue; case 'P': part = 1; continue; default: fprintf(stderr,"unknown flag to part %s\n",*argv); exit(1); } argv++; } yylex(); } --argc > 0 && (++argv)[0][0] == '-' ){ switch(argv[0][1]){ case 's': style=1; continue; case 'p': pastyle=style=1; continue; case 'a': pstyle=stylcmd/diction/pscan.c 644 0 33 36744 2262222073 7532 ((#include "names.h" #include "conp.h" char lastc,nextc; int savsub; scan(si,ce,command) /*scan a phrase */ int si; char ce; { char c; i=si; if(command == 1)subty = PLURAL; else subty = 0; if(sent[i].cc==ADJ_ADV && sent[i+1].cc != NOUN && sent[i+1].cc != UNK && sent[i+1].cc != ADJ) sent[i++].cc = ADV; done=0; verb = 0; verb=getv(i,ce); /*get verb if obvious*/ if(command == 0)j=getnoun(i,ce); /*get subject*/ else j = si; if(i != j || ((i==j) && sent[i].cc == NOUN)){ i = j+1; } for(;((c=sent[i].cc) != ce) && (c != END) && (c != '\0');i++){ nextc=sent[i+1].cc; if(i>0){ lastc=sent[i-1].cc; if(lastc==BE)be=1; else{ if(lastc != ADV)be=0; } } else lastc=0; if(verb==1)question=0; switch(c){ case '"': if(nextc==ED){ verb=1; sent[++i].cc=VERB; subty=SING; continue; } subty=0; verb=getv(++i,ce); i=getnoun(i,ce); continue; case ART: case ADJ: case POS: case ING: aflg=1; i=getnoun(i,ce); aflg=0; continue; case PREP: if(nextc == ce){ sent[i].cc=ADV; goto sdone; } prep=1; i=getnoun(++i,ce); prep=0; continue; case VERB_ADJ: if(verb==0){ sent[i].cc=VERB; verb=1; continue; } case NOUN_ADJ: if(be==1){ sent[i].cc=ADJ; continue; } case PRONP_ADJ: case PRONS_ADJ: i=getnoun(i,ce); continue; case NOUN_ADV: if(verb == 1 && iverb == i+1){ sent[i].cc = NOUN; } else { sent[i].cc = ADV; } continue; case ADJ_ADV: if(be == 1){ if(nextc == ADJ || nextc == NOUN_ADJ || nextc == ADJ_ADV || nextc == UNK){ sent[i].cc = ADV; continue; } if(nextc == ',' && (sent[i+2].cc == ADJ_ADV || sent[i+2].cc == ADV)){ sent[i++].cc = ADV; sent[++i].cc = ADV; comma--; continue; } sent[i].cc = ADJ; continue; } if(lastc == NOUN && (nextc == ',' || nextc == END)){ sent[i].cc=ADJ; continue; } if(nextc!= UNK && nextc != NOUN_VERB && nextc != NOUN && nextc != NV_PL){ sent[i].cc=ADV; continue; } sent[i].cc=ADJ; continue; case WHO: i=who(i,ce); continue; case PRONP: subty=PLURAL; continue; case NOUN: if(nextc==NOUN){ sent[i].cc=ADJ; continue; } case PRONS: subty=SING; continue; case CONJ: if(nextc==UNK || nextc == NOUN_VERB || nextc == NV_PL){ if(lastc == ADJ)sent[++i].cc = ADJ; else sent[++i].cc = VERB; } if(nextc == ED){ sent[++i].cc = VERB; } continue; case AUXP: case AUXS: case BES: case BEP: case AUXV: case AUX: case HAS: case HAVE: case HAD: verb=getv(i,ce); continue; case ADV: case AUXX: case VERB: case BE: case INTER: continue; case THAT: if(nextc==SUBCONJ){ sent[i].cc=PRONP; goto subc; } verb=getv(i+1,ce); j = i+1; while(sent[j].cc == ADV || sent[j].cc == ADJ_ADV){ j++; } if((verb==1 && iverb== j) || sent[j].cc==ED || sent[j].cc == VERB_ADJ){ sent[i].cc=PRONP; while(i+1 < j)sent[++i].cc = ADV; } else if(verb==0 && nextc==NV_PL && ((lastc==NOUN && (sent[i-1].ic==UNK || sent[i-1].ic==NOUN_VERB|| sent[i-1].ic==NOUN))|| lastc == ',')){ sent[i].cc=PRONP; subty=SING; } else if(verb==0 && (nextc==UNK || nextc==NOUN_VERB) && (lastc==NOUN && sent[i-1].ic==NV_PL)){ subty=PLURAL; sent[i].cc=PRONP; } else { if(i == 0)sent[i].cc=ADJ; else sent[i].cc=SUBCONJ; j=i; subty=0; i=getnoun(i+1,ce); if(done)sent[j].cc=ADJ; } continue; case ',': if(nextc != CONJ){ /*parenthetical*/ continue; } i++; comma--; if(sent[i+1].cc == ED){ sent[++i].cc = VERB; continue; } if(command == 1){ verb = getv(++i,ce); continue; } case SUBCONJ: subc: if(nextc==END||(lastc==',' && nextc==',')){ sent[i].cc=ADV; continue; } subty=0; ce=','; verb=getv(++i,ce); i=getnoun(i,ce); continue; case PREP_ADV: if(sent[i+2].cc==PREP_ADV &&(sent[i+1].cc != NOUN && sent[i+1].cc != NOUN_VERB && sent[i+1].cc != NV_PL)){ sent[i].cc=ADV; sent[i+2].cc=CONJ; continue; } sav=i++; savsub = subty; pverb=getv(i,ce); if((pverb==1 && iverb == i) || sent[i].cc== ED){ sent[sav].cc=PRONP; sent[i].cc=VERB; continue; } i=getnoun(i,ce); if(done==1){ sent[sav].cc=ADV; goto sdone; } if(pverb==1 && iverb == i+1){ sent[sav].cc=SUBCONJ; ce=','; continue; } switch(sent[i+1].cc){ case UNK: case NV_PL: case NOUN_VERB: case ED: sent[sav].cc=SUBCONJ; verb=0; ce=','; continue; default: sent[sav].cc=PREP; subty = savsub; continue; } case TO: sent[i++].cc=VERB; switch(nextc){ case UNK: case AUXS: case VERB_ADJ: case NOUN_VERB: case ED: case VERB: sent[i].cc=VERB; continue; case HAVE: sent[i].cc = VERB; if(sent[i+1].cc == ED){ sent[++i].cc = VERB; continue; } if(sent[i+1].cc != BE)continue; i++; case BE: sent[i].cc=VERB; if(sent[i+1].cc == ED || sent[i+1].cc == ING){ sent[++i].cc = VERB; } else if(sent[i+1].cc == UNK){ sent[++i].cc = ADJ; } continue; default: sent[i-1].cc = PREP; prep=1; i=getnoun(i,ce); prep=0; continue; } case NV_PL: if(subty==0){ i=getnoun(i,ce); subty=PLURAL; } else if(verb== 0){ /*need verb*/ sent[i].cc=VERB; verb=1; } else{ i=getnoun(i,ce); } continue; case UNK: case NOUN_VERB: if(verb==1){ if(be==1 && nextc != WHO){ sent[i].cc=ADJ; continue; } i=getnoun(i,ce); } else if(nextc==NV_PL &&( sent[i+2].cc==NOUN_VERB || sent[i+2].cc==NOUN|| sent[i+2].cc==UNK || sent[i+2].cc==NV_PL)){ sent[i].cc=NOUN; if(sent[i-1].cc == NOUN){ sent[i-1].cc = ADJ; } subty=SING; continue; } else if(subty==0){ i=getnoun(i,ce); continue; } else { /* desparation */ sent[i].cc=VERB; verb=1; } continue; case ED: if(verb == 0){ sent[i].cc=VERB; verb=1; } else if(sent[i-1].cc == BE){ sent[i].cc = VERB; } else{ i=getnoun(i,ce); } continue; default: printf("got a %c on %s\n",sent[i].cc,sent[i].sp); } } sdone: if(sent[i].cc==END && sent[i].ic != ';')return(-1); else { if(sent[i].ic == ';')sent[i].cc=';'; else comma--; return(i); } } getv(si,ce) int si; char ce; { int conj; char c; int ik; must=0; bflg=0; hflg=0; verbty=0; for(j=si;((c=sent[j].cc) != ce) && (c != END); j++){ iverb=j; switch(c){ case ED: continue; case HAS: hflg=1; verbty=SING; sent[j].cc=AUXX; goto next; case HAVE: if(sent[j-1].cc==TO){ continue; } case HAD: hflg=1; verbty=PLURAL; sent[j].cc=AUXX; goto next; case BE: if(sent[j].ic != BE){ return(1); } continue; case VERB: if(sent[j-1].cc==TO){ continue; } return(1); case AUXX: return(1); case AUXP: must=1; verbty=PLURAL; sent[j].cc=AUXX; goto next; case AUXS: if(sent[j-1].cc==TO){ continue; } verbty=SING; sent[j].cc=AUXX; goto next; case AUX: case AUXV: must=1; sent[j].cc=AUXX; next: if(sent[j-1].cc == CONJ && verb == 0)conj = 0; else conj = 1; if(question==1){ j=getnoun(j+1,ce); question=0; } getv2(ce); if(sent[j].cc == AUXX){ sent[j].cc = VERB; } if((sent[j].cc!=VERB && sent[j].cc!=BE) && sent[iverb].cc==AUXX){ sent[iverb].cc=VERB; for(ik=iverb+1;ik<=j;ik++)sent[ik].cc=sent[ik].ic; } return(conj); case BES: verbty=SING; bflg=1; sent[j].cc=BE; goto next; case BEP: verbty=PLURAL; bflg=1; sent[j].cc=BE; goto next; case SUBCONJ: if(sent[j-1].cc== ',' && sent[j+1].cc == ','){ continue; } case THAT: case WHO: goto vdone; case ',': if(comma==1 && sent[j+1].cc==CONJ){ goto vdone; } } } vdone: return(0); } getv2(ce) char ce; { int vflg; char c; vflg=0; while(((c=sent[++j].cc) != ce) && (c != END)){ switch(c){ case NOUN_ADV: case ADJ_ADV: if(bflg == 0 || sent[j+1].cc == ED || sent[j+1].cc == ING){ sent[j].cc = ADV; } else{ j -= 1; return; } case ADV: continue; case SUBCONJ: if(sent[j+1].cc == ED || sent[j+1].cc == ING || sent[j+1].cc == ADV || sent[j+1].cc == ADJ_ADV)sent[j].cc = ADV; else return; continue; case VERB: return; case VERB_ADJ: case ED: sent[j].cc=VERB; return; case BE: must=0; bflg=1; continue; case ING: if(bflg == 1){ sent[j].cc = VERB; } else { j -= 1; } return; case NOUN_VERB: case UNK: if(bflg==1 || vflg==1 || hflg==1){ j -= 1; return; } sent[j].cc=VERB; return; case PRONP_ADJ: case PRONS_ADJ: c=sent[j+1].cc; if(c==ED||c==ING||c==BE||must==1){ sent[j].cc = ADV; } else{ j -= 1; return; } continue; case AUXV: case AUX: case AUXP: case AUXS: case HAD: case HAVE: case HAS: must=0; vflg=1; sent[j].cc=AUXX; continue; default: j -= 1; return; } } j -= 1; } getnoun(k,ce) int k,ce; { char c; int st,t,nextst; int rep; int t1,tt; st=k; rep=0; b: nextst=sent[st+1].cc; switch(sent[st].cc){ case END: done=1; break; case ',': if(ce==','){ done=1; break; } else { goto getdef; } case '"': if(aflg == 1){ st++; goto b; } break; case NOUN: switch(nextst){ case UNK: case NOUN_VERB: if(verb==1){ goto nn; } if(subty != PLURAL){ goto nn; } break; case NV_PL: if(verb==1){ goto nn; } if(subty == PLURAL){ goto nn; } break; case NOUN_ADJ: case POS: case NOUN: nn: sent[st].cc=ADJ; goto b; } if(prep==0)subty=SING; break; case ADV: st++; goto b; case WHO: st=who(st,ce); st++; goto b; case ADJ_ADV: case VERB_ADJ: case ED: sent[st++].cc=ADJ; goto b; case ING: if(nextst==UNK || nextst==NOUN_VERB || nextst==NOUN || nextst==NV_PL){ sent[st++].cc=ADJ; goto b; } sent[st].cc=NOUN; if(prep==0)subty=SING; break; case ART: case POS: if(st != k){ goto ge((tdef; } case ADJ: st++; goto b; case PRONP: if(prep==0)subty=PLURAL; break; case PRONS: if(prep==0)subty=SING; break; case NOUN_VERB: if(nextst==NOUN||(verb==1 && (nextst== NV_PL|| nextst==NOUN_VERB) )){ sent[st].cc=ADJ; goto b; } case NV_PL: sent[st].cc=NOUN; if(prep==0){ if(sent[st].ic==NV_PL)subty=PLURAL; else subty=SING; } if(sent[st-1].cc == NOUN && sent[st-1].ic == NOUN){ sent[st-1].cc = ADJ; } break; case PRONP_ADJ: switch(nextst){ case NOUN_ADJ: case NV_PL: case ADJ_ADV: case PRONS_ADJ: case ADJ: case ING: sent[st++].cc=ADJ; goto b; case NOUN_VERB: case UNK: case ED: if(verb == 0){ goto def; } else{ sent[st++].cc=ADJ; goto b; } case NOUN: sent[st++].cc=ADJ; if(prep==0)subty=SING; break; case SUBCONJ: sent[st++].cc=PRONP; /* more than .. */ sent[st++].cc=CONJ; if(verb==0)verb=getv(st,ce); goto b; case '"': sent[st++].cc = ADJ; st++; goto b; default: def: sent[st].cc=PRONP; if(prep==0)subty=PLURAL; break; } break; case PRONS_ADJ: if(aflg == 1 && nextst != END && nextst != ART){ sent[st++].cc=ADJ; goto b; } switch(nextst){ case '"': sent[st++].cc = ADJ; st++; goto b; case ING: case UNK: case NOUN_VERB: case NOUN_ADJ: case ADJ_ADV: case ADJ: sent[st++].cc=ADJ; goto b; case NOUN: sent[st++].cc=ADJ; if(prep==0)subty=SING; break; case PRONS_ADJ: sent[st++].cc=ADJ; sent[st].cc=PRONP; if(prep==0)subty=SING; break; case NV_PL: if(verb==1){ sent[st++].cc=ADJ; sent[st].cc=NOUN; if(prep==0)subty=PLURAL; break; } sent[st].cc=PRONP; if(prep==0)subty=SING; break; default: sent[st].cc=PRONP; if(prep==0)subty=SING; break; } break; case NOUN_ADJ: if(nextst==NOUN||nextst==ADJ||nextst == NOUN_ADJ||nextst==PRONS_ADJ||nextst==PRONP_ADJ){ sent[st++].cc=ADJ; goto b; } if(nextst!=UNK && nextst != NOUN_VERB && nextst != NV_PL){ sent[st].cc=NOUN; if(prep==0)subty=SING; break; } if(verb==1 || sent[st+2].cc==ED){ sent[st++].cc=ADJ; goto b; } sent[st].cc=NOUN; if(prep==0)subty=SING; break; case UNK: if(nextst != UNK){ if(nextst == ',' && rep==0){ c=sent[st+2].cc; if((c==UNK||c==ADJ||c==NOUN_ADJ||c==ING) && (sent[st+3].cc==UNK||sent[st+3].cc==NOUN_VERB || sent[st+3].cc==NV_PL)){ comma--; sent[st].cc=ADJ; sent[st+2].cc=ADJ; sent[st+3].cc=NOUN; if(prep==0){ if(sent[st+3].ic==NV_PL)subty=PLURAL; else subty=SING; } return(st+3); } else { sent[st].cc=NOUN; if(prep==0)subty=SING; break; } } if(nextst==NOUN||nextst==ING ||nextst==NOUN_ADJ|| sent[st-1].cc==ADV || nextst==ADJ){ sent[st++].cc=ADJ; goto b; } if((nextst==NV_PL || nextst==NOUN_VERB) &&(verb==1 ||(verb==0 && (sent[st+2].cc==UNK || sent[st+2].cc==NOUN_VERB || sent[st+2].cc==ED||sent[st+2].cc==VERB_ADJ)))){ sent[st++].cc=ADJ; sent[st].cc=NOUN; if(prep == 0)subty=PLURAL; break; } if(nextst==CONJ &&(sent[st+2].cc==ADJ||sent[st+2].cc==ADJ_ADV)){ sent[st].cc=ADJ; goto b; } sent[st].cc=NOUN; if(prep==0)subty=SING; break; } for(t=st+1;sent[t].cc== UNK;t++); if(verb==0 && prep == 0){ /* UUU. */ if(prep==0)subty=SING; if(sent[t].cc==NV_PL){ /* UUZ.*/ if(sent[t+1].cc==UNK || sent[t+1].cc==NOUN_VERB){ /* UUZU */ sent[t+1].cc=VERB; verb=1; sent[t].cc=NOUN; t1=t; } else{ /* UUZ. */ sent[t].cc=VERB; verb=1; sent[t-1].cc=NOUN; t1=t-1; } } else{ /* UU. */ if(sent[t].cc!= ED){ sent[t-1].cc=VERB; verb=1; sent[t-2].cc=NOUN; t1=t-2; t--; } else { sent[--t].cc=NOUN; t1=t; } } } else{ if(sent[t].cc==NOUN_VERB|| sent[t].cc==NOUN|| sent[t].cc==NV_PL){ sent[t].cc=NOUN; if(prep==0)subty=PLURAL; t1=t; } else{ sent[--t].cc=NOUN; if(prep==0)subty=SING; t1=t; } } for(tt=st;ttcc != END;sentp++){ if(sentp->cc != ',' && sentp->cc != '"')nn++; if(sentp->cc == VERB || sentp->cc == BE || sentp->cc == AUX)kk++; } if(nn < 4 && kk == 0)return; } imper = lexp = lpas = index = lverbc = 0; conjf = verbf = kk = nn = sc = comp = begsc = 0; bflg = olvb = infinf = ovflg = 0; nlet = 0; f = 1; sentp=sent; while(sentp->cc != END){ /* printf("%c:",sentp->ic); */ if(sentp->cc == ';')comp++; else { if((sentp->cc != ',') && (sentp->cc != '"')){ if(*sentp->sp != 'x'){ nn++; nlet += sentp->leng; } kk++; } } switch(sentp->cc){ case NOUN: spart ="noun"; if(f)index=0; if(*sentp->sp != 'x'){ noun++; numnonf++; letnonf += sentp->leng; } bflg = infinf = ovflg = 0; break; case VERB: spart = "verb"; if(f)index=1; if(sentp->ic==TO){ infin++; infinf=1; lverbc++; } else { if(f)imper=1; if(ovflg == 0 && infinf == 0){ ovflg = 1; lverbc++; olvb++; } numnonf++; letnonf += sentp->leng; if(infinf == 0){ if(verbf == 0)verbf++; else if(conjf)comp++; } if(bflg && sentp->ic == ED)lpas = ++passive; } break; case INTER: spart = "interj"; if(f)index=2; bflg = infinf = ovflg = 0; break; case ADJ: spart = "adj"; if(f)index=3; adj++; numnonf++; letnonf += sentp->leng; bflg = infinf = ovflg = 0; break; case ADV: spart = "adv"; if(f)index=4; adv++; numnonf++; letnonf += sentp->leng; break; case CONJ: spart = "conj"; conjc++; if(f)index=5; if(infinf && (sentp+1)->cc == VERB); else { if(verbf)conjf++; bflg = infinf = ovflg = 0; } break; case POS: spart = "pos"; if(f)index=6; bflg = infinf = ovflg = 0; break; case PRONS: case PRONP: spart = "pron"; pron++; if(f){ index=7; if((sentp+1)->cc == BE){ if(sentp->leng == 5 && *(sentp->sp) == 't' && *((sentp->sp)+3)=='r'){index=14;lexp=1;} else if(sentp->leng ==2&& *(sentp->sp) == 'i' ){index=14;lexp=1;} } } bflg = infinf = ovflg = 0; if(sentp->ic == THAT || sentp->ic == WHO)sc++; break; case ART: spart = "art"; if(f)index=8; bflg = infinf = ovflg = 0; break; case PREP: spart = "prep"; if(f)index=9; prepc++; bflg = infinf = ovflg = 0; break; case AUXX: spart = "aux"; if(ovflg == 0 && infinf == 0){ ovflg = 1; lverbc++; olvb++; aux++; } if(f)index=10; break; case BE: if(ovflg == 0 && infinf == 0){ ovflg = 1; lverbc++; olvb++; } spart = "be"; if(f)index=11; tobe++; bflg = 1; if(verbf == 0)verbf++; else if(conjf)comp++; break; case SUBCONJ: spart = "subcj"; if(f){ index=13; begsc++; } sc++; if((sentp-1)->cc != CONJ) verbf = conjf = 0; bflg = infinf = ovflg = 0; break; default: if(sentp->cc == ','){ if(begsc)conjf=verbf=0; } spart = sentp->sp; } if(part){ printf("%s %s\n",spart,sentp->sp); } else if(pstyle){ printf("%s ",sentp->sp); if(kk == 15){ printf("\n"); kk=0; } } if(style){ ssp=sentp->sp; lvowel = 0; while(*ssp != '\0'){ if(*ssp >= '0' && *ssp <= '9'){ lvowel=0; break; } switch(*(ssp++)){ case 'a': case 'e': case 'i': case 'o': case 'u': case 'y': case 'A': case 'E': case 'I': case 'O': case 'U': case 'Y': lvowel++; continue; } } if(lvowel != 0){ vowel += lvowel; twds++; } } if(f){ ff=sentp->cc; f=0; } sentp++; } if(part){ printf(". %s\n",sentp->sp); } numsent++; numlet += nlet; tverbc += lverbc; verbc += olvb; if(*(sentp->sp) == '?'){ if(sc > 0)sc -= 1; qcount++; } else if(*(sentp->sp) == '/')icount++; else if(imper)icount++; if(rstyle||pstyle)rd = 4.71*((float)(nlet)/(float)(nn))+.5*(float)(nn)-21.43; if((rstyle&& rd>=rthresh)||(lstyle&&nn >= lthresh)||(pastyle&&lpas)||(estyle&&lexp)){ if(!part){ for(st=sent, kk=0;st->cc != END;st++){ printf("%s ",st->sp); if(kk++ >= 15){ kk=0; printf("\n"); } } } kk=1; } else kk=0; if(pstyle || kk){ if(!part)printf("%s\n",sentp->sp); printf(" sentence length: %d ",nn); if(sc == 0){ if(comp == 0)printf("SIMPLE "); else printf("COMPOUND "); } else if(comp == 0)printf("COMPLEX "); else printf("COMPOUND-COMPLEX "); if(index==14)printf(":expletive:"); if(lpas)printf(":passive:"); if(rstyle||pstyle)printf(" readability %4.2f ",rd); printf(": begins with %s\n\n",names[index]); } if(index < 15)beg[index]++; if(nn > maxsent){ maxsent=nn; maxindex=numsent; } if(nn < minsent ){ minsent = nn; minindex=numsent; } numwds += nn; if(nn > 49)nn=49; sleng[nn]++; if(sc == 0){ if(comp == 0)simple++; else compound++; } else if(comp == 0)complex++; else compdx++; } ; else printf("COMPOUND-COMPLEX "); if(index==14)printf(":expletive:"); if(lpas)printf(":passive:"); if(rstyle||pstyle)printf(" readability %4.2f ",rd); printf(": begins with %s\n\n",names[index]); } if(index < 15)beg[index]++cmd/diction/ehash.c 644 0 33 22411 2262222255 7502 # struct hnode { char *aakey; struct dict *aadata; }; struct dict { char *entry; char val; }; char able(); struct dict able_d[]; char ace(); struct dict ace_d[]; char age(); struct dict age_d[]; char ance(); struct dict ance_d[]; char ant(); struct dict ant_d[]; char cal(); struct dict cal_d[]; char cle(); struct dict cle_d[]; char ee(); struct dict ee_d[]; char ence(); struct dict ence_d[]; char ess(); struct dict ess_d[]; char est(); struct dict est_d[]; char ful(); struct dict ful_d[]; char ible(); struct dict ible_d[]; char ic(); struct dict ic_d[]; char ice(); struct dict ice_d[]; char ion(); struct dict ion_d[]; char ional(); struct dict ional_d[]; char is(); struct dict is_d[]; char ish(); struct dict ish_d[]; char ist(); struct dict ist_d[]; char ite(); struct dict ite_d[]; char ive(); struct dict ive_d[]; char ize(); struct dict ize_d[]; char lar(); struct dict lar_d[]; char less(); struct dict less_d[]; char man(); struct dict man_d[]; char ment(); struct dict ment_d[]; char ness(); struct dict ness_d[]; char ous(); struct dict ous_d[]; char ship(); struct dict ship_d[]; char ss(); struct dict ss_d[]; char ure(); struct dict ure_d[]; char us(); struct dict us_d[]; char ing(); struct dict ing_d[]; char ed(); struct dict ed_d[]; struct fandd { char (*fun)(); struct dict *yd; } arr[] = { able, able_d, ace, ace_d, age, age_d, ance, ance_d, ant, ant_d, cal, cal_d, cle, cle_d, ee, ee_d, ence, ence_d, ess, ess_d, est, est_d, ful, ful_d, ible, ible_d, ic, ic_d, ice, ice_d, ion, ion_d, ional, ional_d, is, is_d, ish, ish_d, ist, ist_d, ite, ite_d, ive, ive_d, ize, ize_d, lar, lar_d, less, less_d, man, man_d, ment, ment_d, ness, ness_d, ous, ous_d, ship, ship_d, ss, ss_d, ure, ure_d, us, us_d, ing, ing_d, ed, ed_d, 0, 0 }; egetd(){ struct dict *pp; struct fandd *ptr; ptr = arr; while(ptr->fun != 0){ pp = ptr->yd; while(pp->entry != 0){ (*ptr->fun)(pp->entry,0,pp); pp++; } ptr++; } } char aahash(s,ex,aatsize,aapr1,aapr2,tbl,data) char *s; struct hnode tbl[]; struct dict *data; { char *cp; int i, key, c, p1, p2; cp = s; key =0; while (c = *cp++) key = key + (key<<5) + c; key &= 077777; p1 = key%aapr1; p2 = key%aapr2; if (p2==0) p2=17; for(i=0; ival); } else return(0); } else if(strcmp(tbl[p1].aakey, s)== 0) { return(tbl[p1].aadata->val); } p1 = (p1+p2)%aatsize; } fprintf(stderr, "hash table full\n"); exit(); } struct hnode aa1root[43]; #define aa1tsize 43 #define aa1p1 37 #define aa1p2 41 char able(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa1tsize,aa1p1,aa1p2,aa1root,ptr)); } struct hnode aa2root[11]; #define aa2tsize 11 #define aa2p1 5 #define aa2p2 7 char ace(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa2tsize,aa2p1,aa2p2,aa2root,ptr)); } struct hnode aa3root[61]; #define aa3tsize 61 #define aa3p1 53 #define aa3p2 59 char age(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa3tsize,aa3p1,aa3p2,aa3root,ptr)); } struct hnode aa4root[31]; #define aa4tsize 31 #define aa4p1 23 #define aa4p2 29 char ance(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa4tsize,aa4p1,aa4p2,aa4root,ptr)); } struct hnode aa5root[31]; #define aa5tsize 31 #define aa5p1 23 #define aa5p2 29 char ant(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa5tsize,aa5p1,aa5p2,aa5root,ptr)); } struct hnode aa7root[19]; #define aa7tsize 19 #define(( aa7p1 13 #define aa7p2 17 char cal(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa7tsize,aa7p1,aa7p2,aa7root,ptr)); } struct hnode aa8root[13]; #define aa8tsize 13 #define aa8p1 7 #define aa8p2 11 char cle(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa8tsize,aa8p1,aa8p2,aa8root,ptr)); } struct hnode aa10root[31]; #define aa10tsize 31 #define aa10p1 23 #define aa10p2 29 char ee(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa10tsize,aa10p1,aa10p2,aa10root,ptr)); } struct hnode aa11root[19]; #define aa11tsize 19 #define aa11p1 13 #define aa11p2 17 char ence(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa11tsize,aa11p1,aa11p2,aa11root,ptr)); } struct hnode aa13root[47]; #define aa13tsize 47 #define aa13p1 41 #define aa13p2 43 char ess(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa13tsize,aa13p1,aa13p2,aa13root,ptr)); } struct hnode aa14root[67]; #define aa14tsize 67 #define aa14p1 59 #define aa14p2 61 char est(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa14tsize,aa14p1,aa14p2,aa14root,ptr)); } struct hnode aa15root[43]; #define aa15tsize 43 #define aa15p1 37 #define aa15p2 41 char ful(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa15tsize,aa15p1,aa15p2,aa15root,ptr)); } struct hnode aa18root[19]; #define aa18tsize 19 #define aa18p1 13 #define aa18p2 17 char ible(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa18tsize,aa18p1,aa18p2,aa18root,ptr)); } struct hnode aa19root[151]; #define aa19tsize 151 #define aa19p1 139 #define aa19p2 149 char ic(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa19tsize,aa19p1,aa19p2,aa19root,ptr)); } struct hnode aa20root[11]; #define aa20tsize 11 #define aa20p1 5 #define aa20p2 7 char ice(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa20tsize,aa20p1,aa20p2,aa20root,ptr)); } struct hnode aa21root[61]; #define aa21tsize 61 #define aa21p1 53 #define aa21p2 59 char ion(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa21tsize,aa21p1,aa21p2,aa21root,ptr)); } struct hnode aa22root[13]; #define aa22tsize 13 #define aa22p1 7 #define aa22p2 11 char ional(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa22tsize,aa22p1,aa22p2,aa22root,ptr)); } struct hnode aa23root[11]; #define aa23tsize 11 #define aa23p1 5 #define aa23p2 7 char is(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa23tsize,aa23p1,aa23p2,aa23root,ptr)); } struct hnode aa24root[71]; #define aa24tsize 71 #define aa24p1 61 #define aa24p2 67 char ish(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa24tsize,aa24p1,aa24p2,aa24root,ptr)); } struct hnode aa25root[151]; #define aa25tsize 151 #define aa25p1 139 #define aa25p2 149 char ist(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa25tsize,aa25p1,aa25p2,aa25root,ptr)); } struct hnode aa26root[79]; #define aa26tsize 79 #define aa26p1 71 #define aa26p2 73 char ite(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa26tsize,aa26p1,aa26p2,aa26root,ptr)); } struct hnode aa28root[151]; #define aa28tsize 151 #define aa28p1 139 #define aa28p2 149 char ive(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa28tsize,aa28p1,aa28p2,aa28root,ptr)); } struct hnode aa29root[11]; #define aa29tsize 11 #define aa29p1 5 #define aa29p2 7 char ize(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa29tsize,aa29p1,aa29p2,aa29root,ptr)); } struct hnode aa30root[37]; #define aa30tsize 37 #define aa30p1 29 #define aa30p2 31 char lar(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa30tsize,aa30p1,aa30p2,aa30root,ptr)); } struct hnode aa31root[11]; #define aa31tsize 11 #define aa31p1 5 #define aa31p2 7 char less(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa31tsize,aa31p1,aa31p2,aa31root,ptr)); } struct hnode aa33root[11]; #define aa33tsize 11 #define aa33p1 5 #define aa33p2 7 char man(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa33tsize,aa33p1,aa33p2,aa33root,ptr)); } struct hnode aa34root[29]; #define aa34tsize 29 #define aa34p1 19 #define aa34p2 23 char ment(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa34tsize,aa34p1,aa34p2,aa34root,ptr)); } struct hnode aa35root[11]; #define aa35tsize 11 #define aa35p1 5 #define aa35p2 7 char ness(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa35tsize,aa35p1,aa35p2,aa35root,ptr)); } struct hnode aa37root[11]; #define aa37tsize 11 #define aa37p1 5 #define aa37p2 7 char ous(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa37tsize,aa37p1,aa37p2,aa37root,ptr)); } struct hnode aa39root[11]; #define aa39tsize 11 #define aa39p1 5 #define aa39p2 7 char ship(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa39tsize,aa39p1,aa39p2,aa39root,ptr)); } struct hnode aa40root[61]; #define aa40tsize 61 #define aa40p1 53 #define aa40p2 59 char ss(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa40tsize,aa40p1,aa40p2,aa40root,ptr)); } struct hnode aa42root[89]; #define aa42tsize 89 #define aa42p1 79 #define aa42p2 83 char ure(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa42tsize,aa42p1,aa42p2,aa42root,ptr)); } struct hnode aa43root[19]; #define aa43tsize 19 #define aa43p1 13 #define aa43p2 17 char us(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa43tsize,aa43p1,aa43p2,aa43root,ptr)); } struct hnode aa44root[23]; #define aa44tsize 23 #define aa44p1 17 #define aa44p2 19 char ing(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa44tsize,aa44p1,aa44p2,aa44root,ptr)); } struct hnode aa45root[43]; #define aa45tsize 43 #define aa45p1 37 #define aa45p2 41 char ed(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa45tsize,aa45p1,aa45p2,aa45root,ptr)); } char us(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa43tsize,aa43p1,aa43p2,aa43root,ptr)); } struct hnode aa44root[23]; #define aa44tsize 23 #define aa44p1 17 #define aa44p2 19 char ing(a0,a1,ptr) char *a0; struct dict *ptrcmd/diction/nhash.c 644 0 33 7133 2262222352 7475 struct dict { char *entry; char val; }; extern struct dict ary_d[], cy_d[], ery_d[], fy_d[],gy_d[]; extern struct dict ity_d[],ly_d[],ory_d[],ry_d[],ty_d[]; extern struct dict dict[]; char aahash(); char lookup(); char ary(); char cy(); char ery(); char fy(); char gy(); char ity(); char ly(); char ory(); char ry(); char ty(); struct hnode { char *aakey; struct dict *aadata; }; char aahash(s,ex,aatsize,aapr1,aapr2,tbl,data) char *s; struct hnode tbl[]; struct dict *data; { char *cp; int ii, key, c, p1, p2; cp = s; key =0; while (c = *cp++) key = key + (key<<5) + c; key &= 077777; p1 = key%aapr1; p2 = key%aapr2; if (p2==0) p2=17; for(ii=0; iival); } else return(0); } else if(strcmp(tbl[p1].aakey, s)== 0) { return(tbl[p1].aadata->val); } p1 = (p1+p2)%aatsize; } fprintf(stderr, "hash table full\n"); exit(); } getd(){ struct dict *ptr; ptr = dict; while(ptr->entry != 0){ lookup(ptr->entry,0,ptr); ptr++; } } struct hnode aa1root[463]; #define aa1tsize 463 #define aa1p1 457 #define aa1p2 461 char lookup(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa1tsize,aa1p1,aa1p2,aa1root,ptr)); } struct hnode aa6root[113]; #define aa6tsize 113 #define aa6p1 107 #define aa6p2 109 char ary(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa6tsize,aa6p1,aa6p2,aa6root,ptr)); } struct hnode aa9root[13]; #define aa9tsize 13 #define aa9p1 7 #define aa9p2 1 char cy(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa9tsize,aa9p1,aa9p2,aa9root,ptr)); } struct hnode aa12root[59]; #define aa12tsize 59 #define aa12p1 47 #define aa12p2 43 char ery(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa12tsize,aa12p1,aa12p2,aa12root,ptr)); } struct hnode aa16root[23]; #define aa16tsize 23 #define aa16p1 17 #define aa16p2 19 char fy(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa16tsize,aa16p1,aa16p2,aa16root,ptr)); } struct hnode aa17root[29]; #define aa17tsize 29 #define aa17p1 19 #define aa17p2 23 char gy(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa17tsize,aa17p1,aa17p2,aa17root,ptr)); } struct hnode aa27root[11]; #define aa27tsize 11 #define aa27p1 5 #define aa27p2 7 char ity(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa27tsize,aa27p1,aa27p2,aa27root,ptr)); } struct hnode aa32root[281]; #define aa32tsize 281 #define aa32p1 271 #define aa32p2 277 char ly(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa32tsize,aa32p1,aa32p2,aa32root,ptr)); } struct hnode aa36root[59]; #define aa36tsize 59 #define aa36p1 47 #define aa36p2 43 char ory(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa36tsize,aa36p1,aa36p2,aa36root,ptr)); } struct hnode aa38root[59]; #define aa38tsize 59 #define aa38p1 47 #define aa38p2 53 char ry(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa38tsize,aa38p1,aa38p2,aa38root,ptr)); } struct hnode aa41root[127]; #define aa41tsize 127 #define aa41p1 109 #define aa41p2 113 char ty(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa41tsize,aa41p1,aa41p2,aa41root,ptr)); } struct fandd { char (*fun)(); struct dict *yd; } arr[] = { ary, ary_d, cy, cy_d, ery, ery_d, fy, fy_d, gy, gy_d, ity, ity_d, ly, ly_d, ory, ory_d, ry, ry_d, ty, ty_d, 0, 0 }; ygetd(){ struct fandd *ptr; struct dict *pp; ptr=arr; while(ptr->fun != 0){ pp = pt((r->yd; while(pp->entry != 0){ (*ptr->fun)(pp->entry,0,pp); pp++; } ptr++; } } a41p1 109 #define aa41p2 113 char ty(a0,a1,ptr) char *a0; struct dict *ptr; { return(aahash(a0,a1,aa41tsize,aa41p1,aa41p2,aa41root,ptr)); } struct fandd { char (*fun)(); struct dict *yd; } arr[] = { ary, ary_d, cy, cy_d, ery, ery_d, fy, fy_d, gy, gy_d, ity, ity_d, ly, ly_d, ory, ory_d, ry, ry_d, ty, ty_d, 0, 0 }; ygetd(){ struct fandd *ptr; struct dict *pp; ptr=arr; while(ptr->fun != 0){ pp = ptcmd/diction/deroff.c 644 0 33 23161 2550565216 7671 char *xxxvers = "\nDeroff Version 2.0 29 December 1979\n"; #include /* Deroff command -- strip troff, eqn, and Tbl sequences from a file. Has two flags argument, -w, to cause output one word per line rather than in the original format. -ms (or -m) causes -ms macro's to be interpreted so that just sentences are output, -mm does same for -mm macro's, -ml in addition to interpreting -ms macros also gets rid of lists. Deroff follows .so and .nx commands, removes contents of macro definitions, equations (both .EQ ... .EN and $...$), Tbl command sequences, and Troff backslash constructions. All input is through the C macro; the most recently read character is in c. */ #define C ( (c=getc(infile)) == EOF ? eof() : ((c==ldelim)&&(filesp==files) ? skeqn() : c) ) #define C1 ( (c=getc(infile)) == EOF ? eof() : c) #define SKIP while(C != '\n') #define SKIP_TO_COM SKIP; SKIP; pc=c; while(C != '.' || pc != '\n' || C > 'Z')pc=c #define YES 1 #define NO 0 #define MS 0 #define MM 1 #define ONE 1 #define TWO 2 #define NOCHAR -2 #define SPECIAL 0 #define APOS 1 #define DIGIT 2 #define LETTER 3 int wordflag = NO; int msflag = NO; int mac = MS; int disp = 0; int inmacro = NO; int intable = NO; char chars[128]; /* SPECIAL, APOS, DIGIT, or LETTER */ char line[512]; char *lp; int c; int pc; int ldelim = NOCHAR; int rdelim = NOCHAR; int argc; char **argv; char fname[50]; FILE *files[15]; FILE **filesp; FILE *infile; char *calloc(); main(ac, av) int ac; char **av; { register int i; register char *p; static char onechar[2] = "X"; FILE *opn(); argc = ac - 1; argv = av + 1; while(argc>0 && argv[0][0]=='-' && argv[0][1]!='\0') { for(p=argv[0]+1; *p; ++p) switch(*p) { case 'w': wordflag = YES; break; case 'm': msflag = YES; if(*(p+1) == 'm'){ mac=MM; p++; } else if(*(p+1) == 's') p++; else if(*(p+1) == 'l'){ disp=1; p++; } break; default: onechar[0] = *p; fatal("Invalid flag %s\n", onechar); } --argc; ++argv; } if(argc == 0) infile = stdin; else { infile = opn(argv[0]); --argc; ++argv; } files[0] = infile; filesp = &files[0]; for(i='a'; i<='z' ; ++i) chars[i] = LETTER; for(i='A'; i<='Z'; ++i) chars[i] = LETTER; for(i='0'; i<='9'; ++i) chars[i] = DIGIT; chars['\''] = APOS; chars['&'] = APOS; work(); } skeqn() { while((c = getc(infile)) != rdelim) if(c == EOF) c = eof(); else if(c == '"') while( (c = getc(infile)) != '"') if(c == EOF) c = eof(); else if(c == '\\') if((c = getc(infile)) == EOF) c = eof(); if(msflag)return(c='x'); return(c = ' '); } FILE *opn(p) register char *p; { FILE *fd; if(p[0]=='-' && p[1]=='\0') fd = stdin; else if( (fd = fopen(p, "r")) == NULL) fatal("Cannot open file %s\n", p); return(fd); } eof() { if(infile != stdin) fclose(infile); if(filesp > files) infile = *--filesp; else if(argc > 0) { infile = opn(argv[0]); --argc; ++argv; } else exit(0); return(C); } getfname() { register char *p; struct chain { struct chain *nextp; char *datap; } *chainblock; register struct chain *q; static struct chain *namechain = NULL; char *copys(); while(C == ' ') ; for(p = fname ; (*p=c)!= '\n' && c!=' ' && c!='\t' && c!='\\' ; ++p) C; *p = '\0'; while(c != '\n') C; /* see if this name has already been used */ for(q = namechain ; q; q = q->nextp) if( ! strcmp(fname, q->datap)) { fname[0] = '\0'; return; } q = (struct chain *) calloc(1, sizeof(*chainblock)); q->nextp = namechain; q->datap = copys(fname); namechain = q; } fatal(s,p) char *s, *p; { fprintf(stderr, "Deroff: "); fprintf(stderr, s, p); exit(1); } work() { for( ;; ) { if(C == '.' || c == '\'') comline(); else regline(NO,TWO); } } regline(macline,const) int macline; int const; { line[0] = c; lp = line; for( ; ; ) { if(c == '\\') { *lp = ' '; backsl(); } if(c == '\n') break; if(intable && c=='T') { *++lp = C; if(c=='{' || c=='}') { lp[-1] = ' '; *lp = C; } } else *++lp = C; } *lp = '\0'; if(line[0] != '\0') if(wordflag) putwords(macline); else if(macline) putmac(line,const); else puts(line); } putmac(s,const) register char *s; int const; { register char *t; while(*s) { while(*s==' ' || *s=='\t') putchar(*s++); for(t = s ; *t!=' ' && *t!='\t' && *t!='\0' ; ++t) ; if(*s == '\"')s++; if(t>s+const && chars[ s[0] ]==LETTER && chars[ s[1] ]==LETTER) while(s < t) if(*s == '\"')s++; else putchar(*s++); else s = t; } putchar('\n'); } putwords(macline) /* break into words for -w option */ int macline; { register char *p, *p1; int i, nlet; for(p1 = line ; ;) { /* skip initial specials ampersands and apostrophes */ while( chars[*p1] < DIGIT) if(*p1++ == '\0') return; nlet = 0; for(p = p1 ; (i=chars[*p]) != SPECIAL ; ++p) if(i == LETTER) ++nlet; if( (!macline && nlet>1) /* MDM definition of word */ || (macline && nlet>2 && chars[ p1[0] ]==LETTER && chars[ p1[1] ]==LETTER) ) { /* delete trailing ampersands and apostrophes */ while(p[-1]=='\'' || p[-1]=='&') --p; while(p1 < p) putchar(*p1++); putchar('\n'); } else p1 = p; } } comline() { register int c1, c2; com: while(C==' ' || c=='\t') ; comx: if( (c1=c) == '\n') return; c2 = C; if(c1=='.' && c2!='.') inmacro = NO; if(c2 == '\n') return; if(c1=='E' && c2=='Q' && filesp==files) eqn(); else if(c1=='T' && (c2=='S' || c2=='C' || c2=='&') && filesp==files){ if(msflag){ stbl(); } else tbl(); } else if(c1=='T' && c2=='E') intable = NO; else if(c1=='G' && c2 == 'R') sdis('G','E'); else if(!inmacro && c1=='d' && c2=='e') macro(); else if(!inmacro && c1=='i' && c2=='g') macro(); else if(!inmacro && c1=='a' && c2 == 'm') macro(); else if(c1=='s' && c2=='o') { getfname(); if( fname[0] ) infile = *++filesp = opn( fname ); } else if(c1=='n' && c2=='x') { getfname(); if(fname[0] == '\0') exit(0); if(infile != stdin) fclose(infile); infile = *filesp = opn(fname); } else if(c1=='h' && c2=='w') { SKIP; } else if(msflag && c1 == 'T' && c2 == 'L'){ SKIP_TO_COM; goto comx; } else if(msflag && c1=='N' && c2 == 'R')SKIP; else if(msflag && c1 == 'A' && (c2 == 'U' || c2 == 'I')){ if(mac==MM)SKIP; else { SKIP_TO_COM; goto comx; } } else if(msflag && c1 == 'F' && c2 == 'S'){ SKIP_TO_COM; goto comx; } else if(msflag && c1 == 'S' && c2 == 'H'){ SKIP_TO_COM; goto comx; } else if(msflag && c1 == 'N' && c2 == 'H'){ SKIP_TO_COM; goto comx; } else if(msflag && c1 == 'O' && c2 == 'K'){ SKIP_TO_COM; goto comx; } else if(msflag && c1 == 'N' && c2 == 'D') SKIP; else if(msflag && mac==MM && c1=='H' && (c2==' '||c2=='U')) SKIP; else if(msflag && mac==MM && c2=='L'){ if(disp || c1 == 'R')sdis('L','E'); else{ SKIP; putchar('.'); } } else if(msflag && (c1 == 'D' || c1 == 'N' || c1 == 'K') && c2 == 'S') { sdis(c1,'E'); } /* removed RS-RE */ else if(msflag && c1 == 'n' && c2 == 'f') sdis('f','i'); else if(msflag && c1 == 'c' && c2 == 'e') sce(); else { if(c1=='.' && c2=='.') while(C == '.') ; ++inmacro; if(c1 <= 'Z' && msflag)regline(YES,ONE); else regline(YES,TWO); --inmacro; } } macro() { if(msflag){ do { SKIP; } while(C!='.' || C!='.' || C=='.'); /* look for .. */ if(c != '\n')SKIP; return; } SKIP; inmacro = YES; } sdis(a1,a2) char a1,a2; { register int c1,c2; register int eqnf; eqnf=1; SKIP; while(1){ while(C != '.')SKIP; if((c1=C) == '\n')continue; if((c2=C) == '\n')continue; if(c1==a1 && c2 == a2){ SKIP; if(eqnf)putchar('.'); putchar('\n'); return; } else if(a1 == 'D' && c1 == 'E' && c2 == 'Q'){eqn(); eqnf=0;} else SKIP; } } tbl() { while(C != '.'); SKIP; intable = YES; } stbl() { while(C != '.'); SKIP_TO_COM; if(c != 'T' || C != 'E'){ SKIP; pc=c; while(C != '.' || pc != '\n' || C != 'T' || C != 'E')pc=c; } } eqn() { register int c1, c2; register int dflg; int last; last=0; dflg = 1; SKIP; for( ;;) { if(C == '.' || c == '\'') { while(C==' ' || c=='\t') ; if(c=='E' && C=='N') { SKIP; if(msflag && dflg){ putchar('x'); putchar(' '); if(last){putchar('.'); putchar(' '); } } return; } } else if(c == 'd') /* look for delim */ { if(C=='e' && C=='l') if( C=='i' && C=='m') { while(C1 == ' '); if((c1=c)=='\n' || (c2=C1)=='\n' || (c1=='o' && c2=='f' && C1=='f') ) { ldelim = NOCHAR; rdelim = NOCHAR; } else { ldelim = c1; rdelim = c2; } } dflg = 0; } if(c != '\n') while(C != '\n'){ if(c == '.')last=1; else last=0; } } } backsl() /* skip over a complete backslash construction */ { int bdelim; sw: switch(C) { case '"': SKIP; return; case 's': if(C == '\\') backsl(); else { while(C>='0' && c<='9') ; ungetc(c,infile); c = '0'; } --lp; return; case 'f': case 'n': case 'k': case '*': if(C != '(') return; case '(': if(C != '\n') C; return; case '$': C; /* discard argument number */ return; case 'b': case 'x': case 'v': case 'h': case 'w': case 'o': case 'l': case 'L': if( (bdelim=C) == '\n') return; while(C!='\n' && c!=bdelim) if(c == '\\') backsl(); return; case '\\': if(inmacro) goto sw; defa((ult: return; } } char *copys(s) register char *s; { register char *t, *t0; if( (t0 = t = calloc( strlen(s)+1, sizeof(*t) ) ) == NULL) fatal("Cannot allocate memory", (char *) NULL); while( *t++ = *s++ ) ; return(t0); } sce(){ register char *ap; register int n, i; char a[10]; for(ap=a;C != '\n';ap++){ *ap = c; if(ap == &a[9]){ SKIP; ap=a; break; } } if(ap != a)n = atoi(a); else n = 1; for(i=0;i #include #define MAXSIZ 6500 #define QSIZE 650 struct words { char inp; char out; struct words *nst; struct words *link; struct words *fail; } w[MAXSIZ], *smax, *q; int fflag; int nflag = 1; /*use default file*/ char *filename; int nfile; int nsucc; long nsent = 0; long nhits = 0; char *nlp; char *begp, *endp; int oct = 0; FILE *wordf; char *argptr; main(argc, argv) char **argv; { while (--argc > 0 && (++argv)[0][0]=='-') switch (argv[0][1]) { case 'f': fflag++; filename = ++argv; argc--; continue; case 'n': nflag = 0; continue; case 'd': continue; default: fprintf(stderr, "diction: unknown flag\n"); continue; } out: if(nflag){ wordf = fopen(DICT,"r"); if(wordf == NULL){ fprintf(stderr,"diction: can't open default dictionary\n"); exit(2); } } else { wordf = fopen(*filename,"r"); if(wordf == NULL){ fprintf(stderr,"diction: can't open %s\n",filename); exit(2); } } cgotofn(); cfail(); nfile = argc; if (argc<=0) { execute((char *)NULL); } else while (--argc >= 0) { execute(*argv); argv++; } printf("number of sentences %ld number of hits %ld\n",nsent,nhits); exit(nsucc == 0); } execute(file) char *file; { register char *p; register struct words *c; register ccount; struct words *savc; char *savp; int savct; int scr; char buf[1024]; int f; int hit; if (file) { if ((f = open(file, 0)) < 0) { fprintf(stderr, "diction: can't open %s\n", file); exit(2); } } else f = 0; ccount = 0; p = buf; nlp = p; c = w; oct = hit = 0; savc = savp = 0; for (;;) { if (--ccount <= 0) { if (p == &buf[1024]) p = buf; if (p > &buf[512]) { if ((ccount = read(f, p, &buf[1024] - p)) <= 0) break; } else if ((ccount = read(f, p, 512)) <= 0) break; convert(p,ccount); } if(p == &buf[1024])p=buf; nstate: if (c->inp == *p) { c = c->nst; } else if (c->link != 0) { c = c->link; goto nstate; } else { if(savp != 0){ c=savc; p=savp; if(ccount > savct)ccount += savct; else ccount = savct; savc=savp=0; goto hadone; } c = c->fail; if (c==0) { c = w; istate: if (c->inp == *p) { c = c->nst; } else if (c->link != 0) { c = c->link; goto istate; } } else goto nstate; } if(c->out){ if((c->inp == *(p+1)) && (c->nst != 0)){ savp=p; savc=c; savct=ccount; goto cont; } else if(c->link != 0){ savc=c; while((savc=savc->link)!= 0){ if(savc->inp == *(p+1)){ savp=p; savc=c; savct=ccount; goto cont; } } } hadone: savc=savp=0; if(c->out == (char)(0377)){ c=w; goto nstate; } begp = p - (c->out); if(begp < &buf[0])begp = &buf[1024] - (&buf[0]-begp); endp=p; hit = 1; nhits++; if (*p++ == '.') { if (--ccount <= 0) { if (p == &buf[1024]) p = buf; if (p > &buf[512]) { if ((ccount = read(f, p, &buf[1024] - p)) <= 0) break; } else if ((ccount = read(f, p, 512)) <= 0) break; convert(p,ccount); } } succeed: nsucc = 1; { if (p <= nlp) { outc(&buf[1024]); nlp = buf; } outc(p); } nomatch: nlp = p; c = w; begp = endp = 0; continue; } cont: if (*p++ == '.'){ if(hit){ if(p <= nlp){ outc(&buf[1024]); nlp = buf; } outc(p); putchar('\n'); putchar('\n'); } hit = 0; oct = 0; nlp = p; c = w; begp = endp = 0; } } close(f); } getargc() { register c; if (wordf){ if((c=getc(wordf))==EOF){ fclose(wordf); if(nflag && fflag){ nflag=0; wordf=fopen(*filename,"r"); if(wordf == NULL){ fprintf("can't open %s\n",filename); exit(2); } return(getc(wordf)); } else return(EOF); } else return(c); } if ((c = *argptr++) == '\0') return(EOF); return(c); } cgotofn() { register c; register struct words *s; register ct; int neg; s = smax = w; neg = ct = 0; nword: for(;;) { c = getargc(); if(c == '~'){ neg++; c = getargc(); } if (c==EOF) return; if (c == '\n') { if(neg)s->out = 0377; else s->out = ct-1; neg = ct = 0; s = w; } else { loop: if (s->inp == c) { s = s->nst; ct++; continue; } if (s->inp == 0) goto enter; if (s->link == 0) { if (smax >= &w[MAXSIZ - 1]) overflo(); s->link = ++smax; s = smax; goto enter; } s = s->link; goto loop; } } enter: do { s->inp = c; ct++; if (smax >= &w[MAXSIZ - 1]) overflo(); s->nst = ++smax; s = smax; } while ((c = getargc()) != '\n' && c!=EOF); if(neg)smax->out = 0377; else smax->out = ct-1; neg = ct = 0; s = w; if (c != EOF) goto nword; } overflo() { fprintf(stderr, "wordlist too large\n"); exit(2); } cfail() { struct words *queue[QSIZE]; struct words **front, **rear; struct words *state; int bstart; register char c; register struct words *s; s = w; front = rear = queue; init: if ((s->inp) != 0) { *rear++ = s->nst; if (rear >= &queue[QSIZE - 1]) overflo(); } if ((s = s->link) != 0) { goto init; } while (rear!=front) { s = *front; if (front == &queue[QSIZE-1]) front = queue; else front++; cloop: if ((c = s->inp) != 0) { bstart=0; *rear = (q = s->nst); if (front < rear) if (rear >= &queue[QSIZE-1]) if (front == queue) overflo(); else rear = queue; else rear++; else if (++rear == front) overflo(); state = s->fail; floop: if (state == 0){ state = w;bstart=1;} if (state->inp == c) { qloop: q->fail = state->nst; if ((state->nst)->out != 0 && q->out == 0) q->out = (state->nst)->out; if((q=q->link) != 0)goto qloop; } else if ((state = state->link) != 0) goto floop; else if(bstart==0){state=0; goto floop;} } if ((s = s->link) != 0) goto cloop; } /* for(s=w;s<=smax;s++) printf("s %d ch %c out %d nst %d link %d fail %d\n",s, s->inp,s->out,s->nst,s->link,s->fail); */ } convert(p,ccount) char *p; { int ct; char *pt; for(pt=p,ct=ccount;--ct>=0;pt++){ if(isupper(*pt))*pt=tolower(*pt); else if(isspace(*pt))*pt=' '; else if(*pt=='.' || *pt=='?'||*pt=='!'){ *pt='.'; nsent++; } else if(ispunct(*pt))*pt=' '; } } outc(addr) char *addr; { while(nlp < addr){ if(oct++ > 70 && *nlp == ' ' && nlp != begp && nlp != endp){ oct=0; putchar('\n'); } if(nlp == begp){ putchar('['); } putchar(*nlp); if(nlp == endp){ putchar(']'); } nlp++; } } convert(p,ccount) char *p; { int ct; char *pt; for(pt=p,ct=ccount;--ct>=0;pt++){ if(isupper(*pt))*pt=tolower(*pt); else if(isspace(*pt))*pt=' '; else if(*pt=='.' || *pt=='?'||*pt=='!'){ *pt='.'; nsent++; } else if(ispunct(*pt))*pt=' '; } } outc(addr) char *addr; { while(nlp < addr){ if(oct++ > 70 && *nlp == ' ' && nlp != begp && nlp != endp){ oct=0; putchar('\n'); } if(nlp == begp){ putchar('['); } cmd/diction/explain 755 0 33 314 2266773101 7577 trap 'rm $$; exit' 1 2 3 15 D=/usr/lib/explain.d while echo "phrase?";read x do cat >$$ < 70 && *nlp == ' ' && nlp != beg/,5< /,"cmd/diction/explain.d 644 0 33 33613 2266772772 10103 exhibit filing behavior file which "that" when clause is restrictive in accordance with your request as you requested very in the field of in a great deal of much a large number of many a majority of most the great majority of most a number of several, many, some abovementioned the, this, that, those, these absolutely complete complete absolutely essential essential accordingly so accounted for by the fact that due to, caused by, because activate start, begin actual experience experience actually really actual facts facts add the point that add that added increments increments adequate enough adequate advent coming, arrival afford an opportunity allow, permit after this is accomplished then aggregate total all of all all throughout throughout along the line of like along the lines of like along the same line like an example of this is the fact that thus an order of magnitude 10 times analyzation analysis and/or AVOID and etc etc another additional another answer is in the affirmative answer is yes anticipate expect any and all any, all are of the opinion that think that, believe that are of the same opinion agree arrive at a decision decide arrive at an approximation estimate as a matter of fact in fact or OMIT as a method of for as a consequence of because as is the case as happens as of this date today as good or better than as good as or better than good and very as long as when, if as of now now as shown in X X shows that as per AVOID as regards about as related to for, about as soon as when as to abo((ut, on as to whether whether the question as to whether whether assist help assistance help give assistance to help assuming that if at a later date later at about at at above, at below above, below at all times always at an early date soon, shortly at an earlier date previously at the present moment in time now at the present time currently, now at the time when when at this point in time now at this time now at which time when at your earliest convenience soon in back of behind in behind behind based on the fact that because basic fundamentals fundamentals be cognizant of aware, know, notice being that as, because, since being as as, become, since brief in duration brief, quick, fast bring to a conclusion conclude, end, finish but that that but what that by means of with, by by the use of by carry out experiments experiment center portion center center around center on center about center on check into, check up on, check on check circle around circle collaborate together collaborate collect together collect combine together combine come to an end end commence begin common accord accord compensation pay completely eliminated eliminated completely full full concerning about conclude end conduct an investigation of investigate conjecture guess connect together connect connect up connect consensus of opinion consensus consequent result result consequently so consolidate together consolidate construct build contemplate plan continue to remain remain continue on continue cooperate together cooperate count up count could of could have couple together couple debate about debate definitely decide on decide, select demean degrade, denigrate (unless behave without regard to value) demonstrate show, prove depreciate in value depreciate deserving of deserve desirable benefits benefits desirous of want, desire despite the fact that although, though different than only to introduce a clause discontinue stop distant from from disutility uselessness divide up divide due to because, owing to due to the fact that because duly noted noted during the time that while during the course of during, while each and every each early beginnings beginnings effectuate cause elucidate explain emotional feelings emotions, feelings empty out empty enclosed herein enclosed enclosed herewith enclosed encounter meet end result result end up end endeavor try enter in, enter into enter enthused show enthusiasm entirely complete complete equally as good as good as, equally good essentially awfully very eventuate happen every now and then now and then exactly identical identical except in a small number of cases usually exhibit a tendency to tend to experiencing difficulty having trouble fabricate make, build face up to face facilitate ease, simplify, help facts and figures facts fast in action fast fearful of fear fearful that fear few in number few fewer in number fewer file away file final completion completion final ending ending final outcome outcome final result result final upshot upshot finalize complete, finish, end find it interesting to know AVOID rather interesting interesting first and foremost first first of all first first beginnings beginnings first initiated initiated firstly first follow after follow following after following, after for the purpose of for, to for the reason that because, since there is reason to believe I think for the simple reason that because, since for this reason so for your information formalize REWRITE forward send from the point of view of for full and complete full, complete generally agreed agreed give an indication of indicate give rise to cause indicate show, suggest give authorization authorize gratuitous gratuitous only for unearned or unwarranted greatly minimize minimize has a deleterious effect damages, harms, injures has got to has to have a need for need referred to as called a preference for prefer have a particular preference for prefer have got to have to has the capability can having reference to this for, about head up head cannot help but cannot help in the production of to produce hopeful of hope hopeful that hope hopefully avoid--usually a misplaced modifier if and when if, when if at all possible if possible impact A MORE PRECISE WORD implement carry out important essentials essentials importantly REWRITE in a large measure largely in a position to can in accordance with by in advance of before in agreement with agree with in all cases always in a number of cases some in a satisfactory manner satisfactorily in a very real sense in a sense or OMIT in behalf of for in between between in case if in no case never in close proximity near in conflict with oppose or contradict in conjunction with with in connection with about, concerning in large measure largely in many cases often in most cases usually in my opinion I think in order to to in rare cases rarely in some cases sometimes in reference to, with reference to concerning, about in regard to about or another simple preposition in regards to as regards in relation with with in relation to toward, to in respect to about with respect to about in short supply scarce in terms of about in the amount of for in the case of for, by, in, if in the course of while, during in the event of if in the event that if in the form of as in the instance of for in the interim meanwhile in the last analysis in the light of the fact that because in the majority of instances (or cases) usually, generally in the matter of about in the near future soon in the possession of has, have in possession of has, have in the neighborhood of about in the not too distant future soon in the proximity of near, nearly, about in the range of between in the same way as described in the same way, as described in the shape of usually unnecessary in the vicinity of near in this case here in view of the above therefore in view of because, since in view of the fact that since, as, because in view of the foregoing circumstances therefore in violation of violate inasmuch as since, for, as initial first initialize start initiate begin, start injurious to harm, damage inquire ask inside of inside institute begin institute a change change institute an improvement improve intents and purposes intents intermingle mingle involve the necessity of require irregardless regardless is defined as is is indicative of indicates is suggestive of suggests is used to control controls is used to provide provides is when is when (only to denote time - not in definitions) is where is where (only to denote place - not in definitions) it is incumbent on me I must it is often the case that often it stands to reason it was noted that if if it is apparent that apparently it is believed that I think it is clear that clearly it is doubtful that possibly it is evident that it is of interest to note that it may be that I think it is suggested that I think it is worth pointing out that note that had the ability to could needless to say it would not be unreasonable to assume I(we) think, assume join together join joint cooperation cooperation joint partnership partnership just exactly just, exactly kind of somewhat, rather know about know large in size large last but not least AVOID later on later leaving out of consideration disregarding liable likely link up link literally lose out on lose main essentials essentials in a precise manner precisely make a calibration calibrate might of might have must of must have make a purchase buy make a study of study make adjustments to adjust make an approximation of approximate make an examination of examine with the exception of except make an exception of except make application to apply make contact with see, meet make mention of mention make out a list of list make the acquaintance of meet make the adjustment adjust maximum possible maximum meaningful significant or REWRITE meet up with meet melt down melt melt up melt merge together merge methodology method mingle together mingle minimize as far as possible minimize miss out on miss mix together mix modification change more preferable preferable most unique unique mutual cooperation cooperation necessary requisite requisite necessitate require, need nice A MORE EXACT WORD not in a position to cannot not of a high order of accuracy inaccurate notwithstanding the fact that although of considerable magnitude big, large, great overall general, complete of that of which of the order of magnitude of about of very minor importance unimportant off of off on a few occasions occasionally on account of because on account of the fact that because on behalf of for on the grounds that since, because, as on the occasion of on, when on the order of about, nearly on the basis of by, from, because on the part of by one of the one, a open up open operates to correct corrects optimum best outside of outside, besides, except over with over past history history perceptive of perceive perform do perform a measurement measure perform the measurement measure permits the reduction of reduces personalize REWRITE pertaining to about, on physical size size plan ahead plan plan for the future plan plan in advance plan plan on plan present a conclusion conclude present a report report presently now (presently means "very soon") prior to before reveal show sufficient number of enough prioritize rank proceed to analyze analyze procure get productive of produce prolong the duration prolong protrude out from protrude provided that if pursuant to our agreement as we agreed pursuant to under put to use in (building, measuring, etc) build, measure, etc. range all the way from range from reason is because reason is that or because reason why reason recur again recur reduce down reduce refer back refer reflective of reflect regretful regrettable reinitiate start again relative to about repeat again repeat repeat the same (noun) repeat the (noun) representative of represents resultant effect effect resume again resume retreat back retreat return again return return back return revert back revert seal off seal should of should have situation REWRITE seems apparent seems, is apparent send a communication to notify short space of time sort time single unit unit small i((n size small so as to to sort of somewhat, rather spell out explain state the point that state that still continue continue still remain remain stress the point that stress that subsequent next sufficient enough subsequent to later, after substantially in agreement agree succeed in doing do, accomplish superior than superior to surrounding circumstances circumstances take appropriate action act appropriately take appropriate measures act take cognizance of note, notice take into consideration consider termed as termed terminate end, stop termination end the fact is AVOID the authors we, I the foregoing the, this, that, these, those the foreseeable future soon the fullest possible extent most, completely or fully (or OMIT) the only difference being that except that whether or not whether the truth is there are not many who few there is very little doubt that doubtless, no doubt through the medium of through through the use of by, with throughout the entire throughout, in the entire time interval interval to loan to lend to summarize the above in summary total effect of all this the effect of all this, total effect totality total (adj) usually makes a more concise construction transpire happen, occur true facts facts try and try to ultimate last ultimate end end under a separate cover separately under date of on under separate cover separately under the necessity to have to underlying purpose purpose undertake a study of study uniformly consistent consistent unique uncommon until such time as until up to about up to, about, approximately up to this time before utilize use very complete complete very unique unique, uncommon vital important we wish to thank we thank with a view to to with regard to about, regarding with the object of to (plus infinitive) with the result that so that with this in mind, it is clear that therefore within the realm of possibility possible, possibly without further delay now, immediately worth while worth while only for actions, not approval would of would have basically a lot of many lots of many the nature in fact wise AVOID WORDS THAT END IN "wise" viable alternative alternative rather quite fairly relatively comparatively AVOID UNLESS REALLY COMPARING anticipate expect approximately about as already stated as can be seen from X X shows employ use from the standpoint of according to in a considerable number of cases often in excess of more than, above upon on y now, immediately worth while worth while only for actions, not approval would of would have basically a lot of macmd/diction/style.1 644 0 33 2506 2271123333 7450 .TH STYLE 1 .SH NAME style \- analyze surface characteristics of a document .SH SYNOPSIS .B style [ .B \-ml ] [ .B \-mm ] [ .B \-a ] [ .B \-e ] [ .B \-l num ] [ .B \-r num ] [ .B \-p ] [ .B \-P ] file ... .LP .SH DESCRIPTION .I Style analyzes the surface characteristics of the writing style of a document. It reports on readability, sentence length and structure, word length and usage, verb type, and sentence openers. Because .I style runs .I deroff before looking at the text, formatting header files should be included as part of the input. The default macro package .B \-ms may be overridden with the flag .B \-mm. The flag .BR \-ml , which causes .B deroff to skip lists, should be used if the document contains many lists of non-sentences. The other options are used to locate sentences with certain characteristics. .TP .B \-a print all sentences with their length and readability index. .TP .B \-e print all sentences that begin with an expletive. .TP .B \-p print all sentences that contain a passive verb. .TP .BI \-l num print all sentences longer than .IR num . .TP .BI \-r num print all sentences whose readability index is greater than .IR num . .TP .B \-P print parts of speech of the words in the document. .SH "SEE ALSO" deroff(1), diction(1) .SH BUGS Use of non-standard formatting macros may cause incorrect sentence breaks. a print all sentences with their length and readability index. .TP .B \-e print all sentences that begin with an expletive. .TP .B \-p print all sentences that contain a passive verb. .Tcmd/diction/diction.1 644 0 33 2050 2262455533 7745 .TH DICTION 1 .SH NAME diction \- print wordy sentences .br explain \- interactive thesaurus for diction .SH SYNOPSIS .B diction [ .B \-ml ] [ .B \-mm ] [ .B \-n ] [ .B \-f pfile ] file ... .br .B explain .LP .SH DESCRIPTION .I Diction finds all sentences in a document that contain phrases from a data base of bad or wordy diction. Each phrase is bracketed with [ ]. Because .I diction runs .I deroff before looking at the text, formatting header files should be included as part of the input. The default macro package .B \-ms may be overridden with the flag .B \-mm. The flag .B \-ml which causes .B deroff to skip lists, should be used if the document contains many lists of non-sentences. The user may supply her/his own pattern file to be used in addition to the default file with .B \-f .I pfile. If the flag .B \-n is also supplied the default file will be supressed. .PP .I Explain is an interactive thesaurus for the phrases found by diction. .SH "SEE ALSO" deroff(1) .SH BUGS Use of non-standard formatting macros may cause incorrect sentence breaks. the flag .B \-mm. The flag .B \-ml which causes .B deroff to skip lists, should be used if the document contains many lists of non-sentences. The user may supply her/his own pattern file to be used in addition to the default file with .B \-f .I pfile. If the flag .B \-n is also supplied the default file will be supressed. .PP .I Explain is an interactive thesaurus for the phrases found by diction. .SH "SEE ALSO" deroff(1) .SH BUGS Use of non-standard formatting macrcmd/sed/ 775 0 33 0 2552562445 5277 cmd/sed/Makefile 644 0 33 236 2550275717 7004 CFLAGS=-O -w sed: sed0.o sed1.o cc -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 y 02552562445-sente< a9 may00000005277his own pattern file to be used in addition to the default file with .B \-f .I pfile. If the flag .B \-n is also supplied the default file will be supressed. .PP .I Explain is an interacti hesaurus/ C. /,"cmd/sed/sed.h 644 0 33 4377 2550275717 6322 # /* * 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; r 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; cmd/sed/sed0.c 644 0 33 35462 2550275720 6406 #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) { rep->re1 = op; } else { op = rep->re1; } if((rep->rhs = p) > reend) { fprintf(stderr, TMMES, linebuf); exit(2); } if((p = compsub(rep->rhs)) == badp) { fprintf(stderr, CGMES, linebuf); exit(2); } if(*cp == 'g') { cp++; rep->gfl++; } else if(gflag) rep->gfl++; if(*cp == 'p') { cp++; rep->pfl = 1; } if(*cp == 'P') { cp++; rep->pfl = 2; } if(*cp == 'w') { cp++; if(*cp++ != ' ') { fprintf(stderr, CGMES, linebuf); exit(2); } if(nfiles >= 10) { fprintf(stderr, "Too many files in w commands\n"); exit(2); } text(fname[nfiles]); for(i = nfiles - 1; i >= 0; i--) if(cmp(fname[nfiles],fname[i]) == 0) { rep->fcode = fcode[i]; goto done; } if((rep->fcode = fopen(fname[nfiles], "w")) == NULL) { fprintf(stderr, "cannot open %s\n", fname[nfiles]); exit(2); } fcode[nfiles++] = rep->fcode; } break; case 'w': rep->command = WCOM; if(*cp++ != ' ') { fprintf(stderr, CGMES, linebuf); exit(2); } if(nfiles >= 10){ fprintf(stderr, "Too many files in w commands\n"); exit(2); } text(fname[nfiles]); for(i = nfiles - 1; i >= 0; i--) if(cmp(fname[nfiles], fname[i]) == 0) { rep->fcode = fcode[i]; goto done; } if((rep->fcode = fopen(fname[nfiles], "w")) == NULL) { fp((rintf(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); } har *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 == '\\' && *scmd/sed/sed1.c 644 0 33 24472 2550275720 6406 #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 (*l((p == 0) continue; return(0); case CEOF: loc2 = lp; return(1); case CCL: c = *lp++ & 0177; if(ep[c>>3] & bittab[c & 07]) { ep += 16; continue; } return(0); case CBRA: braslist[*ep++] = lp; continue; case CKET: braelist[*ep++] = lp; continue; case CBACK: bbeg = braslist[*ep]; ct = braelist[*ep++] - bbeg; if(ecmp(bbeg, lp, ct)) { lp += ct; continue; } return(0); case CBACK|STAR: bbeg = braslist[*ep]; ct = braelist[*ep++] - bbeg; curlp = lp; while(ecmp(bbeg, lp, ct)) lp += ct; while(lp >= curlp) { if(advance(lp, ep)) return(1); lp -= ct; } return(0); case CDOT|STAR: curlp = lp; while (*lp++); goto star; case CCHR|STAR: curlp = lp; while (*lp++ == *ep); ep++; goto star; case CCL|STAR: curlp = lp; do { c = *lp++ & 0177; } while(ep[c>>3] & bittab[c & 07]); ep += 16; goto star; star: if(--lp == curlp) { continue; } if(*ep == CCHR) { c = ep[1]; do { if(*lp != c) continue; if(advance(lp, ep)) return(1); } while(lp-- > curlp); return(0); } if(*ep == CBACK) { c = *(braslist[ep[1]]); do { if(*lp != c) continue; if(advance(lp, ep)) return(1); } while(lp-- > curlp); return(0); } do { if(lp == locs) break; if (advance(lp, ep)) return(1); } while (lp-- > curlp); return(0); default: fprintf(stderr, "RE botch, %o\n", *--ep); } } substitute(ipc) union reptr *ipc; { if(match(ipc->re1, 0) == 0) return(0); sflag = 1; dosub(ipc->rhs); if(ipc->gfl) { while(*loc2) { if(match(ipc->re1, 1) == 0) break; dosub(ipc->rhs); } } return(1); } dosub(rhsbuf) char *rhsbuf; { register char *lp, *sp, *rp; int c; lp = linebuf; sp = genbuf; rp = rhsbuf; while (lp < loc1) *sp++ = *lp++; while(c = *rp++) { if (c == '&') { sp = place(sp, loc1, loc2); continue; } else if (c&0200 && (c &= 0177) >= '1' && c < NBRA+'1') { sp = place(sp, braslist[c-'1'], braelist[c-'1']); continue; } *sp++ = c&0177; if (sp >= &genbuf[LBSIZE]) fprintf(stderr, "output line too long.\n"); } lp = loc2; loc2 = sp - genbuf + linebuf; while (*sp++ = *lp++) if (sp >= &genbuf[LBSIZE]) { fprintf(stderr, "Output line too long.\n"); } lp = linebuf; sp = genbuf; while (*lp++ = *sp++); spend = lp-1; } char *place(asp, al1, al2) char *asp, *al1, *al2; { register char *sp, *l1, *l2; sp = asp; l1 = al1; l2 = al2; while (l1 < l2) { *sp++ = *l1++; if (sp >= &genbuf[LBSIZE]) fprintf(stderr, "Output line too long.\n"); } return(sp); } command(ipc) union reptr *ipc; { register int i; register char *p1, *p2, *p3; char *execp; switch(ipc->command) { case ACOM: *aptr++ = ipc; if(aptr >= &abuf[ABUFSIZE]) { fprintf(stderr, "Too many appends after line %ld\n", lnum); } *aptr = 0; break; case CCOM: delflag = 1; if(!ipc->inar || dolflag) { for(p1 = ipc->re1; *p1; ) putc(*p1++, stdout); putc('\n', stdout); } break; case DCOM: delflag++; break; case CDCOM: p1 = p2 = linebuf; while(*p1 != '\n') { if(*p1++ == 0) { delflag++; return; } } p1++; while(*p2++ = *p1++); spend = p2-1; jflag++; break; case EQCOM: fprintf(stdout, "%ld\n", lnum); break; case GCOM: p1 = linebuf; p2 = holdsp; while(*p1++ = *p2++); spend = p1-1; break; case CGCOM: *spend++ = '\n'; p1 = spend; p2 = holdsp; while(*p1++ = *p2++) if(p1 >= lbend) break; spend = p1-1; break; case HCOM: p1 = holdsp; p2 = linebuf; while(*p1++ = *p2++); hspend = p1-1; break; case CHCOM: *hspend++ = '\n'; p1 = hspend; p2 = linebuf; while(*p1++ = *p2++) if(p1 >= hend) break; hspend = p1-1; break; case ICOM: for(p1 = ipc->re1; *p1; ) putc(*p1++, stdout); putc('\n', stdout); break; case BCOM: jflag = 1; break; case LCOM: p1 = linebuf; p2 = genbuf; genbuf[72] = 0; while(*p1) if(*p1 >= 040) { if(*p1 == 0177) { p3 = rub; while(*p2++ = *p3++) if(p2 >= lcomend) { *p2 = '\\'; fprintf(stdout, "%s\n", genbuf); p2 = genbuf; } p2--; p1++; continue; } *p2++ = *p1++; if(p2 >= lcomend) { *p2 = '\\'; fprintf(stdout, "%s\n", genbuf); p2 = genbuf; } } else { p3 = trans[*p1-1]; while(*p2++ = *p3++) if(p2 >= lcomend) { *p2 = '\\'; fprintf(stdout, "%s\n", genbuf); p2 = genbuf; } p2--; p1++; } *p2 = 0; fprintf(stdout, "%s\n", genbuf); break; case NCOM: if(!nflag) { for(p1 = linebuf; p1 < spend; p1++) putc(*p1, stdout); putc('\n', stdout); } if(aptr > abuf) arout(); if((execp = gline(linebuf)) == badp) { pending = ipc; delflag = 1; break; } spend = execp; break; case CNCOM: if(aptr > abuf) arout(); *spend++ = '\n'; if((execp = gline(spend)) == badp) { pending = ipc; delflag = 1; break; } spend = execp; break; case PCOM: for(p1 = linebuf; p1 < spend; p1++) putc(*p1, stdout); putc('\n', stdout); break; case CPCOM: cpcom: for(p1 = linebuf; *p1 != '\n' && *p1 != '\0'; ) putc(*p1++, stdout); putc('\n', stdout); break; case QCOM: if(!nflag) { for(p1 = linebuf; p1 < spend; p1++) putc(*p1, stdout); putc('\n', stdout); } if(aptr > abuf) arout(); fclose(stdout); exit(0); case RCOM: *aptr++ = ipc; if(aptr >= &abuf[ABUFSIZE]) fprintf(stderr, "Too many reads after line%ld\n", lnum); *aptr = 0; break; case SCOM: i = substitute(ipc); if(ipc->pfl && i) if(ipc->pfl == 1) { for(p1 = linebuf; p1 < spend; p1++) putc(*p1, stdout); putc('\n', stdout); } else goto cpcom; if(i && ipc->fcode) goto wcom; break; case TCOM: if(sflag == 0) break; sflag = 0; jflag = 1; break; wcom: case WCOM: fprintf(ipc->fcode, "%s\n", linebuf); break; case XCOM: p1 = linebuf; p2 = genbuf; while(*p2++ = *p1++); p1 = holdsp; p2 = linebuf; while(*p2++ = *p1++); spend = p2 - 1; p1 = genbuf; p2 = holdsp; while(*p2++ = *p1++); hspend = p2 - 1; break; case YCOM: p1 = linebuf; p2 = ipc->re1; while(*p1 = p2[*p1]) p1++; break; } } char * gline(addr) char *addr; { register char *p1, *p2; register c; p1 = addr; p2 = cbp; for (;;) { if (p2 >= ebp) { if ((c = read(f, ibuf, 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; } 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(*++apcmd/sh/ 775 0 33 0 2552563055 5134 cmd/sh/Makefile 644 0 33 1036 2310756513 6652 CFLAGS = -n -O -g all: sh cp: sh cp sh /bin/sh rm sh *.o cmp: sh cmp sh /bin/sh rm sh *.o sh: setbrk.o sh: builtin.o blok.o stak.o sh: cmd.o fault.o main.o sh: word.o string.o name.o args.o sh: xec.o service.o error.o io.o sh: print.o macro.o expand.o sh: ctype.o msg.o blok.o: brkincr.h fault.o: brkincr.h main.o: brkincr.h stak.o: brkincr.h sh:; cc -o sh -n *.o newsys:; :newsys file=msg; make sh install:; install -s sh $(DESTDIR)/bin clean:; rm -f sh *.o diff:; :diff list:; list Makefile *.h *.s *.c .c.o:; cc -O -c $< : sh cp sh /bin/sh rm sh *.o cmp: sh cmp sh /bin/sh rm sh *.o sh: setbrk.o sh: builtin.o blok.o stak.o sh: cmd.o fault.o main.o sh: word.o string.o name.o args.o sh: xec.o service.o error.o io.o sh: print.o macro.o expand.o sh: ctype.o msg.o blok.o: brkincr.h fault.o: brkincr.h main.o: brkincr.h stak.o: brkincr.h sh:; cc -o sh -n *.o newsys:; :newsys file=msg; make sh install:; install -s sh $(DESTDIR)/bin clean:; rm -f sh *.o diff:; :diff list:; list Makefile *.hcmd/sh/args.c 644 0 33 4246 2111463503 6311 ((# /* * 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 } om, 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 cmd/sh/blok.c 644 0 33 3664 2111463503 6307 # /* * 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 G BLKPTR p; IF (p=ap) ANDF pword) &= ~BUSY; cmd/sh/brkincr.h 644 0 33 53 2111463503 6744 #define BRKINCR 01000 #define BRKMAX 04000 ; { 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); pr/,5< /,"cmd/sh/builtin.c 644 0 33 27 2111463503 6754 builtin() {return(0);} define BRKMAX 04000 ; { 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); pr/,5< /,"cmd/sh/cmd.c 644 0 33 14023 2111463503 6132 # /* * 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); } 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(); cmd/sh/ctype.c 644 0 33 3563 2111463503 6502 # /* * 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 }; _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, _UPcmd/sh/ctype.h 644 0 33 4362 2111463503 6505 # /* * 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)) ) #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)) #defcmd/sh/defs.h 644 0 33 10734 2254645323 6334 ((# /* * UNIX shell */ /* error exits from various parts of shell */ #define ERROR 1 #define SYNBAD 2 #define SIGFAIL 3 #define SIGFLG 0200 /* command tree */ #define FPRS 020 #define FINT 040 #define FAMP 0100 #define FPIN 0400 #define FPOU 01000 #define FPCL 02000 #define FCMD 04000 #define COMMSK 017 #define TCOM 0 #define TPAR 1 #define TFIL 2 #define TLST 3 #define TIF 4 #define TWH 5 #define TUN 6 #define TSW 7 #define TAND 8 #define TORF 9 #define TFORK 10 #define TFOR 11 /* execute table */ #define SYSSET 1 #define SYSCD 2 #define SYSEXEC 3 #define SYSLOGIN 4 #define SYSTRAP 5 #define SYSEXIT 6 #define SYSSHFT 7 #define SYSWAIT 8 #define SYSCONT 9 #define SYSBREAK 10 #define SYSEVAL 11 #define SYSDOT 12 #define SYSRDONLY 13 #define SYSTIMES 14 #define SYSXPORT 15 #define SYSNULL 16 #define SYSREAD 17 #define SYSTST 18 #define SYSUMASK 19 /* used for input and output of shell */ #define INIO 10 #define OTIO 11 /*io nodes*/ #define USERIO 10 #define IOUFD 15 #define IODOC 16 #define IOPUT 32 #define IOAPP 64 #define IOMOV 128 #define IORDW 256 #define INPIPE 0 #define OTPIPE 1 /* arg list terminator */ #define ENDARGS 0 #include "mac.h" #include "mode.h" #include "name.h" /* result type declarations */ #define alloc malloc ADDRESS alloc(); VOID addblok(); STRING make(); STRING movstr(); TREPTR cmd(); TREPTR makefork(); NAMPTR lookup(); VOID setname(); VOID setargs(); DOLPTR useargs(); REAL expr(); STRING catpath(); STRING getpath(); STRING *scan(); STRING mactrim(); STRING macro(); STRING execs(); VOID await(); VOID post(); STRING copyto(); VOID exname(); STRING staknam(); VOID printnam(); VOID printflg(); VOID prs(); VOID prc(); VOID getenv(); STRING *setenv(); #define attrib(n,f) (n->namflg |= f) #define round(a,b) (((int)((ADR(a)+b)-1))&~((b)-1)) #define closepipe(x) (close(x[INPIPE]), close(x[OTPIPE])) #define eq(a,b) (cf(a,b)==0) #define max(a,b) ((a)>(b)?(a):(b)) #define assert(x) ; /* temp files and io */ UFD output; INT ioset; IOPTR iotemp; /* files to be deleted sometime */ IOPTR iopend; /* documents waiting to be read at NL */ /* substitution */ INT dolc; STRING *dolv; DOLPTR argfor; ARGPTR gchain; /* stack */ #define BLK(x) ((BLKPTR)(x)) #define BYT(x) ((BYTPTR)(x)) #define STK(x) ((STKPTR)(x)) #define ADR(x) ((char*)(x)) /* stak stuff */ #include "stak.h" /* string constants */ MSG atline; MSG readmsg; MSG colon; MSG minus; MSG nullstr; MSG sptbnl; MSG unexpected; MSG endoffile; MSG synmsg; /* name tree and words */ SYSTAB reserved; INT wdval; INT wdnum; ARGPTR wdarg; INT wdset; BOOL reserv; /* prompting */ MSG stdprompt; MSG supprompt; MSG profile; /* built in names */ NAMNOD fngnod; NAMNOD ifsnod; NAMNOD homenod; NAMNOD mailnod; NAMNOD pathnod; NAMNOD ps1nod; NAMNOD ps2nod; /* special names */ MSG flagadr; STRING cmdadr; STRING exitadr; STRING dolladr; STRING pcsadr; STRING pidadr; MSG defpath; /* names always present */ MSG mailname; MSG homename; MSG pathname; MSG fngname; MSG ifsname; MSG ps1name; MSG ps2name; /* transput */ CHAR tmpout[]; STRING tmpnam; INT serial; #define TMPNAM 7 FILE standin; #define input (standin->fdes) #define eof (standin->feof) INT peekc; STRING comdiv; MSG devnull; /* flags */ #define noexec 01 #define intflg 02 #define prompt 04 #define setflg 010 #define errflg 020 #define ttyflg 040 #define forked 0100 #define oneflg 0200 #define rshflg 0400 #define waiting 01000 #define stdflg 02000 #define execpr 04000 #define readpr 010000 #define keyflg 020000 INT flags; /* error exits from various parts of shell */ #include jmp_buf subshell; jmp_buf errshell; /* fault handling */ #include "brkincr.h" POS brkincr; #define MINTRAP 0 #define MAXTRAP 17 #define INTR 2 #define QUIT 3 #define MEMF 11 #define ALARM 14 #define KILL 15 #define TRAPSET 2 #define SIGSET 4 #define SIGMOD 8 VOID fault(); BOOL trapnote; STRING trapcom[]; BOOL trapflg[]; /* name tree and words */ STRING *environ; CHAR numbuf[]; MSG export; MSG readonly; /* execflgs */ INT exitval; BOOL execbrk; INT loopcnt; INT breakcnt; /* messages */ MSG mailmsg; MSG coredump; MSG badopt; MSG badparam; MSG badsub; MSG nospace; MSG notfound; MSG badtrap; MSG baddir; MSG badshift; MSG illegal; MSG restricted; MSG execpmsg; MSG notid; MSG wtfailed; MSG badcreate; MSG piperr; MSG badopen; MSG badnum; MSG arglist; MSG txtbsy; MSG toobig; MSG badexec; MSG notfound; MSG badfile; address end[]; #include "ctype.h" []; MSG export; MSG readonly; /* cmd/sh/dup.h 644 0 33 141 2111463503 6120 # /* * UNIX shell * * S. R. Bourne * Bell Telephone Laboratories * */ #define DUPFLG 0100 g; 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 notfo/,5< /,"cmd/sh/error.c 644 0 33 2105 2111463503 6476 # /* * 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 } rs * 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 iotemcmd/sh/expand.c 644 0 33 5640 2111463503 6633 # /* * UNIX shell * * S. R. Bourne * Bell Telephone Laboratories * */ #include "defs.h" #include #define DIRSIZ 15 #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, dirf; BOOL dir=0; STRING rescan = 0; REG STRING s, cs; ARGPTR schain = gchain; struct direct entry; STATBUF statb; IF trapnote&SIGSET THEN return(0); FI s=cs=as; entry.d_name[DIRSIZ-1]=0; /* to end the string */ /* check for meta chars */ BEGIN REG BOOL slash; slash=0; WHILE !fngchar(*cs) DO IF *cs++==0 THEN IF rflg ANDF slash THEN break; ELSE return(0) FI ELIF *cs=='/' THEN slash++; FI OD END LOOP IF cs==s THEN s=nullstr; break; ELIF *--cs == '/' THEN *cs=0; IF s==cs THEN s="/" FI break; FI POOL IF stat(s,&statb)>=0 ANDF (statb.st_mode&S_IFMT)==S_IFDIR ANDF (dirf=open(s,0))>0 THEN dir++; FI count=0; IF *cs==0 THEN *cs++=0200 FI IF dir THEN /* check for rescan */ REG STRING rs; rs=cs; REP IF *rs=='/' THEN rescan=rs; *rs=0; gchain=0 FI PER *rs++ DONE WHILE read(dirf, &entry, 16) == 16 ANDF (trapnote&SIGSET) == 0 DO IF entry.d_ino==0 ORF (*entry.d_name=='.' ANDF *cs!='.') THEN continue; FI IF gmatch(entry.d_name, cs) THEN addg(s,entry.d_name,rescan); count++; FI OD close(dirf); IF rescan THEN REG ARGPTR rchain; rchain=gchain; gchain=schain; IF count THEN count=0; WHILE rchain DO count += expand(rchain->argval,1); rchain=rchain->argnxt; OD FI *rescan='/'; FI FI BEGIN REG CHAR c; s=as; WHILE c = *s DO *s++=(c&STRIP?c:'/') OD END return(count); } gmatch(s, p) REG STRING s, p; { REG INT scc; CHAR c; IF scc = *s++ THEN IF (scc &= STRIP)==0 THEN scc=0200; FI FI SWITCH c = *p++ IN (( case '[': {BOOL ok; INT lc; ok=0; lc=077777; WHILE c = *p++ DO IF c==']' THEN return(ok?gmatch(s,p):0); ELIF c==MINUS THEN IF lc<=scc ANDF scc<=(*p++) THEN ok++ FI ELSE IF scc==(lc=(c&STRIP)) THEN ok++ FI FI OD return(0); } default: IF (c&STRIP)!=scc THEN return(0) FI case '?': return(scc?gmatch(s,p):0); case '*': IF *p==0 THEN return(1) FI --s; WHILE *s DO IF gmatch(s++,p) THEN return(1) FI OD return(0); case 0: return(scc==0); ENDSW } LOCAL VOID addg(as1,as2,as3) STRING as1, as2, as3; { REG STRING s1, s2; REG INT c; s2 = locstak()+BYTESPERWORD; s1=as1; WHILE c = *s1++ DO IF (c &= STRIP)==0 THEN *s2++='/'; break; FI *s2++=c; OD s1=as2; WHILE *s2 = *s1++ DO s2++ OD IF s1=as3 THEN *s2++='/'; WHILE *s2++ = *++s1 DONE FI makearg(endstak(s2)); } makearg(args) REG STRING args; { args->argnxt=gchain; gchain=args; } DO IF gmatch(s++,p) THEN return(1) FI OD return(0); case 0: return(scc==0); ENDSW }cmd/sh/fault.c 644 0 33 2515 2111463503 6465 # /* * UNIX shell * * S. R. Bourne * Bell Telephone Laboratories * */ #include "defs.h" STRING trapcom[MAXTRAP]; BOOL trapflg[MAXTRAP]; /* ======== fault handling routines ======== */ VOID fault(sig) REG INT sig; { REG INT flag; signal(sig,fault); IF sig==MEMF THEN IF setbrk(brkincr) == -1 THEN error(nospace); FI ELIF sig==ALARM THEN IF flags&waiting THEN done(); FI ELSE flag = (trapcom[sig] ? TRAPSET : SIGSET); trapnote |= flag; trapflg[sig] |= flag; FI } stdsigs() { ignsig(QUIT); getsig(INTR); getsig(MEMF); getsig(ALARM); } ignsig(n) { REG INT s, i; IF (s=signal(i=n,1)&01)==0 THEN trapflg[i] |= SIGMOD; FI return(s); } getsig(n) { REG INT i; IF trapflg[i=n]&SIGMOD ORF ignsig(i)==0 THEN signal(i,fault); FI } oldsigs() { REG INT i; REG STRING t; i=MAXTRAP; WHILE i-- DO t=trapcom[i]; IF t==0 ORF *t THEN clrsig(i); FI trapflg[i]=0; OD trapnote=0; } clrsig(i) INT i; { free(trapcom[i]); trapcom[i]=0; IF trapflg[i]&SIGMOD THEN signal(i,fault); trapflg[i] &= ~SIGMOD; FI } chktrap() { /* check for traps */ REG INT i=MAXTRAP; REG STRING t; trapnote &= ~TRAPSET; WHILE --i DO IF trapflg[i]&TRAPSET THEN trapflg[i] &= ~TRAPSET; IF t=trapcom[i] THEN INT savxit=exitval; execexp(t,0); exitval=savxit; exitset(); FI FI OD } 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]&SIGMcmd/sh/io.c 644 0 33 3507 2254645323 5775 # /* * UNIX shell * * S. R. Bourne * Bell Telephone Laboratories * */ #include "defs.h" #include "dup.h" /* ======== input output and file copying ======== */ initf(fd) UFD fd; { REG FILE f=standin; f->fdes=fd; f->fsiz=((flags&(oneflg|ttyflg))==0 ? BUFSIZ : 1); f->fnxt=f->fend=f->fbuf; f->feval=0; f->flin=1; f->feof=FALSE; } estabf(s) REG STRING s; { REG FILE f; (f=standin)->fdes = -1; f->fend=length(s)+(f->fnxt=s); f->flin=1; return(f->feof=(s==0)); } push(af) FILE af; { REG FILE f; (f=af)->fstak=standin; f->feof=0; f->feval=0; standin=f; } pop() { REG FILE f; IF (f=standin)->fstak THEN IF f->fdes>=0 THEN close(f->fdes) FI standin=f->fstak; return(TRUE); ELSE return(FALSE); FI } chkpipe(pv) INT *pv; { IF pipe(pv)<0 ORF pv[INPIPE]<0 ORF pv[OTPIPE]<0 THEN error(piperr); FI } chkopen(idf) STRING idf; { REG INT rc; IF (rc=open(idf,0))<0 THEN failed(idf,badopen); ELSE return(rc); FI } rename(f1,f2) REG INT f1, f2; { IF f1!=f2 THEN dup(f1|DUPFLG, f2); close(f1); IF f2==0 THEN ioset|=1 FI FI } create(s) STRING s; { REG INT rc; IF (rc=creat(s,0666))<0 THEN failed(s,badcreate); ELSE return(rc); FI } tmpfil() { itos(serial++); movstr(numbuf,tmpnam); return(create(tmpout)); } /* set by trim */ BOOL nosubst; copy(ioparg) IOPTR ioparg; { CHAR c, *ends; REG CHAR *cline, *clinep; INT fd; REG IOPTR iop; IF iop=ioparg THEN copy(iop->iolst); ends=mactrim(iop->ioname); IF nosubst THEN iop->iofile &= ~IODOC FI fd=tmpfil(); iop->ioname=cpystak(tmpout); iop->iolst=iotemp; iotemp=iop; cline=locstak(); LOOP clinep=cline; chkpr(NL); WHILE (c = (nosubst ? readc() : nextc(*ends)), !eolchar(c)) DO *clinep++ = c OD *clinep=0; IF eof ORF eq(cline,ends) THEN break FI *clinep++=NL; write(fd,cline,clinep-cline); POOL close(fd); FI } 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->cmd/sh/mac.h 644 0 33 1554 2111463504 6122 # /* * UNIX shell * * S. R. Bourne * Bell Telephone Laboratories * */ #define LOCAL static #define PROC extern #define TYPE typedef #define STRUCT TYPE struct #define UNION TYPE union #define REG register #define IF if( #define THEN ){ #define ELSE } else { #define ELIF } else if ( #define FI ;} #define BEGIN { #define END } #define SWITCH switch( #define IN ){ #define ENDSW } #define FOR for( #define WHILE while( #define DO ){ #define OD ;} #define REP do{ #define PER }while( #define DONE ); #define LOOP for(;;){ #define POOL } #define SKIP ; #define DIV / #define REM % #define NEQ ^ #define ANDF && #define ORF || #define TRUE (-1) #define FALSE 0 #define LOBYTE 0377 #define STRIP 0177 #define QUOTE 0200 #define EOF 0 #define NL '\n' #define SP ' ' #define LQ '`' #define RQ '\'' #define MINUS '-' #define COLON ':' #define MAX(a,b) ((a)>(b)?(a):(b)) ne IN ){ #define ENDSW } #define FOR for( #define WHILE while( #define DO ){ #define OD ;} #define REP do{ #define PER }while( #define DONE ); #deficmd/sh/macro.c 644 0 33 7743 2111463504 6464 # /* * 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 m((acro(as) STRING as; { /* Strip "" and do $ substitution * Leaves result on top of stack */ REG BOOL savqu =quoted; REG CHAR savq = quote; FILEHDR fb; push(&fb); estabf(as); usestak(); quote=0; quoted=0; copyto(0); pop(); IF quoted ANDF (stakbot==staktop) THEN pushstak(QUOTE) FI quote=savq; quoted=savqu; return(fixstak()); } LOCAL comsubst() { /* command substn */ FILEBLK cb; REG CHAR d; REG STKPTR savptr = fixstak(); usestak(); WHILE (d=readc())!=SQUOTE ANDF d DO pushstak(d) OD BEGIN REG STRING argc; trim(argc=fixstak()); push(&cb); estabf(argc); END BEGIN REG TREPTR t = makefork(FPOU,cmd(EOFSYM,MTFLG|NLFLG)); INT pv[2]; /* this is done like this so that the pipe * is open only when needed */ chkpipe(pv); initf(pv[INPIPE]); execute(t, 0, 0, pv); close(pv[OTPIPE]); END tdystak(savptr); staktop=movstr(savptr,stakbot); WHILE d=readc() DO pushstak(d|quote) OD await(0); WHILE stakbot!=staktop DO IF (*--staktop&STRIP)!=NL THEN ++staktop; break; FI OD pop(); } #define CPYSIZ 512 subst(in,ot) INT in, ot; { REG CHAR c; FILEBLK fb; REG INT count=CPYSIZ; push(&fb); initf(in); /* DQUOTE used to stop it from quoting */ WHILE c=(getch(DQUOTE)&STRIP) DO pushstak(c); IF --count == 0 THEN flush(ot); count=CPYSIZ; FI OD flush(ot); pop(); } LOCAL flush(ot) { write(ot,stakbot,staktop-stakbot); IF flags&execpr THEN write(output,stakbot,staktop-stakbot) FI staktop=stakbot; } IF (*--staktop&STRIP)!=NL cmd/sh/main.c 644 0 33 6147 2504313227 6306 # /* * UNIX shell * * S. R. Bourne * Bell Telephone Laboratories * */ #include "defs.h" #include "dup.h" #include "sym.h" #include "timeout.h" #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 */ getenv(); /* look for restricted */ /* IF c>0 ANDF any('r', *v) THEN rflag=0 FI */ /* look for options */ dolc=options(c,v); IF dolc<2 THEN flags |= stdflg FI IF (flags&stdflg)==0 THEN dolc--; FI dolv=v+c-dolc; dolc--; /* return here for shell file execution */ setjmp(subshell); /* number of positional parameters */ assnum(&dolladr,dolc); cmdadr=dolv[0]; /* set pidname */ assnum(&pidadr, getpid()); /* set up temp file names */ settmp(); /* default ifs */ dfault(&ifsnod, sptbnl); IF (beenhere++)==FALSE THEN /* ? profile */ IF *cmdadr=='-' ANDF (input=pathopen(nullstr, profile))>=0 THEN exfile(rflag); flags &= ~ttyflg; FI IF rflag==0 THEN flags |= rshflg FI /* open input file if specified */ IF comdiv THEN estabf(comdiv); input = -1; ELSE input=((flags&stdflg) ? 0 : chkopen(cmdadr)); comdiv--; FI #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; { dup(fa|DUPFLG, fb); close(fa); ioctl(fb, FIOCLEX, 0); } e) 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[TMcmd/sh/mode.h 644 0 33 6211 2343406444 6310 # /* * 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)) EPTR 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(cmd/sh/msg.c 644 0 33 5160 2254645325 6153 ((# /* * UNIX shell * * S. R. Bourne * Bell Telephone Laboratories * */ #include "defs.h" #include "sym.h" MSG version = "\nVERSION sys137 DATE 1978 Nov 6 14:29:22\n"; /* error messages */ MSG badopt = "bad option(s)"; MSG mailmsg = "you have mail\n"; MSG nospace = "no space"; MSG synmsg = "syntax error"; MSG badnum = "bad number"; MSG badparam = "parameter not set"; MSG badsub = "bad substitution"; MSG badcreate = "cannot create"; MSG illegal = "illegal io"; MSG restricted = "restricted"; MSG piperr = "cannot make pipe"; MSG badopen = "cannot open"; MSG coredump = " - core dumped"; MSG arglist = "arg list too long"; MSG txtbsy = "text busy"; MSG toobig = "too big"; MSG badexec = "cannot execute"; MSG notfound = "not found"; MSG badfile = "bad file number"; MSG badshift = "cannot shift"; MSG baddir = "bad directory"; MSG badtrap = "bad trap"; MSG wtfailed = "is read only"; MSG notid = "is not an identifier"; /* built in names */ MSG pathname = "PATH"; MSG homename = "HOME"; MSG mailname = "MAIL"; MSG fngname = "FILEMATCH"; MSG ifsname = "IFS"; MSG ps1name = "PS1"; MSG ps2name = "PS2"; /* string constants */ MSG nullstr = ""; MSG sptbnl = " \t\n"; MSG defpath = ":/bin:/usr/bin"; MSG colon = ": "; MSG minus = "-"; MSG endoffile = "end of file"; MSG unexpected = " unexpected"; MSG atline = " at line "; MSG devnull = "/dev/null"; MSG execpmsg = "+ "; MSG readmsg = "> "; MSG stdprompt = "$ "; MSG supprompt = "# "; MSG profile = ".profile"; /* tables */ SYSTAB reserved { {"in", INSYM}, {"esac", ESSYM}, {"case", CASYM}, {"for", FORSYM}, {"done", ODSYM}, {"if", IFSYM}, {"while", WHSYM}, {"do", DOSYM}, {"then", THSYM}, {"else", ELSYM}, {"elif", EFSYM}, {"fi", FISYM}, {"until", UNSYM}, { "{", BRSYM}, { "}", KTSYM}, {0, 0}, }; STRING sysmsg[] { 0, "Hangup", 0, /* Interrupt */ "Quit", "Illegal instruction", "Trace/BPT trap", "IOT trap", "EMT trap", "Floating exception", "Killed", "Bus error", "Memory fault", "Bad system call", 0, /* Broken pipe */ "Alarm call", "Terminated", "Signal 16", }; MSG export = "export"; MSG readonly = "readonly"; SYSTAB commands { {"cd", SYSCD}, {"read", SYSREAD}, /* {"[", SYSTST}, */ {"set", SYSSET}, {":", SYSNULL}, {"trap", SYSTRAP}, {"login", SYSLOGIN}, {"wait", SYSWAIT}, {"eval", SYSEVAL}, {".", SYSDOT}, {"newgrp", SYSLOGIN}, {readonly, SYSRDONLY}, {export, SYSXPORT}, {"chdir", SYSCD}, {"break", SYSBREAK}, {"continue", SYSCONT}, {"shift", SYSSHFT}, {"exit", SYSEXIT}, {"exec", SYSEXEC}, {"times", SYSTIMES}, {"umask", SYSUMASK}, {0, 0}, }; G readonly = "readonly"; SYSTAB commands { {"cd", SYSCD}, {"read", SYSREAD}, /* {"[", SYSTST}, */ {"set", SYSSET}, {":", SYSNULL}, {"trap", SYSTRAP}, {"login", SYSLOGIN}, {"wait", SYSWAIT}, {"eval", SYSEVAL}, {".", SYSDOT}, {"newgrp", SYSLOGIN}, {readonly, SYSRDONLY}, {export, SYSXPORT}, {"chdir", SYSCD}, {"break", SYSBREAK}, {"continue", SYSCONT}, {"shift",cmd/sh/name.c 644 0 33 10721 2111463504 6311 # /* * UNIX shell * * S. R. Bourne * Bell Telephone Laboratories * */ #include "defs.h" PROC BOOL chkid(); NAMNOD ps2nod = { NIL, NIL, ps2name}, fngnod = { NIL, NIL, fngname}, pathnod = { NIL, NIL, pathname}, ifsnod = { NIL, NIL, ifsname}, ps1nod = { &pathnod, &ps2nod, ps1name}, homenod = { &fngnod, &ifsnod, homename}, mailnod = { &homenod, &ps1nod, mailname}; NAMPTR namep = &mailnod; /* ======== variable and string handling ======== */ syslook(w,syswds) STRING w; SYSTAB syswds; { REG CHAR first; REG STRING s; REG SYSPTR syscan; syscan=syswds; first = *w; WHILE s=syscan->sysnam DO IF first == *s ANDF eq(w,s) THEN return(syscan->sysval); FI syscan++; OD return(0); } setlist(arg,xp) REG ARGPTR arg; INT xp; { WHILE arg DO REG STRING s=mactrim(arg->argval); setname(s, xp); arg=arg->argnxt; IF flags&execpr THEN prs(s); IF arg THEN blank(); ELSE newline(); FI FI OD } VOID setname(argi, xp) STRING argi; INT xp; { REG STRING argscan=argi; REG NAMPTR n; IF letter(*argscan) THEN WHILE alphanum(*argscan) DO argscan++ OD IF *argscan=='=' THEN *argscan = 0; n=lookup(argi); *argscan++ = '='; attrib(n, xp); IF xp&N_ENVNAM THEN n->namenv = n->namval = argscan; ELSE assign(n, argscan); FI return; FI FI failed(argi,notid); } replace(a, v) REG STRING *a; STRING v; { free(*a); *a=make(v); } dfault(n,v) NAMPTR n; STRING v; { IF n->namval==0 THEN assign(n,v) FI } assign(n,v) NAMPTR n; STRING v; { IF n->namflg&N_RDONLY THEN failed(n->namid,wtfailed); ELSE replace(&n->namval,v); FI } INT readvar(names) STRING *names; { FILEBLK fb; REG FILE f = &fb; REG CHAR c; REG INT rc=0; NAMPTR n=lookup(*names++); /* done now to avoid storage mess */ STKPTR rel=relstak(); push(f); initf(dup(0)); IF lseek(0,0L,1)==-1 THEN f->fsiz=1; FI LOOP c=nextc(0); IF (*names ANDF any(c, ifsnod.namval)) ORF eolchar(c) THEN zerostak(); assign(n,absstak(rel)); setstak(rel); IF *names THEN n=lookup(*names++); ELSE n=0; FI IF eolchar(c) THEN break; FI ELSE pushstak(c); FI POOL WHILE n DO assign(n, nullstr); IF *names THEN n=lookup(*names++); ELSE n=0; FI OD IF eof THEN rc=1 FI lseek(0, (long)(f->fnxt-f->fend), 1); pop(); return(rc); } assnum(p, i) STRING *p; INT i; { itos(i); replace(p,numbuf); } STRING make(v) STRING v; { REG STRING p; IF v THEN movstr(v,p=alloc(length(v))); return(p); ELSE return(0); FI } NAMPTR lookup(nam) REG STRING nam; { REG NAMPTR nscan=namep; REG NAMPTR *prev; INT LR; IF !chkid(nam) THEN failed(nam,notid); FI WHILE nscan DO IF (LR=cf(nam,nscan->namid))==0 THEN return(nscan); ELIF LR<0 THEN prev = &(nscan->namlft); ELSE prev = &(nscan->namrgt); FI nscan = *prev; OD /* add name node */ nscan=alloc(sizeof *nscan); nscan->namlft=nscan->namrgt=NIL; nscan->namid=make(nam); nscan->namval=0; nscan->namflg=N_DEFAULT; nscan->namenv=0; return(*prev = nscan); } LOCAL BOOL chkid(nam) STRING nam; { REG CHAR * cp=nam; IF !letter(*cp) THEN return(FALSE); ELSE WHILE *++cp DO IF !alphanum(*cp) THEN return(FALSE); FI OD FI return(TRUE); } LOCAL VOID (*namfn)(); namscan(fn) VOID (*fn)(); { namfn=fn; namwalk(namep); } LOCAL VOID namwalk(np) REG NAMPTR np; { IF np THEN namwalk(np->namlft); (*namfn)(np); namwalk(np->namrgt); FI } VOID printnam(n) NAMPTR n; { REG STRING s; sigchk(); IF s=n->namval THEN prs(n->namid); prc('='); prs(s); newline(); FI } LOCAL STRING staknam(n) REG NAMPTR n; { REG STRING p; p=movstr(n->namid,staktop); p=movstr("=",p); p=movstr(n->namval,p); return(getstak(p+1-ADR(stakbot))); } VOID exname(n) REG NAMPTR n; { IF n->namflg&N_EXPORT THEN free(n->namenv); n->namenv = make(n->namval); ELSE free(n->namval); n->namval = make(n->namenv); FI } VOID printflg(n) REG NAMPTR n; { IF n->namflg&N_EXPORT THEN prs(export); blank(); FI IF n->namflg&N_RDONLY THEN prs(readonly); blank(); FI IF n->namflg&(N_EXPORT|N_RDONLY) THEN prs(n->namid); newline(); FI } VOID getenv() { REG STRING *e=environ; WHILE *e DO setname(*e++, N_ENVNAM) OD } LOCAL INT namec; VOID countnam(n) NAMPTR n; { namec++; } LOCAL STRING *argnam; VOID pushnam(n) NAMPTR n; { IF n->namval THEN *argnam++ = staknam(n); FI } STRING *setenv() { REG STRING *er; namec=0; namscan(countnam); argnam = er = getstak(namec*BYTESPERWORD+BYTESPERWORD); namscan(pushnam); *argnam++ = 0; return(er); } blank(); FI IF n->namflg&(N_EXPORT|N_RDONLY) cmd/sh/name.h 644 0 33 467 2111463504 6264 # /* * 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; }; REG STRING *er; namec=0; namscan(countnam); argnam = er = getstak(namec*BYTESPERWORD+BYTESPERWORD); nams/,5< /,"cmd/sh/print.c 644 0 33 2064 2111463504 6506 # /* * 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 } 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==iccmd/sh/service.c 644 0 33 14040 2326705073 7037 # /* * UNIX shell * * S. R. Bourne * Bell Telephone Laboratories * */ #include "defs.h" PROC VOID gsort(); #define ARGMK 01 INT errno; STRING sysmsg[]; /* fault handling */ #define ENOMEM 12 #define ENOEXEC 8 #define E2BIG 7 #define ENOENT 2 #define ETXTBSY 26 /* service routines for `execute' */ VOID initio(iop) IOPTR iop; { REG STRING ion; REG INT iof, fd; IF iop THEN iof=iop->iofile; ion=mactrim(iop->ioname); IF *ion ANDF (flags&noexec)==0 THEN IF iof&IODOC THEN subst(chkopen(ion),(fd=tmpfil())); close(fd); fd=chkopen(tmpout); unlink(tmpout); ELIF iof&IOMOV THEN IF eq(minus,ion) THEN fd = -1; close(iof&IOUFD); ELIF (fd=stoi(ion))>=USERIO THEN failed(ion,badfile); ELSE fd=dup(fd); FI ELIF (iof&IOPUT)==0 THEN fd=chkopen(ion); ELIF flags&rshflg THEN failed(ion,restricted); ELIF iof&IOAPP ANDF (fd=open(ion,1))>=0 THEN lseek(fd, 0L, 2); ELSE fd=create(ion); FI IF fd>=0 THEN rename(fd,iof&IOUFD); FI FI initio(iop->ionxt); FI } STRING getpath(s) STRING s; { REG STRING path; IF any('/',s) THEN IF flags&rshflg THEN failed(s, restricted); ELSE return(nullstr); FI ELIF (path = pathnod.namval)==0 THEN return(defpath); ELSE return(cpystak(path)); FI } INT pathopen(path, name) REG STRING path, name; { REG UFD f; REP path=catpath(path,name); PER (f=open(curstak(),0))<0 ANDF path DONE return(f); } STRING catpath(path,name) REG STRING path; STRING name; { /* leaves result on top of stack */ REG STRING scanp = path, argp = locstak(); WHILE *scanp ANDF *scanp!=COLON DO *argp++ = *scanp++ OD IF scanp!=path THEN *argp++='/' FI IF *scanp==COLON THEN scanp++ FI path=(*scanp ? scanp : 0); scanp=name; WHILE (*argp++ = *scanp++) DONE return(path); } LOCAL STRING xecmsg; LOCAL STRING *xecenv; VOID execa(at) STRING at[]; { REG STRING path; REG STRING *t = at; IF (flags&noexec)==0 THEN xecmsg=notfound; path=getpath(*t); namscan(exname); xecenv=setenv(); WHILE path=execs(path,t) DONE failed(*t,xecmsg); FI } LOCAL STRING execs(ap,t) STRING ap; REG STRING t[]; { REG STRING p, prefix; prefix=catpath(ap,t[0]); trim(p=curstak()); sigchk(); execve(p, &t[0] ,xecenv); SWITCH errno IN case ENOEXEC: flags=0; comdiv=0; ioset=0; clearup(); /* remove open files and for loop junk */ IF input THEN close(input) FI close(output); output=2; input=chkopen(p); /* 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; p=wait(&w); WHILE pw <= &pwlist[ipwc] DO IF *pw==p THEN *pw=0; pwc--; ELSE pw++; FI OD END IF p == -1 THEN continue FI w_hi = (w>>8)&LOBYTE; IF sig = w&0177 THEN IF sig == 0177 /* ptrace! return */ THEN prs("ptrace: "); sig = w_hi; FI IF sysmsg[sig] THEN IF i!=p ORF (flags&prompt)==0 THEN prp(); prn(p); blank() FI prs(sysmsg[sig]); IF w&0200 THEN prs(coredump) FI FI newline(); FI IF rc==0 THEN rc = (sig ? sig|SIGFLG : w_hi); FI wx |= w; OD IF wx ANDF flags&errflg THEN exitsh(rc); FI exitval=rc; exitset(); } BOOL nosubst; trim(at) STRING at; { REG STRING p; REG CHAR c; REG CHAR q=0; IF p=at THEN WHILE c = *p DO *p++=c&STRIP; q |= c OD FI nosubst=q"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 } I 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 Lcmd/sh/setbrk.c 644 0 33 247 2111463504 6625 # /* * UNIX shell * * S. R. Bourne * Bell Telephone Laboratories * */ #include "defs.h" setbrk(incr) { REG BYTPTR a=sbrk(incr); brkend=a+incr; return(a); } 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/,5ȇ< /,"cmd/sh/stak.c 644 0 33 2261 2111463504 6313 # /* * 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()))); } argp; { /* tidy up after `locstak' */ REG STKPTR oldstak; *argp++=0; oldstak=stakbot; stakbot=staktop=round(argp,BYTESPERWORD); return(oldstak); } VOID tdystak(x) REG STKPTR x; { /* try to bring stack back to x */ WHILE ADR(stakbsy)>ADR(x) DO free(stakbsy); stakbsy = stakbsy->word; OD staktop=stakbot=max(ADR(x),ADR(stcmd/sh/stak.h 644 0 33 3071 2111463504 6320 # /* * 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(); 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 */ STKPcmd/sh/string.c 644 0 33 1112 2111463504 6651 # /* * 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); } / #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) STRINcmd/sh/sym.h 644 0 33 1373 2111463504 6171 # /* * 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 '{' SYM 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 EOFSYcmd/sh/timeout.h 644 0 33 142 2254645326 7034 # /* * UNIX shell * * S. R. Bourne * Bell Telephone Laboratories * */ #define TIMEOUT 2400 define MARK 0100000 /* odd chars */ #define DQUOTE '"' #define SQUOTE '`' #define LITERAL '\'' #define DOLLAR '$' #define ESCAPE '\\' #define BRACE '{' SYM 0436 #define FORSYM 0435 #define WHSYM 0433 #define UNSYM 0427 #define CASYM 0417 #define SYMREP 04000 #define ECSYM (SYMREP|';') #define ANDFSYM (SYMREP|'&') #defi/,5< /,"cmd/sh/word.c 644 0 33 4510 2514716253 6334 # /* * 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=='#' 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; REP IF trapnote&SIGSET THEN newline(); sigchk() FI PER (len=read(f->fdes,f->fbuf,f->fsiz))<0 ANDF trapnote DONE return(len); } oto 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 cmd/sh/xec.c 644 0 33 20241 2254645327 6163 # /* * UNIX shell * * S. R. Bourne * Bell Telephone Laboratories * */ #include "defs.h" #include "sym.h" LOCAL INT parent; SYSTAB commands; /* ======== command execution ========*/ execute(argt, execflg, pf1, pf2) TREPTR argt; INT *pf1, *pf2; { /* `stakbot' is preserved by this routine */ REG TREPTR t; STKPTR sav=savstak(); sigchk(); IF (t=argt) ANDF execbrk==0 THEN REG INT treeflgs; INT oldexit, type; REG STRING *com; treeflgs = t->tretyp; type = treeflgs&COMMSK; oldexit=exitval; exitval=0; SWITCH type IN case TCOM: BEGIN STRING a1; INT argn, internal; ARGPTR schain=gchain; IOPTR io=t->treio; gchain=0; argn = getarg(t); com=scan(argn); a1=com[1]; gchain=schain; IF (internal=syslook(com[0],commands)) ORF argn==0 THEN setlist(t->comset, 0); FI IF argn ANDF (flags&noexec)==0 THEN /* print command if execpr */ IF flags&execpr THEN argn=0; prs(execpmsg); WHILE com[argn]!=ENDARGS DO prs(com[argn++]); blank() OD newline(); FI SWITCH internal IN case SYSDOT: IF a1 THEN REG INT f; IF (f=pathopen(getpath(a1), a1)) < 0 THEN failed(a1,notfound); ELSE execexp(0,f); FI FI break; case SYSTIMES: { L_INT t[4]; times(t); prt(t[2]); blank(); prt(t[3]); newline(); } break; case SYSEXIT: exitsh(a1?stoi(a1):oldexit); case SYSNULL: io=0; break; case SYSCONT: execbrk = -loopcnt; break; case SYSBREAK: IF (execbrk=loopcnt) ANDF a1 THEN breakcnt=stoi(a1); FI break; case SYSTRAP: IF a1 THEN BOOL clear; IF (clear=digit(*a1))==0 THEN ++com; FI WHILE *++com DO INT i; IF (i=stoi(*com))>=MAXTRAP ORF 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(); } RGPTR 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,fcmd/spell/ 775 0 33 0 2552563430 5636 ((cmd/spell/american 444 0 33 5636 2111463506 7425 acknowledgment aggrandize aluminize aluminum amor amorous amphitheater analog analyze anemia anemic anesthesia anesthetic anesthetize antagonize apologize appareled appareling appetize arbor archeology ardor arithmetize armor armory axiomatize baptize barreled barreling behavior behoove belabor beveled beveler beveling canceled canceler canceling candor catalog catalyze catechize categorize cauterize center channeled channeler channeling chiseled chiseler chiseling clamor clamorous clangor color colorable colorful colorist corbeled corbeling counseled counseling crystallize cudgeled cudgeler cudgeling decentralize decriminalize defense dehumanize deionize demagnetize demeanor demineralize demoralize depersonalize depolarize desensitize detribalize dialyze diarrhea discolor disemboweled disemboweling disfavor disheveled disheveler disheveling dishonor dishonorable disorganize doweled doweler doweling dramatize dueled dueler dueling duelist economize ecumenical edema emphasize enameled enameling enamor encyclopedia endeavor energize eon epicenter esophagus eulogize favor favorable favorite fervor fiber flavor fraternize fueled fueler fueling funneled funneler funneling furor galvanize gaveled gaveler gaveling glamorize gram graveled graveling groveled groveler groveling gynecology harbor harmonize hiccup hiccupped hiccupping homeopathy homogenize honor honorable humor hydrolyze hypnotize hypostatize hypothesize jeweled jeweler jeweling judgment kilogram kinesthetic labeled labeler labeling labor laborite legitimize leveled leveler leveling libeled libeler libeling license liter logorrhea louver luster marveled marveler marveling mechanize medieval memorize mesmerize metallize milligram milliliter millimeter modeled modeler modeling nanogram naught neighbor neighborhood notarize ocher odor offense optimize orientation ostracize pajama pallor paneled paneling paralleled paralleling paralyze parametrize parceled parceler parceling parenthesize parlor peptize photolyze photosynthesize picogram plagiarize preprogram program proselytize psychoanalyze psycoanalyze pulverize pummeled pummeler pummeling pyorrhea pyrolyze quantize quarreled quarreler quarreling rancor raveled raveler raveling realize recognize reconnoiter reveled reveler reveling rigor rumor saber saltpeter savior savor savory scepter schematize scrutinize sensitize sepulcher shoveled shoveler shoveling shriveled shriveling siphon sniveled sniveler sniveling soliloquize specialty specter spirochete splendor squirreled squirreling stigmatize succor summarize swiveled swiveling symmetrize sympathize synchronize synthesize systematize tantalize tasseled tasseling temporize theater theatergoer theatergoing theorize tinseled tinseling titer toweled toweling trammeled traumatize traveled traveler traveling tricolor tumor tunneled tunneler tunneling tyrannize valor vapor varicolored vigor vulcanize wagon watercolor watercolorist weaseled weaseling whiskey yodeled yodeling oquize specialty specter spirochete splendor squirreled squirreling stigmatize succor summarize swcmd/spell/british 444 0 33 6177 2111463506 7313 acclimatise aeon aerodrome aeroplane aggrandise alarum aluminium amour amourous amphitheatre anaemia anaemic anaesthesia anaesthetic anaesthetise analyse antagonise apologise apparelled apparelling appetise arbour archaeology ardour arithmetise armour armoury axiomatise baptise barrelled barrelling behaviour behavioural behove belabour bevelled beveller bevelling cancelled canceller cancelling candour catalyse catechise categorise cauterise centimetre centre channelled channeller channelling cheque chequer chiselled chiseller chiselling clamour clamourous clangour colour colourable colourist connexion corbelled corbelling counselled counselling crystallise cudgelled cudgeller cudgelling decentralise decriminalise defence dehumanise deionise demagnetise demeanour demineralise demoralise depersonalise depolarise desensitise detribalise dialyse diarrhoea discolour disembowelled disembowelling disfavour dishevelled disheveller dishevelling dishonour dishonourable disorganise dowelled doweller dowelling dramatise draught duelled dueller duelling duellist economise emphasise enamelled enamelling enamour encyclopaedia endeavour energise epicentre eulogise favour favourable favourite fervour fibre flavour fraternise fuelled fueller fuelling funnelled funneller funnelling furore fuze galvanise gaol gavelled gaveller gavelling glamourise gramme gravelled gravelling grovelled groveller grovelling gynaecology harbour harmonise homoeopathy homogenise honour honourable humour hydrolyse hypnotise hypostatise hypothesise jewelled jeweller jewelling kilogramme kilometre kinaesthetic labelled labeller labelling labour labourite legitimise levelled leveller levelling libelled libeller libelling licence litre logorrhoea lustre marvelled marveller marvelling mechanise mediaeval memorise mesmerise metallise metre milligramme millilitre millimetre modelled modeller modelling nanogramme nanometre neighbour neighbourhood notarise nought ochre odour oecumenical oedema oesophagus offence optimise orientate ostracise pallour panelled panelling parallelled parallelling paralyse parametrise parcelled parceller parcelling parenthesise parlour peptise photolyse photosynthesise picogramme plagiarise practise preprogramme programme proselytise psychoanalyse pulverise pummelled pummeller pummelling pyjama pyorrhoea pyrolyse quantise quarrelled quarreller quarrelling rancour ravelled raveller ravelling realise recognise reconnoitre revelled reveller revelling rigour rumour sabre saltpetre saviour savour savoury sceptre schematise scrutinise sensitise sepulchre shovelled shoveller shovelling shrivelled shrivelling snivelled sniveller snivelling soliloquise speciality spectre splendour squirrelled squirrelling stigmatise succour summarise millimetre swivelled swivelling symmetrise sympathise synchronise synthesise syphon systematise tantalise tasselled tasselling temporise theatre theorise tinselled tinselling titre towelled towelling trammelled traumatise travelled traveller travelling tricolour tumour tunnelled tunneller tunnelling tyrannise tyre valour vapour varicoloured vigour vulcanise waggon watercolour watercolourist weaselled weaselling whilst whisky yodelled yodelling splendour squirrelled squirrelling stigmatise succour summarise millimetre swivelled swivelling symmetrise sympathise synchronise synthesise syphon systematise tantalise tasselled tasselling temporise theatre theorise tinselled tinselling titre towelled towelling trammelled traumatise travelled traveller travelling tricolour tumour tunnelled tunneller tunnelling tyrannise tyre valoucmd/spell/Makefile 644 0 33 1471 2263502423 7356 all: spell hlist hlista hlistb hstop spellin spellout install: all install -s spell $(DESTDIR)/usr/lib install -s spellin ${DESTDIR}/usr/bin install -s spellout ${DESTDIR}/usr/bin install -c hlista $(DESTDIR)/usr/dict install -c hlistb $(DESTDIR)/usr/dict install -c hstop $(DESTDIR)/usr/dict install -c spell.sh $(DESTDIR)/usr/bin/spell clean: rm -f spell spellin hlista hlistb hlist hstop spellout spell: spell.c cc -s -O spell.c -o spell spellin: spellin.c cc -O -s spellin.c -o spellin spellout: spellout.c cc -O -s spellout.c -o spellout hlist: /usr/dict/words spellin spellin hlist hlista: american local hlist spellin (cat american local)|spellin hlist >hlista hlistb: british local hlist spellin (cat british local)|spellin hlist >hlistb hstop: stop spellin spellin hstop pell.sh $(DESTDIR)/usr/bin/spell clean: rm -f spell spellin hlista hlistb hlist hstop spellout spell: spell.c cc -s -O spell.c -o spell spellin: spellin.c cc -O -s spellin.c -o spellin spelloutcmd/spell/local 644 0 33 4737 2415741750 6752 aardvark abort abs ac access acct accton adb adduser adventure alarm analyze apl apropos ar arcv arff arithmetic as ascii assert at atof awk backgammon banner basename bc bcd binmail bk boggle bproc brk cal calendar call cat catman cb cc ccat cd changes char chdir checklist checknr chess chfn chgrp ching chmod chown chsh clear close clri cmp col colcrt colrm comm compact cons core cp crash creat cribbage cron crypt csh ctags ctime ctype cu curses cxref date dbm dc dcheck dd ddate delivermail deroff df dh di((ction diff diff3 diffdir diffh dir dmesg drum du dump dumpdir dup dz echo ecvt ed edit efl egrep end enroll environ eqn eqnchar error ex exec execl execle execlp execv execve execvp exit exp expand explain expr eyacc f77 false fclose ferror fgrep file filsys find finger fish fl flcopy floor flushnote fmt fold fopen fork fread frexp from fsck fseek gamma getarg getc getenv getgrent getlogin getpass getpgrp getpid getpw getpwent gets getuid graph greek grep group hangman head hier hp ht hypot icheck id indir int intro ioctl iostat iul j0 jobs join kill killpg kl kmem l3tol last lastcomm ld learn leave lex link lint lisp liszt ln lock login look lookbib lorder lp lpq lpr lprm ls lseek lxref m4 mail mailaliases make makekey malloc man me mem mesg mille mkdir mkfs mknod mkstr mktemp mm monitor monop more mount mpu mpx mpxio ms msgs mtab mv ncheck neqn net netcp netlog netlogin netlpr netmail netq netrm nettroff newcsh newgrp newtty nice nlist nm nroff null num number od old open page passwd pause pc perror pi pipe pix plot popen pr print printenv printf prmail prof profil ps pstat pti ptrace ptx putc puts pwd px pxp pxref qsort quiz quot rand ranlib ratfor read refer regex renice reset restor rev rewind rk rm rmdir sa scanf script sdb sed see setbuf setjmp setpgrp setuid sh signal sigset sigsys sin sinh size sleep snake soelim sort spell spline split ssp stab stat stdio sticky stime string strings strip struct stty style su sum swab swapon symorder sync sys sysgen system tabs tail tar tbl tc tee term termcap termlib test time times tk tm touch tp tr tra trek trman troff true tset tsort tty ttyname ttys ttytype types ul umask uncompact ungetc uniq units unlink up update uptime users usr utime utmp uuclean uucp uudiff uuencode uulog uuname uusend uustat uux va vadvise valloc vfont vfontinfo vfork vgrind vhangup vi vlimit vmstat vp vpac vpq vpr vprint vprm vread vswapon vtimes vtroff vwrite w wait wait3 wall wc whatis whereis which who whoami write wtmp wump xget xsend xstr yacc yes zork r tbl tc tee term termcap termlibcmd/spell/spell.c 644 0 33 17765 2111463506 7236 #include "spell.h" #define DLEV 2 char *strcat(); int strip(); char *skipv(); int an(); int s(); int es(); int ily(); int ncy(); int CCe(); int VCe(); int bility(); int tion(); int ize(); int y_to_e(); int i_to_y(); int nop(); int metry(); struct suftab { char *suf; int (*p1)(); int n1; char *d1; char *a1; int (*p2)(); int n2; char *d2; char *a2; } suftab[] = { {"ssen",ily,4,"-y+iness","+ness" }, {"ssel",ily,4,"-y+i+less","+less" }, {"se",s,1,"","+s", es,2,"-y+ies","+es" }, {"s'",s,2,"","+'s"}, {"s",s,1,"","+s"}, {"ecn",ncy,1,"","-t+ce"}, {"ycn",ncy,1,"","-cy+t"}, {"ytilb",nop,0,"",""}, {"ytilib",bility,5,"-le+ility",""}, {"elbaif",i_to_y,4,"-y+iable",""}, {"elba",CCe,4,"-e+able","+able"}, {"yti",CCe,3,"-e+ity","+ity"}, {"ylb",y_to_e,1,"-e+y",""}, {"yl",ily,2,"-y+ily","+ly"}, {"laci",strip,2,"","+al"}, {"latnem",strip,2,"","+al"}, {"lanoi",strip,2,"","+al"}, {"tnem",strip,4,"","+ment"}, {"gni",CCe,3,"-e+ing","+ing"}, {"reta",nop,0,"",""}, {"re",strip,1,"","+r", i_to_y,2,"-y+ier","+er"}, {"de",strip,1,"","+d", i_to_y,2,"-y+ied","+ed"}, {"citsi",strip,2,"","+ic"}, {"cihparg",i_to_y,1,"-y+ic",""}, {"tse",strip,2,"","+st", i_to_y,3,"-y+iest","+est"}, {"cirtem",i_to_y,1,"-y+ic",""}, {"yrtem",metry,0,"-ry+er",""}, {"cigol",i_to_y,1,"-y+ic",""}, {"tsigol",i_to_y,2,"-y+ist",""}, {"tsi",VCe,3,"-e+ist","+ist"}, {"msi",VCe,3,"-e+ism","+ist"}, {"noitacif",i_to_y,6,"-y+ication",""}, {"noitazi",ize,5,"-e+ation",""}, {"rota",tion,2,"-e+or",""}, {"noit",tion,3,"-e+ion","+ion"}, {"naino",an,3,"","+ian"}, {"na",an,1,"","+n"}, {"evit",tion,3,"-e+ive","+ive"}, {"ezi",CCe,3,"-e+ize","+ize"}, {"pihs",strip,4,"","+ship"}, {"dooh",ily,4,"-y+hood","+hood"}, {"ekil",strip,4,"","+like"}, 0 }; char *preftab[] = { "anti", "bio", "dis", "electro", "en", "fore", "hyper", "intra", "inter", "iso", "kilo", "magneto", "meta", "micro", "milli", "mis", "mono", "multi", "non", "out", "over", "photo", "poly", "pre", "pseudo", "re", "semi", "stereo", "sub", "super", "thermo", "ultra", "under", /*must precede un*/ "un", 0 }; int vflag; int xflag; char word[100]; char original[100]; char *deriv[40]; char affix[40]; main(argc,argv) char **argv; { register char *ep, *cp; register char *dp; int fold; int j; FILE *file, *found; if(!prime(argc,argv)) { fprintf(stderr, "spell: cannot initialize hash table\n"); exit(1); } found = fopen(argv[2],"w"); for(argc-=3,argv+=3; argc>0 && argv[0][0]=='-'; argc--,argv++) switch(argv[0][1]) { case 'b': ise(); break; case 'v': vflag++; break; case 'x': xflag++; break; } for(;; fprintf(file,"%s%s\n",affix,original)) { affix[0] = 0; file = found; for(ep=word;(*ep=j=getchar())!='\n';ep++) if(j == EOF) exit(0); for(cp=word,dp=original; cpsuf;t++) { cp = ep; while(*sp) if(*--cp!=*sp++) goto next; for(sp=cp; --sp>=word&&!vowel(*sp); ) ; if(spp1)(ep-t->n1,t->d1,t->a1,lev+1)) return(1); if(t->p2!=0) { deriv[lev] = deriv[lev+1] = 0; return((*t->p2)(ep-t->n2,t->d2,t->a2,lev)); } return(0); next: ; } return(0); } nop() { return(0); } strip(ep,d,a,lev) char *ep,*d,*a; { return(putsuf(ep,a,lev)||suffix(ep,lev)); } s(ep,d,a,lev) char *ep,*d,*a; { if(lev>DLEV+1) return(0); if(*ep=='s'&&ep[-1]=='s') return(0); return(strip(ep,d,a,lev)); } an(ep,d,a,lev) char *ep,*d,*a; { if(!isupper(*word)) /*must be proper name*/ return(0); return(putsuf(ep,a,lev)); } ize(ep,d,a,lev) char *ep,*d,*a; { *ep++ = 'e'; return(strip(ep,"",d,lev)); } y_to_e(ep,d,a,lev) char *ep,*d,*a; { *ep++ = 'e'; return(strip(ep,"",d,lev)); } ily(ep,d,a,lev) char *ep,*d,*a; { if(ep[-1]=='i') return(i_to_y(ep,d,a,lev)); else return(strip(ep,d,a,lev)); } ncy(ep,d,a,lev) char *ep, *d, *a; { if(skipv(skipv(ep-1))DLEV) return(0); switch(ep[-1]) { default: return(0); case 'i': return(i_to_y(ep,d,a,lev)); case 's': case 'h': case 'z': case 'x': return(strip(ep,d,a,lev)); } } metry(ep,d,a,lev) char *ep, *d,*a; { ep[-2] = 'e'; ep[-1] = 'r'; return(strip(ep,d,a,lev)); } tion(ep,d,a,lev) char *ep,*d,*a; { switch(ep[-2]) { case 'c': case 'r': return(putsuf(ep,a,lev)); case 'a': return(y_to_e(ep,d,a,lev)); } return(0); } /* possible consonant-consonant-e ending*/ CCe(ep,d,a,lev) char *ep,*d,*a; { switch(ep[-1]) { case 'l': if(vowel(ep[-2])) break; switch(ep[-2]) { case 'l': case 'r': case 'w': break; default: return(y_to_e(ep,d,a,lev)); } break; case 's': if(ep[-2]=='s') break; case 'c': case 'g': if(*ep=='a') return(0); case 'v': case 'z': if(vowel(ep[-2])) break; case 'u': if(y_to_e(ep,d,a,lev)) return(1); if(!(ep[-2]=='n'&&ep[-1]=='g')) return(0); } return(VCe(ep,d,a,lev)); } /* possible consonant-vowel-consonant-e ending*/ VCe(ep,d,a,lev) char *ep,*d,*a; { char c; c = ep[-1]; if(c=='e') return(0); if(!vowel(c) && vowel(ep[-2])) { c = *ep; *ep++ = 'e'; if(putsuf(ep,d,lev)||suffix(ep,lev)) return(1); ep--; *ep = c; } return(strip(ep,d,a,lev)); } char *lookuppref(wp,ep) char **wp; char *ep; { register char **sp; register char *bp,*cp; for(sp=preftab;*sp;sp++) { bp = *wp; for(cp= *sp;*cp;cp++,bp++) if(Tolower(*bp)!=*cp) goto next; for(cp=bp;cp0); strcat(affix,"\t"); return(i); } monosyl(bp,ep) char *bp, *ep; { if(ep=bp) if(vowel(*ep)) return(0); return(1); } char * skipv(s) char *s; { if(s>=word&&vowel(*s)) s--; while(s>=word&&!vowel(*s)) s--; return(s); } vowel(c) { switch(Tolower(c)) { case 'a': case 'e': case 'i': case 'o': case 'u': case 'y': return(1); } return(0); } /* crummy way to Brit((ishise */ ise() { register struct suftab *p; for(p = suftab;p->suf;p++) { ztos(p->suf); ztos(p->d1); ztos(p->a1); } } ztos(s) char *s; { for(;*s;s++) if(*s=='z') *s = 's'; } dict(bp,ep) char *bp, *ep; { register char *wp; long h; register long *lp; register i; if(xflag) printf("=%.*s\n",ep-bp,bp); for(i=0; i #include #ifndef unix #define SHIFT 5 #define TABSIZE (int)(400000/(1< 1) { FILE *f; if ((f = fopen(argv[1], "ri")) == NULL) return(0); if (fread((char *)tab, sizeof(*tab), TABSIZE, f) != TABSIZE) return(0); fclose(f); } for (i=0; i>SHIFT]&(1<<((int)h&((1<>SHIFT] |= 1<<((int)h&((1< 1) { FILE *f; if ((f = fopen(argv[1], "ri")) == NULL) return(0); if (fread((char *)tab, sizeof(*tab), TABSIZE, f) != TABSIZE) return(0); fclose(f); } for (i=0; i>$H 2>/dev/null case $V in /dev/null) exit esac sed '/^\./d' $V | sort -u +1f +0 H history, S stop, V data for -v H=${H-/usr/dict/spellhist} T=/tmp/spell.$$ V=/dev/null F= B= trap "rm -f $T*; exit" 0 1 2 13 15 for A in $* do case $A in -v) B="$B -v" V=${T}a ;; -a) ;; -b) D=${D-/usr/dict/hlistb} B="$B -b" ;; *) F="$F $A" esac done deroff -w $F |\ sort -u |\ /usr/lib/spell ${S-/usr/dict/hstop} $T |\ /usr/lib/spell ${D-/usr/dict/hlista} $V $B |\ sort -u +0f +0 - $T |\ tee -a $H who am i >>$H 2>/dev/null case $V in /dev/null) exit esaccmd/spell/spellin.c 644 0 33 1513 2111463506 7525 #include "spell.h" /* add entries to hash table for use by spell preexisting hash table is first argument words to be added are standard input if no hash table is given, create one from scratch */ main(argc,argv) char **argv; { register i, j; long h; register long *lp; char word[NW]; register char *wp; if(!prime(argc,argv)) { fprintf(stderr, "spellin: cannot initialize hash table\n"); exit(1); } while (fgets(word, sizeof(word), stdin)) { for (i=0; i1 && argv[1][0]=='-' && argv[1][1]=='d') { dflag = 1; argc--; argv++; } if(argc<=1) { fprintf(stderr,"spellout: arg count\n"); exit(1); } if(!prime(argc,argv)) { fprintf(stderr, "spellout: cannot initialize hash table\n"); exit(1); } while (fgets(word, sizeof(word), stdin)) { indict = 1; for (i=0; i long linect, wordct, charct, pagect; long tlinect, twordct, tcharct, tpagect; int baud=300; /* baud rate */ int cps=30; /* # of chars per second */ int lpp=66; /* # of lines per page */ char *wd = "lwc"; int verbose; int uucp; main(argc, argv) char **argv; { int i, token; register FILE *fp; register int c; char *p; while (argc > 1 && *argv[1] == '-') { switch (argv[1][1]) { case 'l': case 'w': case 'c': case 'p': case 't': wd = argv[1]+1; break; case 's': lpp = atoi(argv[1]+2); if (lpp <= 0) goto usage; break; case 'v': verbose++; wd = "lwcpt"; break; case 'u': uucp++; break; case 'b': baud = atoi(argv[1]+2); if (baud == 110) cps = 10; else cps = baud / 10; if (cps <= 0) goto usage; break; default: usage: fprintf(stderr, "Usage: wc [-lwcpt] [-v] [-u] [-spagesize] [-bbaudrate]\n"); exit(1); } argc--; argv++; } if (uucp) cps = cps * 9 / 10; /* 27 cps at 300 baud */ if (verbose) { for (p=wd; *p; p++) switch(*p) { case 'l': printf("lines\t"); break; case 'w': printf("words\t"); break; case 'c': printf("chars\t"); break; case 'p': printf("pages\t"); break; case 't': printf("time@%d\t",baud); break; } printf("\n"); } i = 1; fp = stdin; do { if(argc>1 && (fp=fopen(argv[i], "r")) == NULL) { fprintf(stderr, "wc: can't open %s\n", argv[i]); continue; } linect = 0; wordct = 0; charct = 0; pagect = 0; token = 0; for(;;) { c = getc(fp); if (c == EOF) break; charct++; if(' '1) { printf(" %s\n", argv[i]); } else printf("\n"); fclose(fp); tlinect += linect; twordct += wordct; tcharct += charct; tpagect += pagect; } while(++i 2) { wcp(wd, tcharct, twordct, tlinect, tpagect); printf(" total\n"); } exit(0); } wcp(wd, charct, wordct, linect, pagect) register char *wd; long charct; long wordct; long linect, pagect; { while (*wd) switch (*wd++) { case 'l': ipr(linect); break; case 'w': ipr(wordct); break; case 'c': ipr(charct); break; case 'p': ipr(pagect); break; case 't': prttime(charct/cps); break; } } ipr(num) long num; { if (verbose) printf("%ld\t", num); else printf("%7ld", num); } prttime(secs) long secs; { int hrs,mins; float t; long osecs; char *units; osecs = secs; hrs = secs / (60*60); secs = secs % (60*60); mins = secs / 60; secs = secs % 60; t = osecs; if (hrs) { t /= (60*60); units = "hr"; } else if (mins) { t /= 60; units = "mi"; } else { units = "se"; } printf("%4.1f %2s\t", t, units); } ipr(pagectcmd/struct/ 775 0 33 0 2552564765 6057 ((cmd/struct/0.alloc.c 644 0 33 4570 2111463510 7515 #include #include "def.h" int routbeg; extern int debug; struct coreblk {struct coreblk *nxtblk; int blksize; int nxtfree; int *blk; }; long space; challoc(n) int n; { int i; i = malloc(n); if(i) { space += n; return(i); } fprintf(stderr,"alloc out of space\n"); fprintf(stderr,"total space alloc'ed = %D\n",space); fprintf(stderr,"%d more bytes requested\n",n); exit(1); } chfree(p,n) int *p,n; { ASSERT(p,chfree); space -= n; free(p); } struct coreblk *tcore, *gcore; int tblksize=12, gblksize=300; balloc(n,p,size) /* allocate n bytes from coreblk *p */ int n,size; /* use specifies where called */ struct coreblk **p; { int i; struct coreblk *q; n = (n+sizeof(i)-1)/sizeof(i); /* convert bytes to wds to ensure ints always at wd boundaries */ for (q = *p; ; q = q->nxtblk) { if (!q) { q = morespace(n,p,size); break; } if (q-> blksize - q->nxtfree >= n) break; } i = q->nxtfree; q ->nxtfree += n; return( &(q->blk)[i]); } talloc(n) /* allocate from line-by-line storage area */ int n; {return(balloc(n,&tcore,tblksize)); } galloc(n) /* allocate from graph storage area */ int n; { return(balloc(n,&gcore,gblksize)); } reuse(p) /* set nxtfree so coreblk can be reused */ struct coreblk *p; { for (; p; p=p->nxtblk) p->nxtfree = 0; } bfree(p) /* free coreblk p */ struct coreblk *p; { if (!p) return; bfree(p->nxtblk); p->nxtblk = 0; free(p); } morespace(n,p,size) /* get at least n more wds for coreblk *p */ int n,size; struct coreblk **p; {struct coreblk *q; int t,i; t = nblk))+sizeof(*q)); if(!q){ error(": alloc out of space","",""); fprintf(stderr,"space = %D\n",space); fprintf(stderr,"%d more bytes requested\n",n); exit(1); } space += i; q->nxtblk = *p; *p = q; q -> blksize = t; q-> nxtfree = 0; q->blk = q + 1; return(q); } freegraf() { bfree(gcore); gcore = 0; } error(mess1, mess2, mess3) char *mess1, *mess2, *mess3; { static lastbeg; if (lastbeg != routbeg) { fprintf(stderr,"routine beginning on line %d:\n",routbeg); lastbeg = routbeg; } fprintf(stderr,"error %s %s %s\n",mess1, mess2, mess3); } faterr(mess1, mess2, mess3) char *mess1, *mess2, *mess3; { error(mess1, mess2, mess3); exit(1); } strerr(mess1, mess2, mess3) char *mess1, *mess2, *mess3; { error("struct error: ",mess1, mess2); } eegraf() { bfree(gcore); gcore = 0; } error(mess1, mess2, mess3) char *mess1, *mess2, *mess3; { static lastbeg; if (lacmd/struct/0.args.c 644 0 33 4017 2111463510 7353 #include # #include "def.h" int errflag; FILE *infd; int intcase=1, arbcase=0; int exitsize=0; /* max number of nodes to be left in loop without iterating */ int maxnode=400; /* max number of nodes */ int maxhash=347; /* prime number = size of hash table */ int progress=0; /* if not 0, print line number every n lines, n = progress */ int labinit=10; /* labels generated starting with labinit */ int labinc=10; /* labels increase by labinc */ int inputform=0; /* = 0 if freeform input, 1 if standard form input */ int debug=0; int levbrk=1; /* true implies multilevel breaks; false implies single-level breaks only */ int levnxt=1; /* true implies multilevel nexts; false implies single-level nexts only */ int maxprogsw=12; /* number of program switches which can be set */ char *progsw[] = {"i", "a", "e", "m", "h", "p", "t", "c", "s", "d", "b", "n" }; int *swval[] = {&intcase, &arbcase, &exitsize, &maxnode, &maxhash, &progress, &labinit, &labinc, &inputform, &debug, &levbrk, &levnxt }; char *getargs(argc, argv) int argc; char *argv[]; { int n, infile; infile = 0; for (n = 1; n < argc; ++n) { if (argv[n][0] == '-') setsw(&argv[n][1]); else { if (infile != 0) error("multiple input files - using first one: ", argv[infile],""); else infile = n; } } if (errflag) exit(1); if (!infile) faterr("no input file","",""); infd = fopen(argv[infile],"r"); if (infd == NULL) faterr("can't open input file:",argv[infile],""); return; } setsw(str) char *str; { int i, val, swnum; #define maxtemp 15 char temp[maxtemp]; for (i = 0; 'a' <= str[i] && str[i] <= 'z'; ++i) { if (i >= maxtemp) { error("invalid switch:",str,""); errflag = 1; } temp[i] = str[i]; } temp[i] = '\0'; swnum = find(temp,progsw,maxprogsw); if (swnum == -1) { error("invalid switch:", str,""); errflag = 1; return; } if (str[i] == '\0') *(swval[swnum]) = !*(swval[swnum]); else { sscanf(&str[i],"%d",&val); *(swval[swnum]) = val; } } str) char *str; { int i, val, swnum; #define maxtemp 15 char temp[maxtemp]; for (i = 0; 'a' <= str[i] && str[i] <= 'z'; ++i) { if (i >= maxtemp) { error("invalid switch:",str,""); errflag = 1; } temp[i] = str[i]; } temp[i] = '\0'; swnum = find(temp,progsw,maxprogsw); if (swnum == -1) { error("invalid switch:", str,""); errflag = 1; return; } if (str[i] == '\0') *(swval[swnum]) = !*(swval[swnum]); else { sscanf(&str[i],"%d",&val); *(swval[swnum])cmd/struct/Makefile 644 0 33 3040 2111463512 7552 CFLAGS=-O YFLAGS=-d 0FILES.c = 0.alloc.c 0.args.c 0.def.c 0.extr.c 0.graph.c 0.list.c 0.parts.c 0.string.c 0FILES.o = 0.alloc.o 0.args.o 0.def.o 0.extr.o 0.graph.o 0.list.o 0.parts.o 0.string.o 1FILES.c = 1.finish.c 1.form.c 1.fort.c 1.hash.c 1.init.c 1.line.c 1.main.c 1.node.c 1.recog.c 1.tables.c 1FILES.o = 1.finish.o 1.form.o 1.fort.o 1.hash.o 1.init.o 1.line.o 1.main.o 1.node.o 1.recog.o 1.tables.o 2FILES.c = 2.dfs.c 2.dom.c 2.head.c 2.inarc.c 2.main.c 2.tree.c 2FILES.o = 2.dfs.o 2.dom.o 2.head.o 2.inarc.o 2.main.o 2.tree.o 3FILES.c = 3.branch.c 3.flow.c 3.loop.c 3.main.c 3.reach.c 3.then.c 3FILES.o = 3.branch.o 3.flow.o 3.loop.o 3.main.o 3.reach.o 3.then.o 4FILES.c = 4.brace.c 4.form.c 4.main.c 4.out.c 4FILES.o = 4.brace.o 4.form.o 4.main.o 4.out.o all: structure beautify install: structure beautify install -s structure $(DESTDIR)/usr/lib/struct install -s beautify $(DESTDIR)/usr/lib/struct install -c struct $(DESTDIR)/usr/bin clean: rm -f *.o y.tab.h beauty.c structure: main.o $(0FILES.o) $(1FILES.o) $(2FILES.o) $(3FILES.o) $(4FILES.o) cc -o structure main.o 0.*.o 1.*.o 2.*.o 3.*.o 4.*.o beautify: beauty.o tree.o lextab.o bdef.o cc -O beauty.o tree.o lextab.o bdef.o -o beautify -lln lint: lint $(0FILES.c) $(1FILES.c) $(2FILES.c) $(3FILES.c) $(4FILES.c) main.c main.o $(0FILES.o) $(1FILES.o) $(2FILES.o) $(3FILES.o) $(4FILES.o): def.h $(1FILES.o): 1.defs.h 1.incl.h $(2FILES.o): 2.def.h $(3FILES.o): 3.def.h $(4FILES.o): 4.def.h lextab.o tree.o: y.tab.h y.tab.h: beauty.y lextab.o tree.o beauty.y: b.h y.tab.h: beauty.c $(4FILES.o) cc -o structure main.o 0.*.o 1.*.o 2.*.o 3.*.o 4.*.o beautify: beauty.o tree.o lextab.o bdef.o cc -O beauty.o tree.o lextab.o bdef.o -o beautify -lln lint: lint $(0FILES.c) $(1FILES.c) $(2FILES.c) $(3FILES.c) $(4FILES.c) main.c main.o $(0FILES.o) $(1FILES.o) $(2FILES.o) $(3FILES.o) $(4FILES.o): def.h $(1FILES.o): 1.defs.h 1.incl.h $(2FILES.o): 2.def.h $(3FILES.o): 3.def.h $(4FILES.o): 4.def.h lextab.o tree.o: y.tab.h y.tab.h: beauty.y lextab.o tree.o bcmd/struct/0.def.c 644 0 33 247 2111463510 7136 #include #include "def.h" int routnum; FILE *debfd; LOGICAL routerr; int nodenum, accessnum; int **graph; int progtype; VERT stopvert, retvert; VERT START; extab.o bdef.o -o beautify -lln lint: lint $(0FILES.c) $(1FILES.c) $(2FILES.c) $(3FILES.c) $(4FILES.c) main.c main.o $(0FILES.o) $(1FILES.o) $(2FILES.o) $(3FILES.o) $(4FILES.o): def.h $(1FILES.o): 1.defs.h 1.incl.h $(2FILES.o): 2.def.h $(3FILES.o): /,5< /,"cmd/struct/0.extr.c 644 0 33 1515 2111463510 7401 ((#include #include "def.h" struct lablist {long labelt; struct lablist *nxtlab; }; struct lablist *endlab, *errlab, *reflab, *linelabs, *newlab; int nameline; /* line number of function/subroutine st., if any */ int stflag; /* determines whether at beginning or middle of block of straight line code */ int nlabs, lswnum, swptr, flag, counter, p1, p3, begline, endline, r1,r2, endcom; long begchar, endchar, comchar; char *pred, *inc, *prerw, *postrw, *exp, *stcode; #define maxdo 20 /* max nesting of do loops */ long dostack[maxdo]; /* labels of do nodes */ int doloc[maxdo]; /* loc of do node */ int doptr; struct list *FMTLST; /* list of FMTVX's generated */ struct list *ENTLST; /* list of STLNVX nodes corresponding to entry statements */ long rtnbeg; /* number of chars up to beginning of current routine */ lswnum, swptr, flag, counter, p1, p3, begline, endline, r1,r2, endcom; long begchar, endchar, comchar; char *pred, *inc, *prerw, *postrw, *exp, *stcode; #define maxdo 20 /* mcmd/struct/0.graph.c 644 0 33 2000 2111463510 7506 #include #include "def.h" #define TABOVER(n) tabover(n,stderr) prgraph() { VERT v; int i; if (progress) fprintf(stderr,"prgraph():\n"); for (v = 0; v < nodenum; ++v) { fprintf(stderr,"%d %s:",v, typename[NTYPE(v)]); for (i = 0; i < ARCNUM(v); ++i) { printf("%d ",ARC(v,i)); ASSERT(UNDEFINED <= ARC(v,i) && ARC(v,i) < nodenum, prgraph); } printf("\n"); } printf("\n\n"); } prtree() { prtr(START,1); } prtr(v,tab) /* print tree in form of program indenting by tab */ VERT v; int tab; { int i; TABOVER(tab); fprintf(stderr,"%d %s:",v,typename[NTYPE(v)]); for (i = 0; i < ARCNUM(v); ++i) fprintf(stderr," %d",ARC(v,i)); printf("\n"); for (i = 0; i < CHILDNUM(v); ++i) { TABOVER(tab+1); fprintf(stderr,"{\n"); if (DEFINED(LCHILD(v,i))) prtr(LCHILD(v,i),tab+1); TABOVER(tab+1); fprintf(stderr,"}\n"); } if (DEFINED(RSIB(v))) prtr(RSIB(v),tab); } tabover(n,fd) /* tab n times */ int n; FILE *fd; { int i; for (i = 0; i < n; ++i) putc('\t',fd); } cmd/struct/0.list.c 644 0 33 2061 2111463510 7367 #include #include "def.h" struct list *consls(v,ls) /* make list */ VERT v; struct list *ls; { struct list *temp; temp = challoc(sizeof(*temp)); temp->elt = v; temp->nxtlist = ls; return(temp); } struct list *append(v,ls) /* return ls . v */ VERT v; struct list *ls; { struct list *temp; if (!ls) return(consls(v,0)); for (temp = ls; temp -> nxtlist; temp = temp->nxtlist) ; temp->nxtlist = consls(v,0); return(ls); } freelst(ls) struct list *ls; { if (!ls) return; if (ls->nxtlist) freelst(ls->nxtlist); chfree(ls,sizeof(*ls)); } oneelt(ls) /* return w if w is only elt of ls, UNDEFINED otherwise */ struct list *ls; { if (!ls) return(UNDEFINED); if (ls->nxtlist) return(UNDEFINED); return(ls->elt); } lslen(ls) /* return number of elements in list ls */ struct list *ls; { int count; struct list *lp; count = 0; for (lp = ls; lp; lp = lp->nxtlist) ++count; return(count); } prlst(ls) struct list *ls; { struct list *lp; for (lp = ls; lp; lp = lp->nxtlist) printf("%d,",lp->elt); fprintf(stderr,"\n"); } ls)); } oneelt(ls) /* return w if w is only elt of ls, UNDEFINED otherwise */ struct list *ls; { if (!ls) return(UNDEFINED); if (ls->nxtlist) return(UNDEFINED); return(ls->elt); } lslen(ls) /* return number of elements in list ls */ struct list *ls; { int count; struct list *lp; count = 0; for (lp = ls; lp; lp = lp->nxtlist) ++count; return(count); } prlst(ls) struct list *ls; { struct list *lp; for (lp = ls; lp; lp = lp->nxtlist) cmd/struct/0.parts.c 644 0 33 4633 2111463510 7554 #include #include "def.h" char *typename[TYPENUM] = {"STLNVX", "IFVX", "DOVX", "IOVX", "FMTVX", "COMPVX", "ASVX", "ASGOVX", "LOOPVX", "WHIVX", "UNTVX", "ITERVX", "THENVX", "STOPVX", "RETVX", "DUMVX", "GOVX", "BRKVX", "NXTVX", "SWCHVX", "ACASVX", "ICASVX" }; int hascom[TYPENUM] = {2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2, 2, 0 }; int nonarcs[TYPENUM] = {FIXED+3, FIXED+4, FIXED+2, FIXED+3, FIXED+2, FIXED+2, FIXED+2, FIXED+2, FIXED+1, FIXED+1, FIXED+1, FIXED+4, FIXED+3, FIXED, FIXED, FIXED+2, FIXED+1, FIXED + 1, FIXED + 1, FIXED+3, FIXED+4, FIXED+2 }; int childper[TYPENUM] = {0, 2, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 2, 1 }; int arcsper[TYPENUM] = {1, 2, 2, 3, 0, -(FIXED+1), 1, -(FIXED+1), 1, 1, 1, 1, 2, 0, 0, -FIXED, 1, 1, 1, -(FIXED+1), 2, 1 }; VERT *arc(v,i) VERT v; int i; { ASSERT(DEFINED(v),arc); ASSERT(0 <= i && i < ARCNUM(v), arc); return(&graph[v][nonarcs[NTYPE(v)] + i ]); } VERT *lchild(v,i) VERT v; int i; { ASSERT(DEFINED(v),lchild); ASSERT(0 <= i && i < childper[NTYPE(v)],lchild); return(&graph[v][nonarcs[NTYPE(v)]-i-1]); } int *vxpart(v,type,j) VERT v; int type,j; { ASSERT((NTYPE(v) == type) && (0 <= j) && (j < nonarcs[type] - FIXED), vxpart); return(&graph[v][FIXED+j]); } int *expres(v) VERT v; { int ty; ty = NTYPE(v); ASSERT(ty == COMPVX || ty == ASGOVX || ty == ASVX || ty == SWCHVX || ty == ICASVX,expres); return(&graph[v][FIXED]); } int *negpart(v) VERT v; { ASSERT(NTYPE(v) == IFVX || NTYPE(v) == ACASVX,negpart); return(&graph[v][FIXED+1]); } int *predic(v) VERT v; { ASSERT(NTYPE(v) == IFVX || NTYPE(v) == ACASVX, predic); return(&graph[v][FIXED]); } int *level(v) VERT v; { ASSERT(NTYPE(v) == GOVX || NTYPE(v) == BRKVX || NTYPE(v) == NXTVX, level); return(&graph[v][FIXED]); } int *stlfmt(v,n) VERT v; int n; { ASSERT(NTYPE(v) == STLNVX || NTYPE(v) == FMTVX,stlfmt); return(&graph[v][FIXED + n]); } create(type,arcnum) int type, arcnum; { int i, *temp, wds; if (nodenum >= maxnode) { maxnode += 100; temp=realloc(graph,maxnode*sizeof(*graph)); free(graph); graph=temp; } wds = nonarcs[type] + arcnum; graph[nodenum] = galloc(sizeof(*graph) * wds); for (i = 0; i < wds; i++) graph[nodenum][i] = 0; NTYPE(nodenum) = type; if (arcsper[type] < 0) ARCNUM(nodenum) = arcnum; return(nodenum++); } ASSERT(NTYPE(v) == STLNVX || NTYPE(v) == FMTVX,stlfmt); return(&graph[v][FIXED + n]); } create(tcmd/struct/0.string.c 644 0 33 3245 2111463510 7727 #include #include "def.h" #include "1.defs.h" str_copy(s,ptr,length) /* copy s at ptr, return length of s */ char *s, *ptr; int length; {int i; for (i = 0; i < length; i++) { ptr[i] = s[i]; if (ptr[i] == '\0') return(i + 1); } faterr("string too long to be copied at given address:\n",s,""); } find(s,ar,size) char *s,*ar[]; int size; { int i; for (i=0; i < size; i++) {if (str_eq(s, ar[i])) return(i);} return(-1); } str_eq(s,t) char s[],t[]; {int j; for (j = 0; s[j] == t[j]; j++) {if (s[j] == '\0') return(1);} return(0); } classmatch(c,i) char c; int i; {switch(i) {case _digit: if ('0' <= c && c <= '9') return(1); else return(0); case _letter: if ( ('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z')) return(1); else return(0); case _diglet: return(classmatch(c,_digit)||classmatch(c,_letter) ); case _arith: if (050 <= c && c<= 057) return(1); else return(0); case _nl: return(c=='\n'); case _other: return(1); } } copychars(cbeg,target,n) /* copy n chars from cbeg to target */ char *cbeg, *target; int n; { int i; for (i = 0; i < n; i++) target[i] = cbeg[i]; } copycs(cbeg,target,n) /* copy n chars from cbeg to target, add '\0' */ char *cbeg, *target; int n; { copychars(cbeg,target,n); target[n] = '\0'; } slength(s) /* return number of chars in s, not counting '\0' */ char *s; { int i; if (!s) return(-1); for (i = 0; s[i] != '\0'; i++); return(i); } concat(x,y) /* allocate space, return xy */ char *x, *y; { char *temp; int i,j; i = slength(x); j = slength(y); temp = galloc(i + j + 1); sprintf(temp,"%s",x); sprintf(&temp[i],"%s",y); return(temp); } rget,n) /* copy n chars from cbeg to target, add '\0' */ char *cbeg, *target; int n; { copychars(cbeg,target,n); target[n] = '\0'; } slength(s) /* return number of chars in s, not counting '\0' */ char *s; { int i; if (!s) return(-1); for (i = 0; s[i] != '\0'; i++); return(i); } concat(x,y) /* allocate space, return xy */ cha((cmd/struct/1.defs.h 644 0 33 4761 2111463510 7354 #define snum 145 #define _s0 0 #define _s1 1 #define _s2 2 #define _s3 3 #define _s4 4 #define _start 5 #define _g 6 #define _go 7 #define _got 8 #define _goto 9 #define _ugo 10 #define _ago 11 #define _agoc 12 #define _agol 13 #define _agor 14 #define _cgo 15 #define _cgold 16 #define _cgor 17 #define _cgoc 18 #define _i 19 #define _if 20 #define _if1 21 #define _if2 22 #define _pard 23 #define _arif 24 #define _c 25 #define _co 26 #define _con 27 #define _cont 28 #define _conti 29 #define _contin 30 #define _con_u 31 #define _con_ue 32 #define _d 33 #define _do 34 #define _dol 35 #define _dov 36 #define _doveq 37 #define _a 38 #define _as 39 #define _ass 40 #define _assi 41 #define _assig 42 #define _assign 43 #define _assd 44 #define _ast 45 #define _asto 46 #define _fr 47 #define _fre 48 #define _frea 49 #define _1func 50 #define _1f 51 #define _fu 52 #define _fun 53 #define _func 54 #define _funct 55 #define _fncti 56 #define _fncto 57 #define _fin 58 #define _fint 59 #define _finte 60 #define _fintg 61 #define _finge 62 #define _fc 63 #define _fco 64 #define _fcom 65 #define _fcomp 66 #define _fcmpl 67 #define _fcple 68 #define _fdou 69 #define _fdoub 70 #define _fdobl 71 #define _fdble 72 #define _fp 73 #define _fpr 74 #define _fpre 75 #define _fprec 76 #define _fprci 77 #define _fpris 78 #define _fprsi 79 #define _fprco 80 #define _fl 81 #define _flo 82 #define _flog 83 #define _flogi 84 #define _flgic 85 #define _flgca 86 #define _s 87 #define _st 88 #define _sto 89 #define _su 90 #define _sub 91 #define _subr 92 #define _subro 93 #define _subrt 94 #define _subri 95 #define _subrn 96 #define _r 97 #define _re 98 #define _ret 99 #define _retu 100 #define _retr 101 #define _e 102 #define _en 103 #define _end 104 #define _ent 105 #define _entr 106 #define _fo 107 #define _for 108 #define _form 109 #define _fma 110 #define _fmt 111 #define _w 112 #define _wr 113 #define _wri 114 #define _writ 115 #define _write 116 #define _read 117 #define _rdig 118 #define _rwp 119 #define _rwlab 120 #define _rwe 121 #define _rwen 122 #define _rwend 123 #define _endeq 124 #define _rwer 125 #define _rwerr 126 #define _p 127 #define _pr 128 #define _pri 129 #define _prin 130 #define _pu 131 #define _pun 132 #define _punc 133 #define _bd 134 #define _bl 135 #define _blo 136 #define _blc 137 #define _blk 138 #define _bld 139 #define _blda 140 #define _bldt 141 #define ABORT 142 #define endrt 143 #define nulls 144 #define _other 1 #define _digit 2 #define _letter 3 #define _diglet 4 #define _arith 5 #define _nl 6 e _rwe 121 #defcmd/struct/1.finish.c 644 0 33 1277 2111463510 7705 #include #include "def.h" #include "1.incl.h" fingraph() { /* if any entry statements, add a DUMVX with arcs to all entry statements */ if (ENTLST) { ARC(START,0) = addum(ARC(START,0),ENTLST); freelst(ENTLST); } /* if any FMTVX, add a DUMVX with arcs to all FMTVX's */ if (FMTLST) { ARC(START,0) = addum(ARC(START,0),FMTLST); freelst(FMTLST); } } addum(v,lst) VERT v; struct list *lst; { VERT new; int count,i; struct list *ls; count = lslen(lst); /* length of lst */ new = create(DUMVX,1+count); ARC(new,0) = v; for (i = count, ls = lst; i >= 1; --i, ls = ls->nxtlist) { ASSERT(ls,addum); ARC(new,i) = ls->elt; } ASSERT(!ls, addum); return(new); } C(START,0),ENTLST); freelst(ENTLST); } /* if any FMTVX, add a DUMVX with arcs to all FMTVX's */ if (FMTLST) { ARC(START,0) = addum(ARC(START,0),FMTLST); freelst(FMTLST); } } addum(v,lst) VERT v; struct list *lst; { VERT new; int count,i; struct list *ls; count = lslen(lst); /* length of lst */ newcmd/struct/1.form.c 644 0 33 6315 2111463510 7366 #include #include "1.defs.h" #include "def.h" extern int linechar, errflag, debug; extern int (*input)(), (*unput)(); uptolow(c) /*translates upper to lower case */ int c; { if ('A' <= c && c <= 'Z') return(c+'a'-'A'); else return(c); } rdfree(func) int (*func)(); { int c; while ( (c = (*input)()) != '\n') { (*func)(c); } } rdstand(func) int (*func)(); { int c; while ( (c=(*input)()) != '\n') { (*func)(c); } } labfree(func) /* labels in freeform input */ int (*func)(); { int c; int temp[6]; int j; for (j = 0; j < 5; ++j) { while ( (c = (*input)()) == ' ' || c == '\t' ); if (c == '\n') { if (j != 0) { temp[j] = '\0'; error("label without code - ignored:","",""); } } if (c < '0' || c > '9') { (*unput)(c); break; } else { temp[j] = c; (*func)(c); } } for ( ; j < 5; ++j) (*func)(' '); } labstand(func) /* labels in standard form input */ int (*func)(); { int c; int j; for (j = 0; j < 5; ++j) { c = (*input)(); if (c == '\n') { error("line shorter than 5 characters","",""); errflag = 1; (*unput)('\n'); } if (c == '\t' || c == '\n') { for ( ;j<5; ++j) (*func)(' '); return; } (*func)(c); } (*input)(); /* throw away continuation char */ } contfree() /* identify continuation lines in free-form input */ { return(nonblchar(_diglet,0)); /* any non-alpha non-digit */ } nonblchar(class,yesno) int class,yesno; { #define CARDSIZE 121 int temp[CARDSIZE]; int j; for (j=0; (temp[j]=(*input)()) == ' ' || temp[j] == '\t'; ++j) if (j>=CARDSIZE-1) { temp[CARDSIZE-1] = '\0'; error ("line unexpectedly long","",""); break; } if (temp[j]!=EOF && classmatch(temp[j],class)==yesno) return(1); else { for ( ; j >= 0; --j) (*unput)(temp[j]); return(0); } } contstand() /* continuation lines in standard form input */ { int temp[6]; int i; for (i = 0; i < 6; ++i) { temp[i] = (*input)(); if (temp[i] == '\t' || temp[i] == '\n' || temp[i] == '\0' || temp[i] == EOF) { for ( ;i >= 0; --i) (*unput)(temp[i]); return(0); } } if (temp[5] != '0' && temp[5] != ' ') return(1); else { for ( i = 5 ; i >= 0; --i) (*unput)(temp[i]); return(0); } } comstand(posafter) /* standard form comments */ int posafter; { int c; c = (*input)(); if (!posafter) (*unput)(c); if (c == 'c' || c == '*' || c== '#') return(1); else return(0); } comfree(posafter) int posafter; { return(comstand(posafter)); } int (*rline[])() = {rdfree,rdstand}; int (*comment[])() = {comfree,comstand}; int (*getlabel[])() = {labfree, labstand}; int (*chkcont[])() = {contfree,contstand}; blankline() { if ( nonblchar(_nl,1) ) /* first non-blank is nl */ { (*unput) ('\n'); return(1); } else return(0); } #define maxunbp 80 char unbuf[maxunbp+1]; int unbp; empseek(linebeg) int linebeg; { unbp = 0; if (fseek(infd,(long)(linebeg+rtnbeg),0) == -1) faterr("in disk seek","",""); } inchar() { if (unbp > 0) return( unbuf[--unbp] ); else { return( uptolow(getc(infd)) ); } } unchar(c) int c; { if (unbp >= maxunbp) faterr("dec.rat: unbuf size exceeded","",""); if(c!=EOF)unbuf[unbp++] = c; } r(_nl,1) ) /* first non-blank is nl */ { (*unput) ('\n'); return(1); } else return(0); } #define maxunbp 80 char unbuf[maxunbp+1]; int unbp; empseek(linebeg) int linebeg; { unbp = 0; if (fseek(infd,(long)(linebeg+rtnbeg),0) == -1) faterr("in disk seek","",""); } inchar() { if (unbp > cmd/struct/1.fort.c 644 0 33 11445 2111463510 7415 #include #include "1.incl.h" #include "1.defs.h" #include "def.h" act(k,c,bufptr) int k,bufptr; char c; { long ftemp; struct lablist *makelab(); switch(k) /*handle labels */ {case 1: if (c != ' ') { ftemp = c - '0'; newlab->labelt = 10L * newlab->labelt + ftemp; if (newlab->labelt > 99999L) { error("in syntax:\n","",""); fprintf(stderr,"line %d: label beginning %D too long\n%s\n", begline,newlab->labelt,buffer); fprintf(stderr,"treating line as straight line code\n"); return(ABORT); } } break; case 3: nlabs++; newlab = newlab->nxtlab = makelab(0L); break; /* handle labsw- switches and labels */ /* handle if statements */ case 30: counter++; break; case 31: counter--; if (counter) return(_if1); else { pred = remtilda(stralloc(&buffer[p1],bufptr - p1)); p3 = bufptr + 1; /* p3 pts. to 1st symbol after ) */ flag = 1; return(_if2); } case 45: /* set p1 to pt.to 1st symbol of p((red */ p1 = bufptr + 1; act(30,c,bufptr); break; /* handle do loops */ case 61: p1 = bufptr; break; /* p1 pts. to 1st symbol of increment string */ case 62: counter ++; break; case 63: counter --; break; case 64: if (counter != 0) break; act(162,c,bufptr); return(ABORT); case 70: if (counter) return(_rwp); r1 = bufptr; return(_rwlab); case 72: exp = remtilda( stralloc(&buffer[r1+1],bufptr - r1 - 1)); break; case 73: endlab = newlab; break; case 74: errlab = newlab; break; case 75: reflab = newlab; act(3,c,bufptr); break; case 76: r1 = bufptr; break; case 77: if (!counter) { act(111,c,bufptr); return(ABORT); } counter--; break; /* generate nodes of all types */ case 111: /* st. line code */ stcode = remtilda(stralloc(&buffer[p3],endbuf - p3)); recognize(STLNVX,flag); return(ABORT); case 122: /* uncond. goto */ recognize(ungo,flag); break; case 123: /* assigned goto */ act(72,c,bufptr); faterr("in parsing:\n","assigned goto must have list of labels",""); case 124: /* ass. goto, labels */ recognize(ASGOVX, flag); break; case 125: /* computed goto*/ exp = remtilda( stralloc(&buffer[r1+1],bufptr - r1 - 1)); recognize(COMPVX, flag); return(ABORT); case 133: /* if() = is a simple statement, so reset flag to 0 */ flag = 0; act(111,c,bufptr); return(ABORT); case 141: /* arith. if */ recognize(arithif, 0); break; case 150: /* label assignment */ exp = remtilda( stralloc(&buffer[r1+1],bufptr - r1 - 1)); recognize(ASVX, flag); break; case 162: /* do node */ inc = remtilda(stralloc(&buffer[p1],endbuf - p1)); recognize(DOVX, 0); break; case 180: /* continue statement */ recognize(contst, 0); break; case 200: /* function or subroutine statement */ progtype = sub; nameline = begline; recognize(STLNVX,0); break; case 210: /* block data statement */ progtype = blockdata; act(111,c,bufptr); return(ABORT); case 300: /* return statement */ recognize(RETVX,flag); break; case 350: /* stop statement */ recognize(STOPVX, flag); break; case 400: /* end statement */ if (progtype == sub) act(300, c, bufptr); else act(350, c, bufptr); return(endrt); case 500: prerw = remtilda(stralloc(&buffer[p3],r1 - p3 + 1)); postrw = remtilda(stralloc(&buffer[r2],endbuf - r2)); if (reflab || endlab || errlab) recognize(IOVX,flag); else recognize(STLNVX,flag); return(ABORT); case 510: r2 = bufptr; act(3,c,bufptr); act(500,c,bufptr); return(ABORT); case 520: r2 = bufptr; reflab = newlab; act(3,c,bufptr); act(500,c,bufptr); return(ABORT); case 600: recognize(FMTVX,0); return(ABORT); case 700: stcode = remtilda(stralloc(&buffer[p3],endbuf - p3)); recognize(entry,0); return(ABORT); /* error */ case 999: printf("error: symbol '%c' should not occur as %d'th symbol of: \n%s\n", c,bufptr, buffer); return(ABORT); } return(nulls); } struct lablist *makelab(x) long x; { struct lablist *p; p = challoc (sizeof(*p)); p->labelt = x; p->nxtlab = 0; return(p); } long label(i) int i; { struct lablist *j; for (j = linelabs; i > 0; i--) { if (j == 0) return(0L); j = j->nxtlab; } if (j) return(j->labelt); else return(0L); } freelabs() { struct lablist *j,*k; j = linelabs; while(j != 0) { k = j->nxtlab; chfree(j,sizeof(*j)); j = k; } } stralloc(ad,n) /* allocate space, copy n chars from address ad, add '0' */ int n; char *ad; { char *cp; cp = galloc(n+1); copycs(ad,cp,n); return(cp); } remtilda(s) /* change ~ to blank */ char *s; { int i; for (i = 0; s[i] != '\0'; i++) if (s[i] == '~') s[i] = ' '; return(s); } rn(0L); j = j->nxtlab; } if (j) return(j->labelt); else return(0L); } freelabs() { struct lablist *j,*k; j = linelabs; while(j != 0) { k = j->nxtlab; chfree(j,sizeof(*j)); j = k; } } strallcmd/struct/1.hash.c 644 0 33 11151 2111463510 7360 #include #include "1.incl.h" #include "1.defs.h" #include"def.h" extern int match[], symclass[], action[], newstate[]; extern char symbol[]; long *hashtab; int *value, *chain; extern FILE *infd; parse() {int i,j,found,current, someread; char c; hash_init(); routinit(); line_init(); someread = 0; /* indicates haven't read part of a routine */ empseek(0); endbuf = getline(&endline, &endchar, &endcom, & comchar); if (progress && endbuf != -1) fprintf(stderr,"parsing\n"); while(endbuf != -1) /* getline returns -1 when no more input */ { someread = 1; if (progress > 0) { for (i = begline; i <= endline; i++) if (!(i % progress)) fprintf(stderr,"parsing line %d\n",i); } current = 0; for (i = 0; i < endbuf; i++) { c = buffer[i]; if(c != '~') { found = 0; if ( (current < 0 || current >= snum) && current != ABORT) { strerr("in parsing:","",""); fprintf(stderr,"line %d of file, parser in invalid state", begline,current); fprintf(stderr,"treating it as straight line code\n"); current = ABORT; } else for (j = match[current]; j < match[current + 1]; j++) { if ((symclass[j] == 0 && c == symbol[j]) || (symclass[j] != 0 && classmatch(c,symclass[j]) )) {found = 1; break; } } if (!found) { error("in syntax:","",""); fprintf(stderr,"between lines %d and %d of file\n",begline, endline); if (debug) fprintf(stderr,"symbol '%c' does not match entries for state %d\n",c,current); fprintf(stderr,"treating it as straight line code\n"); current = ABORT; } else if (!action[j]) current = newstate[j]; else { current = act(action[j],c,i); if (current == nulls) current = newstate[j]; } if (current == ABORT) break; if (current == endrt) { return(1); } } } line_init(); endbuf = getline(&endline, &endchar, &endcom,&comchar); } if (someread) return(1); else return(0); } hash_init() { int i; hashtab = challoc(sizeof(*hashtab) * maxhash); chain = challoc(sizeof(*chain) * maxhash); value = challoc(sizeof(*value) * maxhash); for (i = 0; i < maxhash; i++) { hashtab[i] = -1L; value[i] = -2; chain[i] = 0; } } hash_check() { int i; for (i = 0; i < maxhash; ++i) if (value[i] == -2 && hashtab[i] != -1L) { error("in syntax; label used but does not appear as statement label:","",""); fprintf(stderr,"%D\n",hashtab[i]); routerr = 1; } } hash_free() { chfree(hashtab,sizeof(*hashtab) * maxhash); hashtab = 0; chfree(chain,sizeof(*chain) * maxhash); chain = 0; chfree(value,sizeof(*value) * maxhash); value = 0; } hash(x) long x; { int quo, rem, hcount, temp; ASSERT(x >= 0L, hash); quo = x/maxhash; rem = x - (quo * maxhash); if (quo == 0) quo = 1; temp = rem; for (hcount=0; (hashtab[temp] != -1L) && (hashtab[temp] != x) && (hcount=maxhash) faterr("hash table overflow - too many labels","",""); hashtab[temp] = x; return(temp); } addref(x,ptr) /* put ptr in chain for x or assign value of x to *ptr */ long x; int *ptr; { int index; index = hash(x); if (value[index] == -1) { /* x already assigned value */ *ptr = chain[index]; return; } /* add ptr to chain */ if (chain[index] == 0) *ptr = 0; else *ptr = chain[index]; chain[index] = ptr; } fixvalue (x,ptr) long x; int ptr; { int *temp1, *temp2, index, temp0; index = hash(x); while (index != -2) { /* trace chain of linked labels */ if (value[index] == -1) { error("in syntax: ","",""); fprintf(stderr,"attempt to redefine value of label %D between lines %d and %d\n", x,begline,endline); routerr = 1; return; } temp1 = &chain[index]; /* trace chain for each label */ while (temp1 != 0) { temp2 = *temp1; *temp1 = ptr; temp1 = temp2; } temp0 = index; index = value[index]; value[temp0] = -1; } } connect(x,y) long x,y; { int *temp, index, temp2; index = hash(x); if (value[index] == -1) fixvalue(y, chain[index]); else { if (y == implicit) { /* attach implicit chain to x chain */ temp = &chain[index]; while (*temp != 0) temp = *temp; *temp = chain[hash(y)]; } temp2 = index; /* attach y linked labels to x linked labels */ while (value[temp2] >= 0) temp2 = value[temp2]; if (y == implicit) value[temp2] = value[hash(y)]; else value[temp2] = hash(y); } if (y == implicit) clear(y); } clear(x) long x; { int index; index = hash(x); value[index] = -2; chain[index] = 0; hashtab[index] = -1L; } cit) { /* attach implicit chain to x chain */ temp = &chain[index]; while (*temp != 0) temp = *temp; *temp = chain[hash(y)]; } temp2 = index; /* attach y linked labels to x linked labels */ while (value[temp2] >= 0) temp2 = value[temp2]; if (y == implicit) value[temp2] = value[hash(y)]; else value[temp2] = hash(y); } if (y == implicit) clear(y); } clear(x) loncmd/struct/1.incl.h 644 0 33 2411 2111463510 7346 ((#define maxlsw 10 /* max number of switches and labels per statement */ #define implicit 0L /* "label" of following line so all flow can be treated as jump to label */ struct lablist {long labelt; struct lablist *nxtlab; }; extern struct lablist *endlab, *errlab, *reflab, *linelabs, *newlab; extern long label(); extern int routbeg; /* line number of first line of routine */ extern int nameline; /* line number of function/subroutine st., if any */ extern int stflag; /* determines whether at beginning or middle of block of straight line code */ extern char buffer[]; extern int endbuf; extern int nlabs, lswnum, swptr, flag, counter, p1, p3, begline, endline, r1,r2, endcom; extern long begchar, endchar, comchar; /* statement types not associated with actual node types */ #define contst -1 #define ungo -2 #define arithif -3 #define readst -8 #define writest -9 #define entry -10 extern char *pred, *inc, *prerw, *postrw, *exp, *stcode; #define maxdo 20 /* max nesting of do loops */ extern long dostack[maxdo]; /* labels of do nodes */ extern int doloc[maxdo]; /* loc of do node */ extern int doptr; extern struct list *FMTLST; /* list of FMTVX's generated */ extern struct list *ENTLST; /* list of STLNVX nodes corresponding to entry statements */ ctual node types */ #define contst -1 #define ungo -2 #define arithif -3 #define readst -8 #define writest -9 #define entry -10 extern char *pred, *inc, *prerw, *postrw, *exp, *stcode; #define maxdo 20 /* max nesting of do loops */ extern cmd/struct/1.init.c 644 0 33 1534 2111463510 7364 #include #include "1.defs.h" #include "1.incl.h" #include "def.h" prog_init() { endline = endcom = 0; endchar = -1; comchar = -1; graph = challoc(sizeof(*graph) * maxnode); } routinit() { graf_init(); progtype = !sub; routbeg = endline + 1; rtnbeg = endchar + 1; nameline = 0; stflag = UNDEFINED; } line_init() { struct lablist *makelab(); freelabs(); newlab = linelabs = makelab(0L); flag = counter = nlabs = lswnum = swptr = p1 = 0; p3 = 5; endcom = endline; comchar = endchar; begline = endline + 1; begchar = endchar + 1; reflab = endlab = errlab = 0; r1 = r2 = 0; } graf_init() { int arctype[3]; long arclab[3]; nodenum = 0; doptr = UNDEFINED; retvert = stopvert = UNDEFINED; ENTLST = FMTLST = 0; arctype[0] = -2; arclab[0] = implicit; START = makenode(DUMVX,FALSE,FALSE,implicit,1,arctype,arclab); } lablist *makelab(); freelabs(); newlab = linelabs = makelab(0L); flag = counter = nlabs = lswnum = swptr = p1 = 0; p3 = 5; endcom = endline; comchar = endchacmd/struct/1.line.c 644 0 33 4405 2111463510 7350 #include # #include "def.h" #define bufsize 1601 char buffer[bufsize]; int bufcount; extern int errflag; long stchars; /* counts number of chars at most recent \n read */ #ifndef unix long ostchars; extern long ftell(); #endif int newline; /* counts number of lines read so far in file */ extern int rdfree(), comfree(),labfree(), contfree(); extern int rdstand(), comstand(), labstand(), contstand(); extern int (*rline[])(); extern int (*comment[])(); extern int (*getlabel[])(); extern int (*chkcont[])(); flush() {bufcount = 0; } addchar(c) { buffer[bufcount++] = c; } getline(lastline,lastchar,linecom,charcom) int *lastline, *linecom; long *lastchar, *charcom; /* set *lastline to number of last line of statement, set *lastchar to number of last char of statement, set *linecom to number of last line of comment preceding statement */ { int i; flush(); while ( unput1(input1()) != EOF) { while ( (*comment[inputform])(0) || blankline() ) { (*rline[inputform])(addchar); flush(); } *linecom = newline; /* set charcom to number of last char of comment, starting at 0 if at start of file and no comment, will be -1 */ *charcom = stchars - 1; if (unput1(input1()) == EOF) break; (*getlabel[inputform])(addchar); (*rline[inputform])(addchar); while ( blankline() || ( !(*comment[inputform])(0) && (*chkcont[inputform])() )) (*rline[inputform])(addchar); addchar('\0'); *lastline = newline; *lastchar = stchars - 1; if (debug == 40) fprintf(stderr,"line %d; bufcount: %d\n",newline,bufcount); for (i = 5; i < bufcount; ++i) if (buffer[i] == ' ' || buffer[i] == '\t' || buffer[i] == '\n') buffer[i] = '~'; return(bufcount); } return(-1); } int linechars; /* counts number of chars read so far in current line */ long newchar; /* counts number of chars read so far in file */ input1() { static int c; if (c == '\n') linechars = 0; c = inchar(); ++linechars; ++newchar; if (c == '\n') { ++newline; #ifdef unix stchars = newchar; #else ostchars=stchars; stchars=ftell(infd); #endif } return(c); } unput1(c) { --linechars; --newchar; unchar(c); if (c == '\n') { #ifdef unix stchars = newchar; #else stchars=ostchars; #endif --newline; } return(c); } ad so far in current line */ long newchar; /* counts number of chars read so far in file */ input1() { static int c; if (c == '\n') linechars = 0; c = inchar(); ++linechars; ++newchar; if (c == '\n') { ++newline; #ifdef unix stchars cmd/struct/1.main.c 644 0 33 232 2111463510 7317 #include #include "def.h" int endbuf; mkgraph() { if (!parse()) return(FALSE); hash_check(); hash_free(); fingraph(); return(TRUE); } { #ifdef unix stchars = newchar; #else stchars=ostchars; #endif --newline; } return(c); } ad so far in current line */ long newchar; /* counts number of chars read so far in file */ input1() { static int c; if (c == '\n') linechars = 0; c = /,5h< /,"cmd/struct/1.node.c 644 0 33 1511 2111463510 7341 #include #include "def.h" #include "1.incl.h" makenode(type,addimp,addcom, labe,arcnum,arctype,arclab) LOGICAL addimp,addcom; int type, arctype[], arcnum; long arclab[], labe; { int i; VERT num; ASSERT(arcsper[type] < 0 || arcnum == arcsper[type], makenode); num = create(type,arcnum); if (addimp) fiximp(num,labe); for (i = 0; i < arcnum; ++i) { if (arctype[i] == -2) addref(arclab[i],&ARC(num,i)); else ARC(num,i) = arctype[i]; } if (hascom[type] ) { if (!addcom || endcom < begline) BEGCOM(num) = UNDEFINED; else BEGCOM(num) = begchar - rtnbeg; } return(num); } fiximp(num,labe) /* fix implicit links, check nesting */ VERT num; long labe; { fixvalue(implicit, num); /* set implicit links to this node */ clear(implicit); if(labe != implicit) fixvalue(labe, num); } m,labe); for (i = 0; i < arcnum; ++i) { if (arctype[i] == -2) addref(arclab[i],&ARC(num,i)); else ARC(num,i) = arctype[i]; } if (hascom[type] ) { if (!addcomcmd/struct/1.recog.c 644 0 33 21517 2111463511 7544 #include #include "1.incl.h" #include "def.h" recognize(type, ifflag) /* if ifflag = 1, statement is if()type; otherwise is type */ int type, ifflag; /* do whatever is needed for this statement */ { int *arctype, i, sp; VERT num, num1, nest, loophead; extern long label(); long *arclab; if (nlabs > 3) sp = nlabs; else sp = 3; arctype = challoc(sizeof(*arctype) * sp); arclab = challoc(sizeof(*arclab) * sp); for( i=0; i < endbuf; i++) {if (buffer[i] == '~') buffer[i] = ' ';} loophead = nest = innerdo(label(0)); if (DEFINED(nest)) { /* this statement is last line of do loop */ nest = ARC(nest,0); /* nest is ITERVX of the innermost do ending here */ } if (ifflag) { if (type == ungo) { arctype[0] = -2; arclab[0] = label(1); } else arctype[0] = 0; arctype[1] = (nest >= 0) ? nest : -2; arclab[1] = implicit; num1 = makenode(IFVX,TRUE,TRUE,label(0),2,arctype,arclab); PRED(num1) = pred; } arctype[0] = (nest >= 0) ? nest : -2; arclab[0] = i((mplicit; switch(type) { case ungo: if (!ifflag) { connect(label(1),implicit); if (label(0) != implicit) connect(label(1),label(0)); } break; case RETVX: case STOPVX: if (type == RETVX) { if (retvert == UNDEFINED) retvert = makenode(type,FALSE,FALSE,implicit,0,arctype,arclab); num = retvert; } else { if (stopvert == UNDEFINED) stopvert = makenode(type,FALSE,FALSE,implicit,0,arctype,arclab); num = stopvert; } if (!ifflag) { fixvalue(implicit,num); clear(implicit); if (label(0) != implicit) fixvalue(label(0),num); } break; case contst: contin(label(0),loophead); break; case FMTVX: num = makenode(FMTVX,FALSE,TRUE,implicit,0,arctype,arclab); BEGCODE(num) = comchar + 1 - rtnbeg; ONDISK(num) = endline - endcom; if (label(0) != implicit) fixvalue(label(0),num); FMTLST = append(num,FMTLST); break; case STLNVX: if (DEFINED(stflag) && !ifflag && (label(0) == implicit)) { ++CODELINES(stflag); ONDISK(stflag) += endline - begline + 1; } else { num = makenode(STLNVX,!ifflag,!ifflag,label(0),1,arctype,arclab); if (!ifflag) { stflag = num; BEGCODE(num) = comchar + 1 - rtnbeg; ONDISK(num) = endline - endcom; CODELINES(num) = 1; } else { BEGCODE(num) = stcode; ONDISK(num) = FALSE; CODELINES(num) = 1; } } break; case DOVX: if (arctype[0] != -2) { error("illegal do range, ","",""); fprintf(stderr," between lines %d and %d\n",begline, endline); exit(1); } arctype[1] = UNDEFINED; num1 = makenode(DOVX,TRUE,TRUE,label(0),2,arctype,arclab); if (++doptr >= maxdo) { faterr("in parsing:\n","do loops nested deeper than allowed",""); } dostack[doptr] = label(1); doloc[doptr] = num1; /* stack link to node after loop */ INC(num1) = inc; num = makenode(ITERVX,TRUE,FALSE,implicit,1,arctype,arclab); ARC(num1,0) = num; FATH(num) = UNDEFINED; /* number of DOVX can change so leave UNDEFINED until later */ break; case arithif: if (label(1) == label(2) || label(1) == 0L) makeif(1,label(0),concat(pred," > 0"),label(3),label(2)); else if (label(1) == label(3) || label(3) == 0L) makeif(1,label(0),concat(pred," == 0"),label(2),label(1)); else if (label(2) == label(3) || label(2) == 0L) makeif(1,label(0),concat(pred," < 0"),label(1),label(3)); else { makeif(1,label(0),concat(pred," < 0"),label(1),implicit); makeif(1,implicit,concat(pred," == 0"),label(2),label(3)); } break; case IOVX: if (endlab) { arctype[1] = -2; arclab[1] = endlab->labelt; } else arctype[1] = UNDEFINED; if (errlab) { arctype[2] = -2; arclab[2] = errlab->labelt; } else arctype[2] = UNDEFINED; num = makenode(IOVX,!ifflag,!ifflag,label(0),3,arctype,arclab); PRERW(num) = prerw; POSTRW(num) = postrw; if (reflab) addref(reflab->labelt, &FMTREF(num)); else FMTREF(num) = UNDEFINED; break; case COMPVX: if (intcase) { num = compcase(ifflag); break; } case ASGOVX: for (i = 0; i < nlabs - 1; i++) { arctype[i] = -2; arclab[i] = label(nlabs-i-1); } num = makenode(type,!ifflag,!ifflag,label(0),nlabs - 1, arctype, arclab); EXP(num) = exp; break; case ASVX: num = makenode(ASVX,!ifflag,!ifflag,label(0),1,arctype,arclab); EXP(num) = exp; addref(label(1),&LABREF(num)); break; case entry: num = makenode(STLNVX,FALSE,TRUE,label(0),1,arctype,arclab); BEGCODE(num) = comchar + 1 - rtnbeg; ONDISK(num) = endline - endcom; CODELINES(num) = 1; ENTLST = append(num,ENTLST); break; } if (ifflag && type != ungo) { ARC(num1,0) = num; } if (DEFINED(loophead)) nesteddo(label(0), loophead); if (ifflag || DEFINED(loophead) || type != STLNVX) stflag = UNDEFINED; chfree(arctype,sizeof(*arctype) * sp); chfree(arclab,sizeof(*arclab) * sp); if (debug) { fprintf(debfd,"line %d: ", begline); if (ifflag) fprintf(debfd,"if() "); switch(type) {case RETVX: fprintf(debfd,"return"); break; case STOPVX: fprintf(debfd,"stop"); break; case contst: fprintf(debfd,"continue"); break; case ungo: fprintf(debfd,"uncond. goto"); break; case COMPVX: fprintf(debfd,"comp. goto"); break; case ASGOVX: fprintf(debfd,"ass. goto, labs"); break; case ASVX: fprintf(debfd,"label assignment"); break; case STLNVX: fprintf(debfd,"simple statement"); break; case arithif: fprintf(debfd,"arith if"); break; case DOVX: fprintf(debfd,"do "); break; case FMTVX: fprintf(debfd,"format st"); break; case IOVX: fprintf(debfd,"IOVX statement "); break; case entry: fprintf(debfd,"entry statement "); break; } fprintf(debfd,"\n%s\n", buffer); } } makeif(first,labe,test,arc1,arc2) /* construct IFVX with arcs to labels arc1,arc2 */ int first; long labe, arc1,arc2; char *test; { int num, arctype[2]; long arclab[2]; arctype[0] = arctype[1] = -2; arclab[0] = arc1; arclab[1] = arc2; num = makenode(IFVX,first,first,labe,2,arctype,arclab); PRED(num) = test; return(num); } innerdo(labe) /* return number of DOVX associated with labe, or UNDEFINED */ long labe; { if (DEFINED(doptr)) {if (dostack[doptr] == labe) return(doloc[doptr--]); } return(UNDEFINED); } contin(labe,nest) /* handle continue statements */ long labe; int nest; { VERT y; if (!DEFINED(nest)) { /* not nested */ if (labe != implicit) connect(implicit,labe); /* labe pts to next node */ } else { /* nested */ y = ARC(nest,0); fixvalue(labe,y); /* labe pts to ITERVX */ fixvalue(implicit, y); /* implicit links pt to ITERVX */ clear(implicit); } } nesteddo(labe,v) /* if multiple do's end on same label, add arc from inner DOVX to enclosing DOVX; add implicit link out of outermost DOVX with this label */ long labe; int v; { while (DEFINED(doptr) && dostack[doptr] == labe) { ARC(v,1) = ARC(doloc[doptr],0); /*set inner DOVX to point to outer ITERVX */ v = doloc[doptr--]; } addref(implicit, &ARC(v,1)); } compcase(ifflag) /* turn computed goto into case statement */ LOGICAL ifflag; { int *arctype, i, num, d, arct; extern long label(); long *arclab; char *str; arctype = challoc(sizeof(*arctype) * nlabs); arclab = challoc (sizeof(*arclab) * nlabs); d = distinct(linelabs->nxtlab,arctype,arclab,nlabs-1); /* puts distinct labels in arclab, count of each in arctype */ arct = -2; for (i = 0; i < d; ++i) arctype[i] = makenode(ICASVX,FALSE,FALSE,implicit,1,&arct,&arclab[i]); num = makenode(SWCHVX,!ifflag,!ifflag,label(0),d,arctype,arclab); EXP(num) = exp; str = challoc(6*(nlabs-1)); /* 5 digits + , or \0 per label */ for (i = 0; i < d; ++i) /* construct list of values for each label */ EXP(arctype[i]) = stralloc(str,accum(str,linelabs->nxtlab,arclab[i])); chfree(str,6*(nlabs-1)); chfree(arctype,sizeof(*arctype) * nlabs); chfree(arclab,sizeof(*arclab) * nlabs); return(num); } accum(str,vlist,f) /* build string of indices in compnode corr. to label f */ char *str; long f; struct lablist *vlist; { int s,j; struct lablist *p; s = 0; j = 1; for (p = vlist; p ; p = p->nxtlab) /* search for occurrences of f */ { if (p->labelt ==f) { if (s) { str[s] = ','; ++s; } sprintf(&str[s],"%d",j); while (str[s] != '\0') ++s; } ++j; } return(s+1); } distinct(vlist,count,dlist,size) /* make dlist into list of distinct labels in vlist */ struct lablist *vlist; long dlist[]; /*count[] gets count of each label; d distinct labels */ int count[],size; {int d,i; d = 0; for(i = 0; i < size; i++) count[i] = 0; for (;vlist && vlist->labelt != 0L; vlist = vlist ->nxtlab) { for (i = 0; ;i++) { if (i == d) dlist[d++] = vlist->labelt; if (dlist[i] == vlist->labelt) { ++count[i]; break; } } } return(d); } turn(s+1); } distinct(vlist,count,dlist,size) /* make dlist into list of distinct labels in vlist */ struct lablist *vlist; long dlist[]; /*count[] gets count of each labecmd/struct/1.tables.c 644 0 33 25414 2111463511 7717 #include int match[146] = { 0, 1, 2, 3, 4, 5, 19, 21, 23, 25, 29, 32, 36, 38, 42, 44, 46, 50, 52, 56, 59, 61, 65, 74, 77, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 102, 105, 108, 114, 116, 118, 120, 122, 124, 126, 129, 131, 134, 136, 139, 142, 144, 147, 149, 151, 153, 155, 157, 159, 161, 163, 165, 167, 169, 171, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 221, 223, 225, 227, 229, 231, 233, 235, 237, 239, 241, 243, 245, 247, 249, 251, 254, 256, 258, 260, 262, 264, 266, 268, 270, 272, 274, 276, 278, 280, 283, 287, 292, 298, 303, 307, 311, 316, 320, 324, 327, 329, 331, 333, 335, 337, 339, 341, 343, 345, 347, 349, 351, 353, 355, 356, 357, 359 }; int symclass[358] = { 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 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', 'i', 'd', 'g', 'a', 'r', 'w', 'c', 'l', 's', 'e', 'p', 'f', 'b', '_', 'o', '_', 't', '_', 'o', '_', '_', '_', '(', '_', '_', '\0', '_', '_', ',', '\0', '_', '(', '_', '_', ',', ')', '_', '\0', '_', '_', '_', '_', ',', ')', '_', ',', '_', '_', '_', '\0', '_', 'f', 'n', '_', '(', '_', '(', ')', '\0', '_', '=', 'g', 'a', 'r', 'p', 'w', 's', '_', '_', '_', ',', '_', '_', ',', '\0', '_', 'o', '_', 'n', '_', 't', '_', 'i', '_', 'n', '_', 'u', '_', 'e', '_', '\0', '_', 'o', '_', '_', 'u', '_', '_', '_', '_', '_', '=', '_', '_', '(', ')', ',', '_', '_', 's', '_', 's', '_', 'i', '_', 'g', '_', 'n', '_', '_', '_', '_', 't', '_', 'o', '_', '_', '\0', '_', 'e', '_', 'a', 't', '_', 'l', 'd', '_', 'f', '_', 'u', 'o', '_', 'n', '_', 'c', '_', 't', '_', 'i', '_', 'o', '_', 'n', '_', 't', '_', 'e', '_', 'g', '_', 'e', '_', 'r', '_', 'o', '_', 'm', 'n', '_', 'p', '_', 'l', '_', 'e', '_', 'x', '_', 'b', '_', 'l', '_', 'e', '_', 'p', '_', 'r', '_', 'e', '_', 'c', '_', 'i', '_', 's', '_', 'i', '_', 'o', '_', 'n', '_', 'o', '_', 'g', '_', 'i', '_', 'c', '_', 'a', '_', 'l', '_', 't', 'u', '_', 'o', '_', 'p', '_', 'b', '_', 'r', '_', 'o', '_', 't', '_', 'i', '_', 'n', '_', 'e', '_', 'e', '_', 't', '_', 'u', '_', 'r', '_', 'n', '_', 'n', '_', 'd', 't', '_', '\0', '_', 'r', '_', 'y', '_', 'r', '_', 'm', '_', 'a', '_', 't', '_', '(', '_', 'r', '_', 'i', '_', 't', '_', 'e', '_', '(', '_', '(', '_', '_', '_', ',', '\0', '_', '(', ')', ',', '\0', '_', '_', 'e', ',', '\0', ')', '_', 'n', 'r', ')', '\0', '_', 'd', ')', '\0', '_', '=', ')', '\0', '_', '_', ',', ')', '\0', '_', 'r', ')', '\0', '_', '=', ')', '\0', '_', 'r', 'u', '_', 'i', '_', 'n', '_', 't', '_', 'n', '_', 'c', '_', 'h', '_', 'l', '_', 'o', '_', 'c', '_', 'k', '_', 'd', '_', 'a', '_', 't', '_', 'a', '_', '_', '_', '_' }; int action[358] = { 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 111, 0, 111, 0, 111, 76, 111, 1, 0, 0, 111, 1, 122, 111, 0, 72, 123, 111, 0, 111, 1, 3, 3, 111, 124, 111, 1, 111, 1, 3, 3, 111, 76, 111, 0, 0, 125, 111, 0, 0, 111, 45, 111, 30, 31, 111, 0, 133, 0, 0, 0, 0, 0, 0, 1, 111, 1, 3, 111, 1, 3, 141, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 180, 111, 0, 111, 1, 0, 111, 1, 61, 111, 0, 0, 111, 0, 62, 63, 64, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 1, 111, 1, 3, 111, 76, 111, 0, 150, 111, 0, 111, 0, 0, 111, 0, 76, 111, 0, 111, 0, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 200, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 0, 111, 0, 111, 350, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 200, 111, 0, 111, 0, 111, 0, 111, 0, 111, 300, 111, 0, 111, 0, 0, 111, 400, 111, 0, 111, 700, 111, 0, 111, 0, 111, 0, 111, 0, 111, 600, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 1, 111, 1, 520, 520, 111, 62, 77, 70, 111, 0, 1, 0, 75, 111, 520, 0, 0, 0, 510, 111, 0, 0, 510, 111, 0, 73, 510, 111, 0, 1, 3, 510, 111, 0, 0, 510, 111, 0, 74, 510, 111, 0, 0, 0, 111, 0, 111, 0, 111, 76, 111, 0, 111, 0, 111, 76, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 0, 111, 210, 111, 0, 0, 0 }; int newstate[358] = { 1, 2, 3, 4, 5, 19, 33, 6, 38, 47, 112, 63, 81, 87, 102, 127, 51, 134, 142, 7, 142, 8, -5, 9, -5, 10, 11, 15, -5, 10, 142, -5, 11, 12, 142, -5, 13, -5, 13, 13, 14, -5, 142, -5, 16, 142, 16, 15, 17, 142, 18, 142, 18, 18, 142, -5, 20, 58, 142, 21, -5, 21, -5, -5, 21, 142, 6, 38, 47, 127, 112, 87, 23, 142, 23, 24, 142, 24, 24, 142, -5, 26, -5, 27, -5, 28, -5, 29, -5, 30, -5, 31, -5, 32, -5, 142, 142, 34, -5, 35, 69, -5, 35, 36, -5, 36, 37, -5, 37, 37, 37, 37, 37, -5, 39, -5, 40, -5, 41, -5, 42, -5, 43, -5, 44, 142, 44, 45, 142, 46, -5, 46, 142, -5, 48, 142, 49, 99, 142, 50, 117, 142, 51, 142, 52, 107, 142, 53, 142, 54, 142, 55, 142, 56, 142, 57, 142, 142, 142, 59, 142, 60, 142, 61, 142, 62, 142, 50, 142, 64, 142, 65, 27, 142, 66, 142, 67, 142, 68, 142, 50, 142, 70, 142, 71, 142, 72, 142, 73, 142, 74, 142, 75, 142, 76, 142, 77, 142, 78, 142, 79, 142, 80, 142, 50, 142, 82, 142, 83, 142, 84, 142, 85, 142, 86, 142, 50, 142, 88, 90, 142, 89, 142, 142, 142, 91, 142, 92, 142, 93, 142, 94, 142, 95, 142, 96, 142, 142, 142, 98, 142, 99, 142, 100, 142, 101, 142, 142, 142, 103, 142, 104, 105, 142, 142, 142, 106, 142, 142, 142, 108, -5, 109, -5, 110, -5, 111, -5, -5, -5, 113, -5, 114, -5, 115, -5, 116, -5, 119, -5, 119, 118, -5, 118, -5, -5, -5, 119, 119, -5, -5, 119, 120, 121, 120, -5, -5, 119, 122, 125, -5, -5, 119, 123, -5, -5, 119, 124, -5, -5, 119, 124, 120, -5, -5, 119, 126, -5, -5, 119, 124, -5, -5, 119, 128, 131, 142, 129, 142, 130, 142, 117, 142, 132, 142, 133, 142, 117, 142, 135, -5, 136, -5, 137, -5, 138, -5, 139, -5, 140, -5, 141, -5, -5, -5, -5, -5, -5 }; 5, 111, -5, -5, -5, 113, -5, 114, -5, 115, -5, 116, -5, 119, -5, 119, 118, -5, 118, -5, -5, -5, 119, 119, -5, -5, 119, 120, 121, 120, -5, -5, 119, 122, 125, -5, -5, 119, 123, -5, -5, 119, 124, -5, -5, 1cmd/struct/2.def.h 644 0 33 436 2111463511 7146 ((extern int accessnum; /* number of nodes accessible from START */ extern VERT *after; /* node numbers associated with after numbers of depth first search */ extern int *ntobef; /* before numbers associated with nodes */ extern int *ntoaft; /* after numbers associated with nodes */ -5, 113, -5, 114, -5, 115, -5, 116, -5, 119, -5, 119, 118, -5, 118, -5, -5, -5, 119, 119, -5, -5, 119, 120, 12/,5< /,"cmd/struct/2.dfs.c 644 0 33 10612 2111463511 7214 #include # /* depth-first search used to identify back edges, unreachable nodes; each node v entered by back edge replaced by LOOPVX ->ITERVX -> v, so that back edges entering v now enter the ITERVX, and other edges entering v now enter the LOOPVX. Nodes are numbered according to depth-first search: before numbering- ntobef[v] = i => node numbered v is i'th node in order of first visit during the search; after numbering- ntoaft[v] = i => node numbered v is i'th node visited in order of last visit during the search. Also, in this case after[i] = v. */ #include "def.h" #include "2.def.h" #define MAXINS 3 /* spacing needed between numbers generated during depth first search */ int *status; int befcount, aftcount; /* following defines used to mark back edges and nodes entered by back edges */ #define UNPROCESSED 0 #define STACKED 1 #define FINISHED 2 #define MARK(v) {REACH(v) = 1; } /* mark node v */ #define UNMARK(v) {REACH(v) = 0; } #define MARKED(v) (REACH(v)) #define MKEDGE(e) {if (e >= -1) e = -(e+3); } /* mark edge e */ #define UNMKEDGE(e) {if (e < -1) e = -(e+3); } #define BACKEDGE(e) (e < -1) dfs(v) /* depth first search */ VERT v; { int i; VERT w; accessnum = 0; status = challoc(sizeof(*status) * nodenum); for (w = 0; w < nodenum; ++w) { status[w] = UNPROCESSED; UNMARK(w); } search(v); chreach(); chfree(status, sizeof(*status) * nodenum); addloop(); after = challoc(sizeof(*after) * accessnum); for (i = 0; i < accessnum; ++i) after[i] = UNDEFINED; ntoaft = challoc(sizeof(*ntoaft) * nodenum); ntobef = challoc(sizeof(*ntobef) * nodenum); for (w = 0; w < nodenum; ++w) ntobef[w] = ntoaft[w] = UNDEFINED; befcount = 0; aftcount = 0; repsearch(v); } search(v) /* using depth first search, mark back edges using MKEDGE, and nodes entered by back edges using MARK */ VERT v; { VERT adj; int i; status[v] = STACKED; for(i = 0; i < ARCNUM(v); ++i) { adj = ARC(v,i); if (!DEFINED(adj)) continue; else if (status[adj] == UNPROCESSED) search(adj); else if (status[adj] == STACKED) { MARK(adj); /* mark adj as entered by back edge */ MKEDGE(ARC(v,i)); /* mark edge ARC(v,i) as being back edge */ } } status[v] = FINISHED; ++accessnum; } chreach() /* look for unreachable nodes */ { VERT v; LOGICAL unreach; unreach = FALSE; for (v = 0; v < nodenum; ++v) if (status[v] == UNPROCESSED && NTYPE(v) != FMTVX && NTYPE(v) != STOPVX && NTYPE(v) != RETVX) { unreach = TRUE; if (debug) fprintf(stderr,"node %d unreachable\n",v); } if (unreach) error(": unreachable statements - ","will be ignored",""); } addloop() /* add LOOPVX, ITERVX at nodes entered by back edges, and adjust edges */ { VERT v, adj; int j, oldnum; for (v = 0, oldnum = nodenum; v < oldnum; ++v) /* insloop increases nodenum */ if (MARKED(v)) { UNMARK(v); /* remove mark indicating v entered by back edge */ if (NTYPE(v) != ITERVX) /* DO loops already have ITERVX */ insloop(v); /* add LOOPVX, ITERVX since v entered by back edge*/ } /* arcs which used to enter v now enter LOOPVX; must make back edges enter ITERVX */ for (v = 0; v < nodenum; ++v) for (j = 0; j < ARCNUM(v); ++j) { if (BACKEDGE(ARC(v,j))) { UNMKEDGE(ARC(v,j)); /* return edge to normal value */ adj = ARC(v,j); if (NTYPE(adj) == ITERVX) continue; ASSERT(NTYPE(adj) == LOOPVX,addloop); ARC(v,j) = ARC(adj,0); /* change arc to point to ITERVX */ ASSERT(NTYPE(ARC(v,j)) == ITERVX,addloop); } } } insloop(v) /* insert LOOPVX, ITERVX at node number v */ VERT v; { VERT loo, iter; loo = create(LOOPVX, 1); iter = create(ITERVX,1); accessnum += 2; /* want LOOPVX to take on node number v, so that arcs other than back arcs entering v will enter the LOOPVX automatically */ exchange(&graph[v], &graph[loo]); exchange(&v, &loo); ARC(loo,0) = iter; ARC(iter,0) = v; FATH(iter) = UNDEFINED; /* will be defined later along with FATH for DOVX */ } exchange(p1,p2) /* exchange values of p1,p2 */ int *p1,*p2; { int temp; temp = *p1; *p1 = *p2; *p2 = temp; } repsearch(v) /* repeat df search in order to fill in after, ntoaft, ntobef tables */ VERT v; { VERT adj; int i,temp; ntobef[v] = befcount; ++befcount; for(i = 0; i < ARCNUM(v); ++i) { adj = ARC(v,i); if (DEFINED(adj) && ntobef[adj] == UNDEFINED) repsearch(adj); } ++aftcount; temp = accessnum - aftcount; after[temp] = v; ntoaft[v] = temp; } ong with FATH for DOVX */ } exchange(p1,p2) /* exchange values of p1,p2 */ int *p1,*p2; { int temp; temp = *p1; cmd/struct/2.dom.c 644 0 33 2004 2111463511 7173 #include # /* set dom[v] to immediate dominator of v, based on arcs as stored in inarcs (i.e. pretending the graph is reducible if it isn't). Algorithm is from Hecht and Ullman, Analysis of a simple algorithm for global flow analysis problems, except bit vector operations replaced by search through DOM to save quadratic blowup in space */ #include "def.h" #include "2.def.h" getdom(inarc,dom) struct list **inarc; VERT *dom; { VERT v; int i; struct list *ls; for (v = 0; v < nodenum; ++v) dom[v] = UNDEFINED; for (i = 1; i < accessnum; ++i) { v = after[i]; for (ls = inarc[v]; ls; ls = ls->nxtlist) { ASSERT(ntoaft[ls->elt] < i,getdom); dom[v] = comdom(dom[v],ls->elt,dom); } } } comdom(u,v,dom) /* find closest common dominator of u,v */ VERT u,v, *dom; { if (u == UNDEFINED) return(v); if (v == UNDEFINED) return(u); while(u != v) { ASSERT(u != UNDEFINED && v != UNDEFINED, comdom); if (ntoaft[u] < ntoaft[v]) v = dom[v]; else u = dom[u]; } return(u); } ] = UNDEFINED; for (i = 1; i < accessnum; ++i) { v = after[i]; for (ls = inarc[v]; ls; ls = ls->nxtlist) { ASSERT(ntoaft[ls->elt] < i,getdom); dom[v] = comdom(dom[v],ls->elt,dom); } } } comdom(u,v,dom) /* find closest common dominator of u,v */ VERT u,v, *dom; { if (u == UNDEFINED) return(v); if (v == UNDEFINED) return(u); while(u != v) { ASSERT(u != UNDEFINED && v != UNDEFINED, comdom); if (ntoaft[u] < ntoaft[v]) v = dom[v]; else u = dom[u]; } return(u);cmd/struct/2.head.c 644 0 33 5021 2111463511 7317 #include # /* set head[v] to ITERVX heading smallest loop containing v, for each v */ #include "def.h" #include "2.def.h" /* define ANC(v,w) true if v == w or v is ancestor of w */ #define ANC(v,w) (ntobef[v] <= ntobef[w] && ntoaft[v] <= ntoaft[w]) /* reflexive ancestor */ gethead(head) VERT *head; { VERT v, w, adj; int i, j; /* search nodes in reverse of after numbering so that all paths from a node to an ancestor are searched before the node */ /* at any point, the current value of head allows chains of nodes to be reached from any node v by taking head[v], head[head[v]], etc. until an UNDEFINED value is reached. Upon searching each arc, the appropriate chains must be merged to avoid losing information. For example, from one path out of a node v it may be known that v is in a loop headed by z, while from another it may be known that v is in a loop headed by w. Thus, head[v] must be set to whichever of z,w is the closer ancestor, and the fact that this node is in a loop headed by the other must be recorded in head. */ for (v = 0; v < nodenum; ++v) head[v] = UNDEFINED; for (i = accessnum -1; i >= 0; --i) { v = after[i]; for (j = 0; j < ARCNUM(v); ++j) { adj = ARC(v,j); if (!DEFINED(adj)) continue; if (ntoaft[adj] < i) /* back edge */ merge(v,adj,head); else if (ANC(v,adj)) /* not back edge or cross edge */ { /* need to do only tree edges - must not do edge (v,adj) when head[adj] is not ANC of v */ if (DEFINED(head[adj]) && ANC(head[adj],v)) merge(v,head[adj],head); } else /* cross edge */ { w = lowanc(adj,v,head); if (DEFINED(w)) merge(w,v,head); } } if (NTYPE(v) == LOOPVX || NTYPE(v) == DOVX) head[ARC(v,0)] = head[v]; /* head of ITERVX must be different ITERVX */ } } lowanc(y,z,head) /* find the first node in chain of y which is anc of z, if it exists */ VERT y,z, *head; { while (y != -1 && !ANC(y,z)) y = head[y]; return(y); } merge(w,y,head) /* merge chains of w and(( y according to ANC relation */ VERT w,y, *head; { VERT t, min; if (w == y) return; if (ANC(w,y)) /* set t to min of w,y */ { t = y; y = head[y]; } else { t = w; w = head[w]; } while (w != -1 && y != -1) /* construct chain at t by adding min of remaining elts */ { if (ANC(w,y)) { min = y; y = head[y]; } else { min = w; w = head[w]; } if (t != min) { head[t] = min; t = min; } } if (w == -1) min = y; else min = w; if (t != min) head[t] = min; } NC relation */ VERT w,y, *head; { VERT t, min; if (w == y) return; if (ANC(w,y)) /* set t to min of w,y */ { t = y; y = head[y]; } else { t = w; w = head[w]; } while (w != -1 && y != -1) /* construct chain at t by adding min of remaining elts */ { if (ANC(w,y)) { min = y; y = head[y]; } else { min = w; w = head[w]; } if (t != min) { head[t] = min; t = min; } } if (w == -1) min = y; else min = w; if (t != min) hecmd/struct/2.inarc.c 644 0 33 3051 2111463511 7513 #include # /* find forward in-arcs for each node, pretending that arcs which jump into a loop jump to the head of the largest such loop instead, based on the depth first search tree */ #include "def.h" #include "2.def.h" getinarc(inarc,head) /* construct array "inarc" containing in arcs for each node */ struct list **inarc; VERT *head; { VERT v,adj,x; int i, j; for (v=0; v < nodenum; ++v) inarc[v] = 0; /* fill in inarc nodes */ for (i = 0; i < accessnum; ++i) { v = after[i]; for (j = 0; j < ARCNUM(v); ++j) { adj = ARC(v,j); if (!DEFINED(adj)) continue; if (ntoaft[adj] > ntoaft[v]) /* not a back edge */ /* if edge jumps into loop, pretend jumps to head of largest loop jumped into */ { x = maxentry(v,adj,head); if (!DEFINED(x)) x = adj; else x = FATH(x); inarc[x] = consls(v,inarc[x]); /* insert v in list inarc[x] */ } } } } maxentry(x,y,head) /* return z if z is ITERVX of largest loop containing y but not x, UNDEFINED otherwise */ VERT x,y, *head; { if (head[y] == UNDEFINED) return(UNDEFINED); if (loomem(x,head[y], head)) return (UNDEFINED); y = head[y]; while (head[y] != UNDEFINED) { if (loomem(x,head[y],head)) return(y); y = head[y]; } return(y); } loomem(x,y,head) /* return TRUE if x is in loop headed by y, FALSE otherwise */ VERT x,y, *head; { VERT w; if (!DEFINED(y)) return(TRUE); ASSERT(NTYPE(y) == ITERVX, loomem); for (w = (NTYPE(x) == ITERVX) ? x : head[x]; DEFINED(w); w = head[w]) if (w == y) return (TRUE); return(FALSE); } == UNDEFINED) return(UNDEFINED); if (loomem(x,head[y], head)) return (UNDEFINED); y = head[y]; while (head[y] != UNDEFINED) { if (loomem(x,head[y],head)) return(y); y = head[y]; } return(y); } loomem(x,y,head) /* return TRUE if x is in loop headed by y, FALSE otherwise */ VERT x,y, *head; { VERT w; if (!DEFINED(y)) return(TRUE); ASSERT(NTYPE(y) == ITERVX, loomem); for (w = (NTYPE(x) == ITERVX) ? x : head[x]; DEFINED(w); w = head[w]) if (w cmd/struct/2.main.c 644 0 33 2522 2111463511 7345 #include #include "def.h" #include "2.def.h" VERT *after; int *ntobef, *ntoaft; build() { VERT v, *dom, *head; int type; struct list **inarc; dfs(START); if (routerr) return; for (v = 0; v < nodenum; ++v) { type = NTYPE(v); if (type == LOOPVX || type == DOVX) FATH(ARC(v,0)) = v; } head = challoc(sizeof(*head) * nodenum); if (progress) fprintf(stderr," gethead:\n"); gethead(head); /* sets head[v] to ITERVX heading smallest loop containing v or UNDEFINED */ if (routerr) return; inarc = challoc(nodenum * sizeof(*inarc)); if (progress) fprintf(stderr," getinarc:\n"); getinarc(inarc,head); /* sets inarc[v] to list of forward arcs entering v */ dom = challoc(nodenum * sizeof(*dom)); if (progress) fprintf(stderr," getdom:\n"); getdom(inarc,dom); /* sets dom[v] to immediate dominator of v or UNDEFINED */ if (routerr) return; if (progress) fprintf(stderr," gettree:\n"); gettree(inarc, dom, head); if (routerr) return; chfree(head, nodenum * sizeof(*head)); head = 0; chfree(dom,nodenum * sizeof(*dom)); dom = 0; for (v = 0; v < nodenum; ++v) { freelst(inarc[v]); inarc[v] = 0; } chfree(inarc,sizeof(*inarc) * nodenum); inarc = 0; chfree(ntoaft,sizeof(*ntoaft) * nodenum); ntoaft = 0; chfree(ntobef,sizeof(*ntobef) * nodenum); ntobef = 0; chfree(after, sizeof(*after) * accessnum); after = 0; } if (routerr) return; if (progress) fprintf(stderr," gettree:\n"); gettree(inarc, dom, head); if (routerr) return; chfree(head, nodenum * sizeof(*head)); head = 0; chfcmd/struct/2.test.c 644 0 33 1410 2111463511 7373 #include # /* for testing only */ #include "def.h" #include "2.def.h" testaft() { int i; for (i = 0; i < nodenum; ++i) fprintf(stderr,"ntoaft[%d] = %d, ntobef[%d] = %d\n",i,ntoaft[i],i,ntobef[i]); fprintf(stderr,"\n"); for (i = 0; i < accessnum; ++i) fprintf(stderr,"after[%d] = %d\n",i,after[i]); } testhead(head) VERT *head; { VERT v; for (v = 0; v < nodenum; ++v) fprintf(stderr,"head[%d] = %d\n",v,head[v]); } testdom(dom) VERT *dom; { VERT v; for (v = 0; v < nodenum; ++v) fprintf(stderr,"dom[%d] = %d\n",v,dom[v]); } testtree() { VERT v; int i; for (v = 0; v < nodenum; ++v) { fprintf(stderr,"%d: RSIB %d, ",v,RSIB(v)); for (i = 0; i < CHILDNUM(v); ++i) fprintf(stderr," %d",LCHILD(v,i)); fprintf(stderr,"\n"); } } ++i) fprintf(stderr,"after[%d] = %d\n",i,after[i]); } testhead(head) VERT *head; { VERT v; for (v = 0; v < nodenum; ++v) fprintf(stderr,"head[%d] = %d\n",v,head[v]); } testdom(dom) VERT *dom; { VERT v; for (v = 0; v < nodenum; ++v) cmd/struct/2.tree.c 644 0 33 5711 2111463511 7363 #include # /* use inarc, dom, and head to build tree representing structure of program. Each node v has CHILDNUM(v) children denoted by LCHILD(v,0), LCHILD(v,1),... RSIB((v) is right sibling of v or UNDEFINED; RSIB(v) represents code following v at the same level of nesting, while LCHILD(v,i) represents code nested within v */ #include "def.h" #include "2.def.h" gettree(inarc,dom,head) /* build tree */ struct list **inarc; VERT *dom, *head; { VERT v,u,from; int i; for ( v = 0; v < nodenum; ++v) { RSIB(v) = UNDEFINED; for (i = 0; i < CHILDNUM(v); ++i) LCHILD(v,i) = UNDEFINED; } for (i = accessnum-1; i > 0; --i) { v = after[i]; from = oneelt(inarc[v]); /* the unique elt of inarc[v] or UNDEFINED */ if (DEFINED(from)) if (NTYPE(from) == IFVX && (head[v] == head[from] || asoc(v,exitsize) != -1) ) /* place in clause of IFVX if in smallest loop containing it or if size of code for v is <= exitsize */ if (ARC(from,THEN) == v) { LCHILD(from,THEN) = v; continue; } else { ASSERT(ARC(from,ELSE) == v,gettree); LCHILD(from,ELSE) = v; continue; } else if (NTYPE(v) == ITERVX || NTYPE(from) == ITERVX ) /* LOOPVX -> ITERVX ->vert always in same loop*/ { LCHILD(from,0) = v; continue; } else if (NTYPE(from) == SWCHVX) { ASSERT(0 < ARCNUM(v),gettree); if (ARC(from,0) == v) LCHILD(from,0) = v; else { int j; for (j = 1; j < ARCNUM(from); ++j) if (ARC(from,j) == v) {insib(ARC(from,j-1),v); break; } } continue; } else if (NTYPE(from) == ICASVX && (head[v] == head[from] || asoc(v,exitsize) != -1)) { LCHILD(from,0) = v; continue; } else if (NTYPE(from) == DUMVX && ARC(from,0) == v) { LCHILD(from,0) = v; continue; } if (loomem(v,head[dom[v]],head)) /* v is in smallest loop containing dom[v] */ insib(dom[v],v); else { /* make v follow LOOPVX heading largest loop containing DOM[v] but not v */ ASSERT(DEFINED(head[dom[v]]),gettree); for (u = head[dom[v]]; head[u] != head[v]; u = head[u]) ASSERT(DEFINED(head[u]),gettree); ASSERT(NTYPE(u) == ITERVX,gettree); insib(FATH(u),v); } } } insib(w,v) /* make RSIB(w) = v, and make RSIB(rightmost sib of v) = old RSIB(w) */ VERT w,v; { VERT u, temp; temp = RSIB(w); RSIB(w) = v; for (u = v; DEFINED(RSIB(u)); u = RSIB(u)) ; RSIB(u) = temp; } asoc(v,n) /* return # of nodes associated with v if <= n, -1 otherwi((se */ VERT v; int n; { int count,i,temp; VERT w; count = (NTYPE(v) == STLNVX) ? CODELINES(v) : 1; for (i = 0; i < CHILDNUM(v); ++i) { w = LCHILD(v,i); if (!DEFINED(w)) continue; temp = asoc(w,n-count); if (temp == -1) return(-1); count += temp; if (count > n) return(-1); } if (DEFINED(RSIB(v))) { temp = asoc(RSIB(v),n-count); if (temp == -1) return(-1); count += temp; } if (count > n) return(-1); else return(count); } return # of nodes associated with v if <= n, -1 otherwicmd/struct/3.branch.c 644 0 33 3073 2111463511 7661 #include #include "def.h" #include "3.def.h" getbranch(head) VERT *head; { VERT v; for (v = 0; v < nodenum; ++v) LABEL(v) = FALSE; for (v = START; DEFINED(v); v = RSIB(v)) chkbranch(v,head); addlab(START); } chkbranch(v,head) VERT v,*head; { VERT w; int i; switch(NTYPE(v)) { case GOVX: for (i = 1, w = head[v]; DEFINED(w); w = head[w], ++i) { if (i > 1 && !levnxt && !levbrk) break; if (ARC(v,0) == BRK(w) && (levbrk || i == 1)) { NTYPE(v) = BRKVX; LEVEL(v) = i; break; } else if (ARC(v,0) == NXT(w) && (levnxt || i == 1)) { NTYPE(v) = NXTVX; LEVEL(v) = i; break; } } if (NTYPE(v) == GOVX) { if (ARC(v,0) == stopvert) NTYPE(v) = STOPVX; else if (ARC(v,0) == retvert) NTYPE(v) = RETVX; else LABEL(ARC(v,0)) = TRUE; } break; case COMPVX: case ASGOVX: for (i = 0; i < ARCNUM(v); ++i) LABEL(ARC(v,i)) = TRUE; break; case IOVX: if (DEFINED(ARC(v,ENDEQ))) LABEL(ARC(v,ENDEQ)) = TRUE; if (DEFINED(ARC(v,ERREQ))) LABEL(ARC(v,ERREQ)) = TRUE; if (DEFINED(FMTREF(v))) LABEL(FMTREF(v)) = TRUE; break; } for (i = 0; i < CHILDNUM(v); ++i) for (w = LCHILD(v,i); DEFINED(w); w = RSIB(w)) chkbranch(w,head); } addlab(v) /* add labels */ VERT v; { int recvar; if (NTYPE(v) != ITERVX && LABEL(v) ) LABEL(v) = nxtlab(); RECURSE(addlab,v,recvar); if (NTYPE(v) == ITERVX && LABEL(NXT(v))) LABEL(NXT(v)) = nxtlab(); } nxtlab() { static count; return(labinit + (count++) * labinc); } v,ERREQ))) LABEL(ARC(v,ERREQ)) = TRUE; if (DEFINED(FMTREF(v))) LABEL(FMTREF(v)) = TRUE; break; } for (i = 0; i < CHILDNUM(v); ++i) for (w = LCHILD(v,i); DEFINED(w); w = RSIB(w)) chkbranch(w,head); } addlab(v) /* add labels */ VERT v; { int recvar; if (NTYPE(v) != ITERVX && LABEL(v) ) LABEL(v) = nxtlab(); RECURSE(addlab,v,recvar); if (NTYPE(v) == ITERVX && LABEL(NXT(v))) LABEL(NXT(v)) = nxtlab(); } nxtlab() cmd/struct/3.def.h 644 0 33 456 2111463511 7151 #define RECURSE(p,v,r) { for (r = 0; r < CHILDNUM(v); ++r) if (DEFINED(LCHILD(v,r))) p(LCHILD(v,r)); if (DEFINED(RSIB(v))) p(RSIB(v)); } #define IFTHEN(v) ( NTYPE(v) == IFVX && !DEFINED(LCHILD(v,ELSE))) #define BRK(v) FATH(v) /* lexical successor of v, for ITERVX only */ #define LABEL(v) REACH(v) dd labels */ VERT v; { int recvar; if (NTYPE(v) != ITERVX && LABEL(v) ) LABEL(v) = nxtlab(); RECURSE(addlab,v,re/,58< /,"cmd/struct/3.flow.c 644 0 33 3175 2111463511 7376 #include # /* correct the flow of control in the new program - use GOTO's which may be changed later to NEXT, BREAK, etc. */ #include "def.h" #include "3.def.h" #define BRANCHTYPE(v) (NTYPE(v) == GOVX ) #define HASLEX(t) (t != GOVX && t != COMPVX && t != ASGOVX && t != ITERVX ) /* for these, control never flows directly to following statement */ getflow() { fixflow(START,UNDEFINED); } fixflow(v,autolex) VERT v; VERT autolex; /* lexical successor of v */ { VERT lex,chlex,z,x,w; int i; lex = lexval(v,autolex); if (HASLEX(NTYPE(v)) && NTYPE(v) != ICASVX) if (DEFINED(REACH(v)) && REACH(v) != lex) insib(v,makebr(REACH(v))); else if (NTYPE(v) == DOVX && ARC(v,1) != lex) insib(v,makebr(ARC(v,1))); if (NTYPE(v) == ITERVX) { BRK(v) = autolex; chlex = v; } else chlex = lexval(v,autolex); for (i = 0; i < CHILDNUM(v); ++i) { w = LCHILD(v,i); if (DEFINED(w)) fixflow(w,chlex); else { ASSERT(i < ARCNUM(v),fixflow); z = ARC(v,i); ASSERT(DEFINED(z), fixflow); if (z != chlex) { x = makebr(z); LCHILD(v,i) = x; RSIB(x) = UNDEFINED; } } } if (DEFINED(RSIB(v))) fixflow(RSIB(v),autolex); } lexval(v,lastlex) VERT v,lastlex; { VERT sib; if (!HASLEX(NTYPE(v))) return(UNDEFINED); sib = RSIB(v); if (NTYPE(v) == ICASVX || NTYPE(v) == ACASVX) return(lastlex); else if (!DEFINED(sib)) return(lastlex); else if (BRANCHTYPE(sib)) return(ARC(sib,0)); else return(sib); } makebr(w) /* make branching node leading to w */ VERT w; { VERT new; new = create(GOVX,1); ARC(new,0) = w; RSIB(new) = UNDEFINED; REACH(new) = UNDEFINED; return(new); } (RSIB(v))) fixflow(RSIB(v),autolex); } lexval(v,lastlex) VERT v,lastlex; { VERT sib; if (!HASLEX(NTYPE(v))) return(UNDEFINED); sib = RSIB(v); if (NTYPE(v) == ICASVX || NTYPE(v) == ACASVX) return(lastlex); else if (!DEFINED(sib)) return(lastlex); else if (BRANCHTYPE(sib)) return(ARC(sib,0)); else return(sib); } makebr(w) /* make branching node leading to w */ VERcmd/struct/3.loop.c 644 0 33 6217 2111463511 7400 #include #include "def.h" #include "3.def.h" #define ARCCOUNT(v) REACH(v) fixhd(v,hd,head) VERT v,hd,*head; { VERT w,newhd; int i; head[v] = hd; newhd = (NTYPE(v) == ITERVX) ? v : hd; for (i = 0; i < CHILDNUM(v); ++i) for (w = LCHILD(v,i); DEFINED(w); w = RSIB(w)) fixhd(w,newhd,head); } getloop() { cntarcs(); fixloop(START); } cntarcs() /* count arcs entering each node */ { VERT w,v; int i; for (v = 0; v < nodenum; ++v) ARCCOUNT(v) = 0; for (v = 0; v < nodenum; ++v) for (i = 0; i < ARCNUM(v); ++i) { w = ARC(v,i); if (!DEFINED(w)) continue; ++ARCCOUNT(w); } } fixloop(v) /* find WHILE loops */ VERT v; { int recvar; if (NTYPE(v) == LOOPVX) { ASSERT(DEFINED(ARC(v,0)),fixloop); NXT(ARC(v,0)) = ARC(v,0); if (!getwh(v)) getun(v); } else if (NTYPE(v) == IFVX && arbcase) getswitch(v); else if (NTYPE(v)==DOVX) { ASSERT(DEFINED(ARC(v,0)),fixloop); NXT(ARC(v,0))=ARC(v,0); } RECURSE(fixloop,v,recvar); } getwh(v) VERT v; { VERT vchild, vgrand,vgreat; ASSERT(NTYPE(v) == LOOPVX,getwh); vchild = LCHILD(v,0); ASSERT(DEFINED(vchild),getwh); ASSERT(NTYPE(vchild) == ITERVX,getwh); vgrand = LCHILD(vchild,0); if (!DEFINED(vgrand) || !IFTHEN(vgrand) ) return(FALSE); vgreat = LCHILD(vgrand,THEN); if (DEFINED(vgreat) && NTYPE(vgreat) == GOVX && ARC(vgreat,0) == BRK(vchild)) { /* turn into WHILE */ NTYPE(v) = WHIVX; NEG(vgrand) = !NEG(vgrand); LPRED(vchild) = vgrand; LCHILD(vchild,0) = RSIB(vgrand); RSIB(vgrand) = UNDEFINED; return(TRUE); } return(FALSE); } getun(v) /* change loop to REPEAT UNTIL if possible */ VERT v; { VERT vchild, vgrand, vgreat, before, ch; ASSERT(NTYPE(v) == LOOPVX,getun); vchild = LCHILD(v,0); ASSERT(DEFINED(vchild), getun); if (ARCCOUNT(vchild) > 2) return(FALSE); /* loop can be iterated without passing through predicate of UNTIL */ vgrand = ARC(vchild,0); if (!DEFINED(vgrand)) return(FALSE); for (ch = vgrand,before = UNDEFINED; DEFINED(RSIB(ch)); ch = RSIB(ch)) before = ch; if (!IFTHEN(ch)) return(FALSE); vgreat = LCHILD(ch,THEN); if (DEFINED(vgreat) && NTYPE(vgreat) == GOVX && ARC(vgreat,0) == BRK(vchild)) { /* create UNTIL node */ NTYPE(v) = UNTVX; NXT(vchild) = ch; LPRED(vchild)=ch; RSIB(before) = UNDEFINED; return(TRUE); } return(FALSE); } #define FORMCASE(w) (DEFINED(w) && !DEFINED(RSIB(w)) && NTYPE(w) == IFVX && ARCCOUNT(w) == 1) getswitch(v) VERT v; { VERT ch, grand, temp; /* must be of form if ... else if ... else if ... */ if (NTYPE(v) != IFVX) return(FALSE); ch = LCHILD(v,ELSE); if (!FORMCASE(ch)) return(FALSE); grand = LCHILD(ch,ELSE); if (!FORMCASE(grand)) return(FALSE); temp = create(SWCHVX,0); exchange(&graph[temp],&graph[v]); /* want arcs to enter switch, not first case*/ BEGCOM(v) = UNDEFINED; RSIB(v) = RSIB(temp); /* statements which followed IFVX should follow switch */ EXP(v) = UNDEFINED; LCHILD(v,0) = temp; NTYPE(temp) = ACASVX; for (ch = LCHILD(temp,ELSE); FORMCASE(ch); ) { LCHILD(temp,ELSE) = UNDEFINED; (( RSIB(temp) = ch; NTYPE(ch) = ACASVX; temp = ch; ch = LCHILD(temp,ELSE); } ASSERT(!DEFINED(RSIB(temp)),getswitch); return(TRUE); } LSE); temp = create(SWCHVX,0); exchange(&graph[temp],&graph[v]); /* want arcs to enter switch, not first case*/ BEGCOM(v) = UNDEFINED; RSIB(v) = RSIB(temp); /* statements which followed IFVX should follow switch */ EXP(v) = UNDEFINED; LCHILD(v,0) = temp; NTYPE(temp) = ACASVX; for (ch = LCHILD(temp,ELSE); FORMCASE(ch); ) { LCHILD(temp,ELSE) = UNDEFINED; cmd/struct/3.main.c 644 0 33 1342 2111463511 7345 #include #include "def.h" structure() { VERT v, *head; if (progress) fprintf(stderr," getreach:\n"); getreach(); if (routerr) return; if (progress) fprintf(stderr," getflow:\n"); getflow(); if (progress) fprintf(stderr," getthen:\n"); getthen(START); head = challoc(nodenum * sizeof(*head)); for (v = 0; v < nodenum; ++v) head[v] = UNDEFINED; for (v = START; DEFINED(v); v = RSIB(v)) fixhd(v,UNDEFINED,head); /* fixhd must be called before getloop so that it gets applied to IFVX which becomes NXT(w) for UNTVX w */ if (progress) fprintf(stderr," getloop:\n"); getloop(); if (progress) fprintf(stderr," getbranch:\n"); getbranch(head); chfree(head,nodenum * sizeof(*head)); head = 0; } ) fprintf(stderr," getthen:\n"); getthen(START); head = challoc(nodenum * sizeof(*head)); for (v = 0; v < nodenum; ++v) head[v] = UNDEFINED; for (v = START; DEFINED(v); v = RSIB(v)) fixhd(v,UNDEFINED,head); /* fixhd must be called before getloop so that it gets appliedcmd/struct/3.reach.c 644 0 33 7067 2111463511 7515 #include # /* set REACH[v] = w if w is only node outside subtree of v which is reached from within subtree of v, REACH[v] = UNDEFINED otherwise */ #include "def.h" /* strategy in obtaining REACH(v) for each node v: Since only need to know whether there is exactly one exit from subtree of v, need keep track only of 2 farthest exits from each subtree rather than all exits. The first may be the unique exit, while the second is used when the children of a node has the same first exit. To obtain 2 farthest exits of v, look at 2 farthest exits of children of v and the nodes entered by arcs from v. Farthest exits are identified by numbering the nodes from -2 to -(accessnum-2) starting at the bottom left corner of tree using procedure number(). The farthest exit from the subtree of v is the one with the least number according NUM to this numbering. If a node w is an exit from the subtree of v, then NUM(w) < NUM(v). The negative numbers allow NUM(v) to be stored in the same location as REACH(v). REACH(w) may already be set when an arc (v,w) to a child is searched, but the negative numbering is consistent, i.e. NUM(v) < NUM(w) in this case as in other cases where w is not an exit from the subtree of v. */ struct pair { int smallest; int second; }; getreach() /* obtain REACH(v) for each node v */ { VERT v; struct pair *pr; for (v = 0; v < nodenum; ++v) REACH(v) = UNDEFINED; number(START); for (v = START; DEFINED(v); v = RSIB(v)) { pr = exits(v); /* need to free the space for pr */ chfree(pr,sizeof(*pr)); } } exits(v) /* set REACH(v) = w if w is only node outside subtree of v which is reached from within subtree of v, leave REACH(v) UNDEFINED otherwise */ VERT v; { struct pair *vpair, *chpair; VERT w,t; int i; vpair = challoc(sizeof(*vpair)); vpair ->smallest = vpair ->second = UNDEFINED; for (i = 0; i < CHILDNUM(v); ++i) { w = LCHILD(v,i); if (!DEFINED(w)) continue; for (t = w; DEFINED(t); t = RSIB(t)) { chpair = exits(t); /* set vpair->smallest,second to two smallest of vpair->smallest,second, chpair->smallest,second */ if (inspr(chpair->smallest,vpair)) inspr(chpair->second,vpair); chfree(chpair, sizeof(*chpair)); } } for (i = 0; i < ARCNUM(v); ++i) { w = ARC(v,i); if (!DEFINED(w)) continue; inspr(w,vpair); } /* throw out nodes in subtree of v */ if (NUM(vpair->second) >= NUM(v)) { vpair->second = UNDEFINED; if (NUM(vpair->smallest) >= NUM(v)) vpair->smallest = UNDEFINED; } if (vpair->second == UNDEFINED) REACH(v) = vpair->smallest; /* vpair->smallest possibly UNDEFINED */ else REACH(v) = UNDEFINED; return(vpair); } /* number nodes from -2 to -(accessnum+2) starting at bottom left corner of tree */ number(v) VERT v; { int i; VERT w; static int count; for (i = 0; i < CHILDNUM(v); ++i) { w = LCHILD(v,i); if (DEFINED(w)) number(w); } SETNUM(v,count-2); --count; if (DEFINED(RSIB(v))) number(RSIB(v)); } NUM(v) VERT v; { if (!DEFINED(v)) return(UNDEFINED); return(REACH(v)); } SETNUM(v,count) VERT v; int count; { /* this reuses REACH to save space; /* appears to be no conflict with setting true value of REACH later */ REACH(v) = count; } LOGICAL inspr(w,pr) /* insert w in order in pr, return TRUE if <= smaller of pr */ /* don't insert duplicates */ VERT w; struct pair *pr; { if (w == pr-> smallest) return(TRUE); if (NUM(w) < NUM(pr->smallest)) { pr->second = pr->smallest; pr->smallest = w; return(TRUE); } if (w == pr->second) return(FALSE); if (NUM(w) < NUM(pr->second)) pr->second = w; return(FALSE); } ACH to save space; /* appears to be no conflict with setting true value of REACH later */ REACH(v) = count; } LOGICAL inspr(w,pr) /* insert w in order in pr, return TRUE if <= smaller of pr */ /* don't insert duplicates */ VERT w; struct pair *pr; { if (w == pr-> smallest) return(TRUE); if (NUM(w) < NUM(pr->smallest)) { pr->second = pr->smallest; pr->smallest = w; return(TRUE); } if (w == pr->second) return(FALSE); if (NUM(w) # /* for testing only */ #include "def.h" testreach() { VERT v; for (v = 0; v < nodenum; ++v) fprintf(stderr,"REACH(%d) = %d\n",v,REACH(v)); } LOGICAL inspr(w,pr) /* insert w in order in pr, return TRUE if <= smaller of pr */ /* don't insert duplicates */ VERT w; struct pair *pr; { if (w == pr-> smallest) return(TRUE); if (NUM(w) < NUM(pr->smallest)) { pr->second = pr->smallest/,5< /,"cmd/struct/3.then.c 644 0 33 3053 2111463511 7360 #include #include "def.h" #include "3.def.h" #define BRANCHTYPE(t) (t == STOPVX || t == RETVX || t == BRKVX || t == NXTVX || t == GOVX) #define MAXCHUNK 20 /* if else clause smaller than MAXCHUNK and smaller than then clause, and there is no reason not to negate the if, negate the if */ getthen(v) /* turn IFVX into THEN when appropriate, create else ifs where possible */ VERT v; { VERT tch, fch; int tn,fn; int recvar; if (NTYPE(v) == IFVX) { tch = LCHILD(v,THEN); fch = LCHILD(v,ELSE); if (!DEFINED(fch)) mkthen(v); else if (!DEFINED(tch)) { negate(v); mkthen(v); } else if (BRANCHTYPE(NTYPE(tch))) mkthen(v); else if (BRANCHTYPE(NTYPE(fch))) { negate(v); mkthen(v); } else if (NTYPE(fch) != IFVX || DEFINED(RSIB(fch))) /* not an else if */ if ( NTYPE(tch) == IFVX && !DEFINED(RSIB(tch))) /* invert into else if */ negate(v); else { /* asoc(v,n) returns number of statements associated with v if <= n, -1 otherwise */ tn = asoc(tch,MAXCHUNK); fn = asoc(fch,MAXCHUNK); if (fn >= 0 && (tn < 0 || fn < tn)) /* else clause smaller */ negate(v); } } RECURSE(getthen,v,recvar); } mkthen(v) VERT v; { VERT w,tc; w = LCHILD(v,ELSE); tc = LCHILD(v,THEN); ASSERT(!DEFINED(w) || (DEFINED(tc) && BRANCHTYPE(NTYPE(tc)) ),mkthen); if (DEFINED(w)) { insib(v,w); LCHILD(v,ELSE) = UNDEFINED; } ASSERT(IFTHEN(v),mkthen); } negate(v) VERT v; { ASSERT(NTYPE(v) == IFVX,negate); exchange(&LCHILD(v,THEN), &LCHILD(v,ELSE)); NEG(v) = !NEG(v); } ,MAXCHUNK); if (fn >= 0 && (tn < 0 || fn < tn)) /* else clause smaller */ negate(v); } } RECURSE(getthen,v,recvar); } mkthen(v) VERT v; { VERT w,tc; w = LCHILD(v,ELSE); tc = LCHILD(v,THEN); ASSERT(!DEFINED(w) || (DEFINED(tc) && BRANCHTYPE(NTYPE(tc)) ),mkthen); if (DEFINED(w)) { insib(v,w); LCHILD(v,ELSE) = UNDEFINED; } ASSERT(IFTHEN(v),mkthen); } negate(v) VERT v; { ASSERT(NTYPE(v) == IFVX,negate); exchange(&LCHILD(v,THEN((cmd/struct/4.brace.c 644 0 33 2365 2111463512 7505 #include #include "def.h" #include "4.def.h" #include "3.def.h" ndbrace(v) /* determine whether braces needed around subparts of v */ /* return TRUE if v ends with IF THEN not in braces */ VERT v; { VERT w; int i; LOGICAL endif; endif = FALSE; for (i = 0; i < CHILDNUM(v); ++i) { endif = FALSE; for (w = LCHILD(v,i); DEFINED(w); w = RSIB(w)) endif = ndbrace(w); if (NTYPE(v) != DUMVX && NTYPE(v) != ITERVX && (!DEFINED(LCHILD(v,i)) || compound(v,i) || (endif && NTYPE(v) == IFVX && !IFTHEN(v) && i == THEN ))) /* DUMVX doesn't nest, ITERVX doen't nest since nesting is done at LOOPNODE, etc., must check for IFTHEN followed by unrelated ELSE */ { YESBRACE(v,i); endif = FALSE; } } return(endif || IFTHEN(v) ); } compound(v,ch) /* return TRUE iff subpart ch of v has multiple statements */ VERT v; int ch; { VERT w; w = LCHILD(v,ch); if (!DEFINED(w)) return(FALSE); if (NTYPE(w) == ITERVX) { ASSERT(DEFINED(NXT(w)),compound); if (LABEL(NXT(w))) return(TRUE); /* loop ends with labeled CONTINUE statement */ else return(compound(w,0)); } else if (DEFINED(RSIB(w))) return(TRUE); else if (NTYPE(w) == STLNVX && CODELINES(w) > 1) return(TRUE); else return(FALSE); } endif || IFTHEN(v) ); } compound(v,ch) /* return TRUE iff subpart ch of v has multiple statements */ VERT v; int ch; { VERT w; w = LCHILD(v,ch); if (!DEFINED(w)) return(FALSE); if (NTYPE(w) == ITERVX) { ASSERT(DEFINED(NXT(w)),compound); if (LABEL(NXTcmd/struct/4.def.h 644 0 33 641 2111463512 7147 #define YESTAB TRUE #define NOTAB FALSE #define TABOVER(n) tabover(n,outfd) #define OUTSTR(x) fprintf(outfd,"%s",x) #define OUTNUM(x) fprintf(outfd,"%d",x) extern LOGICAL *brace; #define YESBRACE(v,i) { if (DEFINED(LCHILD(v,i))) brace[LCHILD(v,i)] = TRUE; } #define NOBRACE(v,i) { if (DEFINED(LCHILD(v,i))) brace[LCHILD(v,i)] = FALSE; } #define HASBRACE(v,i) ((DEFINED(LCHILD(v,i))) ? brace[LCHILD(v,i)] : TRUE) ret/,5< /,"cmd/struct/4.form.c 644 0 33 3064 2111463512 7371 #include # #include "def.h" #include "4.def.h" extern int linechars; extern int rdfree(), comfree(), labfree(), contfree(); extern int rdstand(), comstand(), labstand(), contstand(); extern int (*rline[])(); extern int (*comment[])(); extern int (*getlabel[])(); extern int (*chkcont[])(); null(c) char c; {return;} comprint() { int c, blank, first,count; blank = 1; first = 1; count = 0; while ((c = (*comment[inputform])(0) ) || blankline() ) { ++count; if (c) { (*comment[inputform])(1); /* move head past comment signifier */ blank = blankline(); /* if (first && !blank) OUTSTR("#\n");*/ prline("#"); first = 0; } else (*rline[inputform])(null); } /* if (!blank) OUTSTR("#\n"); */ return(count); } prcode(linecount,tab) int linecount, tab; { int someout; someout = FALSE; while (linecount) { if ( (*comment[inputform])(0) ) { linecount -= comprint(); someout = TRUE; continue; } else if (blankline() ) (*rline[inputform])(null); else if ((*chkcont[inputform])() ) { TABOVER(tab); prline("&"); someout = TRUE; } else {if (someout) TABOVER(tab); (*getlabel[inputform])(null); prline(""); someout=TRUE; } --linecount; } } charout(c) char c; { putc(c,outfd); } prline(str) char *str; { fprintf(outfd,"%s",str); (*rline[inputform]) (charout); putc('\n',outfd); } input2() { static int c; c = inchar(); if (c == '\n') linechars = 0; else ++linechars; return(c); } unput2(c) int c; { unchar(c); --linechars; return(c); } BOVER(tab); prline("&"); someout = TRUE; } else {if (someout) TABOVER(tab); (*getlabel[inputform])(null); prline(""); someout=TRUE; } --linecount; } } charout(c) char c; { putc(c,outfd); } prline(str) char *str; { fprintf(outfd,"%s",str); (*rline[inputform]) (charout); putc('\n',outfd); } input2() { static int c; c = inchar(); if (c == '\n') linechars = 0; else ++linechars; return(c); } unput2(c)cmd/struct/4.main.c 644 0 33 737 2111463512 7336 #include #include "def.h" #include "4.def.h" LOGICAL *brace; output() { VERT w; int i; brace = challoc(nodenum * sizeof(*brace)); for (i = 0; i < nodenum; ++i) brace[i] = FALSE; if (progress) fprintf(stderr,"ndbrace:\n"); for (w = START; DEFINED(w); w = RSIB(w)) ndbrace(w); if (progress) fprintf(stderr,"outrat:\n"); for (w = START; DEFINED(w); w = RSIB(w)) outrat(w,0,YESTAB); OUTSTR("END\n"); chfree(brace,nodenum * sizeof(*brace)); brace = 0; } /,"cmd/struct/4.out.c 644 0 33 12002 2111463512 7245 #include #include "def.h" #include "4.def.h" #include "3.def.h" outrat(v,tab,tabfirst) VERT v; int tab; /* number of tabs to indent */ LOGICAL tabfirst; /* FALSE if doing IF of ELSE IF */ { LOGICAL ndcomma; VERT w; int type,i; type = NTYPE(v); if (hascom[type]) prcom(v); if (!LABEL(v) && type == FMTVX) { OUTSTR("#following unreferenced format statement commented out\n"); OUTSTR("#"); } if (LABEL(v) && type != ITERVX) { ASSERT(tabfirst, outrat); prlab(LABEL(v),tab); } else if (tabfirst && type != DUMVX && type != ITERVX) TABOVER(tab); switch(type) { case DUMVX: newlevel(v,0,tab,YESTAB); break; case GOVX: OUTSTR("go to "); OUTNUM(LABEL(ARC(v,0))); OUTSTR("\n"); break; case STOPVX: if (progtype != blockdata) OUTSTR("stop\n"); break; case RETVX: OUTSTR("return\n"); break; case BRKVX: if (!levbrk) { ASSERT(LEVEL(v) == 1,outrat); OUTSTR("break\n"); } else { OUTSTR("break "); OUTNUM(LEVEL(v)); OUTSTR("\n"); } break; case NXTVX: if (!levnxt) { ASSERT(LEVEL(v) == 1,outrat); OUTSTR("next\n"); } else { OUTSTR("next "); OUTNUM(LEVEL(v)); OUTSTR("\n"); } break; case ASGOVX: case COMPVX: OUTSTR("goto "); if (type == ASGOVX) { OUTSTR(EXP(v)); OUTSTR(","); } OUTSTR("("); for (i = ARCNUM(v)-1; i >=0; --i) /* arcs were stored backward */ { OUTNUM(LABEL(ARC(v,i))); if (i > 0) OUTSTR(","); } OUTSTR(")"); if (type == COMPVX) { OUTSTR(","); OUTSTR(EXP(v)); } OUTSTR("\n"); break; case ASVX: OUTSTR("assign "); OUTNUM(LABEL(LABREF(v))); OUTSTR(" to "); OUTSTR(EXP(v)); OUTSTR("\n"); break; case IFVX: OUTSTR("IF"); prpred(v,TRUE); if (IFTHEN(v)) newlevel(v,THEN,tab+1,YESTAB); else { newlevel(v,THEN,tab+1,YESTAB); TABOVER(tab); OUTSTR("ELSE "); w = LCHILD(v,ELSE); ASSERT(DEFINED(w),outrat); if (NTYPE(w) == IFVX && !LABEL(w) && !DEFINED(RSIB(w)) && !HASBRACE(v,ELSE) ) newlevel(v,ELSE,tab,NOTAB); else newlevel(v,ELSE,tab+1,YESTAB); } break; case ITERVX: newlevel(v,0,tab,YESTAB); ASSERT(DEFINED(NXT(v)),outrat); if (LABEL(NXT(v))) { prlab(LABEL(NXT(v)),tab); OUTSTR("continue\n"); } break; case DOVX: OUTSTR("DO "); OUTSTR(INC(v)); newlevel(v,0,tab+1,YESTAB); break; case LOOPVX: case UNTVX: OUTSTR("REPEAT"); newlevel(v,0,tab+1,YESTAB); if (type == UNTVX) { TABOVER(tab+1); OUTSTR("UNTIL"); ASSERT(DEFINED(ARC(v,0)),outrat); prpred(LPRED(ARC(v,0)),TRUE); OUTSTR("\n"); } break; case WHIVX: OUTSTR("WHILE"); ASSERT(DEFINED(ARC(v,0)),outrat); ASSERT(DEFINED(LPRED(ARC(v,0))),outrat); prpred(LPRED(ARC(v,0)),TRUE); newlevel(v,0,tab+1,YESTAB); break; case STLNVX: case FMTVX: prstln(v,tab); break; case SWCHVX: OUTSTR("SWITCH"); if (DEFINED(EXP(v))) { OUTSTR("("); OUTSTR(EXP(v));(( OUTSTR(")"); } newlevel(v,0,tab+1,YESTAB); break; case ICASVX: case ACASVX: OUTSTR("CASE "); if (type == ACASVX) prpred(v,FALSE); else OUTSTR(EXP(v)); OUTSTR(":\n"); newlevel(v,0,tab+1,YESTAB); if (type == ACASVX &&DEFINED(LCHILD(v,ELSE))) { TABOVER(tab); OUTSTR("DEFAULT:\n"); newlevel(v,1,tab+1,YESTAB); } break; case IOVX: OUTSTR(PRERW(v)); ndcomma = FALSE; if (DEFINED(FMTREF(v))) { OUTNUM(LABEL(FMTREF(v))); ndcomma = TRUE; } if (DEFINED(ARC(v,ENDEQ))) { if (ndcomma) OUTSTR(","); OUTSTR("end = "); OUTNUM(LABEL(ARC(v,ENDEQ))); ndcomma = TRUE; } if (DEFINED(ARC(v,ERREQ))) { if (ndcomma) OUTSTR(","); OUTSTR("err = "); OUTNUM(LABEL(ARC(v,ERREQ))); ndcomma = TRUE; } OUTSTR(POSTRW(v)); OUTSTR("\n"); break; } } newlevel(v,ch,tab,tabfirst) VERT v; int ch; /* number of lchild of v being processed */ int tab; /* number of tabs to indent */ LOGICAL tabfirst; /* same as for outrat */ { LOGICAL addbrace; VERT w; if (NTYPE(v) == ACASVX || NTYPE(v) == ICASVX) addbrace = FALSE; else addbrace = HASBRACE(v,ch); ASSERT(tabfirst || !addbrace,newlevel); if (addbrace) OUTSTR(" {"); if(tabfirst && NTYPE(v)!=ITERVX && NTYPE(v)!=DUMVX) OUTSTR("\n"); for (w = LCHILD(v,ch); DEFINED(w); w = RSIB(w)) outrat(w,tab,tabfirst); if (addbrace) { TABOVER(tab); OUTSTR("}\n"); } } prpred(v,addpar) VERT v; LOGICAL addpar; { if (addpar) OUTSTR("("); if (NEG(v)) OUTSTR("!("); OUTSTR(PRED(v)); if (NEG(v)) OUTSTR(")"); if (addpar) OUTSTR(")"); } prlab(n,tab) int n,tab; { TABOVER(tab); OUTSTR("~"); OUTNUM(n); OUTSTR(" "); } prstln(v,tab) VERT v; int tab; { ASSERT(NTYPE(v) == STLNVX || NTYPE(v) == FMTVX,prstln); if (!ONDISK(v)) { OUTSTR(BEGCODE(v)); OUTSTR("\n"); } else { empseek(BEGCODE(v)); prcode(ONDISK(v),tab); } } prcom(v) VERT v; { if (DEFINED(BEGCOM(v))) { empseek(BEGCOM(v)); comprint(); } } TSTR("("); if (NEG(v)) OUTSTR("!("); OUTSTR(PRED(v)); if (NEG(v)) OUTSTR(")"); if (addpar) OUTSTR(")"); } prlab(n,tab) int n,tab; { TABOVER(tab); OUTSTR("~"); OUTNUM(n); OUTSTR(" "); } prstln(v,tab) VERT v; int tab; { ASSERT(NTYPE(v) == STLNVX || NTYPE(v) == FMTVX,prstln); if (!ONDISK(v)) { OUTSTR(BEGCODE(v)); OUTSTR("\n"); } else { empseek(BEGCODE(v)); prcode(ONDISK(v),tab); } } prcom(v) VERT v; { if (DEFINED(BEGCOM(v))) { empseek(BEGCOM(v)); comprint(); } cmd/struct/b.h 644 0 33 442 2111463512 6467 extern int xxindent, xxval, newflag, xxmaxchars, xxbpertab; extern int xxlineno; /* # of lines already output */ #define xxtop 100 /* max size of xxstack */ extern int xxstind, xxstack[xxtop], xxlablast, xxt; struct node {int op; char *lit; struct node *left; struct node *right; }; ); if (!ONDISK(v)) { OUTSTR(BEGCODE(v)); OUTSTR("\n"); } else { empseek(BEGCODE(v)); prcode(ONDISK(v),tab); } }/,5< /,"cmd/struct/bdef.c 644 0 33 276 2111463512 7146 #define xxtop 100 /* max size of xxstack */ int xxindent, xxval, newflag, xxmaxchars, xxbpertab; int xxlineno; /* # of lines already output */ int xxstind, xxstack[xxtop], xxlablast, xxt; op], xxlablast, xxt; struct node {int op; char *lit; struct node *left; struct node *right; }; ); if (!ONDISK(v)) { OUTSTR(BEGCODE(v)); OUTSTR("\n"); } else { empseek(BEGCODE(v)); prcode(ONDISK(v),tab); } }/,5< /,"cmd/struct/beauty.y 644 0 33 17661 2111463512 7633 %term xxif 300 xxelse 301 xxwhile 302 xxrept 303 xxdo 304 xxrb 305 xxpred 306 %term xxident 307 xxle 308 xxge 309 xxne 310 xxnum 311 xxcom 312 %term xxstring 313 xxexplist 314 xxidpar 315 xxelseif 316 xxlb 318 xxend 319 %term xxcase 320 xxswitch 321 xxuntil 322 xxdefault 323 %term xxeq 324 %left '|' %left '&' %left '!' %binary '<' '>' xxeq xxne xxge xxle %left '+' '-' %left '*' '/' %left xxuminus %right '^' %{ #include "b.h" #include %} %% %{ struct node *t; %} allprog: prog xxnew ; prog: stat | prog stat ; stat: iftok pred nlevel elsetok nlevel | iftok pred nlevel | xxtab whtok pred nlevel | xxtab rpttok nlevel optuntil | xxtab dotok nlevel | xxtab swtok oppred pindent lbtok caseseq xxtab rbtok mindent | xxtab fstok | lbtok prog xxtab rbtok | lbtok rbtok | labtok stat | xxnl comtok stat | error ; xxtab: = { if (!xxlablast) tab(xxindent); xxlablast = 0; } xxnl: = newline(); xxnew: = putout('\n',"\n"); nlevel: pindent stat mindent; pindent: = { if (xxstack[xxstind] != xxlb) ++xxindent; }; mindent: = {if (xxstack[xxstind] != xxlb && xxstack[xxstind] != xxelseif) --xxindent; pop(); }; caseseq: casetok caseseq | casetok ; casetok: xxtab xxctok predlist pindent prog mindent | xxtab xxctok predlist pindent mindent | xxtab deftok pindent prog mindent | xxnl comtok casetok ; xxctok: xxcase = {putout(xxcase,"case "); free ($1); push(xxcase); } deftok: xxdefault ':' = { putout(xxcase,"default"); free($1); putout(':',":"); free($2); push(xxcase); } swtok: xxswitch = {putout(xxswitch,"switch"); free($1); push(xxswitch); } fstok: xxend = { free($1); putout(xxident,"end"); putout('\n',"\n"); putout('\n',"\n"); putout('\n',"\n"); } | xxident = { putout(xxident,$1); free($1); newflag = 1; forst(); newflag = 0; }; identtok: xxident '(' explist ')' = { xxt = addroot($1,xxident,0,0); $$ = addroot("",xxidpar,xxt,$3); } | xxident = $$ = addroot($1,xxident,0,0); ; predlist: explist ':' = { yield($1,0); putout(':',":"); freetree($1); } explist: expr ',' explist = $$ = addroot($2,xxexplist,checkneg($1,0),$3); | expr = $$ = checkneg($1,0); ; oppred: pred | ; pred: '(' expr ')' = { t = checkneg($2,0); yield(t,100); freetree(t); }; expr: '(' expr ')' = $$ = $2; | '-' expr %prec xxuminus = $$ = addroot($1,xxuminus,$2,0); | '!' expr = $$ = addroot($1,'!',$2,0); | expr '+' expr = $$ = addroot($2,'+',$1,$3); | expr '-' expr = $$ = addroot($2,'-',$1,$3); | expr '*' expr = $$ = addroot($2,'*',$1,$3); | expr '/' expr = $$ = addroot($2,'/',$1,$3); | expr '^' expr = $$ = addroot($2,'^',$1,$3); | expr '|' expr = $$ = addroot($2,'|',$1,$3); | expr '&' expr = $$ = addroot($2,'&',$1,$3); | expr '>' expr = $$ = addroot($2,'>',$1,$3); | expr '<' expr = $$ = addroot($2,'<',$1,$3); | expr xxeq expr = $$ = addroot($2,xxeq,$1,$3); | expr xxle expr = $$ = addroot($2,xxle,$1,$3); | expr xxge expr = $$ = addroot($2,xxge,$1,$3); | expr xxne expr = $$ = addroot($2,xxne,$1,$3); | identtok = $$ = $1; | xxnum = $$ = addroot($1,xxnum,0,0); | xxstring = $$ = addroot($1,xxstring,0,0); ; iftok: xxif = { if (xxstack[xxstind] == xxelse && !xxlablast) { --xxindent; xxstack[xxstind] = xxelseif; putout(' '," "); } else { if (!xxlablast) tab(xxindent); xxlablast = 0; } putout(xxif,"if"); free($1); push(xxif); } elsetok: xxelse = { tab(xxindent); putout(xxelse,"else"); free($1); push(xxelse); } whtok: xxwhile = { putout(xxwhile,"while"); free($1); push(xxwhile); } rpttok: xxrept = { putout(xxrept,"repeat"); free($1); push(xxrept); } optuntil: xxtab unttok pred | ; unttok: xxuntil = { putout('\t',"\t"); putout(xxuntil,"until"); free($1); } dotok: dopart opdotok ; dopart: xxdo identtok '=' expr ',' expr = {push(xxdo); putout(xxdo,"do"); free($1); puttree($2); putout('=',"="); free($3); puttree($4); putout(',',","); free($5); puttree($6); } opdotok: ',' expr = { putout(',',","); puttree($2); } | ; lbtok: '{' = { putout('{'," {"); push(xxlb); } rbtok: '}' = { putout('}',"}"); pop(); } labtok: xxnum = { tab(xxindent); putout(xxnum,$1); putout(' '," "); xxlablast = 1; } comtok: xxcom = { putout(xxcom,$1); free($1); xxlablast = 0; } | comtok xxcom = { putout ('\n',"\n"); putout(xxcom,$2); free($2); xxlablast = 0; }; %% #define ASSERT(X,Y) if (!(X)) error("struct bug: assertion 'X' invalid in routine Y","",""); yyerror(s) char *s; { extern int yychar; fprintf(stderr,"\n%s",s); fprintf(stderr," in beautifying, output line %d,",xxlineno + 1); fprintf(stderr," on input: "); switch (yychar) { case '\t': fprintf(stderr,"\\t\n"); return; case '\n': fprintf(stderr,"\\n\n"); return; case '\0': fprintf(stderr,"$end\n"); return; d((efault: fprintf(stderr,"%c\n",yychar); return; } } yyinit(argc, argv) /* initialize pushdown store */ int argc; char *argv[]; { xxindent = 0; xxbpertab = 8; xxmaxchars = 120; } #include main() { int exit(); if ( signal(SIGINT, SIG_IGN) != SIG_IGN) signal(SIGINT, exit); yyinit(); yyparse(); } putout(type,string) /* output string with proper indentation */ int type; char *string; { static int lasttype; if ( (lasttype != 0) && (lasttype != '\n') && (lasttype != ' ') && (lasttype != '\t') && (type == xxcom)) accum("\t"); else if (lasttype == xxcom && type != '\n') tab(xxindent); else if (lasttype == xxif || lasttype == xxwhile || lasttype == xxdo || type == '=' || lasttype == '=' || (lasttype == xxident && (type == xxident || type == xxnum) ) || (lasttype == xxnum && type == xxnum) ) accum(" "); accum(string); lasttype = type; } accum(token) /* fill output buffer, generate continuation lines */ char *token; { static char *buffer; static int lstatus,llen,bufind; int tstatus,tlen,i; #define NEW 0 #define MID 1 #define CONT 2 if (buffer == 0) { buffer = malloc(xxmaxchars); if (buffer == 0) error("malloc out of space","",""); } tlen = slength(token); if (tlen == 0) return; for (i = 0; i < tlen; ++i) ASSERT(token[i] != '\n' || tlen == 1,accum); switch(token[tlen-1]) { case '\n': tstatus = NEW; break; case '+': case '-': case '*': case ',': case '|': case '&': case '(': tstatus = CONT; break; default: tstatus = MID; } if (llen + bufind + tlen > xxmaxchars && lstatus == CONT && tstatus != NEW) { putchar('\n'); ++xxlineno; for (i = 0; i < xxindent; ++i) putchar('\t'); putchar(' ');putchar(' '); llen = 2 + xxindent * xxbpertab; lstatus = NEW; } if (lstatus == CONT && tstatus == MID) { /* store in buffer in case need \n after last CONT char */ ASSERT(bufind + tlen < xxmaxchars,accum); for (i = 0; i < tlen; ++i) buffer[bufind++] = token[i]; } else { for (i = 0; i < bufind; ++i) putchar(buffer[i]); llen += bufind; bufind = 0; for (i = 0; i < tlen; ++i) putchar(token[i]); if (tstatus == NEW) ++xxlineno; llen = (tstatus == NEW) ? 0 : llen + tlen; lstatus = tstatus; } } tab(n) int n; { int i; newline(); for ( i = 0; i < n; ++i) putout('\t',"\t"); } newline() { static int already; if (already) putout('\n',"\n"); else already = 1; } error(mess1, mess2, mess3) char *mess1, *mess2, *mess3; { fprintf(stderr,"\nerror in beautifying, output line %d: %s %s %s \n", xxlineno, mess1, mess2, mess3); exit(1); } push(type) int type; { if (++xxstind > xxtop) error("nesting too deep, stack overflow","",""); xxstack[xxstind] = type; } pop() { if (xxstind <= 0) error("stack exhausted, can't be popped as requested","",""); --xxstind; } forst() { while( (xxval = yylex()) != '\n') { putout(xxval, yylval); free(yylval); } free(yylval); } s3) char *mess1, *mess2, *mess3; { fprintf(stderr,"\nerror in beautifying, oucmd/struct/def.h 644 0 33 7374 2111463512 7037 #define ASSERT(P,R) {if (!(P)) {fprintf(stderr,"failed assertion in routine R: P\n"); abort();}} extern int routnum, routerr; extern long rtnbeg; /* number of chars up to beginnine of curernt routing */ extern int **graph, nodenum; extern int stopflg; /* turns off generation of stop statements */ #define TRUE 1 #define FALSE 0 #define LOGICAL int #define VERT int #define DEFINED(v) (v >= 0) #define UNDEFINED -1 /* node types */ #define STLNVX 0 #define IFVX 1 #define DOVX 2 #define IOVX 3 #define FMTVX 4 #define COMPVX 5 #define ASVX 6 #define ASGOVX 7 #define LOOPVX 8 #define WHIVX 9 #define UNTVX 10 #define ITERVX 11 #define THENVX 12 #define STOPVX 13 #define RETVX 14 #define DUMVX 15 #define GOVX 16 #define BRKVX 17 #define NXTVX 18 #define SWCHVX 19 #define ACASVX 20 #define ICASVX 21 #define TYPENUM 22 extern int hascom[TYPENUM]; /* FALSE for types with no comments, 2 otherwise */ extern int nonarcs[TYPENUM]; /* number of wds per node other than arcs */ extern VERT *arc(), *lchild(); extern int *vxpart(), *negpart(), *predic(), *expres(), *level(), *stlfmt(); /* node parts */ #define FIXED 4 /* number of wds needed in every node */ #define NTYPE(v) graph[v][0] #define BEGCOM(v) graph[v][1] #define RSIB(v) graph[v][2] #define REACH(v) graph[v][3] #define LCHILD(v,i) *lchild(v,i) #define CHILDNUM(v) childper[NTYPE(v)] #define ARC(v,i) *arc(v,i) #define ARCNUM(v) *((arcsper[NTYPE(v)] >= 0) ? &arcsper[NTYPE(v)]: &graph[v][-arcsper[NTYPE(v)]]) /* STLNVX, FMTVX parts */ #define BEGCODE(v) *stlfmt(v,0) /* 1st char of line on disk or address of string */ #define ONDISK(v) *stlfmt(v,1) /* FALSE if in core,# of lines on disk otherwise */ #define CODELINES(v) *vxpart(v,STLNVX,2) /* # of statements stored in node */ /* IOVX parts */ #define FMTREF(v) *vxpart(v,IOVX,0) /* FMTVX associated with i/o statememt */ #define PRERW(v) *vxpart(v,IOVX,1) /* string occurring in i/o statement before parts with labels */ #define POSTRW(v) *vxpart(v,IOVX,2) /* string occurring in i/o statement after parts wih labels */ #define ENDEQ 1 /* arc number associated with endeq */ #define ERREQ 2 /* arc number associated wth erreq */ /* ITERVX parts */ #define NXT(v) *vxpart(v,ITERVX,0) /* THENVX containing condition for iteration for WHILE or UNTIL */ #define FATH(v) *vxpart(v,ITERVX,1) /* father of v */ #define LPRED(v) *vxpart(v,ITERVX,2) /* loop predicate for WHILE, UNTIL */ /*DOVX parts */ #define INC(v) *vxpart(v,DOVX,0) /* string for iteration condition of DO */ /* IFVX,THENVX parts */ #define PRED(v) *predic(v) /* string containing predicate */ #define NEG(v) *negpart(v) /* TRUE if predicate negated */ #define THEN 0 /* arc number of true branch */ #define ELSE 1 /* arc number of false branch */ /* miscellaneous parts */ #define EXP(v) *expres(v) /* expression - ASVX, COMPVX, ASGOVX, SWCHVX, ICASVX */ #define LABREF(v) *vxpart(v,ASVX,1) /* node referred to by label in ASSIGN statement */ /* BRKVX, NXTVX parts */ #define LEVEL(v) *level(v) /* also COMPVX, ASGOVX, SWCHVX, and DUMVX contain wd for number of arcs */ /* location of this wd specified by negative entry in arcsper */ extern int arcsper[TYPENUM]; /* also nodes contain wds for children as specified by childper */ extern childper[TYPENUM]; /* switches */ extern int intcase, arbcase, whiloop, invelse, exitsize, maxnode, maxhash, progress, labinit, labinc, inputform, debug,levbrk,levnxt,mkunt; /* arrays */ extern int *after; extern char *typename[]; struct list { VERT elt; struct list *nxtlist; }; struct list *append(), *consl(); extern VERT retvert, stopvert; /* specifies unique return and stop vertices */ extern VERT START; extern int progtype; /* type of program - main or sub or blockdata */ #define sub 1 #define blockdata 2 extern FILE *infd, *debfd, *outfd; ntcase, arbcase, whiloop, invelse, exitsize, maxnode, maxhash, progress, labinit, labinc, inputform, debug,levbrk,levnxt,mkunt; /* arrays */ extern int *after; extern char *typename[]; struct list { VERT elt; struct list *nxtlist; }; struct list *append(cmd/struct/lextab.l 644 0 33 10776 2111463512 7604 %{ #include "y.tab.h" #include "b.h" #undef input #define input() ninput() #undef unput #define unput(c) nunput(c) extern int yylval; #define xxbpmax 1700 char xxbuf[xxbpmax + 2]; int xxbp = -1; #define xxunmax 200 char xxunbuf[xxunmax + 2]; int xxunbp = -1; int blflag; %} D [0-9] A [0-9a-z] L [a-z] SP [^0-9a-z] %% %{ char *xxtbuff; int xxj, xxn, xxk; char *xxp; %} [=/,(]{D}+[h] { blflag = 1; sscanf(&yytext[1],"%d",&xxn); xxtbuff = malloc(2*xxn+3); for (xxj = xxk = 1; xxj <= xxn; ++xxj) { xxtbuff[xxk] = ninput(); if (xxtbuff[xxk] == '"') xxtbuff[++xxk] = '"'; ++xxk; } xxtbuff[0] = xxtbuff[xxk++] = '"'; xxtbuff[xxk] = '\0'; putback(xxtbuff); free(xxtbuff); backup(yytext[0]); blflag = 0; xxbp = -1; } IF {fixval(); xxbp = -1; return(xxif);} ELSE {fixval(); xxbp = -1; return(xxelse);} REPEAT {fixval(); xxbp = -1; return(xxrept); } WHILE {fixval(); xxbp = -1; return(xxwhile); } UNTIL { fixval(); xxbp = -1; return(xxuntil); } DO {fixval(); xxbp = -1; return(xxdo); } SWITCH {fixval(); xxbp = -1; return(xxswitch); } CASE {fixval(); xxbp = -1; return(xxcase); } DEFAULT {fixval(); xxbp = -1; return(xxdefault); } END {fixval(); xxbp = -1; return(xxend); } ".true." | ".false." | {L}{A}* {fixval(); xxbp = -1; return(xxident); } ~{D}+ {xxbuf[0] = ' '; fixval(); xxbp = -1; return(xxnum); } {D}+/"."(ge|gt|le|lt|eq|ne|not|or|and)"." | {D}+\.? | {D}+\.?[de][+-]?{D}+ | {D}*\.{D}+[de][+-]?{D}+ | {D}*\.{D}+ {fixval(); xxbp = -1; return(xxnum); } ".gt." { putback(">"); xxbp = -1; } ".ge." { putback(">=");xxbp = -1; } ".lt." { putback("<"); xxbp = -1; } ".le." { putback("<="); xxbp = -1; } ".eq." { putback("=="); xxbp = -1; } ".ne." { putback("!="); xxbp = -1; } ".not." { putback("!"); xxbp = -1; } ".or." { putback("||"); xxbp = -1; } ".and." { putback("&&"); xxbp = -1; } ">=" {fixval(); xxbp = -1; return(xxge); } "<=" {fixval(); xxbp = -1; return(xxle); } == {fixval(); xxbp = -1; return(xxeq((); } != {fixval(); xxbp = -1; return(xxne); } "||" {fixval(); xxbp = -1; return('|'); } "&&" {fixval(); xxbp = -1; return('&'); } "**" {fixval(); xxbp = -1; return('^'); } #.* {fixval(); xxbp = -1; return(xxcom); } \"([^"]|\"\")*\" {fixval(); xxbp = -1; return(xxstring); } '([^']|'')*' { fixval(); xxp = yylval; xxn = slength(xxp); xxtbuff = malloc(2*xxn+1); xxtbuff[0] = '"'; for (xxj = xxk = 1; xxj < xxn-1; ++xxj) { if (xxp[xxj] == '\'' && xxp[++xxj] == '\'') xxtbuff[xxk++] = '\''; else if (xxp[xxj] == '"') { xxtbuff[xxk++] = '"'; xxtbuff[xxk++] = '"'; } else xxtbuff[xxk++] = xxp[xxj]; } xxtbuff[xxk++] = '"'; xxtbuff[xxk] = '\0'; free(xxp); yylval = xxtbuff; xxbp = -1; return(xxstring); } ^\n xxbp = -1; \n {xxbp = -1; if (newflag) {fixval(); return('\n'); } } {SP} {fixval(); xxbp = -1; return(yytext[0]); } %% rdchar() { int c; if (xxunbp >= 0) return(xxunbuf[xxunbp--]); c = getchar(); if (c == EOF) return('\0'); else return((char)c); } backup(c) char c; { if (++xxunbp > xxunmax) { xxunbuf[xxunmax + 1] = '\0'; error("RATFOR beautifying; input backed up too far during lex:\n", xxunbuf,"\n"); } xxunbuf[xxunbp] = c; } nunput(c) char c; { backup(c); if (xxbp < 0) return; if (c != xxbuf[xxbp]) { xxbuf[xxbp + 1] = '\0'; error("RATFOR beautifying; lex call of nunput with wrong char:\n", xxbuf,"\n"); } for ( --xxbp; xxbp >= 0 && (xxbuf[xxbp] == ' ' || xxbuf[xxbp] == '\t'); --xxbp) backup(xxbuf[xxbp]); xxbuf[xxbp+1] = '\0'; } ninput() { char c,d; if (blflag) c = rdchar(); else while ( (c = rdchar()) == ' ' || c == '\t') addbuf(c); if (c != '\n') return(addbuf(c)); while ( (d = rdchar()) == ' ' || d == '\t'); if (d == '&') return(ninput()); backup(d); return(addbuf('\n')); } addbuf(c) char c; { if (++xxbp > xxbpmax) { xxbuf[xxbpmax +1] = '\0'; error("RATFOR beautifying; buffer xxbuf too small for token beginning:\n", xxbuf,"\n"); } xxbuf[xxbp] = c; xxbuf[xxbp + 1] = '\0'; return(c); } fixval() { int i, j, k; for (j = 0; xxbuf[j] == ' ' || xxbuf[j] == '\t'; ++j); for (k = j; xxbuf[k] != '\0'; ++k); for (--k; k > j && xxbuf[k] == ' ' || xxbuf[k] == '\t'; --k); xxbuf[k+1] = '\0'; i = slength(&xxbuf[j]) + 1; yylval = malloc(i); str_copy(&xxbuf[j],yylval,i); } putback(str) char *str; { int i; for (i = 0; str[i] != '\0'; ++i); for (--i; i >= 0; --i) backup(str[i]); } fcmd/struct/main.c 644 0 33 2053 2111463512 7205 #include #include #include "1.defs.h" #include "def.h" char (*input)(), (*unput)(); FILE *outfd = stdout; main(argc,argv) int argc; char *argv[]; { int anyoutput; int dexit(); char *getargs(); char input1(), unput1(), input2(), unput2(); anyoutput = FALSE; getargs(argc,argv); if (debug == 2) debfd = stderr; else if (debug) debfd = fopen("debug1","w"); if (signal(SIGINT, SIG_IGN) !=SIG_IGN) signal(SIGINT,dexit); prog_init(); for (;;) { ++routnum; routerr = 0; input = input1; unput = unput1; if (!mkgraph()) break; if (debug) prgraph(); if (routerr) continue; if (progress)fprintf(stderr,"build:\n"); build(); if (debug) prtree(); if (routerr) continue; if (progress)fprintf(stderr,"structure:\n"); structure(); if (debug) prtree(); if (routerr) continue; input = input2; unput = unput2; if (progress)fprintf(stderr,"output:\n"); output(); if (routerr) continue; anyoutput = TRUE; freegraf(); } if (anyoutput) exit(0); else exit(1); } dexit() { exit(1); } (!mkgraph()) break; if (debug) prgraph(); if (routerr) continue; if (progress)fprintf(stderr,"build:\n"); build(); if (debug) prtree(); if (routerr) continue; if (progress)fprintf(stderr,"structure:\n"); structure(); if (debug) prtree(); if (routerr) continue; input = input2; unput = unput2; if (progress)fprintf(stderr,"output:\n"); output(); if (routerr) continue; anyoutput = TRUE; freegraf(); } if (anyoutput) exit(0); elcmd/struct/struct 755 0 33 466 2111463512 7355 trap "rm -f /tmp/struct*$$" 0 1 2 3 13 15 files=no for i do case $i in -*) ;; *) files=yes esac done case $files in yes) /usr/lib/struct/structure $* >/tmp/struct$$ ;; no) cat >/tmp/structin$$ /usr/lib/struct/structure /tmp/structin$$ $* >/tmp/struct$$ esac && /usr/lib/struct/beautify addroot(string,type,n1,n2) char *string; int type; struct node *n1, *n2; { struct node *p; p = malloc(sizeof(*p)); p->left = n1; p->right = n2; p->op = type; p->lit = malloc(slength(string) + 1); str_copy(string,p->lit,slength(string) + 1); return(p); } freetree(tree) struct node *tree; { if (tree) {freetree(tree->left); freetree(tree->right); freenode(tree); } } freenode(treenode) struct node *treenode; { free(treenode->lit); free(treenode); } int compop[] { '&', '|', '<', '>', xxeq, xxle, xxne, xxge}; int notop[] { '|', '&', xxge, xxle, xxne, '>', xxeq, '<'}; char *opstring[] { "||", "&&", ">=", "<=", "!=", ">", "==", "<"}; checkneg(tree,neg) /* eliminate nots if possible */ struct node *tree; int neg; { int i; struct node *t; if (!tree) return(0); for (i = 0; i < 8; ++i) if (tree->op == compop[i]) break; if (i > 1 && i < 8 && tree ->left ->op == '-' && str_eq(tree->right->lit,"0")) { t = tree->right; tree->right = tree->left->right; freenode(t); t = tree->left; tree->left = tree->left->left; freenode(t); } if (neg) { if (tree ->op == '!') { t = tree->left; freenode(tree); return(checkneg(t,0)); } if (i < 8) { tree->op = notop[i]; free(tree->lit); tree->lit = malloc(slength(opstring[i])+1); str_copy(opstring[i],tree->lit, slength(opstring[i])+1); if (tree->op == '&' || tree->op == '|') { tree->left = checkneg(tree->left,1); tree->right = checkneg(tree->right,1); } return(tree); } if (tree->op == xxident && str_eq(tree->lit,".false.")) str_copy(".true.",tree->lit, slength(".true.")+1); else if (tree->op == xxident && str_eq(tree->lit,".true.")) { free(tree->lit); tree->lit = malloc(slength(".false.")+1); str_copy(".false.",tree->lit, slength(".false.")+1); } else { tree = addroot("!",'!',tree,0); tree->lit = malloc(2); str_copy("!",tree->lit, slength("!")+1); } return(tree); } else if (tree->op == '!') { t = tree; tree = tree->left; freenode(t); return(checkneg(tree,1)); } else {tree->left = checkneg(tree->left,0); tree->right = checkneg(tree->right,0); return(tree); } } yield(tree,fprec) struct node *tree; int fprec; /* fprec is precedence of father of this node */ { int paren,p; static int oplast; /* oplast = 1 iff last char printed was operator */ if (!tree) return; p = prec(tree ->op); paren = (p < fprec || (oplast && tree->op == xxuminus)) ? 1 : 0; if (paren) { putout('(',"("); oplast = 0; } switch(tree->op) { case xxuminus: tree->op = '-'; case '!': putout(tree->op,tree->lit); oplast = 1; yield(tree->left,p); break; case '&': case '|': case '<': case '>': case xxeq: case xxle: case xxge: case '+': case '-': case '*': case '/': case '^': yield(tree->left,p); putout(tree->op, tree->lit); oplast = 1; yield(tree->right,p); break; case xxidpar: yield(tree->left,0); putout('(',"("); oplast = 0; yield(tree->right,0); putout('(',")"); oplast = 0; break; default: yield(tree->left,p); putout(tree->op, tree->lit); oplast = 0; yield(tree->right,p); break; } if (paren) { putout(')',")"); oplast = 0; } } puttree(tree) struct node *tree; { yield(tree,0); freetree(tree); } prec(oper) int oper; { switch(oper) { case ',': return(0); case '|': return(1); case '&': return(2); case '!': return(3); case '<': case '>': case xxeq: case xxne: case xxle: case xxge: return(4); case '+': case '-': return(5); case '*': case '/': return(6); case xxuminus: return(7); case '^': return(8); default: return(9); } } str_copy(s,ptr,length) /* copy s at ptr, return length of s */ char *s, *ptr; int length; {int i; for (i = 0; i < length; i++) { ptr[i] = s[i]; if (ptr[i] == '\0') return(i + 1); } fprintf(2,"string %s too long to be copied by str_copy at address %d\n", *s,ptr); exit(1); } str_e((q(s,t) char s[],t[]; {int j; for (j = 0; s[j] == t[j]; j++) {if (s[j] == '\0') return(1);} return(0); } slength(s) /* return number of chars in s, not counting '\0' */ char *s; { int i; if (!s) return(-1); for (i = 0; s[i] != '\0'; i++); return(i); } th of s */ char *s, *ptr; int length; {int i; for (i = 0; i < length; i++) { ptr[i] = s[i]; if (ptr[i] == '\0') return(i + 1); } fprintf(2,"string %s too long to be copied by str_copy at address %d\n", *s,ptr); exit(1); } str_ecmd/tbl/ 775 0 33 0 2552566333 5305 cmd/tbl/Makefile 644 0 33 2412 2254671635 7030 CFLAGS=-O o = t0.o t1.o t2.o t3.o t4.o t5.o t6.o t7.o t8.o t9.o\ tb.o tc.o te.o tf.o tg.o ti.o tm.o ts.o tt.o tu.o tv.o tbl : $o $(CC) $o -o tbl $o : t..c install: install -s tbl $(DESTDIR)/usr/bin clean : rm -f *.o test: sh compr sample01 sh compr sample02 sh compr sample03 sh compr sample04 sh compr sample05 sh compr sample06 sh compr sample07 sh compr sample08 sh compeq sample09 sh compeq sample10 sh compeq sample11 sh compr sample12 sh compr sample13 sh compr sample14 sh compr sample15 sh compr sample16 sh compr sample17 sh compr sample18 sh compr sample19 sh compr sample20 sh compr sample21 sh compr sample22 sh compr sample23 sh compms sample24 sh compr sample25 sh compr sample26 sh compr sample27 sh compr sample28 sh compr sample29 sh compr sample30 sh compr sample31 sh compr sample32 sh compr sample33 sh compms sample34 sh compeq sample35 sh compeq sample36 sh compnr sample37 sh compr sample38 sh compr sample39 sh compr sample40 sh compr sample41 sh compr sample42 sh compr sample43 sh compr sample44 sh compms sample45 sh compms sample46 sh compr sample47 sh compnr sample48 sh compeq /usr/doc/mel/tables ichk: /usr/bin/tbl /usr/bin/tbl sample1 >junk1 cmp -s junk1 out1 comp: tbl cmp -s tbl /usr/bin/tbl r sample29 sh compr sample30 sh compr sample31 sh compr sample32 sh compr sample33 sh compms sample34 sh compeq sample35 sh compeq sample36 sh compnr sample37 sh compr sample38 sh compr sample39 sh compr sample40 sh compr sample41 shcmd/tbl/t..c 644 0 33 3044 2111463514 6042 /* t..c : external declarations */ # include "stdio.h" # include "ctype.h" # define MAXLIN 200 # define MAXHEAD 30 # define MAXCOL 20 # define MAXCHS 2000 # define MAXRPT 100 # define CLLEN 10 # define SHORTLINE 4 extern int nlin, ncol, iline, nclin, nslin; extern int style[MAXHEAD][MAXCOL]; extern int ctop[MAXHEAD][MAXCOL]; extern char font[MAXHEAD][MAXCOL][2]; extern char csize[MAXHEAD][MAXCOL][4]; extern char vsize[MAXHEAD][MAXCOL][4]; extern char cll[MAXCOL][CLLEN]; extern int stynum[]; extern int F1, F2; extern int lefline[MAXHEAD][MAXCOL]; extern int fullbot[]; extern char *instead[]; extern int expflg; extern int ctrflg; extern int evenflg; extern int evenup[]; extern int boxflg; extern int dboxflg; extern int linsize; extern int tab; extern int pr1403; extern int linsize, delim1, delim2; extern int allflg; extern int textflg; extern int left1flg; extern int rightl; struct colstr {char *col, *rcol;}; extern struct colstr *table[]; extern char *cspace, *cstore; extern char *exstore, *exlim; extern int sep[]; extern int used[], lused[], rused[]; extern int linestop[]; extern int leftover; extern char *last, *ifile; extern int texname; extern int texct, texmax; extern char texstr[]; extern int linstart; extern FILE *tabin, *tabout; # define CRIGHT 80 # define CLEFT 40 # define CMID 60 # define S1 31 # define S2 32 # define TMP 38 # define SF 35 # define SL 34 # define LSIZE 33 # define SIND 37 # define SVS 36 /* this refers to the relative position of lines */ # define LEFT 1 # define RIGHT 2 # define THRU 3 # define TOP 1 # define BOT 2 rused[]; extern int linestop[]; extern int leftover; extern char *last, *ifile; extern int texname; extern int texct, texmax; extern char texstr[]; extern int linstart; extern FILE *tabin, *tabout; # define CRIGHT 80 # define CLEFT 40 # define CMID 60 # define S1 31 # define S2 32 # define TMP 38 # define SF 35 # define SL 34 # define LSIZE 33 # define SIND 37 # define SVS 36 /* this refers to the relative position of lines */ # define LEFT 1 # define RIGHT 2 # define Tcmd/tbl/t0.c 644 0 33 2064 2111463514 6045 /* t0.c: storage allocation */ # # include "t..c" int expflg = 0; int ctrflg = 0; int boxflg = 0; int dboxflg = 0; int tab = '\t'; int linsize; int pr1403; int delim1, delim2; int evenup[MAXCOL], evenflg; int F1 = 0; int F2 = 0; int allflg = 0; int leftover = 0; int textflg = 0; int left1flg = 0; int rightl = 0; char *cstore, *cspace; char *last; struct colstr *table[MAXLIN]; int style[MAXHEAD][MAXCOL]; int ctop[MAXHEAD][MAXCOL]; char font[MAXHEAD][MAXCOL][2]; char csize[MAXHEAD][MAXCOL][4]; char vsize[MAXHEAD][MAXCOL][4]; int lefline[MAXHEAD][MAXCOL]; char cll[MAXCOL][CLLEN]; /*char *rpt[MAXHEAD][MAXCOL];*/ /*char rpttx[MAXRPT];*/ int stynum[MAXLIN+1]; int nslin, nclin; int sep[MAXCOL]; int fullbot[MAXLIN]; char *instead[MAXLIN]; int used[MAXCOL], lused[MAXCOL], rused[MAXCOL]; int linestop[MAXLIN]; int nlin, ncol; int iline = 1; char *ifile = "Input"; int texname = 'a'; int texct = 0; char texstr[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYXZ0123456789"; int linstart; char *exstore, *exlim; FILE *tabin /*= stdin */; FILE *tabout /* = stdout */; cll[MAXCOL][CLLEN]; /*char *rpt[MAXHEAD][MAXCOL];*/ /*char rpttx[MAXRPT];*/ int stynum[MAXLIN+1]; int nslin, nclin; int sep[MAXCOL]; int fullbot[MAXLIN]; char *instead[MAXLIN]; int used[MAXCOL], lused[MAXCOL], rused[MAXCOL]; int linestop[MAXLIN]; int nlin, ncol; int iline = 1; char *ifile = "Input"; int texname = 'a'; int texct = 0; char texstr[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYXZ0123456789"; int linstart; char *exstore, *exlim; FILE cmd/tbl/t1.c 644 0 33 3445 2263353034 6055 /* t1.c: main control and input switching */ # # include "t..c" #include # ifdef gcos /* required by GCOS because file is passed to "tbl" by troff preprocessor */ # define _f1 _f extern FILE *_f[]; # endif # ifdef unix # define MACROS "/usr/lib/tmac.s" # define PYMACS "/usr/lib/tmac.m" # endif # ifdef gcos # define MACROS "cc/troff/smac" # define PYMACS "cc/troff/mmac" # endif # define ever (;;) main(argc,argv) char *argv[]; { # ifdef unix int badsig(); signal(SIGPIPE, badsig); # endif # ifdef gcos if(!intss()) tabout = fopen("qq", "w"); /* default media code is type 5 */ # endif exit(tbl(argc,argv)); } tbl(argc,argv) char *argv[]; { char line[BUFSIZ]; /* required by GCOS because "stdout" is set by troff preprocessor */ tabin=stdin; tabout=stdout; setinp(argc,argv); while (gets1(line)) { fprintf(tabout, "%s\n",line); if (prefix(".TS", line)) tableput(); } fclose(tabin); return(0); } int sargc; char **sargv; setinp(argc,argv) char **argv; { sargc = argc; sargv = argv; sargc--; sargv++; if (sargc>0) swapin(); } swapin() { while (sargc>0 && **sargv=='-') /* Mem fault if no test on sargc */ { if (sargc<=0) return(0); if (match("-ms", *sargv)) { *sargv = MACROS; break; } if (match("-mm", *sargv)) { *sargv = PYMACS; break; } if (match("-TX", *sargv)) pr1403=1; sargc--; sargv++; } if (sargc<=0) return(0); # ifdef unix /* file closing is done by GCOS troff preprocessor */ if (tabin!=stdin) fclose(tabin); # endif tabin = fopen(ifile= *sargv, "r"); iline=1; # ifdef unix /* file names are all put into f. by the GCOS troff preprocessor */ fprintf(tabout, ".ds f. %s\n",ifile); # endif if (tabin==NULL) error("Can't open file"); sargc--; sargv++; return(1); } # ifdef unix badsig() { signal(SIGPIPE, SIG_IGN); exit(0); } # endif "-TX", *sargv)) pr1403=1; sargc--; sargv++; } if (sargc<=0) return(0); # ifdef unix /* file closing is done by GCOS troff preprocessor */ if (tabin!=stdin) fclose(tabin); # endif tabin = fopen(ifile= *sargv, "((cmd/tbl/t2.c 644 0 33 405 2111463514 6024 /* t2.c: subroutine sequencing for one table */ # include "t..c" tableput() { saveline(); savefill(); ifdivert(); cleanfc(); getcomm(); getspec(); gettbl(); getstop(); checkuse(); choochar(); maktab(); runout(); release(); rstofill(); endoff(); restline(); } , SIG_IGN); exit(0); } # endif "-TX", *sargv)) pr1403=1; sargc--; sargv++; } if (sargc<=0) return(0); # ifdef unix /* file closing is done by GCOS tro/,5< /,"cmd/tbl/t3.c 644 0 33 3246 2111463514 6053 /* t3.c: interpret commands affecting whole table */ # include "t..c" struct optstr {char *optnam; int *optadd;} options [] = { "expand", &expflg, "EXPAND", &expflg, "center", &ctrflg, "CENTER", &ctrflg, "box", &boxflg, "BOX", &boxflg, "allbox", &allflg, "ALLBOX", &allflg, "doublebox", &dboxflg, "DOUBLEBOX", &dboxflg, "frame", &boxflg, "FRAME", &boxflg, "doubleframe", &dboxflg, "DOUBLEFRAME", &dboxflg, "tab", &tab, "TAB", &tab, "linesize", &linsize, "LINESIZE", &linsize, "delim", &delim1, "DELIM", &delim1, 0,0}; getcomm() { char line[200], *cp, nb[25], *t; struct optstr *lp; int c, ci, found; for(lp= options; lp->optnam; lp++) *(lp->optadd) = 0; texname = texstr[texct=0]; tab = '\t'; printf(".nr %d \\n(.s\n", LSIZE); gets1(line); /* see if this is a command line */ if (index(line,';') == NULL) { backrest(line); return; } for(cp=line; (c = *cp) != ';'; cp++) { if (!letter(c)) continue; found=0; for(lp= options; lp->optadd; lp++) { if (prefix(lp->optnam, cp)) { *(lp->optadd) = 1; cp += strlen(lp->optnam); if (letter(*cp)) error("Misspelled global option"); while (*cp==' ')cp++; t=nb; if ( *cp == '(') while ((ci= *++cp) != ')') *t++ = ci; else cp--; *t++ = 0; *t=0; if (lp->optadd == &tab) { if (nb[0]) *(lp->optadd) = nb[0]; } if (lp->optadd == &linsize) printf(".nr %d %s\n", LSIZE, nb); if (lp->optadd == &delim1) { delim1 = nb[0]; delim2 = nb[1]; } found=1; break; } } if (!found) error("Illegal option"); } cp++; backrest(cp); return; } backrest(cp) char *cp; { char *s; for(s=cp; *s; s++); un1getc('\n'); while (s>cp) un1getc(*--s); return; } = *++cp) != ')') *t++ = ci; else cp--; *t++ = 0; *t=0; if (lp->optadd == &tab) { if (nb[0]) *(lp->optadd) = nb[0]; } if (lp->optadd == &linsize) printf(".nr %d %s\n", LSIZE, nb); if (lp->optadd == &delim1) { delim1 = nb[0]; delim2 = nb[1]; } found=1; break; } } if (!found) ecmd/tbl/t4.c 644 0 33 12213 2111463514 6066 /* t4.c: read table specification */ # include "t..c" int oncol; getspec() { int icol, i; for(icol=0; icol0) {ncol++; rightl++;}; if(sawchar) nclin++; if (nclin>=MAXHEAD) error("too many lines in specification"); icol=0; if (ncol==0 || nclin==0) error("no specification"); if (c== '.') { while ((c=get1char()) && c != '\n') if (c != ' ' && c != '\t') error("dot not last character on format line"); /* fix up sep - default is 3 except at edge */ for(icol=0; icol=MAXCOL) error("too many columns in table"); sawchar=1; continue; case 'b': case 'i': c += 'A'-'a'; case 'B': case 'I': if (icol==0) continue; snp=font[nclin][icol-1]; snp[0]= (c=='I' ? '2' : '3'); snp[1]=0; continue; case 't': case 'T': if (icol>0) ctop[nclin][icol-1] = 1; continue; case 'd': case 'D': if (icol>0) ctop[nclin][icol-1] = -1; continue; case 'f': case 'F': if (icol==0) continue; snp=font[nclin][icol-1]; snp[0]=snp[1]=stopc=0; for(i=0; i<2; i++) { c = get1char(); if (i==0 && c=='(') { stopc=')'; c = get1char(); } if (c==0) break; if (c==stopc) {stopc=0; break;} if (stopc==0) if (c==' ' || c== tab ) break; if (c=='\n'){un1getc(c); break;} snp[i] = c; if (c>= '0' && c<= '9') break; } if (stopc) if (get1char()!=stopc) error("Nonterminated font name"); continue; case 'P': case 'p': if (icol<=0) continue; temp = snp = csize[nclin][icol-1]; while (c = get1char()) { if (c== ' ' || c== tab || c=='\n') break; if (c=='-' || c == '+') if (snp>temp) break; else *snp++=c; else if (digit(c)) *snp++ = c; else break; if (snp-temp>4) error("point size too large"); } *snp = 0; if (atoi(temp)>36) error("point size unreasonable"); un1getc (c); continue; case 'V': case 'v': if (icol<=0) continue; temp = snp = vsize[nclin][icol-1]; while (c = get1char()) { if (c== ' ' || c== tab || c=='\n') break; if (c=='-' || c == '+') if (snp>temp) break; else *snp++=c; else if (digit(c)) *snp++ = c; else break; if (snp-temp>4) error("vertical spacing value too large"); } *snp=0; un1getc(c); continue; case 'w': case 'W': snp = cll [icol-1]; /* Dale Smith didn't like this check - possible to have two text blocks of different widths now .... if (*snp) { fprintf(tabout, "Ignored second width specification"); continue; } /* end commented out code ... */ stopc=0; while (c = get1char()) { if (snp==cll[icol-1] && c=='(') { stopc = ')'; continue; } if ( !stopc && (c>'9' || c< '0')) break; if (stopc && c== stopc) break; *snp++ =c; } *snp=0; if (snp-cll[icol-1]>CLLEN) error ("column width too long"); if (!stopc) un1getc(c); continue; case 'e': case 'E': if (icol<1) continue; evenup[icol-1]=1; evenflg=1; continue; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': sn[0] = c; snp=sn+1; while (digit(*snp++ = c = get1char())) ; un1getc(c); sep[icol-1] = max(sep[icol-1], numb(sn)); continue; case '|': lefline[nclin][icol]++; if (icol==0) left1flg=1; continue; } } error("EOF reading table specification"); } pc) un1getc(c); continue; case 'e': case 'E': if (icol<1) continue; evenup[icol-1]=1; evenflg=1; continue; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': sn[0] = c; snp=sn+1; while (digit(*snp++ = c = get1char())) ; un1getc(c); sep[icol-1] = max(sep[icol-1], numb(sn)); cocmd/tbl/t5.c 644 0 33 6071 2111463514 6054 (( /* t5.c: read data for table */ # include "t..c" gettbl() { int icol, ch; cstore=cspace= chspace(); textflg=0; for (nlin=nslin=0; gets1(cstore); nlin++) { stynum[nlin]=nslin; if (prefix(".TE", cstore)) { leftover=0; break; } if (prefix(".TC", cstore) || prefix(".T&", cstore)) { readspec(); nslin++; } if (nlin>=MAXLIN) { leftover=cstore; break; } fullbot[nlin]=0; if (cstore[0] == '.' && !isdigit(cstore[1])) { instead[nlin] = cstore; while (*cstore++); continue; } else instead[nlin] = 0; if (nodata(nlin)) { if (ch = oneh(nlin)) fullbot[nlin]= ch; nlin++; nslin++; instead[nlin]=fullbot[nlin]=0; } table[nlin] = alocv((ncol+2)*sizeof(table[0][0])); if (cstore[1]==0) switch(cstore[0]) { case '_': fullbot[nlin]= '-'; continue; case '=': fullbot[nlin]= '='; continue; } stynum[nlin] = nslin; nslin = min(nslin+1, nclin-1); for (icol = 0; icol MAXCHS) cstore = cspace = chspace(); } last = cstore; permute(); if (textflg) untext(); return; } nodata(il) { int c; for (c=0; c=nlin)return(0); if (instead[ir]) return(0); if (ifform==0 && ctype(ir,ij)=='^') return(1); if (table[ir][ij].rcol!=0) return(0); if (fullbot[ir]) return(0); return(vspen(table[ir][ij].col)); } vspen(s) char *s; { if (s==0) return(0); if (!point(s)) return(0); return(match(s, SPAN)); } .col = start; table[irow][jcol].rcol = strig; while (is=nlin)return(0); if (instead[ir]) return(0); if (ifform==0 && ctype(ir,ij)=='^') return(1); if (table[ir][ij].rcol!=0) return(0); if (fullbot[ir]) return(0); return(vspen(table[ir][ij].col)); } vspen(s) char *s; { if (s==0) returncmd/tbl/t6.c 644 0 33 14102 2111463514 6067 /* t6.c: compute tab stops */ # define tx(a) (a>0 && a<128) # include "t..c" maktab() { # define FN(i,c) font[stynum[i]][c] # define SZ(i,c) csize[stynum[i]][c] /* define the tab stops of the table */ int icol, ilin, tsep, k, ik, vforml, il, text; int doubled[MAXCOL], acase[MAXCOL]; char *s; for(icol=0; icol =0 && vspen(table[il][icol].col); il=prev(il)) vforml=il; if (fspan(vforml,icol)) continue; if (filler(table[ilin][icol].col)) continue; switch(ctype(vforml,icol)) { case 'a': acase[icol]=1; s = table[ilin][icol].col; if (s>0 && s<128 && text) { if (doubled[icol]==0) fprintf(tabout, ".nr %d 0\n.nr %d 0\n",S1,S2); doubled[icol]=1; fprintf(tabout, ".if \\n(%c->\\n(%d .nr %d \\n(%c-\n",s,S2,S2,s); } case 'n': if (table[ilin][icol].rcol!=0) { if (doubled[icol]==0 && text==0) fprintf(tabout, ".nr %d 0\n.nr %d 0\n", S1, S2); doubled[icol]=1; if (real(s=table[ilin][icol].col) && !vspen(s)) { if (tx(s) != text) continue; fprintf(tabout, ".nr %d ", TMP); wide(s, FN(vforml,icol), SZ(vforml,icol)); fprintf(tabout, "\n"); fprintf(tabout, ".if \\n(%d<\\n(%d .nr %d \\n(%d\n", S1, TMP, S1, TMP); } if (text==0 && real(s=table[ilin][icol].rcol) && !vspen(s) && !barent(s)) { fprintf(tabout, ".nr %d \\w%c%s%c\n",TMP, F1, s, F1); fprintf(tabout, ".if \\n(%d<\\n(%d .nr %d \\n(%d\n",S2,TMP,S2,TMP); } continue; } case 'r': case 'c': case 'l': if (real(s=table[ilin][icol].col) && !vspen(s)) { if (tx(s) != text) continue; fprintf(tabout, ".nr %d ", TMP); wide(s, FN(vforml,icol), SZ(vforml,icol)); fprintf(tabout, "\n"); fprintf(tabout, ".if \\n(%d<\\n(%d .nr %d \\n(%d\n", icol+CRIGHT, TMP, icol+CRIGHT, TMP); } } } } if (acase[icol]) { fprintf(tabout, ".if \\n(%d>=\\n(%d .nr %d \\n(%du+2n\n",S2,icol+CRIGHT,icol+CRIGHT,S2); } if (doubled[icol]) { fprintf(tabout, ".nr %d \\n(%d\n", icol+CMID, S1); fprintf(tabout, ".nr %d \\n(%d+\\n(%d\n",TMP,icol+CMID,S2); fprintf(tabout, ".if \\n(%d>\\n(%d .nr %d \\n(%d\n",TMP,icol+CRIGHT,icol+CRIGHT,TMP); fprintf(tabout, ".if \\n(%d<\\n(%d .nr %d +(\\n(%d-\\n(%d)/2\n",TMP,icol+CRIGHT,icol+CMID,icol+CRIGHT,TMP); } if (cll[icol][0]) { fprintf(tabout, ".nr %d %sn\n", TMP, cll[icol]); fprintf(tabout, ".if \\n(%d<\\n(%d .nr %d \\n(%d\n",icol+CRIGHT, TMP, icol+CRIGHT, TMP); } for(ilin=0; ilin=0; ik--) { fprintf(tabout, "-\\n(%d",CRIGHT+icol-ik); if (!expflg && ik>0) fprintf(tabout, "-%dn", sep[icol-ik]); } fprintf(tabout, "\n"); fprintf(tabout, ".if \\n(%d>0 .nr %d \\n(%d/%d\n", TMP, TMP, TMP, k); fprintf(tabout, ".if \\n(%d<0 .nr %d 0\n", TMP, TMP); for(ik=1; ik<=k; ik++) { if (doubled[icol-k+ik]) fprintf(tabout, ".nr %d +\\n(%d/2\n", icol-k+ik+CMID, TMP); fprintf(tabout, ".nr %d +\\n(%d\n", icol-k+ik+CRIGHT, TMP); } } } if (textflg) untext(); /* if even requested, make all columns widest width */ # define TMP1 S1 # define TMP2 S2 if (evenflg) { fprintf(tabout, ".nr %d 0\n", TMP); for(icol=0; icol\\n(%d .nr %d \\n(%d\n", icol+CRIGHT, TMP, TMP, icol+CRIGHT); } for(icol=0; icol0 .nr %d +12u\n",icol+CMID, icol+CMID); */ } tsep=sep[icol]; } if (rightl) fprintf(tabout, ".nr %d (\\n(%d+\\n(%d)/2\n",ncol+CRIGHT-1, ncol+CLEFT-1, ncol+CRIGHT-2); fprintf(tabout, ".nr TW \\n(%d\n", ncol+CRIGHT-1); if (boxflg || allflg || dboxflg) fprintf(tabout, ".nr TW +%d*\\n(%d\n", sep[ncol-1], TMP); fprintf(tabout, ".if t .if (\\n(TW+\\n(.o)>7.65i .tm Table at line %d file %s is too wide - \\n(TW units\n", iline-1, ifile); return; } wide(s, fn, size) char *s, *size, *fn; { if (point(s)) { fprintf(tabout, "\\w%c", F1); if (*fn>0) putfont(fn); if (*size) putsize(size); fprintf(tabout, "%s", s); if (*fn>0) putfont("P"); if (*size) putsize("0"); fprintf(tabout, "%c",F1); } else fprintf(tabout, "\\n(%c-", s); } filler(((s) char *s; { return (point(s) && s[0]=='\\' && s[1] == 'R'); } ol-1], TMP); fprintf(tabout, ".if t .if (\\n(TW+\\n(.o)>7.65i .tm Table at line %d file %s is too wide - \\n(TW units\n", iline-1, ifile); return; } wide(s, fn, size) char *s, *size, *fn; { if (point(s)) { fprintf(tabout, "\\w%c", F1); if (*fn>0) putfont(fn); if (*size) putsize(size); fprintf(tabout, "%s", s); if (*fn>0) putfont("P"); if (*size) putsize("0"); fprintf(tabout, "%c",F1); } else fprintf(tabout, "\\n(%c-", s); } fillercmd/tbl/t7.c 644 0 33 6060 2111463514 6054 /* t7.c: control to write table entries */ # include "t..c" # define realsplit ((ct=='a'||ct=='n') && table[ldata][c].rcol) runout() { int i; if (boxflg || allflg || dboxflg) need(); if (ctrflg) { fprintf(tabout, ".nr #I \\n(.i\n"); fprintf(tabout, ".in +(\\n(.lu-\\n(TWu-\\n(.iu)/2u\n"); } fprintf(tabout, ".fc %c %c\n", F1, F2); fprintf(tabout, ".nr #T 0-1\n"); deftail(); for(i=0; i=0 && vspen(table[lf][c].col); lf=prev(lf)) vforml=lf; if (fspan(vforml,c)) continue; switch(ct=ctype(vforml,c)) { case 'n': case 'a': if (table[ldata][c].rcol) if (lused[c]) /*Zero field width*/ fprintf(tabout, "\\n(%du ",c+CMID); case 'c': case 'l': case 'r': if (realsplit? rused[c]: (used[c]+lused[c])) fprintf(tabout, "\\n(%du ",c+CRIGHT); continue; case 's': if (lspan(lform, c)) fprintf(tabout, "\\n(%du ", c+CRIGHT); continue; } } fprintf(tabout, "\n"); } ifline(s) char *s; { if (s[0] == '\\') s++; if (s[1] ) return(0); if (s[0] == '_') return('-'); if (s[0] == '=') return('='); return(0); } need() { int texlin, horlin, i; for(texlin=horlin=i=0; i=0 .nr #%c \\n(#T\n",linestop[i]+'a'-1); if (boxflg || allflg || dboxflg) /* bottom of table line */ if (fullbot[nlin-1]==0) { if (!pr1403) fprintf(tabout, ".if \\n(T. .vs \\n(.vu-\\n(.sp\n"); fprintf(tabout, ".if \\n(T. "); drawline(nlin,0,ncol, dboxflg ? '=' : '-',1,0); fprintf(tabout, "\n.if \\n(T. .vs\n"); /* T. is really an argument to a macro but because of eqn we don't dare pass it as an argument and reference by $1 */ } for(c=0; c=0) { fprintf(tabout, ".if \\n(#%c>=0 .sp -1\n",linestop[lf]+'a'-1); fprintf(tabout, ".if \\n(#%c>=0 ", linestop[lf]+'a'-1); tohcol(c); drawvert(lf, nlin-1, c, lwid); fprintf(tabout, "\\h'|\\n(TWu'\n"); } } if (boxflg || allflg || dboxflg) /* right hand line */ { fprintf(tabout, ".if \\n(#a>=0 .sp -1\n"); fprintf(tabout, ".if \\n(#a>=0 \\h'|\\n(TWu'"); drawvert (0, nlin-1, ncol, dboxflg? 2 : 1); fprintf(tabout, "\n"); } fprintf(tabout, ".ls\n"); fprintf(tabout, "..\n"); fprintf(tabout, ".ec\n"); } ".if \\n(#%c>=0 .sp -1\n",linestop[lf]+'a'-1); fprintf(tabout, ".if \\n(#%c>=0 ", linestop[lf]+'a'-1); tohcol(c); drawvert(lf, nlin-1, c, lwid); fprintf(tabout, "\\h'|\\n(TWu'\n"); } } if (boxflg || allflg || dboxflg) /* right hand line */ { fprintf(tabout, ".if \\n(#a>=0 .sp -1\n"); fprintf(tabout, ".if \\n(#a>=0 \\h'|\\n(TWu'"); drawvert (0, nlin-1, ncol, dboxflg? 2 : 1); fprintf(tabout, "\n"); } fprintf(tabout, ".ls\n"); fprincmd/tbl/t8.c 644 0 33 16213 2111463514 6076 /* t8.c: write out one line of output table */ # include "t..c" # define realsplit ((ct=='a'||ct=='n') && table[nl][c].rcol) int watchout; int once; int topat[MAXCOL]; putline(i, nl) /* i is line number for deciding format */ /* nl is line number for finding data usually identical */ { int c, lf, ct, form, lwid, vspf, ip, cmidx, exvspen, vforml; int vct, chfont; char *s, *size, *fn; watchout=vspf=exvspen=0; if (i==0) once=0; if (i==0 && ( allflg || boxflg || dboxflg)) fullwide(0, dboxflg? '=' : '-'); if (instead[nl]==0 && fullbot[nl] ==0) for(c=0; c0 && s<128) fprintf(tabout, ".ne \\n(%c|u+\\n(.Vu\n",s); continue; } if (point(s)) continue; fprintf(tabout, ".ne \\n(%c|u+\\n(.Vu\n",s); watchout=1; } if (linestop[nl]) fprintf(tabout, ".mk #%c\n", linestop[nl]+'a'-1); lf = prev(nl); if (instead[nl]) { puts(instead[nl]); return; } if (fullbot[nl]) { switch (ct=fullbot[nl]) { case '=': case '-': fullwide(nl,ct); } return; } for(c=0; c=0) if (vspen(table[lf][c].col)) vspf=1; } if (vspf) { fprintf(tabout, ".nr #^ \\n(\\*(#du\n"); fprintf(tabout, ".nr #- \\n(#^\n"); /* current line position relative to bottom */ } vspf=0; chfont=0; for(c=0; c=0 && vspen(table[lf][c].col)) fprintf(tabout, ".if (\\n(%c|+\\n(^%c-1v)>\\n(#- .nr #- +(\\n(%c|+\\n(^%c-\\n(#--1v)\n",s,'a'+c,s,'a'+c); else fprintf(tabout, ".if (\\n(%c|+\\n(#^-1v)>\\n(#- .nr #- +(\\n(%c|+\\n(#^-\\n(#--1v)\n",s,s); } if (allflg && once>0 ) fullwide(i,'-'); once=1; runtabs(i, nl); if (allh(i) && !pr1403) { fprintf(tabout, ".nr %d \\n(.v\n", SVS); fprintf(tabout, ".vs \\n(.vu-\\n(.sp\n"); } if (chfont) fprintf(tabout, ".nr %2d \\n(.f\n", S1); fprintf(tabout, ".nr 35 1m\n"); fprintf(tabout, "\\&"); vct = 0; for(c=0; c=0) { tohcol(c); drawvert(lf, i, c, lwid); vct += 2; } if (rightl && c+1==ncol) continue; vforml=i; for(lf=prev(nl); lf>=0 && vspen(table[lf][c].col); lf=prev(lf)) vforml= lf; form= ctype(vforml,c); if (form != 's') { ct = c+CLEFT; if (form=='a') ct = c+CMID; if (form=='n' && table[nl][c].rcol && lused[c]==0) ct= c+CMID; fprintf(tabout, "\\h'|\\n(%du'", ct); } s= table[nl][c].col; fn = font[stynum[vforml]][c]; size = csize[stynum[vforml]][c]; if (*size==0)size=0; switch(ct=ctype(vforml, c)) { case 'n': case 'a': if (table[nl][c].rcol) { if (lused[c]) /*Zero field width*/ { ip = prev(nl); if (ip>=0) if (vspen(table[ip][c].col)) { if (exvspen==0) { fprintf(tabout, "\\v'-(\\n(\\*(#du-\\n(^%cu", c+'a'); if (cmidx) fprintf(tabout, "-((\\n(#-u-\\n(^%cu)/2u)", c+'a'); vct++; fprintf(tabout, "'"); exvspen=1; } } fprintf(tabout, "%c%c",F1,F2); puttext(s,fn,size); fprintf(tabout, "%c",F1); } s= table[nl][c].rcol; form=1; break; } case 'c': form=3; break; case 'r': form=2; break; case 'l': form=1; break; case '-': case '=': if (real(table[nl][c].col)) fprintf(stderr,"%s: line %d: Data ignored on table line %d\n", ifile, iline-1, i+1); makeline(i,c,ct); continue; default: continue; } if (realsplit ? rused[c]: used[c]) /*Zero field width*/ { /* form: 1 left, 2 right, 3 center adjust */ if (ifline(s)) { makeline(i,c,ifline(s)); continue; } if (filler(s)) { printf("\\l'|\\n(%du\\&%s'", c+CRIGHT, s+2); continue; } ip = prev(nl); cmidx = ctop[stynum[nl]][c]==0; if (ip>=0) if (vspen(table[ip][c].col)) { if (exvspen==0) { fprintf(tabout, "\\v'-(\\n(\\*(#du-\\n(^%cu", c+'a'); if (cmidx) fprintf(tabout, "-((\\n(#-u-\\n(^%cu)/2u)", c+'a'); vct++; fprintf(tabout, "'"); } } fprintf(tabout, "%c", F1); if (form!= 1) fprintf(tabout, "%c", F2); if (vspen(s)) vspf=1; else puttext(s, fn, size); if (form !=2) fprintf(tabout, "%c", F2); fprintf(tabout, "%c", F1); } if (ip>=0) if (vspen(table[ip][c].col)) { exvspen = (c+1 < ncol) && vspen(table[ip][c+1].col) && (topat[c] == topat[c+1]) && (cmidx == (ctop [stynum[nl]][c+1]==0)) && (left(i,c+1,&lwid)<0); if (exvspen==0) { fprintf(tabout, "\\v'(\\n(\\*(#du-\\n(^%cu", c+'a'); if (cmidx) fprintf(tabout, "-((\\n(#-u-\\n(^%cu)/2u)", c+'a'); vct++; fprintf(tabout, "'"); } } else exvspen=0; /* if lines need to be split for gcos here is the place for a backslash */ if (vct > 7 && c < ncol) { fprintf(tabout, "\n.sp-1\n\\&"); vct=0; } } fprintf(tabout, "\n"); if (allh(i) && !pr1403) fprintf(tabout, ".vs \\n(%du\n", SVS); if (watchout) funnies(i,nl); if (vspf) { for(c=0; c0) fprintf(tabout, "\\f\\n(%2d", S1); if (size!=0) putsize("0"); } } funnies( stl, lin) { /* write out funny diverted things */ int c, s, pl, lwid, dv, lf, ct; char *fn; fprintf(tabout, ".mk ##\n"); /* rmember current vertical position */ fprintf(tabout, ".nr %d \\n(##\n", S1); /* bottom position */ for(c=0; c=0 && !isalpha(ct=ctype(pl,c)); pl=prev(pl)) ; switch (ct) { case 'n': case 'c': fprintf(tabout, "(\\n(%du+\\n(%du-\\n(%c-u)/2u\n",c+CLEFT,c-1+ctspan(lin,c)+CRIGHT, s); break; case 'l': fprintf(tabout, "\\n(%du\n",c+CLEFT); break; case 'a': fprintf(tabout, "\\n(%du\n",c+CMID); break; case 'r': fprintf(tabout, "\\n(%du-\\n(%c-u\n", c+CRIGHT, s); break; } fprintf(tabout, ".in +\\n(%du\n", SIND); fn=font[stynum[stl]][c]; putfont(fn); pl = prev(stl); if (stl>0 && pl>=0 && vspen(table[pl][c].col)) { fprintf(tabout, ".sp |\\n(^%cu\n", 'a'+c); if (ctop[stynum[stl]][c]==0) { fprintf(tabout, ".nr %d \\n(#-u-\\n(^%c-\\n(%c|+1v\n",TMP, 'a'+c, s); fprintf(tabout, ".if \\n(%d>0 .sp \\n(%du/2u\n", TMP, TMP); } } fprintf(tabout, ".%c+\n",s); fprintf(tabout, ".in -\\n(%du\n", SIND); if (*fn>0) putfont("P"); fprintf(tabout, ".mk %d\n", S2); fprintf(tabout, ".if \\n(%d>\\n(%d .nr %d \\n(%d\n", S2, S1, S1, S2); } fprintf(tabout, ".sp |\\n(%du\n", S1); for(c=dv=0; c=0) { if (dv++ == 0) fprintf(tabout, ".sp -1\n"); tohcol(c); dv++; drawvert(lf, stl, c, lwid); } } if (dv) fprintf(tabout,"\n"); } putfont(fn) char *fn; { if (fn && *fn) fprintf(tabout, fn[1] ? "\\f(%.2s" : "\\f%.2s", fn); } putsize(s) char *s; { if (s && *s) fprintf(tabout, "\\s%s",s); } mk %d\n", S2); fprintf(tabout, ".if \\n(%d>\\n(%d .nr %d \\n(%d\n", S2, S1, S1, S2); } fprintf(tabout, ".sp |\\n(%du\n", S1); for(c=dv=0; c=0) { if (dv++ == 0) fprintf(tabout, ".sp -1\n"); tohcol(c); dv++; drawvert(lf, stl, c, lwid); } } if (dv) fprintf(tabout,"\n"); } putfont(fn) char *fn; { icmd/tbl/t9.c 644 0 33 2515 2111463514 6057 /* t9.c: write lines for tables over 200 lines */ # include "t..c" static useln; yetmore() { for(useln=0; useln=MAXLIN) error("Wierd. No data in table."); table[0]=table[useln]; for(useln=nlin-1; useln>=0 && (fullbot[useln] || instead[useln]); useln--); if (useln<0) error("Wierd. No real lines in table."); domore(leftover); while (gets1(cstore=cspace) && domore(cstore)) ; last =cstore; return; } domore(dataln) char *dataln; { int icol, ch; if (prefix(".TE", dataln)) return(0); if (dataln[0] == '.' && !isdigit(dataln[1])) { puts(dataln); return(1); } instead[0]=fullbot[0]=0; if (dataln[1]==0) switch(dataln[0]) { case '_': fullbot[0]= '-'; putline(useln,0); return(1); case '=': fullbot[0]= '='; putline(useln, 0); return(1); } for (icol = 0; icol =MAXVEC) error("Too many characters in table"); spvecs[spcount++]= pp = calloc(MAXCHS+200,1); if (pp== -1 || pp == 0) error("no space for characters"); return(pp); } # define MAXPC 50 char *thisvec; int tpcount = -1; char *tpvecs[MAXPC]; alocv(n) { int *tp, *q; if (tpcount<0 || thisvec+n > tpvecs[tpcount]+MAXCHS) { tpcount++; if (tpvecs[tpcount]==0) { tpvecs[tpcount] = calloc(MAXCHS,1); } thisvec = tpvecs[tpcount]; if (thisvec == -1) error("no space for vectors"); } tp=thisvec; thisvec+=n; for(q=tp; q= 128 || s<0); } st funny character */ for( s="\002\003\005\006\007!%&#/?,:;<=>@`^~_{}+-*ABCDEFGHIJKMNOPQRSTUVWXYZabcdefgjkoqrstwxyz"; *s; s++) { if (had[*s]==0) { F1= *s; had[F1]=1; break; } } /* choose second funny character */ for( s="\002\003\005\006\007:_~^`@;,<=>#%&!/?{}+-*ABCDEFGHIJKMNOPQRSTUVWXZabcdefgjkoqrstuwxyz"; *s; s++) { if (had[*s]==0) { F2= *s; break; } } if (F1==0 || F2==0) error("couldn't cmd/tbl/te.c 644 0 33 2017 2263353401 6131 /* te.c: error message control, input line count */ # include "t..c" error(s) char *s; { fprintf(stderr, "\n%s: line %d: %s\n", ifile, iline, s); # ifdef unix fprintf(stderr, "tbl quits\n"); exit(1); # endif # ifdef gcos fprintf(stderr, "run terminated due to error condition detected by tbl preprocessor\n"); exit(0); # endif } gets1(s) char *s; { char *p; int nbl = 0; iline++; p=fgets(s,BUFSIZ,tabin); while (p==0) { if (swapin()==0) return(0); p = fgets(s,BUFSIZ,tabin); } while (*s) s++; s--; if (*s == '\n') *s-- =0; for(nbl=0; *s == '\\' && s>p; s--) nbl++; if (linstart && nbl % 2) /* fold escaped nl if in table */ gets1(s+1); return(p); } # define BACKMAX 500 char backup[BACKMAX]; char *backp = backup; un1getc(c) { if (c=='\n') iline--; *backp++ = c; if (backp >= backup+BACKMAX) error("too much backup"); } get1char() { int c; if (backp>backup) c = *--backp; else c=getc(tabin); if (c== EOF) /* EOF */ { if (swapin() ==0) error("unexpected EOF"); c = getc(tabin); } if (c== '\n') iline++((; return(c); } - =0; for(nbl=0; *s == '\\' && s>p; s--) nbl++; if (linstart && nbl % 2) /* fold escaped nl if in table */ gets1(s+1); return(p); } # define BACKMAX 500 char backup[BACKMAX]; char *backp = backup; un1getc(c) { if (c=='\n') iline--; *backp++ = c; if (backp >= backup+BACKMAX) error("too much backup"); } get1char() { int c; if (backp>backup) c = *--backp; else c=getc(tabin); if (c== EOF) /* EOF */ { if (swapin() ==0) error("unexpected EOF"); c = getc(tabin); } if (c== '\n') iline++cmd/tbl/tf.c 644 0 33 2160 2111463515 6131 /* tf.c: save and restore fill mode around table */ # include "t..c" savefill() { /* remembers various things: fill mode, vs, ps in mac 35 (SF) */ fprintf(tabout, ".de %d\n",SF); fprintf(tabout, ".ps \\n(.s\n"); fprintf(tabout, ".vs \\n(.vu\n"); fprintf(tabout, ".in \\n(.iu\n"); fprintf(tabout, ".if \\n(.u .fi\n"); fprintf(tabout, ".if \\n(.j .ad\n"); fprintf(tabout, ".if \\n(.j=0 .na\n"); fprintf(tabout, "..\n"); fprintf(tabout, ".nf\n"); /* set obx offset if useful */ fprintf(tabout, ".nr #~ 0\n"); fprintf(tabout, ".if n .nr #~ 0.6n\n"); } rstofill() { fprintf(tabout, ".%d\n",SF); } endoff() { int i; for(i=0; i\\n(.vu .sp \\n(%du-\\n(.vu\n", S2,S2); } if (cll[icol][0]) fprintf(tabout, ".ll %sn\n", cll[icol]); else fprintf(tabout, ".ll \\n(%du*%du/%du\n",SL,ctspan(ilin,icol),ncol+1); fprintf(tabout,".if \\n(.l<\\n(%d .ll \\n(%du\n", icol+CRIGHT, icol+CRIGHT); if (ctype(ilin,icol)=='a') fprintf(tabout, ".ll -2n\n"); fprintf(tabout, ".in 0\n"); while (gets1(line)) { if (line[0]=='T' && line[1]=='}' && line[2]== tab) break; if (match("T}", line)) break; fprintf(tabout, "%s\n", line); } if (fn && *fn) fprintf(tabout, ".ft \\n(%d\n", S1); if (sz && *sz) fprintf(tabout, ".br\n.ps\n.vs\n"); fprintf(tabout, ".br\n"); fprintf(tabout, ".di\n"); fprintf(tabout, ".nr %c| \\n(dn\n", texname); fprintf(tabout, ".nr %c- \\n(dl\n", texname); fprintf(tabout, "..\n"); fprintf(tabout, ".ec \\\n"); /* copy remainder of line */ if (line[2]) tcopy (sp, line+3); else *sp=0; oname=texname; texname = texstr[++texct]; return(oname); } untext() { rstofill(); fprintf(tabout, ".nf\n"); fprintf(tabout, ".ll \\n(%du\n", SL); } ) fprintf(tabout, ".ft \\n(%d\n", S1); if (sz && *sz) fprintf(tabout, ".br\n.ps\n.vs\n"); fprintf(tabout, ".br\n"); fprintf(tabout, ".di\n"); fprintf(tabout, ".nr %c| \\ncmd/tbl/ti.c 644 0 33 1771 2111463515 6143 /* ti.c: classify line intersections */ # include "t..c" /* determine local environment for intersections */ interv(i,c) { int ku, kl; if (c>=ncol || c == 0) { if (dboxflg) { if (i==0) return(BOT); if (i>=nlin) return(TOP); return(THRU); } if (c>=ncol) return(0); } ku = i>0 ? lefdata(i-1,c) : 0; if (i+1 >= nlin) kl=0; else kl = lefdata(allh(i) ? i+1 : i, c); if (ku==2 && kl==2) return(THRU); if (ku ==2) return(TOP); if (kl==BOT) return(2); return(0); } interh(i,c) { int kl, kr; if (fullbot[i]== '=' || (dboxflg && (i==0 || i>= nlin-1))) { if (c==ncol) return(LEFT); if (c==0) return(RIGHT); return(THRU); } if (i>=nlin) return(0); kl = c>0 ? thish (i,c-1) : 0; if (kl<=1 && i>0 && allh(up1(i))) kl = c>0 ? thish(up1(i),c-1) : 0; kr = thish(i,c); if (kr<=1 && i>0 && allh(up1(i))) kr = c>0 ? thish(up1(i), c) : 0; if (kl== '=' && kr == '=') return(THRU); if (kl== '=') return(LEFT); if (kr== '=') return(RIGHT); return(0); } up1(i) { i--; while (instead[i] && i>0) i--; return(i); } fullbotcmd/tbl/tm.c 644 0 33 2035 2111463515 6141 /* tm.c: split numerical fields */ # include "t..c" maknew(str) char *str; { /* make two numerical fields */ int dpoint, c; char *p, *q, *ba; p = str; for (ba= 0; c = *str; str++) if (c == '\\' && *(str+1)== '&') ba=str; str=p; if (ba==0) { for (dpoint=0; *str; str++) { if (*str=='.' && !ineqn(str,p) && (str>p && digit(*(str-1)) || digit(*(str+1)))) dpoint=str; } if (dpoint==0) for(; str>p; str--) { if (digit( * (str-1) ) && !ineqn(str, p)) break; } if (!dpoint && p==str) /* not numerical, don't split */ return(0); if (dpoint) str=dpoint; } else str = ba; p =str; if (exstore ==0 || exstore >exlim) { exstore = chspace(); exlim= exstore+MAXCHS; } q = exstore; while (*exstore++ = *str++); *p = 0; return(q); } ineqn (s, p) char *s, *p; { /* true if s is in a eqn within p */ int ineq = 0, c; while (c = *p) { if (s == p) return(ineq); p++; if ((ineq == 0) && (c == delim1)) ineq = 1; else if ((ineq == 1) && (c == delim2)) ineq = 0; } return(0); } ot numerical, don't split */ return(0); if (dpoint) str=dpoint; } else str = ba; p =str; if (exstore ==0 || exstore >exlim) { exstore = chspace(); exlim= exstore+MAXCHS; } q = exstore; while (*exstore++ = *str++); *p = 0; return(q); } ineqn (s, p) char *s, *p; { /* true if s is in a eqn within p */ int ineq = 0, c; while (c = *p) { if (s == p) return(ineq); p++; if ((ineq == 0) && (c == delim1)) ineq = 1; else if ((ineq == 1) && (c == delim2))cmd/tbl/ts.c 644 0 33 1243 2111463515 6147 /* ts.c: minor string processing subroutines */ match (s1, s2) char *s1, *s2; { while (*s1 == *s2) if (*s1++ == '\0') return(1); else s2++; return(0); } prefix(small, big) char *small, *big; { int c; while ((c= *small++) == *big++) if (c==0) return(1); return(c==0); } letter (ch) { if (ch >= 'a' && ch <= 'z') return(1); if (ch >= 'A' && ch <= 'Z') return(1); return(0); } numb(str) char *str; { /* convert to integer */ int k; for (k=0; *str >= '0' && *str <= '9'; str++) k = k*10 + *str - '0'; return(k); } digit(x) { return(x>= '0' && x<= '9'); } max(a,b) { return( a>b ? a : b); } tcopy (s,t) char *s, *t; { while (*s++ = *t++); } ; } prefix(small, big) char *small, *big; { int c; while ((c= *small++) == *big++) if (c==0) return(1); return(c==0); } letter (ch) { if (ch >= 'a' && ch <= 'z') return(1); if (ch >= 'A' && ch <= 'Z') return(1); return(0); } numb(str) char *str; { /* convert to integer */ int k; for (k=0; *str >= '0' && *str <= '9'; str++) k = k*((cmd/tbl/tt.c 644 0 33 2567 2111463515 6162 /* tt.c: subroutines for drawing horizontal lines */ # include "t..c" ctype(il, ic) { if (instead[il]) return(0); if (fullbot[il]) return(0); il = stynum[il]; return(style[il][ic]); } min(a,b) { return(arcol : pc->col); if (s==0 || (point(s) && *s==0)) return(1); if (vspen(s)) return(1); if (t=barent( s)) return(t); return(0); } k==1) continue; one=1; } return(one); } thish(i,c) { int t; char *s; struct colstr *pc; if (c<0)return(0); if (i<0) return(0); t cmd/tbl/tu.c 644 0 33 7722 2111463515 6161 /* tu.c: draws horizontal lines */ # include "t..c" makeline(i,c,lintype) { int cr, type, shortl; type = thish(i,c); if (type==0) return; cr=c; shortl = (table[i][c].col[0]=='\\'); if (c>0 && !shortl && thish(i,c-1) == type)return; if (shortl==0) for(cr=c; cr < ncol && (ctype(i,cr)=='s'||type==thish(i,cr)); cr++); else for(cr=c+1; cr0 && vspand(prev(i),cl,1)) cl++; for(cr=cl; cr0 && vspand(prev(i),cr,1)) break; if (cl1) { switch(interv(i,cl)) { case TOP: exhl = ln==0 ? "1p" : "-1p"; break; case BOT: exhl = ln==1 ? "1p" : "-1p"; break; case THRU: exhl = "1p"; break; } if (exhl[0]) fprintf(tabout, "\\h'%s'", exhl); } else if (lcount==1) { switch(interv(i,cl)) { case TOP: case BOT: exhl = "-1p"; break; case THRU: exhl = "1p"; break; } if (exhl[0]) fprintf(tabout, "\\h'%s'", exhl); } if (lcount>1) { switch(interv(i,cr+1)) { case TOP: exhr = ln==0 ? "-1p" : "+1p"; break; case BOT: exhr = ln==1 ? "-1p" : "+1p"; break; case THRU: exhr = "-1p"; break; } } else if (lcount==1) { switch(interv(i,cr+1)) { case TOP: case BOT: exhr = "+1p"; break; case THRU: exhr = "-1p"; break; } } } else fprintf(tabout, "\\h'|\\n(%du'", cl+CLEFT); fprintf(tabout, "\\s\\n(%d",LSIZE); if (linsize) fprintf(tabout, "\\v'-\\n(%dp/6u'", LSIZE); if (shortl) fprintf(tabout, "\\l'|\\n(%du'", cr+CRIGHT); else { lnch = "\\(ul"; if (pr1403) lnch = lintype==2 ? "=" : "\\(ru"; if (cr+1>=ncol) fprintf(tabout, "\\l'|\\n(TWu%s%s'", exhr,lnch); else fprintf(tabout, "\\l'(|\\n(%du+|\\n(%du)/2u%s%s'", cr+CRIGHT, cr+1+CLEFT, exhr, lnch); } if (linsize) fprintf(tabout, "\\v'\\n(%dp/6u'", LSIZE); fprintf(tabout, "\\s0"); } if (oldpos!=0) fprintf(tabout, "\\v'%dp'", -oldpos); if (!nodata) fprintf(tabout, "\\v'+.5m'"); } getstop() { int i,c,k,junk, stopp; stopp=1; for(i=0; i=0 && linestop[k]==0) linestop[k]= ++stopp; } if (boxflg || allflg || dboxflg) linestop[0]=1; } left(i,c, lwidp) int *lwidp; { int kind, li, lj; /* returns -1 if no line to left */ /* returns number of line where it starts */ /* stores into lwid the kind of line */ *lwidp=0; kind = lefdata(i,c); if (kind==0) return(-1); if (i+1=0 && lefdata(i,c)==kind) i=prev(li=i); if (prev(li)== -1) li=0; *lwidp=kind; for(lj= i+1; lj=nlin) i=nlin-1; if (ctype(i,c) == 's') { for(ck=c; ctype(i,ck)=='s'; ck--); if (thish(i,ck)==0) return(0); } i =stynum[i]; i = lefline[i][c]; if (i>0) return(i); if (dboxflg && c==0) return(2); if (allflg)return(1); if (boxflg && c==0) return(1); return(0); } next(i) { while (i+1 =0 && (fullbot[i] || instead[i])) ; return(i); } i1) switch(interh(start,c)) { case THRU: ept += 1; break; case LEFT: ept += (ln==0 ? 1 : -1); break; case RIGHT: ept += (ln==1 ? 1 : -1); break; } else if (lwid==1) switch(interh(start,c)) { case THRU: ept += 1; break; case LEFT: case RIGHT: ept -= 1; break; } if (exb) fprintf(tabout, "\\v'%s'", exb); if (epb) fprintf(tabout, "\\v'%dp'", epb); fprintf(tabout, "\\s\\n(%d",LSIZE); if (linsize) fprintf(tabout, "\\v'-\\n(%dp/6u'", LSIZE); fprintf(tabout, "\\h'-\\n(#~u'"); /* adjustment for T450 nroff boxes */ fprintf(tabout, "\\L'|\\n(#%cu-%s", linestop[start]+'a'-1, vm=='v'? "1v" : "\\n(35u"); if (ext) fprintf(tabout, "-(%s)",ext); if (exb) fprintf(tabout, "-(%s)", exb); pos = ept-epb; if (pos) fprintf(tabout, "%s%dp", pos>=0? "+" : "", pos); /* the string #d is either "nl" or ".d" depending on diversions; on GCOS not the same */ fprintf(tabout, "'\\s0\\v'\\n(\\*(#du-\\n(#%cu+%s", linestop[start]+'a'-1,vm=='v' ? "1v" : "\\n(35u"); if (ext) fprintf(tabout, "+%s",ext); if (ept) fprintf(tabout, "%s%dp", (-ept)>0 ? "+" : "", (-ept)); fprintf(tabout, "'"); if (linsize) fprintf(tabout, "\\v'\\n(%dp/6u'", LSIZE); } } midbar(i,c) { int k; k = midbcol(i,c); if (k==0 && c>0) k = midbcol(i, c-1); return(k); } midbcol(i,c) { int ct; while ( (ct=ctype(i,c)) == 's') c--; if (ct=='-' || ct == '=') return(ct); if (ct=barent(table[i][c].col)) return(ct); return(0); } barent(s) char *s; { if (s==0) return (1); if (s[0]== '\\') s++; if (s[1]!= 0) return(0); switch(s[0]) { case '_': return('-'); case '=': return('='); } return(0); } rintf(tabout, "'"); if (linsize) fprintf(tabout, "\\v'\\n(%dp/6u'", LSIZE); } } midbar(i,c) { int k; k = midbcol(i,c); if (k==0 && c>0) k = midbcol(i, c-1); return(k); } midbcol(i,c) { int ct; while ( ((cmd/termcap/ 775 0 33 0 2552566560 6161 cmd/termcap/reorder 644 0 33 425 2427163015 7577 /|adm3|/;.,/^[^ ]/-m0 /|h19|/;.,/^[^ ]/-m0 /|mime|/;.,/^[^ ]/-m0 /|c100|/;.,/^[^ ]/-m0 /|c100rv|/;.,/^[^ ]/-m0 /|2621|/;.,/^[^ ]/-m0 /|adm3a|/;.,/^[^ ]/-m0 1,/^# ---/g/^s/.m0 0a # Mail changes to csvax:mark, csvax.mark@berkeley, or ucbvax!mark or lose them! . w termcap.obj q turn('='); } return(0); } rintf(tabout, "'"); if (linsize) fprintf(tabout, "\\v'\\n(%dp/6u'", LSIZE); } } midbar ) { int / C. /,"cmd/termcap/READ_ME 644 0 33 4113 2450540466 7254 To install this directory on your system: First determine a list of "common terminals" for your system. This list will probably be small, and can be empty if you like, but you should probably put your own terminal in it. Second, edit the editor script "reorder" to use this list instead of the list built in to it. The changes will be evident from looking at the script. Notice that the script contains the terminals in order from least common to most common, since the move commands will move them to the front in that order, the effect will be to put the most common at the front of termcap since that's moved last. The s.* terminals are specials, and although they don't have to go to the front, they are probably quite common and really should go near the front. Third, if you are not a super user and cannot create the directory /usr/lib/tabset, make a corresponding directory somewhere you can and add a line to reorder to globally change all /usr/lib/tabset's to your own path name. This change is better than just changing the termcap.src file because it makes it easier to diff it from newer distributed versions. Try to keep the source as is whenever possible, and put mungings into reorder. Now you can run "make install" which will create an /etc/termcap. Again, if you aren't a super user change the cp command to put it where you can. In this case you will have to redefine E_TERMCAP in "local/uparm.h", which will probably be in subdirectories with the other UCB software. Finally, if you make additions or fixes to termcap, please mail a note explaining what you did with the fixed termcap entry (not the whole file, please!) to me at one of the addresses below, so it can be incorporated back into the original source. I will normally include anything unless there is a good reason not to, but I reserve the right to redo it differently. csvax:mark (if on the berkeley network) ucbvax!mark or chico!ucbvax!mark (if on the BTL uucp net) csvax.mark@berkeley (if on the Arpanet) or Mark Horton Computer Science Division Evans Hall University of California Berkeley, California 94720 mcap entry (not the whole file, please!) to me at one of the addresses below, so it can be incorporated back into the original source. I will normally include anything unless there is a good reason not to, but I reserve the right to redo it differently. csvax:mark (if on the berkeley network) ucbvax!mark or chico!ucbvax!mark (if on the BTL uucp net) csvax.mark@berkeley (if on the Arpanet) or Mark Horton Computer Science Dcmd/termcap/makefile 644 0 33 742 2357515316 7723 # # reorder gives an editor command for most common terminals # (in reverse order from n'th to 1'st most commonly used) # to move them to the front of termcap # termcap.obj: termcap.src ed - termcap.src < reorder install: termcap.obj cp termcap.obj ${DESTDIR}/etc/termcap clean: rm -f termcap.obj tabset: /tmp mkdir /usr/lib/tabset cp tabset/* /usr/lib/tabset VGRIND= csh /usr/ucb/vgrind vgrind: ${VGRIND} -n -h "Terminal Capibility Data Base" \ termcap.src reorder makefile ,"cmd/termcap/termcap.src 644 0 33 111547 2552451253 10451 # Termcap source file %W% %G% # Mark Horton, U.C. Berkeley # # This file describes capabilities of various terminals, as needed by # software such as screen editors. It does not attempt to describe # printing terminals very well, nor graphics terminals. Someday. # See termcap(5) in the Unix Programmers Manual for documentation. # # The A manufacturer represents Diablo, DTC, Xerox, Qume, and other Daisy # wheel terminals until such time as termcap distinguishes between them # enough to justify separate codes. # 1620 uses all 132 columns, 1640 sets left margin to 8 and uses snazzy # binary tabset file. Both should work on both terminals. A6|1620|450|diablo 1620:\ :if=/usr/lib/tabset/std:\ :kb=^H:bs:co#132:ff=^L:hc:hu=\EU:hd=\ED:os:pt:up=\E\n: A7|1640|diablo 1640:\ :co#124:if=/usr/lib/tabset/diablo:tc=1620: Ad|dtc300s|300|300s|gsi|dtc|dtc 300s:\ :if=/usr/lib/tabset/std:\ :kb=^h:bs:co#132:ff=^L:hc:hu=\EH:hd=\Eh:os:pt:up=^Z: Ag|gsi:bs:co#132:hc:hd=\Eh:hu=\EH:os:pt:up=^Z: Aj|aj830|aj832|aj|anderson jacobson:\ :bs:hc:hd=\E9:hu=\E8:os:pl:up=\E7: Aq|qume5|qume|Qume Sprint 5:\ :if=/usr/lib/tabset/std:\ :kb=^h:bs:co#80:ff=^L:hc:hu=\EH:hd=\Eh:os:pt:up=^Z: Ax|x1720|x1700|1700|x1750|xerox 1720:co#132:bs:ff=^L:hc:os:pt:if=/usr/lib/tabset/xerox1720 Ca|cdc456|cdc:\ :li#24:co#80:cl=^Y^X:nd=^L:up=^Z:bs:\ :cm=\E1%+ %+ :ho=^Y:al=\E\114:dl=\E\112:ce=^V:cd=^X:am: Cc|cdc456tst:\ :li#24:co#80:cl=^y^x:bs:cm=\E1%+ %+ :am: D0|dm1520|dm1521|1521|1520|datamedia 1520:\ :am:bs:cd=^K:ce=^]:cl=^L:cm=^^%r%+ %.:co#80:ho=^Y:\ :ku=^_:kd=^J:kl=^H:kr=^\:kh=^Y:\ :li#24:nd=^\:up=^_:xn:ma=^\ ^_^P^YH:pt: D1|dm1521|1521|datamedia 1521:\ :am:bs:cd=^K:ce=^]:cl=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:ve=\E[0q\E?4h:\ :kd=\E[B:kl=\E[D:kr=\E[C:ku=\E[A:\ :sr=\EM:\ :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS: D6|dt80132|dmdt80132|datamedia dt80/1 in 132 char mode:\ :bs:cd=20^[[0J:co#132:ce=20^[[0K:kd=^[[B:kl=^[[D:kr=^[[C:ku=^[[A:\ :li#24:cm=5^[[%i%d;%dH:cl=50^[[H^[[2J:nd=^[[C:up=5^[[A: ED|delta|dd5000|delta data 5000:\ :am:bs:cl=^NR:cm=^O%D%+9%D%+9:co#80:li#27:ho=^NQ:nc:nd=^Y:\ :up=^Z:ce=^NU:dc=^NV:ma=^K^J^Z^P^Y :xr: # Since nd is blank, when you want to erase something you # are out of luck. You will have to do ^L's a lot to # redraw the screen. h1000 is untested. It doesn't work in # vi - this terminal is too dumb for even vi. (The code is # there but it isn't debugged for this case.) H1|h1000|hazeltine 1000:bs:ho=^K:cl=^L:nd= :co#80:li#12: # Note: the h1552 appears to be the first Hazeltine terminal which # is not braindamaged. It has tildes and backprimes and everything! # Be sure the auto lf/cr switch is set to cr. H2|h1552|hazeltine 1552:\ :al=\EE:dl=\EO:f1=\EP:l1=blue:f2=\EQ:l2=red:f3=\ER:l3=green:tc=vt52: H3|h1552rv|hazeltine 1552 reverse video:\ :so=\ES:se=\ET:tc=h1552: H5|h1500|hazeltine 1500:\ :al=40~^Z:am:bs:cd=10~^X:ce=~^O:cl=~^\:cm=~^Q%r%.%.:co#80:\ :dl=40~^S:do=~^K:li#24:nd=^P:.se=~^_:.so=~^Y:up=~^L: # h1510 assumed to be in sane escape mode. Else use h1500((. H6|h1510|hazeltine 1510:\ :al=\E^Z:am:bs:cd=\E^X:ce=\E^O:cl=\E^\:cm=\E^Q%r%.%.:co#80:\ :dl=\E^S:do=\E^K:li#24:nd=^P:.se=\E^_:.so=\E^Y:up=\E^L: H8|h1520|hazeltine 1520:\ :al=~^Z:am:bs:cd=~^X:ce=~^O:cl=~\034:cm=~^Q%r%.%.\200:co#80:\ :dl=~^S:do=~^K:hz:li#24:nd=^P:se=~^Y:so=~\037:up=~^L:ho=~^R: # Note: h2000 won't work well because of a clash between upper case and ~'s. H7|h2000|hazeltine 2000:\ :al=6~^z:am:bs:cl=6~^\:cm=~^q%r%.%.:co#74:\ :dl=6~^s:ho=~^r:li#27:nc:pc=\177: # One of these should go in the misc category, IBM and ISC can't # both have I. I will wait to see who comes out with more terminals. I8|8001|ISC8001:al=\EU:am:bc=^Z:cl=3*^L:cm=^C%r%.%.:co#80:\ :cd=\EQ:dm=\EQ:ed=\EF:\ :dc=\177:dl=\EV:ei=\EF:im=\EQ:li#40:nd=1^Y:ta=8\t:\ :up=^\:ho=1^H:pc=^@: It|intext|ISC modified owl 1200:\ :al=5.5*\020:am:bc=\037:bs:cd=5.5*\026J:cl=132\014:\ :cm=\017%+ %+ :co#80:dc=5.5*\022:dl=5.5*\021:\ :ei=\026\074:im=\026\073:ip=5.5*:in:li#24:nd=\036:up=\034:\ :ma=^K^P^R^L^L :kl=^H:kd=^J:kr=^L:ku=^K: I9|ibm|ibm3101|3101|i3101|IBM 3101-10:\ :if=/usr/lib/tabset/3101:\ :am:bs:cl=^[K:li#24:co#80:nd=^[C:up=^[A:cd=^[J:ce=^[I:\ :kd=\EB:kl=\ED:kr=\EC:ku=\EA:ho=^[H:cm=\EY%+\40%+\40:pt: L3|digilog|333|digilog 333:bs:co#80:ce=\030:ho=^n:li#16:nd=^i:up=^o: # uses xon/xoff, so no padding needed. ks/ke have nothing to do with arrow # keys. is sets 80 col mode, normal video, autowrap on (for am). # Seems to be no way to get rid of status line. M1|tab132|tab|tab132/15|tab 132/15:is=\E[?7h\E[?3l\E[?5l:dN@:ks@:ke@:\ :da:db:al=\E[L:dl=\E[M:dc=\E[P:ei=\E[4l:im=\E[4h:cm=\E[%i%d;%dH:\ :ku=\E[A:kd=\E[B:kl=\E[D:tc=vt100: M2|tab132w:co#132:is=\E[?7h\E[?3h\E[?5l:tc=tab132: M3|tab132rv:is=\E[?7h\E[?3l\E[?5h:tc=tab132: M4|tab132wrv:is=\E[?7h\E[?3h\E[?5h:tc=tab132w: M5|mw2|Multiwriter 2:\ :co#132:hc:os:de#001202: M6|trs80|trs-80|radio shack trs-80 Model I:\ :am:bs:co#64:li#16: M7|d800|Direct 800/A:\ :co#80:li#24:am:cl=\E[1;1H\E[2J:bs:cm=\E[%i%d;%dH:\ :nd=\E[C:up=\E[A:ce=\E[K:cd=\E[J:\ :if=/dskb/rcd/.dinit:\ :so=\E[7m:se=\E[0m:us=\E[4m:ue=\E[0m:xs:vs=\E[>12l:ve=\E[>12h:\ :sf=\ED:sr=\EM:da:db:as=\E[1m:ae=\E[0m:ms:pt:\ :kl=\E[D:kr=\E[C:ku=\E[A:kd=\E[B:\ :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:\ :k5=\EOT:k6=\EOU:k7=\EOV:k8=\EOW: M8|vc404|volker-craig 404:\ :am:bs:cd=40^W:ce=20^V:cl=40^X:cm=^P%+ %+ :co#80:ho=40^Y:\ :kd=^J:kl=^H:kr=^U:ku=^Z:li#24:ma=^Z^P^U :nd=^U:up=^Z: M9|vc404s|volker-craig 404 w/standout mode:\ :se=^O:so=^N:tc=vc404: MA|vc404na|volker-craig 404 w/no arrow keys:ma@:kr@:ku@:tc=vc404: MB|vc404sna|volker-craig 404 w/standout mode and no arrow keys:\ :se=^O:so=^N:tc=vc404na: # missing in vc303a and vc303 descriptions: they scroll 2 lines at a time MC|vc303a|vc403a|volker-craig 303a:\ :am:bs:ce=20^V:cl=40^X:co#80:ho=40^Y:kd=^J:kl=^H::kr=^U:\ :ku=^Z:li#24:ll=^P^@W:nd=^U:ns:up=^Z: MD|vc303|vc103|vc203|volker-craig 303:\ :am:bs:cl=40^L:co#80:ho=40^K:kd=^J:kl=^H:kr=^I:ku=^N:li#24:\ :ll=^O\200W:nd=^I:ns:up=^N: ME|ampex|d80|dialogue|dialogue80|ampex dialogue 80:\ :am:bs:pt:if=/usr/lib/tabset/stdcrt:cl=\E*:cm=\E=%+ %+ :\ :al=\EE:bt=\EI:ic=\EQ:im=:ei=:dl=\ER:dc=\EW:\ :ce=\Et:cd=\Ey:so=\Ej:se=\Ek:li#24:co#80:nd=^L:up=^K: MF|aaadb|ann arbor ambassador 48/destructive backspace:\ :is=\E[48;0;0;48p\E[H\E[J\E[>30h\E[1Q\E[m:bs@:\ :vs=\E[>30l:ve=\E[>30h:tc=aaa: MG|compucolor|compucolorII:\ :pt:am:cm=%r^C%.%.:bc=^Z:li#32:co#64:\ :cl=^L:ho=^H:nd=^Y:up=^\: MH|d132|datagraphix|datagraphix 132a:\ :co#80:li#30:cl=^l:ho=\Et:da:db:sf=\Ev:sr=\Ew:\ :up=\Ek:nd=\El:vs=\ex:ve=\Em\En:\ :al=\E3:ic=\E5:dc=\E6:in:ic=\E5: MI|soroc|Soroc 120:\ :cd=\EY:ce=\ET:cl=2\E*:ma=^K^P^R^L^L :\ :kl=^H:ku=^K:kr=^L:kd=^J:tc=adm3a: Ma|aa|annarbor|ann arbor:\ :cm=^O%r%B%.%>^S^L%+@:co#80:li#40:bs:cl=2^L:up=^N:nd=^_:ho=^K:am:\ :kb=^^:kd=^J:ku=^N:kl=^H:kr=^_:kh=^K:ma=^_ ^N^P: # Needs function keys added. Also can't use 60 line mode because it needs # too much nl delay - can fix for nl but not out of vi. # The cl delay is sufficent, but a smaller one could do. # This entry is merged from Mike O'Brien@Rand and Howard Katseff at # Bell Labs, and is untested. Mb|aaa|ambas|ambassador|ann arbor ambassador/48 lines:\ :al=\E[L:am:bs:\ :cd=\E[0J:ce=\E[0K:cl=400\E[;H\E[0J:cm=\E[%i%d;%dH:co#80:\ :da:db:dc=\E[4h\E[1Q\E[P\E[4l\E[0Q:dc=\E[P:dl=\E[M:dm=\E[1Q:\ :ed=\E[0Q:ei=\E[0Q:ho=\E[;H:ic=\E[@:if=/usr/lib/tabset/aa:im=\E[1Q:\ :is=\E[48;0;0;48p\E[H\E[J\E[1Q\E[m:li#48:mi:\ :nd=\E[C:nl=\ED:pt:sf=\E[S:sr=\E[T:se=\E[m:so=\E[7m:up=\E[A: Md|datapoint|dp3|dp3360|datapoint 3360:\ :am:bs:cd^_:ce=^^:cl=^]^_:co#82:ho=^]:li#25:nd=^x:up=^z: Mg|dg|dg6053|data general 6053:\ ca:am:bs:cm=^P%r%.%.:cl=^L:ho=^H:nd=^S\ up=^W:ce=^K:co#80:li#24: Mi|cdi|cdi1203:am:bs:hc:os:co#80:cD#200: Mk|teletec|tec|Teletec Datascreen:\ :am:bs:co#80:cl=^l:ho=^^:li#24:nd=^_:up=^k: # ^S is an arrow key! Boy is this guy in for a surprise on v7! Ml|sol:\ :am:bs:cm=\E^1%.\E^2%.:cl=^K:ho=^N:co#64:li#16:nd=^S:up=^W:\ :kl=^A:kr=^S:ku=^W:kd=^Z:ma=^A^H^S ^W^P^Z^N: Mn|xl83|Cybernex XL-83:\ :am:bs:cd=62^P:ce=3^O:cl=62^L:cm=^W%+ %+ :co#80:ho=^K:\ :kd=^J:kl=^H:ku=^N:li#24:up=^N:nd=^I: Mo|omron|Omron 8025AG:\ :al=\EL:am:bs:cd=\ER:co#80:ce=\EK:cl=\EJ:da:db:dc=\EP:dl=\EM:\ :ho=\EH:li#24:nd=\EC:se=\E4:sf=\ES:so=\Ef:sr=\ET:up=\EA:ve=:vs=\EN: Mp|plasma|plasma panel:am:bs:cl=^L:co#85:ho=^^:li#45:nd=\030:up=\026: Ms|swtp|ct82|southwest technical products ct82:\ :am:bs:bc=^d:al=^\^y:cd=^v:ce=^F:cl=^L:cm=%r^k%.%.:co#82:li#20:\ :dl=^z:nd=^s:up=^a:so=^^^v:se=^^^F:dc=^\^h:ic=^\^x:ho=^p:\ :ei=:sf=^n:sr=^o:ll=^c:im=:\ :is=^\^r^^^s^^^d^]^w^i^s^^^]^^^o^]^w^r^i: Mt|terak|Terak emulating Datamedia 1520:tc=dm1520: My|mdl110|cybernex mdl-110:cm=^P%+ %+ :co#80:li#24:am:cl=70^X:bs:\ :nd=^U:up=^Z:ho=^Y:ce=145^N@^V:cd=145^NA^W:al=65^NA^N^]:\ :dl=40^NA^N^^:im=:\ :ei=:ic=3.5^NA^]:dm:ed:dc=3.5^NA^^:so=^NF:se=^NG:ta=43\t:\ :ma=^Z^P:cd=6^N@^V Mz|zen30|z30|zentec 30:\ :mi:co#80:li#24:ma=^L ^R^L^K^P:ul:\ :al=1.5*\EE:bs:ce=1.0*\ET:cm=\E=%+ %+ :cl=\E*:\ :ho=^^:nd=^L:se=\EG0;so=\EG6:up=^K:im=\Eq:ei=\Er:\ :am:dc=\EW:dl=1.5*\ER:cd=\EY: T3|33|tty33|tty|model 33 teletype:\ :co#72:hc:os: T4|43|tty43|model 43 teletype:\ :kb=^h:am:bs:hc:os:co#132: T7|37|tty37|model 37 teletype:\ :bs:hc:hu=\E8:hd=\E9:up=\E7:os: # The Visual 200 beeps when you type a character in insert mode. # This is a horribly obnoxious misfeature, and some of the entries # below try to get around the problem by ignoring the feature or # turning it off when inputting a character. They are said not to # work well at 300 baud. (You could always cut the wire to the bell!) V2|vi200|visual 200 with function keys:\ :al=\EL:am:bs:cd=\Ey:ce=4*\Ex:cl=\Ev:\ :cm=\EY%+ %+ :co#80:dc=4*\EO:dl=4*\EM:ho=\EH:\ :im=:ei=:ic=\Ei \b\Ej:\ :is=\E3\Eb\Ej\E\\\El\EG\Ed\Ek:\ :k0=\EP:k1=\EQ:k2=\ER:k3=\E :k4=\E!:k5=\E":k6=\E#:\ :k7=\E$:k8=\E%:k9=\E&:kl=\ED:kr=\EC:ku=\EA:kd=\EB:kh=\EH:\ :li#24:nd=\EC:pt:sr=\EI:up=\EA:vs=\Ed:ve=\Ec: VR|vi200rvic|visual 200 reverse video using insert char:\ :ei=\Ej:im=\Ei:ic@:tc=vi200rv: # The older Visuals didn't come with function keys. This entry uses # ks and ke so that the keypad keys can be used as function keys. # If your version of vi doesn't support function keys you may want # to use V2. Vf|vi200f|visual|visual 200 no function keys:\ :al=\EL:am:bs:cd=\Ey:ce=4*\Ex:cl=\Ev:\ :cm=\EY%+ %+ :co#80:dc=4*\EO:dl=4*\EM:ho=\EH:\ :im=:ei=:ic=\Ei \b\Ej:\ :is=\E3\Eb\Ej\E\\\El\EG\Ed\Ek:ks=\E=:ke=\E>:\ :k0=\E?p:k1=\E?q:k2=\E?r:k3=\E?s:k4=\E?t:k5=\E?u:k6=\E?v:\ :k7=\E?w:k8=\E?x:k9=\E?y:kl=\ED:kr=\EC:ku=\EA:kd=\EB:kh=\EH:\ :li#24:nd=\EC:pt:sr=\EI:up=\EA:vs=\Ed:ve=\Ec: Vr|vi200rv|visual 200 reverse video:\ :so=\E4:se=\E3:sr@:vs@:ve@:tc=vi200: Vt|vi200ic|visual 200 using insert char:\ :ei=\Ej:im=\Ei:ic@:tc=vi200: Xa|tek|tek4012|4012|tektronix 4012:\ :is=\E^O:bs:cl=1000\E^L:co#75:ns:li#35:os: Xb|tek4013|4013|tektronix 4013:\ :as=\E^N:ae=\E^O:tc=4012: Xc|tek4014|4014|tektronix 4014:\ :is=\E^O\E9:co#81:li#38:dF#1000:tc=tek4012: Xd|tek4015|4015|tektronix 4015:\ :as=\E^N:ae=\E^O:tc=4014: Xe|tek4014sm|4014sm|tektronix 4014 in small font:\ :is=\E^O\E\072:co#121:li#58:tc=tek4014: Xf|tek4015sm|4015sm|tektronix 4015 in small font:\ :as=\E^N:ae=\E^O:tc=4014sm: # I think the 1000UP is supposed to be so expensive it never happens. X4|tek4023|4023|tektronix 4023:\ :so=^_P:se=^_@:cm=\034%r%+ %+ :nd=\t:bs:cl=4\E^L:co#80:li#24:am:\ :up=1000UP: # Can't use cursor motion because it's memory relative, and because # it only works in the workspace, not the monitor. Same for home. # Likewise, standout only works in the workspace. X5|4025|4027|4024|tek4025|tek4027|tek4024|4025cu|4027cu|tektronix 4024/4025/4027:\ :is=\41com 31\r\n^_sto 9,17,25,33,41,49,57,65,73\r:\ :ks=^_lea p4 /h/\r^_lea p8 /k/\r^_lea p6 / /\r^_lea p2 /j/\r^_lea f5 /H/\r:\ :ke=^_lea p2\r^_lea p4\r^_lea p6\r^_lea p8\r^_lea f5\r:\ :am:bs:da:db:pt:li#34:co#80:cl=^_era\r\n\n:up=^K:nd=^_rig\r:\ :al=145^_up\r^_ili\r:dl=^_dli\r:\ :dc=^_dch\r:im=^_ich\r:ei=^F\n^K:nl=^F\n:\ :ce=^_dch 80\r:cd=^_dli 50\r:CC=^_: X7|4025-17|4027-17|tek 4025 17 line window:li#17:tc=4025: X8|4025-17ws|4027-17ws|tek 4025 17 line window in workspace:\ :is=\41com 31\r\n^_sto 9,17,25,33,41,49,57,65,73\r^_wor 17\r^_mon 17\r:\ :ti=^_wor h\r:te=^_mon h\r:so=^_att e\r:se=^_att s\r:tc=4025-17: Xe|4025ex|4027ex|tek 4025 w/!:ti=\41com 31\r:te=^_com 33\r:\ :is=^_com 33\r\n\41sto 9,17,25,33,41,49,57,65,73\r:tc=4025: # Regent: lowest common denominator, works on all regents. a0|regent|adds regent series:\ :am:bs:cl=^L:cm=^K%+ ^P%B%.:co#80:ho=^A:li#24:ll=^A^Z:nd=^F:up=^Z: # Regent 100 has a bug where if computer sends escape when user is holding # down shift key it gets confused, so we avoid escape. a1|regent100|adds regent 100:\ :cm=^K%+ ^P%B%.:k1=^B1\r:k2=^B2\r:k3=^B3\r:k4=^B4\r:\ :k5=^B5\r:k6=^B6\r:k7=^B7\r:k8=^B8\r:\ :kh=^A:kl=^U:kr=^F:ku=^Z:kd=^J:tc=regent: # Regent 20, untested a2|regent20|adds regent 20:\ :cd=\Ek:ce=\EK:cm=\EY%+ %+ :tc=regent: a3|regent25|adds regent 25:\ :k0=^B0\r:k1=^B1\r:k2=^B2\r:k3=^B3\r:k4=^B4\r:\ :k5=^B5\r:k6=^B6\r:k7=^B7\r:k8=^B8\r:k9=^B9\r:\ :kh=^A:kl=^U:kr=^F:ku=^Z:kd=^J:tc=regent20: # Regent 40: untested a4|regent40|adds regent 40:\ :al=\EM:dl=\El:is=\EB:se=\E0@:so=\EOP:ue=\EO@:us=\E0`:vb=\ED\Ed:\ :tc=regent25: # If you ha((ve standout problem with regent 200, try so=\ER\EOP:se=\E0@\EV: a6|regent60|regent200|adds Regent 60:\ :dc=\EE:ei=\EF:im=\EF:is=\EV\EB:ko=dc,im,ei:tc=regent40: a7|regent60na|regent 60 w/no arrow keys:\ kl@:kr@:ku@:kd@:tc=regent60: # Note: if return acts weird on a980, check internal switch #2 # on the top chip on the CONTROL pc board. ac|a980|adds consul 980:\ :al=13\E^N:am:bs:cl=^L\200^K@:cm=^K%+@\E^E%2:co#80:dl=13\E^O:\ :k0=\E0:k1=\E1:k2=\E2:k3=\E3:k4=\E4:k5=\E5:k6=\E6:k7=\E7:k8=\E8:k9=\E9:\ :li#24:nd=\E^E01:so=^Y^^^N:se=^O:up=9: # Reports are that most of these Beehive entries (except superbee) have not been # tested and do not work right. se is a trouble spot. Be warned. b2|sb2|sb3|fixed superbee:xb@:tc=superbee: bh|bh3m|beehiveIIIm:if=/usr/lib/tabset/beehive:\ :al=160^S:am:bs:cd=^R:ce=^P:cl=^E^R:co#80:dl=300^Q:ho=^E:li#20:ll=^E^K:\ :nd=^L:pt:se= ^_:so=^] :up=^K: # This loses on lines > 80 chars long, use at your own risk bi|superbeeic|super bee with insert char:\ :ic=:im=\EQ:ei=\ER:tc=superbee: bm|microb|microbee|micro bee series:\ :am:bs:cd=\EJ:ce=\EK:cl=\EE:co#80:cm=\EF%+ %+ :\ :k1=\Ep:k2=\Eq:k3=\Er:k4=\Es:k5=\Et:k6=\Eu:k7=\Ev:k8=\Ew:k9=\Ex:\ :kd=\EB:kh=\EH:kl=\ED:kr=\EC:ku=\EA:\ :li#24:nd=\EC:pt:se=\Ed@ :so= \EdP:ue=\Ed@:up=\EA:us=\Ed`: # Superbee - f1=escape, f2=^C. # Note: there are at least 3 kinds of superbees in the world. The sb1 # holds onto escapes and botches ^C's. The sb2 is the best of the 3. # The sb3 puts garbage on the bottom of the screen when you scroll with # the switch in the back set to CRLF instead of AEP. This description # is tested on the sb2 but should work on all with either switch setting. # The f1/f2 business is for the sb1 and the :xb: can be taken out for # the other two if you want to try to hit that tiny escape key. # This description is tricky: being able to use cm depends on there being # 2048 bytes of memory and the hairy nl string. bs|sb1|superbee|superb|beehive super bee:if=/usr/lib/tabset/stdcrt:is=\EE:\ :am:bs:cd=3\EJ:ce=3\EK:cl=3\EH\EJ:co#80:cm=\EF%r%3%3:cr=1000\r:\ :dC#10:da:db:xb:dc=3\EP:dl=100\EM:so=\E_1:se=\E_0:\ :li#25:nl=\n\200\200\200\n\200\200\200\EA\EK\200\200\200\ET\ET:\ :nd=\EC:pt:up=\EA:ho=\EH:ve=\n:\ :k1=\Ep:k2=\Eq:k3=\Er:k4=\Es:k5=\Et:k6=\Eu:k7=\Ev:k8=\Ew:\ :kd=\EB:kh=\EH:kl=\ED:kr=\EC:ku=\EA: # From vax135!hpk Sat Jun 27 07:41:20 1981 # There seem to be a number of different versions of the C108 PROMS # (with bug fixes in its Z-80 program). # The first one that we had would lock out the keyboard of you # sent lots of short lines (like /usr/dict/words) at 9600 baud. # Try that on your C108 and see if it sends a ^S when you type it. # If so, you have an old version of the PROMs. # The old one also messed up running vi with a 132-character line-length. # You should configure the C108 to send ^S/^Q before running this. # It is much faster (at 9600 baud) than the c100 because the delays # Are not fixed. c8|c108|c108-8|concept 108 w/8 pages and ^S/^Q:\ :ti=\EU\Evh 8p\Ep\r:te=\Ev ^A\177p\Ep\r\n:tc=c108-4: cS|c108|c108-4|concept 108 w/4 pages and ^S/^Q:\ :is=\EU\E F\Ef\E7\E5\E8\El\ENH\EK\E\200\Eo&\200\Eo\47\E:\ :ti=\EU\Evh 8p\Ep\r:te=\Ev \177p\Ep\r\n:\ :al=\E^R:am:bs:cd=\E^C:ce=\E^S:cl=\E?\E:cm=\Ea%+ %+ :co#80:\ :dc=\E^A:dl=\E^B:ei=\E\200:eo:im=\E^P:in:ip=:li#24:mi:nd=\E=:\ :kb=^h:ul:up=\E;:db:us=\EG:ue=\Eg:xn:vs=\EW:ve=\Ew:\ :vb=\Ek\200\200\200\200\200\200\200\200\200\200\200\200\200\200\EK:\ :us=\EG:ue=\Eg:ks=\EX:ke=\Ex:ku=\E;:kd=\E<:kl=\E>:kr=\E=:kh=\E?:\ :k1=\E5:k2=\E6:k3=\E7:so=\ED\EE:se=\Ed\Ee # Some tty drivers use cr3 for concept, others use nl3, hence dN/dC below. # 2 nulls padding on te isn't always enough. 6 works fine. Maybe less # than 6 but more than 2 will work. # It seems rather strange to have is end in escape. Seems to reprogram # arrow keys to send escape sequences instead of whatever sequences. co|c100|concept|c104|c1004p|concept100|concept 100:\ :is=\EU\Ef\E7\E5\E8\El\ENH\EK\E\200\Eo&\200\Eo\47\E:\ :ti=\EU\Ev 8p\Ep\r:te=\Ev \200\200\200\200\200\200\Ep\r\n:\ :al=3*\E^R:am:bs:cd=16*\E^C:ce=16\E^S:cl=2*^L:cm=\Ea%+ %+ :co#80:\ :dc=16\E^A:dl=3*\E^B:ei=\E\200:eo:im=\E^P:in:ip=16*:li#24:mi:nd=\E=:\ :pt:kb=^h:ta=8\t:ul:up=\E;:db:us=\EG:ue=\Eg:xn:vs=\EW:ve=\Ew:\ :vb=\Ek\200\200\200\200\200\200\200\200\200\200\200\200\200\200\EK:\ :us=\EG:ue=\Eg:ks=\EX:ke=\Ex:ku=\E;:kd=\E<:kl=\E>:kr=\E=:kh=\E?:\ :k1=\E5:k2=\E6:k3=\E7:.dN#9:dC#9: cp|c100rvpp|c100rv4ppp|c100 with printer port:\ :is=\EU\Ef\E7\E5\E8\El\ENH\Ek\E\200\Eo&\200\Eo!\200\EQ"\EY(^W\Eo\47\E:\ :tc=c100rv: cn|c100rvna|c100rv4pna|c100 with no arrows:ks@:ke@:tc=c100rv: cr|c100rv|c100rv4p|c100 rev video:\ :is=\EU\Ef\E7\E5\E8\El\ENH\Ek\E\200\Eo&\200\Eo\47\E:vs@:ve@:\ :vb=\EK\200\200\200\200\200\200\200\200\200\200\200\200\200\200\Ek:\ :tc=c100: cs|c100s|slowconcept|slowconcept100|slow concept 100:\ :vb=\Ek\200\EK:pt:dC@:dN@:tc=c100: cd|c100rvs|slow reverse concept 100:\ :vb=\EK\200\Ek:pt:dC@:dN@:tc=c100rv: d0|vt100n|vt100 w/no init:is@:if@:tc=vt100: d1|vt100|vt-100|pt100|pt-100|dec vt100:\ :co#80:li#24:cl=50\E[;H\E[2J:bs:am:cm=5\E[%i%2;%2H:nd=2\E[C:up=2\E[A:\ :ce=3\E[K:cd=50\E[J:so=2\E[7m:se=2\E[m:us=2\E[4m:ue=2\E[m:\ :is=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:ks=\E[?1h\E=:ke=\E[?1l\E>:\ :if=/usr/lib/tabset/vt100:ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:\ :kh=\E[H:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:pt:sr=5\EM:xn:\ :dl=\E7\E[%i%2;24r\E[24;0H\n\E[;r\E8:\ :al=\E7\E[%i%2;24r\E8\EM\E[;r\E8:xv: d1|ovt100|vt-100|pt100|pt-100|dec vt100:\ :co#80:li#24:am:cl=50\E[;H\E[2J:bs:cm=5\E[%i%2;%2H:nd=2\E[C:up=2\E[A:\ :ce=3\E[K:cd=50\E[J:so=2\E[7m:se=2\E[m:us=2\E[4m:ue=2\E[m:\ :is=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:ks=\E[?1h\E=:ke=\E[?1l\E>:\ :if=/usr/lib/tabset/vt100:ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:\ :kh=\E[H:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:pt:sr=5\EM:xn: d2|gt42|dec gt42:\ :bs:co#72:ns:li#40:os: d3|vt132|vt-132:\ :al=99\E[L:dl=99\E[M:ip=7:dc=7\E[P:ei=\E[4l:im=\E[4h:xn:dN#30:tc=vt100: d4|gt40|dec gt40:\ :bs:co#72:ns:li#30:os: d5|vt50|dec vt50:\ :bs:cd=\EJ:ce=\EK:cl=\EH\EJ:co#80:li#12:nd=\EC:pt:up=\EA: dI|dw1|decwriter I:\ :bs:co#72:hc:os: dh|vt50h|dec vt50h:\ :bs:cd=\EJ:ce=\EK:cl=\EH\EJ:cm=\EY%+ %+ :co#80:li#12:nd=\EC:\ :pt:sr=\EI:up=\EA: ds|vt100s|vt-100s|pt100s|pt-100s|dec vt100 132 cols 14 lines:\ :li#14:tc=vt100w: dt|vt100w|vt-100w|pt100w|pt-100w|dec vt100 132 cols:\ :co#128:li#24:is=\E>\E[?3h\E[?4l\E[?5l\E[?7h\E[?8h:tc=vt100: dv|vt52|dec vt52:\ :bs:cd=\EJ:ce=\EK:cl=\EH\EJ:cm=\EY%+ %+ :co#80:li#24:nd=\EC:\ :pt:sr=\EI:up=\EA:ku=\EA:kd=\EB:kr=\EC:kl=\ED: dw|dw2|dw3|dw4|decwriter II:\ :kb=^h:bs:co#132:hc:os: e1|ep48|ep4080|execuport 4080:am:bs:os:co#80:hu=\036:hd=\034: e2|ep40|ep4000|execuport 4000:am:bs:os:co#136:hu=\036:hd=\034: g2|1200|tn1200|terminet 1200:\ :co#120:hc:os: g3|300|tn300|terminet 300:\ :co#120:hc:os: # Note: no "ho" on HP's since that homes to top of memory, not screen. # Due to severe braindamage, the only way to get the arrow keys to # transmit anything at all is to turn on the function key labels # (f1-f8) with ks, and even then the poor user has to hold down shift! # The default 2621 turns off the labels except when it has to to enable # the function keys. If your installation prefers labels on all the time, # or off all the time (at the "expense" of the function keys) move the # 2621nl or 2621wl labels to the front using reorder. h2|2621|hp2621|hp2621a|hp2621p|2621|2621a|2621p|hp 2621:\ :is=\E&j@\r\E3\r:bt=\Ei:cm=\E&a%r%dc%dY:dc=2\EP:ip=2:\ :kh=\Ep\r:ku=\Et\r:kl=\Eu\r:kr=\Ev\r:kd=\Ew\r:\ :kn#8:k1=\Ep\r:k2=\Eq\r:k3=\Er\r:k4=\Es\r:k5=\Et\r:k6=\Eu\r:k7=\Ev\r:\ :k8=\Ew\r:ks=\E&jB:ke=\E&j@:ta=2^I:tc=hp: # 2621k45: untested h3|2621k45|hp2621k45|k45|hp 2621 with 45 keyboard:\ :kb=^H:ku=\EA:kd=\EB:kl=\ED:kr=\EC:kh=\Eh:ks=\E&s1A:ke=\E&s0A:tc=2621: h4|hp|hp2645|2645|hp 264x series:\ :if=/usr/lib/tabset/stdcrt:\ :al=\EL:am:bs:cd=\EJ:ce=\EK:ch=\E&a%dC:cl=\EH\EJ:cm=6\E&a%r%dc%dY:\ :co#80:cv=\E&a%dY:da:db:dc=\EP:dl=\EM:ei=\ER:im=\EQ:\ :kb=^H:ku=\EA:kd=\EB:kl=\ED:kr=\EC:kh=\Eh:ks=\E&s1A:ke=\E&s0A:\ :li#24:mi:ml=\El:mu=\Em:nd=\EC:pt:se=\E&d@:so=\E&dJ:\ :us=\E&dD:ue=\E&d@:up=\EA:xs: h6|hp2626|hp2626a|hp2626p|2626|2626a|2626p|hp 2626:\ :is=\E&j@\r\E3\r:if=/usr/lib/tabset/stdcrt:\ :al=\EL:am:bs:bt=\Ei:cd=\EJ:ce=\EK:cl=\EH\EJ:\ :cm=\E&a%r%dc%dY:co#80:da:db:dc=2\EP:dl=\EM:ei=\ER:\ :im=\EQ:ip=2:li#24:mi:nd=\EC:pt:se=\E&d@:so=\E&dB:up=\EA:\ :kh=\Eh:ku=\EA:kl=\ED:kr=\EC:kd=\EB:\ :ma=j^Jk^P^K^Pl :sf=\ES:\ :ta=2^I:xs: # cD a pain - only screw up at 9600 baud. h8|hp2648|hp2648a|2648a|2648|HP 2648a graphics terminal:\ :cl=50\EH\EJ:cm=20\E&a%r%dc%dY:dc=7\EP:ip#5:is=130\Eg:tc=2645: # 2640a doesn't have the Y cursor addressing feature, and C is memory relative # instead of screen relative, as we need. ha|2640|hp2640a|2640a|hp 2640a:cm@:ks@:ke@:tc=2645: hb|2640b|hp2640b|2644a|hp2644a|hp 264x series:ks@:ke@:tc=2645: # 2621 using all 48 lines of memory, only 24 visible at any time. Untested. hb|big2621|48 line 2621:li#48:ho=\EH:cm=\E&a%r%dc%dR:tc=2621: hn|2621nl|hp2621nl|2621|hp 2621 with no labels:ks@:ke@:kh@:ku@:kl@:kr@:kd@:tc=hp2621: # Needed for our vax console, since lsi-11 expands tabs (wrong). ht|2621nt|hp 2621 w/no tabs:pt@:tc=2621: hw|2621wl|hp2621wl|2621|hp 2621 with labels:is=\E&jA\r\E3\r:ke=\E&jA:tc=hp2621: # Infoton is now called General Terminal Corp. or some such thing. # gt100 sounds like something DEC would come out with. Lets hope they don't. i1|i100|gt100|gt100a|General Terminal 100A (formerly Infoton 100):\ :cl=^L:cd=\EJ:ce=\EK:li#24:co#80:\ :al=\EL:dl=\EM:up=\EA:nd=\EC:ho=\EH:cm=\Ef%r%+ %+ :vb=\Eb\Ea:am:bs:\ :so=\Eb:se=\Ea: i4|i400|400|infoton 400:\ :if=/usr/lib/tabset/infoton_tabs:\ :al=\E[L:am:bs:ce=\E[N:cl=\E[2J:cm=%i\E[%3;%3H:co#80:dl=\E[M:li#25:\ :nd=\E[C:up=\E[A:im=\E[4h\E[2Q:ei=\E[4l\E[0Q:\ :dc=\E[4h\E[2Q\E[P\E[4l\E[0Q: ia|addrinfo:\ :li#24:co#80:cl=^L:ho=^H:nd=^Y:cd=^K:\ :up=^\:am:bc=^Z:cm=\037%+\377%+\377:ll=^H^\: ik|infotonKAS:\ :am:bc=^Z:cd=^K:cl=^L:co#80:li#24:nd=^Y:up=^\:ll=^H^\: kA|h19A|heathA|h19A|heathkitA|heathkit h19 ansi mode:\ :al=1*\E[1L:am:bs:cd=\E[J:ce=\E[K:cl=\E[2J:cm=\E[%i%2;%2H:co#80:\ :dc=\E[1P:dl=1*\E[1M:dn=\E[1B:ei=\E[4l:ho=\E[H:im=\E[4h:li#24:mi:\ :nd=\E[1C:as=\E[10m:ae=\E[11m:ms:pt:se=\E[0m:so=\E[7m:up=\E[1A:\(( :vs=\E[>4h:ve=\E[>4l:kb=^h:ku=\E[1A:kd=\E[1B:kl=\E[1D:kr=\E[1C:\ :kh=\E[H:kn#8:k1=\EOS:k2=\EOT:k3=\EOU:k4=\EOV:k5=\EOW:l6=blue:\ :l7=red:l8=white:k6=\EOP:k7=\EOQ:k8=\EOR:\ :sr=\EM:is=\E<\E[>1;2;3;4;5;6;7;8;9l\E[0m\E[11m\E[?7h: kB|h19bs|heathkit w/keypad shifted:ks=\Et:ke=\Eu:tc=h19b: kU|h19us|heathkit w/keypad shifted/underscore cursor:ks=\Et:ke=\Eu:tc=h19u: kb|h19|heath|h19b|heathkit|heath-19|z19|zenith|heathkit h19:\ :al=1*\EL:am:bs:cd=\EJ:ce=\EK:cl=\EE:cm=\EY%+ %+ :co#80:dc=\EN:\ :dl=1*\EM:do=\EB:ei=\EO:ho=\EH:im=\E@:li#24:mi:nd=\EC:as=\EF:ae=\EG:\ :ms:pt:sr=\EI:se=\Eq:so=\Ep:up=\EA:vs=\Ex4:ve=\Ey4:\ :kb=^h:ku=\EA:kd=\EB:kl=\ED:kr=\EC:kh=\EH:kn#8:\ :k1=\ES:k2=\ET:k3=\EU:k4=\EV:k5=\EW:\ :l6=blue:l7=red:l8=white:k6=\EP:k7=\EQ:k8=\ER: ku|h19u|heathkit with underscore cursor:vs@:ve@:tc=h19b: # If the adm31 gives you trouble with standout mode, check the DIP switch # in position 6, bank @c11, 25% from back end of pc. Should be OFF. # If there is no such switch, you have an old adm31 and must use oadm31 l1|adm31|31|lsi adm31:is=\Eu\E0:\ :al=\EE:am:bs:ce=\ET:cm=\E=%+ %+ :cl=\E*:cd=\EY:co#80:dc=\EW:dl=\ER:\ :ei=\Er:ho=^^:im=\Eq:k0=^A0\r:k1=^A1\r:k2=^A2\r:k3=^A3\r:k4=^A4\r:\ :k5=^A5\r:k6=^A6\r:k7=^A7\r:k8=^A8\r:k9=^A9\r:kd=^J:kl=^H:kr=^L:ku=^K:\ :li#24:ma=j^Jk^P^K^Pl ^R^L^L :mi:nd=^L:\ :se=\EG0:so=\EG1:up=^K:us=\EG1:ue=\EG0: l2|adm2|lsi adm2:\ :al=\EE:am:bs:cd=\EY:ce=\ET:cl=\E;:cm=\E=%+ %+ :co#80:dc=\EW:dl=\ER:\ :ei=:ho=^^:ic=\EQ:im=:kd=^J:kh=^^:kl=^H:kr=^L:ku=^K:li#24:nd=^L:up=^K: l3|adm3|3|lsi adm3:\ :am:bs:cl=^Z:li#24:ma=^K^P:co#80: l4|adm42|42|lsi adm42:vs=\EC\E3 \E3(:\ :al=270\EE:am:bs:cd=\EY:ce=\ET:cl=\E;:cm=\E=%+ %+ :co#80:\ :dc=\EW:dl=\ER:ei=\Er:im=\Eq:ip=6*:li#24:\ :bt=\EI:nd=^L:se=\EG0:so=\EG4:ta=\t:up=^k:\ :ma=^K^P:pc=\177: l5|adm5|5|lsi adm5:\ :cd=\EY:ce=\ET:do=^J:kb=^H:kd=^J:kh=^^:kl=^H:kr=^L:ku=^K:\ :ma=^Hh^Jj^Kk^Ll^^H:se=\EG:sg#1:so=\EG:tc=adm3a: la|adm3a|3a|lsi adm3a:\ :am:bs:cm=\E=%+ %+ :cl=1^Z:co#80:ho=^^:li#24:ma=^K^P:nd=^L:up=^K: lb|adm3a+|3a+:kl=^H:kd=^J:ku=^K:kr=^L:tc=adm3a: lo|oadm31|o31|old adm31:so=\EG4:us@:ue@:tc=adm31: # These mime1 entries refer to the Microterm Mime I or Mime II. # The default mime is assumed to be in enhanced act iv mode. m3|mime3a|mime1 emulating 3a:\ :am@:ma=^X ^K^J^Z^P:ku=^Z:kd=^K:kl=^H:kr=^X:tc=adm3a: m4|microterm|act4|microterm act iv:\ :am:bs:cd=^_:ce=^^:cl=^L:cm=^T%.%.:co#80:li#24:nd=^X:up=^Z:ho=^]: # The padding on sr and ta for act5 and mime is a guess and not final. m5|microterm5|act5|microterm act v:\ :uc=\EA:pt:ta=2^I:sr=3\EH:ku=^Z:kd=^K:kl=^H:kr=^X:ma=^Z^P^Xl^Kj:tc=act4: # act5s is not tested and said not to work. mS|act5s|skinny act5:ti=\EP:te=\EQ:li#48:co#39:tc=act5: # Mimes using brightness for standout. Half bright is really dim unless # you turn up the brightness so far that lines show up on the screen. # uc is disabled to get around a curses bug, and should be put back in someday. mf|mimefb|full bright mime1:so=^Y:se=^S:uc@:is=^S\E:tc=mime: mh|mimehb|half bright mime1:so=^S:se=^Y:uc@:is=^Y\E:tc=mime: mm|mime|mime1|mime2|mimei|mimeii|microterm mime1:\ :al=80^A:am:bs:cd=^_:ce=^^:cl=\035^C:cm=^T%+^X%> 0%+P:co#80:\ :dl=80^W:ta=2^I:li#24:nd=^X:pt:uc=^U:up=^z:ho=\035:do=^K:is=^S\E:\ :ma=^X ^K^J^Z^P:ku=^Z:kd=^K:kl=^H:kr=^X:sr=3^R: # These termcaps (for mime 2a) put the terminal in low intensity mode # since high intensity mode is so obnoxious. ms|mime2as|microterm mime2a (emulating an enhanced soroc iq120):\ :al=20*^A:am:bs:cd=20*\EJ:ce=\EK:cl=\EL:cm=\E=%+ %+ :co#80:dc=\ED:\ :dl=20*^W:kl=^H:kr=^L:ku=^K:kd=^J:ho=^^:is=\E):sr=\EI\ :im=\EE:ei=^Z:ip=2:li#24:nd=^L:so=\E\072:se=\E;:up=\EI:\ :us=\E6:ue=\E7: # This is the preferred mode (but ^X can't be used as a kill character) mv|mime2a|mime2av|microterm mime2a (emulating an enhanced vt52):\ :al=20*^A:bs:cd=20*\EQ:co#80:ce=\EP:cl=\EL:cm=\EY%+ %+ :is=^Y\ :dc=^N:dl=20*^W:ip=2:ei=^Z:ho=\EH:im=^O:kd=\EB:kl=\ED:kr=\EC:ku=\EA:\ :li#24:nd=\EC:pt:se=\E9:so=\E8:up=\EA:sr=\EA:us=\E4:ue=\E5: mx|mime3ax|mime1 emulating enhanced 3a:\ :al=80^A:dl=80^W:pt:ce=^X:cd=^_:tc=mime3a: pe|pe550|perkin elmer 550:\ :bs:co#80:ce=20\EI:cl=20\EK:cm=\EX%+ \EY%+ :\ :ho=\EH:li#24:ll=\EH\EA:nd=\EC:up=\EA: :ma=^Z^P:cd=6^N@^V: pf|fox|perkin elmer 1100:if=/usr/lib/tabset/stdcrt:\ :am:bs:cd=5.5*\EJ:ce=\EI:cl=132\EH\EJ:co#80:ho=\EH:li#24:\ :ll=\EH\EA:nd=\EC:cm=\EX%+ \EY%+ :up=\EA:vb=^P^B^P^C: po|owl|perkin elmer 1200:if=/usr/lib/tabset/stdcrt:\ :al=5.5*\EL:am:bs:cd=5.5*\EJ:ce=5.5\EI:cl=132\EH\EJ:ho=\EH:ll=\EH\EA:\ :cm=\EX%+ \EY%+ :co#80:dc=5.5*\EO:dl=5.5*\EM:ei=:ic=\EN:im=:ip=5.5*:\ :kb=^h:in:li#24:nd=\EC:up=\EA:se?=\E!\200:so?=\E!^H:vb=^P^B^P^C:\ :k1=\ERA:k2=\ERB:k3=\ERC:k4=\ERD:k5=\ERE:k6=\ERF:\ :k7=\ERG:k8=\ERH:k9=\ERI:k0=\ERJ: qB|bc|bill croft homebrew:\ :am:bs:cm=\E=%+ %+ :cl=^Z:co#96:ho=^^:li#72:\ :nd=^L:up=^K:vb=: qN|nucterm|rayterm|NUC homebrew:\ :am:bs:cl=1^L:li#24:co#80:nd=^C:up=^N:ho=^B:ll=^K:ce=^A:cd=^E: qb|ex3000:\ :li#24:co#80:ho=^Q: qc|carlock|klc:\ :al=^E:am:bs:ce=^U:cl=100^Z:cm=\E=%+ %+ :co#80:dc=\177:dl=^D:dm=:\ :ed=:ei=^T:ho=^^:im=^T:li#24:nd=^L:se=^V:so=^V:up=^K:vb=\EV\EV: qe|exidy|exidy2500|exidy sorcerer as dm2500:\ :al=^P^J^X:am:bs:ce=^W:cl=^^:cm=^L%r%n%.%.:co#64:\ :dc=\b:dl=^P^Z^X:dm=^P:ed=^X:ei=^X:ho=^B:ic=^\:\ :im=^P:li#30:nd=^\:pt:so=^N:se=^X:up=^Z: qn|netx|netronics:\ :bs:cd=2000^F^E:ce=1600^E:cl=466^L:cm=\E=%+@%+@:co#64:ho=^D:\ :li#16:ma=j^Jk^Pl :nd=\E+@A:pc=\200:sr=\E=@@^K:up=^K: # This came from the comp ctr who got it from some user. Smart indeed! qs|sexidy|exidy smart:\ :li#24:co#64:cl=^l:ho=^q:nd=^s:up=^w:bs:bc=^a:ma=^x^J:kd=^S: qu|ubell|ubellchar:if=/usr/staff/michael/term/startup:\ :am:bs:pt:ce=\Ed:cl=^Z:cm=\E=%+ %+ :co#80:li#24:nd=^L:up=^K:\ :ma=j^Jk^P^K^Pl :ho=^^: qw|ttyWilliams:\ :co#80:li#12:bc=^Y:do=^K:up=^Z:cl=^^:ce=^_:am:ho=^]:nd=^X: qx|xitex|xitex sct-100:\ :bs:cd=2000^F^E:ce=1600^E:cl=400^L:cm=\E=%+@%+@:co#64:ho=^D:\ :li#16:ma=j^Jk^Pl :nd=\E+@A:pc=\200:sr=\E=@@^K:up=^K: sa|arpanet|network:co#80:os:am: sb|bussiplexer:co#80:os:am: sd|du|dialup:co#80:os:am: se|ethernet|network:co#80:os:am: sp|plugboard:co#80:os:am: su|dumb|un|unknown:co#80:os:am: sw|switch|intelligent switch:co#80:os:am: t3|ti|ti700|ti733|735|ti735|ti silent 700:\ :bs:co#80:hc:os:dC#162: t4|ti745|745|743|ti silent 745:\ :bs:co#80:hc:os: t8|ti800|ti omni 800:\ :bs:co#132:hc:os: # There are some tvi's that require incredible amounts of padding and # some that don't. I'm assuming 912 and 920 are the old slow ones, # and 912b, 912c, 920b, 920c are the new ones that don't need padding. v1|tvi912|912|920|tvi920|old televideo:if=/usr/lib/tabset/stdcrt:\ :al=33*\EE:am:bs:ce=\ET:cm=\E=%+ %+ :cl=^Z:co#80:dc=\EW:dl=33*\ER:ei=:\ :kb=^h:ku=^K:kd=^J:kl=^H:kr=^L:k0=^A@\r:k1=^AA\r:k2=^AB\r:k3=^AC\r:\ :k4=^AD\r:k5=^AE\r:k6=^AF\r:k7=^AG\r:k8=^AH\r:k9=^AI\r:\ :ho=^^:im=:ic=\EQ:li#24:nd=^L:pt:se=\Ek:so=\Ej:up=^K:us=\El:ue=\Em:\ :ma=^K^P^L :sg#1:ug#1: v2|912b|912c|920b|920c|tvi|new televideo 912/920:\ :al=5*\EE:dl=5*\ER:tc=912: # set to page 1 when entering ex (\E-17 ) # reset to page 0 when exiting ex (\E-07 ) v2|tvi9122p|tvi9202p|9122p|9202p|tvi2p|televideo w/2 pages:\ :ti=\E-17 :te=\E-07 :tc=tvi912:\ va|tvi950-ap|tvi 950 w/alt pages:is=\E\\1:ti=\E-06 :te=\E-16 :tc=tvi950: vf|tvi950-4p|tvi 950 w/4 pages:ti=\E\\1:te=\E\\3:tc=tvi950: vl|tvi950b|bare tvi950 no is:is@:ks=\El:ke=\Ek:tc=tvi950: vs|tvi950ns|tvi950 w/no standout:so@:se@:us@:ue@:tc=tvi950: vt|tvi950-2p|tvi 950 w/2 pages:ti=\E\\1:te=\E\\2:tc=tvi950: # The following tvi descriptions from B:pjphar # is for all 950 sets the following attributes: # full duplex (\EDF) write protect off (\E() # conversation mode (\EC) graphics mode off (\E%) # white on black (\Ed) auto page flip off (\Ew) # turn off status line (\Eg) # normal video (\E0) monitor mode off (\EX or \Eu) # edit mode (\Er) load blank char to space (\Ee\040) # line edit mode (\EO) enable buffer control (^O) # protect mode off (\E\047) local edit keys (\Ek) # program unshifted send key to send line all (\E016) # program shifted send key to send line unprotected (\E004) # set the following to nulls: # field delimiter (\Ex0\200\200) # line delimiter (\Ex1\200\200) # start-protected field delimiter (\Ex2\200\200) # end-protected field delimiter (\Ex3\200\200) # set end of text delimiter to carriage return/null (\Ex4\r\200) # clear all column tabs (\E3) # # tvi950 sets duplex (send) edit keys (\El) when entering vi # sets local (no send) edit keys (\Ek) when exiting vi # v5|tvi950|950|televideo950:if=/usr/lib/tabset/stdcrt:\ :is=\EDF\EC\Ed\EG0\Eg\Er\EO\E\047\E(\E%\Ew\EX\Ee ^O\ \Ek\E016\E004\Ex0\200\200\Ex1\200\200\Ex2\200\200\ \Ex3\200\200\Ex4\r\200\E3:\ :al=\EE:am:bs:bt=\EI:cd=\Ey:ce=\Et:cl=\E*:cm=\E=%+ %+ :\ :co#80:dc=\EW:dl=\ER:do=^V:ei=\Er:ho=^^:im=\Eq:k0=^A0\r:\ :k1=^A@\r:k2=^AA\r:k3=^AB\r:k4=^AC\r:k5=^AD\r:k6=^AE\r:\ :k7=^AF\r:k8=^AG\r:k9=^AH\r:kb=^H:kd=^V:kh=^^:kl=^H:\ :ko=ic\054dc\054al\054dl\054cl\054bt\054ce\054cd:kr=^L:\ :ku=^K:li#24:ma=^Vj^Kk^Hh^Ll^^H:mi:ms:nd=^L:pt:se=\EG0:\ :sg#1:so=\EG4:sr=\Ej:ue=\EG0:ug#1:up=^K:us=\EG8:\ :vb=\Eb\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\Ed:\ :ve=\Ek:vs=\El:xn: # # is for 950 with two pages adds the following: # set 48 line page (\E\\2) # place cursor at page 0, line 24, column 1 (\E-07 ) # # two page 950 adds the following: # when entering ex, set 24 line page (\E\\1) # when exiting ex, reset 48 line page (\E\\2) # place cursor at 0,24,1 (\E-07 ) # v3|tvi9502p|9502p|televideo950 w/2 pages:\ :is=\EDF\EC\Ed\EG0\Eg\Er\EO\E\047\E(\E%\Ew\EX\Ee ^O\ \Ek\E016\E004\Ex0\200\200\Ex1\200\200\Ex2\200\200\ \Ex3\200\200\Ex4\r\200\E\\2\E-07 \E3\ :te=\E\\2\E-07 :ti=\E\\1\E-07 :tc=tvi950: # # is for 950 with four pages adds the following: # set 96 line page (\E\\3) # place cursor at page 0, line 24, column 1 (\E-07 ) # # four page 950 adds the following: # when entering ex, set 24 line page (\E\\1) # when exiting ex, reset 96 line page (\E\\3) # place cursor at 0,24,1 (\E-07 ) # v4|tvi9504p|9504p|televideo950 w/4 pages:\ :is=\EDF\EC\Ed\EG0\Eg\Er\EO\E\047\E(\E%\Ew\EX\Ee ^O\ \Ek\E016\E004\Ex0\200\200\Ex1\200\200\Ex2\200\200\ \Ex3\200\200\Ex4\r\200\E\\3\E-07 \E3\ :te=\E\\3\E-07 :ti=\E\\1\E-07 :tc=tvi950: # # is for reverse vi((deo 950 changes the following: # set reverse video (\Ed) # # set vb accordingly (\Eb ...nulls... \Ed) # vr|tvi950rv|950rv|televideo950 rev video:if=/usr/lib/tabset/stdcrt:\ :is=\EDF\EC\Eb\EG0\Eg\Er\EO\E\047\E(\E%\Ew\EX\Ee ^O\ \Ek\E016\E004\Ex0\200\200\Ex1\200\200\Ex2\200\200\ \Ex3\200\200\Ex4\r\200\E3:\ :vb=\Ed\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\Eb:\ :tc=tvi950: # # uses the appropriate entries from 9502p and 950rv # v3|tvi950rv2p|950rv2p|televideo950 rev video w/2 pages:\ :is=\EDF\EC\Eb\EG0\Eg\Er\EO\E\047\E(\E%\Ew\EX\Ee ^O\ \Ek\E016\E004\Ex0\200\200\Ex1\200\200\Ex2\200\200\ \Ex3\200\200\Ex4\r\200\E\\2\E-07 \E3\ :te=\E\\2\E-07 :ti=\E\\1\E-07 :tc=tvi950rv: # # uses the appropriate entries from 9504p and 950rv # vR|tvi950rv4p|950rv4p|televideo950 rev video w/4 pages:\ :is=\EDF\EC\Eb\EG0\Er\EO\E\047\E(\E%\Ew\EX\Ee ^O\ \Ek\E016\E004\Ex0\200\200\Ex1\200\200\Ex2\200\200\ \Ex3\200\200\Ex4\r\200\E\\3\E-07 \E3\ :te=\E\\3\E-07 :ti=\E\\1\E-07 :tc=tvi950rv: # Note two things called "teleray". Reorder should move the common one # to the front if you have either. A dumb teleray with the cursor stuck # on the bottom and no obvious model number is probably a 3700. y1|t3700|teleray|dumb teleray 3700:\ :bs:cl=^L:co#80:li#24: y3|t3800|teleray 3800 series: \ :bs:cd=\EJ:ce=\EK:cl=^L:cm=\EY%+ %+ :co#80: \ :do=\n:ho=\EH:li#24:ll=\EY7 :nd=\EC:pt:up=^K: y6|t1061|t10|teleray|teleray 1061:if=/usr/lib/tabset/teleray:\ :al=2*\EL:am:bs:cd=1\EJ:ce=\EK:cl=1^L:cm=\EY%+ %+ :co#80:\ :dc=\EQ:dl=2*\EM:ei=:ho=\EH:ic=\EP:im=:ip=0.4*:\ :k1=^Z1:k2=^Z2:k3=^Z3:k4=^Z4:k5=^Z5:k6=^Z6:k7=^Z7:k8=^Z8:\ :li#24:nd=\EC:pt:se=\ER@:so= \ERD:\ :is=\Ee\EU01^Z1\EV\EU02^Z2\EV\EU03^Z3\EV\EU04^Z4\EV\EU05^Z5\EV\EU06^Z6\EV\EU07^Z7\EV\EU08^Z8\EV\Ef:\ :up=\EA:us=\ERH:ue=\ER@:xs:xt:sg=2:ug=1: yf|t1061f|teleray 1061 with fast PROMs:\ al=\EL:ip@:dl=\EM:tc=t1061: # # ---- # Convention: First entry is two chars, first char is manufacturer, # second char is canonical abbreviation for model or mode. # Second entry is canonical abbreviation. # Third entry is the one the editor will print with "set" command. # Last entry is verbose description. # Others are mnemonic synonyms for the terminal. # # If you absolutely MUST check for a specific terminal (this is discouraged) # check for the 2nd entry (the canonical form) since all other codes are # subject to change. The two letter codes are there for version 6 and are # EXTREMELY subject to change, or even to go away if version 6 becomes for # all practical purposes obsolete. # # Special manufacturer codes: # M: Misc. (with only a few terminals) # q: Homemade # s: special (dialup, etc.) # # This file is to be installed with an editor script that moves the most # common terminals to the front of the file. If the source is not available, # it can be constructed by sorting # the above entries by the 2 char initial code. er codes are there for version 6 and are # EXTREMELY subject to change, or even to go away if version 6 becomes for # all practical purposes obsolete. cmd/termcap/tabset/ 775 0 33 0 2552615400 7427 cmd/termcap/tabset/beehive 644 0 33 244 2331454633 11030                                                                                 2615400sp env< oa9auto00000007427aded when -u is done. wholine.l a simple function for putting a line of text in the .who file to be read later on by h19sys. This should probably be put somewhere else. lis r and au|/ lC. /,"cmd/termcap/tabset/diablo 644 0 33 130 2404626370 10645  9 2 1 1 1 !1 )1 11 91 A1 I1 Q1 Y1 a1 i1 q1 y1 9                                      2615400sp env< oa9auto00000007427aded when -u is done. wholine.l a simple function for putting a line of text in the .who file to be read later on by h19sys. This should probably be put somewhere else. lis r and au|//|,|5h< /,"cmd/termcap/tabset/std 644 0 33 207 2552615317 10215 3 1 1 1 1 1 1 1 1 1 1 1 1 1               2615400sp env< oa9auto00000007427aded when -u is done. wholine.l a simple function for putting a line of text in the .who file to be read later on by h19sys. This should probably be put somewhere else. lis r and au|//|,|5x< /,"cmd/termcap/tabset/teleray 644 0 33 71 2331454634 11045 GY9(FY90FY98FY9@FY9HFY9PFY9XFY9`FY9hF 1 1 1 1 1 1 1 1               2615400sp env< oa9auto00000007427aded when -u is done. wholine.l a simple function for putting a line of text in the .who file to be read later on by h19sys. This should probably be put somewhere else. lis r and au|//|,|5< /,"cmd/termcap/tabset/vt100 644 0 33 237 2331454634 10276  H H H H H H H H H H H H H H H H   2615400sp env< oa9auto00000007427aded when -u is done. wholine.l a simple function for putting a line of text in the .who file to be read later on by h19sys. This should probably be put somewhere else. lis r and au|//|,|5< /,"cmd/termcap/tabset/xerox1720 644 0 33 244 2331454634 11101 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2615400sp env< oa9auto00000007427aded when -u is done. wholine.l a simple function for putting a line of text in the .who file to be read later on by h19sys. This should probably be put somewhere else. lis r and au|//|,|5< /,"cmd/termcap/tabset/3101 644 0 33 135 2405012317 7773 ((H 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 2615400sp env< oa9auto00000007427aded when -u is done. wholine.l a simple function for putting a line of text in the .who file to be read later on by h19sys. This should probably be put somewhere else. lis r and au|//|,|5< /,"cmd/termcap/tabset/aa 600 0 33 151 2552615313 7766  1 1 1 1 1 1 1 1 1  1 1 1 1 1 1 2615400sp env< oa9auto00000007427aded when -u is done. wholine.l a simple function for putting a line of text in the .who file to be read later on by h19sys. This should probably be put somewhere else. lis r and au|//|,|5Ȇ< /,"cmd/termcap/termcap.old 664 0 33 70036 2552451251 10415 # Mail changes to csvax:mark, csvax.mark@berkeley, or ucbvax!mark or lose them! sw|switch|intelligent switch:co#80:os:am: su|dumb|un|unknown:co#80:os:am: sp|plugboard:co#80:os:am: sa|arpanet|network:co#80:os:am: sd|du|dialup:co#80:os:am: sb|bussiplexer:co#80:os:am: la|adm3a|3a|lsi adm3a:\ :am:bs:cm=\E=%+ %+ :cl=1^Z:co#80:ho=^^:li#24:ma=^K^P:nd=^L:up=^K: h2|2621|hp2621|hp2621a|hp2621p|2621|2621a|2621p|hp 2621:\ :is=\E&j@\r\E3\r:bt=\Ei:cm=\E&a%r%dc%dY:dc=2\EP:ip=2:\ :kh=\Ep\r:ku=\Et\r:kl=\Eu\r:kr=\Ev\r:kd=\Ew\r:\ :kn#8:k1=\Ep\r:k2=\Eq\r:k3=\Er\r:k4=\Es\r:k5=\Et\r:k6=\Eu\r:k7=\Ev\r:\ :k8=\Ew\r:ks=\E&jB:ke=\E&j@:ta=2^I:tc=hp: cr|c100rv|c100 rev video:\ :is=\EU\Ef\E7\E5\E8\El\ENH\Ek\E\200\Eo&\200\Eo\47\E:vs@:ve@:\ :vb=\EK\200\200\200\200\200\200\200\200\200\200\200\200\200\200\Ek:\ :tc=c100: co|c100|concept|concept100|concept 100:\ :is=\EU\Ef\E7\E5\E8\El\ENH\EK\E\200\Eo&\200\Eo\47\E:\ :al=3*\E^R:am:bs:cd=16*\E^C:ce=16\E^S:cl=2*^L:cm=\Ea%+ %+ :co#80:\ :dc=16\E^A:dl=3*\E^B:ei=\E\200:eo:im=\E^P:in:ip=16*:li#24:mi:nd=\E=:\ :pt:kb=^h:ta=8\t:ul:up=\E;:db:us=\EG:ue=\Eg:xn:vs=\EW:ve=\Ew:\ :vb=\Ek\200\200\200\200\200\200\200\200\200\200\200\200\200\200\EK:\ :us=\EG:ue=\Eg:ks=\EX:ke=\Ex:ku=\E;:kd=\E<:kl=\E>:kr=\E=:kh=\E?:\ :k1=\E5:k2=\E6:k3=\E7:.dN#9:dC#9: mm|mime|mime1|mime2|mimei|mimeii|microterm mime1:\ :al=80^A:am:bs:cd=^_:ce=^^:cl=\035^C:cm=^T%+^X%> 0%+P:co#80:\ :dl=80^W:ta=2^I:li#24:nd=^X:pt:uc=^U:up=^z:ho=\035:do=^K:is=^S\E:\ :ma=^X ^K^J^Z^P:ku=^Z:kd=^K:kl=^H:kr=^X:sr=3^R: kb|h19|heath|h19b|heathkit|heath-19|z19|zenith|heathkit h19:\ :al=1*\EL:am:bs:cd=\EJ:ce=\EK:cl=\EE:cm=\EY%+ %+ :co#80:dc=\EN:\ :dl=1*\EM:do=\EB:ei=\EO:ho=\EH:im=\E@:li#24:mi:nd=\EC:as=\EF:ae=\EG:\ :ms:pt:sr=\EI:se=\Eq:so=\Ep:up=\EA:vs=\Ex4:ve=\Ey4:\ :kb=^h:ku=\EA:kd=\EB:kl=\ED:kr=\EC:kh=\EH:kn#8:\ :k1=\ES:k2=\ET:k3=\EU:k4=\EV:k5=\EW:\ :l6=blue:l7=red:l8=white:k6=\EP:k7=\EQ:k8=\ER: l3|adm3|3|lsi adm3:\ :am:bs:cl=^Z:li#24:ma=^K^P:co#80: # The A manufacturer represents Diablo, DTC, Xerox, Qume, and other Daisy # wheel terminals until such time as termcap distinguishes between them # enough to justify separate codes. # 1620 uses all 132 columns, 1640 sets left margin to 8 and uses snazzy # binary tabset file. Both should work on both terminals. A6|1620|450|diablo 1620:\ :if=/usr/lib/tabset/std:\ :kb=^H:bs:co#132:ff=^L:hc:hu=\EU:hd=\ED:os:pt:up=\E\n: A7|1640|diablo 1640:\ :co#124:if=/usr/lib/tabset/diablo:tc=1620: Ad|dtc300s|300|300s|gsi|dtc|dtc 300s:\ :if=/usr/lib/tabset/std:\ :kb=^h:bs:co#132:ff=^L:hc:hu=\EH:hd=\Eh:os:pt:up=^Z: Ag|gsi:bs:co#132:hc:hd=\Eh:hu=\EH:os:pt:up=^Z: Aj|aj830|aj832|aj|anderson jacobson:\ :bs:hc:hd=\E9:hu=\E8:os:pl:up=\E7: Aq|qume5|qume|Qume Sprint 5:\ :if=/usr/lib/tabset/std:\ :kb=^h:bs:co#80:ff=^L:hc:hu=\EH:hd=\Eh:os:pt:up=^Z: Ax|x1720|xerox 1720:co#132:bs:ff=^L:hc:os:pt:if=/usr/lib/tabset/xerox1720 Ca|cdc456|cdc:\ :li#24:co#80:cl=^Y^X:nd=^L:up=^Z:bs:\ :cm=\E1%+ %+ :ho=^Y:al=\E\114:dl=\E\112:ce=^V:cd=^X:am: Cc|cdc456tst:\ :li#24:co#80:cl=^y^x:bs:cm=\E1%+ %+ :am: D0|dm1520|1520|datamedia 1520:\ :am:bs:cd=^K:ce=^]:cl=^L:cm=^^%r%+ %.:co#80:ho=^Y:\ :ku=^_:kd=^J:kl=^H:kr=^\:kh=^Y:\ :li#24:nd=^\:up=^_:xn:ma=^\ ^_^P^YH:pt: D1|dm1521|1521|datamedia 1521:\ :am:bs:cd=^K:ce=^]:cl=^L:cm=^^%r%+ %.:co#80:ho=^Y:\ :ku=^_:kd=^J:kl=^H:kr=^\:kh=^Y:\ :li#24:nd=^\:up=^_:xn:ma=^\ ^_^P^YH:pt: D2|dm2500|datamedia2500|2500|datamedia 2500:\ :al=15^P\n^X^]^X^]:bs:ce=^W:cl=^^^^\177:cm=^L%r%n%.%.:co#80:\ :dc=10*\b:dl=10*^P^Z^X^]:dm=^P:ed=^X^]:ei=10\377\377^X^]:ho=^B:ic10*^\:\ :im=^P:li#24:nc:nd=^\:pc=\377:so=^N:se=^X^]:up=^Z: D3|dm3025|datamedia 3025a:is=\EQ\EU\EV:\ :al=130\EP\n\EQ:bs:cd=2\EJ:ce=\EK:cl=2\EM:cm=\EY%r%+ %+ :\ :co#80:dc=6\b:dl=130\EP\EA\EQ:dm=\EP:ed=\EQ:ei=\EQ:ho=\EH:\ :im=\EP:ip=6:li#24:nd=\EC:pt:so=\EOA:se=\EO@:up=\EA: D4|3045|dm3045|datamedia 3045a:is=\EU\EV:\ :am:bs:cd=2\EJ:ce=\EK:cl=2\EM:cm=\EY%r%+ %+ :co#80:\ :dc=6\EB:dm=:ed=:ei=\EP:ho=\EH:ic=:im=\EP:ip=6:\ :k0=\Ey\r:k1=\Ep\r:k2=\Eq\r:k3=\Er\r:k4=\Es\r:\ :k5=\Et\r:k6=\Eu\r:k7=\Ev\r:k8=\Ew\r:k9=\Ex\r:\ :kh=\EH:ku=\EA:kr=\EC:li#24:nd=\EC:pc=\177:pt:eo:ul:up=\EA:xn: D5|dt80|dmdt80|dm80|datamedia dt80/1:\ :is=\E<\E[2J\E[H\E[?1;3;5;6;9l\E[?7;8h:\ :am:bs:cd=\E[J:co#80:li#24:ce=\E[K:cl=\E[2J\E[H:\ :cm=%i\E[%d;%dH:ho=\E[H:nd=\E[C:\ :so=\E[7m:se=\E[m:\ :up=\E[A:us=\E[4m:ue=\E[m:\ :vb=\E[?5h\E[?5l:\ :vs=\E[1;2;3;4q\E[?4l:ve=\E[0q\E?4h:\ :kd=\E[B:kl=\E[D:kr=\E[C:ku=\E[A:\ :sr=\EM:\ :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS: D6|dt80132|dmdt80132|datamedia dt80/1 in 132 char mode:\ :bs:cd=20^[[0J:co#132:ce=20^[[0K:kd=^[[B:kl=^[[D:kr=^[[C:ku=^[[A:\ :li#24:cm=5^[[%i%d;%dH:cl=50^[[H^[[2J:nd=^[[C:up=5^[[A: ED|delta|dd5000|delta data 5000:\ :am:bs:cl=^NR:cm=^O%D%+9%D%+9:co#80:li#27:ho=^NQ:nc:nd=^Y:\ :up=^Z:ce=^NU:dc=^NV:ma=^K^J^Z^P^Y :xr: # Note: the h1552 appears to be the first Hazeltine terminal which # is not braindamaged. It has tildes and backprimes and everything! # Be sure the auto lf/cr switch is set to cr. H2|h1552|hazeltine 1552:\ :al=\EE:dl=\EO:f1=\EP:l1=blue:f2=\EQ:l2=red:f3=\ER:l3=green:tc=vt52: H3|h1552rv|hazeltine 1552 reverse video:\ :so=\ES:se=\ET:tc=h1552: H5|h1500|hazeltine 1500:\ :al=40~^Z:am:bs:cd=10~^X:ce=~^O:cl=~^\:cm=~^Q%r%.%.:co#80:\ :dl=40~^S:do=~^K:hz:li#24:nd=^P:.se=~^_:.so=~^Y:up=~^L: H6|h1510|hazeltine 1510:\ :al=\E^Z:am:bs:cd=\E^X:ce=\E^O:cl=\E^\:cm=\E^Q%r%.%.:co#80:\ :dl=\E^S:do=\E^K:hz:li#24:nd=^P:.se=\E^_:.so=\E^Y:up=\E^L: H8|h1520|hazeltine 1520:\ :al=~^Z:am:bs:cd=~^X:ce=~^O:cl=~\034:cm=~^Q%r%.%.\200:co#80:\ :dl=~^S:do=~^K:hz:li#24:nd=^P:se=~^Y:so=~\037:up=~^L:ho=~^R: # Note: h2000 won't work because of a clash between upper case and ~'s. H7|h2000|hazeltine 2000:\ :al=6~^z:am:bs:cl=6~^\:cm=~^q%r%.%.:co#74:\ :dl=6~^s:ho=~^r:li#27:nc:pc=\177: # One of these should go in the misc category, IBM and ISC can't # both have I. I will wait to see who comes out with more terminals. I8|8001|ISC8001:al=\EU:am:bc=^Z:cl=3*^L:cm=^C%r%.%.:co#80:\ :cd=\EQ:dm=\EQ:ed=\EF:\ :dc=\177:dl=\EV:ei=\EF:im=\EQ:li#40:nd=1^Y:ta=8\t:\ :up=^\:ho=1^H:pc=^@: It|intext|ISC modified owl 1200:\ :al=5.5*\020:am:bc=\037:bs:cd=5.5*\026J:cl=132\014:\ :cm=\017%+ %+ :co#80:dc=5.5*\022:dl=5.5*\021:\ :ei=\026\074:im=\026\073:ip=5.5*:in:li#24:nd=\036:up=\034:\ :ma=^K^P^R^L^L :kl=^H:kd=^J:kr=^L:ku=^K: I9|ibm|ibm3101|3101|i3101|IBM 3101-10:\ :if=/usr/lib/tabset/3101:\ :am:bs:cl=^[K:li#24:co#80:nd=^[C:up=^[A:cd=^[J:ce=^[I:\ :kd=\EB:kl=\ED:kr=\EC:ku=\EA:ho=^[H:cm=\EY%+\40%+\40: L3|digilog|333|digilog 333:bs:co#80:ce=\030:ho=^n:li#16:nd=^i:up=^o: MA|ampex|d80|dialogue|dialogue80|ampex dialogue 80:\ :am:bs:pt:if=/usr/lib/tabset/stdcrt:cl=\E*:cm=\E=%+ %+ :\ :al=\EE:bt=\EI:ic=\EQ:im=:ei=:dl=\ER:dc=\EW:\ :ce=\Et:cd=\Ey:so=\Ej:se=\Ek:li#24:co#80:nd=^L:up=^K: MB|aaadb|ann arbor ambassador 48/destructive backspace:\ :is=\E[48;0;0;48p\E[H\E[J\E[>30h\E[1Q\E[m:bs@:\ :vs=\E[>30l:ve=\E[>30h:tc=aaa: MC|compucolor|compucolorII:\ :pt:am:cm=%r^C%.%.:bc=^Z:li#32:co#64:\ :cl=^L:ho=^H:nd=^Y:up=^\: MD|d132|datagraphix|datagraphix 132a:\ :co#80:li#30:cl=^l:ho=\Et:da:db:sf=\Ev:sr=\Ew:\ :up=\Ek:nd=\El:vs=\ex:ve=\Em\En:\ :al=\E3:ic=\E5:dc=\E6:in:ic=\E5: MS|soroc|Soroc 120:\ :cd=\EY:ce=\ET:cl=2\E*:ma=^K^P^R^L^L :\ :kl=^H:ku=^K:kr=^L:kd=^J:tc=adm3a: Ma|aa|annarbor|ann arbor:\ :cm=^O%r%B%.%>^S^L%+@:co#80:li#40:bs:cl=2^L:up=^N:nd=^_:ho=^K:am:\ :kb=^^:kd=^J:ku=^N:kl=^H:kr=^_:kh=^K:ma=^_ ^N^P: # Needs function keys added. Also can't use 60 line mode because it needs # too much nl delay - can fix for nl but not out of vi. # The cl delay is sufficent, but a smaller one could do. # This entry is merged from Mike O'Brien@Rand and Howard Katseff at # Bell Labs, and is untested. Mb|aaa|ambas|ambassador|ann arbor ambassador/48 lines:\ :al=\E[L:am:bs:\ :cd=\E[0J:ce=\E[0K:cl=400\E[;H\E[0J:cm=\E[%i%d;%dH:co#80:\ :da:db:dc=\E[4h\E[1Q\E[P\E[4l\E[0Q:dc=\E[P:dl=\E[M:dm=\E[1Q:\ :ed=\E[0Q:ei=\E[0Q:ho=\E[;H:ic=\E[@:if=/usr/lib/tabset/aa:im=\E[1Q:\ :is=\E[48;0;0;48p\E[H\E[J\E[1Q\E[m:li#48:mi:\ :nd=\E[C:nl=\ED:pt:sf=\E[S:sr=\E[T:se=\E[m:so=\E[7m:up=\E[A: Md|datapoint|dp3|dp3360|datapoint 3360:\ :am:bs:cd^_:ce=^^:cl=^]^_:co#82:ho=^]:li#25:nd=^x:up=^z: Mg|dg|dg6053|data general 6053:\ ca:am:b((s:cm=^P%r%.%.:cl=^L:ho=^H:nd=^S\ up=^W:ce=^K:co#80:li#24: Mi|cdi|cdi1203:am:bs:hc:os:co#80:cD#200: Mk|teletec|tec|Teletec Datascreen:\ :am:bs:co#80:cl=^l:ho=^^:li#24:nd=^_:up=^k: # ^S is an arrow key! Boy is this guy in for a surprise on v7! Ml|sol:\ :am:bs:cm=\E^1%.\E^2%.:cl=^K:ho=^N:co#64:li#16:nd=^S:up=^W:\ :kl=^A:kr=^S:ku=^W:kd=^Z:ma=^A^H^S ^W^P^Z^N: Mo|omron|Omron 8025AG:\ :al=\EL:am:bs:cd=\ER:co#80:ce=\EK:cl=\EJ:da:db:dc=\EP:dl=\EM:\ :ho=\EH:li#24:nd=\EC:se=\E4:sf=\ES:so=\Ef:sr=\ET:up=\EA:ve=:vs=\EN: Mp|plasma|plasma panel:am:bs:cl=^L:co#85:ho=^^:li#45:nd=\030:up=\026: Ms|swtp|ct82|southwest technical products ct82:\ :am:bs:bc=^d:al=^\^y:cd=^v:ce=^F:cl=^L:cm=%r^k%.%.:co#82:li#20:\ :dl=^z:nd=^s:up=^a:so=^^^v:se=^^^F:dc=^\^h:ic=^\^x:ho=^p:\ :ei=:sf=^n:sr=^o:ll=^c:im=:\ :is=^\^r^^^s^^^d^]^w^i^s^^^]^^^o^]^w^r^i: Mt|terak|Terak emulating Datamedia 1520:tc=dm1520: My|mdl110|cybernex mdl-110:cm=^P%+ %+ :co#80:li#24:am:cl=70^X:bs:\ :nd=^U:up=^Z:ho=^Y:ce=145^N@^V:cd=145^NA^W:al=65^NA^N^]:\ :dl=40^NA^N^^:im=:\ :ei=:ic=3.5^NA^]:dm:ed:dc=3.5^NA^^:so=^NF:se=^NG:ta=43\t:\ :ma=^Z^P:cd=6^N@^V Mz|zen30|z30|zentec 30:\ :mi:co#80:li#24:ma=^L ^R^L^K^P:ul:\ :al=1.5*\EE:bs:ce=1.0*\ET:cm=\E=%+ %+ :cl=\E*:\ :ho=^^:nd=^L:se=\EG0;so=\EG6:up=^K:im=\Eq:ei=\Er:\ :am:dc=\EW:dl=1.5*\ER:cd=\EY: T3|33|tty33|tty|model 33 teletype:\ :co#72:hc:os: T4|43|tty43|model 43 teletype:\ :kb=^h:am:bs:hc:os:co#132: T7|37|tty37|model 37 teletype:\ :bs:hc:hu=\E8:hd=\E9:up=\E7:os: # The Visual 200 beeps when you type a character in insert mode. # This is a horribly obnoxious misfeature, and some of the entries # below try to get around the problem by ignoring the feature or # turning it off when inputting a character. They are said not to # work well at 300 baud. (You could always cut the wire to the bell!) V2|vi200|visual 200 with function keys:\ :al=\EL:am:bs:cd=\Ey:ce=4*\Ex:cl=\Ev:\ :cm=\EY%+ %+ :co#80:dc=4*\EO:dl=4*\EM:ho=\EH:\ :im=:ei=:ic=\Ei \b\Ej:\ :is=\E3\Eb\Ej\E\\\El\EG\Ed\Ek:\ :k0=\EP:k1=\EQ:k2=\ER:k3=\E :k4=\E!:k5=\E":k6=\E#:\ :k7=\E$:k8=\E%:k9=\E&:kl=\ED:kr=\EC:ku=\EA:kd=\EB:kh=\EH:\ :li#24:nd=\EC:pt:sr=\EI:up=\EA:vs=\Ed:ve=\Ec: VR|vi200rvic|visual 200 reverse video using insert char:\ :ei=\Ej:im=\Ei:ic@:tc=vi200rv: # The older Visuals didn't come with function keys. This entry uses # ks and ke so that the keypad keys can be used as function keys. # If your version of vi doesn't support function keys you may want # to use V2. Vf|vi200f|visual|visual 200 no function keys:\ :al=\EL:am:bs:cd=\Ey:ce=4*\Ex:cl=\Ev:\ :cm=\EY%+ %+ :co#80:dc=4*\EO:dl=4*\EM:ho=\EH:\ :im=:ei=:ic=\Ei \b\Ej:\ :is=\E3\Eb\Ej\E\\\El\EG\Ed\Ek:ks=\E=:ke=\E>:\ :k0=\E?p:k1=\E?q:k2=\E?r:k3=\E?s:k4=\E?t:k5=\E?u:k6=\E?v:\ :k7=\E?w:k8=\E?x:k9=\E?y:kl=\ED:kr=\EC:ku=\EA:kd=\EB:kh=\EH:\ :li#24:nd=\EC:pt:sr=\EI:up=\EA:vs=\Ed:ve=\Ec: Vr|vi200rv|visual 200 reverse video:\ :so=\E4:se=\E3:sr@:vs@:ve@:tc=vi200: Vt|vi200ic|visual 200 using insert char:\ :ei=\Ej:im=\Ei:ic@:tc=vi200: Xa|tek|tek4012|4012|tektronix 4012:\ :is=\E^O:bs:cl=1000\E^L:co#75:ns:li#35:os: Xb|tek4013|4013|tektronix 4013:\ :as=\E^N:ae=\E^O:tc=4012: Xc|tek4014|4014|tektronix 4014:\ :is=\E^O\E9:co#81:li#38:dF#1000:tc=tek4012: Xd|tek4015|4015|tektronix 4015:\ :as=\E^N:ae=\E^O:tc=4014: Xe|tek4014sm|4014sm|tektronix 4014 in small font:\ :is=\E^O\E\072:co#121:li#58:tc=tek4014: Xf|tek4015sm|4015sm|tektronix 4015 in small font:\ :as=\E^N:ae=\E^O:tc=4014sm: # I think the 1000UP is supposed to be so expensive it never happens. X4|tek4023|4023|tektronix 4023:\ :so=^_P:se=^_@:cm=\034%r%+ %+ :nd=\t:bs:cl=4\E^L:co#80:li#24:am:\ :up=1000UP: # Can't use cursor motion because it's memory relative, and because # it only works in the workspace, not the monitor. Same for home. # Likewise, standout only works in the workspace. X5|4025|4027|4024|tek4025|tek4027|tek4024|4025cu|4027cu|tektronix 4024/4025/4027:\ :is=\41com 31\r\n^_sto 9,17,25,33,41,49,57,65,73\r:\ :ks=^_lea p4 /h/\r^_lea p8 /k/\r^_lea p6 / /\r^_lea p2 /j/\r^_lea f5 /H/\r:\ :ke=^_lea p2\r^_lea p4\r^_lea p6\r^_lea p8\r^_lea f5\r:\ :am:bs:da:db:pt:li#34:co#80:cl=^_era\r\n\n:up=^K:nd=^_rig\r:\ :al=145^_up\r^_ili\r:dl=^_dli\r:\ :dc=^_dch\r:im=^_ich\r:ei=^F\n^K:nl=^F\n:\ :ce=^_dch 80\r:cd=^_dli 50\r:CC=^_: X7|4025-17|4027-17|tek 4025 17 line window:li#17:tc=4025: X8|4025-17ws|4027-17ws|tek 4025 17 line window in workspace:\ :is=\41com 31\r\n^_sto 9,17,25,33,41,49,57,65,73\r^_wor 17\r^_mon 17\r:\ :ti=^_wor h\r:te=^_mon h\r:so=^_att e\r:se=^_att s\r:tc=4025-17: Xe|4025ex|4027ex|tek 4025 w/!:ti=\41com 31\r:te=^_com 33\r:\ :is=^_com 33\r\n\41sto 9,17,25,33,41,49,57,65,73\r:tc=4025: # Regent: lowest common denominator, works on all regents. a0|regent|adds regent series:\ :am:bs:cl=^L:cm=^K%+ ^P%B%.:co#80:ho=^A:li#24:ll=^A^Z:nd=^F:up=^Z: # Regent 100 has a bug where if computer sends escape when user is holding # down shift key it gets confused, so we avoid escape. a1|regent100|adds regent 100:\ :cm=^K%+ ^P%B%.:k1=^B1\r:k2=^B2\r:k3=^B3\r:k4=^B4\r:\ :k5=^B5\r:k6=^B6\r:k7=^B7\r:k8=^B8\r:\ :kh=^A:kl=^U:kr=^F:ku=^Z:kd=^J:tc=regent: # Regent 20, untested a2|regent20|adds regent 20:\ :cd=\Ek:ce=\EK:cm=\EY%+ %+ :tc=regent: a3|regent25|adds regent 25:\ :k0=^B0\r:k1=^B1\r:k2=^B2\r:k3=^B3\r:k4=^B4\r:\ :k5=^B5\r:k6=^B6\r:k7=^B7\r:k8=^B8\r:k9=^B9\r:\ :kh=^A:kl=^U:kr=^F:ku=^Z:kd=^J:tc=regent20: # Regent 40: untested a4|regent40|adds regent 40:\ :al=\EM:dl=\El:is=\EB:se=\E0@:so=\EOP:ue=\EO@:us=\E0`:vb=\ED\Ed:\ :tc=regent25: # If you have standout problem with regent 200, try so=\ER\EOP:se=\E0@\EV: a6|regent60|regent200|adds Regent 60:\ :dc=\EE:ei=\EF:im=\EF:is=\EV\EB:ko=dc,im,ei:tc=regent40: a7|regent60na|regent 60 w/no arrow keys:\ kl@:kr@:ku@:kd@:tc=regent60: # Note: if return acts weird on a980, check internal switch #2 # on the top chip on the CONTROL pc board. ac|a980|adds consul 980:\ :al=13\E^N:am:bs:cl=^L\200^K@:cm=^K%+@\E^E%2:co#80:dl=13\E^O:\ :k0=\E0:k1=\E1:k2=\E2:k3=\E3:k4=\E4:k5=\E5:k6=\E6:k7=\E7:k8=\E8:k9=\E9:\ :li#24:nd=\E^E01:so=^Y^^^N:se=^O:up=9: b2|sb2|sb3|fixed superbee:xb@:tc=superbee: bh|bh3m|beehiveIIIm:if=/usr/lib/tabset/beehive:\ :al=160^S:am:bs:cd=^R:ce=^P:cl=^E^R:co#80:dl=300^Q:ho=^E:li#20:ll=^E^K:\ :nd=^L:pt:se= ^_:so=^] :up=^K: # This loses on lines > 80 chars long, use at your own risk bi|superbeeic|super bee with insert char:\ :ic=:im=\EQ:ei=\ER:tc=superbee: bm|microb|microbee|micro bee series:\ :am:bs:cd=\EJ:ce=\EK:cl=\EE:co#80:cm=\EF%+ %+ :\ :k1=\Ep:k2=\Eq:k3=\Er:k4=\Es:k5=\Et:k6=\Eu:k7=\Ev:k8=\Ew:k9=\Ex:\ :kd=\EB:kh=\EH:kl=\ED:kr=\EC:ku=\EA:\ :li#24:nd=\EC:pt:se=\Ed@ :so= \EdP:ue=\Ed@:up=\EA:us=\Ed`: # Superbee - f1=escape, f2=^C. # Note: there are at least 3 kinds of superbees in the world. The sb1 # holds onto escapes and botches ^C's. The sb2 is the best of the 3. # The sb3 puts garbage on the bottom of the screen when you scroll with # the switch in the back set to CRLF instead of AEP. This description # is tested on the sb2 but should work on all with either switch setting. # The f1/f2 business is for the sb1 and the :xb: can be taken out for # the other two if you want to try to hit that tiny escape key. # This description is tricky: being able to use cm depends on there being # 2048 bytes of memory and the hairy nl string. bs|sb1|superbee|superb|beehive super bee:if=/usr/lib/tabset/stdcrt:is=\EE:\ :am:bs:cd=3\EJ:ce=3\EK:cl=3\EH\EJ:co#80:cm=\EF%r%3%3:cr=1000\r:\ :dC#10:da:db:xb:dc=3\EP:dl=100\EM:so=\E_1:se=\E_0:\ :li#25:nl=\n\200\200\200\n\200\200\200\EA\EK\200\200\200\ET\ET:\ :nd=\EC:pt:up=\EA:ho=\EH:ve=\n:\ :k1=\Ep:k2=\Eq:k3=\Er:k4=\Es:k5=\Et:k6=\Eu:k7=\Ev:k8=\Ew:\ :kd=\EB:kh=\EH:kl=\ED:kr=\EC:ku=\EA: c4|c1004p|c100 w/4 pages:\ :ti=\EU\Ev 8p\Ep\r:te=\Ev ~p\Ep\r\n:vs@:ve@:tc=c100: cP|c100rv4ppp|c100 with printer port:\ :is=\EU\Ef\E7\E5\E8\El\ENH\Ek\E\200\Eo&\200\Eo!\200\EQ"\EY(^W\Eo\47\E:\ :tc=c100rv4p: cR|c100rv4p|c100 w/4 pages:\ :ti=\EU\Ev 8p\Ep\r:te=\Ev ~p\Ep\r\n:tc=c100rv: # Some tty drivers use cr3 for concept, others use nl3, hence dN/dC below. # It seems rather strange to have is end in escape. I don't understand... cn|c100rv4pna|c100 with no arrows:ks@:ke@:tc=c100rv4p: cs|c100s|slowconcept|slowconcept100|slow concept 100:\ :vb=\Ek\200\EK:pt:dC@:dN@:tc=c100: cd|c100rvs|slow reverse concept 100:\ :vb=\EK\200\Ek:pt:dC@:dN@:tc=c100rv: # vt100 and vt132 are still untested d0|vt100n|vt100 w/no init:is@:if@:tc=vt100: d1|vt100|vt-100|pt100|pt-100|dec vt100:\ :co#80:li#24:am:cl=50\E[;H\E[2J:bs:cm=5\E[%i%2;%2H:nd=2\E[C:up=2\E[A:\ :ce=3\E[K:cd=50\E[J:so=2\E[7m:se=2\E[m:us=2\E[4m:ue=2\E[m:\ :is=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:ks=\E[?1h\E=:ke=\E[?1l\E>:\ :if=/usr/lib/tabset/vt100:ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:\ :kh=\E[H:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:pt:sr=5\EM: d2|gt42|dec gt42:\ :bs:co#72:ns:li#40:os: d3|vt132|vt-132:\ :al=99\E[L:dl=99\E[M:ip=7:dc=7\E[P:ei=\E[4h:im=\E[4l:xn:dN#30:tc=vt100: d4|gt40|dec gt40:\ :bs:co#72:ns:li#30:os: d5|vt50|dec vt50:\ :bs:cd=\EJ:ce=\EK:cl=\EH\EJ:co#80:li#12:nd=\EC:pt:up=\EA: dI|dw1|decwriter I:\ :bs:co#72:hc:os: dh|vt50h|dec vt50h:\ :bs:cd=\EJ:ce=\EK:cl=\EH\EJ:cm=\EY%+ %+ :co#80:li#12:nd=\EC:\ :pt:sr=\EI:up=\EA: ds|vt100s|vt-100s|pt100s|pt-100s|dec vt100 132 cols 14 lines:\ :li#14:tc=vt100w: dt|vt100w|vt-100w|pt100w|pt-100w|dec vt100 132 cols:\ :co#128:li#24:is=\E>\E[?3h\E[?4l\E[?5l\E[?7h\E[?8h:tc=vt100: dv|vt52|dec vt52:\ :bs:cd=\EJ:ce=\EK:cl=\EH\EJ:cm=\EY%+ %+ :co#80:li#24:nd=\EC:\ :pt:sr=\EI:up=\EA:ku=\EA:kd=\EB:kr=\EC:kl=\ED: dw|dw2|dw3|dw4|decwriter II:\ :kb=^h:bs:co#132:hc:os: e1|ep48|ep4080|execuport 4080:am:bs:os:co#80:hu=\036:hd=\034: e2|ep40|ep4000|execuport 4000:am:bs:os:co#136:hu=\036:hd=\034: g2|1200|tn1200|terminet 1200:\ :co#120:hc:os: g3|300|tn300|terminet 300:\ :co#120:hc:os: # Note: no "ho" on HP's since that homes to top of memory, not screen. # Due to severe braindamage, the only way to get the arrow keys to # transmit anything at all is to turn on the function key labels # (f1-f8) with ks, and even then the poor user has to hold down shift! # The default 2621 turns off the labels except when it has to to enable # the function keys. If your installation prefers labels on all the time, # or off all the time (at the "expense" of(( the function keys) move the # 2621nl or 2621wl labels to the front using reorder. # 2621k45: untested h3|2621k45|hp2621k45|k45|hp 2621 with 45 keyboard:\ :kb=^H:ku=\EA:kd=\EB:kl=\ED:kr=\EC:kh=\Eh:ks=\E&s1A:ke=\E&s0A:tc=2621: h4|hp|hp2645|2645|hp 264x series:\ :if=/usr/lib/tabset/stdcrt:\ :al=\EL:am:bs:cd=\EJ:ce=\EK:ch=\E&a%dC:cl=\EH\EJ:cm=6\E&a%r%dc%dY:\ :co#80:cv=\E&a%dY:da:db:dc=\EP:dl=\EM:ei=\ER:im=\EQ:\ :kb=^H:ku=\EA:kd=\EB:kl=\ED:kr=\EC:kh=\Eh:ks=\E&s1A:ke=\E&s0A:\ :li#24:mi:ml=\El:mu=\Em:nd=\EC:pt:se=\E&d@:so=\E&dJ:\ :us=\E&dD:ue=\E&d@:up=\EA:xs: h6|hp2626|hp2626a|hp2626p|2626|2626a|2626p|hp 2626:\ :is=\E&j@\r\E3\r:if=/usr/lib/tabset/stdcrt:\ :al=\EL:am:bs:bt=\Ei:cd=\EJ:ce=\EK:cl=\EH\EJ:\ :cm=\E&a%r%dc%dY:co#80:da:db:dc=2\EP:dl=\EM:ei=\ER:\ :im=\EQ:ip=2:li#24:mi:nd=\EC:pt:se=\E&d@:so=\E&dB:up=\EA:\ :kh=\Eh:ku=\EA:kl=\ED:kr=\EC:kd=\EB:\ :ma=j^Jk^P^K^Pl :sf=\ES:\ :ta=2^I:xs: # cD a pain - only screw up at 9600 baud. h8|hp2648|hp2648a|2648a|2648|HP 2648a graphics terminal:\ :cl=50\EH\EJ:cm=20\E&a%r%dc%dY:dc=7\EP:ip#5:is=130\Eg:tc=2645: # 2640a doesn't have the Y cursor addressing feature, and C is memory relative # instead of screen relative, as we need . ha|2640|hp2640a|2640a|hp 2640a:cm@:ks@:ke@:tc=2645: hb|2640b|hp2640b|2644a|hp2644a|hp 264x series:ks@:ke@:tc=2645: # 2621 using all 48 lines of memory, only 24 visible at any time. Untested. hb|big2621|48 line 2621:li#48:ho=\EH:cm=\E&a%r%dc%dR:tc=2621: hn|2621nl|hp2621nl|2621|hp 2621 with no labels:ks@:ke@:kh@:ku@:kl@:kr@:kd@:tc=hp2621: hw|2621wl|hp2621wl|2621|hp 2621 with labels:is=\E&jA\r\E3\r:ke=\E&jA:tc=hp2621: # Infoton is now called General Terminal Corp. or some such thing. # gt100 sounds like something DEC would come out with. Lets hope they don't. i1|i100|gt100|gt100a|General Terminal 100A (formerly Infoton 100):\ :cl=^L:cd=\EJ:ce=\EK:li#24:co#80:\ :al=\EL:dl=\EM:up=\EA:nd=\EC:ho=\EH:cm=\Ef%r%+ %+ :vb=\Eb\Ea:am:bs:\ :so=\Eb:se=\Ea: i4|i400|400|infoton 400:\ :if=/usr/lib/tabset/infoton_tabs:\ :al=\E[L:am:bs:ce=\E[N:cl=\E[2J:cm=%i\E[%3;%3H:co#80:dl=\E[M:li#25:\ :nd=\E[C:up=\E[A:im=\E[4h\E[2Q:ei=\E[4l\E[0Q:\ :dc=\E[4h\E[2Q\E[P\E[4l\E[0Q: ia|addrinfo:\ :li#24:co#80:cl=^L:ho=^H:nd=^Y:cd=^K:\ :up=^\:am:bc=^Z:cm=\037%+\377%+\377:ll=^H^\: ik|infotonKAS:\ :am:bc=^Z:cd=^K:cl=^L:co#80:li#24:nd=^Y:up=^\:ll=^H^\: kA|h19A|heathA|h19A|heathkitA|heathkit h19 ansi mode:\ :al=1*\E[1L:am:bs:cd=\E[J:ce=\E[K:cl=\E[2J:cm=\E[%i%2;%2H:co#80:\ :dc=\E[1P:dl=1*\E[1M:dn=\E[1B:ei=\E[4l:ho=\E[H:im=\E[4h:li#24:mi:\ :nd=\E[1C:as=\E[10m:ae=\E[11m:ms:pt:se=\E[0m:so=\E[7m:up=\E[1A:\ :vs=\E[>4h:ve=\E[>4l:kb=^h:ku=\E[1A:kd=\E[1B:kl=\E[1D:kr=\E[1C:\ :kh=\E[H:kn#8:k1=\EOS:k2=\EOT:k3=\EOU:k4=\EOV:k5=\EOW:l6=blue:\ :l7=red:l8=white:k6=\EOP:k7=\EOQ:k8=\EOR:\ :sr=\EM:is=\E<\E[>1;2;3;4;5;6;7;8;9l\E[0m\E[11m\E[?7h: kB|h19bs|heathkit w/keypad shifted:ks=\Et:ke=\Eu:tc=h19b: kU|h19us|heathkit w/keypad shifted/underscore cursor:ks=\Et:ke=\Eu:tc=h19u: ku|h19u|heathkit with underscore cursor:vs@:ve@:tc=h19b: l1|adm31|31|lsi adm31:is=\Eu\E0:\ :al=\EE:am:bs:ce=\ET:cm=\E=%+ %+ :cl=\E*:co#80:dc=\EW:dl=\ER:\ :ei=\Er:ho=^^:im=\Eq:li#24:mi:nd=^L:se=\EG0:so=\EG4:up=^K:\ :kl=^H:kd=^J:ku=^K:kr=^L:ma=^K^P^L : l2|adm2|lsi adm2:\ :al=\EE:am:bs:cd=\EY:ce=\ET:cl=\E;:cm=\E=%+ %+ :co#80:dc=\EW:dl=\ER:\ :ei=:ho=^^:ic=\EQ:im=:kd=^J:kh=^^:kl=^H:kr=^L:ku=^K:li#24:nd=^L:up=^K: l4|adm42|42|lsi adm42:vs=\EC\E3 \E3(:\ :al=270\EE:am:bs:cd=\EY:ce=\ET:cl=\E;:cm=\E=%+ %+ :co#80:\ :dc=\EW:dl=\ER:ei=\Er:im=\Eq:ip=6*:li#24:\ :bt=\EI:nd=^L:se=\EG0:so=\EG4:ta=\t:up=^k:\ :ma=^K^P:pc=\177: lb|adm3a+|3a+:kl=^H:kd=^J:ku=^K:kr=^L:tc=adm3a: # These mime1 entries refer to the Microterm Mime I or Mime II. # The default mime is assumed to be in enhanced act iv mode. m3|mime3a|mime1 emulating 3a:\ :am@:ma=^X ^K^J^Z^P:ku=^Z:kd=^K:kl=^H:kr=^X:tc=adm3a: m4|microterm|act4|microterm act iv:\ :am:bs:cd=^_:ce=^^:cl=^L:cm=^T%.%.:co#80:li#24:nd=^X:up=^Z:ho=^]: # The padding on sr and ta for act5 and mime is a guess and not final. m5|microterm5|act5|microterm act v:\ :uc=\EA:pt:ta=2^I:sr=3\EH:ku=^Z:kd=^K:kl=^H:kr=^X:ma=^Z^P^Xl^Kj:tc=act4: # act5s is not tested and said not to work. mS|act5s|skinny act5:ti=\EP:te=\EQ:li#48:co#39:tc=act5: # Mimes using brightness for standout. Half bright is really dim unless # you turn up the brightness so far that lines show up on the screen. # uc is disabled to get around a curses bug, and should be put back in someday. mf|mimefb|full bright mime1:so=^Y:se=^S:uc@:is=^S\E:tc=mime: mh|mimehb|half bright mime1:so=^S:se=^Y:uc@:is=^Y\E:tc=mime: # These termcaps (for mime 2a) put the terminal in low intensity mode # since high intensity mode is so obnoxious. ms|mime2as|microterm mime2a (emulating an enhanced soroc iq120):\ :al=20*^A:am:bs:cd=20*\EJ:ce=\EK:cl=\EL:cm=\E=%+ %+ :co#80:dc=\ED:\ :dl=20*^W:kl=^H:kr=^L:ku=^K:kd=^J:ho=^^:is=\E):sr=\EI\ :im=\EE:ei=^Z:ip=2:li#24:nd=^L:so=\E\072:se=\E;:up=\EI:\ :us=\E6:ue=\E7: # This is the preferred mode (but ^X can't be used as a kill character) mv|mime2a|mime2av|microterm mime2a (emulating an enhanced vt52):\ :al=20*^A:bs:cd=20*\EQ:co#80:ce=\EP:cl=\EL:cm=\EY%+ %+ :is=^Y\ :dc=^N:dl=20*^W:ip=2:ei=^Z:ho=\EH:im=^O:kd=\EB:kl=\ED:kr=\EC:ku=\EA:\ :li#24:nd=\EC:pt:se=\E9:so=\E8:up=\EA:sr=\EA:us=\E4:ue=\E5: mx|mime3ax|mime1 emulating enhanced 3a:\ :al=80^A:dl=80^W:pt:ce=^X:cd=^_:tc=mime3a: pf|fox|perkin elmer 1100:if=/usr/lib/tabset/stdcrt:\ :am:bs:cd=5.5*\EJ:ce=\EI:cl=132\EH\EJ:co#80:ho=\EH:li#24:\ :ll=\EH\EA:nd=\EC:cm=\EX%+ \EY%+ :up=\EA:vb=^P^B^P^C: po|owl|perkin elmer 1200:if=/usr/lib/tabset/stdcrt:\ :al=5.5*\EL:am:bs:cd=5.5*\EJ:ce=5.5\EI:cl=132\EH\EJ:ho=\EH:ll=\EH\EA:\ :cm=\EX%+ \EY%+ :co#80:dc=5.5*\EO:dl=5.5*\EM:ei=:ic=\EN:im=:ip=5.5*:\ :kb=^h:in:li#24:nd=\EC:up=\EA:se?=\E!\200:so?=\E!^H:vb=^P^B^P^C:\ :k1=\ERA:k2=\ERB:k3=\ERC:k4=\ERD:k5=\ERE:k6=\ERF:\ :k7=\ERG:k8=\ERH:k9=\ERI:k0=\ERJ: qB|bc|bill croft homebrew:\ :am:bs:cm=\E=%+ %+ :cl=^Z:co#96:ho=^^:li#72:\ :nd=^L:up=^K:vb=: qN|nucterm|rayterm|NUC homebrew:\ :am:bs:cl=1^L:li#24:co#80:nd=^C:up=^N:ho=^B:ll=^K:ce=^A:cd=^E: qb|ex3000:\ :li#24:co#80:ho=^Q: qc|carlock|klc:\ :al=^E:am:bs:ce=^U:cl=100^Z:cm=\E=%+ %+ :co#80:dc=\177:dl=^D:dm=:\ :ed=:ei=^T:ho=^^:im=^T:li#24:nd=^L:se=^V:so=^V:up=^K:vb=\EV\EV: qe|exidy|exidy2500|exidy sorcerer as dm2500:\ :al=^P^J^X:am:bs:ce=^W:cl=^^:cm=^L%r%n%.%.:co#64:\ :dc=\b:dl=^P^Z^X:dm=^P:ed=^X:ei=^X:ho=^B:ic=^\:\ :im=^P:li#30:nd=^\:pt:so=^N:se=^X:up=^Z: qn|netx|netronics:\ :bs:cd=2000^F^E:ce=1600^E:cl=466^L:cm=\E=%+@%+@:co#64:ho=^D:\ :li#16:ma=j^Jk^Pl :nd=\E+@A:pc=\200:sr=\E=@@^K:up=^K: # This came from the comp ctr who got it from some user. Smart indeed! qs|sexidy|exidy smart:\ :li#24:co#64:cl=^l:ho=^q:nd=^s:up=^w:bs:bc=^a:ma=^x^J:kd=^S: qu|ubell|ubellchar:if=/usr/staff/michael/term/startup:\ :am:bs:pt:ce=\Ed:cl=^Z:cm=\E=%+ %+ :co#80:li#24:nd=^L:up=^K:\ :ma=j^Jk^P^K^Pl :ho=^^: qw|ttyWilliams:\ :co#80:li#12:bc=^Y:do=^K:up=^Z:cl=^^:ce=^_:am:ho=^]:nd=^X: qx|xitex|xitex sct-100:\ :bs:cd=2000^F^E:ce=1600^E:cl=400^L:cm=\E=%+@%+@:co#64:ho=^D:\ :li#16:ma=j^Jk^Pl :nd=\E+@A:pc=\200:sr=\E=@@^K:up=^K: t3|ti|ti700|ti733|735|ti735|ti silent 700:\ :bs:co#80:hc:os:dC#162: t4|ti745|745|743|ti silent 745:\ :bs:co#80:hc:os: # There are some tvi's that require incredible amounts of padding and # some that don't. I'm assuming 912 and 920 are the old slow ones, # and 912b, 912c, 920b, 920c are the new ones that don't need padding. v1|tvi912|912|920|tvi920|old televideo:if=/usr/lib/tabset/stdcrt:\ :al=33*\EE:am:bs:ce=\ET:cm=\E=%+ %+ :cl=^Z:co#80:dc=\EW:dl=33*\ER:ei=:\ :kb=^h:ku=^K:kd=^J:kl=^H:kr=^L:k0=^A@\r:k1=^AA\r:k2=^AB\r:k3=^AC\r:\ :k4=^AD\r:k5=^AE\r:k6=^AF\r:k7=^AG\r:k8=^AH\r:k9=^AI\r:\ :ho=^^:im=:ic=\EQ:li#24:nd=^L:pt:se=\Ek:so=\Ej:up=^K:us=\El:ue=\Em:\ :ma=^K^P^L :sg=1:ug=1: v2|912b|912c|920b|920c|tvi|new televideo 912/920:\ :al=5*\EE:dl=5*\ER:tc=912: # is turns off status line (\Eg) and turns on keypad (\El). # It seems like it should be :ks=\El:ke=\Ek:, but we want the tab and backspace # keys to work when out of vi, too! v5|tvi950|950|televideo 950:\ :is=\Eg\El:sr=\Ej:bt=\EI:do=^V:im=\Eq:ei=\Er:ic@:\ :kb=^H:kh=^^:ku=^K:kd=^V:kl=^H:kr=^L:\ :k0=^A0\r:k1=^A@\r:k2=^AA\r:k3=^AB\r:\ :k4=^AC\r:k5=^AD\r:k6=^AE\r:k7=^AF\r:k8=^AG\r:k9=^AH\r:\ :al=\EE:dl=\ER:\ :so=\EG4:se=\EG0:us=\EG8:ue=\EG0:sg#1:ug#1:xn:tc=912c: # Note two things called "teleray". Reorder should move the common one # to the front if you have either. A dumb teleray with the cursor stuck # on the bottom and no obvious model number is probably a 3700. y1|t3700|teleray|dumb teleray 3700:\ :bs:cl=^L:co#80:li#24: y3|t3800|teleray 3800 series: \ :bs:cd=\EJ:ce=\EK:cl=^L:cm=\EY%+ %+ :co#80: \ :do=\n:ho=\EH:li#24:ll=\EY7 :nd=\EC:pt:up=^K: y6|t1061|t10|teleray|teleray 1061:if=/usr/lib/tabset/teleray:\ :al=2*\EL:am:bs:cd=1\EJ:ce=\EK:cl=1^L:cm=\EY%+ %+ :co#80:\ :dc=\EQ:dl=2*\EM:ei=:ho=\EH:ic=\EP:im=:ip=0.4*:\ :k1=^Z1:k2=^Z2:k3=^Z3:k4=^Z4:k5=^Z5:k6=^Z6:k7=^Z7:k8=^Z8:\ :li#24:nd=\EC:pt:se=\ER@:so= \ERD:\ :is=\Ee\EU01^Z1\EV\EU02^Z2\EV\EU03^Z3\EV\EU04^Z4\EV\EU05^Z5\EV\EU06^Z6\EV\EU07^Z7\EV\EU08^Z8\EV\Ef:\ :up=\EA:us=\ERH:ue=\ER@:xs:xt:sg=2:ug=1: yf|t1061f|teleray 1061 with fast PROMs:\ al=\EL:ip@:dl=\EM:tc=t1061: # # ---- # Convention: First entry is two chars, first char is manufacturer, # second char is canonical abbreviation for model or mode. # Second entry is canonical abbreviation. # Third entry is the one the editor will print with "set" command. # Last entry is verbose description. # Others are mnemonic synonyms for the terminal. # # If you absolutely MUST check for a specific terminal (this is discouraged) # check for the 2nd entry (the canonical form) since all other codes are # subject to change. The two letter codes are there for version 6 and are # EXTREMELY subject to change, or even to go away if version 6 becomes for # all practical purposes obsolete. # # Special manufacturer codes: # M: Misc. (with only a few terminals) # q: Homemade # s: special (dialup, etc.) # # This file is to be installed with an editor script that moves the most # common terminals to the front of the file. If the source is not available, # it can be constructed by sorting # the above entrie((s by the 2 char initial code. er codes are there for version 6 and are # EXTREMELY subject to change, or even to go away if version 6 becomes for # all practical purposes obsolete. # # Special manufacturer codes: # M: Misc. (with only a few terminals) # q: Homemade # s: special (dialup, etc.) # # This file is to be installed with an editor script that moves the most # common terminals to the front of the file. If the source is not available, # it can be constructed by sorting # the above entriecmd/dump/ 775 0 33 0 2552530171 5460 cmd/dump/dumpoptr.c 444 0 33 21027 2447631353 7610 static char *sccsid = "@(#)dumpoptr.c 1.4 (Berkeley) 12/17/80"; #include "dump.h" /* * This is from /usr/include/grp.h * That defined struct group, which conflicts * with the struct group defined in param.h */ struct Group { /* see getgrent(3) */ char *gr_name; char *gr_passwd; int gr_gid; char **gr_mem; }; struct Group *getgrnam(); /* * Query the operator; This fascist piece of code requires * an exact response. * It is intended to protect dump aborting by inquisitive * people banging on the console terminal to see what is * happening which might cause dump to croak, destroying * a large number of hours of work. * * Every 2 minutes we reprint the message, alerting others * that dump needs attention. */ int timeout; char *attnmessage; /* attemtion message */ query(question) char *question; { char replybuffer[64]; int back; FILE *mytty; if ( (mytty = fopen("/dev/tty", "r")) == NULL){ msg("fopen on /dev/tty fails\n"); abort(); } attnmessage = question; timeout = 0; alarmcatch(); for(;;){ if ( fgets(replybuffer, 63, mytty) == NULL){ if (ferror(mytty)){ clearerr(mytty); continue; } } else if ( (strcmp(replybuffer, "yes\n") == 0) || (strcmp(replybuffer, "Yes\n") == 0)){ back = 1; goto done; } else if ( (strcmp(replybuffer, "no\n") == 0) || (strcmp(replybuffer, "No\n") == 0)){ back = 0; goto done; } else { msg("\"Yes\" or \"No\" ONLY!\n"); alarmcatch(); } } done: /* * Turn off the alarm, and reset the signal to trap out.. */ alarm(0); if (signal(SIGALRM, sigalrm) == SIG_IGN) signal(SIGALRM, SIG_IGN); fclose(mytty); return(back); } /* * Alert the console operator, and enable the alarm clock to * sleep for 2 minutes in case nobody comes to satisfy dump */ alarmcatch() { if (timeout) msgtail("\n"); msg("NEEDS ATTENTION: %s: (\"yes\" or \"no\") ", attnmessage); signal(SIGALRM, alarmcatch); alarm(120); timeout = 1; } /* * Here if an inquisitive operator interrupts the dump program */ interrupt() { msg("Interrupt received. Do >>>YOU<<< know what are you doing?\n"); if (query("Do you really want to abort dump?")) dumpabort(); signal(SIGINT, interrupt); } /* * The following variables and routines manage alerting * operators to the status of dump. * This works much like wall(1) does. */ struct Group *gp; /* * Get the names from the group entry "operator" to notify. */ set_operators() { if (!notify) /*not going to notify*/ return; gp = getgrnam(OPGRENT); endgrent(); if (gp == (struct Group *)0){ msg("No entry in /etc/group for %s.\n", OPGRENT); notify = 0; return; } } struct tm *localtime(); struct tm *localclock; /* * We fork a child to do the actual broadcasting, so * that the process control groups are not messed up */ broadcast(message) char *message; { time_t clock; FILE *f_utmp; struct utmp utmp; int nusers; char **np; int pid, s; switch (pid = fork()) { case -1: return; case 0: break; default: while (wait(&s) != pid) continue; return; } if (!notify || gp == 0) exit(0); clock = time(0); localclock = localtime(&clock); if((f_utmp = fopen("/etc/utmp", "r")) == NULL) { msg("Cannot open /etc/utmp\n"); return; } nusers = 0; while (!feof(f_utmp)){ if (fread(&utmp, sizeof (struct utmp), 1, f_utmp) != 1) break; if (utmp.ut_name[0] == 0) continue; nusers++; for (np = gp->gr_mem; *np; np++){ if (strncmp(*np, utmp.ut_name, sizeof(utmp.ut_name)) != 0) continue; /* * Do not send messages to operators on dialups */ if (strncmp(utmp.ut_line, DIALUP, strlen(DIALUP)) == 0) continue; #ifdef DEBUG msg("Message to %s at %s\n", utmp.ut_name, utmp.ut_line); #endif DEBUG sendmes(utmp.ut_line, message); } } fclose(f_utmp); Exit(0); /* the wait in this same routine will catch this */ /* NOTREACHED */ } sendmes(tty, message) char *tty, *message; { char t[50], buf[BUFSIZ]; register char *cp; register int c, ch; int msize; FILE *f_tty; msize = strlen(message); strcpy(t, "/dev/"); strcat(t, tty); if((f_tty = fopen(t, "w")) != NULL) { setbuf(f_tty, buf); fprintf(f_tty, "\nMessage from the dump program to all operators at %d:%02d ...\r\n\n" ,localclock->tm_hour ,localclock->tm_min); for (cp = message, c = msize; c-- > 0; cp++) { ch = *cp; if (ch == '\n') putc('\r', f_tty); putc(ch, f_tty); } fclose(f_tty); } } /* * print out an estimate of the amount of time left to do the dump */ time_t tschedule = 0; timeest() { time_t tnow, deltat; time (&tnow); if (tnow >= tschedule){ tschedule = tnow + 300; if (blockswritten < 500) return; deltat = tstart_writing - tnow + (((1.0*(tnow - tstart_writing))/blockswritten) * esize); msg("%3.2f%% done, finished in %d:%02d\n", (blockswritten*100.0)/esize, deltat/3600, (deltat%3600)/60); } } int blocksontape() { /* * esize: total number of blocks estimated over all reels * blockswritten: blocks actually written, over all reels * etapes: estimated number of tapes to write * * tsize: blocks can write on this reel * asize: blocks written on this reel * tapeno: number of tapes written so far */ if (tapeno == etapes) return(esize - (etapes - 1)*tsize); return(tsize); } /* VARARGS1 */ /* ARGSUSED */ msg(fmt, a1, a2, a3, a4, a5) char *fmt; { fprintf(stderr," DUMP: "); #ifdef TDEBUG fprintf(stderr,"pid=%d ", getpid()); #endif fprintf(stderr, fmt, a1, a2, a3, a4, a5); fflush(stdout); fflush(stderr); } /* VARARGS1 */ /* ARGSUSED */ msgtail(fmt, a1, a2, a3, a4, a5) char *fmt; { fprintf(stderr, fmt, a1, a2, a3, a4, a5); } /* * Tell the operator what has to be done; * we don't actually do it */ getfstab() { register struct fstab *dt; struct fstab *fsp; nfstab = 0; if (setfsent() == 0) { msg("Can't open %s for dump table information.\n", FSTAB); } else { for (nfstab = 0, dt = fstab; nfstab < MAXFSTAB;){ if ( (fsp = getfsent()) == 0) break; if ( (strcmp(fsp->fs_type, FSTAB_RW) == 0) || (strcmp(fsp->fs_type, FSTAB_RO) == 0) ){ *dt = *fsp; nfstab++; dt++; } } endfsent(); } } /* * Search in the fstab for a file name. * This file name can be either the special or the path file name. * * The entries in the fstab are the BLOCK special names, not the * character special names. * The caller of fstabsearch assures that the character device * is dumped (that is much faster) * * The file name can omit the leading '/'. */ struct fstab *fstabsearch(key) char *key; { register struct fstab *dt; int i; int keylength; char *rawname(); keylength = min(strlen(key), sizeof (dt->fs_file)); for (i = 0, dt = fstab; i < nfstab; i++, dt++){ if (strncmp(dt->fs_file, key, keylength) == 0) return(dt); if (strncmp(dt->fs_spec, key, keylength) == 0) return(dt); if (strncmp(rawname(dt->fs_spec), key, keylength) == 0) return(dt); if (key[0] != '/'){ if ( (dt->fs_spec[0] == '/') && (strncmp(dt->fs_spec+1, key, keylength) == 0)) return(dt); if ( (dt->fs_file[0] == '/') && (strncmp(dt->fs_file+1, key, keylength) == 0)) return(dt); } } return(0); } /* * Tell the operator what to do */ lastdump(arg) char arg; /* w ==> just what to do; W ==> most recent dumps */ { char *lastname; char *date; register int i; time_t tnow; register struct fstab *dt; int dumpme; register struct idates *itwalk; int idatesort(); time(&tnow); getfstab(); /* /etc/fstab input */ inititimes(); /* /etc/dumpdates input */ qsort(idatev, nidates, sizeof(struct idates *), idatesort); if (arg == 'w') fprintf(stdout, "Dump these file systems:\n"); else fprintf(stdout, "Last dump(s) done (Dump '>' file systems):\n"); lastname = "??"; ITITERATE(i, itwalk){ if (strncmp(lastname, itwalk->id_name, sizeof(itwalk->id_name)) == 0) continue; date = (char *)ctime(&itwalk->id_ddate); date[16] = '\0'; /* blast away seconds and year */ lastname = itwalk->id_name; dt = fstabsearch(itwalk->id_name); dumpme = ( (dt != 0) && (dt->fs_freq != 0) && (itwalk->id_ddate < tnow - (dt->fs_freq*DAY))); if ( (arg != 'w') || dumpme) fprintf(stdout,"%c %8s\t(%6s) Last dump: Level %c, Date %s\n", dumpme && (arg != 'w') ? '>' : ' ', itwalk->id_name, dt ? dt->fs_file : 0, itwalk->id_incno, date ); } } int idatesort(p1, p2) struct idates **p1, **p2; { int diff; diff = strncmp((*p1)->id_name, (*p2)->id_name, sizeof((*p1)->id_name)); if (diff == 0) return ((*p2)->id_ddate - (*p1)->id_ddate); else return (diff); } int max(a,b) { return(a>b?a:b); } int min(a,b)(( { return(a' : ' ', itwalk->id_name, dt ? dt->fs_file : 0, itwalk->id_incno, date ); } } int idatesort(p1, p2) struct idates **p1, **p2; { int diff; diff = strncmp((*p1)->id_name, (*p2)->id_name, sizeof((*p1)->id_name)); if (diff == 0) return ((*p2)->id_ddate - (*p1)->id_ddate); else return (diff); } int max(a,b) { return(a>b?a:b); } int min(a,b)cmd/dump/Makefile 444 0 33 1514 2475063511 7205 # sccsid = "@(#)Makefile 1.3 (Berkeley) 2/20/81" # # dump.h header file # dumpitime.c reads /etc/ddate # dumpmain.c driver # dumpoptr.c operator interface # dumptape.c handles the mag tape and opening/closing # dumptraverse.c traverses the file system # unctime.c undo ctime # # DEBUG use local directory to find ddate and dumpdates # TDEBUG trace out the process forking # PSRCS = \ dump.h dumpmain.c dumptraverse.c dumptape.c dumpoptr.c dumpitime.c SRCS = \ dump.h dumpitime.c \ dumpmain.c dumpoptr.c dumptape.c \ dumptraverse.c unctime.c OBJS = \ dumpitime.o \ dumpmain.o dumpoptr.o \ dumptape.o dumptraverse.o unctime.o DFLAGS = CFLAGS = -O $(DFLAGS) dump: $(OBJS) $(CC) $(CFLAGS) $(OBJS) -o dump install: install -s dump $(DESTDIR)/etc clean: rm -f *.o dump lint: lint $(DFLAGS) $(SRCS) psrcs: echo $(PSRCS) dumpdates # TDEBUG trace out the process forking # PSRCS = \ dump.h dumpmain.c dumptraverse.c dumptape.c dumpoptr.c dumpitime.c SRCS = \ dump.h dumpitime.c \ dumpmain.c dumcmd/dump/dump.h 444 0 33 6625 2422206614 6666 /* * "@(#)dump.h 1.1 (Berkeley) 10/13/80" */ #define NI 16 #define DIRPB (BSIZE/sizeof(struct direct)) #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define MWORD(m,i) (m[(unsigned)(i-1)/MLEN]) #define MBIT(i) (1<<((unsigned)(i-1)%MLEN)) #define BIS(i,w) (MWORD(w,i) |= MBIT(i)) #define BIC(i,w) (MWORD(w,i) &= ~MBIT(i)) #define BIT(i,w) (MWORD(w,i) & MBIT(i)) short clrmap[MSIZ]; short dirmap[MSIZ]; short nodmap[MSIZ]; /* * All calculations done in 0.1" units! */ char *disk; /* name of the disk file */ char *tape; /* name of the tape file */ char *increm; /* name of the file containing incremental information*/ char incno; /* increment number */ int uflag; /* update flag */ int fi; /* disk file descriptor */ int to; /* tape file descriptor */ ino_t ino; /* current inumber; used globally */ int nsubdir; int newtape; /* new tape flag */ int nadded; /* number of added sub directories */ int dadded; /* directory added flag */ int density; /* density in 0.1" units */ long tsize; /* tape size in 0.1" units */ long esize; /* estimated tape size, blocks */ long asize; /* number of 0.1" units written on current tape */ int etapes; /* estimated number of tapes */ int notify; /* notify operator flag */ int blockswritten; /* number of blocks written on current tape */ int tapeno; /* current tape number */ time_t tstart_writing; /* when started writing the first tape block */ char *processname; char *ctime(); char *prdate(); long atol(); int mark(); int add(); int dump(); int tapsrec(); int dmpspc(); int dsrch(); int nullf(); char *getsuffix(); char *rawname(); int interrupt(); /* in case operator bangs on console */ #define HOUR (60L*60L) #define DAY (24L*HOUR) #define YEAR (365L*DAY) /* * Exit status codes */ #define X_FINOK 1 /* normal exit */ #define X_REWRITE 2 /* restart writing from the check point */ #define X_ABORT 3 /* abort all of dump; don't attempt checkpointing*/ #ifdef DEBUG #define OINCREM "./ddate" /*old format incremental info*/ #define NINCREM "./dumpdates" /*new format incremental info*/ #else not DEBUG #define OINCREM "/etc/ddate" /*old format incremental info*/ #define NINCREM "/etc/dumpdates" /*new format incremental info*/ #endif #define TAPE "/dev/rmt8" /* default tape device */ #define DISK "/dev/rrp1g" /* default disk */ #define OPGRENT "operator" /* group entry to notify */ #define DIALUP "ttyd" /* prefix for dialups */ #define MAXFSTAB 32 struct fstab fstab[MAXFSTAB]; struct fstab *fstabsearch(); /* search in fs_file and fs_spec */ int nfstab; /* * The contents of the file NINCREM is maintained both on * a linked list, and then (eventually) arrayified. */ struct itime{ struct idates it_value; struct itime *it_next; }; struct itime *ithead; /* head of the list version */ int nidates; /* number of records (might be zero) */ int idates_in; /* we have read the increment file */ struct idates **idatev; /* the arrayfied version */ #define ITITERATE(i, ip) for (i = 0,ip = idatev[0]; i < nidates; i++, ip = idatev[i]) /* * We catch these interrupts */ int sighup(); int sigquit(); int sigill(); int sigtrap(); int sigfpe(); int sigkill(); int sigbus(); int sigsegv(); int sigsys(); int sigalrm(); int sigterm(); me *it_next; }; struct itime *ithead; /* head of the list version */ int nidates; /* number of records (micmd/dump/dumpitime.c 444 0 33 11103 2422206616 7716 static char *sccsid = "@(#)dumpitime.c 1.1 (Berkeley) 10/13/80"; #include "dump.h" char *prdate(d) time_t d; { char *p; if(d == 0) return("the epoch"); p = ctime(&d); p[24] = 0; return(p); } struct idates **idatev = 0; int nidates = 0; int idates_in = 0; struct itime *ithead = 0; inititimes() { FILE *df; register int i; register struct itime *itwalk; if (idates_in) return; if ( (df = fopen(increm, "r")) == NULL){ nidates = 0; ithead = 0; } else { do{ itwalk=(struct itime *)calloc(1,sizeof (struct itime)); if (getrecord(df, &(itwalk->it_value)) < 0) break; nidates++; itwalk->it_next = ithead; ithead = itwalk; } while (1); fclose(df); } idates_in = 1; /* * arrayify the list, leaving enough room for the additional * record that we may have to add to the idate structure */ idatev = (struct idates **)calloc(nidates + 1,sizeof (struct idates *)); for (i = nidates-1, itwalk = ithead; i >= 0; i--, itwalk = itwalk->it_next) idatev[i] = &itwalk->it_value; } getitime() { register struct idates *ip; register int i; char *fname; fname = disk; #ifdef FDEBUG msg("Looking for name %s in increm = %s for delta = %c\n", fname, increm, incno); #endif spcl.c_ddate = 0; inititimes(); /* * Go find the entry with the same name for a lower increment * and older date */ ITITERATE(i, ip){ if(strncmp(fname, ip->id_name, sizeof (ip->id_name)) != 0) continue; if (ip->id_incno >= incno) continue; if (ip->id_ddate <= spcl.c_ddate) continue; spcl.c_ddate = ip->id_ddate; } } putitime() { FILE *df; register struct idates *itwalk; register int i; char *fname; if(uflag == 0) return; fname = disk; spcl.c_ddate = 0; ITITERATE(i, itwalk){ if (strncmp(fname, itwalk->id_name, sizeof (itwalk->id_name)) != 0) continue; if (itwalk->id_incno != incno) continue; goto found; } /* * construct the new upper bound; * Enough room has been allocated. */ itwalk = idatev[nidates] = (struct idates *)calloc(1, sizeof(struct idates)); nidates += 1; found: strncpy(itwalk->id_name, fname, sizeof (itwalk->id_name)); itwalk->id_incno = incno; itwalk->id_ddate = spcl.c_date; if ( (df = fopen(increm, "w")) == NULL){ msg("Cannot open %s\n", increm); dumpabort(); } ITITERATE(i, itwalk){ recout(df, itwalk); } fclose(df); msg("level %c dump on %s\n", incno, prdate(spcl.c_date)); } recout(file, what) FILE *file; struct idates *what; { fprintf(file, DUMPOUTFMT, what->id_name, what->id_incno, ctime(&(what->id_ddate)) ); } int recno; int getrecord(df, idatep) FILE *df; struct idates *idatep; { char buf[BUFSIZ]; recno = 0; if ( (fgets(buf, BUFSIZ, df)) != buf) return(-1); recno++; if (makeidate(idatep, buf) < 0) msg("Unknown intermediate format in %s, line %d\n", NINCREM, recno); #ifdef FDEBUG msg("getrecord: %s %c %s\n", idatep->id_name, idatep->id_incno, prdate(idatep->id_ddate)); #endif return(0); } /* * Convert from old format to new format * Convert from /etc/ddate to /etc/dumpdates format */ o_nconvert() { FILE *oldfile; FILE *newfile; struct idates idate; struct idates idatecopy; if( (newfile = fopen(NINCREM, "w")) == NULL){ msg("%s: Can not open %s to update.\n", processname, NINCREM); Exit(X_ABORT); } if ( (oldfile = fopen(OINCREM, "r")) != NULL){ while(!feof(oldfile)){ if (fread(&idate, sizeof(idate), 1, oldfile) != 1) break; /* * The old format ddate did not have * the full special path name on it; * we add the prefix /dev/ to the * sp((ecial name, although this may not be * always the right thing to do. */ idatecopy = idate; strcpy(idatecopy.id_name, "/dev/"); strncat(idatecopy.id_name, idate.id_name, sizeof(idate.id_name) - sizeof ("/dev/")); recout(newfile, &idatecopy); } } fclose(oldfile); fclose(newfile); } time_t unctime(); int makeidate(ip, buf) struct idates *ip; char *buf; { char un_buf[128]; sscanf(buf, DUMPINFMT, ip->id_name, &ip->id_incno, un_buf); ip->id_ddate = unctime(un_buf); if (ip->id_ddate < 0) return(-1); return(0); } est(ip) struct dinode *ip; { long s; esize++; s = (ip->di_size + BSIZE-1) / BSIZE; esize += s; if(s > NADDR-3) { /* * This code is only appproximate. * it totally estimates low on doubly and triply indirect * files. */ s -= NADDR-3; s = (s + (BSIZE/sizeof(daddr_t))-1) / (BSIZE/sizeof(daddr_t)); esize += s; } } bmapest(map) short *map; { register i, n; n = -1; for(i=0; idi_size + BSIZE-1) / BSIZE; esize += s; if(s > NADDR-3) { /* * This code is only appproximate. * it totally estimates low on doubly and triply indirect * files. */ s -= NADDR-3; s = (s + (BSIZE/sizeof(daddr_t))-1) / (BSIZE/sizeof(daddr_t)); esize += s; } } bmapest(map) short *map; { register i, n; n = -1; for(i=0; i 1) { argv++; argc--; arg = *argv; if (*arg == '-') argc++; } while(*arg) switch (*arg++) { case 'w': lastdump('w'); /* tell us only what has to be done */ exit(0); break; case 'W': /* what to do */ lastdump('W'); /* tell us the current state of what has been done */ exit(0); /* do nothing else */ break; case 'J': /* update old to new */ o_nconvert(); exit(0); /* do nothing else */ break; case 'f': /* output file */ if(argc > 1) { argv++; argc--; tape = *argv; } break; case 'd': /* density, in bits per inch */ if (argc > 1) { argv++; argc--; density = atoi(*argv) / 10; } break; case 's': /* tape size, feet */ if(argc > 1) { argv++; argc--; tsize = atol(*argv); tsize *= 12L*10L; } break; case '0': /* dump level */ case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': incno = arg[-1]; break; case 'u': /* update /etc/dumpdates */ uflag++; break; case 'n': /* notify operators */ notify++; break; default: printf("bad key '%c%'\n", arg[-1]); Exit(X_ABORT); } if(argc > 1) { argv++; argc--; disk = *argv; } if (signal(SIGHUP, sighup) == SIG_IGN) signal(SIGHUP, SIG_IGN); if (signal(SIGTRAP, sigtrap) == SIG_IGN) signal(SIGTRAP, SIG_IGN); if (signal(SIGFPE, sigfpe) == SIG_IGN) signal(SIGFPE, SIG_IGN); if (signal(SIGBUS, sigbus) == SIG_IGN) signal(SIGBUS, SIG_IGN); if (signal(SIGSEGV, sigsegv) == SIG_IGN) signal(SIGSEGV, SIG_IGN); if (signal(SIGTERM, sigterm) == SIG_IGN) signal(SIGTERM, SIG_IGN); if (signal(SIGINT, interrupt) == SIG_IGN) signal(SIGINT, SIG_IGN); set_operators(); /* /etc/group snarfed */ getfstab(); /* /etc/fstab snarfed */ /* * disk can be either the full special file name, * the suffix of the special file name, * the special name missing the leading '/', * the file system name with or without the leading '/'. */ dt = fstabsearch(disk); if (dt != 0) disk = rawname(dt->fs_spec); getitime(); /* /etc/dumpdates snarfed */ msg("Date of this level %c dump: %s\n", incno, prdate(spcl.c_date)); msg("Date of last level %c dump: %s\n", incno, prdate(spcl.c_ddate)); msg("Dumping %s ", disk); if (dt != 0) msgtail("(%s) ", dt->fs_file); msgtail("to %s\n", tape); fi = open(disk, 0); if (fi < 0) { msg("Cannot open %s\n", disk); Exit(X_ABORT); } CLR(clrmap); CLR(dirmap); CLR(nodmap); esize = 0; msg("mapping (Pass I) [regular files]\n"); pass(mark, (short *)NULL); /* mark updates esize */ do { msg("mapping (Pass II) [directories]\n"); nadded = 0; pass(add, dirmap); } while(nadded); bmapest(clrmap); bmapest(nodmap); fetapes = ( esize /* blocks */ *BSIZE /* bytes / block */ *(1.0/density) /* 0.1" / byte */ + esize /* blocks */ *(1.0/NTREC) /* IRG's / block */ *7 /* 0.1" / IRG */ ) * (1.0 / tsize ) /* tape / 0.1" */ ; etapes = fetapes; /* truncating assignment */ etapes++; /* * esize is typically about 5% too low; we frob it here */ esize += ((5*esize)/100); msg("estimated %ld tape blocks on %3.2f tape(s).\n", esize, fetapes); otape(); /* bitmap is the first to tape write */ time(&(tstart_writing)); bitmap(clrmap, TS_CLRI); msg("dumping (Pass III) [directories]\n"); pass(dump, dirmap); msg("dumping (Pass IV) [regular files]\n"); pass(dump, nodmap); spcl.c_type = TS_END; for(i=0; i= NTREC) flusht(); } tapsrec(d) daddr_t d; { if(d == 0) return; tdaddr[trecno] = d; trecno++; spcl.c_tapea++; if(trecno >= NTREC) flusht(); } int nogripe = 0; flusht() { register i, si; daddr_t d; while(trecno < NTREC) tdaddr[trecno++] = 1; loop: d = 0; for(i=0; i tsize) { close_rewind(); otape(); } timeest(); } rewind() { int secs; int f; #ifdef DEBUG msg("Waiting 10 seconds to rewind.\n"); sleep(10); #else /* * It takes about 3 minutes, 25secs to rewind 2300' of tape */ msg("Tape rewinding\n", secs); close(to); while ((f = open(tape, 0)) < 0) sleep (10); close(f); #endif } close_rewind() { close(to); if (!nogripe){ rewind(); msg("Change Tapes: Mount tape #%d\n", tapeno+1); broadcast("CHANGE TAPES!\7\7\n"); } do{ if (query ("Is the new tape mounted and ready to go?")) break; if (query ("Do you want to abort?")){ dumpabort(); /*NOTREACHED*/ } } while (1); } /* * We implement taking and restoring checkpoints on * the tape level. * When each tape is opened, a new process is created by forking; this * saves all of the necessary context in the parent. The child * continues the dump; the parent waits around, saving the context. * If the child returns X_REWRITE, then it had problems writing that tape; * this causes the parent to fork again, duplicating the context, and * everything continues as if nothing had happened. */ otape() { (( int parentpid; int childpid; int status; int waitpid; int sig_ign_parent(); int interrupt(); /* * Force the tape to be closed */ close(to); parentpid = getpid(); restore_check_point: signal(SIGINT, interrupt); /* * All signals are inherited... */ childpid = fork(); if (childpid < 0){ msg("Context save fork fails in parent %d\n", parentpid); Exit(X_ABORT); } if (childpid != 0){ /* * PARENT: * save the context by waiting * until the child doing all of the work returns. * don't catch the interrupt */ signal(SIGINT, SIG_IGN); #ifdef TDEBUG msg("Tape: %d; parent process: %d child process %d\n", tapeno+1, parentpid, childpid); #endif TDEBUG for (;;){ waitpid = wait(&status); if (waitpid != childpid){ msg("Parent %d waiting for child %d has another child %d return\n", parentpid, childpid, waitpid); } else break; } if (status & 0xFF){ msg("Child %d returns LOB status %o\n", childpid, status&0xFF); } status = (status >> 8) & 0xFF; #ifdef TDEBUG switch(status){ case X_FINOK: msg("Child %d finishes X_FINOK\n", childpid); break; case X_ABORT: msg("Child %d finishes X_ABORT\n", childpid); break; case X_REWRITE: msg("Child %d finishes X_REWRITE\n", childpid); break; default: msg("Child %d finishes unknown %d\n", childpid,status); break; } #endif TDEBUG switch(status){ case X_FINOK: Exit(X_FINOK); case X_ABORT: Exit(X_ABORT); case X_REWRITE: goto restore_check_point; default: msg("Bad return code from dump: %d\n", status); Exit(X_ABORT); } /*NOTREACHED*/ } else { /* we are the child; just continue */ #ifdef TDEBUG sleep(4); /* allow time for parent's message to get out */ msg("Child on Tape %d has parent %d, my pid = %d\n", tapeno+1, parentpid, getpid()); #endif do{ to = creat(tape, 0666); if (to < 0) { if (!query("Cannot open tape. Do you want to retry the open?")) dumpabort(); } else break; } while (1); asize = 0; tapeno++; /* current tape sequence */ newtape++; /* new tape signal */ spcl.c_volume++; spcl.c_type = TS_TAPE; spclrec(); if (tapeno > 1) msg("Tape %d begins with blocks from ino %d\n", tapeno, ino); } } /* * The parent still catches interrupts, but does nothing with them */ sig_ign_parent() { msg("Waiting parent receives interrupt\n"); signal(SIGINT, sig_ign_parent); } dumpabort() { msg("The ENTIRE dump is aborted.\n"); Exit(X_ABORT); } Exit(status) { #ifdef TDEBUG msg("pid = %d exits with status %d\n", getpid(), status); #endif TDEBUG exit(status); } pcl.c_volume++; spcl.c_type = TS_TAPE; spclrec(); if (tapeno > 1) msg("Tape %d begins with blocks from ino %d\n", tapeno, ino); } } /* * The parent still catches interrupts, but does nothing with them */ sig_ign_parent() { msg("Waiting parent receives interrupt\n"); signal(SIGINT, sig_ign_parent); } dumpabort() { msg("The ENTIRE dump is aborted.\n"); Exit(X_ABORT); } Exit(status) { #ifdef TDEBUG msg("pidcmd/dump/dumptraverse.c 444 0 33 10371 2422206621 10444 static char *sccsid = "@(#)dumptraverse.c 1.1 (Berkeley) 10/13/80"; #include "dump.h" struct filsys sblock; struct dinode itab[INOPB * NI]; pass(fn, map) int (*fn)(); short *map; { register i, j; int bits; ino_t mino; daddr_t d; sync(); bread((daddr_t)1, (char *)&sblock, sizeof(sblock)); mino = (sblock.s_isize-2) * INOPB; ino = 0; for(i=2;; i+=NI) { if(ino >= mino) break; d = (unsigned)i; for(j=0; j= mino) break; if((ino % MLEN) == 0) { bits = ~0; if(map != NULL) bits = *map++; } ino++; if(bits & 1) { if(d != 0) { bread(d, (char *)itab, sizeof(itab)); d = 0; } (*fn)(&itab[j]); } bits >>= 1; } } } icat(ip, fn1, fn2) struct dinode *ip; int (*fn1)(), (*fn2)(); { register i; daddr_t d[NADDR]; l3tol(&d[0], &ip->di_addr[0], NADDR); (*fn2)(d, NADDR-3); for(i=0; idi_mode & IFMT; if(f == 0) return; BIS(ino, clrmap); if(f == IFDIR) BIS(ino, dirmap); if(ip->di_mtime >= spcl.c_ddate || ip->di_ctime >= spcl.c_ddate) { BIS(ino, nodmap); if (f != IFREG){ esize += 1; return; } est(ip); } } add(ip) struct dinode *ip; { if(BIT(ino, nodmap)) return; nsubdir = 0; dadded = 0; icat(ip, dsrch, nullf); if(dadded) { BIS(ino, nodmap); est(ip); nadded++; } if(nsubdir == 0) if(!BIT(ino, nodmap)) BIC(ino, dirmap); } dump(ip) struct dinode *ip; { register i; if(newtape) { newtape = 0; bitmap(nodmap, TS_BITS); } BIC(ino, nodmap); spcl.c_dinode = *ip; spcl.c_type = TS_INODE; spcl.c_count = 0; i = ip->di_mode & IFMT; if(i != IFDIR && i != IFREG) { spclrec(); return; } icat(ip, tapsrec, dmpspc); } dmpspc(dp, n) daddr_t *dp; { register i, t; spcl.c_count = n; for(i=0; i BREADEMAX){ msg("More than %d block read errors from %d\n", BREADEMAX, disk); broadcast("DUMP IS AILING!\n"); msg("This is an unrecoverable error.\n"); if (!query("Do you want to attempt to continue?")){ dumpabort(); /*NOTREACHED*/ } else breaderrors = 0; } } } CLR(map) register short *map; { register n; n = MSIZ; do *map++ = 0; while(--n); } \n", disk, da, c, regc, &c, n); #ifdef ERNIE msg("Notify Robert Henry of this error.\n"); #endif if (++breaderrors > BREADEMAX){ msg("More than %d block read errors from %d\n", BREADEMAX, disk); broadcast("DUMP IS AILING!\n"); msg("This is an cmd/dump/unctime.c 444 0 33 3547 2517645526 7376 #include #include #include /* * Convert a ctime(3) format string into a system format date. * Return the date thus calculated. * * Return -1 if the string is not in ctime format. */ /* * Offsets into the ctime string to various parts. */ #define E_MONTH 4 #define E_DAY 8 #define E_HOUR 11 #define E_MINUTE 14 #define E_SECOND 17 #define E_YEAR 20 time_t unctime(str) char *str; { struct tm then; char dbuf[30]; time_t emitl(); if (strlen(str) != 25) str[25] = 0; strcpy(dbuf, str); dbuf[E_MONTH+3] = 0; if ( (then.tm_mon = lookup(&dbuf[E_MONTH])) < 0) { return(-1);; } then.tm_mday = atoi(&dbuf[E_DAY]); then.tm_hour = atoi(&dbuf[E_HOUR]); then.tm_min = atoi(&dbuf[E_MINUTE]); then.tm_sec = atoi(&dbuf[E_SECOND]); then.tm_year = atoi(&dbuf[E_YEAR]) - 1900; return(emitl(&then)); } static char months[] = "JanFebMarAprMayJunJulAugSepOctNovDec"; static lookup(str) char *str; { register char *cp, *cp2; for (cp = months, cp2 = str; *cp != 0; cp += 3) if (strncmp(cp, cp2, 3) == 0) return((cp-months) / 3); return(-1); } /* * Routine to convert a localtime(3) format date back into * a system format date. * * Use a binary search. */ struct tm *localtime(); time_t emitl(dp) struct tm *dp; { time_t conv; register int i, bit; struct tm dcopy; dcopy = *dp; dp = &dcopy; conv = 0; for (i = 30; i >= 0; i--) { bit = 1 << i; conv |= bit; if (dcmp(localtime(&conv), dp) > 0) conv &= ~bit; } return(conv); } /* * Compare two localtime ((dates, return result. */ #define DECIDE(a) \ if (dp->a > dp2->a) \ return(1); \ if (dp->a < dp2->a) \ return(-1) static dcmp(dp, dp2) register struct tm *dp, *dp2; { DECIDE(tm_year); DECIDE(tm_mon); DECIDE(tm_mday); DECIDE(tm_hour); DECIDE(tm_min); DECIDE(tm_sec); return(0); } static char *sccsid = "@(#)unctime.c 1.3 (Berkeley) 81/04/18"; 0; i >= 0; i--) { bit = 1 << i; conv |= bit; if (dcmp(localtime(&conv), dp) > 0) conv &= ~bit; } return(conv); } /* * Compare two localtime cmd/troff/ 775 0 33 0 2552570744 5645 cmd/troff/Makenroff 644 0 33 1010 2346517333 7547 CFLAGS = -O -DNROFF -DVMUNIX c = ni.o nii.o n1.o n2.o n3.o n4.o n5.o n6.o n7.o n8.o n9.o n10.o s = hytab.o ntab.o suftab.o nroff : $c $s $(CC) -z -o nroff $s $c hytab.o : hytab.c cc -S hytab.c /usr/src/cmd/as/:rofix hytab.s as -o hytab.o hytab.s rm hytab.s ntab.o: ntab.c cc -S ntab.c /usr/src/cmd/as/:rofix ntab.s as -o ntab.o ntab.s rm ntab.s suftab.o: suftab.c cc -S suftab.c /usr/src/cmd/as/:rofix suftab.s as -o suftab.o suftab.s rm suftab.s install : install -s nroff /usr/bin clean : rm -f *.o -O -DNROFF -DVMUNIX c = ni.o nii.o n1.o n2.o n3.o n4.o n5.o n6.o n7.o n8.o n9.o n10.o s = hytab.o ntab.o suftab.o nroff : $c $s $(CC) -z -o nroff $s $c hytab.o : hytab.c cc -S hytab.c /usr/src/cmd/as/:rofix hytab.s as -o hytab.o hytab.s rm hytab.s ntab.o: ntab.c cc -S ntab.c /usr/src/cmd/as/:rofix ntab.s as -o ntab.o ntab.s rm ntab.s suftab.o: suftab.c cc -S suftab.c /usr/src/cmd/as/:rofix suftab.s as -o suftab.o suftab.s rm suftab.s install : install -s nroff /usr/bin clean : rmcmd/troff/Maketroff 644 0 33 1014 2346517333 7561 CFLAGS = -O -DVMUNIX c = ni.o nii.o n1.o n2.o n3.o n4.o n5.o t6.o n7.o n8.o n9.o t10.o s = hytab.o suftab.o tab3.o troff : $c $s $(CC) -z -o troff $s $c hytab.o : hytab.c cc -S hytab.c /usr/src/cmd/as/:rofix hytab.s as -o hytab.o hytab.s rm hytab.s suftab.o: suftab.c cc -S suftab.c /usr/src/cmd/as/:rofix suftab.s as -o suftab.o suftab.s rm suftab.s # tab3.o: tab3.c # cc -S tab3.c # /usr/src/cmd/as/:rofix tab3.s # as -o tab3.o tab3.s # rm tab3.s # install : install -s troff /usr/bin clean : rm -f *.o -DVMUNIX c = ni.o nii.o n1.o n2.o n3.o n4.o n5.o t6.o n7.o n8.o n9.o t10.o s = hytab.o suftab.o tab3.o troff : $c $s $(CC) -z -o troff $s $c hytab.o : hytab.c cc -S hytab.c /usr/src/cmd/as/:rofix hytab.s as -o hytab.o hytab.s rm hytab.s suftab.o: suftab.c cc -S suftab.c /usr/src/cmd/as/:rofix suftab.s as -o suftab.o suftab.s rm suftab.s # tab3.o: tab3.c # cc -S tab3.c # /usr/src/cmd/as/:rofix tab3.s # as -o tab3.o tab3.s # rm tab3.s # install : install -s troff /usr/bin clean :cmd/troff/README 644 0 33 1111 2346517334 6577 The version of [nt]roff in this directory is changed somewhat from the version you may be used to. 1. fonts are in /usr/lib/font/ftXX, where XX is the name of the font (e.g., HI). Source is in ./font/ftXX.c. 2. macro files like -ms are searched for in /usr/lib/tmac/tmac.xxx. Your /usr/lib/tmac may have to be changed. The .so request has been modified to make it a fatal error to try .so non-existent-file; this should head off people who are explcitly including /usr/lib/tmac.s, etc. 3. terminal driving tables for nroff are in /usr/lib/term/tabxxx instead of /usr/lib/term/xxx. rsion you may be used to. 1. fonts are in /usr/lib/font/ftXX, where XX is the name of the font (e.g., HI). Source is in ./font/ftXX.c. 2. macro files like -ms are searched for in /usr/lib/tmac/tmac.xxx. Your /usr/lib/tmac may have to be changed. The .so request has been modified to make it a fatal error to try .so non-existent-file; this should head off people who are explcitly including /usr/lib/tmac.s, etc. 3. terminal driving tacmd/troff/d.h 644 0 33 144 2346517335 6301 struct d {filep op; int dnl,dimac,ditrap,ditf,alss,blss,nls,mkline, maxl,hnl,curd;} d[NDI], *dip; 1. fonts are in /usr/lib/font/ftXX, where XX is the name of the font (e.g., HI). Source is in ./font/ftXX.c. 2. macro files like -ms are searched for in /usr/lib/tmac/tmac.xxx. Your /usr/lib/tmac may have to be changed. The .so request has been modified to make it a fatal error to try .so non-existent-file; this shoul/,5< /,"cmd/troff/font/ 775 0 33 0 2527315541 6605 cmd/troff/font/ftB.c 644 0 33 3507 2111463576 7555 /*modified for Commercial II*/ char Bw[256-32] { /*Times Bold widths*/ 12, /*space*/ 13, /*!*/ 0, /*"*/ 0, /*#*/ 18, /*$*/ 28, /*%*/ 27, /*&*/ 12, /*' close*/ 16, /*(*/ 16, /*)*/ 18, /***/ 36, /*+*/ 12, /*,*/ 14, /*- hyphen*/ 12, /*.*/ 18, /*/*/ 19+0200, /*0*/ 19+0200, /*1*/ 19+0200, /*2*/ 19+0200, /*3*/ 19+0200, /*4*/ 19+0200, /*5*/ 19+0200, /*6*/ 19+0200, /*7*/ 19+0200, /*8*/ 19+0200, /*9*/ 13, /*:*/ 13, /*;*/ 0, /*<*/ 36, /*=*/ 0, /*>*/ 22, /*?*/ 0, /*@*/ 28+0200, /*A*/ 26+0200, /*B*/ 26+0200, /*C*/ 29+0200, /*D*/ 25+0200, /*E*/ 23+0200, /*F*/ 28+0200, /*G*/ 32+0200, /*H*/ 16+0200, /*I*/ 21+0200, /*J*/ 28+0200, /*K*/ 25+0200, /*L*/ 36+0200, /*M*/ 30+0200, /*N*/ 29+0200, /*O*/ 25+0200, /*P*/ 29+0300, /*Q*/ 28+0200, /*R*/ 23+0200, /*S*/ 25+0200, /*T*/ 29+0200, /*U*/ 27+0200, /*V*/ 36+0200, /*W*/ 27+0200, /*X*/ 28+0200, /*Y*/ 27+0200, /*Z*/ 12, /*[*/ 0, /*\*/ 12, /*]*/ 0, /*^*/ 0, /*_*/ 12, /*` open*/ 19, /*a*/ 19+0200, /*b*/ 16, /*c*/ 19+0200, /*d*/ 17, /*e*/ 13+0200, /*f*/ 18+0100, /*g*/ 22+0200, /*h*/ 12+0200, /*i*/ 12+0300, /*j*/ 23+0200, /*k*/ 12+0200, /*l*/ 32, /*m*/ 22, /*n*/ 18, /*o*/ 20+0100, /*p*/ 19+0100, /*q*/ 15, /*r*/ 17, /*s*/ 13+0200, /*t*/ 21, /*u*/ 19, /*v*/ 27, /*w*/ 21, /*x*/ 19+0100, /*y*/ 17, /*z*/ 0, /*{*/ 2, /*|*/ 0, /*}*/ 0, /*~*/ 6, /*narrow space*/ 14, /*hyphen*/ 27, /*bullet*/ 27, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 28, /*1/4*/ 28, /*1/2*/ 28, /*3/4*/ 36, /*minus*/ 22, /*fi*/ 22, /*fl*/ 23, /*ff*/ 33, /*ffi*/ 33, /*ffl*/ 15, /*degree*/ 20, /*dagger*/ 0, /*section*/ 9, /*foot mark*/ 0, /*'*/ 0, /*`*/ 0, /*_*/ 0, 3, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0, 20, /*registered*/ 20, /*copywrite*/ 0, 19, /*cent*/ }; phen*/ 27, /*bullet*/ 27, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 28, /*1/4*/ 28, /*1/2*/ 28, /*3/4*/ 36, /*minus*/ 22, /*fi*/ 22, /*fl*/ 23, /*ff*/ 33, /*ffi*/ 33, /*ffl*/ cmd/troff/font/ftBC.c 644 0 33 3516 2111463576 7660 ((char XXw[256-32] { /*XX*/ 12, /*space*/ 11, /*!*/ 0, /*"*/ 0, /*#*/ 15, /*$*/ 19, /*%*/ 19, /*&*/ 7, /*' close*/ 8, /*(*/ 8, /*)*/ 14, /***/ 27, /*+*/ 7, /*,*/ 11, /*- hyphen*/ 7, /*.*/ 14, /*/*/ 15+0200, /*0*/ 15+0200, /*1*/ 15+0200, /*2*/ 15+0200, /*3*/ 15+0200, /*4*/ 15+0200, /*5*/ 15+0200, /*6*/ 15+0200, /*7*/ 15+0200, /*8*/ 15+0200, /*9*/ 11, /*:*/ 11, /*;*/ 0, /*<*/ 27, /*=*/ 0, /*>*/ 17, /*?*/ 0, /*@*/ 16+0200, /*A*/ 16+0200, /*B*/ 16+0200, /*C*/ 17+0200, /*D*/ 13+0200, /*E*/ 13+0200, /*F*/ 17+0200, /*G*/ 17+0200, /*H*/ 8+0200, /*I*/ 13+0200, /*J*/ 15+0200, /*K*/ 13+0200, /*L*/ 24+0200, /*M*/ 18+0200, /*N*/ 17+0200, /*O*/ 15+0200, /*P*/ 17+0300, /*Q*/ 16+0200, /*R*/ 15+0200, /*S*/ 14+0200, /*T*/ 17+0200, /*U*/ 15+0200, /*V*/ 23+0200, /*W*/ 15+0200, /*X*/ 14+0200, /*Y*/ 13+0200, /*Z*/ 12, /*[*/ 0, /*\*/ 12, /*]*/ 0, /*^*/ 0, /*_*/ 7, /*` open*/ 13, /*a*/ 13+0200, /*b*/ 12, /*c*/ 13+0200, /*d*/ 13, /*e*/ 9+0200, /*f*/ 13+0100, /*g*/ 13+0200, /*h*/ 7+0200, /*i*/ 7+0300, /*j*/ 12+0200, /*k*/ 7+0200, /*l*/ 20, /*m*/ 13, /*n*/ 13, /*o*/ 13+0100, /*p*/ 13+0100, /*q*/ 8, /*r*/ 11, /*s*/ 8+0200, /*t*/ 13, /*u*/ 11, /*v*/ 19, /*w*/ 10, /*x*/ 12+0100, /*y*/ 9, /*z*/ 0, /*{*/ 2, /*|*/ 0, /*}*/ 0, /*~*/ 6, /*narrow space*/ 11, /*hyphen*/ 27, /*bullet*/ 27, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 19, /*1/4*/ 19, /*1/2*/ 19, /*3/4*/ 27, /*minus*/ 17, /*fi*/ 17, /*fl*/ 18, /*ff*/ 26, /*ffi*/ 26, /*ffl*/ 13, /*degree*/ 17, /*dagger*/ 0, /*section*/ 10, /*foot mark*/ 0, /*'*/ 0, /*`*/ 0, /*_*/ 0,3, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0, 20, /*registered*/ 20, /*copywrite*/ 0, 15, /*cent*/ 0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0}; e*/ 19, /*1/4*/ 19, /*1/2*/ 19, /*3/4*/ 27, /*minus*/ 17, /*fi*/ 17, /*fl*/ 18, /*ff*/ 26, /*ffi*/ 26, /*ffl*/ 13, /*degree*/ 17, /*dagger*/ 0, /*section*/ 10, /*foocmd/troff/font/ftBC.n 644 0 33 443 2111463576 7647 13 8 13 20 7 7 9 11 13 13 10 9 7 13 12 13 36 11 13 18 12 7 13 7 13 19 8 19 11 11 19 13 14 7 13 19 7 19 12 19 17 14 17 17 18 24 13 16 17 8 15 16 15 13 13 17 16 15 14 13 15 16 23 13 17 15 15 15 15 15 15 15 15 15 15 15 14 27 17 17 18 15 26 26 8 8 12 12 13 17 27 20 11 27 11 27 17 10 2 20 27 15 ,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0}; e*/ 19, /*1/4*/ 19, /*1/2*/ 19, /*3/4*/ 27, /*minus*/ 17, /*fi*/ 17, /*fl*/ 18, /|,|5x< /,"cmd/troff/font/ftC.c 644 0 33 3564 2111463576 7561 char Cw[256-32] { /*Comm I news Condensed made to look like II*/ 12, /*space*/ 8, /*!*/ 0, /*"*/ 0, /*#*/ 16, /*$*/ 24, /*%*/ 23, /*&*/ 8, /*' close*/ 11, /*(*/ 11, /*)*/ 14, /***/ 27, /*+*/ 8, /*,*/ 10, /*- hyphen*/ 8, /*.*/ 18, /*/*/ 16+0200, /*0*/ 16+0200, /*1*/ 16+0200, /*2*/ 16+0200, /*3*/ 16+0200, /*4*/ 16+0200, /*5*/ 16+0200, /*6*/ 16+0200, /*7*/ 16+0200, /*8*/ 16+0200, /*9*/ 8, /*:*/ 8, /*;*/ 0, /*<*/ 27, /*=*/ 0, /*>*/ 14, /*?*/ 0, /*@*/ 19+0200, /*A*/ 17+0200, /*B*/ 17+0200, /*C*/ 17+0200, /*D*/ 15+0200, /*E*/ 15+0200, /*F*/ 18+0200, /*G*/ 17+0200, /*H*/ 8+0200, /*I*/ 13+0200, /*J*/ 17+0200, /*K*/ 15+0200, /*L*/ 22+0200, /*M*/ 18+0200, /*N*/ 18+0200, /*O*/ 16+0200, /*P*/ 18+0300, /*Q*/ 17+0200, /*R*/ 17+0200, /*S*/ 17+0200, /*T*/ 17+0200, /*U*/ 17+0200, /*V*/ 24+0200, /*W*/ 16+0200, /*X*/ 17+0200, /*Y*/ 15+0200, /*Z*/ 10, /*[*/ 0, /*\*/ 10, /*]*/ 0, /*^*/ 0, /*_*/ 8, /*` open*/ 14, /*a*/ 15+0200, /*b*/ 14, /*c*/ 15+0200, /*d*/ 14, /*e*/ 11+0200, /*f*/ 14+0100, /*g*/ 14+0200, /*h*/ 8+0200, /*i*/ 8+0300, /*j*/ 14+0200, /*k*/ 8+0200, /*l*/ 22, /*m*/ 14, /*n*/ 15, /*o*/ 15+0100, /*p*/ 15+0100, /*q*/ 10, /*r*/ 14, /*s*/ 12+0200, /*t*/ 14, /*u*/ 14, /*v*/ 20, /*w*/ 13, /*x*/ 14+0100, /*y*/ 12, /*z*/ 0, /*{*/ 5, /*|*/ 0, /*}*/ 0, /*~*/ 6, /*narrow space*/ 10, /*hyphen*/ 27, /*bullet*/ 36, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 24, /*1/4*/ 24, /*1/2*/ 24, /*3/4*/ 27, /*minus*/ 18, /*fi*/ 18, /*fl*/ 20, /*ff*/ 18, /*ffi*/ 19, /*ffl*/ 15, /*degree*/ 19, /*dagger*/ 0, /*section*/ 9, /*foot mark*/ 0, /*'*/ 0, /*`*/ 0, /*_*/ 0,3, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0, 0, /*registered*/ 0, /*copywrite*/ 0, 0, /*cent*/ 0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0}; *rule*/ 24, /*1/4*/ 24, /*1/2*/ 24, /*3/4*/ 27, /*minus*/ 18, /*fi*/ 18, /*fl*/ 20, /*ff*/ 18, /*ffi*/ 19, /*ffl*/ 15, /*degree*/ cmd/troff/font/ftC.n 644 0 33 442 2111463576 7544 14 12 14 22 8 8 12 14 15 15 13 11 8 14 14 15 36 8 14 18 14 8 14 8 15 24 10 24 14 10 20 15 18 8 14 24 8 23 14 24 18 17 18 17 18 22 15 17 18 8 16 17 17 15 15 17 17 17 17 15 16 19 24 13 17 17 16 16 16 16 16 16 16 16 16 16 14 27 18 18 20 0 19 18 11 11 10 10 15 19 27 0 8 27 8 27 14 9 5 0 36 16 , 0, /*cent*/ 0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0}; *rule*/ 24, /*1/4*/ 24, /*1/2*/ 24, /*3/4*/ 2/|,|5< /,"cmd/troff/font/ftCE.c 644 0 33 3514 2111463576 7661 /*modified for Commercial II*/ char CEw[256-32] { /*Century Expanded widths*/ 12, /*space*/ 13, /*!*/ 0, /*"*/ 20, /*#*/ 18, /*$*/ 24, /*%*/ 27, /*&*/ 9, /*' close*/ 15, /*(*/ 15, /*)*/ 16, /***/ 27, /*+*/ 9, /*,*/ 14, /*- hyphen*/ 9, /*.*/ 12, /*/*/ 18+0200, /*0*/ 18+0200, /*1*/ 18+0200, /*2*/ 18+0200, /*3*/ 18+0200, /*4*/ 18+0200, /*5*/ 18+0200, /*6*/ 18+0200, /*7*/ 18+0200, /*8*/ 18+0200, /*9*/ 13, /*:*/ 13, /*;*/ 0, /*<*/ 27, /*=*/ 0, /*>*/ 19, /*?*/ 30, /*@*/ 28+0200, /*A*/ 25+0200, /*B*/ 25+0200, /*C*/ 27+0200, /*D*/ 26+0200, /*E*/ 25+0200, /*F*/ 26+0200, /*G*/ 29+0200, /*H*/ 15+0200, /*I*/ 20+0200, /*J*/ 28+0200, /*K*/ 25+0200, /*L*/ 32+0200, /*M*/ 29+0200, /*N*/ 25+0200, /*O*/ 24+0200, /*P*/ 26+0300, /*Q*/ 26+0200, /*R*/ 22+0200, /*S*/ 24+0200, /*T*/ 28+0200, /*U*/ 28+0200, /*V*/ 36+0200, /*W*/ 27+0200, /*X*/ 27+0200, /*Y*/ 24+0200, /*Z*/ 12, /*[*/ 0, /*\*/ 12, /*]*/ 0, /*^*/ 0, /*_*/ 9, /*` open*/ 18, /*a*/ 19+0200, /*b*/ 16, /*c*/ 19+0200, /*d*/ 17, /*e*/ 13+0200, /*f*/ 20+0100, /*g*/ 19+0200, /*h*/ 10+0200, /*i*/ 12+0300, /*j*/ 20+0200, /*k*/ 10+0200, /*l*/ 29, /*m*/ 19, /*n*/ 17, /*o*/ 19+0100, /*p*/ 19+0100, /*q*/ 16, /*r*/ 15, /*s*/ 14+0200, /*t*/ 19, /*u*/ 19, /*v*/ 27, /*w*/ 19, /*x*/ 20+0100, /*y*/ 17, /*z*/ 0, /*{*/ 5, /*|*/ 0, /*}*/ 0, /*~*/ 6, /*narrow space*/ 14, /*hyphen*/ 27, /*bullet*/ 27, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 24, /*1/4*/ 24, /*1/2*/ 24, /*3/4*/ 27, /*minus*/ 20, /*fi*/ 20, /*fl*/ 22, /*ff*/ 30, /*ffi*/ 30, /*ffl*/ 13, /*degree*/ 18, /*dagger*/ 0, /*section*/ 8, /*foot mark*/ 0, /*'*/ 0, /*`*/ 0, /*_*/ 0, 3, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0, 20, /*registered*/ 20, /*copywrite*/ 0, 18, /*cent*/ }; phen*/ 27, /*bullet*/ 27, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 24, /*1/4*/ 24, /*1/2*/ 24, /*3/4*/ 27, /*minus*/ 20, /*fi*/ 20, /*fl*/ 22, /*ff*/ 30, /*ffi*/ 30, /*fcmd/troff/font/ftCK.c 644 0 33 3533 2111463576 7670 /*modified for Commercial II*/ char CKw[256-32] { /*Century Bold Italic widths (CK)*/ 12, /*space*/ 14, /*!*/ 0, /*"*/ 0, /*#*/ 19, /*$*/ 31, /*%*/ 30, /*&*/ 10, /*' close*/ 18, /*(*/ 18, /*)*/ 18, /***/ 27, /*+*/ 10, /*,*/ 14, /*- hyphen*/ 10, /*.*/ 11, /*/*/ 19+0200, /*0*/ 19+0200, /*1*/ 19+0200, /*2*/ 19+0200, /*3*/ 19+0200, /*4*/ 19+0200, /*5*/ 19+0200, /*6*/ 19+0200, /*7*/ 19+0200, /*8*/ 19+0200, /*9*/ 13, /*:*/ 13, /*;*/ 0, /*<*/ 27, /*=*/ 0, /*>*/ 21, /*?*/ 0, /*@*/ 27+0200, /*((A*/ 27+0200, /*B*/ 25+0200, /*C*/ 28+0200, /*D*/ 26+0200, /*E*/ 24+0200, /*F*/ 27+0200, /*G*/ 29+0200, /*H*/ 15+0200, /*I*/ 20+0200, /*J*/ 29+0200, /*K*/ 25+0200, /*L*/ 31+0200, /*M*/ 27+0200, /*N*/ 27+0200, /*O*/ 26+0200, /*P*/ 28+0300, /*Q*/ 29+0200, /*R*/ 22+0200, /*S*/ 25+0200, /*T*/ 28+0200, /*U*/ 25+0200, /*V*/ 35+0200, /*W*/ 26+0200, /*X*/ 27+0200, /*Y*/ 24+0200, /*Z*/ 14, /*[*/ 0, /*\*/ 14, /*]*/ 0, /*^*/ 0, /*_*/ 10, /*` open*/ 21, /*a*/ 19+0200, /*b*/ 18, /*c*/ 20+0200, /*d*/ 18, /*e*/ 14+0200, /*f*/ 19+0100, /*g*/ 21+0200, /*h*/ 12+0200, /*i*/ 13+0300, /*j*/ 21+0200, /*k*/ 13+0200, /*l*/ 30, /*m*/ 21, /*n*/ 19, /*o*/ 20+0100, /*p*/ 20+0100, /*q*/ 15, /*r*/ 16, /*s*/ 14+0200, /*t*/ 21, /*u*/ 19, /*v*/ 27, /*w*/ 22, /*x*/ 20+0100, /*y*/ 17, /*z*/ 0, /*{*/ 5, /*|*/ 0, /*}*/ 0, /*~*/ 6, /*narrow space*/ 14, /*hyphen*/ 27, /*bullet*/ 27, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 31, /*1/4*/ 31, /*1/2*/ 31, /*3/4*/ 27, /*minus*/ 23, /*fi*/ 23, /*fl*/ 22, /*ff*/ 19, /*en*/ 33, /*paragraph*/ 15, /*degree*/ 19, /*dagger*/ 0, /*section*/ 8, /*foot mark*/ 0, /*'*/ 0, /*`*/ 0, /*_*/ 0, 3, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0, 23, /*registered*/ 23, /*copywrite*/ 0, 19, /*cent*/ }; / 27, /*bullet*/ 27, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 31, /*1/4*/ 31, /*1/2*/ 31, /*3/4*/ 27, /*minus*/ 23, /*fi*/ 23, /*fl*/ 22, /*ff*/ 19, /*en*/cmd/troff/font/ftCW.c 644 0 33 3535 2111463576 7706 char XXw[256-32] { /*XX*/ 25, /*space*/ 25, /*!*/ 0, /*"*/ 0, /*#*/ 25, /*$*/ 25, /*%*/ 25, /*&*/ 25, /*' close*/ 25, /*(*/ 25, /*)*/ 25, /***/ 25, /*+*/ 25, /*,*/ 25, /*- hyphen*/ 25, /*.*/ 25, /*/*/ 25+0200, /*0*/ 25+0200, /*1*/ 25+0200, /*2*/ 25+0200, /*3*/ 25+0200, /*4*/ 25+0200, /*5*/ 25+0200, /*6*/ 25+0200, /*7*/ 25+0200, /*8*/ 25+0200, /*9*/ 25, /*:*/ 25, /*;*/ 0, /*<*/ 25, /*=*/ 0, /*>*/ 25, /*?*/ 0, /*@*/ 25+0200, /*A*/ 25+0200, /*B*/ 25+0200, /*C*/ 25+0200, /*D*/ 25+0200, /*E*/ 25+0200, /*F*/ 25+0200, /*G*/ 25+0200, /*H*/ 25+0200, /*I*/ 25+0200, /*J*/ 25+0200, /*K*/ 25+0200, /*L*/ 25+0200, /*M*/ 25+0200, /*N*/ 25+0200, /*O*/ 25+0200, /*P*/ 25+0300, /*Q*/ 25+0200, /*R*/ 25+0200, /*S*/ 25+0200, /*T*/ 25+0200, /*U*/ 25+0200, /*V*/ 25+0200, /*W*/ 25+0200, /*X*/ 25+0200, /*Y*/ 25+0200, /*Z*/ 25, /*[*/ 0, /*\*/ 25, /*]*/ 0, /*^*/ 0, /*_*/ 25, /*` open*/ 25, /*a*/ 25+0200, /*b*/ 25, /*c*/ 25+0200, /*d*/ 25, /*e*/ 25+0200, /*f*/ 25+0100, /*g*/ 25+0200, /*h*/ 25+0200, /*i*/ 25+0300, /*j*/ 25+0200, /*k*/ 25+0200, /*l*/ 25, /*m*/ 25, /*n*/ 25, /*o*/ 25+0100, /*p*/ 25+0100, /*q*/ 25, /*r*/ 25, /*s*/ 25+0200, /*t*/ 25, /*u*/ 25, /*v*/ 25, /*w*/ 25, /*x*/ 25+0100, /*y*/ 25, /*z*/ 0, /*{*/ 25, /*|*/ 0, /*}*/ 0, /*~*/ 6, /*narrow space*/ 25, /*hyphen*/ 25, /*bullet*/ 25, /*square*/ 25, /*3/4 em*/ 25, /*rule*/ 25, /*1/4*/ 25, /*1/2*/ 25, /*3/4*/ 25, /*minus*/ 25, /*fi*/ 25, /*fl*/ 25, /*ff*/ 25, /*ffi*/ 25, /*ffl*/ 25, /*degree*/ 25, /*dagger*/ 0, /*section*/ 25, /*foot mark*/ 0, /*'*/ 0, /*`*/ 0, /*_*/ 0,3, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0, 25, /*registered*/ 25, /*copywrite*/ 0, 25, /*cent*/ 0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0}; e*/ 25, /*1/4*/ 25, /*1/2*/ 25, /*3/4*/ 25, /*minus*/ 25, /*fi*/ 25, /*fl*/ 25, /*ff*/ 25, /*ffi*/ 25, /*ffl*/ 25, /*degree*/ 25, /*dagger*/ 0, /*secticmd/troff/font/ftCW.n 644 0 33 462 2111463577 7676 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 ,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0}; e*/ 25, /*1/4*/ 25, /*1/2*/ 25, /*3/4*/ 25, /*minus*/ 25, /*fi*/ 2/|,|5؆< /,"cmd/troff/font/ftG.c 644 0 33 3507 2111463577 7563 /*modified for Commercial II*/ char Gw[256-32] { /*Geneva Regular widths*/ 12, /*space*/ 12, /*!*/ 0, /*"*/ 0, /*#*/ 23, /*$*/ 28, /*%*/ 25, /*&*/ 9, /*' close*/ 13, /*(*/ 13, /*)*/ 16, /***/ 36, /*+*/ 8, /*,*/ 15, /*- hyphen*/ 8, /*.*/ 15, /*/*/ 23+0200, /*0*/ 23+0200, /*1*/ 23+0200, /*2*/ 23+0200, /*3*/ 23+0200, /*4*/ 23+0200, /*5*/ 23+0200, /*6*/ 23+0200, /*7*/ 23+0200, /*8*/ 23+0200, /*9*/ 12, /*:*/ 12, /*;*/ 0, /*<*/ 36, /*=*/ 0, /*>*/ 25, /*?*/ 0, /*@*/ 25+0200, /*A*/ 26+0200, /*B*/ 27+0200, /*C*/ 26+0200, /*D*/ 24+0200, /*E*/ 22+0200, /*F*/ 29+0200, /*G*/ 27+0200, /*H*/ 11+0200, /*I*/ 20+0200, /*J*/ 26+0200, /*K*/ 22+0200, /*L*/ 32+0200, /*M*/ 27+0200, /*N*/ 29+0200, /*O*/ 24+0200, /*P*/ 29+0300, /*Q*/ 26+0200, /*R*/ 25+0200, /*S*/ 23+0200, /*T*/ 27+0200, /*U*/ 24+0200, /*V*/ 35+0200, /*W*/ 25+0200, /*X*/ 26+0200, /*Y*/ 23+0200, /*Z*/ 12, /*[*/ 0, /*\*/ 12, /*]*/ 0, /*^*/ 0, /*_*/ 9, /*` open*/ 21, /*a*/ 22+0200, /*b*/ 21, /*c*/ 22+0200, /*d*/ 21, /*e*/ 12+0200, /*f*/ 21+0100, /*g*/ 22+0200, /*h*/ 10+0200, /*i*/ 10+0300, /*j*/ 21+0200, /*k*/ 10+0200, /*l*/ 31, /*m*/ 22, /*n*/ 21, /*o*/ 22+0100, /*p*/ 22+0100, /*q*/ 14, /*r*/ 20, /*s*/ 12+0200, /*t*/ 22, /*u*/ 19, /*v*/ 28, /*w*/ 20, /*x*/ 20+0100, /*y*/ 18, /*z*/ 0, /*{*/ 2, /*|*/ 0, /*}*/ 0, /*~*/ 6, /*narrow space*/ 15, /*hyphen*/ 27, /*bullet*/ 36, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 30, /*1/4*/ 30, /*1/2*/ 30, /*3/4*/ 36, /*minus*/ 22, /*fi*/ 22, /*fl*/ 24, /*ff*/ 34, /*ffi*/ 34, /*ffl*/ 14, /*degree*/ 20, /*dagger*/ 0, /*section*/ 9, /*foot mark*/ 0, /*'*/ 0, /*`*/ 0, /*_*/ 0, 3, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0, 21, /*registered*/ 21, /*copywrite*/ 0, 23, /*cent*/ }; phen*/ 27, /*bullet*/ 36, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 30, /*1/4*/ 30, /*1/2*/ 30, /*3/4*/ 36, /*minus*/ 22, /*fi*/ 22, /*fl*/ 24, /*ff*/ 34, /*ffi*/ 34, /*ffl*/ cmd/troff/font/ftGI.c 644 0 33 3500 2111463577 7665 char W10[256-32] { /*Genevia Regular Italic (GI) widths #803-033B*/ 13, /*space*/ 13, /*!*/ 0, /*"*/ 0, /*#*/ 23, /*$*/ 30, /*%*/ 26, /*&*/ 9, /*' close*/ 13, /*(*/ 13, /*)*/ 15, /***/ 36, /*+*/ 8, /*,*/ 14, /*- hyphen*/ 8, /*.*/ 11, /*/*/ 23+0200, /*0*/ 23+0200, /*1*/ 23+0200, /*2*/ 23+0200, /*3*/ 23+0200, /*4*/ 23+0200, /*5*/ 23+0200, /*6*/ 23+0200, /*7*/ 23+0200, /*8*/ 23+0200, /*9*/ 12, /*:*/ 12, /*;*/ 0, /*<*/ 36, /*=*/ 0, /*>*/ 24, /*?*/ 0, /*@*/ 25+0200, /*A*/ 25+0200, /*B*/ 28+0200, /*C*/ 26+0200, /*D*/ 23+0200, /*E*/ 21+0200, /*F*/ 29+0200, /*G*/ 26+0200, /*H*/ 11+0200, /*I*/ 20+0200, /*J*/ 25+0200, /*K*/ 22+0200, /*L*/ 31+0200, /*M*/ 27+0200, /*N*/ 29+0200, /*O*/ 23+0200, /*P*/ 29+0300, /*Q*/ 26+0200, /*R*/ 25+0200, /*S*/ 22+0200, /*T*/ 26+0200, /*U*/ 24+0200, /*V*/ 33+0200, /*W*/ 25+0200, /*X*/ 24+0200, /*Y*/ 23+0200, /*Z*/ 12, /*[*/ 0, /*\*/ 12, /*]*/ 0, /*^*/ 0, /*_*/ 9, /*` open*/ 21, /*a*/ 22+0200, /*b*/ 21, /*c*/ 22+0200, /*d*/ 21, /*e*/ 12+0200, /*f*/ 22+0100, /*g*/ 22+0200, /*h*/ 10+0200, /*i*/ 10+0300, /*j*/ 20+0200, /*k*/ 10+0200, /*l*/ 32, /*m*/ 22, /*n*/ 22, /*o*/ 22+0100, /*p*/ 22+0100, /*q*/ 13, /*r*/ 20, /*s*/ 12+0200, /*t*/ 22, /*u*/ 19, /*v*/ 28, /*w*/ 20, /*x*/ 19+0100, /*y*/ 18, /*z*/ 0, /*{*/ 2, /*|*/ 0, /*}*/ 0, /*~*/ 6, /*narrow space*/ 14, /*hyphen*/ 27, /*bullet*/ 36, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 30, /*1/4*/ 30, /*1/2*/ 30, /*3/4*/ 36, /*minus*/ 22, /*fi*/ 22, /*fl*/ 24, /*ff*/ 34, /*ffi*/ 34, /*ffl*/ 14, /*degree*/ 20, /*dagger*/ 0, /*section*/ 9, /*foot mark*/ 0, /*'*/ 0, /*`*/ 0, /*_*/ 0, 3, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0, 21, /*registered*/ 21, /*copywrite*/ 0, 23, /*cent*/ }; phen*/ 27, /*bullet*/ 36, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 30, /*1/4*/ 30, /*1/2*/ 30, /*3/4*/ 36, /*minus*/ 22, /*fi*/ 22, /*fl*/ 24, /*ff*/ 34, /*ffi*/ 34, /*ffl*/ 14, /*((cmd/troff/font/ftGM.c 644 0 33 3533 2111463577 7677 /*Geneva Medium (similar to Helvetica Medium)*/ char W11[256-32] { /*Geneva Medium widths*/ 14, /*space*/ 14, /*!*/ 0, /*"*/ 0, /*#*/ 25, /*$*/ 29, /*%*/ 27, /*&*/ 10, /*' close*/ 15, /*(*/ 15, /*)*/ 17, /***/ 27, /*+*/ 10, /*,*/ 17, /*- hyphen*/ 10, /*.*/ 17, /*/*/ 25+0200, /*0*/ 25+0200, /*1*/ 25+0200, /*2*/ 25+0200, /*3*/ 25+0200, /*4*/ 25+0200, /*5*/ 25+0200, /*6*/ 25+0200, /*7*/ 25+0200, /*8*/ 25+0200, /*9*/ 14, /*:*/ 14, /*;*/ 0, /*<*/ 27, /*=*/ 0, /*>*/ 27, /*?*/ 0, /*@*/ 27+0200, /*A*/ 27+0200, /*B*/ 29+0200, /*C*/ 28+0200, /*D*/ 24+0200, /*E*/ 23+0200, /*F*/ 29+0200, /*G*/ 27+0200, /*H*/ 12+0200, /*I*/ 22+0200, /*J*/ 27+0200, /*K*/ 23+0200, /*L*/ 32+0200, /*M*/ 28+0200, /*N*/ 30+0200, /*O*/ 25+0200, /*P*/ 30+0300, /*Q*/ 26+0200, /*R*/ 26+0200, /*S*/ 24+0200, /*T*/ 27+0200, /*U*/ 26+0200, /*V*/ 35+0200, /*W*/ 26+0200, /*X*/ 25+0200, /*Y*/ 25+0200, /*Z*/ 16, /*[*/ 0, /*\*/ 16, /*]*/ 0, /*^*/ 0, /*_*/ 10, /*` open*/ 22, /*a*/ 23+0200, /*b*/ 22, /*c*/ 23+0200, /*d*/ 22, /*e*/ 14+0200, /*f*/ 23+0100, /*g*/ 22+0200, /*h*/ 11+0200, /*i*/ 11+0300, /*j*/ 22+0200, /*k*/ 11+0200, /*l*/ 32, /*m*/ 22, /*n*/ 23, /*o*/ 23+0100, /*p*/ 23+0100, /*q*/ 15, /*r*/ 21, /*s*/ 14+0200, /*t*/ 22, /*u*/ 20, /*v*/ 30, /*w*/ 21, /*x*/ 21+0100, /*y*/ 20, /*z*/ 0, /*{*/ 2, /*|*/ 0, /*}*/ 0, /*~*/ 7, /*narrow space*/ 17, /*hyphen*/ 27, /*bullet*/ 27, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 32, /*1/4*/ 32, /*1/2*/ 32, /*3/4*/ 27, /*minus*/ 24, /*fi*/ 24, /*fl*/ 28, /*ff*/ 38, /*ffi*/ 38, /*ffl*/ 14, /*degree*/ 23, /*dagger*/ 0, /*section*/ 9, /*foot mark*/ 0, /*'*/ 0, /*`*/ 0, /*_*/ 0, 3, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0, 21, /*registered*/ 21, /*copywrite*/ 0, 25, /*cent*/ }; phen*/ 27, /*bullet*/ 27, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 32, /*1/4*/ 32, /*1/2*/ 32, /*3/4*/ 27, /*minus*/ 24, /*fi*/ 24, /*fl*/ 28, /*ff*/ 38, /cmd/troff/font/ftGR.c 644 0 33 3512 2111463577 7701 char XXw[256-32] { /*XX*/ 12, /*space*/ 0, /*!*/ 0, /*"*/ 0, /*#*/ 20, /*$*/ 0, /*%*/ 20, /*&*/ 10, /*' close*/ 16, /*(*/ 16, /*)*/ 0, /***/ 0, /*+*/ 10, /*,*/ 15, /*- hyphen*/ 10, /*.*/ 0, /*/*/ 20+0200, /*0*/ 20+0200, /*1*/ 6+0200, /*2*/ 6+0200, /*3*/ 4+0200, /*4*/ 6+0200, /*5*/ 4+0200, /*6*/ 15+0200, /*7*/ 15+0200, /*8*/ 20+0200, /*9*/ 11, /*:*/ 14, /*;*/ 0, /*<*/ 20, /*=*/ 0, /*>*/ 20, /*?*/ 0, /*@*/ 23+0200, /*A*/ 26+0200, /*B*/ 28+0200, /*C*/ 28+0200, /*D*/ 27+0200, /*E*/ 30+0200, /*F*/ 24+0200, /*G*/ 23+0200, /*H*/ 16+0200, /*I*/ 20+0200, /*J*/ 29+0200, /*K*/ 28+0200, /*L*/ 33+0200, /*M*/ 30+0200, /*N*/ 26+0200, /*O*/ 25+0200, /*P*/ 30+0300, /*Q*/ 29+0200, /*R*/ 27+0200, /*S*/ 25+0200, /*T*/ 29+0200, /*U*/ 21+0200, /*V*/ 24+0200, /*W*/ 29+0200, /*X*/ 33+0200, /*Y*/ 25+0200, /*Z*/ 28, /*[*/ 0, /*\*/ 0, /*]*/ 0, /*^*/ 0, /*_*/ 10, /*` open*/ 23, /*a*/ 25+0200, /*b*/ 18, /*c*/ 19+0200, /*d*/ 17, /*e*/ 24+0200, /*f*/ 21+0100, /*g*/ 23+0200, /*h*/ 12+0200, /*i*/ 18+0300, /*j*/ 21+0200, /*k*/ 21+0200, /*l*/ 24, /*m*/ 20, /*n*/ 19, /*o*/ 21+0100, /*p*/ 21+0100, /*q*/ 24, /*r*/ 24, /*s*/ 17+0200, /*t*/ 19, /*u*/ 15, /*v*/ 24, /*w*/ 23, /*x*/ 24+0100, /*y*/ 17, /*z*/ 0, /*{*/ 0, /*|*/ 0, /*}*/ 0, /*~*/ 6, /*narrow space*/ 15, /*hyphen*/ 0, /*bullet*/ 0, /*square*/ 0, /*3/4 em*/ 38, /*rule*/ 19, /*1/4*/ 16, /*1/2*/ 0, /*3/4*/ 17, /*minus*/ 30, /*fi*/ 29, /*fl*/ 34, /*ff*/ 20, /*ffi*/ 17, /*ffl*/ 0, /*degree*/ 20, /*dagger*/ 0, /*section*/ 10, /*foot mark*/ 0, /*'*/ 0, /*`*/ 0, /*_*/ 0,3, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0, 0, /*registered*/ 0, /*copywrite*/ 0, 20, /*cent*/ 0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0}; *rule*/ 19, /*1/4*/ 16, /*1/2*/ 0, /*3/4*/ 17, /*minus*/ 30, /*fi*/ 29, /*fl*/ 34, /*ff*/ 20, /*ffi*/ 17, /*ffl*/ 0, /*degree*/ 20, /*dagger*/ 0, /*section*/ 10, /*foot cmd/troff/font/ftGR.n 644 0 33 435 2111463577 7675 23 17 20 24 21 12 17 24 19 25 23 24 18 19 21 21 0 14 23 38 18 10 17 10 19 19 24 16 15 15 24 21 0 10 21 0 10 20 24 0 30 25 26 23 30 33 28 29 24 16 25 28 21 27 25 28 26 27 33 30 29 23 24 20 29 29 20 20 0 0 0 0 0 0 0 20 0 17 30 29 34 20 17 20 16 16 28 0 0 20 20 0 11 0 0 0 20 10 0 0 0 20 ,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0}; *rule*/ 19, /*1/4*/ 16, /*1/2*/ 0, /*3/4*/ 17, /*minus*/ 30, /*fi*/ 29, /*fl*/ 34, /|,|5(< /,"cmd/troff/font/ftI.c 644 0 33 3505 2111463577 7563 /*modified for Commercial II*/ char Iw[256-32] { /*Times Italic widths*/ 12, /*space*/ 13, /*!*/ 0, /*"*/ 0, /*#*/ 19, /*$*/ 27, /*%*/ 26, /*&*/ 11, /*' close*/ 15, /*(*/ 15, /*)*/ 16, /***/ 36, /*+*/ 11, /*,*/ 13, /*- hyphen*/ 11, /*.*/ 9, /*/*/ 19+0200, /*0*/ 19+0200, /*1*/ 19+0200, /*2*/ 19+0200, /*3*/ 19+0200, /*4*/ 19+0200, /*5*/ 19+0200, /*6*/ 19+0200, /*7*/ 19+0200, /*8*/ 19+0200, /*9*/ 11, /*:*/ 11, /*;*/ 0, /*<*/ 36, /*=*/ 0, /*>*/ 20, /*?*/ 0, /*@*/ 25+0200, /*A*/ 24+0200, /*B*/ 26+0200, /*C*/ 27+0200, /*D*/ 23+0200, /*E*/ 21+0200, /*F*/ 27+0200, /*G*/ 29+0200, /*H*/ 14+0200, /*I*/ 16+0200, /*J*/ 28+0200, /*K*/ 24+0200, /*L*/ 34+0200, /*M*/ 27+0200, /*N*/ 27+0200, /*O*/ 22+0200, /*P*/ 27+0300, /*Q*/ 27+0200, /*R*/ 20+0200, /*S*/ 23+0200, /*T*/ 28+0200, /*U*/ 25+0200, /*V*/ 36+0200, /*W*/ 24+0200, /*X*/ 24+0200, /*Y*/ 25+0200, /*Z*/ 13, /*[*/ 0, /*\*/ 13, /*]*/ 0, /*^*/ 0, /*_*/ 11, /*` open*/ 19, /*a*/ 18+0200, /*b*/ 15, /*c*/ 18+0200, /*d*/ 16, /*e*/ 11+0200, /*f*/ 17+0100, /*g*/ 19+0200, /*h*/ 9+0200, /*i*/ 9+0300, /*j*/ 19+0200, /*k*/ 9+0200, /*l*/ 28, /*m*/ 19, /*n*/ 18, /*o*/ 17+0100, /*p*/ 18+0100, /*q*/ 13, /*r*/ 14, /*s*/ 10+0200, /*t*/ 19, /*u*/ 16, /*v*/ 24, /*w*/ 18, /*x*/ 16+0100, /*y*/ 14, /*z*/ 0, /*{*/ 2, /*|*/ 0, /*}*/ 0, /*~*/ 6, /*narrow space*/ 13, /*hyphen*/ 27, /*bullet*/ 27, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 27, /*1/4*/ 27, /*1/2*/ 27, /*3/4*/ 36, /*minus*/ 21, /*fi*/ 21, /*fl*/ 21, /*ff*/ 31, /*ffi*/ 31, /*ffl*/ 15, /*degree*/ 19, /*dagger*/ 0, /*section*/ 7, /*foot mark*/ 0, /*'*/ 0, /*`*/ 0, /*_*/ 0, 3, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0, 20, /*registered*/ 20, /*copywrite*/ 0, 19, /*cent*/ }; phen*/ 27, /*bullet*/ 27, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 27, /*1/4*/ 27, /*1/2*/ 27, /*3/4*/ 36, /*minus*/ 21, /*fi*/ 21, /*fl*/ 21, /*ff*/ 31, /*ffi*/ 31, /*ffl*/ 15cmd/troff/font/ftL.c 644 0 33 3536 2111463577 7572 char Lw[256-32] { /*L Geneva Light*/ 12, /*space*/ 11, /*!*/ 0, /*"*/ 0, /*#*/ 21, /*$*/ 27, /*%*/ 25, /*&*/ 7, /*' close*/ 13, /*(*/ 13, /*)*/ 16, /***/ 27, /*+*/ 7, /*,*/ 13, /*- hyphen*/ 7, /*.*/ 10, /*/*/ 21+0200, /*0*/ 21+0200, /*1*/ 21+0200, /*2*/ 21+0200, /*3*/ 21+0200, /*4*/ 21+0200, /*5*/ 21+0200, /*6*/ 21+0200, /*7*/ 21+0200, /*8*/ 21+0200, /*9*/ 11, /*:*/ 11, /*;*/ 0, /*<*/ 27, /*=*/ 0, /*>*/ 22, /*?*/ 0, /*@*/ 23+0200, /*A*/ 24+0200, /*B*/ 26+0200, /*C*/ 26+0200, /*D*/ 22+0200, /*E*/ 20+0200, /*F*/ 27+0200, /*G*/ 26+0200, /*H*/ 10+0200, /*I*/ 18+0200, /*J*/ 24+0200, /*K*/ 20+0200, /*L*/ 30+0200, /*M*/ 26+0200, /*N*/ 28+0200, /*O*/ 22+0200, /*P*/ 28+0300, /*Q*/ 24+0200, /*R*/ 22+0200, /*S*/ 20+0200, /*T*/ 25+0200, /*U*/ 23+0200, /*V*/ 35+0200, /*W*/ 23+0200, /*X*/ 22+0200, /*Y*/ 22+0200, /*Z*/ 11, /*[*/ 0, /*\*/ 11, /*]*/ 0, /*^*/ 0, /*_*/ 7, /*` open*/ 20, /*a*/ 21+0200, /*b*/ 20, /*c*/ 21+0200, /*d*/ 20, /*e*/ 11+0200, /*f*/ 21+0100, /*g*/ 20+0200, /*h*/ 9+0200, /*i((*/ 9+0300, /*j*/ 19+0200, /*k*/ 9+0200, /*l*/ 31, /*m*/ 20, /*n*/ 20, /*o*/ 21+0100, /*p*/ 21+0100, /*q*/ 12, /*r*/ 18, /*s*/ 11+0200, /*t*/ 20, /*u*/ 18, /*v*/ 27, /*w*/ 18, /*x*/ 18+0100, /*y*/ 17, /*z*/ 0, /*{*/ 2, /*|*/ 0, /*}*/ 0, /*~*/ 6, /*narrow space*/ 13, /*hyphen*/ 27, /*bullet*/ 27, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 30, /*1/4*/ 30, /*1/2*/ 30, /*3/4*/ 27, /*minus*/ 20, /*fi*/ 20, /*fl*/ 22, /*ff*/ 31, /*ffi*/ 31, /*ffl*/ 14, /*degree*/ 18, /*dagger*/ 0, /*section*/ 8, /*foot mark*/ 0, /*'*/ 0, /*`*/ 0, /*_*/ 0, 3, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0, 21, /*registered*/ 21, /*copywrite*/ 0, 21, /*cent*/ 0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0}; le*/ 30, /*1/4*/ 30, /*1/2*/ 30, /*3/4*/ 27, /*minus*/ 20, /*fi*/ 20, /*fl*/ 22, /*ff*/ 31, /*ffi*/ 31, /*ffl*/ 14, /*degree*/ 18, /*dagger*/ 0, /*seccmd/troff/font/ftLI.c 644 0 33 3546 2111463577 7704 char LIw[256-32] { /*LI Geneva Light Italic*/ 12, /*space*/ 12, /*!*/ 0, /*"*/ 0, /*#*/ 21, /*$*/ 27, /*%*/ 26, /*&*/ 7, /*' close*/ 13, /*(*/ 13, /*)*/ 15, /***/ 36, /*+*/ 7, /*,*/ 13, /*- hyphen*/ 7, /*.*/ 7, /*/*/ 21+0200, /*0*/ 21+0200, /*1*/ 21+0200, /*2*/ 21+0200, /*3*/ 21+0200, /*4*/ 21+0200, /*5*/ 21+0200, /*6*/ 21+0200, /*7*/ 21+0200, /*8*/ 21+0200, /*9*/ 11, /*:*/ 11, /*;*/ 0, /*<*/ 36, /*=*/ 0, /*>*/ 24, /*?*/ 0, /*@*/ 24+0200, /*A*/ 25+0200, /*B*/ 27+0200, /*C*/ 26+0200, /*D*/ 22+0200, /*E*/ 20+0200, /*F*/ 28+0200, /*G*/ 26+0200, /*H*/ 10+0200, /*I*/ 19+0200, /*J*/ 25+0200, /*K*/ 21+0200, /*L*/ 30+0200, /*M*/ 26+0200, /*N*/ 28+0200, /*O*/ 23+0200, /*P*/ 28+0300, /*Q*/ 24+0200, /*R*/ 23+0200, /*S*/ 21+0200, /*T*/ 25+0200, /*U*/ 22+0200, /*V*/ 32+0200, /*W*/ 22+0200, /*X*/ 22+0200, /*Y*/ 22+0200, /*Z*/ 11, /*[*/ 0, /*\*/ 11, /*]*/ 0, /*^*/ 0, /*_*/ 7, /*` open*/ 21, /*a*/ 22+0200, /*b*/ 20, /*c*/ 22+0200, /*d*/ 20, /*e*/ 12+0200, /*f*/ 22+0100, /*g*/ 21+0200, /*h*/ 9+0200, /*i*/ 9+0300, /*j*/ 20+0200, /*k*/ 9+0200, /*l*/ 31, /*m*/ 21, /*n*/ 21, /*o*/ 22+0100, /*p*/ 22+0100, /*q*/ 13, /*r*/ 19, /*s*/ 12+0200, /*t*/ 21, /*u*/ 18, /*v*/ 27, /*w*/ 19, /*x*/ 18+0100, /*y*/ 18, /*z*/ 0, /*{*/ 2, /*|*/ 0, /*}*/ 0, /*~*/ 6, /*narrow space*/ 13, /*hyphen*/ 27, /*bullet*/ 27, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 27, /*1/4*/ 27, /*1/2*/ 27, /*3/4*/ 36, /*minus*/ 21, /*fi*/ 21, /*fl*/ 24, /*ff*/ 33, /*ffi*/ 33, /*ffl*/ 14, /*degree*/ 20, /*dagger*/ 0, /*section*/ 8, /*foot mark*/ 0, /*'*/ 0, /*`*/ 0, /*_*/ 0, 3, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0, 21, /*registered*/ 21, /*copywrite*/ 0, 21, /*cent*/ 0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0}; le*/ 27, /*1/4*/ 27, /*1/2*/ 27, /*3/4*/ 36, /*minus*/ 21, /*fi*/ 21, /*fl*/ 24, /*ff*/ 33, /*ffi*/ 33, /*ffl*/ 14, /*degree*/ 20, /*dagger*/ 0cmd/troff/font/ftPA.c 644 0 33 4160 2111463577 7671 /*Commercial II*/ char PAw[256-32] { /*character withs for Palatino 814-007A*/ 12, /*space*/ 12, /*!*/ 0, /*"*/ 0, /*sharp*/ 19, /*$*/ 27, /*%*/ 29, /*&*/ 10, /*' close*/ 14, /*(*/ 14, /*)*/ 16, /***/ 27, /*+*/ 9, /*,*/ 14, /*- hyphen*/ 9, /*.*/ 12, /*/*/ 19+0200, /*0*/ 19+0200, /*1*/ 19+0200, /*2*/ 19+0200, /*3*/ 19+0200, /*4*/ 19+0200, /*5*/ 19+0200, /*6*/ 19+0200, /*7*/ 19+0200, /*8*/ 19+0200, /*9*/ 12, /*:*/ 12, /*;*/ 0, /*<*/ 27, /*=*/ 0, /*>*/ 20, /*?*/ 0, /*@*/ 28+0200, /*A*/ 21+0200, /*B*/ 25+0200, /*C*/ 28+0200, /*D*/ 21+0200, /*E*/ 20+0200, /*F*/ 27+0200, /*G*/ 30+0200, /*H*/ 12+0200, /*I*/ 12+0200, /*J*/ 27+0200, /*K*/ 22+0200, /*L*/ 34+0200, /*M*/ 30+0200, /*N*/ 29+0200, /*O*/ 22+0200, /*P*/ 29+0300, /*Q*/ 25+0200, /*R*/ 19+0200, /*S*/ 22+0200, /*T*/ 28+0200, /*U*/ 27+0200, /*V*/ 36+0200, /*W*/ 24+0200, /*X*/ 24+0200, /*Y*/ 24+0200, /*Z*/ 13, /*[*/ 0, /*\*/ 13, /*]*/ 0, /*^*/ 0, /*_*/ 10, /*` open*/ 18, /*a*/ 20+0200, /*b*/ 16, /*c*/ 21+0200, /*d*/ 17, /*e*/ 12+0200, /*f*/ 19+0100, /*g*/ 22+0200, /*h*/ 11+0200, /*i*/ 11+0300, /*j*/ 20+0200, /*k*/ 11+0200, /*l*/ 32, /*m*/ 22, /*n*/ 20, /*o*/ 21+0100, /*p*/ 19+0100, /*q*/ 15, /*r*/ 15, /*s*/ 12+0200, /*t*/ 22, /*u*/ 20, /*v*/ 30, /*w*/ 19, /*x*/ 20+0100, /*y*/ 18, /*z*/ 0, /*{*/ 2, /*|*/ 0, /*}*/ 0, /*~*/ 6, /*narrow space*/ 14, /*hyphen*/ 27, /*bullet*/ 27, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 27, /*1/4*/ 27, /*1/2*/ 27, /*3/4*/ 27, /*minus*/ 22, /*fi*/ 22, /*fl*/ 23, /*ff*/ 33, /*ffi*/ 33, /*ffl*/ 13, /*degree*/ 22, /*dagger*/ 0, /*section*/ 9, /*foot mark*/ 0, /*'*/ 0, /*`*/ 0, /*_*/ 0, 3, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0, 20, /*registered*/ 20, /*copywrite*/ 0, 19, /*cent*/ }; /4*/ 27, /*1/2*/ 27, /*3/4*/ 27, /*minus*/ 22, /*fi*/ 22, /*fl*/ 23, /*ff*/ 33, /*ffi*/ 33, /*ffl*/ 13, /*degree*/ 22, /*dagger*/ 0, /*section*/ 9, /*foot mark*/ 0, /*'*/ 0, /*`*/ 0, /*_*/ 0, 3, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0cmd/troff/font/ftPB.c 644 0 33 4213 2111463577 7671 /*Commercial II*/ char W14[256-32] { /*character withs for Palatino Bold 814-009A*/ 12, /*space*/ 14, /*!*/ 00, /*"*/ 00, /*sharp*/ 18, /*$*/ 27, /*%*/ 30, /*&*/ 12, /*' close*/ 14, /*(*/ 14, /*)*/ 15, /***/ 27, /*+*/ 12, /*,*/ 15, /*- hyphen*/ 10, /*.*/ 13, /*/*/ 18+0200, /*0*/ 18+0200, /*1*/ 18+0200, /*2*/ 18+0200, /*3*/ 18+0200, /*4*/ 18+0200, /*5*/ 18+0200, /*6*/ 18+0200, /*7*/ 18+0200, /*8*/ 18+0200, /*9*/ 14, /*:*/ 15, /*;*/ 00, /*<*/ 27, /*=*/ 00, /*>*/ 21, /*?*/ 00, /*@*/ 28+0200, /*A*/ 22+0200, /*B*/ 25+0200, /*C*/ 29+0200, /*D*/ 21+0200, /*E*/ 20+0200, /*F*/ 28+0200, /*G*/ 30+0200, /*H*/ 14+0200, /*I*/ 14+0200, /*J*/ 28+0200, /*K*/ 22+0200, /*L*/ 36+0200, /*M*/ 30+0200, /*N*/ 29+0200, /*O*/ 22+0200, /*P*/ 29+0300, /*Q*/ 26+0200, /*R*/ 20+0200, /*S*/ 25+0200, /*T*/ 28+0200, /*U*/ 28+0200, /*V*/ 36+0200, /*W*/ 25+0200, /*X*/ 25+0200, /*Y*/ 23+0200, /*Z*/ 13, /*[*/ 00, /*\*/ 13, /*]*/ 00, /*^*/ 0, /*_*/ 12, /*` open*/ 18, /*a*/ 20+0200, /*b*/ 16, /*c*/ 22+0200, /*d*/ 18, /*e*/ 14+0200, /*f*/ 20+0100, /*g*/ 22+0200, /*h*/ 12+0200, /*i*/ 12+0300, /*j*/ 22+0200, /*k*/ 12+0200, /*l*/ 32, /*m*/ 22, /*n*/ 20, /*o*/ 22+0100, /*p*/ 20+0100, /*q*/ 15, /*r*/ 16, /*s*/ 13+0200, /*t*/ 22, /*u*/ 21, /*v*/ 31, /*w*/ 19, /*x*/ 21+0100, /*y*/ 18, /*z*/ 00, /*{*/ 2, /*|*/ 00, /*}*/ 00, /*~*/ 6, /*narrow space*/ 15, /*hyphen*/ 27, /*bullet*/ 27, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 32, /*1/4*/ 32, /*1/2*/ 32, /*3/4*/ 27, /*minus*/ 23, /*fi*/ 23, /*fl*/ 25, /*ff*/ 34, /*ffi*/ 34, /*ffl*/ 15, /*degree*/ 21, /*dagger*/ 00, /*section*/ 9, /*foot mark*/ 00, /*'*/ 00, /*`*/ 00, /*_*/ 0, 3, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0, 20, /*registered*/ 20, /*copywrite*/ 00, 18, /*cent*/ }; /*1/2*/ 32, /*3/4*/ 27, /*minus*/ 23, /*fi*/ 23, /*fl*/ 25, /*ff*/ 34, /*ffi*/ 34, /*ffl*/ 15, /*degree*/ 21, /*dagger*/ 00, /*section*/ 9, /*foot mark*/ 00, /*'*/ 00, /*`*/ 00, /*_*/ 0, 3, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,cmd/troff/font/ftPI.c 644 0 33 4201 2111463600 7660 ((/*Commercial II*/ char PIw[256-32] { /*character withs for Palatino Italic 814-008A*/ 12, /*space*/ 9, /*!*/ 00, /*"*/ 00, /*sharp*/ 18, /*$*/ 28, /*%*/ 27, /*&*/ 9, /*' close*/ 13, /*(*/ 13, /*)*/ 19, /***/ 27, /*+*/ 9, /*,*/ 14, /*- hyphen*/ 9, /*.*/ 12, /*/*/ 18+0200, /*0*/ 18+0200, /*1*/ 18+0200, /*2*/ 18+0200, /*3*/ 18+0200, /*4*/ 18+0200, /*5*/ 18+0200, /*6*/ 18+0200, /*7*/ 18+0200, /*8*/ 18+0200, /*9*/ 9, /*:*/ 9, /*;*/ 00, /*<*/ 27, /*=*/ 00, /*>*/ 14, /*?*/ 00, /*@*/ 27+0200, /*A*/ 21+0200, /*B*/ 24+0200, /*C*/ 27+0200, /*D*/ 20+0200, /*E*/ 18+0200, /*F*/ 26+0200, /*G*/ 27+0200, /*H*/ 12+0200, /*I*/ 12+0200, /*J*/ 25+0200, /*K*/ 20+0200, /*L*/ 36+0200, /*M*/ 28+0200, /*N*/ 27+0200, /*O*/ 20+0200, /*P*/ 27+0300, /*Q*/ 25+0200, /*R*/ 17+0200, /*S*/ 22+0200, /*T*/ 28+0200, /*U*/ 27+0200, /*V*/ 35+0200, /*W*/ 26+0200, /*X*/ 25+0200, /*Y*/ 22+0200, /*Z*/ 14, /*[*/ 00, /*\*/ 14, /*]*/ 00, /*^*/ 0, /*_*/ 9, /*` open*/ 17, /*a*/ 16+0200, /*b*/ 15, /*c*/ 18+0200, /*d*/ 15, /*e*/ 12+0200, /*f*/ 16+0100, /*g*/ 18+0200, /*h*/ 12+0200, /*i*/ 12+0300, /*j*/ 16+0200, /*k*/ 11+0200, /*l*/ 28, /*m*/ 20, /*n*/ 16, /*o*/ 18+0100, /*p*/ 16+0100, /*q*/ 14, /*r*/ 14, /*s*/ 11+0200, /*t*/ 19, /*u*/ 18, /*v*/ 26, /*w*/ 18, /*x*/ 19+0100, /*y*/ 16, /*z*/ 00, /*{*/ 2, /*|*/ 00, /*}*/ 00, /*~*/ 6, /*narrow space*/ 14, /*hyphen*/ 27, /*bullet*/ 27, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 28, /*1/4*/ 28, /*1/2*/ 28, /*3/4*/ 27, /*minus*/ 20, /*fi*/ 20, /*fl*/ 20, /*ff*/ 29, /*ffi*/ 29, /*ffl*/ 14, /*degree*/ 20, /*dagger*/ 00, /*section*/ 10, /*foot mark*/ 00, /*'*/ 00, /*`*/ 00, /*_*/ 0, 3, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0, 20, /*registered*/ 20, /*copywrite*/ 0, 18, /*cent*/ }; 28, /*1/2*/ 28, /*3/4*/ 27, /*minus*/ 20, /*fi*/ 20, /*fl*/ 20, /*ff*/ 29, /*ffi*/ 29, /*ffl*/ 14, /*degree*/ 20, /*dagger*/ 00, /*section*/ 10, /*foot mark*/ 00, /*'*/ 00, /*`*/ 00, /*_*/ 0, 3, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,cmd/troff/font/ftR.c 644 0 33 3507 2111463600 7561 /*modified for Commercial II*/ char Rw[256-32] { /*Times Roman widths*/ 12, /*space*/ 12, /*!*/ 0, /*"*/ 0, /*#*/ 19, /*$*/ 29, /*%*/ 28, /*&*/ 12, /*' close*/ 16, /*(*/ 16, /*)*/ 16, /***/ 36, /*+*/ 12, /*,*/ 13, /*- hyphen*/ 10, /*.*/ 17, /*/*/ 19+0200, /*0*/ 19+0200, /*1*/ 19+0200, /*2*/ 19+0200, /*3*/ 19+0200, /*4*/ 19+0200, /*5*/ 19+0200, /*6*/ 19+0200, /*7*/ 19+0200, /*8*/ 19+0200, /*9*/ 10, /*:*/ 12, /*;*/ 0, /*<*/ 36, /*=*/ 0, /*>*/ 20, /*?*/ 0, /*@*/ 29+0200, /*A*/ 23+0200, /*B*/ 26+0200, /*C*/ 30+0200, /*D*/ 24+0200, /*E*/ 23+0200, /*F*/ 30+0200, /*G*/ 29+0200, /*H*/ 13+0200, /*I*/ 16+0200, /*J*/ 28+0200, /*K*/ 24+0200, /*L*/ 35+0200, /*M*/ 29+0200, /*N*/ 27+0200, /*O*/ 22+0200, /*P*/ 27+0300, /*Q*/ 27+0200, /*R*/ 20+0200, /*S*/ 24+0200, /*T*/ 29+0200, /*U*/ 27+0200, /*V*/ 36+0200, /*W*/ 28+0200, /*X*/ 27+0200, /*Y*/ 23+0200, /*Z*/ 14, /*[*/ 0, /*\*/ 14, /*]*/ 0, /*^*/ 0, /*_*/ 12, /*` open*/ 17, /*a*/ 20+0200, /*b*/ 16, /*c*/ 20+0200, /*d*/ 18, /*e*/ 13+0200, /*f*/ 18+0100, /*g*/ 21+0200, /*h*/ 10+0200, /*i*/ 9+0300, /*j*/ 20+0200, /*k*/ 10+0200, /*l*/ 32, /*m*/ 21, /*n*/ 20, /*o*/ 19+0100, /*p*/ 19+0100, /*q*/ 14, /*r*/ 15, /*s*/ 12+0200, /*t*/ 21, /*u*/ 20, /*v*/ 26, /*w*/ 20, /*x*/ 18+0100, /*y*/ 17, /*z*/ 0, /*{*/ 2, /*|*/ 0, /*}*/ 0, /*~*/ 6, /*narrow space*/ 13, /*hyphen*/ 27, /*bullet*/ 27, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 29, /*1/4*/ 29, /*1/2*/ 29, /*3/4*/ 36, /*minus*/ 21, /*fi*/ 21, /*fl*/ 24, /*ff*/ 32, /*ffi*/ 32, /*ffl*/ 15, /*degree*/ 20, /*dagger*/ 0, /*section*/ 8, /*foot mark*/ 0, /*'*/ 0, /*`*/ 0, /*_*/ 0, 3, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0, 20, /*registered*/ 20, /*copywrite*/ 0, 19, /*cent*/ }; phen*/ 27, /*bullet*/ 27, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 29, /*1/4*/ 29, /*1/2*/ 29, /*3/4*/ 36, /*minus*/ 21, /*fi*/ 21, /*fl*/ 24, /*ff*/ 32, /*ffi*/ 32, /*ffl*/ cmd/troff/font/ftR.n 644 0 33 457 2111463600 7555 21 12 21 32 10 10 17 15 20 20 20 13 9 21 20 19 36 12 17 18 16 12 18 12 20 29 14 29 20 13 26 19 17 10 18 29 12 28 18 29 27 24 27 29 29 35 24 27 30 13 22 26 27 24 23 30 23 20 27 23 28 29 36 16 29 28 19 19 19 19 19 19 19 19 19 19 16 36 21 21 24 19 32 32 16 16 14 14 15 20 36 20 10 36 12 27 20 8 2 20 27 19 e*/ 0, 19, /*cent*/ }; phen*/ 27, /*bullet*/ 27, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 29, /*1/4*/ 29, /*1/2*/|,|5< /,"cmd/troff/font/ftS.c 644 0 33 4722 2111463600 7562 /* Modified for Commercial II and with +, -, and = for equations */ char Sw[256-32] { /*Special font widths*/ 0,0, /*.=Sw+042-40*/ 13, /*"*/ 29, /*#*/ 0,0,0,0, /*.=Sw+074-40*/ 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0, 36, /*<*/ 0, /*.=Sw+076-40*/ 36, /*>*/ 0, /*.=Sw+100-40*/ 36, /*@*/ 0,0,0,0,0,0,0, /*.=Sw+134-40*/ 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0, 15, /*\\*/ 0, /*.=Sw+136-40*/ 15, /*^*/ 18, /*_ underrule*/ 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0, 14, /*{*/ 0, /*.=Sw+175-40*/ 14, /*}*/ 15, /*~*/ 0, /*.=Sw+220-40*/ 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 17, /*section*/ 0, /*.=Sw+222-40*/ 10, /*acute accent*/ 10, /*grave accent*/ 18, /*underrule*/ 15, /*slash (longer)*/ 0, /**/ 0, /**/ 24, /*alpha*/ 23+0300, /*beta*/ 23+0100, /*gamma*/ 19+0200, /*delta*/ 18, /*epsilon*/ 18+0300, /*zeta*/ 23+0100, /*eta*/ 19+0200, /*theta*/ 13, /*iota*/ 21, /*kappa*/ 22+0200, /*lambda*/ 25+0100, /*mu*/ 20, /*nu*/ 20+0300, /*xi*/ 20, /*omicron*/ 27, /*pi*/ 21+0100, /*rho*/ 27, /*sigma*/ 20, /*tau*/ 21, /*upsilon*/ 25+0300, /*phi*/ 22+0100, /*chi*/ 24+0300, /*psi*/ 25, /*omega*/ 24+0200, /*Gamma*/ 26+0200, /*Delta*/ 28+0200, /*Theta*/ 28+0200, /*Lambda*/ 27+0200, /*Xi*/ 29+0200, /*Pi*/ 25+0200, /*Sigma*/ 0, /**/ 28+0200, /*Upsilon*/ 29+0200, /*Phi*/ 32+0200, /*Psi*/ 36+0200, /*Omega*/ 30, /*square root*/ 18+0100, /*terminal sigma*/ 18, /*root en*/ 36, /*>=*/ 36, /*<=*/ 36, /*identically equal*/ 27, /*minus*/ 36, /*approx =*/ 36, /*approximates*/ 36, /*not equal*/ 36, /*right arrow*/ 36, /*left arrow*/ 18, /*up arrow*/ 18, /*down arrow*/ 27, /*equal*/ 27, /*multiply*/ 27, /*divide*/ 36, /*plus-minus*/ 36, /*cup (union)*/ 36, /*cap (intersection)*/ 36, /*subset of*/ 36, /*superset of*/ 36, /*improper subset*/ 36, /*improper superset*/ 34, /*infinity*/ 21, /*partial derivative*/ 36+0200, /*gradient*/ 22, /*not*/ 24, /*integral sign*/ 27, /*proportional to*/ 28, /*empty set*/ 27, /*member of*/ 27, /*plus*/ 0, 0, 0, /*box vert rule (was 2.)*/ 0, 17, /*dbl dagger*/ 42, /*right hand*/ 42, /*left hand*/ 16, /*math * */ 41, /*bell system sign*/ 9, /*or*/ 27, /*circle*/ 9, /*left top (of big curly)*/ 9, /*left bottom*/ 9, /*right top*/ 9, /*right bot*/ 9, /*left center of big curly bracket*/ 9, /*right center of big curly bracket*/ 9, /*bold vertical*/ 9, /*left floor (left bot of big sq bract)*/ 9, /*right floor (rb of ")*/ 9, /*left ceiling (lt of ")*/ 9 }; /*right ceiling (rt of ")*/ /*plus*/ 0, 0, 0, /*box vert rule (was 2.)*/cmd/troff/font/ftSB.c 644 0 33 3543 2111463600 7664 char SBw[256-32] { /*SB Stymie Bold*/ 12, /*space*/ 13, /*!*/ 0, /*"*/ 0, /*#*/ 25, /*$*/ 32, /*%*/ 29, /*&*/ 9, /*' close*/ 15, /*(*/ 15, /*)*/ 13, /***/ 27, /*+*/ 9, /*,*/ 13, /*- hyphen*/ 9, /*.*/ 17, /*/*/ 25+0200, /*0*/ 25+0200, /*1*/ 25+0200, /*2*/ 25+0200, /*3*/ 25+0200, /*4*/ 25+0200, /*5*/ 25+0200, /*6*/ 25+0200, /*7*/ 25+0200, /*8*/ 25+0200, /*9*/ 13, /*:*/ 13, /*;*/ 0, /*<*/ 27, /*=*/ 0, /*>*/ 25, /*?*/ 0, /*@*/ 30+0200, /*A*/ 26+0200, /*B*/ 27+0200, /*C*/ 28+0200, /*D*/ 25((+0200, /*E*/ 24+0200, /*F*/ 28+0200, /*G*/ 30+0200, /*H*/ 14+0200, /*I*/ 17+0200, /*J*/ 29+0200, /*K*/ 23+0200, /*L*/ 35+0200, /*M*/ 30+0200, /*N*/ 29+0200, /*O*/ 24+0200, /*P*/ 29+0300, /*Q*/ 27+0200, /*R*/ 24+0200, /*S*/ 26+0200, /*T*/ 30+0200, /*U*/ 29+0200, /*V*/ 40+0200, /*W*/ 30+0200, /*X*/ 29+0200, /*Y*/ 25+0200, /*Z*/ 13, /*[*/ 0, /*\*/ 13, /*]*/ 0, /*^*/ 0, /*_*/ 9, /*` open*/ 18, /*a*/ 21+0200, /*b*/ 18, /*c*/ 21+0200, /*d*/ 19, /*e*/ 13+0200, /*f*/ 21+0100, /*g*/ 22+0200, /*h*/ 11+0200, /*i*/ 10+0300, /*j*/ 21+0200, /*k*/ 11+0200, /*l*/ 30, /*m*/ 22, /*n*/ 19, /*o*/ 21+0100, /*p*/ 21+0100, /*q*/ 14, /*r*/ 16, /*s*/ 12+0200, /*t*/ 22, /*u*/ 22, /*v*/ 29, /*w*/ 22, /*x*/ 22+0100, /*y*/ 19, /*z*/ 0, /*{*/ 2, /*|*/ 0, /*}*/ 0, /*~*/ 6, /*narrow space*/ 13, /*hyphen*/ 27, /*bullet*/ 27, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 32, /*1/4*/ 32, /*1/2*/ 32, /*3/4*/ 27, /*minus*/ 24, /*fi*/ 24, /*fl*/ 26, /*ff*/ 37, /*ffi*/ 37, /*ffl*/ 14, /*degree*/ 20, /*dagger*/ 0, /*section*/ 10, /*foot mark*/ 0, /*'*/ 0, /*`*/ 0, /*_*/ 0, 3, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0, 20, /*registered*/ 20, /*copywrite*/ 0, 25, /*cent*/ 0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0}; e*/ 32, /*1/4*/ 32, /*1/2*/ 32, /*3/4*/ 27, /*minus*/ 24, /*fi*/ 24, /*fl*/ 26, /*ff*/ 37, /*ffi*/ 37, /*ffl*/ 14, /*degree*/ 20, /*dagger*/ 0, /cmd/troff/font/ftSI.c 644 0 33 3552 2111463600 7673 char SIw[256-32] { /*SI Stymie Medium Italic*/ 12, /*space*/ 11, /*!*/ 0, /*"*/ 0, /*#*/ 18, /*$*/ 30, /*%*/ 26, /*&*/ 8, /*' close*/ 12, /*(*/ 12, /*)*/ 17, /***/ 27, /*+*/ 8, /*,*/ 11, /*- hyphen*/ 7, /*.*/ 7, /*/*/ 18+0200, /*0*/ 18+0200, /*1*/ 18+0200, /*2*/ 18+0200, /*3*/ 18+0200, /*4*/ 18+0200, /*5*/ 18+0200, /*6*/ 18+0200, /*7*/ 18+0200, /*8*/ 18+0200, /*9*/ 11, /*:*/ 11, /*;*/ 0, /*<*/ 27, /*=*/ 0, /*>*/ 22, /*?*/ 0, /*@*/ 25+0200, /*A*/ 23+0200, /*B*/ 24+0200, /*C*/ 25+0200, /*D*/ 24+0200, /*E*/ 23+0200, /*F*/ 26+0200, /*G*/ 27+0200, /*H*/ 11+0200, /*I*/ 11+0200, /*J*/ 25+0200, /*K*/ 21+0200, /*L*/ 30+0200, /*M*/ 27+0200, /*N*/ 26+0200, /*O*/ 21+0200, /*P*/ 26+0300, /*Q*/ 24+0200, /*R*/ 21+0200, /*S*/ 22+0200, /*T*/ 25+0200, /*U*/ 25+0200, /*V*/ 33+0200, /*W*/ 25+0200, /*X*/ 25+0200, /*Y*/ 24+0200, /*Z*/ 12, /*[*/ 0, /*\*/ 12, /*]*/ 0, /*^*/ 0, /*_*/ 8, /*` open*/ 16, /*a*/ 19+0200, /*b*/ 17, /*c*/ 18+0200, /*d*/ 18, /*e*/ 11+0200, /*f*/ 19+0100, /*g*/ 19+0200, /*h*/ 10+0200, /*i*/ 10+0300, /*j*/ 18+0200, /*k*/ 10+0200, /*l*/ 28, /*m*/ 19, /*n*/ 18, /*o*/ 19+0100, /*p*/ 19+0100, /*q*/ 12, /*r*/ 14, /*s*/ 10+0200, /*t*/ 19, /*u*/ 18, /*v*/ 27, /*w*/ 18, /*x*/ 18+0100, /*y*/ 16, /*z*/ 0, /*{*/ 2, /*|*/ 0, /*}*/ 0, /*~*/ 6, /*narrow space*/ 11, /*hyphen*/ 27, /*bullet*/ 27, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 29, /*1/4*/ 29, /*1/2*/ 29, /*3/4*/ 27, /*minus*/ 19, /*fi*/ 19, /*fl*/ 20, /*ff*/ 28, /*ffi*/ 28, /*ffl*/ 17, /*degree*/ 19, /*dagger*/ 0, /*section*/ 8, /*foot mark*/ 0, /*'*/ 0, /*`*/ 0, /*_*/ 0, 3, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0, 19, /*registered*/ 19, /*copywrite*/ 0, 18, /*cent*/ 0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0}; le*/ 29, /*1/4*/ 29, /*1/2*/ 29, /*3/4*/ 27, /*minus*/ 19, /*fi*/ 19, /*fl*/ 20, /*ff*/ 28, /*ffi*/ 28, /*ffl*/ 17, /*degree*/ 19, /*daggercmd/troff/font/ftSM.c 644 0 33 3544 2111463600 7700 char SMw[256-32] { /*SM Stymie Medium*/ 12, /*space*/ 11, /*!*/ 0, /*"*/ 0, /*#*/ 24, /*$*/ 22, /*%*/ 26, /*&*/ 9, /*' close*/ 13, /*(*/ 13, /*)*/ 13, /***/ 27, /*+*/ 9, /*,*/ 11, /*- hyphen*/ 9, /*.*/ 15, /*/*/ 24+0200, /*0*/ 24+0200, /*1*/ 24+0200, /*2*/ 24+0200, /*3*/ 24+0200, /*4*/ 24+0200, /*5*/ 24+0200, /*6*/ 24+0200, /*7*/ 24+0200, /*8*/ 24+0200, /*9*/ 11, /*:*/ 11, /*;*/ 0, /*<*/ 27, /*=*/ 0, /*>*/ 22, /*?*/ 0, /*@*/ 27+0200, /*A*/ 22+0200, /*B*/ 25+0200, /*C*/ 25+0200, /*D*/ 20+0200, /*E*/ 20+0200, /*F*/ 27+0200, /*G*/ 27+0200, /*H*/ 12+0200, /*I*/ 14+0200, /*J*/ 25+0200, /*K*/ 20+0200, /*L*/ 30+0200, /*M*/ 26+0200, /*N*/ 27+0200, /*O*/ 20+0200, /*P*/ 27+0300, /*Q*/ 23+0200, /*R*/ 18+0200, /*S*/ 21+0200, /*T*/ 26+0200, /*U*/ 25+0200, /*V*/ 32+0200, /*W*/ 26+0200, /*X*/ 25+0200, /*Y*/ 21+0200, /*Z*/ 14, /*[*/ 0, /*\*/ 14, /*]*/ 0, /*^*/ 0, /*_*/ 9, /*` open*/ 18, /*a*/ 21+0200, /*b*/ 18, /*c*/ 21+0200, /*d*/ 19, /*e*/ 11+0200, /*f*/ 21+0100, /*g*/ 21+0200, /*h*/ 10+0200, /*i*/ 10+0300, /*j*/ 20+0200, /*k*/ 10+0200, /*l*/ 30, /*m*/ 21, /*n*/ 19, /*o*/ 21+0100, /*p*/ 21+0100, /*q*/ 14, /*r*/ 15, /*s*/ 11+0200, /*t*/ 21, /*u*/ 20, /*v*/ 27, /*w*/ 21, /*x*/ 20+0100, /*y*/ 18, /*z*/ 0, /*{*/ 2, /*|*/ 0, /*}*/ 0, /*~*/ 6, /*narrow space*/ 11, /*hyphen*/ 27, /*bullet*/ 27, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 31, /*1/4*/ 31, /*1/2*/ 31, /*3/4*/ 27, /*minus*/ 21, /*fi*/ 21, /*fl*/ 22, /*ff*/ 32, /*ffi*/ 32, /*ffl*/ 15, /*degree*/ 19, /*dagger*/ 0, /*section*/ 9, /*foot mark*/ 0, /*'*/ 0, /*`*/ 0, /*_*/ 0, 3, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0, 22, /*registered*/ 22, /*copywrite*/ 0, 24, /*cent*/ 0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0}; le*/ 31, /*1/4*/ 31, /*1/2*/ 31, /*3/4*/ 27, /*minus*/ 21, /*fi*/ 21, /*fl*/ 22, /*ff*/ 32, /*ffi*/ 32, /*ffl*/ 15, /*degree*/ 19, /*dagger*/ 0, cmd/troff/font/ftUD.c 644 0 33 3532 2111463600 7666 /*modified for Commercial II*/ char UDw[256-32] { /*Utica Demibold widths (Utica == Futura)*/ 12, /*space*/ 11, /*!*/ 0, /*"*/ 16, /*0*/ 21, /*$*/ 28, /*%*/ 25, /*&*/ 10, /*' close*/ 14, /*(*/ 14, /*)*/ 13, /***/ 27, /*+*/ 9, /*,*/ 14, /*- hyphen*/ 9, /*.*/ 15, /*/*/ 21+0200, /*0*/ 21+0200, /*1*/ 21+0200, /*2*/ 21+0200, /*3*/ 21+0200, /*4*/ 21+0200, /*5*/ 21+0200, /*6*/ 21+0200, /*7*/ 21+0200, /*8*/ 21+0200, /*9*/ 11, /*:*/ 11, /*;*/ 0, /*<*/ 27, /*=*/ 0, /*>*/ 20, /*?*/ 0, /*@*/ 24+0200, /*A*/ 19+0200, /*B*/ 22+0200, /*C*/ 21+0200, /*D*/ 19+0200, /*E*/ 16+0200, /*F*/ 26+0200, /*G*/ 24+0200, /*H*/ 12+0200, /*I*/ 17+0200, /*J*/ 21+0200, /*K*/ 14+0200, /*L*/ 29+0200, /*M*/ 26+0200, /*N*/ 26+0200, /*O*/ 19+0200, /*P*/ 27+0300, /*Q*/ 19+0200, /*R*/ 18+0200, /*S*/ 16+0200, /*T*/ 24+0200, /*U*/ 22+0200, /*V*/ 33+0200, /*W*/ 22+0200, /*X*/ 20+0200, /*Y*/ 22+0200, /*Z*/ 12, /*[*/ 0, /*\*/ 12, /*]*/ 0, /*^*/ 0, /*_*/ 10, /*` open*/ 20, /*a*/ 20+0200, /*b*/ 14, /*c*/ 20+0200, /*d*/ 18, /*e*/ 11+0200, /*f*/ 20+0100, /*g*/ 19+0200, /*h*/ 9+0200, /*i*/ 9+0300, /*j*/ 18+0200, /*k*/ 9+0200, /*l*/ 29, /*m*/ 19, /*n*/ 18, /*o*/ 20+0100, /*p*/ 20+0100, /*q*/ 12, /*r*/ 15, /*s*/ 10+0200, /*t*/ 19, /*u*/ 18, /*v*/ 28, /*w*/ 18, /*x*/ 18+0100, /*y*/ 16, /*z*/ 0, /*{*/ 5, /*|*/ 0, /*}*/ 0, /*~*/ 6, /*narrow space*/ 14, /*hyphen*/ 27, /*bullet*/ 27, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 28, /*1/4*/ 28, /*1/2*/ 28, /*3/4*/ 27, /*minus*/ 18, /*fi*/ 18, /*fl*/ 19, /*ff*/ 27, /*ffi*/ 27, /*ffl*/ 14, /*degree*/ 29, /*dagger*/ 0, /*section*/ 9, /*foot mark*/ 0, /*'*/ 0, /*`*/ 0, /*_*/ 0, 3, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0, 16, /*registered*/ 16, /*copywrite*/ 0, 21, /*cent*/ }; phen*/ 27, /*bullet*/ 27, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 28, /*1/4*/ 28, /*1/2*/ 28, /*3/4*/ 27, /*minus*/ 18, /*fi*/ 18, /*fl*/ 19, /*ff*/ 27, /*cmd/troff/font/mkfont.c 644 0 33 3503 2111463600 10320 #include "mkfont1.c" /* this program takes 102 width values (one per line) in the order provided bu Graphic Systems and prepares a C-compileable width table. */ char ibuf[512]; int id; int width[102]; int ascii[102]; int zero; int emw, hyw; int xxx; main(argc,argv) int argc; char **argv; { register i, j; register char *p; while((--argc > 0) && ((++argv)[0][0]=='-')){ switch(argv[0][1]){ default: continue; } } if(argc){ if((id=open(argv[0],0)) < 0){ printf("Cannot open: %s.\n",a((rgv[0]); exit(1); } } j = read(id,ibuf,512); p = ibuf; for(i=0; i<102; i++){ width[i] = atoi(p); while(*p++ != '\n'); } for(i=0; i<102; i++){ if(font[i].name < 0177){ ascii[i] = font[i].name; }else{ for(j=0; chtab[j] != 0; j =+ 2){ if(font[i].name == chtab[j])break; } ascii[i] = chtab[j+1] & 0377; if(chtab[j] == 'hy')hyw = width[i]; if(chtab[j] == 'em')emw = width[i]; } } printf("char XXw[256-32] {\t/*XX*/\n"); for(i=040; i<256; i++){ if(i == 0377){ printf("0};\n"); break; } if(i == 0177){ printf("6,\t %s\n",nametab[i-040]); continue; } if(i == 0226){ printf("3,\t %s\n",nametab[i-040]); continue; } if(i == ' '){ printf("12,\t %s\n",nametab[i-040]); continue; } if(i == '-'){ printf("%d,\t %s\n",hyw,nametab[i-040]); continue; } for(j=0; j<102; j++){ if(ascii[j] == i)break; } if(j == 102){ printf("0,"); zero++; if(nametab[i-040]){ printf("\t %s\n",nametab[i-040]); zero = 0; }else if(i < 0177){ printf("\t /*%c*/\n",i); zero = 0; } if(zero && !((i+1)%8)){ printf("\n"); zero = 0; } }else{ if(zero){ zero = 0; printf("\n"); } printf("%d",width[j]); if(font[j].ctval)printf("+0%d00, ",font[j].ctval); else printf(",\t "); printf("%s\n",nametab[i-040]); } } } or(j=0; j<102; j++){ if(ascii[j] == i)break; } if(j == 102){ printf("0,"); zero++; if(nametab[i-040]){ printf("\t %s\n",nametab[i-040]); zero = 0; }else if(i < 01cmd/troff/font/mkfont1.c 644 0 33 12337 2111463601 10427 struct { int name; int ctval; } font[102] { 'h',2, 't',2, 'n',0, 'm',0, 'l',2, 'i',2, 'z',0, 's',0, 'd',2, 'b',2, 'x',0, 'f',2, 'j',3, 'u',0, 'k',2, 'p',1, 'em',0, ';',0, 'a',0, 'ru',0, 'c',0, '`',0, 'e',0, '\'',0, 'o',0, '14',0, 'r',0, '12',0, 'v',0, 'hy',0, 'w',0, 'q',1, '/',0, '.',0, 'g',1, '34',0, ',',0, '&',0, 'y',1, '%',0, 'Q',3, 'T',2, 'O',2, 'H',2, 'N',2, 'M',2, 'L',2, 'R',2, 'G',2, 'I',2, 'P',2, 'C',2, 'V',2, 'E',2, 'Z',2, 'D',2, 'B',2, 'S',2, 'Y',2, 'F',2, 'X',2, 'A',2, 'W',2, 'J',2, 'U',2, 'K',2, '0',2, '1',2, '2',2, '3',2, '4',2, '5',2, '6',2, '7',2, '8',2, '9',2, '*',0, '--',0, 'fi',0, 'fl',0, 'ff',0, 'ct',0, 'Fl',0, 'Fi',0, '(',0, ')',0, '[',0, ']',0, 'de',0, 'dg',0, '=',0, 'rg',0, ':',0, '+',0, '!',0, 'bu',0, '?',0, 'fm',0, '|',0, 'co',0, 'sq',0, '$',0}; char *nametab[256-32] { "/*space*/", "/*!*/", "/*\"*/", "/*#*/", "/*$*/", "/*%*/", "/*&*/", "/*' close*/", "/*(*/", "/*)*/", "/***/", "/*+*/", "/*,*/", "/*- hyphen*/", "/*.*/", "/*/*/", "/*0*/", "/*1*/", "/*2*/", "/*3*/", "/*4*/", "/*5*/", "/*6*/", "/*7*/", "/*8*/", "/*9*/", "/*:*/", "/*;*/", "/*<*/", "/*=*/", "/*>*/", "/*?*/", "/*@*/", "/*A*/", "/*B*/", "/*C*/", "/*D*/", "/*E*/", "/*F*/", "/*G*/", "/*H*/", "/*I*/", "/*J*/", "/*K*/", "/*L*/", "/*M*/", "/*N*/", "/*O*/", "/*P*/", "/*Q*/", "/*R*/", "/*S*/", "/*T*/", "/*U*/", "/*V*/", "/*W*/", "/*X*/", "/*Y*/", "/*Z*/", "/*[*/", "/*\\*/", "/*]*/", "/*^*/", "/*_*/", "/*` open*/", "/*a*/", "/*b*/", "/*c*/", "/*d*/", "/*e*/", "/*f*/", "/*g*/", "/*h*/", "/*i*/", "/*j*/", "/*k*/", "/*l*/", "/*m*/", "/*n*/", "/*o*/", "/*p*/", "/*q*/", "/*r*/", "/*s*/", "/*t*/", "/*u*/", "/*v*/", "/*w*/", "/*x*/", "/*y*/", "/*z*/", "/*{*/", "/*|*/", "/*}*/", "/*~*/", "/*narrow space*/", "/*hyphen*/", "/*bullet*/", "/*square*/", "/*3/4 em*/", "/*rule*/", "/*1/4*/", "/*1/2*/", "/*3/4*/", "/*minus*/", "/*fi*/", "/*fl*/", "/*ff*/", "/*ffi*/", "/*ffl*/", "/*degree*/", "/*dagger*/", "/*section*/", "/*foot mark*/", "/*'*/", "/*`*/", "/*_*/", 0, "/*half nar sp*/", 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0, "/*registered*/", "/*copywrite*/", 0, "/*cent*/", }; int chtab [] { '--', 0210, /*font minus*/ 'hy', 0200, /*hyphen*/ 'bu', 0201, /*bullet*/ 'sq', 0202, /*square*/ 'em', 0203, /*3/4em*/ 'ru', 0204, /*rule*/ '14', 0205, /*1/4*/ '12', 0206, /*1/2*/ '34', 0207, /*3/4*/ 'mi', 0302, /*equation minus*/ 'fi', 0211, /*fi*/ 'fl', 0212, /*fl*/ 'ff', 0213, /*ff*/ 'Fi', 0214, /*ffi*/ 'Fl', 0215, /*ffl*/ 'de', 0216, /*degree*/ 'dg', 0217, /*dagger*/ 'sc', 0220, /*section*/ 'fm', 0221, /*foot mark*/ 'aa', 0222, /*acute accent*/ 'ga', 0223, /*grave accent*/ 'ul', 0224, /*underrule*/ 'sl', 0225, /*slash (longer)*/ '*a', 0230, /*alpha*/ '*b', 0231, /*beta*/ '*g', 0232, /*gamma*/ '*d', 0233, /*delta*/ '*e', 0234, /*epsilon*/ '*z', 0235, /*zeta*/ '*y', 0236, /*eta*/ '*h', 0237, /*theta*/ '*i', 0240, /*iota*/ '*k', 0241, /*kappa*/ '*l', 0242, /*lambda*/ '*m', 0243, /*mu*/ '*n', 0244, /*nu*/ '*c', 0245, /*xi*/ '*o', 0246, /*omicron*/ '*p', 0247, /*pi*/ '*r', 0250, /*rho*/ '*s', 0251, /*sigma*/ '*t', 0252, /*tau*/ '*u', 0253, /*upsilon*/ '*f', 0254, /*phi*/ '*x', 0255, /*chi*/ '*q', 0256, /*psi*/ '*w', 0257, /*omega*/ '*A', 0101, /*Alpha*/ '*B', 0102, /*Beta*/ '*G', 0260, /*Gamma*/ '*D', 0261, /*Delta*/ '*E', 0105, /*Epsilon*/ '*Z', 0132, /*Zeta*/ '*Y', 0110, /*Eta*/ '*H', 0262, /*Theta*/ '*I', 0111, /*Iota*/ '*K', 0113, /*Kappa*/ '*L', 0263, /*Lambda*/ '*M', 0115, /*Mu*/ '*N', 0116, /*Nu*/ '*C', 0264, /*Xi*/ '*O', 0117, /*Omicron*/ '*P', 0265, /*Pi*/ '*R', 0120, /*Rho*/ '*S', 0266, /*Sigma*/ '*T', 0124, /*Tau*/ '*U', 0270, /*Upsilon*/ '*F', 0271, /*Phi*/ '*X', 0130, /*Chi*/ '*Q', 0272, /*Psi*/ '*W', 0273, /*Omega*/ 'sr', 0274, /*square root*/ 'ts', 0275, /*terminal sigma*/ 'rn', 0276, /*root en*/ '>=', 0277, /*>=*/ '<=', 0300, /*<=*/ '==', 0301, /*identically equal*/ '~=', 0303, /*approx =*/ 'ap', 0304, /*approximates*/ '!=', 0305, /*not equal*/ '->', 0306, /*right arrow*/ '<-', 0307, /*left arrow*/ 'ua', 0310, /*up arrow*/ 'da', 0311, /*down arrow*/ 'eq', 0312, /*equation equal*/ 'mu', 0313, /*multiply*/ 'di', 0314, /*divide*/ '+-', 0315, /*plus-minus*/ 'cu', 0316, /*cup (union)*/ 'ca', 0317, /*cap (intersection)*/ 'sb', 0320, /*subset of*/ 'sp', 0321, /*superset of*/ 'ib', 0322, /*improper subset*/ 'ip', 0323, /* " superset*/ 'if', 0324, /*infinity*/ 'pd', 0325, /*partial derivative*/ 'gr', 0326, /*gradient*/ 'no', 0327, /*not*/ 'is', 0330, /*integral sign*/ 'pt', 0331, /*proportional to*/ 'es', 0332, /*empty set*/ 'mo', 0333, /*member of*/ 'pl', 0334, /*equation plus*/ 'rg', 0335, /*registered*/ 'co', 0336, /*copyright*/ 'br', 0337, /*box vert rule*/ 'ct', 0340, /*cent sign*/ 'dd', 0341, /*dbl dagger*/ 'rh', 0342, /*right hand*/ 'lh', 0343, /*left hand*/ '**', 0344, /*math * */ 'bs', 0345, /*bell system sign*/ 'or', 0346, /*or*/ 'ci', 0347, /*circle*/ 'lt', 0350, /*left top (of big curly)*/ 'lb', 0351, /*left bottom*/ 'rt', 0352, /*right top*/ 'rb', 0353, /*right bot*/ 'lk', 0354, /*left center of big curly bracket*/ 'rk', 0355, /*right center of big curly bracket*/ 'bv', 0356, /*bold vertical*/ 'lf', 0357, /*left floor (left bot of big sq bract)*/ 'rf', 0360, /*right floor (rb of ")*/ 'lc', 0361, /*left ceiling (lt of ")*/ 'rc', 0362, /*right ceiling (rt of ")*/ 0,0}; *math * */ 'bs', 0345, /*bell system sign*/ 'or', 0346, /*or*/ 'ci', 0347, /*circle*/ 'lt', 0350, /*left top (of big curly)*/ 'lb', 0351, /*left bottom*/ 'rt', 0352, /*right top*/ 'rb', 0353, /*right bot*/ 'lk', 0354, /*left center of big curly bracket*/ 'rk', 0355, /*right center of big cmd/troff/font/linkrc 755 0 33 153 2111463600 10044 cd /usr/lib/font rm ftH ftHI ftHM ftFD ftCI ln ftG ftH ln ftGI ftHI ln ftGM ftHM ln ftUD ftFD ln ftCK ftCI 360, /*right floor (rb of ")*/ 'lc', 0361, /*left ceiling (lt of ")*/ 'rc', 0362, /*right ceiling (rt of ")*/ 0,0}; *math * */ 'bs', 0345, /*bell system sign*/ 'or', 0346, /*or*/ 'ci', 0347, /*circle*/ 'lt', 0350, /*left top (of big curly)*/ 'lb', 0351, /*left bottom*/ 'rt', 0352, /*right top*/ 'rb', 0353, /*rig/|,|5(< /,"cmd/troff/font/ftXM.c 644 0 33 4070 2111463600 7700 char SMw[256-32] { /*SM Stymie Medium*/ 12+2, /*space*/ 11+2, /*!*/ 0, /*"*/ 0, /*#*/ 24+2, /*$*/ 22+2, /*%*/ 26+2, /*&*/ 9+2, /*' close*/ 13+2, /*(*/ 13+2, /*)*/ 13+2, /***/ 27+2, /*+*/ 9+2, /*,*/ 11+2, /*- hyphen*/ 9+2, /*.*/ 15+2, /*/*/ 24+0200+2, /*0*/ 24+0200+2, /*1*/ 24+0200+2, /*2*/ 24+0200+2, /*3*/ 24+0200+2, /*4*/ 24+0200+2, /*5*/ 24+0200+2, /*6*/ 24+0200+2, /*7*/ 24+0200+2, /*8*/ 24+0200+2, /*9*/ 11+2, /*:*/ 11+2, /*;*/ 0, /*<*/ 27+2, /*=*/ 0, /*>*/ 22+2, /*?*/ 0, /*@*/ 27+0200+2, /*A*/ 22+0200+2, /*B*/ 25+0200+2, /*C*/ 25+0200+2, /*D*/ 20+0200+2, /*E*/ 20+0200+2, /*F*/ 27+0200+2, /*G*/ 27+0200+2, /*H*/ 12+0200+2, /*I*/ 14+0200+2, /*J*/ 25+0200+2, /*K*/ 20+0200+2, /*L*/ 30+0200+2, /*M*/ 26+0200+2, /*N*/ 27+0200+2, /*O*/ 20+0200+2, /*P*/ 27+0300+2, /*Q*/ 23+0200+2, /*R*/ 18+0200+2, /*S*/ 21+0200+2, /*T*/ 26+0200+2, /*U*/ 25+0200+2, /*V*/ 32+0200+2, /*W*/ 26+0200+2, /*X*/ 25+0200+2, /*Y*/ 21+0200+2, /*Z*/ 14+2, /*[*/ 0, /*\*/ 14+2, /*]*/ 0, /*^*/ 0, /*_*/ 9+2, /*` open*/ 18((+2, /*a*/ 21+0200+2, /*b*/ 18+2, /*c*/ 21+0200+2, /*d*/ 19+2, /*e*/ 11+0200+2, /*f*/ 21+0100+2, /*g*/ 21+0200+2, /*h*/ 10+0200+2, /*i*/ 10+0300+2, /*j*/ 20+0200+2, /*k*/ 10+0200+2, /*l*/ 30+2, /*m*/ 21+2, /*n*/ 19+2, /*o*/ 21+0100+2, /*p*/ 21+0100+2, /*q*/ 14+2, /*r*/ 15+2, /*s*/ 11+0200+2, /*t*/ 21+2, /*u*/ 20+2, /*v*/ 27+2, /*w*/ 21+2, /*x*/ 20+0100+2, /*y*/ 18+2, /*z*/ 0, /*{*/ 2+2, /*|*/ 0, /*}*/ 0, /*~*/ 6+2, /*narrow space*/ 11+2, /*hyphen*/ 27+2, /*bullet*/ 27+2, /*square*/ 36+2, /*3/4 em*/ 18+2, /*rule*/ 31+2, /*1/4*/ 31+2, /*1/2*/ 31+2, /*3/4*/ 27+2, /*minus*/ 21+2, /*fi*/ 21+2, /*fl*/ 22+2, /*ff*/ 32+2, /*ffi*/ 32+2, /*ffl*/ 15+2, /*degree*/ 19+2, /*dagger*/ 0, /*section*/ 9+2, /*foot mark*/ 0, /*'*/ 0, /*`*/ 0, /*_*/ 0, 3+2, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0, 22+2, /*registered*/ 22+2, /*copywrite*/ 0, 24+2, /*cent*/ 0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0}; */ 31+2, /*3/4*/ 27+2, /*minus*/ 21+2, /*fi*/ 21+2, /*fl*/ 22+2, /*ff*/ 32+2, /*ffi*/ 32+2, /*ffl*/ 15+2, /*degree*/ 19+2, /*dagger*/ 0, /*section*/ 9+2, /*foot mark*/ 0, /*'*/ 0, /*`*/ 0, /*_*/ 0, 3+2, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0, 22+2, /*registered*/ 22+2, /*copywrite*/ 0, 24+2, /*cent*/ 0,0,0,0,0,0cmd/troff/font/ftCS.c 644 0 33 3625 2111463576 7702 /* * Century schoolbook -- Commercial II layout; name CS */ char XXw[256-32] { /*XX*/ 12, /*space*/ 13, /*!*/ 0, /*"*/ 0, /*#*/ 20, /*$*/ 26, /*%*/ 31, /*&*/ 9, /*' close*/ 14, /*(*/ 14, /*)*/ 19, /***/ 27, /*+*/ 9, /*,*/ 12, /*- hyphen*/ 9, /*.*/ 13, /*/*/ 20+0200, /*0*/ 20+0200, /*1*/ 20+0200, /*2*/ 20+0200, /*3*/ 20+0200, /*4*/ 20+0200, /*5*/ 20+0200, /*6*/ 20+0200, /*7*/ 20+0200, /*8*/ 20+0200, /*9*/ 13, /*:*/ 13, /*;*/ 0, /*<*/ 27, /*=*/ 0, /*>*/ 22, /*?*/ 0, /*@*/ 28+0200, /*A*/ 26+0200, /*B*/ 24+0200, /*C*/ 28+0200, /*D*/ 26+0200, /*E*/ 24+0200, /*F*/ 28+0200, /*G*/ 30+0200, /*H*/ 15+0200, /*I*/ 21+0200, /*J*/ 29+0200, /*K*/ 24+0200, /*L*/ 34+0200, /*M*/ 30+0200, /*N*/ 27+0200, /*O*/ 25+0200, /*P*/ 27+0300, /*Q*/ 27+0200, /*R*/ 22+0200, /*S*/ 24+0200, /*T*/ 30+0200, /*U*/ 28+0200, /*V*/ 36+0200, /*W*/ 27+0200, /*X*/ 27+0200, /*Y*/ 22+0200, /*Z*/ 12, /*[*/ 0, /*\*/ 12, /*]*/ 0, /*^*/ 0, /*_*/ 9, /*` open*/ 20, /*a*/ 20+0200, /*b*/ 17, /*c*/ 20+0200, /*d*/ 18, /*e*/ 14+0200, /*f*/ 21+0100, /*g*/ 22+0200, /*h*/ 12+0200, /*i*/ 14+0300, /*j*/ 22+0200, /*k*/ 12+0200, /*l*/ 32, /*m*/ 22, /*n*/ 18, /*o*/ 20+0100, /*p*/ 20+0100, /*q*/ 16, /*r*/ 16, /*s*/ 15+0200, /*t*/ 22, /*u*/ 20, /*v*/ 28, /*w*/ 20, /*x*/ 20+0100, /*y*/ 17, /*z*/ 0, /*{*/ 2, /*|*/ 0, /*}*/ 0, /*~*/ 6, /*narrow space*/ 12, /*hyphen*/ 27, /*bullet*/ 36, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 30, /*1/4*/ 30, /*1/2*/ 30, /*3/4*/ 27, /*minus*/ 22, /*fi*/ 22, /*fl*/ 24, /*ff*/ 32, /*ffi*/ 32, /*ffl*/ 16, /*degree*/ 19, /*dagger*/ 0, /*section*/ 9, /*foot mark*/ 0, /*'*/ 0, /*`*/ 0, /*_*/ 0,3, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0, 20, /*registered*/ 20, /*copywrite*/ 0, 20, /*cent*/ 0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0}; le*/ 30, /*1/4*/ 30, /*1/2*/ 30, /*3/4*/ 27, /*minus*/ 22, /*fi*/ 22, /*fl*/ 24, /*ff*/ 32, /*ffi*/cmd/troff/font/ftCI.c 644 0 33 3624 2111463576 7667 /* * Century Schoolbook Italic-- Commercial II; name CI */ char XXw[256-32] { /*XX*/ 12, /*space*/ 14, /*!*/ 0, /*"*/ 0, /*#*/ 20, /*$*/ 22, /*%*/ 32, /*&*/ 9, /*' close*/ 14, /*(*/ 14, /*)*/ 18, /***/ 27, /*+*/ 9, /*,*/ 12, /*- hyphen*/ 9, /*.*/ 10, /*/*/ 20+0200, /*0*/ 20+0200, /*1*/ 20+0200, /*2*/ 20+0200, /*3*/ 20+0200, /*4*/ 20+0200, /*5*/ 20+0200, /*6*/ 20+0200, /*7*/ 20+0200, /*8*/ 20+0200, /*9*/ 12, /*:*/ 12, /*;*/ 0, /*<*/ 27, /*=*/ 0, /*>*/ 21, /*?*/ 0, /*@*/ 27+0200, /*A*/ 25+0200, /*B*/ 24+0200, /*C*/ 28+0200, /*D*/ 26+0200, /*E*/ 23+0200, /*F*/ 27+0200, /*G*/ 29+0200, /*H*/ 14+0200, /*I*/ 20+0200, /*J*/ 27+0200, /*K*/ 25+0200, /*L*/ 32+0200, /*M*/ 28+0200, /*N*/ 26+0200, /*O*/ 23+0200, /*P*/ 26+0300, /*Q*/ 27+0200, /*R*/ 21+0200, /*S*/ 24+0200, /*T*/ 28+0200, /*U*/ 27+0200, /*V*/ 34+0200, /*W*/ 26+0200, /*X*/ 27+0200, /*Y*/ 22+0200, /*Z*/ 12, /*[*/ 0, /*\*/ 12, /*]*/ 0, /*^*/ 0, /*_*/ 9, /*` open*/ 20, /*a*/ 20+0200, /*b*/ 16, /*c*/ 22+0200, /*d*/ 16, /*e*/ 12+0200, /*f*/ 18+0100, /*g*/ 21+0200, /*h*/ 11+0200, /*i*/ 11+0300, /*j*/ 20+0200, /*k*/ 12+0200, /*l*/ 31, /*m*/ 21, /*n*/ 18, /*o*/ 20+0100, /*p*/ 18+0100, /*q*/ 16, /*r*/ 15, /*s*/ 12+0200, /*t*/ 21, /*u*/ 18, /*v*/ 27, /*w*/ 18, /*x*/ 17+0100, /*y*/ 15, /*z*/ 0, /*{*/ 2, /*|*/ 0, /*}*/ 0, /*~*/ 6, /*narrow space*/ 12, /*hyphen*/ 27, /*bullet*/ 36, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 30, /*1/4*/ 30, /*1/2*/ 30, /*3/4*/ 27, /*minus*/ 21, /*fi*/ 21, /*fl*/ 21, /*ff*/ 29, /*ffi*/ 29, /*ffl*/ 16, /*degree*/ 19, /*dagger*/ 0, /*section*/ 9, /*foot mark*/ 0, /*'*/ 0, /*`*/ 0, /*_*/ 0,3, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0, 21, /*registered*/ 21, /*copywrite*/ 0, 20, /*cent*/ 0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0}; le*/ 30, /*1/4*/ 30, /*1/2*/ 30, /*3/4*/ 27, /*minus*/ 21, /*fi*/ 21, /*fl*/ 21, /*ff*/ 29, /*ffi*/ cmd/troff/font/chars.c 644 0 33 565 2111463576 10123 extern char codetab[]; extern int chtab[]; main(){ register i,j,k; for(i=040; i<(256); i++){ j = codetab[i-040] & 0377; if(j & 0200)for(k=0; chtab[k] != 0; k =+ 2){ if(chtab[k+1] == i){ printf("%o \\(%c%c\n", j, chtab[k] & 0377, chtab[k]>>8 & 0377); break; }else if(i < 0177){ printf("%o %c\n",j,i & 0177); break; } } } } 0,0,0,0,0,0, 0,0,0,0,0,0,0,0}; le*/ 30, /*1/4*/|,|5h< /,"cmd/troff/font/onefont 755 0 33 127 2111463601 10234 cc -c $1.c strip $1.o mv $1.o /usr/lib/font/$1 chmod 755 /usr/lib/font/$1 echo $1 done 6); i++){ j = codetab[i-040] & 0377; if(j & 0200)for(k=0; chtab[k] != 0; k =+ 2){ if(chtab[k+1] == i){ printf("%o \\(%c%c\n", j, chtab[k] & 0377, chtab[k]>>8 & 0377); break; }else if(i < 0177){ printf("%o %c\n",j,i & 0177); break; } } } } 0,0,0,0,0,0, 0,0,0,0,0,0,0,0}; le*/ 30, /*1/4*/|,|5x< /,"cmd/troff/font/ftR.o 644 0 33 400 2413624036 7551   $  $ۛ Rɔ SSR $$  chtab[k]>>8 & 0377); break; }else if(i < 0177){ printf("%o %c\n",j,i & 0177); break; } } } } 0,0,0,0,0,0, 0,0,0,0,0,0,0,0}; le*/ 30, /*1/4*/|,|5< /,"cmd/troff/font/Makefile 644 0 33 50 2413622737 10265 ((mkfont: mkfont.o cc mkfont.o -o mkfont $  $ۛ Rɔ SSR $$  chtab[k]>>8 & 0377); break; }else if(i < 0177){ printf("%o %c\n",j,i & 0177); break; } } } } 0,0,0,0,0,0, 0,0,0,0,0,0,0,0}; le*/ 30, /*1/4*/|,|5< /,"cmd/troff/hytab.c 644 0 33 16033 2346517336 7225 /* * Hyphenation digram tables */ char bxh[1][13] = { 0060,0000,0040,0000,0040,0000,0000,0040,0000,0000,0040,0000,0040 }; char hxx[26][13] = { 0006,0042,0041,0123,0021,0024,0063,0042,0002,0043,0021,0001,0022, 0140,0000,0200,0003,0260,0006,0000,0160,0007,0000,0140,0000,0320, 0220,0000,0160,0005,0240,0010,0000,0100,0006,0000,0200,0000,0320, 0240,0000,0120,0003,0140,0000,0000,0240,0010,0000,0220,0000,0160, 0042,0023,0041,0040,0040,0022,0043,0041,0030,0064,0021,0000,0041, 0100,0000,0140,0000,0220,0006,0000,0140,0003,0000,0200,0000,0000, 0200,0000,0120,0002,0220,0010,0000,0160,0006,0000,0140,0000,0320, 0020,0000,0020,0000,0020,0000,0000,0020,0000,0000,0020,0000,0000, 0043,0163,0065,0044,0022,0043,0104,0042,0061,0146,0061,0000,0007, 0100,0000,0140,0000,0040,0000,0000,0100,0000,0000,0120,0000,0000, 0140,0000,0040,0011,0060,0004,0001,0120,0003,0000,0140,0000,0040, 0200,0000,0100,0000,0140,0000,0000,0140,0000,0000,0140,0000,0240, 0200,0000,0140,0000,0160,0000,0000,0220,0000,0000,0140,0000,0240, 0200,0000,0140,0000,0160,0000,0000,0220,0000,0000,0060,0000,0240, 0021,0043,0041,0121,0040,0023,0042,0003,0142,0042,0061,0001,0022, 0120,0000,0140,0010,0140,0010,0000,0140,0002,0000,0120,0000,0120, 0000,0000,0000,0000,0360,0000,0000,0000,0000,0000,0160,0000,0000, 0100,0000,0040,0005,0120,0000,0000,0100,0000,0000,0060,0000,0140, 0140,0040,0100,0001,0240,0041,0000,0242,0000,0002,0140,0000,0100, 0240,0000,0120,0002,0200,0000,0000,0320,0007,0000,0240,0000,0340, 0101,0021,0041,0020,0040,0005,0042,0121,0002,0021,0201,0000,0020, 0160,0000,0100,0000,0140,0000,0000,0160,0006,0000,0220,0000,0140, 0140,0000,0020,0001,0020,0000,0000,0100,0001,0000,0300,0000,0000, 0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, 0106,0041,0040,0147,0040,0000,0063,0041,0001,0102,0160,0002,0002, 0300,0000,0040,0017,0140,0017,0000,0240,0000,0000,0140,0000,0120, }; char bxxh[26][13] = { 0005,0150,0153,0062,0062,0246,0152,0127,0146,0203,0310,0017,0206, 0100,0000,0120,0000,0140,0000,0000,0100,0000,0000,0120,0000,0060, 0100,0000,0040,0000,0060,0000,0000,0060,0000,0000,0220,0000,0040, 0100,0000,0120,0000,0200,0000,0000,0100,0000,0000,0140,0000,0060, 0043,0142,0046,0140,0062,0147,0210,0131,0046,0106,0246,0017,0111, 0060,0000,0020,0000,0060,0000,0000,0040,0000,0000,0100,0000,0000, 0060,0000,0040,0000,0040,0000,0000,0040,0000,0000,0100,0000,0040, 0100,0000,0100,0000,0100,0000,0000,0040,0000,0000,0100,0000,0140, 0066,0045,0145,0140,0000,0070,0377,0030,0130,0103,0003,0017,0006, 0040,0000,0040,0000,0020,0000,0000,0040,0000,0000,0100,0000,0000, 0200,0000,0020,0000,0140,0000,0000,0120,0000,0000,0120,0000,0040, 0120,0000,0040,0000,0060,0000,0000,0060,0000,0000,0160,0000,0040, 0120,0000,0040,0000,0120,0000,0000,0040,0000,0000,0160,0000,0040, 0120,0000,0020,0000,0140,0000,0000,0120,0000,0000,0140,0000,0040, 0051,0126,0150,0140,0060,0210,0146,0006,0006,0165,0003,0017,0244, 0120,0000,0040,0000,0160,0000,0000,0140,0000,0000,0060,0000,0140, 0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, 0140,0000,0140,0000,0060,0000,0000,0100,0000,0000,0140,0000,0020, 0120,0000,0020,0000,0060,0000,0000,0060,0000,0000,0060,0000,0040, 0140,0000,0020,0000,0100,0000,0000,0140,0000,0000,0140,0000,0020, 0070,0125,0051,0162,0120,0105,0126,0104,0006,0044,0000,0017,0052, 0140,0000,0020,0000,0140,0000,0000,0060,0000,0000,0060,0000,0040, 0020,0000,0000,0000,0020,0000,0000,0000,0000,0000,0000,0000,0060, 0140,0000,0160,0000,0200,0000,0000,0140,0000,0000,0000,0000,0240, 0065,0042,0060,0200,0000,0210,0222,0146,0006,0204,0220,0012,0003, 0240,0000,0020,0000,0120,0000,0000,0200,0000,0000,0200,0000,0240, }; char xhx[26][13] = { 0032,0146,0042,0107,0076,0102,0042,0146,0202,0050,0006,0000,0051, 0036,0377,0057,0013,0057,0366,0377,0057,0001,0377,0057,0000,0040, 0037,0377,0020,0000,0100,0022,0377,0057,0362,0116,0100,0000,0017, 0057,0377,0057,0031,0137,0363,0377,0037,0362,0270,0077,0000,0117, 0074,0142,0012,0236,0076,0125,0063,0165,0341,0046,0047,0000,0024, 0020,0017,0075,0377,0040,0001,0377,0017,0001,0204,0020,0000,0040, 0057,0017,0057,0340,0140,0362,0314,0117,0003,0302,0100,0000,0057, 0057,0357,0077,0017,0100,0366,0314,0057,0342,0346,0037,0000,0060, 0252,0145,0072,0157,0377,0165,0063,0066,0164,0050,0363,0000,0362, 0000,0000,0020,0000,0020,0000,0000,0017,0000,0000,0020,0000,0000, 0117,0017,0237,0377,0200,0354,0125,0110,0004,0257,0000,0000,0300, 0057,0367,0054,0357,0157,0216,0314,0114,0217,0353,0053,0000,0057, 0077,0213,0077,0077,0177,0317,0377,0114,0377,0352,0077,0000,0076, 0077,0213,0077,0077,0157,0177,0377,0054,0377,0352,0117,0000,0075, 0125,0230,0065,0216,0057,0066,0063,0047,0345,0126,0011,0000,0033, 0057,0377,0051,0360,0120,0361,0273,0056,0001,0256,0057,0000,0060, 0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, 0076,0310,0056,0310,0137,0174,0273,0055,0335,0266,0033,0000,0155, 0077,0157,0057,0360,0057,0063,0042,0024,0077,0206,0020,0000,0040, 0057,0037,0077,0360,0100,0365,0377,0037,0362,0176,0050,0000,0026, 0167,0146,0042,0112,0077,0110,0062,0254,0366,0052,0377,0000,0163, 0060,0000,0040,0000,0120,0000,0377,0060,0012,0000,0037,0000,0257, 0037,0232,0157,0361,0040,0003,0125,0010,0001,0256,0000,0000,0340, 0377,0377,0377,0377,0377,0377,0377,0377,0377,0377,0377,0017,0277, 0253,0315,0257,0216,0377,0206,0146,0306,0371,0126,0232,0000,0004, 0057,0012,0100,0360,0160,0360,0000,0040,0000,0017,0157,0000,0176, }; char xxh[26][13] = { 0045,0150,0154,0162,0042,0246,0210,0147,0152,0103,0230,0017,0206, 0100,0000,0040,0000,0140,0000,0000,0100,0000,0021,0120,0017,0060, 0100,0000,0040,0002,0140,0320,0000,0060,0000,0001,0220,0017,0040, 0100,0001,0120,0001,0241,0000,0000,0100,0000,0020,0140,0017,0060, 0023,0162,0046,0142,0022,0207,0210,0131,0052,0106,0250,0017,0110, 0060,0000,0042,0000,0160,0000,0000,0040,0000,0212,0100,0017,0000, 0140,0000,0040,0002,0140,0000,0000,0120,0000,0040,0120,0017,0040, 0100,0000,0100,0000,0140,0001,0021,0140,0000,0046,0100,0017,0140, 0066,0045,0025,0201,0020,0130,0146,0030,0130,0103,0025,0017,0006, 0100,0000,0040,0000,0020,0000,0000,0040,0000,0000,0200,0017,0000, 0200,0000,0020,0001,0140,0000,0000,0140,0000,0000,0120,0017,0040, 0120,0026,0042,0020,0140,0161,0042,0143,0000,0022,0162,0017,0040, 0121,0042,0060,0020,0140,0200,0000,0123,0000,0021,0220,0017,0041, 0121,0042,0060,0120,0140,0200,0000,0123,0000,0021,0160,0017,0041, 0051,0126,0150,0141,0060,0210,0146,0066,0026,0165,0026,0017,0247, 0120,0000,0040,0003,0160,0000,0000,0140,0000,0021,0100,0017,0140, 0000,0000,0000,0000,0200,0000,0000,0000,0000,0000,0000,0017,0000, 0141,0023,0122,0040,0160,0143,0042,0142,0000,0047,0143,0017,0020, 0120,0000,0040,0006,0140,0060,0000,0141,0000,0026,0100,0017,0040, 0140,0000,0020,0007,0100,0000,0000,0140,0000,0001,0140,0017,0020, 0110,0125,0051,0162,0120,0125,0127,0104,0006,0104,0000,0017,0052, 0140,0000,0040,0000,0160,0000,0000,0140,0000,0000,0060,0017,0000, 0040,0005,0020,0000,0040,0313,0231,0030,0000,0140,0000,0017,0056, 0140,0000,0160,0000,0200,0000,0000,0140,0000,0000,0000,0017,0240, 0065,0042,0060,0040,0000,0206,0231,0146,0006,0224,0220,0017,0004, 0240,0000,0020,0000,0140,0000,0000,0220,0000,0000,0200,0017,0141, }; 060,0000,0141,0000,0026,0100,0017,0040, 0140,0000,0020,0007,0100,0000,0000,0140,0000,0001,0140,0017,0020, 0110,0125,0051,0162,0120,0125,0127,0104,0006,0104,0000,0017,0052, 0140,0000,0040,0000,0160,0000,0000,0140,0000,0000,0060,0017,0000, 0040,0005,0020,0000,0040,0313,0231,0030,0000,0140,0000,0017,0056, 0140,0000,0160,0000,0200,0000,0000,0140,0000,0000,0000,0017,0240, 0065,0042,0060,0040,0000,0206,0231,0146,0006,0224,0220,0017,0004, 0240,0000,0020,0000,0140,0000,0000,0220,00cmd/troff/makefile 644 0 33 557 2413413421 7377 DESTDIR = ntroff : troff nroff term.done troff : make -f Maketroff clean make -f Maketroff CC=$(CC) nroff : make -f Makenroff clean make -f Makenroff CC=$(CC) term.done: cd term; make date > term.done clean : rm -f *.o term.done install : install -s troff ${DESTDIR}/usr/bin install -s nroff ${DESTDIR}/usr/bin cd term; make DESTDIR=${DESTDIR} install 000,0140,0000,0000,0000,0017,0240, 0065,0042,0060,00/,5< /,"cmd/troff/n1.c 644 0 33 37430 2413706771 6436 ((#include #include #include "tdef.h" extern #include "d.h" extern #include "v.h" #ifdef NROFF extern #include "tw.h" #endif #include "s.h" #include jmp_buf sjbuf; #include /* troff1.c consume options, initialization, main loop, input routines, escape function calling */ int inchar[LNSIZE], *pinchar = inchar; /* XXX */ extern struct s *frame, *stk, *nxf; extern struct s *ejl, *litlev; extern filep ip; extern filep offset; extern filep nextb; extern int stdi; extern int waitf; extern int nofeed; extern int quiet; extern int ptid; extern int ascii; extern int npn; extern int xflg; extern int stop; extern char ibuf[IBUFSZ]; extern char xbuf[IBUFSZ]; extern char *ibufp; extern char *xbufp; extern char *eibuf; extern char *xeibuf; extern int cbuf[NC]; extern int *cp; extern int *vlist; extern int nx; extern int mflg; extern int ch; extern int pto; extern int pfrom; extern int cps; extern int chbits; extern int ibf; extern int ttyod; extern struct sgttyb ttys; extern int iflg; extern int init; extern int rargc; extern char **argp; extern char trtab[256]; extern int lgf; extern int copyf; extern int eschar; extern int ch0; extern int cwidth; extern int nlflg; extern int *ap; extern int donef; extern int nflush; extern int nchar; extern int rchar; extern int nfo; extern int ifile; extern int fc; extern int padc; extern int tabc; extern int dotc; extern int raw; extern int tabtab[NTAB]; extern char nextf[]; extern int nfi; #ifdef NROFF extern char termtab[]; extern int tti; #endif extern int ifl[NSO]; extern int ifi; extern int pendt; extern int flss; extern int fi; extern int lg; extern char ptname[]; extern int print; extern int nonumb; extern int pnlist[]; extern int *pnp; extern int nb; extern int trap; extern int tflg; extern int ejf; extern int lit; extern int cc; extern int c2; extern int spread; extern int gflag; extern int oline[]; extern int *olinep; extern int dpn; extern int noscale; extern char *unlkp; extern int pts; extern int level; extern int ttysave; extern int tdelim; extern int dotT; extern int tabch, ldrch; extern int eqflg; extern no_out; extern int hflg; #ifndef NROFF extern char codetab[]; extern int spbits; #endif extern int xxx; int stopmesg; filep ipl[NSO]; long offl[NSO]; long ioff; char *ttyp; extern struct contab { int rq; union { int (*f)(); unsigned mx; }x; }contab[NM]; int ms[] = {31,28,31,30,31,30,31,31,30,31,30,31}; #ifndef NROFF int acctf; #endif main(argc,argv) int argc; char **argv; { char *p, *q; register i, j; extern catch(), fpecatch(), kcatch(); signal(SIGHUP,catch); if(signal(SIGINT,catch) == SIG_IGN){ signal(SIGHUP,SIG_IGN); signal(SIGINT,SIG_IGN); signal(SIGQUIT,SIG_IGN); } signal(SIGFPE,fpecatch); signal(SIGPIPE,catch); signal(SIGTERM,kcatch); init1(argv[0][0]); options: while(--argc > 0 && (++argv)[0][0]=='-') switch(argv[0][1]){ case 0: goto start; case 'i': stdi++; continue; case 'q': quiet++; if(gtty(0, &ttys) >= 0) ttysave = ttys.sg_flags; continue; case 'n': npn = cnum(&argv[0][2]); continue; case 'p': xflg = 0; cps = cnum(&argv[0][2]); continue; case 'S': stopmesg++; continue; case 's': if(!(stop = cnum(&argv[0][2])))stop++; continue; case 'r': vlist[findr(argv[0][2])] = cnum(&argv[0][3]); continue; case 'm': p = &nextf[nfi]; q = &argv[0][2]; while((*p++ = *q++) != 0); if (access(nextf, 4) < 0) { char *local = "/usr/local/lib/tmac/tmac.\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; strcat(local, &argv[0][2]); if (access(local, 4) == 0) strcpy(nextf, local); } mflg++; continue; case 'o': getpn(&argv[0][2]); continue; #ifdef NROFF case 'h': hflg++; continue; case 'z': no_out++; continue; case 'e': eqflg++; continue; case 'T': p = &termtab[tti]; q = &argv[0][2]; if(!((*q) & 0177))continue; while((*p++ = *q++) != 0); dotT++; continue; #endif #ifndef NROFF case 'z': no_out++; case 'a': ascii = 1; nofeed++; case 't': ptid = 1; continue; case 'w': waitf = 1; continue; case 'f': nofeed++; continue; case 'x': xflg = 0; continue; case 'b': if(open(ptname,1) < 0)prstr("Busy.\n"); else prstr("Available.\n"); done3(0); case 'g': stop = ptid = gflag = 1; dpn = 0; continue; #endif default: pto = cnum(&argv[0][1]); continue; } if(argv[0][0] == '+'){ pfrom = cnum(&argv[0][1]); print = 0; if(argc > 0)goto options; } start: argp = argv; rargc = argc; init2(); setjmp(sjbuf); loop: copyf = lgf = nb = nflush = nlflg = 0; if(ip && (rbf0(ip)==0) && ejf && (frame->pframe <= ejl)){ nflush++; trap = 0; eject((struct s *)0); goto loop; } i = getch(); if(pendt)goto lt; if(lit && (frame <= litlev)){ lit--; goto lt; } if((j = (i & CMASK)) == XPAR){ copyf++; tflg++; for(;(i & CMASK) != '\n';)pchar(i = getch()); tflg = 0; copyf--; goto loop; } if((j == cc) || (j == c2)){ if(j == c2)nb++; copyf++; while(((j=((i=getch()) & CMASK)) == ' ') || (j == '\t')); ch = i; copyf--; control(getrq(),1); flushi(); goto loop; } lt: ch = i; text(); goto loop; } catch(){ /* prstr("Interrupt\n"); */ done3(01); } fpecatch(){ prstrfl("Floating Exception.\n"); signal(SIGFPE,fpecatch); } kcatch(){ signal(SIGTERM,SIG_IGN); done3(01); } #ifndef NROFF acctg() { static char *acct_file = "/usr/adm/tracct"; acctf = open(acct_file,1); setuid(getuid()); } #endif init1(a) char a; { register char *p; char *mktemp(); register i; #ifndef NROFF acctg();/*open troff actg file while mode 4755*/ #endif p = mktemp("/tmp/taXXXXX"); if(a == 'a')p = &p[5]; if((close(creat(p, 0600))) < 0){ prstr("Cannot create temp file.\n"); exit(-1); } ibf = open(p, 2); for(i=256; --i;)trtab[i]=i; trtab[UNPAD] = ' '; mchbits(); if(a != 'a')unlkp = p; } init2() { register i,j; extern int block; extern char *setbrk(); extern char *ttyname(); ttyod = 2; if(((ttyp=ttyname(j=0)) != (char *)0) || ((ttyp=ttyname(j=1)) != (char *)0) || ((ttyp=ttyname(j=2)) != (char *)0) );else ttyp = "notty"; iflg = j; if(ascii)mesg(0); if((!ptid) && (!waitf)){ if((ptid = open(ptname,1)) < 0){ prstr("Typesetter busy.\n"); done3(-2); } } ptinit(); for(i=NEV; i--;)write(ibf, (char *)&block, EVS*sizeof(int)); olinep = oline; ibufp = eibuf = ibuf; v.hp = init = 0; pinchar = inchar; /* XXX */ ioff = 0; v.nl = -1; cvtime(); frame = stk = (struct s *)setbrk(DELTA); dip = &d[0]; nxf = frame + 1; nx = mflg; } cvtime(){ long tt; register i; time(&tt); tt -= 3600*ZONE; /*5hrs for EST*/ v.dy = (tt/86400L) + 1; v.dw = (v.dy + 3)%7 + 1; for(v.yr=70;; v.yr++){ if((v.yr)%4)ms[1]=28;else ms[1]=29; for(i=0;i<12;){ if(v.dy<=ms[i]){ v.mo = i+1; return; } v.dy -= ms[i++]; } } } cnum(a) char *a; { register i; ibufp = a; eibuf = MAXPTR; i = atoi(); ch = 0; return(i); } mesg(f) int f; { static int mode; if (ttyp==0) return; if(!f){ stat(ttyp,cbuf); mode = ((struct stat *)(cbuf))->st_mode; chmod(ttyp,mode & ~022); }else{ chmod(ttyp,mode); } } prstrfl(s) char *s; { flusho(); prstr(s); } prstr(s) char *s; { register i; register char *j; j = s; for(i=0;*s;i++)s++; write(ttyod,j,i); } control(a,b) int a,b; { register i,j; extern filep boff(); i = a; if((i == 0) || ((j = findmn(i)) == -1))return(0); if(contab[j].rq & MMASK){ nxf->nargs = 0; if(b)collect(); flushi(); return(pushi(((filep)contab[j].x.mx)<= inchar + LNSIZE) { /* XXX */ inchar[0] = makem(sumhp()); pinchar = &inchar[1]; } *pinchar++ = i; /* XXX */ } return(i); } sumhp() /* XXX - add up widths in inchar array */ { register int n; register int *p; n = 0; for (p = inchar; p < pinchar; p++) n += width(*p); return(n); } char ifilt[32] = {0,001,002,003,0,005,006,007,010,011,012}; getch0(){ register int i, j; if(ch0){i=ch0; ch0=0; return(i);} if(nchar){nchar--; return(rchar);} again: if(cp){ if((i = *cp++) == 0){ cp = 0; goto again; } }else if(ap){ if((i = *ap++) == 0){ ap = 0; goto again; } }else if(ip){ if(ip == -1)i = rdtty(); else i = rbf(); }else{ if(donef)done(0); if(nx || ((ibufp >= eibuf) && (ibufp != MAXPTR))){ if(nfo)goto g1; g0: if(nextfile()){ if(ip)goto again; if(ibufp < eibuf)goto g2; } g1: nx = 0; if((j=read(ifile,ibuf,IBUFSZ)) <= 0)goto g0; ibufp = ibuf; eibuf = ibuf + j; if(ip)goto again; } g2: i = *ibufp++ & 0177; ioff++; if(i >= 040)goto g4; else i = ifilt[i]; } if(raw)return(i); if((j = i & CMASK) == IMP)goto again; if((i == 0) && !init)goto again; g4: if((copyf == 0) && ((i & ~BMASK) == 0) && ((i & CMASK) < 0370)) #ifndef NROFF if(spbits && (i>31) && ((codetab[i-32] & 0200))) i |= spbits; else #endif i |= chbits; if((i & CMASK) == eschar)i = (i & ~CMASK) | ESC; return(i); } nextfile(){ register char *p; n0: if(ifile)close(ifile); if(nx){ p = nextf; if(*p != 0)goto n1; } if(ifi > 0){ if(popf())goto n0; /*popf error*/ return(1); /*popf ok*/ } if(rargc-- <= 0)goto n2; p = (argp++)[0]; n1: if((p[0] == '-') && (p[1] == 0)){ ifile = 0; }else if((ifile=open(p,0)) < 0){ prstr("Cannot open "); prstr(p); prstr("\n"); nfo -= mflg; done(02); } nfo++; v.cd = 0; ioff = 0; return(0); n2: if((nfo -= mflg) && !stdi)done(0); nfo++; v.cd = ifile = stdi = mflg = 0; ioff = 0; return(0); } popf(){ register i; register char *p, *q; extern char *ttyname(); ioff = offl[--ifi]; ip = ipl[ifi]; if((ifile = ifl[ifi]) == 0){ p = xbuf; q = ibuf; ibufp = xbufp; eibuf = xeibuf; while(q < eibuf)*q++ = *p++; return(0); } if((lseek(ifile,(long)(ioff & ~(IBUFSZ-1)),0) < 0) || ((i = read(ifile,ibuf,IBUFSZ)) < 0))return(1); eibuf = ibuf + i; ibufp = ibuf; if(ttyname(ifile) == (char *)0) if((ibufp = ibuf + (int)(ioff & (IBUFSZ-1))) >= eibuf)return(1); return(0); } flushi(){ if(nflush)return; ch = 0; if((ch0 & CMASK) == '\n')nlflg++; ch0 = 0; copyf++; while(!nlflg){ if(donef && (frame == stk))break; getch(); } copyf--; v.hp = 0; pinchar = inchar; /* XXX */ } getach(){ register i; lgf++; if(((i = getch()) & MOT) || ((i&CMASK) == ' ') || ((i&CMASK) == '\n')|| (i & 0200)){ ch = i; i = 0; } lgf--; return(i & 0177); } casenx(){ lgf++; skip(); getname(); nx++; nextfile(); nlflg++; ip = 0; ap = 0; nchar = pendt = 0; frame = stk; nxf = frame + 1; } getname(){ register int i, j, k; lgf++; for(k=0; k < (NS-1); k++){ if(((j=(i=getch()) & CMASK) <= ' ') || (j > 0176))break; nextf[k] = j; } nextf[k] = 0; ch = i; lgf--; return(nextf[0]); } caseso(){ register i; register char *p, *q; lgf++; nextf[0] = 0; if(skip() || !getname() || ((i=open(nextf,0)) <0) || (ifi >= NSO)) { prstr("can't open file "); prstr(nextf); prstr("\n"); done(02); } flushi(); ifl[ifi] = ifile; ifile = i; offl[ifi] = ioff; ioff = 0; ipl[ifi] = ip; ip = 0; nx++; nflush++; if(!ifl[ifi++]){ p = ibuf; q = xbuf; xbufp = ibufp; xeibuf = eibuf; while(p < eibuf)*q++ = *p++; } } casecf(){ /* copy file without change */ int fd, i, n; char buf[OBUFSZ]; flusho(); lgf++; nextf[0] = 0; if(skip() || !getname() || ((fd=open(nextf,0)) <0) || (ifi >= NSO)) { prstr("can't open file "); prstr(nextf); prstr("\n"); done(02); } while ((n = read(fd, buf, OBUFSZ)) > 0) for (i = 0; i < n; i++) oput(buf[i]); flusho(); close(fd); } getpn(a) char *a; { register i, neg; long atoi1(); if((*a & 0177) == 0)return; neg = 0; ibufp = a; eibuf = MAXPTR; noscale++; while((i = getch() & CMASK) != 0)switch(i){ case '+': case ',': continue; case '-': neg = MOT; goto d2; default: ch = i; d2: i = atoi1(); if(nonumb)goto fini; else{ *pnp++ = i | neg; neg = 0; if(pnp >= &pnlist[NPN-2]){ prstr("Too many page numbers\n"); done3(-3); } } } fini: if(neg)*pnp++ = -2; *pnp = -1; ch = noscale = print = 0; pnp = pnlist; if(*pnp != -1)chkpn(); } setrpt(){ register i, j; copyf++;raw++; i = getch0(); copyf--;raw--; if((i < 0) || (((j = getch0()) & CMASK) == RPT))return; rchar = j; nchar = i & BMASK; } neg = MOT; goto d2; default: ch = i; d2: i = atoi1(); if(nonumb)goto fini; else{ *pnp++ = i | neg; neg = 0; if(pnp >= &pnlist[NPN-2]){ prstr("Too many page numbers\n"); done3(-3); } } cmd/troff/n10.c 644 0 33 10531 2346517341 6505 #include "tdef.h" #include extern #include "d.h" extern #include "v.h" extern #include "tw.h" /* nroff10.c Device interfaces */ extern int lss; extern char obuf[]; extern char *obufp; extern int xfont; extern int esc; extern int lead; extern int oline[]; extern int *olinep; extern int ulfont; extern int esct; extern int sps; extern int ics; extern int ttysave; extern struct sgttyb ttys; extern char termtab[]; extern int ptid; extern int waitf; extern int pipeflg; extern int eqflg; extern int hflg; extern int tabtab[]; extern int ascii; extern int xxx; int dtab; int bdmode; int plotmode; ptinit(){ register i, j; register char **p; char *q; int x[8]; extern char *setbrk(); if(((i=open(termtab,0)) < 0) && (i=open("/usr/lib/term/tablpr",0)) < 0){ prstr("Cannot open "); prstr(termtab); prstr("\n"); exit(-1); } read(i,(char *)x,8*sizeof(int)); read(i,(char *)&t.bset,j = sizeof(int)*((int *)&t.zzz - &t.bset)); x[2] -= j; q = setbrk(x[2]); lseek(i,(long)t.twinit+8*sizeof(int),0); i = read(i,q,x[2]); j = q - t.twinit; for(p = &t.twinit; p < &t.zzz; p++){ if(*p)*p += j;else *p = ""; } sps = EM; ics = EM*2; dtab = 8 * t.Em; for(i=0; i<16; i++)tabtab[i] = dtab * (i+1); if(eqflg)t.Adj = t.Hor; } twdone(){ obufp = obuf; oputs(t.twrest); flusho(); if(pipeflg){ close(ptid); wait(&waitf); } if(ttysave != -1) { ttys.sg_flags = ttysave; stty(1, &ttys); } } ptout(i) int i; { *olinep++ = i; if(olinep >= &oline[LNSIZE])olinep--; if((i&CMASK) != '\n')return; olinep--; lead += dip->blss + lss - t.Newline; dip->blss = 0; esct = esc = 0; if(olinep>oline){ move(); ptout1(); oputs(t.twnl); }else{ lead += t.Newline; move(); } lead += dip->alss; dip->alss = 0; olinep = oline; } ptout1() { register i, k; register char *codep; extern char *plot(); int *q, w, j, phyw; for(q=oline; q>9) & 03; if(*t.bdon & 0377){ if(!bdmode && (xfont == 2)){ oputs(t.bdon); bdmode++; } if(bdmode && (xfont != 2)){ oputs(t.bdoff); bdmode = 0; } } if(xfont == ulfont){ for(k=w/t.Char;k>0;k--)oput('_'); for(k=w/t.Char;k>0;k--)oput('\b'); } while(*codep != 0){ if(*codep & 0200){ codep = plot(codep); oputs(t.plotoff); oput(' '); }else{ if(plotmode)oputs(t.plotoff); *obufp++ = *codep++; if(obufp == (obuf + OBUFSZ + ascii - 1))flusho(); /* oput(*codep++);*/ } } if(!w)for(k=phyw/t.Char;k>0;k--)oput('\b'); } } char *plot(x) char *x; { register int i; register char *j, *k; if(!plotmode)oputs(t.ploton); k = x; if((*k & 0377) == 0200)k++; for(; *k; k++){ if(*k & 0200){ if(*k & 0100){ if(*k & 040)j = t.up; else j = t.down; }else{ if(*k & 040)j = t.left; else j = t.right; } if(!(i = *k & 037))return(++k); while(i--)oputs(j); }else oput(*k); } return(k); } move(){ register k; register char *i, *j; char *p, *q; int iesct, dt; iesct = esct; if(esct += esc)i = "\0"; else i = "\n\0"; j = t.hlf; p = t.right; q = t.down; if(lead){ if(lead < 0){ lead = -lead; i = t.flr; /* if(!esct)i = t.flr; else i = "\0";*/ j = t.hlr; q = t.up; } if(*i & 0377){ k = lead/t.Newline; lead = lead%((t.Newline; while(k--)oputs(i); } if(*j & 0377){ k = lead/t.Halfline; lead = lead%t.Halfline; while(k--)oputs(j); } else { /* no half-line forward, not at line begining */ k = lead/t.Newline; lead = lead%t.Newline; if (k>0) esc=esct; i = "\n"; while (k--) oputs(i); } } if(esc){ if(esc < 0){ esc = -esc; j = "\b"; p = t.left; }else{ j = " "; if(hflg)while((dt = dtab - (iesct%dtab)) <= esc){ if(dt%t.Em)break; oput(TAB); esc -= dt; iesct += dt; } } k = esc/t.Em; esc = esc%t.Em; while(k--)oputs(j); } if((*t.ploton & 0377) && (esc || lead)){ if(!plotmode)oputs(t.ploton); esc /= t.Hor; lead /= t.Vert; while(esc--)oputs(p); while(lead--)oputs(q); oputs(t.plotoff); } esc = lead = 0; } ptlead(){move();} dostop(){ char junk; flusho(); read(2,&junk,1); } ; j = "\b"; p = t.left; }else{ j = " "; if(hflg)while((dt = dtab - (iesct%dtab)) <= esc){ if(dt%t.Em)break; oput(TAB); esc -= dt; iesct +cmd/troff/n2.c 644 0 33 11530 2346517341 6426 #include "tdef.h" #include extern #include "d.h" extern #include "v.h" #ifdef NROFF extern #include "tw.h" #endif #include "s.h" #include jmp_buf sjbuf; /* troff2.c output, cleanup */ extern struct s *frame, *stk, *nxf; extern filep ip; extern filep offset; extern char *enda; extern char obuf[OBUFSZ]; extern char *obufp; extern int dilev; extern int eschar; extern int tlss; extern int tflg; extern int ascii; extern int print; extern char trtab[]; extern int waitf; extern char ptname[]; extern int ptid; extern int em; extern int ds; extern int mflg; extern filep woff; extern int nflush; extern int lgf; extern int app; extern int nfo; extern int donef; extern int *pendw; extern int nofeed; extern int trap; extern struct sgttyb ttys; extern int ttysave; extern int quiet; extern int pendnf; extern int ndone; extern int lead; extern int ralss; extern int paper; extern int gflag; extern char *unlkp; extern char nextf[]; extern int pipeflg; extern int ejf; extern int no_out; extern int level; extern int stopmesg; extern int xxx; int toolate; int error; #ifndef NROFF extern int acctf; #endif pchar(c) int c; { register i, j; if((i=c) & MOT){pchar1(i); return;} switch(j = i & CMASK){ case 0: case IMP: case RIGHT: case LEFT: return; case HX: j = (tlss>>9) | ((i&~0777)>>3); if(i & 040000){ j &= ~(040000>>3); if(j > dip->blss)dip->blss = j; }else{ if(j > dip->alss)dip->alss = j; ralss = dip->alss; } tlss = 0; return; case LX: tlss = i; return; case PRESC: if(dip == &d[0])j = eschar; default: i = (trtab[j] & BMASK) | (i & ~CMASK); } pchar1(i); } pchar1(c) int c; { register i, j, *k; extern int chtab[]; j = (i = c) & CMASK; if(dip != &d[0]){ wbf(i); dip->op = offset; return; } if(!tflg && !print){ if(j == '\n')dip->alss = dip->blss = 0; return; } if(no_out || (j == FILLER))return; #ifndef NROFF if(ascii){ if(i & MOT){ oput(' '); return; } if(j < 0177){ oput(i); return; } switch(j){ case 0200: case 0210: oput('-'); break; case 0211: oputs("fi"); break; case 0212: oputs("fl"); break; case 0213: oputs("ff"); break; case 0214: oputs("ffi"); break; case 0215: oputs("ffl"); break; default: for(k=chtab; *++k != j; k++) if(*k == 0)return; oput('\\'); oput('('); oput(*--k & BMASK); oput(*k >> BYTE); } }else #endif ptout(i); } oput(i) char i; { *obufp++ = i; if(obufp == (obuf + OBUFSZ + ascii - 1))flusho(); } oputs(i) char *i; { while(*i != 0)oput(*i++); } flusho(){ if(!ascii)*obufp++ = 0; if(!ptid){ while((ptid=open(ptname,1)) < 0){ if(++waitf <=2)prstr("Waiting for Typesetter.\n"); sleep(15); } } if(no_out == 0){ if (!toolate) { toolate++; #ifdef NROFF if(t.bset || t.breset){ if(ttysave == -1) { gtty(1, &ttys); ttysave = ttys.sg_flags; } ttys.sg_flags &= ~t.breset; ttys.sg_flags |= t.bset; stty(1, &ttys); } { char *p = t.twinit; while (*p++) ; write(ptid, t.twinit, p-t.twinit-1); } #endif } toolate += write(ptid, obuf, obufp-obuf); } obufp = obuf; } done(x) int x;{ register i; error |= x; level = 0; app = ds = lgf = 0; if(i=em){ donef = -1; em = 0; if(control(i,0))longjmp(sjbuf,1); } if(!nfo)done3(0); mflg = 0; dip = &d[0]; if(woff)wbt(0); if(pendw)getword(1); pendnf = 0; if(donef == 1)done1(0); donef = 1; ip = 0; frame = stk; nxf = frame + 1; if(!ejf)tbreak(); nflush++; eject((struct s *)0); longjmp(sjbuf,1); } done1(x) int x; { error |= x; if(v.nl){ trap = 0; eject((struct s *)0); longjmp(sjbuf,1); } if(nofeed){ ptlead(); flusho(); done3(0); }else{ if(!gflag)lead += TRAILER; done2(0); } } done2(x) int x; { register i; ptlead(); #ifndef NROFF if(!ascii){ oput(T_INIT); oput(T_STOP); if(!gflag)for(i=8; i>0; i--)oput(T_PAD); if(stopmesg)prstr("Troff finished.\n"); } #endif flusho(); done3(x); } done3(x) int x;{ error |= x; signal(SIGINT, SIG_IGN); signal(SIGTERM, SIG_IGN); unlink(unlkp); #ifdef NROFF twdone(); #endif if(quiet){ ttys.sg_flags |= ECHO; stty(0, &ttys); } if(ascii)mesg(1); #ifndef NROFF report(); #endif exit(error); } edone(x) int x;{ frame = stk; nxf = frame + 1; ip = 0; done(x); } #ifndef NROFF report(){ struct {int use; int uid;} a; if((ptid != 1) && paper ){ lseek(acctf,0L,2); a.use = paper; a.uid = getuid(); write(acctf,(char *)&a,sizeof(a)); close(acctf); } } #endif #ifdef NROFF casepi(){ register i; int id[2]; if(toolate || skip() || !getname() || (pipe(id) == -1) || ((i=fork()) == -1)){ prstr("Pipe not created.\n"); return; } ptid = id[1]; if(i>0){ close(id[0]); toolate++; pipeflg++; return; } close(0); dup(id[0]); close(id[1]); execl(nextf,nextf,0); prstr("Cannot exec: "); prstr(nextf); prstr("\n"); exit(-4); } #endif ek(acctf,0L,2); a.use = paper; a.uid = getuid(); write(acctf,(char *)&a,sizeof(a)); close(acctf); } } #endif #ifdef NROFF casepi(){ register i; int id[2]; cmd/troff/n3.c 644 0 33 25270 2350100442 6416 #include "tdef.h" extern #include "d.h" extern #include "v.h" #ifdef NROFF extern #include "tw.h" #endif #include "s.h" /* troff3.c macro and string routines, storage allocation */ unsigned blist[NBLIST]; extern struct s *frame, *stk, *nxf; extern filep ip; extern filep offset; extern filep nextb; extern char *enda; extern int ch; extern int ibf; extern int lgf; extern int copyf; extern int ch0; extern int app; extern int ds; extern int nlflg; extern int *argtop; extern int *ap; extern int nchar; extern int pendt; extern int rchar; extern int dilev; extern int nonumb; extern int lt; extern int nrbits; extern int nform; extern int fmt[]; extern int oldmn; extern int newmn; extern int macerr; extern filep apptr; extern int diflg; extern filep woff; extern filep roff; extern int wbfi; extern int po; extern int *cp; extern int xxx; int pagech = '%'; int strflg; extern struct contab { int rq; union { int (*f)(); unsigned mx; }x; }contab[NM]; #ifndef VMUNIX int wbuf[BLK]; int rbuf[BLK]; #else int *wbuf; int *rbuf; int Buf[NBLIST*BLK + NEV*EVS]; #endif caseig(){ register i; offset = 0; if((i = copyb()) != '.')control(i,1); } casern(){ register i,j; lgf++; skip(); if(((i=getrq())==0) || ((oldmn=findmn(i)) < 0))return; skip(); clrmn(findmn(j=getrq())); if(j)contab[oldmn].rq = (contab[oldmn].rq & MMASK) | j; } caserm(){ lgf++; while(!skip()){ clrmn(findmn(getrq())); } } caseas(){ app++; caseds(); } caseds(){ ds++; casede(); } caseam(){ app++; casede(); } casede(){ register i, req; register filep savoff; extern filep finds(); if(dip != d)wbfl(); req = '.'; lgf++; skip(); if((i=getrq())==0)goto de1; if((offset=finds(i)) == 0)goto de1; if(ds)copys(); else req = copyb(); wbfl(); clrmn(oldmn); if(newmn)contab[newmn].rq = i | MMASK; if(apptr){ savoff = offset; offset = apptr; wbt(IMP); offset = savoff; } offset = dip->op; if(req != '.')control(req,1); de1: ds = app = 0; return; } findmn(i) int i; { register j; for(j=0;j= 0){ if(contab[i].rq & MMASK)ffree(((filep)contab[i].x.mx)<= 0) && (contab[oldmn].rq & MMASK)){ savip = ip; ip = (((filep)contab[oldmn].x.mx)< 1)done2(02); prstr("Too many string/macro names.\n"); edone(04); return(offset = 0); } contab[i].x.mx = (unsigned)(nextb>>BLKBITS); if(!diflg){ newmn = i; if(oldmn == -1)contab[i].rq = -1; }else{ contab[i].rq = mn | MMASK; } }(( app = 0; return(offset = nextb); } skip(){ register i; while(((i=getch()) & CMASK) == ' '); ch=i; return(nlflg); } copyb() { register i, j, k; int ii, req, state; filep savoff; if(skip() || !(j=getrq()))j = '.'; req = j; k = j>>BYTE; j &= BMASK; copyf++; flushi(); nlflg = 0; state = 1; while(1){ i = (ii = getch()) & CMASK; if(state == 3){ if(i == k)break; if(!k){ ch = ii; i = getach(); ch = ii; if(!i)break; } state = 0; goto c0; } if(i == '\n'){ state = 1; nlflg = 0; goto c0; } if((state == 1) && (i == '.')){ state++; savoff = offset; goto c0; } if((state == 2) && (i == j)){ state++; goto c0; } state = 0; c0: if(offset)wbf(ii); } if(offset){ wbfl(); offset = savoff; wbt(0); } copyf--; return(req); } copys() { register i; copyf++; if(skip())goto c0; if(((i=getch()) & CMASK) != '"')wbf(i); while(((i=getch()) & CMASK) != '\n')wbf(i); c0: wbt(0); copyf--; } filep alloc() { register i; extern filep boff(); filep j; for(i=0;i>BLKBITS); } offset = ((filep)blist[j])<= BLK)wbfl(); } wbfl(){ if(woff == 0)return; #ifndef VMUNIX lseek(ibf, ((long)woff) * sizeof(int), 0); write(ibf, (char *)wbuf, wbfi * sizeof(int)); #endif if((woff & (~(BLK-1))) == (roff & (~(BLK-1))))roff = -1; woff = 0; } blisti(i) filep i; { return((i-NEV*EVS)/(BLK)); } rbf(){ register i; extern filep incoff(); if((i=rbf0(ip)) == 0){ if(!app)i = popi(); }else{ ip = incoff(ip); } return(i); } rbf0(p) filep p; { register filep i; if((i = (p & (~(BLK-1)))) != roff){ roff = i; #ifndef VMUNIX lseek(ibf, ((long)roff) * sizeof(int), 0); if(read(ibf, (char *)rbuf, BLK * sizeof(int)) == 0)return(0); #else rbuf = &Buf[roff]; #endif } return(rbuf[p & (BLK-1)]); } filep incoff(p) filep p; { register i; register filep j; if(!((j = (++p)) & (BLK-1))){ if((i = blist[blisti(--p)]) == -1){ prstr("Bad storage allocation.\n"); done2(-5); } j = ((filep)i)<nargs = 0; frame = p->pframe; ip = p->pip; nchar = p->pnchar; rchar = p->prchar; pendt = p->ppendt; ap = p->pap; cp = p->pcp; ch0 = p->pch0; return(p->pch); } pushi(newip) filep newip; { register struct s *p; extern char *setbrk(); if((enda - sizeof(struct s)) < (char *)nxf)setbrk(DELTA); p = nxf; p->pframe = frame; p->pip = ip; p->pnchar = nchar; p->prchar = rchar; p->ppendt = pendt; p->pap = ap; p->pcp = cp; p->pch0 = ch0; p->pch = ch; cp = ap = 0; nchar = rchar = pendt = ch0 = ch = 0; frame = nxf; if(nxf->nargs == 0) nxf += 1; else nxf = (struct s *)argtop; return(ip = newip); } char *setbrk(x) int x; { register char *i; char *sbrk(); if((i = sbrk(x)) == MAXPTR){ prstrfl("Core limit reached.\n"); edone(0100); }else{ enda = i + x; } return(i); } getsn(){ register i; if((i=getach()) == 0)return(0); if(i == '(')return(getrq()); else return(i); } setstr(){ register i; lgf++; if(((i=getsn()) == 0) || ((i=findmn(i)) == -1) || !(contab[i].rq & MMASK)){ lgf--; return(0); }else{ if((enda-2) < (char *)nxf)setbrk(DELTA); nxf->nargs = 0; strflg++; lgf--; return(pushi(((filep)contab[i].x.mx)<nargs = 0; savnxf = nxf; if(skip())goto rtn; lim = (int *)(nxf = savnxf + sizeof(struct s)/sizeof(savnxf)); strflg = 0; if((argppend = (argpp = (int **)savnxf+(sizeof(struct s)/sizeof(int **))) + 9) > (int **)enda)setbrk(DELTA); strp = (int *)argppend; for(i=8; i>=0; i--)argpp[i] = 0; while((argpp != argppend) && (!skip())){ *argpp++ = strp; quote = 0; if(((i = getch()) & CMASK) == '"')quote++; else ch = i; while(1){ i = getch(); if( nlflg || ((!quote) && ((i & CMASK) == ' ')))break; if(quote && ((i & CMASK) == '"') && (((i=getch()) & CMASK) != '"')){ ch = i; break; } *strp++ = i; if(strflg && (strp >= lim)){ prstrfl("Macro argument too long.\n"); copyf--; edone(004); } if((enda-4) <= (char *)strp)setbrk(DELTA); } *strp++ = 0; } nxf = savnxf; nxf->nargs = argpp -(int **)(nxf + 1); argtop = strp; rtn: copyf--; } seta() { register i; if(((i = (getch() & CMASK) - '0') > 0) && (i <= 9) && (i <= frame->nargs))ap = *((int **)frame + i-1 + (sizeof(struct s)/sizeof(int **))); } caseda(){ app++; casedi(); } casedi(){ register i, j; register *k; lgf++; if(skip() || ((i=getrq()) == 0)){ if(dip != d)wbt(0); if(dilev > 0){ v.dn = dip->dnl; v.dl = dip->maxl; dip = &d[--dilev]; offset = dip->op; } goto rtn; } if(++dilev == NDI){ --dilev; prstr("Cannot divert.\n"); edone(02); } if(dip != d)wbt(0); diflg++; dip = &d[dilev]; dip->op = finds(i); dip->curd = i; clrmn(oldmn); k = (int *)&dip->dnl; for(j=0; j<10; j++)k[j] = 0; /*not op and curd*/ rtn: app = 0; diflg = 0; } casedt(){ lgf++; dip->dimac = dip->ditrap = dip->ditf = 0; skip(); dip->ditrap = vnumb((int *)0); if(nonumb)return; skip(); dip->dimac = getrq(); } casetl(){ register i, j; int w1, w2, w3, delim; filep begin; extern width(), pchar(); dip->nls = 0; skip(); if(dip != d)wbfl(); if((offset = begin = alloc()) == 0)return; if((delim = getch()) & MOT){ ch = delim; delim = '\''; }else delim &= CMASK; if(!nlflg) while(((i = getch()) & CMASK) != '\n'){ if((i & CMASK) == delim)i = IMP; wbf(i); } wbf(IMP);wbf(IMP);wbt(0); w1 = hseg(width,begin); w2 = hseg(width,(filep)0); w3 = hseg(width,(filep)0); offset = dip->op; #ifdef NROFF if(!offset)horiz(po); #endif hseg(pchar,begin); if(w2 || w3)horiz(j=quant((lt - w2)/2-w1,HOR)); hseg(pchar,(filep)0); if(w3){ horiz(lt-w1-w2-w3-j); hseg(pchar,(filep)0); } newline(0); if(dip != d){if(dip->dnl > dip->hnl)dip->hnl = dip->dnl;} else{if(v.nl > dip->hnl)dip->hnl = v.nl;} ffree(begin); } casepc(){ pagech = chget(IMP); } hseg(f,p) int (*f)(); filep p; { register acc, i; static filep q; acc = 0; if(p)q = p; while(1){ i = rbf0(q); q = incoff(q); if(!i || (i == IMP))return(acc); if((i & CMASK) == pagech){ nrbits = i & ~CMASK; nform = fmt[findr('%')]; acc += fnumb(v.pn,f); }else acc += (*f)(i); } } casepm(){ register i, k; register char *p; int xx, cnt, kk, tot; filep j; char *kvt(); char pmline[10]; kk = cnt = 0; tot = !skip(); for(i = 0; i> BYTE) & 0177))*(p-1) = ' '; *p++ = ' '; kvt(k,p); prstr(pmline); } } if(tot || (cnt > 1)){ kvt(kk,pmline); prstr(pmline); } } char *kvt(k,p) int k; char *p; { if(k>=100)*p++ = k/100 + '0'; if(k>=10)*p++ = (k%100)/10 + '0'; *p++ = k%10 + '0'; *p++ = '\n'; *p = 0; return(p); } dummy(){} e; p = pmline; j = (((filep)contab[i].x.mx)<> BYTE) & 0177))*(p-1) = ' '; *p++ = ' '; kvt(k,p); prstr(pmline); } } if(tot || (cnt > 1)){ kvt(kk,pmline); prcmd/troff/n4.c 644 0 33 20433 2347772525 6442 #include "tdef.h" extern #include "d.h" extern #include "v.h" #ifdef NROFF extern #include "tw.h" #endif #include "s.h" /* troff4.c number registers, conversion, arithmetic */ extern int inchar[LNSIZE], *pinchar; /* XXX */ extern struct s *frame; extern int ascii; extern int cbuf[NC]; extern int *cp; extern int r[NN]; extern int *vlist; extern int inc[NN]; extern int fmt[NN]; extern int ch; extern int lgf; extern int pl; extern int lastl; extern int ralss; extern int totout; extern int nrbits; extern int nonumb; extern int vflag; extern int noscale; extern int dfact; extern int dfactd; extern int po; extern int nform; extern int ll; extern int in; extern int font; extern int bdtab[]; extern int lss; extern int pts; extern int fi; extern int res; extern int cwidth; extern int dotT; extern int ev; extern int ne; extern int ad, admod; extern int print; extern int ls; extern int nel, un; extern int xxx; int regcnt = NNAMES; setn() { register i,j; int f; f = nform = 0; if((i=getch() & CMASK) == '+')f = 1; else if(i == '-')f = -1; else ch = i; if((i=getsn()) == 0)return; if((i & 0177) == '.')switch(i>>BYTE){ case 's': i = pts & 077; break; case 'v': i = lss; break; case 'f': i = font + 1; break; case 'p': i = pl; break; case 't': i = findt1(); break; case 'o': i = po; break; case 'l': i = ll; break; case 'i': i = in; break; case '$': i = frame->nargs; break; case 'A': i = ascii; break; case 'c': i = v.cd; break; case 'n': i = lastl; break; case 'a': i = ralss; brea((k; case 'h': i = dip->hnl; break; case 'd': if(dip != d)i = dip->dnl; else i = v.nl; break; case 'u': i = fi; break; case 'j': i = ad + 2*admod; break; case 'w': i = width(*(pinchar-1)); break; /* XXX */ case 'x': i = nel; break; case 'y': i = un; break; case 'T': i = dotT; break; /*-Tterm used in nroff*/ case 'V': i = VERT; break; case 'H': i = HOR; break; case 'k': i = ne; break; case 'P': i = print; break; case 'L': i = ls; break; case 'R': i = NN - regcnt; break; case 'z': i = dip->curd; cbuf[0] = i & BMASK; cbuf[1] = (i >> BYTE) & BMASK; cbuf[2] = 0; cp = cbuf; return; #ifndef NROFF case 'b': i = bdtab[font]; break; #endif default: goto s0; } else{ s0: if((j=findr(i)) == -1)i = 0; else{ i = (vlist[j] = (vlist[j] + inc[j]*f)); nform = fmt[j]; } } setn1(i); cp = cbuf; } setn1(i) int i; { extern int wrc(); cp = cbuf; nrbits = 0; fnumb(i,wrc); *cp = 0; cp = cbuf; } findr(i) int i; { register j; static int numerr; if(i == 0)return(-1); for(j=0;j 1)done2(04); else edone(04); } return(j); } fnumb(i,f) int i, (*f)(); { register j; j = 0; if(i < 0){ j = (*f)('-' | nrbits); i = -i; } switch(nform){ default: case '1': case 0: return(decml(i,f) + j); case 'i': case 'I': return(roman(i,f) + j); case 'a': case 'A': return(abc(i,f) + j); } } decml(i,f) int i, (*f)(); { register j,k; k = 0; nform--; if((j=i/10) || (nform > 0))k = decml(j,f); return(k + (*f)((i%10 + '0') | nrbits)); } roman(i,f) int i, (*f)(); { if(!i)return((*f)('0' | nrbits)); if(nform == 'i')return(roman0(i,f,"ixcmz","vldw")); else return(roman0(i,f,"IXCMZ","VLDW")); } roman0(i,f,onesp,fivesp) int i, (*f)(); char *onesp, *fivesp; { register q, rem, k; k = 0; if(!i)return(0); k = roman0(i/10,f,onesp+1,fivesp+1); q = (i=i%10)/5; rem = i%5; if(rem == 4){ k += (*f)(*onesp | nrbits); if(q)i = *(onesp+1); else i = *fivesp; return(k += (*f)(i | nrbits)); } if(q)k += (*f)(*fivesp | nrbits); while(--rem >= 0) k += (*f)(*onesp | nrbits); return(k); } abc(i,f) int i, (*f)(); { if(!i)return((*f)('0' | nrbits)); else return(abc0(i-1,f)); } abc0(i,f) int i, (*f)(); { register j, k; k = 0; if(j=i/26)k = abc0(j-1,f); return(k + (*f)((i%26 + nform) | nrbits)); } wrc(i) int i; { if(cp >= &cbuf[NC])return(0); *cp++ = i; return(1); } atoi(){ extern long atoi0(); return((int)atoi0()); } long atoi0() { register ii, k, cnt; long i, acc; extern long ckph(); i = 0; acc = 0; nonumb = 0; cnt = -1; a0: cnt++; switch((ii=getch()) & CMASK){ default: ch = ii; if(cnt)break; case '+': i = ckph(); if(nonumb)break; acc += i; goto a0; case '-': i = ckph(); if(nonumb)break; acc -= i; goto a0; case '*': i = ckph(); if(nonumb)break; acc *= i; goto a0; case '/': i = ckph(); if(nonumb)break; if(i == 0){ prstrfl("Divide by zero.\n"); acc = 0; }else acc /= i; goto a0; case '%': i = ckph(); if(nonumb)break; acc %= i; goto a0; case '&': /*and*/ i = ckph(); if(nonumb)break; if((acc > 0) && (i > 0))acc = 1; else acc = 0; goto a0; case ':': /*or*/ i = ckph(); if(nonumb)break; if((acc > 0) || (i > 0))acc = 1; else acc = 0; goto a0; case '=': if(((ii=getch()) & CMASK) != '=')ch = ii; i = ckph(); if(nonumb){acc = 0; break;} if(i == acc)acc = 1; else acc = 0; goto a0; case '>': k = 0; if(((ii=getch()) & CMASK) == '=')k++; else ch =ii; i = ckph(); if(nonumb){acc = 0; break;} if(acc > (i - k))acc = 1; else acc = 0; goto a0; case '<': k = 0; if(((ii=getch()) & CMASK) == '=')k++; else ch =ii; i = ckph(); if(nonumb){acc = 0; break;} if(acc < (i + k))acc = 1; else acc = 0; goto a0; case ')': break; case '(': acc = atoi0(); goto a0; } return(acc); } long ckph(){ register i; long j; extern long atoi0(); extern long atoi1(); if(((i = getch()) & CMASK) == '(')j = atoi0(); else{ ch = i; j = atoi1(); } return(j); } long atoi1() { register i, j, digits; long acc; int neg, abs, field; neg = abs = field = digits = 0; acc = 0; a0: switch((i = getch()) & CMASK){ default: ch = i; break; case '+': goto a0; case '-': neg = 1; goto a0; case '|': abs = 1 + neg; neg = 0; goto a0; } a1: while(((j = ((i = getch()) & CMASK) - '0') >= 0) && (j <= 9)){ field++; digits++; acc = 10*acc + j; } if((i & CMASK) == '.'){ field++; digits = 0; goto a1; } ch = i; if(!field)goto a2; switch((i = getch()) & CMASK){ case 'u': i = j = 1; break; case 'v': /*VSs - vert spacing*/ j = lss; i = 1; break; case 'm': /*Ems*/ j = EM; i = 1; break; case 'n': /*Ens*/ j = EM; #ifndef NROFF i = 2; #endif #ifdef NROFF i = 1; /*Same as Ems in NROFF*/ #endif break; case 'p': /*Points*/ j = INCH; i = 72; break; case 'i': /*Inches*/ j = INCH; i = 1; break; case 'c': /*Centimeters*/ j = INCH*50; i = 127; break; case 'P': /*Picas*/ j = INCH; i = 6; break; default: j = dfact; ch = i; i = dfactd; } if(neg) acc = -acc; if(!noscale){ acc = (acc*j)/i; } if((field != digits) && (digits > 0))while(digits--)acc /= 10; if(abs){ if(dip != d)j = dip->dnl; else j = v.nl; if(!vflag)j = v.hp = sumhp(); /* XXX */ if(abs == 2)j = -j; acc -= j; } a2: nonumb = !field; return(acc); } caserr(){ register i,j; lgf++; while(!skip() && (i=getrq()) ){ for(j=NNAMES; j= '0') && (j <= '9'))k++; } if(!k)k=j; fmt[findr(i)] = k & BMASK; } vnumb(i) int *i; { vflag++; dfact = lss; res = VERT; return(inumb(i)); } hnumb(i) int *i; { dfact = EM; res = HOR; return(inumb(i)); } inumb(n) int *n; { register i, j, f; f = 0; if(n){ if((j = (i = getch()) & CMASK) == '+')f = 1; else if(j == '-')f = -1; else ch = i; } i = atoi(); if(n && f)i = *n + f*i; i = quant(i,res); vflag = 0; res = dfactd = dfact = 1; if(nonumb)i = 0; return(i); } quant(n,m) int n, m; { register i, neg; neg = 0; if(n<0){ neg++; n = -n; } i = n/m; if((n - m*i) > (m/2))i += 1; i *= m; if(neg)i = -i; return(i); } b(i)); } hnumb(i) int *i; { dfact = EM; res = HOR; return(inumb(i)); } inumb(n) int *n; { register i, j, f; f = 0; if(n){ if((j = (i = getch()) & CMASK) == '+')f = 1; else if(j == '-')f = -1; else ch = i; } i = atocmd/troff/n5.c 644 0 33 27067 2347774774 6465 #include "tdef.h" #include extern #include "d.h" extern #include "v.h" #include "s.h" /* troff5.c misc processing requests */ extern int inchar[LNSIZE], *pinchar; /* XXX */ extern struct s *frame; extern struct s *litlev; extern filep ip; extern filep offset; extern int ascii; extern int nonumb; extern int admod; extern int ad; extern int fi; extern int cc; extern int c2; extern int ohc; extern int tabc; extern int dotc; extern int pendnf; extern int hyf; extern int ce; extern int po; extern int po1; extern int nc; extern int in; extern int un; extern int un1; extern int in1; extern int ll; extern int ll1; extern int lt; extern int lt1; extern int nlist[NTRAP]; extern int mlist[NTRAP]; extern int lgf; extern int pl; extern int npn; extern int npnflg; extern int copyf; extern char nextf[]; extern int trap; extern int lss; extern int em; extern int evlist[EVLSZ]; extern int evi; extern int ibf; extern int ev; extern int ch; extern int nflush; extern int tty; extern struct sgttyb ttys; extern int quiet; extern int iflg; extern int eschar; extern int lit; extern int ls; extern int ls1; extern int tabtab[]; extern char trtab[]; extern int ul; extern int cu; extern int sfont; extern int font; extern int fontlab[]; extern int it; extern int itmac; extern int noscale; extern int ic; extern int icf; extern int ics; extern int *vlist; extern int sv; extern int esc; extern int nn; extern int nms; extern int ndf; extern int lnmod; extern int ni; extern int lnsize; extern int nb; extern int nlflg; extern int apts, apts1, pts, pts1, font, font1; extern int ulfont; extern int ulbit; extern int error; extern int nmbits; extern int chbits; extern int tdelim; extern int xxx; int iflist[NIF]; int ifx; casead(){ register i; ad = 1; /*leave admod alone*/ if(skip())return; switch(i = getch() & CMASK){ case 'r': /*right adj, left ragged*/ admod = 2; break; case 'l': /*left adj, right ragged*/ admod = ad = 0; /*same as casena*/ break; case 'c': /*centered adj*/ admod = 1; break; case 'b': case 'n': admod = 0; break; case '0': case '2': case '4': ad = 0; case '1': case '3': case '5': admod = (i - '0')/2; } } casena(){ ad = 0; } casefi(){ tbreak(); fi++; pendnf = 0; lnsize = LNSIZE; } casenf(){ tbreak(); fi = 0; /* can't do while oline is only LNSIZE lnsize = LNSIZE + WDSIZE; */ } casers(){ dip->nls = 0; } casens(){ dip->nls++; } chget(c) int c; { register i; if(skip() || ((i = getch()) & MOT) || ((i&CMASK) == ' ') || ((i&CMASK) == '\n')){ ch = i; retu((rn(c); }else return(i & BMASK); } casecc(){ cc = chget('.'); } casec2(){ c2 = chget('\''); } casehc(){ ohc = chget(OHC); } casetc(){ tabc = chget(0); } caselc(){ dotc = chget(0); } casehy(){ register i; hyf = 1; if(skip())return; noscale++; i = atoi(); noscale = 0; if(nonumb)return; hyf = max(i,0); } casenh(){ hyf = 0; } max(aa,bb) int aa,bb; { if(aa>bb)return(aa); else return(bb); } casece(){ register i; noscale++; skip(); i = max(atoi(),0); if(nonumb)i = 1; tbreak(); ce = i; noscale = 0; } casein(){ register i; if(skip())i = in1; else i = max(hnumb(&in),0); tbreak(); in1 = in; in = i; if(!nc){ un = in; setnel(); } } casell(){ register i; if(skip())i = ll1; else i = max(hnumb(&ll),INCH/10); ll1 = ll; ll = i; setnel(); } caselt(){ register i; if(skip())i = lt1; else i = max(hnumb(<),0); lt1 = lt; lt = i; } caseti(){ register i; if(skip())return; i = max(hnumb(&in),0); tbreak(); un1 = i; setnel(); } casels(){ register i; noscale++; if(skip())i = ls1; else i = max(inumb(&ls),1); ls1 = ls; ls = i; noscale = 0; } casepo(){ register i; if(skip())i = po1; else i = max(hnumb(&po),0); po1 = po; po = i; #ifndef NROFF if(!ascii)esc += po - po1; #endif } casepl(){ register i; skip(); if((i = vnumb(&pl)) == 0)pl = 11 * INCH; /*11in*/ else pl = i; if(v.nl > pl)v.nl = pl; } casewh(){ register i, j, k; lgf++; skip(); i = vnumb((int *)0); if(nonumb)return; skip(); j = getrq(); if((k=findn(i)) != NTRAP){ mlist[k] = j; return; } for(k=0; knls)return; eject(savframe); } casetm(x) int x;{ register i; char tmbuf[NTM]; lgf++; copyf++; if(skip() && x)prstrfl("User Abort."); for(i=0; inls || trap)return; i = findt1(); if(!a){ skip(); j = vnumb((int *)0); if(nonumb)j = lss; }else j = a; if(j == 0)return; if(i < j)j = i; savlss = lss; if(dip != d)i = dip->dnl; else i = v.nl; if((i + j) < 0)j = -i; lss = j; newline(0); lss = savlss; } casert(){ register a, *p; skip(); if(dip != d)p = &dip->dnl; else p = &v.nl; a = vnumb(p); if(nonumb)a = dip->mkline; if((a < 0) || (a >= *p))return; nb++; casesp(a - *p); } caseem(){ lgf++; skip(); em = getrq(); } casefl(){ tbreak(); flusho(); } caseev(){ register nxev; extern int block; if(skip()){ e0: if(evi == 0)return; nxev = evlist[--evi]; goto e1; } noscale++; nxev = atoi(); noscale = 0; if(nonumb)goto e0; flushi(); if((nxev >= NEV) || (nxev < 0) || (evi >= EVLSZ)){ prstrfl("Cannot do ev.\n"); if(error)done2(040);else edone(040); return; } evlist[evi++] = ev; e1: if(ev == nxev)return; lseek(ibf, (long)(ev*EVS*sizeof(int)), 0); write(ibf,(char *)&block, EVS*sizeof(int)); lseek(ibf, (long)(nxev*EVS*sizeof(int)), 0); read(ibf,(char *)&block, EVS*sizeof(int)); ev = nxev; } caseel(){ if(--ifx < 0){ ifx = 0; iflist[0] = 0; } caseif(2); } caseie(){ if(ifx >= NIF){ prstr("if-else overflow.\n"); ifx = 0; edone(040); } caseif(1); ifx++; } caseif(x) int x; { register i, notflag, true; if(x == 2){ notflag = 0; true = iflist[ifx]; goto i1; } true = 0; skip(); if(((i = getch()) & CMASK) == '!'){ notflag = 1; }else{ notflag = 0; ch = i; } i = atoi(); if(!nonumb){ if(i > 0)true++; goto i1; } switch((i = getch()) & CMASK){ case 'e': if(!(v.pn & 01))true++; break; case 'o': if(v.pn & 01)true++; break; #ifdef NROFF case 'n': true++; case 't': #endif #ifndef NROFF case 't': true++; case 'n': #endif case ' ': break; default: true = cmpstr(i); } i1: true ^= notflag; if(x == 1)iflist[ifx] = !true; if(true){ i2: do{ v.hp = 0; pinchar = inchar; /* XXX */ } while(((i = getch()) & CMASK) == ' '); if((i & CMASK) == LEFT)goto i2; ch = i; nflush++; }else{ copyf++; if(eat(LEFT) == LEFT){ while(eatblk(RIGHT,LEFT) != RIGHT)nlflg = 0; } copyf--; } } eatblk(right,left) int right,left; { register i; e0: while(((i = getch() & CMASK) != right) && (i != left) && (i != '\n')); if(i == left){ while((i=eatblk(right,left)) != right)nlflg = 0; goto e0; } return(i); } cmpstr(delim) int delim; { register i, j; register filep p; extern filep alloc(); extern filep incoff(); filep begin; int cnt, k; int savapts, savapts1, savfont, savfont1, savpts, savpts1; if(delim & MOT)return(0); delim &= CMASK; if(dip != d)wbfl(); if((offset = begin = alloc()) == (filep)0)return(0); cnt = 0; v.hp = 0; pinchar = inchar; /* XXX */ savapts = apts; savapts1 = apts1; savfont = font; savfont1 = font1; savpts = pts; savpts1 = pts1; while(((j = (i=getch()) & CMASK) != delim) && (j != '\n')){ wbf(i); cnt++; } wbt(0); k = !cnt; if(nlflg)goto rtn; p = begin; apts = savapts; apts1 = savapts1; font = savfont; font1 = savfont1; pts = savpts; pts1 = savpts1; mchbits(); v.hp = 0; pinchar = inchar; /* XXX */ while(((j = (i=getch()) & CMASK) != delim) && (j != '\n')){ if(rbf0(p) != i){ eat(delim); k = 0; break; } p = incoff(p); k = !(--cnt); } rtn: apts = savapts; apts1 = savapts1; font = savfont; font1 = savfont1; pts = savpts; pts1 = savpts1; mchbits(); offset = dip->op; ffree(begin); return(k); } caserd(){ lgf++; skip(); getname(); if(!iflg){ if(quiet){ ttys.sg_flags &= ~ECHO; stty(0, &ttys); prstrfl(""); /*bell*/ }else{ if(nextf[0]){ prstr(nextf); prstr(":"); }else{ prstr(""); /*bell*/ } } } collect(); tty++; pushi((filep)-1); } rdtty(){ char onechar; onechar = 0; if(read(0, &onechar, 1) == 1){ if(onechar == '\n')tty++; else tty = 1; if(tty != 3)return(onechar); } popi(); tty = 0; if(quiet){ ttys.sg_flags |= ECHO; stty(0, &ttys); } return(0); } caseec(){ eschar = chget('\\'); } caseeo(){ eschar = 0; } caseli(){ skip(); lit = max(inumb((int *)0),1); litlev = frame; if((dip == d) && (v.nl == -1))newline(1); } caseta(){ register i; tabtab[0] = nonumb = 0; for(i=0; ((i < (NTAB-1)) && !nonumb); i++){ if(skip())break; tabtab[i] = max(hnumb(&tabtab[max(i-1,0)]),0) & TMASK; if(!nonumb) switch(ch & CMASK){ case 'C': tabtab[i] |= CTAB; break; case 'R': tabtab[i] |= RTAB; break; default: /*includes L*/ break; } nonumb = ch = 0; } tabtab[i] = 0; } casene(){ register i, j; skip(); i = vnumb((int *)0); if(nonumb)i = lss; if(i > (j = findt1())){ i = lss; lss = j; dip->nls = 0; newline(0); lss = i; } } casetr(){ register i, j; lgf++; skip(); while((i = getch() & CMASK) != '\n'){ if((i & MOT) || ((j = getch()) & MOT))return; if((j &= CMASK) == '\n')j = ' '; trtab[i] = j; } } casecu(){ cu++; caseul(); } caseul(){ register i; noscale++; if(skip())i = 1; else i = atoi(); if(ul && (i == 0)){ font = sfont; ul = cu = 0; } if(i){ if(!ul){ sfont = font; font = ulfont; } ul = i; } noscale = 0; mchbits(); } caseuf(){ register i, j; if(skip() || !(i = getrq()) || (i == 'S') || ((j = find(i,fontlab)) == -1)) ulfont = 1; /*default position 2*/ else ulfont = j; #ifdef NROFF if(ulfont == 0)ulfont = 1; #endif ulbit = ulfont<<9; } caseit(){ register i; lgf++; it = itmac = 0; noscale++; skip(); i = atoi(); skip(); if(!nonumb && (itmac = getrq()))it = i; noscale = 0; } casemc(){ register i; if(icf > 1)ic = 0; icf = 0; if(skip())return; ic = getch(); icf = 1; skip(); i = max(hnumb((int *)0),0); if(!nonumb)ics = i; } casemk(){ register i, j; if(dip != d)j = dip->dnl; else j = v.nl; if(skip()){ dip->mkline = j; return; } if((i = getrq()) == 0)return; vlist[findr(i)] = j; } casesv(){ register i; skip(); if((i = vnumb((int *)0)) < 0)return; if(nonumb)i = 1; sv += i; caseos(); } caseos(){ register savlss; if(sv <= findt1()){ savlss = lss; lss = sv; newline(0); lss = savlss; sv = 0; } } casenm(){ register i; lnmod = nn = 0; if(skip())return; lnmod++; noscale++; i = inumb(&v.ln); if(!nonumb)v.ln = max(i,0); getnm(&ndf,1); getnm(&nms,0); getnm(&ni,0); noscale = 0; nmbits = chbits; } getnm(p,min) int *p, min; { register i; eat(' '); if(skip())return; i = atoi(); if(nonumb)return; *p = max(i,min); } casenn(){ noscale++; skip(); nn = max(atoi(),1); noscale = 0; } caseab(){ dummy(); casetm(1); done2(0); } = lss; lss = sv; newline(0); lss = savlss; sv = 0; } } casenm(){ register i; lnmod = nn = 0; if(skip())return; lnmod++; noscale++; i = inumb(&v.ln); if(!nonumb)v.ln = max(i,0); getnm(&ndf,1); getnm(&nms,0); getnm(&ni,0); noscale = 0; nmbits = chbits; } getnm(p,min) int *p, min; { register i; eat(' '); if(skip())return; i = atoi(); if(nonumb)return; *p = max(i,min); } casenn(){ noscale++; skip(); nn = max(atoi(),1); noscacmd/troff/n6.c 644 0 33 10377 2347776255 6456 ((#include "tdef.h" extern #include "d.h" extern #include "v.h" #ifdef NROFF extern #include "tw.h" #endif /* troff6.c width functions, sizes and fonts */ extern int inchar[LNSIZE], *pinchar; /* XXX */ extern int eschar; extern int widthp; extern int ohc; extern int xfont; extern int smnt; extern int setwdf; extern char trtab[]; extern int chbits; extern int nonumb; extern int noscale; extern int font; extern int font1; extern int pts; extern int sps; extern int nlflg; extern int nform; extern int dfact; extern int dfactd; extern int lss; extern int lss1; extern int vflag; extern int ch0; extern int level; extern int ch; extern int res; extern int xxx; int fontlab[] = {'R','I','B','S',0}; width(c) int c; { register i,j,k; j = c; k = 0; if(j & MOT){ if(j & VMOT)goto rtn; k = j & ~MOTV; if(j & NMOT)k = -k; goto rtn; } if((i = (j & CMASK)) == 010){ k = -widthp; goto rtn; } if(i == PRESC)i = eschar; if((i == ohc) || (i >= 0370))goto rtn; if(j & ZBIT)goto rtn; i = trtab[i] & BMASK; if(i < 040)goto rtn; k = (*(t.codetab[i-32]) & 0177) * t.Char; widthp = k; rtn: return(k); } setch(){ register i,*j,k; extern int chtab[]; if((i = getrq()) == 0)return(0); for(j=chtab;*j != i;j++)if(*(j++) == 0)return(0); k = *(++j) | chbits; return(k); } find(i,j) int i,j[]; { register k; if(((k = i-'0') >= 1) && (k <= 4) && (k != smnt))return(--k); for(k=0; j[k] != i; k++)if(j[k] == 0)return(-1); return(k); } mchbits(){ chbits = (((pts)<<2) | font) << (BYTE + 1); sps = width(' ' | chbits); } setps(){ register i,j; if((((i=getch() & CMASK) == '+') || (i == '-')) && (((j=(ch = getch() & CMASK) - '0') >= 0) && (j <= 9))){ ch = 0; return; } if((i -= '0') == 0){ return; } if((i > 0) && (i <= 9)){ if((i <= 3) && ((j=(ch = getch() & CMASK) - '0') >= 0) && (j <= 9)){ i = 10*i +j; ch = 0; } } } caseft(){ skip(); setfont(1); } setfont(a) int a; { register i,j; if(a)i = getrq(); else i = getsn(); if(!i || (i == 'P')){ j = font1; goto s0; } if(i == 'S')return; if((j = find(i,fontlab)) == -1)return; s0: font1 = font; font = j; mchbits(); } setwd(){ register i, base, wid; int delim, em, k; int savlevel, savhp, savfont, savfont1; int *savpinchar, *p, *q, tempinchar[LNSIZE]; /* XXX */ base = v.st = v.sb = wid = v.ct = 0; if((delim = getch() & CMASK) & MOT)return; savhp = v.hp; savpinchar = pinchar; /* XXX */ for (p=inchar, q=tempinchar; p < pinchar; ) /* XXX */ *q++ = *p++; /* XXX */ pinchar = inchar; /* XXX */ savlevel = level; v.hp = level = 0; savfont = font; savfont1 = font1; setwdf++; while((((i = getch()) & CMASK) != delim) && !nlflg){ wid += width(i); if(!(i & MOT)){ em = 2*t.Halfline; }else if(i & VMOT){ k = i & ~MOTV; if(i & NMOT)k = -k; base -= k; em = 0; }else continue; if(base < v.sb)v.sb = base; if((k=base + em) > v.st)v.st = k; } nform = 0; setn1(wid); v.hp = savhp; pinchar = savpinchar; /* XXX */ for (p=inchar, q=tempinchar; p < pinchar; ) /* XXX */ *p++ = *q++; /* XXX */ level = savlevel; font = savfont; font1 = savfont1; mchbits(); setwdf = 0; } vmot(){ dfact = lss; vflag++; return(mot()); } hmot(){ dfact = EM; return(mot()); } mot(){ register i, j; j = HOR; getch(); /*eat delim*/ if(i = atoi()){ if(vflag)j = VERT; i = makem(quant(i,j)); } getch(); vflag = 0; dfact = 1; return(i); } sethl(k) int k; { register i; i = t.Halfline; if(k == 'u')i = -i; else if(k == 'r')i = -2*i; vflag++; i = makem(i); vflag = 0; return(i); } makem(i) int i; { register j; if((j = i) < 0)j = -j; j = (j & ~MOTV) | MOT; if(i < 0)j |= NMOT; if(vflag)j |= VMOT; return(j); } casefp(){ register i, j; skip(); if(((i = (getch() & CMASK) - '0' -1) < 0) || (i >3))return; if(skip() || !(j = getrq()))return; fontlab[i] = j; } casevs(){ register i; skip(); vflag++; dfact = INCH; /*default scaling is points!*/ dfactd = 72; res = VERT; i = inumb(&lss); if(nonumb)i = lss1; if(i < VERT)i = VERT; lss1 = lss; lss = i; } xlss(){ register i, j; getch(); dfact = lss; i = quant(atoi(),VERT); dfact = 1; getch(); if((j = i) < 0)j = -j; ch0 = ((j & 03700)<<3) | HX; if(i < 0)ch0 |= 040000; return(((j & 077)<<9) | LX); } casefz(){} caseps(){} caselg(){} casecs(){} casebd(){} casess(){} getlg(i) int i; { return(i); } ; } casevs(){ register i; skip(); vflag++; dfact = INCH; /*default scaling is points!*/ dfactd = 72; res = VERT; i = inumb(&lss); if(nonumb)i = lss1; if(i < VERT)i = VERT; lss1 = lss; lss = i; } xlss(){ register i, j; getch(); dfact = lss; cmd/troff/n7.c 644 0 33 26166 2347774254 6457 #include "tdef.h" extern #include "d.h" extern #include "v.h" #ifdef NROFF extern #include "tw.h" #endif #include "s.h" #ifdef NROFF #define GETCH gettch #endif #ifndef NROFF #define GETCH getch #endif /* troff7.c text */ extern struct s *frame, *stk; extern struct s *ejl; extern int pl; extern int trap; extern int flss; extern int npnflg; extern int npn; extern int stop; extern int nflush; extern int ejf; extern int ascii; extern int donef; extern int nc; extern int wch; extern int dpn; extern int ndone; extern int lss; extern int pto; extern int pfrom; extern int print; extern int nlist[NTRAP]; extern int mlist[NTRAP]; extern int *pnp; extern int nb; extern int ic; extern int icf; extern int ics; extern int ne; extern int ll; extern int un; extern int un1; extern int in; extern int ls; extern int spread; extern int totout; extern int nwd; extern int *pendw; extern int *linep; extern int line[]; extern int lastl; extern int ch; extern int ce; extern int fi; extern int nlflg; extern int pendt; extern int sps; extern int adsp; extern int pendnf; extern int over; extern int adrem; extern int nel; extern int ad; extern int ohc; extern int hyoff; extern int nhyp; extern int spflg; extern int word[]; extern int *wordp; extern int wne; extern int chbits; extern int cwidth; extern int widthp; extern int hyf; extern int xbitf; extern int vflag; extern int ul; extern int cu; extern int font; extern int sfont; extern int it; extern int itmac; extern int *hyptr[NHYP]; extern int **hyp; extern int *wdstart, *wdend; extern int lnmod; extern int admod; extern int nn; extern int nms; extern int ndf; extern int ni; extern int nform; extern int lnsize; extern int po; extern int ulbit; extern int *vlist; extern int nrbits; extern int nmbits; extern char trtab[]; extern int xxx; int brflg; tbreak(){ register *i, j, pad; int res; trap = 0; if(nb)return; if((dip == d) && (v.nl == -1)){ newline(1); return; } if(!nc){ setnel(); if(!wch)return; if(pendw)getword(1); movword(); }else if(pendw && !brflg){ getword(1); movword(); } *linep = dip->nls = 0; #ifdef NROFF if(dip == d)horiz(po); #endif if(lnmod)donum(); lastl = ne; if(brflg != 1){ totout = 0; }else if(ad){ if((lastl = (ll - un)) < ne)lastl = ne; } if(admod && ad && (brflg != 2)){ lastl = ne; adsp = adrem = 0; #ifdef NROFF if(admod == 1)un += quant(nel/2,t.Adj); #endif #ifndef NROFF if(admod == 1)un += nel/2; #endif else if(admod ==2)un += nel; } totout++; brflg = 0; if((lastl+un) > dip->maxl)dip->maxl = (lastl+un); horiz(un); #ifdef NROFF if(adrem%t.Adj)res = t.Hor; else res = t.Adj; #endif for(i = line;nc > 0;){ if(((j = *i++) & CMASK) == ' '){ pad = 0; do{ pad += width(j); nc--; }while(((j = *i++) & CMASK) == ' '); i--; pad += adsp; --nwd; if(adrem){ if(adrem < 0){ #ifdef NROFF pad -= res; adrem += res; }else if((totout&01) || ((adrem/res)>=(nwd))){ pad += res; adrem -= res; #endif #ifndef NROFF pad--; adrem++; }else{ pad++; adrem--; #endif } } horiz(pad); }else{ pchar(j); nc--; } } if(ic){ if((j = ll - un - lastl + ics) > 0)horiz(j); pchar(ic); } if(icf)icf++; else ic = 0; ne = nwd = 0; un = in; setnel(); newline(0); if(dip != d){if(dip->dnl > dip->hnl)dip->hnl = dip->dnl;} else{if(v.nl > dip->hnl)dip->hnl = v.nl;} for(j=ls-1; (j >0) && !trap; j--)newline(0); spread = 0; } donum(){ register i, nw; extern pchar(); nrbits = nmbits; nw = width('1' | nrbits); if(nn){ nn--; goto d1; } if(v.ln%ndf){ v.ln++; d1: un += nw*(3+nms+ni); return; } i = 0; if(v.ln<100)i++; if(v.ln<10)i++; horiz(nw*(ni+i)); nform = 0; fnumb(v.ln,pchar); un += nw*nms; v.ln++; } text(){ register i; static int spcnt; nflush++; if((dip == d) && (v.nl == -1)){newline(1); return;} setnel(); if(ce || !fi){ nofill(); return; } if(pendw)goto t4; if(pendt)if(spcnt)goto t2; else goto t3; pendt++; if(spcnt)goto t2; while(((i = GETCH()) & CMASK) == ' ')spcnt++; if(nlflg){ t1: nflush = pendt = ch = spcnt = 0; callsp(); return; } ch = i; if(spcnt){ t2: tbreak(); if(nc || wch)goto rtn; un += spcnt*sps; spcnt = 0; setnel(); if(trap)goto rtn; if(nlflg)goto t1; } t3: if(spread)goto t5; if(pendw || !wch) t4: if(getword(0))goto t6; if(!movword())goto t3; t5: if(nlflg)pendt = 0; adsp = adrem = 0; if(ad){ /* jfr */ if (nwd==1) adsp=nel; else adsp=nel/(nwd-1); #ifdef NROFF adsp = (adsp/t.Adj)*t.Adj; #endif adrem = nel - adsp*(nwd-1); } brflg = 1; tbreak(); spread = 0; if(!trap)goto t3; if(!nlflg)goto rtn; t6: pendt = 0; ckul(); rtn: nflush = 0; } nofill(){ register i, j; if(!pendnf){ over = 0; tbreak(); if(trap)goto rtn; if(nlflg){ ch = nflush = 0; callsp(); return; } adsp = adrem = 0; nwd = 10000; } while((j = ((i = GETCH()) & CMASK)) != '\n'){ if(j == ohc)continue; if(j == CONT){ pendnf++; nflush = 0; flushi(); ckul(); return; } storeline(i,-1); } if(ce){ ce--; if((i=quant(nel/2,HOR)) > 0)un += i; } if(!nc)((storeline(FILLER,0); brflg = 2; tbreak(); ckul(); rtn: pendnf = nflush = 0; } callsp(){ register i; if(flss)i = flss; else i = lss; flss = 0; casesp(i); } ckul(){ if(ul && (--ul == 0)){ cu = 0; font = sfont; mchbits(); } if(it && (--it == 0) && itmac)control(itmac,0); } storeline(c,w){ register i; if((c & CMASK) == JREG){ if((i=findr(c>>BYTE)) != -1)vlist[i] = ne; return; } if(linep >= (line + lnsize - 1)){ if(!over){ prstrfl("Line overflow.\n"); over++; c = 0343; w = -1; goto s1; } return; } s1: if(w == -1)w = width(c); ne += w; nel -= w; /* * if( cu && !(c & MOT) && (trtab[(c & CMASK)] == ' ')) * c = ((c & ~ulbit) & ~CMASK) | '_'; */ *linep++ = c; nc++; } newline(a) int a; { register i, j, nlss; int opn; if(a)goto nl1; if(dip != d){ j = lss; pchar1(FLSS); if(flss)lss = flss; i = lss + dip->blss; dip->dnl += i; pchar1(i); pchar1('\n'); lss = j; dip->blss = flss = 0; if(dip->alss){ pchar1(FLSS); pchar1(dip->alss); pchar1('\n'); dip->dnl += dip->alss; dip->alss = 0; } if(dip->ditrap && !dip->ditf && (dip->dnl >= dip->ditrap) && dip->dimac) if(control(dip->dimac,0)){trap++; dip->ditf++;} return; } j = lss; if(flss)lss = flss; nlss = dip->alss + dip->blss + lss; v.nl += nlss; #ifndef NROFF if(ascii){dip->alss = dip->blss = 0;} #endif pchar1('\n'); flss = 0; lss = j; if(v.nl < pl)goto nl2; nl1: ejf = dip->hnl = v.nl = 0; ejl = frame; if(donef){ if((!nc && !wch) || ndone)done1(0); ndone++; donef = 0; if(frame == stk)nflush++; } opn = v.pn; v.pn++; if(npnflg){ v.pn = npn; npn = npnflg = 0; } nlpn: if(v.pn == pfrom){ print++; pfrom = -1; }else if(opn == pto){ print = 0; opn = -1; chkpn(); goto nlpn; } if(stop && print){ dpn++; if(dpn >= stop){ dpn = 0; dostop(); } } nl2: trap = 0; if(v.nl == 0){ if((j = findn(0)) != NTRAP) trap = control(mlist[j],0); } else if((i = findt(v.nl-nlss)) <= nlss){ if((j = findn1(v.nl-nlss+i)) == NTRAP){ prstrfl("Trap botch.\n"); done2(-5); } trap = control(mlist[j],0); } } findn1(a) int a; { register i, j; for(i=0; idimac && ((i = dip->ditrap -a) > 0))k = i; return(k); } for(i=0; i i)k = i; return(k); } findt1(){ register i; if(dip != d)i = dip->dnl; else i = v.nl; return(findt(i)); } eject(a) struct s *a; { register savlss; if(dip != d)return; ejf++; if(a)ejl = a; else ejl = frame; if(trap)return; e1: savlss = lss; lss = findt(v.nl); newline(0); lss = savlss; if(v.nl && !trap)goto e1; } movword(){ register i, w, *wp; int savwch, hys; over = 0; wp = wordp; if(!nwd){ while(((i = *wp++) & CMASK) == ' '){ wch--; wne -= width(i); } wp--; } if((wne > nel) && !hyoff && hyf && (!nwd || (nel > 3*sps)) && (!(hyf & 02) || (findt1() > lss)) )hyphen(wp); savwch = wch; hyp = hyptr; nhyp = 0; while(*hyp && (*hyp <= wp))hyp++; while(wch){ if((hyoff != 1) && (*hyp == wp)){ hyp++; if(!wdstart || ((wp > (wdstart+1)) && (wp < wdend) && (!(hyf & 04) || (wp < (wdend-1))) && (!(hyf & 010) || (wp > (wdstart+2))) ) ){ nhyp++; storeline(IMP,0); } } i = *wp++; w = width(i); wne -= w; wch--; storeline(i,w); } if(nel >= 0){ nwd++; return(0); } xbitf = 1; hys = width(0200); /*hyphen*/ m1: if(!nhyp){ if(!nwd)goto m3; if(wch == savwch)goto m4; } if(*--linep != IMP)goto m5; if(!(--nhyp)) if(!nwd)goto m2; if(nel < hys){ nc--; goto m1; } m2: if(((i = *(linep-1) & CMASK) != '-') && (i != 0203) ){ *linep = (*(linep-1) & ~CMASK) | 0200; w = width(*linep); nel -= w; ne += w; linep++; /* hsend(); */ } m3: nwd++; m4: wordp = wp; return(1); m5: nc--; w = width(*linep); ne -= w; nel += w; wne += w; wch++; wp--; goto m1; } horiz(i) int i; { vflag = 0; if(i)pchar(makem(i)); } setnel(){ if(!nc){ linep = line; if(un1 >= 0){ un = un1; un1 = -1; } nel = ll - un; ne = adsp = adrem = 0; } } getword(x) int x; { register i, j, swp; int noword; noword = 0; if(x)if(pendw){ *pendw = 0; goto rtn; } if(wordp = pendw)goto g1; hyp = hyptr; wordp = word; over = wne = wch = 0; hyoff = 0; while(1){ j = (i = GETCH()) & CMASK; if(j == '\n'){ wne = wch = 0; noword = 1; goto rtn; } if(j == ohc){ hyoff = 1; continue; } if(j == ' '){ storeword(i,width(i)); /* XXX */ continue; } break; } swp = widthp; storeword(' ' | chbits, -1); if(spflg){ storeword(' ' | chbits, -1); spflg = 0; } widthp = swp; g0: if(j == CONT){ pendw = wordp; nflush = 0; flushi(); return(1); } if(hyoff != 1){ if(j == ohc){ hyoff = 2; *hyp++ = wordp; if(hyp > (hyptr+NHYP-1))hyp = hyptr+NHYP-1; goto g1; } if((j == '-') || (j == 0203) /*3/4 Em dash*/ )if(wordp > word+1){ hyoff = 2; *hyp++ = wordp + 1; if(hyp > (hyptr+NHYP-1))hyp = hyptr+NHYP-1; } } storeword(i,width(i)); /* XXX */ g1: j = (i = GETCH()) & CMASK; if(j != ' '){ if(j != '\n')goto g0; j = *(wordp-1) & CMASK; if((j == '.') || (j == '!') || (j == '?'))spflg++; } *wordp = 0; rtn: wdstart = 0; wordp = word; pendw = 0; *hyp++ = 0; setnel(); return(noword); } storeword(c,w) int c, w; { if(wordp >= &word[WDSIZE - 1]){ if(!over){ prstrfl("Word overflow.\n"); over++; c = 0343; w = -1; goto s1; } return; } s1: if(w == -1)w = width(c); wne += w; *wordp++ = c; wch++; } #ifdef NROFF extern char trtab[]; gettch(){ register int i, j; if(!((i = getch()) & MOT) && (i & ulbit)){ j = i&CMASK; if(cu && (trtab[j] == ' ')) i = ((i & ~ulbit)& ~CMASK) | '_'; if(!cu && (j>32) && (j<0370) && !(*t.codetab[j-32] & 0200)) i &= ~ulbit; } return(i); } #endif nt c, w; { if(wordp >= &word[WDSIZE - 1]){ if(!over){ prstrfl("Word overflow.\n"); over++; c = 0343; w = -1; goto s1; } return; } s1: if(w == -1)w = width(c); wne += w; *wordp++ = c; wch++; } #ifdef NROFF extern char trtab[]; gettch(){ register int i, j; if(!((i = getch()) & MOT) && (i & ulbit)){ j = i&CMASK; if(cu && (trtab[j] == ' ')) i = ((i & ~ulbit)&cmd/troff/n8.c 644 0 33 7757 2346517346 6441 #include "tdef.h" /* troff8.c hyphenation */ char hbuf[NHEX]; char *nexth = hbuf; int *hyend; extern int *wdstart, *wdend; extern int *hyptr[]; extern int **hyp; extern int hyoff; extern int noscale; extern int xxx; #define THRESH 160 /*digram goodness threshold*/ int thresh = THRESH; hyphen(wp) int *wp; { register *i, j; i = wp; while(punct(*i++)) ; if (!alph(*--i)) return; wdstart = i++; while(alph(*i++)) ; hyend = wdend = --i-1; while(punct(*i++)) ; if (*--i) return; if ((wdend-wdstart-4) < 0) return; hyp = hyptr; *hyp = 0; hyoff = 2; if (!exword() && !suffix()) digram(); *hyp++ = 0; if (*hyptr) for(j = 1; j;) { j = 0; for(hyp = hyptr+1; *hyp != 0; hyp++) { if (*(hyp-1) > *hyp) { j++; i = *hyp; *hyp = *(hyp-1); *(hyp-1) = i; } } } } punct(i) int i; { if (!i || alph(i)) return(0); else return(1); } alph(i) int i; { register j; j = i & CMASK; if (((j >= 'A') && (j <= 'Z')) || ((j >= 'a') && (j <= 'z'))) return(1); else return(0); } caseht() { thresh = THRESH; if (skip()) return; noscale++; thresh = atoi(); noscale = 0; } casehw() { register i, k; register char *j; k = 0; while(!skip()) { if ((j = nexth) >= (hbuf + NHEX - 2)) goto full; for (;;) { if ((i = getch()) & MOT) continue; if (((i &= CMASK) == ' ') || (i == '\n')) { *j++ = 0; nexth = j; *j = 0; if (i == ' ') break; else return; } if (i == '-') { k = 0200; continue; } *j++ = maplow(i) | k; k = 0; if (j >= (hbuf + NHEX - 2)) goto full; } } return; full: prstr("Exception word list full.\n"); *nexth = 0; } exword() { register int *w; register char *e; char *save; e = hbuf; while(1) { save = e; if (*e == 0)return(0); w = wdstart; while((*e && (w <= hyend)) && ((*e & 0177) == maplow(*w & CMASK))) {e++; w++;}; if (!*e) { if (((w-1) == hyend) || ((w == wdend) && (maplow(*w & CMASK) == 's'))) { w = wdstart; for(e = save; *e; e++) { if (*e & 0200)*hyp++ = w; if (hyp > (hyptr+NHYP-1)) hyp = hyptr+NHYP-1; w++; } return(1); }else{e++; continue;} }else while(*e++); } } suffix() { register int *w; register char *s, *s0; int i; extern char *suftab[]; extern int *chkvow(); again: if (!alph(i = *hyend & CMASK)) return(0); if (i < 'a') i -= 'A'-'a'; if ((s0 = suftab[i-'a']) == 0) return(0); for (;;) { if ((i = *s0 & 017) == 0) return(0); s = s0 + i - 1; w = hyend - 1; while(((s > s0) && (w >= wdstart)) && ((*s & 0177) == maplow(*w))) { s--; w--; } if (s == s0) break; s0 += i; } s = s0 + i - 1; w = hyend; if (*s0 & 0200) goto mark; while(s > s0) { w--; if (*s-- & 0200) { mark: hyend = w - 1; if (*s0 & 0100) continue; if (!chkvow(w)) return(0); *hyp++ = w; } } if (*s0 & 040) return(0); if (exword()) return(1); goto again; } maplow(i) int i; { if ((i &= CMASK) < 'a')i += 'a' - 'A'; return(i); } vowel(i) int i; { switch(maplow(i)) { case(( 'a': case 'e': case 'i': case 'o': case 'u': case 'y': return(1); default: return(0); } } int *chkvow(w) int *w; { while(--w >= wdstart)if(vowel(*w & CMASK))return(w); return(0); } digram() { register *w, val; int *nhyend, *maxw, maxval; extern char bxh[26][13], bxxh[26][13], xxh[26][13], xhx[26][13], hxx[26][13]; again: if (!(w=chkvow(hyend+1)))return; hyend = w; if (!(w=chkvow(hyend)))return; nhyend = w; maxval = 0; w--; while((++w < hyend) && (w < (wdend-1))) { val = 1; if (w == wdstart)val *= dilook('a',*w,bxh); else if(w == wdstart+1)val *= dilook(*(w-1),*w,bxxh); else val *= dilook(*(w-1),*w,xxh); val *= dilook(*w, *(w+1), xhx); val *= dilook(*(w+1), *(w+2), hxx); if (val > maxval) { maxval = val; maxw = w + 1; } } hyend = nhyend; if (maxval > thresh)*hyp++ = maxw; goto again; } dilook(a,b,t) int a, b; char t[26][13]; { register i, j; i = t[maplow(a)-'a'][(j = maplow(b)-'a')/2]; if (!(j & 01))i >>= 4; return(i & 017); } d-1))) { val = cmd/troff/n9.c 644 0 33 12701 2347773112 6437 #include "tdef.h" extern #include "d.h" extern #include "v.h" #ifdef NROFF extern #include "tw.h" #endif /* troff9.c misc functions */ extern int cbuf[]; extern int *cp; extern int ch; extern int chbits; extern int dfact; extern int vflag; extern int pts; extern int fc; extern int padc; extern int tabtab[]; extern int nlflg; extern int lss; extern int tabch, ldrch; extern int tabc, dotc; extern int nchar, rchar; extern int xxx; setz(){ register i; if(!((i = getch()) & MOT))i |= ZBIT; return(i); } setline(){ register *i, length, c; int w, cnt, delim, rem, temp; if((delim = getch()) & MOT)return; else delim &= CMASK; vflag = 0; dfact = EM; length = quant(atoi(),HOR); dfact = 1; if(!length){ eat(delim); return; } s0: if(((c = getch()) & CMASK) == delim){ ch = c; c = 0204 | chbits; }else if((c & CMASK) == FILLER)goto s0; w = width(c); i = cbuf; if(length < 0){ *i++ = makem(length); length = -length; } if(!(cnt = length/w)){ *i++ = makem(-(temp = ((w-length)/2))); *i++ = c; *i++ = makem(-(w - length - temp)); goto s1; } if(rem = length%w){ switch(c & CMASK){ case 0204: /*rule*/ case 0224: /*underrule*/ case 0276: /*root en*/ *i++ = c | ZBIT; default: *i++ = makem(rem); } } if(cnt){ *i++ = RPT; *i++ = cnt; *i++ = c; } s1: *i++ = 0; eat(delim); cp = cbuf; } eat(c) int c; { register i; while(((i = getch() & CMASK) != c) && (i != '\n')); return(i); } setov(){ register i, j, k; int *p, delim, o[NOV], w[NOV]; if((delim = getch()) & MOT)return; else delim &= CMASK; for(k=0; (k 0 )break; } type = tabtab[j] & (~TMASK); fp = fbuf; pp = padptr; if(x == savfc){while(1){ if(((j = (i = getch()) & CMASK)) == padc){ npad++; *pp++ = fp; if(pp > (padptr + NPP - 1))break; goto s1; }else if(j == savfc) break; else if(j == '\n'){ temp = j; nlflg = 0; break; } ws += width(i); s1: *fp++ = i; if(fp > (fbuf + FBUFSZ -3))break; } if(!npad){ npad++; *pp++ = fp; *fp++ = 0; } *fp++ = temp; *fp++ = 0; temp = i = (j = length-ws)/npad; i = (i/HOR)*HOR; if((j -= i*npad) <0)j = -j; i = makem(i); if(temp <0)i |= NMOT; for(;npad > 0; npad--){ *(*--pp) = i; if(j){ j -= HOR; (*(*pp)) += HOR; } } cp = fbuf; j = 0; }else if(type == 0){ /*plain tab or leader*/ if((j = width(rchar)) == 0)nchar = 0; else{ nchar = length /j; length %= j; } if(length)j = length | MOT; else j = getch0(); }else{ /*center tab*/ /*right tab*/ while(((j = (i = getch()) & CMASK) != savtc) && (j != '\n') && (j != savlc)){ ws += width(i); *fp++ = i; if(fp > (fbuf +FBUFSZ - 3)) break; } *fp++ = i; *fp++ = 0; if(type == RTAB)length -= ws; else length -= ws/2; /*CTAB*/ if(((j = width(rchar)) == 0) || (length <= 0))nchar = 0; else{ nchar = length/j; length %= j; } length = (length/HOR)*HOR; j = makem(length); cp = fbuf; nlflg = 0; } rtn: fc = savfc; tabch = savtc; ldrch = savlc; return(j); } /*right tab*/ while(((j = (i = getch()) & CMASK) != savtc) &cmd/troff/ni.c 644 0 33 12172 2347775602 6527 #include "tdef.h" char obuf[OBUFSZ]; char *obufp = obuf; int r[NN] = { PAIR('%',0), PAIR('n','l'), PAIR('y','r'), PAIR('h','p'), PAIR('c','t'), PAIR('d','n'), PAIR('m','o'), PAIR('d','y'), PAIR('d','w'), PAIR('l','n'), PAIR('d','l'), PAIR('s','t'), PAIR('s','b'), PAIR('c','.')}; int pto = 10000; int pfrom = 1; int print = 1; char nextf[NS] = "/usr/lib/tmac/tmac.xxxxx"; int nfi = 19; #ifdef NROFF char termtab[NS] = "/usr/lib/term/tab37"; int tti = 17; #endif #ifndef NROFF int oldbits = -1; #endif int init = 1; int fc = IMP; int eschar = '\\'; int pl = 11*INCH; int po = PO; int dfact = 1; int dfactd = 1; int res = 1; int smnt = 4; int ascii = ASCII; int ptid = PTID; char ptname[] = "/dev/cat"; int lg = LG; int pnlist[NPN] = {-1}; int *pnp = pnlist; int npn = 1; int npnflg = 1; int xflg = 1; int dpn = -1; int totout = 1; int ulfont = 1; int ulbit = 1<<9; int tabch = TAB; int ldrch = LEADER; int xxx; extern caseds(), caseas(), casesp(), caseft(), caseps(), casevs(), casenr(), caseif(), casepo(), casetl(), casetm(), casebp(), casech(), casepn(), tbreak(), caseti(), casene(), casenf(), casece(), casefi(), casein(), caseli(), casell(), casens(), casemk(), casert(), caseam(), casede(), casedi(), caseda(), casewh(), casedt(), caseit(), caserm(), casern(), casead(), casers(), casena(), casepl(), caseta(), casetr(), caseul(), caselt(), casenx(), caseso(), caseig(), casetc(), casefc(), caseec(), caseeo(), caselc(), caseev(), caserd(), caseab(), casefl(), done(), casess(), casefp(), casecs(), casebd(), caselg(), casehc(), casehy(), casenh(), casenm(), casenn(), casesv(), caseos(), casels(), casecc(), casec2(), caseem(), caseaf(), casehw(), casemc(), casepm(), casecu(), casepi(), caserr(), caseuf(), caseie(), caseel(), casepc(), caseht(); #ifndef NROFF extern casefz(); #endif extern casecf(); struct contab { int rq; /* union { */ int (*f)(); /* unsigned mx; }x; */ }contab[NM]= { PAIR('d','s'),caseds, PAIR('a','s'),caseas, PAIR('s','p'),casesp, PAIR('f','t'),caseft, PAIR('p','s'),caseps, PAIR('v','s'),casevs, PAIR('n','r'),casenr, PAIR('i','f'),caseif, PAIR('i','e'),caseie, PAIR('e','l'),caseel, PAIR('p','o'),casepo, PAIR('t','l'),casetl, PAIR('t','m'),casetm, PAIR('b','p'),casebp, PAIR('c','h'),casech, PAIR('p','n'),casepn, PAIR('b','r'),tbreak, PAIR('t','i'),caseti, PAIR('n','e'),casene, PAIR('n','f'),casenf, PAIR('c','e'),casece, PAIR('f','i'),casefi, PAIR('i','n'),casein, PAIR('l','i'),caseli, PAIR('l','l'),casell, PAIR('n','s'),casens, PAIR('m','k'),casemk, PAIR('r','t'),cas((ert, PAIR('a','m'),caseam, PAIR('d','e'),casede, PAIR('d','i'),casedi, PAIR('d','a'),caseda, PAIR('w','h'),casewh, PAIR('d','t'),casedt, PAIR('i','t'),caseit, PAIR('r','m'),caserm, PAIR('r','r'),caserr, PAIR('r','n'),casern, PAIR('a','d'),casead, PAIR('r','s'),casers, PAIR('n','a'),casena, PAIR('p','l'),casepl, PAIR('t','a'),caseta, PAIR('t','r'),casetr, PAIR('u','l'),caseul, PAIR('c','u'),casecu, PAIR('l','t'),caselt, PAIR('n','x'),casenx, PAIR('s','o'),caseso, PAIR('i','g'),caseig, PAIR('t','c'),casetc, PAIR('f','c'),casefc, PAIR('e','c'),caseec, PAIR('e','o'),caseeo, PAIR('l','c'),caselc, PAIR('e','v'),caseev, PAIR('r','d'),caserd, PAIR('a','b'),caseab, PAIR('f','l'),casefl, PAIR('e','x'),done, PAIR('s','s'),casess, PAIR('f','p'),casefp, PAIR('c','s'),casecs, PAIR('b','d'),casebd, PAIR('l','g'),caselg, PAIR('h','c'),casehc, PAIR('h','y'),casehy, PAIR('n','h'),casenh, PAIR('n','m'),casenm, PAIR('n','n'),casenn, PAIR('s','v'),casesv, PAIR('o','s'),caseos, PAIR('l','s'),casels, PAIR('c','c'),casecc, PAIR('c','2'),casec2, PAIR('e','m'),caseem, PAIR('a','f'),caseaf, PAIR('h','w'),casehw, PAIR('m','c'),casemc, PAIR('p','m'),casepm, #ifdef NROFF PAIR('p','i'),casepi, #endif PAIR('u','f'),caseuf, PAIR('p','c'),casepc, PAIR('h','t'),caseht, #ifndef NROFF PAIR('f','z'),casefz, #endif PAIR('c', 'f'),casecf, }; /* troff environment block */ int block = 0; int ics = ICS; int ic = 0; int icf = 0; int chbits = 0; int spbits = 0; int nmbits = 0; int apts = PS; int apts1 = PS; int pts = PS; int pts1 = PS; int font = FT; int font1 = FT; int sps = SPS; int spacesz = SS; int lss = VS; int lss1 = VS; int ls = 1; int ls1 = 1; int ll = LL; int ll1 = LL; int lt = LL; int lt1 = LL; int ad = 1; int nms = 1; int ndf = 1; int fi = 1; int cc = '.'; int c2 = '\''; int ohc = OHC; int tdelim = IMP; int hyf = 1; int hyoff = 0; int un1 = -1; int tabc = 0; int dotc = '.'; int adsp = 0; int adrem = 0; int lastl = 0; int nel = 0; int admod = 0; int *wordp = 0; int spflg = 0; int *linep = 0; int *wdend = 0; int *wdstart = 0; int wne = 0; int ne = 0; int nc = 0; int nb = 0; int lnmod = 0; int nwd = 0; int nn = 0; int ni = 0; int ul = 0; int cu = 0; int ce = 0; int in = 0; int in1 = 0; int un = 0; int wch = 0; int pendt = 0; int *pendw = 0; int pendnf = 0; int spread = 0; int it = 0; int itmac = 0; int lnsize = LNSIZE; int *hyptr[NHYP] = {0}; int tabtab[NTAB] = {DTAB,DTAB*2,DTAB*3,DTAB*4,DTAB*5,DTAB*6,DTAB*7,DTAB*8, DTAB*9,DTAB*10,DTAB*11,DTAB*12,DTAB*13,DTAB*14,DTAB*15,0}; int line[LNSIZE] = {0}; int word[WDSIZE] = {0}; int blockxxx[EVS-68-NHYP-NTAB-WDSIZE-LNSIZE] = {0}; /*spare 5 words*/ int oline[LNSIZE+1]; = 0; int ni = 0; int ul = 0; int cu = 0; int ce = 0; int in = 0; int in1 = 0; int un = 0; int wch = 0; int pendt = 0; int *pendw = 0; int pendnf = 0; int spread = 0; int it = 0; int itmac = 0; int lnsize = LNSIZE; int *hyptr[NHYP] = {0}; int tabtab[NTAB] = {DTAB,DTAB*2,DTAB*3,DTAB*4,DTAB*5,DTAB*6,DTAB*7,DTAB*8, DTAB*9,DTAB*10,DTAB*11,DTAB*12,DTAB*13,DTAB*14,DTAB*15,0}; int line[LNSIZE] cmd/troff/nii.c 644 0 33 3027 2346517350 6650 #include "tdef.h" #ifdef NROFF #include "tw.h" #endif #include "s.h" #include "d.h" #include "v.h" #include int *vlist = (int *)&v; struct s *frame, *stk, *ejl; struct s *nxf, *litlev; #ifdef NROFF int pipeflg; int hflg; int eqflg; #endif #ifndef NROFF int xpts; int verm; int *pslp; int psflg; int ppts; int pfont; int paper; int mpts; int mfont; int mcase; int escm; int cs; int code; int ccs; int bd; int back; #endif int level; int stdi; int waitf; int nofeed; int quiet; int stop; char ibuf[IBUFSZ]; char xbuf[IBUFSZ]; char *ibufp; char *xbufp; char *eibuf; char *xeibuf; int cbuf[NC]; int *cp; int nx; int mflg; int ch = 0; int cps; int ibf; int ttyod; struct sgttyb ttys; int iflg; char *enda; int rargc; char **argp; char trtab[256]; int lgf; int copyf; int ch0; int cwidth; filep ip; int nlflg; int *ap; int donef; int nflush; int nchar; int rchar; int nfo; int ifile; int padc; int raw; int ifl[NSO]; int ifi; int flss; int nonumb; int trap; int tflg; int ejf; int lit; int gflag; int dilev; int tlss; filep offset; int em; int ds; filep woff; int app; int ndone; int lead; int ralss; filep nextb; int *argtop; int nrbits; int nform; int oldmn; int newmn; int macerr; filep apptr; int diflg; filep roff; int wbfi; int inc[NN]; int fmt[NN]; int evi; int vflag; int noscale; int po1; int nlist[NTRAP]; int mlist[NTRAP]; int evlist[EVLSZ]; int ev; int tty; int sfont; int sv; int esc; int widthp; int xfont; int setwdf; int xbitf; int over; int nhyp; int **hyp; int *olinep; int esct; int ttysave = -1; int dotT; char *unlkp; int no_out; int ds; filep woff; int app; int ndone; int lead; int ralss; filep nextb; int *argtop; int nrbits; int nform; int oldmn; int newmn; int macerr; filep apptr; int diflg; filep roff; int wbfi; int inc[NN]; int fmt[NN]; int evi; int vflag; int noscale; int po1; int nlist[NTRAP]; int mlist[NTRAP]; int evlist[EVLSZ]; int ev; int tty; int sfont; int sv; int esc; int widthp; int xfont; int setwdf; int xbitf; int over; int nhyp; int **hyp; int *olinep; int esct; int ttysave = -1; int dotT; chcmd/troff/ntab.c 644 0 33 10440 2346517350 7032 #define BYTE 8 #define PAIR(A,B) (A|(B<','='), 0277, /*>=*/ PAIR('<','='), 0300, /*<=*/ PAIR('=','='), 0301, /*identically equal*/ PAIR('~','='), 0303, /*approx =*/ PAIR('a','p'), 0304, /*approximates*/ PAIR('!','='), 0305, /*not equal*/ PAIR('-','>'), 0306, /*right arrow*/ PAIR('<','-'), 0307, /*left arrow*/ PAIR('u','a'), 0310, /*up arrow*/ PAIR('d','a'), 0311, /*down arrow*/ PAIR('e','q'), 0312, /*equation equal*/ PAIR('m','u'), 0313, /*multiply*/ PAIR('d','i'), 0314, /*divide*/ PAIR('+','-'), 0315, /*plus-minus*/ PAIR('c','u'), 0316, /*cup (union)*/ PAIR('c','a'), 0317, /*cap (intersection)*/ PAIR('s','b'), 0320, /*subset of*/ PAIR('s','p'), 0321, /*superset of*/ PAIR('i','b'), 0322, /*improper subset*/ PAIR('i','p'), 0323, /* " superset*/ PAIR('i','f'), 0324, /*infinity*/ PAIR('p','d'), 0325, /*partial derivative*/ PAIR('g','r'), 0326, /*gradient*/ PAIR('n','o'), 0327, /*not*/ PAIR('i','s'), 0330, /*integral sign*/ PAIR('p','t'), 0331, /*proportional to*/ PAIR('e','s'), 0332, /*empty set*/ PAIR('m','o'), 0333, /*member of*/ PAIR('p','l'), 0334, /*equation plus*/ PAIR('r','g'), 0335, /*registered*/ PAIR('c','o'), 0336, /*copyright*/ PAIR('b','r'), 0337, /*box vert rule*/ PAIR('c','t'), 0340, /*cent sign*/ PAIR('d','d'), 0341, /*dbl dagger*/ PAIR('r','h'), 0342, /*right hand*/ PAIR('l','h'), 0343, /*left hand*/ PAIR('*','*'), 0344, /*math * */ PAIR('b','s'), 0345, /*bell system sign*/ PAIR('o','r'), 0346, /*or*/ PAIR('c','i'), 0347, /*circle*/ PAIR('l','t'), 0350, /*left top (of big curly)*/ PAIR('l','b'), 0351, /*left bottom*/ PAIR('r','t'), 0352, /*right top*/ PAIR('r','b'), 0353, /*right bot*/ PAIR('l','k'), 0354, /*left center of big curly bracket*/ PAIR('r','k'), 0355, /*((right center of big curly bracket*/ PAIR('b','v'), 0356, /*bold vertical*/ PAIR('l','f'), 0357, /*left floor (left bot of big sq bract)*/ PAIR('r','f'), 0360, /*right floor (rb of ")*/ PAIR('l','c'), 0361, /*left ceiling (lt of ")*/ PAIR('r','c'), 0362, /*right ceiling (rt of ")*/ 0,0}; , 0350, /*left top (of big curly)*/ PAIR('l','b'), 0351, /*left bottom*/ PAIR('r','t'), 0352, /*right top*/ PAIR('r','b'), 0353, /*right bot*/ PAIR('l','k'), 0354, /*left center of big curly bracket*/ PAIR('r','k'), 0355, /*cmd/troff/s.h 644 0 33 214 2346517350 6313 struct s { int nargs; struct s *pframe; filep pip; int pnchar; int prchar; int ppendt; int *pap; int *pcp; int pch0; int pch; }; IR('r','f'), 0360, /*right floor (rb of ")*/ PAIR('l','c'), 0361, /*left ceiling (lt of ")*/ PAIR('r','c'), 0362, /*right ceiling (rt of ")*/ 0,0}; , 0350, /*left top (of big curly)*/ PAIR('l','b'), 0351, /*left bottom*/ PAIR('r','t'), 0352, /*right top*/ PAIR('r','b'), 0353, /*r/,5< /,"cmd/troff/suftab.c 644 0 33 45256 2346517352 7411 /* * Suffix table */ static char sufa[] = { 02,0200+'t', /* -TA */ 02,0200+'s', /* -SA */ 03,0200+'t','r', /* -TRA */ 03,0200+'d','r', /* -DRA */ 03,0200+'b','r', /* -BRA */ 02,0200+'p', /* -PA */ 02,0200+'n', /* -NA */ 02,0200+'m', /* -MA */ 03,0200+'p','l', /* -PLA */ 02,0200+'l', /* -LA */ 02,0200+'k', /* -KA */ 03,0200+'t','h', /* -THA */ 03,0200+'s','h', /* -SHA */ 02,0200+'g', /* -GA */ 02,0200+'d', /* -DA */ 02,0200+'c', /* -CA */ 02,0200+'b', /* -BA */ 00 }; static char sufc[] = { 04,'e','t',0200+'i', /* ET-IC */ 07,'a','l',0200+'i','s',0200+'t','i', /* AL-IS-TIC */ 04,'s',0200+'t','i', /* S-TIC */ 04,'p',0200+'t','i', /* P-TIC */ 05,0200+'l','y','t',0200+'i', /* -LYT-IC */ 04,'o','t',0200+'i', /* OT-IC */ 05,'a','n',0200+'t','i', /* AN-TIC */ 04,'n',0200+'t','i', /* N-TIC */ 04,'c',0200+'t','i', /* C-TIC */ 04,'a','t',0200+'i', /* AT-IC */ 04,'h',0200+'n','i', /* H-NIC */ 03,'n',0200+'i', /* N-IC */ 03,'m',0200+'i', /* M-IC */ 04,'l',0200+'l','i', /* L-LIC */ 04,'b',0200+'l','i', /* B-LIC */ 04,0200+'c','l','i', /* -CLIC */ 03,'l',0200+'i', /* L-IC */ 03,'h',0200+'i', /* H-IC */ 03,'f',0200+'i', /* F-IC */ 03,'d',0200+'i', /* D-IC */ 03,0200+'b','i', /* -BIC */ 03,'a',0200+'i', /* A-IC */ 03,0200+'m','a', /* -MAC */ 03,'i',0200+'a', /* I-AC */ 00 }; static char sufd[] = { 04,0200+'w','o','r', /* -WORD */ 04,0200+'l','o','r', /* -LORD */ 04,0200+'f','o','r', /* -FORD */ 04,0200+'y','a','r', /* -YARD */ 04,0200+'w','a','r', /* -WARD */ 05,0200+'g','u','a','r', /* -GUARD */ 04,0200+'t','a','r', /* -TARD */ 05,0200+'b','o','a','r', /* -BOARD */ 04,0200+'n','a','r', /* -NARD */ 05,0200+'l','i','a','r', /* -LIARD */ 04,0200+'i','a','r', /* -IARD */ 04,0200+'g','a','r', /* -GARD */ 04,0200+'b','a','r', /* -BARD */ 03,0200+'r','o', /* -ROD */ 04,0200+'w','o','o', /* -WOOD */ 04,0200+'h','o','o', /* -HOOD */ 04,0200+'m','o','n', /* -MOND */ 04,0200+'t','e','n', /* -TEND */ 05,0200+'s','t','a','n', /* -STAND */ 04,0200+'l','a','n', /* -LAND */ 04,0200+'h','a','n', /* -HAND */ 04,0200+'h','o','l', /* -HOLD */ 04,0200+'f','o','l', /* -FOLD */ 05,0200+'f','i','e','l', /* -FIELD */ 03,0200+'v','i', /* -VID */ 03,0200+'c','i', /* -CID */ 04,0200+'s','a','i', /* -SAID */ 04,0200+'m','a','i', /* -MAID */ 04,'t',0200+'t','e', /* T-TED */ 03,'t',0200+'e', /* T-ED */ 04,0200+'d','r','e', /* -DRED */ 04,0200+'c','r','e', /* -CRED */ 04,0200+'b','r','e', /* -BRED */ 05,'v',0200+'e','l','e', /* V-ELED */ 0100+04,'a','l',0200+'e', /* AL/ED */ 0140+03,0200+'e','e', /* /EED */ 040+05,'e','d',0200+'d','e', /* ED-DED */ 04,'d',0200+'d','e', /* D-DED */ 040+04,'e','d',0200+'e', /* ED-ED */ 03,'d',0200+'e', /* D-ED */ 05,0200+'d','u','c','e', /* -DUCED */ 0300+02,'e', /* E/D */ 05,0200+'s','t','e','a', /* -STEAD */ 04,0200+'h','e','a', /* -HEAD */ 00 }; static char sufe[] = { 05,'a','r',0200+'i','z', /* AR-IZE */ 05,'a','n',0200+'i','z', /* AN-IZE */ 05,'a','l',0200+'i','z', /* AL-IZE */ 06,0200+'a','r','d',0200+'i','z', /* -ARD-IZE */ 05,0200+'s','e','l','v', /* -SELVE */ 05,0200+'k','n','i','v', /* -KNIVE */ 05,0200+'l','i','e','v', /* -LIEVE */ 0100+03,0200+'q','u', /* /QUE */ 07,'o','n',0200+'t','i','n',0200+'u', /* ON-TIN-UE */ 03,0200+'n','u', /* -NUE */ 03,0200+'d','u', /* -DUE */ 0300+02,'u', /* U/E */ 0300+05,'q','u','a','t', /* QUAT/E */ 04,'u',0200+'a','t', /* U-ATE */ 05,0200+'s','t','a','t', /* -STATE */ 04,0200+'t','a','t', /* -TATE */ 06,0200+'t','o','r',0200+'a','t', /* -TOR-ATE */ 05,'e','n',0200+'a','t', /* EN-ATE */ 04,0200+'m','a','t', /* -MATE */ 05,0200+'h','o','u','s', /* -HOUSE */ 05,0200+'c','l','o','s', /* -CLOSE */ 04,'i',0200+'o','s', /* I-OSE */ 04,0200+'w','i','s', /* -WISE */ 05,'a','s',0200+'u','r', /* AS-URE */ 040+04,0200+'s','u','r', /* -SURE */ 06,0200+'f','i','g',0200+'u','r', /* -FIG-URE */ 040+03,0200+'t','r', /* -TRE */ 05,0200+'s','t','o','r', /* -STORE */ 04,0200+'f','o','r', /* -FORE */ 05,0200+'w','h','e','r', /* -WHERE */ 06,0200+'s','p','h','e','r', /* -SPHERE */ 03,0200+'d','r', /* -DRE */ 03,0200+'c','r', /* -CRE */ 03,0200+'b','r', /* -BRE */ 05,0200+'s','c','o','p', /* -SCOPE */ 04,'y',0200+'o','n', /* Y-ONE */ 05,0200+'s','t','o','n', /* -STONE */ 05,0200+'p','h','o','n', /* -PHONE */ 04,0200+'g','o','n', /* -GONE */ 04,'e',0200+'o','n', /* E-ONE */ 040+04,0200+'e','n','n', /* -ENNE */ 040+05,'a',0200+'r','i','n', /* A-RINE */ 05,0200+'c','l','i','n', /* -CLINE */ 04,0200+'l','i','n', /* -LINE */ 007,00200+'r','o','u',00200+'t','i','n', /*-ROU-TINE */ 04,0200+'s','o','m', /* -SOME */ 04,0200+'c','o','m', /* -COME */ 04,0200+'t','i','m', /* -TIME */ 03,0200+'z','l', /* -ZLE */ 03,0200+'t','l', /* -TLE */ 03,0200+'s','l', /* -SLE */ 03,0200+'p','l', /* -PLE */ 05,0200+'v','i','l','l', /* -VILLE */ 04,'c','k',0200+'l', /* CK-LE */ 03,0200+'k','l', /* -KLE */ 03,0200+'g','l', /* -GLE */ 03,0200+'f','l', /* -FLE */ 03,0200+'d','l', /* -DLE */ 03,0200+'c','l', /* -CLE */ 05,0200+'p','a',0200+'b','l', /* -PA-BLE */ 05,'f','a',0200+'b','l', /* FA-BLE */ 05,0200+'c','a',0200+'b','l', /* -CA-BLE */ 06,0200+'s','t','a','b','l', /* -STABLE */ 04,0200+'a','b','l', /* -ABLE */ 03,0200+'b','l', /* -BLE */ 04,0200+'d','a','l', /* -DALE */ 04,0200+'m','a','l', /* -MALE */ 04,0200+'s','a','l', /* -SALE */ 04,0200+'l','i','k', /* -LIKE */ 0340+05,'g',0200+'u','a','g', /* -G/UAGE */ 05,0200+'r','i','a','g', /* -RIAGE */ 05,'e','r',0200+'a','g', /* ER-AGE */ 04,'m',0200+'a','g', /* M-AGE */ 04,'k',0200+'a','g', /* K-AGE */ 04,'d',0200+'a','g', /* D-AGE */ 04,0200+'w','i','f', /* -WIFE */ 05,0200+'k','n','i','f', /* -KNYFE */ 03,0200+'s','e', /* -SEE */ 04,0200+'f','r','e', /* -FREE */ 0340+02,'e', /* EE */ 04,0200+'w','i','d', /* -WIDE */ 04,0200+'t','i','d', /* -TIDE */ 04,0200+'s','i','d', /* -SIDE */ 06,0200+'q','u','e','n','c', /* -QUENCE */ 07,0200+'f','l','u',0200+'e','n','c', /* -FLU-ENCE */ 040+06,'e','s',0200+'e','n','c', /* ES-ENCE */ 06,'e','r',0200+'e','n','c', /* ER-ENCE */ 05,'i',0200+'e','n','c', /* I-ENCE */ 040+05,0200+'s','a','n','c', /* -SANCE */ 06,'e','r',0200+'a','n','c', /* ER-ANCE */ 06,'a','r',0200+'a','n','c', /* AR-ANCE */ 05,0200+'n','a','n','c', /* -NANCE */ 07,0200+'b','a','l',0200+'a','n','c', /* -BAL-ANCE */ 05,'i',0200+'a','n','c', /* I-ANCE */ 07,0200+'j','u','s',0200+'t','i','c', /* -JUS-TICE */ 05,0200+'s','t','i','c', /* -STICE */ 05,0200+'p','i','e','c', /* -PIECE */ 05,0200+'p','l','a','c', /* -PLACE */ 0340+01, /* /E */ 00 }; static char suff[] = { 03,0200+'o','f', /* -OFF */ 05,0200+'p','r','o','o', /* -PROOF */ 04,0200+'s','e','l', /* -SELF */ 03,0200+'r','i', /* -RIF */ 040+04,0200+'l','i','e', /* -LIEF */ 00 }; static char sufg[] = { 03,0200+'l','o', /* -LOG */ 04,0200+'l','o','n', /* -LONG */ 05,'t',0200+'t','i','n', /* T-TING */ 06,0200+'s','t','r','i','n', /* -STRING */ 05,'r',0200+'r','i','n', /* R-RING */ 05,'p',0200+'p','i','n', /* P-PING */ 05,'n',0200+'n','i','n', /* N-NING */ 05,'m',0200+'m','i','n', /* M-MING */ 05,'l',0200+'l','i','n', /* L-LING */ 05,0200+'z','l','i','n', /* -ZLING */ 05,0200+'t','l','i','n', /* -TLING */ 040+05,'s',0200+'l','i','n', /* S-LING */ 05,'r',0200+'l','i','n', /* R-LING */ 05,0200+'p','l','i','n', /* -PLING */ 06,'n',0200+'k','l','i','n', /* N-KLING */ 05,'k',0200+'l','i','n', /* K-LING */ 05,0200+'g','l','i','n', /* -GLING */ 05,0200+'f','l','i','n', /* -FLING */ 05,0200+'d','l','i','n', /* -DLING */ 05,0200+'c','l','i','n', /* -CLING */ 05,0200+'b','l','i','n', /* -BLING */ 06,'y',0200+'t','h','i','n', /* Y-THING */ 07,'e','e','t','h',0200+'i','n', /* EETH-ING */ 06,'e',0200+'t','h','i','n', /* E-THING */ 05,'g',0200+'g','i','n', /* G-GING */ 05,'d',0200+'d','i','n', /* D-DING */ 05,'b',0200+'b','i','n', /* B-BING */ 03,0200+'i','n', /* -ING */ 00 }; static char sufh[] = { 05,0200+'m','o','u','t', /* -MOUTH */ 05,0200+'w','o','r','t', /* -WORTH */ 04,0200+'w','i','t', /* -WITH */ 05,'t',0200+'t','i','s', /* T-TISH */ 05,'e',0200+'t','i','s', /* E-TISH */ 05,'p',0200+'p','i','s', /* P-PISH */ 05,'r',0200+'n((','i','s', /* R-NISH */ 05,'n',0200+'n','i','s', /* N-NISH */ 05,0200+'p','l','i','s', /* -PLISH */ 05,0200+'g','u','i','s', /* -GUISH */ 05,0200+'g','l','i','s', /* -GLISH */ 05,'b',0200+'l','i','s', /* B-LISH */ 05,'g',0200+'g','i','s', /* G-GISH */ 05,'d',0200+'d','i','s', /* D-DISH */ 03,0200+'i','s', /* -ISH */ 05,0200+'g','r','a','p', /* -GRAPH */ 07,0200+'b','o','r',0200+'o','u','g', /* -BOR-OUGH */ 05,0200+'b','u','r','g', /* -BURGH */ 04,0200+'v','i','c', /* -VICH */ 03,0200+'n','a', /* -NAH */ 03,0200+'l','a', /* -LAH */ 04,0200+'m','i',0200+'a', /* -MI-AH */ 00 }; static char sufi[] = { 03,0200+'t','r', /* -TRI */ 03,0200+'c','h', /* -CHI */ 0200+03,'i','f', /* IF-I */ 0200+03,'e','d', /* ED-I */ 05,0200+'a','s','c','i', /* -ASCII */ 04,0200+'s','e','m', /* -SEMI */ 00 }; static char sufk[] = { 04,0200+'w','o','r', /* -WORK */ 04,0200+'m','a','r', /* -MARK */ 04,0200+'b','o','o', /* -BOOK */ 04,0200+'w','a','l', /* -WALK */ 05,0200+'c','r','a','c', /* -CRACK */ 04,0200+'b','a','c', /* -BACK */ 00 }; static char sufl[] = { 03,0200+'f','u', /* -FUL */ 05,'s',0200+'w','e','l', /* S-WELL */ 04,0200+'t','e','l', /* -TELL */ 05,0200+'s','h','e','l', /* -SHELL */ 05,0200+'s','t','a','l', /* -STALL */ 04,0200+'s','t','a', /* -STAL */ 04,0200+'b','a','l', /* -BALL */ 04,0200+'c','a','l', /* -CALL */ 03,'v',0200+'e', /* V-EL */ 03,'u',0200+'e', /* U-EL */ 03,'k',0200+'e', /* K-EL */ 04,'t','h',0200+'e', /* TH-EL */ 05,'t','c','h',0200+'e', /* TCH-EL */ 03,'a',0200+'e', /* A-EL */ 0140+04,0200+'q','u','a', /* /QUAL */ 040+03,'u',0200+'a', /* U-AL */ 03,0200+'t','a', /* -TAL */ 04,'u','r',0200+'a', /* UR-AL */ 040+05,'g',0200+'o',0200+'n','a', /* G-O-NAL */ 04,'o','n',0200+'a', /* ON-AL */ 03,0200+'n','a', /* -NAL */ 04,0200+'t','i','a', /* -TIAL */ 04,0200+'s','i','a', /* -SIAL */ 040+05,0200+'t','r','i',0200+'a', /* -TRI-AL */ 04,'r','i',0200+'a', /* RI-AL */ 04,0200+'n','i',0200+'a', /* -NI-AL */ 04,0200+'d','i',0200+'a', /* -DI-AL */ 04,0200+'c','i','a', /* -CIAL */ 03,0200+'g','a', /* -GAL */ 04,0200+'m','e','a', /* -MEAL */ /* 040+04,0200+'r','e',0200+'a', /* -RE-AL */ 040+04,0200+'r','e','a', /* -REAL */ 06,'c',0200+'t','i',0200+'c','a', /* C-TI-CAL */ 05,0200+'s','i',0200+'c','a', /* -SI-CAL */ 04,0200+'i',0200+'c','a', /* -I-CAL */ 03,0200+'c','a', /* -CAL */ 03,0200+'b','a', /* -BAL */ 06,0200+'n','o',0200+'m','i',0200+'a', /* -NO-MI-AL */ 00 }; static char sufm[] = { 03,0200+'n','u', /* -NUM */ 05,'o',0200+'r','i',0200+'u', /* O-RI-UM */ 040+03,'i',0200+'u', /* I-UM */ 040+03,'e',0200+'u', /* E-UM */ 05,'i','v',0200+'i','s', /* IV-ISM */ 04,0200+'t','i','s', /* -TISM */ 05,'i',0200+'m','i','s', /* I-MISM */ 05,'a','l',0200+'i','s', /* AL-ISM */ 040+04,'e',0200+'i','s', /* E-ISM */ 040+04,'a',0200+'i','s', /* A-ISM */ 04,0200+'r','o','o', /* -ROOM */ 03,0200+'d','o', /* -DOM */ 03,0200+'h','a', /* -HAM */ 06,0200+'a',0200+'r','i','t','h', /* -A-RITHM */ 05,0200+'r','i','t','h', /* -RITHM */ 00 }; static char sufn[] = { 04,0200+'t','o','w', /* -TOWN */ 04,0200+'d','o','w', /* -DOWN */ 04,0200+'t','u','r', /* -TURN */ 05,0200+'s','p','o','o', /* -SPOON */ 04,0200+'n','o','o', /* -NOON */ 04,0200+'m','o','o', /* -MOON */ 011,'a','l',0200+'i',0200+'z','a',0200+'t','i','o', /* AL-I-ZA-TION */ 07,0200+'i',0200+'z','a',0200+'t','i','o', /* -I-ZA-TION */ 07,'l',0200+'i',0200+'a',0200+'t','i','o', /* L-I-A-TION */ 04,0200+'t','i','o', /* -TION */ 040+05,'s',0200+'s','i','o', /* S-SION */ 04,0200+'s','i','o', /* -SION */ 04,'n',0200+'i','o', /* N-ION */ 04,0200+'g','i','o', /* -GION */ 04,0200+'c','i','o', /* -CION */ 03,0200+'c','o', /* -CON */ 05,0200+'c','o','l','o', /* -COLON */ 03,0200+'t','o', /* -TON */ 04,'i','s',0200+'o', /* IS-ON */ 03,0200+'s','o', /* -SON */ 03,0200+'r','i', /* -RIN */ 03,0200+'p','i', /* -PIN */ 03,0200+'n','i', /* -NIN */ 03,0200+'m','i', /* -MIN */ 03,0200+'l','i', /* -LIN */ 03,0200+'k','i', /* -KIN */ 05,0200+'s','t','e','i', /* -STEIN */ 04,0200+'t','a','i', /* -TAIN */ 05,'g','h','t',0200+'e', /* GHT-EN */ 05,0200+'w','o','m',0200+'e', /* -WOM-EN */ 03,0200+'m','e', /* -MEN */ 04,'o',0200+'k','e', /* O-KEN */ 03,'k',0200+'e', /* K-EN */ 04,0200+'t','e','e', /* -TEEN */ 04,0200+'s','e','e', /* -SEEN */ 040+03,0200+'s','a', /* -SAN */ 05,0200+'w','o','m',0200+'a', /* -WOM-AN */ 03,0200+'m','a', /* -MAN */ 04,0200+'t','i','a', /* -TIAN */ 04,0200+'s','i','a', /* -SIAN */ 040+04,'e',0200+'i','a', /* E-IAN */ 04,0200+'c','i','a', /* -CIAN */ 0300+03,'i','a', /* IA/N */ 05,0200+'c','l','e','a', /* -CLEAN */ 04,0200+'m','e','a', /* -MEAN */ 040+03,'e',0200+'a', /* E-AN */ 00 }; static char sufo[] = { 05,0200+'m','a','c',0200+'r', /* -MAC-RO */ 00 }; static char sufp[] = { 05,0200+'g','r','o','u', /* -GROUP */ 02,0200+'u', /* -UP */ 04,0200+'s','h','i', /* -SHIP */ 04,0200+'k','e','e', /* -KEEP */ 00 }; static char sufr[] = { 04,0200+'z','a','r', /* -ZARR */ 0300+02,'r', /* R/R */ 03,0200+'t','o', /* -TOR */ 040+03,0200+'s','o', /* -SOR */ 040+04,0200+'r','i',0200+'o', /* -RI-OR */ 04,'i','z',0200+'e', /* IZ-ER */ 05,0200+'c','o','v',0200+'e', /* -COV-ER */ /* 04,'o',0200+'v','e', /* O-VER */ 04,0200+'o','v','e', /* -OVER */ 04,0200+'e','v',0200+'e', /* -EV-ER */ 8,0200+'c','o','m',0200+'p','u','t',0200+'e', /* -COM-PUT-ER */ 040+05,'u','s',0200+'t','e', /* US-TER */ 05,'o','s','t',0200+'e', /* OST-ER */ 040+05,0200+'a','c',0200+'t','e', /* -AC-TER */ 06,0200+'w','r','i','t',0200+'e', /* -WRIT-ER */ 040+05,'i','s',0200+'t','e', /* IS-TER */ 040+05,'e','s',0200+'t','e', /* ES-TER */ 040+05,'a','s',0200+'t','e', /* AS-TER */ 04,0200+'s','t','e', /* -STER */ 05,'a','r',0200+'t','e', /* AR-TER */ 04,'r','t',0200+'e', /* RT-ER */ 040+05,'m',0200+'e',0200+'t','e', /* M-E-TER */ 05,0200+'w','a',0200+'t','e', /* -WA-TER */ 03,'r',0200+'e', /* R-ER */ 04,'o','p',0200+'e', /* OP-ER */ 05,0200+'p','a',0200+'p','e', /* -PA-PER */ 04,'w','n',0200+'e', /* WN-ER */ 040+04,'s',0200+'n','e', /* S-NER */ 04,'o','n',0200+'e', /* ON-ER */ 04,'r','m',0200+'e', /* RM-ER */ 03,0200+'m','e', /* -MER */ 04,'l','l',0200+'e', /* LL-ER */ 05,'d',0200+'d','l','e', /* D-DLER */ 04,0200+'b','l','e', /* -BLER */ 03,'k',0200+'e', /* K-ER */ 05,'n',0200+'t','h','e', /* N-THER */ 06,0200+'f','a',0200+'t','h','e', /* -FA-THER */ 06,'e','i',0200+'t','h','e', /* EI-THER */ 04,'t','h',0200+'e', /* TH-ER */ 04,'s','h',0200+'e', /* SH-ER */ 04,0200+'p','h','e', /* -PHER */ 04,'c','h',0200+'e', /* CH-ER */ 04,'d','g',0200+'e', /* DG-ER */ 04,'r','d',0200+'e', /* RD-ER */ 06,'o','u','n','d',0200+'e', /* OUND-ER */ 04,'l','d',0200+'e', /* LD-ER */ 04,'i','d',0200+'e', /* ID-ER */ 05,0200+'d','u','c',0200+'e', /* -DUC-ER */ 04,'n','c',0200+'e', /* NC-ER */ 0100+02, 0200+'e', /* /ER */ 03,0200+'s','a', /* -SAR */ 040+06,'a','c',0200+'u',0200+'l','a', /* AC-U-LAR */ 040+06,'e','c',0200+'u',0200+'l','a', /* EC-U-LAR */ 040+06,'i','c',0200+'u',0200+'l','a', /* IC-U-LAR */ 040+06,'e','g',0200+'u',0200+'l','a', /* EG-U-LAR */ 00 }; static char sufs[] = { 040+04,'u',0200+'o','u', /* U-OUS */ 05,0200+'t','i','o','u', /* -TIOUS */ 05,0200+'g','i','o','u', /* -GIOUS */ 05,0200+'c','i','o','u', /* -CIOUS */ 040+04,'i',0200+'o','u', /* I-OUS */ 05,0200+'g','e','o','u', /* -GEOUS */ 05,0200+'c','e','o','u', /* -CEOUS */ 04,'e',0200+'o','u', /* E-OUS */ 0140+02,0200+'u', /* /US */ 04,0200+'n','e','s', /* -NESS */ 04,0200+'l','e','s', /* -LESS */ 0140+02,0200+'s', /* /SS */ 040+05,'p',0200+'o',0200+'l','i', /* P-O-LIS */ 0140+02,0200+'i', /* /IS */ 0100+03,0200+'x','e', /* X/ES */ 0100+03,0200+'s','e', /* S/ES */ 0100+04,'s','h',0200+'e', /* SH/ES */ 0100+04,'c','h',0200+'e', /* CH/ES */ 0300+01, /* /S */ 00 }; static char suft[] = { 06,'i','o','n',0200+'i','s', /* ION-IST */ 05,'i','n',0200+'i','s', /* IN-IST */ 05,'a','l',0200+'i','s', /* AL-IST */ 06,'l',0200+'o',0200+'g','i','s', /* L-O-GIST */ 05,'h','t',0200+'e','s', /* HT-EST */ 04,'i',0200+'e','s', /* I-EST */ 05,'g',0200+'g','e','s', /* G-GEST */ 04,'g',0200+'e','s', /* G-EST */ 05,'d',0200+'d','e','s', /* D-DEST */ 04,'d',0200+'e','s', /* D-EST */ 04,0200+'c','a','s', /* -CAST */ 05,0200+'h','e','a','r', /* -HEART */ 04,0200+'f','o','o', /* -FOOT */ 03,'i',0200+'o', /* I-OT */ 05,0200+'f','r','o','n', /* -FRONT */ 05,0200+'p','r','i','n', /* -PRINT */ 04,0200+'m','e','n', /* -MENT */ 05,0200+'c','i','e','n', /* -CIENT */ 04,'i',0200+'a','n', /* I-ANT */ 06,0200+'w','r','i','g','h', /* -WRIGHT */ 06,0200+'b','r','i','g','h', /* -BRIGHT */ 06,0200+'f','l','i','g','h', /* -FLIGHT */ 06,0200+'w','e','i','g','h', /* -WEIGHT */ 05,0200+'s','h','i','f', /* -SHIFT */ 05,0200+'c','r','a','f', /* -CRAFT */ 040+04,'d','g',0200+'e', /* DG-ET */ 04,0200+'g','o','a', /* -GOAT */ 04,0200+'c','o','a', /* -COAT */ 04,0200+'b','o','a', /* -BOAT */ 04,0200+'w','h','a', /* -WHAT */ 04,0200+'c','u','i', /* -CUIT */ 00 }; static char sufy[] = { 040+04,'e','s',0200+'t', /* ES-TY */ 040+05,'q','u','i',0200+'t', /* QUI-TY */ 04,0200+'t','i',0200+'t', /* -TI-TY */ 040+05,'o','s',0200+'i',0200+'t', /* OS-I-TY */ 04,0200+'s','i',0200+'t', /* -SI-TY */ 05,'i','n',0200+'i',0200+'t', /* IN-I-TY */ 04,'n','i',0200+'t', /* NI-TY */ 040+010,'f','a',0200+'b','i','l',0200+'i',0200+'t', /* FA-BIL-I-TY */ 010,0200+'c','a',0200+'b','i','l',0200+'i',0200+'t', /* -CA-BIL-I-TY */ 010,0200+'p','a',0200+'b','i','l',0200+'i',0200+'t', /* -PA-BIL-I-TY */ 06,0200+'b','i','l',0200+'i',0200+'t', /* -BIL-I-TY */ 03,'i',0200+'t', /* I-TY */ 04,0200+'b','u','r', /* -BUR-Y */ 04,0200+'t','o',0200+'r', /* -TO-RY */ 05,0200+'q','u','a','r', /* -QUAR-Y */ 040+04,'u',0200+'a','r', /* U-ARY */ 07,0200+'m','e','n',0200+'t','a',0200+'r', /* -MEN-TA-RY */ 06,'i','o','n',0200+'a','r', /* ION-ARY */ 04,'i',0200+'a','r', /* I-ARY */ 04,'n',0200+'o',0200+'m', /* N-O-MY */ 03,0200+'p','l', /* -PLY */ 04,'g',0200+'g','l', /* G-GLY */ 05,0200+'p','a',0200+'b','l', /* -PA-BLY */ 05,'f','a',0200+'b','l', /* FA-BLY */ 05,0200+'c','a',0200+'b','l', /* -CA-BLY */ 04,0200+'a','b','l', /* -ABLY */ 03,0200+'b((','l', /* -BLY */ 02,0200+'l', /* -LY */ 03,0200+'s','k', /* -SKY */ 040+06,'g',0200+'r','a',0200+'p','h', /* G-RA-PHY */ 04,'l',0200+'o',0200+'g', /* L-O-GY */ 02,0200+'f', /* -FY */ 03,0200+'n','e', /* -NEY */ 03,0200+'l','e', /* -LEY */ 04,'c','k',0200+'e', /* CK-EY */ 03,0200+'k','e', /* -KEY */ 04,0200+'b','o','d', /* -BODY */ 05,0200+'s','t','u','d', /* -STUDY */ 0340+04,'e','e','d', /* EEDY */ 02,0200+'b', /* -BY */ 03,0200+'w','a', /* -WAY */ 03,0200+'d','a', /* -DAY */ 00 }; char *suftab[] = { sufa, 0, sufc, sufd, sufe, suff, sufg, sufh, sufi, 0, sufk, sufl, sufm, sufn, sufo, sufp, 0, sufr, sufs, suft, 0, 0, 0, 0, sufy, 0, }; 'f', /* -FY */ 03,0200+'n','e', /* -NEY */ 03,0200+'l','e', /* -LEY */ 04,'c','k',0200+'e', /* CK-EY */ 03,0200+'k','e', /* -KEY */ 04,0200+'b','o','d', /* -BODY */ 05,0200+'s','t','u','d', /* -STUDY */ 0340+04,'e','e','d', /* EEDY */ 02,0200+'b', /* -BY */ 03,0200+'w','a', /* -WAY */ 03,0200+'d','a', /* -DAY */ 00 }; char *cmd/troff/t10.c 644 0 33 12116 2346517352 6516 #include "tdef.h" extern #include "d.h" extern #include "v.h" /* troff10.c CAT interface */ extern int *olinep; extern int oline[]; extern int *pslp; extern int back; extern int xpts; extern int mpts; extern int po; extern int xflg; extern int line[]; extern int lss; extern int xbitf; extern char obuf[]; extern char *obufp; extern int esct; extern int trflg; extern int cs; extern int smnt; extern int mfont; extern int xfont; extern int code; extern int mcase; extern int esc; extern int lead; extern int paper; extern int cps; extern int psflg; extern int ptid; extern int verm; extern int escm; extern char pstab[], psctab[]; extern int dpn; extern int ascii; int mrail = 0; /*0=LR,1=UR*/ int mmag = 1; /*0=UM,1=LM*/ extern int nofeed; extern int gflag; extern int fontlab[]; int papflg; extern int pfont; extern int ppts; extern int oldbits; extern int bd; extern int vflag; extern int stopmesg; extern int xxx; ptinit(){ if(ascii || gflag)return; oput(T_INIT); esc = T_IESC; ptesc(); esct = 0; esc = po; oput(0140); /*some initial lead*/ } ptout(i) int i; { register *k, lw, *j; int ds, de, inith, temp, *slp, dv; int psl[16]; if((i & CMASK) != '\n'){ *olinep++ = i; return; } if(olinep == oline){ lead += lss; return; } pslp = psl; *pslp = lw = inith = dv = 0; for(k=oline; kblss + lss; dip->blss = 0; slp = k; scan: temp = esct - po; if(mpts & DBL)temp -= 55; ds = temp - inith; de = lw - temp; if(de >= ds){ back = 0; esc = -ds; for(k=slp; k=slp; --k)ptout0(*k); } if(xflg && (--pslp >= psl))goto scan; olinep = oline; lead += dip->alss; dip->alss = 0; } ptout0(i) int i; { register j, k, w; int z; if(i & MOT){ j = i & ~MOTV; if(i & NMOT)j = -j; if(back)j = -j; if(i & VMOT)lead += j; else esc += j; return; } xbitf = 2; if((i>>BYTE) == oldbits){ xfont = pfont; xpts = ppts; xbitf = 0; }else xbits(i); if((k = (i & CMASK)) < 040){ return; } w = getcw(k-32); if(cs){ if(bd)w += bd - 1; j = (cs-w)/2; w = cs - j; if(bd)w -= bd - 1; }else j = 0; if(i & ZBIT){ if(cs)w = -j; else w = 0; z = 1; }else z = 0; if(back){ k = j; j = -w; w = -k; } esc += j; if((!xflg || (xpts == *pslp)) && (code & 077)){ if(code & 0200){ if(smnt)xfont = smnt -1; else goto p1; } if((k=(code>>6)&01)^mcase)oput((mcase=k)+0105); if(xfont != mfont){ mfont = xfont; if(mrail != (xfont&01)) oput(0101 + (mrail=xfont&01)); if(mmag != (xfont<2)) oput(0103 + (mmag=(xfont<2))); } if(xpts != mpts)ptps(); if(lead)ptlead(); if(esc)ptesc(); /* oput(code & 077); */ *obufp++ = code & 077; if(obufp == (obuf + OBUFSZ + ascii - 1))flusho(); if(bd){ bd -= 1; if(back && !z)bd = -bd; if(esc += bd)ptesc(); oput(code & 077); if(z)esc -= bd; } }else if(bd && !z){ bd -= 1; if(back)bd = -bd; esc += bd; } p1: esc += w; return; } ptps(){ register i, j, k; if(psflg)return; if(cps){ psflg++; i = findps(cps); }else i = xpts; for(j=0; (i&077) > (k = pstab[j]);j++)if(!k){k=pstab[--j];break;} j = psctab[j]; oput((j & ~0200) | 0120); if((!(mpts & DBL))^(!(j & 0200))){ if(j & 0200)k = 55; else k = -55; esc += k; } mpts = i; } ptlead(){ register i, k; if(k = lead < 0)lead = -lead; if(k^verm)oput(0112 + ((verm=k)<<1)); if(((k=lead)%3) == 2)k++; k /= 3; while(k > 0){ if((i=31) > k)i = k; if(verm)paper -= i; else paper += i; oput(((~i) & 037) | 0140); if((paper > (11*144*15)) && !papflg && ptid != 1){ prstr("Excessive paper use.\n"); papflg++; if(ptid != 1){ lead = 0; done2(0200); } } k -= i; } lead = 0; } ptesc(){ register i, j, k; if(k = esc < 0)esc = -esc; if(k^escm)oput(0107 + (escm=k)); k = esc; while(k > 0){ if((i=127) > k)i = k; if(((j = (esct + i*(1-2*escm))) > (46*72+18-T_IESC)) || (j < 0))break; /* oput(~i); */ *obufp++ = ~i; if(obufp == (obuf + OBUFSZ + ascii - 1))flusho(); esct = j; k -= i; } esc = 0; } dostop(){ register i; if(ascii)return; if(!nofeed && !gflag)lead += TRAILER; ptlead(); flusho(); oput(T_INIT); oput(T_STOP); if(gflag){ oput('f'); for(i=0; i<4; i++){ oput(fontlab[i] & BMASK); oput((fontlab[i]>>BYTE) & BMASK); } }else for(i=8; i>0; i--)oput(T_PAD); flusho(); if(stopmesg)prstr("Pages finished.\n"); mcase = mpts = mfont = mrail = verm = escm = 0; mmag = 1; report(); paper = 0; esc = T_IESC; ptesc(); esct = 0; esc = po; } ); esct = j; k -= i; } esc = 0; } dostop(){ register i; if(ascii)return; if(!nofeed && !gflag)lead += TRAILER; ptlead(); flusho(); oput(T_INIT); oput(T_STOP); if(gflag){ oput('f'); for(i=0; i<4; i++){ oput(fontlab[i] & BMASK); oput((fontlab[i]>>BYTE) & BMASK); } }else for(i=8; i>0; i--)oput(T_PAD); flusho(); if(stopmesg)prstr("Pages finished.\n"); mcase = mpts = mfont = mrail = verm = escm = 0; mmagcmd/troff/t6.c 644 0 33 23557 2350157211 6443 #include "tdef.h" extern #include "d.h" extern #include "v.h" /* troff6.c width functions, sizes and fonts */ extern int inchar[LNSIZE], *pinchar; /* XXX */ extern int eschar; extern int widthp; extern int ohc; extern int xpts; extern int xfont; extern int code; extern int smnt; extern int setwdf; extern int cs; extern int ccs; extern int spacesz; extern char trtab[]; extern int xbitf; extern int mfont; extern int mpts; extern int pfont; extern int ppts; extern int oldbits; extern int chbits; extern int spbits; extern int nonumb; extern int noscale; extern int font; extern int font1; extern int pts; extern int pts1; extern int apts; extern int apts1; extern int sps; extern int nlflg; extern int nform; extern int dfact; extern int lss; extern int lss1; extern int vflag; extern int ch0; extern int lg; char fontfile[] = "/usr/lib/font/ftXX"; int ffi = 16; extern int bd; extern int level; extern int ch; extern int res; extern int ptid; extern char W1[],W2[],W3[],W4[]; extern int xxx; int trflg; char *fontab[] = {W1,W2,W3,W4}; int fontlab[] = {'R','I','B','S',0}; char pstab[] = {6,7,8,9,10,11,12,14,16,18,20,22,24,28,36,0}; char psctab[] = {010,000,001,007,002,003,004,005,0211,006, 0212,0213,0214,0215,0216,0}; int cstab[4], ccstab[4]; int bdtab[4]; int sbold = 0; int spsz = 0; struct fz { char sign; char size; int inc; } fz[4]; width(c) int c; { register i,j,k; j = c; k = 0; if(j & MOT){ if(j & VMOT)goto rtn; k = j & ~MOTV; if(j & NMOT)k = -k; goto rtn; } if((i = (j & CMASK)) == 010){ k = -widthp; goto rtn; } if(i == PRESC)i = eschar; if((i == ohc) || (i >= 0370))goto rtn; if((j>>BYTE) == oldbits){ xfont = pfont; xpts = ppts; }else xbits(j); if(j & ZBIT)goto rtn; if(!trflg)i = trtab[i] & BMASK; if((i -= 32) < 0)goto rtn; k = getcw(i); if(bd)k += bd - 1; if(cs)k = cs; widthp = k; rtn: xbitf = trflg = 0; return(k); } getcw(i) int i; { register j,k; register char *p; int x; extern char codetab[]; bd = 0; if((code = codetab[i]) & 0200){ if(smnt){ p = fontab[smnt-1]; if(xfont == (sbold-1))bd = bdtab[smnt-1]; goto g0; } code = 0; k = 36; goto g1; } p = fontab[xfont]; g0: if(!i)k = spacesz; else k = *(p + i) & BMASK; if(setwdf)v.ct |= ((k>>6) & 3); g1: k = (j = (k&077)*(xpts&077))/6; if((j%6) >= 3)k++; if(cs = cstab[xfont]){ if(ccs = ccstab[xfont])x = ccs; else x = xpts; cs = (j = (cs&077)*(x&077))/6; if((j%6) >= 3)cs++; } if(!bd)bd = bdtab[xfont]; return(k); } xbits(i) int i; { register j, k; /* if((j = i >> BYTE) == oldbits){ x((font = pfont; xpts = ppts; goto rtn; } */ j = i >> BYTE; xfont = (j>>1) & 03; if(k = (j>>3) & 017){ xpts = pstab[--k]; if(psctab[k] < 0)xpts |= DBL; oldbits = j; pfont = xfont; ppts = xpts; goto rtn; } switch(xbitf){ case 0: xfont = font; xpts = pts; break; case 1: xfont = pfont; xpts = ppts; break; case 2: xfont = mfont; xpts = mpts; } rtn: xbitf = 0; } setch(){ register i,*j,k; extern int chtab[]; if((i = getrq()) == 0)return(0); for(j=chtab;*j != i;j++)if(*(j++) == 0)return(0); k = *(++j) | chbits; /* if((i & CMASK) == '*'){ if(((i = find('R',fontlab)) < 0) && ((i = find('G',fontlab)) < 0)) return(k); else return((k & ~(03<<(BYTE+1))) | (i<<(BYTE+1))); } */ return(k); } find(i,j) int i,j[]; { register k; if(((k = i-'0') >= 1) && (k <= 4) && (k != smnt))return(--k); for(k=0; j[k] != i; k++)if(j[k] == 0)return(-1); return(k); } casefz(){ register i, j, k; int savinc; k = 0; fz0: if(skip() || !(i = getrq()) || ((j = find(i,fontlab)) == -1)){ if(k)goto fz1; else return; } if(j == (smnt-1)){ k = smnt; goto fz0; } if(k){ spsz = j + 1; j = k -1; } fz1: if((j==font) && fz[j].inc)savinc = fz[j].inc; else savinc = 0; fz[j].inc = fz[j].sign = fz[j].size = 0; if(skip()){ if(k)spsz = 0; goto fz2; } if(((i=((k=getch()) & CMASK)) == '+') || (i == '-'))fz[j].sign = i; else{ fz[j].sign = 0; ch = k; } noscale++; fz[j].size = atoi(); noscale = 0; fz2: if(j==font)casps1(apts + savinc); else if(j == smnt-1)mchbits(); } caseps(){ register i; if(skip())i = apts1; else{ noscale++; i = inumb(&apts); noscale = 0; if(nonumb)return; } casps1(i); } casps1(i) int i; { if(i <= 0)return; if(fz[font].size){ i = getfz(font, i); } apts1 = apts; apts = i; pts1 = pts; pts = findps(i & 077); mchbits(); } findps(i) int i; { register j, k; for(j=0; i > (k = pstab[j]);j++)if(!k){k=pstab[--j];break;} if(psctab[j] < 0)k |= DBL; return(k); } mchbits(){ register i, j, k; spbits = 0; i = pts & 077; for(j=0; i > (k = pstab[j]);j++)if(!k){k=pstab[--j];break;} chbits = (((++j)<<2) | font) << (BYTE + 1); sps = width(' ' | chbits); if(font == (spsz-1)){ i = findps(getfz(smnt-1, apts + fz[font].inc)); for(j=0; i > (k = pstab[j]);j++)if(!k){k=pstab[--j];break;} spbits = (((++j)<<2) | font) << (BYTE + 1); } } getfz(x,y) int x, y; { register i, j, k; i = fz[x].size; j = fz[x].sign; if(i || j){ if(j == '+')i += y; else if(j == '-')i = y - i; } fz[x].inc = y - i; return(i); } setps(){ register i,j; if((((i=getch() & CMASK) == '+') || (i == '-')) && (((j=(ch = getch() & CMASK) - '0') >= 0) && (j <= 9))){ if(i == '-')j = -j; ch = 0; casps1(apts+j); return; } if((i -= '0') == 0){ casps1(apts1); return; } if((i > 0) && (i <= 9)){ if((i <= 3) && ((j=(ch = getch() & CMASK) - '0') >= 0) && (j <= 9)){ i = 10*i +j; ch = 0; } casps1(i); } } caseft(){ skip(); setfont(1); } setfont(a) int a; { register i,j; if(a)i = getrq(); else i = getsn(); if(!i || (i == 'P')){ j = font1; goto s0; } if(i == 'S')return; if((j = find(i,fontlab)) == -1)return; s0: font1 = font; font = j; i = 0; if(fz[font1].size){ i++; casps1(apts + fz[font1].inc); }else if(fz[font].size){ i++; casps1(apts); } if(!i)mchbits(); } setwd(){ register i, base, wid; int delim, em, k; int savlevel, savhp, savapts, savapts1, savfont, savfont1, savpts, savpts1; int *savpinchar, *p, *q, tempinchar[LNSIZE]; /* XXX */ base = v.st = v.sb = wid = v.ct = 0; if((delim = getch() & CMASK) & MOT)return; savhp = v.hp; savpinchar = pinchar; /* XXX */ for (p=inchar, q=tempinchar; p < pinchar; ) /* XXX */ *q++ = *p++; /* XXX */ pinchar = inchar; /* XXX */ savlevel = level; v.hp = level = 0; savapts = apts; savapts1 = apts1; savfont = font; savfont1 = font1; savpts = pts; savpts1 = pts1; setwdf++; while((((i = getch()) & CMASK) != delim) && !nlflg){ wid += width(i); if(!(i & MOT)){ em = (xpts & 077)*6; }else if(i & VMOT){ k = i & ~MOTV; if(i & NMOT)k = -k; base -= k; em = 0; }else continue; if(base < v.sb)v.sb = base; if((k=base + em) > v.st)v.st = k; } nform = 0; setn1(wid); v.hp = savhp; pinchar = savpinchar; /* XXX */ for (p=inchar, q=tempinchar; p < pinchar; ) /* XXX */ *p++ = *q++; /* XXX */ level = savlevel; apts = savapts; apts1 = savapts1; font = savfont; font1 = savfont1; pts = savpts; pts1 = savpts1; mchbits(); setwdf = 0; } vmot(){ dfact = lss; vflag++; return(mot()); } hmot(){ dfact = 6 * (pts & 077); return(mot()); } mot(){ register i, j; j = HOR; getch(); /*eat delim*/ if(i = atoi()){ if(vflag)j = VERT; i = makem(quant(i,j)); } getch(); vflag = 0; dfact = 1; return(i); } sethl(k) int k; { register i; i = 3 * (pts & 077); if(k == 'u')i = -i; else if(k == 'r')i = -2*i; vflag++; i = makem(i); vflag = 0; return(i); } makem(i) int i; { register j; if((j = i) < 0)j = -j; j = (j & ~MOTV) | MOT; if(i < 0)j |= NMOT; if(vflag)j |= VMOT; return(j); } getlg(i) int i; { register j, k; switch((j = getch0()) & CMASK){ case 'f': if(lg!=2){switch((k =getch0()) & CMASK){ case 'i': j = 0214; break; case 'l': j = 0215; break; default: ch0 = k; j = 0213; } }else j = 0213; break; case 'l': j = 0212; break; case 'i': j = 0211; break; default: ch0 = j; j = i; } return((i & ~CMASK) | j); } caselg(){ lg = 1; if(skip())return; lg = atoi(); } casefp(){ register i, j, k; int x; skip(); if(((i = (getch() & CMASK) - '0' -1) < 0) || (i >3)){prstr("fp: bad font position\n"); return;} if(skip() || !(j = getrq())){prstr("fp: no font name\n"); return;} fontfile[ffi] = j & BMASK; fontfile[ffi+1] = j>>BYTE; if((k = open(fontfile,0)) < 0){ prstr("Cannot open "); c0: prstr(fontfile); prstr("\n"); done(-1); } if(lseek(k,8L * sizeof(int),0) < 0)goto c1; if(read(k,fontab[i],256-32) != 256-32){ c1: prstr("Cannot read "); goto c0; } close(k); if(i == (smnt-1)){smnt = 0; sbold = 0; spsz = 0;} if((fontlab[i] = j) == 'S')smnt = i + 1; bdtab[i] = cstab[i] = ccstab[i] = 0; fz[i].inc = fz[i].sign = fz[i].size = 0; if(ptid != 1){ prstr("Mount font "); prstr(&fontfile[ffi]); prstr(" on "); x = PAIR((i + '1'),0); prstr((char *)&x); prstr("\n"); } } casecs(){ register i, j; noscale++; skip(); if(!(i=getrq()) || ((i = find(i,fontlab)) < 0))goto rtn; skip(); cstab[i] = atoi(); skip(); j = atoi(); if(!nonumb)ccstab[i] = findps(j); rtn: noscale = 0; } casebd(){ register i, j, k; k = 0; bd0: if(skip() || !(i = getrq()) || ((j = find(i,fontlab)) == -1)){ if(k)goto bd1; else return; } if(j == (smnt-1)){ k = smnt; goto bd0; } if(k){ sbold = j + 1; j = k -1; } bd1: skip(); noscale++; bdtab[j] = atoi(); noscale = 0; } casevs(){ register i; skip(); vflag++; dfact = 6; /*default scaling is points!*/ res = VERT; i = inumb(&lss); if(nonumb)i = lss1; if(i < VERT)i = VERT; lss1 = lss; lss = i; } casess(){ register i; noscale++; skip(); if(i = atoi()){ spacesz = i& 0177; sps = width(' ' | chbits); } noscale = 0; } xlss(){ register i, j; getch(); dfact = lss; i = quant(atoi(),VERT); dfact = 1; getch(); if((j = i) < 0)j = -j; ch0 = ((j & 03700)<<3) | HX; if(i < 0)ch0 |= 040000; return(((j & 077)<<9) | LX); } egister i; skip(); vflag++; dfact = 6; /*default scaling is points!*/ res = VERT; i = inumb(&lss); if(nonumb)i = lss1; if(i < VERT)i = VEcmd/troff/tab3.c 644 0 33 37035 2346517354 6754 #define BYTE 8 #define PAIR(A,B) (A|(B<','='), 0277, /*>=*/ PAIR('<','='), 0300, /*<=*/ PAIR('=','='), 0301, /*identically equal*/ PAIR('~','='), 0303, /*approx =*/ PAIR('a','p'), 0304, /*approximates*/ PAIR('!','='), 0305, /*not equal*/ PAIR('-','>'), 0306, /*right arrow*/ PAIR('<','-'), 0307, /*left arrow*/ PAIR('u','a'), 0310, /*up arrow*/ PAIR('d','a'), 0311, /*down arrow*/ PAIR('e','q'), 0312, /*equation equal*/ PAIR('m','u'), 0313, /*multiply*/ PAIR('d','i'), 0314, /*divide*/ PAIR('+','-'), 0315, /*plus-minus*/ PAIR('c','u'), 0316, /*cup (union)*/ PAIR('c','a'), 0317, /*cap (intersection)*/ PAIR('s','b'), 0320, /*subset of*/ PAIR('s','p'), 0321, /*superset of*/ PAIR('i','b'), 0322, /*improper subset*/ PAIR('i','p'), 0323, /* " superset*/ PAIR('i','f'), 0324, /*infinity*/ PAIR('p','d'), 0325, /*partial derivative*/ PAIR('g','r'), 0326, /*gradient*/ PAIR('n','o'), 0327, /*not*/ PAIR('i','s'), 0330, /*integral sign*/ PAIR('p','t'), 0331, /*proportional to*/ PAIR('e','s'), 0332, /*empty set*/ PAIR('m','o'), 0333, /*member of*/ PAIR('p','l'), 0334, /*equation plus*/ PAIR('r','g'), 0335, /*registered*/ PAIR('c','o'), 0336, /*copyright*/ PAIR('b','r'), 0337, /*box vert rule*/ PAIR('c','t'), 0340, /*cent sign*/ PAIR('d','d'), 0341, /*dbl dagger*/ PAIR('r','h'), 0342, /*right hand*/ PAIR('l','h'), 0343, /*left hand*/ PAIR('*','*'), 0344, /*math * */ PAIR('b','s'), 0345, /*bell system sign*/ PAIR('o','r'), 0346, /*or*/ PAIR('c','i'), 0347, /*circle*/ PAIR('l','t'), 0350, /*left top (of big curly)*/ PAIR('l','b'), 0351, /*left bottom*/ PAIR('r','t'), 0352, /*right top*/ PAIR('r','b'), 0353, /*right bot*/ PAIR('l','k'), 0354, /*left center of big curly bracket*/ PAIR('r','k'), 0355, /*right center of big curly bracket*/ PAIR('b','v'), 0356, /*bold vertical*/ PAIR('l','f'), 0357, /*left floor (left bot of big sq bract)*/ PAIR('r','f'), 0360, /*right floor (rb of ")*/ PAIR('l','c'), 0361, /*left ceiling (lt of ")*/ PAIR('r','c'), 0362, /*right ceiling (rt of ")*/ 0,0}; char codetab[256-32] = { /*cat codes*/ 00, /*space*/ 0145, /*!*/ 0230, /*"*/ 0337, /*#*/ 0155, /*$*/ 053, /*%*/ 050, /*&*/ 032, /*' close*/ 0132, /*(*/ 0133, /*)*/ 0122, /***/ 0143, /*+*/ 047, /*,*/ 040, /*- hyphen*/ 044, /*.*/ 043, /*/*/ 0110, /*0*/ 0111, /*1*/ 0112, /*2*/ 0113, /*3*/ 0114, /*4*/ 0115, /*5*/ 0116, /*6*/ 0117, /*7*/ 0120, /*8*/ 0121, /*9*/ 0142, /*:*/ 023, /*;*/ 0303, /*<*/ 0140, /*=*/ 0301, /*>*/ 0147, /*?*/ 0222, /*@*/ 0103, /*A*/ 075, /*B*/ 070, /*C*/ 074, /*D*/ 072, /*E*/ 0101, /*F*/ 065, /*G*/ 060, /*H*/ 066, /*I*/ 0105, /*J*/ 0107, /*K*/ 063, /*L*/ 062, /*M*/ 061, /*N*/ 057, /*O*/ 067, /*P*/ 055, /*Q*/ 064, /*R*/ 076, /*S*/ 056, /*T*/ 0106, /*U*/ 071, /*V*/ 0104, /*W*/ 0102, /*X*/ 077, /*Y*/ 073, /*Z*/ 0134, /*[*/ 0241, /*\*/ 0135, /*]*/ 0336, /*^*/ 0240, /*_*/ 030, /*` open*/ 025, /*a*/ 012, /*b*/ 027, /*c*/ 011, /*d*/ 031, /*e*/ 014, /*f*/ 045, /*g*/ 001, /*h*/ 006, /*i*/ 015, /*j*/ 017, /*k*/ 005, /*l*/ 004, /*m*/ 003, /*n*/ 033, /*o*/ 021, /*p*/ 042, /*q*/ 035, /*r*/ 010, /*s*/ 002, /*t*/ 016, /*u*/ 037, /*v*/ 041, /*w*/ 013, /*x*/ 051, /*y*/ 007, /*z*/ 0332, /*{*/ 0151, /*|*/ 0333, /*}*/ 0342, /*~*/ 00, /*narrow space*/ 040, /*hyphen*/ 0146, /*bullet*/ 0154, /*square*/ 022, /*3/4 em*/ 026, /*rule*/ 034, /*1/4*/ 036, /*1/2*/ 046, /*3/4*/ 0123, /*minus*/ 0124, /*fi*/ 0125, /*fl*/ 0126, /*ff*/ 0131, /*ffi*/ 0130, /*ffl*/ 0136, /*degree*/ 0137, /*dagger*/ 0355, /*section*/ 0150, /*foot mark*/ 0334, /*acute accent*/ 0335, /*grave accent*/ 0240, /*underrule*/ 0304, /*slash (longer)*/ 00, /*half nar sp*/ 00, /**/ 0225, /*alpha*/ 0212, /*beta*/ 0245, /*gamma*/ 0211, /*delta*/ 0231, /*epsilon*/ 0207, /*zeta*/ 0214, /*eta*/ 0202, /*theta*/ 0206, /*iota*/ 0217, /*kappa*/ 0205, /*lambda*/ 0204, /*mu*/ 0203, /*nu*/ 0213, /*xi*/ 0233, /*omicron*/ 0221, /*pi*/ 0235, /*rho*/ 0210, /*sigma*/ 0237, /*tau*/ 0216, /*upsilon*/ 0215, /*phi*/ 0227, /*chi*/ 0201, /*psi*/ 0251, /*omega*/ 0265, /*Gamma*/ 0274, /*Delta*/ 0256, /*Theta*/ 0263, /*Lambda*/ 0302, /*Xi*/ 0267, /*Pi*/ 0276, /*Sigma*/ 00, /**/ 0306, /*Upsilon*/ 0255, /*Phi*/ 0242, /*Psi*/ 0257, /*Omega*/ 0275, /*square root*/ 0262, /*terminal sigma (was root em)*/ 0261, /*root en*/ 0327, /*>=*/ 0326, /*<=*/ 0330, /*identically equal*/ 0264, /*equation minus*/ 0277, /*approx =*/ 0272, /*approximates*/ 0331, /*not equal*/ 0354, /*right arrow*/ 0234, /*left arrow*/ 0236, /*up arrow*/ 0223, /*down arrow*/ 0232, /*equation equal*/ 0323, /*multiply*/ 0324, /*divide*/ 0325, /*plus-minus*/ 0260, /*cup (union)*/ 0305, /*cap (intersection)*/ 0270, /*subset of*/ 0271, /*superset of*/ 0350, /*improper subset*/ 0246, /* improper superset*/ 0244, /*infinity*/ 0273, /*partial derivative*/ 0253, /*gradient*/ 0307, /*not*/ 0266, /*integral sign*/ 0247, /*proportional to*/ 0343, /*empty set*/ 0341, /*member of*/ 0353, /*equation plus*/ 0141, /*registered*/ 0153, /*copyright*/ 0346, /*box rule (was parallel sign)*/ 0127, /*cent sign*/ 0345, /*dbl dagger*/ 0250, /*right hand*/ 0340, /*left hand*/ 0347, /*math * */ 0243, /*bell system sign*/ 0226, /*or (was star)*/ 0351, /*circle*/ 0311, /*left top (of big curly)*/ 0314, /*left bottom*/ 0315, /*right top*/ 0317, /*right bot*/ 0313, /*left center of big curly bracket*/ 0316, /*right center of big curly bracket*/ 0312, /*bold vertical*/ 0321, /*left floor (left bot of big sq bract)*/ 0320, /*right floor (rb of ")*/ 0322, /*left ceiling (lt of ")*/ 0310}; /*right ceiling (rt of ")*/ /*modified for Commercial II*/ char W1[256-32] = { /*Times Roman widths*/ 12, /*space*/ 12, /*!*/ 0, /*"*/ 0, /*#*/ 19, /*$*/ 29, /*%*/ 28, /*&*/ 12, /*' close*/ 16, /*(*/ 16, /*)*/ 16, /***/ 36, /*+*/ 12, /*,*/ 13, /*- hyphen*/ 10, /*.*/ 17, /*/*/ 19+0200, /*0*/ 19+0200, /*1*/ 19+0200, /*2*/ 19+0200, /*3*/ 19+0200, /*4*/ 19+0200, /*5*/ 19+0200, /*6*/ 19+0200, /*7*/ 19+0200, /*8*/ 19+0200, /*9*/ 10, /*:*/ 12, /*;*/ 0, /*<*/ 36, /*=*/ 0, /*>*/ 20, /*?*/ 0, /*@*/ 29+0200, /*A*/ 23+0200, /*B*/ 26+0200, /*C*/ 30+0200, /*D*/ 24+0200, /*E*/ 23+0200, /*F*/ 30+0200, /*G*/ 29+0200, /*H*/ 13+0200, /*I*/ 16+0200, /*J*/ 28+0200, /*K*/ 24+0200, /*L*/ 35+0200, /*M*/ 29+0200, /*N*/ 27+0200, /*O*/ 22+0200, /*P*/ 27+0300, /*Q*/ 27+0200, /*R*/ 20+0200, /*S*/ 24+0200, /*T*/ 29+0200, /*U*/ 27+0200, /*V*/ 36+0200, /*W*/ 28+0200, /*X*/ 27+0200, /*Y*/ 23+0200, /*Z*/ 14, /*[*/ 0, /*\*/ 14, /*]*/ 0, /*^*/ 0, /*_*/ 12, /*` open*/ 17, /*a*/ 20+0200, /*b*/ 16, /*c*/ 20+0200, /*d*/ 18, /*e*/ 13+0200, /*f*/ 18+0100, /*g*/ 21+0200, /*h*/ 10+0200, /*i*/ 9+0300, /*j*/ 20+0200, /*k*/ 10+0200, /*l*/ 32, /*m*/ 21, /*n*/ 20, /*o*/ 19+0100, /*p*/ 19+0100, /*q*/ 14, /*r*/ 15, /*s*/ 12+0200, /*t*/ 21, /*u*/ 20, /*v*/ 26, /*w*/ 20, /*x*/ 18+0100, /*y*/ 17, /*z*/ 0, /*{*/ 2, /*|*/ 0, /*}*/ 0, /*~*/ 6, /*narrow space*/ 13, /*hyphen*/ 27, /*bullet*/ 27, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 29, /*1/4*/ 29, /*1/2*/ 29, /*3/4*/ 36, /*minus*/ 21, /*fi*/ 21, /*fl*/ 24, /*ff*/ 32, /*ffi*/ 32, /*ffl*/ 15, /*degree*/ 20, /*dagger*/ 0, /*section*/ 8, /*foot mark*/ 0, /*'*/ 0, /*`*/ 0, /*_*/ 0, 3, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0, 20, /*registered*/ 20, /*copyright*/ 0, 19, /*cent*/ }; char W2[256-32] = { /*Times Italic widths*/ 12, /*space*/ 13, /*!*/ 0, /*"*/ 0, /*#*/ 19, /*$*/ 27, /*%*/ 26, /*&*/ 11, /*' close*/ 15, /*(*/ 15, /*)*/ 16, /***/ 36, /*+*/ 11, /*,*/ 13, /*- hyphen*/ 11, /*.*/ 9, /*/*/ 19+0200, /*0*/ 19+0200, /*1*/ 19+0200, /*2*/ 19+0200, /*3*/ 19+0200, /*4*/ 19+0200, /*5*/ 19+0200, /*6*/ 19+0200, /*7*/ 19+0200, /*8*/ 19+0200, /*9*/ 11, /*:*/ 11, /*;*/ 0, /*<*/ 36, /*=*/ 0, /*>*/ 20, /*?*/ 0, /*@*/ 25+0200, /*A*/ 24+0200, /*B*/ 26+0200, /*C*/ 27+0200, /*D*/ 23+0200, /*E*/ 21+0200, /*F*/ 27+0200, /*G*/ 29+0200, /*H*/ 14+0200, /*I*/ 16+0200, /*J*/ 28+0200, /*K*/ 24+0200, /*L*/ 34+0200, /*M*/ 27+0200, /*N*/ 27+0200, /*O*/ 22+0200, /*P*/ 27+0300, /*Q*/ 27+0200, /*R*/ 20+0200, /*S*/ 23+0200, /*T*/ 28+0200, /*U*/ 25+0200, /*V*/ 36+0200, /*W*/ 24+0200, /*X*/ 24+0200, /*Y*/ 25+0200, /*Z*/ 13, /*[*/ 0, /*\*/ 13, /*]*/ 0, /*^*/ 0, /*_*/ 11, /*` open*/ 19, /*a*/ 18+0200, /*b*/ 15, /*c*/ 18+0200, /*d*/ 16, /*e*/ 11+0200, /*f*/ 17+0100, /*g*/ 19+0200, /*h*/ 9+0200, /*i*/ 9+0300, /*j*/ 19+0200, /*k*/ 9+0200, /*l*/ 28, /*m*/ 19, /*n*/ 18, /*o*/ 17+0100, /*p*/ 18+0100, /*q*/ 13, /*r*/ 14, /*s*/ 10+0200, /*t*/ 19, /*u*/ 16, /*v*/ 24, /*w*/ 18, /*x*/ 16+0100, /*y*/ 14, /*z*/ 0, /*{*/ 2, /*|*/ 0, /*}*/ 0, /*~*/ 6, /*narrow space*/ 13, /*hyphen*/ 27, /*bullet*/ 27, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 27, /*1/4*/ 27, /*1/2*/ 27, /*3/4*/ 36, /*minus*/ 21, /*fi*/ 21, /*fl*/ 21, /*ff*/ 31, /*ffi*/ 31, /*ffl*/ 15, /*degree*/ 19, /*dagger*/ 16, /*section*/ 7, /*foot mark*/ 0, /*'*/ 0, /*`*/ 0, /*_*/ 0, 3, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0, 20, /*registered*/ 20, /*copyright*/ 0, 19, /*cent*/ }; char W3[256-32] = { /*Times Bold widths*/ 12, /*space*/ 13, /*!*/ 0, /*"*/ 0, /*#*/ 18, /*$*/ 28, /*%*/ 27, /*&*/ 12, /*' close*/ 16, /*(*/ 16, /*)*/ 18, /***/ 36, /*+*/ 12, /*,*/ 14, /*- hyphen*/ 12, /*.*/ 18, /*/*/ 19+0200, /*0*/ 19+0200, /*1*/ 19+0200, /*2*/ 19+0200, /*3*/ 19+0200, /*4*/ 19+0200, /*5*/ 19+0200, /*6*/ 19+0200, /*7*/ 19+0200, /*8*/ 19+0200, /*9*/ 13, /*:*/ 13, /*;*/ 0, /*<*/ 36, /*=*/ 0, /*>*/ 22, /*?*/ 0, /*@*/ 28+0200, /*A*/ 26+0200, /*B*/ 26+0200, /*C*/ 29+0200, /*D*/ 25+0200, /*E*/ 23+0200, /*F*/ 28+0200, /*G*/ 32+0200, /*H*/ 16+0200, /*I*/ 21+0200, /*J*/ 28+0200, /*K*/ 25+0200, /*L*/ 36+0200, /*M*/ 30+0200, /*N*/ 29+0200, /*O*/ 25+0200, /*P*/ 29+0300, /*Q*/ 28+0200, /*R*/ 23+0200, /*S((*/ 25+0200, /*T*/ 29+0200, /*U*/ 27+0200, /*V*/ 36+0200, /*W*/ 27+0200, /*X*/ 28+0200, /*Y*/ 27+0200, /*Z*/ 12, /*[*/ 0, /*\*/ 12, /*]*/ 0, /*^*/ 0, /*_*/ 12, /*` open*/ 19, /*a*/ 19+0200, /*b*/ 16, /*c*/ 19+0200, /*d*/ 17, /*e*/ 13+0200, /*f*/ 18+0100, /*g*/ 22+0200, /*h*/ 12+0200, /*i*/ 12+0300, /*j*/ 23+0200, /*k*/ 12+0200, /*l*/ 32, /*m*/ 22, /*n*/ 18, /*o*/ 20+0100, /*p*/ 19+0100, /*q*/ 15, /*r*/ 17, /*s*/ 13+0200, /*t*/ 21, /*u*/ 19, /*v*/ 27, /*w*/ 21, /*x*/ 19+0100, /*y*/ 17, /*z*/ 0, /*{*/ 2, /*|*/ 0, /*}*/ 0, /*~*/ 6, /*narrow space*/ 14, /*hyphen*/ 27, /*bullet*/ 27, /*square*/ 36, /*3/4 em*/ 18, /*rule*/ 28, /*1/4*/ 28, /*1/2*/ 28, /*3/4*/ 36, /*minus*/ 22, /*fi*/ 22, /*fl*/ 23, /*ff*/ 33, /*ffi*/ 33, /*ffl*/ 15, /*degree*/ 20, /*dagger*/ 0, /*section*/ 9, /*foot mark*/ 0, /*'*/ 0, /*`*/ 0, /*_*/ 0, 3, /*half nar sp*/ 0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0, 20, /*registered*/ 20, /*copyright*/ 0, 19, /*cent*/ }; /* Modified for Commercial II and with +, -, and = for equations */ char W4[256-32] = { /*Special font widths*/ 0,0, /*.=Sw+042-40*/ 13, /*"*/ 29, /*#*/ 0,0,0,0, /*.=Sw+074-40*/ 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0, 36, /*<*/ 0, /*.=Sw+076-40*/ 36, /*>*/ 0, /*.=Sw+100-40*/ 36, /*@*/ 0,0,0,0,0,0,0, /*.=Sw+134-40*/ 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0, 15, /*\\*/ 0, /*.=Sw+136-40*/ 15, /*^*/ 18, /*_ underrule*/ 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0, 14, /*{*/ 0, /*.=Sw+175-40*/ 14, /*}*/ 15, /*~*/ 0, /*.=Sw+220-40*/ 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 17, /*section*/ 0, /*.=Sw+222-40*/ 10, /*acute accent*/ 10, /*grave accent*/ 18, /*underrule*/ 15, /*slash (longer)*/ 0, /**/ 0, /**/ 24, /*alpha*/ 23+0300, /*beta*/ 23+0100, /*gamma*/ 19+0200, /*delta*/ 18, /*epsilon*/ 18+0300, /*zeta*/ 23+0100, /*eta*/ 19+0200, /*theta*/ 13, /*iota*/ 21, /*kappa*/ 22+0200, /*lambda*/ 25+0100, /*mu*/ 20, /*nu*/ 20+0300, /*xi*/ 20, /*omicron*/ 27, /*pi*/ 21+0100, /*rho*/ 27, /*sigma*/ 20, /*tau*/ 21, /*upsilon*/ 25+0300, /*phi*/ 22+0100, /*chi*/ 24+0300, /*psi*/ 25, /*omega*/ 24+0200, /*Gamma*/ 26+0200, /*Delta*/ 28+0200, /*Theta*/ 28+0200, /*Lambda*/ 27+0200, /*Xi*/ 29+0200, /*Pi*/ 25+0200, /*Sigma*/ 0, /**/ 28+0200, /*Upsilon*/ 29+0200, /*Phi*/ 32+0200, /*Psi*/ 36+0200, /*Omega*/ 30, /*square root*/ 18+0100, /*terminal sigma*/ 18, /*root en*/ 36, /*>=*/ 36, /*<=*/ 36, /*identically equal*/ 27, /*minus*/ 36, /*approx =*/ 36, /*approximates*/ 36, /*not equal*/ 36, /*right arrow*/ 36, /*left arrow*/ 18, /*up arrow*/ 18, /*down arrow*/ 27, /*equal*/ 27, /*multiply*/ 27, /*divide*/ 36, /*plus-minus*/ 36, /*cup (union)*/ 36, /*cap (intersection)*/ 36, /*subset of*/ 36, /*superset of*/ 36, /*improper subset*/ 36, /*improper superset*/ 34, /*infinity*/ 21, /*partial derivative*/ 36+0200, /*gradient*/ 22, /*not*/ 24, /*integral sign*/ 27, /*proportional to*/ 28, /*empty set*/ 27, /*member of*/ 27, /*plus*/ 0, 0, 0, /*box vert rule (was 2.)*/ 0, 17, /*dbl dagger*/ 42, /*right hand*/ 42, /*left hand*/ 16, /*math * */ 41, /*bell system sign*/ 9, /*or*/ 27, /*circle*/ 9, /*left top (of big curly)*/ 9, /*left bottom*/ 9, /*right top*/ 9, /*right bot*/ 9, /*left center of big curly bracket*/ 9, /*right center of big curly bracket*/ 9, /*bold vertical*/ 9, /*left floor (left bot of big sq bract)*/ 9, /*right floor (rb of ")*/ 9, /*left ceiling (lt of ")*/ 9 }; /*right ceiling (rt of ")*/ /*plus*/ 0, 0, 0, /*box vert rule (was 2.)*/ 0, 17, /*dbl dagger*/ 42, /*right hand*/ 42, /*left hand*/ 16, /*math * */ 41, /*bell system sign*/ 9, /*or*/ 27, /*circle*/ 9, /*left top (of big curly)*/ 9, /*left bottom*/ 9, /*right top*/ 9, /*right bot*/ 9, /*left center of big curly bracket*/ 9, /*right center of big curly bracket*/ 9, /*bold vertical*/ 9, /*left floor (left bot of big sq bract)*/ 9, /*right floor (rb of ")*/ 9, /*left ceiling (lt of ")*/ 9 };cmd/troff/tdef.h 644 0 33 6726 2346517354 7035 #include #define BUFSIZ BSIZE #undef BMASK #define MAXPTR 0x7fffffff /* max value of any pointer variable */ #ifdef NROFF /*NROFF*/ #define EM t.Em #define HOR t.Hor #define VERT t.Vert #define INCH 240 /*increments per inch*/ #define SPS INCH/10 /*space size*/ #define SS INCH/10 /* " */ #define TRAILER 0 #define UNPAD 0227 #define PO 0 /*page offset*/ #define ASCII 1 #define PTID 1 #define LG 0 #define DTAB 0 /*set at 8 Ems at init time*/ #define ICS 2*SPS #define TEMP 256 /*65K*/ #endif #ifndef NROFF /*TROFF*/ #define INCH 432 /*troff resolution*/ #define SPS 20 /*space size at 10pt; 1/3 Em*/ #define SS 12 /*space size in 36ths of an em*/ #define TRAILER 6048 /*144*14*3 = 14 inches*/ #define UNPAD 027 #define PO 416 /*page offset 26/27ths inch*/ #define HOR 1 #define VERT 3 #define EM (6*(pts&077)) #define ASCII 0 #define PTID 0 #define LG 1 #define DTAB (INCH/2) #define ICS 3*SPS #define TEMP 512 /*128K*/ #endif #include #define NARSP 0177 /*narrow space*/ #define HNSP 0226 /*half narrow space*/ #define PS 10 /*default point size*/ #define FT 0 /*default font position*/ #define LL 65*INCH/10 /*line length; 39picas=6.5in*/ #define VS INCH/6 /*vert space; 12points*/ /* #define NN 132 /*number registers*/ #define NN 528 #define NNAMES 14 /*predefined reg names*/ #define NIF 15 /*if-else nesting*/ #define NS 64 /*name buffer*/ #define NTM 256 /*tm buffer*/ #define NEV 3 /*environments*/ #define EVLSZ 10 /*size of ev stack*/ #define EVS 3*256 /*environment size in words*/ /* #define EVS 4*256 */ #define NM 300 /*requests + macros*/ #define DELTA 512 /*delta core bytes*/ #define NHYP 10 /*max hyphens per word*/ #define NHEX 128 /*byte size of exception word list*/ #define NTAB 35 /*tab stops*/ #define NSO 5 /*"so" depth*/ #define WDSIZE 170 /*word buffer size*/ #define LNSIZE 480 /*line buffer size*/ /* #define LNSIZE 680 */ #define NDI 5 /*number of diversions*/ #define DBL 0100000 /*double size indicator*/ #define MOT 0100000 /*motion character indicator*/ #define MOTV 0160000 /*clear for motion part*/ #define VMOT 0040000 /*vert motion bit*/ #define NMOT 0020000 /* negative motion indicator*/ #define MMASK 0100000 /*macro mask indicator*/ #define CMASK 0100377 #define ZBIT 0400 /*zero width char*/ #define BMASK 0377 #define BYTE 8 #define IMP 004 /*impossible char*/ #define FILLER 037 #define PRESC 026 #define HX 0376 /*High-order part of xlss*/ #define LX 0375 /*low-order part of xlss*/ #define CONT 025 #define COLON 013 #define XPAR 030 #define ESC 033 #define FLSS 031 #define RPT 014 #define JREG 0374 #define NTRAP 20 /*number of traps*/ #define NPN 20 /*numbers in "-o"*/ #define T_PAD 0101 /*cat padding*/ #define T_INIT 0100 #define T_IESC 16 /*initial offset*/ #define T_STOP 0111 #define NPP 10 /*pads per field*/ #define FBUFSZ 256 /*field buf size words*/ #define OBUFSZ BUFSIZ /*bytes*/ #define IBUFSZ BUFSIZ /*bytes*/ #define NC 256 /*cbuf size words*/ #define NOV 10 /*number of overstrike chars*/ #define ZONE 5 /*5hrs for EST*/ #define TDELIM 032 #define LEFT 035 #define RIGHT 036 #define LEADER 001 #define TAB 011 #define TMASK 037777 #define RTAB 0100000 #define CTAB 0040000 #define OHC 024 #define PAIR(A,B) (A|(B< #define NARSP 0177 /*narrow space*/ #define HNSP 0226 /*half narrow space*/ #define PS 10 /*default point size*/ #define FT 0 /*default font position*/ #define LL 65*INCH/10 /*line length; 39picas=6.5in*/ #define VS INCH/6 /*vert space; 12points*/ #ifdef VMUNIX #define NN 528 /*number registers*/ #else #define NN 132 /*number registers*/ #endif /* #define NN 200 */ #define NNAMES 14 /*predefined reg names*/ #define NIF 15 /*if-else nesting*/ #define NS 64 /*name buffer*/ #define NTM 256 /*tm buffer*/ #define NEV 3 /*environments*/ #define EVLSZ 10 /*size of ev stack*/ /* #define EVS 4*256 */ #ifdef VMUNIX #define NM 600 #((define EVS 6*256 /*environment size in words*/ #else #define NM 300 /*requests + macros*/ #define EVS 3*256 /*environment size in words*/ #endif #define DELTA 512 /*delta core bytes*/ #define NHYP 10 /*max hyphens per word*/ #define NHEX 128 /*byte size of exception word list*/ #define NTAB 35 /*tab stops*/ #define NSO 5 /*"so" depth*/ #ifdef VMUNIX #define WDSIZE 340 /*word buffer size*/ #define LNSIZE 960 /*line buffer size*/ #else #define WDSIZE 170 /*word buffer size*/ #define LNSIZE 480 /*line buffer size*/ #endif /* #define LNSIZE 680 */ #define NDI 5 /*number of diversions*/ #define DBL 0100000 /*double size indicator*/ #define MOT 0100000 /*motion character indicator*/ #define MOTV 0160000 /*clear for motion part*/ #define VMOT 0040000 /*vert motion bit*/ #define NMOT 0020000 /* negative motion indicator*/ #define MMASK 0100000 /*macro mask indicator*/ #define CMASK 0100377 #define ZBIT 0400 /*zero width char*/ #define BMASK 0377 #define BYTE 8 #define IMP 004 /*impossible char*/ #define FILLER 037 #define PRESC 026 #define HX 0376 /*High-order part of xlss*/ #define LX 0375 /*low-order part of xlss*/ #define CONT 025 #define COLON 013 #define XPAR 030 #define ESC 033 #define FLSS 031 #define RPT 014 #define JREG 0374 #define NTRAP 20 /*number of traps*/ #define NPN 20 /*numbers in "-o"*/ #define T_PAD 0101 /*cat padding*/ #define T_INIT 0100 #define T_IESC 16 /*initial offset*/ #define T_STOP 0111 #define NPP 10 /*pads per field*/ #ifdef VMUNIX #define FBUFSZ 1024 #else #define FBUFSZ 256 /*field buf size words*/ #endif #define OBUFSZ 512 /*bytes*/ #define IBUFSZ 512 /*bytes*/ #define NC 256 /*cbuf size words*/ #define NOV 10 /*number of overstrike chars*/ #define ZONE 5 /*5hrs for EST*/ #define TDELIM 032 #define LEFT 035 #define RIGHT 036 #define LEADER 001 #define TAB 011 #define TMASK 037777 #define RTAB 0100000 #define CTAB 0040000 #define OHC 024 #define PAIR(A,B) (A|(B<", /*>*/ "\001?", /*?*/ "\001@", /*@*/ "\201A", /*A*/ "\201B", /*B*/ "\201C", /*C*/ "\201D", /*D*/ "\201E", /*E*/ "\201F", /*F*/ "\201G", /*G*/ "\201H", /*H*/ "\201I", /*I*/ "\201J", /*J*/ "\201K", /*K*/ "\201L", /*L*/ "\201M", /*M*/ "\201N", /*N*/ "\201O", /*O*/ "\201P", /*P*/ "\201Q", /*Q*/ "\201R", /*R*/ "\201S", /*S*/ "\201T", /*T*/ "\201U", /*U*/ "\201V", /*V*/ "\201W", /*W*/ "\201X", /*X*/ "\201Y", /*Y*/ "\201Z", /*Z*/ "\001[", /*[*/ "\001\\", /*\*/ "\001]", /*]*/ "\001^", /*^*/ "\001_", /*_ dash*/ "\001`", /*` open*/ "\201a", /*a*/ "\201b", /*b*/ "\201c", /*c*/ "\201d", /*d*/ "\201e", /*e*/ "\201f", /*f*/ "\201g", /*g*/ "\201h", /*h*/ "\201i", /*i*/ "\201j", /*j*/ "\201k", /*k*/ "\201l", /*l*/ "\201m", /*m*/ "\201n", /*n*/ "\201o", /*o*/ "\201p", /*p*/ "\201q", /*q*/ "\201r", /*r*/ "\201s", /*s*/ "\201t", /*t*/ "\201u", /*u*/ "\201v", /*v*/ "\201w", /*w*/ "\201x", /*x*/ "\201y", /*y*/ "\201z", /*z*/ "\001{", /*{*/ "\001|", /*|*/ "\001}", /*}*/ "\001~", /*~*/ "\000\0", /*narrow sp*/ "\001-", /*hyphen*/ "\001o\b+", /*bullet*/ "\002[]", /*square*/ "\001-", /*3/4 em*/ "\001_", /*rule*/ "\0031/4", /*1/4*/ "\0031/2", /*1/2*/ "\0033/4", /*3/4*/ "\001-", /*minus*/ "\202fi", /*fi*/ "\202fl", /*fl*/ "\202ff", /*ff*/ "\203ffi", /*ffi*/ "\203ffl", /*ffl*/ "\000\0", /*degree*/ "\000\0", /*dagger*/ "\000\0", /*section*/ "\001'", /*foot mark*/ "\001'", /*acute accent*/ "\001`", /*grave accent*/ "\001_", /*underrule*/ "\001/", /*slash (longer)*/ "\000\0", /*half narrow space*/ "\001 ", /*unpaddable space*/ "\201\016A\017", /*alpha*/ "\201\016B\017", /*beta*/ "\201\016\\\017", /*gamma*/ "\201\016D\017", /*delta*/ "\201\016S\017", /*epsilon*/ "\201\016Q\017", /*zeta*/ "\201\016N\017", /*eta*/ "\201\016O\017", /*theta*/ "\201i", /*iota*/ "\201k", /*kappa*/ "\201\016L\017", /*lambda*/ "\201\016M\017", /*mu*/ "\201\016@\017", /*nu*/ "\201\016X\017", /*xi*/ "\201o", /*omicron*/ "\201\016J\017", /*pi*/ "\201\016K\017", /*rho*/ "\201\016Y\017", /*sigma*/ "\201\016I\017", /*tau*/ "\201v", /*upsilon*/ "\201\016U\017", /*phi*/ "\201x", /*chi*/ "\201\016V\017", /*psi*/ "\201\016C\017", /*omega*/ "\201\016G\017", /*Gamma*/ "\201\016W\017", /*Delta*/ "\201\016T\017", /*Theta*/ "\201\016E\017", /*Lambda*/ "\000\0", /*Xi*/ "\201\016P\017", /*Pi*/ "\201\016R\017", /*Sigma*/ "\000\0", /**/ "\201Y", /*Upsilon*/ "\201\016F\017", /*Phi*/ "\201\016H\017", /*Psi*/ "\201\016Z\017", /*Omega*/ "\000\0", /*square root*/ "\000\0", /*terminal sigma*/ "\000\0", /*root en*/ "\001>\b_", /*>=*/ "\001<\b_", /*<=*/ "\001=\b_", /*identically equal*/ "\001-", /*equation minus*/ "\001=\b~", /*approx =*/ "\001\0339~\0338", /*approximates*/ "\001=\b/", /*not equal*/ "\002->", /*right arrow*/ "\002<-", /*left arrow*/ "\001|\b^", /*up arrow*/ "\000\0", /*down arrow*/ "\001=", /*equation equal*/ "\001x", /*multiply*/ "\001/", /*divide*/ "\001+\b_", /*plus-minus*/ "\001U", /*cup (union)*/ "\000\0", /*cap (intersection)*/ "\000\0", /*subset of*/ "\000\0", /*superset of*/ "\000\0", /*improper subset*/ "\000\0", /* improper superset*/ "\002oo", /*infinity*/ "\001\016]\017", /*partial derivative*/ "\001\016[\017", /*gradient*/ "\001\016_\017", /*not*/ "\001\016^\017", /*integral sign*/ "\000\0", /*proportional to*/ "\000\0", /*empty set*/ "\000\0", /*member of*/ "\001+", /*equation plus*/ "\001\0338r\0339", /*registered*/ "\001\0338c\0339", /*copyright*/ "\001|", /*box rule */ "\001c\b/", /*cent sign*/ "\000\0", /*dbl dagger*/ "\000\0", /*right hand*/ "\001*", /*left hand*/ "\001*", /*math * */ "\000\0", /*bell system sign*/ "\001|", /*or (was star)*/ "\001O", /*circle*/ "\001|", /*left top (of big curly)*/ "\001|", /*left bottom*/ "\001|", /*right top*/ "\001|", /*right bot*/ "\001|", /*left center of big curly bracket*/ "\001|", /*right center of big curly bracket*/ "\001|", /*bold vertical*/ "\001|", /*left floor (left bot of big sq bract)*/ "\001|", /*right floor (rb of ")*/ "\001|", /*left ceiling (lt of ")*/ "\001|"}; /*right ceiling (rt of ")*/ /*left hand*/ "\001*", /*math * */ "\000\0", /*bell system sign*/ "\001|", /*or (was star)*/ "\001O", /*circle*/ "\001|", /*left top (of big curly)*/ "\001|", /*left bottom*/ "\001|", /*right top*/ "\001|", /*right bot*/ "\001|", /*left center of big curly bracket*/ "\001|", /*right center of big curly brac((cmd/troff/term/tabtn300.c 644 0 33 11566 2111463517 10415 #define INCH 240 /* TTY M37 nroff driving tables width and code tables */ struct { int bset; int breset; int Hor; int Vert; int Newline; int Char; int Em; int Halfline; int Adj; char *twinit; char *twrest; char *twnl; char *hlr; char *hlf; char *flr; char *bdon; char *bdoff; char *ploton; char *plotoff; char *up; char *down; char *right; char *left; char *codetab[256-32]; int zzz; } t = { /*bset*/ 0, /*breset*/ 0, /*Hor*/ INCH/10, /*Vert*/ INCH/6, /*Newline*/ INCH/6, /*Char*/ INCH/10, /*Em*/ INCH/10, /*Halfline*/ INCH/12, /*Adj*/ INCH/10, /*twinit*/ "", /*twrest*/ "", /*twnl*/ "\n", /*hlr*/ "", /*hlf*/ "", /*flr*/ "", /*bdon*/ "", /*bdoff*/ "", /*ploton*/ "", /*plotoff*/ "", /*up*/ "", /*down*/ "", /*right*/ "", /*left*/ "", /*codetab*/ "\001 ", /*space*/ "\001!", /*!*/ "\001\"", /*"*/ "\001#", /*#*/ "\001$", /*$*/ "\001%", /*%*/ "\001&", /*&*/ "\001'", /*' close*/ "\001(", /*(*/ "\001)", /*)*/ "\001*", /***/ "\001+", /*+*/ "\001,", /*,*/ "\001-", /*- hyphen*/ "\001.", /*.*/ "\001/", /*/*/ "\2010", /*0*/ "\2011", /*1*/ "\2012", /*2*/ "\2013", /*3*/ "\2014", /*4*/ "\2015", /*5*/ "\2016", /*6*/ "\2017", /*7*/ "\2018", /*8*/ "\2019", /*9*/ "\001:", /*:*/ "\001;", /*;*/ "\001<", /*<*/ "\001=", /*=*/ "\001>", /*>*/ "\001?", /*?*/ "\001@", /*@*/ "\201A", /*A*/ "\201B", /*B*/ "\201C", /*C*/ "\201D", /*D*/ "\201E", /*E*/ "\201F", /*F*/ "\201G", /*G*/ "\201H", /*H*/ "\201I", /*I*/ "\201J", /*J*/ "\201K", /*K*/ "\201L", /*L*/ "\201M", /*M*/ "\201N", /*N*/ "\201O", /*O*/ "\201P", /*P*/ "\201Q", /*Q*/ "\201R", /*R*/ "\201S", /*S*/ "\201T", /*T*/ "\201U", /*U*/ "\201V", /*V*/ "\201W", /*W*/ "\201X", /*X*/ "\201Y", /*Y*/ "\201Z", /*Z*/ "\001[", /*[*/ "\001\\", /*\*/ "\001]", /*]*/ "\001^", /*^*/ "\001_", /*_ dash*/ "\001`", /*` open*/ "\201a", /*a*/ "\201b", /*b*/ "\201c", /*c*/ "\201d", /*d*/ "\201e", /*e*/ "\201f", /*f*/ "\201g", /*g*/ "\201h", /*h*/ "\201i", /*i*/ "\201j", /*j*/ "\201k", /*k*/ "\201l", /*l*/ "\201m", /*m*/ "\201n", /*n*/ "\201o", /*o*/ "\201p", /*p*/ "\201q", /*q*/ "\201r", /*r*/ "\201s", /*s*/ "\201t", /*t*/ "\201u", /*u*/ "\201v", /*v*/ "\201w", /*w*/ "\201x", /*x*/ "\201y", /*y*/ "\201z", /*z*/ "\001{", /*{*/ "\001|", /*|*/ "\001}", /*}*/ "\001~", /*~*/ "\000\0", /*nar sp*/ "\001-", /*hyphen*/ "\001o\b+", /*bullet*/ "\002[]", /*square*/ "\001-", /*3/4 em*/ "\001_", /*rule*/ "\000\0", /*1/4*/ "\000\0", /*1/2*/ "\000\0", /*3/4*/ "\001-", /*minus*/ "\202fi", /*fi*/ "\202fl", /*fl*/ "\202ff", /*ff*/ "\203ffi", /*ffi*/ "\203ffl", /*ffl*/ "\000\0", /*degree*/ "\000\0", /*dagger*/ "\000\0", /*section*/ "\001'", /*foot mark*/ "\001'", /*acute accent*/ "\001`", /*grave accent*/ "\001_", /*underrule*/ "\001/", /*slash (longer)*/ "\000\0", /*half narrow space*/ "\001 ", /*unpaddable space*/ "\000", /*alpha*/ "\000", /*beta*/ "\000", /*gamma*/ "\000", /*delta*/ "\000", /*epsilon*/ "\000", /*zeta*/ "\000", /*eta*/ "\000", /*theta*/ "\201i", /*iota*/ "\201k", /*kappa*/ "\000", /*lambda*/ "\000", /*mu*/ "\000", /*nu*/ "\000", /*xi*/ "\201o", /*omicron*/ "\000", /*pi*/ "\000", /*rho*/ "\000", /*sigma*/ "\000", /*tau*/ "\201v", /*upsilon*/ "\000", /*phi*/ "\201x", /*chi*/ "\000", /*psi*/ "\000", /*omega*/ "\000", /*Gamma*/ "\000", /*Delta*/ "\000", /*Theta*/ "\000", /*Lambda*/ "\000\0", /*Xi*/ "\000", /*Pi*/ "\000", /*Sigma*/ "\000\0", /**/ "\201Y", /*Upsilon*/ "\000", /*Phi*/ "\000", /*Psi*/ "\000", /*Omega*/ "\000\0", /*square root*/ "\000\0", /*terminal sigma*/ "\000\0", /*root en*/ "\001>\b_", /*>=*/ "\001<\b_", /*<=*/ "\001=\b_", /*identically equal*/ "\001-", /*equation minus*/ "\001=\b~", /*approx =*/ "\000\0", /*approximates*/ "\001=\b/", /*not equal*/ "\002->", /*right arrow*/ "\002<-", /*left arrow*/ "\001|\b^", /*up arrow*/ "\000\0", /*down arrow*/ "\001=", /*equation equal*/ "\001x", /*multiply*/ "\001/", /*divide*/ "\001+\b_", /*plus-minus*/ "\001U", /*cup (union)*/ "\000\0", /*cap (intersection)*/ "\000\0", /*subset of*/ "\000\0", /*superset of*/ "\000\0", /*improper subset*/ "\000\0", /* improper superset*/ "\002oo", /*infinity*/ "\000", /*partial derivative*/ "\000", /*gradient*/ "\000", /*not*/ "\000", /*integral sign*/ "\000\0", /*proportional to*/ "\000\0", /*empty set*/ "\000\0", /*member of*/ "\001+", /*equation plus*/ "\001r\bO", /*registered*/ "\001c\bO", /*copyright*/ "\001|", /*box rule */ "\001c\b/", /*cent sign*/ "\000\0", /*dbl dagger*/ "\000\0", /*right hand*/ "\001*", /*left hand*/ "\001*", /*math * */ "\000\0", /*bell system sign*/ "\001|", /*or (was star)*/ "\001O", /*circle*/ "\001|", /*left top (of big curly)*/ "\001|", /*left bottom*/ "\001|", /*right top*/ "\001|", /*right bot*/ "\001|", /*left center of big curly bracket*/ "\001|", /*right center of big curly bracket*/ "\001|", /*bold vertical*/ "\001|", /*left floor (left bot of big sq bract)*/ "\001|", /*right floor (rb of ")*/ "\001|", /*left ceiling (lt of ")*/ "\001|"}; /*right ceiling (rt of ")*/ /*left hand*/ "\001*", /*math * */ "\000\0", /*bell system sign*/ "\001|", /*or (was star)*/ "\001O", /*circle*/ "\001|", /*left topcmd/troff/term/Makefile 644 0 33 2104 2413343443 10322 CFLAGS=-O all: tab300 tab300S tab300X tab300s tab37 tab450-12 tab450 tab450X tab450-12-8 all: tabtn300 tabx1700 tab300: tab300.o mv tab300.o tab300 tab300S: tab300S.o mv tab300S.o tab300S tab300X: tab300X.o mv tab300X.o tab300X tab300s: tab300s.o mv tab300s.o tab300s tab37: tab37.o mv tab37.o tab37 tab450-12: tab450-12.o mv tab450-12.o tab450-12 tab450: tab450.o mv tab450.o tab450 tab450X: tab450X.o mv tab450X.o tab450X tab450-12-8: tab450-12-8.o mv tab450-12-8.o tab450-12-8 tabtn300: tabtn300.o mv tabtn300.o tabtn300 tabx1700: tabx1700.o mv tabx1700.o tabx1700 install: install tab300 $(DESTDIR)/usr/lib/term install tab300S $(DESTDIR)/usr/lib/term install tab300X $(DESTDIR)/usr/lib/term install tab300s $(DESTDIR)/usr/lib/term install tab37 $(DESTDIR)/usr/lib/term install tab450-12-8 $(DESTDIR)/usr/lib/term install tab450-12 $(DESTDIR)/usr/lib/term install tab450 $(DESTDIR)/usr/lib/term install tab450X $(DESTDIR)/usr/lib/term install tabtn300 $(DESTDIR)/usr/lib/term install tabx1700 $(DESTDIR)/usr/lib/term -rm -f ../term.done clean: : already clean install: install tab300 $(DESTDIR)/usr/lib/term install tab300S $(DESTDIR)/usr/lib/term install tab300X $(DESTDIR)/usr/lib/term install tab300s $(DESTDIR)/usr/lib/term install tab37 $(DESTDIR)/usr/lib/term install tab450-12-8 $(DESTDIR)/usr/lib/term install tab450-12 $(DESTDIR)/usr/lib/term install tab450 $(DESTDIR)/usr/lib/term install tab450X $(DESTDIR)/usr/lib/term install tabtn300 $(DESTDIR)/usr/lib/term install tabx1700 $(Dcmd/troff/term/code.300 644 0 33 11375 2111463517 10052 "\001 ", /*space*/ "\001!", /*!*/ "\001\"", /*"*/ "\001#", /*#*/ "\001$", /*$*/ "\001%", /*%*/ "\001&", /*&*/ "\001'", /*' close*/ "\001(", /*(*/ "\001)", /*)*/ "\001*", /***/ "\001+", /*+*/ "\001,", /*,*/ "\001-", /*- hyphen*/ "\001.", /*.*/ "\001/", /*/*/ "\2010", /*0*/ "\2011", /*1*/ "\2012", /*2*/ "\2013", /*3*/ "\2014", /*4*/ "\2015", /*5*/ "\2016", /*6*/ "\2017", /*7*/ "\2018", /*8*/ "\2019", /*9*/ "\001:", /*:*/ "\001;", /*;*/ "\001<", /*<*/ "\001=", /*=*/ "\001>", /*>*/ "\001?", /*?*/ "\001@", /*@*/ "\201A", /*A*/ "\201B", /*B*/ "\201C", /*C*/ "\201D", /*D*/ "\201E", /*E*/ "\201F", /*F*/ "\201G", /*G*/ "\201H", /*H*/ "\201I", /*I*/ "\201J", /*J*/ "\201K", /*K*/ "\201L", /*L*/ "\201M", /*M*/ "\201N", /*N*/ "\201O", /*O*/ "\201P", /*P*/ "\201Q", /*Q*/ "\201R", /*R*/ "\201S", /*S*/ "\201T", /*T*/ "\201U", /*U*/ "\201V", /*V*/ "\201W", /*W*/ "\201X", /*X*/ "\201Y", /*Y*/ "\201Z", /*Z*/ "\001[", /*[*/ "\001\\", /*\*/ "\001]", /*]*/ "\001^", /*^*/ "\001_", /*_ dash*/ "\001`", /*` open*/ "\201a", /*a*/ "\201b", /*b*/ "\201c", /*c*/ "\201d", /*d*/ "\201e", /*e*/ "\201f", /*f*/ "\201g", /*g*/ "\201h", /*h*/ "\201i", /*i*/ "\201j", /*j*/ "\201k", /*k*/ "\201l", /*l*/ "\201m", /*m*/ "\201n", /*n*/ "\201o", /*o*/ "\201p", /*p*/ "\201q", /*q*/ "\201r", /*r*/ "\201s", /*s*/ "\201t", /*t*/ "\201u", /*u*/ "\201v", /*v*/ "\201w", /*w*/ "\201x", /*x*/ "\201y", /*y*/ "\201z", /*z*/ "\001{", /*{*/ "\001|", /*|*/ "\001}", /*}*/ "\001~", /*~*/ "\000\0", /*narrow sp*/ "\001-", /*hyphen*/ "\001o\b+", /*bullet*/ "\002[]", /*square*/ "\001-", /*3/4 em*/ "\001_", /*rule*/ "\000\0", /*1/4*/ "\000\0", /*1/2*/ "\000\0", /*3/4*/ "\001-", /*minus*/ "\202fi", /*fi*/ "\202fl", /*fl*/ "\202ff", /*ff*/ "\203ffi", /*ffi*/ "\203ffl", /*ffl*/ "\000\0", /*degree*/ "\000\0", /*dagger*/ "\000\0", /*section*/ "\001'", /*foot mark*/ "\001'", /*acute accent*/ "\001`", /*grave accent*/ "\001_", /*underrule*/ "\001/", /*slash (longer)*/ "\000\0", /*half narrow space*/ "\001 ", /*unpaddable space*/ "\001\241c\202(\241", /*alpha*/ (("\001\200B\242\302|\202\342", /*beta*/ "\001\200)\201/\241", /*gamma*/ "\001\200o\342<\302", /*delta*/ "\001<\b-", /*epsilon*/ "\001\200c\201\301,\241\343<\302", /*zeta*/ "\001\200n\202\302|\242\342", /*eta*/ "\001O\b-", /*theta*/ "\001i", /*iota*/ "\001k", /*kappa*/ "\001\200\\\304\241'\301\241'\345\202", /*lambda*/ "\001\200u\242,\202", /*mu*/ "\001\241(\203/\242", /*nu*/ "\001\200c\201\301,\241\343c\241\301`\201\301", /*xi*/ "\001o", /*omicron*/ "\001\341-\303\"\301\"\343", /*pi*/ "\001\200o\242\302|\342\202", /*rho*/ "\001\200o\301\202~\341\242", /*sigma*/ "\001\200t\301\202~\243~\201\341", /*tau*/ "\001v", /*upsilon*/ "\001o\b/", /*phi*/ "\001x", /*chi*/ "\001\200/-\302\202'\244'\202\342", /*psi*/ "\001\241u\203u\242", /*omega*/ "\001\242|\202\343-\303\202`\242", /*Gamma*/ "\001\242/\303-\204-\343\\\242", /*Delta*/ "\001O\b=", /*Theta*/ "\001\242/\204\\\242", /*Lambda*/ "\000\0", /*Xi*/ "\001\242[]\204[]\242\343-\303", /*Pi*/ "\001\200>\302-\345-\303", /*Sigma*/ "\000\0", /**/ "\001Y", /*Upsilon*/ "\001o\b[\b]", /*Phi*/ "\001\200[]-\302\202'\244`\202\342", /*Psi*/ "\001\200O\302\241-\202-\241\342", /*Omega*/ "\000\0", /*square root*/ "\000\0", /*terminal sigma*/ "\000\0", /*root en*/ "\001>\b_", /*>=*/ "\001<\b_", /*<=*/ "\001=\b_", /*identically equal*/ "\001-", /*equation minus*/ "\001=\b~", /*approx =*/ "\000\0", /*approximates*/ "\001=\b/", /*not equal*/ "\002->", /*right arrow*/ "\002<-", /*left arrow*/ "\001|\b^", /*up arrow*/ "\000\0", /*down arrow*/ "\001=", /*equation equal*/ "\001x", /*multiply*/ "\001/", /*divide*/ "\001+\b_", /*plus-minus*/ "\001U", /*cup (union)*/ "\000\0", /*cap (intersection)*/ "\000\0", /*subset of*/ "\000\0", /*superset of*/ "\000\0", /*improper subset*/ "\000\0", /* improper superset*/ "\002oo", /*infinity*/ "\001\200o\201\301`\241\341`\241\341`\201\301", /*partial derivative*/ "\001\242\\\343-\204-\303/\242", /*gradient*/ "\001\200-\202\341,\301\242", /*not*/ "\001\200|'\202`\243\306'\241`\202\346", /*integral sign*/ "\000\0", /*proportional to*/ "\000\0", /*empty set*/ "\000\0", /*member of*/ "\001+", /*equation plus*/ "\001r\bO", /*registered*/ "\001c\bO", /*copyright*/ "\001|", /*box rule */ "\001c\b/", /*cent sign*/ "\000\0", /*dbl dagger*/ "\000\0", /*right hand*/ "\001*", /*left hand*/ "\001*", /*math * */ "\000\0", /*bell system sign*/ "\001|", /*or (was star)*/ "\001O", /*circle*/ "\001|", /*left top (of big curly)*/ "\001|", /*left bottom*/ "\001|", /*right top*/ "\001|", /*right bot*/ "\001|", /*left center of big curly bracket*/ "\001|", /*right center of big curly bracket*/ "\001|", /*bold vertical*/ "\001|", /*left floor (left bot of big sq bract)*/ "\001|", /*right floor (rb of ")*/ "\001|", /*left ceiling (lt of ")*/ "\001|"}; /*right ceiling (rt of ")*/ /*left hand*/ "\001*", /*math * */ "\000\0", /*bell system sign*/ "\001|", /*or (was star)*/ "\001O", /*circle*/ "\001|", /*left top (of big curly)*/ "\001|", /*left bottom*/ "\001|", /*right top*/ "\001|", /*right bot*/ "\001|", /*left center of bicmd/troff/term/tab450.c 644 0 33 1533 2111463517 10032 #define INCH 240 /* DASI450 nroff driving tables width and code tables */ struct { int bset; int breset; int Hor; int Vert; int Newline; int Char; int Em; int Halfline; int Adj; char *twinit; char *twrest; char *twnl; char *hlr; char *hlf; char *flr; char *bdon; char *bdoff; char *ploton; char *plotoff; char *up; char *down; char *right; char *left; char *codetab[256-32]; int zzz; } t = { /*bset*/ 0, /*breset*/ 0177420, /*Hor*/ INCH/60, /*Vert*/ INCH/48, /*Newline*/ INCH/6, /*Char*/ INCH/10, /*Em*/ INCH/10, /*Halfline*/ INCH/12, /*Adj*/ INCH/10, /*twinit*/ "\0334", /*twrest*/ "\0334", /*twnl*/ "\015\n", /*hlr*/ "\033D", /*hlf*/ "\033U", /*flr*/ "\033\n", /*bdon*/ "", /*bdoff*/ "", /*ploton*/ "\0333", /*plotoff*/ "\0334", /*up*/ "\033\n", /*down*/ "\n", /*right*/ " ", /*left*/ "\b", /*codetab*/ #include "code.300" ; char *right; char *left; char *codetab[256-32]; int zzz; } t = { /*bset*/ 0, /*breset*/ 0177420, /*Hor*/ INCH/60, /*Vert*/ INCH/48, /*Newline*/ INCH/6, /*Chacmd/troff/term/tab300.c 644 0 33 1515 2111463517 10024 #define INCH 240 /* DASI300 nroff driving tables width and code tables */ struct { int bset; int breset; int Hor; int Vert; int Newline; int Char; int Em; int Halfline; int Adj; char *twinit; char *twrest; char *twnl; char *hlr; char *hlf; char *flr; char *bdon; char *bdoff; char *ploton; char *plotoff; char *up; char *down; char *right; char *left; char *codetab[256-32]; int zzz; } t = { /*bset*/ 0, /*breset*/ 0177420, /*Hor*/ INCH/60, /*Vert*/ INCH/48, /*Newline*/ INCH/6, /*Char*/ INCH/10, /*Em*/ INCH/10, /*Halfline*/ INCH/12, /*Adj*/ INCH/10, /*twinit*/ "\007", /*twrest*/ "\007", /*twnl*/ "\015\n", /*hlr*/ "", /*hlf*/ "", /*flr*/ "\013", /*bdon*/ "", /*bdoff*/ "", /*ploton*/ "\006", /*plotoff*/ "\033\006", /*up*/ "\013", /*down*/ "\n", /*right*/ " ", /*left*/ "\b", /*codetab*/ #include "code.300" p; char *down; char *right; char *left; char *codetab[256-32]; int zzz; } t = { /*bset*/ 0, /*breset*/ 0177420, /*Hor*/ INCH/60, /*Vert*/ INCH/48, /*Newline*/ INCH/6, /*Chacmd/troff/term/tabx1700.c 644 0 33 1614 2161002426 10272 #define INCH 240 /* XEROX 1700 nroff driving tables width and code tables *** may not be complete & may print some greeks wrong *** */ struct { int bset; int breset; int Hor; int Vert; int Newline; int Char; int Em; int Halfline; int Adj; char *twinit; char *twrest; char *twnl; char *hlr; char *hlf; char *flr; char *bdon; char *bdoff; char *ploton; char *plotoff; char *up; char *down; char *right; char *left; char *codetab[256-32]; int zzz; } t { /*bset*/ 0, /*breset*/ 0177420, /*Hor*/ INCH/60, /*Vert*/ INCH/48, /*Newline*/ INCH/6, /*Char*/ INCH/10, /*Em*/ INCH/10, /*Halfline*/ INCH/12, /*Adj*/ INCH/10, /*twinit*/ "", /*twrest*/ "", /*twnl*/ "\015\n", /*hlr*/ "\033D", /*hlf*/ "\033U", /*flr*/ "\033\n", /*bdon*/ "", /*bdoff*/ "", /*ploton*/ "\0333", /*plotoff*/ "\0334", /*up*/ "\033\n", /*down*/ "\n", /*right*/ " ", /*left*/ "\b", /*codetab*/ #include "code.300" char *down; char *right; char *left; char *codetab[256-32]; int zzz; } t { /*bset*/ 0, /*breset*/ 0177420, /*cmd/troff/svt6.c 644 0 33 22727 2350156464 7023 #include "tdef.h" extern #include "d.h" extern #include "v.h" /* troff6.c width functions, sizes and fonts */ extern int inchar[LNSIZE], *pinchar; /* XXX */ extern int eschar; extern int widthp; extern int ohc; extern int xpts; extern int xfont; extern int code; extern int smnt; extern int setwdf; extern int cs; extern int ccs; extern int spacesz; extern char trtab[]; extern int xbitf; extern int mfont; extern int mpts; extern int pfont; extern int ppts; extern int oldbits; extern int chbits; extern int spbits; extern int nonumb; extern int noscale; extern int font; extern int font1; extern int pts; extern int pts1; extern int apts; extern int apts1; extern int sps; extern int nlflg; extern int nform; extern int dfact; extern int lss; extern int lss1; extern int vflag; extern int ch0; extern int lg; char fontfile[] = "/usr/lib/font/ftXX"; int ffi = 16; extern int bd; extern int level; extern int ch; extern int res; extern int ptid; extern char W1[],W2[],W3[],W4[]; extern int xxx; int trflg; char *fontab[] = {W1,W2,W3,W4}; int fontlab[] = {'R','I','B','S',0}; char pstab[] = {6,7,8,9,10,11,12,14,16,18,20,22,24,28,36,0}; char psctab[] = {010,000,001,007,002,003,004,005,0211,006, 0212,0213,0214,0215,0216,0}; int cstab[4], ccstab[4]; int bdtab[4]; int sbold = 0; int spsz = 0; struct fz { char sign; char size; int inc; } fz[4]; width(c) int c; { register i,j,k; j = c; k = 0; if(j & MOT){ if(j & VMOT)goto rtn; k = j & ~MOTV; if(j & NMOT)k = -k; goto rtn; } if((i = (j & CMASK)) == 010){ k = -widthp; goto rtn; } if(i == PRESC)i = eschar; if((i == ohc) || (i >= 0370))goto rtn; if((j>>BYTE) == oldbits){ xfont = pfont; xpts = ppts; }else xbits(j); if(j & ZBIT)goto rtn; if(!trflg)i = trtab[i] & BMASK; if((i -= 32) < 0)goto rtn; k = getcw(i); if(bd)k += bd - 1; if(cs)k = cs; widthp = k; rtn: xbitf = trflg = 0; return(k); } getcw(i) int i; { register j,k; register char *p; int x; extern char codetab[]; bd = 0; if((code = codetab[i]) & 0200){ if(smnt){ p = fontab[sm((nt-1]; if(xfont == (sbold-1))bd = bdtab[smnt-1]; goto g0; } code = 0; k = 36; goto g1; } p = fontab[xfont]; g0: if(!i)k = spacesz; else k = *(p + i) & BMASK; if(setwdf)v.ct |= ((k>>6) & 3); g1: k = (j = (k&077)*(xpts&077))/6; if((j%6) >= 3)k++; if(cs = cstab[xfont]){ if(ccs = ccstab[xfont])x = ccs; else x = xpts; cs = (j = (cs&077)*(x&077))/6; if((j%6) >= 3)cs++; } if(!bd)bd = bdtab[xfont]; return(k); } xbits(i) int i; { register j, k; /* if((j = i >> BYTE) == oldbits){ xfont = pfont; xpts = ppts; goto rtn; } */ j = i >> BYTE; xfont = (j>>1) & 03; if(k = (j>>3) & 017){ xpts = pstab[--k]; if(psctab[k] < 0)xpts |= DBL; oldbits = j; pfont = xfont; ppts = xpts; goto rtn; } switch(xbitf){ case 0: xfont = font; xpts = pts; break; case 1: xfont = pfont; xpts = ppts; break; case 2: xfont = mfont; xpts = mpts; } rtn: xbitf = 0; } setch(){ register i,*j,k; extern int chtab[]; if((i = getrq()) == 0)return(0); for(j=chtab;*j != i;j++)if(*(j++) == 0)return(0); k = *(++j) | chbits; /* if((i & CMASK) == '*'){ if(((i = find('R',fontlab)) < 0) && ((i = find('G',fontlab)) < 0)) return(k); else return((k & ~(03<<(BYTE+1))) | (i<<(BYTE+1))); } */ return(k); } find(i,j) int i,j[]; { register k; if(((k = i-'0') >= 1) && (k <= 4) && (k != smnt))return(--k); for(k=0; j[k] != i; k++)if(j[k] == 0)return(-1); return(k); } casefz(){ register i, j, k; int savinc; k = 0; fz0: if(skip() || !(i = getrq()) || ((j = find(i,fontlab)) == -1)){ if(k)goto fz1; else return; } if(j == (smnt-1)){ k = smnt; goto fz0; } if(k){ spsz = j + 1; j = k -1; } fz1: if((j==font) && fz[j].inc)savinc = fz[j].inc; else savinc = 0; fz[j].inc = fz[j].sign = fz[j].size = 0; if(skip()){ if(k)spsz = 0; goto fz2; } if(((i=((k=getch()) & CMASK)) == '+') || (i == '-'))fz[j].sign = i; else{ fz[j].sign = 0; ch = k; } noscale++; fz[j].size = atoi(); noscale = 0; fz2: if(j==font)casps1(apts + savinc); else if(j == smnt-1)mchbits(); } caseps(){ register i; if(skip())i = apts1; else{ noscale++; i = inumb(&apts); noscale = 0; if(nonumb)return; } casps1(i); } casps1(i) int i; { if(i <= 0)return; if(fz[font].size){ i = getfz(font, i); } apts1 = apts; apts = i; pts1 = pts; pts = findps(i & 077); mchbits(); } findps(i) int i; { register j, k; for(j=0; i > (k = pstab[j]);j++)if(!k){k=pstab[--j];break;} if(psctab[j] < 0)k |= DBL; return(k); } mchbits(){ register i, j, k; spbits = 0; i = pts & 077; for(j=0; i > (k = pstab[j]);j++)if(!k){k=pstab[--j];break;} chbits = (((++j)<<2) | font) << (BYTE + 1); sps = width(' ' | chbits); if(font == (spsz-1)){ i = findps(getfz(smnt-1, apts + fz[font].inc)); for(j=0; i > (k = pstab[j]);j++)if(!k){k=pstab[--j];break;} spbits = (((++j)<<2) | font) << (BYTE + 1); } } getfz(x,y) int x, y; { register i, j, k; i = fz[x].size; j = fz[x].sign; if(i || j){ if(j == '+')i += y; else if(j == '-')i = y - i; } fz[x].inc = y - i; return(i); } setps(){ register i,j; if((((i=getch() & CMASK) == '+') || (i == '-')) && (((j=(ch = getch() & CMASK) - '0') >= 0) && (j <= 9))){ if(i == '-')j = -j; ch = 0; casps1(apts+j); return; } if((i -= '0') == 0){ casps1(apts1); return; } if((i > 0) && (i <= 9)){ if((i <= 3) && ((j=(ch = getch() & CMASK) - '0') >= 0) && (j <= 9)){ i = 10*i +j; ch = 0; } casps1(i); } } caseft(){ skip(); setfont(1); } setfont(a) int a; { register i,j; if(a)i = getrq(); else i = getsn(); if(!i || (i == 'P')){ j = font1; goto s0; } if(i == 'S')return; if((j = find(i,fontlab)) == -1)return; s0: font1 = font; font = j; i = 0; if(fz[font1].size){ i++; casps1(apts + fz[font1].inc); }else if(fz[font].size){ i++; casps1(apts); } if(!i)mchbits(); } setwd(){ register i, base, wid; int delim, em, k; int savlevel, savhp, savapts, savapts1, savfont, savfont1, savpts, savpts1; base = v.st = v.sb = wid = v.ct = 0; if((delim = getch() & CMASK) & MOT)return; savhp = v.hp; savlevel = level; v.hp = level = 0; savapts = apts; savapts1 = apts1; savfont = font; savfont1 = font1; savpts = pts; savpts1 = pts1; setwdf++; while((((i = getch()) & CMASK) != delim) && !nlflg){ wid += width(i); if(!(i & MOT)){ em = (xpts & 077)*6; }else if(i & VMOT){ k = i & ~MOTV; if(i & NMOT)k = -k; base -= k; em = 0; }else continue; if(base < v.sb)v.sb = base; if((k=base + em) > v.st)v.st = k; } nform = 0; setn1(wid); v.hp = savhp; level = savlevel; apts = savapts; apts1 = savapts1; font = savfont; font1 = savfont1; pts = savpts; pts1 = savpts1; mchbits(); setwdf = 0; } vmot(){ dfact = lss; vflag++; return(mot()); } hmot(){ dfact = 6 * (pts & 077); return(mot()); } mot(){ register i, j; j = HOR; getch(); /*eat delim*/ if(i = atoi()){ if(vflag)j = VERT; i = makem(quant(i,j)); } getch(); vflag = 0; dfact = 1; return(i); } sethl(k) int k; { register i; i = 3 * (pts & 077); if(k == 'u')i = -i; else if(k == 'r')i = -2*i; vflag++; i = makem(i); vflag = 0; return(i); } makem(i) int i; { register j; if((j = i) < 0)j = -j; j = (j & ~MOTV) | MOT; if(i < 0)j |= NMOT; if(vflag)j |= VMOT; return(j); } getlg(i) int i; { register j, k; switch((j = getch0()) & CMASK){ case 'f': if(lg!=2){switch((k =getch0()) & CMASK){ case 'i': j = 0214; break; case 'l': j = 0215; break; default: ch0 = k; j = 0213; } }else j = 0213; break; case 'l': j = 0212; break; case 'i': j = 0211; break; default: ch0 = j; j = i; } return((i & ~CMASK) | j); } caselg(){ lg = 1; if(skip())return; lg = atoi(); } casefp(){ register i, j, k; int x; skip(); if(((i = (getch() & CMASK) - '0' -1) < 0) || (i >3)){prstr("fp: bad font position\n"); return;} if(skip() || !(j = getrq())){prstr("fp: no font name\n"); return;} fontfile[ffi] = j & BMASK; fontfile[ffi+1] = j>>BYTE; if((k = open(fontfile,0)) < 0){ prstr("Cannot open "); c0: prstr(fontfile); prstr("\n"); done(-1); } if(lseek(k,8L * sizeof(int),0) < 0)goto c1; if(read(k,fontab[i],256-32) != 256-32){ c1: prstr("Cannot read "); goto c0; } close(k); if(i == (smnt-1)){smnt = 0; sbold = 0; spsz = 0;} if((fontlab[i] = j) == 'S')smnt = i + 1; bdtab[i] = cstab[i] = ccstab[i] = 0; fz[i].inc = fz[i].sign = fz[i].size = 0; if(ptid != 1){ prstr("Mount font "); prstr(&fontfile[ffi]); prstr(" on "); x = PAIR((i + '1'),0); prstr((char *)&x); prstr("\n"); } } casecs(){ register i, j; noscale++; skip(); if(!(i=getrq()) || ((i = find(i,fontlab)) < 0))goto rtn; skip(); cstab[i] = atoi(); skip(); j = atoi(); if(!nonumb)ccstab[i] = findps(j); rtn: noscale = 0; } casebd(){ register i, j, k; k = 0; bd0: if(skip() || !(i = getrq()) || ((j = find(i,fontlab)) == -1)){ if(k)goto bd1; else return; } if(j == (smnt-1)){ k = smnt; goto bd0; } if(k){ sbold = j + 1; j = k -1; } bd1: skip(); noscale++; bdtab[j] = atoi(); noscale = 0; } casevs(){ register i; skip(); vflag++; dfact = 6; /*default scaling is points!*/ res = VERT; i = inumb(&lss); if(nonumb)i = lss1; if(i < VERT)i = VERT; lss1 = lss; lss = i; } casess(){ register i; noscale++; skip(); if(i = atoi()){ spacesz = i& 0177; sps = width(' ' | chbits); } noscale = 0; } xlss(){ register i, j; getch(); dfact = lss; i = quant(atoi(),VERT); dfact = 1; getch(); if((j = i) < 0)j = -j; ch0 = ((j & 03700)<<3) | HX; if(i < 0)ch0 |= 040000; return(((j & 077)<<9) | LX); } egister i; skip(); vflag++; dfact = 6cmd/comsat.c 444 0 33 11164 2424370562 6255 static char *sccsid = "@(#)comsat.c 4.2 (Berkeley) 10/20/80"; #include #include #include #include #include #include #include #include /* * comsat */ #define dprintf if (0) printf int xd; struct ctp { short ctrl; short ctrlarg; struct sgttyb ctrlv; } ctp; #define MAXUTMP 100 /* down from init */ struct utmp utmp[100]; int nutmp; int uf; unsigned utmpmtime; /* last modification time for utmp */ int onalrm(); #define NAMLEN (sizeof (uts[0].ut_name) + 1) main(argc, argv) char **argv; { register cc; char buf[BUFSIZ]; if (fork()) exit(); chdir("/usr/spool/mail"); if((uf = open("/etc/utmp",0)) < 0) perror("/etc/utmp"), exit(1); while (fork()) wait(0); sleep(10); onalrm(); sigset(SIGALRM, onalrm); sigignore(SIGTTOU); unlink("/dev/mail"); xd = mpx("/dev/mail", 0666); if (xd < 0) { close(2); open("/dev/console", 1); perror("/dev/mail"); exit(1); } while((cc=read(xd, buf, BUFSIZ)) >= 0) { dprintf("0: got %d bytes\n", cc); unpack(buf, cc); } _exit(1); } #define skip(rp, c) ((struct rh *)(((char *)rp)+c)) unpack(rp, cc) register struct rh *rp; { register struct rh *end; int i; i = 0; end = skip(rp, cc); while (rp < end) { dprintf("%d: ", ++i); if (rp->count==0) { dprintf("%d byte control message\n", rp->ccount); control(rp->index, rp+1, rp->ccount); } else { dprintf("%*.*s\n", rp->count, rp->count, rp+1); sighold(SIGALRM); mailfor(rp+1); sigrelse(SIGALRM); } rp->count += rp->ccount; if (rp->count & 1) rp->count++; rp = skip(rp, rp->count); rp++; } } control(x, cb, cc) register char *cb; { register char *end; int cmd; short *sp; struct wh or; end = cb + cc; cmd = *cb++; sp = (short *)cb+1; switch (cmd) { case M_WATCH: dprintf("attach %x, uid %d\n", x, *sp); attach(x, xd); break; case M_CLOSE: sp = (short *)cb; dprintf("detach %x, uid %d\n", x, *sp); detach(x, xd); break; case M_IOCTL: dprintf("ioctl %x\n", x); (( or.index = x; or.count = 0; or.ccount = sizeof ctp; or.data = (char *) &ctp.ctrlarg; ctp.ctrlarg = M_IOANS; write(xd, &or, sizeof or); break; default: dprintf("unknown command %d\n", cmd); return; } } onalrm() { struct stat statbf; struct utmp *utp; dprintf("alarm\n"); alarm(15); fstat(uf,&statbf); if (statbf.st_mtime > utmpmtime) { dprintf(" changed\n"); utmpmtime = statbf.st_mtime; lseek(uf, 0, 0); nutmp = read(uf,utmp,sizeof(utmp))/sizeof(struct utmp); } else dprintf(" ok\n"); } mailfor(name) char *name; { register struct utmp *utp = &utmp[nutmp]; register char *cp; char *rindex(); int offset; dprintf("mailfor %s\n", name); cp = name; while (*cp && *cp != '@') cp++; if (*cp == 0) { dprintf("bad format\n"); return; } *cp = 0; offset = atoi(cp+1); while (--utp >= utmp) if (!strncmp(utp->ut_name, name, sizeof(utmp[0].ut_name))) if (fork() == 0) { signal(SIGALRM, SIG_DFL); alarm(30); notify(utp, offset), exit(0); } else while (wait3(0, WNOHANG, 0) > 0) continue; } char *cr; notify(utp, offset) register struct utmp *utp; { FILE *tp; struct sgttyb gttybuf; char tty[20]; char name[sizeof (utmp[0].ut_name) + 1]; struct stat stb; strcpy(tty, "/dev/"); strncat(tty, utp->ut_line, sizeof(utp->ut_line)); dprintf("notify %s on %s\n", utp->ut_name, tty); if (stat(tty, &stb) == 0 && (stb.st_mode & 0100) == 0) { dprintf("wrong mode\n"); return; } if ((tp = fopen(tty,"w")) == 0) { dprintf("fopen failed\n"); return; } gtty(fileno(tp),>tybuf); cr = (gttybuf.sg_flags & CRMOD) ? "" : "\r"; strncpy(name, utp->ut_name, sizeof (utp->ut_name)); name[sizeof (name) - 1] = 0; fprintf(tp,"%s\n\007New mail for %s\007 has arrived:%s\n", cr, name, cr); fprintf(tp,"----%s\n", cr); jkfprintf(tp, name, offset); fclose(tp); } jkfprintf(tp, name, offset) register FILE *tp; { register FILE *fi; register int linecnt, charcnt; dprintf("HERE %s's mail starting at %d\n", name, offset); if ((fi = fopen(name,"r")) == NULL) { dprintf("Cant read the mail\n"); return; } fseek(fi, offset, 0); linecnt = 7; charcnt = 560; /* * print the first 7 lines or 560 characters of the new mail * (whichever comes first) */ for (;;) { register ch; if ((ch = getc(fi)) == EOF) { fprintf(tp,"----%s\n", cr); break; } if (ch == '\n') { fprintf(tp,"%s\n", cr); if (linecnt-- < 0) { fprintf(tp,"...more...%s\n", cr); break; } } else if(linecnt <= 0) { fprintf(tp,"...more...%s\n", cr); break; } else putc(ch, tp); if (charcnt-- == 0) { fprintf(tp, "%s\n", cr); break; } } } * print the first 7 lines or 560 characters of the new mail * (whichever comes first) */ for (;;) { register ch; if ((ch = getc(fi)) == EOF) { fprintf(tp,"----%s\n", cr); break; } if (ch == '\n') { fprintf(tp,"%s\n", cr); if (linecnt-- < 0) { fprintf(tp,"...more...%s\n", cr); break; } } else if(linecnt <= 0) { fprintf(tp,"...more...%s\n",cmd/whatis.c 444 0 33 4152 2416240322 6234 static char *sccsid = "@(#)whatis.c 4.1 (Berkeley) 10/1/80"; #include #include /* * whatis - what the heck is that file anyways * * Bill Joy UCB */ char *calloc(); char *trim(); unsigned blklen(); main(argc, argv) int argc; char *argv[]; { register char **avp; argc--, argv++; if (argc == 0) { fprintf(stderr, "whatis name ...\n"); exit(1); } if (freopen("/usr/lib/whatis", "r", stdin) == NULL) { perror("/usr/lib/whatis"); exit (1); } argv[argc] = 0; for (avp = argv; *avp; avp++) *avp = trim(*avp); whatis(argv); exit(0); } whatis(argv) char **argv; { char buf[BUFSIZ]; register char *gotit; register char **vp; gotit = calloc(1, blklen(argv)); while (fgets(buf, sizeof buf, stdin) != NULL) for (vp = argv; *vp; vp++) if (match(buf, *vp)) { printf("%s", buf); gotit[vp - argv] = 1; for (vp++; *vp; vp++) if (match(buf, *vp)) gotit[vp - argv] = 1; break; } for (vp = argv; *vp; vp++) if (gotit[vp - argv] == 0) printf("%s: not found\n", *vp); } match(buf, str) char *buf, *str; { register char *bp, *cp; bp = buf; again: cp = str; while (*bp && *cp && lmatch(*bp, *cp)) bp++, cp++; if (*cp == 0 && (*bp == '(' || *bp == ',' || *bp == '\t' || *bp == ' ')) return (1); while (isalpha(*bp) || isdigit(*bp)) bp++; if (*bp != ',') return (0); bp++; while (isspace(*bp)) bp++; goto again; } lmatch(c, d) char c, d; { if (c == d) return (1); if (!isalpha(c) || !isalpha(d)) return (0); if (islower(c)) c = toupper(c); if (islower(d)) d = toupper(d); return (c == d); } unsigned blklen(ip) register char **ip; { register int i = 0; while (*ip++) i++; return (i); } char * trim(cp) register char *cp; { register char *dp; for (dp = cp; *dp; dp++) if (*dp == '/') cp = dp + 1; if (cp[0] != '.') { if (cp + 3 <= dp && dp[-2] == '.' && any(dp[-1], "cosa12345678npP")) dp[-2] = 0; if (cp + 4 <= dp && dp[-3] == '.' && any(dp[-2], "13") && isalpha(dp[-1])) dp[-3] = 0; } return (cp); } any(c, cp) register int c; register char *cp; { while (*cp) if (c == *cp++) return (1); return (0); } { register int i = 0; while (*ip++) i++; return (i); } char * trim(cp) register char *cp; { register char *dp; for (dp = cp; *dp; dp++) if (*dp == '/') cp = dp + 1; if (cp[0] != '.') { if (cp + 3 <= dp && dp[-2] == '.' && any(dp[-1], "cosa12345678npP")) dp[-2] = 0; if (cp + 4 <= dp && dp[-3] == '.' && any(dp[-2], "13") && isalpha(dp[-1])) dp[-3] = 0; } return (cp); } any(c,cmd/uucp/ 775 0 33 0 2552573375 5504 cmd/uucp/NOTICE 644 0 33 205 2255052251 6431 This is quite different from the /32v distribution tape uucp, but it seems to work here, and we see no reason to change uucp. bill c< < a9 no02552573375ip(); < a9){ 00000005504& 0177; sps = width(' ' | chbits); } noscale = 0; } xlss(){ register i, j; getch(); dfact = lss; i = quant(atoi(),VERT); dfact = 1; getch(); if((j = i) < 0)j = -j; ch0 = ((j & 00)<<3) / C. /,"cmd/uucp/README 644 0 33 13774 2153631573 6473 A substantial number of minor changes were made to ``uucp'' at the end of February and early March, before Dave Nowitz returned to Piscataway. Changes made after March, 15, 1979, will be available through stockroom category, ``uucp_changes''. Any installation with a version of ``uucp'' obtained before March 15, should obtain the whole distribution afresh. Most of the changes are relatively benign. See the file CHANGES for a list of what has been done. PLEASE NOTE that there is one important difference between the present version and previous versions: there is a change to the file ``L-devices''. For each entry representing an ACU insert the string "ACU " at the beginning of the line; for each direct connection, insert "DIR ". This should take all of a minute. Two short shell procedures, ``uutest'' and ``uucheck'' are included in the distribution. You may find them useful for administrative purposes. Put links to them in your personal bin directory. (On our system, they live in /usr/lib/uucp.) PWB 1.2 SYSTEMS There is a new stockroom category, called ``pwbuucp'', (made March 21) which gives additional information regarding installing uucp on PWB 1.2 systems. This information is by courtesy of Brian Redman. GENERAL INSTRUCTIONS Before running "uucp", you should change the define for "MYNAME" in "uucp.h" to whoever you are, and recompile. As delivered, "uucp" thinks that it is running on the ``usg'' system. NOTE - To export executable code: A new routine (uucpname.c) has been added which returns the local uucp name. If no action is taken, this routine will return the value of "MYNAME". By defining "UNAME" as value 1 in "uucp.h", the value returned is determined by a call to "uname(&utsname)" where utsname is a structure which contains an element "nodename" - the uucpname for the local system. Since all ACUs are not created equal, the last character which must be sent to the ACU may differ on your system. The value "ACULAST" in "uucp.h" should be modified if necessary. (( To run successfully you will need to provide working versions of the following files: L-devices entries for call-units and hard-wired connections L-dialcodes decodes abbreviations occurring in L.sys L.sys pertinent details about other systems that you may call, as the result of prior agreement. USERFILE user accessibility information The information in these files is specific to each installation. The versions supplied are arbitrarily modified versions of files used on the Usg machine, and are provided only for your information. As delivered, "uucp" is set up to use the following directories (contrary to some documentation): /usr/src/cmd/uucp source files /usr/lib/uucp executable programs and data files /usr/spool/uucp work-in-progress /usr/lib/uucp/.XQTDIR work area for "uuxqt" /usr/spool/uucppublic uucp public directory "/usr/bin/uucp (uux)" is linked to "/usr/lib/uucp/uucp (uux)". NOTE - some resent changes have moved some to the directories. The names appear in uucp.h and the "uucp.mk" file. (SPOOL, XQTDIR, PUBDIR, INSDIR, THISDIR) The login directory for the uucp login(s) should be the PUBDIR directory. Note also that there is an array called "Cmds" in the file "uuxqt.c" which names the commands which may be executed at the request of a remote user, via "uux". You will most probably wish to modify the initialization of this array, to reflect the commands you are willing to allow on your system. The ``mail'' command has been modified, so that it may only be used to send mail, when it is invoked under a name beginning with 'r'. (In the receive mode, it can be used to invoke a shell, thus creating a potential security hole.) When sending mail to a remote site, ``mail'' invokes the ``rmail'' command at the remote site. Hence you should create an ``rmail'' command by linking to ``/bin/mail", and ensure that ``Cmds'' contains an entry for ``rmail'', but not ``mail''. Note that other systems which may contact you via "uucp" will have to login using information that you supply. When UNIX/TS is delivered there is a user "uucp" (with no initial password) whose default shell is (and must be) "/usr/lib/uucp/uucico". If you wish to use "uucp" to contact other systems you will need to obtain username and password information from them in advance and to store this in "L.sys". Since the file "L.sys" contains sensitive information about how to access other systems which are willing to converse with you, it is important that the "L.sys" file be properly protected. You will find that ensuring a high level of protection is not a trivial task. As a minimum you will need to set correctly the permissions on the file itself, its parent directory and every executable "set-uid-to-root" file in your whole system ... and then ensure that the root password is secure ... as a bare minimum. The programs "uuclean" and "uulog" are provided for housekeeping. These should be run frequently, e.g. by "cron". Prototypes of procedures that may be run by "cron" are provided here as the files "uudemon.*". Note also that "uudemon.hr" starts up "uucico" to initiate transfers that have been delayed for some reason, or to poll passive systems for work. Some installations may wish to use both the old and new versions of "uucp" concurrently for a while. This will be because some but not all of your correspondents have made the switch from the old to the new. The old version is no longer supported and the switch should be made as soon as possible. In the interim, you may replace the /usr/bin/uucp (which is linked to /usr/lib/uucp/uucp) by a shell procedure such as: for i in $* do case $i in old!* | dull!* | slow!* ) /usr/lib/uucp/olduucp $* echo old uucp used exit;; esac /usr/lib/uucp/uucp $* (This assumes that the old version of "uucp" has been moved to "olduucp".) For further information contact D. Nowitz (PY 6120) or J. Lions (MH 5667) or U. Arazy (MH 7659). andcmd/uucp/anlwrk.c 644 0 33 6334 2153632070 7220 /* anlwrk 2.1 5/22/79 09:59:09 */ #include "uucp.h" #include #include static char SiD[] = "@(#)anlwrk 2.1"; #define LLEN 20 #define SAME 0 /******* * anlwrk(file, wvec) create a vector of command arguments * char *file, **wvec; * * return codes: * 0 - no more work in this file * positive number - number of arguments */ anlwrk(file, wvec) char *file, **wvec; { static char str[BUFSIZ]; static FILE *fp = NULL; if (file[0] == '\0') return(0); if (fp == NULL) { fp = fopen(file, "r"); if (fp == NULL) return(0); } if (fgets(str, BUFSIZ, fp) == NULL) { fclose(fp); unlink(file); file[0] = '\0'; fp = NULL; return(0); } return(getargs(str, wvec)); } /*** * iswrk(file, reqst, dir, pre) * char *file, *reqst, *dir, *pre; * * iswrk - this routine will check the work list (list). * If it is empty or the present work is exhausted, it * will call gtwrk to generate a new list. * The "reqst" field will be the string "chk" or "get" to * check for work, or get the next work file respectively. * * return codes: * 0 - no more work (or some error) * 1 - there is work */ iswrk(file, reqst, dir, pre) char *file, *reqst, *dir, *pre; { static char **listp, *list[LLEN]; if (listp == NULL || *listp == NULL || listp > (list + LLEN) || !prefix(pre, *listp)) { int i; for (i = 0, listp = list; i < LLEN; i++) { if (*listp != NULL) free(*listp); *listp++ = NULL; } if (gtwrk(dir, pre, listp = list, LLEN) != 0) /* alloc error */ return(0); } if (*listp == NULL) return(0); if (strcmp(reqst, "get") == SAME) sprintf(file, "%s/%s", dir, *listp++); return(1); } /*** * gtwvec(file, dir, wkpre, wrkvec) get work vector * char *file, *dir, *wkpre, **wrkvec; * * return codes: * positive number - number of arguments * 0 - no arguments - fail */ gtwvec(file, dir, wkpre, wrkvec) char *file, *dir, *wkpre, **wrkvec; { int nargs; while ((nargs = anlwrk(file, wrkvec)) == 0) { if (!iswrk(file, "get", dir, wkpre)) return(0); } return(nargs); } /*** * gtwrk(dir, pre, list, llen) * char *dir, *pre, **list; * int llen; * * gtwrk - this routine will build a sorted list * of files in a directory. * "dir" is the directory name to search for file names * beginning with the prefix (pre). * "list" is the pointer to the list and "llen" is the * length of the list. * * return codes: 0 | FAIL */ gtwrk(dir, pre, list, llen) char *dir, *pre, **list; int llen; { struct stat s; char filename[NAMESIZE], *p; char **first, **last; FILE *pdir; extern int compar(); extern char *calloc(); first = last = list; if ((pdir = fopen(dir, "r")) == NULL) return(FAIL); while (gnamef(pdir, filename) && (last - first) < llen) { if (!prefix(pre, filename)) continue; if (stat(filename, &s) == -1) continue; if ((s.st_mode & ANYREAD) == 0) continue; if ((p = calloc(strlen(filename) + 1, sizeof (char))) == NULL) return(FAIL); strcpy(p, filename); *last++ = p; } fclose(pdir); qsort(first, last - first, sizeof *last, compar); return(0); } /*** * compar(p1, p2) * char **p1, **p2; * * compar - this routine is used by qsort. * */ compar(p1, p2) char **p1, **p2; { return(strcmp(*p1, *p2)); } llen) { if (!prefix(pre, filename)) continue; if (stat(filename, &s) == -1) continue; if ((s.st_mode & ANYREAD) == 0) continue; if ((p = calloc(strlen(filename) + 1, sizeof (char))) == NULL) return(FAIL); strcpy(p, filename); *last++ = p; } fclose(pdir); qsort(ficmd/uucp/makefile 644 0 33 7056 2572767714 7303 CC=cc CFLAGS=-O -s LIBS= FRC= OWNER=uucp INSDIR=/usr/lib/uucp BIN=/usr/bin PATH=. PUBDIR=/usr/spool/uucppublic SPOOL=/usr/spool/uucp XQTDIR=/usr/lib/uucp/.XQTDIR PKON=pkon.o IOCTL= CLEAN= COMMANDS=uucp uux uuxqt uucico uulog uuclean uuname OFILES=cpmv.o expfile.o gename.o getpwinfo.o index.o lastpart.o \ prefix.o shio.o ulockf.o xqt.o INIT=init all: $(INIT) $(COMMANDS) install: mkdirs all cp cpfiles $(CLEAN) cp: all cp uucp $(DESTDIR)$(BIN) -chown $(OWNER) $(DESTDIR)$(BIN)/uucp chmod 4111 $(DESTDIR)$(BIN)/uucp rm uucp cp uux $(DESTDIR)$(BIN) -chown $(OWNER) $(DESTDIR)$(BIN)/uux chmod 4111 $(DESTDIR)$(BIN)/uux rm uux cp uuxqt $(DESTDIR)$(INSDIR) -chown $(OWNER) $(DESTDIR)$(INSDIR)/uuxqt chmod 4111 $(DESTDIR)$(INSDIR)/uuxqt rm uuxqt cp uucico $(DESTDIR)$(INSDIR) -chown $(OWNER) $(DESTDIR)$(INSDIR)/uucico chmod 4111 $(DESTDIR)$(INSDIR)/uucico rm uucico cp uulog $(DESTDIR)$(BIN) -chown $(OWNER) $(DESTDIR)$(BIN)/uulog chmod 111 $(DESTDIR)$(BIN)/uulog rm uulog cp uuclean $(DESTDIR)$(INSDIR) -chown $(OWNER) $(DESTDIR)$(INSDIR)/uuclean chmod 111 $(DESTDIR)$(INSDIR)/uuclean rm uuclean cp uuname $(DESTDIR)$(BIN) -chown $(OWNER) $(DESTDIR)$(BIN)/uuname chmod 4111 $(DESTDIR)$(BIN)/uuname rm uuname clean: -rm -f *.o uucico uucp uuclean uulog uuname uux uuxqt clobber: clean -rm -f $(COMMANDS) get: cp $(PATH)/* . cmp: all cmp uucp $(BIN) rm uucp cmp uux $(BIN) rm uux cmp uuxqt $(INSDIR)/uuxqt rm uuxqt cmp uucico $(INSDIR)/uucico rm uucico cmp uulog $(BIN) rm uulog cmp uuclean(( $(INSDIR)/uuclean rm uuclean cmp uuname $(BIN) rm uuname rm *.o init: anlwrk.o anyread.o chkpth.o cpmv.o expfile.o gename.o \ getargs.o getprm.o getpwinfo.o gnamef.o gnsys.o \ gnxseq.o gwd.o imsg.o index.o lastpart.o logent.o \ prefix.o sdmail.o shio.o sysacct.o \ systat.o ulockf.o uucpname.o versys.o xqt.o uucp: uucp.o gwd.o $(OFILES) chkpth.o getargs.o logent.o \ uucpname.o versys.o $(CC) $(CFLAGS) uucp.o gwd.o $(OFILES) \ chkpth.o getargs.o logent.o uucpname.o versys.o \ $(LIBS) -o uucp uux: uux.o $(CC) $(CFLAGS) uux.o gwd.o anyread.o $(OFILES) \ chkpth.o getargs.o getprm.o uucpname.o versys.o \ $(LIBS) -o uux uuxqt: uuxqt.o $(CC) $(CFLAGS) uuxqt.o $(OFILES) \ sdmail.o getprm.o gnamef.o logent.o uucpname.o \ $(LIBS) -o uuxqt uucico: cico.o conn.o cntrl.o pk0.o pk1.o gio.o uucp.h uucpdefs.h \ anyread.o sdmail.o uucpname.o $(IOCTL) $(PKON) $(OFILES) $(CC) $(CFLAGS) cico.o cntrl.o conn.o pk0.o pk1.o gio.o \ anyread.o sdmail.o $(IOCTL) $(PKON) $(OFILES) \ anlwrk.o chkpth.o getargs.o gnamef.o gnsys.o gnxseq.o \ imsg.o logent.o sysacct.o systat.o uucpname.o \ $(LIBS) -o uucico uulog: uulog.o $(CC) $(CFLAGS) uulog.o prefix.o xqt.o ulockf.o gnamef.o \ $(LIBS) -o uulog uuclean: uuclean.o $(CC) $(CFLAGS) uuclean.o gnamef.o prefix.o sdmail.o getpwinfo.o \ $(LIBS) -o uuclean uuname: uuname.o $(CC) $(CFLAGS) uuname.o uucpname.o -o uuname uurecover: uurecover.o $(CC) $(CFLAGS) uurecover.o $(LIBS) -o uurecover -ls -l uurecover FRC: mkdirs: -mkdir ${DESTDIR}$(INSDIR) chmod 755 ${DESTDIR}$(INSDIR) -mkdir ${DESTDIR}$(SPOOL) -chown $(OWNER) ${DESTDIR}$(SPOOL) chmod 777 ${DESTDIR}$(SPOOL) -mkdir ${DESTDIR}$(PUBDIR) -chown $(OWNER) ${DESTDIR}$(PUBDIR) chmod 777 ${DESTDIR}$(PUBDIR) -mkdir ${DESTDIR}$(XQTDIR) -chown $(OWNER) ${DESTDIR}$(XQTDIR) chmod 777 ${DESTDIR}$(XQTDIR) cpfiles: cp $(PATH)/L* $(PATH)/USERFILE ${DESTDIR}$(INSDIR) # cp $(PATH)/uudemon* ${DESTDIR}$(INSDIR) # chmod 755 ${DESTDIR}$(INSDIR)/uudemon* -chown $(OWNER) ${DESTDIR}$(INSDIR)/* chmod 600 $(DESTDIR)$(INSDIR)/L* ${DESTDIR}$(INSDIR)/USERFILE SPOOL) -chown $(OWNER) ${DESTDIR}$(SPOOL) chmod 777 ${DESTDIR}$(SPOOL) -mkdir ${DESTDIR}$(PUBDIR) -chown $(OWNER) ${DESTDIR}$(PUBDIR) chmod 777 ${DESTDIR}$(PUBDIR) -mkdir ${DESTDIR}$(XQTDIR) -chown $(OWNER) ${DESTDIR}$(XQTDIR) chmod 777 ${DESTDIR}$(XQTDIR) cpfiles: cp $(PATH)/L* $(PATH)/USERFILE ${DESTDIR}$(INSDIR) # cp $(PATH)/uudemon* ${DESTDIR}$(INSDIR) # chmod 755 ${DESTDIR}$(INSDIR)/uudemon* -chown $(OWNER) ${DESTDIR}$(INSDIR)/* chmod 600 $(DESTcmd/uucp/CHANGES 644 0 33 2240 2153645643 6553 /* CHANGES 2.9 5/24/79 21:39:26 */ 5/24/79 (uux.c) add an error message; try to continue if gwd fails; 5/24/79 (uucp.c) multi commands/C. file; put -c in command file; use dummy D. name on -c; check for same file on local copy; check ANYREAD/ANYWRITE on local cp check for stat failure on send file; 5/24/79 (cntrl.c) don't look for D. if -c option; don't unlink dummy D.; add local notify on file access failures; 5/23/79 (uucp.h) add "dialout" routine option 5/23/79 (conn.c) add "dialout" routine option 5/23/79 (uucp.c) fix sysfile2 system name too long bug 5/22/79 (anlwrk.c) fix allocation bug - break loop (gtwrk) when list full 5/21/79 (chkpth.c) fix rdpth to use first null in USERFILE for defaults 5/18/79 (logent.c) add pid to log entries 5/18/79 (cico.c) add 2 logent calls 5/18/79 (cntrl.c) touch lock files after each transaction 5/18/79 (ulockf.c) add ultouch (touch lock files); reduce lock timeout 5/16/79 (cntrl.c) turnoff protocol on message failure 5/16/79 (pk1.c) try to fix loop when slave hangs up 5/16/79 (cico.c) fix to get core dumps on kill 5/7/79 (makefile) add -l option to uuname program 5/7/79 (uuname.c) add -l option to uuname.c .c) fix rdpth to use first null in USERFILE for defaults 5/18/79 (logent.c) add pid to log entries 5/18/79 (cico.c) add 2 logent calls 5/18/79 (cntrl.c) touch lock files after each transaction 5/18/79 (ulockf.c) add ultouch (touch lock files); reduce lock timeout 5/16/79 (cntrl.c) turnoff protocol on message failure 5/16/79 (pk1.c) try to fix loop wcmd/uucp/anyread.c 644 0 33 532 2153645753 7333 #include "uucp.h" #include #include /******* * anyread check if anybody can read * return 0 ok: FAIL not ok */ anyread(file) char *file; { struct stat s; if (stat(file, &s) != 0) /* for security check a non existant file is readable */ return(0); if (!(s.st_mode & ANYREAD)) return(FAIL); return(0); } action 5/18/79 (ulockf.c) add ultouch (touch lock files); reduce lock time/,5< /,"cmd/uucp/chkpth.c 644 0 33 10256 2153646013 7223 /* chkpth 2.2 5/21/79 13:20:43 */ #include "uucp.h" #include #include static char SiD[] = "@(#)chkpth 2.2"; #define DFLTNAME "default" #define MAXUSERS 20 struct userpath { char *us_lname; char *us_mname; char us_callback; char **us_path; }; struct userpath Upt[15]; struct userpath *Mchdef = NULL, *Logdef = NULL; int Nbrusers = 0; int Uptfirst = 1; /******* * chkpth(logname, mchname, path) * char *path, *logname, *mchname; * * chkpth - this routine will check the path table for the * machine or log name (non-null parameter) to see if the * input path (path) * starts with an acceptable prefix. * * return codes: 0 | FAIL */ chkpth(logname, mchname, path) char *path, *logname, *mchname; { struct userpath *u; extern char *lastpart(); char **p, *s; char c; int ret, i; if (Uptfirst) { ret = rdpth(Upt); ASSERT(ret == 0, "INIT USERFILE %d", Nbrusers); Uptfirst = 0; } for (u = Upt, i = 0; i < Nbrusers; i++, u++) { if (*logname != '\0' && strcmp(logname, u->us_lname) == SAME) break; if (*mchname != '\0' && strcmp(mchname, u->us_mname) == SAME) break; } if (i >= Nbrusers) { if (*logname == '\0') u = Mchdef; else u = Logdef; if (u == NULL) return(FAIL); } /* found user name */ p = u->us_path; /* check for /../ in path name */ for (s = path; *s != '\0'; s++) { if (*s == '/' && prefix("../", (++s))) return(FAIL); } for (p = u->us_path; *p != NULL; p++) if (prefix(*p, path)) return(0); if (prefix(Spool, path)) { if ((c = *lastpart(path)) == DATAPRE || c == XQTPRE) return(0); } /* path name not valid */ return(FAIL); } /*** * rdpth(u) * struct userpath *u; * * rdpth - this routine will read the USFILE and * construct the userpath structure pointed to by (u); * * return codes: 0 | FAIL */ rdpth(u) struct userpath *u; { char buf[BUFSIZ + 1], *pbuf[BUFSIZ + 1], *pc, **cp; extern char *calloc(), *index(); FILE *uf; if ((uf = fopen(USERFILE, "r")) == NULL) { /* can not open file */ return(FAIL); } while (fgets(buf, BUFSIZ, uf) != NULL) { int nargs, i; if (++Nbrusers > MAXUSERS) { fclose(uf); return(FAIL); } if ((pc = calloc(strlen(buf) + 1, sizeof (char))) == NULL) { /* can not allocate space */ fclose(uf); return(FAIL); } strcpy(pc, buf); nargs = getargs(pc, pbuf); u->us_lname = pbuf[0]; pc = index(u->us_lname, ','); if (pc != NULL) *pc++ = '\0'; else pc = u + strlen(u->us_lname); u->us_mname = pc; if (*u->us_lname == '\0' && Logdef == NULL) Logdef = u; else if (*u->us_mname == '\0' && Mchdef == NULL) Mchdef = u; i = 1; if (strcmp(pbuf[1], "c") == SAME) { u->us_callback = 1; i++; } else u->us_callback = 0; if ((cp = u->us_path = calloc(nargs - i + 1, sizeof (char *))) == NULL) { /* can not allocate space */ fclose(uf); return(FAIL); } while (i < nargs) *cp++ = pbuf[i++]; *cp = NULL; u++; } fclose(uf); return(0); } /*** * callback(name) check for callback * char *name; * * return codes: * 0 - no call back * 1 - call back */ callback(name) char *name; { struct userpath *u; int ret, i; if (Uptfirst) { ret = rdpth(Upt); ASSERT(ret == 0, "INIT USERFILE %d", Nbrusers); Uptfirst = 0; } for (u = Upt, i = 0; i < Nbrusers; u++, i++) { if (strcmp(u->us_lname, name) != SAME) continue; /* found user name */ return(u->us_callback); } /* userid not found */ return(0); } /*** * chkperm(file, user, mopt) check write permission of file * char *file, *user; * char *mopt; none NULL - create directories * * if mopt != NULL and permissions are ok, * a side effect of this routine is to make * directories up to the last part of the * filename (if they do not exist). * * return 0 | FAIL */ chkperm(file, user, mopt) char *file, *user, *mopt; { struct stat s; int ret; char dir[MAXFULLNAME]; extern char *lastpart(); if (stat(file, &s) != -1) return(0); strcpy(dir, file); *lastpart(dir) = '\0'; if ((ret = stat(dir, &s)) == -1 && mop((t == NULL) return(FAIL); if (ret != -1) { if ((s.st_mode & ANYWRITE) == 0) return(FAIL); else return(0); } /* make directories */ return(mkdirs(file)); } last part of the * filename (if they do not exist). * * return 0 | FAIL */ chkperm(file, user, mopt) char *file, *user, *mopt; { struct stat s; int ret; char dir[MAXFULLNAME]; extern char *lastpart(); if (stat(file, &s) != -1) return(0); strcpy(dir, file); *lastpart(dir) = '\0'; if ((ret = stat(dir, &s)) == -1 && mopcmd/uucp/chksum.c 644 0 33 665 2153646046 7205 main() { int i, j; char buf[300]; for (i = 0; i < 300; i++) buf[i] = i; printf("%o\n", chksum(buf, 300)); } chksum(s,n) register char *s; register n; { register short sum; register unsigned t; register x; sum = -1; x = 0; do { if (sum<0) { sum <<= 1; sum++; } else sum <<= 1; t = sum; sum += (unsigned)*s++; x += sum^n; if ((unsigned)sum <= t) { sum ^= x; } } while (--n > 0); return(sum); } ,5Ȇ< /,"cmd/uucp/cico.c 644 0 33 21136 2347036442 6662 /* @(#)cico 2.2 5/18/79 11:31:12 */ #include "uucp.h" #include "uucpdefs.h" #include #include #include char Scico[] = "@(#)cico 2.2"; jmp_buf Sjbuf; /* call fail text */ char *Stattext[] = { "", "BAD SYSTEM", "WRONG TIME", "SYSTEM LOCKED", "NO DEVICE", "DIAL FAILED", "LOGIN FAILED", "BAD SEQUENCE" }; int Role = 0; char *ttyname(); /* call fail codes */ int Stattype[] = {0, 0, 0, 0, SS_NODEVICE, SS_FAIL, SS_FAIL, SS_BADSEQ }; int Errorrate = 0; struct sgttyb Savettyb; /******* * cico - this program is used to place a call to a * remote machine, login, and copy files between the two machines. */ main(argc, argv) char *argv[]; { int ret, seq; int onesys = 0; char wkpre[NAMESIZE], file[NAMESIZE]; char msg[BUFSIZ], *p, *q; extern onintr(), timeout(); extern intrINT(); extern intrHUP(); extern intrQUIT(); extern intrTERM(); extern intrEXIT(); extern char *pskip(); char rflags[30]; char *ttyn; signal(SIGILL, intrEXIT); signal(SIGTRAP, intrEXIT); signal(SIGIOT, intrEXIT); signal(SIGEMT, intrEXIT); signal(SIGFPE, intrEXIT); signal(SIGBUS, intrEXIT); signal(SIGSEGV, intrEXIT); signal(SIGSYS, intrEXIT); signal(SIGINT, intrINT); signal(SIGHUP, intrHUP); signal(SIGQUIT, intrQUIT); signal(SIGTERM, intrTERM); ret = guinfo(getuid(), User, msg); strcpy(Loginuser, User); ASSERT(ret == 0, "BAD UID ret %d", ret); rflags[0] = '\0'; uucpname(Myname); strcpy(Rmtname, Myname); Ifn = Ofn = -1; while(argc>1 && argv[1][0] == '-'){ switch(argv[1][1]){ case 'd': Spool = &argv[1][2]; break; /* * case 'E': * Errorrate = atoi(&argv[1][2]); * if (Errorrate <= 0) * Errorrate = 100; * break; * case 'g': * Pkdrvon = 1; * break; * case 'G': * Pkdrvon = 1; * strcat(rflags, " -g "); * break; */ case 'r': Role = atoi(&argv[1][2]); break; case 's': sprintf(Rmtname, "%.7s", &argv[1][2]); if (Rmtname[0] != '\0') onesys = 1; break; case 'x': Debug = atoi(&argv[1][2]); if (Debug <= 0) Debug = 1; strcat(rflags, argv[1]); break; default: printf("unknown flag %s\n", argv[1]); break; } --argc; argv++; } chdir(Spool); strcpy(Wrkdir, Spool); if (Role == SLAVE) { /* initial handshake */ onesys = 1; ret = ioctl(0, TIOCGETP, &Savettyb); Savettyb.sg_flags |= ECHO; Savettyb.sg_flags &= ~RAW; Ifn = 0; Ofn = 1; fixmode(Ifn); fclose(stderr); fopen(RMTDEBUG, "w"); chmod(RMTDEBUG, 0666); omsg('S', "here", Ofn); signal(SIGALRM, timeout); alarm(MAXMSGTIME); if (setjmp(Sjbuf)) { /* timed out */ ret = ioctl(0, TIOCSETP, &Savettyb); exit(0); } for (;;) { ret = imsg(msg, Ifn); if (ret != 0) { alarm(0); ret = ioctl(0, TIOCSETP, &Savettyb); exit(0); } if (msg[0] == 'S') break; } alarm(0); DEBUG(4, "msg-%s,", msg); q = &msg[1]; p = pskip(q); sprintf(Rmtname, "%.7s", q); DEBUG(4, "sys-%s\n", Rmtname); if (mlock(Rmtname)) { omsg('R', "LCK", Ofn); cleanup(0); } else if (callback(Loginuser)) { signal(SIGINT, SIG_IGN); signal(SIGHUP, SIG_IGN); omsg('R', "CB", Ofn); DEBUG(4, "CALLBACK Role %d\n", Role); logent("CALLBACK", "REQUIRED"); /* set up for call back */ systat(Rmtname, SS_CALLBACK, "CALL BACK"); gename(CMDPRE, Rmtname, 'C', file); close(creat(file, 0666)); chmod(file, 0666); xuucico(Rmtname); cleanup(0); } seq = 0; while (*p == '-') { q = pskip(p); switch(*(++p)) { case 'g': Pkdrvon = 1; break; case 'x': Debug = atoi(++p); if (Debug <= 0) Debug = 1; break; case 'Q': seq = atoi(++p); break; default: break; } p = q; } if (callok(Rmtname) == SS_BADSEQ) { logent("BADSEQ", "PREVIOUS"); omsg('R', "BADSEQ", Ofn); cleanup(0); } if ((ret = gnxseq(Rmtname)) == seq) { omsg('R', "OK", Ofn); cmtseq(); } else { systat(Rmtname, Stattype[7], Stattext[7]); logent("BAD SEQ", "HANDSHAKE FAILED"); ulkseq(); omsg('R', "BADSEQ", Ofn); cleanup(0); } } loop: if (!onesys) { ret = gnsys(Rmtname, Spool, CMDPRE); if (ret == FAIL) cleanup(100); if (ret == 0) cleanup(0); } else if (Role == MASTER && callok(Rmtname) != 0) { logent("SYSTEM STATUS", "CAN NOT CALL"); cleanup(0); } sprintf(wkpre, "%c.%.7s", CMDPRE, Rmtname); if (Role == MASTER) { /* master part */ signal(SIGINT, SIG_IGN); signal(SIGHUP, SIG_IGN); signal(SIGQUIT, SIG_IGN); if (!iswrk(file, "chk", Spool, wkpre) && !onesys) { logent(Rmtname, "NO WORK"); cleanup(0); } if (Ifn != -1 && Role == MASTER) { write(Ofn, EOTMSG, strlen(EOTMSG)); close(Ofn); close(Ifn); Ifn = Ofn = -1; rmlock(NULL); clsacu(); sleep(3); } sprintf(msg, "call to %s ", Rmtname); if (mlock(Rmtname) != 0) { logent(msg, "LOCKED"); goto next; } Ofn = Ifn = conn(Rmtname); if (Ofn < 0) { logent(msg, "FAILED"); systat(Rmtname, Stattype[-Ofn], Stattext[-Ofn]); goto next; } else { logent(msg, "SUCCEEDED"); } if (setjmp(Sjbuf)) goto next; signal(SIGALRM, timeout); alarm(2 * MAXMSGTIME); for (;;) { ret = imsg(msg, Ifn); if (ret != 0) { alarm(0); goto next; } if (msg[0] == 'S') break; } alarm(MAXMSGTIME); seq = gnxseq(Rmtname); sprintf(msg, "%.7s -Q%d %s", Myname, seq, rflags); omsg('S', msg, Ofn); for (;;) { ret = imsg(msg, Ifn); DEBUG(4, "msg-%s\n", msg); if (ret != 0) { alarm(0); ulkseq(); goto next; } if (msg[0] == 'R') break; } alarm(0); if (msg[1] == 'B') { /* bad sequence */ logent("BAD SEQ", "HANDSHAKE FAILED"); systat(Rmtname, Stattype[7], Stattext[7]); ulkseq(); goto next; } if (strcmp(&msg[1], "OK") != SAME) { logent(&msg[1], "HANDSHAKE FAILED"); ulkseq(); goto next; } cmtseq(); } ttyn = ttyname(Ifn); if (ttyn != NULL) chmod(ttyn, 0600); DEBUG(1, " Rmtname %s, ", Rmtname); DEBUG(1, "my Role %s, ", Role ? "MASTER" : "SLAVE"); DEBUG(1, "Spool - %s\n", Spool); DEBUG(1, "Ifn - %d, ", Ifn); DEBUG(1, "Ofn - %d, ", Ofn); DEBUG(1, "Loginuser - %s\n", Loginuser); ret = startup(Role); if (ret != SUCCESS) { logent("startup", "FAILED"); systat(Rmtname, SS_FAIL, "STARTUP"); goto next; } else { logent("startup", "OK"); systat(Rmtname, SS_INPROGRESS, "TALKING"); ret = cntrl(Role, wkpre); DEBUG(1, "ret from cntrl - %d\n", ret); signal(SIGINT, SIG_IGN); signal(SIGHUP, SIG_IGN); signal(SIGALRM, timeout); if (ret == 0) { logent("conversation complete", "OK"); rmstat(Rmtname); } else { logent("conversation complete", "FAILED"); systat(Rmtname, SS_FAIL, "CONVERSATION"); } alarm(MAXMSGTIME); omsg('O', "OOOOO", Ofn); DEBUG(4, "send OO %d,", ret); if (!setjmp(Sjbuf)) { for (;;) { omsg('O', "OOOOO", Ofn); ret = imsg(msg, Ifn); if (ret != 0) break; if (msg[0] == 'O') break; } } alarm(0); } next: if (!onesys) { goto loop; } cleanup(0); } int Hupvec[] = {0, 0, 1}; /*** * cleanup(code) cleanup and exit with "code" status * int code; */ cleanup(code) int code; { int ret; char *ttyn; signal(SIGINT, SIG_IGN); signal(SIGHUP, SIG_IGN); rmlock(NULL); clsacu(); logcls(); if (Role == SLAVE) { ret = ioctl(0, TIOCSETP, &Savettyb); DEBUG(4, "\nIfn - %d, ", Ifn); DEBUG(4, "ret ioctl - %d\n", ret); DEBUG(4, "tty.flags %o,", Savettyb.sg_flags); DEBUG(4, "tty.ispeed %d, ", Savettyb.sg_ispeed); DEBUG(4, "tty.ospeed %d, ", Savettyb.sg_ospeed); ret = ioctl(0, TIOCSETP, Hupvec); DEBUG(4, "ret ioctl - %d\n", ret); } if (Ofn != -1) { if (Role == MASTER) write(Ofn, EOTMSG, strlen(EOTMSG)); ttyn = ttyname(Ifn); if (ttyn != NULL) chmod(ttyn, 0666); close(Ifn); close(Ofn); } DEBUG(1, "exit code %d\n", code); if (code == 0) xuuxqt(); exit(code); } /*** * onintr(inter) interrupt - remove locks and exit */ onintr(inter) int inter; { char str[30]; signal(inter, SIG_IGN); sprintf(str, "SIGNAL %d", inter); logent(str, "CAUGHT"); cleanup(inter); } intrINT() { onintr(SIGINT);} intrHUP() { onintr(SIGHUP);} intrQUIT() { onintr(SIGQUIT);} intrTER((M() { onintr(SIGTERM);} intrEXIT() { signal(SIGIOT, SIG_DFL); setuid(getuid()); abort(); } /*** * fixmode(tty) fix kill/echo/raw on line * * return codes: none */ fixmode(tty) int tty; { struct sgttyb ttbuf; int ret; ioctl(tty, TIOCGETP, &ttbuf); ttbuf.sg_flags = (ANYP | RAW); ret = ioctl(tty, TIOCSETP, &ttbuf); ASSERT(ret >= 0, "RETURN FROM STTY %d", ret); ioctl(tty, TIOCEXCL, 0); return; } /*** * timeout() catch SIGALRM routine */ timeout() { longjmp(Sjbuf, 1); } static char * pskip(p) register char *p; { while( *p && *p != ' ' ) ++p; if( *p ) *p++ = 0; return(p); } /*** * fixmode(tty) fix kill/echo/raw on line * * return codes: none */ fixmode(tty) int tty; { struct sgttyb ttbuf; int ret; ioctl(tty, TIOCGETP, &ttbuf); ttbuf.sg_flags = (ANYP | RAW); ret = ioctl(tty, TIOCSETP, &ttbuf); ASSERT(ret >= 0, "RETURN FROM STTY %d", ret); ioctl(tty, TIOCEXCL, 0); return; } /*** * timeout() catch SIGALRM routine */ timeout() { longjmp(Sjbuf, 1); } static char * pscmd/uucp/cntrl.c 644 0 33 35724 2153646116 7077 /* cntrl 2.7 5/24/79 21:37:36 */ #include "uucp.h" #include #include static char SiD[] = "@(#)cntrl 2.7"; struct Proto { char P_id; int (*P_turnon)(); int (*P_rdmsg)(); int (*P_wrmsg)(); int (*P_rddata)(); int (*P_wrdata)(); int (*P_turnoff)(); }; extern int gturnon(), gturnoff(); extern int grdmsg(), grddata(); extern int gwrmsg(), gwrdata(); extern int imsg(); extern int omsg(); struct Proto Ptbl[]={ 'g', gturnon, grdmsg, gwrmsg, grddata, gwrdata, gturnoff, '\0' }; int (*Rdmsg)()=imsg, (*Rddata)(); int (*Wrmsg)()=omsg, (*Wrdata)(); int (*Turnon)(), (*Turnoff)(); #define YES "Y" #define NO "N" /* failure messages */ #define EM_MAX 6 #define EM_LOCACC "N1" /* local access to file denied */ #define EM_RMTACC "N2" /* remote access to file/path denied */ #define EM_BADUUCP "N3" /* a bad uucp command was generated */ #define EM_NOTMP "N4" /* remote error - can't create temp */ #define EM_RMTCP "N5" /* can't copy to remote directory - file in public */ #define EM_LOCCP "N6" /* can't copy on local system */ char *Em_msg[] = { "COPY FAILED (reason not given by remote)", "local access to file denied", "remote access to path/file denied", "system error - bad uucp command generated", "remote system can't create temp file", "can't copy to file/directory - file left in PUBDIR/user/file", "can't copy to file/directory - file left in PUBDIR/user/file" }; /* */ #define XUUCP 'X' /* execute uucp (string) */ #define SLTPTCL 'P' /* select protocol (string) */ #define USEPTCL 'U' /* use protocol (character) */ #define RCVFILE 'R' /* receive file (string) */ #define SNDFILE 'S' /* send file (string) */ #define RQSTCMPT 'C' /* request complete (string - yes | no) */ #define HUP 'H' /* ready to hangup (string - yes | no) */ #define W_TYPE wrkvec[0] #define W_FILE1 wrkvec[1] #define W_FILE2 wrkvec[2] #define W_USER wrkvec[3] #define W_OPTNS wrkvec[4] #define W_DFILE wrkvec[5] #define W_MODE wrkvec[6] #define RMESG(m, s) if (rmesg(m, s) != 0) {(*Turnoff)(); return(FAIL);} #define RAMESG(s) if (rmesg('\0', s) != 0) {(*Turnoff)(); return(FAIL);} #define WMESG(m, s) if(wmesg(m, s) != 0) {(*Turnoff)(); return(FAIL);} char Wfile[MAXFULLNAME] = {'\0'}; char Dfile[MAXFULLNAME]; /******* * cntrl(role, wkpre) * int role; * char *wkpre; * * cntrl - this routine will execute the conversation * between the two machines after both programs are * running. * * return codes * SUCCESS - ok * FAIL - failed */ cntrl(role, wkpre) int role; char *wkpre; { char msg[BUFSIZ], rqstr[BUFSIZ]; FILE *fp; int filemode; struct stat stbuf; char filename[MAXFULLNAME], wrktype, *wrkvec[20]; extern (*Rdmsg)(), (*Wrmsg)(); extern char *index(), *lastpart(); int status = 1, i; int mailopt; int ret; static int pnum, tmpnum = 0; pnum = getpid(); top: DEBUG(4, "*** TOP *** - role=%d, ", role); if (role == MASTER) { /* get work */ if ((i = gtwvec(Wfile, Spool, wkpre, wrkvec)) == 0) { WMESG(HUP, ""); RMESG(HUP, msg); goto process; } wrktype = W_TYPE[0]; mailopt = index(W_OPTNS, 'm') != NULL; DEBUG(4, "wrktype %c, ", wrktype); if (wrktype == XUUCP) { int n; msg[0] = '\0'; for (n = 1; n < i; n++) { strcat(msg, " "); strcat(msg, wrkvec[n]); } sprintf(rqstr, "X %s", msg); logent(rqstr, "REQUEST"); goto sendmsg; } ASSERT(i > 4, "ARG COUNT - %d\n", i); sprintf(msg, " %s %s %s %s %s %s", W_FILE1, W_FILE2, W_USER, W_OPTNS, W_DFILE, W_MODE); strcpy(User, W_USER); ASSERT(strlen(User) <= 10, "User - %s\n", User); sprintf(rqstr, "%s %s %s %s", W_TYPE, W_FILE1, W_FILE2, W_USER); logent(rqstr, "REQUEST"); DEBUG(4, "User - %s\n", User); if (wrktype == SNDFILE ) { strcpy(filename, W_FILE1); expfile(filename); if (chkpth(User, "", filename) || anyread(filename)) { /* access denied */ logent("DENIED", "ACCESS"); unlinkdf(W_DFILE); lnotify(User, filename, "access denied"); goto top; } strcpy(Dfile, W_DFILE); fp = NULL; if (index(W_OPTNS, 'c') == NULL) fp = fopen(Dfile, "r"); if (fp == NULL && (fp = fopen(filename, "r")) == NULL) { /* can not read data file */ logent("CAN'T READ DATA", "FAILED"); unlinkdf(Dfile); lnotify(User, filename, "can't access"); goto top; } } if (wrktype == RCVFILE) { strcpy(filename, W_FILE2); expfile(filename); if (chkpth(User, "", filename) || chkperm(filename, User, index(W_OPTNS, 'd'))) { /* access denied */ logent("DENIED", "ACCESS"); lnotify(User, filename, "access denied"); goto top; } sprintf(Dfile, "%s/TM.%05d.%03d", Spool, pnum, tmpnum++); if ((fp = fopen(Dfile, "w")) == NULL) { /* can not create temp */ logent("CAN'T CREATE TM", "FAILED"); unlinkdf(Dfile); goto top; } chmod(Dfile, 0666); } sendmsg: DEBUG(4, "wrktype - %c, ", wrktype); DEBUG(4, " fileno - %d\n", fileno(fp)); WMESG(wrktype, msg); RMESG(wrktype, msg); goto process; } /* role is slave */ RAMESG(msg); goto process; process: ultouch(); /* touch all lock files */ DEBUG(4, " PROCESS: msg - %s\n", msg); switch (msg[0]) { case RQSTCMPT: DEBUG(4, "%s\n", "RQSTCMPT:"); logent(msg, "REQUESTED"); if (role == MASTER) { notify(mailopt, W_USER, W_FILE1, Rmtname, &msg[1]); } goto top; case HUP: DEBUG(4, "%s\n", "HUP:"); if (msg[1] == 'Y') { WMESG(HUP, YES); (*Turnoff)(); Rdmsg = imsg; Wrmsg = omsg; return(0); } if (msg[1] == 'N') { ASSERT(role == MASTER, "role - %d", role); role = SLAVE; goto top; } /* get work */ if (!iswrk(Wfile, "chk", Spool, wkpre)) { WMESG(HUP, YES); RMESG(HUP, msg); goto process; } WMESG(HUP, NO); role = MASTER; goto top; case XUUCP: if (role == MASTER) { goto top; } /* slave part */ i = getargs(msg, wrkvec); strcpy(filename, W_FILE1); if (index(filename, ';') != NULL || index(W_FILE2, ';') != NULL || i < 3) { WMESG(XUUCP, NO); goto top; } expfile(filename); if (chkpth("", Rmtname, filename)) { WMESG(XUUCP, NO); logent("XUUCP DENIED", filename); goto top; } sprintf(rqstr, "%s %s", filename, W_FILE2); xuucp(rqstr); WMESG(XUUCP, YES); goto top; case SNDFILE: /* MASTER section of SNDFILE */ DEBUG(4, "%s\n", "SNDFILE:"); if (msg[1] == 'N') { i = atoi(&msg[2]); if (i < 0 || i > EM_MAX) i = 0; logent(Em_msg[i], "REQUEST"); notify(mailopt, W_USER, W_FILE1, Rmtname, &msg[1]); ASSERT(role == MASTER, "role - %d", role); fclose(fp); unlinkdf(W_DFILE); goto top; } if (msg[1] == 'Y') { /* send file */ ASSERT(role == MASTER, "role - %d", role); ret = (*Wrdata)(fp, Ofn); fclose(fp); if (ret != 0) { (*Turnoff)(); return(FAIL); } unlinkdf(W_DFILE); RMESG(RQSTCMPT, msg); goto process; } /* SLAVE section of SNDFILE */ ASSERT(role == SLAVE, "role - %d", role); /* request to receive file */ /* check permissions */ i = getargs(msg, wrkvec); ASSERT(i > 4, "ARG COUNT - %d\n", i); sprintf(rqstr, "%s %s %s %s", W_TYPE, W_FILE1, W_FILE2, W_USER); logent(rqstr, "REQUESTED"); DEBUG(4, "msg - %s\n", msg); DEBUG(4, "W_FILE2 - %s\n", W_FILE2); strcpy(filename, W_FILE2); expfile(filename); if (chkpth("", Rmtname, filename) || chkperm(filename, Loginuser, index(W_OPTNS, 'd'))) { WMESG(SNDFILE, EM_RMTACC); logent("DENIED", "PERMISSION"); goto top; } if (isdir(filename)) { strcat(filename, "/"); strcat(filename, lastpart(W_FILE1)); } strcpy(User, W_USER); ASSERT(strlen(User) <= 10, "User - %s\n", User); DEBUG(4, "chkpth ok Rmtname - %s\n", Rmtname); sprintf(Dfile, "%s/TM.%05d.%03d", Spool, pnum, tmpnum++); if((fp = fopen(Dfile, "w")) == NULL) { WMESG(SNDFILE, EM_NOTMP); logent("CAN'T OPEN", "DENIED"); unlinkdf(Dfile); goto top; } chmod(Dfile, 0666); WMESG(SNDFILE, YES); ret = (*Rddata)(Ifn, fp); fclose(fp); if (ret != 0) { (*Turnoff)(); return(FAIL); } /* copy to user directory */ status = xmv(Dfile, filename); WMESG(RQSTCMPT, status ? EM_RMTCP : YES); logent(status ? "FAILED" : "SUCCEEDED", "COPY"); if (status == 0) { sscanf(W_MODE, "%o", &filemode); DEBUG(4, "mode - %o\n", filemode); if (filemode <= 0) filemode = 0666; chmod(filename, filemode | 0666); } else { putinpub(filename, Dfile, W_USER); } goto top; case RCVFILE: /* MASTER section of RCVFILE */ DEBUG(4, "%s\n", "RCVFILE:"); if (msg[1] == 'N') { i = atoi(&msg[2]); if (i < 0 || i > EM_MAX) i = 0; logent(Em_msg[i], "REQUEST"); not((ify(mailopt, W_USER, W_FILE1, Rmtname, &msg[1]); ASSERT(role == MASTER, "role - %d", role); fclose(fp); goto top; } if (msg[1] == 'Y') { /* receive file */ ASSERT(role == MASTER, "role - %d", role); ret = (*Rddata)(Ifn, fp); fclose(fp); if (ret != 0) { (*Turnoff)(); return(FAIL); } /* copy to user directory */ if (isdir(filename)) { strcat(filename, "/"); strcat(filename, lastpart(W_FILE1)); } status = xmv(Dfile, filename); WMESG(RQSTCMPT, status ? EM_RMTCP : YES); logent(status ? "FAILED" : "SUCCEEDED", "COPY"); notify(mailopt, W_USER, filename, Rmtname, status ? EM_LOCCP : YES); if (status == 0) { sscanf(&msg[2], "%o", &filemode); DEBUG(4, "mode - %o\n", filemode); if (filemode <= 0) filemode = 0666; chmod(filename, filemode | 0666); } else { putinpub(filename, Dfile, W_USER); } goto top; } /* SLAVE section of RCVFILE */ ASSERT(role == SLAVE, "role - %d", role); /* request to send file */ strcpy(rqstr, msg); logent(rqstr, "REQUESTED"); /* check permissions */ i = getargs(msg, wrkvec); ASSERT(i > 3, "ARG COUNT - %d\n", i); DEBUG(4, "msg - %s\n", msg); DEBUG(4, "W_FILE1 - %s\n", W_FILE1); strcpy(filename, W_FILE1); expfile(filename); if (isdir(filename)) { strcat(filename, "/"); strcat(filename, lastpart(W_FILE2)); } strcpy(User, W_USER); ASSERT(strlen(User) <= 10, "User - %s\n", User); if (chkpth("", Rmtname, filename) || anyread(filename)) { WMESG(RCVFILE, EM_RMTACC); logent("DENIED", "PERMISSION"); goto top; } DEBUG(4, "chkpth ok Rmtname - %s\n", Rmtname); if ((fp = fopen(filename, "r")) == NULL) { WMESG(RCVFILE, EM_RMTACC); logent("CAN'T OPEN", "DENIED"); goto top; } /* ok to send file */ ret = stat(filename, &stbuf); ASSERT(ret != -1, "STAT FAILED %s", filename); sprintf(msg, "%s %o", YES, stbuf.st_mode & 0777); WMESG(RCVFILE, msg); ret = (*Wrdata)(fp, Ofn); fclose(fp); if (ret != 0) { (*Turnoff)(); return(FAIL); } RMESG(RQSTCMPT, msg); goto process; } (*Turnoff)(); return(FAIL); } /*** * rmesg(c, msg) read message 'c' * char *msg, c; * * return code: 0 | FAIL */ rmesg(c, msg) char *msg, c; { char str[50]; DEBUG(4, "rmesg - '%c' ", c); if ((*Rdmsg)(msg, Ifn) != 0) { DEBUG(4, "got %s\n", "FAIL"); sprintf(str, "expected '%c' got FAIL", c); logent(str, "BAD READ"); return(FAIL); } if (c != '\0' && msg[0] != c) { DEBUG(4, "got %s\n", msg); sprintf(str, "expected '%c' got %.25s", c, msg); logent(str, "BAD READ"); return(FAIL); } DEBUG(4, "got %.25s\n", msg); return(0); } /*** * wmesg(m, s) write a message (type m) * char *s, m; * * return codes: 0 - ok | FAIL - ng */ wmesg(m, s) char *s, m; { DEBUG(4, "wmesg '%c'", m); DEBUG(4, "%.25s\n", s); return((*Wrmsg)(m, s, Ofn)); } /*** * notify mail results of command * * return codes: none */ notify(mailopt, user, file, sys, msgcode) char *user, *file, *sys, *msgcode; { char str[200]; int i; char *msg; if (!mailopt && *msgcode == 'Y') return; if (*msgcode == 'Y') msg = "copy succeeded"; else { i = atoi(msgcode + 1); if (i < 1 || i > EM_MAX) i = 0; msg = Em_msg[i]; } sprintf(str, "file %s, system %s\n%s\n", file, sys, msg); mailst(user, str); return; } /*** * lnotify(user, file, mesg) - local notify * * return code - none */ lnotify(user, file, mesg) char *user, *file, *mesg; { char mbuf[200]; sprintf(mbuf, "file %s on %s\n%s\n", file, Myname, mesg); mailst(user, mbuf); return; } /*** * startup(role) * int role; * * startup - this routine will converse with the remote * machine, agree upon a protocol (if possible) and start the * protocol. * * return codes: * SUCCESS - successful protocol selection * FAIL - can't find common or open failed */ startup(role) int role; { extern (*Rdmsg)(), (*Wrmsg)(); extern imsg(), omsg(); extern char *blptcl(), fptcl(); char msg[BUFSIZ], str[BUFSIZ]; Rdmsg = imsg; Wrmsg = omsg; if (role == MASTER) { RMESG(SLTPTCL, msg); if ((str[0] = fptcl(&msg[1])) == NULL) { /* no protocol match */ WMESG(USEPTCL, NO); return(FAIL); } str[1] = '\0'; WMESG(USEPTCL, str); if (stptcl(str) != 0) return(FAIL); DEBUG(4, "protocol %s\n", str); return(SUCCESS); } else { WMESG(SLTPTCL, blptcl(str)); RMESG(USEPTCL, msg); if (msg[1] == 'N') { return(FAIL); } if (stptcl(&msg[1]) != 0) return(FAIL); DEBUG(4, "Protocol %s\n", msg); return(SUCCESS); } } /******* * char * fptcl(str) * char *str; * * fptcl - this routine will choose a protocol from * the input string (str) and return the found letter. * * return codes: * '\0' - no acceptable protocol * any character - the chosen protocol */ char fptcl(str) char *str; { struct Proto *p; extern char *index(); for (p = Ptbl; p->P_id != '\0'; p++) { if (index(str, p->P_id) != NULL) { return(p->P_id); } } return('\0'); } /*** * char * * blptcl(str) * char *str; * * blptcl - this will build a string of the * letters of the available protocols and return * the string (str). * * return: * a pointer to string (str) */ char * blptcl(str) char *str; { struct Proto *p; char *s; for (p = Ptbl, s = str; (*s++ = p->P_id) != '\0'; p++); return(str); } /*** * stptcl(c) * char *c; * * stptcl - this routine will set up the six routines * (Rdmsg, Wrmsg, Rddata, Wrdata, Turnon, Turnoff) for the * desired protocol. * * return codes: * SUCCESS - ok * FAIL - no find or failed to open * */ stptcl(c) char *c; { struct Proto *p; for (p = Ptbl; p->P_id != '\0'; p++) { if (*c == p->P_id) { /* found protocol - set routines */ Rdmsg = p->P_rdmsg; Wrmsg = p->P_wrmsg; Rddata = p->P_rddata; Wrdata = p->P_wrdata; Turnon = p->P_turnon; Turnoff = p->P_turnoff; if ((*Turnon)() != 0) return(FAIL); DEBUG(4, "Proto started %c\n", *c); return(SUCCESS); } } DEBUG(4, "Proto start-fail %c\n", *c); return(FAIL); } /*** * putinpub put file in public place * * return code 0 | FAIL */ putinpub(file, tmp, user) char *file, *user, *tmp; { char fullname[MAXFULLNAME]; char *lastpart(); sprintf(fullname, "%s/%s/", PUBDIR, user); if (mkdirs(fullname) != 0) { /* can not make directories */ return(FAIL); } strcat(fullname, lastpart(file)); xmv(tmp, fullname); return(0); } /*** * unlinkdf(file) - unlink D. file * * return code - none */ unlinkdf(file) char *file; { if (strlen(file) > 6) unlink(file); return; } inpub put file in public place * * return cmd/uucp/conn.c 644 0 33 34152 2346647740 6714 /* conn 2.1 5/23/79 19:07:44 */ #define CONN #include "uucp.h" #include #include #include #include #include #include static char SiD[] = "@(#)conn 2.1"; #ifdef DATAKIT #include #endif #define F_NAME 0 #define F_TIME 1 #define F_LINE 2 #define F_SPEED 3 #define F_PHONE 4 #define F_LOGIN 5 jmp_buf Sjbuf; int alarmtr(); #define INVOKE(a, r) ret = a; if (ret<0) return(r); /******* * conn(system) * char *system; * * conn - place a telephone call to system and * login, etc. * * return codes: * CF_SYSTEM: don't know system * CF_TIME: wrong time to call * CF_DIAL: call failed * CF_LOGIN: login/password dialog failed * * >0 - file no. - connect ok * */ conn(system) char *system; { int ret, nf; int fn; char *flds[50]; DEBUG(4, "gdial %s\n", "called"); INVOKE(gdial(), CF_DIAL) DEBUG(4, "finds %s\n", "called"); INVOKE(nf = finds(system, flds), nf) DEBUG(4, "getto %s\n", "called"); INVOKE(fn = getto(flds), CF_DIAL) DEBUG(4, "login %s\n", "called"); INVOKE(login(nf, flds, fn), CF_LOGIN) return(fn); } /*** * char * * lastc(s) return pointer to last character * char *s; * */ char * lastc(s) char *s; { while (*s != '\0') s++; return(s); } #define MAXDEV 10 #define MAXDCH MAXDEV*20 #define MAXCODE 30 #define MAXCCH MAXCODE*20 /* This array tells us about possible acu's, etc. */ struct Devices { char *D_type; char *D_line; char *D_calldev; int D_speed; } Devs [MAXDEV]; char Devbuff[MAXDCH]; struct Codes { char *C_locs; char *C_prefix; } Dialcodes [MAXCODE]; char Codebuff[MAXCCH]; int Dcfull = 0; /*** * gdial() get device and dial info * * return codes: 0 | FAIL */ gdial() { char *flds[10], *lt; char *lb = Devbuff; char *lc = Codebuff; FILE *fn; int nr; struct Devices *pd; struct Codes *pc; if (Dcfull) return(0); fn = fopen(Devfile, "r"); ASSERT(fn != NULL, "CAN'T OPEN %s", Devfile); for (pd = Devs; fgets(lb, 200, fn); pd++) { lt = lastc(lb); nr = getargs(lb, flds); ASSERT(nr == 4, "BAD LINE %s", lb); pd->D_type = flds[0]; pd->D_line = flds[1]; pd->D_calldev = flds[2]; pd->D_speed = atoi(flds[3]); lb = lt; ASSERT(lb < Devbuff + MAXDCH, "TOO LONG %s", Devbuff); ASSERT(pd < Devs + MAXDEV, "TOO MANY DEVICES %d", MAXCODE); } pd->D_line = NULL; fclose(fn); ASSERT(pd > Devs, "BAD FILE %s", Devfile); /* Now dialcodes, same way */ fn = fopen(Dialfile, "r"); ASSERT(fn != NULL, "CAN'T OPEN %s", Dialfile); for (pc = Dialcodes; fgets(lc, 200, fn); pc++) { lt = lastc(lc); nr = getargs(lc, flds); if (nr == 1) flds[nr++] = ""; ASSERT(nr == 2, "BAD LINE %s", lc); pc->C_locs = flds[0]; pc->C_prefix = flds[1]; lc = lt; ASSERT(lc < Codebuff + MAXCCH, "TOO LONG %s", Codebuff); ASSERT(pc < Dialcodes + MAXCODE, "MANY DEVICES %d", MAXCODE); } pc->C_locs = 0; fclose(fn); return(0); } /*** * ckdev(type, speed, ndev) * char *type, *speed; * int ndev; * * ckdev - return the device number in table Devs for * a device with proper attributes. * ((* return codes: >= 0 (ok) | FAIL */ ckdev(type, speed, ndev) char *type, *speed; int ndev; { int sp; struct Devices *pd; sp = atoi(speed); for (pd = &Devs[ndev]; pd->D_line != NULL; pd++) { if (sp != pd->D_speed) continue; if ((strcmp(pd->D_type, type) == SAME) && !mlock(pd->D_line)) return(ndev = pd - Devs); if ((strcmp(pd->D_line, type) == SAME) && !mlock(type)) return(ndev = pd - Devs); } return(FAIL); } /*** * getto(flds) connect to remote machine * char *flds[]; * * return codes: * >0 - file number - ok * FAIL - failed */ getto(flds) char *flds[]; { DEBUG(F_PHONE, "call: no. %s ", flds[4]); DEBUG(4, "for sys %s ", flds[F_NAME]); if (prefix("ACU", flds[F_LINE])) return(call(flds)); #ifdef DATAKIT else if (prefix("DK", flds[F_LINE])) return(dkcall(flds)); #endif else return(direct(flds)); } /*** * call(flds) call remote machine * char *flds[]; * * "flds" contains the call information (name, date, type, speed, * phone no. ... * Ndev has the device no. * * return codes: * >0 - file number - ok * FAIL - failed */ call(flds) char *flds[]; { char *pno, pref[20], phone[20]; char *s1, *s2; int dcr, i; struct Codes *pc; pno = flds[F_PHONE]; s1 = pref; s2 = pno; while (isalpha(*s2)) *s1++ = *s2++; *s1 = '\0'; for (pc = Dialcodes; pc->C_locs; pc++) if (strcmp(pc->C_locs, pref) == SAME) { s1 = pc->C_prefix; break; } sprintf(phone, "%s%s", s1, s2); for (i = 0; i < TRYCALLS; i++) { DEBUG(4, "Dial %s\n", phone); dcr = dialup(phone, flds); DEBUG(4, "dcr returned as %d\n", dcr); if (dcr != FAIL) break; } return(dcr); } /* file descriptor for call unit */ int Dnf = 0; /*** * dialup(ph, flds) dial remote machine * char *ph; * char *flds[]; * * return codes: * file descriptor - succeeded * FAIL - failed */ dialup(ph, flds) char *ph; char *flds[]; { #ifdef DIALOUT int dcf; if ((dcf = dialout(ph, flds[F_SPEED])) < 0) return(FAIL); return(dcf); #endif #ifndef DIALOUT char dcname[20], dnname[20], phone[20]; struct Devices *pd; int nw, lt, pid, dcf, ndev, timelim; extern int Error; for (ndev = 0;;ndev++) { ndev = ckdev(flds[F_LINE], flds[F_SPEED], ndev); if (ndev < 0) { logent("AVAILABLE DEVICE", "NO"); DEBUG(4, "NO AVAILABLE DEVICE %s\n", ""); return(FAIL); } pd = &Devs[ndev]; sprintf(dnname, "/dev/%s", pd->D_calldev); /* open call unit */ Dnf = open(dnname, 1); if (Dnf >= 0) break; delock(pd->D_line); } sprintf(dcname, "/dev/%s", pd->D_line); sprintf(phone, "%s%s", ph, ACULAST); DEBUG(4, "dc - %s, ", dcname); DEBUG(4, "acu - %s\n", dnname); if (setjmp(Sjbuf)) { DEBUG(1, "DN write %s\n", "timeout"); logent("DIALUP DN write", "TIMEOUT"); kill(pid, 9); delock(pd->D_line); close(Dnf); return(FAIL); } signal(SIGALRM, alarmtr); timelim = 5 * strlen(phone); alarm(timelim < 30 ? 30 : timelim); if ((pid = fork()) == 0) { sleep(2); fclose(stdin); fclose(stdout); nw = write(Dnf, phone, lt = strlen(phone)); if (nw != lt) { DEBUG(1, "ACU write %s\n", "error"); logent("DIALUP ACU write", "FAILED"); exit(1); } DEBUG(4, "ACU write ok%s\n", ""); exit(0); } /* open line - will return on carrier */ dcf = open(dcname, 2); DEBUG(4, "dcf is %d\n", dcf); if (dcf < 0) { DEBUG(1, "Line open %s\n", "failed"); logent("DIALUP LINE open", "FAILED"); alarm(0); kill(pid, 9); close(Dnf); return(FAIL); } ioctl(dcf, TIOCHPCL, 0); while ((nw = wait(<)) != pid && nw != -1) ; alarm(0); fflush(stdout); fixline(dcf, pd->D_speed); DEBUG(4, "Forked %d ", pid); DEBUG(4, "Wait got %d ", nw); DEBUG(4, "Status %o\n", lt); if (lt != 0) { close(dcf); close(Dnf); return(FAIL); } return(dcf); #endif } /*** * clsacu() close call unit * * return codes: none */ clsacu() { if (Dnf > 0) { close(Dnf); sleep(5); Dnf = 0; } return; } /*** * direct(flds) connect to hardware line * char *flds[]; * * return codes: * >0 - file number - ok * FAIL - failed */ direct(flds) char *flds[]; { int dcr, ndev; char dcname[20]; ndev = 0; if ((ndev = ckdev(flds[F_LINE], flds[F_SPEED], ndev)) < 0) { logent("DEVICE", "NOT AVAILABLE"); return(FAIL); } sprintf(dcname, "/dev/%s", Devs[ndev].D_line); signal(SIGALRM, alarmtr); alarm(10); if (setjmp(Sjbuf)) return(FAIL); dcr = open(dcname, 2); /* read/write */ alarm(0); if (dcr < 0) return(FAIL); fflush(stdout); fixline(dcr, Devs[ndev].D_speed); return(dcr); } #ifdef DATAKIT #define DKTRIES 2 /*** * dkcall(flds) make datakit connection * * return codes: * >0 - file number - ok * FAIL - failed */ dkcall(flds) char *flds[]; { int dkphone; register char *cp; register ret, i; if (setjmp(Sjbuf)) return(FAIL); signal(SIGALRM, alarmtr); dkphone = 0; cp = flds[F_PHONE]; while(*cp) dkphone = 10 * dkphone + (*cp++ - '0'); DEBUG(4, "dkphone (%d) ", dkphone); for (i = 0; i < DKTRIES; i++) { ret = dkdial(D_UU, dkphone, 0); DEBUG(4, "dkdial (%d)\n", ret); if (ret > -1) break; } return(ret); } #endif #define MAXC 300 /*** * finds(sysnam, flds) set system attribute vector * char *sysnam, *flds[]; * * return codes: * >0 - number of arguments in vector - succeeded * CF_SYSTEM - system name not found * CF_TIME - wrong time to call */ finds(sysnam, flds) char *sysnam, *flds[]; { FILE *fsys; static char info[MAXC]; char **fnp; int na; int fnd = 0; for (fnp = Sysfiles; *fnp != NULL && !fnd; fnp++) { fsys = fopen(*fnp, "r"); if (fsys == NULL) continue; while (!fnd && (fgets(info, MAXC, fsys) != NULL)) { na = getargs(info, flds); if (prefix(sysnam, flds[F_NAME])) fnd = 1; } fclose(fsys); } if (fnd == 0) return(CF_SYSTEM); /* format of fields * 0 name; * 1 time * 2 acu/hardwired/slave * 3 speed * etc */ if (ifdate(flds[F_TIME]) == 0) { DEBUG(1, "Wrong time to call %s\n", sysnam); logent(sysnam, "WRONG TIME TO CALL"); return(CF_TIME); } if (strcmp(flds[F_LINE], "Slave") == 0) { DEBUG(1, "Slave only, no call to %s tried\n", sysnam); logent(sysnam, "NO CALL FROM SLAVE"); return(CF_TIME); } return(na); } /*** * login(nf, flds, dcr) do log conversation * char *flds[]; * int nf; * * return codes: 0 | FAIL */ login(nf, flds, fn) char *flds[]; int nf, fn; { char *want, *altern; extern char *index(); int k, ok; ASSERT(nf > 4, "TOO FEW LOG FIELDS %d", nf); for (k = F_LOGIN; k < nf; k += 2) { want = flds[k]; ok = FAIL; while (ok != 0) { altern = index(want, '-'); if (altern != NULL) *altern++ = '\0'; DEBUG(4, "wanted %s ", want); ok = expect(want, fn); DEBUG(4, "got %s\n", ok ? "?" : "that"); if (ok == 0) break; if (altern == NULL) { logent("LOGIN", "FAILED"); return(FAIL); } want = index(altern, '-'); if (want != NULL) *want++ = '\0'; sendthem(altern, fn); } sleep(2); sendthem(flds[k+1], fn); } return(0); } struct sg_spds {int sp_val, sp_name;} spds[] = { { 300, B300}, {1200, B1200}, {4800, B4800}, {9600, B9600}, {0, 0} }; /*** * fixline(tty, spwant) set speed/echo/mode... * int tty, spwant; * * return codes: none */ fixline(tty, spwant) int tty, spwant; { struct sgttyb ttbuf; struct sg_spds *ps; int speed = -1; int ret; for (ps = spds; ps->sp_val; ps++) if (ps->sp_val == spwant) speed = ps->sp_name; ASSERT(speed >= 0, "BAD SPEED %d", speed); ioctl(tty, TIOCGETP, &ttbuf); ttbuf.sg_flags =(ANYP|RAW); ttbuf.sg_ispeed = ttbuf.sg_ospeed = speed; DEBUG(4, "Speed: want %d ", spwant); DEBUG(4, "use %o ", speed); DEBUG(4, "ps %d\n", ps-spds); ret = ioctl(tty, TIOCSETP, &ttbuf); ASSERT(ret >= 0, "RETURN FROM STTY %d", ret); ioctl(tty, TIOCHPCL, 0); ioctl(tty, TIOCEXCL, 0); return; } #define MR 2000 int Error = 0; /*** * expect(str, fn) look for expected string * char *str; * * return codes: * 0 - found * FAIL - lost line or too many characters read * some character - timed out */ expect(str, fn) char *str; int fn; { static char rdvec[MR]; char *rp = rdvec; int nextch = 0, kr; if (strcmp(str, "\"\"") == SAME) return(0); *rp = 0; if (setjmp(Sjbuf)) { return(FAIL); } signal(SIGALRM, alarmtr); while (notin(str, rdvec)) { alarm(MAXCHARTIME); kr = read(fn, &nextch, 1); if (kr <= 0) { DEBUG(4, "kr - %d\n", kr); alarm(0); DEBUG(4, "lost line kr - %d, ", kr); DEBUG(4, "fn - %d\n", fn); logent("LOGIN", "LOST LINE"); return(FAIL); } { int c; c = nextch & 0177; DEBUG(4, "%c", c > 040 ? c : '_'); } if ((*rp = nextch & 0177) != '\0') rp++; *rp = '\0'; if (rp >= rdvec + MR) return(FAIL); } alarm(0); return(0); } /*** * alarmtr() - catch alarm routine for "expect". */ alarmtr() { longjmp(Sjbuf, 1); } /*** * sendthem(str, fn) send line of login sequence * char *str; * * return codes: none */ sendthem(str, fn) char *str; int fn; { int nw, ns; int nulls; if (prefix("BREAK", str)) { sscanf(&str[5], "%1d", &nulls); if (nulls <= 0 || nulls > 10) nulls = 3; /* send break */ DEBUG(5, "%s,", str); DEBUG(5, "%d\n", nulls); genbrk(fn, nulls); return; } if (strcmp(str, "EOT") == SAME) { write(fn, EOTMSG, strlen(EOTMSG)); return; } if (strcmp(str, "") != SAME) { nw = write(fn, str, ns = strlen(str)); ASSERT(nw == ns, "BAD WRITE $s", str); } write(fn, "\n", 1); return; } #define BSPEED B150 /*** * genbrk send a break * * return codes; none */ genbrk(fn, bnulls) { struct sgttyb ttbuf; int ret, sospeed; ret = ioctl(fn, TIOCGETP, &ttbuf); DEBUG(5, "ioctl ret %d\n", ret); sospeed = ttbuf.sg_ospeed; ttbuf.sg_ospeed = BSPEED; ret = ioctl(fn, TIOCSETP, &ttbuf); DEBUG(5, "ioctl ret %d\n", ret); ret = write(fn, "\0\0\0\0\0\0\0\0\0\0\0\0", bnulls); ASSERT(ret > 0, "BAD WRITE genbrk %d", ret); ttbuf.sg_ospeed = sospeed; ret = ioctl(fn, TIOCSETP, &ttbuf); ret = write(fn, "@", 1); ASSERT(ret > 0, "BAD WRITE genbrk %d", ret); DEBUG(4, "sent BREAK nulls - %d\n", bnulls); return; } /*** * notin(sh, lg) check for occurrence of substring "sh" * char *sh, *lg; * * return codes: * 0 - found the string * 1 - not in the string */ n((otin(sh, lg) char *sh, *lg; { while (*lg != '\0') { if (prefix(sh, lg)) return(0); else lg++; } return(1); } /******* * ifdate(s) * char *s; * * ifdate - this routine will check a string (s) * like "MoTu0800-1730" to see if the present * time is within the given limits. * * String alternatives: * Wk - Mo thru Fr * zero or one time means all day * Any - any day * * return codes: * 0 - not within limits * 1 - within limits */ ifdate(s) char *s; { static char *days[]={ "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", 0 }; long clock; int i, tl, th, tn, dayok=0; struct tm *localtime(); struct tm *tp; time(&clock); tp = localtime(&clock); while (isalpha(*s)) { for (i = 0; days[i]; i++) { if (prefix(days[i], s)) if (tp->tm_wday == i) dayok = 1; } if (prefix("Wk", s)) if (tp->tm_wday >= 1 && tp->tm_wday <= 5) dayok = 1; if (prefix("Any", s)) dayok = 1; s++; } if (dayok == 0) return(0); i = sscanf(s, "%d-%d", &tl, &th); tn = tp->tm_hour * 100 + tp->tm_min; if (i < 2) return(1); if (tn >= tl && tn <= th) return(1); return(0); } *localtime(); struct tm *tp; time(&clock); tp = localtime(&clock); while (isalpha(*s)) { for (i = 0; days[i]; i++) { if (prefix(days[i], s)) if (tp->tm_wday == i) dayok = 1; } if (prefix("Wk", s)) if (tp->tm_wday >= 1 && tp->tm_wday <= 5) dayok = 1; if (prefix("Any", s)) dayok = 1; s++; } if (dayok == 0) return(0); i = sscanf(s, "%d-%d", &tl, &th); tn = tp->tcmd/uucp/cpmv.c 644 0 33 2034 2153646170 6666 #include "uucp.h" #include #include /*** * xcp(f1, f2) copy f1 to f2 * char *f1, *f2; * * return - 0 ok | FAIL failed */ xcp(f1, f2) char *f1, *f2; { char buf[BUFSIZ]; int len; FILE *fp1, *fp2; char *lastpart(); char full[100]; struct stat s; if ((fp1 = fopen(f1, "r")) == NULL) return(FAIL); strcpy(full, f2); if (stat(f2, &s) == 0) { /* check for directory */ if ((s.st_mode & S_IFMT) == S_IFDIR) { strcat(full, "/"); strcat(full, lastpart(f1)); } } DEBUG(4, "full %s\n", full); if ((fp2 = fopen(full, "w")) == NULL) { fclose(fp1); return(FAIL); } while((len = fread(buf, sizeof (char), BUFSIZ, fp1)) > 0) fwrite(buf, sizeof (char), len, fp2); fclose(fp1); fclose(fp2); chmod(f2, 0666); return(0); } /* * xmv(f1, f2) move f1 to f2 * char * f1, *f2; * * return 0 ok | FAIL failed */ xmv(f1, f2) char *f1, *f2; { int ret; if (link(f1, f2) < 0) { /* copy file */ ret = xcp(f1, f2); if (ret == 0) unlink(f1); return(ret); } unlink(f1); return(0); } ); if ((fp2 = fopen(full, "w")) == NULL) { fclose(fp1); return(FAIL); } while((len = fread(buf, sizeof (char), BUFSIZ, fp1)) > 0) fwrite(buf, sizeof (char), len, fp2); fclose(fp1); fclose(fp2); chmod(f2, 0666); return(0); } /* * xmv(f1, f2) move f1 to f2 * char * f1, *f2; * * return 0 ok | FAIL failed */ xmv(f1, f2) char *f1, *f2; { int ret; if (link(f1, f2) < 0) { /* copy file */ ret = xcp(f1, f2); if (ret == 0) unlink(f1); return(ret); }cmd/uucp/expfile.c 644 0 33 2603 2153646213 7355 #include "uucp.h" #include #include /******* * expfile(file) expand file name * char *file; * * return codes: none */ expfile(file) char *file; { char *fpart; char user[20], *up; char full[100]; int uid; switch(file[0]) { case '/': return; case '~': for (fpart = file + 1, up = user; *fpart != '\0' && *fpart != '/'; fpart++) *up++ = *fpart; *up = '\0'; if (gninfo(user, &uid, full) != 0) { strcpy(full, PUBDIR); } strcat(full, fpart); strcpy(file, full); return; default: strcpy(full, Wrkdir); strcat(full, "/"); strcat(full, file); strcpy(file, full); return; } } /*** * isdir(name) check if directory name * char *name; * * return codes: 0 - not directory | 1 - is directory */ isdir(name) char *name; { int ret; struct stat s; ret = stat(name, &s); if (ret < 0) return(0); if ((s.st_mode & S_IFMT) == S_IFDIR) return(1); return(0); } /*** * mkdirs(name) make all necessary directories * char *name; * * return 0 | FAIL */ mkdirs(name) char *name; { int ret; char cmd[100], dir[100], *p; for (p = dir + 1;; p++) { strcpy(dir, name); if ((p = index(p, '/')) == NULL) return(0); *p = '\0'; if (isdir(dir)) continue; sprintf(cmd, "mkdir %s;chmod 0777 %s", dir, dir); DEBUG(4, "mkdir - %s\n", dir); ret = shio(cmd, NULL, NULL, User); if (ret != 0) return(FAIL); } } IFMT) == S_IFDIR) return(1); return(0); } /*** * mkdirs(name) make all necessary directories * char *name; * * returcmd/uucp/getprm.c 644 0 33 2721 2153646310 7216 #include #define LQUOTE '(' #define RQUOTE ')' #define NOSYSPART 0 #define HASSYSPART 1 /******* * char * * getprm(s, prm) get next parameter from s * char *s, *prm; * * return - pointer to next character in s */ char * getprm(s, prm) char *s, *prm; { char *c; while (*s == ' ' || *s == '\t' || *s == '\n') s++; *prm = '\0'; if (*s == '\0') return(NULL); if (*s == '>' || *s == '<' || *s == '|' || *s == ';') { *prm++ = *s++; *prm = '\0'; return(s); } /* look for quoted argument */ if (*s == LQUOTE) { if ((c = index(s + 1, RQUOTE)) != NULL) { c++; while (c != s) *prm++ = *s++; *prm = '\0'; return(s); } } while (*s != ' ' && *s != '\t' && *s != '<' && *s != '>' && *s != '|' && *s != '\0' && *s != ';' && *s != '\n') *prm++ = *s++; *prm = '\0'; return(s); } /*** * split(name, sys, rest) split into system and file part * char *name, *sys, *rest; * * return codes: * NOSYSPART * HASSYSPART */ split(name, sys, rest) char *name, *sys, *rest; { char *c; int i; if (*name == LQUOTE) { if ((c = index(name + 1, RQUOTE)) != NULL) { /* strip off quotes */ name++; while (c != name) *rest++ = *name++; *rest = '\0'; *sys = '\0'; return(NOSYSPART); } } if ((c = index(name, '!')) == NULL) { strcpy(rest, name); *sys = '\0'; return(NOSYSPART); } *c = '\0'; for (i = 0; i < 7; i++) if ((*sys++ = *name++) == '\0') break; strcpy(rest, ++c); return(HASSYSPART); } / split(name, sys, rest) char *name, *sys, *recmd/uucp/gnamef.c 644 0 33 1117 2153646327 7163 #include "uucp.h" #include #include /******* * gnamef(p, filename) get next file name from directory * FILE *p; * char *filename; * * return codes: * 0 - end of directory read * 1 - returned name */ gnamef(p, filename) FILE *p; char *filename; { static struct direct dentry; int i; char *s; while (1) { if (fread(&dentry, sizeof(dentry), 1, p) != 1) return(0); if (dentry.d_ino != 0) break; } for (i = 0, s = dentry.d_name; i < DIRSIZ; i++) if ((filename[i] = *s++) == '\0') break; filename[DIRSIZ] = '\0'; return(1); } mef(p, filename) get next file name from directory * FILE *p; * char *filename; * * return codes: * 0 - end of directory read * 1 - returned name */ gnamef(p, filename) FILE *p; char *filename; { static struct direct dentry; int i; char *s; while (1) { if (fread(&dentry, sizeof(dentry), 1, p) != 1) return(0); if (dentry.d_ino != 0) break; } for (i = 0, s = dentry.d_name; i < DIRSIZ; i++) if ((fcmd/uucp/gnsys.c 644 0 33 4225 2153646345 7074 #include "uucp.h" #define LSIZE 30 /* number of systems to store */ #define WSUFSIZE 6 /* work file name suffix size */ /******* * gnsys(sname, dir, pre) * char *sname, *dir, pre; * * gnsys - this routine will return the next * system name which has work to be done. * "pre" is the prefix for work files. * "dir" is the directory to search. * "sname" is a string of size DIRSIZ - WSUFSIZE. * * return codes: * 0 - no more names * 1 - name returned in sname * FAIL - bad directory */ ((gnsys(sname, dir, pre) char *sname, *dir, pre; { char *s, *p1, *p2; char px[3]; static char *list[LSIZE]; static int nitem=0, n=0; char sysname[NAMESIZE], filename[NAMESIZE]; FILE *fp; px[0] = pre; px[1] = '.'; px[2] = '\0'; if (nitem == 0) { /* get list of systems with work */ int i; fp = fopen(dir, "r"); ASSERT(fp != NULL, "BAD DIRECTRY %s\n", dir); for (i = 0; i < LSIZE; i++) list[i] = NULL; while (gnamef(fp, filename) != 0) { if (!prefix(px, filename)) continue; p2 = filename + strlen(filename) - WSUFSIZE; p1 = filename + strlen(px); for(s = sysname; p1 <= p2; p1++) *s++ = *p1; *s = '\0'; if (sysname[0] == '\0') continue; nitem = srchst(sysname, list, nitem); if (LSIZE <= nitem) break; } fclose(fp); } if (nitem == 0) return(0); while(nitem > n) { strcpy(sname, list[n++]); if (callok(sname) == 0) return(1); } for (n = 0; n < nitem; n++) if (list[n] != NULL) free(list[n]); nitem = n = 0; return(0); } /*** * srchst(name, list, n) * char *name, **list; * int n; * * srchst - this routine will do a linear search * of list (list) to find name (name). * If the name is not found, it is added to the * list. * The number of items in the list (n) is * returned (incremented if a name is added). * * return codes: * n - the number of items in the list */ srchst(name, list, n) char *name, **list; int n; { int i; char *p; extern char *calloc(); for (i = 0; i < n; i++) if (strcmp(name, list[i]) == 0) break; if (i >= n) { if ((p = calloc(strlen(name) + 1, sizeof (char))) == NULL) return(n); strcpy(p, name); list[n++] = p; } return(n); } he name is not found, it is added to the * list. * The number of items in the list (n) is * returned (incremented if a name is added). * * return codes: * n - the number of items in the list */ srchst(name, list, n) char *name, **list; int n; { int i; char *p; extern char *calloc(); for (i = 0; i < n; i++) if (strcmp(name, list[i]) == 0) breacmd/uucp/gnxseq.c 644 0 33 3225 2153646406 7233 #include "uucp.h" #include #include /******* * gnxseq(rmtname) get next conversation sequence number * char *rmtname; * * return - 0 no entry | >0 sequence number */ gnxseq(rmtname) char *rmtname; { int count = 0, ct, ret, i; struct tm *tp; extern struct tm *localtime(); time_t clock; FILE *fp0, *fp1; char buf[BUFSIZ], name[NAMESIZE]; for (i = 0; i < 5; i++) { if ((ret = ulockf(SQLOCK, SQTIME)) == 0) break; sleep(5); } if (ret != 0) { logent("CAN'T LOCK", SQLOCK); DEBUG(4, "can't lock %s\n", SQLOCK); return(0); } if ((fp0 = fopen(SQFILE, "r")) == NULL) return(0); if ((fp1 = fopen(SQTMP, "w")) == NULL) { fclose(fp0); return(0); } chmod(SQTMP, 0400); while (fgets(buf, BUFSIZ, fp0) != NULL) { ret = sscanf(buf, "%s%d", name, &ct); if (ret < 2) ct = 0; name[7] = '\0'; if (ct > 9998) ct = 0; if (strcmp(rmtname, name) != SAME) { fputs(buf, fp1); continue; } /* found name */ count = ++ct; time(&clock); tp = localtime(&clock); fprintf(fp1, "%s %d %d/%d-%d:%d\n", name, ct, tp->tm_mon + 1, tp->tm_mday, tp->tm_hour, tp->tm_min); while (fgets(buf, BUFSIZ, fp0) != NULL) fputs(buf, fp1); } fclose(fp0); fclose(fp1); if (count == 0) { rmlock(SQLOCK); unlink(SQTMP); } return(count); } /*** * cmtseq() commit sequence update * * return 0 ok | other - link failed */ cmtseq() { int ret; if ((ret = access(SQTMP, 0400)) != 0) { rmlock(SQLOCK); return(0); } unlink(SQFILE); ret = link(SQTMP, SQFILE); unlink(SQTMP); rmlock(SQLOCK); return(ret); } /*** * ulkseq() unlock sequence file */ ulkseq() { unlink(SQTMP); rmlock(SQLOCK); } , fp0) != NULL) fputs(buf, fp1); } fclose(fp0); fclose(fp1); if (count == 0) { rmlock(SQLOCK); unlink(SQTMP); } return(count); } /*** * cmtseq() commit sequence update * * return 0 ok | other - link failed */ cmtseq() { int ret; if ((ret = access(SQTMP, 0400)) != 0) { rmlock(SQLOCK); return(0); } unlink(SQFILE); ret = link(SQTMP,cmd/uucp/logent.c 644 0 33 3737 2153646433 7226 /* @(#)logent 2.1 5/18/79 13:27:52 */ #include "uucp.h" #include #include char Slogent[] = "@(#)logent 2.1"; char Tmplog[MAXFULLNAME] = ""; FILE *Lp = NULL; /******* * logent(text, status) make log entry * char *text, *status; * * return code - none */ logent(text, status) char *text, *status; { int n; FILE *fp; if (Lp != NULL) { /* make entry in existing temp log file */ mlogent(Lp, status, text); return; } if (ulockf(LOGLOCK, 10l) == 0) { if ((fp = fopen(LOGFILE, "a")) == NULL) { rmlock(LOGLOCK); } else { mlogent(fp, status, text); fclose(fp); rmlock(LOGLOCK); return; } } /* make a temp log file */ for (n = 0; n < 10; n++) { sprintf(Tmplog, "%s/LOG.%05d.%1d", LOGDIR, getpid(), n); if (access(Tmplog, 0) == -1) break; } if ((Lp = fopen(Tmplog, "w")) == NULL) return; chmod(Tmplog, 0222); setbuf(Lp, NULL); mlogent(Lp, status, text); return; } /*** * mlogent(fp, status, text) - make a log entry */ mlogent(fp, status, text) char *text, *status; FILE *fp; { static pid = 0; struct tm *tp; extern struct tm *localtime(); time_t clock; if (!pid) pid = getpid(); time(&clock); tp = localtime(&clock); fprintf(fp, "%s %s ", User, Rmtname); fprintf(fp, "(%d/%d-%d:%d-%d) ", tp->tm_mon + 1, tp->tm_mday, tp->tm_hour, tp->tm_min, pid); fprintf(fp, "%s (%s)\n", status, text); return; } /*** * logcls() close log file * * return codes: none */ logcls() { if (Lp != NULL) { fclose(Lp); chmod(Tmplog, 0666); } return; } /*** * syslog(text) make system log entry * char *text; * * return codes - none */ syslog(text) char *text; { struct tm *tp; extern struct tm *localtime(); time_t clock; FILE *fp; time(&clock); tp = localtime(&clock); fp = fopen(SYSLOG, "a"); if (fp == NULL) return; fprintf(fp, "%s %s ", User, Rmtname); fprintf(fp, "(%d/%d-%d:%d) ", tp->tm_mon + 1, tp->tm_mday, tp->tm_hour, tp->tm_min); fprintf(fp, "%s\n", text); fclose(fp); return; } lose(Lp); chmod(Tmplog, 0666); cmd/uucp/pk1.c 644 0 33 14703 2153700626 6437 #define USER 1 #include #include #include #include #include #include #include #define PKTIME 10 int Errorrate; int Conbad = 0; int Ntimeout = 0; #define CONBAD 5 #define NTIMEOUT 50 /* * packet driver support routines * */ struct pack *pklines[NPLINES]; /* * start initial synchronization. */ struct pack * pkopen(ifn, ofn) int ifn, ofn; { struct pack *pk; char **bp; int i; if (++pkactive >= NPLINES) return(NULL); if ((pk = (struct pack *) malloc(sizeof (struct pack))) == NULL) return(NULL); pkzero((caddr_t) pk, sizeof (struct pack)); pk->p_ifn = ifn; pk->p_ofn = ofn; pk->p_xsize = pk->p_rsize = PACKSIZE; pk->p_rwindow = pk->p_swindow = WINDOWS; /* allocate input windows */ for (i = 0; i < pk->p_rwindow; i++) { if ((bp = (char **) GETEPACK) == NULL) break; *bp = (char *) pk->p_ipool; pk->p_ipool = bp; } if (i == 0) return(NULL); pk->p_rwindow = i; /* start synchronization */ pk->p_msg = pk->p_rmsg = M_INITA; for (i = 0; i < NPLINES; i++) { if (pklines[i] == NULL) { pklines[i] = pk; break; } } if (i >= NPLINES) return(NULL); pkoutput(pk); while ((pk->p_state & LIVE) == 0) { PKGETPKT(pk); } pkreset(pk); return(pk); } /* * input framing and block checking. * frame layout for most devices is: * * S|K|X|Y|C|Z| ... data ... | * * where S == initial synch byte * K == encoded frame size (indexes pksizes[]) * X, Y == block check bytes * C == control byte * Z == XOR of header (K^X^Y^C) * data == 0 or more data bytes * */ int pksizes[] = { 1, 32, 64, 128, 256, 512, 1024, 2048, 4096, 1 }; #define GETRIES 5 /* * Pseudo-dma byte collection. */ pkgetpack(ipk) struct pack *ipk; { int ret, k, tries; register char *p; struct pack *pk; struct header *h; unsigned short sum; int ifn; char **bp; char hdchk; if (Conbad > CONBAD /* || Ntimeout > NTIMEOUT */) pkfail(); pk = PADDR; ifn = pk->p_ifn; /* find HEADER */ for (tries = 0; tries < GETRIES; ) { p = (caddr_t) &pk->p_ihbuf; if ((ret = pkcget(ifn, p, 1)) < 0) { /* set up retransmit or REJ */ tries++; pk->p_msg |= pk->p_rmsg; if (pk->p_msg == 0) pk->p_msg |= M_RR; if ((pk->p_state & LIVE) == LIVE) pk->p_state |= RXMIT; pkoutput(pk); continue; } if (*p != SYN) continue; p++; ret = pkcget(ifn, p, HDRSIZ - 1); if (ret == -1) continue; break; } if (tries >= GETRIES) { PKDEBUG(4, "tries = %d\n", tries); pkfail(); } h = (struct header * ) &pk->p((_ihbuf; p = (caddr_t) h; hdchk = p[1] ^ p[2] ^ p[3] ^ p[4]; p += 2; sum = (unsigned) *p++ & 0377; sum |= (unsigned) *p << 8; h->sum = sum; PKDEBUG(7, "rec h->cntl %o\n", (unsigned) h->cntl); k = h->ksize; if (hdchk != h->ccntl) { /* bad header */ PKDEBUG(7, "bad header %o,", hdchk); PKDEBUG(7, "h->ccntl %o\n", h->ccntl); Conbad++; return; } if (k == 9) { if (h->sum + h->cntl == CHECK) { pkcntl(h->cntl, pk); Conbad = 0; PKDEBUG(7, "state - %o\n", pk->p_state); } else { /* bad header */ Conbad++; PKDEBUG(7, "bad header %o\n", h->cntl); pk->p_state |= BADFRAME; } return; } if (k && pksizes[k] == pk->p_rsize) { pk->p_rpr = h->cntl & MOD8; pksack(pk); Conbad = 0; bp = pk->p_ipool; pk->p_ipool = (char **) *bp; if (bp == NULL) { PKDEBUG(7, "bp NULL %s\n", ""); return; } } else { Conbad++; return; } ret = pkcget(pk->p_ifn, (char *) bp, pk->p_rsize); PKASSERT(ret != -1, "PKGETPKT CAN't READ %d", ret); pkdata(h->cntl, h->sum, pk, (char *) bp); return; } pkdata(c, sum, pk, bp) char c; short sum; register struct pack *pk; char **bp; { register x; int t; char m; if (pk->p_state & DRAINO || !(pk->p_state & LIVE)) { pk->p_msg |= pk->p_rmsg; pkoutput(pk); goto drop; } t = next[pk->p_pr]; for(x=pk->p_pr; x!=t; x = (x-1)&7) { if (pk->p_is[x] == 0) goto slot; } drop: *bp = (char *)pk->p_ipool; pk->p_ipool = bp; return; slot: m = mask[x]; pk->p_imap |= m; pk->p_is[x] = c; pk->p_isum[x] = sum; pk->p_ib[x] = (char *)bp; return; } /* * setup input transfers */ pkrstart(pk) {} /* * Start transmission on output device associated with pk. * For asynch devices (t_line==1) framing is * imposed. For devices with framing and crc * in the driver (t_line==2) the transfer is * passed on to the driver. */ pkxstart(pk, cntl, x) struct pack *pk; char cntl; register x; { register char *p; int ret; short checkword; char hdchk; p = (caddr_t) &pk->p_ohbuf; *p++ = SYN; if (x < 0) { *p++ = hdchk = 9; checkword = cntl; } else { *p++ = hdchk = pk->p_lpsize; checkword = pk->p_osum[x] ^ (unsigned)(cntl&0377); } checkword = CHECK - checkword; *p = checkword; hdchk ^= *p++; *p = checkword>>8; hdchk ^= *p++; *p = cntl; hdchk ^= *p++; *p = hdchk; /* writes */ PKDEBUG(7, "send %o\n", (unsigned) cntl); p = (caddr_t) & pk->p_ohbuf; if (x < 0) { GENERROR(p, HDRSIZ); ret = write(pk->p_ofn, p, HDRSIZ); PKASSERT(ret == HDRSIZ, "PKXSTART ret %d", ret); } else { char buf[PACKSIZE + HDRSIZ], *b; int i; for (i = 0, b = buf; i < HDRSIZ; i++) *b++ = *p++; for (i = 0, p = pk->p_ob[x]; i < pk->p_rsize; i++) *b++ = *p++; GENERROR(buf, pk->p_rsize + HDRSIZ); ret = write(pk->p_ofn, buf, pk->p_rsize + HDRSIZ); PKASSERT(ret == pk->p_rsize + HDRSIZ, "PKXSTART ret %d", ret); } if (pk->p_msg) pkoutput(pk); return; } pkmove(p1, p2, count, flag) char *p1, *p2; int count, flag; { char *s, *d; int i; if (flag == B_WRITE) { s = p2; d = p1; } else { s = p1; d = p2; } for (i = 0; i < count; i++) *d++ = *s++; return; } /*** * pkcget(fn, b, n) get n characters from input * char *b; - buffer for characters * int fn; - file descriptor * int n; - requested number of characters * * return codes: * n - number of characters returned * 0 - end of file */ jmp_buf Getjbuf; cgalarm() { longjmp(Getjbuf, 1); } pkcget(fn, b, n) int fn, n; char *b; { int nchars, ret; if (setjmp(Getjbuf)) { Ntimeout++; PKDEBUG(4, "alarm %d\n", Ntimeout); return(-1); } signal(SIGALRM, cgalarm); for (nchars = 0; nchars < n; nchars += ret) { alarm(PKTIME); ret = read(fn, b, n - nchars); if (ret == 0) { alarm(0); return(-1); } PKASSERT(ret > 0, "PKCGET READ %d", ret); b += ret; } alarm(0); return(0); } generror(p, s) char *p; int s; { int r; if (Errorrate != 0 && (rand() % Errorrate) == 0) { r = rand() % s; fprintf(stderr, "gen err at %o, (%o), ", r, (unsigned) *(p + r)); *(p + r) += 1; } return; } alarm %d\n", Ntimeout); return(-1); } signal(SIGALRM, cgacmd/uucp/systat.c 644 0 33 4275 2153646521 7261 #include "uucp.h" #include #define STATNAME(f, n) sprintf(f, "%s/%s.%.7s", Spool, "STST", n) #define S_SIZE 100 /******* * systat(name, type, text) make system status entry * char *name, *text; * int type. * * return codes: none */ systat(name, type, text) char *name, *text; int type; { char filename[MAXFULLNAME], line[S_SIZE]; int count; FILE *fp; time_t prestime; if (type == 0) return; line[0] = '\0'; time(&prestime); count = 0; STATNAME(filename, name); fp = fopen(filename, "r"); if (fp != NULL) { fgets(line, S_SIZE, fp); sscanf(&line[2], "%d", &count); if (count <= 0) count = 0; fclose(fp); } if (type == SS_FAIL) count++; fp = fopen(filename, "w"); ASSERT(fp != NULL, "SYSTAT OPEN FAIL %s", ""); chmod(filename, 0666); fprintf(fp, "%d %d %D %s %s\n", type, count, prestime, text, name); fclose(fp); return; } /*** * rmstat(name) remove system status entry * char *name; * * return codes: none */ rmstat(name) char *name; { char filename[MAXFULLNAME]; STATNAME(filename, name); unlink(filename); } /*** * callok(name) check system status for call * char *name; * * return codes 0 - ok | >0 system status */ callok(name) char *name; { char filename[MAXFULLNAME], line[S_SIZE]; FILE *fp; time_t lasttime, prestime; int count, type; STATNAME(filename, name); fp = fopen(filename, "r"); if (fp == NULL) return(SS_OK); if (fgets(line, S_SIZE, fp) == NULL) { /* no data */ fclose(fp); unlink(filename); return(SS_OK); } fclose(fp); time(&prestime); sscanf(line, "%d%d%D", &type, &count, &lasttime); switch(type) { case SS_BADSEQ: case SS_CALLBACK: return(SS_OK); case SS_NODEVICE: return(SS_OK); case SS_INPROGRESS: if (prestime - lasttime < INPROGTIME) { DEBUG(4, "CALL IN PROGRESS %s\n", ""); return(type); } else return(SS_OK); case SS_FAIL: if (count > MAXRECALLS) { logent("MAX RECALLS", "NO CALL"); DEBUG(4, "MAX RECALL COUNT %d\n", count); return(type); } if (prestime - lasttime < RETRYTIME) { logent("RETRY TIME NOT REACHED", "NO CALL"); DEBUG(4, "RETRY TIME (%d) NOT REACHED\n", RETRYTIME); return(type); } return(SS_OK); default: return(SS_OK); } } SS_INPROGRESS: if (prestime - lasttime < INPROGTIME) { DEBUG(4, "CALL IN PROGRESS %s\n", ""); return(type); } else return(SS_OK); case SS_FAIL: if (count > MAXRECALLS) { logent("MAX RECALLS", "NO CALL"); DEBUG(4, "MAX RECALL COUNT %d\n", count); return(type); } if (prestime - lasttime < cmd/uucp/ulockf.c 644 0 33 7464 2153646537 7227 /* @(#)ulockf 2.3 5/18/79 11:52:11 */ #include "uucp.h" #include #include char Sulockf[] = "@(#)ulockf 2.3"; /******* * ulockf(file, atime) * char *file; * time_t atime; * * ulockf - this routine will create a lock file (file). * If one already exists, the create time is checked for * older than the age time (atime). * If it is older, an attempt will be made to unlink it * and create a new one. * * return codes: 0 | FAIL */ ulockf(file, atime) char *file; time_t atime; { struct stat stbuf; time_t ptime; int ret; static int pid = -1; static char tempfile[NAMESIZE]; if (pid < 0) { pid = getpid(); sprintf(tempfile, "LTMP.%d", pid); } if (onelock(pid, tempfile, file) == -1) { /* lock file exists */ /* get status to check age of the lock file */ ret = stat(file, &stbuf); if (ret != -1) { time(&ptime); if ((ptime - stbuf.st_ctime) < atime) { /* file not old enough to delete */ return(FAIL); } } ret = unlink(file); ret = onelock(pid, tempfile, file); if (ret != 0) return(FAIL); } stlock(file); return(0); } #define MAXLOCKS 10 /* maximum number of lock files */ char *Lockfile[MAXLOCKS]; int Nlocks = 0; /*** * stlock(name) put name in list of lock files * char *name; * * return codes: none */ stlock(name) char *name; { char *p; extern char *calloc(); int i; for (i = 0; i < Nlocks; i++) { if (Lockfile[i] == NULL) break; } ASSERT(i < MAXLOCKS, "TOO MANY LOCKS %d", i); if (i >= Nlocks) i = Nlocks++; p = calloc(strlen(name) + 1, sizeof (char)); ASSERT(p != NULL, "CAN NOT ALLOCATE FOR %s", name); strcpy(p, name); Lockfile[i] = p; return; } /*** * rmlock(name) remove all lock files in list * char *name; or name * * return codes: none */ rmlock(name) char *name; { int i; for (i = 0; i < Nlocks; i++) { if (Lockfile[i] == NULL) continue; if (name == NULL || strcmp(name, Lockfile[i]) == SAME) { unlink(Lockfile[i]); free(Lockfile[i]); Lockfile[i] = NULL; } } return; } /* this stuff from pjw */ /* /usr/pjw/bin/recover - check pids to remove unnecessary locks */ /* isalock(name) returns 0 if the name is a lock */ /* unlock(name) unlocks name if it is a lock*/ /* onelock(pid,tempfile,name) makes lock a name on behalf of pid. Tempfile must be in the same file system as name. */ /* lock(pid,tempfile,names) either locks all the names or none of them */ isalock(name) char *name; { struct stat xstat; if(stat(name,&xstat)<0) return(0); if(xstat.st_size!=sizeof(int))(( return(0); return(1); } unlock(name) char *name; { if(isalock(name)) return(unlink(name)); else return(-1); } onelock(pid,tempfile,name) char *tempfile,*name; { int fd; fd=creat(tempfile,0444); if(fd<0) return(-1); write(fd,&pid,sizeof(int)); close(fd); if(link(tempfile,name)<0) { unlink(tempfile); return(-1); } unlink(tempfile); return(0); } lock(pid,tempfile,names) char *tempfile,**names; { int i,j; for(i=0;names[i]!=0;i++) { if(onelock(pid,tempfile,names[i])==0) continue; for(j=0;j #include static char SiD[] = "@(#)uucp 2.7"; /* * uucp */ int Uid; char *Ropt = " "; char Path[100], Optns[10], Ename[8]; char Grade = 'n'; int Copy = 1; #define MAXCOUNT 20 /* maximun number of commands per C. file */ main(argc, argv) char *argv[]; { int ret; char *sysfile1, *sysfile2, *cp; char file1[MAXFULLNAME], file2[MAXFULLNAME]; extern char *index(); uucpname(Myname); Optns[0] = '-'; Ename[0] = Optns[1] = '\0'; while(argc>1 && argv[1][0] == '-'){ switch(argv[1][1]){ case 'c': Copy = 0; strcat(Optns, "c"); break; case 'd': strcat(Optns, "d"); break; case 'e': sprintf(Ename, "%.7s", &argv[1][2]); break; case 'g': Grade = argv[1][2]; break; case 'm': strcat(Optns, "m"); break; case 'r': Ropt = argv[1]; break; case 's': Spool = &argv[1][2]; break; case 'x': Debug = atoi(&argv[1][2]); if (Debug <= 0) Debug = 1; break; default: printf("unknown flag %s\n", argv[1]); break; } --argc; argv++; } DEBUG(4, "\n\n** %s **\n", "START"); ret = gwd(Wrkdir); if (ret != 0) { fprintf(stderr, "can't get working directory; will try to continue\n"); strcpy(Wrkdir, "/UNKNOWN"); } chdir(Spool); Uid = getuid(); ret = guinfo(Uid, User, Path); ASSERT(ret == 0, "CAN NOT FIND UID %d\n", Uid); DEBUG(4, "UID %d, ", Uid); DEBUG(4, "User %s,", User); DEBUG(4, "Ename (%s) ", Ename); DEBUG(4, "PATH %s\n", Path); if (argc < 3) { fprintf(stderr, "usage uucp from ... to\n"); cleanup(0); } /* set up "to" system and file names */ if ((cp = index(argv[argc - 1], '!')) != NULL) { sysfile2 = argv[argc - 1]; *cp = '\0'; if (*sysfile2 == '\0') sysfile2 = Myname; else sprintf(Rmtname, "%.7s", sysfile2); if (versys(sysfile2) != 0) { fprintf(stderr, "bad system name: %s\n", sysfile2); cleanup(0); } strcpy(file2, cp + 1); } else { sysfile2 = Myname; strcpy(file2, argv[argc - 1]); } if (strlen(sysfile2) > 7) *(sysfile2 + 7) = '\0'; /* do each from argument */ while (argc > 2) { if ((cp = index(argv[1], '!')) != NULL) { sysfile1 = argv[1]; *cp = '\0'; if (strlen(sysfile1) > 7) *(sysfile1 + 7) = '\0'; if (*sysfile1 == '\0') sysfile1 = Myname; else sprintf(Rmtname, "%.7s", sysfile1); if (versys(sysfile1) != 0) { fprintf(stderr, "bad system name: %s\n", sysfile1); cleanup(0); } strcpy(file1, cp + 1); } else { sysfile1 = Myname; strcpy(file1, argv[1]); } DEBUG(4, "file1 - %s\n", file1); copy(sysfile1, file1, sysfile2, file2); --argc; argv++; } clscfile(); if (*Ropt != '-') xuucico(""); cleanup(0); } cleanup(code) int code; { logcls(); rmlock(NULL); exit(code); } /*** * copy(s1, f1, s2, f2) generate copy files * char *s1, *f1, *s2, *f2; * * return codes 0 | FAIL */ copy(s1, f1, s2, f2) char *s1, *f1, *s2, *f2; { int ret, type, statret; struct stat stbuf, stbuf1; char dfile[NAMESIZE]; char file1[MAXFULLNAME], file2[MAXFULLNAME]; FILE *cfp; extern char *index(); extern FILE *gtcfile(); type = 0; strcpy(file1, f1); strcpy(file2, f2); if (strcmp(s1, Myname) != SAME) type = 1; if (strcmp(s2, Myname) != SAME) type += 2; if (type & 01) if ((index(file1, '*') != NULL || index(file1, '?') != NULL || index(file1, '[') != NULL)) type = 4; switch (type) { case 0: /* all work here */ DEBUG(4, "all work here %d\n", type); expfile(file1); expfile(file2); if (stat(file1, &stbuf) != 0) { fprintf(stderr, "can't get file status %s \n copy failed\n", file1); return(0); } statret = stat(file2, &stbuf1); if (statret == 0 && stbuf.st_ino == stbuf1.st_ino && stbuf.st_dev == stbuf1.st_dev) { fprintf(stderr, "%s %s - same file; can't copy\n", file1, file2); return(0); } if (chkpth(User, "", file1) != 0 || chkpth(User, "", file2) != 0) { fprintf(stderr, "permission denied\n"); cleanup(1); } if ((stbuf.st_mode & ANYREAD) == 0) { fprintf(stderr, "can't read file (%s) mode (%o)\n", file1, stbuf.st_mode); return(FAIL); } if (statret == 0 && (stbuf1.st_mode & ANYWRITE) == 0) { fprintf(stderr, "can't write file (%s) mode (%o)\n", file2, stbuf.st_mode); return(FAIL); } xcp(file1, file2); logent("WORK HERE", "DONE"); return(0); case 1: /* receive file */ DEBUG(4, "receive file - %d\n", type); if (file1[0] != '~') expfile(file1); expfile(file2); if (chkpth(User, "", file2) != 0) { fprintf(stderr, "permission denied\n"); return(FAIL); } if (Ename[0] != '\0') { /* execute uux - remote uucp */ xuux(Ename, s1, file1, s2, file2); return(0); } cfp = gtcfile(s1); fprintf(cfp, "R %s %s %s %s\n", file1, file2, User, Optns); break; case 2: /* send file */ expfile(file1); if (file2[0] != '~') expfile(file2); DEBUG(4, "send file - %d\n", type); if (chkpth(User, "", file1) != 0) { fprintf(stderr, "permission denied %s\n", file1); return(FAIL); } if (stat(file1, &stbuf) != 0) { fprintf(stderr, "can't get status for file %s\n", file1); return(FAIL); } if ((stbuf.st_mode & S_IFMT) == S_IFDIR) { fprintf(stderr, "directory name illegal - %s\n", file1); return(FAIL); } if ((stbuf.st_mode & ANYREAD) == 0) { fprintf(stderr, "can't read file (%s) mode (%o)\n", file1, stbuf.st_mode); return(FAIL); } if (Ename[0] != '\0') { /* execute uux - remote uucp */ xuux(Ename, s1, file1, s2, file2); return(0); } if (Copy) { gename(DATAPRE, s2, Grade, dfile); if (xcp(file1, dfile) != 0) { fprintf(stderr, "can't copy %s\n", file1); return(FAIL); } chmod(dfile, 0666); } else { /* make a dummy D. name */ /* cntrl.c knows names < 6 chars are dummy D. files */ strcpy(dfile, "D.0"); } cfp = gtcfile(s2); fprintf(cfp, "S %s %s %s %s %s %o\n", file1, file2, User, Optns, dfile, stbuf.st_mode & 0777); break; case 3: case 4: /* send uucp command for execution on s1 */ DEBUG(4, "send uucp command - %d\n", type); if (strcmp(s2, Myname) == SAME) { expfile(file2); if (chkpth(User, "", file2) != 0) { fprintf(stderr, "permission denied\n"); return(FAIL); } } if (Ename[0] != '\0') { /* execute uux - remote uucp */ xuux(Ename, s1, file1, s2, file2); return(0); } cfp = gtcfile(s1); fprintf(cfp, "X %s %s!%s\n", file1, s2, file2); break; } return(0); } /*** * xuux(ename, s1, s2, f1, f2) execute uux for remote uucp * * return code - none */ xuux(ename, s1, f1, s2, f2) char *ename, *s1, *s2, *f1, *f2; { char cmd[200]; DEBUG(4, "Ropt(%s) ", Ropt); DEBUG(4, "ename(%s) ", ename); DEBUG(4, "s1(%s) ", s1); DEBUG(4, "f1(%s) ", f1); DEBUG(4, "s2(%s) ", s2); DEBUG(4, "f2(%s)\n", f2); sprintf(cmd, "uux %s %s!uucp %s!%s \\(%s!%s\\)", Ropt, ename, s1, f1, s2, f2); DEBUG(4, "cmd (%s)\n", cmd); system(cmd); return; } FILE *Cfp = NULL; char Cfile[NAMESIZE]; /*** * gtcfile(sys) - get a Cfile descriptor * * return an open file descriptor */ FILE * gtcfile(sys) char *sys; { static char presys[8] = ""; static int cmdcount = 0; if (strcmp(presys, sys) != SAME /* this is !SAME on first call */ || ++cmdcount > MAXCOUNT) { cmdcount = 1; if (presys[0] != '\0') { clscfile(); } gename(CMDPRE, sys, Grade, Cfile); Cfp = fopen(Cfile, "w"); ASSERT(Cfp != NULL, "CAN'T OPEN %s", Cfile); chmod(Cfile, 0200); strcpy(presys, sys); } return(Cfp); } /*** * clscfile() - close cfile * * return code - none */ clscfile() { if (Cfp == NULL) return; fclose(Cfp); chmod(Cfile, 0666); logent(Cfile, "QUE'D"); Cfp = NULL; return; } esys, sys) != SAME /* this is !SAME on first call */ || ++cmdcount > MAXCOUNT) { cmdcount = 1; if (presys[0] != '\0') { clscfile(); } gename(CMDPRE, sys, Grade, Cfile); Cfp = fopen(Cfile, "w"); ASSERT(Cfp != NULL, "CAN'T OPEN %s", Cfile); chmod(Cfile, 0200); strcpy(presys, sys); } return(Cfp); } /*** * clscfile() - close cfile * * return code - none */ clscfile() { if (Cfp == NULL) return; fclose((cmd/uucp/uucp.h 644 0 33 5347 2457241264 6716 #include "stdio.h" /* define DATAKIT if datakit is available */ /* define DIALOUT if new dialout routine is to be used */ /* define the last characters for ACU */ /* define UNAME if uname() should be used to get uucpname */ #define ACULAST "-<" /* some system names */ /* put in local uucp name of this machine */ #define MYNAME "ucbarpa" #define THISDIR "/usr/lib/uucp" #define XQTDIR "/usr/lib/uucp/.XQTDIR" #define SQFILE "/usr/lib/uucp/SQFILE" #define SQTMP "/usr/lib/uucp/SQTMP" #define SEQFILE "/usr/lib/uucp/SEQF" #define SYSFILE "/usr/lib/uucp/L.sys" #define SYSFILECR "/usr/lib/uucp/L.sys.cr" #define DEVFILE "/usr/lib/uucp/L-devices" #define DIALFILE "/usr/lib/uucp/L-dialcodes" #define USERFILE "/usr/lib/uucp/USERFILE" #define SPOOL "/usr/spool/uucp" #define LOGDIR "/usr/spool/uucp" #define SQLOCK "/usr/spool/uucp/LCK.SQ" #define SYSLOG "/usr/spool/uucp/SYSLOG" #define PUBDIR "/usr/spool/uucppublic" #define SEQLOCK "LCK.SEQL" #define CMDPRE 'C' #define DATAPRE 'D' #define XQTPRE 'X' #define LOGPREFIX "LOG." #define LOGLOCK "/usr/spool/uucp/LCK.LOG" #define LOGFILE "/usr/spool/uucp/LOGFILE" #define RMTDEBUG "AUDIT" #define SQTIME 60L #define TRYCALLS 2 /* number of tries to dial call */ #define DEBUG(l, f, s) if (Debug >= l) fprintf(stderr, f, s) #define ASSERT(e, f, v) if (!(e)) {\ fprintf(stderr, "AERROR - (%s) ", "e");\ fprintf(stderr, f, v);\ cleanup(FAIL);}; #define FMV(p, n) close(n); dup(p[n]); close(p[n]); #define SAME 0 #define ANYREAD 04 #define ANYWRITE 02 #define FAIL -1 #define SUCCESS 0 #define MASTER 1 #define SLAVE 0 #define MAXFULLNAME 100 #define MAXMSGTIME 100 #define MAXCHARTIME 100 #define NAMESIZE 15 #define EOTMSG "\004\n\004\n" #define CALLBACK 1 /* commands */ #define SHELL "/bin/sh" #define MAIL "mail" #define UUCICO "/usr/lib/uucp/uucico" #define UUXQT "/usr/lib/uucp/uuxqt" #define UUCP "uucp" /* call connect fail stuff */ #define CF_SYSTEM -1 #define CF_TIME -2 #define CF_LOCK -3 #define CF_DIAL -5 #define CF_LOGIN -6 /* system status stuff */ #define SS_OK 0 #define SS_FAIL 4 #define SS_NODEVICE 1 #define SS_CALLBACK 2 #define SS_INPROGRESS 3 #define SS_BADSEQ 5 /* fail/retry parameters */ #define RETRYTIME 3300L #define INPROGTIME 7200L #define MAXRECALLS 10 /* stuff for command execution */ #define X_RQDFILE 'F' #define X_STDIN 'I' #define X_STDOUT 'O' #define X_CMD 'C' #define X_USER 'U' #define X_SENDFILE 'S' #define X_LOCK "LCK.XQT" #define X_LOCKTIME 3600L int Ifn, Ofn; char Rmtname[32]; char User[32]; char Loginuser[32]; char *Thisdir; char *Spool; char Myname[32]; char *Sysfiles[]; char *Devfile; char *Dialfile; int Debug; int Pkdebug; int Pkdrvon; int Bspeed; #define WKDSIZE 100 /* size of work dir name */ char Wrkdir[WKDSIZE]; XRECALLS 10 /* stuff for command execution */ #define X_RQDFILE 'F' #define X_STDIN 'I' #define X_STDOUT 'O' #define X_CMD 'C' #define X_USER 'U' #define X_SENDFILE 'S' #define X_LOCK "LCK.XQT" #define X_LOCKTIME 3600L int Ifn, Ofn; char Rmtname[32]; char User[32]; char Lcmd/uucp/uucpdefs.h 644 0 33 331 2153646634 7527 char *Thisdir = THISDIR; char *Spool = SPOOL; int Debug = 0; int Pkdebug = 0; char *Sysfiles[] = { SYSFILE, SYSFILECR, NULL }; char *Devfile = DEVFILE; char *Dialfile = DIALFILE; int Packflg = 0; int Pkdrvon = 0; dir[WKDSIZE]; XRECALLS 10 /* stuff for command execution */ #define X_RQDFILE 'F' #define X_STDIN 'I' #define X_STDOUT 'O' #define X_CMD 'C' #define X_USER 'U' #define X_SENDFILE 'S' #define X_LOC/,5ȇ< /,"cmd/uucp/uucpname.c 644 0 33 623 2153646655 7530 #include "uucp.h" #ifdef UNAME #include #endif /******* * uucpname(name) get the uucp name * * return code - none */ uucpname(name) char *name; { char *s, *d; int i; #ifdef UNAME struct utsname utsname; uname(&utsname); s = &utsname.nodename; #endif #ifndef UNAME s = MYNAME; #endif d = name; while ((*d = *s++) && d < name + 7) d++; *(name + 7) = '\0'; return; } 'S' #define X_LOC/,5؇< /,"cmd/uucp/uuname.c 644 0 33 1403 2413252303 7200 #include "uucp.h" #include char *Sysfiles[1]; /* for compiler */ /******* * uuname - return list of all remote systems * recognized by uucp, or (with -l) the local * uucp name. * * return codes: 0 | 1 (can't read) */ main(argc,argv) char *argv[]; int argc; { int i; FILE *np; char s[128]; if(argv[1][0] == '-' && argv[1][1] == 'l') { uucpname(s); printf("%s\n",s); exit(0); } if(argc != 1) {printf("Usage: uunames [-l]\n"); exit(1);} if((np = fopen(SYSFILE,"r")) == NULL) { printf("%s (name file) protected\n",SYSFILE); exit(1); } while ( fgets(s,128,np) != NULL ) { for(i=0; s[i]!=' '; i++); s[i]='\0'; if(s[0]=='x' && s[1]=='x' && s[2]=='x') continue ; printf("%s\n",s); } exit(0); } main(argc,argv) char *argv[]; int argc; { int i; FILE *np; char s[128]; if(argv[1][0] == '-' && argv[1][1] == 'l') { uucpname(s); printf("%s\n",s); exit(0); } if(argc != 1) {printf("Usage: uunames [-l]\n"); exit(1);} if((np = focmd/uucp/uusecure.c 644 0 33 3107 2153646715 7570 #include "uucp.h" #include "sgtty.h" #include "uucpdefs.h" #include "signal.h" #include ".secret" #define SEP '\t' #define MAXC 300 /******* * this program reads a file whose format is * field1 SEP count field2 * and runs crypt on field2. Count is either blank (read to newline) * or SEP followed by a count byte. */ main (argc,argv) char *argv[]; { char str[10]; char tl[MAXC], tr[MAXC], enc[MAXC]; int count, i, ln, clear; FILE *fp1, *fp2; struct sgttyb sb; extern intrEXIT(); signal(SIGQUIT, intrEXIT); signal(SIGILL, intrEXIT); signal(SIGTRAP, intrEXIT); signal(SIGIOT, intrEXIT); signal(SIGEMT, intrEXIT); signal(SIGFPE, intrEXIT); signal(SIGBUS, intrEXIT); signal(SIGSEGV, intrEXIT); signal(SIGSYS, intrEXIT); if (argc < 3) exit(100); fp1 = fopen(argv[1], "r"); fp2 = fopen(argv[2], "w"); if (fp1 == NULL || fp2 == NULL) exit(120); gtty(0, &sb); sb.sg_flags &= ~ECHO; stty(0, &sb); printf("Passwd:"); gets(str); sb.sg_flags |= ECHO; stty(0, &sb); strcpy(tl, secret); hdpw(str); for (ln = 0;; ln++) { if (gleft(tl, fp1) == 0) { fclose(fp1); fclose(fp2); exit(0); } ASSERT(strlen(tl) < MAXC, "LEFT PART LONG %s", tl); count = gright(tr, fp1, &clear); ASSERT(count < MAXC, "RIGHT LONG %s", tr); encrypt(tr, enc, ln, count); fprintf(fp2, "%s%c", tl, SEP); if (clear) fprintf(fp2, "%c%c", SEP, count); for(i = 0; i < count; i++) putc(enc[i], fp2); putc('\n', fp2); } } /*** * rmlock(p) this is a dummy called in ASSERT */ rmlock(p) char *p; { return; } cleanup(code) int code; { exit(code); } intrEXIT() {_exit(77);} ; fclose(fp2); exit(0); } ASSERT(strlen(tl) < MAXC, "LEFT PART LONG %s", tl); count = gright(tr, fp1, &clear); ASSERT(count < MAXC, "RIGHT LONG %s", tr); encrypt(tr, enc, ln, count); fprintf(fp2, "%s%c", tl, SEP); if (clear) fprintf(fp2, "%c%c", SEP, count); for(i = 0; i < count; i++) putc(enc[i], fp2); putc('\n', fp2); } } /*** * rmlock(p) this is a dummy called in ASSERT */ rmlock(p) char *p; { returcmd/uucp/uux.c 644 0 33 16472 2344406064 6573 (( /* uux 2.2 5/24/79 18:33:11 */ #include "uucp.h" #include "uucpdefs.h" static char SiD[] = "@(#)uux 2.2"; #define NOSYSPART 0 #define HASSYSPART 1 #define APPCMD(d) {\ char *p;\ for (p = d; *p != '\0';) *cmdp++ = *p++;\ *cmdp++ = ' ';\ *cmdp = '\0';} #define GENSEND(f, a, b, c, d) {\ fprintf(f, "S %s %s %s - %s 0666\n", a, b, c, d);\ } #define GENRCV(f, a, b, c) {\ fprintf(f, "R %s %s %s - \n", a, b, c);\ } /* * */ main(argc, argv) char *argv[]; { char cfile[NAMESIZE]; /* send commands for files from here */ char dfile[NAMESIZE]; /* used for all data files from here */ char rxfile[NAMESIZE]; /* to be sent to xqt file (X. ...) */ char tfile[NAMESIZE]; /* temporary file name */ char tcfile[NAMESIZE]; /* temporary file name */ char t2file[NAMESIZE]; /* temporary file name */ int cflag = 0; /* commands in C. file flag */ int rflag = 0; /* C. files for receiving flag */ char buf[BUFSIZ]; char inargs[BUFSIZ]; int pipein = 0; int startjob = 1; char path[MAXFULLNAME]; char cmd[BUFSIZ]; char *ap, *cmdp; char prm[BUFSIZ]; char syspart[8], rest[MAXFULLNAME]; char xsys[8], local[8]; FILE *fprx, *fpc, *fpd, *fp; FILE *xqtstr(); extern char *getprm(), *index(), *lastpart(); int uid, ret; char redir = '\0'; uucpname(Myname); Ofn = 1; Ifn = 0; while (argc>1 && argv[1][0] == '-') { switch(argv[1][1]){ case 'p': case '\0': pipein = 1; break; case 'r': startjob = 0; break; case 'x': Debug = atoi(&argv[1][2]); if (Debug <= 0) Debug = 1; break; default: sprintf(stderr, "unknown flag %s\n", argv[1]); break; } --argc; argv++; } DEBUG(4, "\n\n** %s **\n", "START"); inargs[0] = '\0'; for (argv++; argc > 1; argc--) { DEBUG(4, "arg - %s:", *argv); strcat(inargs, " "); strcat(inargs, *argv++); } DEBUG(4, "arg - %s\n", inargs); ret = gwd(Wrkdir); if (ret != 0) { fprintf(stderr, "can't get working directory; will try to continue\n"); strcpy(Wrkdir, "/UNKNOWN"); } chdir(Spool); uid = getuid(); guinfo(uid, User, path); sprintf(local, "%.7s", Myname); cmdp = cmd; *cmdp = '\0'; gename(DATAPRE, local, 'X', rxfile); fprx = fopen(rxfile, "w"); ASSERT(fprx != NULL, "CAN'T OPEN %s", rxfile); chmod(rxfile, 0666); gename(DATAPRE, local, 'T', tcfile); fpc = fopen(tcfile, "w"); ASSERT(fpc != NULL, "CAN'T OPEN %s", tcfile); chmod(tcfile, 0666); fprintf(fprx, "%c %s %s\n", X_USER, User, local); /* find remote system name */ ap = inargs; while ((ap = getprm(ap, prm)) != NULL) { if (prm[0] == '>' || prm[0] == '<') { ap = getprm(ap, prm); continue; } if (prm[0] == ';') { APPCMD(prm); continue; } split(prm, xsys, rest); if (xsys[0] == '\0') strcpy(xsys, local); break; } DEBUG(4, "xsys %s\n", xsys); if (versys(xsys) != 0) { /* bad system name */ fprintf(stderr, "bad system name: %s\n", xsys); fclose(fprx); fclose(fpc); unlink(rxfile); unlink(tcfile); cleanup(101); } if (pipein) { register int c; gename(DATAPRE, xsys, 'B', dfile); fpd = fopen(dfile, "w"); ASSERT(fpd != NULL, "CAN'T OPEN %s", dfile); chmod(dfile, 0666); while ((c = getc(stdin)) != EOF) putc(c, fpd); #ifdef notdef while (fgets(buf, BUFSIZ, stdin) != NULL) fputs(buf, fpd); #endif fclose(fpd); if (strcmp(local, xsys) != SAME) { GENSEND(fpc, dfile, dfile, User, dfile); cflag++; } fprintf(fprx, "%c %s\n", X_RQDFILE, dfile); fprintf(fprx, "%c %s\n", X_STDIN, dfile); } /* parse command */ ap = inargs; while ((ap = getprm(ap, prm)) != NULL) { DEBUG(4, "prm - %s\n", prm); if (prm[0] == '>' || prm[0] == '<') { redir = prm[0]; continue; } if (prm[0] == '|' || prm[0] == '^') { if (cmdp != cmd) APPCMD(prm); continue; } /* process command or file or option */ ret = split(prm, syspart, rest); DEBUG(4, "s - %s, ", syspart); DEBUG(4, "r - %s, ", rest); DEBUG(4, "ret - %d\n", ret); if (syspart[0] == '\0') strcpy(syspart, local); if (cmdp == cmd && redir == '\0') { /* command */ APPCMD(rest); continue; } /* process file or option */ DEBUG(4, "file s- %s, ", syspart); DEBUG(4, "local - %s\n", local); /* process file */ if (redir == '>') { if (rest[0] != '~') expfile(rest); fprintf(fprx, "%c %s %s\n", X_STDOUT, rest, syspart); redir = '\0'; continue; } if (ret == NOSYSPART) { /* option */ APPCMD(rest); continue; } if (strcmp(xsys, local) == SAME && strcmp(xsys, syspart) == SAME) { expfile(rest); if (redir == '<') fprintf(fprx, "%c %s\n", X_STDIN, rest); else APPCMD(rest); redir = '\0'; continue; } if (strcmp(syspart, local) == SAME) { /* generate send file */ expfile(rest); gename(DATAPRE, xsys, 'A', dfile); DEBUG(4, "rest %s\n", rest); if ((chkpth(User, "", rest) || anyread(rest)) != 0) { fprintf(stderr, "permission denied %s\n", rest); cleanup(1); } if (xcp(rest, dfile) != 0) { fprintf(stderr, "can't copy %s to %s\n", rest, dfile); cleanup(1); } GENSEND(fpc, rest, dfile, User, dfile); cflag++; if (redir == '<') { fprintf(fprx, "%c %s\n", X_STDIN, dfile); fprintf(fprx, "%c %s\n", X_RQDFILE, dfile); } else { APPCMD(lastpart(rest)); fprintf(fprx, "%c %s %s\n", X_RQDFILE, dfile, lastpart(rest)); } redir = '\0'; continue; } if (strcmp(local, xsys) == SAME) { /* generate local receive */ gename(CMDPRE, syspart, 'R', tfile); strcpy(dfile, tfile); dfile[0] = DATAPRE; fp = fopen(tfile, "w"); ASSERT(fp != NULL, "CAN'T OPEN %s", tfile); chmod(tfile, 0666); expfile(rest); GENRCV(fp, rest, dfile, User); fclose(fp); rflag++; if (rest[0] != '~') expfile(rest); if (redir == '<') { fprintf(fprx, "%c %s\n", X_RQDFILE, dfile); fprintf(fprx, "%c %s\n", X_STDIN, dfile); } else { fprintf(fprx, "%c %s %s\n", X_RQDFILE, dfile, lastpart(rest)); APPCMD(lastpart(rest)); } redir = '\0'; continue; } if (strcmp(syspart, xsys) != SAME) { /* generate remote receives */ gename(DATAPRE, syspart, 'R', dfile); strcpy(tfile, dfile); tfile[0] = CMDPRE; fpd = fopen(dfile, "w"); ASSERT(fpd != NULL, "CAN'T OPEN %s", dfile); chmod(dfile, 0666); gename(DATAPRE, xsys, 'T', t2file); GENRCV(fpd, rest, t2file, User); fclose(fpd); GENSEND(fpc, dfile, tfile, User, dfile); cflag++; if (redir == '<') { fprintf(fprx, "%c %s\n", X_RQDFILE, t2file); fprintf(fprx, "%c %s\n", X_STDIN, t2file); } else { fprintf(fprx, "%c %s %s\n", X_RQDFILE, t2file, lastpart(rest)); APPCMD(lastpart(rest)); } redir = '\0'; continue; } /* file on remote system */ if (rest[0] != '~') expfile(rest); if (redir == '<') fprintf(fprx, "%c %s\n", X_STDIN, rest); else APPCMD(rest); redir = '\0'; continue; } fprintf(fprx, "%c %s\n", X_CMD, cmd); fclose(fprx); strcpy(tfile, rxfile); tfile[0] = XQTPRE; if (strcmp(xsys, local) == SAME) { link(rxfile, tfile); unlink(rxfile); if (startjob) if (rflag) xuucico(""); else xuuxqt(); } else { GENSEND(fpc, rxfile, tfile, User, rxfile); cflag++; } fclose(fpc); if (cflag) { gename(CMDPRE, xsys, 'A', cfile); link(tcfile, cfile); unlink(tcfile); if (startjob) xuucico(xsys); cleanup(0); } else unlink(tcfile); } cleanup(code) int code; { rmlock(NULL); DEBUG(1, "exit code %d\n", code); exit(code); } tfile[0] = XQTPRE; if (strcmp(xsys, local) == SAME) { link(rxfile, tfile); unlink(rxfile); if (startjob) if (rflag) xuucico(""); else xuuxqt(); } else { GENSEND(fpc, rxfilecmd/uucp/uuxqt.c 644 0 33 16777 2347036464 7156 #include "uucp.h" #include "uucpdefs.h" #include #include #include #define APPCMD(d) {\ char *p;\ for (p = d; *p != '\0';) *cmdp++ = *p++;\ *cmdp++ = ' ';\ *cmdp = '\0';} /* * uuxqt will execute commands set up by a uux command, * usually from a remote machine - set by uucp. */ char *Cmds[] = { "rmail", "rnews", "vpr", "w", "fsend", "fget", "uusend", "cp", NULL }; #define PATH "PATH=/bin:/usr/bin;" /* to remove restrictions from uuxqt * define ALLOK 1 * * to add allowable commands, add to the list under Cmds[] */ main(argc, argv) char *argv[]; { char xcmd[100]; int cmdnok; char xfile[MAXFULLNAME], user[32], buf[BUFSIZ]; char lbuf[30]; char cfile[NAMESIZE], dfile[MAXFULLNAME]; char file[NAMESIZE]; char fin[MAXFULLNAME], sysout[NAMESIZE], fout[MAXFULLNAME]; FILE *xfp, *dfp, *fp; char path[MAXFULLNAME]; char cmd[BUFSIZ]; char *cmdp, prm[MAXFULLNAME], *ptr; char *getprm(); int uid, ret; int stcico = 0; char rnum[5]; uucpname(Myname); Ofn = 1; Ifn = 0; while (argc>1 && argv[1][0] == '-') { switch(argv[1][1]){ case 'x': Debug = atoi(&argv[1][2]); if (Debug <= 0) Debug = 1; break; default: sprintf(stderr, "unknown flag %s\n", argv[1]); break; } --argc; argv++; } DEBUG(4, "\n\n** %s **\n", "START"); chdir(Spool); strcpy(Wrkdir, Spool); uid = getuid(); guinfo(uid, User, path); DEBUG(4, "User - %s\n", User); if (ulockf(X_LOCK, X_LOCKTIME) != 0) exit(0); DEBUG(4, "process %s\n", ""); while (gtxfile(xfile) > 0) { DEBUG(4, "xfile - %s\n", xfile); xfp = fopen(xfile, "r"); ASSERT(xfp != NULL, "CAN'T OPEN %s", xfile); /* initialize to default */ strcpy(user, User); strcpy(fin, "/dev/null"); strcpy(fout, "/dev/null"); sprintf(sysout, "%.7s", Myname); while (fgets(buf, BUFSIZ, xfp) != NULL) { switch (buf[0]) { case X_USER: sscanf(&buf[1], "%s%s", user, Rmtname); break; case X_STDIN: sscanf(&buf[1], "%s", fin); expfile(fin); break; case X_STDOUT: ss((canf(&buf[1], "%s%s", fout, sysout); sysout[7] = '\0'; if (fout[0] != '~' || prefix(sysout, Myname)) expfile(fout); break; case X_CMD: strcpy(cmd, &buf[2]); if (*(cmd + strlen(cmd) - 1) == '\n') *(cmd + strlen(cmd) - 1) = '\0'; break; default: break; } } fclose(xfp); DEBUG(4, "fin - %s, ", fin); DEBUG(4, "fout - %s, ", fout); DEBUG(4, "sysout - %s, ", sysout); DEBUG(4, "user - %s\n", user); DEBUG(4, "cmd - %s\n", cmd); /* command execution */ if (strcmp(fout, "/dev/null") == SAME) strcpy(dfile,"/dev/null"); else gename(DATAPRE, sysout, 'O', dfile); /* expand file names where necessary */ expfile(dfile); strcpy(buf, PATH); cmdp = buf + strlen(buf); ptr = cmd; xcmd[0] = '\0'; cmdnok = 0; while ((ptr = getprm(ptr, prm)) != NULL) { if (prm[0] == ';' || prm[0] == '^' || prm[0] == '|') { xcmd[0] = '\0'; APPCMD(prm); continue; } if ((cmdnok = cmdok(xcmd, prm)) != 0) /* command not valid */ break; if (prm[0] == '~') expfile(prm); APPCMD(prm); } if (cmdnok) { sprintf(lbuf, "%s XQT DENIED", user); logent(cmd, lbuf); DEBUG(4, "bad command %s\n", prm); notify(user, Rmtname, cmd, "DENIED"); goto rmfiles; } sprintf(lbuf, "%s XQT", user); logent(buf, lbuf); DEBUG(4, "cmd %s\n", buf); mvxfiles(xfile); chdir(XQTDIR); ret = shio(buf, fin, dfile, user); sprintf(rnum, "%d", ret); if (ret != 0 || strcmp(xcmd, "rmail") != SAME && strcmp(xcmd, "rnews") != SAME) notify(user, Rmtname, cmd, rnum); DEBUG(4, "exit cmd - %d\n", ret); chdir(Spool); rmxfiles(xfile); if (ret != 0) { /* exit status not zero */ dfp = fopen(dfile, "a"); ASSERT(dfp != NULL, "CAN'T OPEN %s", dfile); fprintf(dfp, "exit status %d", ret); fclose(dfp); } if (strcmp(fout, "/dev/null") != SAME) { if (prefix(sysout, Myname)) { xmv(dfile, fout); } else { gename(CMDPRE, sysout, 'O', cfile); fp = fopen(cfile, "w"); ASSERT(fp != NULL, "OPEN %s", cfile); chmod(cfile, 0666); fprintf(fp, "S %s %s %s - %s 0666\n", dfile, fout, user, lastpart(dfile)); fclose(fp); } } rmfiles: xfp = fopen(xfile, "r"); ASSERT(xfp != NULL, "CAN'T OPEN %s", xfile); while (fgets(buf, BUFSIZ, xfp) != NULL) { if (buf[0] != X_RQDFILE) continue; sscanf(&buf[1], "%s", file); unlink(file); } unlink(xfile); } if (stcico) xuucico(""); cleanup(0); } cleanup(code) int code; { logcls(); rmlock(NULL); exit(code); } /******* * gtxfile(file) get a file to execute * char *file; * * return codes: 0 - no file | 1 - file to execute */ gtxfile(file) char *file; { static FILE *pdir; char pre[2]; if (pdir == NULL) { pdir = fopen(Spool, "r"); ASSERT(pdir != NULL, "GTXFILE CAN'T OPEN %s", Spool); } pre[0] = XQTPRE; pre[1] = '\0'; while (gnamef(pdir, file) != 0) { DEBUG(4, "file - %s\n", file); if (!prefix(pre, file)) continue; if (gotfiles(file)) /* return file to execute */ return(1); } fclose(pdir); return(0); } /*** * gotfiles(file) check for needed files * char *file; * * return codes: 0 - not ready | 1 - all files ready */ gotfiles(file) char *file; { struct stat stbuf; FILE *fp; char buf[BUFSIZ], rqfile[MAXFULLNAME]; fp = fopen(file, "r"); if (fp == NULL) return(0); while (fgets(buf, BUFSIZ, fp) != NULL) { DEBUG(4, "%s\n", buf); if (buf[0] != X_RQDFILE) continue; sscanf(&buf[1], "%s", rqfile); expfile(rqfile); if (stat(rqfile, &stbuf) == -1) { fclose(fp); return(0); } } fclose(fp); return(1); } /*** * rmxfiles(xfile) remove execute files to x-directory * char *xfile; * * return codes - none */ rmxfiles(xfile) char *xfile; { FILE *fp; char buf[BUFSIZ], file[NAMESIZE], tfile[NAMESIZE]; char tfull[MAXFULLNAME]; if((fp = fopen(xfile, "r")) == NULL) return; while (fgets(buf, BUFSIZ, fp) != NULL) { if (buf[0] != X_RQDFILE) continue; if (sscanf(&buf[1], "%s%s", file, tfile) < 2) continue; sprintf(tfull, "%s/%s", XQTDIR, tfile); unlink(tfull); } fclose(fp); return; } /*** * mvxfiles(xfile) move execute files to x-directory * char *xfile; * * return codes - none */ mvxfiles(xfile) char *xfile; { FILE *fp; char buf[BUFSIZ], ffile[MAXFULLNAME], tfile[NAMESIZE]; char tfull[MAXFULLNAME]; int ret; if((fp = fopen(xfile, "r")) == NULL) return; while (fgets(buf, BUFSIZ, fp) != NULL) { if (buf[0] != X_RQDFILE) continue; if (sscanf(&buf[1], "%s%s", ffile, tfile) < 2) continue; expfile(ffile); sprintf(tfull, "%s/%s", XQTDIR, tfile); unlink(tfull); ret = link(ffile, tfull); ASSERT(ret == 0, "LINK RET-%d", ret); unlink(ffile); } fclose(fp); return; } /*** * cmdok(xc, cmd) check for valid command * *NOTE - side effect is to set xc to the * command to be executed. * char *xc, *cmd; * * return 0 - ok | 1 nok */ cmdok(xc, cmd) char *xc, *cmd; { char **ptr; if (xc[0] != '\0') return(0); #ifndef ALLOK ptr = Cmds; while(*ptr != NULL) { if (strcmp(cmd, *ptr) == SAME) break; ptr++; } if (*ptr == NULL) return(1); #endif strcpy(xc, cmd); return(0); } /*** * notify send mail to user giving execution results * return code - none * This program assumes new mail command - send remote mail */ notify(user, rmt, cmd, str) char *user, *rmt, *cmd, *str; { char text[100]; char ruser[100]; sprintf(text, "uuxqt cmd (%s) status (%s)", cmd, str); if (prefix(rmt, Myname)) strcpy(ruser, user); else sprintf(ruser, "%s!%s", rmt, user); mailst(ruser, text); return; } ecmd/uucp/gename.c 644 0 33 2251 2153647225 7160 #include "uucp.h" /******* * gename(pre, sys, grade, file) generate file name * char grade, *sys, pre, *file; * * return codes: none */ gename(pre, sys, grade, file) char pre, *sys, grade, *file; { char sqnum[5]; getseq(sqnum); sprintf(file, "%c.%.7s%c%.4s", pre, sys, grade, sqnum); DEBUG(4, "file - %s\n", file); return; } #define SLOCKTIME 10L #define SLOCKTRIES 5 #define SEQLEN 4 /******* * getseq(snum) get next sequence number * char *snum; * * return codes: none */ getseq(snum) char *snum; { FILE *fp; int n; for (n = 0; n < SLOCKTRIES; n++) { if (!ulockf( SEQLOCK, SLOCKTIME)) break; sleep(5); } ASSERT(n < SLOCKTRIES, "CAN NOT GET %s", SEQLOCK); if ((fp = fopen(SEQFILE, "r")) != NULL) { /* read sequence number file */ fscanf(fp, "%4d", &n); fp = freopen(SEQFILE, "w", fp); ASSERT(fp != NULL, "CAN NOT OPEN %s", SEQFILE); chmod(SEQFILE, 0666); } else { /* can not read file - create a new one */ if ((fp = fopen(SEQFILE, "w")) == NULL) /* can not write new seqeunce file */ return(FAIL); chmod(SEQFILE, 0666); n = 0; } fprintf(fp, "%s", sprintf(snum, "%04d", ++n)); fclose(fp); rmlock(SEQLOCK); return(0); } %s", SEQLOCK); if ((fp = fopen(SEQFILE, "r")) != NULL) { /* read sequence number file */ fscanf(fp, "%4d", &n); fp = freopen(SEQFILE, "w", fp); ASSERT(fp != NULL, "CAN NOT OPEN %s", SEQFILE); chmod(SEQFILE, 0666); } else { /* can not read file - create a new one */ if ((fp = fopen(SEQFILE, "w")) == NULL) /* can not writecmd/uucp/getargs.c 644 0 33 1110 2153647262 7352 #include /******* * getargs(s, arps) * char *s, *arps[]; * * getargs - this routine will generate a vector of * pointers (arps) to the substrings in string "s". * Each substring is separated by blanks and/or tabs. * * return - the number of subfields. */ getargs(s, arps) char *s, *arps[]; { int i; i = 0; while (1) { arps[i] = NULL; while (*s == ' ' || *s == '\t') *s++ = '\0'; if (*s == '\n') *s = '\0'; if (*s == '\0') break; arps[i++] = s++; while (*s != '\0' && *s != ' ' && *s != '\t' && *s != '\n') s++; } return(i); } * * getargs - this routine will generate a vector of * pointers (arps) to the substrings in string "s". * Each substring is separated by blanks and/or tabs. * * return - the number of subfields. */ getargs(s, arps) char *s, *arps[]; { int i; i = 0; while (1) { arps[i] = NULL; while (*s == ' ' || *s == '\t') *s++ = '\0'; if (*s == '\n') *s = '\0'; if (*s == '\0') break; arps[i++] = s++; while (*s != '\0'cmd/uucp/getpwinfo.c 644 0 33 1564 2153647300 7726 #include "uucp.h" #include /******* * guinfo(uid, name, path) get passwd file info for uid * int uid; * char *path, *name; * * return codes: 0 | FAIL */ guinfo(uid, name, path) int uid; char *path, *name; { struct passwd *pwd; struct passwd *getpwuid(); if ((pwd = getpwuid(uid)) == NULL) { /* can not find uid in passwd file */ *path = '\0'; return(FAIL); } strcpy(path, pwd->pw_dir); strcpy(name, pwd->pw_name); return(0); } /*** * gninfo(name, uid, path) get passwd file ((info for name * char *path, *name; * int *uid; * * return codes: 0 | FAIL */ gninfo(name, uid, path) char *path, *name; int *uid; { struct passwd *pwd; struct passwd *getpwnam(); if ((pwd = getpwnam(name)) == NULL) { /* can not find name in passwd file */ *path = '\0'; return(FAIL); } strcpy(path, pwd->pw_dir); *uid = pwd->pw_uid; return(0); } return(FAIL); } strcpy(path, pwd->pw_dir); strcpy(name, pwd->pw_name); return(0); } /*** * gninfo(name, uid, path) get passwd file cmd/uucp/gio.c 644 0 33 5444 2153647317 6513 #define USER 1 #include #include #include #include #include #include "uucp.h" jmp_buf Failbuf; struct pack *Pk; pkfail() { longjmp(Failbuf, 1); } gturnon() { int ret; struct pack *pkopen(); if (setjmp(Failbuf)) return(FAIL); if (Pkdrvon) { ret = pkon(Ofn, PACKSIZE); DEBUG(4, "pkon - %d ", ret); DEBUG(4, "Ofn - %d\n", Ofn); if (ret <= 0) return(FAIL); } else { if (Debug > 4) pkdebug = 1; Pk = pkopen(Ifn, Ofn); if ((int) Pk == NULL) return(FAIL); } return(0); } gturnoff() { if(setjmp(Failbuf)) return(FAIL); if (Pkdrvon) pkoff(Ofn); else pkclose(Pk); return(0); } gwrmsg(type, str, fn) char type, *str; int fn; { char bufr[BUFSIZ], *s; int len, i, ret; if(setjmp(Failbuf)) return(FAIL); bufr[0] = type; s = &bufr[1]; while (*str) *s++ = *str++; *s = '\0'; if (*(--s) == '\n') *s = '\0'; len = strlen(bufr) + 1; if ((i = len % PACKSIZE)) { len = len + PACKSIZE - i; bufr[len - 1] = '\0'; } ret = gwrblk(bufr, len, fn); return(0); } grdmsg(str, fn) char *str; int fn; { unsigned len; if(setjmp(Failbuf)) return(FAIL); for (;;) { if (Pkdrvon) len = read(fn, str, PACKSIZE); else len = pkread(Pk, str, PACKSIZE); str += len; if (*(str - 1) == '\0') break; } return(0); } gwrdata(fp1, fn) FILE *fp1; int fn; { char bufr[BUFSIZ]; int len; int ret; time_t t1, t2; long bytes; char text[BUFSIZ]; if(setjmp(Failbuf)) return(FAIL); bytes = 0L; time(&t1); while ((len = fread(bufr, sizeof (char), BUFSIZ, fp1)) > 0) { bytes += len; ret = gwrblk(bufr, len, fn); if (ret != len) { return(FAIL); } if (len != BUFSIZ) break; } ret = gwrblk(bufr, 0, fn); time(&t2); sprintf(text, "sent data %D bytes %D secs", bytes, t2 - t1); DEBUG(1, "%s\n", text); syslog(text); sysacct(bytes, t2 - t1); return(0); } grddata(fn, fp2) FILE *fp2; int fn; { int len; char bufr[BUFSIZ]; time_t t1, t2; long bytes; char text[BUFSIZ]; if(setjmp(Failbuf)) return(FAIL); bytes = 0L; time(&t1); for (;;) { len = grdblk(bufr, BUFSIZ, fn); if (len < 0) { return(FAIL); } bytes += len; fwrite(bufr, sizeof (char), len, fp2); if (len < BUFSIZ) break; } time(&t2); sprintf(text, "received data %D bytes %D secs", bytes, t2 - t1); DEBUG(1, "%s\n", text); syslog(text); sysacct(bytes, t2 - t1); return(0); } grdblk(blk, len, fn) int fn, len; char *blk; { int i, ret; for (i = 0; i < len; i += ret) { if (Pkdrvon) ret = read(fn, blk, len - i); else ret = pkread(Pk, blk, len - i); if (ret < 0) return(FAIL); blk += ret; if (ret == 0) return(i); } return(i); } gwrblk(blk, len, fn) char *blk; unsigned len; int fn; { int ret; if (Pkdrvon) ret = write(fn, blk, len); else ret = pkwrite(Pk, blk, len); return(ret); } n", text); syslog(text); sysacct(bytes, t2 - t1); return(0); } grdblk(blk, len, fn) int fn, len; char *blk; { int i, ret; for (i = 0; i < len; i += ret) { if (Pkdrvon) ret = read(fn, blk, len - i); else cmd/uucp/gwd.c 644 0 33 611 2153647340 6461 #include "uucp.h" /******* * gwd(wkdir) get working directory * * return codes 0 | FAIL */ gwd(wkdir) char *wkdir; { FILE *fp; extern FILE *popen(), *pclose(); char *c; if ((fp = popen("pwd", "r")) == NULL) return(FAIL); if (fgets(wkdir, 100, fp) == NULL) { pclose(fp); return(FAIL); } if (*(c = wkdir + strlen(wkdir) - 1) == '\n') *c = '\0'; pclose(fp); return(0); } ; char *blk; { int i, ret;/,5h< /,"cmd/uucp/imsg.c 644 0 33 2114 2153647634 6665 #include "uucp.h" char Msync[2] = "\020"; /******* * imsg(msg, fn) * char *msg; * int fn; * * imsg - this is the initial read message routine - * used before a protocol is agreed upon. * * return codes: * EOF - no more messages * 0 - message returned */ imsg(msg, fn) char *msg; int fn; { int ret; DEBUG(7, "imsg %s>", ""); while ((ret = read(fn, msg, 1)) == 1) { DEBUG(7, "%c", (*msg > 037) ? *msg : '-'); if (*msg == Msync[0]) break; } DEBUG(7, "%s\n", "<"); if (ret < 1) return(EOF); while (read(fn, msg, 1) == 1) { DEBUG(7, "%c", (*msg > 037) ? *msg : '-'); if (*msg == '\n') break; if (*msg == '\0') break; msg++; } *msg = '\0'; return(0); } /*** * omsg(type, msg, fn) * char type, *msg; * int fn; * * omsg - this is the initial write message routine - * used before a protocol is agreed upon. * * return code: always 0 */ omsg(type, msg, fn) char *msg, type; int fn; { char buf[BUFSIZ], *c; c = buf; *c++ = Msync[0]; *c++ = type; while (*msg) *c++ = *msg++; *c++ = '\0'; write(fn, buf, strlen(buf) + 1); return(0); } g : '-'); if (*msg == '\n') break; if (*msg == '\0') break; msg++; } *msg = '\0'; return(0); } /*** * omsg(type, msg, fn) * char type, *msg; * int fn; * * omsg - this is the initial write message routine - * used before a protocol is agreed upon. * * return code: always 0 */ omsg(type, msg, fn) char *msg, type; int fn; { char buf[BUFSIZ], *c; c = buf; *c++ = Msync[0]; *c++ = type; while (*msg) *cmd/uucp/index.c 644 0 33 501 2153647634 7013 #include /******* * char * * index(str, c) return pointer to character c * char c, *str; * * return codes: * NULL - character not found * pointer - pointer to character */ char * index(str, c) char c, *str; { for (; *str != '\0'; str++) { if (*str == c) return(str); } return(NULL); } a protocol is agreed upon. * * return code: always 0 */ omsg(type, msg, fn) char *msg, type; i/,5< /,"cmd/uucp/ioctl.c 644 0 33 754 2153647634 7030 #include "uucp.h" #include /******* * ioctl(fn, com, ttbuf) for machines without ioctl * int fn, com; * struct sgttyb *ttbuf; * * return codes - same as stty and gtty */ ioctl(fn, com, ttbuf) int fn, com; struct sgttyb *ttbuf; { struct sgttyb tb; switch (com) { case TIOCHPCL: gtty(fn, &tb); tb.sg_flags |= 1; return(stty(fn, &tb)); case TIOCGETP: return(gtty(fn, ttbuf)); case TIOCSETP: return(stty(fn, ttbuf)); case TIOCEXCL: default: return(-1); } } ,"cmd/uucp/lastpart.c 644 0 33 406 2153647634 7542 /******* * char * * lastpart(file) find last part of file name * char *file; * * return - pointer to last part */ char * lastpart(file) char *file; { char *c; c = file + strlen(file); while (c >= file) if (*(--c) == '/') break; return(++c); } tb; switch (com) { case TIOCHPCL: gtty(fn, &tb); tb.sg_flags |= 1; return(stty(fn, &tb)); case TIOCGETP: return(gtty(fn, ttbuf)); case TIOCSETP: /,5< /,"((cmd/uucp/pk0.c 644 0 33 23532 2153676350 6444 #define USER 1 #include #include #include #include #include /* * packet driver */ char next[8] ={ 1,2,3,4,5,6,7,0}; /* packet sequence numbers */ char mask[8] ={ 1,2,4,010,020,040,0100,0200 }; struct pack *pklines[NPLINES]; /* * receive control messages */ pkcntl(c, pk) register struct pack *pk; { register cntl, val; val = c & MOD8; cntl = (c>>3) & MOD8; if ( ! ISCNTL(c) ) { fprintf(stderr, "not cntl\n"); return; } if (pk->p_mode & 02) fprintf(stderr, "%o ",c); switch(cntl) { case INITB: val++; pk->p_xsize = pksizes[val]; pk->p_lpsize = val; pk->p_bits = DTOM(pk->p_xsize); if (pk->p_state & LIVE) { pk->p_msg |= M_INITC; break; } pk->p_state |= INITb; if ((pk->p_state & INITa)==0) { break; } pk->p_rmsg &= ~M_INITA; pk->p_msg |= M_INITC; break; case INITC: if ((pk->p_state&INITab)==INITab) { pk->p_state = LIVE; WAKEUP(&pk->p_state); pk->p_rmsg &= ~M_INITB; } else pk->p_msg |= M_INITB; if (val) pk->p_swindow = val; break; case INITA: if (val==0 && pk->p_state&LIVE) { fprintf(stderr, "alloc change not implemented\n"); break; } if (val) { pk->p_state |= INITa; pk->p_msg |= M_INITB; pk->p_rmsg |= M_INITB; pk->p_swindow = val; } break; case RJ: pk->p_state |= RXMIT; pk->p_msg |= M_RR; case RR: pk->p_rpr = val; if (pksack(pk)==0) { WAKEUP(&pk->p_ps); } break; case SRJ: fprintf(stderr, "srj not implemented\n"); break; case CLOSE: pk->p_state = DOWN+RCLOSE; SIGNAL; WAKEUP(&pk->p_pr); WAKEUP(&pk->p_ps); WAKEUP(&pk->p_state); return; } out: if (pk->p_msg) pkoutput(pk); } pkaccept(pk) register struct pack *pk; { register x,seq; char m, cntl, *p, imask, **bp; int bad,accept,skip,s,t,h,cc; unsigned short sum; bad = accept = skip = 0; /* * wait for input */ LOCK; x = next[pk->p_pr]; while ((imask=pk->p_imap) == 0 && pk->p_rcount==0) { PKGETPKT(pk); SLEEP(&pk->p_pr, PKIPRI); } pk->p_imap = 0; UNLOCK; /* * determine input window in m. */ t = (~(-1<p_rwindow)) <>8; /* * mark newly accepted input buffers */ for(x=0; x<8; x++) { if ((imask & mask[x]) == 0) continue; if (((cntl=pk->p_is[x])&0200)==0) { bad++; free: bp = (char **)pk->p_ib[x]; LOCK; *bp = (char *)pk->p_ipool; pk->p_ipool = bp; pk->p_is[x] = 0; UNLOCK; continue; } pk->p_is[x] = ~(B_COPY+B_MARK); sum = (unsigned)chksum(pk->p_ib[x], pk->p_rsize) ^ (unsigned)(cntl&0377); sum += pk->p_isum[x]; if (sum == CHECK) { seq = (cntl>>3) & MOD8; if (m & mask[seq]) { if (pk->p_is[seq] & (B_COPY | B_MARK)) { dup: pk->p_msg |= M_RR; skip++; goto free; } if (x != seq) { LOCK; p = pk->p_ib[x]; pk->p_ib[x] = pk->p_ib[seq]; pk->p_is[x] = pk->p_is[seq]; pk->p_ib[seq] = p; UNLOCK; } pk->p_is[seq] = B_MARK; accept++; cc = 0; if (cntl&B_SHORT) { pk->p_is[seq] = B_MARK+B_SHORT; p = pk->p_ib[seq]; cc = (unsigned)*p++ & 0377; if (cc & 0200) { cc &= 0177; cc |= *p << 7; } } pk->p_isum[seq] = pk->p_rsize - cc; } else { goto dup; } } else { bad++; goto free; } } /* * scan window again turning marked buffers into * COPY buffers and looking for missing sequence * numbers. */ accept = 0; for(x=next[pk->p_pr],t=h= -1; m & mask[x]; x = next[x]) { if (pk->p_is[x] & B_MARK) pk->p_is[x] |= B_COPY; /* hole code if (pk->p_is[x] & B_COPY) { if (h<0 && t>=0) h = x; } else { if (t<0) t = x; } */ if (pk->p_is[x] & B_COPY) { if (t >= 0) { bp = (char **)pk->p_ib[x]; LOCK; *bp = (char *)pk->p_ipool; pk->p_ipool = bp; pk->p_is[x] = 0; UNLOCK; skip++; } else accept++; } else { if (t<0) t = x; } } if (bad) { pk->p_msg |= M_RJ; } if (skip) { pk->p_msg |= M_RR; } pk->p_rcount = accept; return(accept); } pkread(S) SDEF; { register struct pack *pk; register x,s; int is,cc,xfr,count; char *cp, **bp; pk = PADDR; xfr = 0; count = 0; while (pkaccept(pk)==0); while (UCOUNT) { x = next[pk->p_pr]; is = pk->p_is[x]; if (is & B_COPY) { cc = MIN(pk->p_isum[x], UCOUNT); if (cc==0 && xfr) { break; } if (is & B_RESID) cp = pk->p_rptr; else { cp = pk->p_ib[x]; if (is & B_SHORT) { if (*cp++ & 0200) *cp++; } } IOMOVE(cp,cc,B_READ); count += cc; xfr++; pk->p_isum[x] -= cc; if (pk->p_isum[x] == 0) { pk->p_pr = x; bp = (char **)pk->p_ib[x]; LOCK; *bp = (char *)pk->p_ipool; pk->p_ipool = bp; pk->p_is[x] = 0; pk->p_rcount--; UNLOCK; pk->p_msg |= M_RR; } else { pk->p_rptr = cp+cc; pk->p_is[x] |= B_RESID; } if (cc==0) break; } else break; } pkoutput(pk); return(count); } pkwrite(S) SDEF; { register struct pack *pk; register x; int partial; caddr_t cp; int cc, s, fc, count; int pktimeout(); pk = PADDR; if (pk->p_state&DOWN || !pk->p_state&LIVE) { SETERROR; return(-1); } count = UCOUNT; do { LOCK; while (pk->p_xcount>=pk->p_swindow) { pkoutput(pk); PKGETPKT(pk); SLEEP(&pk->p_ps,PKOPRI); } x = next[pk->p_pscopy]; while (pk->p_os[x]!=B_NULL) { PKGETPKT(pk); SLEEP(&pk->p_ps,PKOPRI); } pk->p_os[x] = B_MARK; pk->p_pscopy = x; pk->p_xcount++; UNLOCK; cp = pk->p_ob[x] = GETEPACK; partial = 0; if ((int)UCOUNT < pk->p_xsize) { cc = UCOUNT; fc = pk->p_xsize - cc; *cp = fc&0177; if (fc > 127) { *cp++ |= 0200; *cp++ = fc>>7; } else cp++; partial = B_SHORT; } else cc = pk->p_xsize; IOMOVE(cp,cc,B_WRITE); pk->p_osum[x] = chksum(pk->p_ob[x], pk->p_xsize); pk->p_os[x] = B_READY+partial; pkoutput(pk); } while (UCOUNT); return(count); } pksack(pk) register struct pack *pk; { register x, i; i = 0; for(x=pk->p_ps; x!=pk->p_rpr; ) { x = next[x]; if (pk->p_os[x]&B_SENT) { i++; pk->p_os[x] = B_NULL; pk->p_state &= ~WAITO; pk->p_xcount--; FREEPACK(pk->p_ob[x], pk->p_bits); pk->p_ps = x; WAKEUP(&pk->p_ps); } } return(i); } pkoutput(pk) register struct pack *pk; { register x,rx; int s; char bstate; int i; SDEF; int flag; flag = 0; ISYSTEM; LOCK; if (pk->p_obusy++ || OBUSY) { pk->p_obusy--; UNLOCK; return; } UNLOCK; /* * find seq number and buffer state * of next output packet */ if (pk->p_state&RXMIT) { pk->p_nxtps = next[pk->p_rpr]; flag++; } x = pk->p_nxtps; bstate = pk->p_os[x]; /* * Send control packet if indicated */ if (pk->p_msg) { if (pk->p_msg & ~M_RR || !(bstate&B_READY) ) { x = pk->p_msg; for(i=0; i<8; i++) if (x&1) break; else x >>= 1; x = i; x <<= 3; switch(i) { case CLOSE: break; case RJ: case RR: x += pk->p_pr; break; case SRJ: break; case INITB: x += pksize(pk->p_rsize); break; case INITC: x += pk->p_rwindow; break; case INITA: x += pk->p_rwindow; break; } pk->p_msg &= ~mask[i]; pkxstart(pk, x, -1); goto out; } } /* * Don't send data packets if line is marked dead. */ if (pk->p_state&DOWN) { WAKEUP(&pk->p_ps); goto out; } /* * Start transmission (or retransmission) of data packets. */ if (bstate & (B_READY|B_SENT)) { char seq; bstate |= B_SENT; seq = x; pk->p_nxtps = next[x]; x = 0200+pk->p_pr+(seq<<3); if (bstate & B_SHORT) x |= 0100; pkxstart(pk, x, seq); pk->p_os[seq] = bstate; pk->p_state &= ~RXMIT; pk->p_nout++; goto out; } /* * enable timeout if there's nothing to send * and transmission buffers are languishing */ if (pk->p_xcount) { pk->p_timer = 2; pk->p_state |= WAITO; } else pk->p_state &= ~WAITO; WAKEUP(&pk->p_ps); out: pk->p_obusy = 0; } /* * shut down line by * ignoring new input * letting output drain * releasing space and turning off line discipline */ pkclose(S) SDEF; { register struct pack *pk; register i,s,rbits; char **bp; int rcheck; char *p; pk = PADDR; pk->p_state |= DRAINO; /* * try to flush output */ i = 0; LOCK; pk->p_timer = 2; while (pk->p_xcount && pk->p_state&LIVE) { if (pk->p_state&(RCLOSE+DOWN) || ++i > 2) break; pkoutput(pk); SLEEP(&pk->p_ps,PKOPRI); } pk->p_timer = 0; pk->p_state |= DOWN; UNLOCK; /* * try to exchange CLOSE messages */ i = 0; while ((pk->p_state&RCLOSE)==0 && i<2) { pk->p_msg = M_CLOSE; pk->p_timer = 2; pkoutput(pk); SLEEP(&pk->p_ps, PKOPRI); i++; } for(i=0;ip_rsize); rcheck = 0; for (i=0;i<8;i++) { if (pk->p_os[i]!=B_NULL) { FREEPACK(pk->p_ob[i],pk->p_bits); pk->p_xcount--; } if (pk->p_is[i]!=B_NULL) { FREEPACK(pk->p_ib[i],rbits); rcheck++; } } LOCK; while (pk->p_ipool != NULL) { bp = pk->p_ipool; pk->p_ipool = (char **)*bp; rcheck++; FREEPACK(bp, rbits); } UNLOCK; if (rcheck != pk->p_rwindow) { fprintf(stderr, "r short %d want %d\n",rcheck,pk->p_rwindow); fprintf(stderr, "rcount = %d\n",pk->p_rcount); fprintf(stderr, "xcount = %d\n",pk->p_xcount); } FREEPACK((caddr_t)pk, npbits); } pkreset(pk) register struct pack *pk; { pk->p_ps = pk->p_pr = pk->p_rpr = 0; pk->p_nxtps = 1; } chksum(s,n) register char *s; register n; { register short sum; register unsigned short t; register short x; sum = -1; x = 0; do { if (sum<0) { sum <<= 1; sum++; } else sum <<= 1; t = sum; sum += (unsigned)*s++ & 0377; x += sum^n; if ((unsigned)sum <= t) {(( sum ^= x; } } while (--n > 0); return(sum); } pkline(pk) register struct pack *pk; { register i; for(i=0;i>= 5; for(k=0; n >>= 1; k++); return(k); } -1; x = 0; do { if (sum<0) { sum <<= 1; sum++; } else sum <<= 1; t = sum; sum += (unsigned)*s++ & 0377; x += sum^n; if ((unsigned)sum <= t) {cmd/uucp/pkon.c 644 0 33 27 2153647636 6640 pkon() { } pkoff() { } ile (--n > 0); return(sum); } pkline(pk) register struct pack *pk; { register i; for(i=0;i>= 5; for(k=0; n >>= 1; k++); return(k); } -1; x = 0; do { if (sum<0) { sum <<= 1; sum++; } else sum/,5Ȉ< /,"cmd/uucp/prefix.c 644 0 33 356 2153647636 7213 /******* * prefix(s1, s2) check s2 for prefix s1 * char *s1, *s2; * * return 0 - != * return 1 - == */ prefix(s1, s2) char *s1, *s2; { char c; while ((c = *s1++) == *s2++) if (c == '\0') return(1); return(c == '\0'); } (n--) *s++ = 0; } pksize(n) register n; { register k; n >>= 5; for(k=0; n >>= 1; k++); return(k); } -1; x = 0; do { if (sum<0) { sum <<= 1; sum++; } else sum/,5؈< /,"cmd/uucp/sdmail.c 644 0 33 2012 2153647636 7176 #include "uucp.h" #include /******* * sdmail(file, uid) * char *file, *uid; * * sdmail - this routine will determine the owner * of the file (file), create a message string and * call "mailst" to send the cleanup message. * This is only implemented for local system * mail at this time. */ sdmail(file, uid) char *file, *uid; { static struct passwd *pwd; struct passwd *getpwuid(); char mstr[40]; sprintf(mstr, "uuclean deleted file %s\n", file); if (pwd->pw_uid == uid) { mailst(pwd->pw_name, mstr); return(0); } setpwent(); if ((pwd = getpwuid(uid)) != NULL) { mailst(pwd->pw_name, mstr); } return(0); } /*** * mailst(user, str) * char *user, *str; * * mailst - this routine will fork and execute * a mail command sending string (str) to user (user). */ mailst(user, str) char *user, *str; { FILE *fp; extern FILE *popen(), *pclose(); char cmd[100]; sprintf(cmd, "mail %s", user); if ((fp = popen(cmd, "w")) == NULL) return; fprintf(fp, "%s", str); pclose(fp); return; } , mstr); return(0); } setpwent(); if ((pwd = getpwuid(uid)) != NULL) { mailst(pwd->pw_name, mstr); } return(0); } /*** * mailst(user, str) * char *user, *str; * * mailst - this routine will fork and execute * a mail command sending string (str) to user (user). */ mailst(user, str) char *user, *str; { FILE *fp; extern FILE *popen(), *pclose(); char cmd[100]; sprintf(cmd, "mail %s", user); if ((fp = popen(cmd, "w")) == NULL) return; fprintf(fp, "%s", str); pclose(fp); cmd/uucp/shio.c 644 0 33 1575 2153647637 6705 #include "uucp.h" /******* * shio(cmd, fi, fo, user) execute shell of command with * char *cmd, *fi, *fo; fi and fo as standard input/output * char *user; user name * * return codes: * 0 - ok * non zero - failed - status from child */ shio(cmd, fi, fo, user) char *cmd, *fi, *fo, *user; { int status, f; int uid, pid, ret; char path[MAXFULLNAME]; if (fi == NULL) fi = "/dev/null"; if (fo == NULL) fo = "/dev/null"; DEBUG(3, "shio - %s\n", cmd); if ((pid = fork()) == 0) { close(Ifn); close(Ofn); close(0); f = open(fi, 0); ASSERT(f == 0, "BAD OPEN fileno %d", f); close(1); f = creat(fo, 0666); ASSERT(f == 1, "BAD OPEN fileno %d", f); if (gninfo(user, &uid, path) == 0) setuid(uid); execl(SHELL, "sh", "-c", cmd, 0); exit(100); } while ((ret = wait(&status)) != pid && ret != -1); DEBUG(3, "status %d\n", status); return(status); } ULL) fi = "/dev/null"; if (fo == NULL) fo = "/dev/null"; DEBUG(3, "shio - %s\n", cmd); if ((pid = fork()) == 0) { close(Icmd/uucp/sysacct.c 644 0 33 260 2153647637 7362 #include /******* * sysacct(bytes, time) output accounting info * time_t time; * long bytes; */ sysacct(bytes, time) time_t time; long bytes; { return; } (gninfo(user, &uid, path) == 0) setuid(uid); execl(SHELL, "sh", "-c", cmd, 0); exit(100); } while ((ret = wait(&status)) != pid && ret != -1); DEBUG(3, "status %d\n", status); return(status); } ULL) fi = "/dev/null"; if (fo == NUL/,5< /,"cmd/uucp/uuclean.c 644 0 33 4575 2153647637 7402 #include "uucp.h" #include "uucpdefs.h" #include #include #include #include #include /******* * * uuclean - this program will search through the spool * directory (Spool) and delete all files with a requested * prefix which are older than (nomtime) seconds. * If the -m option is set, the program will try to * send mail to the usid of the file. * * options: * -m - send mail for deleted file * -d - directory to clean * -n - time to age files before delete (in hours) * -p - prefix for search * -x - turn on debug outputs * exit status: * 0 - normal return * 1 - can not read directory */ #define DPREFIX "U" #define NOMTIME 72 /* hours to age files before deletion */ main(argc, argv) char *argv[]; { FILE *pdirf; char file[NAMESIZE]; time_t nomtime, ptime; struct stat stbuf; int mflg=0; extern int onintr(); nomtime = NOMTIME * 3600L; while (argc>1 && argv[1][0] == '-') { switch (argv[1][1]) { case 'd': Spool = &argv[1][2]; break; case 'm': mflg = 1; break; case 'n': nomtime = atoi(&argv[1][2]) * 3600L; break; case 'p': if (&argv[1][2] != '\0') stpre(&argv[1][2]); break; case 'x': Debug = atoi(&argv[1][2]); if (Debug <= 0) Debug = 1; break; default: printf("unknown flag %s\n", argv[1]); break; } --argc; argv++; } DEBUG(4, "DEBUG# %s\n", "START"); chdir(Spool); if ((pdirf = fopen(Spool, "r")) == NULL) { printf("%s directory unreadable\n", Spool); exit(1); } time(&ptime); while (gnamef(pdirf, file)) { if (!chkpre(file)) continue; if (stat(file, &stbuf) == -1) { DEBUG(4, "stat on %s failed\n", file); continue; } if ((stbuf.st_mode & S_IFMT) == S_IFDIR) continue; if ((ptime - stbuf.st_ctime) < nomtime) continue; DEBUG(4, "unlink file %s\n", file); unlink(file); if (mflg) sdmail(file, stbuf.st_uid); } fclose(pdirf); exit(0); } #define MAXPRE 10 char Pre[MAXPRE][DIRSIZ]; int Npre = 0; /*** * chkpre(file) check for prefix * char *file; * * return codes: * 0 - not prefix * 1 - is prefix */ chkpre(file) char *file; { int i; for (i = 0; i < Npre; i++) { if (prefix(Pre[i], file)) return(1); } return(0); } /*** * stpre(p) store prefix * char *p; * * return codes: none */ stpre(p) char *p; { if (Npre < MAXPRE - 2) strcpy(Pre[Npre++], p); return; } ile, stbuf.st_uid); } fclose(pdirf); exit(0); } #define MAXPRE 10 char Pre[MAXPRE][DIRSIZ]; int Npre = 0; /*** * chkpre(file((cmd/uucp/uulog.c 644 0 33 6034 2153647640 7063 #include "uucp.h" #include "uucpdefs.h" #include #include #include #include int Stop = 0; /******* * * uulog - this program will append all update files in * directory (LOGDIR) to the log file (logf) and remove the * update files. * * options: * -n - nominal time for delete of lock file * -s - system name for search * -u - user name for search * -x - turn on debug outputs * * exit codes: * 0 - normal * 1 - lock file problems * */ #define NOMTIME 3600L main(argc, argv) char *argv[]; { FILE *plogf, *lsp; char filename[NAMESIZE]; time_t nomtime; char *system, *user; extern int onintr(), intr1(); char buf[BUFSIZ], u[20], s[20]; nomtime = NOMTIME; system = user = NULL; while (argc>1 && argv[1][0] == '-') { switch (argv[1][1]) { case 'd': printf("-d option removed\n"); break; case 'n': nomtime = atoi(&argv[1][2]); break; case 's': system = &argv[1][2]; break; case 'u': user = &argv[1][2]; break; case 'x': Debug = atoi(&argv[1][2]); if (Debug <= 0) Debug = 1; break; default: printf("unknown flag %s\n", argv[1]); break; } --argc; argv++; } DEBUG(4, "%s\n", "START"); chdir(LOGDIR); if (ulockf(LOGLOCK, nomtime) != 0) exit(0); signal(SIGHUP, intr1); signal(SIGINT,intr1); signal(SIGQUIT, intr1); if ((plogf = fopen(LOGFILE, "a")) == NULL) { rmlock(LOGLOCK); printf("can't open %s\n", LOGFILE); exit(0); } lsp = fopen(LOGDIR, "r"); ASSERT(lsp != NULL, "CAN NOT OPEN %s", LOGDIR); while ((gnamef(lsp, filename)) != 0) { DEBUG(4, "file-%s\n", filename); if (prefix(LOGPREFIX, filename)) { DEBUG(4, "copy file %s\n", filename); if (appendf(plogf, filename) == SUCCESS) { unlink(filename); } } } fclose(lsp); fclose(plogf); chmod(LOGFILE, 0666); rmlock(NULL); if (user == NULL && system == NULL) exit(0); if (Stop) exit(0); signal(SIGHUP, onintr); signal(SIGINT, onintr); signal(SIGQUIT, onintr); plogf = fopen(LOGFILE, "r"); ASSERT(plogf != NULL, "CAN NOT OPEN %s", LOGFILE); while (fgets(buf, BUFSIZ, plogf) != NULL) { sscanf(buf, "%s%s", u, s); DEBUG(4, "u s %s ", u); DEBUG(4, "%s ", s); DEBUG(4, "%s", buf); if (user != NULL && !prefix(user, u)) continue; if (system != NULL && !prefix(system, s)) continue; fputs(buf, stdout); } exit(0); } /*** * onintr() * * onintr - interrupt routine * remove lock file * */ onintr() { rmlock(NULL); exit(0); } intr1() { signal(SIGINT, intr1); signal(SIGHUP, intr1); signal(SIGQUIT, intr1); Stop = 1; return; } cleanup(code) int code; { exit(code); } /******* * appendf(fp, entryf) append file (entryf) to fp file * FILE *fp; * char *entryf; * * return codes: SUCCESS - ok * FAIL - file not readable */ appendf(fp, entryf) FILE *fp; char *entryf; { FILE *pentryf; char ltext[513]; if ((pentryf = fopen(entryf, "r")) == NULL) { /* file entryf not readable */ return(FAIL); } while (fgets(ltext, 512, pentryf)) fputs(ltext, fp); fclose(pentryf); return(SUCCESS); } T, intr1); Stop = 1; return; } cleanup(code) int code; { exit(code); } /******* * appendf(fp, entryf) append file (entryf) to fp file * FILE *fp; * char *entryf; * * return codes: SUCCESS - ok * FAIL - file not readable */ appendf(fp, entryf) FILE *fp; char *entryf; { FILE *pentryf; char ltext[513]; if ((pentryf = fopen(entryf, "r")) == NULL) { /* file entryf not readable */ return(FAIL); } while (fgets(ltext, 512, pentryf)) fputs(ltext, fp); fclose(pecmd/uucp/uurecover.c 644 0 33 2436 2153647641 7752 #include #include #include #include #include struct stat xstat; struct proc mproc[NPROC]; struct nlist nl[] { { "_proc"}, { ""}, }; int err; main(argc,argv) char **argv; { int i,j; if(argc<=1) exit(0); for(i=1;i0) if(isapid(j)) { fprintf(stderr,"recovery: %s in use\n",argv[i]); err=1; } else unlink(argv[i]); else fprintf(stderr,"reocvery: %s not a lock\n",argv[i]); } exit(err); } isalock(s) char *s; { int pid,fd; if(stat(s,&xstat)<0) return(0); if(xstat.st_size!=2) return(0); fd=open(s,0); if(fd<0) return(-1); read(fd,&pid,2); close(fd); return(pid); } int gotpids,pids[NPROC]; isapid(n) { int i; if(gotpids==0) getpids(); for(i=0;i /******* * xuucico(rmtname) start up uucico for rmtname * char *rmtname; * * return codes: none */ xuucico(rmtname) char *rmtname; { if (fork() == 0) { /* start uucico for rmtname system */ char opt[100]; close(0); close(1); close(2); open("/dev/null", 0); open("/dev/null", 1); open("/dev/null", 1); signal(SIGINT, SIG_IGN); signal(SIGHUP, SIG_IGN); signal(SIGQUIT, SIG_IGN); signal(SIGKILL, SIG_IGN); if (rmtname[0] != '\0') sprintf(opt, "-s%.7s", rmtname); else opt[0] = '\0'; execl(UUCICO, "UUCICO", "-r1", opt, 0); exit(100); } return; } /******* * xuuxqt() start up uuxqt * * return codes: none */ xuuxqt() { if (fork() == 0) { /* start uuxqt */ close(0); close(1); close(2); open("/dev/null", 2); open("/dev/null", 2); open("/dev/null", 2); signal(SIGINT, SIG_IGN); signal(SIGHUP, SIG_IGN); signal(SIGQUIT, SIG_IGN); signal(SIGKILL, SIG_IGN); execl(UUXQT, "UUXQT", 0); exit(100); } return; } xuucp(str) char *str; { char text[300]; if (fork() == 0) { /* start uucp */ close(0); close(1); close(2); open("/dev/null", 0); open("/dev/null", 1); open("/dev/null", 1); signal(SIGINT, SIG_IGN); signal(SIGHUP, SIG_IGN); signal(SIGQUIT, SIG_IGN); signal(SIGKILL, SIG_IGN); sprintf(text, "%s -r %s", UUCP, str); execl(SHELL, "sh", "-c", text, 0); exit(100); } sleep(15); return; } , SIG_IGN); signal(SIGKILL, SIG_IGN); execl(UUXQT, "UUXQT", 0); exit(100); } retcmd/uucp/USERFILE 644 0 33 14 2153651636 6655 ((uucp, / , / (str) char *str; { char text[300]; if (fork() == 0) { /* start uucp */ close(0); close(1); close(2); open("/dev/null", 0); open("/dev/null", 1); open("/dev/null", 1); signal(SIGINT, SIG_IGN); signal(SIGHUP, SIG_IGN); signal(SIGQUIT, SIG_IGN); signal(SIGKILL, SIG_IGN); sprintf(text, "%s -r %s", UUCP, str); execl(SHELL, "sh", "-c", text, 0); exit(100); } sleep(15); return;/,5h< /,"cmd/uucp/L.sys 644 0 33 25 2153651733 6447 research Any ACU 300 r *str; { char text[300]; if (fork() == 0) { /* start uucp */ close(0); close(1); close(2); open("/dev/null", 0); open("/dev/null", 1); open("/dev/null", 1); signal(SIGINT, SIG_IGN); signal(SIGHUP, SIG_IGN); signal(SIGQUIT, SIG_IGN); signal(SIGKILL, SIG_IGN); sprintf(text, "%s -r %s", UUCP, str); execl(SHELL, "sh", "-c", text, 0); exit(100); } sleep(15); return;/,5x< /,"cmd/uudiff/ 775 0 33 0 2552573471 6007 cmd/uudiff/Makefile 644 0 33 606 2421024047 7475 CFLAGS=-O uudiff: lenrem locpart printable run1 trim lenrem: lenrem.c cc $(CFLAGS) lenrem.c -o lenrem locpart: locpart.c cc $(CFLAGS) locpart.c -o locpart printable: printable.c cc $(CFLAGS) printable.c -o printable run1: run1.c cc $(CFLAGS) run1.c -o run1 trim: trim.c cc $(CFLAGS) trim.c -o trim install: : stuff lives here! clean: rm -f *.o lenrem locpart printable run1 trim (100); sleep(1/ C. /,"cmd/uudiff/lenrem.c 644 0 33 260 2111463530 7457 main(argc,argv) char *argv[]; { /* args: 1 is name to fix, 2 is this directory */ if (argv[1][0] == '/') printf("%s\n",argv[1]); else printf("%s/%s\n", argv[2], argv[1]); } ble.c cc $(CFLAGS) printable.c -o printable run1: run1.c cc $(CFLAGS) run1.c -o run1 trim: trim.c cc $(CFLAGS) trim.c -o trim install: : stuff lives here! clean: rm -f *.o lenrem locpart printable run1 trim (100); sleep(1//,5h< /,"cmd/uudiff/locpart.c 644 0 33 162 2111463530 7642 main(argc,argv) char *argv[]; { char *p; for (p=argv[1]; *p; p++); while (*p != '/') p--; printf("%s\n", p+1); } "%s\n",argv[1]); else printf("%s/%s\n", argv[2], argv[1]); } ble.c cc $(CFLAGS) printable.c -o printable run1: run1.c cc $(CFLAGS) run1.c -o run1 trim: trim.c cc $(CFLAGS) trim.c -o trim install: : stuff lives here! clean: rm -f *.o lenrem locpart printable run1 trim (100); sleep(1//,5x< /,"cmd/uudiff/printable.c 644 0 33 305 2111463530 10155 main(argc,argv) char *argv[]; { char b[512], *p; int f, c; f = open(argv[1], 0); if (f<0) return(1); p = b + read(f, b, 512); while (p>b) if ( (c= *--p) ==0 || (c&0200) ) return(1); return(0); } rintable.c -o printable run1: run1.c cc $(CFLAGS) run1.c -o run1 trim: trim.c cc $(CFLAGS) trim.c -o trim install: : stuff lives here! clean: rm -f *.o lenrem locpart printable run1 trim (100); sleep(1//,5< /,"cmd/uudiff/remdiff 755 0 33 3521 2111463530 7416 : 'usage: uudiff directory-local sys![directory-remote]' set UUDIR=/usr/src/cmd/uudiff set UUCP=/usr/src/cmd/uucp set SPOOL=/usr/tmp/uucp set UNIXNAME=vax1 set DIFF=YES case $1 in -d) set DIFF=NO; shift;; esac set HERE=`pwd` set ME=`getuid` set LOCAL=$1 set SYS=`echo $2 | sed "s/!.*//"` if [ $SYS = $2 ] then set SYS=$UNIXNAME fi set REMOTE=`echo $2 | sed "s/.*!//"` if [ x$REMOTE = x ] then set $REMOTE = $LOCAL fi set LOCAL=`$UUDIR/lenrem $LOCAL $HERE` set REMOTE=`$UUDIR/lenrem $REMOTE $HERE` set LOCDIR=$LOCAL set DIR=YES set REMDIR=$REMOTE if [ -f $LOCDIR ] then set LOCDIR=`$UUDIR/trim $LOCDIR` set REMDIR=`$UUDIR/trim $REMDIR` set DIR=NO fi cat >zza$pid <zzb$pid ! uucp -f zza$pid $SYS!ef$pid $UUCP/tdemon >>/$UUCP/tmess & if [ $SYS = research ] then cat >$SPOOL/cq$pid <<% zzb$pid cp zzb$pid $HERE/zzc$pid % else uucp -f -w $SYS!zzb$pid $HERE/zzc$pid fi $UUCP/tdemon >>/$UUCP/tmess & $UUCP/filsum $LOCAL >zzd$pid cat >$SPOOL/cz$pid <zzy$pid <<% rm zzb$pid % uucp -f zzy$pid $SYS!ey$pid rm zzy$pid cat >uudiff$pid <<% uudiff comparison of $LOCAL here with $REMOTE on system $SYS % $UUDIR/run1 zzd$pid zzc$pid zzl$pid | sort >>uudiff$pid cat >zzm$pid <<% cg$pid % cat >zzn$pid <<% chdir $HERE % if [ $DIFF = YES ] then if [ $DIR = NO ] then $UUDIR/locpart $LOCAL >zzl$pid fi for f in \`cat zzl${pid}\` do if $UUDIR/printable $LOCDIR/\$f then if [ $DIR = YES ] then uucp $SYS!$REMDIR/\$f \$f.$pid else uucp $SYS!$REMOTE \$f.$pid fi echo $HERE/\$f.$pid >>zzm$pid cat >>zzn$pid <<% echo >>uudiff$pid echo DIFF of \$f: '(< here, > remote)' >>uudiff$pid diff $LOCDIR/\$f \$f.$pid >>uudiff$pid % fi done fi cat >>zzn$pid <<% echo uudiff$pid arrived in $HERE "|" mail $ME rm zz?$pid % cat zzm$pid zzn$pid >>$SPOOL/cg$pid ! $UUCP/tdemon >>/$UUCP/tmess L >zzl$pid fi for f in \`cat zzl${pid}\` do if $UUDIR/printable $LOCDIR/\$f then if [ $DIR = YES ] then uucp $SYS!$REMDIR/\$f \$f.$pid else uucp $SYS!$REMOTE \cmd/uudiff/run1.c 644 0 33 2770 2111463530 7112 # include "stdio.h" # define LAST "\177\177" main (argc,argv) char *argv[]; { FILE *rem, *loc, *cfil; char namel[100], namer[100]; char cname[20], zname[20]; int mr, ml; long suml, sumr; ml=mr=1; loc = fopen(argv[1], "r"); rem = fopen (argv[2], "r"); cfil = fopen (argv[3], "w"); ml = fetch (loc, namel, &suml, ml); mr = fetch (rem, namer, &sumr, mr); while ( ml || mr) { int x; x = strcmp(namel, namer); if (x>0) x=1; if (x<0) x= -1; switch(x) { case -1: /* name l lower */ /* check that file is not our zz* tempfile */ if (notmp(namel, argv[2])) printf("Missing on remote system: %s\n",namel); ml = fetch (loc, namel, &suml, ml); continue; case 0: /* match names */ if (strcmp(namel, LAST)==0) exit(0); if (suml == sumr) printf("Presumed identical: %s\n",namel); else { printf("Differ: %s\n", namel); fprintf(cfil, "%s\n", namel); } ml=fetch(loc, namel, &suml, ml); mr=fetch(rem, namer, &sumr, mr); continue; case 1: /* name 2 lower */ printf((("Extraneous file on remote system: %s\n",namer); mr=fetch(rem, namer, &sumr, mr); continue; default: printf("illegal case %d\n", strcmp(namel,namer)); exit(0); } } } fetch (f, s, lp, m) FILE *f; char *s; long *lp; { char b[200]; if (m==0 ||fgets(b, 200, f)==0) { strcpy (s, LAST); return (0); } sscanf(b, "%s %lo", s, lp); return (1); } notmp(s1, s2) char *s1, *s2; { char bf1[20], bf2[20]; strcpy (bf1, s1); strcpy (bf2, s2); bf1[2]= bf2[2] = '0'; return (strcmp(bf1, bf2)); } printfcmd/uudiff/trim.c 644 0 33 312 2111463530 7146 # if interdata # include "stdio.h" # endif main(argc,argv) char *argv[]; { char *nm, *p; p = nm = argv[1]; while (*p) p++; while (*p != '/') p--; if (p==nm) p++; *p = 0; printf("%s\n", nm); exit(0); } ) FILE *f; char *s; long *lp; { char b[200]; if (m==0 ||fgets(b, 200, f)==0) { strcpy (s, LAST); return (0); } sscanf(b, "%s %lo", s, lp); return (1); } notmp(s1, s2) char *s1, *s2; { char bf1[20], bf2[20]; str/,5< /,"cmd/biff.c 444 0 33 1351 2423774425 5657 static char *sccsid ="@(#)biff.c 4.1 (Berkeley) 10/18/80"; /* * biff */ #include #include #include char *ttyname(); main(argc, argv) int argc; char **argv; { char *cp = ttyname(2); struct stat stb; argc--, argv++; if (cp == 0) fprintf(stderr, "Where are you?\n"), exit(1); if (stat(cp, &stb) < 0) perror(cp), exit(1); if (argc == 0) { printf("is %s\n", stb.st_mode&0100 ? "y" : "n"); exit((stb.st_mode&0100) ? 0 : 1); } switch (argv[0][0]) { case 'y': if (chmod(cp, stb.st_mode|0100) < 0) perror(cp); break; case 'n': if (chmod(cp, stb.st_mode&~0100) < 0) perror(cp); break; default: fprintf(stderr, "usage: biff [y] [n]\n"); } exit((stb.st_mode&0100) ? 0 : 1); } t stb; argc--, argv++; if (cp == 0) fprintf(stderr, "Where are you?\n"), exit(1); if (stat(cp, &stb) < 0) perror(cp), exit(1); if (argc == 0) { printf("is %s\n", stb.st_mode&0100 ? "y" : "n"); exit((stb.st_mode&0100) ? 0 : 1); } switch (argv[0][0]) { case 'y': cmd/xsend/ 775 0 33 0 2552574305 5643 cmd/xsend/enroll.c 644 0 33 1211 2111463532 7346 #include "xmail.h" #include "pwd.h" #include "sys/types.h" MINT *a[42], *x, *b, *one, *c64, *t45, *z, *q, *r, *two, *t15; char buf[256]; char maildir[] = { "/usr/spool/secretmail"}; main() { int uid, i; FILE *fd; char *myname, fname[128]; uid = getuid(); myname = getlogin(); if(myname == NULL) myname = getpwuid(uid)->pw_name; sprintf(fname, "%s/%s.key", maildir, myname); comminit(); setup(getpass("Gimme key: ")); mkb(); mkx(); #ifdef debug omout(b); omout(x); #endif mka(); i = creat(fname, 0644); if(i<0) { perror("fname"); exit(1); } close(i); fd = fopen(fname, "w"); for(i=0; i<42; i++) nout(a[i], fd); exit(0); } char maildir[] = { "/usr/spool/secretmail"}; main() { int uid, i; FILE *fd; char *myname, fname[128]; uid = getuid(); myname = getlogin(); if(myname == NULL) myname = getpwuid(uid)->pw_name; sprintf(fname, "%s/%s.key", maildir, myname); comminit(); setup(getpass("Gimme key: ")); mkb(); mkx(); #ifdef debug omout(b); omout(x); #endif mka(); i = creat(fname, cmd/xsend/lib.c 644 0 33 3617 2111463532 6635 #include "xmail.h" MINT *x, *b, *one, *c64, *t45, *z, *q, *r, *two, *t15; MINT *a[42]; setup(s) char *s; { int pf[2]; strncpy(buf, s, 10); while(*s) *s++ = 0; pipe(pf); if(fork()==0) { close(0); close(1); dup(pf[0]); dup(pf[1]); execl("/usr/lib/makekey", "-", 0); execl("/lib/makekey", "-", 0); exit(1); } write(pf[1], buf, 10); wait((int *)NULL); if(read(pf[0], buf, 13) != 13) { fprintf(stderr, "enroll: cannot generate key\n"); exit(1); } } mkx() { int i, j; for(i=0; i<4; i++) { mult(x, t15, x); *z->val = (short)(rand() ^ buf[i]); madd(x, z, x); } mdiv(x, b, q, x); for(;;) { gcd(b, x, q); if(q->len == 1 && q->val[0] == 1) return; madd(x, one, x); } } mka() { int i, j; for(i=0; i<42; i++) a[i] = itom(1); for(i=j=0; i<42; i++, j++) { *z->val = (short)rand()&00; mult(a[i], z, a[i]); mult(a[i], t45, a[i]); rpow(two, j, q); if( i%14 == 6) j++; madd(a[i], q, a[i]); mult(a[i], t15, a[i]); *z->val = (short)rand()&0777; madd(a[i], z, a[i]); mdiv(a[i], b, q, a[i]); } for(i=0; i<42; i++) mult(a[i], x, a[i]); for(i=0; i<42; i++) { mdiv(a[i], b, q, a[i]); } } mkb() { int i, c; unsigned seed; seed = 123; for(i=0; i<13; i++) seed = seed*buf[i] + i; srand(seed); *b->val = 04 + (rand()&03); for(i=0; i<11; i++) { *z->val = (buf[i+2] + rand()) & 077; mult(b, c64, b); madd(b, z, b); } } comminit() { int i; x = itom(0); b = itom(1); one = itom(1); two = itom(2); c64 = itom(64); t45 = itom(1); t15 = itom(1); rpow(two, 45, t45); rpow(two, 15, t15); z = itom(1); q = itom(1); } #ifndef debug nout(a, fd) MINT *a; FILE *fd; { fwrite(&a->len, sizeof(int), 1, fd); fwrite(a->val, sizeof(short), a->len, fd); } nin(a, fd) MINT *a; FILE *fd; { xfree(a); fread(&a->len, sizeof(int), 1, fd); a->val = xalloc(a->len, "nin"); fread(a->val, sizeof(short), a->len, fd); } #endif xfatal(s) char *s; { fprintf(stderr, "%s\n", s); exit(1); } one = itom(1); two = itom(2); c64 = itom(64); t45 = itom(1); t15 = itom(1); rpow(two, 45, t45); rpow(two,cmd/xsend/makefile 644 0 33 744 2421024444 7400 CFLAGS = -O -d2 all: enroll xsend xget enroll: enroll.o lib.o cc enroll.o lib.o -lmp -o enroll xget: xget.o lib.o cc xget.o lib.o -lmp -o xget xsend: xsend.o lib.o cc xsend.o lib.o -lmp -o xsend enroll.o xget.o xsend.o lib.o: xmail.h list: @pr -2 -w124 m.h xmail.h enroll.c xsend.c xget.c lib.c makefile install: enroll xsend xget install -s enroll $(DESTDIR)/usr/bin install -s xsend $(DESTDIR)/usr/bin install -s xget $(DESTDIR)/usr/bin clean: rm -f *.o yacc.* y.tab.c ,"cmd/xsend/xget.c 644 0 33 4552 2111463532 7035 #include "xmail.h" #include "sys/types.h" #include "sys/dir.h" #include "ctype.h" #include "pwd.h" #include "sys/stat.h" char *myname; int uid; struct direct dbuf; char *maildir = "/usr/spool/secretmail/"; FILE *kf, *mf, *df; MINT *x, *b, *one, *t45, *z, *q, *r; MINT *two, *t15, *mbuf; char buf[256], line[128]; #define MXF 100 int fnum[MXF], fcnt; struct stat stbuf; main() { int i; char *p; uid = getuid(); myname = getlogin(); if(myname == NULL) myname = getpwuid(uid)->pw_name; comminit(); mbuf = itom(0); files(); setup(getpass("Key: ")); mkb(); mkx(); #ifndef debug invert(x, b, x); #else invert(x, b, z); mult(x, z, z); mdiv(z, b, q, z); omout(z); invert(x, b, x); #endif for(i=0; i= MXF) break; fnum[fcnt++] = i; } if(fcnt == 0) { printf("no secret mail\n"); exit(0); } qsort(fnum, fcnt, sizeof(int), icmp); } decipher(u, w) FILE *u, *w; { int i; short a; for(;;) { nin(mbuf, u); if(feof(u)) break; mult(mbuf, x, mbuf); mdiv(mbuf, b, q, mbuf); for(i=1; i<=3; i++) { a = mbuf->val[i]; putc(a&0177, w); a >>= 8; putc(a&0177, w); } } } f); if(feof(df)) break; if(dbuf.d_ino == 0) continue; if(sscanf(dbuf.d_name, line, &i) != 1) continue; if(fcnt >= MXF) break; fnum[fcncmd/xsend/xmail.h 644 0 33 315 2421024410 7146 #include #include extern MINT *x, *b, *one, *c64, *t45, *z, *q, *r, *two, *t15; extern char buf[256]; #ifdef debug #define nin(x, y) m_in(x, 8, y) #define nout(x, y) m_out(x, 8, y) #endif k; mult(mbuf, x, mbuf); mdiv(mbuf, b, q, mbuf); for(i=1; i<=3; i++) { a = mbuf->val[i]; putc(a&0177, w); a >>= 8; putc(a&0177, w); } } } f); if(feof(df)) break; if(dbuf.d_ino == 0) continue; /,5< /,"cmd/xsend/xsend.c 644 0 33 4704 2111463532 7206 #include "xmail.h" #include "sys/types.h" #include "pwd.h" #include "sys/stat.h" #include "sys/dir.h" extern int errno; struct stat stbuf; int uid, destuid; char *myname, *dest, *keyfile[128], line[128]; struct direct dbuf; char *maildir = "/usr/spool/secretmail/"; FILE *kf, *mf, *df; MINT *a[42], *cd[6][128]; MINT *msg; char buf[256], eof; int dbg; main(argc, argv) char **argv; { int i, nmax, len; char *p; long now; if(argc != 2) xfatal("mail to exactly one person"); uid = getuid(); p =getlogin(); if(p == NULL) p = getpwuid(uid)->pw_name; myname = malloc(strlen(p)+1); strcpy(myname, p); dest = argv[1]; strcpy(keyfile, maildir); strcat(keyfile, dest); strcat(keyfile, ".key"); if(stat(keyfile, &stbuf) <0) xfatal("addressee not enrolled"); destuid = getpwnam(dest)->pw_uid; if(destuid != stbuf.st_uid) fprintf(stderr, "warning: addressee's key file may be subverted\n"); errno = 0; kf = fopen(keyfile, "r"); if(kf == NULL) xfatal("addressee's key weird"); df = fopen(maildir, "r"); if(df == NULL) { perror(maildir); exit(1); } strcpy(line, dest); strcat(line, ".%d"); nmax = -1; for(; !feof(df);) { fread(&dbuf, sizeof(dbuf), 1, df); if(dbuf.d_ino == 0) continue; if(sscanf(dbuf.d_name, line, &i) != 1) continue; if(i>nmax) nmax = i; } nmax ++; for(i=0; i<10; i++) { sprintf(line, "%s%s.%d", maildir, dest, nmax+i); if(creat(line, 0666) >= 0) break; } if(i==10) xfatal("cannot create mail file"); mf = fopen(line, "w"); init(); time(&now); sprintf(buf, "From %s %s", myname, ctime(&now) ); #ifdef DBG dbg = 1; #endif run(); sprintf(buf, "mail %s <%snotice", dest, maildir); system(buf); exit(0); } mkcd() { int i, j, k, n; for(i=0; i<42; i++) nin(a[i], kf); fclose(kf); for(i=0; i<6; i++) for(j=0; j<128; j++) for(k=j, n=0; k>0 && n<7; n++, k>>=1) if(k&01) madd(cd[i][j], a[7*i+n], cd[i][j]); } encipher(s) char s[6]; { int i; msub(msg, msg, msg); for(i=0; i<6; i++) madd(msg, cd[i][s[i]&0177], msg); } init() { int i, j; msg = itom(0); for(i=0; i<42; i++) a[i] = itom(0); for(i=0; i<6; i++) for(j=0; j<128; j++) cd[i][j] = itom(0); mkcd(); } run() { char *p; int i, len, eof = 0; for(;;) { len = strlen(buf); for(i=0; i # include # include "files" /* MANIFEST CONSTANT DEFINITIONS */ /* base of nonterminal internal numbers */ # define NTBASE 010000 /* internal codes for error and accept actions */ # define ERRCODE 8190 # define ACCEPTCODE 8191 /* sizes and limits */ # ifdef HUGE # define ACTSIZE 12000 # define MEMSIZE 12000 # define NSTATES 750 # define NTERMS 127 # define NPROD 600 # define NNONTERM 300 # define TEMPSIZE 1200 # define CNAMSZ 5000 # define LSETSIZE 600 # define WSETSIZE 350 # endif # ifdef MEDIUM # define ACTSIZE 4000 # define MEMSIZE 5200 # define NSTATES 600 # define NTERMS 127 # define NPROD 400 # define NNONTERM 200 # define TEMPSIZE 800 # define CNAMSZ 4000 # define LSETSIZE 450 # define WSETSIZE 250 # endif # define NAMESIZE 50 # define NTYPES 63 # ifdef WORD32 # define TBITSET ((32+NTERMS)/32) /* bit packing macros (may be machine dependent) */ # define BIT(a,i) ((a)[(i)>>5] & (1<<((i)&037))) # define SETBIT(a,i) ((a)[(i)>>5] |= (1<<((i)&037))) /* number of words needed to hold n+1 bits */ # define NWORDS(n) (((n)+32)/32) # else # define TBITSET ((16+NTERMS)/16) /* bit packing macros (may be machine dependent) */ # define BIT(a,i) ((a)[(i)>>4] & (1<<((i)&017))) # define SETBIT(a,i) ((a)[(i)>>4] |= (1<<((i)&017))) /* number of words needed to hold n+1 bits */ # define NWORDS(n) (((n)+16)/16) # endif /* relationships which must hold: TBITSET ints must hold NTERMS+1 bits... WSETSIZE >= NNONTERM LSETSIZE >= NNONTERM TEMPSIZE >= NTERMS + NNONTERMs + 1 TEMPSIZE >= NSTATES */ /* associativities */ # define NOASC 0 /* no assoc. */ # define LASC 1 /* left assoc. */ # define RASC 2 /* right assoc. */ # define BASC 3 /* binary assoc. */ /* flags for state generation */ # define DONE 0 # define MUSTDO 1 # define MUSTLOOKAHEAD 2 /* flags for a rule having an action, and being reduced */ # define ACTFLAG 04 # define REDFLAG 010 /* output parser flags */ # define YYFLAG1 (-1000) /* macros for getting associativity and precedence levels */ # define ASSOC(i) ((i)&03) # define PLEVEL(i) (((i)>>4)&077) # define TYPE(i) ((i>>10)&077) /* macros for setting associativity and precedence levels */ # define SETASC(i,j) i|=j # define SETPLEV(i,j) i |= (j<<4) # define SETTYPE(i,j) i |= (j<<10) /* looping macros */ # define TLOOP(i) for(i=1;i<=ntokens;++i) # define NTLOOP(i) for(i=0;i<=nnonter;++i) # define PLOOP(s,i) for(i=s;i0 ; ++p ) ; p = prdptr[-*p]; q = chcopy( sarr, nontrst[*p-NTBASE].name ); q = chcopy( q, " : " ); for(;;){ *q++ = ++p==pp ? '_' : ' '; *q = '\0'; if((i = *p) <= 0) break; q = chcopy( q, symnam(i) ); if( q> &sarr[ISIZE-30] ) error( "item too big" ); } if( (i = *pp) < 0 ){ /* an item calling for a reduction */ q = chcopy( q, " (" ); sprintf( q, "%d)", -i ); } return( sarr ); } char *symnam(i){ /* return a pointer to the name of symbol i */ char *cp; cp = (i>=NTBASE) ? nontrst[i-NTBASE].name : tokset[i].name ; if( *cp == ' ' ) ++cp; return( cp ); } struct wset *zzcwp = wsets; int zzgoent = 0; int zzgobest = 0; int zzacent = 0; int zzexcp = 0; int zzclose = 0; int zzsrconf = 0; int * zzmemsz = mem0; int zzrrconf = 0; summary(){ /* output the summary on the tty */ if( foutput!=NULL ){ fprintf( foutput, "\n%d/%d terminals, %d/%d nonterminals\n", ntokens, NTERMS, nnonter, NNONTERM ); fprintf( foutput, "%d/%d grammar rules, %d/%d states\n", nprod, NPROD, nstate, NSTATES ); fprintf( foutput, "%d shift/reduce, %d reduce/reduce conflicts reported\n", zzsrconf, zzrrconf ); fprintf( foutput, "%d/%d working sets used\n", zzcwp-wsets, WSETSIZE ); fprintf( foutput, "memory: states,etc. %d/%d, parser %d/%d\n", zzmemsz-mem0, MEMSIZE, memp-amem, ACTSIZE ); fprintf( foutput, "%d/%d distinct lookahead sets\n", nlset, LSETSIZE ); fprintf( foutput, "%d extra closures\n", zzclose - 2*nstate ); fprintf( foutput, "%d shift entries, %d exceptions\n", zzacent, zzexcp ); fprintf( foutput, "%d goto entries\n", zzgoent ); fprintf( foutput, "%d entries saved by ((goto default\n", zzgobest ); } if( zzsrconf!=0 || zzrrconf!=0 ){ fprintf( stdout,"\nconflicts: "); if( zzsrconf )fprintf( stdout, "%d shift/reduce" , zzsrconf ); if( zzsrconf && zzrrconf )fprintf( stdout, ", " ); if( zzrrconf )fprintf( stdout, "%d reduce/reduce" , zzrrconf ); fprintf( stdout, "\n" ); } fclose( ftemp ); if( fdefine != NULL ) fclose( fdefine ); } /* VARARGS1 */ error(s,a1) char *s; { /* write out error comment */ ++nerrors; fprintf( stderr, "\n fatal error: "); fprintf( stderr, s,a1); fprintf( stderr, ", line %d\n", lineno ); if( !fatfl ) return; summary(); exit(1); } aryfil( v, n, c ) int *v,n,c; { /* set elements 0 through n-1 to c */ int i; for( i=0; ilset; if( pp == 0 ) fprintf( foutput, "\tNULL"); else { fprintf( foutput, " { " ); TLOOP(j) { if( BIT(pp,j) ) fprintf( foutput, "%s ", symnam(j) ); } fprintf( foutput, "}" ); } } cpres(){ /* compute an array with the beginnings of productions yielding given nonterminals The array pres points to these lists */ /* the array pyield has the lists: the total size is only NPROD+1 */ register **pmem; register c, j, i; static int * pyield[NPROD]; pmem = pyield; NTLOOP(i){ c = i+NTBASE; pres[i] = pmem; fatfl = 0; /* make undefined symbols nonfatal */ PLOOP(0,j){ if (*prdptr[j] == c) *pmem++ = prdptr[j]+1; } if(pres[i] == pmem){ error("nonterminal %s not defined!", nontrst[i].name); } } pres[i] = pmem; fatfl = 1; if( nerrors ){ summary(); exit(1); } if( pmem != &pyield[nprod] ) error( "internal Yacc error: pyield %d", pmem-&pyield[nprod] ); } int indebug = 0; cpfir() { /* compute an array with the first of nonterminals */ register *p, **s, i, **t, ch, changes; zzcwp = &wsets[nnonter]; NTLOOP(i){ aryfil( wsets[i].ws.lset, tbitset, 0 ); t = pres[i+1]; for( s=pres[i]; s 0 ; ++p ) { if( ch < NTBASE ) { SETBIT( wsets[i].ws.lset, ch ); break; } else if( !pempty[ch-NTBASE] ) break; } } } /* now, reflect transitivity */ changes = 1; while( changes ){ changes = 0; NTLOOP(i){ t = pres[i+1]; for( s=pres[i]; s= 0; ++p ) { changes |= setunion( wsets[i].ws.lset, wsets[ch].ws.lset ); if( !pempty[ch] ) break; } } } } NTLOOP(i) pfirst[i] = flset( &wsets[i].ws ); if( !indebug ) return; if( (foutput!=NULL) ){ NTLOOP(i) { fprintf( foutput, "\n%s: ", nontrst[i].name ); prlook( pfirst[i] ); fprintf( foutput, " %d\n", pempty[i] ); } } } state(c){ /* sorts last state,and sees if it equals earlier ones. returns state number */ int size1,size2; register i; struct item *p1, *p2, *k, *l, *q1, *q2; p1 = pstate[nstate]; p2 = pstate[nstate+1]; if(p1==p2) return(0); /* null state */ /* sort the items */ for(k=p2-1;k>p1;k--) { /* make k the biggest */ for(l=k-1;l>=p1;--l)if( l->pitem > k->pitem ){ int *s; struct looksets *ss; s = k->pitem; k->pitem = l->pitem; l->pitem = s; ss = k->look; k->look = l->look; l->look = ss; } } size1 = p2 - p1; /* size of state */ for( i= (c>=NTBASE)?ntstates[c-NTBASE]:tstates[c]; i != 0; i = mstates[i] ) { /* get ith state */ q1 = pstate[i]; q2 = pstate[i+1]; size2 = q2 - q1; if (size1 != size2) continue; k=p1; for(l=q1;lpitem != k->pitem ) break; ++k; } if (l != q2) continue; /* found it */ pstate[nstate+1] = pstate[nstate]; /* delete last state */ /* fix up lookaheads */ if( nolook ) return(i); for( l=q1,k=p1; llook->lset[s]; if( setunion( clset.lset, k->look->lset ) ) { tystate[i] = MUSTDO; /* register the new set */ l->look = flset( &clset ); } } return (i); } /* state is new */ if( nolook ) error( "yacc state/nolook error" ); pstate[nstate+2] = p2; if(nstate+1 >= NSTATES) error("too many states" ); if( c >= NTBASE ){ mstates[ nstate ] = ntstates[ c-NTBASE ]; ntstates[ c-NTBASE ] = nstate; } else { mstates[ nstate ] = tstates[ c ]; tstates[ c ] = nstate; } tystate[nstate]=MUSTDO; return(nstate++); } int pidebug = 0; /* debugging flag for putitem */ putitem( ptr, lptr ) int *ptr; struct looksets *lptr; { register struct item *j; if( pidebug && (foutput!=NULL) ) { fprintf( foutput, "putitem(%s), state %d\n", writem(ptr), nstate ); } j = pstate[nstate+1]; j->pitem = ptr; if( !nolook ) j->look = flset( lptr ); pstate[nstate+1] = ++j; if( (int *)j > zzmemsz ){ zzmemsz = (int *)j; if( zzmemsz >= &mem0[MEMSIZE] ) error( "out of state space" ); } } cempty(){ /* mark nonterminals which derive the empty string */ /* also, look for nonterminals which don't derive any token strings */ # define EMPTY 1 # define WHOKNOWS 0 # define OK 1 register i, *p; /* first, use the array pempty to detect productions that can never be reduced */ /* set pempty to WHONOWS */ aryfil( pempty, nnonter+1, WHOKNOWS ); /* now, look at productions, marking nonterminals which derive something */ more: PLOOP(0,i){ if( pempty[ *prdptr[i] - NTBASE ] ) continue; for( p=prdptr[i]+1; *p>=0; ++p ){ if( *p>=NTBASE && pempty[ *p-NTBASE ] == WHOKNOWS ) break; } if( *p < 0 ){ /* production can be derived */ pempty[ *prdptr[i]-NTBASE ] = OK; goto more; } } /* now, look at the nonterminals, to see if they are all OK */ NTLOOP(i){ /* the added production rises or falls as the start symbol ... */ if( i == 0 ) continue; if( pempty[ i ] != OK ) { fatfl = 0; error( "nonterminal %s never derives any token string", nontrst[i].name ); } } if( nerrors ){ summary(); exit(1); } /* now, compute the pempty array, to see which nonterminals derive the empty string */ /* set pempty to WHOKNOWS */ aryfil( pempty, nnonter+1, WHOKNOWS ); /* loop as long as we keep finding empty nonterminals */ again: PLOOP(1,i){ if( pempty[ *prdptr[i]-NTBASE ]==WHOKNOWS ){ /* not known to be empty */ for( p=prdptr[i]+1; *p>=NTBASE && pempty[*p-NTBASE]==EMPTY ; ++p ) ; if( *p < 0 ){ /* we have a nontrivially empty nonterminal */ pempty[*prdptr[i]-NTBASE] = EMPTY; goto again; /* got one ... try for another */ } } } } int gsdebug = 0; stagen(){ /* generate the states */ int i, j; register c; register struct wset *p, *q; /* initialize */ nstate = 0; /* THIS IS FUNNY from the standpoint of portability */ /* it represents the magic moment when the mem0 array, which has /* been holding the productions, starts to hold item pointers, of a /* different type... */ /* someday, alloc should be used to allocate all this stuff... for now, we /* accept that if pointers don't fit in integers, there is a problem... */ pstate[0] = pstate[1] = (struct item *)mem; aryfil( clset.lset, tbitset, 0 ); putitem( prdptr[0]+1, &clset ); tystate[0] = MUSTDO; nstate = 1; pstate[2] = pstate[1]; aryfil( amem, ACTSIZE, 0 ); /* now, the main state generation loop */ more: SLOOP(i){ if( tystate[i] != MUSTDO ) continue; tystate[i] = DONE; aryfil( temp1, nnonter+1, 0 ); /* take state i, close it, and do gotos */ closure(i); WSLOOP(wsets,p){ /* generate goto's */ if( p->flag ) continue; p->flag = 1; c = *(p->pitem); if( c <= 1 ) { if( pstate[i+1]-pstate[i] <= p-wsets ) tystate[i] = MUSTLOOKAHEAD; continue; } /* do a goto on c */ WSLOOP(p,q){ if( c == *(q->pitem) ){ /* this item contributes to the goto */ putitem( q->pitem + 1, &q->ws ); q->flag = 1; } } if( c < NTBASE ) { state(c); /* register new state */ } else { temp1[c-NTBASE] = state(c); } } if( gsdebug && (foutput!=NULL) ){ fprintf( foutput, "%d: ", i ); NTLOOP(j) { if( temp1[j] ) fprintf( foutput, "%s %d, ", nontrst[j].name, temp1[j] ); } fprintf( foutput, "\n"); } indgo[i] = apack( &temp1[1], nnonter-1 ) - 1; goto more; /* we have done one goto; do some more */ } /* no more to do... stop */ } int cldebug = 0; /* debugging flag for closure */ closure(i){ /* generate the closure of state i */ int c, ch, work, k; register struct wset *u, *v; int *pi; int **s, **t; struct item *q; register struct item *p; ++zzclose; /* first, copy kernel of state i to wsets */ cwp = wsets; ITMLOOP(i,p,q){ cwp->pitem = p->pitem; cwp->flag = 1; /* this item must get closed */ SETLOOP(k) cwp->ws.lset[k] = p->look->lset[k]; WSBUMP(cwp); } /* now, go through the loop, closing each item */ work = 1; while( work ){ work = 0; WSLOOP(wsets,u){ if( u->flag == 0 ) continue; c = *(u->pitem); /* dot is before c */ if( c < NTBASE ){ u->flag = 0; continue; /* only interesting case is where . is before nonterminal */ } /* compute the lookahead */ aryfil( clset.lset, tbitset, 0 ); /* find items involving c */ WSLOOP(u,v){ if( v->flag == 1 && *(pi=v->pitem) == c ){ v->flag = 0; if( nolook ) continue; while( (ch= *++pi)>0 ){ if( ch < NTBASE ){ /* terminal symbol */ SETBIT( clset.lset, ch ); break; } /* nonterminal symbol */ setunion( clset.lset, pfirst[ch-NTBASE]->lset ); if( !pempty[ch-NTBASE] ) break; } if( ch<=0 ) setunion( clset.lset, v->ws.lset ); } } /* now loop over productions derived from c */ c -= NTBASE; /* c is now nonterminal number */ t = pres[c+1]; for( s=pres[c]; spitem == *s ){ /* yes, it is there */ if( nolook ) goto nexts; if( setunion( v->ws.lset, clset.lset ) ) v->flag = work = 1; goto nexts; } } /* not there; make a new ((entry */ if( cwp-wsets+1 >= WSETSIZE ) error( "working set overflow" ); cwp->pitem = *s; cwp->flag = 1; if( !nolook ){ work = 1; SETLOOP(k) cwp->ws.lset[k] = clset.lset[k]; } WSBUMP(cwp); nexts: ; } } } /* have computed closure; flags are reset; return */ if( cwp > zzcwp ) zzcwp = cwp; if( cldebug && (foutput!=NULL) ){ fprintf( foutput, "\nState %d, nolook = %d\n", i, nolook ); WSLOOP(wsets,u){ if( u->flag ) fprintf( foutput, "flag set!\n"); u->flag = 0; fprintf( foutput, "\t%s", writem(u->pitem)); prlook( &u->ws ); fprintf( foutput, "\n" ); } } } struct looksets *flset( p ) struct looksets *p; { /* decide if the lookahead set pointed to by p is known */ /* return pointer to a perminent location for the set */ register struct looksets *q; int j, *w; register *u, *v; for( q = &lkst[nlset]; q-- > lkst; ){ u = p->lset; v = q->lset; w = & v[tbitset]; while( v= LSETSIZE )error("too many lookahead sets" ); SETLOOP(j){ q->lset[j] = p->lset[j]; } return( q ); } e lookahead set pointed to by p is known */ /* return pointer to a perminent location for the set */ register struct looksets *q; int j, *w; register *u, *v; for( q = &lkst[nlset]; q-- > lkst; ){ u = p->lset; v = q->lset; w = & v[tbitset]; while( v= 2 && argv[1][0] == '-' ) { while( *++(argv[1]) ){ switch( *argv[1] ){ case 'v': case 'V': foutput = fopen(FILEU, "w" ); if( foutput == NULL ) error( "cannot open y.output" ); continue; case 'D': case 'd': fdefine = fopen( FILED, "w" ); continue; case 'o': case 'O': fprintf( stderr, "`o' flag now default in yacc\n" ); continue; case 'r': case 'R': error( "Ratfor Yacc is dead: sorry...\n" ); default: error( "illegal option: %c", *argv[1]); } } argv++; argc--; } ftable = fopen( OFILE, "w" ); if( ftable == NULL ) error( "cannot open table file" ); ftemp = fopen( TEMPNAME, "w" ); faction = fopen( ACTNAME, "w" ); if( ftemp==NULL || faction==NULL ) error( "cannot open temp file" ); if( argc < 2 || ((finput=fopen( infile=argv[1], "r" )) == NULL ) ){ error( "cannot open input file" ); } cnamp = cnames; defin(0,"$end"); extval = 0400; defin(0,"error"); defin(1,"$accept"); mem=mem0; lev = 0; ty = 0; i=0; /* sorry -- no yacc parser here..... we must bootstrap somehow... */ for( t=gettok(); t!=MARK && t!= ENDFILE; ){ switch( t ){ case ';': t = gettok(); break; case START: if( (t=gettok()) != IDENTIFIER ){ error( "bad %%start construction" ); } start = chfind(1,tokname); t = gettok(); continue; case TYPEDEF: if( (t=gettok()) != TYPENAME ) error( "bad syntax in %%type" ); ty = numbval; for(;;){ t = gettok(); switch( t ){ case IDENTIFIER: if( (t=chfind( 1, tokname ) ) < NTBASE ) { j = TYPE( toklev[t] ); if( j!= 0 && j != ty ){ error( "type redeclaration of token %s", tokset[t].name ); } else SETTYPE( toklev[t],ty); } else { j = nontrst[t-NTBASE].tvalue; if( j != 0 && j != ty ){ error( "type redeclaration of nonterminal %s", nontrst[t-NTBASE].name ); } else nontrst[t-NTBASE].tvalue = ty; } case ',': continue; case ';': t = gettok(); break; default: break; } break; } continue; case UNION: /* copy the union declaration to the output */ cpyunion(); t = gettok(); continue; case LEFT: case BINARY: case RIGHT: ++i; case TERM: lev = t-TERM; /* nonzero means new prec. and assoc. */ ty = 0; /* get identifiers so defined */ t = gettok(); if( t == TYPENAME ){ /* there is a type defined */ ty = numbval; t = gettok(); } for(;;) { switch( t ){ case ',': t = gettok(); continue; case ';': break; case IDENTIFIER: j = chfind(0,tokname); if( lev ){ if( ASSOC(toklev[j]) ) error( "redeclaration of precedence of %s", tokname ); SETASC(toklev[j],lev); SETPLEV(toklev[j],i); } if( ty ){ if( TYPE(toklev[j]) ) error( "redeclaration of type of %s", tokname ); SETTYPE(toklev[j],ty); } if( (t=gettok()) == NUMBER ){ tokset[j].value = numbval; if( j < ndefout && j>2 ){ error( "please define type number of %s earlier", tokset[j].name ); } t=gettok(); } continue; } break; } continue; case LCURLY: defout(); cpycode(); t = gettok(); continue; default: error( "syntax error" ); } } if( t == ENDFILE ){ error( "unexpected EOF before %%" ); } /* t is MARK */ defout(); fprintf( ftable, "#define yyclearin yychar = -1\n" ); fprintf( ftable, "#define yyerrok yyerrflag = 0\n" ); fprintf( ftable, "extern int yychar;\nextern short yyerrflag;\n" ); fprintf( ftable, "#ifndef YYMAXDEPTH\n#define YYMAXDEPTH 150\n#endif\n" ); if( !ntypes ) fprintf( ftable, "#ifndef YYSTYPE\n#define YYSTYPE int\n#endif\n" ); fprintf( ftable, "YYSTYPE yylval, yyval;\n" ); prdptr[0]=mem; /* added production */ *mem++ = NTBASE; *mem++ = start; /* if start is 0, we will overwrite with the lhs of the first rule */ *mem++ = 1; *mem++ = 0; prdptr[1]=mem; while( (t=gettok()) == LCURLY ) cpycode(); if( t != C_IDENTIFIER ) error( "bad syntax on first rule" ); if( !start ) prdptr[0][1] = chfind(1,tokname); /* read rules */ while( t!=MARK && t!=ENDFILE ){ /* process a rule */ if( t == '|' ){ *mem++ = *prdptr[nprod-1]; } else if( t == C_IDENTIFIER ){ *mem = chfind(1,tokname); if( *mem < NTBASE ) error( "token illegal on LHS of grammar rule" ); ++mem; } else error( "illegal rule: missing semicolon or | ?" ); /* read rule body */ t = gettok(); more_rule: while( t == IDENTIFIER ) { *mem = chfind(1,tokname); if( *mem=NTBASE)error("nonterminal %s illegal after %%prec", nontrst[j-NTBASE].name); levprd[nprod]=toklev[j]; t = gettok(); } if( t == '=' ){ levprd[nprod] |= ACTFLAG; fprintf( faction, "\ncase %d:", nprod ); cpyact( mem-prdptr[nprod]-1 ); fprintf( faction, " break;" ); if( (t=gettok()) == IDENTIFIER ){ /* action within rule... */ sprintf( actname, "$$%d", nprod ); j = chfind(1,actname); /* make it a nonterminal */ /* the current rule will become rule number nprod+1 */ /* move the contents down, and make room for the null */ for( p=mem; p>=prdptr[nprod]; --p ) p[2] = *p; mem += 2; /* enter null production for action */ p = prdptr[nprod]; *p++ = j; *p++ = -nprod; /* update the production information */ levprd[nprod+1] = levprd[nprod] & ~ACTFLAG; levprd[nprod] = ACTFLAG; if( ++nprod >= NPROD ) error( "more than %d rules", NPROD ); prdptr[nprod] = p; /* make the action appear in the original rule */ *mem++ = j; /* get some more of the rule */ goto more_rule; } } while( t == ';' ) t = gettok(); *mem++ = -nprod; /* check that default action is reasonable */ if( ntypes && !(levprd[nprod]&ACTFLAG) && nontrst[*prdptr[nprod]-NTBASE].tvalue ){ /* no explicit action, LHS has value */ register tempty; tempty = prdptr[nprod][1]; if( tempty < 0 ) error( "must return a value, since LHS has a type" ); (( else if( tempty >= NTBASE ) tempty = nontrst[tempty-NTBASE].tvalue; else tempty = TYPE( toklev[tempty] ); if( tempty != nontrst[*prdptr[nprod]-NTBASE].tvalue ){ error( "default action causes potential type clash" ); } } if( ++nprod >= NPROD ) error( "more than %d rules", NPROD ); prdptr[nprod] = mem; levprd[nprod]=0; } /* end of all rules */ finact(); if( t == MARK ){ fprintf( ftable, "\n# line %d \"%s\"\n", lineno, infile ); while( (c=getc(finput)) != EOF ) putc( c, ftable ); } fclose( finput ); } finact(){ /* finish action routine */ fclose(faction); fprintf( ftable, "# define YYERRCODE %d\n", tokset[2].value ); } defin( t, s ) register char *s; { /* define s to be a terminal if t=0 or a nonterminal if t=1 */ register val; if (t) { if( ++nnonter >= NNONTERM ) error("too many nonterminals, limit %d",NNONTERM); nontrst[nnonter].name = cstash(s); return( NTBASE + nnonter ); } /* must be a token */ if( ++ntokens >= NTERMS ) error("too many terminals, limit %d",NTERMS ); tokset[ntokens].name = cstash(s); /* establish value for token */ if( s[0]==' ' && s[2]=='\0' ) /* single character literal */ val = s[1]; else if ( s[0]==' ' && s[1]=='\\' ) { /* escape sequence */ if( s[3] == '\0' ){ /* single character escape sequence */ switch ( s[2] ){ /* character which is escaped */ case 'n': val = '\n'; break; case 'r': val = '\r'; break; case 'b': val = '\b'; break; case 't': val = '\t'; break; case 'f': val = '\f'; break; case '\'': val = '\''; break; case '"': val = '"'; break; case '\\': val = '\\'; break; default: error( "invalid escape" ); } } else if( s[2] <= '7' && s[2]>='0' ){ /* \nnn sequence */ if( s[3]<'0' || s[3] > '7' || s[4]<'0' || s[4]>'7' || s[5] != '\0' ) error("illegal \\nnn construction" ); val = 64*s[2] + 8*s[3] + s[4] - 73*'0'; if( val == 0 ) error( "'\\000' is illegal" ); } } else { val = extval++; } tokset[ntokens].value = val; toklev[ntokens] = 0; return( ntokens ); } defout(){ /* write out the defines (at the end of the declaration section) */ register int i, c; register char *cp; for( i=ndefout; i<=ntokens; ++i ){ cp = tokset[i].name; if( *cp == ' ' ) ++cp; /* literals */ for( ; (c= *cp)!='\0'; ++cp ){ if( islower(c) || isupper(c) || isdigit(c) || c=='_' ); /* VOID */ else goto nodef; } fprintf( ftable, "# define %s %d\n", tokset[i].name, tokset[i].value ); if( fdefine != NULL ) fprintf( fdefine, "# define %s %d\n", tokset[i].name, tokset[i].value ); nodef: ; } ndefout = ntokens+1; } char * cstash( s ) register char *s; { char *temp; temp = cnamp; do { if( cnamp >= &cnames[cnamsz] ) error("too many characters in id's and literals" ); else *cnamp++ = *s; } while ( *s++ ); return( temp ); } gettok() { register i, base; static int peekline; /* number of '\n' seen in lookahead */ register c, match, reserve; begin: reserve = 0; lineno += peekline; peekline = 0; c = getc(finput); while( c==' ' || c=='\n' || c=='\t' || c=='\f' ){ if( c == '\n' ) ++lineno; c=getc(finput); } if( c == '/' ){ /* skip comment */ lineno += skipcom(); goto begin; } switch(c){ case EOF: return(ENDFILE); case '{': ungetc( c, finput ); return( '=' ); /* action ... */ case '<': /* get, and look up, a type name (union member name) */ i = 0; while( (c=getc(finput)) != '>' && c>=0 && c!= '\n' ){ tokname[i] = c; if( ++i >= NAMESIZE ) --i; } if( c != '>' ) error( "unterminated < ... > clause" ); tokname[i] = '\0'; for( i=1; i<=ntypes; ++i ){ if( !strcmp( typeset[i], tokname ) ){ numbval = i; return( TYPENAME ); } } typeset[numbval = ++ntypes] = cstash( tokname ); return( TYPENAME ); case '"': case '\'': match = c; tokname[0] = ' '; i = 1; for(;;){ c = getc(finput); if( c == '\n' || c == EOF ) error("illegal or missing ' or \"" ); if( c == '\\' ){ c = getc(finput); tokname[i] = '\\'; if( ++i >= NAMESIZE ) --i; } else if( c == match ) break; tokname[i] = c; if( ++i >= NAMESIZE ) --i; } break; case '%': case '\\': switch(c=getc(finput)) { case '0': return(TERM); case '<': return(LEFT); case '2': return(BINARY); case '>': return(RIGHT); case '%': case '\\': return(MARK); case '=': return(PREC); case '{': return(LCURLY); default: reserve = 1; } default: if( isdigit(c) ){ /* number */ numbval = c-'0' ; base = (c=='0') ? 8 : 10 ; for( c=getc(finput); isdigit(c) ; c=getc(finput) ){ numbval = numbval*base + c - '0'; } ungetc( c, finput ); return(NUMBER); } else if( islower(c) || isupper(c) || c=='_' || c=='.' || c=='$' ){ i = 0; while( islower(c) || isupper(c) || isdigit(c) || c=='_' || c=='.' || c=='$' ){ tokname[i] = c; if( reserve && isupper(c) ) tokname[i] += 'a'-'A'; if( ++i >= NAMESIZE ) --i; c = getc(finput); } } else return(c); ungetc( c, finput ); } tokname[i] = '\0'; if( reserve ){ /* find a reserved word */ if( !strcmp(tokname,"term")) return( TERM ); if( !strcmp(tokname,"token")) return( TERM ); if( !strcmp(tokname,"left")) return( LEFT ); if( !strcmp(tokname,"nonassoc")) return( BINARY ); if( !strcmp(tokname,"binary")) return( BINARY ); if( !strcmp(tokname,"right")) return( RIGHT ); if( !strcmp(tokname,"prec")) return( PREC ); if( !strcmp(tokname,"start")) return( START ); if( !strcmp(tokname,"type")) return( TYPEDEF ); if( !strcmp(tokname,"union")) return( UNION ); error("invalid escape, or illegal reserved word: %s", tokname ); } /* look ahead to distinguish IDENTIFIER from C_IDENTIFIER */ c = getc(finput); while( c==' ' || c=='\t'|| c=='\n' || c=='\f' || c== '/' ) { if( c == '\n' ) ++peekline; else if( c == '/' ){ /* look for comments */ peekline += skipcom(); } c = getc(finput); } if( c == ':' ) return( C_IDENTIFIER ); ungetc( c, finput ); return( IDENTIFIER ); } fdtype( t ){ /* determine the type of a symbol */ register v; if( t >= NTBASE ) v = nontrst[t-NTBASE].tvalue; else v = TYPE( toklev[t] ); if( v <= 0 ) error( "must specify type for %s", (t>=NTBASE)?nontrst[t-NTBASE].name: tokset[t].name ); return( v ); } chfind( t, s ) register char *s; { int i; if (s[0]==' ')t=0; TLOOP(i){ if(!strcmp(s,tokset[i].name)){ return( i ); } } NTLOOP(i){ if(!strcmp(s,nontrst[i].name)) { return( i+NTBASE ); } } /* cannot find name */ if( t>1 ) error( "%s should have been defined earlier", s ); return( defin( t, s ) ); } cpyunion(){ /* copy the union declaration to the output, and the define file if present */ int level, c; fprintf( ftable, "\n# line %d \"%s\"\n", lineno, infile ); fprintf( ftable, "typedef union " ); if( fdefine ) fprintf( fdefine, "\ntypedef union " ); level = 0; for(;;){ if( (c=getc(finput)) < 0 ) error( "EOF encountered while processing %%union" ); putc( c, ftable ); if( fdefine ) putc( c, fdefine ); switch( c ){ case '\n': ++lineno; break; case '{': ++level; break; case '}': --level; if( level == 0 ) { /* we are finished copying */ fprintf( ftable, " YYSTYPE;\n" ); if( fdefine ) fprintf( fdefine, " YYSTYPE;\nextern YYSTYPE yylval;\n" ); return; } } } } cpycode(){ /* copies code between \{ and \} */ int c; c = getc(finput); if( c == '\n' ) { c = getc(finput); lineno++; } fprintf( ftable, "\n# line %d \"%s\"\n", lineno, infile ); while( c>=0 ){ if( c=='\\' ) if( (c=getc(finput)) == '}' ) return; else putc('\\', ftable ); if( c=='%' ) if( (c=getc(finput)) == '}' ) return; else putc('%', ftable ); putc( c , ftable ); if( c == '\n' ) ++lineno; c = getc(finput); } error("eof before %%}" ); } skipcom(){ /* skip over comments */ register c, i=0; /* i is the number of lines skipped */ /* skipcom is called after reading a / */ if( getc(finput) != '*' ) error( "illegal comment" ); c = getc(finput); while( c != EOF ){ while( c == '*' ){ if( (c=getc(finput)) == '/' ) return( i ); } if( c == '\n' ) ++i; c = getc(finput); } error( "EOF inside comment" ); /* NOTREACHED */ } cpyact(offset){ /* copy C action to the next ; or closing } */ int brac, c, match, j, s, tok; fprintf( faction, "\n# line %d \"%s\"\n", lineno, infile ); brac = 0; loop: c = getc(finput); swt: switch( c ){ case ';': if( brac == 0 ){ putc( c , faction ); return; } goto lcopy; case '{': brac++; goto lcopy; case '$': s = 1; tok = -1; c = getc(finput); if( c == '<' ){ /* type description */ ungetc( c, finput ); if( gettok() != TYPENAME ) error( "bad syntax on $ clause" ); tok = numbval; c = getc(finput); } if( c == '$' ){ fprintf( faction, "yyval"); if( ntypes ){ /* put out the proper tag... */ if( tok < 0 ) tok = fdtype( *prdptr[nprod] ); fprintf( faction, ".%s", typeset[tok] ); } goto loop; } if( c == '-' ){ s = -s; c = getc(finput); } if( isdigit(c) ){ j=0; while( isdigit(c) ){ j= j*10+c-'0'; c = getc(finput); } j = j*s - offset; if( j > 0 ){ error( "Illegal use of $%d", j+offset ); } fprintf( faction, "yypvt[-%d]", -j ); if( ntypes ){ /* put out the proper tag */ if( j+offset <= 0 && tok < 0 ) error( "must specify type of $%d", j+offset ); if( tok < 0 ) tok = fdtype( prdptr[nprod][j+offset] ); fprintf( faction, ".%s", typeset[tok] ); } goto swt; } putc( '$' , faction ); if( s<0 ) putc('-', faction ); goto swt; case '}': if( --brac ) goto lcopy; putc( c, faction ); return; case '/': /* look for comments */ putc( c , faction ); c = getc(finput); if( c != '*' ) goto swt; /* it really is a comment */ putc( c , faction ); c = getc(finput); while( c != EOF ){ while( c=='*' ){ putc( c , faction ); if( (c=getc(finput)) == '/' ) goto lcopy; } putc( c , faction ); if( c == '\n' )++lineno; c = getc(finput); } error( "EOF inside comment" ); case '\'': /* character constant */ match = '\''; goto string; case '"': /* character string */ match = '"(('; string: putc( c , faction ); while( c=getc(finput) ){ if( c=='\\' ){ putc( c , faction ); c=getc(finput); if( c == '\n' ) ++lineno; } else if( c==match ) goto lcopy; else if( c=='\n' ) error( "newline in string or char. const." ); putc( c , faction ); } error( "EOF in string or character constant" ); case EOF: error("action does not terminate" ); case '\n': ++lineno; goto lcopy; } lcopy: putc( c , faction ); goto loop; } aracter string */ match = '"cmd/yacc/y3.c 644 0 33 22015 2111463533 6232 # include "dextern" /* important local variables */ int lastred; /* the number of the last reduction of a state */ int defact[NSTATES]; /* the default actions of states */ output(){ /* print the output for the states */ int i, k, c; register struct wset *u, *v; fprintf( ftable, "short yyexca[] ={\n" ); SLOOP(i) { /* output the stuff for state i */ nolook = !(tystate[i]==MUSTLOOKAHEAD); closure(i); /* output actions */ nolook = 1; aryfil( temp1, ntokens+nnonter+1, 0 ); WSLOOP(wsets,u){ c = *( u->pitem ); if( c>1 && cpitem) ) putitem( v->pitem+1, (struct looksets *)0 ); } temp1[c] = state(c); } else if( c > NTBASE && temp1[ (c -= NTBASE) + ntokens ] == 0 ){ temp1[ c+ntokens ] = amem[indgo[i]+c]; } } if( i == 1 ) temp1[1] = ACCEPTCODE; /* now, we have the shifts; look at the reductions */ lastred = 0; WSLOOP(wsets,u){ c = *( u->pitem ); if( c<=0 ){ /* reduction */ lastred = -c; TLOOP(k){ if( BIT(u->ws.lset,k) ){ if( temp1[k] == 0 ) temp1[k] = c; else if( temp1[k]<0 ){ /* reduce/reduce conflict */ if( foutput!=NULL ) fprintf( foutput, "\n%d: reduce/reduce conflict (red'ns %d and %d ) on %s", i, -temp1[k], lastred, symnam(k) ); if( -temp1[k] > lastred ) temp1[k] = -lastred; ++zzrrconf; } else { /* potential shift/reduce conflict */ precftn( lastred, k, i ); } } } } } wract(i); } fprintf( ftable, "\t};\n" ); wdef( "YYNPROD", nprod ); } int pkdebug = 0; apack(p, n ) int *p;{ /* pack state i from temp1 into amem */ int off; register *pp, *qq, *rr; int *q, *r; /* we don't need to worry about checking because we we will only look entries known to be there... */ /* eliminate leading and trailing 0's */ q = p+n; for( pp=p,off=0 ; *pp==0 && pp<=q; ++pp,--off ) /* VOID */ ; if( pp > q ) return(0); /* no actions */ p = pp; /* now, find a place for the elements from p to q, inclusive */ r = &amem[ACTSIZE-1]; for( rr=amem; rr<=r; ++rr,++off ){ /* try rr */ for( qq=rr,pp=p ; pp<=q ; ++pp,++qq){ if( *pp != 0 ){ if( *pp != *qq && *qq != 0 ) goto nextk; } } /* we have found an acceptable k */ if( pkdebug && foutput!=NULL ) fprintf( foutput, "off = %d, k = %d\n", off, rr-amem ); for( qq=rr,pp=p; pp<=q; ++pp,++qq ){ if( *pp ){ if( qq > r ) error( "action table overflow" ); if( qq>memp ) memp = qq; *qq = *pp; } } if( pkdebug && foutput!=NULL ){ for( pp=amem; pp<= memp; pp+=10 ){ fprintf( foutput, "\t"); for( qq=pp; qq<=pp+9; ++qq ) fprintf( foutput, "%d ", *qq ); fprintf( foutput, "\n"); } } return( off ); nextk: ; } error("no space in action table" ); /* NOTREACHED */ } go2out(){ /* output the gotos for the nontermninals */ int i, j, k, best, count, cbest, times; fprintf( ftemp, "$\n" ); /* mark begining of gotos */ for( i=1; i<=nnonter; ++i ) { go2gen(i); /* find the best one to make default */ best = -1; times = 0; for( j=0; j<=nstate; ++j ){ /* is j the most frequent */ if( tystate[j] == 0 ) continue; if( tystate[j] == best ) continue; /* is tystate[j] the most frequent */ count = 0; cbest = tystate[j]; for( k=j; k<=nstate; ++k ) if( tystate[k]==cbest ) ++count; if( count > times ){ best = cbest; times = count; } } /* best is now the default entry */ zzgobest += (times-1); for( j=0; j<=nstate; ++j ){ if( tystate[j] != 0 && tystate[j]!=best ){ fprintf( ftemp, "%d,%d,", j, tystate[j] ); zzgoent += 1; } } /* now, the default */ zzgoent += 1; fprintf( ftemp, "%d\n", best ); } } int g2debug = 0; go2gen(c){ /* output the gotos for nonterminal c */ int i, work, cc; struct item *p, *q; /* first, find nonterminals with gotos on c */ aryfil( temp1, nnonter+1, 0 ); temp1[c] = 1; work = 1; while( work ){ work = 0; PLOOP(0,i){ if( (cc=prdptr[i][1]-NTBASE) >= 0 ){ /* cc is a nonterminal */ if( temp1[cc] != 0 ){ /* cc has a goto on c */ cc = *prdptr[i]-NTBASE; /* thus, the left side of production i does too */ if( temp1[cc] == 0 ){ work = 1; temp1[cc] = 1; } } } } } /* now, we have temp1[c] = 1 if a goto on c in closure of cc */ if( g2debug && foutput!=NULL ){ fprintf( foutput, "%s: gotos on ", nontrst[c].name ); NTLOOP(i) if( temp1[i] ) fprintf( foutput, "%s ", nontrst[i].name); fprintf( foutput, "\n"); } /* now, go through and put gotos into tystate */ aryfil( tystate, nstate, 0 ); SLOOP(i){ ITMLOOP(i,p,q){ if( (cc= *p->pitem) >= NTBASE ){ if( temp1[cc -= NTBASE] ){ /* goto on c is possible */ tystate[i] = amem[indgo[i]+c]; break; } } } } } precftn(r,t,s){ /* decide a shift/reduce conflict by precedence. /* r is a rule number, t a token number */ /* the conflict is in state s */ /* temp1[t] is changed to reflect the action */ int lp,lt, action; lp = levprd[r]; lt = toklev[t]; if( PLEVEL(lt) == 0 || PLEVEL(lp) == 0 ) { /* conflict */ if( foutput != NULL ) fprintf( foutput, "\n%d: shift/reduce conflict (shift %d, red'n %d) on %s", s, temp1[t], r, symnam(t) ); ++zzsrconf; return; } if( PLEVEL(lt) == PLEVEL(lp) ) action = ASSOC(lt); else if( PLEVEL(lt) > PLEVEL(lp) ) action = RASC; /* shift */ else action = LASC; /* reduce */ switch( action ){ case BASC: /* error action */ temp1[t] = ERRCODE; return; case LASC: /* reduce */ temp1[t] = -r; return; } } wract(i){ /* output state i */ /* temp1 has the actions, lastred the default */ int p, p0, p1; int ntimes, tred, count, j; int flag; /* find the best choice for lastred */ lastred = 0; ntimes = 0; TLOOP(j){ if( temp1[j] >= 0 ) continue; if( temp1[j]+lastred == 0 ) continue; /* count the number of appearances of temp1[j] */ count = 0; tred = -temp1[j]; levprd[tred] |= REDFLAG; TLOOP(p){ if( temp1[p]+tred == 0 ) ++count; } if( count >ntimes ){ lastred = tred; ntimes = count; } } /* for error recovery, arrange that, if there is a shift on the /* error recovery token, `error', that the default be the error action */ if( temp1[1] > 0 ) lastred = 0; /* clear out entries in temp1 which equal lastred */ TLOOP(p) if( temp1[p]+lastred == 0 )temp1[p]=0; wrstate(i); defact[i] = lastred; flag = 0; TLOOP(p0){ if( (p1=temp1[p0])!=0 ) { if( p1 < 0 ){ p1 = -p1; goto exc; } else if( p1 == ACCEPTCODE ) { p1 = -1; goto exc; } else if( p1 == ERRCODE ) { p1 = 0; goto exc; exc: if( flag++ == 0 ) fprintf( ftable, "-1, %d,\n", i ); fprintf( ftable, "\t%d, %d,\n", tokset[p0].value, p1 ); ++zzexcp; } else { fprintf( ftemp, "%d,%d,", tokset[p0].value, p1 ); ++zzacent; } } } if( flag ) { defact[i] = -2; fprintf( ftable, "\t-2, %d,\n", lastred ); } fprintf( ftemp, "\n" ); return; } wrstate(i){ /* writes state i */ register j0,j1; register struct item *pp, *qq; register struct wset *u; if( foutput == NULL ) return; fprintf( foutput, "\nstate %d\n",i); ITMLOOP(i,pp,qq) fprintf( foutput, "\t%s\n", writem(pp->pitem)); if( tystate[i] == MUSTLOOKAHEAD ){ /* print out empty productions in closure */ WSLOOP( wsets+(pstate[i+1]-pstate[i]), u ){ if( *(u->pitem) < 0 ) fprintf( foutput, "\t%s\n", writem(u->pitem) ); } } /* check for state equal to another */ TLOOP(j0) if( (j1=temp1[j0]) != 0 ){ fprintf( foutput, "\n\t%s ", symnam(j0) ); if( j1>0 ){ /* shift, error, or accept */ if( j1 == ACCEPTCODE ) fprintf( foutput, "accept" ); else if( j1 == ERRCODE ) fprintf( foutput, "error" ); else fprintf( foutput, "shift %d", j1 ); } else fprintf( foutput, "reduce %d",-j1 ); } /* output the final production */ if( lastred ) fprintf( foutput, "\n\t. reduce %d\n\n", lastred ); else fprintf( foutput, "\n\t. error\n\n" ); /* now, output nonterminal actions */ j1 = ntokens; for( j0 = 1; j0 <= nnonter; ++j0 ){ if( temp1[++j1] ) fprintf( foutput, "\t%s goto %d\n", symnam( j0+NTBASE), temp1[j1] ); } } wdef( s, n ) char *s; { /* output a definition of s to the value n */ fprintf( ftable, "# define %s %d\n", s, n ); } warray( s, v, n ) char *s; int *v, n; { register i; fprintf( ftable, "short %s[]={\n", s ); for( i=0; i j ) j = *p; if( *p < k ) k = *p; } if( k <= j ){ /* nontrivial situation */ /* temporarily, kill this for compatibility j -= k; /* j is now the range */ if( k > maxoff ) maxoff = k; } greed[i] = (yypact[i+1]-yypact[i]) + 2*j; if( j > maxspr ) maxspr = j; } /* initialize ggreed table */ for( i=1; i<=nnonter; ++i ){ ggreed[i] = 1; j = 0; /* minimum entry index is always 0 */ q = mem + yypgo[i+1] -1; for( p = mem+yypgo[i]; p j ) j = *p; } ggreed[i] = ggreed[i] + 2*j; if( j > maxoff ) maxoff = j; } /* now, prepare to put the shift actions into the a array */ for( i=0; i1 ) fprintf( ftable, "State %d: null\n", i ); pa[i] = YYFLAG1; } while( (i = nxti()) != NOMORE ) { if( i >= 0 ) stin(i); else gin(-i); } if( adb>2 ){ /* print a array */ for( p=a; p <= maxa; p += 10){ fprintf( ftable, "%4d ", p-a ); for( i=0; i<10; ++i ) fprintf( ftable, "%4d ", p[i] ); fprintf( ftable, "\n" ); } } /* write out the output appropriate to the language */ aoutput(); osummary(); ZAPFILE(TEMPNAME); } gin(i){ register *p, *r, *s, *q1, *q2; /* enter gotos on nonterminal i into array a */ ggreed[i] = 0; q2 = mem+ yypgo[i+1] - 1; q1 = mem + yypgo[i]; /* now, find a place for it */ for( p=a; p < &a[ACTSIZE]; ++p ){ if( *p ) continue; for( r=q1; r maxa ){ if( (maxa=s) > &a[ACTSIZE] ) error( "a array overflow" ); } } /* we have found a spot */ *p = *q2; if( p > maxa ){ if( (maxa=p) > &a[ACTSIZE] ) error( "a array overflow" ); } for( r=q1; r1 ) fprintf( ftable, "Nonterminal %d, entry at %d\n" , i, pgo[i] ); goto nextgi; nextgp: ; } error( "cannot place goto %d\n", i ); nextgi: ; } stin(i){ register *r, *s, n, flag, j, *q1, *q2; greed[i] = 0; /* enter state i into the a array */ q2 = mem+yypact[i+1]; q1 = mem+yypact[i]; /* find an acceptable place */ for( n= -maxoff; n1 ) fprintf( ftable, "State %d: entry at %d equals state %d\n", i, n, j ); return; } goto nextn; /* we have some disagreement */ } } for( r = q1; r < q2; r += 2 ){ if( (s = *r + n + a ) >= &a[ACTSIZE] ) error( "out of space in optimizer a array" ); if( s > maxa ) maxa = s; if( *s != 0 && *s != r[1] ) error( "clobber of a array, pos'n %d, by %d", s-a, r[1] ); *s = r[1]; } pa[i] = n; if( adb>1 ) fprintf( ftable, "State %d: entry at %d\n", i, pa[i] ); return; nextn: ; } error( "Error; failure to place state %d\n", i ); } nxti(){ /* finds the next i */ register i, max, maxi; max = 0; for( i=1; i<= nnonter; ++i ) if( ggreed[i] >= max ){ max = ggreed[i]; maxi = -i; } for( i=0; i= max ){ max = greed[i]; maxi = i; } if( nxdb ) fprintf( ftable, "nxti = %d, max = %d\n", maxi, max ); if( max==0 ) return( NOMORE ); else return( maxi ); } osummary(){ /* write summary */ register i, *p; if( foutput == NULL ) return; i=0; for( p=maxa; p>=a; --p ) { if( *p == 0 ) ++i; } fprintf( foutput, "Optimizer space used: input %d/%d, output %d/%d\n", pmem-mem+1, MEMSIZE, maxa-a+1, ACTSIZE ); fprintf( foutput, "%d table entries, %d zero\n", (maxa-a)+1, i ); fprintf( foutput, "maximum spread: %d, maximum offset: %d\n", maxspr, maxoff ); } aoutput(){ /* this version is for C */ /* write out the optimized parser */ fprintf( ftable, "# define YYLAST %d\n", maxa-a+1 ); arout( "yyact", a, (maxa-a)+1 ); arout( "yypact", pa, nstate ); arout( "yypgo", pgo, nnonter+1 ); } arout( s, v, n ) char *s; int *v, n; { register i; fprintf( ftable, "short %s[]={\n", s ); for( i=0; i &mem[MEMSIZE] ) error( "out of space" ); return( c ); } ); if( ++i == n ) fprintf( ftable, " };\n" ); else fprintf( ftable, "," ); } } gtnm(){ register s, val, c; /* read and convert an integer from the standard input */ /* return the terminating character */ /* blanks, tabs, and newlines are ignored */ s = 1; val = 0; while( (c=getc(finput)) != EOF ){ if( isdigit(c) ){ val = val * 10 + c - '0'; } else if ( c == '-' ) s = -1; else break; } *pmem++ cmd/yacc/yaccdiffs 644 0 33 11423 2111463533 7412 Yacc Differences This document gives a short list of differences between the new Yacc and earlier Yaccs. _B_u_g_s _F_i_x_e_d 1. There was a bug which caused Yacc to silently steal away in the night if an action had mismatched '' in it; this is fixed. 2. A number of table size overflow conditions used to be checked incorrectly or not at all; this is now better. 3. A bug which suppressed the printing of some rules with empty RHS's on the y.output file has been fixed. _S_p_e_e_d_u_p_s, _S_h_r_i_n_k_s, _a_n_d _D_i_d_d_l_e_s 1. The old optimizer (-o) flag is now the default in Yacc. At the same time, the Yacc process itself has been sped up; the result is that Yacc takes about the same or slightly longer on short inputs, but is much faster on long inputs. 2. The optimized parsers produced by Yacc are likely to be 2-3 times faster and 1-2k bytes smaller than the old ones, for medium/large grammars. The time to parse is now essentially independent of the grammar size; it used to grow as the size of the grammar did. 3. The y.output file has been considerably reformatted, to make it easier to read. The old "goto" table is gone; the goto's for nonterminal symbols are now printed in the states where they occur. Rules which can be reduced in a state have their rule number printed after them, in (). This makes it much easier to interpret the "reduce n" actions. The message "same as n" has been removed; duplicate states are in fact duplicated, saving shuffling and cross-referencing. 4. Various table sizes are somewhat bigger. 5. The form feed character, and the construction '\f', are now recognized; form feed is ignored (=whitespace) on input. January 14, 1977 - 2 - 6. The arrays "yysterm" and "yysnter" are no longer (( pro- duced on output; they were little used, and took up a surprising amount of space in the parser. 7. Rules in the input which are not reduced are now com- plained about; they may represent unreachable parts of the grammar, botched precedence, or duplicate rules. As with conflicts, a summary complaint, "n rules not reduced", appears at the terminal; more information is on the y.output file. _N_e_w _F_e_a_t_u_r_e_s 1. The actions are now copied into the middle of the parser, rather than being gathered into a separate rou- tine. It's faster. Also, you can return a value from yyparse (and stop parsing...) by saying `return(x);' in an action. There are macros which simulate various interesting parsing actions: YYERROR causes the parser to behave as if a syntax error had been encountered (i.e., do error recovery) YYACCEPT causes a return from yyparse with a value of 0 YYABORT causes a return from yyparse with a value of 1 2. The repositioning of the actions may cause scope prob- lems for some people who include lexical analyzers in funny places. This can probably be avoided by using another new feature: the `-d' option. Invoking Yacc with the -d option causes the #defines generated by Yacc to be written out onto a file called "y.tab.h", (as well as on the "y.tab.c" file). This can then be included as desired in lexical analyzers, etc. 3. Actions are now permitted within rules; for such actions, $$, $1, $2, etc. continue to have their usual meanings. An error message is returned if any $n refers to a value lying to the right of the action in the rule. These internal actions are assumed to return a value, which is accessed through the $n mechanism. In the y.output file, the actions are referred to by created nonterminal names of the form $$nnn. All actions within rules are assumed to be distinct. If some actions are the same, Yacc might report reduce/reduce conflicts which could be resolved by explicitly identifying identical actions; does anyone have a good idea for a syntax to do this? The = sign may now be omitted in action constructions of the form ={ ... }. January 14, 1977 - 3 - 4. As a result of the rearrangement of rules, people who thought they knew what $1 really turned into, and wrote programs which referred to yypv[1], etc., are in trou- ble. See Steve Johnson if you are really suffering. January 14, 1977 The = sign may now be omitted in action constructions of the form ={ ... }. January 14, 1977 - 3 - 4. As a result of the rearrangement of rules, people whcmd/yacc/yaccnews 644 0 33 15224 2111463533 7276 5/18/78 A new version of Yacc has been installed which contains some new features relating to error recovery, detection of funny conditions in the grammar, and strong typing. Existing grammars should continue to work, with the possible exception of somewhat better error recovery behavior. More details follow: *** Ratfor and EFL Yacc are dead. Long live C! *** The y.tab.c file now uses the # line feature to reflect most error conditions in actions, etc., back to the yacc source file, rather than the y.tab.c file. As always with such features, lookahead may cause the line number to be one too large occasionally. *** The error recovery algorithm has been changed to cause the parser never to reduce on a state where there is a shift on the special token `error'. This has the effect of causing the error recovery action to take place somewhat closer to the location of the error than previously. It does not affect the behavior of the parser in the absence of errors. The parse tables may be 1-2% larger as a result of this change. *** Yacc now detects the existence of nonterminals in the grammar which can never derive any strings of tokens (even the empty string). The simplest example is the grammar: %% s : s 'a' ; Here, one must reduce `s' in order to reduce `s': the parser would always report error. If such nonterminals are present, Yacc reports all such, then terminates. *** There is a new reserved word, %start. When used in the declarations section, it may be used to declare the start symbol of the grammar. If %start does not appear, the start symbol is, as at present, the first nonterminal symbol encountered. *** Yacc produced parsers are notorious for producing many many comments from lint. The problem is the value stack of the parser, which typically may contain integers, pointers, and possibly even floating point, etc., values. The lack of tight specification of this stack leads to potential nonportability, and considerable loss of the diagnostic power of lint. Thus, some new features have been added which make use of the new structure and union facilities of C. In effect, the user of Yacc may `honestly' declare the value stack, as well as the lexical interface variable, yylval, to be unions of all the types desired. Yacc will keep track of the types declared for all terminals and nonterminals, and automatically insert the appropriate union tag for all constructions such as $1, $$, etc. It is up to the user to supply the appropriate union declaration, and to declare the type of all the terminal and nonterminal symbols which will have values. If the type declaration feature is used at all, it must be used correctly; if it is not used, the default values are integers, as at present. The new type declaration features are described below: *** There is a new keyword, %union. A construction such as %union { int inttag; float floattag; struct mumble *ptrtag; } can be used, in the declarations section, to declare the type of the yacc stack. The declaration is effectively copied to the y.tab.c file, and, if the -d option is present, to the y.tab.h file as well. The declaration is used to declare the typedef YYSTYPE, which is the type of the value stack. If the -d option is present, the declaration extern YYSTYPE yylval; is also placed onto the y.tab.h file. Note that the lexical analyzer must be changed to use the appropriate union tag when assigning values. It is not necessary that the %union mechanism be used, as long as there is a union type YYSTYPE defined in the declarations section. *** The %token, %left, %right, and %nonassoc declarations now accept a union tag, enclosed in angle brackets (<...>), immediately after the keyword. All tokens mentioned in that declaration are taken to have the appropriate type. *** There is a new keyword, %type, also followed by a union tag in angle brackets, which may be used in the declarations section to declare nonterminal symbols to have a particular type. In both cases, whenever a $$ or $n is encountered in an action, the appropriate union tag is supplied by Yacc. Once any type is declared, it is an error to use a $$ or $n whose type is unknown. It is also illegal to have a grammar rule whose LHS has a type, but the rule has no action and the default action { $$ = $1; } would be inapplicable because $1 had a different type. *** There are occasional times when the type of something is not known (for example, when an action within a rule returns a value). In this case, the $$ and $n syntax is extended to permit the declaration of the type: the syntax is $$ and $n respectively. This rather strange syntax is necessitated by the need to distinguish the <> surrounding the tag from the < and > operators of C in the action. It is anticipated that the usage will be rare. *** As always, report gripes, bugs, suggestions to SCJ *** 12/01/76 A newer version of Yacc has been installed which copies the actions directly into the parser, rather than gathering them into a separate routine. The advantages include 1. It's faster 2. You can return a value from yyparse (and stop parsing...) by saying `return(x);' in an action 3. There are macros which simulate various interesting parsing actions: YYERROR causes the parser to behave as if a syntax error had been encountered (i.e., do error recovery) YYACCEPT causes a return from yyparse with a value of 0 YYABORT causes a return from yyparse with a value of 1 The repositioning of the actions may cause scope problems for some people who include lexical analyzers in funny places. This can probably be avoided by using another new feature: the `-d' option. Invoking Yacc with the -d option causes the #defines generated by Yacc to be written out onto a file called "y.tab.h". This can then be included as desired in lexical analyzers, etc. 11/28/76 A new version of Yacc has been installed which permits actions within rules. For such actions, $$ and $1, $2, etc. continue to have their usual meanings. An error message is returned if any $n refers to a value lying to the right of the action in the rule. These internal actions are assumed to return a value, which is accessed through the $n mechanism. In the y.output file, the actions are referred to by created nonterminal names of the form $$nnn. All actions within rules are assumed to be distinct. If some actions are the same, Yacc might report reduce/reduce conflicts which could be resolved by explicitly identifying identical actions; does ((anyone have a good idea for a syntax to do this? In the new Yacc, the = sign may now be omitted in action constructions of the form ={ ... } to return a value, which is accessed through the $n mechanism. In the y.output file, the actions are referred to by created nonterminal names of the form $$nnn. All actions within rules are assumed to be distinct. If some actions are the same, Yacc might report reduce/reduce conflicts which could be resolved by explicitly identifying identical actions; does cmd/yacc/yaccpar 644 0 33 6435 2111463533 7070 # # define YYFLAG -1000 # define YYERROR goto yyerrlab # define YYACCEPT return(0) # define YYABORT return(1) /* parser for yacc output */ #ifdef YYDEBUG int yydebug = 0; /* 1 for debugging */ #endif YYSTYPE yyv[YYMAXDEPTH]; /* where the values are stored */ int yychar = -1; /* current input token number */ int yynerrs = 0; /* number of errors */ short yyerrflag = 0; /* error recovery flag */ yyparse() { short yys[YYMAXDEPTH]; short yyj, yym; register YYSTYPE *yypvt; register short yystate, *yyps, yyn; register YYSTYPE *yypv; register short *yyxi; yystate = 0; yychar = -1; yynerrs = 0; yyerrflag = 0; yyps= &yys[-1]; yypv= &yyv[-1]; yystack: /* put a state and value onto the stack */ #ifdef YYDEBUG if( yydebug ) printf( "state %d, char 0%o\n", yystate, yychar ); #endif if( ++yyps> &yys[YYMAXDEPTH] ) { yyerror( "yacc stack overflow" ); return(1); } *yyps = yystate; ++yypv; *yypv = yyval; yynewstate: yyn = yypact[yystate]; if( yyn<= YYFLAG ) goto yydefault; /* simple state */ if( yychar<0 ) if( (yychar=yylex())<0 ) yychar=0; if( (yyn += yychar)<0 || yyn >= YYLAST ) goto yydefault; if( yychk[ yyn=yyact[ yyn ] ] == yychar ){ /* valid shift */ yychar = -1; yyval = yylval; yystate = yyn; if( yyerrflag > 0 ) --yyerrflag; goto yystack; } yydefault: /* default state action */ if( (yyn=yydef[yystate]) == -2 ) { if( yychar<0 ) if( (yychar=yylex())<0 ) yychar = 0; /* look through exception table */ for( yyxi=yyexca; (*yyxi!= (-1)) || (yyxi[1]!=yystate) ; yyxi += 2 ) ; /* VOID */ while( *(yyxi+=2) >= 0 ){ if( *yyxi == yychar ) break; } if( (yyn = yyxi[1]) < 0 ) return(0); /* accept */ } if( yyn == 0 ){ /* error */ /* error ... attempt to resume parsing */ switch( yyerrflag ){ case 0: /* brand new error */ yyerror( "syntax error" ); yyerrlab: ++yynerrs; case 1: case 2: /* incompletely recovered error ... try again */ yyerrflag = 3; /* find a state where "error" is a legal shift action */ while ( yyps >= yys ) { yyn = yypact[*yyps] + YYERRCODE; if( yyn>= 0 && yyn < YYLAST && yychk[yyact[yyn]] == YYERRCODE ){ yystate = yyact[yyn]; /* simulate a shift of "error" */ goto yystack; } yyn = yypact[*yyps]; /* the current yyps has no shift onn "error", pop stack */ #ifdef YYDEBUG if( yydebug ) printf( "error recovery pops state %d, uncovers %d\n", *yyps, yyps[-1] ); #endif --yyps; --yypv; } /* there is no state on the stack with an error shift ... abort */ yyabort: return(1); case 3: /* no shift yet; clobber input char */ #ifdef YYDEBUG if( yydebug ) printf( "error recovery discards char %d\n", yychar ); #endif if( yychar == 0 ) goto yyabort; /* don't discard EOF, quit */ yychar = -1; goto yynewstate; /* try again in the same state */ } } /* reduction by production yyn */ #ifdef YYDEBUG if( yydebug ) printf("reduce %d\n",yyn); #endif yyps -= yyr2[yyn]; yypvt = yypv; yypv -= yyr2[yyn]; yyval = yypv[1]; yym=yyn; /* consult goto table to find next state */ yyn = yyr1[yyn]; yyj = yypgo[yyn] + *yyps + 1; if( yyj>=YYLAST || yychk[ yystate = yyact[yyj] ] != -yyn ) yystate = yyact[yypgo[yyn]]; switch(yym){ $A } goto yystack; /* stack new state and value */ } ewstate; /* try again in the same state */ } } /* reduction by production yyn */ #ifdef YYDEBUG if( yydebug ) printf("reduce %d\n",yyn); #endif yyps -= yyr2[yyn]; yypvt = yypv; yypv -= yyr2[yyn]; yyval = ycmd/mt.c 444 0 33 2451 2552436602 5366 static char *sccsid = "@(#)mt.c 4.2 (Berkeley) 81/07/05"; /* * mt */ #include #include #include #include #include struct commands { char *c_name; int c_code; int c_ronly; } com[] = { "eof", MTWEOF, 0, "fsf", MTFSF, 1, "bsf", MTBSF, 1, "fsr", MTFSR, 1, "bsr", MTBSR, 1, "rewind", MTREW, 1, "offline", MTOFFL, 1, 0,0 }; int mtfd; struct mtop mt_com; char *tape; main(argc, argv) char **argv; { char line[80], *getenv(); register char *cp; register struct commands *comp; if (argc < 2) { fprintf(stderr, "usage: mt [ -t tape ] command [ count ]\n"); exit(1); } if ((strcmp(argv[1], "-t") == 0) && argc > 2) { argc -= 2; tape = argv[2]; argv += 2; } else if ((tape = getenv("TAPE")) == NULL) tape = "/dev/rmt12"; 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); } mt_com.mt_count = (argc > 2 ? atoi(argv[2]) : 1); mt_com.mt_op = comp->c_code; if (ioctl(mtfd, MTIOCTOP, &mt_com) < 0) { fprintf(stderr, "%s %d ", comp->c_name, mt_com.mt_count); perror("failed"); } } ; 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); cmd/whereis.c 444 0 33 10051 2551015141 6415 static char *sccsid = "@(#)whereis.c 4.4 (Berkeley) 7/3/81"; #include #include #include #include #include static char *bindirs[] = { "/etc", "/bin", "/usr/bin", "/usr/games", "/lib", "/usr/ucb", "/usr/lib", "/usr/local", "/usr/new", "/usr/old", 0 }; static char *mandirs[] = { "/usr/man/man1", "/usr/man/man2", "/usr/man/man3", "/usr/man/man4", "/usr/man/man5", "/usr/man/man6", "/usr/man/man7", "/usr/man/man8", 0 }; static char *srcdirs[] = { "/usr/src/cmd", "/usr/src/games", "/usr/src/libc/gen", "/usr/src/libc/stdio", "/usr/src/libc/sys", "/usr/src/new", "/usr/src/old", "/usr/src/local", "/usr/src/undoc", 0 }; char sflag = 1; char bflag = 1; char mflag = 1; char **Sflag; int Scnt; char **Bflag; int Bcnt; char **Mflag; int Mcnt; char uflag; /* * whereis name * look for source, documentation and binaries */ main(argc, argv) int argc; char *argv[]; { #ifdef CORY if (getuid() == 0) nice(-20); if (((getuid() >> 8) & 0377) > 10) setuid(getuid()); #endif argc--, argv++; if (argc == 0) { usage: fprintf(stderr, "whereis [ -sbmu ] [ -SBM dir ... -f ] name...\n"); exit(1); } do if (argv[0][0] == '-') { register char *cp = argv[0] + 1; while (*cp) switch (*cp++) { case 'f': break; case 'S': getlist(&argc, &argv, &Sflag, &Scnt); break; case 'B': getlist(&argc, &argv, &Bflag, &Bcnt); break; case 'M': getlist(&argc, &argv, &Mflag, &Mcnt); break; case 's': zerof(); sflag++; continue; case 'u': uflag++; continue; case 'b': zerof(); bflag++; continue; case 'm': zerof(); mflag++; continue; default: goto usage; } argv++; } else lookup(*argv++); while (--argc > 0); } getlist(argcp, argvp, flagp, cntp) char ***argvp; int *argcp; char ***flagp; int *cntp; { (*argvp)++; *flagp = *argvp; *cntp = 0; for ((*argcp)--; *argcp > 0 && (*argvp)[0][0] != '-'; (*argcp)--) (*cntp)++, (*argvp)++; (*argcp)++; (*argvp)--; } zerof() { if (sflag && bflag && mflag) sflag = bflag = mflag = 0; } int count; int print; lookup(cp) register char *cp; { register char *dp; for (dp = cp; *dp; dp++) continue; for (; dp > cp; dp--) { if (*dp == '.') { *dp = 0; break; } } for (dp = cp; *dp; dp++) if (*dp == '/') cp = dp + 1; if (uflag) { print = 0; count = 0; } else print = 1; again: if (print) printf("%s:", cp); if (sflag) { looksrc(cp); if (uflag && print == 0 && count != 1) { print = 1; goto again; } } count = 0; if (bflag) { lookbin(cp); if (uflag && print == 0 && count != 1) { print = 1; goto again; } } count = 0; if (mflag) { lookman(cp); if (uflag && print == 0 && count != 1) { print = 1; goto again; } } if (print) printf("\n"); } looksrc(cp) char *cp; { if (Sflag == 0) { find(srcdirs, cp); } else findv(Sflag, Scnt, cp); } lookbin(cp) char *cp; { if (Bflag == 0) find(bindirs, cp); else findv(Bflag, Bcnt, cp)((; } lookman(cp) char *cp; { if (Mflag == 0) { find(mandirs, cp); } else findv(Mflag, Mcnt, cp); } findv(dirv, dirc, cp) char **dirv; int dirc; char *cp; { while (dirc > 0) findin(*dirv++, cp), dirc--; } find(dirs, cp) char **dirs; char *cp; { while (*dirs) findin(*dirs++, cp); } findin(dir, cp) char *dir, *cp; { register FILE *d; struct direct direct; d = fopen(dir, "r"); if (d == NULL) return; while (fread(&direct, sizeof direct, 1, d) == 1) { if (direct.d_ino == 0) continue; if (itsit(cp, direct.d_name)) { count++; if (print) printf(" %s/%.14s", dir, direct.d_name); } } fclose(d); } itsit(cp, dp) register char *cp, *dp; { register int i = 14; if (dp[0] == 's' && dp[1] == '.' && itsit(cp, dp+2)) return (1); while (*cp && *dp && *cp == *dp) cp++, dp++, i--; if (*cp == 0 && *dp == 0) return (1); while (isdigit(*dp)) dp++; if (*cp == 0 && *dp++ == '.') { --i; while (i > 0 && *dp) if (--i, *dp++ == '.') return (*dp++ == 'C' && *dp++ == 0); return (1); } return (0); } count++; if (print) printf(" %s/%.14s", dir, direct.d_name); } } fclose(d); } itsit(cp, dp) register char *cp, *dp; { register int i = 14; if (dp[0] == 's' && dp[1] == '.' && itsit(cp, dp+2)) return (1); while (*cp && *dp && *cp == *dp) cp++, dp++, i--; if (*cp == 0 && *dp == 0) return (1); while (isdigit(*dp)) dp++; if (*cp == 0 && *dp++ == '.') { --i; while (i > 0 && *dp) if (--i, *dp++ == '.') return (*dp++ == 'C' && *dp+cmd/bad144.c 444 0 33 10053 2527220416 5736 static char *sccsid = "@(#)bad144.c 4.2 (Berkeley) 81/05/11"; /* * bad144 * * This program prints and/or initializes a bad block record for a pack, * in the format used by the DEC standard 144. * * BUGS: * Only reads/writes the first of the bad block record (sector 0 * of the last track of the disk); in fact, there are copies * of the information in the first 5 even numbered sectors of this * track, but UNIX uses only the first, and we don't bother with the * others. * * It is preferable to write the bad information with a standard formatter, * but this program will do in a pinch, e.g. if the bad information is * accidentally wiped out this is a much faster way of restoring it than * reformatting. To add a new bad sector the formatter must be used in * general since UNIX doesn't have on-line formatters to write the BSE * error in the header. The */ #include #include #include struct diskinfo { char *di_type; /* type name of disk */ int di_size; /* size of entire volume in sectors */ int di_nsect; /* sectors per track */ int di_ntrak; /* tracks per cylinder */ } diskinfo[] = { "rk06", 22*3*411, 22, 3, "rk07", 22*3*815, 22, 3, "rm03", 32*5*823, 32, 5, "rm05", 32*19*823, 32, 19, "rp06", 22*19*815, 22, 19, "rm80", 31*14*559, 31, 14, "rp05", 22*19*411, 22, 19, "rp07", 50*32*630, 50, 32, 0, }; struct dkbad dkbad; main(argc, argv) int argc; char **argv; { register struct diskinfo *di; register struct bt_bad *bt; char name[BUFSIZ]; int i, f, bad, oldbad, errs; argc--, argv++; if (argc < 2) { fprintf(stderr, "usage: bad type disk [ snum [ bn ... ] ]\n"); fprintf(stderr, "e.g.: bad rk07 hk0\n"); exit(1); } for (di = diskinfo; di->di_type; di++) if (!strcmp(di->di_type, argv[0])) goto found; fprintf(stderr, "%s: not a known disk type\n", argv[0]); fprintf(stderr, "known types:"); for (di = diskinfo; di->di_type; di++) fprintf(stderr, " %s", di->di_type); fprintf(stderr, "\n"); exit(1); found: sprintf(name, "/dev/r%sc", argv[1]); argc -= 2; argv += 2; if (argc == 0) { f = open(name, 0); if (f < 0) { perror(name); exit(1); } lseek(f, 512 * (di->di_size - di->di_nsect), 0); printf("bad block information at 0x%x in %s:\n", tell(f), name); if (read(f, &dkbad, sizeof (struct dkbad)) != sizeof (struct dkbad)) { fprintf("%s: can't read bad block info (wrong type disk?)\n"); exit(1); } printf("cartidge serial number: %d(10)\n", dkbad.bt_csn); switch (dkbad.bt_flag) { case -1: printf("alignment cartridge\n"); break; case 0: break; default: printf("bt_flag=%x(16)?\n", dkbad.bt_flag); break; } oldbad = 0; bt = dkbad.bt_bad; for (i = 0; i < 128; i++) { bad = (bt->bt_cyl<<16) + bt->bt_trksec; if (bad < 0) break; printf("sn=%d, cn=%d, tn=%d, sn=%d\n", (bt->bt_cyl*di->di_ntrak + (bt->bt_trksec>>8)) * di->di_nsect + (bt->bt_trksec&0xff), bt->bt_cyl, bt->bt_trksec>>8, bt->bt_trksec&0xff); bt++; } exit (0); } f = open(name, 1); if (f < 0) { perror(name); exit(1); } dkbad.bt_csn = atoi(*argv++); argc--; dkbad.bt_mbz = 0; if (argc > 2 * di->di_nsect || argc > 126) { printf("bad: too many bad sectors specified\n"); if (2 * di->di_nsect > 126) printf("limited to 126 by information format\n"); else printf("limited to %d (only 2 tracks of sectors)\n", 2 * di->di_nsect); exit(1); } errs = 0; i = 0; while (argc > 0) { int sn = atoi(*argv++); argc--; if (sn < 0 || sn >= di->di_size) { printf("%d: out of range [0,%d) for %s\n", sn, di->di_size, di->di_type); errs++; } dkbad.bt_bad[i].bt_cyl = sn / (di->di_nsect*di->di_ntrak); sn %= (di->di_nsect*di->di_ntrak); dkbad.bt_bad[i].bt_trksec = ((sn/di->di_nsect) << 8) + (sn%di->di_nsect); i++; } while (i < 126) { dkbad.bt_bad[i].bt_trksec = -1; dkbad.bt_bad[i].bt_cyl = -1; i++; } if (errs) exit(1); lseek(f, 512 * (di->di_size - di->di_nsect), 0); if (write(f, (caddr_t)&dkbad, sizeof (dkbad)) != sizeof (dkbad)) { perror(name); exit(1); } exit(0); } sn, di->di_size, di->di_type); errs++; } dkbad.bt_bad[i].bt_cyl = sn / (di->di_nsect*di->di_ntrak); sn %= (di->di_nsect*di->di_ntrak); dkbad.bt_bad[i].bt_trksec = ((sn/di->di_nsect) << 8) + (sn%di->di_nsect); i++; } while (i < 126) { dkbad.bt_bad[i].bt_trksec = -1; dkbad.bt_bad[i].bt_cyl = -1; i++; } if (errs) exit(1); lseek(f, 512 * (di->di_size - di->di_nsect), 0); if (write(f, (caddr_t)&dkbad, sizeof (dkbad)) != sizeof (dkbad)) {cmd/dnd.c 444 0 33 16324 2462774261 5545 static char *sccsid ="@(#)dnd.c 4.4 (Berkeley) 1/20/81"; /* * batch queue manager. by Greg Chesson. Modified to be * a daemon managing requests to a multiple autodialers, by * Keith Sklower. */ #include #include #include #include #define QSIZE 16 #define DSIZE 40 int xd; int dndebug = 1; /* we actually run debug = 1 */ int nactive; /* number running */ int max; /* max allowable */ int jobnum; char dialbuf[DSIZE]; char *dp = dialbuf; FILE *actfile; struct mx_leaves { char *name; char rack,modem; short chan; int file; } pdevs[] = {{"/dev/cua0",'4','8'}, /*{"/dev/cua1",'4','1'},*/ {0}}; /* the second line here is commented out because, our 1200 baud dialer is being repaired, and if one attempts to dial with a modem that is not capable, the dialer gets hung and must be pulled out of the machine */ struct actinfo { short index; short uid; } runq[QSIZE], xx; #define INDEX(x) ((x&0xff00)>>4) main(argc, argv) char **argv; { register cc; char buf[512]; setbuf(stdout, NULL); umask(0); /*if (argc<2) quit("max jobs?"); max = atoi(argv[1]);*/ max = 1; if(fork()) exit(0); while(fork()) { sleep(10); wait(0); } strcpy(argv[0], "dnd-child"); xd = init(); if (xd < 0) quit("can't make node"); while( (cc=read(xd, buf, 512)) >= 0) { unpack(buf, cc); } _exit(0); } short noioctl = M_IOANS; control(x, cb, cc) register char *cb; { register char *end; register struct chan *cp; int cmd, stat, ch; int uid; end = cb + cc; while (cb < end ) { cmd = *cb++; cb++; switch(cmd&0xff) { case M_WATCH: uid = *((short *)cb); cb += sizeof(short); putq(x,uid); startjob(); break; case M_CLOSE: stopjob(x); break; case M_IOCTL: wctl(x,(char *)&noioctl,sizeof(noioctl)); cb += sizeof(struct sgttyb); } } } startjob() { register x, stat; if (nactive >= max) return; x = getq(); if (x == 0) return; stat = attach(x, xd); if (stat == -1) return; nactive++; printf("starting to dial on behalf of uid %d\n",xx.uid); dp = dialbuf; } stopjob(x) { detach(x, xd); if (delq(x)) { printf("channel %d aborted\n", INDEX(x)); } else { nactive--; printf("channel %d finished\n", INDEX(x)); } startjob(); } /* * make mpx node, open accounting file, and initialize queue. */ init() { register struct mx_leaves *lp; register int t; int xd; if(dndebug==0) freopen(stdout,"/dev/null","w"); if((actfile = fopen("/usr/adm/dnacct","a"))==NULL) quit("Can't make accouting file"); for(t=QSIZE; --t>=0;) runq[t].uid = -1; xd = mpx("", 0666); if(xd < 0) quit("Can't open master mpx node"); for(lp = pdevs; lp->name; lp++) { t = mpx(lp->name, 0666); if (t < 0) { unlink(lp->name); t = mpx(lp->name, 0666); } if(t < 0) quit("Can't make minor mpx node"); lp->file = t; if((t = join(t,xd)) == -1) quit("Can't attach to tree"); else printf("pseudo-device %s assigned channel %x\n",lp->name,t); lp->chan = t; } return(xd); } /* * unpac((k an mpx buffer at * bp of length cc. */ unpack(bp, cc) register char *bp; { register char *end; register struct rh *rp; end = bp + cc; while (bp < end) { rp = (struct rh *)bp; bp += sizeof (struct rh); if (rp->count==0) { control(rp->index, bp, rp->ccount); } else perform(rp,bp); rp->count += rp->ccount; if (rp->count & 1) rp->count++; bp += rp->count; } } /* transfer numbers to the unique dialer */ perform(rp,data) register struct rh *rp; register char *data; { register char *lim; long clock; char c; char *mdata, *tmpt, *ctime(); struct passwd *getpwuid(); if(rp->index!=xx.index) printf("phase error: Writing data from chan %x on behalf of chan %x\n",rp->index,xx.index); lim = rp->count + data; mdata = data; while(mdata< lim && dp < dialbuf+DSIZE) { *dp++ = *mdata; if(*mdata=='<') { *dp++ = 0; time(&clock); tmpt = ctime(&clock); tmpt[20] = 0; if((c = dialit(dialbuf))=='A') fprintf(actfile, "%s dialed %s at %s\n", getpwuid(xx.uid)->pw_name,dialbuf,tmpt); else printf("Dialer returns %c\n",c); fflush(actfile); dp = dialbuf; stopjob(rp->index); return; } mdata++; } } quit(msg) char *msg; { printf("%s\n", msg); exit(1); } putq(x,uid) { register i; for(i=0; ichan,xx.index)) if(lp->name==0) { printf("Unable to locate dialer, chan = %x\n",xx.index); return('K'); } else lp++; pc(STX); pc(lp->rack); pc(lp->modem); for(;*string && *string!='<'; string++) pc(*string); /*for(;*string; string++) pc(*string);*/ pc(SI); pc(ETX); /*if(*string=='<') { c = 'M'; read(fd,&c,1); if(c=='A'); }*/ if(read(fd,&c,1)!=1) c = 'M'; if(c=='B'||c=='G') { pc(ABORT); read(fd,&cc,1); } out: close(fd); return(c); } char * sanitize(string) register char *string; { static char buf[512]; register char *cp = buf; for(;*string; string++) { switch(*string) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '<': *cp++ = *string; break; case '_': *cp++ = '='; break; } } *cp++ = 0; return(buf); } /* Band-aid for hardware glitch - access forbidded to dialer while line in use */ char *DZ = "/dev/cul0"; #include #include jmp_buf handy; linebusy() { void catchit(); int fd; signal(SIGALRM,catchit); alarm(2); if(setjmp(handy)==0) { fd = open(DZ,2); /* if we are there the open did not hang, so we problem got the line was busy */ if(fd > 0) { alarm(0); printf("open succeeded did not hang\n"); close(fd); } printf("Line in use\n"); return(1); /* line busy */ } else /* came in on interrupt */ return(0); /* line is free, we did hang waiting for Carrier */ } void catchit(){ longjmp(handy,1); } nal.h> jmp_buf handy; linebusy() { void catchit(); int fd; signal(SIGALRM,catchit); alarm(2); if(setjmp(handy)==0) { fd = open(DZ,2); /* if we are there the open did not hang, so we problem got the line was busy */ if(fd > 0) { alarm(0); printf("open succeeded did not hang\n"); cmd/whoami.c 444 0 33 443 2416240332 6201 static char *sccsid = "@(#)whoami.c 4.1 (Berkeley) 10/1/80"; #include /* * whoami */ struct passwd *getpwuid(); main() { register struct passwd *pp; pp = getpwuid(getuid()); if (pp == 0) { printf("Intruder alert.\n"); exit(1); } printf("%s\n", pp->pw_name); exit(0); } chit); alarm(2); if(setjmp(handy)==0) { fd = open(DZ,2); /* if we are there the open did not hang, so we problem got the /( ,( 5،< /\@,\D"cmd/efl/ 775 0 33 0 2552532277 5272 cmd/efl/efltest/ 775 0 33 0 2527315631 6733 cmd/efl/efltest/Band.e 644 0 33 12330 2405462515 10046 procedure bnds(n,ml,m,g,nb,b) # to solve a*x = b, where a is a banded matrix, using gaussian # elimination with partial pivoting. # mnemonic - double precision band solution of a system of # linear algebraic equations. # input - # n - the order of the system. # ml - the number of nonzero elements of a on and below the diagonal. # m - the total number of nonzero elements in each row of a. # g - the matrix a, with g(i,j) = a(i,i+j-ml). # nb - the number of right-hand-sides b. # b - the right-hand-sides. # output - # g - has been clobbered. # b - the solution vectors, x. # scratch space allocated - n*( (ml-1)*mu + 1 ) words. # error states - # 1 - n.lt.1. # 2 - ml.lt.1. # 3 - ml.gt.m. # 4 - nb.lt.1. # 5 - singular matrix. (recoverable) real g(n,m),b(n,nb) integer n,ml,m,nb include rstack integer il,iint,istkgt,nerror,nerr # check the input for errors. if ( n < 1 ) { seterr(" bnds - n.lt.1",14,1,2) } if ( ml < 1 ) { seterr(" bnds - ml.lt.1",16,2,2) } if ( ml > m ) { seterr(" bnds - ml.gt.m",15,3,2) } if ( nb < 1 ) { seterr(" bnds - nb.lt.1",15,4,2) } enter(1) il = istkgt(max0(n*(ml-1),1),3) ; iint = istkgt(n,2) bndlu(n,ml,m,g,ws(il),is(iint)) if ( nerror(nerr) == 0 ) { bndfb(n,ml,m,ws(il),g,is(iint),nb,b) } else { erroff() ; seterr(" bnds - singular matrix",23,5,1) } leave() return end procedure bndlu(n,ml,m,g,l,int) # to obtain the lu decomposition of a banded matrix, # using gaussian elimination with partial pivoting. # mnemonic - double precision band lu decomposition. # input - # n - the order of the matrix. # ml - the number of nonzero elements of a on and below the diagonal. # m - the number of nonzero elements in each row of a. # g - the matrix a, with g(i,j) = a(i,i+j-ml). # output - # l - the lower triangular banded factor of a. # g - the upper triangular banded factor of a. # int - the row pivoting used. # scratch storage allocated - none. # error states - # 1 - n.lt.1. # 2 - ml.lt.1. # 3 - m.lt.ml. # 4 - singular matrix. (recoverable) real g(n,m),l(n,ml) # l(n,ml-1). integer n,ml,m,int(n) real x,norm,eps,r1mach integer i,j,k,ll,m1,m2 logical sing # check the input for errors. if ( n < 1 ) { seterr(" bndlu - n.lt.1",15,1,2) } if ( ml < 1 ) { seterr(" bndlu - ml.lt.1",16,2,2) } if ( m < ml ) { seterr(" bndlu - m.lt.ml",16,3,2) } entsrc(i,0) # protect against an existing error state. sing = .false. ; eps = r1mach(4) m1 = ml-1 ; m2 = m-ml ll = m1 for ( i = 1 , i <= min0(m1,n) , i += 1 ) # set to 0 those elements { # of g which are undefined. do j = ml+1-i , m { g(i,j-ll) = g(i,j) } ll = ll-1 do j = m-ll , m { g(i,j) = 0.0e0 } } for ( i = 1 , i <= min0(m2,n) , i += 1 ) # zero out lower rhs wart. { do j = ml+i , m { g(n+1-i,j) = 0.0e0 } } norm = 0.0e0 # get || a || sub infinity. do i = ((1 , n { int(i) = i x = 0.0e0 ; do j = 1 , m { x += abs(g(i,j)) } norm = amax1(norm,x) } do k = 1 , n { x = g(k,1) ; i = k ll = min0(m1+k,n) if ( k < ll ) { do j = k+1 , ll # get the pivot row. { if ( abs(g(j,1)) > abs(x) ) { x = g(j,1) ; i = j } } } int(k) = i if ( x == 0.0e0 ) { sing = .true. ; g(k,1) = norm*eps } if ( ml == 1 | k == n ) { next } if ( i ~= k ) # need to interchange the rows. { do j = 1 , m { x = g(k,j) ; g(k,j) = g(i,j) ; g(i,j) = x } } if ( k >= ll ) { next } do i = k+1 , ll { x = g(i,1)/g(k,1) l(k,i-k) = x do j = 2 , m { g(i,j-1) = g(i,j)-x*g(k,j) } g(i,m) = 0.0e0 } } if ( sing ) { seterr(" bndlu - singular matrix",24,4,1) } return end procedure bndfb(n,ml,m,l,u,int,nb,b) # to solve l*u*x = b, where l and u result from a call to bnds. # mnemonic - double precision band forward elimination and # back-solve. # input - # n - the order of the system. # ml - the number of nonzero entries of l on and below # the diagonal. # m - the number of nonzero elements of u on and above # the diagonal. # l - the lower triangular banded factor. # u - the upper triangular banded factor. # int - the ordering of the rows of the system, due to pivoting. # nb - the number of right-hand-sides. # b - the right-hand-sides. # output - # b - the solution vectors. # scratch space allocated - none. # error states - # 1 - n.lt.1. # 2 - ml.lt.1. # 3 - m.lt.ml. # 4 - nb.lt.1. real l(n,ml),u(n,m),b(n,nb) # l(n,ml-1). integer n,ml,m,int(n),nb integer nerror,nerr # check the input for errors. if ( n < 1 ) { seterr(" bndfb - n.lt.1",15,1,2) } if ( ml < 1 ) { seterr(" bndfb - ml.lt.1",16,2,2) } if ( m < ml ) { seterr(" bndfb - m.lt.ml",16,3,2) } if ( nb < 1 ) { seterr(" bndfb - nb.lt.1",16,4,2) } entsrc(nerr,0) # protect against an existing error state. bndfe(n,ml,l,int,nb,b) # do the forward-elimination. bndbs(n,m,u,nb,b) # do the back-substitution. return end l-1). integer n,ml,m,int(n),nb integer nerror,nerr # check the input for errors. if ( n < 1 ) { seterr(" bndfb - n.lt.1",15,1,2) } if ( ml < 1 ) { seterr(" bndfb - ml.lt.1",16,2,2) } if ( m < ml ) { seterr(" bndfb - m.lt.ml",16,3,2) } if ( nb < 1 ) { seterr(" bndfb - nb.lt.1",1cmd/efl/efltest/Band.out 644 0 33 14637 2405462520 10441 subroutine bnds(n, ml, m, g, nb, b) integer m, n, nb integer ml real g(n, m), b(n, nb) common /cstak/ ds double precision ds(500) integer istkgt, nerror, max0, iint, nerr, il integer is(1000) real rs(1000), ws(500) logical ls(1000) complex cs(500) equivalence (ds(1), cs(1), ws(1), rs(1), is(1), ls(1)) c to solve a*x = b, where a is a banded matrix, using gaussian c elimination with partial pivoting. c mnemonic - double precision band solution of a system of c linear algebraic equations. c input - c n - the order of the system. c ml - the number of nonzero elements of a on and below the diagonal. c m - the total number of nonzero elements in each row of a. c g - the matrix a, with g(i,j) = a(i,i+j-ml). c nb - the number of right-hand-sides b. c b - the right-hand-sides. c output - c g - has been clobbered. c b - the solution vectors, x. c scratch space allocated - n*( (ml-1)*mu + 1 ) words. c error states - c 1 - n.lt.1. c 2 - ml.lt.1. c 3 - ml.gt.m. c 4 - nb.lt.1. c 5 - singular matrix. (recoverable) c check the input for errors. if (n .lt. 1) call seterr(14h bnds - n.lt.1, 14, 1, 2) if (ml .lt. 1) call seterr(15h bnds - ml.lt.1, 16, 2, 2) if (ml .gt. m) call seterr(15h bnds - ml.gt.m, 15, 3, 2) if (nb .lt. 1) call seterr(15h bnds - nb.lt.1, 15, 4, 2) call enter(1) il = istkgt(max0(n*(ml-1), 1), 3) iint = istkgt(n, 2) call bndlu(n, ml, m, g, ws(il), is(iint)) if (nerror(nerr) .ne. 0) goto 1 call bndfb(n, ml, m, ws(il), g, is(iint), nb, b) goto 2 1 call erroff call seterr(23h bnds - singular matrix, 23, 5, 1) 2 call leave return end subroutine bndlu(n, ml, m, g, l, int) integer m, n, ml integer int(n) real g(n, m), l(n, ml) integer min0, i, j, k, m1, m2 integer ll real abs, eps, x, norm, amax1, r1mach logical sing integer temp, temp1 c to obtain the lu decomposition of a banded matrix, c using gaussian elimination with partial pivoting. c mnemonic - double precision band lu decomposition. c input - c n - the order of the matrix. c ml - the number of nonzero elements of a on and below the diagonal. c m - the number of nonzero elements in each row of a. c g - the matrix a, with g(i,j) = a(i,i+j-ml). c output - c l - the lower triangular banded factor of a. c g - the upper triangular banded factor of a. c int - the row pivoting used. c scratch storage allocated - none. c error states - c 1 - n.lt.1. c 2 - ml.lt.1. c 3 - m.lt.ml. c 4 - singular matrix. (recoverable) c l(n,ml-1). c check the input for errors. if (n .lt. 1) call seterr(15h bndlu - n.lt.1, 15, 1, 2) if (ml .lt. 1) call seterr(16h bndlu - ml.lt.1, 16, 2, 2) if (m .lt. ml) call seterr(16h bndlu - m.lt.ml, 16, 3, 2) c protect against an existing error state. call entsrc(i, 0) sing = .false. eps = r1mach(4) m1 = ml-1 m2 = m-ml ll = m1 i = 1 goto 2 1 i = i+1 2 if (i .gt. min0(m1, n)) goto 5 c set to 0 those elements c of g which are undefined. temp = ml+1-i do 3 j = temp, m temp1 = j-ll g(i, temp1) = g(i, j) 3 continue ll = ll-1 temp = m-ll do 4 j = temp, m g(i, j) = 0.0e0 4 continue goto 1 5 i = 1 goto 7 6 i = i+1 7 if (i .gt. min0(m2, n)) goto 9 c zero out lower rhs wart. temp = ml+i do 8 j = temp, m temp1 = n+1-i g(temp1, j) = 0.0e0 8 continue goto 6 c get || a || sub infinity. 9 norm = 0.0e0 do 11 i = 1, n int(i) = i x = 0.0e0 do 10 j = 1, m x = x+abs(g(i, j)) 10 continue norm = amax1(norm, x) 11 continue do 20 k = 1, n x = g(k, 1) i = k ll = min0(m1+k, n) if (k .ge. ll) goto 14 temp = k+1 do 13 j = temp, ll c get the pivot row. if (abs(g(j, 1)) .le. abs(x)) goto 12 x = g(j, 1) i = j 12 continue 13 continue 14 int(k) = i if (x .ne. 0.0e0) goto 15 sing = .true. g(k, 1) = norm*eps 15 if (ml .eq. 1 .or. k .eq. n) goto 20 if (i .eq. k) goto 17 do 16 j = 1, m c need to interchange the rows. x = g(k, j) g(k, j) = g(i, j) g(i, j) = x 16 continue 17 if (k .ge. ll) goto 20 temp = k+1 do 19 i = temp, ll x = g(i, 1)/g(k, 1) temp1 = i-k l(k, temp1) = x do 18 j = 2, m g(i, j-1) = g(i, j)-x*g(k, j) 18 continue g(i, m) = 0.0e0 19 continue 20 continue if (sing) call seterr(24h bndlu - singular matrix, 24, 4, 1) return end subroutine bndfb(n, ml, m, l, u, int, nb, b) integer m, n, nb, ml integer int(n) real l(n, ml), u(n, m), b(n, nb) integer nerror, nerr c to solve l*u*x = b, where l and u result from a call to bnds. c mnemonic - double precision band forward elimination and c back-solve. c input - c n - the order of the system. c ml - the number of nonzero entries of l on and below c the diagonal. c m - the number of nonzero elements of u on and above c the diagonal. c l - the lower triangular banded factor. c u - the upper triangular banded factor. c int - the ordering of the rows of the system, due to pivoting. c nb - the number of right-hand-sides. c b - the right-hand-sides. c output - c b - the solution vectors. c scratch space allocated - none. c error states - c 1 - n.lt.1. c 2 - ml.lt.1. c 3 - m.lt.ml. c 4 - nb.lt.1. c l(n,ml-1). c check the input for errors. if (n .lt. 1) call seterr(15h bndfb - n.lt.1, 15, 1, 2) if (ml .lt. 1) call seterr(16h bndfb - ml.lt.1, 16, 2, 2) if (m .lt. ml) call seterr(16h bndfb - m.lt.ml, 16, 3, 2) if (nb .lt. 1) call seterr(16h bndfb - nb.lt.1, 16, 4, 2) c protect against an existing error state. call entsrc(nerr, 0) call bndfe(n, ml, l, int, nb, b) c do the forward-elimination. call bndbs(n, m, u, nb, b) c do the back-substitution. return end -1). c check the input for errors. if (n .lt. 1) call seterr(15h bndfb - n.lt.1, 15, 1, 2) cmd/efl/efltest/Buram.e 644 0 33 32745 2405462524 10264 ((subroutine Buram(npts,mesh,fn,m,n,p,q,delk) integer npts,m,n; real mesh(npts),fn(npts),p(1),q(1),delk; # Buram is a double precision subroutine which finds a # a rational function which is the best approximation, # in the uniform or minimax sense, to a given discrete # function. The rational function is represented as # the quotient of two polynomials each expanded in terms # of Tchebychev polynomials. This routine is a shell # which in turn calls the routine Burm1 with certain # default values for the initial approximation and for # the stopping criteria. # Input: # npts - the number of mesh points. # mesh - the array of mesh points. # fn - the array of function values. # m - the degree of the desired numerator polynomial. # n - the degree of the desired denominator polynomial. # Output: # p - the array of coefficients for the numerator polynomial. # q - the array of coefficients for the denominator polynomial. # delk - the maximum error in the approximation. # Error States (asterisk indicates recoverable): # 1 - invalid degree # 2 - too few mesh points # 3 - mesh is not strictly monotone # 4* - approximation equals function # 5* - no improvement in approximation # 6* - reached 50 iterations integer nitr,maxitr,itol,Nerror,ier; real fnmax,fnmin; logical Smonor; common /dfccom/ nitr; call Enter(1); if (m<0 | n<0) call Seterr(" Buram - invalid degree",23,1,2); if (npts < m+n+2) call Seterr(" Buram - too few mesh points",28,2,2); if (!(Smonor(mesh,npts,1))) call Seterr(" Buram - mesh is not strictly monotone",38,3,2); # Initialize the numerator and demoninator polynomials. fnmax = fn(1); fnmin = fn(1); do i=2,npts { if (fnmax < fn(i)) fnmax = fn(i); else if (fn(i) < fnmin) fnmin = fn(i); } call Setr(m+1,0.0e0,p); p(1) = 0.5e0*(fnmax + fnmin); call Setr(n+1,0.0e0,q); q(1) = 1.0e0 delk = fnmax - p(1); nitr = 0; if (! (m==0 & n==0)) { maxitr = 50; itol = 2; call Burm1(npts,mesh,fn,maxitr,itol,m,n,p,q,delk); if (nerror(ier)!=0) { if (ier == 7) call Newerr(" Buram - approximation equals function",39,4,1); else if (ier == 8) call Newerr(" Buram - no improvement in approximation",40,5,1); else if (ier == 9) call Newerr(" Buram - reached 50 iterations",30,6,1); else call Eprint; } } call Leave; return end subroutine Burm1(npts,mesh,fn,maxitr,itol,m,n,p,q,delk) integer npts,maxitr,itol,m,n; real mesh(npts),fn(npts),p(1),q(1),delk; # Burm1 is a double precision subroutine which finds a # a rational function which is the best approximation, # in the uniform or minimax sense, to a given discrete # function. The rational function is represented as # the quotient of two polynomials each expanded in terms # of Tchebychev polynomials. This routine starts from an # initial approximation and terminates for one of four # reasons: (1) the error curve equioscillates and the # alternating extrema match to ITOL digits, (2) the number # of iterations exceeds MAXITR, (3) the approximation # cannot be improved, or (4) the approximation is essentially # equal to the given discrete function. # Input: # npts - the number of mesh points. # mesh - the array of mesh points. # fn - the array of function values. # maxitr - the maximum number of iterations. # itol - the number of digits to which the extrema should match. # m - the degree of the desired numerator polynomial. # n - the degree of the desired denominator polynomial. # p - the array of coefficients for the initial numerator. # q - the array of coefficients for the initial denominator. # Output: # p - the array of coefficients for the numerator polynomial. # q - the array of coefficients for the denominator polynomial. # delk - the maximum error in the approximation. # Error States (asterisk indicates recoverable): # 1 - invalid degree # 2 - too few mesh points # 3 - mesh is not strictly monotone # 4 - maxitr .lt. 0 # 5 - invalid accuracy request # 6 - denominator is nonpositive # 7* - approximation equals function # 8* - no improvement in approximation # 9* - reached maximum no. of iterations integer idig,Iflr,I1mach,Istkgt,npptr,nqptr,enptr,qkptr,iexptr; real R1mach,Float,qlrg; logical Smonor; common /cstak/ dstak(500) long real dstak integer istak(1000) real ws(1000) equivalence dstak,istak equivalence dstak,ws call Enter(1); if (m<0 | n<0) call Seterr(" Burm1 - invalid degree",23,1,2); if (npts < m+n+2) call Seterr(" Burm1 - too few mesh points",28,2,2); if (!(Smonor(mesh,npts,1))) call Seterr(" Burm1 - mesh is not strictly monotone",38,3,2); if (maxitr < 0) call Seterr(" Burm1 - maxitr .lt. 0",22,4,2); idig = Iflr(R1mach(5)*Float(I1mach(11))); if (itol < 1 | idig < itol) call Seterr(" Burm1 - invalid accuracy request",36,5,2); qlrg = Abs(q(1)); for (j=2, j<=n+1, j=j+1) if (qlrg < abs(q(j))) qlrg = abs(q(j)); if (qlrg == 0.e0) call Seterr(" Burm1 - denominator is nonpositive",35,6,2) else { for (j=1, j<=n+1, j=j+1) q(j) = q(j)/qlrg; for (j=1, j<=m+1, j=j+1) p(j) = p(j)/qlrg; } npptr = Istkgt(m+1,3); nqptr = Istkgt(n+1,3); enptr = Istkgt(npts,3); qkptr = Istkgt(npts,3); iexptr = Istkgt(npts,2); call B1rm1(npts,mesh,fn,maxitr,itol,m,n,p,q,delk,ws(npptr),ws(nqptr), ws(enptr),ws(qkptr),istak(iexptr)); call Leave; return; end subroutine B1rm1(npts,x,fn,maxitr,itol,m,n,p,q,delk,newp,newq,en,qk,iext) integer npts,maxitr,itol,m,n,iext(npts); real x(npts),fn(npts),p(1),q(1),delk,newp(1),newq(1), en(npts),qk(npts); integer nitr,nex,imax,imin,ilrg,Lrgex ,Nerror,ier; real eps,bnd,R1mach,delnew; common /dfccom/ nitr; eps = R1mach(4)*10.0e0**itol; call Extrmr(npts,fn,nex,iext,imax,imin,ilrg); bnd = Abs(fn(ilrg))*eps; call Enqk(npts,x,fn,m,n,p,q,qk,en); do i=1,npts if (qk(i) <= 0.0e0) call Seterr(" Burm1 - denominator is nonpositive",35,6,2); call Extrmr(npts,en,nex,iext,imax,imin,ilrg); delk = Abs(en(ilrg)); delnew = delk; call Movefr(m+1,p,newp); call Movefr(n+1,q,newq); for (nitr=0, nitr= m+n+2) return; call Lpstp(npts,x,fn,qk,delnew,m,n,newp,newq) if (Nerror(ier) != 0) call Erroff; call Enqk(npts,x,fn,m,n,newp,newq,qk,en); call Extrmr(npts,en,nex,iext,imax,imin,ilrg); delnew = Abs(en(ilrg)); if (delk <= delnew) { call Seterr(" Burm1 - no improvement in approximation",40,8,1); return; } call Movefr(m+1,newp,p); call Movefr(n+1,newq,q); delk = delnew; } call Seterr(" Burm1 - reached maximum no. of iterations",42,9,1); return; end subroutine Enqk( npts,X,fn,m,n,p,q,Qk,en) integer npts,m,n; real X(npts),fn(npts),p(1),q(1),Qk(npts),en(npts); # # Subroutine Enqk computes en & Qk. # en=error values at mesh points. # Qk=value of denominator polynomial at mesh points. # real Tchbp,Pk; if (npts<=0 | m<0 | n<0) call seterr ("enQk-invalid dimension",22,1,2) do i=1,npts { Qk(i)=Tchbp(n,q,X(i),X(1),X(npts)) if (Qk(i)==0.e0) call seterr ("enQk-divisor .eq. 0.",20,2,2) Pk=Tchbp(m,p,X(i),X(1),X(npts)) en(i)=(fn(i)*Qk(i)-Pk)/Qk(i) } return end integer function Lrgex (npts,en,nex,iext,ilrg,tol) # # Function Lrgex finds the no. of error extrema with magnitudes # within tolerance of magnitude of largest error. # integer npts,nex,iext(nex),ilrg,j,k,L,tol real en(npts),hold if (npts<=0) call Seterr ("Lrgex -invalid dimension",24,1,2) if (nex<=0 | ilrg<=0) call Seterr ("Lrgex -invalid index",20,2,2) k=0 do j=1,nex { L=iext(j) hold=Abs(en(ilrg))-Abs(en(L)) if (hold<=10.**(-tol)*Abs(en(ilrg))) k=k+1 } Lrgex =k return end subroutine Lpstp(npts,mesh,fn,Qk,delk,m,n,p,q) integer npts,m,n; real mesh(npts),fn(npts),Qk(npts),delk,p(1),q(1); # Lpstp defines the linear programming subproblem of the # Differential Correction algorithm. It also provides # the interface to the general purpose linear programming # package. # Input: # npts - the number of mesh points. # mesh - the array of mesh points. # fn - the array of function values. # Qk - the array of current denominator values. # delk - the current minimax error. # m - the degree of the numerator polynomial. # n - the degree of the denominator polynomial. # p - the current numerator polynomial. # q - the current denominator polynomial. # Output: # p - the array of coefficients for the numerator polynomial. # q - the array of coefficients for the denominator polynomial. # Error States (asterisk indicates fatal): # 1* - invalid degree # 2* - too few mesh points # 3* - nonpositive delk # 4 - no improvement in the lp subproblem integer aptr,bptr,cptr,xptr; common /cstak/ dstak(500) long real dstak integer istak(1000) real ws(1000) equivalence dstak,istak equivalence dstak,ws call Enter(1); if (m<0 | n<0) call Seterr(" Lpstp - invalid degree",23,1,2); if (npts < m+n+2) call Seterr(" Lpstp - too few mesh points",28,2,2); aptr = Istkgt((3*npts+1),3); bptr = Istkgt((2*(npts+n+1)),3); cptr = Istkgt((m+n+3),3); xptr = Istkgt((m+n+3),3); call L9stp(npts,mesh,fn,Qk,delk,m,n,p,q,ws(aptr),ws(bptr), ws(cptr),ws(xptr)); call Leave; return; end subroutine L9stp(npts,mesh,fn,Qk,delk,m,n,p,q,A,B,C,X) integer npts,m,n; real mesh(npts),fn(npts),Qk(npts),delk,p(1),q(1), (( A(1),B(1),C(1),X(1); integer nptsc,mc,nc,i1,i2,i3,i4,mm,nn,Nerror,ierr; real ctx,ctxnew,qlrg,Float,R1mach; external Difmt; common /difcom/ nptsc,mc,nc,i1,i2,i3,i4; nptsc = npts; mc = m; nc = n; i1 = npts; i2 = i1 + npts; i3 = i2 + n + 1; i4 = i3 + n + 1; mm = i4; nn = m+n+3; call Movefr(n+1,q,X); call Movefr(m+1,p,X(n+2)); X(nn) = 0.e0; call Setr(i2,0.0e0,B); call Setr((i4-i2),-1.0e0,B(i2+1)); call Setr(nn,0.0e0,C); C(nn) = -1.0e0; call Movefr(npts,mesh,A); call Movefr(npts,fn,A(npts+1)); call Movefr(npts,Qk,A(2*npts+1)); if (delk <= 0.0e0) call Seterr(" Lpstp - nonpositive delk",25,3,2) A(3*npts+1) = delk; ctx = 0.0e0; # Solve the LP problem: max C(T)X subject to AX >= B. # The subroutine Difmt derives the matrix A from # the data stored in the array A. call Lpph2(A,mm,nn, Difmt,B,C,X,4*mm,ctxnew) if (Nerror(ier) != 0) call Erroff; if (ctx < ctxnew) { qlrg = 0.0e0; for (j=1, j<=n+1, j=j+1) if (qlrg < abs(X(j))) qlrg = abs(X(j)); for (j=1, j<=n+1, j=j+1) q(j) = X(j)/qlrg; i = 0; for (j=n+2, j<=m+n+2, j=j+1) { i = i+1; p(i) = X(j)/qlrg; } } else call Seterr(" Lpstp - no improvement in the lp subproblem",44,4,1); return; end subroutine Difmt(inprod,A,mm,nn,irow,X,dinprd) integer mm,nn,irow; real A(1),X(nn),dinprd; logical inprod; # Difmt handles references by the LP routine to # the matrix for the linear programming subproblem. integer npts,m,n,i1,i2,i3,i4,irm1,irm2,irm3,zptr, fnptr,qzptr,jp,maxmn; real fct,fdelk,delk,z,fn,qz,Tchbp; common /difcom/ npts,m,n,i1,i2,i3,i4; call Enter(1); if (mm != i4 | nn ~= m+n+3) call Seterr(" Difmt - invalid dimension",26,1,2) if (irow<0 | mm0) if (b<=a) call seterr (" Tchcf-invalid interval",23,2,2) else #scale x to the interval (-1.e0,1.e0) XX(2)=2.e0*(x-(a+b)/2.e0)/(b-a) if (deg>1) twoxx=2.e0*XX(2) for (i=3,i<=deg+1,i=i+1) XX(i)=twoxx*XX(i-1)-XX(i-2) call leave return end broutine Tchcf computes thcmd/efl/efltest/Buram.out 644 0 33 41270 2405462533 10640 subroutine buram(npts, mesh, fn, m, n, p, q, delk) integer npts integer m, n real mesh(npts), fn(npts), p(1), q(1), delk common /dfccom/ nitr integer nitr integer ier, maxitr, nerror, i, itol real fnmin, fnmax logical smonor c Buram is a double precision subroutine which finds a c a rational function which is the best approximation, c in the uniform or minimax sense, to a given discrete c function. The rational function is represented as c the quotient of two polynomials each expanded in terms c of Tchebychev polynomials. This routine is a shell c which in turn calls the routine Burm1 with certain c default values for the initial approximation and for c the stopping criteria. c Input: c npts - the number of mesh points. c mesh - the array of mesh points. c fn - the array of function values. c m - the degree of the desired numerator polynomial. c n - the degree of the desired denominator polynomial. c Output: c p - the array of coefficients for the numerator polynomial. c q - the array of coefficients for the denominator polynomial. c delk - the maximum error in the approximation. c Error States (asterisk indicates recoverable): c 1 - invalid degree c 2 - too few mesh points c 3 - mesh is not strictly monotone c 4* - approximation equals function c 5* - no improvement in approximation c 6* - reached 50 iterations call enter(1) if (m .lt. 0 .or. n .lt. 0) call seterr( 1 23h Buram - invalid degree, 23, 1, 2) if (npts .lt. m+n+2) call seterr(28h Buram - too few mesh points 1 , 28, 2, 2) if (.not. smonor(mesh, npts, 1)) call seterr( 1 38h Buram - mesh is not strictly monotone, 38, 3, 2) c Initialize the numerator and demoninator polynomials. fnmax = fn(1) fnmin = fn(1) do 3 i = 2, npts if (fnmax .ge. fn(i)) goto 1 fnmax = fn(i) goto 2 1 if (fn(i) .lt. fnmin) fnmin = fn(i) 2 continue 3 continue call setr(m+1, 0.0e0, p) p(1) = 0.5e0*(fnmax+fnmin) call setr(n+1, 0.0e0, q) q(1) = 1.0e0 delk = fnmax-p(1) nitr = 0 if (m .eq. 0 .and. n .eq. 0) goto 11 maxitr = 50 itol = 2 call burm1(npts, mesh, fn, maxitr, itol, m, n, p, q, delk) if (nerror(ier) .eq. 0) goto 10 if (ier .ne. 7) goto 4 call newerr(38h Buram - approximation equals function, 1 39, 4, 1) goto 9 4 if (ier .ne. 8) goto 5 call newerr( 1 40h Buram - no improvement in approximation, 40, 5, 2 1) goto 8 5 if (ier .ne. 9) goto 6 call newerr(30h Buram - reached 50 iterations, 30 1 , 6, 1) goto 7 6 call eprint 7 continue 8 continue 9 continue 10 continue 11 call leave return end subroutine burm1(npts, mesh, fn, maxitr, itol, m, n, p, q, 1 delk) integer npts integer maxitr, itol, m, n real mesh(npts), fn(npts), p(1), q(1), delk common /cstak/ dstak double precision dstak(500) integer istkgt, iexptr, j, idig, iflr, istak(1000) integer enptr, qkptr, i1mach, npptr, nqptr real abs, qlrg, float, ws(1000), r1mach logical smonor equivalence (dstak, istak) equivalence (dstak, ws) c Burm1 is a double precision subroutine which finds a c a rational function which is the best approximation, c in the uniform or minimax sense, to a given discrete c function. The rational function is represented as c the quotient of two polynomials each expanded in terms c of Tchebychev polynomials. This routine starts from an c initial approximation and terminates for one of four c reasons: (1) the error curve equioscillates and the c alternating extrema match to ITOL digits, (2) the number c of iterations exceeds MAXITR, (3) the approximation c cannot be improved, or (4) the approximation is essentially c equal to the given discrete function. c Input: c npts - the number of mesh points. c mesh - the array of mesh points. c fn - the array of function values. c maxitr - the maximum number of iterations. c itol - the number of digits to which the extrema should match. c m - the degree of the desired numerator polynomial. c n - the degree of the desired denominator polynomial. c p - the array of coefficients for the initial numerator. c q - the array of coefficients for the initial denominator. c Output: c p - the array of coefficients for the numerator polynomial. c q - the array of coefficients for the denominator polynomial. c delk - the maximum error in the approximation. c Error States (asterisk indicates recoverable): c 1 - invalid degree c 2 - too few mesh points c 3 - mesh is not strictly monotone c 4 - maxitr .lt. 0 c 5 - invalid accuracy request c 6 - denominator is nonpositive c 7* - approximation equals function c 8* - no improvement in approximation c 9* - reached maximum no. of iterations call enter(1) if (m .lt. 0 .or. n .lt. 0) call seterr( 1 23h Burm1 - invalid degree, 23, 1, 2) if (npts .lt. m+n+2) call seterr(28h Burm1 - too few mesh points 1 , 28, 2, 2) if (.not. smonor(mesh, npts, 1)) call seterr( 1 38h Burm1 - mesh is not strictly monotone, 38, 3, 2) if (maxitr .lt. 0) call seterr(22h Burm1 - maxitr .lt. 0, 22, 4, 2 1 ) idig = iflr(r1mach(5)*float(i1mach(11))) if (itol .lt. 1 .or. idig .lt. itol) call seterr( 1 33h Burm1 - invalid accuracy request, 36, 5, 2) qlrg = abs(q(1)) j = 2 goto 2 1 j = j+1 2 if (j .gt. n+1) goto 3 if (qlrg .lt. abs(q(j))) qlrg = abs(q(j)) goto 1 3 if (qlrg .ne. 0.e0) goto 4 call seterr(35h Burm1 - ((denominator is nonpositive, 35, 6, 2) goto 11 4 j = 1 goto 6 5 j = j+1 6 if (j .gt. n+1) goto 7 q(j) = q(j)/qlrg goto 5 7 j = 1 goto 9 8 j = j+1 9 if (j .gt. m+1) goto 10 p(j) = p(j)/qlrg goto 8 10 continue 11 npptr = istkgt(m+1, 3) nqptr = istkgt(n+1, 3) enptr = istkgt(npts, 3) qkptr = istkgt(npts, 3) iexptr = istkgt(npts, 2) call b1rm1(npts, mesh, fn, maxitr, itol, m, n, p, q, delk, ws( 1 npptr), ws(nqptr), ws(enptr), ws(qkptr), istak(iexptr)) call leave return end subroutine b1rm1(npts, x, fn, maxitr, itol, m, n, p, q, 1 delk, newp, newq, en, qk, iext) integer npts integer maxitr, itol, m, n, iext(npts) real x(npts), fn(npts), p(1), q(1), delk, newp(1) real newq(1), en(npts), qk(npts) common /dfccom/ nitr integer nitr integer ier, nex, nerror, i, imin, imax integer ilrg, lrgex real bnd, abs, eps, delnew, r1mach eps = r1mach(4)*10.0e0**itol call extrmr(npts, fn, nex, iext, imax, imin, ilrg) bnd = abs(fn(ilrg))*eps call enqk(npts, x, fn, m, n, p, q, qk, en) do 1 i = 1, npts if (qk(i) .le. 0.0e0) call seterr( 1 35h Burm1 - denominator is nonpositive, 35, 6, 2) 1 continue call extrmr(npts, en, nex, iext, imax, imin, ilrg) delk = abs(en(ilrg)) delnew = delk call movefr(m+1, p, newp) call movefr(n+1, q, newq) nitr = 0 goto 3 2 nitr = nitr+1 3 if (nitr .ge. maxitr) goto 6 c call Outpt3 (x,npts,p,q,delk,m,n,en,iext,nex) if (delk .gt. bnd) goto 4 call seterr(38h Burm1 - approximation equals function, 39, 7 1 , 1) return c Test for optimal solution. 4 if (lrgex(npts, en, nex, iext, ilrg, itol) .ge. m+n+2) return call lpstp(npts, x, fn, qk, delnew, m, n, newp, newq) if (nerror(ier) .ne. 0) call erroff call enqk(npts, x, fn, m, n, newp, newq, qk, en) call extrmr(npts, en, nex, iext, imax, imin, ilrg) delnew = abs(en(ilrg)) if (delk .gt. delnew) goto 5 call seterr(40h Burm1 - no improvement in approximation, 40, 1 8, 1) return 5 call movefr(m+1, newp, p) call movefr(n+1, newq, q) delk = delnew goto 2 6 call seterr(42h Burm1 - reached maximum no. of iterations, 42, 9 1 , 1) return end subroutine enqk(npts, x, fn, m, n, p, q, qk, en) integer npts integer m, n real x(npts), fn(npts), p(1), q(1), qk(npts), en(npts) integer i real pk, tchbp c c Subroutine Enqk computes en & Qk. c en=error values at mesh points. c Qk=value of denominator polynomial at mesh points. c if (npts .le. 0 .or. m .lt. 0 .or. n .lt. 0) call seterr( 1 22henQk-invalid dimension, 22, 1, 2) do 1 i = 1, npts qk(i) = tchbp(n, q, x(i), x(1), x(npts)) if (qk(i) .eq. 0.e0) call seterr(20henQk-divisor .eq. 0., 20, 2 1 , 2) pk = tchbp(m, p, x(i), x(1), x(npts)) en(i) = (fn(i)*qk(i)-pk)/qk(i) 1 continue return end integer function lrgex(npts, en, nex, iext, ilrg, tol) integer nex, npts integer iext(nex), ilrg, tol real en(npts) integer j, k, l real abs, hold c c Function Lrgex finds the no. of error extrema with magnitudes c within tolerance of magnitude of largest error. c if (npts .le. 0) call seterr(24hLrgex -invalid dimension, 24, 1, 2 1 ) if (nex .le. 0 .or. ilrg .le. 0) call seterr( 1 20hLrgex -invalid index, 20, 2, 2) k = 0 do 1 j = 1, nex l = iext(j) hold = abs(en(ilrg))-abs(en(l)) if (hold .le. 10.**(-tol)*abs(en(ilrg))) k = k+1 1 continue lrgex = k return end subroutine lpstp(npts, mesh, fn, qk, delk, m, n, p, q) integer npts integer m, n real mesh(npts), fn(npts), qk(npts), delk, p(1), q(1) common /cstak/ dstak double precision dstak(500) integer istkgt, aptr, bptr, cptr, xptr, istak(1000) real ws(1000) equivalence (dstak, istak) equivalence (dstak, ws) c Lpstp defines the linear programming subproblem of the c Differential Correction algorithm. It also provides c the interface to the general purpose linear programming c package. c Input: c npts - the number of mesh points. c mesh - the array of mesh points. c fn - the array of function values. c Qk - the array of current denominator values. c delk - the current minimax error. c m - the degree of the numerator polynomial. c n - the degree of the denominator polynomial. c p - the current numerator polynomial. c q - the current denominator polynomial. c Output: c p - the array of coefficients for the numerator polynomial. c q - the array of coefficients for the denominator polynomial. c Error States (asterisk indicates fatal): c 1* - invalid degree c 2* - too few mesh points c 3* - nonpositive delk c 4 - no improvement in the lp subproblem call enter(1) if (m .lt. 0 .or. n .lt. 0) call seterr( 1 23h Lpstp - invalid degree, 23, 1, 2) if (npts .lt. m+n+2) call seterr(28h Lpstp - too few mesh points 1 , 28, 2, 2) aptr = istkgt(3*npts+1, 3) bptr = istkgt(2*(npts+n+1), 3) cptr = istkgt(m+n+3, 3) xptr = istkgt(m+n+3, 3) call l9stp(npts, mesh, fn, qk, delk, m, n, p, q, ws(aptr), ws( 1 bptr), ws(cptr), ws(xptr)) call leave return end subroutine l9stp(npts, mesh, fn, qk, delk, m, n, p, q, a, b, 1 c, x) integer npts integer m, n real mesh(npts), fn(npts), qk(npts), delk, p(1), q(1) real a(1), b(1), c(1), x(1) common /difcom/ nptsc, mc, nc, i1, i2, i3, i4 integer nptsc, mc, nc, i1, i2, i3 integer i4 external difmt integer ier, nerror, i, j, ierr, mm integer nn real abs, ctx, ctxnew, qlrg, float, r1mach nptsc = npts mc = m nc = n i1 = npts i2 = i1+npts i3 = i2+n+1 i4 = i3+n+1 mm = i4 nn = m+n+3 call movefr(n+1, q, x) call movefr(m+1, p, x(n+2)) x(nn) = 0.e0 call setr(i2, 0.0e0, b) call setr(i4-i2, -1.0e0, b(i2+1)) call setr(nn, 0.0e0, c) c(nn) = -1.0e0 call movefr(npts, mesh, a) call movefr(npts, fn, a(npts+1)) call movefr(npts, qk, a(2*npts+1)) if (delk .le. 0.0e0) call seterr(25h Lpstp - nonpositive delk, 25, 1 3, 2) a(3*npts+1) = delk ctx = 0.0e0 c Solve the LP problem: max C(T)X subject to AX >= B. c The subroutine Difmt derives the matrix A from c the data stored in the array A. call lpph2(a, mm, nn, difmt, b, c, x, 4*mm, ctxnew) if (nerror(ier) .ne. 0) call erroff if (ctx .ge. ctxnew) goto 10 qlrg = 0.0e0 j = 1 goto 2 1 j = j+1 2 if (j .gt. n+1) goto 3 if (qlrg .lt. abs(x(j))) qlrg = abs(x(j)) goto 1 3 j = 1 goto 5 4 j = j+1 5 if (j .gt. n+1) goto 6 q(j) = x(j)/qlrg goto 4 6 i = 0 j = n+2 goto 8 7 j = j+1 8 if (j .gt. m+n+2) goto 9 i = i+1 p(i) = x(j)/qlrg goto 7 9 continue goto 11 10 call seterr(44h Lpstp - no improvement in the lp subproblem, 1 44, 4, 1) 11 return end subroutine difmt(inprod, a, mm, nn, irow, x, dinprd) integer nn integer mm, irow real a(1), x(nn), dinprd logical inprod common /difcom/ npts, m, n, i1, i2, i3, i4 integer npts, m, n, i1, i2, i3 integer i4 integer max0, irm1, irm2, irm3, j, zptr integer jp, maxmn, fnptr, qzptr real fct, delk, z, fn, fdelk, tchbp real qz c Difmt handles references by the LP routine to c the matrix for the linear programming subproblem. call enter(1) if (mm .ne. i4 .or. nn .ne. m+n+3) call seterr( 1 26h Difmt - invalid dimension, 26, 1, 2) if (irow .lt. 0 .or. mm .lt. irow) call seterr( 1 22h Difmt - invalid index, 22, 2, 2) irm1 = irow-i1 irm2 = irow-i2 irm3 = irow-i3 if ((.not. inprod) .or. i2 .ge. irow) goto 3 if (i3 .ge. irow) goto 1 dinprd = -x(irm3) goto 2 1 dinprd = x(irm2) 2 continue goto 18 3 if (i2 .ge. irow) goto 6 call setr(nn, 0.0e0, x) if (i3 .ge. irow) goto 4 x(irm3) = -1.0e0 goto 5 4 x(irm2) = 1.0e0 5 continue goto 17 6 if (i1 .ge. irow) goto 7 fct = -1.0e0 zptr = irm1 goto 8 7 fct = 1.0e0 zptr = irow 8 z = a(zptr) fnptr = zptr+npts fn = a(fnptr) qzptr = fnptr+npts qz = a(qzptr) delk = a(3*npts+1) fdelk = fct*fn+delk if (.not. inprod) goto 9 dinprd = fdelk*tchbp(n, x, z, a(1), a(npts))-fct*tchbp(m, 1 x(n+2), z, a(1), a(npts))+qz*x(nn) goto 16 9 maxmn = max0(m, n) call tchcf(z, a(1), a(npts), maxmn, x) j = m+1 goto 11 10 j = j-1 11 if (1 .gt. j) goto 12 jp = j+n+1 x(jp) = (-fct)*x(j) goto 10 12 j = 1 goto 14 13 j = j+1 14 if (j .gt. n+1) goto 15 x(j) = fdelk*x(j) goto 13 15 x(nn) = qz 16 continue 17 continue 18 call leave return end subroutine tchcf(x, a, b, deg, xx) integer deg real x, a, b, xx(((1) integer i real twoxx c c Subroutine Tchcf computes the deg+1 Tchebycheff c coefficients of the point x. c call enter(1) if (deg .lt. 0) call seterr(21h Tchcf-invalid degree, 21, 1, 2) xx(1) = 1.e0 if (deg .le. 0) goto 3 if (b .gt. a) goto 1 call seterr(23h Tchcf-invalid interval, 23, 2, 2) goto 2 1 xx(2) = 2.e0*(x-(a+b)/2.e0)/(b-a) cscale x to the interval (-1.e0,1.e0) 2 continue 3 if (deg .gt. 1) twoxx = 2.e0*xx(2) i = 3 goto 5 4 i = i+1 5 if (i .gt. deg+1) goto 6 xx(i) = twoxx*xx(i-1)-xx(i-2) goto 4 6 call leave return end 1h Tchcf-invalid degree, 21, 1, 2) xx(1) = 1.e0 if (deg .le. 0) goto 3 if (b .gt. a) goto 1 call seterr(23h Tchcf-invalid interval, 23, 2, 2) goto 2 1 xx(2) = 2.e0*(x-(a+b)/2.e0)/(b-a) cscale x to the interval (-1.e0,1.e0) 2 continue 3 if (deg .gt. 1) twoxx = 2.e0cmd/efl/efltest/Dgl.e 644 0 33 7475 2405462537 7712 Procedure DglsBP(Nu,Order,BC,E) # To determine which ODE should use which boundary condition. # Mnemonic - Double precision Galerkin's method for Linear Systems, # Boundary condition Placement. # Scratch Space Allocated - # S(DglsBP) <= Nu*(4*Nu+15) # Integer words. Integer Nu,Order(Nu,Nu,2),BC(Nu,2,2),E(Nu,2,2) Integer inow,inowold,i,j,l,iMaxord,iCE,Istkgt,iPPS Logical AllZero Struct Nodei { Integer bp,N,j,R(1) } Define Push +1 Define Search 0 Define Pop -1 # Define Node = Is(inow) -> Nodei Include dstack # Check the input for errors. If ( Nu < 1 ) { Seterr("DglsBP - Nu.lt.1",16,1,2) } Do l = 1 , 2 { Do i = 1 , Nu { AllZero = .True. # Is Order(i,.,l) = (-1,...,-1)? Do j = 1 , Nu { AllZero &= Order(i,j,l) == (-1) If ( Order(i,j,l) < (-1) | Order(i,j,l) > 2 ) { Seterr("DglsBP - Order(i,j,l) not one of -1,0,1,2",41,2,2) } } If ( ( BC(i,1,l) ~= (-2) & BC(i,1,l) ~= 0 ) | ( BC(i,2,l) ~= (-2) & BC(i,2,l) ~= 1 ) ) { Seterr("DglsBP - BC(i,.,l) not one of -2,0,1",36,3,2) } If ( AllZero ) { Seterr("DglsBP - Order(i,.,l)=(-1,...,-1)",33,4,2) } } } Enter(1) iCE = Istkgt(Nu,2) # Complement of E. # Maxord(i,l) = Max over j=1,...,Nu Order(i,j,l). iMaxord = Istkgt(2*Nu,2) Seti(2*Nu,-1,Is(iMaxord)) Do l = 1 , 2 { Do i = 1 , Nu { Do j = 1 , Nu { Is(iMaxord+i-1+(l-1)*Nu) = Max0(Is(iMaxord+i-1+(l-1)*Nu), Order(i,j,l)) } } } i = 0 ; iPPS = Push While ( i < 4*Nu | iPPS ~= Push ) { Switch ( iPPS ) { Case Push: # Make a node. inowold = inow i += 1 ; inow = Istkgt(Nu+3,2) Is(inow) -> Nodei.bp = inowold # Get the candidates for E(i). D6lsBP(i,Nu,Order,BC,E, Is(iMaxord),Is(iCE),Is(inow) -> Nodei.R,Is(inow) -> Nodei.N) Is(inow) -> Nodei.j = 0 iPPS = Search ; Break Case Search: # Searching a node. Is(inow) -> Nodei.j += 1 If ( Is(inow) -> Nodei.j > Is(inow) -> Nodei.N ) # Back-up. { iPPS = Pop ; Next } E(i,1,1) = Is(inow) -> Nodei.R(Is(inow) -> Nodei.j) iPPS = Push ; Break Case Pop: # Backing up a Node. inow = Is(inow) -> Nodei.bp ; Istkrl(1) ; i -= 1 iPPS = Search ; Break } # End Switch. If ( i == 0 ) { Seterr("DglsBP - Improper Boundary Conditions",37,5,1) ; Break } } # End While. Leave() Return End Procedure D6lsBP(i,Nu,Order,BC,E, Maxord,CE,R,N) Integer i,Nu,Order(Nu,Nu,2),BC(1),E(1), # BC(Nu,2,2),E(Nu,2,2), Maxord(Nu,2),CE(Nu),R(Nu),N # E(i-1),R(N). Integer j,LR,DM,NBCs,l,ii If ( BC(i) < 0 ) { N = 1 ; R(N) = 0 ; Return } # LR = 1 for left, LR = 2 for right. LR = 1+(i-1)/(2*Nu) # DM = 1 for Dirichlet, DM = 2 for Mixed boundary conditions. DM = 1+Mod((i-1)/Nu,2) ii = Mod(i,Nu) ; If ( ii == 0 ) { ii = Nu } # B(i) = B(ii,DM,LR). N = 0 Do j = 1 , Nu { CE(j) = j } # CE = Complement of E. If ( i <= 2*Nu ) { For ( j = 1 , j < i , j += 1 ) { If ( BC(j) >= 0 ) { CE(E(j)) = 0 } } } Else { For ( j = 2*Nu+1 , j < i , j += 1 ) { If ( BC(j) >= 0 ) { CE(E(j)) = 0 } } } Do j = 1 , Nu { If ( CE(j) == 0 ) { Next } NBCs = 0 For ( l = 1 , l < i , l += 1 ) { If ( E(l) == j & BC(l) >= 0 ) { NBCs += 1 } } If ( ( DM == 1 & Maxord(j,LR) > BC(i) ) | ( DM == 2 & Order(j,ii,LR) > BC(i) ) ) { If ( NBCs < Max0(Maxord(j,1),Maxord(j,2)) ) { N += 1 ; R(N) = j } } } Return End lse { For ( j = 2*Nu+1 , j < i , j += 1 ) { If ( BC(j) >= 0 ) { CE(E(j)) = 0 } } } Do j = 1 , Nu { If ( CE(j) == 0 ) { Next } NBCs = 0 Focmd/efl/efltest/Dgl.out 644 0 33 12016 2405462541 10273 subroutine dglsbp(nu, order, bc, e) integer nu integer order(nu, nu, 2), bc(nu, 2, 2), e(nu, 2, 2) common /cstak/ ds double precision ds(500) integer ice, istkgt, max0, i, j, l integer ipps, inow, imaord, inoold, is(1000) real rs(1000) logical allero, ls(1000) complex cs(500) double precision ws(500) integer temp, temp1 equivalence (ds(1), cs(1), ws(1), rs(1), is(1), ls(1)) c To determine which ODE should use which boundary condition. c Mnemonic - Double precision Galerkin's method for Linear Systems, c Boundary condition Placement. c Scratch Space Allocated - c S(DglsBP) <= Nu*(4*Nu+15) c Integer words. c Define Node = Is(inow) -> Nodei c Check the input for errors. if (nu .lt. 1) call seterr(16hDglsBP - Nu.lt.1, 16, 1, 2) do 3 l = 1, 2 do 2 i = 1, nu c Is Order(i,.,l) = (-1,...,-1)? allero = .true. do 1 j = 1, nu allero = allero .and. order(i, j, l) .eq. (-1) if (order(i, j, l) .lt. (-1) .or. order(i, j, l) .gt. 2) 1 call seterr( 2 41hDglsBP - Order(i,j,l) not one of -1,0,1,2, 41, 2, 2 3 ) 1 continue if (bc(i, 1, l) .ne. (-2) .and. bc(i, 1, l) .ne. 0 .or. bc(i 1 , 2, l) .ne. (-2) .and. bc(i, 2, l) .ne. 1) call seterr( 2 36hDglsBP - BC(i,.,l) not one of -2,0,1, 36, 3, 2) if (allero) call seterr( 1 33hDglsBP - Order(i,.,l)=(-1,...,-1), 33, 4, 2) 2 continue 3 continue call enter(1) c Complement of E. ice = istkgt(nu, 2) c Maxord(i,l) = Max over j=1,...,Nu Order(i,j,l). imaord = istkgt(2*nu, 2) call seti(2*nu, -1, is(imaord)) do 6 l = 1, 2 do 5 i = 1, nu do 4 j = 1, nu temp1 = imaord+i-1+(l-1)*nu temp = imaord+i-1+(l-1)*nu is(temp1) = max0(is(temp), order(i, j, l)) 4 continue 5 continue 6 continue i = 0 ipps = 1 7 if (i .ge. 4*nu .and. ipps .eq. 1) goto 15 goto 12 c Make a node. 8 inoold = inow i = i+1 inow = istkgt(nu+3, 2) is(inow) = inoold c Get the candidates for E(i). call d6lsbp(i, nu, order, bc, e, is(imaord), is(ice), is( 1 inow+3), is(inow+1)) is(inow+2) = 0 ipps = 0 goto 13 goto 13 c Searching a node. 9 is(inow+2) = is(inow+2)+1 if (is(inow+2) .le. is(inow+1)) goto 10 ipps = -1 c Back-up. goto 7 10 temp = inow+2+is(inow+2)-1 e(i, 1, 1) = is(temp+1) ipps = 1 goto 13 goto 13 c Backing up a Node. 11 inow = is(inow) call istkrl(1) i = i-1 ipps = 0 goto 13 goto 13 12 temp = ipps+2 if (temp .gt. 0 .and. temp .le. 3) goto ( 11, 9, 8), temp c End Switch. 13 if (i .ne. 0) goto 14 call seterr(37hDglsBP - Improper Boundary Conditions, 37, 5, 1 1) goto 15 14 continue goto 7 c End While. 15 call leave return end subroutine d6lsbp(i, nu, order, bc, e, maxord, ce, r, n) integer nu integer i, order(nu, nu, 2), bc(1), e(1), maxord(nu, 2), ce(nu) integer r(nu), n integer mod, max0, j, l, nbcs, dm integer ii, lr integer temp c BC(Nu,2,2),E(Nu,2,2), c E(i-1),R(N). if (bc(i) .ge. 0) goto 1 n = 1 r(n) = 0 return c LR = 1 for left, LR = 2 for right. 1 lr = (i-1)/(2*nu)+1 c DM = 1 for Dirichlet, DM = 2 for Mixed boundary conditions. dm = mod((i-1)/nu, 2)+1 ii = mod(i, nu) if (ii .eq. 0) ii = nu c B(i) = B(ii,DM,LR). n = 0 do 2 j = 1, nu ce(j) = j 2 continue c CE = Complement of E. if (i .gt. 2*nu) goto 7 j = 1 goto 4 3 (( j = j+1 4 if (j .ge. i) goto 6 if (bc(j) .lt. 0) goto 5 temp = e(j) ce(temp) = 0 5 continue goto 3 6 continue goto 12 7 j = 2*nu+1 goto 9 8 j = j+1 9 if (j .ge. i) goto 11 if (bc(j) .lt. 0) goto 10 temp = e(j) ce(temp) = 0 10 continue goto 8 11 continue 12 do 18 j = 1, nu if (ce(j) .eq. 0) goto 18 nbcs = 0 l = 1 goto 14 13 l = l+1 14 if (l .ge. i) goto 15 if (e(l) .eq. j .and. bc(l) .ge. 0) nbcs = nbcs+1 goto 13 15 if ((dm .ne. 1 .or. maxord(j, lr) .le. bc(i)) .and. (dm .ne. 2 1 .or. order(j, ii, lr) .le. bc(i))) goto 17 if (nbcs .ge. max0(maxord(j, 1), maxord(j, 2))) goto 16 n = n+1 r(n) = j 16 continue 17 continue 18 continue return end nbcs = 0 l = 1 goto 14 13 l = l+1 14 if (l .ge. i) goto 15 if (e(l) .eq. j .and. bc(l) .ge. 0) nbcs = nbcs+1 goto 13 15 if ((dm .ne. 1 .or. maxord(j, lr) .le. bc(i)) .and. (dm .ne. 2 1 .or. order(j, ii, lr) .le. bc(i))) goto 17 if (nbcs .ge. max0(maxord(j, 1), maxord(j, 2))) goto 16 n = n+1 r(n) = j 16 continue 17 continue 18 continue retcmd/efl/efltest/Hard.e 644 0 33 2500 2405462544 10040 struct t { struct s { character(6) a(2),b;integer c} a(3); integer b(6) } procedure sam(x) t x(4),y integer z(5,7) x(2).a(2).a(2) = "abc" y.b(3) = 4 z(2,4)->s.c = 2 z->s.a(2) = "xyz" end procedure struct { field(3) a,b,c,d; field(10000) e; field(3) f} x integer m x.a = 2 x.b = 2 x.c = 2 x.d = 2 x.e = 2 x.f = 2 x.a-=2 x.b-=2 x.c-=2 x.d-=2 x.a*=2 x.b*=2 x.c*=2 x.d*=2 x.c+=2 x.c *= x.d += x.b = (x.a=1)+2 end procedure struct t { field(0:3) a; field(20) b; field(60) c} t x integer k k = x.a+x.b+x.c end procedure struct t { field(50) a,b,c,d,e } integer i t x(5) x(2).a = i x(2).b = i x(2).c = i x(2).d = i x(2).e = i do i = x(1).a, x(3).b,x(5).e x(i**2).b *= x(i**2+1).e end procedure struct t {real a} x x.a = 1. { struct t {integer b, c} y y.b=1 } x.a = 2. end common(cc) complex a integer b procedure integer a {logical a;a = .true.} a = 1 {logical a;a=.false.} a=2 end procedure a = 1 end procedure a(b) end procedure alltyp(y) struct { real a(3) long real b(3) integer c(3) complex d(3) logical e(3) character(8) f(3) character(9) g(3) } x, y x.a(3) = x.b(3) = x.c(3) = x.d(3) = 1 x.e(3) = false x.f(3) = x.g(3) = "abcdefg" end procedure integer i,j logical l switch(i) { case 1: if(l) goto case 2 else switch(j) { case 1: goto case 2 case 2: goto case 1 } case 3: j=2 case 2: while(i!=j) ++j } end l a;a = .true.} a = 1 {logical a;a=.false.} a=2 end procedure a = 1 end procedure a(b) end procedure alltyp(y) struct { real a(3) long real b(3) integer c(3) complex d(3) logical e(3) ccmd/efl/efltest/Hard.out 644 0 33 6275 2405462546 10442 subroutine sam(x) integer x(27, 4) integer y(27), z(5, 7) call ef1asc(x(10, 2), 6, 3habc, 3) y(24) = 4 z(8, 4) = 2 call ef1asc(z(3, 1), 6, 3hxyz, 3) end c main program integer mod, m, x(2) x(1) = 3*(x(1)/3)+1 x(1) = x(1)-3*(mod(x(1)/3, 3)-1) x(1) = x(1)-9*(mod(x(1)/9, 3)-1) x(1) = mod(x(1), 27)+27 x(2) = 10000*(x(2)/10000)+1 x(2) = mod(x(2), 10000)+10000 x(1) = x(1)-2 x(1) = x(1)-6 x(1) = x(1)-18 x(1) = x(1)-54 x(1) = 3*(x(1)/3)+2*(mod(x(1), 3)+1)-1 x(1) = x(1)-3*(mod(x(1)/3, 3)-(2*(mod(x(1)/3, 3)+1)-1)) x(1) = x(1)-9*(mod(x(1)/9, 3)-(2*(mod(x(1)/9, 3)+1)-1)) x(1) = mod(x(1), 27)+27*(2*(x(1)/27+1)-1) x(1) = x(1)+18 x(1) = 3*(x(1)/3) x(1) = x(1)-3*(mod(x(1)/3, 3)-(mod(x(1), 3)+2)) x(1) = x(1)+27*(mod(x(1)/3, 3)+1) x(1) = x(1)-9*(mod(x(1)/9, 3)-((mod(x(1)/9, 3)+1)*(x(1)/27+1)-1)) end c main program integer mod, k, x(1) k = mod(x(1), 4)+mod(x(1)/4, 20)+1+x(1)/80+1 end c main program integer mod, i, x(3, 5) integer temp, temp1, temp2, temp3, temp4 x(1, 2) = 50*(x(1, 2)/50)+i-1 x(1, 2) = mod(x(1, 2), 50)+50*(i-1) x(2, 2) = 50*(x(2, 2)/50)+i-1 x(2, 2) = mod(x(2, 2), 50)+50*(i-1) x(3, 2) = i-1 temp2 = mod(x(1, 1), 50)+1 temp1 = x(1, 3)/50+1 temp = x(3, 5)+1 do 1 i = temp2, temp1, temp temp4 = i**2 temp3 = i**2 x(1, temp4) = mod(x(1, temp4), 50)+50*((x(1, temp4)/50+1)*(x(3, 1 temp3+1)+1)-1) 1 continue end c main program real x(1) integer y(2) x(1) = 1. y(1) = 1 x(1) = 2. end c main program common /cc/ a3 complex a3 integer a, b logical a1, a2 a2 = .true. a = 1 a1 = .false. a = 2 end c main program common /cc/ a complex a integer b a = 1 end subroutine a(b) real b common /cc/ a1 complex a1 integer b1 end subroutine alltyp(y, y1, y2, y3, y4) integer y(38) real y1(38) logical y2(38) complex y3(19) double precision y4(19) common /cc/ a complex a integer b, x(38) real x1(38) logical x2(38) complex x3(19) double precision x4(19) equivalence (x(1), x1(1), x2(1), x3(1), x4(1)) x3(10) = 1 x(13) = x3(10) x4(5) = x(13) x1(3) = x4(5) x2(23) = .false. call ef1asc(x(36), 9, 7habcdefg, 7) call ef1asc(x(28), 8, x(36), 9) end c main program common /cc/ a complex a integer b, i, j logical l goto 11 1 if (.not. l) goto 2 goto 9 goto 7 2 goto 5 3 goto 4 goto 6 4 goto 3 goto 6 5 if (j .eq. 2) goto 4 if (j .eq. 1) goto 3 6 continue 7 goto 12 8 j = 2 goto 12 9 if (i .eq. j) goto 10 j = j+1 goto 9 10 continue goto 12 11 if (i .gt. 0 .and. i .le. 3) goto ( 1, 9, 8), i 12 continue end if (.not. l) goto 2 goto 9 goto 7 2 goto 5 3 goto 4 goto 6 4 goto 3 goto 6 5 if (j .eq. 2) goto 4 if (j .eq. 1) goto 3 6 continue 7 goto 12 8 j = 2 goto 12 cmd/efl/efltest/dstack 644 0 33 271 2405462547 10176 Common (Cstak) Ds ; Long Real Ds(500) Long Real Ws(500) Real Rs(1000) ; Integer Is(1000) ; Complex Cs(500) ; Logical Ls(1000) Equivalence ( Ds(1),Cs(1),Ws(1),Rs(1),Is(1),Ls(1)) end if (.not. l) goto 2 goto 9 goto 7 2 goto 5 3 goto 4 goto 6 4 goto 3 goto 6 5 if (j .eq. 2) goto 4 if/|,|5؆< /,"cmd/efl/efltest/rstack 644 0 33 262 2405462550 10206 common (cstak) ds ; long real ds(500) real ws(500) real rs(1000) ; integer is(1000) ; complex cs(500) ; logical ls(1000) equivalence ds(1),cs(1),ws(1),rs(1),is(1),ls(1) Ls(1)) end if (.not. l) goto 2 goto 9 goto 7 2 goto 5 3 goto 4 goto 6 4 goto 3 goto 6 5 if (j .eq. 2) goto 4 if/|,|5< /,"cmd/efl/addr.c 644 0 33 6266 2405462500 6431 ((#include "defs" struct varblock *subscript(v,s) register ptr v,s; { ptr p; register ptr q; ptr bounds, subs; int size, align, mask; if(v->tag == TERROR) goto ret; if(v->tag!=TNAME && v->tag!=TTEMP) badtag("subscript", v->tag); if(s->tag == TERROR) { v->vsubs = 0; goto ret; } if(s->tag != TLIST) badtag("subscript", s->tag); sizalign(v, &size, &align, &mask); if(bounds = v->vdim) bounds = bounds->datap; subs = s->leftp; while ( bounds && subs) { if(bounds->lowerb) { p = mknode(TAROP,OPMINUS,mkint(1),cpexpr(bounds->lowerb)); subs->datap = mknode(TAROP,OPPLUS, subs->datap, p); } bounds = bounds->nextp; subs = subs->nextp; } v->vdim = 0; if(bounds || subs) { exprerr("subscript and bounds of different length", CNULL); v->vsubs = 0; goto ret; } if(v->vsubs) { /* special case of subscripted type element */ if(s->leftp==0 || s->leftp->nextp!=0) { exprerr("not exactly one subscript on type member", CNULL); v->vsubs = 0; goto ret; } q = mknode(TAROP,OPMINUS,s->leftp->datap, mkint(1) ); q = mknode(TAROP,OPSTAR, mkint(size), q); if(v->voffset) v->voffset = mknode(TAROP,OPPLUS,v->voffset, q); else v->voffset = q; goto ret; } v->vsubs = s; if(v->vtype==TYCHAR || v->vtype==TYSTRUCT || (v->vtype==TYLCOMPLEX && tailor.lngcxtype==NULL) ) { /* add an initial unit subscript */ s->leftp = mkchain(mkint(1), s->leftp); } else { /* add to offset, set first subscript to 1 */ q = mknode(TAROP,OPMINUS,s->leftp->datap, mkint(1) ); q = mknode(TAROP,OPSTAR, mkint(size), q); if(v->voffset) v->voffset = mknode(TAROP,OPPLUS,v->voffset, q); else v->voffset = q; s->leftp->datap = mkint(1); } ret: return(v); } ptr strucelt(var, subelt) register ptr var; ptr subelt; { register ptr p, q; if(var->tag == TERROR) return(var); if(var->vtype!=TYSTRUCT || var->vtypep==0 || var->vdim!=0) { exprerr("attempt to find a member in an array or non-structure", CNULL); return(errnode()); } for(p = var->vtypep->strdesc ; p ; p = p->nextp) if(subelt == p->datap->sthead) break; if(p == 0) { exprerr("%s is not in structure\n", subelt->namep); return(errnode()); } q = p->datap; var->vdim = q->vdim; var->vtypep = q->vtypep; if(q->voffset) if(var->voffset) var->voffset = mknode(TAROP,OPPLUS,var->voffset,cpexpr(q->voffset)); else { var->voffset = cpexpr(q->voffset); } if( (var->vtype = q->vtype) != TYSTRUCT) convtype(var); return(var); } convtype(p) register ptr p; { register int i, k; ptr mksub1(); switch(p->vtype) { case TYFIELD: case TYINT: case TYCHAR: case TYREAL: case TYLREAL: case TYCOMPLEX: case TYLOG: k = eflftn[p->vtype]; break; default: fatal("convtype: impossible type"); } for(i=0; ivbase[i] = 0; else if(p->vbase[i]==0) { exprerr("illegal combination of array and dot",CNULL); mvexpr(errnode(), p); return; } if(p->vsubs == 0) p->vsubs = mksub1(); } fixsubs(p) register ptr p; { ptr q, *firstsub; int size,align,mask; if(p->voffset) { firstsub = &(p->vsubs->leftp->datap); sizalign(p, &size,&align,&mask); if(p->vtype == TYCHAR) size = tailor.ftnsize[FTNINT]; q = mknode(TAROP,OPSLASH,p->voffset,mkint(size)); *firstsub = mknode(TAROP,OPPLUS, q, *firstsub); p->voffset = 0; } } else if(p->vbase[i]==0) { exprerr("illegal combination of array and dot",CNULL); mvexpr(errnode(), p); return; } if(p->vsubs == 0) p->vsubs = mksub1(); } fixsubs(p) register ptr p; { ptr q, *firstsub; int size,align,mask; if(p->voffset) { firstsub = &(p->vsubs->leftp->datap); sizalign(p, &size,&align,&mask)cmd/efl/alloc.c 644 0 33 11412 2405462501 6617 #include "defs" #define NHISTO 50 int histo[NHISTO]; int mem[MEMSIZE]; unsigned int nmemused = 0; unsigned int nmemavail = 0; long int totalloc = 0; long int totfreed = 0; int nexpblocks = 0; ptr expblocks = 0; int nexcblocks = 0; ptr excblocks = 0; ptr chains = 0; ptr alloc(), calloc(), malloc(); ptr intalloc(n) int n; { int *p; /*debug*/ if(n>sizeof(struct genblock)) fatal1("intalloc(%d)", n); if( (p = calloc(1,n)) == NULL) { if(memdump) prmem(); fatal1("Line %d: Cannot allocate memory", yylineno); } return(p); } ptr calloc(m,n) int m, n; { return(alloc(m*n)); } ptr malloc(m) int m; { return(alloc(m)); } /* Very stupid memory allocator. Stores a count word before each block; negative if idle, positive if busy. Looks for a block big enough for current request, and splits it if necessary. Does not coalesce, always starts at bottom of memory. Checks validity of all count words it encounters. */ ptr alloc(k) register int k; { int *p; register int i, j; k = (k + sizeof(int)-1) / sizeof(int); if(k <=0) fprintf(diagfile, "alloc(%d words)\n", k); else if(k >= NHISTO) ++histo[0]; else ++histo[k]; totalloc += k; if(k > 256) fprintf(diagfile, "calloc(%d words)\n", k); /* look for a large enough slot */ if(nmemavail > k) for(i=0 ; i256) { fprintf(diagfile, "Bad count word %d\n", j); goto die; } if(j>=0 || (j = -j) 256) { fprintf(diagfile, "Bad count word %d\n", j); goto die; } mem[i] = k; if(j > k) mem[i+k+1] = -(j-k-1); for(j = i+k ; j>i ; --j) mem[j] = 0; nmemavail -= (k+1); return(mem + i+1); } } /* otherwise try to advance the fence */ mem[nmemused] = k; p = mem + nmemused + 1; nmemused += (k+1); if(nmemused >= MEMSIZE) { die: /*debug*/ fprintf(diagfile, "Highwater mark %d words. ", nmemused); /*debug*/ fprintf(diagfile, "%ld words left over\n", totalloc-totfreed); /* prmem(); */ fatal1("Line %d: out of memory", yylineno); } return(p); } cfree(p) ptr p; { if(p==0) fatal("cfree(0)"); free(p); } free(p) register unsigned int *p; { if(p<=mem || p>mem+nmemused) { fprintf(diagfile, "attempt to free an unallocated block, "); goto bad; } if(p[-1]>256 || p[-1]<0) { fprintf(diagfile, "attempted to free a block of length %u\n",p[-1]); bad: fprintf(diagfile, "location %o ", p); fprintf(diagfile, "mem=%o lastused=%o\n", mem, mem+nmemused); /* if(p[-1]>256 || p[-1]<0) */ fatal(""); } totfreed += p[-1]; nmemavail += p[-1]+1; p[-1] = - p[-1]; ; } prhisto() { int i; fprintf(diagfile, "allocation histogram:\n%4d big blocks\n",histo[0]); for(i=1;i0) fprintf(diagfile, "%4d %2d-word blocks\n", histo[i],i); } ptr allexpblock() { ptr p; if(expblocks) { p = expblocks; expblocks = expblocks->leftp; zeroout(p, sizeof(struct exprblock)); --nexpblocks; return(p); } else return( ALLOC(exprblock) ); } frexpblock(p) register ptr p; { if ( p[-1] != sizeof(struct exprblock)/sizeof(int) ) badtag("frexpblock", p->tag); if(nexpblocks < EXPRPOOL) { p->leftp = expblocks; p->tag = 0; expblocks = p; ++nexpblocks; } else cfree(p); } ptr allexcblock() { ptr p; if(excblocks) { p = excblocks; excblocks = excblocks->leftp; zeroout(p, sizeof(struct execblock)); --nexcblocks; return(p); } else return( ALLOC(execblock) ); } frexcblock(p) register ptr p; { if( p[-1] != sizeof(struct execblock)/sizeof(int) ) fatal1("invalid frexcblock block of size %d", p[-1]); if(nexcblocks < EXECPOOL) { p->leftp = excblocks; p->tag = 0; excblocks = p; ++nexcblocks; } else cfree(p); } zeroout(p,n) register int *p; int n; { register int *pn; pn = p + (n + sizeof(int)-1)/sizeof(int); while(p < pn) *p++ = 0; } frchain(p0) register chainp *p0; { register ptr p; if(p0==0 || *p0==0) return; for(p = *p0 ; p->nextp ; p = p->nextp) p->datap = 0; p->datap = 0; p->nextp = chains; chains = *p0; *p0 = 0; } chainp mkchain(p,q) ptr p, q; { register chainp r; if(chains) { r = chains; chains = chains->nextp; } else r = ALLOC(chain); r->datap = p; r->nextp = q; return(r); } prmem() { register int i,j; fprintf(diagfile, "Memory dump:\n"); for(i=0 ; inamep); else if(j==2) fprintf(diagfile, " chain %o %o", mem[i+1], mem[i+2]); else if (mem[i+1].tag > TIOSTAT) { char *s, *sn; s = & mem[i+1]; sn = s + 12; fprintf(diagfile, " \""); while(*s!= '\0' && snamep); else if(j==2) fprincmd/efl/bigdefs 644 0 33 21227 2340044566 6721 #include "stdio.h" #define HASHEDTABLE 1 #define NFTNTYPES 5 #define NEFLTYPES 12 #define MEMSIZE 12000 #define MAXSTNO 200 #define MAXINCLUDEDEPTH 10 #define MAXBLOCKDEPTH 30 #define MAXINDIFS 100 #define MAXFTNAMES 200 #define MAXEFLNAMES 401 #define EXECPOOL 20 #define EXPRPOOL 40 #define NAMESPERLINE 6 #define LINESPACES 66 #define INDENTSPACES 3 extern int yylineno; extern int dumpic; extern int memdump; extern int dbgflag; extern int nowarnflag; extern int nocommentflag; extern int verbose; e((xtern int dumpcore; #define TEST if(dbgflag) #define efgetc (efmacp?*efmacp++:getc(yyin)) extern char msg[]; #define UNIX 1 #define GCOS 2 #define GCOSBCD 3 #define FIELDMAX 32768. typedef *ptr; #define ALLOC(x) intalloc(sizeof(struct x)) extern FILE *diagfile; extern FILE *codefile; extern FILE *yyin; extern FILE *fileptrs[]; extern char *filenames[]; extern int filelines[]; extern int filedepth; extern char *efmacp; extern int filemacs[]; extern int pushchars[]; extern struct fileblock *iifilep; extern int mem[]; extern unsigned int nmemused; extern long int totfreed; extern long int totalloc; extern int nhid[]; extern int ndecl[]; extern int indifs[]; extern int nxtindif; extern int afterif; extern neflnames; extern int nftnch; extern int nftncont; extern char ftnames[MAXFTNAMES][7]; extern int nftnames; extern int nftnm0; extern int impltype[]; extern int ftnmask[]; extern double fieldmax; extern int ftnefl[]; extern int eflftn[]; extern ptr thisexec; extern ptr thisctl; extern int pushlex; extern int igeol; extern int ateof; extern int eofneed; extern int forcerr; extern int comneed; extern int optneed; extern int defneed; extern int lettneed; extern int prevbg; extern ptr hidlist; extern ptr commonlist; extern ptr tempvarlist; extern ptr temptypelist; extern ptr gonelist; extern int blklevel; extern int ctllevel; extern int dclsect; extern int instruct; extern int inbound; extern int inproc; extern int ncases; extern ptr comments; extern ptr prevcomments; extern ptr genequivs; extern ptr arrays; extern ptr generlist; extern ptr knownlist; extern int graal; extern ptr thisproc; extern ptr thisargs; extern int langopt; extern int dotsopt; extern int dbgopt; extern int dbglevel; extern int stnos[]; extern int nxtstno; extern int constno; extern int labno; extern int nerrs; extern int nbad; extern int nwarns; struct headbits { int tag:8; int subtype:8; int blklevel:8; }; extern struct fileblock { FILE *fileptr; char filename[20]; }; extern struct fileblock *ibfile; extern struct fileblock *icfile; extern struct fileblock *idfile; extern struct fileblock *iefile; extern struct chain { ptr nextp; ptr datap; } ; typedef struct chain *chainp; extern struct comentry { struct headbits header; char comname[7]; long int comleng; int cominit:2; chainp comchain; } ; extern struct stentry { struct headbits header; char *namep; ptr varp; int hashval; }; extern struct stentry *hashtab[]; extern struct stentry **hashend; extern struct typeblock { struct headbits header; ptr sthead; ptr strdesc; int stralign; int strsize; int basetypes; } ; extern struct keyblock { struct headbits header; ptr sthead; } ; extern struct varblock { struct headbits header; ptr sthead; ptr vinit; int vadjdim:1; int vdcldone:1; int vdclstart:1; int vnamedone:1; int vprec:1; int vext:1; int vproc:2; int needpar:1; int vtype:4; int vclass:3; ptr vtypep; ptr vdim; ptr vsubs; ptr voffset; int vextbase; int vbase[NFTNTYPES]; } ; extern struct atblock { int atprec; int attype; int atext; int atclass; ptr attypep; ptr atcommon; ptr atdim; } ; extern struct dimblock { ptr nextp; ptr lowerb; ptr upperb; } ; extern struct exprblock /* must be same size as varblock */ { struct headbits header; ptr leftp; ptr rightp; int vadjdim:1; int vdcldone:1; int vdclstart:1; int vnamedone:1; int vprec:1; int vext:1; int vproc:2; int needpar:1; int vtype:4; int vclass:3; ptr vtypep; ptr vdim; ptr vsubs; ptr voffset; int vextbase; int vbase[NFTNTYPES]; } ; typedef union { struct varblock ; struct exprblock; } *nodep; extern struct execblock { struct headbits header; ptr temps; int labelno; int uniffable:1; int brnchend:1; int labeled:1; int copylab:1; int labdefined:1; int labused:1; int labinacc:1; ptr execdesc; ptr prevexec; int nxtlabno; int nftnst; } ; extern struct ctlblock /* must be same size as execblock */ { struct headbits header; ptr loopvar; ptr loopctl; ptr prevctl; int nextlab; int breaklab; int xlab; int indifn; } ; extern struct caseblock { struct headbits header; ptr nextcase; int labelno; int uniffable:1; int brnchend:1; int labeled:1; int copylab:1; int labdefined:1; int labused:1; int labinacc:1; ptr casexpr; } ; extern struct labelblock { struct headbits header; ptr sthead; int labelno; int uniffable:1; int brnchend:1; int labeled:1; int copylab:1; int labdefined:1; int labused:1; int labinacc:1; } ; extern struct defblock { struct headbits header; ptr sthead; char *valp; } ; extern struct doblock { struct headbits header; ptr dovar; ptr dopar[3]; } ; extern struct fieldspec { struct headbits header; int flbound; int frange; int frshift; int fanymore; } ; extern struct genblock { struct headbits header; ptr nextgenf; char *genname; char *genfname[NEFLTYPES]; int genftype[NEFLTYPES]; } ; extern struct knownname { struct headbits header; ptr nextfunct; char *funcname; int functype; } ; extern struct iostblock { struct headbits header; ptr leftp; /* padding */ ptr right; /* padding */ int vadjdim:1; int vdcldone:1; int vdclstart:1; int vnamedone:1; int vprec:1; int vext:1; int vproc:2; int needpar:1; int vtype:4; int vclass:3; int iokwd; ptr iounit; ptr iolist; int iojunk[7]; /* padding */ } ; extern struct ioitem { struct headbits header; ptr ioexpr; char *iofmt; } ; extern struct tailoring { int ftnsys; int errmode; int charcomp; int ftnin; int ftnout; int ftncontnu; char *procheader; int ftnchwd; int ftnsize[NFTNTYPES]; int ftnalign[NFTNTYPES]; char *dfltfmt[NEFLTYPES]; int hollincall; int deltastno; int dclintrinsics; } tailor; /*Block tags */ #define TAROP 1 #define TASGNOP 2 #define TLOGOP 3 #define TRELOP 4 #define TCALL 5 #define TREPOP 6 #define TLIST 7 #define TCONST 8 #define TNAME 9 #define TERROR 10 #define TCOMMON 11 #define TSTRUCT 12 #define TSTFUNCT 13 #define TEXEC 14 #define TTEMP 15 #define TDEFINE 16 #define TKEYWORD 17 #define TLABEL 18 #define TCASE 19 #define TNOTOP 20 #define TNEGOP 21 #define TDOBLOCK 22 #define TCONTROL 23 #define TKNOWNFUNCT 24 #define TFIELD 25 #define TGENERIC 26 #define TIOSTAT 27 /* Operator subtypes */ #define OPPLUS 1 #define OPMINUS 2 #define OPSTAR 3 #define OPSLASH 4 #define OPPOWER 5 #define OPNOT 6 #define OPAND 7 #define OP2AND 8 #define OP2OR 9 #define OPOR 10 #define OPEQ 11 #define OPLT 12 #define OPGT 13 #define OPLE 14 #define OPGE 15 #define OPNE 16 #define OPLPAR 17 #define OPRPAR 18 #define OPEQUALS 19 #define OPCOMMA 20 #define OPASGN 0 #define OPREL 0 /* Simplification types */ #define LVAL 1 #define RVAL 2 #define SUBVAL 3 #define IFVAL 4 /* Parser return values */ #define PARSERR 1 #define PARSEOF 2 #define PARSOPT 3 #define PARSDCL 4 #define PARSDEF 5 #define PARSPROC 6 /* Symbol table types */ #define TYUNDEFINED 0 #define TYINT 1 #define TYREAL 2 #define TYLREAL 3 #define TYLOG 4 #define TYCOMPLEX 5 #define TYCHAR 6 #define TYSTRUCT 7 #define TYLABEL 8 #define TYSUBR 9 #define TYFIELD 10 #define TYHOLLERITH 11 /* Fortran types */ #define FTNINT 0 #define FTNREAL 1 #define FTNLOG 2 #define FTNCOMPLEX 3 #define FTNDOUBLE 4 #define FTNCHAR 5 /* symbol table classes */ #define CLUNDEFINED 0 #define CLARG 1 #define CLVALUE 2 #define CLSTAT 3 #define CLAUTO 4 #define CLCOMMON 5 #define CLMOS 6 #define CLEXT 7 /* values of vproc */ #define PROCUNKNOWN 0 #define PROCNO 1 #define PROCYES 2 #define PROCINTRINSIC 3 /* ctlblock subtypes */ #define STNULL 1 #define STIF 2 #define STIFELSE 3 #define STREPEAT 4 #define STWHILE 5 #define STFOR 6 #define STDO 7 #define STSWITCH 8 #define STRETURN 9 #define STGOTO 10 #define STCALL 11 #define STPROC 12 /* intermediate code definitions */ #define ICEOF 0 #define ICBEGIN 1 #define ICKEYWORD 2 #define ICOP 3 #define ICNAME 4 #define ICCONST 5 #define ICLABEL 6 #define ICMARK 7 #define ICINDENT 8 #define ICCOMMENT 9 #define ICINDPTR 10 #define ICBLANK 11 #define FCONTINUE 2 #define FCALL 3 #define FDO 4 #define FIF1 5 #define FIF2 6 #define FGOTO 7 #define FRETURN 8 #define FREAD 9 #define FWRITE 10 #define FFORMAT 11 #define FSTOP 12 #define FDATA 13 #define FEQUIVALENCE 14 STCALL 11 #define STPROC 12 /* intermediate code definitions */ #define ICEOF 0 #define ICBEGIN 1 #define ICKEYWORD 2 #define ICOP 3 #define ICNAME 4 #define ICCONST 5 #define ICLABEL 6 #define ICMARK 7 #define ICINDENT 8 #define ICCOMMENT 9 #define ICINDPTR 10 #define ICBLANK 11 #define FCONTINUE 2 #define FCALL 3 #define FDO 4 #define FIF1 5 #define Fcmd/efl/blklab.c 644 0 33 13712 2405462503 6763 #include "defs" hide(p) ptr p; { warn1("Name %s hidden by a new declaration", p->namep); hidlist = mkchain(p->varp, hidlist); p->varp = 0; ++nhid[blklevel]; } /* remove all symbol table entries in terminated block, revive old hidden names */ unhide() { chainp p; register ptr q; register ptr v; register struct stentry *s; struct stentry **hp; for(hp = hashtab ; hpvarp) && v->blklevel == blklevel) { if(v->tag==TLABEL) if(blklevel <= 1) { if(v->labdefined==0) laberr("%s never defined", v->sthead->namep); s->varp = 0; } else { /* move label out a level */ if(v->labdefined) v->labinacc = 1; v->blklevel--; ++ndecl[blklevel-1]; } else { if(v->tag == TNAME) { TEST fprintf(diagfile,"gone(%s) level %d\n", s->namep, blklevel); gonelist = mkchain(s->varp, gonelist); } else if(v->tag!=TSTRUCT) { ++ndecl[blklevel]; if(v->tag==TDEFINE) ((frdef(v); } s->varp = 0; } --ndecl[blklevel]; } } for( p=hidlist ; p && ((v = (q=p->datap)->sthead)->varp==NULL) ; p=hidlist ) { v->varp = q; v->tag = q->tag; v->subtype = q->subtype; if(v->blklevel > q->blklevel) v->blklevel = q->blklevel; hidlist = p->nextp; p->nextp = CHNULL; frchain(&p); --nhid[blklevel]; TEST fprintf(diagfile, "unhide(%s), blklevel %d\n", v->namep, v->blklevel); } if(ndecl[blklevel] != 0) { sprintf(msg, "%d declarations leftover at block level %d", ndecl[blklevel], blklevel); fatal(msg); } if(nhid[blklevel] != 0) fatal("leftover hidden variables"); } ptr bgnexec() { register ptr p; p = allexcblock(); p->tag = TEXEC; p->prevexec = thisexec; if(thisexec && thisexec->copylab) { p->labelno = thisexec->labelno; p->labused = thisexec->labused; thisexec->labelno = 0; } thisexec = p; return(p); } ptr addexec() { register ptr p; register ptr q; q = thisexec; p = q->prevexec; if(q->temps) tempvarlist = hookup(q->temps, tempvarlist); p->brnchend = q->brnchend; p->nftnst += q->nftnst; p->labeled |= q->labeled; p->uniffable |= q->uniffable; if(q->labelno && !(q->labused)) { if(q->nxtlabno) exnull(); else q->nxtlabno = q->labelno; } thisexec = p; if(q->nxtlabno) { if(p->labelno && !(p->labused)) exnull(); p->labelno = q->nxtlabno; p->labused = 0; } frexcblock(q); return(p); } pushctl(t,vp) int t; register ptr vp; { register ptr q; ptr p; int junk; q = allexcblock(); q->tag = TCONTROL; q->subtype = t; q->loopvar = vp; q->prevctl = thisctl; thisctl = q; switch(t) { case STSWITCH: q->xlab = nextlab(); q->nextlab = 0; exgoto(q->xlab); ncases = -1; break; case STFOR: exlab(0); q->nextlab = nextlab(); q->xlab = nextlab(); break; case STWHILE: q->nextlab = thislab(); if(vp) exifgo( mknode(TNOTOP,OPNOT,vp,PNULL), q->breaklab = nextlab() ); else thisexec->copylab = 1; break; case STREPEAT: exnull(); q->xlab = thislab(); thisexec->copylab = 1; junk = nextindif(); indifs[junk] = 0; q->indifn = junk; indifs[q->indifn] = q->xlab; break; case STDO: q->nextlab = nextlab(); exlab(0); putic(ICKEYWORD,FDO); putic(ICLABEL, q->nextlab); putic(ICBLANK, 1); p = mknode(TASGNOP,OPASGN,vp->dovar,vp->dopar[0]); prexpr(p); frexpr(p); putic(ICOP, OPCOMMA); prexpr(vp->dopar[1]); frexpr(vp->dopar[1]); if(vp->dopar[2]) { putic(ICOP, OPCOMMA); prexpr(vp->dopar[2]); frexpr(vp->dopar[2]); } cfree(vp); break; case STIF: exif(vp); thisexec->nftnst = 0; break; default: fatal1("pushctl: invalid control block type %d", t); } ++ctllevel; } popctl() { register ptr p; ptr newp; chainp q; int first, deflabno, blab, cmin, cmax, range, caseval, optcase; int labp[MAXSWITCH]; if(thisctl == 0) fatal("empty control stack popped"); switch(thisctl->subtype) { case STSWITCH: /* if(thisexec->brnchend == 0) */ { if(thisctl->breaklab == 0) thisctl->breaklab = nextlab(); exgoto(thisctl->breaklab); } exlab(thisctl->xlab); deflabno = 0; first = YES; optcase = (thisctl->loopvar->vtype == TYINT); for(p=thisctl->loopctl ; p!=0 ; p = p->nextcase) if(p->labdefined == 0) { laberr("undefined case label", CNULL); optcase = NO; } else if(p->casexpr == 0) deflabno = p->labelno; else if( isicon(p->casexpr, &caseval)) { if(first) { first = NO; cmin = cmax = caseval; } else { if(caseval < cmin) cmin = caseval; if(caseval > cmax) cmax = caseval; } ++ncases; } else optcase = NO; range = cmax - cmin + 1; if(optcase && ncases>2 && range<2*ncases && rangeloopctl ; p!=0 ; p = p->nextcase) if(p->labdefined && p->casexpr) { isicon(p->casexpr, &caseval); frexpr(p->casexpr); labp[caseval-cmin] = p->labelno; } q = CHNULL; blab = (deflabno ? deflabno : thisctl->breaklab); for(i=range-1 ; i>=0 ; --i) q = mkchain(labp[i] ? labp[i] : blab, q); excompgoto(q, mknode(TAROP,OPPLUS, mkint(1-cmin), cpexpr(thisctl->loopvar) )); } else { for(p=thisctl->loopctl ; p!=0 ; p = p->nextcase) if(p->labdefined && p->casexpr) exifgo( mknode(TRELOP,OPEQ, cpexpr(thisctl->loopvar),p->casexpr), p->labelno); } if(deflabno) exgoto(deflabno); for(p = thisctl->loopctl ; p; p = newp) { newp = p->nextcase; cfree(p); } thisctl->loopctl = NULL; break; case STFOR: exgoto(thisctl->nextlab); break; case STWHILE: exgoto(thisctl->nextlab); break; case STREPEAT: break; case STDO: exnull(); exlab(thisctl->nextlab); putic(ICKEYWORD,FCONTINUE); break; case STIF: break; case STPROC: break; default: fatal1("popctl: invalid control block type %d", thisctl->subtype); } if(thisctl->breaklab != 0) thisexec->nxtlabno = thisctl->breaklab; p = thisctl->prevctl; frexcblock(thisctl); thisctl = p; --ctllevel; } tl = NULL; break; case STFOR: exgoto(thisctl->necmd/efl/dcl.c 644 0 33 17420 2405462505 6300 #include "defs" static char mess[ ] = "inconsistent attributes"; attatt(a1 , a2) register struct atblock *a1, *a2; { #define MERGE1(x) {if(a1->x==0) a1->x = a2->x; else if(a2->x!=0 && a1->x!=a2->x) dclerr(mess,"x"+2); } MERGE1(attype); MERGE1(attypep); MERGE1(atprec); MERGE1(atclass); MERGE1(atext); MERGE1(atcommon); MERGE1(atdim); if(a1->atprec!=0 && (a1->attype==TYREAL || a1->attype==TYCOMPLEX) ) a1->attype += (TYLREAL-TYREAL); cfree(a2); } attvars(a , v) register struct atblock * a; register chainp v; { register chainp p; for(p=v; p!=0 ; p = p->nextp) attvr1(a, p->datap); if(a->attype == TYFIELD) cfree(a->attypep); else if(a->attype == TYCHAR) frexpr(a->attypep); cfree(a); } #define MERGE(x,y) {if(v->y==0) v->y = a->x; else if(a->x!=0 && a->x!=v->y) dclerr(mess,"x"+2); } attvr1(a, v) register struct atblock * a; register struct varblock * v; { register chainp p; if(v->vdcldone) { dclerr("attempt to declare variable after use", v->sthead->namep); return; } v->vdclstart = 1; if(v->vclass == CLMOS) dclerr("attempt to redefine structure member", v->sthead->namep); if (v->vdim == 0) v->vdim = a->atdim; else if(!eqdim(a->atdim, v->vdim)) dclerr("inconsistent dimensions", v->sthead->namep); if(v->vprec == 0) v->vprec = a->atprec; MERGE(attype,vtype); if(v->vtypep == 0) { if(a->attypep != 0) if(a->attype == TYFIELD) { v->vtypep = ALLOC(fieldspec); cpblock(a->attypep, v->vtypep, sizeof(struct fieldspec)); } else if(a->attype == TYCHAR) v->vtypep = cpexpr(a->attypep); else v->vtypep = a->attypep; else if(a->attypep!=0 && a->attypep!=v->vtypep) dclerr("inconsistent attributes", "typep"); } if(v->vprec!=0 && (v->vtype==TYREAL || v->vtype==TYCOMPLEX) ) v->vtype += (TYLREAL-TYREAL); if(a->atcommon) if(v->vclass != 0) dclerr("common variable already in common, argument list, or external", v->sthead->namep); else { if(blklevel != a->atcommon->blklevel) dclerr("inconsistent common block usage", ""); for(p = &(a->atcommon->comchain) ; p->nextp!=0 ; p = p->nextp) ; p->nextp = mkchain(v, PNULL); } if(a->atext!=0 && v->vext==0) { v->vext = 1; extname(v); } else if(a->atclass == CLVALUE) if(v->vclass==CLARG || v->vclass==CLVALUE) v->vclass = CLVALUE; else dclerr("cannot value a non-argument variable",v->sthead->namep); else MERGE(atclass,vclass); if(v->vclass==CLCOMMON || v->vclass==CLVALUE || v->vclass==CLAUTO) setvproc(v, PROCNO); } eqdim(a,b) register ptr a, b; { if(a==0 || b==0 || a==b) return(1); a = a->datap; b = b->datap; while(a!=0 && b!=0) { if(!eqexpr(a->lowerb,b->lowerb) || !eqexpr(a->upperb,b->upperb)) return(0); a = a->nextp; b = b->nextp; } return( a == b ); } eqexpr(a,b) register ptr a, b; { if(a==b) return(1); if(a==0 || b==0) return(0); if(a->tag!=b->tag || a->subtype!=b->subtype) return(0); switch(a->tag) { case TCONST: return( equals(a->leftp, b->leftp) ); case TNAME: return( a->sthead == b->sthead ); case TLIST: a = a->leftp; b = b->leftp; while(a!=0 && b!=0) { if(!eqexpr(a->datap,b->datap)) return(0); a = a->nextp; b = b->nextp; } return( a == b ); case TAROP: case TASGNOP: case TLOGOP: case TRELOP: case TCALL: case TREPOP: return(eqexpr(a->leftp,b->leftp) && eqexpr(a->rightp,b->rightp)); case TNOTOP: case TNEGOP: return(eqexpr(a->leftp,b->leftp)); default: badtag("eqexpr", a->tag); } /* NOTREACHED */ } setimpl(type, c1, c2) int type; register int c1, c2; { register int i; if(c1<'a' || c2'z') dclerr("bad implicit range", CNULL); else if(type==TYUNDEFINED || type>TYLCOMPLEX) dclerr("bad type in implicit statement", CNULL); else for(i = c1 ; i<=c2 ; ++i) impltype[i-'a'] = type; } doinits(p) register ptr p; { register ptr q; for( ; p ; p = p->nextp) if( (q = p->datap)->vinit) { mkinit(q, q->vinit); q->vinit = 0; } } mkinit(v, e) register ptr v; register ptr e; { if(v->vdcldone == 0) dclit(v); swii(idfile); if(v->vtype!=TYCHAR && v->vtypep) dclerr("structure initialization", v->sthead->namep); else if(v->vdim==NULL || v->vsubs!=NULL) { if(e->tag==TLIST && (v->vtype==TYCOMPLEX || v->vtype==TYLCOMPLEX) ) e = compconst(e); valinit(v, e); } else arrinit(v,e); swii(icfile); frexpr(e); } valinit(v, e) register ptr v; register ptr e; { static char buf[4] = "1hX"; int vt; vt = v->vtype; /*check for special case of one-character initialization of non-character datum */ if(vt==TYCHAR || e->vtype!=TYCHAR || !isconst(e) || strlen(e->leftp)!=1) { e = simple(RVAL, coerce(vt,e) ); if(e->tag == TERROR) return; if( ! isconst(e) ) { dcl((err("nonconstant initializer", v->sthead->namep); return; } } if(vt == TYCHAR) { charinit(v, e->leftp); return; } prexpr( simple(LVAL,v) ); putic(ICOP,OPSLASH); if(e->vtype != TYCHAR) prexpr(e); else if(strlen(e->leftp) == 1) { buf[2] = e->leftp[0]; putsii(ICCONST, buf); } else dclerr("character initialization of nonchar", v->sthead->namep); putic(ICOP,OPSLASH); putic(ICMARK,0); } arrinit(v, e) register ptr v; register ptr e; { struct exprblock *listinit(), *firstelt(), *nextelt(); ptr arrsize(); if(e->tag!=TLIST && e->tag!=TREPOP) e = mknode(TREPOP, 0, arrsize(v), e); if( listinit(v, firstelt(v), e) ) warn("too few initializers"); if(v->vsubs) { frexpr(v->vsubs); v->vsubs = NULL; } } struct exprblock *listinit(v, subs, e) register struct varblock *v; struct exprblock *subs; register ptr e; { struct varblock *vt; register chainp p; int n; struct varblock *subscript(); struct exprblock *nextelt(); switch(e->tag) { case TLIST: for(p = e->leftp; p; p = p->nextp) { if(subs == NULL) goto toomany; subs = listinit(v, subs, p->datap); } return(subs); case TREPOP: if( ! isicon(e->leftp, &n) ) { dclerr("nonconstant repetition factor"); return(subs); } while(--n >= 0) { if(subs == NULL) goto toomany; subs = listinit(v, subs, e->rightp); } return(subs); default: if(subs == NULL) goto toomany; vt = subscript(cpexpr(v), cpexpr(subs)); valinit(vt, e); frexpr(vt); return( nextelt(v,subs) ); } toomany: dclerr("too many initializers", NULL); return(NULL); } charinit(v,e) ptr v; char *e; { register char *bp; char buf[50]; register int i, j; int nwd, nch; v = cpexpr(v); if(v->vsubs == 0) v->vsubs = mknode(TLIST,0, mkchain(mkint(1),CHNULL), PNULL); nwd = ceil( nch = conval(v->vtypep) , tailor.ftnchwd); sprintf(buf,"%dh", tailor.ftnchwd); for(bp = buf ; *bp ; ++bp ) ; for(i = 0; i 0) v->vsubs->leftp->datap = mknode(TAROP,OPPLUS, v->vsubs->leftp->datap, mkint(1)); prexpr( v = simple(LVAL,v) ); for(j = 0 ; j0 ; ) bp[j++] = *e++; while(j < tailor.ftnchwd) { bp[j++] = ' '; nch--; } bp[j] = '\0'; putic(ICOP,OPSLASH); putsii(ICCONST, buf); putic(ICOP,OPSLASH); putic(ICMARK,0); } frexpr(v); } struct exprblock *firstelt(v) register struct varblock *v; { register struct dimblock *b; register chainp s; ptr t; int junk; if(v->vdim==NULL || v->vsubs!=NULL) fatal("firstelt: bad argument"); s = NULL; for(b = v->vdim->datap ; b; b = b->nextp) { t = (b->lowerb ? cpexpr(b->lowerb) : mkint(1) ); s = hookup(s, mkchain(t,CHNULL) ); if(!isicon(b->upperb,&junk) || (b->lowerb && !isicon(b->lowerb,&junk)) ) dclerr("attempt to initialize adjustable array", v->sthead->namep); } return( mknode(TLIST, 0, s, PNULL) ); } struct exprblock *nextelt(v,subs) struct varblock *v; struct exprblock *subs; { register struct dimblock *b; register chainp *s; int sv; if(v == NULL) return(NULL); b = v->vdim->datap; s = subs->leftp; while(b && s) { sv = conval(s->datap); frexpr(s->datap); if( sv < conval(b->upperb) ) { s->datap =mkint(sv+1); return(subs); } s->datap = (b->lowerb ? cpexpr(b->lowerb) : mkint(1) ); b = b->nextp; s = s->nextp; } if(b || s) fatal("nextelt: bad subscript count"); return(NULL); } ; } struct exprblock *nextelt(v,subs) struct varblock *v; struct exprblock *subs; { register struct dimblock *b; register chainp *s; int sv; if(v == NULL) return(NULL); b = v->vdim->datap; s = subs->leftp; while(b && s) { sv = concmd/efl/dclgen.c 644 0 33 14006 2405462507 6771 #include "defs" #define DOCOMMON 1 #define NOCOMMON 0 dclgen() { register ptr p, q; ptr q1; chainp *y, z; register struct stentry *s; struct stentry **hp; int first; int i, j; extern char *types[]; char *sp; /* print procedure statement and argument list */ for(p = prevcomments ; p ; p = p->nextp) { sp = p->datap; fprintf(codefile, "%s\n", sp+1); cfree(sp); } frchain(&prevcomments); if(tailor.procheader) fprintf(codefile, "%s\n", tailor.procheader); if(procname) { p2str(" "); if(procname->vtype==TYSUBR || procname->vtype==TYUNDEFINED) p2key(FSUBROUTINE); else { p2str(types[procname->vtype]); p2key(FFUNCTION); } p2str(procname->sthead->namep); } else if(procclass == PRBLOCK) { p2stmt(0); p2key(FBLOCKDATA); } else { p2str("c main program"); if(tailor.ftnsys == CRAY) { p2stmt(0); p2key(FPROGRAM); } } if(thisargs) { p2str( "(" ); first = 1; for(p = thisargs ; p ; p = p->nextp) if( (q=p->datap)->vextbase) { if(first) first = 0; else p2str(", "); p2str(ftnames[q->vextbase]); } else for(i=0 ; ivbase[i]) { if(first) first = 0; else p2str( ", " ); p2str(ftnames[j]); } p2str( ")" ); } /* first put out declarations of variables that are used as adjustable dimensions */ y = 0; z = & y; for(hp = hashtab ; hpvarp) ) if(q->tag==TNAME && q->vadjdim && q!=procname) z = z->nextp = mkchain(q,CHNULL); dclchain(y, NOCOMMON); frchain(&y); /* then declare the rest of the arguments */ z = & y; for(p = thisargs ; p ; p = p->nextp) if(p->datap->vadjdim == 0) z = z->nextp = mkchain(p->datap,CHNULL); dclchain(y, NOCOMMON); frchain(&y); frchain(&thisargs); /* now put out declarations for common blocks */ for(p = commonlist ; p ; p = p->nextp) prcomm(p->datap); TEST fprintf(diagfile, "\nend of common declarations"); z = &y; /* next the other variables that are in the symbol table */ for(hp = hashtab ; hpvarp) ) if(q->tag==TNAME && q->vadjdim==0 && q->vclass!=CLCOMMON && q->vclass!=CLARG && q!=procname && (tailor.dclintrinsics || q->vproc!=PROCINTRINSIC) ) z = z->nextp = mkchain(q,CHNULL); dclchain(y, NOCOMMON); frchain(&y); TEST fprintf(diagfile, "\nend of symbol table, start of gonelist"); /* now declare variables that are no longer in the symbol table */ dclchain(gonelist, NOCOMMON); TEST fprintf(diagfile, "\nbeginning of hidlist"); dclchain(hidlist, NOCOMMON); dclchain(tempvarlist, NOCOMMON); /* finally put out equivalence statements that are generated because of structure and character variables */ for(p = genequivs; p ; p = p->nextp) { q = p->datap; p2stmt(0); first = 1; p2key(FEQUIVALENCE); p2str( "(" ); for(i=0; ivbase[i]) { if(first) first = 0; else p2str( ", " ); p2str(ftnames[ q->vbase[i] ]); p2str( "(1" ); if(q1 = q->vdim) for(q1 = q1->datap; q1 ; q1 = q1->nextp) p2str( ",1" ); p2str( ")" ); } p2str( ")" ); } frchain(&genequivs); } prcomm(p) register ptr p; { register int first; register ptr q; p2stmt(0); p2key(FCOMMON); p2str( "/" ); p2str(p->comname); p2str("/ "); first = 1; for(q = p->comchain ; q; q = q->nextp) { if(first) first=0; else p2str(", "); prname(q->datap); } dclchain(p->comchain, DOCOMMON); } prname(p) register ptr p; { register int i; switch(p->tag) { case TCONST: p2str(p->leftp); return; case TNAME: if( ! p->vdcldone ) if(p->blklevel == 1) dclit(p); else mkftnp(p); for(i=0; ivbase[i]) { p2str(ftnames[p->vbase[i]]); return; } fatal1("prname: no fortran types for name %s", p->sthead->namep); case TFTNBLOCK: for(i=0; ivbase[i]) { p2str(ftnames[p->vbase[i]]); return; } return; default: badtag("prname", p->tag); } } dclchain(chp, okcom) ptr chp; int okcom; { extern char *ftntypes[]; register ptr pn, p; register int i; int first, nline; ptr q,v; int ntypes; int size,align,mask; int subval; nline = 0; for(pn = chp ; pn ; pn = pn->nextp) { p = pn->datap; if( (p->tag==TNAME || p->tag==TTEMP) && p->vext!=0) { if(nline%NAMESPERLINE == 0) { p2stmt(0); p2key(FEXTERNAL); } else p2str(", "); ++nline; p2str(ftnames[p->vextbase]); } } for(pn = chp ; pn ; pn = pn->nextp) { p = pn->datap; if( (p->tag==TNAME || p->tag==TTEMP) && p->vtype==TYSTRUCT && p->vclass!=CLARG) { ntypes = 0; for(i=0; ivbase[i]) ++ntypes; if(ntypes > 1) genequivs = mkchain(p, genequivs); } } for(i=0; inextp) { p = pn->datap; if( (p->tag==TNAME || p->tag==TTEMP) && p->vtype!=TYSUBR && p->vbase[i]!=0 && (okcom || p->vclass!=CLCOMMON) ) { if(nline%NAMESPERLINE == 0) { p2stmt(0); p2str(ftntypes[i]); } else p2str( ", " ); ++nline; p2str(ftnames[p->vbase[i]]); first = -1; if(p->vtype==TYCHAR || p->vtype==TYSTRUCT || (p->vtype==TYLCOMPLEX && tailor.lngcxtype==NULL)) { p2str( "(" ); sizalign(p, &size,&align,&mask); p2int( size/tailor.ftnsize[i] ); first = 0; } else if(p->vdim) { p2str( "(" ); first = 1; } if(first >=0) { if(q = p->vdim) for(q = q->datap ; q ; q = q->nextp) { if(q->upperb == 0) { q->upperb = mkint(1); if(q->lowerb) { frexpr(q->lowerb); q->lowerb = 0; } } else if(q->lowerb) { v = fold( mknode(TAROP,OPMINUS, mkint(1),cpexpr(q->lowerb)) ); v = fold( mknode(TAROP,OPPLUS, cpexpr(q->upperb),v) ); q->lowerb = 0; q->upperb = v; } if(first) first = 0; else p2str( ", " ); v = q->upperb = simple(RVAL,q->upperb); if( (v->tag==TNAME && v->vclass==CLARG) || (isicon(v,&subval) && subval>0) ) prname(v); else dclerr("invalid array bound", p->sthead->namep); } p2str( ")" ); } } }(( } } { v = fold( mknode(TAROP,OPMINUS, mkint(1),cpexpr(q->lowerb)) ); v = fold( mknode(TAROP,OPPLUS, cpexpr(q->upperb),v) ); q->lowerb = 0; q->upperb = v; } if(first) first = 0; else p2str( ", " ); v = q->upperb = simple(RVAL,q->upperb); if( (v->tag==TNAME && v->vclass==CLARG) || (isicon(v,&subval) && subval>0) ) prname(v); else dclerr("invalid array bound", p->sthead->namep); } p2str( ")" ); } } }cmd/efl/defs 644 0 33 24740 2405462512 6237 #include "stdio.h" #define NO 0 #define YES 1 #define CNULL (char *) 0 #define PNULL (ptr) 0 #define CHNULL (chainp) 0 #define HASHEDTABLE 1 #define XL 6 #define NFTNTYPES 7 #define NEFLTYPES 13 #define MEMSIZE 12240 #define YYMAXDEPTH 250 #define MAXSTNO 200 #define MAXINCLUDEDEPTH 10 #define MAXBLOCKDEPTH 30 #define MAXINDIFS 150 #define MAXFTNAMES 250 #define MAXEFLNAMES 300 #define MAXSWITCH 100 #define EXECPOOL 20 #define EXPRPOOL 40 #define NAMESPERLINE 6 #define LINESPACES 66 #define INDENTSPACES 3 typedef int *ptr; extern struct chain { ptr nextp; ptr datap; } ; typedef struct chain *chainp; extern int yylineno; extern int dumpic; extern int memdump; extern int dbgflag; extern int nowarnflag; extern int nocommentflag; extern int verbose; extern int dumpcore; #define TEST if(dbgflag) #define efgetc (efmacp?*efmacp++:getc(yyin)) extern char msg[]; #define UNIX 1 #define GCOS 2 #define GCOSBCD 3 #define CRAY 4 #define IBM 5 #define FIELDMAX 32768. #define ALLOC(x) (struct x *) intalloc(sizeof(struct x)) extern FILE *diagfile; extern FILE *codefile; extern FILE *yyin; extern FILE *fileptrs[]; extern char *filenames[]; extern char *basefile; extern int filelines[]; extern int filedepth; extern char *efmacp; extern char *filemacs[]; extern int pushchars[]; extern struct fileblock *iifilep; extern int mem[]; extern unsigned int nmemused; extern long int totfreed; extern long int totalloc; extern int nhid[]; extern int ndecl[]; extern int indifs[]; extern int nxtindif; extern int afterif; extern neflnames; extern int nftnch; extern int nftncont; extern char ftnames[MAXFTNAMES][7]; extern int nftnames; extern int nftnm0; extern int impltype[]; extern int ftnmask[]; extern double fieldmax; extern int ftnefl[]; extern int eflftn[]; extern ptr thisexec; extern ptr thisctl; extern int pushlex; extern int igeol; extern int ateof; extern int eofneed; extern int forcerr; extern int comneed; extern int optneed; extern int defneed; extern int lettneed; extern int iobrlevel; extern int prevbg; extern chainp hidlist; extern chainp commonlist; extern chainp tempvarlist; extern chainp temptypelist; extern chainp gonelist; extern int blklevel; extern int ctllevel; extern int dclsect; extern int instruct; extern int inbound; extern int inproc; extern int ncases; extern ptr comments; extern ptr prevcomments; extern ptr genequivs; extern ptr arrays; extern ptr generlist; extern ptr knownlist; extern int graal; extern ptr procname; extern int procclass; extern ptr thisargs; extern int langopt; extern int dotsopt; extern int dbgopt; extern int dbglevel; extern int stnos[]; extern int nxtstno; extern int constno; extern int labno; extern int nerrs; extern int nbad; extern int nwarns; struct headbits { unsigned int tag:8; unsigned int subtype:8; unsigned int blklevel:8; }; extern struct fileblock { FILE *fileptr; char filename[20]; }; extern struct fileblock *ibfile; extern struct fileblock *icfile; extern struct fileblock *idfile; extern struct fileblock *iefile; extern struct comentry { struct headbits header; char comname[7]; long int comleng; unsigned int cominit:2; chainp comchain; } ; extern struct stentry { struct headbits header; char *namep; ptr varp; int hashval; }; extern struct stentry *hashtab[]; extern struct stentry **hashend; extern struct typeblock { struct headbits header; ptr sthead; ptr strdesc; int stralign; int strsize; int basetypes; } ; extern struct keyblock { struct headbits header; ptr sthead; } ; extern struct varblock { struct headbits header; ptr sthead; ptr vinit; unsigned int vadjdim:1; unsigned int vdcldone:1; unsigned int vdclstart:1; unsigned int vnamedone:1; unsigned int vprec:1; unsigned int vext:1; unsigned int vproc:2; unsigned int needpar:1; unsigned int vtype:4; unsigned int vclass:3; ptr vtypep; ptr vdim; ptr vsubs; ptr voffset; int vextbase; int vbase[NFTNTYPES]; } ; extern struct atblock { int atprec; int attype; int atext; int atclass; ptr attypep; ptr atcommon; ptr atdim; } ; extern struct dimblock { ptr nextp; ptr lowerb; ptr upperb; } ; extern struct exprblock /* must be same size as varblock */ { struct headbits header; ptr leftp; ptr rightp; unsigned int vadjdim:1; unsigned int vdcldone:1; unsigned int vdclstart:1; unsigned int vnamedone:1; unsigned int vprec:1; unsigned int vext:1; unsigned int vproc:2; unsigned int needpar:1; unsigned int vtype:4; unsigned int vclass:3; ptr vtypep; ptr vdim; ptr vsubs; ptr voffset; int vextbase; int vbase[NFTNTYPES]; } ; extern struct execblock { struct headbits header; ptr temps; int labelno; unsigned int uniffable:1; unsigned int brnchend:1; unsigned int labeled:1; unsigned int copylab:1; unsigned int labdefined:1; unsigned int labused:1; unsigned int labinacc:1; ptr execdesc; ptr prevexec; int nxtlabno; int nftnst; } ; extern struct ctlblock /* must be same size as execblock */ { struct headbits header; ptr loopvar; ptr loopctl; ptr prevctl; int nextlab; int breaklab; int xlab; int indifn; } ; extern struct caseblock { struct headbits header; ptr nextcase; int labelno; unsigned int uniffable:1; unsigned int brnchend:1; unsigned int labeled:1; unsigned int copylab:1; unsigned int labdefined:1; unsigned int labused:1; unsigned int labinacc:1; ptr casexpr; } ; extern struct labelblock { struct headbits header; ptr sthead; int labelno; unsigned int uniffable:1; unsigned int brnchend:1; unsigned int labeled:1; unsigned int copylab:1; unsigned int labdefined:1; unsigned int labused:1; unsigned int labinacc:1; } ; extern struct defblock { struct headbits header; ptr sthead; char *valp; } ; extern struct doblock { struct headbits header; ptr dovar; ptr dopar[3]; } ; extern struct fieldspec { struct headbits header; ptr flbound; ptr frange; ptr frshift; int fanymore; } ; extern struct genblock { struct headbits header; ptr nextgenf; char *genname; char *genfname[NEFLTYPES]; int genftype[NEFLTYPES]; } ; extern struct knownname { struct headbits header; ptr nextfunct; char *funcname; int functype; } ; extern struct iostblock { struct headbits header; ptr leftp; /* padding */ ptr right; /* padding */ unsigned int vadjdim:1; unsigned int vdcldone:1; unsigned int vdclstart:1; unsigned int vnamedone:1; unsigned int vprec:1; unsigned int vext:1; unsigned int vproc:2; unsigned int needpar:1; unsigned int vtype:4; unsigned int vclass:3; int iokwd; ptr iounit; ptr iolist; int iojunk[7]; /* padding */ } ; extern struct ioitem { struct headbits header; ptr ioexpr; char *iofmt; int nrep; } ; struct iogroup { struct headbits header; struct doblock *doptr; char *iofmt; int nrep; ptr ioitems; }; extern struct tailoring { int ftnsys; int errmode; int charcomp; int ftnin; int ftnout; int ftncontnu; char *procheader; char *lngcxtype; char *lngcxprefix; int ftnchwd; int ftnsize[NFTNTYPES]; int ftnalign[NFTNTYPES]; char *dfltfmt[NEFLTYPES]; int hollincall; int deltastno; int dclintrinsics; int ftn77; } tailor; struct system { char *sysname; short sysno; short chperwd; short idig; short rdig; short ddig; } systab[]; /* Declarations of popular functions */ char *copys(), *convic(), *procnm(); ptr cpexpr(), compconst(), simple(), mknode(), mkint(), mkconst(); ptr intalloc(), calloc(), allexcblock(), allexpblock(); ptr mkcall(), coerce(), fold(), builtin(), gent(), errnode(); ptr arg1(), arg2(), arg4(); struct stentry *name(); chainp mkchain(), hookup(); /*Block tags */ #define TAROP 1 #define TASGNOP 2 #define TLOGOP 3 #define TRELOP 4 #define TCALL 5 #define TREPOP 6 #define TLIST 7 #define TCONST 8 #define TNAME 9 #define TERROR 10 #define TCOMMON 11 #define TSTRUCT 12 #define TSTFUNCT 13 #define TEXEC 14 #define TTEMP 15 #define TDEFINE 16 #define TKEYWORD 17 #define TLABEL 18 #define TCASE 19 #define TNOTOP 20 #define TNEGOP 21 #define TDOBLOCK 22 #define TCONTROL 23 #define TKNOWNFUNCT 24 #define TFIELD 25 #define TGENERIC 26 #define TIOSTAT 27 #define TIOGROUP 28 #define TIOITEM 29 #define TFTNBLOCK 30 /* Operator subtypes */ #define OPPLUS 1 #define OPMINUS 2 #define OPSTAR 3 #define OPSLASH 4 #define OPPOWER 5 #define OPNOT 6 #define OPAND 7 #define OP2AND 8 #define OP2OR 9 #define OPOR 10 #define OPEQ 11 #define OPLT 12 #define OPGT 13 #define OPLE 14 #define OPGE 15 #define OPNE 16 #define OPLPAR 17 #define OPRPAR 18 #define OPEQUALS 19 #define OPCOMMA 20 #define OPASGN 0 #define OPREL 0 /* Simplification types */ #define LVAL 1 #define RVAL 2 #define SUBVAL 3 #define IFVAL 4 /* Parser return values */ #define PARSERR 1 #define PARSEOF 2 #define PARSOPT 3 #define PARSDCL 4 #define PARSDEF 5 #define PARSPROC 6 /* Symbol table types */ #define TYUNDEFINED 0 #define TYINT 1 #define TYREAL 2 #define TYLREAL 3 #define TYLOG 4 #define TYCOMPLEX 5 #define TYLCOMPLEX 6 #define TYCHAR 7 #define TYSTRUCT 8 #define TYLABEL 9 #define TYSUBR 10 #define TYFIELD 11 #define TYHOLLERITH 12 /* Fortran types */ #define FTNINT 0 #define FT((NREAL 1 #define FTNLOG 2 #define FTNCOMPLEX 3 #define FTNDOUBLE 4 #define FTNCHAR 5 #define FTNDCOMPLEX 6 /* symbol table classes */ #define CLUNDEFINED 0 #define CLARG 1 #define CLVALUE 2 #define CLSTAT 3 #define CLAUTO 4 #define CLCOMMON 5 #define CLMOS 6 #define CLEXT 7 /* values of vproc */ #define PROCUNKNOWN 0 #define PROCNO 1 #define PROCYES 2 #define PROCINTRINSIC 3 /* values of procclass */ #define PRBLOCK 1 #define PRMAIN 2 #define PRSUBR 3 #define PRFUNCT 4 /* ctlblock subtypes */ #define STNULL 1 #define STIF 2 #define STIFELSE 3 #define STREPEAT 4 #define STWHILE 5 #define STFOR 6 #define STDO 7 #define STSWITCH 8 #define STRETURN 9 #define STGOTO 10 #define STCALL 11 #define STPROC 12 /* intermediate code definitions */ #define ICEOF 0 #define ICBEGIN 1 #define ICKEYWORD 2 #define ICOP 3 #define ICNAME 4 #define ICCONST 5 #define ICLABEL 6 #define ICMARK 7 #define ICINDENT 8 #define ICCOMMENT 9 #define ICINDPTR 10 #define ICBLANK 11 #define FCONTINUE 2 #define FCALL 3 #define FDO 4 #define FIF1 5 #define FIF2 6 #define FGOTO 7 #define FRETURN 8 #define FREAD 9 #define FWRITE 10 #define FFORMAT 11 #define FSTOP 12 #define FDATA 13 #define FEQUIVALENCE 14 #define FCOMMON 15 #define FEXTERNAL 16 #define FREWIND 17 #define FBACKSPACE 18 #define FENDFILE 19 #define FSUBROUTINE 20 #define FFUNCTION 21 #define FPROGRAM 22 #define FBLOCKDATA 23 #define FEND 24 /* I/O error handling options */ #define IOERRNONE 0 #define IOERRIBM 1 #define IOERRFORT77 2 INUE 2 #define FCALL 3 #define Fcmd/efl/error.c 644 0 33 2557 2405462514 6654 #include "defs" char *linerr() { static char buff[50]; register int i; for(i = filedepth; i>0 && filenames[i]==NULL ; --i) ; if(i > 0) sprintf(buff, "on line %d of file %s", yylineno, filenames[i]); else sprintf(buff, "on line %d", yylineno); return(buff); } laberr(s,t) char *s; char *t; { errmess("Label error", s, t); } exprerr(s,t) char *s; ptr t; { errmess("Expression error", s, t); } execerr(s,t) char *s, *t; { errmess("Error", s, t); } errmess(m,s,t) char *m, *s, *t; { fprintf(diagfile, "**%s %s: ", m, linerr()); if(s) fprintf(diagfile, s, t); fprintf(diagfile, "\n"); ++nerrs; } dclerr(s, n) char *s, *n; { extern int nerrs; fprintf(diagfile, "**Error %s: Declaration for %s: %s\n", linerr(), n, s); ++nerrs; } badtag(routine, tag) char *routine; int tag; { char buff[100]; sprintf(buff, "impossible tag %d in routine %s", tag, routine); fatal(buff); } fatal1(s,t) char *s; int t; { sprintf(msg, s, t); fatal(msg); } fatal(s) char *s; { fprintf(diagfile, "\n***Compiler error %s.", linerr()); if(s) fprintf(diagfile, " %s.", s); fprintf(diagfile, "\n"); fflush(stdout); if(dumpcore) abort(0); else { rmiis(); exit(-1); } } warn1(s,t) char *s; int t; { sprintf(msg, s, t); warn(msg); } warn(s) char *s; { ++nwarns; if( !nowarnflag) fprintf(diagfile, "*Warning: %s\n", s); } yyerror(s) char *s; { errmess(s, CNULL, CNULL); } ; fatal(buff); } fatal1(s,t) char *s; int t; { sprintf(msg, s, t); fatal(msg); } fatal(s) char *s; { fprintf(diagfile, "\n***Compiler errocmd/efl/exec.c 644 0 33 15603 2405462516 6465 #include "defs" exlab(n) register int n; { if(n==0 && thisexec->labelno && !(thisexec->labused)) { thisexec->labused = 1; n = thisexec->labelno; } if(!prevbg || n!=0) /* avoid empty statement */ { if(comments && !afterif) putcomment(); putic(ICBEGIN, n); putic(ICINDENT, ctllevel); if(n != 0) if(stnos[n] != 0) fatal("statement number changed"); else stnos[n] = ( nxtstno += tailor.deltastno) ; TEST fprintf(diagfile, "LABEL %d\n", n); thisexec->nftnst++; afterif = 0; } } exgoto(n) int n; { exlab(0); exgo1(n); } exgoind(n) int n; { exlab(0); putic(ICKEYWORD,FGOTO); putic(ICINDPTR,n); TEST fprintf(diagfile, "goto indirect %o\n", n); } exgo1(n) int n; { putic(ICKEYWORD,FGOTO); putic(ICLABEL,n); TEST fprintf(diagfile, "goto %d\n", n); } excompgoto(labs,index) ptr labs; register ptr index; { register int first; register ptr p; index = simple(LVAL,index); if(tailor.ftn77) exlab(0); else { int ncases = 0; for(p = labs ; p ; p = p->nextp) ++ncases; exif1( mknode(TLOGOP, OPAND, mknode(TRELOP,OPGT, cpexpr(index), mkint(0)), mknode(TRELOP,OPLE, cpexpr(index), mkint(ncases)) )); } putic(ICKEYWORD, FGOTO); putic(ICOP,OPLPAR); first = 1; for(p = labs ; p ; p = p->nextp) { if(first) first = 0; else putic(ICOP,OPCOMMA); putic(ICLABEL,p->datap); } putic(ICOP,OPRPAR); frchain(&labs); putic(ICOP,OPCOMMA); prexpr(index); frexpr(index); TEST fprintf(diagfile, "computed goto\n"); } excall(p) register ptr p; { register ptr q1, q2, q3; ptr mkholl(), exioop(); if(p->tag==TNAME || p->tag==TFTNBLOCK) p = mkcall(p, PNULL); if(p->tag == TERROR) { frexpr(p); return; } if(p->tag != TCALL) badtag("excall", p->tag); q1 = p->leftp; q2 = (q1->tag==TFTNBLOCK ? q1 : q1->sthead->varp); if(q2->vtype!=TYUNDEFINED && q2->vtype!=TYSUBR) { dclerr("attempt to use a variable as a subroutine", p->sthead->namep); frexpr(p); return; } q1->vtype = q2->vtype = TYSUBR; if(q1->vdcldone==0) dclit(q1); if(q1->tag == TNAME) { if( equals(q2->sthead->namep, "stop") ) { exlab(0); putic(ICKEYWORD, FSTOP); TEST fprintf(diagfile,"stop "); if( (q1 = p->rightp) && (q1 = q1->leftp) ) prexpr( simple(RVAL, q1->datap) ); goto done; } if( ioop(q2->sthead->namep) ) { exioop(p,NO); goto done; } } p = simple(RVAL,p); exlab(0); putic(ICKEYWORD,FCALL); TEST fprintf(diagfile, "call "); /* replace character constant arguments with holleriths */ if( (q1=p->rightp) && tailor.hollincall) for(q1 = q1->leftp ; q1 ; q1 = q1->nextp) if( (q2 = q1->datap)->tag==TCONST && q2->vtype==TYCHAR) { q2->vtype = TYHOLLERITH; frexpr(q2->vtypep); q2->vtypep = 0; q2->leftp = mkholl(q3 = q2->leftp); cfree(q3); } prexpr( p ); done: frexpr(p); } ptr mkholl(p) register char *p; { register char *q, *t, *s; int n; n = strlen(p); q = convic(n); s = t = calloc(n + 2 + strlen(q) , 1); while(*q) *t++ = *q++; *t++ = 'h'; while(*t++ = *p++ ) ; return(s); } ptr ifthen() { ptr p; ptr addexec(); p = addexec(); thisexec->brnchend = 0; if(thisexec->nftnst == 0) { exlab(0); putic(ICKEYWORD,FCONTINUE); thisexec->nftnst = 1; } if(thisexec->nftnst>1 || thisexec->labeled || thisexec->uniffable ) { if(thisctl->breaklab == 0) thisctl->breaklab = nextlab(); indifs[thisctl->indifn] = thisctl->breaklab; } else thisctl->breaklab = 0; return(p); } exasgn(l,o,r) ptr l; int o; ptr r; { exlab(0); if(l->vdcldone == 0) dclit(l); frexpr( simple(LVAL , mknode(TASGNOP,o,l,r)) ); } exretn(p) ptr p; { if(p) { if(procname && procname->vtype && procname->vtype!=TYCHAR && (procname->vtype!=TYLCOMPLEX || tailor.lngcxtype!=NULL) ) { if(p->tag!=TNAME || p->sthead!=procname->sthead) exasgn( cpexpr(procname) , OPASGN, p); } else execerr("can only return values in a function", PNULL); } else if(procname && procname->vtype) warn("function return without data value"); exlab(0); putic(ICKEYWORD, FRETURN); TEST {fprintf(diagfile, "exec: return( " ); prexpr(p); fprintf(diagfile, ")\n" ); } } exnull() { if(thisexec->labelno && !(thisexec->labused) ) { exlab(0); putic(ICKEYWORD,FCONTINUE); } } exbrk(opnext,levskip,btype) int opnext; ptr levskip; int btype; { if(opnext && (btype==STSWITCH || btype==STPROC)) execerr("illegal next", PNULL); else if(!opnext && btype==STPROC) exretn(PNULL); else brknxtlab(opnext,levskip,btype); TEST fprintf(diagfile, "exec: %s\n", (opnext ? "next" : "exit")); } exif(e) register ptr e; { int tag; if( (tag = e->tag)==TERROR || e->vtype!=TYLOG) { frexpr(e); e = mkconst(TYLOG, ".true."); if(tag != TERROR) execerr("non-logical conditional expression in if", PNULL); } TEST fprintf(diagfile, "exif called\n"); e = simple(RVAL,e); exlab(0); putic(ICKEYWORD,FIF2); indifs[thisctl->indifn = nextindif()] = 0; putic(ICINDPTR, thisctl->indifn); putic(ICOP,OPLPAR); prexpr(e); putic(ICOP,OPRPAR); putic(ICMARK,0); putic(ICOP,OPLPAR); prexpr(e = simple(RVAL, mknode(TNOTOP,OPNOT,e,PNULL))); putic(ICOP,OPRPAR); putic(ICMARK,0); afterif = 1; frexpr(e); } exifgo(e,l) ptr e; int l; { exlab(0); exif1(e); exgo1(l); } exif1(e) register ptr e; { e = simple(RVAL,e); exlab(0); putic(ICKEYWORD,FIF1); putic(ICOP,OPLPAR); TEST fprintf(diagfile, "if1 "); prexpr( e ); frexpr(e); putic(ICOP,OPRPAR); putic(ICBLANK, 1); } brkcase() { ptr bgnexec(); if(ncases==0 /* && thisexec->prevexec->brnchend==0 */ ) { exbrk(0, PNULL, 0); addexec(); bgnexec(); } ncases = 1; } brknxtlab(opnext, levp, btype) int opnext; ptr levp; int btype; { register ptr p; int levskip; levskip = ( levp ? convci(levp->leftp) : 1); if(levskip <= 0) { execerr("illegal break count %d", levskip); return; } for(p = thisctl ; p!=0 ; p = p->prevctl) if( (btype==0 || p->subtype==btype) && p->subtype!=STIF && p->subtype!=STPROC && (!opnext || p->subtype!=STSWITCH) ) if(--levskip == 0) break; if(p == 0) { execerr("invalid break/next", PNULL); return; } if(p->subtype==STREPEAT && opnext) exgoind(p->indifn); else if(opnext) exgoto(p->nextlab); else { if(p->breaklab == 0) p->breaklab = nextlab(); exgoto(p->breaklab); } } ptr doloop(p1,p2,p3) ptr p1; ptr p2; ptr p3; { regis((ter ptr p, q; register int i; int val[3]; p = ALLOC(doblock); p->tag = TDOBLOCK; if(p1->tag!=TASGNOP || p1->subtype!=OPASGN || p1->leftp->tag!=TNAME) { p->dovar = gent(TYINT, PNULL); p->dopar[0] = p1; } else { p->dovar = p1->leftp; p->dopar[0] = p1->rightp; frexpblock(p1); } if(p2 == 0) { p->dopar[1] = p->dopar[0]; p->dopar[0] = mkint(1); } else p->dopar[1] = p2; p->dopar[2] = p3; for(i = 0; i<3 ; ++i) { if(q = p->dopar[i]) { if( (q->tag==TNAME || q->tag==TTEMP) && (q->vsubs || q->voffset) ) p->dopar[i] = simple(RVAL,mknode(TASGNOP,0, gent(TYINT,PNULL), q)); else p->dopar[i] = simple(LVAL, coerce(TYINT, q) ); if(isicon(p->dopar[i], &val[i])) { if(val[i] <= 0) execerr("do parameter out of range", PNULL); } else val[i] = -1; } } if(val[0]>0 && val[1]>0 && val[0]>val[1]) execerr("do parameters out of order", PNULL); return(p); } r[2] = p3; for(i = 0; i<3 ; ++i) { if(q = p->dopar[i]) { if( (q->tag==TNAME || q->tag==TTEMP) && (q->vsubs || q->cmd/efl/field.c 644 0 33 4430 2405462520 6573 #include "defs" ptr mkfield(q) register ptr q; { register ptr p; if(!instruct) goto err; else if(q->upperb == 0) dclerr("must have upper bound in field spcification", ""); else { p = ALLOC(fieldspec); p->tag = TFIELD; if(q->lowerb) { p->flbound = q->lowerb; p->frange = mknode(TAROP,OPPLUS,mknode(TAROP,OPMINUS, q->upperb, cpexpr(q->lowerb)), mkconst(TYINT,"1") ); } else { p->flbound = mkconst(TYINT,"1"); p->frange = q->upperb; } p->frange = simple(RVAL,p->frange); if(p->frange->tag != TCONST) { dclerr("field range must be constant", ""); cfree(p); goto err; } cfree(q); return(p); } err: cfree(q); return( errnode() ); } ptr extrfield(p) register ptr p; { register ptr t; t = p->vtypep; p->vtype = TYINT; p->vtypep = 0; if(t->frshift) p = mknode(TAROP,OPSLASH, p, cpexpr(t->frshift)); if(t->fanymore) p = mkcall(builtin(TYINT, "mod"), arg2(p, cpexpr(t->frange)) ); p = mknode(TAROP,OPPLUS, p, cpexpr(t->flbound)); return(p); } ptr setfield(e) ptr e; { ptr lp, rp; register ptr f, p; int subt; lp = cpexpr(e->leftp); rp = e->rightp; subt = e->subtype; f = lp->vtypep; lp->vtype = TYINT; lp->vtypep = 0; if(subt==OPPLUS || subt==OPMINUS) { if(f->frshift) rp = mknode(TAROP,OPSTAR,rp,cpexpr(f->frshift)); } else { if(subt != OPASGN) { rp = mknode(TAROP,subt, extrfield(cpexpr(e->leftp)), rp); subt = OPASGN; } rp = coerce(TYINT,rp); if(f->flbound) rp = simple(RVAL, mknode(TAROP,OPMINUS,rp,cpexpr(f->flbound)) ); if(f->frshift==0) { if(f->fanymore) { p = mknode(TAROP,OPSLASH,cpexpr(lp),cpexpr(f->frange)); p->needpar = YES; p = mknode(TAROP,OPSTAR,cpexpr(f->frange),p); rp = mknode(TAROP,OPPLUS,p,rp); } } else if(f->fanymore==0) { rp = mknode(TAROP,OPSTAR,cpexpr(f->frshift),rp); p = mkcall(builtin(TYINT,"mod"), arg2(cpexpr(lp),cpexpr(f->frshift)) ); rp = mknode(TAROP,OPPLUS, p,rp); } else { p = mknode(TAROP,OPSLASH,cpexpr(lp),cpexpr(f->frshift)); p = mkcall(builtin(TYINT,"mod"), arg2(p, cpexpr(f->frange)) ); if( rp->tag!=TCONST || !equals(rp->leftp, "0") ) p = mknode(TAROP,OPMINUS, p, rp); rp = mknode(TAROP,OPSTAR, cpexpr(f->frshift), p); rp = mknode(TAROP,OPMINUS, cpexpr(lp), rp); } } frexpr( simple(LVAL, mknode(TASGNOP,subt,lp,rp) )); return(extrfield(e->leftp)); } ltin(TYINT,"mod"), arg2(cpexpr(lp),cpexpr(f->frshift)) ); rp = mknode(TAROP,OPPLUS, p,rp); } else { p = mknode(TAROP,OPSLASH,cpexpr(lp),cpexpr(f->frshift)); p = mkcall(builtin(TYINT,"mod"), arg2(p, cpexpr(f->frange))cmd/efl/fixuplex 755 0 33 576 2405462522 7127 ed - lex.yy.c < 0) { if(rket==1) { rket = 2; RET(RBRACK); } else { rket = 0; RET(EOS); } } if(eofneed) return(0); if(forcerr) return(-1); . w q ! lse { p = mknode(TAROP,OPSLASH,cpexp/,5< /,"cmd/efl/free.c 644 0 33 6141 2405462524 6436 #include "defs" cleanst() { register ptr p, q; ptr pjunk; int i; register struct stentry *s; struct stentry **hp; TEST fprintf(diagfile, "\n"); clcomm(); for(hp = hashtab ; hpvarp ) { if( q->blklevel > 0 ) { TEST fprintf(diagfile, "remove %s from st\n", s->namep); switch(q->tag) { case TNAME: frvar(q); break; case TSTRUCT: frtype(q); break; case TDEFINE: frdef(q); break; case TLABEL: cfree(q); break; default: sprintf(msg, "cleanst: illegal entry tag %d, ptr %o, name %s.", q->tag, q, s->namep); fatal(msg); } } else if( q->tag == TNAME ) { q->vdcldone = 0; q->vnamedone = 0; q->vextbase = 0; for(i = 0 ; ivbase[i] = 0; } } if(s->blklevel > 0) name(s->namep,-1); else break; } for(p = gonelist ; p ; p = p->nextp) frvar(p->datap); frchain(&gonelist); if(hidlist) fatal("cleanst: hidlist not empty"); for(p = hidlist ; p ; p = p->nextp) frvar(p->datap); frchain(&hidlist); for(p = tempvarlist ; p ; p = p->nextp) frvar(p->datap); frchain(&tempvarlist); for(p = temptypelist ; p ; p = p->nextp) if(p->datap->blklevel > 0) frtype(p->datap); frchain(&temptypelist); q = &arrays; for(p = arrays ; p ; p = q->nextp) if(p->datap == 0) { q->nextp = p->nextp; p->nextp = 0; pjunk = p; frchain(&pjunk); } else q = p; } frvar(p) register ptr p; { register ptr q, qn; if(p==0) return; switch(p->tag) { case TSTRUCT: frtype(p); return; case TDEFINE: frdef(p); return; case TNAME: case TTEMP: if(q = p->vdim) for(q = q->datap ; q ; q = qn) { if(q->lowerb) frexpr(q->lowerb); frexpr(q->upperb); qn = q->nextp; cfree(q); } if(p->vdim) p->vdim->datap = 0; if(p->vtype == TYCHAR) frexpr(p->vtypep); frexpblock(p); return; default: badtag("frvar",p->tag); } } frtype(p) register ptr p; { register ptr q; if(p==0 || p->tag!=TSTRUCT) fatal("frtype: bad argument"); for(q = p->strdesc ; q; q = q->nextp) frvar(q->datap); frchain( &(p->strdesc) ); cfree(p); } frdef(p) ptr p; { cfree(p->valp); cfree(p); } frexpr(p) register ptr p; { register ptr q; if(p == 0) return; switch(p->tag) { case TAROP: case TRELOP: case TLOGOP: case TASGNOP: case TREPOP: case TCALL: frexpr(p->rightp); case TNOTOP: case TNEGOP: frexpr(p->leftp); break; case TCONST: cfree(p->leftp); if(p->vtype == TYCHAR) frexpr(p->vtypep); if(p->rightp) cfree(p->rightp); break; case TLIST: for(q = p->leftp ; q ; q = q->nextp) frexpr(q->datap); frchain( &(p->leftp) ); break; case TTEMP: case TNAME: case TFTNBLOCK: if(p->vsubs) frexpr(p->vsubs); if(p->voffset) frexpr(p->voffset); case TERROR: /*debug*/ case TIOSTAT: break; default: badtag("frexpr", p->tag); } frexpblock(p); } clcomm() /* clean up common lists */ { ptr p, oldp, q; for(oldp = &commonlist ; p = oldp->nextp ; ) { q = p->datap; if(q->blklevel > 0) { frchain( &(q->comchain) ); cfree(q); oldp->nextp = p->nextp; cfree(p); } else oldp = p; } } ain( &(p->leftp) ); break; case TTEMP: case TNAME: case TFTNBLOCK: if(p->vsubs) frexpr(p->vsubs); if(p->voffset) frexpr(p->voffset); case TERROR: /*debug*/ case TIOSTAT: break; default: badtag("frexpr", p->tag); } frexpblock(p); } clcomm() /* clean up common lists */ { ptr p, oldp, q; for(oldp = &commonlist ; p = oldp->nextp ; ) { q = p->datap; if(q->blklevel > 0) { frchaincmd/efl/gram.dcl 644 0 33 10711 2405462545 7004 dcls1: dcl1 | dcls1 EOS | dcls1 EOS dcl1 { $$ = hookup($1,$3); } ; dcl1: dcl | varlist ; dcl: attrs vars { attvars($1,$2); $$ = $2; } | attrs LBRACK dcls1 RBRACK { attvars($1,$3); $$ = $3; } | INITIAL initlist { $$ = 0; } | IMPLICIT letton implist lettoff { $$ = 0; } | EQUIVALENCE equivsets { $$ = 0; } | EQUIVALENCE equivlist { mkequiv($2); $$ = 0; } ; dcls: dcl | dcls EOS | dcls EOS dcl { $$ = hookup($1,$3); } ; initlist: init | initlist COMMA init ; init: lhs(( ASGNOP {ininit = YES; } expr = { ininit = NO; mkinit($1,$4); frexpr($1); } ; implist: impgroup | implist COMMA impgroup; ; impgroup: impspec { setimpl(imptype, 'a', 'z'); } | impspec LPAR impsets RPAR ; impspec: specs { imptype = $1->attype; cfree($1); } ; impsets: impset | impsets COMMA impset ; impset: LETTER { setimpl(imptype, $1, $1); } | LETTER ADDOP LETTER { setimpl(imptype, $1, $3); } ; equivsets: equivset | equivsets COMMA equivset ; equivset: LPAR equivlist RPAR { mkequiv($2); } ; equivlist: lhs COMMA lhs { $$ = mkchain($1, mkchain($3,CHNULL)); } | equivlist COMMA lhs { $$ = hookup($1, mkchain($3,CHNULL)); } ; attrs: attr | attrs attr { attatt($1,$2); } ; attr: spec dim { $1->atdim = $2; } | array dim { $$ = ALLOC(atblock); $$->atdim = $2; } ; dim: { $$ = 0; } | dimbound ; dimbound: LPAR { inbound = 1; } bounds RPAR { inbound = 0; $$ = arrays = mkchain($3,arrays); } ; bounds: bound | bounds COMMA bound { hookup($1,$3); } ; bound: ubound { $$ = ALLOC(dimblock); $$->lowerb = 0; $$->upperb = $1; } | expr COLON ubound { $$ = ALLOC(dimblock); $$->lowerb = $1; $$->upperb = $3; } ; ubound: expr | MULTOP { $$ = 0; } ; vars: { $$ = 0; } | varlist ; varlist: var | varlist COMMA var { hookup($1,$3); } ; var: varname dim { if($2!=0) if($1->vdim==0) $1->vdim = $2; else if(!eqdim($2,$1->vdim)) dclerr("multiple dimension", $1->namep); $$ = mkchain($1,CHNULL); } | varname dim ASGNOP { ininit = YES; } expr { ininit = NO; if($3!=OPASGN) dclerr("illegal initialization operator", $1->sthead->namep); if($2!=0) if($1->vdim==0) $1->vdim = $2; else if(!eqdim($2,$1->vdim)) dclerr("multiple dimension", $1->sthead->namep); if($5!=0 && $1->vinit!=0) dclerr("multiple initialization", $1->sthead->namep); $1->vinit = $5; $$ = mkchain($1,CHNULL); } ; varname: NAME { $$ = mkvar($1); } ; specs: specarray | specs specarray { attatt($1,$2); } ; specarray: spec | array dimbound { $$ = ALLOC(atblock); $$->atdim = $2; } ; spec: sclass { $$ = ALLOC(atblock); if($1 == CLEXT) $$->atext = 1; $$->atclass = $1; } | comclass contnu { $$ = ALLOC(atblock); $$->atclass = CLCOMMON; $$->atcommon = $1; } | stype { $$ = ALLOC(atblock); $$->attype = $1; } | CHARACTER LPAR expr RPAR { $$ = ALLOC(atblock); $$->attype = TYCHAR; $$->attypep = $3; } | FIELD LPAR bound RPAR { $$ = ALLOC(atblock); $$->attype = TYFIELD; $$->attypep = mkfield($3); } | deftype { $$ = ALLOC(atblock); $$->attype = TYSTRUCT; $$->attypep = $1; } | prec { $$ = ALLOC(atblock); $$->atprec = $1; } ; sclass: AUTOMATIC { $$ = CLAUTO; fprintf(diagfile,"AUTOMATIC not yet implemented\n"); } | STATIC { $$ = CLSTAT; } | INTERNAL { $$ = CLSTAT; } | VALUE { $$ = CLVALUE; fprintf(diagfile, "VALUE not yet implemented\n"); } | EXTERNAL { $$ = CLEXT; } ; comclass: COMMON LPAR comneed comname RPAR { $$ = $4; } | COMMON MULTOP comneed comname MULTOP { $$ = $4; } ; comneed: { comneed = 1; } ; comname: { $$ = mkcomm(""); } | COMNAME ; stype: INTEGER { $$ = TYINT; } | REAL { $$ = TYREAL; } | COMPLEX { $$ = TYCOMPLEX; } | LOGICAL { $$ = TYLOG; } | DOUBLE PRECISION { $$ = TYLREAL; /* holdover from Fortran */ } | DOUBLEPRECISION { $$ = TYLREAL; /* holdover from Fortran */ } ; deftype: STRUCTNAME { $$ = $1->varp; } | STRUCT structname contnu struct { $$ = mkstruct($2,$4); } | STRUCT struct { $$ = mkstruct(PNULL,$2); } ; structname: NAME { if($1->varp && $1->varp->blkleveltag = TSTRUCT; } | STRUCTNAME { if($1->varp) if($1->varp->blklevelnamep); } ; struct: LBRACK { ++instruct; } dcls { --instruct; } RBRACK EOS { $$ = $3; prevv = -1; } ; array: ARRAY | DIMENSION ; prec: LONG { $$ = 1; } | SHORT { $$ = 0; } ; mkstruct($2,$4); } | STRUCT struct { $$ = mkstruct(Pcmd/efl/gram.exec 644 0 33 15073 2412625424 7167 exec: beginexec exec1 { TEST fprintf(diagfile, "exec done\n"); } ; beginexec: { $$ = bgnexec(); if(ncases > 0) ncases = 0; } ; exec1: lhs ASGNOP expr { if($1->tag==TCALL) { dclerr("no statement functions in EFL", $1->sthead->namep); frexpr($1); frexpr($3); } else exasgn($1,$2,$3); } | DOUBLEADDOP lhs { exasgn($2, $1, mkint(1) ); } | lhs1 { excall($1); } | CALL lhs1 { excall($2); } | debug exec enddebug | LBRACK beginblock stats endblock RBRACK { TEST fprintf(diagfile, "exec: { stats }\n"); addexec(); } | labels exec1 { thisexec->labeled = 1; } | control { thisexec->uniffable = 1; popctl(); } | branch { thisexec->brnchend = 1; } | iostat { exio($1, 0); } | null { exnull(); } | ESCAPE { exnull(); putsii(ICCOMMENT, $1); cfree($1); exnull(); } ; null: { TEST fprintf(diagfile, "exec:empty\n"); } | CONTINUE { TEST fprintf(diagfile, "exec: continue\n"); } ; beginblock: { thisexec->copylab = 1; ++blklevel; dclsect = 1; ndecl[blklevel] = 0; nhid [blklevel] = 0; } ; endblock: { if(ndecl[blklevel]) unhide(); --blklevel; dclsect = 0; } ; labels: NAME COLON contnu { mklabel($1,YES); } | CONST contnu { mklabel(mkilab($1),YES); } | CONST contnu COLON contnu { mklabel(mkilab($1),YES); } | DEFAULT COLON contnu { brkcase(); mkcase(PNULL,1); } | CASE { brkcase(); } caselist COLON contnu ; caselist: expr { mkcase($1,1); } | caselist COMMA expr { mkcase($3,1); } ; control: ifclause contnu exec EOS ELSE elsecode contnu exec { TEST fprintf(diagfile, "if-then-else\n"); i = $3->brnchend & $8->brnchend; addexec(); $$ = addexec(); thisexec->brnchend = i; TEST fprintf(diagfile, "exec: if(expr) exec else exec\n"); } | ifclause contnu exec EOS { TEST fprintf(diagfile, "if-then\n"); pushlex = 1; yyclearin; $$ = ifthen(); TEST fprintf(diagfile, "exec: if(expr) exec\n"); } | repeat contnu exec until { TEST fprintf(diagfile, "repeat done\n"); } | leftcont contnu exec { TEST fprintf(diagfile, "exec: control exec\n"); $$ = addexec(); } ; ifclause: IF LPAR expr RPAR { pushctl(STIF,$3); } ; elsecode: { if(thisctl->breaklab == 0) thisctl->breaklab = nextlab(); /* if(thisexec->prevexec->brnchend == 0) */ exgoto(thisctl->breaklab); exlab( indifs[thisctl->indifn] = nextlab() ); } ; repeat: REPEAT { pushctl(STREPEAT, PNULL); } ; until: EOS { pushlex = 1; yyclearin; $$ = addexec(); exgoto(thisctl->xlab); TEST fprintf(diagfile, " no until\n"); } | EOS UNTIL LPAR expr RPAR { $$ = addexec(); exnull(); exlab( indifs[thisctl->indifn] = nextlab() ); exifgo(mknode(TNOTOP,OPNOT,$4,PNULL), thisctl->xlab); TEST fprintf(diagfile, "until\n"); } ; branch: RETURN { exretn(PNULL); } | RETURN expr { exretn($2); } | break | GOTO label { exgoto($2); } | GO NAME label { if( !equals($2->namep, "to") ) execerr("go %s ??\n", $2->namep); else exgoto($3); } | GOTO parlablist compgotoindex { excompgoto($2, $3); } | GO NAME parlablist compgotoindex { if(!equals($2->namep, "to") ) execerr("go %s ??\n", $2->namep); else excompgoto($3, $4); } ; parlablist: LPAR lablist RPAR { $$ = $2; } ; lablist: label { $$ = mkchain($1,CHNULL); } | lablist COMMA label { $$ = hookup($1, mkchain($3,CHNULL) ); } ; compgotoindex: expr | COMMA expr { $$ = $2; } ; label: NAME { $$ = mklabel($1,NO); } | CONST { $$ = mklabel(mkilab($1),NO); } | CASE expr { $$ = mkcase($2,0); } | DEFAULT { $$ = mkcase(PNULL,0); } ; break: brk { exbrk($1, PNULL, 0); } | brk CONST { exbrk($1, $2, 0); } | brk blocktype { exbrk($1, PNULL, $2); } | brk CONST blocktype { exbrk($1,$2,$3); } | brk blocktype CONST { exbrk($1,$3,$2); } ; brk: NEXT { $$ = 1; } | BREAK { $$ = 0; } | EXIT { $$ = 0; } ; blocktype: WHILE { $$ = STWHILE; } | FOR { $$ = STFOR; } | DO { $$ = STDO; } | REPEAT { $$ = STREPEAT; } | SWITCH { $$ = STSWITCH; } | PROCEDURE { $$ = STPROC; } ; leftcont: WHILE LPAR exprnull RPAR { pushctl(STWHILE, $3); TEST fprintf(diagfile, "while(expr)\n"); } | for forinit fortest forincr { exlab(thisctl->xlab); if($3) exifgo(mknode(TNOTOP,OPNOT,$3,PNULL), thisctl->breaklab = nextlab() ); else exnull(); TEST fprintf(diagfile, "for (forlist)\n"); } | SWITCH LPAR expr RPAR { pushctl(STSWITCH, simple(LVAL,$3)); TEST fprintf(diagfile, "switch (expr)\n"); } | do { pushctl(STDO, $1); TEST fprintf(diagfile, "do loop\n"); } ; do: DO expr EOS contnu { $$ = doloop($2, PNULL, PNULL); } | DO expr contnu { $$ = doloop($2, PNULL, PNULL); } | DO expr COMMA expr EOS contnu { $$ = doloop($2, $4, PNULL); } | DO expr COMMA expr contnu { $$ = doloop($2, $4, PNULL); } | DO expr COMMA expr COMMA expr EOS contnu { $$ = doloop($2,$4,$6); } | DO expr COMMA expr COMMA expr contnu { $$ = doloop($2,$4,$6); } ; for: FOR LPAR { pushctl(STFOR, PNULL); } ; forinit: exec COMMA { exgoto(thisctl->xlab); exlab(thisctl->nextlab); addexec(); } | exec EOS contnu COMMA { exgoto(thisctl->xlab); exlab(thisctl->nextlab); addexec(); } ; fortest: exprnull COMMA ; forincr: exec RPAR { addexec(); } | exec EOS contnu RPAR { addexec(); } ; exprnull: { $$ = 0; } | expr ; debug: DEBUG contnu { if(dbgopt) ++dbglevel; } ; enddebug: { if(dbgopt) --dbglevel; } ; iostat: iokwd LPAR iounit COMMA iolist RPAR { $$ = mkiost($1, $3, $5); } ; iokwd: READBIN { $$ = 0; } | WRITEBIN { $$ ((= 1; } | READ { $$ = 2; } | WRITE { $$ = 3; } ; iounit: expr | { $$ = NULL; } ; iolist: ioitem { $$ = mkchain($1,CHNULL); } | iolist COMMA ioitem { hookup($1, mkchain($3,CHNULL)); } ; ioitem: expr { $$ = mkioitem($1,CNULL); } | expr COLON format { $$ = mkioitem($1,$3); } | COLON format { $$ = mkioitem(PNULL,$2); } | iobrace { $$ = mkiogroup($1, CNULL, PNULL); } | do iobrace { $$ = mkiogroup($2, CNULL, $1); } | do iobrace COLON format { $$ = mkiogroup($2,$4,$1); } | iobrace COLON format { $$ = mkiogroup($1,$3,PNULL); } ; iobrace: LBRACK { ++iobrlevel; } iolist RBRACK { --iobrlevel; $$ = $3; } ; format: letter { $$ = mkformat($1, PNULL, PNULL); } | letter LPAR expr RPAR { $$ = mkformat($1, $3, PNULL); } | letter LPAR expr COMMA expr RPAR { $$ = mkformat($1,$3,$5); } | letton CONST lettoff { $$ = $2->leftp; frexpblock($2); } ; letter: letton LETTER lettoff { $$ = $2; } ; letton: { lettneed = YES;} ; lettoff: { lettneed = NO; } ; %% setyydeb() { #ifdef YYDEBUG extern int yydebug; yydebug = 1; #endif } { ++iobrlevel; } iolist RBRACK { --iobrlevel; $$ = $3; } ; format: letter { $$ = mkformat($1, PNULL, PNULL); } | letter LPAR expr RPAR { $$ = mkformat($1, $3, PNULL); } | letter LPAR expr COMMA expr RPAR { $$ = mkformat($1,$3,$5); } | letton CONST lettoff { $$ = $2->leftp; frexpblock($2); } ; letter: letton LETTER lettoff { $$ = $2; } ; letton: { lettneed = YES;} ; lettoff: { lettneed = NO; } ; %% setyydeb() { cmd/efl/gram.expr 644 0 33 6035 2405462554 7204 expr: lhs { if($1->tag == TCALL) $1 = funcinv($1); if($1->vtype==TYUNDEFINED && $1->vext==0) impldecl($1); else if($1->tag==TNAME && $1->vdcldone==0 && $1->vext==0 && !inbound) dclit($1); if($1->vtype==TYFIELD) $$ = extrfield($1); } | CONST | logcon { $$ = mkconst(TYLOG, ($1 == TRUE ? ".true." : ".false.") ); } | specs parexprs { $$ = typexpr($1,$2); } | sizeof | lengthof | parexprs { if( !ininit && $1->tag== TLIST) $$ = compconst($1); else $1->needpar = 1; } | expr ADDOP expr { $$ = mknode(TAROP,$2,$1,$3); } | expr MULTOP expr { $$ = mknode(TAROP,$2,$1,$3); } | expr POWER expr { $$ = mknode(TAROP,$2,$1,$3); } | ADDOP expr %prec MULTOP { if($1==OPMINUS) $$ = mknode(TNEGOP,OPMINUS, $2, PNULL); else $$ = $2; } | DOUBLEADDOP lhs %prec MULTOP { $$ = mknode(TASGNOP,$1,$2,mkint(1)); } | expr RELOP expr { $$ = mknode(TRELOP,$2,$1,$3); } | expr OR expr { $$ = mknode(TLOGOP,$2,$1,$3); } | expr AND expr { $$ = mknode(TLOGOP,$2,$1,$3); } | NOT expr { $$ = mknode(TNOTOP,$1,$2,PNULL); } | lhs ASGNOP expr { if($1->tag == TCALL) { exprerr("may not assign to a function", CNULL); $$ = errnode(); } else $$ = mknode(TASGNOP,$2,$1,$3); } | expr REPOP expr { $$ = mknode(TREPOP,0,$1,$3); } | iostat | error { $$ = errnode(); } ; lhs: lhs1 { if($1->tag==TNAME && $1->vdcldone==0 && $1->vsubs==0 && $1->vext==0 && !inbound) dclit($1); } ; lhs1: lhsname | lhsname parexprs { if($2->tag!=TLIST) $2 = mknode(TLIST,0, mkchain($2,CHNULL), PNULL); if($1->vdim) { if($1->vdcldone==0 && $1->vext==0) dclit($1); $$ = subscript($1,$2); } else $$ = mkcall($1,$2); } | lhs QUALOP NAME { $$ = strucelt($1,$3); } | lhs QUALOP NAME parexprs { if($4->tag != TLIST) $4 = mknode(TLIST,0, mkchain($4,CHNULL), PNULL); $$ = subscript(strucelt($1,$3), $4); } | lhs ARROW STRUCTNAME { $$ = mkarrow($1,$3); } ; lhsname: NAME { if($1->varp == 0) mkvar($1); if(inbound) $1->varp->vadjdim = 1; $$ = cpexpr($1->varp); } ; parexprs: LPAR RPAR { $$ = mknode(TLIST, 0, PNULL, PNULL); } | LPAR expr RPAR { $$ = $2; } | LPAR exprlist RPAR { $$ = mknode(TLIST,0,$2,PNULL); } ; exprlist: expr COMMA expr { $$ = mkchain($1, mkchain($3, CHNULL) ); } | exprlist COMMA expr { hookup($1, mkchain($3,CHNULL) ); } ; sizeof: SIZEOF LPAR expr RPAR { $$ = esizeof($3->vtype, $3->vtypep, $3->vdim); frexpr($3); } | SIZEOF LPAR specs RPAR { if($3->attype==TYREAL && $3->atprec) $3->attype = TYLREAL; $$ = esizeof($3->attype, $3->attypep, $3->atdim); cfree($3); } | SIZEOF LPAR CHARACTER RPAR { $$ = mkint(tailor.ftnsize[FTNINT]/tailor.ftnchwd); } ; lengthof: LENGTHOF LPAR expr RPAR { $$ = elenof($3->vtype, $3->vtypep, $3->vdim); frexpr($3); } | LENGTHOF LPAR specs RPAR { $$ = elenof($3->attype, $3->attypep, $3->atdim); cfree($3); } | LENGTHOF LPAR CHARACTER RPAR { $$ = mkint(1); } ; logcon: logval | QUALOP logval QUALOP { $$ = $2; } ; logval: TRUE | FALSE ; $$ = esizeof($3->attype, $3->attypep, $3->atdim); cfree($3); } | SIZEOF LPAR CHARACTER RPAR { $$ = mkint(tailor.ftnsize[FTNINT]/tailor.ftnchwd); } ; lengthof: LENGTHOF LPAR expr RPAR { $$ = elenof($3->vtype, $3->vtypep, $3->vdim); frexpr($3); } | LENGTHOF LPAR specs RPAR { $$ = elenof($3->attype, $3->attypep, $3->atdim); cfree($3); } | LENGTHOF LPAR CHARACTER RPAR { $$ = mkint(1); } ; logcon: logval | QUALOP logval QUALOP { $$ = $2; } ;cmd/efl/gram.head 644 0 33 10337 2405462565 7151 %{ #include "defs" ptr bgnexec(), addexec(), bgnproc(), mkvar(), mkcomm(), mkstruct(), mkarrow(); ptr mkiost(), mkioitem(), mkiogroup(), mkformat(); ptr funcinv(), extrfield(), typexpr(), strucelt(), mkfield(); ptr esizeof(), elenof(), mkilab(); ptr ifthen(), doloop(); struct varblock *subscript(); %} %start graal %union { int ival; ptr pval; char *cval; } %left COLON %left COMMA %right ASGNOP /* = +- -= ... */ %right REPOP /* $ */ %left OR /* | || */ %left AND /* & && */ %left NOT %nonassoc RELOP /* LT GT LE GE EQ NE */ %left ADDOP /* + - */ %left MULTOP /* * / */ %right POWER /* ** ^ */ %left ARROW QUALOP /* -> . */ %type dcl stat exec stats proc args arg varname comname structname %type dcl1 dcls1 dcl dcls specs equivlist attrs attr comclass %type dim dimbound bounds bound ubound vars varlist var %type specarray spec deftype struct %type expr lhs parexprs iostat sizeof lengthof lhs1 lhsname exprlist %type beginexec control until lablist parlablist compgotoindex %type do exprnull fortest iostat iounit iolist ioitem iobrace %type format %type stype sclass prec logcon logval brk blocktype letter iokwd label %token CONST OPTNAME COMNAME STRUCTNAME NAME ESCAPE %token RELOP ASGNOP OR AND NOT ADDOP MULTOP POWER DOUBLEADDOP %token LETTER TRUE FALSE %{ extern int prevv; extern YYSTYPE prevl; ptr p; ptr procattrs; int i,n; static int imptype; static int ininit =NO; %} %% graal: { graal = PARSEOF; } | option endchunk { graal = PARSOPT; } | dcl endchunk { graal = PARSDCL; doinits($1); frchain( & $1); } | procst EOS stats end { endproc(); graal = PARSPROC; } | define endchunk { graal = PARSDEF; } | exec endchunk { graal = PARSERR; } | error { graal = PARSERR; errmess("Syntax error", "", ""); } ; endchunk: EOS { eofneed = 1; } stat: dcl EOS { if(!dclsect) warn("declaration amid executables"); $$ = bgnexec(); TEST fprintf(diagfile,"stat: dcl\n"); doinits($1); frchain( & $1); } | exec EOS { if(dclsect && $1->tag!=TSTFUNCT) dclsect = 0; TEST fprintf(diagfile, "stat: exec\n"); } | define EOS { $$ = bgnexec(); } | error EOS { yyerrok; errmess("Syntax error", "", ""); $$ = bgnexec(); } ; stats: { $$ = bgnexec(); } | stats { thisexec->copylab = 1; } stat { $$ = addexec(); thisexec->copylab = 0; } ; procst: oproc { procname = 0; thisargs = 0; if(procclass == 0) procclass = PRMAIN; goto proctype; } | oproc procname { thisargs = 0; goto proctype; } | oproc procname LPAR RPAR { thisargs = 0; goto proctype; } | oproc procname LPAR args RPAR { thisargs = $4; proctype: if(procattrs) if(procname == 0) dclerr("attributes on unnamed procedure", ""); else { attvars(procattrs, mkchain(procname,CHNULL)); procclass = PRFUNCT; } fprintf(diagfile, "Procedure %s:\n", procnm() ); if(verbose) fprintf(diagfile, " Pass 1\n"); } ; procname: NAME { procname = mkvar($1); extname(procname); } ; oproc: proc { procattrs = 0; } | attrs proc { procattrs = $1; if(procclass == 0) procclass = PRFUNCT; } ; proc: PROCEDURE { $$ = bgnproc(); procclass = 0; } | BLOCKDATA { $$ = bgnproc(); procclass = PRBLOCK; } ; args: arg { $$ = mkchain($1,CHNULL); } | args COMMA arg { hookup($1, mkchain($3,CHNULL) ); } ; arg: varname { if($1->vclass == CLUNDEFINED) $1->vclass = CLARG; else dclerr("argument already used", $1->sthead->namep); } ; option: optson optionnames { optneed = 0; } ; optson: OPTION { if(blklevel > 0) { execerr("Option statement inside procedure", ""); execerr("procedure %s terminated prematurely", procnm()); endproc(); } optneed = 1; } ; optionnames: | optionnames optelt | optionnames optelt COMMA ; optelt: OPTNAME { setopt($1,CNULL); cfree($1); } | OPTNAME ASGNOP OPTNAME { setopt($1,$3); cfree($1); cfree($3); } | OPTNAME ASGNOP CONST { setopt($1,$3->leftp); cfree($1); cfree($3); } ; define:(( DEFINE { defneed = 1; } ; end: END { if(thisctl->subtype != STPROC) execerr("control stack not empty upon END", ""); exnull(); popctl(); } ; contnu: { igeol=1; /* continue past newlines */ } ; 1; } ; optionnames: | optionnames optelt | optionnames optelt COMMA ; optelt: OPTNAME { setopt($1,CNULL); cfree($1); } | OPTNAME ASGNOP OPTNAME { setopt($1,$3); cfree($1); cfree($3); } | OPTNAME ASGNOP CONST { setopt($1,$3->leftp); cfree($1); cfree($3); } ; define:cmd/efl/icfile.c 644 0 33 5022 2405462570 6746 #include "defs" struct { char chars[ 10 ]; }; crii() /* create names for intermediate files */ { #ifdef unix sprintf(icfile->filename, "eflc.%d", getpid()); sprintf(idfile->filename, "efld.%d", getpid()); sprintf(iefile->filename, "efle.%d", getpid()); #endif #ifdef gcos sprintf(icfile->filename, "code.efl"); sprintf(idfile->filename, "data.efl"); sprintf(iefile->filename, "equv.efl"); #endif } rmiis() { rmii(icfile); rmii(idfile); rmii(iefile); } rmii(p) /* discard the intermediate file */ struct fileblock *p; { #ifdef unix if(p) { fclose(p->fileptr); unlink(p->filename); } #endif #ifdef gcos if(p) fclose(p->fileptr, "d"); #endif } opiis() { opii(icfile); opii(idfile); opii(iefile); } opii(p) /* open the intermediate file for writing */ struct fileblock *p; { #ifdef unix if( (p->fileptr = fopen(p->filename, "w")) == NULL) fatal("cannot open intermediate file"); #endif #ifdef gcos if( (p->fileptr = fopen(p->filename, "wi")) == NULL) fatal("cannot open intermediate file"); #endif } swii(p) struct fileblock *p; { iifilep = p; } putii(w,n) int *w, n; { if( fwrite(w,sizeof(int),n, iifilep->fileptr) != n) fatal("write error"); } getii(w, n) int *w, n; { if( fread(w,sizeof(int), n, iifilep->fileptr) != n) fatal("read error"); } cliis() { clii(icfile); clii(idfile); clii(iefile); } clii(p) /* close the intermediate file */ struct fileblock *p; { #ifdef unix fclose(p->fileptr); #endif #ifdef gcos fclose(p->fileptr, "rl"); #endif } rewii(p) /* close and rewind the intermediate file for reading */ struct fileblock *p; { swii(p); putic(ICEOF,0); clii(p); #ifdef unix if( (p->fileptr = fopen(p->filename, "r")) == NULL) fatal("cannot open intermediate file"); #endif #ifdef gcos if( (p->fileptr = fopen(p->filename, "ri")) == NULL) fatal("cannot open intermediate file"); #endif } putic(c,p) int c; int p; { int w[2]; prevbg = (c==ICINDENT); w[0] = c; w[1] = p; putii(w,2); } getic(p) int *p; { int w[2]; getii(w,2); *p = w[1]; return( w[0] ); } putsii(l, p) int l; char *p; { int word; register int i, m, n; n = strlen(p); putic(l, n); m = (n/sizeof(int)) ; while(m-- > 0) { for(i=0 ; i 0) { for(i=0 ; i 0) { for(i=0 ; i 0) { for(i=0 ; ikeyn ; ++p) mkkeywd(p->keyn, p->keyval); } geninit() { struct gen { char *genn; int restype; char *specn; int argtype; } *p; static struct gen gens[] = { "abs", TYINT, "iabs", TYINT, "abs", TYREAL, "abs", TYREAL, "abs", TYLREAL, "dabs", TYLREAL, "abs", TYCOMPLEX, "cabs", TYREAL, "sin", TYREAL, "sin", TYREAL, "sin", TYLREAL, "dsin", TYLREAL, "sin", TYCOMPLEX, "csin", TYCOMPLEX, "cos", TYREAL, "cos", TYREAL, "cos", TYLREAL, "dcos", TYLREAL, "cos", TYCOMPLEX, "ccos", TYCOMPLEX, "atan", TYREAL, "atan", TYREAL, "atan", TYLREAL, "datan", TYLREAL, "atan2", TYREAL, "atan2", TYREAL, "atan2", TYLREAL, "datan2", TYLREAL, "sqrt", TYREAL, "sqrt", TYREAL, "sqrt", TYLREAL, "dsqrt", TYLREAL, "sqrt", TYCOMPLEX, "csqrt", TYCOMPLEX, "log", TYREAL, "alog", TYREAL, "log", TYLREAL, "dlog", TYLREAL, "log", TYCOMPLEX, "clog", TYCOMPLEX, "log10", TYREAL, "alog10", TYREAL, "log10", TYLREAL, "dlog10", TYLREAL, "exp", TYREAL, "exp", TYREAL, "exp", TYLREAL, "dexp", TYLREAL, "exp", TYCOMPLEX, "cexp", TYCOMPLEX, "int", TYREAL, "int", TYINT, "int", TYLREAL, "idint", TYINT, "mod", TYINT, "mod", TYINT, "mod", TYREAL, "amod", TYREAL, "mod", TYLREAL, "dmod", TYLREAL, "min", TYINT, "min0", TYINT, "min", TYREAL, "amin1", TYREAL, "min", TYLREAL, "dmin1", TYLREAL, "max", TYINT, "max0", TYINT, "max", TYREAL, "amax1", TYREAL, "max", TYLREAL, "dmax1", TYLREAL, "sign", TYREAL, "sign", TYREAL, "sign", TYINT, "isign", TYINT, "sign", TYLREAL, "dsign", TYLREAL, 0, 0, 0, 0 } ; for(p = gens ; p->genn ; ++p) mkgeneric(p->genn, p->restype, p->specn, p->argtype); } knowninit() { struct known { char *knownn; int knowntype; } *p; static struct known knowns[ ] = { "abs", TYREAL, "iabs", TYINT, "dabs", TYLREAL, "aint", TYREAL, "int", TYINT, "idint", TYINT, "amod", TYREAL, "mod", TYINT, "amax0", TYREAL, "amax1", TYREAL, "max0", TYINT, "max1", TYINT, "dmax1", TYLREAL, "amin0", TYREAL, "amin1", TYREAL, "min0", TYINT, "min1", TYINT, "dmin1", TYLREAL, "float", TYREAL, "ifix", TYINT, "sign", TYREAL, "isign", TYINT, "dsign", TYLREAL, "dim", TYREAL, "idim", TYINT, "sngl", TYREAL, "real", TYREAL, "aimag", TYREAL, "dble", TYLREAL, "cmplx", TYCOMPLEX, "conjg", TYCOMPLEX, "exp", TYREAL, "dexp", TYLREAL, "cexp", TYCOMPLEX, "alog", TYREAL, "dlog", TYLREAL, "clog", TYCOMPLEX, "alog10", TYREAL, "dlog10", TYLREAL, "sin", TYREAL, "dsin", TYLREAL, "csin", TYCOMPLEX, "cos", TYREAL, "dcos", TYLREAL, "ccos", TYCOMPLEX, "tanh", TYREAL, "sqrt", TYREAL, "dsqrt", TYLREAL, "csqrt", TYCOMPLEX, "atan", TYREAL, "datan", TYLREAL, "atan2", TYREAL, "datan2", TYLREAL, "dmod", TYLREAL, "cabs", TYREAL, 0, 0 }; for(p = knowns ; p->knownn ; ++p) mkknown(p->knownn, p->knowntype); } TYREAL, "dexp", TYLREAL, "cexp", cmd/efl/io.c 644 0 33 25610 2405462575 6154 #include #include "defs" static int lastfmtchar; static int writeop; static int needcomma; ptr mkiost(kwd,unit,list) int kwd; ptr unit; ptr list; { register ptr p; if(unit!=NULL && unit->vtype!=TYINT) { execerr("I/O unit must be an integer", ""); return(NULL); } p = allexpblock(); p->tag = TIOSTAT; p->vtype = TYINT; p->iokwd = kwd; p->iounit = unit; p->iolist = list; return(p); } struct iogroup *mkiogroup(list, format, dop) ptr list; char *format; ptr dop; { register struct iogroup *p; p = ALLOC(iogroup); p->tag = TIOGROUP; p->doptr = dop; p->iofmt = format; p->ioitems = list; return(p); } ptr exio(iostp, errhandle) struct iostblock *iostp; int errhandle; { ptr unit, list; int fmtlabel, errlabel, endlabel, jumplabel; ptr errval; int fmtio; if(iostp == NULL) return( errnode() ); unit = iostp->iounit; list = iostp->iolist; /* kwd= 0 binary input 2 formatted input 1 binary output 3 formatted output */ writeop = iostp->iokwd & 01; if( fmtio = (iostp->iokwd & 02) ) fmtlabel = ((nextlab() ; frexpblock(iostp); errval = 0; endlabel = 0; if(errhandle) { switch(tailor.errmode) { default: execerr("no error handling ", ""); return( errnode() ); case IOERRIBM: /* ibm: err=, end= */ jumplabel = nextlab(); break; case IOERRFORT77: /* New Fortran Standard: iostat= */ break; } errval = gent(TYINT, PNULL); } if(unit) unit = simple(RVAL, unit); else unit = mkint(writeop ? tailor.ftnout : tailor.ftnin); if(unit->tag!=TCONST && (unit->tag!=TNAME || unit->vsubs!=0)) unit = simple(LVAL, mknode(TASGNOP,OPASGN,gent(TYINT,PNULL),unit)); simlist(list); exlab(0); putic(ICKEYWORD, (writeop ? FWRITE : FREAD) ); putic(ICOP, OPLPAR); prexpr(unit); frexpr(unit); if( fmtio ) { putic(ICOP, OPCOMMA); putic(ICLABEL, fmtlabel); } if(errhandle) switch(tailor.errmode) { case IOERRIBM: putic(ICOP,OPCOMMA); putsii(ICCONST, "err ="); putic(ICLABEL, errlabel = nextlab() ); if(!writeop) { putic(ICOP,OPCOMMA); putsii(ICCONST, "end ="); putic(ICLABEL, endlabel = nextlab() ); } break; case IOERRFORT77: putic(ICOP,OPCOMMA); putsii(ICCONST, "iostat ="); putname(errval); break; } putic(ICOP,OPRPAR); putic(ICBLANK, 1); needcomma = NO; doiolist(list); if(fmtio) { exlab(fmtlabel); putic(ICKEYWORD, FFORMAT); putic(ICOP, OPLPAR); lastfmtchar = '('; doformat(1, list); putic(ICOP, OPRPAR); } friolist(list); if(errhandle && tailor.errmode==IOERRIBM) { exasgn(cpexpr(errval), OPASGN, mkint(0) ); exgoto(jumplabel); exlab(errlabel); exasgn(cpexpr(errval), OPASGN, mkint(1) ); if(endlabel) { exgoto(jumplabel); exlab(endlabel); exasgn(cpexpr(errval), OPASGN, mknode(TNEGOP,OPMINUS,mkint(1),PNULL) ); } exlab(jumplabel); } return( errval ); } doiolist(list) ptr list; { register ptr p, q; register struct doblock *dop; for(p = list ; p ; p = p->nextp) { switch( (q = p->datap) ->tag) { case TIOGROUP: if(dop = q->doptr) { if(needcomma) putic(ICOP, OPCOMMA); putic(ICOP, OPLPAR); needcomma = NO; } doiolist(q->ioitems); if(dop) { putic(ICOP,OPCOMMA); prexpr(dop->dovar); putic(ICOP, OPEQUALS); prexpr(dop->dopar[0]); putic(ICOP, OPCOMMA); prexpr(dop->dopar[1]); if(dop->dopar[2]) { putic(ICOP, OPCOMMA); prexpr(dop->dopar[2]); } putic(ICOP, OPRPAR); needcomma = YES; } break; case TIOITEM: if(q->ioexpr) { if(needcomma) putic(ICOP, OPCOMMA); prexpr(q->ioexpr); needcomma = YES; } break; default: badtag("doiolist", q->tag); } } } doformat(nrep, list) int nrep; ptr list; { register ptr p, q; int k; ptr arrsize(); if(nrep > 1) { fmtnum(nrep); fmtop(OPLPAR); } for(p = list ; p ; p = p->nextp) switch( (q = p->datap) ->tag) { case TIOGROUP: if(q->iofmt) prfmt(q->nrep, q->iofmt); else { doformat(q->nrep>0 ? q->nrep : (q->doptr ? repfac(q->doptr) : 1), q->ioitems); } break; case TIOITEM: if(q->iofmt == NULL) break; if(q->nrep==0 && q->ioexpr && q->ioexpr->vdim) { if( ! isicon(arrsize(q->ioexpr), &k) ) execerr("io of adjustable array", ""); else prfmt(k, q->iofmt); } else prfmt(q->nrep, q->iofmt); } if(nrep > 1) fmtop(OPRPAR); } fmtop(op) register int op; { register c; c = (op==OPLPAR ? '(' : (op==OPRPAR ? ')' : 'x') ); fmtcom(c); putic(ICOP, op); lastfmtchar = c; } fmtnum(k) int k; { fmtcom('1'); prexpr( mkint(k) ); lastfmtchar = ','; /* prevent further comma after factor*/ } /* separate formats with comma unless already a slash*/ fmtcom(c) int c; { if( c!='/' && c!=')' && lastfmtchar!='/' && lastfmtchar!='(' && lastfmtchar!=',' ) { putic(ICOP, OPCOMMA); lastfmtchar = ','; } } prfmt(nrep, str) int nrep; char *str; { char fmt[20]; register int k, k0, k1, k2; register char *t; fmtcom(nrep>1 ? '1' : str[0]); if(nrep > 1) { fmtnum(nrep); fmtop(OPLPAR); } switch(str[0]) { case 'd': case 'e': case 'g': if(writeop) { putsii(ICCONST, "1p"); break; } case 'f': putsii(ICCONST, "0p"); break; case 'c': k = convci(str+1); k0 = tailor.ftnchwd; k1 = k / k0; k2 = k % k0; if(k1>0 && k2>0) sprintf(fmt, "(%da%d,a%d)",k1,k0,k2); else if(k1>1) sprintf(fmt, "(%da%d)", k1, k0); else sprintf(fmt, "a%d", k); putsii(ICCONST, fmt); lastfmtchar = 'f'; /* last char isnt operator */ goto close; default: break; } putsii(ICCONST,str); /* if the format is an nH, act as if it ended with a non-operator character */ if( isdigit(str[0]) ) { for(t = str+1 ; isdigit(*t) ; ++t); ; if(*t=='h' || *t=='H') { lastfmtchar = 'f'; goto close; } } lastfmtchar = str[ strlen(str)-1 ]; close: if(nrep > 1) fmtop(OPRPAR); } friolist(list) ptr list; { register ptr p, q; register struct doblock *dop; for(p = list; p; p = p->nextp) { switch ( (q = p->datap) ->tag) { case TIOGROUP: if(dop = q->doptr) { frexpr(dop->dovar); frexpr(dop->dopar[0]); frexpr(dop->dopar[1]); if(dop->dopar[2]) frexpr(dop->dopar[2]); cfree(dop); } friolist(q->ioitems); break; case TIOITEM: if(q->ioexpr) frexpr(q->ioexpr); break; default: badtag("friolist", q->tag); } if(q->iofmt) cfree(q->iofmt); cfree(q); } frchain( &list ); } simlist(p) register ptr p; { register ptr q, ep; struct iogroup *enloop(); for( ; p ; p = p->nextp) switch( (q = p->datap) ->tag ) { case TIOGROUP: simlist(q->ioitems); break; case TIOITEM: if(ep = q->ioexpr) { /* if element is a subaggregate, need an implied do loop */ if( (ep->voffset || ep->vsubs) && (ep->vdim || ep->vtypep) ) p->datap = enloop(q); else q->ioexpr = simple(LVAL,ep); } break; default: badtag("ioblock", q->tag); } } /* replace an aggregate by an implied do loop of elements */ struct iogroup *enloop(p) struct ioitem *p; { register struct doblock *dop; struct iogroup *gp; ptr np, q, v, arrsize(), mkioitem(); int nrep, k, nwd; q = p->ioexpr; np = arrsize(q); if( ! isicon(np, &nrep) ) nrep = 0; if(q->vtype == TYCHAR) { nwd = ceil(conval(q->vtypep), tailor.ftnchwd); if(nwd != 1) np = simple(LVAL, mknode(TAROP,OPSTAR,np,mkint(nwd))); } else nwd = 0; if( isicon(np, &k) && k==1) return(p); dop = ALLOC(doblock); dop->tag = TDOBLOCK; dop->dovar = v = gent(TYINT, PNULL); dop->dopar[0] = mkint(1); dop->dopar[1] = simple(SUBVAL, np); dop->dopar[2] = NULL; q = simple(LVAL, q); if(q->vsubs == NULL) q->vsubs = mknode(TLIST,0, mkchain(cpexpr(v),CHNULL), PNULL); else q->vsubs->leftp->datap = simple(SUBVAL, mknode(TAROP,OPPLUS, cpexpr(v), mknode(TAROP,OPMINUS,q->vsubs->leftp->datap,mkint(1)))); q->vdim = NULL; gp = mkiogroup( mkchain(mkioitem(q,CNULL), CHNULL), p->iofmt, dop); gp->nrep = nrep; cfree(p); return(gp); } ptr mkformat(letter, n1, n2) char letter; register ptr n1, n2; { char f[20], *fp, *s; int k; if(letter == 's') { if(n1) { k = conval(n1); frexpr(n1); } else k = 1; for(fp = f; k-->0 ; ) *fp++ = '/'; *fp = '\0'; return( copys(f) ); } f[0] = letter; fp = f+1; if(n1) { n1 = simple(RVAL,n1); if(n1->tag==TCONST && n1->vtype==TYINT) { for(s = n1->leftp ; *s; ) *fp++ = *s++; } else execerr("bad format component %s", n1->leftp); frexpr(n1); } if(n2) { if(n2->tag==TCONST && n2->vtype==TYINT) { *fp++ = '.'; for(s = n2->leftp ; *s; ) *fp++ = *s++; } else execerr("bad format component %s", n2->leftp); frexpr(n2); } if( letter == 'x' ) { if(n1 == 0) *fp++ = '1'; fp[0] = 'x'; fp[1] = '\0'; return( copys(f+1) ); } else { *fp = '\0'; return( copys(f) ); } } ptr mkioitem(e,f) register ptr e; char *f; { register ptr p; char fmt[10]; ptr gentemp(); p = ALLOC(ioitem); p->tag = TIOITEM; if(e!=NULL && e->tag==TCONST) if(e->vtype==TYCHAR && (f==0 || (f[0]=='c' && f[1]=='\0') )) { p->ioexpr = 0; sprintf(msg, "%dh%s", strlen(e->leftp), e->leftp); p->iofmt = copys(msg); frexpr(e); return(p); } else e = mknode(TASGNOP,OPASGN,gentemp(e),e); if(e && e->vtype==TYCHAR && f && f[0]=='c' && f[1]=='\0') f = NULL; if(f == NULL) { switch(e->vtype) { case TYINT: case TYREAL: case TYLREAL: case TYCOMPLEX: case TYLOG: f = copys( tailor.dfltfmt[e->vtype] ); break; case TYCHAR: if(e->vtypep->tag != TCONST) { execerr("no adjustable character formats", ""); f = 0; } else { sprintf(fmt, "c%s", e->vtypep->leftp); f = copys(fmt); } break; default: execerr("cannot do I/O on structures", ""); f = 0; break; } } p->ioexpr = e; p->iofmt = f; return(p); } ptr arrsize(p) ptr p; { register ptr b; ptr f, q; q = mkint(1); if(b = p->vdim) for(b = b->datap ; b ; b = b->nextp) { if(b->upperb == 0) continue; f = cpexpr(b->upperb); if(b->lowerb) f = mknode(TAROP,OPPLUS,f, mknode(TAROP,OPMINUS,mkint(1),cpexpr(b->lowerb))); q = simple(RVAL, mknode(TAROP,OPSTAR,q,f)); } return(q); } repfac(dop) register struct doblock *dop; { int m1, m2, m3; m3 = 1; if( isicon(dop->dopar[0],&m1) && isicon(dop->dopar[1],&m2) && (dop->dopar[2]==NULL || isicon(dop->dopar[2],&m3)) ) { if(m3 > 0) return(1 + (m2-m1)/m3); } else execerr("nonconstant implied do", ""); return(1); } ioop(s) char *s; { if( equals(s, "backspace") ) return(FBACKSPACE); if( equals(s, "rewind") ) return(FREWIND); if( equals(s, "endfile") ) return(FENDFILE); return(0); } ptr exioop(p, errcheck) register struct exprblock *p; int errcheck; { register ptr q, t; if( (q = p->rightp)==NULL || (q = q->leftp)==NULL ) { execerr("bad I/O operation", ""); return(NULL); } q = simple(LVAL, cpexpr(q->datap) ); exlab(0); putic(ICKEYWORD, ioop(p->leftp->sthead->namep)); if(errcheck) { if(tailor.errmode != IOERRFORT77) { execerr("cannot test value of IOOP without ftn77", ""); return( errnode() ); } putic(ICOP, OPLPAR); prexpr(q); putic(ICOP, OPCOMMA); putsii(ICCONST, "iostat ="); prexpr(cpexpr( t = gent(TYINT,PNULL))); putic(ICOP, OPRPAR); return( t ); } else { putic(ICBLANK, 1); prexpr(q); } } ULL ) { execerr("bad I/O operation", ""); return(NULL); } q = simple(LVAL, cpexpr(q->datap) ); exlab(0); putic(ICK((cmd/efl/lex.l 644 0 33 15730 2405462604 6341 %Start DOTSON %{ #include #include "defs" #include "tokdefs" typedef union { int ival; ptr pval; } YYSTYPE; extern YYSTYPE yylval; YYSTYPE prevl; int prevv; char *copys(); static ptr p; static ptr q; static FILE *fd; static int quoted, k; static int rket = 0; FILE *opincl(); ptr mkdef(), mkcomm(), mkname(), mkimcon(); #define RET(x) { RETI(x,x); } #define RETL(yv,yl) {yylval=prevl=yl;igeol=comneed=0;return(prevv=yv); } #define RETP(yv,yl) {yylval.pval=prevl.pval=yl;igeol=comneed=0;return(prevv=yv); } #define RETI(yv,yl) {yylval.ival=prevl.ival=yl;igeol=comneed=0;return(prevv=yv); } #define REL(n) { RETI(RELOP, OPREL+n);} #define AS(n) { RETI(ASGNOP, OPASGN+n); } #define RETC(x) { RETP(CONST, mkconst(x,yytext) ); } #define RETZ(x) { yytext[yyleng-1] = '\0'; RETP(CONST, mkimcon(x,yytext) ); } %} D [0-9] d [dD][+-]?[0-9]+ e [eE][+-]?[0-9]+ i [iI] %% [a-zA-Z][a-zA-Z0-9_]* { lower(yytext); if(lettneed && yyleng==1) { RETI(LETTER, yytext[0]); } else if(defneed) { register char *q1, *q2; for(q2=q1=yytext+yyleng+1 ; (*q1 = efgetc)!='\n' ; ++q1) ; *q1 = '\0'; p = mkdef(yytext, q2); defneed = 0; ++yylineno; unput('\n'); } else if(optneed) { RETP(OPTNAME, copys(yytext)); } else if(comneed && ( (q=name(yytext,1))==NULL || q->tag!=TDEFINE) ) { RETP(COMNAME, mkcomm(yytext) ); } else if(q = name(yytext,1)) switch(q->tag) { case TDEFINE: filelines[filedepth] = yylineno; filemacs[filedepth] = efmacp; pushchars[filedepth] = (yysptr>yysbuf? *--yysptr : -1); if(++filedepth >= MAXINCLUDEDEPTH) fatal("macro or include too deep"); filelines[filedepth] = yylineno = 1; efmacp = q->varp->valp; filenames[filedepth] = NULL; break; /*now process new input */ case TSTRUCT: RETP(STRUCTNAME, q); case TNAME: RETP(NAME, q); case TKEYWORD: if(q->subtype == END) { register int c; eofneed = YES; while((c=input())!=';'&&c!='\n'&&c!=EOF) ; NLSTATE; } RET(q->subtype); default: fatal1("lex: impossible type code %d", q->tag); } else RETP(NAME, mkname(yytext) ); } "," RET(COMMA); ";" RET(EOS); "(" RET(LPAR); ")" RET(RPAR); "[" | "{" RET(LBRACK); "]" | "}" { if(iobrlevel>0) RET(RBRACK); rket = 1; RET(EOS); } "," RET(COMMA); ":" RET(COLON); "$" RET(REPOP); "."[oO][rR]"." | "|" RETI(OR,OPOR); "."[cC][oO][rR]"." | "||" RETI(OR,OP2OR); "."[aA][nN][dD]"." | "&" RETI(AND,OPAND); "."[cC][aA][nN][dD]"." | "&&" RETI(AND,OP2AND); "."[nN][oO][tT]"." | "~" RETI(NOT,OPNOT); "!" RETI(NOT,OPNOT); "."[lL][tT]"." | "<" REL(OPLT); "."[lL][eE]"." | "<=" REL(OPLE); "."[gG][tT]"." | ">" REL(OPGT); "."[gG][eE]"." | ">=" REL(OPGE); "."[eE][qQ]"." | "==" REL(OPEQ); "."[nN][eE]"." | "~=" | "!=" REL(OPNE); "->" RET(ARROW); "." RET(QUALOP); "+" RETI(ADDOP, OPPLUS); "-" RETI(ADDOP, OPMINUS); "*" RETI(MULTOP, OPSTAR); "/" RETI(MULTOP, OPSLASH); "**" | "^" RETI(POWER, OPPOWER); "++" RETI(DOUBLEADDOP, OPPLUS); "--" RETI(DOUBLEADDOP, OPMINUS); "=" AS(OPASGN); "+=" AS(OPPLUS); "-=" AS(OPMINUS); "*=" AS(OPSTAR); "/=" AS(OPSLASH); "**=" | "^=" AS(OPPOWER); "&=" AS(OPAND); "&&=" AS(OP2AND); "|=" AS(OPOR); "||=" AS(OP2OR); \'[^\n']*\' | \"[^\n"]*\" { yytext[yyleng-1] = '\0'; p = mkconst(TYCHAR,yytext+1); RETP(CONST,p); } {D}+[hH] { /* nh construct */ int i, n; char c; yytext[yyleng-1] = '\0'; n = convci(yytext); for(i = 0; ivtypep = mkint(i); RETP(CONST, p); } {D}+ RETC(TYINT); {D}+"."{D}* | {D}*"."{D}+ RETC(TYREAL); {D}+"."?{D}*{e} | {D}*"."{D}+{e} RETC(TYREAL); {D}+"."?{D}*{d} | {D}*"."{D}+{d} RETC(TYLREAL); {D}+{i} { yytext[yyleng-1] = '.'; RETP(CONST,mkimcon(TYCOMPLEX,yytext)); } {D}+"."{D}*{i} | {D}*"."{D}+{i} RETZ(TYCOMPLEX); {D}+"."?{D}*{e}{i} | {D}*"."{D}+{e}{i} RETZ(TYCOMPLEX); {D}+"."?{D}*{d}{i} | {D}*"."{D}+{d}{i} RETZ(TYLCOMPLEX); "#".* { if(! nocommentflag) goto litline; } ^"%".* { if(thisexec) thisexec->nftnst += 2; if(inproc) { unput('\n'); RETP(ESCAPE, copys(yytext)); } litline: p = mkchain( copys(yytext), CHNULL); if(inproc==0 && yytext[0]=='%') prevcomments = hookup(prevcomments, p); else comments = hookup(comments,p); } " " ; \t ; \f ; "_"[ \t]*\n ; \n { if(igeol) { igeol=0; prevv = NEWLINE; } else if(prevv>=NAME || prevv==RPAR || prevv==RBRACK || prevv== -1 || prevv==QUALOP) RET(EOS); } . { char * linerr(); fprintf(diagfile, "Bad input character %c %s\n", yytext[0], linerr()); ++nerrs; } ^[ \t]*[iI][nN][cC][lL][uU][dD][eE].*\n { /* Include statement */ char *q1; register char *q2; for(q1=yytext ; *q1==' ' || *q1=='\t' ; ++q1) ; quoted = NO; for(q1 += 7 ; *q1==' ' || *q1=='\t' || *q1=='\'' || *q1=='"' || *q1=='(' ; ++q1 ) if(*q1=='"' || *q1=='\'') quoted = YES; for(q2=q1 ; *q2!='\0' && *q2!=' ' && *q2!='\n' && *q2!='\'' && *q2!='"' && *q2!=')' ; ++q2 ) ; *q2 = '\0'; if( ! quoted) for(k=0; (q = name(q1,1)) && q->tag==TDEFINE ; ++k) { if(k > MAXINCLUDEDEPTH) fatal1("Macros too deep for %s", yytext); q1 = q->varp->valp; } if( (fd = opincl(&q1)) == NULL) { fprintf(diagfile, "Cannot open file %s. Stop.\n", q1); exit(2); } filelines[filedepth] = yylineno; pushchars[filedepth] = '\n'; if(++filedepth >= MAXINCLUDEDEPTH) fatal("macro or include too deep"); fileptrs[filedepth] = yyin = fd; filenames[filedepth] = copys(q1); filelines[filedepth] = yylineno = 1; filemacs[filedepth] = NULL; } %% yywrap() { if(filedepth == 0) { ateof = 1; return(1); } if(efmacp == 0) { fclose(yyin); cfree(filenames[filedepth]); } --filedepth; if( filemacs[filedepth] ) efmacp = filemacs[filedepth]; else { yyin = fileptrs[filedepth]; efmacp = 0; } yylineno = filelines[filedepth]; if(pushchars[filedepth] != -1) unput( pushchars[filedepth] ); return(0); } lower(s) /* replace upper with lower case letters */ register char *s; { register char *t; for(t=s ; *t ; ++t) if( isupper(*t) ) *s++ = tolower(*t); else if(*t != '_') *s++ = *t; } setdot(k) int k; { if(k) BEGIN DOTSON; else BEGIN 0; } FILE *opincl(namep) char **namep; { #ifndef unix return( fopen(*namep, "r") ); #else /* On Unix, follow the C include conventions */ register char *s, *lastslash; char *dir, *name, temp[100]; int i; FILE *fp; name = *namep; if(name[0] == '/') return( fopen(name, "r") ); dir = basefile; for(i = filedepth ; i>=0 ; --i) if( filemacs[i] == NULL) { dir = filenames[i]; break; } lastslash = NULL; for(s = dir ; *s ; ++s) if(*s == '/') lastslash = s; if(lastslash) { *lastslash = '\0'; sprintf(temp, "%s/%s", dir, name); *lastslash = '/'; if( fp = fopen(temp, "r") ) *namep = temp; } else fp = fopen(name, "r"); if(fp == NULL) { sprintf(temp, "/usr/include/%s", name); fp = fopen(temp, "r"); *namep = temp; } return(fp); #endif } dir = basefile; for(i = filedepth ; i>=cmd/efl/main.c 644 0 33 23253 2405462607 6466 static char xxxvers[ ] = "\n@(#)EFL VERSION 1.14, 19 AUGUST 1980"; /* Compiler for the EFL Programming Language. Written by: Stuart I. Feldman Bell Laboratories Murray Hill, New Jersey */ /* Flags: -d EFL debugging output -v verbose (print out Pass numbers and memory limits) -w supress warning messages -f put Fortran output on appropriate .f files -F put Fortran code for input file x onto x.F -e divert diagnostic output to next argument -# do not pass comments through to output */ #include "defs" int sysflag; int nerrs = 0; int nbad = 0; int nwarns = 0; int stnos[MAXSTNO]; int nxtstno = 0; int constno = 0; int labno = 0; int dumpic = NO; int memdump = NO; int dbgflag = NO; int nowarnflag = NO; int nocommentflag = NO; int verbose = NO; int dumpcore = NO; char msg[200]; struct fileblock fcb[4]; struct fileblock *iifilep; struct fileblock *ibfile = &fcb[0]; struct fileblock *icfile = &fcb[1]; struct fileblock *idfile = &fcb[2]; struct fileblock *iefile = &fcb[3]; FILE *diagfile = {stderr}; FILE *codefile = {stdout}; FILE *fileptrs[MAXINCLUDEDEPTH]; char *filenames[MAXINCLUDEDEPTH]; char *basefile; int filelines[MAXINCLUDEDEPTH]; int filedepth = 0; char *efmacp = NULL; char *filemacs[MAXINCLUDEDEPTH]; int pushchars[MAXINCLUDEDEPTH]; int ateof = NO; int igeol = NO; int pushlex = NO; int eofneed = NO; int forcerr = NO; int defneed = NO; int prevbg = NO; int comneed = NO; int optneed = NO; int lettneed = NO; int iobrlevel = 0; ptr comments = NULL; ptr prevcomments = NULL; ptr genequivs = NULL; ptr arrays = NULL; ptr generlist = NULL; ptr knownlist = NULL; ptr thisexec; ptr thisctl; chainp tempvarlist = CHNULL; chainp temptypelist = CHNULL; chainp hidlist = CHNULL; chainp commonlist = CHNULL; chainp gonelist = CHNULL; int blklevel = 0; int ctllevel = 0; int dclsect = 0; int instruct = 0; int inbound = 0; int inproc = 0; int ncases = 0; int graal = 0; ptr procname = NULL; int procclass = 0; ptr thisargs = NULL; int nhid[MAXBLOCKDEPTH]; int ndecl[MAXBLOCKDEPTH]; char ftnames[MAXFTNAMES][((7]; int neflnames = 0; int nftnames; int nftnm0; int impltype[26]; int ftnefl[NFTNTYPES] = { TYINT, TYREAL, TYLOG, TYCOMPLEX, TYLREAL, TYCHAR, TYLCOMPLEX }; int eflftn[NEFLTYPES]; int ftnmask[NFTNTYPES] = { 1, 2, 4, 8, 16, 32, 64 }; struct tailoring tailor; struct system systab[] = { { "portable", 0, 1, 10, 7, 15}, { "unix", UNIX, 4, 10, 7, 15 }, { "gcos", GCOS, 4, 10, 7, 15 }, { "gcosbcd", GCOSBCD, 6, 10, 7, 15}, { "cray", CRAY, 8, 10, 7, 15}, { "ibm", IBM, 4, 10, 7, 15 }, { NULL } }; double fieldmax = FIELDMAX; int langopt = 2; int dotsopt = 0; int dbgopt = 0; int dbglevel = 0; int nftnch; int nftncont; int indifs[MAXINDIFS]; int nxtindif; int afterif = 0; #ifdef gcos # define BIT(n) (1 << (36 - 1 - n) ) # define FORTRAN BIT(1) # define FDS BIT(4) # define EXEC BIT(5) # define FORM BIT(14) # define LNO BIT(15) # define BCD BIT(16) # define OPTZ BIT(17) int compile = FORTRAN | FDS; #endif main(argc,argv) register int argc; register char **argv; { FILE *fd; register char *p; int neflnm0; #ifdef unix int intrupt(); sysflag = UNIX; /* meter(); */ if( (signal(2,1) & 01) == 0) signal(2, intrupt); #endif #ifdef gcos /* meter(); */ sysflag = (intss() ? GCOS : GCOSBCD); #endif crii(); --argc; ++argv; tailinit(systab + sysflag); while(argc>0 && ( (argv[0][0]=='-' && argv[0][1]!='\0') || eqlstrng(argv[0]) )) { if(argv[0][0] == '-') for(p = argv[0]+1 ; *p ; ++p) switch(*p) { case ' ': break; case 'd': case 'D': switch( *++p) { case '1': dbgflag = YES; break; case '2': setyydeb(); break; case '3': dumpcore = YES; break; case '4': dumpic = YES; break; case 'm': case 'M': memdump = YES; break; default: dbgflag = YES; --p; break; } break; case 'w': case 'W': nowarnflag = YES; break; case 'v': case 'V': verbose = YES; break; case '#': nocommentflag = YES; break; case 'C': case 'c': nocommentflag = NO; break; #ifdef gcos case 'O': case 'o': compile |= OPTZ; break; case 'E': case 'e': compile = 0; break; #endif default: fprintf(diagfile, "Illegal EFL flag %c\n", *p); exit(1); } --argc; ++argv; } kwinit(); geninit(); knowninit(); init(); implinit(); neflnm0 = neflnames; #ifdef gcos if( intss() ) compile = 0; else gcoutf(); #endif /* fprintf(diagfile, "EFL 1.10\n"); */ if(argc==0) { filenames[0] = "-"; dofile(stdin); } else while(argc>0) { if( eqlstrng(argv[0]) ) { --argc; ++argv; continue; } if(argv[0][0]=='-' && argv[0][1]=='\0') { basefile = ""; fd = stdin; } else { basefile = argv[0]; fd = fopen(argv[0], "r"); } if(fd == NULL) { sprintf(msg, "Cannot open file %s", argv[0]); fprintf(diagfile, "%s. Stop\n", msg); done(2); } filenames[0] = argv[0]; filedepth = 0; nftnames = 0; nftnm0 = 0; neflnames = neflnm0; dofile(fd); if(fd != stdin) fclose(fd); --argc; ++argv; } p2flush(); if(verbose) fprintf(diagfile, "End of compilation\n"); /* prhisto(); /* */ rmiis(); #ifdef gcos gccomp(); #endif done(nbad); } dofile(fd) FILE *fd; { int k; fprintf(diagfile, "File %s:\n", filenames[0]); #ifdef gcos if( fd==stdin && intss() && inquire(stdin, _TTY) ) freopen("*src", "rt", stdin); #endif yyin = fileptrs[0] = fd; yylineno = filelines[0] = 1; filedepth = 0; ateof = 0; do { nerrs = 0; nwarns = 0; eofneed = 0; forcerr = 0; comneed = 0; optneed = 0; defneed = 0; lettneed = 0; iobrlevel = 0; prevbg = 0; constno = 0; labno = 0; nxtstno = 0; afterif = 0; thisexec = 0; thisctl = 0; nxtindif = 0; inproc = 0; blklevel = 0; implinit(); opiis(); swii(icfile); if(k = yyparse()) fprintf(diagfile, "Error in source file.\n"); else switch(graal) { case PARSERR: /* fprintf(diagfile, "error\n"); */ break; case PARSEOF: break; case PARSOPT: propts(); break; case PARSDCL: fprintf(diagfile, "external declaration\n"); break; case PARSPROC: /* work already done in endproc */ break; case PARSDEF: break; } cliis(); if(nerrs) ++nbad; } while(graal!=PARSEOF && !ateof); } ptr bgnproc() { ptr bgnexec(); if(blklevel > 0) { execerr("procedure %s terminated prematurely", procnm() ); endproc(); } ctllevel = 0; procname = 0; procclass = 0; thisargs = 0; dclsect = 0; blklevel = 1; nftnm0 = nftnames; dclsect = 1; ndecl[1] = 0; nhid[1] = 0; thisctl = allexcblock(); thisctl->tag = TCONTROL; thisctl->subtype = STPROC; inproc = 1; return( bgnexec() ); } endproc() { char comline[50], *concat(); ptr p; inproc = 0; if(nerrs == 0) { pass2(); unhide(); cleanst(); if(dumpic) system( concat("od ", icfile->filename, comline) ); if(memdump) prmem(); } else { fprintf(diagfile, "**Procedure %s not generated\n", procnm()); for( ; blklevel > 0 ; --blklevel) unhide(); cleanst(); } if(nerrs==0 && nwarns>0) if(nwarns == 1) fprintf(diagfile,"*1 warning\n"); else fprintf(diagfile, "*%d warnings\n", nwarns); blklevel = 0; thisargs = 0; procname = 0; procclass = 0; while(thisctl) { p = thisctl; thisctl = thisctl->prevctl; frexcblock(p); } while(thisexec) { p = thisexec; thisexec = thisexec->prevexec; frexcblock(p); } nftnames = nftnm0; if(verbose) { fprintf(diagfile, "Highwater mark %d words. ", nmemused); fprintf(diagfile, "%ld words left over\n", totalloc-totfreed); } } implinit() { setimpl(TYREAL, 'a', 'z'); setimpl(TYINT, 'i', 'n'); } init() { eflftn[TYINT] = FTNINT; eflftn[TYREAL] = FTNREAL; eflftn[TYLREAL] = FTNDOUBLE; eflftn[TYLOG] = FTNLOG; eflftn[TYCOMPLEX] = FTNCOMPLEX; eflftn[TYCHAR] = FTNINT; eflftn[TYFIELD] = FTNINT; eflftn[TYLCOMPLEX] = FTNDOUBLE; } #ifdef gcos meter() { FILE *mout; char *cuserid(), *datime(), *s; if(equals(s = cuserid(), "efl")) return; mout = fopen("efl/eflmeter", "a"); if(mout == NULL) fprintf(diagfile,"cannot open meter file"); else { fprintf(mout, "%s user %s at %s\n", ( rutss()? "tss " : "batch"), s, datime() ); fclose(mout); } } #endif #ifdef unix meter() /* temporary metering of non-SIF usage */ { FILE *mout; int tvec[2]; int uid; char *ctime(), *p; uid = getuid() & 0377; if(uid == 91) return; /* ignore sif uses */ mout = fopen("/usr/sif/efl/Meter", "a"); if(mout == NULL) fprintf(diagfile, "cannot open meter file"); else { time(tvec); p = ctime(tvec); p[16] = '\0'; fprintf(mout,"User %d, %s\n", uid, p+4); fclose(mout); } } intrupt() { done(0); } #endif done(k) int k; { rmiis(); exit(k); } /* if string has an embedded equal sign, set option with it*/ eqlstrng(s) char *s; { register char *t; for(t = s; *t; ++t) if(*t == '=') { *t = '\0'; while( *++t == ' ' ) ; setopt(s, t); return(YES); } return(NO); } #ifdef gcos /* redirect output unit */ gcoutf() { if (!intss()) { fputs("\t\t Version 2.10 : read INFO/EFL (03/27/80)\n", stderr); if (compile) { static char name[80] = "s*", opts[20] = "yw"; char *opt = (char *)inquire(stdout, _OPTIONS); if (!strchr(opt, 't')) { /* if stdout is diverted */ sprintf(name, "%s\"s*\"", (char *)inquire(stdout, _FILENAME)); strcpy(&opts[1], opt); } if (freopen(name, opts, stdout) == NULL) cant(name); } } } /* call in fortran compiler if necessary */ gccomp() { if (compile) { if (nbad > 0) /* abort */ cretsw(EXEC); else { /* good: call forty */ FILE *dstar; /* to intercept "gosys" action */ if ((dstar = fopen("d*", "wv")) == NULL) cant("d*"); fputs("$\tforty\tascii", dstar); if (fopen("*1", "o") == NULL) cant("*1"); fclose(stdout, "rl"); cretsw(FORM | LNO | BCD); if (! tailor.ftncontnu) compile |= FORM; csetsw(compile); gosys("forty"); } } } cant(s) char *s; { ffiler(s); done(1); } #endif compiler if necessary */ gccomp() { if (compile) { if (nbad > 0) /* abort */ cretsw(EXEC); else { /* good: call forty */ FILE *dstar; /* to intercept "gosys" action */ if ((dstar = fopen("d*", "wv")) == NULL) cant("d*"); fputs("$\tforty\tascii", dstar); if (fopen("*1", "o") == NULL) cant("*1"); fclose(stdout, "rl");cmd/efl/misc.c 644 0 33 12357 2405462613 6475 #include #include "defs" char * copys(s) register char *s; { register char *t; char *k; ptr calloc(); for(t=s; *t++ ; ); if( (k = calloc( t-s , sizeof(char))) == NULL) fatal("Cannot allocate memory"); for(t=k ; *t++ = *s++ ; ); return(k); } equals(a,b) register char *a,*b; { if(a==b) return(YES); while(*a == *b) if(*a == '\0') return(YES); else {++a; ++b;} return(NO); } 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); } ptr conrep(a,b) char *a, *b; { char *s; s = intalloc( strlen(a)+strlen(b)+1 ); concat(a,b,s); cfree(a); return(s); } eqcon(p,q) register ptr p, q; { int pt, qt; if(p==q) return(YES); if(p==NULL || q==NULL) return(NO); pt = p->tag; qt = q->tag; if(pt==TNEGOP && qt==TNEGOP) return( eqcon(p->leftp, q->leftp) ); if(pt==TCONST && qt==TNEGOP) return(NO); if(pt==TNEGOP && qt==TCONST) return(NO); if(p->tag==TCONST && q->tag==TCONST) return( equals(p->leftp,q->leftp) ); fatal("eqcon: nonconstant argument"); /* NOTREACHED */ } char *convic(n) register int n; { static char s[20]; register char *t; s[19] = '\0'; t = s+19; do { *--t = '0' + n%10; n /= 10; } while(n > 0); return(t); } conval(p) register ptr p; { int val; if(isicon(p, &val)) return(val); fatal("bad conval"); } isicon(p, valp) ptr p; int *valp; { int val1; if(p) switch(p->tag) { case TNEGOP: if(isicon(p->leftp, &val1)) { *valp = - val1; return(1); } bre((ak; case TCONST: if(p->vtype == TYINT) { *valp = convci(p->leftp); return(YES); } default: break; } return(NO); } isconst(p) ptr p; { return(p->tag==TCONST || (p->tag==TNEGOP && isconst(p->leftp)) ); } iszero(s) register char *s; { if(s == NULL) return(YES); while( *s=='+' || *s=='-' || *s==' ' ) ++s; while( *s=='0' || *s=='.' ) ++s; switch( *s ) { case 'd': case 'e': case 'D': case 'E': case ' ': case '\0': return(YES); default: return(NO); } } convci(p) register char *p; { register int n; register int sgn; n = 0; sgn = 1; for( ; *p ; ++p) if(*p == '-') sgn = -1; else if( isdigit(*p) ) n = 10*n + (*p - '0'); return(sgn * n); } chainp hookup(x,y) register chainp x, y; { register chainp p; if(x == NULL) return(y); for(p=x ; p->nextp ; p = p->nextp) ; p->nextp = y; return(x); } ptr cpexpr(p) register ptr p; { register ptr e; ptr q, q1; if(p == NULL) return(NULL); e = allexpblock(); cpblock(p, e, sizeof(struct exprblock)); switch(p->tag) { case TAROP: case TRELOP: case TLOGOP: case TASGNOP: case TCALL: e->rightp = cpexpr(p->rightp); case TNOTOP: case TNEGOP: e->leftp = cpexpr(p->leftp); break; case TCONST: e->leftp = copys(p->leftp); if(p->rightp) e->rightp = copys(p->rightp); if(p->vtype == TYCHAR) e->vtypep = cpexpr(p->vtypep); break; case TLIST: q1 = &(e->leftp); for(q = p->leftp ; q ; q = q->nextp) q1 = q1->nextp = mkchain( cpexpr(q->datap), CHNULL); break; case TTEMP: case TNAME: case TFTNBLOCK: if(p->vsubs) e->vsubs = cpexpr(p->vsubs); if(p->voffset) e->voffset = cpexpr(p->voffset); break; case TERROR: break; default: badtag("cpexpr", p->tag); } return(e); } mvexpr(p,q) char *p, *q; { cpblock(p,q, sizeof(struct exprblock) ); frexpblock(p); } cpblock(p,q,n) register char *p, *q; int n; { register int i; for(i=0; isthead->namep : "" ); } ptr arg1(a) /* make an argument list of one value */ ptr a; { return( mknode(TLIST,0, mkchain(a,CHNULL), PNULL) ); } ptr arg2(a,b) /* make an argumentlist (a,b) */ ptr a,b; { register ptr p; p = mkchain(a, mkchain(b,CHNULL) ); return( mknode(TLIST,0, p,0) ); } ptr arg4(a,b) /* make an argument list of (a,len(a), b,len(b)) */ ptr a,b; { register ptr p; p = mkchain(b, mkchain(cpexpr(b->vtypep), CHNULL)); p = mkchain(a, mkchain(cpexpr(a->vtypep), p)); return( mknode(TLIST,0,p,PNULL)); } ptr builtin(type,s) int type; char *s; { register ptr p, q; ptr mkvar(), mkname(); if(p = name(s,1)) { if(p->blklevel>1 || (p->tag!=TNAME && p->tag!=TKEYWORD) || (q=p->varp)==0 || q->vext || (q->vtype!=type && q->vtype!=TYUNDEFINED) ) { exprerr("error involving builtin %s", s); return(errnode()); } if(q->vtype!= TYUNDEFINED) return( cpexpr(q) ); } else { q = mkvar( mkname(s) ); if(blklevel > 1) { q->blklevel = 1; q->sthead->blklevel = 1; --ndecl[blklevel]; ++ndecl[1]; } } q->vtype = type; q->vdclstart = 1; mkftnp(q); return( cpexpr(q) ); } ptr errnode() { register struct exprblock * p; p = allexpblock(); p->tag = TERROR; p->vtype = TYINT; return(p); } min(a,b) int a,b; { return( asthead->varp; k = q->vproc; /*debug printf("setvproc(%s ,%d)\n", q->sthead->namep, v); */ if(p != q) p->vproc = k; if(k == v) return; if(k==PROCUNKNOWN || (k==PROCYES && v==PROCINTRINSIC) ) p->vproc = q->vproc = v; else if( !(k==PROCINTRINSIC && v==PROCYES) && p->sthead->varp!=procname) execerr("attempt to use %s as variable and procedure", p->sthead->namep); } urn(p); } min(a,b) int a,b; { return( asthead->varp; k = q->vproc; /*debug printf("setvproc(%s ,%d)\n", q->sthead->namep, v); */ if(p != q) p->vproc = k; if(k == v) returcmd/efl/mk.c 644 0 33 36763 2405462617 6164 #include "defs" ptr mkcomm(s) register char *s; { register ptr p; register char *t; for(p = commonlist ; p ; p = p->nextp) if(equals(s, p->datap->comname)) return(p->datap); p = ALLOC(comentry); for(t = p->comname ; *t++ = *s++ ; ) ; p->tag = TCOMMON; p->blklevel = (blklevel>0? 1 : 0); commonlist = mkchain(p, commonlist); return(commonlist->datap); } ptr mkname(s) char *s; { char *copys(); register ptr p; if( (p = name(s,1)) == 0) { p = name(s,0); p->tag = TNAME; p->blklevel = blklevel; } return(p); } ptr mknode(t, o, l, r) int t,o; register ptr l; register ptr r; { register struct exprblock *p; ptr q; int lt, rt; int ll, rl; ptr mksub1(), mkchcon(); p = allexpblock(); TEST fprintf(diagfile, "mknode(%d,%d,%o,%o) = %o\n", t, o, l, r, p); top: if(t!=TLIST && t!=TCONST && l!=0 && l->tag==TERROR) { frexpr(r); frexpblock(p); return(l); } if(r!=0 && r->tag==TERROR) { frexpr(l); frexpblock(p); return(r); } p->tag = t; p->subtype = o; p->leftp = l; p->rightp = r; switch(t) { case TAROP: ckdcl(l); ckdcl(r); switch(lt = l->vtype) { case TYCHAR: case TYSTRUCT: case TYLOG: exprerr("non-arithmetic operand of arith op",""); goto err; } switch(rt = r->vtype) { case TYCHAR: case TYSTRUCT: case TYLOG: exprerr("non-arithmetic operand of arith op",""); goto err; } if(lt==rt || (o==OPPOWER && rt==TYINT) ) p->vtype = lt; else if( (lt==TYREAL && rt==TYLREAL) || (lt==TYLREAL && rt==TYREAL) ) p->vtype = TYLREAL; else if(lt==TYINT) { l = coerce(rt,l); goto top; } else if(rt==TYINT) { r = coerce(lt,r); goto top; } else if( (lt==TYREAL && rt==TYCOMPLEX) || (lt==TYCOMPLEX && rt==TYREAL) ) p->vtype = TYCOMPLEX; else if( (lt==TYLREAL && rt==TYCOMPLEX) || (lt==TYCOMPLEX && rt==TYLREAL) ) p->vtype = TYLCOMPLEX; else { exprerr("mixed mode", CNULL); goto err; } if( (o==OPPLUS||o==OPSTAR) && l->tag==TCONST && r->tag!=TCONST ) { p->leftp = r; p->rightp = l; } if(o==OPPLUS && l->tag==TNEGOP && (r->tag!=TCONST || l->leftp->tag==TCONST) ) { p->subtype = OPMINUS; p->leftp = r; p->rightp = l->leftp; } break; case TRELOP: ckdcl(l); ckdcl(r); p->vtype = TYLOG; lt = l->vtype; rt = r->vtype; if(lt==TYCHAR || rt==TYCHAR) { if(l->vtype != r->vtype) { exprerr("comparison of character and noncharacter data",CNULL); goto err; } ll = conval(l->vtypep); rl = conval(r->vtypep); if( (o==OPEQ || o==OPNE) && ( (ll==1 && rl==1 && tailor.charcomp==1) || (ll<=tailor.ftnchwd && rl<=tailor.ftnchwd && tailor.charcomp==2) )) { if(l->tag == TCONST) { q = cpexpr( mkchcon(l->leftp) ); frexpr(l); l = q; } if(r->tag == TCONST) { q = cpexpr( mkchcon(r->leftp) ); frexpr(r); r = q; } if(l->vsubs == 0) l->vsubs = mksub1(); if(r->vsubs == 0) r->vsubs = mksub1(); p->leftp = l; p->rightp = r; } else { p->leftp = mkcall(builtin(TYINT,"ef1cmc"), arg4(l,r)); p->rightp = mkint(0); } } else if(lt==TYLOG || rt==TYLOG) exprerr("relational involving logicals", CNULL); else if( (lt==TYCOMPLEX || rt==TYCOMPLEX) && o!=OPEQ && o!=OPNE) exprerr("order comparison of complex numbers", CNULL); else if(lt != rt) { if(lt==TYINT) p->leftp = coerce(rt, l); else if(rt == TYINT) p->rightp = coerce(lt, r); } break; case TLOGOP: ckdcl(l); ckdcl(r); if(r->vtype != TYLOG) { exprerr("non-logical operand of logical operator",CNULL); goto err; } case TNOTOP: ckdcl(l); if(l->vtype != TYLOG) { exprerr("non-logical operand of logical operator",CNULL); } p->vtype = TYLOG; break; case TNEGOP: ckdcl(l); lt = l->vtype; if(lt!=TYINT && lt!=TYREAL && lt!=TYLREAL && lt!=TYCOMPLEX) { exprerr("impossible unary + or - operation",CNULL); goto err; } p->vtype = lt; break; case TCALL: p->vtype = l->vtype; p->vtypep = l->vtypep; break; case TASGNOP: ckdcl(l); ckdcl(r); lt = l->vtype; if(lt==TYFIELD) lt = TYINT; rt = r->vtype; if(lt==TYCHAR || rt==TYCHAR || lt==TYLOG || rt==TYLOG) { if(lt != rt) { exprerr("illegal assignment",CNULL); goto err; } } else if(lt==TYSTRUCT || rt==TYSTRUCT) { if(lt!=rt || l->vtypep->strsize!=r->vtypep->strsize || l->vtypep->stralign!=r->vtypep->stralign) { exprerr("illegal structure assignment",CNULL); goto err; } } else if ( (lt==TYCOMPLEX || rt==TYCOMPLEX) && lt!=rt) /* p->rightp = r = coerce(lt, r) */ ; p->vtype = lt; p->vtypep = l->vtypep; break; case TCONST: case TLIST: case TREPOP: break; default: badtag("mknode", t); } return(p); err: frexpr(p); return( errnode() ); } ckdcl(p) ptr p; { if(p->vtype==TYUNDEFINED || (p->tag==TNAME&&p->vdcldone==0&&p->vadjdim==0)) { /*debug*/ printf("tag=%d, typed=%d\n", p->tag, p->vtype); fatal("untyped subexpression"); } if(p->tag==TNAME) setvproc(p,PROCNO); } ptr mkvar(p) register ptr p; { register ptr q; TEST fprintf(diagfile, "mkvar(%s), blk %d\n", p->namep, blklevel); if(p->blklevel > blklevel) p->blklevel = blklevel; if(instruct || p->varp==0 || p->varp->blkleveltag = TNAME; q->sthead = p; q->blklevel = blklevel; if(! instruct) ++ndecl[blklevel]; } else q = p->varp; if(!instruct) { if(p->varp && p->varp->blklevelvarp == 0) p->varp = q; } p->tag = TNAME; return(q); } ptr mkstruct(v,s) register ptr v; ptr ((s; { register ptr p; p = ALLOC(typeblock); p->sthead = v; p->tag = TSTRUCT; p->blklevel = blklevel; p->strdesc = s; offsets(p); if(v) { v->blklevel = blklevel; ++ndecl[blklevel]; v->varp = p; } else temptypelist = mkchain(p, temptypelist); return(p); } ptr mkcall(fn1, args) ptr fn1, args; { int i, j, first; register ptr funct, p, q; ptr r; if(fn1->tag == TERROR) return( errnode() ); else if(fn1->tag == TNAME) { funct = fn1->sthead->varp; frexpblock(fn1); } else funct = fn1; if(funct->vclass!=0 && funct->vclass!=CLARG) { exprerr("invalid invocation of %s",funct->sthead->namep); frexpr(args); return( errnode() ); } else extname(funct); if(args) for(p = args->leftp; p ; p = p->nextp) { q = p->datap; if( (q->tag==TCALL&&q->vtype==TYUNDEFINED) || (q->tag==TNAME&&q->vdcldone==0) ) dclit(q); if(q->tag==TNAME && q->vproc==PROCUNKNOWN) setvproc(q, PROCNO); if( q->vtype == TYSTRUCT) { first = 1; for(i = 0; ivbase[i] != 0) { r = cpexpr(q); if(first) { p->datap = r; first = 0; } else p = p->nextp = mkchain(r, p->nextp); r->vtype = ftnefl[i]; for(j=0; jvbase[j] = 0; } frexpblock(q); } } return( mknode(TCALL,0,cpexpr(funct), args) ); } mkcase(p,here) ptr p; int here; { register ptr q, s; for(s = thisctl ; s!=0 && s->subtype!=STSWITCH ; s = s->prevctl) ; if(s==0 || (here && s!=thisctl) ) { laberr("invalid case label location",CNULL); return(0); } for(q = s->loopctl ; q!=0 && !eqcon(p,q->casexpr) ; q = q->nextcase) ; if(q == 0) { q = ALLOC(caseblock); q->tag = TCASE; q->casexpr = p; q->labelno = ( here ? thislab() : nextlab() ); q->nextcase = s->loopctl; s->loopctl = q; } else if(here) if(thisexec->labelno == 0) thisexec->labelno = q->labelno; else if(thisexec->labelno != q->labelno) { exnull(); thisexec->labelno = q->labelno; thisexec->labused = 0; } if(here) if(q->labdefined) laberr("multiply defined case",CNULL); else q->labdefined = 1; return(q->labelno); } ptr mkilab(p) ptr p; { char *s, l[30]; if(p->tag!=TCONST || p->vtype!=TYINT) { execerr("invalid label",""); s = ""; } else s = p->leftp; while(*s == '0') ++s; sprintf(l,"#%s", s); TEST fprintf(diagfile,"numeric label = %s\n", l); return( mkname(l) ); } mklabel(p,here) ptr p; int here; { register ptr q; if(q = p->varp) { if(q->tag != TLABEL) laberr("%s is already a nonlabel\n", p->namep); else if(q->labinacc) warn1("label %s is inaccessible", p->namep); else if(here) if(q->labdefined) laberr("%s is already defined\n", p->namep); else if(blklevel > q->blklevel) laberr("%s is illegally placed\n",p->namep); else { q->labdefined = 1; if(thisexec->labelno == 0) thisexec->labelno = q->labelno; else if(thisexec->labelno != q->labelno) { exnull(); thisexec->labelno = q->labelno; thisexec->labused = 0; } } } else { q = ALLOC(labelblock); p->varp = q; q->tag = TLABEL; q->subtype = 0; q->blklevel = blklevel; ++ndecl[blklevel]; q->labdefined = here; q->labelno = ( here ? thislab() : nextlab() ); q->sthead = p; } return(q->labelno); } thislab() { if(thisexec->labelno == 0) thisexec->labelno = nextlab(); return(thisexec->labelno); } nextlab() { stnos[++labno] = 0; return( labno ); } nextindif() { if(++nxtindif < MAXINDIFS) return(nxtindif); fatal("too many indifs"); } mkkeywd(s, n) char *s; int n; { register ptr p; register ptr q; p = name(s, 2); q = ALLOC(keyblock); p->tag = TKEYWORD; q->tag = TKEYWORD; p->subtype = n; q->subtype = n; p->blklevel = 0; p->varp = q; q->sthead = p; } ptr mkdef(s, v) char *s, *v; { register ptr p; register ptr q; if(p = name(s,1)) if(p->blklevel == 0) { if(blklevel > 0) hide(p); else if(p->tag != TDEFINE) dclerr("attempt to DEFINE a variable name", s); else { if( strcmp(v, (q=p->varp) ->valp) ) { warn("macro value replaced"); cfree(q->valp); q->valp = copys(v); } return(p); } } else { dclerr("type already defined", s); return( errnode() ); } else p = name(s,0); q = ALLOC(defblock); p->tag = TDEFINE; q->tag = TDEFINE; p->blklevel = q->blklevel = (blklevel==0 ? 0 : 1); q->sthead = p; p->varp = q; p->varp->valp = copys(v); return(p); } mkknown(s,t) char *s; int t; { register ptr p; p = ALLOC(knownname); p->nextfunct = knownlist; p->tag = TKNOWNFUNCT; knownlist = p; p->funcname = s; p->functype = t; } ptr mkint(k) int k; { return( mkconst(TYINT, convic(k) ) ); } ptr mkconst(t,p) int t; ptr p; { ptr q; q = mknode(TCONST, 0, copys(p), PNULL); q->vtype = t; if(t == TYCHAR) q->vtypep = mkint( strlen(p) ); return(q); } ptr mkimcon(t,p) int t; char *p; { ptr q; char *zero, buff[100]; zero = (t==TYCOMPLEX ? "0." : "0d0"); sprintf(buff, "(%s,%s)", zero, p); q = mknode(TCONST, 0, copys(buff), PNULL); q->vtype = t; return(q); } ptr mkarrow(p,t) register ptr p; ptr t; { register ptr q, s; if(p->vsubs == 0) if(p->vdim==0 && p->vtype!=TYCHAR && p->vtype!=TYSTRUCT) { exprerr("need an aggregate to the left of arrow",CNULL); frexpr(p); return( errnode() ); } else { if(p->vdim) { s = 0; for(q = p->vdim->datap ; q ; q = q->nextp) s = mkchain( mkint(1), s); subscript(p, mknode(TLIST,0,s,PNULL) ); } } p->vtype = TYSTRUCT; p->vtypep = t->varp; return(p); } mkequiv(p) ptr p; { ptr q, t; int first; swii(iefile); putic(ICBEGIN, 0); putic(ICINDENT, 0); putic(ICKEYWORD, FEQUIVALENCE); putic(ICOP, OPLPAR); first = 1; for(q = p ; q ; q = q->nextp) { if(first) first = 0; else putic(ICOP, OPCOMMA); prexpr( t = simple(LVAL,q->datap) ); frexpr(t); } putic(ICOP, OPRPAR); swii(icfile); frchain( &p ); } mkgeneric(gname,atype,fname,ftype) char *gname, *fname; int atype, ftype; { register ptr p; ptr generic(); if(p = generic(gname)) { if(p->genfname[atype]) fatal1("generic name already defined", gname); } else { p = ALLOC(genblock); p->tag = TGENERIC; p->nextgenf = generlist; generlist = p; p->genname = gname; } p->genfname[atype] = fname; p->genftype[atype] = ftype; } ptr generic(s) char *s; { register ptr p; for(p= generlist; p ; p = p->nextgenf) if(equals(s, p->genname)) return(p); return(0); } knownfunct(s) char *s; { register ptr p; for(p = knownlist ; p ; p = p->nextfunct) if(equals(s, p->funcname)) return(p->functype); return(0); } ptr funcinv(p) register ptr p; { ptr fp, fp1; register ptr g; char *s; register int t; int vt; if(g = generic(s = p->leftp->sthead->namep)) { if(p->rightp->tag==TLIST && p->rightp->leftp && ( (vt = typearg(p->rightp->leftp)) >=0) && (t = g->genftype[vt]) ) { p->leftp = builtin(t, g->genfname[vt]); } else { dclerr("improper use of generic function", s); frexpr(p); return( errnode() ); } } fp = p->leftp; setvproc(fp, PROCYES); fp1 = fp->sthead->varp; s = fp->sthead->namep; if(p->vtype==TYUNDEFINED && fp->vclass!=CLARG) if(t = knownfunct(s)) { p->vtype = t; setvproc(fp, PROCINTRINSIC); setvproc(fp1, PROCINTRINSIC); fp1->vtype = t; builtin(t,fp1->sthead->namep); cpblock(fp1, fp, sizeof(struct exprblock)); } dclit(p); return(p); } typearg(p0) register chainp p0; { register chainp p; register int vt, maxt; if(p0 == NULL) return(-1); maxt = p0->datap->vtype; for(p = p0->nextp ; p ; p = p->nextp) if( (vt = p->datap->vtype) > maxt) maxt = vt; for(p = p0 ; p ; p = p->nextp) p->datap = coerce(maxt, p->datap); return(maxt); } ptr typexpr(t,e) register ptr t, e; { ptr e1; int etag; if(t->atdim!=0 || (e->tag==TLIST && t->attype!=TYCOMPLEX) ) goto typerr; switch(t->attype) { case TYCOMPLEX: if(e->tag==TLIST) if(e->leftp==0 || e->leftp->nextp==0 || e->leftp->nextp->nextp!=0) { exprerr("bad conversion to complex", ""); return( errnode() ); } else { e->leftp->datap = simple(RVAL, e->leftp->datap); e->leftp->nextp->datap = simple(RVAL, e->leftp->nextp->datap); if(isconst(e->leftp->datap) && isconst(e->leftp->nextp->datap) ) return( compconst(e) ); e1 = mkcall(builtin(TYCOMPLEX,"cmplx"), arg2( coerce(TYREAL,e->leftp->datap), coerce(TYREAL,e->leftp->nextp->datap))); frchain( &(e->leftp) ); frexpblock(e); return(e1); } case TYINT: case TYREAL: case TYLREAL: case TYLOG: case TYFIELD: e = coerce(t->attype, simple(RVAL, e) ); etag = e->tag; if(etag==TAROP || etag==TLOGOP || etag==TRELOP) e->needpar = YES; return(e); case TYCHAR: case TYSTRUCT: goto typerr; } typerr: exprerr("typexpr not fully implemented", ""); frexpr(e); return( errnode() ); } ptr compconst(p) register ptr p; { register ptr a, b; int as, bs; int prec; prec = TYREAL; p = p->leftp; if(p == 0) goto err; if(p->datap->vtype == TYLREAL) prec = TYLREAL; a = coerce(TYLREAL, p->datap); p = p->nextp; if(p->nextp) goto err; if(p->datap->vtype == TYLREAL) a = coerce(prec = TYLREAL,a); b = coerce(TYLREAL, p->datap); if(a->tag==TNEGOP) { as = '-'; a = a->leftp; } else as = ' '; if(b->tag==TNEGOP) { bs = '-'; b = b->leftp; } else bs = ' '; if(a->tag!=TCONST || a->vtype!=prec || b->tag!=TCONST || b->vtype!=prec ) goto err; if(prec==TYLREAL && tailor.lngcxtype==NULL) { ptr q, e1, e2; struct dimblock *dp; sprintf(msg, "_const%d", ++constno); q = mkvar(mkname(msg)); q->vtype = TYLREAL; dclit(q); dp = ALLOC(dimblock); dp->upperb = mkint(2); q->vdim = mkchain(dp,CHNULL); sprintf(msg, "%c%s", as, a->leftp); e1 = mkconst(TYLREAL, msg); sprintf(msg, "%c%s", bs, b->leftp); e2 = mkconst(TYLREAL, msg); mkinit(q, mknode(TLIST,0, mkchain(e1,mkchain(e2,CHNULL)),PNULL) ); cfree(q->vdim); q->vtype = TYLCOMPLEX; return(q); } else { sprintf(msg, "(%c%s, %c%s)", as, a->leftp, bs, b->leftp); return( mkconst(TYCOMPLEX, msg) ); } err: exprerr("invalid complex constant", ""); return( errnode() ); } ptr mkchcon(p) char *p; { register ptr q; char buf[10]; sprintf(buf, "_const%d", ++constno); q = mkvar(mkname(buf)); q->vtype = TYCHAR; q->vtypep = mkint(strlen(p)); mkinit(q, mkconst(TYCHAR, p)); return(q); } ptr mksub1() { return( mknode(TLIST,0, mkchain(mkint(1),CHNULL), PNULL) ); } q->vtype = ((cmd/efl/namgen.c 644 0 33 12033 2405462621 6775 #include "defs" impldecl(p) register ptr p; { extern char *types[]; register ptr q; int n; if(p->vtype==TYSUBR) return; if(p->tag == TCALL) { impldecl(p->leftp); p->vtype = p->leftp->vtype; p->vtypep = p->leftp->vtypep; return; } if(inbound) n = TYINT; else { n = impltype[p->sthead->namep[0] - 'a' ]; if(n==TYREAL && p->vprec!=0) n = TYLREAL; sprintf(msg, "%s implicitly typed %s",p->sthead->namep, types[n]); warn(msg); } q = p->sthead->varp; p->vtype = q->vtype = n; if(p->blklevel>1 && p->vdclstart==0) { p->blklevel = q->blklevel = p->sthead->blklevel = 1; p->vdclstart = q->vdclstart = 1; --ndecl[blklevel]; ++ndecl[1]; } } extname(p) register ptr p; { register int i; register char *q, *s; /* if(p->vclass == CLARG) return; */ if(p->vextbase) return; q = p->sthead->namep; setvproc(p, PROCYES); /* external names are automatically at block level 1 */ if( (i =p->blklevel) >1) { p->sthead->blklevel = 1; p->blklevel = 1; p->sthead->varp->blklevel = 1; ++ndecl[1]; --ndecl[i]; } if(p->vclass!=CLUNDEFINED && p->vclass!=CLARG) { dclerr("illegal class for procedure", q); return; } if(p->vclass!=CLARG && strlen(q)>XL) { if(! ioop(q) ) dclerr("procedure name too long", q); return; } if(lookftn(q) > 0) dclerr("procedure name already used", q); else { for(i=0 ; ivbase[i]) break; if(i < NFTNTYPES) p->vextbase = p->vbase[i]; else p->vextbase = nxtftn(); if(p->vext==0 || p->vclass!=CLARG) for(s = ftnames[ p->vextbase ]; *s++ = *q++ ; ) ; return; } } dclit(p) register ptr p; { register ptr q; if(p->tag == TERROR) return; q = p->sthead->varp; if(p->tag == TCALL) { dclit(p->leftp); if( ioop(p->leftp->sthead->namep) ) p->leftp->vtype = TYLOG; p->vtype = p->leftp->vtype; p->vtypep = p->leftp->vtypep; return; } if(q->vdcldone == 0) mkftnp(q); if(p != q) cpblock(q,p, sizeof(struct exprblock)); } mkftnp(p) register ptr p; { int i,k; if(inbound || p->vdcldone) return; if(p == 0) fatal("mkftnp: zero argument"); if(p->tag!=TNAME && p->tag!=TTEMP) badtag("mkftnp", p->tag); if(p->vtype == TYUNDEFINED) if(p->vextbase) return; else impldecl(p); p->vdcldone = 1; switch(p->vtype) { case TYCHAR: case TYINT: case TYREAL: case TYLREAL: case TYLOG: case TYCOMPLEX: case TYLCOMPLEX: p->vbase[ eflftn[p->vtype] ] = nxtftn(); break; case TYSTRUCT: k = p->vtypep->basetypes; for(i=0; ivbase[i] = nxtftn(); break; case TYSUBR: break; default: fatal1("invalid type for %s", p->sthead->namep); break; } } namegen() { register ptr p; register struct stentry **hp; register int i; for(hp = hashtab ; hpvarp) ) if(p->tag == TNAME) mkft(p); for(p = gonelist ; p ; p = p->nextp) mkft(p->datap); for(p = hidlist ; p ; p = p->nextp) if(p->datap->tag == TNAME) mkft(p->datap); for(p = tempvarlist ; p ; p = p->nextp) mkft(p->datap); TEST fprintf(diagfile, "Fortran names:\n"); TEST for(i=1; i<=nftnames ; ++i) fprintf(diagfile, "%s\n", ftnames[i]); } mkft(p) register ptr p; { int i; register char *s, *t; if(p->vnamedone) return; if(p->vdcldone==0 && p!=procname) { if(p->vext && p->vtype==TYUNDEFINED) p->vtype = TYSUBR; else if(p->vextbase==0 && p->vadjdim==0 && p->vclass!=CLCOMMON) warn1("%s never used", p->sthead->namep); mkftnp(p); } if(p->vextbase) mkftname(p->vextbase, p->sthead->namep); for(i=0; ivbase[i] != 0) if(p!=procname && p->vextbase!=0) { s = ftnames[p->vextbase]; t = ftnames[p->vbase[i]]; while(*t++ = *s++ ) ; } else if(p->sthead) mkftname(p->vbase[i], p->sthead->namep); else mkftname(p->vbase[i], CHNULL); p->vnamedone = 1; } mkftname(n,s) int n; char *s; { int i, j; register int k; char fn[7]; register char *c1, *c2; if(ftnames[n][0] != '\0') return; if(s==0 || *s=='\0') s = "temp"; else if(*s == '_') ++s; k = strlen(s); for(i=0; i XL) { s += (k-XL); k = XL; } for( ; itag = TFTNBLOCK; p->vtype = type; p->vdcldone = 1; if( (k = lookftn(name)) == 0) { k = nxtftn(); strcpy(ftnames[k], name); } p->vbase[ eflftn[type] ] = k; p->vextbase = k; return(p); } (nftnames); } fatal("too many Fortran names generated"); /* NOTREACHED */ } lookftn(s) char *s; { register int i; for(i=1 ; i<=nftnames ; ++i) if(equals(ftnames[i],s)) return(i); return(0); } ptr mkftnblock(type, name) int type; char *name; { register struct varblock *p; register int k; p = allexpblock(); p->tag = TFTNBLOCK; p->vtype = type; p->vdcldone = 1; if( (k = lookftn(name)) == 0) { k = nxtftn(); strcpy(ftnames[k], name); } p->vbase[ eflftn[type] ] = k; p->cmd/efl/pass2.c 644 0 33 12237 2405462622 6567 #include "defs" #include static int indent; char *verb[] = { " ", " ", "continue", "call ", "do ", "if ", "if ", "goto ", "return", "read ", "write ", "format ", "stop ", "data ", "equivalence ", "common ", "external ", "rewind", "backspace", "endfile", "subroutine ", "function ", "program", "blockdata", "end", CNULL }; extern char *ops[]; ptr getsii(); /* generate code */ pass2() { exnull(); if(comments) putcomment(); if(verbose) fprintf(diagfile, " Pass 2\n"); dclsect = 0; indent = 0; namegen(); dclgen(); body(iefile); datas(); body(icfile); p2stmt(0); p2key(FEND); p2flush(); if(verbose) fprintf(diagfile, " Pass 2 done\n"); } datas() { register int c, n; int n1; rewii(idfile); swii(idfile); for( ; ; ) { c = getic(&n1); n = n1; switch(c) { case ICEOF: return; case ICMARK: break; case ICBLANK: putblank(n); break; case ICNAME: if(*ftnames[n] == '\0') fatal1("no name for n=%d", n); p2stmt(0); p2key(FDATA); p2str( ftnames[n] ); break; case ICOP: p2str( ops[n] ); break; case ICCONST: p2str( getsii(n) ); break; default: fatal1("datas: invalid intermediate tag %d", c); } } } body(fileadd) struct fileblock **fileadd; { int n1; register int n; register int c; int prevc; int ifn; rewii(fileadd); swii(fileadd); prevc = 0; ifn = 0; for(;;) { c = getic(&n1); n = n1; switch(c) { case ICEOF: return; case ICBEGIN: if(n != 0) { if(prevc) p2key(FCONTINUE); else prevc = 1; p2stmt( stnos[n] ); } else if(!prevc) p2stmt(0); break; case ICKEYWORD: p2key(n); if(n != FIF2) break; getic(&ifn); if( indifs[ifn] ) skipuntil(ICMARK) ; break; case ICOP: p2str( ops[n] ); break; case ICNAME: if(*ftnames[n]=='\0') fatal1("no name for n=%d", n); p2str( ftnames[n] ); break; case ICCOMMENT: if(prevc) p2key(FCONTINUE); p2com(n); break; case ICBLANK: putblank(n); break; case ICCONST: p2str( getsii(n) ); break; case ICINDPTR: n = indifs[n]; case ICLABEL: p2str(" "); p2int( stnos[n] ); break; case ICMARK: if( indifs[ifn] ) { p2str(" "); p2key(FGOTO); p2int( stnos[ indifs[ifn] ] ); } else { skipuntil(ICINDENT); p2str(" "); } break; case ICINDENT: indent = n * INDENTSPACES; p2indent(indent); break; default: sprintf(msg, "Bad pass2 value %o,%o", c,n); fatal(msg); break; } if(c!=ICBEGIN && c!=ICINDENT) prevc = 0; } } putname(p) register ptr p; { register int i; if(p->vextbase) { putic(ICNAME, p->vextbase); return; } for(i=0 ; ivbase[i]) { putic(ICNAME, p->vbase[i]); return; } if(strlen(p->sthead->namep) <= XL) fatal1("no fortran slot for name %s", p->sthead->namep); } putconst(ty, p) int ty; char *p; { ptr mkchcon(); if(ty != TYCHAR) putsii(ICCONST,p); else /* change character constant to a variable */ putname( mkchcon(p) ); } putzcon(p) register ptr p; { char buff[100]; sprintf(buff, "(%s,%s)", p->leftp, p->rightp); putsii(ICCONST,buff); } putcomment() { register ptr p; for(p = comments ; p ; p = p->nextp) { putsii(ICCOMMENT, p->datap); cfree(p->datap); } frchain(&comments); } putblank(n) int n; { while(n-- > 0) p2putc(' '); } skipuntil(k) int k; { register int i; int n; while( (i = getic(&n))!=k && i!=ICEOF) if(i==ICCOMMENT || i==ICCONST) getsii(n); } p2int(n) /* put an integer constant in the output */ int n; { p2str( convic(n) ); } p2key(((n) /* print a keyword */ int n; { p2str( verb[n] ); } p2str(s) /* write a character string on the output */ char *s; { int n; n = strlen(s); if(nftnch==LINESPACES-1 && (n==1 || (n==2 && s[1]==' ')) ) p2putc(s[0]); else { if( n<=LINESPACES && nftnch+n>LINESPACES-1 ) p2line( min(LINESPACES-n , indent+INDENTSPACES) ); while(*s) p2putc(*s++); } } p2stmt(n) /* start a statement with label n */ int n; { if(n > 0) fprintf(codefile,"\n%4d ", n); else fprintf(codefile,"\n "); nftnch = 0; nftncont = 0; } p2com(n) /* copy a comment */ int n; { register int k; register char *q; q = getsii(n); if(q[0] == '%') /* a literal escape line */ { putc('\n', codefile); while(--n > 0) putc(*++q, codefile); } else /* actually a comment line */ { ++q; --n; do { k = (n>71 ? 71 : n); fprintf(codefile, "\n"); putc( tailor.ftnsys==CRAY ? 'C' : 'c' , codefile); while(k-- > 0) putc(*q++, codefile); n -= 71; } while(n > 0); } } p2flush() { if(nftnch > 0) { fprintf(codefile, "\n"); nftnch = 0; } } p2putc(c) char c; { if(nftnch >= LINESPACES) /* end of line */ p2line(0); if(tailor.ftnsys == CRAY) putc( islower(c) ? toupper(c) : c , codefile); else putc(c, codefile); ++nftnch; } p2line(in) int in; { register char contchar; if(++nftncont > 19) { execerr("too many continuation lines", CNULL); contchar = 'X'; } if(tailor.ftncontnu == 1) fprintf(codefile, "\n&"); else { /* standard column-6 continuation */ if(nftncont < 20) contchar = "0123456789ABCDEFGHIJ" [nftncont]; fprintf(codefile, "\n %c", contchar); } nftnch = 0; if(in > 0) p2indent(in); } p2indent(n) register int n; { while(n-- > 0) p2putc(' '); } c) : c , codefile); else putc(c, codefile); ++nftnch; } p2line(in) int in; { register char contchar; if(++nftncont > 19) { execerr("too many continuation lines", CNULL); contchar = 'X'; } if(tailor.ftncontnu == 1) fprintf(codefile, "\n&"); else { /* standard column-6 continuation */ if(nftncont < 20) contchar = "0123456789ABCDEFGHIJ" [nftcmd/efl/print.c 644 0 33 7516 2405462624 6661 #include "defs" char *ops[ ] = { "", "+", "-", "*", "/", "**", ".not. ", " .and. ", ".andand.", ".oror.", " .or. ", " .eq. ", " .lt. ", " .gt. ", " .le. ", " .ge. ", " .ne. ", "(", ")", " = ", ", " }; int opprecs[ ] = { 0, 7, 7, 8, 8, 9, 5, 4, 4, 3, 3, 6, 6, 6, 6, 6, 6, 10, 10, 1, 0 }; char *qualops[ ] = { "", "->", ".", " of ", " sub " }; char *classes[ ] = { "", "arg ", "valarg ", "static ", "auto ", "common ", "mos ", "external ", "statement function " }; char *precs[ ] = { "", "long " }; char *types[ ] = { "", "integer ", "real ", "double precision ", "logical ", "complex ", "char ", "type " }; char *ftntypes[] = { "integer ", "real ", "logical ", "complex ", "double precision ", 0, 0 }; char *langs[] = { "pfort", "ratfor", "efl"}; propts() { fprintf(diagfile, "Options: "); fprintf(diagfile, "%s ", langs[langopt]); fprintf(diagfile, "%s ", (dbgopt ? "debug" : "ndebug") ); fprintf(diagfile, "%s ", (dotsopt? "dotson" : "dotsoff") ); fprintf(diagfile, "\n"); } prexpr(e) ptr e; { if(e) prexp1(e, 0,0,0); } prexp1(e, prec, subt, leftside) register ptr e; int prec, subt, leftside; { ptr p, q; int prec1, needpar; needpar = 0; switch(e->tag) { case TERROR: break; case TCONST: TEST fprintf(diagfile, "%s", e->leftp); if(e->rightp) putzcon(e); else putconst(e->vtype, e->leftp); break; case TFTNBLOCK: putname(e); break; case TNAME: if(e->sthead == 0) fatal("name without entry"); TEST fprintf(diagfile, "%s", e->sthead->namep); putname(e); if(e->vsubs) prexp1(e->vsubs, 0,0,0); break; case TTEMP: TEST fprintf(diagfile, "(fakename %o)", e); putname(e); break; case TLIST: if(e->leftp == 0) break; TEST fprintf(diagfile, "( "); putic(ICOP, OPLPAR); for(p=e->leftp ; p!=0 ; p = p->nextp) { prexp1(p->datap, 0,0,0); if(p->nextp) { TEST fprintf(diagfile, " , "); putic(ICOP, OPCOMMA); } } TEST fprintf(diagfile, " )"); putic(ICOP, OPRPAR); break; case TSTFUNCT: fprintf(diagfile, "statement function "); prexp1(e->leftp, 0,0,0); TEST fprintf(diagfile, " = "); putic(ICOP, OPEQUALS); prexp1(e->rightp, 0,0,0); break; case TAROP: if(e->subtype==OPSTAR && e->leftp->tag!=TCONST && e->rightp->tag==TCONST) { q = e->leftp; e->leftp = e->rightp; e->rightp = q; } case TLOGOP: prec1 = opprecs[e->subtype]; goto print; case TNOTOP: prec1 = 5; if(prec > 1) /* force parens */ needpar = 1; goto print; case TNEGOP: if(prec > 1) /* force parens */ needpar = 1; prec1 = 8; goto print; case TASGNOP: prec1 = 1; goto print; case TRELOP: prec1 = 6; goto print; case TCALL: prec1 = 10; goto print; case TREPOP: prec1 = 2; goto print; print: if(prec1 < prec ) needpar = 1; else if(prec1 == prec) if(e->needpar) needpar = 1; else if(subt == e->subtype) needpar |= ! (e->tag==TLOGOP || leftside || subt==0 || subt==OPPLUS || subt==OPSTAR); else needpar |= ! (leftside || subt==OPPLUS || subt==OPSTAR); if(needpar) { putic(ICOP,OPLPAR); TEST fprintf(diagfile, "("); } if(e->rightp != 0) { prexp1(e->leftp, prec1, e->subtype, 1); switch(e->tag) { case TASGNOP: TEST fprintf(diagfile, "="); putic(ICOP, OPEQUALS); if(e->subtype != 0) prexp1(e->leftp, prec1, 0, 1); case TAROP: case TNEGOP: case TLOGOP: case TNOTOP: case TRELOP: if(e->subtype) { TEST fprintf(diagfile, " %s ", ops[e->subtype]); putic(ICOP, e->subtype); } break; case TCALL: TEST fprintf(diagfile, " %s ", qualops[e->subtype]); break; case TREPOP: TEST fprintf(diagfile, "$"); break; } prexp1(e->rightp, prec1,e->subtype, 0); } else { /* e->rightp == 0 */ TEST fprintf(diagfile, " %s ", ops[e->subtype]); putic(ICOP, e->subtype); prexp1(e->leftp, prec1,e->subtype, 0); } if(needpar) { putic(ICOP, OPRPAR); TEST fprintf(diagfile, ")"); } break; default: badtag("prexp1", e->tag); break; } } OP, e->subtype); } break; case TCALL: TEST fprintf(diagfile, " %s ", qualops[e->subtype]); break; case TREPOP: TEST fprintf(diagfile, "$"); break; }cmd/efl/simple.c 644 0 33 27445 2405462625 7042 #include #include "defs" /* basic simplifying procedure */ ptr simple(t,e) int t; /* take on the values LVAL, RVAL, and SUBVAL */ register ptr e; /* points to an expression */ { int tag, subtype; ptr lp, rp; int ltag; int lsubt; ptr p, e1; ptr exio(), exioop(), dblop(), setfield(), gentemp(); int a,b,c; top: if(e == 0) return(0); tag = e->tag; subtype = e->subtype; if(lp = e->leftp) { ltag = lp->tag; lsubt = lp->subtype; } rp = e->rightp; TEST fprintf(diagfile, "simple(%d; tag %d,%d)\n", t,tag,subtype); switch(tag){ case TNOTOP: switch(ltag) { case TNOTOP: /* not not = yes */ frexpblock(e); e = lp->leftp; frexpblock(lp); goto top; case TLOGOP: /* de Morgan's Law */ lp->subtype = (OPOR+OPAND) - lp->subtype; lp->leftp = mknode(TNOTOP,OPNOT,lp->leftp, PNULL); lp->rightp=mknode(TNOTOP,OPNOT,lp->rightp, PNULL); frexpblock(e); e = lp; goto top; case TRELOP: /* reverse the condition */ lp->subtype = (OPEQ+OPNE) - lp->subtype; frexpblock(e); e = lp; goto top; case TCALL: case TASGNOP: e->leftp = simple(RVAL,lp); case TNAME: case TFTNBLOCK: lp = simple(RVAL,lp); case TTEMP: if(t == LVAL) e = simple(LVAL, mknode(TASGNOP,0, gentemp(e->leftp), e)); break; case TCONST: if(equals(lp->leftp, ".false.")) e->leftp = copys(".true."); else if(equals(lp->leftp, ".true.")) e->leftp = copys(".false."); else goto typerr; e->tag = TCONST; e->subtype = 0; cfree(lp->leftp); frexpblock(lp); break; default: goto typerr; } break; case TLOGOP: switch(subtype) { case OPOR: case OPAND: goto binop; case OP2OR: case OP2AND: lp = e->leftp = simple(RVAL, lp); if(lp->tag != TTEMP) lp = simple(RVAL, mknode(TASGNOP,0, gent(TYLOG,0),lp)); return( simple(LVAL, mknode(TASGNOP,subtype,lp,rp)) ); default: fatal("impossible logical operator"); } case TNEGOP: lp = e->leftp = simple(RVAL,lp); ltag = lp->tag; lsubt = lp->subtype; if(ltag==TNEGOP) { frexpblock(e); e = lp->leftp; frexpblock(lp); goto top; } else goto lvcheck; case TAROP: case TRELOP: binop: e->leftp = simple(RVAL,lp); lp = e->leftp; ltag = lp->tag; lsubt = lp->subtype; e->rightp= simple(RVAL,rp); rp = e->rightp; if(tag==TAROP && isicon(rp,&b) ) { /* simplify a*1, a/1 , a+0, a-0 */ if( ((subtype==OPSTAR||subtype==OPSLASH) && b==1) || ((subtype==OPPLUS||subtype==OPMINUS) && b==0) ) { frexpr(rp); mvexpr(lp,e); goto top; } if(isicon(lp, &a)) /* try folding const op const */ { e1 = fold(e); if(e1!=e || e1->tag!=TAROP) { e = e1; goto top; } } if(ltag==TAROP && lp->needpar==0 && isicon(lp->rightp,&a) ) { /* look for cases of (e op const ) op' const */ if( (subtype==OPPLUS||subtype==OPMINUS) && (lsubt==OPPLUS||lsubt==OPMINUS) ) { /* (e +- const) +- const */ c = (subtype==OPPLUS ? 1 : -1) * b + (lsubt==OPPLUS? 1 : -1) * a; if(c > 0) subtype = OPPLUS; else { subtype = OPMINUS; c = -c; } fixexpr: fre((xpr(rp); frexpr(lp->rightp); frexpblock(e); e = lp; e->subtype = subtype; e->rightp = mkint(c); goto top; } else if(lsubt==OPSTAR && ( (subtype==OPSTAR) || (subtype==OPSLASH && a%b==0)) ) { /* (e * const ) (* or /) const */ c = (subtype==OPSTAR ? a*b : a/b ); subtype = OPSTAR; goto fixexpr; } } if(ltag==TAROP && (lsubt==OPPLUS || lsubt==OPMINUS) && subtype==OPSLASH && divides(lp,conval(rp)) ) { e->leftp = mknode(TAROP,OPSLASH,lp->leftp, cpexpr(rp)); e->rightp = mknode(TAROP,OPSLASH,lp->rightp, rp); e->subtype = lsubt; goto top; } } else if( tag==TRELOP && isicon(lp,&a) && isicon(rp,&b) ) { e1 = fold(e); if(e1!=e || e1->tag!=TRELOP) { e = e1; goto top; } } lvcheck: if(t == LVAL) e = simple(LVAL, mknode(TASGNOP,0, gentemp(e),e)); else if(t == SUBVAL) { /* test for legal Fortran c*v +-c form */ if(tag==TAROP && (subtype==OPPLUS || subtype==OPMINUS)) if(rp->tag==TCONST && rp->vtype==TYINT) { if(!cvform(lp)) e->leftp = simple(SUBVAL, lp); } else goto makesub; else if( !cvform(e) ) goto makesub; } break; case TCALL: if( lp->tag!=TFTNBLOCK && ioop(lp->sthead->namep) ) { e = exioop(e, YES); exlab(0); break; } e->rightp = simple(RVAL, rp); if(t == SUBVAL) goto makesub; if(t == LVAL) e = simple(RVAL, mknode(TASGNOP,0, gentemp(e),e)); break; case TNAME: if(e->voffset) fixsubs(e); if(e->vsubs) e->vsubs = simple(SUBVAL, e->vsubs); if(t==SUBVAL && !vform(e)) goto makesub; case TTEMP: case TFTNBLOCK: case TCONST: if(t==SUBVAL && e->vtype!=TYINT) goto makesub; break; case TASGNOP: lp = e->leftp = simple(LVAL,lp); if(subtype==OP2OR || subtype==OP2AND) e = dblop(e); else { rp = e->rightp = simple(RVAL,rp); if(e->vtype == TYCHAR) excall(mkcall(mkftnblock(TYSUBR,"ef1asc"), arg4(cpexpr(lp),rp))); else if(e->vtype == TYSTRUCT) { if(lp->vtypep->strsize != rp->vtypep->strsize) fatal("simple: attempt to assign incompatible structures"); e1 = mkchain(cpexpr(lp),mkchain(rp, mkchain(mkint(lp->vtypep->strsize),CHNULL))); excall(mkcall(mkftnblock(TYSUBR,"ef1ass"), mknode(TLIST, 0, e1, PNULL) )); } else if(lp->vtype == TYFIELD) lp = setfield(e); else { if(subtype != OPASGN) /* but is one of += etc */ { rp = e->rightp = simple(RVAL, mknode( (subtype<=OPPOWER?TAROP:TLOGOP),subtype, cpexpr(e->leftp),e->rightp)); e->subtype = OPASGN; } exlab(0); prexpr(e); frexpr(rp); } frexpblock(e); e = lp; if(t == SUBVAL) goto top; } break; case TLIST: for(p=lp ; p ; p = p->nextp) p->datap = simple(t, p->datap); break; case TIOSTAT: e = exio(e, 1); break; default: break; } return(e); typerr: exprerr("type match error", CNULL); return(e); makesub: if(t==SUBVAL && e->vtype!=TYINT) warn1("Line %d. Non-integer subscript", yylineno); return( simple(RVAL, mknode(TASGNOP,0,gent(TYINT,PNULL),e)) ); } ptr fold(e) register ptr e; { int a, b, c; register ptr lp, rp; lp = e->leftp; rp = e->rightp; if(lp->tag!=TCONST && lp->tag!=TNEGOP) return(e); if(rp->tag!=TCONST && rp->tag!=TNEGOP) return(e); switch(e->tag) { case TAROP: if( !isicon(lp,&a) || !isicon(rp,&b) ) return(e); switch(e->subtype) { case OPPLUS: c = a + b;break; case OPMINUS: c = a - b; break; case OPSTAR: c = a * b; break; case OPSLASH: if(a%b!=0 && (a<0 || b<0) ) return(e); c = a / b; break; case OPPOWER: return(e); default: fatal("fold: illegal binary operator"); } frexpr(e); if(c >= 0) return( mkint(c) ); else return(mknode(TNEGOP,OPMINUS, mkint(-c), PNULL) ); case TRELOP: if( !isicon(lp,&a) || !isicon(rp,&b) ) return(e); frexpr(e); switch(e->subtype) { case OPEQ: c = a == b; break; case OPLT: c = a < b ; break; case OPGT: c = a > b; break; case OPLE: c = a <= b; break; case OPGE: c = a >= b; break; case OPNE: c = a != b; break; default: fatal("fold: invalid relational operator"); } return( mkconst(TYLOG, (c ? ".true." : ".false.")) ); case TLOGOP: if(lp->vtype!=TYLOG || rp->vtype!=TYLOG) return(e); a = equals(lp->leftp, ".true."); b = equals(rp->leftp, ".true."); frexpr(e); switch(e->subtype) { case OPAND: case OP2AND: c = a & b; break; case OPOR: case OP2OR: c = a | b; break; default: fatal("fold: invalid logical operator"); } return( mkconst(TYLOG, (c? ".true." : ".false")) ); default: return(e); } } #define TO + 100* ptr coerce(t,e) /* coerce expression e to type t */ int t; register ptr e; { register int et; int econst; char buff[100]; char *s, *s1; ptr conrep(), xfixf(); if(e->tag == TNEGOP) { e->leftp = coerce(t, e->leftp); goto settype; } et = e->vtype; econst = (e->tag == TCONST); TEST fprintf(diagfile, "coerce type %d to type %d\n", et, t); if(t == et) return(e); switch( et TO t ) { case TYCOMPLEX TO TYINT: case TYLREAL TO TYINT: e = coerce(TYREAL,e); case TYREAL TO TYINT: if(econst) e = xfixf(e); if(e->vtype != TYINT) e = mkcall(builtin(TYINT,"ifix"), arg1(e)); break; case TYINT TO TYREAL: if(econst) { e->leftp = conrep(e->leftp, "."); goto settype; } e = mkcall(builtin(TYREAL,"float"), arg1(e)); break; case TYLREAL TO TYREAL: if(econst) { for(s=e->leftp ; *s && *s!='d';++s) ; *s = 'e'; goto settype; } e = mkcall(builtin(TYREAL,"sngl"), arg1(e)); break; case TYCOMPLEX TO TYREAL: if(econst) { s1 = (char *)(e->leftp) + 1; s = buff; while(*s1!=',' && *s1!='\0') *s1++ = *s++; *s = '\0'; cfree(e->leftp); e->leftp = copys(buff); goto settype; } else e = mkcall(mkftnblock(TYREAL,"real"), arg1(e)); break; case TYINT TO TYLREAL: if(econst) { e->leftp = conrep(e->leftp,"d0"); goto settype; } case TYCOMPLEX TO TYLREAL: e = coerce(TYREAL,e); case TYREAL TO TYLREAL: if(econst) { for(s=e->leftp ; *s && *s!='e'; ++s) ; if(*s == 'e') *s = 'd'; else e->leftp = conrep(e->leftp,"d0"); goto settype; } e = mkcall(builtin(TYLREAL,"dble"), arg1(e)); break; case TYINT TO TYCOMPLEX: case TYLREAL TO TYCOMPLEX: e = coerce(TYREAL, e); case TYREAL TO TYCOMPLEX: if(e->tag == TCONST) { sprintf(buff, "(%s,0.)", e->leftp); cfree(e->leftp); e->leftp = copys(buff); goto settype; } else e = mkcall(builtin(TYCOMPLEX,"cmplx"), arg2(e, mkconst(TYREAL,"0."))); break; default: goto mismatch; } return(e); mismatch: exprerr("impossible conversion", ""); frexpr(e); return( errnode() ); settype: e->vtype = t; return(e); } /* check whether expression is in form c, v, or v*c */ cvform(p) register ptr p; { switch(p->tag) { case TCONST: return(p->vtype == TYINT); case TNAME: return(vform(p)); case TAROP: if(p->subtype==OPSTAR && p->rightp->tag==TCONST && p->rightp->vtype==TYINT && vform(p->leftp)) return(1); default: return(0); } } /* is p a simple integer variable */ vform(p) register ptr p; { return( p->tag==TNAME && p->vtype==TYINT && p->vdim==0 && p->voffset==0 && p->vsubs==0) ; } ptr dblop(p) ptr p; { ptr q; bgnexec(); if(p->subtype == OP2OR) q = mknode(TNOTOP,OPNOT, cpexpr(p->leftp), PNULL); else q = cpexpr(p->leftp); pushctl(STIF, q); bgnexec(); exasgn(cpexpr(p->leftp), OPASGN, p->rightp); ifthen(); popctl(); addexec(); return(p->leftp); } divides(a,b) ptr a; int b; { if(a->vtype!=TYINT) return(0); switch(a->tag) { case TNEGOP: return( divides(a->leftp,b) ); case TCONST: return( conval(a) % b == 0); case TAROP: switch(a->subtype) { case OPPLUS: case OPMINUS: return(divides(a->leftp,b)&& divides(a->rightp,b) ); case OPSTAR: return(divides(a->rightp,b)); default: return(0); } default: return(0); } /* NOTREACHED */ } /* truncate floating point constant to integer */ #define MAXD 100 ptr xfixf(e) struct exprblock *e; { char digit[MAXD+1]; /* buffer into which digits are placed */ char *first; /* points to first nonzero digit */ register char *end; /* points at position past last digit */ register char *dot; /* decimal point is immediately to left of this digit */ register char *s; int expon; dot = NULL; end = digit; expon = 0; for(s = e->leftp ; *s; ++s) if( isdigit(*s) ) { if(end-digit > MAXD) return(e); *end++ = *s; } else if(*s == '.') dot = end; else if(*s=='d' || *s=='e') { expon = convci(s+1); break; } else fatal1("impossible character %d in floating constant", *s); if(dot == NULL) dot = end; dot += expon; if(dot-digit > MAXD) return(e); for(first = digit; firstleftp); e->leftp = copys(first); e->vtype = TYINT; return(e); } return(e); *end++ = *s; } else if(*s == '.') dot = end; else if(*s=='d' || *s=='e') { expon = convci(s+1); break; } else fatal1("impossible character %d in floating constant", *s); if(dot == NULL) cmd/efl/struct.c 644 0 33 6476 2405462627 7060 #include "defs" offsets(s) register ptr s; { register ptr p, q; ptr t; ptr prevp; int n; int size, align, mask, nelt; double rshift; s->stralign = 1; s->strsize = 0; s->basetypes = 0; prevp = 0; rshift = 0; for(p = s->strdesc ; p ; p = p->nextp) { q = p->datap; if(q->vclass != 0) dclerr("attempt to give storage class to mos", q->namep); else q->vclass = CLMOS; if(q->vtype == TYUNDEFINED) impldecl(q); sizalign(q, &size, &align, &mask); s->strsize = evenoff(s->strsize, align); q->voffset =(( mkint(s->strsize); /* sloppy formula */ nelt = 1; if(t = q->vdim) for(t = t->datap ; t ; t = t->nextp) { if(t->upperb == 0) continue; n = conval(t->upperb); if(t->lowerb) n -= conval(t->lowerb)-1; nelt *= n; } if(q->vtype==TYFIELD && q->vdim==0 && (n=conval(q->vtypep->frange))*rshift<=fieldmax && rshift>0) { prevp->vtypep->fanymore = 1; q->vtypep->frshift = mkint( (int) rshift ); rshift *= n; cfree(q->voffset); q->voffset = mkint(s->strsize - tailor.ftnsize[FTNINT]); } else { if(q->vdim!=0 && q->vtype==TYFIELD) q->vtype = TYINT; rshift = (q->vtype==TYFIELD ? n : 0); s->strsize += nelt * evenoff(size,align); s->stralign = lcm(s->stralign, align); s->basetypes |= mask; } prevp = q; } } lcm(a,b) int a,b; { int ab, c; if( (ab = a*b) == 0) return(0); while(b) { c = a%b; a = b; b = c; } return(ab/a); } sizalign(p, s, a, m) register ptr p; int *s; int *a; int *m; { register int k, t; if(p->tag == TERROR) return; if(p->tag!=TNAME && p->tag!=TTEMP && p->tag!=TFTNBLOCK) badtag("sizalign", p->tag); switch(t = p->vtype) { case TYFIELD: case TYINT: case TYREAL: case TYLREAL: case TYCOMPLEX: case TYLOG: k = eflftn[t]; *s = tailor.ftnsize[k]; *a = tailor.ftnalign[k]; *m = ftnmask[k]; return; case TYLCOMPLEX: if(tailor.lngcxtype) { k = FTNDCOMPLEX; *s = tailor.ftnsize[FTNDCOMPLEX]; } else { k = FTNDOUBLE; *s = 2*tailor.ftnsize[k]; } *a = tailor.ftnalign[k]; *m = ftnmask[k]; return; case TYSTRUCT: *s = p->vtypep->strsize; *a = p->vtypep->stralign; *m = p->vtypep->basetypes; return; case TYCHAR: *s = tailor.ftnsize[FTNINT] * ceil(conval(p->vtypep), tailor.ftnchwd); *a = tailor.ftnalign[FTNINT]; *m = ftnmask[FTNINT]; return; case TYSUBR: *s = 1; *a = 1; *m = 1; dclerr("subroutine name as variable", p->sthead->namep); return; default: fatal1("sizalign: invalid type %d", t); } } evenoff(a,b) /* round a up to a multiple of b */ int a,b; { return(b * ceil(a,b)); } ceil(a,b) int a,b; { return( (a+b-1)/b ); } ptr esizeof(type, typep, dim) register int type; register ptr typep; ptr dim; { register int k; switch(type) { case TYFIELD: case TYINT: case TYREAL: case TYLREAL: case TYCOMPLEX: case TYLCOMPLEX: case TYLOG: k = tailor.ftnsize[ eflftn[type] ]; break; case TYSTRUCT: k = typep->strsize; break; case TYCHAR: k = tailor.ftnsize[FTNINT] * ceil(conval(typep), tailor.ftnchwd); break; default: exprerr("invalid sizeof", ""); k = 0; } /* debug version. should multiply by dimension */ return( mkint(k) ); } ptr elenof(type, typep, dim) register int type; register ptr typep; ptr dim; { if(type == TYCHAR) return( mkint( conval(typep) ) ); exprerr("invalid lengthof", ""); return( mkint(0) ); /* debug version. should multiply by dimension */ } case TYSTRUCT: k = typep->strsize; break; case TYCHAR: k = tailor.ftnsize[FTNINT] * ceil(conval(typep), tailor.ftnchwd); break; default: exprerr("invalid sizeof", ""); k = 0; cmd/efl/symtab.c 644 0 33 5644 2405462630 7021 #include "defs" #ifdef HASHEDTABLE /* Basic symbol table maintainer. Action depends on t: t = -1 Remove name from table t = 0 Put name in table if not there. Copy name string t = 1 Find name in table if there, otherwise return 0. t = 2 Put name in table if not there. Do not copy name */ struct stentry *hashtab[MAXEFLNAMES+1]; struct stentry **hashend = hashtab+MAXEFLNAMES+1; #define NEXT(x) (++xhashval && equals(s,p->namep)) switch(t) { case -1: cfree(p->namep); cfree(p); delhash(hp); --neflnames; return(0); case 0: case 1: case 2: return(p); default: fatal("name: illegal argument"); } /* not in table */ switch(t) { case -1: fatal1("cannot delete nonexistent name %s from symbol table", s); case 1: return(0); case 0: case 2: if(++neflnames >= MAXEFLNAMES) fatal("hash table full"); *hp = p = ALLOC(stentry); p->namep = (t==0 ? copys(s) : s); p->hashval = hash; return(p); default: fatal("illegal call to name"); } } hashfunct(s) register char *s; { register int h; h = 0; while(*s) h += *s++; return( h % (MAXEFLNAMES+1) ); } delhash(hp) struct stentry **hp; { struct stentry **hq, **hvp; for ( ; ; ) { *hp = 0; hq = hp; for(hp = NEXT(hp) ; *hp && ( (hq < (hvp = hashtab + (*hp)->hashval) && hvp<=hp) || (hphashval && equals(s,p->namep)) switch(t) { case -1: cfree(p->namep); cfree(p); *hp = 0; return(0); case 0: case 1: case 2: return(p); default: fatal("name: illegal argument"); } /* not in table */ switch(t) { case -1: fatal1("cannot delete nonexistent name %s from symbol table", s); case 1: return(0); case 0: case 2: /* look for an empty slot */ for(hp = hashtab ; hp= MAXEFLNAMES) fatal("hash table full"); else ++hashend; *hp = p = ALLOC(stentry); p->namep = (t==0 ? copys(s) : s); p->hashval = hash; return(p); default: fatal("illegal call to name"); } } hashfunct(s) register char *s; { register int h; h = 0; while(*s) h = *s++; return(h); } #endif me %s from symbol table", s); case 1: return(0); case 0: case 2: /* look for an empcmd/efl/tailor.c 644 0 33 10333 2405462631 7024 #include "defs" setopt(p,q) char *p; char *q; { int qval; qval = (q!=NULL) && ( equals(q, "yes") || equals(q, "on") ); if(equals(p,"debug")) dbgopt = 1; else if(equals(p,"ndebug")) dbgopt = 0; else if(equals(p,"pfort")) langopt = 0; else if(equals(p,"ratfor")) langopt = 1; else if(equals(p,"efl")) langopt = 2; else if(equals(p,"dots")) dotsopt = qval; else if(equals(p,"ioerror")) { if(equals(q,"none")) tailor.errmode = IOERRNONE; else if(equals(q,"ibm")) tailor.errmode = IOERRIBM; else if(equals(q,"fortran77")) tailor.errmode = IOERRFORT77; else execerr("unknown ioerror option %s", q); } else if(equals(p, "system")) { register struct system *sysp; for(sysp = systab ; sysp->sysname ; ++sysp) if( equals(q, sysp->sysname) ) break; if(sysp->sysname) tailinit(sysp); else execerr("unknown system %s", q); } else if(equals(p, "continue")) tailor.ftncontnu = equals(q, "column1"); else if(equals(p, "procheader")) tailor.procheader = (q ? copys(q) : 0); else if(equals(p, "hollincall")) tailor.hollincall = qval; else if(equals(p, "longcomplextype")) { tailor.lngcxtype = (q ? copys(q) : CNULL); if(qval) eflftn[TYLCOMPLEX] = FTNDCOMPLEX; } else if(equals(p, "longcomplexprefix")) tailor.lngcxprefix = (q ? copys(q) : CNULL); else if(equals(p, "fortran77")) { if(tailor.ftn77 = (q==NULL || qval) ) tailor.errmode = IOERRFORT77; else if(tailor.errmode == IOERRFORT77) tailor.errmode = IOERRNONE; } else if( !tailop(p,q) ) execerr("unknown option %s", p); if(langopt==2) setdot(dotsopt); else if(langopt==1) setdot(1); } tailinit(sysp) register struct system *sysp; { register int sysf = sysp->sysno; tailor.ftncontnu = (sysf==UNIX); tailor.ftnsys = sysf; tailor.ftnin = 5; tailor.ftnout = 6; tailor.errmode = (sysf==UNIX ? IOERRFORT77 : IOERRIBM); tailor.charcomp = 2; tailor.hollincall = YES; tailor.deltastno = 1; tailor.dclintrinsics = YES; tailsize(sysp->chperwd); tailfmt(sysp->idig, sysp->rdig, sysp->ddig); } tailsize(wordsize) int wordsize; { int i; tailor.ftnchwd = wordsize; tailor.ftnsize[FTNINT] = wordsize; tailor.ftnsize[FTNREAL] = wordsize; tailor.ftnsize[FTNLOG] = wordsize; tailor.ftnsize[FTNCOMPLEX] = 2*wordsize; tailor.ftnsize[FTNDOUBLE] = 2*wordsize; tailor.ftnsize[FTNDCOMPLEX] = 2*wordsize; for(i = 0 ; ioptn ; ++cp) if(equals(n, cp->optn)) { *(cp->coptloc) = copys(v); return(1); } for(ip = ints ; ip->optn ; ++ip) if(equals(n, ip->optn)) { if( equals(v, "yes") || equals(v, "on") ) val = 1; else if( equals(v, "no") || equals(v, "off") ) val = 0; else val = convci(v); *(ip->ioptloc) = val; return(1); } return(0); } lign[FTNREAL], "dalign", &tailor.ftnalign[FTNDOUBLE], "lalign", &tailor.ftnalign[FTNLOG], "zalign", &tailor.ftnalign[FTNCOMPLEX], 0, 0 }; for(cp = formats; cp->optn ; ++cp) if(equals(n, cp->optn)) { *(cp->coptloc) = copys(v); return(1); } for(ip = ints ; ip->optn ; ++ip) if(eqcmd/efl/temp.c 644 0 33 2002 2405462632 6452 #include "defs" ptr gentemp(t) ptr t; { register ptr oldp; register ptr p; register ptr q; int ttype; ptr ttypep, tdim; /* search the temporary list for a matching type */ ttype = t->vtype; ttypep = t->vtypep; tdim = t->vdim; for(oldp = &tempvarlist ; p = oldp->nextp ; oldp = p) if( (q = p->datap) && (q->vtype == ttype) && (q->vtypep == ttypep) && eqdim(q->vdim,tdim) ) { oldp->nextp = p->nextp; break; } if(p == PNULL) { q = allexpblock(); q->tag = TTEMP; q->subtype = t->subtype; q->vtype = ttype; q->vclass = t->vclass; q->vtypep = ( ttypep ? cpexpr(ttypep) : PNULL); q->vdim = tdim; mkftnp(q); /* assign fortran types */ p = mkchain(q, CHNULL); p->datap = q; } p->nextp = thisexec->temps; thisexec->temps = p; return( cpexpr(q) ); /* need a copy of the block for the temporary list and another for use */ } ptr gent(t,tp) /* make a temporary of type t, typepointer tp */ int t; ptr tp; { static struct varblock model; model.vtype = t; model.vtypep = tp; return( gentemp(&model) ); } = ttype; q->vclass = t->vclass; q->vtypep = ( ttypep ? cpexpr(ttypep) : PNULL); q->vdim = tdim; mkftnp(q); /* assign fortran types */ p = mkchain(q, CHNULL); p->datap = q; } p->nextp = thisexec->temps; thisexec->temps = p; return( cpexpr(q) ); /* need a copy of the block for the temporary list and another for use */ } ptr gent(t,tp) /* make a temporary of type t, typepointer tp */ int t; ptr tp; { static struct varblock model; model.vtype = t; model.vtypep = tp; return( gentemp(&model) ); cmd/efl/tokens 644 0 33 1071 2405462646 6601 EOS NEWLINE LPAR RPAR LBRACK RBRACK COMMA COLON ASGNOP REPOP OR AND NOT RELOP ADDOP MULTOP POWER DOUBLEADDOP ARROW QUALOP NAME OPTNAME STRUCTNAME COMNAME CONST COMMON INTERNAL EXTERNAL AUTOMATIC STATIC VALUE PROCEDURE BLOCKDATA OPTION INCLUDE DEFINE END INTEGER REAL COMPLEX LOGICAL CHARACTER STRUCT FIELD ARRAY DIMENSION LONG SHORT INITIAL EQUIVALENCE IMPLICIT DEBUG IF ELSE WHILE UNTIL REPEAT DO FOR SWITCH CASE DEFAULT GO GOTO BREAK EXIT NEXT RETURN CONTINUE CALL DOUBLE PRECISION DOUBLEPRECISION SIZEOF LENGTHOF LETTER READ WRITE READBIN WRITEBIN TRUE FALSE ESCAPE POP OR AND NOT RELOP ADDOP MULTOP POWER DOUBLEADDOP ARROW QUALOP NAME OPTNAME STRUCTNAME COMNAME CONST COMMON INTERNAL EXTERNAL AUTOMATIC STATIC VALUE PROCEDURE BLOCKDATA OPTION INCLUDE DEFINE END INTEGER REAL COMPLEX LOGICAL CHARACTER STRUCT FIELD ARRAY DIMENSION LONG SHORT INITIAL EQUIVALENCE IMPLICIT DEBUG IF ELSE WHILE UNTIL REPEAT DO FOR SWITCH CASE DEFAULT GO GOTO BREAK EXIT NEXT RETURN CONTINUE CALL DOUBLE PRECISION DOUBLEPRECISION SIZEOF LENGTcmd/efl/Makefile 644 0 33 3511 2412637035 7006 CFLAGS = -O -w LIBES = FILES1 = Makefile efl.1 defs tokens main.c init.c tailor.c\ gram.head gram.dcl gram.expr gram.exec\ lex.l fixuplex symtab.c\ dcl.c addr.c struct.c field.c misc.c alloc.c mk.c FILES2 = exec.c blklab.c simple.c print.c temp.c io.c error.c\ pass2.c icfile.c free.c dclgen.c namgen.c FILES = $(FILES1) $(FILES2) P = detab 0 6 12 18 24 30 36 42 48 54 60 66 72 | und -3 | opr -r2 OBJECTS = main.o init.o tailor.o gram.o lex.o symtab.o\ dcl.o addr.o struct.o field.o blklab.o\ mk.o misc.o alloc.o print.o simple.o exec.o temp.o io.o error.o\ pass2.o icfile.o free.o dclgen.o namgen.o a.out : $(OBJECTS) @echo LOAD @$(CC) $(CFLAGS) $(LDFLAGS) $(OBJECTS) $(LIBES) @size $(OBJECTS) : defs lex.o init.o : tokdefs # gram.c can no longer be made on a pdp11 because of yacc limits gram.c: gram.head gram.dcl gram.expr gram.exec tokdefs ( sed gram.in $(YACC) $(YFLAGS) gram.in (echo "#define YYDEBUG"; cat y.tab.c) > gram.c rm gram.in y.tab.c lex.c: fixuplex lex lex.l fixuplex mv lex.yy.c lex.c tokdefs: tokens grep -n . tokdefs clean: -rm a.out *.o gram.c lex.c tokdefs -du printall: -pr $(FILES1) | $P -pr $(FILES2) | $P touch print print: $(FILES) -pr $? | $P touch print lint: a.out lint -p *.c -lS install: a.out strip a.out -@size a.out /usr/bin/efl cp a.out ${DESTDIR}/usr/bin/efl test: a.out a.out "system=gcos" efltest/Hard.e >z1 2>z2 cmp z1 efltest/Hard.out a.out "system=gcos" efltest/Band.e >z1 2>z2 cmp z1 efltest/Band.out a.out "system=gcos" efltest/Buram.e >z1 2>z2 cmp z1 efltest/Buram.out a.out "system=gcos" efltest/Dgl.e >z1 2>z2 cmp z1 efltest/Dgl.out rm z1 z2 @echo TEST OK tape: $(FILES) gram.c lex.c a.out tar cb $(FILES) gram.c lex.c a.out nt lint: a.out lint -p *.c -lS install: a.out strip a.out -@size a.out /usr/bin/efl cp a.out ${DESTDIR}/usr/bin/efl test: a.out a.out "system=gcos" efltest/Hard.e >z1 2>z2 cmcmd/1kfix.c 444 0 33 4117 2423042073 5761 static char *sccsid = "@(#)1kfix.c 4.1 (Berkeley) 10/15/80"; #include #include #include #include char *malloc(); #define round(a,b) (((a)+((b)-1))&~(b-1)) main(argc, argv) int argc; char *argv[]; { char *tp, *dp, *sp; struct exec x, y; int io; char zeroes[NBPG]; --argc; ++argv; if (argc == 0) { fprintf(stderr, "usage: 1kfix file ...\n"); exit(1); } do { io = open(argv[0], 2); if (io < 0) { perror(argv[0]); argc--, argv++; continue; } if (read(io, &x, sizeof x) != sizeof x) goto format; switch (x.a_magic) { case OMAGIC: case NMAGIC: if ((round(x.a_text,NBPG) & CLOFSET) == 0) { fprintf(stderr, "%s: wins as is\n", argv[0]); goto skip; } break; case ZMAGIC: lseek(io, NBPG, 0); break; default: format: printf("%s: not object file\n", argv[0]); goto skip; } tp = malloc(x.a_text); dp = malloc(x.a_data); sp = malloc(x.a_syms); if (read(io, tp, x.a_text) != x.a_text || read(io, dp, x.a_data) != x.a_data || read(io, sp, x.a_syms) != x.a_syms) { fprintf(stderr, "%s: short read\n", argv[0]); goto skip; } close(io); io = creat(argv[0], 0755); if (io < 0) { perror(argv[0]); goto skip; } y = x; switch (x.a_magic) { case ZMAGIC: { int i; for (i = 0; i < 512; i++) if (tp[i] != 0) break; if (i == 512) printf("%s: already fixed\n", argv[0]); if (x.a_text & CLOFSET) { y.a_text -= NBPG; y.a_data += NBPG; } } break; case OMAGIC: case NMAGIC: y.a_text = round(x.a_text, NBPG) - NBPG; y.a_data += NBPG; if (y.a_text == 0) { fprintf(stderr, "%s: text size would be 0\n", argv[0]); goto skip; } } y.a_trsize = y.a_drsize = 0; write(io, (char *)&y, sizeof y); if (x.a_magic == ZMAGIC) lseek(io, BSIZE, 0); write(io, tp, x.a_text); if (x.a_magic != ZMAGIC) write(io, zeroes, round(x.a_text, NBPG) - x.a_text); write(io, dp, x.a_data); write(io, sp, x.a_syms); free(tp); free(dp); f((ree(sp); skip: argc--, argv++; close(io); } while (argc > 0); exit(0); } .a_data += NBPG; if (y.a_text == 0) { fprintf(stderr, "%s: text size would be 0\n", argv[0]); goto skip; } } y.a_trsize = y.a_drsize = 0; write(io, (char *)&y, sizeof y); if (x.a_magic == ZMAGIC) lseek(io, BSIZE, 0); write(io, tp, x.a_text); if (x.a_magic != ZMAGIC) write(io, zeroes, round(x.a_text, NBPG) - x.a_text); write(io, dp, x.a_data); write(io, sp, x.a_syms); free(tp); free(dp); fcmd/MAKE 755 0 33 10500 2662305470 5261 trap "" 1 CHOWN=/etc/chown DESTDIR=${DESTDIR-/} CC=cc if [ ! -d $DESTDIR/bin ] then : make sure directory hierarchy exists ( cd $DESTDIR for i in bin etc lib sys usr do if [ ! -d $i ] then rm -f $i; mkdir $i fi done cd $DESTDIR/usr for i in bin dict games include lib net spool ucb vpd do if [ ! -d $i ] then rm -f $i; mkdir $i fi done cd $DESTDIR/usr/include for i in local sys do if [ ! -d $i ] then rm -f $i; mkdir $i fi done cd $DESTDIR/usr/lib for i in learn lex lisp lint refer struct term tmac uucp do if [ ! -d $i ] then rm -f $i; mkdir $i fi done cd $DESTDIR/usr/net for i in bin network do if [ ! -d $i ] then rm -f $i; mkdir $i fi done cd $DESTDIR/usr/spool for i in lpd mail secretmail uucp uucppublic vpd do if [ ! -d $i ] then rm -f $i; mkdir $i fi done ) fi for i in $* do echo " ======== $i" CFLAGS='-O -d2' case $i in 512restor.c|analyze.c|arff.c|colcrt.c|dump.c|dumpdir.c|egrep.y|fgrep.c|\ ld.c|ndump.c|ncheck.c|ps.c|quot.c|ranlib.c|restor.c|sa.c|sort.c|\ tar.c|w.c|wc.c)\ CFLAGS='-O';; esac case $i in clean) rm -f *.o core y.tab.c lex.yy.c ;: Clean unwanted files. ;; *.y) B=`basename $i .y` eval D=`grep " $B\$" DESTINATIONS` yacc $B.y \ && $CC $CFLAGS -o $B y.tab.c -lln \ && install -s $B $DESTDIR$D/$B rm -f y.tab.[co] $B ;; *.l) B=`basename $i .l` eval D=`grep " $B\$" DESTINATIONS` lex $B.l \ && $CC $CFLAGS -o $B lex.yy.c -lln \ && install -s $B $DESTDIR$D/$B rm -f lex.yy.[co] $B ;; clear.c|more.c|ul.c) B=`basename $i .c` eval D=`grep " $B\$" DESTINATIONS` $CC $CFLAGS -o $B $B.c -ltermlib \ && install -s $B $DESTDIR$D/$B rm -f $B.o $B ;; comsat.c|lock.c) B=`basename $i .c` eval D=`grep " $B\$" DESTINATIONS` $CC $CFLAGS -o $B $B.c -ljobs \ && install -s $B $DESTDIR$D/$B rm -f $B.o $B ;; *.c) B=`basename $i .c` eval D=`grep " $B\$" DESTINATIONS` $CC $CFLAGS -o $B $B.c -lm \ && install -s $B $DESTDIR$D/$B rm -f $B.o $B ;; mklost+found.s|*.sh) B=`basename $i .sh` eval D=`grep " $B\$" DESTINATIONS` install -c $B.sh $DESTDIR$D/$B ;; *.s) B=`basename $i .s` eval D=`grep " $B\$" DESTINATIONS` as -o $B.o $B.s \ && $CC -o $B $B.o \ && install -s $B $DESTDIR$D/$B rm -f $B.o $B ;; MAKE|DESTINATIONS|SCCS|mip) echo Do nothing. ;; MODES) BINF=" df login mail mkdir mv passwd rmdir su" UBINF=" at newgrp" UCBF=" chfn chsh" LIBF=" atrun ex3.6preserve ex3.6recover" UULIBF="uucp/uuxqt uucp/uucico uucp/uuclean uucp/uusub" UUBINF="uucp uux uulog uuname" TMPF=" tmp usr/tmp usr/lib/uucp/.XQTDIR usr/msgs" TSPOOL="lpd mail secretmail uucp uucppublic" ATDIR="at at/past" BNETBF="v6mail" cd $DESTDIR/bin; $CHOWN root $BINF; chmod 4755 $BINF cd $DESTDIR/usr/bin; $CHOWN root $UBINF; chmod 4755 $UBINF cd $DESTDIR/usr/ucb; $CHOWN root $UCBF; chmod 4755 $UCBF cd $DESTDIR/usr/lib; $CHOWN root $LIBF; chmod 4755 $LIBF cd $DESTDIR/usr/lib; $CHOWN uucp $UULIBF; chmod 4755 $UULIBF cd $DESTDIR/usr/bin; $CHOWN uucp $UUBINF; chmod 4755 $UUBINF if [ -f $DESTDIR/usr/net/bin/net ]; then cd $DESTDIR/usr/net/bin; $CHOWN root $BNETBF; chmod 4755 $BNETBF; cd $DESTIDR/usr/ucb; fi cd $DESTDIR; chmod 777 $TMPF cd $DESTDIR/usr/spool; chmod 777 $TSPOOL; chmod 755 $ATDIR;\ $CHOWN root $ATDIR ;; ALIASES) echo Establish alias names. rm -f $DESTDIR/bin/[ ln $DESTDIR/bin/test $DESTDIR/bin/[ rm -f $DESTDIR/usr/ucb/l $DESTDIR/usr/ucb/f $DESTDIR/usr/ucb/u rm -f $DESTDIR/usr/ucb/page ln $DESTDIR/usr/ucb/ls $DESTDIR/usr/ucb/l ln $DESTDIR/usr/ucb/finger $DESTDIR/usr/ucb/f ln $DESTDIR/usr/ucb/users $DESTDIR/usr/ucb/u ln $DESTDIR/usr/ucb/more $DESTDIR/usr/ucb/page ln $DESTDIR/bin/ps $DESTDIR/bin/ss cp $DESTDIR/usr/ucb/ls $DESTDIR/bin/ucbls rm $DESTDIR/usr/bin/uuclean ln $DESTDIR/usr/lib/uucp/uuclean $DESTDIR/usr/bin/uuclean rm -f $DESTDIR/usr/ucb/uptime ln $DESTDIR/usr/ucb/w $DESTDIR/usr/ucb/uptime (cd $DESTDIR/usr/ucb ; rm vi view edit e ../bin/ex) (cd $DESTDIR/usr/ucb ; ln ex vi ; ln ex view ; ln ex edit ) (cd $DESTDIR/usr/ucb ; ln ex e ; ln ex ../bin/ex) (cd $DESTDIR/usr/ucb ; rm -f mail ; ln Mail mail) ;; *) if [ ! -d $i ] then echo "Don't know what to do with $i." else date cd $i make CC=$CC DESTDIR=$DESTDIR \ && make install DESTDIR=$DESTDIR \ && make clean date cd .. fi esac done $DESTDIR/usr/ucb/uptime ln $DESTDIR/usr/ucb/w $DESTDIR/usr/ucb/uptime (cd $DESTDIR/usr/ucb ; rm vi view edit e ../bin/ex) (cd $DESTDIR/usr/ucb ; ln ex vi ; ln ex view ; ln ex edit ) (ccmd/badsect.c 444 0 33 1340 2527220225 6341 static char *sccsid = "@(#)badsect.c 4.2 (Berkeley) 81/05/11"; /* * badsect * * Badsect takes a list of file-system relative sector numbers * and makes files containing the blocks of which these sectors are a part. * It can be used to contain sectors which have problems if these sectors * are not part of the bad file for the pack (see bad144). For instance, * this program can be used if the driver for the file system in question * does not support bad block forwarding. */ #include main(argc, argv) int argc; char **argv; { char nambuf[32]; int errs = 0; --argc, argv++; while (argc > 0) { if (mknod(*argv, 0, atoi(*argv) / CLSIZE)) perror("mknod"), errs++; argc--, argv++; } exit(errs); } t can be used to contain sectors which have problems if these sectors * are not part of the bad file for the pack (see bad144). For instance, * this program can be used if the driver for the file system in question * does not support bad block forwarding. */ #include cmd/DESTINATIONS 644 0 33 7731 2527130120 6425 /usr/ucb ;: 1kfix /etc ;: 512restor /usr/bin ;: [ /etc ;: ac /etc ;: accton /bin ;: adb /etc ;: analyze /usr/ucb ;: apl /usr/ucb ;: apropos /bin ;: ar /usr/bin ;: ar11 /etc ;: arcv /etc ;: arff /bin ;: as /usr/bin ;: at /usr/lib ;: atrun /bin ;: awk /etc ;: bad144 /etc ;: badsect /usr/bin ;: basename /usr/bin ;: bc /usr/games ;: bcd /usr/ucb ;: biff /usr/bin ;: cal /usr/bin ;: calendar /usr/bin ;: call /bin ;: cat /etc ;: catman /usr/bin ;: cb /bin ;: cc /usr/ucb ;: ccat /usr/bin ;: checkeq /usr/ucb ;: checknr /usr/ucb ;: chfn /etc ;: chgrp /bin ;: chk /bin ;: chmod /etc ;: chown /usr/ucb ;: chsh /usr/ucb ;: clear /etc ;: clri /bin ;: cmp /usr/bin ;: col /usr/ucb ;: colcrt /usr/ucb ;: colrm /usr/bin ;: comm /usr/ucb ;: compact /etc ;: comsat /bin ;: cp /etc ;: cron /usr/bin ;: crypt /usr/ucb ;: ctags /usr/bin ;: cu /usr/ucb ;: cxref /bin ;: date /usr/bin ;: dc /etc ;: dcheck /bin ;: dd /usr/ucb ;: ddate /usr/bin ;: deroff /bin ;: df /bin ;: diff /usr/bin ;: diff3 /usr/ucb ;: diffdir /etc ;: dmesg /usr/lib ;: dnd /bin ;: du /etc ;: dump /etc ;: dumpdir /bin ;: echo /bin ;: ed /usr/bin ;: egrep /usr/bin ;: eqn /usr/ucb ;: expand /bin ;: expr /usr/bin ;: f77 /bin ;: false /usr/bin ;: fgrep /usr/bin ;: file /usr/bin ;: find /usr/ucb ;: finger /usr/games ;: fish /etc ;: flcopy /usr/ucb ;: fmt /usr/ucb ;: fold /usr/ucb ;: from /etc ;: fsck /usr/ucb ;: gets /usr/lib ;: getNAME /etc ;: getty /usr/bin ;: graph /bin ;: grep /etc ;: halt /usr/ucb ;: head /usr/ucb ;: help /etc ;: icheck /etc ;: init /usr/bin ;: install /usr/bin ;: iostat /usr/ucb ;: iul /usr/bin ;: join /bin ;: kill /usr/ucb ;: last /usr/ucb ;: lastcomm /bin ;: ld /usr/ucb ;: leave /usr/bin ;: lex /usr/bin ;: lint /bin ;: ln /usr/ucb ;: lnall /usr/ucb ;: lock /bin ;: login /etc ;: logtime /usr/bin ;: look /usr/bin ;: lookbib /usr/bin ;: lorder /usr/bin ;: lpr /usr/bin ;: m4 /bin ;: mail /usr/bin ;: make /usr/lib ;: makekey /usr/lib ;: makewhatis /usr/bin ;: man /usr/bin ;: mesg /bin ;: mkdir /etc ;: mkfs /etc ;: mklost+found /etc ;: mknod /usr/ucb ;: mkstr /usr/ucb ;: more /etc ;: mount /usr/ucb ;: msgs /bin ;: mt /bin ;: mv /etc ;: ncheck /usr/bin ;: neqn /usr/bin ;: newgrp /bin ;: nice /bin ;: nm /bin ;: nohup /usr/bin ;: nroff /usr/ucb ;: num /bin ;: od /bin ;: passwd /usr/ucb ;: pix /bin ;: pr /usr/ucb ;: print /usr/ucb ;: printenv /usr/ucb ;: prmail /usr/bin ;: prof /bin ;: ps /etc ;: pstat /usr/ucb ;: pti /usr/bin ;: ptx /bin ;: pwd /usr/ucb ;: px /usr/ucb ;: pxref /usr/games ;: quiz /et((c ;: quot /usr/bin ;: ranlib /etc ;: reboot /usr/bin ;: reloc /etc ;: renice /usr/ucb ;: reset /etc ;: restor /usr/bin ;: rev /usr/ucb ;: rewind /bin ;: rm /bin ;: rmail /bin ;: rmdir /etc ;: sa /etc ;: savecore /usr/ucb ;: script /bin ;: sed /usr/ucb ;: see /bin ;: sh /etc ;: shutdown /bin ;: size /usr/bin ;: sleep /usr/ucb ;: soelim /usr/bin ;: sort /usr/bin ;: spell /usr/bin ;: spline /usr/bin ;: split /usr/ucb ;: ssp /usr/ucb ;: strings /bin ;: strip /bin ;: stty /bin ;: su /usr/bin ;: sum /etc ;: swapon /usr/ucb ;: symorder /bin ;: sync /usr/bin ;: t300 /usr/bin ;: t300s /usr/bin ;: t450 /usr/bin ;: tabs /usr/bin ;: tail /bin ;: tar /usr/bin ;: tbl /usr/bin ;: tc /usr/bin ;: tee /usr/bin ;: tek /bin ;: test /bin ;: time /usr/bin ;: tk /usr/bin ;: touch /bin ;: tp /usr/bin ;: tr /usr/ucb ;: tra /usr/games ;: trek /usr/ucb ;: trman /usr/bin ;: troff /bin ;: true /usr/bin ;: tsort /usr/bin ;: tty /usr/ucb ;: ul /etc ;: umount /usr/ucb ;: uncompact /usr/ucb ;: unexpand /usr/bin ;: uniq /usr/bin ;: units /etc ;: update /usr/ucb ;: uptime /usr/ucb ;: users /usr/bin ;: uucp /usr/ucb ;: uudecode /usr/ucb ;: uuencode /usr/bin ;: uusend /usr/bin ;: uux /usr/ucb ;: vfontinfo /etc ;: vipw /usr/ucb ;: vmstat /usr/bin ;: vplot /usr/ucb ;: w /bin ;: wall /usr/bin ;: wc /usr/ucb ;: what /usr/ucb ;: whatis /usr/ucb ;: whereis /usr/ucb ;: which /usr/ucb ;: whoami /bin ;: who /bin ;: write /usr/games ;: wump /usr/ucb ;: xstr /usr/bin ;: yacc /usr/ucb ;: yes ct /usr/ucb ;: unexpand /usr/bin ;: unicmd/cxref.sh 755 0 33 72 2423774215 6211 : echo "use 'ctags -x' instead of cxref" exec ctags -x $* r/ucb ;: users /usr/bin ;: uucp /usr/ucb ;: uudecode /usr/ucb ;: uuencode /usr/bin ;: uusend /usr/bin ;: uux /usr/ucb ;: vfontinfo /etc ;: vipw /usr/ucb ;: vmstat /usr/bin ;: vplot /usr/ucb ;: w /bin ;: wall /usr/bin ;: wc /usr/ucb ;: what /usr/ucb ;: whatis /usr/ucb ;: whereis /usr/ucb ;: which /usr/ucb ;: whoami /bin ;: who /bin ;: write /usr/games ;: wu/( ,( 58< /\@,\D"cmd/diffdir.sh 755 0 33 152 2423774217 6532 echo "use just 'diff', not diffdir" echo "(but note that diffdir -h is diff -l, see man (1) diff)" exit 1 code /usr/ucb ;: uuencode /usr/bin ;: uusend /usr/bin ;: uux /usr/ucb ;: vfontinfo /etc ;: vipw /usr/ucb ;: vmstat /usr/bin ;: vplot /usr/ucb ;: w /bin ;: wall /usr/bin ;: wc /usr/ucb ;: what /usr/ucb ;: whatis /usr/ucb ;: whereis /usr/ucb ;: which /usr/ucb ;: whoami /bin ;: who /bin ;: write /usr/games ;: wu/( ,( 5H< /\@,\D"cmd/more.c 444 0 33 73533 2521311706 5732 static char *sccsid = "@(#)more.c 4.4 (Berkeley) 81/04/23"; /* ** more.c - General purpose tty output filter and file perusal program ** ** by Eric Shienbrood, UC Berkeley ** ** modified by Geoff Peck, UCB to add underlining, single spacing ** modified by John Foderaro, UCB to add -c and MORE environment variable */ #include #ifdef V6 #include #endif #include #include #include #include #include #include #include #include #include #include /* Help file will eventually go in libpath(more.help) on all systems */ #ifdef INGRES #define VI "/usr/bin/vi" #define HELPFILE "/mntp/doucette/more/more.help" #endif #ifndef INGRES #ifndef HELPFILE #define HELPFILE libpath(more.help) #endif #define VI binpath(vi) #endif #define Fopen(s,m) (Currline = 0,file_pos=0,fopen(s,m)) #define Ftell(f) file_pos #define Fseek(f,off) (file_pos=off,fseek(f,off,0)) #define Getc(f) (++file_pos, getc(f)) #define Ungetc(c,f) (--file_pos, ungetc(c,f)) #ifdef V6 #define MBIT RAW #define CBREAK ~RAW #else #define MBIT CBREAK #define stty(fd,argp) ioctl(fd,TIOCSETN,argp) #endif #define TBUFSIZ 1024 #define LINSIZ 256 #define ctrl(letter) ('letter' & 077) #define RUBOUT '\177' #define ESC '\033' #define QUIT '\034' struct sgttyb otty; long file_pos, file_size; int fnum, no_intty, no_tty, slow_tty; int dum_opt, dlines, onquit(), end_it(); #ifdef SIGTSTP int onsusp(); #endif int nscroll = 11; /* Number of lines scrolled by 'd' */ int fold_opt = 1; /* Fold long lines */ int stop_opt = 1; /* Stop after form feeds */ int ssp_opt = 0; /* Suppress white space */ int ul_opt = 1; /* Underline as best we can */ int promptlen; int Currline; /* Line we are currently at */ int startup = 1; int firstf = 1; int notell = 1; int bad_so; /* True if overwriting does not turn off standout */ int inwait, Pause, errors; int within; /* true if we are within a file, false if we are between files */ int hard, dumb, noscroll, hardtabs, clreol; int catch_susp; /* We should catch the SIGTSTP signal */ char **fnames; /* The list of file names */ int nfiles; /* Number of files left to process */ char *shell; /* The name of the shell to use */ int shellp; /* A previous shell command exists */ char ch; jmp_buf restore; char obuf[BUFSIZ]; /* stdout buffer */ char Line[LINSIZ]; /* Line buffer */ int Lpp = 24; /* lines per page */ char *Clear; /* clear screen */ char *eraseln; /* erase line */ char *Senter, *Sexit;/* enter and exit standout mode */ char *ULenter, *ULexit; /* enter and exit underline mode */ char *chUL; /* underline character */ char *chBS; /* backspace character */ char *Home; /* go to home */ char *cursorm; /* cursor movement */ char cursorhome[40]; /* contains cursor movement to home */ char *EodClr; /* clear rest of screen */ char *tgetstr(); int Mcol = 80; /* number of columns */ int Wrap = 1; /* set if automargins */ long fseek(); char *getenv(); struct { long chrctr, line; } context, screen_start; extern char PC; /* pad character */ extern short ospeed; main(argc, argv) int argc; char *argv[]; { register FILE *f; register char *s; register char *p; register char ch; register int left; int prnames = 0; int initopt = 0; int srchopt = 0; int clearit = 0; int initline; char initbuf[80]; FILE *checkf(); nfiles = argc; fnames = argv; initterm (); if(s = getenv("MORE")) argscan(s); while (--nfiles > 0) { if ((ch = (*++fnames)[0]) == '-') { argscan(*fnames+1); } else if (ch == '+') { s = *fnames; if (*++s == '/') { srchopt++; for (++s, p = initbuf; p < initbuf + 79 && *s != '\0';) *p++ = *s++; *p = '\0'; } else { initopt++; for (initline = 0; *s != '\0'; s++) if (isdigit (*s)) initline = initline*10 + *s -'0'; --initline; } } else break; } /* allow clreol only if Home and eraseln and EodClr strings are * defined, and in that case, make sure we are in noscroll mode */ if(clreol) { if ((*Home == '\0') || (*eraseln == '\0') || (*EodClr == '\0')) clreol = 0; else noscroll = 1; } if (dlines == 0) dlines = Lpp - (noscroll ? 1 : 2); left = dlines; if (nfiles > 1) prnames++; if (!no_intty && nfiles == 0) { fputs("Usage: ",stderr); fputs(argv[0],stderr); fputs(" [-dfln] [+linenum | +/pattern] name1 name2 ...\n",stderr); exit(1); } else f = stdin; if (!no_tty) { signal(SIGQUIT, onquit); signal(SIGINT, end_it); #ifdef SIGTSTP if (signal (SIGTSTP, SIG_IGN) == SIG_DFL) { signal(SIGTSTP, onsusp); catch_susp++; } #endif stty (2, &otty); } if (no_intty) { if (no_tty) copy_file (stdin); else { if ((ch = Getc (f)) == '\f') doclear(); else { Ungetc (ch, f); if (noscroll && (ch != EOF)) { if (clreol) home (); else doclear (); } } if (srchopt) { search (initbuf, stdin, 1); if (noscroll) left--; } else if (initopt) skiplns (initline, stdin); screen (stdin, left); } no_intty = 0; prnames++; firstf = 0; } while (fnum < nfiles) { if ((f = checkf (fnames[fnum], &clearit)) != NULL) { context.line = context.chrctr = 0; Currline = 0; if (firstf) setjmp (restore); if (firstf) { firstf = 0; if (srchopt) { search (initbuf, f, 1); if (noscroll) left--; } else if (initopt) skiplns (initline, f); } else if (fnum < nfiles && !no_tty) { setjmp (restore); left = command (fnames[fnum], f); } if (left != 0) { if ((noscroll || clearit) && (file_size != 0x7fffffffffffffffL)) if (clreol) home (); else doclear (); if (prnames) { if (bad_so) erase (0); if (clreol) cleareol (); pr("::::::::::::::"); if (promptlen > 14) erase (14); printf ("\n"); if(clreol) cleareol(); printf("%s\n", fnames[fnum]); if(clreol) cleareol(); printf("::((::::::::::::\n", fnames[fnum]); if (left > Lpp - 4) left = Lpp - 4; } if (no_tty) copy_file (f); else { within++; screen(f, left); within = 0; } } setjmp (restore); fflush(stdout); fclose(f); screen_start.line = screen_start.chrctr = 0L; context.line = context.chrctr = 0L; } fnum++; firstf = 0; } reset_tty (); exit(0); } argscan(s) char *s; { for (dlines = 0; *s != '\0'; s++) if (isdigit(*s)) dlines = dlines*10 + *s - '0'; else if (*s == 'd') dum_opt = 1; else if (*s == 'l') stop_opt = 0; else if (*s == 'f') fold_opt = 0; else if (*s == 'p') noscroll++; else if (*s == 'c') clreol++; else if (*s == 's') ssp_opt = 1; else if (*s == 'u') ul_opt = 0; } /* ** Check whether the file named by fs is an ASCII file which the user may ** access. If it is, return the opened file. Otherwise return NULL. */ FILE * checkf (fs, clearfirst) register char *fs; int *clearfirst; { struct stat stbuf; register FILE *f; char c; if (stat (fs, &stbuf) == -1) { fflush(stdout); if (clreol) cleareol (); perror(fs); return (NULL); } if ((stbuf.st_mode & S_IFMT) == S_IFDIR) { printf("\n*** %s: directory ***\n\n", fs); return (NULL); } if ((f=Fopen(fs, "r")) == NULL) { fflush(stdout); perror(fs); return (NULL); } c = Getc(f); /* Try to see whether it is an ASCII file */ switch ((c | *f->_ptr << 8) & 0177777) { case 0405: case 0407: case 0410: case 0411: case 0413: case 0177545: printf("\n******** %s: Not a text file ********\n\n", fs); fclose (f); return (NULL); default: break; } if (c == '\f') *clearfirst = 1; else { *clearfirst = 0; Ungetc (c, f); } if ((file_size = stbuf.st_size) == 0) file_size = 0x7fffffffffffffffL; return (f); } /* ** A real function, for the tputs routine in termlib */ putch (ch) char ch; { putchar (ch); } /* ** Print out the contents of the file f, one screenful at a time. */ #define STOP -10 screen (f, num_lines) register FILE *f; register int num_lines; { register int c; register int nchars; int length; /* length of current line */ static int prev_len = 1; /* length of previous line */ for (;;) { while (num_lines > 0 && !Pause) { if ((nchars = getline (f, &length)) == EOF) { if (clreol) clreos(); return; } if (ssp_opt && length == 0 && prev_len == 0) continue; prev_len = length; if (bad_so || (Senter && *Senter == ' ') && promptlen > 0) erase (0); /* must clear before drawing line since tabs on some terminals * do not erase what they tab over. */ if (clreol) cleareol (); prbuf (Line, length); if (nchars < promptlen) erase (nchars); /* erase () sets promptlen to 0 */ else promptlen = 0; /* is this needed? * if (clreol) * cleareol(); /* must clear again in case we wrapped * */ if (nchars < Mcol || !fold_opt) putchar('\n'); if (nchars == STOP) break; num_lines--; } fflush(stdout); if ((c = Getc(f)) == EOF) { if (clreol) clreos (); return; } if (Pause && clreol) clreos (); Ungetc (c, f); setjmp (restore); Pause = 0; startup = 0; if ((num_lines = command (NULL, f)) == 0) return; if (hard && promptlen > 0) erase (0); if (noscroll && num_lines == dlines) { if (clreol) home(); else doclear (); } screen_start.line = Currline; screen_start.chrctr = Ftell (f); } } /* ** Come here if a quit signal is received */ onquit() { signal(SIGQUIT, SIG_IGN); if (!inwait) { putchar ('\n'); if (!startup) { signal(SIGQUIT, onquit); longjmp (restore, 1); } else Pause++; } else if (!dum_opt && notell) { write (2, "[Use q or Q to quit]", 20); promptlen += 20; notell = 0; } signal(SIGQUIT, onquit); } /* ** Clean up terminal state and exit. Also come here if interrupt signal received */ end_it () { reset_tty (); if (clreol) { putchar ('\r'); clreos (); fflush (stdout); } else if (!clreol && (promptlen > 0)) { kill_line (); fflush (stdout); } else write (2, "\n", 1); _exit(0); } copy_file(f) register FILE *f; { register int c; while ((c = getc(f)) != EOF) putchar(c); } /* Simplified printf function */ printf (fmt, args) register char *fmt; int args; { register int *argp; register char ch; register int ccount; ccount = 0; argp = &args; while (*fmt) { while ((ch = *fmt++) != '%') { if (ch == '\0') return (ccount); ccount++; putchar (ch); } switch (*fmt++) { case 'd': ccount += printd (*argp); break; case 's': ccount += pr ((char *)*argp); break; case '%': ccount++; argp--; putchar ('%'); break; case '0': return (ccount); default: break; } ++argp; } return (ccount); } /* ** Print an integer as a string of decimal digits, ** returning the length of the print representation. */ printd (n) int n; { int a, nchars; if (a = n/10) nchars = 1 + printd(a); else nchars = 1; putchar (n % 10 + '0'); return (nchars); } /* Put the print representation of an integer into a string */ static char *sptr; scanstr (n, str) int n; char *str; { sptr = str; sprintf (n); *sptr = '\0'; } sprintf (n) { int a; if (a = n/10) sprintf (a); *sptr++ = n % 10 + '0'; } static char bell = ctrl(G); strlen (s) char *s; { register char *p; p = s; while (*p++) ; return (p - s - 1); } /* See whether the last component of the path name "path" is equal to the ** string "string" */ tailequ (path, string) char *path; register char *string; { register char *tail; tail = path + strlen(path); while (tail >= path) if (*(--tail) == '/') break; ++tail; while (*tail++ == *string++) if (*tail == '\0') return(1); return(0); } prompt (filename) char *filename; { if (clreol) cleareol (); else if (promptlen > 0) kill_line (); if (!hard) { promptlen = 8; if (Senter && Sexit) tputs (Senter, 1, putch); if (clreol) cleareol (); pr("--More--"); if (filename != NULL) { promptlen += printf ("(Next file: %s)", filename); } else if (!no_intty) { promptlen += printf ("(%d%%)", (int)((file_pos * 100) / file_size)); } if (dum_opt) { promptlen += pr("[Hit space to continue, Rubout to abort]"); } if (Senter && Sexit) tputs (Sexit, 1, putch); if (clreol) clreos (); fflush(stdout); } else write (2, &bell, 1); inwait++; } /* ** Get a logical line */ getline(f, length) register FILE *f; int *length; { register int c; register char *p; register int column; static int colflg; p = Line; column = 0; c = Getc (f); if (colflg && c == '\n') { Currline++; c = Getc (f); } while (p < &Line[LINSIZ - 1]) { if (c == EOF) { if (p > Line) { *p = '\0'; *length = p - Line; return (column); } *length = p - Line; return (EOF); } if (c == '\n') { Currline++; break; } *p++ = c; if (c == '\t') if (hardtabs && column < promptlen && !hard) { if (eraseln && !dumb) { column = 1 + (column | 7); tputs (eraseln, 1, putch); promptlen = 0; } else { for (--p; column & 7 && p < &Line[LINSIZ - 1]; column++) { *p++ = ' '; } if (column >= promptlen) promptlen = 0; } } else column = 1 + (column | 7); else if (c == '\b') column--; else if (c == '\r') column = 0; else if (c == '\f' && stop_opt) { p[-1] = '^'; *p++ = 'L'; column += 2; Pause++; } else if (c == EOF) { *length = p - Line; return (column); } else if (c >= ' ' && c != RUBOUT) column++; if (column >= Mcol && fold_opt) break; c = Getc (f); } if (column >= Mcol && Mcol > 0) { if (!Wrap) { *p++ = '\n'; } } colflg = column == Mcol && fold_opt; *length = p - Line; *p = 0; return (column); } /* ** Erase the rest of the prompt, assuming we are starting at column col. */ erase (col) register int col; { if (promptlen == 0) return; if (hard) { putchar ('\n'); } else { if (col == 0) putchar ('\r'); if (!dumb && eraseln) tputs (eraseln, 1, putch); else for (col = promptlen - col; col > 0; col--) putchar (' '); } promptlen = 0; } /* ** Erase the current line entirely */ kill_line () { erase (0); if (!eraseln || dumb) putchar ('\r'); } /* * force clear to end of line */ cleareol() { tputs(eraseln, 1, putch); } clreos() { tputs(EodClr, 1, putch); } /* ** Print string and return number of characters */ pr(s1) char *s1; { register char *s; register char c; for (s = s1; c = *s++; ) putchar(c); return (s - s1 - 1); } /* Print a buffer of n characters */ prbuf (s, n) register char *s; register int n; { char c; /* next ouput character */ register int state; /* next output char's UL state */ static int pstate = 0; /* current terminal UL state (off) */ while (--n >= 0) if (!ul_opt) putchar (*s++); else { if (n >= 2 && s[0] == '_' && s[1] == '\b') { n -= 2; s += 2; c = *s++; state = 1; } else if (n >= 2 && s[1] == '\b' && s[2] == '_') { n -= 2; c = *s++; s += 2; state = 1; } else { c = *s++; state = 0; } if (state != pstate) tputs(state ? ULenter : ULexit, 1, putch); pstate = state; putchar(c); if (state && *chUL) { pr(chBS); tputs(chUL, 1, putch); } } } /* ** Clear the screen */ doclear() { if (Clear && !hard) { tputs(Clear, 1, putch); /* Put out carriage return so that system doesn't ** get confused by escape sequences when expanding tabs */ putchar ('\r'); promptlen = 0; } } /* * Go to home position */ home() { tputs(Home,1,putch); } static int lastcmd, lastarg, lastp; static int lastcolon; char shell_line[132]; /* ** Read a command and do it. A command consists of an optional integer ** argument followed by the command character. Return the number of lines ** to display i((n the next screenful. If there is nothing more to display ** in the current file, zero is returned. */ command (filename, f) char *filename; register FILE *f; { register int nlines; register int retval; register char c; char colonch; FILE *helpf; int done; char comchar, cmdbuf[80], *p; #define ret(val) retval=val;done++;break done = 0; if (!errors) prompt (filename); else errors = 0; if (MBIT == RAW && slow_tty) { otty.sg_flags |= MBIT; stty(2, &otty); } for (;;) { nlines = number (&comchar); lastp = colonch = 0; if (comchar == '.') { /* Repeat last command */ lastp++; comchar = lastcmd; nlines = lastarg; if (lastcmd == ':') colonch = lastcolon; } lastcmd = comchar; lastarg = nlines; if (comchar == otty.sg_erase) { kill_line (); prompt (filename); continue; } switch (comchar) { case ':': retval = colon (filename, colonch, nlines); if (retval >= 0) done++; break; case ' ': case 'z': if (nlines == 0) nlines = dlines; else if (comchar == 'z') dlines = nlines; ret (nlines); case 'd': case ctrl(D): if (nlines != 0) nscroll = nlines; ret (nscroll); case RUBOUT: case 'q': case 'Q': end_it (); case 's': case 'f': if (nlines == 0) nlines++; if (comchar == 'f') nlines *= dlines; putchar ('\r'); erase (0); printf ("\n"); if (clreol) cleareol (); printf ("...skipping %d line", nlines); if (nlines > 1) pr ("s\n"); else pr ("\n"); if (clreol) cleareol (); pr ("\n"); while (nlines > 0) { while ((c = Getc (f)) != '\n') if (c == EOF) { retval = 0; done++; goto endsw; } Currline++; nlines--; } ret (dlines); case '\n': if (nlines != 0) dlines = nlines; else nlines = 1; ret (nlines); case '\f': if (!no_intty) { doclear (); Fseek (f, screen_start.chrctr); Currline = screen_start.line; ret (dlines); } else { write (2, &bell, 1); break; } case '\'': if (!no_intty) { kill_line (); pr ("\n***Back***\n\n"); Fseek (f, context.chrctr); Currline = context.line; ret (dlines); } else { write (2, &bell, 1); break; } case '=': kill_line (); promptlen = printd (Currline); fflush (stdout); break; case 'n': lastp++; case '/': if (nlines == 0) nlines++; kill_line (); pr ("/"); promptlen = 1; fflush (stdout); if (lastp) { write (2,"\r", 1); search (NULL, f, nlines); /* Use previous r.e. */ } else { ttyin (cmdbuf, 78, '/'); write (2, "\r", 1); search (cmdbuf, f, nlines); } ret (dlines-1); case '!': do_shell (filename); break; case 'h': if ((helpf = fopen (HELPFILE, "r")) == NULL) error ("Can't open help file"); if (noscroll) doclear (); copy_file (helpf); close (helpf); prompt (filename); break; case 'v': /* This case should go right before default */ if (!no_intty) { kill_line (); cmdbuf[0] = '+'; scanstr (Currline, &cmdbuf[1]); pr ("vi "); pr (cmdbuf); putchar (' '); pr (fnames[fnum]); execute (filename, VI, "vi", cmdbuf, fnames[fnum], 0); break; } default: write (2, &bell, 1); break; } if (done) break; } putchar ('\r'); endsw: inwait = 0; notell++; if (MBIT == RAW && slow_tty) { otty.sg_flags &= ~MBIT; stty(2, &otty); } return (retval); } char ch; /* * Execute a colon-prefixed command. * Returns <0 if not a command that should cause * more of the file to be printed. */ colon (filename, cmd, nlines) char *filename; int cmd; int nlines; { if (cmd == 0) ch = readch (); else ch = cmd; lastcolon = ch; switch (ch) { case 'f': kill_line (); if (!no_intty) promptlen = printf ("\"%s\" line %d", fnames[fnum], Currline); else promptlen = printf ("[Not a file] line %d", Currline); fflush (stdout); return (-1); case 'n': if (nlines == 0) { if (fnum >= nfiles - 1) end_it (); nlines++; } putchar ('\r'); erase (0); skipf (nlines); return (0); case 'p': if (no_intty) { write (2, &bell, 1); return (-1); } putchar ('\r'); erase (0); if (nlines == 0) nlines++; skipf (-nlines); return (0); case '!': do_shell (filename); return (-1); case 'q': case 'Q': end_it (); default: write (2, &bell, 1); return (-1); } } /* ** Read a decimal number from the terminal. Set cmd to the non-digit which ** terminates the number. */ number(cmd) char *cmd; { register int i; i = 0; ch = otty.sg_kill; for (;;) { ch = readch (); if (ch >= '0' && ch <= '9') i = i*10 + ch - '0'; else if (ch == otty.sg_kill) i = 0; else { *cmd = ch; break; } } return (i); } do_shell (filename) char *filename; { char cmdbuf[80]; kill_line (); pr ("!"); fflush (stdout); promptlen = 1; if (lastp) pr (shell_line); else { ttyin (cmdbuf, 78, '!'); if (expand (shell_line, cmdbuf)) { kill_line (); promptlen = printf ("!%s", shell_line); } } fflush (stdout); write (2, "\n", 1); promptlen = 0; shellp = 1; execute (filename, shell, shell, "-c", shell_line, 0); } /* ** Search for nth ocurrence of regular expression contained in buf in the file */ search (buf, file, n) char buf[]; FILE *file; register int n; { long startline = Ftell (file); register long line1 = startline; register long line2 = startline; register long line3 = startline; register int lncount; int saveln, rv, re_exec(); char *s, *re_comp(); context.line = saveln = Currline; context.chrctr = startline; lncount = 0; if ((s = re_comp (buf)) != 0) error (s); while (!feof (file)) { line3 = line2; line2 = line1; line1 = Ftell (file); rdline (file); lncount++; if ((rv = re_exec (Line)) == 1) if (--n == 0) { if (lncount > 3 || (lncount > 1 && no_intty)) { pr ("\n"); if (clreol) cleareol (); pr("...skipping\n"); } if (!no_intty) { Currline -= (lncount >= 3 ? 3 : lncount); Fseek (file, line3); if (noscroll) if (clreol) { home (); cleareol (); } else doclear (); } else { kill_line (); if (noscroll) if (clreol) { home (); cleareol (); } else doclear (); pr (Line); putchar ('\n'); } break; } else if (rv == -1) error ("Regular expression botch"); } if (feof (file)) { if (!no_intty) { #ifdef V6 file->_flag &= ~_IOEOF; /* why doesn't fseek do this ??!!??! */ #endif Currline = saveln; Fseek (file, startline); } else { pr ("\nPattern not found\n"); end_it (); } error ("Pattern not found"); } } execute (filename, cmd, args) char *filename; char *cmd, *args; { int id; fflush (stdout); reset_tty (); while ((id = fork ()) < 0) sleep (5); if (id == 0) { execv (cmd, &args); write (2, "exec failed\n", 12); exit (1); } signal (SIGINT, SIG_IGN); signal (SIGQUIT, SIG_IGN); #ifdef SIGTSTP if (catch_susp) signal(SIGTSTP, SIG_DFL); #endif wait (0); signal (SIGINT, end_it); signal (SIGQUIT, onquit); #ifdef SIGTSTP if (catch_susp) signal(SIGTSTP, onsusp); #endif set_tty (); pr ("------------------------\n"); prompt (filename); } /* ** Skip n lines in the file f */ skiplns (n, f) register int n; register FILE *f; { register char c; while (n > 0) { while ((c = Getc (f)) != '\n') if (c == EOF) return; n--; Currline++; } } /* ** Skip nskip files in the file list (from the command line). Nskip may be ** negative. */ skipf (nskip) register int nskip; { if (nskip == 0) return; if (nskip > 0) { if (fnum + nskip > nfiles - 1) nskip = nfiles - fnum - 1; } else if (within) ++fnum; fnum += nskip; if (fnum < 0) fnum = 0; pr ("\n...Skipping "); pr ("\n"); if (clreol) cleareol (); pr ("...Skipping "); pr (nskip > 0 ? "to file " : "back to file "); pr (fnames[fnum]); pr ("\n"); if (clreol) cleareol (); pr ("\n"); --fnum; } /*----------------------------- Terminal I/O -------------------------------*/ initterm () { char buf[TBUFSIZ]; char clearbuf[100]; char *clearptr, *padstr; int ldisc; setbuf(stdout, obuf); if (!(no_tty = gtty(1, &otty))) { if (tgetent(buf, getenv("TERM")) <= 0) { dumb++; ul_opt = 0; } else { if (((Lpp = tgetnum("li")) < 0) || tgetflag("hc")) { hard++; /* Hard copy terminal */ Lpp = 24; } if (tailequ (fnames[0], "page") || !hard && tgetflag("ns")) noscroll++; if ((Mcol = tgetnum("co")) < 0) Mcol = 80; Wrap = tgetflag("am"); bad_so = tgetflag ("xs"); clearptr = clearbuf; eraseln = tgetstr("ce",&clearptr); Clear = tgetstr("cl", &clearptr); Senter = tgetstr("so", &clearptr); Sexit = tgetstr("se", &clearptr); /* * Set up for underlining: some terminals don't need it; * others have start/stop sequences, still others have an * underline char sequence which is assumed to move the * cursor forward one character. If underline sequence * isn't available, settle for standout sequence. */ if (tgetflag("ul") || tgetflag("os")) ul_opt = 0; if ((chUL = tgetstr("uc", &clearptr)) == NULL ) chUL = ""; if ((ULenter = tgetstr("us", &clearptr)) == NULL && (!*chUL) && (ULenter = tgetstr("so", &clearptr)) == NULL) ULenter = ""; if ((ULexit = tgetstr("ue", &clearptr)) == NULL && (!*chUL) && (ULexit = tgetstr("se", &clearptr)) == NULL) ULexit = ""; if (padstr = tgetstr("pc", &clearptr)) PC = *padstr; Home = tgetstr("ho",&clearptr); if (*Home == '\0') { if ((cursorm = tgetstr("cm", &clearptr)) != NULL) { strcpy(cursorhome, tgoto(cursorm, 0, 0)); Home = cursorhome; } } EodClr = tgetstr("cd", &clearptr); } if ((shell = getenv("SHELL")) == NULL) shell = "/bin/sh"; } no_intty = gtty(0, &otty); gtty(2, &otty); ospeed = otty.sg_ospeed; slow_tty = ospeed < B1200; h((ardtabs = !(otty.sg_flags & XTABS); if (!no_tty) { otty.sg_flags &= ~ECHO; if (MBIT == CBREAK || !slow_tty) otty.sg_flags |= MBIT; } } readch () { char ch; extern int errno; if (read (2, &ch, 1) <= 0) if (errno != EINTR) exit(0); else ch = otty.sg_kill; return (ch); } static char BS = '\b'; static char CARAT = '^'; ttyin (buf, nmax, pchar) char buf[]; register int nmax; char pchar; { register char *sptr; register char ch; register int slash = 0; int maxlen; char cbuf; sptr = buf; maxlen = 0; while (sptr - buf < nmax) { if (promptlen > maxlen) maxlen = promptlen; ch = readch (); if (ch == '\\') { slash++; } else if ((ch == otty.sg_erase) && !slash) { if (sptr > buf) { --promptlen; write (2, &BS, 1); --sptr; if ((*sptr < ' ' && *sptr != '\n') || *sptr == RUBOUT) { --promptlen; write (2, &BS, 1); } continue; } else { if (!eraseln) promptlen = maxlen; longjmp (restore, 1); } } else if ((ch == otty.sg_kill) && !slash) { if (hard) { show (ch); putchar ('\n'); putchar (pchar); } else { putchar ('\r'); putchar (pchar); if (eraseln) erase (1); promptlen = 1; } sptr = buf; fflush (stdout); continue; } if (slash && (ch == otty.sg_kill || ch == otty.sg_erase)) { write (2, &BS, 1); --sptr; } if (ch != '\\') slash = 0; *sptr++ = ch; if ((ch < ' ' && ch != '\n' && ch != ESC) || ch == RUBOUT) { ch += ch == RUBOUT ? -0100 : 0100; write (2, &CARAT, 1); promptlen++; } cbuf = ch; if (ch != '\n' && ch != ESC) { write (2, &cbuf, 1); promptlen++; } else break; } *--sptr = '\0'; if (!eraseln) promptlen = maxlen; if (sptr - buf >= nmax - 1) error ("Line too long"); } expand (outbuf, inbuf) char *outbuf; char *inbuf; { register char *instr; register char *outstr; register char ch; char temp[200]; int changed = 0; instr = inbuf; outstr = temp; while ((ch = *instr++) != '\0') switch (ch) { case '%': if (!no_intty) { strcpy (outstr, fnames[fnum]); outstr += strlen (fnames[fnum]); changed++; } else *outstr++ = ch; break; case '!': if (!shellp) error ("No previous command to substitute for"); strcpy (outstr, shell_line); outstr += strlen (shell_line); changed++; break; case '\\': if (*instr == '%' || *instr == '!') { *outstr++ = *instr++; break; } default: *outstr++ = ch; } *outstr++ = '\0'; strcpy (outbuf, temp); return (changed); } show (ch) register char ch; { char cbuf; if ((ch < ' ' && ch != '\n' && ch != ESC) || ch == RUBOUT) { ch += ch == RUBOUT ? -0100 : 0100; write (2, &CARAT, 1); promptlen++; } cbuf = ch; write (2, &cbuf, 1); promptlen++; } error (mess) char *mess; { if (clreol) cleareol (); else kill_line (); promptlen += strlen (mess); if (Senter && Sexit) { tputs (Senter, 1, putch); pr(mess); tputs (Sexit, 1, putch); } else pr (mess); fflush(stdout); errors++; longjmp (restore, 1); } set_tty () { otty.sg_flags |= MBIT; otty.sg_flags &= ~ECHO; stty(2, &otty); } reset_tty () { otty.sg_flags |= ECHO; otty.sg_flags &= ~MBIT; stty(2, &otty); } rdline (f) register FILE *f; { register char c; register char *p; p = Line; while ((c = Getc (f)) != '\n' && c != EOF && p - Line < LINSIZ - 1) *p++ = c; if (c == '\n') Currline++; *p = '\0'; } /* Come here when we get a suspend signal from the terminal */ #ifdef SIGTSTP onsusp () { reset_tty (); fflush (stdout); /* Send the TSTP signal to suspend our process group */ kill (0, SIGTSTP); /* Pause for station break */ /* We're back */ signal (SIGTSTP, onsusp); set_tty (); if (inwait) longjmp (restore); } #endif p = Line; while ((c = Getc (f)) != '\n' && c != EOF && p - Line < LINSIZ - 1) *p++ = c; if (c == '\n') Currline++; *p = '\0'; } /* Come here whencmd/help.sh 755 0 33 1713 2423774221 6072 echo 'Look in a printed manual if you can for general help. You should have someone show you some things and then read one of the tutorial papers (e.g. UNIX for Beginners or An Introduction to the C Shell) to get started. The commands: man -k keyword lists commands relevant to keyword man command prints out the manual for a command are helpful; other basic commands are: cat - concatenates files (and just prints them out) ex - text editor finger - user information lookup program ls - list contents of directory mail - send and receive mail msgs - system messages and junk mail program passwd - change login password tset - set terminal modes who - who is on the system write - write to another user You could find programs about mail by the command: man -k mail And print out the mail command documentation via: man mail You can logout by typing a control-d (if your prompt is $) or by typing ``logout'\'\'' if your prompt is %.' - user information lookup program ls - list contecmd/iul.sh 755 0 33 62 2423774222 5670 : echo "use 'ul -i' instead of iul' exec ul -i $* sgs - system messages and junk mail program passwd - change login password tset - set terminal modes who - who is on the system write - write to another user You could find programs about mail by the command: man -k mail And print out the mail command documentation via: man mail You can logout by typing a control-d (if your prompt is $) or by typin/( ,( 5x< /\@,\D"cmd/lnall.sh 755 0 33 44 2423774224 6203 echo 'use ln, not lnall' exec ln $* exec ul -i $* sgs - system messages and junk mail program passwd - change login password tset - set terminal modes who - who is on the system write - write to another user You could find programs about mail by the command: man -k mail And print out the mail command documentation via: man mail You can logout by typing a control-d (if your prompt is $) or by typin/( ,( 5< /\@,\D"cmd/see.sh 755 0 33 24 2423774225 5654 exec /bin/cat -v $* all' exec ln $* exec ul -i $* sgs - system messages and junk mail program passwd - change login password tset - set terminal modes who - who is on the system write - write to another user You could find programs about mail by the command: man -k mail And print out the mail command documentation via: man mail You can logout by typing a control-d (if your prompt is $) or by typin/( ,( 5< /\@,\D"cmd/tra.sh 755 0 33 127 2423774227 5714 echo "tra is obsolete; use 'tail -f' instead" echo "see 'man tail' for details" exit 1 junk mail program passwd - change login password tset - set terminal modes who - who is on the system write - write to another user You could find programs about mail by the command: man -k mail And print out the mail command documentation via: man mail You can logout by typing a control-d (if your prompt is $) or by typin/( ,( 5< /\@,\D"cmd/error/ 775 0 33 0 2552533537 5655 ((cmd/error/Makefile 444 0 33 1530 2424001055 7354 # # @(#)Makefile 1.2 (Berkeley) 10/18/80 # # error.h error header file # errorinput.c does all of the input, and canonicalizes errors # errorpi.c canonicalizes pi errors # errormain.c main # errorsubr.c does grotty subroutine work # errorfilter.c "greps" out unwanted messages # errortouch.c touches all mentioned files # HDRS = error.h PHDRS = $(HDRS) SRCS = errormain.c errorinput.c errorpi.c errorsubr.c errorfilter.c errortouch.c PSRCS = $(SRCS) OBJS = errormain.o errorinput.o errorpi.o errorsubr.o errorfilter.o errortouch.o DFLAGS = -DDEBUG -DERNIE CFLAGS = -O $(DFLAGS) LINTFLAGS = $(DFLAGS) error: $(OBJS) $(CC) $(CFLAGS) $(OBJS) -o error $(OBJS): $(HDRS) install: install -s error $(DESTDIR)/usr/ucb clean: rm -f error $(OBJS) lint: lint $(LINTFLAGS) $(SRCS) psrcs: echo $(PHDRS) $(PSRCS) print: print $(PHDRS) $(PSRCS) h PHDRS = $(HDRS) SRCS = errormain.c errorinput.c errorpi.c errorsubr.c errorfilter.c errortouch.c PSRCS = $(SRCS) OBJS = errormain.o errorinput.o errorpi.o errorsubr.ocmd/error/error.h 444 0 33 10515 2423111660 7244 /* * @(#)error.h 1.1 (Berkeley) 10/16/80 */ typedef int boolean; #define TRUE 1 #define FALSE 0 /* * Descriptors for the various languages we know about. * If you touch these, also touch lang_table */ #define INUNKNOWN 0 #define INCPP 1 #define INCC 2 #define INAS 3 #define INLD 4 #define INLINT 5 #define INF77 6 #define INPI 7 #define INPC 8 #define INFRANZ 9 #define INLISP 10 #define INVAXIMA 11 #define INRATFOR 12 #define INLEX 13 #define INYACC 14 #define INAPL 15 #define INMAKE 16 #define INRI 17 extern int language; /* * We analyze each line in the error message file, and * attempt to categorize it by type, as well as language. * Here are the type descriptors. */ typedef int Errorclass; #define C_FIRST 0 /* first error category */ #define C_UNKNOWN 0 /* must be zero */ #define C_IGNORE 1 /* ignore the message; used for pi */ #define C_SYNC 2 /* synchronization errors */ #define C_DISCARD 3 /* touches dangerous files, so discard */ #define C_NONSPEC 4 /* not specific to any file */ #define C_THISFILE 5 /* specific to this file, but at no line */ #define C_NULLED 6 /* refers to special func; so null */ #define C_TRUE 7 /* fits into true error format */ #define C_DUPL 8 /* sub class only; duplicated error message */ #define C_LAST 9 /* last error category */ #define SORTABLE(x) (!(NOTSORTABLE(x))) #define NOTSORTABLE(x) (x <= C_NONSPEC) /* * Resources to count and print out the error categories */ extern char *class_table[]; extern int class_count[]; #define nunknown class_count[C_UNKNOWN] #define nignore class_count[C_IGNORE] #define nsyncerrors class_count[C_SYNC] #define ndiscard class_count[C_DISCARD] #define nnonspec class_count[C_NONSPEC] #define nthisfile class_count[C_THISFILE] #define nnulled class_count[C_NULLED] #define ntrue class_count[C_TRUE] #define ndupl class_count[C_DUPL] /* places to put the error complaints */ #define TOTHEFILE 1 /* touch the file */ #define TOSTDOUT 2 /* just print them out (ho-hum) */ FILE *errorfile; /* where error file comes from */ FILE *queryfile; /* where the query responses from the user come from*/ extern char *currentfilename; extern char *processname; extern char *scriptname; extern boolean query; /* * Describes attributes about a language */ struct lang_desc{ char *lang_name; char *lang_incomment; /* one of the following defines */ char *lang_outcomment; /* one of the following defines */ }; extern struct lang_desc lang_table[]; #define CINCOMMENT "/*###" #define COUTCOMMENT "%%%*/\n" #define FINCOMMENT "C###" #define FOUTCOMMENT "%%%\n" #define NEWLINE "%%%\n" #define PIINCOMMENT "(*###" #define PIOUTCOMMENT "%%%*)\n" #define LISPINCOMMENT ";###" #define ASINCOMMENT "####" #define RIINCOMMENT CINCOMMENT #define RIOUTCOMMENT COUTCOMMENT /* * Defines and resources for determing if a given line * is to be discarded because it refers to a file not to * be touched, or if the function reference is to a * function the user doesn't want recorded. */ #define IG_FILE1 "llib-lc" #define IG_FILE2 "llib-port" #define IG_FILE3 "/usr/lib/llib-lc" #define IG_FILE4 "/usr/lib/llib-port" #define ERRORNAME "/.errorrc" int nignored; char **names_ignored; /* * Structure definition for a full error */ struct error_desc{ struct error_desc *error_next; /*linked together*/ int error_lgtext; /* how many on the right hand side*/ char **error_text; /* the right hand side proper*/ Errorclass error_e_class; /* error category of this error*/ Errorclass error_s_class; /* sub descriptor of error_e_class*/ int error_language; /* the language for this error*/ int error_position; /* oridinal position */ int error_line; /* discovered line number*/ int error_no; /* sequence number on input */ }; /* * Resources for the true errors */ extern int nerrors; extern struct error_desc *er_head; extern struct error_desc **errors; /* * Resources for each of the files mentioned */ extern int nfiles; extern struct error_desc ***files; /* array of pointers into errors*/ boolean *touchedfiles; /* which files we touched */ /* * The langauge the compilation is in, as intuited from * the flavor of error messages analyzed. */ extern int langauge; extern char *currentfilename; /* * Functional forwards */ char *Calloc(); char *strsave(); char *clobberfirst(); char lastchar(); char firstchar(); char next_lastchar(); char **wordvsplice(); int wordvcmp(); boolean persperdexplode(); ed */ extern int nfiles; extern struct error_desc ***files; /* array of pointers into errors*/ boolean *touchedfiles; /* which files we touched */ /* * The langauge the compilacmd/error/errorfilter.c 444 0 33 6776 2423111662 10445 static char *sccsid = "@(#)errorfilter.c 1.1 (Berkeley) 10/16/80"; #include #include #include #include "error.h" char *lint_libs[] = { IG_FILE1, IG_FILE2, IG_FILE3, IG_FILE4, 0 }; extern char* processname; int lexsort(); /* * Read the file ERRORNAME of the names of functions in lint * to ignore complaints about. */ getignored(auxname) char *auxname; { register int i; FILE *fyle; char inbuffer[256]; int uid; char filename[128]; char *username; struct passwd *passwdentry; nignored = 0; if (auxname == 0){ /* use the default */ if ( (username = (char *)getlogin()) == NULL){ username = "Unknown"; uid = getuid(); if ( (passwdentry = (struct passwd *)getpwuid(uid)) == NULL){ return; } } else { if ( (passwdentry = (struct passwd *)getpwnam(username)) == NULL) return; } strcpy(filename, passwdentry->pw_dir); strcat(filename, ERRORNAME); } else strcpy(filename, auxname); #ifdef FULLDEBUG printf("Opening file \"%s\" to read names to ignore.\n", filename); #endif if ( (fyle = fopen(filename, "r")) == NULL){ #ifdef FULLDEBUG fprintf(stderr, "%s: Can't open file \"%s\"\n", processname, filename); #endif return; } /* * Make the first pass through the file, counting lines */ for (nignored = 0; fgets(inbuffer, 255, fyle) != NULL; nignored++) continue; names_ignored = (char **)Calloc(nignored+1, sizeof (char *)); fclose(fyle); if (freopen(filename, "r", fyle) == NULL){ #ifdef FULLDEBUG fprintf(stderr, "%s: Failure to open \"%s\" for second read.\n", processname, filename); #endif nignored = 0; return; } for (i=0; i < nignored && (fgets (inbuffer, 255, fyle) != NULL); i++){ names_ignored[i] = strsave(inbuffer); substitute(names_ignored[i], '\n', '\0'); } qsort(names_ignored, nignored, sizeof *names_ignored, lexsort); #ifdef FULLDEBUG printf("Names to ignore follow.\n"); for (i=0; i < nignored; i++){ printf("\tIgnore: %s\n", names_ignored[i]); } #endif } int lexsort(cpp1, cpp2) char **cpp1, **cpp2; { return(strcmp(*cpp1, *cpp2)); } int search_ignore(key) char *key; { register int ub, lb; register int halfway; int order; if (nignored == 0) return(-1); for(lb = 0, ub = nignored - 1; ub >= lb; ){ halfway = (ub + lb)/2; if ( (order = strcmp(key, names_ignored[halfway])) == 0) return(halfway); if (order < 0) /*key is less than probe, throw away above*/ ub = halfway - 1; else lb = halfway + 1; } return(-1); } /* * Tell if the error text is to be ignored. * The error must have been canonicalized, with * the file name the zeroth entry in the errorv, * and the linenumber the second. * Return the new categorization of the error class. */ Errorclass discardit(errorp) register struct error_desc *errorp; { int language; register int i; Errorclass errorclass = errorp->error_e_class; switch(errorclass){ case C_SYNC: case C_NONSPEC: case C_UNKNOWN: return(errorclass); default: ; } if(errorp->error_lgtext < 2){ return(C_NONSPEC); } language = errorp->e((rror_language; if(language == INLINT){ if (errorclass != C_NONSPEC){ /* no file */ for(i=0; lint_libs[i] != 0; i++){ if (strcmp(errorp->error_text[0], lint_libs[i]) == 0){ return(C_DISCARD); } } } /* check if the argument to the error message is to be ignored*/ if (ispunct(lastchar(errorp->error_text[2]))) clob_last(errorp->error_text[2], '\0'); if (search_ignore(errorp->error_text[errorclass == C_NONSPEC ? 0 : 2]) >= 0){ return(C_NULLED); } } return(errorclass); } >ecmd/error/errorinput.c 444 0 33 27127 2477636321 10345 static char *sccsid = "@(#)errorinput.c 1.3 (Berkeley) 81/02/28"; #include #include #include "error.h" int wordc; /* how long the current error message is */ char **wordv; /* the actual error message */ int nerrors; int language; Errorclass onelong(); Errorclass cpp(); Errorclass pccccom(); /* Portable C Compiler C Compiler */ Errorclass richieccom(); /* Richie Compiler for 11 */ Errorclass lint0(); Errorclass lint1(); Errorclass lint2(); Errorclass lint3(); Errorclass make(); Errorclass f77(); Errorclass pi(); Errorclass ri(); /* * Eat all of the lines in the input file, attempting to categorize * them by their various flavors */ static char inbuffer[BUFSIZ]; eaterrors(r_errorc, r_errorv) int *r_errorc; struct error_desc ***r_errorv; { extern boolean piflag; Errorclass errorclass = C_SYNC; for (;;){ if (fgets(inbuffer, BUFSIZ, errorfile) == NULL) break; wordvbuild(inbuffer, &wordc, &wordv); /* * for convience, convert wordv to be 1 based, instead * of 0 based. */ wordv -= 1; if ( 0 #ifndef ERNIE || (piflag && ( (errorclass = pi() ) != C_UNKNOWN)) #endif || (( errorclass = onelong() ) != C_UNKNOWN) || (( errorclass = cpp() ) != C_UNKNOWN) || (( errorclass = pccccom() ) != C_UNKNOWN) || (( errorclass = richieccom() ) != C_UNKNOWN) || (( errorclass = lint0() ) != C_UNKNOWN) || (( errorclass = lint1() ) != C_UNKNOWN) || (( errorclass = lint2() ) != C_UNKNOWN) || (( errorclass = lint3() ) != C_UNKNOWN) || (( errorclass = make() ) != C_UNKNOWN) || (( errorclass = f77() ) != C_UNKNOWN) #ifdef ERNIE || ((errorclass = pi() ) != C_UNKNOWN) || (( errorclass = ri() )!= C_UNKNOWN) #endif ) ; else errorclass = catchall(); if (wordc) erroradd(wordc, wordv+1, errorclass, C_UNKNOWN); } #ifdef FULLDEBUG printf("%d errorentrys\n", nerrors); #endif arrayify(r_errorc, r_errorv, er_head); } /* * create a new error entry, given a zero based array and count */ erroradd(errorlength, errorv, errorclass, errorsubclass) int errorlength; char **errorv; Errorclass errorclass; Errorclass errorsubclass; { register struct error_desc *newerror; register char *cp; if (errorclass == C_TRUE){ /* check canonicalization of the second argument*/ for(cp = errorv[1]; *cp && isdigit(*cp); cp++) continue; errorclass = (*cp == '\0') ? C_TRUE : C_NONSPEC; #ifdef FULLDEBUG if (errorclass != C_TRUE) printf("The 2nd word, \"%s\" is not a number.\n", errorv[1]); #endif } if (errorlength > 0){ newerror = (struct error_desc *)Calloc(1, sizeof(struct error_desc)); newerror->error_language = language; /* language is global */ newerror->error_text = errorv; newerror->error_lgtext = errorlength; if (errorclass == C_TRUE) newerror->error_line = atoi(errorv[1]); newerror->error_e_class = errorclass; newerror->error_s_class = errorsubclass; switch(newerror->error_e_class = discardit(newerror)){ case C_SYNC: nsyncerrors++; break; case C_DISCARD: ndiscard++; break; case C_NULLED: nnulled++; break; case C_NONSPEC: nnonspec++; break; case C_THISFILE: nthisfile++; break; case C_TRUE: ntrue++; break; case C_UNKNOWN: nunknown++; break; case C_IGNORE: nignore++; break; } newerror->error_next = er_head; er_head = newerror; newerror->error_no = nerrors++; } /* length > 0 */ } Errorclass onelong() { char **nwordv; if ( (wordc == 1) && (language != INLD) ){ /* * We have either: * a) file name from cc * b) Assembler telling world that it is complaining * c) Noise from make ("Stop.") * c) Random noise */ wordc = 0; if (strcmp(wordv[2], "Stop.") == 0){ language = INMAKE; return(C_SYNC); } if (strcmp(wordv[1], "Assembler:") == 0){ /* assembler always alerts us to what happened*/ language = INAS; return(C_SYNC); } else if (strcmp(wordv[1], "Undefined:") == 0){ /* loader complains about unknown symbols*/ language = INLD; return(C_SYNC); } if (lastchar(wordv[1]) == ':'){ /* cc tells us what file we are in */ currentfilename = wordv[1]; substitute(currentfilename, ':', '\0'); language = INCC; return(C_SYNC); } } else if ( (wordc == 1) && (language == INLD) ){ nwordv = (char **)Calloc(4, sizeof(char *)); nwordv[0] = "ld:"; nwordv[1] = wordv[1]; nwordv[2] = "is"; nwordv[3] = "undefined."; wordc = 4; wordv = nwordv - 1; return(C_NONSPEC); } else if (wordc == 1){ return(C_SYNC); } return(C_UNKNOWN); } /* end of one long */ Errorclass cpp() { /* * Now attempt a cpp error message match * Examples: * ./morse.h: 23: undefined control * morsesend.c: 229: MAGNIBBL: argument mismatch * morsesend.c: 237: MAGNIBBL: argument mismatch * test1.c: 6: undefined control */ if ( (language != INLD) /* loader errors have almost same fmt*/ && (lastchar(wordv[1]) == ':') && (isdigit(firstchar(wordv[2]))) && (lastchar(wordv[2]) == ':') ){ language = INCPP; clob_last(wordv[1], '\0'); clob_last(wordv[2], '\0'); return(C_TRUE); } return(C_UNKNOWN); } /*end of cpp*/ Errorclass pccccom() { /* * Now attempt a ccom error message match: * Examples: * "morsesend.c", line 237: operands of & have incompatible types * "test.c", line 7: warning: old-fashioned initialization: use = * "subdir.d/foo2.h", line 1: illegal initialization */ if ( (firstchar(wordv[1]) == '"') && (lastchar(wordv[1]) == ',') && (next_lastchar(wordv[1]) == '"') && (strcmp(wordv[2],"line") == 0) && (isdigit(firstchar(wordv[3]))) && (lastchar(wordv[3]) == ':') ){ clob_last(wordv[1], '\0'); /* drop last , */ clob_last(wordv[1], '\0'); /* drop last " */ wordv[1]++; /* drop first " */ clob_last(wordv[3], '\0'); /* drop : on line number */ wordv[2] = wordv[1]; /* overwrite "line" */ wordv++; /*compensate*/ if (language == INAS){ if (strcmp(currentfilename, "???") != 0) wordv[1] = currentfilename; return(C_NULLED); } else { currentfilename = wordv[1]; language = INCC; return(C_TRUE); } } return(C_UNKNOWN); } /* end of ccom */ /* * Do the error message from the Richie C Compiler for the PDP11, * which has this source: * * if (filename[0]) * fprintf(stderr, "%s:", filename); * fprintf(stderr, "%d: ", line); * */ Errorclass richieccom() { register char *cp; register char **nwordv; char *file; if (lastchar(wordv[1]) == ':'){ cp = wordv[1] + strlen(wordv[1]) - 1; while (isdigit(*--cp)) continue; if (*cp == ':'){ clob_last(wordv[1], '\0'); /* last : */ *cp = '\0'; /* first : */ file = wordv[1]; nwordv = wordvsplice(1, wordc, wordv+1); nwordv[0] = file; nwordv[1] = cp + 1; wordc += 1; wordv = nwordv - 1; language = INCC; currentfilename = wordv[1]; return(C_TRUE); } } return(C_UNKNOWN); } Errorclass lint0() { register char *cp; register char **nwordv; char *line, *file; /* * Attempt a match for the new lint style normal compiler * error messages, of the form * * printf("%s(%d): %s\n", filename, linenumber, message); */ if (wordc >= 2){ if ( (lastchar(wordv[1]) == ':') && (next_lastchar(wordv[1]) == ')') ) { clob_last(wordv[1], '\0'); /* colon */ if (persperdexplode(wordv[1], &line, &file)){ nwordv = wordvsplice(1, wordc, wordv+1); nwordv[0] = file; /* file name */ nwordv[1] = line; /* line number */ wordc += 1; wordv = nwordv - 1; language = INLINT; return(C_TRUE); } wordv[1][strlen(wordv[1])] = ':'; } } return (C_UNKNOWN); } Errorclass lint1() { char *line1, *line2; char *file1, *file2; char **nwordv1, **nwordv2; /* * Now, attempt a match for the various errors that lint * can complain about. * * Look first for type 1 lint errors */ if (strcmp(wordv[wordc-1], "::") == 0){ /* * %.7s, arg. %d used inconsistently %s(%d) :: %s(%d) * %.7s value used inconsistently %s(%d) :: %s(%d) * %.7s multiply declared %s(%d) :: %s(%d) * %.7s value declared inconsistently %s(%d) :: %s(%d) * %.7s function value type must be declared before use %s(%d) :: %s(%d) */ language = INLINT; if ( (persperdexplode(wordv[wordc], &line2, &file2)) && (persperdexplode(wordv[wordc-2], &line1, &file1)) ){ nwordv1 = wordvsplice(2, wordc, wordv+1); nwordv2 = wordvsplice(2, wordc, wordv+1); nwordv1[0] = file1; nwordv1[1] = line1; erroradd(wordc+2, nwordv1, C_TRUE, C_DUPL); /* takes 0 based*/ nwordv2[0] = file2; nwordv2[1] = line2; wordc = wordc + 2; wordv = nwordv2 - 1; /* 1 based */ return(C_TRUE); } } return(C_UNKNOWN); } /* end of lint 1*/ Errorclass lint2() { char *file; char *line; char **nwordv; /* * Look for type 2 lint errors * * %.7s used( %s(%d) ), but not defined * %.7s defined( %s(%d) ), but never used * %.7s declared( %s(%d) ), but never used or defined * * bufp defined( "./metric.h"(10) ), but never used */ if ( (lastchar(wordv[2]) == '(' /* ')' */ ) && (strcmp(wordv[4], "),") == 0) ){ language = INLINT; if (persperdexplode(wordv[3], &line, &file)){ nwordv = wordvsplice(2, wordc, wordv+1); nwordv[0] = file; nwordv[1] =(( line; wordc = wordc + 2; wordv = nwordv - 1; /* 1 based */ return(C_TRUE); } } return(C_UNKNOWN); } /* end of lint 2*/ char *Lint31[4] = {"returns", "value", "which", "is"}; char *Lint32[6] = {"value", "is", "used,", "but", "none", "returned"}; Errorclass lint3() { if ( (wordvcmp(wordv+2, 4, Lint31) == 0) || (wordvcmp(wordv+2, 6, Lint32) == 0) ){ language = INLINT; return(C_NONSPEC); } return(C_UNKNOWN); } /* * Special word vectors for use by F77 recognition */ char *F77_fatal[3] = {"Compiler", "error", "line"}; char *F77_error[3] = {"Error", "on", "line"}; char *F77_warning[3] = {"Warning", "on", "line"}; f77() { char **nwordv; /* * look for f77 errors: * Error messages from /usr/src/cmd/f77/error.c, with * these printf formats: * * Compiler error line %d of %s: %s * Error on line %d of %s: %s * Warning on line %d of %s: %s */ if (wordc < 6) return(C_UNKNOWN); if ( (lastchar(wordv[6]) == ':') &&( (wordvcmp(wordv+1, 3, F77_fatal) == 0) || (wordvcmp(wordv+1, 3, F77_error) == 0) || (wordvcmp(wordv+1, 3, F77_warning) == 0) ) ){ language = INF77; nwordv = wordvsplice(2, wordc, wordv+1); nwordv[0] = wordv[6]; clob_last(nwordv[0],'\0'); nwordv[1] = wordv[4]; wordc += 2; wordv = nwordv - 1; /* 1 based */ return(C_TRUE); } return(C_UNKNOWN); } /* end of f77 */ char *Make_Croak[3] = {"***", "Error", "code"}; char *Make_NotRemade[5] = {"not", "remade", "because", "of", "errors"}; Errorclass make() { if (wordvcmp(wordv+1, 3, Make_Croak) == 0){ language = INMAKE; return(C_SYNC); } if (wordvcmp(wordv+2, 5, Make_NotRemade) == 0){ language = INMAKE; return(C_SYNC); } return(C_UNKNOWN); } Errorclass ri() { char **nwordv; /* * Match an error message produced by ri; here is the * procedure yanked from the distributed version of ri * April 24, 1980. * * serror(str, x1, x2, x3) * char str[]; * char *x1, *x2, *x3; * { * extern int yylineno; * * putc('"', stdout); * fputs(srcfile, stdout); * putc('"', stdout); * fprintf(stdout, " %d: ", yylineno); * fprintf(stdout, str, x1, x2, x3); * fprintf(stdout, "\n"); * synerrs++; * } */ if ( (firstchar(wordv[1]) == '"') &&(lastchar(wordv[1]) == '"') &&(lastchar(wordv[2]) == ':') &&(isdigit(firstchar(wordv[2]))) ){ clob_last(wordv[1], '\0'); /* drop the last " */ wordv[1]++; /* skip over the first " */ clob_last(wordv[2], '\0'); language = INRI; return(C_TRUE); } return(C_UNKNOWN); } Errorclass catchall() { /* * Catches random things. */ language = INUNKNOWN; return(C_NONSPEC); } /* end of catch all*/ ; * fprintf(stdout, "\n"); * synerrs++; * } */ if ( (firstchar(wordv[1]) == '"') &&(lastchar(wordv[1]) == '"') &&(lastchar(wordv[2]) == ':') &&(isdigit(firstchar(wordv[2]))) ){ clob_last(wordv[1], '\0'); /* drop the last " */ wordv[1]++; /* skip over the first " */ clob_last(wordv[2], '\0'); language = INRI; return(C_TRUE); } return(C_UNKNOWN); } Errorclass catchall() { /* * Catches cmd/error/errormain.c 444 0 33 15075 2423112746 10120 static char *sccsid = "@(#)errormain.c 1.2 (Berkeley) 10/16/80"; #include #include #include #include "error.h" int nerrors = 0; struct error_desc *er_head; struct error_desc **errors; int nfiles = 0; struct error_desc ***files; /* array of pointers into errors*/ int language = INCC; char *currentfilename = "????"; char *processname; char *im_on; /* my tty name */ boolean query = FALSE; /* query the operator if touch files */ boolean notouch = FALSE; /* don't touch ANY files */ boolean piflag = FALSE; /* this is not pi */ char *suffixlist = ".*"; /* initially, can touch any file */ int errorsort(); int onintr(); /* * error [-I ignorename] [-n] [-q] [-t suffixlist] [-s] [-v] [infile] * * -I: the following name, `ignorename' contains a list of * function names that are not to be treated as hard errors. * Default: ~/.errorsrc * * -n: don't touch ANY files! * * -q: The user is to be queried before touching each * file; if not specified, all files with hard, non * ignorable errors are touched (assuming they can be). * * -t: touch only files ending with the list of suffices, each * suffix preceded by a dot. * eg, -t .c.y.l * will touch only files ending with .c, .y or .l * * -s: print a summary of the error's categories. * * -v: after touching all files, overlay vi(1), ex(1) or ed(1) * on top of error, entered in the first file with * an error in it, with the appropriate editor * set up to use the "next" command to get the other * files containing errors. * * -p: (obsolete: for older versions of pi without bug * fix regarding printing out the name of the main file * with an error in it) * Take the following argument and use it as the name of * the pascal source file, suffix .p * * -E: show the errors in sorted order; intended for * debugging. * * -S: show the errors in unsorted order * (as they come from the error file) * * infile: The error messages come from this file. * Default: stdin */ main(argc, argv) int argc; char *argv[]; { char *cp; char *ignorename = 0; int ed_argc; char **ed_argv; /*return from touchfiles*/ boolean show_errors = FALSE; boolean Show_Errors = FALSE; boolean pr_summary = FALSE; boolean edit_files = FALSE; processname = argv[0]; errorfile = stdin; if (argc > 1){ for(; (argc > 1) && (argv[1][0] == '-'); argc--, argv++){ for (cp = argv[1] + 1; *cp; cp++){ switch(*cp){ default: fprintf(stderr, "%s: -%c: Unknown flag\n", processname, *cp); break; case 'n': /* no touch */ notouch = TRUE; break; case 'q': /* query */ query = TRUE; break; case 'S': Show_Errors = TRUE; break; case 's': /* show summary */ pr_summary = TRUE; break; case 'v': /* edit files */ edit_files = TRUE; break; #ifndef ERNIE case 'p': *cp-- = 0; argv++; argc--; if (argc > 1){ currentfilename=argv[1]; piflag = TRUE; } break; #endif case 't': *cp-- = 0; argv++; argc--; if (argc > 1){ suffixlist = argv[1]; } break; case 'I': /*ignore file name*/ *cp-- = 0; argv++; argc--; if (argc > 1) ignorename = argv[1]; break; } /*end of the argument switch*/ } /*end of loop to consume characters after '-'*/ } } /* end of being at least one argument */ if (notouch) suffixlist = 0; if (argc > 1){ if (argc > 3){ fprintf(stderr, "%s: Only takes 0 or 1 arguments\n", processname); exit(3); } if ( (errorfile = fopen(argv[1], "r")) == NULL){ fprintf(stderr, "%s: %s: No such file or directory for reading errors.\n", processname, argv[1]); exit(4); } } im_on = "/dev/tty"; if ( (queryfile = fopen(im_on, "r")) == NULL){ fprintf(stderr,"%s: Can't open \"%s\" to query the user.\n", processname, im_on); exit(9); } if (signal(SIGINT, onintr) == SIG_IGN) signal(SIGINT, SIG_IGN); if (signal(SIGTERM, onintr) == SIG_IGN) signal(SIGTERM, SIG_IGN); getignored(ignorename); eaterrors(&nerrors, &errors); if (Show_Errors) printerrors(TRUE, nerrors, errors); qsort(errors, nerrors, sizeof (struct error_desc *), errorsort); if (show_errors) printerrors(FALSE, nerrors, errors); findfiles(nerrors, errors, &nfiles, &files); #define P(msg, arg) fprintf(stdout, msg, arg) if (pr_summary){ if (nunknown) P("%d Errors are unclassifiable.\n", nunknown); if (nignore) P("%d Errors are classifiable, but totally discarded.\n",nignore); if (nsyncerrors) P("%d Errors are synchronization errors.\n", nsyncerrors); if (nignore) P("%d Errors are discarded because they refer to sacrosinct files.\n", ndiscard); if (nnulled) P("%d Errors are nulled because they refer to specific functions.\n", nnulled); if (nnonspec) P("%d Errors are not specific to any file.\n", nnonspec); if (nthisfile) P("%d Errors are specific to a given file, but not to a line.\n", nthisfile); if (ntrue) P("%d Errors are true errors, and can be inserted into the files.\n", ntrue); } filenames(nfiles, files); fflush(stdout); if (touchfiles(nfiles, files, &ed_argc, &ed_argv) && edit_files){ if (!query || inquire("Do you still want to edit the files you touched? ")){ /* * ed_agument's first argument is * a vi/ex compatabile search argument * to find the first occurance of ### */ try("vi", ed_argc, ed_argv); try("ex", ed_argc, ed_argv); try("ed", ed_argc-1, ed_argv+1); fprintf(stdout, "Can't find any editors.\n"); } } } try(name, argc, argv) char *name; int argc; char **argv; { argv[0] = name; wordvprint(stdout, argc, argv); fprintf(stdout, "\n"); fflush(stderr); fflush(stdout); sleep(2); if (freopen(im_on, "r", stdin) == NULL) return; if (freopen(im_on, "w", stdout) == NULL) return; execvp(name, argv); } int errorsort(epp1, epp2) struct error_desc **epp1, **epp2; { register struct error_desc *ep1, *ep2; int order; /* * Sort by: * 1) synchronization, non specific, discarded errors first; * 2) nulled and true errors last * a) grouped by similar file names * 1) grouped in ascending line number */ ep1 = *epp1; ep2 = *epp2; if (ep1 == 0 || ep2 == 0) return(0); if ( (NOTSORTABLE(ep1->error_e_class)) ^ (NOTSORTABLE(ep2->error_e_class))){ return(NOTSORTABLE(ep1->error_e_class) ? -1 : 1); } if (NOTSORTABLE(ep1->error_e_class)) /* then both are */ return(ep1->error_no - ep2->error_no); order = strcmp(ep1->error_text[0], ep2->error_text[0]); if (order == 0){ ret((urn(ep1->error_line - ep2->error_line); } return(order); } ed by similar file names * 1) grouped in ascending line number */ ep1 = *epp1; ep2 = *epp2; if (ep1 == 0 || ep2 == 0) return(0); if ( (NOTSORTABLE(ep1->error_e_class)) ^ (NOTSORTABLE(ep2->error_e_class))){ return(NOTSORTABLE(ep1->error_e_class) ? -1 : 1); } if (NOTSORTABLE(ep1->error_e_class)) /* then both are */ return(ep1->error_no - ep2->error_no); order = strcmp(ep1->error_text[0], ep2->error_text[0]); if (order == 0){ retcmd/error/errorpi.c 444 0 33 25274 2423111671 7602 static char *sccsid = "@(#)errorpi.c 1.1 (Berkeley) 10/16/80"; #include #include #include "error.h" extern char *currentfilename; static char *c_linenumber; static char *unk_hdr[] = {"In", "program", "???"}; static char **c_header = &unk_hdr[0]; /* * Attempt to handle error messages produced by pi (and by pc) * * problem #1: There is no file name available when a file does not * use a #include; this will have to be given to error * in the command line. * problem #2: pi doesn't always tell you what line number * a error refers to; for example during the tree * walk phase of code generation and error detection, * an error can refer to "variable foo in procedure bletch" * without giving a line number * problem #3: line numbers, when available, are attached to * the source line, along with the source line itself * These line numbers must be extracted, and * the source line thrown away. * problem #4: Some error messages produce more than one line number * on the same message. * There are only two (I think): * %s undefined on line%s * %s improperly used on line%s * here, the %s makes line plural or singular. * * Here are the error strings used in pi version 1.2 that can refer * to a file name or line number: * * Multiply defined label in case, lines %d and %d * Goto %s from line %d is into a structured statement * End matched %s on line %d * Inserted keyword end matching %s on line %d * * Here are the general pi patterns recognized: * define piptr == -.*^-.* * define msg = .* * define digit = [0-9] * definename = .* * define date_format letter*3 letter*3 (digit | (digit digit)) * (digit | (digit digit)):digit*2 digit*4 * * {e,E} (piptr) (msg) Encounter an error during textual scan * E {digit}* - (msg) Have an error message that refers to a new line * E - msg Have an error message that refers to current * function, program or procedure * (date_format) (name): When switch compilation files * ... (msg) When refer to the previous line * 'In' ('procedure'|'function'|'program') (name): * pi is now complaining about 2nd pass errors. * * Here is the output from a compilation * * * 2 var i:integer; * e --------------^--- Inserted ';' * E 2 - All variables must be declared in one var part * E 5 - Include filename must end in .i * Mon Apr 21 15:56 1980 test.h: * 2 begin * e ------^--- Inserted ';' * Mon Apr 21 16:06 1980 test.p: * E 2 - Function type must be specified * 6 procedure foo(var x:real); * e ------^--- Inserted ';' * In function bletch: * E - No assignment to the function variable * w - variable x is never used * E 6 - foo is already defined in this block * In procedure foo: * w - variable x is neither used nor set * 9 z : = 23; * E --------------^--- Undefined variable * 10 y = [1]; * e ----------------^--- Inserted ':' * 13 z := 345.; * e -----------------------^--- Digits required after decimal point * E 10 - Constant set involved in non set context * E 11 - Type clash: real is incompatible with integer * ... Type of expression clashed with type of variable in assignment * E 12 - Parameter type not identical to type of var parameter x of foo * In program mung: * w - variable y is never used * w - type foo is never used * w - function bletch is never used * E - z undefined on lines 9 13 */ char *Months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct","Nov", "Dec", 0 }; char *Days[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", 0 }; char *Piroutines[] = { "program", "function", "procedure", 0 }; static boolean structured, multiple; char *pi_Endmatched[] = {"End", "matched"}; char *pi_Inserted[] = {"Inserted", "keyword", "end", "matching"}; char *pi_multiple[] = {"Mutiply", "defined", "label", "in", "case,", "line"}; char *pi_structured[] = {"is", "into", "a", "structured", "statement"}; char *pi_und1[] = {"undefined", "on", "line"}; char *pi_und2[] = {"undefined", "on", "lines"}; char *pi_imp1[] = {"improperly", "used", "on", "line"}; char *pi_imp2[] = {"improperly", "used", "on", "lines"}; boolean alldigits(string) register char *string; { for (; *string && isdigit(*string); string++) continue; return(*string == '\0'); } boolean instringset(member, set) char *member; register char **set; { for(; *set; set++){ if (strcmp(*set, member) == 0) return(TRUE); } return(FALSE); } boolean isdateformat(wordc, wordv) int wordc; char **wordv; { return( (wordc == 5) && (instringset(wordv[0], Days)) && (instringset(wordv[1], Months)) && (alldigits(wordv[2])) && (alldigits(wordv[4])) ); } boolean piptr(string) register char *string; { int state = 0; if (*string != '-') return(FALSE); while (*string && *string == '-') string++; if (*string != '^') return(FALSE); string++; while (*string && *string == '-') string++; return(*string == '\0'); } extern int wordc; extern char **wordv; Errorclass pi() { char **nwordv; char buffer[128]; if ( ( strlen(wordv[1]) == 1) && ( (wordv[1][0] == 'e') || (wordv[1][0] == 'E') ) && ( piptr(wordv[2]) ) ) { boolean longpiptr = 0; /* * We have recognized a first pass error of the form: * letter ------^---- message * * turn into an error message of the form: * * file line 'pascal errortype' letter \n |---- message * or of the form: * file line letter |---- message * when there are strlen("(*[pi]") or more * preceding '-' on the error pointer. * * Where the | is intended to be a down arrow, so that * the pi error messages can be inserted above the * line in error, instead of below. (All of the other * langauges put thier messages before the source line, * instead of after it as does pi.) * * where the pointer to the error has been truncated * by 6 characters to account for the fact that * the pointer points into a tab preceded input line. */ language = INPI; substitute(wordv[2], '^', '|'); longpiptr = position(wordv[2],'|') > (6+8); nwordv = wordvsplice(longpiptr ? 2 : 4, wordc, wordv+1); nwordv[0] = strsave(currentfilename); nwordv[1] = strsave(c_linenumber); if (!longpiptr){ nwordv[2] = "pascal errortype"; nwordv[3] = wordv[1]; nwordv[4] = strsave("%%%\n"); if (strlen(nwordv[5]) > (8-2)) /* this is the pointer */ nwordv[5] += (8-2); /* bump over 6 characters */ } wordv = nwordv - 1; /* convert to 1 based */ wordc += longpiptr ? 2 : 4; return(C_TRUE); } if ( (wordc >= 4) && (strlen(wordv[1]) == 1) && ( (*wordv[1] == 'E') || (*wordv[1] == 'w') || (*wordv[1] == 'e') ) && (alldigits(wordv[2])) && (strlen(wordv[3]) == 1) && (wordv[3][0] == '-') ){ /* * Message of the form: letter linenumber - message * Turn into form: filename linenumber letter - message */ language = INPI; nwordv = wordvsplice(1, wordc, wordv + 1); nwordv[0] = strsave(currentfilename); nwordv[1] = wordv[2]; nwordv[2] = wordv[1]; c_linenumber = wordv[2]; wordc += 1; wordv = nwordv - 1; return(C_TRUE); } if ( (wordc >= 3) && (strlen(wordv[1]) == 1) && ( (*(wordv[1]) == 'E') || (*(wordv[1]) == 'w') || (*(wordv[1]) == 'e') ) && (strlen(wordv[2]) == 1) && (wordv[2][0] == '-') ) { /* * Message of the form: letter - message * This happens only when we are traversing the tree * during the second pass of pi, and discover semantic * errors. * * We have already (presumably) saved the header message * and can now construct a nulled error message for the * current file. * * Turns into a message of the form: * filename (header) letter - message * * First, see if it is a message referring to more than * one line number. Only of the form: * %s undefined on line%s * %s improperly used on line%s */ boolean undefined = 0; int wordindex; language = INPI; if ( (undefined = (wordvcmp(wordv+2, 3, pi_und1) == 0) ) || (undefined = (wordvcmp(wordv+2, 3, pi_und2) == 0) ) || (wordvcmp(wordv+2, 4, pi_imp1) == 0) || (wordvcmp(wordv+2, 4, pi_imp2) == 0) ){ for (wordindex = undefined ? 5 : 6; wordindex <= wordc; wordindex++){ nwordv = wordvsplice(2, undefined ? 2 : 3, wordv+1); nwordv[0] = strsave(currentfilename); nwordv[1] = wordv[wordindex]; if (wordindex != wordc) erroradd(undefined ? 4 : 5, nwordv, C_TRUE, C_UNKNOWN); } wordc = undefined ? 4 : 5; wordv = nwordv - 1; return(C_TRUE); } nwordv = wordvsplice(1+3, wordc, wordv+1); nwordv[0] = strsave(currentfilename); nwordv[1] = strsave(c_header[0]); nwordv[2] = strsave(c_header[1]); nwordv[3] = strsave(c_header[2]); wordv = nwordv - 1; wordc += 1 + 3; return(C_THISFILE); } if (strcmp(wordv[1], "...") == 0){ /* * have a continuation error message * of the form: ... message * Turn into form : filename linenumber message */ language = INPI; nwordv = wordvsplice(1, wordc, wordv+1); nwordv[0] = strsave(currentfilename); nwordv[1] = strsave(c_li((nenumber); wordv = nwordv - 1; wordc += 1; return(C_TRUE); } if( (wordc == 6) && (lastchar(wordv[6]) == ':') && (isdateformat(5, wordv + 1)) ){ /* * Have message that tells us we have changed files */ language = INPI; currentfilename = strsave(wordv[6]); clob_last(currentfilename, '\0'); return(C_SYNC); } if( (wordc == 3) && (strcmp(wordv[1], "In") == 0) && (lastchar(wordv[3]) == ':') && (instringset(wordv[2], Piroutines)) ) { language = INPI; c_header = wordvsplice(0, wordc, wordv+1); return(C_SYNC); } /* * now, check for just the line number followed by the text */ if (alldigits(wordv[1])){ language = INPI; c_linenumber = wordv[1]; return(C_IGNORE); } /* * Attempt to match messages refering to a line number * * Multiply defined label in case, lines %d and %d * Goto %s from line %d is into a structured statement * End matched %s on line %d * Inserted keyword end matching %s on line %d */ multiple = structured = 0; if ( ( (wordc == 6) && (wordvcmp(wordv+1, 2, pi_Endmatched) == 0)) || ( (wordc == 8) && (wordvcmp(wordv+1, 4, pi_Inserted) == 0)) || ( multiple = ((wordc == 9) && (wordvcmp(wordv+1,6, pi_multiple) == 0) ) ) || ( structured = ((wordc == 10) && (wordvcmp(wordv+6,5, pi_structured) == 0 ) )) ){ language = INPI; nwordv = wordvsplice(2, wordc, wordv+1); nwordv[0] = strsave(currentfilename); nwordv[1] = structured ? wordv [5] : wordv[wordc]; wordc += 2; wordv = nwordv - 1; if (!multiple) return(C_TRUE); erroradd(wordc, nwordv, C_TRUE, C_UNKNOWN); nwordv = wordvsplice(0, wordc, nwordv); nwordv[1] = wordv[wordc - 2]; return(C_TRUE); } return(C_UNKNOWN); } dv+1,6, pi_multiple) == 0) ) ) || ( structured = ((wordc == 10) && (wordvcmp(wordv+6,5, pi_structured) == 0 ) )) ){ language = INPI; nwordv = wordvsplice(2, wordc, wordv+1); nwordv[0] = strsave(currentfilename); nwordv[1] = structured ? wordv [5] : wordv[wordc]; wordc += 2; wordv = nwordv - 1; if (!multcmd/error/errorsubr.c 444 0 33 17216 2423111676 10147 static char *sccsid = "@(#)errorsubr.c 1.1 (Berkeley) 10/16/80"; #include #include #include "error.h" /* * go through and arrayify a list of rules */ arrayify(e_length, e_array, header) int *e_length; struct error_desc ***e_array; struct error_desc *header; { register struct error_desc *errorp; register struct error_desc **array; register int listlength; register int listindex; for (errorp = header, listlength = 0; errorp; errorp = errorp->error_next, listlength++) continue; array = (struct error_desc **)Calloc(listlength+1,sizeof (struct error_desc*)); for(listindex = 0, errorp = header; listindex < listlength; listindex++, errorp = errorp->error_next){ array[listindex] = errorp; errorp->error_position = listindex; } array[listindex] = (struct error_desc *)0; *e_length = listlength; *e_array = array; } /*VARARGS1*/ error(msg, a1, a2, a3) char *msg; { fprintf(stderr, "Error: "); fprintf(stderr, msg, a1, a2, a3); fprintf(stderr, "\n"); fflush(stdout); fflush(stderr); exit(6); } /*ARGSUSED*/ char *Calloc(nelements, size) int nelements; int size; { char *back; if ( (back = (char *)calloc(nelements, size)) == (char *)NULL){ error("Ran out of memory.\n"); exit(1); } return(back); } char *strsave(instring) char *instring; { char *outstring; strcpy(outstring = (char *)Calloc(1, strlen(instring) + 1), instring); return(outstring); } /* * find the position of a given character in a string * (one based) */ int position(string, ch) register char *string; register char ch; { register int i; for (i=1; *string; string++, i++){ if (*string == ch) return(i); } return(-1); } /* * clobber the first occurance of ch in string by the new character */ char *substitute(string, chold, chnew) char *string; char chold, chnew; { register char *cp = string; while (*cp){ if (*cp == chold){ *cp = chnew; break; } cp++; } return(string); } char lastchar(string) char *string; { int length; length = strlen(string); if (length >= 1) return(string[length-1]); else return('\0'); } char firstchar(string) char *string; { return(string[0]); } char next_lastchar(string) char *string; { int length; length = strlen(string); if (length >= 2) return(string[length - 2]); else return('\0'); } clob_last(string, newstuff) char *string, newstuff; { int length; length = strlen(string); if (length >= 1) string[length - 1] = newstuff; } /* * parse a string that is the result of a format %s(%d) * return TRUE if this is of the proper format */ boolean persperdexplode(string, r_perd, r_pers) char *string; char **r_perd, **r_pers; { register char *cp; int length; length = strlen(string); if ( (length >= 4) && (string[length - 1] == ')' ) ){ for (cp = &string[length - 2]; (isdigit(*cp)) && (*cp != '('); --cp) continue; if (*cp == '('){ string[length - 1] = '\0'; /* clobber the ) */ *r_perd = strsave(cp+1); string[length - 1] = ')'; *cp = '\0'; /* clobber the ( */ *r_pers = strsave(string); *cp = '('; return(TRUE); } } return(FALSE); } /* * parse a quoted string that is the result of a format \"%s\"(%d) * return TRUE if this is of the proper format */ boolean qpersperdexplode(string, r_perd, r_pers) char *string; char **r_perd, **r_pers; { register char *cp; int length; length = strlen(string); if ( (length >= 4) && (string[length - 1] == ')' ) ){ for (cp = &string[length - 2]; (isdigit(*cp)) && (*cp != '('); --cp) continue; if (*cp == '(' && *(cp - 1) == '"'){ string[length - 1] = '\0'; *r_perd = strsave(cp+1); string[length - 1] = ')'; *(cp - 1) = '\0'; /* clobber the " */ *r_pers = strsave(string + 1); *(cp - 1) = '"'; return(TRUE); } } return(FALSE); } static char cincomment[] = CINCOMMENT; static char coutcomment[] = COUTCOMMENT; static char fincomment[] = FINCOMMENT; static char foutcomment[] = FOUTCOMMENT; static char newline[] = NEWLINE; static char piincomment[] = PIINCOMMENT; static char pioutcomment[] = PIOUTCOMMENT; static char lispincomment[] = LISPINCOMMENT; static char riincomment[] = RIINCOMMENT; static char rioutcomment[] = RIOUTCOMMENT; struct lang_desc lang_table[] = { /*INUNKNOWN 0*/ "unknown", cincomment, coutcomment, /*INCPP 1*/ "cpp", cincomment, coutcomment, /*INCC 2*/ "cc", cincomment, coutcomment, /*INAS 3*/ "as", ASINCOMMENT, newline, /*INLD 4*/ "ld", cincomment, coutcomment, /*INLINT 5*/ "lint", cincomment, coutcomment, /*INF77 6*/ "f77", fincomment, foutcomment, /*INPI 7*/ "pi", piincomment, pioutcomment, /*INPC 8*/ "pc", piincomment, pioutcomment, /*INFRANZ 9*/ "franz",lispincomment, newline, /*INLISP 10*/ "lisp", lispincomment, newline, /*INVAXIMA 11*/ "vaxima",lispincomment,newline, /*INRATFOR 12*/ "ratfor",fincomment, foutcomment, /*INLEX 13*/ "lex", cincomment, coutcomment, /*INYACC 14*/ "yacc", cincomment, coutcomment, /*INAPL 15*/ "apl", ".lm", newline, /*INMAKE 16*/ "make", ASINCOMMENT, newline, /*INRI 17*/ "ri", riincomment, rioutcomment, 0, 0, 0 }; printerrors(look_at_subclass, errorc, errorv) boolean look_at_subclass; int errorc; struct error_desc *errorv[]; { register int i; register struct error_desc *errorp; for (errorp = errorv[i = 0]; i < errorc; errorp = errorv[++i]){ if (errorp->error_e_class == C_IGNORE) continue; if (look_at_subclass && errorp->error_s_class == C_DUPL) continue; printf("Error %d, (%s error) [%s], text = \"", i, class_table[errorp->error_e_class], lang_table[errorp->error_language].lang_name); wordvprint(stdout,errorp->error_lgtext,errorp->error_text); printf("\"\n"); } } wordvprint(fyle, wordc, wordv) FILE *fyle; int wordc; char *wordv[]; { int i; for(i = 0; i < wordc; i++){ fprintf(fyle, "%s",wordv[i]); if (i != wordc - 1) fprintf(fyle, " "); } } /* * Given a string, parse it into a number of words, and build * a wordc wordv combination pointing into it. */ wordvbuild(string, r_wordc, r_wordv) char *string; int *r_wordc; char ***r_wordv; { register char *cp; char *saltedbuffer; char **wordv; int wordcount; int wordindex; saltedbuffer = strsave(string); for (wordcount = 0, cp = saltedbuffer; *cp; wordcount++){ while (*cp && isspace(*cp)) cp++; if (*cp == 0) break; while (!isspace(*cp)) cp++; } wordv = (char **)Calloc(wordcount + 1, sizeof (char *)); for (cp=saltedbuffer,wordindex=0; wordcount; wordindex++,--wordcount){ while (*cp && isspace(*cp)) cp++; if (*cp == 0) break; wordv[wordindex] = cp; while(!isspace(*cp)) cp++; *cp++ = '\0'; } if (wordcount != 0) error("Initial miscount of the number of words in a line\n"); wordv[wordindex] = (char *)0; #ifdef FULLDEBUG for (wordcount = 0; wordcount < wordindex; wordcount++) printf("Word %d = \"%s\"\n", wordcount, wordv[wordcount]); printf("\n"); #endif *r_wordc = wordindex; *r_wordv = wordv; } /* * Compare two 0 based wordvectors */ int wordvcmp(wordv1, wordc, wordv2) char **wordv1; int wordc; char **wordv2; { register int i; int back; for (i = 0; i < wordc; i++){ if (back = strcmp(wordv1[i], wordv2[i])){ return(back); } } return(0); /* they are equal */ } /* * splice a 0 basedword vector onto the tail of a * new wordv, allowing the first emptyhead slots to be empty */ char **wordvsplice(emptyhead, wordc, wordv) int emptyhead; int wordc; char **wordv; { register char **nwordv; int nwordc = emptyhead + wordc; register int i; nwordv = (char **)Calloc(nwordc, sizeof (char *)); f((or (i = 0; i < emptyhead; i++) nwordv[i] = 0; for(i = emptyhead; i < nwordc; i++){ nwordv[i] = wordv[i-emptyhead]; } return(nwordv); } rn(0); /* they are equal */ } /* * splice a 0 basedword vector onto the tail of a * new wordv, allowing the first emptyhead slots to be empty */ char **wordvsplice(emptyhead, wordc, wordv) int emptyhead; int wordc; char **wordv; { register char **nwordv; int nwordc = emptyhead + wordc; register int i; nwordv = (char **)Calloc(nwordc, sizeof (char *)); fcmd/error/errortouch.c 444 0 33 26712 2423113012 10301 static char *sccsid = "@(#)errortouch.c 1.2 (Berkeley) 10/16/80"; #include #include #include #include #include #include "error.h" findfiles(nerrors, errors, r_nfiles, r_files) int nerrors; struct error_desc **errors; int *r_nfiles; struct error_desc ****r_files; { int nfiles; struct error_desc ***files; char *currentfilename; register int errorindex; int fileindex; register struct error_desc *errorp; /* * First, go through and count all of the filenames */ for (errorp = errors[errorindex = 0],nfiles = 0, currentfilename = "\1"; errorindex < nerrors; errorp = errors[++errorindex]){ if (SORTABLE(errorp->error_e_class)){ if (strcmp(errorp->error_text[0],currentfilename) != 0){ nfiles++; currentfilename = errorp->error_text[0]; } } } files = (struct error_desc ***)Calloc(nfiles + 3, sizeof (struct error_desc**)); touchedfiles = (boolean *)Calloc(nfiles+3, sizeof(boolean)); /* * Now, go through and partition off the error messages * into those that are synchronization, discarded or * not specific to any file, and those that were * nulled or true errors. */ files[0] = &errors[0]; for (errorp = errors[errorindex = 0], fileindex = 0; (errorindex < nerrors) && (NOTSORTABLE(errorp->error_e_class)); errorp = errors[++errorindex]){ continue; } /* * Now, go through and partition off all error messages * for a given file. */ files[1] = &errors[errorindex]; touchedfiles[0] = touchedfiles[1] = FALSE; for (errorp = errors[errorindex], currentfilename = "\1", fileindex = 1; errorindex < nerrors; errorp = errors[++errorindex]){ if ( (errorp->error_e_class == C_NULLED) || (errorp->error_e_class == C_TRUE) ){ if (strcmp(errorp->error_text[0],currentfilename) != 0){ currentfilename = errorp->error_text[0]; touchedfiles[fileindex] = FALSE; files[fileindex++] = &errors[errorindex]; } } } files[fileindex] = &errors[nerrors]; *r_nfiles = nfiles; *r_files = files; } char *class_table[] = { /*C_UNKNOWN 0 */ "Unknown", /*C_IGNORE 1 */ "ignore", /*C_SYNC 2 */ "synchronization", /*C_DISCARD 3 */ "discarded", /*C_NONSPEC 4 */ "non specific", /*C_THISFILE 5 */ "specific to this file", /*C_NULLED 6 */ "nulled", /*C_TRUE 7 */ "true", /*C_DUPL 8 */ "duplicated" }; int class_count[C_LAST - C_FIRST] = {0}; filenames(nfiles, files) int nfiles; struct error_desc ***files; { register int fileindex; register struct error_desc *errorp; register struct error_desc **erpp; char *sep = " "; register int errortype; extern char *class_table[]; int someerrors = 0; /* * first, go through and simply dump out errors that * don't pertain to any file */ if (files[1] - files[0] > 0){ for(errortype = C_UNKNOWN; NOTSORTABLE(errortype); errortype++){ if (class_count[errortype] > 0){ if (errortype > C_SYNC) someerrors++; fprintf(stdout, "\n\t%d %s errors follow:\n", class_count[errortype], class_table[errortype]); for (errorp = *(erpp = files[0]); erpp < files[1]; errorp = (*++erpp)){ if (errorp->error_e_class == errortype) errorprint(stdout, errorp, TRUE); } } } } if (nfiles){ someerrors++; fprintf(stdout, "%d files contain errors:", nfiles); for (fileindex = 1; fileindex <= nfiles; fileindex++){ fprintf(stdout, "%s\"%s\" (%d)", sep, (*files[fileindex])->error_text[0], files[fileindex+1] - files[fileindex]); sep = ", "; } fprintf(stdout, "\n"); } if (!someerrors) fprintf(stdout, "No errors.\n"); } extern boolean notouch; boolean touchfiles(nfiles, files, r_edargc, r_edargv) int nfiles; struct error_desc ***files; int *r_edargc; char ***r_edargv; { char *currentfilename; register struct error_desc *errorp; register int fileindex; register struct error_desc **erpp; int ntrueerrors; int errordest; /* where errors go*/ char *sep; boolean scribbled; int n_pissed_on; /* # of file touched*/ int previewed; for (fileindex = 1; fileindex <= nfiles; fileindex++){ fprintf(stdout, "\nFile \"%s\" has %d total error messages.\n", currentfilename = (*files[fileindex])->error_text[0], files[fileindex+1] - files[fileindex]); /* * First, iterate through all error messages in this file * to see how many of the error messages really will * get inserted into the file. */ for (erpp = files[fileindex], ntrueerrors = 0; erpp < files[fileindex+1]; erpp++){ errorp = *erpp; if (errorp->error_e_class == C_TRUE) ntrueerrors++; } fprintf(stdout,"\t%d of these errors can be inserted into the file.\n", ntrueerrors); /* * What does the operator want? */ previewed = 0; errordest = TOSTDOUT; if (oktotouch(currentfilename) && (ntrueerrors > 0) ){ if (query && inquire("Do you want to preview the errors first?")){ previewed = 1; for (erpp = files[fileindex]; erpp < files[fileindex + 1]; erpp++){ errorprint(stdout, *erpp, TRUE); } fprintf(stdout, "\n"); } if ( !query || inquire("Do you want to touch file \"%s\"? ", currentfilename) ){ errordest = TOTHEFILE; if (!probethisfile(currentfilename)){ errordest = TOSTDOUT; fprintf(stdout, "Can't find file \"%s\" to insert error messages into.\n", currentfilename); } else { if (edit(currentfilename)) errordest = TOSTDOUT; else touchedfiles[fileindex] = TRUE; } } } if (previewed && (errordest == TOSTDOUT)) continue; /* with the next file */ /* * go through and print each error message, * diverting to the right place */ if ( (files[fileindex+1] - files[fileindex]) != ntrueerrors) if (!previewed) fprintf(stdout, ">>Uninserted error messages for file \"%s\" follow.\n", currentfilename); for (erpp = files[fileindex];erpp < files[fileindex+1];erpp++){ errorp = *erpp; if (errorp->error_e_class == C_TRUE){ switch (errordest){ case TOSTDOUT: if (!previewed) errorprint(stdout,errorp, TRUE); break; case TOTHEFILE: insert(errorp->error_line); text(errorp, FALSE); break; } /* switch */ } else { if (!previewed) errorprint(stdout, errorp, TRUE); } } /* end of walking through all errors*/ if (errordest == TOTHEFILE){ writetouched(); } } /* end of walking through all files*/ scribbled = FALSE; for (n_pissed_on = 0, fileindex = 1; fileindex <= nfiles; fileindex++){ scribbled |= touchedfiles[fileindex]; n_pissed_on++; } if (scribbled){ /* * Construct an execv argument * We need 1 argument for the editor's name * We need 1 argument for the initial search string * We need n_pissed_on arguments for the file names * We need 1 argument that is a null for execv. * The caller fills in the editor's name. * We fill in the initial search string. * We fill in the arguments, and the null. */ (*r_edargv) = (char **)Calloc(n_pissed_on + 3, sizeof(char *)); (*r_edargc) = n_pissed_on + 2; (*r_edargv)[1] = "+/###/"; n_pissed_on = 2; fprintf(stdout, "You touched file(s):"); sep = " "; for (fileindex = 1; fileindex <= nfiles; fileindex++){ if (!touchedfiles[fileindex]) continue; errorp = *(files[fileindex]); fprintf(stdout,"%s\"%s\"", sep, errorp->error_text[0]); sep = ", "; (*r_edargv)[n_pissed_on++] = errorp->error_text[0]; } fprintf(stdout, "\n"); (*r_edargv)[n_pissed_on] = 0; return(TRUE); } else { fprintf(stdout, "You didn't touch any files.\n"); return(FALSE); } } /* end of touchfiles*/ int oktotouch(filename) char *filename; { extern char *suffixlist; register char *src; register char *pat; char *osrc; pat = suffixlist; if (pat == 0) return(0); if (*pat == '*') return(1); while (*pat++ != '.') continue; --pat; /* point to the period */ for (src = &filename[strlen(filename)], --src; (src > filename) && (*src != '.'); --src) continue; if (*src != '.') return(0); for (src++, pat++, osrc = src; *src && *pat; src = osrc, pat++){ for (; *src /* not at end of the source */ && *pat /* not off end of pattern */ && *pat != '.' /* not off end of sub pattern */ && *pat != '*' /* not wild card */ && *src == *pat; /* and equal... */ src++, pat++) continue; if (*src == 0 && (*pat == 0 || *pat == '.' || *pat == '*')) return(1); if (*src != 0 && *pat == '*') return(1); while (*pat && *pat != '.') pat++; if (! *pat) return(0); } return(0); } FILE *o_touchedfile; /* the old file */ FILE *n_touchedfile; /* the new file */ char *o_name; char n_name[32]; char *canon_name = "ErrorXXXXXX"; int o_lineno; int n_lineno; boolean tempfileopen = FALSE; /* * open the file; guaranteed to be both readable and writable * Well, if it isn't, then return TRUE if something failed */ boolean edit(name) char *name; { o_name = name; if ( (o_touchedfile = fopen(name, "r")) == NULL){ fprintf(stderr, "%s: Can't open file \"%s\" to touch (read).\n", processname, name); return(TRUE); } strcpy(n_name, ca((non_name); mktemp(n_name); if ( (n_touchedfile = fopen(n_name, "w")) == NULL){ fprintf(stderr,"%s: Can't open file \"%s\" to touch (write).\n", processname, name); return(TRUE); } tempfileopen = TRUE; n_lineno = 0; o_lineno = 0; return(FALSE); } /* * Position to the line (before, after) the line given by place */ char edbuffer[BUFSIZ]; insert(place) int place; { --place; /* always insert messages before the offending line*/ for(; o_lineno < place; o_lineno++, n_lineno++){ if(fgets(edbuffer, BUFSIZ, o_touchedfile) == NULL) return; fputs(edbuffer, n_touchedfile); } } text(errorp, use_all) register struct error_desc *errorp; boolean use_all; { int offset = use_all ? 0 : 2; fputs(lang_table[errorp->error_language].lang_incomment, n_touchedfile); fprintf(n_touchedfile, "%d [%s] ", errorp->error_line, lang_table[errorp->error_language].lang_name); wordvprint(n_touchedfile, errorp->error_lgtext-offset, errorp->error_text+offset); fputs(lang_table[errorp->error_language].lang_outcomment,n_touchedfile); n_lineno++; } writetouched() { int bytes_read; for(; (bytes_read = fread(edbuffer, 1, sizeof(edbuffer), o_touchedfile))!= NULL; ){ fwrite(edbuffer, 1, bytes_read, n_touchedfile); } fclose(n_touchedfile); fclose(o_touchedfile); unlink(o_name); link(n_name, o_name); unlink(n_name); tempfileopen = FALSE; } onintr() { if (inquire("\nInterrupt: Do you want to continue?")){ signal(SIGINT, onintr); return; } if (tempfileopen) writetouched(); exit(1); } errorprint(place, errorp, print_all) FILE *place; struct error_desc *errorp; boolean print_all; { int offset = print_all ? 0 : 2; if (errorp->error_e_class == C_IGNORE) return; fprintf(place, "[%s] ", lang_table[errorp->error_language].lang_name); wordvprint(place,errorp->error_lgtext-offset,errorp->error_text+offset); putc('\n', place); } boolean inquire(fmt, a1, a2) char *fmt; /*VARARGS1*/ { char buffer[128]; char ch; for(;;){ do{ fflush(stdout); fprintf(stderr, fmt, a1, a2); fflush(stderr); } while (fgets(buffer, 127, queryfile) == NULL); ch = buffer[0]; if (ch == 'Y' || ch == 'y') return(TRUE); if (ch == 'N' || ch == 'n') return(FALSE); fprintf(stderr, "Yes or No only!\n"); } } boolean probethisfile(currentfilename) char *currentfilename; { struct stat statbuf; if (stat(currentfilename, &statbuf) != 0) return(FALSE); if ( (statbuf.st_mode&S_IREAD) && (statbuf.st_mode&S_IWRITE)) return(TRUE); return(FALSE); } out); fprintf(stderr, fmt, a1, a2); fflush(stdercmd/mklost+found.s 755 0 33 707 2460467524 7402 mkdir lost+found cd lost+found echo creating slots... for i in 1 2 3 4 5 6 7 8 9 0 a b c d e f do tee ${i}1 ${i}2 ${i}3 ${i}4 ${i}5 ${i}6 ${i}7 ${i}8 < /dev/null tee ${i}9 ${i}a ${i}b ${i}c ${i}d ${i}e ${i}f ${i}0 < /dev/null done echo removing dummy files... for i in 1 2 3 4 5 6 7 8 9 0 a b c d e f do rm ${i}1 ${i}2 ${i}3 ${i}4 ${i}5 ${i}6 ${i}7 ${i}8 rm ${i}9 ${i}a ${i}b ${i}c ${i}d ${i}e ${i}f ${i}0 done cd .. echo done ls -ld `pwd`/lost+found ȍ< /\@,\D"cmd/ucbmail/ 775 0 33 0 2552572226 6136 cmd/ucbmail/40.local.c 644 0 33 3023 2400701676 7672 # /* * Mail -- a mail program * * Ingres 11/70. Unix version 6.0 * * Local routines that are installation dependent. * All fiddlers please note: if you make careful note of * what you change here, I will incorporate your changes and * you won't have to remake them each release. */ #include "rcv.h" /* * Locate the user's mailbox file (ie, the place where new, unread * mail is queued). On the 11/40, it is in /usr/mail/name */ findmail() { register char *cp; cp = copy("/usr/mail/", mailname); copy(myname, cp); } /* * Get rid of the queued mail. */ demail() { close(creat(mailname, 0644)); alter(mailname); } /* * Get an environment variable. At present, we only support * "SHELL" and "HOME". This routine makes use of the getpw * routine in the neighboring getname.c stuff. */ char * getenv(name) char name[]; { char pwline[LINESIZE]; static char val[30]; register char *cp, *dp; register int cc; if (equal(name, "SHELL")) cc = 6; else if (equal(name, "HOME")) cc = 5; else return(NOSTR); if (getpw(uid, pwline) < 0) return(NOSTR); for (cp = pwline; *cp && cc > 0;) if (*cp++ == ':') cc--; dp = cp; while (*cp != ':' && *cp != '\0') cp++; *cp = '\0'; if (*dp == '\0') return(NOSTR); copy(dp, val); return(val); } /* * Lock and unlock retrofits which are only * significant in version 7. */ lock(name) char *name; { return(0); } unlock() { return(0); } /* * discover user's login name. */ username(uid, namebuf) char namebuf[]; { return(getname(uid, namebuf)); } ; if (getpw(uid, pwline) < 0) return(NOSTR); for (cp = pwline; *cp && cc > 0;) if (*cp++ == ':') cc--; dp = cp; while (*cp != ':' && *cp != '\0') cp++; *cp = '\0'; if (*dp == '\0') return(NOSTR); copy(dp, val); return(val); } /* * Lock and unlock retrofits which are only * significant in version 7. */ lock(name) char *name; { return(0); } unlock() { return(0); } /* * discover user's login name. */ username(uid, namebuf) char namebuf[]; { return(getnamecmd/ucbmail/40.local.h 644 0 33 1174 2400701676 7704 /* * Declarations and constants specific to an installation. * EECS/ERL 11/40 Unix */ #define LOCAL 'z' /* Local machine id */ #define MAIL "/usr/bin/mail" /* Name of mail sender */ #define EDITOR "/usr/bin/ex" /* Name of text editor */ #define VISUAL "/usr/bin/vi" /* Name of display editor */ #define HELPFILE "/usr/lib/Mail.help" /* Name of casual help file */ #define THELPFILE "/usr/lib/Mail.help.~" /* Name of casual tilde help */ #define UIDMASK 0377 /* Significant uid bits */ #define MASTER "/usr/lib/Mail.rc" #define stat _stat /* Simulate version 7 */ #define fstat _fstat /* Simulate version 7 */ ine id */ #define MAIL "/usr/bin/mail" /* Name of mail sender */ #define EDITOR "/usr/bin/ex" /* Name of text editor */ #define VISUAL "/usr/bin/vi" /* Name of display editor */ #define HELPFILE "/usr/lib/Mail.help" /* Name of casual help file */ #define THELPFILE "/usr/lib/Mail.help.~" /* Name of casual tilde help */ #define UIDMASK 0377 /* Significant uid bits */ #deficmd/ucbmail/:rofix 644 0 33 35 2400701676 7316 g/^[ ]*\.data/s//.text/ w q #define stat _stat /* Simulate version 7 */ #define fstat _fstat /* Simulate version 7 */ ine id */ #define MAIL "/usr/bin/mail" /* Name of mail sender */ #define EDITOR "/usr/bin/ex" /* Name of text editor */ #define VISUAL "/usr/bin/vi" /* Name of display editor */ #define HELPFILE "/usr/lib/Mail.help" /* Name of casual help file */ #define THELPFILE "/usr/lib/Mail.help.~" /,5x< /,"cmd/ucbmail/:versfix 644 0 33 430 2400701676 7674 s/....// s/..............\(....\)$/, \1/ g/ /s// / g/Jan/s//January/ g/Feb/s//February/ g/Mar/s//March/ g/Apr/s//April/ g/May/s//May/ g/Jun/s//June/ g/Aug/s//August/ g/Sep/s//September/ g/Oct/s//October/ g/Nov/s//November/ g/Dec/s//December/ 1s/.*/char *version = "&";/ 1,$p w q ame of display editor */ #define HELPFILE "/usr/lib/Mail.help" /* Name of casual help file */ #define THELPFILE "/usr/lib/Mail.help.~" /,5< /,"((cmd/ucbmail/Mail.help 644 0 33 1575 2400701702 7746 Mail Commands t type messages n goto and type next message e edit messages f give head lines of messages d delete messages s file append messages to file u undelete messages r reply to messages pre make messages go back to /usr/mail m mail to specific users q quit, saving unresolved messages in mbox x quit, do not remove system mailbox h print out active message headers ! shell escape c [directory] chdir to directory or home if none given A consists of integers, ranges of same, or user names separated by spaces. If omitted, Mail uses the last message typed. A consists of user names or distribution names separated by spaces. Distribution names are defined in .sendrc in your home directory. t> mail to specific users q quit, saving unresolved messages in mbox x quit, do not remove system mailbox h print out accmd/ucbmail/Mail.help.~ 644 0 33 1220 2400701702 10205 ----------------------------------------------------------- The following ~ escapes are defined: ~~ Quote a single tilde ~c users Add users to cc list ~d Read in dead.letter ~e Edit the message buffer ~h Prompt for to list, subject and cc list ~r file Read a file into the message buffer ~p Print the message buffer ~m messages Read in messages, right shifted by a tab ~s subject Set subject ~t users Add users to to list ~v Invoke display editor on message ~w file Write message onto file. ~? Print this message ~!command Invoke the shell ~|command Pipe the message through the command ----------------------------------------------------------- cc list ~d Read in dead.letter ~e Edit the message buffer ~h Prompt for to list, subject and cc list ~r file Read a file into the message buffer ~p Print the message buffer ~m messages Read in messages, right shifted by a tab ~s subject Set subject ~t users Add users to to list ~v Invoke display editor on message ~w file Write message onto file. ~? Print thicmd/ucbmail/Signal.c 644 0 33 1045 2400701702 7563 # #include /* * The following is for systems with botched signal() system entries * which don't return the proper value for the previous signal. */ int oldsigs[17]; int (*Signal())(sig, spot) int spot; { int ret; /* printf("Signal(%d, %.1o)\n", sig, spot); */ if (sig < 1 || sig > 16) return(-1); ret = oldsigs[sig]; oldsigs[sig] = (int) spot; signal(sig, spot); return(ret); } Siginit() { register int i; for (i = 1; i < 17; i++) { oldsigs[i] = (int) signal(i, SIG_IGN); signal(i, (int (*)()) oldsigs[i]); } } lowing is for systems with botched signal() system entries * which don't return the proper value for the previous signal. */ int oldsigs[17]; int (*Signal())(sig, spot) int spot; { int ret; /* printf("Signal(%d, %.1o)\n", sig, spot); */ if (sig < 1 || sig > 16) return(-1); ret = oldsigs[sig]; oldsigs[sig] = (int) spot; signal(sig, spot); return(ret); } Siginit() { register int i; for (i = 1; i < 17; i++) { oldsigs[i] = (int) signal(i, SIG_IGN); sigcmd/ucbmail/aux.c 644 0 33 23676 2526621627 7221 # #include "rcv.h" #include #include #include /* * Mail -- a mail program * * Auxiliary functions. */ /* * Return a pointer to a dynamic copy of the argument. */ char * savestr(str) char *str; { register char *cp, *cp2, *top; for (cp = str; *cp; cp++) ; top = salloc(cp-str + 1); if (top == NOSTR) return(NOSTR); for (cp = str, cp2 = top; *cp; cp++) *cp2++ = *cp; *cp2 = 0; return(top); } /* * Copy the name from the passed header line into the passed * name buffer. Null pad the name buffer. */ copyname(linebuf, nbuf) char *linebuf, *nbuf; { register char *cp, *cp2; for (cp = linebuf + 5, cp2 = nbuf; *cp != ' ' && cp2-nbuf < 8; cp++) *cp2++ = *cp; while (cp2-nbuf < 8) *cp2++ = 0; } /* * Announce a fatal error and die. */ panic(str) char *str; { prs("panic: "); prs(str); prs("\n"); exit(1); } /* * Catch stdio errors and report them more nicely. */ _error(str) char *str; { prs("Stdio Error: "); prs(str); prs("\n"); abort(); } /* * Print a string on diagnostic output. */ prs(str) char *str; { register char *s; for (s = str; *s; s++) ; write(2, str, s-str); } /* * Touch the named message by setting its MTOUCH flag. * Touched messages have the effect of not being sent * back to the system mailbox on exit. */ touch(mesg) { if (mesg >= 1 && mesg <= msgCount) message[mesg-1].m_flag |= MTOUCH; } /* * Test to see if the passed file name is a directory. * Return true if it is. */ isdir(name) char name[]; { struct stat sbuf; if (stat(name, &sbuf) < 0) return(0); return((sbuf.st_mode & S_IFMT) == S_IFDIR); } /* * Compute the size in characters of the passed message */ unsigned int msize(messp) struct message *messp; { register struct message *mp; mp = messp; return(mp->m_size); } /* * Count the number of arguments in the given string raw list. */ argcount(argv) char **argv; { register char **ap; for (ap = argv; *ap != NOSTR; ap++) ; return(ap-argv); } /* * Given a file address, determine the * block number it represents. */ blockof(off) off_t off; { off_t a; a = off >> 9; a &= 077777; return((int) a); } /* * Take a file address, and determine * its offset in the current block. */ offsetof(off) off_t off; { off_t a; a = off & 0777; return((int) a); } /* * Determine if the passed file is actually a tty, via a call to * gtty. This is not totally reliable, but . . . */ isatty(f) { struct sgttyb buf; if (gtty(f, &buf) < 0) return(0); return(1); } /* * Return the desired header line from the passed message * pointer (or NOSTR if the desired header field is not available). */ char * hfield(field, mp) char field[]; struct message *mp; { register FILE *ibuf; char linebuf[LINESIZE]; register int lc; ibuf = setinput(mp); if ((lc = mp->m_lines) <= 0) return(NOSTR); if (readline(ibuf, linebuf) < 0) return(NOSTR); lc--; do { lc = gethfield(ibuf, linebuf, lc); if (lc == -1) return(NOSTR); if (ishfield(linebuf, field)) return(savestr(hcontents(linebuf))); } while (lc > 0); return(NOSTR); } /* * Return the next header field found in the given message. * Return > 0 if something found, <= 0 elsewise. * Must deal with \ continuations & other such fraud. */ gethfield(f, linebuf, rem) register FILE *f; char linebuf[]; register int rem; { char line2[LINESIZE]; long loc; register char *cp, *cp2; register int c; for (;;) { if (rem <= 0) return(-1); if (readline(f, linebuf) < 0) return(-1); rem--; if (strlen(linebuf) == 0) return(-1); if (isspace(linebuf[0])) continue; if (linebuf[0] == '>') continue; cp = index(linebuf, ':'); if (cp == NOSTR) continue; for (cp2 = linebuf; cp2 < cp; cp2++) if (isdigit(*cp2)) continue; /* * I guess we got a headline. * Handle wraparounding */ for (;;) { if (rem <= 0) break; #ifdef CANTELL loc = ftell(f); if (readline(f, line2) < 0) break; rem--; if (!isspace(line2[0])) { fseek(f, loc, 0); rem++; break; } #else c = getc(f); ungetc(c, f); if (!isspace(c) || c == '\n') break; if (readline(f, line2) < 0) break; rem--; #endif cp2 = line2; for (cp2 = line2; *cp2 != 0 && isspace(*cp2); cp2++) ; if (strlen(linebuf) + strlen(cp2) >= LINESIZE-2) break; cp = &linebuf[strlen(linebuf)]; while (cp > linebuf && (isspace(cp[-1]) || cp[-1] == '\\')) cp--; *cp++ = ' '; for (cp2 = line2; *cp2 != 0 && isspace(*cp2); cp2++) ; strcpy(cp, cp2); } if ((c = strlen(linebuf)) > 0) { cp = &linebuf[c-1]; while (cp > linebuf && isspace(*cp)) cp--; *++cp = 0; } return(rem); } /* NOTREACHED */ } /* * Check whether the passed line is a header line of * the desired breed. */ ishfield(linebuf, field) char linebuf[], field[]; { register char *cp; register int c; if ((cp = index(linebuf, ':')) == NOSTR) return(0); if (cp == linebuf) return(0); cp--; while (cp > linebuf && isspace(*cp)) cp--; c = *++cp; *cp = 0; if (icequal(linebuf ,field(()) { *cp = c; return(1); } *cp = c; return(0); } /* * Extract the non label information from the given header field * and return it. */ char * hcontents(hfield) char hfield[]; { register char *cp; if ((cp = index(hfield, ':')) == NOSTR) return(NOSTR); cp++; while (*cp && isspace(*cp)) cp++; return(cp); } /* * Compare two strings, ignoring case. */ icequal(s1, s2) register char *s1, *s2; { while (raise(*s1++) == raise(*s2)) if (*s2++ == 0) return(1); return(0); } /* * The following code deals with input stacking to do source * commands. All but the current file pointer are saved on * the stack. */ static int ssp = -1; /* Top of file stack */ static FILE *sstack[_NFILE]; /* Saved input files */ /* * Pushdown current input file and switch to a new one. * Set the global flag "sourcing" so that others will realize * that they are no longer reading from a tty (in all probability). */ source(name) char name[]; { register FILE *fi; if ((fi = fopen(name, "r")) == NULL) { perror(name); return(1); } if (ssp >= _NFILE-2) { printf("Too much \"sourcing\" going on.\n"); fclose(fi); return(1); } sstack[++ssp] = input; input = fi; sourcing++; return(0); } /* * Source a file, but do nothing if the file cannot be opened. */ source1(name) char name[]; { register int f; if ((f = open(name, 0)) < 0) return(0); close(f); source(name); } /* * Pop the current input back to the previous level. * Update the "sourcing" flag as appropriate. */ unstack() { if (ssp < 0) { printf("\"Source\" stack over-pop.\n"); sourcing = 0; return(1); } fclose(input); input = sstack[ssp--]; if (ssp < 0) sourcing = 0; return(0); } /* * Touch the indicated file. * This is nifty for the shell. * If we have the utime() system call, this is better served * by using that, since it will work for empty files. * On non-utime systems, we must sleep a second, then read. */ alter(name) char name[]; { #ifdef UTIME struct stat statb; long time(); time_t time_p[2]; #else register int pid, f; char w; #endif UTIME #ifdef UTIME if (stat(name, &statb) < 0) return; time_p[0] = time((long *) 0) + 1; time_p[1] = statb.st_mtime; utime(name, time_p); #else if ((pid = fork()) != 0) return; clrbuf(stdout); clrbuf(stderr); clrbuf(stdin); sleep(1); if ((f = open(name, 0)) < 0) exit(1); read(f, &w, 1); exit(0); #endif } /* * Examine the passed line buffer and * return true if it is all blanks and tabs. */ blankline(linebuf) char linebuf[]; { register char *cp; for (cp = linebuf; *cp; cp++) if (!any(*cp, " \t")) return(0); return(1); } /* * Fetch the sender's name from the passed message. */ char * nameof(mp) register struct message *mp; { char namebuf[LINESIZE]; char linebuf[LINESIZE]; register char *cp, *cp2; register FILE *ibuf; int first = 1; if ((cp = hfield("reply-to", mp)) != NOSTR) { strcpy(namebuf, cp); return(savestr(namebuf)); } ibuf = setinput(mp); copy("", namebuf); if (readline(ibuf, linebuf) <= 0) return(savestr(namebuf)); newname: for (cp = linebuf; *cp != ' '; cp++) ; while (any(*cp, " \t")) cp++; for (cp2 = &namebuf[strlen(namebuf)]; *cp && !any(*cp, " \t") && cp2-namebuf < LINESIZE-1; *cp2++ = *cp++) ; *cp2 = '\0'; if (readline(ibuf, linebuf) <= 0) return(savestr(namebuf)); if ((cp = index(linebuf, 'F')) == NULL) return(savestr(namebuf)); if (strncmp(cp, "From", 4) != 0) return(savestr(namebuf)); while ((cp = index(cp, 'r')) != NULL) { if (strncmp(cp, "remote", 6) == 0) { if ((cp = index(cp, 'f')) == NULL) break; if (strncmp(cp, "from", 4) != 0) break; if ((cp = index(cp, ' ')) == NULL) break; cp++; if (first) { copy(cp, namebuf); first = 0; } else strcpy(rindex(namebuf, '!')+1, cp); strcat(namebuf, "!"); goto newname; } cp++; } return(savestr(namebuf)); } /* * Find the rightmost pointer to an instance of the * character in the string and return it. */ char * rindex(str, c) char str[]; register int c; { register char *cp, *cp2; for (cp = str, cp2 = NOSTR; *cp; cp++) if (c == *cp) cp2 = cp; return(cp2); } /* * See if the string is a number. */ numeric(str) char str[]; { register char *cp = str; while (*cp) if (!isdigit(*cp++)) return(0); return(1); } /* * Are any of the characters in the two strings the same? */ anyof(s1, s2) register char *s1, *s2; { register int c; while (c = *s1++) if (any(c, s2)) return(1); return(0); } /* * Determine the leftmost index of the character * in the string. */ char * index(str, ch) char *str; { register char *cp; register int c; for (c = ch, cp = str; *cp; cp++) if (*cp == c) return(cp); return(NOSTR); } /* * String compare two strings of bounded length. */ strncmp(as1, as2, an) char *as1, *as2; { register char *s1, *s2; register int n; s1 = as1; s2 = as2; n = an; while (--n >= 0 && *s1 == *s2++) if (*s1++ == '\0') return(0); return(n<0 ? 0 : *s1 - *--s2); } /* * Determine the leftmost index of the character * in the strcmd/ucbmail/c.local.c 644 0 33 3126 2403014651 7666 # /* * Mail -- a mail program * * EECS Cory 11/70 Version 7.0 * * Local routines that are installation dependent. * All fiddlers please note: if you make careful note of * what you change here, I will incorporate your changes and * you won't have to remake them each release. */ #include "rcv.h" #include /* * Locate the user's mailbox file (ie, the place where new, unread * mail is queued). At Cory, it is in /usr/spool/mail/name. */ findmail() { register char *cp; cp = copy("/usr/spool/mail/", mailname); copy(myname, cp); } /* * Get rid of the queued mail. */ demail() { register int p; close(creat(mailname, 0666)); alter(mailname); } /* * Mail file lock / unlock. * Insignificant on Cory version 7, since /usr/spool/mail not * generally writable. */ lock(name) char *name; { return(0); } unlock() { return(0); } /* * Discover user login name. */ username(uid, namebuf) char namebuf[]; { register char *np; if (uid == getuid() && (np = getenv("USER")) != NOSTR) { strncpy(namebuf, np, 9); return(0); } return(getname(uid, namebuf)); } /* * Discover user name from uid. Uses the fancy hashed passwd * data base available only on Cory Unix. */ getname(uid, namebuf) char namebuf[]; { struct passwd *gp; struct passwd *getpwuid(); gp = getpwuid(uid); if (gp == (struct passwd *) 0) return(-1); strcpy(namebuf, gp->pw_name); return(0); } /* * Cory hall getuserid */ getuserid(name) char name[]; { struct passwd *gp; struct passwd *getpwnam(); if ((gp = getpwnam(name)) == (struct passwd *) 0) return(-1); return(gp->pw_uid); } * Discover user name from uid. Uses the fancy hashed passwd * data base available only on Cory Unix. */ getname(uid, namebuf) char namebuf[]; { struct passwd *gp; struct passwd *getpwuid(); gp = getpwuid(uid); if (gp == (struct passwd *) 0) return(-1); strcpy(namebuf, gp->pw_name); return(0); } /* * Cory hall getuserid */ getuserid(name) char name[]; { struct passwd *gp; struct passwd *getpwnam(); icmd/ucbmail/c.local.h 644 0 33 1442 2403015075 7673 /* * Declarations and constants specific to an installation. * UCB 11/70 Version 7.0 */ #define APPEND /* New mail to end of mail box */ #define LOCAL 'y' /* Local machine id */ #define MAIL "/bin/mail" /* Name of mail sender */ #define DELIVERMAIL "/etc/delivermail" /* Name of snazzy mail deliverer */ #define VISUAL "/usr/ucb/bin/vi" /* Name of display editor */ #define EDITOR "/usr/ucb/bin/ex" /* Name of text editor */ #define SHELL "/bin/csh" /* Default shell interpreter */ #define HELPFILE "/usr/ucb/lib/Mail.help" /* Name of casual help file */ #define THELPFILE "/usr/ucb/lib/Mail.help.~" /* Name of casual tilde help */ #define UIDMASK 0177777 /* Significant uid bits */ #define MASTER "/usr/ucb/lib/Mail.rc" #define UTIME /* System implement utime(2) */ e of snazzy mail deliverer */ #define VISUAL "/usr/ucb/bin/vi" /* Name of display editor */ #define EDITOR "/usr/ucb/bin/ex" /* Name of text editor */ #define SHELL "/bin/csh" /* Default shell interpreter */ #define HELcmd/ucbmail/cc.local.c 644 0 33 3425 2400701706 10034 # /* * Mail -- a mail program * * Computer Center Unix * * Local routines that are installation dependent. */ #include "rcv.h" /* * Locate the user's mailbox file (ie, the place where new, unread * mail is queued). At Computer Center, it is in /usr/mail/name. */ findmail() { register char *cp; cp = copy("/usr/mail/", mailname); copy(myname, cp); } /* * Get rid of the queued mail. * This is essentially "mail -n > /dev/null &" */ demail() { register int p; if (uid == 0) { remove(ma((ilname); return; } if ((p = fork()) != 0) return; for (p = 0; p < 15; p++) close(p); open("/dev/null", 2); dup(0); dup(0); for (p = SIGHUP; p <= SIGQUIT; p++) signal(p, SIG_IGN); execl(MAIL, "mail", "-n", 0); perror(MAIL); exit(1); } /* * Get the value of an environment variable. */ char * getenv(name) char name[]; { register int t; static char val[30]; t = ttyn(2); hget(t); if (equal(name, "SHELL")) return("/bin/csh"); if (!equal(name, "HOME")) return(NOSTR); copy(hgethome(), val); return(val); } /* * Mail file lock / unlock. * Not implemented in this version. */ lock(name) char name[]; { return(0); } unlock() { return(0); } /* * Discover user login name. */ username(uid, namebuf) char namebuf[]; { return(getname(uid, namebuf)); } /* * Unix routine to do an "fopen" on file descriptor * The mode has to be repeated because you can't query its * status */ FILE * fdopen(fd, mode) register char *mode; { extern int errno; register FILE *iop; extern FILE *_lastbuf; for (iop = _iob; iop->_flag&(_IOREAD|_IOWRT); iop++) if (iop >= _lastbuf) return(NULL); iop->_cnt = 0; iop->_file = fd; if (*mode != 'r') { iop->_flag |= _IOWRT; if (*mode == 'a') lseek(fd, 0L, 2); } else iop->_flag |= _IOREAD; return(iop); } f)); } /* * Unix routine to do an "fopen" on file descriptor * The mode has to be repeated because you can't query its * status */ FILE * fdopen(fd, mode) register char *mode; { extern int errno; register FILE *iop; extern FILcmd/ucbmail/cc.local.h 644 0 33 1533 2400701706 10037 /* * Declarations and constants specific to an installation. * Computer Center Unix A * * Note to fiddlers: please, please, PLEASE note all changes * that you make here so that I can keep an up to date version. */ #define LOCAL 'a' /* Local machine id */ #define MAIL "/bin/mail" /* Name of mail sender */ #define UIDGID /* Names and uids like cory */ #define EDITOR "/usr/bin/ex" /* Name of text editor */ #define VISUAL "/usr/new/vi" /* Name of display editor */ #define SHELL "/bin/csh" /* Default shell */ #define HELPFILE "/usr/lib/Mail.help" /* Name of casual help file */ #define THELPFILE "/usr/lib/Mail.help.~" /* Name of casual tilde help */ #define UIDMASK 0377 /* Significant uid bits */ #define MASTER "/usr/lib/Mail.rc" #define stat _stat /* Simulate version 7 */ #define fstat _fstat /* Simulate version 7 */ d uids like cory */ #define EDITOR "/usr/bin/ex" /* Name of text editor */ #define VISUAL "/usr/new/vi" /* Name of display editor */ #define SHELL "/bin/csh" /* Dcmd/ucbmail/cmd1.c 644 0 33 11342 2400702647 7224 # #include "rcv.h" #include /* * Mail -- a mail program * * User commands. */ /* * Print the current active headings. */ static int screen; headers(msgvec) int *msgvec; { register int n, mesg, flag; register struct message *mp; n = msgvec[0]; if (n != 0) screen = (n-1)/SCREEN; if (screen < 0) screen = 0; mp = &message[screen * SCREEN]; if (mp >= &message[msgCount]) mp = &message[msgCount - SCREEN]; if (mp < &message[0]) mp = &message[0]; flag = 0; mesg = mp - &message[0]; dot = mp; for (; mp < &message[msgCount]; mp++) { mesg++; if (mp->m_flag & MDELETED) continue; if (flag++ >= SCREEN) break; printhead(mesg); sreset(); } if (flag == 0) { printf("No more mail.\n"); return(1); } return(0); } /* * Scroll to the next/previous screen */ scroll(arg) char arg[]; { register int s; int cur[1]; cur[0] = 0; s = screen; switch (*arg) { case 0: case '+': s++; if (s*SCREEN > msgCount) { printf("On last screenful of messages\n"); return(0); } screen = s; break; case '-': if (--s < 0) { printf("On first screenful of messages\n"); return(0); } screen = s; break; default: printf("Unrecognized scrolling command \"%s\"\n", arg); return(1); } return(headers(cur)); } /* * Print out the headlines for each message * in the passed message list. */ from(msgvec) int *msgvec; { register int *ip; for (ip = msgvec; *ip != NULL; ip++) { printhead(*ip); sreset(); } if (--ip >= msgvec) dot = &message[*ip - 1]; return(0); } /* * Print out the header of a specific message. * This is a slight improvement to the standard one. */ printhead(mesg) { struct message *mp; FILE *ibuf; char headline[LINESIZE], wcount[10], *subjline, dispc; char pbuf[BUFSIZ]; int s; struct headline hl; register char *cp; mp = &message[mesg-1]; ibuf = setinput(mp); readline(ibuf, headline); subjline = hfield("subject", mp); if (subjline == NOSTR) subjline = hfield("subj", mp); /* * Bletch! */ if (subjline != NOSTR && strlen(subjline) > 28) subjline[29] = '\0'; dispc = ' '; if (mp->m_flag & MSAVED) dispc = '*'; if (mp->m_flag & MPRESERVE) dispc = 'P'; parse(headline, &hl, pbuf); sprintf(wcount, " %d/%d", mp->m_lines, mp->m_size); s = strlen(wcount); cp = wcount + s; while (s < 7) s++, *cp++ = ' '; *cp = '\0'; if (subjline != NOSTR) printf("%c%3d %-8s %16.16s %s \"%s\"\n", dispc, mesg, nameof(mp), hl.l_date, wcount, subjline); else printf("%c%3d %-8s %16.16s %s\n", dispc, mesg, nameof(mp), hl.l_date, wcount); } /* * Print out the value of dot. */ pdot() { printf("%d\n", dot - &message[0] + 1); return(0); } /* * Print out all the possible commands. */ pcmdlist() { register struct cmd *cp; register int cc; extern struct cmd cmdtab[]; printf("Commands are:\n"); for (cc = 0, cp = cmdtab; cp->c_name != NULL; cp++) { cc += strlen(cp->c_name) + 2; if (cc > 72) { printf("\n"); cc = strlen(cp->c_name) + 2; } if ((cp+1)->c_name != NOSTR) printf("%s, ", cp->c_name); else printf("%s\n", cp->c_name); } return(0); } /* * Type out the messages requested. */ type(msgvec) int *msgvec; { register *ip; register struct message *mp; register int mesg; int c; FILE *ibuf; for (ip = msgvec; *ip && ip-msgvec < msgCount; ip++) { mesg = *ip; touch(mesg); mp = &message[mesg-1]; dot = mp; print(mp); } return(0); } /* * Print the indicated message on standard output. */ print(mp) register struct message *mp; { if (value("quiet") == NOSTR) printf("Message %2d:\n", mp - &message[0] + 1); touch(mp - &message[0] + 1); send(mp, stdout); } /* * Print the top so many lines of each desired message. * The number of lines is taken from the variable "toplines" * and defaults to 5. */ top(msgvec) int *msgvec; { register int *ip; register struct message *mp; register int mesg; int c, topl, lines, lineb; char *valtop, linebuf[LINESIZE]; FILE *ibuf; topl = 5; valtop = value("toplines"); if (valtop != NOSTR) { topl = atoi(valtop); if (topl < 0 || topl > 10000) topl = 5; } lineb = 1; for (ip = msgvec; *ip && ip-msgvec < msgCount; ip++) { mesg = *ip; touch(mesg); mp = &message[mesg-1]; dot = mp; if (value("quiet") == NOSTR) printf("Message %2d:\n", mesg); ibuf = setinput(mp); c = mp->m_lines; if (!lineb) printf("\n"); for (lines = 0; lines < c && lines <= topl; lines++) { if (readline(ibuf, linebuf) <= 0) break; puts(linebuf); lineb = blankline(linebuf); } } return(0); } /* * Touch all the given messages so that they will * get mboxed. */ stouch(msgvec) int msgvec[]; { register int *ip; for (ip = msgvec; *ip != 0; ip++) { touch(*ip); dot = &message[*ip-1]; dot->m_flag &= ~MPRESERVE; } return(0); } %2d:\n", mesg); ibuf = setinput(mp); c = mp->m_lines; if (!lineb) printf("\n"); for (lines = 0; lines < c && lines <= topl; lines++) { if (readline(ibuf, linebuf) <= 0) break; puts(linebuf); lineb = blankline(linebuf); } } return(0); } /* * Touch all the gcmd/ucbmail/cmd2.c 644 0 33 14627 2400701712 7226 # #include "rcv.h" #include /* * Mail -- a mail program * * More user commands. */ /* * If any arguments were given, go to the next applicable argument * following dot, otherwise, go to the next applicable message. * If given as first command with no arguments, print first message. */ next(msgvec) int *msgvec; { register struct message *mp; register int *ip, *ip2; int list[2], mdot; if (*msgvec != NULL) { /* * If some messages were supplied, find the * first applicable one following dot using * wrap around. */ mdot = dot - &message[0] + 1; for (ip = msgvec; *ip != NULL; ip++) if (*ip > mdot) break; if (*ip == NULL) ip = msgvec; ip2 = ip; do { if (*ip2 != NULL) ip2++; if (*ip2 == NULL) ip2 = msgvec; mp = &message[*ip2 - 1]; if ((mp->m_flag & MDELETED) == 0) { dot = mp; goto hitit; } } while (ip2 != ip); printf("No messages applicable\n"); return(1); } /* * If this is the first command, select message 1((. * Note that this must exist for us to get here at all. */ if (!sawcom) { dot = &message[0]; goto hitit; } /* * Just find the next good message after dot, no * wraparound. */ for (mp = dot+1; mp < &message[msgCount]; mp++) if ((mp->m_flag & (MDELETED|MSAVED)) == 0) break; if (mp >= &message[msgCount]) { printf("At EOF\n"); return(0); } dot = mp; hitit: /* * Print dot. */ list[0] = dot - &message[0] + 1; list[1] = NULL; return(type(list)); } /* * Save the indicated messages at the end of the passed file name. */ save(str) char str[]; { register int *ip, mesg; register struct message *mp; char *file, *disp; int f, *msgvec, lc, cc, t; FILE *obuf; struct stat statb; msgvec = (int *) salloc((msgCount + 2) * sizeof *msgvec); if ((file = snarf(str, &f)) == NOSTR) return(1); if (!f) { *msgvec = first(0, MMNORM); if (*msgvec == NULL) { printf("No messages to save.\n"); return(1); } msgvec[1] = NULL; } if (f && getmsglist(str, msgvec, 0) < 0) return(1); if ((file = expand(file)) == NOSTR) return(1); printf("\"%s\" ", file); flush(); if (stat(file, &statb) >= 0) disp = "[Appended]"; else disp = "[New file]"; if ((obuf = fopen(file, "a")) == NULL) { perror(NOSTR); return(1); } cc = lc = 0; for (ip = msgvec; *ip && ip-msgvec < msgCount; ip++) { mesg = *ip; touch(mesg); mp = &message[mesg-1]; if ((t = send(mp, obuf)) < 0) { perror(file); fclose(obuf); return(1); } lc += t; cc += msize(mp); mp->m_flag |= MSAVED; } fflush(obuf); if (ferror(obuf)) perror(file); fclose(obuf); printf("%s %d/%d\n", disp, lc, cc); return(0); } /* * Write the indicated messages at the end of the passed * file name, minus header and trailing blank line. */ swrite(str) char str[]; { register int *ip, mesg; register struct message *mp; register char *file, *disp; char linebuf[BUFSIZ]; int f, *msgvec, lc, cc, t; FILE *obuf, *mesf; struct stat statb; msgvec = (int *) salloc((msgCount + 2) * sizeof *msgvec); if ((file = snarf(str, &f)) == NOSTR) return(1); if ((file = expand(file)) == NOSTR) return(1); if (!f) { *msgvec = first(0, MMNORM); if (*msgvec == NULL) { printf("No messages to write.\n"); return(1); } msgvec[1] = NULL; } if (f && getmsglist(str, msgvec, 0) < 0) return(1); printf("\"%s\" ", file); flush(); if (stat(file, &statb) >= 0) disp = "[Appended]"; else disp = "[New file]"; if ((obuf = fopen(file, "a")) == NULL) { perror(NOSTR); return(1); } cc = lc = 0; for (ip = msgvec; *ip && ip-msgvec < msgCount; ip++) { mesg = *ip; touch(mesg); mp = &message[mesg-1]; mesf = setinput(mp); t = mp->m_lines - 2; readline(mesf, linebuf); while (t-- > 0) { fgets(linebuf, BUFSIZ, mesf); fputs(linebuf, obuf); cc += strlen(linebuf); } lc += mp->m_lines - 2; mp->m_flag |= MSAVED; } fflush(obuf); if (ferror(obuf)) perror(file); fclose(obuf); printf("%s %d/%d\n", disp, lc, cc); return(0); } /* * Snarf the file from the end of the command line and * return a pointer to it. If there is no file attached, * just return NOSTR. Put a null in front of the file * name so that the message list processing won't see it, * unless the file name is the only thing on the line, in * which case, return 0 in the reference flag variable. */ char * snarf(linebuf, flag) char linebuf[]; int *flag; { register char *cp; *flag = 1; cp = strlen(linebuf) + linebuf - 1; /* * Strip away trailing blanks. */ while (*cp == ' ' && cp > linebuf) cp--; *++cp = 0; /* * Now search for the beginning of the file name. */ while (cp > linebuf && !any(*cp, "\t ")) cp--; if (*cp == '\0') { printf("No file specified.\n"); return(NOSTR); } if (any(*cp, " \t")) *cp++ = 0; else *flag = 0; return(cp); } /* * Delete messages. */ delete(msgvec) int msgvec[]; { return(delm(msgvec)); } /* * Delete messages, then type the new dot. */ deltype(msgvec) int msgvec[]; { int list[2]; if (delm(msgvec) >= 0) { list[0] = dot - &message[0]; list[0]++; touch(list[0]); list[1] = NULL; return(type(list)); } else { printf("No more messages\n"); return(0); } } /* * Delete the indicated messages. * Set dot to some nice place afterwards. * Internal interface. */ delm(msgvec) int *msgvec; { register struct message *mp; register *ip, mesg; int last; last = NULL; for (ip = msgvec; *ip != NULL; ip++) { mesg = *ip; touch(mesg); mp = &message[mesg-1]; mp->m_flag |= MDELETED; mp->m_flag &= ~(MPRESERVE|MSAVED); last = mesg; } if (last != NULL) { dot = &message[last-1]; last = first(0, MDELETED); if (last != NULL) { dot = &message[last-1]; return(0); } else { dot = &message[0]; return(-1); } } /* * Following can't happen -- it keeps lint happy */ return(-1); } /* * Undelete the indicated messages. */ undelete(msgvec) int *msgvec; { register struct message *mp; register *ip, mesg; for (ip = msgvec; ip-msgvec < msgCount; ip++) { mesg = *ip; if (mesg == 0) return; touch(mesg); mp = &message[mesg-1]; dot = mp; mp->m_flag &= ~MDELETED; } } /* * Interactively dump core on "core" */ core() { register int pid; int status; if ((pid = vfork()) == -1) { perror("fork"); return(1); } if (pid == 0) { abort(); _exit(1); } printf("Okie dokie"); fflush(stdout); while (wait(&status) != pid) ; if (status & 0200) printf(" -- Core dumped\n"); else printf("\n"); } p = msgvec; ip-msgvec < msgCount; ip++) { mesg = *ip; if (mesg == 0) return; touch(mesg); mp =cmd/ucbmail/cmd3.c 644 0 33 20357 2400701714 7226 # #include "rcv.h" #include /* * Mail -- a mail program * * Still more user commands. */ /* * Process a shell escape by saving signals, ignoring signals, * and forking a sh -c */ shell(str) char *str; { int (*sig[2])(), stat[1]; register int t; char *Shell; if ((Shell = value("SHELL")) == NOSTR) Shell = SHELL; for (t = 2; t < 4; t++) sig[t-2] = signal(t, SIG_IGN); t = vfork(); if (t == 0) { for (t = 2; t < 4; t++) if (sig[t-2] != SIG_IGN) signal(t, SIG_DFL); execl(Shell, Shell, "-c", str, 0); perror(Shell); _exit(1); } while (wait(stat) != t) ; if (t == -1) perror("fork"); for (t = 2; t < 4; t++) signal(t, sig[t-2]); printf("!\n"); return(0); } /* * Fork an interactive shell. */ dosh(str) char *str; { int (*sig[2])(), stat[1]; register int t; char *Shell; if ((Shell = value("SHELL")) == NOSTR) Shell = SHELL; for (t = 2; t < 4; t++) sig[t-2] = signal(t, SIG_IGN); t = vfork(); if (t == 0) { for (t = 2; t < 4; t++) if (sig[t-2] != SIG_IGN) signal(t, SIG_DFL); execl(Shell, Shell, 0); perror(Shell); _exit(1); } while (wait(stat) != t) ; if (t == -1) perror("fork"); for (t = 2; t < 4; t++) signal(t, sig[t-2]); putchar('\n'); return(0); } /* * Print out a nice help message from some file or another. */ help() { register c; register FILE *f; if ((f = fopen(HELPFILE, "r")) == NULL) { printf("No help just now.\n"); return(1); } while ((c = getc(f)) != EOF) putchar(c); fclose(f); return(0); } /* * Change user's working directory. */ schdir(str) char *str; { register char *cp; for (cp = str; *cp == ' '; cp++) ; if (*cp == '\0') cp = homedir; else if ((cp = expand(cp)) == NOSTR) return(1); if (chdir(cp) < 0) { perror(cp); return(1); } return(0); } /* * Reply to a list of messages. Extract each name from the * message header and send them off to mail1() */ respond(msgvec) int *msgvec; { struct message *mp; char *cp, buf[2 * LINESIZE], *rcv; struct name *np; struct header head; char *netmap(); if (msgvec[1] != 0) { printf("Sorry, can't reply to multiple messages at once\n"); return(1); } mp = &message[msgvec[0] - 1]; dot = mp; rcv = nameof(mp); strcpy(buf, ""); cp = hfield("to", mp); if (cp != NOSTR) strcpy(buf, cp); np = elide(extract(buf, GTO)); /* rcv = rename(rcv); */ mapf(np, rcv); np = delname(np, myname); head.h_seq = 1; cp = detract(np, 0); if (cp != NOSTR) { strcpy(buf, cp); strcat(buf, " "); strcat(buf, rcv); } else strcpy(buf, rcv); head.h_to = buf; head.h_subject = hfield("subject", mp); if (head.h_subject == NOSTR) head.h_subject = hfield("subj", mp); head.h_cc = NOSTR; cp = hfield("cc", mp); if (cp != NOSTR) { np = elide(extract(cp, GCC)); mapf(np, rcv); np = delname(np, myname); head.h_cc = detract(np, 0); } head.h_bcc = NOSTR; mail1(&head); return(0); } /* * Preserve the named messages, so that they will be sent * back to the system mailbox. */ preserve(msgvec) int *msgvec; { register struct message *mp; register int *ip, mesg; if (edit) { printf("Cannot \"preserve\" in edit mode\n"); return(1); } for (ip = msgvec; *ip != NULL; ip++) { mesg = *ip; mp = &message[mesg-1]; mp->m_flag |= MPRESERVE; dot = mp; } return(0); } /* * Print the size of each message. */ messize(msgvec) int *msgvec; { register struct message *mp; register int *ip, mesg; for (ip = msgvec; *ip != NULL; ip++) { mesg = *ip; mp = &message[mesg-1]; printf("%d: %d\n", mesg, msize(mp)); } return(0); } /* * Quit quickly. If we are sourcing, just pop the input level * by returning an error. */ rexit(e) { if (sourcing) return(1); exit(e); } /* * Set or display a variable value. Syntax is similar to that * of csh. */ set(arglist) char **arglist; { register struct var *vp; register char *cp, *cp2; char varbuf[BUFSIZ], **ap, **p; int errs, h, s; if (argcount(arglist) == 0) { for (h = 0, s = 1; h < HSHSIZE; h++) for (vp = variables[h]; vp != NOVAR; vp = vp->v_link) s++; ap = (((char **) salloc(s * sizeof *ap); for (h = 0, p = ap; h < HSHSIZE; h++) for (vp = variables[h]; vp != NOVAR; vp = vp->v_link) *p++ = vp->v_name; *p = NOSTR; sort(ap); for (p = ap; *p != NOSTR; p++) printf("%s\t%s\n", *p, value(*p)); return(0); } errs = 0; for (ap = arglist; *ap != NOSTR; ap++) { cp = *ap; cp2 = varbuf; while (*cp != '=' && *cp != '\0') *cp2++ = *cp++; *cp2 = '\0'; if (*cp == '\0') cp = ""; else cp++; if (equal(varbuf, "")) { printf("Non-null variable name required\n"); errs++; continue; } assign(varbuf, cp); } return(errs); } /* * Unset a bunch of variable values. */ unset(arglist) char **arglist; { register struct var *vp, *vp2; register char *cp; int errs, h; char **ap; errs = 0; for (ap = arglist; *ap != NOSTR; ap++) { if ((vp2 = lookup(*ap)) == NOVAR) { if (!sourcing) { printf("\"%s\": undefined variable\n", *ap); errs++; } continue; } h = hash(*ap); if (vp2 == variables[h]) { variables[h] = variables[h]->v_link; vfree(vp2->v_name); vfree(vp2->v_value); cfree(vp2); continue; } for (vp = variables[h]; vp->v_link != vp2; vp = vp->v_link) ; vp->v_link = vp2->v_link; vfree(vp2->v_name); vfree(vp2->v_value); cfree(vp2); } return(errs); } /* * Put add users to a group. */ group(argv) char **argv; { register struct grouphead *gh; register struct group *gp; register int h; int s; char **ap, *gname, **p; if (argcount(argv) == 0) { for (h = 0, s = 1; h < HSHSIZE; h++) for (gh = groups[h]; gh != NOGRP; gh = gh->g_link) s++; ap = (char **) salloc(s * sizeof *ap); for (h = 0, p = ap; h < HSHSIZE; h++) for (gh = groups[h]; gh != NOGRP; gh = gh->g_link) *p++ = gh->g_name; *p = NOSTR; sort(ap); for (p = ap; *p != NOSTR; p++) printgroup(*p); return(0); } if (argcount(argv) == 1) { printgroup(*argv); return(0); } gname = *argv; h = hash(gname); if ((gh = findgroup(gname)) == NOGRP) { gh = (struct grouphead *) calloc(sizeof *gh, 1); gh->g_name = vcopy(gname); gh->g_list = NOGE; gh->g_link = groups[h]; groups[h] = gh; } /* * Insert names from the command list into the group. * Who cares if there are duplicates? They get tossed * later anyway. */ for (ap = argv+1; *ap != NOSTR; ap++) { gp = (struct group *) calloc(sizeof *gp, 1); gp->ge_name = vcopy(*ap); gp->ge_link = gh->g_list; gh->g_list = gp; } return(0); } /* * Sort the passed string vecotor into ascending dictionary * order. */ sort(list) char **list; { register char **ap; int diction(); for (ap = list; *ap != NOSTR; ap++) ; if (ap-list < 2) return; qsort(list, ap-list, sizeof *list, diction); } /* * Do a dictionary order comparison of the arguments from * qsort. */ diction(a, b) register char **a, **b; { return(strcmp(*a, *b)); } /* * The do nothing command for comments. */ null(e) { return(0); } /* * Print out the current edit file, if we are editting. * Otherwise, print the name of the person who's mail * we are reading. */ file(e) { register char *cp; if (edit) printf("Reading \"%s\"\n", editfile); else printf("Reading %s's mail\n", rindex(mailname, '/') + 1); return(0); } /* * Expand file names like echo */ echo(argv) char **argv; { register char **ap; register char *cp; for (ap = argv; *ap != NOSTR; ap++) { cp = *ap; if ((cp = expand(cp)) != NOSTR) printf("%s\n", cp); } return(0); } /* * Reply to a series of messages by simply mailing to the senders * and not messing around with the To: and Cc: lists as in normal * reply. */ Respond(msgvec) int msgvec[]; { struct header head; struct message *mp; register int s, *ap; register char *cp, *subject; for (s = 0, ap = msgvec; *ap != 0; ap++) { mp = &message[*ap - 1]; dot = mp; s += strlen(nameof(mp)) + 1; } if (s == 0) return(0); cp = salloc(s + 2); head.h_to = cp; for (ap = msgvec; *ap != 0; ap++) { mp = &message[*ap - 1]; cp = copy(nameof(mp), cp); *cp++ = ' '; } *--cp = 0; mp = &message[msgvec[0] - 1]; subject = hfield("subject", mp); head.h_seq = 0; if (subject == NOSTR) subject = hfield("subj", mp); head.h_subject = subject; if (subject != NOSTR) head.h_seq++; head.h_cc = NOSTR; head.h_bcc = NOSTR; mail1(&head); return(0); } - 1]; dot = mp; s += strlen(nameof(mp)) + 1; } if (s == 0) return(0); cp = salloc(s + 2); head.h_to = cp; for (ap = msgvec; *ap != 0; ap++) { mp = &message[*ap - 1]; cp = copy(nameof(mp), cp); *cp++ = ' '; } *--cp = 0; mp = &message[msgvec[0] - 1]; sucmd/ucbmail/cmdtab.c 644 0 33 4342 2400701715 7607 # #include "def.h" /* * Mail -- a mail program * * Define all of the command names and bindings. */ extern int type(), preserve(), delete(), undelete(), next(), shell(), schdir(); extern int save(), help(), headers(), pdot(), strace(), respond(), editor(); extern int edstop(), exit(), pcmdlist(), sendmail(), from(); extern int messize(), psalloc(), deltype(), unset(), set(), source(); extern int pversion(), group(), top(), core(), null(), stouch(), visual(); extern int swrite(), dosh(), file(), echo(), Respond(), scroll(); struct cmd cmdtab[] = { "next", next, NDMLIST, 0, MMNDEL, "alias", group, M|RAWLIST, 0, 1000, "print", type, MSGLIST, 0, MMNDEL, "type", type, MSGLIST, 0, MMNDEL, "visual", visual, I|MSGLIST, 0, MMNORM, "top", top, MSGLIST, 0, MMNDEL, "touch", stouch, MSGLIST, 0, MMNDEL, "preserve", preserve, MSGLIST, 0, MMNDEL, "delete", delete, P|MSGLIST, 0, MMNDEL, "dp", deltype, MSGLIST, 0, MMNDEL, "dt", deltype, MSGLIST, 0, MMNDEL, "undelete", undelete, P|MSGLIST, MDELETED,MMNDEL, "unset", unset, M|RAWLIST, 1, 1000, "mail", sendmail, M|I|STRLIST, 0, 0, "mbox", stouch, MSGLIST, 0, 0, "!", shell, I|STRLIST, 0, 0, "chdir", schdir, M|STRLIST, 0, 0, "cd", schdir, M|STRLIST, 0, 0, "save", save, STRLIST, 0, 0, "source", source, M|STRLIST, 0, 0, "set", set, M|RAWLIST, 0, 1000, "shell", dosh, I|NOLIST, 0, 0, "version", pversion, M|NOLIST, 0, 0, "group", group, M|RAWLIST, 0, 1000, "write", swrite, STRLIST, 0, 0, "from", from, MSGLIST, 0, MMNORM, "file", file, M|NOLIST, 0, 0, "?", help, M|NOLIST, 0, 0, "z", scroll, M|STRLIST, 0, 0, "headers", headers, MSGLIST, 0, MMNDEL, "help", help, M|NOLIST, 0, 0, "=", pdot, NOLIST, 0, 0, "Reply", Respond, I|MSGLIST, 0, MMNDEL, "Respond", Respond, I|MSGLIST, 0, MMNDEL, "reply", respond, I|MSGLIST, 0, MMNDEL, "respond", respond, I|MSGLIST, 0, MMNDEL, "edit", editor, I|MSGLIST, 0, MMNORM, "echo", echo, RAWLIST, 0, 1000, "quit", edstop, NOLIST, 0, 0, "list", pcmdlist, M|NOLIST, 0, 0, "xit", exit, M|NOLIST, 0, 0, "exit", exit, M|NOLIST, 0, 0, "size", messize, MSGLIST, 0, MMNDEL, "hold", preserve, MSGLIST, 0, MMNDEL, "core", core, M|NOLIST, 0, 0, "#", null, M|NOLIST, 0, 0, 0, 0, 0, 0, 0 }; 0, MMNDEL, "Respond", Respond, I|MSGLIST, 0, MMNDEL, "reply", respond, I|MSGLIST, 0, MMNDEL, "respond", respond, I|MSGLIST, 0, MMNDEL, "edit", editor, I|MSGLIST, 0, MMNORM, "echo", echo, RAWLIST, 0, 1000, "quit", edstop, NOLIST, 0, 0, "list", pcmdlist, M|NOLIST, 0, 0, "cmd/ucbmail/collect.c 644 0 33 33667 2400701717 10040 # /* * Mail -- a mail program * * Collect input from standard input, handling * ~ escapes. */ #include "rcv.h" #include /* * Read a message from standard output and return a read file to it * or NULL on error. */ /* * The following hokiness with global variables is so that on * receipt of an interrupt signal, the partial message can be salted * away on dead.letter. The output file must be available to flush, * and the input to read. Several open files could be saved all through * Mail if stdio allowed simultaneous read/write access. */ static int (*savesig)(); /* Previous SIGINT value */ static FILE *newi; /* File for saving away */ static FILE *newo; /* Output side of same */ static int hf; /* Ignore interrups */ static int nofault; /* Soft signal if set */ static int hadintr; /* Have seen one SIGINT so far */ static jmp_buf coljmp; /* To get back to work */ FILE * collect(hp) struct header *hp; { FILE *ibuf, *fbuf, *obuf; int lc, cc, escape, collrub(), intack(), stopdot; register int c, t; char linebuf[LINESIZE], *cp; extern char tempMail[]; noreset++; stopdot = (value("dot") != NOSTR) && intty; ibuf = obuf = NULL; if (value("ignore") != NOSTR) hf = 1; else hf = 0; nofault = 1; hadintr = 0; if ((savesig = signal(SIGINT, SIG_IGN)) != SIG_IGN) signal(SIGINT, hf ? intack : collrub); newi = NULL; newo = NULL; if ((obuf = fopen(tempMail, "w")) == NULL) { perror(tempMail); goto err; } newo = obuf; if ((ibuf = fopen(tempMail, "r")) == NULL) { perror(tempMail); newo = NULL; fclose(obuf); goto err; } newi = ibuf; remove(tempMail); /* * If we are going to prompt for a subject, * refrain from printing a newline after * the headers (since some people mind). */ t = GTO|GSUBJECT|GCC|GNL; c = 0; if (intty && sflag == NOSTR && hp->h_subject == NOSTR && value("ask")) t &= ~GNL, c++; if (hp->h_seq != 0) { puthead(hp, stdout, t); fflush(stdout); } if (c) grabh(hp, GSUBJECT); escape = ESCAPE; if ((cp = value("escape"(()) != NOSTR) escape = *cp; for (;;) { setjmp(coljmp); nofault = 0; flush(); if (readline(stdin, linebuf) <= 0) break; hadintr = 0; if (stopdot && equal(".", linebuf)) break; if (linebuf[0] != escape || (!intty && value("henry") == NOSTR)) { if ((t = putline(obuf, linebuf)) < 0) goto err; continue; } c = linebuf[1]; nofault= 0; switch (c) { default: /* * On double escape, just send the single one. * Otherwise, it's an error. */ if (c == escape) { if (putline(obuf, &linebuf[1]) < 0) goto err; else break; } printf("Unknown tilde escape.\n"); break; case 'C': /* * Dump core. */ core(); break; case '!': /* * Shell escape, send the balance of the * line to sh -c. */ shell(&linebuf[2]); break; case ':': case '_': /* * Escape to command mode, but be nice! */ nofault = 0; execute(&linebuf[2]); break; case '.': /* * Simulate end of file on input. */ goto eof; case 'q': case 'Q': /* * Force a quit of sending mail. * Act like an interrupt happened. */ nofault = 0; hadintr++; collrub(SIGINT); exit(1); case 'h': /* * Grab a bunch of headers. */ if (!intty || !outtty) { printf("~h: no can do!?\n"); break; } grabh(hp, GTO|GSUBJECT|GCC|GBCC); printf("(continue)\n"); break; case 't': /* * Add to the To list. */ hp->h_to = addto(hp->h_to, &linebuf[2]); hp->h_seq++; break; case 's': /* * Set the Subject list. */ cp = &linebuf[2]; while (any(*cp, " \t")) cp++; hp->h_subject = savestr(cp); hp->h_seq++; break; case 'c': /* * Add to the CC list. */ hp->h_cc = addto(hp->h_cc, &linebuf[2]); hp->h_seq++; break; case 'b': /* * Add stuff to blind carbon copies list. */ hp->h_bcc = addto(hp->h_bcc, &linebuf[2]); hp->h_seq++; break; case 'd': copy(deadletter, &linebuf[2]); /* fall into . . . */ case 'r': /* * Invoke a file: * Search for the file name, * then open it and copy the contents to obuf. */ cp = &linebuf[2]; while (any(*cp, " \t")) cp++; if (*cp == '\0') { printf("Interpolate what file?\n"); break; } cp = expand(cp); if (cp == NOSTR) break; if (isdir(cp)) { printf("%s: directory\n"); break; } if ((fbuf = fopen(cp, "r")) == NULL) { perror(cp); break; } printf("\"%s\" ", cp); flush(); lc = 0; cc = 0; while (readline(fbuf, linebuf) > 0) { lc++; if ((t = putline(obuf, linebuf)) < 0) { fclose(fbuf); goto err; } cc += t; } fclose(fbuf); printf("%d/%d\n", lc, cc); break; case 'w': /* * Write the message on a file. */ cp = &linebuf[2]; while (any(*cp, " \t")) cp++; if (*cp == '\0') { fprintf(stderr, "Write what file!?\n"); break; } if ((cp = expand(cp)) == NOSTR) break; fflush(obuf); rewind(ibuf); exwrite(cp, ibuf, 1); break; case 'm': case 'f': /* * Interpolate the named messages, if we * are in receiving mail mode. Does the * standard list processing garbage. * If ~f is given, we don't shift over. */ if (!rcvmode) { printf("No messages to send from!?!\n"); break; } cp = &linebuf[2]; while (any(*cp, " \t")) cp++; if (forward(cp, obuf, c) < 0) goto err; printf("(continue)\n"); break; case '?': nofault = 0; if ((fbuf = fopen(THELPFILE, "r")) == NULL) { printf("No help just now.\n"); break; } t = getc(fbuf); while (t != -1) { putchar(t); t = getc(fbuf); } fclose(fbuf); break; case 'p': /* * Print out the current state of the * message without altering anything. */ fflush(obuf); rewind(ibuf); nofault = 0; printf("-------\nMessage contains:\n"); puthead(hp, stdout, GTO|GSUBJECT|GCC|GBCC|GNL); t = getc(ibuf); while (t != EOF) { putchar(t); t = getc(ibuf); } printf("(continue)\n"); break; case '^': case '|': /* * Pipe message through command. * Collect output as new message. */ obuf = mespipe(ibuf, obuf, &linebuf[2]); newo = obuf; ibuf = newi; newi = ibuf; printf("(continue)\n"); break; case 'v': case 'e': /* * Edit the current message. * 'e' means to use EDITOR * 'v' means to use VISUAL */ if ((obuf = mesedit(ibuf, obuf, c)) == NULL) goto err; newo = obuf; ibuf = newi; printf("(continue)\n"); break; break; } } eof: fclose(obuf); rewind(ibuf); signal(SIGINT, savesig); noreset = 0; return(ibuf); err: if (ibuf != NULL) fclose(ibuf); if (obuf != NULL) fclose(obuf); signal(SIGINT, savesig); noreset = 0; return(NULL); } /* * Non destructively interrogate the value of the given signal. */ psig(n) { register (*wassig)(); wassig = signal(n, SIG_IGN); signal(n, wassig); return((int) wassig); } /* * Write a file, ex-like if f set. */ exwrite(name, ibuf, f) char name[]; FILE *ibuf; { register FILE *of; register int c; long cc; int lc; struct stat junk; if (f) { printf("\"%s\" ", name); fflush(stdout); } if (stat(name, &junk) >= 0) { if (!f) fprintf(stderr, "%s: ", name); fprintf(stderr, "File exists\n", name); return(-1); } if ((of = fopen(name, "w")) == NULL) { perror(NOSTR); return(-1); } lc = 0; cc = 0; while ((c = getc(ibuf)) != EOF) { cc++; if (c == '\n') lc++; putc(c, of); if (ferror(of)) { perror(name); fclose(of); return(-1); } } fclose(of); printf("%d/%ld\n", lc, cc); fflush(stdout); return(0); } /* * Edit the message being collected on ibuf and obuf. * Write the message out onto some poorly-named temp file * and point an editor at it. * * On return, make the edit file the new temp file. */ FILE * mesedit(ibuf, obuf, c) FILE *ibuf, *obuf; { int pid, s; FILE *fbuf; register int t; int (*sig)(); struct stat sbuf; extern char tempMail[], tempEdit[]; register char *edit; sig = signal(SIGINT, SIG_IGN); if (stat(tempEdit, &sbuf) >= 0) { printf("%s: file exists\n", tempEdit); goto out; } close(creat(tempEdit, 0600)); if ((fbuf = fopen(tempEdit, "w")) == NULL) { perror(tempEdit); goto out; } fflush(obuf); rewind(ibuf); t = getc(ibuf); while (t != EOF) { putc(t, fbuf); t = getc(ibuf); } fflush(fbuf); if (ferror(fbuf)) { perror(tempEdit); remove(tempEdit); goto fix; } fclose(fbuf); if ((edit = value(c == 'e' ? "EDITOR" : "VISUAL")) == NOSTR) edit = c == 'e' ? EDITOR : VISUAL; pid = vfork(); if (pid == 0) { if (sig != SIG_IGN) signal(SIGINT, SIG_DFL); execl(edit, edit, tempEdit, 0); perror(edit); _exit(1); } if (pid == -1) { perror("fork"); remove(tempEdit); goto out; } while (wait(&s) != pid) ; if (s != 0) { printf("Fatal error in \"%s\"\n", edit); remove(tempEdit); goto out; } /* * Now switch to new file. */ if ((fbuf = fopen(tempEdit, "a")) == NULL) { perror(tempEdit); remove(tempEdit); goto out; } if ((ibuf = fopen(tempEdit, "r")) == NULL) { perror(tempEdit); fclose(fbuf); remove(tempEdit); goto out; } remove(tempEdit); fclose(obuf); fclose(newi); obuf = fbuf; goto out; fix: perror(tempEdit); out: signal(SIGINT, sig); newi = ibuf; return(obuf); } /* * Pipe the message through the command. * Old message is on stdin of command; * New message collected from stdout. * Sh -c must return 0 to accept the new message. */ FILE * mespipe(ibuf, obuf, cmd) FILE *ibuf, *obuf; char cmd[]; { register FILE *ni, *no; int pid, s; int (*savesig)(); char *Shell; newi = ibuf; if ((no = fopen(tempEdit, "w")) == NULL) { perror(tempEdit); return(obuf); } if ((ni = fopen(tempEdit, "r")) == NULL) { perror(tempEdit); fclose(no); remove(tempEdit); return(obuf); } remove(tempEdit); savesig = signal(SIGINT, SIG_IGN); fflush(obuf); rewind(ibuf); if ((Shell = value("SHELL")) == NULL) Shell = "/bin/sh"; if ((pid = vfork()) == -1) { perror("fork"); goto err; } if (pid == 0) { /* * stdin = current message. * stdout = new message. */ close(0); dup(fileno(ibuf)); close(1); dup(fileno(no)); for (s = 4; s < 15; s++) close(s); execl(Shell, Shell, "-c", cmd, 0); perror(Shell); _exit(1); } while (wait(&s) != pid) ; if (s != 0 || pid == -1) { fprintf(stderr, "\"%s\" failed!?\n", cmd); goto err; } if (fsize(ni) == 0) { fprintf(stderr, "No bytes from \"%s\" !?\n", cmd); goto err; } /* * Take new files. */ newi = ni; fclose(ibuf); fclose(obuf); signal(SIGINT, savesig); return(no); err: fclose(no); fclose(ni); signal(SIGINT, savesig); return(obuf); } /* * Interpolate the named messages into the current * message, preceding each line with a tab. * Return a count of the number of characters now in * the message, or -1 if an error is encountered writing * the message temporary. The flag argument is 'm' if we * should shift over and 'f' if not. */ forward(ms, obuf, f) char ms[]; FILE *obuf; { register int *msgvec, *ip; extern char tempMail[]; msgvec = (int *) salloc((msgCount+1) * sizeof *msgvec); if (msgvec == (int *) NOSTR) return(0); if (getmsglist(ms, msgvec, 0) < 0) return(0); if (*msgvec == NULL) { *msgvec = first(0, MMNORM); if (*msgvec == NULL) { printf("No appropriate messages\n"); return(0); } msgvec[1] = NULL; } printf("Interpolating:"); for (ip = msgvec; *ip != NULL; ip++) { touch(*ip); printf(" %d", *ip); if (f == 'm') { if (transmit(&message[*ip-1], obuf) < 0) { perror(tempMail); return(-1); } } else if (send(&message[*ip-1], obuf) < 0) { perror(tempMail); return(-1); } } printf("\n"); return(0); } /* * Send message described by the passed pointer to the * passed output buffer. Insert a tab in front of each * line. Return a count of the characters sent, or -1 * on error. */ transmit(mailp, obuf) struct message *mailp; FILE *obuf; { register struct message *mp; register int c, ch; int n, bol; FILE *ibuf; mp = mailp;(( ibuf = setinput(mp); c = msize(mp); n = c; bol = 1; while (c-- > 0) { if (bol) { bol = 0; putc('\t', obuf); n++; if (ferror(obuf)) { perror("/tmp"); return(-1); } } ch = getc(ibuf); if (ch == '\n') bol++; putc(ch, obuf); if (ferror(obuf)) { perror("/tmp"); return(-1); } } return(n); } /* * On interrupt, go here to save the partial * message on #/dead.letter. * Then restore signals and execute the normal * signal routine. We only come here if signals * were previously set anyway. */ collrub(s) { register FILE *dbuf; register int c; #ifdef V7 signal(s, SIG_IGN); #else signal(SIGINT, SIG_IGN); #endif if (nofault) { #ifdef V7 signal(s, collrub); #else signal(SIGINT, collrub); #endif return; } if (hadintr == 0) { hadintr++; clrbuf(stdout); printf("\n(Interrupt -- one more to kill letter)\n"); #ifdef V7 signal(s, collrub); #else signal(SIGINT, collrub); #endif longjmp(coljmp, 1); } fclose(newo); rewind(newi); if (value("nosave") != NOSTR || fsize(newi) == 0) goto done; if ((dbuf = fopen(deadletter, "w")) == NULL) goto done; chmod(deadletter, 0600); while ((c = getc(newi)) != EOF) putc(c, dbuf); fclose(dbuf); done: fclose(newi); signal(SIGINT, savesig); if (rcvmode) stop(); else exit(1); } /* * Acknowledge an interrupt signal from the tty by typing an @ */ intack(s) { signal(SIGINT, SIG_IGN); puts("@"); fflush(stdout); clearerr(stdin); signal(SIGINT, intack); } /* * Add a string to the end of a header entry field. */ char * addto(hf, news) char hf[], news[]; { register char *cp, *cp2, *linebuf; if (hf == NOSTR) hf = ""; if (*news == '\0') return(hf); linebuf = salloc(strlen(hf) + strlen(news) + 2); for (cp = hf; any(*cp, " \t"); cp++) ; for (cp2 = linebuf; *cp;) *cp2++ = *cp++; *cp2++ = ' '; for (cp = news; any(*cp, " \t"); cp++) ; while (*cp != '\0') *cp2++ = *cp++; *cp2 = '\0'; return(linebuf); } r(stdin); signal(SIGINT, intack); } /* * Add a string to the end of a cmd/ucbmail/def.h 644 0 33 16112 2414153667 7152 # #include "local.h" #include #include #include #undef isalpha #undef isdigit /* * Mail -- a mail program * * Commands are: * t print out these messages * r reply to messages * m mail to users (analogous to send) * e edit messages * c [directory] chdir to dir or home if none * x exit quickly * w file save messages in file * q quit, save remaining stuff in mbox * d delete messages * u undelete messages * h print message headers * * Author: Kurt Shoens (UCB) March 25, 1978 */ #define ESCAPE '~' /* Default escape for sending */ #define NMLSIZE 20 /* max names in a message list */ #define PATHSIZE 35 /* Size of pathnames throughout */ #define NAMESIZE 20 /* Max size of user name */ #define HSHSIZE 19 /* Hash size for aliases and vars */ #define HDRFIELDS 3 /* Number of header fields */ #define LINESIZE 512 /* max readable line width */ #define SCREEN 18 /* screen size in lines (effective) */ #define STRINGSIZE ((unsigned) 128)/* Dynamic allocation units */ #define MAXARGC 20 /* Maximum list of raw strings */ #define NOSTR ((char *) 0) /* Null string pointer */ #define MAXEXP 25 /* Maximum expansion of aliases */ #define equal(a, b) (strcmp(a,b)==0)/* A nice function to string compare */ struct message { short m_flag; /* flags, see below */ short m_block; /* block number of this message */ short m_offset; /* offset in block of message */ unsigned m_size; /* Bytes in the message */ short m_lines; /* Lines in the message */ }; /* * flag bits. */ #define MUSED 1 /* entry is used, but this bit isn't */ #define MDELETED 2 /* entry has been deleted */ #define MSAVED 4 /* entry has been saved */ #define MTOUCH 8 /* entry has been noticed */ #define MPRESERVE 16 /* keep entry in sys mailbox */ #define MMARK 32 /* message is marked! */ #define MODIFY 64 /* message has been modified */ /* * Format of the command description table. * The actual table is declared and initialized * in lex.c */ struct cmd { char *c_name; /* Name of command */ int (*c_func)(); /* Implementor of the command */ short c_argtype; /* Type of arglist (see below) */ short c_msgflag; /* Required flags of messages */ short c_msgmask; /* Relevant flags of messages */ }; /* Yechh, can't initialize unions */ #define c_minargs c_msgflag /* Minimum argcount for RAWLIST */ #define c_maxargs c_msgmask /* Max argcount for RAWLIST */ /* * Argument types. */ #define MSGLIST 0 /* Message list type */ #define STRLIST 1 /* A pure string */ #define RAWLIST 2 /* Shell string list */ #define NOLIST 3 /* Just plain 0 */ #define NDMLIST 4 /* Message list, no defaults */ #define P 040 /* Autoprint dot after command */ #define I 0100 /* Interactive command bit */ #define M 0200 /* Illegal from send mode bit */ /* * Oft-used mask values */ #define MMNORM (MDELETED|MSAVED)/* Look at both save and delete bits */ #define MMNDEL MDELETED /* Look only at deleted bit */ /* * Structure used to return a break down of a head * line (hats off to Bill Joy!) */ struct headline { char *l_from; /* The name of the sender */ char *l_tty; /* His tty string (if any) */ char *l_date; /* The entire date string */ }; #define GTO 1 /* Grab To: line */ #define GSUBJECT 2 /* Likewise, Subject: line */ #define GCC 4 /* And the Cc: line */ #define GBCC 8 /* And also the Bcc: line */ #define GMASK (GTO|GSUBJECT|GCC|GBCC) /* Mask of places from whence */ #define GNL 16 /* Print blank line after */ #define GDEL 32 /* Entity removed from list */ #define GCOMMA 64 /* detract puts in commas */ /* * Structure used to pass about the current * state of the user-typed message header. */ struct header { char *h_to; /* Dynamic "To:" string */ char *h_subject; /* Subject string */ char *h_cc; /* Carbon copies string */ char *h_bcc; /* Blind carbon copies */ int h_seq; /* Sequence for optimization */ }; /* * Structure of namelist nodes used in processing * the recipients of mail and aliases and all that * kind of stuff. */ struct name { struct name *n_flink; /* Forward link in list. */ struct name *n_blink; /* Backward list link */ short n_type; /* From which list it came */ char *n_name; /* This fella's name */ }; /* * Structure of a variable node. All variables are * kept on a singly-linked list of these, rooted by * "variables" */ struct var { struct var *v_link; /* Forward link to next variable */ char *v_name; /* The variable's name */ char *v_value; /* And it's current value */ }; struct group { struct group *ge_link; /* Next person in this group */ char *ge_name; /* This person's user name */ }; struct grouphead { struct grouphead *g_link; /* Next grouphead in list */ char *g_name; /* Name of this group */ struct group *g_list; /* Users in group. */ }; #define NIL ((struct name *) 0) /* The nil pointer for namelists */ #define NONE ((struct cmd *) 0) /* The nil pointer to command tab */ #define NOVAR ((struct var *) 0) /* The nil pointer to variables */ #define NOGRP ((struct grouphead *) 0)/* The nil grouphead pointer */ #define NOGE ((struct group *) 0) /* The nil group pointer */ /* * Token values returned by the scanner used for argument lists. * Also, sizes of scanner-related things. */ #define TEOL 0 /* End of the command line */ #define TNUMBER 1 /* A message number */ #define TDASH 2 /* A simple dash */ #define TSTRING 3 /* A string (possibly containing -) */ #define TDOT 4 /* A "." */ #define TUP 5 /* An "^" */ #define TDOLLAR 6 /* A "$" */ #define TSTAR 7 /* A "*" */ #define TOPEN 8 /* An '(' */ #define TCLOSE 9 /* A ')' */ #define TPLUS 10 /* A '+' */ #define REGDEP 2 /* Maximum regret depth. */ #define STRINGLEN 16 /* Maximum length of string token */ /* * Kludges to handle the change from setexit / reset to setjmp / longjmp */ #define setexit() setjmp(srbuf) #define reset(x) longjmp(srbuf, x) /* * VM/UNIX has a vfork system call which is faster than forking. If we * don't have it, fork(2) will do . . . */ #ifndef VMUNIX #define vfork() fork() #endif /* * Forward declarations of routine types to keep lint and cc happy. */ FILE *Fdopen(); FILE *collect(); FILE *infix(); FILE *mesedit(); FILE *mespipe(); FILE *setinput(); char **unpack(); char *addto(); char *arpafix(); char *calloc(); char *copy(); char *copyin(); char *detract(); char *expand(); char *gets(); char *hfield(); char *index(); char *nameof(); char *nextword(); char *getenv(); char *hcontents(); char *netmap(); char *netname(); char *readtty(); char *rename(); char *revarpa(); char *rindex(); char *rpair(); char *salloc(); char *savestr(); char *savestr(); char *snarf(); char *value(); char *vcopy(); char *yankword(); off_t fsize(); struct cmd *lex(); struct grouphead *findgroup(); struct name *cat(); struct name *delname(); struct name *elide(); struct name *extract(); struct name *gexpand(); struct name *map(); struct name *outof(); struct name *put(); struct name *usermap(); struct name *verify(); struct var *lookup(); unsigned int msize(); ); char *rename(); char *revarpa(); char *rindex(); char *rpair(); char *salloc(); char *savestr(); char *savestr(); char *snarf(); char *value(); char *vcopy(); char *yankword(); off_t fsize(); struct cmd *lex(); struct grouphead *findgroup(); struct name *cat(); struct name *delname(); struct name *elide(); struct name *extract(); struct name *gexpand(); struct name *map(); struct name *outof(); struct name *put(); struct name *user((cmd/ucbmail/edit.c 644 0 33 6320 2400702067 7301 # #include "rcv.h" #include #include /* * Mail -- a mail program * * Perform message editing functions. */ /* * Edit a message list. */ editor(msgvec) int *msgvec; { char *edname; if ((edname = value("EDITOR")) == NOSTR) edname = EDITOR; return(edit1(msgvec, edname)); } /* * Invoke the visual editor on a message list. */ visual(msgvec) int *msgvec; { char *edname; if ((edname = value("VISUAL")) == NOSTR) edname = VISUAL; return(edit1(msgvec, edname)); } /* * Edit a message by writing the message into a funnily-named file * (which should not exist) and forking an editor on it. * We get the editor from the stuff above. */ edit1(msgvec, ed) int *msgvec; char *ed; { register char *cp, *cp2; register int c; int *ip, pid, mesg, lines; unsigned int ms; int (*sigint)(), (*sigquit)(); FILE *ibuf, *obuf; char edname[15], nbuf[10]; struct message *mp; extern char tempEdit[]; off_t fsize(), size; struct stat statb; long modtime; /* * Set signals; locate editor. */ sigint = signal(SIGINT, SIG_IGN); sigquit = signal(SIGQUIT, SIG_IGN); /* * Deal with each message to be edited . . . */ for (ip = msgvec; *ip && ip-msgvec < msgCount; ip++) { mesg = *ip; mp = &message[mesg-1]; mp->m_flag |= MODIFY; /* * Make up a name for the edit file of the * form "Message%d" and make sure it doesn't * already exist. */ cp = &nbuf[10]; *--cp = 0; while (mesg) { *--cp = mesg % 10 + '0'; mesg /= 10; } cp2 = copy("Message", edname); while (*cp2++ = *cp++) ; if (!access(edname, 2)) { printf("%s: file exists\n", edname); goto out; } /* * Copy the message into the edit file. */ close(creat(edname, 0600)); if ((obuf = fopen(edname, "w")) == NULL) { perror(edname); goto out; } if (send(mp, obuf) < 0) { perror(edname); fclose(obuf); remove(edname); goto out; } fflush(obuf); if (ferror(obuf)) { remove(edname); fclose(obuf); goto out; } fclose(obuf); /* * Fork/execl the editor on the edit file. */ if (stat(edname, &statb) < 0) modtime = 0; modtime = statb.st_mtime; pid = vfork(); if (pid == -1) { perror("fork"); remove(edname); goto out; } if (pid == 0) { if (sigint != SIG_IGN) signal(SIGINT, SIG_DFL); if (sigquit != SIG_IGN) signal(SIGQUIT, SIG_DFL); execl(ed, ed, edname, 0); perror(ed); _exit(1); } while (wait(&mesg) != pid) ; /* * Now copy the message to the end of the * temp file. */ if (stat(edname, &statb) < 0) { perror(edname); goto out; } if (modtime == statb.st_mtime) { remove(edname); goto out; } if ((ibuf = fopen(edname, "r")) == NULL) { perror(edname); remove(edname); goto out; } remove(edname); fseek(otf, (long) 0, 2); size = fsize(otf); mp->m_block = blockof(size); mp->m_offset = offsetof(size); ms = 0; lines = 0; while ((c = getc(ibuf)) != EOF) { if (c == '\n') lines++; putc(c, otf); if (ferror(otf)) break; ms++; } mp->m_size = ms; mp->m_lines = lines; if (ferror(otf)) perror("/tmp"); fclose(ibuf); } /* * Restore signals and return. */ out: signal(SIGINT, sigint); signal(SIGQUIT, sigquit); } ove(edname); goto out; } remove(edname); fseek(otf, (long) 0, 2); size = fsize(otf); mp->m_block = blockof(size); mp->m_offset = offsetof(size); ms = 0; lines = 0; while ((c = getc(ibuf)) != EOF) { if (c == '\n') lines++; putc(c, otf); if (ferror(otf)) break; ms+cmd/ucbmail/errlst.c 644 0 33 1462 2400701720 7664 char *sys_errlist[] = { "Error 0", "Not owner", "No such file or directory", "No such process", "Interrupted system call", "I/O error", "No such device or address", "Arg list too long", "Exec format error", "Bad file number", "No children", "No more processes", "Not enough core", "Permission denied", "Bad address", "Block device required", "Mount device busy", "File exists", "Cross-device link", "No such device", "Not a directory", "Is a directory", "Invalid argument", "File table overflow", "Too many open files", "Not a typewriter", "Text file busy", "File too large", "No space left on device", "Illegal seek", "Read-only file system", "Too many links", "Broken pipe", "Argument too large", "Result too large", }; int sys_nerr = { sizeof sys_errlist/sizeof sys_errlist[0] }; denied", "Bad address", "Block device required", "Mount device busy", "File exists", "Cross-device link", "No such device", "Not a directory", "Is a directory", "Invalid argument", "File table ovcmd/ucbmail/fio.c 644 0 33 16116 2400701722 7152 # #include "rcv.h" #include #include /* * Mail -- a mail program * * File I/O. */ /* * Set up the input pointers while copying the mail file into * /tmp. */ setptr(ibuf) FILE *ibuf; { register int count, s, l; off_t offset; char linebuf[LINESIZE]; int maybe, mestmp, flag; struct message this; extern char tempSet[]; if ((mestmp = opentemp(tempSet)) < 0) exit(1); msgCount = 0; offset = 0; s = 0; l = 0; maybe = 1; flag = MUSED; if (value("hold") != NOSTR) flag = MPRESERVE|MUSED; for (;;) { if ((count = readline(ibuf, linebuf)) == 0) { this.m_flag = flag; this.m_offset = offsetof(offset); this.m_block = blockof(offset); this.m_size = s; this.m_lines = l; if (append(&this, mestmp)) { perror(tempSet); exit(1); } fclose(ibuf); makemessage(mestmp); close(mestmp); return; } if (putline(otf, linebuf) < 0) { perror("/tmp"); exit(1); } if (maybe && ishead(linebuf)) { msgCount++; this.m_flag = flag; this.m_block = blockof(offset); this.m_offset = offsetof(offset); this.m_size = s; this.m_lines = l; s = 0; l = 0; if (append(&this, mestmp)) { perror(tempSet); exit(1); } } offset += count; s += count; l++; maybe = 0; if (linebuf[0] == 0) maybe = 1; } } /* * Drop the passed line onto the passed output buffer. * If a write error occurs, return -1, else the count of * characters written, including the newline. */ putline(obuf, linebuf) FILE *obuf; char *linebuf; { register int c; c = strlen(linebuf); fputs(linebuf, obuf); putc('\n', obuf); if (ferror(obuf)) return(-1); return(c+1); } /* * Read up a line from the specified input into the line * buffer. Return the number of characters read. Do not * include the newline at the end. */ readline(ibuf, linebuf) FILE *ibuf; char *linebuf; { register char *cp; register int c; do { clearerr(ibuf); c = getc(ibuf); for (cp = linebuf; c != '\n' && c != EOF; c = getc(ibuf)) { if (c == 0) continue; if (cp - linebuf < LINESIZE-2) *cp++ = c; } } while (ferror(ibuf) && ibuf == stdin); *cp = 0; if (c == EOF && cp == linebuf) return(0); return(cp - linebuf + 1); } /* * Return a file buffer all ready to read up the * passed message pointer. */ FILE * setinput(mp) register struct message *mp; { off_t off; fflush(otf); off = mp->m_block; off <<= 9; off += mp->m_offset; if (fseek(itf, off, 0) < 0) { perror("fseek"); panic("temporary file seek"); } return(itf); } /* * Take the data out of the passed ghost file and toss it into * a dynamically allocated message structure. */ makemessage(f) { register struct message *m; register char *mp; register count; mp = calloc((unsigned) (msgCount + 1), sizeof *m); if (mp == NOSTR) { printf("Insufficient memory for %d messages\n", msgCount); exit(1); } message = (struct message *) mp; dot = message; lseek(f, 0L, 0); while (count = read(f, mp, BUFSIZ)) mp += count; for (m = &message[0]; m < &message[msgCount]; m++) { m->m_size = (m+1)->m_size; m->m_lines = (m+1)->m_lines; } message[msgCount].m_size = 0; message[msgCount].m_lines = 0; } /* * Append the passed message descriptor onto the temp file. * If the write fails, return 1, else 0 */ append(mp, f) struct message *mp; { if (write(f, (char *) mp, sizeof *mp) != sizeof *mp) return(1); return(0); } /* * Delete a file, but only if the file is a plain file. */ remove(name) char name[]; { struct stat statb; extern int errno; if (stat(name, &statb) < 0) return(-1); if ((statb.st_mode & S_IFMT) != S_IFREG) { errno = EISDIR; return(-1); } return(unlink(name)); } /* * Terminate an editing session by attempting to write out the user's * file from the temporary. */ edstop() { register int gotcha, c; register struct message *mp; FILE *obuf; for (mp = &message[0], gotcha = 0; mp < &message[msgCount]; mp++) if (mp->m_flag & (MODIFY|MDELETED)) { gotcha++; break; } if (!gotcha) return; printf("\"%s\" ", editfile); flush(((); if ((obuf = fopen(editfile, "w")) == NULL) { perror(editfile); reset(0); } c = 0; for (mp = &message[0]; mp < &message[msgCount]; mp++) { if ((mp->m_flag & MDELETED) != 0) continue; c++; if (send(mp, obuf) < 0) { perror(editfile); reset(0); } } fflush(obuf); if (ferror(obuf)) { perror(editfile); reset(0); } if (c == 0) { remove(editfile); printf("removed\n"); } else printf("complete\n"); flush(); } /* * Empty the output buffer. */ clrbuf(buf) register FILE *buf; { buf = stdout; buf->_ptr = buf->_base; buf->_cnt = BUFSIZ; } /* * Open a temp file by creating, closing, unlinking, and * reopening. Return the open file descriptor. */ opentemp(file) char file[]; { register int f; if ((f = creat(file, 0600)) < 0) { perror(file); return(-1); } close(f); if ((f = open(file, 2)) < 0) { perror(file); remove(file); return(-1); } remove(file); return(f); } /* * Flush the standard output. */ flush() { fflush(stdout); fflush(stderr); } /* * Determine the size of the file possessed by * the passed buffer. */ off_t fsize(iob) FILE *iob; { register int f; struct stat sbuf; f = fileno(iob); if (fstat(f, &sbuf) < 0) return(0); return(sbuf.st_size); } /* * Take a file name, possibly with shell meta characters * in it and expand it by using "sh -c echo filename" * Return the file name as a dynamic string. */ char * expand(name) char name[]; { char xname[BUFSIZ]; char cmdbuf[BUFSIZ]; register int pid, l, rc; register char *cp, *Shell; int s, pivec[2], (*sigint)(); struct stat sbuf; if (!anyof(name, "~{[*?$`'\"\\")) return(name); /* sigint = signal(SIGINT, SIG_IGN); */ if (pipe(pivec) < 0) { perror("pipe"); /* signal(SIGINT, sigint) */ return(name); } sprintf(cmdbuf, "echo %s", name); if ((pid = vfork()) == 0) { Shell = value("SHELL"); if (Shell == NOSTR) Shell = SHELL; close(pivec[0]); close(1); dup(pivec[1]); close(pivec[1]); close(2); execl(Shell, Shell, "-c", cmdbuf, 0); _exit(1); } if (pid == -1) { perror("fork"); close(pivec[0]); close(pivec[1]); return(NOSTR); } close(pivec[1]); l = read(pivec[0], xname, BUFSIZ); close(pivec[0]); while (wait(&s) != pid); ; s &= 0377; if (s != 0 && s != SIGPIPE) { fprintf(stderr, "\"Echo\" failed\n"); goto err; } if (l < 0) { perror("read"); goto err; } if (l == 0) { fprintf(stderr, "\"%s\": No match\n", name); goto err; } if (l == BUFSIZ) { fprintf(stderr, "Buffer overflow expanding \"%s\"\n", name); goto err; } xname[l] = 0; for (cp = &xname[l-1]; *cp == '\n' && cp > xname; cp--) ; *++cp = '\0'; if (any(' ', xname) && stat(xname, &sbuf) < 0) { fprintf(stderr, "\"%s\": Ambiguous\n", name); goto err; } /* signal(SIGINT, sigint) */ return(savestr(xname)); err: /* signal(SIGINT, sigint); */ return(NOSTR); } /* * A nicer version of Fdopen, which allows us to fclose * without losing the open file. */ FILE * Fdopen(fildes, mode) char *mode; { register int f; FILE *fdopen(); f = dup(fildes); if (f < 0) { perror("dup"); return(NULL); } return(fdopen(f, mode)); } ; *++cp = '\0'; if (any(' ', xname) && stat(xname, &sbuf) < 0) { fprintf(stderr, "\"%s\": Ambiguous\n", name); goto err; } /* signal(SIGINT, sigint) */ return(savestr(xname)); err: /* signal(SIGINT, sigint); */ return(NOSTR); } /* * A nicer version of Fdopen, which allows us to fclose * without losing the open file. */ FILE * Fdopen(fildes, mode) char *mode; { register int f; FILE *fdopen(); f = dup(fildes); cmd/ucbmail/fmt.c 644 0 33 15547 2400701725 7175 # #include #include /* * fmt -- format the concatenation of input files or standard input * onto standard output. Designed for use with Mail ~| * * Syntax: fmt [ name ... ] * Author: Kurt Shoens (UCB) 12/7/78 */ #define LENGTH 72 /* Max line length in output */ #define NOSTR ((char *) 0) /* Null string pointer for lint */ int pfx; /* Current leading blank count */ int lineno; /* Current input line */ int mark; /* Last place we saw a head line */ char *calloc(); /* for lint . . . */ char *headnames[] = {"To", "Subject", "Cc", 0}; /* * Drive the whole formatter by managing input files. Also, * cause initialization of the output stuff and flush it out * at the end. */ main(argc, argv) char **argv; { register FILE *fi; register int errs = 0; setout(); lineno = 1; mark = -10; setbuf(stdout, calloc(1, BUFSIZ)); if (argc < 2) { setbuf(stdin, calloc(1, BUFSIZ)); fmt(stdin); oflush(); exit(0); } while (--argc) { if ((fi = fopen(*++argv, "r")) == NULL) { perror(*argv); errs++; continue; } fmt(fi); fclose(fi); } oflush(); exit(errs); } /* * Read up characters from the passed input file, forming lines, * doing ^H processing, expanding tabs, stripping trailing blanks, * and sending each line down for analysis. */ fmt(fi) FILE *fi; { char linebuf[BUFSIZ], canonb[BUFSIZ]; register char *cp, *cp2; register int c, col; c = getc(fi); while (c != EOF) { /* * Collect a line, doing ^H processing. * Leave tabs for now. */ cp = linebuf; while (c != '\n' && c != EOF && cp-linebuf < BUFSIZ-1) { if (c == '\b') { if (cp > linebuf) cp--; c = getc(fi); continue; } if ((c < ' ' || c >= 0177) && c != '\t') { c = getc(fi); continue; } *cp++ = c; c = getc(fi); } *cp = '\0'; /* * Toss anything remaining on the input line. */ while (c != '\n' && c != EOF) c = getc(fi); /* * Expand tabs on the way to canonb. */ col = 0; cp = linebuf; cp2 = canonb; while (c = *cp++) { if (c != '\t') { col++; if (cp2-canonb < BUFSIZ-1) *cp2++ = c; continue; } do { if (cp2-canonb < BUFSIZ-1) *cp2++ = ' '; col++; } while ((col & 07) != 0); } /* * Swipe trailing blanks from the line. */ for (cp2--; cp2 >= canonb && *cp2 == ' '; cp2--) ; *++cp2 = '\0'; prefix(canonb); if (c != EOF) c = getc(fi); } } /* * Take a line devoid of tabs and other garbage and determine its * blank prefix. If the indent changes, call for a linebreak. * If the input line is blank, echo the blank line on the output. * Finally, if the line minus the prefix is a mail header, try to keep * it on a line by itself. */ prefix(line) char line[]; { register char *cp, **hp; register int np, h; if (strlen(line) == 0) { oflush(); putchar('\n'); return; } for (cp = line; *cp == ' '; cp++) ; np = cp - line; /* * The following horrible expression attempts to avoid linebreaks * when the indent changes due to a paragraph. */ if (np != pfx && (np > pfx || abs(pfx-np) > 8)) oflush(); if (h = ishead(cp)) oflush(), mark = lineno; if (lineno - mark < 3 && lineno - mark > 0) for (hp = &headnames[0]; *hp != (char *) 0; hp++) if (ispref(*hp, cp)) { h = 1; oflush(); break; } if (!h && (h = (*cp == '.'))) oflush(); pfx = np; split(cp); if (h) oflush(); lineno++; } /* * Split up the passed line into output "words" which are * maximal strings of non-blanks with the blank separation * attached at the end. Pass these words along to the output * line packer. */ split(line) char line[]; { register char *cp, *cp2; char word[BUFSIZ]; cp = line; while (*cp) { cp2 = word; /* * Collect a 'word,' allowing it to contain escaped * white space. */ while (*cp && *cp != ' ') { if (*cp == '\\' && isspace(cp[1])) *cp2++ = *cp++; *cp2++ = *cp++; } /* * Guarantee a space at end of line. * Two spaces after end of sentence punctuation. */ if (*cp == '\0') { *cp2++ = ' '; if (any(cp[-1], ".:!")) *cp2++ = ' '; } while (*cp == ' ') *cp2++ = *cp++; *cp2 = '\0'; pack(word); } } /* * Output section. * Build up line images from the words passed in. Prefix * each line with correct number of blanks. The buffer "outbuf" * contains the current partial line image, including prefixed blanks. * "outp" points to the next available space therein. When outp is NOSTR, * there ain't nothing in there yet. At the bottom of this whole mess, * leading tabs are reinserted. */ char outbuf[BUFSIZ]; /* Sandbagged output line image */ char *outp; /* Pointer in above */ /* * Initialize the output section. */ setout() { outp = NOSTR; } /* * Pack a word onto the output line. If this is the beginning of * the line, push on the appropriately-sized string of blanks first. * If the word won't fit on the current line, flush and begin a new * line. If the word is too long to fit all by itself on a line, * just give it its own and hope for the best. */ pack(word) char word[]; { register char *cp; register int s, t; if (outp == NOSTR) leadin(); t = strlen(word); s = outp-outbuf; if (t+s <= LENGTH) { /* * In like flint! */ for (cp = word; *cp; *outp++ = *cp++) ; return; } if (s > pfx) { oflush(); leadin(); } for (cp = word; *cp; *outp++ = *cp++) ; } /* * If there is anything on the current output line, send it on * its way. Set outp to NOSTR to indicate the absence of the current * line prefix. */ oflush() { if (outp == NOSTR) return; *outp = '\0'; tabulate(outbuf); outp = NOSTR; } /* * Take the passed line buffer, insert leading tabs where possible, and * output on standard output (finally). */ tabulate(line) char line[]; { register char *cp, *cp2; register int b, t; /* * Toss trailing blanks in the output line. */ cp = line + strlen(line) - 1; while (cp >= line && *cp == ' ') cp--; *++cp = '\0'; /* * Count the leading blank space and tabulate. */ for (cp = line; *cp == ' '; ((cp++) ; b = cp-line; t = b >> 3; b &= 07; if (t > 0) do putc('\t', stdout); while (--t); if (b > 0) do putc(' ', stdout); while (--b); while (*cp) putc(*cp++, stdout); putc('\n', stdout); } /* * Initialize the output line with the appropriate number of * leading blanks. */ leadin() { register int b; register char *cp; for (b = 0, cp = outbuf; b < pfx; b++) *cp++ = ' '; outp = cp; } /* * Save a string in dynamic space. * This little goodie is needed for * a headline detector in head.c */ char * savestr(str) char str[]; { register char *top; top = calloc(strlen(str) + 1, 1); if (top == NOSTR) { fprintf(stderr, "fmt: Ran out of memory\n"); exit(1); } copy(str, top); return(top); } /* * Is s1 a prefix of s2?? */ ispref(s1, s2) register char *s1, *s2; { while (*s1++ == *s2) ; return(*s1 == '\0'); } b = 0, cp = outbuf; b < pfx; b++) *cp++ = ' '; outp = cp; } /* * Save a string in dynamic space. * This little goodie is needed for * a headline dcmd/ucbmail/getname.c 644 0 33 6045 2400701726 10001 # /* * Getname / getuserid for those with no * hashed passwd data base). * Do not compile this module in if you DO have hashed * passwd's -- this is slower. * * Also provided here is a getpw routine which can share * the open file. This is used for the Version 6 getenv * implementation. */ #include "rcv.h" static FILE *pwfile = NULL; /* Pw file held open */ static char *pwname = "/etc/passwd"; /* Name of passwd file */ /* * Search the passwd file for a uid. Return name through ref parameter * if found, indicating success with 0 return. Return -1 on error. * If -1 is passed as the user id, close the passwd file. */ getname(uid, namebuf) char namebuf[]; { register char *cp, *cp2; char linebuf[BUFSIZ]; if (uid == -1) { if (pwfile != NULL) fclose(pwfile); pwfile = NULL; return(0); } if (pwfile == NULL && (pwfile = fopen(pwname, "r")) == NULL) return(-1); rewind(pwfile); while (fgets(linebuf, BUFSIZ, pwfile) != NULL) if (pweval(linebuf) == uid) { for (cp = linebuf, cp2 = namebuf; *cp != ':'; *cp2++ = *cp++) ; *cp2 = '\0'; return(0); } return(-1); } /* * Read the users password file line into the passed line * buffer. */ getpw(uid, linebuf) char linebuf[]; { register char *cp, *cp2; if (uid == -1) { if (pwfile != NULL) fclose(pwfile); pwfile = NULL; return(0); } if (pwfile == NULL && (pwfile = fopen(pwname, "r")) == NULL) return(-1); rewind(pwfile); while (fgets(linebuf, BUFSIZ, pwfile) != NULL) if (pweval(linebuf) == uid) { if (linebuf[0] != '\0') linebuf[strlen(linebuf)-1] = '\0'; return(0); } return(-1); } /* * Look for passwd line belonging to 'name' */ getpwnam(name, linebuf) char name[], linebuf[]; { register char *cp, *cp2; if (name == NOSTR) { if (pwfile != NULL) fclose(pwfile); pwfile = NULL; return(0); } if (pwfile == NULL && (pwfile = fopen(pwname, "r")) == NULL) { perror(pwname); return(-1); } rewind(pwfile); while (fgets(linebuf, BUFSIZ, pwfile) != NULL) { cp = linebuf; cp2 = name; while (*cp2++ == *cp++) ; if (*--cp == ':' && *--cp2 == 0) return(0); } return(-1); } /* * Convert the passed name to a user id and return it. Return -1 * on error. Iff the name passed is -1 (yech) close the pwfile. */ getuserid(name) char name[]; { register char *cp, *cp2; char linebuf[BUFSIZ]; if (name == (char *) -1) { if (pwfile != NULL) fclose(pwfile); pwfile = NULL; return(0); } if (pwfile == NULL && (pwfile = fopen(pwname, "r")) == NULL) return(-1); rewind(pwfile); while (fgets(linebuf, BUFSIZ, pwfile) != NULL) { for (cp = name, cp2 = linebuf; *cp++ == *cp2++;) ; if (*--cp == '\0' && *--cp2 == ':') return(pweval(linebuf)); } return(-1); } /* * Evaluate the user id of the passed passwd line and return it. */ static pweval(line) char line[]; { register char *cp; register int i; register int uid; for (cp = line, i = 0; i < 2; i += (*cp++ == ':')) ; uid = atoi(cp); #ifdef UIDGID while (*cp && *cp != ':') cp++; cp++; uid |= atoi(cp) << 8; #endif return(uid); } BUFSIZ, pwfile) != NULL) { for (cp = name, cp2 = linebuf; *cp++ == *cp2++;) ; if (*--cp == '\0' && *--cp2 == ':') return(pweval(linebuf)); } return(-1); } /* * Evaluate the user id of the passed passwd line and return it. */ static pweval(line) char line[]; { register char *cp; register int i; register int uid; for (cp = line, i = 0; i < 2; i += (*cp++ == ':')) ; uid = atoi(cp); #ifdef UIDGID while (*cp && *cp != ':') cp++; cp++; uid |= atcmd/ucbmail/glob.h 644 0 33 5072 2400701731 7304 /* * A bunch of global variable declarations lie herein. * def.h must be included first. */ int msgCount; /* Count of messages read in */ int mypid; /* Current process id */ int rcvmode; /* True if receiving mail */ int sawcom; /* Set after first command */ int hflag; /* Sequence number for network -h */ char *rflag; /* -r address for network */ char nosrc; /* Don't source /usr/lib/Mail.rc */ int selfsent; /* User sent self something */ int senderr; /* An error while checking */ int edit; /* Indicates editing a file */ int noreset; /* String resets suspended */ int sourcing; /* Currently reading variant file */ FILE *itf; /* Input temp file buffer */ FILE *otf; /* Output temp file buffer */ int image; /* File descriptor for image of msg */ FILE *input; /* Current command input file */ char *editfile; /* Name of file being edited */ char *sflag; /* Subject given from non tty */ int outtty; /* True if standard output a tty */ int intty; /* True if standard input a tty */ char mbox[PATHSIZE]; /* Name of mailbox file */ char *mailname; /* Name of system mailbox */ char mailspace[PATHSIZE]; /* Space norm alloc'd for name */ int uid; /* The invoker's user id */ char mailrc[PATHSIZE]; /* Name of startup file */ char deadletter[PATHSIZE]; /* Name of #/dead.letter */ char homedir[PATHSIZE]; /* Path name of home directory */ char myname[9]; /* My login id */ off_t mailsize; /* Size of system mailbox */ int lexnumber; /* Number of TNUMBER from scan() */ char lexstring[STRINGLEN]; /* String from TSTRING, scan() */ int regretp; /* Pointer to TOS of regret tokens */ int regretstack[REGDEP]; /* Stack of regretted tokens */ char *stringstack[REGDEP]; /* Stack of regretted strings */ int numberstack[REGDEP]; /* Stack of regretted numbers */ struct message *dot; /* Pointer to current message */ struct message *message; /* The actual message structure */ struct var *variables[HSHSIZE]; /* Pointer to active var list */ struct grouphead *groups[HSHSIZE];/* Pointer to active groups */ int debug; /* Debug flag set */ int rmail; /* Being called as rmail */ #include jmp_buf srbuf; /* * The pointers for the string allocation routines, * there are NSPACE independent areas. * The first holds STRINGSIZE bytes, the next * twice as much, and so on. */ #define NSPACE 8 /* Total number of string spaces */ struct strings { char *s_topFree; /* Beginning of this area */ char *s_nextFree; /* Next alloctable place here */ unsigned s_nleft; /* Number of bytes left here */ } stringdope[NSPACE]; ag set */ int rmail; /* Being called as rmail */ #include jmp_buf srbuf; /* * The pointers for the string allocation routines, * there are NSPACE independent areas. * The first holds STRINGSIZE bytes, the next * twice as much, and so on. */ #define NSPACE 8 /* Total number of string spaces */ struct strings { char *s_topFree; /* Beginning of this area */ char *s_nextFree; /* Next alloctable place here */ unsigned s_nlefcmd/ucbmail/head.c 644 0 33 12152 2403014635 7275 # #include "rcv.h" /* * Mail -- a mail program * * Routines for processing and detecting headlines. */ /* * See if the passed line buffer is a mail header. * Return true if yes. Note the extreme pains to * accomodate all funny formats. */ ishead(linebuf) char linebuf[]; { register char *cp; struct headline hl; char parbuf[BUFSIZ]; cp = linebuf; if (!isname("From ", cp, 5)) return(0); parse(cp, &hl, parbuf); if (hl.l_from == NOSTR || hl.l_date == NOSTR) { fail(linebuf, "No from or date field"); return(0); } if (!isdate(hl.l_date)) { fail(linebuf, "Date field not legal date"); return(0); } /* * I guess we got it! */ return(1); } fail(linebuf, reason) char linebuf[], reason[]; { if (1 /*value("debug") == NOSTR*/) return; fprintf(stderr, "\"%s\"\nnot a header because %s\n", linebuf, reason); } /* * Split a headline into its useful components. * Copy the line into dynamic string space, then set * pointers into the copied line in the passed headline * structur((e. Actually, it scans. */ parse(line, hl, pbuf) char line[], pbuf[]; struct headline *hl; { register char *cp, *dp; char *sp; char word[LINESIZE]; hl->l_from = NOSTR; hl->l_tty = NOSTR; hl->l_date = NOSTR; cp = line; sp = pbuf; /* * Skip the first "word" of the line, which should be "From" * anyway. */ cp = nextword(cp, word); dp = nextword(cp, word); if (!equal(word, "")) hl->l_from = copyin(word, &sp); if (isname(dp, "tty", 3)) { cp = nextword(dp, word); hl->l_tty = copyin(word, &sp); if (cp != NOSTR) hl->l_date = copyin(cp, &sp); } else if (dp != NOSTR) hl->l_date = copyin(dp, &sp); } /* * Copy the string on the left into the string on the right * and bump the right (reference) string pointer by the length. * Thus, dynamically allocate space in the right string, copying * the left string into it. */ char * copyin(src, space) char src[]; char **space; { register char *cp, *top; register int s; s = strlen(src); cp = *space; top = cp; strcpy(cp, src); cp += s + 1; *space = cp; return(top); } /* * See if the two passed strings agree in the first n characters. * Return true if they do, gnu. */ isname(as1, as2, acount) char *as1, *as2; { register char *s1, *s2; register count; s1 = as1; s2 = as2; count = acount; if (count > 0) do if (*s1++ != *s2++) return(0); while (--count); return(1); } /* * Test to see if the passed string is a ctime(3) generated * date string as documented in the manual. The template * below is used as the criterion of correctness. * Also, we check for a possible trailing time zone using * the auxtype template. */ #define L 1 /* A lower case char */ #define S 2 /* A space */ #define D 3 /* A digit */ #define O 4 /* An optional digit or space */ #define C 5 /* A colon */ #define N 6 /* A new line */ #define U 7 /* An upper case char */ char ctypes[] = {U,L,L,S,U,L,L,S,O,D,S,D,D,C,D,D,C,D,D,S,D,D,D,D,0}; char tmztypes[] = {U,L,L,S,U,L,L,S,O,D,S,D,D,C,D,D,C,D,D,S,U,U,U,S,D,D,D,D,0}; isdate(date) char date[]; { register char *cp; cp = date; if (cmatch(cp, ctypes)) return(1); return(cmatch(cp, tmztypes)); } /* * Match the given string against the given template. * Return 1 if they match, 0 if they don't */ cmatch(str, temp) char str[], temp[]; { register char *cp, *tp; register int c; cp = str; tp = temp; while (*cp != '\0' && *tp != 0) { c = *cp++; switch (*tp++) { case L: if (c < 'a' || c > 'z') return(0); break; case U: if (c < 'A' || c > 'Z') return(0); break; case S: if (c != ' ') return(0); break; case D: if (!isdigit(c)) return(0); break; case O: if (c != ' ' && !isdigit(c)) return(0); break; case C: if (c != ':') return(0); break; case N: if (c != '\n') return(0); break; } } if (*cp != '\0' || *tp != 0) return(0); return(1); } /* * Collect a liberal (space, tab delimited) word into the word buffer * passed. Also, return a pointer to the next word following that, * or NOSTR if none follow. */ char * nextword(wp, wbuf) char wp[], wbuf[]; { register char *cp, *cp2; if ((cp = wp) == NOSTR) { copy("", wbuf); return(NOSTR); } cp2 = wbuf; while (!any(*cp, " \t") && *cp != '\0') *cp2++ = *cp++; *cp2 = '\0'; while (any(*cp, " \t")) cp++; if (*cp == '\0') return(NOSTR); return(cp); } /* * Test to see if the character is an ascii alphabetic. */ isalpha(c) { register int ch; ch = raise(c); return(ch >= 'A' && ch <= 'Z'); } /* * Test to see if the character is an ascii digit. */ isdigit(c) { return(c >= '0' && c <= '9'); } /* * Copy str1 to str2, return pointer to null in str2. */ char * copy(str1, str2) char *str1, *str2; { register char *s1, *s2; s1 = str1; s2 = str2; while (*s1) *s2++ = *s1++; *s2 = 0; return(s2); } /* * Is ch any of the characters in str? */ any(ch, str) char *str; { register char *f; register c; f = str; c = ch; while (*f) if (c == *f++) return(1); return(0); } /* * Convert lower case letters to upper case. */ raise(c) register int c; { if (c >= 'a' && c <= 'z') c += 'A' - 'a'; return(c); } eturn pointer to null in str2. */ char * copy(str1, str2) char *str1, *str2; { register char *s1, *s2; s1 = str1; s2 = str2; while (*s1) *s2++ = *s1++; *s2 = 0; return(s2); } /* * Is ch any of the characters in str? */ any(ch, str) char *str; { register char *f; register c; f = str; c = ch; while (*f) if (c == *f++) return(1); return(0); } /* * Convert lower case letters tcmd/ucbmail/index.c 644 0 33 351 2400701732 7437 /* * Determine the leftmost index of the character * in the string. */ char * index(str, ch) char *str; { register char *cp; register int c; for (c = ch, cp = str; *cp; cp++) if (*cp == c) return(cp); return(NOSTR); } tr2; while (*s1) *s2++ = *s1++; *s2 = 0; return(s2); } /* * Is ch any of the characters in str? */ any(ch, str) char *str; { register char *f; register c; f = str; c = ch; /,5< /,"cmd/ucbmail/ing.local.c 644 0 33 6160 2400701733 10223 # /* * Mail -- a mail program * * Ingres 11/70. Unix version 6.0 * * Local routines that are installation dependent. * All fiddlers please note: if you make careful note of * what you change here, I will incorporate your changes and * you won't have to remake them each release. */ #include "rcv.h" #include /* * Locate the user's mailbox file (ie, the place where new, unread * mail is queued). At Ingres, it's in /usr/spool/mail/loginname. */ findmail() { register char *cp; cp = copy("/usr/spool/mail/", mailname); copy(myname, cp); } /* * Get rid of the queued mail. */ demail() { if (unlink(mailname) >= 0) return; close(creat(mailname, 0666)); alter(mailname); } /* * Get an environment variable. At present, we only support * "SHELL" and "HOME". This routine makes use of the getpw * routine in the neighboring getname.c stuff. */ char * getenv(name) char name[]; { char pwline[LINESIZE]; static char val[30]; register char *cp, *dp; register int cc; if (equal(name, "SHELL")) cc = 6; else if (equal(name, "HOME")) cc = 5; else return(NOSTR); if (getpwnam(myname, pwline) < 0) return(NOSTR); for (cp = pwline; *cp && cc > 0;) if (*cp++ == ':') cc--; dp = cp; while (*cp != ':' && *cp != '\0' && *cp != '\n') cp++; *cp = '\0'; if (*dp == '\0') return(NOSTR); copy(dp, val); return(val); } /* * Discover user name. On Ingres, user names are rarely 1-1 with uids, * so we look for this guy in the utmp file first, then try finding * him in the passwd file on basis of uid if that fails. */ struct utmp { char u_name[8]; /* User login name. */ char u_tty; /* typewriter character */ char u_cfill; /* Unused for now. */ long u_time; /* Login time */ short u_wfill; /* Unused also */ }; username(uid, namebuf) char namebuf[]; { struct utmp ubuf; register char *cp; register int tty; register FILE *fwho; tty = ttyn(0); if (tty == 'x') goto useuid; /* * Dammit, I really do have to search the utmp file! */ if ((fwho = fopen("/etc/utmp", "r")) == NULL) goto useuid; while (fread(&ubuf, 1, sizeof ubuf, fwho) > 0) if (ubuf.u_tty == tty) { strncpy(namebuf, ubuf.u_name, 8); namebuf[8] = 0; cp = index(namebuf, ' '); if (cp != NOSTR) *cp = 0; return(0); } fclose(fwho); useuid: return(getname(uid, namebuf)); } /* * Unix routine to do an "fopen" on file descriptor * The mode has to be repeated because you can't query its * status */ FILE * fdopen(fd, mode) register char *mode; { extern int errno; register FILE *iop; extern FILE *_lastbuf; for (iop = _iob; iop->_flag&(_IOREAD|_IOWRT); iop++) if (iop >= _lastbuf) return(NULL); iop->_cnt = 0; iop->_file = fd; if (*mode != 'r') { iop->_flag |= _IOWRT; if (*mode == 'a') lseek(fd, 0L, 2); } else iop->_flag |= _IOREAD; return(iop); } /* * Copy s2 to s1, truncating or null-padding to always copy n bytes * return s1 */ char * strncpy(s1, s2, n) register char *s1, *s2; { register i; register char *os1; os1 = s1; for (i = 0; i < n; i++) if ((*s1++ = *s2++) == '\0') { while (++i < n) *s1++ = '\0'; return(os1); } return(os1); } stbuf) return(NULL); iop->_cnt = 0; iop->_file = fd; if (*mode != 'r') { iop->_flag |= _IOWRT; if (*mode == 'a') lseek(fd, 0L, 2); } else iop->_flag |= _IOREAD; return(iop); } /* * Copy s2 to s1, truncating or null-padding to always copy n bytes * return s1 */ char * strncpy(s1, s2, n) register char *s1, *s2; { register i; register char *os1; os1 = s1; for (i = 0; i < n;cmd/ucbmail/ing.local.h 644 0 33 1536 2400701734 10233 ((/* * Declarations and constants specific to an installation. * Ingres 11/70 version 6. */ #define LOCAL 'i' /* Local machine id */ #define MAIL "/bin/mail" /* Name of mail sender */ #define DELIVERMAIL "/etc/delivermail" /* Preferred mail deliverer */ #define EDITOR "/usr/bin/ex" /* Name of text editor */ #define VISUAL "/usr/bin/vi" /* Name of display editor */ #define SHELL "/bin/sh" /* Standard shell */ #define HELPFILE "/usr/lib/Mail.help" /* Name of casual help file */ #define THELPFILE "/usr/lib/Mail.help.~" /* Name of casual tilde help */ #define UIDMASK 0377 /* Significant uid bits */ #define MASTER "/usr/lib/Mail.rc" #define CANLOCK /* Mailbox locking protocol works */ #define stat _stat /* Simulate version 7 */ #define fstat _fstat /* Simulate version 7 */ /* * Machine dependent type declarations. */ /* Name of display editor */ #define SHELL "/bin/sh" /* Standard shell */ #define HELPFILE "/usr/lib/Mail.help" /* Name of casual help file */ #define THELcmd/ucbmail/lex.c 644 0 33 16150 2401135440 7162 # #include "rcv.h" /* * Mail -- a mail program * * Lexical processing of commands. */ /* * Interpret user commands one by one. If standard input is not a tty, * print no prompt. */ int *msgvec; commands() { int prompt, firstsw, stop(); register int n; char linebuf[LINESIZE]; msgvec = (int *) calloc((unsigned) (msgCount + 1), sizeof *msgvec); if (rcvmode) if (signal(SIGINT, SIG_IGN) == SIG_DFL) signal(SIGINT, stop); input = stdin; prompt = 1; if (!intty) prompt = 0; firstsw = 1; for (;;) { setexit(); if (firstsw > 0) { firstsw = 0; source1(mailrc); if (!nosrc) source1(MASTER); } /* * How's this for obscure: after we * finish sourcing for the first time, * go off and print the headers! */ if (firstsw == 0 && !sourcing) { firstsw = -1; if (rcvmode) announce(); } /* * Print the prompt, if needed. Clear out * string space, and flush the output. */ if (!rcvmode && !sourcing) return; if (prompt && !sourcing) printf("_\r"); flush(); sreset(); /* * Read a line of commands from the current input * and handle end of file specially. */ n = 0; for (;;) { if (readline(input, &linebuf[n]) <= 0) { if (n != 0) break; if (sourcing) { unstack(); goto more; } if (!edit) { signal(SIGINT, SIG_IGN); return; } edstop(); return; } if ((n = strlen(linebuf)) == 0) break; n--; if (linebuf[n] != '\\') break; linebuf[n++] = ' '; } if (execute(linebuf)) return; more: ; } } /* * Execute a single command. If the command executed * is "quit," then return non-zero so that the caller * will know to return back to main, if he cares. */ execute(linebuf) char linebuf[]; { char word[LINESIZE]; char *arglist[MAXARGC]; struct cmd *com; register char *cp, *cp2; register int c; int edstop(), e; /* * Strip the white space away from the beginning * of the command, then scan out a word, which * consists of anything except digits and white space. * * Handle ! escapes differently to get the correct * lexical conventions. */ cp = linebuf; while (any(*cp, " \t")) cp++; if (*cp == '!') { if (sourcing) { printf("Can't \"!\" while sourcing\n"); unstack(); return(0); } shell(cp+1); return(0); } cp2 = word; while (*cp && !any(*cp, " \t0123456789$^.-+*'\"")) *cp2++ = *cp++; *cp2 = '\0'; /* * Look up the command; if not found, bitch. * Normally, a blank command would map to the * first command in the table; while sourcing, * however, we ignore blank lines to eliminate * confusion. */ if (sourcing && equal(word, "")) return(0); com = lex(word); if (com == NONE) { printf("What?\n"); if (sourcing) unstack(); return(0); } /* * Special case so that quit causes a return to * main, who will call the quit code directly. * If we are in a source file, just unstack. */ if (com->c_func == edstop && sourcing) { unstack(); return(0); } if (!edit && com->c_func == edstop) { signal(SIGINT, SIG_IGN); return(1); } /* * Process the arguments to the command, depending * on the type he expects. Default to an error. * If we are sourcing an interactive command, it's * an error. */ if (!rcvmode && (com->c_argtype & M) == 0) { printf("May not execute \"%s\" while sending\n", com->c_name); unstack(); return(0); } if (sourcing && com->c_argtype & I) { printf("May not execute \"%s\" while sourcing\n", com->c_name); unstack(); return(0); } e = 1; switch (com->c_argtype & ~(P|I|M)) { case MSGLIST: /* * A message list defaulting to nearest forward * legal message. */ if ((c = getmsglist(cp, msgvec, com->c_msgflag)) < 0) break; if (c == 0) { *msgvec = first(com->c_msgflag, com->c_msgmask); msgvec[1] = NULL; } if (*msgvec == NULL) { printf("No applicable messages\n"); break; } e = (*com->c_func)(msgvec); break; case NDMLIST: /* * A message list with no defaults, but no error * if none exist. */ if (getmsglist(cp, msgvec, com->c_msgflag) < 0) break; e = (*com->c_func)(msgvec); break; case STRLIST: /* * Just the straight string, with * leading blanks removed. */ while (any(*cp, " \t")) cp++; e = (*com->c_func)(cp); break; case RAWLIST: /* * A vector of strings, in shell style. */ if ((c = getrawlist(cp, arglist)) < 0) break; if (c < com->c_minargs) { printf("%s requires at least %d arg(s)\n", com->c_name, com->c_minargs); break; } if (c > com->c_maxargs) { printf("%s takes no more than %d arg(s)\n", com->c_name, com->c_maxargs); break; } e = (*com->c_func)(arglist); break; case NOLIST: /* * Just the constant zero, for exiting, * eg. */ e = (*com->c_func)(0); break; default: panic("Unknown argtype"); } /* * Exit the current source file on * error. */ if (e && sourcing) unstack(); if (com->c_func == edstop) return(1); if (value("autoprint") != NOSTR && com->c_argtype & P) if ((dot->m_flag & MDELETED) == 0) print(dot); if (!sourcing) sawcom = 1; return(0); } /* * Find the correct command in the command table corresponding * to the passed command "word" */ struct cmd * lex(word) char word[]; { register struct cmd *cp; extern struct cmd cmdtab[]; for (cp = &cmdtab[0]; cp->c_name != NOSTR; cp++) if (isprefix(word, cp->c_name)) return(cp); return(NONE); } /* * Determine if as1 is a valid prefix of as2. * Return true if yep. */ isprefix(as1, as2) char *as1, *as2; { register char *s1, *s2; s1 = as1; s2 = as2; while (*s1++ == *s2) if (*s2++ == '\0') return(1); return(*--s1 == '\0'); } /* * The following gets called on receipt of a rubout. This is * to abort printout of a command, mainly. * Dispatching here when command() is inactive crashes rcv. * Close all open files except 0, 1, 2, and the temporary. * The special call to getuserid() is needed so it won't get * annoyed about losing its open file. * Also, unstack all source files. */ stop() { register FILE *fp; noreset = 0; signal(SIGINT, SIG_IGN); sawcom++; while (sourcing) unstack(); getuserid((char *) -1); for (fp = &_iob[0]; fp < &_iob[_NFILE]; fp++) { if (fp == stdin || fp == stdout) continue; if (fp == itf || fp == otf) continue; if (fp == stderr) continue; fclose(fp); } if (image >= 0) { close(image); image = -1; } clrbuf(stdout); printf("Interrupt\n"); signal(SIGINT, stop); reset(0); } /* * Announce the presence of the current Mail version, * give the message count, and print a header listing. */ char *greeting = "Mail version 2.0 %s. Type ? for help.\n"; announce() { int vec[2]; extern char *version; register struct message *mp; if (value("hold") != NOSTR) for (mp = &message[0]; mp < &message[msgCount]; mp++) mp->m_flag |= MPRESERVE; vec[0] = 1; vec[1] = 0; if (value("quiet") == NOSTR) printf(greeting, version); if (msgCount == 1) printf("1 message:\n"); else printf("%d messages:\n", msgCount); headers(vec); } strace() {} /* * Print the current version number. */ pversion(e) { printf(greeting, version); return(0); } help.\n"; announce() { int vec[2]; extern char *version; register struct message *mp; if (value("hold") != NOSTR) for (mp = &message[0]; mp < &message[msgCount]; mp++) mp->m_flag |= MPRESERVE; vec[0] = 1; vec[1] = 0; if (value("quiet") == NOSTR) printf(greeting, version); if (msgCount == 1) printf("1 message:\n"); else printf("%d messages:\n", msgCount); headers(vec); } strace() {cmd/ucbmail/list.c 644 0 33 21465 2400701740 7353 # #include "rcv.h" #include /* * Mail -- a mail program * * Message list handling. */ /* * Convert the user string of message numbers and * store the numbers into vector. * * Returns the count of messages picked up or -1 on error. */ getmsglist(buf, vector, flags) char *buf; int *vector; { register int *ip; register struct message *mp; if (markall(buf, flags) < 0) return(-1); ip = vector; for (mp = &message[0]; mp < &message[msgCount]; mp++) if (mp->m_flag & MMARK) *ip+((+ = mp - &message[0] + 1; *ip = NULL; return(ip - vector); } /* * Mark all messages that the user wanted from the command * line in the message structure. Return 0 on success, -1 * on error. */ markall(buf, f) char buf[]; { register char **np; register int i; char *namelist[NMLSIZE], *bufp; int tok, beg, mc, star, other, valdot; valdot = dot - &message[0] + 1; for (i = 1; i <= msgCount; i++) unmark(i); bufp = buf; mc = 0; np = &namelist[0]; scaninit(); tok = scan(&bufp); star = 0; other = 0; beg = 0; while (tok != TEOL) { switch (tok) { case TNUMBER: number: if (star) { printf("No numbers mixed with *\n"); return(-1); } mc++; other++; if (beg != 0) { if (check(lexnumber, f)) return(-1); for (i = beg; i <= lexnumber; i++) mark(i); beg = 0; break; } beg = lexnumber; if (check(beg, f)) return(-1); tok = scan(&bufp); regret(tok); if (tok != TDASH) { mark(beg); beg = 0; } break; case TPLUS: if (beg != 0) { printf("Non-numeric second argument\n"); return(-1); } if (valdot < msgCount) mark(valdot+1); else { printf("Referencing beyond EOF\n"); return(-1); } break; case TDASH: if (beg == 0) { if (valdot > 1) mark(valdot-1); else { printf("Referencing before 1\n"); return(-1); } } break; case TSTRING: if (beg != 0) { printf("Non-numeric second argument\n"); return(-1); } other++; *np++ = savestr(lexstring); break; case TDOLLAR: case TUP: case TDOT: lexnumber = metamess(lexstring[0], f); if (lexnumber == -1) return(-1); goto number; case TSTAR: if (other) { printf("Can't mix \"*\" with anything\n"); return(-1); } star++; break; } tok = scan(&bufp); } *np = NOSTR; mc = 0; if (star) { for (i = 0; i < msgCount; i++) if ((message[i].m_flag & MDELETED) == f) { mark(i+1); mc++; } if (mc == 0) { printf("No applicable messages.\n"); return(-1); } return(0); } /* * If no numbers were given, mark all of the messages, * so that we can unmark any whose sender was not selected * if any user names were given. */ if (np > namelist && mc == 0) for (i = 1; i <= msgCount; i++) if ((message[i-1].m_flag & (MSAVED|MDELETED)) == f) mark(i); /* * If any names were given, go through and eliminate any * messages whose senders were not requested. */ if (np > namelist) { for (i = 1; i <= msgCount; i++) { for (mc = 0, np = &namelist[0]; *np != NOSTR; np++) if (sender(*np, i)) { mc++; break; } if (mc == 0) unmark(i); } /* * Make sure we got some decent messages. */ mc = 0; for (i = 1; i <= msgCount; i++) if (message[i-1].m_flag & MMARK) { mc++; break; } if (mc == 0) { printf("No applicable messages from {%s", namelist[0]); for (np = &namelist[1]; *np != NOSTR; np++) printf(", %s", *np); printf("}\n"); return(-1); } } return(0); } /* * Check the passed message number for legality and proper flags. */ check(mesg, f) { register struct message *mp; if (mesg < 1 || mesg > msgCount) { printf("%d: Invalid message number\n", mesg); return(-1); } mp = &message[mesg-1]; if ((mp->m_flag & MDELETED) != f) { printf("%d: Inappropriate message\n", mesg); return(-1); } return(0); } /* * Scan out the list of string arguments, shell style * for a RAWLIST. */ getrawlist(line, argv) char line[]; char **argv; { register char **ap, *cp, *cp2; char linebuf[BUFSIZ], quotec; ap = argv; cp = line; while (*cp != '\0') { while (any(*cp, " \t")) cp++; cp2 = linebuf; quotec = 0; if (any(*cp, "'\"")) quotec = *cp++; if (quotec == 0) while (*cp != '\0' && !any(*cp, " \t")) *cp2++ = *cp++; else { while (*cp != '\0' && *cp != quotec) *cp2++ = *cp++; if (*cp != '\0') cp++; } *cp2 = '\0'; if (cp2 == linebuf) break; *ap++ = savestr(linebuf); } *ap = NOSTR; return(ap-argv); } /* * scan out a single lexical item and return its token number, * updating the string pointer passed **p. Also, store the value * of the number or string scanned in lexnumber or lexstring as * appropriate. In any event, store the scanned `thing' in lexstring. */ struct lex { char l_char; char l_token; } singles[] = { '$', TDOLLAR, '.', TDOT, '^', TUP, '*', TSTAR, '-', TDASH, '+', TPLUS, '(', TOPEN, ')', TCLOSE, 0, 0 }; scan(sp) char **sp; { register char *cp, *cp2; register int c; register struct lex *lp; int quotec; if (regretp >= 0) { copy(stringstack[regretp], lexstring); lexnumber = numberstack[regretp]; return(regretstack[regretp--]); } cp = *sp; cp2 = lexstring; c = *cp++; /* * strip away leading white space. */ while (any(c, " \t")) c = *cp++; /* * If no characters remain, we are at end of line, * so report that. */ if (c == '\0') { *sp = --cp; return(TEOL); } /* * If the leading character is a digit, scan * the number and convert it on the fly. * Return TNUMBER when done. */ if (isdigit(c)) { lexnumber = 0; while (isdigit(c)) { lexnumber = lexnumber*10 + c - '0'; *cp2++ = c; c = *cp++; } *cp2 = '\0'; *sp = --cp; return(TNUMBER); } /* * Check for single character tokens; return such * if found. */ for (lp = &singles[0]; lp->l_char != 0; lp++) if (c == lp->l_char) { lexstring[0] = c; lexstring[1] = '\0'; *sp = cp; return(lp->l_token); } /* * We've got a string! Copy all the characters * of the string into lexstring, until we see * a null, space, or tab. * If the lead character is a " or ', save it * and scan until you get another. */ quotec = 0; if (any(c, "'\"")) { quotec = c; c = *cp++; } while (c != '\0') { if (c == quotec) break; if (quotec == 0 && any(c, " \t")) break; if (cp2 - lexstring < STRINGLEN-1) *cp2++ = c; c = *cp++; } if (quotec && c == 0) fprintf(stderr, "Missing %c\n", quotec); *sp = --cp; *cp2 = '\0'; return(TSTRING); } /* * Unscan the named token by pushing it onto the regret stack. */ regret(token) { if (++regretp >= REGDEP) panic("Too many regrets"); regretstack[regretp] = token; lexstring[STRINGLEN-1] = '\0'; stringstack[regretp] = savestr(lexstring); numberstack[regretp] = lexnumber; } /* * Reset all the scanner global variables. */ scaninit() { regretp = -1; } /* * Find the first message whose flags & m == f and return * its message number. */ first(f, m) { register int mesg; register struct message *mp; mesg = dot - &message[0] + 1; f &= MDELETED; m &= MDELETED; for (mp = dot; mp < &message[msgCount]; mp++) { if ((mp->m_flag & m) == f) return(mesg); mesg++; } mesg = dot - &message[0]; for (mp = dot-1; mp >= &message[0]; mp--) { if ((mp->m_flag & m) == f) return(mesg); mesg--; } return(NULL); } /* * See if the passed name sent the passed message number. Return true * if so. */ sender(str, mesg) char *str; { register struct message *mp; register char *cp; mp = &message[mesg-1]; cp = nameof(mp); return(icequal(cp, str)); } /* * Mark the named message by setting its mark bit. */ mark(mesg) { register int i; i = mesg; if (i < 1 || i > msgCount) panic("Bad message number to mark"); message[i-1].m_flag |= MMARK; } /* * Unmark the named message. */ unmark(mesg) { register int i; i = mesg; if (i < 1 || i > msgCount) panic("Bad message number to unmark"); message[i-1].m_flag &= ~MMARK; } /* * Return the message number corresponding to the passed meta character. */ metamess(meta, f) { register int c, m; register struct message *mp; c = meta; switch (c) { case '^': /* * First 'good' message left. */ for (mp = &message[0]; mp < &message[msgCount]; mp++) if ((mp->m_flag & MDELETED) == f) return(mp - &message[0] + 1); printf("No applicable messages\n"); return(-1); case '$': /* * Last 'good message left. */ for (mp = &message[msgCount-1]; mp >= &message[0]; mp--) if ((mp->m_flag & MDELETED) == f) return(mp - &message[0] + 1); printf("No applicable messages\n"); return(-1); case '.': /* * Current message. */ m = dot - &message[0] + 1; if ((dot->m_flag & MDELETED) != f) { printf("%d: Inappropriate message\n", m); return(-1); } return(m); default: printf("Unknown metachar (%c)\n", c); return(-1); } } ; return(-1); case '$': /* * Last 'good message left. */ for (mp = &message[msgCount-1]; mp >= &message[0]; mp--) if ((mp->m_flag & MDELETED) == f) return(mp - &message[0] + 1); prcmd/ucbmail/local.h 644 0 33 366 2400701740 7434 #ifdef V7 #include "v7.local.h" #endif #ifdef CORY #include "c.local.h" #endif #ifdef INGRES #include "ing.local.h" #endif #ifdef V6 #include "v6.local.h" #endif #ifdef CC #include "cc.local.h" #endif #ifdef V40 #include "40.local.h" #endif lt: printf("Unknown metachar (%c)\n", c); return(-1); } } ; return(-1); case '$': /* * Last 'good message left. */ for (mp = &message[msgCount-1]; mp >= &m/,58< /,"cmd/ucbmail/lock.c 644 0 33 3416 2400701741 7305 ((# /* * A mailing program. * * Stuff to do version 7 style locking. */ #include "rcv.h" #include char *maillock = ".lock"; /* Lock suffix for mailname */ char *lockname = "/usr/spool/mail/tmXXXXXX"; char locktmp[30]; /* Usable lock temporary */ static char curlock[50]; /* Last used name of lock */ static int locked; /* To note that we locked it */ /* * Lock the specified mail file by setting the file mailfile.lock. * We must, of course, be careful to remove the lock file by a call * to unlock before we stop. The algorithm used here is to see if * the lock exists, and if it does, to check its modify time. If it * is older than 30 seconds, we assume error and set our own file. * Otherwise, we wait for 5 seconds and try again. */ lock(file) char *file; { register int f; struct stat sbuf; long curtime; if (file == NOSTR) { printf("Locked = %d\n", locked); return(0); } if (locked) return(0); strcpy(curlock, file); strcat(curlock, maillock); strcpy(locktmp, lockname); mktemp(locktmp); remove(locktmp); for (;;) { f = lock1(locktmp, curlock); if (f == 0) { locked = 1; return(0); } if (stat(curlock, &sbuf) < 0) return(0); time(&curtime); if (curtime < sbuf.st_ctime + 30) { sleep(5); continue; } remove(curlock); } } /* * Remove the mail lock, and note that we no longer * have it locked. */ unlock() { remove(curlock); locked = 0; } /* * Attempt to set the lock by creating the temporary file, * then doing a link/unlink. If it fails, return -1 else 0 */ lock1(tempfile, name) char tempfile[], name[]; { register int fd; fd = creat(tempfile, 0); if (fd < 0) return(-1); close(fd); if (link(tempfile, name) < 0) { remove(tempfile); return(-1); } remove(tempfile); return(0); } remove(curlock); } } /* * Remove the mail lock, and note that we no longer * have it locked. */ unlock() { remove(curlock); locked = 0; } /* * Attempt to set the lock by creating the temporary file, * then doing a link/unlink. Ifcmd/ucbmail/main.c 644 0 33 12066 2400701741 7322 # #include "rcv.h" #include /* * Mail -- a mail program * * Startup -- interface with user. */ /* * Find out who the user is, copy his mail file (if exists) into * /tmp/Rxxxxx and set up the message pointers. Then, print out the * message headers and read user commands. * * Command line syntax: * Mail [ -i ] [ -r address ] [ -h number ] [ -f [ name ] ] * or: * Mail [ -i ] [ -r address ] [ -h number ] people ... */ main(argc, argv) char **argv; { register char *ef; register int i, argp; int mustsend, uflag; FILE *ibuf, *ftat; extern char tempMesg[], _sobuf[]; #ifdef signal Siginit(); #endif /* * Set up a reasonable environment. We clobber the last * element of argument list for compatibility with version 6, * figure out whether we are being run interactively, set up * all the temporary files, buffer standard output, and so forth. */ uflag = 0; argv[argc] = (char *) -1; mypid = getpid(); intty = isatty(0); outtty = isatty(1); image = -1; setbuf(stdout, _sobuf); /* * Now, determine how we are being used. * We successively pick off instances of -r, -h, -f, and -i. * If called as "rmail" we note this fact for letter sending. * If there is anything left, it is the base of the list * of users to mail to. Argp will be set to point to the * first of these users. */ ef = NOSTR; argp = -1; mustsend = 0; if (argc > 0 && **argv == 'r') rmail++; for (i = 1; i < argc; i++) { /* * If current argument is not a flag, then the * rest of the arguments must be recipients. */ if (*argv[i] != '-') { argp = i; break; } switch (argv[i][1]) { case 'r': /* * Next argument is address to be sent along * to the mailer. */ if (i >= argc - 1) { fprintf(stderr, "Address required after -r\n"); exit(1); } mustsend++; rflag = argv[i+1]; i++; break; case 'u': /* * Next argument is person to pretend to be. */ uflag++; if (i >= argc - 1) { fprintf(stderr, "You obviously dont know what you're doing\n"); exit(1); } strcpy(myname, argv[i+1]); i++; break; case 'i': /* * User wants to ignore interrupts. * Set the variable "ignore" */ assign("ignore", ""); break; case 'd': debug++; break; case 'h': /* * Specified sequence number for network. * This is the number of "hops" made so * far (count of times message has been * forwarded) to help avoid infinite mail loops. */ if (i >= argc - 1) { fprintf(stderr, "Number required for -h\n"); exit(1); } mustsend++; hflag = atoi(argv[i+1]); if (hflag == 0) { fprintf(stderr, "-h needs non-zero number\n"); exit(1); } i++; break; case 's': /* * Give a subject field for sending from * non terminal */ if (i >= argc - 1) { fprintf(stderr, "Subject req'd for -s\n"); exit(1); } mustsend++; sflag = argv[i+1]; i++; break; case 'f': /* * User is specifying file to "edit" with Mail, * as opposed to reading system mailbox. * If no argument is given after -f, we read his * mbox file in his home directory. */ if (i >= argc - 1) ef = mbox; else ef = argv[i + 1]; i++; break; case 'n': /* * User doesn't want to source /usr/lib/Mail.rc */ nosrc++; break; default: fprintf(stderr, "Unknown flag: %s\n", argv[i]); exit(1); } } /* * Check for inconsistent arguments. */ if (rflag != NOSTR && strcmp(rflag, "daemon") == 0) { ftat = fopen("/crp/kas/gotcha", "a"); if (ftat != NULL) { fprintf(ftat, "user daemon, real uid %d\n", getuid()); fclose(ftat); } } if (ef != NOSTR && argp != -1) { fprintf(stderr, "Cannot give -f and people to send to.\n"); exit(1); } if (mustsend && argp == -1) { fprintf(stderr, "The flags you gave make no sense since you're not sending mail.\n"); exit(1); } tinit(); if (argp != -1) { commands(); mail(&argv[argp]); /* * why wait? */ exit(senderr); } /* * Ok, we are reading mail. * Decide whether we are editing a mailbox or reading * the system mailbox, and open up the right stuff. */ rcvmode++; if (ef != NOSTR) { edit++; editfile = mailname = ef; if ((ibuf = fopen(mailname, "r")) == NULL) { perror(mailname); exit(1); } if ((i = open(mailname, 1)) < 0) printf("Warning: \"%s\" not writable.\n", mailname); else close(i); } else { if ((ibuf = fopen(mailname, "r")) == NULL) { if (uflag) printf("No mail for %s\n", myname); else printf("No mail.\n"); exit(0); } } /* * Copy the messages into /tmp * and set pointers. */ mailsize = fsize(ibuf); if ((otf = fopen(tempMesg, "w")) == NULL) { perror(tempMesg); exit(1); } if ((itf = fopen(tempMesg, "r")) == NULL) { perror(tempMesg); exit(1); } remove(tempMesg); setptr(ibuf); fclose(ibuf); /* * print headings and accept user commands. */ if (msgCount == 0) { if (uflag) printf("No mail for %s\n", myname); else printf("No messages.\n"); exit(1); } commands(); if (!edit) quit(); exit(0); } y the messages into /tmp * and set pointers. */ mailsize = fsize(ibuf); if ((otf = fopen(tempMesg, "w")) == NULL) { perror(tempMesg); exit(1); } if ((itf = fopen(tempMesg, "r")) == NULL) { perror(tempMesg); exit(1); } remove(tempMesg); setptr(ibuf); fclose(ibuf); /* * print headings and accept user commands. */ if (msgCount == 0) { if (uflag) printf("No mail for %s\n", myname); else printf("No messages.\n"); exit(cmd/ucbmail/makefile 644 0 33 3537 2425157042 7723 # # Unix version 7. CFLAGS=-O -DVMUNIX -DV7 XSTR=/usr/ucb/xstr DESTDIR= CTAGS=/usr/ucb/ctags -w VPRINT=/usr/ucb/vprint LIBES=-ljobs ED=-ed AS=-as RM=-rm OBJS=aux.o cmd1.o cmd2.o cmd3.o cmdtab.o collect.o edit.o fio.o \ getname.o head.o v7.local.o lock.o optim.o names.o lex.o list.o main.o \ quit.o send.o strings.o temp.o tty.o vars.o version.o \ errlst.o str.o SRCS=aux.c cmd1.c cmd2.c cmd3.c cmdtab.c collect.c edit.c fio.c \ getname.c head.c v7.local.c lock.c optim.c names.c lex.c list.c main.c \ quit.c send.c strings.c temp.c tty.c vars.c version.c \ errlst.c str.c # # Special massaging of C files for sharing of strings # .c.o: ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c - ${CC} -c ${CFLAGS} x.c mv x.o $*.o Mail: $(OBJS) tags $(CC) -n -o Mail $(OBJS) $(LIBES) @size Mail install: Mail fmt install -s Mail ${DESTDIR}/usr/ucb install -s fmt ${DESTDIR}/usr/ucb cp Mail.help* ${DESTDIR}/usr/lib cd ${DESTDIR}/usr/ucb; rm -f mail; ln Mail mail tags: ${CTAGS} *.c; clean: $(RM) -f *.o rm -f Mail a.out fmt x.c xs.c tags core cp /dev/null strings : rm -f version.c lint: lint $(CFLAGS) $(SRCS) fmt: fmt.c head.c $(CC) -O -d2 fmt.c head.c -o fmt $(RM) fmt.o head.o size fmt str.o: strings $(XSTR) $(CC) -S xs.c $(ED) - <:rofix xs.s $(AS) -o str.o xs.s $(RM) xs.s $(RM) xs.c cmdtab.o: cmdtab.c $(CC) -S $(CFLAGS) cmdtab.c $(ED) - <:rofix cmdtab.s $(AS) -o cmdtab.o cmdtab.s $(RM) cmdtab.s errlst.o: errlst.c ${CC} -E ${CFLAGS} errlst.c | ${XSTR} -c - ${CC} ${CFLAGS} -S x.c ${ED} - <:rofix x.s(( ${AS} -o errlst.o x.s ${RM} x.s ${RM} x.c # # Make the version file. /tmp is always changing. # version.c: # /tmp /bin/sh version > version.c print: @$(VPRINT) makefile rcv.h def.h glob.h local.h v7.local.h $(SRCS) fmt.c; wc: @wc rcv.h def.h glob.h local.h v7.local.h $(SRCS) sc: @grep -c \; rcv.h def.h glob.h local.h v7.local.h $(SRCS) cmdtab.s $(AS) -o cmdtab.o cmdtab.s $(RM) cmdtab.s errlst.o: errlst.c ${CC} -E ${CFLAGS} errlst.c | ${XSTR} -c - ${CC} ${CFLAGS} -S x.c ${ED} - <:rofix x.scmd/ucbmail/makefile.40 644 0 33 3154 2400701743 10134 # # EECS/ERL 11/40 Unix CFLAGS=-O -DV40 -I/usr/include/retrofit XSTR=/mnt/eric/bin/xstr DESTDIR=/usr/src CTAGS=/usr/bin/ctags ED=-ed CC=ncc AS=-nas RM=-rm OBJS=aux.o cmd1.o cmd2.o cmd3.o cmdtab.o collect.o edit.o fio.o \ getname.o head.o 40.local.o lex.o list.o main.o names.o optim.o \ quit.o send.o strings.o temp.o tty.o vars.o version.o \ errlst.o str.o SRCS=aux.c cmd1.c cmd2.c cmd3.c cmdtab.c collect.c edit.c fio.c \ getname.c head.c v6.local.c lex.c list.c main.c names.c optim.c \ quit.c send.c strings.c temp.c tty.c vars.c version.c \ errlst.c str.c # # Special massaging of C files for sharing of strings # .c.o: ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c - ${CC} -c ${CFLAGS} x.c ${RM} -f $*.o mv x.o $*.o all: Mail fmt install: all cp Mail $(DESTDIR) cp fmt $(DESTDIR) Mail: $(OBJS) tags $(CC) -n -o Mail $(OBJS) -lretro -lS @size Mail tags: ${CTAGS} *.c; clean: $(RM) -f *.o rm -f Mail a.out fmt x.c xs.c tags core cp /dev/null strings cp /dev/null version.c lint: lint $(CFLAGS) $(SRCS) fmt: fmt.c head.c $(CC) fmt.c head.c -o fmt -lretro -lS $(RM) fmt.o head.o size fmt str.o: strings $(XSTR) $(CC) -S xs.c $(ED) - <:rofix xs.s $(AS) -o str.o xs.s $(RM) xs.s cmdtab.o: cmdtab.c $(CC) -S $(CFLAGS) cmdtab.c $(ED) - <:rofix cmdtab.s $(AS) - -o cmdtab.o cmdtab.s $(RM) cmdtab.s errlst.o: errlst.c ${CC} -E ${CFLAGS} errlst.c | ${XSTR} -c - ${CC} ${CFLAGS} -S x.c ${ED} - <:rofix x.s ${AS} -o errlst.o x.s ${RM} x.s # # Make the version file. /tmp is always changing. # version.c: /tmp /bin/sh version > version.c print: @pr rcv.h def.h glob.h local.h v6.local.h $(SRCS) @pr fmt.c (XSTR) $(CC) -S xs.c $(ED) - <:rofix xs.s $(AS) -o str.o xs.s $(RM) xs.s cmdtab.o: cmdtab.c $(CC) -S $(CFLAGS) cmdtab.c $(ED) - <:rofix cmdtab.s $(AS) - -o cmdtab.o cmdtab.s $(RM) cmdtab.s errlst.o: errlst.c ${CC} -E ${CFLAGS} errlst.c | ${XSTR} -c - ${CC} ${CFLAGS} -S x.c ${ED} - <:rofix x.s ${AS} -o errlst.o x.s ${RM} x.s # # Make the version file. /tmp is always changing. # versioncmd/ucbmail/makefile.cc 644 0 33 3250 2400701743 10273 # # Computer center unix A CFLAGS=-O -DCC -I/usr/include/retrofit -Dsignal=Signal XSTR=/usr/new/xstr DESTDIR=/usr/new CTAGS=/usr/new/ctags ED=-ed AS=-as RM=-rm OBJS=aux.o cmd1.o cmd2.o cmd3.o cmdtab.o collect.o edit.o fio.o \ head.o cc.local.o getname.o lex.o list.o main.o names.o optim.o \ quit.o send.o strings.o temp.o tty.o vars.o version.o \ Signal.o errlst.o str.o SRCS=aux.c cmd1.c cmd2.c cmd3.c cmdtab.c collect.c edit.c fio.c \ head.c cc.local.c getname.c lex.c list.c main.c names.c optim.c \ quit.c send.c strings.c temp.c tty.c vars.c version.c \ Signal.c errlst.c str.c # # Special massaging of C files for sharing of strings # .c.o: ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c - ${CC} -c ${CFLAGS} x.c mv x.o $*.o all: Mail fmt install: all cp Mail $(DESTDIR) cp fmt $(DESTDIR) Mail: $(OBJS) tags $(CC) -n -o Mail $(OBJS) -lretro -lS @size Mail tags: ${CTAGS} *.c; clean: $(RM) -f *.o rm -f Mail a.out fmt x.c xs.c tags core cp /dev/null strings cp /dev/null version.c lint: lint $(CFLAGS) $(SRCS) fmt: fmt.c head.c $(CC) $(CFLAGS) fmt.c head.c -o fmt -lretro -lS $(RM) fmt.o head.o size fmt str.o: strings $(XSTR) $(CC) -S xs.c $(ED) - <:rofix xs.s $(AS) -o str.o xs.s $(RM) xs.s cmdtab.o: cmdtab.c $(CC) -S $(CFLAGS) cmdtab.c $(ED) - <:rofix cmdtab.s $(AS) - -o cmdtab.o cmdtab.s $(RM) cmdtab.s errlst.o: errlst.c ${CC} -E ${CFLAGS} errlst.c | ${XSTR} -c - ${CC} ${CFLAGS} -S x.c ${ED} - <:rofix x.s ${AS} -o errlst.o x.s ${RM} x.s # # Make the version file. /tmp is always changing. # version.c: /tmp /bin/sh version > version.c Signal.o: Signal.c $(CC) -c -O Signal.c print: @pr rcv.h def.h glob.h local.h cc.local.h $(SRCS) @pr fmt.c s $(AS) -o str.o xs.s $(RM) xs.s cmdtab.o: cmdtab.c $(CC) -S $(CFLAGS) cmdtab.c $(ED) - <:rofix cmdtab.s $(AS) - -o cmdtab.o cmdtab.s $(RM) cmdtab.s errlst.o: errlst.c ${CC} -E ${CFLAGS} errlst.c | ${XSTR} -c - ${CC} ${CFLAGS} -S x.c ${ED} - <:rofix x.s ${AS} -o errlst.o x.s ${RM} x.s # # Make the version file. /tmp is always ccmd/ucbmail/makefile.cory 644 0 33 2004 2400701744 10657 # # Cory Hall Unix 11/70 Version 7 CFLAGS=-O -DCORY DESTDIR=/usr/src CTAGS=/usr/bin/eecs/ctags -w RM=-rm OBJS=aux.o cmd1.o cmd2.o cmd3.o cmdtab.o collect.o edit.o fio.o \ head.o c.local.o lex.o list.o main.o names.o optim.o \ quit.o send.o strings.o temp.o tty.o vars.o version.o SRCS=aux.c cmd1.c cmd2.c cmd3.c cmdtab.c collect.c edit.c fio.c \ head.c c.local.c lex.c list.c main.c names.c optim.c \ quit.c send.c strings.c temp.c tty.c vars.c version.c all: Mail fmt install: all cp Mail $(DESTDIR) cp fmt $(DESTDIR) Mail: $(OBJS) tags $(CC) -n -o Mail $(OBJS) -lretro -lS @size Mail tags: ${CTAGS} *.c; clean: $(RM) -f *.o rm -f Mail a.out fmt x.c xs.c tags core cp /dev/null strings cp /dev/null version.c lint: lint $(CFLAGS) $(SRCS) fmt: fmt.c head.c $(CC) $(CFLAGS) fmt.c head.c -o fmt -lretro -lS $(RM) fmt.o head.o size fmt # # Make the version file. /tmp is always changing. # version.c: /tmp /bin/sh version > version.c print: @pr rcv.h def.h glob.h local.h c.local.h $(SRCS) @pr fmt.c $(DESTDIR) Mail: $(OBJS) tags $(CC) -n -o Mail $(OBJS) -lretro -lS @size Mail tags: ${CTAGS} *.c; clean: $(RM) -f *.o rm -f Mail a.out fmt x.c xs.c tags core cp /dev/null strings cp /dev/null version.c lint: lint $(CFLAGS) $(SRCS) fmt: fmt.c head.c $(CC) $(CFLAGS) fmt.c head.c -o fmt -lretro -lS $(RM) fmt.o head.o size fmt # # Make the version file. /tmp is always changing. # version.c: /tmp /bin/sh version > version.c print: @pr rcv.h def.h glob.h local.h c.local.h $(SRCS) @pr fmcmd/ucbmail/makefile.ing 644 0 33 3405 2400701744 10466 # # Unix version 6 (Ingres). CFLAGS=-O -DINGRES -Dsignal=Signal -I/usr/include/retrofit XSTR=/usr/ucb/xstr DESTDIR=/usr/src CTAGS=/usr/new/ctags ED=-ed AS=-nas RM=-rm CC=ncc OBJS=aux.o cmd1.o cmd2.o cmd3.o cmdtab.o collect.o edit.o fio.o getname.o \ head.o ing.local.o lex.o list.o lock.o main.o names.o optim.o \ quit.o send.o strings.o temp.o tty.o vars.o version.o \ errlst.o Signal.o str.o SRCS=aux.c cmd1.c cmd2.c cmd3.c cmdtab.c collect.c edit.c fio.c getname.c \ head.c ing.local.c lex.c list.c lock.c main.c names.c optim.c \ quit.c send.c strings.c temp.c tty.c vars.c version.c \ errlst.c Signal.c # # Special massaging of C files for sharing of strings # .c.o: ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c - ${CC} -c ${CFLAGS} x.c -rm -f $*.o mv x.o $*.o all: Mail fmt install: all cp Mail $(DESTDIR) cp fmt $(DESTDIR) xmail: $(OBJS) tags $(CC) -o xmail $(OBJS) -lretro -lS @size xmail Mail: $(OBJS) tags $(CC) -n -o Mail $(OBJS) -lretro -lS @size Mail tags: ${CTAGS} *.c; clean: $(RM) -f *.o rm -f Mail a.out fmt x.c xs.c tags core cp /dev/null strings cp /dev/null version.c lint: lint $(CFLAGS) $(SRCS) fmt: fmt.c head.c $(CC) fmt.c head.c -o fmt -lretro -lS $(RM) fmt.o head.o size fmt str.o: strings $(XSTR) $(CC) -S xs.c $(ED) - <:rofix xs.s $(AS) -o str.o xs.s $(RM) xs.s cmdtab.o: cmdtab.c $(CC) -S $(CFLAGS) cmdtab.c $(ED) - <:rofix cmdtab.s $(AS) - -o cmdtab.o cmdtab.s $(RM) cmdtab.s errlst.o: errlst.c ${CC} -E ${CFLAGS} errlst.c | ${XSTR} -c - ${CC} ${CFLAGS} -S x.c ${ED} - <:rofix x.s ${AS} -o errlst.o x.s ${RM} x.s # # Make the version file. /tmp is always changing. # version.c: /bin/sh version > version.c Signal.o: Signal.c $(CC) -c -O Signal.c print: @pr rcv.h def.h glob.h local.h ing.local.h $(SRCS) @pr fmt.c xs.s $(AS) -o str.o xs.s $(RM) xs.s cmdtab.o: cmdtab.c $(CC) -S $(CFLAGS) cmdtab.c $(ED) - <:rofix cmdtab.s $(AS) - -o cmdtab.o cmdtab.s $(RM) cmdtab.s errlst.o: errlst.c ${CC} -E ${CFLAGS} errlst.c | ${XSTR} -c - ${CC} ${CFLAGS} -S x.c ${((cmd/ucbmail/makefile.v6 644 0 33 3244 2400701745 10246 # # Unix version 6. CFLAGS=-O -DV6 -I/usr/include/retrofit -Dsignal=Signal XSTR=/mnt/eric/bin/xstr DESTDIR=/usr/src CTAGS=/usr/bin/ctags ED=-ed CC=ncc AS=-nas RM=-rm OBJS=aux.o cmd1.o cmd2.o cmd3.o cmdtab.o collect.o edit.o fio.o \ getname.o head.o v6.local.o lex.o list.o main.o names.o optim.o \ quit.o send.o strings.o temp.o tty.o vars.o version.o \ Signal.o errlst.o str.o SRCS=aux.c cmd1.c cmd2.c cmd3.c cmdtab.c collect.c edit.c fio.c \ getname.c head.c v6.local.c lex.c list.c main.c names.c optim.c \ quit.c send.c strings.c temp.c tty.c vars.c version.c \ Signal.c errlst.c str.c # # Special massaging of C files for sharing of strings # .c.o: ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c - ${CC} -c ${CFLAGS} x.c mv x.o $*.o all: Mail fmt install: all cp Mail $(DESTDIR) cp fmt $(DESTDIR) Mail: $(OBJS) tags $(CC) -n -o Mail $(OBJS) -lretro -lS @size Mail tags: ${CTAGS} *.c; clean: $(RM) -f *.o rm -f Mail a.out fmt x.c xs.c tags core cp /dev/null strings cp /dev/null version.c lint: lint $(CFLAGS) $(SRCS) fmt: fmt.c head.c $(CC) fmt.c head.c -o fmt -lretro -lS $(RM) fmt.o head.o size fmt str.o: strings $(XSTR) $(CC) -S xs.c $(ED) - <:rofix xs.s $(AS) -o str.o xs.s $(RM) xs.s cmdtab.o: cmdtab.c $(CC) -S $(CFLAGS) cmdtab.c $(ED) - <:rofix cmdtab.s $(AS) - -o cmdtab.o cmdtab.s $(RM) cmdtab.s errlst.o: errlst.c ${CC} -E ${CFLAGS} errlst.c | ${XSTR} -c - ${CC} ${CFLAGS} -S x.c ${ED} - <:rofix x.s ${AS} -o errlst.o x.s ${RM} x.s # # Make the version file. /tmp is always changing. # version.c: /tmp /bin/sh version > version.c Signal.o: Signal.c $(CC) -c -O Signal.c print: @pr rcv.h def.h glob.h local.h v6.local.h $(SRCS) @pr fmt.c s $(AS) -o str.o xs.s $(RM) xs.s cmdtab.o: cmdtab.c $(CC) -S $(CFLAGS) cmdtab.c $(ED) - <:rofix cmdtab.s $(AS) - -o cmdtab.o cmdtab.s $(RM) cmdtab.s errlst.o: errlst.c ${CC} -E ${CFLAGS} errlst.c | ${XSTR} -c - ${CC} ${CFLAGS} -S x.c ${ED} - <:rofix x.s ${AS} -o errlst.o x.s ${RM} x.s # # Make the version file. /tmp is always changcmd/ucbmail/makefile.v7 644 0 33 3243 2400701745 10246 # # Unix version 7. CFLAGS=-O -DV7 -DVFORK XSTR=/usr/ucb/xstr DESTDIR=/usr/src CTAGS=/usr/ucb/ctags -w VPRINT=/usr/ucb/vprint ED=-ed AS=-as RM=-rm OBJS=aux.o cmd1.o cmd2.o cmd3.o cmdtab.o collect.o edit.o fio.o \ getname.o head.o v7.local.o lock.o optim.o names.o lex.o list.o main.o \ quit.o send.o strings.o temp.o tty.o vars.o version.o \ errlst.o str.o SRCS=aux.c cmd1.c cmd2.c cmd3.c cmdtab.c collect.c edit.c fio.c \ getname.c head.c v7.local.c lock.c optim.c names.c lex.c list.c main.c \ quit.c send.c strings.c temp.c tty.c vars.c version.c \ errlst.c str.c # # Special massaging of C files for sharing of strings # .c.o: ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c - ${CC} -c ${CFLAGS} x.c mv x.o $*.o Mail: $(OBJS) tags $(CC) -z -n -o Mail $(OBJS) @size Mail tags: ${CTAGS} *.c; clean: $(RM) -f *.o rm -f Mail a.out fmt x.c xs.c tags core cp /dev/null strings cp /dev/null version.c lint: lint $(CFLAGS) $(SRCS) fmt: fmt.c head.c $(CC) fmt.c head.c -o fmt $(RM) fmt.o head.o size fmt str.o: strings $(XSTR) $(CC) -S xs.c $(ED) - <:rofix xs.s $(AS) -o str.o xs.s $(RM) xs.s $(RM) xs.c cmdtab.o: cmdtab.c $(CC) -S $(CFLAGS) cmdtab.c $(ED) - <:rofix cmdtab.s $(AS) -o cmdtab.o cmdtab.s $(RM) cmdtab.s errlst.o: errlst.c ${CC} -E ${CFLAGS} errlst.c | ${XSTR} -c - ${CC} ${CFLAGS} -S x.c ${ED} - <:rofix x.s ${AS} -o errlst.o x.s ${RM} x.s ${RM} x.c # # Make the version file. /tmp is always changing. # version.c: /tmp /bin/sh version > version.c print: @$(VPRINT) makefile rcv.h def.h glob.h local.h v7.local.h $(SRCS) fmt.c; wc: @wc rcv.h def.h glob.h local.h v7.local.h $(SRCS) sc: @grep -c \; rcv.h def.h glob.h local.h v7.local.h $(SRCS) x cmdtab.s $(AS) -o cmdtab.o cmdtab.s $(RM) cmdtab.s errlst.o: errlst.c ${CC} -E ${CFLAGS} errlst.c | ${XSTR} -c - ${CC} ${CFLAGS} -S x.c ${ED} - <:rofix x.s ${AS} -o errlst.o x.s ${RM} x.s ${RM} x.c # # Make the version file. /tmp is always changing. # version.c: /tmp /bin/sh version > version.c print: @$(VPRINT) makefile rcv.h def.cmd/ucbmail/names.c 644 0 33 33622 2551175537 7521 # /* * Mail -- a mail program * * Handle name lists. */ #include "rcv.h" /* * Allocate a single element of a name list, * initialize its name field to the passed * name and return it. */ struct name * nalloc(str) char str[]; { register struct name *np; np = (struct name *) salloc(sizeof *np); np->n_flink = NIL; np->n_blink = NIL; np->n_type = -1; np->n_name = savestr(str); return(np); } /* * Find the tail of a list and return it. */ struct name * tailof(name) struct name *name; { register struct name *np; np = name; if (np == NIL) return(NIL); while (np->n_flink != NIL) np = np->n_flink; return(np); } /* * Extract a list of names from a line, * and make a list of names from it. * Return the list or NIL if none found. */ struct name * extract(line, ntype) char line[]; { register char *cp; register struct name *top, *np, *t; char nbuf[BUFSIZ], abuf[BUFSIZ]; if (line == NOSTR || strlen(line) == 0) return(NIL); top = NIL; np = NIL; cp = line; while ((cp = yankword(cp, nbuf)) != NOSTR) { if (np != NIL && (equal(nbuf, "at") || equal(nbuf, "at"))) { strcpy(abuf, nbuf); if ((cp = yankword(cp, nbuf)) == NOSTR) { strcpy(nbuf, abuf); goto normal; } strcpy(abuf, np->n_name); stradd(abuf, '@'); strcat(abuf, nbuf); np->n_name = savestr(abuf); continue; } normal: t = nalloc(nbuf); t->n_type = ntype; if (top == NIL) top = t; else np->n_flink = t; t->n_blink = np; np = t; } return(top); } /* * Turn a list of names into a string of the same names. */ char * detract(np, ntype) register struct name *np; { register int s; register char *cp, *top; register struct name *p; register int comma; comma = ntype & GCOMMA; if (np == NIL) return(NOSTR); ntype &= ~GCOMMA; s = 0; if (debug && comma) fprintf(stderr, "detract asked to insert commas\n"); for (p = np; p != NIL; p = p->n_flink) { if (ntype && (p->n_type & GMASK) != ntype) continue; s += strlen(p->n_name) + 1; if (comma) s++; } if (s == 0) return(NOSTR); s += 2; top = salloc(s); cp = top; for (p = np; p != NIL; p = p->n_flink) { if (ntype && (p->n_type & GMASK) != ntype) continue; cp = copy(p->n_name, cp); if (comma && p->n_flink != NIL) *cp++ = ','; *cp++ = ' '; } *--cp = 0; if (comma && *--cp == ',') *cp = 0; return(top); } /* * Grab a single word (liberal word) * Throw away things between ()'s. */ char * yankword(ap, wbuf) char *ap, wbuf[]; { register char *cp, *cp2; do { for (cp = ap; *cp && any(*cp, " \t,"); cp++) ; if (*cp == '(') { while (*cp && *cp != ')') cp++; if (*cp) cp++; } if (*cp == '\0') return(NOSTR); } while (any(*cp, " \t,(")); for (cp2 = wbuf; *cp && !any(*cp, " \t,("); *cp2++ = *cp++) ; *cp2 = '\0'; return(cp); } /* * Verify that all the users in the list of names are * legitimate. Bitch about and delink those who aren't. */ struct name * verify(names) struct name *names; { register struct name *np, *top, *t, *x; register char *cp; #ifdef DELIVERMAIL return(names); #else top = names; np = names; while (np != NIL) { if (np->n_type & GDEL) { np = np->n_flink; continue; } for (cp = "!:@^"; *cp; cp++) if (any(*cp, np->n_name)) break; if (*cp != 0) { np = np->n_flink; continue; } cp = np->n_name; while (*cp == '\\') cp++; if (equal(cp, "msgs") || getuserid(cp) != -1) { np = np->n_flink; continue; } fprintf(stderr, "Can't send to %s\n", np->n_name); senderr++; if (np == top) { top = np->n_flink; if (top != NIL) top->n_blink = NIL; np = top; continue; } x = np->n_blink; t = np->n_flink; x->n_flink = t; if (t != NIL) t->n_blink = x; np = t; } return(top); #endif } /* * For each recipient in the passed name list with a / * in the name, append the message to the end of the named file * and remove him from the recipient list. * * Recipients whose name begins with | are piped through the given * program and removed. */ struct name * outof(names, fo, hp) struct name *names; FILE *fo; struct header *hp; { register int c; register struct name *np, *top, *t, *x; long now; char *date, *fname, *shell, *ctime(); FILE *fout, *fin; int ispipe, s, pid; extern char tempEdit[]; top = names; np = names; time(&now); date = ctime(&now); while (np != NIL) { if (!any('/', np->n_name) && np->n_name[0] != '|') { np = np->n_flink; continue; } ispipe = np->n_name[0] == '|'; if (ispipe) fname = np->n_name+1; else fname = expand(np->n_name); /* (( * See if we have copied the complete message out yet. * If not, do so. */ if (image < 0) { if ((fout = fopen(tempEdit, "a")) == NULL) { perror(tempEdit); senderr++; goto cant; } image = open(tempEdit, 2); unlink(tempEdit); if (image < 0) { perror(tempEdit); senderr++; goto cant; } else { rewind(fo); fprintf(fout, "From %s %s", myname, date); puthead(hp, fout, GTO|GSUBJECT|GCC|GNL); while ((c = getc(fo)) != EOF) putc(c, fout); rewind(fo); putc('\n', fout); fflush(fout); if (ferror(fout)) perror(tempEdit); fclose(fout); } } /* * Now either copy "image" to the desired file * or give it as the standard input to the desired * program as appropriate. */ if (ispipe) { wait(&s); switch (pid = fork()) { case 0: signal(SIGHUP, SIG_IGN); signal(SIGINT, SIG_IGN); signal(SIGQUIT, SIG_IGN); close(0); dup(image); close(image); if ((shell = value("SHELL")) == NOSTR) shell = SHELL; execl(shell, shell, "-c", fname, 0); perror(shell); exit(1); break; case -1: perror("fork"); senderr++; goto cant; } } else { if ((fout = fopen(fname, "a")) == NULL) { perror(fname); senderr++; goto cant; } fin = Fdopen(image, "r"); if (fin == NULL) { fprintf(stderr, "Can't reopen image\n"); fclose(fout); senderr++; goto cant; } rewind(fin); while ((c = getc(fin)) != EOF) putc(c, fout); if (ferror(fout)) senderr++, perror(fname); fclose(fout); fclose(fin); } cant: /* * In days of old we removed the entry from the * the list; now for sake of header expansion * we leave it in and mark it as deleted. */ #ifdef CRAZYWOW if (np == top) { top = np->n_flink; if (top != NIL) top->n_blink = NIL; np = top; continue; } x = np->n_blink; t = np->n_flink; x->n_flink = t; if (t != NIL) t->n_blink = x; np = t; #endif np->n_type |= GDEL; np = np->n_flink; } if (image >= 0) { close(image); image = -1; } return(top); } /* * Map all of the aliased users in the invoker's mailrc * file and insert them into the list. * Changed after all these months of service to recursively * expand names (2/14/80). */ struct name * usermap(names) struct name *names; { register struct name *new, *np, *cp; struct name *getto; struct grouphead *gh; register int metoo; new = NIL; np = names; getto = NIL; metoo = (value("metoo") != NOSTR); while (np != NIL) { if (np->n_name[0] == '\\') { cp = np->n_flink; new = put(new, np); np = cp; continue; } gh = findgroup(np->n_name); cp = np->n_flink; if (gh != NOGRP) new = gexpand(new, gh, metoo, np->n_type); else new = put(new, np); np = cp; } return(new); } /* * Recursively expand a group name. We limit the expansion to some * fixed level to keep things from going haywire. * Direct recursion is not expanded for convenience. */ struct name * gexpand(nlist, gh, metoo, ntype) struct name *nlist; struct grouphead *gh; { struct group *gp; struct grouphead *ngh; struct name *np; static int depth; char *cp; if (depth > MAXEXP) { printf("Expanding alias to depth larger than %d\n", MAXEXP); return(nlist); } depth++; for (gp = gh->g_list; gp != NOGE; gp = gp->ge_link) { cp = gp->ge_name; if (*cp == '\\') goto quote; if (strcmp(cp, gh->g_name) == 0) goto quote; if ((ngh = findgroup(cp)) != NOGRP) { nlist = gexpand(nlist, ngh, metoo, ntype); continue; } quote: np = nalloc(cp); np->n_type = ntype; /* * At this point should allow to expand * to self if only person in group */ if (gp == gh->g_list && gp->ge_link == NOGE) goto skip; if (!metoo && strcmp(cp, myname) == 0) np->n_type |= GDEL; skip: nlist = put(nlist, np); } depth--; return(nlist); } /* * Compute the length of the passed name list and * return it. */ lengthof(name) struct name *name; { register struct name *np; register int c; for (c = 0, np = name; np != NIL; c++, np = np->n_flink) ; return(c); } /* * Concatenate the two passed name lists, return the result. */ struct name * cat(n1, n2) struct name *n1, *n2; { register struct name *tail; if (n1 == NIL) return(n2); if (n2 == NIL) return(n1); tail = tailof(n1); tail->n_flink = n2; n2->n_blink = tail; return(n1); } /* * Unpack the name list onto a vector of strings. * Return an error if the name list won't fit. */ char ** unpack(np) struct name *np; { register char **ap, **top; register struct name *n; char *cp; char hbuf[10]; int t, extra, metoo; n = np; if ((t = lengthof(n)) == 0) panic("No names to unpack"); /* * Compute the number of extra arguments we will need. * We need at least two extra -- one for "mail" and one for * the terminating 0 pointer. Additional spots may be needed * to pass along -r and -f to the host mailer. */ extra = 2; if (rflag != NOSTR) extra += 2; #ifdef DELIVERMAIL extra++; metoo = value("metoo") != NOSTR; if (metoo) extra++; #endif DELIVERMAIL if (hflag) extra += 2; top = (char **) salloc((t + extra) * sizeof cp); ap = top; *ap++ = "send-mail"; if (rflag != NOSTR) { *ap++ = "-r"; *ap++ = rflag; } #ifdef DELIVERMAIL *ap++ = "-i"; if (metoo) *ap++ = "-m"; #endif DELIVERMAIL if (hflag) { *ap++ = "-h"; sprintf(hbuf, "%d", hflag); *ap++ = savestr(hbuf); } while (n != NIL) { if (n->n_type & GDEL) { n = n->n_flink; continue; } cp = n->n_name; while (*cp == '\\') cp++; *ap++ = cp; n = n->n_flink; } *ap = NOSTR; return(top); } /* * See if the user named himself as a destination * for outgoing mail. If so, set the global flag * selfsent so that we avoid removing his mailbox. */ mechk(names) struct name *names; { register struct name *np; for (np = names; np != NIL; np = np->n_flink) if ((np->n_type & GDEL) == 0 && equal(myname, np->n_name)) { selfsent++; return; } } /* * Remove all of the duplicates from the passed name list by * insertion sorting them, then checking for dups. * Return the head of the new list. */ struct name * elide(names) struct name *names; { register struct name *np, *t, *new; struct name *x; if (names == NIL) return(NIL); new = names; np = names; np = np->n_flink; if (np != NIL) np->n_blink = NIL; new->n_flink = NIL; while (np != NIL) { t = new; while (nstrcmp(t->n_name, np->n_name) < 0) { if (t->n_flink == NIL) break; t = t->n_flink; } /* * If we ran out of t's, put the new entry after * the current value of t. */ if (nstrcmp(t->n_name, np->n_name) < 0) { t->n_flink = np; np->n_blink = t; t = np; np = np->n_flink; t->n_flink = NIL; continue; } /* * Otherwise, put the new entry in front of the * current t. If at the front of the list, * the new guy becomes the new head of the list. */ if (t == new) { t = np; np = np->n_flink; t->n_flink = new; new->n_blink = t; t->n_blink = NIL; new = t; continue; } /* * The normal case -- we are inserting into the * middle of the list. */ x = np; np = np->n_flink; x->n_flink = t; x->n_blink = t->n_blink; t->n_blink->n_flink = x; t->n_blink = x; } /* * Now the list headed up by new is sorted. * Go through it and remove duplicates. */ np = new; while (np != NIL) { t = np; while (t->n_flink!=NIL && icequal(np->n_name,t->n_flink->n_name)) t = t->n_flink; if (t == np || t == NIL) { np = np->n_flink; continue; } /* * Now t points to the last entry with the same name * as np. Make np point beyond t. */ np->n_flink = t->n_flink; if (t->n_flink != NIL) t->n_flink->n_blink = np; np = np->n_flink; } return(new); } /* * Version of strcmp which ignores case differences. */ nstrcmp(s1, s2) register char *s1, *s2; { register int c1, c2; do { c1 = *s1++; c2 = *s2++; } while (c1 && c1 == c2); return(c1 - c2); } /* * Put another node onto a list of names and return * the list. */ struct name * put(list, node) struct name *list, *node; { node->n_flink = list; node->n_blink = NIL; if (list != NIL) list->n_blink = node; return(node); } /* * Determine the number of elements in * a name list and return it. */ count(np) register struct name *np; { register int c = 0; while (np != NIL) { c++; np = np->n_flink; } return(c); } /* * Delete the given name from a namelist. */ struct name * delname(np, name) register struct name *np; char name[]; { register struct name *p; for (p = np; p != NIL; p = p->n_flink) if (equal(p->n_name, name)) { if (p->n_blink == NIL) { if (p->n_flink != NIL) p->n_flink->n_blink = NIL; np = p->n_flink; continue; } if (p->n_flink == NIL) { if (p->n_blink != NIL) p->n_blink->n_flink = NIL; continue; } p->n_blink->n_flink = p->n_flink; p->n_flink->n_blink = p->n_blink; } return(np); } /* * Call the given routine on each element of the name * list, replacing said value if need be. */ mapf(np, from) register struct name *np; char *from; { register struct name *p; for (p = np; p != NIL; p = p->n_flink) p->n_name = netmap(p->n_name, from); } /* * Pretty print a name list * Uncomment it if you need it. */ prettyprint(name) struct name *name; { register struct name *np; np = name; while (np != NIL) { fprintf(stderr, "%s(%d) ", np->n_name, np->n_type); np = np->n_flink; } fprintf(stderr, "\n"); } n each element of the name * list, replacing said value if need be. */ mapf(np, from) register struct namecmd/ucbmail/optim.c 644 0 33 40632 2415563736 7546 ((# /* * Mail -- a program for sending and receiving mail. * * Network name modification routines. */ #include "rcv.h" #include /* * Map a name into the correct network "view" of the * name. This is done by prepending the name with the * network address of the sender, then optimizing away * nonsense. */ char *metanet = "!^:%@."; char * netmap(name, from) char name[], from[]; { char nbuf[BUFSIZ], ret[BUFSIZ]; register char *cp; if (strlen(from) == 0) return(name); if (any('@', name) || any('%', name)) return(arpafix(name, from)); cp = revarpa(from); if (cp == NOSTR) return(name); strcpy(nbuf, cp); cp = &nbuf[strlen(nbuf) - 1]; while (!any(*cp, metanet) && cp > nbuf) cp--; if (cp == nbuf) return(name); *++cp = 0; strcat(nbuf, revarpa(name)); optim(nbuf, ret); cp = revarpa(ret); if (!icequal(name, cp)) return((char *) savestr(cp)); return(name); } /* * Rename the given network path to use * the kinds of names that we would right here. */ char * rename(str) char str[]; { register char *cp, *cp2; char buf[BUFSIZ], path[BUFSIZ]; register int c, host; strcpy(path, ""); for (;;) { if ((c = *cp++) == 0) break; cp2 = buf; while (!any(c, metanet) && c != 0) { *cp2++ = c; c = *cp++; } *cp2 = 0; if (c == 0) { strcat(path, buf); break; } host = netlook(buf, ntype(c)); strcat(path, netname(host)); stradd(path, c); } if (strcmp(str, path) != 0) return(savestr(path)); return(str); } /* * Turn a network machine name into a unique character * + give connection-to status. BN -- connected to Bell Net. * AN -- connected to ARPA net, SN -- connected to Schmidt net. * CN -- connected to COCANET. */ #define AN 1 /* Connected to ARPA net */ #define BN 2 /* Connected to BTL net */ #define CN 4 /* Connected to COCANET */ #define SN 8 /* Connected to Schmidt net */ struct netmach { char *nt_machine; char nt_mid; short nt_type; } netmach[] = { "a", 'a', SN, "b", 'b', SN, "c", 'c', SN, "d", 'd', SN, "e", 'e', SN, "f", 'f', SN, "g", 'g', SN, "ingres", 'i', AN|SN, "ing70", 'i', AN|SN, "berkeley", 'i', AN|SN, "ingvax", 'j', SN, "virus", 'k', SN, "vlsi", 'l', SN, "image", 'm', SN, "esvax", 'o', SN, "sesm", 'o', SN, "q", 'q', SN, "research", 'R', BN, "arpavax", 'r', SN, "src", 's', SN, "mathstat", 't', SN, "csvax", 'v', BN|SN, "vax", 'v', BN|SN, "ucb", 'v', BN|SN, "ucbvax", 'v', BN|SN, "vax135", 'x', BN, "cory", 'y', SN, "eecs40", 'z', SN, 0, 0, 0 }; netlook(machine, attnet) char machine[]; { register struct netmach *np; register char *cp, *cp2; char nbuf[20]; /* * Make into lower case. */ for (cp = machine, cp2 = nbuf; *cp; *cp2++ = little(*cp++)) ; *cp2 = 0; /* * If a single letter machine, look through those first. */ if (strlen(nbuf) == 1) for (np = netmach; np->nt_mid != 0; np++) if (np->nt_mid == nbuf[0]) return(nbuf[0]); /* * Look for usual name */ for (np = netmach; np->nt_mid != 0; np++) if (strcmp(np->nt_machine, nbuf) == 0) return(np->nt_mid); /* * Look in side hash table. */ return(mstash(nbuf, attnet)); } /* * Make a little character. */ little(c) register int c; { if (c >= 'A' && c <= 'Z') c += 'a' - 'A'; return(c); } /* * Turn a network unique character identifier into a network name. */ char * netname(mid) { register struct netmach *np; char *mlook(); if (mid & 0200) return(mlook(mid)); for (np = netmach; np->nt_mid != 0; np++) if (np->nt_mid == mid) return(np->nt_machine); return(NOSTR); } /* * Deal with arpa net addresses. The way this is done is strange. * In particular, if the destination arpa net host is not Berkeley, * then the address is correct as stands. Otherwise, we strip off * the trailing @Berkeley, then cook up a phony person for it to * be from and optimize the result. */ char * arpafix(name, from) char name[]; char from[]; { register char *cp; register int arpamach; char newname[BUFSIZ]; char fake[5]; char fakepath[20]; if (debug) { fprintf(stderr, "arpafix(%s, %s)\n", name, from); } cp = rindex(name, '@'); if (cp == NOSTR) cp = rindex(name, '%'); if (cp == NOSTR) { fprintf(stderr, "Somethings amiss -- no @ or % in arpafix\n"); return(name); } cp++; arpamach = netlook(cp, '@'); if (arpamach == 0) { if (debug) fprintf(stderr, "machine %s unknown, uses: %s\n", cp, name); return(name); } if (((nettype(arpamach) & nettype(LOCAL)) & ~AN) == 0) { if (debug) fprintf(stderr, "machine %s known but remote, uses: %s\n", cp, name); return(name); } strcpy(newname, name); cp = rindex(newname, '@'); if (cp == NOSTR) cp = rindex(newname, '%'); *cp = 0; fake[0] = arpamach; fake[1] = ':'; fake[2] = LOCAL; fake[3] = ':'; fake[4] = 0; prefer(fake); strcpy(fakepath, netname(fake[0])); stradd(fakepath, fake[1]); strcat(fakepath, "daemon"); if (debug) fprintf(stderr, "machine local, call netmap(%s, %s)\n", newname, fakepath); return(netmap(newname, fakepath)); } /* * Take a network machine descriptor and find the types of connected * nets and return it. */ nettype(mid) { register struct netmach *np; if (mid & 0200) return(mtype(mid)); for (np = netmach; np->nt_mid != 0; np++) if (np->nt_mid == mid) return(np->nt_type); return(0); } /* * Hashing routines to salt away machines seen scanning * networks paths that we don't know about. */ #define XHSIZE 19 /* Size of extra hash table */ #define NXMID (XHSIZE*3/4) /* Max extra machines */ struct xtrahash { char *xh_name; /* Name of machine */ short xh_mid; /* Machine ID */ short xh_attnet; /* Attached networks */ } xtrahash[XHSIZE]; struct xtrahash *xtab[XHSIZE]; /* F: mid-->machine name */ short midfree; /* Next free machine id */ /* * Initialize the extra host hash table. * Called by sreset. */ minit() { register struct xtrahash *xp, **tp; register int i; midfree = 0; tp = &xtab[0]; for (xp = &xtrahash[0]; xp < &xtrahash[XHSIZE]; xp++) { xp->xh_name = NOSTR; xp->xh_mid = 0; xp->xh_attnet = 0; *tp++ = (struct xtrahash *) 0; } } /* * Stash a net name in the extra host hash table. * If a new entry is put in the hash table, deduce what * net the machine is attached to from the net character. * * If the machine is already known, add the given attached * net to those already known. */ mstash(name, attnet) char name[]; { register struct xtrahash *xp; struct xtrahash *xlocate(); xp = xlocate(name); if (xp == (struct xtrahash *) 0) { printf("Ran out of machine id spots\n"); return(0); } if (xp->xh_name == NOSTR) { if (midfree >= XHSIZE) { printf("Out of machine ids\n"); return(0); } xtab[midfree] = xp; xp->xh_name = savestr(name); xp->xh_mid = 0200 + midfree++; } switch (attnet) { case '!': case '^': xp->xh_attnet |= BN; break; default: case ':': xp->xh_attnet |= SN; break; case '@': case '%': xp->xh_attnet |= AN; break; } return(xp->xh_mid); } /* * Search for the given name in the hash table * and return the pointer to it if found, or to the first * empty slot if not found. * * If no free slots can be found, return 0. */ struct xtrahash * xlocate(name) char name[]; { register int h, q, i; register char *cp; register struct xtrahash *xp; for (h = 0, cp = name; *cp; h = (h << 2) + *cp++) ; if (h < 0 && (h = -h) < 0) h = 0; h = h % XHSIZE; cp = name; for (i = 0, q = 0; q < XHSIZE; i++, q = i * i) { xp = &xtrahash[(h + q) % XHSIZE]; if (xp->xh_name == NOSTR) return(xp); if (strcmp(cp, xp->xh_name) == 0) return(xp); if (h - q < 0) q += XHSIZE; xp = &xtrahash[(h - q) % XHSIZE]; if (xp->xh_name == NOSTR) return(xp); if (strcmp(cp, xp->xh_name) == 0) return(xp); } return((struct xtrahash *) 0); } /* * Return the name from the extra host hash table corresponding * to the passed machine id. */ char * mlook(mid) { register int m; if ((mid & 0200) == 0) return(NOSTR); m = mid & 0177; if (m >= midfree) { printf("Use made of undefined machine id\n"); return(NOSTR); } return(xtab[m]->xh_name); } /* * Return the bit mask of net's that the given extra host machine * id has so far. */ mtype(mid) { register int m; if ((mid & 0200) == 0) return(0); m = mid & 0177; if (m >= midfree) { printf("Use made of undefined machine id\n"); return(0); } return(xtab[m]->xh_attnet); } /* * Take a network name and optimize it. This gloriously messy * opertions takes place as follows: the name with machine names * in it is tokenized by mapping each machine name into a single * character machine id (netlook). The separator characters (network * metacharacters) are left intact. The last component of the network * name is stripped off and assumed to be the destination user name -- * it does not participate in the optimization. As an example, the * name "research!vax135!research!ucbvax!bill" becomes, tokenized, * "r!x!r!v!" and "bill" A low level routine, optim1, fixes up the * network part (eg, "r!x!r!v!"), then we convert back to network * machine names and tack the user name on the end. * * The result of this is copied into the parameter "name" */ optim(net, name) char net[], name[]; { char netcomp[BUFSIZ], netstr[40], xfstr[40]; register char *cp, *cp2; register int c; strcpy(netstr, ""); cp = net; for (;;) { /* * Rip off next path component into netcomp */ cp2 = netcomp; while (*cp && !any(*cp, metanet)) *cp2++ = *cp++; *cp2 = 0; /* * If we hit null byte, then we just scanned * the destination user name. Go off and optimize * if its so. */ if (*cp == 0) break; if ((c = netlook(netcomp, *cp)) == 0) { printf("No host named \"%s\"\n", netcomp); err: strcpy(name, net); return; } stradd(netstr, c); stradd(netstr, *cp++); /* * If multiple network separators given, * throw away the extras. */ while (any(*cp, metanet)) cp++; } if (strlen(netcomp) == 0) { printf("net name syntax\n"); goto err; } optim1(netstr, xfstr); /* * Convert back to machine names. */ cp = xfstr; strcpy(name, ""); while (*cp) { ((if ((cp2 = netname(*cp++)) == NOSTR) { printf("Made up bad net name\n"); goto err; } strcat(name, cp2); stradd(name, *cp++); } strcat(name, netcomp); } /* * Take a string of network machine id's and separators and * optimize them. We process these by pulling off maximal * leading strings of the same type, passing these to the appropriate * optimizer and concatenating the results. */ #define IMPLICIT 1 #define EXPLICIT 2 optim1(netstr, name) char netstr[], name[]; { char path[40], rpath[40]; register char *cp, *cp2; register int tp, nc; cp = netstr; prefer(cp); strcpy(name, ""); while (*cp != 0) { strcpy(path, ""); tp = ntype(cp[1]); nc = cp[1]; while (*cp && tp == ntype(cp[1])) { stradd(path, *cp++); cp++; } switch (netkind(tp)) { default: strcpy(rpath, path); break; case IMPLICIT: optimimp(path, rpath); break; case EXPLICIT: optimex(path, rpath); break; } for (cp2 = rpath; *cp2 != 0; cp2++) { stradd(name, *cp2); stradd(name, nc); } } optiboth(name); prefer(name); } /* * Return the network of the separator -- * AN for arpa net * BN for Bell labs net * SN for Schmidt (berkeley net) * 0 if we don't know. */ ntype(nc) register int nc; { switch (nc) { case '^': case '!': return(BN); case ':': case '.': return(SN); case '@': case '%': return(AN); default: return(0); } /* NOTREACHED */ } /* * Return the kind of routing used for the particular net * EXPLICIT means explicitly routed * IMPLICIT means implicitly routed * 0 means don't know */ netkind(nt) register int nt; { switch (nt) { case BN: return(EXPLICIT); case AN: case SN: return(IMPLICIT); default: return(0); } /* NOTREACHED */ } /* * Do name optimization for an explicitly routed network (eg BTL network). */ optimex(net, name) char net[], name[]; { register char *cp, *rp; register int m; char *rindex(); strcpy(name, net); cp = name; if (strlen(cp) == 0) return(-1); if (cp[strlen(cp)-1] == LOCAL) { name[0] = 0; return(0); } for (cp = name; *cp; cp++) { m = *cp; rp = rindex(cp+1, m); if (rp != NOSTR) strcpy(cp, rp); } return(0); } /* * Do name optimization for implicitly routed network (eg, arpanet, * Berkeley network) */ optimimp(net, name) char net[], name[]; { register char *cp; register int m; cp = net; if (strlen(cp) == 0) return(-1); m = cp[strlen(cp) - 1]; if (m == LOCAL) { strcpy(name, ""); return(0); } name[0] = m; name[1] = 0; return(0); } /* * Perform global optimization on the given network path. * The trick here is to look ahead to see if there are any loops * in the path and remove them. The interpretation of loops is * more strict here than in optimex since both the machine and net * type must match. */ optiboth(net) char net[]; { register char *cp, *cp2; char *rpair(); cp = net; if (strlen(cp) == 0) return; if ((strlen(cp) % 2) != 0) { printf("Strange arg to optiboth\n"); return; } while (*cp) { cp2 = rpair(cp+2, *cp); if (cp2 != NOSTR) strcpy(cp, cp2); cp += 2; } } /* * Find the rightmost instance of the given (machine, type) pair. */ char * rpair(str, mach) char str[]; { register char *cp, *last; last = NOSTR; while (*cp) { if (*cp == mach) last = cp; cp += 2; } return(last); } /* * Change the network separators in the given network path * to the preferred network transmission means. */ prefer(name) char name[]; { register char *cp; register int state, n; state = LOCAL; for (cp = name; *cp; cp += 2) { n = best(state, *cp); if (n) cp[1] = n; state = *cp; } } /* * Return the best network separator for the given machine pair. */ struct netorder { short no_stat; char no_char; } netorder[] = { CN, ':', AN, '@', AN, '%', SN, ':', BN, '!', -1, 0 }; best(src, dest) { register int dtype, stype; register struct netorder *np; stype = nettype(src); dtype = nettype(dest); if (stype == 0 || dtype == 0) { printf("ERROR: unknown internal machine id\n"); return(0); } if ((stype & dtype) == 0) { #ifdef DELIVERMAIL if (src != LOCAL) #endif printf("No way to get from \"%s\" to \"%s\"\n", netname(src), netname(dest)); return(0); } np = &netorder[0]; while ((np->no_stat & stype & dtype) == 0) np++; return(np->no_char); } /* * Code to twist around arpa net names. */ #define WORD 257 /* Token for a string */ static char netbuf[256]; static char *yylval; /* * Reverse all of the arpa net addresses in the given name to * be of the form "host @ user" instead of "user @ host" * This function is its own inverse. */ char * revarpa(str) char str[]; { if (yyinit(str) < 0) return(NOSTR); if (name()) return(NOSTR); if (strcmp(str, netbuf) == 0) return(str); return(savestr(netbuf)); } /* * Parse (by recursive descent) network names, using the following grammar: * name: * term {':' term} * term {'^' term} * term {'!' term} * term '@' name * term '%' name * * term: * string of characters. */ name() { register int t; register char *cp; for (;;) { t = yylex(); if (t != WORD) return(-1); cp = yylval; t = yylex(); switch (t) { case 0: strcat(netbuf, cp); return(0); case '@': case '%': if (name()) return(-1); stradd(netbuf, '@'); strcat(netbuf, cp); return(0); case WORD: return(-1); default: strcat(netbuf, cp); stradd(netbuf, t); } } } /* * Scanner for network names. */ static char *charp; /* Current input pointer */ static int nexttok; /* Salted away next token */ /* * Initialize the network name scanner. */ yyinit(str) char str[]; { static char lexbuf[BUFSIZ]; netbuf[0] = 0; if (strlen(str) >= sizeof lexbuf - 1) return(-1); nexttok = 0; strcpy(lexbuf, str); charp = lexbuf; return(0); } /* * Scan and return a single token. * yylval is set to point to a scanned string. */ yylex() { register char *cp, *dot; register int s; if (nexttok) { s = nexttok; nexttok = 0; return(s); } cp = charp; while (*cp && isspace(*cp)) cp++; if (*cp == 0) return(0); if (any(*cp, "!^@:%")) { charp = cp+1; return(*cp); } dot = cp; while (*cp && !any(*cp, " \t!^@:%")) cp++; if (any(*cp, "!^@:%")) nexttok = *cp; if (*cp == 0) charp = cp; else charp = cp+1; *cp = 0; yylval = dot; return(WORD); } /* * Add a single character onto a string. */ stradd(str, c) register char *str; register int c; { str += strlen(str); *str++ = c; *str = 0; } nexttok = 0; return(s); } cp = charp; while (*cp && isspace(*cp)) cp++; if (*cp == 0) returcmd/ucbmail/quit.c 644 0 33 13214 2400701752 7356 # #include "rcv.h" #include /* * Rcv -- receive mail rationally. * * Termination processing. */ /* * Save all of the undetermined messages at the top of "mbox" * Save all untouched messages back in the system mailbox. * Remove the system mailbox, if none saved there. */ quit() { int mcount, p, modify; FILE *ibuf, *obuf, *fbuf, *rbuf; register struct message *mp; register int c; extern char tempQuit[], tempResid[]; struct stat minfo; /* * See if there any messages to save in mbox. If no, we * can save copying mbox to /tmp and back. * * Check also to see if any files need to be preserved. * Delete all untouched messages to keep them out of mbox. * If all the messages are to be preserved, just exit with * a message. * * If the luser has sent mail to himself, refuse to do * anything with the mailbox, unless mail locking works. */ lock(mailname); #ifndef CANLOCK if (selfsent) { printf("You have new mail.\n"); unlock(); return; } #endif rbuf = NULL; if (stat(mailname, &minfo) >= 0 && minfo.st_size > mailsize) { printf("New mail has arrived.\n"); rbuf = fopen(tempResid, "w"); fbuf = fopen(mailname, "r"); if (rbuf == NULL || fbuf == NULL) goto newmail; #ifdef APPEND fseek(fbuf, mailsize, 0); while ((c = getc(fbuf)) != EOF) putc(c, rbuf); #else p = minfo.st_size - mailsize; while (p-- > 0) { c = getc(fbuf); if (c == EOF) goto newmail; putc(c, rbuf); } #endif fclose(fbuf); fclose(rbuf); if ((rbuf = fopen(tempResid, "r")) == NULL) goto newmail; remove(tempResid); } for (mp = &message[0]; mp < &message[msgCount]; mp++) { if (mp->m_flag & MDELETED) mp->m_flag = MDELETED|MTOUCH; if ((mp->m_flag & MTOUCH) == 0) mp->m_flag |= MDELETED; } modify = 0; for (c = 0, p = 0, mp = &message[0]; mp < &message[msgCount]; mp++) { if ((mp->m_flag & (MSAVED|MDELETED|MPRESERVE)) == 0) c++; if ((mp->m_flag & MPRESERVE) || (mp->m_flag & MTOUCH) == 0) p++; if (mp->m_flag & MODIFY) modify++; } if (p == msgCount && !modify) { if (p == 1) printf("Held 1 message in %s\n", mailname); else printf("Held %2d messages in %s\n", p, mailname); unlock(); return; } if (c == 0) { if (p != 0) { writeback(rbuf); unlock(); return; } goto cream; } /* * Create another temporary file and copy user's mbox file * darin. If there is no mbox, copy nothing. * If he has specified "append" don't copy his mailbox, * just copy saveable entries at the end. */ mcount = c; if (value("append") == NOSTR) { if ((obuf = fopen(tempQuit, "w")) == NULL) { perror(tempQuit); unlock(); return; } if ((ibuf = fopen(tempQuit, "r")) == NULL) { perror(tempQuit); remove(tempQuit); fclose(obuf); unlock(); return; } remove(tempQuit); if ((fbuf = fopen(mbox, "r")) != NULL) { while ((c = getc(fbuf)) != EOF) putc(c, obuf); fclose(fbuf); } if (ferror(obuf)) { perror(tempQuit); fclose(ibuf); fclose(obuf); unlock(); return; } fclose(obuf); clo((se(creat(mbox, 0600)); if ((obuf = fopen(mbox, "w")) == NULL) { perror(mbox); fclose(ibuf); unlock(); return; } } if (value("append") != NOSTR) if ((obuf = fopen(mbox, "a")) == NULL) { perror(mbox); unlock(); return; } for (mp = &message[0]; mp < &message[msgCount]; mp++) if ((mp->m_flag & (MDELETED|MSAVED|MPRESERVE)) == 0) if (send(mp, obuf) < 0) { perror(mbox); fclose(ibuf); fclose(obuf); unlock(); return; } /* * Copy the user's old mbox contents back * to the end of the stuff we just saved. * If we are appending, this is unnecessary. */ if (value("append") == NOSTR) { rewind(ibuf); c = getc(ibuf); while (c != EOF) { putc(c, obuf); if (ferror(obuf)) break; c = getc(ibuf); } fclose(ibuf); fflush(obuf); } if (ferror(obuf)) { perror(mbox); fclose(obuf); unlock(); return; } fclose(obuf); if (mcount == 1) printf("Saved 1 message in mbox\n"); else printf("Saved %d messages in mbox\n", mcount); /* * Now we are ready to copy back preserved files to * the system mailbox, if any were requested. */ if (p != 0) { writeback(rbuf); unlock(); return; } /* * Finally, remove his /usr/mail file. * If new mail has arrived, copy it back. */ cream: if (rbuf != NULL) { fbuf = fopen(mailname, "w"); if (fbuf == NULL) goto newmail; while ((c = getc(rbuf)) != EOF) putc(c, fbuf); fclose(rbuf); fclose(fbuf); alter(mailname); unlock(); return; } demail(); unlock(); return; newmail: printf("Thou hast new mail.\n"); unlock(); } /* * Preserve all the appropriate messages back in the system * mailbox, and print a nice message indicated how many were * saved. On any error, just return -1. Else return 0. * Incorporate the any new mail that we found. */ writeback(res) register FILE *res; { register struct message *mp; register int p, c; FILE *obuf; p = 0; if ((obuf = fopen(mailname, "w")) == NULL) { perror(mailname); return(-1); } #ifndef APPEND if (res != NULL) while ((c = getc(res)) != EOF) putc(c, obuf); #endif for (mp = &message[0]; mp < &message[msgCount]; mp++) if ((mp->m_flag&MPRESERVE)||(mp->m_flag&MTOUCH)==0) { p++; if (send(mp, obuf) < 0) { perror(mailname); fclose(obuf); return(-1); } } #ifdef APPEND if (res != NULL) while ((c = getc(res)) != EOF) putc(c, obuf); #endif fflush(obuf); if (ferror(obuf)) { perror(mailname); fclose(obuf); return(-1); } if (res != NULL) fclose(res); fclose(obuf); alter(mailname); if (p == 1) printf("Held 1 message in %s\n", mailname); else printf("Held %d messages in %s\n", p, mailname); return(0); } ESERVE)||(mp->m_flag&MTOUCH)==0) { p++; if (send(mp, obuf) < 0) { perror(mailname); fclose(obuf); return(-1); } } #ifdef APPEND if (res != NULL) while ((c = getc(res)) != EOF) putc(c, obuf); #endif fflush(obuf); if (ferror(obuf)) { perror(mailname); fclose(obuf); return(-1); } if (res != NULL) fclose(res); fclose(obuf); alter(mcmd/ucbmail/rcv.h 644 0 33 241 2400701752 7127 # /* * Mail -- a mail program * * This file is included by normal files which want both * globals and declarations. */ #include "def.h" #include "glob.h" MTOUCH)==0) { p++; if (send(mp, obuf) < 0) { perror(mailname); fclose(obuf); return(-1); } } #ifdef APPEND if (res != NULL) while ((c = getc(res)) != EOF) putc(c, obuf); #endif fflush(obuf); if (ferror(obuf)) { perror(mailname/,5< /,"cmd/ucbmail/send.c 644 0 33 17120 2415551233 7330 # #include "rcv.h" #ifdef VMUNIX #include #endif /* * Mail -- a mail program * * Mail to others. */ /* * Send message described by the passed pointer to the * passed output buffer. Return -1 on error, but normally * the number of lines written. */ send(mailp, obuf) struct message *mailp; FILE *obuf; { register struct message *mp; register int t; unsigned int c; FILE *ibuf; int lc; mp = mailp; ibuf = setinput(mp); c = msize(mp); lc = 0; while (c-- > 0) { putc(t = getc(ibuf), obuf); if (t == '\n') lc++; if (ferror(obuf)) return(-1); } return(lc); } /* * Interface between the argument list and the mail1 routine * which does all the dirty work. */ mail(people) char **people; { register char *cp2; register int s; char *buf, **ap; struct header head; for (s = 0, ap = people; *ap != (char *) -1; ap++) s += strlen(*ap) + 1; buf = salloc(s+1); cp2 = buf; for (ap = people; *ap != (char *) -1; ap++) { cp2 = copy(*ap, cp2); *cp2++ = ' '; } if (cp2 != buf) cp2--; *cp2 = '\0'; head.h_to = buf; head.h_subject = NOSTR; head.h_cc = NOSTR; head.h_bcc = NOSTR; head.h_seq = 0; mail1(&head); return(0); } /* * Send mail to a bunch of user names. The interface is through * the mail routine below. */ sendmail(str) char *str; { register char **ap; char *bufp; register int t; struct header head; if (blankline(str)) head.h_to = NOSTR; else head.h_to = str; head.h_subject = NOSTR; head.h_cc = NOSTR; head.h_bcc = NOSTR; head.h_seq = 0; mail1(&head); return(0); } /* * Mail a message on standard input to the people indicated * in the passed header. (Internal interface). */ mail1(hp) struct header *hp; { register char *cp; int pid, i, s, p, gotcha; char **namelist; struct name *to, *np; FILE *mtf, *postage; int remote = rflag != NOSTR || rmail; char **t; /* * Collect user's mail from standard input. * Get the result as mtf. */ pid = -1; if ((mtf = collect(hp)) == NULL) return(-1); hp->h_seq = 1; if (hp->h_subject == NOSTR) hp->h_subject = sflag; if (fsize(mtf) == 0 && hp->h_subject == NOSTR) { printf("No message !?!\n"); goto out; } if (intty && value("askcc") != NOSTR) grabh(hp, GCC); else if (intty) { printf("EOT\n"); flush(); } /* * Now, take the user names from the combined * to and cc lists and do all the alias * processing. */ senderr = 0; to = usermap(cat(extract(hp->h_bcc, GBCC), cat(extract(hp->h_to, GTO), extract(hp->h_cc, GCC)))); if (to == NIL) { printf("No recipients specified\n"); goto topdog; } /* * Look through the recipient list for names with /'s * in them which we write to as files directly. */ to = outof(to, mtf, hp); rewind(mtf); to = verify(to); if (senderr && !remote) { topdog: if (fsize(mtf) != 0) { remove(deadletter); exwrite(deadletter, mtf, 1); rewind(mtf); } } for (gotcha = 0, np = to; np != NIL; np = np->n_flink) if ((np->n_type & GDEL) == 0) { gotcha++; break; } if (!gotcha) goto out; to = elide(to); mechk(to); if (count(to) > 1) hp->h_seq++; if (hp->h_seq > 0 && !remote) { fixhead(hp, to); if (fsize(mtf) == 0) printf("Null message body; hope that's ok\n"); if ((mtf = infix(hp, mtf)) == NULL) { fprintf(stderr, ". . . message lost, sorry.\n"); return(-1); } } namelist = unpack(to); if (debug) { printf("Recipients of message:\n"); for (t = namelist; *t != NOSTR; t++) printf(" \"%s\"", *t); printf("\n"); fflush(stdout); return; } if ((cp = value("record")) != NOSTR) savemail(expand(cp), hp, mtf); /* * Wait, to absorb a potential zombie, then * fork, set up the temporary mail file as standard * input for "mail" and exec with the user list we generated * far above. Return the process id to caller in case he * wants to await the completion of mail. */ #ifdef VMUNIX while (wait3(&s, WNOHANG, 0) > 0) ; #else wait(&s); #endif rewind(mtf); pid = fork(); if (pid == -1) { perror("fork"); remove(deadletter); exwrite(deadletter, mtf, 1); goto out; } if (pid == 0) { #ifdef SIGTSTP if (remote == 0) { signal(SIGTSTP, SIG_IGN); signal(SIGTTIN, SIG_IGN); signal(SIGTTOU, SIG_IGN); } #endif for (i = SIGHUP; i <= SIGQUIT; i++) signal(i, SIG_IGN); if ((postage = fopen("/crp/kurt/postage", "a")) != NULL) { fprintf(postage, "%s %d %d\n", myname, count(to), fsize(mtf)); fclose(postage); } s = fileno(mtf); for (i = 3; i < 15; i++) if (i != s) close(i); close(0); dup(s); close(s); #ifdef CC submit(getpid()); #endif CC #ifdef DELIVERMAIL execv(DELIVERMAIL, namelist); #endif DELIVERMAIL execv(MAIL, namelist); perror(MAIL); exit(1); } out: if (remote) { while ((p = wait(&s)) != pid && p != -1) ; if (s != 0) senderr++; pid = 0; } fclose(mtf); return(pid); } /* * Fix the header by glopping all of the expanded names from * the distribution list into the appropriate fields. * If there are any ARPA net recipients in the message, * we must insert commas, alas. */ fixhead(hp, tolist) struct header *hp; struct name *tolist; { register struct name *nlist; register int f; register struct name *np; for (f = 0, np = tolist; np != NIL; np = np->n_flink) if (any('@', np->n_name)) { f |= GCOMMA; break; } if (debug && f & GCOMMA) fprintf(stderr, "Should be inserting commas in recip lists\n"); hp->h_to = detract(tolist, GTO|f); hp->h_cc = detract(tolist, GCC|f); } /* * Prepend a header in front of the collected stuff * and return the new file. */ FILE * infix(hp, fi) struct(( header *hp; FILE *fi; { extern char tempMail[]; register FILE *nfo, *nfi; register int c; if ((nfo = fopen(tempMail, "w")) == NULL) { perror(tempMail); return(fi); } if ((nfi = fopen(tempMail, "r")) == NULL) { perror(tempMail); fclose(nfo); return(fi); } remove(tempMail); puthead(hp, nfo, GTO|GSUBJECT|GCC|GNL); rewind(fi); c = getc(fi); while (c != EOF) { putc(c, nfo); c = getc(fi); } if (ferror(fi)) { perror("read"); fprintf(stderr, "Please notify Kurt Shoens\n"); return(fi); } fflush(nfo); if (ferror(nfo)) { perror(tempMail); fclose(nfo); fclose(nfi); return(fi); } fclose(nfo); fclose(fi); rewind(nfi); return(nfi); } /* * Dump the to, subject, cc header on the * passed file buffer. */ puthead(hp, fo, w) struct header *hp; FILE *fo; { register int gotcha; gotcha = 0; if (hp->h_to != NOSTR && w & GTO) fprintf(fo, "To: "), fmt(hp->h_to, fo), gotcha++; if (hp->h_subject != NOSTR && w & GSUBJECT) fprintf(fo, "Subject: %s\n", hp->h_subject), gotcha++; if (hp->h_cc != NOSTR && w & GCC) fprintf(fo, "Cc: "), fmt(hp->h_cc, fo), gotcha++; if (hp->h_bcc != NOSTR && w & GBCC) fprintf(fo, "Bcc: "), fmt(hp->h_bcc, fo), gotcha++; if (gotcha && w & GNL) putc('\n', fo); return(0); } /* * Format the given text to not exceed 72 characters. */ fmt(str, fo) register char *str; register FILE *fo; { register int col; register char *cp; cp = str; col = 0; while (*cp) { if (*cp == ' ' && col > 65) { fprintf(fo, "\n "); col = 4; cp++; continue; } putc(*cp++, fo); col++; } putc('\n', fo); } /* * Save the outgoing mail on the passed file. */ savemail(name, hp, fi) char name[]; struct header *hp; FILE *fi; { register FILE *fo; register int c; long now; char *n; if ((fo = fopen(name, "a")) == NULL) { perror(name); return(-1); } time(&now); n = rflag; if (n == NOSTR) n = myname; fprintf(fo, "From %s %s", n, ctime(&now)); rewind(fi); for (c = getc(fi); c != EOF; c = getc(fi)) putc(c, fo); fprintf(fo, "\n"); fflush(fo); if (ferror(fo)) perror(name); fclose(fo); return(0); } e the outgoing mail on the passed file. */ savemail(name, hp, fi) char name[]; struct header *hp; FILE *fi; { register FILE *fo; register int c; long now; char *n; if ((fo = fopen(name, "a")) == NULL) { perror(name); return(-1); } time(&now); n = rflag; if (n == NOSTR) n = myname; fprintf(fo, "From %s %s", n, ctime(&now)); rewind(fi); for (c = getc(fi); c != EOF; c = getc(fi)) putc(c, fo); fprintf(fo, cmd/ucbmail/strings.c 644 0 33 3303 2400701754 10045 # /* * Mail -- a mail program * * String allocation routines. * Strings handed out here are reclaimed at the top of the command * loop each time, so they need not be freed. */ #include "rcv.h" /* * Allocate size more bytes of space and return the address of the * first byte to the caller. An even number of bytes are always * allocated so that the space will always be on a word boundary. * The string spaces are of exponentially increasing size, to satisfy * the occasional user with enormous string size requests. */ char * salloc(size) { register char *t; register int s; register struct strings *sp; int index; s = size; s++; s &= ~01; index = 0; for (sp = &stringdope[0]; sp < &stringdope[NSPACE]; sp++) { if (sp->s_topFree == NOSTR && (STRINGSIZE << index) >= s) break; if (sp->s_nleft >= s) break; index++; } if (sp >= &stringdope[NSPACE]) panic("String too large"); if (sp->s_topFree == NOSTR) { index = sp - &stringdope[0]; sp->s_topFree = (char *) calloc(STRINGSIZE << index, (unsigned) 1); if (sp->s_topFree == NOSTR) { fprintf(stderr, "No room for space %d\n", index); panic("Internal error"); } sp->s_nextFree = sp->s_topFree; sp->s_nleft = STRINGSIZE << index; } sp->s_nleft -= s; t = sp->s_nextFree; sp->s_nextFree += s; return(t); } /* * Reset the string area to be empty. * Called to free all strings allocated * since last reset. */ sreset() { register struct strings *sp; register int index; if (noreset) return; minit(); index = 0; for (sp = &stringdope[0]; sp < &stringdope[NSPACE]; sp++) { if (sp->s_topFree == NOSTR) continue; sp->s_nextFree = sp->s_topFree; sp->s_nleft = STRINGSIZE << index; index++; } } t = STRINGSIZE << index; } sp->s_nleft -= s; t = sp->s_nextFree; sp->s_nextFree += s; return(t); } /* * Reset the string area to be empty. * Called to free all strings allocated * since last reset. */ sreset() { register struct strings *sp; register int index; if (noreset) return; minit(); index =cmd/ucbmail/temp.c 644 0 33 2476 2400701755 7334 # #include "rcv.h" /* * Mail -- a mail program * * Give names to all the temporary files that we will need. */ char tempMail[14]; char tempQuit[14]; char tempEdit[14]; char tempSet[14]; char tempResid[14]; char tempMesg[14]; tinit() { register char *cp, *cp2; char uname[9]; register int err = 0; register int pid; pid = getpid(); sprintf(tempMail, "/tmp/Rs%05d", pid); sprintf(tempResid, "/tmp/Rq%05d", pid); sprintf(tempQuit, "/tmp/Rm%05d", pid); sprintf(tempEdit, "/tmp/Re%05d", pid); sprintf(tempSet, "/tmp/Rx%05d", pid); sprintf(tempMesg, "/tmp/Rx%05d", pid); if (strlen(myname) != 0) { uid = getuserid(myname); if (uid == -1) goto youlose; } else { uid = getuid() & UIDMASK; if (username(uid, uname) < 0) { copy("ubluit", myname); youlose: err++; if (rcvmode) { printf("Who are you!?\n"); exit(1); } } copy(uname, myname); } mailname = mailspace; cp = value("HOME"); if (cp == NOSTR) cp = "."; copy(cp, homedir); findmail(); cp = copy(homedir, mbox); copy("/mbox", cp); cp = copy(homedir, mailrc); copy("/.mailrc", cp); cp = copy(homedir, deadletter); copy("/dead.letter", cp); if (debug) { printf("uid = %d, user = %s, mailname = %s\n", uid, myname, mailname); printf("deadletter = %s, mailrc = %s, mbox = %s\n", deadletter, mailrc, mbox); } } e you!?\n"); exit(1); } } copy(uname, myname); } mailname = mailspace; cp = value("HOME"); if (cp == NOSTR) cp = "."; copy(cp, homedir); findmail(); cp = copy(homedir, mbox);cmd/ucbmail/tty.c 644 0 33 6237 2415415226 7207 # /* * Mail -- a mail program * * Generally useful tty stuff. */ #include "rcv.h" #include static int c_erase; /* Current erase char */ static int c_kill; /* Current kill char */ #ifndef TIOCSTI static int ttyset; /* We must now do erase/kill */ #endif /* * Read all relevant header fields. */ grabh(hp, gflags) struct header *hp; { struct sgttyb ttybuf; #ifndef TIOCSTI int (*savesigs[2])(); #endif register int s; int errs; errs = 0; #ifndef TIOCSTI ttyset = 0; #endif if (gtty(fileno(stdin), &ttybuf) < 0) { perror("gtty"); return(-1); } c_erase = ttybuf.sg_erase; c_kill = ttybuf.sg_kill; #ifndef TIOCSTI ttybuf.sg_erase = 0; ttybuf.sg_kill = 0; for (s = SIGINT; s <= SIGQUIT; s++) if ((savesigs[s-SIGINT] = signal(s, SIG_IGN)) == SIG_DFL) signal(s, SIG_DFL); #endif if (gflags & GTO) { #ifndef TIOCSTI if (!ttyset && hp->h_to != NOSTR) ttyset++, stty(fileno(stdin), &ttybuf); #endif hp->h_to = readtty("To: ", hp->h_to); if (hp->h_to != NOSTR) hp->h_seq++; } if (gflags & GSUBJECT) { #ifndef TIOCSTI if (!ttyset && hp->h_subject != NOSTR) ttyset++, stty(fileno(stdin), &ttybuf); #endif hp->h_subject = readtty("Subject: ", hp->h_subject); if (hp->h_subject != NOSTR) hp->h_seq++; } if (gflags & GCC) { #ifndef TIOCSTI if (!ttyset && hp->h_cc != NOSTR) ttyset++, stty(fileno(stdin), &ttybuf); #endif hp->h_cc = readtty("Cc: ", hp->h_cc); if (hp->h_cc != NOSTR) hp->h_seq++; } if (gflags & GBCC) { #ifndef TIOCSTI if (!ttyset && hp->h_bcc != NOSTR) ttyset++, stty(fileno(stdin), &ttybuf); #endif hp->h_bcc = readtty("Bcc: ", hp->h_bcc); if (hp->h_bcc != NOSTR) hp->h_seq++; } #ifndef TIOCSTI ttybuf.sg_erase = c_erase; ttybuf.sg_kill = c_kill; if (ttyset) stty(fileno(stdin), &ttybuf); for (s = SIGINT; s <= SIGQUIT; s++) signal(s, savesigs[s-SIGINT]); #endif return(errs); } /* * Read up a header from standard input. * The source string has the preliminary contents to * be read. * */ char * readtty(pr, src) char pr[], src[]; { char canonb[BUFSIZ]; int c, ch; register char *cp, *cp2; fputs(pr, stdout); fflush(stdout); if (src != NOSTR && strlen(src) > BUFSIZ - 2) { printf("too long to edit\n"); return(src); } #ifndef TIOCSTI if (src != NOSTR) cp = copy(src, canonb); else cp = copy("", canonb); fputs(canonb, stdout); fflush(stdout); #else for (cp = src; c = *cp; cp++) { if (c == c_erase || c == c_kill) { ch = '\\'; ioctl(0, TIOCSTI, &ch); } ioctl(0, TIOCSTI, &c); } cp = canonb; #endif cp2(( = fgets(cp, BUFSIZ - (cp - canonb), stdin); canonb[strlen(canonb) - 1] = '\0'; #ifndef TIOCSTI if (cp2 == NOSTR || *cp2 == '\0') return(src); cp = cp2; if (!ttyset) return(strlen(canonb) > 0 ? savestr(canonb) : NOSTR); while (*cp != '\0') { c = *cp++; if (c == c_erase) { if (cp2 == canonb) continue; if (cp2[-1] == '\\') { cp2[-1] = c; continue; } cp2--; continue; } if (c == c_kill) { if (cp2 == canonb) continue; if (cp2[-1] == '\\') { cp2[-1] = c; continue; } cp2 = canonb; continue; } *cp2++ = c; } *cp2 = '\0'; #endif if (equal("", canonb)) return(NOSTR); return(savestr(canonb)); } if (!ttyset) return(strlen(canonb) > 0 ? savestr(canonb) : NOSTR); while (*cp != '\0') { c = *cp++; if (c == c_erase) { if (cp2 == canonb) continue; if (cp2[-1] == '\\') { cp2[-1] = c; continue; } cp2--; continue; } if (c == c_kill) { if (cp2 == canonb) continue; if (cp2[-1] == '\\') { cp2[-1] = c; cmd/ucbmail/v6.local.c 644 0 33 2767 2400701757 10020 # /* * Mail -- a mail program * * Unix version 6.0 * * Local routines that are installation dependent. * All fiddlers please note: if you make careful note of * what you change here, I will incorporate your changes and * you won't have to remake them each release. */ #include "rcv.h" /* * Locate the user's mailbox file (ie, the place where new, unread * mail is queued). In Version 6, it is in ~/.mail */ findmail() { register char *cp; cp = copy(homedir, mailname); copy("/.mail", cp); } /* * Get rid of the queued mail. */ demail() { close(creat(mailname, 0666)); alter(mailname); } /* * Get an environment variable. At present, we only support * "SHELL" and "HOME". This routine makes use of the getpw * routine in the neighboring getname.c stuff. */ char * getenv(name) char name[]; { char pwline[LINESIZE]; static char val[30]; register char *cp, *dp; register int cc; if (equal(name, "SHELL")) cc = 6; else if (equal(name, "HOME")) cc = 5; else return(NOSTR); if (getpw(uid, pwline) < 0) return(NOSTR); for (cp = pwline; *cp && cc > 0;) if (*cp++ == ':') cc--; dp = cp; while (*cp != ':' && *cp != '\0') cp++; *cp = '\0'; if (*dp == '\0') return(NOSTR); copy(dp, val); return(val); } /* * Lock and unlock retrofits which are only * significant in version 7. */ lock(name) char *name; { return(0); } unlock() { return(0); } /* * Discover user login name. */ username(uid, namebuf) char namebuf[]; { return(getname(uid, namebuf)); } R); if (cmd/ucbmail/v6.local.h 644 0 33 1242 2400701760 10002 /* * Declarations and constants specific to an installation. * Unix Version 6. */ #define LOCAL 'i' /* Local machine id */ #define MAIL "/bin/mail" /* Name of mail sender */ #define EDITOR "/usr/bin/ex" /* Name of text editor */ #define VISUAL "/usr/bin/vi" /* Name of display editor */ #define SHELL "/bin/sh" /* Standard shell */ #define HELPFILE "/usr/lib/Mail.help" /* Name of casual help file */ #define THELPFILE "/usr/lib/Mail.help.~" /* Name of casual tilde help */ #define UIDMASK 0377 /* Significant uid bits */ #define MASTER "/usr/lib/Mail.rc" #define stat _stat /* Simulate version 7 */ #define fstat _fstat /* Simulate version 7 */ e of mail sender */ #define EDITOR "/usr/bin/ex" /* Name of text editor */ #define VISUAL "/usr/bin/vi" /* Name of display editor */ #define SHELL "/bin/sh" /* Standard shell */ #define HELPFILE "/usr/lib/Mail.help" /* Name of casual help file */ #define THELPFILE "/usr/lib/Mail.help.~" /* Name of casual tilde help */ #define UIDMASK cmd/ucbmail/v7.local.c 644 0 33 1464 2531551636 10016 # /* * Mail -- a mail program * * Version 7 * * Local routines that are installation dependent. */ #include "rcv.h" /* * Locate the user's mailbox file (ie, the place where new, unread * mail is queued). In Version 7, it is in /usr/spool/mail/name. */ findmail() { register char *cp; cp = copy("/usr/spool/mail/", mailname); copy(myname, cp); if (isdir(mailname)) { stradd(mailname, '/'); strcat(mailname, myname); } } /* * Get rid of the queued mail. */ demail() { if (remove(mailname) >= 0) return; close(creat(mailname, 0666)); alter(mailname); } /* * Discover user login name. */ username(uid, namebuf) char namebuf[]; { register char *np; if (uid == getuid() && (np = getenv("USER")) != NOSTR) { strncpy(namebuf, np, 9); return(0); } return(getname(uid, namebuf)); } py("/usr/spool/mail/", mailname); copy(myname, cp); if (isdir(mailname)) { stradd(mailname, '/'); strcat(mailname, myname); } } /* * Get rid of the queued mail. */ demail() { if (remove(mailncmd/ucbmail/v7.local.h 644 0 33 1502 2457243502 10011 /* * Declarations and constants specific to an installation. * * Vax/Unix version 7. */ #define LOCAL 'r' /* Local machine id */ #define MAIL "/bin/mail" /* Name of mail sender */ #define DELIVERMAIL "/etc/delivermail" /* Name of classy mail deliverer */ #define EDITOR "/usr/ucb/ex" /* Name of text editor */ #define VISUAL "/usr/ucb/vi" /* Name of display editor */ #define SHELL "/bin/csh" /* Standard shell */ #define HELPFILE "/usr/lib/Mail.help" /* Name of casual help file */ #define THELPFILE "/usr/lib/Mail.help.~" /* Name of casual tilde help */ #define UIDMASK 0177777 /* Significant uid bits */ #define MASTER "/usr/lib/Mail.rc" #define APPEND /* New mail goes to end of mailbox */ #define CANLOCK /* Locking protocol actually works */ #define UTIME /* System implements utime(2) */ */ #define VISUAL "/usr/ucb/vi" /* Name of display editor */ #define SHELL "/bin/csh" /* Standard shell */ #define HELPFILE "/usr/lib/Mail.help" /* Name of casual help file */ #definecmd/ucbmail/version.c 644 0 33 44 2460467704 10012 char *version = "January 13, 1981"; /* Name of casual tilde help */ #define UIDMASK 0177777 /* Significant uid bits */ #define MASTER "/usr/lib/Mail.rc" #define APPEND /* New mail goes to end of mailbox */ #define CANLOCK /* Locking protocol actually works */ #define UTIME /* System implements utime(2) */ */ #define VISUAL "/usr/ucb/vi" /* Name of display editor */ #define SHELL "/bin/csh" /* Standar/,5< /,"cmd/ucbmail/vars.c 644 0 33 4643 2400701760 7334 # #include "rcv.h" /* * Mail -- a mail program * * Variable handling stuff. */ /* * Assign a value to a variable. */ assign(name, value) char name[], value[]; { register struct var *vp; register int h; h = hash(name); vp = lookup(name); if (vp == NOVAR) { vp = (struct var *) calloc(sizeof *vp, 1); vp->v_name = vcopy(name); vp->v_link = variables[h]; variables[h] = vp; } else vfree(vp->v_value); vp->v_value = vcopy(value); } /* * Free up a variable string. We do not bother to allocate * strings whose value is "" since they are expected to be frequent. * Thus, we cannot free same! */ vfree(cp) register char *cp; { if (!equal(cp, "")) cfree(cp); } /* * Copy a variable value into permanent (ie, not collected after each * command) space. Do not bother to alloc space for "" */ char * vcopy(str) char str[]; { register char *top, *cp, *cp2; if (equal(str, "")) return(""); top = calloc(strlen(str)+1, 1); cp = top; cp2 = str; while (*cp++ = *cp2++) ; return(to((p); } /* * Get the value of a variable and return it. * Look in the environment if its not available locally. */ char * value(name) char name[]; { register struct var *vp; if ((vp = lookup(name)) == NOVAR) return(getenv(name)); return(vp->v_value); } /* * Locate a variable and return its variable * node. */ struct var * lookup(name) char name[]; { register struct var *vp; register int h; h = hash(name); for (vp = variables[h]; vp != NOVAR; vp = vp->v_link) if (equal(vp->v_name, name)) return(vp); return(NOVAR); } /* * Locate a group name and return it. */ struct grouphead * findgroup(name) char name[]; { register struct grouphead *gh; register int h; h = hash(name); for (gh = groups[h]; gh != NOGRP; gh = gh->g_link) if (equal(gh->g_name, name)) return(gh); return(NOGRP); } /* * Print a group out on stdout */ printgroup(name) char name[]; { register struct grouphead *gh; register struct group *gp; if ((gh = findgroup(name)) == NOGRP) { printf("\"%s\": not a group\n", name); return; } printf("%s\t", gh->g_name); for (gp = gh->g_list; gp != NOGE; gp = gp->ge_link) printf(" %s", gp->ge_name); printf("\n"); } /* * Hash the passed string and return an index into * the variable or group hash table. */ hash(name) char name[]; { register int h; register char *cp; for (cp = name, h = 0; *cp; h = (h << 2) + *cp++) ; h &= ~0100000; return(h % HSHSIZE); } h; register struct group *gp; if ((gh = findgroup(name)) == NOGRP) { printf("\"%s\": notcmd/ucbmail/version 755 0 33 61 2400701761 7557 date >/tmp/$$ ed - /tmp/$$ < :versfix rm /tmp/$$ gh->g_name); for (gp = gh->g_list; gp != NOGE; gp = gp->ge_link) printf(" %s", gp->ge_name); printf("\n"); } /* * Hash the passed string and return an index into * the variable or group hash table. */ hash(name) char name[]; { register int h; register char *cp; for (cp = name, h = 0; *cp; h = (h << 2) + *cp++) ; h &= ~0100000; return(h % HSHSIZE); } h/,5< /,"cmd/ucbmail/strings 644 0 33 0 2552572225 7542 cmd/cal.c 644 0 33 5140 2111463401 5471 char dayw[] = { " S M Tu W Th F S" }; char *smon[]= { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", }; char string[432]; main(argc, argv) char *argv[]; { register y, i, j; int m; if(argc < 2) { printf("usage: cal [month] year\n"); exit(0); } if(argc == 2) goto xlong; /* * print out just month */ m = number(argv[1]); if(m<1 || m>12) goto badarg; y = number(argv[2]); if(y<1 || y>9999) goto badarg; printf(" %s %u\n", smon[m-1], y); printf("%s\n", dayw); cal(m, y, string, 24); for(i=0; i<6*24; i+=24) pstr(string+i, 24); exit(0); /* * print out complete year */ xlong: y = number(argv[1]); if(y<1 || y>9999) goto badarg; printf("\n\n\n"); printf(" %u\n", y); printf("\n"); for(i=0; i<12; i+=3) { for(j=0; j<6*72; j++) string[j] = '\0'; printf(" %.3s", smon[i]); printf(" %.3s", smon[i+1]); printf(" %.3s\n", smon[i+2]); printf("%s %s %s\n", dayw, dayw, dayw); cal(i+1, y, string, 72); cal(i+2, y, string+23, 72); cal(i+3, y, string+46, 72); for(j=0; j<6*72; j+=72) pstr(string+j, 72); } printf("\n\n\n"); exit(0); badarg: printf("Bad argument\n"); } number(str) char *str; { register n, c; register char *s; n = 0; s = str; while(c = *s++) { if(c<'0' || c>'9') return(0); n = n*10 + c-'0'; } return(n); } pstr(str, n) char *str; { register i; register char *s; s = str; i = n; while(i--) if(*s++ == '\0') s[-1] = ' '; i = n+1; while(i--) if(*--s != ' ') break; s[1] = '\0'; printf("%s\n", str); } char mon[] = { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, }; cal(m, y, p, w) char *p; { register d, i; register char *s; s = p; d = jan1(y); mon[2] = 29; mon[9] = 30; switch((jan1(y+1)+7-d)%7) { /* * non-leap year */ case 1: mon[2] = 28; break; /* * 1752 */ default: mon[9] = 19; break; /* * leap year */ case 2: ; } for(i=1; i 9) *s = i/10+'0'; s++; *s++ = i%10+'0'; s++; if(++d == 7) { d = 0; s = p+w; p = s; } } } /* * return day of the week * of jan 1 of given year */ jan1(yr) { register y, d; /* * normal gregorian calendar * one extra day per four years */ y = yr; d = 4+y+(y+3)/4; /* * julian calendar * regular gregorian * less three days per 400 */ if(y > 1800) { d -= (y-1701)/100; d += (y-1601)/400; } /* * great calendar changeover instant */ if(y > 1752) d += 3; return(d%7); } = i/10+'0'; s++; *s++ = i%10+'0'; s++; if(++d == 7) { d = 0; s = p+w; p = s; } } } /* * return day of the week * of jan 1 of given year */ jan1(yr) { register y, d; /* * normal gregorian calendar * one extra day per four years */ y = yr; d = 4+y+(y+3)/4; /* * julian calendar * regular gregorian * less three days per 400 */ if(y > 1800) { d -= (y-1701)/100; d += (y-1601)cmd/calendar.sh 755 0 33 631 2425461036 6670 PATH=/bin:/usr/bin tmp=/tmp/cal$$ trap "rm $tmp /tmp/cal2$$; exit" 0 1 2 13 15 /usr/lib/calendar >$tmp case $# in 0) egrep -f $tmp calendar;; *) sed ' s/\([^:]*\):.*:\(.*\):[^:]*$/y=\2 z=\1/ ' /etc/passwd \ | while read x do eval $x if test -r $y/calendar; then egrep -f $tmp $y/calendar 2>/dev/null > /tmp/cal2$$ if [ -s /tmp/cal2$$ ] ; then < /tmp/cal2$$ mail $z fi fi done esac regular gr/( ,( 5< /\@,\D"cmd/apropos.sh 755 0 33 30 2424122606 6547 exec /usr/ucb/man -k $* tmp/cal$$ trap "rm $tmp /tmp/cal2$$; exit" 0 1 2 13 15 /usr/lib/calendar >$tmp case $# in 0) egrep -f $tmp calendar;; *) sed ' s/\([^:]*\):.*:\(.*\):[^:]*$/y=\2 z=\1/ ' /etc/passwd \ | while read x do eval $x if test -r $y/calendar; then egrep -f $tmp $y/calendar 2>/dev/null > /tmp/cal2$$ if [ -s /tmp/cal2$$ ] ; then < /tmp/cal2$$ mail $z fi fi done esac regular gr/( ,( 5< /\@,\D"cmd/berknet/ 775 0 33 0 2552522736 6155 cmd/berknet/mach.h 644 0 33 22275 2512735245 7346 /* sccs id variable */ static char *mach_h_sid = "@(#)mach.h 1.11"; /* mach.h -- define machine-dependent things *** Pre-processor Flags *** This set of code is controlled by this set of conditional compilation flags: TESTING if defined, do not generate tests, etc. which require super-user status. OLDTTY if defined, compile for old 1 character TTY names CCTTY if defined, compile for CC tty name format if neither is defined, use v7 ttyname format PASSWDF compile in code to handle /etc/passwdf(( - split passwd files V6 Assume the v6 features instead of the v7 ones. FUID use the funny uid's present on CC V6 DELIVERM Uses the delivermail program HPASSWD The local machine has the hashed password stuff OLDMAIL mail is in home-directory/.mail USRMAIL mail is in /usr/mail/name (mail is in /usr/spool/mail/name) CC Machine is a Computer Center machine NUID userid (as returned by getuid()) on this machine UID1CHAR Uses vanila Version6 userid's (only 1 byte for uid) NOEUID Does not have the geteuid() system call NFREECMD doesn't allow any "network" free commands NOFP floating point just doesn't work on this machine NOREMACCT allows netlpr's on remote machines without an account CSH use the /bin/csh shell (Paths.h sets BINSH to this path ). CRN CC crn's are passed DONTHOLDBIG large (size > MAXDAYFILE ) jobs wont be held until night for transmission SWAB this machine has byte-ordering reversed from the DEC VAX and PDP-11 standard (the only current example is Onyx) The conditonal flags are first defined in "/usr/include/whoami.h" on the local machine. For "normal" version 6 machines, there is a dummy machine definition for "VANILLA6" which indicates the v6 UNIX options. For "normal" version 7 machines, there is a dummy machine definition for "VANILLA7" which indicates the v7 UNIX options. (VM/UNIX and Berkeley VM/VAX/UNIX can use this) */ /* be sure to include before these defns */ # include # include /* note NUID is only used in mmail.c */ # ifdef RAND /* definitions for Rand-Unix */ # ifdef VAX # define LOCAL 'v' # define NUID (-1) # endif VAX # ifdef GRAPHICS # define V6 # define OLDTTY # define UID1CHAR # define OLDMAIL # define LOCAL 'g' # define NUID (-1) # endif GRAPHICS # ifdef TP # define LOCAL 't' # define V6 # define OLDTTY # define UID1CHAR # define OLDMAIL # define NUID (-1) # endif TP /* end of definitions for Rand */ # endif RAND # ifdef NOSC /* definitions for Naval Ocean Systems Center NOSC */ # ifdef ATTS # define LOCAL 'a' # define V6 # define OLDTTY # define UID1CHAR # define OLDMAIL # define NUID (-1) # endif ATTS # ifdef CCMM # define LOCAL 'c' # define V6 # define OLDTTY # define UID1CHAR # define OLDMAIL # define NUID (-1) # endif CCMM # ifdef MSSF # define V6 # define OLDTTY # define UID1CHAR # define OLDMAIL # define LOCAL 'm' # define NUID (-1) # endif MSSF /* end of definitions for NOSC */ # endif NOSC # ifdef BERKELEY /* definitions for Berkeley */ # ifdef A # define CCV7 # define LOCAL 'a' # endif A # ifdef B # define CCV7 # define LOCAL 'b' # endif B # ifdef C # define CCV7 # define LOCAL 'c' # endif C # ifdef D # define CCV7 # define LOCAL 'd' # endif D # ifdef E # define CCV7 # define LOCAL 'e' # endif E # ifdef F # define CCV7 # define LOCAL 'f' # endif F # ifdef G # define LOCAL 'g' # define NUID (501) # endif G # ifdef ING70 # define V6 # define OLDTTY # define UID1CHAR # define PASSWDF # define DELIVERM # define MULTNAMS # define FREELPR # define LOCAL 'i' # define NUID (174) /* correct vers. 7 = LOCAL, NUID */ # endif ING70 # ifdef INGVAX # define LOCAL 'j' # define NUID (37) # define FREELPR # define DELIVERM # endif INGVAX # ifdef VIRUS # define LOCAL 'k' # define NUID (-1) # endif VIRUS # ifdef IMAGE # define V6 # define OLDTTY # define UID1CHAR # define PASSWDF # define LOCAL 'm' # define NUID ((84 << 8) | 84) /* correct vers. 7 = LOCAL, NUID */ # endif IMAGE # ifdef KIM # define LOCAL 'n' # define NUID (XXX) # endif KIM # ifdef ESVAX # define LOCAL 'o' # define NUID (67) # endif ESVAX # ifdef CAD # define LOCAL 'p' # define NUID (67) # endif CAD # ifdef Q # define V6 # define CCV6 # define OLDTTY # define FUID # define PASSWDF # define USRMAIL # define NOEUID # define LOCAL 'q' # define NOREMACCT # define MAXSENDQ # define NUID ((11 << 8) | 38) # define MAXSENDQ 35 # define CRN # define MAGICCRN "3700" /* default CC crn */ /* correct vers. 7 = LOCAL, NUID */ # endif Q # ifdef ARPAVAX # define LOCAL 'r' # define NUID (501) # define DELIVERM # define MAXSENDQ 35 # endif ARPAVAX # ifdef SRC # define V6 # define OLDTTY # define FUID # define NOEUID # define LOCAL 's' # define NUID 38 # define USRMAIL /* correct vers. 7 = LOCAL, NUID */ # endif SRC # ifdef MATHSTAT # define LOCAL 't' # define NUID (-1) # endif MATHSTAT # ifdef CSVAX # define LOCAL 'v' # define NUID (501) # define DELIVERM # define MAXSENDQ 35 # endif CSVAX # ifdef ONYX # define LOCAL 'x' # define NUID (10) # define NOFP # define SWAB /* on the Ing70 their ncc can't take this undef, so you'll have to delete it when compiling on the Ing70 */ # undef PARMLIST # define PARMLIST 20 # endif ONYX # ifdef CORY # define LOCAL 'y' # define NUID (10) # define MAXSENDQ 35 # include # undef NETLDISC # define DELIVERM # endif CORY # ifdef EECS40 # define V6 # define OLDTTY # define USRMAIL # define PASSWDF # define UID1CHAR # define LOCAL 'z' # define NUID ((1 << 8) | 104) # define NFREECMD # define NOFP /* correct vers. 7 = LOCAL, NUID */ # endif EECS40 /* end of Berkeley definitions */ # endif BERKELEY /* the CC V6 machines are all the same. splitting their type into a separate group will allow the binary patching program "patchd" to be used to patch the binaries so the sources can be compiled on one CC machine and the binaries shipped around to the other CC machines. */ # ifdef CCV7 # undef CC # define NOREMACCT # define NUID (10) # define MAXSENDQ 35 # define CSH # define CRN # define MAGICCRN "3700" /* default CC crn */ # endif CCV7 # ifdef CC # define V6 # define CCV6 # define CCTTY # define PASSWDF # define FUID # define USRMAIL # define NUID (115) # define MAXSENDQ 35 # define NOREMACCT # define CSH # define CRN # define MAGICCRN "3700" /* default CC crn */ # endif CC /* default version 6 options */ # ifdef VANILLA6 # define V6 # define UID1CHAR # define OLDTTY # define OLDMAIL # endif VANILLA6 /* default version 7 options */ # ifdef VANILLA7 # endif VANILLA7 # ifndef V6 # include # include # include # include # include # include # include # include # include # include # define getsize(S) ((S)->st_size) # define gettime() (time(0)) int (*signal())(); /* #define SIG_DFL (int (*)())0 #define SIG_IGN (int (*)())1 */ # else V6 # define ETXTBSY 26 # define S_IREAD 0400 # define S_IFMT 060000 # define S_IFDIR 0040000 # define ANYP 0300 # define ECHO 010 # define ROOTINO 1 # define DIRSIZ 14 # define TIOCEXCL 0 # define SIGHUP 1 # define SIGINT 2 # define SIGQUIT 3 # define SIGKILL 9 # define SIGALRM 14 # define SIGTERM 15 # define SIG_IGN 1 # define ASSERT "Assertion failed: file %s, line %d\n", __FILE__, __LINE__);exit(1);}} # define assert(ex) {if (!(ex)){fprintf(stderr,ASSERT # define isprint(c) (040 <= c && c <= 0176) # define longjmp(a,b) reset() # define setjmp(a) setexit() struct stat { int st_dev; int st_ino; int st_mode; char st_nlink:8; char st_uid:8; char st_gid:8; char st_size0; int st_size1; int st_addr[8]; long st_atime; long st_mtime; }; struct direct { int d_ino; char d_name[DIRSIZ]; }; struct tms { /* see times - sect 2 */ int tms_utime; /* user time */ int tms_stime; /* system time */ long tms_cutime; /* user time, children */ long tms_cstime; /* system time, children */ }; struct sgttyb { char sg_ispeed; char sg_ospeed; char sg_erase; char sg_kill; int sg_flags; }; struct passwd { /* see getpwent(3) */ char *pw_name; char *pw_passwd; int pw_uid; int pw_gid; int pw_quota; char *pw_comment; char *pw_gecos; char *pw_dir; char *pw_shell; }; /* /usr/include/varargs.h */ typedef char *va_list; # define va_dcl int va_alist; # define va_start(list) list = (char *) &va_alist # define va_end(list) # define va_arg(list,mode) ((mode *)(list += sizeof(mode)))[-1] typedef int jmp_buf[10]; long gettime(), getsize(); # endif V6 /* end of non-v7 defns */ # ifdef FUID # define getgid(s) (0) # endif FUID # ifdef UID1CHAR # define uidmask(S) (S & 0377) # define geteuid() ((getuid()>>8)&0377) # else UID1CHAR # define uidmask(S) (S) # endif UID1CHAR # ifdef NOEUID # define geteuid(S) (-1) # endif NOEUID # ifdef CCTTY # define ttyname(S) myttyname(S) # endif CCTTY #ifdef CRN #include #endif CRN # ifdef OLDTTY /* this is the version 7 utmp structure. the getutmp() procedure converts the v6 structure into this format */ struct utmp { char ut_line[8]; /* tty name */ char ut_name[8]; /* user id */ long ut_time; /* time on */ }; # else OLDTTY # include # endif OLDTTY # define chfromf(S) (S ? 'T' : 'F') /* functions */ char *hgethome(), *calloc(), *ctime(), *getenv(); char *getname(), *getun(), *getlogin(); char *SnFromUid(), *ttyname(); struct passwd *getpwnam(), *getpwuid(); long atol(),time(); struct utmp *getutmp(); utmp structure. the getutmp() procedure converts the v6 structure into this format */ struct utmp { char ut_line[8]; /* tty name */ char ut_name[8]; /* user id */ long ut_time; /* time on */ }; # else OLDTTY # include # endif OLDTTY # define chfromf(S) (S ? 'T' : 'F') /* functions */ char *hgethome()cmd/berknet/v6mail.c 644 0 33 42540 2552441027 7620 /* * Version 6 Cory mail-- * a clean and simple mail program * machine and version independent * Eric Schmidt * must run as setuid root to chown the destination mailbox * if NOTROOT defined, doesn't need to run as root * * DON'T CHANGE THIS CODE * bitch to "csvax:schmidt" instead */ /* * mail command usage * mail [-yn] * prints your mail * mail people * sends standard input to people * * mail -r fromaddr people * sends mail from the network * * mail -d people * don't call delive((rmail, send mail directly * mail msgs * send to "msgs" * mail filename * mail to filename instead of user (must be at least one /) * mail -D * delete the invokers mailbox (more efficient than * mail -n >/dev/null) */ /* * bugs: * Ingres 11/70 multiple names/uid? * additions: * Save? type 'x' - doesn't unlink the mail file */ /* * BIFF is an immediate notification flag using the MPX stuff */ # include # include # include "mach.h" # ifdef RAND /* for all machines at RAND */ # define MAILMODE 0644 # endif RAND # ifdef NOSC /* for all machines at NOSC */ # define MAILMODE 0644 # endif NOSC # ifdef BERKELEY /* for Berkeley */ /* for each machine */ /* lump the CC machines into one */ # ifdef CCV7 # define MAILMODE 0600 # define MSGSCMD "/usr/ucb/bin/msgs" # endif # ifdef CCV6 # define MSGSCMD "/usr/bin/eecs/msgs" # define MAILMODE 0600 # endif # ifdef ING70 # define MAILMODE 0666 # define MSGSCMD "/usr/bin/msgs" # define NOTROOT # endif # ifdef INGVAX # define MAILMODE 0644 # define MSGSCMD "/usr/ucb/msgs" # endif # ifdef VIRUS # define MAILMODE 0644 # define MSGSCMD "/usr/bin/msgs" # endif # ifdef IMAGE # define MAILMODE 0644 # define MSGSCMD "/usr/bin/msgs" # endif # ifdef KIM # define MAILMODE 0644 # define MSGSCMD "/usr/ucb/msgs" # endif # ifdef ESVAX # define MAILMODE 0644 # define MSGSCMD "/usr/ucb/msgs" # endif # ifdef Q # define MAILMODE 0600 # define MSGSCMD "/usr/bin/eecs/msgs" # endif # ifdef ARPAVAX # define MAILMODE 0644 # define MSGSCMD "/usr/ucb/msgs" # define BIFF # endif # ifdef SRC # define MAILMODE 0600 # define MSGSCMD "/usr/bin/msgs" # endif # ifdef MATHSTAT # define MAILMODE 0600 # define MSGSCMD "/usr/bin/msgs" # endif # ifdef CSVAX # define MAILMODE 0644 # define MSGSCMD "/usr/ucb/msgs" # define BIFF # endif # ifdef ONYX # define MAILMODE 0644 # define MSGSCMD "/usr/ucb/bin/msgs" # endif # ifdef CORY # define MAILMODE 0600 # define MSGSCMD "/usr/bin/eecs/msgs" # endif # ifdef EECS40 # define MAILMODE 0644 # define MSGSCMD "/usr/bin/msgs" # endif /* end of berkeley defsn */ # endif /* end of per-machine ifdefs */ # ifndef BERKELEY # define MAILMODE 0644 # define MSGSCMD "/usr/ucb/msgs" # endif # ifdef USRMAIL # define MAILDIR "/usr/mail" # else # define MAILDIR "/usr/spool/mail" # endif char lettmp[] = "/tmp/MaXXXXX"; /* keep letter before sending it */ char preptmp[] = "/tmp/mbXXXXX"; /* if prepending msg, use this file */ int chew; /* if true, strip extra from lines */ int dflag; /* if true, don't call delivermail */ char shopcnt[30] = "0"; /* hop count parameter for rmt mail */ int errs; /* no of errs in sending */ char deleteonly; /* if true, just delete mailbox */ char remname[50]; /* if non-empty, from line extra */ char _sobuf[BUFSIZ]; main(argc, argv) char **argv; { register int myuid; int delexit(); char namebuf[128], *sn = NULL, logindir[60]; struct passwd *pwd; setbuf(stdout,_sobuf); mktemp(lettmp); mktemp(preptmp); unlink(lettmp); unlink(preptmp); myuid = getuid(); logindir[0] = 0; sn = getlogin(); if(sn == NULL || *sn == 0 || *sn == ' '){ pwd = getpwuid(myuid); /* will read passwd file */ if(pwd != NULL){ sn = pwd->pw_name; strcpy(logindir,pwd->pw_dir); } if(sn == NULL){ fprintf(stderr,"Who are you?\n"); delexit(EX_OSFILE); } } strcpy(namebuf,sn); if (argc < 2) goto hitit; for (argc--, argv++; argc > 0 && argv[0][0] == '-'; argc--, argv++) switch(argv[0][1]) { case 'y': case 'n': argc++, argv--; hitit: printmail(argc, argv, namebuf,logindir); delexit(EX_OK); case 'r': /* one-arg -r-- -r addr */ if (argc < 2) continue; /* ignore -r if not network or root */ if (strcmp("network", namebuf) == 0 || myuid == 0 || strcmp("uucp", namebuf) == 0 || index(argv[1], '!') != NULL) { strcpy(namebuf,argv[1]); chew++; /* eat From lines */ } else strcpy(remname, argv[1]); argc--, argv++; continue; case 'h': /* hop count - used by network */ if(argc < 2) continue; strcpy(shopcnt,argv[1]); argc--, argv++; continue; case 'd': /* really deliver this message */ dflag++; continue; case 'D': /* only delete the invokers mailbox */ deleteonly++; goto hitit; /* delete mail box, thats all */ } /* if we are already ignoring signals, catch sigint */ if(signal(SIGINT,SIG_IGN) != SIG_IGN) signal(SIGINT, delexit); argc++, argv--; bulkmail(argc, argv, namebuf); delexit(EX_OK); } printmail(argc, argv, name, logindir) char **argv; char *name, *logindir; { register int c; FILE *fdin; char sfnmail[60], mbox[120]; struct stat statbuf; # ifdef OLDMAIL if(logindir[0] == 0){ pwd = getpwuid(getuid()); if(pwd == NULL){ fprintf(stderr,"Can't get directory\n"); exit(EX_OSFILE); } strcpy(logindir, pwd->pw_dir); } sprintf(sfnmail,"%s/.mail",logindir); # else sprintf(sfnmail,"%s/%s",MAILDIR,name); # endif if(deleteonly){ remove(sfnmail); return; } if (stat(sfnmail, &statbuf)>=0 && statbuf.st_nlink==1 && getsize(&statbuf) > 0L && (fdin = fopen(sfnmail, "r")) != NULL){ getput(fdin, stdout); fclose(fdin); fflush(stdout); c = 'y'; if (argc<2) { if(isatty(0)){ printf("Save(y-n) ?"); fflush(stdout); c = getchar(); } } else c = argv[1][1]; if (!any(c, "xyn")) delexit(EX_OK); if (c == 'y') { sprintf(mbox,"%s/mbox",logindir); if (accesss(mbox)) { printf("Saved mail in 'mbox'\n"); if(insert(sfnmail, mbox, getuid(),getgid())) remove(sfnmail); } else printf("In wrong directory\n"); } else if(c != 'x') remove(sfnmail); } else printf("No mail.\n"); } bulkmail(argc, argv, from) char **argv, *from; { extern int errno; char linebuf[BUFSIZ]; char *getdate(); FILE *fdout; # ifdef DELIVERM /* ** Ship off to delivermail if appropriate (and possible) */ if (!dflag) { argv[0] = "-delivermail"; argv[argc] = 0; execv("/etc/delivermail", argv); /* oops... better just deliver it. */ fprintf(stderr, "Not using delivermail\n"); errno = 0; argv[argc] = (char *)-1; } # endif fdout = fopen(lettmp, "w"); if (fdout == NULL) { perror(lettmp); delexit(EX_OSFILE); } /* * If delivering mail from the network via mail -r, * Strip the leading line and throw it away, as long * as it begins with "From ..." (and preserve the date if poss.) */ if (chew) { fgets(linebuf,BUFSIZ,stdin); if(strncmp(linebuf,"From ",5) != 0){ fline(fdout,NULL,from); fprintf(fdout,"%s", linebuf); } else fline(fdout,getdate(linebuf),from); } else fline(fdout,NULL,from); if(remname[0]) fprintf(fdout,"(from %s)\n",remname); /* on the image machine, promt with subj */ if(getput(stdin,fdout) == 0) delexit(EX_OSERR); putc('\n',fdout); fclose(fdout); while (--argc > 0) sendto(*++argv,from); delexit(errs); } /* print from line, with date date, if date = NULL, compute it */ fline(fdout,date,from) FILE *fdout; char *date; char *from; { int tbuf[2]; if(date == NULL){ time(tbuf); date = ctime(tbuf); } fprintf(fdout,"From %s %s", from, date); } /* look over linebuf and return ptr to date, NULL if error */ char *getdate(linebuf) char *linebuf; { register char *s; s = linebuf; while(*s){ if(strncmp(s," Sun ",5) == 0 || strncmp(s," Mon ",5) == 0 || strncmp(s," Tue ",5) == 0 || strncmp(s," Wed ",5) == 0 || strncmp(s," Thu ",5) == 0 || strncmp(s," Fri ",5) == 0 || strncmp(s," Sat ",5) == 0) return(++s); s++; } return(NULL); } sendto(person, fromaddr) char *person; char *fromaddr; { static int saved = 0; register int hisuid, hisgid; char sfnmail[60], logindir[60]; struct passwd *pwd; stripmach(&person); if(person[0] == ':')person++; /* delivermail provides these services */ if(any(':',person) # ifdef MSGSCMD || strcmp(person,"msgs") == 0 # endif ){ int pid; int pidchild; while((pid = fork()) == -1)sleep(2); if (pid < 0) { perror("fork"); goto assback; } if (pid == 0) { fclose(stdin); freopen(lettmp,"r",stdin); setuid(getuid()); /* insure no security hole*/ if (strcmp(person,"msgs") != 0) { /* sendberkmail will add the machine, e.g. CSVAX:schmidt, if the -f flag is not set */ execl("/usr/net/bin/sendberkmail", "sendberkmail", "-t",person,"-h",shopcnt, chew ? "-f" : 0,fromaddr,0); perror("/usr/net/bin/sendberkmail"); } # ifdef MSGSCMD else { execl(MSGSCMD, "msgs", "-s", 0); perror(MSGSCMD); } # endif exit(EX_UNAVAILABLE); } for (;;) { register int rcode = wait(&pidchild); if (rcode == -1) goto assback; if (rcode == pid) break; } if ((pidchild & 0377) != 0 || (pidchild >> 8) != 0) goto assback; return; } if(!any('/',person)){ /* if name has no / in it, we assume it is a user's name */ # ifdef HPASSWD hisuid = uidfromsn(person); # else pwd = getpwnam(person); if(pwd != NULL){ hisuid = guid(pwd->pw_uid,pwd->pw_gid); hisgid = pwd->pw_gid; strcpy(logindir,pwd->pw_dir); } else hisuid = -1; # endif if(hisuid == -1){ assback: fflush(stdout); fprintf(stderr,"Can't send to %s.\n", person); errs++; if (isatty(0) && saved==0) { saved++; if (accesss("dead.letter")) { printf("Letter saved in 'dead.letter'\n"); insert(lettmp, "dead.letter", getuid(),getgid()); } else printf("In wrong directory\n"); } return; } # ifdef OLDMAIL sprintf(sfnmail,"%s/.mail",logindir); # else sprintf(sfnmail,"%s/%s",MAILDIR,person); # endif lock(sfnmail); insert(lettmp, sfnmail, hisuid, hisgid); unlock(); } else { /* it has / in it, "person" is a file */ if(accesss(person)){ lock(person); insert(lettmp, person, -1, -1); unlock(); } else fprintf(stderr,"Can't access %s\n",person); } } /* return 1 if success, 0 otherwise */ insert(from, to, uid, gid) char *from, *to; { # ifdef V6 return(prepend(from,to,uid, gid)); # else return(append(from,to,uid, gid)); # endif } /* return 1 if success, 0 otherwise */ append(from,to,uid, gid) char *from, *to; { register FILE *fdin, *fdout; int ret; struct stat statbuf; #ifdef BIFF /* biff ... */ char *rindex(); char *cp; char buf[100]; int f; /* end biff */ #endif BIFF if (((stat(to, &statbuf) >= 0 && (statbuf.st_mode&S_IFDIR) != 0) { fprintf(stderr, "Exotic destination %s\n", to); errs++; return(0); } if ((fdout = fopen(to, "a")) == NULL) { perror(to); errs++; return(0); } # ifndef NOTROOT if(uid != -1)mchown(to, uid, gid); # endif if(uid != -1)chmod(to, MAILMODE); if ((fdin = fopen(from, "r")) == NULL) { perror(from); return(0); } #ifdef BIFF { f = open("/dev/mail", 1); cp = rindex(to, '/'); if (cp) { sprintf(buf, "%s@%d\n", cp+1, ftell(fdout)); } } #endif BIFF ret = getput(fdin,fdout); fclose(fdin); fclose(fdout); #ifdef BIFF if (cp && f >= 0) { write(f, buf, strlen(buf)+1); close(f); } #endif BIFF return(ret); } /* return 1 if success, 0 otherwise */ prepend(from, to, uid, gid) char *from, *to; { register int (*sig)(); struct stat statbuf; FILE *fdout, *fdin; int ret; if (stat(to, &statbuf) >= 0 && (statbuf.st_mode&S_IFDIR) != 0) { fprintf(stderr, "Exotic destination %s\n", to); goto badexit; } unlink(preptmp); if ((fdout = fopen(preptmp, "w")) == NULL) { perror("mail"); goto badexit; } chmod(preptmp, MAILMODE); if ((fdin = fopen(from, "r")) == NULL) { perror("mail"); goto badexit; } if(getput(fdin,fdout) == 0){ perror("file i/o"); goto badexit; } fclose(fdin); fdin = fopen(to, "r"); /* ignore error since may not exist */ if(fdin != NULL && getput(fdin,fdout) == 0){ perror("file i/o"); goto badexit; } if(fdin != NULL)fclose(fdin); fclose(fdout); sig = signal(SIGINT, SIG_IGN); remove(to); if ((fdout = fopen(to, "w")) == NULL) { perror(to); unlink(preptmp); signal(SIGINT, sig); goto badexit; } # ifdef NOTROOT if(uid != -1)chmod(to,0666); # else if(uid != -1)mchown(to, uid, gid); # endif if(stat(to, &statbuf) < 0 || statbuf.st_nlink != 1) { fclose(fdout); signal(SIGINT, sig); goto badexit; } if ((fdin = fopen(preptmp, "r")) == NULL) { perror("mail"); signal(SIGINT, sig); goto badexit; } ret = getput(fdin,fdout); fclose(fdout); fclose(fdin); signal(SIGINT, sig); return(ret); badexit: unlink(preptmp); errs++; return(0); } delexit(ex) { unlink(lettmp); unlink(preptmp); exit(ex); } /* return 1 if ok, 0 otherwise */ getput(fdin, fdout) register FILE *fdin, *fdout; { extern int errno; register int c; while((c = getc(fdin)) != EOF) { errno = 0; putc(c,fdout); if(errno) { perror("mail"); return(0); } } return(1); } accesss(s1) register char *s1; { struct stat statbuf; if(stat(s1,&statbuf)<0 || access(s1,2) == 0) return(1); return(0); } any(c, str) register char *str, c; { register char *f; f = str; while (*f) if (c == *f++) return(1); return(0); } char locktmp[30]; /* Usable lock temporary */ char curlock[50]; /* Last used name of lock */ int locked; /* To note that we locked it */ /* * Lock the specified mail file by setting the file mailfile.lock. * We must, of course, be careful to unlink the lock file by a call * to unlock before we stop. The algorithm used here is to see if * the lock exists, and if it does, to check its modify time. If it * is older than 30 seconds, we assume error and set our own file. * Otherwise, we wait for 5 seconds and try again. */ lock(file) char *file; { register int f; struct stat statbuf; long curtime; /* if using OLDMAIL, and NOTROOT, cann't lock since can't necessarily write on user's login directory */ # ifdef OLDMAIL return; # endif if (file == NULL) { printf("Locked = %d\n", locked); return(0); } if (locked) return(0); sprintf(curlock,"%s%s",file,".lock"); sprintf(locktmp,"%s/tmXXXXXX",MAILDIR); mktemp(locktmp); unlink(locktmp); for (;;) { f = lock1(locktmp, curlock); if (f == 0) { locked = 1; return(0); } if (stat(curlock, &statbuf) < 0) return(0); time(&curtime); if (curtime < statbuf.st_mtime + 30) { sleep(5); continue; } unlink(curlock); } } /* * Remove the mail lock, and note that we no longer * have it locked. */ unlock() { if (locked) unlink(curlock); locked = 0; } /* * Attempt to set the lock by creating the temporary file, * then doing a link/unlink. If it fails, return -1 else 0 */ lock1(tempfile, name) char tempfile[], name[]; { int fno; fno = creat(tempfile, 0400); if (fno < 0) return(-1); close(fno); if (link(tempfile, name) < 0) { unlink(tempfile); return(-1); } unlink(tempfile); return(0); } /* stripfx(prefix string, pointer to string) takes a ptr to string and compares it to prefix string. may be called multiple times returns ":username" */ stripfx(pfx, name) register char *pfx; register char **name; { register char *cp = *name; while (*pfx && (*cp == *pfx || *cp == toupper(*pfx))) cp++, pfx++; if (*cp != ':' || *pfx != 0) return; *name = cp; } stripmach(pperson) register char **pperson; { # ifdef RAND /* for machines at RAND */ # ifdef GRAPHICS stripfx("g",pperson); stripfx("graphics",pperson); # endif # ifdef TP stripfx("t",pperson); stripfx("tp",pperson); # endif # ifdef VAX stripfx("v",pperson); stripfx("vax",pperson); # endif /* end of defns for Rand */ # endif # ifdef NOSC /* for machines at NOSC */ # ifdef ATTS stripfx("a",pperson); stripfx("atts",pperson); # endif # ifdef CCMM stripfx("c",pperson); stripfx("ccmm",pperson); # endif # ifdef MSSF stripfx("m",pperson); stripfx("mssf",pperson); # endif /* end of defns for NOSC */ # endif # ifdef BERKELEY /* for Berkeley */ # ifdef A stripfx("a",pperson); # endif # ifdef B stripfx("b",pperson); # endif # ifdef C stripfx("c",pperson); # endif # ifdef D stripfx("d",pperson); # endif # ifdef E stripfx("e",pperson); # endif # ifdef ING70 stripfx("i",pperson); stripfx("ing70",pperson); stripfx("ingres",pperson); # endif # ifdef INGVAX stripfx("j",pperson); stripfx("ingvax",pperson); # endif # ifdef VIRUS stripfx("k",pperson); stripfx("virus",pperson); # endif # ifdef IMAGE stripfx("m",pperson); stripfx("image",pperson); # endif # ifdef KIM stripfx("n",pperson); stripfx("kim",pperson); # endif # ifdef ESVAX stripfx("o",pperson); stripfx("esvax",pperson); # endif # ifdef Q stripfx("q",pperson); # endif # ifdef ARPAVAX stripfx("r",pperson); stripfx("arpavax",pperson); # endif # ifdef SRC stripfx("s",pperson); stripfx("src",pperson); # endif # ifdef MATHSTAT stripfx("t",pperson); stripfx("mathstat",pperson); # endif # ifdef CSVAX stripfx("v",pperson); stripfx("vax",pperson); stripfx("csvax",pperson); # endif # ifdef CORY stripfx("y",pperson); stripfx("cory",pperson); # endif # ifdef EECS40 stripfx("z",pperson); stripfx("eecs40",pperson); # endif /* end of berkeley defns */ # endif } /* this removes the mail file sfn by either truncating it, as required on OLDMAIL systems, or unlinking it. If the unlink fails, we truncate it. */ remove(sfn) char *sfn; { int i; # ifdef OLDMAIL i = creat(sfn,0666); if(i >= 0)close(i); # else if(unlink(sfn) < 0){ i = creat(sfn,MAILMODE); if(i >= 0)close(i); } # endif } CORY stripfx("y",pperson); stripfx("cory",pperson); # endif # ifdef EECS40 stripfx("z",pperson); stripfx("eecs40",pperson); # endif /* end of berkeley defnscmd/berknet/mach.c 644 0 33 25731 2512735247 7343 /* sccs id variable */ static char *mach_sid = "@(#)mach.c 1.6"; /* This file is meant to handle all the machine dependencies in the network code. Everything is conditionally compiled. It can be uses w/o network stuff to simulate v7 for other programs, too. */ # include # include "mach.h" char shomedir[100]; int debugflg; /* the CC and SRC machines have the submit() call */ # ifndef CC # ifndef SRC submit(a) {} # endif # endif # ifdef FUID setgid() {}; # endif /* Set the owner uid/gid of a file. On v7, this is done by the chown command with three args - (file, uid, gid). On Vanilla V6 this is done using the top byte of the second parameter as the gid byte. On Berkeley Funny uids on V6, no gid is specified. */ mchown(sfn,uid,gid) char *sfn; int uid; int gid; { # ifndef V6 chown(sfn,uid,gid); # else # ifndef FUID uid = uidmask(uid); uid = ((gid&0377) << 8) | (uid & 0377); # endif chown(sfn,uid); if(debugflg) fprintf(stderr, "chown %s to %d(%o)\n",sfn,uid,uid); # endif } /* SnFromuid(uid) The login name corresponding to uid. Reads the password file. Successive calls overwrite the static string returned. Returns NULL if error. */ char *SnFromUid(uid) register int uid; { register struct passwd *pwd; static int ouid = -1; static char oresult[20] = ""; uid = uidmask(uid); if(uid == ouid) return(oresult); # ifdef HPASSWD if(getname(uid,oresult) == 0){ ouid = uid; return(oresult); } # endif pwd = getpwuid(uid); if(pwd != NULL){ strcpy(oresult,pwd->pw_name); ouid = uid; return(oresult); } return(NULL); } uidfromsn(sn) register char *sn; { register int him = -1; register struct passwd *pwd; # ifdef HPASSWD him = getuserid(sn); # endif if(him == -1){ pwd = getpwnam(sn); if(pwd != NULL)him = guid(pwd->pw_uid,pwd->pw_gid); } return(him); } /* handle the regular unix and local mods difference for user id's */ /* this call returns the 1 word uid = to what getuid will return */ guid(uid,gid){ uid = uidmask(uid); # ifdef FUID return((uid & 0377) | (gid << 8)); # else return(uid); # endif } # ifdef OLDTTY isatty(i){ return(ttyn(i) != 'x'); } char *ttyname(i){ /* return NULL if not TTY */ char c; static char ttystr[] = "/dev/ttyx"; c = ttyn(i); ttystr[8] = c; return(c == 'x' ? NULL : ttystr); } # endif # ifdef CCTTY # undef ttyname() char *myttyname(i){ /* return NULL for non tty */ static char s[15],*p; p = ttyname(i); if(p == NULL)return(NULL); strcpy(s,"/dev/"); strcat(s,p); return(s); } # define ttynam((e(S) myttyname(S) # endif /* expand control chars in string s */ expandcc(s) register char *s; { char stemp[100]; register char *p; if(s == NULL)return; strcpy(stemp,s); p = stemp; while(*p){ if(!isprint(*p)){ *s++ = '^'; *s++ = *p++ + 0140; } else *s++ = *p++; } } /* get passwd from passwdf */ getpwdf(pwd) struct passwd *pwd; { # ifdef PASSWDF # ifndef TESTING register char *p, *q; char buf1[BUFSIZ], found; FILE *pw; debug("reading passwdf\n"); pwd->pw_passwd[0] = 0; pw = fopen("/etc/passwdf","r"); if(pw == NULL) return; found = 0; while(fgets(buf1,BUFSIZ,pw) != NULL){ for(p=buf1; *p && *p != ':'; p++); *p = 0; if(strcmp(buf1,pwd->pw_name) == 0){ found = 1; break; } } fclose(pw); if(!found)return; q = ++p; for(;*p && *p != ':';p++); *p = 0; strcpy(pwd->pw_passwd,q); /* debug("user %s passwd %s %s",pwd->pw_name,pwd->pw_passwd); */ # endif # endif } /* getutmp() return a pointer to the system utmp structure associated with terminal sttyname, e.g. "/dev/tty3" Is version independent-- will work on v6 systems return NULL if error */ struct utmp *getutmp(sttyname) char *sttyname; { # ifdef OLDTTY struct v6utmp { char v6ut_name[8]; char v6ut_tty; char v6ut_fill; long v6ut_time; int v6ut_fl1; } v6utmpstr; # endif static struct utmp utmpstr; FILE *fdutmp; debug("reading utmp\n"); if(sttyname == NULL || sttyname[0] == 0)return(NULL); fdutmp = fopen("/etc/utmp","r"); if(fdutmp == NULL)return(NULL); # ifndef OLDTTY while(fread(&utmpstr,1,sizeof utmpstr,fdutmp) == sizeof utmpstr) if(strcmp(utmpstr.ut_line,sttyname+5) == 0){ fclose(fdutmp); return(&utmpstr); } # else while(fread(&v6utmpstr,1,sizeof v6utmpstr,fdutmp) == sizeof v6utmpstr) if(v6utmpstr.v6ut_tty == sttyname[8]){ strcpy(utmpstr.ut_name,v6utmpstr.v6ut_name); strcpy(utmpstr.ut_line,"ttyx"); utmpstr.ut_line[3] = v6utmpstr.v6ut_tty; utmpstr.ut_time = v6utmpstr.v6ut_time; fclose(fdutmp); return(&utmpstr); } # endif fclose(fdutmp); return(NULL); } /* these are all the v7 routines not available on the v6 machines */ # ifdef V6 char **environ; /* global environment pointer */ ioctl(a,b,c){ return(0); /* always succeeds */ } long atol(s) register char *s; { long i = 0; while('0' <= *s && *s <= '9') i = i * 10 + (*s++ - '0'); return(i); } long gettime(){ long tt; time(&tt); return(tt); } long getsize(str) struct stat *str; { long wk; wk = ((long)(str->st_size0 & 0377)) << 16; wk += (long)((unsigned)str->st_size1); return(wk); } /* getenv("HOME") always returns home directory. returns NULL if there is error. */ char *getenv(){ register char *shdir = NULL; register struct passwd *pwd; register int it; if(shomedir[0] != 0)return(shomedir); # ifdef BERKELEY /* hget only works on Berkeley machines */ it = ttyn(2); # ifdef OLDTTY if(it == 'x')it = ttyn(1); if(it == 'x')it = ttyn(0); if(it != 'x' && hget(it) == 0)shdir = hgethome(); # endif # ifdef CCTTY if(it == -1)it = ttyn(1); if(it == -1)it = ttyn(0); if(it != -1 && hget(it) == 0)shdir = hgethome(); # endif # endif if(shdir == NULL){ pwd = PwdCurrent(); if(pwd != NULL)shdir = pwd->pw_dir; } if(shdir != NULL)strcpy(shomedir,shdir); return(shdir); } /* doesn't handle split passwd files */ struct passwd * getpwuid(uid) register uid; { register struct passwd *p; struct passwd *getpwent(); uid = uidmask(uid); setpwent(); while( (p = getpwent()) && guid(p->pw_uid,p->pw_gid) != uid ); endpwent(); return(p); } static char PASSWD[] = "/etc/passwd"; static char EMPTY[] = ""; static FILE *pwf = NULL; static char line[BUFSIZ+1]; static struct passwd passwd; setpwent() { debug("reading passwd\n"); if( pwf == NULL ) pwf = fopen( PASSWD, "r" ); else rewind( pwf ); } endpwent() { if( pwf != NULL ){ fclose( pwf ); pwf = NULL; } } static char * pwskip(p) register char *p; { while( *p && *p != ':' ) ++p; if( *p ) *p++ = 0; return(p); } struct passwd * getpwent() { register char *p; if (pwf == NULL) { if( (pwf = fopen( PASSWD, "r" )) == NULL ) return(0); } p = fgets(line, BUFSIZ, pwf); if (p==NULL) return(0); passwd.pw_name = p; p = pwskip(p); passwd.pw_passwd = p; p = pwskip(p); passwd.pw_uid = atoi(p); passwd.pw_uid = uidmask(passwd.pw_uid); p = pwskip(p); passwd.pw_gid = atoi(p); passwd.pw_quota = 0; passwd.pw_comment = EMPTY; p = pwskip(p); passwd.pw_gecos = p; p = pwskip(p); passwd.pw_dir = p; p = pwskip(p); passwd.pw_shell = p; while(*p && *p != '\n') p++; *p = '\0'; return(&passwd); } struct passwd * getpwnam(name) char *name; { register struct passwd *p; struct passwd *getpwent(); setpwent(); while( (p = getpwent()) && strcmp(name,p->pw_name) ); endpwent(); return(p); } /* getlogin() Return current user name by looking at /etc/utmp (calls getutmp()). Returns NULL if not found. */ char *getlogin() { register struct utmp *putmp; register char *s; char sttyname[30]; if(isatty(2))strcpy(sttyname,ttyname(2)); else if(isatty(0))strcpy(sttyname,ttyname(0)); else if(isatty(1))strcpy(sttyname,ttyname(1)); else return(NULL); putmp = getutmp(sttyname); if(putmp == NULL)return(NULL); s = putmp->ut_name; while(*s != 0 && *s != ' ')s++; *s = 0; if(putmp->ut_name[0] == 0)return(NULL); return(putmp->ut_name); } /* * Unix routine to do an "fopen" on file descriptor * The mode has to be repeated because you can't query its * status */ FILE * fdopen(fd, mode) register char *mode; { extern int errno; register FILE *iop; extern FILE *_lastbuf; for (iop = _iob; iop->_flag&(_IOREAD|_IOWRT); iop++) if (iop >= _lastbuf) return(NULL); iop->_cnt = 0; iop->_file = fd; if (*mode != 'r') { iop->_flag |= _IOWRT; if (*mode == 'a') lseek(fd, 0L, 2); } else iop->_flag |= _IOREAD; return(iop); } system(s) char *s; { int status, pid, w; register int (*istat)(), (*qstat)(); while((pid = fork()) == -1)sleep(2); if (pid == 0) { execl("/bin/sh", "sh", "-c", s, 0); _exit(127); } istat = signal(SIGINT, SIG_IGN); qstat = signal(SIGQUIT, SIG_IGN); while ((w = wait(&status)) != pid && w != -1) ; if (w == -1) status = -1; signal(SIGINT, istat); signal(SIGQUIT, qstat); return(status); } char * getpass(prompt) char *prompt; { struct sgttyb ttyb; int flags; register char *p; register c; FILE *fi = NULL; static char pbuf[9]; int (*signal())(); int (*sig)(); /* modified because Cory needs super-user to stty /dev/tty */ if ((fi = fopen("/dev/tty", "r")) == NULL) fi = stdin; else setbuf(fi, (char *)NULL); if(gtty(fileno(fi),&ttyb) < 0){ pbuf[0] = 0; return(pbuf); } /* if(gtty(0,&ttyb) >= 0)fi = stdin; else if(gtty(2,&ttyb) >= 0)fi = stderr; else { pbuf[0] = 0; return(pbuf); } */ sig = signal(SIGINT, SIG_IGN); flags = ttyb.sg_flags; ttyb.sg_flags &= ~ECHO; if(stty(fileno(fi), &ttyb) < 0) perror("stty:"); fprintf(stderr, prompt); for (p=pbuf; (c = getc(fi))!='\n' && c!=EOF;) { if (p < &pbuf[8]) *p++ = c; } *p = '\0'; fprintf(stderr, "\n"); ttyb.sg_flags = flags; stty(fileno(fi), &ttyb); signal(SIGINT, sig); if (fi != stdin) fclose(fi); return(pbuf); } /* * Compare strings (at most n bytes): s1>s2: >0 s1==s2: 0 s1= 0 && *s1 == *s2++) if (*s1++ == '\0') return(0); return(n<0 ? 0 : *s1 - *--s2); } /* set the umask, ignore in v6 */ umask(n){} /* end of non-vax v7 routines */ # endif /* PwdCurrent() Read the password file and return pwd to entry for current user. Return NULL if error. This code is a little screwed up because of the conventions regarding the state of the utmp file after someone su's-- either to root or to another person. The final decision was to return getpwuid(getuid) if the machine has one login name per userid, and if there are multiple login names per userid, to search the passwd file for the getlogin() name and return the passwd file entry for that. If there is no utmp entry, just use the userid. This means that people who su on machine with multiple user-id's will get the passwd entry for the account recorded in the utmp file, not their current userid. */ struct passwd * PwdCurrent() { register struct passwd *pwd; register char *sn; # ifdef MULTNAMS sn = getlogin(); if(sn != NULL && sn[0] != 0 && sn[0] != ' '){ pwd = getpwnam(sn); if(pwd != NULL)return(pwd); } # endif return(getpwuid(uidmask(getuid()))); } /*VARARGS0*/ debug(s,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,t) char *s; { if(debugflg){ printf(s,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,t); putchar('\n'); } } swd entry for the account recorded in cmd/berknet/makefile 664 0 33 477 2552440376 7731 v6mail: mach.o v6mail.o cc -n -s -z -o v6mail v6mail.o mach.o mach.o: mach.c mach.h cc -O -c mach.c v6mail.o: v6mail.c mach.h cc -O -c v6mail.c install: v6mail install -s v6mail ${DESTDIR}/usr/net/bin chown root ${DESTDIR}/usr/net/bin/v6mail chmod 4755 ${DESTDIR}/usr/net/bin/v6mail clean: rm -f *.o v6mail GS0*/ debug(s,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,t) char *s; { if(debugflg){ printf(s,a,b,c,d,e,f/,5< /,"cmd/pc0/ 775 0 33 0 2552606617 5206 ((cmd/pc0/0.h 644 0 33 46220 2552606567 5631 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)0.h 1.14 6/7/81"; */ #define DEBUG #define CONSETS #define CHAR #define STATIC #define hp21mx 0 #include #include typedef enum {FALSE, TRUE} bool; /* * Option flags * * The following options are recognized in the text of the program * and also on the command line: * * b block buffer the file output * * i make a listing of the procedures and functions in * the following include files * * l make a listing of the program * * n place each include file on a new page with a header * * p disable post mortem and statement limit counting * * t disable run-time tests * * u card image mode; only first 72 chars of input count * * w suppress special diagnostic warnings * * z generate counters for an execution profile */ #ifdef DEBUG bool fulltrace, errtrace, testtrace, yyunique; #endif DEBUG /* * Each option has a stack of 17 option values, with opts giving * the current, top value, and optstk the value beneath it. * One refers to option `l' as, e.g., opt('l') in the text for clarity. */ char opts[ 'z' - 'A' + 1]; short optstk[ 'z' - 'A' + 1]; #define opt(c) opts[c-'A'] /* * Monflg is set when we are generating * a pxp profile. this is set by the -z command line option. */ bool monflg; /* * profflag is set when we are generating a prof profile. * this is set by the -p command line option. */ bool profflag; /* * NOTES ON THE DYNAMIC NATURE OF THE DATA STRUCTURES * * Pi uses expandable tables for * its namelist (symbol table), string table * hash table, and parse tree space. The following * definitions specify the size of the increments * for these items in fundamental units so that * each uses approximately 1024 bytes. */ #define STRINC 1024 /* string space increment */ #define TRINC 512 /* tree space increment */ #define HASHINC 509 /* hash table size in words, each increment */ #define NLINC 56 /* namelist increment size in nl structs */ /* * The initial sizes of the structures. * These should be large enough to compile * an "average" sized program so as to minimize * storage requests. * On a small system or and 11/34 or 11/40 * these numbers can be trimmed to make the * compiler smaller. */ #define ITREE 2000 #define INL 200 #define IHASH 509 /* * The following limits on hash and tree tables currently * allow approximately 1200 symbols and 20k words of tree * space. The fundamental limit of 64k total data space * should be exceeded well before these are full. */ /* * TABLE_MULTIPLIER is for uniformly increasing the sizes of the tables */ #ifdef VAX #define TABLE_MULTIPLIER 8 #else #define TABLE_MULTIPLIER 1 #endif VAX #define MAXHASH (4 * TABLE_MULTIPLIER) #define MAXNL (12 * TABLE_MULTIPLIER) #define MAXTREE (30 * TABLE_MULTIPLIER) /* * MAXDEPTH is the depth of the parse stack. * STACK_MULTIPLIER is for increasing its size. */ #ifdef VAX #define STACK_MULTIPLIER 8 #else #define STACK_MULTIPLIER 1 #endif VAX #define MAXDEPTH ( 150 * STACK_MULTIPLIER ) /* * ERROR RELATED DEFINITIONS */ /* * Exit statuses to pexit * * AOK * ERRS Compilation errors inhibit obj productin * NOSTART Errors before we ever got started * DIED We ran out of memory or some such */ #define AOK 0 #define ERRS 1 #define NOSTART 2 #define DIED 3 bool Recovery; #define eholdnl() Eholdnl = 1 #define nocascade() Enocascade = 1 bool Eholdnl, Enocascade; /* * The flag eflg is set whenever we have a hard error. * The character in errpfx will precede the next error message. * When cgenflg is set code generation is suppressed. * This happens whenver we have an error (i.e. if eflg is set) * and when we are walking the tree to determine types only. */ bool eflg; char errpfx; #define setpfx(x) errpfx = x #define standard() setpfx('s') #define warning() setpfx('w') #define recovered() setpfx('e') int cgenflg; /* * The flag syneflg is used to suppress the diagnostics of the form * E 10 a, defined in someprocedure, is neither used nor set * when there were syntax errors in "someprocedure". * In this case, it is likely that these warinings would be spurious. */ bool syneflg; /* * The compiler keeps its error messages in a file. * The variable efil is the unit number on which * this file is open for reading of error message text. * Similarly, the file ofil is the unit of the file * "obj" where we write the interpreter code. */ short efil; short ofil; short obuf[518]; bool Enoline; #define elineoff() Enoline = TRUE #define elineon() Enoline = FALSE /* * SYMBOL TABLE STRUCTURE DEFINITIONS * * The symbol table is henceforth referred to as the "namelist". * It consists of a number of structures of the form "nl" below. * These are contained in a number of segments of the symbol * table which are dynamically allocated as needed. * The major namelist manipulation routines are contained in the * file "nl.c". * * The major components of a namelist entry are the "symbol", giving * a pointer into the string table for the string associated with this * entry and the "class" which tells which of the (currently 19) * possible types of structure this is. * * Many of the classes use the "type" field for a pointer to the type * which the entry has. * * Other pieces of information in more than one class include the block * in which the symbol is defined, flags indicating whether the symbol * has been used and whether it has been assigned to, etc. * * A more complete discussion of the features of the namelist is impossible * here as it would be too voluminous. Refer to the "PI 1.0 Implementation * Notes" for more details. */ /* * The basic namelist structure. * There are also two other variants, defining the real * field as longs or integers given below. * * The array disptab defines the hash header for the symbol table. * Symbols are hashed based on the low 6 bits of their pointer into * the string table; see the routines in the file "lookup.c" and also "fdec.c" * especially "funcend". */ extern struct nl *Fp; extern int pnumcnt; #ifdef PTREE # include "pTree.h" #endif PTREE struct nl { char *symbol; char class, nl_flags; #ifdef PC char extra_flags; /* for where things are */ #endif PC struct nl *type; struct nl *chain, *nl_next; int value[5]; # ifdef PTREE pPointer inTree; # endif PTREE } *nlp, *disptab[077+1]; extern struct nl nl[INL]; struct { char *symbol; char class, nl_flags; #ifdef PC char extra_flags; #endif struct nl *type; struct nl *chain, *nl_next; double real; }; struct { char *symbol; char class, nl_block; #ifdef PC char extra_flags; #endif struct nl *type; struct nl *chain, *nl_next; long range[2]; }; struct { char *symbol; char class, nl_flags; #ifdef PC char extra_flags; #endif struct nl *type; struct nl *chain, *nl_next; int *ptr[4]; #ifdef PI int entloc; #endif PI }; /* * NL FLAGS BITS * * Definitions of the usage of the bits in * the nl_flags byte. Note that the low 5 bits of the * byte are the "nl_block" and that some classes make use * of this byte as a "width". * * The only non-obvious bit definition here is "NFILES" * which records whether a structure contains any files. * Such structures are not allowed to be dynamically allocated. */ #define BLOCKNO( flag ) ( flag & 037 ) #define NLFLAGS( flag ) ( flag &~ 037 ) #define NUSED 0100 #define NMOD 0040 #define NFORWD 0200 #define NFILES 0200 #ifdef PC #define NEXTERN 0001 /* flag used to mark external funcs and procs */ #define NLOCAL 0002 /* variable is a local */ #define NPARAM 0004 /* variable is a parameter */ #define NGLOBAL 0010 /* variable is a global */ #define NREGVAR 0020 /* or'ed in if variable is in a register */ #endif PC /* * used to mark value[ NL_FORV ] for loop variables */ #define FORVAR 1 /* * Definition of the commonly used "value" fields. * The most important one is NL_OFFS which gives * the offset of a variable in its stack mark. */ #define NL_OFFS 0 #define NL_CNTR 1 #define NL_NLSTRT 2 #define NL_LINENO 3 #define NL_FVAR 3 #define NL_FCHAIN 4 #define NL_GOLEV 2 #define NL_GOLINE 3 #define NL_FORV 1 #define NL_FLDSZ 1 #define NL_VARNT 2 #define NL_VTOREC 2 #define NL_TAG 3 #define NL_ELABEL 4 /* * For BADUSE nl structures, NL_KINDS is a bit vector * indicating the kinds of illegal usages complained about * so far. For kind of bad use "kind", "1 << kind" is set. * The low bit is reserved as ISUNDEF to indicate whether * this identifier is totally undefined. */ #define NL_KINDS 0 #define ISUNDEF 1 /* * variables come in three flavors: globals, parameters, locals; * they can also hide in registers, but that's a different flag */ #define PARAMVAR 1 #define LOCALVAR 2 #define GLOBALVAR 3 /* * NAMELIST CLASSES * * The following are the namelist classes. * Different classes make use of the value fields * of the namelist in different ways. * * The namelist should be redesigned by providing * a number of structure definitions with one corresponding * to each namelist class, ala a variant record in Pascal. */ #define BADUSE 0 #define CONST 1 #define TYPE 2 #define VAR 3 #define ARRAY 4 #define PTRFILE 5 #define RECORD 6 #define FIELD 7 #define PROC 8 #define FUNC 9 #define FVAR 10 #define REF 11 #define PTR 12 #define FILET 13 #define SET 14 #define RANGE 15 #define LABEL 16 #define WITHPTR 17 #define SCAL 18 #define STR 19 #define PROG 20 #define IMPROPER 21 #define VARNT 22 #define FPROC 23 #define FFUNC 24 /* * Clnames points to an array of names for the * namelist classes. */ char **clnames; /* * PRE-DEFINED NAMELIST OFFS((ETS * * The following are the namelist offsets for the * primitive types. The ones which are negative * don't actually exist, but are generated and tested * internally. These definitions are sensitive to the * initializations in nl.c. */ #define TFIRST -7 #define TFILE -7 #define TREC -6 #define TARY -5 #define TSCAL -4 #define TPTR -3 #define TSET -2 #define TSTR -1 #define NIL 0 #define TBOOL 1 #define TCHAR 2 #define TINT 3 #define TDOUBLE 4 #define TNIL 5 #define T1INT 6 #define T2INT 7 #define T4INT 8 #define T1CHAR 9 #define T1BOOL 10 #define T8REAL 11 #define TLAST 11 /* * SEMANTIC DEFINITIONS */ /* * NOCON and SAWCON are flags in the tree telling whether * a constant set is part of an expression. * these are no longer used, * since we now do constant sets at compile time. */ #define NOCON 0 #define SAWCON 1 /* * The variable cbn gives the current block number, * the variable bn is set as a side effect of a call to * lookup, and is the block number of the variable which * was found. */ short bn, cbn; /* * The variable line is the current semantic * line and is set in stat.c from the numbers * embedded in statement type tree nodes. */ short line; /* * The size of the display * which defines the maximum nesting * of procedures and functions allowed. * Because of the flags in the current namelist * this must be no greater than 32. */ #define DSPLYSZ 20 /* * the display is made up of saved AP's and FP's. * FP's are used to find locals, and AP's are used to find parameters. * FP and AP are untyped pointers, but are used throughout as (char *). * the display is used by adding AP_OFFSET or FP_OFFSET to the * address of the approriate display entry. */ struct dispsave { char *savedAP; char *savedFP; } display[ DSPLYSZ ]; #define AP_OFFSET ( 0 ) #define FP_OFFSET ( sizeof(char *) ) /* * formal routine structure: */ struct formrtnhead { long (*fentryaddr)(); /* formal entry point */ long fbn; /* block number of function */ } frtn; #define FENTRYOFFSET 0 #define FBNOFFSET ( FENTRYOFFSET + sizeof frtn.fentryaddr ) #define FDISPOFFSET ( FBNOFFSET + sizeof frtn.fbn ) /* * The following structure is used * to keep track of the amount of variable * storage required by each block. * "Max" is the high water mark, "off" * the current need. Temporaries for "for" * loops and "with" statements are allocated * in the local variable area and these * numbers are thereby changed if necessary. */ struct om { long om_max; long reg_max; struct tmps { long om_off; long reg_off; } curtmps; } sizes[DSPLYSZ]; #define NOREG 0 #define REGOK 1 /* * the following structure records whether a level declares * any variables which are (or contain) files. * this so that the runtime routines for file cleanup can be invoked. */ bool dfiles[ DSPLYSZ ]; /* * Structure recording information about a constant * declaration. It is actually the return value from * the routine "gconst", but since C doesn't support * record valued functions, this is more convenient. */ struct { struct nl *ctype; short cival; double crval; int *cpval; } con; /* * The set structure records the lower bound * and upper bound with the lower bound normalized * to zero when working with a set. It is set by * the routine setran in var.c. */ struct { short lwrb, uprbp; } set; /* * structures of this kind are filled in by precset and used by postcset * to indicate things about constant sets. */ struct csetstr { struct nl *csettype; long paircnt; long singcnt; bool comptime; }; /* * The following flags are passed on calls to lvalue * to indicate how the reference is to affect the usage * information for the variable being referenced. * MOD is used to set the NMOD flag in the namelist * entry for the variable, ASGN permits diagnostics * to be formed when a for variable is assigned to in * the range of the loop. */ #define NOFLAGS 0 #define MOD 01 #define ASGN 02 #define NOUSE 04 /* * the following flags are passed to lvalue and rvalue * to tell them whether an lvalue or rvalue is required. * the semantics checking is done according to the function called, * but for pc, lvalue may put out an rvalue by indirecting afterwards, * and rvalue may stop short of putting out the indirection. */ #define LREQ 01 #define RREQ 02 double MAXINT; double MININT; /* * Variables for generation of profile information. * Monflg is set when we want to generate a profile. * Gocnt record the total number of goto's and * cnts records the current counter for generating * COUNT operators. */ short gocnt; short cnts; /* * Most routines call "incompat" rather than asking "!compat" * for historical reasons. */ #define incompat !compat /* * Parts records which declaration parts have been seen. * The grammar allows the "label" "const" "type" "var" and routine * parts to be repeated and to be in any order, so that * they can be detected semantically to give better * error diagnostics. */ int parts[ DSPLYSZ ]; #define LPRT 1 #define CPRT 2 #define TPRT 4 #define VPRT 8 #define RPRT 16 /* * Flags for the "you used / instead of div" diagnostic */ bool divchk; bool divflg; bool errcnt[DSPLYSZ]; /* * Forechain links those types which are * ^ sometype * so that they can be evaluated later, permitting * circular, recursive list structures to be defined. */ struct nl *forechain; /* * Withlist links all the records which are currently * opened scopes because of with statements. */ struct nl *withlist; struct nl *intset; struct nl *input, *output; struct nl *program; /* progseen flag used by PC to determine if * a routine segment is being compiled (and * therefore no program statement seen) */ bool progseen; /* * STRUCTURED STATEMENT GOTO CHECKING * * The variable level keeps track of the current * "structured statement level" when processing the statement * body of blocks. This is used in the detection of goto's into * structured statements in a block. * * Each label's namelist entry contains two pieces of information * related to this check. The first `NL_GOLEV' either contains * the level at which the label was declared, `NOTYET' if the label * has not yet been declared, or `DEAD' if the label is dead, i.e. * if we have exited the level in which the label was defined. * * When we discover a "goto" statement, if the label has not * been defined yet, then we record the current level and the current line * for a later error check. If the label has been already become "DEAD" * then a reference to it is an error. Now the compiler maintains, * for each block, a linked list of the labels headed by "gotos[bn]". * When we exit a structured level, we perform the routine * ungoto in stat.c. It notices labels whose definition levels have been * exited and makes them be dead. For labels which have not yet been * defined, ungoto will maintain NL_GOLEV as the minimum structured level * since the first usage of the label. It is not hard to see that the label * must eventually be declared at this level or an outer level to this * one or a goto into a structured statement will exist. */ short level; struct nl *gotos[DSPLYSZ]; #define NOTYET 10000 #define DEAD 10000 /* * Noreach is true when the next statement will * be unreachable unless something happens along * (like exiting a looping construct) to save * the day. */ bool noreach; /* * UNDEFINED VARIABLE REFERENCE STRUCTURES */ struct udinfo { int ud_line; struct udinfo *ud_next; char nullch; }; /* * CODE GENERATION DEFINITIONS */ /* * NSTAND is or'ed onto the abstract machine opcode * for non-standard built-in procedures and functions. */ #define NSTAND 0400 #define codeon() cgenflg++ #define codeoff() --cgenflg #define CGENNING ( cgenflg >= 0 ) /* * Codeline is the last lino output in the code generator. * It used to be used to suppress LINO operators but no * more since we now count statements. * Lc is the intepreter code location counter. * short codeline; */ char *lc; /* * Routines which need types * other than "integer" to be * assumed by the compiler. */ double atof(); long lwidth(); long leven(); long aryconst(); long a8tol(); long roundup(); struct nl *tmpalloc(); struct nl *lookup(); double atof(); int *tree(); int *hash(); char *alloc(); int *calloc(); char *savestr(); char *parnam(); bool fcompat(); struct nl *lookup1(); struct nl *hdefnl(); struct nl *defnl(); struct nl *enter(); struct nl *nlcopy(); struct nl *tyrecl(); struct nl *tyary(); struct nl *fields(); struct nl *variants(); struct nl *deffld(); struct nl *defvnt(); struct nl *tyrec1(); struct nl *reclook(); struct nl *asgnop1(); struct nl *gtype(); struct nl *call(); struct nl *lvalue(); struct nl *rvalue(); struct nl *cset(); /* * type cast NIL to keep lint happy (which is not so bad) */ #define NLNIL ( (struct nl *) NIL ) /* * Funny structures to use * pointers in wild and wooly ways */ struct { char pchar; }; struct { short pint; short pint2; }; struct { long plong; }; struct { double pdouble; }; #define OCT 1 #define HEX 2 /* * MAIN PROGRAM VARIABLES, MISCELLANY */ /* * Variables forming a data base referencing * the command line arguments with the "i" option, e.g. * in "pi -i scanner.i compiler.p". */ char **pflist; short pflstc; short pfcnt; char *filename; /* current source file name */ long tvec; extern char *snark; /* SNARK */ extern char *classes[ ]; /* maps namelist classes to string names */ #define derror error #ifdef PC /* * the current function number, for [ lines */ int ftnno; /* * the pc output stream */ FILE *pcstream; #endif PC a data base referencing * the command line arguments with the "i" option, e.g. * in "pi -i scanner.i compiler.p". */ char **pflist; short pflstc; short pfcnt; char *filename; /* current source file name */ long tvec; extern char *snark; /* SNARK */ extern char *classes[ ]; /* maps namelist classes to string names */ #define derror error #ifdef PC /* ((cmd/pc0/OPnames.h 644 0 33 5073 2552606567 7015 /* static char sccsid[] = "@(#)OPnames.h 1.2 10/2/80"; */ char *otext[] = { 0, " NODUMP", " BEG", " END", " CALL", " FCALL", " FRTN", " FSAV", " SDUP2", " SDUP4", " TRA", " TRA4", " GOTO", " LINO", " PUSH", 0, " IF", " REL2", " REL4", " REL24", " REL42", " REL8", " RELG", " RELT", " REL28", " REL48", " REL82", " REL84", " AND", " OR", " NOT", 0, " AS2", " AS4", " AS24", " AS42", " AS21", " AS41", " AS28", " AS48", " AS8", " AS", " INX2P2", " INX4P2", " INX2", " INX4", " OFF", " NIL", " ADD2", " ADD4", " ADD24", " ADD42", " ADD28", " ADD48", " ADD82", " ADD84", " SUB2", " SUB4", " SUB24", " SUB42", " SUB28", " SUB48", " SUB82", " SUB84", " MUL2", " MUL4", " MUL24", " MUL42", " MUL28", " MUL48", " MUL82", " MUL84", " ABS2", " ABS4", " ABS8", 0, " NEG2", " NEG4", " NEG8", 0, " DIV2", " DIV4", " DIV24", " DIV42", " MOD2", " MOD4", " MOD24", " MOD42", " ADD8", " SUB8", " MUL8", " DVD8", " STOI", " STOD", " ITOD", " ITOS", " DVD2", " DVD4", " DVD24", " DVD42", " DVD28", " DVD48", " DVD82", " DVD84", " RV1", " RV14", " RV2", " RV24", " RV4", " RV8", " RV", " LV", " LRV1", " LRV14", " LRV2", " LRV24", " LRV4", " LRV8", " LRV", " LLV", " IND1", " IND14", " IND2", " IND24", " IND4", " IND8", " IND", 0, " CON1", " CON14", " CON2", " CON24", " CON4", " CON8", " CON", " LVCON", " RANG2", " RANG42", " RSNG2", " RSNG42", " RANG4", " RANG24", " RSNG4", " RSNG24", " STLIM", " LLIMIT", " BUFF", " HALT", 0, 0, 0, 0, "*ORD2", "*CONG", "*CONC", "*CONC4", "*ABORT", " PXPBUF", " COUNT", 0, " CASE1OP", " CASE2OP", " CASE4OP", "*CASEBEG", "*CASE1", "*CASE2", "*CASE4", "*CASEEND", " ADDT", " SUBT", " MULT", " INCT", " CTTOT", " CARD", " IN", " ASRT", " FOR1U", " FOR2U", " FOR4U", " FOR1D", " FOR2D", " FOR4D", 0, 0, " READE", " READ4", " READC", " READ8", " READLN", " EOF", " EOLN", 0, " WRITEC", " WRITES", " WRITEF", " WRITLN", " PAGE", " NAM", " MAX", " MIN", " UNIT", " UNITINP", " UNITOUT", " MESSAGE", " GET", " PUT", " FNIL", 0, " DEFNAME", " RESET", " REWRITE", " FILE", " REMOVE", " FLUSH", 0, 0, " PACK", " UNPACK", " ARGC", " ARGV", 0, 0, 0, 0, " CLCK", " WCLCK", " SCLCK", " DISPOSE", " NEW", " DATE", " TIME", " UNDEF", " ATAN", " COS", " EXP", " LN", " SIN", " SQRT", " CHR2", " CHR4", " ODD2", " ODD4", " PRED2", " PRED4", " PRED24", " SUCC2", " SUCC4", " SUCC24", " SEED", " RANDOM", " EXPO", " SQR2", " SQR4", " SQR8", " ROUND", " TRUNC" }; MESSAGE", " GET", " PUT", " FNIL", 0, " DEFNAME", " RESET", " REWRITE", " FILE", " REMOVE", " FLUSH", 0, 0, " PACK", " UNPACK", " ARGC", " ARGV", 0, 0, 0, 0, " CLCK", " WCLCK", " SCLCK", " DISPOSE", " NEW", " DATE", " TIME", " UNDEF", " ATAN", " COS", " EXP", " LN", " SIN", " SQRT", " CHR2", " CHR4", " ODD2", " ODD4", " PRED2", " PRED4", " PRED24", " SUCC2", " SUCC4", " SUCC24", " SEED", " RANDOM", " EXcmd/pc0/TRdata.c 644 0 33 3343 2552606567 6623 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)TRdata.c 1.1 8/27/80"; #include "whoami.h" #include "0.h" #ifdef PI1 #ifdef DEBUG char *trnames[] { 0, "MINUS", "MOD", "DIV", "DIVD", "MULT", "ADD", "SUB", "EQ", "NE", "LT", "GT", "LE", "GE", "NOT", "AND", "OR", "ASGN", "PLUS", "IN", "LISTPP", "PDEC", "FDEC", "PVAL", "PVAR", "PFUNC", "PPROC", "NIL", "STRNG", "CSTRNG", "PLUSC", "MINUSC", "ID", "INT", "FINT", "CINT", "CFINT", "TYPTR", "TYPACK", "TYSCAL", "TYRANG", "TYARY", "TYFILE", "TYSET", "TYREC", "TYFIELD", "TYVARPT", "TYVARNT", "CSTAT", "BLOCK", "BSTL", "LABEL", "PCALL", "FCALL", "CASE", "WITH", "WHILE", "REPEAT", "FORU", "FORD", "GOTO", "IF", "ASRT", "CSET", "RANG", "VAR", "ARGL", "ARY", "FIELD", "PTR", "WEXP", "PROG", "BINT", "CBINT", "IFEL", "IFX", "TYID", "COPSTR", "BOTTLE", "RFIELD", "FLDLST", "LAST" }; #endif #endif char *trdesc[] { 0, "dp", "dpp", "dpp", "dpp", "dpp", "dpp", "dpp", "dpp", "dpp", "dpp", "dpp", "dpp", "dpp", "dp", "dpp", "dpp", "npp", "dp", "dpp", "pp", "n\"pp", "n\"pp", "pp", "pp", "pp", "p", "d", "dp", "p", "p", "p", "p", "dp", "dp", "p", "p", "np", "np", "np", "npp", "npp", "np", "np", "np", "pp", "nppp", "npp", "npp", "np", "np", "n\"p", "n\"p", "n\"p", "npp", "npp", "npp", "npp", "nppp", "nppp", "n\"", "nppp", "np", "dp", "pp", "n\"p", "p", "p", "pp", "", "ppp", "n\"pp", "dp", "p", "nppp", "nppp", "np", "s", "nnnnn", "npp", "npp", "x" }; char *opnames[] { 0, "unary -", "mod", "div", "/", "*", "+", "-", "=", "<>", "<", ">", "<=", ">=", "not", "and", "or", ":=", "unary +", "in" }; "np", "np", "np", "npp", "npp", "np", "np", "np", "pp", "nppp", "npp", "npp", "np", "np", "n\"p", "n\"p", "n\"p", "npp", "npp", "npp", "npp", "nppp", "nppp", "n\"", "nppp", "np", "dp", "pp", "n\"p", "p", "p", "pp", "", "ppp", "n\"pp", "dp", "p", "cmd/pc0/align.h 644 0 33 720 2552606570 6511 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)align.h 1.1 8/27/80"; */ /* * alignment of various types in bytes. * sizes are found using sizeof( type ). */ #define A_CHAR 1 #define A_INT 4 #define A_FLOAT 4 #define A_DOUBLE 4 #define A_LONG 4 #define A_SHORT 2 #define A_POINT 4 #define A_STRUCT 1 #define A_STACK 4 #define A_FILET 4 #define A_SET 4 #define A_MIN 1 #define A_MAX 4  /,"cmd/pc0/ato.c 644 0 33 1246 2552606570 6221 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)ato.c 1.2 3/8/81"; #include "whoami.h" #include "0.h" long a8tol(cp) char *cp; { int err; long l; register CHAR c; l = 0; err = 0; while ((c = *cp++) != '\0') { if (c == '8' || c == '9') if (err == 0) { error("8 or 9 in octal number"); err++; } c -= '0'; if ((l & 016000000000L) != 0) if (err == 0) { error("Number too large for this implementation"); err++; } l = (l << 3) | c; } return (l); } /* * Note that the version of atof * used in this compiler does not * (sadly) complain when floating * point numbers are too large. */ char *cp; { int err; long l; register CHAR c; l = 0; err = 0; while ((c = *cp++) != '\0') { if (c == '8' || c == '9') if (err == 0) { error("8 or 9 in octal number"); err++; } c -= '0'; if ((l & 016000000000L) != 0) if (err == 0) { error("Number too large for this implementation"); err++; } l = (l << 3cmd/pc0/call.c 644 0 33 31125 2552606570 6370 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)call.c 1.17 6/12/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "opcode.h" #include "objfmt.h" #ifdef PC # include "pc.h" # include "pcops.h" #endif PC /* * Call generates code for calls to * user defined procedures and functions * and is called by proc and funccod. * P is the result of the lookup * of the procedure/function symbol, * and porf is PROC or FUNC. * Psbn is the block number of p. * * the idea here is that regular scalar functions are just called, * while structure functions and formal functions have their results * stored in a temporary after the call. * structure functions do this because they return pointers * to static results, so we copy the static * and return a pointer to the copy. * formal functions do this because we have to save the result * around a call to the runtime routine which restores the display, * so we can't just leave the result lying around(( in registers. * formal calls save the address of the descriptor in a local * temporary, so it can be addressed for the call which restores * the display (FRTN). * calls to formal parameters pass the formal as a hidden argument * to a special entry point for the formal call. * [this is somewhat dependent on the way arguments are addressed.] * so PROCs and scalar FUNCs look like * p(...args...) * structure FUNCs look like * (temp = p(...args...),&temp) * formal FPROCs look like * ( t=p,( t -> entryaddr )(...args...,t),FRTN( t )) * formal scalar FFUNCs look like * ( t=p,temp=( t -> entryaddr )(...args...,t),FRTN( t ),temp) * formal structure FFUNCs look like * (t=p,temp = ( t -> entryaddr )(...args...,t),FRTN( t ),&temp) */ struct nl * call(p, argv, porf, psbn) struct nl *p; int *argv, porf, psbn; { register struct nl *p1, *q; int *r; struct nl *p_type_class = classify( p -> type ); bool chk = TRUE; # ifdef PC long p_p2type = p2type( p ); long p_type_p2type = p2type( p -> type ); bool noarguments; long calltype; /* type of the call */ /* * these get used if temporaries and structures are used */ struct nl *tempnlp; long temptype; /* type of the temporary */ long p_type_width; long p_type_align; char extname[ BUFSIZ ]; struct nl *tempdescrp; # endif PC # ifdef OBJ if (p->class == FFUNC || p->class == FPROC) { put(2, PTR_RV | psbn << 8+INDX, (int)p->value[NL_OFFS]); } if (porf == FUNC) { /* * Push some space * for the function return type */ put(2, O_PUSH, leven(-lwidth(p->type))); } # endif OBJ # ifdef PC /* * if this is a formal call, * stash the address of the descriptor * in a temporary so we can find it * after the FCALL for the call to FRTN */ if ( p -> class == FFUNC || p -> class == FPROC ) { tempdescrp = tmpalloc(sizeof( struct formalrtn *) , NIL , REGOK ); putRV( 0 , cbn , tempdescrp -> value[ NL_OFFS ] , tempdescrp -> extra_flags , P2PTR|P2STRTY ); putRV( 0 , psbn , p -> value[ NL_OFFS ] , p -> extra_flags , P2PTR|P2STRTY ); putop( P2ASSIGN , P2PTR | P2STRTY ); } /* * if we have to store a temporary, * temptype will be its type, * otherwise, it's P2UNDEF. */ temptype = P2UNDEF; calltype = P2INT; if ( porf == FUNC ) { p_type_width = width( p -> type ); switch( p_type_class ) { case TSTR: case TSET: case TREC: case TFILE: case TARY: calltype = temptype = P2STRTY; p_type_align = align( p -> type ); break; default: if ( p -> class == FFUNC ) { calltype = temptype = p2type( p -> type ); } break; } if ( temptype != P2UNDEF ) { tempnlp = tmpalloc(p_type_width, p -> type, NOREG); /* * temp * for (temp = ... */ putRV( 0 , cbn , tempnlp -> value[ NL_OFFS ] , tempnlp -> extra_flags , temptype ); } } switch ( p -> class ) { case FUNC: case PROC: /* * ... p( ... */ sextname( extname , p -> symbol , BLOCKNO(p -> nl_block) ); putleaf( P2ICON , 0 , 0 , p2type( p ) , extname ); break; case FFUNC: case FPROC: /* * ... ( t -> entryaddr )( ... */ putRV( 0 , cbn , tempdescrp -> value[ NL_OFFS ] , tempdescrp -> extra_flags , P2PTR | P2STRTY ); if ( FENTRYOFFSET != 0 ) { putleaf( P2ICON , FENTRYOFFSET , 0 , P2INT , 0 ); putop( P2PLUS , ADDTYPE( ADDTYPE( ADDTYPE( p2type( p ) , P2FTN ) , P2PTR ) , P2PTR ) ); } putop( P2UNARY P2MUL , ADDTYPE( ADDTYPE( p2type( p ) , P2FTN ) , P2PTR ) ); break; default: panic("call class"); } noarguments = TRUE; # endif PC /* * Loop and process each of * arguments to the proc/func. * ... ( ... args ... ) ... */ for (p1 = plist(p); p1 != NIL; p1 = p1->chain) { if (argv == NIL) { error("Not enough arguments to %s", p->symbol); return (NIL); } switch (p1->class) { case REF: /* * Var parameter */ r = argv[1]; if (r != NIL && r[0] != T_VAR) { error("Expression given (variable required) for var parameter %s of %s", p1->symbol, p->symbol); chk = FALSE; break; } q = lvalue( (int *) argv[1], MOD | ASGN , LREQ ); if (q == NIL) { chk = FALSE; break; } if (q != p1->type) { error("Parameter type not identical to type of var parameter %s of %s", p1->symbol, p->symbol); chk = FALSE; break; } break; case VAR: /* * Value parameter */ # ifdef OBJ q = rvalue(argv[1], p1->type , RREQ ); # endif OBJ # ifdef PC /* * structure arguments require lvalues, * scalars use rvalue. */ switch( classify( p1 -> type ) ) { case TFILE: case TARY: case TREC: case TSET: case TSTR: q = rvalue( argv[1] , p1 -> type , LREQ ); break; case TINT: case TSCAL: case TBOOL: case TCHAR: precheck( p1 -> type , "_RANG4" , "_RSNG4" ); q = rvalue( argv[1] , p1 -> type , RREQ ); postcheck( p1 -> type ); break; default: q = rvalue( argv[1] , p1 -> type , RREQ ); if ( isa( p1 -> type , "d" ) && isa( q , "i" ) ) { putop( P2SCONV , P2DOUBLE ); } break; } # endif PC if (q == NIL) { chk = FALSE; break; } if (incompat(q, p1->type, argv[1])) { cerror("Expression type clashed with type of value parameter %s of %s", p1->symbol, p->symbol); chk = FALSE; break; } # ifdef OBJ if (isa(p1->type, "bcsi")) rangechk(p1->type, q); if (q->class != STR) convert(q, p1->type); # endif OBJ # ifdef PC switch( classify( p1 -> type ) ) { case TFILE: case TARY: case TREC: case TSET: case TSTR: putstrop( P2STARG , p2type( p1 -> type ) , lwidth( p1 -> type ) , align( p1 -> type ) ); } # endif PC break; case FFUNC: /* * function parameter */ q = flvalue( (int *) argv[1] , p1 ); chk = (chk && fcompat(q, p1)); break; case FPROC: /* * procedure parameter */ q = flvalue( (int *) argv[1] , p1 ); chk = (chk && fcompat(q, p1)); break; default: panic("call"); } # ifdef PC /* * if this is the nth (>1) argument, * hang it on the left linear list of arguments */ if ( noarguments ) { noarguments = FALSE; } else { putop( P2LISTOP , P2INT ); } # endif PC argv = argv[2]; } if (argv != NIL) { error("Too many arguments to %s", p->symbol); rvlist(argv); return (NIL); } if (chk == FALSE) return NIL; # ifdef OBJ if ( p -> class == FFUNC || p -> class == FPROC ) { put(2, PTR_RV | psbn << 8+INDX, (int)p->value[NL_OFFS]); put(1, O_FCALL); put(2, O_FRTN, even(width(p->type))); } else { put(2, O_CALL | psbn << 8, (long)p->entloc); } # endif OBJ # ifdef PC /* * for formal calls: add the hidden argument * which is the formal struct describing the * environment of the routine. * and the argument which is the address of the * space into which to save the display. */ if ( p -> class == FFUNC || p -> class == FPROC ) { putRV( 0 , cbn , tempdescrp -> value[ NL_OFFS ] , tempdescrp -> extra_flags , P2PTR|P2STRTY ); if ( !noarguments ) { putop( P2LISTOP , P2INT ); } noarguments = FALSE; } /* * do the actual call: * either ... p( ... ) ... * or ... ( t -> entryaddr )( ... ) ... * and maybe an assignment. */ if ( porf == FUNC ) { switch ( p_type_class ) { case TBOOL: case TCHAR: case TINT: case TSCAL: case TDOUBLE: case TPTR: putop( ( noarguments ? P2UNARY P2CALL : P2CALL ) , p_type_p2type ); if ( p -> class == FFUNC ) { putop( P2ASSIGN , p_type_p2type ); } break; default: putstrop( ( noarguments ? P2UNARY P2STCALL : P2STCALL ), ADDTYPE( p_type_p2type , P2PTR ) , p_type_width , p_type_align ); putstrop( P2STASG , p_type_p2type , lwidth( p -> type ) , align( p -> type ) ); break; } } else { putop( ( noarguments ? P2UNARY P2CALL : P2CALL ) , P2INT ); } /* * ( t=p , ... , FRTN( t ) ... */ if ( p -> class == FFUNC || p -> class == FPROC ) { putop( P2COMOP , P2INT ); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_FRTN" ); putRV( 0 , cbn , tempdescrp -> value[ NL_OFFS ] , tempdescrp -> extra_flags , P2PTR | P2STRTY ); putop( P2CALL , P2INT ); putop( P2COMOP , P2INT ); } /* * if required: * either ... , temp ) * or ... , &temp ) */ if ( porf == FUNC && temptype != P2UNDEF ) { if ( temptype != P2STRTY ) { putRV( 0 , cbn , tempnlp -> value[ NL_OFFS ] , tempnlp -> extra_flags , p_type_p2type ); } else { putLV( 0 , cbn , tempnlp -> value[ NL_OFFS ] , tempnlp -> extra_flags , p_type_p2type ); } putop( P2COMOP , P2INT ); } if ( porf == PROC ) { putdot( filename , line ); } # endif PC return (p->type); } rvlist(al) register int *al; { for (; al != NIL; al = al[2]) rvalue( (int *) al[1], NLNIL , RREQ ); } /* * check that two function/procedure namelist entries are compatible */ bool fcompat( formal , actual ) struct nl *formal; struct nl *actual; { register struct nl *f_chain; register struct nl *a_chain; bool compat = TRUE; if ( formal == NIL || actual == NIL ) { return FALSE; } for (a_chain = plist(actual), f_chain = plist(formal); f_chain != NIL; f_chain = f_chain->chain, a_chain = a_chain->chain) { if (a_chain == NIL) { error("%s %s declared on line %d has more arguments than", parnam(formal->class), formal->symbol, linenum(formal)); cerror("%s %s declared on line %d", parnam(actual->class), actual->symbol, linenum(actual)); return FALSE; } if ( a_chain -> class != f_chain -> class ) { error("%s parameter %s of %s declared on line %d is not identical", parnam(f_chain->class), f_chain->symbol, formal->symbol, linenum(formal)((); cerror("with %s parameter %s of %s declared on line %d", parnam(a_chain->class), a_chain->symbol, actual->symbol, linenum(actual)); compat = FALSE; } else if (a_chain->class == FFUNC || a_chain->class == FPROC) { compat = (compat && fcompat(f_chain, a_chain)); } if ((a_chain->class != FPROC && f_chain->class != FPROC) && (a_chain->type != f_chain->type)) { error("Type of %s parameter %s of %s declared on line %d is not identical", parnam(f_chain->class), f_chain->symbol, formal->symbol, linenum(formal)); cerror("to type of %s parameter %s of %s declared on line %d", parnam(a_chain->class), a_chain->symbol, actual->symbol, linenum(actual)); compat = FALSE; } } if (a_chain != NIL) { error("%s %s declared on line %d has fewer arguments than", parnam(formal->class), formal->symbol, linenum(formal)); cerror("%s %s declared on line %d", parnam(actual->class), actual->symbol, linenum(actual)); return FALSE; } return compat; } char * parnam(nltype) int nltype; { switch(nltype) { case REF: return "var"; case VAR: return "value"; case FUNC: case FFUNC: return "function"; case PROC: case FPROC: return "procedure"; default: return "SNARK"; } } plist(p) struct nl *p; { switch (p->class) { case FFUNC: case FPROC: return p->ptr[ NL_FCHAIN ]; case PROC: case FUNC: return p->chain; default: panic("plist"); } } linenum(p) struct nl *p; { if (p->class == FUNC) return p->ptr[NL_FVAR]->value[NL_LINENO]; return p->value[NL_LINENO]; } n "var"; case VAR: return "value"; case FUNC: case FFUNC: return "function"; case PROC: case FPROC: return "procedure"; default: return "SNARK"; } } plist(p) struct nl *p; { switch (p->class) { case FFUNC: case FPROC: return p->ptr[ NL_FCHAIN ]; case PROC: case FUNC: return p->chain; default: panic("plist"); } } linenum(p) struct nl *p; { if (p->class =cmd/pc0/case.c 644 0 33 6562 2552606570 6357 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)case.c 1.3 3/8/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "opcode.h" /* * The structure used to * hold information about * each case label. */ struct ct { long clong; int cline; }; #ifdef OBJ /* * Caseop generates the * pascal case statement code */ caseop(r) int *r; { register struct nl *p; register struct ct *ctab; register *cs; int *cl; double low, high; short *brtab; char *brtab0; char *csend; int w, i, j, m, n; int goc; bool nr; goc = gocnt; /* * Obtain selector attributes: * p type * w width * low lwb(p) * high upb(p) */ p = rvalue((int *) r[2], NLNIL , RREQ ); if (p != NIL) { if (isnta(p, "bcsi")) { error("Case selectors cannot be %ss", nameof(p)); p = NIL; } else { cl = p; if (p->class != RANGE) cl = p->type; if (cl == NIL) p = NIL; else { w = width(p); #ifdef DEBUG if (hp21mx) w = 2; #endif low = cl->range[0]; high = cl->range[1]; } } } /* * Count # of cases */ n = 0; for (cl = r[3]; cl != NIL; cl = cl[2]) { cs = cl[1]; if (cs == NIL) continue; for (cs = cs[2]; cs != NIL; cs = cs[2]) n++; } /* * Allocate case table space */ ctab = i = malloc(n * sizeof *ctab); if (i == 0) { error("Ran out of memory (case)"); pexit(DIED); } /* * Check the legality of the * labels and count the number * of good labels */ m = 0; for (cl = r[3]; cl != NIL; cl = cl[2]) { cs = cl[1]; if (cs == NIL) continue; line = cs[1]; for (cs = cs[2]; cs != NIL; cs = cs[2]) { gconst(cs[1]); if (p == NIL || con.ctype == NIL) continue; if (incompat(con.ctype, p, NIL )) { cerror("Case label type clashed with case selector expression type"); continue; } if (con.crval < low || con.crval > high) { error("Case label out of range"); continue; } ctab[m].clong = con.crval; ctab[m].cline = line; m++; } } /* * Check for duplicate labels */ for (i = 0; i < m; i++) for (j = 0; j < m; j++) if (ctab[i].clong == ctab[j].clong) { if (i == j) continue; if (j < i) break; error("Multiply defined label in case, lines %d and %d", ctab[i].cline, ctab[j].cline); } /* * Put out case operator and * leave space for the * branch table */ if (p != NIL) { put(2, O_CASE1OP + (w >> 1), n); brtab = brtab0 = lc; putspace(n * 2); put(1, O_CASEBEG); for (i=0; i> 1), (int)ctab[i].clong); else put(2 ,O_CASE4, ctab[i].clong); put(1, O_CASEEND); } csend = getlab(); put(2, O_TRA, csend); /* * Free the case * table space. */ free(ctab); /* * Generate code for each * statement. Patch branch * table to beginning of each * statement and follow each * statement with a branch back * to the TRA above. */ nr = TRUE; for (cl = r[3]; cl != NIL; cl = cl[2]) { cs = cl[1]; if (cs == NIL) continue; if (p != NIL) for (cs = cs[2]; cs != NIL; cs = cs[2]) { patchfil(brtab - 1, (long)(lc - brtab0), 1); brtab++; } cs = cl[1]; putcnt(); level++; statement(cs[3]); nr = (noreach && nr); noreach = 0; put(2, O_TRA, csend); level--; if (gotos[cbn]) ungoto(); } /* * Patch the termination branch */ patch(csend); noreach = nr; if (goc != gocnt) putcnt(); } #endif OBJ */ nr = TRUE; for (cl = r[3]; cl != NIL; cl = cl[2]) { cs = cl[1]; if (cs == NIL) continue; if (p != NIL) for (cs = cs[2]; cs cmd/pc0/clas.c 644 0 33 7575 2552606570 6373 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)clas.c 1.4 6/1/81"; #include "whoami.h" #include "0.h" #include "tree.h" /* * This is the array of class * names for the classes returned * by classify. The order of the * classes is the same as the base * of the namelist, with special * negative index entries for structures, * scalars, pointers, sets and strings * to be collapsed into. */ char *clnxxxx[] = { "file", /* -7 TFILE */ "record", /* -6 TREC */ "array", /* -5 TARY */ "scalar", /* -4 TSCAL */ "pointer", /* -3 TPTR */ "set", /* -2 TSET */ "string", /* -1 TSTR */ "SNARK", /* 0 NIL */ "Boolean", /* 1 TBOOL */ "char", /* 2 TCHAR */ "integer", /* 3 TINT */ "real", /* 4 TREAL */ "\"nil\"", /* 5 TNIL */ }; char **clnames = &clnxxxx[-(TFIRST)]; /* * Classify takes a pointer * to a type and returns one * of several interesting group * classifications for easy use. */ classify(p1) struct nl *p1; { register struct nl *p; p = p1; swit: if (p == NIL) { nocascade(); return (NIL); } if (p == &nl[TSTR]) return (TSTR); if ( p == &nl[ TSET ] ) { return TSET; } switch (p->class) { case PTR: return (TPTR); case ARRAY: if (p->type == nl+T1CHAR) return (TSTR); return (TARY); case STR: return (TSTR); case SET: return (TSET); case RANGE: p = p->type; goto swit; case TYPE: if (p <= nl+TLAST) return (p - nl); panic("clas2"); case FILET: return (TFILE); case RECORD: return (TREC); case SCAL: return (TSCAL); default: panic("clas"); } } #ifndef PI0 /* * Is p a text file? */ text(p) struct nl *p; { return (p != NIL && p->class == FILET && p->type == nl+T1CHAR); } #endif /* * Scalar returns a pointer to * the the base scalar type of * its argument if its argument * is a SCALar else NIL. */ scalar(p1) struct nl *p1; { register struct nl *p; p = p1; if (p == NIL) return (NIL); if (p->class == RANGE) p = p->type; if (p == NIL) return (NIL); return (p->class == SCAL ? p : NIL); } /* * Isa tells whether p * is one of a group of * namelist classes. The * classes wanted are specified * by the characters in s. * (Note that s would more efficiently, * if less clearly, be given by a mask.) */ isa(p, s) register struct nl *p; char *s; { register i; register char *cp; if (p == NIL) return (NIL); /* * map ranges down to * the base type */ if (p->class == RANGE) p = p->type; /* * the following character/class * associations are made: * * s scalar * b Boolean * c character * i integer * d double (real) * t set */ switch (p->class) { case SET: i = TDOUBLE+1; break; case SCAL: i = 0; break; default: i = p - nl; } if (i >= 0 && i <= TDOUBLE+1) { i = "sbcidt"[i]; cp = s; while (*cp) if (*cp++ == i) return (1); } return (NIL); } /* * Isnta is !isa */ isnta(p, s) { return (!isa(p, s)); } /* * "shorthand" */ nameof(p) { return (clnames[classify(p)]); } #ifndef PI0 nowexp(r) int *r; { if (r[0] == T_WEXP) { if (r[2] == NIL) error("Oct/hex allowed only on writeln/write calls"); else error("Width expressions allowed only in writeln/write calls"); return (1); } return (NIL); } #endif /* * is a variable a local, a formal parameter, or a global? * all this from just the offset: * globals are at levels 0 or 1 * positives are parameters * negative evens are locals */ whereis( level , offset , extra_fl((ags ) int level; int offset; char extra_flags; { # ifdef OBJ return ( offset >= 0 ? PARAMVAR : LOCALVAR ); # endif OBJ # ifdef PC switch ( extra_flags & ( NGLOBAL | NPARAM | NLOCAL ) ) { case NGLOBAL: return GLOBALVAR; case NPARAM: return PARAMVAR; case NLOCAL: return LOCALVAR; default: panic( "whereis" ); } # endif PC } t levels 0 or 1 * positives are parameters * negative evens are locals */ whereis( level , offset , extra_flcmd/pc0/const.c 644 0 33 10563 2552606571 6607 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)const.c 1.4 9/4/80"; #include "whoami.h" #include "0.h" #include "tree.h" /* * Const enters the definitions * of the constant declaration * part into the namelist. */ #ifndef PI1 constbeg() { /* * this allows for multiple declaration * parts, unless the "standard" option * has been specified. * If a routine segment is being compiled, * do level one processing. */ if (!progseen) level1(); if (parts[ cbn ] & (TPRT|VPRT|RPRT)) { if ( opt( 's' ) ) { standard(); } else { warning(); } error("Constant declarations should precede type, var and routine declarations"); } if (parts[ cbn ] & CPRT) { if ( opt( 's' ) ) { standard(); } else { warning(); } error("All constants should be declared in one const part"); } parts[ cbn ] |= CPRT; } #endif PI1 const(cline, cid, cdecl) int cline; register char *cid; register int *cdecl; { register struct nl *np; #ifdef PI0 send(REVCNST, cline, cid, cdecl); #endif line = cline; gconst(cdecl); np = enter(defnl(cid, CONST, con.ctype, con.cival)); #ifndef PI0 np->nl_flags |= NMOD; #endif #ifdef PC if (cbn == 1) { stabgconst( cid , line ); } #endif PC # ifdef PTREE { pPointer Const = ConstDecl( cid , cdecl ); pPointer *Consts; pSeize( PorFHeader[ nesting ] ); Consts = &( pDEF( PorFHeader[ nesting ] ).PorFConsts ); *Consts = ListAppend( *Consts , Const ); pRelease( PorFHeader[ nesting ] ); } # endif if (con.ctype == NIL) return; if ( con.ctype == nl + TSTR ) np->ptr[0] = con.cpval; if (isa(con.ctype, "i")) np->range[0] = con.crval; else if (isa(con.ctype, "d")) np->real = con.crval; } #ifndef PI0 #ifndef PI1 constend() { } #endif #endif /* * Gconst extracts * a constant declaration * from the tree for it. * only types of constants * are integer, reals, strings * and scalars, the first two * being possibly signed. */ gconst(r) int *r; { register struct nl *np; register *cn; char *cp; int negd, sgnd; long ci; con.ctype = NIL; cn = r; negd = sgnd = 0; loop: if (cn == NIL || cn[1] == NIL) return (NIL); switch (cn[0]) { default: panic("gconst"); case T_MINUSC: negd = 1 - negd; case T_PLUSC: sgnd++; cn = cn[1]; goto loop; case T_ID: np = lookup(cn[1]); if (np == NIL) return; if (np->class != CONST) { derror("%s is a %s, not a constant as required", cn[1], classes[np->class]); return; } con.ctype = np->type; switch (classify(np->type)) { case TINT: con.crval = np->range[0]; break; case TDOUBLE: con.crval = np->real; break; case TBOOL: case TCHAR: case TSCAL: con.cival = np->value[0]; con.crval = con.cival; break; case TSTR: con.cpval = np->ptr[0]; break; case NIL: con.ctype = NIL; return; default: panic("gconst2"); } break; case T_CBINT: con.crval = a8tol(cn[1]); goto restcon; case T_CINT: con.crval = atof(cn[1]); if (con.crval > MAXINT || con.crval < MININT) { derror("Constant too large for this implementation"); con.crval = 0; } restcon: ci = con.crval; #ifndef PI0 if (bytes(ci, ci) <= 2) con.ctype = nl+T2INT; else #endif con.ctype = nl+T4INT; break; case T_CFINT: con.ctype = nl+TDOUBLE; con.crval = atof(cn[1]); break; case T_CSTRNG: cp = cn[1]; if (cp[1] == 0) { con.ctype = nl+T1CHAR; con.cival = cp[0]; con.crval = con.cival; break; } con.ctype = nl+TSTR; con.cpval = savestr(cp); break; } if (sgnd) { if (isnta(con.ctype, "id")) derror("%s constants cannot be signed", nameof(con.ctype)); else { if (negd) con.crval = -con.crval; ci = con.crval; } } } #ifndef PI0 isconst(r) register int *r; { if (r == NIL) return (1); switch (r[0]) { case T_MINUS: r[0] = T_MINUSC; r[1] = r[2]; return (isconst(r[1])); case T_PLUS: r[0] = T_PLUSC; r[1] = r[2]; return (isconst(r[1])); case T_VAR: if (r[3] != NIL) return (0); r[0] = T_ID; r[1] = r[2]; return (1); case T_BINT: r[0] = T_CBINT; r[1] = r[2]; return (1); case T_INT: r[0] = T_CINT; r[1] = r[2]; return (1); case T_FINT: r[0] = T_CFINT; r[1] = r[2]; return (1); case T_STRNG: r[0] = T_CSTRNG; r[1] = r[2]; return (1); } return (0); } #endif T_MINUSC; r[1] = r[2]; return (isconst(r[1])); case T_PLUS: r[0] = T_PLUSC; r[1] = r[2]; return (isconst(r[1])); case T_VAcmd/pc0/conv.c 644 0 33 15712 2552606571 6427 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)conv.c 1.2 3/8/81"; #include "whoami.h" #ifdef PI #include "0.h" #include "opcode.h" #ifdef PC # include "pcops.h" #endif PC #ifndef PI0 /* * Convert a p1 into a p2. * Mostly used for different * length integers and "to real" conversions. */ convert(p1, p2) struct nl *p1, *p2; { if (p1 == NIL || p2 == NIL) return; switch (width(p1) - width(p2)) { case -7: case -6: put(1, O_STOD); return; case -4: put(1, O_ITOD); return; case -3: case -2: put(1, O_STOI); return; case -1: case 0: case 1: return; case 2: case 3: put(1, O_ITOS); return; default: panic("convert"); } } #endif /* * Compat tells whether * p1 and p2 are compatible * types for an assignment like * context, i.e. value parameters, * indicies for 'in', etc. */ compat(p1, p2, t) struct nl *p1, *p2; { register c1, c2; c1 = classify(p1); if (c1 == NIL) return (NIL); c2 = classify(p2); if (c2 == NIL) return (NIL); switch (c1) { case TBOOL: case TCHAR: if (c1 == c2) return (1); break; case TINT: if (c2 == TINT) return (1); case TDOUBLE: if (c2 == TDOUBLE) return (1); #ifndef PI0 if (c2 == TINT && divflg == 0 && t != NIL ) { divchk= 1; c1 = classify(rvalue(t, NLNIL , RREQ )); divchk = NIL; if (c1 == TINT) { error("Type clash: real is incompatible with integer"); cerror("This resulted because you used '/' which always returns real rather"); cerror("than 'div' which divides integers and returns integers"); divflg = 1; return (NIL); } } #endif break; case TSCAL: if (c2 != TSCAL) break; if (scalar(p1) != scalar(p2)) { derror("Type clash: non-identical scalar types"); return (NIL); } return (1); case TSTR: if (c2 != TSTR) break; if (width(p1) != width(p2)) { derror("Type clash: unequal length strings"); return (NIL); } return (1); case TNIL: if (c2 != TPTR) break; return (1); case TFILE: if (c1 != c2) break; derror("Type clash: files not allowed in this context"); return (NIL); default: if (c1 != c2) break; if (p1 != p2) { derror("Type clash: non-identical %s types", clnames[c1]); return (NIL); } if (p1->nl_flags & NFILES) { derror("Type clash: %ss with file components not allowed in this context", clnames[c1]); return (NIL); } return (1); } derror("Type clash: %s is incompatible with %s", clnames[c1], clnames[c2]); return (NIL); } #ifndef PI0 /* * Rangechk generates code to * check if the type p on top * of the stack is in range for * assignment to a variable * of type q. */ rangechk(p, q) struct nl *p, *q; { register struct nl *rp; register op; int wq, wrp; if (opt('t') == 0) return; rp = p; if (rp == NIL) return; if (q == NIL) return; # ifdef OBJ /* * When op is 1 we are checking length * 4 numbers against length 2 bounds, * and adding it to the opcode forces * generation of appropriate tests. */ op = 0; wq = width(q); wrp = width(rp); op = wq != wrp && (wq == 4 || wrp == 4); if (rp->class == TYPE) rp = rp->type; switch (rp->class) { case RANGE: if (rp->range[0] != 0) { # ifndef DEBUG if (wrp <= 2) put(3, O_RANG2+op, ( short ) rp->range[0], ( short ) rp->range[1]); else if (rp != nl+T4INT) put(3, O_RANG4+op, rp->range[0], rp->range[1] ); # else if (!hp21mx) { if (wrp <= 2) put(3, O_RANG2+op,( short ) rp->range[0], ( short ) rp->range[1]); else if (rp != nl+T4INT) put(3, O_RANG4+op,rp->range[0], rp->range[1]); } else if (rp != nl+T2INT && rp != nl+T4INT) put(3, O_RANG2+op,( short ) rp->range[0], ( short ) rp->range[1]); # endif break; } /* * Range whose lower bounds are * zero can be treated as scalars((. */ case SCAL: if (wrp <= 2) put(2, O_RSNG2+op, ( short ) rp->range[1]); else put( 2 , O_RSNG4+op, rp->range[1]); break; default: panic("rangechk"); } # endif OBJ # ifdef PC /* * what i want to do is make this and some other stuff * arguments to a function call, which will do the rangecheck, * and return the value of the current expression, or abort * if the rangecheck fails. * probably i need one rangecheck routine to return each c-type * of value. * also, i haven't figured out what the `other stuff' is. */ putprintf( "# call rangecheck" , 0 ); # endif PC } #endif #endif #ifdef PC /* * if type p requires a range check, * then put out the name of the checking function * for the beginning of a function call which is completed by postcheck. * (name1 is for a full check; name2 assumes a lower bound of zero) */ precheck( p , name1 , name2 ) struct nl *p; char *name1 , *name2; { if ( opt( 't' ) == 0 ) { return; } if ( p == NIL ) { return; } if ( p -> class == TYPE ) { p = p -> type; } switch ( p -> class ) { case RANGE: if ( p != nl + T4INT ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , p -> range[0] != 0 ? name1 : name2 ); } break; case SCAL: /* * how could a scalar ever be out of range? */ break; default: panic( "precheck" ); break; } } /* * if type p requires a range check, * then put out the rest of the arguments of to the checking function * a call to which was started by precheck. * the first argument is what is being rangechecked (put out by rvalue), * the second argument is the lower bound of the range, * the third argument is the upper bound of the range. */ postcheck( p ) struct nl *p; { if ( opt( 't' ) == 0 ) { return; } if ( p == NIL ) { return; } if ( p -> class == TYPE ) { p = p -> type; } switch ( p -> class ) { case RANGE: if ( p != nl + T4INT ) { if (p -> range[0] != 0 ) { putleaf( P2ICON , p -> range[0] , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); } putleaf( P2ICON , p -> range[1] , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); } break; case SCAL: break; default: panic( "postcheck" ); break; } } #endif PC #ifdef DEBUG conv(dub) int *dub; { int newfp[2]; double *dp = dub; long *lp = dub; register int exp; long mant; newfp[0] = dub[0] & 0100000; newfp[1] = 0; if (*dp == 0.0) goto ret; exp = ((dub[0] >> 7) & 0377) - 0200; if (exp < 0) { newfp[1] = 1; exp = -exp; } if (exp > 63) exp = 63; dub[0] &= ~0177600; dub[0] |= 0200; mant = *lp; mant <<= 8; if (newfp[0]) mant = -mant; newfp[0] |= (mant >> 17) & 077777; newfp[1] |= (((int) (mant >> 1)) & 0177400) | (exp << 1); ret: dub[0] = newfp[0]; dub[1] = newfp[1]; } #endif t newfp[2]; double *dp = dub; long *lp = dub; regiscmd/pc0/cset.c 644 0 33 27300 2552606571 6414 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)cset.c 1.6 3/20/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "opcode.h" #include "objfmt.h" #ifdef PC #include "pc.h" #include "pcops.h" #endif PC /* * CONSETS causes compile time constant sets to be constructed here. * * COMPSETSZE defines the maximum number of longs to be used in * constant set construction */ #define CONSETS #define COMPSETSZE 10 #define BITSPERBYTE 8 #define BITSPERLONG 32 #define LG2BITSBYTE 3 #define MSKBITSBYTE 0x07 #define LG2BITSLONG 5 #define MSKBITSLONG 0x1f /* * rummage through a `constant' set (i.e. anything within [ ]'s) tree * and decide if this is a compile time constant set or a runtime set. * this information is returned in a structure passed from the caller. * while rummaging, this also reorders the tree so that all ranges * preceed all singletons. */ bool precset( r , settype , csetp ) int *r; struct nl *settype; struct csetstr *csetp; { register int *e; register struct nl *t; register struct nl *exptype; register int *el; register int *pairp; register int *singp; int *ip; int lower; int upper; bool setofint; csetp -> csettype = NIL; csetp -> paircnt = 0; csetp -> singcnt = 0; csetp -> comptime = TRUE; setofint = FALSE; if ( settype != NIL ) { if ( settype -> class == SET ) { /* * the easy case, we are told the type of the set. */ exptype = settype -> type; } else { /* * we are told the type, but it's not a set * supposedly possible if someone tries * e.g string context [1,2] = 'abc' */ error("Constant set involved in non set context"); return csetp -> comptime; } } else { /* * So far we have no indication * of what the set type should be. * We "look ahead" and try to infer * The type of the constant set * by evaluating one of its members. */ e = r[2]; if (e == NIL) { /* * tentative for [], return type of `intset' */ settype = lookup( intset ); if ( settype == NIL ) { panic( "empty set" ); } settype = settype -> type; if ( settype == NIL ) { return csetp -> comptime; } if ( isnta( settype , "t" ) ) { error("Set default type \"intset\" is not a set"); return csetp -> comptime; } csetp -> csettype = settype; setran( settype -> type ); if (((set.uprbp + 1) >> LG2BITSLONG) >= COMPSETSZE) csetp -> comptime = FALSE; return csetp -> comptime; } e = e[1]; if (e == NIL) { return csetp -> comptime; } if (e[0] == T_RANG) { e = e[1]; } codeoff(); t = rvalue(e, NIL , RREQ ); codeon(); if (t == NIL) { return csetp -> comptime; } /* * The type of the set, settype, is * deemed to be a set of the base type * of t, which we call exptype. If, * however, this would involve a * "set of integer", we cop out * and use "intset"'s current scoped * type instead. */ if (isa(t, "r")) { error("Sets may not have 'real' elements"); return csetp -> comptime; } if (isnta(t, "bcsi")) { error("Set elements must be scalars, not %ss", nameof(t)); return csetp -> comptime; } if (isa(t, "i")) { settype = lookup(intset); if (settype == NIL) panic("intset"); settype = settype->type; if (settype == NIL) return csetp -> comptime; if (isnta(settype, "t")) { error("Set default type \"intset\" is not a set"); return csetp -> comptime; } exptype = settype->type; /* * say we are doing an intset * but, if we get out of range errors for intset * we punt constructing the set at compile time. */ setofint = TRUE; } else { exptype = t->type; if (exptype == NIL) return csetp -> comptime; if (exptype->class != RANGE) exptype = exptype->type; settype = defnl(0, SET, exptype, 0); } } csetp -> csettype = settype; # ifndef CONSETS csetp -> comptime = FALSE; # endif CONSETS setran( exptype ); if (((set.uprbp + 1) >> LG2BITSLONG) >= COMPSETSZE) csetp -> comptime = FALSE; lower = set.lwrb; upper = set.lwrb + set.uprbp; pairp = NIL; singp = NIL; codeoff(); while ( el = r[2] ) { e = el[1]; if (e == NIL) { /* * don't hang this one anywhere. */ csetp -> csettype = NIL; r[2] = el[2]; continue; } if (e[0] == T_RANG) { if ( csetp -> comptime && constval( e[2] ) ) { #ifdef CONSETS t = con.ctype; if ( con.crval < lower || con.crval > upper ) { if ( setofint ) { csetp -> comptime = FALSE; } else { error("Range upper bound of %D out of set bounds" , ((long)con.crval) ); csetp -> csettype = NIL; } } #endif CONSETS } else { csetp -> comptime = FALSE; t = rvalue(e[2], NIL , RREQ ); if (t == NIL) { rvalue(e[1], NIL , RREQ ); goto pairhang; } } if (incompat(t, exptype, e[2])) { cerror("Upper bound of element type clashed with set type in constant set"); } if ( csetp -> comptime && constval( e[1] ) ) { #ifdef CONSETS t = con.ctype; if ( con.crval < lower || con.crval > upper ) { if ( setofint ) { csetp -> comptime = FALSE; } else { error("Range lower bound of %D out of set bounds" , ((long)con.crval) ); csetp -> csettype = NIL; } } #endif CONSETS } else { csetp -> comptime = FALSE; t = rvalue(e[1], NIL , RREQ ); if (t == NIL) { goto pairhang; } } if (incompat(t, exptype, e[1])) { cerror("Lower bound of element type clashed with set type in constant set"); } pairhang: /* * remove this range from the tree list and * hang it on the pairs list. */ ip = el[2]; el[2] = pairp; pairp = r[2]; r[2] = ip; csetp -> paircnt++; } else { if ( csetp -> comptime && constval( e ) ) { #ifdef CONSETS t = con.ctype; if ( con.crval < lower || con.crval > upper ) { if ( setofint ) { csetp -> comptime = FALSE; } else { error("Value of %D out of set bounds" , ((long)con.crval) ); csetp -> csettype = NIL; } } #endif CONSETS } else { csetp -> comptime = FALSE; t = rvalue((int *) e, NLNIL , RREQ ); if (t == NIL) { goto singhang; } } if (incompat(t, exptype, e)) { cerror("Element type clashed with set type in constant set"); } singhang: /* * take thi((s expression off the tree list and * hang it on the list of singletons. */ ip = el[2]; el[2] = singp; singp = r[2]; r[2] = ip; csetp -> singcnt++; } } codeon(); # ifdef PC if ( pairp != NIL ) { for ( el = pairp ; el[2] != NIL ; el = el[2] ) /* void */; el[2] = singp; r[2] = pairp; } else { r[2] = singp; } # endif PC # ifdef OBJ if ( singp != NIL ) { for ( el = singp ; el[2] != NIL ; el = el[2] ) /* void */; el[2] = pairp; r[2] = singp; } else { r[2] = pairp; } # endif OBJ if ( csetp -> csettype == NIL ) { csetp -> comptime = TRUE; } return csetp -> comptime; } #ifdef CONSETS /* * mask[i] has the low i bits turned off. */ long mask[] = { # ifdef DEC11 0xffffffff , 0xfffffffe , 0xfffffffc , 0xfffffff8 , 0xfffffff0 , 0xffffffe0 , 0xffffffc0 , 0xffffff80 , 0xffffff00 , 0xfffffe00 , 0xfffffc00 , 0xfffff800 , 0xfffff000 , 0xffffe000 , 0xffffc000 , 0xffff8000 , 0xffff0000 , 0xfffe0000 , 0xfffc0000 , 0xfff80000 , 0xfff00000 , 0xffe00000 , 0xffc00000 , 0xff800000 , 0xff000000 , 0xfe000000 , 0xfc000000 , 0xf8000000 , 0xf0000000 , 0xe0000000 , 0xc0000000 , 0x80000000 , 0x00000000 # else 0xffffffff , 0xfeffffff , 0xfcffffff , 0xf8ffffff , 0xf0ffffff , 0xe0ffffff , 0xc0ffffff , 0x80ffffff , 0x00ffffff , 0x00feffff , 0x00fcffff , 0x00f8ffff , 0x00f0ffff , 0x00e0ffff , 0x00c0ffff , 0x0080ffff , 0x0000ffff , 0x0000feff , 0x0000fcff , 0x0000f8ff , 0x0000f0ff , 0x0000e0ff , 0x0000c0ff , 0x000080ff , 0x000000ff , 0x000000fe , 0x000000fc , 0x000000f8 , 0x000000f0 , 0x000000e0 , 0x000000c0 , 0x00000080 , 0x00000000 # endif DEC11 }; /* * given a csetstr, either * put out a compile time constant set and an lvalue to it. * or * put out rvalues for the singletons and the pairs * and counts of each. */ #endif CONSETS postcset( r , csetp ) int *r; struct csetstr *csetp; { register int *el; register int *e; int lower; int upper; int lowerdiv; int lowermod; int upperdiv; int uppermod; int label; long *lp; long *limit; long tempset[ COMPSETSZE ]; long temp; char *cp; # ifdef PC char labelname[ BUFSIZ ]; # endif PC if ( csetp -> comptime ) { #ifdef CONSETS setran( ( csetp -> csettype ) -> type ); limit = &tempset[ ( set.uprbp >> LG2BITSLONG ) + 1 ]; for ( lp = &tempset[0] ; lp < limit ; lp++ ) { *lp = 0; } for ( el = r[2] ; el != NIL ; el = el[2] ) { e = el[1]; if ( e[0] == T_RANG ) { constval( e[1] ); lower = con.crval; constval( e[2] ); upper = con.crval; if ( upper < lower ) { continue; } lowerdiv = ( lower - set.lwrb ) >> LG2BITSLONG; lowermod = ( lower - set.lwrb ) & MSKBITSLONG; upperdiv = ( upper - set.lwrb ) >> LG2BITSLONG; uppermod = ( upper - set.lwrb ) & MSKBITSLONG; temp = mask[ lowermod ]; if ( lowerdiv == upperdiv ) { temp &= ~mask[ uppermod + 1 ]; } tempset[ lowerdiv ] |= temp; limit = &tempset[ upperdiv-1 ]; for ( lp = &tempset[ lowerdiv+1 ] ; lp <= limit ; lp++ ) { *lp |= 0xffffffff; } if ( lowerdiv != upperdiv ) { tempset[ upperdiv ] |= ~mask[ uppermod + 1 ]; } } else { constval( e ); temp = con.crval - set.lwrb; cp = (char *)tempset; cp[temp >> LG2BITSBYTE] |= (1 << (temp & MSKBITSBYTE)); } } if ( !CGENNING ) return; # ifdef PC putprintf( " .data" , 0 ); putprintf( " .align 2" , 0 ); label = getlab(); putlab( label ); lp = &( tempset[0] ); limit = &tempset[ ( set.uprbp >> LG2BITSLONG ) + 1 ]; while ( lp < limit ) { putprintf( " .long 0x%x" , 1 , *lp ++ ); for ( temp = 2 ; ( temp <= 8 ) && lp < limit ; temp ++ ) { putprintf( ",0x%x" , 1 , *lp++ ); } putprintf( "" , 0 ); } putprintf( " .text" , 0 ); sprintf( labelname , PREFIXFORMAT , LABELPREFIX , label ); putleaf( P2ICON , 0 , 0 , P2PTR | P2STRTY , labelname ); # endif PC # ifdef OBJ put(2, O_CON, (int)(((set.uprbp >> LG2BITSLONG) + 1) * (BITSPERLONG >> LG2BITSBYTE))); lp = &( tempset[0] ); limit = &tempset[ ( set.uprbp >> LG2BITSLONG ) + 1 ]; while ( lp < limit ) { put(2, O_CASE4, *lp ++); } # endif OBJ #else panic("const cset"); #endif CONSETS } else { # ifdef PC putleaf( P2ICON , csetp -> paircnt , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , csetp -> singcnt , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); for ( el = r[2] ; el != NIL ; el = el[2] ) { e = el[1]; if ( e[0] == T_RANG ) { rvalue( e[2] , NIL , RREQ ); putop( P2LISTOP , P2INT ); rvalue( e[1] , NIL , RREQ ); putop( P2LISTOP , P2INT ); } else { rvalue( e , NIL , RREQ ); putop( P2LISTOP , P2INT ); } } # endif PC # ifdef OBJ for ( el = r[2] ; el != NIL ; el = el[2] ) { e = el[1]; if ( e[0] == T_RANG ) { stkrval( e[1] , NIL , RREQ ); stkrval( e[2] , NIL , RREQ ); } else { stkrval( e , NIL , RREQ ); } } put(2 , O_CON24 , (int)csetp -> singcnt ); put(2 , O_CON24 , (int)csetp -> paircnt ); # endif OBJ } } T ); rvalue( e[1] , NIL , RREQ ); putop( P2LISTOP , P2INT ); } else { rvalue( e , NIL , RREQ ); putop( P2LISTOP , P2INT ); } } # endif PC # ifdef OBJ for ( el = r[2] ; el != NIL ; el = el[2] ) { e = el[1]; if ( e[0] == T_RANG ) { stkrval( e[1] , NIL , RREQ ); stkrvacmd/pc0/error.c 644 0 33 4061 2552606572 6567 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)error.c 1.3 3/18/81"; #include "whoami.h" #include "0.h" #ifndef PI1 #include "yy.h" #endif char errpfx = 'E'; extern int yyline; /* * Panic is called when impossible * (supposedly, anyways) situations * are encountered. * Panic messages should be short * as they do not go to the message * file. */ panic(s) char *s; { #ifdef DEBUG #ifdef PI1 printf("Snark (%s) line=%d\n", s, line); abort(); #else printf("Snark (%s) line=%d, yyline=%d\n", s, line, yyline); abort () ; /* die horribly */ #endif #endif #ifdef PI1 Perror( "Snark in pi1", s); #else Perror( "Snark in pi", s); #endif pexit(DIED); } extern char *errfile; /* * Error is called for * semantic errors and * prints the error and * a line number. */ /*VARARGS*/ error(a1, a2, a3, a4, a5) register char *a1; { char errbuf[256]; /* was extern. why? ...pbk */ register int i; if (errpfx == 'w' && opt('w') != 0) { errpfx = 'E'; return; } Enocascade = 0; geterr(a1, errbuf); a1 = errbuf; if (line < 0) line = -line; #ifndef PI1 if (opt('l')) yyoutline(); #endif yysetfile(filename); if (errpfx == ' ') { printf(" "); for (i = line; i >= 10; i /= 10) pchr( ' ' ); printf("... "); } else if (Enoline) printf(" %c - ", errpfx); else printf("%c %d - ", errpfx, line); printf(a1, a2, a3, a4, a5); if (errpfx == 'E') #ifndef PI0 eflg = TRUE, codeoff(); #else eflg = TRUE; #endif errpfx = 'E'; if (Eholdnl) Eholdnl = 0; else pchr( '\n' ); } /*VARAGRS*/ cerror(a1, a2, a3, a4, a5) { if (Enocascade) return; setpfx(' '); error(a1, a2, a3, a4, a5); } #ifdef PI1 /*VARARGS*/ derror(a1, a2, a3, a4, a5) { if (!holdderr) error(a1, a2, a3, a4, a5); errpfx = 'E'; } char *lastname, printed, hadsome; /* * this yysetfile for PI1 only. * the real yysetfile is in yyput.c */ yysetfile(name) char *name; { if (lastname == name) return; printed =| 1; gettime( name ); printf("%s %s:\n" , myctime( &tvec ) , name ); lastname = name; } #endif 1, a2, a3, a4, a5) { if (Enocascade) return; setpfx(' '); error(a1, a2, a3, a4, a5); } #ifdef PI1 /*VARARGS*/ derror(a1, a2, a3, a4, a5) { if (!holdderr) error(a1, a2, a3, a4, a5); errpfx = 'E'; } char *lastname, printed, hadsome; /* * this yysetfile for PI1 only. * the real yysetfile is in yyput.c */ yysetfile(name) char *name; { if (lastname == name) return; printed =| 1; gettime( name ); printf("%s %s:\n" , mycticmd/pc0/errs 644 0 33 21724 2552606572 6215 rm -f tmp/ato.c /usr/ucb/mkstr - pc2.0strings tmp/ ato.c cd tmp; cc -O -w -I.. -c ato.c; rm -f ../ato.o; mv ato.o ../ato.o rm -f tmp/ato.c rm -f tmp/call.c /usr/ucb/mkstr - pc2.0strings tmp/ call.c cd tmp; cc -O -w -I.. -c call.c; rm -f ../call.o; mv call.o ../call.o rm -f tmp/call.c rm -f tmp/case.c /usr/ucb/mkstr - pc2.0strings tmp/ case.c cd tmp; cc -O -w -I.. -c case.c; rm -f ../case.o; mv case.o ../case.o rm -f tmp/case.c rm -f tmp/clas.c /usr/ucb/mkstr - pc2.0strings tmp/ clas.c cd tmp; cc -O -w -I.. -c clas.c; rm -f ../clas.o; mv clas.o ../clas.o rm -f tmp/clas.c rm -f tmp/const.c /usr/ucb/mkstr - pc2.0strings tmp/ const.c cd tmp; cc -O -w -I.. -c const.c; rm -f ../const.o; mv const.o ../const.o rm -f tmp/const.c rm -f tmp/conv.c /usr/ucb/mkstr - pc2.0strings tmp/ conv.c cd tmp; cc -O -w -I.. -c conv.c; rm -f ../conv.o; mv conv.o ../conv.o rm -f tmp/conv.c rm -f tmp/cset.c /usr/ucb/mkstr - pc2.0strings tmp/ cset.c cd tmp; cc -O -w -I.. -c cset.c; rm -f ../cset.o; mv cset.o ../cset.o rm -f tmp/cs((et.c rm -f tmp/error.c /usr/ucb/mkstr - pc2.0strings tmp/ error.c cd tmp; cc -O -w -I.. -c error.c; rm -f ../error.o; mv error.o ../error.o rm -f tmp/error.c rm -f tmp/fdec.c /usr/ucb/mkstr - pc2.0strings tmp/ fdec.c cd tmp; cc -O -w -I.. -c fdec.c; rm -f ../fdec.o; mv fdec.o ../fdec.o rm -f tmp/fdec.c rm -f tmp/fend.c /usr/ucb/mkstr - pc2.0strings tmp/ fend.c cd tmp; cc -O -w -I.. -c fend.c; rm -f ../fend.o; mv fend.o ../fend.o rm -f tmp/fend.c rm -f tmp/fhdr.c /usr/ucb/mkstr - pc2.0strings tmp/ fhdr.c cd tmp; cc -O -w -I.. -c fhdr.c; rm -f ../fhdr.o; mv fhdr.o ../fhdr.o rm -f tmp/fhdr.c rm -f tmp/flvalue.c /usr/ucb/mkstr - pc2.0strings tmp/ flvalue.c cd tmp; cc -O -w -I.. -c flvalue.c; rm -f ../flvalue.o; mv flvalue.o ../flvalue.o rm -f tmp/flvalue.c rm -f tmp/forop.c /usr/ucb/mkstr - pc2.0strings tmp/ forop.c cd tmp; cc -O -w -I.. -c forop.c; rm -f ../forop.o; mv forop.o ../forop.o rm -f tmp/forop.c rm -f tmp/func.c /usr/ucb/mkstr - pc2.0strings tmp/ func.c cd tmp; cc -O -w -I.. -c func.c; rm -f ../func.o; mv func.o ../func.o rm -f tmp/func.c rm -f tmp/gen.c /usr/ucb/mkstr - pc2.0strings tmp/ gen.c cd tmp; cc -O -w -I.. -c gen.c; rm -f ../gen.o; mv gen.o ../gen.o rm -f tmp/gen.c rm -f tmp/hash.c /usr/ucb/mkstr - pc2.0strings tmp/ hash.c cd tmp; cc -O -w -I.. -c hash.c; rm -f ../hash.o; mv hash.o ../hash.o rm -f tmp/hash.c rm -f tmp/lab.c /usr/ucb/mkstr - pc2.0strings tmp/ lab.c cd tmp; cc -O -w -I.. -c lab.c; rm -f ../lab.o; mv lab.o ../lab.o rm -f tmp/lab.c rm -f tmp/lookup.c /usr/ucb/mkstr - pc2.0strings tmp/ lookup.c cd tmp; cc -O -w -I.. -c lookup.c; rm -f ../lookup.o; mv lookup.o ../lookup.o rm -f tmp/lookup.c rm -f tmp/lval.c /usr/ucb/mkstr - pc2.0strings tmp/ lval.c cd tmp; cc -O -w -I.. -c lval.c; rm -f ../lval.o; mv lval.o ../lval.o rm -f tmp/lval.c rm -f tmp/stklval.c /usr/ucb/mkstr - pc2.0strings tmp/ stklval.c cd tmp; cc -O -w -I.. -c stklval.c; rm -f ../stklval.o; mv stklval.o ../stklval.o rm -f tmp/stklval.c rm -f tmp/main.c /usr/ucb/mkstr - pc2.0strings tmp/ main.c cd tmp; cc -O -w -I.. -c main.c; rm -f ../main.o; mv main.o ../main.o rm -f tmp/main.c rm -f tmp/nl.c /usr/ucb/mkstr - pc2.0strings tmp/ nl.c cd tmp; cc -O -w -I.. -c nl.c; rm -f ../nl.o; mv nl.o ../nl.o rm -f tmp/nl.c rm -f tmp/proc.c /usr/ucb/mkstr - pc2.0strings tmp/ proc.c cd tmp; cc -O -w -I.. -c proc.c; rm -f ../proc.o; mv proc.o ../proc.o rm -f tmp/proc.c rm -f tmp/put.c /usr/ucb/mkstr - pc2.0strings tmp/ put.c cd tmp; cc -O -w -I.. -c put.c; rm -f ../put.o; mv put.o ../put.o rm -f tmp/put.c rm -f tmp/rec.c /usr/ucb/mkstr - pc2.0strings tmp/ rec.c cd tmp; cc -O -w -I.. -c rec.c; rm -f ../rec.o; mv rec.o ../rec.o rm -f tmp/rec.c rm -f tmp/rval.c /usr/ucb/mkstr - pc2.0strings tmp/ rval.c cd tmp; cc -O -w -I.. -c rval.c; rm -f ../rval.o; mv rval.o ../rval.o rm -f tmp/rval.c rm -f tmp/stkrval.c /usr/ucb/mkstr - pc2.0strings tmp/ stkrval.c cd tmp; cc -O -w -I.. -c stkrval.c; rm -f ../stkrval.o; mv stkrval.o ../stkrval.o rm -f tmp/stkrval.c rm -f tmp/stat.c /usr/ucb/mkstr - pc2.0strings tmp/ stat.c cd tmp; cc -O -w -I.. -c stat.c; rm -f ../stat.o; mv stat.o ../stat.o rm -f tmp/stat.c rm -f tmp/string.c /usr/ucb/mkstr - pc2.0strings tmp/ string.c cd tmp; cc -O -w -I.. -c string.c; rm -f ../string.o; mv string.o ../string.o rm -f tmp/string.c rm -f tmp/subr.c /usr/ucb/mkstr - pc2.0strings tmp/ subr.c cd tmp; cc -O -w -I.. -c subr.c; rm -f ../subr.o; mv subr.o ../subr.o rm -f tmp/subr.c rm -f tmp/tmps.c /usr/ucb/mkstr - pc2.0strings tmp/ tmps.c cd tmp; cc -O -w -I.. -c tmps.c; rm -f ../tmps.o; mv tmps.o ../tmps.o rm -f tmp/tmps.c rm -f tmp/tree.c /usr/ucb/mkstr - pc2.0strings tmp/ tree.c cd tmp; cc -O -w -I.. -c tree.c; rm -f ../tree.o; mv tree.o ../tree.o rm -f tmp/tree.c rm -f tmp/type.c /usr/ucb/mkstr - pc2.0strings tmp/ type.c cd tmp; cc -O -w -I.. -c type.c; rm -f ../type.o; mv type.o ../type.o rm -f tmp/type.c rm -f tmp/var.c /usr/ucb/mkstr - pc2.0strings tmp/ var.c cd tmp; cc -O -w -I.. -c var.c; rm -f ../var.o; mv var.o ../var.o rm -f tmp/var.c rm -f tmp/TRdata.c /usr/ucb/mkstr - pc2.0strings tmp/ TRdata.c cd tmp; cc -O -w -I.. -c TRdata.c; rm -f ../TRdata.o; mv TRdata.o ../TRdata.o rm -f tmp/TRdata.c rm -f tmp/y.tab.c /usr/ucb/mkstr - pc2.0strings tmp/ y.tab.c cd tmp; cc -O -w -I.. -c y.tab.c; rm -f ../y.tab.o; mv y.tab.o ../y.tab.o rm -f tmp/y.tab.c rm -f tmp/yycosts.c /usr/ucb/mkstr - pc2.0strings tmp/ yycosts.c cd tmp; cc -O -w -I.. -c yycosts.c; rm -f ../yycosts.o; mv yycosts.o ../yycosts.o rm -f tmp/yycosts.c rm -f tmp/yyerror.c /usr/ucb/mkstr - pc2.0strings tmp/ yyerror.c cd tmp; cc -O -w -I.. -c yyerror.c; rm -f ../yyerror.o; mv yyerror.o ../yyerror.o rm -f tmp/yyerror.c rm -f tmp/yyget.c /usr/ucb/mkstr - pc2.0strings tmp/ yyget.c cd tmp; cc -O -w -I.. -c yyget.c; rm -f ../yyget.o; mv yyget.o ../yyget.o rm -f tmp/yyget.c rm -f tmp/yyid.c /usr/ucb/mkstr - pc2.0strings tmp/ yyid.c cd tmp; cc -O -w -I.. -c yyid.c; rm -f ../yyid.o; mv yyid.o ../yyid.o rm -f tmp/yyid.c rm -f tmp/yylex.c /usr/ucb/mkstr - pc2.0strings tmp/ yylex.c cd tmp; cc -O -w -I.. -c yylex.c; rm -f ../yylex.o; mv yylex.o ../yylex.o rm -f tmp/yylex.c rm -f tmp/yymain.c /usr/ucb/mkstr - pc2.0strings tmp/ yymain.c cd tmp; cc -O -w -I.. -c yymain.c; rm -f ../yymain.o; mv yymain.o ../yymain.o rm -f tmp/yymain.c rm -f tmp/yyoptions.c /usr/ucb/mkstr - pc2.0strings tmp/ yyoptions.c cd tmp; cc -O -w -I.. -c yyoptions.c; rm -f ../yyoptions.o; mv yyoptions.o ../yyoptions.o rm -f tmp/yyoptions.c rm -f tmp/yypanic.c /usr/ucb/mkstr - pc2.0strings tmp/ yypanic.c cd tmp; cc -O -w -I.. -c yypanic.c; rm -f ../yypanic.o; mv yypanic.o ../yypanic.o rm -f tmp/yypanic.c rm -f tmp/yyparse.c /usr/ucb/mkstr - pc2.0strings tmp/ yyparse.c cd tmp; cc -O -w -I.. -c yyparse.c; rm -f ../yyparse.o; mv yyparse.o ../yyparse.o rm -f tmp/yyparse.c rm -f tmp/yyprint.c /usr/ucb/mkstr - pc2.0strings tmp/ yyprint.c cd tmp; cc -O -w -I.. -c yyprint.c; rm -f ../yyprint.o; mv yyprint.o ../yyprint.o rm -f tmp/yyprint.c rm -f tmp/yyput.c /usr/ucb/mkstr - pc2.0strings tmp/ yyput.c cd tmp; cc -O -w -I.. -c yyput.c; rm -f ../yyput.o; mv yyput.o ../yyput.o rm -f tmp/yyput.c rm -f tmp/yyrecover.c /usr/ucb/mkstr - pc2.0strings tmp/ yyrecover.c cd tmp; cc -O -w -I.. -c yyrecover.c; rm -f ../yyrecover.o; mv yyrecover.o ../yyrecover.o rm -f tmp/yyrecover.c rm -f tmp/yyseman.c /usr/ucb/mkstr - pc2.0strings tmp/ yyseman.c cd tmp; cc -O -w -I.. -c yyseman.c; rm -f ../yyseman.o; mv yyseman.o ../yyseman.o rm -f tmp/yyseman.c rm -f tmp/yytree.c /usr/ucb/mkstr - pc2.0strings tmp/ yytree.c cd tmp; cc -O -w -I.. -c yytree.c; rm -f ../yytree.o; mv yytree.o ../yytree.o rm -f tmp/yytree.c rm -f tmp/p2put.c /usr/ucb/mkstr - pc2.0strings tmp/ p2put.c cd tmp; cc -O -w -I.. -c p2put.c; rm -f ../p2put.o; mv p2put.o ../p2put.o rm -f tmp/p2put.c rm -f tmp/stab.c /usr/ucb/mkstr - pc2.0strings tmp/ stab.c cd tmp; cc -O -w -I.. -c stab.c; rm -f ../stab.o; mv stab.o ../stab.o rm -f tmp/stab.c rm -f tmp/pcproc.c /usr/ucb/mkstr - pc2.0strings tmp/ pcproc.c cd tmp; cc -O -w -I.. -c pcproc.c; rm -f ../pcproc.o; mv pcproc.o ../pcproc.o rm -f tmp/pcproc.c rm -f tmp/pcfunc.c /usr/ucb/mkstr - pc2.0strings tmp/ pcfunc.c cd tmp; cc -O -w -I.. -c pcfunc.c; rm -f ../pcfunc.o; mv pcfunc.o ../pcfunc.o rm -f tmp/pcfunc.c rm -f tmp/pccaseop.c /usr/ucb/mkstr - pc2.0strings tmp/ pccaseop.c cd tmp; cc -O -w -I.. -c pccaseop.c; rm -f ../pccaseop.o; mv pccaseop.o ../pccaseop.o rm -f tmp/pccaseop.c rm -f tmp/pclval.c /usr/ucb/mkstr - pc2.0strings tmp/ pclval.c cd tmp; cc -O -w -I.. -c pclval.c; rm -f ../pclval.o; mv pclval.o ../pclval.o rm -f tmp/pclval.c rm -f Version.[oc] ./version > Version.c cc -O -w -z ato.o call.o case.o clas.o const.o conv.o cset.o error.o fdec.o fend.o fhdr.o flvalue.o forop.o func.o gen.o hash.o lab.o lookup.o lval.o stklval.o main.o nl.o proc.o put.o rec.o rval.o stkrval.o stat.o string.o subr.o tmps.o tree.o type.o var.o TRdata.o treen.o yycopy.o y.tab.o yycosts.o yyerror.o yyget.o yyid.o yylex.o yymain.o yyoptions.o yypanic.o yyparse.o yyprint.o yyput.o yyrecover.o yyseman.o yytree.o p2put.o stab.o pcproc.o pcfunc.o pccaseop.o pclval.o Version.c > Version.c cc -O -w -z ato.o call.o case.ocmd/pc0/fdec.c 644 0 33 12112 2552606572 6353 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)fdec.c 1.20 6/1/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "opcode.h" #include "objfmt.h" #include "align.h" /* * this array keeps the pxp counters associated with * functions and procedures, so that they can be output * when their bodies are encountered */ int bodycnts[ DSPLYSZ ]; #ifdef PC # include "pc.h" # include "pcops.h" #endif PC #ifdef OBJ int cntpatch; int nfppatch; #endif OBJ funcfwd(fp) struct nl *fp; { /* * save the counter for this function */ if ( monflg ) { fp -> value[ NL_CNTR ] = bodycnts[ cbn ]; } return (fp); } /* * Funcext marks the procedure or * function external in the symbol * table. Funcext should only be * called if PC, and is an error * otherwise. */ funcext(fp) struct nl *fp; { #ifdef PC if (opt('s')) { standard(); error("External procedures and functions are not standard"); } else { if (cbn == 1) { fp->extra_flags |= NEXTERN; stabefunc( fp -> symbol , fp -> class , line ); } else error("External procedures and functions can only be declared at the outermost level."); } #endif PC #ifdef OBJ error("Procedures or functions cannot be declared external."); #endif OBJ return(fp); } /* * Funcbody is called * when the actual (resolved) * declaration of a procedure is * encountered. It puts the names * of the (function) and parameters * into the symbol table. */ funcbody(fp) struct nl *fp; {(( register struct nl *q, *p; struct nl *functemp; cbn++; if (cbn >= DSPLYSZ) { error("Too many levels of function/procedure nesting"); pexit(ERRS); } sizes[cbn].om_max = sizes[cbn].curtmps.om_off = -DPOFF1; sizes[cbn].reg_max = -1; sizes[cbn].curtmps.reg_off = 0; gotos[cbn] = NIL; errcnt[cbn] = syneflg; parts[ cbn ] = NIL; dfiles[ cbn ] = FALSE; if (fp == NIL) return (NIL); /* * Save the virtual name * list stack pointer so * the space can be freed * later (funcend). */ fp->ptr[2] = nlp; if (fp->class != PROG) { for (q = fp->chain; q != NIL; q = q->chain) { enter(q); # ifdef PC q -> extra_flags |= NPARAM; # endif PC } } if (fp->class == FUNC) { /* * For functions, enter the fvar */ enter(fp->ptr[NL_FVAR]); # ifdef PC q = fp -> ptr[ NL_FVAR ]; if (q -> type != NIL ) { functemp = tmpalloc( leven( roundup( (int)lwidth(q -> type), (long)align(q -> type))), q -> type, NOREG); if ( q -> ptr[NL_OFFS] != functemp->value[NL_OFFS] ) panic("func var"); } q -> extra_flags |= functemp -> extra_flags; # endif PC } # ifdef PTREE /* * pick up the pointer to porf declaration */ PorFHeader[ ++nesting ] = fp -> inTree; # endif PTREE return (fp); } /* * Segend is called to check for * unresolved variables, funcs and * procs, and deliver unresolved and * baduse error diagnostics at the * end of a routine segment (a separately * compiled segment that is not the * main program) for PC. This * routine should only be called * by PC (not standard). */ segend() { register struct nl *p; register int i,b; char *cp; #ifdef PC if (opt('s')) { standard(); error("Separately compiled routine segments are not standard."); } else { b = cbn; for (i=0; i<077; i++) { for (p = disptab[i]; p != NIL && (p->nl_block & 037) == b; p = p->nl_next) { switch (p->class) { case BADUSE: cp = 's'; if (p->chain->ud_next == NIL) cp++; eholdnl(); if (p->value[NL_KINDS] & ISUNDEF) nerror("%s undefined on line%s", p->symbol, cp); else nerror("%s improperly used on line%s", p->symbol, cp); pnumcnt = 10; pnums(p->chain); pchr('\n'); break; case FUNC: case PROC: if ((p->nl_flags & NFORWD) && ((p->extra_flags & NEXTERN) == 0)) nerror("Unresolved forward declaration of %s %s", classes[p->class], p->symbol); break; case FVAR: if (((p->nl_flags & NMOD) == 0) && ((p->chain->extra_flags & NEXTERN) == 0)) nerror("No assignment to the function variable"); break; } } disptab[i] = p; } } #endif PC #ifdef OBJ error("Missing program statement and program body"); #endif OBJ } /* * Level1 does level one processing for * separately compiled routine segments */ level1() { # ifdef OBJ error("Missing program statement"); # endif OBJ # ifdef PC if (opt('s')) { standard(); error("Missing program statement"); } # endif PC cbn++; sizes[cbn].om_max = sizes[cbn].curtmps.om_off = -DPOFF1; gotos[cbn] = NIL; errcnt[cbn] = syneflg; parts[ cbn ] = NIL; dfiles[ cbn ] = FALSE; progseen = TRUE; } pnums(p) struct udinfo *p; { if (p->ud_next != NIL) pnums(p->ud_next); if (pnumcnt == 0) { printf("\n\t"); pnumcnt = 20; } pnumcnt--; printf(" %d", p->ud_line); } nerror(a1, a2, a3) { if (Fp != NIL) { yySsync(); #ifndef PI1 if (opt('l')) yyoutline(); #endif yysetfile(filename); printf("In %s %s:\n", classes[Fp->class], Fp->symbol); Fp = NIL; elineoff(); } error(a1, a2, a3); } = NIL; errcnt[cbn] = syneflg; parts[ cbn ] = NIL; dfiles[ cbn ] = FALSE; progseen = TRUE; } pnums(p) struct udinfo *p; { if (p->ud_next != NIL) pnums(p->ud_next); if (pnumcnt == 0) { printf("\n\t"); pnumcnt = 20; } pnumcnt--; printf(" %d", p->ud_line); } nerror(a1, a2, a3) { if (Fp != NIL) { yySsync(); #ifndef PI1 if (opt('l')) yyoutline(); #endif yysetfile(filename); printf("In %s %s:\n", classes[Fpcmd/pc0/fend.c 644 0 33 40631 2552606573 6376 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)fend.c 1.9 6/8/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "opcode.h" #include "objfmt.h" #include "align.h" /* * this array keeps the pxp counters associated with * functions and procedures, so that they can be output * when their bodies are encountered */ int bodycnts[ DSPLYSZ ]; #ifdef PC # include "pc.h" # include "pcops.h" #endif PC #ifdef OBJ int cntpatch; int nfppatch; #endif OBJ struct nl *Fp; int pnumcnt; /* * Funcend is called to * finish a block by generating * the code for the statements. * It then looks for unresolved declarations * of labels, procedures and functions, * and cleans up the name list. * For the program, it checks the * semantics of the program * statement (yuchh). */ funcend(fp, bundle, endline) struct nl *fp; int *bundle; int endline; { register struct nl *p; register int i, b; int var, inp, out, *blk; bool chkref; struct nl *iop; char *cp; extern int cntstat; # ifdef PC int savlabel = getlab(); int toplabel = getlab(); int botlabel = getlab(); int proflabel = getlab(); char extname[ BUFSIZ ]; # endif PC cntstat = 0; /* * yyoutline(); */ if (program != NIL) line = program->value[3]; blk = bundle[2]; if (fp == NIL) { cbn--; # ifdef PTREE nesting--; # endif PTREE return; } #ifdef OBJ /* * Patch the branch to the * entry point of the function */ patch4(fp->entloc); /* * Put out the block entrance code and the block name. * HDRSZE is the number of bytes of info in the static * BEG data area exclusive of the proc name. It is * currently defined as: /* struct hdr { /* long framesze; /* number of bytes of local vars */ /* long nargs; /* number of bytes of arguments */ /* bool tests; /* TRUE => perform runtime tests */ /* short offset; /* offset of procedure in source file */ /* char name[1]; /* name of active procedure */ /* }; */ # define HDRSZE (2 * sizeof(long) + sizeof(short) + sizeof(bool)) var = put(2, ((lenstr(fp->symbol,0) + HDRSZE) << 8) | (cbn == 1 && opt('p') == 0 ? O_NODUMP: O_BEG), (long)0); /* * output the number of bytes of arguments * this is only checked on formal calls. */ put(2, O_CASE4, cbn == 1 ? (long)0 : (long)(fp->value[NL_OFFS]-DPOFF2)); /* * Output the runtime test mode for the routine */ put(2, sizeof(bool) == 2 ? O_CASE2 : O_CASE4, opt('t') ? TRUE : FALSE); /* * Output line number and routine name */ put(2, O_CASE2, bundle[1]); putstr(fp->symbol, 0); #endif OBJ #ifdef PC /* * put out the procedure entry code */ if ( fp -> class == PROG ) { putprintf( " .text" , 0 ); putprintf( " .align 1" , 0 ); putprintf( " .globl _main" , 0 ); putprintf( "_main:" , 0 ); putprintf( " .word 0" , 0 ); putprintf( " calls $0,_PCSTART" , 0 ); putprintf( " movl 4(ap),__argc" , 0 ); putprintf( " movl 8(ap),__argv" , 0 ); putprintf( " calls $0,_program" , 0 ); putprintf( " calls $0,_PCEXIT" , 0 ); ftnno = fp -> entloc; putprintf( " .text" , 0 ); putprintf( " .align 1" , 0 ); putprintf( " .globl _program" , 0 ); putprintf( "_program:" , 0 ); stabfunc( "program" , fp -> class , bundle[1] , 0 ); } else { ftnno = fp -> entloc; putprintf( " .text" , 0 ); putprintf( " .align 1" , 0 ); sextname( extname , fp -> symbol , cbn - 1 ); putprintf( " .globl %s%s" , 0 , FORMALPREFIX , extname ); putprintf( " .globl %s" , 0 , extname ); putprintf( "%s:" , 0 , extname ); stabfunc( fp -> symbol , fp -> class , bundle[1] , cbn - 1 ); for ( p = fp -> chain ; p != NIL ; p = p -> chain ) { stabparam( p -> symbol , p2type( p -> type ) , p -> value[ NL_OFFS ] , lwidth( p -> type ) ); } if ( fp -> class == FUNC ) { /* * stab the function variable */ p = fp -> ptr[ NL_FVAR ]; stablvar( p -> symbol , p2type( p -> type ) , cbn , p -> value[ NL_OFFS ] , lwidth( p -> type ) ); } /* * stab local variables * rummage down hash chain links. */ for ( i = 0 ; i <= 077 ; i++ ) { for ( p = disptab[ i ] ; p != NIL ; p = p->nl_next) { if ( ( p -> nl_block & 037 ) != cbn ) { break; } /* * stab local variables * that's named variables, but not params */ if ( ( p -> symbol != NIL ) && ( p -> class == VAR ) && ( p -> value[ NL_OFFS ] < 0 ) ) { stablvar( p -> symbol , p2type( p -> type ) , cbn , p -> value[ NL_OFFS ] , lwidth( p -> type ) ); } } } } stablbrac( cbn ); /* * register save mask */ putprintf( " .word " , 1 ); putprintf( PREFIXFORMAT , 0 , LABELPREFIX , savlabel ); putjbr( botlabel ); putlab( toplabel ); if ( profflag ) { /* * call mcount for profiling */ putprintf( " moval " , 1 ); putprintf( PREFIXFORMAT , 1 , LABELPREFIX , proflabel ); putprintf( ",r0" , 0 ); putprintf( " jsb mcount" , 0 ); putprintf( " .data" , 0 ); putprintf( " .align 2" , 0 ); putlab( proflabel ); putprintf( " .long 0" , 0 ); putprintf( " .text" , 0 ); } /* * set up unwind exception vector. */ putprintf( " moval %s,%d(%s)" , 0 , UNWINDNAME , UNWINDOFFSET , P2FPNAME ); /* * save address of display entry, for unwind. */ putprintf( " moval %s+%d,%d(%s)" , 0 , DISPLAYNAME , cbn * sizeof(struct dispsave) , DPTROFFSET , P2FPNAME ); /* * save old display */(( putprintf( " movq %s+%d,%d(%s)" , 0 , DISPLAYNAME , cbn * sizeof(struct dispsave) , DSAVEOFFSET , P2FPNAME ); /* * set up new display by saving AP and FP in appropriate * slot in display structure. */ putprintf( " movq %s,%s+%d" , 0 , P2APNAME , DISPLAYNAME , cbn * sizeof(struct dispsave) ); /* * ask second pass to allocate known locals */ putlbracket( ftnno , -sizes[ cbn ].om_max ); /* * and zero them if checking is on * by calling blkclr( bytes of locals , starting local address ); */ if ( opt( 't' ) && ( -sizes[ cbn ].om_max ) > DPOFF1 ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_blkclr" ); putleaf( P2ICON , ( -sizes[ cbn ].om_max ) - DPOFF1 , 0 , P2INT , 0 ); putLV( 0 , cbn , sizes[ cbn ].om_max , NLOCAL , P2CHAR ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); putdot( filename , line ); } #endif PC if ( monflg ) { if ( fp -> value[ NL_CNTR ] != 0 ) { inccnt( fp -> value [ NL_CNTR ] ); } inccnt( bodycnts[ fp -> nl_block & 037 ] ); } if (fp->class == PROG) { /* * The glorious buffers option. * 0 = don't buffer output * 1 = line buffer output * 2 = 512 byte buffer output */ # ifdef OBJ if (opt('b') != 1) put(1, O_BUFF | opt('b') << 8); # endif OBJ # ifdef PC if ( opt( 'b' ) != 1 ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_BUFF" ); putleaf( P2ICON , opt( 'b' ) , 0 , P2INT , 0 ); putop( P2CALL , P2INT ); putdot( filename , line ); } # endif PC out = 0; for (p = fp->chain; p != NIL; p = p->chain) { if (strcmp(p->symbol, "input") == 0) { inp++; continue; } if (strcmp(p->symbol, "output") == 0) { out++; continue; } iop = lookup1(p->symbol); if (iop == NIL || bn != cbn) { error("File %s listed in program statement but not declared", p->symbol); continue; } if (iop->class != VAR) { error("File %s listed in program statement but declared as a %s", p->symbol, classes[iop->class]); continue; } if (iop->type == NIL) continue; if (iop->type->class != FILET) { error("File %s listed in program statement but defined as %s", p->symbol, nameof(iop->type)); continue; } # ifdef OBJ put(2, O_CON24, text(iop->type) ? 0 : width(iop->type->type)); i = lenstr(p->symbol,0); put(2, O_CON24, i); put(2, O_LVCON, i); putstr(p->symbol, 0); put(2, O_LV | bn<<8+INDX, (int)iop->value[NL_OFFS]); put(1, O_DEFNAME); # endif OBJ # ifdef PC putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_DEFNAME" ); putLV( p -> symbol , bn , iop -> value[NL_OFFS] , iop -> extra_flags , p2type( iop ) ); putCONG( p -> symbol , strlen( p -> symbol ) , LREQ ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , strlen( p -> symbol ) , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , text(iop->type) ? 0 : width(iop->type->type) , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); putdot( filename , line ); # endif PC } if (out == 0 && fp->chain != NIL) { recovered(); error("The file output must appear in the program statement file list"); } } /* * Process the prog/proc/func body */ noreach = 0; line = bundle[1]; statlist(blk); # ifdef PTREE { pPointer Body = tCopy( blk ); pDEF( PorFHeader[ nesting -- ] ).PorFBody = Body; } # endif PTREE # ifdef OBJ if (cbn== 1 && monflg != 0) { patchfil(cntpatch - 2, (long)cnts, 2); patchfil(nfppatch - 2, (long)pfcnt, 2); } # endif OBJ # ifdef PC if ( fp -> class == PROG && monflg ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_PMFLUSH" ); putleaf( P2ICON , cnts , 0 , P2INT , 0 ); putleaf( P2ICON , pfcnt , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putLV( PCPCOUNT , 0 , 0 , NGLOBAL , P2INT ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); putdot( filename , line ); } # endif PC if (fp->class == PROG && inp == 0 && (input->nl_flags & (NUSED|NMOD)) != 0) { recovered(); error("Input is used but not defined in the program statement"); } /* * Clean up the symbol table displays and check for unresolves */ line = endline; b = cbn; Fp = fp; chkref = syneflg == errcnt[cbn] && opt('w') == 0; for (i = 0; i <= 077; i++) { for (p = disptab[i]; p != NIL && (p->nl_block & 037) == b; p = p->nl_next) { /* * Check for variables defined * but not referenced */ if (chkref && p->symbol != NIL) switch (p->class) { case FIELD: /* * If the corresponding record is * unused, we shouldn't complain about * the fields. */ default: if ((p->nl_flags & (NUSED|NMOD)) == 0) { warning(); nerror("%s %s is neither used nor set", classes[p->class], p->symbol); break; } /* * If a var parameter is either * modified or used that is enough. */ if (p->class == REF) continue; # ifdef OBJ if ((p->nl_flags & NUSED) == 0) { warning(); nerror("%s %s is never used", classes[p->class], p->symbol); break; } # endif OBJ # ifdef PC if (((p->nl_flags & NUSED) == 0) && ((p->extra_flags & NEXTERN) == 0)) { warning(); nerror("%s %s is never used", classes[p->class], p->symbol); break; } # endif PC if ((p->nl_flags & NMOD) == 0) { warning(); nerror("%s %s is used but never set", classes[p->class], p->symbol); break; } case LABEL: case FVAR: case BADUSE: break; } switch (p->class) { case BADUSE: cp = "s"; if (p->chain->ud_next == NIL) cp++; eholdnl(); if (p->value[NL_KINDS] & ISUNDEF) nerror("%s undefined on line%s", p->symbol, cp); else nerror("%s improperly used on line%s", p->symbol, cp); pnumcnt = 10; pnums(p->chain); pchr('\n'); break; case FUNC: case PROC: # ifdef OBJ if ((p->nl_flags & NFORWD)) nerror("Unresolved forward declaration of %s %s", classes[p->class], p->symbol); # endif OBJ # ifdef PC if ((p->nl_flags & NFORWD) && ((p->extra_flags & NEXTERN) == 0)) nerror("Unresolved forward declaration of %s %s", classes[p->class], p->symbol); # endif PC break; case LABEL: if (p->nl_flags & NFORWD) nerror("label %s was declared but not defined", p->symbol); break; case FVAR: if ((p->nl_flags & NMOD) == 0) nerror("No assignment to the function variable"); break; } } /* * Pop this symbol * table slot */ disptab[i] = p; } # ifdef OBJ put(1, O_END); # endif OBJ # ifdef PC /* * if there were file variables declared at this level * call pclose( &__disply[ cbn ] ) to clean them up. */ if ( dfiles[ cbn ] ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_PCLOSE" ); putRV( DISPLAYNAME , 0 , cbn * sizeof( struct dispsave ) , NGLOBAL , P2PTR | P2CHAR ); putop( P2CALL , P2INT ); putdot( filename , line ); } /* * if this is a function, * the function variable is the return value. * if it's a scalar valued function, return scalar, * else, return a pointer to the structure value. */ if ( fp -> class == FUNC ) { struct nl *fvar = fp -> ptr[ NL_FVAR ]; long fvartype = p2type( fvar -> type ); long label; char labelname[ BUFSIZ ]; switch ( classify( fvar -> type ) ) { case TBOOL: case TCHAR: case TINT: case TSCAL: case TDOUBLE: case TPTR: putRV( fvar -> symbol , ( fvar -> nl_block ) & 037 , fvar -> value[ NL_OFFS ] , fvar -> extra_flags , fvartype ); break; default: label = getlab(); sprintf( labelname , PREFIXFORMAT , LABELPREFIX , label ); putprintf( " .data" , 0 ); putprintf( " .lcomm %s,%d" , 0 , labelname , lwidth( fvar -> type ) ); putprintf( " .text" , 0 ); putleaf( P2NAME , 0 , 0 , fvartype , labelname ); putLV( fvar -> symbol , ( fvar -> nl_block ) & 037 , fvar -> value[ NL_OFFS ] , fvar -> extra_flags , fvartype ); putstrop( P2STASG , fvartype , lwidth( fvar -> type ) , align( fvar -> type ) ); putdot( filename , line ); putleaf( P2ICON , 0 , 0 , fvartype , labelname ); break; } putop( P2FORCE , fvartype ); putdot( filename , line ); } /* * restore old display entry from save area */ putprintf( " movq %d(%s),%s+%d" , 0 , DSAVEOFFSET , P2FPNAME , DISPLAYNAME , cbn * sizeof(struct dispsave) ); stabrbrac( cbn ); putprintf( " ret" , 0 ); /* * let the second pass allocate locals * and registers */ putprintf( " .set " , 1 ); putprintf( PREFIXFORMAT , 1 , LABELPREFIX , savlabel ); putprintf( ", 0x%x" , 0 , savmask() ); putlab( botlabel ); putprintf( " subl2 $LF%d,sp" , 0 , ftnno ); putrbracket( ftnno ); putjbr( toplabel ); /* * put down the entry point for formal calls * the arguments for FCALL have been passed to us * as hidden parameters after the regular arguments. */ if ( fp -> class != PROG ) { putprintf( "%s%s:" , 0 , FORMALPREFIX , extname ); putprintf( " .word " , 1 ); putprintf( PREFIXFORMAT , 0 , LABELPREFIX , savlabel ); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_FCALL" ); putRV( 0 , cbn , fp -> value[ NL_OFFS ] , NPARAM , P2PTR|P2STRTY ); putop( P2CALL , P2INT ); putdot( filename , line ); putjbr( botlabel ); } /* * declare pcp counters, if any */ if ( monflg && fp -> class == PROG ) { putprintf( " .data" , 0 ); putprintf( " .comm " , 1 ); putprintf( PCPCOUNT , 1 ); putprintf( ",%d" , 0 , ( cnts + 1 ) * sizeof (long) ); putprintf( " .text" , 0 ); } # endif PC #ifdef DEBUG dumpnl(fp->ptr[2], fp->symbol); #endif /* * Restore the * (virtual) name list * position */ nlfree(fp->ptr[2]); /* * Proc/fun((c has been * resolved */ fp->nl_flags &= ~NFORWD; /* * Patch the beg * of the proc/func to * the proper variable size */ if (Fp == NIL) elineon(); # ifdef OBJ patchfil(var, (long)(-sizes[cbn].om_max), 2); # endif OBJ cbn--; if (inpflist(fp->symbol)) { opop('l'); } } #ifdef PC /* * construct the long name of a function based on it's static nesting. * into a caller-supplied buffer (that should be about BUFSIZ big). */ sextname( buffer , name , level ) char buffer[]; char *name; int level; { char *starthere; int i; starthere = &buffer[0]; for ( i = 1 ; i < level ; i++ ) { sprintf( starthere , EXTFORMAT , enclosing[ i ] ); starthere += strlen( enclosing[ i ] ) + 1; } sprintf( starthere , EXTFORMAT , name ); starthere += strlen( name ) + 1; if ( starthere >= &buffer[ BUFSIZ ] ) { panic( "sextname" ); } } #endif PC upplied buffer (that should be about BUFSIZ big). */ sextname( buffer , name , level ) char bucmd/pc0/fhdr.c 644 0 33 23775 2552606573 6417 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)fhdr.c 1.3 6/1/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "opcode.h" #include "objfmt.h" #include "align.h" /* * this array keeps the pxp counters associated with * functions and procedures, so that they can be output * when their bodies are encountered */ int bodycnts[ DSPLYSZ ]; #ifdef PC # include "pc.h" # include "pcops.h" #endif PC #ifdef OBJ int cntpatch; int nfppatch; #endif OBJ /* * Funchdr inserts * declaration of a the * prog/proc/func into the * namelist. It also handles * the arguments and puts out * a transfer which defines * the entry point of a procedure. */ struct nl * funchdr(r) int *r; { register struct nl *p; register *il, **rl; struct nl *cp, *dp; int s, o, *pp; if (inpflist(r[2])) { opush('l'); yyretrieve(); /* kludge */ } pfcnt++; parts[ cbn ] |= RPRT; line = r[1]; if (r[3] == NIL && (p=lookup1(r[2])) != NIL && bn == cbn) { /* * Symbol already defined * in this block. it is either * a redeclared symbol (error) * a forward declaration, * or an external declaration. */ if ((p->class == FUNC || p->class == PROC) && (p->nl_flags & NFORWD) != 0) { /* * Grammar doesnt forbid * types on a resolution * of a forward function * declaration. */ if (p->class == FUNC && r[4]) error("Function type should be given only in forward declaration"); /* * get another counter for the actual */ if ( monflg ) { bodycnts[ cbn ] = getcnt(); } # ifdef PC enclosing[ cbn ] = p -> symbol; # endif PC # ifdef PTREE /* * mark this proc/func as forward * in the pTree. */ pDEF( p -> inTree ).PorFForward = TRUE; # endif PTREE return (p); } } /* if a routine segment is being compiled, * do level one processing. */ if ((r[0] != T_PROG) && (!progseen)) level1(); /* * Declare the prog/proc/func */ switch (r[0]) { case T_PROG: progseen = TRUE; if (opt('z')) monflg = TRUE; program = p = defnl(r[2], PROG, 0, 0); p->value[3] = r[1]; break; case T_PDEC: if (r[4] != NIL) error("Procedures do not have types, only functions do"); p = enter(defnl(r[2], PROC, 0, 0)); p->nl_flags |= NMOD; # ifdef PC enclosing[ cbn ] = r[2]; p -> extra_flags |= NGLOBAL; # endif PC break; case T_FDEC: il = r[4]; if (il == NIL) error("Function type must be specified"); else if (il[0] != T_TYID) { il = NIL; error("Function type can be specified only by using a type identifier"); } else il = gtype(il); p = enter(defnl(r[2], FUNC, il, NIL)); p->nl_flags |= NMOD; /* * An arbitrary restriction */ switch (o = classify(p->type)) { case TFILE: case TARY: case TREC: case TSET: case TSTR: warning(); if (opt('s')) { standard(); } error("Functions should not return %ss", clnames[o]); } # ifdef PC enclosing[ cbn ] = r[2]; p -> extra_flags |= NGLOBAL; # endif PC break; default: panic("funchdr"); } if (r[0] != T_PROG) { /* * Mark this proc/func as * being forward declared */ p->nl_flags |= NFORWD; /* * Enter the parameters * in the next block for * the time being */ if (++cbn >= DSPLYSZ) { error("Procedure/function nesting too deep"); pexit(ERRS); } /* * For functions, the function variable */ if (p->class == FUNC) { # ifdef OBJ cp = defnl(r[2], FVAR, p->type, 0); # endif OBJ # ifdef PC /* * fvars used to be allocated and deallocated * by the caller right before the arguments. * the offset of the fvar was kept in * value[NL_OFFS] of function (very wierd, * but see asgnop). * now, they are locals to the function * with the offset kept in the fvar. */ cp = defnl(r[2], FVAR, p->type, (int)-leven(roundup( (int)(DPOFF1+lwidth(p->type)), (long)align(p->type)))); cp -> extra_flags |= NLOCAL; # endif PC cp->chain = p; p->ptr[NL_FVAR] = cp; } /* * Enter the parameters * and compute total size */ p->value[NL_OFFS] = params(p, r[3]); /* * because NL_LINENO field in the function * namelist entry has been used (as have all * the other fields), the line number is * stored in the NL_LINENO field of its fvar. */ if (p->class == FUNC) p->ptr[NL_FVAR]->value[NL_LINENO] = r[1]; else p->value[NL_LINENO] = r[1]; cbn--; } else { /* * The wonderful * program statement! */ # ifdef OBJ if (monflg) { put(1, O_PXPBUF); cntpatch = put(2, O_CASE4, (long)0); nfppatch = put(2, O_CASE4, (long)0); } # endif OBJ cp = p; for (rl = r[3]; rl; rl = rl[2]) { if (rl[1] == NIL) continue; dp = defnl(rl[1], VAR, 0, 0); cp->chain = dp; cp = dp; } } /* * Define a branch at * the "entry point" of * the prog/proc/func. */ p->entloc = getlab(); if (monflg) { bodycnts[ cbn ] = getcnt(); p->value[ NL_CNTR ] = 0; } # ifdef OBJ put(2, O_TRA4, (long)p->entloc); # endif OBJ # ifdef PTREE { pPointer PF = tCopy( r ); pSeize( PorFHeader[ nesting ] ); if ( r[0] != T_PROG ) { pPointer *PFs; PFs = &( pDEF( PorFHeader[ nesting ] ).PorFPFs ); *PFs = ListAppend( *PFs , PF ); } else { pDEF( PorFHeader[ nesting ] ).GlobProg = PF; } pRelease( PorFHeader[ nesting ] ); } # endif PTREE return (p); } /* * deal with the parameter declaration for a routine. * p is the namelist entry of the routine. * formalist is the parse tree for the parameter declaration. * formalist [0] T_LISTPP * [1] pointer to a formal * [2] pointer to next formal * for by-value or by-reference formals, the formal is * formal [0] T_PVAL or T_PVAR * [1] pointer to id_list * [2] pointer to type (error if not typeid) * for function and procedure formals, the formal is * formal [0] T_PFUNC or T_PPROC * [1] pointer to id_list (error if more than one) * [2] pointer to type (error if not typeid, or proc) * [3] pointer to formalist for this routine. */ fparams(p, formal) register struct nl *p; int *formal; { params(p, formal[3]); p -> value[ NL_LINENO ] = formal[4]; p -> ptr[ NL_FCHAIN ] = p -> chain; p -> chain = NIL; } params(p, formalist) register struct nl *p; int *formalist; { struct nl *chainp, *savedp; struct nl *dp; register int **formalp; /* an element of the formal list */ register int *formal; /* a formal */ int *typ, *idlist; int w, o; /* * Enter the parameters * and compute total size */ chainp = savedp = p; # ifdef OBJ o = 0; # endif OBJ # ifdef PC /* * parameters used to be allocated backwards, * then fixed. for pc, they are allocated correctly. * also, they are aligned. */ o = DPOFF2; # endif PC for (formalp = formalist; formalp != NIL; formalp = formalp[2]) { p = NIL; formal = formalp[1]; if (formal == NIL) continue; /* * Parametric procedures * don't have types !?! */ typ = formal[2]; if ( typ == NIL ) { if ( formal[0] != T_PPROC ) { error("Types must be specified for arguments"); p = NIL; } } else { if ( formal[0] == T_PPROC ) { error("Procedures cannot have types"); p = NIL; } else { if (typ[0] != T_TYID) { error("Types for arguments can be specified only by using type identifiers"); p = NIL; } else { p = gtype(typ); } } } for (idlist = formal[1]; idlist != NIL; idlist = idlist[2]) { switch (formal[0]) { default: panic("funchdr2"); case T_PVAL: if (p != NIL) { if (p->class == FILET) error("Files cannot be passed by value"); else if (p->nl_flags & NFILES) error("Files cannot be a component of %ss passed by value", nameof(p)); } # ifdef OBJ w = lwidth(p); o -= even(w); # ifdef DEC11 dp = defnl(idlist[1], VAR, p, o); # else dp = defnl(idlist[1], VAR, p, (w < 2) ? o + 1 : o); # endif DEC11 # endif OBJ # ifdef PC dp = defnl( idlist[1] , VAR , p , o = roundup( o , (long)A_STACK ) ); o += lwidth( p ); # endif PC dp->nl_flags |= NMOD; break; case T_PVAR: # ifdef OBJ dp = defnl(idlist[1], REF, p, o -= sizeof ( int * ) ); # endif OBJ # ifdef PC dp = defnl( ((idlist[1] , REF , p , o = roundup( o , (long)A_STACK ) ); o += sizeof(char *); # endif PC break; case T_PFUNC: if (idlist[2] != NIL) { error("Each function argument must be declared separately"); idlist[2] = NIL; } # ifdef OBJ dp = defnl(idlist[1], FFUNC, p, o -= sizeof ( int * ) ); # endif OBJ # ifdef PC dp = defnl( idlist[1] , FFUNC , p , o = roundup( o , (long)A_STACK ) ); o += sizeof(char *); # endif PC dp -> nl_flags |= NMOD; fparams(dp, formal); break; case T_PPROC: if (idlist[2] != NIL) { error("Each procedure argument must be declared separately"); idlist[2] = NIL; } # ifdef OBJ dp = defnl(idlist[1], FPROC, p, o -= sizeof ( int * ) ); # endif OBJ # ifdef PC dp = defnl( idlist[1] , FPROC , p , o = roundup( o , (long)A_STACK ) ); o += sizeof(char *); # endif PC dp -> nl_flags |= NMOD; fparams(dp, formal); break; } if (dp != NIL) { # ifdef PC dp -> extra_flags |= NPARAM; # endif PC chainp->chain = dp; chainp = dp; } } } p = savedp; # ifdef OBJ /* * Correct the naivete (naivety) * of our above code to * calculate offsets */ for (dp = p->chain; dp != NIL; dp = dp->chain) dp->value[NL_OFFS] += -o + DPOFF2; return (-o + DPOFF2); # endif OBJ # ifdef PC return roundup( o , (long)A_STACK ); # endif PC } D; cmd/pc0/flvalue.c 644 0 33 5255 2552606573 7103 /* Copyright (c) 1980 Regents of the University of California */ static char sccsid[] = "@(#)flvalue.c 1.11 6/8/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "opcode.h" #include "objfmt.h" #ifdef PC # include "pc.h" # include "pcops.h" #endif PC /* * flvalue generates the code to either pass on a formal routine, * or construct the structure which is the environment for passing. * it tells the difference by looking at the tree it's given. */ struct nl * flvalue( r , formalp ) int *r; struct nl *formalp; { struct nl *p; struct nl *tempnlp; char *typename; #ifdef PC char extname[ BUFSIZ ]; #endif PC if ( r == NIL ) { return NIL; } typename = formalp -> class == FFUNC ? "function":"procedure"; if ( r[0] != T_VAR ) { error("Expression given, %s required for %s parameter %s" , typename , typename , formalp -> symbol ); return NIL; } p = lookup(r[2]); if (p == NIL) { return NIL; } switch ( p -> class ) { case FFUNC: case FPROC: if ( r[3] != NIL ) { error("Formal %s %s cannot be qualified" , typename , p -> symbol ); return NIL; } # ifdef OBJ put(2, PTR_RV | bn << 8+INDX, (int)p->value[NL_OFFS]); # endif OBJ # ifdef PC putRV( p -> symbol , bn , p -> value[ NL_OFFS ] , p -> extra_flags , p2type( p ) ); # endif PC return p; case FUNC: case PROC: if ( r[3] != NIL ) { error("%s %s cannot be qualified" , typename , p -> symbol ); return NIL; } if (bn == 0) { error("Built-in %s %s cannot be passed as a parameter" , typename , p -> symbol ); return NIL; } /* * allocate space for the thunk */ tempnlp = tmpalloc( sizeof ( struct formrtnhead ) + 2 * bn * sizeof(struct dispsave) , nl+TSTR, NOREG); # ifdef OBJ put(2 , O_LV | cbn << 8 + INDX , (int)tempnlp -> value[ NL_OFFS ] ); put(2, O_FSAV | bn << 8, (long)p->entloc); # endif OBJ # ifdef PC putleaf( P2ICON , 0 , 0 , ADDTYPE( P2PTR , ADDTYPE( P2FTN , P2PTR|P2STRTY ) ) , "_FSAV" ); sprintf( extname , "%s" , FORMALPREFIX ); sextname( &extname[ strlen( extname ) ] , p -> symbol , bn ); putleaf( P2ICON , 0 , 0 , p2type( p ) , extname ); putleaf( P2ICON , bn , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putLV( 0 , cbn , tempnlp -> value[NL_OFFS] , tempnlp -> extra_flags , P2STRTY ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2PTR | P2STRTY ); # endif PC return p; default: error("Variable given, %s required for %s parameter %s" , typename , typename , formalp -> symbol ); return NIL; } } extname ) ] , p -> symbol , bn ); putleaf( P2ICON , 0 , 0 , p2type( p ) , extname ); putleaf( P2ICON , bn , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putLV( 0 , cbn , tempnlp -> value[NL_OFFS] , tempnlp -> extra_flags , P2STRTY ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2PTR | P2STRTY ); # endif Pcmd/pc0/forop.c 644 0 33 24403 2552606574 6607 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)forop.c 1.9 6/1/81"; #include "whoami.h" #include "0.h" #include "opcode.h" #include "tree.h" #include "objfmt.h" #ifdef PC # include "pc.h" # include "pcops.h" #endif PC /* * forop for pc: * this evaluates the initial and termination expressions, * checks them to see if the loop executes at all, and then * does the assignment and the loop. * arg here looks like: * arg[0] T_FORU or T_FORD * [1] lineof "for" * [2] [0] T_ASGN * [1] lineof ":=" * [2] [0] T_VAR * [1] lineof id * [2] char * to id * [3] qualifications * [3] initial expression * [3] termination expression * [4] statement */ forop( arg ) int *arg; { int *lhs; struct nl *forvar; struct nl *fortype; int *init; struct nl *inittype; struct nl *initnlp; /* initial value namelist entry */ char forflags; int *term; struct nl *termtype; struct nl *termnlp; /* termination value namelist entry */ int *stat; int goc; /* saved gocnt */ int again; /* label at the top of the loop */ int after; /* label after the end of the loop */ bool shadowed; /* shadowing for var in temporary? */ long s_offset; /* saved offset of real for variable */ long s_flags; /* saved flags of real for variable */ long s_forv; /* saved NL_FORV of the for variable */ # ifdef PC char s_extra_flags; /* saved extra_flags of the for var */ # endif PC goc = gocnt; forvar = NIL; shadowed = FALSE; if ( arg == NIL ) { goto byebye; } if ( arg[2] == NIL ) { goto byebye; } line = arg[1]; putline(); lhs = ( (int *) arg[2] )[2]; init = ( (int *) arg[2] )[3]; term = arg[3]; stat = arg[4]; if (lhs == NIL) { nogood: if (forvar != NIL) { forvar->value[ NL_FORV ] = FORVAR; } rvalue( init , NIL , RREQ ); rvalue( term , NIL , RREQ ); statement( stat ); goto byebye; } /* * and this marks the variable as used!!! */ forvar = lookup( lhs[2] ); if ( forvar == NIL ) { goto nogood; } s_forv = forvar -> value[ NL_FORV ]; if ( lhs[3] != NIL ) { error("For variable %s must be unqualified", forvar->symbol); goto nogood; } if (forvar->class == WITHPTR) { error("For variable %s cannot be an element of a record", lhs[2]); goto nogood; } if ( opt('s') && ( ( bn != cbn ) || #ifdef OBJ ( whereis( bn , forvar->value[NL_OFFS] , 0 ) == PARAMVAR ) #endif OBJ #ifdef PC ( whereis( bn , forvar->value[NL_OFFS] , forvar -> extra_flags ) == PARAMVAR ) #endif PC ) ) { standard(); error("For variable %s must be declared in the block in which it is used", forvar->symbol); } /* * find out the type of the loop variable */ codeoff(); fortype = lvalue( lhs , MOD , RREQ ); codeon(); if ( fortype == NIL ) { goto nogood; } if ( isnta( fortype , "bcis" ) ) { error("For variable %s cannot be %ss", forvar->symbol, nameof( fortype ) ); goto nogood; } if ( forvar->value[ NL_FORV ] & FORVAR ) { error("Can't modify the for variable %s in the range of the loop", forvar->symbol); forvar = NIL; goto nogood; } /* * allocate space for the initial and termination expressions * the initial is tentatively placed in a register as it will * shadow the for loop variable in the body of the loop. */ initnlp = tmpalloc(sizeof(long), nl+T4INT, REGOK); termnlp = tmpalloc(sizeof(long), nl+T4INT, NOREG); # ifdef PC /* * compute and save the initial expression */ putRV( 0 , cbn , initnlp -> value[ NL_OFFS ] , initnlp -> extra_flags , P2INT ); # endif PC # ifdef OBJ put(2, O_LV | cbn<<8+INDX, initnlp -> value[ NL_OFFS ] ); # endif OBJ inittype = rvalue( init , fortype , RREQ ); if ( incompat( inittype , fortype , init ) ) { cerror("Type of initial expression clashed with index type in 'for' statement"); if (forvar != NIL) { forvar->value[ NL_FORV ] = FORVAR; } rvalue( term , NIL , RREQ ); statement( stat ); goto byebye; } # ifdef PC putop( P2ASSIGN , P2INT ); putdot( filename , line ); /* * compute and save the termination expression */ putRV( 0 , cbn , termnlp -> value[ NL_OFFS ] , termnlp -> extra_flags , P2INT ); # endif PC # ifdef OBJ gen(O_AS2, O_AS2, sizeof(long), width(inittype)); /* * compute and save the termination expression */ put(2, O_LV | cbn<<8+INDX, termnlp -> value[ NL_OFFS ] ); ((# endif OBJ termtype = rvalue( term , fortype , RREQ ); if ( incompat( termtype , fortype , term ) ) { cerror("Type of limit expression clashed with index type in 'for' statement"); if (forvar != NIL) { forvar->value[ NL_FORV ] = FORVAR; } statement( stat ); goto byebye; } # ifdef PC putop( P2ASSIGN , P2INT ); putdot( filename , line ); /* * we can skip the loop altogether if !( init <= term ) */ after = getlab(); putRV( 0 , cbn , initnlp -> value[ NL_OFFS ] , initnlp -> extra_flags , P2INT ); putRV( 0 , cbn , termnlp -> value[ NL_OFFS ] , termnlp -> extra_flags , P2INT ); putop( ( arg[0] == T_FORU ? P2LE : P2GE ) , P2INT ); putleaf( P2ICON , after , 0 , P2INT , 0 ); putop( P2CBRANCH , P2INT ); putdot( filename , line ); /* * put down the label at the top of the loop */ again = getlab(); putlab( again ); /* * okay, then we have to execute the body, but first, * assign the initial expression to the for variable. * see the note in asgnop1 about why this is an rvalue. */ lvalue( lhs , NOUSE , RREQ ); if ( opt( 't' ) ) { precheck( fortype , "_RANG4" , "_RSNG4" ); } putRV( 0 , cbn , initnlp -> value[ NL_OFFS ] , initnlp -> extra_flags , P2INT ); if ( opt( 't' ) ) { postcheck( fortype ); } putop( P2ASSIGN , p2type( fortype ) ); putdot( filename , line ); # endif PC # ifdef OBJ gen(O_AS2, O_AS2, sizeof(long), width(termtype)); /* * we can skip the loop altogether if !( init <= term ) */ put(2, O_RV4 | cbn<<8+INDX, initnlp -> value[ NL_OFFS ] ); put(2, O_RV4 | cbn<<8+INDX, termnlp -> value[ NL_OFFS ] ); gen(NIL, arg[0] == T_FORU ? T_LE : T_GE, sizeof(long), sizeof(long)); after = getlab(); put(2, O_IF, after); /* * put down the label at the top of the loop */ again = getlab(); putlab( again ); /* * okay, then we have to execute the body, but first, * assign the initial expression to the for variable. */ lvalue( lhs , NOUSE , LREQ ); put(2, O_RV4 | cbn<<8+INDX, initnlp -> value[ NL_OFFS ] ); rangechk(fortype, nl+T4INT); gen(O_AS2, O_AS2, width(fortype), sizeof(long)); # endif OBJ /* * shadowing the real for variable * with the initail expression temporary: * save the real for variable's offset, flags * (including nl_block). * replace them with the initial expression's offset, * and mark it as being a for variable. */ shadowed = TRUE; s_offset = forvar -> value[ NL_OFFS ]; s_flags = forvar -> nl_flags; forvar -> value[ NL_OFFS ] = initnlp -> value[ NL_OFFS ]; forvar -> nl_flags = cbn; forvar -> value[ NL_FORV ] = FORVAR; # ifdef PC s_extra_flags = forvar -> extra_flags; forvar -> extra_flags = initnlp -> extra_flags; # endif PC /* * and don't forget ... */ putcnt(); statement( stat ); /* * wasn't that fun? do we get to do it again? * we don't do it again if ( !( forvar < limit ) ) * pretend we were doing this at the top of the loop */ line = arg[ 1 ]; # ifdef PC if ( opt( 'p' ) ) { if ( opt('t') ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_LINO" ); putop( P2UNARY P2CALL , P2INT ); putdot( filename , line ); } else { putRV( STMTCOUNT , 0 , 0 , NGLOBAL , P2INT ); putleaf( P2ICON , 1 , 0 , P2INT , 0 ); putop( P2ASG P2PLUS , P2INT ); putdot( filename , line ); } } /*rvalue( lhs , NIL , RREQ );*/ putRV( 0 , cbn , initnlp -> value[ NL_OFFS ] , initnlp -> extra_flags , P2INT ); putRV( 0 , cbn , termnlp -> value[ NL_OFFS ] , termnlp -> extra_flags , P2INT ); putop( ( arg[ 0 ] == T_FORU ? P2LT : P2GT ) , P2INT ); putleaf( P2ICON , after , 0 , P2INT , 0 ); putop( P2CBRANCH , P2INT ); putdot( filename , line ); /* * okay, so we have to do it again, * but first, increment the for variable. * there it is again, an rvalue on the lhs of an assignment. */ /*lvalue( lhs , MOD , RREQ );*/ putRV( 0 , cbn , initnlp -> value[ NL_OFFS ] , initnlp -> extra_flags , P2INT ); if ( opt( 't' ) ) { precheck( fortype , "_RANG4" , "_RSNG4" ); } /*rvalue( lhs , NIL , RREQ );*/ putRV( 0 , cbn , initnlp -> value[ NL_OFFS ] , initnlp -> extra_flags , P2INT ); putleaf( P2ICON , 1 , 0 , P2INT , 0 ); putop( ( arg[0] == T_FORU ? P2PLUS : P2MINUS ) , P2INT ); if ( opt( 't' ) ) { postcheck( fortype ); } putop( P2ASSIGN , P2INT ); putdot( filename , line ); /* * and do it all again */ putjbr( again ); /* * and here we are */ putlab( after ); # endif PC # ifdef OBJ /* * okay, so we have to do it again. * Luckily we have a magic opcode which increments the * index variable, checks the limit falling through if * it has been reached, else range checking the result * updating the index variable, and returning to the top * of the loop. */ putline(); put(2, O_RV4 | cbn<<8+INDX, termnlp -> value[ NL_OFFS ] ); lvalue(lhs, MOD, LREQ); if (width(fortype) <= 2) put(4, (arg[0] == T_FORU ? O_FOR1U : O_FOR1D) + (width(fortype)>>1), (int)fortype->range[0], (int)fortype->range[1], again); else put(4, (arg[0] == T_FORU ? O_FOR4U : O_FOR4D), fortype->range[0], fortype->range[1], again); /* * and here we are */ patch( after ); # endif OBJ byebye: noreach = 0; if (forvar != NIL) { forvar -> value[ NL_FORV ] = s_forv; } if ( shadowed ) { forvar -> value[ NL_OFFS ] = s_offset; forvar -> nl_flags = s_flags; # ifdef PC forvar -> extra_flags = s_extra_flags; # endif PC } if ( goc != gocnt ) { putcnt(); } } ype->range[1], again); else put(4, (arg[0] == T_FORU ? O_FOR4U : O_FOR4D), fortype->range[0], fortype->range[1], again); /* * and here we are */ patch( after ); # endif OBJ byebye: noreach = 0; if (forvar != NIL) { cmd/pc0/func.c 644 0 33 12036 2552606574 6414 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)func.c 1.7 3/8/81"; #include "whoami.h" #ifdef OBJ /* * the rest of the file */ #include "0.h" #include "tree.h" #include "opcode.h" /* * Funccod generates code for * built in function calls and calls * call to generate calls to user * defined functions and procedures. */ funccod(r) int *r; { struct nl *p; register struct nl *p1; register int *al; register op; int argc, *argv; int tr[2], tr2[4]; /* * Verify that the given name * is defined and the name of * a function. */ p = lookup(r[2]); if (p == NIL) { rvlist(r[3]); return (NIL); } if (p->class != FUNC && p->class != FFUNC) { error("%s is not a function", p->symbol); rvlist(r[3]); return (NIL); } argv = r[3]; /* * Call handles user defined * procedures and functions */ if (bn != 0) return (call(p, argv, FUNC, bn)); /* * Count the arguments */ argc = 0; for (al = argv; al != NIL; al = al[2]) argc++; /* * Built-in functions have * their interpreter opcode * associated with them. */ op = p->value[0] &~ NSTAND; if (opt('s') && (p->value[0] & NSTAND)) { standard(); error("%s is a nonstandard function", p->symbol); } switch (op) { /* * Parameterless functions */ case O_CLCK: case O_SCLCK: case O_WCLCK: case O_ARGC: if (argc != 0) { error("%s takes no arguments", p->symbol); rvlist(argv); return (NIL); } put(1, op); return (nl+T4INT); case O_EOF: case O_EOLN: if (argc == 0) { argv = tr; tr[1] = tr2; tr2[0] = T_VAR; tr2[2] = input->symbol; tr2[1] = tr2[3] = NIL; argc = 1; } else if (argc != 1) { error("%s takes either zero or one argument", p->symbol); rvlist(argv); return (NIL); } } /* * All other functions take * exactly one argument. */ if (argc != 1) { error("%s takes exactly one argument", p->symbol); rvlist(argv); return (NIL); } /* * Evaluate the argmument */ if (op == O_EOF || op == O_EOLN) p1 = stklval((int *) argv[1], NLNIL , LREQ ); else p1 = stkrval((int *) argv[1], NLNIL , RREQ ); if (p1 == NIL) return (NIL); switch (op) { case O_EXP: case O_SIN: case O_COS: case O_ATAN: case O_LN: case O_SQRT: case O_RANDOM: case O_EXPO: case O_UNDEF: if (isa(p1, "i")) convert( nl+T4INT , nl+TDOUBLE); else if (isnta(p1, "d")) { error("%s's argument must be integer or real, not %s", p->symbol, nameof(p1)); return (NIL); } put(1, op); if (op == O_UNDEF) return (nl+TBOOL); else if (op == O_EXPO) return (nl+T4INT); else return (nl+TDOUBLE); case O_SEED: if (isnta(p1, "i")) { error("seed's argument must be an integer, not %s", nameof(p1)); return (NIL); } put(1, op); return (nl+T4INT); case O_ROUND: case O_TRUNC: if (isnta(p1, "d")) { error("%s's argument must be a real, not %s", p->symbol, nameof(p1)); return (NIL); } put(1, op); return (nl+T4INT); case O_ABS2: case O_SQR2: if (isa(p1, "d")) { put(1, op + O_ABS8-O_ABS2); return (nl+TDOUBLE); } if (isa(p1, "i")) { put(1, op + (width(p1) >> 2)); return (nl+T4INT); } error("%s's argument must be an integer or real, not %s", p->symbol, nameof(p1)); return (NIL); case O_ORD2: if (isa(p1, "bcis") || classify(p1) == TPTR) { return (nl+T4INT); } error("ord's argument must be of scalar type or a pointer, not %s", nameof(p1)); return (NIL); case O_SUCC2: case O_PRED2: if (((isa(p1, "d")) { error("%s is forbidden for reals", p->symbol); return (NIL); } if ( isnta( p1 , "bcsi" ) ) { error("%s's argument must be of scalar type, not %s", p->symbol, nameof(p1)); return NIL; } if (isa(p1, "i")) { if (width(p1) <= 2) { op += O_PRED24 - O_PRED2; put(3, op, (int)p1->range[0], (int)p1->range[1]); } else { op++; put(3, op, p1->range[0], p1->range[1]); } return nl + T4INT; } else { put(3, op, (int)p1->range[0], (int)p1->range[1]); return p1; } case O_ODD2: if (isnta(p1, "i")) { error("odd's argument must be an integer, not %s", nameof(p1)); return (NIL); } put(1, op + (width(p1) >> 2)); return (nl+TBOOL); case O_CHR2: if (isnta(p1, "i")) { error("chr's argument must be an integer, not %s", nameof(p1)); return (NIL); } put(1, op + (width(p1) >> 2)); return (nl+TCHAR); case O_CARD: if (isnta(p1, "t")) { error("Argument to card must be a set, not %s", nameof(p1)); return (NIL); } put(2, O_CARD, width(p1)); return (nl+T2INT); case O_EOLN: if (!text(p1)) { error("Argument to eoln must be a text file, not %s", nameof(p1)); return (NIL); } put(1, op); return (nl+TBOOL); case O_EOF: if (p1->class != FILET) { error("Argument to eof must be file, not %s", nameof(p1)); return (NIL); } put(1, op); return (nl+TBOOL); case 0: error("%s is an unimplemented 6000-3.4 extension", p->symbol); default: panic("func1"); } } #endif OBJ } put(2, O_CARD, width(p1)); return (nl+T2INT); case O_EOLN: if (!text(p1)) { error("Argument to eoln must be a text file, not %s", nameof(p1)); return (NIL); } put(1, op); return (nl+TBOOL); case O_EOF: if (p1->class != FILET) { error("Argument to eof must be file, not %s", nameof(p1)); return (NIL); } put(1, op); return (nl+TBOOL); case 0: error("%s is an unimplemented 6000-3.4 extension", p->symbol); default: pacmd/pc0/gen.c 644 0 33 12475 2552606575 6242 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)gen.c 1.2 3/8/81"; #include "whoami.h" #ifdef OBJ /* * and the rest of the file */ #include "0.h" #include "tree.h" #include "opcode.h" #include "objfmt.h" /* * This array tells the type * returned by an arithmetic * operation. It is indexed * by the logarithm of the * lengths base 2. */ #ifndef DEBUG char arret[] = { T4INT, T4INT, T4INT, TDOUBLE, T4INT, T4INT, T4INT, TDOUBLE, T4INT, T4INT, T4INT, TDOUBLE, TDOUBLE, TDOUBLE, TDOUBLE, TDOUBLE }; #else char arret0[] = { T4INT, T4INT, T4INT, TDOUBLE, T4INT, T4INT, T4INT, TDOUBLE, T4INT, T4INT, T4INT, TDOUBLE, TDOUBLE, TDOUBLE, TDOUBLE, TDOUBLE }; char arret1[] = { T4INT, T4INT, T4INT, TDOUBLE, T4INT, T4INT, T4INT, TDOUBLE, T4INT, T4INT, T4INT, TDOUBLE, TDOUBLE, TDOUBLE, TDOUBLE, TDOUBLE }; char *arret = arret0; #endif /* * These array of arithmetic and set * operators are indexed by the * tree nodes and is highly dependent * on their order. They thus take * on the flavor of magic. */ int arop[] = { 0, O_NEG2, O_MOD2, O_DIV2, O_DVD2, O_MUL2, O_ADD2, O_SUB2, O_REL2, O_REL2, O_REL2, O_REL2, O_REL2, O_REL2 }; int setop[] = { O_MULT, O_ADDT, O_SUBT, O_RELT, O_RELT, O_RELT, O_RELT, O_RELT, O_RELT, }; /* * The following array is * used when operating on * two reals since they are * shoved off in a corner in * the interpreter table. */ int ar8op[] = { O_DVD8, O_MUL8, O_ADD8, O_SUB8, O_REL8, O_REL8, O_REL8, O_REL8, O_REL8, O_REL8, }; /* * The following arrays, which are linearizations * of two dimensional arrays, are the offsets for * arithmetic, relational and assignment operations * indexed by the logarithms of the argument widths. */ #ifndef DEBUG char artab[] = { O_ADD2-O_ADD2, O_ADD2-O_ADD2, O_ADD42-O_ADD2, O_ADD82-O_ADD2, O_ADD2-O_ADD2, O_ADD2-O_ADD2, O_ADD42-O_ADD2, O_ADD82-O_ADD2, O_ADD24-O_ADD2, O_ADD24-O_ADD2, O_ADD4-O_ADD2, O_ADD84-O_ADD2, O_ADD28-O_ADD2, O_ADD28-O_ADD2, O_ADD48-O_ADD2, -1 }; #else char artab0[] = { O_ADD2-O_ADD2, O_ADD2-O_ADD2, O_ADD42-O_ADD2, O_ADD82-O_ADD2, O_ADD2-O_ADD2, O_ADD2-O_ADD2, O_ADD42-O_ADD2, O_ADD82-O_ADD2, O_ADD24-O_ADD2, O_ADD24-O_ADD2, O_ADD4-O_ADD2, O_ADD84-O_ADD2, O_ADD28-O_ADD2, O_ADD28-O_ADD2, O_ADD48-O_ADD2, -1 }; char artab1[] = { O_ADD2-O_ADD2, O_ADD2-O_ADD2, O_ADD2-O_ADD2, O_ADD82-O_ADD2, O_ADD2-O_ADD2, O_ADD2-O_ADD2, O_ADD2-O_ADD2, O_ADD82-O_ADD2, O_ADD2-O_ADD2, O_ADD2-O_ADD2, O_ADD2-O_ADD2, O_ADD84-O_ADD2, O_ADD28-O_ADD2, O_ADD28-O_ADD2, O_ADD28-O_ADD2, -1 }; char *artab = artab0; #endif #ifndef DEBUG char reltab[] = { O_REL2-O_REL2, O_REL2-O_REL2, O_REL42-O_REL2, O_REL82-O_REL2, O_REL2-O_REL2, O_REL2-O_REL2, O_REL42-O_REL2, O_REL82-O_REL2, O_REL24-O_REL2, O_REL24-O_REL2, O_REL4-O_REL2, O_REL84-O_REL2, O_REL28-O_REL2, O_REL28-O_REL2, O_REL48-O_REL2, O_REL8-O_REL2 }; #else char reltab0[] = { O_REL2-O_REL2, O_REL2-O_REL2, O_REL42-O_REL2, O_REL82-O_REL2, O_REL2-O_REL2, O_REL2-O_REL2, O_REL42-O_REL2, O_REL82-O_REL2, O_REL24-O_REL2, O_REL24-O_REL2, O_REL4-O_REL2, O_REL84-O_REL2, O_REL28-O_REL2, O_REL28-O_REL2, O_REL48-O_REL2, O_REL8-O_REL2 }; char reltab1[] = { O_REL2-O_REL2, O_REL2-O_REL2, O_REL2-O_REL2, O_REL82-O_REL2, O_REL2-O_REL2, O_REL2-O_REL2, O_REL2-O_REL2, O_REL82-O_REL2, O_REL2-O_REL2, O_REL2-O_REL2, O_REL2-O_REL2, O_REL82-O_REL2, O_REL28-O_REL2, O_REL28-O_REL2, O_REL28-O_REL2, O_REL8-O_REL2 }; char *reltab = reltab0; #endif #ifndef DEBUG char asgntab[] = { O_AS21-O_AS2, O_AS21-O_AS2, O_AS41-O_AS2, -1, O_AS2-O_AS2, O_AS2-O_AS2, O_AS42-O_AS2, -1, O_AS24-O_AS2, O_AS24-O_AS2, O_AS4-O_AS2, -1, O_AS28-O_AS2, O_AS28-O_AS2, O_AS48-O_AS2, O_AS8-O_AS2, }; #else char asgntb0[] = { O_AS21-O_AS2, O_AS21-O_AS2, O_AS41-O_AS2, -1, O_AS2-O_AS2, O_AS2-O_AS2, O_AS42-O_AS2, -1, O_AS24-O_AS2, O_AS24-O_AS2, O_AS4-O_AS2, -1, O_AS28-O_AS2, O_AS28-O_AS2, O_AS48-O_AS2, O_AS8-O_AS2, }; char asgntb1[] = { O_AS21-O_AS2, O_AS21-O_AS2, O_AS21-O_AS2, -1, O_AS2-O_AS2, O_AS2-O_AS2, O_AS2-O_AS2, -1, O_AS2-O_AS2, O_AS2-O_AS2, O_AS2-O_AS2, -1, O_AS28-O_AS2, O_AS28-O_AS2, O_AS28-O_AS2, O_AS4-O_AS2, }; char *asgntab = asgntb0; #endif #ifdef DEBUG genmx() { arret = arret1; artab = artab1; reltab = reltab1; asgntab = asgntb1; } #endif /* * Gen generates code for assignments, * and arithmetic and string operations * and comparisons. */ struct nl * gen(p, o, w1, w2) int p, o, w1, w2; { register i, j; int op, off; switch (p) { case O_AS2: case NIL: i = j = -1; /* * Take the log2 of the widths * and linearize them for indexing. * width for indexing. */ #ifdef DEBUG if (hp21mx) { if (w1 == 4) w1 = 8; if (w2 == 4) w2 = 8; } #endif do i++; while (w1 >>= 1); do j++; while (w2 >>= 1); i <<= 2; i |= j; if (p == O_AS2) { put(1, O_AS2 + asgntab[i]); return (NIL); } op = arop[o]; if (op == O_REL2) { put(1, (op + reltab[i]) | (o - T_EQ) << 8+INDX); return (nl+TBOOL); } put(1, i == 15 ? ar8op[o-T_DIVD] : op | artab[i]); return (op == O_DVD2 && !divchk ? nl+TDOUBLE : nl+arret[i]); case TREC: case TSTR: put(2, O_RELG | (o - T_EQ) << 8+INDX, w1); return (nl+TBOOL); case TSET: op = setop[o-T_MULT]; if (op == O_RELT) op |= (o - T_EQ)<<8+INDX; put(2, op, w1); return (o >= T_EQ ? nl+TBOOL : nl+TSET); default: panic("gen"); } } #endif OBJ if (op == O_REL2) { put(1, (op + reltab[i]) | (o - T_EQ) << 8+INDX); return (nl+TBOOL); } put(1, i == 15 ? ar8op[o-T_DIVD] : op | artab[i]); return (op == O_DVD2 && !divchk ? cmd/pc0/gram 644 0 33 761 2552606575 6131 "@(#)gram 1.3 8/27/80" /yyval/s//*&/ /\*yysterm\[]/,$d 1;/yyactr/ka 'a,$s/yypv/yyYpv/g 'aa register int **yyYpv; register int *p, *q; yyYpv = yypv; . 1;/^##/-w! y.tab.h /^int yylval 0/d /extern int yychar,/s//extern/ /yyclearin/d /yyerrok/d 1;/^##/d $a yyEactr(__np__, var) int __np__; char *var; { switch(__np__) { default: return (1); . g/case.*@@/s/@@//\ .m$ g/@@/ka\ 'a;?case?,?case?t$\ 'am$\ a\ }\ break; $a } } . 1,$s/@@// /int nterms/d /int nnonter/d /int nstate/d /int yyerrval/d w! q ,"cmd/pc0/hash.c 644 0 33 6751 2552606575 6374 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)hash.c 1.2 11/24/80"; #include "whoami.h" #include "0.h" #include "yy.h" /* * The definition for the segmented hash tables. */ struct ht { int *ht_low; int *ht_high; int ht_used; } htab[MAXHASH]; /* * This is the array of keywords and their * token values, which are hashed into the table * by inithash. */ struct kwtab yykey[] = { "and", YAND, "array", YARRAY, "assert", YASSERT, "begin", YBEGIN, "c((ase", YCASE, "const", YCONST, "div", YDIV, "do", YDO, "downto", YDOWNTO, "else", YELSE, "end", YEND, "file", YFILE, "for", YFOR, "forward", YFORWARD, "function", YFUNCTION, "goto", YGOTO, "if", YIF, "in", YIN, "label", YLABEL, "mod", YMOD, "nil", YNIL, "not", YNOT, "of", YOF, "or", YOR, "packed", YPACKED, "procedure", YPROCEDURE, "program", YPROG, "record", YRECORD, "repeat", YREPEAT, "set", YSET, "then", YTHEN, "to", YTO, "type", YTYPE, "until", YUNTIL, "var", YVAR, "while", YWHILE, "with", YWITH, "oct", YOCT, /* non-standard Pascal */ "hex", YHEX, /* non-standard Pascal */ "external", YEXTERN, /* non-standard Pascal */ 0 }; char *lastkey = &yykey[sizeof yykey/sizeof yykey[0]]; /* * Inithash initializes the hash table routines * by allocating the first hash table segment using * an already existing memory slot. */ #ifndef PI0 inithash() #else inithash(hshtab) int *hshtab; #endif { register int *ip; #ifndef PI0 static int hshtab[HASHINC]; #endif htab[0].ht_low = hshtab; htab[0].ht_high = &hshtab[HASHINC]; for (ip = yykey; *ip; ip += 2) hash(ip[0], 0)[0] = ip; } /* * Hash looks up the s(ymbol) argument * in the string table, entering it if * it is not found. If save is 0, then * the argument string is already in * a safe place. Otherwise, if hash is * entering the symbol for the first time * it will save the symbol in the string * table using savestr. */ int *hash(s, save) char *s; int save; { register int *h; register i; register char *cp; int *sym; struct ht *htp; int sh; /* * The hash function is a modular hash of * the sum of the characters with the sum * doubled before each successive character * is added. */ cp = s; if (cp == NIL) cp = token; /* default symbol to be hashed */ i = 0; while (*cp) i = i*2 + *cp++; sh = (i&077777) % HASHINC; cp = s; if (cp == NIL) cp = token; /* * There are as many as MAXHASH active * hash tables at any given point in time. * The search starts with the first table * and continues through the active tables * as necessary. */ for (htp = htab; htp < &htab[MAXHASH]; htp++) { if (htp->ht_low == NIL) { cp = (char *) calloc(sizeof ( int * ), HASHINC); if (cp == 0) { yerror("Ran out of memory (hash)"); pexit(DIED); } htp->ht_low = cp; htp->ht_high = htp->ht_low + HASHINC; cp = s; if (cp == NIL) cp = token; } h = htp->ht_low + sh; /* * quadratic rehash increment * starts at 1 and incremented * by two each rehash. */ i = 1; do { if (*h == 0) { if (htp->ht_used > (HASHINC * 3)/4) break; htp->ht_used++; if (save != 0) { *h = (int) savestr(cp); } else *h = s; return (h); } sym = *h; if (sym < lastkey && sym >= yykey) sym = *sym; if (sym->pchar == *cp && strcmp(sym, cp) == 0) return (h); h += i; i += 2; if (h >= htp->ht_high) h -= HASHINC; } while (i < HASHINC); } yerror("Ran out of hash tables"); pexit(DIED); } d * by two each rehacmd/pc0/iorec.h 644 0 33 1315 2552606575 6546 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)iorec.h 1.1 8/27/80"; */ #include #define NAMSIZ 76 struct iorec { char *fileptr; /* ptr to file window */ long lcount; /* number of lines printed */ long llimit; /* maximum number of text lines */ FILE *fbuf; /* FILE ptr */ struct iorec *fchain; /* chain to next file */ long *flev; /* ptr to associated file variable */ char *pfname; /* ptr to name of file */ long funit; /* file status flags */ long size; /* size of elements in the file */ char fname[NAMSIZ]; /* name of associated UNIX file */ char buf[BUFSIZ]; /* I/O buffer */ char window[1]; /* file window element */ }; le window */ long lcount; /* number of lines printed */ long llimit; /* maximum number of text lines */ FILE *fbuf; /* FILE ptr */ struct iorec *fchain; /* chain to next file */ long *flev; /* ptr to associated file variable */ char *pfname; /* ptr to name of file */ long funit; /* file scmd/pc0/lab.c 644 0 33 7731 2552606575 6206 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)lab.c 1.9 6/1/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "opcode.h" #include "objfmt.h" #ifdef PC # include "pc.h" # include "pcops.h" #endif PC /* * Label enters the definitions * of the label declaration part * into the namelist. */ label(r, l) int *r, l; { #ifdef PC char extname[ BUFSIZ ]; #endif PC #ifndef PI0 register *ll; register struct nl *p, *lp; lp = NIL; #else send(REVLAB, r); #endif if ( ! progseen ) { level1(); } line = l; #ifndef PI1 if (parts[ cbn ] & (CPRT|TPRT|VPRT|RPRT)){ if ( opt( 's' ) ) { standard(); } else { warning(); } error("Label declarations should precede const, type, var and routine declarations"); } if (parts[ cbn ] & LPRT) { if ( opt( 's' ) ) { standard(); } else { warning(); } error("All labels should be declared in one label part"); } parts[ cbn ] |= LPRT; #endif #ifndef PI0 for (ll = r; ll != NIL; ll = ll[2]) { l = getlab(); p = enter(defnl(ll[1], LABEL, 0, l)); /* * Get the label for the eventual target */ p->value[1] = getlab(); p->chain = lp; p->nl_flags |= (NFORWD|NMOD); p->value[NL_GOLEV] = NOTYET; p->entloc = l; lp = p; # ifdef OBJ /* * This operator is between * the bodies of two procedures * and provides a target for * gotos for this label via TRA. */ putlab(l); /* put(2, O_GOTO | cbn<<8+INDX, (long)p->value[1]); */ put(2, O_GOTO | cbn<<8, (long)p->value[1]); # endif OBJ # ifdef PC /* * labels have to be .globl otherwise /lib/c2 may * throw them away if they aren't used in the function * which defines them. */ sextname( extname , p -> symbol , cbn ); putprintf( " .globl %s" , 0 , extname ); if ( cbn == 1 ) { stabglabel( extname , line ); } # endif PC } gotos[cbn] = lp; # ifdef PTREE { pPointer Labels = LabelDCopy( r ); pDEF( PorFHeader[ nesting ] ).PorFLabels = Labels; } # endif PTREE #endif } #ifndef PI0 /* * Gotoop is called when * we get a statement "goto label" * and generates the needed tra. */ gotoop(s) char *s; { register struct nl *p; #ifdef PC char extname[ BUFSIZ ]; #endif PC gocnt++; p = lookup(s); if (p == NIL) return (NIL); # ifdef OBJ put(2, O_TRA4, (long)p->entloc); # endif OBJ # ifdef PC if ( cbn != bn ) { /* * call goto to unwind the stack to the destination level */ putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_GOTO" ); putLV( DISPLAYNAME , 0 , bn * sizeof( struct dispsave ) , NGLOBAL , P2PTR | P2INT ); putop( P2CALL , P2INT ); putdot( filename , line ); } sextname( extname , p -> symbol , bn ); putprintf( " jbr %s" , 0 , extname ); # endif PC if (bn == cbn) if (p->nl_flags & NFORWD) { if (p->value[NL_GOLEV] == NOTYET) { p->value[NL_GOLEV] = level; p->value[NL_GOLINE] = line; } } else if (p->value[NL_GOLEV] == DEAD) { recovered(); error("Goto %s is into a structured statement", p->symbol); } } /* * Labeled is called when a label * definition is encountered, and * marks that it has been found and * patches the associated GOTO generated * by gotoop. */ labeled(s) char *s; { register struct nl *p; #ifdef PC char extname[ BUFSIZ ]; #endif PC p = lookup(s); if (p == NIL) return (NIL); if (bn != cbn) { error("Label %s not defined in correct block", s); return; } if ((p->nl_flags & NFORWD) == 0) { error("Label %s redefined", s); return; } p->nl_flags &= ~NFORWD; # ifdef OBJ patch4(p->entloc); # endif OBJ # ifdef PC sextname( extname , p -> symbol , bn ); putprintf( "%s:" , 0 , extname ); # endif PC if (p->value[NL_GOLEV] != NOTYET) if (p->value[NL_GOLEV] < level) { recovered(); error("Goto %s from line %d is into a structured statement", s, p->value[NL_GOLINE]); } p->value[NL_GOLEV] = level; } #endif orrect block", s); return; } if ((pcmd/pc0/lookup.c 644 0 33 3774 2552606576 6765 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)lookup.c 1.1 8/27/80"; #include "whoami.h" #include "0.h" /* * Lookup is called to * find a symbol in the * block structure symbol * table and returns a pointer to * its namelist entry. */ struct nl * lookup(s) register char *s; { register struct nl *p; register struct udinfo *udp; if (s == NIL) { nocascade(); return (NIL); } p = lookup1(s); if (p == NIL) { derror("%s is undefined", s); retu((rn (NIL); } if (p->class == FVAR) { p = p->chain; bn--; } return (p); } #ifndef PI0 int flagwas; #endif /* * Lookup1 is an internal lookup. * It is not an error to call lookup1 * if the symbol is not defined. Also * lookup1 will return FVARs while * lookup never will, thus asgnop * calls it when it thinks you are * assigning to the function variable. */ struct nl * lookup1(s) register char *s; { register struct nl *p; #ifndef PI0 register struct nl *q; #endif register int i; if (s == NIL) return (NIL); bn = cbn; #ifndef PI0 /* * We first check the field names * of the currently active with * statements (expensive since they * are not hashed). */ for (p = withlist; p != NIL; p = p->nl_next) { q = p->type; if (q == NIL) continue; if (reclook(q, s) != NIL) /* * Return the WITHPTR, lvalue understands. */ return (p); } #endif /* * Symbol table is a 64 way hash * on the low bits of the character * pointer value. (Simple, but effective) */ i = (int) s & 077; for (p = disptab[i]; p != NIL; p = p->nl_next) if (p->symbol == s && p->class != FIELD && p->class != BADUSE) { bn = (p->nl_block & 037); #ifndef PI0 flagwas = p->nl_flags; p->nl_flags |= NUSED; #endif return (p); } return (NIL); } #ifndef PI01 nlfund(sp) char *sp; { register struct nl *p; register int i; i = (int) sp & 077; for (p = disptab[i]; p != NIL; p = p->nl_next) if (p->symbol == sp && (p->nl_block & 037) == 0) return (nloff(p)); return (0); } #endif i =cmd/pc0/lval.c 644 0 33 21275 2552606576 6426 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)lval.c 1.8 6/15/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "opcode.h" #include "objfmt.h" #ifdef PC # include "pc.h" # include "pcops.h" #endif PC extern int flagwas; /* * Lvalue computes the address * of a qualified name and * leaves it on the stack. * for pc, it can be asked for either an lvalue or an rvalue. * the semantics are the same, only the code is different. */ struct nl * lvalue(r, modflag , required ) int *r, modflag; int required; { register struct nl *p; struct nl *firstp, *lastp; register *c, *co; int f, o; /* * Note that the local optimizations * done here for offsets would more * appropriately be done in put. */ int tr[2], trp[3]; if (r == NIL) { return (NIL); } if (nowexp(r)) { return (NIL); } if (r[0] != T_VAR) { error("Variable required"); /* Pass mesgs down from pt of call ? */ return (NIL); } # ifdef PC /* * pc requires a whole different control flow */ return pclvalue( r , modflag , required ); # endif PC # ifdef OBJ /* * pi uses the rest of the function */ firstp = p = lookup(r[2]); if (p == NIL) { return (NIL); } c = r[3]; if ((modflag & NOUSE) && !lptr(c)) { p->nl_flags = flagwas; } if (modflag & MOD) { p->nl_flags |= NMOD; } /* * Only possibilities for p->class here * are the named classes, i.e. CONST, TYPE * VAR, PROC, FUNC, REF, or a WITHPTR. */ switch (p->class) { case WITHPTR: /* * Construct the tree implied by * the with statement */ trp[0] = T_LISTPP; trp[1] = tr; trp[2] = r[3]; tr[0] = T_FIELD; tr[1] = r[2]; c = trp; # ifdef PTREE /* * mung r[4] to say which field this T_VAR is * for VarCopy */ r[4] = reclook( p -> type , r[2] ); # endif /* and fall through */ case REF: /* * Obtain the indirect word * of the WITHPTR or REF * as the base of our lvalue */ put(2, PTR_RV | bn << 8+INDX , (int)p->value[0] ); f = 0; /* have an lv on stack */ o = 0; break; case VAR: f = 1; /* no lv on stack yet */ o = p->value[0]; break; default: error("%s %s found where variable required", classes[p->class], p->symbol); return (NIL); } /* * Loop and handle each * qualification on the name */ if (c == NIL && (modflag&ASGN) && ( p->value[NL_FORV] & FORVAR ) ) { error("Can't modify the for variable %s in the range of the loop", p->symbol); return (NIL); } for (; c != NIL; c = c[2]) { co = c[1]; if (co == NIL) { return (NIL); } lastp = p; p = p->type; if (p == NIL) { return (NIL); } switch (co[0]) { case T_PTR: /* * Pointer qualification. */ lastp->nl_flags |= NUSED; if (p->class != PTR && p->class != FILET) { error("^ allowed only on files and pointers, not on %ss", nameof(p)); goto bad; } if (f) { if (p->class == FILET && bn != 0) put(2, O_LV | bn <<8+INDX , o ); else /* * this is the indirection from * the address of the pointer * to the pointer itself. * kirk sez: * fnil doesn't want this. * and does it itself for files * since only it knows where the * actual window is. * but i have to do this for * regular pointers. * This is further complicated by * the fact that global variables * are referenced through pointers * on the stack. Thus an RV on a * global variable is the same as * an LV of a non-global one ?!? */ put(2, PTR_RV | bn <<8+INDX , o ); } else { if (o) { put(2, O_OFF, o); } if (p->class != FILET || bn == 0) put(1, PTR_IND); } /* * Pointer cannot be * nil and file cannot * be at end-of-file. */ put(1, p->class == FILET ? O_FNIL : O_NIL); f = o = 0; continue; case T_ARGL: if (p->class != ARRAY) { if (lastp == firstp) { error("%s is a %s, not a function", r[2], classes[firstp->class]); } else { error("Illegal function qualificiation"); } return (NIL); } recovered(); error("Pascal uses [] for subscripting, not ()"); case T_ARY: if (p->class != ARRAY) { error("Subscripting allowed only on arrays, not on %ss", nameof(p)); goto bad; } if (f) { if (bn == 0) /* * global variables are * referenced through pointers * on the stack */ put(2, PTR_RV | bn<<8+INDX, o); else put(2, O_LV | bn<<8+INDX, o); } else { if (o) { put(2, O_OFF, o); } } switch (arycod(p, co[1])) { case 0: return (NIL); case -1: goto bad; } f = o = 0; continue; case T_FIELD: /* * Field names are just * an offset with some * semantic checking. */ if (p->class != RECORD) { error(". allowed only on records, not on %ss", nameof(p)); goto bad; } if (co[1] == NIL) { return (NIL); } p = reclook(p, co[1]); if (p == NIL) { error("%s is not a field in this record", co[1]); goto bad; } # ifdef PTREE /* * mung co[3] to indicate which field * this is for SelCopy */ co[3] = p; # endif if (modflag & MOD) { p->nl_flags |= NMOD; } if ((modflag & NOUSE) == 0 || lptr(c[2])) { p->nl_flags |= NUSED; } o += p->value[0]; continue; default: panic("lval2"); } } if (f) { if (bn == 0) /* * global variables are referenced through * pointers on the stack */ put(2, PTR_RV | bn<<8+INDX, o); else put(2, O_LV | bn<<8+INDX, o); } else { if (o) { put(2, O_OFF, o); } } return (p->type); bad: cerror("Error occurred on qualification of %s", r[2]); return (NIL); # endif OBJ } lptr(c) register int *c; { register int *co; for (; c != NIL; c = c[2]) { co = c[1]; if (co == NIL) { return (NIL); } switch (co[0]) { case T_PTR: return (1); case T_ARGL: return (0); case T_ARY: case T_FIELD: continue; default: panic("lptr"); } } return (0); } /* * Arycod does the * code generation * for subscripting. */ arycod(np, el) struct nl *np; int *el; { register struct nl *p, *ap; long sub; bool constsub; int i, d, v, v1; int w; p = np; if (el == NIL) { return (0); } d = p->value[0]; /* * Check each subscript */ for (i = 1; i <= d; i++) { if (el == NIL) { error("Too few subscripts (%d given, %d required)", i-1, d); return (-1); } p = p->chain; if (constsub = constval(el[1])) { ap = con.ctype; sub = con.crval; if (sub < p->range[0] || sub > p->range[1]) { error("Subscript value of %D is out of range", sub); return (0); } sub -= p->range[0]; } else { # ifdef PC precheck( p , "_SUBSC" , "_SUBSCZ" ); # endif PC ap = rvalue(el[1], NLNIL , RREQ ); if (ap == NIL) { return (0); } # ifdef PC postcheck( p ); # endif PC } if (incompat(ap, p->type, el[1])) { cerror("Array index type incompatible with declared index type"); if (d != 1) { cerror("Error occurred on index number %d", i); } return (-1); } w = aryconst(np, i); # ifdef OBJ if (constsub) { sub *= w; if (sub != 0) { w = width(ap); put(2, w <= 2 ? O_CON2 : O_CON4, sub); gen(NIL, T_ADD, sizeof(char *), w); } el = el[2]; continue; } if (opt('t') == 0) { switch (w) { case 8: w = 6; case 4: case 2: case 1: put(2, (width(ap) != 4 ? O_INX2P2 : O_INX4P2) | (w & ~1) << 7, ( short ) p->range[0]); el = el[2]; continue; } } put(4, width(ap) != 4 ? O_INX2 : O_INX4, w, (short)p->range[0], (short)(p->range[1])); el = el[2]; continue; # endif OBJ # ifdef PC /* * subtract off the lower bound */ if (constsub) { sub *= w; if (sub != 0) { putleaf( P2ICON , sub , 0 , P2IN((T , 0 ); putop(P2PLUS, ADDTYPE(p2type(np->type), P2PTR)); } el = el[2]; continue; } if ( p -> range[ 0 ] != 0 ) { putleaf( P2ICON , p -> range[0] , 0 , P2INT , 0 ); putop( P2MINUS , P2INT ); } /* * multiply by the width of the elements */ if ( w != 1 ) { putleaf( P2ICON , w , 0 , P2INT , 0 ); putop( P2MUL , P2INT ); } /* * and add it to the base address */ putop( P2PLUS , ADDTYPE( p2type( np -> type ) , P2PTR ) ); # endif PC el = el[2]; } if (el != NIL) { do { el = el[2]; i++; } while (el != NIL); error("Too many subscripts (%d given, %d required)", i-1, d); return (-1); } return (1); } , 0 ); putop( P2MINUS , P2INT ); } /* * multiply by the width of the elements */ if ( w != 1 ) { putleaf( P2ICON , w , 0 , P2INT , 0 ); putop( P2MUL , P2INT ); } /* * and add it to the base address */ putop( P2PLUS , ADDTYPE( p2type( np -> type ) , P2PTR ) ); # endifcmd/pc0/main.c 644 0 33 17454 2552606576 6420 /* Copyright (c) 1979 Regents of the University of California */ static char copyright[] = "@(#)Copyright (c) 1979 Regents of the University of California"; static char sccsid[] = "@(#)main.c 1.4 3/9/81"; #include "whoami.h" #include "0.h" #include "yy.h" #include #include "objfmt.h" /* * This version of pi has been in use at Berkeley since May 1977 * and is very stable. Please report any problems with the error * recovery to the second author at the address given in the file * READ_ME. The second author takes full responsibility for any bugs * in the syntactic error recovery. */ char piusage[] = "pi [ -blnpstuw ] [ -i file ... ] name.p"; char pixusage[] = "pix [ -blnpstuw ] [ -i file ... ] name.p [ arg ... ]"; char pcusage[] = "pc [ options ] [ -o file ] [ -i file ... ] name.p"; char *usageis = piusage; char *errfile = ERR_STRNGS; #ifdef OBJ char *obj = "obj"; #endif OBJ #ifdef PC char *pcname = "pc.pc1"; #endif PC #ifdef PTREE char *pTreeName = "pi.pTree"; #endif PTREE /* * Be careful changing errfile and howfile. * There are the "magic" constants 9 and 15 immediately below. * errfile is now defined by ERR_STRNGS, in objfmt.h, * and its leading path name length is ERR_PATHLEN long. * this for executing out of the current directory if running as `a.something'. */ #ifdef OBJ char *howfile = HOW_STRNGS; #endif OBJ #ifdef PC char *howfile = HOW_STRNGS; #endif PC int onintr(); extern char *lastname; FILE *ibuf; FILE *pcstream = NULL; /* * these are made real variables * so they can be changed * if you are compiling on a smaller machine */ double MAXINT = 2147483647.; double MININT = -2147483648.; /* * Main program for pi. * Process options, then call yymain * to do all the real work. */ main(argc, argv) int argc; char *argv[]; { register char *cp; register c; int i; if (argv[0][0] == 'a') errfile += ERR_PATHLEN , howfile += HOW_PATHLEN; # ifdef OBJ if (argv[0][0] == '-' && argv[0][1] == 'o') { obj = &argv[0][2]; usageis = pixusage; howfile[HOW_PATHLEN+6] = 'x'; ofil = 3; } else { ofil = creat(obj, 0755); if (ofil < 0) { perror(obj); pexit(NOSTART); } } # endif OBJ argv++, argc--; if (argc == 0) { i = fork(); if (i == -1) goto usage; if (i == 0) { execl("/bin/cat", "cat", howfile, 0); goto usage; } while (wait(&i) != -1) continue; pexit(NOSTART); } # ifdef OBJ opt('p') = opt('t') = opt('b') = 1; while (argc > 0) { cp = argv[0]; if (*cp++ != '-') break; while (c = *cp++) switch (c) { #ifdef DEBUG case 'k': case 'r': case 'y': togopt(c); continue; case 'K': yycosts(); pexit(NOSTART); case 'A': testtrace = TRUE; case 'F': fulltrace = TRUE; case 'E': errtrace = TRUE; opt('r')++; continue; case 'U': yyunique = 0; continue; #endif case 'b': opt('b') = 2; continue; case 'i': pflist = argv + 1; pflstc = 0; while (argc > 1) { if (dotted(argv[1], 'p')) break; pflstc++, argc--, argv++; } if (pflstc == 0) goto usage; continue; case 'l': case 'n': case 'p': case 's': case 't': case 'u': case 'w': togopt(c); continue; case 'z': monflg = TRUE; continue; default: usage: Perror( "Usage", usageis); pexit(NOSTART); } argc--, argv++; } # endif OBJ # ifdef PC opt( 'b' ) = 1; opt( 'g' ) = 0; opt( 't' ) = 0; opt( 'p' ) = 0; usageis = pcusage; while ( argc > 0 ) { cp = argv[0]; if ( *cp++ != '-' ) { break; } c = *cp++; switch( c ) { #ifdef DEBUG case 'k': case 'r': case 'y': togopt(c); break; case 'K': yycosts(); pexit(NOSTART); case 'A': testtrace = TRUE; /* and fall through */ case 'F': fulltrace = TRUE; /* and fall through */ case 'E': errtrace = TRUE; opt('r')++; break; case 'U': yyunique = 0; break; #endif case 'b': opt('b') = 2; break; case 'i': pflist = argv + 1; pflstc = 0; while (argc > 1) { if (dotted(argv[1], 'p')) break; pflstc++, argc--, argv++; } if (pflstc == 0) goto usage; break; /* * output file for the first pass */ case 'o': if ( argc < 2 ) { goto usage; } argv++; argc--; pcname = argv[0]; break; case 'C': /* * since -t is an ld switch, use -C * to turn on tests */ togopt( 't' ); break; case 'g': /* * sdb symbol table */ togopt( 'g' ); break; case 'l': case 's': case 'u': case 'w': togopt(c); break; case 'p': /* * -p on the command line means profile */ profflag = TRUE; break; case 'z': monflg = TRUE; break; default: usage: Perror( "Usage", usageis); pexit(NOSTART); } argc--; argv++; } # endif PC if (argc != 1) goto usage; efil = open ( errfile, 0 ); if ( efil < 0 ) perror(errfile), pexit(NOSTART); filename = argv[0]; if (!dotted(filename, 'p')) { Perror(filename, "Name must end in '.p'"); pexit(NOSTART); } close(0); if ( ( ibuf = fopen( filename , "r" ) ) == NULL ) perror(filename), pexit(NOSTART); ibp = ibuf; # ifdef PC if ( ( pcstream = fopen( pcname , "w" ) ) == NULL ) { perror( pcname ); pexit( NOSTART ); } stabsource( filename ); # endif PC # ifdef PTREE # define MAXpPAGES 16 if ( ! pCreate( pTreeName , MAXpPAGES ) ) { perror( pTreeName ); pexit( NOSTART ); } # endif PTREE if ( signal( SIGINT , SIG_IGN ) != SIG_IGN ) signal( SIGINT , onintr ); if (opt('l')) { opt('n')++; yysetfile(filename); opt('n')--; } yymain(); /* No return */ } pchr(c) char c; { putc ( c , stdout ); } char ugh[] = "Fatal error in pi\n"; /* * Exit from the Pascal system. * We throw in an ungraceful termination * message if c > 1 indicating a severe * error such as running out of memory * or an internal inconsistency. */ pexit(c) int c; { if (opt('l') && c != DIED && c != NOSTART) while (getline() != -1) continue; yyflush(); switch (c) { case DIED: write(2, ugh, sizeof ugh); case NOSTART: case ERRS: # ifdef OBJ if (ofil > 0) unlink(obj); # endif OBJ # ifdef PC if ( pcstream != NULL ) { unlink( pcname ); } # endif PC break; case AOK: # ifdef OBJ pflush(); # endif OBJ # ifdef PC puteof(); # endif PC break; } /* * this to gather statistics on programs being compiled * taken 20 june 79 ... peter * * if (fork() == 0) { * char *cp = "-0"; * cp[1] += c; * execl("/usr/lib/gather", "gather", cp, filename, 0); * exit(1); * } */ # ifdef PTREE pFinish(); # endif exit(c); } onintr() { signal( SIGINT , SIG_IGN ); pexit(NOSTART); } /* * Get an error message from the error message file */ geterr(seekpt, buf) int seekpt; char *buf; { lseek(efil, (long) seekpt, 0); if (read(efil, buf, 256) <= 0) perror(errfile), pexit(DIED); } header() { extern char version[]; static char anyheaders; gettime( filename ); if (anyheaders && opt('n')) putc( '\f' , stdout ); anyheaders++; # ifdef OBJ printf("Berkeley Pascal PI -- Version 2.0 (%s)\n\n%s %s\n\n", version, myctime(&tvec), filename); # endif OBJ # ifdef PC printf("Berkeley Pascal PC -- Version 2.0 (%s)\n\n%s %s\n\n", version, myctime(&tvec), filename); # endif PC } efil, (long) seekpt, 0); if (read(efil, buf, 256) <= 0) perror(errfile), pexit(DIED); } header() { extern char version[]; static char anyheaders; gettime( filename ); if (anyheaders && opt('n')) putc( cmd/pc0/makefile 644 0 33 16252 2552606576 7023 ((SCCSID = "@(#)pcmakefile 1.18 4/1/81" WHOAMI = pc INSTALLNAME = $(DESTDIR)/usr/lib/pc0 VERSION = 2.0 MKSTR = /usr/ucb/mkstr EYACC = /usr/ucb/eyacc RM = -rm -f GET = touch CFLAGS = -O -w LDFLAGS = -z LIBDIR = ${DESTDIR}/usr/lib TMPDIR = tmp ERRORSTRINGS = ${WHOAMI}${VERSION}strings SRCS = ato.c \ call.c case.c clas.c const.c conv.c cset.c \ error.c fdec.c fend.c fhdr.c flvalue.c forop.c func.c gen.c hash.c \ lab.c lookup.c lval.c stklval.c \ main.c nl.c proc.c put.c \ rec.c rval.c stkrval.c\ stat.c string.c subr.c \ tmps.c tree.c type.c var.c \ TRdata.c \ treen.c yycopy.c \ yycosts.c yyerror.c yyget.c yyid.c yylex.c yymain.c yyoptions.c \ yypanic.c yyparse.c yyprint.c yyput.c yyrecover.c yyseman.c yytree.c \ p2put.c stab.c pcproc.c pcfunc.c pccaseop.c pclval.c HDRS = 0.h OPnames.h align.h iorec.h objfmt.h pstab.h pc.h pcops.h \ send.h tree.h whoami.h yy.h OTHERS = pas.y opc.c version.c gram pic.c OBJS = ato.o \ call.o case.o clas.o const.o conv.o cset.o \ error.o fdec.o fend.o fhdr.o flvalue.o forop.o func.o gen.o hash.o \ lab.o lookup.o lval.o stklval.o \ main.o nl.o proc.o put.o \ rec.o rval.o stkrval.o\ stat.o string.o subr.o \ tmps.o tree.o type.o var.o \ TRdata.o \ treen.o yycopy.o \ y.tab.o \ yycosts.o yyerror.o yyget.o yyid.o yylex.o yymain.o yyoptions.o \ yypanic.o yyparse.o yyprint.o yyput.o yyrecover.o yyseman.o yytree.o \ p2put.o stab.o pcproc.o pcfunc.o pccaseop.o pclval.o a.out: ${OBJS} version ${RM} Version.[oc] ./version > Version.c ${CC} ${CFLAGS} ${LDFLAGS} ${OBJS} Version.c sources: ${SRCS} ${HDRS} ${OTHERS} ${SRCS} ${HDRS} ${OTHERS}: ${GET} $@ .c.o: ${RM} ${TMPDIR}/$*.c ${MKSTR} - ${ERRORSTRINGS} ${TMPDIR}/ $*.c cd ${TMPDIR}; ${CC} ${CFLAGS} -I.. -c $*.c;\ rm -f ../$*.o; mv $*.o ../$*.o ${RM} ${TMPDIR}/$*.c y.tab.h: pas.y gram ${RM} y.tab.h y.tab.c ${EYACC} pas.y > /dev/null ex - y.tab.c opcode.h ${RM} opc pTree.h: echo "/* this is not pTree.h */" > pTree.h version: version.c ${CC} version.c -o version clean: ${RM} *.o ${TMPDIR}/*.c ${RM} y.tab.h y.tab.c y.tab.out ${RM} ${ERRORSTRINGS} ${RM} version Version.c ${RM} a.out core *.list *.bak ${RM} opc pic tags print: sources @pr makefile READ_ME @ls -ls | pr @cc -o pic pic.c @pic | pr @rm pic @pr 0.h whoami.h main.c pas.y @pr OPnames.h opcode.h tree.h @pr pc.h @pr [a-ln-x]*.c @pr yy.h yy*.c install: a.out cp ${ERRORSTRINGS} ${LIBDIR}/${ERRORSTRINGS} cp a.out ${INSTALLNAME} depend: sources /bin/grep '^#[ ]*include' *.h \ | sed '/<.*>/d' \ | sed 's/\(.*\):[^"]*"\([^"]*\)".*/\1: \2/' >makedep /bin/grep '^#[ ]*include' *.c \ | sed '/<.*>/d' \ | sed 's/:[^"]*"\([^"]*\)".*/: \1/' \ | sed 's/\.c/.o/' >>makedep 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 # DO NOT DELETE THIS LINE -- make depend uses it 0.h: pTree.h yy.h: y.tab.h TRdata.o: whoami.h TRdata.o: 0.h ato.o: whoami.h ato.o: 0.h call.o: whoami.h call.o: 0.h call.o: tree.h call.o: opcode.h call.o: objfmt.h call.o: pc.h call.o: pcops.h case.o: whoami.h case.o: 0.h case.o: tree.h case.o: opcode.h clas.o: whoami.h clas.o: 0.h clas.o: tree.h const.o: whoami.h const.o: 0.h const.o: tree.h conv.o: whoami.h conv.o: 0.h conv.o: opcode.h conv.o: pcops.h cset.o: whoami.h cset.o: 0.h cset.o: tree.h cset.o: opcode.h cset.o: objfmt.h cset.o: pc.h cset.o: pcops.h error.o: whoami.h error.o: 0.h error.o: yy.h fdec.o: whoami.h fdec.o: 0.h fdec.o: tree.h fdec.o: opcode.h fdec.o: objfmt.h fdec.o: align.h fdec.o: pc.h fdec.o: pcops.h fend.o: whoami.h fend.o: 0.h fend.o: tree.h fend.o: opcode.h fend.o: objfmt.h fend.o: align.h fend.o: pc.h fend.o: pcops.h fhdr.o: whoami.h fhdr.o: 0.h fhdr.o: tree.h fhdr.o: opcode.h fhdr.o: objfmt.h fhdr.o: align.h fhdr.o: pc.h fhdr.o: pcops.h flvalue.o: whoami.h flvalue.o: 0.h flvalue.o: tree.h flvalue.o: opcode.h flvalue.o: objfmt.h flvalue.o: pc.h flvalue.o: pcops.h forop.o: whoami.h forop.o: 0.h forop.o: opcode.h forop.o: tree.h forop.o: objfmt.h forop.o: pc.h forop.o: pcops.h func.o: whoami.h func.o: 0.h func.o: tree.h func.o: opcode.h gen.o: whoami.h gen.o: 0.h gen.o: tree.h gen.o: opcode.h gen.o: objfmt.h hash.o: whoami.h hash.o: 0.h hash.o: yy.h lab.o: whoami.h lab.o: 0.h lab.o: tree.h lab.o: opcode.h lab.o: objfmt.h lab.o: pc.h lab.o: pcops.h lookup.o: whoami.h lookup.o: 0.h lval.o: whoami.h lval.o: 0.h lval.o: tree.h lval.o: opcode.h lval.o: objfmt.h lval.o: pc.h lval.o: pcops.h main.o: whoami.h main.o: 0.h main.o: yy.h main.o: objfmt.h nl.o: whoami.h nl.o: 0.h nl.o: opcode.h nl.o: objfmt.h opc.o: OPnames.h p2put.o: whoami.h p2put.o: 0.h p2put.o: pcops.h p2put.o: pc.h pccaseop.o: whoami.h pccaseop.o: 0.h pccaseop.o: tree.h pccaseop.o: objfmt.h pccaseop.o: pcops.h pccaseop.o: pc.h pcfunc.o: whoami.h pcfunc.o: 0.h pcfunc.o: tree.h pcfunc.o: opcode.h pcfunc.o: pc.h pcfunc.o: pcops.h pclval.o: whoami.h pclval.o: 0.h pclval.o: tree.h pclval.o: opcode.h pclval.o: objfmt.h pclval.o: pc.h pclval.o: pcops.h pcproc.o: whoami.h pcproc.o: 0.h pcproc.o: tree.h pcproc.o: opcode.h pcproc.o: pc.h pcproc.o: pcops.h pic.o: OPnames.h proc.o: whoami.h proc.o: 0.h proc.o: tree.h proc.o: opcode.h proc.o: objfmt.h put.o: whoami.h put.o: opcode.h put.o: 0.h put.o: objfmt.h put.o: pc.h put.o: OPnames.h rec.o: whoami.h rec.o: 0.h rec.o: tree.h rec.o: opcode.h rval.o: whoami.h rval.o: 0.h rval.o: tree.h rval.o: opcode.h rval.o: objfmt.h rval.o: pc.h rval.o: pcops.h stab.o: whoami.h stab.o: 0.h stab.o: pstab.h stab.o: pc.h stat.o: whoami.h stat.o: 0.h stat.o: tree.h stat.o: objfmt.h stat.o: pcops.h stat.o: pc.h stat.o: opcode.h stklval.o: whoami.h stklval.o: 0.h stklval.o: tree.h stklval.o: opcode.h stklval.o: objfmt.h stkrval.o: whoami.h stkrval.o: 0.h stkrval.o: tree.h stkrval.o: opcode.h stkrval.o: objfmt.h stkrval.o: pcops.h string.o: whoami.h string.o: 0.h string.o: send.h subr.o: whoami.h subr.o: 0.h tmps.o: whoami.h tmps.o: 0.h tree.o: whoami.h tree.o: 0.h type.o: whoami.h type.o: 0.h type.o: tree.h type.o: objfmt.h var.o: whoami.h var.o: 0.h var.o: align.h var.o: iorec.h var.o: pc.h var.o: pcops.h y.tab.o: whoami.h y.tab.o: 0.h y.tab.o: yy.h y.tab.o: tree.h yycopy.o: 0.h yycopy.o: yy.h yycosts.o: whoami.h yycosts.o: 0.h yycosts.o: yy.h yyerror.o: whoami.h yyerror.o: 0.h yyerror.o: yy.h yyget.o: whoami.h yyget.o: 0.h yyget.o: yy.h yyid.o: whoami.h yyid.o: 0.h yyid.o: yy.h yylex.o: whoami.h yylex.o: 0.h yylex.o: yy.h yymain.o: whoami.h yymain.o: 0.h yymain.o: yy.h yymain.o: objfmt.h yyoptions.o: whoami.h yyoptions.o: 0.h yyoptions.o: yy.h yypanic.o: whoami.h yypanic.o: 0.h yypanic.o: yy.h yyparse.o: whoami.h yyparse.o: 0.h yyparse.o: yy.h yyprint.o: whoami.h yyprint.o: 0.h yyprint.o: yy.h yyput.o: whoami.h yyput.o: 0.h yyput.o: tree.h yyput.o: yy.h yyrecover.o: whoami.h yyrecover.o: 0.h yyrecover.o: yy.h yyseman.o: whoami.h yyseman.o: 0.h yyseman.o: yy.h yytree.o: whoami.h yytree.o: 0.h yytree.o: tree.h # DEPENDENCIES MUST END AT END OF FILE # IF YOU PUT STUFF HERE IT WILL GO AWAY # see make depend above h yyoptions.o: 0.h yyoptions.o: yy.h yypanic.o: whoami.h yypanic.o: 0.h yypanic.o: yy.h yyparse.o: whoami.h yyparse.o: 0.h yyparse.o: yy.h yyprint.o: whoami.h yyprint.o: 0.h yyprint.o: yy.h yyput.o: whoami.h yyput.o: 0.h yyput.o: tree.h yyput.o: yy.h yyrecover.o: whoami.h yyrecover.o: 0.h yyrecover.o: yy.h yyseman.o: whoami.h yyseman.o: 0.hcmd/pc0/nl.c 644 0 33 31363 2552606577 6101 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)nl.c 1.5 6/1/81"; #include "whoami.h" #include "0.h" #include "opcode.h" #include "objfmt.h" /* * NAMELIST SEGMENT DEFINITIONS */ struct nls { struct nl *nls_low; struct nl *nls_high; } ntab[MAXNL], *nlact; struct nl nl[INL]; struct nl *nlp = nl; struct nls *nlact = ntab; /* * all these strings must be places where people can find them * since lookup only looks at the string pointer, not the chars. * see, for example, pTreeInit. */ /* * built in constants */ char *in_consts[] = { "true" , "false" , "TRUE", "FALSE", "minint" , "maxint" , "minchar" , "maxchar" , "bell" , "tab" , 0 }; /* * built in simple types */ char *in_types[] = { "boolean", "char", "integer", "real", "_nil", /* dummy name */ 0 }; int in_rclasses[] = { TINT , TINT , TINT , TCHAR , TBOOL , TDOUBLE , 0 }; long in_ranges[] = { -128L , 128L , -32768L , 32767L , -2147483648L , 2147483647L , 0L , 127L , 0L , 1L , 0L , 0L /* fake for reals */ }; /* * built in constructed types */ char *in_ctypes[] = { "Boolean" , "intset" , "alfa" , "text" , 0 }; /* * built in variables */ char *in_vars[] = { "input" , "output" , 0 }; /* * built in functions */ char *in_funcs[] = { "abs" , "arctan" , "card" , "chr" , "clock" , "cos" , "eof" , "eoln" , "eos" , "exp" , "expo" , "ln" , "odd" , "ord" , "pred" , "round" , "sin" , "sqr" , "sqrt" , "succ" , "trunc" , "undefined" , /* * Extensions */ "argc" , "random" , "seed" , "wallclock" , "sysclock" , 0 }; /* * Built-in procedures */ char *in_procs[] = { "date" , "dispose" , "flush" , "get" , "getseg" , "halt" , "linelimit" , "message" , "new" , "pack" , "page" , "put" , "putseg" , "read" , "readln" , "re((move" , "reset" , "rewrite" , "time" , "unpack" , "write" , "writeln" , /* * Extensions */ "argv" , "null" , "stlimit" , 0 }; #ifndef PI0 /* * and their opcodes */ int in_fops[] = { O_ABS2, O_ATAN, O_CARD|NSTAND, O_CHR2, O_CLCK|NSTAND, O_COS, O_EOF, O_EOLN, 0, O_EXP, O_EXPO|NSTAND, O_LN, O_ODD2, O_ORD2, O_PRED2, O_ROUND, O_SIN, O_SQR2, O_SQRT, O_SUCC2, O_TRUNC, O_UNDEF|NSTAND, /* * Extensions */ O_ARGC|NSTAND, O_RANDOM|NSTAND, O_SEED|NSTAND, O_WCLCK|NSTAND, O_SCLCK|NSTAND }; /* * Built-in procedures */ int in_pops[] = { O_DATE|NSTAND, O_DISPOSE|NSTAND, O_FLUSH|NSTAND, O_GET, 0, O_HALT|NSTAND, O_LLIMIT|NSTAND, O_MESSAGE|NSTAND, O_NEW, O_PACK, O_PAGE, O_PUT, 0, O_READ4, O_READLN, O_REMOVE|NSTAND, O_RESET, O_REWRITE, O_TIME|NSTAND, O_UNPACK, O_WRITEF, O_WRITLN, /* * Extensions */ O_ARGV|NSTAND, O_ABORT|NSTAND, O_STLIM|NSTAND }; #endif /* * Initnl initializes the first namelist segment and then * initializes the name list for block 0. */ initnl() { register char **cp; register struct nl *np; struct nl *fp; int *ip; long *lp; #ifdef DEBUG if ( hp21mx ) { MININT = -32768.; MAXINT = 32767.; #ifndef PI0 genmx(); #endif } #endif ntab[0].nls_low = nl; ntab[0].nls_high = &nl[INL]; defnl ( 0 , 0 , 0 , 0 ); /* * Types */ for ( cp = in_types ; *cp != 0 ; cp ++ ) hdefnl ( *cp , TYPE , nlp , 0 ); /* * Ranges */ lp = in_ranges; for ( ip = in_rclasses ; *ip != 0 ; ip ++ ) { np = defnl ( 0 , RANGE , nl+(*ip) , 0 ); nl[*ip].type = np; np -> range[0] = *lp ++ ; np -> range[1] = *lp ++ ; }; /* * built in constructed types */ cp = in_ctypes; /* * Boolean = boolean; */ hdefnl ( *cp++ , TYPE , nl+T1BOOL , 0 ); /* * intset = set of 0 .. 127; */ intset = *cp++; hdefnl( intset , TYPE , nlp+1 , 0 ); defnl ( 0 , SET , nlp+1 , 0 ); np = defnl ( 0 , RANGE , nl+TINT , 0 ); np -> range[0] = 0L; np -> range[1] = 127L; /* * alfa = array [ 1 .. 10 ] of char; */ np = defnl ( 0 , RANGE , nl+TINT , 0 ); np -> range[0] = 1L; np -> range[1] = 10L; defnl ( 0 , ARRAY , nl+T1CHAR , 1 ) -> chain = np; hdefnl ( *cp++ , TYPE , nlp-1 , 0 ); /* * text = file of char; */ hdefnl ( *cp++ , TYPE , nlp+1 , 0 ); np = defnl ( 0 , FILET , nl+T1CHAR , 0 ); np -> nl_flags |= NFILES; /* * input,output : text; */ cp = in_vars; # ifndef PI0 input = hdefnl ( *cp++ , VAR , np , INPUT_OFF ); output = hdefnl ( *cp++ , VAR , np , OUTPUT_OFF ); # else input = hdefnl ( *cp++ , VAR , np , 0 ); output = hdefnl ( *cp++ , VAR , np , 0 ); # endif # ifdef PC input -> extra_flags |= NGLOBAL; output -> extra_flags |= NGLOBAL; # endif PC /* * built in constants */ cp = in_consts; np = hdefnl ( *cp++ , CONST , nl + TBOOL , 1 ); fp = hdefnl ( *cp++ , CONST , nl + TBOOL , 0 ); (nl + TBOOL)->chain = fp; fp->chain = np; np = hdefnl ( *cp++ , CONST , nl + TBOOL , 1 ); fp = hdefnl ( *cp++ , CONST , nl + TBOOL , 0 ); fp->chain = np; if (opt('s')) (nl + TBOOL)->chain = fp; hdefnl ( *cp++ , CONST , nl + T4INT , 0 ) -> range[0] = MININT; hdefnl ( *cp++ , CONST , nl + T4INT , 0 ) -> range[0] = MAXINT; hdefnl ( *cp++ , CONST , nl + T1CHAR , 0 ); hdefnl ( *cp++ , CONST , nl + T1CHAR , 127 ); hdefnl ( *cp++ , CONST , nl + T1CHAR , '\007' ); hdefnl ( *cp++ , CONST , nl + T1CHAR , '\t' ); /* * Built-in functions and procedures */ #ifndef PI0 ip = in_fops; for ( cp = in_funcs ; *cp != 0 ; cp ++ ) hdefnl ( *cp , FUNC , 0 , * ip ++ ); ip = in_pops; for ( cp = in_procs ; *cp != 0 ; cp ++ ) hdefnl ( *cp , PROC , 0 , * ip ++ ); #else for ( cp = in_funcs ; *cp != 0 ; cp ++ ) hdefnl ( *cp , FUNC , 0 , 0 ); for ( cp = in_procs ; *cp != 0 , cp ++ ) hdefnl ( *cp , PROC , 0 , 0 ); #endif # ifdef PTREE pTreeInit(); # endif } struct nl * hdefnl(sym, cls, typ, val) { register struct nl *p; #ifndef PI1 if (sym) hash(sym, 0); #endif p = defnl(sym, cls, typ, val); if (sym) enter(p); return (p); } /* * Free up the name list segments * at the end of a statement/proc/func * All segments are freed down to the one in which * p points. */ nlfree(p) struct nl *p; { nlp = p; while (nlact->nls_low > nlp || nlact->nls_high < nlp) { free(nlact->nls_low); nlact->nls_low = NIL; nlact->nls_high = NIL; --nlact; if (nlact < &ntab[0]) panic("nlfree"); } } char *VARIABLE = "variable"; char *classes[ ] = { "undefined", "constant", "type", "variable", /* VARIABLE */ "array", "pointer or file", "record", "field", "procedure", "function", "variable", /* VARIABLE */ "variable", /* VARIABLE */ "pointer", "file", "set", "subrange", "label", "withptr", "scalar", "string", "program", "improper", "variant", "formal procedure", "formal function" }; char *snark = "SNARK"; #ifdef PI #ifdef DEBUG char *ctext[] = { "BADUSE", "CONST", "TYPE", "VAR", "ARRAY", "PTRFILE", "RECORD", "FIELD", "PROC", "FUNC", "FVAR", "REF", "PTR", "FILET", "SET", "RANGE", "LABEL", "WITHPTR", "SCAL", "STR", "PROG", "IMPROPER", "VARNT", "FPROC", "FFUNC" }; char *stars = "\t***"; /* * Dump the namelist from the * current nlp down to 'to'. * All the namelist is dumped if * to is NIL. */ dumpnl(to, rout) struct nl *to; { register struct nl *p; register int j; struct nls *nlsp; int i, v, head; if (opt('y') == 0) return; if (to != NIL) printf("\n\"%s\" Block=%d\n", rout, cbn); nlsp = nlact; head = NIL; for (p = nlp; p != to;) { if (p == nlsp->nls_low) { if (nlsp == &ntab[0]) break; nlsp--; p = nlsp->nls_high; } p--; if (head == NIL) { printf("\tName\tClass Bn+Flags\tType\tVal\tChn\n"); head++; } printf("%3d:", nloff(p)); if (p->symbol) printf("\t%.7s", p->symbol); else printf(stars); if (p->class) printf("\t%s", ctext[p->class]); else printf(stars); if (p->nl_flags) { pchr('\t'); if (p->nl_flags & 037) printf("%d ", p->nl_flags & 037); #ifndef PI0 if (p->nl_flags & NMOD) pchr('M'); if (p->nl_flags & NUSED) pchr('U'); #endif if (p->nl_flags & NFILES) pchr('F'); } else printf(stars); if (p->type) printf("\t[%d]", nloff(p->type)); else printf(stars); v = p->value[0]; switch (p->class) { case TYPE: break; case VARNT: goto con; case CONST: switch (nloff(p->type)) { default: printf("\t%d", v); break; case TDOUBLE: printf("\t%f", p->real); break; case TINT: case T4INT: con: printf("\t%ld", p->range[0]); break; case TSTR: printf("\t'%s'", p->ptr[0]); break; } break; case VAR: case REF: case WITHPTR: case FFUNC: case FPROC: printf("\t%d,%d", cbn, v); break; case SCAL: case RANGE: printf("\t%ld..%ld", p->range[0], p->range[1]); break; case RECORD: printf("\t%d(%d)", v, p->value[NL_FLDSZ]); break; case FIELD: printf("\t%d", v); break; case STR: printf("\t|%d|", p->value[0]); break; case FVAR: case FUNC: case PROC: case PROG: if (cbn == 0) { printf("\t<%o>", p->value[0] & 0377); #ifndef PI0 if (p->value[0] & NSTAND) printf("\tNSTAND"); #endif break; } v = p->value[1]; default: casedef: if (v) printf("\t<%d>", v); else printf(stars); } if (p->chain) printf("\t[%d]", nloff(p->chain)); switch (p->class) { case RECORD: if (p->ptr[NL_VARNT]) printf("\tVARNT=[%d]", nloff(p->ptr[NL_VARNT])); if (p->ptr[NL_TAG]) printf(" TAG=[%d]", nloff(p->ptr[NL_TAG])); break; case VARNT: printf("\tVTOREC=[%d]", nloff(p->ptr[NL_VTOREC])); break; } # ifdef PC if ( p -> extra_flags != 0 ) { pchr( '\t' ); if ( p -> extra_flags & NEXTERN ) printf( "NEXTERN " ); if ( p -> extra_flags & NLOCAL ) printf( "NLOCAL " ); if ( p -> extra_flags & NPARAM ) printf( "NPARAM " ); if ( p -> extra_flags & NGLOBAL ) printf( "NGLOBAL " ); if ( p -> extra_flags & NREGVAR ) printf( "NREGVAR " ); } # endif PC # ifdef PTREE pchr( '\t' ); pPrintPointer( stdout , "%s" , p -> inTree ); # endif pchr('\n'); } if (head == 0) printf("\tNo entries\n"); } #endif /* * Define a new name list entry * with initial symbol, class, type * and value[0] as given. A new name * list segment is allocated to hold * the next name list slot if necessary. */ struct nl * defnl(sym, cls, typ, val) char *sym; int cls; struct nl *typ; int val; { register struct nl *p; register int *q, i; char *cp; p = nlp; /* * Zero out this entry */ q = p; i = (sizeof *p)/(sizeof (int)); do *q++ = 0; while (--i); /* * Insert the values */ p->symbol = sym; p->class = cls; p->type = typ; p->nl_block = cbn; p->value[0] = val; /* * Insure that the next namelist * entry actually exists. This is * really not needed here, it would * suffice to do it at entry if we * need the slot. It is done this * way because, historically, nlp * always pointed at the next namelist * slot. */ nlp++; if (nlp >= nlact->nls_high) { i = NLINC; cp = malloc(NLINC * sizeof *nlp); if (cp == 0) { i = NLINC / 2; cp = malloc((NLINC / 2) * sizeof *nlp); } if (cp == 0) { error("Ran out of memory (defnl)"); pexit(DIED); } nlact++; if (nlact >= &ntab[MAXNL]) { error("Ran out of name list tables"); pexit(DIED); } nlp = cp; nlact->nls_low = nlp; nlact->nls_high = nlact->nls_low + i; } return (p); } /* * Make a duplicate of the argument * namelist entry for, e.g., type * declarations of the form 'type a = b' * and array indicies. */ struct nl * nlcopy(p) struct nl *p; { register int *p1, *p2, i; p1 = p; p = p2 = defnl(0, 0, 0, 0); i = (sizeof *p)/(sizeof (int)); do *p2++ = *p1++; while (--i); p->chain = NIL; return (p); } /* * Compute a namelist offset */ nloff(p) struct nl *p; { return (p - nl); } /* * Enter a symbol into the block * symbol table. Symbols are hashed * 64 ways based on low 6 bits of the * cha((racter pointer into the string * table. */ struct nl * enter(np) struct nl *np; { register struct nl *rp, *hp; register struct nl *p; int i; rp = np; if (rp == NIL) return (NIL); #ifndef PI1 if (cbn > 0) if (rp->symbol == input->symbol || rp->symbol == output->symbol) error("Pre-defined files input and output must not be redefined"); #endif i = rp->symbol; i &= 077; hp = disptab[i]; if (rp->class != BADUSE && rp->class != FIELD) for (p = hp; p != NIL && (p->nl_block & 037) == cbn; p = p->nl_next) if (p->symbol == rp->symbol && p->class != BADUSE && p->class != FIELD) { #ifndef PI1 error("%s is already defined in this block", rp->symbol); #endif break; } rp->nl_next = hp; disptab[i] = rp; return (rp); } #endif symbol || rp->symbol == output->symbol) error("Pre-defined files input and output must not be redefined"); #endif i = rp->symbol; i &= 077; hp = disptab[i]; if (rp->class != BADUSE && rp->class != FIELD) for (p = hp; p != NIL && (p->nl_block & 037) == cbn; p = cmd/pc0/objfmt.h 644 0 33 6030 2552606577 6727 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)objfmt.h 1.6 3/10/81"; */ #ifdef OBJ /* * the creation time, the size and the magic number of the obj file */ struct pxhdr { long maketime; long objsize; short magicnum; }; # define HEADER_BYTES 1024 /* the size of px_header */ # define PX_HEADER "/usr/lib/px_header" /* px_header's name */ # define PI_COMP "/usr/ucb/pi" /* the compiler's name */ # define PX_INTRP "/usr/ucb/px" /* the interpreter's name */ # define INDX 1 /* amt to shift display index */ #endif OBJ /* * the file of error messages created by mkstr */ #ifdef OBJ # define ERR_STRNGS "/usr/lib/pi2.0strings" # define ERR_PATHLEN 9 # define HOW_STRNGS "/usr/lib/how_pi\0" # define HOW_PATHLEN 9 #endif OBJ #ifdef PC # define ERR_STRNGS "/usr/lib/pc2.0strings" # define ERR_PATHLEN 9 # define HOW_STRNGS "/usr/lib/how_pc\0" # define HOW_PATHLEN 9 #endif PC /* * these are because of varying sizes of pointers */ #ifdef VAX # define PTR_AS O_AS4 # define PTR_RV O_RV4 # define PTR_IND O_IND4 # define PTR_CON O_CON4 # define PTR_DUP O_SDUP4 # define CON_INT O_CON24 # define INT_TYP (nl + T4INT) # define PTR_DCL unsigned long /* for pointer variables */ # define SHORTADDR 32768 /* maximum short address */ # define TOOMUCH 65536 /* maximum variable size */ # define MAXSET 65536 /* maximum set size */ /* * Offsets due to the structure of the runtime stack. * DPOFF1 is the amount of fixed storage in each block allocated * as local variables for the runtime system. * since locals are allocated negative offsets, * -DPOFF1 is the last used implicit local offset. * DPOFF2 is the size of the block mark. * since arguments are allocated positive offsets, * DPOFF2 is the end of the implicit arguments. * for obj, the first argument has the highest offset * from the stackpointer. and the block mark is an * implicit last parameter. * for pc, the first argument has the lowest offset * from the argumentpointer. and the block mark is an * implicit first parameter. */ # ifdef OBJ # define DPOFF1 0 # define DPOFF2 32 # define INPUT_OFF -8 /* offset of `input' */ # define OUTPUT_OFF -4 /* offset of `output' */ # endif OBJ # ifdef PC # define DPOFF1 ( sizeof rtlocs - sizeof rtlocs.unwind ) # define DPOFF2 ( sizeof (long) ) # define INPUT_OFF 0 # define OUTPUT_OFF 0 # endif PC # define MAGICNUM 0403 /* obj magic number */ #endif VAX #ifdef PDP11 # define PTR_AS O_AS2 # define PTR_RV O_RV2 # define PTR_IND O_IND2 # define PTR_CON O_CON2 # define PTR_DUP O_SDUP2 # define CON_INT O_CON2 # define INT_TYP (nl + T2INT) # define PTR_DCL char * # define TOOMUCH 50000 # define SHORTADDR 65536 # define MAXSET 65536 /* maximum set size */ # define DPOFF1 0 # define DPOFF2 18 /* sizeof(struct stack) */ # define INPUT_OFF -2 # define OUTPUT_OFF -4 # define MAGICNUM 0404 #endif PDP11 PC # define MAGICNUM 0403 /* obj magic number */ #endif VAX #ifdef PDP11 # define PTR_AS O_AS2 # define PTR_RV O_RV2 # define PTR_IND O_IND2 # define PTR_CON O_CON2 # define PTR_DUP O_SDUP2 # define CON_INT O_CON2 # define INT_TYP (nl + T2INT) # define PTR_DCL char * # define TOOMUCH 50000 # define SHORTADDR 65536 # define MAXSET 65536 /* maximum set size */ # define DPOFF1 0 # define DPOFF2 18 /* sizeof(struct stack) */ # define INPUT_OFF -2 # define OUTPUT_OFF -4 # define MAGcmd/pc0/opc.c 644 0 33 417 2552606577 6205 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)opc.c 1.1 8/27/80"; #include "OPnames.h" main() { register int i; for (i = 0; i < 256; i++) if (otext[i]) printf("#define O_%s %04o\n", otext[i]+1, i); exit(0); } # define PTR_DCL char * # define TOOMUCH 50000 # define SHORTADDR 65536 # define MAXSET 65536 /* maximum set size */ # define DPOFF1 0 # define DPO/,58< /,"cmd/pc0/opcode.h 644 0 33 11306 2552606577 6741 #define O_NODUMP 0001 #define O_BEG 0002 #define O_END 0003 #define O_CALL 0004 #define O_FCALL 0005 #define O_FRTN 0006 #define O_FSAV 0007 #define O_SDUP2 0010 #define O_SDUP4 0011 #define O_TRA 0012 #define O_TRA4 0013 #define O_GOTO 0014 #define O_LINO 0015 #define O_PUSH 0016 #define O_IF 0020 #define O_REL2 0021 #define O_REL4 0022 #define O_REL24 0023 #define O_REL42 0024 #define O_REL8 0025 #define O_RELG 0026 #define O_RELT 0027 #define O_REL28 0030 #define O_REL48 0031 #define O_REL82 0032 #define O_REL84 0033 #define O_AND 0034 #define O_OR 0035 #define O_NOT 0036 #define O_AS2 0040 #define O_AS4 0041 #define O_AS24 0042 #define O_AS42 0043 #define O_AS21 0044 #define O_AS41 0045 #define O_AS28 0046 #define O_AS48 0047 #define O_AS8 0050 #define O_AS 0051 #define O_INX2P2 0052 #define O_INX4P2 0053 #define O_INX2 0054 #define O_INX4 0055 #define O_OFF 0056 #define O_NIL 0057 #define O_ADD2 0060 #define O_ADD4 0061 #define O_ADD24 0062 #define O_ADD42 0063 #define O_ADD28 0064 #define O_ADD48 0065 #define O_ADD82 0066 #define O_ADD84 0067 #define O_SUB2 0070 #define O_SUB4 0071 #define O_SUB24 0072 #define O_SUB42 0073 #define O_SUB28 0074 #define O_SUB48 0075 #define O_SUB82 0076 #define O_SUB84 0077 #define O_MUL2 0100 #define O_MUL4 0101 #define O_MUL24 0102 #define O_MUL42 0103 #define O_MUL28 0104 #define O_MUL48 0105 #define O_MUL82 0106 #define O_MUL84 0107 #define O_ABS2 0110 #define O_ABS4 0111 #define O_ABS8 0112 #define O_NEG2 0114 #define O_NEG4 0115 #define O_NEG8 0116 #define O_DIV2 0120 #define O_DIV4 0121 #define O_DIV24 0122 #define O_DIV42 0123 #define O_MOD2 0124 #define O_MOD4 0125 #define O_MOD24 0126 #define O_MOD42 0127 #define O_ADD8 0130 #define O_SUB8 0131 #define O_MUL8 0132 #define O_DVD8 0133 #define O_STOI 0134 #define O_STOD 0135 #define O_ITOD 0136 #define O_ITOS 0137 #define O_DVD2 0140 #define O_DVD4 0141 #define O_DVD24 0142 #define O_DVD42 0143 #define O_DVD28 0144 #define O_DVD48 0145 #define O_DVD82 0146 #define O_DVD84 0147 #define O_RV1 0150 #define O_RV14 0151 #define O_RV2 0152 #define O_RV24 0153 #define O_RV4 0154 #define O_RV8 0155 #define O_RV 0156 #define O_LV 0157 #define O_LRV1 0160 #define O_LRV14 0161 #define O_LRV2 0162 #define O_LRV24 0163 #define O_LRV4 0164 #define O_LRV8 0165 #define O_LRV 0166 #define O_LLV 0167 #define O_IND1 0170 #define O_IND14 0171 #define O_IND2 0172 #define O_IND24 0173 #define O_IND4 0174 #define O_IND8 0175 #define O_IND 0176 #define O_CON1 0200 #define O_CON14 0201 #define O_CON2 0202 #define O_CON24 0203 #define O_CON4 0204 #define O_CON8 0205 #define O_CON 0206 #define O_LVCON 0207 #define O_RANG2 0210 #define O_RANG42 0211 #define O_RSNG2 0212 #define O_RSNG42 0213 #define O_RANG4 0214 #define O_RANG24 0215 #define O_RSNG4 0216 #define O_RSNG24 0217 #define O_STLIM 0220 #define O_LLIMIT 0221 #define O_BUFF 0222 #define O_HALT 0223 #define O_ORD2 0230 #define O_CONG 0231 #define O_CONC 0232 #define O_CONC4 0233 #define O_ABORT 0234 #define O_PXPBUF 0235 #define O_COUNT 0236 #define O_CASE1OP 0240 #define O_CASE2OP 0241 #define O_CASE4OP 0242 #define O_CASEBEG 0243 #define O_CASE1 0244 #define O_CASE2 0245 #define O_CASE4 0246 #define O_CASEEND 0247 #define O_ADDT 0250 #define O_SUBT 0251 #define O_MULT 0252 #define O_INCT 0253 #define O_CTTOT 0254 #define O_CARD 0255 #define O_IN 0256 #define O_ASRT 0257 #define O_FOR1U 0260 #define O_FOR2U 0261 #define O_FOR4U 0262 #define O_FOR1D 0263 #define O_FOR2D 0264 #define O_FOR4D 0265 #define O_READE 0270 #define O_READ4 0271 #define O_READC 0272 #define O_READ8 0273 #define O_READL((N 0274 #define O_EOF 0275 #define O_EOLN 0276 #define O_WRITEC 0300 #define O_WRITES 0301 #define O_WRITEF 0302 #define O_WRITLN 0303 #define O_PAGE 0304 #define O_NAM 0305 #define O_MAX 0306 #define O_MIN 0307 #define O_UNIT 0310 #define O_UNITINP 0311 #define O_UNITOUT 0312 #define O_MESSAGE 0313 #define O_GET 0314 #define O_PUT 0315 #define O_FNIL 0316 #define O_DEFNAME 0320 #define O_RESET 0321 #define O_REWRITE 0322 #define O_FILE 0323 #define O_REMOVE 0324 #define O_FLUSH 0325 #define O_PACK 0330 #define O_UNPACK 0331 #define O_ARGC 0332 #define O_ARGV 0333 #define O_CLCK 0340 #define O_WCLCK 0341 #define O_SCLCK 0342 #define O_DISPOSE 0343 #define O_NEW 0344 #define O_DATE 0345 #define O_TIME 0346 #define O_UNDEF 0347 #define O_ATAN 0350 #define O_COS 0351 #define O_EXP 0352 #define O_LN 0353 #define O_SIN 0354 #define O_SQRT 0355 #define O_CHR2 0356 #define O_CHR4 0357 #define O_ODD2 0360 #define O_ODD4 0361 #define O_PRED2 0362 #define O_PRED4 0363 #define O_PRED24 0364 #define O_SUCC2 0365 #define O_SUCC4 0366 #define O_SUCC24 0367 #define O_SEED 0370 #define O_RANDOM 0371 #define O_EXPO 0372 #define O_SQR2 0373 #define O_SQR4 0374 #define O_SQR8 0375 #define O_ROUND 0376 #define O_TRUNC 0377 346 #define O_UNDEF 0347 #define O_ATAN 0350 #define O_COS 0351 #define O_EXP 0352 #define O_LN 0353 #define O_SIN 0354 #define O_SQRT 0355 #define O_CHR2 0356 #define O_CHR4 0357 #define O_ODD2 0360 #define O_ODD4 0361 #define O_PRED2 0362 #define O_PRED4 0363 #define O_PRED24 0364 #define O_SUCC2 0365 #define Ocmd/pc0/p2put.c 644 0 33 40512 2552606600 6521 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)p2put.c 1.9 6/1/81"; /* * functions to help pi put out * polish postfix binary portable c compiler intermediate code * thereby becoming the portable pascal compiler */ #include "whoami.h" #ifdef PC #include "0.h" #include "pcops.h" #include "pc.h" /* * mash into f77's format * lovely, isn't it? */ #define TOF77( fop,val,rest ) ( ( ( (rest) & 0177777 ) << 16 ) \ | ( ( (val) & 0377 ) << 8 ) \ | ( (fop) & 0377 ) ) /* * emits an ftext operator and a string to the pcstream */ puttext( string ) char *string; { int length = str4len( string ); if ( !CGENNING ) return; p2word( TOF77( P2FTEXT , length , 0 ) ); # ifdef DEBUG if ( opt( 'k' ) ) { fprintf( stdout , "P2FTEXT | %3d | 0 " , length ); } # endif p2string( string ); } int str4len( string ) char *string; { return ( ( strlen( string ) + 3 ) / 4 ); } /* * put formatted text into a buffer for printing to the pcstream. * a call to putpflush actually puts out the text. * none of arg1 .. arg5 need be present. * and you can add more if you need them. */ /* VARARGS */ putprintf( format , incomplete , arg1 , arg2 , arg3 , arg4 , arg5 ) char *format; int incomplete; { static char ppbuffer[ BUFSIZ ]; static char *ppbufp = ppbuffer; if ( !CGENNING ) return; sprintf( ppbufp , format , arg1 , arg2 , arg3 , arg4 , arg5 ); ppbufp = &( ppbuffer[ strlen( ppbuffer ) ] ); if ( ppbufp >= &( ppbuffer[ BUFSIZ ] ) ) panic( "putprintf" ); if ( ! incomplete ) { puttext( ppbuffer ); ppbufp = ppbuffer; } } /* * emit a left bracket operator to pcstream * with function number, the maximum temp register, and total local bytes * until i figure out how to use them, regs 0 .. 11 are free. * one idea for one reg is to save the display pointer on block entry */ putlbracket( ftnno , localbytes ) int ftnno; int localbytes; { # define MAXTP2REG 11 p2word( TOF77( P2FLBRAC , MAXTP2REG , ftnno ) ); p2word( BITSPERBYTE * localbytes ); # ifdef DEBUG if ( opt( 'k' ) ) { fprintf( stdout , "P2FLBRAC | %3d | %d " , MAXTP2REG , ftnno ); fprintf( stdout , "%d\n" , BITSPERBYTE * localbytes ); } # endif } /* * emit a right bracket operator * which for the binary (fortran) interface * forces the stack allocate and register mask */ putrbracket( ftnno ) int ftnno; { p2word( TOF77( P2FRBRAC , 0 , ftnno ) ); # ifdef DEBUG if ( opt( 'k' ) ) { fprintf( stdout , "P2FRBRAC | 0 | %d\n" , ftnno ); } # endif } /* * emit an eof operator */ puteof() { p2word( P2FEOF ); # ifdef DEBUG if ( opt( 'k' ) ) { fprintf( stdout , "P2FEOF\n" ); } # endif } /* * emit a dot operator, * with a source file line number and name * if line is negative, there was an error on that line, but who cares? */ putdot( filename , line ) char *filename; int line; { int length = str4len( filename ); if ( line < 0 ) { line = -line; } p2word( TOF77( P2FEXPR , length , line ) ); # ifdef DEBUG if ( opt( 'k' ) ) { fprintf( stdout , "P2FEXPR | %3d | %d " , length , line ); } # endif p2string( filename ); } /* * put out a leaf node */ putleaf( op , lval , rval , type , name ) int op; int lval; int rval; int type; char *name; { if ( !CGENNING ) return; switch ( op ) { default: panic( "[putleaf]" ); case P2ICON: p2word( TOF77( P2ICON , name != NIL , type ) ); p2word( lval ); # ifdef DEBUG if ( opt( 'k' ) ) { fprintf( stdout , "P2ICON | %3d | 0x%x " , name != NIL , type ); fprintf( stdout , "%d\n" , lval ); } # endif if ( name ) p2name( name ); break; case P2NAME: p2word( TOF77( P2NAME , lval != 0 , type ) ); if ( lval ) p2word( lval ); # ifdef DEBUG if ( opt( 'k' ) ) { fprintf( stdout , "P2NAME | %3d | 0x%x " , lval != 0 , type ); if ( lval ) fprintf( stdout , "%d " , lval ); } # endif p2name( name ); break; case P2REG: p2word( TOF77( P2REG , rval , type ) ); # ifdef DEBUG if ( opt( 'k' ) ) { fprintf( stdout , "P2REG | %3d | 0x%x\n" , rval , type ); } # endif break; } } /* * rvalues are just lvalues with indirection, except * special cases for registers and for named globals, * whose names are their rvalues. */ putRV( name , level , offset , extra_flags , type ) char *name; int level; int offset; char extra_flags; int type; { char extname[ BUFSIZ ]; char *printname; int regnumber; if ( !CGENNING ) return; if ( extra_flags & NREGVAR ) { if ( ( offset < 0 ) || ( offset > P2FP ) ) { panic( "putRV regvar" ); } putleaf( P2REG , 0 , offset , type , 0 ); return; } if ( whereis( level , offset , extra_flags ) == GLOBALVAR ) { if ( name != 0 ) { if ( name[0] != '_' ) { sprintf( extname , EXTFORMAT , name ); printname = extname; } else { printname = name; } putleaf( P2NAME , offset , 0 , type , printname ); return; } else { panic( "putRV no name" ); } } putLV( name , level , offset , extra_flags , type ); putop( P2UNARY P2MUL , type ); } /* * put out an lvalue * given a level and offset * special case for * named globals, whose lvalues are just their names as constants. */ putLV( name , level , offset , extra_flags , type ) char *name; int level; int offset; char extra_flags; int type; { char extname[ BUFSIZ ]; char *printname; if ( !CGENNING ) return; if ( extra_flags & NREGVAR ) { panic( "putLV regvar" ); } switch ( whereis( level , offset , extra_flags ) ) { case GLOBALVAR: if ( ( name != 0 ) ) { if ( name[0] != '_' ) { sprintf( extname , EXTFORMAT , name ); printname = extname; } else { printname = name; } putleaf( P2ICON , offset , 0 , ADDTYPE( type , P2PTR ) , printname ); return; } else { panic( "putLV no name" ); } case PARAMVAR: if ( level == cbn ) { putleaf( P2REG , 0 , P2AP , ADDTYPE( type , P2PTR ) , 0 ); } else { putleaf( P2NAME , (level * sizeof(struct dispsave)) + AP_OFFSET , 0 , P2PTR | P2CHAR , DISPLAYNAME ); } putleaf( P2ICON , offset , 0 , P2INT , 0 ); putop( P2PLUS , P2PTR | P2CHAR ); break; case LOCALVAR: if ( level == cbn ) { putleaf( P2REG , 0 , P2FP , ADDTYPE( type , P2PTR ) , 0 ); } else { putleaf( P2NAME , (level * sizeof(struct dispsave)) + FP_OFFSET , 0 , P2PTR | P2CHAR , DISPLAYNAME ); } putleaf( P2ICON , -offset , 0 , P2INT , 0 ); putop( P2MINUS , P2PTR | P2CHAR ); break; } return; } /* * put out a floating point constant leaf node * the constant is declared in aligned data space * and a P2NAME leaf put out for it */ putCON8( value ) double value; { int label; char name[ BUFSIZ ]; if ( !CGENNING ) return; putprintf( " .data" , 0 ); putprintf( " .align 2" , 0 ); label = getlab(); putlab( label ); putprintf( " .double 0d%.20e" , 0 , value ); putprintf( " .text" , 0 ); sprintf( name , PREFIXFORMAT , LABELPREFIX , label ); putleaf( P2NAME , 0 , 0 , P2DOUBLE , name ); } /* * put out either an lvalue or an rvalue for a constant string. * an lvalue (for assignment rhs's) is the name as a constant, * an rvalue (for parameters) is just the name. */ putCONG( string , length , required ) char *string; int length; int required; { char name[ BUFSIZ ]; int label; char *cp; int pad; int others; if ( !CGENNING ) return; putprintf( " .data" , 0 ); label = getlab(); putlab( label ); cp = string; while ( *cp ) { putprintf( " .byte 0%o" , 1 , *cp ++ ); for ( others = 2 ; ( others <= 8 ) && *cp ; others ++ ) { putprintf( ",0%o" , 1 , ((*cp++ ); } putprintf( "" , 0 ); } pad = length - strlen( string ); while ( pad-- > 0 ) { putprintf( " .byte 0%o" , 1 , ' ' ); for ( others = 2 ; ( others <= 8 ) && ( pad-- > 0 ) ; others++ ) { putprintf( ",0%o" , 1 , ' ' ); } putprintf( "" , 0 ); } putprintf( " .byte 0" , 0 ); putprintf( " .text" , 0 ); sprintf( name , PREFIXFORMAT , LABELPREFIX , label ); if ( required == RREQ ) { putleaf( P2NAME , 0 , 0 , P2ARY | P2CHAR , name ); } else { putleaf( P2ICON , 0 , 0 , P2PTR | P2CHAR , name ); } } /* * map a pascal type to a c type * this would be tail recursive, but i unfolded it into a for (;;). * this is sort of like isa and lwidth * a note on the types used by the portable c compiler: * they are divided into a basic type (char, short, int, long, etc.) * and qualifications on those basic types (pointer, function, array). * the basic type is kept in the low 4 bits of the type descriptor, * and the qualifications are arranged in two bit chunks, with the * most significant on the right, * and the least significant on the left * e.g. int *foo(); * (a function returning a pointer to an integer) * is stored as * * so, we build types recursively * also, we know that /lib/f1 can only deal with 6 qualifications * so we stop the recursion there. this stops infinite type recursion * through mutually recursive pointer types. */ #define MAXQUALS 6 int p2type( np ) { return typerecur( np , 0 ); } typerecur( np , quals ) struct nl *np; int quals; { if ( np == NIL || quals > MAXQUALS ) { return P2UNDEF; } switch ( np -> class ) { case SCAL : case RANGE : if ( np -> type == ( nl + TDOUBLE ) ) { return P2DOUBLE; } switch ( bytes( np -> range[0] , np -> range[1] ) ) { case 1: return P2CHAR; case 2: return P2SHORT; case 4: return P2INT; default: panic( "p2type int" ); } case STR : return ( P2ARY | P2CHAR ); case RECORD : case SET : return P2STRTY; case FILET : return ( P2PTR | P2STRTY ); case CONST : case VAR : case FIELD : return p2type( np -> type ); case TYPE : switch ( nloff( np ) ) { case TNIL : return ( P2PTR | P2UNDEF ); case TSTR : return ( P2ARY | P2CHAR ); case TSET : return P2STRTY; default : return ( p2type( np -> type ) ); } case REF: case WITHPTR: case PTR : return ADDTYPE( typerecur( np -> type , quals + 1 ) , P2PTR ); case ARRAY : return ADDTYPE( typerecur( np -> type , quals + 1 ) , P2ARY ); case FUNC : /* * functions are really pointers to functions * which return their underlying type. */ return ADDTYPE( ADDTYPE( typerecur( np -> type , quals + 2 ) , P2FTN ) , P2PTR ); case PROC : /* * procedures are pointers to functions * which return integers (whether you look at them or not) */ return ADDTYPE( ADDTYPE( P2INT , P2FTN ) , P2PTR ); case FFUNC : case FPROC : /* * formal procedures and functions are pointers * to structures which describe their environment. */ return ( P2PTR | P2STRTY ); default : panic( "p2type" ); } } /* * add a most significant type modifier to a type */ long addtype( underlying , mtype ) long underlying; long mtype; { return ( ( ( underlying & ~P2BASETYPE ) << P2TYPESHIFT ) | mtype | ( underlying & P2BASETYPE ) ); } /* * put a typed operator to the pcstream */ putop( op , type ) int op; int type; { extern char *p2opnames[]; if ( !CGENNING ) return; p2word( TOF77( op , 0 , type ) ); # ifdef DEBUG if ( opt( 'k' ) ) { fprintf( stdout , "%s (%d) | 0 | 0x%x\n" , p2opnames[ op ] , op , type ); } # endif } /* * put out a structure operator (STASG, STARG, STCALL, UNARY STCALL ) * which looks just like a regular operator, only the size and * alignment go in the next consecutive words */ putstrop( op , type , size , alignment ) int op; int type; int size; int alignment; { extern char *p2opnames[]; if ( !CGENNING ) return; p2word( TOF77( op , 0 , type ) ); p2word( size ); p2word( alignment ); # ifdef DEBUG if ( opt( 'k' ) ) { fprintf( stdout , "%s (%d) | 0 | 0x%x %d %d\n" , p2opnames[ op ] , op , type , size , alignment ); } # endif } /* * the string names of p2ops */ char *p2opnames[] = { "", "P2UNDEFINED", /* 1 */ "P2NAME", /* 2 */ "P2STRING", /* 3 */ "P2ICON", /* 4 */ "P2FCON", /* 5 */ "P2PLUS", /* 6 */ "", "P2MINUS", /* 8 also unary == P2NEG */ "", "P2NEG", "P2MUL", /* 11 also unary == P2INDIRECT */ "", "P2INDIRECT", "P2AND", /* 14 also unary == P2ADDROF */ "", "P2ADDROF", "P2OR", /* 17 */ "", "P2ER", /* 19 */ "", "P2QUEST", /* 21 */ "P2COLON", /* 22 */ "P2ANDAND", /* 23 */ "P2OROR", /* 24 */ "", /* 25 */ "", /* 26 */ "", /* 27 */ "", /* 28 */ "", /* 29 */ "", /* 30 */ "", /* 31 */ "", /* 32 */ "", /* 33 */ "", /* 34 */ "", /* 35 */ "", /* 36 */ "", /* 37 */ "", /* 38 */ "", /* 39 */ "", /* 40 */ "", /* 41 */ "", /* 42 */ "", /* 43 */ "", /* 44 */ "", /* 45 */ "", /* 46 */ "", /* 47 */ "", /* 48 */ "", /* 49 */ "", /* 50 */ "", /* 51 */ "", /* 52 */ "", /* 53 */ "", /* 54 */ "", /* 55 */ "P2LISTOP", /* 56 */ "", "P2ASSIGN", /* 58 */ "P2COMOP", /* 59 */ "P2DIV", /* 60 */ "", "P2MOD", /* 62 */ "", "P2LS", /* 64 */ "", "P2RS", /* 66 */ "", "P2DOT", /* 68 */ "P2STREF", /* 69 */ "P2CALL", /* 70 also unary */ "", "P2UNARYCALL", "P2FORTCALL", /* 73 also unary */ "", "P2UNARYFORTCALL", "P2NOT", /* 76 */ "P2COMPL", /* 77 */ "P2INCR", /* 78 */ "P2DECR", /* 79 */ "P2EQ", /* 80 */ "P2NE", /* 81 */ "P2LE", /* 82 */ "P2LT", /* 83 */ "P2GE", /* 84 */ "P2GT", /* 85 */ "P2ULE", /* 86 */ "P2ULT", /* 87 */ "P2UGE", /* 88 */ "P2UGT", /* 89 */ "P2SETBIT", /* 90 */ "P2TESTBIT", /* 91 */ "P2RESETBIT", /* 92 */ "P2ARS", /* 93 */ "P2REG", /* 94 */ "P2OREG", /* 95 */ "P2CCODES", /* 96 */ "P2FREE", /* 97 */ "P2STASG", /* 98 */ "P2STARG", /* 99 */ "P2STCALL", /* 100 also unary */ "", "P2UNARYSTCALL", "P2FLD", /* 103 */ "P2SCONV", /* 104 */ "P2PCONV", /* 105 */ "P2PMCONV", /* 106 */ "P2PVCONV", /* 107 */ "P2FORCE", /* 108 */ "P2CBRANCH", /* 109 */ "P2INIT", /* 110 */ "P2CAST", /* 111 */ }; /* * low level routines */ /* * puts a long word on the pcstream */ p2word( word ) long word; { putw( word , pcstream ); } /* * put a length 0 mod 4 null padded string onto the pcstream */ p2string( string ) char *string; { int slen = strlen( string ); int wlen = ( slen + 3 ) / 4; int plen = ( wlen * 4 ) - slen; char *cp; int p; for ( cp = string ; *cp ; cp++ ) putc( *cp , pcstream ); for ( p = 1 ; p <= plen ; p++ ) putc( '\0' , pcstream ); # ifdef DEBUG if ( opt( 'k' ) ) { fprintf( stdout , "\"%s" , string ); for ( p = 1 ; p <= plen ; p++ ) fprintf( stdout , "\\0" ); fprintf( stdout , "\"\n" ); } # endif } /* * puts a name on the pcstream */ p2name( name ) char *name; { int pad; fprintf( pcstream , NAMEFORMAT , name ); pad = strlen( name ) % sizeof (long); for ( ; pad < sizeof (long) ; pad++ ) { putc( '\0' , pcstream ); } # ifdef DEBUG if ( opt( 'k' ) ) { fprintf( stdout , NAMEFORMAT , name ); pad = strlen( name ) % sizeof (long); for ( ; pad < sizeof (long) ; pad++ ) { fprintf( stdout , "\\0" ); } fprintf( stdout , "\n" ); } # endif } /* * put out a jump to a label */ putjbr( label ) long label; { printjbr( LABELPREFIX , label ); } /* * put out a jump to any kind of label */ printjbr( prefix , label ) char *prefix; long label; { putprintf( " jbr " , 1 ); putprintf( PREFIXFORMAT , 0 , prefix , label ); } /* * another version of put to catch calls to put */ put( arg1 , arg2 ) { putprintf( "# PUT CALLED!: arg1 = %d arg2 = 0%o" , 0 , arg1 , arg2 ); } #endif PC * put out a jump to a label */ putjbr( label ) long label; { printjbr( LABELPREFIX , label ); } /* * put out a jump to any kind of label */ prcmd/pc0/pTree.h 644 0 33 225 2552606600 6470 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)pTree.h 1.1 8/27/80"; */ /* this is not pTree.h */ /* * another version of put to catch calls to put */ put( arg1 , arg2 ) { putprintf( "# PUT CALLED!: arg1 = %d arg2 = 0%o" , 0 , arg1 , arg2 ); } #endif PC * put out a jump to a label */ putjbr( label ) long label; { printjbr/,5h< /,"cmd/pc0/pas.y 644 0 33 36640 2552606600 6267 ((/* Copyright (c) 1979 Regents of the University of California */ /* * Yacc grammar for UNIX Pascal * * This grammar is processed by the commands in the shell script * "gram" to yield parse tables and semantic routines in the file * "y.tab.c" and a header defining the lexical tokens in "yy.h". * * In order for the syntactic error recovery possible with this * grammar to work, the grammar must be processed by a yacc which * has been modified to fully enumerate possibilities in states * which involve the symbol "error". * The parser used for Pascal also uses a different encoding of * the test entries in the action table which speeds the parse. * A version of yacc which will work for Pascal is included on * the distribution table as "eyacc". * * The "gram" script also makes the following changes to the "y.tab.c" * file: * * 1) Causes yyval to be declared int *. * * 2) Loads the variable yypv into a register as yyYpv so that * the arguments $1, ... are available as yyYpv[1] etc. * This produces much smaller code in the semantic actions. * * 3) Deletes the unused array yysterm. * * 4) Moves the declarations up to the flag line containing * '##' to the file yy.h so that the routines which use * these "magic numbers" don't have to all be compiled at * the same time. * * 5) Creates the semantic restriction checking routine yyEactr * by processing action lines containing `@@'. * * This compiler uses a different version of the yacc parser, a * different yyerror which is called yerror, and requires more * lookahead sets than normally provided by yacc. * * Source for the yacc used with this grammar is included on * distribution tapes. */ /* * TERMINAL DECLARATIONS * * Some of the terminal declarations are out of the most natural * alphabetic order because the error recovery * will guess the first of equal cost non-terminals. * This makes, e.g. YTO preferable to YDOWNTO. */ %term YAND YARRAY YBEGIN YCASE YCONST YDIV YDO YDOTDOT YTO YELSE YEND YFILE YFOR YFORWARD YFUNCTION YGOTO YID YIF YIN YINT YLABEL YMOD YNOT YNUMB YOF YOR YPACKED YNIL YPROCEDURE YPROG YRECORD YREPEAT YSET YSTRING YTHEN YDOWNTO YTYPE YUNTIL YVAR YWHILE YWITH YBINT YOCT YHEX YASSERT YCASELAB YILLCH YEXTERN YLAST /* * PRECEDENCE DECLARATIONS * * Highest precedence is the unary logical NOT. * Next are the multiplying operators, signified by '*'. * Lower still are the binary adding operators, signified by '+'. * Finally, at lowest precedence and non-associative are the relationals. */ %binary '<' '=' '>' YIN %left '+' '-' YOR '|' %left UNARYSIGN %left '*' '/' YDIV YMOD YAND '&' %left YNOT %{ /* * GLOBALS FOR ACTIONS */ /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)pas.y 1.4 3/18/81"; */ /* * The following line marks the end of the yacc * Constant definitions which are removed from * y.tab.c and placed in the file y.tab.h. */ ## /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)pas.y 1.4 3/18/81"; #include "whoami.h" #include "0.h" #include "yy.h" #include "tree.h" #ifdef PI #define lineof(l) l #define line2of(l) l #endif %} %% /* * PRODUCTIONS */ goal: prog_hedr decls block '.' = funcend($1, $3, lineof($4)); | decls = segend(); ; prog_hedr: YPROG YID '(' id_list ')' ';' = $$ = funcbody(funchdr(tree5(T_PROG, lineof($1), $2, fixlist($4), NIL))); | YPROG error = { yyPerror("Malformed program statement", PPROG); /* * Should make a program statement * with "input" and "output" here. */ $$ = funcbody(funchdr(tree5(T_PROG, lineof($1), NIL, NIL, NIL))); } ; block: YBEGIN stat_list YEND = { $$ = tree3(T_BSTL, lineof($1), fixlist($2)); if ($3 < 0) brerror($1, "begin"); } ; /* * DECLARATION PART */ decls: decls decl = trfree(); | decls error = { Derror: constend(), typeend(), varend(), trfree(); yyPerror("Malformed declaration", PDECL); } | /* lambda */ = trfree(); ; decl: labels | const_decl = constend(); | type_decl = typeend(); | var_decl = varend(); | proc_decl ; /* * LABEL PART */ labels: YLABEL label_decl ';' = label(fixlist($2), lineof($1)); ; label_decl: YINT = $$ = newlist($1 == NIL ? NIL : *hash($1, 1)); | label_decl ',' YINT = $$ = addlist($1, $3 == NIL ? NIL : *hash($3, 1)); ; /* * CONST PART */ const_decl: YCONST YID '=' const ';' = constbeg($1, line2of($2)), const(lineof($3), $2, $4); | const_decl YID '=' const ';' = const(lineof($3), $2, $4); | YCONST error = { constbeg($1, line2of($1)); Cerror: yyPerror("Malformed const declaration", PDECL); } | const_decl error = goto Cerror; ; /* * TYPE PART */ type_decl: YTYPE YID '=' type ';' = typebeg($1, line2of($2)), type(lineof($3), $2, $4); | type_decl YID '=' type ';' = type(lineof($3), $2, $4); | YTYPE error = { typebeg($1, line2of($1)); Terror: yyPerror("Malformed type declaration", PDECL); } | type_decl error = goto Terror; ; /* * VAR PART */ var_decl: YVAR id_list ':' type ';' = varbeg($1, line2of($3)), var(lineof($3), fixlist($2), $4); | var_decl id_list ':' type ';' = var(lineof($3), fixlist($2), $4); | YVAR error = { varbeg($1, line2of($1)); Verror: yyPerror("Malformed var declaration", PDECL); } | var_decl error = goto Verror; ; /* * PROCEDURE AND FUNCTION DECLARATION PART */ proc_decl: phead YFORWARD ';' = funcfwd($1); | phead YEXTERN ';' = funcext($1); | pheadres decls block ';' = funcend($1, $3, lineof($4)); ; pheadres: phead = funcbody($1); ; phead: porf YID params ftype ';' = $$ = funchdr(tree5($1, lineof($5), $2, $3, $4)); ; porf: YPROCEDURE = $$ = T_PDEC; | YFUNCTION = $$ = T_FDEC; ; params: '(' param_list ')' = $$ = fixlist($2); | /* lambda */ = $$ = NIL; ; /* * PARAMETERS */ param: id_list ':' type = $$ = tree3(T_PVAL, fixlist($1), $3); | YVAR id_list ':' type = $$ = tree3(T_PVAR, fixlist($2), $4); | YFUNCTION id_list params ftype = $$ = tree5(T_PFUNC, fixlist($2), $4, $3, lineof($1)); | YPROCEDURE id_list params ftype = $$ = tree5(T_PPROC, fixlist($2), $4, $3, lineof($1)); ; ftype: ':' type = $$ = $2; | /* lambda */ = $$ = NIL; ; param_list: param = $$ = newlist($1); | param_list ';' param = $$ = addlist($1, $3); ; /* * CONSTANTS */ const: YSTRING = $$ = tree2(T_CSTRNG, $1); | number | '+' number = $$ = tree2(T_PLUSC, $2); | '-' number = $$ = tree2(T_MINUSC, $2); ; number: const_id = $$ = tree2(T_ID, $1); | YINT = $$ = tree2(T_CINT, $1); | YBINT = $$ = tree2(T_CBINT, $1); | YNUMB = $$ = tree2(T_CFINT, $1); ; const_list: const = $$ = newlist($1); | const_list ',' const = $$ = addlist($1, $3); ; /* * TYPES */ type: simple_type | '^' YID = $$ = tree3(T_TYPTR, lineof($1), tree2(T_ID, $2)); | struct_type | YPACKED struct_type = $$ = tree3(T_TYPACK, lineof($1), $2); ; simple_type: type_id | '(' id_list ')' = $$ = tree3(T_TYSCAL, lineof($1), fixlist($2)); | const YDOTDOT const = $$ = tree4(T_TYRANG, lineof($2), $1, $3); ; struct_type: YARRAY '[' simple_type_list ']' YOF type = $$ = tree4(T_TYARY, lineof($1), fixlist($3), $6); | YFILE YOF type = $$ = tree3(T_TYFILE, lineof($1), $3); | YSET YOF simple_type = $$ = tree3(T_TYSET, lineof($1), $3); | YRECORD field_list YEND = { $$ = setuptyrec( lineof( $1 ) , $2 ); if ($3 < 0) brerror($1, "record"); } ; simple_type_list: simple_type = $$ = newlist($1); | simple_type_list ',' simple_type = $$ = addlist($1, $3); ; /* * RECORD TYPE */ field_list: fixed_part variant_part = $$ = tree4(T_FLDLST, lineof(NIL), fixlist($1), $2); ; fixed_part: field = $$ = newlist($1); | fixed_part ';' field = $$ = addlist($1, $3); | fixed_part error = yyPerror("Malformed record declaration", PDECL); ; field: /* lambda */ = $$ = NIL; | id_list ':' type = $$ = tree4(T_RFIELD, lineof($2), fixlist($1), $3); ; variant_part: /* lambda */ = $$ = NIL; | YCASE type_id YOF variant_list = $$ = tree5(T_TYVARPT, lineof($1), NIL, $2, fixlist($4)); | YCASE YID ':' type_id YOF variant_list = $$ = tree5(T_TYVARPT, lineof($1), $2, $4, fixlist($6)); ; variant_list: variant = $$ = newlist($1); | variant_list ';' variant = $$ = addlist($1, $3); | variant_list error = yyPerror("Malformed record declaration", PDECL); ; variant: /* lambda */ = $$ = NIL; | const_list ':' '(' field_list ')' = $$ = tree4(T_TYVARNT, lineof($2), fixlist($1), $4); | const_list ':' '(' ')' = $$ = tree4(T_TYVARNT, lineof($2), fixlist($1), NIL); ; /* * STATEMENT LIST */ stat_list: stat = $$ = newlist($1); | stat_lsth stat = { if ((p = $1) != NIL && (q = p[1])[0] == T_IFX) { q[0] = T_IFEL; q[4] = $2; } else $$ = addlist($1, $2); } ; stat_lsth: stat_list ';' = if ((q = $1) != NIL && (p = q[1]) != NIL && p[0] == T_IF) { if (yychar < 0) yychar = yylex(); if (yyshifts >= 2 && yychar == YELSE) { recovered(); copy(&Y, &OY, sizeof Y); yerror("Deleted ';' before keyword else"); yychar = yylex(); p[0] = T_IFX; } } ; /* * CASE STATEMENT LIST */ cstat_list: cstat = $$ = newlist($1); | cstat_list ';' cstat = $$ = addlist($1, $3); | error = { $$ = NIL; Kerror: yyPerror("Malformed statement in case", PSTAT); } | cstat_list error = goto Kerror; ; cstat: const_list ':' stat = $$ = tree4(T_CSTAT, lineof($2), fixlist($1), $3); | YCASELAB stat = $$ = tree4(T_CSTAT, lineof($1), NIL, $2); | /* lambda */ = $$ = NIL; ; /* * STATEMENT */ stat: /* lambda */ = $$ = NIL; | YINT ':' stat = $$ = tree4(T_LABEL, lineof($2), $1 == NIL ? NIL : *hash($1, 1), $3); | proc_id = $$ = tree4(T_PCALL, lineof(yyline), $1, NIL); | proc_id '(' wexpr_list ')' = $$ = tree4(T_PCALL, lineof($2), $1, fixlist($3)); | YID error = goto NSerror; | assign | YBEGIN stat_list YEND =(( { $$ = tree3(T_BLOCK, lineof($1), fixlist($2)); if ($3 < 0) brerror($1, "begin"); } | YCASE expr YOF cstat_list YEND = { $$ = tree4(T_CASE, lineof($1), $2, fixlist($4)); if ($5 < 0) brerror($1, "case"); } | YWITH var_list YDO stat = $$ = tree4(T_WITH, lineof($1), fixlist($2), $4); | YWHILE expr YDO stat = $$ = tree4(T_WHILE, lineof($1), $2, $4); | YREPEAT stat_list YUNTIL expr = $$ = tree4(T_REPEAT, lineof($3), fixlist($2), $4); | YFOR assign YTO expr YDO stat = $$ = tree5(T_FORU, lineof($1), $2, $4, $6); | YFOR assign YDOWNTO expr YDO stat = $$ = tree5(T_FORD, lineof($1), $2, $4, $6); | YGOTO YINT = $$ = tree3(T_GOTO, lineof($1), *hash($2, 1)); | YIF expr YTHEN stat = $$ = tree5(T_IF, lineof($1), $2, $4, NIL); | YIF expr YTHEN stat YELSE stat = $$ = tree5(T_IFEL, lineof($1), $2, $4, $6); | YIF expr YTHEN stat YELSE = $$ = tree5(T_IFEL, lineof($1), $2, $4, NIL); | YASSERT '(' expr ')' = $$ = tree3(T_ASRT, lineof($1), $3); | error = { NSerror: $$ = NIL; Serror: yyPerror("Malformed statement", PSTAT); } ; assign: variable ':' '=' expr = $$ = tree4(T_ASGN, lineof($2), $1, $4); ; /* * EXPRESSION */ expr: error = { NEerror: $$ = NIL; Eerror: yyPerror("Missing/malformed expression", PEXPR); } | expr relop expr %prec '<' = $$ = tree4($2, $1[1] == SAWCON ? $3[1] : $1[1], $1, $3); | '+' expr %prec UNARYSIGN = $$ = tree3(T_PLUS, $2[1], $2); | '-' expr %prec UNARYSIGN = $$ = tree3(T_MINUS, $2[1], $2); | expr addop expr %prec '+' = $$ = tree4($2, $1[1] == SAWCON ? $3[1] : $1[1], $1, $3); | expr divop expr %prec '*' = $$ = tree4($2, $1[1] == SAWCON ? $3[1] : $1[1], $1, $3); | YNIL = $$ = tree2(T_NIL, NOCON); | YSTRING = $$ = tree3(T_STRNG, SAWCON, $1); | YINT = $$ = tree3(T_INT, NOCON, $1); | YBINT = $$ = tree3(T_BINT, NOCON, $1); | YNUMB = $$ = tree3(T_FINT, NOCON, $1); | variable | YID error = goto NEerror; | func_id '(' wexpr_list ')' = $$ = tree4(T_FCALL, NOCON, $1, fixlist($3)); | '(' expr ')' = $$ = $2; | negop expr %prec YNOT = $$ = tree3(T_NOT, NOCON, $2); | '[' element_list ']' = $$ = tree3(T_CSET, SAWCON, fixlist($2)); | '[' ']' = $$ = tree3(T_CSET, SAWCON, NIL); ; element_list: element = $$ = newlist($1); | element_list ',' element = $$ = addlist($1, $3); ; element: expr | expr YDOTDOT expr = $$ = tree3(T_RANG, $1, $3); ; /* * QUALIFIED VARIABLES */ variable: YID = { @@ return (identis(var, VAR)); $$ = setupvar($1, NIL); } | qual_var = $1[3] = fixlist($1[3]); ; qual_var: array_id '[' expr_list ']' = $$ = setupvar($1, tree2(T_ARY, fixlist($3))); | qual_var '[' expr_list ']' = $1[3] = addlist($1[3], tree2(T_ARY, fixlist($3))); | record_id '.' field_id = $$ = setupvar($1, setupfield($3, NIL)); | qual_var '.' field_id = $1[3] = addlist($1[3], setupfield($3, NIL)); | ptr_id '^' = $$ = setupvar($1, tree1(T_PTR)); | qual_var '^' = $1[3] = addlist($1[3], tree1(T_PTR)); ; /* * Expression with write widths */ wexpr: expr | expr ':' expr = $$ = tree4(T_WEXP, $1, $3, NIL); | expr ':' expr ':' expr = $$ = tree4(T_WEXP, $1, $3, $5); | expr octhex = $$ = tree4(T_WEXP, $1, NIL, $2); | expr ':' expr octhex = $$ = tree4(T_WEXP, $1, $3, $4); ; octhex: YOCT = $$ = OCT; | YHEX = $$ = HEX; ; expr_list: expr = $$ = newlist($1); | expr_list ',' expr = $$ = addlist($1, $3); ; wexpr_list: wexpr = $$ = newlist($1); | wexpr_list ',' wexpr = $$ = addlist($1, $3); ; /* * OPERATORS */ relop: '=' = $$ = T_EQ; | '<' = $$ = T_LT; | '>' = $$ = T_GT; | '<' '>' = $$ = T_NE; | '<' '=' = $$ = T_LE; | '>' '=' = $$ = T_GE; | YIN = $$ = T_IN; ; addop: '+' = $$ = T_ADD; | '-' = $$ = T_SUB; | YOR = $$ = T_OR; | '|' = $$ = T_OR; ; divop: '*' = $$ = T_MULT; | '/' = $$ = T_DIVD; | YDIV = $$ = T_DIV; | YMOD = $$ = T_MOD; | YAND = $$ = T_AND; | '&' = $$ = T_AND; ; negop: YNOT | '~' ; /* * LISTS */ var_list: variable = $$ = newlist($1); | var_list ',' variable = $$ = addlist($1, $3); ; id_list: YID = $$ = newlist($1); | id_list ',' YID = $$ = addlist($1, $3); ; /* * Identifier productions with semantic restrictions * * For these productions, the characters @@ signify * that the associated C statement is to provide * the semantic restriction for this reduction. * These lines are made into a procedure yyEactr, similar to * yyactr, which determines whether the corresponding reduction * is permitted, or whether an error is to be signaled. * A zero return from yyEactr is considered an error. * YyEactr is called with an argument "var" giving the string * name of the variable in question, essentially $1, although * $1 will not work because yyEactr is called from loccor in * the recovery routines. */ const_id: YID = @@ return (identis(var, CONST)); ; type_id: YID = { @@ return (identis(var, TYPE)); $$ = tree3(T_TYID, lineof(yyline), $1); } ; var_id: YID = @@ return (identis(var, VAR)); ; array_id: YID = @@ return (identis(var, ARRAY)); ; ptr_id: YID = @@ return (identis(var, PTRFILE)); ; record_id: YID = @@ return (identis(var, RECORD)); ; field_id: YID = @@ return (identis(var, FIELD)); ; proc_id: YID = @@ return (identis(var, PROC)); ; func_id: YID = @@ return (identis(var, FUNC)); ; var, CONST)); ; type_id: YID = { @@ return (identis(var, TYPE)); $$ = tree3(T_TYID, lcmd/pc0/pc.h 644 0 33 5372 2552606601 6044 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)pc.h 1.3 4/1/81"; */ /* * random constants for pc */ /* * the name of the display. */ #define DISPLAYNAME "__disply" /* * the structure below describes the locals used by the run time system. * at function entry, at least this much space is allocated, * and the following information is filled in: * the address of a routine to close the current frame for unwinding, * a pointer to the display entry for the current static level and * the previous contents of the display for this static level. * the curfile location is used to point to the currently active file, * and is filled in as io is initiated. * one of these structures is allocated on the (negatively growing) stack. * at function entry, fp is set to point to the last field of the struct, * thus the offsets of the fields are as indicated below. */ struct rtlocals { struct iorec *curfile; struct dispsave dsave; struct dispsave *dptr; int (*unwind)(); } rtlocs; #define CURFILEOFFSET ( ( -sizeof rtlocs ) + sizeof rtlocs.unwind ) #define DSAVEOFFSET ( CURFILEOFFSET + sizeof rtlocs.curfile ) #define DPTROFFSET ( DSAVEOFFSET + sizeof rtlocs.dsave ) #define UNWINDOFFSET ( DPTROFFSET + sizeof rtlocs.dptr ) #define UNWINDNAME "_UNWIND" /* * the register save mask for saving no registers */ #define RSAVEMASK ( 0 ) /* * runtime check mask for divide check and integer overflow */ #define RUNCHECK ( ( 1 << 15 ) | ( 1 << 14 ) ) /* * formats for various names * NAMEFORMAT arbitrary length strings. * EXTFORMAT for externals, a preceding underscore. * PREFIXFORMAT used to print made up names with prefixes. * LABELPREFIX with getlab() makes up label names. * LLABELPREFIX with getlab() makes up sdb labels. * FORMALPREFIX prefix for EXTFORMAT for formal entry points. * a typical use might be to print out a name with a preceeding underscore * with putprintf( EXTFORMAT , 0 , name ); */ #define NAMEFORMAT "%s" #define EXTFORMAT "_%s" #define PREFIXFORMAT "%s%d" #define LABELPREFIX "L" #define LLABELPREFIX "LL" #define FORMALPREFIX "__" /* * the name of the statement counter */ #define STMTCOUNT "__stcnt" /* * the name of the pcp counters */ #define PCPCOUNT "__pcpcount" /* * a vector of pointer to enclosing functions for fully qualified names. */ char *enclosing[ DSPLYSZ ]; /* * and of course ... */ #define BITSPERBYTE 8 /* * error number for case label not found (ECASE) * stolen from ~mckusick/px/lib/h01errs.h */ #define ECASE 5 L" #define FORMALPREFIX "__" /* * the name of the statement counter */ #define STMTCOUNT "__stcnt" /* * the name of the pcp counters */ #define PCPCOUNT "__pcpcount" /* * a vector of pointer to enclosing functions for fullcmd/pc0/pccaseop.c 644 0 33 17740 2552606601 7254 /* Copyright (c) 1980 Regents of the University of California */ static char sccsid[] = "@(#)pccaseop.c 1.7 6/1/81"; #include "whoami.h" #ifdef PC /* * and the rest of the file */ #include "0.h" #include "tree.h" #include "objfmt.h" #include "pcops.h" #include "pc.h" /* * structure for a case: * its constant label, line number (for errors), and location label. */ struct ct { long cconst; int cline; int clabel; }; /* * the P2FORCE operator puts(( its operand into a register. * these to keep from thinking of it as r0 all over. */ #define FORCENAME "r0" /* * given a tree for a case statement, generate code for it. * this computes the expression into a register, * puts down the code for each of the cases, * and then decides how to do the case switching. * tcase [0] T_CASE * [1] lineof "case" * [2] expression * [3] list of cased statements: * cstat [0] T_CSTAT * [1] lineof ":" * [2] list of constant labels * [3] statement */ pccaseop( tcase ) int *tcase; { struct nl *exprtype; struct nl *exprnlp; struct nl *rangetype; long low; long high; long exprctype; long swlabel; long endlabel; long label; long count; long *cstatlp; long *cstatp; long *casep; struct ct *ctab; struct ct *ctp; long i; long nr; long goc; int casecmp(); bool dupcases; goc = gocnt; /* * find out the type of the case expression * even if the expression has errors (exprtype == NIL), continue. */ line = tcase[1]; codeoff(); exprtype = rvalue( (int *) tcase[2] , NIL , RREQ ); codeon(); if ( exprtype != NIL ) { if ( isnta( exprtype , "bcsi" ) ) { error("Case selectors cannot be %ss" , nameof( exprtype ) ); exprtype = NIL; } else { if ( exprtype -> class != RANGE ) { rangetype = exprtype -> type; } else { rangetype = exprtype; } if ( rangetype == NIL ) { exprtype = NIL; } else { low = rangetype -> range[0]; high = rangetype -> range[1]; } } } if ( exprtype != NIL ) { /* * compute and save the case expression. * also, put expression into a register * save its c-type and jump to the code to do the switch. */ exprctype = p2type( exprtype ); exprnlp = tmpalloc( sizeof (long) , nl + T4INT , NOREG ); putRV( 0 , cbn , exprnlp -> value[ NL_OFFS ] , exprnlp -> extra_flags , P2INT ); (void) rvalue( (int *) tcase[2] , NIL , RREQ ); putop( P2ASSIGN , P2INT ); putop( P2FORCE , P2INT ); putdot( filename , line ); swlabel = getlab(); putjbr( swlabel ); } /* * count the number of cases * and allocate table for cases, lines, and labels * default case goes in ctab[0]. */ count = 1; for ( cstatlp = tcase[3] ; cstatlp != NIL ; cstatlp = cstatlp[2] ) { cstatp = cstatlp[1]; if ( cstatp == NIL ) { continue; } for ( casep = cstatp[2] ; casep != NIL ; casep = casep[2] ) { count++; } } /* */ ctab = (struct ct *) malloc( count * sizeof( struct ct ) ); if ( ctab == (struct ct *) 0 ) { error("Ran out of memory (case)"); pexit( DIED ); } /* * pick up default label and label for after case statement. */ ctab[0].clabel = getlab(); endlabel = getlab(); /* * generate code for each case * filling in ctab for each. * nr is for error if no case falls out bottom. */ nr = 1; count = 0; for ( cstatlp = tcase[3] ; cstatlp != NIL ; cstatlp = cstatlp[2] ) { cstatp = cstatlp[1]; if ( cstatp == NIL ) { continue; } line = cstatp[1]; label = getlab(); for ( casep = cstatp[2] ; casep != NIL ; casep = casep[2] ) { gconst( casep[1] ); if( exprtype == NIL || con.ctype == NIL ) { continue; } if ( incompat( con.ctype , exprtype , NIL ) ) { cerror("Case label type clashed with case selector expression type"); continue; } if ( con.crval < low || con.crval > high ) { error("Case label out of range"); continue; } count++; ctab[ count ].cconst = con.crval; ctab[ count ].cline = line; ctab[ count ].clabel = label; } /* * put out the statement */ putlab( label ); putcnt(); level++; statement( cstatp[3] ); nr = (nr && noreach); noreach = 0; level--; if (gotos[cbn]) { ungoto(); } putjbr( endlabel ); } noreach = nr; /* * default action is to call error */ putlab( ctab[0].clabel ); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_ERROR" ); putleaf( P2ICON , ECASE , 0 , P2INT , 0 ); putRV( 0 , cbn , exprnlp -> value[ NL_OFFS ] , exprnlp -> extra_flags , P2INT ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); putdot( filename , line ); /* * sort the cases */ qsort( &ctab[1] , count , sizeof (struct ct) , casecmp ); /* * check for duplicates */ dupcases = FALSE; for ( ctp = &ctab[1] ; ctp < &ctab[ count ] ; ctp++ ) { if ( ctp[0].cconst == ctp[1].cconst ) { error("Multiply defined label in case, lines %d and %d" , ctp[0].cline , ctp[1].cline ); dupcases = TRUE; } } if ( dupcases ) { return; } /* * choose a switch algorithm and implement it: * direct switch >= 1/3 full and >= 4 cases. * binary switch not direct switch and > 8 cases. * ifthenelse not direct or binary switch. */ putlab( swlabel ); if ( ctab[ count ].cconst - ctab[1].cconst < 3 * count && count >= 4 ) { directsw( ctab , count ); } else if ( count > 8 ) { binarysw( ctab , count ); } else { itesw( ctab , count ); } putlab( endlabel ); if ( goc != gocnt ) { putcnt(); } } /* * direct switch */ directsw( ctab , count ) struct ct *ctab; int count; { int fromlabel = getlab(); long i; long j; putprintf( " casel %s,$%d,$%d" , 0 , FORCENAME , ctab[1].cconst , ctab[ count ].cconst - ctab[1].cconst ); putlab( fromlabel ); i = 1; j = ctab[1].cconst; while ( i <= count ) { if ( j == ctab[ i ].cconst ) { putprintf( " .word " , 1 ); putprintf( PREFIXFORMAT , 1 , LABELPREFIX , ctab[ i ].clabel ); putprintf( "-" , 1 ); putprintf( PREFIXFORMAT , 0 , LABELPREFIX , fromlabel ); i++; } else { putprintf( " .word " , 1 ); putprintf( PREFIXFORMAT , 1 , LABELPREFIX , ctab[ 0 ].clabel ); putprintf( "-" , 1 ); putprintf( PREFIXFORMAT , 0 , LABELPREFIX , fromlabel ); } j++; } putjbr( ctab[0].clabel ); } /* * binary switch * special case out default label and start recursion. */ binarysw( ctab , count ) struct ct *ctab; int count; { bsrecur( ctab[0].clabel , &ctab[0] , count ); } /* * recursive log( count ) search. */ bsrecur( deflabel , ctab , count ) int deflabel; struct ct *ctab; int count; { if ( count <= 0 ) { putprintf( " jbr L%d" , 0 , deflabel ); return; } else if ( count == 1 ) { putprintf( " cmpl %s,$%d" , 0 , FORCENAME , ctab[1].cconst ); putprintf( " jeql L%d" , 0 , ctab[1].clabel ); putprintf( " jbr L%d" , 0 , deflabel ); return; } else { int half = ( count + 1 ) / 2; int gtrlabel = getlab(); putprintf( " cmpl %s,$%d" , 0 , FORCENAME , ctab[ half ].cconst ); putprintf( " jgtr L%d" , 0 , gtrlabel ); putprintf( " jeql L%d" , 0 , ctab[ half ].clabel ); bsrecur( deflabel , &ctab[0] , half - 1 ); putprintf( "L%d:" , 0 , gtrlabel ); bsrecur( deflabel , &ctab[ half ] , count - half ); return; } } itesw( ctab , count ) struct ct *ctab; int count; { int i; for ( i = 1 ; i <= count ; i++ ) { putprintf( " cmpl %s,$%d" , 0 , FORCENAME , ctab[ i ].cconst ); putprintf( " jeql L%d" , 0 , ctab[ i ].clabel ); } putprintf( " jbr L%d" , 0 , ctab[0].clabel ); return; } int casecmp( this , that ) struct ct *this; struct ct *that; { if ( this -> cconst < that -> cconst ) { return -1; } else if ( this -> cconst > that -> cconst ) { return 1; } else { return 0; } } #endif PC ) struct ct *ctab; int cmd/pc0/pcfunc.c 644 0 33 23173 2552606602 6733 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)pcfunc.c 1.6 6/1/81"; #include "whoami.h" #ifdef PC /* * and to the end of the file */ #include "0.h" #include "tree.h" #include "opcode.h" #include "pc.h" #include "pcops.h" /* * Funccod generates code for * built in function calls and calls * call to generate calls to user * defined functions and procedures. */ pcfunccod( r ) int *r; { struct nl *p; register struct nl *p1; register int *al; register op; int argc, *argv; int tr[2], tr2[4]; char *funcname; struct nl *tempnlp; long temptype; struct nl *rettype; /* * Verify that the given name * is defined and the name of * a function. */ p = lookup(r[2]); if (p == NIL) { rvlist(r[3]); return (NIL); } if (p->class != FUNC && p->class != FFUNC) { error("%s is not a function", p->symbol); rvlist(r[3]); return (NIL); } argv = r[3]; /* * Call handles user defined * procedures and functions */ if (bn != 0) return (call(p, argv, FUNC, bn)); /* * Count the arguments */ argc = 0; for (al = argv; al != NIL; al = al[2]) argc++; /* * Built-in functions have * their interpreter opcode * associated with them. */ op = p->value[0] &~ NSTAND; if (opt('s') && (p->value[0] & NSTAND)) { standard(); error("%s is a nonstandard function", p->symbol); } if ( op == O_ARGC ) { putleaf( P2NAME , 0 , 0 , P2INT , "__argc" ); return nl + T4INT; } switch (op) { /* * Parameterless functions */ case O_CLCK: funcname = "_CLCK"; goto noargs; case O_SCLCK: funcname = "_SCLCK"; goto noargs; noargs: if (argc != 0) { error("%s takes no arguments", p->symbol); rvlist(argv); return (NIL); } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , funcname ); putop( P2UNARY P2CALL , P2INT ); return (nl+T4INT); case O_WCLCK: if (argc != 0) { error("%s takes no arguments", p->symbol); rvlist(argv); return (NIL); } putleaf( ((P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_time" ); putleaf( P2ICON , 0 , 0 , P2INT , 0 ); putop( P2CALL , P2INT ); return (nl+T4INT); case O_EOF: case O_EOLN: if (argc == 0) { argv = tr; tr[1] = tr2; tr2[0] = T_VAR; tr2[2] = input->symbol; tr2[1] = tr2[3] = NIL; argc = 1; } else if (argc != 1) { error("%s takes either zero or one argument", p->symbol); rvlist(argv); return (NIL); } } /* * All other functions take * exactly one argument. */ if (argc != 1) { error("%s takes exactly one argument", p->symbol); rvlist(argv); return (NIL); } /* * find out the type of the argument */ codeoff(); p1 = stkrval((int *) argv[1], NLNIL , RREQ ); codeon(); if (p1 == NIL) return (NIL); /* * figure out the return type and the funtion name */ switch (op) { case O_EXP: funcname = "_exp"; goto mathfunc; case O_SIN: funcname = "_sin"; goto mathfunc; case O_COS: funcname = "_cos"; goto mathfunc; case O_ATAN: funcname = "_atan"; goto mathfunc; case O_LN: funcname = opt('t') ? "_LN" : "_log"; goto mathfunc; case O_SQRT: funcname = opt('t') ? "_SQRT" : "_sqrt"; goto mathfunc; case O_RANDOM: funcname = "_RANDOM"; goto mathfunc; mathfunc: if (isnta(p1, "id")) { error("%s's argument must be integer or real, not %s", p->symbol, nameof(p1)); return (NIL); } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2DOUBLE , P2PTR ) , funcname ); p1 = stkrval( (int *) argv[1] , NLNIL , RREQ ); if ( isa( p1 , "i" ) ) { putop( P2SCONV , P2DOUBLE ); } putop( P2CALL , P2DOUBLE ); return nl + TDOUBLE; case O_EXPO: if (isnta( p1 , "id" ) ) { error("%s's argument must be integer or real, not %s", p->symbol, nameof(p1)); return NIL; } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_EXPO" ); p1 = stkrval( (int *) argv[1] , NLNIL , RREQ ); if ( isa( p1 , "i" ) ) { putop( P2SCONV , P2DOUBLE ); } putop( P2CALL , P2INT ); return ( nl + T4INT ); case O_UNDEF: if ( isnta( p1 , "id" ) ) { error("%s's argument must be integer or real, not %s", p->symbol, nameof(p1)); return NIL; } p1 = stkrval( (int *) argv[1] , NLNIL , RREQ ); putleaf( P2ICON , 0 , 0 , P2INT , 0 ); putop( P2COMOP , P2INT ); return ( nl + TBOOL ); case O_SEED: if (isnta(p1, "i")) { error("seed's argument must be an integer, not %s", nameof(p1)); return (NIL); } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_SEED" ); p1 = stkrval( (int *) argv[1] , NLNIL , RREQ ); putop( P2CALL , P2INT ); return nl + T4INT; case O_ROUND: case O_TRUNC: if ( isnta( p1 , "d" ) ) { error("%s's argument must be a real, not %s", p->symbol, nameof(p1)); return (NIL); } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , op == O_ROUND ? "_ROUND" : "_TRUNC" ); p1 = stkrval( (int *) argv[1] , NLNIL , RREQ ); putop( P2CALL , P2INT ); return nl + T4INT; case O_ABS2: if ( isa( p1 , "d" ) ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2DOUBLE , P2PTR ) , "_fabs" ); p1 = stkrval( (int *) argv[1] , NLNIL , RREQ ); putop( P2CALL , P2DOUBLE ); return nl + TDOUBLE; } if ( isa( p1 , "i" ) ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_abs" ); p1 = stkrval( (int *) argv[1] , NLNIL , RREQ ); putop( P2CALL , P2INT ); return nl + T4INT; } error("%s's argument must be an integer or real, not %s", p->symbol, nameof(p1)); return NIL; case O_SQR2: if ( isa( p1 , "d" ) ) { temptype = P2DOUBLE; rettype = nl + TDOUBLE; tempnlp = tmpalloc(sizeof(double), rettype, REGOK); } else if ( isa( p1 , "i" ) ) { temptype = P2INT; rettype = nl + T4INT; tempnlp = tmpalloc(sizeof(long), rettype, REGOK); } else { error("%s's argument must be an integer or real, not %s", p->symbol, nameof(p1)); return NIL; } putRV( 0 , cbn , tempnlp -> value[ NL_OFFS ] , tempnlp -> extra_flags , temptype , 0 ); p1 = rvalue( (int *) argv[1] , NLNIL , RREQ ); putop( P2ASSIGN , temptype ); putRV( 0 , cbn , tempnlp -> value[ NL_OFFS ] , tempnlp -> extra_flags , temptype , 0 ); putRV( 0 , cbn , tempnlp -> value[ NL_OFFS ] , tempnlp -> extra_flags , temptype , 0 ); putop( P2MUL , temptype ); putop( P2COMOP , temptype ); return rettype; case O_ORD2: p1 = stkrval( (int *) argv[1] , NLNIL , RREQ ); if (isa(p1, "bcis") || classify(p1) == TPTR) { return (nl+T4INT); } error("ord's argument must be of scalar type or a pointer, not %s", nameof(p1)); return (NIL); case O_SUCC2: case O_PRED2: if (isa(p1, "d")) { error("%s is forbidden for reals", p->symbol); return (NIL); } if ( isnta( p1 , "bcsi" ) ) { error("%s's argument must be of scalar type, not %s", p->symbol, nameof(p1)); return NIL; } if ( opt( 't' ) ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , op == O_SUCC2 ? "_SUCC" : "_PRED" ); p1 = stkrval( (int *) argv[1] , NLNIL , RREQ ); putleaf( P2ICON , p1 -> range[0] , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , p1 -> range[1] , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); } else { p1 = rvalue( argv[1] , NIL , RREQ ); putleaf( P2ICON , 1 , 0 , P2INT , 0 ); putop( op == O_SUCC2 ? P2PLUS : P2MINUS , P2INT ); } if ( isa( p1 , "bcs" ) ) { return p1; } else { return nl + T4INT; } case O_ODD2: if (isnta(p1, "i")) { error("odd's argument must be an integer, not %s", nameof(p1)); return (NIL); } p1 = rvalue( (int *) argv[1] , NLNIL , RREQ ); putleaf( P2ICON , 1 , 0 , P2INT , 0 ); putop( P2AND , P2INT ); return nl + TBOOL; case O_CHR2: if (isnta(p1, "i")) { error("chr's argument must be an integer, not %s", nameof(p1)); return (NIL); } if (opt('t')) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2CHAR , P2PTR ) , "_CHR" ); p1 = stkrval( (int *) argv[1] , NLNIL , RREQ ); putop( P2CALL , P2CHAR ); } else { p1 = stkrval( (int *) argv[1] , NLNIL , RREQ ); } return nl + TCHAR; case O_CARD: if (isnta(p1, "t")) { error("Argument to card must be a set, not %s", nameof(p1)); return (NIL); } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_CARD" ); p1 = stkrval( (int *) argv[1] , NLNIL , LREQ ); putleaf( P2ICON , lwidth( p1 ) , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); return nl + T2INT; case O_EOLN: if (!text(p1)) { error("Argument to eoln must be a text file, not %s", nameof(p1)); return (NIL); } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_TEOLN" ); p1 = stklval( (int *) argv[1] , NOFLAGS ); putop( P2CALL , P2INT ); return nl + TBOOL; case O_EOF: if (p1->class != FILET) { error("Argument to eof must be file, not %s", nameof(p1)); return (NIL); } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_TEOF" ); p1 = stklval( (int *) argv[1] , NOFLAGS ); putop( P2CALL , P2INT ); return nl + TBOOL; case 0: error("%s is an unimplemented 6000-3.4 extension", p->symbol); default: panic("func1"); } } #endif PC *) argv[1] , NOFLAGS ); putop( P2CALL , P2INT ); return nl + TBOOL; case O_EOF: if (p1->class != FILET) { error("Argument to eof must be file, not %s", nameof(p1)); return (NIL); } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_TEOF" ); p1 = stklval( (int *) argv[1] , NOFLAGS ); putop( P2CALL , P2INT ); return nl + TBOOL; cmd/pc0/pclval.c 644 0 33 17366 2552606602 6745 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)pclval.c 1.4 6/1/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "opcode.h" #include "objfmt.h" #ifdef PC /* * and the rest of the file */ # include "pc.h" # include "pcops.h" extern int flagwas; /* * pclvalue computes the address * of a qualified name and * leaves it on the stack. * for pc, it can be asked for either an lvalue or an rvalue. * the semantics are the same, only the code is different. * for putting out calls to check for nil and fnil, * we have to traverse the list of qualifications twice: * once to put out the calls and once to put out the address to be checked. */ struct nl * pclvalue( r , modflag , required ) int *r; int modflag; int required; { register struct nl *p; register *c, *co; int f, o; int tr[2], trp[3]; struct nl *firstp; struct nl *lastp; char *firstsymbol; char firstextra_flags; int firstbn; if ( r == NIL ) { return NIL; } if ( nowexp( r ) ) { return NIL; } if ( r[0] != T_VAR ) { error("Variable required"); /* Pass mesgs down from pt of call ? */ return NIL; } firstp = p = lookup( r[2] ); if ( p == NIL ) { return NIL; } firstsymbol = p -> symbol; firstbn = bn; firstextra_flags = p -> extra_flags; c = r[3]; if ( ( modflag & NOUSE ) && ! lptr( c ) ) { p -> nl_flags = flagwas; } if ( modflag & MOD ) { p -> nl_flags |= NMOD; } /* * Only possibilities for p -> class here * are the named classes,(( i.e. CONST, TYPE * VAR, PROC, FUNC, REF, or a WITHPTR. */ if ( p -> class == WITHPTR ) { /* * Construct the tree implied by * the with statement */ trp[0] = T_LISTPP; trp[1] = tr; trp[2] = r[3]; tr[0] = T_FIELD; tr[1] = r[2]; c = trp; } /* * this not only puts out the names of functions to call * but also does all the semantic checking of the qualifications. */ if ( ! nilfnil( p , c , modflag , firstp , r[2] ) ) { return NIL; } switch (p -> class) { case WITHPTR: case REF: /* * Obtain the indirect word * of the WITHPTR or REF * as the base of our lvalue */ putRV( firstsymbol , firstbn , p -> value[ 0 ] , firstextra_flags , p2type( p ) ); firstsymbol = 0; f = 0; /* have an lv on stack */ o = 0; break; case VAR: f = 1; /* no lv on stack yet */ o = p -> value[0]; break; default: error("%s %s found where variable required", classes[p -> class], p -> symbol); return (NIL); } /* * Loop and handle each * qualification on the name */ if ( c == NIL && ( modflag & ASGN ) && ( p -> value[ NL_FORV ] & FORVAR ) ) { error("Can't modify the for variable %s in the range of the loop", p -> symbol); return (NIL); } for ( ; c != NIL ; c = c[2] ) { co = c[1]; if ( co == NIL ) { return NIL; } lastp = p; p = p -> type; if ( p == NIL ) { return NIL; } switch ( co[0] ) { case T_PTR: /* * Pointer qualification. */ if ( f ) { putLV( firstsymbol , firstbn , o , firstextra_flags , p2type( p ) ); firstsymbol = 0; } else { if (o) { putleaf( P2ICON , o , 0 , P2INT , 0 ); putop( P2PLUS , P2PTR | P2CHAR ); } } /* * Pointer cannot be * nil and file cannot * be at end-of-file. * the appropriate function name is * already out there from nilfnil. */ if ( p -> class == PTR ) { /* * this is the indirection from * the address of the pointer * to the pointer itself. * kirk sez: * fnil doesn't want this. * and does it itself for files * since only it knows where the * actual window is. * but i have to do this for * regular pointers. */ putop( P2UNARY P2MUL , p2type( p ) ); if ( opt( 't' ) ) { putop( P2CALL , P2INT ); } } else { putop( P2CALL , P2INT ); } f = o = 0; continue; case T_ARGL: case T_ARY: if ( f ) { putLV( firstsymbol , firstbn , o , firstextra_flags , p2type( p ) ); firstsymbol = 0; } else { if (o) { putleaf( P2ICON , o , 0 , P2INT , 0 ); putop( P2PLUS , P2INT ); } } arycod( p , co[1] ); f = o = 0; continue; case T_FIELD: /* * Field names are just * an offset with some * semantic checking. */ p = reclook(p, co[1]); o += p -> value[0]; continue; default: panic("lval2"); } } if (f) { if ( required == LREQ ) { putLV( firstsymbol , firstbn , o , firstextra_flags , p2type( p -> type ) ); } else { putRV( firstsymbol , firstbn , o , firstextra_flags , p2type( p -> type ) ); } } else { if (o) { putleaf( P2ICON , o , 0 , P2INT , 0 ); putop( P2PLUS , P2INT ); } if ( required == RREQ ) { putop( P2UNARY P2MUL , p2type( p -> type ) ); } } return ( p -> type ); } /* * this recursively follows done a list of qualifications * and puts out the beginnings of calls to fnil for files * or nil for pointers (if checking is on) on the way back. * this returns true or false. */ nilfnil( p , c , modflag , firstp , r2 ) struct nl *p; int *c; int modflag; struct nl *firstp; char *r2; /* no, not r2-d2 */ { int *co; struct nl *lastp; int t; if ( c == NIL ) { return TRUE; } co = (int *) ( c[1] ); if ( co == NIL ) { return FALSE; } lastp = p; p = p -> type; if ( p == NIL ) { return FALSE; } switch ( co[0] ) { case T_PTR: /* * Pointer qualification. */ lastp -> nl_flags |= NUSED; if ( p -> class != PTR && p -> class != FILET) { error("^ allowed only on files and pointers, not on %ss", nameof(p)); goto bad; } break; case T_ARGL: if ( p -> class != ARRAY ) { if ( lastp == firstp ) { error("%s is a %s, not a function", r2, classes[firstp -> class]); } else { error("Illegal function qualificiation"); } return FALSE; } recovered(); error("Pascal uses [] for subscripting, not ()"); /* and fall through */ case T_ARY: if ( p -> class != ARRAY ) { error("Subscripting allowed only on arrays, not on %ss", nameof(p)); goto bad; } codeoff(); t = arycod( p , co[1] ); codeon(); switch ( t ) { case 0: return FALSE; case -1: goto bad; } break; case T_FIELD: /* * Field names are just * an offset with some * semantic checking. */ if ( p -> class != RECORD ) { error(". allowed only on records, not on %ss", nameof(p)); goto bad; } if ( co[1] == NIL ) { return FALSE; } p = reclook( p , co[1] ); if ( p == NIL ) { error("%s is not a field in this record", co[1]); goto bad; } if ( modflag & MOD ) { p -> nl_flags |= NMOD; } if ( ( modflag & NOUSE ) == 0 || lptr( c[2] ) ) { p -> nl_flags |= NUSED; } break; default: panic("nilfnil"); } /* * recursive call, check the rest of the qualifications. */ if ( ! nilfnil( p , c[2] , modflag , firstp , r2 ) ) { return FALSE; } /* * the point of all this. */ if ( co[0] == T_PTR ) { if ( p -> class == PTR ) { if ( opt( 't' ) ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_NIL" ); } } else { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_FNIL" ); } } return TRUE; bad: cerror("Error occurred on qualification of %s", r2); return FALSE; } #endif PC ! nilfnil( p , c[2] , modflag , firstp , r2 ) ) { return FALSE; } /* * the point of all this. */ if ( co[0] == T_PTR ) { if ( p -> class == PTR ) { if ( opt( 't' ) ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , Pcmd/pc0/pcops.h 644 0 33 5754 2552606602 6573 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)pcops.h 1.1 8/27/80"; */ /* * tree node operators */ #define P2UNDEFINED 1 #define P2NAME 2 #define P2STRING 3 #define P2ICON 4 #define P2FCON 5 #define P2PLUS 6 #define P2MINUS 8 /* also unary == P2NEG */ #define P2MUL 11 /* also unary == P2INDIRECT */ #define P2AND 14 /* also unary */ #define P2OR 17 #define P2ER 19 #define P2QUEST 21 #define P2COLON 22 #define P2ANDAND 23 #define P2OROR 24 /* * yacc operator classes, reserved words, little symbols, etc. * operators 25 .. 57 not used, except 56 */ #define P2LISTOP 56 #define P2ASSIGN 58 #define P2COMOP 59 #define P2DIV 60 #define P2MOD 62 #define P2LS 64 #define P2RS 66 #define P2DOT 68 #define P2STREF 69 #define P2CALL 70 /* also unary */ #define P2FORTCALL 73 /* also unary */ #define P2NOT 76 #define P2COMPL 77 #define P2INCR 78 #define P2DECR 79 #define P2EQ 80 #define P2NE 81 #define P2LE 82 #define P2LT 83 #define P2GE 84 #define P2GT 85 #define P2ULE 86 #define P2ULT 87 #define P2UGE 88 #define P2UGT 89 #define P2SETBIT 90 #define P2TESTBIT 91 #define P2RESETBIT 92 #define P2ARS 93 #define P2REG 94 #define P2OREG 95 #define P2CCODES 96 #define P2FREE 97 #define P2STASG 98 #define P2STARG 99 #define P2STCALL 100 /* also unary */ /* * some conversion operators */ #define P2FLD 103 #define P2SCONV 104 #define P2PCONV 105 #define P2PMCONV 106 #define P2PVCONV 107 /* * special node operators, used for special contexts */ #define P2FORCE 108 #define P2CBRANCH 109 #define P2INIT 110 #define P2CAST 111 /* * prefix unary operator modifier */ #define P2ASG 1+ #define P2UNARY 2+ /* * these borrowed from /usr/src/cmd/mip/fort.c * to use the binary interface. * only FTEXT, FEXPR, FLBRAC, FRBRAC, and FEOF are used */ #define P2FTEXT 200 #define P2FEXPR 201 #define P2FLBRAC 203 #define P2FRBRAC 204 #define P2FEOF 205 /* * type names */ #define P2UNDEF 0 #define P2FARG 1 #define P2CHAR 2 #define P2SHORT 3 #define P2INT 4 /* this is also used for booleans */ #define P2LONG 5 /* don't use these, the second pass chokes */ #define P2FLOAT 6 #define P2DOUBLE 7 #define P2STRTY 8 #define P2UNIONTY 9 #define P2ENUMTY 10 #define P2MOETY 11 #define P2UCHAR 12 #define P2USHORT 13 #define P2UNSIGNED 14 #define P2ULONG 15 /* * type modifiers */ #define P2PTR 020 #define P2FTN 040 #define P2ARY 060 /* * see the comment for p2type for an explanation of c type words */ #define P2BASETYPE 017 #define P2TYPESHIFT 2 /* * add a most significant type modifier, m, to a type, t */ #define ADDTYPE( t,m ) ( ( ( ( t ) & ~P2BASETYPE ) << P2TYPESHIFT ) \ | ( m ) \ | ( ( t ) & P2BASETYPE ) ) /* * the runtime framepointer and argumentpointer registers */ #define P2FP 13 #define P2FPNAME "fp" #define P2AP 12 #define P2APNAME "ap" 2FTN 040 #define P2((cmd/pc0/pcproc.c 644 0 33 107570 2552606603 6770 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)pcproc.c 1.6 6/1/81"; #include "whoami.h" #ifdef PC /* * and to the end of the file */ #include "0.h" #include "tree.h" #include "opcode.h" #include "pc.h" #include "pcops.h" /* * The following array is used to determine which classes may be read * from textfiles. It is indexed by the return value from classify. */ #define rdops(x) rdxxxx[(x)-(TFIRST)] int rdxxxx[] = { 0, /* -7 file types */ 0, /* -6 record types */ 0, /* -5 array types */ O_READE, /* -4 scalar types */ 0, /* -3 pointer types */ 0, /* -2 set types */ 0, /* -1 string types */ 0, /* 0 nil, no type */ O_READE, /* 1 boolean */ O_READC, /* 2 character */ O_READ4, /* 3 integer */ O_READ8 /* 4 real */ }; /* * Proc handles procedure calls. * Non-builtin procedures are "buck-passed" to func (with a flag * indicating that they are actually procedures. * builtin procedures are handled here. */ pcproc(r) int *r; { register struct nl *p; register int *alv, *al, op; struct nl *filetype, *ap; int argc, *argv, typ, fmtspec, strfmt, stkcnt, *file; char fmt, format[20], *strptr; int prec, field, strnglen, fmtlen, fmtstart, pu; int *pua, *pui, *puz; int i, j, k; int itemwidth; char *readname; struct nl *tempnlp; long readtype; struct tmps soffset; #define CONPREC 4 #define VARPREC 8 #define CONWIDTH 1 #define VARWIDTH 2 #define SKIP 16 /* * Verify that the name is * defined and is that of a * procedure. */ p = lookup(r[2]); if (p == NIL) { rvlist(r[3]); return; } if (p->class != PROC && p->class != FPROC) { error("Can't call %s, its %s not a procedure", p->symbol, classes[p->class]); rvlist(r[3]); return; } argv = r[3]; /* * Call handles user defined * procedures and functions. */ if (bn != 0) { call(p, argv, PROC, bn); return; } /* * Call to built-in procedure. * Count the arguments. */ argc = 0; for (al = argv; al != NIL; al = al[2]) argc++; /* * Switch on the operator * associated with the built-in * procedure in the namelist */ op = p->value[0] &~ NSTAND; if (opt('s') && (p->value[0] & NSTAND)) { standard(); error("%s is a nonstandard procedure", p->symbol); } switch (op) { case O_ABORT: if (argc != 0) error("null takes no arguments"); return; case O_FLUSH: if (argc == 0) { putleaf( P2ICON , 0 , 0 , P2INT , "_PFLUSH" ); putop( P2UNARY P2CALL , P2INT ); putdot( filename , line ); return; } if (argc != 1) { error("flush takes at most one argument"); return; } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_FLUSH" ); ap = stklval(argv[1], NOFLAGS); if (ap == NIL) return; if (ap->class != FILET) { error("flush's argument must be a file, not %s", nameof(ap)); return; } putop( P2CALL , P2INT ); putdot( filename , line ); return; case O_MESSAGE: case O_WRITEF: case O_WRITLN: /* * Set up default file "output"'s type */ file = NIL; filetype = nl+T1CHAR; /* * Determine the file implied * for the write and generate * code to make it the active file. */ if (op == O_MESSAGE) { /* * For message, all that matters * is that the filetype is * a character file. * Thus "output" will suit us fine. */ putleaf( P2ICON , 0 , 0 , P2INT , "_PFLUSH" ); putop( P2UNARY P2CALL , P2INT ); putdot( filename , line ); putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putLV( "__err" , 0 , 0 , NGLOBAL , P2PTR|P2STRTY ); putop( P2ASSIGN , P2PTR|P2STRTY ); putdot( filename , line ); } else if (argv != NIL && (al = argv[1])[0] != T_WEXP) { /* * If there is a first argument which has * no write widths, then it is potentially * a file name. */ codeoff(); ap = stkrval(argv[1], NIL , RREQ ); codeon(); if (ap == NIL) argv = argv[2]; if (ap != NIL && ap->class == FILET) { /* * Got "write(f, ...", make * f the active file, and save * it and its type for use in * processing the rest of the * arguments to write. */ putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_UNIT" ); file = argv[1]; filetype = ap->type; stklval(argv[1], NOFLAGS); putop( P2CALL , P2INT ); putop( P2ASSIGN , P2PTR|P2STRTY ); putdot( filename , line ); /* * Skip over the first argument */ argv = argv[2]; argc--; } else { /* * Set up for writing on * standard output. */ putRV( 0, cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putLV( "_output" , 0 , 0 , NGLOBAL , P2PTR|P2STRTY ); putop( P2ASSIGN , P2PTR|P2STRTY ); putdot( filename , line ); } } else { putRV( 0, cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putLV( "_output" , 0 , 0 , NGLOBAL , P2PTR|P2STRTY ); putop( P2ASSIGN , P2PTR|P2STRTY ); putdot( filename , line ); } /* * Loop and process each * of the arguments. */ for (; argv != NIL; argv = argv[2]) { /* * fmtspec indicates the type (CONstant or VARiable) * and number (none, WIDTH, and/or PRECision) * of the fields in the printf format for this * output variable. * stkcnt is the number of longs pushed on the stack * fmt is the format output indicator (D, E, F, O, X, S) * fmtstart = 0 for leading blank; = 1 for no blank */ fmtspec = NIL; stkcnt = 0; fmt = 'D'; fmtstart = 1; al = argv[1]; if (al == NIL) continue; if (al[0] == T_WEXP) alv = al[1]; else alv = al; if (alv == NIL) continue; codeoff(); ap = stkrval(alv, NIL , RREQ ); codeon(); if (ap == NIL) continue; typ = classify(ap); if (al[0] == T_WEXP) { /* * Handle width expressions. * The basic game here is that width * expressions get evaluated. If they * are constant, the value is placed * directly in the format string. * Otherwise the value is pushed onto * the stack and an indirection is * put into the format string. */ if (al[3] == OCT) fmt = 'O'; else if (al[3] == HEX) fmt = 'X'; else if (al[3] != NIL) { /* * Evaluate second format spec */ if ( constval(al[3]) && isa( con.ctype , "i" ) ) { fmtspec += CONPREC; prec = con.crval; } else { fmtspec += VARPREC; } fmt = 'f'; switch ( typ ) { case TINT: if ( opt( 's' ) ) { standard(); error("Writing %ss with two write widths is non-standard", clnames[typ]); } /* and fall through */ case TDOUBLE: break; default: error("Cannot write %ss with two write widths", clnames[typ]); continue; } } /* * Evaluate first format spec */ if (al[2] != NIL) { if ( constval(al[2]) && isa( con.ctype , "i" ) ) { fmtspec += CONWIDTH; field = con.crval; } else { fmtspec += VARWIDTH; } } if ((fmtspec & CONPREC) && prec < 0 || (fmtspec & CONWIDTH) && field < 0) { error("Negative widths are not allowed"); continue; } if ( opt('s') && ((fmtspec & CONPREC) && prec == 0 || (fmtspec & CONWIDTH) && field == 0)) { standard(); error("Zero widths are non-standard"); } } if (filetype != nl+T1CHAR) { if (fmt == 'O' || fmt == 'X') { error("Oct/hex allowed only on text files"); continue; } if (fmtspec) { error("Write widths allowed only on text files"); continue; } /* * Generalized write, i.e. * to a non-textfile. */ putleaf( P2ICON , 0 , 0 , ADDTYPE( ADDTYPE( ADDTYPE( p2type( filetype ) , P2PTR ) , P2FTN ) , P2PTR ) , "_FNIL" ); stklval(file, NOFLAGS); putop( P2CALL , ADDTYPE( p2type( filetype ) , P2PTR ) ); putop( P2UNARY P2MUL , p2type( filetype ) ); /* * file^ := ... */ switch ( classify( filetype ) ) { case TBOOL: case TCHAR: case TINT: case TSCAL: precheck( filetype , "_RANG4" , "_RSGN4" ); /* and fall through */ case TDOUBLE: case TPTR: ap = rvalue( argv[1] , filetype , RREQ ); break; default: ap = rvalue( argv[1] , filetype , LREQ ); break; } if (ap == NIL) continue; if (incompat(ap, filetype, argv[1])) { cerror("Type mismatch in write to non-text file"); continue; } switch ( classify( filetype ) ) { case TBOOL: case TCHAR: case TINT: case TSCAL: postcheck( filetype ); /* and fall through */ case TDOUBLE: case TPTR: putop( P2ASSIGN , p2type( filetype ) ); putdot( filename , line ); break; default: putstrop( P2STASG , p2type( filetype ) , lwidth( filetype ) , align( filetype ) ); putdot( filename , line ); break; } /* * put(file) */ putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_PUT" ); putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putop( P2CALL , P2INT ); putdot( filename , line ); continue; } /* * Write to a textfile * * Evaluate the expression * to be written. */ if (fmt == 'O' || fmt == 'X') { if (opt('s')) { standard(); error("Oct and hex are non-standard"); } if (typ == TSTR || typ == TDOUBLE) { (( error("Can't write %ss with oct/hex", clnames[typ]); continue; } if (typ == TCHAR || typ == TBOOL) typ = TINT; } /* * If there is no format specified by the programmer, * implement the default. */ switch (typ) { case TINT: if (fmt == 'f') { typ = TDOUBLE; goto tdouble; } if (fmtspec == NIL) { if (fmt == 'D') field = 10; else if (fmt == 'X') field = 8; else if (fmt == 'O') field = 11; else panic("fmt1"); fmtspec = CONWIDTH; } break; case TCHAR: tchar: fmt = 'c'; break; case TSCAL: warning(); if (opt('s')) { standard(); } error("Writing scalars to text files is non-standard"); case TBOOL: fmt = 's'; break; case TDOUBLE: tdouble: switch (fmtspec) { case NIL: field = 21; prec = 14; fmt = 'e'; fmtspec = CONWIDTH + CONPREC; break; case CONWIDTH: if (--field < 1) field = 1; prec = field - 7; if (prec < 1) prec = 1; fmtspec += CONPREC; fmt = 'e'; break; case VARWIDTH: fmtspec += VARPREC; fmt = 'e'; break; case CONWIDTH + CONPREC: case CONWIDTH + VARPREC: if (--field < 1) field = 1; } format[0] = ' '; fmtstart = 0; break; case TSTR: constval( alv ); switch ( classify( con.ctype ) ) { case TCHAR: typ = TCHAR; goto tchar; case TSTR: strptr = con.cpval; for (strnglen = 0; *strptr++; strnglen++) /* void */; strptr = con.cpval; break; default: strnglen = width(ap); break; } fmt = 's'; strfmt = fmtspec; if (fmtspec == NIL) { fmtspec = SKIP; break; } if (fmtspec & CONWIDTH) { if (field <= strnglen) fmtspec = SKIP; else field -= strnglen; } break; default: error("Can't write %ss to a text file", clnames[typ]); continue; } /* * Generate the format string */ switch (fmtspec) { default: panic("fmt2"); case NIL: if (fmt == 'c') { if ( opt( 't' ) ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN|P2INT , P2PTR ) , "_WRITEC" ); putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); stkrval( alv , NIL , RREQ ); putop( P2LISTOP , P2INT ); } else { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN|P2INT , P2PTR ) , "_fputc" ); stkrval( alv , NIL , RREQ ); } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_ACTFILE" ); putRV( 0, cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putop( P2CALL , P2INT ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); putdot( filename , line ); } else { sprintf(&format[1], "%%%c", fmt); goto fmtgen; } case SKIP: break; case CONWIDTH: sprintf(&format[1], "%%%1D%c", field, fmt); goto fmtgen; case VARWIDTH: sprintf(&format[1], "%%*%c", fmt); goto fmtgen; case CONWIDTH + CONPREC: sprintf(&format[1], "%%%1D.%1D%c", field, prec, fmt); goto fmtgen; case CONWIDTH + VARPREC: sprintf(&format[1], "%%%1D.*%c", field, fmt); goto fmtgen; case VARWIDTH + CONPREC: sprintf(&format[1], "%%*.%1D%c", prec, fmt); goto fmtgen; case VARWIDTH + VARPREC: sprintf(&format[1], "%%*.*%c", fmt); fmtgen: if ( opt( 't' ) ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_WRITEF" ); putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_ACTFILE" ); putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putop( P2CALL , P2INT ); putop( P2LISTOP , P2INT ); } else { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_fprintf" ); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_ACTFILE" ); putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putop( P2CALL , P2INT ); } putCONG( &format[ fmtstart ] , strlen( &format[ fmtstart ] ) , LREQ ); putop( P2LISTOP , P2INT ); if ( fmtspec & VARWIDTH ) { /* * either * ,(temp=width,MAX(temp,...)), * or * , MAX( width , ... ) , */ if ( ( typ == TDOUBLE && al[3] == NIL ) || typ == TSTR ) { soffset = sizes[cbn].curtmps; tempnlp = tmpalloc(sizeof(long), nl+T4INT, REGOK); putRV( 0 , cbn , tempnlp -> value[ NL_OFFS ] , tempnlp -> extra_flags , P2INT ); ap = stkrval( al[2] , NIL , RREQ ); putop( P2ASSIGN , P2INT ); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_MAX" ); putRV( 0 , cbn , tempnlp -> value[ NL_OFFS ] , tempnlp -> extra_flags , P2INT ); } else { if (opt('t') || typ == TSTR || typ == TDOUBLE) { putleaf( P2ICON , 0 , 0 ,ADDTYPE( P2FTN | P2INT, P2PTR ) ,"_MAX" ); } ap = stkrval( al[2] , NIL , RREQ ); } if (ap == NIL) continue; if (isnta(ap,"i")) { error("First write width must be integer, not %s", nameof(ap)); continue; } switch ( typ ) { case TDOUBLE: putleaf( P2ICON , 1 , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , 1 , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); if ( al[3] == NIL ) { /* * finish up the comma op */ putop( P2COMOP , P2INT ); fmtspec &= ~VARPREC; putop( P2LISTOP , P2INT ); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_MAX" ); putRV( 0 , cbn , tempnlp -> value[ NL_OFFS ] , tempnlp -> extra_flags , P2INT ); tmpfree(&soffset); putleaf( P2ICON , 8 , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , 1 , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); } putop( P2LISTOP , P2INT ); break; case TSTR: putleaf( P2ICON , strnglen , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , 0 , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); putop( P2COMOP , P2INT ); putop( P2LISTOP , P2INT ); break; default: if (opt('t')) { putleaf( P2ICON , 0 , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , 0 , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); } putop( P2LISTOP , P2INT ); break; } } /* * If there is a variable precision, * evaluate it */ if (fmtspec & VARPREC) { if (opt('t')) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_MAX" ); } ap = stkrval( al[3] , NIL , RREQ ); if (ap == NIL) continue; if (isnta(ap,"i")) { error("Second write width must be integer, not %s", nameof(ap)); continue; } if (opt('t')) { putleaf( P2ICON , 0 , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , 0 , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); } putop( P2LISTOP , P2INT ); } /* * evaluate the thing we want printed. */ switch ( typ ) { case TCHAR: case TINT: stkrval( alv , NIL , RREQ ); putop( P2LISTOP , P2INT ); break; case TDOUBLE: ap = stkrval( alv , NIL , RREQ ); if ( isnta( ap , "d" ) ) { putop( P2SCONV , P2DOUBLE ); } putop( P2LISTOP , P2INT ); break; case TSCAL: case TBOOL: putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_NAM" ); ap = stkrval( alv , NIL , RREQ ); sprintf( format , PREFIXFORMAT , LABELPREFIX , listnames( ap ) ); putleaf( P2ICON , 0 , 0 , P2PTR | P2CHAR , format ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); putop( P2LISTOP , P2INT ); break; case TSTR: putCONG( "" , 0 , LREQ ); putop( P2LISTOP , P2INT ); break; } putop( P2CALL , P2INT ); putdot( filename , line ); } /* * Write the string after its blank padding */ if (typ == TSTR ) { if ( opt( 't' ) ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_WRITES" ); putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); ap = stkrval(alv, NIL , RREQ ); putop( P2LISTOP , P2INT ); } else { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_fwrite" ); ap = stkrval(alv, NIL , RREQ ); } if (strfmt & VARWIDTH) { /* * min, inline expanded as * temp < len ? temp : len */ putRV( 0 , cbn , tempnlp -> value[ NL_OFFS ] , tempnlp -> extra_flags , P2INT ); putleaf( P2ICON , strnglen , 0 , P2INT , 0 ); putop( P2LT , P2INT ); putRV( 0 , cbn , tempnlp -> value[ NL_OFFS ] , tempnlp -> extra_flags , P2INT ); putleaf( P2ICON , strnglen , 0 , P2INT , 0 ); putop( P2COLON , P2INT ); putop( P2QUEST , P2INT ); tmpfree(&soffset); } else { if ( ( fmtspec & SKIP ) && ( strfmt & CONWIDTH ) ) { strnglen = field; } putleaf( P2ICON , strnglen , 0 , P2INT , 0 ); } putop( P2LISTOP , P2INT ); putleaf( P2ICON , 1 , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_ACTFILE" ); putRV( 0, cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putop( P2CALL , P2INT ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); putdot( filename , line ); } } /* * Done with arguments((. * Handle writeln and * insufficent number of args. */ switch (p->value[0] &~ NSTAND) { case O_WRITEF: if (argc == 0) error("Write requires an argument"); break; case O_MESSAGE: if (argc == 0) error("Message requires an argument"); case O_WRITLN: if (filetype != nl+T1CHAR) error("Can't 'writeln' a non text file"); if ( opt( 't' ) ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_WRITLN" ); putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); } else { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_fputc" ); putleaf( P2ICON , '\n' , 0 , P2CHAR , 0 ); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_ACTFILE" ); putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putop( P2CALL , P2INT ); putop( P2LISTOP , P2INT ); } putop( P2CALL , P2INT ); putdot( filename , line ); break; } return; case O_READ4: case O_READLN: /* * Set up default * file "input". */ file = NIL; filetype = nl+T1CHAR; /* * Determine the file implied * for the read and generate * code to make it the active file. */ if (argv != NIL) { codeoff(); ap = stkrval(argv[1], NIL , RREQ ); codeon(); if (ap == NIL) argv = argv[2]; if (ap != NIL && ap->class == FILET) { /* * Got "read(f, ...", make * f the active file, and save * it and its type for use in * processing the rest of the * arguments to read. */ file = argv[1]; filetype = ap->type; putRV( 0, cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_UNIT" ); stklval(argv[1], NOFLAGS); putop( P2CALL , P2INT ); putop( P2ASSIGN , P2PTR|P2STRTY ); putdot( filename , line ); argv = argv[2]; argc--; } else { /* * Default is read from * standard input. */ putRV( 0, cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putLV( "_input" , 0 , 0 , NGLOBAL , P2PTR|P2STRTY ); putop( P2ASSIGN , P2PTR|P2STRTY ); putdot( filename , line ); input->nl_flags |= NUSED; } } else { putRV( 0, cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putLV( "_input" , 0 , 0 , NGLOBAL , P2PTR|P2STRTY ); putop( P2ASSIGN , P2PTR|P2STRTY ); putdot( filename , line ); input->nl_flags |= NUSED; } /* * Loop and process each * of the arguments. */ for (; argv != NIL; argv = argv[2]) { /* * Get the address of the target * on the stack. */ al = argv[1]; if (al == NIL) continue; if (al[0] != T_VAR) { error("Arguments to %s must be variables, not expressions", p->symbol); continue; } codeoff(); ap = stklval(al, MOD|ASGN|NOUSE); codeon(); if (ap == NIL) continue; if (filetype != nl+T1CHAR) { /* * Generalized read, i.e. * from a non-textfile. */ if (incompat(filetype, ap, argv[1] )) { error("Type mismatch in read from non-text file"); continue; } /* * var := file ^; */ ap = lvalue( al , MOD | ASGN | NOUSE , RREQ ); if ( isa( ap , "bsci" ) ) { precheck( ap , "_RANG4" , "_RSNG4" ); } putleaf( P2ICON , 0 , 0 , ADDTYPE( ADDTYPE( ADDTYPE( p2type( filetype ) , P2PTR ) , P2FTN ) , P2PTR ) , "_FNIL" ); if (file != NIL) stklval(file, NOFLAGS); else /* Magic */ putRV( "_input" , 0 , 0 , NGLOBAL , P2PTR | P2STRTY ); putop( P2CALL , P2INT ); switch ( classify( filetype ) ) { case TBOOL: case TCHAR: case TINT: case TSCAL: case TDOUBLE: case TPTR: putop( P2UNARY P2MUL , p2type( filetype ) ); } switch ( classify( filetype ) ) { case TBOOL: case TCHAR: case TINT: case TSCAL: postcheck( ap ); /* and fall through */ case TDOUBLE: case TPTR: putop( P2ASSIGN , p2type( ap ) ); putdot( filename , line ); break; default: putstrop( P2STASG , p2type( ap ) , lwidth( ap ) , align( ap ) ); putdot( filename , line ); break; } /* * get(file); */ putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_GET" ); putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putop( P2CALL , P2INT ); putdot( filename , line ); continue; } /* * if you get to here, you are reading from * a text file. only possiblities are: * character, integer, real, or scalar. * read( f , foo , ... ) is done as * foo := read( f ) with rangechecking * if appropriate. */ typ = classify(ap); op = rdops(typ); if (op == NIL) { error("Can't read %ss from a text file", clnames[typ]); continue; } /* * left hand side of foo := read( f ) */ ap = lvalue( al , MOD|ASGN|NOUSE , RREQ ); if ( isa( ap , "bsci" ) ) { precheck( ap , "_RANG4" , "_RSNG4" ); } switch ( op ) { case O_READC: readname = "_READC"; readtype = P2INT; break; case O_READ4: readname = "_READ4"; readtype = P2INT; break; case O_READ8: readname = "_READ8"; readtype = P2DOUBLE; break; case O_READE: readname = "_READE"; readtype = P2INT; break; } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | readtype , P2PTR ) , readname ); putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); if ( op == O_READE ) { sprintf( format , PREFIXFORMAT , LABELPREFIX , listnames( ap ) ); putleaf( P2ICON , 0 , 0 , P2PTR | P2CHAR , format ); putop( P2LISTOP , P2INT ); warning(); if (opt('s')) { standard(); } error("Reading scalars from text files is non-standard"); } putop( P2CALL , readtype ); if ( isa( ap , "bcsi" ) ) { postcheck( ap ); } putop( P2ASSIGN , p2type( ap ) ); putdot( filename , line ); } /* * Done with arguments. * Handle readln and * insufficient number of args. */ if (p->value[0] == O_READLN) { if (filetype != nl+T1CHAR) error("Can't 'readln' a non text file"); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_READLN" ); putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putop( P2CALL , P2INT ); putdot( filename , line ); } else if (argc == 0) error("read requires an argument"); return; case O_GET: case O_PUT: if (argc != 1) { error("%s expects one argument", p->symbol); return; } putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_UNIT" ); ap = stklval(argv[1], NOFLAGS); if (ap == NIL) return; if (ap->class != FILET) { error("Argument to %s must be a file, not %s", p->symbol, nameof(ap)); return; } putop( P2CALL , P2INT ); putop( P2ASSIGN , P2PTR|P2STRTY ); putdot( filename , line ); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , op == O_GET ? "_GET" : "_PUT" ); putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putop( P2CALL , P2INT ); putdot( filename , line ); return; case O_RESET: case O_REWRITE: if (argc == 0 || argc > 2) { error("%s expects one or two arguments", p->symbol); return; } if (opt('s') && argc == 2) { standard(); error("Two argument forms of reset and rewrite are non-standard"); } putleaf( P2ICON , 0 , 0 , P2INT , op == O_RESET ? "_RESET" : "_REWRITE" ); ap = stklval(argv[1], MOD|NOUSE); if (ap == NIL) return; if (ap->class != FILET) { error("First argument to %s must be a file, not %s", p->symbol, nameof(ap)); return; } if (argc == 2) { /* * Optional second argument * is a string name of a * UNIX (R) file to be associated. */ al = argv[2]; al = stkrval(al[1], NOFLAGS , RREQ ); if (al == NIL) return; if (classify(al) != TSTR) { error("Second argument to %s must be a string, not %s", p->symbol, nameof(al)); return; } strnglen = width(al); } else { putleaf( P2ICON , 0 , 0 , P2INT , 0 ); strnglen = 0; } putop( P2LISTOP , P2INT ); putleaf( P2ICON , strnglen , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , text(ap) ? 0: width(ap->type) , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); putdot( filename , line ); return; case O_NEW: case O_DISPOSE: if (argc == 0) { error("%s expects at least one argument", p->symbol); return; } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , op == O_DISPOSE ? "_DISPOSE" : opt('t') ? "_NEWZ" : "_NEW" ); ap = stklval(argv[1], op == O_NEW ? ( MOD | NOUSE ) : MOD ); if (ap == NIL) return; if (ap->class != PTR) { error("(First) argument to %s must be a pointer, not %s", p->symbol, nameof(ap)); return; } ap = ap->type; if (ap == NIL) return; argv = argv[2]; if (argv != NIL) { if (ap->class != RECORD) { error("Record required when specifying variant tags"); return; } for (; argv != NIL; argv = argv[2]) { if (ap->ptr[NL_VARNT] == NIL) { error("Too many tag fields"); return; } if (!isconst(argv[1])) { error("Second and successive arguments to %s must be constants", p->symbol); return; } gconst(argv[1]); if (con.ctype == NIL) return; if (incompat(con.ctype, (ap->ptr[NL_TAG])->type , NIL )) { cerror("Specified tag constant type clashed with variant case selector type"); return; } for (ap = ap->ptr[NL_VARNT]; ap != NIL; ap = ap->chain) if (ap->range[0] == con.crval) break; if (ap == NIL) { error("No variant case label value equals specified constant value"); return; } ap = ap->ptr[NL_VTOREC]; } } putleaf( P2ICON , width( ap ) , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); putdot((( filename , line ); return; case O_DATE: case O_TIME: if (argc != 1) { error("%s expects one argument", p->symbol); return; } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , op == O_DATE ? "_DATE" : "_TIME" ); ap = stklval(argv[1], MOD|NOUSE); if (ap == NIL) return; if (classify(ap) != TSTR || width(ap) != 10) { error("Argument to %s must be a alfa, not %s", p->symbol, nameof(ap)); return; } putop( P2CALL , P2INT ); putdot( filename , line ); return; case O_HALT: if (argc != 0) { error("halt takes no arguments"); return; } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_HALT" ); putop( P2UNARY P2CALL , P2INT ); putdot( filename , line ); noreach = 1; return; case O_ARGV: if (argc != 2) { error("argv takes two arguments"); return; } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_ARGV" ); ap = stkrval(argv[1], NIL , RREQ ); if (ap == NIL) return; if (isnta(ap, "i")) { error("argv's first argument must be an integer, not %s", nameof(ap)); return; } al = argv[2]; ap = stklval(al[1], MOD|NOUSE); if (ap == NIL) return; if (classify(ap) != TSTR) { error("argv's second argument must be a string, not %s", nameof(ap)); return; } putop( P2LISTOP , P2INT ); putleaf( P2ICON , width( ap ) , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); putdot( filename , line ); return; case O_STLIM: if (argc != 1) { error("stlimit requires one argument"); return; } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_STLIM" ); ap = stkrval(argv[1], NIL , RREQ ); if (ap == NIL) return; if (isnta(ap, "i")) { error("stlimit's argument must be an integer, not %s", nameof(ap)); return; } putop( P2CALL , P2INT ); putdot( filename , line ); return; case O_REMOVE: if (argc != 1) { error("remove expects one argument"); return; } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_REMOVE" ); ap = stkrval(argv[1], NOFLAGS , RREQ ); if (ap == NIL) return; if (classify(ap) != TSTR) { error("remove's argument must be a string, not %s", nameof(ap)); return; } putleaf( P2ICON , width( ap ) , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); putdot( filename , line ); return; case O_LLIMIT: if (argc != 2) { error("linelimit expects two arguments"); return; } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_LLIMIT" ); ap = stklval(argv[1], NOFLAGS|NOUSE); if (ap == NIL) return; if (!text(ap)) { error("linelimit's first argument must be a text file, not %s", nameof(ap)); return; } al = argv[2]; ap = stkrval(al[1], NIL , RREQ ); if (ap == NIL) return; if (isnta(ap, "i")) { error("linelimit's second argument must be an integer, not %s", nameof(ap)); return; } putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); putdot( filename , line ); return; case O_PAGE: if (argc != 1) { error("page expects one argument"); return; } putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_UNIT" ); ap = stklval(argv[1], NOFLAGS); if (ap == NIL) return; if (!text(ap)) { error("Argument to page must be a text file, not %s", nameof(ap)); return; } putop( P2CALL , P2INT ); putop( P2ASSIGN , P2PTR|P2STRTY ); putdot( filename , line ); if ( opt( 't' ) ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_PAGE" ); putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); } else { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_fputc" ); putleaf( P2ICON , '\f' , 0 , P2CHAR , 0 ); putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_ACTFILE" ); putRV( 0 , cbn , CURFILEOFFSET , NLOCAL , P2PTR|P2STRTY ); putop( P2CALL , P2INT ); putop( P2LISTOP , P2INT ); } putop( P2CALL , P2INT ); putdot( filename , line ); return; case O_PACK: if (argc != 3) { error("pack expects three arguments"); return; } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_PACK" ); pu = "pack(a,i,z)"; pua = (al = argv)[1]; pui = (al = al[2])[1]; puz = (al = al[2])[1]; goto packunp; case O_UNPACK: if (argc != 3) { error("unpack expects three arguments"); return; } putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_UNPACK" ); pu = "unpack(z,a,i)"; puz = (al = argv)[1]; pua = (al = al[2])[1]; pui = (al = al[2])[1]; packunp: ap = stkrval((int *) pui, NLNIL , RREQ ); if (ap == NIL) return; ap = stklval(pua, op == O_PACK ? NOFLAGS : MOD|NOUSE); if (ap == NIL) return; if (ap->class != ARRAY) { error("%s requires a to be an unpacked array, not %s", pu, nameof(ap)); return; } putop( P2LISTOP , P2INT ); al = (struct nl *) stklval(puz, op == O_UNPACK ? NOFLAGS : MOD|NOUSE); if (al->class != ARRAY) { error("%s requires z to be a packed array, not %s", pu, nameof(ap)); return; } if (al->type == NIL || ap->type == NIL) return; if (al->type != ap->type) { error("%s requires a and z to be arrays of the same type", pu, nameof(ap)); return; } putop( P2LISTOP , P2INT ); k = width(al); itemwidth = width(ap->type); ap = ap->chain; al = al->chain; if (ap->chain != NIL || al->chain != NIL) { error("%s requires a and z to be single dimension arrays", pu); return; } if (ap == NIL || al == NIL) return; /* * al is the range for z i.e. u..v * ap is the range for a i.e. m..n * i will be n-m+1 * j will be v-u+1 */ i = ap->range[1] - ap->range[0] + 1; j = al->range[1] - al->range[0] + 1; if (i < j) { error("%s cannot have more elements in a (%d) than in z (%d)", pu, j, i); return; } /* * get n-m-(v-u) and m for the interpreter */ i -= j; j = ap->range[0]; putleaf( P2ICON , itemwidth , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , j , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , i , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , k , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); putdot( filename , line ); return; case 0: error("%s is an unimplemented 6400 extension", p->symbol); return; default: panic("proc case"); } } #endif PC i -= j; j = ap->range[0]; putleaf( P2ICON , itemwidth , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , j , 0 , cmd/pc0/pcwhoami.h 644 0 33 1041 2552606603 7240 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)pcwhoami.h 1.2 3/6/81"; */ /* * am i generating an obj file (OBJ), * postfix binary input to the 2nd pass of the portable c compiler (PC), * or pTrees (PTREE)? */ #undef OBJ #define PC #undef PTREE /* * am i the vax or the pdp11 version */ #define VAX #undef PDP11 #define DEC11 /* * am i pi or pxp? */ #define PI #undef PXP /* * am i both passes, or am i only one of the two passes pi0 or pi1? */ #define PI01 #undef PI0 #undef PI1 the University of California */ /* static char sccsid[] = "@(#)pcwhoami.h 1.2 3/6/81"; */ /* * am i generating an obj file (OBJ), * postfix binary input to the 2nd pass of the portable c compiler (PC), * or pTrees (PTREE)? */ #undef OBJ #define PC #undef PTREE /* * am i the vax or the pdp11 version */ #define VAX #undef PDP11 #define DEC11 /* * am i pi or pxp? */ #define PI #undef PXP /* * am i both passes, or am i only one of the two passes pi0 or pi1? */ #decmd/pc0/pic.c 644 0 33 762 2552606604 6171 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)pic.c 1.1 8/27/80"; #include "OPnames.h" main() { register int j, k; for(j = 0; j < 32; j++) { for (k = 0; k < 256; k += 32) if (otext[j+k]) printf("%03o%cO_%s\t", j+k, *otext[j+k], otext[j+k]+1); else printf("%03o\t\t", j+k); putchar('\n'); if ((j+1)%8 == 0) putchar('\n'); } printf("Starred opcodes are used internally in Pi and are never generated.\n"); exit(0); } ,"cmd/pc0/piwhoami.h 644 0 33 1041 2552606604 7247 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)piwhoami.h 1.2 3/6/81"; */ /* * am i generating an obj file (OBJ), * postfix binary input to the 2nd pass of the portable c compiler (PC), * or pTrees (PTREE)? */ #define OBJ #undef PC #undef PTREE /* * am i the vax or the pdp11 version */ #define VAX #undef PDP11 #define DEC11 /* * am i pi or pxp? */ #define PI #undef PXP /* * am i both passes, or am i only one of the two passes pi0 or pi1? */ #de((fine PI01 #undef PI0 #undef PI1 the University of California */ /* static char sccsid[] = "@(#)piwhoami.h 1.2 3/6/81"; */ /* * am i generating an obj file (OBJ), * postfix binary input to the 2nd pass of the portable c compiler (PC), * or pTrees (PTREE)? */ #define OBJ #undef PC #undef PTREE /* * am i the vax or the pdp11 version */ #define VAX #undef PDP11 #define DEC11 /* * am i pi or pxp? */ #define PI #undef PXP /* * am i both passes, or am i only one of the two passes pi0 or pi1? */ #decmd/pc0/proc.c 644 0 33 57310 2552606604 6422 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)proc.c 1.9 6/4/81"; #include "whoami.h" #ifdef OBJ /* * and the rest of the file */ #include "0.h" #include "tree.h" #include "opcode.h" #include "objfmt.h" /* * The following array is used to determine which classes may be read * from textfiles. It is indexed by the return value from classify. */ #define rdops(x) rdxxxx[(x)-(TFIRST)] int rdxxxx[] = { 0, /* -7 file types */ 0, /* -6 record types */ 0, /* -5 array types */ O_READE, /* -4 scalar types */ 0, /* -3 pointer types */ 0, /* -2 set types */ 0, /* -1 string types */ 0, /* 0 nil, no type */ O_READE, /* 1 boolean */ O_READC, /* 2 character */ O_READ4, /* 3 integer */ O_READ8 /* 4 real */ }; /* * Proc handles procedure calls. * Non-builtin procedures are "buck-passed" to func (with a flag * indicating that they are actually procedures. * builtin procedures are handled here. */ proc(r) int *r; { register struct nl *p; register int *alv, *al, op; struct nl *filetype, *ap; int argc, *argv, typ, fmtspec, strfmt, stkcnt, *file; char fmt, format[20], *strptr; int prec, field, strnglen, fmtlen, fmtstart, pu; int *pua, *pui, *puz; int i, j, k; int itemwidth; struct tmps soffset; struct nl *tempnlp; #define CONPREC 4 #define VARPREC 8 #define CONWIDTH 1 #define VARWIDTH 2 #define SKIP 16 /* * Verify that the name is * defined and is that of a * procedure. */ p = lookup(r[2]); if (p == NIL) { rvlist(r[3]); return; } if (p->class != PROC && p->class != FPROC) { error("Can't call %s, its %s not a procedure", p->symbol, classes[p->class]); rvlist(r[3]); return; } argv = r[3]; /* * Call handles user defined * procedures and functions. */ if (bn != 0) { call(p, argv, PROC, bn); return; } /* * Call to built-in procedure. * Count the arguments. */ argc = 0; for (al = argv; al != NIL; al = al[2]) argc++; /* * Switch on the operator * associated with the built-in * procedure in the namelist */ op = p->value[0] &~ NSTAND; if (opt('s') && (p->value[0] & NSTAND)) { standard(); error("%s is a nonstandard procedure", p->symbol); } switch (op) { case O_ABORT: if (argc != 0) error("null takes no arguments"); return; case O_FLUSH: if (argc == 0) { put(1, O_MESSAGE); return; } if (argc != 1) { error("flush takes at most one argument"); return; } ap = stklval(argv[1], NIL , LREQ ); if (ap == NIL) return; if (ap->class != FILET) { error("flush's argument must be a file, not %s", nameof(ap)); return; } put(1, op); return; case O_MESSAGE: case O_WRITEF: case O_WRITLN: /* * Set up default file "output"'s type */ file = NIL; filetype = nl+T1CHAR; /* * Determine the file implied * for the write and generate * code to make it the active file. */ if (op == O_MESSAGE) { /* * For message, all that matters * is that the filetype is * a character file. * Thus "output" will suit us fine. */ put(1, O_MESSAGE); } else if (argv != NIL && (al = argv[1])[0] != T_WEXP) { /* * If there is a first argument which has * no write widths, then it is potentially * a file name. */ codeoff(); ap = stkrval(argv[1], NIL , RREQ ); codeon(); if (ap == NIL) argv = argv[2]; if (ap != NIL && ap->class == FILET) { /* * Got "write(f, ...", make * f the active file, and save * it and its type for use in * processing the rest of the * arguments to write. */ file = argv[1]; filetype = ap->type; stklval(argv[1], NIL , LREQ ); put(1, O_UNIT); /* * Skip over the first argument */ argv = argv[2]; argc--; } else /* * Set up for writing on * standard output. */ put(1, O_UNITOUT); } else put(1, O_UNITOUT); /* * Loop and process each * of the arguments. */ for (; argv != NIL; argv = argv[2]) { /* * fmtspec indicates the type (CONstant or VARiable) * and number (none, WIDTH, and/or PRECision) * of the fields in the printf format for this * output variable. * stkcnt is the number of bytes pushed on the stack * fmt is the format output indicator (D, E, F, O, X, S) * fmtstart = 0 for leading blank; = 1 for no blank */ fmtspec = NIL; stkcnt = 0; fmt = 'D'; fmtstart = 1; al = argv[1]; if (al == NIL) continue; if (al[0] == T_WEXP) alv = al[1]; else alv = al; if (alv == NIL) continue; codeoff(); ap = stkrval(alv, NIL , RREQ ); codeon(); if (ap == NIL) continue; typ = classify(ap); if (al[0] == T_WEXP) { /* * Handle width expressions. * The basic game here is that width * expressions get evaluated. If they * are constant, the value is placed * directly in the format string. * Otherwise the value is pushed onto * the stack and an indirection is * put into the format string. */ if (al[3] == OCT) fmt = 'O'; else if (al[3] == HEX) fmt = 'X'; else if (al[3] != NIL) { /* * Evaluate second format spec */ if ( constval(al[3]) && isa( con.ctype , "i" ) ) { fmtspec += CONPREC; prec = con.crval; } else { fmtspec += VARPREC; } fmt = 'f'; switch ( typ ) { case TINT: if ( opt( 's' ) ) { standard(); error("Writing %ss with two write widths is non-standard", clnames[typ]); } /* and fall through */ case TDOUBLE: break; default: error("Cannot write %ss with two write widths", clnames[typ]); continue; } } /* * Evaluate first format spec */ if (al[2] != NIL) { if ( constval(al[2]) && isa( con.ctype , "i" ) ) { fmtspec += CONWIDTH; field = con.crval; } else { fmtspec += VARWIDTH; } } if ((fmtspec & CONPREC) && prec < 0 || (fmtspec & CONWIDTH) && field < 0) { error("Negative widths are not allowed"); continue; } if ( opt('s') && ((fmtspec & CONPREC) && prec == 0 || (fmtspec & CONWIDTH) && field == 0)) { standard(); error("Zero widths are non-standard"); } } if (filetype != nl+T1CHAR) { if (fmt == 'O' || fmt == 'X') { error("Oct/hex allowed only on text files"); continue; } if (fmtspec) { error("Write widths allowed only on text files"); continue; } /* * Generalized write, i.e. * to a non-textfile. */ stklval(file, NIL , LREQ ); put(1, O_FNIL); /* * file^ := ... */ ap = rvalue(argv[1], NIL); if (ap == NIL) continue; if (incompat(ap, filetype, argv[1])) { cerror("Type mismatch in write to non-text file"); continue; } convert(ap, filetype); put(2, O_AS, width(filetype)); /* * put(file) */ put(1, O_PUT); continue; } /* * Write to a textfile * * Evaluate the expression * to be written. */ if (fmt == 'O' || fmt == 'X') { if (opt('s')) { standard(); error("Oct and hex are non-standard"); } if (typ == TSTR || typ == TDOUBLE) { error("Can't write %ss with oct/hex", clnames[typ]); continue; } if (typ == TCHAR || typ == TBOOL) typ = TINT; } /* * Place the arguement on the stack. If there is * no format specified by the programmer, implement * the default. */ switch (typ) { case TINT: if (fmt != 'f') { ap = stkrval(alv, NIL , RREQ ); stkcnt += sizeof(long); } else { ap = stkrval(alv, NIL , RREQ ); put(1, O_ITOD); stkcnt += sizeof(double); typ = TDOUBLE; goto tdouble; } if (fmtspec == NIL) { if (fmt == 'D') field = 10; else if (fmt == 'X') field = 8; else if (fmt == 'O') field = 11; else panic("fmt1"); fmtspec = CONWIDTH; } break; case TCHAR: tchar: if (fmtspec == NIL) { put(1, O_FILE); ap = stkrval(alv, NIL , RREQ ); convert(nl + T4INT, INT_TYP); put(2, O_WRITEC, sizeof(char *) + sizeof(int)); fmtspec = SKIP; break; } ap = stkrval(alv, NIL , RREQ ); convert(nl + T4INT, INT_TYP); stkcnt += sizeof(int); fmt = 'c'; break; case TSCAL: warning(); if (opt('s')) { standard(); } error("Writing scalars to text files is non-standard"); case TBOOL: stkrval(alv, NIL , RREQ ); put(2, O_NAM, (long)listnames(ap)); stkcnt += sizeof(char *); fmt = 's'; break; case TDOUBLE: ap = stkrval(alv, TDOUBLE , RREQ ); stkcnt += sizeof(double); tdouble: switch (fmtspec) { case NIL: # ifdef DEC11 field = 21; # else field = 22; # endif DEC11 prec = 14; fmt = 'e'; fmtspec = CONWIDTH + CONPREC; break; case CONWIDTH: if (--field < 1) field = 1; # ifdef DEC11 prec = field - 7; # else prec = field - 8; # endif DEC11 if (prec(( < 1) prec = 1; fmtspec += CONPREC; fmt = 'e'; break; case CONWIDTH + CONPREC: case CONWIDTH + VARPREC: if (--field < 1) field = 1; } format[0] = ' '; fmtstart = 0; break; case TSTR: constval( alv ); switch ( classify( con.ctype ) ) { case TCHAR: typ = TCHAR; goto tchar; case TSTR: strptr = con.cpval; for (strnglen = 0; *strptr++; strnglen++) /* void */; strptr = con.cpval; break; default: strnglen = width(ap); break; } fmt = 's'; strfmt = fmtspec; if (fmtspec == NIL) { fmtspec = SKIP; break; } if (fmtspec & CONWIDTH) { if (field <= strnglen) { fmtspec = SKIP; break; } else field -= strnglen; } /* * push string to implement leading blank padding */ put(2, O_LVCON, 2); putstr("", 0); stkcnt += sizeof(char *); break; default: error("Can't write %ss to a text file", clnames[typ]); continue; } /* * If there is a variable precision, evaluate it onto * the stack */ if (fmtspec & VARPREC) { ap = stkrval(al[3], NIL , RREQ ); if (ap == NIL) continue; if (isnta(ap,"i")) { error("Second write width must be integer, not %s", nameof(ap)); continue; } if ( opt( 't' ) ) { put(3, O_MAX, 0, 0); } convert(nl+T4INT, INT_TYP); stkcnt += sizeof(int); } /* * If there is a variable width, evaluate it onto * the stack */ if (fmtspec & VARWIDTH) { if ( ( typ == TDOUBLE && fmtspec == VARWIDTH ) || typ == TSTR ) { soffset = sizes[cbn].curtmps; tempnlp = tmpalloc(sizeof(long), nl+T4INT, REGOK); put(2, O_LV | cbn << 8 + INDX, tempnlp -> value[ NL_OFFS ] ); } ap = stkrval(al[2], NIL , RREQ ); if (ap == NIL) continue; if (isnta(ap,"i")) { error("First write width must be integer, not %s", nameof(ap)); continue; } /* * Perform special processing on widths based * on data type */ switch (typ) { case TDOUBLE: if (fmtspec == VARWIDTH) { fmt = 'e'; put(1, O_AS4); put(2, O_RV4 | cbn << 8 + INDX, tempnlp -> value[NL_OFFS] ); # ifdef DEC11 put(3, O_MAX, 8, 1); # else put(3, O_MAX, 9, 1); # endif DEC11 convert(nl+T4INT, INT_TYP); stkcnt += sizeof(int); put(2, O_RV4 | cbn << 8 + INDX, tempnlp->value[NL_OFFS] ); fmtspec += VARPREC; tmpfree(&soffset); } put(3, O_MAX, 1, 1); break; case TSTR: put(1, O_AS4); put(2, O_RV4 | cbn << 8 + INDX, tempnlp -> value[ NL_OFFS ] ); put(3, O_MAX, strnglen, 0); break; default: if ( opt( 't' ) ) { put(3, O_MAX, 0, 0); } break; } convert(nl+T4INT, INT_TYP); stkcnt += sizeof(int); } /* * Generate the format string */ switch (fmtspec) { default: panic("fmt2"); case SKIP: break; case NIL: sprintf(&format[1], "%%%c", fmt); goto fmtgen; case CONWIDTH: sprintf(&format[1], "%%%d%c", field, fmt); goto fmtgen; case VARWIDTH: sprintf(&format[1], "%%*%c", fmt); goto fmtgen; case CONWIDTH + CONPREC: sprintf(&format[1], "%%%d.%d%c", field, prec, fmt); goto fmtgen; case CONWIDTH + VARPREC: sprintf(&format[1], "%%%d.*%c", field, fmt); goto fmtgen; case VARWIDTH + CONPREC: sprintf(&format[1], "%%*.%d%c", prec, fmt); goto fmtgen; case VARWIDTH + VARPREC: sprintf(&format[1], "%%*.*%c", fmt); fmtgen: fmtlen = lenstr(&format[fmtstart], 0); put(2, O_LVCON, fmtlen); putstr(&format[fmtstart], 0); put(1, O_FILE); stkcnt += 2 * sizeof(char *); put(2, O_WRITEF, stkcnt); } /* * Write the string after its blank padding */ if (typ == TSTR) { put(1, O_FILE); put(2, CON_INT, 1); if (strfmt & VARWIDTH) { put(2, O_RV4 | cbn << 8 + INDX , tempnlp -> value[ NL_OFFS ] ); put(2, O_MIN, strnglen); convert(nl+T4INT, INT_TYP); tmpfree(&soffset); } else { if ((fmtspec & SKIP) && (strfmt & CONWIDTH)) { strnglen = field; } put(2, CON_INT, strnglen); } ap = stkrval(alv, NIL , RREQ ); put(2, O_WRITES, 2 * sizeof(char *) + 2 * sizeof(int)); } } /* * Done with arguments. * Handle writeln and * insufficent number of args. */ switch (p->value[0] &~ NSTAND) { case O_WRITEF: if (argc == 0) error("Write requires an argument"); break; case O_MESSAGE: if (argc == 0) error("Message requires an argument"); case O_WRITLN: if (filetype != nl+T1CHAR) error("Can't 'writeln' a non text file"); put(1, O_WRITLN); break; } return; case O_READ4: case O_READLN: /* * Set up default * file "input". */ file = NIL; filetype = nl+T1CHAR; /* * Determine the file implied * for the read and generate * code to make it the active file. */ if (argv != NIL) { codeoff(); ap = stkrval(argv[1], NIL , RREQ ); codeon(); if (ap == NIL) argv = argv[2]; if (ap != NIL && ap->class == FILET) { /* * Got "read(f, ...", make * f the active file, and save * it and its type for use in * processing the rest of the * arguments to read. */ file = argv[1]; filetype = ap->type; stklval(argv[1], NIL , LREQ ); put(1, O_UNIT); argv = argv[2]; argc--; } else { /* * Default is read from * standard input. */ put(1, O_UNITINP); input->nl_flags |= NUSED; } } else { put(1, O_UNITINP); input->nl_flags |= NUSED; } /* * Loop and process each * of the arguments. */ for (; argv != NIL; argv = argv[2]) { /* * Get the address of the target * on the stack. */ al = argv[1]; if (al == NIL) continue; if (al[0] != T_VAR) { error("Arguments to %s must be variables, not expressions", p->symbol); continue; } ap = stklval(al, MOD|ASGN|NOUSE); if (ap == NIL) continue; if (filetype != nl+T1CHAR) { /* * Generalized read, i.e. * from a non-textfile. */ if (incompat(filetype, ap, argv[1] )) { error("Type mismatch in read from non-text file"); continue; } /* * var := file ^; */ if (file != NIL) stklval(file, NIL , LREQ ); else /* Magic */ put(2, PTR_RV, (int)input->value[0]); put(1, O_FNIL); put(2, O_IND, width(filetype)); convert(filetype, ap); if (isa(ap, "bsci")) rangechk(ap, ap); put(2, O_AS, width(ap)); /* * get(file); */ put(1, O_GET); continue; } typ = classify(ap); op = rdops(typ); if (op == NIL) { error("Can't read %ss from a text file", clnames[typ]); continue; } if (op != O_READE) put(1, op); else { put(2, op, (long)listnames(ap)); warning(); if (opt('s')) { standard(); } error("Reading scalars from text files is non-standard"); } /* * Data read is on the stack. * Assign it. */ if (op != O_READ8 && op != O_READE) rangechk(ap, op == O_READC ? ap : nl+T4INT); gen(O_AS2, O_AS2, width(ap), op == O_READ8 ? 8 : op == O_READ4 ? 4 : 2); } /* * Done with arguments. * Handle readln and * insufficient number of args. */ if (p->value[0] == O_READLN) { if (filetype != nl+T1CHAR) error("Can't 'readln' a non text file"); put(1, O_READLN); } else if (argc == 0) error("read requires an argument"); return; case O_GET: case O_PUT: if (argc != 1) { error("%s expects one argument", p->symbol); return; } ap = stklval(argv[1], NIL , LREQ ); if (ap == NIL) return; if (ap->class != FILET) { error("Argument to %s must be a file, not %s", p->symbol, nameof(ap)); return; } put(1, O_UNIT); put(1, op); return; case O_RESET: case O_REWRITE: if (argc == 0 || argc > 2) { error("%s expects one or two arguments", p->symbol); return; } if (opt('s') && argc == 2) { standard(); error("Two argument forms of reset and rewrite are non-standard"); } codeoff(); ap = stklval(argv[1], MOD|NOUSE); codeon(); if (ap == NIL) return; if (ap->class != FILET) { error("First argument to %s must be a file, not %s", p->symbol, nameof(ap)); return; } put(2, O_CON24, text(ap) ? 0: width(ap->type)); if (argc == 2) { /* * Optional second argument * is a string name of a * UNIX (R) file to be associated. */ al = argv[2]; codeoff(); al = stkrval(al[1], NOFLAGS , RREQ ); codeon(); if (al == NIL) return; if (classify(al) != TSTR) { error("Second argument to %s must be a string, not %s", p->symbol, nameof(al)); return; } put(2, O_CON24, width(al)); al = argv[2]; al = stkrval(al[1], NOFLAGS , RREQ ); } else { put(2, O_CON24, 0); put(2, PTR_CON, NIL); } ap = stklval(argv[1], MOD|NOUSE); put(1, op); return; case O_NEW: case O_DISPOSE: if (argc == 0) { error("%s expects at least one argument", p->symbol); return; } ap = stklval(argv[1], op == O_NEW ? ( MOD | NOUSE ) : MOD ); if (ap == NIL) return; if (ap->class != PTR) { error("(First) argument to %s must be a pointer, not %s", p->symbol, nameof(ap)); return; } ap = ap->type; if (ap == NIL) return; argv = argv[2]; if (argv != NIL) { if (ap->class != RECORD) { error("Record required when specifying variant tags"); return; } for (; argv != NIL; argv = argv[2]) { if (ap->ptr[NL_VARNT] == NIL) { error("Too many tag fields"); return; } if (!isconst(argv[1])) { error("Second and successive arguments to %s must be constants", p->symbol); return; } gconst(argv[1]); if (con.ctype == NIL) return; if (incompat(con.ctype, (ap->ptr[NL_TAG])->type , NIL )) { cerror("Specified tag constant type clashed with variant case selector type"); return; } for (ap = ap->ptr[NL_VARNT]; ap != NIL; ap = ap->chain) if (ap->range[0] == co((n.crval) break; if (ap == NIL) { error("No variant case label value equals specified constant value"); return; } ap = ap->ptr[NL_VTOREC]; } } put(2, op, width(ap)); return; case O_DATE: case O_TIME: if (argc != 1) { error("%s expects one argument", p->symbol); return; } ap = stklval(argv[1], MOD|NOUSE); if (ap == NIL) return; if (classify(ap) != TSTR || width(ap) != 10) { error("Argument to %s must be a alfa, not %s", p->symbol, nameof(ap)); return; } put(1, op); return; case O_HALT: if (argc != 0) { error("halt takes no arguments"); return; } put(1, op); noreach = 1; return; case O_ARGV: if (argc != 2) { error("argv takes two arguments"); return; } ap = stkrval(argv[1], NIL , RREQ ); if (ap == NIL) return; if (isnta(ap, "i")) { error("argv's first argument must be an integer, not %s", nameof(ap)); return; } al = argv[2]; ap = stklval(al[1], MOD|NOUSE); if (ap == NIL) return; if (classify(ap) != TSTR) { error("argv's second argument must be a string, not %s", nameof(ap)); return; } put(2, op, width(ap)); return; case O_STLIM: if (argc != 1) { error("stlimit requires one argument"); return; } ap = stkrval(argv[1], NIL , RREQ ); if (ap == NIL) return; if (isnta(ap, "i")) { error("stlimit's argument must be an integer, not %s", nameof(ap)); return; } if (width(ap) != 4) put(1, O_STOI); put(1, op); return; case O_REMOVE: if (argc != 1) { error("remove expects one argument"); return; } codeoff(); ap = stkrval(argv[1], NOFLAGS , RREQ ); codeon(); if (ap == NIL) return; if (classify(ap) != TSTR) { error("remove's argument must be a string, not %s", nameof(ap)); return; } put(2, O_CON24, width(ap)); ap = stkrval(argv[1], NOFLAGS , RREQ ); put(1, op); return; case O_LLIMIT: if (argc != 2) { error("linelimit expects two arguments"); return; } al = argv[2]; ap = stkrval(al[1], NIL , RREQ ); if (ap == NIL) return; if (isnta(ap, "i")) { error("linelimit's second argument must be an integer, not %s", nameof(ap)); return; } ap = stklval(argv[1], NOFLAGS|NOUSE); if (ap == NIL) return; if (!text(ap)) { error("linelimit's first argument must be a text file, not %s", nameof(ap)); return; } put(1, op); return; case O_PAGE: if (argc != 1) { error("page expects one argument"); return; } ap = stklval(argv[1], NIL , LREQ ); if (ap == NIL) return; if (!text(ap)) { error("Argument to page must be a text file, not %s", nameof(ap)); return; } put(1, O_UNIT); put(1, op); return; case O_PACK: if (argc != 3) { error("pack expects three arguments"); return; } pu = "pack(a,i,z)"; pua = argv[1]; al = argv[2]; pui = al[1]; alv = al[2]; puz = alv[1]; goto packunp; case O_UNPACK: if (argc != 3) { error("unpack expects three arguments"); return; } pu = "unpack(z,a,i)"; puz = argv[1]; al = argv[2]; pua = al[1]; alv = al[2]; pui = alv[1]; packunp: codeoff(); ap = stklval(pua, op == O_PACK ? NOFLAGS : MOD|NOUSE); al = (struct nl *) stklval(puz, op == O_UNPACK ? NOFLAGS : MOD|NOUSE); codeon(); if (ap == NIL) return; if (ap->class != ARRAY) { error("%s requires a to be an unpacked array, not %s", pu, nameof(ap)); return; } if (al->class != ARRAY) { error("%s requires z to be a packed array, not %s", pu, nameof(ap)); return; } if (al->type == NIL || ap->type == NIL) return; if (al->type != ap->type) { error("%s requires a and z to be arrays of the same type", pu, nameof(ap)); return; } k = width(al); itemwidth = width(ap->type); ap = ap->chain; al = al->chain; if (ap->chain != NIL || al->chain != NIL) { error("%s requires a and z to be single dimension arrays", pu); return; } if (ap == NIL || al == NIL) return; /* * al is the range for z i.e. u..v * ap is the range for a i.e. m..n * i will be n-m+1 * j will be v-u+1 */ i = ap->range[1] - ap->range[0] + 1; j = al->range[1] - al->range[0] + 1; if (i < j) { error("%s cannot have more elements in a (%d) than in z (%d)", pu, j, i); return; } /* * get n-m-(v-u) and m for the interpreter */ i -= j; j = ap->range[0]; put(2, O_CON24, k); put(2, O_CON24, i); put(2, O_CON24, j); put(2, O_CON24, itemwidth); al = (struct nl *) stklval(puz, op == O_UNPACK ? NOFLAGS : MOD|NOUSE); ap = stklval(pua, op == O_PACK ? NOFLAGS : MOD|NOUSE); ap = stkrval((int *) pui, NLNIL , RREQ ); if (ap == NIL) return; put(1, op); return; case 0: error("%s is an unimplemented 6400 extension", p->symbol); return; default: panic("proc case"); } } #endif OBJ nd m for the interpreter */ i -= j; j = ap->range[0]; put(2, O_CON24, k); put(2, O_CON24, i); put(2, O_CON24, j); put(2, O_CON24, itemwidth); al = (struct nl *) stklval(puz, op == O_UNPACK ? NOFLAGS : MOD|NOUSE); ap = stklval(pua, op == O_PACK ? NOFLAGS : MOD|NOUSE); ap = stkrval((int *) pucmd/pc0/pstab.h 644 0 33 1226 2552606604 6550 /* static char sccsid[] = "@(#)pstab.h 1.2 9/9/80"; */ /* * subtypes within the above type * subtypes N_PSO and N_PSOL are .stabs name,,0,subtype,0 * others subtypes are .stabs name,,0,subtype,line */ #define N_PSO 0x1 /* source file name */ #define N_PSOL 0x2 /* include file name */ #define N_PGLABEL 0x3 /* global label */ #define N_PGCONST 0x4 /* global constant */ #define N_PGTYPE 0x5 /* global type */ #define N_PGVAR 0x6 /* global variable */ #define N_PGFUNC 0x7 /* global function */ #define N_PGPROC 0x8 /* global procedure */ #define N_PEFUNC 0x9 /* external function */ #define N_PEPROC 0xa /* external procedure */ ame,,0,subtype,0 * others subtypes are .stabs name,,0,subtype,line */ #define N_PSO 0x1 /* source file name */ #define N_PSOL 0x2 /* include file name */ #define N_PGLABEL 0x3 /* global label */ #define N_PGCONST 0x4 /* global constant */ #define N_PGTYPE 0x5 /* global type */ #define N_PGVAR 0x6 /* global variable */ #define N_PGFUNC 0x7 /* globcmd/pc0/put.c 644 0 33 32375 2552606605 6274 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)put.c 1.14 3/26/81"; #include "whoami.h" #include "opcode.h" #include "0.h" #include "objfmt.h" #ifdef PC # include "pc.h" #endif PC short *obufp = obuf; /* * If DEBUG is defined, include the table * of the printing opcode names. */ #ifdef DEBUG #include "OPnames.h" #endif #ifdef OBJ /* * Put is responsible for the interpreter equivalent of code * generation. Since the interpreter is specifically designed * for Pascal, little work is required here. */ put(a) { register int *p, i; register char *cp; register short *sp; register long *lp; int n, subop, suboppr, op, oldlc, w; char *string; static int casewrd; /* * It would be nice to do some more * optimizations here. The work * done to collapse offsets in lval * should be done here, the IFEQ etc * relational operators could be used * etc. */ oldlc = lc; if ( !CGENNING ) /* * code disabled - do nothing */ return (oldlc); p = &a; n = *p++; suboppr = subop = (*p >> 8) & 0377; op = *p & 0377; string = 0; #ifdef DEBUG if ((cp = otext[op]) == NIL) { printf("op= %o\n", op); panic("put"); } #endif switch (op) { case O_ABORT: cp = "*"; break; case O_AS: switch(p[1]) { case 2: op = O_AS2; break; case 4: op = O_AS4; break; case 8: op = O_AS8; break; default: goto pack; } n = 1; # ifdef DEBUG cp = otext[op]; # endif DEBUG break; case O_CONG: case O_LVCON: case O_CON: case O_LINO: case O_NEW: case O_DISPOSE: case O_IND: case O_OFF: case O_INX2: case O_INX4: case O_CARD: case O_ADDT: case O_SUBT: case O_MULT: case O_IN: case O_CASE1OP: case O_CASE2OP: case O_CASE4OP: case O_FRTN: case O_WRITES: case O_WRITEC: case O_WRITEF: case O_MAX: case O_MIN: case O_ARGV: case O_CTTOT: case O_INCT: case O_RANG2: case O_RSNG2: case O_RANG42: case O_RSNG42: case O_SUCC2: case O_SUCC24: case O_PRED2: case O_PRED24: if (p[1] == 0) break; case O_CON2: case O_CON24: pack: if (p[1] < 128 && p[1] >= -128) { suboppr = subop = p[1]; p++; n--; if (op == O_CON2) { op = O_CON1; # ifdef DEBUG cp = otext[O_CON1]; # endif DEBUG } if (op == O_CON24) { op = O_CON14; # ifdef DEBUG cp = otext[O_CON14]; # endif DEBUG } } break; case O_CON8: { short *sp = &p[1]; #ifdef DEBUG if ( opt( 'k' ) ) printf ( "%5d\tCON8\t%22.14e\n" , lc - HEADER_BYTES , * ( ( double * ) &p[1] ) ); #endif # ifdef DEC11 word(op); # else word(op << 8); # endif DEC11 for ( i = 1 ; i <= 4 ; i ++ ) word ( *sp ++ ); return ( oldlc ); } default: if (op >= O_REL2 && op <= O_REL84) { if ((i = (subop >> INDX) * 5 ) >= 30) i -= 30; else i += 2; #ifdef DEBUG string = &"IFEQ\0IFNE\0IFLT\0IFGT\0IFLE\0IFGE"[i]; #endif suboppr = 0; } break; case O_IF: case O_TRA: /***** (( codeline = 0; *****/ /* relative addressing */ p[1] -= ( unsigned ) lc + sizeof(short); break; case O_FOR1U: case O_FOR2U: case O_FOR1D: case O_FOR2D: /* relative addressing */ p[3] -= ( unsigned ) lc + 3 * sizeof(short); break; case O_CONC: #ifdef DEBUG (string = "'x'")[1] = p[1]; #endif suboppr = 0; op = O_CON1; # ifdef DEBUG cp = otext[O_CON1]; # endif DEBUG subop = p[1]; goto around; case O_CONC4: #ifdef DEBUG (string = "'x'")[1] = p[1]; #endif suboppr = 0; op = O_CON14; subop = p[1]; goto around; case O_CON1: case O_CON14: suboppr = subop = p[1]; around: n--; break; case O_CASEBEG: casewrd = 0; return (oldlc); case O_CASEEND: if ((unsigned) lc & 1) { lc--; word(casewrd); } return (oldlc); case O_CASE1: #ifdef DEBUG if (opt('k')) printf("%5d\tCASE1\t%d\n" , lc - HEADER_BYTES, p[1]); #endif /* * this to build a byte size case table * saving bytes across calls in casewrd * so they can be put out by word() */ lc++; if ((unsigned) lc & 1) # ifdef DEC11 casewrd = p[1] & 0377; # else casewrd = (p[1] & 0377) << 8; # endif DEC11 else { lc -= 2; # ifdef DEC11 word(((p[1] & 0377) << 8) | casewrd); # else word((p[1] & 0377) | casewrd); # endif DEC11 } return (oldlc); case O_CASE2: #ifdef DEBUG if (opt('k')) printf("%5d\tCASE2\t%d\n" , lc - HEADER_BYTES , p[1]); #endif word(p[1]); return (oldlc); case O_PUSH: lp = (long *)&p[1]; if (*lp == 0) return (oldlc); if (*lp < 128 && *lp >= -128) { suboppr = subop = *lp; p++; n--; break; } goto longgen; case O_FOR4U: case O_FOR4D: /* relative addressing */ p[1 + 2 * (sizeof(long) / sizeof(int))] -= (unsigned)lc + (sizeof(short) + 2 * sizeof(long)); goto longgen; case O_TRA4: case O_CALL: case O_FSAV: case O_GOTO: case O_NAM: case O_READE: /* absolute long addressing */ lp = (long *)&p[1]; *lp -= HEADER_BYTES; goto longgen; case O_RV1: case O_RV14: case O_RV2: case O_RV24: case O_RV4: case O_RV8: case O_RV: case O_LV: /* * positive offsets represent arguments * and must use "ap" display entry rather * than the "fp" entry */ if (p[1] >= 0) { subop++; suboppr++; } # ifdef PDP11 break; # else /* * offsets out of range of word addressing * must use long offset opcodes */ if (p[1] < SHORTADDR && p[1] >= -SHORTADDR) break; else { op += O_LRV - O_RV; # ifdef DEBUG cp = otext[op]; # endif DEBUG } /* and fall through */ # endif PDP11 case O_BEG: case O_NODUMP: case O_CON4: case O_CASE4: case O_RANG4: case O_RANG24: case O_RSNG4: case O_RSNG24: case O_SUCC4: case O_PRED4: longgen: n = (n << 1) - 1; if ( op == O_LRV || op == O_FOR4U || op == O_FOR4D) n--; #ifdef DEBUG if (opt('k')) { printf("%5d\t%s", lc - HEADER_BYTES, cp+1); if (suboppr) printf(":%d", suboppr); for ( i = 2, lp = (long *)&p[1]; i < n ; i += sizeof ( long )/sizeof ( short ) ) printf( "\t%D " , *lp ++ ); if (i == n) { sp = (short *)lp; printf( "\t%d ", *sp ); } pchr ( '\n' ); } #endif if ( op != O_CASE4 ) # ifdef DEC11 word((op & 0377) | subop << 8); # else word(op << 8 | (subop & 0377)); # endif DEC11 for ( i = 1, sp = (short *)&p[1]; i < n; i++) word ( *sp ++ ); return ( oldlc ); } #ifdef DEBUG if (opt('k')) { printf("%5d\t%s", lc - HEADER_BYTES, cp+1); if (suboppr) printf(":%d", suboppr); if (string) printf("\t%s",string); if (n > 1) pchr('\t'); for (i=1; iclass != TYPE) ap = ap->type; if (ap->value[ NL_ELABEL ] != 0) { /* the list already exists */ return( ap -> value[ NL_ELABEL ] ); } # ifdef OBJ oldlc = lc; put(2, O_TRA, lc); ap->value[ NL_ELABEL ] = lc; # endif OBJ # ifdef PC putprintf( " .data" , 0 ); putprintf( " .align 1" , 0 ); ap -> value[ NL_ELABEL ] = getlab(); putlab( ap -> value[ NL_ELABEL ] ); # endif PC /* number of scalars */ next = ap->type; len = next->range[1]-next->range[0]+1; # ifdef OBJ put(2, O_CASE2, len); # endif OBJ # ifdef PC putprintf( " .word %d" , 0 , len ); # endif PC /* offsets of each scalar name */ len = (len+1)*sizeof(short); # ifdef OBJ put(2, O_CASE2, len); # endif OBJ # ifdef PC putprintf( " .word %d" , 0 , len ); # endif PC next = ap->chain; do { for(strptr = next->symbol; *strptr++; len++) continue; len++; # ifdef OBJ put(2, O_CASE2, len); # endif OBJ # ifdef PC putprintf( " .word %d" , 0 , len ); # endif PC } while (next = next->chain); /* list of scalar names */ strptr = getnext(ap, &next); # ifdef OBJ do { # ifdef DEC11 w = (unsigned) *strptr; # else w = *strptr << 8; # endif DEC11 if (!*strptr++) strptr = getnext(next, &next); # ifdef DEC11 w |= *strptr << 8; # else w |= (unsigned) *strptr; # endif DEC11 if (!*strptr++) strptr = getnext(next, &next); word(w); } while (next); /* jump over the mess */ patch(oldlc); # endif OBJ # ifdef PC while ( next ) { while ( *strptr ) { putprintf( " .byte 0%o" , 1 , *strptr++ ); for ( w = 2 ; ( w <= 8 ) && *strptr ; w ++ ) { putprintf( ",0%o" , 1 , *strptr++ ); } putprintf( "" , 0 ); } putprintf( " .byte 0" , 0 ); strptr = getnext( next , &next ); } putprintf( " .text" , 0 ); # endif PC return( ap -> value[ NL_ELABEL ] ); } getnext(next, new) struct nl *next, **new; { if (next != NIL) { next = next->chain; *new = next; } if (next == NIL) return(""); #ifdef OBJ if (opt('k') && CGENNING ) printf("%5d\t\t\"%s\"\n", lc-HEADER_BYTES, next->symbol); #endif OBJ return(next->symbol); } #ifdef OBJ /* * Putspace puts out a table * of nothing to leave space * for the case branch table e.g. */ putspace(n) int n; { register i; if ( !CGENNING ) /* * code disabled - do nothing */ return(lc); #ifdef DEBUG if (opt('k')) printf("%5d\t.=.+%d\n", lc - HEADER_BYTES, n); #endif for (i = even(n); i > 0; i -= 2) word(0); } putstr(sptr, padding) char *sptr; int padding; { register unsigned short w; register char *strptr = sptr; register int pad = padding; if ( !CGENNING ) /* * code disabled - do nothing */ return(lc); #ifdef DEBUG if (opt('k')) printf("%5d\t\t\"%s\"\n", lc-HEADER_BYTES, strptr); #endif if (pad == 0) { do { # ifdef DEC11 w = (unsigned short) * strptr; # else w = (unsigned short)*strptr<<8; # endif DEC11 if (w) # ifdef DEC11 w |= *++strptr << 8; # else w |= *++strptr; # endif DEC11 word(w); } while (*strptr++); } else { # ifdef DEC11 do { w = (unsigned short) * strptr; if (w) { if (*++strptr) w |= *strptr << 8; else { w |= ' \0'; pad--; } word(w); } } while (*strptr++); # else do { w = (unsigned short)*strptr<<8; if (w) { if (*++strptr) w |= *strptr; else { w |= ' '; pad--; } word(w); } } while (*strptr++); # endif DEC11 while (pad > 1) { word(' '); pad -= 2; } if (pad == 1) # ifdef DEC11 word(' '); # else word(' \0'); # endif DEC11 else word(0); } } #endif OBJ lenstr(sptr, padding) char *sptr; int padding; { register int cnt; register char *strptr = sptr; cnt = padding; do { cnt++; } while (*strptr++); return((++cnt) & ~1); } /* * Patch repairs the branch * at location loc to come * to the current location. * for PC, this puts down the label * and the branch just references that label. * lets here it for two pass assemblers. */ patch(loc) { # ifdef OBJ patchfil(loc, (long)(lc-loc-2), 1); # endif OBJ # ifdef PC putlab( loc ); # endif PC } #ifdef OBJ patch4(loc) { patchfil(loc, (long)(lc - HEADER_BYTES), 2); } /* * Patchfil makes loc+2 have value * as its contents. */ patchfil(loc, value, words) PTR_DCL loc; long value; int words; { register i; int val; if ( !CGENNING ) return; if (loc > (unsigned) lc) panic("patchfil"); #ifdef DEBUG if (opt('k')) printf("\tpatch %u %D\n", loc - HEADER_BYTES, value); #endif val = value; do { # ifndef DEC11 if (words > 1) val = value >> 16; else val = value; # endif DEC11 i = ((unsigned) loc + 2 - ((unsigned) lc & ~01777))/2; if (i >= 0 && i < 1024) obuf[i] = val; else { lseek(ofil, (long) loc+2, 0); write(ofil, &val, 2); lseek(ofil, (long) 0, 2); } loc += 2; # ifdef DEC11 val = value >> 16; # endif DEC11 } while (--words); } /* * Put the word o into the code */ word(o) int o; { *obufp = o; obufp++; lc += 2; if (obufp >= obuf+512) pflush(); } extern char *obj; /* * Flush the code buffer */ pflush() { register i; i = (obufp - ( ( short * ) obuf ) ) * 2; if (i != 0 && write(ofil, obuf, i) != i) perror(obj), pexit(DIED); obufp = obuf; } #endif OBJ /* * Getlab - returns the location counter. * included here for the eventual code generator. * for PC, thank you! */ getlab() { # ifdef OBJ return (lc); # endif OBJ # ifdef PC static long lastlabel; return ( ++lastlabel ((); # endif PC } /* * Putlab - lay down a label. * for PC, just print the label name with a colon after it. */ putlab(l) int l; { # ifdef PC putprintf( PREFIXFORMAT , 1 , LABELPREFIX , l ); putprintf( ":" , 0 ); # endif PC return (l); } uf; } #endif OBJ /* * Getlab - returns the location counter. * included here for the eventual code generator. * for PC, thank you! */ getlab() { # ifdef OBJ return (lc); # endif OBJ # ifdef PC static long lastlabel; return ( ++lastlabel cmd/pc0/putn.c 644 0 33 1711 2552606605 6420 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)putn.c 1.1 8/27/80"; /* * put[1234] * these sort of replace the assembler code * which used to mung the stack inserting 1, 2, 3, or 4 and then * jmp ( not jsr ) to put. these are more portable, * but since they can only receive integer arguments, calls * to one of these with long or real arguments must be changed * to call put directly. */ /* * is there some reason why these aren't #defined? */ put1 ( arg1 ) int arg1; { return ( put ( 1 , arg1 ) ); } put2 ( arg1 , arg2 ) int arg1 , arg2; { return ( put ( 2 , arg1 , arg2 ) ); } put3 ( arg1 , arg2 , arg3 ) int arg1 , arg2 , arg3; { return ( put ( 3 , arg1 , arg2 , arg3 ) ); } put4 ( arg1 , arg2 , arg3 , arg4 ) int arg1 , arg2 , arg3 , arg4; { return ( put ( 4 , arg1 , arg2 , arg3 , arg4 ) ); } all put directly. */ /* * is there some cmd/pc0/rec.c 644 0 33 13501 2552606605 6223 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)rec.c 1.4 4/1/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "opcode.h" /* * Build a record namelist entry. * Some of the processing here is somewhat involved. * The basic structure we are building is as follows. * * Each record has a main RECORD entry, with an attached * chain of fields as ->chain; these include all the fields in all * the variants of this record. * * Attached to NL_VARNT is a chain of VARNT structures * describing each of the variants. These are further linked * through ->chain. Each VARNT has, in ->range[0] the value of * the associated constant, and each points at a RECORD describing * the subrecord through NL_VTOREC. These pointers are not unique, * more than one VARNT may reference the same RECORD. * * The involved processing here is in computing the NL_OFFS entry * by maxing over the variants. This works as follows. * * Each RECORD has two size counters. NL_OFFS is the maximum size * so far of any variant of this record; NL_FLDSZ gives the size * of just the FIELDs to this point as a base for further variants. * * As we process each variant record, we start its size with the * NL_FLDSZ we have so far. After processing it, if its NL_OFFS * is the largest so far, we update the NL_OFFS of this subrecord. * This will eventually propagate back and update the NL_OFFS of the * entire record. */ /* * P0 points to the outermost RECORD for name searches. */ struct nl *P0; tyrec(r, off) int *r, off; { return tyrec1(r, off, 1); } /* * Define a record namelist entry. * R is the tree for the record to be built. * Off is the offset for the first item in this (sub)record. */ struct nl * tyrec1(r, off, first) register int *r; int off; char first; { register struct nl *p, *P0was; p = defnl(0, RECORD, 0, 0); P0was = P0; if (first) P0 = p; #ifndef PI0 p->value[NL_FLDSZ] = p->value[NL_OFFS] = off; #endif if (r != NIL) { fields(p, r[2]); variants(p, r[3]); } /* * round the lengths of records up to their alignments */ p->value[NL_OFFS] = roundup(p->value[NL_OFFS], (long)align(p)); P0 = P0was; return (p); } /* * Define the fixed part fields for p. */ struct nl * fields(p, r) struct nl *p; int *r; { register int *fp, *tp, *ip; struct nl *jp; for (fp = r; fp != NIL; fp = fp[2]) { tp = fp[1]; if (tp == NIL) continue; jp = gtype(tp[3]); line = tp[1]; for (ip = tp[2]; ip != NIL; ip = ip[2]) deffld(p, ip[1], jp); } } /* * Define the variants for RECORD p. */ struct nl * variants(p, r) struct nl *p; register int *r; { register int *vc, *v; int *vr; struct nl *ct; if (r == NIL) return; ct = gtype(r[3]); if ( ( ct != NIL ) && ( isnta( ct , "bcsi" ) ) ) { error("Tag fields cannot be %ss" , nameof( ct ) ); } line = r[1]; /* * Want it even if r[2] is NIL so * we check its type in "new" and "dispose" * calls -- link it to NL_TAG. */ p->ptr[NL_TAG] = deffld(p, r[2], ct); for (vc = r[4]; vc != NIL; vc = vc[2]) { v = vc[1]; if (v == NIL) continue; vr = tyrec1(v[3], p->value[NL_FLDSZ], 0); #ifndef PI0 if (vr->value[NL_OFFS] > p->value[NL_OFFS]) p->value[NL_OFFS] = vr->value[NL_OFFS]; #endif line = v[1]; for (v = v[2]; v != NIL; v = v[2]) defvnt(p, v[1], vr, ct); } } /* * Define a field in subrecord p of record P0 * with name s and type t. */ struct nl * deffld(p, s, t) struct nl *p; register char *s; register struct nl *t; { register struct nl *fp; if (reclook(P0, s) != NIL) { #ifndef PI1 error("%s is a duplicate field name in this record", s); #endif s = NIL; } #ifndef PI0 /* * it used to be easy to keep track of offsets of fields * and total sizes of records. * but now, the offset of the field is aligned * so only it knows it's offset, and calculating * the total size of the record is based on it, * rather than just the width of the field. */ fp = enter(defnl(s, FIELD, t, (int)roundup(p->value[NL_OFFS], (long)align(t)))); #else fp = enter(defnl(s, FIELD, t, 0)); #endif if (s != NIL) { fp->chain = P0->chain; P0->chain = fp; #ifndef PI0 /* * and the size of the record is incremented. */ p -> value[ NL_OFFS ] = fp -> value[ NL_OFFS ] + width( t ); p -> value[ NL_FLDSZ ] = p -> value[ NL_OFFS ]; #endif if (t != NIL) { P0->nl_flags |= t->nl_flags & NFILES; p->nl_flags |= t->nl_flags & NFILES; } # ifdef PC stabfield( s , p2type( t ) , fp -> value[ NL_OFFS ] , lwidth( t ) ); # endif PC } return (fp); } /* * Define a variant from the constant tree of t * in subrecord p of record P0 where the casetype * is ct and the variant record to be associated is vr. */ struct nl * defvnt(p, t, vr, ct) struct nl *p, *vr; int *t; register struct nl *ct; { register struct nl *av; gconst(t); if (ct != NIL && incompat(con.ctype, ct , t )) { #ifndef PI1 cerror("Variant label type incompatible with selector type"); #endif ct = NIL; } av = defnl(0, VARNT, ct, 0); #ifndef PI1 if (ct != NIL) uniqv(p); #endif av->chain = p->ptr[NL_VARNT]; p->ptr[NL_VARNT] = av; av->ptr[NL_VTOREC] = vr; av->range[0] = con.crval; return (av); } #ifndef PI1 /* * Check that the constant label value * is unique among the labels in this variant. */ uniqv(p) struct nl *p; { register struct nl *vt; for (vt = p->ptr[NL_VARNT]; vt != NIL; vt = vt->chain) if (vt->range[0] == con.crval) { error("Duplicate variant case label in record"); return; } } #endif /* * See if the field name s is defined * in the record p, returning a pointer * to it namelist entry if it is. */ struct nl * reclook(p, s) register struct nl *p; char *s; { if (p == NIL || s == NIL) return (NIL); for (p = p->chain; p != NIL; p = p->chain) if (p->symbol == s) return (p); return (NIL); } ster struct nl *vt; for (vt = p->ptr[NL_VARNT]; vt != NIL; vt = vt->chain) if (vt->range[0] == con.crval) { error("Duplicate variant case label in record"); return; } } #endif /*cmd/pc0/rval.c 644 0 33 63750 2552606606 6432 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)rval.c 1.12 6/1/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "opcode.h" #include "objfmt.h" #ifdef PC # include "pc.h" # include "pcops.h" #endif PC extern char *opnames[]; /* line number of the last record comparison warning */ short reccompline = 0; /* line number of the last non-standard set comparison */ short nssetline = 0; #ifdef PC char *relts[] = { "_RELEQ" , "_RELNE" , "_RELTLT" , "_RELTGT" , "_RELTLE" , "_RELTGE" }; char *relss[] = { "_RELEQ" , "_RELNE" , "_RELSLT" , "_RELSGT" , "_RELSLE" , "_RELSGE" }; long relops[] = { P2EQ , P2NE , P2LT , P2GT , P2LE , P2GE }; long mathop[] = { P2MUL , P2PLUS , P2MINUS }; char *setop[] = { "_MULT" , "_ADDT" , "_SUBT" }; #endif PC /* * Rvalue - an expression. * * Contype is the type that the caller would prefer, nand is important * if constant sets(( or constant strings are involved, the latter * because of string padding. * required is a flag whether an lvalue or an rvalue is required. * only VARs and structured things can have gt their lvalue this way. */ struct nl * rvalue(r, contype , required ) int *r; struct nl *contype; int required; { register struct nl *p, *p1; register struct nl *q; int c, c1, *rt, w, g; char *cp, *cp1, *opname; long l; double f; extern int flagwas; struct csetstr csetd; # ifdef PC struct nl *rettype; long ctype; struct nl *tempnlp; # endif PC if (r == NIL) return (NIL); if (nowexp(r)) return (NIL); /* * Pick up the name of the operation * for future error messages. */ if (r[0] <= T_IN) opname = opnames[r[0]]; /* * The root of the tree tells us what sort of expression we have. */ switch (r[0]) { /* * The constant nil */ case T_NIL: # ifdef OBJ put(2, O_CON2, 0); # endif OBJ # ifdef PC putleaf( P2ICON , 0 , 0 , P2PTR|P2UNDEF , 0 ); # endif PC return (nl+TNIL); /* * Function call with arguments. */ case T_FCALL: # ifdef OBJ return (funccod(r)); # endif OBJ # ifdef PC return (pcfunccod( r )); # endif PC case T_VAR: p = lookup(r[2]); if (p == NIL || p->class == BADUSE) return (NIL); switch (p->class) { case VAR: /* * If a variable is * qualified then get * the rvalue by a * lvalue and an ind. */ if (r[3] != NIL) goto ind; q = p->type; if (q == NIL) return (NIL); # ifdef OBJ w = width(q); switch (w) { case 8: put(2, O_RV8 | bn << 8+INDX, (int)p->value[0]); break; case 4: put(2, O_RV4 | bn << 8+INDX, (int)p->value[0]); break; case 2: put(2, O_RV2 | bn << 8+INDX, (int)p->value[0]); break; case 1: put(2, O_RV1 | bn << 8+INDX, (int)p->value[0]); break; default: put(3, O_RV | bn << 8+INDX, (int)p->value[0], w); } # endif OBJ # ifdef PC if ( required == RREQ ) { putRV( p -> symbol , bn , p -> value[0] , p -> extra_flags , p2type( q ) ); } else { putLV( p -> symbol , bn , p -> value[0] , p -> extra_flags , p2type( q ) ); } # endif PC return (q); case WITHPTR: case REF: /* * A lvalue for these * is actually what one * might consider a rvalue. */ ind: q = lvalue(r, NOFLAGS , LREQ ); if (q == NIL) return (NIL); # ifdef OBJ w = width(q); switch (w) { case 8: put(1, O_IND8); break; case 4: put(1, O_IND4); break; case 2: put(1, O_IND2); break; case 1: put(1, O_IND1); break; default: put(2, O_IND, w); } # endif OBJ # ifdef PC if ( required == RREQ ) { putop( P2UNARY P2MUL , p2type( q ) ); } # endif PC return (q); case CONST: if (r[3] != NIL) { error("%s is a constant and cannot be qualified", r[2]); return (NIL); } q = p->type; if (q == NIL) return (NIL); if (q == nl+TSTR) { /* * Find the size of the string * constant if needed. */ cp = p->ptr[0]; cstrng: cp1 = cp; for (c = 0; *cp++; c++) continue; w = c; if (contype != NIL && !opt('s')) { if (width(contype) < c && classify(contype) == TSTR) { error("Constant string too long"); return (NIL); } w = width(contype); } # ifdef OBJ put(2, O_CONG, w); putstr(cp1, w - c); # endif OBJ # ifdef PC putCONG( cp1 , w , required ); # endif PC /* * Define the string temporarily * so later people can know its * width. * cleaned out by stat. */ q = defnl(0, STR, 0, w); q->type = q; return (q); } if (q == nl+T1CHAR) { # ifdef OBJ put(2, O_CONC, (int)p->value[0]); # endif OBJ # ifdef PC putleaf( P2ICON , p -> value[0] , 0 , P2CHAR , 0 ); # endif PC return (q); } /* * Every other kind of constant here */ switch (width(q)) { case 8: #ifndef DEBUG # ifdef OBJ put(2, O_CON8, p->real); # endif OBJ # ifdef PC putCON8( p -> real ); # endif PC #else if (hp21mx) { f = p->real; conv(&f); l = f.plong; put(2, O_CON4, l); } else # ifdef OBJ put(2, O_CON8, p->real); # endif OBJ # ifdef PC putCON8( p -> real ); # endif PC #endif break; case 4: # ifdef OBJ put(2, O_CON4, p->range[0]); # endif OBJ # ifdef PC putleaf( P2ICON , p -> range[0] , 0 , P2INT , 0 ); # endif PC break; case 2: # ifdef OBJ put(2, O_CON2, (short)p->range[0]); # endif OBJ # ifdef PC /* * make short constants ints */ putleaf( P2ICON , (short) p -> range[0] , 0 , P2INT , 0 ); # endif PC break; case 1: # ifdef OBJ put(2, O_CON1, p->value[0]); # endif OBJ # ifdef PC /* * make char constants ints */ putleaf( P2ICON , p -> value[0] , 0 , P2INT , 0 ); # endif PC break; default: panic("rval"); } return (q); case FUNC: case FFUNC: /* * Function call with no arguments. */ if (r[3]) { error("Can't qualify a function result value"); return (NIL); } # ifdef OBJ return (funccod((int *) r)); # endif OBJ # ifdef PC return (pcfunccod( r )); # endif PC case TYPE: error("Type names (e.g. %s) allowed only in declarations", p->symbol); return (NIL); case PROC: case FPROC: error("Procedure %s found where expression required", p->symbol); return (NIL); default: panic("rvid"); } /* * Constant sets */ case T_CSET: # ifdef OBJ if ( precset( r , contype , &csetd ) ) { if ( csetd.csettype == NIL ) { return NIL; } postcset( r , &csetd ); } else { put( 2, O_PUSH, -lwidth(csetd.csettype)); postcset( r , &csetd ); setran( ( csetd.csettype ) -> type ); put( 2, O_CON24, set.uprbp); put( 2, O_CON24, set.lwrb); put( 2, O_CTTOT, (int)(4 + csetd.singcnt + 2 * csetd.paircnt)); } return csetd.csettype; # endif OBJ # ifdef PC if ( precset( r , contype , &csetd ) ) { if ( csetd.csettype == NIL ) { return NIL; } postcset( r , &csetd ); } else { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_CTTOT" ); /* * allocate a temporary and use it */ tempnlp = tmpalloc(lwidth(csetd.csettype), csetd.csettype, NOREG); putLV( 0 , cbn , tempnlp -> value[ NL_OFFS ] , tempnlp -> extra_flags , P2PTR|P2STRTY ); setran( ( csetd.csettype ) -> type ); putleaf( P2ICON , set.lwrb , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , set.uprbp , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); postcset( r , &csetd ); putop( P2CALL , P2INT ); } return csetd.csettype; # endif PC /* * Unary plus and minus */ case T_PLUS: case T_MINUS: q = rvalue(r[2], NIL , RREQ ); if (q == NIL) return (NIL); if (isnta(q, "id")) { error("Operand of %s must be integer or real, not %s", opname, nameof(q)); return (NIL); } if (r[0] == T_MINUS) { # ifdef OBJ put(1, O_NEG2 + (width(q) >> 2)); # endif OBJ # ifdef PC putop( P2UNARY P2MINUS , p2type( q ) ); # endif PC return (isa(q, "d") ? q : nl+T4INT); } return (q); case T_NOT: q = rvalue(r[2], NIL , RREQ ); if (q == NIL) return (NIL); if (isnta(q, "b")) { error("not must operate on a Boolean, not %s", nameof(q)); return (NIL); } # ifdef OBJ put(1, O_NOT); # endif OBJ # ifdef PC putop( P2NOT , P2INT ); # endif PC return (nl+T1BOOL); case T_AND: case T_OR: p = rvalue(r[2], NIL , RREQ ); p1 = rvalue(r[3], NIL , RREQ ); if (p == NIL || p1 == NIL) return (NIL); if (isnta(p, "b")) { error("Left operand of %s must be Boolean, not %s", opname, nameof(p)); return (NIL); } if (isnta(p1, "b")) { error("Right operand of %s must be Boolean, not %s", opname, nameof(p1)); return (NIL); } # ifdef OBJ put(1, r[0] == T_AND ? O_AND : O_OR); # endif OBJ # ifdef PC /* * note the use of & and | rather than && and || * to force evaluation of all the expressions. */ putop( r[ 0 ] == T_AND ? P2AND : P2OR , P2INT ); # endif PC return (nl+T1BOOL); case T_DIVD: # ifdef OBJ p = rvalue(r[2], NIL , RREQ ); p1 = rvalue(r[3], NIL , RREQ ); # endif OBJ # ifdef PC /* * force these to be doubles for the divide */ p = rvalue( r[ 2 ] , NIL , RREQ ); if ( isnta( p , "d" ) ) { putop( P2SCONV , P2DOUBLE ); } p1 = rvalue( r[ 3 ] , NIL , RREQ ); if ( isnta( p1 , "d" ) ) { putop( P2SCONV , P2DOUBLE ); } # endif PC if (p == NIL || p1 == NIL) return (NIL); if (isnta(p, "id")) { error("Left operand of / must be integer or real, not %s", nameof(p)); return (NIL); } if (isnta(p1, "id")) { error("Right operand of / must be integer or real, not %s", nameof(p1)); return (NIL); } # ifdef OBJ return gen(NIL, r[0], width(p), width(p1)); # endif OBJ # ifdef PC putop( P2DIV , P2DOUBLE ); return nl + TDOUBLE; # endif PC case T_MULT: case T_ADD: case T_SUB: # ifdef OBJ /* * If the context hasn't told us the type * and a constant set is present * we need to infer the type * before generating code. */ if ( contype == NIL ) { codeoff(); contype =(( rvalue( r[3] , NIL , RREQ ); codeon(); if ( contype == lookup( intset ) -> type ) { codeoff(); contype = rvalue( r[2] , NIL , RREQ ); codeon(); } } if ( contype == NIL ) { return NIL; } p = rvalue( r[2] , contype , RREQ ); p1 = rvalue( r[3] , p , RREQ ); if ( p == NIL || p1 == NIL ) return NIL; if (isa(p, "id") && isa(p1, "id")) return (gen(NIL, r[0], width(p), width(p1))); if (isa(p, "t") && isa(p1, "t")) { if (p != p1) { error("Set types of operands of %s must be identical", opname); return (NIL); } gen(TSET, r[0], width(p), 0); return (p); } # endif OBJ # ifdef PC /* * the second pass can't do * long op double or double op long * so we have to know the type of both operands * also, it gets tricky for sets, which are done * by function calls. */ codeoff(); p1 = rvalue( r[ 3 ] , contype , RREQ ); codeon(); if ( isa( p1 , "id" ) ) { p = rvalue( r[ 2 ] , contype , RREQ ); if ( ( p == NIL ) || ( p1 == NIL ) ) { return NIL; } if ( isa( p , "i" ) && isa( p1 , "d" ) ) { putop( P2SCONV , P2DOUBLE ); } p1 = rvalue( r[ 3 ] , contype , RREQ ); if ( isa( p , "d" ) && isa( p1 , "i" ) ) { putop( P2SCONV , P2DOUBLE ); } if ( isa( p , "id" ) ) { if ( isa( p , "d" ) || isa( p1 , "d" ) ) { ctype = P2DOUBLE; rettype = nl + TDOUBLE; } else { ctype = P2INT; rettype = nl + T4INT; } putop( mathop[ r[0] - T_MULT ] , ctype ); return rettype; } } if ( isa( p1 , "t" ) ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( ADDTYPE( P2PTR | P2STRTY , P2FTN ) , P2PTR ) , setop[ r[0] - T_MULT ] ); if ( contype == NIL ) { contype = p1; if ( contype == lookup( intset ) -> type ) { codeoff(); contype = rvalue( r[2] , NIL , LREQ ); codeon(); } } if ( contype == NIL ) { return NIL; } /* * allocate a temporary and use it */ tempnlp = tmpalloc(lwidth(contype), contype, NOREG); putLV( 0 , cbn , tempnlp -> value[ NL_OFFS ] , tempnlp -> extra_flags , P2PTR|P2STRTY ); p = rvalue( r[2] , contype , LREQ ); if ( isa( p , "t" ) ) { putop( P2LISTOP , P2INT ); if ( p == NIL || p1 == NIL ) { return NIL; } p1 = rvalue( r[3] , p , LREQ ); if ( p != p1 ) { error("Set types of operands of %s must be identical", opname); return NIL; } putop( P2LISTOP , P2INT ); putleaf( P2ICON , lwidth( p1 ) / sizeof( long ) , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2PTR | P2STRTY ); return p; } } if ( isnta( p1 , "idt" ) ) { /* * find type of left operand for error message. */ p = rvalue( r[2] , contype , RREQ ); } /* * don't give spurious error messages. */ if ( p == NIL || p1 == NIL ) { return NIL; } # endif PC if (isnta(p, "idt")) { error("Left operand of %s must be integer, real or set, not %s", opname, nameof(p)); return (NIL); } if (isnta(p1, "idt")) { error("Right operand of %s must be integer, real or set, not %s", opname, nameof(p1)); return (NIL); } error("Cannot mix sets with integers and reals as operands of %s", opname); return (NIL); case T_MOD: case T_DIV: p = rvalue(r[2], NIL , RREQ ); p1 = rvalue(r[3], NIL , RREQ ); if (p == NIL || p1 == NIL) return (NIL); if (isnta(p, "i")) { error("Left operand of %s must be integer, not %s", opname, nameof(p)); return (NIL); } if (isnta(p1, "i")) { error("Right operand of %s must be integer, not %s", opname, nameof(p1)); return (NIL); } # ifdef OBJ return (gen(NIL, r[0], width(p), width(p1))); # endif OBJ # ifdef PC putop( r[ 0 ] == T_DIV ? P2DIV : P2MOD , P2INT ); return ( nl + T4INT ); # endif PC case T_EQ: case T_NE: case T_LT: case T_GT: case T_LE: case T_GE: /* * Since there can be no, a priori, knowledge * of the context type should a constant string * or set arise, we must poke around to find such * a type if possible. Since constant strings can * always masquerade as identifiers, this is always * necessary. */ codeoff(); p1 = rvalue(r[3], NIL , RREQ ); codeon(); if (p1 == NIL) return (NIL); contype = p1; # ifdef OBJ if (p1->class == STR) { /* * For constant strings we want * the longest type so as to be * able to do padding (more importantly * avoiding truncation). For clarity, * we get this length here. */ codeoff(); p = rvalue(r[2], NIL , RREQ ); codeon(); if (p == NIL) return (NIL); if (width(p) > width(p1)) contype = p; } else if ( isa( p1 , "t" ) ) { if ( contype == lookup( intset ) -> type ) { codeoff(); contype = rvalue( r[2] , NIL , RREQ ); codeon(); if ( contype == NIL ) { return NIL; } } } /* * Now we generate code for * the operands of the relational * operation. */ p = rvalue(r[2], contype , RREQ ); if (p == NIL) return (NIL); p1 = rvalue(r[3], p , RREQ ); if (p1 == NIL) return (NIL); # endif OBJ # ifdef PC c1 = classify( p1 ); if ( c1 == TSET || c1 == TSTR || c1 == TREC ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , c1 == TSET ? relts[ r[0] - T_EQ ] : relss[ r[0] - T_EQ ] ); /* * for [] and strings, comparisons are done on * the maximum width of the two sides. * for other sets, we have to ask the left side * what type it is based on the type of the right. * (this matters for intsets). */ if ( c1 == TSTR ) { codeoff(); p = rvalue( r[ 2 ] , NIL , LREQ ); codeon(); if ( p == NIL ) { return NIL; } if ( lwidth( p ) > lwidth( p1 ) ) { contype = p; } } else if ( c1 == TSET ) { if ( contype == lookup( intset ) -> type ) { codeoff(); p = rvalue( r[ 2 ] , NIL , LREQ ); codeon(); if ( p == NIL ) { return NIL; } contype = p; } } /* * put out the width of the comparison. */ putleaf( P2ICON , lwidth( contype ) , 0 , P2INT , 0 ); /* * and the left hand side, * for sets, strings, records */ p = rvalue( r[ 2 ] , contype , LREQ ); putop( P2LISTOP , P2INT ); p1 = rvalue( r[ 3 ] , p , LREQ ); putop( P2LISTOP , P2INT ); putop( P2CALL , P2INT ); } else { /* * the easy (scalar or error) case */ p = rvalue( r[ 2 ] , contype , RREQ ); if ( p == NIL ) { return NIL; } /* * since the second pass can't do * long op double or double op long * we may have to do some coercing. */ if ( isa( p , "i" ) && isa( p1 , "d" ) ) { putop( P2SCONV , P2DOUBLE ); } p1 = rvalue( r[ 3 ] , p , RREQ ); if ( isa( p , "d" ) && isa( p1 , "i" ) ) putop( P2SCONV , P2DOUBLE ); putop( relops[ r[0] - T_EQ ] , P2INT ); } # endif PC c = classify(p); c1 = classify(p1); if (nocomp(c) || nocomp(c1)) return (NIL); g = NIL; switch (c) { case TBOOL: case TCHAR: if (c != c1) goto clash; break; case TINT: case TDOUBLE: if (c1 != TINT && c1 != TDOUBLE) goto clash; break; case TSCAL: if (c1 != TSCAL) goto clash; if (scalar(p) != scalar(p1)) goto nonident; break; case TSET: if (c1 != TSET) goto clash; if ( opt( 's' ) && ( ( r[0] == T_LT ) || ( r[0] == T_GT ) ) && ( line != nssetline ) ) { nssetline = line; standard(); error("%s comparison on sets is non-standard" , opname ); } if (p != p1) goto nonident; g = TSET; break; case TREC: if ( c1 != TREC ) { goto clash; } if ( p != p1 ) { goto nonident; } if (r[0] != T_EQ && r[0] != T_NE) { error("%s not allowed on records - only allow = and <>" , opname ); return (NIL); } g = TREC; break; case TPTR: case TNIL: if (c1 != TPTR && c1 != TNIL) goto clash; if (r[0] != T_EQ && r[0] != T_NE) { error("%s not allowed on pointers - only allow = and <>" , opname ); return (NIL); } break; case TSTR: if (c1 != TSTR) goto clash; if (width(p) != width(p1)) { error("Strings not same length in %s comparison", opname); return (NIL); } g = TSTR; break; default: panic("rval2"); } # ifdef OBJ return (gen(g, r[0], width(p), width(p1))); # endif OBJ # ifdef PC return nl + TBOOL; # endif PC clash: error("%ss and %ss cannot be compared - operator was %s", clnames[c], clnames[c1], opname); return (NIL); nonident: error("%s types must be identical in comparisons - operator was %s", clnames[c1], opname); return (NIL); case T_IN: rt = r[3]; # ifdef OBJ if (rt != NIL && rt[0] == T_CSET) { precset( rt , NIL , &csetd ); p1 = csetd.csettype; if (p1 == NIL) return NIL; postcset( rt, &csetd); } else { p1 = stkrval(r[3], NIL , RREQ ); rt = NIL; } # endif OBJ # ifdef PC if (rt != NIL && rt[0] == T_CSET) { if ( precset( rt , NIL , &csetd ) ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_IN" ); } else { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_INCT" ); } p1 = csetd.csettype; if (p1 == NIL) return NIL; } else { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_IN" ); codeoff(); p1 = rvalue(r[3], NIL , LREQ ); codeon(); } # endif PC p = stkrval(r[2], NIL , RREQ ); if (p == NIL || p1 == NIL) return (NIL); if (p1->class != SET) { error("Right operand of 'in' must be a set, not %s", nameof(p1)); return (NIL);(( } if (incompat(p, p1->type, r[2])) { cerror("Index type clashed with set component type for 'in'"); return (NIL); } setran(p1->type); # ifdef OBJ if (rt == NIL || csetd.comptime) put(4, O_IN, width(p1), set.lwrb, set.uprbp); else put(2, O_INCT, (int)(3 + csetd.singcnt + 2*csetd.paircnt)); # endif OBJ # ifdef PC if ( rt == NIL || rt[0] != T_CSET ) { putleaf( P2ICON , set.lwrb , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , set.uprbp , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); p1 = rvalue( r[3] , NIL , LREQ ); putop( P2LISTOP , P2INT ); } else if ( csetd.comptime ) { putleaf( P2ICON , set.lwrb , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); putleaf( P2ICON , set.uprbp , 0 , P2INT , 0 ); putop( P2LISTOP , P2INT ); postcset( r[3] , &csetd ); putop( P2LISTOP , P2INT ); } else { postcset( r[3] , &csetd ); } putop( P2CALL , P2INT ); # endif PC return (nl+T1BOOL); default: if (r[2] == NIL) return (NIL); switch (r[0]) { default: panic("rval3"); /* * An octal number */ case T_BINT: f = a8tol(r[2]); goto conint; /* * A decimal number */ case T_INT: f = atof(r[2]); conint: if (f > MAXINT || f < MININT) { error("Constant too large for this implementation"); return (NIL); } l = f; if (bytes(l, l) <= 2) { # ifdef OBJ put(2, O_CON2, ( short ) l); # endif OBJ # ifdef PC /* * short constants are ints */ putleaf( P2ICON , l , 0 , P2INT , 0 ); # endif PC return (nl+T2INT); } # ifdef OBJ put(2, O_CON4, l); # endif OBJ # ifdef PC putleaf( P2ICON , l , 0 , P2INT , 0 ); # endif PC return (nl+T4INT); /* * A floating point number */ case T_FINT: # ifdef OBJ put(2, O_CON8, atof(r[2])); # endif OBJ # ifdef PC putCON8( atof( r[2] ) ); # endif PC return (nl+TDOUBLE); /* * Constant strings. Note that constant characters * are constant strings of length one; there is * no constant string of length one. */ case T_STRNG: cp = r[2]; if (cp[1] == 0) { # ifdef OBJ put(2, O_CONC, cp[0]); # endif OBJ # ifdef PC putleaf( P2ICON , cp[0] , 0 , P2CHAR , 0 ); # endif PC return (nl+T1CHAR); } goto cstrng; } } } /* * Can a class appear * in a comparison ? */ nocomp(c) int c; { switch (c) { case TREC: if ( line != reccompline ) { reccompline = line; warning(); if ( opt( 's' ) ) { standard(); } error("record comparison is non-standard"); } break; case TFILE: case TARY: error("%ss may not participate in comparisons", clnames[c]); return (1); } return (NIL); } /* * this is sort of like gconst, except it works on expression trees * rather than declaration trees, and doesn't give error messages for * non-constant things. * as a side effect this fills in the con structure that gconst uses. * this returns TRUE or FALSE. */ constval(r) register int *r; { register struct nl *np; register *cn; char *cp; int negd, sgnd; long ci; con.ctype = NIL; cn = r; negd = sgnd = 0; loop: /* * cn[2] is nil if error recovery generated a T_STRNG */ if (cn == NIL || cn[2] == NIL) return FALSE; switch (cn[0]) { default: return FALSE; case T_MINUS: negd = 1 - negd; /* and fall through */ case T_PLUS: sgnd++; cn = cn[2]; goto loop; case T_NIL: con.cpval = NIL; con.cival = 0; con.crval = con.cival; con.ctype = nl + TNIL; break; case T_VAR: np = lookup(cn[2]); if (np == NIL || np->class != CONST) { return FALSE; } if ( cn[3] != NIL ) { return FALSE; } con.ctype = np->type; switch (classify(np->type)) { case TINT: con.crval = np->range[0]; break; case TDOUBLE: con.crval = np->real; break; case TBOOL: case TCHAR: case TSCAL: con.cival = np->value[0]; con.crval = con.cival; break; case TSTR: con.cpval = np->ptr[0]; break; default: con.ctype = NIL; return FALSE; } break; case T_BINT: con.crval = a8tol(cn[2]); goto restcon; case T_INT: con.crval = atof(cn[2]); if (con.crval > MAXINT || con.crval < MININT) { derror("Constant too large for this implementation"); con.crval = 0; } restcon: ci = con.crval; #ifndef PI0 if (bytes(ci, ci) <= 2) con.ctype = nl+T2INT; else #endif con.ctype = nl+T4INT; break; case T_FINT: con.ctype = nl+TDOUBLE; con.crval = atof(cn[2]); break; case T_STRNG: cp = cn[2]; if (cp[1] == 0) { con.ctype = nl+T1CHAR; con.cival = cp[0]; con.crval = con.cival; break; } con.ctype = nl+TSTR; con.cpval = cp; break; } if (sgnd) { if (isnta(con.ctype, "id")) { derror("%s constants cannot be signed", nameof(con.ctype)); return FALSE; } else if (negd) con.crval = -con.crval; } return TRUE; } ndif con.ctype = nl+cmd/pc0/send.h 644 0 33 1122 2552606606 6365 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)send.h 1.1 8/27/80"; */ #define RINIT 1 #define RENQ 2 #define RTREE 3 #define RTRFREE 4 #define RTRCHK 5 #define REVENIT 6 #define RSTRING 7 #define REVLAB 8 #define REVCNST 9 #define REVTBEG 10 #define REVTYPE 11 #define REVTEND 12 #define REVVBEG 13 #define REVVAR 14 #define REVVEND 15 #define REVFHDR 16 #define REVFFWD 17 #define REVFBDY 18 #define REVFEND 19 #define ROPUSH 20 #define ROPOP 21 #define ROSET 22 #define RKILL 23 #define RFINISH 24 #define RLAST 24 extern char *trdesc[]; ccsid[] = "@(#)send.h 1.1 8/27/80"; */ #define RINIT 1 #define RENQ 2 #define RTREE 3 #define RTRFREE 4 #define RTRCHK 5 #define REVENIT 6 #define RSTRING 7 #define REVLAB 8 #define REVCNST 9 #define REVTBEG 10 #define REVTYPE 11 #define REVTEND 12 #define REVVBEG 13 #define REVVAR 14 #define REVVEND 15 #define REVFHDR 16 #define REVFFWD 17 #define REVFBDY 18 #define REVFEND 19 #define ROPUSH 20 #define ROPOP 21 #define ROSETcmd/pc0/stab.c 644 0 33 14737 2552606607 6421 /* Copyright (c) 1980 Regents of the University of California */ static char sccsid[] = "@(#)stab.c 1.6 3/24/81"; /* * procedures to put out sdb symbol table information. * and stabs for separate compilation type checking. * these use the new .stabs, .stabn, and .stabd directives */ #include "whoami.h" #ifdef PC /* and the rest of the file */ # include "0.h" # include /* * additional symbol definition for * that is used by the separate compilation facility -- * eventually, should be updated to include this */ # include "pstab.h" # include "pc.h" /* * absolute value: line numbers are negative if error recovery. */ #define ABS( x ) ( x < 0 ? -x : x ) /* * global variables */ stabgvar( name , type , offset , length , line ) char *name; int type; int offset; int length; int line; { /* * for separate compilation */ putprintf( " .stabs \"%s\",0x%x,0,0x%x,0x%x" , 0 , name , N_PC , N_PGVAR , ABS( line ) ); /* * for sdb */ if ( ! opt('g') ) { return; } putprintf( " .stabs \"" , 1 ); putprintf( NAMEFORMAT , 1 , name ); putprintf( "\",0x%x,0,0x%x,0" , 0 , N_GSYM , type ); putprintf( " .stabs \"" , 1 ); putprintf( NAMEFORMAT , 1 , name ); putprintf( "\",0x%x,0,0,0x%x" , 0 , N_LENG , length ); } /* * local variables */ stablvar( name , type , level , offset , length ) char *name; int type; int level; int offset; int length; { if ( ! opt('g') ) { return; } putprintf( " .stabs \"" , 1 ); putprintf( NAMEFORMAT , 1 , name ); putprintf( "\",0x%x,0,0x%x,0x%x" , 0 , N_LSYM , type , -offset ); putprintf( " .stabs \"" , 1 ); putprintf( NAMEFORMAT , 1 , name ); putprintf( "\",0x%x,0,0,0x%x" , 0 , N_LENG , length ); } /* * parameters */ stabparam( name , type , offset , length ) char *name; int type; int offset; int length; { if ( ! opt('g') ) { return; } putprintf( " .stabs \"" , 1 ); putprintf( NAMEFORMAT , 1 , name ); putprintf( "\",0x%x,0,0x%x,0x%x" , 0 , N_PSYM , type , offset ); putprintf( " .stabs \"" , 1 ); putprintf( NAMEFORMAT , 1 , name ); putprintf( "\",0x%x,0,0,0x%x" , 0 , N_LENG , length ); } /* * fields */ stabfield( name , type , offset , length ) char *name; int type; int offset; int length; { if ( ! opt('g') ) { return; } putprintf( " .stabs \"" , 1 ); putprintf( NAMEFORMAT , 1 , name ); putprintf( "\",0x%x,0,0x%x,0x%x" , 0 , N_SSYM , type , offset ); putprintf( " .stabs \"" , 1 ); putprintf( NAMEFORMAT , 1 , name ); putprintf( "\",0x%x,0,0,0x%x" , 0 , N_LENG , length ); } /* * left brackets */ stablbrac( level ) int level; { if ( ! opt('g') ) { return; } putprintf( " .stabd 0x%x,0,0x%x" , 0 , N_LBRAC , level ); } /* * right brackets */ stabrbrac( level ) int level; { if ( ! opt('g') ) { return; } put((printf( " .stabd 0x%x,0,0x%x" , 0 , N_RBRAC , level ); } /* * functions */ stabfunc( name , class , line , level ) char *name; int class; int line; long level; { int type; long i; char extname[ BUFSIZ ]; /* * for separate compilation */ if ( level == 1 ) { if ( class == FUNC ) { putprintf( " .stabs \"%s\",0x%x,0,0x%x,0x%x" , 0 , name , N_PC , N_PGFUNC , ABS( line ) ); } else if ( class == PROC ) { putprintf( " .stabs \"%s\",0x%x,0,0x%x,0x%x" , 0 , name , N_PC , N_PGPROC , ABS( line ) ); } } /* * for sdb */ if ( ! opt('g') ) { return; } putprintf( " .stabs \"" , 1 ); putprintf( NAMEFORMAT , 1 , name ); sextname( extname , name , level ); putprintf( "\",0x%x,0,0x%x,%s" , 0 , N_FUN , line , extname ); } /* * source line numbers */ stabline( line ) int line; { if ( ! opt('g') ) { return; } putprintf( " .stabd 0x%x,0,0x%x" , 0 , N_SLINE , ABS( line ) ); } /* * source files */ stabsource( filename ) char *filename; { int label; /* * for separate compilation */ putprintf( " .stabs \"%s\",0x%x,0,0x%x,0" , 0 , filename , N_PC , N_PSO ); /* * for sdb */ if ( ! opt('g') ) { return; } label = getlab(); putprintf( " .stabs \"" , 1 ); putprintf( NAMEFORMAT , 1 , filename ); putprintf( "\",0x%x,0,0," , 1 , N_SO ); putprintf( PREFIXFORMAT , 0 , LLABELPREFIX , label ); putprintf( PREFIXFORMAT , 1 , LLABELPREFIX , label ); putprintf( ":" , 0 ); } /* * included files get one or more of these: * one as they are entered by a #include, * and one every time they are returned to by nested #includes */ stabinclude( filename ) char *filename; { int label; /* * for separate compilation */ putprintf( " .stabs \"%s\",0x%x,0,0x%x,0" , 0 , filename , N_PC , N_PSOL ); /* * for sdb */ if ( ! opt('g') ) { return; } label = getlab(); putprintf( " .stabs \"" , 1 ); putprintf( NAMEFORMAT , 1 , filename ); putprintf( "\",0x%x,0,0," , 1 , N_SOL ); putprintf( PREFIXFORMAT , 0 , LLABELPREFIX , label ); putprintf( PREFIXFORMAT , 1 , LLABELPREFIX , label ); putprintf( ":" , 0 ); } /* * global Pascal symbols : * labels, types, constants, and external procedure and function names: * These are used by the separate compilation facility * to be able to check for disjoint header files. */ /* * global labels */ stabglabel( label , line ) char *label; int line; { putprintf( " .stabs \"%s\",0x%x,0,0x%x,0x%x" , 0 , label , N_PC , N_PGLABEL , ABS( line ) ); } /* * global constants */ stabgconst( const , line ) char *const; int line; { putprintf( " .stabs \"%s\",0x%x,0,0x%x,0x%x" , 0 , const , N_PC , N_PGCONST , ABS( line ) ); } /* * global types */ stabgtype( type , line ) char *type; int line; { putprintf( " .stabs \"%s\",0x%x,0,0x%x,0x%x" , 0 , type , N_PC , N_PGTYPE , ABS( line ) ); } /* * external functions and procedures */ stabefunc( name , class , line ) char *name; int class; int line; { int type; if ( class == FUNC ) { type = N_PEFUNC; } else if ( class == PROC ) { type = N_PEPROC; } else { return; } putprintf( " .stabs \"%s\",0x%x,0,0x%x,0x%x" , 0 , name , N_PC , type , ABS( line ) ); } #endif PC ine; { putprintf( " .stcmd/pc0/stat.c 644 0 33 26625 2552606607 6442 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)stat.c 1.5 6/1/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "objfmt.h" #ifdef PC # include "pcops.h" # include "pc.h" #endif PC int cntstat; short cnts = 3; #include "opcode.h" /* * Statement list */ statlist(r) int *r; { register *sl; for (sl=r; sl != NIL; sl=sl[2]) statement(sl[1]); } /* * Statement */ statement(r) int *r; { register *s; register struct nl *snlp; struct tmps soffset; s = r; snlp = nlp; soffset = sizes[cbn].curtmps; top: if (cntstat) { cntstat = 0; putcnt(); } if (s == NIL) return; line = s[1]; if (s[0] == T_LABEL) { labeled(s[2]); s = s[3]; noreach = 0; cntstat = 1; goto top; } if (noreach) { noreach = 0; warning(); error("Unreachable statement"); } switch (s[0]) { case T_PCALL: putline(); # ifdef OBJ proc(s); # endif OBJ # ifdef PC pcproc( s ); # endif PC break; case T_ASGN: putline(); asgnop(s); break; case T_GOTO: putline(); gotoop(s[2]); noreach = 1; cntstat = 1; break; default: level++; switch (s[0]) { default: panic("stat"); case T_IF: case T_IFEL: ifop(s); break; case T_WHILE: whilop(s); noreach = 0; break; case T_REPEAT: repop(s); break; case T_FORU: case T_FORD: forop(s); noreach = 0; break; case T_BLOCK: statlist(s[2]); break; case T_CASE: putline(); # ifdef OBJ caseop(s); # endif OBJ # ifdef PC pccaseop( s ); # endif PC break; case T_WITH: withop(s); break; case T_ASRT: putline(); asrtop(s); break; } --level; if (gotos[cbn]) ungoto(); break; } /* * Free the temporary name list entries defined in * expressions, e.g. STRs, and WITHPTRs from withs. */ nlfree(snlp); /* * free any temporaries allocated for this statement * these come from strings and sets. */ tmpfree(&soffset); } ungoto() { register struct nl *p; for (p = gotos[cbn]; p != NIL; p = p->chain) if ((p->nl_flags & NFORWD) != 0) { if (p->value[NL_GOLEV] != NOTYET) if (p->value[NL_GOLEV] > level) p->value[NL_GOLEV] = level; } else if (p->value[NL_GOLEV] != DEAD) if (p->value[NL_GOLEV] > level) p->value[NL_GOLEV] = DEAD; } putcnt() { if (monflg == 0) { return; } inccnt( getcnt() ); } int getcnt() { return ++cnts; } inccnt( counter ) int counter; { # ifdef OBJ put(2, O_COUNT, counter ); # endif OBJ # ifdef PC putRV( PCPCOUNT , 0 , counter * sizeof (long) , NGLOBAL , P2INT ); putleaf( P2ICON , 1 , 0 , P2INT , 0 ); putop( P2ASG P2PLUS , P2INT ); putdot( filename , line ); # endif PC } putline() { # ifdef OBJ if (opt('p') != 0) put(2, O_LINO, line); # endif OBJ # ifdef PC static lastline; if ( line != lastline ) { stabline( line ); lastline = line; } if ( opt( 'p' ) ) { if ( opt('t') ) { putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_LINO" ); putop( P2UNARY P2CALL , P2INT ); putdot( filename , line ); } else { putRV( STMTCOUNT , 0 , 0 , NGLOBAL , P2INT ); putleaf( P2ICON , 1 , 0 , P2INT , 0 ); putop( P2ASG P2PLUS , P2INT ); putdot( filename , line ); } } # endif PC } /* * With varlist do stat * * With statement requires an extra word * in automatic storage for each level of withing. * These indirect pointers are initialized here, and * the scoping effect of the with statement occurs * because lookup examines the field names of the records * associated with the WITHPTRs on the withlist. */ withop(s) int *s; { register *p; register struct nl *r; struct nl *tempnlp; int *swl; putline(); swl = withlist; for (p = s[2]; p != NIL; p = p[2]) { tempnlp = tmpalloc(sizeof(int *), INT_TYP, REGOK); # ifdef OBJ put(2, O_LV | cbn <<8+INDX, tempnlp -> value[ NL_OFFS ] ); # endif OBJ # ifdef PC putRV( 0 , cbn , tempnlp -> value[ NL_OFFS ] , tempnlp -> extra_flags , P2PTR|P2STRTY ); # endif PC r = lvalue(p[1], MOD , LREQ ); if (r == NIL) continue; if (r->class != RECORD) { error("Variable in with statement refers to %s, not to a record", nameof(r)); continue; } r = defnl(0, WITHPTR, r, tempnlp -> value[ NL_OFFS ] ); # ifdef PC r -> extra_flags |= tempnlp -> extra_flags; # endif PC r->nl_next = withlist; withlist = r; # ifdef OBJ put(1, PTR_AS); # endif OBJ # ifdef PC putop( P2ASSIGN , P2PTR|P2STRTY ); putdot( filename , line ); # endif PC } statement(s[3]); withlist = swl; } extern flagwas; /* * var := expr */ asgnop(r) int *r; { register struct nl *p; register *av; if (r == NIL) return (NIL); /* * Asgnop's only function is * to handle function variable * assignments. All other assignment * stuff is handled by asgnop1. * the if below checks for unqualified lefthandside: * necessary for fvars. */ av = r[2]; if (av != NIL && av[0] == T_VAR && av[3] == NIL) { p = lookup1(av[2]); if (p != NIL) p->nl_flags = flagwas; if (p != NIL && p->class == FVAR) { /* * Give asgnop1 the func * which is the chain of * the FVAR. */ p->nl_flags |= NUSED|NMOD; p = p->chain; if (p == NIL) { rvalue(r[3], NIL , RREQ ); return; } # ifdef OBJ put(2, O_LV | bn << 8+INDX, (int)p->value[NL_OFFS]); if (isa(p->type, "i") && width(p->type) == 1) asgnop1(r, nl+T2INT); else asgnop1(r, p->type); # endif OBJ # ifdef PC /* * this should be the lvalue of the fvar, * but since the second pass knows to use * the address of the left operand of an * assignment, what i want here is an rvalue. * see note in funchdr about fvar allocation. */ p = p -> ptr[ NL_FVAR ]; putRV( p -> symbol , bn , p -> value[ NL_OFFS ] , p -> extra_flags , p2type( p -> type ) ); asgnop1( r , p ((-> type ); # endif PC return; } } asgnop1(r, NIL); } /* * Asgnop1 handles all assignments. * If p is not nil then we are assigning * to a function variable, otherwise * we look the variable up ourselves. */ struct nl * asgnop1(r, p) int *r; register struct nl *p; { register struct nl *p1; int w; if (r == NIL) return (NIL); if (p == NIL) { # ifdef OBJ p = lvalue(r[2], MOD|ASGN|NOUSE , LREQ ); w = width(p); # endif OBJ # ifdef PC /* * since the second pass knows that it should reference * the lefthandside of asignments, what i need here is * an rvalue. */ p = lvalue( r[2] , MOD|ASGN|NOUSE , RREQ ); # endif PC if ( p == NIL ) { rvalue( r[3] , NIL , RREQ ); return NIL; } } # ifdef OBJ /* * assigning to the return value, which is at least * of width two since it resides on the stack */ else { w = width(p); if (w < 2) w = 2; } p1 = rvalue(r[3], p , RREQ ); # endif OBJ # ifdef PC /* * if this is a scalar assignment, * then i want to rvalue the righthandside. * if this is a structure assignment, * then i want an lvalue to the righthandside. * that's what the intermediate form sez. */ switch ( classify( p ) ) { case TINT: case TCHAR: case TBOOL: case TSCAL: precheck( p , "_RANG4" , "_RSNG4" ); case TDOUBLE: case TPTR: p1 = rvalue( r[3] , p , RREQ ); break; default: p1 = rvalue( r[3] , p , LREQ ); break; } # endif PC if (p1 == NIL) return (NIL); if (incompat(p1, p, r[3])) { cerror("Type of expression clashed with type of variable in assignment"); return (NIL); } switch (classify(p)) { case TINT: case TBOOL: case TCHAR: case TSCAL: # ifdef OBJ rangechk(p, p1); # endif OBJ # ifdef PC postcheck( p ); # endif PC case TDOUBLE: case TPTR: # ifdef OBJ gen(O_AS2, O_AS2, w, width(p1)); # endif OBJ # ifdef PC putop( P2ASSIGN , p2type( p ) ); putdot( filename , line ); # endif PC break; default: # ifdef OBJ put(2, O_AS, w); # endif OBJ # ifdef PC putstrop( P2STASG , p2type( p ) , lwidth( p ) , align( p ) ); putdot( filename , line ); # endif PC } return (p); /* Used by for statement */ } /* * if expr then stat [ else stat ] */ ifop(r) int *r; { register struct nl *p; register l1, l2; /* l1 is start of else, l2 is end of else */ int goc; bool nr; goc = gocnt; if (r == NIL) return; putline(); p = rvalue(r[2], NIL , RREQ ); if (p == NIL) { statement(r[3]); noreach = 0; statement(r[4]); noreach = 0; return; } if (isnta(p, "b")) { error("Type of expression in if statement must be Boolean, not %s", nameof(p)); statement(r[3]); noreach = 0; statement(r[4]); noreach = 0; return; } # ifdef OBJ l1 = put(2, O_IF, getlab()); # endif OBJ # ifdef PC l1 = getlab(); putleaf( P2ICON , l1 , 0 , P2INT , 0 ); putop( P2CBRANCH , P2INT ); putdot( filename , line ); # endif PC putcnt(); statement(r[3]); nr = noreach; if (r[4] != NIL) { /* * else stat */ --level; ungoto(); ++level; # ifdef OBJ l2 = put(2, O_TRA, getlab()); # endif OBJ # ifdef PC l2 = getlab(); putjbr( l2 ); # endif PC patch(l1); noreach = 0; statement(r[4]); noreach = (noreach && nr); l1 = l2; } else noreach = 0; patch(l1); if (goc != gocnt) putcnt(); } /* * while expr do stat */ whilop(r) int *r; { register struct nl *p; register l1, l2; int goc; goc = gocnt; if (r == NIL) return; putlab(l1 = getlab()); putline(); p = rvalue(r[2], NIL , RREQ ); if (p == NIL) { statement(r[3]); noreach = 0; return; } if (isnta(p, "b")) { error("Type of expression in while statement must be Boolean, not %s", nameof(p)); statement(r[3]); noreach = 0; return; } l2 = getlab(); # ifdef OBJ put(2, O_IF, l2); # endif OBJ # ifdef PC putleaf( P2ICON , l2 , 0 , P2INT , 0 ); putop( P2CBRANCH , P2INT ); putdot( filename , line ); # endif PC putcnt(); statement(r[3]); # ifdef OBJ put(2, O_TRA, l1); # endif OBJ # ifdef PC putjbr( l1 ); # endif PC patch(l2); if (goc != gocnt) putcnt(); } /* * repeat stat* until expr */ repop(r) int *r; { register struct nl *p; register l; int goc; goc = gocnt; if (r == NIL) return; l = putlab(getlab()); putcnt(); statlist(r[2]); line = r[1]; p = rvalue(r[3], NIL , RREQ ); if (p == NIL) return; if (isnta(p,"b")) { error("Until expression type must be Boolean, not %s, in repeat statement", nameof(p)); return; } # ifdef OBJ put(2, O_IF, l); # endif OBJ # ifdef PC putleaf( P2ICON , l , 0 , P2INT , 0 ); putop( P2CBRANCH , P2INT ); putdot( filename , line ); # endif PC if (goc != gocnt) putcnt(); } /* * assert expr */ asrtop(r) register int *r; { register struct nl *q; if (opt('s')) { standard(); error("Assert statement is non-standard"); } if (!opt('t')) return; r = r[2]; # ifdef OBJ q = rvalue((int *) r, NLNIL , RREQ ); # endif OBJ # ifdef PC putleaf( P2ICON , 0 , 0 , ADDTYPE( P2FTN | P2INT , P2PTR ) , "_ASRT" ); q = stkrval( r , NLNIL , RREQ ); # endif PC if (q == NIL) return; if (isnta(q, "b")) error("Assert expression must be Boolean, not %ss", nameof(q)); # ifdef OBJ put(1, O_ASRT); # endif OBJ # ifdef PC putop( P2CALL , P2INT ); putdot( filename , line ); # endif PC } is non-standard"); } if (!opt('t')) return; r = r[2]; # ifdef OBJ q = rvalue((int *) r, NLNIL , cmd/pc0/stklval.c 644 0 33 744 2552606607 7101 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)stklval.c 1.1 8/27/80"; #include "whoami.h" #include "0.h" #include "tree.h" #include "opcode.h" #include "objfmt.h" /* * Lvalue computes the address * of a qualified name and * leaves it on the stack. */ struct nl * stklval(r, modflag) int *r, modflag; { /* * For the purposes of the interpreter stklval * is the same as an lvalue. */ return(lvalue(r, modflag , LREQ )); } ,"cmd/pc0/stkrval.c 644 0 33 16750 2552606610 7145 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)stkrval.c 1.4 3/8/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "opcode.h" #include "objfmt.h" #ifdef PC # include "pcops.h" #endif PC /* * stkrval Rvalue - an expression, and coerce it to be a stack quantity. * * Contype is the type that the caller would prefer, nand is important * if constant sets or constant strings are involved, the latter * because of string padding. */ /* * for the obj version, this is a copy of rvalue hacked to use fancy new * push-onto-stack-and-convert opcodes. * for the pc version, i just call rvalue and convert if i have to, * based on the return type of rvalue. */ struct nl * stkrval(r, contype , required ) register int *r; struct nl *contype; long required; { register struct nl *p; register struct nl *q; register char *cp, *cp1; register int c, w; int **pt; long l; double f; if (r == NIL) return (NIL); if (nowexp(r)) return (NIL); /* * The root of the tree tells us what sort of expression we have. */ switch (r[0]) { /* * The constant nil */ case T_NIL: # ifdef OBJ put(2, O_CON14, 0); # endif OBJ # ifdef PC putleaf( P2ICON , 0 , 0 , P2INT , 0 ); # endif PC return (nl+TNIL); case T_FCALL: case T_VAR: p = lookup(r[2]); if (p == NIL || p->class == BADUSE) return (NIL); switch (p->class) { case VAR: /* * if a variable is * qualified then get * the rvalue by a * stklval and an ind. */ if (r[3] != NIL) goto ind; q = p->type; if (q == NIL) return (NIL); if (classify(q) == TSTR) return(stklval(r, NOFLAGS)); # ifdef OBJ w = width(q); switch (w) { case 8: put(2, O_RV8 | bn << 8+INDX, (int)p->value[0]); return(q); case 4: put(2, O_RV4 | bn << 8+INDX, (int)p->value[0]); return(q); case 2: put(2, O_RV24 | bn << 8+INDX, (int)p->value[0]); return(q); case 1: put(2, O_RV14 | bn << 8+INDX, (int)p->value[0]); return(q); default: put(3, O_RV | bn << 8+INDX, (int)p->value[0], w); return(q); } # endif OBJ # ifdef PC return rvalue( r , contype , required ); # endif PC case WITHPTR: case REF: /* * A stklval for these * is actually what one * might consider a rvalue. */ ind: q = stklval(r, NOFLAGS); if (q == NIL) return (NIL); if (classify(q) == TSTR) return(q); # ifdef OBJ w = width(q); switch (w) { case 8: put(1, O_IND8); return(q); case 4: put(1, O_IND4); return(q); case 2: put(1, O_IND24); return(q); case 1: put(1, O_IND14); return(q); default: put(2, O_IND, w); return(q); } # endif OBJ # ifdef PC if ( required == RREQ ) { putop( P2UNARY P2MUL , p2type( q ) ); } return q; # endi((f PC case CONST: if (r[3] != NIL) { error("%s is a constant and cannot be qualified", r[2]); return (NIL); } q = p->type; if (q == NIL) return (NIL); if (q == nl+TSTR) { /* * Find the size of the string * constant if needed. */ cp = p->ptr[0]; cstrng: cp1 = cp; for (c = 0; *cp++; c++) continue; w = 0; if (contype != NIL && !opt('s')) { if (width(contype) < c && classify(contype) == TSTR) { error("Constant string too long"); return (NIL); } w = width(contype) - c; } # ifdef OBJ put(2, O_LVCON, lenstr(cp1, w)); putstr(cp1, w); # endif OBJ # ifdef PC putCONG( cp1 , c + w , LREQ ); # endif PC /* * Define the string temporarily * so later people can know its * width. * cleaned out by stat. */ q = defnl(0, STR, 0, c); q->type = q; return (q); } if (q == nl+T1CHAR) { # ifdef OBJ put(2, O_CONC4, (int)p->value[0]); # endif OBJ # ifdef PC putleaf( P2ICON , p -> value[0] , 0 , P2CHAR , 0 ); # endif PC return(q); } /* * Every other kind of constant here */ # ifdef OBJ switch (width(q)) { case 8: #ifndef DEBUG put(2, O_CON8, p->real); return(q); #else if (hp21mx) { f = p->real; conv(&f); l = f.plong; put(2, O_CON4, l); } else put(2, O_CON8, p->real); return(q); #endif case 4: put(2, O_CON4, p->range[0]); return(q); case 2: put(2, O_CON24, (short)p->range[0]); return(q); case 1: put(2, O_CON14, p->value[0]); return(q); default: panic("stkrval"); } # endif OBJ # ifdef PC return rvalue( r , contype , required ); # endif PC case FUNC: case FFUNC: /* * Function call */ pt = (int **)r[3]; if (pt != NIL) { switch (pt[1][0]) { case T_PTR: case T_ARGL: case T_ARY: case T_FIELD: error("Can't qualify a function result value"); return (NIL); } } # ifdef OBJ q = p->type; if (classify(q) == TSTR) { c = width(q); put(2, O_LVCON, even(c+1)); putstr("", c); put(1, PTR_DUP); p = funccod(r); put(2, O_AS, c); return(p); } p = funccod(r); if (width(p) <= 2) put(1, O_STOI); # endif OBJ # ifdef PC p = pcfunccod( r ); # endif PC return (p); case TYPE: error("Type names (e.g. %s) allowed only in declarations", p->symbol); return (NIL); case PROC: case FPROC: error("Procedure %s found where expression required", p->symbol); return (NIL); default: panic("stkrvid"); } case T_PLUS: case T_MINUS: case T_NOT: case T_AND: case T_OR: case T_DIVD: case T_MULT: case T_SUB: case T_ADD: case T_MOD: case T_DIV: case T_EQ: case T_NE: case T_GE: case T_LE: case T_GT: case T_LT: case T_IN: p = rvalue(r, contype , required ); # ifdef OBJ if (width(p) <= 2) put(1, O_STOI); # endif OBJ return (p); case T_CSET: p = rvalue(r, contype , required ); return (p); default: if (r[2] == NIL) return (NIL); switch (r[0]) { default: panic("stkrval3"); /* * An octal number */ case T_BINT: f = a8tol(r[2]); goto conint; /* * A decimal number */ case T_INT: f = atof(r[2]); conint: if (f > MAXINT || f < MININT) { error("Constant too large for this implementation"); return (NIL); } l = f; if (bytes(l, l) <= 2) { # ifdef OBJ put(2, O_CON24, (short)l); # endif OBJ # ifdef PC putleaf( P2ICON , (short) l , 0 , P2INT , 0 ); # endif PC return(nl+T4INT); } # ifdef OBJ put(2, O_CON4, l); # endif OBJ # ifdef PC putleaf( P2ICON , l , 0 , P2INT , 0 ); # endif PC return (nl+T4INT); /* * A floating point number */ case T_FINT: # ifdef OBJ put(2, O_CON8, atof(r[2])); # endif OBJ # ifdef PC putCON8( atof( r[2] ) ); # endif PC return (nl+TDOUBLE); /* * Constant strings. Note that constant characters * are constant strings of length one; there is * no constant string of length one. */ case T_STRNG: cp = r[2]; if (cp[1] == 0) { # ifdef OBJ put(2, O_CONC4, cp[0]); # endif OBJ # ifdef PC putleaf( P2ICON , cp[0] , 0 , P2CHAR , 0 ); # endif PC return(nl+T1CHAR); } goto cstrng; } } } tof(r[2])); # endif OBcmd/pc0/string.c 644 0 33 4310 2552606610 6732 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)string.c 1.2 11/24/80"; #include "whoami.h" #include "0.h" #ifndef PI01 #ifndef PXP #include "send.h" #endif #endif /* * STRING SPACE DECLARATIONS * * Strng is the base of the current * string space and strngp the * base of the free area therein. * Strp is the array of descriptors. */ #ifndef PI0 STATIC char strings[STRINC]; STATIC char *strng = strings; STATIC char *strngp = strings; #else char *strng, *strngp; #endif #ifndef PI01 #ifndef PXP STATIC char *strp[20]; STATIC char **stract strp; int strmax; #endif #endif #ifndef PI01 #ifndef PXP #ifndef PI0 initstring() #else initstring(strings) char *strings; #endif { *stract++ = strings; #ifdef PI0 strng = strngp = strings; #endif strmax = STRINC * 2; } #endif #endif /* * Copy a string into the string area. */ char * savestr(cp) register char *cp; { register int i; i = strlen(cp) + 1; if (strngp + i >= strng + STRINC) { strngp = malloc(STRINC); if (strngp == 0) { yerror("Ran out of memory (string)"); pexit(DIED); } #ifndef PI01 #ifndef PXP *stract++ = strngp; strmax =+ STRINC; #endif #endif strng = strngp; } strcpy(strngp, cp); cp = strngp; strngp = cp + i; #ifdef PI0 send(RSTRING, cp); #endif return (cp); } #ifndef PI1 #ifndef PXP esavestr(cp) char *cp; { #ifdef PI0 send(REVENIT); #endif strngp = ( (char *) ( ( (int) (strngp + 1) ) &~ 1 ) ); return (savestr(cp)); } #endif #endif #ifndef PI01 #ifndef PXP soffset(cp) register char *cp; { register char **sp; register int i; if (cp == NIL || cp == OCT || cp == HEX) return (-cp); for (i = STRINC, sp = strp; sp < stract; sp++) { if (cp >= *sp && cp < (*sp + STRINC)) return (i + (cp - *sp)); i =+ STRINC; } i = nlfund(cp); if (i != 0) return (i); panic("soffset"); } #ifdef PI1 sreloc(i) register int i; { if (i == 0 || i == -OCT || i == -HEX) return (-i); if (i < STRINC) { if (i >= INL) panic("sreloc INL"); i = nl[i].symbol; if (i == 0) panic("sreloc nl[i]"); return (i); } if (i > strmax || i < 0) panic("sreloc"); return (strp[(i / STRINC) - 1] + (i % STRINC)); } evenit() { strngp = (strngp + 1) &~ 1; } #endif #endif #endif STRINC)) return (i + (cp - *sp)); i =+ STRINC; } i = nlfund(cp); if (i != 0) return (i); panic("soffset"); } #ifdef PI1 sreloc(i) register int i; { if (i == 0 || i == -OCT || i == -HEX) return (-i); if (i < STRINC) { if (i >= INL) panic("sreloc INL"); i = nl[i].symbol; if (i == 0) pcmd/pc0/subr.c 644 0 33 5445 2552606610 6411 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)subr.c 1.4 11/24/80"; #include "whoami.h" #include "0.h" #ifndef PI1 /* * Does the string fp end in '.' and the character c ? */ dotted(fp, c) register char *fp; char c; { register int i; i = strlen(fp); return (i > 1 && fp[i - 2] == '.' && fp[i - 1] == c); } /* * Toggle the option c. */ togopt(c) char c; { register char *tp; tp = &opt( c ); *tp = 1 - *tp; } /* * Set the time vector "tvec" to the * modification time stamp of a file. */ gettime( filename ) char *filename; { #include struct stat stb; stat(filename, &stb); tvec = stb.st_mtime; } /* * Convert a "ctime" into a Pascal styple time line */ char * myctime(tv) int *tv; { register char *cp, *dp; char *cpp; register i; static char mycbuf[26]; cpp = ctime(tv); dp = mycbuf; cp = cpp; cpp[16] = 0; while (*dp++ = *cp++); dp--; cp = cpp+19; cpp[24] = 0; while (*dp++ = *cp++); return (mycbuf); } /* * Is "fp" in the command line list of names ? */ inpflist(fp) char *fp; { register i, *pfp; pfp = pflist; for (i = pflstc; i > 0; i--) if (strcmp(fp, *pfp++) == 0) return (1); return (0); } #endif extern int errno; extern char *sys_errlist[]; /* * Boom! */ Perror(file, error) char *file, *error; { fprintf( stderr , "%s: %s\n" , file , error ); } int * calloc(num, size) int num, size; { register int p1, *p2, nbyte; nbyte = (num*size+( ( sizeof ( int ) ) - 1 ) ) & ~( ( sizeof ( int ) ) - 1 ); if ((p1 = malloc(nbyte)) == 0) return (0); p2 = p1; nbyte /= sizeof ( int ); do { *p2++ = 0; } while (--nbyte); return (p1); } /* * Compare strings: s1>s2: >0 s1==s2: 0 s1>= 1; #ifdef PI0 send(ROPOP, c); #endif } m; register int bytes; { if (bytes != 0) do *to++ = *from++; while (--bytes); } /* * Is ch one of the characters in the string cp ? */ any(cp, ch) register char *cp; char ch; { while (*cp) if (*cp++ =cmd/pc0/tmp 755 0 33 120 2552606610 5761 .Z..pclval.cpclval.ocoreptstk[c] <<= 1; optstk[c] |= opts[c]; opts[c] = 1; #ifdef PI0 send(ROPUSH, c); #endif } opop(c) register CHAR c; { c -= 'A'; opts[c] = optstk[c] & 1; optstk[c] >>= 1; #ifdef PI0 send(ROPOP, c); #endif } m; register int bytes; { if (bytes != 0) do *to++ = *from++; while (--bytes); } /* * Is ch one of the characters in/,5< /,"cmd/pc0/tmps.c 644 0 33 4372 2552606610 6417 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)tmps.c 1.5 6/1/81"; #include "whoami.h" #include "0.h" #ifdef PC # include "pc.h" #endif PC /* * This routine defines the register allocation strategy * All temporaries are allocated here, and this routines decides * where they are to be put. */ #ifdef PC #ifdef VAX # define MAXREGS 6 # define MINREGSIZE 4 # define MAXREGSIZE 4 # define FIRSTREG 6 #else #ifdef PDP11 # define MAXREGS 3 # define MINREGSIZE 2 # define MAXREGSIZE 2 # define FIRSTREG 2 #else # define MAXREGS 0 # define MINREGSIZE 0 # define MAXREGSIZE 0 # define FIRSTREG 0 #endif PDP11 #endif VAX #endif PC /* * allocate runtime temporary variables */ struct nl * tmpalloc(size, type, mode) long size; struct nl *type; int mode; { register struct om *op = &sizes[ cbn ]; register int offset; register struct nl *nlp; # ifdef PC if (mode == REGOK && size >= MINREGSIZE && size <= MAXREGSIZE && op->curtmps.reg_off < MAXREGS) { offset = op->curtmps.reg_off++; if ( offset > op->reg_max ) { op->reg_max = offset; } nlp = defnl( 0 , VAR , type , offset + FIRSTREG ); nlp -> extra_flags = NLOCAL | NREGVAR; return nlp; } # endif PC offset = op->curtmps.om_off -= leven( size ); if ( offset < op->om_max ) { op->om_max = offset; } nlp = defnl( 0 , VAR , type , offset ); # ifdef PC nlp -> extra_flags = NLOCAL; putlbracket( ftnno , -offset ); # endif PC return nlp; } /* * deallocate runtime temporary variables */ tmpfree(restore) register struct tmps *restore; { register struct om *op = &sizes[ cbn ]; # ifdef PC if (restore->reg_off < op->curtmps.reg_off) { op->curtmps.reg_off = restore->reg_off; } # endif PC if (restore->om_off > op->curtmps.om_off) { op->curtmps.om_off = restore->om_off; # ifdef PC putlbracket( ftnno , -restore->om_off ); # endif PC } } #ifdef PC #ifdef VAX /* * create a save mask for registers which have been used * in this level */ savmask() { int mask; int i; mask = RSAVEMASK; if (opt('t')) mask |= RUNCHECK; for (i = 0; i <= sizes[ cbn ].reg_max; i++) mask |= 1 << (FIRSTREG + i); return mask; } #endif VAX #endif PC ff = restore->reg_off; } # endif PC if (restore->om_off > op->curtmps.om_off) { op->curtmps.om_off = restore->om_off; # ifdef PC putlbracket( ftnno , -restore->om_off ); # endif PC } } #ifdef PC #ifdef VAX /* * create a save mask for registercmd/pc0/tree.c 644 0 33 6622 2552606611 6374 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)tree.c 1.2 11/24/80"; #include "whoami.h" #include "0.h" /* * TREE SPACE DECLARATIONS */ struct tr { int *tr_low; int *tr_high; } ttab[MAXTREE], *tract; /* * The variable space is the * absolute base of the tree segments. * (exactly the same as ttab[0].tr_low) * Spacep is maintained to point at the * beginning of the next tree slot to * be allocated for use by the grammar. * Spacep is used "extern" by the semantic * actions in pas.y. * The variable tract is maintained to point * at the tree segment out of which we are * allocating (the active segment). */ int *space, *spacep; /* * TREENMAX is the maximum width * in words that any tree node * due to the way in which the parser uses * the pointer spacep. */ #define TREENMAX 6 int trspace[ITREE]; int *space = trspace; int *spacep = trspace; struct tr *tract = ttab; /* * Inittree allocates the first tree slot * and sets up the first segment descriptor. * A lot of this work is actually done statically * above. */ inittree() { ttab[0].tr_low = space; ttab[0].tr_high = &space[ITREE]; } /* * Tree builds the nodes in the * parse tree. It is rarely called * directly, rather calls are made * to tree[12345] which supplies the * first argument to save space in * the code. Tree also guarantees * that spacep points to the beginning * of the next slot it will return, * a property required by the parser * which was always true before we * segmented the tree space. */ int *tree(cnt, a) int cnt; { register int *p, *q; register int i; i = cnt; p = spacep; q = &a; do *p++ = *q++; while (--i); q = spacep; spacep = p; if (p+TREENMAX >= tract->tr_high) /* * this peek-ahead should * save a great number of calls * to tralloc. */ tralloc(TREENMAX); return (q); } /* * Tralloc preallocates enough * space in the tree to allow * the grammar to use the variable * spacep, as it did before the * tree was segmented. */ tralloc(howmuch) { register char *cp; register i; if (spacep + howmuch >= tract->tr_high) { i = TRINC; cp = malloc(i * sizeof ( int )); if (cp == 0) { yerror("Ran out of memory (tralloc)"); pexit(DIED); } spacep = cp; tract++; if (tract >= &ttab[MAXTREE]) { yerror("Ran out of tree tables"); pexit(DIED); } tract->tr_low = cp; tract->tr_high = tract->tr_low+i; } } extern int yylacnt; extern bottled; #ifdef PXP #endif /* * Free up the tree segments * at the end of a block. * If there is scanner lookahead, * i.e. if yylacnt != 0 or there is bottled output, then we * cannot free the tree space. * This happens only when errors * occur and the forward move extends * across "units". */ trfree() { if (yylacnt != 0 || bottled != NIL) return; #ifdef PXP if (needtree()) return; #endif spacep = space; while (tract->tr_low > spacep || tract->tr_high <= spacep) { free(tract->tr_low); tract->tr_low = NIL; tract->tr_high = NIL; tract--; if (tract < ttab) panic("ttab"); } #ifdef PXP packtree(); #endif } /* * Copystr copies a token from * the "token" buffer into the * tree space. */ copystr(token) register char *token; { register char *cp; register int i; i = (strlen(token) + sizeof ( int )) & ~( ( sizeof ( int ) ) - 1 ); tralloc(i / sizeof ( int )); strcpy(spacep, token); cp = spacep; spacep = cp + i; tralloc(TREENMAX); return (cp); } { free(tract->tr_low); tract->tr_low = NIL; tract->tr_high = NIL; tract--; if (tract < ttab) pancmd/pc0/tree.h 644 0 33 3066 2552606611 6400 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)tree.h 1.1 8/27/80"; */ #define T_MINUS 1 #define T_MOD 2 #define T_DIV 3 #define T_DIVD 4 #define T_MULT 5 #define T_ADD 6 #define T_SUB 7 #define T_EQ 8 #define T_NE 9 #define T_LT 10 #define T_GT 11 #define T_LE 12 #define T_GE 13 #define T_NOT 14 #define T_AND 15 #define T_OR 16 #define T_ASGN 17 #define T_PLUS 18 #define T_IN 19 #define T_LISTPP 20 #define T_PDEC 21 #define T_FDEC 22 #define T_PVAL 23 #def((ine T_PVAR 24 #define T_PFUNC 25 #define T_PPROC 26 #define T_NIL 27 #define T_STRNG 28 #define T_CSTRNG 29 #define T_PLUSC 30 #define T_MINUSC 31 #define T_ID 32 #define T_INT 33 #define T_FINT 34 #define T_CINT 35 #define T_CFINT 36 #define T_TYPTR 37 #define T_TYPACK 38 #define T_TYSCAL 39 #define T_TYRANG 40 #define T_TYARY 41 #define T_TYFILE 42 #define T_TYSET 43 #define T_TYREC 44 #define T_TYFIELD 45 #define T_TYVARPT 46 #define T_TYVARNT 47 #define T_CSTAT 48 #define T_BLOCK 49 #define T_BSTL 50 #define T_LABEL 51 #define T_PCALL 52 #define T_FCALL 53 #define T_CASE 54 #define T_WITH 55 #define T_WHILE 56 #define T_REPEAT 57 #define T_FORU 58 #define T_FORD 59 #define T_GOTO 60 #define T_IF 61 #define T_ASRT 62 #define T_CSET 63 #define T_RANG 64 #define T_VAR 65 #define T_ARGL 66 #define T_ARY 67 #define T_FIELD 68 #define T_PTR 69 #define T_WEXP 70 #define T_PROG 71 #define T_BINT 72 #define T_CBINT 73 #define T_IFEL 74 #define T_IFX 75 #define T_TYID 76 #define T_COPSTR 77 #define T_BOTTLE 78 #define T_RFIELD 79 #define T_FLDLST 80 #define T_LAST 81 #define T_CASE 54 #define T_WITH 55 #define T_WHILE 56 #define T_REPEAT 57 #define T_FORU 58 #define T_FORD 59 #define T_GOTO 60 #define T_IF 61 #define T_ASRT 62 #define T_CSET 63 #define T_RANG 64 #define T_VAR 65 #define T_ARGL 66 #define T_ARY 67 #define T_FIELD 68 #define T_PTR 69 #define T_WEXP 70 #define T_PROG 71 #define T_BINT 72 #define T_CBINT 73 #define T_IFEL 74 #define T_IFX 75 #define T_TYID 76 #define T_COPSTR 77 #define T_BOTTLE 78 #defcmd/pc0/treen.c 644 0 33 1311 2552606611 6540 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)treen.c 1.1 8/27/80"; /* * is there some reason why these aren't #defined? */ tree1 ( arg1 ) int arg1; { tree ( 1 , arg1 ); } tree2 ( arg1 , arg2 ) int arg1 , arg2; { tree ( 2 , arg1 , arg2 ); } tree3 ( arg1 , arg2 , arg3 ) int arg1 , arg2 , arg3; { tree ( 3 , arg1 , arg2 , arg3 ); } tree4 ( arg1 , arg2 , arg3 , arg4 ) int arg1 , arg2 , arg3 , arg4; { tree ( 4 , arg1 , arg2 , arg3 , arg4 ); } tree5 ( arg1 , arg2 , arg3 , arg4 , arg5 ) int arg1 , arg2 , arg3 , arg4 , arg5; { tree ( 5 , arg1 , arg2 , arg3 , arg4 , arg5 ); } ) int arg1; { tree ( 1 , arg1 ); } tree2 ( arg1 , arg2 ) int arg1 , arg2; { tree ( 2 , arg1 , arg2 ); } tree3 ( arg1 , arg2 , arg3 ) int arg1 , arg2 , arg3; { tree ( 3 , arg1 , arg2 , arg3 ); } tree4 ( arg1 , arg2 , arg3 , arg4 ) int arg1 , arg2 , arg3 , arg4; cmd/pc0/type.c 644 0 33 15722 2552606611 6437 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)type.c 1.6 3/8/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "objfmt.h" /* * Type declaration part */ typebeg() { /* * this allows for multiple * declaration parts unless * standard option has been * specified. * If routine segment is being * compiled, do level one processing. */ #ifndef PI1 if (!progseen) level1(); if ( parts[ cbn ] & ( VPRT | RPRT ) ) { if ( opt( 's' ) ) { standard(); } else { warning(); } error("Type declarations should precede var and routine declarations"); } if (parts[ cbn ] & TPRT) { if ( opt( 's' ) ) { standard(); } else { warning(); } error("All types should be declared in one type part"); } parts[ cbn ] |= TPRT; #endif /* * Forechain is the head of a list of types that * might be self referential. We chain them up and * process them later. */ forechain = NIL; #ifdef PI0 send(REVTBEG); #endif } type(tline, tid, tdecl) int tline; char *tid; register int *tdecl; { register struct nl *np; np = gtype(tdecl); line = tline; #ifndef PI0 enter(defnl(tid, TYPE, np, 0))->nl_flags |= NMOD; #else enter(defnl(tid, TYPE, np, 0)); send(REVTYPE, tline, tid, tdecl); #endif #ifdef PC if (cbn == 1) { stabgtype( tid , line ); } #endif PC # ifdef PTREE { pPointer Type = TypeDecl( tid , tdecl ); pPointer *Types; pSeize( PorFHeader[ nesting ] ); Types = &( pDEF( PorFHeader[ nesting ] ).PorFTypes ); *Types = ListAppend( *Types , Type ); pRelease( PorFHeader[ nesting ] ); } # endif } typeend() { #ifdef PI0 send(REVTEND); #endif foredecl(); } /* * Return a type pointer (into the namelist) * from a parse tree for a type, building * namelist entries as needed. */ struct nl * gtype(r) register int *r; { register struct nl *np; register char *cp; register int oline; long w; if (r == NIL) return (NIL); oline = line; if (r[0] != T_ID) oline = line = r[1]; switch (r[0]) { default: panic("type"); case T_TYID: r++; case T_ID: np = lookup(r[1]); if (np == NIL) break; if (np->class != TYPE) { #ifndef PI1 error("%s is a %s, not a type as required", r[1], classes[np->class]); #endif np = NIL; break; } np = np->type; break; case T_TYSCAL: np = tyscal(r); break; case T_TYRANG: np = tyrang(r); break; case T_TYPTR: np = defnl(0, PTR, 0, 0 ); np -> ptr[0] = r[2]; np->nl_next = forechain; forechain = np; break; case T_TYPACK: np = gtype(r[2]); break; case T_TYARY: np = tyary(r); break; case T_TYREC: np = tyrec(r[2], 0); # ifdef PTREE /* * mung T_TYREC[3] to point to the record * for RecTCopy */ r[3] = np; # endif break; case T_TYFILE: np = gtype(r[2]); if (np == NIL) break; #ifndef PI1 if (np->nl_flags & NFILES) error("Files cannot be members of files"); #endif np = defnl(0, FILET, np, 0); np->nl_flags |= NFILES; break; case T_TYSET: np = gtype(r[2]); if (np == NIL) break; if (np->type == nl+TDOUBLE) { #ifndef PI1 error("Set of real is not allowed"); #endif np = NIL; break; } if (np->class != RANGE && np->class != SCAL) { #ifndef PI1 error("Set type must be range or scalar, not %s", nameof(np)); #endif np = NIL; break; } #ifndef PI1 if (width(np) > 2) error("Implementation restriction: sets must be indexed by 16 bit quantities"); #endif np = defnl(0, SET, np, 0); break; } line = oline; w = lwidth(np); #ifndef PC if (w >= TOOMUCH) { error("Storage requirement of %s exceeds the implementation limit of %D by %D bytes", nameof(np), (long)(TOOMUCH-1), (long)(w-TOOMUCH+1)); np = NIL; } #endif return (np); } /* * Scalar (enumerated) types */ tyscal(r) int *r; { register struct nl *np, *op, *zp; register *v; int i; np = defnl(0, SCAL, 0, 0); np->type = np; v = r[2]; if (v == NIL) return (NIL); i = -1; zp = np; for (; v != NIL; v = v[2]) { op = enter(defnl(v[1], CONST, np, ++i)); #ifndef PI0 op->nl_flags |= NMOD; #endif op->value[1] = i; zp->chain = op; zp = op; } np->range[1] = i; return (np); } /* * Declare a subrange. */ tyrang(r) register int *r; { register struct nl *lp, *hp; double high; int c, c1; gconst(r[3]); hp = con.ctype; high = con.crval; gconst(r[2]); lp = con.ctype; if (lp == NIL || hp == NIL) return (NIL); if (norange(lp) || norange(hp)) return (NIL); c = classify(lp); c1 = classify(hp); if (c != c1) { #ifndef PI1 error("Can't mix %ss and %ss in subranges", nameof(lp), nameof(hp)); #endif return (NIL); } if (c == TSCAL && scalar(lp) != scalar(hp)) { #ifndef PI1 error("Scalar types must be identical in subranges"); #endif return (NIL); } if (con.crval > high) { #ifndef PI1 error("Range lower bound exceeds upper bound"); #endif return (NIL); } lp = defnl(0, RANGE, hp->type, 0); lp->range[0] = con.crval; lp->range[1] = high; return (lp); } norange(p) register struct nl *p; { if (isa(p, "d")) { #ifndef PI1 error("Subrange of real is not allowed"); #endif return (1); } if (isnta(p, "bcsi")) { #ifndef PI1 error("Subrange bounds must be Boolean, character, integer or scalar, not %s", nameof(p)); #endif return (1); } return (0); } /* * Declare arrays and chain together the dimension specification */ struct nl * tyary(r) int *r; { struct nl *np; register *tl; register struct nl *tp, *ltp; int i; tp = gtype(r[3]); if (tp == NIL) return (NIL); np = defnl(0, ARRAY, tp, 0); np->nl_flags |= (tp->nl_flags) & NFILES; ltp = np; i = 0; for (tl = r[2]; tl != NIL; tl = tl[2]) { tp = gtype(tl[1]); if (tp == NIL) { np = NIL; continue; } if (tp->class == RANGE && tp->type == nl+TDOUBLE) { #ifndef PI1 error("Index type for arrays cannot be real"); #endif np = NIL; continue; } if (tp->class != RANGE && tp->class != SCAL) { #ifndef PI1 error("Array index type is a %s, not a range or scalar as required", classes[tp->class]); #endif np = NIL; continue; } #ifndef PC if (tp->class == RANGE && bytes(tp->range[0], tp->range[1]) > 2) { #ifndef PI1 error("Value of dimension specifier too large or small for this implementation"); #endif continue; } #endif tp = nlcopy(tp); i++; ltp->chain = tp; ltp = tp; } if (np != NIL) np->value[0] = i; return (np); } /* * Delayed processing for pointers to * allow self-referential and mutually * recursive pointer constructs. */ foredecl() { register struct nl *p, *q; for (p = forec((hain; p != NIL; p = p->nl_next) { if (p->class == PTR && p -> ptr[0] != 0) { p->type = gtype(p -> ptr[0]); #ifndef PI1 if (p->type != NIL && ( ( p->type )->nl_flags & NFILES)) error("Files cannot be members of dynamic structures"); #endif # ifdef PTREE { if ( pUSE( p -> inTree ).PtrTType == pNIL ) { pPointer PtrTo = tCopy( p -> ptr[0] ); pDEF( p -> inTree ).PtrTType = PtrTo; } } # endif p -> ptr[0] = 0; } } } { register struct nl *p, *q; for (p = foreccmd/pc0/var.c 644 0 33 17630 2552606612 6247 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)var.c 1.10 7/8/81"; #include "whoami.h" #include "0.h" #include "align.h" #include "iorec.h" #ifdef PC # include "pc.h" # include "pcops.h" #endif PC /* * Declare variables of a var part. DPOFF1 is * the local variable storage for all prog/proc/func * modules aside from the block mark. The total size * of all the local variables is entered into the * size array. */ varbeg() { /* this allows for multiple declaration * parts except when the "standard" * option has been specified. * If routine segment is being compiled, * do level one processing. */ #ifndef PI1 if (!progseen) level1(); if ( parts[ cbn ] & RPRT ) { if ( opt( 's' ) ) { standard(); } else { warning(); } error("Variable declarations should precede routine declarations"); } if ( parts[ cbn ] & VPRT ) { if ( opt( 's' ) ) { standard(); } else { warning(); } error("All variables should be declared in one var part"); } parts[ cbn ] |= VPRT; #endif /* * #ifndef PI0 * sizes[cbn].om_max = sizes[cbn].curtmps.om_off = -DPOFF1; * #endif */ forechain = NIL; #ifdef PI0 send(REVVBEG); #endif } var(vline, vidl, vtype) #ifdef PI0 int vline, *vidl, *vtype; { register struct nl *np; register int *vl; np = gtype(vtype); line = vline; for (vl = vidl; vl != NIL; vl = vl[2]) { } } send(REVVAR, vline, vidl, vtype); } #else int vline; register int *vidl; int *vtype; { register struct nl *np; register struct om *op; long w; int o2; int *ovidl = vidl; struct nl *vp; np = gtype(vtype); line = vline; w = lwidth(np); op = &sizes[cbn]; for (; vidl != NIL; vidl = vidl[2]) { # ifdef OBJ op->curtmps.om_off = roundup((int)(op->curtmps.om_off-w), (long)align(np)); o2 = op -> curtmps.om_off; # endif OBJ # ifdef PC if ( cbn == 1 ) { /* * global variables are not accessed off the fp * but rather by their names. */ o2 = 0; } else { /* * locals are aligned, too. */ op->curtmps.om_off = roundup((int)(op->curtmps.om_off - w), (long)align(np)); o2 = op -> curtmps.om_off; } # endif PC vp = enter(defnl(vidl[1], VAR, np, o2)); if ( np -> nl_flags & NFILES ) { dfiles[ cbn ] = TRUE; } # ifdef PC if ( cbn == 1 ) { putprintf( " .data" , 0 ); putprintf( " .align %d" , 0 , dotalign(align(np))); putprintf( " .comm " , 1 ); putprintf( EXTFORMAT , 1 , vidl[1] ); putprintf( ",%d" , 0 , w ); putprintf( " .text" , 0 ); stabgvar( vidl[1] , p2type( np ) , o2 , w , line ); vp -> extra_flags |= NGLOBAL; } else { vp -> extra_flags |= NLOCAL; } # endif PC } # ifdef PTREE { pPointer *Vars; pPointer Var = VarDecl( ovidl , vtype ); pSeize( PorFHeader[ nesting ] ); Vars = &( pDEF( PorFHeader[ nesting ] ).PorFVars ); *Vars = ListAppend( *Vars , Var ); pRelease( PorFHeader[ nesting ] ); } # endif } #endif varend() { foredecl(); #ifndef PI0 sizes[cbn].om_max = sizes[cbn].curtmps.om_off; #else send(REVVEND); #endif } /* * Evening */ long leven(w) register long w; { if (w < 0) return (w & 0xfffffffe); return ((w+1) & 0xfffffffe); } int even(w) register int w; { return leven((long)w); } /* * Find the width of a type in bytes. */ width(np) struct nl *np; { return (lwidth(np)); } long lwidth(np) struct nl *np; { register struct nl *p; long w; p = np; if (p == NIL) return (0); loop: switch (p->class) { case TYPE: switch (nloff(p)) { case TNIL: return (2); case TSTR: case TSET: panic("width"); default: p = p->type; goto loop; } case ARRAY: return (aryconst(p, 0)); case PTR: return ( sizeof ( int * ) ); case FILET: return ( sizeof(struct iorec) + lwidth( p -> type ) ); case RANGE: if (p->type == nl+TDOUBLE) #ifdef DEBUG return (hp21mx ? 4 : 8); #else return (8); #endif case SCAL: return (bytes(p->range[0], p->range[1])); case SET: setran(p->type); return roundup((int)((set.uprbp >> 3) + 1), (long)(A_SET)); case STR: case RECORD: return ( p->value[NL_OFFS] ); default: panic("wclass"); } } /* * round up x to a multiple of y * for computing offsets of aligned things. * y had better be positive. * rounding is in the direction of x. */ long roundup( x , y ) int x; register long y; { if ( y == 0 ) { return 0; } if ( x >= 0 ) { return ( ( ( x + ( y - 1 ) ) / y ) * y ); } else { return ( ( ( x - ( y - 1 ) ) / y ) * y ); } } /* * alignment of an object using the c alignment scheme */ int align( np ) struct nl *np; { register struct nl *p; p = np; if ( p == NIL ) { return 0; } alignit: switch ( p -> class ) { case TYPE: switch ( nloff( p ) ) { case TNIL: return A_POINT; case TSTR: return A_CHAR; case TSET: return A_SET; default: p = p -> type; goto alignit; } case ARRAY: /* * arrays are aligned as their component types */ p = p -> type; goto alignit; case PTR: return A_POINT; case FILET: return A_FILET; case RANGE: if ( p -> type == nl+TDOUBLE ) { return A_DOUBLE; } /* else, fall through */ case SCAL: switch ( bytes( p -> range[0] , p -> range[1] ) ) { case 4: return A_LONG; case 2: return A_SHORT; case 1: return A_CHAR; default: panic( "align: scal" ); } case SET: return A_SET; case STR: return A_CHAR; case RECORD: /* * follow chain through all fields in record, * taking max of alignments of types of fields. * short circuit out if i reach the maximum alignment. * this is pretty likely, as A_MAX is only 4. */ { register long recalign; register long fieldalign; recalign = A_MIN; p = p -> chain; while ( ( p != NIL ) && ( recalign < A_MAX ) ) { fieldalign = align( p -> type ); if ( fieldalign > recalign ) { recalign = fieldalign; } p = p -> chain; } return recalign; } default: panic( "align" ); } } /* * given an alignment, return power of two for .align pseudo-op */ dotalign( alignment ) int alignment; { switch ( alignment ) { case A_CHAR: /* * also * A_STRUCT */ return 0; case A_SHORT: return 1; case A_LONG: /* * also * A_POINT, A_INT, A_FLOAT, A_DOUBLE, * A_STACK, A_FILET, A_SET */ return 2; } } /* * Return the width of an element * of a n time subscripted np. */ long aryconst(np, n) struct nl *np; int n; { register struct nl *p; long s, d; if ((p = np) == NIL) return (NIL); if (p->class != ARRAY) panic("ary"); s = lwidth(p->type); /* * Arrays of anything but characters are word aligned. */ if (s & 1) if (s != 1) s++; /* * Skip the first n subscripts */ while (n >= 0) { p = p->chain; n--; } /* * Sum across remaining subscripts. */ while (p != NIL) { if (p->class != RANGE && p->class != SCAL) panic("aryran"); d = p->range[1] - p->range[0] + 1; s *= d; p = p->chain; } return (s); } /* * Find the lower bound of a set, and also its size in bits. */ setran(q) struct nl *q; { register lb, ub; register struct nl *p; p = q; if (p == NIL) return (NIL); lb = p->range[0]; ub = p->range[1]; if (p->class != RANGE && p->class != SCAL) panic("setran"); set.lwrb = lb; /* set.(upperbound prime) = number of bits - 1; */ set.uprbp = ub-lb; } /* * Return the number of bytes required to hold an arithmetic quantity */ bytes(lb, ub) long lb, ub; { #ifndef DEBUG if (lb < -32768 || ub > 32767) return (4); else if (lb < -128 || ub > 127) return (2); #else if (!hp21mx && (lb < -32768 || ub > 32767)) return (4); if (lb < -128 || ub > 127) return (2); #endif else return (1); } ge[1]; if (p->class != RANGE && p->class != SCAL) panic("setran"); set.lwrb = lb; /* set.(upperbouncmd/pc0/version.c 644 0 33 766 2552606612 7106 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)version.c 1.1 8/27/80"; /* * this writes the declaration of the character string version * onto standard output. * useful for makeing Version.c give the correct date for pi. */ #include char *ctime(); long clock; char *cstring; main() { time( &clock ); cstring = ctime( &clock ); cstring[ 24 ] = '\0'; printf( "char version[] = \"%s\";\n" , cstring ); } "((cmd/pc0/whoami.h 600 0 33 1041 2552606612 6705 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)pcwhoami.h 1.2 3/6/81"; */ /* * am i generating an obj file (OBJ), * postfix binary input to the 2nd pass of the portable c compiler (PC), * or pTrees (PTREE)? */ #undef OBJ #define PC #undef PTREE /* * am i the vax or the pdp11 version */ #define VAX #undef PDP11 #define DEC11 /* * am i pi or pxp? */ #define PI #undef PXP /* * am i both passes, or am i only one of the two passes pi0 or pi1? */ #define PI01 #undef PI0 #undef PI1 the University of California */ /* static char sccsid[] = "@(#)pcwhoami.h 1.2 3/6/81"; */ /* * am i generating an obj file (OBJ), * postfix binary input to the 2nd pass of the portable c compiler (PC), * or pTrees (PTREE)? */ #undef OBJ #define PC #undef PTREE /* * am i the vax or the pdp11 version */ #define VAX #undef PDP11 #define DEC11 /* * am i pi or pxp? */ #define PI #undef PXP /* * am i both passes, or am i only one of the two passes pi0 or pi1? */ #decmd/pc0/yy.h 644 0 33 15036 2552606612 6123 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)yy.h 1.1 8/27/80"; */ #include "y.tab.h" /* * INPUT/OUTPUT */ /* * The buffer for the input file is normally "ibuf". * When files are included, however, this may be * pushed down in the stack of currently active * files. For this reason, the pointer ibp always * references the i/o buffer of the current input file. */ FILE *ibuf, *ibp; /* * Line and token buffers. Charbuf is the character buffer for * input lines, token the buffer for tokens returned * by the scanner. CBSIZE defines the maximum line * length allowed on input and is doubtless too small. * The token buffer should be a local array in yylex. */ #define CBSIZE 161 char charbuf[CBSIZE], *bufp, token[CBSIZE]; #define digit(c) (c >= '0' && c <= '9') #define alph(c) ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) /* * Flag to prevent reprinting current line after * an error. */ char yyprtd; /* * The following variables are maintained by * the scanner in the file lex and used in scanning * and in parsing. * * The variable yychar is the current scanner character. * Currently, the scanner must be called as * yychar = yylex() * even though it should set yychar itself. * Yychar has value YEOF at end of file, and negative value if * there is no yychar, e.g. after a shift in the parser. * * The variable yycol is the current column in the line whose number * is given by yyline. Yyecol and yyeline give the position for an * error message to flag, usually the start of an input token. * Yylval is the semantic return from the scanner. * * In fact all of these variables are "per token". * In the usual case, only the copies in the scanner token structure * 'Y' are used, and the #defines below serve to make them look * like variables. * * For the purposes of the error recovery, however, they are copied * and restored quite freely. For the error recovery also, the * file name which the input line this token is on and the seek * pointer of this line in its source file are saved as yyefile * and yyseekp. The global variable yylinpt is the seek pointer * of the current input line. */ int yycol; int yyline; int yyseqid; int yysavc; int yylinpt; /* *** NOTE *** * It would be much better to not have the Yyeline and Yyefile * in the scanner structure and to have a mechanism for mapping * seqid's to these globally. */ struct yytok { int Yychar; int Yylval; int Yyecol; int Yyeline; int Yyseekp; char *Yyefile; int Yyeseqid; } Y, OY; #define yychar Y.Yychar #define yylval Y.Yylval #define yyecol Y.Yyecol #define yyeline Y.Yyeline #define yyseekp Y.Yyseekp #define yyefile Y.Yyefile #define yyeseqid Y.Yyeseqid /* * Yyval is the semantic value returned by a reduction. * It is what "$$" is expanded to by yacc. */ int *Ps, *yyval; /* * N is the length of a reduction. * Used externally by "lineof" to get the left and * right margins for a reduction. */ int N; /* * Definitions for looking up keywords. * The keyword array is called yykey, and * lastkey points at the end of it. */ char *lastkey; struct kwtab { char *kw_str; int kw_val; } yykey[]; /* * ERROR RECOVERY EXTERNALS */ #define CLIMIT 40 /* see yyrecover.c */ char *tokname(); char *charname(); char *classes[]; /* * Tokens which yacc doesn't define */ #define YEOF 0 #define ERROR 256 /* * Limit on the number of syntax errors */ #define MAXSYNERR 100 /* * Big costs */ #define HUGE 50 #define INFINITY 100 /* * Kinds of panics */ #define PDECL 0 #define PSTAT 1 #define PEXPR 2 #define PPROG 3 #define yyresume() yyResume = 1; char yyResume; char dquote; char errout; /* * Yyidwant and yyidhave are the namelist classes * of identifiers associated with a identifier reduce * error, set before the recovery is called. * Since they may be set again during the forward move * they must be saved by yyrecover, which uses them in printing * error messages. */ int yyidhave, yyidwant; /* * The variables yy*shifts are used to prevent looping and the printing * of spurious messages in the parser. Yyshifts gives the number of * true input shifts since the last corrective action. YyOshifts * is the value of yyshifts before it was last cleared, and is used * by yyPerror in yypanic.c to suppress messages. * * Yytshifts counts true input shifts. It is used to prevent looping * inserting unique symbols. If yytshifts == yyTshifts (local to * yyrecover.c) then there has been no shift over true input since * the last unique symbol insertion. We refuse, in this case, * to insert more unique symbols so as to prevent looping. * * The recovery cannot loop because it guarantees the progress of the * parse, i.e.: * * 1) Any insertion guarantees to shift over 2 symbols, a replacement * over one symbol. * * 2) Unique symbol insertions are limited to one for each true * symbol of input, or "safe" insertion of the keywords "end" * and "until" at zero cost (safe since these are know to match * stack that cannot have been generated - e.g. "begin" or "repeat") * * 3) We never panic more than once from a given state without * shifting over input, i.e. we force the parse stack to shrink * after each unsuccessful panic. */ int yyshifts, yyOshifts; unsigned yytshifts; #ifdef PXP /* * Identifier class definitions */ #define UNDEF 0 #define CONST 1 #define TYPE 2 #define VAR 3 #define ARRAY 4 #define PTRFILE 5 #define RECORD 6 #define FIELD 7 #define PROC 8 #define FUNC 9 #define FVAR 10 #define REF 11 #define PTR 12 #define FILET 13 #define SET 14 #define RANGE 15 #define LABEL 16 #define WITHPTR 17 #define SCAL 18 #define STR 19 #define PROG 20 #define IMPROPER 21 /* * COMMENT FORMATTING DEFINITIONS */ /* * Count of tokens on this input line * Note that this can be off if input is not syntactically correct. */ int yytokcnt; int yywhcnt; /* * Types of comments */ #define CLMARG 0 #define CALIGN 1 #define CTRAIL 2 #define CRMARG 3 #define CSRMARG 4 #define CNL 5 #define CNLBL 6 #define CFORM 7 #define CINCLUD 8 /* * Comment structure * Cmhp is the head of the current list of comments */ struct comment { struct comment *cmnext; int cmdelim; struct commline *cml; int cmjust; int cmseqid; } *cmhp; /* * Structure for holding a comment line */ struct commline { char *cmtext; int cmcol; /* Only used for first line of comment currently */ struct commline *cml; }; struct W { int Wseqid; int Wcol; } yyw[MAXDEPTH + 1], *yypw; #define commform() quickcomm(CFORM) #define commnl() quickcomm(CNL) #define commnlbl() quickcomm(CNLBL) #endif p is the head of the current list of comments */ struct comment { struct comment *cmnext; int cmdelim; struct commline *cml; int cmjust; int cmseqid; } *cmhp; /* * Structure for holding a comment line */ struct commline { char *cmtext; int cmcol; /* Only used for first line of comment currently */ struct commline *cml; }; struct W { int Wseqid; int Wcol; } yyw[MAXDEPTH + 1], *yypw; #define commform() quickcomm(CFORM) #define commnl() quickcomm(CNL) #define commncmd/pc0/yycopy.c 644 0 33 547 2552606613 6753 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)yycopy.c 1.1 8/27/80"; #include "0.h" #include "yy.h" OYcopy () { register int *r0 = & OY; register int *r1 = & Y; register int r2 = ( sizeof ( struct yytok ) ) / ( sizeof ( int ) ); do { * r0 ++ = * r1 ++ ; } while ( -- r2 > 0 ); } ml; }; struct W { int Wseqid; int Wcol; } yyw[MAXDEPTH + 1/,5< /,"((cmd/pc0/yycosts.c 644 0 33 11455 2552606613 7174 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)yycosts.c 1.2 3/8/81"; #include "whoami.h" #include "0.h" #include "yy.h" /* * Symbol costs for Pascal. * * Cost strategy of August 14, 1977. * * The costs determined by the routines in this file are used by * the recovery in choosing appropriate corrections. * The cost vectors and the error productions in the grammar * work together to define the corrective capacity of the grammar. * * The costs here largely derive from those given in Steve Rhode's * thesis for the Pascal-I error correcting parser which he implemented. * Some minor changes have been made to adjust for the fact that * the current error recovery is not as "smart", both because of the * limited forward move and because of the lack of any type information * about identifiers. * * These adjustments largely take the form of increased costs for certain * tokens, noticeably keywords which are major brackets such as "begin" * "label", "procedure", etc. * * The overall weighting strategy is still similar to Rhodes' strategy. * The costs can be considered: * * LOW <= 3 * MEDIUM 4 or 5 * HIGH >= 6 */ /* * Insertion costs * * In addition to the normal symbol insertion costs, * there are zero cost insertions here. * The current error recovery system treats symbols * which have zero insertion cost in a special way, * inserting them but suppressing diagnostics. * This allows the system to hold of on bracketing * error diagnostics about missing end's until the * reduction occurs which knows the line number of the * corresponding "begin", "repeat", etc. * A more intelligent and useful diagnostic can then * be printed. * * Although this routine never allows the insertion * of the keyword begin, it can be inserted after a * procedure or function body starts, if it was omitted * by a special case in the panic routine, which notices * the keywords in the statement body of the procedure * and inserts the begin to recover. * * Similarly, we do not insert end-of-file, but * the fact that end-of-file is the unique input * is noticed by the recovery routines as a special * case and handled there. */ inscost(sy, before) register int sy, before; { switch (before) { case YEND: if (sy == YEND) break; case YPROCEDURE: case YFUNCTION: if (sy == YUNTIL || sy == YEND) return (0); } switch (sy) { case ';': return (1); case ',': case ':': case YOF: case YDO: return (2); case YARRAY: case '+': case '*': return (3); default: return (4); case '^': case YNOT: case YLABEL: case YCONST: case YTYPE: case YVAR: case YUNTIL: case '(': case '[': case YWHILE: case YWITH: case YASSERT: return (5); case YPROCEDURE: case YFUNCTION: case YCASE: return (6); case YEND: return (8); case YBEGIN: case YEOF: case YREPEAT: case YRECORD: return (INFINITY); } } /* * Replacement costs * * Most replacement costs are the same as an insertion * plus a deletion cost. One special case is the replacement * of a large number of keywords by an identifier. * These are given lower costs, especially the keyword "to". */ repcost(what, with) register int what, with; { register int c; if (with == what) return (INFINITY); if (with == YID && what > ERROR) switch (what) { case YID: case YDOTDOT: case YINT: case YBINT: case YSTRING: case YNUMB: break; case YTO: return (3); default: return (5); case YRECORD: case YTHEN: return (6); case YBEGIN: break; } if (what == ';' && (with == ',' || with == '.')) return (CLIMIT - 1); c = delcost(what) + inscost(with); /* * It costs extra to replace something which has * semantics by something which doesn't. */ if (nullsem(what) == NIL && nullsem(with) != NIL) c += 4; return (c); } /* * Deletion costs */ delcost(what) int what; { switch (what) { case '.': case ':': case ',': case '=': case '(': return (3); case YELSE: case YTHEN: return (4); default: return (5); case YLABEL: case YCONST: case YTYPE: case YVAR: return (10); case YPROCEDURE: case YFUNCTION: case YBEGIN: case YEND: return ((CLIMIT * 3) / 4); case ';': case YEOF: return (INFINITY); } } #ifdef DEBUG /* * Routine to print out costs with "-K" option. */ char yysyms[] = ";,:=*+/-|&()[]<>~^"; yycosts() { register int c; register char *cp; printf("Insert\tDelete\tRep(ID)\tSymbol\n"); for (cp = yysyms; *cp; cp++) yydocost(*cp); for (c = ERROR + 1; c < YLAST; c++) yydocost(c); #ifdef PXP flush(); #endif } yydocost(c) int c; { printf("%4d\t", inscost(c, -1)); printf("%4d\t", delcost(c)); if (repcost(c, YID) != inscost(YID) + delcost(c)) printf("%4d", repcost(c, YID)); printf("\t%s%s\n", charname(c)); } #endif ut costs with "-K" option. */ char yysyms[] = ";,:=*+/-|&()[]<>~^"; yycosts() { register int c; register char *cp; printf("Insert\tDelete\tRep(ID)\tSymbol\n"); for (cp = yysyms; *cp; cp++) yydocost(*cpcmd/pc0/yyerror.c 644 0 33 3133 2552606613 7144 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)yyerror.c 1.2 3/8/81"; #include "whoami.h" #include "0.h" #include "yy.h" /* * Yerror prints an error * message and then returns * NIL for the tree if needed. * The error is flagged on the * current line which is printed * if the listing is turned off. #ifdef PXP * * As is obvious from the fooling around * with fout below, the Pascal system should * be changed to use the new library "lS". #endif */ yerror(s, a1, a2, a3, a4, a5) char *s; { #ifdef PI char buf[256]; #endif register int i, j; static yySerrs; #ifdef PXP int ofout; #endif if (errpfx == 'w' && opt('w') != 0) { errpfx = 'E'; return; } #ifdef PXP flush(); ofout = fout[0]; fout[0] = errout; #endif yyResume = 0; #ifdef PI geterr(s, buf); s = buf; #endif yysync(); pchr(errpfx); pchr(' '); for (i = 3; i < yyecol; i++) pchr('-'); printf("^--- "); /* if (yyecol > 60) printf("\n\t"); */ printf(s, a1, a2, a3, a4, a5); pchr('\n'); if (errpfx == 'E') #ifdef PI eflg = TRUE, codeoff(); #endif #ifdef PXP eflg = TRUE; #endif errpfx = 'E'; yySerrs++; if (yySerrs >= MAXSYNERR) { yySerrs = 0; yerror("Too many syntax errors - QUIT"); pexit(ERRS); } #ifdef PXP flush(); fout[0] = ofout; return (0); #endif } /* * A bracketing error message */ brerror(where, what) int where; char *what; { if (where == 0) { line = yyeline; setpfx(' '); error("End matched %s on line %d", what, where); return; } if (where < 0) where = -where; yerror("Inserted keyword end matching %s on line %d", what, where); } UE; #endif errpfx = 'E'; yySerrs++; if (yySerrs >= MAXSYNERR) { yySerrs = 0; yerror("Too many syntax errors - QUIT"); pexit(ERRS); } #ifdef PXP flush(); fout[0] = ofout; return (0); #endif } /* * A bracketing error message */ brerror(where, what) int where; char *what; { if (where == 0) { line = yyeline; setpfx(' '); error("End matched %s on line %d", what, where); return; } if (where < 0cmd/pc0/yyget.c 644 0 33 13763 2553177701 6626 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)yyget.c 1.1 8/27/80"; #include "whoami.h" #include "0.h" #include "yy.h" #ifdef PXP int yytokcnt; #endif /* * Readch returns the next * character from the current * input line or -1 on end-of-file. * It also maintains yycol for use in * printing error messages. */ readch() { register i, c; if (*bufp == '\n' && bufp >= charbuf) { #ifdef PXP yytokcnt = 0; #endif if (getline() < 0) return (-1); } c = *++bufp; if (c == '\t') yycol = ((yycol + 8) & ~7); else yycol++; return (c); } /* * Definitions of the structures used for the * include facility. The variable "ibp" points * to the getc buffer of the current input file. * There are "inclev + 1" current include files, * and information in saved in the incs stack * whenever a new level of include nesting occurs. * * Ibp in the incs structure saves the pointer * to the previous levels input buffer; * filename saves the previous file name; * Printed saves whether the previous file name * had been printed before this nesting occurred; * and yyline is the line we were on on the previous file. */ #define MAXINC 10 struct inc { FILE *ibp; char *filename; int Printed; int yyline; int yyLinpt; } incs[MAXINC]; extern char *printed; int inclev = -1; #ifdef PXP /* * These initializations survive only if * pxp is asked to pretty print one file. * Otherwise they are destroyed by the initial * call to getline. */ char charbuf[CBSI((ZE] = " program x(output);\n"; int yycol = 8; char *bufp = charbuf; #endif /* * YyLinpt is the seek pointer to the beginning of the * next line in the file. */ int yyLinpt; /* * Getline places the next line * from the input stream in the * line buffer, returning -1 at YEOF. */ getline() { register char *cp; register CHAR c; #ifdef PXP static char ateof; #endif register FILE *ib; int i; if (opt('l') && yyprtd == 0) yyoutline(); yyprtd = 0; top: yylinpt = yyLinpt; yyline++; yyseqid++; cp = charbuf; ib = ibp; i = sizeof charbuf - 1; for (;;) { c = getc(ib); if (c == EOF) { if (uninclud()) goto top; #ifdef PXP if (ateof == 0 && bracket) { strcpy(charbuf, "begin end.\n"); ateof = 1; goto out; } #endif bufp = "\n"; yyline--; yyseqid--; yyprtd = 1; return (-1); } *cp++ = c; if (c == '\n') break; if (--i == 0) { line = yyline; error("Input line too long - QUIT"); pexit(DIED); } } *cp = 0; yyLinpt = yylinpt + cp - charbuf; if (includ()) goto top; #ifdef PXP if (cp == &charbuf[1]) commnl(); else if (cp == &charbuf[2]) switch (charbuf[0]) { case ' ': commnlbl(); break; case '\f': commform(); } #endif if (opt('u')) setuflg(); out: bufp = charbuf - 1; yycol = 8; return (1); } /* * Check an input line to see if it is a "#include" pseudo-statement. * We allow arbitrary blanks in the line and the file name * may be delimited by either 's or "s. A single semicolon * may be placed after the name, but nothing else is allowed */ includ() { register char *cp, *dp; char ch; register struct inc *ip; cp = charbuf; if (*cp++ != '#') return (0); cp = skipbl(cp); for (dp = "include"; *dp; dp++) if (*dp != *cp++) return (0); line = yyline; cp = skipbl(cp); ch = *cp++; if (ch != '\'' && ch != '"') { /* * This should be a yerror flagging the place * but its not worth figuring out the column. */ line = yyline; error("Include syntax error - expected ' or \" not found - QUIT"); pexit(DIED); } for (dp = cp; *dp != ch; dp++) if (*dp == 0) { line = yyline; error("Missing closing %c for include file name - QUIT", ch); pexit(DIED); } *dp++ = 0; /* * if (*dp == ';') * dp++; * dp = skipbl(dp); * if (*dp != '\n') { * line = yyline; * error("Garbage after filename in include"); * pexit(DIED); * } */ if ((!dotted(cp, 'i')) && (!dotted(cp, 'h'))) { line = yyline; error("Include filename must end in .i or .h"); } #ifdef PXP commincl(cp, ch); if (noinclude) return (1); #endif inclev++; if (inclev > MAXINC) { line = yyline; error("Absurdly deep include nesting - QUIT"); pexit(DIED); } ip = &incs[inclev]; ip->filename = filename; filename = savestr(cp); /* * left over from before stdio * * cp = malloc(518); * if (cp == -1) { * error("Ran out of memory (include)"); * pexit(DIED); * } * */ ip->ibp = ibp; if ( ( ibp = fopen(filename, "r" ) ) == NULL ) { perror(filename); pexit(DIED); } if (inpflist(filename)) { #ifdef PI opush('l'); #endif #ifdef PXP opush('z'); #endif } ip->Printed = printed; printed = 0; ip->yyline = yyline; yyline = 0; ip->yyLinpt = yyLinpt; yyLinpt = 0; /* * left over from before stdio * * ip->ibp = ibp; * ibp = cp; * */ # ifdef PC stabinclude( filename ); # endif PC return (1); } skipbl(ocp) char *ocp; { register char *cp; cp = ocp; while (*cp == ' ' || *cp == '\t') cp++; return (cp); } /* * At the end of an include, * close the file, free the input buffer, * and restore the environment before * the "push", including the value of * the z option for pxp and the l option for pi. */ uninclud() { register struct inc *ip; if (inclev < 0) return (0); /* * left over from before stdio: becomes fclose ( ibp ) * * close(ibp[0]); * free(ibp); * */ fclose ( ibp ); ip = &incs[inclev]; ibp = ip->ibp; yyline = ip->yyline; if (inpflist(filename)) { #ifdef PI opop('l'); #endif #ifdef PXP opop('z'); #endif } filename = ip->filename; yyLinpt = ip->yyLinpt; /* * If we printed out the nested name, * then we should print all covered names again. * If we didn't print out the nested name * we print the uncovered name only if it * has not been printed before (unstack). */ if (printed) { printed = 0; while (ip >= incs) { ip->Printed = 0; ip--; } } else printed = ip->Printed; # ifdef PC /* if ( inclev == 0 ) { stabsource( filename ); } else { */ stabinclude( filename ); /* } */ # endif PC inclev--; return (1); } npt; /* * cmd/pc0/yyid.c 644 0 33 11660 2552606614 6434 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)yyid.c 1.3 3/8/81"; #include "whoami.h" #include "0.h" #include "yy.h" #ifdef PI extern int *yypv; /* * Determine whether the identifier whose name * is "cp" can possibly be a kind, which is a * namelist class. We look through the symbol * table for the first instance of cp as a non-field, * and at all instances of cp as a field. * If any of these are ok, we return true, else false. * It would be much better to handle with's correctly, * even to just know whether we are in a with at all. * * Note that we don't disallow constants on the lhs of assignment. */ identis(cp, kind) register char *cp; int kind; { register struct nl *p; int i; /* * Cp is NIL when error recovery inserts it. */ if (cp == NIL) return (1); /* * Record kind we want for possible later use by yyrecover */ yyidwant = kind; yyidhave = NIL; i = ( (int) cp ) & 077; for (p = disptab[i]; p != NIL; p = p->nl_next) if (p->symbol == cp) { if (yyidok(p, kind)) goto gotit; if (p->class != FIELD && p->class != BADUSE) break; } if (p != NIL) for (p = p->nl_next; p != NIL; p = p->nl_next) if (p->symbol == cp && p->class == FIELD && yyidok(p, kind)) goto gotit; return (0); gotit: if (p->class == BADUSE && !Recovery) { yybadref(p, OY.Yyeline); yypv[0] = NIL; } return (1); } /* * A bad reference to the identifier cp on line * line and use implying the addition of kindmask * to the mask of kind information. */ yybaduse(cp, line, kindmask) register char *cp; int line, kindmask; { register struct nl *p, *oldp; int i; i = ( (int) cp ) & 077; for (p = disptab[i]; p != NIL; p = p->nl_next) if (p->symbol == cp) break; oldp = p; if (p == NIL || p->class != BADUSE) p = enter(defnl(cp, BADUSE, 0, 0)); p->value[NL_KINDS] |= kindmask; yybadref(p, line); return (oldp); } /* * ud is initialized so that esavestr will allocate * sizeof ( struct udinfo ) bytes for the 'real' struct udinfo */ struct udinfo ud = { ~0 , ~0 , 0}; /* * Record a reference to an undefined identifier, * or one which is improperly used. */ yybadref(p, line) register struct nl *p; int line; { register struct udinfo *udp; if (p->chain != NIL && p->chain->ud_line == line) return; udp = esavestr(&ud); udp->ud_line = line; udp->ud_next = p->chain; p->chain = udp; } #define varkinds ((1<class == BADUSE) { if (kind == VAR) return (p->value[0] & varkinds); return (p->value[0] & (1 << kind)); } if (yyidok1(p, kind)) return (1); if (yyidhave != NIL) yyidhave = IMPROPER; else yyidhave = p->class; return (0); } yyidok1(p, kind) register struct nl *p; int kind; { int i; switch (kind) { case FUNC: return ( p -> class == FUNC || p -> class == FVAR || p -> class == FFUNC ); case PROC: return ( p -> class == PROC || p -> class == FPROC ); case CONST: case TYPE: case FIELD: return (p->class == kind); case VAR: return (p->class == CONST || yyisvar(p, NIL)); case ARRAY: case RECORD: return (yyisvar(p, kind)); case PTRFILE: return (yyisvar(p, PTR) || yyisvar(p, FILET)); } } yyisvar(p, class) register struct nl *p; int class; { switch (p->class) { case FIELD: case VAR: case REF: case FVAR: /* * We would prefer to return * parameterless functions only. */ case FUNC: case FFUNC: return (class == NIL || (p->type != NIL && p->type->class == class)); case PROC: case FPROC: return ( class == NIL ); } return (0); } #endif #ifdef PXP #ifndef DEBUG identis() { return (1); } #endif #ifdef DEBUG extern char *classes[]; char kindchars[] "UCTVAQRDPF"; /* * Fake routine "identis" for pxp when testing error recovery. * Looks at letters in variable names to answer questions * about attributes. Mapping is * C const_id * T type_id * V var_id also if any of AQRDF * A array_id * Q ptr_id * R record_id * D field_id D for "dot" * P proc_id * F func_id */ identis(cp, kind) register char *cp; int kind; { register char *dp; char kindch; /* * Don't do anything unless -T */ if (!typetest) return (1); /* * Inserted symbols are always correct */ if (cp == NIL) return (1); /* * Set up the names for error messages */ yyidwant = classes[kind]; for (dp = kindchars; *dp; dp++) if (any(cp, *dp)) { yyidhave = classes[dp - kindchars]; break; } /* * U in the name means undefined */ if (any(cp, 'U')) return (0); kindch = kindchars[kind]; if (kindch == 'V') for (dp = "AQRDF"; *dp; dp++) if (any(cp, *dp)) return (1); return (any(cp, kindch)); } #endif #endif eturn (1); /* * Inserted symbols are always correct */ if (cp == NIL) r((cmd/pc0/yylex.c 644 0 33 13356 2552606614 6634 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)yylex.c 1.2 3/8/81"; #include "whoami.h" #include "0.h" #include "yy.h" /* * Scanner */ int yylacnt; #define YYLASIZ 10 struct yytok Yla[YYLASIZ]; unyylex(y) struct yylex *y; { if (yylacnt == YYLASIZ) panic("unyylex"); copy(&Yla[yylacnt], y, sizeof Yla[0]); yylacnt++; } yylex() { register c; register **ip; register char *cp; int f; char delim; if (yylacnt != 0) { yylacnt--; copy(&Y, &Yla[yylacnt], sizeof Y); return (yychar); } if (c = yysavc) yysavc = 0; else c = readch(); #ifdef PXP yytokcnt++; #endif next: /* * skip white space */ #ifdef PXP yywhcnt = 0; #endif while (c == ' ' || c == '\t') { #ifdef PXP if (c == '\t') yywhcnt++; yywhcnt++; #endif c = readch(); } yyecol = yycol; yyeline = yyline; yyefile = filename; yyeseqid = yyseqid; yyseekp = yylinpt; cp = token; yylval = yyline; switch (c) { case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': case 's': case 't': case 'u': case 'v': case 'w': case 'x': case 'y': case 'z': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z': do { *cp++ = c; c = readch(); } while (alph(c) || digit(c)); *cp = 0; if (opt('s')) for (cp = token; *cp; cp++) if (*cp >= 'A' && *cp <= 'Z') { *cp |= ' '; } yysavc = c; ip = hash(0, 1); if (*ip < yykey || *ip >= lastkey) { yylval = *ip; return (YID); } yylval = yyline; /* * For keywords * the lexical token * is magically retrieved * from the keyword table. */ return ((*ip)[1]); case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': f = 0; do { *cp++ = c; c = readch(); } while (digit(c)); if (c == 'b' || c == 'B') { /* * nonstandard - octal constants */ if (opt('s')) { standard(); yerror("Octal constants are non-standard"); } *cp = 0; yylval = copystr(token); return (YBINT); } if (c == '.') { c = readch(); if (c == '.') { *cp = 0; yysavc = YDOTDOT; yylval = copystr(token); return (YINT); } infpnumb: f++; *cp++ = '.'; if (!digit(c)) { yyset(); recovered(); yerror("Digits required after decimal point"); *cp++ = '0'; } else while (digit(c)) { *cp++ = c; c = readch(); } } if (c == 'e' || c == 'E') { f++; *cp++ = c; if ((c = yysavc) == 0) c = readch(); if (c == '+' || c == '-') { *cp++ = c; c = readch(); } if (!digit(c)) { yyset(); yerror("Digits required in exponent"); *cp++ = '0'; } else while (digit(c)) { *cp++ = c; c = readch(); } } *cp = 0; yysavc = c; yylval = copystr(token); if (f) return (YNUMB); return (YINT); case '"': case '`': if (!any(bufp + 1, c)) goto illch; if (!dquote) { recovered(); dquote++; yerror("Character/string delimiter is '"); } case '\'': case '#': delim = c; do { do { c = readch(); if (c == '\n') { yerror("Unmatched %c for string", delim); if (cp == token) *cp++ = ' ', cp++; break; } *cp++ = c; } while (c != delim); c = readch(); } while (c == delim); *--cp = 0; if (cp == token) { yerror("Null string not allowed"); *cp++ = ' '; *cp++ = 0; } yysavc = c; yylval = copystr(token); return (YSTRING); case '.': c = readch(); if (c == '.') return (YDOTDOT); if (digit(c)) { recovered(); yerror("Digits required before decimal point"); *cp++ = '0'; goto infpnumb; } yysavc = c; return ('.'); case '{': /* * { ... } comment */ #ifdef PXP getcm(c); #endif #ifdef PI c = options(); while (c != '}') { if (c <= 0) goto nonterm; if (c == '{') { warning(); yyset(); yerror("{ in a { ... } comment"); } c = readch(); } #endif c = readch(); goto next; case '(': if ((c = readch()) == '*') { /* * (* ... *) comment */ #ifdef PXP getcm(c); c = readch(); goto next; #endif #ifdef PI c = options(); for (;;) { if (c < 0) { nonterm: yerror("Comment does not terminate - QUIT"); pexit(ERRS); } if (c == '(' && (c = readch()) == '*') { warning(); yyset(); yerror("(* in a (* ... *) comment"); } if (c == '*') { if ((c = readch()) != ')') continue; c = readch(); goto next; } c = readch(); } #endif } yysavc = c; c = '('; case ';': case ',': case ':': case '=': case '*': case '+': case '/': case '-': case '|': case '&': case ')': case '[': case ']': case '<': case '>': case '~': case '^': return (c); default: switch (c) { case YDOTDOT: return (c); case '\n': c = readch(); #ifdef PXP yytokcnt++; #endif goto next; case '\f': c = readch(); goto next; } if (c <= 0) return (YEOF); illch: do yysavc = readch(); while (yysavc == c); yylval = c; return (YILLCH); } } yyset() { yyecol = yycol; yyeline = yyline; yyefile = filename; yyseekp = yylinpt; } /* * Setuflg trims the current * input line to at most 72 chars * for the u option. */ setuflg() { if (charbuf[71] != '\n') { charbuf[72] = '\n'; charbuf[73] = 0; } } ; #ifdef PXP yytokcnt++; #endif goto next; case '\f': c = readch(); goto next; } if (c <= 0) return (YEOF); illch: do yysavc = readch(); while (yysavc == c); yylval = c; return (YILLCH); } } yyset() { yyecol = yycol; yycmd/pc0/yymain.c 644 0 33 5122 2552606615 6741 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)yymain.c 1.2 3/8/81"; #include "whoami.h" #include "0.h" #include "yy.h" #include #include "objfmt.h" #include /* * Yymain initializes each of the utility * clusters and then starts the processing * by calling yyparse. */ yymain() { /* * Initialize the scanner */ #ifdef PXP if (bracket == 0) { #endif if (getline() == -1) { Perror(filename, "No lines in file"); pexit(NOSTART); } #ifdef PXP } else yyline = 0; #endif #ifdef PI # ifdef OBJ magic(); # endif OBJ #endif line = 1; errpfx = 'E'; /* * Initialize the clusters * initstring(); */ inithash(); inittree(); #ifdef PI initnl(); #endif /* * Process the input */ yyparse(); #ifdef PI # ifdef OBJ magic2(); # endif OBJ # ifdef DEBUG dumpnl(0); # endif #endif #ifdef PXP prttab(); if (onefile) { extern int outcol; if (outcol) pchr('\n'); flush(); if (eflg) { writef(2, "File not rewritten because of errors\n"); pexit(ERRS); } signal(SIGHUP, SIG_IGN); signal(SIGINT, SIG_IGN); copyfile(); } #endif pexit(eflg ? ERRS : AOK); } #ifdef PXP copyfile() { extern int fout[]; register int c; close(1); if (creat(firstname, 0644) != 1) { perror(firstname); pexit(ERRS); } lseek(fout[0], 0l, 0); while ((c = read(fout[0], &fout[3], 512)) > 0) { if (write(1, &fout[3], c) != c) { perror(firstname); pexit(ERRS); } } } #endif static struct exec magichdr; #ifdef PI #ifdef OBJ magic() { short buf[HEADER_BYTES / sizeof ( short )]; unsigned *ubuf = buf; register int hf, i; hf = open(PX_HEADER,0); if (hf >= 0 && read(hf, buf, HEADER_BYTES) > sizeof(struct exec)) { magichdr.a_magic = ubuf[0]; magichdr.a_text = ubuf[1]; magichdr.a_data = ubuf[2]; magichdr.a_bss = ubuf[3]; magichdr.a_syms = ubuf[4]; magichdr.a_entry = ubuf[5]; magichdr.a_trsize = ubuf[6]; magichdr.a_drsize = ubuf[7]; for (i = 0; i < HEADER_BYTES / sizeof ( short ); i++) word(buf[i]); } close(hf); } #endif OBJ #ifdef OBJ magic2() { struct pxhdr pxhd; if (magichdr.a_magic != 0407) panic ( "magic2" ); pflush(); lseek(ofil, 0l, 0); magichdr.a_data = ( unsigned ) lc - magichdr.a_text; magichdr.a_data -= sizeof (struct exec); write(ofil, &magichdr, sizeof(struct exec)); pxhd.objsize = ( ( unsigned ) lc) - HEADER_BYTES; time(&pxhd.maketime); pxhd.magicnum = MAGICNUM; lseek(ofil, ( long ) ( HEADER_BYTES - sizeof ( pxhd ) ) , 0); write(ofil, &pxhd, sizeof (pxhd)); } #endif OBJ #endif #ifdef PXP writef(i, cp) { write(i, cp, strlen(cp)); } #endif if (magichdr.a_magic != 0407) panic ( "magic2" ); pflush(); lseek(ofil, 0l, 0); magichdr.a_data = ( unsigned ) lc - magichdr.a_text; magichdr.a_data -= sizeof (struct exec); write(ofil, &magichdr, sizeof(struct exec)); pxhd.objsize = ( ( unsigned ) lc) - HEADER_BYTES; time(&pxhd.maketime); pxhd.magicnum = MAGICNUM; lseek(ofil, ( long ) ( HEADER_BYTES - sizeof ( pxhd ) ) , 0); write(ofil, &pxhd, sizeof (pxhd)); } #((cmd/pc0/yyoptions.c 644 0 33 2274 2552606615 7515 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)yyoptions.c 1.1 8/27/80"; #include "whoami.h" #include "0.h" #include "yy.h" /* * Options processes the option * strings which can appear in * comments and returns the next character. */ options() { register c, ch; register char *optp; int ok; c = readch(); if (c != '$') return (c); do { ch = c = readch(); switch (c) { case 'b': optp = &opt( 'b' ); c = readch(); if (!digit(c)) return (c); *optp = c - '0'; c = readch(); break; # ifdef PC case 'C': /* * C is a replacement for t, fake it. */ c = 't'; /* and fall through */ case 'g': # endif PC case 'k': case 'l': case 'n': case 'p': case 's': case 't': case 'u': case 'w': case 'z': optp = &opt( c ); c = readch(); if (c == '+') { *optp = 1; c = readch(); } else if (c == '-') { *optp = 0; c = readch(); } else { return (c); } break; default: return (c); } #ifdef PI0 send(ROSET, ch, *optp); #endif } while (c == ','); if ( opt( 'u' ) ) setuflg(); return (c); } l through */ case 'g': # endif PC case 'k': case 'l': case 'n': case 'p': case 's': case 't': case 'u': case 'w': case 'z': optp = &opt( c ); c = readch(); if (c == '+') { *optp = 1; c = readch(); } else if (c == '-') { *optp = 0; c = readch(); } elcmd/pc0/yypanic.c 644 0 33 6140 2552606615 7110 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)yypanic.c 1.2 3/8/81"; #include "whoami.h" #include "0.h" #include "yy.h" struct yytok oldpos; /* * The routine yyPerror coordinates the panic when * the correction routines fail. Three types of panics * are possible - those in a declaration part, those * in a statement part, and those in an expression. * * Declaration part panics consider insertion of "begin", * expression part panics will stop on more symbols. * The panics are otherwise the same. * * ERROR MESSAGE SUPPRESSION STRATEGY: August 11, 1977 * * If the parser has not made at least 2 moves since the last point of * error then we want to suppress the supplied error message. * Otherwise we print it. * We then skip input up to the next solid symbol. */ yyPerror(cp, kind) char *cp; register int kind; { register int ishifts, brlev; copy(&oldpos, &Y, sizeof oldpos); brlev = 0; if (yychar < 0) yychar = yylex(); for (ishifts = yyshifts; ; yychar = yylex(), yyshifts++) switch (yychar) { case YILLCH: yerror("Illegal character"); if (ishifts == yyshifts) yyOshifts = 0; continue; case YEOF: goto quiet; case ';': if (kind == PPROG) continue; if (kind == PDECL) yychar = yylex(); goto resume; case YEND: if (kind == PPROG) continue; case YPROCEDURE: case YFUNCTION: goto resume; case YLABEL: case YTYPE: case YCONST: case YVAR: if (kind == PSTAT) { yerror("Declaration found when statement expected"); goto quiet; } case YBEGIN: goto resume; case YFOR: case YREPEAT: case YWHILE: case YGOTO: case YIF: if (kind != PDECL) goto resume; yerror("Expected keyword begin after declarations, before statements"); unyylex(&Y); yychar = YBEGIN; yylval = nullsem(YBEGIN); goto quiet; case YTHEN: case YELSE: case YDO: if (kind == PSTAT) { yychar = yylex(); goto resume; } if (kind == PEXPR) goto resume; continue; case ')': case ']': if (kind != PEXPR) continue; if (brlev == 0) goto resume; if (brlev > 0) brlev--; continue; case '(': case '[': brlev++; continue; case ',': if (brlev != 0) continue; case YOF: case YTO: case YDOWNTO: if (kind == PEXPR) goto resume; continue; #ifdef PI /* * A rough approximation for now * Should be much more lenient on suppressing * warnings. */ case YID: syneflg = TRUE; continue; #endif } resume: if (yyOshifts >= 2) { if (yychar != -1) unyylex(&Y); copy(&Y, &oldpos, sizeof Y); yerror(cp); yychar = yylex(); } quiet: if (yyshifts - ishifts > 2 && opt('r')) { setpfx('r'); yerror("Parsing resumes"); } /* * If we paniced in the statement part, * and didn't stop at a ';', then we insert * a ';' to prevent the recovery from immediately * inserting one and complaining about it. */ if (kind == PSTAT && yychar != ';') { unyylex(&Y); yyshifts--; yytshifts--; yychar = ';'; yylval = nullsem(';'); } } char != -1) unyylex(&Y); copy(&Y, &oldpos, sizeof Y); yerror(cp); yychar = yylex(); } quiet: if (yyshifts - ishifts > 2 && opt('r')) { setpfx('r'); yerror("Parsing resumes"); } /* * If we paniced in the statement part, * and didn't stop at a ';', then we insert * a ';' to prevent the recovery from immediately * inserting one and complaining about it. */ if (kind == PSTAT && yychar != 'cmd/pc0/yyparse.c 644 0 33 6400 2552606615 7127 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)yyparse.c 1.2 3/8/81"; #include "whoami.h" #include "0.h" #include "yy.h" /* * Parser for 'yacc' output. * Specifially Modified for Berkeley Pascal */ int yystate; /* Current parser state */ int *yypv; unsigned yytshifts = 1; /* Number of "true" shifts */ /* * Parse Tables */ int yygo[]; int yypgo[]; int yyr1[]; int yyr2[]; int yyact[]; int yypact[]; /* * Parse and parallel semantic stack */ int yyv[MAXDEPTH]; int yys[MAXDEPTH]; /* * This routine parses the input stream, and * returns if it accepts, or if an unrecoverable syntax * error is encountered. */ yyparse() { register int *ps, n, *p; int paniced, *panicps, idfail; yystate = 0; yychar = yylex(); OY.Yychar = -1; yyshifts = 3; paniced = 0; ps = &yys[0]-1; yypv = &yyv[0]-1; #ifdef PXP yypw = &yyw[0]-1; #endif stack: /* * Push new state and value. */ if (yypv >= &yyv[MAXDEPTH-1]) { yerror("Parse stack overflow"); pexit(DIED); } *++ps = yystate; *++yypv = yyval; #ifdef PXP yypw++; #endif newstate: /* * Locate parsing actions for the * new parser state. */ p = &yyact[ yypact[yystate+1] ]; actn: /* * Search the parse actions table * for something useful to do. * While n is non-positive, it is the negation * of the token we are testing for. */ #ifdef PI if ((n = *p++) <= 0) { if (yychar < 0) yychar = yylex(); do if ((n += yychar) != 0) p++; while ((n = *p++) <= 0); } #else while ((n = *p++) <= 0) if ((n += yychar) != 0) p++; #endif switch (n >> 12) { /* * Shift. */ case 2: #ifdef PXP yypw[1].Wseqid = yyseqid; yypw[1].Wcol = yycol; #endif OYcopy(); yystate = n & 07777; yyval = yylval; #ifdef PI yychar = -1; #else yychar = yylex(); #endif yyshifts++; yytshifts++; goto stack; /* * Reduce. */ case 3: n &= 07777; N = yyr2[n]; if (N == 1 && OY.Yychar == YID && !yyEactr(n, yypv[0])) { idfail = 1; goto errin; } OY.Yychar = -1; ps -= N; yypv -= N; #ifdef PXP yypw -= N; #endif yyval = yypv[1]; yyactr(n); /* * Use goto table to find next state. */ p = &yygo[yypgo[yyr1[n]]]; while (*p != *ps && *p >= 0) p += 2; yystate = p[1]; goto stack; /* * Accept. */ case 4: return; /* * Error. */ case 1: idfail = 0; errin: if ((paniced || yyshifts != 0) && yyrecover(ps, idfail)) { paniced = 0; ps = Ps; yystate = *ps; goto newstate; } /* * Find a state where 'error' is a * legal shift action. */ if (paniced && yyshifts <= 0 && ps >= panicps) { yypv -= (ps - panicps) + 1; #ifdef PXP yypw -= (ps - panicps) + 1; #endif ps = panicps - 1; } while (ps >= yys) { for (p = &yyact[ yypact[*ps+1] ] ; *p <= 0; p += 2) if (*p == -256) { panicps = ps; yystate= p[1] & 07777; yyOshifts = yyshifts; yyshifts = 0; paniced = 1; goto stack; } --ps; --yypv; #ifdef PXP --yypw; #endif #ifdef PI if (OY.Yychar != YID) syneflg = TRUE; #endif OY.Yychar = -1; } if (yychar == YEOF) yyunexeof(); if (yystate == 1) yyexeof(); yerror("Unrecoverable syntax error - QUIT"); return; } panic("yyparse"); } (p = &yyact[ yypact[*ps+1] ] ; *p <= 0; p += 2) if (*p == -256) { panicps = ps; yystate= p[1] & 07777; yyOshifts = yyshifts; yyshifts = 0; paniced = 1; goto stack; } --ps; --yypv; #ifdef PXP --yypw;((cmd/pc0/yyprint.c 644 0 33 3400 2552606616 7147 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)yyprint.c 1.2 3/8/81"; #include "whoami.h" #include "0.h" #include "yy.h" char *tokname(); STATIC short bounce; /* * Printing representation of a * "character" - a lexical token * not in a yytok structure. * 'which' indicates which char * you want * should always be called as "charname(...,0),charname(...,1)" */ char * charname(ch , which ) int ch; int which; { struct yytok Ych; Ych.Yychar = ch; Ych.Yylval = nullsem(ch); return (tokname(&Ych , which )); } /* * Printing representation of a token * 'which' as above. */ char * tokname(tp , which ) register struct yytok *tp; int which; { register char *cp; register struct kwtab *kp; char *cp2; cp2 = ""; switch (tp->Yychar) { case YCASELAB: cp = "case-label"; break; case YEOF: cp = "end-of-file"; break; case YILLCH: cp = "illegal character"; break; case 256: /* error token */ cp = "error"; break; case YID: cp = "identifier"; break; case YNUMB: cp = "real number"; break; case YINT: case YBINT: cp = "number"; break; case YSTRING: cp = tp->Yylval; cp = cp == NIL || cp[1] == 0 ? "character" : "string"; break; case YDOTDOT: cp = "'..'"; break; default: if (tp->Yychar < 256) { cp = "'x'\0'x'\0'x'\0'x'"; /* * for four times reentrant code! * used to be: * if (bounce = ((bounce + 1) & 1)) * cp += 4; */ bounce = ( bounce + 1 ) % 4; cp += (4 * bounce); /* 'x'\0 is 4 chars */ cp[1] = tp->Yychar; break; } for (kp = yykey; kp->kw_str != NIL && kp->kw_val != tp->Yychar; kp++) continue; cp = "keyword "; cp2 = kp->kw_str; } return ( which ? cp2 : cp ); } TDOT: cp = "'..'"; break; default: if (tp->Yychar < 256) { cp = "'x'\0'x'\0'x'\0'x'"; /* * for four times reentrant code! * used to be: * if (bounce = ((bounce + 1) & 1)) * cp += 4; */ bounce = ( bounce + 1 )cmd/pc0/yyput.c 644 0 33 12056 2552606616 6652 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)yyput.c 1.2 3/8/81"; #include "whoami.h" #include "0.h" #include "tree.h" #include "yy.h" /* * Structure describing queued listing lines during the forward move * of error recovery. These lines will be stroed by yyoutline during * the forward move and flushed by yyoutfl or yyflush when an * error occurs or a program termination. */ struct B { int Bmagic; int Bline; int Bseekp; char *Bfile; int Bseqid; struct B *Bnext; } *bottled; /* * Filename gives the current input file, lastname is * the last filename we printed, and lastid is the seqid of the last line * we printed, to help us avoid printing * multiple copies of lines. */ extern char *filename; char *lastname; int lastid; char hadsome; char holdbl; /* * Print the current line in the input line * buffer or, in a forward move of the recovery, queue it for printing. */ yyoutline() { register struct B *bp; if (Recovery) { bp = tree(6, T_BOTTLE, yyline, yylinpt, filename, yyseqid); if (bottled != NIL) bp->Bnext = bottled->Bnext, bottled->Bnext = bp; else bp->Bnext = bp; bottled = bp; return; } yyoutfl(yyseqid); if (yyseqid != lastid) yyprline(charbuf, yyline, filename, yyseqid); } /* * Flush all the bottled output. */ yyflush() { yyoutfl(32767); } /* * Flush the listing to the sequence id toseqid */ yyoutfl(toseqid) int toseqid; { register struct B *bp; bp = bottled; if (bp == NIL) return; bp = bp->Bnext; while (bp->Bseqid <= toseqid) { yygetline(bp->Bfile, bp->Bseekp, bp->Bline, bp->Bseqid); if (bp->Bnext == bp) { bottled = NIL; break; } bp = bp->Bnext; bottled->Bnext = bp; } } FILE *yygetunit = NULL; char *yygetfile; /* * Yysync guarantees that the line associated * with the current token was the last line * printed for a syntactic error message. */ yysync() { yyoutfl(yyeseqid); if (lastid != yyeseqid) yygetline(yyefile, yyseekp, yyeline, yyeseqid); } yySsync() { yyoutfl(OY.Yyeseqid); } /* * Yygetline gets a line from a file after we have * lost it. The pointer efile gives the name of the file, * seekp its offset in the file, and eline its line number. * If this routine has been called before the last file * it worked on will be open in yygetunit, with the files * name being given in yygetfile. Note that this unit must * be opened independently of the unit in use for normal i/o * to this file; if it were a dup seeks would seek both files. */ yygetline(efile, seekp, eline, eseqid) char *efile; int seekp, eline, eseqid; { register int cnt; register char *bp; char buf[CBSIZE + 1]; if (lastid == eseqid) return; if (eseqid == yyseqid) { bp = charbuf; yyprtd++; } else { bp = buf; if (efile != yygetfile) { if ( yygetunit != NULL ) fclose( yygetunit ); yygetfile = efile; yygetunit = fopen( yygetfile , "r" ); if (yygetunit < 0) oops: perror(yygetfile), pexit(DIED); } if ( fseek( yygetunit , (long) seekp , 0 ) < 0) goto oops; cnt = fread( bp , sizeof( * bp ) , CBSIZE , yygetunit ); if (cnt < 0) goto oops; bp[cnt] = 0; } yyprline(bp, eline, efile, eseqid); } yyretrieve() { yygetline(OY.Yyefile, OY.Yyseekp, OY.Yyeline, OY.Yyeseqid); } /* * Print the line in the character buffer which has * line number line. The buffer may be terminated by a new * line character or a null character. We process * form feed directives, lines with only a form feed character, and * suppress numbering lines which are empty here. */ yyprline(buf, line, file, id) register char *buf; int line; char *file; int id; { lastid = id; if (buf[0] == '\f' && buf[1] == '\n') { printf("\f\n"); hadsome = 0; holdbl = 0; return; } if (holdbl) { pchr('\n'); holdbl = 0; } if (buf[0] == '\n') holdbl = 1; else { yysetfile(file); yyprintf(buf, line); } hadsome = 1; } yyprintf(cp, line) register char *cp; int line; { printf("%6d ", line); while (*cp != 0 && *cp != '\n') pchr(graphic(*cp++)); pchr('\n'); } graphic(ch) register CHAR ch; { switch (ch) { default: if (ch >= ' ') return (ch); case 0177: return ('?'); case '\n': case '\t': return (ch); } } extern int nopflg; char printed = 1; /* * Set the current file name to be file, * printing the name, or a header on a new * page if required. * there is another yysetfile in error.c * this one is for PI and PXP that one is for PI1 */ yysetfile(file) register char *file; { #ifdef PXP if (nopflg == 1) return; #endif if (lastname == file) return; if (file == filename && opt('n') && (printed & 02) == 0) { printed |= 02; header(); } else yyputfn(file); lastname = file; } /* * Put out an include file name * if an error occurs but the name has * not been printed (or if another name * has been printed since it has). */ yyputfn(cp) register char *cp; { extern int outcol; if (cp == lastname && printed) return; lastname = cp; printed = 1; #ifdef PXP if (outcol) pchr('\n'); #endif gettime( cp ); printf("%s %s:\n" , myctime( &tvec ) , cp ); hadsome = 1; } t('n') && (printed & 02) == 0) { printed |= 02; header(); } else yyputfn(file); lastname = file; } /* * Put out an include file name * if an error occurs but the name has * not been printed (or if another name * has been printed since it has). */ yyputfn(cp) register char *cp; { extern int outcol; if (cp == lastname && printed) return; lastname = cp; printed = 1; #ifdef PXP if (outcol) pchr('\n'); #endif gettime( cp ); printf("%s %s:\cmd/pc0/yyrecover.c 644 0 33 46725 2552606616 7521 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)yyrecover.c 1.2 3/8/81"; #include "whoami.h" #include "0.h" #include "yy.h" /* * Very simplified version of Graham-Rhodes error recovery * method for LALR parsers. Backward move is embodied in * default reductions of the yacc parser until an error condition * is reached. Forward move is over a small number of input tokens * and cannot "condense". The basic corrections are: * * 1) Delete the input token. * * 2) Replace the current input with a legal input. * * 3) Insert a legal token. * * All corrections are weighted, considered only if they allow * at least two shifts, and the cost of a correction increases if * it allows shifting over only a part of the lookahead. * * Another error situation is that which occurs when an identifier "fails" * a reduction because it is not the required "class". * In this case, we also consider replacing this identifier, which has * already been shifted over, wi((th an identifier of the correct class. * * Another correction performed here is unique symbol insertion. * If the current state admits only one input, and no other alternative * correction presents itself, then that symbol will be inserted. * There is a danger in this of looping, and it is handled * by counting true shifts over input (see below). * * * A final class of corrections, considered only when the error * occurred immediately after a shift over a terminal, involves * the three basic corrections above, but with the point of error * considered to be before this terminal was shifted over, effectively * "unreading" this terminal. This is a feeble attempt at elimination * of the left-right bias and because "if" has a low weight and some * statements are quite simple i.e. * * cse ch of ... * * we can get a small number of errors. The major deficiency of * this is that we back up only one token, and that the forward * move is over a small number of tokens, often not enough to really * tell what the input should be, e.g. in * * a[i] > a[i - 1] ... * * In such cases a bad identifier (misspelled keyword) or omitted * keyword will be change or inserted as "if" as it has the lowest cost. * This is not terribly bad, as "if"s are most common. * This also allows the correction of other errors. * * This recovery depends on the default reductions which delay * noticing the error until the parse reaches a state where the * relevant "alternatives" are visible. Note that it does not * consider tokens which will cause reductions before being * shifted over. This requires the grammar to be written in a * certain way for the recovery to work correctly. * In some sense, also, the recovery suffers because we have * LALR(1) tables rather than LR(1) tables, e.g. in * * if rec.field < rec2,field2 then */ /* * Definitions of possible corrective actions */ #define CPANIC 0 #define CDELETE 1 #define CREPLACE 2 #define CINSERT 3 #define CUNIQUE 4 #define CCHIDENT 5 /* * Multiplicative cost factors for corrective actions. * * When an error occurs we take YCSIZ - 1 look-ahead tokens. * If a correction being considered will shift over only part of * that look-ahead, it is not completely discarded, but rather * "weighted", its cost being multiplied by a weighting factor. * For a correction to be considered its weighted cost must be less * than CLIMIT. * * Non-weighted costs are considered: * * LOW <= 3 * MEDIUM 4,5 * HIGH >= 6 * * CURRENT WEIGHTING STRATEGY: Aug 20, 1977 * * For all kinds of corrections we demand shifts over two symbols. * Corrections have high weight even after two symbol * shifts because the costs for deleting and inserting symbols are actually * quite low; we do not want to change weighty symbols * on inconclusive evidence. * * The weights are the same after the third look ahead. * This prevents later, unrelated errors from causing "funny" * biases of the weights toward one type of correction. * * Current look ahead is 5 symbols. */ /*** CLIMIT is defined in yy.h for yycosts ***/ #define CPRLIMIT 50 #define CCHIDCOST 3 char insmult[8] = {INFINITY, INFINITY, INFINITY, 15, 8, 6, 3, 1}; char repmult[7] = {INFINITY, INFINITY, INFINITY, 8, 6, 3, 1}; char delmult[6] = {INFINITY, INFINITY, INFINITY, 6, 3, 1}; #define NOCHAR -1 #define Eprintf if (errtrace) printf #define Tprintf if (testtrace) printf /* * Action arrays of the parser needed here */ int yyact[], yypact[], *yypv; /* * Yytips is the tip of the stack when using * the function loccor to check for local * syntactic correctness. As we don't want * to copy the whole parser stack, but want * to simulate parser moves, we "split" * the parser stack and keep the tip here. */ #define YYTIPSIZ 16 int yytips[YYTIPSIZ], yytipct; int yytipv[YYTIPSIZ]; /* * The array YC saves the lookahead tokens for the * forward moves. * Yccnt is the number of tokens in the YC array. */ #define YCSIZ 6 int yCcnt; struct yytok YC0[YCSIZ + 1]; struct yytok *YC; /* * YCps gives the top of stack at * the point of error. */ bool yyunique = 1; STATIC unsigned yyTshifts; /* * Cact is the corrective action we have decided on * so far, ccost its cost, and cchar the associated token. * Cflag tells if the correction is over the previous input token. */ int cact, ccost, cchar, cflag; /* * ACtok holds the token under * consideration when examining * the lookaheads in a state. */ struct yytok ACtok; #define acchar ACtok.Yychar #define aclval ACtok.Yylval /* * Make a correction to the current stack which has * top of stack pointer Ps. */ yyrecover(Ps0, idfail) int *Ps0, idfail; { register int c, i; int yyrwant, yyrhave; #ifdef PI Recovery = 1; #endif YC = &YC0[1]; #ifdef DEBUG if (errtrace) { setpfx('p'); yerror("Point of error"); printf("States %d %d ...", Ps0[0], Ps0[-1]); if (idfail) printf(" [Idfail]"); pchr('\n'); printf("Input %s%s", tokname(&Y , 0) , tokname(&Y , 1)); } #endif /* * We first save the current input token * and its associated semantic information. */ if (yychar < 0) yychar = yylex(); copy(&YC[0], &Y, sizeof Y); /* * Set the default action and cost */ cact = CPANIC, ccost = CLIMIT, cflag = 0; /* * Peek ahead */ for (yCcnt = 1; yCcnt < YCSIZ; yCcnt++) { yychar = yylex(); copy(&YC[yCcnt], &Y, sizeof YC[0]); #ifdef DEBUG Eprintf(" | %s%s", tokname(&YC[yCcnt] , 0 ) , tokname(&YC[yCcnt] , 1 )); #endif } #ifdef DEBUG Eprintf("\n"); #endif /* * If we are here because a reduction failed, try * correcting that. */ if (idfail) { /* * Save the particulars about * the kind of identifier we want/have. */ yyrwant = yyidwant; yyrhave = yyidhave; #ifdef DEBUG Tprintf(" Try Replace %s identifier with %s identifier cost=%d\n", classes[yyidhave], classes[yyidwant], CCHIDCOST); #endif /* * Save the semantics of the ID on the * stack, and null them out to free * up the reduction in question. */ i = yypv[0]; yypv[0] = nullsem(YID); c = correct(NOCHAR, 0, CCHIDCOST, &repmult[2], Ps0, yypv); yypv[0] = i; #ifdef DEBUG if (c < CPRLIMIT || fulltrace) Eprintf("Cost %2d Replace %s identifier with %s identifier\n", c, classes[yyrhave], classes[yyrwant]); #endif if (c < ccost) cact = CCHIDENT, ccost = c, cchar = YID; } /* * First try correcting the state we are in */ trystate(Ps0, yypv, 0, &insmult[1], &delmult[1], &repmult[1]); /* * Now, if we just shifted over a terminal, try * correcting it. */ if (OY.Yychar != -1 && OY.Yylval != nullsem(OY.Yychar)) { YC--; copy(&YC[0], &OY, sizeof YC[0]); trystate(Ps0 - 1, yypv - 1, 1, insmult, delmult, repmult); if (cflag == 0) YC++; else { yypv--; #ifdef PXP yypw--; #endif Ps0--; yCcnt++; } } /* * Restoring the first look ahead into * the scanner token allows the error message * routine to print the error message with the text * of the correct line. */ copy(&Y, &YC[0], sizeof Y); /* * Unique symbol insertion. * * If there was no reasonable correction found, * but only one input to the parser is acceptable * we report that, and try it. * * Special precautions here to prevent looping. * The number of true inputs shifted over at the point * of the last unique insertion is recorded in the * variable yyTshifts. If this is not less than * the current number in yytshifts, we do not insert. * Thus, after one unique insertion, no more unique * insertions will be made until an input is shifted * over. This guarantees termination. */ if (cact == CPANIC && !idfail) { register int *ap; ap = &yyact[yypact[*Ps0 + 1]]; if (*ap == -ERROR) ap += 2; if (ap[0] <= 0 && ap[2] > 0) { cchar = -ap[0]; if (cchar == YEOF) yyexeof(); if (cchar != ERROR && yyTshifts < yytshifts) { cact = CUNIQUE; #ifdef DEBUG Eprintf("Unique symbol %s%s\n" , charname(cchar , 0 ) , charname(cchar , 1 )); #endif /* * Note that the inserted symbol * will not be counted as a true input * (i.e. the "yytshifts--" below) * so that a true shift will be needed * to make yytshifts > yyTshifts. */ yyTshifts = yytshifts; } } } /* * Set up to perform the correction. * Build a token appropriate for replacement * or insertion in the yytok structure ACchar * having the attributes of the input at the * point of error. */ copy(&ACtok, &YC[0], sizeof ACtok); acchar = cchar; aclval = nullsem(acchar); if (aclval != NIL) recovered(); switch (cact) { /* * Panic, just restore the * lookahead and return. */ case CPANIC: setpfx('E'); if (idfail) { copy(&Y, &OY, sizeof Y); if (yyrhave == NIL) { #ifdef PI if (yybaduse(yypv[0], yyeline, ISUNDEF) == NIL) #endif yerror("Undefined identifier"); } else { yerror("Improper %s identifier", classes[yyrhave]); #ifdef PI yybaduse(yypv[0], yyeline, NIL); #endif } /* * Suppress message from panic routine */ yyshifts = 1; } i = 0; /* Note that on one path we dont touch yyshifts ! */ break; /* * Delete the input. * Mark this as a shift over true input. * Restore the lookahead starting at * the second token. */ case CDELETE: if (ccost != 0) yerror("Deleted %s%s", tokname(&YC[0] , 0 ) , tokname(&YC[0] , 1 )); yytshifts++; i = 1; yyshifts = 0; break; /* * Replace the input with a new token. */ case CREPLACE: if (acchar == YEOF) yyexeof(); if (acchar == YEND) aclval = NIL; yerror("Replaced %s%s with a %s%s", tokname(&YC[0] , 0 ), tokname(&YC[0] , 1 ), tokname(&ACtok , 0 ), tokname(&ACtok , 1 )); copy(&YC[0], &ACtok, sizeof YC[0]); i = 0; yyshifts = 0; break; /* * Insert a token. * Don't count this token as a true input shift. * For inserted "end"s pas.y is responsible * for the error message later so suppress it. * Restore all the lookahead. */ case CINSERT: if (acchar == YEOF) yyexeof(); if (acchar != YEND) yerror("Inserted %s%s", tokname(&ACtok , 0 ), (( tokname(&ACtok , 1 )); yytshifts--; i = 0; yyshifts = 0; break; /* * Make a unique symbol correction. * Like an insertion but a different message. */ case CUNIQUE: setpfx('E'); yerror("Expected %s%s", tokname(&ACtok , 0 ), tokname(&ACtok , 1 )); yytshifts--; i = 0; if (ccost == 0 || yyunique) yyshifts = 0; else yyshifts = -1; break; /* * Change an identifier's type * to make it work. */ case CCHIDENT: copy(&Y, &OY, sizeof Y); #ifdef PI i = 1 << yyrwant; #endif if (yyrhave == NIL) { yerror("Undefined %s", classes[yyrwant]); #ifdef PI i |= ISUNDEF; #endif } else yerror("Replaced %s id with a %s id", classes[yyrhave], classes[yyrwant]); #ifdef PI yybaduse(yypv[0], yyeline, i); #endif yypv[0] = nullsem(YID); i = 0; yyshifts = 0; break; } /* * Restore the desired portion of the lookahead, * and possibly the inserted or unique inserted token. */ for (yCcnt--; yCcnt >= i; yCcnt--) unyylex(&YC[yCcnt]); if (cact == CINSERT || cact == CUNIQUE) unyylex(&ACtok); /* * Put the scanner back in sync. */ yychar = yylex(); /* * We succeeded if we didn't "panic". */ Recovery = 0; Ps = Ps0; return (cact != CPANIC); } yyexeof() { yerror("End-of-file expected - QUIT"); pexit(ERRS); } yyunexeof() { yerror("Unexpected end-of-file - QUIT"); pexit(ERRS); } /* * Try corrections with the state at Ps0. * Flag is 0 if this is the top of stack state, * 1 if it is the state below. */ trystate(Ps0, Pv0, flag, insmult, delmult, repmult) int *Ps0, *Pv0, flag; char *insmult, *delmult, *repmult; { /* * C is a working cost, ap a pointer into the action * table for looking at feasible alternatives. */ register int c, *ap; int i, *actions; #ifdef DEBUG Eprintf("Trying state %d\n", *Ps0); #endif /* * Try deletion. * Correct returns a cost. */ #ifdef DEBUG Tprintf(" Try Delete %s%s cost=%d\n", tokname(&YC[0] , 0 ), tokname(&YC[0] , 1 ), delcost(YC[0].Yychar)); #endif c = delcost(YC[0].Yychar); #ifndef DEBUG if (c < ccost) { #endif c = correct(NOCHAR, 1, c, delmult, Ps0, Pv0); #ifdef DEBUG if (c < CPRLIMIT || fulltrace) Eprintf("Cost %2d Delete %s%s\n", c, tokname(&YC[0] , 0 ), tokname(&YC[0] , 1 )); #endif if (c < ccost) cact = CDELETE, ccost = c, cflag = flag; #ifndef DEBUG } #endif /* * Look at the inputs to this state * which will cause parse action shift. */ aclval = NIL; ap = &yyact[yypact[*Ps0 + 1]]; /* * Skip action on error to * detect true unique inputs. * Error action is always first. */ if (*ap == -ERROR) ap += 2; /* * Loop through the test actions * for this state. */ for (actions = ap; *ap <= 0; ap += 2) { /* * Extract the token of this action */ acchar = -*ap; /* * Try insertion */ #ifdef DEBUG Tprintf(" Try Insert %s%s cost=%d\n" , charname(acchar , 0 ) , charname(acchar , 1 ) , inscost(acchar)); #endif c = inscost(acchar, YC[0].Yychar); #ifndef DEBUG if (c < ccost) { #endif if (c == 0) { c = correct(acchar, 0, 1, insmult + 1, Ps0, Pv0); #ifdef DEBUG Eprintf("Cost %2d Freebie %s%s\n", c , charname(acchar , 0 ) , charname(acchar , 1 )); #endif if (c < ccost) cact = CUNIQUE, ccost = 0, cchar = acchar, cflag = flag; } else { c = correct(acchar, 0, c, insmult, Ps0, Pv0); #ifdef DEBUG if (c < CPRLIMIT || fulltrace) Eprintf("Cost %2d Insert %s%s\n", c , charname(acchar , 0 ) , charname(acchar , 1 )); #endif if (c < ccost) cact = CINSERT, ccost = c, cchar = acchar, cflag = flag; } #ifndef DEBUG } #endif /* * Try replacement */ #ifdef DEBUG Tprintf(" Try Replace %s%s with %s%s cost=%d\n", tokname(&YC[0] , 0 ), tokname(&YC[0] , 1 ), charname(acchar , 0 ), charname(acchar , 1 ), repcost(YC[0].Yychar, acchar)); #endif c = repcost(YC[0].Yychar, acchar); #ifndef DEBUG if (c < ccost) { #endif c = correct(acchar, 1, repcost(YC[0].Yychar, acchar), repmult, Ps0, Pv0); #ifdef DEBUG if (c < CPRLIMIT || fulltrace) Eprintf("Cost %2d Replace %s%s with %s%s\n", c, tokname(&YC[0] , 0 ), tokname(&YC[0] , 1 ), tokname(&ACtok , 0 ), tokname(&ACtok , 1 )); #endif if (c < ccost) cact = CREPLACE, ccost = c, cchar = acchar, cflag = flag; #ifndef DEBUG } #endif } } int *yCpv; char yyredfail; /* * The ntok structure is used to build a * scanner structure for tokens inserted * from the argument "fchar" to "correct" below. */ static struct yytok ntok; /* * Compute the cost of a correction * C is the base cost for it. * Fchar is the first input character from * the current state, NOCHAR if none. * The rest of the inputs come from the array * YC, starting at origin and continuing to the * last character there, YC[yCcnt - 1].Yychar. * * The cost returned is INFINITE if this correction * allows no shifts, otherwise is weighted based * on the number of shifts this allows against the * maximum number possible with the available lookahead. */ correct(fchar, origin, c, multvec, Ps0, Pv0) register int fchar, c; int origin; char *multvec; int *Ps0, *Pv0; { register char *mv; /* * Ps is the top of the parse stack after the most * recent local correctness check. Loccor returns * NIL when we cannot shift. */ register int *ps; yyredfail = 0; /* * Initialize the tip parse and semantic stacks. */ ps = Ps0; yytips[0] = *ps; ps--; yytipv[0] = Pv0[0]; yCpv = Pv0 - 1; yytipct = 1; /* * Shift while possible. * Adjust cost as necessary. */ mv = multvec; do { if (fchar != NOCHAR) { copy(&ntok, &YC[0], sizeof ntok); ntok.Yychar = fchar, ntok.Yylval = nullsem(fchar); fchar = NOCHAR; ps = loccor(ps, &ntok); } else ps = loccor(ps, &YC[origin++]); if (ps == NIL) { if (yyredfail && mv > multvec) mv--; c *= *mv; break; } mv++; } while (*mv != 1); return (c); } extern int yygo[], yypgo[], yyr1[], yyr2[]; /* * Local syntactic correctness check. * The arguments to this routine are a * top of stack pointer, ps, and an input * token tok. Also, implicitly, the contents * of the yytips array which contains the tip * of the stack, and into which the new top * state on the stack will be placed if we shift. * * If we succeed, we return a new top of stack * pointer, else we return NIL. */ loccor(ps, ntok) int *ps; struct yytok *ntok; { register int *p, n; register int nchar; int i; if (ps == NIL) return (NIL); nchar = ntok->Yychar; yyeline = ntok->Yyeline; #ifdef DEBUG Tprintf(" Stack "); for (i = yytipct - 1; i >= 0; i--) Tprintf("%d ", yytips[i]); Tprintf("| %d, Input %s%s\n", *ps , charname(nchar , 0 ) , charname(nchar , 1 )); #endif /* * As in the yacc parser yyparse, * p traces through the action list * and "n" is the information associated * with the action. */ newstate: p = &yyact[ yypact[yytips[yytipct - 1]+1] ]; actn: /* * Search the parse actions table * for something useful to do. * While n is non-positive, it is the * arithmetic inverse of the token to be tested. * This allows a fast check. */ while ((n = *p++) <= 0) if ((n += nchar) != 0) p++; switch (n >> 12) { /* * SHIFT */ case 2: n &= 07777; yyredfail = 0; if (nchar == YID) yyredfail++; if (yytipct == YYTIPSIZ) { tipover: #ifdef DEBUG Tprintf("\tTIP OVFLO\n"); #endif return (NIL); } yytips[yytipct] = n; yytipv[yytipct] = ntok->Yylval; yytipct++; #ifdef DEBUG Tprintf("\tShift to state %d\n", n); #endif return (ps); /* * REDUCE */ case 3: n &= 07777; if (yyEactr(n, yytipv[yytipct - 1]) == 0) { #ifdef DEBUG Tprintf("\tYyEactr objects: have %s id, want %s id\n", classes[yyidhave], classes[yyidwant]); #endif return (NIL); } yyredfail = 0; i = yyr2[n]; #ifdef DEBUG Tprintf("\tReduce, length %d,", i); #endif if (i > yytipct) { i -= yytipct; yytipct = 0; ps -= i; yCpv -= i; } else yytipct -= i; if (yytipct >= YYTIPSIZ) goto tipover; /* * Use goto table to find next state */ p = &yygo[yypgo[yyr1[n]]]; i = yytipct ? yytips[yytipct - 1] : *ps; while (*p != i && *p >= 0) p += 2; #ifdef DEBUG Tprintf(" new state %d\n", p[1]); #endif yytips[yytipct] = p[1]; yytipct++; goto newstate; /* * ACCEPT */ case 4: #ifdef DEBUG Tprintf("\tAccept\n"); #endif return (ps); /* * ERROR */ case 1: #ifdef DEBUG Tprintf("\tError\n"); #endif return (0); } panic("loccor"); } goto tipover; /* * Use goto tablecmd/pc0/yyseman.c 644 0 33 1350 2552606617 7121 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)yyseman.c 1.1 8/27/80"; #include "whoami.h" #include "0.h" #include "yy.h" /* * Assign semantics to a generated token * * Most terminals have a semantic value the current * input line. If they are generated they are flagged * by having this number negated. * * The terminals which have true semantics such * as identifiers and strings are instead given * semantic value NIL here - we do not attempt * to do repair, e.g. by giving generated integers * the value 1, etc. */ nullsem(ch) int ch; { switch (ch) { case YID: case YINT: case YNUMB: case YBINT: case YSTRING: return (NIL); default: return (-yyeline); } } als have a semantic value the current * input line. If they are generated they are flagged * by having this number negated. * * The terminals which have true semantics such * as identifiers and strings are instead given * semantic value NIL here - we do not attempt * to d((cmd/pc0/yytree.c 644 0 33 7740 2552606617 6766 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)yytree.c 1.1 8/27/80"; #include "whoami.h" #include "0.h" #include "tree.h" extern int *spacep; /* * LIST MANIPULATION ROUTINES * * The grammar for Pascal is written left recursively. * Because of this, the portions of parse trees which are to resemble * lists are in the somewhat inconvenient position of having * the nodes built from left to right, while we want to eventually * have as semantic value the leftmost node. * We could carry the leftmost node as semantic value, but this * would be inefficient as to add a new node to the list we would * have to chase down to the end. Other solutions involving a head * and tail pointer waste space. * * The simple solution to this apparent dilemma is to carry along * a pointer to the leftmost node in a list in the rightmost node * which is the current semantic value of the list. * When we have completed building the list, we can retrieve this * left end pointer very easily; neither adding new elements to the list * nor finding the left end is thus expensive. As the bottommost node * has an unused next pointer in it, no space is wasted either. * * The nodes referred to here are of the T_LISTPP type and have * the form: * * T_LISTPP some_pointer next_element * * Here some_pointer points to the things of interest in the list, * and next_element to the next thing in the list except for the * rightmost node, in which case it points to the leftmost node. * The next_element of the rightmost node is of course zapped to the * NIL pointer when the list is completed. * * Thinking of the lists as tree we heceforth refer to the leftmost * node as the "top", and the rightmost node as the "bottom" or as * the "virtual root". */ /* * Make a new list */ newlist(new) register int *new; { if (new == NIL) return (NIL); return (tree3(T_LISTPP, new, spacep)); } /* * Add a new element to an existing list */ addlist(vroot, new) register int *vroot; int *new; { register int *top; if (new == NIL) return (vroot); if (vroot == NIL) return (newlist(new)); top = vroot[2]; vroot[2] = spacep; return (tree3(T_LISTPP, new, top)); } /* * Fix up the list which has virtual root vroot. * We grab the top pointer and return it, zapping the spot * where it was so that the tree is not circular. */ fixlist(vroot) register int *vroot; { register int *top; if (vroot == NIL) return (NIL); top = vroot[2]; vroot[2] = NIL; return (top); } /* * Set up a T_VAR node for a qualified variable. * Init is the initial entry in the qualification, * or NIL if there is none. * * if we are building pTrees, there has to be an extra slot for * a pointer to the namelist entry of a field, if this T_VAR refers * to a field name within a WITH statement. * this extra field is set in lvalue, and used in VarCopy. */ setupvar(var, init) char *var; register int *init; { if (init != NIL) init = newlist(init); # ifndef PTREE return (tree4(T_VAR, NOCON, var, init)); # else return tree5( T_VAR , NOCON , var , init , NIL ); # endif } /* * set up a T_TYREC node for a record * * if we are building pTrees, there has to be an extra slot for * a pointer to the namelist entry of the record. * this extra field is filled in in gtype, and used in RecTCopy. */ setuptyrec( line , fldlst ) int line; int *fldlst; { # ifndef PTREE return tree3( T_TYREC , line , fldlst ); # else return tree4( T_TYREC , line , fldlst , NIL ); # endif } /* * set up a T_FIELD node for a field. * * if we are building pTrees, there has to be an extra slot for * a pointer to the namelist entry of the field. * this extra field is set in lvalue, and used in SelCopy. */ setupfield( field , other ) int *field; int *other; { # ifndef PTREE return tree3( T_FIELD , field , other ); # else return tree4( T_FIELD , field , other , NIL ); # endif } return tree4( T_TYREC , line , cmd/config/ 775 0 33 0 2552543203 5760 cmd/config/config.y 444 0 33 16313 2552442323 7525 %token CPU IDENT CONFIG ANY DEVICE UBA MBA NEXUS CSR DRIVE VECTOR OPTIONS %token CONTROLLER PSEUDO_DEVICE FLAGS ID SEMICOLON NUMBER FPNUMBER TRACE %token DISK SLAVE AT HZ TIMEZONE DST MAXUSERS MASTER COMMA MINUS %{ /* config.y 1.11 81/05/22 */ #include "config.h" #include struct device cur; struct device *curp = NULL; char *temp_id; %} %% Configuration: Many_specs ; Many_specs: Many_specs Spec | ; Spec: Device_spec SEMICOLON = { newdev(&cur); } | Config_spec SEMICOLON | TRACE SEMICOLON = { do_trace = ! do_trace; } | SEMICOLON | error SEMICOLON ; Config_spec: CPU Save_id = { struct cputype *cp = malloc(sizeof (struct cputype)); cp->cpu_name = ns($2); cp->cpu_next = cputype; cputype = cp; free(temp_id); } | OPTIONS Opt_list | IDENT ID { ident = ns($2); } | CONFIG Save_id ID = { mkconf(temp_id, $3); free(temp_id); } | HZ NUMBER = { yyerror("HZ specification obsolete; delete"); hz = 60; } | TIMEZONE NUMBER = { timezone = 60 * $2; check_tz(); } | TIMEZONE NUMBER DST = { timezone = 60 * $2; dst = 1; check_tz(); } | TIMEZONE FPNUMBER = { timezone = $2; check_tz(); } | TIMEZONE FPNUMBER DST = { timezone = $2; dst = 1; check_tz(); } | MINUS TIMEZONE NUMBER = { timezone = -60 * $3; check_tz(); } | MINUS TIMEZONE NUMBER DST = { timezone = -60 * $3; dst = 1; check_tz(); } | MINUS TIMEZONE FPNUMBER = { timezone = -$3; check_tz(); } | MINUS TIMEZONE FPNUMBER DST = { timezone = -$3; dst = 1; check_tz(); } | MAXUSERS NUMBER = { maxusers = $2; } ; Opt_list: Opt_list COMMA Option | Option ; Option: Save_id = { struct opt *op = malloc(sizeof (struct opt)); op->op_name = ns($1); op->op_next = opt; opt = op; free(temp_id); } ; Save_id: ID = { $$ = temp_id = ns($1); } ; Dev: UBA = { $$ = ns("uba"); } | MBA = { $$ = ns("mba"); } | ID = { $$ = ns($1); } ; Device_spec: DEVICE Dev_name Dev_info Int_spec = { cur.d_type = DEVICE; } | MASTER Dev_name Dev_info Int_spec = { cur.d_type = MASTER; } | DISK Dev_name Dev_info Int_spec = { cur.d_dk = 1; cur.d_type = DEVICE; } | CONTROLLER Dev_name Dev_info Int_spec = { cur.d_type = CONTROLLER; } | PSEUDO_DEVICE Init_dev Dev = { cur.d_name = $3; cur.d_type = PSEUDO_DEVICE; } ; Dev_name: Init_dev Dev NUMBER = { cur.d_name = $2; if (eq($2, "mba")) seen_mba = TRUE; else if (eq($2, "uba")) seen_uba = TRUE; cur.d_unit = $3; } ; Init_dev: = { init_dev(&cur); } ; Dev_info: Con_info Info_list | ; Con_info: AT Dev NUMBER = { if (eq(cur.d_name, "mba") || eq(cur.d_name, "uba")) yyerror(sprintf(errbuf, "%s must be connected to a nexus", cur.d_name)); cur.d_conn = connect($2, $3); } | AT NEXUS NUMBER = { check_nexus(&cur, $3); cur.d_conn = TO_NEXUS; } ; Info_list: Info_list Info | ; Info: CSR NUMBER = { cur.d_addr = $2; } | DRIVE NUMBER = { cur.d_drive = $2; } | SLAVE NUMBER = { if (cur.d_conn != NULL && cur.d_conn != TO_NEXUS && cur.d_conn->d_type == MASTER) cur.d_slave = $2; else yyerror("can't specify slave--not to master"); } | FLAGS NUMBER = { cur.d_flags = $2; } ; Int_spec: VECTOR Id_list = { cur.d_vec = $2; } | ; Id_list: Save_id = { struct idlst *a = (struct idlst *)malloc(sizeof(struct idlst)); a->id = $1; a->id_next = 0; $$ = a; } | Save_id Id_list = { struct idlst *a = (struct idlst *)malloc(sizeof(struct idlst)); a->id = $1; a->id_next = $2; $$ = a; } ; %% yyerror(s) char *s; { fprintf(stderr, "config: %s at line %d\n", s, yyline); } /* * ns: * Return the passed string in a new space */ char * ns(str) register char *str; { register char *cp; cp = malloc(strlen(str)+1); strcpy(cp, str); return cp; } /* * newdev * Add a device to the list */ newdev(dp) register struct device *dp; { register struct device *np; np = (struct device *) malloc(sizeof *np); *np = *dp; if (curp == NULL) dtab = np; else curp->d_next = np; curp = np; } /* * mkconf * Note that a configuration should be made */ mkconf(dev, sysname) char *dev, *sysname; { register struct file_list *fl; fl = (struct file_list *) malloc(sizeof *fl); fl->f_fn = ns(dev); fl->f_needs = ns(sysname); if (confp == NULL) conf_list = fl; else confp->f_next = fl; confp = fl; } /* * Connect: * Find the pointer to connect to the given device and number. * returns NULL if no such device and prints an error message */ struct device *connect(dev, num) register char *dev; register int num; { register struct device *dp; struct device *hu((hcon(); if (num == QUES) return huhcon(dev); for (dp = dtab; dp != NULL; dp = dp->d_next) if ((num == dp->d_unit) && eq(dev, dp->d_name)) if (dp->d_type != CONTROLLER && dp->d_type != MASTER) { yyerror(sprintf(errbuf, "%s connected to non-controller", dev)); return NULL; } else return dp; yyerror(sprintf(errbuf, "%s %d not defined", dev, num)); return NULL; } /* * huhcon * Connect to an unspecific thing */ struct device *huhcon(dev) register char *dev; { register struct device *dp, *dcp; struct device rdev; int oldtype; /* * First make certain that there are some of these to wildcard on */ for (dp = dtab; dp != NULL; dp = dp->d_next) if (eq(dp->d_name, dev)) break; if (dp == NULL) { yyerror(sprintf(errbuf, "no %s's to wildcard", dev)); return NULL; } oldtype = dp->d_type; dcp = dp->d_conn; /* * Now see if there is already a wildcard entry for this device * (e.g. Search for a "uba ?") */ for (; dp != NULL; dp = dp->d_next) if (eq(dev, dp->d_name) && dp->d_unit == -1) break; /* * If there isn't, make one becuase everything needs to be connected * to something. */ if (dp == NULL) { dp = &rdev; init_dev(dp); dp->d_unit = QUES; dp->d_name = ns(dev); dp->d_type = oldtype; newdev(dp); dp = curp; /* * Connect it to the same thing that other similar things are * connected to, but make sure it is a wildcard unit * (e.g. up connected to sc ?, here we make connect sc? to a uba?) * If other things like this are on the NEXUS or if the aren't * connected to anything, then make the same connection, else * call ourself to connect to another unspecific device. */ if (dcp == TO_NEXUS || dcp == NULL) dp->d_conn = dcp; else dp->d_conn = connect(dcp->d_name, QUES); } return dp; } /* * init_dev: * Set up the fields in the current device to their * default values. */ init_dev(dp) register struct device *dp; { dp->d_name = "OHNO!!!"; dp->d_type = DEVICE; dp->d_conn = NULL; dp->d_vec = NULL; dp->d_addr = dp->d_flags = dp->d_dk = 0; dp->d_slave = dp->d_drive = dp->d_unit = UNKNOWN; } /* * Check_nexus: * Make certain that this is a reasonable type of thing to put * on the nexus. */ check_nexus(dev, num) register struct device *dev; int num; { if (!eq(dev->d_name, "uba") && !eq(dev->d_name, "mba")) yyerror("only uba's and mba's should be connected to the nexus"); if (num != QUES) yyerror("can't give specific nexus numbers"); } /* * Check the timezone to make certain it is sensible */ check_tz() { if (timezone > 24 * 60) yyerror("timezone is unreasonable"); else hadtz = TRUE; } xus: * Make certain that this is a reasonable type of thing to put * on the nexus. */ check_nexus(dev, num) register struct device *dev; int num; { if (!eq(dev->d_name, "uba") && !eq(dev->d_name, "mba")) yyerror("only uba's and mba's should be connected to the nexus"); if (num != QUES) yyerror(cmd/config/mkmakefile.c 444 0 33 16770 2552442324 10347 /* * mkmakefile.c 1.10 81/05/18 * Functions in this file build the makefile from the files list * and the information in the config table */ #include #include #include "y.tab.h" #include "config.h" #define next_word(fp, wd)\ { register char *word = get_word(fp);\ if (word == EOF) return EOF; \ else wd = word; } static struct file_list *fcur; /* * fl_lookup * look up a file name */ struct file_list *fl_lookup(file) register char *file; { register struct file_list *fp; for (fp = ftab ; fp != NULL; fp = fp->f_next) { if (eq(fp->f_fn, file)) return fp; } return NULL; } /* * new_fent * Make a new file list entry */ struct file_list *new_fent() { register struct file_list *fp; fp = (struct file_list *) malloc(sizeof *fp); fp->f_needs = fp->f_next = NULL; if (fcur == NULL) fcur = ftab = fp; else fcur->f_next = fp; fcur = fp; return fp; } /* * makefile: * Build the makefile from the skeleton */ makefile() { FILE *ifp, *ofp; char line[BUFSIZ]; struct cputype *cp; struct opt *op; read_files(); /* Read in the "files" file */ ifp = fopen("../conf/makefile", "r"); if (ifp == NULL) { perror("../conf/makefile"); exit(1); } ofp = fopen(path("makefile"), "w"); if (ofp == NULL) { perror(path("makefile")); exit(1); } fprintf(ofp, "IDENT=-D%s", raise(ident)); if (cputype == NULL) { printf("cpu type must be specified\n"); exit(1); } for (cp = cputype; cp; cp = cp->cpu_next) fprintf(ofp, " -D%s", cp->cpu_name); for (op = opt; op; op = op->op_next) fprintf(ofp, " -D%s", op->op_name); fprintf(ofp, "\n"); if (hz == 0) { #ifdef notdef printf("hz not specified; 50hz assumed\n"); #endif hz = 60; } if (hadtz == 0) printf("timezone not specified; gmt assumed\n"); if (maxusers == 0) { printf("maxusers not specified; 24 assumed\n"); maxusers = 24; } else if (maxusers < 8) { printf("minimum of 8 maxusers assumed\n"); maxusers = 8; } else if (maxusers > 128) { printf("maxusers truncated to 128\n"); maxusers = 128; } fprintf(ofp, "PARAM=-DHZ=%d -DTIMEZONE=%d -DDST=%d -DMAXUSERS=%d\n", hz, timezone, dst, maxusers); while(fgets(line, BUFSIZ, ifp) != NULL) { if (*line != '%') { fprintf(ofp, "%s", line); continue; } else if (eq(line, "%OBJS\n")) do_objs(ofp); else if (eq(line, "%CFILES\n")) do_cfiles(ofp); else if (eq(line, "%RULES\n")) do_rules(ofp); else if (eq(line, "%LOAD\n")) do_load(ofp); else fprintf(stderr, "Unknown %% construct in generic makefile: %s", line); } fclose(ifp); fclose(ofp); } /* * files: * Read in the "files" file. * Store it in the ftab linked list */ read_files() { FILE *fp; register struct file_list *tp; register struct device *dp; register char *wd, *this; int type; fp = fopen("../conf/files", "r"); if (fp == NULL) { perror("../conf/files"); exit(1); } ftab = NULL; while((wd = get_word(fp)) != EOF) { if (wd == NULL) continue; this = ns(wd); /* * Readad standard/optional */ next_word(fp, wd); if (wd == NULL) { fprintf(stderr, "Huh, no type for %s in files.\n", this); exit(10); } if ((tp = fl_lookup(wd)) == NULL) tp = new_fent(); else free(tp->f_fn); tp->f_fn = this; type = 0; if (eq(wd, "optional")) { next_word(fp, wd); if (wd == NULL) { fprintf(stderr, "Needed a dev for optional(%s)\n", this); exit(11); } tp->f_needs = ns(wd); for (dp = dtab ; dp != NULL; dp = dp->d_next) { if (eq(dp->d_name, wd)) break; } if (dp == NULL) type = INVISIBLE; } next_word(fp, wd); if (type == 0 && wd != NULL) type = DEVICE; else if (type == 0) type = NORMAL; tp->f_type = type; } fclose(fp); } /* * do_objs * Spew forth the OBJS definition */ do_objs(fp) FILE *fp; { register struct file_list *tp; register int lpos, len; register char *cp, och, *sp; char *tail(); fprintf(fp, "OBJS="); lpos = 6; for (tp = ftab; tp != NULL; tp = tp->f_next) { if (tp->f_type == INVISIBLE) continue; sp = tail(tp->f_fn); cp = sp + (len = strlen(sp)) - 1; och = *cp; *cp = 'o'; if (len + lpos > 72) { lpos = 8; fprintf(fp, "\\\n\t"); } fprintf(fp, "%s ", sp); lpos += len + 1; *cp = och; } if (lpos != 8) putc('\n', fp); } /* * do_cfiles * Spew forth the CFILES definition */ do_cfiles(fp) FILE *fp; { register struct file_list *tp; register int lpos, len; fprintf(fp, "CFILES="); lpos = 8; for (tp = ftab; tp != NULL; tp = tp->f_next) { if (tp->f_type == INVISIBLE) continue; if (tp->f_fn[strlen(tp->f_fn)-1] != 'c') continue; if ((len = 3 + strlen(tp->f_fn)) + lpos > 72) { lpos = 8; fprintf(fp, "\\\n\t"); } fprintf(fp, "../%s ", tp->f_fn); lpos += len + 1; } if (lpos != 8) putc('\n', fp); } /* * tail: * Return tail end of a filename */ char *tail(fn) char *fn; { register char *cp; cp = rindex(fn, '/'); return cp+1; } /* * do_rules: * Spit out the rules for making each file */ do_rules(f) FILE *f; { register char *cp, *np, och, *tp; register struct file_list *ftp; for (ftp = ftab; ftp != NULL; ftp = ftp->f_next) { if (ftp->f_type == INVISIBLE) continue; cp = (np = ftp->f_fn) + strlen(ftp->f_fn) - 1; och = *cp; *cp = '\0'; fprintf(f, "%so: ../%s%c\n", tail(np), np, och); tp = tail(np); if (och == 's') fprintf(f, "\t${AS} -o %so ../%ss\n\n", tp, np); else if (ftp->f_type == NORMAL) { fprintf(f, "\t${CC} -I. -c -S ${COPTS} ../%sc\n", np); fprintf(f, "\t${C2} %ss | sed -f ../sys/asm.sed | ${AS} -o %so\n", tp, tp); fprintf(f, "\trm -f %ss\n\n", tp); } else if (ftp->f_type == DEVICE) { fprintf(f, "\t${CC} -I. -c -S ${COPTS} ../%sc\n", np); fprintf(f,"\t${C2} -i %ss | sed -f ../sys/asm.sed | ${AS} -o %so\n", tp, tp); fprintf(f, "\trm -f %ss\n\n", tp); } else fprintf(stderr, "Don't know rules for %s", np); *cp = och; } } /* * Create the load strings */ do_load(f) register FILE *f; { register struct file_list *fl; register bool first = TRUE; for (fl = conf_list; fl != NULL; fl = fl->f_next) { fprintf(f, "%s: makefile locore.o ${OBJS} ioconf.o param.o swap%s.o\n", fl->f_needs, fl->f_fn); fprintf(f, "\t@echo loading %s\n\t@rm -f %s\n", fl->f_needs, fl->f_needs); if (first) { first = FALSE; fprintf(f, "\t@sh ../conf/newvers.sh\n"); fprintf(f, "\t@cc $(CFLAGS) -c ve((rs.c\n"); } fprintf(f, "\t@ld -n -o %s -e start -x -T 80000000 locore.o ${OBJS} vers.o ioconf.o param.o swap%s.o\n", fl->f_needs, fl->f_fn); fprintf(f, "\t@echo rearranging symbols\n"); fprintf(f, "\t@-symorder ../sys/symbols.sort %s\n", fl->f_needs); fprintf(f, "\t@size %s\n", fl->f_needs); fprintf(f, "\t@chmod 755 %s\n\n", fl->f_needs); } for (fl = conf_list; fl != NULL; fl = fl->f_next) { fprintf(f, "swap%s.o: ../dev/swap%s.c\n", fl->f_fn, fl->f_fn); fprintf(f, "\t${CC} -I. -c -S ${COPTS} ../dev/swap%s.c\n", fl->f_fn); fprintf(f, "\t${C2} swap%s.s | sed -f ../sys/asm.sed | ${AS} -o swap%s.o\n", fl->f_fn, fl->f_fn); fprintf(f, "\trm -f swap%s.s\n\n", fl->f_fn); } fprintf(f, "all:"); for (fl = conf_list; fl != NULL; fl = fl->f_next) fprintf(f, " %s", fl->f_needs); putc('\n', f); } raise(str) register char *str; { register char *cp = str; while(*str) { if (islower(*str)) *str = toupper(*str); str++; } return cp; } CC} -I. cmd/config/config.h 444 0 33 2577 2552442322 7472 /* * config.h 1.5 81/05/22 * Definitions that everybody needs to know */ #define eq(a,b) (strcmp(a,b) == 0) #define TRUE 1 #define FALSE 0 #define DRIVER 1 #define NORMAL 2 #define INVISIBLE 3 #define TO_NEXUS -1 struct file_list { char *f_fn; int f_type; char *f_next; char *f_needs; }; struct idlst { char *id; struct idlst *id_next; }; typedef char bool; struct device { int d_type; /* CONTROLLER, DEVICE, UBA or MBA */ struct device *d_conn; /* What it is connected to */ char *d_name; /* Name of device (e.g. rk11) */ struct idlist *d_vec; /* Interrupt vectors */ int d_addr; /* Address of csr */ int d_unit; /* Unit number */ int d_drive; /* Drive number */ int d_slave; /* Slave number */ #define QUES -1 /* -1 means '?' */ #define UNKNOWN -2 /* -2 means not set yet */ bool d_dk; /* if init 1 set to number for iostat */ int d_flags; /* Flags for device init */ struct device *d_next; /* Next one in list */ }; struct config { char *c_dev; char *s_sysname; }; struct cputype { char *cpu_name; struct cputype *cpu_next; } *cputype; struct opt { char *op_name; struct cputype *op_next; } *opt; char *ident, *ns(), *malloc(), *tc(), *qu(); bool do_trace, seen_mba, seen_uba; struct device *connect(); struct device *dtab; char errbuf[80]; int yyline; struct file_list *ftab, *conf_list, *confp; char *PREFIX; int hz, timezone, hadtz, maxusers, dst; or device init */ struct device *d_next; /* Next one in list */ }; struct config { char *c_dev; char *s_sysname; }; struct cmd/config/mkheaders.c 444 0 33 6026 2552442323 10155 /* * mkheaders.c 1.6 81/04/08 * Make all the .h files for the optional entries */ #include #include #include "config.h" /* * This macro reads a line of the form * #define STRING * and assigns STRING to wd and to count */ #define rdln(f, wd, count) {\ register char *iwd;\ if ((wd = get_word(f)) != NULL && wd != EOF)\ if ((wd = get_word(f)) != NULL && wd != EOF) {\ iwd = ns(wd);\ if ((wd = get_word(f)) != NULL && wd != EOF) {\ count = atoi(wd);\ wd = get_word(f);\ wd = iwd;\ }\ }\ } headers() { register struct file_list *fl; for (fl = ftab; fl != NULL; fl = fl->f_next) if (fl->f_needs != NULL) do_count(fl->f_needs, fl->f_needs, TRUE); } /* * do_count: * Count all the devices of a certain type and recurse to count * whatever the device is connected to */ do_count(dev, hname, search) register char *dev, *hname; bool search; { register struct device *dp, *mp; register int count; for (count = 0,dp = dtab; dp != NULL; dp = dp->d_next) if (dp->d_unit != -1 && eq(dp->d_name, dev)) { count++; if (search) { mp = dp->d_conn; if (mp != NULL && mp != -1 && mp->d_conn != -1) { do_count(mp->d_name, hname, FALSE); search = FALSE; } } } do_header(dev, hname, count); } do_header(dev, hname, count) char *dev, *hname; int count; { char *file, *name, *inw, *toheader(), *tomacro(); struct file_list *fl, *fl_head; FILE *inf, *outf; int inc, oldcount; file = toheader(hname); name = tomacro(dev); inf = fopen(file, "r"); oldcount = -1; if (inf == NULL) { outf = fopen(file, "w"); if (outf == NULL) { perror(file); exit(1); } fprintf(outf, "#define %s %d\n", name, count); fclose(outf); return; } fl_head = NULL; while(1) { rdln(inf, inw, inc); if (inw == EOF) break; if (eq(inw, name)) { oldcount = inc; inc = count; } fl = (struct file_list *) malloc(sizeof *fl); fl->f_fn = inw; fl->f_type = inc; fl->f_next = fl_head; fl_head = fl; } fclose(inf); if (count == oldcount) { for (fl = fl_head; fl != NULL; fl = fl->f_next) free(fl); return; } if (oldcount == -1) { fl = (struct file_list *) malloc(sizeof *fl); fl->f_fn = name; fl->f_type = count; fl->f_next = fl_head; fl_head = fl; } outf = fopen(file, "w"); if (outf == NULL) { perror(file); exit(1); } for (fl = fl_head; fl != NULL; fl = fl->f_next) { fprintf(outf, "#define %s %d\n", fl->f_fn, count ? fl->f_type : 0); free(fl); } fclose(outf); } /* * toheader: * Convert a dev name to a .h file nae */ char *toheader(dev) char *dev; { static char hbuf[80]; strcpy(hbuf, path(dev)); strcat(hbuf, ".h"); return hbuf; } /* * tomacro: * Convert a dev name to a macro name */ char *tomacro(dev) register char *dev; { static char mbuf[20]; register char *cp; cp = mbuf; *cp++ = 'N'; while(*dev) *cp++ = toupper(*dev++); *cp++ = '\0'; return mbuf; } t ? fl->f_type : 0); free(fl); } fclose(outf); } /* * toheader: * Convert a dev name to a .h file nae */ char *toheader(dev) char *dev; { static char hbuf[80]; strcpy(hbuf, path(dev)); strcat(hbuf, ".h"); return hbuf; } /* * tomacro: * Convert a dev name to a macro name */ char *tomacro(dev) register char *dev; { static char mbuf[20]; register char *cp; cp = mbuf; *cp++ = 'N'; while(*dev) *cp++ = toupper(*dev++); *cp++ = '\0cmd/config/main.c 444 0 33 3123 2552442323 7131 /* * main.c 1.4 81/03/09 * Config * Do system configuration for VAX/UNIX * 1) Build system data structures * 2) Build makefile * 3) Create header files for devices * Michael Toy -- Berkeley -- 1981 */ #include #include #include "y.tab.h" #include "config.h" main(argc, argv) int argc; char **argv; { if (argc != 2) { fprintf(stderr, "usage: config \n"); exit(1); } PREFIX = argv[1]; if (freopen(argv[1], "r", stdin) == NULL) { perror(argv[1]); exit(2); } dtab = NULL; if (yyparse()) exit(3); else { ioconf(); /* Print ioconf.c */ ubglue(); /* Create ubglue.s */ makefile(); /* build Makefile */ headers(); /* make a lot of .h files */ printf("Don't forget to run \"make depend\"\n"); } } /* * get_word * returns EOF on end of file * NULL on end of line * pointer to the word otherwise */ char *get_word(fp) register FILE *fp; { static char line[80]; register int ch; register char *cp; while((ch = getc(fp)) != EOF) if (ch != ' ' && ch != '\t') break; if (ch == EOF) return EOF; if (ch == '\n') return NULL; cp = line; *cp++ = ch; while((ch = getc(fp)) != EOF) { if (isspace(ch)) break; *cp++ = ch; } *cp = '\0'; if (ch == EOF) return EOF; ungetc(ch, fp); return line; } /* * path: * Prepend the path to a filename */ path(file) char *file; { register char *cp; cp = malloc(strlen(PREFIX)+strlen(file)+5); strcpy(cp, "../"); strcat(cp, PREFIX); strcat(cp, "/"); strcat(cp, file); return cp; } ) return EOF; if (ch == '\n') return NULL; cp = line; *cp++ = ch; while((ch = getc(fp)) != EOF) { if (isspace(ch)) break; *cp++ = ch; } *cp = '\0'; if (ch == EOF) return EOF; ungetc(ch, fp); return line; } /* * path: * Prepend the path to a filename */ path(file) char *file; { register char *cp; cp = malloc(strlen(PREFIX)+strlen(file)+5); strcpy(cp, "../"); cmd/config/makefile 664 0 33 627 2552542410 7531 ((OBJS = y.tab.o main.o lex.yy.o mkioconf.o mkmakefile.o mkubglue.o mkheaders.o CFLAGS=-w -O LDFLAGS=-ll DESTDIR=/ config: $(OBJS) $(CC) $(OBJS) -o config $(LDFLAGS) install: config install config $(DESTDIR)/etc y.tab.o: y.tab.c y.tab.c: config.y yacc -d config.y lex.yy.c: config.l lex config.l clean: rm -f $(OBJS) lex.yy.c y.tab.c print: pr -l57 main.c config.y config.l mk*.c | netlpr -c vpr *file; { /,5< /,"cmd/config/mkioconf.c 444 0 33 16255 2552542405 10046 #include #include "y.tab.h" #include "config.h" /* * mkioconf.c 1.9 81/07/09 * ioconf: * Build the ioconf.c file */ char *qu(); ioconf() { register struct device *dp, *mp, *np; register int uba_n, slave; char *intv(); FILE *fp; fp = fopen(path("ioconf.c"), "w"); if (fp == NULL) { perror(path("ioconf.c")); exit(1); } fprintf(fp, "#include \"../h/param.h\"\n"); fprintf(fp, "#include \"../h/pte.h\"\n"); fprintf(fp, "#include \"../h/buf.h\"\n"); fprintf(fp, "#include \"../h/map.h\"\n"); fprintf(fp, "#include \"../h/mbavar.h\"\n"); fprintf(fp, "#include \"../h/vm.h\"\n"); fprintf(fp, "#include \"../h/ubavar.h\"\n\n"); fprintf(fp, "#define C (caddr_t)\n\n"); /* * First print the mba initialization structures */ if (seen_mba) { for (dp = dtab; dp != NULL; dp = dp->d_next) { mp = dp->d_conn; if (mp == NULL || mp == TO_NEXUS || !eq(mp->d_name, "mba")) continue; fprintf(fp, "extern struct mba_driver %sdriver;\n", dp->d_name); } fprintf(fp, "\nstruct mba_device mbdinit[] = {\n"); fprintf(fp, "\t/* Device, Unit, Mba, Drive, Dk */\n"); for (dp = dtab; dp != NULL; dp = dp->d_next) { mp = dp->d_conn; if (dp->d_unit == QUES || mp == NULL || mp == TO_NEXUS || !eq(mp->d_name, "mba")) continue; if (dp->d_addr) { printf("can't specify csr address on mba for %s%d\n", dp->d_name, dp->d_unit); continue; } if (dp->d_vec != NULL) { printf("can't specify vector for %s%d on mba\n", dp->d_name, dp->d_unit); continue; } if (dp->d_drive == UNKNOWN) { printf("drive not specified for %s%d\n", dp->d_name, dp->d_unit); continue; } if (dp->d_slave != UNKNOWN) { printf("can't specify slave number for %s%d\n", dp->d_name, dp->d_unit); continue; } fprintf(fp, "\t{ &%sdriver, %d, %s, %s, %d },\n", dp->d_name, dp->d_unit, qu(mp->d_unit), qu(dp->d_drive), dp->d_dk); } fprintf(fp, "\t0\n};\n\n"); /* * Print the mbsinit structure * Driver Controller Unit Slave */ fprintf(fp, "struct mba_slave mbsinit [] = {\n"); fprintf(fp, "\t/* Driver, Ctlr, Unit, Slave */\n"); for (dp = dtab; dp != NULL; dp = dp->d_next) { /* * All slaves are connected to something which is connected to * the massbus. */ if ((mp = dp->d_conn) == NULL || mp == TO_NEXUS) continue; np = mp->d_conn; if (np == NULL || np == TO_NEXUS || !eq(np->d_name, "mba")) continue; fprintf(fp, "\t{ &%sdriver, %s, %2d, %d },\n", mp->d_name, qu(mp->d_unit), dp->d_unit, dp->d_slave); } fprintf(fp, "\t0\n};\n\n"); } /* * Now generate interrupt vectors for the unibus */ for (dp = dtab; dp != NULL; dp = dp->d_next) { if (dp->d_vec != NULL) { struct idlst *ip; mp = dp->d_conn; if (mp == NULL || mp == TO_NEXUS || !eq(mp->d_name, "uba")) continue; fprintf(fp, "extern struct uba_driver %sdriver;\n", dp->d_name); fprintf(fp, "extern "); ip = dp->d_vec; for (;;) { fprintf(fp, "X%s%d()", ip->id, dp->d_unit); ip = ip->id_next; if (ip == 0) break; fprintf(fp, ", "); } fprintf(fp, ";\n"); fprintf(fp, "int\t (*%sint%d[])() = { ", dp->d_name, dp->d_unit, dp->d_unit); ip = dp->d_vec; for (;;) { fprintf(fp, "X%s%d", ip->id, dp->d_unit); ip = ip->id_next; if (ip == 0) break; fprintf(fp, ", "); } fprintf(fp, ", 0 } ;\n"); } } /* * Now spew forth the uba_minfo structure */ fprintf(fp, "\nstruct uba_ctlr ubminit[] = {\n"); fprintf(fp, "/*\t driver,\tctlr,\tubanum,\talive,\tintr,\taddr */\n"); for (dp = dtab; dp != NULL; dp = dp->d_next) { mp = dp->d_conn; if (dp->d_type != CONTROLLER || mp == TO_NEXUS || mp == NULL || !eq(mp->d_name, "uba")) continue; if (dp->d_vec == 0) { printf("must specify vector for %s%d\n", dp->d_name, dp->d_unit); continue; } if (dp->d_addr == 0) { printf("must specify csr address for %s%d\n", dp->d_name, dp->d_unit); continue; } if (dp->d_drive != UNKNOWN || dp->d_slave != UNKNOWN) { printf("drives need their own entries; dont specify drive or slave for %s%d\n", dp->d_name, dp->d_unit); continue; } if (dp->d_flags) { printf("controllers (e.g. %s%d) don't have flags, only devices do\n", dp->d_name, dp->d_unit); continue; } fprintf(fp, "\t{ &%sdriver,\t%d,\t%s,\t0,\t%sint%d, C 0%o },\n", dp->d_name, dp->d_unit, qu(mp->d_unit), dp->d_name, dp->d_unit, dp->d_addr); } fprintf(fp, "\t0\n};\n"); /* * Now we go for the uba_device stuff */ fprintf(fp, "\nstruct uba_device ubdinit[] = {\n"); fprintf(fp, "\t/* driver, unit, ctlr, ubanum, slave, intr, addr, dk, flags*/\n"); for (dp = dtab; dp != NULL; dp = dp->d_next) { mp = dp->d_conn; if (dp->d_unit == QUES || dp->d_type != DEVICE || mp == NULL || mp == TO_NEXUS || mp->d_type == MASTER || eq(mp->d_name, "mba")) continue; np = mp->d_conn; if (np != NULL && np != TO_NEXUS && eq(np->d_name, "mba")) continue; np = NULL; if (eq(mp->d_name, "uba")) { if (dp->d_vec == 0) { printf("must specify vector for device %s%d\n", dp->d_name, dp->d_unit); continue; } if (dp->d_addr == 0) { printf("must specify csr address for device %s%d\n", dp->d_name, dp->d_unit); continue; } if (dp->d_drive != UNKNOWN || dp->d_slave != UNKNOWN) { printf("drives/slaves can be specified only for controllers, not for device %s%d\n", dp->d_name, dp->d_unit); continue; } uba_n = mp->d_unit; slave = QUES; } else { if ((np = mp->d_conn) == NULL) { printf("%s%d isn't connected to anything, so %s%d is unattached\n", mp->d_name, mp->d_unit, dp->d_name, dp->d_unit); continue; } uba_n = np->d_unit; if (dp->d_drive == UNKNOWN) { printf("must specify ``drive number'' for %s%d\n", dp->d_name, dp->d_unit); continue; } /* NOTE THAT ON THE UNIBUS ``drive'' IS STORED IN */ /* ``SLAVE'' AND WE DON'T WANT A SLAVE SPECIFIED */ if (dp->d_slave != UNKNOWN) { printf("slave numbers should be given only for massbus tapes, not for %s%d\n", dp->d_name, dp->d_unit); continue; } if (dp->d_vec != 0) { printf("interrupt vectors should not be given for drive %s%d\n", dp->d_name, dp->d_unit); continue; } if (dp->d_addr != 0) { printf("csr addresses should be given only on controllers, not on %s%d\n", dp->d_name, dp->d_unit); continue; } slave = dp->d_drive; } fprintf(fp, "\t{ &%sdriver, %2d, %s, %s, %2d, %s, C 0%-6o, %d, 0x%x },\n", eq(mp->d_name, "uba") ? dp->d_name : mp->d_name, dp->d_unit, eq(mp->d_name, "uba") ? " -1" : qu(mp->d_unit), qu(uba_n), slave, intv(dp), dp->d_addr, dp->d_dk, dp->d_flags); } fprintf(fp, "\t0\n};\n"); fclose(fp); } /* * intv * Return vector name */ char *intv(dev) register struct device *dev; { static char buf[20]; if (dev->d_vec == NULL) return " 0"; else return sprintf(buf, "%sint%d", dev->d_name, dev->d_unit); } char * qu(num) { if (num == QUES) return "'?'"; if(num == UNKNOWN) return " -1"; return ns(sprintf(errbuf, "%3d", num)); } ba") ? " -1" : qu(mp->d_unit), qu(uba_n), slave, intv(dp), dp->d_addr, dp->d_dk, dp->d_flags); } fprintf(fp, "\t0\n};\n"); fclose(fp); } /* * intv * Return vector name */ char *intv(dev) register struct device *dev; { static char buf[20]; if (dev->d_vec == NULL) return " 0"; else return sprintf(bufcmd/config/mkubglue.c 444 0 33 2350 2552442325 10023 /* * Make the uba interrupt file ubglue.s * mkubglue.c 1.4 81/05/22 */ #include #include "config.h" #include "y.tab.h" ubglue() { register FILE *fp; register struct device *dp, *mp; fp = fopen(path("ubglue.s"), "w"); if (fp == NULL) { perror(path("ubglue.s")); exit(1); } for (dp = dtab ; dp != NULL; dp = dp->d_next) { mp = dp->d_conn; if (mp != NULL && mp != -1 && !eq(mp->d_name, "mba")) { struct idlst *id, *id2; for (id = dp->d_vec; id; id = id->id_next) { for (id2 = dp->d_vec; id2; id2 = id2->id_next) { if (id2 == id) { dump_vec(fp, id->id, dp->d_unit); break; } if (!strcmp(id->id, id2->id)) break; } } } } fclose(fp); } /* * dump_vec * Print an interrupt vector */ dump_vec(fp, vector, number) register FILE *fp; char *vector; int number; { char nbuf[80]; register char *v = nbuf; sprintf(v, "%s%d", vector, number); fprintf(fp, "\t.globl\t_X%s\n\t.align\t2\n_X%s:\n\tpushr\t$0x3f\n", v, v((); if (strncmp(vector, "dzx", 3) == 0) fprintf(fp, "\tmovl\t$%d,r0\n\tjbr\t_dzdma\n\n", number); else { fprintf(fp, "\tpushl\t$%d\n", number); fprintf(fp, "\tcalls\t$1,_%s\n\tpopr\t$0x3f\n\trei\n\n", vector); } } _vec * Print an interrupt vector */ dump_vec(fp, vector, number) register FILE *fp; char *vector; int number; { char nbuf[80]; register char *v = nbuf; sprintf(v, "%s%d", vector, number); fprintf(fp, "\t.globl\t_X%s\n\t.align\t2\n_X%s:\n\tpushr\t$0x3f\n", v, vcmd/config/y.tab.h 664 0 33 1105 2552542456 7241 # define CPU 257 # define IDENT 258 # define CONFIG 259 # define ANY 260 # define DEVICE 261 # define UBA 262 # define MBA 263 # define NEXUS 264 # define CSR 265 # define DRIVE 266 # define VECTOR 267 # define OPTIONS 268 # define CONTROLLER 269 # define PSEUDO_DEVICE 270 # define FLAGS 271 # define ID 272 # define SEMICOLON 273 # define NUMBER 274 # define FPNUMBER 275 # define TRACE 276 # define DISK 277 # define SLAVE 278 # define AT 279 # define HZ 280 # define TIMEZONE 281 # define DST 282 # define MAXUSERS 283 # define MASTER 284 # define COMMA 285 # define MINUS 286 260 # define DEVICE 261 # define UBA 262 # define MBA 263 # define NEXUS 264 # define CSR 265 # define DRIVE 266 # define VECTOR 267 # define OPTIONS 268 # define CONTROLLER 269 # define PSEUDO_DEVICE 270 # define FLAGS 271 # define ID 272 # define SEMICOLON 273 # define NUMBER 274 # define FPNUMBER 275 # define TRACE 276 # define DISK 277 # define SLAVE 278 # define AT 279 # define HZ 280 # define TIMEZONE 281 # define DST 282 # define MAcmd/config/config.l 444 0 33 4216 2552442322 7466 %{ /* config.l 1.8 81/05/18 */ #include #include "y.tab.h" #include "config.h" #define tprintf if (do_trace) printf int yylval; /* * Key word table */ struct kt { char *kt_name; int kt_val; } key_words[] = { "cpu", CPU, "ident", IDENT, "config", CONFIG, "options", OPTIONS, "device", DEVICE, "controller", CONTROLLER, "uba", UBA, "mba", MBA, "csr", CSR, "nexus", NEXUS, "drive", DRIVE, "vector", VECTOR, "pseudo-device", PSEUDO_DEVICE, "flags", FLAGS, "trace", TRACE, "disk", DISK, "tape", DEVICE, "slave", SLAVE, "at", AT, "hz", HZ, "timezone", TIMEZONE, "dst", DST, "maxusers", MAXUSERS, "master", MASTER, 0,0, }; %} WORD [A-Za-z_][-A-Za-z_]* %% {WORD} { int i; if ((i = kw_lookup(yytext)) == -1) { yylval = (int) yytext; tprintf("id(%s) ", yytext); return ID; } tprintf("(%s) ", yytext); return i; } \"[^"]+\" { yytext[strlen(yytext)-1] = '\0'; yylval = (int) yytext + 1; return ID; } 0[0-7]* { yylval = octal(yytext); tprintf("#O:%o ", yylval); return NUMBER; } 0x[0-9a-f]+ { yylval = hex(yytext); tprintf("#X:%x ", yylval); return NUMBER; } [1-9][0-9]* { yylval = atoi(yytext); tprintf("#D:%d ", yylval); return NUMBER; } [0-9]"."[0-9]* { float atof(); yylval = (int) (60 * atof(yytext) + 0.5); return FPNUMBER; } "-" { return MINUS; } "?" { yylval = -1; tprintf("? "); return NUMBER; } \n/[ \t] { yyline++; tprintf("\n... "); } \n { yyline++; tprintf("\n"); return SEMICOLON; } ^#.* { /* Ignored (comment) */; } [ \t]* { /* Ignored (white space) */; } ";" { return SEMICOLON; } "," { return COMMA; } %% /* * kw_lookup * Look up a string in the keyword table. Returns a -1 if the * string is not a keyword otherwise it returns the keyword number */ kw_lookup(word) register char *word; { register struct kt *kp; for (kp = key_words; kp->kt_name != 0; kp++) if (eq(word, kp->kt_name)) return kp->kt_val; return -1; } /* * Number conversion routines */ octal(str) char *str; { int num; sscanf(str, "%o", &num); return num; } hex(str) char *str; { int num; sscanf(str+2, "%x", &num); return num; } w_lookup * Look up a string in the keyword table. Returns a -1 if the * string is not a keyword otherwise it returns the keyword number */ kw_lookup(word) register char *word; { register struct kt *kp; for (kp = key_words; kp->kt_name != 0; kp++) if (eq(word, kp->kt_name)) return kp->kt_val; return -1; } /* * Number conversion routines */ octal(str) cmd/config/newvers.sh 664 0 33 322 2552442325 10052 touch version awk ' { version = $1 + 1; }\ END { printf "char *version = \"Berkeley VAX/UNIX Version 4.%d ", version > "vers.c";\ printf "%d\n", version > "version"; }' < version echo `date`'\n";' >> vers.c the * string is not a keyword otherwise it returns the keyword number */ kw_lookup(word) register char *word; { register struct kt *kp; for (kp = key_words; kp->kt_name != 0; kp++) if (eq(word, kp->kt_n/,5< /,"cmd/savecore.c 444 0 33 17127 2552465611 6605 static char *sccsid = "@(#)savecore.c 4.7 (Berkeley) 81/05/20"; /* * savecore */ #include #include #include #include #include #include #include #define DAY (60L*60L*24L) #define LEEWAY (3*DAY) #define eq(a,b) (!strcmp(a,b)) #define ok(number) ((number)&0x7fffffff) #define SHUTDOWNLOG "/usr/adm/shutdownlog" struct nlist nl[] = { #define X_DUMPDEV 0 { "_dumpdev" }, #define X_DUMPLO 1 { "_dumplo" }, #define X_TIME 2 { "_time" }, #define X_PHYSMEM 3 { "_physmem" }, #define X_VERSION 4 { "_version" }, #define X_PANICSTR 5 { "_panicstr" }, { 0 }, }; char *system; char *dirname; /* directory to save dumps in */ char *ddname; /* name of dump device */ char *find_dev(); dev_t dumpdev; /* dump device */ time_t dumptime; /* time the dump was taken */ int dumplo; /* where dump starts on dumpdev */ int physmem; /* amount of memory in machine */ time_t now; /* current date */ char *path(); unsigned malloc(); char *ctime(); char vers[80]; char core_vers[80]; char panic_mesg[80]; int panicstr; off_t lseek(); off_t Lseek(); main(argc, argv) char **argv; int argc; { if (argc != 2 && argc != 3) { fprintf(stderr, "usage: savecore dirname [ system ]\n"); exit(1); } dirname = argv[1]; if (argc == 3) system = argv[2]; if (access(dirname, 2) < 0) { perror(dirname); exit(1); } (void) time(&now); read_kmem(); log_entry(); if (get_crashtime() && check_space()) save_core(); else exit(1); } char * find_dev(dev, type) register dev_t dev; register int type; { register int dfd = Open("/dev", 0); struct direct dir; struct stat statb; static char devname[DIRSIZ + 1]; char *dp; strcpy(devname, "/dev/"); while(Read(dfd, (char *)&dir, sizeof dir) > 0) { if (dir.d_ino == 0) continue; strncpy(devname + 5, dir.d_name, DIRSIZ); devname[DIRSIZ] = '\0'; if (stat(devname, &statb)) { perror(devname); continue; } if ((statb.st_mode&S_IFMT) != type) continue; if (dev == statb.st_rdev) { close(dfd); dp = (char *)malloc(strlen(devname)+1); strcpy(dp, devname); return dp; } } close(dfd); fprintf(stderr, "Can't find device %d,%d\n", major(dev), minor(dev)); exit(1); /*NOTREACHED*/ } read_kmem() { int kmem; FILE *fp; register char *cp; nlist("/vmunix", nl); if (nl[X_DUMPDEV].n_value == 0) { fprintf(stderr, "/vmunix: dumpdev not in namelist\n"); exit(1); } if (nl[X_DUMPLO].n_value == 0) { fprintf(stderr, "/vmunix: dumplo not in namelist\n"); exit(1); } if (nl[X_TIME].n_value == 0) { fprintf(stderr, "/vmunix: time not in namelist\n"); exit(1); } if (nl[X_PHYSMEM].n_value == 0) { fprintf(stderr, "/vmunix: physmem not in namelist\n"); exit(1); } if (nl[X_VERSION].n_value == 0) { fprintf(stderr, "/vmunix: version not in namelist\n"); exit(1); } if (nl[X_PANICSTR].n_value == 0) { fprintf(stderr, "/vmunix: panicstr not in namelist\n"); exit(1); } kmem = Open("/dev/kmem", 0); Lseek(kmem, (long)nl[X_DUMPDEV].n_value, 0); Read(kmem, (char *)&dumpdev, sizeof dumpdev); Lseek(kmem, (long)nl[X_DUMPLO].n_value, 0); Read(kmem, (char *)&dumplo, sizeof dumplo); Lseek(kmem, (long)nl[X_PHYSMEM].n_value, 0); Read(kmem, (char *)&physmem, sizeof physmem); dumplo *= 512L; ddname = find_dev(dumpdev, S_IFBLK); if ((fp = fdopen(kmem, "r")) == NULL) { fprintf(stderr, "Couldn't fdopen kmem\n"); exit(1); } if (system) return; fseek(fp, (long)nl[X_VERSION].n_value, 0); fgets(vers, sizeof vers, fp); fclose(fp); if ((fp = fopen(ddname, "r")) =((= NULL) { perror(ddname); exit(1); } fseek(fp, (off_t)(dumplo+ok(nl[X_VERSION].n_value)), 0); fgets(core_vers, sizeof core_vers, fp); fclose(fp); if (!eq(vers, core_vers)) fprintf(stderr, "Warning: vmunix version mismatch:\n\t%sand\n\t%s", vers,core_vers); fp = fopen(ddname, "r"); fseek(fp, (off_t)(dumplo + ok(nl[X_PANICSTR].n_value)), 0); fread((char *)&panicstr, sizeof panicstr, 1, fp); if (panicstr) { fseek(fp, dumplo + ok(panicstr), 0); cp = panic_mesg; do *cp = getc(fp); while (*cp++); } fclose(fp); } get_crashtime() { int dumpfd; time_t clobber = (time_t)0; if (system) return (1); dumpfd = Open(ddname, 2); Lseek(dumpfd, (off_t)(dumplo + ok(nl[X_TIME].n_value)), 0); Read(dumpfd, (char *)&dumptime, sizeof dumptime); Lseek(dumpfd, (off_t)(dumplo + ok(nl[X_TIME].n_value)), 0); Write(dumpfd, (char *)&clobber, sizeof clobber); close(dumpfd); if (dumptime == 0) { #ifdef DEBUG printf("dump time is 0\n"); #endif return 0; } printf("System went down at %s", ctime(&dumptime)); if (dumptime < now - LEEWAY || dumptime > now + LEEWAY) { printf("Dump time is unreasonable\n"); return 0; } return 1; } char * path(file) char *file; { register char *cp = (char *)malloc(strlen(file) + strlen(dirname) + 2); (void) strcpy(cp, dirname); (void) strcat(cp, "/"); (void) strcat(cp, file); return cp; } check_space() { struct stat dsb; register char *ddev; register int dfd; struct filsys sblk; if (stat(dirname, &dsb) < 0) { perror(dirname); exit(1); } ddev = find_dev(dsb.st_dev, S_IFBLK); dfd = Open(ddev, 0); Lseek(dfd, 1L< sblk.s_tfree) { fprintf(stderr, "Dump omitted, not enough space on device\n"); return (0); } return (1); } read_number(fn) char *fn; { char lin[80]; register FILE *fp; if ((fp = fopen(path(fn), "r")) == NULL) return 0; if (fgets(lin, 80, fp) == NULL) { fclose(fp); return 0; } fclose(fp); return atoi(lin); } save_core() { register int n; char buffer[32*NBPG]; register char *cp = buffer; register int ifd, ofd, bounds; register FILE *fp; bounds = read_number("bounds"); ifd = Open(system?system:"/vmunix", 0); ofd = Create(path(sprintf(cp, "vmunix.%d", bounds)), 0666); while((n = Read(ifd, cp, BUFSIZ)) > 0) Write(ofd, cp, n); close(ifd); close(ofd); ifd = Open(ddname, 0); ofd = Create(path(sprintf(cp, "vmcore.%d", bounds)), 0666); Lseek(ifd, (off_t)dumplo, 0); printf("Saving %d bytes of image in vmcore.%d\n", NBPG*physmem, bounds); while(physmem > 0) { n = Read(ifd, cp, (physmem > 32 ? 32 : physmem) * NBPG); Write(ofd, cp, n); physmem -= n/NBPG; } close(ifd); close(ofd); fp = fopen(path("bounds"), "w"); fprintf(fp, "%d\n", bounds+1); fclose(fp); } char *days[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; log_entry() { FILE *fp; struct tm *tm, *localtime(); tm = localtime(&now); fp = fopen("/usr/adm/shutdownlog", "a"); if (fp == 0) return; fseek(fp, 0L, 2); fprintf(fp, "%02d:%02d %s %s %2d, %4d. Reboot", tm->tm_hour, tm->tm_min, days[tm->tm_wday], months[tm->tm_mon], tm->tm_mday, tm->tm_year + 1900); if (panicstr) fprintf(fp, " after panic: %s\n", panic_mesg); else putc('\n', fp); fclose(fp); } /* * Versions of std routines that exit on error. */ Open(name, rw) char *name; int rw; { int fd; if ((fd = open(name, rw)) < 0) { perror(name); exit(1); } return fd; } Read(fd, buff, size) int fd, size; char *buff; { int ret; if ((ret = read(fd, buff, size)) < 0) { perror("read"); exit(1); } return ret; } off_t Lseek(fd, off, flag) int fd, flag; long off; { long ret; if ((ret = lseek(fd, off, flag)) == -1L) { perror("lseek"); exit(1); } return ret; } Create(file, mode) char *file; int mode; { register int fd; if ((fd = creat(file, mode)) < 0) { perror(file); exit(1); } return fd; } Write(fd, buf, size) int fd, size; char *buf; { if (write(fd, buf, size) < size) { perror("write"); exit(1); } } ret = read(fd, buff, size)) < 0) { perror("read"); exit(1); } return ret; } off_t Lseek(fd, off, flag) int fd, flag; long off; { long ret; if ((ret = lseek(fd, off, flag)) == -1L) { perror("lseek"); exit(1); } return ret; } Create(file, mode) char *file; int mode; { register int fd; if ((fd = creat(file, mode)) < 0) { perror(file); exit(1); } return fd; } Write(fd, buf, size) int fd, size; dummy 664 0 33 0 2534254111 5016 lib/ 775 0 33 0 2552607260 4522 lib/libplot/ 775 0 33 0 2552605536 6173 lib/libplot/Makefile 644 0 33 2425 2424542276 7720 all: plot.a t4014.a t300.a t300s.a t450.a plot.a: plot.c.a -rm -r xplot;mkdir xplot cd xplot;ar x ../plot.c.a cd xplot;cc -c -O *.c cd xplot;ar rc plot.a *.o mv xplot/plot.a . rm -r xplot t4014.a: t4014.c.a -rm -r xplot;mkdir xplot cd xplot;ar x ../t4014.c.a cd xplot;cc -c -O *.c cd xplot;ar rc t4014.a *.o mv xplot/t4014.a . rm -r xplot t300.a: t300.c.a -rm -r xplot;mkdir xplot cd xplot;ar x ../t300.c.a cd xplot;cc -c -O *.c cd xplot;ar rc t300.a *.o mv xplot/t300.a . rm -r xplot t300s.a: t300s.c.a -rm -r xplot;mkdir xplot cd xplot;ar x ../t300s.c.a cd xplot;cc -c -O *.c cd xplot;ar rc t300s.a *.o mv xplot/t300s.a . rm -r xplot t450.a: t450.c.a -rm -r xplot;mkdir xplot cd xplot;ar x ../t450.c.a cd xplot;cc -c -O *.c cd xplot;ar rc t450.a *.o mv xplot/t450.a . rm -r xplot install: all install plot.a $(DESTDIR)/usr/lib/libplot.a ranlib $(DESTDIR)/usr/lib/libplot.a install t4014.a $(DESTDIR)/usr/lib/lib4014.a ranlib $(DESTDIR)/usr/lib/lib4014.a install t300.a $(DESTDIR)/usr/lib/lib300.a ranlib $(DESTDIR)/usr/lib/lib300.a install t300s.a $(DESTDIR)/usr/lib/lib300s.a ranlib $(DESTDIR)/usr/lib/lib300s.a install t450.a $(DESTDIR)/usr/lib/lib450.a ranlib $(DESTDIR)/usr/lib/lib450.a clean: rm -f plot.a t4014.a t300.a t300s.a t450.a -rmdir xplot t/t450.a . rm -r xplot install: all install plot.a $(DESTDIR)/usr/lib/libplot.a ranlib $(DESTDIR)/usr/lib/libplot.a install t4014.a $(DESTDIR)/usr/lib/lib4014.a ranlib $(DESTDIR)/usr/lib/lib4014.a install t300.a $(DESTDIR)/usr/llib/libplot/plot.c.a 644 0 33 4452 2375730516 7624 ! arc.c 287602852 10 1 100664 136 ` #include arc(xi,yi,x0,y0,x1,y1){ putc('a',stdout); putsi(xi); putsi(yi); putsi(x0); putsi(y0); putsi(x1); putsi(y1); } box.c 287602853 10 1 100664 114 ` box(x0, y0, x1, y1) { move(x0, y0); cont(x0, y1); cont(x1, y1); cont(x1, y0); cont(x0, y0); move(x1, y1); } circle.c 287602852 10 1 100664 88 ` #include circle(x,y,r){ putc('c',stdout); putsi(x); putsi(y); putsi(r); } close.c 287602853 10 1 100664 79 ` #include closevt(){ fflush(stdout); } closepl(){ fflush(stdout); } cont.c 287602853 10 1 100664 77 ` #include cont(xi,yi){ putc('n',stdout); putsi(xi); putsi(yi); } dot.c 287602853 10 1 100664 163 ` #include dot(xi,yi,dx,n,pat) int pat[]; { int i; putc('d',stdout); putsi(xi); putsi(yi); putsi(dx); putsi(n); for(i=0; i erase(){ putc('e',stdout); } label.c 287602853 10 1 100664 124 ` #include label(s) char *s; { int i; putc('t',stdout); for(i=0;s[i];)putc(s[i++],stdout); putc('\n',stdout); } line.c 287602853 10 1 100664 107 ` #include line(x0,y0,x1,y1){ putc('l',stdout); putsi(x0); putsi(y0); putsi(x1); putsi(y1); } linmod.c 287602853 10 1 100664(( 126 ` #include linemod(s) char *s; { int i; putc('f',stdout); for(i=0;s[i];)putc(s[i++],stdout); putc('\n',stdout); } move.c 287602853 10 1 100664 77 ` #include move(xi,yi){ putc('m',stdout); putsi(xi); putsi(yi); } open.c 287602853 10 1 100664 24 ` openvt(){ } openpl(){ } point.c 287602853 10 1 100664 78 ` #include point(xi,yi){ putc('p',stdout); putsi(xi); putsi(yi); } putsi.c 287602853 10 1 100664 82 ` #include putsi(a){ putc((char)a,stdout); putc((char)(a>>8),stdout); } space.c 287602853 10 1 100664 108 ` #include space(x0,y0,x1,y1){ putc('s',stdout); putsi(x0); putsi(y0); putsi(x1); putsi(y1); } 02853 10 1 100664 24 ` openvt(){ } openpl(){ } point.c 287602853 10 1 100664 78 ` #include point(xi,yi){ putc('p',stdout); putsi(xi); putsi(yi); } putsi.c lib/libplot/t300.c.a 644 0 33 12666 2375730516 7362 ! arc.c 287606513 10 1 100664 9 ` arc(){ } box.c 287606513 10 1 100664 114 ` box(x0, y0, x1, y1) { move(x0, y0); cont(x0, y1); cont(x1, y1); cont(x1, y0); cont(x0, y0); move(x1, y1); } circle.c 287606513 10 1 100664 12 ` circle(){ } close.c 287606513 10 1 100664 84 ` #include closevt(){ closepl(); } closepl(){ fflush(stdout); reset(); } con.h 287606514 10 1 100664 633 ` # #include /* gsi plotting output routines */ # define DOWN 012 # define UP 013 # define LEFT 010 # define RIGHT 040 # define BEL 007 # define ESC 033 # define ACK 006 # define CR 015 # define FF 014 # define VERTRESP 48 # define HORZRESP 60. # define VERTRES 8. # define HORZRES 6. /* down is line feed, up is reverse line feed, left is backspace, right is space. 48 points per inch vertically, 60 horizontally */ extern int xnow, ynow; extern int OUTF; extern struct sgttyb ITTY, PTTY; extern float HEIGHT, WIDTH, OFFSET; extern int xscale, xoffset, yscale; extern float botx, boty, obotx, oboty, scalex,scaley; dot.c 287606513 10 1 100664 9 ` dot(){ } erase.c 287606513 10 1 100664 102 ` #include "con.h" erase(){ int i; for(i=0; i<11*(VERTRESP/VERTRES); i++) spew(DOWN); return; } label.c 287606524 10 1 100664 118 ` #include "con.h" label(s) char *s; { int i,c; while((c = *s++) != '\0'){ xnow += 6; spew(c); } return; } line.c 287606571 10 1 100664 792 ` #include "con.h" line(x0,y0,x1,y1){ iline(xconv(xsc(x0)),yconv(ysc(y0)),xconv(xsc(x1)),yconv(ysc(y1))); return; } cont(x0,y0){ iline(xnow,ynow,xconv(xsc(x0)),yconv(ysc(y0))); return; } iline(cx0,cy0,cx1,cy1){ int maxp,tt,j,np; char chx,chy; float xd,yd; float dist2(),sqrt(); movep(cx0,cy0); maxp = sqrt(dist2(cx0,cy0,cx1,cy1))/2.; xd = cx1-cx0; yd = cy1-cy0; if(xd >= 0)chx = RIGHT; else chx = LEFT; if(yd >= 0)chy = UP; else chy = DOWN; if(maxp==0){ xd=0; yd=0; } else{ xd /= maxp; yd /= maxp; } inplot(); for (tt=0; tt<=maxp; tt++){ j= cx0+xd*tt-xnow; xnow += j; j = abval(j); while(j-- > 0)spew(chx); j = cy0+yd*tt-ynow; ynow += j; j = abval(j); while(j-- > 0)spew(chy); spew ('.'); } outplot(); return; } linmod.c 287606513 10 1 100664 13 ` linemod(){ } move.c 287606513 10 1 100664 65 ` move(xi,yi){ movep(xconv(xsc(xi)),yconv(ysc(yi))); return; } open.c 287606619 10 1 100664 976 ` # #include /* gsi plotting output routines */ # define DOWN 012 # define UP 013 # define LEFT 010 # define RIGHT 040 # define BEL 007 # define ACK 006 # define CR 015 # define FF 014 # define VERTRESP 48 # define HORZRESP 60. # define HORZRES 6. # define VERTRES 8. /* down is line feed, up is reverse oyne feed, left is bwckspace, right is space. 48 points per inch vertically, 60 horizontally */ int xnow, ynow; int OUTF; struct sgttyb ITTY, PTTY; float HEIGHT = 6.0, WIDTH = 6.0, OFFSET = 0.0; int xscale, xoffset, yscale; float botx = 0., boty = 0., obotx = 0., oboty = 0.; float scalex = 1., scaley = 1.; openpl () { int reset(); xnow = ynow = 0; OUTF = 1; printf("\r"); gtty(OUTF, &ITTY); signal (2, reset); PTTY = ITTY; PTTY.sg_flags &= ~CRMOD; /* don't map lf */ /* initialize constants */ xscale = 4096./(HORZRESP * WIDTH); yscale = 4096 /(VERTRESP * HEIGHT); xoffset = OFFSET * HORZRESP; return; } openvt(){ openpl(); } point.c 287606513 10 1 100664 55 ` point(xi,yi){ move(xi,yi); label("."); return; } space.c 287606632 10 1 100664 190 ` # include "con.h" float deltx = 4095.; float delty = 4095.; space(x0,y0,x1,y1){ botx = -2047.; boty = -2047.; obotx = x0; oboty = y0; scalex = deltx/(x1-x0); scaley = delty/(y1-y0); } subr.c 287606669 10 1 100664 1472 ` #include #include "con.h" abval(q) { return (q>=0 ? q : -q); } xconv (xp) { /* x position input is -2047 to +2047, output must be 0 to PAGSIZ*HORZRES */ xp += 2048; /* the computation is newx = xp*(PAGSIZ*HORZRES)/4096 */ return (xoffset + xp /xscale); } yconv (yp) { /* see description of xconv */ yp += 2048; return (yp / yscale); } inplot() { stty(OUTF, &PTTY); spew (ACK); } outplot() { spew(ESC); spew(ACK); fflush(stdout); stty(OUTF, &ITTY); } spew(ch) { if(ch == UP)putc(ESC,stdout); putc(ch, stdout); } tobotleft () { move(-2048,-2048); } reset() { outplot(); exit(); } float dist2 (x1, y1, x2, y2) { float t,v; t = x2-x1; v = y1-y2; return (t*t+v*v); } swap (pa, pb) int *pa, *pb; { int t; t = *pa; *pa = *pb; *pb = t; } movep (xg, yg) { int i,ch; if((xg == xnow) && (yg == ynow))return; /* if we need to go to left margin, just CR */ if (xg < xnow/2) { spew(CR); xnow = 0; } i = (xg-xnow)/HORZRES; if(xnow < xg)ch = RIGHT; else ch = LEFT; xnow += i*HORZRES; i = abval(i); while(i--)spew(ch); i = abval(xg-xnow); inplot(); while(i--) spew(ch); outplot(); i=(yg-ynow)/VERTRES; if(ynow < yg)ch = UP; else ch = DOWN; ynow += i*VERTRES; i = abval(i); while(i--)spew(ch); i=abval(yg-ynow); inplot(); while(i--)spew(ch); outplot(); xnow = xg; ynow = yg; } xsc(xi){ int xa; xa = (xi - obotx) * scalex + botx; return(xa); } ysc(yi){ int ya; ya = (yi - oboty) *scaley +boty; return(ya); } ES; if(xnow < xg)ch = RIGHT; else ch = LEFT; xnow += i*HORZRES; i = ablib/libplot/t300s.c.a 644 0 33 14006 2375730517 7534 ! arc.c 287606715 10 1 100664 9 ` arc(){ } box.c 287606715 10 1 100664 114 ` box(x0, y0, x1, y1) { move(x0, y0); cont(x0, y1); cont(x1, y1); cont(x1, y0); cont(x0, y0); move(x1, y1); } circle.c 287606715 10 1 100664 12 ` circle(){ } close.c 287606715 10 1 100664 84 ` #include closevt(){ closepl(); } closepl(){ fflush(stdout); reset(); } con.h 287606715 10 1 100664 774 ` # #include /* gsi plotting output routines */ # define DOUBLE 010 #define ADDR 0100 #define COM 060 #define PENUP 04 #define MAXX 070 #define MAXY 07 #define SPACES 7 # define DOWN 012 # define UP 013 # define LEFT 010 # define RIGHT 040 # define BEL 007 # define ESC 033 # define ACK 006 # define INPLOT 'P' # define CR 015 # define FF 014 # define VERTRESP 48 # define HORZRESP 60. # define VERTRES 8. # define HORZRES 6. /* down is line feed, up is reverse line feed, left is backspace, right is space. 48 points per inch vertically, 60 horizontally */ extern int xnow, ynow; extern int OUTF; extern struct sgttyb ITTY, PTTY; extern float HEIGHT, WIDTH, OFFSET; extern int xscale, xoffset, yscale; extern float botx, boty, obotx, oboty, scalex,scaley; dot.c 287606715 10 1 100664 9 ` dot(){ } erase.c 287606715 10 1 100664 102 ` #include "con.h" erase(){ int i; for(i=0; i<11*(VERTRESP/VERTRES); i++) spew(DOWN); return; } label.c 287606727 10 1 100664 124 ` #include "con.h" label(s) char *s; { int i,c; while((c = *s++) != '\0'){ xnow += HORZRES; spew(c); } return; } line.c 287606772 10 1 100664 717 ` #include "con.h" line(x0,y0,x1,y1){ iline(xconv(xsc(x0)),yconv(ysc(y0)),xconv(xsc(x1)),yconv(ysc(y1))); return; } cont(x0,y0){ iline(xnow,ynow,xconv(xsc(x0)),yconv(ysc(y0))); return; } iline(cx0,cy0,cx1,cy1){ int maxp,tt,j,np; char chx,chy,command; float xd,yd; float dist2(),sqrt(); movep(cx0,cy0); maxp = sqrt(dist2(cx0,cy0,cx1,cy1))/2.; xd = cx1-cx0; yd = cy1-cy0; command = COM|((xd<0)<<1)|(yd<0); if(maxp == 0){ xd=0; yd=0; } else { xd /= maxp; yd /= maxp; } inplot(); spew(command); for (tt=0; tt<=maxp; tt++){ chx= cx0+xd*tt-xnow; xnow += chx; chx = abval(chx); chy = cy0+yd*tt-ynow; ynow += chy; chy = abval(chy); spew(ADDR|chx<<3|chy); } outplot(); return; } linmod.c 287606715 10 1 100664 13 ` line((mod(){ } move.c 287606715 10 1 100664 65 ` move(xi,yi){ movep(xconv(xsc(xi)),yconv(ysc(yi))); return; } open.c 287606853 10 1 100664 976 ` # #include /* gsi plotting output routines */ # define DOWN 012 # define UP 013 # define LEFT 010 # define RIGHT 040 # define BEL 007 # define ACK 006 # define CR 015 # define FF 014 # define VERTRESP 48 # define HORZRESP 60. # define HORZRES 6. # define VERTRES 8. /* down is line feed, up is reverse oyne feed, left is bwckspace, right is space. 48 points per inch vertically, 60 horizontally */ int xnow, ynow; int OUTF; struct sgttyb ITTY, PTTY; float HEIGHT = 6.0, WIDTH = 6.0, OFFSET = 0.0; int xscale, xoffset, yscale; float botx = 0., boty = 0., obotx = 0., oboty = 0.; float scalex = 1., scaley = 1.; openpl () { int reset(); xnow = ynow = 0; OUTF = 1; printf("\r"); gtty(OUTF, &ITTY); signal (2, reset); PTTY = ITTY; PTTY.sg_flags &= ~CRMOD; /* don't map lf */ /* initialize constants */ xscale = 4096./(HORZRESP * WIDTH); yscale = 4096 /(VERTRESP * HEIGHT); xoffset = OFFSET * HORZRESP; return; } openvt(){ openpl(); } point.c 287606715 10 1 100664 72 ` #include "con.h" point(xi,yi){ move(xi,yi); label("."); return; } space.c 287606877 10 1 100664 190 ` # include "con.h" float deltx = 4095.; float delty = 4095.; space(x0,y0,x1,y1){ botx = -2047.; boty = -2047.; obotx = x0; oboty = y0; scalex = deltx/(x1-x0); scaley = delty/(y1-y0); } subr.c 287606941 10 1 100664 1975 ` #include #include "con.h" abval(q) { return (q>=0 ? q : -q); } xconv (xp) { /* x position input is -2047 to +2047, output must be 0 to PAGSIZ*HORZRES */ xp += 2048; /* the computation is newx = xp*(PAGSIZ*HORZRES)/4096 */ return (xoffset + xp /xscale); } yconv (yp) { /* see description of xconv */ yp += 2048; return (yp / yscale); } inplot() { stty(OUTF, &PTTY); spew(ESC); spew (INPLOT); } outplot() { spew(ESC); spew(ACK); spew(ESC); spew(ACK); fflush(stdout); stty (OUTF, &ITTY); } spew(ch) { putc(ch, stdout); } tobotleft () { move(-2048,-2048); } reset() { outplot(); exit(); } float dist2 (x1, y1, x2, y2) { float t,v; t = x2-x1; v = y1-y2; return (t*t+v*v); } swap (pa, pb) int *pa, *pb; { int t; t = *pa; *pa = *pb; *pb = t; } #define DOUBLE 010 #define ADDR 0100 #define COM 060 #define MAXX 070 #define MAXY 07 extern xnow,ynow; #define SPACES 7 movep(ix,iy){ int dx,dy,remx,remy,pts,i; int xd,yd; int addr,command; char c; if(xnow == ix && ynow == iy)return; inplot(); dx = ix-xnow; dy = iy-ynow; command = COM|PENUP|((dx<0)<<1)|(dy<0); dx = abval(dx); dy = abval(dy); xd = dx/(SPACES*2); yd = dy/(SPACES*2); pts = xd0){ c=command|DOUBLE; addr=ADDR; if(xd>0)addr|=MAXX; if(yd>0)addr|=MAXY; spew(c); while(i--){ spew(addr); } } if(xd!=yd){ if(xd>pts){ i=xd-pts; addr=ADDR|MAXX; } else{ i=yd-pts; addr=ADDR|MAXY; } c=command|DOUBLE; spew(c); while(i--){ spew(addr); } } remx=dx-xd*SPACES*2; remy=dy-yd*SPACES*2; addr=ADDR; i = 0; if(remx>7){ i=1; addr|=MAXX; remx -= 7; } if(remy>7){ i=1; addr|=MAXY; remy -= 7; } while(i--){ spew(command); spew(addr); } if(remx>0||remy>0){ spew(command); spew(ADDR|remx<<3|remy); } xnow=ix; ynow=iy; outplot(); return; } xsc(xi){ int xa; xa = (xi - obotx) * scalex + botx; return(xa); } ysc(yi){ int ya; ya = (yi - oboty) *scaley +boty; return(ya); } UBLE; spew(c); while(i--){ spew(addr); } } remx=dx-xd*SPACES*2; remy=dy-yd*SPACES*2; addr=ADDR; i = 0; if(remx>7){ i=1; addr|=MAXX; remx -= 7; } if(remy>7){ i=1; addr|=MAXY; remy -= 7; } while(i--){ spew(command); spew(addr); } if(remx>0||remy>0){ spew(command); spew(ADDR|remx<<3|remy); } xnow=ix; ynow=iy; outplot(); return; } xsc(xi){ int xa; xa = (xi - obotx) * scalex + botx; return(xa); } ysc(yi){ int ya; ya = (yi - oboty) *scaley +boty; return(yalib/libplot/t4014.c.a 644 0 33 13006 2375730517 7436 ! arc.c 287606113 10 1 100664 1842 ` int del = 20; step(d){ del = d; } arc(x,y,x0,y0,x1,y1){ double pc; double sqrt(); int flg,m,xc,yc,xs,ys,qs,qf; float dx,dy,r; char use; dx = x-x0; dy = y-y0; r = dx*dx+dy*dy; pc = r; pc = sqrt(pc); flg = pc/4; if(flg == 0)step(1); else if(flg < del)step(flg); xc = xs = x0; yc = ys = y0; move(xs,ys); if(x0 == x1 && y0 == y1)flg=0; else flg=1; qs = quad(x,y,x0,y0); qf = quad(x,y,x1,y1); if(abs(x-x1) < abs(y-y1)){ use = 'x'; if(qs == 2 || qs ==3)m = -1; else m=1; } else { use = 'y'; if(qs > 2)m= -1; else m= 1; } while(1){ switch(use){ case 'x': if(qs == 2 || qs == 3)yc -= del; else yc += del; dy = yc-y; pc = r-dy*dy; xc = m*sqrt(pc)+x; if((x < xs && x >= xc) || ( x > xs && x <= xc) || (y < ys && y >= yc) || ( y > ys && y <= yc) ) { if(++qs > 4)qs=1; if(qs == 2 || qs == 3)m= -1; else m=1; flg=1; } cont(xc,yc); xs = xc; ys = yc; if(qs == qf && flg == 1) switch(qf){ case 3: case 4: if(xs >= x1)return; continue; case 1: case 2: if(xs <= x1)return; } continue; case 'y': if(qs > 2)xc += del; else xc -= del; dx = xc-x; pc = r-dx*dx; yc = m*sqrt(pc)+y; if((x < xs && x >= xc) || ( x > xs && x <= xc ) || (y < ys && y >= yc) || (y > ys && y <= yc) ) { if(++qs > 4)qs=1; if(qs > 2)m = -1; else m = 1; flg=1; } cont(xc,yc); xs = xc; ys = yc; if(qs == qf && flg == 1) switch(qs){ case 1: case 4: if(ys >= y1)return; continue; case 2: case 3: if(ys <= y1)return; } } } } quad(x,y,xp,yp){ if(x < xp) if(y <= yp)return(1); else return(4); else if(x > xp) if(y < yp)return(2); else return(3); else if(y < yp)return(2); else return(4); } abs(a){ if(a < 0)return(-a); return(a); } box.c 287606034 10 1 100664 114 ` box(x0, y0, x1, y1) { move(x0, y0); cont(x0, y1); cont(x1, y1); cont(x1, y0); cont(x0, y0); move(x1, y1); } circle.c 287606034 10 1 100664 40 ` circle(x,y,r){ arc(x,y,x+r,y,x+r,y); } close.c 287606035 10 1 100664 105 ` #include closevt(){ putch(037); fflush(stdout); } closepl(){ putch(037); fflush(stdout); } dot.c 287606035 10 1 100664 9 ` dot(){ } erase.c 287606035 10 1 100664 192 ` extern int ohiy; extern int ohix; extern int oloy; extern int oextra; erase(){ int i; putch(033); putch(014); ohiy= -1; ohix = -1; oextra = -1; oloy = -1; sleep(2); return; } label.c 287606099 10 1 100664 590 ` #define N 0104 #define E 0101 #define NE 0105 #define S 0110 #define W 0102 #define SW 0112 /* arrange by incremental plotting that an initial * character such as +, X, *, etc will fall * right on the point, and undo it so that further * labels will fall properly in place */ char lbl_mv[] = { 036,040,S,S,S,S,S,S,SW,SW,SW,SW,SW,SW,SW,SW,SW,SW,037,0 }; char lbl_umv[] = { 036,040,N,N,N,N,N,N,NE,NE,NE,NE,NE,NE,NE,NE,NE,NE,037,0 }; label(s) char *s; { register i,c; for(i=0; c=lbl_mv[i]; i++) putch(c); for(i=0; c=s[i]; i++) putch(c); for(i=0; c=lbl_umv[i]; i++) putch(c); } line.c 287606035 10 1 100664 49 ` line(x0,y0,x1,y1){ move(x0,y0); cont(x1,y1); } linemod.c 287606035 10 1 100664 216 ` linemod(s) char *s; { char c; putch(033); switch(s[0]){ case 'l': c = 'd'; break; case 'd': if(s[3] != 'd')c='a'; else c='b'; break; case 's': if(s[5] != '\0')c='c'; else c='`'; } putch(c); } move.c 287606035 10 1 100664 42 ` move(xi,yi){ putch(035); cont(xi,yi); } open.c 287606035 10 1 100664 26 ` openvt () { } openpl(){ } point.c 287606035 10 1 100664 44 ` point(xi,yi){ move(xi,yi); cont(xi,yi); } scale.c 287606156 10 1 100664 267 ` extern float scalex; extern float scaley; extern int scaleflag; scale(i,x,y) char i; float x,y; { switch(i) { default: return; case 'c': x *= 2.54; y *= 2.54; case 'i': x /= 200; y /= 200; case 'u': scalex = 1/x; scaley = 1/y; } scaleflag = 1; } space.c 287606035 10 1 100664 289 ` extern float botx; extern float boty; extern float obotx; extern float oboty; extern float scalex; extern float scaley; extern int scaleflag; space(x0,y0,x1,y1){ botx = 0.; boty = 0.; obotx = x0; oboty = y0; if(scaleflag) return; scalex = 3120./(x1-x0); scaley = 3120./(y1-y0); } subr.c 287606231 10 1 100664 900 ` #include float obotx = 0.; float oboty = 0.; float botx = 0.; float boty = 0.; float scalex = 1.; float scaley = 1.; int scaleflag; int oloy = -1; int ohiy = -1; int ohix = -1; int oextra = -1; cont(x,y){ int hix,hiy,lox,loy,extra; int n; x = (x-obotx)*scalex + botx; y = (y-oboty)*scaley + boty; hix=(x>>7) & 037; hiy=(y>>7) & 037; lox = (x>>2)&037; loy=(y>>2)&037; extra=x&03+(y<<2)&014; n = (abs(hix-ohix) + abs(hiy-ohiy) + 6) / 12; if(hiy != ohiy){ putch(hiy|040); ohiy=hiy; } if(hix != ohix){ if(extra != oextra){ putch(extra|0140); oextra=extra; } putch(loy|0140); putch(hix|040); ohix=hix; oloy=loy; } else{ if(extra != oextra){ putch(extra|0140); putch(loy|0140); oextra=extra; oloy=loy; } else if(loy != oloy){ putch(loy|0140); oloy=loy; } } putch(lox|0100); while(n--) putch(0); } putch(c){ putc(c,stdou((t); } xtra=x&03+(y<<2)&014; n = (abs(hix-ohix) + abs(hiy-ohiy) + 6) / 12; if(hiy != ohiy){ putch(hiy|040); ohiy=hiy; } if(hix != ohix){ if(extra != oextra){ putch(extra|0140); oextra=extra; } putch(loy|0140); putch(hix|040); ohix=hix; oloy=loy; } else{ if(extra != oextra){ putch(extra|0140); putch(loy|0140); oextra=extra; oloy=loy; } else if(loy != oloy){ putch(loy|0140); oloy=loy; } } putch(lox|0100); while(n--) putch(0); } putch(c){ putc(c,stdoulib/libplot/t450.c.a 644 0 33 13020 2375730517 7352 ! arc.c 287606287 10 1 100664 9 ` arc(){ } box.c 287606287 10 1 100664 114 ` box(x0, y0, x1, y1) { move(x0, y0); cont(x0, y1); cont(x1, y1); cont(x1, y0); cont(x0, y0); move(x1, y1); } circle.c 287606287 10 1 100664 12 ` circle(){ } close.c 287606287 10 1 100664 84 ` #include closevt(){ closepl(); } closepl(){ fflush(stdout); reset(); } con.h 287606287 10 1 100664 672 ` # #include /* gsi plotting output routines */ # define DOWN 012 # define UP 013 # define LEFT 010 # define RIGHT 040 # define BEL 007 # define ESC 033 # define ACK 006 #define PLOTIN 063 #define PLOTOUT 064 # define CR 015 # define FF 014 # define VERTRESP 48 # define HORZRESP 60. # define VERTRES 8. # define HORZRES 6. /* down is line feed, up is reverse line feed, left is backspace, right is space. 48 points per inch vertically, 60 horizontally */ extern int xnow, ynow; extern int OUTF; extern struct sgttyb ITTY, PTTY; extern float HEIGHT, WIDTH, OFFSET; extern int xscale, xoffset, yscale; extern float botx, boty, obotx, oboty, scalex,scaley; dot.c 287606287 10 1 100664 9 ` dot(){ } erase.c 287606287 10 1 100664 102 ` #include "con.h" erase(){ int i; for(i=0; i<11*(VERTRESP/VERTRES); i++) spew(DOWN); return; } label.c 287606300 10 1 100664 118 ` #include "con.h" label(s) char *s; { int i,c; while((c = *s++) != '\0'){ xnow += 6; spew(c); } return; } line.c 287606349 10 1 100664 794 ` #include "con.h" line(x0,y0,x1,y1){ iline(xconv(xsc(x0)),yconv(ysc(y0)),xconv(xsc(x1)),yconv(ysc(y1))); return; } cont(x0,y0){ iline(xnow,ynow,xconv(xsc(x0)),yconv(ysc(y0))); return; } iline(cx0,cy0,cx1,cy1){ int maxp,tt,j,np; char chx,chy; float xd,yd; float dist2(),sqrt(); movep(cx0,cy0); maxp = sqrt(dist2(cx0,cy0,cx1,cy1))/2.; xd = cx1-cx0; yd = cy1-cy0; if(xd >= 0)chx = RIGHT; else chx = LEFT; if(yd >= 0)chy = UP; else chy = DOWN; if(maxp == 0){ xd=0; yd=0; } else{ xd /= maxp; yd /= maxp; } inplot(); for (tt=0; tt<=maxp; tt++){ j= cx0+xd*tt-xnow; xnow += j; j = abval(j); while(j-- > 0)spew(chx); j = cy0+yd*tt-ynow; ynow += j; j = abval(j); while(j-- > 0)spew(chy); spew ('.'); } outplot(); return; } linmod.c 287606288 10 1 100664 13 ` linemod(){ } move.c 287606288 10 1 100664 65 ` move(xi,yi){ movep(xconv(xsc(xi)),yconv(ysc(yi))); return; } open.c 287606433 10 1 100664 1035 ` # #include /* gsi plotting output routines */ # define DOWN 012 # define UP 013 # define LEFT 010 # define RIGHT 040 # define BEL 007 # define ACK 006 #define PLOTIN 063 #define PLOTOUT 064 # define CR 015 # define FF 014 # define VERTRESP 48 # define HORZRESP 60. # define HORZRES 6. # define VERTRES 8. /* down is line feed, up is reverse oyne feed, left is bwckspace, right is space. 48 points per inch vertically, 60 horizontally */ int xnow, ynow; int OUTF; struct sgttyb ITTY, PTTY; float HEIGHT = 6.0, WIDTH = 6.0, OFFSET = 0.0; int xscale, xoffset, yscale; float botx = 0., boty = 0., obotx = 0., oboty = 0.; float scalex = 1., scaley = 1.; openpl () { int reset(); xnow = ynow = 0; OUTF = 1; printf("\r"); gtty(OUTF, &ITTY); signal (2, reset); PTTY = ITTY; PTTY.sg_flags &= ~CRMOD; /* don't map lf */ stty(OUTF,&PTTY); /* initialize constants */ xscale = 4096./(HORZRESP * WIDTH); yscale = 4096 /(VERTRESP * HEIGHT); xoffset = OFFSET * HORZRESP; return; } openvt(){ openpl(); } point.c 287606288 10 1 100664 55 ` point(xi,yi){ move(xi,yi); label("."); return; } space.c 287606288 10 1 100664 148 ` # include "con.h" space(x0,y0,x1,y1){ botx = -2047.; boty = -2047.; obotx = x0; oboty = y0; scalex = 4096./(x1-x0); scaley = 4096./(y1-y0); } subr.c 287606468 10 1 100664 1503 ` #include #include "con.h" abval(q) { return (q>=0 ? q : -q); } xconv (xp) { /* x position input is -2047 to +2047, output must be 0 to PAGSIZ*HORZRES */ xp += 2048; /* the computation is newx = xp*(PAGSIZ*HORZRES)/4096 */ return (xoffset + xp /xscale); } yconv (yp) { /* see description of xconv */ yp += 2048; return (yp / yscale); } inplot() { spew (ESC); spew(PLOTIN); } outplot() { spew(ESC); spew(PLOTOUT); fflush(stdout); } spew(ch) { if(ch == UP){ putc(ESC,stdout); ch = DOWN; } putc(ch, stdout); } tobotleft () { move(-2048,-2048); } reset() { signal(2,1); outplot(); stty(OUTF,&ITTY); exit(); } float dist2 (x1, y1, x2, y2) { float t,v; t = x2-x1; v = y1-y2; return (t*t+v*v); } swap (pa, pb) int *pa, *pb; { int t; t = *pa; *pa = *pb; *pb = t; } movep (xg,yg) { int i,ch; if((xg == xnow) && (yg == ynow))return; /* if we need to go to left margin, just CR */ if (xg < xnow/2) { spew(CR); xnow = 0; } i = (xg-xnow)/HORZRES; if(xnow < xg)ch = RIGHT; else ch = LEFT; xnow += i*HORZRES; i = abval(i); while(i--)spew(ch); i = abval(xg-xnow); inplot(); while(i--) spew(ch); outplot(); i=(yg-ynow)/VERTRES; if(ynow < yg)ch = UP; else ch = DOWN; ynow += i*VERTRES; i = abval(i); while(i--)spew(ch); i=abval(yg-ynow); inplot(); while(i--)spew(ch); outplot(); xnow = xg; ynow = yg; } xsc(xi){ int xa; xa = (xi - obotx) * scalex + botx; return(xa); } ysc(yi){ int ya; ya = (yi - oboty) *scaley +boty; return(ya); } S; if(xnow < xg)ch = RIGHT; else ch = LEFT; xnow += i*HORZRES; i = abval(i); while(i--)spew(ch); i = abval(xg-xnow); inplot(); while(i--) spew(ch); outplot(); i=(yg-ynow)/VERTRES; if(ynow < yg)ch = UP; else ch = DOWN; ynow += i*VERTRES; i = abval(i); while(i--)spew(ch); i=abval(yg-ynow); inplot(); while(i--)spew(ch); outplot(); xnow = xg; ynow = yg; } xsc(xi){ int xa; xa = (xi - obotx) * scalex + botx; return(xa); } ysc(yi){ int ya; ya = (yi - oboty) *scaley +boty; lib/libplot/vt0.c.a 644 0 33 5772 2375730520 7360 ! arc.c 287604804 10 1 100664 93 ` extern vti; arc(xi,yi,x0,y0,x1,y1){ char c; c = 6; write(vti,&c,1); write(vti,&xi,12); } box.c 287604805 10 1 100664 114 ` box(x0, y0, x1, y1) { move(x0, y0); cont(x0, y1); cont(x1, y1); cont(x1, y0); cont(x0, y0); move(x1, y1); } circle.c 287604804 10 1 100664 82 ` extern vti; circle(x,y,r){ char c; c = 5; write(vti,&c,1); write(vti,&x,6); } close.c 287604804 10 1 100664 64 ` extern vti; closevt(){ close(vti); } closepl(){ close(vti); } dot.c 287604804 10 1 100664 197 ` extern vti; dot(xi,yi,dx,n,pat) int pat[]; { struct {char pad,c; int xi,yi,dx;} p; p.c = 7; p.xi = xsc(xi); p.yi = ysc(yi); p.dx = xsc(dx); write(vti,&p.c,7); write(vti,pat,n?n&0377:256); } erase.c 287604804 10 1 100664 58 ` extern vti; erase(){ int i; i=0401; write(vti,&i,2); } frame.c 287604804 10 1 100664 63 ` frame(n) { extern vti; n=n&0377 | 02000; write(vti,&n,2); } label.c 287604804 10 1 100664 122 ` extern vti; label(s) char *s; { int i, o; o = 01401; write(vti, &o, 2); for(i=0; s[i++]; ) ; write(vti, s, i); } line.c 287604804 10 1 100664 260 ` extern vti; extern xnow,ynow; line(x0,y0,x1,y1){ struct{char x,c; int x0,y0,x1,y1;} p; p.c = 3; p.x0 = xsc(x0); p.y0 = ysc(y0); p.x1 = xnow = xsc(x1); p.y1 = ynow = ysc(y1); write(vti,&p.c,9); } cont(x0,y0){ line(xnow,ynow,xsc(x0),ysc(y0)); return; } linmod.c 287604805 10 1 100664 24 ` linemod(s) char *s; { } move.c 287604804 10 1 100664 155 ` extern vti; extern xnow,ynow; move(xi,yi){ struct {char pad,c; int x,y;} p; p.c = 9; p.x = xnow = xsc(xi); p.y = ynow = ysc(yi); write(vti,&p.c,5); } open.c 287604805 10 1 100664 230 ` int xnow; int ynow; float boty 0.; float botx 0.; float oboty 0.; float obotx 0.; float scalex 1.; float scaley 1.; int vti -1; openvt () { vti = open("/dev/vt0",1); return; } openpl() { vti = open("/dev/vt0",1); return; } point.c 287604805 10 1 100664 157 ` extern vti; extern xnow,ynow; point(xi,yi){ struct {char pad,c; int x,y;} p; p.c = 2; p.x = xnow = xsc(xi); p.y = ynow = ysc(yi); write(vti,&p.c,5); } space.c 287604805 10 1 100664 287 ` extern float boty; extern float botx; extern float oboty; extern float obotx; extern flo((at scalex; extern float scaley; float deltx 4095.; float delty 4095.; space(x0,y0,x1,y1){ botx = -2047.; boty = -2047; obotx = x0; oboty = y0; scalex = deltx/(x1-x0); scaley = delty/(y1-y0); } subr.c 287604805 10 1 100664 246 ` extern float obotx; extern float oboty; extern float boty; extern float botx; extern float scalex; extern float scaley; xsc(xi){ int xa; xa = (xi-obotx)*scalex+botx; return(xa); } ysc(yi){ int ya; ya = (yi-oboty)*scaley+boty; return(ya); } rn flolib/libln/ 775 0 33 0 2552602054 5616 lib/libln/allprint.c 644 0 33 775 2111463574 7666 # include allprint(c) char c; { extern FILE *yyout; switch(c){ case '\n': fprintf(yyout,"\\n"); break; case '\t': fprintf(yyout,"\\t"); break; case '\b': fprintf(yyout,"\\b"); break; case ' ': fprintf(yyout,"\\\bb"); break; default: if(!printable(c)) fprintf(yyout,"\\%-3o",c); else putc(c,yyout); break; } return; } sprint(s) char *s; { while(*s) allprint(*s++); return; } printable(c) int c; { return(040 < c && c < 0177); } lib/libln/main.c 644 0 33 60 2111463574 6730 # include "stdio.h" main(){ yylex(); exit(0); } ern FILE *yyout; switch(c){ case '\n': fprintf(yyout,"\\n"); break; case '\t': fprintf(yyout,"\\t"); break; case '\b': fprintf(yyout,"\\b"); break; case ' ': fprintf(yyout,"\\\bb"); break; default: if(!printable(c)) fprintf(yyout,"\\%-3o",c); else putc(c,yyout); break; } return; } sprint(s) char *s; { while(*s)/,5h< /,"lib/libln/reject.c 644 0 33 1500 2111463574 7320 # include extern struct {int *yyaa, *yybb; int *yystops;} *yylstate [], **yylsp, **yyolsp; yyreject () { extern FILE *yyout, *yyin; extern int yyprevious , *yyfnd; extern char yyextra[]; extern char yytext[]; extern int yyleng; for( ; yylsp < yyolsp; yylsp++) yytext[yyleng++] = yyinput(); if (*yyfnd > 0) return(yyracc(*yyfnd++)); while (yylsp-- > yylstate) { yyunput(yytext[yyleng-1]); yytext[--yyleng] = 0; if (*yylsp != 0 && (yyfnd= (*yylsp)->yystops) && *yyfnd > 0) return(yyracc(*yyfnd++)); } if (yytext[0] == 0) return(0); yyoutput(yyprevious = yyinput()); yyleng=0; return(-1); } yyracc(m) { yyolsp = yylsp; if (yyextra[m]) { while (yyback((*yylsp)->yystops, -m) != 1 && yylsp>yylstate) { yylsp--; yyunput(yytext[--yyleng]); } } yyprevious = yytext[yyleng-1]; yytext[yyleng] = 0; return(m); } turn(yyracc(*yyfnd++)); while (yylsp-- > yylstate) { yyunput(yytext[yyleng-1]); yytext[--yyleng] = 0; if (*yylsp != 0 && (yyfnd= (*yylsp)->yystops) && *yyfnd > 0) return(yyracc(*yyfnd++)lib/libln/yyless.c 644 0 33 464 2111463574 7364 yyless(x) { extern char yytext[]; register char *lastch, *ptr; extern int yyleng; extern int yyprevious; lastch = yytext+yyleng; if (x>=0 && x <= yyleng) ptr = x + yytext; else ptr = x; while (lastch > ptr) yyunput(*--lastch); *lastch = 0; if (ptr >yytext) yyprevious = *--lastch; yyleng = ptr-yytext; } eturn(m); } turn(yyracc(*yyfnd++)); while (yylsp-- > yylstate) { yyunput(yytext[yyleng-1]); yytext[--yyleng] /,5< /,"lib/libln/yywrap.c 644 0 33 31 2111463574 7335 yywrap() { return(1); } ytext[]; register char *lastch, *ptr; extern int yyleng; extern int yyprevious; lastch = yytext+yyleng; if (x>=0 && x <= yyleng) ptr = x + yytext; else ptr = x; while (lastch > ptr) yyunput(*--lastch); *lastch = 0; if (ptr >yytext) yyprevious = *--lastch; yyleng = ptr-yytext; } eturn(m); } turn(yyracc(*yyfnd++)); while (yylsp-- > yylstate) { yyunput(yytext[yyleng-1]); yytext[--yyleng] /,5< /,"lib/libln/Makefile 644 0 33 611 2256631242 7321 CFLAGS = -O all: libln.a libln.a: cc -c -O allprint.c main.c reject.c yyless.c cc -c -O yywrap.c rm -f libln.a ar rvc libln.a allprint.o main.o reject.o yyless.o yywrap.o rm allprint.o main.o reject.o yyless.o yywrap.o install: all install libln.a $(DESTDIR)/usr/lib rm -f $(DESTDIR)/usr/lib/libl.a ln $(DESTDIR)/usr/lib/libln.a $(DESTDIR)/usr/lib/libl.a clean: rm -f *.o libln.a eng-1]); yytext[--yyleng] /,5< /,"lib/libcurses/ 775 0 33 0 2552602766 6523 lib/libcurses/:ctfix 444 0 33 53 2501350217 7655 1,$s; ; /vb/arpa/arnold/=lib/=curses/; w q -O allprint.c main.c reject.c yyless.c cc -c -O yywrap.c rm -f libln.a ar rvc libln.a al< < a9.o y02552602766ap.o < a9main00000006523yyless.o yywrap.o install: all install libln.a $(DESTDIR)/usr/lib rm -f $(DESTDIR)/usr/lib/libl.a ln $(DESTDIR)/usr/lib/libln.a $(DESTDIR)/usr/lib/libl.a clean: rm -f *.o libln.a eng ; yytex/ C. /,"lib/libcurses/Makefile 444 0 33 4463 2520734462 10245 # # cursor package maker # # @(#)Makefile 1.10 (Berkeley) 4/17/81 # HEADERS=curses.h unctrl.h cr_ex.h curses.ext CFILES= box.c clear.c initscr.c endwin.c mvprintw.c mvscanw.c mvwin.c \ newwin.c overlay.c overwrite.c printw.c scanw.c refresh.c \ touchwin.c erase.c clrtobot.c clrtoeol.c cr_put.c cr_tty.c \ longname.c delwin.c insertln.c deleteln.c scroll.c getstr.c \ getch.c addstr.c addch.c move.c curses.c unctrl.c standout.c \ tstp.c insch.c delch.c OBJS= box.o clear.o initscr.o endwin.o mvprintw.o mv((scanw.o mvwin.o \ newwin.o overlay.o overwrite.o printw.o scanw.o refresh.o \ touchwin.o erase.o clrtobot.o clrtoeol.o cr_put.o cr_tty.o \ longname.o delwin.o insertln.o deleteln.o scroll.o getstr.o \ getch.o addstr.o addch.o move.o curses.o unctrl.o standout.o \ tstp.o insch.o delch.o POBJS= box.p clear.p initscr.p endwin.p mvprintw.p mvscanw.p mvwin.p \ newwin.p overlay.p overwrite.p printw.p scanw.p refresh.p \ touchwin.p erase.p clrtobot.p clrtoeol.p cr_put.p cr_tty.p \ longname.p delwin.p insertln.p deleteln.p scroll.p getstr.p \ getch.p addstr.p addch.p move.p curses.p unctrl.p standout.p \ tstp.p insch.p delch.p CTAGS= ctags CC= cc LINT= lint LPASS1= /usr/lib/lint/lint1 AR= ar RM= rm LN= ln CFL= CFLAGS= -O ${CFL} LDFLAGS=-n .SUFFIXES: .p .c.p: rm -f x.c ln $*.c x.c ${CC} ${CFLAGS} -p -c x.c mv x.o $*.p libcurses: ${HEADERS} crlib crlib: ${OBJS} ${AR} rv crlib $? ranlib crlib pcrlib: ${POBJS} rm -f x.c ${AR} rv pcrlib $? ranlib pcrlib test: crlib test.o ${CC} ${LDFLAGS} ${CFLAGS} -o test test.o crlib -ltermlib cat.o: curses.h ${CC} -c ${CFLAGS} cat.c new: cleanup ctags ${CC} -c ${CFLAGS} ${CFILES} ${AR} qv crlib ${OBJS} ${RM} /ya/staff/arnold/=eye/crlib /ya/staff/arnold/=hacks/crlib \ /ya/staff/arnold/=eye/curses.h /ya/staff/arnold/=hacks/curses.h clean: rm ${OBJS} crlib ctags: ${CTAGS} ${CFILES} curses.h cr_ex.h lint: ${LINT} -hxb ${CFL} ${CFILES} -lcurses > lint.out lpr: -pr curses.h ${CFILES} | lpr -lpq tp: tp crm0 Makefile tags ${HEADERS} ${CFILES} llib-lcurses tar: tar crvf curses.tar Makefile tags ${HEADERS} ${CFILES} llib-lcurses llib-lcurses.ln: llib-lcurses -(/lib/cpp -C -Dlint llib-lcurses | ${LPASS1} > llib-lcurses.ln ) 2>&1 | grep -v warning install: install -c crlib ${DESTDIR}/usr/lib/libcurses.a ranlib ${DESTDIR}/usr/lib/libcurses.a BJS} crlib ctags: ${CTAGS} ${CFILES} curses.h cr_ex.h lint: ${LINT} -hxb ${CFL} ${CFILES} -lcurses > lint.out lpr: -pr curses.h ${CFILES} | lpr -lpq tp: tp crm0 Makefile tags ${HEADERS} ${CFILES} lib/libcurses/addch.c 444 0 33 2773 2501350221 10000 # include "curses.ext" /* * This routine adds the character to the current position * * 3/5/81 (Berkeley) @(#)addch.c 1.3 */ waddch(win, c) reg WINDOW *win; char c; { reg int x, y; x = win->_curx; y = win->_cury; # ifdef FULLDEBUG fprintf(outf, "ADDCH('%c') at (%d, %d)\n", c, y, x); # endif if (y >= win->_maxy || x >= win->_maxx || y < 0 || x < 0) return ERR; switch (c) { case '\t': { reg int newx; for (newx = x + (8 - (x & 07)); x < newx; x++) if (waddch(win, ' ') == ERR) return ERR; return OK; } default: # ifdef FULLDEBUG fprintf(outf, "ADDCH: 1: y = %d, x = %d, firstch = %d, lastch = %d\n", y, x, win->_firstch[y], win->_lastch[y]); # endif if (win->_flags & _STANDOUT) c |= _STANDOUT; if (win->_y[y][x] != c) { if (win->_firstch[y] == _NOCHANGE) win->_firstch[y] = win->_lastch[y] = x; else if (x < win->_firstch[y]) win->_firstch[y] = x; else if (x > win->_lastch[y]) win->_lastch[y] = x; } win->_y[y][x++] = c; if (x >= win->_maxx) { x = 0; newline: if (++y >= win->_maxy) if (win->_scroll) { wrefresh(win); scroll(win); --y; } else return ERR; } # ifdef FULLDEBUG fprintf(outf, "ADDCH: 2: y = %d, x = %d, firstch = %d, lastch = %d\n", y, x, win->_firstch[y], win->_lastch[y]); # endif break; case '\n': wclrtoeol(win); if (!NONL) x = 0; goto newline; case '\r': x = 0; break; case '\b': if (--x < 0) x = 0; break; } win->_curx = x; win->_cury = y; return OK; } axx) lib/libcurses/addstr.c 444 0 33 502 2501350222 10163 # include "curses.ext" /* * This routine adds a string starting at (_cury,_curx) * * 1/26/81 (Berkeley) @(#)addstr.c 1.1 */ waddstr(win,str) reg WINDOW *win; reg char *str; { # ifdef DEBUG fprintf(outf, "WADDSTR(\"%s\")\n", str); # endif while (*str) if (waddch(win, *str++) == ERR) return ERR; return OK; } clrtoeol(win); if (!NONL) x = 0; goto newline; case '\r': x = 0; break; case '\b'/,5< /,"lib/libcurses/box.c 444 0 33 1203 2501350222 7511 # include "curses.h" /* * This routine draws a box around the given window with "vert" * as the vertical delimiting char, and "hor", as the horizontal one. * * 1/26/81 (Berkeley) @(#)box.c 1.1 */ box(win, vert, hor) reg WINDOW *win; char vert, hor; { reg int i; reg int endy, endx; reg char *fp, *lp; endx = win->_maxx; endy = win->_maxy - 1; fp = win->_y[0]; lp = win->_y[endy]; for (i = 0; i < endx; i++) fp[i] = lp[i] = hor; endx--; for (i = 0; i <= endy; i++) win->_y[i][0] = (win->_y[i][endx] = vert); if (!win->_scroll && (win->_flags&_SCROLLWIN)) fp[0] = fp[endx] = lp[0] = lp[endx] = ' '; touchwin(win); } or", as the horizontal one. * * 1/26/81 (Berkeley) @(#)box.c 1.1 */ box(win, vert, hor) reg WINDOW *win; char vert, hor; { reg int i; reg int endy, endx; reg char *fp, *lp; endx = win->_maxx; endy = win->_maxy - 1; fp = win->_y[0]; lp = win->_y[endy]; for (i = 0; i < endx; i++) fp[i] = lp[i] = hor; endx--; for (i = 0; i <= endy; i++) win->_y[i][0] = (win->_lib/libcurses/clear.c 444 0 33 625 2501350223 7777 # include "curses.ext" /* * This routine clears the window. * * 1/26/81 (Berkeley) @(#)clear.c 1.1 */ wclear(win) reg WINDOW *win; { if (win == curscr) { # ifdef DEBUG fprintf(outf,"WCLEAR: win == curscr\n"); fprintf(outf,"WCLEAR: curscr = %d\n",curscr); fprintf(outf,"WCLEAR: stdscr = %d\n",stdscr); # endif clear(); return refresh(); } werase(win); win->_clear = TRUE; return OK; } = 0; i < endx;/,5< /,"lib/libcurses/clrtobot.c 444 0 33 1405 2501350225 10560 # include "curses.ext" /* * This routine erases everything on the window. * * 1/26/81 (Berkeley) @(#)clrtobot.c 1.1 */ wclrtobot(win) reg WINDOW *win; { reg int y; reg char *sp, *end, *maxx; reg int startx, minx; startx = win->_curx; for (y = win->_cury; y < win->_maxy; y++) { minx = _NOCHANGE; end = &win->_y[y][win->_maxx]; for (sp = &win->_y[y][startx]; sp < end; sp++) if (*sp != ' ') { maxx = sp; if (minx == _NOCHANGE) minx = sp - win->_y[y]; *sp = ' '; } if (minx != _NOCHANGE) { if (win->_firstch[y] > minx || win->_firstch[y] == _NOCHANGE) win->_firstch[y] = minx; if (win->_lastch[y] < maxx - win->_y[y]) win->_lastch[y] = maxx - win->_y[y]; } startx = 0; } win->_curx = win->_cury = 0; } >_cury; y < win->_maxy; y++) { minx = _NOCHANGE; end = &win->_y[y][win->_maxx]; for (sp = &win->_y[y][startx]; sp < end; sp++) if (*sp != ' ') { maxx = sp; if (minx == _NOCHANGE) minx = sp - win->_y[y]; *sp = ' '; } if (lib/libcurses/clrtoeol.c 444 0 33 1574 2501350226 10563 # include "curses.ext" /* * This routine clears up to the end of line * * 3/5/81 (Berkeley) @(#)clrtoeol.c 1.2 */ wclrtoeol(win) reg WINDOW *win; { reg char *sp, *end; reg int y, x; reg char *maxx; reg int minx; y = win->_cury; x = win->_curx; end = &win->_y[y][win->_maxx]; minx = _NOCHANGE; maxx = &win->_y[y][x]; for (sp = maxx; sp < end; sp++) if (*sp != ' ') { maxx = sp; if (minx == _NOCHANGE) minx = sp - win->_y[y]; *sp = ' '; } /* * update firstch and lastch for t((he line */ # ifdef DEBUG fprintf(outf, "CLRTOEOL: minx = %d, maxx = %d, firstch = %d, lastch = %d\n", minx, maxx - win->_y[y], win->_firstch[y], win->_lastch[y]); # endif if (minx != _NOCHANGE) { if (win->_firstch[y] > minx || win->_firstch[y] == _NOCHANGE) win->_firstch[y] = minx; if (win->_lastch[y] < maxx - win->_y[y]) win->_lastch[y] = maxx - win->_y[y]; } } ' ') { maxx = sp; if (minx == _NOCHANGE) minx = sp - win->_y[y]; *sp = ' '; } /* * update firstch and lastch for tlib/libcurses/cr_ex.h 444 0 33 1133 2501350227 10035 /* Copyright (c) 1979 Regents of the University of California */ /* * Character constants and bits * * The editor uses the QUOTE bit as a flag to pass on with characters * e.g. to the putchar routine. The editor never uses a simple char variable. * Only arrays of and pointers to characters are used and parameters and * registers are never declared character. * * 1/26/81 (Berkeley) @(#)cr_ex.h 1.1 */ # define QUOTE 0200 # define TRIM 0177 # define CTRL(c) ('c' & 037) # define NL CTRL(j) # define CR CTRL(m) # define DELETE 0177 /* See also ATTN, QUIT in ex_tune.h */ # define ESCAPE 033 and bits * * The editor uses the QUOTE bit as a flag to pass on with characters * e.g. to the putchar routine. The editor never uses a simple char variable. * Only arrays of and pointers to characters are used and parameters and * registers are never declared character. * * 1/26/81 (Berkeley) @(#)cr_ex.h 1.1 */ # define QUOTE 0200 # define TRIM 0177 # define CTRL(c) ('c' & 037) # define NL CTRL(j) # define Clib/libcurses/cr_put.c 444 0 33 13242 2501350230 10242 # include "curses.ext" # include "cr_ex.h" # define HARDTABS 8 extern char *tgoto(); int plodput(); /* * Terminal driving and line formatting routines. * Basic motion optimizations are done here as well * as formatting of lines (printing of control characters, * line numbering and the like). * * 1/26/81 (Berkeley) @(#)cr_put.c 1.1 */ /* * Sync the position of the output cursor. * Most work here is rounding for terminal boundaries getting the * column position implied by wraparound or the lack thereof and * rolling up the screen to get destline on the screen. */ static int outcol, outline, destcol, destline, plodcnt; WINDOW *_win; mvcur(ly, lx, y, x) int ly, lx, y, x; { #ifdef DEBUG fprintf(outf, "MVCUR: moving cursor from (%d,%d) to (%d,%d)\n", ly, lx, y, x); #endif destcol = x; destline = y; outcol = lx; outline = ly; fgoto(); } fgoto() { reg char *cgp; reg int l, c; if (destcol > COLS - 1) { destline += destcol / COLS; destcol %= COLS; } if (outcol > COLS - 1) { l = (outcol + 1) / COLS; outline += l; outcol %= COLS; if (AM == 0) { while (l > 0) { putchar('\n'); if (_pfast) putchar('\r'); l--; } outcol = 0; } if (outline > LINES - 1) { destline -= outline - (LINES - 1); outline = LINES - 1; } } if (destline > LINES - 1) { l = destline; destline = LINES - 1; if (outline < LINES - 1) { c = destcol; if (_pfast == 0 && !CA) destcol = 0; fgoto(); destcol = c; } while (l > LINES - 1) { putchar('\n'); l--; if (_pfast == 0) outcol = 0; } } if (destline < outline && !(CA || UP != NULL)) destline = outline; cgp = tgoto(CM, destcol, destline); if (CA) if (plod(strlen(cgp)) > 0) plod(0); else tputs(cgp, 0, _putchar); else plod(0); outline = destline; outcol = destcol; } char _putchar(c) reg char c; { putchar(c); #ifdef DEBUG fprintf(outf, "_PUTCHAR(%s)\n", unctrl(c)); #endif } extern bool plodflg; extern int plodcnt; plod(cnt) int cnt; { reg int i, j, k; reg int soutcol, soutline; reg char c; plodcnt = plodflg = cnt; soutcol = outcol; soutline = outline; if (HO) { if (GT) i = (destcol / HARDTABS) + (destcol % HARDTABS); else i = destcol; if (destcol >= outcol) { j = destcol / HARDTABS - outcol / HARDTABS; if (GT && j) j += destcol % HARDTABS; else j = destcol - outcol; } else if (outcol - destcol <= i && (BS || BC)) i = j = outcol - destcol; else j = i + 1; k = outline - destline; if (k < 0) k = -k; j += k; if (i + destline < j) { tputs(HO, 0, plodput); outcol = outline = 0; } else if (LL) { k = (LINES - 1) - destline; if (i + k + 2 < j) { tputs(LL, 0, plodput); outcol = 0; outline = LINES - 1; } } } if (GT) i = destcol % HARDTABS + destcol / HARDTABS; else i = destcol; /* if (BT && outcol > destcol && (j = (((outcol+7) & ~7) - destcol - 1) >> 3)) { j *= (k = strlen(BT)); if ((k += (destcol&7)) > 4) j += 8 - (destcol&7); else j += k; } else */ j = outcol - destcol; /* * If we will later need a \n which will turn into a \r\n by * the system or the terminal, then don't bother to try to \r. */ if ((NONL || !_pfast) && outline < destline) goto dontcr; /* * If the terminal will do a \r\n and there isn't room for it, * then we can't afford a \r. */ if (NC && outline >= destline) goto dontcr; /* * If it will be cheaper, or if we can't back up, then send * a return preliminarily. */ if (j > i + 1 || outcol > destcol && !BS && !BC) { plodput('\r'); if (NC) { plodput('\n'); outline++; } outcol = 0; } dontcr: while (outline < destline) { outline++; plodput('\n'); if (plodcnt < 0) goto out; if (NONL || _pfast == 0) outcol = 0; } if (BT) k = strlen(BT); while (outcol > destcol) { if (plodcnt < 0) goto out; /* if (BT && outcol - destcol > 4+k) { tputs(BT, 0, plodput); outcol--; outcol &= ~7; continue; } */ outcol--; if (BC) tputs(BC, 0, plodput); else plodput('\b'); } while (outline > destline) { outline--; tputs(UP, 0, plodput); if (plodcnt < 0) goto out; } if (GT && destcol - outcol > 1) { for (;;) { i = (outcol / HARDTABS + 1) * HARDTABS; if (i > destcol) break; if (TA) tputs(TA, 0, plodput); else plodput('\t'); outcol = i; } if (destcol - outcol > 4 && i < COLS && (BC || BS)) { if (TA) tputs(TA, 0, plodput); else plodput('\t'); outcol = i; while (outcol > destcol) { outcol--; if (BC) tputs(BC, 0, plodput); else plodput('\b'); } } } while (outcol < destcol) { if (_win != NULL) if (plodflg) /* avoid a complex calculation */ plodcnt--; else { c = _win->_y[outline-_win->_begy][outcol-_win->_begx]; if ((c&_STANDOUT) == (curscr->_flags&_STANDOUT)) putchar(c); else goto nondes; } else nondes: if (ND) tputs(ND, 0, plodput); else plodput(' '); outcol++; if (plodcnt < 0) goto out; } out: if (plodflg) { outcol = soutcol; outline = soutline; } return(plodcnt); } /* * Move (slowly) to destination. * Hard thing here is using home cursor on really deficient terminals. * Otherwise just use cursor motions, hacking use of tabs and overtabbing * and backspace. */ static bool plodflg; plodput(c) reg char c; { if (plodflg) plodcnt--; else { putchar(c); #ifdef DEBUG fprintf(outf, "PLODPUT(%s)\n", unctrl(c)); #endif } } /* * Put with padding */ putpad(cp) reg char *cp; { fflush(stdout); #ifdef DEBUG fprintf(outf, "PUTPAD: _puts(\"%s\")\n", cp); #endif _puts(cp); } lowly) to destination. * Hard thing here is using home cursor on really deficient terminals. * Otherwise just use cursor motions, hacking use of tabs and overtabbing * and backspace. */ static bool plodflg; plodput(c) reg char c; { if (plodflg) plodcnt--; else { putchar(c); #ifdef DEBUG fprintf(outf, "PLODPUT(%s)\n", unctrl(c)); #endlib/libcurses/cr_tty.c 444 0 33 6445 2552502421 10250 /* * Terminal initialization routines. * * 5/15/81 (Berkeley) @(#)cr_tty.c 1.3 */ # undef DEBUG # include "curses.ext" # include "cr_ex.h" static bool *sflags[] = { &AM, &BS, &EO, &HZ, &IN, &MI, &MS, &NC, &OS, &UL, &XN }; static char *xPC, **sstrs[] = { &AL, &BC, &BT, &CD, &CE, &CL, &CM, &DC, &DL, &DM, &DO, &ED, &EI, &HO, &IC, &IM, &IP, &LL, &MA, &ND, &xPC, &SE, &SF, &SO, &SR, &TA, &TE, &TI, &UC, &UE, &UP, &US, &VB, &VS, &VE }, *tgoto(); static char tspace[128], /* Space for capability strings */ *aoftspace; /* Address of tspace for relocation */ static int destcol, destline; /* * This routine does terminal type initialization routines, and * calculation of flags at entry. It is almost entirely stolen from * Bill Joy's ex version 2.6. */ short ospeed = -1; gettmode() { if (gtty(_tty_ch, &_tty) < 0) return; savetty(); if (stty(_tty_ch, &_tty) < 0) _tty.sg_flags = _res_flg; ospeed = _tty.sg_ospeed; _res_flg = _tty.sg_flags; UPPERCASE = (_tty.sg_flags & L((CASE) != 0; GT = ((_tty.sg_flags & XTABS) == 0); NONL = ((_tty.sg_flags & CRMOD) == 0); # ifdef DEBUG fprintf(outf, "GETTMODE: UPPERCASE = %s\n", UPPERCASE ? "TRUE":"FALSE"); fprintf(outf, "GETTMODE: GT = %s\n", GT ? "TRUE" : "FALSE"); fprintf(outf, "GETTMODE: NONL = %s\n", NONL ? "TRUE" : "FALSE"); fprintf(outf, "GETTMODE: ospeed = %d\n", ospeed); # endif } setterm(type) reg char *type; { reg int unknown; char genbuf[1024]; # ifdef DEBUG fprintf(outf, "SETTERM(\"%s\")\n", type); fprintf(outf, "SETTERM: LINES = %d, COLS = %d\n", LINES, COLS); # endif if (type[0] == '\0') type = "xx"; unknown = FALSE; if (tgetent(genbuf, type) != 1) { unknown++; strcpy(genbuf, "xx|dumb:"); } # ifdef DEBUG fprintf(outf, "SETTERM: tty = %s\n", type); # endif if (LINES == 0) LINES = tgetnum("li"); if (LINES <= 5) LINES = 24; else if (LINES > 48) LINES = 48; if (COLS == 0) COLS = tgetnum("co"); if (COLS <= 4) COLS = 80; else if (COLS > 1000) COLS = 1000; # ifdef DEBUG fprintf(outf, "SETTERM: LINES = %d, COLS = %d\n", LINES, COLS); # endif aoftspace = tspace; zap(); /* get terminal description */ if (tgoto(CM, destcol, destline)[0] == 'O') CA = FALSE, CM = 0; else CA = TRUE; PC = xPC ? xPC[0] : FALSE; aoftspace = tspace; strcpy(ttytype, longname(genbuf, type)); if (unknown) return ERR; return OK; } /* * This routine gets all the terminal falgs from the termcap database */ zap() { reg bool **fp; reg char *namp, ***sp; extern char *tgetstr(); /* * get boolean flags */ namp = "ambseohzinmimsncosulxn\0\0"; # ifdef FULLDEBUG fprintf(outf, "ZAP: namp = \"%s\"\n", namp); # endif fp = sflags; do { *(*fp++) = tgetflag(namp); # ifdef FULLDEBUG fprintf(outf, "ZAP: %.2s = %d", namp, *(*(fp - 1))); # endif namp += 2; } while (*namp); /* * get string values */ namp = "albcbtcdceclcmdcdldmdoedeihoicimipllmandpcsesfsosrtatetiucueupusvbvsve"; # ifdef FULLDEBUG fprintf(outf, "ZAP: namp = \"%s\"\n", namp); # endif sp = sstrs; do { *(*sp++) = tgetstr(namp, &aoftspace); # ifdef FULLDEBUG fprintf(outf, "ZAP: %.2s = \"%s\"\n", namp, *(*(sp-1))); # endif namp += 2; } while (*namp); if (!SO && US) { SO = US; SE = UE; } } /* * get a string capability from the entry */ char * getcap(name) char *name; { return tgetstr(name, &aoftspace); } ring values */ namp = "albcbtcdceclcmdcdldmdoedeihoicimipllmandpcsesfsosrtatetiucueupusvbvsve"; # ifdef FULLDEBUG fprintf(outf, "ZAP: namp = \"%s\"\n", namp); # endif sp = sstrs; do { *(*sp++) = tgetstr(namp, &alib/libcurses/curses.c 444 0 33 2026 2501350233 10233 /* * Define global variables * * 3/5/81 (Berkeley) @(#)curses.c 1.2 */ # include "curses.h" bool _echoit = TRUE, /* set if stty indicates ECHO */ _rawmode = FALSE,/* set if stty indicates RAW mode */ My_term = FALSE,/* set if user specifies terminal type */ _endwin = FALSE;/* set if endwin has been called */ char ttytype[10], /* long name of tty */ *Def_term = "unknown"; /* default terminal type */ int _tty_ch = 1, /* file channel which is a tty */ LINES, /* number of lines allowed on screen */ COLS, /* number of columns allowed on screen */ _res_flg; /* sgtty flags for reseting later */ WINDOW *stdscr = NULL, *curscr = NULL; # ifdef DEBUG FILE *outf; /* debug output file */ # endif SGTTY _tty; /* tty modes */ bool AM, BS, CA, DA, DB, EO, GT, HZ, IN, MI, MS, NC, OS, UL, XN, NONL, UPPERCASE, normtty, _pfast; char *AL, *BC, *BT, *CD, *CE, *CL, *CM, *DC, *DL, *DM, *DO, *ED, *EI, *HO, *IC, *IM, *IP, *LL, *MA, *ND, *SE, *SF, *SO, *SR, *TA, *TE, *TI, *UC, *UE, *UP, *US, *VB, *VE, *VS, PC; number of columns allowed on screen */ _res_flg; /* sgtty flags for reseting later */ WINDOW *stdscr = NULL, *curscr = NULL; # ifdef DEBUG FILE *outf; /* debug output file */ # endif SGTTY _tty; /* tty modes */ bool AM, BS, CA, DA, DB, EO, GT, HZ, IN, MI, MS, NC, OS, UL, XN, NONL, UPPERCASE, normtty, _pfast; char *AL, *BC, *BT, *CD, *CE, *CL, *CM, *DC, *DL, *DM, *DO, *ED, *EI, *HO, *IC, *IM, *IP, *LL, *MA, *ND, *SE, *SF, *SO, *SR, *TA, *TE, *TI, *UC, *UE, *UP, *Ulib/libcurses/curses.h 444 0 33 10264 2552502421 10267 /* 5/15/81 (Berkeley) @(#)curses.h 1.8 */ # ifndef WINDOW # include # include # define bool char # define reg register # define TRUE (1) # define FALSE (0) # define ERR (0) # define OK (1) # define _SUBWIN 01 # define _ENDLINE 02 # define _FULLWIN 04 # define _SCROLLWIN 010 # define _FLUSH 020 # define _STANDOUT 0200 # define _NOCHANGE -1 # define _puts(s) tputs(s, 0, _putchar); typedef struct sgttyb SGTTY; /* * Capabilities from termcap */ extern bool AM, BS, CA, DA, DB, EO, GT, HZ, IN, MI, MS, NC, OS, UL, XN; extern char *AL, *BC, *BT, *CD, *CE, *CL, *CM, *DC, *DL, *DM, *DO, *ED, *EI, *HO, *IC, *IM, *IP, *LL, *MA, *ND, *SE, *SF, *SO, *SR, *TA, *TE, *TI, *UC, *UE, *UP, *US, *VB, *VE, *VS, PC; /* * From the tty modes... */ extern bool NONL, UPPERCASE, normtty, _pfast; struct _win_st { short _cury, _curx; short _maxy, _maxx; short _begy, _begx; short _flags; bool _clear; bool _leave; bool _scroll; char **_y; short *_firstch; short *_lastch; }; # define WINDOW struct _win_st extern bool My_term, _echoit, _rawmode, _endwin; extern char *Def_term, ttytype[]; extern int LINES, COLS, _tty_ch, _res_flg; extern SGTTY _tty; extern WINDOW *stdscr, *curscr; /* * Define VOID to stop lint from generating "null effect" * comments. */ # ifdef lint int __void__; # define VOID(x) (__void__ = (int) (x)) # else # define VOID(x) (x) # endif /* * psuedo functions for standard screen */ # define addch(ch) VOID(waddch(stdscr, ch)) # define getch() VOID(wgetch(stdscr)) # define addstr(str) VOID(waddstr(stdscr, str)) # define getstr(str) VOID(wgetstr(stdscr, str)) # define move(y, x) VOID(wmove(stdscr, y, x)) # define clear() VOID(wclear(stdscr)) # define erase() VOID(werase(stdscr)) # define clrtobot() VOID(wclrtobot(stdscr)) # define clrtoeol() VOID(wclrtoeol(stdscr)) # define insertln() VOID(winsertln(stdscr)) # define deleteln() VOID(wdeleteln(stdscr)) # define refresh() VOID(wrefresh(stdscr)) # define inch() VOID(winch(stdscr)) # define insch(c) VOID(winsch(stdscr,c)) # define delch() VOID(wdelch(stdscr)) # define standout() VOID(wstandout(stdscr)) # define standend() VOID(wstandend(stdscr)) /* * mv functions */ #define mvwaddch(win,y,x,ch) VOID(wmove(win,y,x)==ERR?ERR:waddch(win,ch)) #define mvwgetch(win,y,x) VOID(wmove(win,y,x)==ERR?ERR:wgetch(win)) #define mvwaddstr(win,y,x,str) VOID(wmove(win,y,x)==ERR?ERR:waddstr(win,str)) #define mvwgetstr(win,y,x) VOID(wmove(win,y,x)==ERR?ERR:wgetstr(win)) #define mvwinch(win,y,x) VOID(wmove(win,y,x) == ERR ? ERR : winch(win)) #define mvwdelch(win,y,x) VOID(wmove(win,y,x) == ERR ? ERR : wdelch(win)) #define mvwinsch(win,y,x,c) VOID(wmove(win,y,x) == ERR ? ERR:winsch(win,c)) #define mvaddch(y,x,ch) mvwaddch(stdscr,y,x,ch) #define mvgetch(y,x) mvwgetch(stdscr,y,x) #define mvaddstr(y,x,str) mvwaddstr(stdscr,y,x,str) #define mvgetstr(y,x) mvwgetstr(stdscr,y,x) #define mvinch(y,x) mvwinch(stdscr,y,x) #define mvdelch(y,x) mvwdelch(stdscr,y,x) #define mvinsch(y,x,c) mvwinsch(stdscr,y,x,c) /* * psuedo functions */ #define clearok(win,bf) (win->_clear = bf) #define leaveok(win,bf) (win->_leave = bf) #define scrollok(win,bf) (win->_scroll = bf) #define flushok(win,bf) (bf ? (win->_flags |= _FLUSH):(win->_flags &= ~_FLUSH)) #define getyx(win,y,x) y = win->_cury, x = win->_curx #define winch(win) (win->_y[win->_cury][win->_curx]) #define raw() (_tty.sg_flags|=RAW, _pfast=_rawmode=TRUE, stty(_tty_ch,&_tty)) #define noraw() (_tty.sg_flags&=~RAW,_rawmode=FALSE,_pfast=!(_tty.sg_flags&CRMOD),stty(_tty_ch,&_tty)) #define crmode() (_tty.sg_flags |= CBREAK, _rawmode = TRUE, stty(_tty_ch,&_tty)) #define nocrmode() (_tty.sg_flags &= ~CBREAK,_rawmode=FALSE,stty(_tty_ch,&_tty)) #define echo() (_tty.sg_flags |= ECHO, _echoit = TRUE, stty(_tty_ch, &_tty)) #define noecho() (_tty.sg_flags &= ~ECHO, _echoit = FALSE, stty(_tty_ch, &_tty)) #define nl() (_tty.sg_flags |= CRMOD,_pfast = _rawmode,stty(_tty_ch, &_tty)) #define nonl() (_tty.sg_flags &= ~CRMOD, _pfast = TRUE, stty(_tty_ch, &_tty)) #define savetty() (gtty(_tty_ch, &_tty), _res_flg = _tty.sg_flags) #define resetty() (_tty.sg_flags = _res_flg, stty(_tty_ch, &_tty)) WINDOW *initscr(), *newwin(), *subwin(); char *longname(), *getcap(); # endif tty.sg_flags |= ECHO, _echoit = TRUE, stty(_tty_ch, &_tty)) #define noecho() (_tty.sg_flags &= ~ECHO, _echoit = FALSE, stty(_tty_ch, &_tty)) #define nl() (_tty.sg_flags |= CRMOD,_pfast = _rawmode,stty(_tty_ch, &_tty)) #define nonl() (_tty.sg_flags &= ~CRMOD, _pfast = TRUE, stty(_tty_ch, &_tty)) #define savetty() (gtty(_tty_ch, &lib/libcurses/longname.c 444 0 33 1017 2552502422 10533 ((# define reg register /* * This routine returns the long name of the terminal or "def" * if none can be found. * * 5/15/81 (Berkeley) @(#)longname.c 1.2 */ char * longname(bp, def) reg char *bp, *def; { reg char *cp; static char ttytype[20]; char save; while (*bp && *bp != ':' && *bp != '|') bp++; if (*bp == '|') { bp++; cp = bp; while (*cp && *cp != ':' && *cp != '|') cp++; save = *cp; *cp = 0; strcpy(ttytype, bp); *cp = save; return ttytype; } strcpy(ttytype, def); return ttytype; } gister /* * This routine returns the long name of the terminal or "def" * if none can be found. * * 5/15/81 (Berkeley) @(#)longname.c 1.2 */ char * longname(bp, def) reg char *bp, *def; { reg char *cp; static char ttytype[20]; char save; while (*bp && *bp != ':' && *bp != '|') bp++; if (*bp == '|') { bp++; cp = bp; while (*cp && *cp != ':' && *cp != '|') cp++; save = *cp; *cp = 0; strcpy(ttytype, bp); *cp = save; return ttytype; } strcpy(ttytype, def); retlib/libcurses/delwin.c 444 0 33 501 2517262757 10211 # include "curses.ext" /* * This routine deletes a window and releases it back to the system. * * 1/26/81 (Berkeley) @(#)delwin.c 1.1 */ delwin(win) reg WINDOW *win; { reg int i; if (!(win->_flags & _SUBWIN)) for (i = 0; i < win->_maxy && win->_y[i]; i++) cfree(win->_y[i]); cfree(win->_y); cfree(win); } == '|') { bp++; cp = bp; while (*cp && *cp != ':' && *cp != '|') cp++; save = *cp; *c/,58< /,"lib/libcurses/endwin.c 444 0 33 412 2501350240 10166 /* * Clean things up before exiting * * 1/26/81 (Berkeley) %W */ # include "curses.ext" endwin() { resetty(); _puts(VE); _puts(TE); if (curscr) { if (curscr->_flags & _STANDOUT) { _puts(SE); curscr->_flags &= ~_STANDOUT; } _endwin = TRUE; } } cfree(win->_y[i]); cfree(win->_y); cfree(win); } == '|') { bp++; cp = bp; while (*cp && *cp != ':' && *cp != '|') cp++; save = *cp; *c/,5H< /,"lib/libcurses/erase.c 444 0 33 1416 2501350242 10030 # include "curses.ext" /* * This routine erases everything on the window. * * 1/27/81 (Berkeley) @(#)erase.c 1.2 */ werase(win) reg WINDOW *win; { reg int y; reg char *sp, *end, *start, *maxx; reg int minx; # ifdef DEBUG fprintf(outf, "WERASE(%0.2o)\n", win); # endif for (y = 0; y < win->_maxy; y++) { minx = _NOCHANGE; start = win->_y[y]; end = &start[win->_maxx]; for (sp = start; sp < end; sp++) if (*sp != ' ') { maxx = sp; if (minx == _NOCHANGE) minx = sp - start; *sp = ' '; } if (minx != _NOCHANGE) { if (win->_firstch[y] > minx || win->_firstch[y] == _NOCHANGE) win->_firstch[y] = minx; if (win->_lastch[y] < maxx - win->_y[y]) win->_lastch[y] = maxx - win->_y[y]; } } win->_curx = win->_cury = 0; } ); # endif for (y = 0; y < win->_maxy; y++) { minx = _NOCHANGE; start = win->_y[y]; end = &start[win->_maxx]; for (sp = start; sp < end; sp++) if (*sp != ' ') { maxx = sp; if (minx == _NOCHANGE) minx = sp - start; lib/libcurses/getch.c 444 0 33 1331 2552502421 10023 # include "curses.ext" /* * This routine reads in a character from the window. * * 7/8/81 (Berkeley) @(#)getch.c 1.2 */ wgetch(win) reg WINDOW *win; { reg bool weset = FALSE; reg char inp; if (!win->_scroll && (win->_flags&_FULLWIN) && win->_curx == win->_maxx && win->_cury == win->_maxy) return ERR; # ifdef DEBUG fprintf(outf, "WGETCH: _echoit = %c, _rawmode = %c\n", _echoit ? 'T' : 'F', _rawmode ? 'T' : 'F'); # endif if (_echoit && !_rawmode) { raw(); weset++; } inp = getchar(); # ifdef DEBUG fprintf(outf,"WGETCH got '%s'\n",unctrl(inp)); # endif if (_echoit) { mvwaddch(curscr, win->_begy+win->_cury, win->_begx+win->_curx, inp); waddch(win, inp); } if (weset) noraw(); return inp; } && (win->_flags&_FULLWIN) && win->_curx == win->_maxx && win->_cury == win->_maxy) return ERR; # ifdef DEBUG fprintf(outf, "WGETCH: _echoit = %c, _rawmode = %c\n", _echoit ? 'T' : 'F', _rawmode ? 'T' : 'F'); # endif if (_echoit && !_rawmode) { raw(); weset++; } inp = getchar(); #lib/libcurses/getstr.c 444 0 33 503 2552502422 10222 # include "curses.ext" /* * This routine gets a string starting at (_cury,_curx) * * 7/2/81 (Berkeley) @(#)getstr.c 1.4 */ wgetstr(win,str) reg WINDOW *win; reg char *str; { while ((*str = wgetch(win)) != ERR && *str != '\n') str++; if (*str == ERR) { *str = '\0'; return ERR; } *str = '\0'; return OK; } def DEBUG fprintf(outf, "WGETCH: _echoit = %c, _rawmode = %c\n", _echoit ? 'T' : 'F', _rawmode ?/,5x< /,"lib/libcurses/initscr.c 444 0 33 2017 2501400427 10403 # include "curses.ext" # include extern char *getenv(); /* * This routine initializes the current and standard screen. * * 3/5/81 (Berkeley) @(#)initscr.c 1.2 */ WINDOW * initscr() { reg char *sp; int tstp(); # ifdef DEBUG fprintf(outf, "INITSCR()\n"); # endif if (!My_term && isatty(2)) { _tty_ch = 2; gettmode(); if ((sp = getenv("TERM")) == NULL) sp = Def_term; setterm(sp); # ifdef DEBUG fprintf(outf, "INITSCR: term = %s\n", sp); # endif } else setterm(Def_term); _puts(TI); _puts(VS); # ifdef SIGTSTP signal(SIGTSTP, tstp); # endif if (curscr != NULL) { # ifdef DEBUG fprintf(outf, "INITSCR: curscr = 0%o\n", curscr); # endif delwin(curscr); } # ifdef DEBUG fprintf(outf, "LINES = %d, COLS = %d\n", LINES, COLS); # endif if ((curscr = newwin(LINES, COLS, 0, 0)) == ERR) return ERR; curscr->_clear = TRUE; if (stdscr != NULL) { # ifdef DEBUG fprintf(outf, "INITSCR: stdscr = 0%o\n", stdscr); # endif delwin(stdscr); } stdscr = newwin(LINES, COLS, 0, 0); return stdscr; } s(VS); # ifdef SIGTSTP signal(SIGTSTP, tstp); # endif if (curscr != NULL) { # ifdef DEBUG fprintf(outf, "INITSCR: curscr = 0%o\n", curscr); # endif delwin(curscr); } # ifdef DEBUG fprintf(outf, "LINES = %d, COLS = %d\n", LINES, COLS); # endif if ((curscr = newwin(LINES, COLS, 0, 0)) == ERR) return ERR; curscr->_clear = TRUE; if (stdscr != NULL) { # ifdef DEBUG fprintf(outf, "INITSCR: stdscr = 0%o\n", stdscr); # endif delwin(stdscr); } stdscr = newwin(LINES, COLS, 0, 0); relib/libcurses/insertln.c 444 0 33 1412 2517262762 10603 # include "curses.ext" /* * This routine performs an insert-line on the window, leaving * (_cury,_curx) unchanged. * * 4/17/81 (Berkeley) @(#)insertln.c 1.4 */ winsertln(win) reg WINDOW *win; { reg char *temp; reg int y; reg char *end; temp = win->_y[win->_maxy-1]; win->_firstch[win->_cury] = 0; win->_lastch[win->_cury] = win->_maxx - 1; for (y = win->_maxy - 1; y > win->_cury; --y) { win->_y[y] = win->_y[y-1]; win->_firstch[y] = 0; win->_lastch[y] = win->_maxx - 1; } for (end = &tem((p[win->_maxx]; temp < end; ) *temp++ = ' '; win->_y[win->_cury] = temp - win->_maxx; if (win->_cury == LINES - 1 && win->_y[LINES-1][COLS-1] != ' ') if (win->_scroll) { wrefresh(win); scroll(win); win->_cury--; } else return ERR; return OK; } n->_maxy-1]; win->_firstch[win->_cury] = 0; win->_lastch[win->_cury] = win->_maxx - 1; for (y = win->_maxy - 1; y > win->_cury; --y) { win->_y[y] = win->_y[y-1]; win->_firstch[y] = 0; win->_lastch[y] = win->_maxx - 1; } for (end = &temlib/libcurses/llib-lcurses 444 0 33 5534 2552502422 11122 /* 5/15/81 (Berkely) @(#)llib-lcurses 1.4 */ /* LINTLIBRARY */ # include static char *sp; static WINDOW *wp; char _putchar(c) char c; { return c; } /* VARARGS2 */ int _sprintw(win, fmt, args) WINDOW *win; char *fmt; { return 0; } /* VARARGS2 */ int _sscans(win, fmt, args) WINDOW *win; char *fmt; { return 0; } box(win, vert, hor) WINDOW *win; int vert, hor; {} delwin(win) WINDOW *win; {} endwin() {} fgoto() {} gettmode() {} char *getcap(name) char *name; { return name; } WINDOW *initscr() { return wp; } char *longname(bp, def) char *bp ,*def; { return sp; } mvcur(ly, lx, y, x) int ly, lx, y, x; {} /* VARARGS3 */ int mvprintw(y, x, fmt, args) int y, x; char *fmt; { return 0; } /* VARARGS3 */ int mvscanw(y, x, fmt, args) int y, x; char *fmt; { return 0; } int mvwin(win, by, bx) WINDOW *win; { return 0; } /* VARARGS4 */ int mvwprintw(win, y, x, fmt, args) WINDOW *win; int y, x; char *fmt; { return 0; } /* VARARGS4 */ int mvwscanw(win, y, x, fmt, args) WINDOW *win; int y, x; char *fmt; { return 0; } WINDOW *newwin(num_lines, num_cols, begy, begx) int num_lines, num_cols, begy, begx; { return wp; } overlay(win1, win2) WINDOW *win1, *win2; {} overwrite(win1, win2) WINDOW *win1, *win2; {} int plod(cnt) int cnt; { return 0; } plodput(c) char c; {} /* VARARGS1 */ int printw(fmt, args) char *fmt; { return 0; } /* VARARGS1 */ putpad(cp) char *cp; {} int scanw(fmt, args) char *fmt; { return 0; } int scroll(win) WINDOW *win; { return 0; } int setterm(type) char *type; { return 0; } WINDOW *subwin(orig, num_lines, num_cols, begy, begx) WINDOW *orig; int num_lines, num_cols, begy, begx; { return wp; } touchwin(win) WINDOW *win; {} tstp() {} int waddch(win, c) WINDOW *win; char c; { return 0; } int waddstr(win, str) WINDOW *win; char *str; { return 0; } int wclear(win) WINDOW *win; { return 0; } wclrtobot(win) WINDOW *win; {} wclrtoeol(win) WINDOW *win; {} wdeleteln(win) WINDOW *win; {} werase(win) WINDOW *win; {} int wgetch(win) WINDOW *win; { return 0; } int wgetstr(win, str) WINDOW *win; char *str; { return 0; } winsertln(win) WINDOW *win; {} int wmove(win, y, x) WINDOW *win; int y, x; { return 0; } /* VARARGS2 */ int wprintw(win, fmt, args) WINDOW *win; char *fmt; { return 0; } /* VARARGS2 */ int wrefresh(win) WINDOW *win; { return 0; } int wscanw(win, fmt, args) WINDOW *win; char *fmt; { return 0; } char *wstandend(win) WINDOW *win; { return sp; } char *wstandout(win) WINDOW *win; { return sp; } zap() {} bool AM, BS, CA, DA, DB, EO, GT, HZ, IN, MI, MS, NC, OS, UL, XN, NONL, UPPERCASE, normtty, _pfast, My_term, _echoit, _rawmode, _endwin; char *AL, *BC, *BT, *CD, *CE, *CL, *CM, *DC, *DL, *DM, *DO, *ED, *EI, *HO, *IC, *IM, *IP, *LL, *MA, *ND, *SE, *SF, *SO, *SR, *TA, *TE, *TI, *UC, *UE, *UP, *US, *VB, *VE, *VS, PC, *Def_term, ttytype[]; int LINES, COLS, _tty_ch, _res_flg; SGTTY _tty; WINDOW *stdscr, *curscr; ) WINDOW *win; { return sp; } char *wstandout(win) WINDOW *win; { return sp; } zap() {} bool AM, BS, CA, DA, DB, EO, GT, HZ, IN, MI, MS, NC, OS, UL, XN, NONL, lib/libcurses/deleteln.c 444 0 33 1006 2517262764 10542 # include "curses.ext" /* * This routine deletes a line from the screen. It leaves * (_cury,_curx) unchanged. * * 4/16/81 (Berkeley) @(#)deleteln.c 1.3 */ wdeleteln(win) reg WINDOW *win; { reg char *temp; reg int y; reg char *end; temp = win->_y[win->_cury]; for (y = win->_cury; y < win->_maxy; y++) { win->_y[y] = win->_y[y+1]; win->_firstch[y] = 0; win->_lastch[y] = win->_maxx - 1; } for (end = &temp[win->_maxx]; temp < end; ) *temp++ = ' '; win->_y[win->_maxy-1] = temp - win->_maxx; } ude "curses.ext" /* * This routine deletes a line from the screen. It leaves * (_cury,_curx) unchanged. * * 4/16/81 (Berkeley) @(#)deleteln.c 1.3 */ wdeleteln(win) reg WINDOW *win; { reg char *temp; reg int y; reg char *end; temp = win->_y[win->_cury]; for (y = win->_cury; y < win->_maxy; y++) { win->_y[y] = win->_y[y+1]; win->_firstch[y] = 0; win->_lastch[y] = win->_maxx - 1; } for (end = &temp[win->_maxx]; temp < end; ) *temp++ = ' '; win->_y[win->_maxy-1] = temp - win->_malib/libcurses/move.c 444 0 33 530 2501350252 7654 # include "curses.ext" /* * This routine moves the cursor to the given point * * 1/26/81 (Berkeley) @(#)move.c 1.1 */ wmove(win, y, x) reg WINDOW *win; reg int y, x; { # ifdef DEBUG fprintf(outf, "MOVE to (%d, %d)\n", y, x); # endif if (x >= win->_maxx || y >= win->_maxy) return ERR; win->_curx = x; win->_cury = y; return OK; } ]; win->_firstch[y] = 0; win->_lastch[y] = win->_maxx - 1; } for (end /,5ȇ< /,"lib/libcurses/mvprintw.c 444 0 33 741 2501350253 10601 # include "curses.ext" /* * implement the mvprintw commands. Due to the variable number of * arguments, they cannot be macros. Sigh.... * * 1/26/81 (Berkeley) @(#)mvprintw.c 1.1 */ mvprintw(y, x, fmt, args) reg int y, x; char *fmt; int args; { return move(y, x) == OK ? _sprintw(stdscr, fmt, &args) : ERR; } mvwprintw(win, y, x, fmt, args) reg WINDOW *win; reg int y, x; char *fmt; int args; { return wmove(win, y, x) == OK ? _sprintw(win, fmt, &args) : ERR; } ,"lib/libcurses/mvscanw.c 444 0 33 743 2501350255 10375 # include "curses.ext" /* * implement the mvscanw commands. Due to the variable number of * arguments, they cannot be macros. Another sigh.... * * 1/26/81 (Berkeley) @(#)mvscanw.c 1.1 */ mvscanw(y, x, fmt, args) reg int y, x; char *fmt; int args; { return move(y, x) == OK ? _sscanw(stdscr, fmt, &args) : ERR; } mvwscanw(win, y, x, fmt, args) reg WINDOW *win; reg int y, x; char *fmt; int args; { return wmove(win, y, x) == OK ? _sscanw(win, fmt, &args) : ERR; } ,"lib/libcurses/mvwin.c 444 0 33 467 2501350256 10063 # include "curses.ext" /* * relocate the starting position of a window * * 1/26/81 (Berkeley) @(#)mvwin.c 1.1 */ mvwin(win, by, bx) reg WINDOW *win; reg int by, bx; { if (by + win->_maxy > LINES || bx + win->_maxx > COLS) return ERR; win->_begy = by; win->_begx = bx; touchwin(win); return OK; } args) : ERR; } mvwscanw(win, y, x, fmt, args) reg WINDOW *win; reg int y, x; char *fmt; int args; { ret/,5< /,"lib/libcurses/newwin.c 444 0 33 7011 2501350260 10235 ((/* * allocate space for and set up defaults for a new window * * 1/26/81 (Berkeley) %W */ # include "curses.ext" short *calloc(); WINDOW *malloc(); static WINDOW *makenew(); # undef nl /* don't need it here, and it interferes */ WINDOW * newwin(num_lines, num_cols, begy, begx) int num_lines, num_cols, begy, begx; { reg WINDOW *win; reg char *sp; reg int i, by, bx, nl, nc; by = begy; bx = begx; nl = num_lines; nc = num_cols; if (nl == 0) nl = LINES - by; if (nc == 0) nc = COLS - bx; if ((win = makenew(nl, nc, by, bx)) == NULL) return ERR; for (i = 0; i < nl; i++) if ((win->_y[i] = (char *) calloc(nc, sizeof (char))) == NULL) { reg int j; for (j = 0; j < i; j++) cfree(win->_y[j]); cfree(win->_firstch); cfree(win->_lastch); cfree(win->_y); cfree(win); return ERR; } else for (sp = win->_y[i]; sp < win->_y[i] + nc; ) *sp++ = ' '; return win; } WINDOW * subwin(orig, num_lines, num_cols, begy, begx) reg WINDOW *orig; int num_lines, num_cols, begy, begx; { reg int i; reg WINDOW *win; reg int by, bx, nl, nc; reg int j, k; by = begy; bx = begx; nl = num_lines; nc = num_cols; /* * make sure window fits inside the original one */ # ifdef DEBUG fprintf(outf, "SUBWIN(%0.2o, %d, %d, %d, %d)\n", orig, nl, nc, by, bx); # endif if (by < orig->_begy || bx < orig->_begx || by + nl > orig->_maxy || bx + nc > orig->_maxx) return ERR; if (nl == 0) nl = orig->_maxy - orig->_begy - by; if (nc == 0) nc = orig->_maxx - orig->_begx - bx; if ((win = makenew(nl, nc, by, bx)) == NULL) return ERR; j = orig->_begy + by; k = orig->_begx + bx; for (i = 0; i < nl; i++) win->_y[i] = &orig->_y[j++][k]; win->_flags = _SUBWIN; return win; } /* * This routine sets up a window buffer and returns a pointer to it. */ static WINDOW * makenew(num_lines, num_cols, begy, begx) int num_lines, num_cols, begy, begx; { reg int i; reg WINDOW *win; reg int by, bx, nl, nc; by = begy; bx = begx; nl = num_lines; nc = num_cols; # ifdef DEBUG fprintf(outf, "MAKENEW(%d, %d, %d, %d)\n", nl, nc, by, bx); # endif if ((win = (WINDOW *) malloc(sizeof (WINDOW))) == NULL) return NULL; # ifdef DEBUG fprintf(outf, "MAKENEW: nl = %d\n", nl); # endif if ((win->_y = (char **) calloc(nl, sizeof (char *))) == NULL) { cfree(win); return (WINDOW *) NULL; } if ((win->_firstch = calloc(nl, sizeof (short))) == NULL) { cfree(win); cfree(win->_y); } if ((win->_lastch = calloc(nl, sizeof (short))) == NULL) { cfree(win); cfree(win->_y); cfree(win->_firstch); } # ifdef DEBUG fprintf(outf, "MAKENEW: nc = %d\n", nc); # endif win->_cury = win->_curx = 0; win->_clear = (nl == LINES && nc == COLS); win->_maxy = nl; win->_maxx = nc; win->_begy = by; win->_begx = bx; win->_scroll = win->_leave = FALSE; for (i = 0; i < nl; i++) win->_firstch[i] = win->_lastch[i] = _NOCHANGE; if (bx + nc == COLS) { win->_flags |= _ENDLINE; if (bx == 0 && nl == LINES && by == 0) win->_flags |= _FULLWIN; if (by + nl == LINES) win->_flags |= _SCROLLWIN; } # ifdef DEBUG fprintf(outf, "MAKENEW: win->_clear = %d\n", win->_clear); fprintf(outf, "MAKENEW: win->_leave = %d\n", win->_leave); fprintf(outf, "MAKENEW: win->_scroll = %d\n", win->_scroll); fprintf(outf, "MAKENEW: win->_flags = %0.2o\n", win->_flags); fprintf(outf, "MAKENEW: win->_maxy = %d\n", win->_maxy); fprintf(outf, "MAKENEW: win->_maxx = %d\n", win->_maxx); fprintf(outf, "MAKENEW: win->_begy = %d\n", win->_begy); fprintf(outf, "MAKENEW: win->_begx = %d\n", win->_begx); # endif return win; } ifdef DEBUG fprintf(outf, "MAKENEW: win->_clear = %d\n", win->_clear); fprintf(outf, "MAKENEW: win->_leave = %d\n", win->_leave); fprintf(outf, "MAKENEW: win->_scroll = %d\n", win->_scroll); fprintf(outf, "MAKENEW: win->_flags = %0.2o\n", win->_flags); fprintf(outf, "MAKENEW: win->_maxy = %d\n", win->_maxy); fprintf(outf, "MAKENEW: win->_maxx = %d\n", win->_maxx); fprintf(outf, "MAKENEW: win->_begy = %d\n", win->_begy); fprintf(outf, "MAKENEW: win->_begx = %d\n", win->_begx); # endif returlib/libcurses/overlay.c 444 0 33 1674 2501350261 10421 # include "curses.h" # include # define min(a,b) (a < b ? a : b) # define max(a,b) (a < b ? a : b) /* * This routine writes win1 on win2 non-destructively. * * 1/26/81 (Berkeley) @(#)overlay.c 1.1 */ overlay(win1, win2) reg WINDOW *win1, *win2; { reg char *sp, *end; reg int x, y, endy, endx, starty, startx, y_top, y_bot, x_left, x_right; # ifdef DEBUG fprintf(outf, "OVERLAY(%0.2o, %0.2o);\n", win1, win2); # endif y_top = max(win1->_begy, win2->_begy); y_bot = min(win1->_maxy, win2->_maxy); x_left = max(win1->_begx, win2->_begx); x_right = min(win1->_maxx, win2->_maxx); starty = y_top - win1->_begy; startx = x_left - win1->_begx; endy = y_bot - win1->_begy; endx = x_right - win1->_begx; for (y = starty; y < endy; y++) { end = &win1->_y[y][endx]; x = startx + win1->_begx; for (sp = &win1->_y[y][startx]; sp <= end; sp++) { if (!isspace(*sp)) mvwaddch(win2, y + win1->_begy, x, *sp); x++; } } } _top = max(win1->_begy, win2->_begy); y_bot = min(win1->_maxy, win2lib/libcurses/overwrite.c 444 0 33 1226 2501350263 10761 # include "curses.h" # define min(a,b) (a < b ? a : b) /* * This routine writes win1 on win2 destructively. * * 1/26/81 (Berkeley) @(#)overwrite.c 1.1 */ overwrite(win1, win2) reg WINDOW *win1, *win2; { reg int x, y, minx, miny, starty; # ifdef DEBUG fprintf(outf, "OVERWRITE(0%o, 0%o);\n", win1, win2); # endif miny = min(win1->_maxy, win2->_maxy); minx = min(win1->_maxx, win2->_maxx); # ifdef DEBUG fprintf(outf, "OVERWRITE:\tminx = %d, miny = %d\n", minx, miny); # endif starty = win1->_begy - win2->_begy; for (y = 0; y < miny; y++) if (wmove(win2, y + starty, 0) != ERR) for (x = 0; x < minx; x++) waddch(win2, win1->_y[y][x]); } c 1.1 */ overwrite(win1, win2) reg WINDOW *win1, *win2; { reg int x, y, minx, miny, starty; # ifdef DEBUG fprintf(outf, "OVERWRITE(0%o, 0%o);\n", win1, win2); # endif miny = min(win1->_maxy, win2->_maxy); minx = min(win1->_maxx, win2->_maxx); # ifdef DEBUG fprintf(outf, "OVERWRITE:\tminx = %d, miny = %d\n", minx, miny); # endif starty = win1->_begy lib/libcurses/printw.c 444 0 33 1761 2501350264 10263 /* * printw and friends * * 1/26/81 (Berkeley) @(#)printw.c 1.1 */ # include "curses.ext" /* * This routine implements a printf on the standard screen. */ printw(fmt, args) char *fmt; int args; { return _sprintw(stdscr, fmt, &args); } /* * This routine implements a printf on the given window. */ wprintw(win, fmt, args) WINDOW *win; char *fmt; int args; { return _sprintw(win, fmt, &args); } /* * This routine actually executes the printf and adds it to the window * * This is really a modified version of "sprintf". As such, * it assumes that sprintf interfaces with the other printf functions * in a certain way. If this is not how your system works, you * will have to modify this routine to use the interface that your * "sprintf" uses. */ _sprintw(win, fmt, args) WINDOW *win; char *fmt; int *args; { FILE junk; char buf[512]; junk._flag = _IOWRT + _IOSTRG; junk._ptr = buf; junk._cnt = 32767; _doprnt(fmt, args, &junk); putc('\0', &junk); return waddstr(win, buf); } eally a modifielib/libcurses/refresh.c 444 0 33 11536 2552602253 10423 /* * make the current screen look like "win" over the area coverd by * win. * * 7/9/81 (Berkeley) @(#)refresh.c 1.6 */ # include "curses.ext" # ifdef DEBUG # define STATIC # else # define STATIC static # endif STATIC short ly, lx; STATIC bool curwin; WINDOW *_win = NULL; wrefresh(win) reg WINDOW *win; { reg short wy; reg int retval; /* * make sure were in visual state */ if (_endwin) { _puts(VS); _puts(TI); _endwin = FALSE; } /* * initialize loop parameters */ ly = curscr->_cury; lx = curscr->_curx; wy = 0; _win = win; curwin = (win == curscr); if (win->_clear || curscr->_clear || curwin) { if ((win->_flags & _FULLWIN) || curscr->_clear) { _puts(CL); ly = lx = curscr->_curx = curscr->_cury = 0; curscr->_clear = FALSE; if (!curwin) werase(curscr); touchwin(win); } win->_clear = FALSE; } if (!CA) { if (win->_curx != 0) putchar('\n'); if (!curwin) werase(curscr); } # ifdef DEBUG fprintf(outf, "REFRESH(%0.2o): curwin = %d\n", win, cu((rwin); fprintf(outf, "REFRESH:\n\tfirstch\tlastch\n"); # endif for (wy = 0; wy < win->_maxy; wy++) { # ifdef DEBUG fprintf(outf, "%d\t%d\t%d\n", wy, win->_firstch[wy], win->_lastch[wy]); # endif if (win->_firstch[wy] != _NOCHANGE) if (makech(win, wy) == ERR) return ERR; else win->_firstch[wy] = _NOCHANGE; } if (win->_leave) { curscr->_cury = ly; curscr->_curx = lx; ly -= win->_begy; lx -= win->_begx; if (ly >= 0 && ly < win->_maxy && lx >= 0 && lx < win->_maxx) { win->_cury = ly; win->_curx = lx; } else win->_cury = win->_curx = 0; } else { mvcur(ly, lx, win->_cury + win->_begy, win->_curx + win->_begx); curscr->_cury = win->_cury + win->_begy; curscr->_curx = win->_curx + win->_begx; } retval = OK; ret: _win = NULL; fflush(stdout); return retval; } /* * make a change on the screen */ STATIC makech(win, wy) reg WINDOW *win; short wy; { reg char *nsp, *csp, *ce; reg short wx, lch, y; reg int nlsp, clsp; /* last space in lines */ wx = win->_firstch[wy]; y = wy + win->_begy; lch = win->_lastch[wy]; if (curwin) csp = " "; else csp = &curscr->_y[wy + win->_begy][wx + win->_begx]; nsp = &win->_y[wy][wx]; if (CE && !curwin) { for (ce = &win->_y[wy][win->_maxx - 1]; *ce == ' '; ce--) if (ce <= win->_y[wy]) break; nlsp = ce - win->_y[wy]; } if (!curwin) ce = CE; else ce = NULL; while (wx <= lch) { if (*nsp != *csp) { mvcur(ly, lx, y, wx + win->_begx); # ifdef DEBUG fprintf(outf, "MAKECH: 1: wx = %d, lx = %d\n", wx, lx); # endif ly = y; lx = wx + win->_begx; while (*nsp != *csp && wx <= lch) { if (ce != NULL && wx >= nlsp && *nsp == ' ') { /* * check for clear to end-of-line */ ce = &curscr->_y[ly][COLS - 1]; while (*ce == ' ') if (ce-- <= csp) break; clsp = ce - curscr->_y[ly] - win->_begx; # ifdef DEBUG fprintf(outf, "MAKECH: clsp = %d, nlsp = %d\n", clsp, nlsp); # endif if (clsp - nlsp >= strlen(CE) && clsp < win->_maxx) { # ifdef DEBUG fprintf(outf, "MAKECH: using CE\n"); # endif if (curscr->_flags & _STANDOUT) { _puts(SE); curscr->_flags &= ~_STANDOUT; } _puts(CE); lx = wx + win->_begx; while (wx++ <= clsp) *csp++ = ' '; goto ret; } ce = NULL; } /* * enter/exit standout mode as appropriate */ if (SO && (*nsp&_STANDOUT) != (curscr->_flags&_STANDOUT)) { if (*nsp & _STANDOUT) { _puts(SO); curscr->_flags |= _STANDOUT; } else { _puts(SE); curscr->_flags &= ~_STANDOUT; } } wx++; if (wx >= win->_maxx && wy == win->_maxy - 1) if (win->_scroll) { if ((win->_flags&(_ENDLINE|_STANDOUT)) == (_ENDLINE|_STANDOUT)) if (!MS) { _puts(SE); curscr->_flags &= ~_STANDOUT; } if (!curwin) putchar((*csp = *nsp) & 0177); else putchar(*nsp & 0177); scroll(win); if (win->_flags&_FULLWIN && !curwin) scroll(curscr); ly = win->_begy+win->_cury; lx = win->_begx+win->_curx; return OK; } else if (win->_flags&_SCROLLWIN) { lx = --wx; return ERR; } if (!curwin) putchar((*csp++ = *nsp) & 0177); else putchar(*nsp & 0177); if (UC && (*nsp & _STANDOUT)) { putchar('\b'); _puts(UC); } nsp++; } # ifdef DEBUG fprintf(outf, "MAKECH: 2: wx = %d, lx = %d\n", wx, lx); # endif if (lx == wx + win->_begx) /* if no change */ break; lx = wx + win->_begx; } else if (wx < lch) while (*nsp == *csp && wx <= lch) { nsp++; if (!curwin) csp++; ++wx; } else break; # ifdef DEBUG fprintf(outf, "MAKECH: 3: wx = %d, lx = %d\n", wx, lx); # endif } ret: if ((win->_flags & _STANDOUT) && !MS) { _puts(SE); curscr->_flags &= ~_STANDOUT; } return OK; } nsp++; } # ifdef DEBUG fprintf(outf, "MAKECH: 2: wx = %d, lx = %d\n", wx, lx); # endif if (lx == wx + win->_begx) /* if no change */ break; lib/libcurses/scanw.c 444 0 33 1760 2501350267 10055 /* * scanw and friends * * 1/26/81 (Berkeley) @(#)scanw.c 1.1 */ # include "curses.ext" /* * This routine implements a scanf on the standard screen. */ scanw(fmt, args) char *fmt; int args; { return _sscans(stdscr, fmt, &args); } /* * This routine implements a scanf on the given window. */ wscanw(win, fmt, args) WINDOW *win; char *fmt; int args; { return _sscans(win, fmt, &args); } /* * This routine actually executes the scanf from the window. * * This is really a modified version of "sscanf". As such, * it assumes that sscanf interfaces with the other scanf functions * in a certain way. If this is not how your system works, you * will have to modify this routine to use the interface that your * "sscanf" uses. */ _sscans(win, fmt, args) WINDOW *win; char *fmt; int *args; { char buf[100]; FILE junk; junk._flag = _IOREAD|_IOSTRG; junk._base = junk._ptr = buf; if (wgetstr(win, buf) == ERR) return ERR; junk._cnt = strlen(buf); return _doscan(&junk, fmt, args); } ersion of "sscanlib/libcurses/scroll.c 444 0 33 1260 2552502422 10231 # include "curses.ext" /* * This routine scrolls the window up a line. * * 7/8/81 (Berkeley) @(#)scroll.c 1.2 */ scroll(win) reg WINDOW *win; { reg char *sp; reg int i; reg char *temp; if (!win->_scroll) return ERR; temp = win->_y[0]; for (i = 0; i < win->_maxy - 1; i++) win->_y[i] = win->_y[i+1]; for (sp = temp; sp - temp < win->_maxx; ) *sp++ = ' '; win->_y[win->_maxy - 1] = temp; win->_cury--; if (win == curscr) { putchar('\n'); if (!NONL) win->_curx = 0; # ifdef DEBUG fprintf(outf, "SCROLL: win == curscr\n"); # endif } # ifdef DEBUG else fprintf(outf, "SCROLL: win [0%o] != curscr [0%o]\n",win,curscr); # endif touchwin(win); return OK; } ; reg char *temp; if (!win->_scroll) return ERR; temp = win->_y[0]; for (i = 0; i < win->_maxy - 1; i++) win->_y[i] = win->_y[i+1]; for (sp = temp; sp - temp < win->_maxx; ) *sp++ = ' '; win->_y[win->_maxy - 1] = temp; win->_cury--; if (win == curscr) { putchar('\n'); if (!NONL) win->_curx = 0; # ifdef DEBUG fplib/libcurses/standout.c 444 0 33 705 2501350273 10556 /* * routines dealing with entering and exiting standout mode * * 1/26/81 (Berkeley) @(#)standout.c 1.1 */ # include "curses.ext" /* * enter standout mode */ char * wstandout(win) reg WINDOW *win; { if (!SO && !UC) return FALSE; win->_flags |= _STANDOUT; return (SO ? SO : UC); } /* * exit standout mode */ char * wstandend(win) reg WINDOW *win; { if (!SO && !UC) return FALSE; win->_flags &= ~_STANDOUT; return (SE ? SE : UC); } 5x< /,"lib/libcurses/touchwin.c 444 0 33 477 2501350276 10566 # include "curses.ext" /* * make it look like the whole window has been changed. * * 1/26/81 (Berkeley) @(#)touchwin.c 1.1 */ touchwin(win) reg WINDOW *win; { reg int y, maxy, maxx; maxy = win->_maxy; maxx = win->_maxx - 1; for (y = 0; y < maxy; y++) { win->_firstch[y] = 0; win->_lastch[y] = maxx; } } */ char * wstandend(win) reg WINDOW *win; { if (!SO && !UC) return FALSE; win->_flags &= ~_STA/,5< /,"lib/libcurses/unctrl.c 444 0 33 1533 2501350277 10250 /* * define unctrl codes for each character * * 1/26/81 (Berkeley) @(#)unctrl.c 1.1 */ /* LINTLIBRARY */ char *_unctrl[] = { /* unctrl codes for ttys */ "^@", "^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", "^[", "^\\", "^]", "^~", "^_", " ", "!", "\"", "#", "$", "%", "&", "'", "(", ")", "*", "+", ",", "-", ".", "/", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ":", ";", "<", "=", ((">", "?", "@", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "[", "\\", "]", "^", "_", "`", "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", "{", "|", "}", "~", "^?" }; , "^_", " ", "!", "\"", "#", "$", "%", "&", "'", "(", ")", "*", "+", ",", "-", ".", "/", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ":", ";", "<", "=", lib/libcurses/unctrl.h 444 0 33 204 2501350303 10215 /* * unctrl.h * * 1/26/81 (Berkeley) @(#)unctrl.h 1.1 */ extern char *_unctrl[]; # define unctrl(ch) (_unctrl[(unsigned) ch]) ", "X", "Y", "Z", "[", "\\", "]", "^", "_", "`", "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", "{", "|", "}", "~", "^?" }; , "^_", " ", "!", "\"", "#", "$", "%", "&", "'", "(", ")", "*", "+", ",/,5< /,"lib/libcurses/curses.ext 444 0 33 554 2501350304 10574 /* * External variables for the library * * @(#)curses.ext 1.2 (Berkeley) 3/5/81 */ /* LINTLIBRARY */ # include "curses.h" # include "unctrl.h" extern bool _echoit, _rawmode, My_term, _endwin; extern char ttytype[], *_unctrl[]; extern int _tty_ch, LINES, COLS; extern SGTTY _tty; char _putchar(); #ifdef DEBUG # define outf _outf FILE *outf; #endif , "\"", "#", "$", "%", "&", "'", "(", ")", "*", "+", ",/,5< /,"lib/libcurses/tstp.c 444 0 33 615 2501400454 7704 # include # ifdef SIGTSTP # include "curses.ext" /* * handle stop and start signals * * 3/5/81 (Berkeley) @(#)tstp.c 1.1 */ tstp() { SGTTY tty; # ifdef DEBUG if (outf) fflush(outf); # endif tty = _tty; mvcur(0, COLS - 1, LINES - 1, 0); endwin(); fflush(stdout); kill(0, SIGTSTP); signal(SIGTSTP, tstp); _tty = tty; stty(_tty_ch, &_tty); wrefresh(curscr); } # endif "(", ")", "*", "+", ",/,5Ȉ< /,"lib/libcurses/insch.c 444 0 33 1401 2517262771 10047 # include "curses.ext" /* * This routine performs an insert-char on the line, leaving * (_cury,_curx) unchanged. * * @(#)insch.c 1.2 (Berkeley) 4/17/81 */ winsch(win, c) reg WINDOW *win; char c; { reg char *temp1, *temp2; reg char *end; end = &win->_y[win->_cury][win->_curx]; temp1 = &win->_y[win->_cury][win->_maxx - 1]; temp2 = temp1 - 1; while (temp1 > end) *temp1-- = *temp2--; *temp1 = c; win->_lastch[win->_cury] = win->_maxx - 1; if (win->_firstch[win->_cury] == _NOCHANGE || win->_firstch[win->_cury] > win->_curx) win->_firstch[win->_cury] = win->_curx; if (win->_cury == LINES - 1 && win->_y[LINES-1][COLS-1] != ' ') if (win->_scroll) { wrefresh(win); scroll(win); win->_cury--; } else return ERR; return OK; } in->_y[win->_cury][win->_curx]; temp1 = &win->_y[win->_cury][win->_maxx - 1]; temp2 = temp1 - 1; while (temp1 > end) *temp1-- = *temp2--; *temp1 = c; win->_lastch[win->_cury] = win->_maxx - 1; if (win->_firstch[win->_cury] == _NOCHANGE || winlib/libcurses/delch.c 444 0 33 1127 2517262774 10032 # include "curses.ext" /* * This routine performs an insert-char on the line, leaving * (_cury,_curx) unchanged. * * @(#)delch.c 1.1 (Berkeley) 4/17/81 */ wdelch(win) reg WINDOW *win; { reg char *temp1, *temp2; reg char *end; end = &win->_y[win->_cury][win->_maxx - 1]; temp2 = &win->_y[win->_cury][win->_curx + 1]; temp1 = temp2 - 1; while (temp1 < end) *temp1++ = *temp2++; *temp1 = ' '; win->_lastch[win->_cury] = win->_maxx - 1; if (win->_firstch[win->_cury] == _NOCHANGE || win->_firstch[win->_cury] > win->_curx) win->_firstch[win->_cury] = win->_curx; return OK; } * (_cury,_curx) unchanged. * * @(#)delch.c 1.1 (Berkeley) 4/17/81 */ wdelch(win) reg WINDOW *win; { reg char *temp1, *temp2; reg char *end; end = &win->_y[win->_cury][win->_maxx - 1]; temp2 = &win->_y[win->_cury][win->_curx + 1]; temp1 = temp2 - 1; while (temp1 < end) *temp1++ = *temp2++; *temp1 = ' '; win->_lastch[win->_cury] = win->_maxx - 1; if (win->_firstch[win->_cury] == _NOCHANGE || win->_firlib/libcurses/getcap.c 664 0 33 205 2552502421 10157 # include "curses.ext" /* * get a capability from the termcap entry * * %W% (Berkeley) %G% */ char * getcap(name) char *name; { 1.1 (Berkeley) 4/17/81 */ wdelch(win) reg WINDOW *win; { reg char *temp1, *temp2; reg char *end; end = &win->_y[win->_cury][win->_maxx - 1]; temp2 = &win->_y[win->_cury][win->_curx + 1]; temp1 = temp2 - 1; while (temp1 < end) *temp1++ = *temp2++; *temp1 = ' '; win->_lastch/,5< /,"lib/libdbm/ 775 0 33 0 2552601746 5756 lib/libdbm/Makefile 644 0 33 255 2413354413 7453 CFLAGS=-O libdbm.a: dbm.o mv dbm.o libdbm.a dbm.o : dbm.h install: install -c libdbm.a $(DESTDIR)/usr/lib install -c dbm.h $(DESTDIR)/usr/include clean: rm libdbm.a reg W< a9 re000000057561, *temp2; reg char *end; end = &win->_y[win->_cury][win->_maxx - 1]; temp2 = &win->_y[win->_cury][win->_curx + 1]; temp1 = temp2 - 1; while (temp1 < end) *temp1++ = *temp2++; *te = ' '; / C. /,"lib/libdbm/dbm.c 644 0 33 17155 2444103343 6766 #include "dbm.h" #include #include dbminit(file) char *file; { struct stat statb; dbrdonly = 0; strcpy(pagbuf, file); strcat(pagbuf, ".pag"); pagf = open(pagbuf, 2); if (pagf < 0) { pagf = open(pagbuf, 0); dbrdonly = 1; } strcpy(pagbuf, file); strcat(pagbuf, ".dir"); dirf = open(pagbuf, 2); if (dirf < 0) { dirf = open(pagbuf, 0); dbrdonly = 1; } if(pagf < 0 || dirf < 0) { printf("cannot open database %s\n", file); return(-1); } fstat(dirf, &statb); m((axbno = statb.st_size*BYTESIZ-1; return(0); } long forder(key) datum key; { long hash; hash = calchash(key); for(hmask=0;; hmask=(hmask<<1)+1) { blkno = hash & hmask; bitno = blkno + hmask; if(getbit() == 0) break; } return(blkno); } datum fetch(key) datum key; { register i; datum item; dbm_access(calchash(key)); for(i=0;; i+=2) { item = makdatum(pagbuf, i); if(item.dptr == NULL) return(item); if(cmpdatum(key, item) == 0) { item = makdatum(pagbuf, i+1); if(item.dptr == NULL) printf("items not in pairs\n"); return(item); } } } delete(key) datum key; { register i; datum item; if (dbrdonly) return -1; dbm_access(calchash(key)); for(i=0;; i+=2) { item = makdatum(pagbuf, i); if(item.dptr == NULL) return(-1); if(cmpdatum(key, item) == 0) { delitem(pagbuf, i); delitem(pagbuf, i); break; } } lseek(pagf, blkno*PBLKSIZ, 0); write(pagf, pagbuf, PBLKSIZ); return(0); } store(key, dat) datum key, dat; { register i; datum item; char ovfbuf[PBLKSIZ]; if (dbrdonly) return -1; loop: dbm_access(calchash(key)); for(i=0;; i+=2) { item = makdatum(pagbuf, i); if(item.dptr == NULL) break; if(cmpdatum(key, item) == 0) { delitem(pagbuf, i); delitem(pagbuf, i); break; } } i = additem(pagbuf, key); if(i < 0) goto split; if(additem(pagbuf, dat) < 0) { delitem(pagbuf, i); goto split; } lseek(pagf, blkno*PBLKSIZ, 0); write(pagf, pagbuf, PBLKSIZ); return (0); split: if(key.dsize+dat.dsize+2*sizeof(short) >= PBLKSIZ) { printf("entry too big\n"); return (-1); } clrbuf(ovfbuf, PBLKSIZ); for(i=0;;) { item = makdatum(pagbuf, i); if(item.dptr == NULL) break; if(calchash(item) & (hmask+1)) { additem(ovfbuf, item); delitem(pagbuf, i); item = makdatum(pagbuf, i); if(item.dptr == NULL) { printf("split not paired\n"); break; } additem(ovfbuf, item); delitem(pagbuf, i); continue; } i += 2; } lseek(pagf, blkno*PBLKSIZ, 0); write(pagf, pagbuf, PBLKSIZ); lseek(pagf, (blkno+hmask+1)*PBLKSIZ, 0); write(pagf, ovfbuf, PBLKSIZ); setbit(); goto loop; } datum firstkey() { return(firsthash(0L)); } datum nextkey(key) datum key; { register i; datum item, bitem; long hash; int f; hash = calchash(key); dbm_access(hash); f = 1; for(i=0;; i+=2) { item = makdatum(pagbuf, i); if(item.dptr == NULL) break; if(cmpdatum(key, item) <= 0) continue; if(f || cmpdatum(bitem, item) < 0) { bitem = item; f = 0; } } if(f == 0) return(bitem); hash = hashinc(hash); if(hash == 0) return(item); return(firsthash(hash)); } datum firsthash(hash) long hash; { register i; datum item, bitem; loop: dbm_access(hash); bitem = makdatum(pagbuf, 0); for(i=2;; i+=2) { item = makdatum(pagbuf, i); if(item.dptr == NULL) break; if(cmpdatum(bitem, item) < 0) bitem = item; } if(bitem.dptr != NULL) return(bitem); hash = hashinc(hash); if(hash == 0) return(item); goto loop; } dbm_access(hash) long hash; { static long oldb = -1; for(hmask=0;; hmask=(hmask<<1)+1) { blkno = hash & hmask; bitno = blkno + hmask; if(getbit() == 0) break; } if(blkno != oldb) { clrbuf(pagbuf, PBLKSIZ); lseek(pagf, blkno*PBLKSIZ, 0); read(pagf, pagbuf, PBLKSIZ); chkblk(pagbuf); oldb = blkno; } } getbit() { long bn; register b, i, n; static oldb = -1; if(bitno > maxbno) return(0); n = bitno % BYTESIZ; bn = bitno / BYTESIZ; i = bn % DBLKSIZ; b = bn / DBLKSIZ; if(b != oldb) { clrbuf(dirbuf, DBLKSIZ); lseek(dirf, (long)b*DBLKSIZ, 0); read(dirf, dirbuf, DBLKSIZ); oldb = b; } if(dirbuf[i] & (1< maxbno) { maxbno = bitno; getbit(); } n = bitno % BYTESIZ; bn = bitno / BYTESIZ; i = bn % DBLKSIZ; b = bn / DBLKSIZ; dirbuf[i] |= 1<= sp[0]) goto null; t = PBLKSIZ; if(n > 0) t = sp[n+1-1]; item.dptr = buf+sp[n+1]; item.dsize = t - sp[n+1]; return(item); null: item.dptr = NULL; item.dsize = 0; return(item); } cmpdatum(d1, d2) datum d1, d2; { register n; register char *p1, *p2; n = d1.dsize; if(n != d2.dsize) return(n - d2.dsize); if(n == 0) return(0); p1 = d1.dptr; p2 = d2.dptr; do if(*p1++ != *p2++) return(*--p1 - *--p2); while(--n); return(0); } int hitab[16] /* ken's { 055,043,036,054,063,014,004,005, 010,064,077,000,035,027,025,071, }; */ = { 61, 57, 53, 49, 45, 41, 37, 33, 29, 25, 21, 17, 13, 9, 5, 1, }; long hltab[64] = { 06100151277L,06106161736L,06452611562L,05001724107L, 02614772546L,04120731531L,04665262210L,07347467531L, 06735253126L,06042345173L,03072226605L,01464164730L, 03247435524L,07652510057L,01546775256L,05714532133L, 06173260402L,07517101630L,02431460343L,01743245566L, 00261675137L,02433103631L,03421772437L,04447707466L, 04435620103L,03757017115L,03641531772L,06767633246L, 02673230344L,00260612216L,04133454451L,00615531516L, 06137717526L,02574116560L,02304023373L,07061702261L, 05153031405L,05322056705L,07401116734L,06552375715L, 06165233473L,05311063631L,01212221723L,01052267235L, 06000615237L,01075222665L,06330216006L,04402355630L, 01451177262L,02000133436L,06025467062L,07121076461L, 03123433522L,01010635225L,01716177066L,05161746527L, 01736635071L,06243505026L,03637211610L,01756474365L, 04723077174L,03642763134L,05750130273L,03655541561L, }; long hashinc(hash) long hash; { long bit; hash &= hmask; bit = hmask+1; for(;;) { bit >>= 1; if(bit == 0) return(0L); if((hash&bit) == 0) return(hash|bit); hash &= ~bit; } } long calchash(item) datum item; { register i, j, f; long hashl; int hashi; hashl = 0; hashi = 0; for(i=0; i>= 4; } } return(hashl); } delitem(buf, n) char buf[PBLKSIZ]; { register short *sp; register i1, i2, i3; sp = (short *)buf; if(n < 0 || n >= sp[0]) goto bad; i1 = sp[n+1]; i2 = PBLKSIZ; if(n > 0) i2 = sp[n+1-1]; i3 = sp[sp[0]+1-1]; if(i2 > i1) while(i1 > i3) { i1--; i2--; buf[i2] = buf[i1]; buf[i1] = 0; } i2 -= i1; for(i1=n+1; i1 0) i1 = sp[sp[0]+1-1]; i1 -= item.dsize; i2 = (sp[0]+2) * sizeof(short); if(i1 <= i2) return(-1); sp[sp[0]+1] = i1; for(i2=0; i2 t) goto bad; t = sp[i+1]; } if(t < (sp[0]+1)*sizeof(short)) goto bad; return; bad: printf("bad block\n"); abort(); clrbuf(buf, PBLKSIZ); } p[0]+1-1]; i1 -= item.dsize; i2 = (sp[0]+2) * sizeof(short); if(i1 <= i2) return(-1); sp[sp[0]+1] = i1; for(i2=0; i2 t) goto bad; t = sp[i+1]; } if(t < (slib/libdbm/dbm.h 644 0 33 606 2430210472 6721 #define PBLKSIZ 1024 #define DBLKSIZ 4096 #define BYTESIZ 8 #define NULL ((char *) 0) long bitno; long maxbno; long blkno; long hmask; char pagbuf[PBLKSIZ]; char dirbuf[DBLKSIZ]; int dirf; int pagf; int dbrdonly; typedef struct { char *dptr; int dsize; } datum; datum fetch(); datum makdatum(); datum firstkey(); datum nextkey(); datum firsthash(); long calchash(); long hashinc(); ; sp = (short *)buf; t = PB/,5x< /,"lib/libg/ 775 0 33 0 2552601753 5440 lib/libg/Makefile 644 0 33 163 2256420110 7126 libg.a: dbxxx.s as dbxxx.s -o libg.a install: libg.a install -c libg.a ${DESTDIR}/usr/lib clean: rm -f libg.a g blkno; long hmask< < a9]; c02552601753BLKSIZ< a9int 00000005440rdonly; typedef struct { char *dptr; int dsize; } datum; datum fetch(); datum makdatum(); datum firstkey(); datum nextkey(); datum firsthash(); long calchash(); long hashinc(); ; sp short *)/ C. /,"((lib/libg/dbxxx.s 644 0 33 214 2115360576 7021 .data .comm __dbargs,512 .text .align 1 .globl __dbsubc __dbsubc: callg __dbargs+4,*__dbargs .globl __dbsubn __dbsubn: halt .data < a9]; c02552601753BLKSIZ< a9int 00000005440rdonly; typedef struct { char *dptr; int dsize; } datum; datum fetch(); datum makdatum(); datum firstkey(); datum nextkey(); datum firsthash(); long calchash(); long hashinc(); ; sp short *)//,5h< /,"lib/libm/ 775 0 33 0 2552602244 5442 lib/libm/Makefile 644 0 33 427 2434655565 7165 CFLAGS=-O FILES= asin.o atan.o hypot.o jn.o j0.o j1.o pow.o gamma.o \ log.o sin.o sqrt.o tan.o tanh.o sinh.o erf.o exp.o floor.o libm.a : $(FILES) ar rc libm.a $(FILES) install: libm.a cp libm.a ${DESTDIR}/usr/lib ranlib ${DESTDIR}/usr/lib/libm.a clean: rm -f *.o libm.a h(); datum makdatum(); datum firstkey(); datum nextkey(); datum firsthash(); long calchash(); long hashinc(); ; sp short *)/ C. /,"lib/libm/asin.c 644 0 33 1233 2327130210 6607 /* asin(arg) and acos(arg) return the arcsin, arccos, respectively of their arguments. Arctan is called after appropriate range reduction. */ #include int errno; double atan(); double sqrt(); static double pio2 = 1.570796326794896619; double asin(arg) double arg; { double sign, temp; sign = 1.; if(arg <0){ arg = -arg; sign = -1.; } if(arg > 1.){ errno = EDOM; return(0.); } temp = sqrt(1. - arg*arg); if(arg > 0.7) temp = pio2 - atan(temp/arg); else temp = atan(arg/temp); return(sign*temp); } double acos(arg) double arg; { if((arg > 1.) || (arg < -1.)){ errno = EDOM; return(0.); } return(pio2 - asin(arg)); } int errno; double atan(); double sqrt(); static double pio2 = 1.570796326794896619; double asin(arg) double arg; { double sign, temp; sign = 1.; if(arg <0){ arg = -arg; sign = -1.; } if(arg > 1.){ errno = EDOM; return(0.); } temp = sqrt(1. - arg*arg); if(arg > 0.7) temp = pio2 - atan(temp/arg); else temp = atan(arg/temlib/libm/atan.c 644 0 33 4255 2111463072 6615 /* floating-point arctangent atan returns the value of the arctangent of its argument in the range [-pi/2,pi/2]. atan2 returns the arctangent of arg1/arg2 in the range [-pi,pi]. there are no error returns. coefficients are #5077 from Hart & Cheney. (19.56D) */ double static sq2p1 =2.414213562373095048802e0; static double sq2m1 = .414213562373095048802e0; static double pio2 =1.570796326794896619231e0; static double pio4 = .785398163397448309615e0; static double p4 = .161536412982230228262e2; static double p3 = .26842548195503973794141e3; static double p2 = .11530293515404850115428136e4; static double p1 = .178040631643319697105464587e4; static double p0 = .89678597403663861959987488e3; static double q4 = .5895697050844462222791e2; static double q3 = .536265374031215315104235e3; static double q2 = .16667838148816337184521798e4; static double q1 = .207933497444540981287275926e4; static double q0 = .89678597403663861962481162e3; /* atan makes its argument positive and calls the inner routine satan. */ double atan(arg) double arg; { double satan(); if(arg>0) return(satan(arg)); else return(-satan(-arg)); } /* atan2 discovers what quadrant the angle is in and calls atan. */ double atan2(arg1,arg2) double arg1,arg2; { double satan(); if((arg1+arg2)==arg1) if(arg1 >= 0.) return(pio2); else return(-pio2); else if(arg2 <0.) if(arg1 >= 0.) return(pio2+pio2 - satan(-arg1/arg2)); else return(-pio2-pio2 + satan(arg1/arg2)); else if(arg1>0) return(satan(arg1/arg2)); else return(-satan(-arg1/arg2)); } /* satan reduces its argument (known to be positive) to the range [0,0.414...] and calls xatan. */ static double satan(arg) double arg; { double xatan(); if(arg < sq2m1) return(xatan(arg)); else if(arg > sq2p1) return(pio2 - xatan(1.0/arg)); else return(pio4 + xatan((arg-1.0)/(arg+1.0))); } /* xatan evaluates a series valid in the range [-0.414...,+0.414...]. */ static double xatan(arg) double arg; { double argsq; double value; argsq = arg*arg; value = ((((p4*argsq + p3)*argsq + p2)*argsq + p1)*argsq + p0); value = value/(((((argsq + q4)*argsq + q3)*argsq + q2)*argsq + q1)*argsq + q0); return(value*arg); } double arg; { double xatan(); if(arg < sq2m1) return(xatan(arg)); else if(arg > sq2p1) return(pio2 - xatan(1.0/arg)); else return(pio4 + xatan((arg-1.0)/(arg+1.0))); } /* xatan evaluates a series valid in the range [-0.414...,+0.414...]. */ static double xatan(arg) double arg; { double argsq; double value; argsq = arg*lib/libm/erf.c 644 0 33 4516 2111463072 6446 /* C program for floating point error function erf(x) returns the error function of its argument erfc(x) returns 1.0-erf(x) erf(x) is defined by ${2 over sqrt(pi)} int from 0 to x e sup {-t sup 2} dt$ the entry for erfc is provided because of the extreme loss of relative accuracy if erf(x) is called for large x and the result subtracted from 1. (e.g. for x= 10, 12 places are lost). There are no error returns. Calls exp. Coefficients for large x are #5667 from Hart & Cheney (18.72D). */ #define M 7 #define N 9 int errno; static double torp = 1.1283791670955125738961589031; static double p1[] = { 0.804373630960840172832162e5, 0.740407142710151470082064e4, 0.301782788536507577809226e4, 0.380140318123903008244444e2, 0.143383842191748205576712e2, -.288805137207594084924010e0, 0.007547728033418631287834e0, }; static double q1[] = { 0.804373630960840172826266e5, 0.342165257924628539769006e5, 0.637960017324428279487120e4, 0.658070155459240506326937e3, 0.380190713951939403753468e2, 0.100000000000000000000000e1, 0.0, }; static double p2[] = { 0.18263348842295112592168999e4, 0.28980293292167655611275846e4, 0.2320439590251635247384768711e4, 0.1143262070703886173606073338e4, 0.3685196154710010637133875746e3, 0.7708161730368428609781633646e2, 0.9675807882987265400604202961e1, 0.5641877825507397413087057563e0, 0.0, }; static double q2[] = { 0.18263348842295112595576438e4, 0.495882756472114071495438422e4, 0.60895424232724435504633068e4, 0.4429612803883682726711528526e4, 0.2094384367789539593790281779e4, 0.6617361207107653469211984771e3, 0.1371255960500622202878443578e3, 0.1714980943627607849376131193e2, 1.0, }; double erf(arg) double arg;{ double erfc(); int sign; double argsq; double d, n; int i; errno = 0; sign = 1; if(arg < 0.){ arg = -arg; sign = -1; } if(arg < 0.5){ argsq = arg*arg; for(n=0,d=0,i=M-1; i>=0; i--){ n = n*argsq + p1[i]; d = d*argsq + q1[i]; } return(sign*torp*arg*n/d); } if(arg >= 10.) return(sign*1.); return(sign*(1. - erfc(arg))); } double erfc(arg) double arg;{ double erf(); double exp(); double n, d; int i; errno = 0; if(arg < 0.) return(2. - erfc(-arg)); /* if(arg < 0.5) return(1. - erf(arg)); */ if(arg >= 10.) return(0.); for(n=0,d=0,i=N-1; i>=0; i--){ n = n*arg + p2[i]; d = d*arg + q2[i]; } return(exp(-arg*arg)*n/d); } arg; for(n=0,d=0,i=M-1; i>=0; i--){ n = n*argsq + p1[i]; d = d*argsq + q1[i]; } return(sign*torp*arg*n/d); } if(arg >= 10.) return(sign*1.); return(sign*(1. - er((lib/libm/exp.c 644 0 33 2024 2111463072 6456 /* exp returns the exponential function of its floating-point argument. The coefficients are #1069 from Hart and Cheney. (22.35D) */ #include #include int errno; static double p0 = .2080384346694663001443843411e7; static double p1 = .3028697169744036299076048876e5; static double p2 = .6061485330061080841615584556e2; static double q0 = .6002720360238832528230907598e7; static double q1 = .3277251518082914423057964422e6; static double q2 = .1749287689093076403844945335e4; static double log2e = 1.4426950408889634073599247; static double sqrt2 = 1.4142135623730950488016887; static double maxf = 10000; double exp(arg) double arg; { double fract; double temp1, temp2, xsq; int ent; if(arg == 0.) return(1.); if(arg < -maxf) return(0.); if(arg > maxf) { errno = ERANGE; return(HUGE); } arg *= log2e; ent = floor(arg); fract = (arg-ent) - 0.5; xsq = fract*fract; temp1 = ((p2*xsq+p1)*xsq+p0)*fract; temp2 = ((1.0*xsq+q2)*xsq+q1)*xsq + q0; return(ldexp(sqrt2*(temp2+temp1)/(temp2-temp1), ent)); } 8889634073599247; static double sqrt2 = 1.4142135623730950488016887; static double maxf = 10000; double exp(arg) double arg; { double fract; double temp1, temp2, xsq; int ent; if(arg == 0.) return(1.); if(arg < -maxf) return(0.); if(arg > maxf) { errno = ERANGE; return(HUGE); } arg *= log2e; ent = floor(arg); fract = (arg-ent) - 0.5; xsq = fract*fract; temp1 = ((p2*xsq+p1)*xsq+p0)*fract; temp2 = ((1.0*xsq+q2)*xsq+q1)*xsq + q0; return(ldexp(sqrt2*(temp2+temp1)/(temlib/libm/floor.c 644 0 33 463 2111463072 6770 /* * floor and ceil-- greatest integer <= arg * (resp least >=) */ double modf(); double floor(d) double d; { double fract; if (d<0.0) { d = -d; fract = modf(d, &d); if (fract != 0.0) d += 1; d = -d; } else modf(d, &d); return(d); } double ceil(d) double d; { return(-floor(-d)); } UGE); } arg *= log2e; ent = floor(arg); fract = (arg-ent) - 0.5; xsq = fract*fract; temp1 = ((p2*xsq+p1)*xs/,5< /,"lib/libm/hypot.c 644 0 33 670 2111463072 7012 /* * sqrt(a^2 + b^2) * (but carefully) */ double sqrt(); double hypot(a,b) double a,b; { double t; if(a<0) a = -a; if(b<0) b = -b; if(a > b) { t = a; a = b; b = t; } if(b==0) return(0.); a /= b; /* * pathological overflow possible * in the next line. */ return(b*sqrt(1. + a*a)); } struct complex { double r; double i; }; double cabs(arg) struct complex arg; { double hypot(); return(hypot(arg.r, arg.i)); } ,5< /,"lib/libm/j0.c 644 0 33 10316 2111463073 6217 /* floating point Bessel's function of the first and second kinds of order zero j0(x) returns the value of J0(x) for all real values of x. There are no error returns. Calls sin, cos, sqrt. There is a niggling bug in J0 which causes errors up to 2e-16 for x in the interval [-8,8]. The bug is caused by an inappropriate order of summation of the series. rhm will fix it someday. Coefficients are from Hart & Cheney. #5849 (19.22D) #6549 (19.25D) #6949 (19.41D) y0(x) returns the value of Y0(x) for positive real values of x. For x<=0, error number EDOM is set and a large negative value is returned. Calls sin, cos, sqrt, log, j0. The values of Y0 have not been checked to more than ten places. Coefficients are from Hart & Cheney. #6245 (18.78D) #6549 (19.25D) #6949 (19.41D) */ #include #include int errno; static double pzero, qzero; static double tpi = .6366197723675813430755350535e0; static double pio4 = .7853981633974483096156608458e0; static double p1[] = { 0.4933787251794133561816813446e21, -.1179157629107610536038440800e21, 0.6382059341072356562289432465e19, -.1367620353088171386865416609e18, 0.1434354939140344111664316553e16, -.8085222034853793871199468171e13, 0.2507158285536881945555156435e11, -.4050412371833132706360663322e8, 0.2685786856980014981415848441e5, }; static double q1[] = { 0.4933787251794133562113278438e21, 0.5428918384092285160200195092e19, 0.3024635616709462698627330784e17, 0.1127756739679798507056031594e15, 0.3123043114941213172572469442e12, 0.6699987672982239671814028660e9, 0.1114636098462985378182402543e7, 0.1363063652328970604442810507e4, 1.0 }; static double p2[] = { 0.5393485083869438325262122897e7, 0.1233238476817638145232406055e8, 0.8413041456550439208464315611e7, 0.2016135283049983642487182349e7, 0.1539826532623911470917825993e6, 0.2485271928957404011288128951e4, 0.0, }; static double q2[] = { 0.5393485083869438325560444960e7, 0.1233831022786324960844856182e8, 0.8426449050629797331554404810e7, 0.2025066801570134013891035236e7, 0.1560017276940030940592769933e6, 0.2615700736920839685159081813e4, 1.0, }; static double p3[] = { -.3984617357595222463506790588e4, -.1038141698748464093880530341e5, -.8239066313485606568803548860e4, -.2365956170779108192723612816e4, -.2262630641933704113967255053e3, -.4887199395841261531199129300e1, 0.0, }; static double q3[] = { 0.2550155108860942382983170882e6, 0.6667454239319826986004038103e6, 0.5332913634216897168722255057e6, 0.1560213206679291652539287109e6, 0.1570489191515395519392882766e5, 0.4087714673983499223402830260e3, 1.0, }; static double p4[] = { -.2750286678629109583701933175e20, 0.6587473275719554925999402049e20, -.5247065581112764941297350814e19, 0.1375624316399344078571335453e18, -.1648605817185729473122082537e16, 0.1025520859686394284509167421e14, -.3436371222979040378171030138e11, 0.5915213465686889654273830069e8, -.4137035497933148554125235152e5, }; static double q4[] = { 0.3726458838986165881989980e21, 0.4192417043410839973904769661e19, 0.2392883043499781857439356652e17, 0.9162038034075185262489147968e14, 0.2613065755041081249568482092e12, 0.5795122640700729537480087915e9, 0.1001702641288906265666651753e7, 0.1282452772478993804176329391e4, 1.0, }; double j0(arg) double arg;{ double argsq, n, d; double sin(), cos(), sqrt(); int i; if(arg < 0.) arg = -arg; if(arg > 8.){ asympt(arg); n = arg - pio4; return(sqrt(tpi/arg)*(pzero*cos(n) - qzero*sin(n))); } argsq = arg*arg; for(n=0,d=0,i=8;i>=0;i--){ n = n*argsq + p1[i]; d = d*argsq + q1[i]; } return(n/d); } double y0(arg) double arg;{ double argsq, n, d; double sin(), cos(), sqrt(), log(), j0(); int i; errno = 0; if(arg <= 0.){ errno = EDOM; return(-HUGE); } if(arg > 8.){ asympt(arg); n = arg - pio4; return(sqrt(tpi/arg)*(pzero*sin(n) + qzero*cos(n))); } argsq = arg*arg; for(n=0,d=0,i=8;i>=0;i--){ n = n*argsq + p4[i]; d = d*argsq + q4[i]; } return(n/d + tpi*j0(arg)*log(arg)); } static asympt(arg) double arg;{ double zsq, n, d; int i; zsq = 64./(arg*arg); for(n=0,d=0,i=6;i>=0;i--){ n = n*zsq + p2[i]; d = d*zsq + q2[i]; } pzero = n/d; for(n=0,d=0,i=6;i>=0;i--){ n = n*zsq + p3[i]; d = d*zsq + q3[i]; } qzero = (8./arg)*(n/d); } } if(arg > 8.){ asympt(arg); n = arg - pio4; return(sqrt(tpi/arg)*(pzero*sin(n) + qzero*cos(n))); } argsq = arg*arg; for(n=0,d=0,i=8;i>=0;i--){ n = n*argsq + p4[i]; d = d*argsq + q4[i]; } return(n/d + tpi*j0(arg)*log(arg)); } static asympt(arg) double arg;{ double zsq, n, d; int i; zslib/libm/j1.c 644 0 33 10424 2111463073 6220 /* floating point Bessel's function of the first and second kinds of order one j1(x) returns the value of J1(x) for all real values of x. There are no error returns. Calls sin, cos, sqrt. There is a niggling bug in J1 which causes errors up to 2e-16 for x in the interval [-8,8]. The bug is caused by an inappropriate order of summation of the series. rhm will fix it someday. Coefficients are from Hart & Cheney. #6050 (20.98D) #6750 (19.19D) #7150 (19.35D) y1(x) returns the value of Y1(((x) for positive real values of x. For x<=0, error number EDOM is set and a large negative value is returned. Calls sin, cos, sqrt, log, j1. The values of Y1 have not been checked to more than ten places. Coefficients are from Hart & Cheney. #6447 (22.18D) #6750 (19.19D) #7150 (19.35D) */ #include #include int errno; static double pzero, qzero; static double tpi = .6366197723675813430755350535e0; static double pio4 = .7853981633974483096156608458e0; static double p1[] = { 0.581199354001606143928050809e21, -.6672106568924916298020941484e20, 0.2316433580634002297931815435e19, -.3588817569910106050743641413e17, 0.2908795263834775409737601689e15, -.1322983480332126453125473247e13, 0.3413234182301700539091292655e10, -.4695753530642995859767162166e7, 0.2701122710892323414856790990e4, }; static double q1[] = { 0.1162398708003212287858529400e22, 0.1185770712190320999837113348e20, 0.6092061398917521746105196863e17, 0.2081661221307607351240184229e15, 0.5243710262167649715406728642e12, 0.1013863514358673989967045588e10, 0.1501793594998585505921097578e7, 0.1606931573481487801970916749e4, 1.0, }; static double p2[] = { -.4435757816794127857114720794e7, -.9942246505077641195658377899e7, -.6603373248364939109255245434e7, -.1523529351181137383255105722e7, -.1098240554345934672737413139e6, -.1611616644324610116477412898e4, 0.0, }; static double q2[] = { -.4435757816794127856828016962e7, -.9934124389934585658967556309e7, -.6585339479723087072826915069e7, -.1511809506634160881644546358e7, -.1072638599110382011903063867e6, -.1455009440190496182453565068e4, 1.0, }; static double p3[] = { 0.3322091340985722351859704442e5, 0.8514516067533570196555001171e5, 0.6617883658127083517939992166e5, 0.1849426287322386679652009819e5, 0.1706375429020768002061283546e4, 0.3526513384663603218592175580e2, 0.0, }; static double q3[] = { 0.7087128194102874357377502472e6, 0.1819458042243997298924553839e7, 0.1419460669603720892855755253e7, 0.4002944358226697511708610813e6, 0.3789022974577220264142952256e5, 0.8638367769604990967475517183e3, 1.0, }; static double p4[] = { -.9963753424306922225996744354e23, 0.2655473831434854326894248968e23, -.1212297555414509577913561535e22, 0.2193107339917797592111427556e20, -.1965887462722140658820322248e18, 0.9569930239921683481121552788e15, -.2580681702194450950541426399e13, 0.3639488548124002058278999428e10, -.2108847540133123652824139923e7, 0.0, }; static double q4[] = { 0.5082067366941243245314424152e24, 0.5435310377188854170800653097e22, 0.2954987935897148674290758119e20, 0.1082258259408819552553850180e18, 0.2976632125647276729292742282e15, 0.6465340881265275571961681500e12, 0.1128686837169442121732366891e10, 0.1563282754899580604737366452e7, 0.1612361029677000859332072312e4, 1.0, }; double j1(arg) double arg;{ double xsq, n, d, x; double sin(), cos(), sqrt(); int i; x = arg; if(x < 0.) x = -x; if(x > 8.){ asympt(x); n = x - 3.*pio4; n = sqrt(tpi/x)*(pzero*cos(n) - qzero*sin(n)); if(arg <0.) n = -n; return(n); } xsq = x*x; for(n=0,d=0,i=8;i>=0;i--){ n = n*xsq + p1[i]; d = d*xsq + q1[i]; } return(arg*n/d); } double y1(arg) double arg;{ double xsq, n, d, x; double sin(), cos(), sqrt(), log(), j1(); int i; errno = 0; x = arg; if(x <= 0.){ errno = EDOM; return(-HUGE); } if(x > 8.){ asympt(x); n = x - 3*pio4; return(sqrt(tpi/x)*(pzero*sin(n) + qzero*cos(n))); } xsq = x*x; for(n=0,d=0,i=9;i>=0;i--){ n = n*xsq + p4[i]; d = d*xsq + q4[i]; } return(x*n/d + tpi*(j1(x)*log(x)-1./x)); } static asympt(arg) double arg;{ double zsq, n, d; int i; zsq = 64./(arg*arg); for(n=0,d=0,i=6;i>=0;i--){ n = n*zsq + p2[i]; d = d*zsq + q2[i]; } pzero = n/d; for(n=0,d=0,i=6;i>=0;i--){ n = n*zsq + p3[i]; d = d*zsq + q3[i]; } qzero = (8./arg)*(n/d); } rn(-HUGE); } if(x > 8.){ asympt(x); n = x - 3*pio4; return(sqrt(tpi/x)*(pzero*sin(n) + qzero*cos(n))); } xsq = x*x; for(n=0,d=0,i=9;i>=0;i--){ n = n*xsq + p4[i]; d = d*xsq + q4[i]; } return(x*n/d + tpi*(j1(x)*log(x)-1./lib/libm/jn.c 644 0 33 3254 2111463073 6300 /* floating point Bessel's function of the first and second kinds and of integer order. int n; double x; jn(n,x); returns the value of Jn(x) for all integer values of n and all real values of x. There are no error returns. Calls j0, j1. For n=0, j0(x) is called, for n=1, j1(x) is called, for nx, a continued fraction approximation to j(n,x)/j(n-1,x) is evaluated and then backward recursion is used starting from a supposed value for j(n,x). The resulting value of j(0,x) is compared with the actual value to correct the supposed value of j(n,x). yn(n,x) is similar in all respects, except that forward recursion is used for all values of n>1. */ #include #include int errno; double jn(n,x) int n; double x;{ int i; double a, b, temp; double xsq, t; double j0(), j1(); if(n<0){ n = -n; x = -x; } if(n==0) return(j0(x)); if(n==1) return(j1(x)); if(x == 0.) return(0.); if(n>x) goto recurs; a = j0(x); b = j1(x); for(i=1;in;i--){ t = xsq/(2.*i - t); } t = x/(2.*n-t); a = t; b = 1; for(i=n-1;i>0;i--){ temp = b; b = (2.*i/x)*b - a; a = temp; } return(t*j0(x)/b); } double yn(n,x) int n; double x;{ int i; int sign; double a, b, temp; double y0(), y1(); if (x <= 0) { errno = EDOM; return(-HUGE); } sign = 1; if(n<0){ n = -n; if(n%2 == 1) sign = -1; } if(n==0) return(y0(x)); if(n==1) return(sign*y1(x)); a = y0(x); b = y1(x); for(i=1;i0;i--){ temp = b; b = (2.*i/x)*b - a; a = temp; } return(t*j0(x)/b); } double yn(n,x) int n; double x;{ int i; int sign; double a, b, temp; double y0(), y1(); if (x <= 0) { errno = EDOM; return(-HUGE); } sign = 1; if(n<0){ n = -n; if(n%2 == 1) sign = -1lib/libm/log.c 644 0 33 2131 2111463073 6443 /* log returns the natural logarithm of its floating point argument. The coefficients are #2705 from Hart & Cheney. (19.38D) It calls frexp. */ #include #include int errno; double frexp(); static double log2 = 0.693147180559945309e0; static double ln10 = 2.302585092994045684; static double sqrto2 = 0.707106781186547524e0; static double p0 = -.240139179559210510e2; static double p1 = 0.309572928215376501e2; static double p2 = -.963769093368686593e1; static double p3 = 0.421087371217979714e0; static double q0 = -.120069589779605255e2; static double q1 = 0.194809660700889731e2; static double q2 = -.891110902798312337e1; double log(arg) double arg; { double x,z, zsq, temp; int exp; if(arg <= 0.) { errno = EDOM; return(-HUGE); } x = frexp(arg,&exp); while(x<0.5) { x = x*2; exp = exp-1; } if(x int errno; double log(), exp(); double pow(arg1,arg2) double arg1, arg2; { double temp; long l; if(arg1 <= 0.) { if(arg1 == 0.) { if(arg2 <= 0.) goto domain; return(0.); } l = arg2; if(l != arg2) goto domain; temp = exp(arg2 * log(-arg1)); if(l & 1) temp = -temp; return(temp); } return(exp(arg2 * log(arg1))); domain: errno = EDOM; return(0.); } 5< /,"lib/libm/sin.c 644 0 33 2524 2111463073 6461 ((/* C program for floating point sin/cos. Calls modf. There are no error exits. Coefficients are #3370 from Hart & Cheney (18.80D). */ static double twoopi = 0.63661977236758134308; static double p0 = .1357884097877375669092680e8; static double p1 = -.4942908100902844161158627e7; static double p2 = .4401030535375266501944918e6; static double p3 = -.1384727249982452873054457e5; static double p4 = .1459688406665768722226959e3; static double q0 = .8644558652922534429915149e7; static double q1 = .4081792252343299749395779e6; static double q2 = .9463096101538208180571257e4; static double q3 = .1326534908786136358911494e3; double cos(arg) double arg; { double sinus(); if(arg<0) arg = -arg; return(sinus(arg, 1)); } double sin(arg) double arg; { double sinus(); return(sinus(arg, 0)); } static double sinus(arg, quad) double arg; int quad; { double modf(); double e, f; double ysq; double x,y; int k; double temp1, temp2; x = arg; if(x<0) { x = -x; quad = quad + 2; } x = x*twoopi; /*underflow?*/ if(x>32764){ y = modf(x,&e); e = e + quad; modf(0.25*e,&f); quad = e - 4*f; }else{ k = x; y = x - k; quad = (quad + k) & 03; } if (quad & 01) y = 1-y; if(quad > 1) y = -y; ysq = y*y; temp1 = ((((p4*ysq+p3)*ysq+p2)*ysq+p1)*ysq+p0)*y; temp2 = ((((ysq+q3)*ysq+q2)*ysq+q1)*ysq+q0); return(temp1/temp2); } int quad; { double modf(); double e, f; double ysq; double x,y; int k; double temp1, temp2; x = arg; if(x<0) { x = -x; quad = quad + 2; } x = x*twoopi; /*unlib/libm/sinh.c 644 0 33 2451 2111463073 6630 /* sinh(arg) returns the hyperbolic sine of its floating- point argument. The exponential function is called for arguments greater in magnitude than 0.5. A series is used for arguments smaller in magnitude than 0.5. The coefficients are #2029 from Hart & Cheney. (20.36D) cosh(arg) is computed from the exponential function for all arguments. */ double exp(); static double p0 = -0.6307673640497716991184787251e+6; static double p1 = -0.8991272022039509355398013511e+5; static double p2 = -0.2894211355989563807284660366e+4; static double p3 = -0.2630563213397497062819489e+2; static double q0 = -0.6307673640497716991212077277e+6; static double q1 = 0.1521517378790019070696485176e+5; static double q2 = -0.173678953558233699533450911e+3; double sinh(arg) double arg; { double temp, argsq; register sign; sign = 1; if(arg < 0) { arg = - arg; sign = -1; } if(arg > 21.) { temp = exp(arg)/2; if (sign>0) return(temp); else return(-temp); } if(arg > 0.5) { return(sign*(exp(arg) - exp(-arg))/2); } argsq = arg*arg; temp = (((p3*argsq+p2)*argsq+p1)*argsq+p0)*arg; temp /= (((argsq+q2)*argsq+q1)*argsq+q0); return(sign*temp); } double cosh(arg) double arg; { if(arg < 0) arg = - arg; if(arg > 21.) { return(exp(arg)/2); } return((exp(arg) + exp(-arg))/2); } gsq; register sign; sign = 1; if(arg < 0) { arg = - arg; sign = -1; } if(arg > 21.) { temp = exp(arg)/2; if (sign>0) return(temp); else return(-temp); } if(arg > 0.5) { return(sign*(exp(alib/libm/sqrt.c 644 0 33 1300 2111463073 6650 /* sqrt returns the square root of its floating point argument. Newton's method. calls frexp */ #include int errno; double frexp(); double sqrt(arg) double arg; { double x, temp; int exp; int i; if(arg <= 0.) { if(arg < 0.) errno = EDOM; return(0.); } x = frexp(arg,&exp); while(x < 0.5) { x *= 2; exp--; } /* * NOTE * this wont work on 1's comp */ if(exp & 1) { x *= 2; exp--; } temp = 0.5*(1.0+x); while(exp > 60) { temp *= (1L<<30); exp -= 60; } while(exp < -60) { temp /= (1L<<30); exp += 60; } if(exp >= 0) temp *= 1L << (exp/2); else temp /= 1L << (-exp/2); for(i=0; i<=4; i++) temp = 0.5*(temp + arg/temp); return(temp); } emp; int exp; int i; if(arg <= 0.) { if(arg < 0.) errno = EDOM; return(0.); } x = frexp(arg,&exp); while(x < 0.5) { x *= 2; exp--; } /* * NOTE * this wont work on 1's comp */ if(exp & 1) { x *= 2; exp--; } temp = 0.5*(1.0+x); while(exp > 60) { temp *= (1L<<30); exp -= 60; } whillib/libm/tan.c 644 0 33 2461 2111463073 6452 /* floating point tangent A series is used after range reduction. Coefficients are #4285 from Hart & Cheney. (19.74D) */ #include #include int errno; static double invpi = 1.27323954473516268; static double p0 = -0.1306820264754825668269611177e+5; static double p1 = 0.1055970901714953193602353981e+4; static double p2 = -0.1550685653483266376941705728e+2; static double p3 = 0.3422554387241003435328470489e-1; static double p4 = 0.3386638642677172096076369e-4; static double q0 = -0.1663895238947119001851464661e+5; static double q1 = 0.4765751362916483698926655581e+4; static double q2 = -0.1555033164031709966900124574e+3; double tan(arg) double arg; { double modf(); double sign, temp, e, x, xsq; int flag, i; flag = 0; sign = 1.; if(arg < 0.){ arg = -arg; sign = -1.; } arg = arg*invpi; /*overflow?*/ x = modf(arg,&e); i = e; switch(i%4) { case 1: x = 1. - x; flag = 1; break; case 2: sign = - sign; flag = 1; break; case 3: x = 1. - x; sign = - sign; break; case 0: break; } xsq = x*x; temp = ((((p4*xsq+p3)*xsq+p2)*xsq+p1)*xsq+p0)*x; temp = temp/(((1.0*xsq+q2)*xsq+q1)*xsq+q0); if(flag == 1) { if(temp == 0.) { errno = ERANGE; if (sign>0) return(HUGE); return(-HUGE); } temp = 1./temp; } return(sign*temp); } = -1.; } arg = arg*invpi; /*overflow?*/ x = modf(arg,&e); i = e; switch(i%4) { case 1: x = 1. - x; flag = 1; break; case 2: sign = - sign; flag = 1; break; case 3: x = 1. - x; siglib/libm/tanh.c 644 0 33 570 2111463073 6601 /* tanh(arg) computes the hyperbolic tangent of its floating point argument. sinh and cosh are called except for large arguments, which would cause overflow improperly. */ double sinh(), cosh(); double tanh(arg) double arg; { double sign; sign = 1.; if(arg < 0.){ arg = -arg; sign = -1.; } if(arg > 21.) return(sign); return(sign*sinh(arg)/cosh(arg)); } switch(i%4) { case 1: x = 1. - x; flag/,5̇ /,"lib/libm/gamma.c 644 0 33 4027 2145675020 6756 /* C program for floating point log gamma function gamma(x) computes the log of the absolute value of the gamma function. The sign of the gamma function is returned in the external quantity signgam. The coefficients for expansion around zero are #5243 from Hart & Cheney; for expansion around infinity they are #5404. Calls log and sin. */ #include #include int errno; int signgam = 0; static double goobie = 0.9189385332046727417803297; static double pi = 3.1415926535897932384626434; #define M 6 #define N 8 static double p1[] = { 0.83333333333333101837e-1, -.277777777735865004e-2, 0.793650576493454e-3, -.5951896861197e-3, 0.83645878922e-3, -.1633436431e-2, }; static double p2[] = { -.42353689509744089647e5, -.20886861789269887364e5, -.87627102978521489560e4, -.20085274013072791214e4, -.43933044406002567613e3, -.50108693752970953015e2, -.67449507245925289918e1, 0.0, }; static double q2[] = { -.42353689509744090010e5, -.29803853309256649932e4, 0.99403074150827709015e4, -.15286072737795220248e4, -.49902852662143904834e3, 0.18949823415702801641e3, -.23081551524580124562e2, 0.10000000000000000000e1, }; double gamma(arg) double arg; { double log(), pos(), neg(), asym(); signgam = 1.; if(arg <= 0.) return(neg(arg)); if(arg > 8.) return(asym(arg)); return(log(pos(arg))); } static double asym(arg) double arg; { double log(); double n, argsq; int i; argsq = 1./(arg*arg); for(n=0,i=M-1; i>=0; i--){ n = n*argsq + p1[i]; } return((arg-.5)*log(arg) - arg ((+ goobie + n/arg); } static double neg(arg) double arg; { double temp; double log(), sin(), pos(); arg = -arg; temp = sin(pi*arg); if(temp == 0.) { errno = EDOM; return(HUGE); } if(temp < 0.) temp = -temp; else signgam = -1; return(-log(arg*pos(arg)*temp/pi)); } static double pos(arg) double arg; { double n, d, s; register i; if(arg < 2.) return(pos(arg+1.)/arg); if(arg > 3.) return((arg-1.)*pos(arg-1.)); s = arg - 2.; for(n=0,d=0,i=N-1; i>=0; i--){ n = n*s + p2[i]; d = d*s + q2[i]; } return(n/d); } tatic double neg(arg) double arg; { double temp; double log(), sin(), pos(); arg = -arg; temp = sin(pi*arg); if(temp == 0.) { errno = EDOM; return(HUGE); } if(temp < 0.) temp = -temp; else signgam = -1; return(-log(arg*pos(arg)*temp/pi)); } static double pos(arg) double arg; { double n, d, s; register i; if(arg < 2.) return(pos(arg+1.)/arg); if(arg > 3.) return((arg-1.)*pos(arg-1.)); s = arg - 2.; for(n=0,d=0,i=N-1; i>=0; i--){ n = n*s + p2[i]; d = d*s + q2[lib/libmp/ 775 0 33 0 2552602403 5617 lib/libmp/gcd.c 644 0 33 1402 2111463073 6577 #include gcd(a,b,c) MINT *a,*b,*c; { MINT x,y,z,w; x.len=y.len=z.len=w.len=0; move(a,&x); move(b,&y); while(y.len!=0) { mdiv(&x,&y,&w,&z); move(&y,&x); move(&z,&y); } move(&x,c); xfree(&x); xfree(&y); xfree(&z); xfree(&w); return; } invert(a, b, c) MINT *a, *b, *c; { MINT x, y, z, w, Anew, Aold; int i = 0; x.len = y.len = z.len = w.len = Aold.len = 0; Anew.len = 1; Anew.val = xalloc(1); *Anew.val = 1; move(b, &x); move(a, &y); while(y.len != 0) { mdiv(&x, &y, &w, &z); move(&Anew, &x); mult(&w, &Anew, &Anew); madd(&Anew, &Aold, &Anew); move(&x, &Aold); move(&y, &x); move(&z, &y); i++; } move(&Aold, c); if( (i&01) == 0) msub(b, c, c); xfree(&x); xfree(&y); xfree(&z); xfree(&w); xfree(&Aold); xfree(&Anew); } vert(a, b, c) MINT *a, *b, *c; { MINT x, y, z, w, Anew, Aold; int i = 0; x.len = y.len = z.len = w.len = Aold.len = 0; Anew.len = 1; Anew.val = xalloc(1); *Anew.val = 1; move(b, &x); move(a, &y); while(y.len != 0) { mdiv(&x, &y, &w, &z); move(lib/libmp/madd.c 644 0 33 4364 2111463073 6761 #include m_add(a,b,c) struct mint *a,*b,*c; { int carry,i; int x; short *cval; cval=xalloc(a->len+1,"m_add"); carry=0; for(i=0;ilen;i++) { x=carry+a->val[i]+b->val[i]; if(x&0100000) { carry=1; cval[i]=x&077777; } else { carry=0; cval[i]=x; } } for(;ilen;i++) { x=carry+a->val[i]; if(x&0100000) cval[i]=x&077777; else { carry=0; cval[i]=x; } } if(carry==1) { cval[i]=1; c->len=i+1; } else c->len=a->len; c->val=cval; if(c->len==0) shfree(cval); return; } madd(a,b,c) struct mint *a,*b,*c; { struct mint x,y,z; int sign; x.len=a->len; x.val=a->val; y.len=b->len; y.val=b->val; z.len=0; sign=1; if(x.len>=0) if(y.len>=0) if(x.len>=y.len) m_add(&x,&y,&z); else m_add(&y,&x,&z); else { y.len= -y.len; msub(&x,&y,&z); } else if(y.len<=0) { x.len = -x.len; y.len= -y.len; sign= -1; madd(&x,&y,&z); } else { x.len= -x.len; msub(&y,&x,&z); } xfree(c); c->val=z.val; c->len=sign*z.len; return; } m_sub(a,b,c) struct mint *a,*b,*c; { int x,i; int borrow; short one; struct mint mone; one=1; mone.len= 1; mone.val= &one; c->val=xalloc(a->len,"m_sub"); borrow=0; for(i=0;ilen;i++) { x=borrow+a->val[i]-b->val[i]; if(x&0100000) { borrow= -1; c->val[i]=x&077777; } else { borrow=0; c->val[i]=x; } } for(;ilen;i++) { x=borrow+a->val[i]; if(x&0100000) c->val[i]=x&077777; else { borrow=0; c->val[i]=x; } } if(borrow<0) { for(i=0;ilen;i++) c->val[i] ^= 077777; c->len=a->len; madd(c,&mone,c); } for(i=a->len-1;i>=0;--i) if(c->val[i]>0) { if(borrow==0) c->len=i+1; else c->len= -i-1; return; } shfree(c->val); return; } msub(a,b,c) struct mint *a,*b,*c; { struct mint x,y,z; int sign; x.len=a->len; y.len=b->len; x.val=a->val; y.val=b->val; z.len=0; sign=1; if(x.len>=0) if(y.len>=0) if(x.len>=y.len) m_sub(&x,&y,&z); else { sign= -1; msub(&y,&x,&z); } else { y.len= -y.len; madd(&x,&y,&z); } else if(y.len<=0) { sign= -1; x.len= -x.len; y.len= -y.len; msub(&y,&x,&z); } else { x.len= -x.len; madd(&x,&y,&z); sign= -1; } if(a==c && x.len!=0) xfree(a); else if(b==c && y.len!=0) xfree(b); else xfree(c); c->val=z.val; c->len=sign*z.len; return; } y.len=b->len; x.val=a->val; y.val=b->val; z.len=0; sign=1; if(x.len>=0) if(y.len>=0) if(x.len>=y.len) m_sub(&x,&y,&z); else { sign= -1; msub(&y,&x,&z); } else { y.len= -y.len; madd(&x,&y,&z); } else if(y.len<=0) { sign= -1; x.lenlib/libmp/mdiv.c 644 0 33 3671 2111463073 7013 #include mdiv(a,b,q,r) MINT *a,*b,*q,*r; { MINT x,y; int sign; sign=1; x.val=a->val; y.val=b->val; x.len=a->len; if(x.len<0) {sign= -1; x.len= -x.len;} y.len=b->len; if(y.len<0) {sign= -sign; y.len= -y.len;} xfree(q); xfree(r); m_div(&x,&y,q,r); if(sign==-1) { q->len= -q->len; r->len = - r->len; } return; } m_dsb(q,n,a,b) short *a,*b; { long int x,qx; int borrow,j,u; qx=q; borrow=0; for(j=0;j>15; } x=borrow+b[j]; b[j]=x&077777; if(x>>15 ==0) { return(0);} borrow=0; for(j=0;jlen==0) { fatal("mdiv divide by zero"); return;} if(b->len==1) { r->val=xalloc(1,"m_div1"); sdiv(a,b->val[0],q,r->val); if(r->val[0]==0) { shfree(r->val); r->len=0; } else r->len=1; return; } if(a->len < b->len) { q->len=0; r->len=a->len; r->val=xalloc(r->len,"m_div2"); for(qq=0;qqlen;qq++) r->val[qq]=a->val[qq]; return; } x.len=1; x.val = &d; n=b->len; d=0100000L/(b->val[n-1]+1L); mult(a,&x,&u); /*subtle: relies on fact that mult allocates extra space */ mult(b,&x,&v); v1=v.val[n-1]; v2=v.val[n-2]; qval=xalloc(a->len-n+1,"m_div3"); for(j=a->len-n;j>=0;j--) { qq=m_trq(v1,v2,u.val[j+n],u.val[j+n-1],u.val[j+n-2]); if(m_dsb(qq,n,v.val,&(u.val[j]))) qq -= 1; qval[j]=qq; } x.len=n; x.val=u.val; mcan(&x); sdiv(&x,d,&w,(short *)&qq); r->len=w.len; r->val=w.val; q->val=qval; qq=a->len-n+1; if(qq>0 && qval[qq-1]==0) qq -= 1; q->len=qq; if(qq==0) shfree(qval); if(x.len!=0) xfree(&u); xfree(&v); return; } act that mult allocates extra space */ mult(b,&x,&v); v1=v.val[n-1]; lib/libmp/mout.c 644 0 33 3750 2111463073 7036 #include #include m_in(a,b,f) MINT *a; FILE *f; { MINT x,y,ten; int sign,c; short qten,qy; xfree(a); sign=1; ten.len=1; ten.val= &qten; qten=b; x.len=0; y.len=1; y.val= &qy; while((c=getc(f))!=EOF) switch(c) { case '\\': getc(f); continue; case '\t': case '\n': a->len *= sign; xfree(&x); return(0); case ' ': continue; case '-': sign = -sign; continue; default: if(c>='0' && c<= '9') { qy=c-'0'; mult(&x,&ten,a); madd(a,&y,a); move(a,&x); continue; } else { VOID ungetc(c,stdin); a->len *= sign; return(0); } } return(EOF); } m_out(a,b,f) MINT *a; FILE *f; { int sign,xlen,i; short r; MINT x; char *obuf; register char *bp; sign=1; xlen=a->len; if(xlen<0) { xlen= -xlen; sign= -1; } if(xlen==0) { fprintf(f,"0\n"); return; } x.len=xlen; x.val=xalloc(xlen,"m_out"); for(i=0;ival[i]; obuf=(char *)malloc(7*xlen); bp=obuf+7*xlen-1; *bp--=0; while(x.len>0) { for(i=0;i<10&&x.len>0;i++) { sdiv(&x,b,&x,&((r); *bp--=r+'0'; } if(x.len>0) *bp--=' '; } if(sign==-1) *bp--='-'; fprintf(f,"%s\n",bp+1); free(obuf); FREE(x) return; } sdiv(a,n,q,r) MINT *a,*q; short *r; { MINT x,y; int sign; sign=1; x.len=a->len; x.val=a->val; if(n<0) { sign= -sign; n= -n; } if(x.len<0) { sign = -sign; x.len= -x.len; } s_div(&x,n,&y,r); xfree(q); q->val=y.val; q->len=sign*y.len; *r = *r*sign; return; } s_div(a,n,q,r) MINT *a,*q; short *r; { int qlen,i; long int x; short *qval; x=0; qlen=a->len; qval=xalloc(qlen,"s_div"); for(i=qlen-1;i>=0;i--) { x=x*0100000L+a->val[i]; qval[i]=x/n; x=x%n; } *r=x; if(qval[qlen-1]==0) qlen--; q->len=qlen; q->val=qval; if(qlen==0) shfree(qval); return; } min(a) MINT *a; { return(m_in(a,10,stdin)); } omin(a) MINT *a; { return(m_in(a,8,stdin)); } mout(a) MINT *a; { m_out(a,10,stdout); } omout(a) MINT *a; { m_out(a,8,stdout); } fmout(a,f) MINT *a; FILE *f; { m_out(a,10,f); } fmin(a,f) MINT *a; FILE *f; { return(m_in(a,10,f)); } x=0; qlen=a->len; qvlib/libmp/msqrt.c 644 0 33 1211 2111463074 7207 #include msqrt(a,b,r) MINT *a,*b,*r; { MINT x,junk,y; int j; x.len=junk.len=y.len=0; if(a->len<0) fatal("msqrt: neg arg"); if(a->len==0) { b->len=0; r->len=0; return(0); } if(a->len%2==1) x.len=(1+a->len)/2; else x.len=1+a->len/2; x.val=xalloc(x.len,"msqrt"); for(j=0;jlen%2==1) x.val[x.len-1]=0400; else x.val[x.len-1]=1; xfree(b); xfree(r); loop: mdiv(a,&x,&y,&junk); xfree(&junk); madd(&x,&y,&y); sdiv(&y,2,&y,(short *)&j); if(mcmp(&x,&y)>0) { xfree(&x); move(&y,&x); xfree(&y); goto loop; } xfree(&y); move(&x,b); mult(&x,&x,&x); msub(a,&x,r); xfree(&x); return(r->len); } a->len==0) { b->len=0; r->len=0; return(0); } if(a->len%2==1) x.len=(1+a->len)/2; else x.len=1+a->len/2; x.val=xalloc(x.len,"msqrt"); for(j=0;jlen%2==1) x.val[x.len-1]=0400; else x.val[x.len-1]=1; xfree(b); xfree(r); loop: mdiv(a,&x,&y,&junk); xfree(&junk); madd(&x,&y,&y); sdiv(&y,2,&y,(short *)&j); if(mcmp(&x,&y)>0) { xfree(lib/libmp/mult.c 644 0 33 2525 2111463074 7033 #include mult(a,b,c) struct mint *a,*b,*c; { struct mint x,y,z; int sign; sign = 1; x.val=a->val; y.val=b->val; z.len=0; if(a->len<0) { x.len= -a->len; sign= -sign; } else x.len=a->len; if(b->len<0) { y.len= -b->len; sign= -sign; } else y.len=b->len; if(x.lenlen= -z.len; else c->len=z.len; if(c->len==0) shfree(z.val); else c->val=z.val; return; } #define S2 x=a->val[j]; #define S3 x=x*b->val[i-j]; #define S4 tradd(&carry,&sum,x); #define S5 c->val[i]=sum.yy.low&077777; #define S6 sum.xx=sum.xx>>15; #define S7 sum.yy.high=carry; m_mult(a,b,c) struct mint *a,*b,*c; { long x; union {long xx; struct half yy;} sum; int carry; int i,j; c->val=xalloc(a->len+b->len,"m_mult"); sum.xx=0; for(i=0;ilen;i++) { carry=0; for(j=0;jlen;i++) { carry=0; for(j=i-b->len+1;jlen+b->len;i++) { carry=0; for(j=i-b->len+1;jlen;j++) { S2 S3 S4 } S5 S6 S7 } if(c->val[i-1]!=0) c->len=a->len+b->len; else c->len=a->len+b->len-1; return; } tradd(a,b,c) long c; int *a; union g {long xx; struct half yy;} *b; { b->xx= b->xx+c; if(b->yy.high&0100000) { b->yy.high= b->yy.high&077777; *a += 1; } return; } { S2 S3 S4 } S5 S6 S7 } for(;ilen;i++) { carry=0; for(j=i-b->len+1;jlen+b->len;i++) lib/libmp/pow.c 644 0 33 1157 2111463074 6657 #include pow(a,b,c,d) MINT *a,*b,*c,*d; { int i,j,n; MINT x,y; x.len=y.len=0; xfree(d); d->len=1; d->val=xalloc(1,"pow"); *d->val=1; for(j=0;jlen;j++) { n=b->val[b->len-j-1]; for(i=0;i<15;i++) { mult(d,d,&x); mdiv(&x,c,&y,d); if((n=n<<1)&0100000) { mult(a,d,&x); mdiv(&x,c,&y,d); } } } xfree(&x); xfree(&y); return; } rpow(a,n,b) MINT *a,*b; { MINT x,y; int i; x.len=1; x.val=xalloc(1,"rpow"); *x.val=n; y.len=n*a->len+4; y.val=xalloc(y.len,"rpow2"); for(i=0;ival=xalloc(1,"pow"); *d->val=1; for(j=0;jlen;j++) { n=b->val[b->len-j-1]; for(i=0;i<15;i++) { mult(d,d,&x); mdiv(&x,c,&y,d); if((n=n<<1)&0100000) { mult(a,d,&x); mdiv(&x,c,&y,d); } } } xfree(&x); xfree(&y); return; } rpow(a,n,b) MINT *a,*b; { MINT x,y; int i; x.len=1; x.val=xalloc(1,"rpow"); *x.val=n; y.len=n*a->len+4; y.val=xalloc(y.len,"rpow2"); for(i=0;ilib/libmp/util.c 644 0 33 2467 2111463074 7034 char *malloc(); #ifdef lint int xv_oid; #endif #include #include move(a,b) MINT *a,*b; { int i,j; xfree(b); b->len=a->len; if((i=a->len)<0) i = -i; if(i==0) return; b->val=xalloc(i,"move"); for(j=0;jval[j]=a->val[j]; return; } dummy(){} short *xalloc(nint,s) char *s; { short *i; i=(short *)malloc(2*(unsigned)nint+4); #ifdef DBG if(dbg) fprintf(stderr, "%s: %o\n",s,i); #endif if(i!=NULL) return(i); fatal("mp: no free space"); return(0); } fatal(s) char *s; { fprintf(stderr,"%s\n",s); VOID fflush(stdout); sleep(2); abort(); } xfree(c) MINT *c; { #ifdef DBG if(dbg) fprintf(stderr, "xfree "); #endif if(c->len==0) return; shfree(c->val); c->len=0; return; } mcan(a) MINT *a; { int i,j; if((i=a->len)==0) return; else if(i<0) i= -i; for(j=i;j>0 && a->val[j-1]==0;j--); if(j==i) return; if(j==0) { xfree(a); return; } if(a->len > 0) a->len=j; else a->len = -j; } MINT *itom(n) { MINT *a; a=(MINT *)xalloc(2,"itom"); if(n>0) { a->len=1; a->val=xalloc(1,"itom1"); *a->val=n; return(a); } else if(n<0) { a->len = -1; a->val=xalloc(1,"itom2"); *a->val= -n; return(a); } else { a->len=0; return(a); } } mcmp(a,b) MINT *a,*b; { MINT c; int res; if(a->len!=b->len) return(a->len-b->len); c.len=0; msub(a,b,&c); res=c.len; xfree(&c); return(res); } ; if(j==i) return; if(j==0) { xfree(a); return; } if(a->len > 0) a->len=j; else a->len = -j; } MINT *itom(n) { MINT *a; a=(MINT *)xalloc(2,"itom"); if(n>0) { a->len=1; a->val=xalloc(1,"itolib/libmp/Makefile 644 0 33 315 2413065274 7326 DESTDIR= CFLAGS=-O OBJS= pow.o gcd.o msqrt.o mdiv.o mout.o mult.o madd.o util.o libmp.a: $(OBJS) ar cr libmp.a $(OBJS) install: libmp.a install -c libmp.a ${DESTDIR}/usr/lib clean: rm -f *.o libmp.a f(a->len!=b->len) return(a->len-b->len); c.len=0; msub(a,b,&c); res=c.len; xfree(&c); return(res); } ; if(j==i) return; if(j==0) { xfree(a); return; } if(a->len > 0) a->len=j; else a->len = -j; } MINT */,5L /,"lib/libnm/ 775 0 33 0 2552602437 5624 lib/libnm/asin.s 644 0 33 1254 2400311124 7005 ((#double asin(arg) #double arg; -1.0<=arg<=1.0 or an out of range error return #method: call atan() after range reduction # calls: satan (internal entry point of atan.s), _sqrt # J F Jarvis August 8, 1078 .globl _asin .globl _errno .globl _sqrt .globl satan .set EDOM,33 .text .align 1 _asin: .word 0x0c0 movd 4(ap),r6 jgtr a1 mnegd r6,r6 a1: cmpd r6,$0d1.0e+0 jleq a2 movl $EDOM,_errno clrd r0 ret # a2: muld3 r6,r6,r0 subd3 r0,$0d1.0e+0,-(sp) calls $2,_sqrt cmpd r6,$0d0.6875 jleq a3 divd2 r6,r0 jsb satan subd3 r0,pio2,r0 jbr a4 a3: divd3 r0,r6,r0 jsb satan a4: tstd 4(ap) jleq a5 ret a5: mnegd r0,r0 ret .data .align 2 pio2: .double 0d1.57079632679489661923e+0 qrt # J F Jarvis August 8, 1078 .globl _asin .globl _errno .globl _sqrt .globl satan .set EDOM,33 .text .align 1 _asin: .word 0x0c0 movd 4(ap),r6 jgtr a1 mnegd r6,r6 a1: cmpd r6,$0d1.0e+0 jleq a2 movl $EDOM,_errno clrd r0 ret # a2: muld3 r6,r6,r0 subd3 r0,$0d1.0e+0,-(sp) calls $2,_sqrt cmpd r6,$0d0.6875 jleq a3 divd2 r6,r0 jlib/libnm/atan.s 644 0 33 3625 2400311136 7005 # double atan(arg1); -pi/2 < atan < pi/2 #double atan2(arg1,arg2); -pi< atan2=0 ret # .align 1 _atan2: .word 0x03c0 movd 4(ap),r0 # atan(arg1/arg2) movd 12(ap),r2 addd3 r0,r2,r4 cmpd r0,r4 jneq b1 tstd r0 jgeq b2 mnegd pio2,r0 ret b2: movd pio2,r0 ret # b1: tstd r2 jgeq b3 divd2 r2,r0 jleq b4 bsbb satan # arg1<0, arg2<0 subd2 pi,r0 ret b4: mnegd r0,r0 # arg1>0, arg2<0 bsbb satan subd3 r0,pi,r0 ret # b3: divd2 r2,r0 jleq b5 bsbb satan # arg1>0, arg2>0 ret b5: mnegd r0,r0 # arg1<0, arg2>0 bsbb satan mnegd r0,r0 ret # .globl satan satan: # range reduction on positive arg(r0) cmpd r0,sq2m1 jgeq c1 bsbb xatan rsb c1: cmpd r0,sq2p1 jleq c2 divd3 r0,$0d1.0e+0,r0 bsbb xatan subd3 r0,pio2,r0 rsb c2: addd3 $0d1.0e+0,r0,r2 subd2 $0d1.0e+0,r0 divd2 r2,r0 bsbb xatan addd2 pio4,r0 rsb # xatan: # compute arctan(r0) for:sqrt(2)-1 int errno; double atan(); double asin(); static double pio2 = 1.570796326794896619; double acos(arg) double arg; { if(arg > 1.|| arg < -1.){ errno = EDOM; return(0.); } return(pio2 - asin(arg)); } 6188251e-7 .double 0d0.275569807356154e-5 .double 0d0.19841270279079/,5| /,"lib/libnm/pow.c 644 0 33 676 2111463073 11362 1lib/libm/pow.clib/libnm/README 644 0 33 604 2400311614 6531 20 Aug 80 Robert Henry, UCB All alignments on a double word boundary (via .align 3) converted to .align 2, as that is all that the assembler guarantees. (NB: Floating point values can be aligned on any boundary...) A bug in exp.s attempted to relocate an immediate floating point constant; this makes no sense. movd $huge, r0 changed to movd huge, r0 which is what they wanted anyway 4e-5 .double 0d0.19841270279079/,5 /,"lib/libnm/badtan.s 644 0 33 2227 2400311161 7306 # double tan(arg) # double arg; #method: range reduction to [0,pi/4] followed by polynomial # approximation: Hart&Cheney TAN 4285 D=19.74 .globl _tan .text .align 1 _tan: .word 0x07c0 clrl r10 # sign flag, !=0 negate result movd 4(ap),r0 jgeq c1 xorw2 $0x8000,r10 mnegd r0,r0 c1: emodd fopi,fopix,r0,r2,r6 bicl2 $~3,r2 caseb r2,$0,$3 a0: .word a1-a0,a2-a0,a3-a0,a4-a0 a2: subd3 r6,$0d1.0e+0,r6 jbr b1 a3: xorw2 $0x8000,r10 b1: bsbb rtan jneq b2 # tests final result cmptd in rtan movd $0d1.7e+38,r0 jmp b3 b2: divd3 r0,$0d1.0e+0,r0 b3: xorw2 r10,r0 # negate result if flag != 0 ret a4: subd3 r6,$0d1.0e+0,r6 xorw2 $0x8000,r10 a1: bsbb rtan xorw2 r10,r0 ret rtan: muld3 r6,r6,r8 polyd r8,$4,pcoef muld2 r0,r6 polyd r8,$3,qcoef divd3 r0,r6,r0 rsb .data .align 2 pcoef: .double 0d0.33866386426771720960e-4 .double 0d0.34225543872410034353e-1 .double 0d-0.15506856534832663769e+2 .double 0d0.10559709017149531936e+4 .double 0d-0.13068202647548256682e+5 qcoef: .double 0d1.0e+0 .double 0d-0.15550331640317099669e+3 .double 0d0.47657513629164836989e+4 .double 0d-0.16638952389471190018e+5 fopi: .double 0d1.27323954473516268e+0 fopix: .byte 0x29 r10,r0 ret rtan: muld3 r6,r6,r8 polyd r8,$4,pcoef muld2 r0,r6 polyd r8,$3,qcoef divd3 r0,r6,r0 rsb .data .align 2 pcoef: .double 0d0.33866386426771720960e-4 .double 0d0.34225543872410034353e-1 .double 0d-0.15506856534832663769e+2 .double 0d0.10559709017149531936e+4 .double 0d-0.13068202647548256682e+5 qcoef: .double 0d1.0e+0 .double 0d-0.155503lib/libnm/sqrt.s.old 644 0 33 1777 2400311353 7637 # double sqrt(arg) # double arg # if(arg<0.0) { _errno=EDOM; return(0.0) } # J. F. Jarvis August 2, 1978 .set EDOM,98 .text .align 1 .globl _sqrt .globl _errno _sqrt: .word 0x0c0 movd 4(ap),r4 jgtr range jeql retz movl $EDOM,_errno retz: clrd r0 ret # range: extzv $7,$8,r4,r6 # r6 is exponent of arg insv $128,$7,$8,r4 # r2: 0.5<=fraction(arg)<1.0 incl r6 clrl r7 ediv $2,r6,r6,r7 # r6=(exp+1)/2; r7=(exp+1)%2 addb2 $64,r6 # r6 is correct exponent for result polyf r4,$4,pcoef # init estimate of sqrt(frac) # Hart&Cheney SQRT 0132 D=5.1 divd3 r0,r4,r2 # Newtons method, 2 iterations addd2 r2,r0 muld2 $0d0.5e+0,r0 divd3 r0,r4,r2 # Hart&Cheney 6.1.7 addd2 r2,r0 #d=21 at exit muld2 hc[r7],r0 # *sqrt(2) requ for even org exp. insv r6,$7,$8,r0 # insert correct exp. ret .data .align 2 pcoef: .float 0f-0.1214683825e+0 .float 0f0.5010420763e+0 .float 0f-0.9093210498e+0 .float 0f0.1300669049e+1 .float 0f0.2290699453e+0 hc: .double 0d0.35355339059327376220e+0 # sqrt(2)/4 .double 0d0.5e+0 slib/MAKE 644 0 33 150 2504476421 5221 for i in */. do echo " ======= $i"; date cd $i; make; make DESTDIR=$DESTDIR install clean; cd .. done ff, size)) < 0) { perror("re< < a9etur02552607260f_t Ls< a9lag)00000004522ag; long off; { long ret; if ((ret = lseek(fd, off, flag)) == -1L) { perror("lseek"); exit(1); } return ret; } Create(file, mode) char *file; int mode; { register int fd; i fd = cre //( ,( 5L /\@,\D"lib/libtermlib/ 775 0 33 0 2552605574 6655 lib/libtermlib/tgoto.c 644 0 33 6751 2373172417 10245 /* Copyright (c) 1979 Regents of the University of California */ #define CTRL(c) ('c' & 037) char *UP; char *BC; /* * Routine to perform cursor addressing. * CM is a string containing printf type escapes to allow * cursor addressing. We start out ready to print the destination * line, and switch each time we print row or column. * The following escapes are defined for substituting row/column: * * %d as in printf * %2 like %2d * %3 like %3d * %. gives %c hacking special case characters * %+x like %c but adding x first * * The codes below affect the state but don't use up a value. * * %>xy if value > x add y * %r reverses row/column * %i increments row/column (for one origin indexing) * %% gives % * %B BCD (2 decimal digits encoded in one byte) * %D Delta Data (backwards bcd) * * all other characters are ``self-inserting''. */ char * tgoto(CM, destcol, destline) char *CM; int destcol, destline; { static char result[16]; static char added[10]; char *cp = CM; register char *dp = result; register int c; int oncol = 0; register int which = destline; if (cp == 0) { toohard: /* * ``We don't do that under BOZO's big top'' */ return ("OOPS"); } added[0] = 0; while (c = *cp++) { if (c != '%') { *dp++ = c; continue; } switch (c = *cp++) { #ifdef CM_N case 'n': destcol ^= 0140; destline ^= 0140; goto setwhich; #endif case 'd': if (which < 10) goto one; if (which < 100) goto two; /* fall into... */ case '3': *dp++ = (which / 100) | '0'; which %= 100; /* fall into... */ case '2': two: *dp++ = which / 10 | '0'; one: *dp++ = which % 10 | '0'; swap: oncol = 1 - oncol; setwhich: which = oncol ? destcol : destline; continue; #ifdef CM_GT case '>': if (which > *cp++) which += *cp++; else cp++; continue; #endif case '+': which += *cp++; /* fall into... */ case '.': casedot: /* * This code is worth scratching your head at for a * while. The idea is that various weird th((ings can * happen to nulls, EOT's, tabs, and newlines by the * tty driver, arpanet, and so on, so we don't send * them if we can help it. * * Tab is taken out to get Ann Arbors to work, otherwise * when they go to column 9 we increment which is wrong * because bcd isn't continuous. We should take out * the rest too, or run the thing through more than * once until it doesn't make any of these, but that * would make termlib (and hence pdp-11 ex) bigger, * and also somewhat slower. This requires all * programs which use termlib to stty tabs so they * don't get expanded. They should do this anyway * because some terminals use ^I for other things, * like nondestructive space. */ if (which == 0 || which == CTRL(d) || which == '\t' || which == '\n') { if (oncol || UP) /* Assumption: backspace works */ /* * Loop needed because newline happens * to be the successor of tab. */ do { strcat(added, oncol ? (BC ? BC : "\b") : UP); which++; } while (which == '\n'); } *dp++ = which; goto swap; case 'r': oncol = 1; goto setwhich; case 'i': destcol++; destline++; which++; continue; case '%': *dp++ = c; continue; #ifdef CM_B case 'B': which = (which/10 << 4) + which%10; continue; #endif #ifdef CM_D case 'D': which = which - 2 * (which%16); continue; #endif default: goto toohard; } } strcpy(dp, added); return (result); } dded, oncol ? (BC ? BC lib/libtermlib/makefile 644 0 33 1031 2416607170 10424 CFLAGS= -O -DCM_N -DCM_GT -DCM_B -DCM_D termcap.a: termcap.o tgoto.o tputs.o ar cr termcap.a termcap.o tgoto.o tputs.o clean: -rm -f *.o -rm -f termcap.a install: termcap.a install -c termcap.a ${DESTDIR}/usr/lib/libtermcap.a -rm -f ${DESTDIR}/usr/lib/libtermlib.a ln ${DESTDIR}/usr/lib/libtermcap.a ${DESTDIR}/usr/lib/libtermlib.a ranlib ${DESTDIR}/usr/lib/libtermcap.a VGRIND= csh /usr/ucb/vgrind vgrind: cp /dev/null index ${VGRIND} -h "Termcap library" termcap.c tputs.c tgoto.c ${VGRIND} -h "Termcap library" -x index -DCM_B -DCM_D termcap.a: termcap.o tgoto.o tputs.o ar cr termcap.a termcap.o tgoto.o tputs.o clean: -rm -f *.o -rm -f termcap.a install: termcap.a install -c termcap.a ${DESTDIR}/usr/lib/libtermcap.a -rm -f ${DESTDIR}/usr/lib/libtermlib.a ln ${DESTDIR}/usr/lib/libtermcap.a ${DESTDIR}/usr/lib/libtermlib.a ranlib ${DESTDIR}/usr/lib/libtermcap.a VGRIND= csh /usr/ucb/vgrind vgrind: cp /dev/null index ${VGRIND} -h "Termcap library" termcap.c tputs.c tgoto.c ${VGRIND} -h "Tlib/libtermlib/tc1.c 644 0 33 543 2242766415 7553 /* * tc1 [term] * dummy program to test termlib. * gets entry, counts it, and prints it. */ #include char buf[1024]; char *getenv(); main(argc, argv) char **argv; { char *p; int rc; if (argc < 2) p = getenv("TERM"); else p = argv[1]; rc = tgetent(buf,p); printf("tgetent returns %d, len=%d, text=\n'%s'\n",rc,strlen(buf),buf); } DIR}/usr/lib/libtermcap.a VGRIND= csh /usr/ucb/vgrind vgrind: c/,5 /,"lib/libtermlib/tc2.c 644 0 33 1456 2242766352 7600 /* * tc2 [term] * Dummy program to test out termlib. * Commands are "tcc\n" where t is type (s for string, f for flag, * or n for number) and cc is the name of the capability. */ #include char buf[1024]; char *getenv(), *tgetstr(); main(argc, argv) char **argv; { char *p, *q; int rc; char b[3], c; char area[200]; if (argc < 2) p = getenv("TERM"); else p = argv[1]; rc = tgetent(buf,p); for (;;) { c = getchar(); if (c < 0) exit(0); b[0] = getchar(); if (b[0] < ' ') exit(0); b[1] = getchar(); b[2] = 0; getchar(); switch(c) { case 'f': printf("%s: %d\n",b,tgetflag(b)); break; case 'n': printf("%s: %d\n",b,tgetnum(b)); break; case 's': q = area; printf("%s: %s\n",b,tgetstr(b,&q)); break; default: exit(0); } } } char b[3], c; char area[200]; if (argc < 2) p = getenv("TERM"); else p = argv[1]; rc = tgetent(buf,p); for (;;) { c = getchar(); if (c < 0) exit(0); b[0] = getchar(); if (b[0] < ' ') elib/libtermlib/termcap.c 644 0 33 15150 2315640762 10554 /* Copyright (c) 1979 Regents of the University of California */ #define BUFSIZ 1024 #define MAXHOP 32 /* max number of tc= indirections */ #include #include "local/uparm.h" /* * termcap - routines for dealing with the terminal capability data base * * BUG: Should use a "last" pointer in tbuf, so that searching * for capabilities alphabetically would not be a n**2/2 * process when large numbers of capabilities are given. * Note: If we add a last pointer now we will screw up the * tc capability. We really should compile termcap. * * Essentially all the work here is scanning and decoding escapes * in string capabilities. We don't use stdio because the editor * doesn't, and because living w/o it is not hard. */ static char *tbuf; static int hopcount; /* detect infinite loops in termcap, init 0 */ char *tskip(); char *tgetstr(); char *tdecode(); char *getenv(); /* * Get an entry for terminal name in buffer bp, * from the termcap file. Parse is very rudimentary; * we just notice escaped newlines. */ tgetent(bp, name) char *bp, *name; { register char *cp; register int c; register int i = 0, cnt = 0; char ibuf[BUFSIZ]; char *cp2; int tf; tbuf = bp; tf = 0; #ifndef V6 cp = getenv("TERMCAP"); /* * TERMCAP can have one of two things in it. It can be the * name of a file to use instead of /etc/termcap. In this * case it better start with a "/". Or it can be an entry to * use so we don't have to read the file. In this case it * has to already have the newlines crunched out. */ if (cp && *cp) { if (*cp!='/') { cp2 = getenv("TERM"); if (cp2==(char *) 0 || strcmp(name,cp2)==0) { strcpy(bp,cp); return(tnchktc()); } else { tf = open(E_TERMCAP, 0); } } else tf = open(cp, 0); } if (tf==0) tf = open(E_TERMCAP, 0); #else tf = open(E_TERMCAP, 0); #endif if (tf < 0) return (-1); for (;;) { cp = bp; for (;;) { if (i == cnt) { cnt = read(tf, ibuf, BUFSIZ); if (cnt <= 0) { close(tf); return (0); } i = 0; } c = ibuf[i++]; if (c == '\n') { if (cp > bp && cp[-1] == '\\'){ cp--; continue; } break; } if (cp >= bp+BUFSIZ) { write(2,"Termcap entry too long\n", 23); break; } else *cp++ = c; } *cp = 0; /* * The real work for the match. */ if (tnamatch(name)) { close(tf); return(tnchktc()); } } } /* * tnchktc: check the last entry, see if it's tc=xxx. If so, * recursively find xxx and append that entry (minus the names) * to take the place of the tc=xxx entry. This allows termcap * entries to say "like an HP2621 but doesn't turn on the labels". * Note that this works because of the left to right scan. */ tnchktc() { register char *p, *q; char tcname[16]; /* name of similar terminal */ char tcbuf[BUFSIZ]; char *holdtbuf = tbuf; int l; p = tbuf + strlen(tbuf) - 2; /* before the last colon */ while (*--p != ':') if (p MAXHOP) { write(2, "Infinite tc= loop\n", 18); return (0); } if (tgetent(tcbuf, tcname) != 1) return(0); for (q=tcbuf; *q != ':'; q++) ; l = p - holdtbuf + strlen(q); if (l > BUFSIZ) { write(2, "Termcap entry too long\n", 23); q[BUFSIZ - (p-tbuf)] = 0; } strcpy(p, q+1); tbuf = holdtbuf; return(1); } /* * Tnamatch deals with name matching. The first field of the termcap * entry is a sequence of names separated by |'s, so we compare * against each such name. The normal : terminator after the last * name (before the first field) stops us. */ tnamatch(np) char *np; { register char *Np, *Bp; Bp = tbuf; if (*Bp == '#') return(0); for (;;) { for (Np = np; *Np && *Bp == *Np; Bp++, Np++) continue; if (*Np == 0 && (*Bp == '|' || *Bp == ':' || *Bp == 0)) return (1); while (*Bp && *Bp != ':' && *Bp != '|') Bp++; if (*Bp == 0 || *((Bp == ':') return (0); Bp++; } } /* * Skip to the next field. Notice that this is very dumb, not * knowing about \: escapes or any such. If necessary, :'s can be put * into the termcap file in octal. */ static char * tskip(bp) register char *bp; { while (*bp && *bp != ':') bp++; if (*bp == ':') bp++; return (bp); } /* * Return the (numeric) option id. * Numeric options look like * li#80 * i.e. the option string is separated from the numeric value by * a # character. If the option is not found we return -1. * Note that we handle octal numbers beginning with 0. */ tgetnum(id) char *id; { register int i, base; register char *bp = tbuf; for (;;) { bp = tskip(bp); if (*bp == 0) return (-1); if (*bp++ != id[0] || *bp == 0 || *bp++ != id[1]) continue; if (*bp == '@') return(-1); if (*bp != '#') continue; bp++; base = 10; if (*bp == '0') base = 8; i = 0; while (isdigit(*bp)) i *= base, i += *bp++ - '0'; return (i); } } /* * Handle a flag option. * Flag options are given "naked", i.e. followed by a : or the end * of the buffer. Return 1 if we find the option, or 0 if it is * not given. */ tgetflag(id) char *id; { register char *bp = tbuf; for (;;) { bp = tskip(bp); if (!*bp) return (0); if (*bp++ == id[0] && *bp != 0 && *bp++ == id[1]) { if (!*bp || *bp == ':') return (1); else if (*bp == '@') return(0); } } } /* * Get a string valued option. * These are given as * cl=^Z * Much decoding is done on the strings, and the strings are * placed in area, which is a ref parameter which is updated. * No checking on area overflow. */ char * tgetstr(id, area) char *id, **area; { register char *bp = tbuf; for (;;) { bp = tskip(bp); if (!*bp) return (0); if (*bp++ != id[0] || *bp == 0 || *bp++ != id[1]) continue; if (*bp == '@') return(0); if (*bp != '=') continue; bp++; return (tdecode(bp, area)); } } /* * Tdecode does the grung work to decode the * string capability escapes. */ static char * tdecode(str, area) register char *str; char **area; { register char *cp; register int c; register char *dp; int i; cp = *area; while ((c = *str++) && c != ':') { switch (c) { case '^': c = *str++ & 037; break; case '\\': dp = "E\033^^\\\\::n\nr\rt\tb\bf\f"; c = *str++; nextc: if (*dp++ == c) { c = *dp++; break; } dp++; if (*dp) goto nextc; if (isdigit(c)) { c -= '0', i = 2; do c <<= 3, c |= *str++ - '0'; while (--i && isdigit(*str)); } break; } *cp++ = c; } *cp++ = 0; str = *area; *area = cp; return (str); } c; register char *dp; int i; cp = *area; while ((c = *str++) && c != ':') { switch (c) { case '^': c = *str++ & 037; break; case '\\': dp = "E\033^^\\\\::n\nr\rt\tb\bf\f"; c = *str++; nextc: if (*dp++ == c) { c = *dp++; break; } dp++; if (*dp) goto nextc; if (isdigit(c)) { c -= '0', i = 2; do c <<= 3, c |= *str++ - '0'; while (--i && isdlib/libtermlib/tc3.c 644 0 33 2427 2315565745 7604 /* * tc3 [term] * Dummy program to test out termlib. * Input two numbers and it prints out the tgoto string generated. */ #include char buf[1024]; char *getenv(), *tgetstr(); char *rdchar(); char *tgoto(); char *CM; char cmbuff[30]; char *x; char *UP; char *tgout; main(argc, argv) char **argv; { char *p; int rc; int row, col; if (argc < 2) p = getenv("TERM"); else p = argv[1]; rc = tgetent(buf,p); x = cmbuff; UP = tgetstr("up", &x); printf("UP = %x = ", UP); pr(UP); printf("\n"); if (UP && *UP==0) UP = 0; CM = tgetstr("cm", &x); printf("CM = "); pr(CM); printf("\n"); for (;;) { if (scanf("%d %d", &row, &col) < 2) exit(0); tgout = tgoto(CM, row, col); pr(tgout); printf("\n"); } } pr(p) register char *p; { for (; *p; p++) printf("%s", rdchar(*p)); } /* * rdchar: returns a readable representation of an ASCII char, using ^ notation. */ #include char *rdchar(c) char c; { static char ret[4]; register char *p; /* * Due to a bug in isprint, this prints spaces as ^`, but this is OK * because we want something to show up on the screen. */ ret[0] = ((c&0377) > 0177) ? '\'' : ' '; c &= 0177; ret[1] = isprint(c) ? ' ' : '^'; ret[2] = isprint(c) ? c : c^0100; ret[3] = 0; for (p=ret; *p==' '; p++) ; return (p); } ", rdchar(*p)); } /* * rdchar: returns a readable representation of an ASCII char, using ^ notation. */ #include char *rdchar(c) char c; { static char ret[4]; register char *p; /* * Due to a bug in isprint, this prlib/libtermlib/tputs.c 644 0 33 3372 2242717511 10257 /* Copyright (c) 1979 Regents of the University of California */ #include #include /* * The following array gives the number of tens of milliseconds per * character for each speed as returned by gtty. Thus since 300 * baud returns a 7, there are 33.3 milliseconds per char at 300 baud. */ static short tmspc10[] = { 0, 2000, 1333, 909, 743, 666, 500, 333, 166, 83, 55, 41, 20, 10 }; short ospeed; char PC; /* * Put the character string cp out, with padding. * The number of affected lines is affcnt, and the routine * used to output one character is outc. */ tputs(cp, affcnt, outc) register char *cp; int affcnt; int (*outc)(); { register int i = 0; register int mspc10; if (cp == 0) return; /* * Convert the number representing the delay. */ if (isdigit(*cp)) { do i = i * 10 + *cp++ - '0'; while (isdigit(*cp)); } i *= 10; if (*cp == '.') { cp++; if (isdigit(*cp)) i += *cp - '0'; /* * Only one digit to the right of the decimal point. */ while (isdigit(*cp)) cp++; } /* * If the delay is followed by a `*', then * multiply by the affected lines count. */ if (*cp == '*') cp++, i *= affcnt; /* * The guts of the string. */ while (*cp) (*outc)(*cp++); /* * If no delay needed, or output speed is * not comprehensible, then don't try to delay. */ if (i == 0) return; if (ospeed <= 0 || ospeed >= (sizeof tmspc10 / sizeof tmspc10[0])) return; /* * Round up by a half a character frame, * and then do the delay. * Too bad there are no user program accessible programmed delays. * Transmitting pad characters slows many * terminals down and also loads the system. */ mspc10 = tmspc10[ospeed]; i += mspc10 / 2; for (i /= mspc10; i > 0; i--) (*outc)(PC); } needed, or output speed is * not comprehensible, then don't try to delay. */ if (i == 0) return; if (ospeed <= 0 || ospeed >= (sizeof tmspc10 / sizeof tmspc10[0])) return; /* * Round up by a half a character frame, * and then do the delay. * Tlib/libF77/ 775 0 33 0 2552605636 5561 lib/libF77/Makefile 644 0 33 2542 2413063171 7273 # compile, then strip unnecessary symbols .c.o : cc -O -c $< -ld -r -x $*.o mv a.out $*.o MISC = Version.o main.o s_rnge.o abort_.o getarg_.o iargc_.o getenv_.o signal_.o s_stop.o s_paus.o system_.o POW = pow_ci.o pow_dd.o pow_di.o pow_hh.o pow_ii.o pow_ri.o pow_zi.o pow_zz.o CX = c_abs.o c_cos.o c_div.o c_exp.o c_log.o c_sin.o c_sqrt.o DCX = z_abs.o z_cos.o z_div.o z_exp.o z_log.o z_sin.o z_sqrt.o REAL = r_abs.o r_acos.o r_asin.o r_atan.o r_atn2.o r_cnjg.o r_cos.o\ r_cosh.o r_dim.o r_exp.o r_imag.o r_int.o\ r_lg10.o r_log.o r_mod.o r_nint.o r_sign.o\ r_sin.o r_sinh.o r_sqrt.o r_tan.o r_tanh.o rand_.o DBL = d_abs.o d_acos.o d_asin.o d_atan.o d_atn2.o\ d_cnjg.o d_cos.o d_cosh.o d_dim.o d_exp.o\ d_imag.o d_int.o d_lg10.o d_log.o d_mod.o\ d_nint.o d_prod.o d_sign.o d_sin.o d_sinh.o\ d_sqrt.o d_tan.o d_tanh.o INT = i_abs.o i_dim.o i_dnnt.o i_indx.o i_len.o i_mod.o i_nint.o i_sign.o HALF = h_abs.o h_dim.o h_dnnt.o h_indx.o h_len.o h_mod.o h_nint.o h_sign.o CMP = l_ge.o l_gt.o l_le.o l_lt.o hl_ge.o hl_gt.o hl_le.o hl_lt.o EFL = ef1asc_.o ef1cmc_.o CHAR = s_cat.o s_cmp.o s_copy.o libF77.a : $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) $(HALF) $(CMP) $(EFL) $(CHAR) cabs.o tanh.o sinh.o ar r libF77.a $? Version.o: Version.c cc -c Version.c install: cp libF77.a $(DESTDIR)/usr/lib ranlib $(DESTDIR)/usr/lib/libF77.a clean: rm *.o libF77.a x.o i_len.o i_mod.o i_nint.o i_sign.o HALF = h_abs.o h_dim.o h_dnnt.o h_indx.o h_len.o h_mod.o h_nint.o h_sign.o CMP = l_ge.o l_gt.o l_le.o l_lt.o hl_ge.o hl((lib/libF77/abort_.c 644 0 33 151 2347040401 7214 #include abort_() { fprintf(stderr, "Fortran abort routine called\n"); _cleanup(); abort(); } W) $(CX) $(DCX) $(REAL) $(DBL) $(INT) $(HALF) $(CMP) $(EFL) $(CHAR) cabs.o tanh.o sinh.o ar r libF77.a $? Version.o: Version.c cc -c Version.c install: cp libF77.a $(DESTDIR)/usr/lib ranlib $(DESTDIR)/usr/lib/libF77.a clean: rm *.o libF77.a x.o i_len.o i_mod.o i_nint.o i_sign.o HALF = h_abs.o h_dim.o h_dnn/,5܆ /,"lib/libF77/c_abs.c 644 0 33 147 2347040402 7023 #include "complex" float c_abs(z) complex *z; { double cabs(); return( cabs( z->real, z->imag ) ); } } W) $(CX) $(DCX) $(REAL) $(DBL) $(INT) $(HALF) $(CMP) $(EFL) $(CHAR) cabs.o tanh.o sinh.o ar r libF77.a $? Version.o: Version.c cc -c Version.c install: cp libF77.a $(DESTDIR)/usr/lib ranlib $(DESTDIR)/usr/lib/libF77.a clean: rm *.o libF77.a x.o i_len.o i_mod.o i_nint.o i_sign.o HALF = h_abs.o h_dim.o h_dnn/,5 /,"lib/libF77/c_cos.c 644 0 33 254 2347040402 7041 #include "complex" c_cos(r, z) complex *r, *z; { double sin(), cos(), sinh(), cosh(); r->real = cos(z->real) * cosh(z->imag); r->imag = - sin(z->real) * sinh(z->imag); } cabs.o tanh.o sinh.o ar r libF77.a $? Version.o: Version.c cc -c Version.c install: cp libF77.a $(DESTDIR)/usr/lib ranlib $(DESTDIR)/usr/lib/libF77.a clean: rm *.o libF77.a x.o i_len.o i_mod.o i_nint.o i_sign.o HALF = h_abs.o h_dim.o h_dnn/,5 /,"lib/libF77/c_div.c 644 0 33 1142 2347040402 7054 struct complex { float real, imag; }; c_div(c, a, b) struct complex *a, *b, *c; { double ratio, den; double abr, abi; if( (abr = b->real) < 0.) abr = - abr; if( (abi = b->imag) < 0.) abi = - abi; if( abr <= abi ) { if(abi == 0) abort(); /* fatal("complex division by zero"); */ ratio = b->real / b->imag ; den = b->imag * (1 + ratio*ratio); c->real = (a->real*ratio + a->imag) / den; c->imag = (a->imag*ratio - a->real) / den; } else { ratio = b->imag / b->real ; den = b->real * (1 + ratio*ratio); c->real = (a->real + a->imag*ratio) / den; c->imag = (a->imag - a->real*ratio) / den; } } en; double abr, abi; if( (abr = b->real) < 0.) abr = - abr; if( (abi = b->imag) < 0.) abi = - abi; if( abr <= abi ) { if(abi == 0) abort(); /* fatal("complex division by zero"); */ ratio = b->real / b->imag ; den = b->imag * (1 + ratio*ratio); c->real = (a->real*ratio + a->imag) / den; c->imag = (a->imag*ratio - a->real) / den; } else { ratio = b->imag / b->real ; den = b->real * (1 + ratio*ratilib/libF77/c_exp.c 644 0 33 261 2347040403 7050 #include "complex" c_exp(r, z) complex *r, *z; { double expx; double exp(), cos(), sin(); expx = exp(z->real); r->real = expx * cos(z->imag); r->imag = expx * sin(z->imag); } g) < 0.) abi = - abi; if( abr <= abi ) { if(abi == 0) abort(); /* fatal("complex division by zero"); */ ratio = b->real / b->imag ; den = b->imag * (1 + ratio*ratio); c->real = (a->real*ratio + a->imag) / den; c->imag = (a->imag*ratio/,5 /,"lib/libF77/c_log.c 644 0 33 240 2347040403 7032 #include "complex" c_log(r, z) complex *r, *z; { double log(), cabs(), atan2(); r->imag = atan2(z->imag, z->real); r->real = log( cabs(z->real, z->imag) ); } sin(z->imag); } g) < 0.) abi = - abi; if( abr <= abi ) { if(abi == 0) abort(); /* fatal("complex division by zero"); */ ratio = b->real / b->imag ; den = b->imag * (1 + ratio*ratio); c->real = (a->real*ratio + a->imag) / den; c->imag = (a->imag*ratio/,5, /,"lib/libF77/c_sin.c 644 0 33 252 2347040403 7045 #include "complex" c_sin(r, z) complex *r, *z; { double sin(), cos(), sinh(), cosh(); r->real = sin(z->real) * cosh(z->imag); r->imag = cos(z->real) * sinh(z->imag); } ag); } g) < 0.) abi = - abi; if( abr <= abi ) { if(abi == 0) abort(); /* fatal("complex division by zero"); */ ratio = b->real / b->imag ; den = b->imag * (1 + ratio*ratio); c->real = (a->real*ratio + a->imag) / den; c->imag = (a->imag*ratio/,5< /,"lib/libF77/c_sqrt.c 644 0 33 570 2347040403 7250 #include "complex" c_sqrt(r, z) complex *r, *z; { double mag, sqrt(), cabs(); if( (mag = cabs(z->real, z->imag)) == 0.) r->real = r->imag = 0.; else if(z->real > 0) { r->real = sqrt(0.5 * (mag + z->real) ); r->imag = z->imag / r->real / 2; } else { r->imag = sqrt(0.5 * (mag - z->real) ); if(z->imag < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5L /,"lib/libF77/cabs.c 644 0 33 465 2347040404 6671 double cabs(real, imag) double real, imag; { double temp, sqrt(); if(real < 0) real = -real; if(imag < 0) imag = -imag; if(imag > real){ temp = real; real = imag; imag = temp; } if((real+imag) == real) return(real); temp = imag/real; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5\ /,"lib/libF77/complex 644 0 33 140 2347040404 7175 ((typedef struct { float real, imag; } complex; typedef struct { double dreal, dimag; } dcomplex; f(imag < 0) imag = -imag; if(imag > real){ temp = real; real = imag; imag = temp; } if((real+imag) == real) return(real); temp = imag/real; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5l /,"lib/libF77/d_abs.c 644 0 33 106 2347040404 7021 double d_abs(x) double *x; { if(*x >= 0) return(*x); return(- *x); } dreal, dimag; } dcomplex; f(imag < 0) imag = -imag; if(imag > real){ temp = real; real = imag; imag = temp; } if((real+imag) == real) return(real); temp = imag/real; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5| /,"lib/libF77/d_acos.c 644 0 33 103 2347040404 7176 double d_acos(x) double *x; { double acos(); return( acos(*x) ); } } dreal, dimag; } dcomplex; f(imag < 0) imag = -imag; if(imag > real){ temp = real; real = imag; imag = temp; } if((real+imag) == real) return(real); temp = imag/real; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5 /,"lib/libF77/d_asin.c 644 0 33 103 2347040404 7203 double d_asin(x) double *x; { double asin(); return( asin(*x) ); } } dreal, dimag; } dcomplex; f(imag < 0) imag = -imag; if(imag > real){ temp = real; real = imag; imag = temp; } if((real+imag) == real) return(real); temp = imag/real; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5 /,"lib/libF77/d_atan.c 644 0 33 103 2347040405 7175 double d_atan(x) double *x; { double atan(); return( atan(*x) ); } } dreal, dimag; } dcomplex; f(imag < 0) imag = -imag; if(imag > real){ temp = real; real = imag; imag = temp; } if((real+imag) == real) return(real); temp = imag/real; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5 /,"lib/libF77/d_atn2.c 644 0 33 116 2347040405 7122 double d_atn2(x,y) double *x, *y; { double atan2(); return( atan2(*x,*y) ); } imag; } dcomplex; f(imag < 0) imag = -imag; if(imag > real){ temp = real; real = imag; imag = temp; } if((real+imag) == real) return(real); temp = imag/real; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5 /,"lib/libF77/d_cnjg.c 644 0 33 142 2347040405 7176 #include "complex" d_cnjg(r, z) dcomplex *r, *z; { r->dreal = z->dreal; r->dimag = - z->dimag; } imag < 0) imag = -imag; if(imag > real){ temp = real; real = imag; imag = temp; } if((real+imag) == real) return(real); temp = imag/real; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5̇ /,"lib/libF77/d_cos.c 644 0 33 100 2347040406 7034 double d_cos(x) double *x; { double cos(); return( cos(*x) ); } ->dreal; r->dimag = - z->dimag; } imag < 0) imag = -imag; if(imag > real){ temp = real; real = imag; imag = temp; } if((real+imag) == real) return(real); temp = imag/real; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5܇ /,"lib/libF77/d_cosh.c 644 0 33 103 2347040407 7210 double d_cosh(x) double *x; { double cosh(); return( cosh(*x) ); } real; r->dimag = - z->dimag; } imag < 0) imag = -imag; if(imag > real){ temp = real; real = imag; imag = temp; } if((real+imag) == real) return(real); temp = imag/real; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5 /,"lib/libF77/d_dim.c 644 0 33 105 2347040407 7027 double d_dim(a,b) double *a, *b; { return( *a > *b ? *a - *b : 0); } al; r->dimag = - z->dimag; } imag < 0) imag = -imag; if(imag > real){ temp = real; real = imag; imag = temp; } if((real+imag) == real) return(real); temp = imag/real; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5 /,"lib/libF77/d_exp.c 644 0 33 100 2347040410 7037 ((double d_exp(x) double *x; { double exp(); return( exp(*x) ); } ); } al; r->dimag = - z->dimag; } imag < 0) imag = -imag; if(imag > real){ temp = real; real = imag; imag = temp; } if((real+imag) == real) return(real); temp = imag/real; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5  /,"lib/libF77/d_imag.c 644 0 33 110 2347040410 7161 #include "complex" double d_imag(z) dcomplex *z; { return(z->dimag); } r->dimag = - z->dimag; } imag < 0) imag = -imag; if(imag > real){ temp = real; real = imag; imag = temp; } if((real+imag) == real) return(real); temp = imag/real; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5 /,"lib/libF77/d_int.c 644 0 33 135 2347040410 7045 double d_int(x) double *x; { double floor(); return( (*x>0) ? floor(*x) : -floor(- *x) ); } g; } imag < 0) imag = -imag; if(imag > real){ temp = real; real = imag; imag = temp; } if((real+imag) == real) return(real); temp = imag/real; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5, /,"lib/libF77/d_lg10.c 644 0 33 162 2347040410 7016 #define log10e 0.43429448190325182765 double d_lg10(x) double *x; { double log(); return( log10e * log(*x) ); } = -imag; if(imag > real){ temp = real; real = imag; imag = temp; } if((real+imag) == real) return(real); temp = imag/real; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5< /,"lib/libF77/d_log.c 644 0 33 100 2347040411 7025 double d_log(x) double *x; { double log(); return( log(*x) ); } x; { double log(); return( log10e * log(*x) ); } = -imag; if(imag > real){ temp = real; real = imag; imag = temp; } if((real+imag) == real) return(real); temp = imag/real; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5L /,"lib/libF77/d_mod.c 644 0 33 276 2347040412 7042 double d_mod(x,y) double *x, *y; { double floor(), quotient; if( (quotient = *x / *y) >= 0) quotient = floor(quotient); else quotient = -floor(-quotient); return(*x - (*y) * quotient ); } al+imag) == real) return(real); temp = imag/real; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5\ /,"lib/libF77/d_nint.c 644 0 33 150 2347040413 7223 double d_nint(x) double *x; { double floor(); return( (*x)>=0 ? floor(*x + .5) : -floor(.5 - *x) ); } floor(quotient); else quotient = -floor(-quotient); return(*x - (*y) * quotient ); } al+imag) == real) return(real); temp = imag/real; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5l /,"lib/libF77/d_prod.c 644 0 33 74 2347040413 7204 double d_prod(x,y) float *x, *y; { return( (*x) * (*y) ); } =0 ? floor(*x + .5) : -floor(.5 - *x) ); } floor(quotient); else quotient = -floor(-quotient); return(*x - (*y) * quotient ); } al+imag) == real) return(real); temp = imag/real; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5| /,"lib/libF77/d_sign.c 644 0 33 146 2347040413 7220 double d_sign(a,b) double *a, *b; { double x; x = (*a >= 0 ? *a : - *a); return( *b >= 0 ? x : -x); } } floor(quotient); else quotient = -floor(-quotient); return(*x - (*y) * quotient ); } al+imag) == real) return(real); temp = imag/real; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5 /,"lib/libF77/d_sin.c 644 0 33 100 2347040413 7037 double d_sin(x) double *x; { double sin(); return( sin(*x) ); } : - *a); return( *b >= 0 ? x : -x); } } floor(quotient); else quotient = -floor(-quotient); return(*x - (*y) * quotient ); } al+imag) == real) return(real); temp = imag/real; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5 /,"lib/libF77/d_sinh.c 644 0 33 103 2347040414 7213 ((double d_sinh(x) double *x; { double sinh(); return( sinh(*x) ); } *a); return( *b >= 0 ? x : -x); } } floor(quotient); else quotient = -floor(-quotient); return(*x - (*y) * quotient ); } al+imag) == real) return(real); temp = imag/real; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5 /,"lib/libF77/d_sqrt.c 644 0 33 103 2347040414 7243 double d_sqrt(x) double *x; { double sqrt(); return( sqrt(*x) ); } *a); return( *b >= 0 ? x : -x); } } floor(quotient); else quotient = -floor(-quotient); return(*x - (*y) * quotient ); } al+imag) == real) return(real); temp = imag/real; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5 /,"lib/libF77/d_tan.c 644 0 33 100 2347040415 7032 double d_tan(x) double *x; { double tan(); return( tan(*x) ); } } *a); return( *b >= 0 ? x : -x); } } floor(quotient); else quotient = -floor(-quotient); return(*x - (*y) * quotient ); } al+imag) == real) return(real); temp = imag/real; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5̈ /,"lib/libF77/d_tanh.c 644 0 33 103 2347040415 7205 double d_tanh(x) double *x; { double tanh(); return( tanh(*x) ); } *a); return( *b >= 0 ? x : -x); } } floor(quotient); else quotient = -floor(-quotient); return(*x - (*y) * quotient ); } al+imag) == real) return(real); temp = imag/real; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5܈ /,"lib/libF77/derf_.c 644 0 33 101 2347040415 7025 double derf_(x) double *x; { double erf(); return( erf(*x) ); } } *a); return( *b >= 0 ? x : -x); } } floor(quotient); else quotient = -floor(-quotient); return(*x - (*y) * quotient ); } al+imag) == real) return(real); temp = imag/real; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5 /,"lib/libF77/derfc_.c 644 0 33 104 2347040416 7174 double derfc_(x) double *x; { double erfc(); return( erfc(*x) ); } *a); return( *b >= 0 ? x : -x); } } floor(quotient); else quotient = -floor(-quotient); return(*x - (*y) * quotient ); } al+imag) == real) return(real); temp = imag/real; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5 /,"lib/libF77/ef1asc_.c 644 0 33 357 2347040470 7265 /* EFL support routine to copy string b to string a */ #define M ( (long) (sizeof(long) - 1) ) #define EVEN(x) ( ( (x)+ M) & (~M) ) ef1asc_(a, la, b, lb) int *a, *b; long int *la, *lb; { s_copy( (char *)a, (char *)b, EVEN(*la), *lb ); } l; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5  /,"lib/libF77/ef1cmc_.c 644 0 33 260 2347040470 7252 /* EFL support routine to compare two character strings */ long int ef1cmc_(a, la, b, lb) int *a, *b; long int *la, *lb; { return( s_cmp( (char *)a, (char *)b, *la, *lb) ); } *la, *lb; { s_copy( (char *)a, (char *)b, EVEN(*la), *lb ); } l; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5 /,"lib/libF77/erf_.c 644 0 33 76 2347040417 6656 float erf_(x) float *x; { double erf(); return( erf(*x) ); } ng int ef1cmc_(a, la, b, lb) int *a, *b; long int *la, *lb; { return( s_cmp( (char *)a, (char *)b, *la, *lb) ); } *la, *lb; { s_copy( (char *)a, (char *)b, EVEN(*la), *lb ); } l; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5, /,"lib/libF77/erfc_.c 644 0 33 101 2347040417 7026 float erfc_(x) float *x; { double erfc(); return( erfc(*x) ); } int ef1cmc_(a, la, b, lb) int *a, *b; long int *la, *lb; { return( s_cmp( (char *)a, (char *)b, *la, *lb) ); } *la, *lb; { s_copy( (char *)a, (char *)b, EVEN(*la), *lb ); } l; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } + a->imag) / den; c->imag = (a->imag*ratio/,5< /,"lib/libF77/getarg_.c 644 0 33 610 2347040420 7357 ((/* * subroutine getarg(k, c) * returns the kth unix command argument in fortran character * variable argument c */ getarg_(n, s, ls) long int *n; register char *s; long int ls; { extern int xargc; extern char **xargv; register char *t; register int i; if(*n>=0 && *nimag = (a->imag*ratio/,5L /,"lib/libF77/getenv_.c 644 0 33 1537 2347040467 7442 /* * getenv - f77 subroutine to return environment variables * * called by: * call getenv (ENV_NAME, char_var) * where: * ENV_NAME is the name of an environment variable * char_var is a character variable which will receive * the current value of ENV_NAME, or all blanks * if ENV_NAME is not defined */ getenv_(fname, value, flen, vlen) char *value, *fname; long int vlen, flen; { extern char **environ; register char *ep, *fp, *flast; register char **env = environ; flast = fname + flen; for(fp = fname ; fp < flast ; ++fp) if(*fp == ' ') { flast = fp; break; } while (ep = *env++) { for(fp = fname; fp= 0) return(*x); return(- *x); } ; } while (ep = *env++) { for(fp = fname; fp *b ? *a - *b : 0); } ; } while (ep = *env++) { for(fp = fname; fp=0 ? floor(*x + .5) : -floor(.5 - *x) ); } fp = fname; fp= 0 ) *value++ = ' '; return(0); } har *value, *fname; long int vlen, flen; { extern char **environ; reg/,5 /,"lib/libF77/h_len.c 644 0 33 66 2347040436 7030 short h_len(s, n) char *s; long int n; { return(n); } b; { int i, n; char *s, *t, *bend; n = la - lb + 1; bend = b + lb; for(i = 0 ; i < n ; ++i) { s = a + i; t = b; while(t < bend) if(*s++ != *t++) goto no; return(i+1); no: ; } return(0); } p++; goto blank; endloop: ; } blank: while( --vlen >= 0 ) *value++ = ' '; return(0); } har *value, *fname; long int vlen, flen; { extern char **environ; reg/,5 /,"lib/libF77/h_mod.c 644 0 33 65 2347040440 7023 short h_mod(a,b) short *a, *b; { return( *a % *b); } b; { int i, n; char *s, *t, *bend; n = la - lb + 1; bend = b + lb; for(i = 0 ; i < n ; ++i) { s = a + i; t = b; while(t < bend) if(*s++ != *t++) goto no; return(i+1); no: ; } return(0); } p++; goto blank; endloop: ; } blank: while( --vlen >= 0 ) *value++ = ' '; return(0); } har *value, *fname; long int vlen, flen; { extern char **environ; reg/,5 /,"lib/libF77/h_nint.c 644 0 33 146 2347040440 7234 short h_nint(x) float *x; { double floor(); return( (*x)>=0 ? floor(*x + .5) : -floor(.5 - *x) ); } + 1; bend = b + lb; for(i = 0 ; i < n ; ++i) { s = a + i; t = b; while(t < bend) if(*s++ != *t++) goto no; return(i+1); no: ; } return(0); } p++; goto blank; endloop: ; } blank: while( --vlen >= 0 ) *value++ = ' '; return(0); } har *value, *fname; long int vlen, flen; { extern char **environ; reg/,5̉ /,"lib/libF77/h_sign.c 644 0 33 143 2347040440 7221 short h_sign(a,b) short *a, *b; { short x; x = (*a >= 0 ? *a : - *a); return( *b >= 0 ? x : -x); } } + 1; bend = b + lb; for(i = 0 ; i < n ; ++i) { s = a + i; t = b; while(t < bend) if(*s++ != *t++) goto no; return(i+1); no: ; } return(0); } p++; goto blank; endloop: ; } blank: while( --vlen >= 0 ) *value++ = ' '; return(0); } har *value, *fname; long int vlen, flen; { extern char **environ; reg/,5܉ /,"((lib/libF77/hl_ge.c 644 0 33 130 2420123340 7015 short hl_ge(a,b,la,lb) char *a, *b; long int la, lb; { return(s_cmp(a,b,la,lb) >= 0); } x : -x); } } + 1; bend = b + lb; for(i = 0 ; i < n ; ++i) { s = a + i; t = b; while(t < bend) if(*s++ != *t++) goto no; return(i+1); no: ; } return(0); } p++; goto blank; endloop: ; } blank: while( --vlen >= 0 ) *value++ = ' '; return(0); } har *value, *fname; long int vlen, flen; { extern char **environ; reg/,5 /,"lib/libF77/hl_gt.c 644 0 33 127 2420123340 7042 short hl_gt(a,b,la,lb) char *a, *b; long int la, lb; { return(s_cmp(a,b,la,lb) > 0); } x : -x); } } + 1; bend = b + lb; for(i = 0 ; i < n ; ++i) { s = a + i; t = b; while(t < bend) if(*s++ != *t++) goto no; return(i+1); no: ; } return(0); } p++; goto blank; endloop: ; } blank: while( --vlen >= 0 ) *value++ = ' '; return(0); } har *value, *fname; long int vlen, flen; { extern char **environ; reg/,5 /,"lib/libF77/hl_le.c 644 0 33 130 2420123340 7022 short hl_le(a,b,la,lb) char *a, *b; long int la, lb; { return(s_cmp(a,b,la,lb) <= 0); } x : -x); } } + 1; bend = b + lb; for(i = 0 ; i < n ; ++i) { s = a + i; t = b; while(t < bend) if(*s++ != *t++) goto no; return(i+1); no: ; } return(0); } p++; goto blank; endloop: ; } blank: while( --vlen >= 0 ) *value++ = ' '; return(0); } har *value, *fname; long int vlen, flen; { extern char **environ; reg/,5  /,"lib/libF77/hl_lt.c 644 0 33 127 2420123340 7047 short hl_lt(a,b,la,lb) char *a, *b; long int la, lb; { return(s_cmp(a,b,la,lb) < 0); } x : -x); } } + 1; bend = b + lb; for(i = 0 ; i < n ; ++i) { s = a + i; t = b; while(t < bend) if(*s++ != *t++) goto no; return(i+1); no: ; } return(0); } p++; goto blank; endloop: ; } blank: while( --vlen >= 0 ) *value++ = ' '; return(0); } har *value, *fname; long int vlen, flen; { extern char **environ; reg/,5 /,"lib/libF77/i_abs.c 644 0 33 112 2347040442 7025 long int i_abs(x) long int *x; { if(*x >= 0) return(*x); return(- *x); } ,lb) < 0); } x : -x); } } + 1; bend = b + lb; for(i = 0 ; i < n ; ++i) { s = a + i; t = b; while(t < bend) if(*s++ != *t++) goto no; return(i+1); no: ; } return(0); } p++; goto blank; endloop: ; } blank: while( --vlen >= 0 ) *value++ = ' '; return(0); } har *value, *fname; long int vlen, flen; { extern char **environ; reg/,5, /,"lib/libF77/i_dim.c 644 0 33 111 2347040443 7031 long int i_dim(a,b) long int *a, *b; { return( *a > *b ? *a - *b : 0); } ,lb) < 0); } x : -x); } } + 1; bend = b + lb; for(i = 0 ; i < n ; ++i) { s = a + i; t = b; while(t < bend) if(*s++ != *t++) goto no; return(i+1); no: ; } return(0); } p++; goto blank; endloop: ; } blank: while( --vlen >= 0 ) *value++ = ' '; return(0); } har *value, *fname; long int vlen, flen; { extern char **environ; reg/,5< /,"lib/libF77/i_dnnt.c 644 0 33 152 2347040444 7231 long int i_dnnt(x) double *x; { double floor(); return( (*x)>=0 ? floor(*x + .5) : -floor(.5 - *x) ); } bend = b + lb; for(i = 0 ; i < n ; ++i) { s = a + i; t = b; while(t < bend) if(*s++ != *t++) goto no; return(i+1); no: ; } return(0); } p++; goto blank; endloop: ; } blank: while( --vlen >= 0 ) *value++ = ' '; return(0); } har *value, *fname; long int vlen, flen; { extern char **environ; reg/,5L /,"lib/libF77/i_indx.c 644 0 33 410 2347040444 7225 long int i_indx(a, b, la, lb) char *a, *b; long int la, lb; { long int i, n; char *s, *t, *bend; n = la - lb + 1; bend = b + lb; for(i = 0 ; i < n ; ++i) { s = a + i; t = b; while(t < bend) if(*s++ != *t++) goto no; return(i+1); no: ; } return(0); } oto blank; endloop: ; } blank: while( --vlen >= 0 ) *value++ = ' '; return(0); } har *value, *fname; long int vlen, flen; { extern char **environ; reg/,5\ /,"lib/libF77/i_len.c 644 0 33 71 2347040445 7025 long int i_len(s, n) char *s; long int n; { return(n); } b; { long int i, n; char *s, *t, *bend; n = la - lb + 1; bend = b + lb; for(i = 0 ; i < n ; ++i) { s = a + i; t = b; while(t < bend) if(*s++ != *t++) goto no; return(i+1); no: ; } return(0); } oto blank; endloop: ; } blank: while( --vlen >= 0 ) *value++ = ' '; return(0); } har *value, *fname; long int vlen, flen; { extern char **environ; reg/,5l /,"lib/libF77/i_mod.c 644 0 33 73 2347040445 7030 long int i_mod(a,b) long int *a, *b; { return( *a % *b); } { long int i, n; char *s, *t, *bend; n = la - lb + 1; bend = b + lb; for(i = 0 ; i < n ; ++i) { s = a + i; t = b; while(t < bend) if(*s++ != *t++) goto no; return(i+1); no: ; } return(0); } oto blank; endloop: ; } blank: while( --vlen >= 0 ) *value++ = ' '; return(0); } har *value, *fname; long int vlen, flen; { extern char **environ; reg/,5| /,"((lib/libF77/i_nint.c 644 0 33 151 2347040445 7236 long int i_nint(x) float *x; { double floor(); return( (*x)>=0 ? floor(*x + .5) : -floor(.5 - *x) ); } - lb + 1; bend = b + lb; for(i = 0 ; i < n ; ++i) { s = a + i; t = b; while(t < bend) if(*s++ != *t++) goto no; return(i+1); no: ; } return(0); } oto blank; endloop: ; } blank: while( --vlen >= 0 ) *value++ = ' '; return(0); } har *value, *fname; long int vlen, flen; { extern char **environ; reg/,5 /,"lib/libF77/i_sign.c 644 0 33 154 2347040445 7231 long int i_sign(a,b) long int *a, *b; { long int x; x = (*a >= 0 ? *a : - *a); return( *b >= 0 ? x : -x); } b + 1; bend = b + lb; for(i = 0 ; i < n ; ++i) { s = a + i; t = b; while(t < bend) if(*s++ != *t++) goto no; return(i+1); no: ; } return(0); } oto blank; endloop: ; } blank: while( --vlen >= 0 ) *value++ = ' '; return(0); } har *value, *fname; long int vlen, flen; { extern char **environ; reg/,5 /,"lib/libF77/iargc_.c 644 0 33 76 2347040445 7170 long int iargc_() { extern int xargc; return ( xargc - 1 ); } 0 ? *a : - *a); return( *b >= 0 ? x : -x); } b + 1; bend = b + lb; for(i = 0 ; i < n ; ++i) { s = a + i; t = b; while(t < bend) if(*s++ != *t++) goto no; return(i+1); no: ; } return(0); } oto blank; endloop: ; } blank: while( --vlen >= 0 ) *value++ = ' '; return(0); } har *value, *fname; long int vlen, flen; { extern char **environ; reg/,5 /,"lib/libF77/l_ge.c 644 0 33 132 2347040446 6664 long int l_ge(a,b,la,lb) char *a, *b; long int la, lb; { return(s_cmp(a,b,la,lb) >= 0); } >= 0 ? x : -x); } b + 1; bend = b + lb; for(i = 0 ; i < n ; ++i) { s = a + i; t = b; while(t < bend) if(*s++ != *t++) goto no; return(i+1); no: ; } return(0); } oto blank; endloop: ; } blank: while( --vlen >= 0 ) *value++ = ' '; return(0); } har *value, *fname; long int vlen, flen; { extern char **environ; reg/,5 /,"lib/libF77/l_gt.c 644 0 33 131 2347040446 6702 long int l_gt(a,b,la,lb) char *a, *b; long int la, lb; { return(s_cmp(a,b,la,lb) > 0); } >= 0 ? x : -x); } b + 1; bend = b + lb; for(i = 0 ; i < n ; ++i) { s = a + i; t = b; while(t < bend) if(*s++ != *t++) goto no; return(i+1); no: ; } return(0); } oto blank; endloop: ; } blank: while( --vlen >= 0 ) *value++ = ' '; return(0); } har *value, *fname; long int vlen, flen; { extern char **environ; reg/,5̊ /,"lib/libF77/l_le.c 644 0 33 132 2347040446 6671 long int l_le(a,b,la,lb) char *a, *b; long int la, lb; { return(s_cmp(a,b,la,lb) <= 0); } >= 0 ? x : -x); } b + 1; bend = b + lb; for(i = 0 ; i < n ; ++i) { s = a + i; t = b; while(t < bend) if(*s++ != *t++) goto no; return(i+1); no: ; } return(0); } oto blank; endloop: ; } blank: while( --vlen >= 0 ) *value++ = ' '; return(0); } har *value, *fname; long int vlen, flen; { extern char **environ; reg/,5܊ /,"lib/libF77/l_lt.c 644 0 33 131 2347040446 6707 long int l_lt(a,b,la,lb) char *a, *b; long int la, lb; { return(s_cmp(a,b,la,lb) < 0); } >= 0 ? x : -x); } b + 1; bend = b + lb; for(i = 0 ; i < n ; ++i) { s = a + i; t = b; while(t < bend) if(*s++ != *t++) goto no; return(i+1); no: ; } return(0); } oto blank; endloop: ; } blank: while( --vlen >= 0 ) *value++ = ' '; return(0); } har *value, *fname; long int vlen, flen; { extern char **environ; reg/,5 /,"lib/libF77/main.c 644 0 33 3104 2501275434 6723 /* STARTUP PROCEDURE FOR UNIX FORTRAN PROGRAMS */ #include #include int xargc; char **xargv; int _sigfdie(), _sigidie(), _sigqdie(), _sigindie(), _sigtdie(); main(argc, argv, arge) int argc; char **argv; char **arge; { xargc = argc; xargv = argv; signal(SIGFPE, _sigfdie); /* ignore underflow, enable overflow */ signal(SIGIOT, _sigidie); if ((int)signal(SIGQUIT,_sigqdie) & 01) signal(SIGQUIT, SIG_IGN); if ((int)signal(SIGINT, _sigindie) & 01) signal(SIGINT, SIG_IGN); signal(SIGTERM,_sigtdie); #ifdef pdp11 ldfps(01200); /* detect overflow as an exception */ #endif f_init(); MAIN__(); f_exit(); } #ifdef vax static char *fpenames[] = { "unknown floating exception", "integer overflow", "integer divide by zero", "floating overflow", "floating/decimal divide by zero", "floating underflow", "decimal overflow", "subscript out of range", "floating overflow", "floating divide by zero", "floating underflow" }; _sigfdie(sig, code) int sig, code; { if (code < 0 || code >= sizeof fpenames/sizeof fpenames[0]) code = 0; _sigdie(fpenames[code], 1); } #else _sigfdie() { _sigdie("floating exception, 1); } #endif _sigidie() { _sigdie("IOT Trap", 1); } _sigqdie() { _sigdie("Quit signal", 1); } _sigindie() { _sigdie("Interrupt", 0); } _sigtdie() { _sigdie("Killed", 0); } _sigdie(s, kill) register char *s; int kill; { /* print error message, then clear buffers */ fflush(stderr); fprintf(stderr, "%s\n", s); f_exit(); fflush(stderr); if (kill) { /* now get a core */ signal(SIGIOT, 0); abort(); /*NOTREACHED*/ } exit(1); } names[code], 1); } #else _sigfdie() { _sigdie("floating exception, 1); } #endif _sigidie() { _sigdie("IOT Trap", 1); } _sigqdie() { _sigdie("Quit signal", 1); } _sigindie() { _sigdie("Interrupt", 0); } _sigtdie() { _sigdie("Killed", 0); } _sigdie(s, kill) register char *s; int kill; { /* print error message, then clear buffers */ fflush(stderr); fprintf(stderr, "%s\n", s); f_exit(); fflush(stderr); if (kill) { /* now get a corelib/libF77/mclock_.c 644 0 33 131 2347040447 7365 ((long int mclock_() { int buf[6]; times(buf); return(buf[0]+buf[2]+buf[3]); } lse _sigfdie() { _sigdie("floating exception, 1); } #endif _sigidie() { _sigdie("IOT Trap", 1); } _sigqdie() { _sigdie("Quit signal", 1); } _sigindie() { _sigdie("Interrupt", 0); } _sigtdie() { _sigdie("Killed", 0); } _sigdie(s, kill) register char *s; int kill; { /* print error message, then clear buffers */ fflush(stderr/,5  /,"lib/libF77/pow_ci.c 644 0 33 317 2347040447 7244 #include "complex" pow_ci(p, a, b) /* p = a**b */ complex *p, *a; long int *b; { dcomplex p1, a1; a1.dreal = a->real; a1.dimag = a->imag; pow_zi(&p1, &a1, b); p->real = p1.dreal; p->imag = p1.dimag; } e("Quit signal", 1); } _sigindie() { _sigdie("Interrupt", 0); } _sigtdie() { _sigdie("Killed", 0); } _sigdie(s, kill) register char *s; int kill; { /* print error message, then clear buffers */ fflush(stderr/,5 /,"lib/libF77/pow_dd.c 644 0 33 122 2347040450 7224 double pow_dd(ap, bp) double *ap, *bp; { double pow(); return(pow(*ap, *bp) ); } { dcomplex p1, a1; a1.dreal = a->real; a1.dimag = a->imag; pow_zi(&p1, &a1, b); p->real = p1.dreal; p->imag = p1.dimag; } e("Quit signal", 1); } _sigindie() { _sigdie("Interrupt", 0); } _sigtdie() { _sigdie("Killed", 0); } _sigdie(s, kill) register char *s; int kill; { /* print error message, then clear buffers */ fflush(stderr/,5, /,"lib/libF77/pow_di.c 644 0 33 461 2347040451 7240 double pow_di(ap, bp) double *ap; long int *bp; { double pow, x; long int n; pow = 1; x = *ap; n = *bp; if(n != 0) { if(n < 0) { if(x == 0) { return(pow); } n = -n; x = 1/x; } for( ; ; ) { if(n & 01) pow *= x; if(n >>= 1) x *= x; else break; } } return(pow); } } _sigdie(s, kill) register char *s; int kill; { /* print error message, then clear buffers */ fflush(stderr/,5< /,"lib/libF77/pow_hh.c 644 0 33 332 2347040451 7240 short pow_hh(ap, bp) short *ap, *bp; { short pow, x, n; pow = 1; x = *ap; n = *bp; if(n < 0) { } else if(n > 0) for( ; ; ) { if(n & 01) pow *= x; if(n >>= 1) x *= x; else break; } return(pow); } f(n & 01) pow *= x; if(n >>= 1) x *= x; else break; } } return(pow); } } _sigdie(s, kill) register char *s; int kill; { /* print error message, then clear buffers */ fflush(stderr/,5L /,"lib/libF77/pow_ii.c 644 0 33 343 2347040451 7244 long int pow_ii(ap, bp) long int *ap, *bp; { long int pow, x, n; pow = 1; x = *ap; n = *bp; if(n < 0) { } else if(n > 0) for( ; ; ) { if(n & 01) pow *= x; if(n >>= 1) x *= x; else break; } return(pow); } pow *= x; if(n >>= 1) x *= x; else break; } } return(pow); } } _sigdie(s, kill) register char *s; int kill; { /* print error message, then clear buffers */ fflush(stderr/,5\ /,"lib/libF77/pow_ri.c 644 0 33 457 2347040452 7264 float pow_ri(ap, bp) float *ap; long int *bp; { double pow, x; long int n; pow = 1; x = *ap; n = *bp; if(n != 0) { if(n < 0) { if(x == 0) { return(pow); } n = -n; x = 1/x; } for( ; ; ) { if(n & 01) pow *= x; if(n >>= 1) x *= x; else break; } } return(pow); } } } _sigdie(s, kill) register char *s; int kill; { /* print error message, then clear buffers */ fflush(stderr/,5l /,"lib/libF77/pow_zi.c 644 0 33 1057 2453721461 7315 #include "complex" pow_zi(p, a, b) /* p = a**b */ dcomplex *p, *a; long int *b; { long int n; double t; dcomplex x; n = *b; p->dreal = 1; p->dimag = 0; if(n == 0) return; if(n < 0) { n = -n; z_div(&x,p,a); } else { x.dreal = a->dreal; x.dimag = a->dimag; } for( ; ; ) { if(n & 01) { t = p->dreal * x.dreal - p->dimag * x.dimag; p->dimag = p->dreal * x.dimag + p->dimag * x.dreal; p->dreal = t; } if(n >>= 1) { t = x.dreal * x.dreal - x.dimag * x.dimag; x.dimag = 2 * x.dreal * x.dimag; x.dreal = t; } else break; } } b */ dcomplex *p, *a; long int *b; { long int n; double t; dcomplex x; n = *b; p->dreal = 1; p->dimag = 0; if(n == 0) return; if(n < 0) { n = -n; z_div(&x,p,a); } else { x.dreal = a->dreal; x.dimag = a->dimag; } for( ; ; ) { if(n & 01) { t = p->dreal * x.dreal - p->dimag * x.dimag; p->dimag = p->dreal * x.dimag + p->dimag * x.dreal; p->dreal = t; } if(n >>= 1) { t = x.dreal * x.dreal - x.dimag * x.dimag; x.dimag = 2 * x.dreal * xlib/libF77/pow_zz.c 644 0 33 530 2347040452 7305 #include "complex" pow_zz(r,a,b) dcomplex *r, *a, *b; { double logr, logi, x, y; double log(), exp(), cos(), sin(), atan2(), cabs(); logr = log( cabs(a->dreal, a->dimag) ); logi = atan2(a->dimag, a->dreal); x = exp( logr * b->dreal - logi * b->dimag ); y = logr * b->dimag + logi * b->dreal; r->dreal = x * cos(y); r->dimag = x * sin(y); } mag; p->dimag = p->dreal * x.dimag + p->dimag * x.dreal; p->dreal = t; /,5 /,"lib/libF77/r_abs.c 644 0 33 105 2347040453 7042 double r_abs(x) float *x; { if(*x >= 0) return(*x); return(- *x); } logi, x, y; double log(), exp(), cos(), sin(), atan2(), cabs(); logr = log( cabs(a->dreal, a->dimag) ); logi = atan2(a->dimag, a->dreal); x = exp( logr * b->dreal - logi * b->dimag ); y = logr * b->dimag + logi * b->dreal; r->dreal = x * cos(y); r->dimag = x * sin(y); } mag; p->dimag = p->dreal * x.dimag + p->dimag * x.dreal; p->dreal = t; /,5 /,"((lib/libF77/r_acos.c 644 0 33 102 2347040453 7217 double r_acos(x) float *x; { double acos(); return( acos(*x) ); } } logi, x, y; double log(), exp(), cos(), sin(), atan2(), cabs(); logr = log( cabs(a->dreal, a->dimag) ); logi = atan2(a->dimag, a->dreal); x = exp( logr * b->dreal - logi * b->dimag ); y = logr * b->dimag + logi * b->dreal; r->dreal = x * cos(y); r->dimag = x * sin(y); } mag; p->dimag = p->dreal * x.dimag + p->dimag * x.dreal; p->dreal = t; /,5 /,"lib/libF77/r_asin.c 644 0 33 102 2347040453 7224 double r_asin(x) float *x; { double asin(); return( asin(*x) ); } } logi, x, y; double log(), exp(), cos(), sin(), atan2(), cabs(); logr = log( cabs(a->dreal, a->dimag) ); logi = atan2(a->dimag, a->dreal); x = exp( logr * b->dreal - logi * b->dimag ); y = logr * b->dimag + logi * b->dreal; r->dreal = x * cos(y); r->dimag = x * sin(y); } mag; p->dimag = p->dreal * x.dimag + p->dimag * x.dreal; p->dreal = t; /,5 /,"lib/libF77/r_atan.c 644 0 33 102 2347040454 7216 double r_atan(x) float *x; { double atan(); return( atan(*x) ); } } logi, x, y; double log(), exp(), cos(), sin(), atan2(), cabs(); logr = log( cabs(a->dreal, a->dimag) ); logi = atan2(a->dimag, a->dreal); x = exp( logr * b->dreal - logi * b->dimag ); y = logr * b->dimag + logi * b->dreal; r->dreal = x * cos(y); r->dimag = x * sin(y); } mag; p->dimag = p->dreal * x.dimag + p->dimag * x.dreal; p->dreal = t; /,5̋ /,"lib/libF77/r_atn2.c 644 0 33 115 2347040454 7143 double r_atn2(x,y) float *x, *y; { double atan2(); return( atan2(*x,*y) ); } , y; double log(), exp(), cos(), sin(), atan2(), cabs(); logr = log( cabs(a->dreal, a->dimag) ); logi = atan2(a->dimag, a->dreal); x = exp( logr * b->dreal - logi * b->dimag ); y = logr * b->dimag + logi * b->dreal; r->dreal = x * cos(y); r->dimag = x * sin(y); } mag; p->dimag = p->dreal * x.dimag + p->dimag * x.dreal; p->dreal = t; /,5܋ /,"lib/libF77/r_cnjg.c 644 0 33 135 2347040454 7222 #include "complex" r_cnjg(r, z) complex *r, *z; { r->real = z->real; r->imag = - z->imag; } ), exp(), cos(), sin(), atan2(), cabs(); logr = log( cabs(a->dreal, a->dimag) ); logi = atan2(a->dimag, a->dreal); x = exp( logr * b->dreal - logi * b->dimag ); y = logr * b->dimag + logi * b->dreal; r->dreal = x * cos(y); r->dimag = x * sin(y); } mag; p->dimag = p->dreal * x.dimag + p->dimag * x.dreal; p->dreal = t; /,5 /,"lib/libF77/r_cos.c 644 0 33 77 2347040455 7053 double r_cos(x) float *x; { double cos(); return( cos(*x) ); } >real; r->imag = - z->imag; } ), exp(), cos(), sin(), atan2(), cabs(); logr = log( cabs(a->dreal, a->dimag) ); logi = atan2(a->dimag, a->dreal); x = exp( logr * b->dreal - logi * b->dimag ); y = logr * b->dimag + logi * b->dreal; r->dreal = x * cos(y); r->dimag = x * sin(y); } mag; p->dimag = p->dreal * x.dimag + p->dimag * x.dreal; p->dreal = t; /,5 /,"lib/libF77/r_cosh.c 644 0 33 102 2347040455 7230 double r_cosh(x) float *x; { double cosh(); return( cosh(*x) ); } al; r->imag = - z->imag; } ), exp(), cos(), sin(), atan2(), cabs(); logr = log( cabs(a->dreal, a->dimag) ); logi = atan2(a->dimag, a->dreal); x = exp( logr * b->dreal - logi * b->dimag ); y = logr * b->dimag + logi * b->dreal; r->dreal = x * cos(y); r->dimag = x * sin(y); } mag; p->dimag = p->dreal * x.dimag + p->dimag * x.dreal; p->dreal = t; /,5  /,"lib/libF77/r_dim.c 644 0 33 104 2347040455 7047 double r_dim(a,b) float *a, *b; { return( *a > *b ? *a - *b : 0); } ; r->imag = - z->imag; } ), exp(), cos(), sin(), atan2(), cabs(); logr = log( cabs(a->dreal, a->dimag) ); logi = atan2(a->dimag, a->dreal); x = exp( logr * b->dreal - logi * b->dimag ); y = logr * b->dimag + logi * b->dreal; r->dreal = x * cos(y); r->dimag = x * sin(y); } mag; p->dimag = p->dreal * x.dimag + p->dimag * x.dreal; p->dreal = t; /,5 /,"lib/libF77/r_exp.c 644 0 33 77 2347040455 7063 double r_exp(x) float *x; { double exp(); return( exp(*x) ); } ); } ; r->imag = - z->imag; } ), exp(), cos(), sin(), atan2(), cabs(); logr = log( cabs(a->dreal, a->dimag) ); logi = atan2(a->dimag, a->dreal); x = exp( logr * b->dreal - logi * b->dimag ); y = logr * b->dimag + logi * b->dreal; r->dreal = x * cos(y); r->dimag = x * sin(y); } mag; p->dimag = p->dreal * x.dimag + p->dimag * x.dreal; p->dreal = t; /,5, /,"lib/libF77/r_imag.c 644 0 33 106 2347040456 7216 #include "complex" double r_imag(z) complex *z; { return(z->imag); } r->imag = - z->imag; } ), exp(), cos(), sin(), atan2(), cabs(); logr = log( cabs(a->dreal, a->dimag) ); logi = atan2(a->dimag, a->dreal); x = exp( logr * b->dreal - logi * b->dimag ); y = logr * b->dimag + logi * b->dreal; r->dreal = x * cos(y); r->dimag = x * sin(y); } mag; p->dimag = p->dreal * x.dimag + p->dimag * x.dreal; p->dreal = t; /,5< /,"((lib/libF77/r_int.c 644 0 33 134 2347040456 7074 double r_int(x) float *x; { double floor(); return( (*x>0) ? floor(*x) : -floor(- *x) ); } ), exp(), cos(), sin(), atan2(), cabs(); logr = log( cabs(a->dreal, a->dimag) ); logi = atan2(a->dimag, a->dreal); x = exp( logr * b->dreal - logi * b->dimag ); y = logr * b->dimag + logi * b->dreal; r->dreal = x * cos(y); r->dimag = x * sin(y); } mag; p->dimag = p->dreal * x.dimag + p->dimag * x.dreal; p->dreal = t; /,5L /,"lib/libF77/r_lg10.c 644 0 33 161 2347040457 7046 #define log10e 0.43429448190325182765 double r_lg10(x) float *x; { double log(); return( log10e * log(*x) ); } (), atan2(), cabs(); logr = log( cabs(a->dreal, a->dimag) ); logi = atan2(a->dimag, a->dreal); x = exp( logr * b->dreal - logi * b->dimag ); y = logr * b->dimag + logi * b->dreal; r->dreal = x * cos(y); r->dimag = x * sin(y); } mag; p->dimag = p->dreal * x.dimag + p->dimag * x.dreal; p->dreal = t; /,5\ /,"lib/libF77/r_log.c 644 0 33 77 2347040457 7052 double r_log(x) float *x; { double log(); return( log(*x) ); } x; { double log(); return( log10e * log(*x) ); } (), atan2(), cabs(); logr = log( cabs(a->dreal, a->dimag) ); logi = atan2(a->dimag, a->dreal); x = exp( logr * b->dreal - logi * b->dimag ); y = logr * b->dimag + logi * b->dreal; r->dreal = x * cos(y); r->dimag = x * sin(y); } mag; p->dimag = p->dreal * x.dimag + p->dimag * x.dreal; p->dreal = t; /,5l /,"lib/libF77/r_mod.c 644 0 33 275 2347040460 7062 double r_mod(x,y) float *x, *y; { double floor(), quotient; if( (quotient = *x / *y) >= 0) quotient = floor(quotient); else quotient = -floor(-quotient); return(*x - (*y) * quotient ); } ->dimag, a->dreal); x = exp( logr * b->dreal - logi * b->dimag ); y = logr * b->dimag + logi * b->dreal; r->dreal = x * cos(y); r->dimag = x * sin(y); } mag; p->dimag = p->dreal * x.dimag + p->dimag * x.dreal; p->dreal = t; /,5| /,"lib/libF77/r_nint.c 644 0 33 147 2347040460 7251 double r_nint(x) float *x; { double floor(); return( (*x)>=0 ? floor(*x + .5) : -floor(.5 - *x) ); } floor(quotient); else quotient = -floor(-quotient); return(*x - (*y) * quotient ); } ->dimag, a->dreal); x = exp( logr * b->dreal - logi * b->dimag ); y = logr * b->dimag + logi * b->dreal; r->dreal = x * cos(y); r->dimag = x * sin(y); } mag; p->dimag = p->dreal * x.dimag + p->dimag * x.dreal; p->dreal = t; /,5 /,"lib/libF77/r_sign.c 644 0 33 144 2347040460 7236 double r_sign(a,b) float *a, *b; { float x; x = (*a >= 0 ? *a : - *a); return( *b >= 0 ? x : -x); } } floor(quotient); else quotient = -floor(-quotient); return(*x - (*y) * quotient ); } ->dimag, a->dreal); x = exp( logr * b->dreal - logi * b->dimag ); y = logr * b->dimag + logi * b->dreal; r->dreal = x * cos(y); r->dimag = x * sin(y); } mag; p->dimag = p->dreal * x.dimag + p->dimag * x.dreal; p->dreal = t; /,5 /,"lib/libF77/r_sin.c 644 0 33 77 2347040460 7054 double r_sin(x) float *x; { double sin(); return( sin(*x) ); } - *a); return( *b >= 0 ? x : -x); } } floor(quotient); else quotient = -floor(-quotient); return(*x - (*y) * quotient ); } ->dimag, a->dreal); x = exp( logr * b->dreal - logi * b->dimag ); y = logr * b->dimag + logi * b->dreal; r->dreal = x * cos(y); r->dimag = x * sin(y); } mag; p->dimag = p->dreal * x.dimag + p->dimag * x.dreal; p->dreal = t; /,5 /,"lib/libF77/r_sinh.c 644 0 33 102 2347040460 7231 double r_sinh(x) float *x; { double sinh(); return( sinh(*x) ); } *a); return( *b >= 0 ? x : -x); } } floor(quotient); else quotient = -floor(-quotient); return(*x - (*y) * quotient ); } ->dimag, a->dreal); x = exp( logr * b->dreal - logi * b->dimag ); y = logr * b->dimag + logi * b->dreal; r->dreal = x * cos(y); r->dimag = x * sin(y); } mag; p->dimag = p->dreal * x.dimag + p->dimag * x.dreal; p->dreal = t; /,5 /,"lib/libF77/r_sqrt.c 644 0 33 102 2347040460 7261 double r_sqrt(x) float *x; { double sqrt(); return( sqrt(*x) ); } *a); return( *b >= 0 ? x : -x); } } floor(quotient); else quotient = -floor(-quotient); return(*x - (*y) * quotient ); } ->dimag, a->dreal); x = exp( logr * b->dreal - logi * b->dimag ); y = logr * b->dimag + logi * b->dreal; r->dreal = x * cos(y); r->dimag = x * sin(y); } mag; p->dimag = p->dreal * x.dimag + p->dimag * x.dreal; p->dreal = t; /,5̌ /,"lib/libF77/r_tan.c 644 0 33 77 2347040460 7045 double r_tan(x) float *x; { double tan(); return( tan(*x) ); } } *a); return( *b >= 0 ? x : -x); } } floor(quotient); else quotient = -floor(-quotient); return(*x - (*y) * quotient ); } ->dimag, a->dreal); x = exp( logr * b->dreal - logi * b->dimag ); y = logr * b->dimag + logi * b->dreal; r->dreal = x * cos(y); r->dimag = x * sin(y); } mag; p->dimag = p->dreal * x.dimag + p->dimag * x.dreal; p->dreal = t; /,5܌ /,"((lib/libF77/r_tanh.c 644 0 33 102 2347040461 7223 double r_tanh(x) float *x; { double tanh(); return( tanh(*x) ); } *a); return( *b >= 0 ? x : -x); } } floor(quotient); else quotient = -floor(-quotient); return(*x - (*y) * quotient ); } ->dimag, a->dreal); x = exp( logr * b->dreal - logi * b->dimag ); y = logr * b->dimag + logi * b->dreal; r->dreal = x * cos(y); r->dimag = x * sin(y); } mag; p->dimag = p->dreal * x.dimag + p->dimag * x.dreal; p->dreal = t; /,5 /,"lib/libF77/s_cat.c 644 0 33 421 2347040461 7045 s_cat(lp, rpp, rnp, np, ll) char *lp, *rpp[]; long int rnp[], *np, ll; { int i, n, nc; char *rp; n = *np; for(i = 0 ; i < n ; ++i) { nc = ll; if(rnp[i] < nc) nc = rnp[i]; ll -= nc; rp = rpp[i]; while(--nc >= 0) *lp++ = *rp++; } while(--ll >= 0) *lp++ = ' '; } ag + logi * b->dreal; r->dreal = x * cos(y); r->dimag = x * sin(y); } mag; p->dimag = p->dreal * x.dimag + p->dimag * x.dreal; p->dreal = t; /,5 /,"lib/libF77/s_cmp.c 644 0 33 745 2347040461 7066 int s_cmp(a, b, la, lb) /* compare two strings */ register char *a, *b; long int la, lb; { register char *aend, *bend; aend = a + la; bend = b + lb; if(la <= lb) { while(a < aend) if(*a != *b) return( *a - *b ); else { ++a; ++b; } while(b < bend) if(*b != ' ') return( ' ' - *b ); else ++b; } else { while(b < bend) if(*a == *b) { ++a; ++b; } else return( *a - *b ); while(a < aend) if(*a != ' ') return(*a - ' '); else ++a; } return(0); } ,"lib/libF77/s_copy.c 644 0 33 400 2347040461 7245 s_copy(a, b, la, lb) /* assign strings: a = b */ char *a, *b; long int la, lb; { char *aend, *bend; aend = a + la; if(la <= lb) while(a < aend) *a++ = *b++; else { bend = b + lb; while(b < bend) *a++ = *b++; while(a < aend) *a++ = ' '; } } bend) if(*b != ' ') return( ' ' - *b ); else ++b; } else { while(b < bend) if(*a == *b) { ++a; ++b; } else return( *a - *b ); while(a < aend) /,5 /,"lib/libF77/s_paus.c 644 0 33 1310 2347040462 7265 #include #define PAUSESIG 15 s_paus(s, n) char *s; long int n; { int i; int waitpause(); fprintf(stderr, "PAUSE "); if(n > 0) for(i = 0; i /* called when a subscript is out of range */ s_rnge(varn, offset, procn, line) char *varn, *procn; long int offset; int line; { register int i; fprintf(stderr, "Subscript out of range on file line %d, procedure ", line); for(i = 0 ; i < 8 && *procn!='_' ; ++i) putc(*procn++, stderr); fprintf(stderr, ".\nAttempt to access the %ld-th element of variable ", offset+1); for(i = 0 ; i < 6 && *varn!=' ' ; ++i) putc(*varn++, stderr); fprintf(stderr, ".\n"); _cleanup(); abort(); } "lib/libF77/s_stop.c 644 0 33 330 2347040462 7263 #include s_stop(s, n) char *s; long int n; { int i; if(n > 0) { fprintf(stderr, "STOP "); for(i = 0; i 21.) { temp = exp(arg)/2; if (sign>0) return(temp); else return(-temp); } if(arg > 0.5) { return(sign*(exp(a((rg) - exp(-arg))/2); } argsq = arg*arg; temp = (((p3*argsq+p2)*argsq+p1)*argsq+p0)*arg; temp /= (((argsq+q2)*argsq+q1)*argsq+q0); return(sign*temp); } double cosh(arg) double arg; { if(arg < 0) arg = - arg; if(arg > 21.) { return(exp(arg)/2); } return((exp(arg) + exp(-arg))/2); } gsq; register sign; sign = 1; if(arg < 0) { arg = - arg; sign = -1; } if(arg > 21.) { temp = exp(arg)/2; if (sign>0) return(temp); else return(-temp); } if(arg > 0.5) { return(sign*(exp(alib/libF77/subout.c 644 0 33 705 2347040464 7305 #include subout(varn, offset, procn, line) char *varn, *procn; long int offset; int line; { register int i; fprintf(stderr, "Subscript out of range on line %d of procedure ", line); for(i = 0 ; i < 8 && *procn!='_' ; ++i) putc(*procn++, stderr); fprintf(stderr, ".\nAttempt to access the %ld-th element of variable ", offset+1); for(i = 0 ; i < 6 && *varn!=' ' ; ++i) putc(*varn++, stderr); fprintf(stderr, ".\n"); _cleanup(); abort(); } 5| /,"lib/libF77/system_.c 644 0 33 374 2347040464 7451 /* f77 interface to system routine */ system_(s, n) register char *s; long int n; { char buff[1000]; register char *bp, *blast; blast = buff + (n<1000 ? n : 1000L); for(bp = buff ; bp 21.) return(sign); return(sign*sinh(arg)/cosh(arg)); } ++i) putc(*varn++, stderr); fprintf(stderr/,5 /,"lib/libF77/z_abs.c 644 0 33 153 2347040465 7060 #include "complex" double z_abs(z) dcomplex *z; { double cabs(); return( cabs( z->dreal, z->dimag ) ); } xcept for large arguments, which would cause overflow improperly. */ double sinh(), cosh(); double tanh(arg) double arg; { double sign; sign = 1.; if(arg < 0.){ arg = -arg; sign = -1.; } if(arg > 21.) return(sign); return(sign*sinh(arg)/cosh(arg)); } ++i) putc(*varn++, stderr); fprintf(stderr/,5 /,"lib/libF77/z_cos.c 644 0 33 263 2347040466 7102 #include "complex" z_cos(r, z) dcomplex *r, *z; { double sin(), cos(), sinh(), cosh(); r->dreal = cos(z->dreal) * cosh(z->dimag); r->dimag = - sin(z->dreal) * sinh(z->dimag); } ouble sinh(), cosh(); double tanh(arg) double arg; { double sign; sign = 1.; if(arg < 0.){ arg = -arg; sign = -1.; } if(arg > 21.) return(sign); return(sign*sinh(arg)/cosh(arg)); } ++i) putc(*varn++, stderr); fprintf(stderr/,5 /,"lib/libF77/z_div.c 644 0 33 1173 2347040466 7121 struct dcomplex { double dreal, dimag; }; z_div(c, a, b) struct dcomplex *a, *b, *c; { double ratio, den; double abr, abi; if( (abr = b->dreal) < 0.) abr = - abr; if( (abi = b->dimag) < 0.) abi = - abi; if( abr <= abi ) { if(abi == 0) abort(); /* fatal("complex division by zero"); */ ratio = b->dreal / b->dimag ; den = b->dimag * (1 + ratio*ratio); c->dreal = (a->dreal*ratio + a->dimag) / den; c->dimag = (a->dimag*ratio - a->dreal) / den; } else { ratio = b->dimag / b->dreal ; den = b->dreal * (1 + ratio*ratio); c->dreal = (a->dreal + a->dimag*ratio) / den; c->dimag = (a->dimag - a->dreal*ratio) / den; } } if( (abr = b->dreal) < 0.) abr = - abr; if( (abi = b->dimag) < 0.) abi = - abi; if( abr <= abi ) { if(abi == 0) abort(); /* fatal("complex division by zero"); */ ratio = b->dreal / b->dimag ; den = b->dimag * (1 + ratio*ratio); c->dreal = (a->dreal*ratio + a->dimag) / den; c->dimag = (a->dimag*ratio - a->dreal) / den; } else { ratio = b->dimag / b->dreal ; den = b->drealib/libF77/z_exp.c 644 0 33 267 2347040466 7116 #include "complex" z_exp(r, z) dcomplex *r, *z; { double expx; double exp(), cos(), sin(); expx = exp(z->dreal); r->dreal = expx * cos(z->dimag); r->dimag = expx * sin(z->dimag); } ag) < 0.) abi = - abi; if( abr <= abi ) { if(abi == 0) abort(); /* fatal("complex division by zero"); */ ratio = b->dreal / b->dimag ; den = b->dimag * (1 + ratio*ratio); c->dreal = (a->dreal*ratio + a->dimag) / den; c->dimag = /,5܍ /,"lib/libF77/z_log.c 644 0 33 251 2347040466 7074 #include "complex" z_log(r, z) dcomplex *r, *z; { double log(), cabs(), atan2(); r->dimag = atan2(z->dimag, z->dreal); r->dreal = log( cabs( z->dreal, z->dimag ) ); } (z->dimag); } ag) < 0.) abi = - abi; if( abr <= abi ) { if(abi == 0) abort(); /* fatal("complex division by zero"); */ ratio = b->dreal / b->dimag ; den = b->dimag * (1 + ratio*ratio); c->dreal = (a->dreal*ratio + a->dimag) / den; c->dimag = /,5 /,"lib/libF77/z_sin.c 644 0 33 261 2347040467 7106 #include "complex" z_sin(r, z) dcomplex *r, *z; { double sin(), cos(), sinh(), cosh(); r->dreal = sin(z->dreal) * cosh(z->dimag); r->dimag = cos(z->dreal) * sinh(z->dimag); } g); } ag) < 0.) abi = - abi; if( abr <= abi ) { if(abi == 0) abort(); /* fatal("complex division by zero"); */ ratio = b->dreal / b->dimag ; den = b->dimag * (1 + ratio*ratio); c->dreal = (a->dreal*ratio + a->dimag) / den; c->dimag = /,5 /,"((lib/libF77/z_sqrt.c 644 0 33 614 2453223510 7276 #include "complex" z_sqrt(r, z) dcomplex *r, *z; { double mag, sqrt(), cabs(); if( (mag = cabs(z->dreal, z->dimag)) == 0.) r->dreal = r->dimag = 0.; else if(z->dreal > 0) { r->dreal = sqrt(0.5 * (mag + z->dreal) ); r->dimag = z->dimag / r->dreal / 2; } else { r->dimag = sqrt(0.5 * (mag - z->dreal) ); r->dreal = z->dimag / r->dimag / 2; if(z->dimag < 0) r->dreal = - r->dreal; } } mag) / den; c->dimag = /,5  /,"lib/libF77/Version.c 644 0 33 277 2413062514 7407 static char junk[] = "\n@(#)LIBF77 VERSION 2.01 11 AUGUST 1980\n"; /* 2.00 11 June 1980. File version.c added to library. 2.01 11 August 1980. Added rand_.c, courtesy of R. H. Morris. */ rt(0.5 * (mag + z->dreal) ); r->dimag = z->dimag / r->dreal / 2; } else { r->dimag = sqrt(0.5 * (mag - z->dreal) ); r->dreal = z->dimag / r->dimag / 2; if(z->dimag < 0) r->dreal = - r->dreal; } } mag) / den; c->dimag = /,5 /,"lib/libF77/outstr_.c 644 0 33 212 2413062514 7446 #include /* print a character string */ outstr_(s, n) register char *s; register long n; { while ( --n >= 0) putchar(*s++); } t 1980. Added rand_.c, courtesy of R. H. Morris. */ rt(0.5 * (mag + z->dreal) ); r->dimag = z->dimag / r->dreal / 2; } else { r->dimag = sqrt(0.5 * (mag - z->dreal) ); r->dreal = z->dimag / r->dimag / 2; if(z->dimag < 0) r->dreal = - r->dreal; } } mag) / den; c->dimag = /,5, /,"lib/libF77/rand_.c 644 0 33 561 2413062514 7041 /* Uniform random number generator. Code courtesy of Bob Morris. Linear congruential generator, suitable for 32 bit machines; multiplication is mod 2**31 */ static long randx = 1; srand_(x) /* subroutine to set seed */ long *x; { randx = *x; } double rand_() { double ldexp(); return(ldexp((double)(((randx = randx*1103515245 + 12345)>>7) & 077777777), -24)); } ->dreal = - r->dreal; } } mag) / den; c->dimag = /,5< /,"lib/libpc/ 775 0 33 0 2552607302 5610 lib/libpc/ACTFILE.c 644 0 33 332 2552607263 7072 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)ACTFILE.c 1.1 10/29/80"; #include "h00vars.h" FILE * ACTFILE(curfile) struct iorec *curfile; { return curfile->fbuf; } */ long *x; { randx = *x; } double rand_() { double ldexp(); return(ldexp((double)(((randx = randx*1103515245 + 12345)>>7) & 077777777), -24)); } ->dreal = - r->dreal; } } / den; / C. /,"lib/libpc/ADDT.c 644 0 33 562 2552607263 6544 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)ADDT.c 1.2 3/7/81"; long * ADDT(result0, left, right, siz) long *result0; register long *left; register long *right; long siz; { register long *result = result0; register int size = siz; do { *result++ = *left++ | *right++; } while (--size); return result0; } >dreal = - r->dreal; } } / den; //,5܆ /,"lib/libpc/APPEND.c 644 0 33 710 2552607263 6772 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)APPEND.c 1.2 6/10/81"; #include "h00vars.h" APPEND(filep) register struct iorec *filep; { filep = GETNAME (filep, 0, 0, 0); filep->fbuf = fopen(filep->fname, "a"); if (filep->fbuf == NULL) { PERROR("Could not open ", filep->pfname); return; } filep->funit |= (EOFF | FWRITE); if (filep->fblk > PREDEF) { setbuf(filep->fbuf, &filep->buf[0]); } }  /,"lib/libpc/ARGV.c 644 0 33 1056 2552607263 6606 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)ARGV.c 1.3 6/10/81"; #include "h00vars.h" ARGV(subscript, var, siz) long subscript; /* subscript into argv */ register char *var; /* pointer to pascal char array */ long siz; /* sizeof(var) */ { register char *cp; register int size = siz; if (subscript >= _argc) { ERROR("Argument to argv of %D is out of range\n", subscript); return; } cp = _argv[subscript]; do { *var++ = *cp++; } while (--size && *cp); while (size--) *var++ = ' '; } y of California */ static char sccsid[] = "@(#)ARGV.c 1.3 6/10/81"; #include "h00vars.h" ARGV(subscript, var, siz) long subscript; /* subscript into argv */ register char *var; /* pointer to pascal char array */ long siz; /* sizeof(var) */ { register char *cp; register int size = siz; if (subscript >= _argc) { ERROR("Argument to argv of %D is out of range\n", subscript); return; } cp = _argv[subscript]; do { *var++ = *cp++; } while (--silib/libpc/ASRT.c 644 0 33 512 2552607264 6575 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)ASRT.c 1.2 6/10/81"; #define NULL 0 ASRT(cond, stmt) short cond; char *stmt; { if (cond) return; if (stmt != NULL) { ERROR("Assertion failed: %s\n", stmt); return; } else { ERROR("Assertion failed\n", 0); return; } } nt size = siz; if (subscript >= _argc) { ERROR("Argument to argv of %D is out of range/,5  /,"((lib/libpc/BUFF.c 644 0 33 531 2552607264 6547 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)BUFF.c 1.2 3/7/81"; #include "h00vars.h" extern char _sobuf[]; BUFF(amount) long amount; { struct iorec *curfile; curfile = OUTPUT; if (amount == 0) setbuf(0, ACTFILE(curfile)); else if (amount == 2) setbuf(_sobuf, ACTFILE(curfile)); } if (subscript >= _argc) { ERROR("Argument to argv of %D is out of range/,5 /,"lib/libpc/CARD.c 644 0 33 2134 2552607264 6557 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)CARD.c 1.2 3/7/81"; char _cntbl[] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8 }; long CARD(setptr, siz) register unsigned char *setptr; long siz; { register int cnt; register int size = siz; cnt = 0; do { cnt += _cntbl[*setptr++]; } while (--size); return cnt; } 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8 }; long CARD(setptr, siz) register unsigned char *setptr; long siz; { register int cnt; register intlib/libpc/CHR.c 644 0 33 424 2552607264 6442 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)CHR.c 1.3 6/10/81"; char CHR(value) long value; { if (value < 0 || value > 127) { ERROR("Argument to chr of %D is out of range\n", value); return; } return (char)value; } 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8 }; long CARD(s/,5< /,"lib/libpc/CLCK.c 644 0 33 272 2552607264 6543 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)CLCK.c 1.2 3/7/81"; long CLCK() { long tim[4]; times(tim); return (tim[0] * 50) / 3; } OR("Argument to chr of %D is out of range\n", value); return; } return (char)value; } 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8 }; long CARD(s/,5L /,"lib/libpc/CTTOT.c 644 0 33 6066 2552607264 6753 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)CTTOT.c 1.4 6/10/81"; #include "whoami.h" #include "h00vars.h" long _mask[] = { # ifdef DEC11 0xffffffff , 0xfffffffe , 0xfffffffc , 0xfffffff8 , 0xfffffff0 , 0xffffffe0 , 0xffffffc0 , 0xffffff80 , 0xffffff00 , 0xfffffe00 , 0xfffffc00 , 0xfffff800 , 0xfffff000 , 0xffffe000 , 0xffffc000 , 0xffff8000 , 0xffff0000 , 0xfffe0000 , 0xfffc0000 , 0xfff80000 , 0xfff00000 , 0xffe00000 , 0xffc00000 , 0xff800000 , 0xff000000 , 0xfe000000 , 0xfc000000 , 0xf8000000 , 0xf0000000 , 0xe0000000 , 0xc0000000 , 0x80000000 , 0x00000000 # else 0xffffffff , 0xfeffffff , 0xfcffffff , 0xf8ffffff , 0xf0ffffff , 0xe0ffffff , 0xc0ffffff , 0x80ffffff , 0x00ffffff , 0x00feffff , 0x00fcffff , 0x00f8ffff , 0x00f0ffff , 0x00e0ffff , 0x00c0ffff , 0x0080ffff , 0x0000ffff , 0x0000feff , 0x0000fcff , 0x0000f8ff , 0x0000f0ff , 0x0000e0ff , 0x0000c0ff , 0x000080ff , 0x000000ff , 0x000000fe , 0x000000fc , 0x000000f8 , 0x000000f0 , 0x000000e0 , 0x000000c0 , 0x00000080 , 0x00000000 # endif DEC11 }; /* * Constant set constructor */ long * CTTOT(result0, lwrbnd, uprbnd, paircnt, singcnt, data) long *result0; /* pointer to final set */ long lwrbnd; /* lower bound of set */ long uprbnd; /* upper - lower of set */ long paircnt; /* number of pairs to construct */ long singcnt; /* number of singles to construct */ long data; /* paircnt plus singcnt sets of data */ { register long *result = result0; register long *dataptr = &data; int lowerbnd = lwrbnd; int upperbnd = uprbnd; register long *lp; register char *cp; register long temp; long *limit; int lower; int lowerdiv; int lowermod; int upper; int upperdiv; int uppermod; int cnt; limit = &result[(upperbnd + 1 + BITSPERLONG - 1) >> LG2BITSLONG]; for (lp = result; lp < limit; ) *lp++ = 0; for (cnt = 0; cnt < paircnt; cnt++) { upper = *dataptr++ - lowerbnd; if (upper < 0 || upper > upperbnd) { ERROR("Range upper bound of %D out of set bounds\n", *--dataptr); return; } lower = *dataptr++ - lowerbnd; if (lower < 0 || lower > upperbnd) { ERROR("Range lower bound of %D out of set bounds\n", *--dataptr); return; } if (lower > upper) { continue; } lowerdiv = lower >> LG2BITSLONG; lowermod = lower & MSKBITSLONG; upperdiv = upper >> LG2BITSLONG; uppermod = upper & MSKBITSLONG; temp = _mask [lowermod]; if ( lowerdiv == upperdiv ) { temp &= ~_mask[ uppermod + 1 ]; } result[ lowerdiv ] |= temp; limit = &result[ upperdiv-1 ]; for ( lp = &result[ lowerdiv+1 ] ; lp <= limit ; lp++ ) { *lp |= ~0; } if ( lowerdiv != upperdiv ) { result[ upperdiv ] |= ~_mask[ uppermod + 1 ]; } } for (cnt = 0, cp = (char *)result; cnt < singcnt; cnt++) { lower = *dataptr++ - lowerbnd; if (lower < 0 || lower > upperbnd) { ERROR("Value of %D out of set bounds\n", *--dataptr); return; } cp[ lower >> LG2BITSBYTE ] |= (1 << (lower & MSKBITSBYTE)); } return(result); } ult[ lowerdiv ] |= temp; limit = &result[ upperdiv-1 ]; for ( lp = &result[ lowerdiv+1 ] ; lp <= limit ; lp++ ) { *lp |= ~0; } if ( lowerdiv != upperdiv ) { result[ upperdiv ] |= ~_mask[ uppermod + 1 ]; } } for (cnt = 0, cp = (char *)result; cnt < singcnt; cnt++) { lower = *dataptr++ - lowerbnd; if (lower < 0 || lower > upperbnd) { ERROR("Value of %D out of set bounds\n", *--dataptr); return; } cp[ lower >> LG2BITSBYTE ] |lib/libpc/DATE.c 644 0 33 561 2552607264 6545 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)DATE.c 1.1 10/29/80"; char _pd_date[] = { 8, 9, 10, 4, 5, 6, 10, 22, 23, 10, 0 }; extern char *ctime(); DATE(alfap) register char *alfap; { register char *ap, *cp, *dp; long a; time(&a); cp = ctime(&a); ap = alfap; for (dp = _pd_date; *dp; *ap++ = cp[*dp++]); } ; if (lower < 0 || lower > upperbnd) { ERROR("/,5l /,"((lib/libpc/DEFNAME.c 644 0 33 531 2552607265 7065 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)DEFNAME.c 1.2 3/7/81"; #include "h00vars.h" DEFNAME(filep, name, maxnamlen, datasize) register struct iorec *filep; char *name; long maxnamlen; long datasize; { filep = GETNAME(filep, name, maxnamlen, datasize); filep->funit |= FDEF; } ; *ap++ = cp[*dp++]); } ; if (lower < 0 || lower > upperbnd) { ERROR("/,5| /,"lib/libpc/DISPOSE.c 644 0 33 1027 2552607265 7155 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)DISPOSE.c 1.3 6/10/81"; #include "h00vars.h" DISPOSE(var, siz) register char **var; /* pointer to pointer being deallocated */ long siz; /* sizeof(bletch) */ { register int size = siz; if (*var == 0 || *var + size > _maxptr || *var < _minptr) { ERROR("Pointer value out of legal range\n", 0); return; } free(*var); if (*var == _minptr) _minptr += size; if (*var + size == _maxptr) _maxptr -= size; *var = (char *)(0); } egents of the University of California */ static char sccsid[] = "@(#)DISPOSE.c 1.3 6/10/81"; #include "h00vars.h" DISPOSE(var, siz) register char **var; /* pointer to pointer being deallocated */ long siz; /* sizeof(bletch) */ { register int size = siz; if (*var == 0 || *var + size > _maxptr || *var < _minptr) { ERROR("Pointer value out of legal range\n", 0); return; } free(*var); if (*var == _minptr) _minptr += size; if (*var + size == _maxptr) _maxptr -= size; lib/libpc/ERROR.c 644 0 33 1164 2552607265 6742 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)ERROR.c 1.8 6/10/81"; #include #include #include "h00vars.h" /* * Routine ERROR is called from the runtime library when a runtime * error occurs. Its arguments are a pointer to an error message and * an error specific piece of data. */ long ERROR(msg, d1, d2) char *msg; long d1, d2; { PFLUSH(); fputc('\n',stderr); SETRACE(); /* * Historical anomaly */ if ((int)msg == 5) { fprintf(stderr, "Label of %D not found in case\n", d1); return d1; } fprintf(stderr, msg, d1, d2); return d1; } #include #include #include "h00vars.h" /* * Routine ERROR is called from the runtime library when a runtime * error occurs. Its arguments are a pointer to an error message and * an error specific piece of data. */ long ERROR(msg, d1, d2) char *msg; long d1, d2; { PFLUSH(); fputc('\n',stderr); SETRACE(); /* * Historical anomaly */ if ((int)msg == 5) { flib/libpc/EXPO.c 644 0 33 676 2552607265 6613 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)EXPO.c 1.2 3/7/81"; long EXPO(value) double value; { register int retval; register char *cp; char sign, buf[30]; extern char *index(); if (value == 0.0) return 0; sprintf(buf, "%.1e", value); cp = index(buf, 'e') + 1; sign = *cp++; retval = 0; while (*cp) retval = retval * 10 + *cp++ - '0'; return sign == '-' ? -retval : retval; } 5 /,"lib/libpc/FCALL.c 644 0 33 536 2552607265 6654 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)FCALL.c 1.4 6/8/81"; #include "h00vars.h" FCALL(frtn) register struct formalrtn *frtn; { blkcpy(frtn->fbn * sizeof(struct display), &_disply[1], &frtn->fdisp[frtn->fbn]); blkcpy(frtn->fbn * sizeof(struct display), &frtn->fdisp[0], &_disply[1]); } 0; while (*cp) retval = retval * 10 + *cp++ - '0'; return sign == /,5 /,"lib/libpc/FLUSH.c 644 0 33 600 2552607265 6704 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)FLUSH.c 1.2 6/10/81"; #include "h00vars.h" FLUSH(curfile) register struct iorec *curfile; { if (curfile->fblk >= MAXFILES || _actfile[curfile->fblk] != curfile) { ERROR("Reference to an inactive file\n", 0); return; } if (curfile->funit & FWRITE) { fflush(curfile->fbuf); } } * 10 + *cp++ - '0'; return sign == /,5̇ /,"lib/libpc/FNIL.c 644 0 33 1004 2552607265 6572 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)FNIL.c 1.3 6/10/81"; #include "h00vars.h" char * FNIL(curfile) register struct iorec *curfile; { if (curfile->fblk >= MAXFILES || _actfile[curfile->fblk] != curfile) { ERROR("Reference to an inactive file\n", 0); return; } if (curfile->funit & FDEF) { ERROR("%s: Reference to an inactive file\n", curfile->pfname); return; } if (curfile->funit & FREAD) { IOSYNC(curfile); } return curfile->fileptr; } opyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)FNIL.c 1.3 6/10/81"; #include "h00vars.h" char * FNIL(curfile) register struct iorec *curfile; { if (curfile->fblk >= MAXFILES || _actfile[curfile->fblk] != curfile) { ERROR("Reference to an inactive file\n", 0); return; } if (curfile->funit & FDEF) { ERROR("%s: Reference to an inactive file\n", curfile->pfname); return; } if (curfile->funit & FREAD) { IOSYNC(curfile); } return curfile->fileptrlib/libpc/FRTN.c 644 0 33 416 2552607265 6601 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)FRTN.c 1.5 6/8/81"; #include "h00vars.h" FRTN(frtn) register struct formalrtn *frtn; { blkcpy(frtn->fbn * sizeof(struct display), frtn->fdisp[frtn->fbn], &_disply[1]); } RROR("Reference to an inactive file\n", 0); return; } if (curfile->funit & FDEF) { ERROR("%s: Reference to an inactive file\n", curfile->pfname)/,5 /,"lib/libpc/FSAV.c 644 0 33 621 2552607266 6566 ((/* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)FSAV.c 1.3 4/1/81"; #include "h00vars.h" struct formalrtn * FSAV(entryaddr, cbn, frtn) long (*entryaddr)(); long cbn; register struct formalrtn *frtn; { frtn->fentryaddr = entryaddr; frtn->fbn = cbn; blkcpy(frtn->fbn * sizeof(struct display), &_disply[1], &frtn->fdisp[0]); return frtn; } ", curfile->pfname)/,5 /,"lib/libpc/GET.c 644 0 33 715 2552607266 6452 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)GET.c 1.2 6/10/81"; #include "h00vars.h" GET(curfile) register struct iorec *curfile; { if (curfile->funit & FWRITE) { ERROR("%s: Attempt to read, but open for writing\n", curfile->pfname); return; } IOSYNC(curfile); if (curfile->funit & EOFF) { ERROR("%s: Tried to read past end of file\n", curfile->pfname); return; } curfile->funit |= SYNC; }  /,"lib/libpc/GETNAME.c 644 0 33 6122 2552607266 7131 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)GETNAME.c 1.6 6/10/81"; #include "h00vars.h" /* * GETNAME - activate a file * * takes a name, name length, element size, and variable * level and returns a pointer to a file structure. * * a new file structure is initialized if necessary. * temporary names are generated, and given * names are blank trimmed. */ struct iorec * GETNAME(filep, name, namlim, datasize) register struct iorec *filep; char *name; long namlim; long datasize; { int maxnamlen = namlim; struct iorec *prev; struct iorec *next; register int cnt; struct iorec locvar; if (filep->fblk >= MAXFILES || _actfile[filep->fblk] != filep) { /* * initialize a new filerecord */ filep->funit = 0; if (datasize == 0) { filep->funit |= FTEXT; datasize = 1; } filep->fsize = datasize; filep->fbuf = 0; filep->lcount = 0; filep->llimit = 0x7fffffff; filep->fileptr = &filep->window[0]; /* * check to see if file is global, or allocated in * the stack by checking its address against the * address of one of our routine's local variables. */ if (filep < &locvar) filep->flev = GLVL; else filep->flev = filep; do { if (++_filefre == MAXFILES) _filefre = PREDEF + 1; } while (_actfile[_filefre] != FILNIL); filep->fblk = _filefre; _actfile[_filefre] = filep; /* * link the newrecord into the file chain */ prev = (struct iorec *)&_fchain; next = _fchain.fchain; while (filep->flev > next->flev) { prev = next; next = next->fchain; } filep->fchain = next; prev->fchain = filep; } else { if ((filep->funit & FDEF) == 0 && filep->fbuf != NULL) { /* * have a previous buffer, close associated file */ if (filep->fblk > PREDEF) { fflush(filep->fbuf); setbuf(filep->fbuf, NULL); } fclose(filep->fbuf); if (ferror(filep->fbuf)) { ERROR("%s: Close failed\n", filep->pfname); return; } /* * renamed temporary files are discarded */ if ((filep->funit & TEMP) && name != NULL) { if (unlink(filep->pfname)) { PERROR("Could not remove ", filep->pfname); return; } } } filep->funit &= (TEMP | FTEXT); } /* * get the filename associated with the buffer */ if (name == NULL) { if (*filep->fname != NULL) { return(filep); } /* * no name given and no previous name, so generate * a new one of the form #tmp.xxxxxx */ filep->funit |= TEMP; sprintf(filep->fname, "#tmp.%c%d", 'a' + filep->fblk, getpid()); filep->pfname = &filep->fname[0]; return(filep); } /* * trim trailing blanks, and insure that the name * will fit into the file structure */ for (cnt = 0; cnt < maxnamlen; cnt++) if (name[cnt] == '\0' || name[cnt] == ' ') break; if (cnt >= NAMSIZ) { ERROR("%s: File name too long\n", name); return; } maxnamlen = cnt; filep->funit &= ~TEMP; /* * put the new name into the structure */ for (cnt = 0; cnt < maxnamlen; cnt++) filep->fname[cnt] = name[cnt]; filep->fname[cnt] = '\0'; filep->pfname = &filep->fname[0]; return(filep); } /* * trim trailing blanks, and insure that the name * will fit into the file structure */ for (cnt = 0; cnt < maxnamlen; cnt++) if (name[cnt] == '\0' || name[cnt] == ' ') break; if (cnt >= NAMSIZ) { ERROR("%s: File name too long\n", name); return; } maxnamlen = cnt; filep->funit &= ~TEMP; /* * put the new name into the structure */ for (cnt = 0; cnt < maxnamlen; cnt++) filep->fname[cnt] = name[cnt]lib/libpc/GOTO.s 644 0 33 1700 2552607266 6636 # Copyright (c) 1979 Regents of the University of California # # sccsid[] = "@(#)GOTO.s 1.3 6/10/81"; # .set EGOTO,13 #this is dependent upon errdata .set PC,16 .data jmplbl: .long 0 frame: .long 0 .text .globl _GOTO .align 1 _GOTO: .word 0 movl *4(ap),frame #save parameters movl PC(fp),jmplbl moval unwind,PC(fp) #begin unwinding ret unwind: tstl (fp) #check for exception vector bneq L1 cmpl ap,__disply+8 #check for past global procedure bgequ egoto moval unwind,PC(fp) #blow away this stack frame ret L1: cmpl ap,frame #check for requested frame bgtru egoto #lost it somewhere blssu L2 #not there yet jmp *jmplbl #proceed in this section L2: pushl -4(fp) #level of this frame calls $1,*(fp) #call the exception handler movq -12(fp),*-4(fp) #restore the display moval unwind,PC(fp) #blow away this stack frame ret egoto: pushl $0 pushal L3 calls $2,_ERROR ret L3: .asciz "Active frame not found in non-local goto\n" al procedure bgequ egoto moval unwind,PC(fp) #blow away this slib/libpc/HALT.c 644 0 33 333 2552607266 6557 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)HALT.c 1.3 6/10/81"; #include "h00vars.h" HALT() { PFLUSH(); fputs("Call to procedure halt\n", stderr); PCEXIT(0); } ll the exception handler movq -12(fp),*-4(fp) #restore the display moval unwind,PC(fp) #blow away this stack frame ret egoto: pushl $0 pushal L3 calls $2,_ERROR ret L3: .asciz "Active frame not/,5< /,"lib/libpc/IN.c 644 0 33 1007 2552607267 6355 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)IN.c 1.2 3/7/81"; #include "h00vars.h" bool IN(element, lower, upper, setptr) long element; /* element to check */ long lower; /* lowest element of set */ long upper; /* upper - lower of set */ char setptr[]; /* pointer to set */ { register int indx; if ((indx = element - lower) < 0 || indx > upper) return FALSE; if (setptr[indx >> LG2BITSBYTE] & (1 << (indx & MSKBITSBYTE))) return TRUE; return FALSE; } right (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)IN.c 1.2 3/7/81"; #include "h00vars.h" bool IN(element, lower, upper, setptr) long element; /* element to check */ long lower; /* lowest element of set */ long upper; /* upper - lower of set */ char setptr[]; /* pointer to set */ { register int indx; if ((indx = element - lower) < 0 || indx > upper) return FALSE; if (setptr[indx >> LG2BITSBYTE] & (1 << (indx & MSKBITSBYTE))) return TRUE; return FAlib/libpc/INCT.c 644 0 33 1262 2552607267 6607 ((/* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)INCT.c 1.2 3/7/81"; #include "h00vars.h" bool INCT(element, paircnt, singcnt, data) register long element; /* element to find */ long paircnt; /* number of pairs to check */ long singcnt; /* number of singles to check */ long data; /* paircnt plus singcnt bounds */ { register long *dataptr = &data; register int cnt; for (cnt = 0; cnt < paircnt; cnt++) { if (element > *dataptr++) { dataptr++; continue; } if (element >= *dataptr++) { return TRUE; } } for (cnt = 0; cnt < singcnt; cnt++) { if (element == *dataptr++) { return TRUE; } } return FALSE; } ) register long element; /* element to find */ long paircnt; /* number of pairs to check */ long singcnt; /* number of singles to check */ long data; /* paircnt plus singcnt bounds */ { register long *dataptr = &data; register int cnt; for (cnt = 0; cnt < paircnt; cnt++) { if (element > *dataptr++) { dataptr++; lib/libpc/IOSYNC.c 644 0 33 2615 2552607267 7061 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)IOSYNC.c 1.5 6/10/81"; #include "h00vars.h" /* * insure that a usable image is in the buffer window */ IOSYNC(curfile) register struct iorec *curfile; { char *limit, *ptr; if (curfile->funit & FWRITE) { ERROR("%s: Attempt to read, but open for writing\n", curfile->pfname); return; } if ((curfile->funit & SYNC) == 0) { return; } if (curfile->funit & EOFF) { ERROR("%s: Tried to read past end of file\n", curfile->pfname); return; } curfile->funit &= ~SYNC; if (curfile->funit & SPEOLN) { curfile->funit &= ~(SPEOLN|EOLN); curfile->funit |= EOFF; return; } fread(curfile->fileptr, (int)curfile->fsize, 1, curfile->fbuf); if (ferror(curfile->fbuf)) { ERROR("%s: Tried to read past end of file\n", curfile->pfname); return; } if (feof(curfile->fbuf)) { if (curfile->funit & FTEXT) { *curfile->fileptr = ' '; if (curfile->funit & EOLN) { curfile->funit &= ~EOLN; curfile->funit |= EOFF; return; } curfile->funit |= (SPEOLN|EOLN); return; } curfile->funit |= EOFF; limit = &curfile->fileptr[curfile->fsize]; for (ptr = curfile->fileptr; ptr < limit; ) *ptr++ = 0; return; } if (curfile->funit & FTEXT) { if (*curfile->fileptr == '\n') { curfile->funit |= EOLN; *curfile->fileptr = ' '; return; } curfile->funit &= ~EOLN; } } it & FTEXT) { *curfile->fileptr = ' '; if (curfile->funit & EOLN) { curfile->funit &= ~EOLN; curfile-lib/libpc/LINO.c 644 0 33 370 2552607267 6572 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)LINO.c 1.2 6/10/81"; #include "h00vars.h" LINO() { if (++_stcnt >= _stlim) { ERROR("Statement count limit of %D exceeded\n", _stcnt); return; } } & FTEXT) { if (*curfile->fileptr == '\n') { curfile->funit |= EOLN; *curfile->fileptr = ' '; return; } curfile->funit &= ~EOLN; } } it & FTEXT) { *curfi/,5| /,"lib/libpc/LLIMIT.c 644 0 33 610 2552607267 7020 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)LLIMIT.c 1.3 6/10/81"; #include "h00vars.h" LLIMIT(curfile, limit) register struct iorec *curfile; long limit; { if (limit <= 0) limit = 0x7fffffff; curfile->llimit = limit; if (curfile->lcount >= curfile->llimit) { ERROR("%s: Line limit exceeded\n", curfile->pfname); return; } } } } it & FTEXT) { *curfi/,5 /,"lib/libpc/LN.c 644 0 33 425 2552607267 6343 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)LN.c 1.4 6/10/81"; #include double LN(value) double value; { if (value <= 0) { ERROR("Non-positive argument of %e to ln\n", value); return; } return log(value); } ; if (curfile->lcount >= curfile->llimit) { ERROR("%s: Line limit exceeded\n", curfile->pfname); return; } } } } it & FTEXT) { *curfi/,5 /,"lib/libpc/MAX.c 644 0 33 716 2552607270 6454 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)MAX.c 1.4 6/10/81"; #include "h00vars.h" long MAX(width, reduce, min) register long width; /* requested width */ long reduce; /* amount of extra space required */ long min; /* minimum amount of space needed */ { if (width <= 0) { ERROR("Non-positive format width: %D\n", width); return; } if ((width -= reduce) >= min) return width; return min; }  /,"lib/libpc/MULT.c 644 0 33 562 2552607270 6607 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)MULT.c 1.2 3/7/81"; long * MULT(result0, left, right, siz) long *result0; register long *left; register long *right; long siz; { register long *result = result0; register int size = siz; do { *result++ = *left++ & *right++; } while (--size); return result0; } : %D\n", width); return; } if ((width -= reduc/,5 /,"lib/libpc/NAM.c 644 0 33 1000 2552607270 6445 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)NAM.c 1.3 6/10/81"; #include "h00vars.h" char * NAM(val, name) long val; /* internal enumerated type value */ char *name; /* ptr to enumerated type name descriptor */ { register int value = val; register short *sptr; sptr = (short *)name; if (value < 0 || value >= *sptr) { ERROR("Enumerated type value of %D is out of range on output\n", val); return; } sptr++; return name + 2 + sptr[value]; } lib/libpc/NEW.c 644 0 33 1001 2552607270 6464 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)NEW.c 1.3 6/10/81"; #include "h00vars.h" NEW(var, size) char **var; /* pointer to item being deallocated */ long size; /* sizeof struct pointed to by var */ { extern char *malloc(); char *memblk; memblk = malloc((int)size); if (memblk == 0) { ERROR("Ran out of memory\n", 0); return; } *var = memblk; if (memblk < _minptr) _minptr = memblk; if (memblk + size > _maxptr) _maxptr = memblk + size; }(( * Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)NEW.c 1.3 6/10/81"; #include "h00vars.h" NEW(var, size) char **var; /* pointer to item being deallocated */ long size; /* sizeof struct pointed to by var */ { extern char *malloc(); char *memblk; memblk = malloc((int)size); if (memblk == 0) { ERROR("Ran out of memory\n", 0); return; } *var = memblk; if (memblk < _minptr) _minptr = memblk; if (memblk + size > _maxptr) _maxptr = memblk + size; }lib/libpc/NEWZ.c 644 0 33 1031 2552607270 6621 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)NEWZ.c 1.3 6/10/81"; #include "h00vars.h" NEWZ(var, size) char **var; /* pointer to item being deallocated */ long size; /* sizeof struct pointed to by var */ { register char *cp; char *limit; extern char *malloc(); cp = malloc((int)size); if (cp == 0) { ERROR("Ran out of memory\n", 0); return; } *var = cp; if (cp < _minptr) _minptr = cp; limit = cp + size; if (limit > _maxptr) _maxptr = limit; blkclr(size, cp); } ents of the University of California */ static char sccsid[] = "@(#)NEWZ.c 1.3 6/10/81"; #include "h00vars.h" NEWZ(var, size) char **var; /* pointer to item being deallocated */ long size; /* sizeof struct pointed to by var */ { register char *cp; char *limit; extern char *malloc(); cp = malloc((int)size); if (cp == 0) { ERROR("Ran out of memory\n", 0); return; } *var = cp; if (cp < _minptr) _minptr = cp; limit = cp + size; if (limit > _maxptr) _maxptr = limlib/libpc/NIL.c 644 0 33 466 2552607270 6453 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)NIL.c 1.2 6/10/81"; #include "h00vars.h" char * NIL(ptr) char *ptr; /* pointer to struct */ { if (ptr > _maxptr || ptr < _minptr) { ERROR("Pointer value out of legal range\n", 0); return; } return ptr; } lloc(); cp = malloc((int)size); if (cp == 0) { ERROR("Ran out of memory\n", 0); return; } *var = cp; /,5 /,"lib/libpc/PACK.c 644 0 33 2102 2552607270 6554 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)PACK.c 1.3 6/10/81"; /* * pack(a,i,z) * * with: a: array[m..n] of t * z: packed array[u..v] of t * * semantics: for j := u to v do * z[j] := a[j-u+i]; * * need to check: * 1. i >= m * 2. i+(v-u) <= n (i.e. i-m <= (n-m)-(v-u)) * * on stack: lv(z), lv(a), rv(i) (len 4) * * move w(t)*(v-u+1) bytes from lv(a)+w(t)*(i-m) to lv(z) */ PACK(i, a, z, size_a, lb_a, ub_a, size_z) long i; /* subscript into a to begin packing */ char *a; /* pointer to structure a */ char *z; /* pointer to structure z */ long size_a; /* sizeof(a_type) */ long lb_a; /* lower bound of structure a */ long ub_a; /* (upper bound of a) - (lb_a + sizeof(z_type)) */ long size_z; /* sizeof(z_type) */ { int subscr; register char *cp; register char *zp = z; register char *limit; subscr = i - lb_a; if (subscr < 0 || subscr > ub_a) { ERROR("i = %D: Bad i to pack(a,i,z)\n", i); return; } cp = &a[subscr * size_a]; limit = cp + size_z; do { *zp++ = *cp++; } while (cp < limit); } char *z; /* pointer to structure z */ long size_a; /* sizeof(a_type) */ long lb_a; /* lower bound of structure a */ long ub_a; /* (upper bound of a) - (lb_a + sizeof(z_type)) */ long size_z; /* sizeof(z_type) */ { int subscr; register char *cp; register char *zp = z; register char *limit; subscr = i - lb_a; if (subscr < 0 || subscr > ub_a) { ERROR("i = %D: Bad i to pack(a,i,z)\n", i); return; } cp = &a[subscr * size_a]; limlib/libpc/PAGE.c 644 0 33 660 2552607270 6541 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)PAGE.c 1.2 6/10/81"; #include "h00vars.h" PAGE(curfile) register struct iorec *curfile; { if (curfile->funit & FREAD) { ERROR("%s: Attempt to write, but open for reading\n", curfile->pfname); return; } fputc(' ', curfile->fbuf); if (ferror(curfile->fbuf)) { PERROR("Could not write to ", curfile->pfname); return; } } ,5 /,"lib/libpc/PCEXIT.c 644 0 33 756 2552607270 7027 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)PCEXIT.c 1.1 10/29/80"; #include "h00vars.h" PCEXIT(code) int code; { struct { long usr_time; long sys_time; long child_usr_time; long child_sys_time; } tbuf; double l; PCLOSE(GLVL); PFLUSH(); if (_stcnt > 0) { times(&tbuf); l = tbuf.usr_time; l = l / HZ; fprintf(stderr, "\n%1ld %s %04.2f seconds cpu time.\n", _stcnt, "statements executed in", l); } exit(code); } ,"lib/libpc/PCLOSE.c 644 0 33 1425 2552607271 7033 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)PCLOSE.c 1.4 6/10/81"; #include "h00vars.h" PCLOSE(level) struct iorec *level; { register struct iorec *next; next = _fchain.fchain; while(next != FILNIL && next->flev <= level) { if (next->fbuf != 0) { if ((next->funit & FDEF) == 0) { if (next->fblk > PREDEF) { fflush(next->fbuf); setbuf(next->fbuf, NULL); } fclose(next->fbuf); if (ferror(next->fbuf)) { ERROR("%s: Close failed\n", next->pfname); return; } } if ((next->funit & TEMP) != 0 && unlink(next->pfname)) { PERROR("Could not remove ", next->pfname); return; } } _actfile[next->fblk] = FILNIL; next = next->fchain; } _fchain.fchain = next; } el) { if (next->fbuf != 0) { if ((next->funit & FDEF) == 0) { if (next->fblk > PREDEF) { fflush(next->fbuf); setbuf(next->fbuf, NULL); } fclose(next->fbuf); if (ferror(next->fbuf)) { ERROR("%s: Closelib/libpc/PCSTART.c 644 0 33 3303 2552607271 7163 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)PCSTART.c 1.5 6/10/81"; #include "h00vars.h" /* * program variables */ struct display _disply[MAXLVL]; int _argc; char **_argv; long _stlim = 500000; long _stcnt = 0; long _seed = 1; #ifdef VAX char *_minptr = (char *)0x7fffffff; #else char *_minptr = (char *)0xffff; #endif VAX char *_maxptr = (char *)0; /* * file record variables */ long _filefre = PREDEF; struct iorechd _fchain = { 0, 0, 0, 0, /* only use fchain field */ INPUT /* fchain */ }; struct iorec *_actfile[MAXFILES] = { INPUT, OUTPUT, ERR }; /* * standard files */ char _inwin, _outwin, _errwin; struct iorechd input = { &_inwin, /* fileptr */ 0, /* lcount */ 0x7fffffff, /* llimit */ &_iob[0], /* fbuf */ OUTPUT, /* fchain */ STDLVL, /* flev */ "standard input", /* pfname */ FTEXT | FREAD | SYNC, /* funit */ 0, /* fblk */ 1 /* fsize */ }; struct iorechd output = { &_outwin, /* fileptr */ ((0, /* lcount */ 0x7fffffff, /* llimit */ &_iob[1], /* fbuf */ ERR, /* fchain */ STDLVL, /* flev */ "standard output", /* pfname */ FTEXT | FWRITE | EOFF, /* funit */ 1, /* fblk */ 1 /* fsize */ }; struct iorechd _err = { &_errwin, /* fileptr */ 0, /* lcount */ 0x7fffffff, /* llimit */ &_iob[2], /* fbuf */ FILNIL, /* fchain */ STDLVL, /* flev */ "Message file", /* pfname */ FTEXT | FWRITE | EOFF, /* funit */ 2, /* fblk */ 1 /* fsize */ }; PCSTART() { /* * necessary only on systems which do not initialize * memory to zero */ struct iorec **ip; for (ip = &_actfile[3]; ip < &_actfile[MAXFILES]; *ip++ = FILNIL); } /* fblk */ 1 /* fsize */ }; struct iorechd _err = { &_errwin, /* fileptr */ 0, /* lcount */ 0x7fffffff, /* llimit */ &_iob[2], /* fbuf */ FILNIL, /* fchain */ STDLVL, /* flev */ "Message file", /* pfname */ FTEXT | FWRITE | EOFF, /* funit */ 2, /* fblk */ 1 /* fsize lib/libpc/PERROR.c 644 0 33 770 2552607271 7041 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)PERROR.c 1.1 6/10/81"; #include #include #include "h00vars.h" /* * Routine PERROR is called from the runtime library when a runtime * I/O error occurs. Its arguments are a pointer to an error message and * the name of the offending file. */ long PERROR(msg, fname) char *msg, *fname; { PFLUSH(); fputc('\n',stderr); SETRACE(); fputs(msg, stderr); perror(fname); return 0; } "lib/libpc/PFLUSH.c 644 0 33 611 2552607272 7024 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)PFLUSH.c 1.1 10/29/80"; #include "h00vars.h" /* * insure that a usable image is in the buffer window */ PFLUSH() { register struct iorec *next; next = _fchain.fchain; while(next != FILNIL) { if ((next->funit & (FDEF | FREAD)) == 0) { fflush(next->fbuf); } next = next->fchain; } } *msg, *fname; { PFLUSH();/,5l /,"lib/libpc/PMFLUSH.c 644 0 33 1232 2552607272 7161 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)PMFLUSH.c 1.3 3/7/81"; #include "h00vars.h" PMFLUSH(cntrs, rtns, bufaddr) long cntrs; /* total number of counters (stmt + routine) */ long rtns; /* number of func and proc counters */ long *bufaddr; /* address of count buffers */ { register FILE *filep; bufaddr[0] = 0426; time(&bufaddr[1]); bufaddr[2] = cntrs; bufaddr[3] = rtns; filep = fopen(PXPFILE, "w"); if (filep == NULL) goto ioerr; fwrite(bufaddr, (int)(cntrs + 1), sizeof(long), filep); if (ferror(filep)) goto ioerr; fclose(filep); if (!ferror(filep)) return; ioerr: perror(PXPFILE); } rtns, bufaddr) long cntrs; /* total number of counters (stmt + routine) */ long rtns; /* number of func and proc counters */ long *bufaddr; /* address of count buffers */ { register FILE *filep; bufaddr[0] = 0426; time(&bufaddr[1]); bufaddr[2] = cntrs; bufaddr[3] = rtns; filep = fopen(PXPFILE, "w"); if (filep == NULL) goto ioerr; fwrite(buflib/libpc/PRED.c 644 0 33 635 2552607272 6563 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)PRED.c 1.4 6/10/81"; long PRED(value, lower, upper) long value; long lower; long upper; { if (value == lower) { ERROR("Cannot take pred of first element of a range\n"); return; } value--; if (value < lower || value > upper) { ERROR("Value of %D is out of range\n", value); return; } return value; } rs; bu/,5 /,"lib/libpc/PUT.c 644 0 33 724 2552607272 6500 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)PUT.c 1.3 6/10/81"; #include "h00vars.h" PUT(curfile) register struct iorec *curfile; { if (curfile->funit & FREAD) { ERROR("%s: Attempt to write, but open for reading\n", curfile->pfname); return; } fwrite(curfile->fileptr, (int)curfile->fsize, 1, curfile->fbuf); if (ferror(curfile->fbuf)) { PERROR("Could not write to ", curfile->pfname); return; } } /,"lib/libpc/RAND.s 644 0 33 470 2552607272 6572 # # Copyright (c) 1979 Regents of the University of California # # sccsid[] = "@(#)RAND.s 1.1 1/16/81"; # # calculate (1103515245*seed) mod 2^31-1 # .globl _RAND _RAND: .word 0 emul 4(ap),$1103515245,$0,r0 # a * seed into r1,r0 quadword ediv $0x7fffffff,r0,r1,r0 # get quotient into r1, remainder in r0 ret te(curfile->fileptr, (int)curfile->fsize, 1, curfile->fbuf); if (ferror(curfile->fbuf)) { PERROR("Could n/,5 /,"lib/libpc/RANDOM.c 644 0 33 426 2552607272 7007 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)RANDOM.c 1.3 3/7/81"; #include "h00vars.h" extern long RAND(); double RANDOM() { /* * div by maxint to get 0..1 */ _seed = RAND(_seed); return((double)_seed / 0x7fffffff); } ent into r1, remainder in r0 ret te(curfile->fileptr, (int)curfile->fsize, 1, curfile->fbuf); if (ferror(curfile->fbuf)) { PERROR("Could n/,5 /,"lib/libpc/RANG4.c 644 0 33 466 2552607272 6646 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)RANG4.c 1.3 6/10/81"; long RANG4(value, lower, upper) long value; long lower; long upper; { if (value < lower || value > upper) { ERROR("Value of %D is out of range\n", value); return; } return value; } t te(curfile->fileptr, (int)curfile->fsize, 1, curfile->fbuf); if (ferror(curfile->fbuf)) { PERROR("Could n/,5̉ /,"lib/libpc/READ4.c 644 0 33 1246 2552607272 6647 ((/* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)READ4.c 1.5 6/10/81"; #include "h00vars.h" long READ4(curfile) register struct iorec *curfile; { long data; int retval; if (curfile->funit & FWRITE) { ERROR("%s: Attempt to read, but open for writing\n", curfile->pfname); return; } UNSYNC(curfile); retval = fscanf(curfile->fbuf, "%ld", &data); if (retval == EOF) { ERROR("%s: Tried to read past end of file\n", curfile->pfname); return; } if (retval == 0) { ERROR("%s: Bad data found on integer read\n", curfile->pfname); return; } curfile->funit &= ~EOLN; curfile->funit |= SYNC; return data; } ter struct iorec *curfile; { long data; int retval; if (curfile->funit & FWRITE) { ERROR("%s: Attempt to read, but open for writing\n", curfile->pfname); return; } UNSYNC(curfile); retval = fscanf(curfile->fbuf, "%ld", &data); if (retval == EOF) { ERROR("%s: Tried to read past end of file\n", curfile->pfname); return; } lib/libpc/READ8.c 644 0 33 1247 2552607273 6655 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)READ8.c 1.4 6/10/81"; #include "h00vars.h" double READ8(curfile) register struct iorec *curfile; { double data; int retval; if (curfile->funit & FWRITE) { ERROR("%s: Attempt to read, but open for writing\n", curfile->pfname); return; } UNSYNC(curfile); retval = fscanf(curfile->fbuf, "%lf", &data); if (retval == EOF) { ERROR("%s: Tried to read past end of file\n", curfile->pfname); return; } if (retval == 0) { ERROR("%s: Bad data found on real read\n", curfile->pfname); return; } curfile->funit &= ~EOLN; curfile->funit |= SYNC; return data; } ster struct iorec *curfile; { double data; int retval; if (curfile->funit & FWRITE) { ERROR("%s: Attempt to read, but open for writing\n", curfile->pfname); return; } UNSYNC(curfile); retval = fscanf(curfile->fbuf, "%lf", &data); if (retval == EOF) { ERROR("%s: Tried to read past end of file\n", curfile->pfname); return;lib/libpc/READC.c 644 0 33 1000 2552607273 6653 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)READC.c 1.2 6/10/81"; #include "h00vars.h" char READC(curfile) register struct iorec *curfile; { char data; if (curfile->funit & FWRITE) { ERROR("%s: Attempt to read, but open for writing\n", curfile->pfname); return; } IOSYNC(curfile); if (curfile->funit & EOFF) { ERROR("%s: Tried to read past end of file\n", curfile->pfname); return; } curfile->funit |= SYNC; return *curfile->fileptr; } lib/libpc/READE.c 644 0 33 2307 2552607273 6670 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)READE.c 1.5 6/10/81"; #include "h00vars.h" long READE(curfile, name) register struct iorec *curfile; char *name; { register short *sptr; register int len; register int nextlen; register int cnt; char *cp; char namebuf[NAMSIZ]; int retval; if (curfile->funit & FWRITE) { ERROR("%s: Attempt to read, but open for writing\n", curfile->pfname); return; } UNSYNC(curfile); retval = fscanf(curfile->fbuf, "%*[ \t\n]%74[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]", namebuf); if (retval == EOF) { ERROR("%s: Tried to read past end of file\n", curfile->pfname); return; } if (retval == 0) goto ename; curfile->funit &= ~EOLN; curfile->funit |= SYNC; for (len = 0; len < NAMSIZ && namebuf[len]; len++) /* void */; len++; sptr = (short *)name; cnt = *sptr++; cp = name + sizeof (short) + *sptr; do { nextlen = *sptr++; nextlen = *sptr - nextlen; if (nextlen == len && RELEQ(len, namebuf, cp)) { return *((short *) name) - cnt; } cp += (int)nextlen; } while (--cnt); ename: ERROR("Unknown name \"%s\" found on enumerated type read\n", namebuf); } return; } if (retval == 0) goto ename; curfile->funit &= ~EOLN; curfile->funit |= SYNC; for (len = 0; len < NAMSIZ && namebuf[len]; len++) /* void */; len++; sptr = (short *)name; cnt = *sptr++; cp = name + sizeof (short) + *sptr; do { nextlen = *sptr++; nextlen = *sptr - nextlen; if (nextlelib/libpc/READLN.c 644 0 33 436 2552607273 6776 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)READLN.c 1.4 6/10/81"; #include "h00vars.h" READLN(curfile) register struct iorec *curfile; { do { IOSYNC(curfile); curfile->funit |= SYNC; } while ((curfile->funit & EOLN) == 0); } = SYNC; for (len = 0; len < NAMSIZ && namebuf[len]; len++) /* void */; len++; sptr = (short *)name; cnt = *sptr++; cp = name + /,5 /,"lib/libpc/RELEQ.c 644 0 33 540 2552607273 6675 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)RELEQ.c 1.2 3/7/81"; #include "h00vars.h" bool RELEQ(siz, str1, str2) long siz; register char *str1; register char *str2; { register int size = siz; while (*str1++ == *str2++ && --size) /* void */; if (size == 0) return TRUE; return FALSE; } oid */; len++; sptr = (short *)name; cnt = *sptr++; cp = name + /,5, /,"lib/libpc/RELNE.c 644 0 33 540 2552607273 6672 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)RELNE.c 1.2 3/7/81"; #include "h00vars.h" bool RELNE(siz, str1, str2) long siz; register char *str1; register char *str2; { register int size = siz; while (*str1++ == *str2++ && --size) /* void */; if (size == 0) return FALSE; return TRUE; } oid */; len++; sptr = (short *)name; cnt = *sptr++; cp = name + /,5< /,"lib/libpc/RELSGE.c 644 0 33 574 2552607273 7015 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)RELSGE.c 1.2 3/7/81"; #include "h00vars.h" bool RELSGE(siz, str1, str2) long siz; register char *str1; register char *str2; { register int size = siz; while (*str1++ == *str2++ && --size) /* void */; if ((size == 0) || (*--str1 >= *--str2)) return TRUE; return FALSE; } rt *)name; cnt = *sptr++; cp = name + /,5L /,"lib/libpc/RELSGT.c 644 0 33 574 2552607273 7034 ((/* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)RELSGT.c 1.2 3/7/81"; #include "h00vars.h" bool RELSGT(siz, str1, str2) long siz; register char *str1; register char *str2; { register int size = siz; while (*str1++ == *str2++ && --size) /* void */; if ((size == 0) || (*--str1 <= *--str2)) return FALSE; return TRUE; } rt *)name; cnt = *sptr++; cp = name + /,5\ /,"lib/libpc/RELSLE.c 644 0 33 574 2552607273 7022 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)RELSLE.c 1.2 3/7/81"; #include "h00vars.h" bool RELSLE(siz, str1, str2) long siz; register char *str1; register char *str2; { register int size = siz; while (*str1++ == *str2++ && --size) /* void */; if ((size == 0) || (*--str1 <= *--str2)) return TRUE; return FALSE; } rt *)name; cnt = *sptr++; cp = name + /,5l /,"lib/libpc/RELSLT.c 644 0 33 574 2552607274 7042 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)RELSLT.c 1.2 3/7/81"; #include "h00vars.h" bool RELSLT(siz, str1, str2) long siz; register char *str1; register char *str2; { register int size = siz; while (*str1++ == *str2++ && --size) /* void */; if ((size == 0) || (*--str1 >= *--str2)) return FALSE; return TRUE; } rt *)name; cnt = *sptr++; cp = name + /,5| /,"lib/libpc/RELTGE.c 644 0 33 576 2552607274 7021 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)RELTGE.c 1.2 3/7/81"; #include "h00vars.h" bool RELTGE(bytecnt, left, right) long bytecnt; register long *left; register long *right; { register int longcnt; longcnt = bytecnt >> 2; do { if ((*right++ & ~*left++) != 0) return FALSE; } while (--longcnt); return TRUE; } *)name; cnt = *sptr++; cp = name + /,5 /,"lib/libpc/RELTGT.c 644 0 33 1010 2552607274 7040 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)RELTGT.c 1.2 3/7/81"; #include "h00vars.h" bool RELTGT(bytecnt, left, right) long bytecnt; register long *left; register long *right; { register int longcnt; longcnt = bytecnt >> 2; do { if ((*right & ~*left) != 0) return FALSE; if ((*left++ & ~*right++) != 0) goto geq; } while (--longcnt); return FALSE; geq: while (--longcnt) { if ((*right++ & ~*left++) != 0) return FALSE; } return TRUE; } ight (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)RELTGT.c 1.2 3/7/81"; #include "h00vars.h" bool RELTGT(bytecnt, left, right) long bytecnt; register long *left; register long *right; { register int longcnt; longcnt = bytecnt >> 2; do { if ((*right & ~*left) != 0) return FALSE; if ((*left++ & ~*right++) != 0) goto geq; } while (--longcnt); return FALSE; geq: while (--longcnt) { if ((*right++ & ~*left++) != 0) return FALSE; } return lib/libpc/RELTLE.c 644 0 33 576 2552607274 7026 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)RELTLE.c 1.2 3/7/81"; #include "h00vars.h" bool RELTLE(bytecnt, left, right) long bytecnt; register long *left; register long *right; { register int longcnt; longcnt = bytecnt >> 2; do { if ((*left++ & ~*right++) != 0) return FALSE; } while (--longcnt); return TRUE; } eq; } while (--longcnt); return FALS/,5 /,"lib/libpc/RELTLT.c 644 0 33 1010 2552607275 7046 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)RELTLT.c 1.2 3/7/81"; #include "h00vars.h" bool RELTLT(bytecnt, left, right) long bytecnt; register long *left; register long *right; { register int longcnt; longcnt = bytecnt >> 2; do { if ((*left & ~*right) != 0) return FALSE; if ((*right++ & ~*left++) != 0) goto leq; } while (--longcnt); return FALSE; leq: while (--longcnt) { if ((*left++ & ~*right++) != 0) return FALSE; } return TRUE; } ight (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)RELTLT.c 1.2 3/7/81"; #include "h00vars.h" bool RELTLT(bytecnt, left, right) long bytecnt; register long *left; register long *right; { register int longcnt; longcnt = bytecnt >> 2; do { if ((*left & ~*right) != 0) return FALSE; if ((*right++ & ~*left++) != 0) goto leq; } while (--longcnt); return FALSE; leq: while (--longcnt) { if ((*left++ & ~*right++) != 0) return FALSE; } return lib/libpc/REMOVE.c 644 0 33 1463 2552607275 7051 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)REMOVE.c 1.3 6/10/81"; #include "h00vars.h" REMOVE(name, namlim) char *name; long namlim; { register int cnt; register int maxnamlen = namlim; char namebuf[NAMSIZ]; /* * trim trailing blanks, and insure that the name * will fit into the file structure */ for (cnt = 0; cnt < maxnamlen; ) if (name[cnt] == '\0' || name[cnt++] == ' ') break; if (cnt >= NAMSIZ) { ERROR("%s: File name too long\n", name); return; } maxnamlen = cnt; /* * put the name into the buffer with null termination */ for (cnt = 0; cnt < maxnamlen; cnt++) namebuf[cnt] = name[cnt]; namebuf[cnt] = '\0'; /* * unlink the file */ if (unlink(namebuf)) { PERROR("Could not remove ", namebuf); return; } } insure that the name * will fit into the file structure */ for (cnt = 0; cnt < maxnamlen; ) if (name[cnt] == '\0' || name[cnt++] == ' ') break; if (cnt >= NAMSIZ) { ERROR("%s: File name too llib/libpc/RESET.c 644 0 33 1551 2552607275 6734 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)RESET.c 1.4 6/10/81"; #include "h00vars.h" RESET(filep, name, maxnamlen, datasize) register struct iorec *filep; char *name; long maxnamlen; long datasize; { if (name == NULL && filep == INPUT && filep->fname[0] == '\0') { if (fseek(filep->fbuf, (long)0, 0)) { PERROR("Could not reset ", filep->pfname); return; } filep->funit &= ~(EOFF | EOLN); filep->funit |= SYNC; return; } filep = ((GETNAME(filep, name, maxnamlen, datasize); filep->fbuf = fopen(filep->fname, "r"); if (filep->fbuf == NULL) { if (filep->funit & TEMP) { filep->funit |= (EOFF | SYNC | FREAD); return; } PERROR("Could not open ", filep->pfname); return; } filep->funit |= (SYNC | FREAD); if (filep->fblk > PREDEF) { setbuf(filep->fbuf, &filep->buf[0]); } } )0, 0)) { PERROR("Could not reset ", filep->pfname); return; } filep->funit &= ~(EOFF | EOLN); filep->funit |= SYNC; return; } filep = lib/libpc/REWRITE.c 644 0 33 1054 2552607275 7171 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)REWRITE.c 1.3 6/10/81"; #include "h00vars.h" REWRITE(filep, name, maxnamlen, datasize) register struct iorec *filep; char *name; long maxnamlen; long datasize; { filep = GETNAME (filep, name, maxnamlen, datasize); filep->fbuf = fopen(filep->fname, "w"); if (filep->fbuf == NULL) { PERROR("Could not create ",filep->pfname); return; } filep->funit |= (EOFF | FWRITE); if (filep->fblk > PREDEF) { setbuf(filep->fbuf, &filep->buf[0]); } } ity of California */ static char sccsid[] = "@(#)REWRITE.c 1.3 6/10/81"; #include "h00vars.h" REWRITE(filep, name, maxnamlen, datasize) register struct iorec *filep; char *name; long maxnamlen; long datasize; { filep = GETNAME (filep, name, maxnamlen, datasize); filep->fbuf = fopen(filep->fname, "w"); if (filep->fbuf == NULL) { PERROR("Could not create ",filep->pfname); return; } filep->funit |= (EOFF | FWRITE); if (filep->fblk > PREDEF) { lib/libpc/ROUND.c 644 0 33 350 2552607275 6715 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)ROUND.c 1.3 3/7/81"; long ROUND(value) double value; { if (value >= 0.0) return (long)(value + 0.5); return (long)(value - 0.5); } ong maxnamlen; long datasize; { filep = GETNAME (filep, name, maxnamlen, datasize); filep->fbuf = fopen(filep->fname, "w"); if (filep->fbuf == NULL) { PERROR("Could not create ",/,5 /,"lib/libpc/RSNG4.c 644 0 33 436 2552607275 6670 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)RSNG4.c 1.3 6/10/81"; long RSNG4(value, upper) long value; long upper; { if (value < 0 || value > upper) { ERROR("Value of %D is out of range\n", value); return; } return value; } (filep, name, maxnamlen, datasize); filep->fbuf = fopen(filep->fname, "w"); if (filep->fbuf == NULL) { PERROR("Could not create ",/,5  /,"lib/libpc/SCCS 644 0 33 5320 2552607275 6362 N#._..,s.ROUND.c+s.ACTFILE.cAs.ADDT.c.s.ARGV.c)3s.ASRT.cBs.BUFF.czAs.CARD.c:s.CHR.c+s.CLCK.c:s.CTTOT.c+s.DATE.c3,s.DEFNAME.cBs.DISPOSE.cs.ERROR.c2s.EXPO.c*Ls.FCALL.cCs.FLUSH.c)(s.FNIL.cs.FRTN.c1s.FSAV.cs.GET.c$s.GETNAME.cs.GOTO.s\1s.HALT.cYBs.IN.c9s.INCT.cTs.IOSYNC.c)s.LINO.c82s.LLIMIT.c s.LN.c!Es.MAX.c,s.MULT.c2s.NAM.cz.unixio.iK*s.NEW.c,s.NEWZ.c s.NIL.c,s.PACK.cs.PAGE.c,s.PCEXIT.c,s.PCLOSE.cs.PCSTART.c,s.PFLUSH.cF@s.PMFLUSH.c7s.PRED.c?s.PUT.c>s.RANDOM.cHs.RANG4.c:s.READ4.cAs.READ8.cs.APPEND.cJDs.unixio.hEs.libpc.h8s.CATCHERR.c,s.unixio.ix.unixio.ix.SEEK.cx.TELL.cx.libpc.hp.UNSYNC.cp.READ4.cp.READ8.cp.READC.cp.READE.cx.HALT.cp.PAGE.cp.PUT.cp.WRITEC.cp.WRITEF.cp.WRITES.cp.GETNAME.cp.PCLOSE.cp.LLIMIT.cp.SQRT.cx.GET.cp.UNIT.cx.FNIL.cp.TEOF.cp.TEOLN.cp.WRITLN.cp.APPEND.cp.RESET.cp.REWRITE.cp.REMOVE.cp.SEEK.cp.LN.cp.NAM.cp.MAX.cp.GOTO.sp.NEW.cp.NEWZ.cx.FLUSH.cp.PACK.cp.UNPACK.cp.RANG4.cp.RSNG4.cp.SUBSC.cp.SUBSCZ.cx.ERROR.cp.STLIM.cp.LINO.cp.DISPOSE.cp.PRED.cp.SUCC.cp.CTTOT.cp.READLN.cp.PCSTART.cx.CHR.cx.ASRT.cx.ARGV.cp.TEOLN.cp.TRUNC.cp.UNPACK.cp.UNWIND.cp.WRITEC.cp.WRITEF.cp.WRITES.cp.h00vars.hp.makefilem-s.blkcpy.cWCs.blkclr.cx.BUFF.cx.ARGV.cx.ADDT.cp.PACK.cp.UNPACK.cp.RANG4.cp.RSNG4.cp.SUBSC.cp.SUBSCZ.cx.ERROR.cp.STLIM.cp.LINO.cp.DISPOSE.cp.PRED.cp.SUCC.cp.CTTOT.cp.READLN.cp.PCSTART.cx.CHR.cx.ASRT.cx.ARGV.cp.TEOLN.clib/libpc/SCLCK.c 644 0 33 274 2552607275 6672 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)SCLCK.c 1.2 3/7/81"; long SCLCK() { long tim[4]; times(tim); return (tim[1] * 50) / 3; } x.ADDT.cp.PACK.cp.UNPACK.cp.RANG4.cp.RSNG4.cp.SUBSC.cp.SUBSCZ.cx.ERROR.cp.STLIM.cp.LINO.cp.DISPOSE.cp.PRED.cp.SUCC.cp.CTTOT.cp./,5, /,"lib/libpc/SEED.c 644 0 33 342 2552607275 6547 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)SEED.c 1.5 3/7/81"; #include "h00vars.h" long SEED(value) long value; { long tmp; tmp = _seed; _seed = value; return tmp; } p.UNPACK.cp.RANG4.cp.RSNG4.cp.SUBSC.cp.SUBSCZ.cx.ERROR.cp.STLIM.cp.LINO.cp.DISPOSE.cp.PRED.cp.SUCC.cp.CTTOT.cp./,5< /,"lib/libpc/SEEK.c 644 0 33 576 2552607276 6570 ((/* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)SEEK.c 1.3 6/17/81"; #include "h00vars.h" /* * Random access routine */ SEEK(curfile, loc) register struct iorec *curfile; struct seekptr *loc; { curfile->funit |= SYNC; if (fseek(curfile->fbuf, loc->cnt, 0) == -1) { PERROR("Could not seek ", curfile->pfname); return; } } p.SUCC.cp.CTTOT.cp./,5L /,"lib/libpc/SETRACE.s 644 0 33 672 2552607276 7144 # Copyright (c) 1979 Regents of the University of California # # sccsid[] = "@(#)SETRACE.s 1.2 3/18/81"; # # set trace bit in return frame of calling routine # this will cause core dump at point of return # unless running a debugger, in which case a breakpoint # will occur at the error point # .set PSW,4 .set FP,12 .globl _SETRACE _SETRACE: .word 0 movl FP(fp),r0 #r0 has ptr to callers frame bisl2 $0x10,PSW(r0) #set trace bit ret ,5\ /,"lib/libpc/SQRT.c 644 0 33 427 2552607276 6625 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)SQRT.c 1.3 6/10/81"; #include double SQRT(value) double value; { if (value < 0) { ERROR("Negative argument of %e to sqrt\n", value); return; } return sqrt(value); } e error point # .set PSW,4 .set FP,12 .globl _SETRACE _SETRACE: .word 0 movl FP(fp),r0 #r0 has ptr to callers frame bisl2 $0x10,PSW(r0/,5l /,"lib/libpc/STLIM.c 644 0 33 433 2552607276 6721 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)STLIM.c 1.2 6/10/81"; #include "h00vars.h" STLIM(limit) long limit; { if (_stcnt >= limit) { ERROR("Statement count limit of %D exceeded\n", _stcnt); return; } _stlim = limit; } ror point # .set PSW,4 .set FP,12 .globl _SETRACE _SETRACE: .word 0 movl FP(fp),r0 #r0 has ptr to callers frame bisl2 $0x10,PSW(r0/,5| /,"lib/libpc/SUBSC.c 644 0 33 434 2552607276 6711 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)SUBSC.c 1.3 6/10/81"; long SUBSC(i, lower, upper) long i, lower, upper; { if (i < lower || i > upper) { ERROR("Subscript value of %D is out of range\n", i); return; } return i; } or point # .set PSW,4 .set FP,12 .globl _SETRACE _SETRACE: .word 0 movl FP(fp),r0 #r0 has ptr to callers frame bisl2 $0x10,PSW(r0/,5 /,"lib/libpc/SUBSCZ.c 644 0 33 414 2552607276 7041 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)SUBSCZ.c 1.3 6/10/81"; long SUBSCZ(i, upper) long i, upper; { if (i < 0 || i > upper) { ERROR("Subscript value of %D is out of range\n", i); return; } return i; } } return i; } or point # .set PSW,4 .set FP,12 .globl _SETRACE _SETRACE: .word 0 movl FP(fp),r0 #r0 has ptr to callers frame bisl2 $0x10,PSW(r0/,5 /,"lib/libpc/SUBT.c 644 0 33 563 2552607276 6612 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)SUBT.c 1.2 3/7/81"; long * SUBT(result0, left, right, siz) long *result0; register long *left; register long *right; long siz; { register long *result = result0; register int size = siz; do { *result++ = *left++ & ~*right++; } while (--size); return result0; } #r0 has ptr to callers frame bisl2 $0x10,PSW(r0/,5 /,"lib/libpc/SUCC.c 644 0 33 634 2552607276 6571 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)SUCC.c 1.4 6/10/81"; long SUCC(value, lower, upper) long value; long lower; long upper; { if (value == upper) { ERROR("Cannot take succ of last element of a range\n"); return; } value++; if (value < lower || value > upper) { ERROR("Value of %D is out of range\n", value); return; } return value; } 0,PSW(r0/,5 /,"lib/libpc/TELL.c 644 0 33 673 2552607276 6577 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)TELL.c 1.3 6/17/81"; #include "h00vars.h" /* * Find current location */ struct seekptr TELL(curfile) register struct iorec *curfile; { struct seekptr loc; if ((curfile->funit & FREAD) && (curfile->funit & SYNC) == 0) { fseek(curfile->fbuf, -curfile->fsize, 1); curfile->funit |= SYNC; } loc.cnt = ftell(curfile->fbuf); return loc; } ,5̋ /,"lib/libpc/TEOF.c 644 0 33 656 2552607277 6576 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)TEOF.c 1.3 6/10/81"; #include "h00vars.h" bool TEOF(filep) register struct iorec *filep; { if (filep->fblk >= MAXFILES || _actfile[filep->fblk] != filep) { ERROR("Reference to an inactive file\n", 0); return; } if (filep->funit & EOFF) return TRUE; IOSYNC(filep); if (filep->funit & EOFF) return TRUE; return FALSE; } ,5܋ /,"lib/libpc/TEOLN.c 644 0 33 607 2552607277 6716 ((/* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)TEOLN.c 1.3 6/10/81"; #include "h00vars.h" bool TEOLN(filep) register struct iorec *filep; { if (filep->fblk >= MAXFILES || _actfile[filep->fblk] != filep) { ERROR("Reference to an inactive file\n", 0); return; } IOSYNC(filep); if (filep->funit & EOLN) return TRUE; return FALSE; } EOFF) return TRUE; return/,5 /,"lib/libpc/TIME.c 644 0 33 505 2552607277 6570 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)TIME.c 1.1 10/29/80"; extern char *ctime(); TIME(alfap) register char *alfap; { register char *ap, *cp; register int i; long a; time(&a); cp = ctime(&a); ap = alfap; for (cp = cp + 10, i = 10; i; *ap++ = *cp++, i--); } filep); if (filep->funit & EOLN) return TRUE; return FALSE; } EOFF) return TRUE; return/,5 /,"lib/libpc/TRUNC.c 644 0 33 261 2552607277 6724 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)TRUNC.c 1.2 3/7/81"; long TRUNC(value) double value; { return (long)(value); } register char *ap, *cp; register int i; long a; time(&a); cp = ctime(&a); ap = alfap; for (cp = cp + 10, i = 10; i; *ap++ = *cp++, i--); } filep); if (filep->funit & EOLN) return TRUE; return FALSE; } EOFF) return TRUE; return/,5  /,"lib/libpc/UNIT.c 644 0 33 716 2552607277 6615 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)UNIT.c 1.2 6/10/81"; #include "h00vars.h" struct iorec * UNIT(curfile) register struct iorec *curfile; { if (curfile->fblk >= MAXFILES || _actfile[curfile->fblk] != curfile) { ERROR("Reference to an inactive file\n", 0); return; } if (curfile->funit & FDEF) { ERROR("%s: Reference to an inactive file\n", curfile->pfname); return; } return curfile; }  /,"lib/libpc/UNPACK.c 644 0 33 1561 2552607277 7036 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)UNPACK.c 1.3 6/10/81"; /* * unpack(z,a,i) * * with: z and a as in pack * * semantics: for j := u to v do * a[j-u+i] := z[j] */ UNPACK(i, a, z, size_a, lb_a, ub_a, size_z) long i; /* subscript into a to begin packing */ char *a; /* pointer to structure a */ char *z; /* pointer to structure z */ long size_a; /* sizeof(a_type) */ long lb_a; /* lower bound of structure a */ long ub_a; /* (upper bound of a) - (lb_a + sizeof(z_type)) */ long size_z; /* sizeof(z_type) */ { int subscr; register char *cp; register char *zp = z; register char *limit; subscr = i - lb_a; if (subscr < 0 || subscr > ub_a) { ERROR("i = %D: Bad i to unpack(z,a,i)\n", i); return; } cp = &a[subscr * size_a]; limit = cp + size_z; do { *cp++ = *zp++; } while (cp < limit); } ar *z; /* pointer to structure z */ long size_a; /* sizeof(a_type) */ long lb_a; /* lower bound of structure a */ long ub_a; /* (upper boundlib/libpc/UNSYNC.c 644 0 33 1075 2552607277 7074 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)UNSYNC.c 1.3 6/10/81"; #include "h00vars.h" /* * push back last char read to prepare for formatted read */ UNSYNC(curfile) register struct iorec *curfile; { if (curfile->funit & FWRITE) { ERROR("%s: Attempt to read, but open for writing\n", curfile->pfname); return; } if (curfile->funit & EOFF) { ERROR("%s: Tried to read past end of file\n", curfile->pfname); return; } if ((curfile->funit & SYNC) == 0) { ungetc(*curfile->fileptr, curfile->fbuf); } } */ static char sccsid[] = "@(#)UNSYNC.c 1.3 6/10/81"; #include "h00vars.h" /* * push back last char read to prepare for formatted read */ UNSYNC(curfile) register struct iorec *curfile; { if (curfile->funit & FWRITE) { ERROR("%s: Attempt to read, but open for writing\n", curfile->pfname); return; } if (curfile->funit & EOFF) { ERROR("%s: Tried to read past end of file\n", curfile->pfname); return; } if ((curfile->funit & SYlib/libpc/UNWIND.c 644 0 33 247 2552607300 7024 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)UNWIND.c 1.2 3/7/81"; UNWIND(frame) long *frame; { PCLOSE(*frame); } ead to prepare for formatted read */ UNSYNC(curfile) register struct iorec *curfile; { if (curfile->funit & FWRITE) { ERROR("%s: Attempt to read, but open for writing\n", curfile->pfname); return; } if (curfile->funit & EOFF) { ERROR("%s:/,5L /,"lib/libpc/WRITEC.c 644 0 33 711 2552607300 7011 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)WRITEC.c 1.4 6/10/81"; #include "h00vars.h" WRITEC(curfile, d1, d2) register struct iorec *curfile; char d1; FILE *d2; { if (curfile->funit & FREAD) { ERROR("%s: Attempt to write, but open for reading\n", curfile->pfname); return; } fputc(d1, d2); if (ferror(curfile->fbuf)) { PERROR("Could not write to ", curfile->pfname); return; } }  /,"lib/libpc/WRITEF.c 644 0 33 1033 2552607300 7032 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)WRITEF.c 1.4 6/10/81"; #include "h00vars.h" WRITEF(curfile, d1, d2, d3, d4, d5, d6, d7, d8) register struct iorec *curfile; FILE *d1; char *d2; int d3, d4, d5, d6, d7, d8; { if (curfile->funit & FREAD) { ERROR("%s: Attempt to write, but open for reading\n", curfile->pfname); return; } fprintf(d1, d2, d3, d4, d5, d6, d7, d8); if (ferror(curfile->fbuf)) { PERROR("Could not write to ", curfile->pfname); return; } } ts of the University of California */ static char sccsid[] = "@(#)WRITEF.c 1.4 6/10/81"; #include "h00vars.h" WRITEF(curfile, d1, d2, d3, d4, d5, d6, d7, d8) register struct iorec *curfile; FILE *d1; char *d2; int d3, d4, d5, d6, d7, d8; { if (curfile->funit & FREAD) { ERROR("%s: Attempt to write, but open for reading\n", curfile->pfname); return; } fprintf(d1, d2, d3, d4, d5, d6, d7, d8); if (ferror(curfile->fbuf)) { PERROR("Could not write to ", curfil((lib/libpc/WRITES.c 644 0 33 752 2552607300 7036 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)WRITES.c 1.4 6/10/81"; #include "h00vars.h" WRITES(curfile, d1, d2, d3, d4) register struct iorec *curfile; FILE *d1; int d2, d3; char *d4; { if (curfile->funit & FREAD) { ERROR("%s: Attempt to write, but open for reading\n", curfile->pfname); return; } fwrite(d1, d2, d3, d4); if (ferror(curfile->fbuf)) { PERROR("Could not write to ", curfile->pfname); return; } } ,"lib/libpc/WRITLN.c 644 0 33 1046 2552607300 7055 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)WRITLN.c 1.2 6/10/81"; #include "h00vars.h" WRITLN(curfile) register struct iorec *curfile; { if (curfile->funit & FREAD) { ERROR("%s: Attempt to write, but open for reading\n", curfile->pfname); return; } if (++curfile->lcount >= curfile->llimit) { ERROR("%s: Line limit exceeded\n", curfile->pfname); return; } fputc('\n', curfile->fbuf); if (ferror(curfile->fbuf)) { PERROR("Could not write to ", curfile->pfname); return; } } niversity of California */ static char sccsid[] = "@(#)WRITLN.c 1.2 6/10/81"; #include "h00vars.h" WRITLN(curfile) register struct iorec *curfile; { if (curfile->funit & FREAD) { ERROR("%s: Attempt to write, but open for reading\n", curfile->pfname); return; } if (++curfile->lcount >= curfile->llimit) { ERROR("%s: Line limit exceeded\n", curfile->pfname); return; } fputc('\n', curfile->fbuf); if (ferror(curfile->fbuf)) { PERROR("Could not write tlib/libpc/blkclr.c 644 0 33 344 2552607301 7270 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)blkclr.c 1.1 3/7/81"; blkclr(siz, at) long siz; register char *at; { register int size = siz; while(size-- > 0) *at++ = 0; } OR("%s: Attempt to write, but open for reading\n", curfile->pfname); return; } if (++curfile->lcount >= curfile->llimit) { ERROR("%s: Line limit exceeded\n", curfile->pfname); retur/,5 /,"lib/libpc/blkcpy.c 644 0 33 560 2552607301 7303 /* Copyright (c) 1979 Regents of the University of California */ static char sccsid[] = "@(#)blkcpy.c 1.1 3/7/81"; blkcpy(siz, from, to) long siz; register char *from; register char *to; { register int size = siz; if (from + size < to) while(size-- > 0) *to++ = *from++; else { to += size; from += size; while(size-- > 0) *--to = *--from; } } s: Line limit exceeded\n", curfile->pfname); retur/,5 /,"lib/libpc/h00vars.h 644 0 33 7331 2552607301 7332 /* Copyright (c) 1979 Regents of the University of California */ /* sccsid[] = "@(#)h00vars.h 1.9 6/17/81"; */ #include #include "whoami.h" #define PXPFILE "pmon.out" #define BITSPERBYTE 8 #define BITSPERLONG (BITSPERBYTE * sizeof(long)) #define LG2BITSBYTE 03 #define MSKBITSBYTE 07 #define LG2BITSLONG 05 #define MSKBITSLONG 037 #define HZ 60 #define MAXLVL 20 #define MAXERRS 75 #define NAMSIZ 76 #define MAXFILES 32 #define PREDEF 2 #ifdef VAX #define STDLVL ((struct iorec *)(0x7ffffff1)) #define GLVL ((struct iorec *)(0x7ffffff0)) #else #define STDLVL ((struct iorec *)(0xfff1)) #define GLVL ((struct iorec *)(0xfff0)) #endif VAX #define FILNIL ((struct iorec *)(0)) #define INPUT ((struct iorec *)(&input)) #define OUTPUT ((struct iorec *)(&output)) #define ERR ((struct iorec *)(&_err)) typedef enum {FALSE, TRUE} bool; /* * runtime display structure */ struct display { char *ap; char *fp; }; /* * formal routine structure */ struct formalrtn { long (*fentryaddr)(); /* formal entry point */ long fbn; /* block number of function */ struct display fdisp[ MAXLVL ]; /* saved at first passing */ }; /* * program variables */ extern struct display _disply[MAXLVL];/* runtime display */ extern int _argc; /* number of passed args */ extern char **_argv; /* values of passed args */ extern long _stlim; /* statement limit */ extern long _stcnt; /* statement count */ extern long _seed; /* random number seed */ extern char *_maxptr; /* maximum valid pointer */ extern char *_minptr; /* minimum valid pointer */ extern long _pcpcount[]; /* pxp buffer */ /* * file structures */ struct iorechd { char *fileptr; /* ptr to file window */ long lcount; /* number of lines printed */ long llimit; /* maximum number of text lines */ FILE *fbuf; /* FILE ptr */ struct iorec *fchain; /* chain to next file */ struct iorec *flev; /* ptr to associated file variable */ char *pfname; /* ptr to name of file */ short funit; /* file status flags */ unsigned short fblk; /* index into active file table */ long fsize; /* size of elements in the file */ char fname[NAMSIZ]; /* name of associated UNIX file */ }; struct iorec { char *fileptr; /* ptr to file window */ long lcount; /* number of lines printed */ long llimit; /* maximum number of text lines */ FILE *fbuf; /* FILE ptr */ struct iorec *fchain; /* chain to next file */ struct iorec *flev; /* ptr to associated file variable */ char *pfname; /* ptr to name of file */ short funit; /* file status flags */ unsigned short fblk; /* index into active file table */ long fsize; /* size of elements in the file */ char fname[NAMSIZ]; /* name of associated UNIX file */ char buf[BUFSIZ]; /* I/O buffer */ char window[1]; /* file window element */ }; /* * unit flags */ #define SPEOLN 0x100 /* 1 => pseudo EOLN char read at EOF */ #define FDEF 0x080 /* 1 => reserved file name */ #define FTEXT 0x040 /* 1 => text file, process EOLN */ #define FWRITE 0x020 /* 1 => open for writing */ #define FREAD 0x010 /* 1 => open for reading */ #define TEMP 0x008 /* 1 => temporary file */ #define SYNC 0x004 /* 1 => window is out of sync */ #define EOLN 0x002 /* 1 => at end of line */ #define EOFF 0x001 /* 1 => at end of file */ /* * file routines */ extern struct iorec *GETNAME(); extern char *MKTEMP(); extern char *PALLOC(); /* * file record variables */ extern struct iorechd _fchain; /* head of active file chain */ extern struct iorec *_actfile[]; /* table of active files */ extern long _filefre; /* last used entry in _actfile */ /* * standard files */ extern struct iorechd input; extern struct iorechd output; extern struct iorechd _err; /* * seek pointer struct for TELL, SEEK extensions */ struct seekptr { long cnt; }; ile routines */ extern struct iorec *GETNAME(); extern char *MKTEMP(); extern char *PALLOC(); /* * file record variables */ extern struct iorechd _fchain; /* head of active file chain */ extern struct iorec *_actfile[]; /* table of active files */ extern long _filefre; /* last used entrylib/libpc/libpc.h 644 0 33 2251 2552607301 7134 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)libpc.h 1.5 6/17/81"; */ extern FILE *ACTFILE(); extern long *ADDT(); extern long CARD(); extern char CHR(); extern long CLCK(); extern long *CTTOT(); extern long ERROR(); extern long EXPO(); extern char *FNIL(); extern struct formalrtn *FSAV(); extern struct iorec *GETNAME(); extern bool IN(); extern bool INCT(); extern double LN(); extern long MAX(); extern long *MULT(); extern char *NAM(); extern char *NIL()((; extern long PRED(); extern double RANDOM(); extern char READC(); extern long READ4(); extern long READE(); extern double READ8(); extern bool RELNE(); extern bool RELEQ(); extern bool RELSLT(); extern bool RELSLE(); extern bool RELSGT(); extern bool RELSGE(); extern bool RELTLT(); extern bool RELTLE(); extern bool RELTGT(); extern bool RELTGE(); extern long ROUND(); extern long RANG4(); extern long RSNG4(); extern long SCLCK(); extern long SEED(); extern double SQRT(); extern long SUBSC(); extern long SUBSCZ(); extern long *SUBT(); extern long SUCC(); extern struct seekptr TELL(); extern bool TEOF(); extern bool TEOLN(); extern long TRUNC(); extern struct iorec *UNIT(); Q(); extern bool RELSLT(); extern bool RELSLE(); extern bool RELSGT(); extern bool RELSGE(); extern bool RELTLT(); extern bool RELTLE(); extern bool RELTGT(); extern bool RELTGE(); extern long ROUND(); extern long RANG4(); extern long RSNG4(); extern long SCLCK(); extern long SEED(); extern double SQRT(); extern long SUBSC(); extern long SUBlib/libpc/makefile 644 0 33 10614 2552607302 7415 SCCSID = "@(#)makefile 1.8 6/10/81" CFLAGS = -O LIB = ${DESTDIR}/usr/lib SRCDIR = ${DESTDIR}/usr/ucb PASDIR = ${DESTDIR}/usr/src/cmd/pascal LD= ld RM = /bin/rm -f RANLIB= ranlib AR= ar CMDS = ACTFILE.c ADDT.c ARGV.c ASRT.c BUFF.c CARD.c CHR.c CLCK.c \ CTTOT.c DATE.c DEFNAME.c DISPOSE.c EXPO.c FCALL.c FLUSH.c \ FNIL.c FRTN.c FSAV.c GET.c GOTO.s HALT.c IN.c INCT.c LINO.c \ LLIMIT.c LN.c MAX.c MULT.c NAM.c NEW.c NEWZ.c NIL.c PACK.c \ PAGE.c PRED.c PUT.c RANDOM.c RANG4.c READ4.c READ8.c READC.c \ READE.c READLN.c RELEQ.c RELNE.c RELSGE.c RELSGT.c RELSLE.c \ RELSLT.c RELTGE.c RELTGT.c RELTLE.c RELTLT.c REMOVE.c RESET.c \ REWRITE.c ROUND.c RSNG4.c SCLCK.c SEED.c SQRT.c STLIM.c \ SUBSC.c SUBSCZ.c SUBT.c SUCC.c TEOF.c TEOLN.c TIME.c TRUNC.c \ UNIT.c UNPACK.c WRITEC.c WRITEF.c WRITES.c WRITLN.c SYS = ERROR.c GETNAME.c IOSYNC.c PCEXIT.c PCLOSE.c PCSTART.c PERROR.c \ PFLUSH.c PMFLUSH.c RAND.s SETRACE.s UNSYNC.c UNWIND.c blkclr.c blkcpy.c EXTN = APPEND.c SEEK.c TELL.c HDRS = whoami.h h00vars.h OBJS = ACTFILE.o ADDT.o ARGV.o ASRT.o BUFF.o CARD.o CHR.o CLCK.o\ CTTOT.o DATE.o DEFNAME.o DISPOSE.o EXPO.o FCALL.o FLUSH.o\ FNIL.o FRTN.o FSAV.o GET.o GOTO.o HALT.o IN.o INCT.o LINO.o \ LLIMIT.o LN.o MAX.o MULT.o NAM.o NEW.o NEWZ.o NIL.o PACK.o\ PAGE.o PRED.o PUT.o RANDOM.o RANG4.o READ4.o READ8.o READC.o\ READE.o READLN.o RELEQ.o RELNE.o RELSGE.o RELSGT.o RELSLE.o\ RELSLT.o RELTGE.o RELTGT.o RELTLE.o RELTLT.o REMOVE.o RESET.o\ REWRITE.o ROUND.o RSNG4.o SCLCK.o SEED.o SQRT.o STLIM.o\ SUBSC.o SUBSCZ.o SUBT.o SUCC.o TEOF.o TEOLN.o TIME.o TRUNC.o\ UNIT.o UNPACK.o WRITEC.o WRITEF.o WRITES.o WRITLN.o SYOBJ = ERROR.o GETNAME.o IOSYNC.o PCEXIT.o PCLOSE.o PCSTART.o PERROR.o\ PFLUSH.o PMFLUSH.o RAND.o SETRACE.o UNSYNC.o UNWIND.o blkclr.o blkcpy.o EXOBJ = APPEND.o SEEK.o TELL.o sources: ${CMDS} ${SYS} ${EXTN} ${HDRS} .s.o: ${AS} -o tmp $*.s -${LD} -x -r -o $@ tmp .c.o: ${CC} ${CFLAGS} -c $*.c mv $@ tmp -${LD} -x -r -o $@ tmp install: libpc cp libpc ${LIB}/libpc.a ${RANLIB} ${LIB}/libpc.a libpc: ${OBJS} ${SYOBJ} ${EXOBJ} ${RM} libpc ${AR} cr libpc ${OBJS} ${SYOBJ} ${EXOBJ} ${RANLIB} libpc whoami.h: cp ${PASDIR}/whoami.h whoami.h clean: ${RM} libpc *.o a.out lpr tmp core errs print: ls -l >lst ${SRCDIR}/vprint lst makefile *.h [A-Z][A-Z]*.[cs] [a-z][a-z]*.[cs] ${RM} lst grind: sources ${SRCDIR}/ctags -v *.h *.c *.s | sort -f >index ${SRCDIR}/vgrind -t -x index >lpr ${SRCDIR}/vgrind -t -n makefile >>lpr ${RM} index ${SRCDIR}/vgrind -t *.h *.c >>lpr ${SRCDIR}/vgrind -t -n GOTO.s RAND.s SETRACE.s >>lpr ${SRCDIR}/vpr -t lpr depend: sources /bin/grep '^#[ ]*include' *.c \ | sed '/<.*>/d' \ | sed 's/:[^"]*"\([^"]*\)".*/: \1/' \ | sed 's/\.c/.o/' >makedep 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 # DO NOT DELETE THIS LINE -- make depend uses it # DEPENDENCIES MUST END AT END OF FILE ACTFILE.o: h00vars.h APPEND.o: h00vars.h ARGV.o: h00vars.h BUFF.o: h00vars.h CATCHERR.o: h00vars.h CTTOT.o: whoami.h CTTOT.o: h00vars.h DEFNAME.o: h00vars.h DISPOSE.o: h00vars.h ERROR.o: h00vars.h FCALL.o: h00vars.h FLUSH.o: h00vars.h FNIL.o: h00vars.h FRTN.o: h00vars.h FSAV.o: h00vars.h GET.o: h00vars.h GETNAME.o: h00vars.h IN.o: h00vars.h INCT.o: h00vars.h IOSYNC.o: h00vars.h LINO.o: h00vars.h LLIMIT.o: h00vars.h MAX.o: h00vars.h NAM.o: h00vars.h NEW.o: h00vars.h NEWZ.o: h00vars.h NIL.o: h00vars.h PAGE.o: h00vars.h PCEXIT.o: h00vars.h PCLOSE.o: h00vars.h PCSTART.o: h00vars.h PERROR.o: h00vars.h PFLUSH.o: h00vars.h PMFLUSH.o: h00vars.h PUT.o: h00vars.h RANDOM.o: h00vars.h READ4.o: h00vars.h READ8.o: h00vars.h READC.o: h00vars.h READE.o: h00vars.h READLN.o: h00vars.h RELEQ.o: h00vars.h RELNE.o: h00vars.h RELSGE.o: h00vars.h RELSGT.o: h00vars.h RELSLE.o: h00vars.h RELTGE.o: h00vars.h RELTGT.o: h00vars.h RELTLE.o: h00vars.h RELTLT.o: h00vars.h REMOVE.o: h00vars.h RESET.o: h00vars.h REWRITE.o: h00vars.h SEED.o: h00vars.h SEEK.o: h00vars.h STLIM.o: h00vars.h TELL.o: h00vars.h TEOF.o: h00vars.h TEOLN.o: h00vars.h UNIT.o: h00vars.h UNSYNC.o: h00vars.h WRITEC.o: h00vars.h WRITEF.o: h00vars.h WRITES.o: h00vars.h WRITLN.o: h00vars.h # DEPENDENCIES MUST END AT END OF FILE # IF YOU PUT STUFF HERE IT WILL GO AWAY # see make depend above RELSGT.o: h00vars.h RELSLE.o: h00vars.h RELTGE.o: h00vars.h RELTGT.o: h00vars.h RELTLE.o: h00vars.h RELTLT.o: h00valib/libpc/unixio.h 644 0 33 517 2552607302 7342 (* Copyright (c) 1979 Regents of the University of California *) const sccsid = '@(#)unixio.h 1.1 6/17/81'; type fileptr = record cnt :integer end; function TELL( var fptr :text) {returns} :fileptr; external; procedure SEEK( var fptr :text; var cnt :fileptr); external; procedure APPEND( var fptr :text); external; F YOU PUT STUFF HERE IT WILL GO AWAY # see make depend above RELSGT.o: h00vars.h REL/,5 /,"lib/libpc/unixio.i 644 0 33 2016 2552607302 7357 (* Copyright (c) 1979 Regents of the University of California *) const sccsid = '@(#)unixio.i 1.1 6/17/81'; type fileptr = record cnt :integer end; function TELL( var fptr :text) {returns} :fileptr; var filesize, headsize, tailsize :integer; result :fileptr; begin tailsize := 0; while not eof(fptr) do begin get(fptr); tailsize := tailsize + 1 end; filesize := 0; reset(fptr); while not eof(fptr) do begin get(fptr); filesize := filesize + 1 end; reset(fptr); for headsize := 1 to filesize - tailsize do get(fptr); result.cnt := headsize; TELL := result end; procedure SEEK( var fptr :text; var cnt :fileptr); var i :integer; begin reset(fptr); for i := 1 to cnt.cnt do get(fptr) end; procedure APPEND( var fptr :text); var tmp :text; begin rewrite(tmp); reset(fptr); while not eof(fptr) do begin if eoln(fptr) then writeln(tmp) else write(tmp, fptr^); get(fptr) end; reset(tmp); rewrite(fptr); while not eof(tmp) do begin if eoln(tmp) then writeln(fptr) else write(fptr, tmp^); get(tmp) end end; r); result.cnt := headsize; TELL := result end; procedure SEEK( var fptr :text; var cnt :fileptr); var i :integer; begin reset(fptr); for i := 1 to cnt.cnt do get(fptr) end; procedure APPEND( var fptr :text); var tmp :text; begin rewrite(tmp); reset(fptr); while not eof(fptr) do begin if eoln(fptr) then writeln(tmp) else write(tmp, fptr^); get(fptr) end; reset(tmp); rewrite(fptr); while not eof(tmp) do begin if eoln(tmp) then writeln(fptr) else write(fptr, tmp^); get(tlib/libpc/whoami.h 644 0 33 1041 2552607302 7324 /* Copyright (c) 1979 Regents of the University of California */ /* static char sccsid[] = "@(#)piwhoami.h 1.2 3/6/81"; */ /* * am i generating an obj file (OBJ), * postfix binary input to the 2nd pass of the portable c compiler (PC), * or pTrees (PTREE)? */ #define OBJ #undef PC #undef PTREE /* * am i the vax or the pdp11 version */ #define VAX #undef PDP11 #define DEC11 /* * am i pi or pxp? */ #define PI #undef PXP /* * am i both passes, or am i only one of the two passes pi0 or pi1? */ #de((fine PI01 #undef PI0 #undef PI1 the University of California */ /* static char sccsid[] = "@(#)piwhoami.h 1.2 3/6/81"; */ /* * am i generating an obj file (OBJ), * postfix binary input to the 2nd pass of the portable c compiler (PC), * or pTrees (PTREE)? */ #define OBJ #undef PC #undef PTREE /* * am i the vax or the pdp11 version */ #define VAX #undef PDP11 #define DEC11 /* * am i pi or pxp? */ #define PI #undef PXP /* * am i both passes, or am i only one of the two passes pi0 or pi1? */ #delib/libjobs/ 775 0 33 0 2552602014 6136 lib/libjobs/setpgrp.s 644 0 33 735 2424166014 10061 # C library -- setpgrp, getpgrp # setpgrp(pid, pgrp); /* set pgrp of pid and descendants to pgrp */ # if pid==0 use current pid # # getpgrp(pid) # implemented as setpgrp(pid, -1) .set setpgrp,39 .globl _setpgrp .globl _getpgrp .globl cerror .align 1 _setpgrp: .word 0x0000 chmk $setpgrp bcc noerror jmp cerror noerror: ret .align 1 _getpgrp: .word 0x0000 pushl $-1 pushl 4(ap) calls $2,gpgrp ret gpgrp: .word 0x0000 chmk $setpgrp bcc noerror jmp cerror /,"lib/libjobs/signal.s 644 0 33 3140 2340431461 7661 # C library -- sigsys # sigsys(n, SIG_DFL); /* default action on signal(n) */ # sigsys(n, SIG_HOLD); /* block signal temporarily */ # sigsys(n, SIG_IGN); /* ignore signal(n) */ # sigsys(n, label); /* goto label on signal(n) */ # sigsys(n, DEFERSIG(label)); /* goto label with signal SIG_HOLD */ # returns old label, only one level. .set SIGDORTI,0x200 .set signal,48 .globl _sigsys .globl cerror .align 1 _sigsys: .word 0x0000 chmk $signal bcc noerror jmp cerror noerror: ret # # sigpeel(n, newact) # # when called from routine which was called by system, peels # back frames to the last one, then calls the system to reenable # the signal with newact, arranging to clean the stack before the # signal can happen again # .globl _sigpeel .align 1 _sigpeel: .word 0x0000 .set RETOFF,16 # offset of return address in frame # get signal number value to set movl 4(ap),r0 movl 8(ap),r1 movab unw1,RETOFF(fp) ret # peel off our frame # top frame is now frame of routine signal action called unw1: movab unw2,RETOFF(fp) ret # now frame from callg of ``locore.s/sigcode()'' is gone # if no value to set, can just ret now to go back to old code # with an ret->rei, else must make the frame passed to us into a # signal call frame by putting the new signal code in the # second word, and call the kernel which will pop off the frame. unw2: tstl r1 bneq unw3 ret # easy # mark dorti wanted, and reenable signal unw3: bisl3 $SIGDORTI,r0,4(ap) ### movl r0,4(ap) ### for testing on old system movl r1,8(ap) chmk $signal halt # can't happen ### for testing on old system ### ret # and then rei, natch to set, can just ret now to go back to old code # with an ret->rei, else must make the frame passed to us into a # signal call frame by putting the new signal code in the # second word, and call the kernel which will pop off the frame. unw2: tstl r1 bneq unw3 ret # easy # mark dorti wanted, and reenable signal unw3: bisl3 $SIGDORTI,r0,4(ap) ### movl r0,4(ap) ### for testing on old system movl r1,8(ap) chmlib/libjobs/getwd.c 644 0 33 2613 2342122606 7502 /* * Getwd */ #include #include #include #define dot "." #define dotdot ".." static char *name; static int file; static int off = -1; static struct stat d, dd; static struct direct dir; char * getwd(np) char *np; { int rdev, rino; *np++ = '/'; name = np; stat("/", &d); rdev = d.st_dev; rino = d.st_ino; for (;;) { stat(dot, &d); if (d.st_ino==rino && d.st_dev==rdev) goto done; if ((file = open(dotdot,0)) < 0) prexit("getwd: cannot open ..\n"); fstat(file, &dd); chdir(dotdot); if(d.st_dev == dd.st_dev) { if(d.st_ino == dd.st_ino) goto done; do if (read(file, (char *)&dir, sizeof(dir)) < sizeof(dir)) prexit("getwd: read error in ..\n"); while (dir.d_ino != d.st_ino); } else do { if(read(file, (char *)&dir, sizeof(dir)) < sizeof(dir)) prexit("getwd: read error in ..\n"); stat(dir.d_name, &dd); } while(dd.st_ino != d.st_ino || dd.st_dev != d.st_dev); close(file); cat(); } done: name--; if (chdir(name) < 0) prexit("getwd: can't change back\n"); return (name); } cat() { register i, j; i = -1; while (dir.d_name[++i] != 0); if ((off+i+2) > 1024-1) return; for(j=off+1; j>=0; --j) name[j+i+1] = name[j]; if (off >= 0) name[i] = '/'; off=i+off+1; name[off] = 0; for(--i; i>=0; --i) name[i] = dir.d_name[i]; } prexit(cp) char *cp; { write(2, cp, strlen(cp)); exit(1); } d); } while(dd.st_ino != d.st_ino || dd.st_dev != d.st_dev); close(file); cat(); } done: name--; if (chdir(lib/libjobs/killpg.s 644 0 33 312 2342130447 7646 # C library -- killpg .set kill,37 .globl _killpg .globl cerror _killpg: .word 0x0000 mnegl 8(ap),8(ap) # kill with - signo is killpg chmk $kill bcc noerror jmp cerror noerror: clrl r0 ret j+i+1] = name[j]; if (off >= 0) name[i] = '/'; off=i+off+1; name[off] = 0; for(--i; i>=0; --i) name[i] = dir.d_name[i]; } prexit(cp) char *cp; { write(2, cp, strlen(cp)); exit(1); } d); } while(dd.st_ino /,5 /,"lib/libjobs/wait3.s 644 0 33 1226 2340455025 7440 # C library -- wait3 # pid = wait3(&status, flags, &vmstat); # # pid == -1 if error # status indicates fate of process, if given # flags may indicate process is not to hang or # that untraced stopped children are to be reported. # vmstat optionally returns detailed resource usage information # .set wait3,7 # same as wait! .globl _wait3 .globl cerror .align 1 _wait3: .word 0x0000 movl 8(ap),r0 # make it easy for system to get movl 12(ap),r1 # these extra arguments bispsw $0xf # flags wait3() chmk $wait3 bcc noerror jmp cerror noerror: tstl 4(ap) # status desired? beql nostatus # no movl r1,*4(ap) # store child's status nostatus: ret process is not to hang or # that untraced stopped children are to be reported. # vmstat optionally returns detailed resource usage information # .set wait3,7 # same as wait! .globl _wait3 .globl cerror .align 1 _wait3: .word 0x0000 movl 8(ap),r0 # make it easy for system to get movl 12(ap),r1 # these extra arguments bispsw $0xf # flags wait3() chmlib/libjobs/sigset.c 644 0 33 10106 2516235003 7701 #include #include /* * signal system call interface package. */ extern errno; #ifdef PDP11 #define BYTESPERVEC 4 /* size of machine language vector */ extern char mvectors[NSIG+1][BYTESPERVEC]; #endif static int (*cactions[NSIG+1])(); /* saved callers signal actions */ static char setflg[NSIG+1]; /* =1 means action perm ``sigset'' */ int (*sigsys())(); int _sigcatch(); /* * old signal protocol. when signal occurs, further * instances of same signal are not blocked, so that * ((recursive signals are possible. the action will * not be re-enabled by these routines when return * is made from the interrupt (compare sigset). */ int (* signal(signum, action))() register int signum; register int (*action)(); { register int (*retval)(); if (signum <= 0 || signum > NSIG) { errno = EINVAL; return (BADSIG); } retval = cactions[signum]; cactions[signum] = action; if (action != SIG_IGN && action != SIG_DFL && action != SIG_HOLD) if (SIGISDEFER(action)) #ifdef PDP11 action = DEFERSIG(mvectors[signum]); else action = (int (*)())(int)mvectors[signum]; #else action = DEFERSIG(_sigcatch); else action = _sigcatch; #endif action = sigsys(signum, action); if (action == SIG_IGN || action == SIG_DFL || action == SIG_HOLD) retval = action; setflg[signum] = 0; /* 'tis fleeting (madness may take its toll) */ return (retval); } /* * set ``permanent'' action for this signal. if a function, * it will be deferred when interupt occurs and enabled again * when return occurs. after sigset, sighold and sigrelse can * be used to protect signum signal critical sections. */ int (* sigset(signum, action))() register int signum; register int (*action)(); { register int (*retval)(); if (signum <= 0 || signum > NSIG) { errno = EINVAL; return (BADSIG); } retval = cactions[signum]; cactions[signum] = action; if (action != SIG_IGN && action != SIG_DFL && action != SIG_HOLD) action = DEFERSIG(_sigcatch); action = sigsys(signum, action); if (action == SIG_IGN || action == SIG_DFL || action == SIG_HOLD) retval = action; setflg[signum] = 1; /* don't want to lose control! */ return (retval); } /* * temporarily hold a signal until further notice * via sigpause or sigrelse */ sighold(signum) register int signum; { if (signum <= 0 || signum > NSIG) { errno = EINVAL; return; } sigsys(signum, SIG_HOLD); } /* * atomically release the signal and pause * if no signals pending. signal will normally * be held on return (unless an routine called at * interrupt time resets it). */ sigpause(signum) register signum; { if (signum <= 0 || signum > NSIG || setflg[signum] == 0) { errno = EINVAL; return; } #ifdef PDP11 sigsys(signum|SIGDOPAUSE, DEFERSIG(mvectors[signum])); #else sigsys(signum|SIGDOPAUSE, DEFERSIG(_sigcatch)); #endif } /* * re-enable signals after sighold or possibly after sigpause */ sigrelse(signum) register signum; { if (signum <= 0 || signum > NSIG || setflg[signum] == 0) { errno = EINVAL; return (-1); } #ifdef PDP11 sigsys(signum, DEFERSIG(mvectors[signum])); #else sigsys(signum, DEFERSIG(_sigcatch)); #endif return (0); } /* * ignore signal */ sigignore(signum) int signum; { sigsys(signum, SIG_IGN); } #ifdef PDP11 /* * called at interrupt time. on pdp11 assembly language * routine resets signal catch to returned action, if * returned action is not SIG_DFL. */ int (* _sigcatch(signum))() register signum; { (*cactions[signum])(signum); /* call the C routine */ if (setflg[signum]) return (DEFERSIG(mvectors[signum]); else return (SIG_DFL); /* old protocol */ } #else /* * called at interrupt time. on vax, sigpeel will peel * off the interrupt frames and reenable the signal with * the argument action (cleanly). if the action is * SIG_DFL sigpeel will do nothing, but we can as well * return ourselves without its help. */ _sigcatch(signum, code, xx, ps, pc) register signum; int code; { register int (*act)() = cactions[signum]; { asm("callg (ap),(r10)"); } if (setflg[signum]) { sigpeel(signum, DEFERSIG(_sigcatch)); /*NOTREACHED*/ } /* old protocol, just return */ } #endif nterrupt time. on vax, sigpeel will peel * off the interrupt frames and reenable the signal with * the argument action (cleanly). if the action is * SIG_DFL sigpeel will do nothing, but we can as well * return ourselves without its help. */ _sigcatch(signum, code, xx, ps, pc) register signum; int code; { register int (*act)() = cactions[signum]; { asm("callg (ap),(r10)"); } if (setflg[signum]) { sigpeel(signum, DEFERSIG(_sigclib/libjobs/makefile 644 0 33 355 2525647321 7716 CFLAGS=-O OBJS= getwd.o killpg.o setpgrp.o signal.o sigset.o wait3.o libjobs.a: ${OBJS} ar cr libjobs.a `lorder ${OBJS}` install: install -c libjobs.a $(DESTDIR)/usr/lib ranlib $(DESTDIR)/usr/lib/libjobs.a clean: rm libjobs.a *.o el will do nothing, but we can as well * return ourselves without its help. */ _sigcatch(signum, code, xx, ps, pc) register signum; int code; { register int (*act)() = cactions[sig/,5, /,"lib/libI77/ 775 0 33 0 2552600776 5564 lib/libI77/Makefile 644 0 33 1514 2413063360 7274 .SUFFIXES: .o .x .c CFLAGS=-O .c.o: $(CC) $(CFLAGS) -c $< .c.x: $(CC) $(CFLAGS) -c $< ar ru libI77.a $*.o -rm $*.o > $*.x FILES=backspace.x dfe.x due.x iio.x inquire.x \ lib.x rewind.x rsfe.x \ rdfmt.x sue.x uio.x wsfe.x sfe.x fmt.x \ lio.x lread.x open.x close.x util.x \ endfile.x wrtfmt.x err.x fmtlib.x SOURCE=rewind.c endfile.c uio.c due.c dfe.c \ Makefile backspace.c close.c err.c fio.h fmt.c fmt.h \ fmtlib.c ftest.c lib.c open.c rdfmt.c rsfe.c sfe.c \ sue.c util.c wrtfmt.c wsfe.c iio.c lio.h lio.c \ inquire.c lread.c libI77.a: $(FILES) lio.h: chmod 0666 lio.h lio.x lread.x: lio.h fmt.x rdfmt.x rsfe.x testfmt.x wrtfmt.x wsfe.x: fmt.h $(FILES): fio.h /usr/include/stdio.h/ install: cp libI77.a $(DESTDIR)/usr/lib/libI77.a ranlib $(DESTDIR)/usr/lib/libI77.a clean: rm *.x libI77.a list: @pr -w72 *.h *.c Makefile endfile.c uio.c due.c dfe.c \ Makefile backspace.c close.c err.c fio.h fmt.c fmt.h \ fmtlib.c ftest.c lib.c open.c rdfmt.c rsfe.c sfe.c \ sue.c util.c wrtfmt.c wsfe.c iio.c lilib/libI77/backspace.c 644 0 33 2072 2413060107 7710 #include "fio.h" f_back(a) alist *a; { unit *b; int n,i; long x; char buf[32]; if(a->aunit >= MXUNIT || a->aunit < 0) err(a->aerr,101,"backspace") b= &units[a->aunit]; if(b->useek==0) err(a->aerr,106,"backspace") if(b->ufd==NULL) err(a->aerr,114,"backspace") if(b->uend==1) { b->uend=0; return(0); } if(b->uwrt) { (void) t_runc(b); (void) nowreading(b); } if(b->url>0) { long y; x=ftell(b->ufd); y = x % b->url; if(y == 0) x--; x /= b->url; x *= b->url; (void) fseek(b->ufd,x,0); return(0); } if(b->ufmt==0) { (void) fseek(b->ufd,-(long)sizeof(int),1); (void) fread((char *)&n,sizeof(int),1,b->ufd); (void) fseek(b->ufd,-(long)n-2*sizeof(int),1); return(0); } for(;;) { long y; y = x=ftell(b->ufd); if(xufd,x,0); n=fread(buf,1,(int)(y-x), b->ufd); for(i=n-2;i>=0;i--) { if(buf[i]!='\n') continue; (void) fseek(b->ufd,(long)(i+1-n),1); return(0); } if(x==0) return(0); else if(n<=0) err(a->aerr,(EOF),"backspace") (void) fseek(b->ufd, x, 0); } } long)sizeof(int),1); (void) fread((char *)&n,sizeof(int),1,b->ufd); (void) fseek(b->ufd,-(long)n-2*sizeof(int),1); return(0); } for(;;) { long y; y = x=ftell(b->ufd); if(xufd,x,0); n=fread(buf,1,(int)(y-x), b->ufd); for(i=n-2;i>=0;i--) { if(buf[i]!='\n') continue; (void) fseek(b->ufd,(long)(i+1-n),1); return(0); } if(x==0) return(0); else if(n<=0) err(a->alib/libI77/close.c 644 0 33 1472 2413060107 7104 #include "fio.h" f_clos(a) cllist *a; { unit *b; if(a->cunit >= MXUNIT) return(0); b= &units[a->cunit]; if(b->ufd==NULL) return(0); b->uend=0; if(a->csta!=0) switch(*a->csta) { default: keep: case 'k': if(b->uwrt) (void) t_runc(b); if(fclose(b->ufd) != 0) abort(); if(b->ufnm!=0) free(b->ufnm); b->ufnm=NULL; b->ufd=NULL; return(0); case 'd': delete: (void) fclose(b->ufd); if(b->ufnm!=0) { (void) unlink(b->ufnm); /*SYSDEP*/ free(b->ufnm); } b->ufnm=NULL;(( b->ufd=NULL; return(0); } else if(b->uscrtch==1) goto delete; else goto keep; } f_exit() { int i; cllist xx; xx.cerr=1; xx.csta=NULL; for(i=0;iufnm=NULL; b->ufd=NULL; return(0); case 'd': delete: (void) fclose(b->ufd); if(b->ufnm!=0) { (void) unlink(b->ufnm); /*SYSDEP*/ free(b->ufnm); } b->ufnm=NULL;lib/libI77/ctest.c 644 0 33 437 2413060107 7101 #include "stdio.h" char buf[256]; main() { int w,dp,sign; char *s; double x; for(;;) { scanf("%d %lf",&w,&x); if(feof(stdin)) exit(0); s=fcvt(x,w,&dp,&sign); strcpy(buf,s); printf("%d,%f:\t%d\t%s\n",w,x,dp,buf); s=ecvt(x,w,&dp,&sign); printf("\t\t%d\t%s\n",dp,s); } } d) fflush(units[i].ufd); } nm); b->ufnm=NULL; b->ufd=NULL; return(0); case 'd': delete: (void) fclose(b->ufd); if(/,5 /,"lib/libI77/dfe.c 644 0 33 4065 2413060107 6536 #include "fio.h" #include "fmt.h" extern int rd_ed(),rd_ned(),y_getc(),y_putc(),y_err(); extern int y_rev(), y_rsk(); extern int w_ed(),w_ned(); s_rdfe(a) cilist *a; { int n; if(!init) f_init(); if(n=c_dfe(a))return(n); reading=1; if(curunit->uwrt) (void) nowreading(curunit); getn = y_getc; doed = rd_ed; doned = rd_ned; dorevert = donewrec = y_err; doend = y_rsk; if(pars_f(fmtbuf)<0) err(a->cierr,100,"startio"); fmt_bg(); return(0); } s_wdfe(a) cilist *a; { int n; if(!init) f_init(); if(n=c_dfe(a)) return(n); reading=0; if(!curunit->uwrt) (void) nowwriting(curunit); putn = y_putc; doed = w_ed; doned= w_ned; dorevert = donewrec = y_err; doend = y_rev; if(pars_f(fmtbuf)<0) err(a->cierr,100,"startwrt"); fmt_bg(); return(0); } e_rdfe() { (void) en_fio(); return(0); } e_wdfe() { (void) en_fio(); return(0); } c_dfe(a) cilist *a; { sequential=0; formatted=external=1; elist=a; cursor=scale=recpos=0; if(a->ciunit>MXUNIT || a->ciunit<0) err(a->cierr,101,"startchk"); curunit = &units[a->ciunit]; if(curunit->ufd==NULL && fk_open(DIR,FMT,a->ciunit)) err(a->cierr,104,"dfe"); cf=curunit->ufd; if(!curunit->ufmt) err(a->cierr,102,"dfe") if(!curunit->useek) err(a->cierr,104,"dfe") fmtbuf=a->cifmt; (void) fseek(cf,(long)curunit->url * (a->cirec-1),0); curunit->uend = 0; return(0); } y_rsk() { if(curunit->uend || curunit->url <= recpos || curunit->url == 1) return; do { getc(cf); } while(++recpos < curunit->url); } y_getc() { int ch; if(curunit->uend) return(-1); if((ch=getc(cf))!=EOF) { recpos++; if(curunit->url>=recpos || curunit->url==1) return(ch); else return(' '); } if(feof(cf)) { curunit->uend=1; errno=0; return(-1); } err(elist->cierr,errno,"readingd"); } y_putc(c) { recpos++; if(recpos <= curunit->url || curunit->url==1) putc(c,cf); else err(elist->cierr,110,"dout"); return(0); } y_rev() { /*what about work done?*/ if(curunit->url==1 || recpos==curunit->url) return(0); while(recposurl) (*putn)(' '); recpos=0; return(0); } y_err() { err(elist->cierr, 110, "dfe"); } cpos || curunit->url==1) return(ch); else return(' '); } if(feof(cf)) { curunit->uend=1; errno=0; return(-1); } err(elist->cierr,errno,"readingd"); } y_putc(c) { recpos++; if(recpos <= curunit->url || curunit->url==1) putc(c,cf); else err(elist->cierr,110,"dout"); return(0); } y_rev() { /*what about work done?*/ if(curunit->url==1 || recpos==curunit->url) return(0); while(recposurl) (*putn)(' '); recpos=0; retulib/libI77/due.c 644 0 33 2003 2413060110 6535 #include "fio.h" s_rdue(a) cilist *a; { int n; if(n=c_due(a)) return(n); reading=1; if(curunit->uwrt) (void) nowreading(curunit); return(0); } s_wdue(a) cilist *a; { int n; if(n=c_due(a)) return(n); reading=0; if(!curunit->uwrt) (void) nowwriting(curunit); return(0); } c_due(a) cilist *a; { if(!init) f_init(); if(a->ciunit>=MXUNIT || a->ciunit<0) err(a->cierr,101,"startio"); recpos=sequential=formatted=0; external=1; curunit = &units[a->ciunit]; elist=a; if(curunit->ufd==NULL && fk_open(DIR,UNF,a->ciunit) ) err(a->cierr,104,"due"); cf=curunit->ufd; if(curunit->ufmt) err(a->cierr,102,"cdue") if(!curunit->useek) err(a->cierr,104,"cdue") if(curunit->ufd==NULL) err(a->cierr,114,"cdue") (void) fseek(cf,(long)(a->cirec-1)*curunit->url,0); curunit->uend = 0; return(0); } e_rdue() { if(curunit->url==1 || recpos==curunit->url) return(0); (void) fseek(cf,(long)(curunit->url-recpos),1); if(ftell(cf)%curunit->url) err(elist->cierr,200,"syserr"); return(0); } e_wdue() { return(e_rdue()); } UNF,a->ciunit) ) err(a->cierr,104,"due"); cf=curunit->ufd; if(curunit->ufmt) err(a->cierr,102,"cdue") if(!curunit->useek) err(a->cierr,104,"cdue") if(curunit->ufd==NULL) err(a->cierr,114,"cdue") (void) fseek(cf,(long)(a->cirec-1)*curunit->url,0); curunit->uend = 0; return(0); } e_rdue() { if(curunit->url==1 || recpos==curunit->url) return(0); (void) fseek(cf,(long)(curunit->url-recpos),1); if(ftell(cf)%curunit->url) err(elist->cierr,200,"syserr"); return(0); } e_wdue() { return(e_rdue());lib/libI77/endfile.c 644 0 33 2320 2413060110 7370 #include "fio.h" static alist *ax; extern char *mktemp(), *strcpy(); f_end(a) alist *a; { unit *b; if(a->aunit>=MXUNIT || a->aunit<0) err(a->aerr,101,"endfile"); b = &units[a->aunit]; if(b->ufd==NULL) return(0); b->uend=1; if( b->useek==0) return(0); ax=a; if(b->uwrt) (void) nowreading(b); return(t_runc(b)); } t_runc(b) unit *b; { char buf[128],nm[16]; FILE *tmp; int n,m; long loc,len; if(b->url) return(0); /*don't truncate direct files*/ loc=ftell(b->ufd); (void) fseek(b->ufd,0L,2); len=ftell(b->ufd); if(loc==len || b->useek==0 || b->ufnm==NULL) return(0); (void) strcpy(nm,"tmp.FXXXXXX"); if(b->uwrt) (void) nowreading(b); (void) mktemp(nm); tmp=fopen(nm,"w"); (void) fseek(b->ufd,0L,0); for(;loc>0;) { n=fread(buf,1,loc>128?128:(int)loc,b->ufd); if(n>loc) n=loc; loc -= n; (void) fwrite(buf,1,n,tmp); } (void) fflush(tmp); for(n=0;n<10;n++) { if((m=fork())==-1) continue; else if(m==0) { (void) execl("/bin/cp","cp",nm,b->ufnm,0); (void) execl("/usr/bin/cp","cp",nm,b->ufnm,0); fprintf(stdout,"no cp\n"); exit(1); } (void) wait(&m); if(m!=0) err(ax->aerr,111,"endfile"); (void) fclose(tmp); (void) unlink(nm); return(0); } err(ax->aerr,111,"endfile"); } for(;loc>0;) { n=fread(buf,1,loc>128?128:(int)loc,b->ufd); if(n>loc) n=loc; loc -= n; (void) fwrite(buf,1,n,tmp); } (void) fflush(tmp); for(n=0;n<10;n++) { if((m=fork())==-1) continue; else if(m==0) { (void) execl("/bin/cp","cp",nm,b->ufnm,0); (void) execl("/usr/bin/cp","cp",nm,lib/libI77/err.c 644 0 33 5144 2413060110 6561 #include #include #include #include "fio.h" #define STR(x) (x==NULL?"":x) /*global definitions*/ unit units[MXUNIT]; /*unit table*/ flag init; /*0 on entry, 1 after initializations*/ cilist *elist; /*active external io list*/ flag reading; /*1 if reading, 0 if writing*/ flag cplus,cblank; char *fmtbuf; flag external; /*1 if external io, 0 if internal */ int (*doed)(),(*doned)(); int (*doend)(),(*donewrec)(),(*dorevert)(); flag sequential; /*1 if sequential io, 0 if direct*/ flag formatted; /*1 if formatted io, 0 if unformatted*/ int (*getn)(),(*putn)(); /*for formatted io*/ FILE *cf; /*current file*/ unit *curunit; /*current unit*/ int recpos; /*place in current record*/ int cursor,scale; /*error messages*/ char *F_err[] = { "error in format", "illegal unit number", "formatted io not allowed", "unformatted io not allowed", "direct io not allowed", "sequential io not allowed", "can't backspace file", "null file name", "can't stat file", "unit not connected", "o((ff end of record", "truncation failed in endfile", "incomprehensible list input", "out of free space", "unit not connected", "read unexpected character", "blank logical input field", }; #define MAXERR (sizeof(F_err)/sizeof(char *)+100) fatal(n,s) char *s; { if(n<100 && n>=0) perror(s); /*SYSDEP*/ else if(n>=(int)MAXERR) { fprintf(stderr,"%s: illegal error number %d\n",s,n); } else if(n<0) fprintf(stderr,"%s: end of file %d\n",s,n); else fprintf(stderr,"%s: %s\n",s,F_err[n-100]); fprintf(stderr,"apparent state: unit %d named %s\n",curunit-units, STR(curunit->ufnm)); fprintf(stderr,"last format: %s\n",STR(fmtbuf)); fprintf(stderr,"lately %s %s %s %s IO\n",reading?"reading":"writing", sequential?"sequential":"direct",formatted?"formatted":"unformatted", external?"external":"internal"); _cleanup(); abort(); } /*initialization routine*/ f_init() { unit *p; init=1; p= &units[0]; p->ufd=stderr; p->useek=canseek(stderr); p->ufmt=1; p->uwrt=1; p = &units[5]; p->ufd=stdin; p->useek=canseek(stdin); p->ufmt=1; p->uwrt=0; p= &units[6]; p->ufd=stdout; p->useek=canseek(stdout); p->ufmt=1; p->uwrt=1; } canseek(f) FILE *f; /*SYSDEP*/ { struct stat x; (void) fstat(fileno(f),&x); if(x.st_nlink > 0 /*pipe*/ && !isatty(fileno(f))) { return(1); } return(0); } nowreading(x) unit *x; { long loc; x->uwrt=0; loc=ftell(x->ufd); if(freopen(x->ufnm,"r",x->ufd) == NULL) return(1); (void) fseek(x->ufd,loc,0); return(0); } nowwriting(x) unit *x; { long loc; loc=ftell(x->ufd); x->uwrt=1; if(freopen(x->ufnm,"a",x->ufd) == NULL) return(1); (void) fseek(x->ufd,loc,0); return(0); } fmt=1; p->uwrt=1; } canseek(f) FILE *f; /*SYSDEP*/ { struct stat x; (void) fstat(fileno(f),&x); if(x.st_nlink > 0 /*pipe*/ && !isatty(fileno(f))) { return(1); } return(0); } nowreading(x) unit *x; { long loc; x->uwrt=0; loc=ftell(x->ufd); if(freopen(x->ufnm,"r",x->ufd) == NULL) return(1); (void) fseek(x->ufd,loc,0); return(0); } nowwriting(x) unit *x; { long loc; loc=ftell(x->ufd); x->uwrt=lib/libI77/fio.h 644 0 33 3661 2413060110 6555 #include typedef long ftnint; typedef ftnint flag; typedef long ftnlen; /*external read, write*/ typedef struct { flag cierr; ftnint ciunit; flag ciend; char *cifmt; ftnint cirec; } cilist; /*internal read, write*/ typedef struct { flag icierr; char *iciunit; flag iciend; char *icifmt; ftnint icirlen; ftnint icirnum; } icilist; /*open*/ typedef struct { flag oerr; ftnint ounit; char *ofnm; ftnlen ofnmlen; char *osta; char *oacc; char *ofm; ftnint orl; char *oblnk; } olist; /*close*/ typedef struct { flag cerr; ftnint cunit; char *csta; } cllist; /*rewind, backspace, endfile*/ typedef struct { flag aerr; ftnint aunit; } alist; /*units*/ typedef struct { FILE *ufd; /*0=unconnected*/ char *ufnm; long uinode; int url; /*0=sequential*/ flag useek; /*true=can backspace, use dir, ...*/ flag ufmt; flag uprnt; flag ublnk; flag uend; flag uwrt; /*last io was write*/ flag uscrtch; } unit; typedef struct { flag inerr; ftnint inunit; char *infile; ftnlen infilen; ftnint *inex; /*parameters in standard's order*/ ftnint *inopen; ftnint *innum; ftnint *innamed; char *inname; ftnlen innamlen; char *inacc; ftnlen inacclen; char *inseq; ftnlen inseqlen; char *indir; ftnlen indirlen; char *infmt; ftnlen infmtlen; char *inform; ftnint informlen; char *inunf; ftnlen inunflen; ftnint *inrecl; ftnint *innrec; char *inblank; ftnlen inblanklen; } inlist; extern int errno; extern flag init; extern cilist *elist; /*active external io list*/ extern flag reading,external,sequential,formatted; extern int (*getn)(),(*putn)(); /*for formatted io*/ extern FILE *cf; /*current file*/ extern unit *curunit; /*current unit*/ extern unit units[]; #define err(f,n,s) {if(f) errno= n; else fatal(n,s); return(n);} /*Table sizes*/ #define MXUNIT 20 extern int recpos; /*position in current record*/ #define WRITE 1 #define READ 2 #define SEQ 3 #define DIR 4 #define FMT 5 #define UNF 6 #define EXT 7 #define INT 8 ern cilist *elist; /*active external io list*/ extern flag reading,external,seqlib/libI77/fmt.c 644 0 33 15033 2413060111 6576 #include "fio.h" #include "fmt.h" #define skip(s) while(*s==' ') s++ #ifdef interdata #define SYLMX 300 #endif #ifdef pdp11 #define SYLMX 300 #endif #ifdef vax #define SYLMX 300 #endif #define GLITCH '\2' /* special quote character for stu */ extern int cursor,scale; extern flag cblank,cplus; /*blanks in I and compulsory plus*/ struct syl syl[SYLMX]; int parenlvl,pc,revloc; char *f_s(),*f_list(),*i_tem(),*gt_num(); pars_f(s) char *s; { parenlvl=revloc=pc=0; if((s=f_s(s,0))==NULL) { return(-1); } return(0); } char *f_s(s,curloc) char *s; { skip(s); if(*s++!='(') { return(NULL); } if(parenlvl++ ==1) revloc=curloc; if(op_gen(RET,curloc,0,0)<0 || (s=f_list(s))==NULL) { return(NULL); } skip(s); return(s); } char *f_list(s) char *s; { for(;*s!=0;) { skip(s); if((s=i_tem(s))==NULL) return(NULL); skip(s); if(*s==',') s++; else if(*s==')') { if(--parenlvl==0) { (void) op_gen(REVERT,revloc,0,0); return(++s); } (void) op_gen(GOTO,0,0,0); return(++s); } } return(NULL); } char *i_tem(s) char *s; { char *t; int n,curloc; if(*s==')') return(s); if(ne_d(s,&t)) return(t); if(e_d(s,&t)) return(t); s=gt_num(s,&n); if((curloc=op_gen(STACK,n,0,0))<0) return(NULL); return(f_s(s,curloc)); } ne_d(s,p) char *s,**p; { int n,x,sign=0; char *ap_end(); switch(*s) { default: return(0); case ':': (void) op_gen(COLON,0,0,0); break; case '$': (void) op_gen(NONL, 0, 0, 0); break; case 'B': case 'b': if(*++s=='z' || *s == 'Z') (void) op_gen(BZ,0,0,0); else (void) op_gen(BN,0,0,0); break; case 'S': case 's': if(*(s+1)=='s' || *(s+1) == 'S') { x=SS; s++; } else if(*(s+1)=='p' || *(s+1) == 'P') { x=SP; s++; } else x=S; (void) op_gen(x,0,0,0); break; case '/': (void) op_gen(SLASH,0,0,0); break; case '-': sign=1; s++; /*OUTRAGEOUS CODING TRICK*/ case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': s=gt_num(s,&n); switch(*s) { default: return(0); case 'P': case 'p': if(sign) n= -n; (void) op_gen(P,n,0,0); break; case 'X': case 'x': (void) op_gen(X,n,0,0); break; case 'H': case 'h': (void) op_gen(H,n,(int)(s+1),0); s+=n; break; } break; case GLITCH: case '"': case '\'': (void) op_gen(APOS,(int)s,0,0); if((*p = ap_end(s)) == NULL) return(0); return(1); case 'T': case 't': if(*(s+1)=='l' || *(s+1) == 'L') { x=TL; s++; } else if(*(s+1)=='r'|| *(s+1) == 'R') { x=TR; s++; } else x=T; s=gt_num(s+1,&n); s--; (void) op_gen(x,n,0,0); break; case 'X': case 'x': (void) op_gen(X,1,0,0); break; case 'P': case 'p': (void) op_gen(P,1,0,0); break; } s++; *p=s; return(1); } e_d(s,p) char *s,**p; { int n,w,d,e,found=0,x=0; char *sv=s; s=gt_num(s,&n); (void) op_gen(STACK,n,0,0); switch(*s++) { default: break; case 'E': case 'e': x=1; case 'G': case 'g': found=1; s=gt_num(s,&w); if(w==0) break; if(*s=='.') { s++; s=gt_num(s,&d); } else d=0; if(*s!='E' && *s != 'e') (void) op_gen(x==1?E:G,w,d,0); else { s++; s=gt_num(s,&e); (void) op_gen(x==1?EE:GE,w,d,e); } break; case 'O': case 'o': found = 1; s = gt_num(s, &w); if(w==0) break; (void) op_gen(O, w, 0, 0); break; case 'L': case 'l': found=1; s=gt_num(s,&w); if(w==0) break; (void) op_gen(L,w,0,0); break; case 'A': case 'a': found=1; skip(s); if(*s>='0' && *s<='9') { s=gt_num(s,&w); if(w==0) break; (void) op_gen(AW,w,0,0); break; } (void) op_gen(A,0,0,0); break; case 'F': case 'f': found=1; s=gt_num(s,&w); if(w==0) break; if(*s=='.') { s++; s=gt_num(s,&d); } else d=0; (void) op_gen(F,w,d,0); break; case 'D': case 'd': found=1; s=gt_num(s,&w); if(w==0) break; if(*s=='.') { s++; s=gt_num(s,&d); } else d=0; (void) op_gen(D,w,d,0); break; case 'I': case 'i': found=1; s=gt_num(s,&w); if(w==0) break; if(*s!='.') { (void) op_gen(I,w,0,0); break; } s++; s=gt_num(s,&d); (void) op_gen(IM,w,d,0); break; } if(found==0) { pc--; /*unSTACK*/ *p=sv; return(0); } *p=s; return(1); } op_gen(a,b,c,d) { struct syl *p= &syl[pc]; if(pc>=SYLMX) { fprintf(stderr,"format too complicated:\n%s\n", fmtbuf); abort(); } p->op=a; p->p1=b; p->p2=c; p->p3=d; return(pc++); } char *gt_num(s,n) char *s; int *n; { int m=0,cnt=0; char c; for(c= *s;;c = *s) { if(c==' ') { s++; continue; } if(c>'9' || c<'0') break; m=10*m+c-'0'; cnt++; s++; } if(cnt==0) *n=1; else *n=m; return(s); } #define STKSZ 10 int cnt[STKSZ],ret[STKSZ],cp,rp; flag workdone, nonl; en_fio() { ftnint one=1; return(do_fio(&one,(char *)NULL,0l)); } do_fio(number,ptr,len) ftnint *number; ftnlen len; char *ptr; { struct syl *p; int n,i; for(i=0;i<*number;i++,ptr+=len) { loop: switch(type_f((p= &syl[pc])->op)) { default: fprintf(stderr,"unknown code in do_fio: %d\n%s\n", p->op,fmtbuf); err(elist->cierr,100,"do_fio"); case NED: if((*doned)(p)) { pc++; goto loop; } pc++; continue; case ED: if(cnt[cp]<=0) { cp--; pc++; goto loop; } if(((ptr==NULL) return((*doend)()); cnt[cp]--; workdone=1; if((n=(*doed)(p,ptr,len))>0) err(elist->cierr,errno,"fmt"); if(n<0) err(elist->ciend,(EOF),"fmt"); continue; case STACK: cnt[++cp]=p->p1; pc++; goto loop; case RET: ret[++rp]=p->p1; pc++; goto loop; case GOTO: if(--cnt[cp]<=0) { cp--; rp--; pc++; goto loop; } pc=1+ret[rp--]; goto loop; case REVERT: rp=cp=0; pc = p->p1; if(ptr==NULL) return((*doend)()); if(!workdone) return(0); if((n=(*dorevert)()) != 0) return(n); goto loop; case COLON: if(ptr==NULL) return((*doend)()); pc++; goto loop; case NONL: nonl = 1; pc++; goto loop; case S: case SS: cplus=0; pc++; goto loop; case SP: cplus = 1; pc++; goto loop; case P: scale=p->p1; pc++; goto loop; case BN: cblank=0; pc++; goto loop; case BZ: cblank=1; pc++; goto loop; } } return(0); } fmt_bg() { workdone=cp=rp=pc=cursor=0; cnt[0]=ret[0]=0; } type_f(n) { switch(n) { default: return(n); case RET: return(RET); case REVERT: return(REVERT); case GOTO: return(GOTO); case STACK: return(STACK); case X: case SLASH: case APOS: case H: case T: case TL: case TR: return(NED); case F: case I: case IM: case A: case AW: case O: case L: case E: case EE: case D: case G: case GE: return(ED); } } char *ap_end(s) char *s; { char quote; quote= *s++; for(;*s;s++) { if(*s!=quote) continue; if(*++s!=quote) return(s); } if(elist->cierr) { errno = 100; return(NULL); } fatal(100, "bad string"); /*NOTREACHED*/ } VERT: return(REVERT); case GOTO: return(GOTO); case STACK: return(STACK); case X: case SLASH: case APOS: case H: case T: case TL: case TR: return(NED); case F: case I: case IM: case A: case AW: case O: case L: case E: case EE: case D: case G: case GE: return(ED); } } char *ap_end(s) char *s; { char quote; quote= *s++; for(;*s;s++) { if(*s!=quote) continue; if(*++s!=quote) return(s); } if(elist->cierr) { errno = 100; return(NULL); } fatal(100, "bad slib/libI77/fmt.h 644 0 33 1675 2413060111 6572 struct syl { int op,p1,p2,p3; }; #define RET 1 #define REVERT 2 #define GOTO 3 #define X 4 #define SLASH 5 #define STACK 6 #define I 7 #define ED 8 #define NED 9 #define IM 10 #define APOS 11 #define H 12 #define TL 13 #define TR 14 #define T 15 #define COLON 16 #define S 17 #define SP 18 #define SS 19 #define P 20 #define BN 21 #define BZ 22 #define F 23 #define E 24 #define EE 25 #define D 26 #define G 27 #define GE 28 #define L 29 #define A 30 #define AW 31 #define O 32 #define NONL 33 extern struct syl syl[]; extern int pc,parenlvl,revloc; extern int (*doed)(),(*doned)(); extern int (*dorevert)(),(*donewrec)(),(*doend)(); extern flag cblank,cplus,workdone, nonl; extern int dummy(); extern char *fmtbuf; extern int scale; typedef union { float pf; double pd; } ufloat; typedef union { short is; char ic; long il; } uint; #define GET(x) if((x=(*getn)())<0) return(x) #define VAL(x) (x!='\n'?x:' ') #define PUT(x) (*putn)(x) extern int cursor; A 30 #define AW 31 #define O 32 #define NONL 33 extern struct syl lib/libI77/fmtlib.c 644 0 33 720 2413060111 7222 #define MAXINTLENGTH 12 char *icvt(value,ndigit,sign, base) long value; int *ndigit,*sign; register int base; { static char buf[MAXINTLENGTH+1]; register int i; if(value>0) *sign=0; else if(value<0) { value = -value; *sign= 1; } else { *sign=0; *ndigit=1; buf[MAXINTLENGTH]='0'; return(&buf[MAXINTLENGTH]); } for(i=MAXINTLENGTH-1;value>0;i--) { *(buf+i)=(int)(value%base)+'0'; value /= base; } *ndigit=MAXINTLENGTH-1-i; return(&buf[i+1]); }  /,"lib/libI77/ftest.c 644 0 33 1477 2413060111 7124 #include "fio.h" #define FLOAT double cilist x,y; main(argc,argv) char **argv; { FLOAT dd[20]; int ret[22]; long one=1; int i,n,j; if(argc<2) { fprintf(stderr,"%s infmt [outfmt] [n]\n",argv[0]); exit(1); } setcilist(&x,5,argv[1],0,1,1); argc--; argv++; if(argc<2 || argv[1][0]!='(') setcilist(&y,6,argv[0],0,1,1); else { setcilist(&y,6,argv[1],0,1,1); argc--; argv++; } if(argc>=2) n=atoi(argv[1]); else n=1; j=0; ret[j++]=s_rsfe(&x); for(i=0;i=2) n=atoi(argv[1]); else n=1; j=0; ret[j++]=s_rsfe(&x); for(i=0;i= icend) err(svic->iciend,(EOF),"endfile"); if(icpos++ < svic->icirlen) return(*icptr++); else err(svic->icierr,110,"recend"); } z_putc(c) { if(icptr >= icend) err(svic->icierr,110,"inwrite"); if(icpos++ < svic->icirlen) *icptr++ = c; else err(svic->icierr,110,"recend"); return(0); } z_rnew() { icptr = svic->iciunit + (++icnum)*svic->icirlen; icpos = 0; } s_rsfi(a) icilist *a; { int n; if(n=c_si(a)) return(n); reading=1; doed=rd_ed; doned=rd_ned; getn=z_getc; dorevert = donewrec = y_ierr; doend = z_rnew; return(0); } s_wsfi(a) icilist *a; { int n; if(n=c_si(a)) return(n); reading=0; doed=w_ed; doned=w_ned; putn=z_putc; dorevert = donewrec = y_ierr; doend = z_wnew; return(0); } c_si(a) icilist *a; { fmtbuf=a->icifmt; if(pars_f(fmtbuf)<0) err(a->icierr,100,"startint"); fmt_bg(); sequential=formatted=1; external=0; cblank=cplus=scale=0; svic=a; icnum=icpos=0; icptr=svic->iciunit; icend=icptr+svic->icirlen*svic->icirnum; return(0); } z_wnew() { while(icpos++ < svic->icirlen) *icptr++ = ' '; icpos = 0; icnum++; } e_rsfi() { int n; n = en_fio(); fmtbuf = NULL; return(n); } e_wsfi() { int n; n = en_fio(); fmtbuf = NULL; if(icnum >= svic->icirnum) return(n); while(icpos++ < svic->icirlen) *icptr++ = ' '; return(n); } y_ierr() { err(elist->cierr, 110, "iio"); } sequential=formattedlib/libI77/inquire.c 644 0 33 3657 2413060111 7455 #include "fio.h" f_inqu(a) inlist *a; { flag byfile; int i; unit *p; char buf[256]; long x; if(a->infile!=NULL) { byfile=1; g_char(a->infile,a->infilen,buf); x=inode(buf); for(i=0,p=NULL;iinunitinunit>=0) { p= &units[a->inunit]; } else { p=NULL; } } if(a->inex!=NULL) if(byfile && x>0 || !byfile && p!=NULL) *a->inex=1; else *a->inex=0; if(a->inopen!=NULL) if(byfile) *a->inopen=(p!=NULL); else *a->inopen=(p!=NULL && p->ufd!=NULL); if(a->innum!=NULL) *a->innum= p-units; if(a->innamed!=NULL) if(byfile || p!=NULL && p->ufnm!=NULL) *a->innamed=1; else *a->innamed=0; if(a->inname!=NULL) if(byfile) b_char(buf,a->inname,a->innamlen); else if(p!=NULL && p->ufnm!=NULL) b_char(p->ufnm,a->inname,a->innamlen); if(a->inacc!=NULL && p!=NULL && p->ufd!=NULL) if(p->url) b_char("direct",a->inacc,a->inacclen); else b_char("sequential",a->inacc,a->inacclen); if(a->inseq!=NULL) if(byfile || p!=NULL && p->useek) b_char("yes",a->inseq,a->inseqlen); else b_char("no",a->inseq,a->inseqlen); if(a->indir!=NULL) if(byfile || p!=NULL && p->useek) b_char("yes",a->indir,a->indirlen); else b_char("no",a->indir,a->indirlen); if(a->infmt!=NULL) if(p!=NULL && p->ufmt) b_char("formatted",a->infmt,a->infmtlen); else if(p!=NULL) b_char("unformatted",a->infmt,a->infmtlen); if(a->inform!=NULL) b_char("yes",a->inform,a->informlen);(( if(a->inunf) if(byfile || p!=NULL && p->useek) b_char("yes",a->inunf,a->inunflen); else b_char("unknown",a->inunf,a->inunflen); if(a->inrecl!=NULL && p!=NULL) *a->inrecl=p->url; if(a->innrec!=NULL && p!=NULL && p->url>0) *a->innrec=ftell(p->ufd)/p->url+1; if(a->inblank && p!=NULL && p->ufmt) if(p->ublnk) b_char("zero",a->inblank,a->inblanklen); else b_char("blank",a->inblank,a->inblanklen); return(0); } >infmt,a->infmtlen); if(a->inform!=NULL) b_char("yes",a->inform,a->informlen);lib/libI77/lib.c 644 0 33 1031 2413060112 6530 #include "fio.h" setcilist(x,u,fmt,rec,xerr,end) cilist *x; char *fmt; { x->ciunit=u; x->cifmt=fmt; x->cirec=rec; x->cierr=xerr; x->ciend=end; } setolist(x,xunit,fname,sta,fm,rl,blnk,oerr) olist *x; char *fname,*sta,*fm,*blnk; { x->oerr=oerr; x->ounit=xunit; x->ofnm=fname; x->ofnmlen=strlen(fname); x->osta=sta; x->ofm=fm; x->orl=rl; x->oblnk=blnk; } stcllist(x,xunit,stat,cerr) cllist *x; char *stat; { x->cerr=cerr; x->cunit=xunit; x->csta=stat; } setalist(x,xunit,aerr) alist *x; { x->aunit=xunit; x->aerr=aerr; } t(x,u,fmt,rec,xerr,end) cilist *x; char *fmt; { x->ciunit=u; x->cifmt=fmt; x->cirec=rec; x->cierr=xerr; x->ciend=end; } setolist(x,xunit,fname,sta,fm,rl,blnk,oerr) olist *x; char *fname,*sta,*fm,*blnk; { x->oerr=oerr; x->ounit=xunit; x->ofnm=fname; x->ofnmlen=strlen(fname); x->osta=sta; x->ofm=fm; x->orl=rl; x->oblnk=blnk; } stcllist(x,xunit,stat,cerr) cllist *x; char *stat; { x->cerr=cerr; x->cunit=xunit; x->csta=stat; } setalist(x,xunit,aerr) alist *x; { x->aunitlib/libI77/lio.c 644 0 33 4115 2413060112 6553 #include "fio.h" #include "fmt.h" #include "lio.h" extern int l_write(); int t_putc(); s_wsle(a) cilist *a; { int n; if(!init) f_init(); if(n=c_le(a)) return(n); reading=0; external=1; formatted=1; putn = t_putc; lioproc = l_write; if(!curunit->uwrt) return(nowwriting(curunit)); else return(0); } e_wsle() { t_putc('\n'); recpos=0; return(0); } t_putc(c) { recpos++; putc(c,cf); } lwrt_I(n) ftnint n; { char buf[LINTW],*p; (void) sprintf(buf," %ld",(long)n); if(recpos+strlen(buf)>=LINE) { t_putc('\n'); recpos=0; } for(p=buf;*p;t_putc(*p++)); } lwrt_L(n, len) ftnint n; ftnlen len; { if(recpos+LLOGW>=LINE) { t_putc('\n'); recpos=0; } (void) wrt_L((uint *)&n,LLOGW, len); } lwrt_A(p,len) char *p; ftnlen len; { int i; if(recpos+len>=LINE) { t_putc('\n'); recpos=0; } t_putc(' '); for(i=0;i=LINE) { t_putc('\n'); recpos=0; } scale=0; (void) wrt_F((ufloat *)&n,LFW,LFD,(ftnlen)sizeof(n)); } else { if(recpos+LEW>=LINE) { t_putc('\n'); recpos=0; } (void) wrt_E((ufloat *)&n,LEW,LED,LEE,(ftnlen)sizeof(n)); } } lwrt_C(a,b) double a,b; { if(recpos+2*LFW+3>=LINE) { t_putc('\n'); recpos=0; } t_putc(' '); t_putc('('); lwrt_F(a); t_putc(','); lwrt_F(b); t_putc(')'); } l_write(number,ptr,len,type) ftnint *number,type; flex *ptr; ftnlen len; { int i; ftnint x; double y,z; float *xx; double *yy; for(i=0;i< *number; i++) { switch((int)type) { default: fatal(204,"unknown type in lio"); case TYSHORT: x=ptr->flshort; goto xint; case TYLONG: x=ptr->flint; xint: lwrt_I(x); break; case TYREAL: y=ptr->flreal; goto xfloat; case TYDREAL: y=ptr->fldouble; xfloat: lwrt_F(y); break; case TYCOMPLEX: xx= &(ptr->flreal); y = *xx++; z = *xx; goto xcomplex; case TYDCOMPLEX: yy = &(ptr->fldouble); y= *yy++; z = *yy; xcomplex: lwrt_C(y,z); break; case TYLOGICAL: lwrt_L(ptr->flint, len); break; case TYCHAR: lwrt_A((char *)ptr,len); break; } ptr = (flex *)((char *)ptr + len); } return(0); } case TYLONG: x=ptr->flint; xint: lwrt_I(x); break; case TYREAL: y=ptr->flreal; goto xfloat; case TYDREAL: y=ptr->fldouble; xfloat: lwrt_F(y); break; case TYCOMPLEX: xx= &(ptr->flreal); y = *xx++; z = *xx; goto xcomplex; case TYDCOMPLEX: yy = &(ptr->fldouble); y= *yy++; z = *yy; xcomplex: lwrt_C(y,z); break; case TYLOGICAL: lwrt_L(ptr->flint, len); break; case TYCHAR: lwrt_A((char *)plib/libI77/lio.h 644 0 33 1266 2413060112 6564 /* copy of ftypes from the compiler */ /* variable types * numeric assumptions: * int < reals < complexes * TYDREAL-TYREAL = TYDCOMPLEX-TYCOMPLEX */ #define TYUNKNOWN 0 #define TYADDR 1 #define TYSHORT 2 #define TYLONG 3 #define TYREAL 4 #define TYDREAL 5 #define TYCOMPLEX 6 #define TYDCOMPLEX 7 #define TYLOGICAL 8 #define TYCHAR 9 #define TYSUBR 10 #define TYERROR 11 #define NTYPES (TYERROR+1) #define LINTW 12 #define LINE 80 #define LLOGW 2 #define LLOW 1.0 #define LHIGH 10.0 #define LFW 12 #define LFD 8 #define LEW 16 #define LED 9 #define LEE 2 typedef union { short flshort; ftnint flint; float flreal; double fldouble; } flex; extern int scale; extern int (*lioproc)(); TYADDR 1 #define TYSHORT 2 #define TYLONG 3 #define TYREAL 4 #define TYDREAL 5 #define TYCOMPLEX 6 #define TYDCOMPLEX 7 #define TYLOGICAL 8 #define TYCHAR 9 #define TYSUBR 10 #define TYERROR 11 #define NTYPES (TYERROR+1) #define LINTW 12 #define LINE 80 #define LLOGW 2 #define LLOW 1.0 #define LHIGH 10.0 #define LFW 12 #definlib/libI77/lread.c 664 0 33 15731 2520521741 7120 #include "fio.h" #include "fmt.h" #include "lio.h" #include "ctype.h" extern char *fmtbuf; extern char *malloc(), *realloc(); int (*lioproc)(); #define isblnk(x) (ltab[x+1]&B) #define issep(x) (ltab[x+1]&SX) #define isapos(x) (ltab[x+1]&AX) #define isexp(x) (ltab[x+1]&EX) #define issign(x) (ltab[x+1]&SG) #define SX 1 #define B 2 #define AX 4 #define EX 8 #define SG 16 char ltab[128+1] = { /* offset one for EOF */ 0, 0,0,AX,0,0,0,0,0,0,0,SX,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, SX|B,0,AX,0,0,0,0,AX,0,0,0,SG,SX,SG,0,SX, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,EX,EX,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, AX,0,0,0,EX,EX,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; char l_comma, l_first; t_getc() { int ch; if(curunit->uend) return(EOF); if((ch=getc(cf))!=EOF) return(ch); if(feof(cf)) curunit->uend = 1; return(EOF); } e_rsle() { int ch; if(curunit->uend) return(0); while((ch=t_getc())!='\n' && ch!=EOF); return(0); } flag lquit; int lcount,ltype; char *lchar; double lx,ly; #define ERR(x) if(n=(x)) return(n) #define GETC(x) (x=t_getc()) l_read(number,ptr,len,type) ftnint *number,type; flex *ptr; ftnlen len; { int i,n,ch; double *yy; float *xx; for(i=0;i<*number;i++) { if(lquit) return(0); if(curunit->uend) err(elist->ciend, EOF, "list in") if(lcount == 0) { ltype = NULL; if(!l_first) l_comma = 0; else l_first = 0; for(;;) { GETC(ch); switch(ch) { case EOF: goto loopend; case ' ': case '\n': continue; case '/': lquit = 1; goto loopend; case ',': if(l_comma) { lcount = 1; (void) ungetc(ch, cf); goto loopend; } l_comma = 1; continue; default: (void) ungetc(ch, cf); goto rddata; } } } rddata: switch((int)type) { case TYSHORT: case TYLONG: case TYREAL: case TYDREAL: ERR(l_R()); break; case TYCOMPLEX: case TYDCOMPLEX: ERR(l_C()); break; case TYLOGICAL: ERR(l_L()); break; case TYCHAR: ERR(l_CHAR()); break; } loopend: if(lquit) return(0); if(feof(cf)) err(elist->ciend,(EOF),"list in") else if(ferror(cf)) { clearerr(cf); err(elist->cierr,errno,"list in") } if(ltype==NULL) goto bump; switch((int)type) { case TYSHORT: ptr->flshort=lx; break; case TYLOGICAL: case TYLONG: ptr->flint=lx; break; case TYREAL: ptr->flreal=lx; break; case TYDREAL: ptr->fldouble=lx; break; case TYCOMPLEX: xx=(float *)ptr; *xx++ = lx; *xx = ly; break; case TYDCOMPLEX: yy=(double *)ptr; *yy++ = lx; *yy = ly; break; case TYCHAR: b_char(lchar,(char *)ptr,len); break; } bump: if(lcount>0) lcount--; ptr = (flex *)((char *)ptr + len); } return(0); } l_R() { double a,b,c,d; int i,ch,sign=0,da,db,dc,dd; int poststar = 0; a=b=c=d=0; da=db=dc=0; if(lcount>0) return(0); ltype=NULL; da=rd_int(&a); if(da== -1) sign=da; if(GETC(ch)!='*') { (void) ungetc(ch,cf); db=1; b=a; a=1; } else db=rd_int(&b); if(db > 0) poststar = 1; if(G((ETC(ch)!='.') { dc=c=0; (void) ungetc(ch,cf); } else dc=rd_int(&c); if(dc > 0) poststar = 1; if(isexp(GETC(ch))) dd=rd_int(&d); else if(issign(ch)) { (void) ungetc(ch, cf); dd = rd_int(&d); } else { (void) ungetc(ch,cf); dd = 0; d=0; } if(dd > 0) poststar = 1; lcount=a; if(poststar == 0) return(0); if(db && b<0) { sign=1; b = -b; } for(i=0;i0) return(0); ltype=NULL; GETC(ch); if(ch!='(') { if(fscanf(cf,"%d",&lcount)!=1) if(!feof(cf)) err(elist->cierr,112,"complex format") else err(elist->cierr,(EOF),"lread"); if(GETC(ch)!='*') { (void) ungetc(ch,cf); if(!feof(cf)) err(elist->cierr,112,"no star") else err(elist->cierr,(EOF),"lread"); } if(GETC(ch)!='(') { (void) ungetc(ch,cf); return(0); } } lcount = 1; ltype=TYLONG; (void) fscanf(cf,"%lf",&lx); while(isblnk(GETC(ch)) || (ch == '\n')); if(ch!=',') { (void) ungetc(ch,cf); err(elist->cierr,112,"no comma"); } while(isblnk(GETC(ch))); (void) ungetc(ch,cf); (void) fscanf(cf,"%lf",&ly); while(isblnk(GETC(ch))); if(ch!=')') err(elist->cierr,112,"no )"); while(isblnk(GETC(ch))); if(ch != '\n') (void) ungetc(ch,cf); return(0); } l_L() { int ch; if(lcount>0) return(0); ltype=NULL; GETC(ch); if(isdigit(ch)) { (void) ungetc(ch,cf); (void) fscanf(cf,"%d",&lcount); if(GETC(ch)!='*') if(!feof(cf)) err(elist->cierr,112,"no star") else err(elist->cierr,(EOF),"lread"); } else (void) ungetc(ch,cf); if(GETC(ch)=='.') GETC(ch); switch(ch) { case 't': case 'T': lx=1; break; case 'f': case 'F': lx=0; break; default: if(isblnk(ch) || issep(ch) || ch==EOF) { (void) ungetc(ch,cf); return(0); } else err(elist->cierr,112,"logical"); } ltype=TYLONG; lcount = 1; while(!issep(GETC(ch)) && ch!=EOF); (void) ungetc(ch, cf); return(0); } #define BUFSIZE 128 l_CHAR() { int ch,size,i; char quote,*p; if(lcount>0) return(0); ltype=NULL; GETC(ch); if(isdigit(ch)) { (void) ungetc(ch,cf); (void) fscanf(cf,"%d",&lcount); if(GETC(ch)!='*') err(elist->cierr,112,"no star"); } else (void) ungetc(ch,cf); if(GETC(ch)=='\'' || ch=='"') quote=ch; else if(isblnk(ch) || (issep(ch) && ch != '\n') || ch==EOF) { (void) ungetc(ch,cf); return(0); } else err(elist->cierr,112,"no quote"); ltype=TYCHAR; if(lchar!=NULL) free(lchar); size=BUFSIZE; p=lchar=malloc((unsigned int)size); if(lchar==NULL) err(elist->cierr,113,"no space"); for(i=0;;) { while(GETC(ch)!=quote && ch!='\n' && ch!=EOF && ++iuwrt) return(nowreading(curunit)); else return(0); } c_le(a) cilist *a; { fmtbuf="list io"; if(a->ciunit>=MXUNIT || a->ciunit<0) err(a->cierr,101,"stler"); scale=recpos=0; elist=a; curunit = &units[a->ciunit]; if(curunit->ufd==NULL && fk_open(SEQ,FMT,a->ciunit)) err(a->cierr,102,"lio"); cf=curunit->ufd; if(!curunit->ufmt) err(a->cierr,103,"lio") return(0); } do_lio(type,number,ptr,len) ftnint *number,*type; flex *ptr; ftnlen len; { return((*lioproc)(number,ptr,len,*type)); } ; if(curunit->uwrt) return(nowreadinlib/libI77/open.c 644 0 33 4547 2413060114 6744 #include "sys/types.h" #include "sys/stat.h" #include "fio.h" extern char *mktemp(), *malloc(), *strcpy(); f_open(a) olist *a; { unit *b; int n; char buf[256]; cllist x; if(a->ounit>=MXUNIT || a->ounit<0) err(a->oerr,101,"open") b= &units[a->ounit]; if(b->ufd!=0) goto connected; unconnected: b->url=a->orl; if(a->oblnk && *a->oblnk=='b') b->ublnk=1; else b->ublnk=0; if(a->ofm==0) { if(b->url>0) b->ufmt=0; else b->ufmt=1; } else if(*a->ofm=='f') b->ufmt=1; else b->ufmt=0; if(a->osta==0) goto unknown; switch(*a->osta) { unknown: default: case 'o': if(a->ofnm==0) err(a->oerr,107,"open") g_char(a->ofnm,a->ofnmlen,buf); b->uscrtch=0; if(a->osta == 0) goto done; if(*a->osta=='o' && access(buf,0)) err(a->oerr,errno,"open") done: b->ufnm=(char *) malloc((unsigned int)(strlen(buf)+1)); if(b->ufnm==NULL) err(a->oerr,113,"no space"); (void) strcpy(b->ufnm,buf); b->uend=0; if(isdev(buf)) { b->ufd = fopen(buf,"r"); if(b->ufd==NULL) err(a->oerr,errno,buf) else b->uwrt = 0; } else { b->ufd = fopen(buf, "a"); if(b->ufd != NULL) b->uwrt = 1; else if((b->ufd = fopen(buf, "r")) != NULL) { (void) fseek(b->ufd, 0L, 2); b->uwrt = 0; } else err(a->oerr, errno, buf) } b->useek=canseek(b->ufd); if((b->uinode=inode(buf))==-1) err(a->oerr,108,"open") if(a->orl && b->useek) rewind(b->ufd); return(0); case 's': b->uscrtch=1; (void) strcpy(buf,"tmp.FXXXXXX"); (void) mktemp(buf); goto done; case 'n': b->uscrtch=0; if(a->ofnm==0) err(a->oerr,107,"open") g_char(a->ofnm,a->ofnmlen,buf); /*SYSDEP access*/ if(access(buf, 0) == -1) (void) close(creat(buf, 0666)); goto done; } connected: if(a->ofnm==0) { same: if(a->oblnk!= 0) b->ublnk= *a->oblnk== 'b'?0:1; return(0); } g_char(a->ofnm,a->ofnmlen,buf); if(inode(buf)==b->uinode) goto same; x.cunit=a->ounit; x.csta=0; x.cerr=a->oerr; if((n=f_clos(&x))!=0) return(n); goto unconnected; } fk_open(seq,fmt,n) ftnint n; { char nbuf[10]; olist a; (void) sprintf(nbuf,"fort.%ld",n); a.oerr=1; a.ounit=n; a.ofnm=nbuf; a.ofnmlen=strlen(nbuf); a.osta=NULL; a.oacc= seq==SEQ?"s":"d"; a.ofm = fmt==FMT?"f":"u"; a.orl = seq==DIR?1:0; a.oblnk=NULL; return(f_open(&a)); } isdev(s) char *s; { struct stat x; int j; if(stat(s, &x) == -1) return(0); if((j = (x.st_mode&S_IFMT)) == S_IFREG || j == S_IFDIR) return(0); else return(1); } =a->oerr; if((n=f_clos(&x))!=0) return(n); goto unconnected; } fk_open(seq,fmt,n) ftnint n; { char nbuf[10]; olist a; (void) sprintf(nbuf,"fort.%ld",lib/libI77/pwd.c 644 0 33 2314 2347040507 6575 /* * Print working (current) directory */ #include #include #include char dot[] "."; char dotdot[] ".."; char root[] "/"; char name[512]; int file; int off -1; struct stat x; struct direct y; main() { for (;;) { stat(dot, &x); if ((file = open(dotdot,0)) < 0) prname(); do { if (read(file, &y, sizeof(y)) < sizeof(y)) prname(); } while (y.d_ino != x.st_ino); close(file); if (y.d_ino == 2) ckroot(); cat(); chdir(dotdot); } } ckroot() { register i; if (stat(y.d_name,&x)<0 || chdir(root)<0 || (file=open(root,0))<0) prname(); i = x.st_dev; do { if (read(file,&y,sizeof(y)) < sizeof(y)) prname(); if (y.d_ino == 0) continue; if (stat(y.d_name,&x) < 0) prname(); } while (x.st_dev!=i || (x.st_mode&S_IFMT)!=S_IFDIR); if (strcmp(dot, y.d_name) || strcmp(dotdot, y.d_name)) cat(); write(1, root, 1); prname(); } prname() { if (off<0) off = 0; name[off] = '\n'; write(1, name, off+1); exit(0); } cat() { register i, j; i = -1; while (y.d_name[++i] != 0); if ((off+i+2) > 511) prname(); for(j=off+1; j>=0; --j) name[j+i+1] = name[j]; off=i+off+1; name[i] = root[0]; for(--i; i>=0; --i) name[i] = y.d_name[i]; } f (stat(y.d_name,&x) < 0) prname(); } while (x.st_dev!=i || (x.st_mode&S_IFMT)!=S_IFDIR); if (strcmp(dot, y.d_name) || strcmp(dotdot, y.d_name)) cat(); write(1, root, 1); prname(); } prname() { if (off<0) off = 0; name[off] = '\n'; write(1, name, off+1); exit(0); } cat() { register i, j; lib/libI77/rdfmt.c 644 0 33 10523 2413060114 7126 #include "fio.h" #include "fmt.h" extern int cursor; rd_ed(p,ptr,len) char *ptr; struct syl *p; ftnlen len; { int ch; for(;cursor>0;cursor--) if((ch=(*getn)())<0) return(ch); if(cursor<0) { if(recpos+cursor < 0) err(elist->cierr,110,"fmt") if(curunit->useek) (void) fseek(cf,(long) cursor,1); else err(elist->cierr,106,"fmt"); cursor=0; } switch(p->op) { default: fprintf(stderr,"rd_ed, unexpected code: %d\n%s\n", p->op,fmtbuf); abort(); case I: ch = (rd_I((uint *)ptr,p->p1,len, 10)); brea((k; case IM: ch = (rd_I((uint *)ptr,p->p1,len, 10)); break; case O: ch = (rd_I((uint *)ptr, p->p1, len, 8)); break; case L: ch = (rd_L((ftnint *)ptr,p->p1)); break; case A: ch = (rd_A(ptr,len)); break; case AW: ch = (rd_AW(ptr,p->p1,len)); break; case E: case EE: case D: case G: case GE: case F: ch = (rd_F((ufloat *)ptr,p->p1,p->p2,len)); break; } if(ch == 0) return(ch); else if(feof(cf)) return(EOF); clearerr(cf); return(errno); } rd_ned(p) struct syl *p; { switch(p->op) { default: fprintf(stderr,"rd_ned, unexpected code: %d\n%s\n", p->op,fmtbuf); abort(); case APOS: return(rd_POS(p->p1)); case H: return(rd_H(p->p1,p->p2)); case SLASH: return((*donewrec)()); case TR: case X: cursor += p->p1; return(1); case T: cursor=p->p1-recpos - 1; return(1); case TL: cursor -= p->p1; return(1); } } rd_I(n,w,len, base) ftnlen len; uint *n; register int base; { long x=0; int i,sign=0,ch; for(i=0;iis=x; else if(len == sizeof(char)) n->ic = x; else n->il=x; return(0); } rd_L(n,w) ftnint *n; { int ch,i,v = -1; for(i=0;i='0') x=10*x+ch-'0'; else if(ch=='e' || ch=='d' || ch=='.') break; else if(cblank && (ch==' ' || ch== '\n')) x*=10; else if(ch==',') { i=w; break; } else return(errno = 115); } if(ch=='.') dot=1; while(i='0') y=10*y+ch-'0'; else if(cblank && (ch==' ' || ch == '\n')) y *= 10; else if(ch==',') {i=w; break;} else if(ch==' ') continue; else continue; ny++; } expon: if(ch=='-') sz=1; while(i='0') z=10*z+ch-'0'; else if(cblank && (ch==' ' || ch == '\n')) z *= 10; else if(ch==',') break; else if(ch==' ') continue; else if(ch=='+') continue; else if(ch!='\n') return(errno=115); } if(!dot) for(i=0;i0;i--) x /= 10; for(i=scale;i<0;i++) x *= 10; } if(len==sizeof(float)) p->pf=x; else p->pd=x; return(0); } rd_A(p,len) char *p; ftnlen len; { int i,ch; for(i=0;i=len) { for(i=0;icifmt; curunit= &units[a->ciunit]; cf=curunit->ufd; if(pars_f(fmtbuf)<0) err(a->cierr,100,"startio"); getn= x_getc; doed= rd_ed; doned= rd_ned; fmt_bg(); doend=x_endp; donewrec=xrd_SL; dorevert=x_rev; cblank=curunit->ublnk; cplus=0; if(curunit->uwrt) (void) nowreading(curunit); return(0); } xrd_SL() { int ch; if(!curunit->uend) while((ch=getc(cf))!='\n' && ch!=EOF); cursor=recpos=0; return(1); } x_getc() { int ch; if(curunit->uend) return(EOF); if((ch=getc(cf))!=EOF && ch!='\n') { recpos++; return(ch); } if(ch=='\n') { (void) ungetc(ch,cf); return(ch); } if(feof(cf)) { errno=0; curunit->uend=1; return(-1); } return(-1); } x_endp() { (void) xrd_SL(); return(0); } x_rev() { (void) xrd_SL(); return(0); } =0; if(curunit->uwrt) (void) nowreading(curunit); return(0); } xrd_SL() { int ch; if(!curunit->uend) while((ch=getc(cf))!='\n' && ch!=EOF); cursor=recpos=0; return(1); } x_getc() { int ch; if(curunit->uend) return(EOF); if((ch=getc(cf))!=EOF && ch!='\n') { recpos++; return(ch); } if(ch=='\n') { (void) ungetc(ch,cf); return(ch); } if(feof(cf)) { errno=0; curunit->uend=1; return(-1); } return(-1); } x_endp() { lib/libI77/sfe.c 644 0 33 671 2413060115 6533 /* sequential formatted external common routines*/ #include "fio.h" extern char *fmtbuf; e_rsfe() { int n; n=en_fio(); fmtbuf=NULL; return(n); } c_sfe(a) cilist *a; /* check */ { unit *p; if(a->ciunit >= MXUNIT || a->ciunit<0) err(a->cierr,101,"startio"); p = &units[a->ciunit]; if(p->ufd==NULL && fk_open(SEQ,FMT,a->ciunit)) err(a->cierr,114,"sfe") if(!p->ufmt) err(a->cierr,102,"sfe") return(0); } e_wsfe() { return(e_rsfe()); } ,5L /,"lib/libI77/stest.c 644 0 33 1347 2413060115 7141 #include "fio.h" #define out(a,b) {n=b;if(n==0) fprintf(stderr,"%s:%d\n",a,errno);else \ fprintf(stderr,"%s:%d %d\n",a,errno,n);} extern errno; olist xopen; cllist xclose; alist xaux; cilist xio; long one = 1; char xx[] = "1234"; char yy[] = "terrible junk"; main() { int n; setolist(&xopen,9,"junk","o","u",0,NULL,0); out("open",f_open(&xopen)); setalist(&xaux,9,0); out("rew",f_rew(&xaux)); setcilist(&xio,9,NULL,0,0,0); out("start",s_wsue(&xio)); out("io",do_uio(&one,xx,(long)sizeof(xx)-1)); out("endw",e_wsue()); out("enf",f_end(&xaux)); out("bck",f_back(&xaux)); out("bck",f_back(&xaux)); out("startr",s_rsue(&xio)); out("rio",do_uio(&one,yy,(long)sizeof(xx)-1)); out("endr",e_rsue()); fprintf(stdout,"yy: %s\n",yy); } char yy[] = "terrible junk"; main() { int n; setolist(&xopen,9,"junk","o","u",0,NULL,0); out("open",f_open(&xopen)); setalist(&xaux,9,0); out("rew",f_rew(&xaux)); setcilist(&xio,9,NULL,0,0,0); out("start",s_wsue(&xio)); out("io",do_uio(&one,xx,(long)sizeof(xx)-1)); out("lib/libI77/sue.c 644 0 33 2367 2413060115 6576 ((#include "fio.h" extern int reclen; long recloc; s_rsue(a) cilist *a; { int n; if(!init) f_init(); if(n=c_sue(a)) return(n); reading=1; recpos=0; if(curunit->uwrt) (void) nowreading(curunit); if(fread((char *)&reclen,sizeof(int),1,cf) != 1) { if(feof(cf)) { curunit->uend = 1; err(a->ciend, EOF, "start"); } clearerr(cf); err(a->cierr, errno, "start"); } return(0); } s_wsue(a) cilist *a; { int n; if(!init) f_init(); if(n=c_sue(a)) return(n); reading=0; reclen=0; if(!curunit->uwrt) (void) nowwriting(curunit); recloc=ftell(cf); (void) fseek(cf,(long)sizeof(int),1); return(0); } c_sue(a) cilist *a; { if(a->ciunit >= MXUNIT || a->ciunit < 0) err(a->cierr,101,"startio"); external=sequential=1; formatted=0; curunit = &units[a->ciunit]; elist=a; if(curunit->ufd==NULL && fk_open(SEQ,UNF,a->ciunit)) err(a->cierr,114,"sue"); cf=curunit->ufd; if(curunit->ufmt) err(a->cierr,103,"sue") if(!curunit->useek) err(a->cierr,103,"sue") return(0); } e_wsue() { long loc; (void) fwrite((char *)&reclen,sizeof(int),1,cf); loc=ftell(cf); (void) fseek(cf,recloc,0); (void) fwrite((char *)&reclen,sizeof(int),1,cf); (void) fseek(cf,loc,0); return(0); } e_rsue() { (void) fseek(cf,(long)(reclen-recpos+sizeof(int)),1); return(0); } nits[a->ciunit]; elist=a; if(curunit->ufd==NULL && fk_open(SEQ,UNF,a->ciunit)) err(a->cierr,114,"sue"); cf=curunit->ufd; if(curunit->ufmt) err(a->cierr,103,"sue") if(!curunit->useek) err(a->cierr,103,"sue") return(0); } e_wsue() { long loc; (void) fwrite((lib/libI77/uio.c 644 0 33 1557 2413060115 6576 #include "fio.h" int reclen; do_us(number,ptr,len) ftnint *number; ftnlen len; char *ptr; { if(reading) { recpos += *number * len; if(recpos>reclen) { err(elist->cierr,110,"eof/uio"); } (void) fread(ptr,(int)len,(int)(*number),cf); return(0); } else { reclen += *number * len; (void) fwrite(ptr,(int)len,(int)(*number),cf); return(0); } } do_uio(number,ptr,len) ftnint *number; ftnlen len; char *ptr; { if(sequential) return(do_us(number,ptr,len)); else return(do_ud(number,ptr,len)); } do_ud(number,ptr,len) ftnint *number; ftnlen len; char *ptr; { recpos += *number * len; if(recpos > curunit->url && curunit->url!=1) err(elist->cierr,110,"eof/uio"); if(reading) { if(fread(ptr,(int)len,(int)(*number),cf) != *number) err(elist->cierr,27,"eof/uio") else return(0); } (void) fwrite(ptr,(int)len,(int)(*number),cf); return(0); } o_uio(number,ptr,len) ftnint *number; ftnlen len; char *ptr; { if(sequential) return(do_us(number,ptr,len)); else return(do_ud(number,ptr,lenlib/libI77/util.c 644 0 33 1721 2413060116 6751 #include #include #include #include "fio.h" #define DIRSIZE 14 g_char(a,alen,b) char *a,*b; ftnlen alen; { char *x=a+alen-1,*y=b+alen-1; *(y+1)=0; for(;x>=a && *x==' ';x--) *y--=0; for(;x>=a;*y--= *x--); } b_char(a,b,blen) char *a,*b; ftnlen blen; { int i; for(i=0;iy) for(;num>0;num--) *y++= *x++; else for(num--;num>=0;num--) *(y+num)= *(x+num); } else { register char *x=a,*y=b; if(x>y) for(;num>0;num--) *y++= *x++; else for(num--;num>=0;num--) *(y+num)= *(x+num); } } DONE {*bufpos++=0; (void) close(file); return;}lib/libI77/wrtfmt.c 644 0 33 12364 2413060116 7344 #include "fio.h" #include "fmt.h" extern int cursor; extern char *icvt(), *ecvt(); mv_cur() { /*buggy, could move off front of record*/ for(;cursor>0;cursor--) (*putn)(' '); if(cursor<0) { if(cursor+recpos<0) err(elist->cierr,110,"left off"); if(curunit->useek) (void) fseek(cf,(long)cursor,1); else err(elist->cierr,106,"fmt"); cursor=0; } return(0); } w_ed(p,ptr,len) char *ptr; struct syl *p; ftnlen len; { if(mv_cur()) return(mv_cur()); switch(p->op) { default: fprintf(stderr,"w_ed, unexpected code: %d\n%s\n", p->op,fmtbuf); abort(); case I: return(wrt_I((uint *)ptr,p->p1,len, 10)); case IM: return(wrt_IM((uint *)ptr,p->p1,p->p2,len)); case O: return(wrt_I((uint *)ptr, p->p1, len, 8)); case L: return(wrt_L((uint *)ptr,p->p1, len)); case A: return(wrt_A(ptr,len)); case AW: return(wrt_AW(ptr,p->p1,len)); case D: case E: case EE: return(wrt_E((ufloat *)ptr,p->p1,p->p2,p->p3,len)); case G: case GE: return(wrt_G((ufloat *)ptr,p->p1,p->p2,p->p3,len)); case F: return(wrt_F((ufloat *)ptr,p->p1,p->p2,len)); } } w_ned(p) struct syl *p; { switch(p->op) { default: fprintf(stderr,"w_ned, unexpected code: %d\n%s\n", p->op,fmtbuf); abort(); case SLASH: return((*donewrec)()); case T: cursor = p->p1-recpos - 1; return(1); case TL: cursor -= p->p1; return(1); case TR: case X: cursor += p->p1; return(1); case APOS: return(wrt_AP(p->p1)); case H: return(wrt_H(p->p1,p->p2)); } } wrt_I(n,w,len, base) uint *n; ftnlen len; register int base; { int ndigit,sign,spare,i; long x; char *ans; if(len==sizeof(short)) x=n->is; else if(len == sizeof(char)) x = n->ic; else x=n->il; ans=icvt(x,&ndigit,&sign, base); spare=w-ndigit; if(sign || cplus) spare--; if(spare<0) for(i=0;iis; else if(len == sizeof(char)) x = n->ic; else x=n->il; ans=icvt(x,&ndigit,&sign, 10); if(sign || cplus) xsign=1; else xsign=0; if(ndigit+xsign>w || m+xsign>w) { for(i=0;i=m) spare=w-ndigit-xsign; else spare=w-m-xsign; for(i=0;iis; else if(sz == sizeof(char)) x = n->ic; else x=n->il; for(i=0;i 0) (*putn)(*p++); return(0); } wrt_AW(p,w,len) char * p; ftnlen len; { while(w>len) { w--; (*putn)(' '); } while(w-- > 0) (*putn)(*p++); return(0); } wrt_E(p,w,d,e,len) ufloat *p; ftnlen len; { char *s; int dp,sign,i,delta; char *ecvt(); if(scale>0) d++; s=ecvt( (len==sizeof(float)?p->pf:p->pd) ,d,&dp,&sign); if(sign || cplus) delta=6; else delta=5; if(w -d) { (*putn)('.'); for(i=0;i<-scale;i++) (*putn)('0'); for(i=0;i0 && scalepf != 0) dp -= scale; else dp = 0; if(dp < 100 && dp > -100) (*putn)('e'); if(dp<0) { (*putn)('-'); dp = -dp; } else (*putn)('+'); if(e>=3 || dp >= 100) { (*putn)(dp/100 + '0'); dp = dp % 100; } if(e!=1) (*putn)(dp/10+'0'); (*putn)(dp%10+'0'); return(0); } wrt_G(p,w,d,e,len) ufloat *p; ftnlen len; { double up = 1,x; int i,oldscale=scale,n,j; x= len==sizeof(float)?p->pf:p->pd; if(x < 0 ) x = -x; if(x<.1) return(wrt_E((ufloat *)p,w,d,e,len)); for(i=0;i<=d;i++,up*=10) { if(x>up) continue; scale=0; if(e==0) n=4; else n=e+2; i=wrt_F(p,w-n,d-i,len); for(j=0;jpf:p->pd); if(scale) { if(scale>0) for(i=0;i=d) sign=0; if(sign || cplus) delta=2; else delta=1; n= w - (d+delta+(dp>0?dp:0)); if(n<0) { for(i=0;ipf:p->pd); if(scale) { if(scale>0) for(i=0;i=d) sign=0; if(sign || cplus) delta=2; else delta=1; n= w - (d+delta+(dp>0?dp:0)); if(n<0) { for(i=0;icifmt; curunit = &units[a->ciunit]; cf=curunit->ufd; if(pars_f(fmtbuf)<0) err(a->cierr,100,"startio"); putn= x_putc; doed= w_ed; doned= w_ned; doend=xw_end; dorevert=xw_rev; donewrec=x_wSL; fmt_bg(); cplus=0; cblank=curunit->ublnk; if(!curunit->uwrt) (void) nowwriting(curunit); return(0); } x_putc(c) { recpos++; putc(c,cf); } pr_put(c) { static flag new = 1; recpos++; if(c=='\n') { new=1; putc(c,cf); } else if(new==1) { new=0; if(c=='0') putc('\n',cf); else if(c=='1') putc('\f',cf); } else putc(c,cf); } x_wSL() { (*putn)('\n'); recpos=0; cursor = 0; return(1); } xw_end() { if(nonl == 0) (*putn)('\n'); return(0); } xw_rev() { if(workdone) (*putn)('\n'); return(workdone=0); } cplus=0; cblank=curunit->ublnk; if(!curunit->uwrt) (void) nowwriting(curunit); return(0); } x_putc(c) { recpos++; putc(c,cf); } pr_put(c) { static flag new = 1; recpos++; if(c=='\n') { new=1; putc(c,cf); } else if(new==1) { new=0; if(c=='0') putc('\n',cf); else if(c=='1') putc('\f',cf); } else putc(c,cf); } x_wSL() { (*putn)('\n'); recpos=0; cursor = 0; return(1); } xw_end() { if(nonl == 0) (*putn)('\n'); return(0); } xw_rev() { iflib/libI77/Version.c 644 0 33 203 2413060106 7372 static char junk[] = "\n@(#) LIBI77 VERSION 2.02 2 AUGUST 1980\n"; /* 2.01 $ format added 2.02 Coding bug in open.c repaired */ return(0); } x_putc(c) { recpos++; putc(c,cf); } pr_put(c) { static flag new = 1; recpos++; if(c=='\n') { new=1; putc(c,cf); } else if(new==1) { new=0; if(c=='0') putc('\n',cf); else if(c=='1') putc('\f',cf); } else putc(c,cf); } x_wSL() { (*putn)('\n'); recpos=0; curso/,5 /,"lib/libI77/errs 664 0 33 2535 2520523450 6540 cc -O -c backspace.c ar ru libI77.a backspace.o ar: creating libI77.a rm backspace.o > backspace.x cc -O -c dfe.c ar ru libI77.a dfe.o rm dfe.o > dfe.x cc -O -c due.c ar ru libI77.a due.o rm due.o > due.x cc -O -c iio.c ar ru libI77.a iio.o rm iio.o > iio.x cc -O -c inquire.c ar ru libI77.a inquire.o rm inquire.o > inquire.x cc -O -c lib.c ar ru libI77.a lib.o rm lib.o > lib.x cc -O -c rewind.c ar ru libI77.a rewind.o rm rewind.o > rewind.x cc -O -c rsfe.c ar ru libI77.a rsfe.o rm rsfe.o > rsfe.x cc -O -c rdfmt.c ar ru libI77.a rdfmt.o rm rdfmt.o > rdfmt.x cc -O -c sue.c ar ru libI77.a sue.o rm sue.o > sue.x cc -O -c uio.c ar ru libI77.a uio.o rm uio.o > uio.x cc -O -c wsfe.c ar ru libI77.a wsfe.o rm wsfe.o > wsfe.x cc -O -c sfe.c ar ru libI77.a sfe.o rm sfe.o > sfe.x cc -O -c fmt.c ar ru libI77.a fmt.o rm fmt.o > fmt.x cc -O -c lio.c ar ru libI77.a lio.o rm lio.o > lio.x cc -O -c lread.c ar ru libI77.a lread.o rm lread.o > lread.x cc -O -c open.c ar ru libI77.a open.o rm open.o > open.x cc -O -c close.c ar ru libI77.a close.o rm close.o > close.x cc -O -c util.c ar ru libI77.a util.o rm util.o > util.x cc -O -c endfile.c ar ru libI77.a endfile.o rm endfile.o > endfile.x cc -O -c wrtfmt.c ar ru libI77.a wrtfmt.o rm wrtfmt.o > wrtfmt.x cc -O -c err.c ar ru libI77.a err.o rm err.o > err.x cc -O -c fmtlib.c ar ru libI77.a fmtlib.o rm fmtlib.o > fmtlib.x lio.o rm lio.o > lio.x cc -O -c lread.c ar ru libI77.a lread.o rm lread.o > lread.x cc -O -c open.c ar ru libI77.a open.o rm open.o > open.x cc -O -c close.c ar rlib/libI77uc/ 775 0 33 0 2552602210 6075 lib/libI77uc/Makefile 644 0 33 5152 2552602133 7627 # Makefile for the f77 I/O library # @(#)Makefile 1.7 2/27/81 # Originally written by P. Weinberger, Bell Labs, Murray Hill, N.J. # Modified by D. Wasley, Univ of California, Berkeley, Calif. # for 11's #LIBDIR = /usr/ucb/lib # for Vax LIBDIR = $(DESTDIR)/usr/lib LIB = libI77uc.a LIB66 = libI66.a CFLAGS = -O TAPE = /dev/rnmt0.16 SOURCES = backspace.c close.c dballoc.c dfe.c due.c endfile.c err.c fmt.c \ fmtlib.c iio.c inquire.c lwrite.c lread.c dolio.c open.c \ rdfmt.c rewind.c sfe.c sue.c douio.c util.c wrtfmt.c \ dofio.c f_errlist.c f_errno.h fiodefs.h fio.h format.h lio.h \ yes_66.c no_66.c OBJECTS = dfe.o due.o iio.o sue.o sfe.o lread.o lwrite.o \ dofio.o douio.o dolio.o \ rdfmt.o wrtfmt.o fmt.o fmtlib.o \ backspace.o rewind.o open.o close.o endfile.o inquire.o \ dballoc.o err.o util.o f_errlist.o all: $(LIB) $(LIB66) $(LIB): $(OBJECTS) Version no_66.o @echo Loading @rm -f $(LIB) @ar rc $(LIB) $(OBJECTS) Version no_66.o @chmod 664 $(LIB) @echo "" > /dev/tty $(LIB66): $(OBJECTS) yes_66.o @rm -f $(LIB66) @mv yes_66.o $(LIB66) install: cp $(LIB) $(LIBDIR)/$(LIB) cp $(LIB66) $(LIBDIR)/$(LIB66) ranlib $(LIBDIR)/$(LIB) backspace.o: fio.h backspace.c dfe.o: fio.h dfe.c due.o: fio.h due.c iio.o: fio.h lio.h iio.c inquire.o: fio.h inquire.c rewind.o: fio.h rewind.c rdfmt.o: fio.h format.h rdfmt.c sue.o: fio.h sue.c douio.o: fio.h douio.c sfe.o: fio.h sfe.c fmt.o: fio.h format.h fmt.c dofio.o: fio.h format.h dofio.c lwrite.o: fio.h lio.h lwrite.c lread.o: fio.h lio.h lread.c dolio.o: fio.h lio.h dolio.c open.o: fio.h open.c close.o: fio.h close.c util.o: fio.h util.c endfile.o: fio.h endfile.c wrtfmt.o: fio.h format.h wrtfmt.c err.o: fiodefs.h err.c fmtlib.o: fio.h fmtlib.c dballoc.o: dballoc.c fio.h: fiodefs.h #fiodefs.h: f_errno.h # compile, then strip unnecessary symbols .c.o: cc $(CFLAGS) -c $*.c -ld -r -x $*.o mv a.out $*.o f_errlist.o: f_errlist.c cc $(CFLAGS) -c f_errlist.c Version: $(SOURCES) mkvers @rm -f Version.c mkvers $(LIB) $(SOURCES) > Version.c cc -c Version.c mv Version.o Version mkvers: mkvers.c @cc mkvers.c -o mkvers clean: rm -f *.o $(LIB) tags mkvers Version index: $(SOURCES) mkindx @mkindx "f77 libI77.a Source Listing " Makefile $(SOURCES) print: index @pr index Makefile `ls $(SOURCES)` | lpr mkindx: mkindx.c @cc mkindx.c -o mkindx writeup: writeup.tx @-rm writeup @nroff -ms writeup.tx > writeup wup: writeup.tx @nroff -ms writeup.tx | ul | more tape: @tar cbf 20 $(TAPE) mkvers.c mkindx.c \ Makefile READ_ME NEWS writeup.tx writeup $(SOURCES) order: @rm -f order @lorder $(OBJECTS) | tsort >order tags: $(SOURCES) @ctags $(SOURCES) rs Version index: $(SOURCES) mkindx @mkindx "f77 libI77.a Source Listing " Makefile $(SOURCES) print: index @pr index Makefile `ls $(SOURCES)` | lpr mkindx: mkindx.c @cc mkindx.c -o mkindx writeup: writeup.tx @-rm writeup @nroff -ms writeup.tx > writeup wup: writeup.tx @nroff -ms writeup.tx | ul | more tape: @tar cbf 20 $(TAPE) mkvers.c mkindx.c \ Makefile READ_ME NEWS writeup.tx writeup lib/libI77uc/READ_ME 644 0 33 3764 2311077641 7220 ((Last update: Jan 1980 The sources here represent a major update of the f77 i/o library. In almost all cases routines conform to the ANSI standard. The only known exceptions are the "print" file form in `open' and `inquire', and the "+" vertical format control (still not implemented). Often relaxations or extensions of the standard have been incorporated. See the writeup file for details of the new library. The non-ANSI extensions can be eliminated from the library by changing the Makefile to compile with -DKOSHER. There may be some minor incompatabilities between the Vax 'C' compiler and 'C' on other machines that may cause problems with this code. The default definition of 'int' for example. I don't expect it to be a major problem. Please do send WELL DOCUMENTED bug reports to me. A modified I/O code generation routine for the compiler is included in this directory. It include 2 compile time options. One option affects the handling of the iostat= clause: unless compiled with -DKOSHER or -DIOSRETURN an iostat= clause by itself will not cause a return on any error. Return is made only if one of the err= or end= clauses is present. The other option, suppressed with -DKOSHER, is that end= is allowed in write statements. This copy of 'io.c' is included on the distribution tape. -+-+-+-+-+- To use the tape: 1. Load, using tar, into an appropriate directory. This is basically the source for libI77 so /usr/src/libI77 would be appropriate. 2. Link or copy or move 'io.c' into the source directory for f77pass1. Usually /usr/src/cmd/f77. NOTE Jan, 1980: This may be /usr/src/cmd/f77/vaxvax 3. 'make f77pass1', 'make install' while in the /f77 directory. 4. Return to the /libI77 directory. 'make lib' if necessary. Otherwise 'make install' to put the new lib in place. 5. If you modify the writeup.tx file, you can 'make writeup' to create the nroff'ed version. -+-+-+-+-+- David Wasley 431 Davis Hall University of California Berkeley, Calif. 94720 (415) 642-3478 e directory lib/libI77uc/NEWS 644 0 33 5422 2337323457 6700 Update info on the f77 I/O lib. 01 Feb, 1980 All instances of: if(!init) f_init(); have been removed. f_init() is called from main.c on startup in the new libF77.a . 01 Feb, 1980 Backspace now allows non-seek files to reset the EOF flag. 20 Mar, 1980 The way SIGINT is handled in libF77/main.c has been changed. If the signal is not SIG_DFL, it is left alone as otherwise the program will be killed if run in the background and the user types DEL. The signal trap that used to be in the I/O lib has been removed. 20 Mar, 1980 The ANSI fortran standard requires that I/O routines return to the caller on any error condition if iostat= is specified even if no err= or end= trap is specified. The implication of this is that the program must be prepared to deal with ALL I/O errors if iostat= is specified. If only one trap is specified, end= for example, the program must test the iostat variable for positive/non-zero after the I/O call since return will occur on any error. This seems awkward and I've chosen to make this feature optional. I am interested in other views on this. In the current version of the compiler (using the modified io.c), iostat= is used only to return status information from I/O calls but does not itself cause return on any I/O error. Only the traps, err= and end=, will cause a return/branch, and only for the specified trap(s). This feature has been made a compile time option in the current version of (modified) io.c It implements the standard correctly if compiled with -DKOSHER or -DIOSRETURN. Otherwise it executes as currently implemented. 18 Apr, 1980 As originally implemented the '$' specification caused a NULL to be output (inplace of the \n) Actually NULL's should never appear in the formatted output streams. Therefore in "sfe.c" in x_putc() and pr_put() add if (c) before the instances of putc(c,cf) 12 May, 1980 Spaces (ASCII 040) do not have significance in FORMAT statements except within strings. In order to accomodate old programs that may have arbitrary occurances of spaces, all spaces are now ignored. Thus the format ( 1 0 X , 1 2 F 1 0 . 4 / ) is accepted. 12 May, 1980 A bug in handling partially filled "unformatted direct" records has been fixed by ensuring that all records are complete when written. The bug was that the last record of such a file would cause EOF if a read was attempted for a full record. Existing files of this form should be "fixed" by reading and rewriting the last record using the new version of libI77.a 12 May, 1980 BACKSPACE will now open a default file (fort.N) if the specified logical unit is not open. REWIND and other I/O already did this. CLOSE and ENDFILE do not open a default file. has been fixed by ensuring that all records are complete when written. The bug was that the last record of such a file would cause EOF if a read was attempted for a full record. Existing files of this form should be "fixed" by lib/libI77uc/writeup.tx 644 0 33 37404 2462453575 10306 .ND .nr ll 7.0i .nr LL 7.0i .po 0.0i .rm PT .rm BT .LP .TL Introduction to the f77 I/O Library September 1980 .PP The fortran-77 I/O library, libI77.a, includes routines to perform all of the standard types of FORTRAN input and output. Several enhancements and extensions to FORTRAN I/O have been added. The f77 library routines use the C stdio library routines to provide efficient buffering for file I/O. .PP Some general concepts regarding f77 I/O deserve clarification. There are three forms of I/O: .B formatted, .B unformatted, and .B list-directed. The last is related to formatted but does not obey all the rules for formatted I/O. There are two modes of access to .B external and .B internal files: .B direct and .B sequential. The definition of a logical record depends upon the combination of I/O form and mode specified by the fortran I/O statement. .PP A logical record in a .B direct access .B external file is a string of bytes of a length specified when the file is opened. Read and write statements must not specify logical records longer than the original record size definition. Shorter logical records are allowed. .I Unformatted direct writes leave the unfilled part of the record undefined. .I Formatted direct writes cause the unfilled record to be padded with blanks. .PP Logical records in .B sequentially accessed .B external files may be of arbitrary and variable length. Logical record length for .I unformatted sequential files is determined by the size of items in the iolist. For .I formatted write statements, logical record length is determined by the format statement interacting with the iolist at execution time. Formatted sequential access causes one or more logical records ending with 'newline' characters to be read or written. .PP Logical record length for .B list-directed I/O is relatively meaningless. On output, the record length is dependent on the magnitude of the data items. On input, the record length is determined by the data types and the file contents. .PP The logical record length for an .B internal read or write is the length of the character variable or array element. Thus a simple character variable is a single logical record. A character variable array is similar to a fixed length direct access file, and obeys the same rules. .I Unformatted I/O is not allowed on "internal" files. .PP Note that each execution of a fortran unformatted I/O statement causes a single logical record to be read or written. Each execution of a fortran formatted I/O statement causes one or more logical records to be read or written. .PP Any error detected during I/O processing will cause the program to abort unless alternate action has been provided for specifically in the program. Any I/O statement may include an err= clause (and iostat= clause) to specify an alternate branch to be taken on errors (and return the specific error code). Read statements may include end= to branch on end-of-file. File position and the value of I/O list items is undefined following an error. I. Implementation details. .PP The maximum number of logical units that a program may have open at one time has been set to correspond with the UNIX system limit, currently 20. However, the I/O library uses UNIX file access for internal purposes. Therefore fatal errors are possible if the maximum number of files are open. Specifically, 'close' or 'endfile' on an old file, and "'inquire' by file" may fail. .PP Vertical format control is implemented. The logical unit must be opened for sequential access and "form = 'print'" (see below). Control codes '0' and '1' are replaced in the output file with '\\n' and '\\f' respectively. The control character '+' isn't implemented and, like any other character in the first position of a record written to a "print" file, is dropped. No vertical format control is recognized for direct formatted output or list directed output. .PP By default, logical units 0, 5, and 6 are opened to ``stderr'', ``stdin'', and ``stdout'' respectively. However they can be re-defined with an 'open' statement. To preserve error reporting, ((it is an error to close logical unit 0. If you want to open the default filename for any preconnected logical unit, remember to 'close' the unit first. Redefining the standard units may impair normal console I/O. An alternative is to use shell re-direction to externally re-define the above units. To re-define default blank control or format of the standard input or output files, use the 'open' statement specifying the unit number and no filename (see below). .PP An 'open' statement need not specify a filename. If it refers to a logical unit that is already open, the "blank= " and "form= " specifiers may be redefined without affecting the current file position. Otherwise, if "status='scratch'" is specified, a temporary file with a name of the form 'tmp.FXXXXXX' will be opened, and, by default, will be deleted when closed or during termination of program execution. Any other "status= " specifier without an associated filename results in opening a file named 'fort.N' where N is the specified logical unit number. It is an error to try to open an existing file with "status='new'". It is an error to try to open a nonexistent file with "status='old'". By default "status='unknown'" will be assumed, and a file will be created if necessary. Existing files are never truncated on opening but are positioned at the end-of-file. .PP Sequentially accessed external files are truncated to the current file position on 'close', 'backspace', or 'rewind' only if the last access to the file was a write. .PP Upper as well as lower case characters are recognized in format statements and all alphabetic arguments to the I/O library routines. This has always been true for statements that are part of the source code, but not for format statements or character arguments from a file. .PP If the external representation of a datum is too large for the field width specified, the specified field is filled with asterisks (*). On 'Ew.dEe' output, the e field will be filled with asterisks if the exponent representation is too large. (This will only happen if e==0) .PP List-directed output of complex values now includes an appropriate comma. List-directed output now distinguishes between real*4 and real*8 values and formats them differently. Output of a character string that includes '\\n' now works correctly. .PP If I/O errors are not trapped by the user's program an appropriate error message will be written to 'stderr' before aborting. An error number will be printed in [ ] along with a brief error message showing the logical unit and I/O state. Error numbers < 100 refer to UNIX errors, and are described in the introduction to chapter 2 of the UNIX Programmer's Manual. Error numbers >= 100 come from the I/O library, and are described further in the appendix to this writeup. For internal I/O, part of the string will be printed with '|' at the current position in the string. For external I/O, part of the current record will be displayed if the error was caused during reading from a file that can backspace. .PP Direct access list-directed I/O is not allowed. Unformatted internal I/O is not allowed. Both the above will be caught by the compiler. All other flavors of I/O are allowed, although some are not part of the ANSI standard. .PP The standard units, 0, 5, and 6, are now named internally 'stderr', 'stdin', and 'stdout' respectively. These are not actual filenames and can not be used for opening these units. \'inquire' will not return these names and will indicate that the above units are not named unless they have been opened to real files. The names are meant to make error reporting more meaningful. .PP On output, a real value that is truly zero will display as '0.' to distinguish it from a very small non-zero value. This occurs in 'F', 'E', 'D', and 'G' format conversions. .PP Non-destructive tabbing is implemented for both internal and external formatted I/O. Tabbing left or right on output does not affect previously written portions of a record. Tabbing right on output causes unwritten portions of a record to be filled with blanks. Tabbing left or right off the end of a logical record is an error. The format specifier 'T' must be followed by a positive non-zero number. If it is not, it will have a different meaning (See below). Note that spacing with 'X' always writes blanks in the output record. II. Non-"ANSI Standard" Extensions .PP B is an acceptable edit control specifier. It causes return to the default mode of blank interpretation (NULL) and is identical to BN. This is consistent with S which returns to default sign control. .PP P by itself is equivalent to 0P. It resets the scale factor to the default value, 0. .PP The form of the 'Ew.dEe' format specifier has been extended to 'D' also. The form 'Ew.d.e' is allowed but is not standard. The 'e' field specifies the minimum number of digits or spaces in the exponent field on output. If the value of the exponent is too large, the exponent notation 'e' or 'd' will be dropped from the output to allow one more character position. If this is still not adequate, the 'e' field will be filled with asterisks (*). The default value for 'e' is 2. .PP An additional form of tab control specification has been added. The ANSI standard forms 'TRn', 'TLn', and 'Tn' are supported where n is a positive non-zero number. If 'T' or 'nT' is specified, tabbing will be to the next (or n-th) 8-column tab stop. Thus columns of alphanumerics can be lined up without counting. (See above for a description of the tabbing implementation.) .PP A format control specifier has been added to suppress the newline at the end of the last record of a formatted sequential write. The specifier is a dollar sign ($). It is constrained by the same rules as the colon (:). It is used typically for console prompts. For example: .DS write (*, "('enter value for x: ',$)") read (*,*) x .DE .PP Radices other than 10 can be specified for formatted integer I/O conversion. The specifier is patterned after P, the pre-scale factor for floating point conversion. It remains in effect until another radix is specified or format interpretation is complete. The specifier is defined as [n]R where 2 <= n <= 36. If n is omitted, the default decimal radix is restored. .PP In conjunction with the above, a sign control specifier has been added to cause integer values to be interpreted as unsigned during output conversion. The specifier is SU and remains in effect until another sign control specifier is encountered, or format interpretation is complete. Radix and 'unsigned' specifiers could be used to format a hexadecimal dump, as follows: .DS 2000 format( SU, 16R, 8I10.8) .DE Note: Unsigned integer values greater than (2**30 - 1), i.e. any signed negative value, can not be read by FORTRAN input routines. All internal values will be output correctly. .PP The ANSI standard is ambiguous regarding the definition of a "print" file. Since UNIX has no default "print" file, an additional 'form' specifier is now recognized in the 'open' statement. Specifying "form='print'" implies 'formatted' and enables vertical format control for that logical unit (see above). Vertical format control is interpreted only on sequential formatted writes to a "print" file. .PP The 'inquire' statement will return 'print' in the 'FORM=' string variable for logical units opened as "print" files. It will return -1 for the unit number of an unconnected file. .PP If a logical unit is already open, an 'open' statement including the 'form=' option or the 'blank=' option will do nothing but re-define those options. This instance of the 'open' statement need not include the filename, and must not include a filename if 'unit=' refers to the standard input or outputs. Therefore, to re-define the standard output as a "print" file, use: .DS open (unit=6, form='print') .DE .PP In a 'close' statement, "status='keep'" may be specified for temporary files. This is the default for all other files. Remember to get the file's real name, using 'inquire', if you want to re-open it later. .PP List directed read has been modified to allow input of a string not enclosed in quotes. The string must not start with a digit, and can not contain a separator (, or /) or blank (space or tab). A newline will terminate the string unless escaped with \\. Any string not meeting the above restrictions must be enclosed in quotes (" or '). .PP Internal list-directed I/O has been implemented. During internal list reads, bytes are consummed until the iolist is satisfied, or the 'end-of-file' is reached. During internal list writes, records are filled until the iolist is satisfied. The length of an internal array element should be at least 20 bytes to avoid logical record overflow when writing double precision values. Internal list read was implemented to make command line decoding easier. Internal list write should be avoided. .bp .ce 2 Appendix A I/O Library Error Messages .PP The following error messages are generated by the I/O library. The error numbers are returned in the "iostat=" variable if the "err=" return is taken. Error numbers < 100 are generated by UNIX. See the UNIX Programmers Manual, introduction to chapter 2. .DS /* 100 */ "error in format" See error message output for the location of the error in the format. Can be caused by more than 10 levels of nested (), or an extremely long format statement. /* 101 */ "illegal unit number" It is illegal to close logical unit 0. Negative unit numbers are not allowed. The upper limit is system dependent. /* 102 */ "formatted io not allowed" The logical unit was opened for unformatted I/O. /* 103 */ "unformatted io not allowed" The logical unit was opened for formatted I/O. /* 104 */ "direct io not allowed" The logical unit was opened for sequential access, or the logical record length was specified as 0. /* 105 */ "sequential io not allowed" The logical unit was opened for direct access I/O. /* 106 */ "can't backspace file" The file associated with the logical unit can't seek. May be a device or a pipe. /* 107 */ "off beginning of record" The format specified a left tab off the beginning of the record. /* 108 */ "can't stat file" The system can't retur((n status information about the file. Perhaps the directory is unreadable. /* 109 */ "no * after repeat count" Repeat counts in list-directed I/O must be followed by an * with no blank spaces. .DE .DS /* 110 */ "off end of record" A formatted write tried to go beyond the logical end-of-record. An unformatted read or write will also cause this. /* 111 */ "truncation failed" The truncation of external sequential files on 'close', 'backspace', or 'rewind' tries to do a copy. It failed. Perhaps the temp file couldn't be created. /* 112 */ "incomprehensible list input" List input has to be just right. /* 113 */ "out of free space" The library dynamically creates buffers for internal use. You ran out of memory for this. Your program is too big! /* 114 */ "unit not connected" The logical unit was not open. /* 115 */ "read unexpected character" Certain format conversions can't tolerate non-numeric data. Logical data must be T or F. /* 116 */ "blank logical input field" /* 117 */ "'new' file exists" You tried to open an existing file with "status='new'". /* 118 */ "can't find 'old' file" You tried to open a non-existent file with "status='old'". /* 119 */ "unknown system error" Shouldn't happen, but ..... (Send me a documented example.) /* 120 */ "requires seek ability" Direct access requires seek ability. Sequential unformatted I/O requires seek ability on the file due to the special data structure required. Tabbing left also requires seek ability. /* 121 */ "illegal argument" Certain arguments to 'open', etc. will be checked for legitimacy. Often only non- default forms are looked for. /* 122 */ "negative repeat count" The repeat count for list directed input must be a positive integer. .DE a documented example.) /* 120 */ "requires seek ability" Direct access requires seek ability. Sequential unformatted I/O requires seek ability on the file due to the special data structure required. Tabbing left also requires seek ability. lib/libI77uc/backspace.c 644 0 33 2050 2475104644 10251 /* char id_backspace[] = "@(#)backspace.c 1.2"; * * Backspace records */ #include "fio.h" char *bksp = "backspace"; char last_char(); f_back(a) alist *a; { unit *b; int n,i; long x,y; lfname = NULL; elist = NO; external = YES; errflag = a->aerr; lunit = a->aunit; if (not_legal(lunit)) err(errflag,F_ERUNIT,bksp) b= &units[lunit]; if(!b->ufd && (n=fk_open(READ,SEQ,FMT,(ftnint)lunit)) ) err(errflag,n,bksp) lfname = b->ufnm; if(b->uend) { b->uend = NO; return(OK); } if((x=ftell(b->ufd))==0) return(OK); if(!b->useek) err(errflag,F_ERNOBKSP,bksp) if(b->uwrt) t_runc(b,errflag); if(b->url) /* direct access, purely academic */ { y = x%(long)b->url; x -= y?y:b->url; fseek(b->ufd,x,0); return(OK); } if(!b->ufmt) /* unformatted sequential */ { fseek(b->ufd,-(long)sizeof(int),1); fread((char *)&n,sizeof(int),1,b->ufd); fseek(b->ufd,-(long)n-2*sizeof(int),1); return(OK); } if(x==1) /* formatted sequential */ { rewind(b->ufd); return(OK); } while(last_char(b->ufd)!='\n'); /* slow but simple */ return(OK); } lag,F_ERNOBKSP,bksp) if(b->uwrt) t_runc(b,errflag); if(b->url) /* direct access, purely academic */ { y = x%(long)b->url; x -= y?y:b->url; fseek(b->ufd,x,0); return(OK); } if(!b->ufmt) /* unformatted sequential */ { fseek(b->ufd,-(long)sizeof(int),1); fread((char *)&n,sizeof(int),1,b->ufd); fseek(b->ufd,-(long)n-2*sizeof(int),1); return(OK); } if(x==1) /* formatted sequential */ { rewind(b->ufd); return(OK); } while(last_char(b->ufd)!='\n'lib/libI77uc/close.c 644 0 33 2167 2475104676 7460 /* char id_close[] = "@(#)close.c 1.2"; * * close.c - f77 file close, flush, exit routines */ #include "fio.h" #define FROM_OPEN '\1' f_clos(a) cllist *a; { unit *b; lfname = NULL; elist = NO; external = YES; errflag = a->cerr; lunit = a->cunit; if(not_legal(lunit)) err(errflag,F_ERUNIT,"close"); if(lunit==STDERR && (!a->csta || *a->csta != FROM_OPEN)) err(errflag,F_ERUNIT,"can't close stderr"); b= &units[lunit]; if(!b->ufd) err(errflag,F_ERNOPEN,"close"); if(a->csta) switch(lcase(*a->csta)) { delete: case 'd': fclose(b->ufd); if(b->ufnm) unlink(b->ufnm); /*SYSDEP*/ break; default: keep: case 'k': if(b->uwrt) t_runc(b,errflag); fclose(b->ufd); break; } else if(b->uscrtch) goto delete; else goto keep; if(b->ufnm) free(b->ufnm); b->ufnm=NULL; b->ufd=NULL; return(OK); } f_exit() { ftnint lu, dofirst = YES; cllist xx; xx.cerr=1; xx.csta=NULL; for(lu=STDOUT; (dofirst || lu!=STDOUT); lu = ++lu % MXUNIT) { xx.cunit=lu; f_clos(&xx); dofirst = NO; } } ftnint flush_(u) ftnint *u; { FILE *F = units[*u].ufd; if(F) return(fflush(F)); else return(F_ERNOPEN); } p: case 'k': if(b->uwrt) t_runc(b,errflag); fclose(b->ufd); break; } else if(b->uscrtch) goto delete; else goto keep; if(b->ufnm) free(b->ufnm); b->ufnm=NULL; b->ufd=NULL; return(OK); } f_exit() { ftnint lu, dofirst = YES; cllist xx; xx.cerr=1; xx.csta=NULL; for(lu=STDOUT; (dofirst || lu!=STDOUT); lu = ++lu % MXUNIT) { xx.cunit=lu; f_clos(&xx); dofirst = NO; lib/libI77uc/dballoc.c 644 0 33 6274 2475111057 7745 /* char id_dballoc[] = "@(#)dballoc.c 1.3"; * * C storage allocator * circular first-fit strategy * works with noncontiguous, but monotonically linked, arena * each block is preceded by a ptr to the (pointer of) * the next following block * blocks are exact number of words long; BUSY * bit in ptr is 1 for busy, 0 for idle * gaps in arena are merely noted as busy blocks * last block of arena (pointed to by alloct) is empty and * has a pointer to first * idle blocks are coalesced during space search */ #include #include "f_errno.h" /* all these defines must be powers of 2 */ #define WORD sizeof(struct store) #define BLOCK 1024 #define BUSY 1 #define NULL 0 #define testbusy(p) ((int)(p)&BUSY) #define setbusy(p) (struct store *)((int)(p)+BUSY) #define clearbusy(p) (struct store *)((int)(p)&~BUSY) /* #define DEBUG YES */ #ifndef DEBUG #define ASSERT(p) #endif #ifdef DEBUG #define ASSERT(p) if(!(p))botch("p");else botch(s) char *s; { fatal(F_ERSYS,s); } #endif struct store { struct store *ptr; }; struct store allocs[] = { /*initial arena*/ setbusy(&allocs[1].ptr), setbusy(&allocs[0].ptr) }; struct store *allocp = &allocs[1]; /*search ptr*/ struct store *alloct = &allocs[1]; /*arena top*/ struct store *allocx = 0; /*for benefit of realloc*/ struct store *sbrk(); struct store * malloc(nbytes) unsigned nbytes; { struct store *p, *q; register nw; static temp; /*coroutines assume no auto*/ #ifdef verbose printf("malloc(%d) ",nbytes); #endif nw = (nbytes+2*WORD-1)/WORD; ASSERT(allocp>allocs && allocp<=alloct); for(p=allocp; ; ) { for(temp=0; ; ) { if(!testbusy(p->ptr)) { while(!testbusy((q=p->ptr)->ptr)) { ASSERT(q>p&&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) { fatal(F_ERSYS,"dballoc"); } else if(++temp>1) break; } temp = (nw+BLOCK/WORD)&~(BLOCK/WORD-1); q = sbrk(temp*WORD); /*SYSDEP*/ if((int)q == -1) return(NULL); ASSERT(q>alloct); alloct->ptr = q; if(q!=alloct+1) alloct->ptr = setbusy(alloct->ptr); alloct = q->ptr = q+temp-1; alloct->ptr = setbusy(allocs); } found: allocp = p + nw; ASSERT(allocp<=alloct); if(q>allocp) { allocx = allocp->ptr; allocp->ptr = p->ptr; } p->ptr = setbusy(allocp); #ifdef verbose printf("= %o\n",p+1); #endif return(p+1); } /* * freeing strategy tuned for LIFO allocation */ free(p) struct store *p; { struct store *savep=p; #ifdef verbose printf("free(%o)\n",p); #endif ASSERT(p>clearbusy(allocs[1].ptr)&&p<=alloct); allocp = --p; ASSERT(testbusy(p->ptr)); p->ptr = clearbusy(p->ptr); ASSERT(p->ptr > allocp && p->ptr <= alloct); } char *calloc(nbytes,count) { char *c; c=(char *)malloc(nbytes*count); return(c); } struct store * realloc(p, nbytes) register struct store *p; unsigned nbytes; { register struct store *q; struct store *s, *t; register unsigned nw; unsigned onw; onw = p[-1].ptr - p; q = malloc(nbytes); if(q==NULL || q==p) return(q); s = p; t = q; nw = (nbytes+WORD-1)/WORD; if(nwptr = (s++)->ptr; if(q

=p) (q+(q+nw-p))->ptr = allocx; return(q); } ); } char *calloc(nbytes,count) { char *c; c=(char *)malloc(nbytes*count); return(c); } struct store * realloc(p, nbytes) register struct store *p; unsigned nbytes; { register struct store *q; struct store *s, *t; register unsigned nw; unsigned onw; onw = p[-1].ptr - p; q = malloc(nbytes); if(q==NULL || q==p) ((lib/libI77uc/dfe.c 644 0 33 6166 2475104756 7113 /* char id_dfe[] = "@(#)dfe.c 1.2"; * * direct formatted external i/o */ #include "fio.h" extern int rd_ed(),rd_ned(),w_ed(),w_ned(); int y_getc(),y_putc(),y_rnew(),y_wnew(),y_tab(); char *dfe = "dfe"; char *rdfe = "read dfe"; char *wdfe = "write dfe"; s_rdfe(a) cilist *a; { int n; reading = YES; if(n=c_dfe(a,READ)) return(n); if(curunit->uwrt) nowreading(curunit); getn = y_getc; doed = rd_ed; doned = rd_ned; dotab = y_tab; dorevert = doend = donewrec = y_rnew; if(pars_f(fmtbuf)) err(errflag,F_ERFMT,rdfe) fmt_bg(); return(OK); } s_wdfe(a) cilist *a; { int n; reading = NO; if(n=c_dfe(a,WRITE)) return(n); curunit->uend = NO; if(!curunit->uwrt) nowwriting(curunit); putn = y_putc; doed = w_ed; doned = w_ned; dotab = y_tab; dorevert = doend = donewrec = y_wnew; if(pars_f(fmtbuf)) err(errflag,F_ERFMT,wdfe) fmt_bg(); return(OK); } e_rdfe() { en_fio(); return(OK); } e_wdfe() { en_fio(); return(OK); } c_dfe(a,flag) cilist *a; { int n; sequential = NO; external = formatted = FORMATTED; lfname = NULL; elist = NO; cursor=scale=recpos=reclen=0; radix = 10; signit = YES; fmtbuf = a->cifmt; errflag = a->cierr; endflag = a->ciend; lunit = a->ciunit; if(not_legal(lunit)) err(errflag,F_ERUNIT,dfe); curunit = &units[lunit]; if(!curunit->ufd && (n=fk_open(flag,DIR,FMT,(ftnint)lunit))) err(errflag,n,dfe) cf = curunit->ufd; elist = YES; lfname = curunit->ufnm; if(!curunit->ufmt) err(errflag,F_ERNOFIO,dfe) if(!curunit->useek || !curunit->url) err(errflag,F_ERNODIO,dfe) recnum = a->cirec - 1; fseek(cf, (long)curunit->url * recnum, 0); cblank = curunit->ublnk; cplus = NO; return(OK); } y_getc() { int ch; if(curunit->uend) return(EOF); if(curunit->url==1 || recpos++ < curunit->url) { if((ch=getc(cf))!=EOF) { return(ch); } if(feof(cf)) { curunit->uend = YES; return(EOF); } err(errflag,errno,rdfe); } else return(' '); } y_putc(c) { if(curunit->url!=1 && recpos++ >= curunit->url) err(errflag,F_EREREC,wdfe) putc(c,cf); return(OK); } y_tab() { int n; if(curunit->url==1) { if(cursor < 0 && -cursor > ftell(cf)) return(F_ERBREC); } else { if(reclen < recpos) reclen = recpos; if((recpos + cursor) < 0) return(F_ERBREC); n = reclen - recpos; /* n >= 0 */ if(!reading && (cursor-n) > 0) { recpos = reclen; cursor -= n; fseek(cf,(long)n,1); while(cursor--) if(n=(*putn)(' ')) return(n); return(cursor=0); } recpos += cursor; if(recpos >= curunit->url) err(errflag,F_EREREC,dfe) } fseek(cf,(long)cursor,1); return(cursor=0); } /* /*y_rev() /*{ /*what about work done?*/ /* if(curunit->url==1) return(0); /* while(recposurl) (*putn)(' '); /* recpos=0; /* return(0); /*} /* /*y_err() /*{ /* err(errflag, F_EREREC, dfe); /*} */ y_rnew() { if(curunit->url != 1) { fseek(cf,(long)curunit->url*(++recnum),0); recpos = reclen = cursor = 0; } return(OK); } y_wnew() { if(curunit->url != 1) { if(reclen > recpos) { fseek(cf,(long)(reclen-recpos),1); recpos = reclen; } while(recpos < curunit->url) (*putn)(' '); recnum++; recpos = reclen = cursor = 0; } return(OK); } y_rend() { return(OK); } y_wend() { return(y_wnew()); } )(' '); /* recpos=0; /* return(0); /*} /* /*y_err() /*{ /* err(errflag, F_EREREC, dfe); /*} */ y_rnew() { if(curunit->url != 1) { fseek(cf,(long)curunit->url*(++recnum),0); recpos = reclen = cursor = 0; } return(OK); } y_wnew() { if(curunit->url != 1) { if(reclen > recpos) { fseek(cf,(long)(reclen-recpos),1); recpos = reclen; } while(recpos < curunit->url) (*putn)(' '); relib/libI77uc/due.c 644 0 33 2452 2475105117 7114 /* char id_due[] = "@(#)due.c 1.2"; * * direct unformatted external i/o */ #include "fio.h" char *due = "due"; s_rdue(a) cilist *a; { int n; reading = YES; if(n=c_due(a,READ)) return(n); if(curunit->uwrt) nowreading(curunit); return(OK); } s_wdue(a) cilist *a; { int n; reading = NO; if(n=c_due(a,WRITE)) return(n); curunit->uend = NO; if(!curunit->uwrt) nowwriting(curunit); return(OK); } c_due(a,flag) cilist *a; { int n; lfname = NULL; elist = NO; sequential=formatted=NO; recpos = reclen = 0; external = YES; errflag = a->cierr; endflag = a->ciend; lunit = a->ciunit; if(not_legal(lunit)) err(errflag,F_ERUNIT,due); curunit = &units[lunit]; if (!curunit->ufd && (n=fk_open(flag,DIR,UNF,(ftnint)lunit)) ) err(errflag,n,due) cf = curunit->ufd; elist = YES; lfname = curunit->ufnm; if (curunit->ufmt) err(errflag,F_ERNOUIO,due) if (!curunit->useek || !curunit->url) err(errflag,F_ERNODIO,due) if (fseek(cf, (long)((a->cirec-1)*curunit->url), 0) < 0) return(due_err(due)); else return(OK); } e_rdue() { return(OK); } e_wdue() {/* This is to ensure full records. It is really necessary. */ int n = 0; if (curunit->url!=1 && recpos!=curunit->url && (fseek(cf, (long)(curunit->url-recpos-1), 1) < 0 || fwrite(&n, 1, 1, cf) != 1)) return(due_err(due)); return(OK); } ->ufnm; if (curunit->ufmt) err(errflag,F_ERNOUIO,due) if (!curunit->useek || !curunit->url) err(errflag,F_ERNODIO,due) if (fseek(cf, (long)((a->cirec-1)*curunit->url), 0) < 0) return(due_err(due)); else retlib/libI77uc/endfile.c 644 0 33 2405 2475105153 7743 /* char id_endfile[] = "@(#)endfile.c 1.2"; * * endfile */ #include "fio.h" char *endf = "endfile"; extern char *tmplate; f_end(a) alist *a; { unit *b; lfname = NULL; elist = NO; errflag = a->aerr; lunit = a->aunit; if (not_legal(lunit)) err(errflag,F_ERUNIT,endf) b = &units[lunit]; if(!b->ufd) err(errflag,F_ERNOPEN,endf) if(b->uend) return(0); lfname = b->ufnm; b->uend = YES; return(t_runc(b,errflag)); } t_runc(b,flag) unit *b; ioflag flag; { char buf[128],nm[16]; FILE *tmp; int n,m; long loc,len; fflush(b->ufd); if(b->uwrt) nowreading(b); if(b->url || !b->useek || !b->ufnm) return(OK); /*don't trunc dir files*/ loc=ftell(b->ufd); fseek(b->ufd,0L,2); len=ftell(b->ufd); if (loc==len) return(OK); strcpy(nm,tmplate); mktemp(nm); if(!(tmp=fopen(nm,"w"))) err(flag,errno,endf); fseek(b->ufd,0L,0); while (loc) { n=fread(buf,1,loc>sizeof(buf)?sizeof(buf):(int)loc,b->ufd); loc -= n; fwrite(buf,1,n,tmp); } fflush(tmp); for(n=0;n<10;n++) { if((m=fork())==-1) continue; else if(m==0) { execl("/bin/cp","cp",nm,b->ufnm,0); execl("/usr/bin/cp","cp",nm,b->ufnm,0); fatal(F_ERSYS,"no cp for trunc"); } wait(&m); if(m) err(flag,F_ERTRUNC,endf); fclose(tmp); unlink(nm); return(OK); } err(flag,F_ERTRUNC,endf); } !(tmp=fopen(nm,"w"))) err(flag,errno,endf); fseek(b->ufd,0L,0); while (loc) { n=fread(buf,1,loc>sizeof(buf)?sizeof(buf):(int)loc,b->ufd); loc -= n; fwrite(buf,1,n,tmp); } fflush(tmp); for(n=0;n<10;n++) { if((m=fork())==-1) continue; elib/libI77uc/err.c 644 0 33 7253 2526433011 7125 /* char id_err[] = "@(#)err.c 1.4"; * * file i/o error and initialization routines */ #include #include #include #include "fiodefs.h" /* * global definitions */ char *tmplate = "tmp.FXXXXXX"; /* scratch file template */ char *fortfile = "fort.%d"; /* default file template */ unit units[MXUNIT] = 0; /*unit table*/ flag reading; /*1 if reading, 0 if writing*/ flag external; /*1 if external io, 0 if internal */ flag sequential; /*1 if sequential io, 0 if direct*/ flag formatted; /*1 if formatted io, 0 if unformatted, -1 if list*/ char *fmtbuf, *icptr, *icend, *fmtptr; int (*doed)(),(*doned)(); int (*doend)(),(*donewrec)(),(*dorevert)(),(*dotab)(); int (*lioproc)(); int (*getn)(),(*putn)(),(*ungetn)(); /*for formatted io*/ icilist *svic; /* active internal io list */ FILE *cf; /*current file structure*/ unit *curunit; /*current unit structure*/ int lunit; /*current logical unit*/ char *lfname; /*current filename*/ int recpos; /*place in current record*/ ftnint recnum; /* current record number */ int reclen; /* current record length */ int cursor,scale; int radix; ioflag signit,tab,cplus,cblank,elist,errflag,endflag,lquit,l_first; flag leof; int lcount,line_len; /*error messages*/ extern char *sys_errlist[]; extern int sys_nerr; extern char *f_errlist[]; extern int f_nerr; fatal(n,s) char *s; { ftnint lu; for (lu=1; lu < MXUNIT; lu++) flush_(&lu); if(n<0) fprintf(stderr,"%s: [%d] end of file\n",s,n); else if(n>=0 && n=F_ER && n0?"formatted":(formatted<0?"list":"unformatted"), external?"external":"internal"); if (formatted) { if(fmtbuf) prnt_fmt(n); if (external) { if(reading && curunit->useek) prnt_ext(); /* print external data */ } else prnt_int(); /* print internal array */ } } f_exit(); _cleanup(); abort(); } prnt_ext() { int ch; int i=1; long loc; fprintf (stderr, "part of last data: "); loc = ftell(curunit->ufd); if(loc) { if(loc==1L) rewind(curunit->ufd); else for(;i<12 && last_char(curunit->ufd)!='\n';i++); while(i--) ffputc(fgetc(curunit->ufd),stderr); } fputc('|',stderr); for(i=0;i<5 && (ch=fgetc(curunit->ufd)!=EOF);i++) ffputc(ch,stderr); fputc('\n',stderr); } prnt_int() { char *ep; fprintf (stderr,"part of last string: "); ep = icptr - (recpos<12?recpos:12); while (ep='0' && x<='9') #define isspace(s) (s==' ') #define skip(s) while(isspace(*s)) s++ #ifdef interdata #define SYLMX 300 #endif #ifdef pdp11 #define SYLMX 300 #endif #ifdef vax #define SYLMX 300 #endif struct syl syl[SYLMX]; int parenlvl,pc,revloc; char *f_s(), *f_list(), *i_tem(), *gt_num(), *ap_end(); pars_f(s) char *s; { parenlvl=revloc=pc=0; return((f_s(s,0)==FMTERR)? ERROR : OK); } char *f_s(s,curloc) char *s; { skip(s); if(*s++!='(') { fmtptr = s; return(FMTERR); } if(parenlvl++ ==1) revloc=curloc; op_gen(RET,curloc,0,0,s); if((s=f_list(s))==FMTERR) { return(FMTERR); } skip(s); return(s); } char *f_list(s) char *s; { while (*s) { skip(s); if((s=i_tem(s))==FMTERR) return(FMTERR); skip(s); if(*s==',') s++; else if(*s==')') { if(--parenlvl==0) { op_gen(REVERT,revloc,0,0,s); } else op_gen(GOTO,0,0,0,s); return(++s); } } fmtptr = s; return(FMTERR); } char *i_tem(s) char *s; { char *t; int n,curloc; if(*s==')') return(s); if(ne_d(s,&t)) return(t); if(e_d(s,&t)) return(t); s=gt_num(s,&n); curloc = op_gen(STACK,n,0,0,s); return(f_s(s,curloc)); } ne_d(s,p) char *s,**p; { int n,x,sign=0,pp1,pp2; switch(lcase(*s)) { case ':': op_gen(COLON,(int)('\n'),0,0,s); break; #ifndef KOSHER case '$': op_gen(DOLAR,(int)('\0'),0,0,s); break; /*** NOT STANDARD FORTRAN ***/ #endif case 'b': switch(lcase(*(s+1))) { case 'z': s++; op_gen(BZ,1,0,0,s); break; case 'n': s++; default: op_gen(BN,0,0,0,s); break; } break; case 's': switch(lcase(*(s+1))) { case 'p': s++; x=SP; pp1=1; pp2=1; break; #ifndef KOSHER case 'u': s++; x=SU; pp1=0; pp2=0; break; /*** NOT STANDARD FORTRAN ***/ #endif case 's': s++; x=SS; pp1=0; pp2=1; break; default: x=S; pp1=0; pp2=1; break; } op_gen(x,pp1,pp2,0,s); break; case '/': op_gen(SLASH,0,0,0,s); break; case '-': sign=1; s++; /*OUTRAGEOUS CODING TRICK*/ case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': s=gt_num(s,&n); switch(lcase(*s)) { case 'p': if(sign) n= -n; op_gen(P,n,0,0,s); break; #ifndef KOSHER case 'r': if(n<=1) /*** NOT STANDARD FORTRAN ***/ { fmtptr = s; return(FMTERR); } op_gen(R,n,0,0,s); break; case 't': op_gen(T,0,n,0,s); break; /* NOT STANDARD FORT */ #endif case 'x': op_gen(X,n,0,0,s); break; case 'h': op_gen(H,n,(int)(s+1),0,s); s+=n; break; default: fmtptr = s; return(0); } break; case GLITCH: case '"': case '\'': op_gen(APOS,(int)s,0,0,s); *p = ap_end(s); return(FMTOK); case 't': switch(lcase(*(s+1))) { case 'l': s++; x=TL; break; case 'r': s++; x=TR; break; default: x=T; break; } if(isdigit(*(s+1))) {s=gt_num(s+1,&n); s--;} #ifndef KOSHER else n = 0; /* NOT STANDARD FORTRAN, should be error */ #endif #ifdef KOSHER fmtptr = s; return(FMTERR); #endif op_gen(x,n,1,0,s); break; case 'x': op_gen(X,1,0,0,s); break; case 'p': op_gen(P,0,0,0,s); break; #ifndef KOSHER case 'r': op_gen(R,10,1,0,s); break; /*** NOT STANDARD FORTRAN ***/ #endif default: fmtptr = s; return(0); } s++; *p=s; return(FMTOK); } e_d(s,p) char *s,**p; { int n,w,d,e,x=0; char *sv=s; char c; s=gt_num(s,&n); op_gen(STACK,n,0,0,s); c = lcase(*s); s++; switch(c) { case 'd': case 'e': case 'g': s = gt_num(s, &w); if (w==0) break; if(*s=='.') { s++; s=gt_num(s,&d); } else d=0; if(lcase(*s) == 'e' #ifndef KOSHER || *s == '.' /*** '.' is NOT STANDARD FORTRAN ***/ #endif ) { s++; s=gt_num(s,&e); if(c=='e') n=EE; else if(c=='d') n=DE; else n=GE; } else { e=2; if(c=='e') n=E; else if(c=='d') n=D; else n=G; } op_gen(n,w,d,e,s); break; case 'l': s = gt_num(s, &w); if (w==0) break; op_gen(L,w,0,0,s); break; case 'a': skip(s); if(*s>='0' && *s<='9') { s=gt_num(s,&w); if(w==0) break; op_gen(AW,w,0,0,s); break; } op_gen(A,0,0,0,s); break; case 'f': s = gt_num(s, &w); if (w==0) break; if(*s=='.') { s++; s=gt_num(s,&d); } else d=0; op_gen(F,w,d,0,s); break; case 'i': s = gt_num(s, &w); if (w==0) break; if(*s =='.') { s++; s=gt_num(s,&d); x = IM; } else { d = 1; x = I; } op_gen(x,w,d,0,s); break; default: pc--; /* unSTACK */ *p = sv; fmtptr = s; return(FMTERR); } *p = s; return(FMTOK); } op_gen(a,b,c,d,s) char *s; { struct syl *p= &syl[pc]; if(pc>=SYLMX) { fmtptr = s; fatal(F_ERFMT,"format too complex"); } #ifdef DEBUG fprintf(stderr,"%3d opgen: %d %d %d %d %c\n", pc,a,b,c,d,*s==GLITCH?'"':*s); /* for debug */ #endif p->op=a; p->p1=b; p->p2=c; p->p3=d; return(pc++); } char *gt_num(s,n) char *s; int *n; { int m=0,a_digit=NO; skip(s); while(isdigit(*s) || isspace(*s)) { if (isdigit(*s)) { m = 10*m + (*s)-'0'; a_digit = YES; } s++; } if(a_digit) *n=m; else *n=1; return(s); } char *ap_end(s) char *s; { char quote; quote = *s++; for(;*s;s++) { if(*s==quote && *++s!=quote) return(s); } fmtptr = s; fatal(F_ERFMT,"bad string"); } c\n", pc,a,b,c,d,*s==GLITCH?'"':*s); /* for debug */ #endif p->op=a; p->p1=b; p->p2=c; p->p3=d; return(pc++); } char *gt_num(s,n) char *s; int *n; { int m=0,a_digit=NO; skip(s); while(isdigit(*s) || isspace(*s)) { if (isdigit(*s)) { m = 10*m + (*s)-'0'; a_digit = YES; } s++; } if(a_digit) *n=m; else *n=1; return(s); } char *ap_end(s) char *s; { char quote; quote = *s++; for(;*s;s++) { if(*s==quote && *++s!=quote) return(s); } fmtptr = s;lib/libI77uc/fmtlib.c 644 0 33 2216 2475105345 7615 /* char id_fmtlib[] = "@(#)fmtlib.c 1.2"; * * integer to ascii conversion */ #include "fio.h" char _digit[] = "0123456789abcdefghijklmnopqrstuvwxyz"; char *icvt(value,ndigit,sign) long value; int *ndigit,*sign; { static char buf[MAXINTLENGTH+1]; register int i; long kludge, rem, mask = 0x7fffffff; int one = 1; char c; if (value == 0) { *sign=0; *ndigit=one; buf[MAXINTLENGTH]='0'; return(&buf[MAXINTLENGTH]); } else if (signit) /* signed */ { *sign = (value < 0); c = (int)(value % radix); value /= radix; if (*sign) { value = -value; c = -c; } } else /* unsigned */ { *sign = 0; if (value < 0) { /* ALL THIS IS TO SIMULATE UNSIGNED MOD & DIV */ kludge = mask - (radix - one); value &= mask; rem = (kludge % radix) + (value % radix); value = (kludge / radix) + (value / radix) + (rem / radix) + one; c = (int)(rem % radix); } else { c = (int)(value % radix); value /= radix; } } *(buf+MAXINTLENGTH) = _digit[c]; for(i=MAXINTLENGTH-one; va((lue!=0; i--) { c = (int)(value % radix); *(buf+i) = _digit[c]; value /= radix; } *ndigit = MAXINTLENGTH - i; return(&buf[i+one]); } HIS IS TO SIMULATE UNSIGNED MOD & DIV */ kludge = mask - (radix - one); value &= mask; rem = (kludge % radix) + (value % radix); value = (kludge / radix) + (value / radix) + (rem / radix) + one; c = (int)(rem % radix); } else { c = (int)(value % radix); value /= radix; } } *(buf+MAXINTLENGTH) = _digit[c]; for(i=MAXINTLENGTH-one; valib/libI77uc/iio.c 644 0 33 7164 2475105415 7125 /* char id_iio[] = "@(#)iio.c 1.2"; * * internal (character array) i/o */ #include "fio.h" #include "lio.h" extern int rd_ed(),rd_ned(),w_ed(),w_ned(); extern int l_read(),l_write(); int z_wnew(),z_rnew(),z_tab(); z_getc() { if(icptr >= icend && !recpos) /* new rec beyond eof */ { leof = EOF; return(EOF); } if(recpos++ < svic->icirlen) return(*icptr++); return(' '); } z_putc(c) char c; { if(icptr < icend) { if(c=='\n') return(z_wnew()); if(recpos++ < svic->icirlen) { *icptr++ = c; return(OK); } else err(errflag,F_EREREC,"iio") } leof = EOF; #ifndef KOSHER err(endflag,EOF,"iio") /* NOT STANDARD, end-of-file on writes */ #endif #ifdef KOSHER err(errflag,F_EREREC,"iio") #endif } z_ungetc(ch,cf) char ch; { if(ch==EOF || --recpos >= svic->icirlen) return(OK); if(--icptr < svic->iciunit || recpos < 0) err(errflag,F_ERBREC,"ilio") *icptr = ch; return(OK); } s_rsfi(a) icilist *a; { reading = YES; doed=rd_ed; doned=rd_ned; getn=z_getc; doend = donewrec = z_rnew; dorevert = z_rnew; dotab = z_tab; return(c_si(a)); } s_wsfi(a) icilist *a; { reading = NO; doed=w_ed; doned=w_ned; putn=z_putc; doend = donewrec = z_wnew; dorevert = z_wnew; dotab = z_tab; return(c_si(a)); } s_rdfi(a) icilist *a; { reading = YES; doed = rd_ed; doned = rd_ned; getn = z_getc; donewrec = z_rnew; dorevert = doend = z_rnew; dotab = z_tab; return(c_di(a)); } s_wdfi(a) icilist *a; { reading = NO; doed = w_ed; doned = w_ned; putn = z_putc; donewrec = z_wnew; dorevert = doend = z_wnew; dotab = z_tab; return(c_di(a)); } c_fi(a) icilist *a; { fmtbuf=a->icifmt; formatted = FORMATTED; external = NO; cblank=cplus=NO; scale=cursor=0; radix = 10; signit = YES; elist = YES; svic = a; recpos=reclen=0; icend = a->iciunit + a->icirnum*a->icirlen; errflag = a->icierr; endflag = a->iciend; if(pars_f(fmtbuf)) err(errflag,F_ERFMT,"ifio") fmt_bg(); return(OK); } c_si(a) icilist *a; { sequential = YES; recnum = 0; icptr = a->iciunit; return(c_fi(a)); } c_di(a) icilist *a; { sequential = NO; recnum = a->icirec - 1; icptr = a->iciunit + recnum*a->icirlen; return(c_fi(a)); } z_rnew() { icptr = svic->iciunit + (++recnum)*svic->icirlen; recpos = reclen = cursor = 0; return(OK); } z_wnew() { if(reclen > recpos) { icptr += (reclen - recpos); recpos = reclen; } while(recpos < svic->icirlen) (*putn)(' '); recpos = reclen = cursor = 0; recnum++; return(OK); } z_tab() { int n; if(reclen < recpos) reclen = recpos; if((recpos + cursor) < 0) return(F_ERBREC); n = reclen - recpos; if(!reading && (cursor-n) > 0) { icptr += n; recpos = reclen; cursor -= n; while(cursor--) if(n=(*putn)(' ')) return(n); } else { icptr += cursor; recpos += cursor; } return(cursor=0); } e_rsfi() { int n; n = en_fio(); fmtbuf = NULL; return(n); } e_wsfi() { return(e_rsfi()); } e_rdfi() { return(e_rsfi()); } e_wdfi() { return(e_wsfi()); } c_li(a) icilist *a; { fmtbuf="int list io"; sequential = formatted = LISTDIRECTED; external = NO; elist = YES; svic = a; recnum = recpos = 0; cplus = cblank = NO; icptr = a->iciunit; icend = icptr + a->icirlen * a->icirnum; errflag = a->icierr; endflag = a->iciend; leof = NO; return(OK); } s_rsli(a) icilist *a; { reading = YES; lioproc = l_read; getn = z_getc; ungetn = z_ungetc; l_first = YES; lcount = 0; lquit = NO; return(c_li(a)); } s_wsli(a) icilist *a; { reading = NO; putn = z_putc; lioproc = l_write; line_len = a->icirlen; return(c_li(a)); } e_rsli() { fmtbuf = NULL; return(OK); } e_wsli() { fmtbuf = NULL; reclen = recpos; return(z_wnew()); } ftnint iiorec_() { return(recnum); } ftnint iiopos_() { return(recpos); } endflag = a->iciend; leof = NO; return(OK); } s_rsli(a) icilist *a; { reading = YES; lioproc = l_read; getn = z_getc; ungetn = z_ungetc; l_first = YES; lcount = 0; lquit = NO; return(c_li(a)); } s_wsli(a) icilist *a; { reading = NO; putn = z_putc; lioproc = l_write; line_len = a->icirlen; return(c_li(a)); } e_rsli() { fmtbuf = NULL; return(OK); } e_wsli() { fmtbuf = NULL;lib/libI77uc/inquire.c 644 0 33 4016 2475105444 10014 /* char id_inquire[] = "@(#)inquire.c 1.2"; * * inquire.c - f77 i/o inquire statement routine */ #include "fio.h" f_inqu(a) inlist *a; { char *byfile; int i; unit *p; char buf[256], *s; long x_inode; elist = NO; lfname = a->infile; lunit = a->inunit; external = YES; p = NULL; if(byfile=a->infile) { g_char(a->infile,a->infilen,buf); if((x_inode=inode(buf))==-1) { if(a->inex) *a->inex = NO; /* doesn't exist */ return(OK); } for(i=0;iinerr,F_ERUNIT,"inquire") else if (units[lunit].ufd) { p= &units[lunit]; lfname = p->ufnm; } } if(a->inex) *a->inex= ((byfile && x_inode) || (!byfile && p)); if(a->inopen) *a->inopen=(p!=NULL); if(a->innum) *a->innum= (p?(p-units):-1); if(a->innamed) *a->innamed= (byfile || (p && p->ufnm)); if(a->inname) { if(byfile) s = buf; else if(p && p->ufnm) s = p->ufnm; else s=""; b_char(s,a->inname,a->innamlen); } if(a->inacc && p) { if(p->url) s = "direct"; else s = "sequential"; b_char(s,a->inacc,a->inacclen); } if(a->inseq) { s= ((byfile && !p) || (p && !p->url))? "yes" : "no"; b_char(s,a->inseq,a->inseqlen); } if(a->indir) { s= ((byfile && !p) || (p && p->useek && p->url))? "yes" : "no"; b_char(s,a->indir,a->indirlen); } if(a->inform) { if(p) { #ifndef KOSHER if(p->uprnt) s = "print"; /*** NOT STANDARD FORTRAN ***/ else #endif s = p->ufmt?"formatted":"unformatted"; } else s = "unknown"; b_char(s,a->inform,a->informlen); } if(a->infmt) { if (p) s= p->ufmt? "yes" : "no"; else s= "unknown"; b_char(s,a->infmt,a->infmtlen); } if(a->inunf) { if (p) s= p->ufmt? "no" : "yes"; else s= "unknown"; b_char(s,a->inunf,a->inunflen); } if(a->inrecl && p) *a->inrecl=p->url; if(a->innrec && p && p->url) *a->innrec=(ftell(p->ufd)/p->url)+1; if(a->inblank && p && p->ufmt) { b_char(p->ublnk? "zero" : "blank",a->inblank,a->inblanklen); } return(OK); } "; } else s = "unknown"; b_char(s,a->inform,a->informlen); } if(a->infmt) { if (p) s= p->ufmt? "yes" : "no"; else s= "unknown"; b_char(s,a->infmt,a->infmtlen); } if(a->inunf) { if (p) s= p->ufmt? "no" : "yes"; else s= "unknown"; b_char(s,a->inunf,a->inunflen); } if(a->inrecl && p) *a->inrecl=p->url; if(a->innrec && p && p->url) *a->innrec=(ftell(p->ufd)/p->url)+1; if(a->inblank && p && p->ufmt) { b_char(p->ublnk? "zero" : "blank",a->inblank,a->inblanklen); } lib/libI77uc/lwrite.c 644 0 33 5660 2475105535 7655 /* char id_lwrite[] = "@(#)lwrite.c 1.2"; * * list directed write */ #include "fio.h" #include "lio.h" int l_write(), t_putc(); s_wsle(a) cilist *a; { int n; reading = NO; if(n=c_le(a,WRITE)) return(n); putn = t_putc; lioproc = l_write; line_len = LINE; curunit->uend = NO; leof = NO; if(!curunit->uwrt) nowwriting(curunit); return(OK); } t_putc(c) char c; { if(c=='\n') recpos=0; else recpos++; putc(c,cf); return(OK); } e_wsle() { int n; PUT('\n') return(OK); } l_write(number,ptr,len,type) ftnint *number,type; flex *ptr; ftnlen len; { int i,n; ftnint x; float y,z; double yd,zd; float *xx; double *yy; for(i=0;i< *number; i++) { switch((int)type) { case TYSHORT: x=ptr->flshort; goto xint; case TYLONG: x=ptr->flint; xint: ERR(lwrt_I(x)); break; case TYREAL: ERR(lwrt_F(ptr->flreal)); break; case TYDREAL: ERR(lwrt_D(ptr->fldouble)); break; case TYCOMPLEX: xx= &(ptr->flreal); y = *xx++; z = *xx; ERR(lwrt_C(y,z)); break; case TYDCOMPLEX: yy = &(ptr->fldouble); yd= *yy++; zd = *yy; ERR(lwrt_DC(yd,zd)); break; case TYLOGICAL: ERR(lwrt_L(ptr->flint)); break; case TYCHAR: ERR(lwrt_A((char *)ptr,len)); break; default: fatal(F_ERSYS,"unknown type in lwrite"); } ptr = (char *)ptr + len; } return(OK); } lwrt_I(in) ftnint in; { int n; char buf[16],*p; sprintf(buf," %ld",(long)in); if(n=chk_len(LINTW)) return(n); for(p=buf;*p;) PUT(*p++) return(OK); } lwrt_L(ln) ftnint ln; { int n; if(n=chk_((len(LLOGW)) return(n); return(wrt_L(&ln,LLOGW)); } lwrt_A(p,len) char *p; ftnlen len; { int i,n; if(n=chk_len(LSTRW)) return(n); PUT(' ') PUT(' ') for(i=0;i=1.0;x/=10.0,d--); return(wrt_F(&f,LFW,d,(ftnlen)sizeof(float))); } else { scale = 1; return(wrt_E(&f,LEW,LED-scale,LEE,(ftnlen)sizeof(float))); } } lwrt_D(dn) double dn; { int d,n; double x; ufloat f; if(dn==0.0) return(lwrt_0()); f.pd = dn; d = dwidth(dn); if(n=chk_len(d)) return(n); if(d==LDFW) { scale = 0; for(d=LDFD,x=abs(dn);x>=1.0;x/=10.0,d--); return(wrt_F(&f,LDFW,d,(ftnlen)sizeof(double))); } else { scale = 1; return(wrt_E(&f,LDEW,LDED-scale,LDEE,(ftnlen)sizeof(double))); } } lwrt_C(a,b) float a,b; { int n; if(n=chk_len(LCW)) return(n); PUT(' ') PUT(' ') PUT('(') if(n=lwrt_F(a)) return(n); PUT(',') if(n=lwrt_F(b)) return(n); PUT(')') return(OK); } lwrt_DC(a,b) double a,b; { int n; if(n=chk_len(LDCW)) return(n); PUT(' ') PUT(' ') PUT('(') if(n=lwrt_D(a)) return(n); PUT(',') if(n=lwrt_D(b)) return(n); PUT(')') return(OK); } lwrt_0() { int n; char *z = " 0."; if(n=chk_len(4)) return(n); while(*z) PUT(*z++) return(OK); } chk_len(w) { int n; if(recpos+w > line_len) PUT('\n') return(OK); } if(n=chk_len(LCW)) return(n); PUT(' ') PUT(' ') PUT('(') if(n=lwrt_F(a)) retlib/libI77uc/lread.c 644 0 33 15352 2475105476 7461 /* char id_lread[] = "@(#)lread.c 1.2"; * * list directed read */ #include "fio.h" #include "lio.h" #define SP 1 #define B 2 #define AP 4 #define EX 8 #define D 16 #define EIN 32 #define isblnk(x) (ltab[x+1]&B) #define issep(x) (ltab[x+1]&SP) #define isapos(x) (ltab[x+1]&AP) #define isexp(x) (ltab[x+1]&EX) #define isdigit(x) (ltab[x+1]&D) #define endlinp(x) (ltab[x+1]&EIN) #define GETC(x) (x=(*getn)()) char *lrd = "list read"; char *lchar; double lx,ly; int ltype; int l_read(),t_getc(),ungetc(); char ltab[128+1] = { EIN, /* offset one for EOF */ /* 0- 15 */ 0,0,AP,0,0,0,0,0,0,B,SP|B|EIN,0,0,0,0,0, /* ^B,TAB,NEWLINE */ /* 16- 31 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 32- 47 */ SP|B,0,AP,0,0,0,0,AP,0,0,0,0,SP,0,0,EIN, /* space,",',comma,/ */ /* 48- 63 */ D,D,D,D,D,D,D,D,D,D,0,0,0,0,0,0, /* digits 0-9 */ /* 64- 79 */ 0,0,0,0,EX,EX,0,0,0,0,0,0,0,0,0,0, /* D,E */ /* 80- 95 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 96-111 */ 0,0,0,0,EX,EX,0,0,0,0,0,0,0,0,0,0, /* d,e */ /* 112-127 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; s_rsle(a) cilist *a; /* start read sequential list external */ { int n; reading = YES; if(n=c_le(a,READ)) return(n); l_first = YES; lquit = NO; lioproc = l_read; getn = t_getc; ungetn = ungetc; leof = curunit->uend; lcount = 0; if(curunit->uwrt) nowreading(curunit); return(OK); } t_getc() { int ch; if(curunit->uend) return(EOF); if((ch=getc(cf))!=EOF) return(ch); if(feof(cf)) { curunit->uend = YES; leof = EOF; } else clearerr(cf); return(EOF); } e_rsle() { int ch; if(curunit->uend) return(OK); while(!endlinp(GETC(ch))); return(OK); } l_read(number,ptr,len,type) ftnint *number,type; flex *ptr; ftnlen len; { int i,n,ch; double *yy; float *xx; for(i=0;i<*number;i++) { if(leof) err(endflag, EOF, lrd) if(l_first) { l_first = NO; while(isblnk(GETC(ch))); /* skip blanks */ (*ungetn)(ch,cf); } else if(lcount==0) /* repeat count == 0 ? */ { ERR(t_sep()); /* look for non-blank, allow 1 comma */ if(lquit) return(OK); /* slash found */ } switch((int)type) { case TYSHORT: case TYLONG: case TYREAL: case TYDREAL: ERR(l_R(1)); break; case TYCOMPLEX: case TYDCOMPLEX: ERR(l_C()); break; case TYLOGICAL: ERR(l_L()); break; case TYCHAR: ERR(l_CHAR()); break; } if(lquit) return(OK); if(leof) err(endflag,EOF,lrd) else if(external && ferror(cf)) err(errflag,errno,lrd) if(ltype) switch((int)type) { case TYSHORT: ptr->flshort=lx; break; case TYLOGICAL: case TYLONG: ptr->flint=lx; break; case TYREAL: ptr->flreal=lx; break; case TYDREAL: ptr->fldouble=lx; break; case TYCOMPLEX: xx=(float *)ptr; *xx++ = ly; *xx = lx; break; case TYDCOMPLEX: yy=(double *)ptr; *yy++ = ly; *yy = lx; break; case TYCHAR: b_char(lchar,(char *)ptr,len); break; } if(lcount>0) lcount--; ptr = (char *)ptr + len; } return(OK); } lr_comm() { int ch; if(lcount) return(lcount); ltype=NULL; while(isblnk(GETC(ch))); if(ch==',') { lcount=1; return(lcount); } (*ungetn)(ch,cf); if(ch=='/') { lquit = YES; return(lquit); } else return(OK); } get_repet() { char ch; double lc; if(isdigit(GETC(ch))) { (*ungetn)(ch,cf); rd_int(&lc); lcount = (int)lc; if(GETC(ch)!='*') if(leof) return(EOF); else return(F_ERREPT); } else { lcount = 1; (*ungetn)(ch,cf); } return(OK); } l_R(flg) int flg; { double a,b,c,d; int da,db,dc,dd; int i,ch,sign=0; a=b=c=d=0; da=db=dc=dd=0; if(flg && lr_comm()) return(OK); da=rd_int(&a); /* repeat count ? */ if(GETC(ch)=='*') { if (a <= 0.) return(F_ERNREP); lcount=(int)a; db=rd_int(&b); /* whole part of number */ } else { (*ungetn)(ch,cf); db=da; b=a; lcount=1; } if(GETC(ch)=='.' && isdigit(GETC(ch))) { (*ungetn)(ch,cf); dc=rd_int(&c); /* fractional part of number */ } else { (*ungetn)(ch,cf); dc=0; c=0.; } if(isexp(GETC(ch))) dd=rd_int(&d); /* exponent */ else if (ch == '+' || ch == '-') { (*ungetn)(ch,cf); dd=rd_int(&d); } else { (*ungetn)(ch,cf); dd=0; } if(db<0 || b<0) { sign=1; b = -b; } for(i=0;i 0) { for(i=0;i0:#digits&&y!=0 */ } l_C() { int ch,n; if(lr_comm()) return(OK); if(n=get_repet()) return(n); /* get repeat count */ if(GETC(ch)!='(') err(errflag,F_ERLIO,"no (") while(isblnk(GETC(ch))); (*ungetn)(ch,cf); l_R(0); /* get real part */ ly = lx; if(t_sep()) return(EOF); l_R(0); /* get imag part */ while(isblnk(GETC(ch))); if(ch!=')') err(errflag,F_ERLIO,"no )") ltype = TYCOMPLEX; return(OK); } l_L() { int ch,n; if(lr_comm()) return(OK); if(n=get_repet()) return(n); /* get repeat count */ if(GETC(ch)=='.') GETC(ch); switch(ch) { case 't': case 'T': lx=1; break; case 'f': case 'F': lx=0; break; default: if(isblnk(ch) || issep(ch)) { (*ungetn)(ch,cf); lx=0; return(OK); } else if(ch==EOF) return(EOF); else err(errflag,F_ERLIO,"logical not T or F"); } ltype=TYLOGICAL; while(!issep(GETC(ch)) && !isblnk(ch) && ch!='\n' && ch!=EOF); return(OK); } #define BUFSIZE 128 l_CHAR() { int ch,size,i,n; char quote,*p; if(lr_comm()) return(OK); if(n=get_repet()) return(n); /* get repeat count */ if(isapos(GETC(ch))) quote=ch; else if(isblnk(ch) || issep(ch) || ch==EOF || ch=='\n') { if(ch==EOF) return(EOF); (*ungetn)(ch,cf); return(OK); } else { quote = '\0'; /* to allow single word non-quoted */ (*ungetn)(ch,cf); } ltype=TYCHAR; if(lchar!=NULL) free(lchar); size=BUFSIZE-1; p=lchar=(char *)malloc(BUFSIZE); if(lchar==NULL) err(errflag,F_ERSPACE,lrd) for(i=0;;) { while( ( (quote && GETC(ch)!=quote) || (!quote && !issep(GETC(ch)) && !isblnk(ch) ) ) && ch!='\n' && ch!=EOF && ++icierr; endflag = a->ciend; lunit = a->ciunit; if(not_legal(lunit)) err(errflag,F_ERUNIT,fmtbuf) curunit = &units[lunit]; if(!curunit->ufd && (n=fk_open(flag,SEQ,FMT,(ftnint)lunit))) err(errflag,n,fmtbuf) cf = curunit->ufd; elist = YES;(( lfname = curunit->ufnm; scale=recpos=cursor=0; cplus=cblank=NO; if(!curunit->ufmt) err(errflag,F_ERNOFIO,fmtbuf) if(curunit->url) err(errflag,F_ERNOSIO,fmtbuf) return(OK); } do_lio(type,number,ptr,len) ftnint *number,*type; flex *ptr; ftnlen len; { return((*lioproc)(number,ptr,len,*type)); } = a->ciunit; if(not_legal(lunit)) err(errflag,F_ERUNIT,fmtbuf) curunit = &units[lunit]; if(!curunit->ufd && (n=fk_open(flag,SEQ,FMT,(ftnint)lunit))) err(errflag,n,fmtbuf) cf = curunit->ufd; elist = YES;lib/libI77uc/open.c 644 0 33 5351 2475105563 7306 /* char id_open[] = "@(#)open.c 1.2"; * * open.c - f77 file open routines */ #include #include #include #include "fio.h" #define SCRATCH (st=='s') #define NEW (st=='n') #define OLD (st=='o') #define OPEN (b->ufd) #define FROM_OPEN "\1" /* for use in f_clos() */ extern char *tmplate; extern char *fortfile; f_open(a) olist *a; { unit *b; int n,exists; char buf[256],st; cllist x; lfname = NULL; elist = NO; external = YES; /* for err */ errflag = a->oerr; lunit = a->ounit; if(not_legal(lunit)) err(errflag,F_ERUNIT,"open") b= &units[lunit]; if(a->osta) st = lcase(*a->osta); else st = 'u'; if(SCRATCH) { strcpy(buf,tmplate); mktemp(buf); } else if(a->ofnm) g_char(a->ofnm,a->ofnmlen,buf); else sprintf(buf,fortfile,lunit); lfname = &buf[0]; if(OPEN) { if(!a->ofnm || inode(buf)==b->uinode) { if(a->oblnk) b->ublnk= (lcase(*a->oblnk)== 'z'); #ifndef KOSHER if(a->ofm && b->ufmt) b->uprnt = (lcase(*a->ofm)== 'p'); #endif return(OK); } x.cunit=lunit; x.csta=FROM_OPEN; x.cerr=errflag; if(n=f_clos(&x)) return(n); } exists = (access(buf,0)==NULL); if(!exists && OLD) err(errflag,F_EROLDF,"open"); if( exists && NEW) err(errflag,F_ERNEWF,"open"); if(isdev(buf)) { if((b->ufd = fopen(buf,"r")) != NULL) b->uwrt = NO; else err(errflag,errno,buf) } else { if((b->ufd = fopen(buf, "a")) != NULL) b->uwrt = YES; else if((b->ufd = fopen(buf, "r")) != NULL) { fseek(b->ufd, 0L, 2); b->uwrt = NO; } else err(errflag, errno, buf) } if((b->uinode=finode(b->ufd))==-1) err(errflag,F_ERSTAT,"open") b->ufnm = (char *) calloc(strlen(buf)+1,sizeof(char)); if(b->ufnm==NULL) err(errflag,F_ERSPACE,"open") strcpy(b->ufnm,buf); b->uscrtch = SCRATCH; b->uend = NO; b->useek = canseek(b->ufd); b->url = a->orl; b->ublnk = (a->oblnk && (lcase(*a->oblnk)=='z')); if (a->ofm) { switch(lcase(*a->ofm)) { case 'f': b->ufmt = YES; b->uprnt = NO; break; #ifndef KOSHER case 'p': /* print file *** NOT STANDARD FORTRAN ***/ b->ufmt = YES; b->uprnt = YES; break; #endif case 'u': b->ufmt = NO; b->uprnt = NO; break; default: err(errflag,F_ERARG,"open form=") } } else /* not specified */ { b->ufmt = (b->url==0); b->uprnt = NO; } if(b->url && b->useek) rewind(b->ufd); return(OK); } fk_open(rd,seq,fmt,n) ftnint n; { char nbuf[10]; olist a; sprintf(nbuf, fortfile, (int)n); a.oerr=errflag; a.ounit=n; a.ofnm=nbuf; a.ofnmlen=strlen(nbuf); a.osta=NULL; a.oacc= seq==SEQ?"s":"d"; a.ofm = fmt==FMT?"f":"u"; a.orl = seq==DIR?1:0; a.oblnk=NULL; return(f_open(&a)); } isdev(s) char *s; { struct stat x; int j; if(stat(s, &x) == -1) return(NO); if((j = (x.st_mode&S_IFMT)) == S_IFREG || j == S_IFDIR) return(NO); else return(YES); } b->url && b->useek) rewind(b->ufd); return(OK); } fk_open(rd,seq,fmt,n) ftnint n; { char nbuf[10]; olist a; sprintf(nbuf, fortfile, (int)n); a.oerr=errflag; a.ounit=n; a.ofnm=nbuf; a.ofnmlen=strlen(nbuf); a.osta=NULL; a.oacc= seq==SEQ?"s":"d"; a.ofm = fmt==FMT?"f":"u"lib/libI77uc/rdfmt.c 644 0 33 10501 2523205667 7472 /* char id_rdfmt[] = "@(#)rdfmt.c 1.2"; * * formatted read routines */ #include "fio.h" #include "format.h" #define isdigit(c) (c>='0' && c<='9') #define isalpha(c) (c>='a' && c<='z') rd_ed(p,ptr,len) char *ptr; struct syl *p; ftnlen len; { int n; if(cursor && (n=rd_mvcur())) return(n); switch(p->op) { case I: case IM: n = (rd_I(ptr,p->p1,len)); break; case L: n = (rd_L(ptr,p->p1)); break; case A: p->p1 = len; /* cheap trick */ case AW: n = (rd_AW(ptr,p->p1,len)); break; case E: case EE: case D: case DE: case G: case GE: case F: n = (rd_F(ptr,p->p1,p->p2,len)); break; default: return(errno=F_ERFMT); } if (n < 0) { if(feof(cf)) return(EOF); n = errno; clearerr(cf); } return(n); } rd_ned(p,ptr) char *ptr; struct syl *p; { switch(p->op) { #ifndef KOSHER case APOS: return(rd_POS(p->p1)); case H: return(rd_H(p->p1,p->p2)); #endif case SLASH: return((*donewrec)()); case TR: case X: cursor += p->p1; tab = (p->op==TR); return(OK); case T: if(p->p1) cursor = p->p1 - recpos - 1; #ifndef KOSHER else cursor = 8*p->p2 - recpos%8; /* NOT STANDARD FORT */ #endif tab = YES; return(OK); case TL: cursor -= p->p1; tab = YES; return(OK); default: return(errno=F_ERFMT); } } rd_mvcur() { int n; if(tab) return((*dotab)()); while(cursor--) if((n=(*getn)()) < 0) return(n); return(cursor=0); } rd_I(n,w,len) ftnlen len; uint *n; { long x=0; int i,sign=0,ch,c; for(i=0;iis=x; else n->il=x; return(OK); } rd_L(n,w) ftnint *n; { int ch,i,v = -1; for(i=0;i='0') x=10*x+ch-'0'; else if(ch=='e' || ch=='d' || ch=='.') break; else if(cblank && ch==' ') x*=10; else if(ch==',') { i=w; break; } else if(ch!='\n') return(errno=F_ERRDCHR); } if(ch=='.') dot=1; while(i='0') y=10*y+ch-'0'; else if(cblank && ch==' ') y *= 10; else if(ch==',') {i=w; break;} else if(ch==' ') continue; else continue; ny++; } if(ch=='-') sz=1; while(i='0') z=10*z+ch-'0'; else if(cblank && ch==' ') z *= 10; else if(ch==',') break; else if(ch==' ') continue; else if(ch=='+') continue; else if(ch!='\n') return(errno=F_ERRDCHR); } if(!dot) for(i=0;i0;i--) x /= 10; for(i=scale;i<0;i++) x *= 10; } if(len==sizeof(float)) p->pf=x; else p->pd=x; return(OK); } rd_AW(p,w,len) char *p; ftnlen len; { int i,ch; if(w >= len) { for(i=0;iaunit; errflag = a->aerr; if(not_legal(lunit)) err(errflag,F_ERUNIT,"rewind") b = &units[lunit]; if(!b->ufd && (n=fk_open(READ,SEQ,FMT,(ftnint)lunit)) ) err(errflag,n,"rewind") lfname = b->ufnm; if(!b->useek) err(errflag,F_ERNOBKSP,"rewind") b->uend = NO; if(b->uwrt) if(n=t_runc(b,errfl((ag)) return(n); rewind(b->ufd); return(OK); } rewind.c - f77 file rewind */ #include "fio.h" f_rew(a) alist *a; { int n; unit *b; lfname = NULL; elist = NO; external = YES; /* for err */ lunit = a->aunit; errflag = a->aerr; if(not_legal(lunit)) err(errflag,F_ERUNIT,"rewind") b = &units[lunit]; if(!b->ufd && (n=fk_open(READ,SEQ,FMT,(ftnint)lunit)) ) err(errflag,n,"rewind") lfname = b->ufnm; if(!b->useek) err(errflag,F_ERNOBKSP,"rewind") b->uend = NO; if(b->uwrt) if(n=t_runc(b,errfllib/libI77uc/sfe.c 644 0 33 6512 2475105647 7125 /* char id_sfe[] = "@(#)sfe.c 1.2"; * * sequential formatted external routines */ #include "fio.h" /* * read sequential formatted external */ extern int rd_ed(),rd_ned(); int x_rnew(),x_getc(),x_tab(); s_rsfe(a) cilist *a; /* start */ { int n; reading = YES; if(n=c_sfe(a,READ)) return(n); if(curunit->uwrt) nowreading(curunit); getn= x_getc; doed= rd_ed; doned= rd_ned; donewrec = dorevert = doend = x_rnew; dotab = x_tab; if(pars_f(fmtbuf)) err(errflag,F_ERFMT,"read sfe") fmt_bg(); return(OK); } x_rnew() /* find next record */ { int ch; if(!curunit->uend) while((ch=getc(cf))!='\n' && ch!=EOF); cursor=recpos=reclen=0; return(OK); } x_getc() { int ch; if(curunit->uend) return(EOF); if((ch=getc(cf))!=EOF && ch!='\n') { recpos++; return(ch); } if(ch=='\n') { ungetc(ch,cf); return(ch); } if(feof(cf)) curunit->uend = YES; return(EOF); } e_rsfe() { int n; n=en_fio(); fmtbuf=NULL; return(n); } c_sfe(a,flag) cilist *a; /* check */ { unit *p; int n; external=sequential=formatted=FORMATTED; fmtbuf=a->cifmt; lfname = NULL; elist = NO; errflag = a->cierr; endflag = a->ciend; lunit = a->ciunit; if(not_legal(lunit)) err(errflag,F_ERUNIT,"sfe"); curunit = p = &units[lunit]; if(!p->ufd && (n=fk_open(flag,SEQ,FMT,(ftnint)lunit)) ) err(errflag,n,"sfe") cf = curunit->ufd; elist = YES; lfname = curunit->ufnm; if(!p->ufmt) err(errflag,F_ERNOFIO,"sfe") if(p->url) err(errflag,F_ERNOSIO,"sfe") cursor=recpos=scale=reclen=0; radix = 10; signit = YES; cblank = curunit->ublnk; cplus = NO; return(OK); } /* * write sequential formatted external */ extern int w_ed(),w_ned(); int x_putc(),pr_put(),x_wend(),x_wnew(); ioflag new; s_wsfe(a) cilist *a; /*start*/ { int n; reading = NO; if(n=c_sfe(a,WRITE)) return(n); if(!curunit->uwrt) nowwriting(curunit); curunit->uend = NO; if (curunit->uprnt) putn = pr_put; else putn = x_putc; new = YES; doed= w_ed; doned= w_ned; doend = x_wend; dorevert = donewrec = x_wnew; dotab = x_tab; if(pars_f(fmtbuf)) err(errflag,F_ERFMT,"write sfe") fmt_bg(); return(OK); } x_putc(c) { if(c=='\n') recpos = reclen = cursor = 0; else recpos++; if (c) putc(c,cf); return(OK); } pr_put(c) { if(c=='\n') { new = YES; recpos = reclen = cursor = 0; } else if(new) { new = NO; if(c=='0') c = '\n'; else if(c=='1') c = '\f'; else return(OK); } else recpos++; if (c) putc(c,cf); return(OK); } x_tab() { int n; if(reclen < recpos) reclen = recpos; if(curunit->useek) { if((recpos+cursor) < 0) return(F_ERBREC); n = reclen - recpos; /* distance to eor, n>=0 */ if((cursor-n) > 0) { fseek(cf,(long)n,1); /* find current eor */ recpos = reclen; cursor -= n; } else { fseek(cf,(long)cursor,1); /* do not pass go */ recpos += cursor; return(cursor=0); } } else if(cursor < 0) return(F_ERSEEK); /* can't go back */ while(cursor--) { if(reading) { n = (*getn)(); if(n=='\n') { (*ungetn)(n,cf); return(F_EREREC); } if(n==EOF) return(EOF); } else (*putn)(' '); /* fill in the empty record */ } return(cursor=0); } x_wnew() { if(reclen>recpos) fseek(cf,(long)(reclen-recpos),1); return((*putn)('\n')); } x_wend(last) char last; { if(reclen>recpos) fseek(cf,(long)(reclen-recpos),1); return((*putn)(last)); } /* /*xw_rev() /*{ /* if(workdone) x_wSL(); /* return(workdone=0); /*} /* */ e_wsfe() { return(e_rsfe()); } { if(reading) { n = (*getn)(); if(n=='\n') { (*ungetn)(n,cf); return(F_EREREC); } if(n==EOF) return(EOF); } else (*putn)(' '); /* fill in the empty record */ lib/libI77uc/sue.c 644 0 33 2723 2475105667 7146 /* char id_sue[] = "@(#)sue.c 1.2"; * * sequential unformatted external read/write routines */ #include "fio.h" extern int reclen; long recloc; char *rsue = "read sue"; char *sue = "sue"; s_rsue(a) cilist *a; { int n; reading = YES; if(n=c_sue(a,READ)) return(n); if(curunit->uwrt) nowreading(curunit); recpos = 0; if(fread(&reclen,sizeof(int),1,cf) == 1) return(OK); if(feof(cf)) { curunit->uend = YES; err(endflag, EOF, rsue) } clearerr(cf); err(errflag, errno, rsue) } s_wsue(a) cilist *a; { int n; reading = NO; if(n=c_sue(a,WRITE)) return(n); if(!curunit->uwrt) nowwriting(curunit); reclen = 0; recloc=ftell(cf); fseek(cf,(long)sizeof(int),1); curunit->uend = NO; return(OK); } c_sue(a,flag) cilist *a; { int n; external = sequential = YES; formatted = NO; lfname = NULL; elist = NO; errflag = a->cierr; endflag = a->ciend; lunit = a->ciunit; if(not_legal(lunit)) err(errflag,F_ERUNIT,sue) curunit = &units[lunit]; if(!curunit->ufd && (n=fk_open(flag,SEQ,UNF,(ftnint)lunit))) err(errflag,n,sue) cf = curunit->ufd; elist = YES; lfname = curunit->ufnm; if(curunit->ufmt) err(errflag,F_ERNOUIO,sue) if(curunit->url) err(errflag,F_ERNOSIO,sue) if(!curunit->useek) err(errflag,F_ERSEEK,sue) return(OK); } e_wsue() { long loc; fwrite(&reclen,sizeof(int),1,cf); loc=ftell(cf); fseek(cf,recloc,0); fwrite(&reclen,sizeof(int),1,cf); fseek(cf,loc,0); return(OK); } e_rsue() { fseek(cf,(long)(reclen-recpos+sizeof(int)),1); return(OK); } (n=fk_open(flag,SEQ,UNF,(ftnint)lunit))) elib/libI77uc/douio.c 644 0 33 2120 2475105064 7447 /* char id_douio[] = "@(#)douio.c 1.2"; * * unformatted external i/o */ #include "fio.h" char *eor = "eor/uio"; char *uio = "uio"; do_us(number,ptr,len) ftnint *number; ftnlen len; char *ptr; /* sequential */ { if(reading) { recpos += *number * len; if (recpos > reclen) err(errflag,F_EREREC,eor); if (fread(ptr,(int)len,(int)(*number),cf) != *number) return(due_err(uio)); } else { reclen += *number * len; fwrite(ptr,(int)len,(int)(*number),cf); } return(OK); } do_uio(number,ptr,len) ftnint *number; ftnlen len; char *ptr; { if(sequential) return(do_us(number,ptr,len)); else return(do_ud(number,ptr,len)); } do_ud(number,ptr,len) ftnint *number; ftnlen len; char *ptr; /* direct */ { recpos += *number * len; if(recpos > curunit->url && curunit->url!=1) err(errflag,F_EREREC,eor); if(reading) { if (fread(ptr, (int)len, (int)(*number), cf) != *number) return(due_err(uio)); } else fwrite(ptr,(int)len,(int)(*number),cf); return(OK); } due_err(s) char *s; { if(feof(cf)) err(endflag,EOF,s) else { clearerr(cf); err(errflag,errno,s) } } umber,ptr,len)); else return(do_ud(number,ptr,len)); } do_ud(number,ptr,len) ftnint *number; ftnlen len; char *ptr; /* direct */ { recpos += *number * len; if(recpos > curunit->url && curunit->url!=1) err(errflag,F_EREREC,eor); if(reading) { if (fread(ptr, (int)len, (int)(*number), cf) != *number) return(due_err(uio)); } else fwrite(ptr,(int)len,(int)(*number),cf); return(OK); } due_err(s) char *s; { if(felib/libI77uc/util.c 644 0 33 2612 2525741714 7317 /* char id_util[] = "@(#)util.c 1.2"; * * utility routines */ #include #include #include "fio.h" ini_std(u,F,w,i66) FILE *F; { unit *p; p = &units[u]; p->ufd = F; p->ufnm = NULL; p->useek = canseek(F); p->ufmt = YES; p->uwrt = (w==WRITE)? YES : NO; p->uscrtch = p->uend = NO; p->ublnk = p->uprnt = (i66!=0)? YES : NO; p->url = 0; p->uinode = finode(F); } canseek(f) FILE *f; /*SYSDEP*/ { struct stat x; return( (fstat(fileno(f),&x)==0) && (x.st_nlink > 0 /*!pipe*/) && !isatty(fileno(f)) ); } nowreading(x) unit *x; { long loc; x->uwrt = NO; loc=ftell(x->ufd); freopen(x->ufnm,"r",x->ufd); fseek(x->ufd,loc,0); } nowwriting(x) unit *x; { long loc; x->uwrt = YES; loc=ftell(x->ufd); freopen(x->ufnm,"a",x->ufd); fseek(x->ufd,loc,0); } g_char(a,alen,b) char *a,*b; ftnlen alen; { char *x=a+alen-1, *y=b+alen-1; while (x >= a && *x == ' ') {x--; y--;} *(y+1) = '\0'; while (x >= a) *y-- = *x--; } b_char(from, to, tolen) char *from, *to; ftnlen tolen; { int i=0;(( while (*from && i < tolen) { *to++ = *from++; i++; } while (i++ < tolen) *to++ = ' '; } inode(a) char *a; { struct stat x; if(stat(a,&x)==0) return(x.st_ino); else return(-1); } finode(f) FILE *f; { struct stat x; if(fstat(fileno(f),&x)==0) return(x.st_ino); else return(-1); } char last_char(f) FILE *f; { fseek(f,-2L,1); if(ftell(f)) return(getc(f)); else return('\n'); } --;} *(y+1) = '\0'; while (x >= a) *y-- = *x--; } b_char(from, to, tolen) char *from, *to; ftnlen tolen; { int i=0;lib/libI77uc/wrtfmt.c 644 0 33 11555 2520637032 7703 /* char id_wrtfmt[] = "@(#)wrtfmt.c 1.3"; * * formatted write routines */ #include "fio.h" #include "format.h" extern char *icvt(); #define abs(x) (x<0?-x:x) w_ed(p,ptr,len) char *ptr; struct syl *p; ftnlen len; { int n; if(cursor && (n=wr_mvcur())) return(n); switch(p->op) { case I: case IM: return(wrt_IM(ptr,p->p1,p->p2,len)); case L: return(wrt_L(ptr,p->p1)); case A: p->p1 = len; /* cheap trick */ case AW: return(wrt_AW(ptr,p->p1,len)); case D: case DE: case E: case EE: return(wrt_E(ptr,p->p1,p->p2,p->p3,len)); case G: case GE: return(wrt_G(ptr,p->p1,p->p2,p->p3,len)); case F: return(wrt_F(ptr,p->p1,p->p2,len)); default: return(errno=F_ERFMT); } } w_ned(p,ptr) char *ptr; struct syl *p; { switch(p->op) { case SLASH: return((*donewrec)()); case T: if(p->p1) cursor = p->p1 - recpos - 1; #ifndef KOSHER else cursor = 8*p->p2 - recpos%8; /* NOT STANDARD FORT */ #endif tab = YES; return(OK); case TL: cursor -= p->p1; tab = YES; return(OK); case TR: case X: cursor += p->p1; tab = (p->op == TR); return(OK); case APOS: return(wrt_AP(p->p1)); case H: return(wrt_H(p->p1,p->p2)); default: return(errno=F_ERFMT); } } wr_mvcur() { int n; if(tab) return((*dotab)()); while(cursor--) PUT(' ') return(cursor=0); } wrt_IM(ui,w,m,len) uint *ui; ftnlen len; { int ndigit,sign,spare,i,xsign,n; long x; char *ans; if(sizeof(short)==len) x=ui->is; /* else if(len == sizeof(char)) x = ui->ic; */ else x=ui->il; if(x==0 && m==0) { for(i=0;iw || m+xsign>w) { for(i=0;i=m) spare=w-ndigit-xsign; else spare=w-m-xsign; for(i=0;ilen) { w--; PUT(' ') } while(w-- > 0) PUT(*p++) return(OK); } wrt_E(p,w,d,e,len) ufloat *p; ftnlen len; { char *s,ex[4],expch; int dd,dp,sign,i,delta,pad,n; char *ecvt(); expch=(len==sizeof(float)?'e':'d'); if((len==sizeof(float)?p->pf:p->pd)==0.0) { wrt_F(p,w-(e+2),d,len); PUT(expch) PUT('+') /* for(i=0;i<(e-1);i++)PUT(' ') deleted PUT('0') */ /* added */ for(i=0;ipf:p->pd) ,dd,&dp,&sign); delta = 3+e; if(sign||cplus) delta++; pad=w-(delta+d)-(scale>0? scale:0); if(pad<0) { for(i=0;i -d) { PUT('.') for(i=0;i<-scale;i++) PUT('0') for(i=0;i0) for(i=0;ie) { if(pad>(++e)) { PUT(expch) for(i=0;ipf:p->pd); i=d; if(x==0.0) goto zero; x = abs(x); if(x>=0.1) { for(i=0; i<=d; i++, uplim*=10.0) { if(x>uplim) continue; zero: oldscale=scale; scale=0; ne = e+2; if(n = wrt_F(p,w-ne,d-i,len)) return(n); for(j=0; jpf:p->pd); if(scale && x!=0.0) { if(scale>0) for(i=0;i=d) sign=0; ?? */ delta=1; if(sign || cplus) delta++; nf = w - (d + delta + (dp>0?dp:0)); if(nf<0) { for(i=0;i0) for(i=0; i<(nf-(dp<=0?1:0)); i++) PUT(' ') if(sign) PUT('-') else if(cplus) PUT('+') if(dp>0) for(i=0;i0) PUT('0') PUT('.') for(i=0; i< -dp && i=d) sign=0; ?? */ delta=1; if(sign || cplus) delta++; nf = w - (d + delta + (dp>0?dp:0)); if(nf<0) { for(i=0;i0?errflag:endflag,n,dfio) #define STKSZ 10 int cnt[STKSZ],ret[STKSZ],cp,rp; char *dfio = "dofio"; en_fio() { ftnint one=1; return(do_fio(&one,NULL,0l)); } do_fio(number,ptr,len) ftnint *number; ftnlen len; char *ptr; { struct syl *p; int n,i,more; more = *number; for(;;) switch(type_f((p= &syl[pc])->op)) { case NED: DO((*doned)(p,ptr)) pc++; break; case ED: if(ptr==NULL) { DO((*doend)('\n')) return(OK); } if(cnt[cp]<=0) { cp--; pc++; break; } if(!more) return(OK); DO((*doed)(p,ptr,len)) cnt[cp]--; ptr += len; more--; break; case STACK: /* repeat count */ if(++cp==STKSZ) err(errflag,F_ERFMT,"too many nested ()") cnt[cp]=p->p1; pc++; break; case RET: /* open paren */ if(++rp==STKSZ) err(errflag,F_ERFMT,"too many nested ()") ret[rp]=p->p1; pc++; break; case GOTO: /* close paren */ if(--cnt[cp]<=0) { cp--; rp--; pc++; } else pc = ret[rp--] + 1; break; case REVERT: /* end of format */ if(ptr==NULL) { DO((*doend)('\n')) return(OK); } if(!more) return(OK); rp=cp=0; pc = p->p1; DO((*dorevert)()) break; case COLON: #ifndef KOSHER case DOLAR: /*** NOT STANDARD FORTRAN ***/ #endif if (ptr == NULL) { DO((*doend)((char)p->p1)) return(OK); } if (!more) return(OK); pc++; break; #ifndef KOSHER case SU: /*** NOT STANDARD FORTRAN ***/ #endif case SS: case SP: case S: cplus = p->p1; signit = p->p2; pc++; break; case P: scale = p->p1; pc++; break; #ifndef KOSHER case R: /*** NOT STANDARD FORTRAN ***/ radix = p->p1; pc++; break; #endif case BN: case BZ: cblank = p->p1; pc++; break; default: err(errflag,F_ERFMT,"impossible code") } } fmt_bg() { cp=rp=pc=cursor=0; cnt[0]=ret[0]=0; } type_f(n) { #ifdef DEBUG fprintf(stderr," pc=%d, cnt[%d]=%d, ret[%d]=%d, op=%d\n", pc,cp,cnt[cp],rp,ret[rp],n); /*for debug*/ #endif switch(n) { case X: /* non-editing specifications */ case SLASH: case APOS: case H: case T: case TL: case TR: return(NED); case F: /* editing conversions */ case I: case IM: case A: case AW: case L: case E: case EE: case D: case DE: case G: case GE: return(ED); default: return(n); } } e") } } fmt_bg() { cp=rp=pc=cursor=0; cnt[0]=ret[0]=0; } type_f(n) { #ifdef DEBUG fprintf(stderr," pc=%d, cnt[%d]=%d, ret[%d]=%d, op=%d\n", pc,cp,cnt[cp],rp,ret[rp],n); /*for debug*/ #endif switch(nlib/libI77uc/fiodefs.h 644 0 33 4062 2474360457 7773 /* char id_fiodefs[] = "@(#)fiodefs.h 1.1"; * * fortran file i/o type definitions */ #include #include "f_errno.h" /* Logical Unit Table Size */ #define MXUNIT _NFILE #define GLITCH '\2' /* special quote for Stu, generated in f77pass1 */ #define LISTDIRECTED -1 #define FORMATTED 1 #define ERROR 1 #define OK 0 #define YES 1 #define NO 0 #define STDERR 0 #define STDIN 5 #define STDOUT 6 #define WRITE 1 #define READ 2 #define SEQ 3 #define DIR 4 #define FMT 5 #define UNF 6 #define EXT(( 7 #define INT 8 typedef char ioflag; typedef long ftnint; typedef ftnint flag; typedef long ftnlen; typedef struct /*external read, write*/ { flag cierr; ftnint ciunit; flag ciend; char *cifmt; ftnint cirec; } cilist; typedef struct /*internal read, write*/ { flag icierr; char *iciunit; flag iciend; char *icifmt; ftnint icirlen; ftnint icirnum; ftnint icirec; } icilist; typedef struct /*open*/ { flag oerr; ftnint ounit; char *ofnm; ftnlen ofnmlen; char *osta; char *oacc; char *ofm; ftnint orl; char *oblnk; } olist; typedef struct /*close*/ { flag cerr; ftnint cunit; char *csta; } cllist; typedef struct /*rewind, backspace, endfile*/ { flag aerr; ftnint aunit; } alist; typedef struct /*units*/ { FILE *ufd; /*0=unconnected*/ char *ufnm; long uinode; int url; /*0=sequential*/ flag useek; /*true=can backspace, use dir, ...*/ flag ufmt; flag uprnt; flag ublnk; flag uend; flag uwrt; /*last io was write*/ flag uscrtch; } unit; typedef struct /* inquire */ { flag inerr; ftnint inunit; char *infile; ftnlen infilen; ftnint *inex; /*parameters in standard's order*/ ftnint *inopen; ftnint *innum; ftnint *innamed; char *inname; ftnlen innamlen; char *inacc; ftnlen inacclen; char *inseq; ftnlen inseqlen; char *indir; ftnlen indirlen; char *inform; ftnlen informlen; char *infmt; ftnint infmtlen; char *inunf; ftnlen inunflen; ftnint *inrecl; ftnint *innrec; char *inblank; ftnlen inblanklen; } inlist; typedef union { float pf; double pd; } ufloat; typedef union { short is; char ic; long il; } uint; tnint *inex; /*parameters in standard's order*/ ftnint *inopen; ftnint *innum; ftnint *innamed; char *inname; ftnlen innamlen; char *inacc; ftnlen inacclen; char *inseq; ftnlen inseqlen; char *indir; ftnlen indirlen; char *inform; ftnlen informlen; char *infmt; ftnint infmtlen; char *inunf; ftnlen inunflen; ftnint *inrecl; ftnint *innrec; char *inblank; ftnlen inblanklen; } inlist; typedef union { float pf; double pd; } ufloat; typedlib/libI77uc/fio.h 644 0 33 2434 2474360454 7127 /* char id_fio[] = "@(#)fio.h 1.1"; * * f77 file i/o common definitions */ #include "fiodefs.h" #define err(f,n,s) {if(f) return(errno=n); else fatal(n,s);} #define not_legal(u) (u>=MXUNIT || u<0) #define GET(x) if((x=(*getn)())<0) return(x) #define VAL(x) (x!='\n'?x:' ') #define PUT(x) {if(n=(*putn)(x)) return(n);} #define lcase(s) ((s >= 'A') && (s <= 'Z') ? s+('a'-'A') : s) #define MAXINTLENGTH 32 /* to accomodate binary format */ long ftell(); extern int errno; extern ioflag init; extern icilist *svic; /* active internal io list */ extern flag reading,external,sequential,formatted; extern int (*getn)(),(*putn)(),(*ungetn)(); /*for formatted io*/ extern FILE *cf; /*current file structure*/ extern unit *curunit; /*current unit structure */ extern int lunit; /*current logical unit*/ extern char *lfname; /*current filename*/ extern unit units[]; /*logical units table*/ extern int recpos; /*position in current record*/ extern ftnint recnum; /*current record number*/ extern int reclen; /* current record length */ extern int (*doed)(), (*doned)(); extern int (*dorevert)(), (*donewrec)(), (*doend)(), (*dotab)(); extern ioflag cblank, cplus, tab, elist, signit, errflag, endflag; extern char *fmtbuf, *icptr, *icend, *fmtptr; extern int scale; extern int cursor; extern int radix; al unit*/ extern char *lfname; /*current filename*/ extern unit units[]; /*logical units table*/ extern int recpos; /*position in current record*/ extern ftnint recnum; /*current record number*/ extern int reclen; /* current lib/libI77uc/fmt.h 644 0 33 1451 2236644046 7134 /* * format parser definitions */ struct syl { int op,p1,p2,p3; }; #define RET 1 #define REVERT 2 #define GOTO 3 #define X 4 #define SLASH 5 #define STACK 6 #define I 7 #define ED 8 #define NED 9 #define IM 10 #define APOS 11 #define H 12 #define TL 13 #define TR 14 #define T 15 #define COLON 16 #define S 17 #define SP 18 #define SS 19 #define P 20 #define BN 21 #define BZ 22 #define F 23 #define E 24 #define EE 25 #define D 26 #define DE 27 /*** NOT STANDARD FORTRAN ***/ #define G 28 #define GE 29 #define L 30 #define A 31 #define AW 32 #define R 33 /*** NOT STANDARD FORTRAN ***/ #define DOLAR 34 /*** NOT STANDARD FORTRAN ***/ #define SU 35 /*** NOT STANDARD FORTRAN ***/ #define FMTOK 1 #define FMTERR 0 extern struct syl syl[]; extern int pc,parenlvl,revloc; #define COLON 16 #define S 17 #define SP 18 #define SS 19 #define P 20 #define BN 21 #define BZ 22 #define F 23 #define E 24 #define EE 25 #define D 26 #define DE 27 /*** NOT STANDARD FORTRAN ***/ #definlib/libI77uc/lio.h 644 0 33 2347 2474360470 7136 /* char id_lio[] = "@(#)lio.h 1.1"; * * copy of ftypes from the compiler * variable types numeric assumptions: * int < reals < complexes * TYDREAL-TYREAL = TYDCOMPLEX-TYCOMPLEX */ #define TYUNKNOWN 0 #define TYADDR 1 #define TYSHORT 2 #define TYLONG 3 #define TYREAL 4 #define TYDREAL 5 #define TYCOMPLEX 6 #define TYDCOMPLEX 7 #define TYLOGICAL 8 #define TYCHAR 9 #define TYSUBR 10 #define TYERROR 11 #define NTYPES (TYERROR+1) #define LINE 80 #define LINTW (strlen(buf)) #define LLOGW 3 #define LSTRW (len+2) #define LLOW 1.0e-1 #define LHIGH 1.0e+LFD #define LDHIGH 1.0e+LDFD #define LFD 6 #define LFW (LFD+4) #define LDFD 14 #define LDFW (LDFD+4) #define LED LFD #define LEW LFW+4 #define LEE 2 #define LDED LDFD #define LDEW LDFW+4 #define LDEE 2 #define LCW (width(a)+width(b)+5) #define LDCW (dwidth(a)+dwidth(b)+5) #define abs(z) (z<0?-z:z) #define width(z) ((z!=0.0 && (abs(z)>=LHIGH || abs(z)=LDHIGH || abs(z)0?errflag:endflag,n,"list io") typedef union { short flshort; ftnint flint; float flreal; double fldouble; } flex; extern int (*lioproc)(); extern flag leof; extern ioflag lquit,l_first; extern int lcount,line_len; W+4 #define LDEE 2 #define LCW (width(a)+width(b)+5) #define LDCW (dwidth(a)+dwidth(b)+5) #define abs(z) (z<0?-z:z) #define width(z) ((z!=0.0 && (abs(z)>=LHIGH || abs(z)=LDHIGH || abs(z)labtype == LABUNKNOWN) { lp->labtype = LABFORMAT; lp->labelno = newlabel(); } else if(lp->labtype != LABFORMAT) { execerr("bad format number", 0); return(-1); } return(lp->labelno); } setfmt(lp) struct Labelblock *lp; { ftnint n; char *s, *lexline(); s = lexline(&n); preven(ALILONG); prlabel(asmfile, lp->labelno); putstr(asmfile, s, n); flline(); } startioctl() { register int i; inioctl = YES; nioctl = 0; ioformatted = UNFORMATTED; for(i = 1 ; i<=NIOS ; ++i) V(i) = NULL; } endioctl() { int i; expptr p; inioctl = NO; if(ioblkp == NULL) ioblkp = autovar( (MAXIO+SZIOINT-1)/SZIOINT , TYIOINT, NULL); /* set up for error recovery */ ioerrlab = ioendlab = jumplab = 0; skiplab = iosreturn = NO; if(p = V(IOSEND)) if(ISICON(p)) ioendlab = mklabel(p->constblock.const.ci)->labelno; else err("bad end= clause"); if(p = V(IOSERR)) if(ISICON(p)) ioerrlab = mklabel(p->constblock.const.ci)->labelno; else err("bad err= clause"); if(IOSTP) if(IOSTP->headblock.tag!=TADDR || ! ISINT(IOSTP->addrblock.vtype) ) { err("iostat must be an integer variable"); frexpr(IOSTP); IOSTP = NULL; } #ifdef IOSRETURN else iosreturn = YES; if(iosreturn && IOSRW && !(ioerrlab && ioendlab) ) { jumplab = newlabel(); iostest = OPEQ; if(ioerrlab || ioendlab) skiplab = YES; } else if(ioerrlab && !ioendlab) #else if(ioerrlab && !ioendlab) #endif { jumplab = ioerrlab; iostest = IOSRW ? OPLE : OPEQ; } else if(!ioerrlab && ioendlab) { jumplab = ioendlab; iostest = OPGE; } else if(ioerrlab && ioendlab) { iostest = OPEQ; if(ioerrlab == ioendlab) jumplab = ioerrlab; else { if(!IOSTP) IOSTP = mktemp(TYINT, NULL); jumplab = newlabel(); skiplab = YES; } } /*else if(IOSTP) /* the standard requires this return! */ /* { /* iosreturn = YES; /* if(iostmt==IOREAD || iostmt==IOWRITE) /* { /* jumplab = newlabel(); /* iostest = OPEQ; /* } /* } */ ioset(TYIOINT, XERR, ICON(ioerrlab!=0 || iosreturn) ); switch(iostmt) { case IOOPEN: dofopen(); break; case IOCLOSE: dofclose(); break; case IOINQUIRE: dofinquire(); break; case IOBACKSPACE: dofmove("f_back"); break; case IOREWIND: dofmove("f_rew"); break; case IOENDFILE: dofmove("f_end"); break; case IOREAD: case IOWRITE: startrw(); break; default: fatali("impossible iostmt %d", iostmt); } for(i = 1 ; i<=NIOS ; ++i) if(i!=IOSIOSTAT && V(i)!=NULL) frexpr(V(i)); } iocname() { register int i; int found, mask; found = 0; mask = M(iostmt); for(i = 1 ; i <= NIOS ; ++i) if(toklen==strlen(ioc[i].iocname) && eqn(toklen, token, ioc[i].iocname)) if(ioc[i].iotype & mask) return(i); else found = i; if(found) errstr("invalid control %s for statement", ioc[found].iocname); else errstr("unknown iocontrol %s", varstr(toklen, token) ); return(IOSBAD); } ioclause(n, p) register int n; register expptr p; { struct Ioclist *iocp; ++nioctl; if(n == IOSBAD) return; if(n == IOSPOSITIONAL) { if(nioctl > IOSFMT) { err("illegal positional iocontrol"); return; } n = nioctl; } if(p == NULL) { if(n == IOSUNIT) p = (iostmt==IOREAD ? IOSTDIN : IOSTDOUT); else if(n != IOSFMT) { err("illegal * iocontrol"); return; } } if(n == IOSFMT) ioformatted = (p==NULL ? LISTDIRECTED : FORMATTED); iocp = & ioc[n]; if(iocp->iocval == NULL) { if(n!=IOSFMT && ( n!=IOSUNIT || (p!=NULL && p->headblock.vtype!=TYCHAR) ) ) p = fixtype(p); iocp->iocval = p; } else errstr("iocontrol %s repeated", iocp->iocname); } /* io list item */ doio(list) chainp list; { struct Exprblock *call0(); doiolist(list); ioroutine[0] = 'e'; putiocall( call0(TYINT, ioroutine) ); } LOCAL doiolist(p0) chainp p0; { chainp p; register tagptr q; register expptr qe; register struct Nameblock *qn; struct Addrblock *tp, *mkscalar(); int range; for (p = p0 ; p ; p = p->nextp) { q = p->datap; if(q->headblock.tag == TIMPLDO) { exdo(range=newlabel(), q->impldoblock.varnp); doiolist(q->impldoblock.datalist); enddo(range); free(q); } else { if(q->headblock.tag==TPRIM && q->primblock.argsp==NULL && q->primblock.namep->vdim!=NULL) { vardcl(qn = q->primblock.namep); if(qn->vdim->nelt) putio( fixtype(cpexpr(qn->vdim->nelt)), mkscalar(qn) ); else err("attempt to i/o array of unknown size"); } else if(q->headblock.tag==TPRIM && q->primblock.argsp==NULL && (qe = memversion(q->primblock.namep)) ) putio(ICON(1),qe); else if( (qe = fixtype(cpexpr(q)))->headblock.tag==TADDR) putio(ICON(1), qe); else if(qe->headblock.vtype != TYERROR) { if(iostmt == IOWRITE) { tp = mktemp(qe->headblock.vtype, qe->headblock.vleng); puteq( cpexpr(tp), qe); putio(ICON(1), tp); } else err("non-left side in READ list"); } frexpr(q); } } frchain( &p0 ); } LOCAL putio(nelt, addr) expptr nelt; register expptr addr; { int type; register struct Exprblock *q; type = addr->headblock.vtype; if(ioformatted!=LISTDIRECTED && ISCOMPLEX(type) ) { nelt = mkexpr(OPSTAR, ICON(2), nelt); type -= (TYCOMPLEX-TYREAL); } /* pass a length with every item. for noncharacter data, fake one */ if(type != TYCHAR) { if( ISCONST(addr) ) addr = putconst(addr); addr->headblock.vtype = TYCHAR; addr->headblock.vleng = ICON( typesize[type] ); } nelt = fixtype( mkconv(TYLENG,nelt) ); if(ioformatted == LISTDIRECTED) q = call3(TYINT, "do_lio", mkconv(TYLONG, ICON(type)), nelt, addr); else q = call2(TYINT, (ioformatted==FORMATTED ? "do_fio" : "do_uio"), nelt, addr); putiocall(q); } endio() { if(skiplab) { putlabel(jumplab); if(ioendlab) putif( mkexpr(OPGE, cpexpr(IOSTP), ICON(0)), ioendlab); if(ioerrlab) putif( mkexpr(OPLE, cpexpr(IOSTP), ICON(0)), ioerrlab); } else if(iosreturn && jumplab) putlabel(jumplab); if(IOSTP) frexpr(IOSTP); } LOCAL putiocall(q) register struct Exprblock *q; { if(IOSTP) { q->vtype = TYINT; q = fixexpr( mkexpr(OPASSIGN, cpexpr(IOSTP), q)); } if(jumplab) putif( mkexpr(iostest, q, ICON(0) ), jumplab); else putexpr(q); } startrw() { register expptr p; register struct Nameblock *np; register struct Addrblock *unitp, *nump; struct Constblock *mkaddcon(); int k, fmtoff; int intfile, sequential; intfile = NO; if(p = V(IOSUNIT)) { if( ISINT(p->headblock.vtype) ) ioset(TYIOINT, XUNIT, cpexpr(p) ); else if(p->headblock.vtype == TYCHAR) { intfile = YES; if(p->headblock.tag==TPRIM && p->primblock.argsp==NULL && (np = p->primblock.namep)->vdim!=NULL) { vardcl(np); if(np->vdim->nelt) nump = cpexpr(np->vdim->nelt); else { err("attempt to use internal unit array of unknown size"); nump = ICON(1); } unitp = mkscalar(np); } else { nump = ICON(1); unitp = fixtype(cpexpr(p)); } ioset(TYIOINT, XIRNUM, nump); ioset(TYIOINT, XIRLEN, cpexpr(unitp->vleng) ); ioset(TYADDR, XIUNIT, addrof(unitp) ); } } else err("bad unit specifier"); sequential = YES; if(p = V(IOSREC)) if( ISINT(p->headblock.vtype) ) { ioset(TYIOINT, (intfile ? XIREC : XREC), cpexpr(p) ); sequential = NO; } else err("bad REC= clause"); ioset(TYIOINT, (intfile ? XIEND : XEND), ICON(ioendlab!=0 || iosreturn) ); fmtoff = (intfile ? XIFMT : XFMT); if(p = V(IOSFMT)) { if(p->headblock.tag==TPRIM && p->primblock.argsp==NULL) { vardcl(np = p->primblock.namep); if(np->vdim) { ioset(TYADDR, fmtoff, addrof(mkscalar(np)) ); goto endfmt; } if( ISINT(np->vtype) ) { ioset(TYADDR, fmtoff, p); goto endfmt; } } p = V(IOSFMT) = fixtype(p); if(p->headblock.vtype == TYCHAR) ioset(TYADDR, fmtoff, addrof(cpexpr(p)) ); else if( ISICON(p) ) { if( (k = fmtstmt( mklabel(p->constblock.const.ci) )) > 0 ) ioset(TYADDR, fmtoff, mkaddcon(k) ); else ioformatted = UNFORMATTED; } else { err("bad format descriptor"); ioformatted = UNFORMATTED; } } else ioset(TYADDR, fmtoff, ICON(0) ); endfmt: if(intfile && ioformatted==UNFOR((MATTED) err("unformatted internal I/O not allowed"); if(!sequential && ioformatted==LISTDIRECTED) err("direct list-directed I/O not allowed"); ioroutine[0] = 's'; ioroutine[1] = '_'; ioroutine[2] = (iostmt==IOREAD ? 'r' : 'w'); ioroutine[3] = (sequential ? 's' : 'd'); ioroutine[4] = "ufl" [ioformatted]; ioroutine[5] = (intfile ? 'i' : 'e'); ioroutine[6] = '\0'; putiocall( call1(TYINT, ioroutine, cpexpr(ioblkp) )); } LOCAL dofopen() { register expptr p; if( (p = V(IOSUNIT)) && ISINT(p->headblock.vtype) ) ioset(TYIOINT, XUNIT, cpexpr(p) ); else err("bad unit in open"); if( (p = V(IOSFILE)) ) if(p->headblock.vtype == TYCHAR) ioset(TYIOINT, XFNAMELEN, cpexpr(p->headblock.vleng) ); else err("bad file in open"); iosetc(XFNAME, p); if(p = V(IOSRECL)) if( ISINT(p->headblock.vtype) ) ioset(TYIOINT, XRECLEN, cpexpr(p) ); else err("bad recl"); else ioset(TYIOINT, XRECLEN, ICON(0) ); iosetc(XSTATUS, V(IOSSTATUS)); iosetc(XACCESS, V(IOSACCESS)); iosetc(XFORMATTED, V(IOSFORM)); iosetc(XBLANK, V(IOSBLANK)); putiocall( call1(TYINT, "f_open", cpexpr(ioblkp) )); } LOCAL dofclose() { register expptr p; if( (p = V(IOSUNIT)) && ISINT(p->headblock.vtype) ) { ioset(TYIOINT, XUNIT, cpexpr(p) ); iosetc(XCLSTATUS, V(IOSSTATUS)); putiocall( call1(TYINT, "f_clos", cpexpr(ioblkp)) ); } else err("bad unit in close statement"); } LOCAL dofinquire() { register expptr p; if(p = V(IOSUNIT)) { if( V(IOSFILE) ) err("inquire by unit or by file, not both"); ioset(TYIOINT, XUNIT, cpexpr(p) ); } else if( ! V(IOSFILE) ) err("must inquire by unit or by file"); iosetlc(IOSFILE, XFILE, XFILELEN); iosetip(IOSEXISTS, XEXISTS); iosetip(IOSOPENED, XOPEN); iosetip(IOSNUMBER, XNUMBER); iosetip(IOSNAMED, XNAMED); iosetlc(IOSNAME, XNAME, XNAMELEN); iosetlc(IOSACCESS, XQACCESS, XQACCLEN); iosetlc(IOSSEQUENTIAL, XSEQ, XSEQLEN); iosetlc(IOSDIRECT, XDIRECT, XDIRLEN); iosetlc(IOSFORM, XFORM, XFORMLEN); iosetlc(IOSFORMATTED, XFMTED, XFMTEDLEN); iosetlc(IOSUNFORMATTED, XUNFMT, XUNFMTLEN); iosetip(IOSRECL, XQRECL); iosetip(IOSNEXTREC, XNEXTREC); iosetlc(IOSBLANK, XQBLANK, XQBLANKLEN); putiocall( call1(TYINT, "f_inqu", cpexpr(ioblkp) )); } LOCAL dofmove(subname) char *subname; { register expptr p; if( (p = V(IOSUNIT)) && ISINT(p->headblock.vtype) ) { ioset(TYIOINT, XUNIT, cpexpr(p) ); putiocall( call1(TYINT, subname, cpexpr(ioblkp) )); } else err("bad unit in I/O motion statement"); } LOCAL ioset(type, offset, p) int type, offset; expptr p; { register struct Addrblock *q; q = cpexpr(ioblkp); q->vtype = type; q->memoffset = fixtype( mkexpr(OPPLUS, q->memoffset, ICON(offset)) ); puteq(q, p); } LOCAL iosetc(offset, p) int offset; register expptr p; { if(p == NULL) ioset(TYADDR, offset, ICON(0) ); else if(p->headblock.vtype == TYCHAR) ioset(TYADDR, offset, addrof(cpexpr(p) )); else err("non-character control clause"); } LOCAL iosetip(i, offset) int i, offset; { register expptr p; if(p = V(i)) if(p->headblock.tag==TADDR && ONEOF(p->addrblock.vtype, M(TYLONG)|M(TYLOGICAL)) ) ioset(TYADDR, offset, addrof(cpexpr(p)) ); else errstr("impossible inquire parameter %s", ioc[i].iocname); else ioset(TYADDR, offset, ICON(0) ); } LOCAL iosetlc(i, offp, offl) int i, offp, offl; { register expptr p; if( (p = V(i)) && p->headblock.vtype==TYCHAR) ioset(TYIOINT, offl, cpexpr(p->headblock.vleng) ); iosetc(offp, p); } ; } LOCAL iosetip(i, offset) int i, offset; { register expptr p; if(p = V(i)) if(p->headblock.tag==TADDR && ONEOF(p->addrblock.vtype, M(TYLONG)|M(TYLOGICAL)) ) ioset(TYADDR, offset, addroflib/libI77uc/mkvers.c 640 0 33 2103 2474365070 7640 char id_mkvers[] = "%W%"; /* * extract sccs id strings from source files * first arg is lib name. * Put them in Version.c */ #include #define SCCS_ID "@(#)" #define VERSION "Version.c" main(argc, argv) int argc; char **argv; { char buf[256]; char *s, *e; char *index(), *ctime(); long t; FILE *V, *fdopen(); V = stdout; /* fdopen(creat(VERSION, 0644), "w"); */ if (!V) { perror("mkvers"); exit(1); } fprintf(V, "char *sccs_id[] = {\n"); if (argc-- > 1) { time(&t); s = ctime(&t) + 4; s[20] = '\0'; fprintf(V, "\t\"%s%s\t%s\",\n", SCCS_ID, *++argv, s); } while (--argc) { if (freopen(*++argv, "r", stdin) == NULL) { perror(*argv); continue; } while(gets(buf)) { s = buf; while(s = index(s, '@')) if (strncmp(s, SCCS_ID, 4) == 0) break; if (s) { e = index(s, '"'); if (e) { *e = '\0'; fprintf(V, "\t\"%s\",\n", s); break; } } } if (feof(stdin)) fprintf(stderr, "%s: no sccs id string\n", *argv); } fprintf(V, "};\n"); fclose(V); fflush(stdout); fflush(stderr); } ID, *++argv, s); } while (--argc) { if (freopen(*++argv, "r", stdin) == NULL) { perror(*argv); continue; } while(gets(buf)) { s = buf; while(s = index(s, '@')) if (strncmp(s, SCCS_ID, 4) == 0) break; if (s) { e = index(s, '"'); if (e) { *e = '\0'; fprintf(V, "\t\"%s\",\n", s); break; } } } if (feof(stdin)) fprintf(stderr, "%s: no sccs id string\n", *argv); } flib/libI77uc/mkindx.c 640 0 33 2015 2474663630 7630 /* * mkindx.c - utility to format a nice index to source files, etc. * * usage: mkindx "title string" [file_name] [filename] ..... */ # include char list[1000] = "pwd >>index; echo \" \" >>index; ls -l "; char *apndx = ">>index"; char *cp = list; extern char *ctime(); FILE *fopen(), *index; main (argc, argv) char **argv; { short i; long time(), t; if (index = fopen ("index", "w")) { fprintf (index, "\n\n\n\n\n\n\n\n\n"); center (argv[1]); /* center title on page */ t = time(0); center (ctime(&t)); /* center date & time */ fprintf (index, "\n"); fclose (index); while (*cp) cp++; /* find end of shell command */ for (i = 2; i < argc; i++) { while (*argv[i]) *cp++ = *(argv[i]++); *cp++ = ' '; } while (*apndx) *cp++ = *apndx++; *cp = '\0'; system (list); } else fprintf (stderr, "mkindx: can't open index\n"); } center (string) char *string; { short pad; pad = (72 - strlen(string)) >> 1; while (pad-- > 0) fputc(' ', index); fprintf (index, "%s\n", string); } (ctime(&t)); /* center date & time */ fprintf (index, "\n"); fclose (index); while (*cp) cp++; /* find end of shell command */ for (i = 2; i < argc; i++) { while (*argv[i]) *cp++ = *(argv[i]++); *cp++ = ' '; } while (*apndx) *cp++ = *apndx++; *cp = '\0'; system (list); } else fprintf (stderr, "mkindx: can't open index\n"); } center (string) char *string; { short pad; pad = (72 - strlen(string)) >> 1; while (pad-- > 0) fputc(' ', index); fprintf (index, "%s\n"lib/libI77uc/libI77.fix 664 0 33 6562 2523205127 7744 From G:dlw Tue Apr 28 14:03:40 1981 To: r:sklower Subject: reading into (nH.... The following puts it back. David ---- Apr 28 13:56 1981 s.rdfmt.c: -r1.2 vs. -r1.3 Page 1 55,58c55,60 < /* case APOS: < /* return(rd_POS(p->p1)); < /* case H: < /* return(rd_H(p->p1,p->p2)); */ --- > #ifndef KOSHER > case APOS: /* NOT STANDARD F77 */ > return(rd_POS((char *)p->p1)); > case H: /* NOT STANDARD F77 */ > return(rd_H(p->p1,(char *)p->p2)); > #endif 234,253c236,264 < /*rd_H(n,s) char *s; < /*{ int i,ch; < /* for(i=0;i rd_H(n,s) char *s; > { int i,ch = 0; > for(i=0;i { if (ch != '\n') > GET(ch); > if (ch == '\n') > *s++ = ' '; > else > *s++ = ch; > } > return(OK); > } > > rd_POS(s) char *s; > { char quote; > int ch = 0; > quote = *s++; > while(*s) > { if(*s==quote && *(s+1)!=quote) > break; > if (ch != '\n') > GET(ch); > if (ch == '\n') > *s++ = ' '; > else > *s++ = ch; > } > return(OK); > } From G:dlw Tue Apr 28 19:48:37 1981 To: r:sklower Subject: fort-66 carriage control on lu.6 Below are diffs to allow initialization of the I/O lib for carriage control on logical unit 6 (stdout). The "trick" is to load a module that initializes a short int (init66_) to: for fortran-66, 0 for f-77 (this is the default) Now, there are several ways to force init66_ to be set. 1) pass "-u _init66_" to the loader. This is next to impossible with the f77 driver as it is. 2) load a BLOCK DATA module that does the initialization. For example: block data old66 common /init66/ iflag integer*2 iflag data iflag/1/ end The following two routines are new in libI77(( ..... --- yes_66.c --- /* char id_yes_66[] = "@(#)yes_66.c 1.1"; * set flag to initialize fortran-66 mods * * user's load command must include "-u _init66_" */ short init66_ = 1; --- no_66.c --- /* char id_no_66[] = "@(#)no_66.c 1.1"; * flag to NOT initialize fortran-66 mods */ short init66_ = 0; --- sccsdiffs for other affected routines --- Apr 28 19:31 1981 s.Makefile: -r1.8 vs. -r1.9 Page 1 20c20,21 < dofio.c f_errlist.c f_errno.h fiodefs.h fio.h format.h lio.h --- > dofio.c f_errlist.c yes_66.c no_66.c \ > f_errno.h fiodefs.h fio.h format.h lio.h 26c27 < dballoc.o err.o util.o f_errlist.o --- > dballoc.o yes_66.o err.o no_66.o util.o f_errlist.o Apr 28 19:29 1981 s.err.c: -r1.4 vs. -r1.5 Page 1 148,150c148,151 < { ini_std(STDERR, stderr, WRITE); < ini_std(STDIN, stdin, READ); < ini_std(STDOUT, stdout, WRITE); --- > { extern short init66_; > ini_std(STDERR, stderr, WRITE, 0); > ini_std(STDIN, stdin, READ, 0); > ini_std(STDOUT, stdout, WRITE, init66_); Apr 28 19:30 1981 s.util.c: -r1.2 vs. -r1.3 Page 1 12c12 < ini_std(u,F,w) FILE *F; --- > ini_std(u,F,w,i66) FILE *F; 20c20,21 < p->ublnk = p->uscrtch = p->uprnt = p->uend = NO; --- > p->ublnk = p->uscrtch = p->uend = NO; > p->uprnt = (i66!=0)? YES : NO; ------------------------------------------------- Please let me know if this allows the "standard nbs" tests to run. David 6_; > ini_std(STDERR, stderr, WRITE, 0); > ini_std(STDIN, stdin, READ, 0); > ini_std(STDOUT, stdout, WRITE, init66_); Apr 28 19:30 1981lib/libI77uc/f_errlist.c 400 0 33 1670 2477314141 10320 /* char id_f_errlist[] = "@(#)f_errlist.c 1.2"; * * f77 I/O error messages */ char *f_errlist[] = { /* 100 */ "error in format", /* 101 */ "illegal unit number", /* 102 */ "formatted io not allowed", /* 103 */ "unformatted io not allowed", /* 104 */ "direct io not allowed", /* 105 */ "sequential io not allowed", /* 106 */ "can't backspace file", /* 107 */ "off beginning of record", /* 108 */ "can't stat file", /* 109 */ "no * after repeat count", /* 110 */ "off end of record", /* 111 */ "truncation failed", /* 112 */ "incomprehensible list input", /* 113 */ "out of free space", /* 114 */ "unit not connected", /* 115 */ "read unexpected character", /* 116 */ "blank logical input field", /* 117 */ "'new' file exists", /* 118 */ "can't find 'old' file", /* 119 */ "unknown system error", /* 120 */ "requires seek ability", /* 121 */ "illegal argument", /* 122 */ "negative repeat count", }; int f_nerr = (sizeof(f_errlist)/sizeof(char *)); repeat count", /* 110 */ "off end of record", /* 111 */ "truncation faillib/libI77uc/f_errno.h 600 0 33 2517 2477322351 7773 /* char id_f_errno[] = "@(#)f_errno.h 1.4"; * * f77 I/O error definitions */ #include extern int errno; extern int f_nerr; #define F_ER 100 /* base offset of f77 error numbers */ #define F_ERFMT 100 /* error in format */ #define F_ERUNIT 101 /* illegal unit number */ #define F_ERNOFIO 102 /* formatted io not allowed */ #define F_ERNOUIO 103 /* unformatted io not allowed */ #define F_ERNODIO 104 /* direct io not allowed */ #define F_ERNOSIO 105 /* sequential io not allowed */ #define F_ERNOBKSP 106 /* can't backspace file */ #define F_ERBREC 107 /* off beginning of record */ #define F_ERSTAT 108 /* can't stat file */ #define F_ERREPT 109 /* no * after repeat count */ #define F_EREREC 110 /* off end of record */ #define F_ERTRUNC 111 /* truncation failed */ #define F_ERLIO 112 /* incomprehensible list input */ #define F_ERSPACE 113 /* out of free space */ #define F_ERNOPEN 114 /* unit not connected */ #define F_ERRDCHR 115 /* read unexpected character */ #define F_ERLOGIF 116 /* blank logical input field */ #define F_ERNEWF 117 /* 'new' file exists */ #define F_EROLDF 118 /* can't find 'old' file */ #define F_ERSYS 119 /* unknown system error */ #define F_ERSEEK 120 /* requires seek ability */ #define F_ERARG 121 /* illegal argument */ #define F_ERNREP 122 /* negative repeat count */ #define F_MAXERR (f_nerr + F_ER) F_ERSPACE 113 /* out of free space */ #define F_ERNOPEN 114 /* unit not connected */ #define F_ERRDCHR 115 /* read unexpected character */ #define F_ERLOGIF 116 /* blank logicalib/libI77uc/format.h 600 0 33 1525 2474362737 7640 /* char id_format[] = "@(#)format.h 1.1"; * * format parser definitions */ struct syl { int op,p1,p2,p3; }; #define RET 1 #define REVERT 2 #define GOTO 3 #define X 4 #define SLASH 5 #define STACK 6 #define I 7 #define ED 8 #define NED 9 #define IM 10 #define APOS 11 #define H 12 #define TL 13 #define TR 14 #define T 15 #define COLON 16 #define S 17 #define SP 18 #define SS 19 #define P 20 #define BN 21 #define BZ 22 #define F 23 #define E 24 #define EE 25 #define D 26 #define DE 27 /*** NOT STANDARD FORTRAN ***/ #define G 28 #define GE 29 #define L 30 #define A 31 #define AW 32 #define R 33 /*** NOT STANDARD FORTRAN ***/ #define DOLAR 34 /*** NOT STANDARD FORTRAN ***/ #define SU 35 /*** NOT STANDARD FORTRAN ***/ #define FMTOK 1 #define FMTERR 0 extern struct syl syl[]; extern int pc,parenlvl,revloc; #define COLON 16 #define S 17 #define SP 18 #define SS 19 #define P 20 #define BN 21 #define BZ 22 #define F 23 #define E 24 #define EE 25 #define D 26 #define lib/libI77uc/Version.c 664 0 33 1257 2526433043 7767 char *sccs_id[] = { "@(#)libI77uc.a May 8 22:20:34 1981", "@(#)backspace.c 1.2", "@(#)close.c 1.2", "@(#)dballoc.c 1.3", "@(#)dfe.c 1.2", "@(#)due.c 1.2", "@(#)endfile.c 1.2", "@(#)err.c 1.4", "@(#)fmt.c 1.2", "@(#)fmtlib.c 1.2", "@(#)iio.c 1.2", "@(#)inquire.c 1.2", "@(#)lwrite.c 1.2", "@(#)lread.c 1.2", "@(#)dolio.c 1.2", "@(#)open.c 1.2", "@(#)rdfmt.c 1.2", "@(#)rewind.c 1.2", "@(#)sfe.c 1.2", "@(#)sue.c 1.2", "@(#)douio.c 1.2", "@(#)util.c 1.2", "@(#)wrtfmt.c 1.3", "@(#)dofio.c 1.2", "@(#)f_errlist.c 1.2", "@(#)f_errno.h 1.4", "@(#)fiodefs.h 1.1", "@(#)fio.h 1.1", "@(#)format.h 1.1", "@(#)lio.h 1.1", "@(#)yes_66.c 1.1", "@(#)no_66.c 1.1", }; .c 1.2", "@(#)err.c 1.4", "@(#)fmt.c 1.2", "@(#)fmtlib.c 1.2", "@(#)iio.c 1.2", "@(#)inquire.c 1.2", "@(#)lwrite.c 1.2", "@(#)lread.c 1.2", "@(#)dolio.c 1.2", "@(#)open.c 1.2", "@(#)rdfmt.c 1.2", "@(#)rewind.c 1.2", "@(#)sfe.c 1.2", "@(#)sue.c 1.2", "@(#)douio.c 1.2", "@(#)util.c 1.2", "@(#)wrtfmt.c 1.3", "@(#)dofio.c lib/libI77uc/yes_66.c 664 0 33 256 2525742203 7433 /* char id_yes_66[] = "@(#)yes_66.c 1.1"; * set flag to initialize fortran-66 mods * * user's load command must include "-u _init66_" */ short init66_ = 1; yes_66_(){} .c 1.2", "@(#)err.c 1.4", "@(#)fmt.c 1.2", "@(#)fmtlib.c 1.2", "@(#)iio.c 1.2", "@(#)inquire.c 1.2", "@(#)lwrite.c 1.2", "@(#)lread.c 1.2", "@(#)dolio.c 1.2", "@(#)open.c 1.2", "@(#)rdfmt.c 1.2", "@(#)rewind.c 1.2", "@(#)sfe.c 1.2", /,5< /,"lib/libI77uc/err.fix 664 0 33 2346 2526432342 7477 From G:dlw Fri May 8 10:07:35 1981 To: e:dlw o:asa r:sklower v:ucsfcgl!tef Subject: libI77 error reporting bug fix There is a bug in the routine that displays external data on read errors. The essential fix is to move a ) on line 111. I've also caused such output to treat non-graphic chars in the traditional fashion (^I) since a very common error is for data files to include imbedded TABs. The following diff is for my current rev. David ----- May 8 09:57 1981 s.err.c: -r1.5 vs. -r1.6 Page 1 108c108(( < while(i--) fputc(fgetc(curunit->ufd),stderr); --- > while(i--) ffputc(fgetc(curunit->ufd),stderr); 111c111 < for(i=0;i<5 && (ch=fgetc(curunit->ufd)!=EOF);i++) fputc(ch,stderr); --- > for(i=0;i<5 && (ch=fgetc(curunit->ufd))!=EOF;i++) ffputc(ch,stderr); 119c119 < while (ep while (ep while (ep<(icptr+5) && ep { ffputc((*ep==GLITCH)?'"':*ep,stderr); 145a146,158 > ffputc(c, f) > int c; > FILE *f; > { > c &= 0177; > if (c < ' ' || c == 0177) > { > fputc('^', f); > c ^= 0100; > } > fputc(c, f); > } > )!=EOF;i++) ffputc(ch,stderr); 119c119 < while (ep while (ep while (ep<(icptr+5) && ep c ^= 0100; > } > fputc(c, f); > } > )!=EOF;i++) ffputc(ch,stderr); 119c119 < while (ep while (ep c ^= 0100; > } > fputc(c, f); > } > )!=EOF;i++) ffputc(ch,stderr); 119c119 < while (ep while (ep } > )!=EOF;i++) ffputc(ch,stderr); 119c119 < while (ep while (ep while (ep dividend, and 1 otherwise, # provided that the comparison is made as unsigned. # .text .align 1 .globl udiv udiv: .word 0x0000 movl 4(ap),r0 # Dividend movl 8(ap),r2 # Divisor jeql div # If divisor=0, force exception cmpl r2,$1 # If divisor <= 1 (signed), jleq nodiv # no division is necessary div: clrl r1 # Zero-extend the dividend ediv r2,r0,r0,r2 # Divide. q->r0, r->r2 (discarded) ret nodiv: jeql retn # If divisor=1, return dividend cmpl r0,r2 # Unsigned comparison between jgequ one # dividend and divisor clrl r0 # Dividend < divisor, return 0 ret one: movl $1,r0 # Dividend >= divisor, return 1 retn: ret movl 4(ap),r0 # Dividend movl 8(ap),r2 # Divisor jeql div # If divisor=0, force exception cmpl r2,$1 # If divisor <= 1 (signed), jleq nodiv # no division is necessary div: clrl r1 # Zero-extend the dividend ediv r2,r0,r0,r2 # Divide. q->r0, r->r2 (discarded) ret nodiv: jeql retn # If divisor=1, return dividend cmpl r0,r2 # Unsigned libc/crt/urem.s 444 0 33 2351 2451005520 6660 # @(#)urem.s 4.1 (Berkeley) 12/21/80 # # urem - unsigned remainder for vax-11 # # arguments: dividend, divisor # result: remainder # uses r0-r2 # # if 1 < divisor <= 2147483647, zero-extend the dividend # to 64 bits and let ediv do the work. If the divisor is 1, # ediv will overflow if bit 31 of the dividend is on, so # just return 0. If the divisor is 0, do the ediv also, # so it will generate the proper exception. All other values # of the divisor have bit 31 on: in this case the remainder # must be the dividend if divisor > dividend, and the dividend # minus the divisor otherwise. The comparison must be unsigned. # .text .align 1 .globl urem urem: .word 0x0000 movl 4(ap),r0 # Dividend movl 8(ap),r2 # Divisor jeql div # If divisor=0, force exception cmpl r2,$1 # If divisor <= 1 (signed), jleq nodiv # no division is necessary div: clrl r1 # Zero-extend the dividend ediv r2,r0,r2,r0 # Divide. q->r2 (discarded), r->r0 ret nodiv: jneq nzero # If divisor=1, return 0 clrl r0 # (because doing the divide will overflow ret # if the dividend has its high bit on) nzero: cmpl r0,r2 # If dividend < divisor (unsigned) jlssu retn # remainder is dividend subl2 r2,r0 # else remainder is dividend - divisor retn: ret divisor=0, force exception cmpl r2,$1 # If divisor <= 1 (signed), jleq nodiv # no division is necessary div: clrl r1 # Zero-extend the dividend ediv r2,r0,r2,r0 # Divide. q->r2 (discarded), r->r0 ret nodiv: jneq nzero # If divisor=1, return 0 clrl r0 # (because doi((libc/crt/Makefile 644 0 33 346 2451007631 7155 # %W% (Berkeley) %G% CFLAGS= -O OBJS= cerror.o mcount.o udiv.o urem.o .c.o: ${CC} ${CFLAGS} -c $*.c -ld -x -r $*.o mv a.out $*.o .s.o: ${AS} -o $*.o $*.s -ld -x -r $*.o mv a.out $*.o all: ${OBJS} clean: rm -f ${OBJS} divisor=0, force exception cmpl r2,$1 # If divisor <= 1 (signed), jleq nodiv # no division is necessary div: clrl r1 # Zero-extend the dividend ediv r2,r0,r2,r0 # Divide. q->r2 (/,5  /,"libc/csu/ 775 0 33 0 2552604253 5456 libc/csu/crt0.s 444 0 33 1062 2451005636 6570 # @(#)crt0.s 4.1 (Berkeley) 12/21/80 # C runtime startoff .set exit,1 .globl _exit .globl start .globl _main .globl _environ # # C language startup routine start: .word 0x0000 subl2 $8,sp movl 8(sp),(sp) # argc movab 12(sp),r0 movl r0,4(sp) # argv L1: tstl (r0)+ # null args term ? bneq L1 cmpl r0,*4(sp) # end of 'env' or 'argv' ? blss L2 tstl -(r0) # envp's are in list L2: movl r0,8(sp) # env movl r0,_environ # indir is 0 if no env ; not 0 if env calls $3,_main pushl r0 calls $1,_exit chmk $exit # .data _environ: .space 4 tartoff .set exit,1 .globl _exit .globl start .globl _main .globl _environ # # C language startup routine start: .word 0x0000 subl2 $8,sp movl 8(sp),(sp) # argc movab 12(sp),r0 movl r0,4(sp) # argv L1: tstl (r0)+ # null args term ? bneq L1 cmpl r0,*4(sp) # end of 'env' or 'argv' ? blss L2 tstl -(r0) # envp's are in list L2: movl r0,8(sp) # env movl r0,_environ # indir is 0 if no env ; not 0 if env calls $3,_main pushl r0 callslibc/csu/mcrt0.s 444 0 33 2625 2451005636 6753 # @(#)mcrt0.s 4.1 (Berkeley) 12/21/80 # C runtime startoff including monitoring .set exit,1 .set cbufs,300 .globl start .globl _monitor .globl _sbrk .globl _main .globl _exit .globl _IEH3exit .globl _etext .globl _environ .globl __cleanup .comm countbase,4 start: .word 0x0000 subl2 $8,sp movl 8(sp),(sp) # argc movab 12(sp),r0 movl r0,4(sp) # argv L1: tstl (r0)+ # null args term ? bneq L1 cmpl r0,*4(sp) # end of 'env' or 'argv' ? blss L2 tstl -(r0) # envp's are in list L2: movl r0,8(sp) # env movl r0,_environ # indir is 0 if no env ; not 0 if env subl3 $eprol,$_etext,r1 addl2 $7,r1 extzv $3,$16,r1,r1 addl2 r1,r1 # tally size addl2 $8*cbufs+12,r1 # entrance count plus header pushl $cbufs # # entrance counters pushl r1 # bufsiz pushl r1 # for sbrk calls $1,_sbrk cmpl r0,$-1 beql nospace # bandaid for sbrk not clearing memory (remove bandaid when fixed) # addl3 (sp),(sp),r1 #L100: # clrb -1(r0)[r1] # sobgtr r1,L100 # end bandaid pushl r0 addl3 $12,r0,countbase pushab _etext pushab eprol calls $5,_monitor calls $3,_main pushl r0 calls $1,_exit .data _environ: .space 4 emsg: .byte 'N,'o,' ,'s,'p,'a,'c,'e,' ,'f,'o,'r,' .byte 'm,'o,'n,'i,'t,'o,'r,' ,'b,'u,'f,'f,'e,'r,0xa,0x0 em1: .text nospace: pushl $em1-emsg pushab emsg pushl $2 calls $3,_write _exit: _IEH3exit: .word 0x0000 calls $0,__cleanup pushl $0 calls $1,_monitor chmk $exit eprol: (sp),(sp),r1 #L100: # clrb -1(r0)[r1] # sobgtr r1,L100 # end bandaid pushl r0 addl3 $12,r0,countbase pulibc/csu/Makefile 644 0 33 226 2451007635 7160 # %W% (Berkeley) %G% CFLAGS= -O OBJS= crt0.o mcrt0.o .s.o: ${AS} -o $*.o $*.s -ld -x -r $*.o mv a.out $*.o all: ${OBJS} clean: rm -f ${OBJS} ,' ,'f,'o,'r,' .byte 'm,'o,'n,'i,'t,'o,'r,' ,'b,'u,'f,'f,'e,'r,0xa,0x0 em1: .text nospace: pushl $em1-emsg pushab emsg pushl $2 calls $3,_write _exit: _IEH3exit: .word 0x0000 calls $0,__cleanup pushl $0 calls $1,_monitor chmk $exit eprol: (sp),(sp),r1 #/,5 /,"libc/gen/ 775 0 33 0 2552604303 5431 libc/gen/atof.s 444 0 33 22617 2451002633 6653 # @(#)atof.s 4.1 (Berkeley) 12/21/80 # # atof: convert ascii to floating # # C usage: # # double atof (s) # char *s; # # Register usage: # # r0-1: value being developed # r2: first section: pointer to the next character # second section: binary exponent # r3: flags # r4: first section: the current character # second section: scratch # r5: the decimal exponent # r6-7: scratch # # Flag definitions # .set msign,0 # mantissa has negative sign .set esign,1 # exponent has negative sign .set decpt,2 # decimal point encountered .align 2 two31: .word 0x5000 # 2 ** 31 .word 0 # (=2147483648) .word 0 # in floating-point .word 0 # (so atof doesn't have to convert it) # # Entry point # .text .align 2 .globl _atof _atof: .word 0x00c0 # Save r7, r6 (we use r0-r7) # # Initialization # clrl r3 # All flags start out false movl 4(ap),r2 # Address the first character clrl r5 # Clear starting exponent # # Skip leading white space # sk0: movzbl (r2)+,r4 # Fetch the next (first) character cmpb $' ,r4 # Is it blank? jeql sk0 # ...yes cmpb r4,$8 # 8 is lowest of white-space group jlss sk1 # Jump if char too low to be white space cmpb r4,$13 # 13 is highest of white-space group jleq sk0 # Jump if character is white space sk1: # # Check for a sign # cmpb $'+,r4 # Positive sign? jeql cs1 # ... yes cmpb $'-,r4 # Negative sign? jneq cs2 # ... no bisb2 $1= '0' && *p <= '9') n = n*10 + *p++ - '0'; return(f? -n: n); } r0,-(sp) # and also mantissa calls $3,_ldexp # go combine them exit: ret 6 # low-order part i/,5܆ /,"libc/gen/atol.c 444 0 33 475 2451002634 6600 /* @(#)atol.c 4.1 (Berkeley) 12/21/80 */ long atol(p) register char *p; { long n; register int f; n = 0; f = 0; for(;;p++) { switch(*p) { case ' ': case '\t': continue; case '-': f++; case '+': p++; } break; } while(*p >= '0' && *p <= '9') n = n*10 + *p++ - '0'; return(f? -n: n); } } r0,-(sp) # and also mantissa calls $3,_ldexp # go combine them exit: ret 6 # low-order part i/,5 /,"libc/gen/calloc.c 444 0 33 754 2451002635 7077 /* @(#)calloc.c 4.1 (Berkeley) 12/21/80 */ /* calloc - allocate and clear memory block */ #define CHARPERINT (sizeof(int)/sizeof(char)) #define NULL 0 char * calloc(num, size) unsigned num, size; { register char *mp; char *malloc(); register int *q; register m; num *= size; mp = malloc(num); if(mp == NULL) return(NULL); q = (int *) mp; m = (num+CHARPERINT-1)/CHARPERINT; while(--m>=0) *q++ = 0; return(mp); } cfree(p, num, size) char *p; unsigned num, size; { free(p); } ,"libc/gen/chrtab.c 444 0 33 21151 2451002636 7140 ((/* @(#)chrtab.c 4.1 (Berkeley) 12/21/80 */ char chrtab[][16] = { 0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, sp, */ 0010,0010,0010,0010,0010,0010,0010,0010,0000,0000,0010,0000,0000,0000,0000,0000, /*, !, */ 0024,0024,0024,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, ", */ 0000,0000,0000,0044,0044,0176,0044,0044,0176,0044,0044,0000,0000,0000,0000,0000, /*, #, */ 0000,0010,0010,0010,0076,0101,0100,0076,0001,0101,0076,0010,0010,0000,0000,0000, /*, $, */ 0000,0000,0000,0141,0142,0004,0010,0010,0020,0043,0103,0000,0000,0000,0000,0000, /*, %, */ 0000,0000,0070,0104,0110,0060,0060,0111,0106,0106,0071,0000,0000,0000,0000,0000, /*, &, */ 0004,0010,0020,0040,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, ', */ 0000,0004,0010,0020,0040,0040,0040,0040,0040,0040,0020,0010,0004,0000,0000,0000, /*, (, */ 0000,0040,0020,0010,0004,0004,0004,0004,0004,0004,0010,0020,0040,0000,0000,0000, /*, ), */ 0000,0000,0000,0010,0111,0052,0034,0177,0034,0052,0111,0010,0000,0000,0000,0000, /*, *, */ 0000,0000,0000,0000,0010,0010,0010,0177,0010,0010,0010,0000,0000,0000,0000,0000, /*, +, */ 0000,0000,0000,0000,0000,0000,0000,0000,0000,0030,0030,0010,0020,0000,0000,0000, /*, ,, */ 0000,0000,0000,0000,0000,0000,0000,0176,0000,0000,0000,0000,0000,0000,0000,0000, /*, -, */ 0000,0000,0000,0000,0000,0000,0000,0000,0000,0030,0030,0000,0000,0000,0000,0000, /*, ., */ 0000,0000,0001,0002,0004,0010,0010,0010,0020,0040,0100,0000,0000,0000,0000,0000, /*, /, */ 0000,0030,0044,0102,0102,0102,0102,0102,0102,0044,0030,0000,0000,0000,0000,0000, /*, 0, */ 0000,0010,0030,0010,0010,0010,0010,0010,0010,0010,0034,0000,0000,0000,0000,0000, /*, 1, */ 0000,0070,0104,0004,0004,0010,0020,0040,0100,0100,0174,0000,0000,0000,0000,0000, /*, 2, */ 0000,0176,0004,0004,0010,0014,0002,0002,0002,0104,0070,0000,0000,0000,0000,0000, /*, 3, */ 0000,0004,0014,0024,0044,0104,0176,0004,0004,0004,0004,0000,0000,0000,0000,0000, /*, 4, */ 0000,0174,0100,0100,0130,0144,0002,0002,0102,0044,0030,0000,0000,0000,0000,0000, /*, 5, */ 0000,0074,0102,0100,0130,0144,0102,0102,0102,0044,0030,0000,0000,0000,0000,0000, /*, 6, */ 0000,0176,0004,0004,0010,0010,0020,0020,0040,0040,0040,0000,0000,0000,0000,0000, /*, 7, */ 0000,0034,0042,0101,0042,0076,0101,0101,0101,0101,0076,0000,0000,0000,0000,0000, /*, 8, */ 0000,0034,0042,0101,0101,0101,0043,0036,0004,0010,0020,0040,0000,0000,0000,0000, /*, 9, */ 0000,0000,0000,0000,0000,0000,0030,0030,0000,0030,0030,0000,0000,0000,0000,0000, /*, :, */ 0000,0000,0000,0000,0000,0000,0030,0030,0000,0030,0030,0020,0040,0000,0000,0000, /*, ;, */ 0002,0004,0010,0020,0040,0100,0040,0020,0010,0004,0002,0000,0000,0000,0000,0000, /*, <, */ 0000,0000,0000,0000,0177,0000,0177,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, =, */ 0100,0040,0020,0010,0004,0002,0004,0010,0020,0040,0100,0000,0000,0000,0000,0000, /*, >, */ 0000,0030,0044,0102,0001,0002,0004,0010,0010,0000,0010,0000,0000,0000,0000,0000, /*, ?, */ 0000,0074,0102,0101,0115,0123,0121,0121,0121,0111,0046,0000,0000,0000,0000,0000, /*, @, */ 0000,0010,0024,0042,0101,0101,0177,0101,0101,0101,0101,0000,0000,0000,0000,0000, /*, A, */ 0000,0176,0101,0101,0101,0176,0101,0101,0101,0101,0176,0000,0000,0000,0000,0000, /*, B, */ 0000,0076,0101,0100,0100,0100,0100,0100,0100,0101,0076,0000,0000,0000,0000,0000, /*, C, */ 0000,0176,0101,0101,0101,0101,0101,0101,0101,0101,0176,0000,0000,0000,0000,0000, /*, D, */ 0000,0176,0100,0100,0100,0170,0100,0100,0100,0100,0177,0000,0000,0000,0000,0000, /*, E, */ 0000,0177,0100,0100,0100,0174,0100,0100,0100,0100,0100,0000,0000,0000,0000,0000, /*, F, */ 0000,0076,0101,0100,0100,0117,0101,0101,0101,0101,0076,0000,0000,0000,0000,0000, /*, G, */ 0000,0101,0101,0101,0101,0176,0101,0101,0101,0101,0101,0000,0000,0000,0000,0000, /*, H, */ 0000,0034,0010,0010,0010,0010,0010,0010,0010,0010,0034,0000,0000,0000,0000,0000, /*, I, */ 0000,0016,0004,0004,0004,0004,0004,0004,0104,0104,0070,0000,0000,0000,0000,0000, /*, J, */ 0000,0101,0102,0104,0110,0120,0160,0110,0104,0102,0101,0000,0000,0000,0000,0000, /*, K, */ 0000,0100,0100,0100,0100,0100,0100,0100,0100,0100,0177,0000,0000,0000,0000,0000, /*, L, */ 0000,0101,0143,0125,0111,0101,0101,0101,0101,0101,0101,0000,0000,0000,0000,0000, /*, M, */ 0000,0101,0141,0121,0111,0105,0103,0101,0101,0101,0101,0000,0000,0000,0000,0000, /*, N, */ 0000,0076,0101,0101,0101,0101,0101,0101,0101,0101,0076,0000,0000,0000,0000,0000, /*, O, */ 0000,0176,0101,0101,0101,0176,0100,0100,0100,0100,0100,0000,0000,0000,0000,0000, /*, P, */ 0000,0076,0101,0101,0101,0101,0101,0101,0131,0105,0076,0002,0001,0000,0000,0000, /*, Q, */ 0000,0176,0101,0101,0101,0176,0104,0102,0101,0101,0101,0000,0000,0000,0000,0000, /*, R, */ 0000,0076,0101,0100,0100,0076,0001,0001,0001,0101,0076,0000,0000,0000,0000,0000, /*, S, */ 0000,0177,0010,0010,0010,0010,0010,0010,0010,0010,0010,0000,0000,0000,0000,0000, /*, T, */ 0000,0101,0101,0101,0101,0101,0101,0101,0101,0101,0076,0000,0000,0000,0000,0000, /*, U, */ 0000,0101,0101,0101,0101,0101,0101,0101,0042,0024,0010,0000,0000,0000,0000,0000, /*, V, */ 0000,0101,0101,0101,0101,0111,0111,0125,0143,0101,0101,0000,0000,0000,0000,0000, /*, W, */ 0000,0101,0101,0042,0024,0010,0024,0042,0101,0101,0101,0000,0000,0000,0000,0000, /*, X, */ 0000,0101,0042,0024,0010,0010,0010,0010,0010,0010,0010,0000,0000,0000,0000,0000, /*, Y, */ 0000,0177,0001,0002,0004,0010,0020,0040,0100,0100,0177,0000,0000,0000,0000,0000, /*, Z, */ 0000,0034,0020,0020,0020,0020,0020,0020,0020,0020,0020,0034,0000,0000,0000,0000, /*, [, */ 0000,0000,0100,0040,0020,0010,0010,0010,0004,0002,0001,0000,0000,0000,0000,0000, /*, , \, */ 0000,0070,0010,0010,0010,0010,0010,0010,0010,0010,0010,0070,0000,0000,0000,0000, /*, ], */ 0010,0024,0042,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, ^, */ 0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0377,0000,0000, /*, _, */ 0040,0020,0010,0004,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, `, */ 0000,0000,0000,0000,0000,0074,0002,0076,0102,0102,0076,0000,0000,0000,0000,0000, /*, a, */ 0000,0100,0100,0100,0100,0174,0102,0102,0102,0102,0174,0000,0000,0000,0000,0000, /*, b, */ 0000,0000,0000,0000,0000,0074,0102,0100,0100,0102,0074,0000,0000,0000,0000,0000, /*, c, */ 0002,0002,0002,0002,0002,0076,0102,0102,0102,0102,0076,0000,0000,0000,0000,0000, /*, d, */ 0000,0000,0000,0000,0000,0074,0102,0174,0100,0102,0074,0000,0000,0000,0000,0000, /*, e, */ 0000,0016,0020,0020,0020,0176,0020,0020,0020,0020,0020,0000,0000,0000,0000,0000, /*, f, */ 0000,0000,0000,0000,0000,0076,0102,0102,0102,0102,0076,0002,0002,0102,0076,0000, /*, g, */ 0000,0100,0100,0100,0100,0174,0102,0102,0102,0102,0102,0000,0000,0000,0000,0000, /*, h, */ 0000,0000,0000,0010,0000,0030,0010,0010,0010,0010,0034,0000,0000,0000,0000,0000, /*, i, */ 0000,0000,0000,0010,0000,0030,0010,0010,0010,0010,0010,0010,0010,0050,0020,0000, /*, j, */ 0000,0100,0100,0100,0100,0106,0110,0120,0160,0110,0106,0000,0000,0000,0000,0000, /*, k, */ 0000,0030,0010,0010,0010,0010,0010,0010,0010,0010,0034,0000,0000,0000,0000,0000, /*, l, */ 0000,0000,0000,0000,0000,0166,0111,0111,0111,0111,0111,0000,0000,0000,0000,0000, /*, m, */ 0000,0000,0000,0000,0100,0174,0102,0102,0102,0102,0102,0000,0000,0000,0000,0000, /*, n, */ 0000,0000,0000,0000,0000,0074,0102,0102,0102,0102,0074,0000,0000,0000,0000,0000, /*, o, */ 0000,0000,0000,0000,0000,0174,0102,0102,0102,0102,0174,0100,0100,0100,0100,0000, /*, p, */ 0000,0000,0000,0000,0000,0076,0102,0102,0102,0102,0076,0002,0002,0002,0002,0000, /*, q, */ 0000,0000,0000,0000,0000,0134,0142,0100,0100,0100,0100,0000,0000,0000,0000,0000, /*, r, */ 0000,0000,0000,0000,0000,0076,0100,0074,0002,0102,0074,0000,0000,0000,0000,0000, /*, s, */ 0000,0020,0020,0020,0020,0176,0020,0020,0020,0020,0014,0000,0000,0000,0000,0000, /*, t, */ 0000,0000,0000,0000,0000,0102,0102,0102,0102,0102,0075,0000,0000,0000,0000,0000, /*, u, */ 0000,0000,0000,0000,0000,0101,0101,0101,0042,0024,0010,0000,0000,0000,0000,0000, /*, v, */ 0000,0000,0000,0000,0000,0111,0111,0111,0111,0111,0066,0000,0000,0000,0000,0000, /*, w, */ 0000,0000,0000,0000,0000,0102,0044,0030,0030,0044,0102,0000,0000,0000,0000,0000, /*, x, */ 0000,0000,0000,0000,0000,0102,0102,0102,0042,0024,0010,0020,0040,0100,0000,0000, /*, y, */ 0000,0000,0000,0000,0000,0176,0004,0010,0020,0040,0176,0000,0000,0000,0000,0000, /*, z, */ 0000,0014,0020,0020,0020,0020,0040,0020,0020,0020,0020,0014,0000,0000,0000,0000, /*, {, */ 0000,0010,0010,0010,0010,0000,0000,0010,0010,0010,0010,0000,0000,0000,0000,0000, /*, |, */ 0000,0030,0010,0010,0010,0010,0004,0010,0010,0010,0010,0030,0000,0000,0000,0000, /*, }, */ 0020,0052,0004,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, ~, */ 0000,0176,0176,0176,0176,0176,0176,0176,0176,0176,0176,0000,0000,0000,0000,0000, /*, del, */ }; ,0020,0040,0176,0000,0000,0000,0000,0000, /*, z, */ 0000,0014,0020,0020,0020,0020,0040,0020,0020,0020,0020,0014,0000,0000,0000,0000, /*, {, */ 0000,0010,0010,0010,0010,0000,0000,0010,0010,0010,0010,0000,0000,0000,0000,0000, /*, |, */ 0000,0030,0010,0010,0010,0010,0004,0010,0010,0010,0010,0030,0000,0000,0000,0000, /*, }, */ 0020,0052,0004,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /libc/gen/crypt.c 444 0 33 16715 2451002637 7051 /* @(#)crypt.c 4.1 (Berkeley) 12/21/80 */ /* * This program implements the * Proposed Federal Information Processing * Data Encryption Standard. * See Federal Register, March 17, 1975 (40FR12134) */ /* * Initial permutation, */ static char IP[] = { 58,50,42,34,26,18,10, 2, 60,52,44,36,28,20,12, 4, 62,54,46,38,30,22,14, 6, 64,56,48,40,32,24,16, 8, 57,49,41,33,25,17, 9, 1, 59,51,43,35,27,19,11, 3, 61,53,45,37,29,21,13, 5, 63,55,47,39,31,23,15, 7, }; /* * Final permutation, FP = IP^(-1) */ ((static char FP[] = { 40, 8,48,16,56,24,64,32, 39, 7,47,15,55,23,63,31, 38, 6,46,14,54,22,62,30, 37, 5,45,13,53,21,61,29, 36, 4,44,12,52,20,60,28, 35, 3,43,11,51,19,59,27, 34, 2,42,10,50,18,58,26, 33, 1,41, 9,49,17,57,25, }; /* * Permuted-choice 1 from the key bits * to yield C and D. * Note that bits 8,16... are left out: * They are intended for a parity check. */ static char PC1_C[] = { 57,49,41,33,25,17, 9, 1,58,50,42,34,26,18, 10, 2,59,51,43,35,27, 19,11, 3,60,52,44,36, }; static char PC1_D[] = { 63,55,47,39,31,23,15, 7,62,54,46,38,30,22, 14, 6,61,53,45,37,29, 21,13, 5,28,20,12, 4, }; /* * Sequence of shifts used for the key schedule. */ static char shifts[] = { 1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1, }; /* * Permuted-choice 2, to pick out the bits from * the CD array that generate the key schedule. */ static char PC2_C[] = { 14,17,11,24, 1, 5, 3,28,15, 6,21,10, 23,19,12, 4,26, 8, 16, 7,27,20,13, 2, }; static char PC2_D[] = { 41,52,31,37,47,55, 30,40,51,45,33,48, 44,49,39,56,34,53, 46,42,50,36,29,32, }; /* * The C and D arrays used to calculate the key schedule. */ static char C[28]; static char D[28]; /* * The key schedule. * Generated from the key. */ static char KS[16][48]; /* * Set up the key schedule from the key. */ setkey(key) char *key; { register i, j, k; int t; /* * First, generate C and D by permuting * the key. The low order bit of each * 8-bit char is not used, so C and D are only 28 * bits apiece. */ for (i=0; i<28; i++) { C[i] = key[PC1_C[i]-1]; D[i] = key[PC1_D[i]-1]; } /* * To generate Ki, rotate C and D according * to schedule and pick up a permutation * using PC2. */ for (i=0; i<16; i++) { /* * rotate. */ for (k=0; k>3)&01; f[t+1] = (k>>2)&01; f[t+2] = (k>>1)&01; f[t+3] = (k>>0)&01; } /* * The new R is L ^ f(R, K). * The f here has to be permuted first, though. */ for (j=0; j<32; j++) R[j] = L[j] ^ f[P[j]-1]; /* * Finally, the new L (the original R) * is copied back. */ for (j=0; j<32; j++) L[j] = tempL[j]; } /* * The output L and R are reversed. */ for (j=0; j<32; j++) { t = L[j]; L[j] = R[j]; R[j] = t; } /* * The final output * gets the inverse permutation of the very original. */ for (j=0; j<64; j++) block[j] = L[FP[j]-1]; } char * crypt(pw,salt) char *pw; char *salt; { register i, j, c; int temp; static char block[66], iobuf[16]; for(i=0; i<66; i++) block[i] = 0; for(i=0; (c= *pw) && i<64; pw++){ for(j=0; j<7; j++, i++) block[i] = (c>>(6-j)) & 01; i++; } setkey(block); for(i=0; i<66; i++) block[i] = 0; for(i=0;i<48;i++) E[i] = e[i]; for(i=0;i<2;i++){ c = *salt++; iobuf[i] = c; if(c>'Z') c -= 6; if(c>'9') c -= 7; c -= '.'; for(j=0;j<6;j++){ if((c>>j) & 01){ temp = E[6*i+j]; E[6*i+j] = E[6*i+j+24]; E[6*i+j+24] = temp; } } } for(i=0; i<25; i++) encrypt(block,0); for(i=0; i<11; i++){ c = 0; for(j=0; j<6; j++){ c <<= 1; c |= block[6*i+j]; } c += '.'; if(c>'9') c += 7; if(c>'Z') c += 6; iobuf[i+2] = c; } iobuf[i+2] = 0; if(iobuf[1]==0) iobuf[1] = iobuf[0]; return(iobuf); } r(i=0;i<2;i++){ c = *salt++; iobuf[i] = c; iflibc/gen/ctime.c 444 0 33 10717 2451002640 6777 /* @(#)ctime.c 4.1 (Berkeley) 12/21/80 */ /* * This routine converts time as follows. * The epoch is 0000 Jan 1 1970 GMT. * The argument time is in seconds since then. * The localtime(t) entry returns a pointer to an array * containing * seconds (0-59) * minutes (0-59) * hours (0-23) * day of month (1-31) * month (0-11) * year-1970 * weekday (0-6, Sun is 0) * day of the year * daylight savings flag * * The routine calls the system to determine the local * timezone and whether Daylight Saving Time is permitted locally. * (DST is then determined by the current US standard rules) * There is a table that accounts for the peculiarities * undergone by daylight time in 1974-1975. * * The routine does not work * in Saudi Arabia which runs on Solar time. * * asctime(tvec)) * where tvec is produced by localtime * returns a ptr to a character string * that has the ascii time in the form * Thu Jan 01 00:00:00 1970n0\\ * 01234567890123456789012345 * 0 1 2 * * ctime(t) just calls localtime, then asctime. */ #include #include #include static char cbuf[26]; static int dmsize[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; /* * The following table is used for 1974 and 1975 and * gives the day number of the first day after the Sunday of the * change. */ static struct { int daylb; int dayle; } daytab[] = { 5, 333, /* 1974: Jan 6 - last Sun. in Nov */ 58, 303, /* 1975: Last Sun. in Feb - last Sun in Oct */ }; struct tm *gmtime(); char *ct_numb(); struct tm *localtime(); char *ctime(); char *ct_num(); char *asctime(); char * ctime(t) long *t; { return(asctime(localtime(t))); } struct tm * localtime(tim) long *tim; { register int dayno; register struct tm *ct; register daylbegin, daylend; long copyt; struct timeb systime; ftime(&systime); copyt = *tim - (long)systime.timezone*60; ct = gmtime(©t); dayno = ct->tm_yday; daylbegin = 119; /* last Sun in Apr */ daylend = 303; /* Last Sun in Oct */ if (ct->tm_year==74 || ct->tm_year==75) { daylbegin = daytab[ct->tm_year-74].daylb; daylend = daytab[ct->tm_year-74].dayle; } daylbegin = sunday(ct, daylbegin); daylend = sunday(ct, daylend); if (systime.dstflag && (dayno>daylbegin || (dayno==daylbegin && ct->tm_hour>=2)) && (daynotm_hour<1))) { copyt += 1*60*60; ct = gmtime(©t); ct->tm_isdst++; } return(ct); } /* * The argument is a 0-origin day number. * The value is the day number of the ((first * Sunday on or after the day. */ static sunday(t, d) register struct tm *t; register int d; { if (d >= 58) d += dysize(t->tm_year) - 365; return(d - (d - t->tm_yday + t->tm_wday + 700) % 7); } struct tm * gmtime(tim) long *tim; { register int d0, d1; long hms, day; register int *tp; static struct tm xtime; /* * break initial number into days */ hms = *tim % 86400; day = *tim / 86400; if (hms<0) { hms += 86400; day -= 1; } tp = (int *)&xtime; /* * generate hours:minutes:seconds */ *tp++ = hms%60; d1 = hms/60; *tp++ = d1%60; d1 /= 60; *tp++ = d1; /* * day is the day number. * generate day of the week. * The addend is 4 mod 7 (1/1/1970 was Thursday) */ xtime.tm_wday = (day+7340036)%7; /* * year number */ if (day>=0) for(d1=70; day >= dysize(d1); d1++) day -= dysize(d1); else for (d1=70; day<0; d1--) day += dysize(d1-1); xtime.tm_year = d1; xtime.tm_yday = d0 = day; /* * generate month */ if (dysize(d1)==366) dmsize[1] = 29; for(d1=0; d0 >= dmsize[d1]; d1++) d0 -= dmsize[d1]; dmsize[1] = 28; *tp++ = d0+1; *tp++ = d1; xtime.tm_isdst = 0; return(&xtime); } char * asctime(t) struct tm *t; { register char *cp, *ncp; register int *tp; cp = cbuf; for (ncp = "Day Mon 00 00:00:00 1900\n"; *cp++ = *ncp++;); ncp = &"SunMonTueWedThuFriSat"[3*t->tm_wday]; cp = cbuf; *cp++ = *ncp++; *cp++ = *ncp++; *cp++ = *ncp++; cp++; tp = &t->tm_mon; ncp = &"JanFebMarAprMayJunJulAugSepOctNovDec"[(*tp)*3]; *cp++ = *ncp++; *cp++ = *ncp++; *cp++ = *ncp++; cp = ct_numb(cp, *--tp); cp = ct_numb(cp, *--tp+100); cp = ct_numb(cp, *--tp+100); cp = ct_numb(cp, *--tp+100); if (t->tm_year>=100) { cp[1] = '2'; cp[2] = '0'; } cp += 2; cp = ct_numb(cp, t->tm_year+100); return(cbuf); } dysize(y) { if((y%4) == 0) return(366); return(365); } static char * ct_numb(cp, n) register char *cp; { cp++; if (n>=10) *cp++ = (n/10)%10 + '0'; else *cp++ = ' '; *cp++ = n%10 + '0'; return(cp); } "[(*tp)*3]; *cp++ = *ncp++; *cp++ = *ncp++; *clibc/gen/ctype_.c 444 0 33 1214 2451002641 7132 /* @(#)ctype_.c 4.1 (Berkeley) 12/21/80 */ #include char _ctype_[] = { 0, _C, _C, _C, _C, _C, _C, _C, _C, _C, _S, _S, _S, _S, _S, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _S, _P, _P, _P, _P, _P, _P, _P, _P, _P, _P, _P, _P, _P, _P, _P, _N, _N, _N, _N, _N, _N, _N, _N, _N, _N, _P, _P, _P, _P, _P, _P, _P, _U|_X, _U|_X, _U|_X, _U|_X, _U|_X, _U|_X, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _P, _P, _P, _P, _P, _P, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _P, _P, _P, _P, _C }; _S, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _S, _P, _P, _P, _P, _P, _P, _P, _P, _P, _P, _P, _P, _P, _P, _P, _N, _N, _N, _N, _N, _N, _N, _N, _N, _N, _P, _P, _P, _P, _P, _P, _P, _U|_X, _U|_X, _U|_X, _U|_X, _U|_X, _U|_X, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _P, _P, _P, _P, _P, _P, _L|_X, libc/gen/ecvt.c 444 0 33 3214 2451002641 6612 /* @(#)ecvt.c 4.1 (Berkeley) 12/21/80 */ /* * ecvt converts to decimal * the number of digits is specified by ndigit * decpt is set to the position of the decimal point * sign is set to 0 for positive, 1 for negative */ char *cvt(); #define NDIG 80 char* ecvt(arg, ndigits, decpt, sign) double arg; int ndigits, *decpt, *sign; { return(cvt(arg, ndigits, decpt, sign, 1)); } char* fcvt(arg, ndigits, decpt, sign) double arg; int ndigits, *decpt, *sign; { return(cvt(arg, ndigits, decpt, sign, 0)); } static char* cvt(arg, ndigits, decpt, sign, eflag) double arg; int ndigits, *decpt, *sign; { register int r2; double fi, fj; register char *p, *p1; static char buf[NDIG]; double modf(); if (ndigits<0) ndigits = 0; if (ndigits>=NDIG-1) ndigits = NDIG-2; r2 = 0; *sign = 0; p = &buf[0]; if (arg<0) { *sign = 1; arg = -arg; } arg = modf(arg, &fi); p1 = &buf[NDIG]; /* * Do integer part */ if (fi != 0) { p1 = &buf[NDIG]; while (fi != 0) { fj = modf(fi/10, &fi); *--p1 = (int)((fj+.03)*10) + '0'; r2++; } while (p1 < &buf[NDIG]) *p++ = *p1++; } else if (arg > 0) { while ((fj = arg*10) < 1) { arg = fj; r2--; } } p1 = &buf[ndigits]; if (eflag==0) p1 += r2; *decpt = r2; if (p1 < &buf[0]) { buf[0] = '\0'; return(buf); } while (p<=p1 && p<&buf[NDIG]) { arg *= 10; arg = modf(arg, &fj); *p++ = (int)fj + '0'; } if (p1 >= &buf[NDIG]) { buf[NDIG-1] = '\0'; return(buf); } p = p1; *p1 += 5; while (*p1 > '9') { *p1 = '0'; if (p1>buf) ++*--p1; else { *p1 = '1'; (*decpt)++; if (eflag==0) { if (p>buf) *p = '0'; p++; } } } *p = '\0'; return(buf); } r2--; } } p1 = &buf[ndigits]; if (eflag==0) p1 += r2; *decpt = r2; if (p1 < &buf[0]) { buf[0] = '\0'; return(buf); } while (p<=p1 && p<&buf[NDIG]) { arg *= 10; arg = modf(arg, &fj); *p++ = (int)fj + '0'; } if (p1 >= &buf[NDIG]) { buf[NDIG-1] = '\0'; return(buf); } p = p1; *p1 += 5; while (*p1 > '9') { *p1 = '0'; if (p1>buf) ++*--libc/gen/errlst.c 444 0 33 1535 2477646575 7224 /* @(#)errlst.c 4.1 (Berkeley) 12/21/80 */ char *sys_errlist[] = { "Error 0", "Not owner", "No such file or directory", "No such process", "Interrupted system call", "I/O error", "No such device or address", "Arg list too long", "Exec format error", "Bad file number", "No children", "No more processes", "Not enough core", "Permission denied", "Bad address", "Block device required", "Mount device busy", "File exists", "Cross-device link", "No such device", "Not a directory", "Is a directory", "Invalid argument", "File table overflow", "Too many open files", "Not a typewriter", "Text file busy", "File too large", "No space left on device", "Illegal seek", "Read-only file system", "Too many links", "Broken pipe", "Argument too large", "Result too large", }; int sys_nerr = { sizeof sys_errlist/sizeof sys_errlist[0] }; denied", "Bad address", "Block device required", "Mount device busy", "File exists", "Cross-device link", "No such device", "Not a directory", "Is a direclibc/gen/execvp.c 444 0 33 2615 2451002642 7150 /* @(#)execvp.c 4.1 (Berkeley) 12/21/80 */ /* * execlp(name, arg,...,0) (like execl, but does path search) * execvp(name, argv) (like execv, but does path search) */ #include #define NULL 0 static char shell[] = "/bin/sh"; char *execat(), *getenv(); extern errno; execlp(name, argv) char *name, *argv; { return(execvp(name, &argv)); } execvp(name, argv) char *name, **argv; { char *pathstr; register char *cp; char fname[128]; char *newargs[256]; int i; register unsigned etxtbsy = 1; register eacces = 0; if ((pathstr = getenv("PATH")) == NULL) pathstr = ":/bin:/usr/bin"; cp = index(name, '/')? "": pathstr; do { cp = execat(cp, name, fname); retry: execv(fname, argv); switch(errno) { case ENOEXEC: newargs[0] = "sh"; newargs[1] = fname; for (i=1; newargs[i+1]=argv[i]; i++) { if (i>=254) { errno = E2BIG; return(-1); } } execv(shell, newargs); return(-1); case ETXTBSY: if (++etxtbsy > 5) return(-1); sleep(etxtbsy); goto retry; case EACCES: eacces++; break; case ENOMEM: case E2BIG: return(-1); } } while (cp); if (eacces) errno = EACCES; return(-1); } static char * execat(s1, s2, si) register char *s1, *s2; char *si; { register char *s; s = si; while (*s1 && *s1 != ':' && *s1 != '-') *s++ = *s1++; if (si != s) *s++ = '/'; while (*s2) *s++ = *s2++; *s = '\0'; return(*s1? ++s1: 0); } , newargs); return(-1); case ETXTBSY: if (++etxtbsy > 5) return(-1); sleep(etxtbsy); goto retry; libc/gen/frexp.c 444 0 33 726 2451002643 6764 ((/* @(#)frexp.c 4.1 (Berkeley) 12/21/80 */ /* the call x = frexp(arg,&exp); must return a double fp quantity x which is <1.0 and the corresponding binary exponent "exp". such that arg = x*2^exp */ double frexp(x,i) double x; int *i; { int neg; int j; j = 0; neg = 0; if(x<0){ x = -x; neg = 1; } if(x>1.0) while(x>1){ j = j+1; x = x/2; } else if(x<0.5) while(x<0.5){ j = j-1; x = 2*x; } *i = j; if(neg) x = -x; return(x); } /,"libc/gen/getenv.c 444 0 33 1310 2451002643 7136 /* @(#)getenv.c 4.1 (Berkeley) 12/21/80 */ /* * getenv(name) * returns ptr to value associated with name, if any, else NULL */ #define NULL 0 extern char **environ; char *nvmatch(); char * getenv(name) register char *name; { register char **p = environ; register char *v; while (*p != NULL) if ((v = nvmatch(name, *p++)) != NULL) return(v); return(NULL); } /* * s1 is either name, or name=value * s2 is name=value * if names match, return value of s2, else NULL * used for environment searching: see getenv */ static char * nvmatch(s1, s2) register char *s1, *s2; { while (*s1 == *s2++) if (*s1++ == '=') return(s2); if (*s1 == '\0' && *(s2-1) == '=') return(s2); return(NULL); } name) register char *name; { register char **p = environ; register char *v; while (*p != NULL) if ((v = nvmatch(name, *p++)) != NULL) return(v); return(NULL); } /* * s1 is either name, or name=value * s2 is name=value * if names match, return value of s2, else NULL * used for environment searchinlibc/gen/getlogin.c 444 0 33 1011 2451002644 7455 /* @(#)getlogin.c 4.1 (Berkeley) 12/21/80 */ #include static char UTMP[] = "/etc/utmp"; static struct utmp ubuf; char * getlogin() { register me, uf; register char *cp; if( !(me = ttyslot()) ) return(0); if( (uf = open( UTMP, 0 )) < 0 ) return(0); lseek( uf, (long)(me*sizeof(ubuf)), 0 ); if (read(uf, (char *)&ubuf, sizeof(ubuf)) != sizeof(ubuf)) return(0); close(uf); ubuf.ut_name[sizeof (ubuf.ut_name)] = ' '; for (cp=ubuf.ut_name; *cp++!=' ';) ; *--cp = '\0'; return( ubuf.ut_name ); } tlogin.c 4.1 (Berkeley) 12/21/80 */ #include static char UTMP[] = "/etc/utmp"; static struct utmp ubuf; char * getlogin() { register me, uf; register char *cp; if( !(me = ttyslot()) ) return(0); if( (uf = open( UTMP, 0 )) < 0 ) return(0); lseek( uf, (long)(me*sizeof(ubuf)), 0 ); if (read(uf, (char *)&ubuf, sizeof(ubuf)) != sizeof(ubuf)) return(0); close(uf); ubuf.ut_name[sizeof (ubuf.ut_name)] = ' '; for (cp=ubuf.ut_name; *cp++!=' ';) ; *--cp = '\0'; return( ubuf.ut_nlibc/gen/index.c 444 0 33 405 2451002644 6742 /* @(#)index.c 4.1 (Berkeley) 12/21/80 */ /* * Return the ptr in sp at which the character c appears; * NULL if not found */ #define NULL 0 char * index(sp, c) register char *sp, c; { do { if (*sp == c) return(sp); } while (*sp++); return(NULL); } rn(0); lseek( uf, (long)(me*sizeof(ubuf)), 0 ); if (read(uf, (char *)&ubuf, sizeof(ubuf)) != sizeof(ubuf)) return(0); close(uf); ubuf.ut_name[sizeof (ubu/,5 /,"libc/gen/isatty.c 444 0 33 274 2451002645 7155 /* @(#)isatty.c 4.1 (Berkeley) 12/21/80 */ /* * Returns 1 iff file is a tty */ #include isatty(f) { struct sgttyb ttyb; if (gtty(f, &ttyb) < 0) return(0); return(1); } do { if (*sp == c) return(sp); } while (*sp++); return(NULL); } rn(0); lseek( uf, (long)(me*sizeof(ubuf)), 0 ); if (read(uf, (char *)&ubuf, sizeof(ubuf)) != sizeof(ubuf)) return(0); close(uf); ubuf.ut_name[sizeof (ubu/,5 /,"libc/gen/l3tol.c 444 0 33 500 2451002645 6665 /* @(#)l3tol.c 4.1 (Berkeley) 12/21/80 */ l3tol(lp, cp, n) long *lp; char *cp; int n; { register i; register char *a, *b; a = (char *)lp; b = cp; for(i=0;i=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 - 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)) { iflibc/gen/mktemp.c 444 0 33 535 2451002650 7131 /* @(#)mktemp.c 4.1 (Berkeley) 12/21/80 */ char * mktemp(as) char *as; { register char *s; register unsigned pid; register i; pid = getpid(); s = as; while (*s++) ; s--; while (*--s == 'X') { *s = (pid%10) + '0'; pid /= 10; } s++; i = 'a'; while (access(as, 0) != -1) { if (i=='z') return("/"); *s = i++; } return(as); } *)q); } #ifdef debug allock() { #ifdef longdebug register union stor/,5  /,"libc/gen/modf.s 444 0 33 1573 2451002772 6631 # @(#)modf.s 4.2 (Berkeley) 12/21/80 # # double modf (value, iptr) # double value; # double *iptr; # # Modf returns the fractional part of "value", and stores the integer # part indirectly through "iptr". # # Entry point # .text .align 1 .globl _modf _modf: .word 0x0000 # We use r0-r2, but do not save them # # This instruction does the following: # # Extend the long floating value at 4(ap) with 0, and # multiply it by 1.0. Store the integer part of the result # in r2, and the fractional part of the result in r0-r1. # emodd 4(ap),$0,$0f1.0,r2,r0 # How did you like # THAT, sports fans? jvs iovfl # Jump if integer overflow cvtld r2,*12(ap) # Else store integer result ret # and return # # Integer overflow occurred...develop the integer part by # subtracting the fractional part from the argument. # iovfl: subd3 r0,4(ap),*12(ap) # Develop integer part ret ating value at 4(ap) with 0, and # multiply it by 1.0. Store the integer part of the result # in r2, and the fractional part of thlibc/gen/mon.c 444 0 33 1335 2451002651 6445 /* @(#)mon.c 4.1 (Berkeley) 12/21/80 */ monitor(lowpc, highpc, buf, bufsiz, cntsiz) char *lowpc, *highpc; int *buf, bufsiz; { register o; static *sbuf, ssiz; struct phdr { int *lpc; int *hpc; int ncnt; }; struct cnt { int *pc; long ncall; }; if (lowpc == 0) { profil(0, 0, 0, 0); o = creat("mon.out", 0666); write(o, sbuf, ssiz); close(o); return; } sbuf = buf; ssiz = bufsiz; buf[0] = (int)lowpc; buf[1] = (int)highpc; buf[2] = cntsiz; o = sizeof(struct phdr) + cntsiz*sizeof(struct cnt); buf = (int *) (((int)buf) + o); bufsiz -= o; if (bufsiz<=0) return; o = ((highpc - lowpc)>>1); if(bufsiz < o) o = ((float) bufsiz / o) * 32768; else o = 0177777; profil(buf, bufsiz, lowpc, o); } t cnt { int *pc; long ncall; }; if (lowpc == 0) { profil(0, 0, 0, 0); o = creat("mon.out", 0666); write(o, sbuf, ssiz); close(o); return; } sbuf = buf; ssiz = bufsiz; buf[0] = (int)lowpc; buf[1] = (int)highpc; buf[2] = cntsiz; o = sizeof(struct phdr) + cntsiz*sizeof(libc/gen/mpx.c 444 0 33 2345 2451002651 6462 /* @(#)mpx.c 4.1 (Berkeley) 12/21/80 */ #include #include #include static struct mx_args vec; int mpxcall(); mpx(name,mode) char *name; { if (name && *name) { vec.m_name = name; vec.m_arg[1] = mode; return(mpxcall(MPX, &vec)); } else return(mpxcall(MPXN, 0)); } chan(gr) { vec.m_arg[1] = gr; return(mpxcall(CHAN, &vec)); } join(fd,ch) { vec.m_arg[0] = fd; vec.m_arg[1] = ch; return(mpxcall(JOIN, &vec)); } connect(fd,ch,side) { vec.m_arg[0] = fd; vec.m((_arg[1] = ch; vec.m_arg[2] = side; return(mpxcall(CONNECT, &vec)); } attach(sub,gp) { vec.m_arg[0] = sub; vec.m_arg[1] = gp; return(mpxcall(ATTACH, &vec)); } detach(sub,gp) { vec.m_arg[0] = sub; vec.m_arg[1] = gp; return(mpxcall(DETACH, &vec)); } extract(sub,ch,side) { vec.m_arg[0] = sub; vec.m_arg[1] = ch; vec.m_arg[2] = 1 /* side */; /* 0 seems to be useless */ return(mpxcall(EXTR, &vec)); } debug(var,val) { vec.m_arg[0] = var; vec.m_arg[1] = val; return(mpxcall(DEBUG, &vec)); } npgrp(ch, gfd, pid) { vec.m_arg[0] = ch; vec.m_arg[1] = gfd; vec.m_arg[2] = pid; return(mpxcall(NPGRP, &vec)); } ckill(index,gp,sig) { vec.m_arg[0] = index; vec.m_arg[1] = gp; vec.m_arg[2] = sig; return(mpxcall(CSIG, &vec)); } n(mpxcall(DETACH, &vec)); } extract(sub,ch,side) { vec.m_arg[0] = sub; vec.m_arg[1] = ch; vec.m_arg[2] = 1 /* side */; /* 0 seems to be useless */ return(mpxcall(EXTR, &vec)); } debug(var,val) { vec.m_arg[0] = var; vec.m_arg[1] = val; return(mpxcall(DEBUG, &vec)); } npgrp(libc/gen/nlist.c 444 0 33 3215 2451002652 7005 /* @(#)nlist.c 4.1 (Berkeley) 12/21/80 */ #include #include #include #include /* * nlist - retreive attributes from name list (string table version) */ nlist(name, list) char *name; struct nlist *list; { register struct nlist *p, *q; register n, m, i, nreq; FILE *f; off_t sa; /* symbol address */ off_t ss; /* start of strings */ struct exec buf; struct nlist space[BUFSIZ/sizeof (struct nlist)]; int maxlen; maxlen = 0; for (q = list, nreq = 0; q->n_un.n_name && q->n_un.n_name[0]; q++, nreq++) { q->n_type = 0; q->n_value = 0; q->n_desc = 0; q->n_other = 0; i = strlen(q->n_un.n_name); if (i > maxlen) maxlen = i; } f = fopen(name, "r"); if (f == NULL) return (NULL); fread((char *)&buf, sizeof buf, 1, f); if (N_BADMAG(buf)) { close(f); return (-1); } sa = N_SYMOFF(buf); ss = sa + buf.a_syms; n = buf.a_syms; while (n) { m = sizeof (space); if (n < m) m = n; fseek(f, sa, 0); i = fread((char *)space, m, 1, f); sa += m; n -= m; for (q = space; (m -= sizeof(struct nlist)) >= 0; q++) { char nambuf[BUFSIZ]; if (q->n_un.n_strx == 0 || q->n_type & N_STAB) continue; fseek(f, ss+q->n_un.n_strx, 0); fread(nambuf, maxlen+1, 1, f); for (p = list; p->n_un.n_name[0]; p++) { i = 0; while (p->n_un.n_name[i]) { if (p->n_un.n_name[i] != nambuf[i]) goto cont; i++; } if (nambuf[i]) goto cont; p->n_value = q->n_value; p->n_type = q->n_type; p->n_desc = q->n_desc; p->n_other = q->n_other; if (--nreq == 0) goto alldone; break; cont: ; } } } alldone: fclose(f); return (0); } & N_STAB) continue; fseek(f, ss+q->n_un.n_strx, 0); fread(nambuf, maxlen+1, 1, f); for (p = list; p->n_un.n_name[0]; p++) { i = 0; while (p->n_un.n_name[i]) { if (p->n_un.n_name[i] != nambuf[i]) goto cont; i++; } if (nambuf[i]) goto cont; p->n_value = q->n_value; p->n_type = q->n_type; p->n_desc = q->n_desclibc/gen/perror.c 444 0 33 603 2451002652 7143 /* @(#)perror.c 4.1 (Berkeley) 12/21/80 */ /* * Print the error indicated * in the cerror cell. */ int errno; int sys_nerr; char *sys_errlist[]; perror(s) char *s; { register char *c; register n; c = "Unknown error"; if(errno < sys_nerr) c = sys_errlist[errno]; n = strlen(s); if(n) { write(2, s, n); write(2, ": ", 2); } write(2, c, strlen(c)); write(2, "\n", 1); } +; } if (nambuf[i]) /,5\ /,"libc/gen/qsort.c 444 0 33 2624 2451002653 7030 /* @(#)qsort.c 4.1 (Berkeley) 12/21/80 */ static int (*qscmp)(); static int qses; qsort(a, n, es, fc) char *a; unsigned n; int es; int (*fc)(); { qscmp = fc; qses = es; qs1(a, a+n*es); } static qs1(a, l) char *a, *l; { register char *i, *j; register es; char **k; char *lp, *hp; int c; unsigned n; es = qses; start: if((n=l-a) <= es) return; n = es * (n / (2*es)); hp = lp = a+n; i = a; j = l-es; for(;;) { if(i < lp) { if((c = (*qscmp)(i, lp)) == 0) { qsexc(i, lp -= es); continue; } if(c < 0) { i += es; continue; } } loop: if(j > hp) { if((c = (*qscmp)(hp, j)) == 0) { qsexc(hp += es, j); goto loop; } if(c > 0) { if(i == lp) { qstexc(i, hp += es, j); i = lp += es; goto loop; } qsexc(i, j); j -= es; i += es; continue; } j -= es; goto loop; } if(i == lp) { if(lp-a >= l-hp) { qs1(hp+es, l); l = lp; } else { qs1(a, lp); a = hp+es; } goto start; } qstexc(j, lp -= es, i); j = hp -= es; } } static qsexc(i, j) char *i, *j; { register char *ri, *rj, c; int n; n = qses; ri = i; rj = j; do { c = *ri; *ri++ = *rj; *rj++ = c; } while(--n); } static qstexc(i, j, k) char *i, *j, *k; { register char *ri, *rj, *rk; int c; int n; n = qses; ri = i; rj = j; rk = k; do { c = *ri; *ri++ = *rk; *rk++ = *rj; *rj++ = c; } while(--n); } qs1(hp+es, l); l = lp; } else { qs1(a, lp); a = hp+es; } goto start; } qstexc(j,libc/gen/rand.c 444 0 33 256 2451002654 6564 /* @(#)rand.c 4.1 (Berkeley) 12/21/80 */ static long randx = 1; srand(x) unsigned x; { randx = x; } rand() { return((randx = randx * 1103515245 + 12345) & 0x7fffffff); } ++ = c; } while(--n); } static qstexc(i, j, k) char *i, *j, *k; { register char *ri, *rj, *rk; int c; int n; n = qses; ri = i; rj = j; rk = k; do { c = *ri; *ri++ = *rk; *rk++ = *rj; *rj++ = c; } while(--n); } qs1(hp+es, l); /,5| /,"libc/gen/regex.c 444 0 33 17316 2451002655 7020 /* @(#)regex.c 4.1 (Berkeley) 12/21/80 */ # /* * routines to do regular expression matching * * Entry points: * * re_comp(s) * char *s; * ... returns 0 if the string s was compiled successfully, * a pointer to an error message otherwise. * If passed 0 or a null string returns without changing * the currently compiled re (see note 11 below). * * re_exec(s) * char *s; * ... returns 1 if the string s matches the last compiled regular * expression, * 0 if the string s failed to match the last compiled * regular expression, and * -1 if the compiled regular expression was invalid * (indicating an internal error). * * The strings passed to both re_comp and re_exec may have trailing or * embedded newline characters; they are terminated by nulls. * * The identity of the author of these routines is lost in antiquity; * this is essentially the same as the re code in the original V6 ed. * * The regular expressions recognized are described below. This description * is essentially the same as that for ed. * * A regular expression specifies a set of strings of characters. * A member of this set of strings is said to be matched by * the regular expression. In the following specification for * regular expressions the word `character' means any character but NUL. * * 1. Any character except a special character matches itself. * Special characters are the regular expression delimiter plus * \ [ . and sometimes ^ * $. * 2. A . matches any character. * 3. A \ followed by any character except a digit or ( ) * matches that character. * 4. A nonempty string s bracketed [s] (or [^s]) matches any * character in (or not in) s. In s, \ has no special meaning, * and ] may only appear as the first letter. A substring * a-b, with a and b in ascending ASCII order, stands for * the inclusive range of ASCII characters. * 5. A regular expression of form 1-4 followed by * matches a * sequence of 0 or m((ore matches of the regular expression. * 6. A regular expression, x, of form 1-8, bracketed \(x\) * matches what x matches. * 7. A \ followed by a digit n matches a copy of the string that the * bracketed regular expression beginning with the nth \( matched. * 8. A regular expression of form 1-8, x, followed by a regular * expression of form 1-7, y matches a match for x followed by * a match for y, with the x match being as long as possible * while still permitting a y match. * 9. A regular expression of form 1-8 preceded by ^ (or followed * by $), is constrained to matches that begin at the left * (or end at the right) end of a line. * 10. A regular expression of form 1-9 picks out the longest among * the leftmost matches in a line. * 11. An empty regular expression stands for a copy of the last * regular expression encountered. */ /* * constants for re's */ #define CBRA 1 #define CCHR 2 #define CDOT 4 #define CCL 6 #define NCCL 8 #define CDOL 10 #define CEOF 11 #define CKET 12 #define CBACK 18 #define CSTAR 01 #define ESIZE 512 #define NBRA 9 static char expbuf[ESIZE], *braslist[NBRA], *braelist[NBRA]; static char circf; /* * compile the regular expression argument into a dfa */ char * re_comp(sp) register char *sp; { register int c; register char *ep = expbuf; int cclcnt, numbra = 0; char *lastep = 0; char bracket[NBRA]; char *bracketp = &bracket[0]; static char *retoolong = "Regular expression too long"; #define comerr(msg) {expbuf[0] = 0; numbra = 0; return(msg); } if (sp == 0 || *sp == '\0') { if (*ep == 0) return("No previous regular expression"); return(0); } if (*sp == '^') { circf = 1; sp++; } else circf = 0; for (;;) { if (ep >= &expbuf[ESIZE]) comerr(retoolong); if ((c = *sp++) == '\0') { if (bracketp != bracket) comerr("unmatched \\("); *ep++ = CEOF; *ep++ = 0; return(0); } if (c != '*') lastep = ep; switch (c) { case '.': *ep++ = CDOT; continue; case '*': if (lastep == 0 || *lastep == CBRA || *lastep == CKET) goto defchar; *lastep |= CSTAR; continue; case '$': if (*sp != '\0') goto defchar; *ep++ = CDOL; continue; case '[': *ep++ = CCL; *ep++ = 0; cclcnt = 1; if ((c = *sp++) == '^') { c = *sp++; ep[-2] = NCCL; } do { if (c == '\0') comerr("missing ]"); if (c == '-' && ep [-1] != 0) { if ((c = *sp++) == ']') { *ep++ = '-'; cclcnt++; break; } while (ep[-1] < c) { *ep = ep[-1] + 1; ep++; cclcnt++; if (ep >= &expbuf[ESIZE]) comerr(retoolong); } } *ep++ = c; cclcnt++; if (ep >= &expbuf[ESIZE]) comerr(retoolong); } while ((c = *sp++) != ']'); lastep[1] = cclcnt; continue; case '\\': if ((c = *sp++) == '(') { if (numbra >= NBRA) comerr("too many \\(\\) pairs"); *bracketp++ = numbra; *ep++ = CBRA; *ep++ = numbra++; continue; } if (c == ')') { if (bracketp <= bracket) comerr("unmatched \\)"); *ep++ = CKET; *ep++ = *--bracketp; continue; } if (c >= '1' && c < ('1' + NBRA)) { *ep++ = CBACK; *ep++ = c - '1'; continue; } *ep++ = CCHR; *ep++ = c; continue; defchar: default: *ep++ = CCHR; *ep++ = c; } } } /* * match the argument string against the compiled re */ int re_exec(p1) register char *p1; { register char *p2 = expbuf; register int c; int rv; for (c = 0; c < NBRA; c++) { braslist[c] = 0; braelist[c] = 0; } if (circf) return((advance(p1, p2))); /* * fast check for first character */ if (*p2 == CCHR) { c = p2[1]; do { if (*p1 != c) continue; if (rv = advance(p1, p2)) return(rv); } while (*p1++); return(0); } /* * regular algorithm */ do if (rv = advance(p1, p2)) return(rv); while (*p1++); return(0); } /* * try to match the next thing in the dfa */ static int advance(lp, ep) register char *lp, *ep; { register char *curlp; int ct, i; int rv; 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: if (cclass(ep, *lp++, 1)) { ep += *ep; continue; } return(0); case NCCL: if (cclass(ep, *lp++, 0)) { ep += *ep; continue; } return(0); case CBRA: braslist[*ep++] = lp; continue; case CKET: braelist[*ep++] = lp; continue; case CBACK: if (braelist[i = *ep++] == 0) return(-1); if (backref(i, lp)) { lp += braelist[i] - braslist[i]; continue; } return(0); case CBACK|CSTAR: if (braelist[i = *ep++] == 0) return(-1); curlp = lp; ct = braelist[i] - braslist[i]; while (backref(i, lp)) lp += ct; while (lp >= curlp) { if (rv = advance(lp, ep)) return(rv); lp -= ct; } continue; case CDOT|CSTAR: curlp = lp; while (*lp++) ; goto star; case CCHR|CSTAR: curlp = lp; while (*lp++ == *ep) ; ep++; goto star; case CCL|CSTAR: case NCCL|CSTAR: curlp = lp; while (cclass(ep, *lp++, ep[-1] == (CCL|CSTAR))) ; ep += *ep; goto star; star: do { lp--; if (rv = advance(lp, ep)) return(rv); } while (lp > curlp); return(0); default: return(-1); } } backref(i, lp) register int i; register char *lp; { register char *bp; bp = braslist[i]; while (*bp++ == *lp++) if (bp >= braelist[i]) return(1); return(0); } int cclass(set, c, af) register char *set, c; int af; { register int n; if (c == 0) return(0); n = *set++; while (--n) if (*set++ == c) return(af); return(! af); } goto star; star: do { lp--; if (rv = advance(lp, ep)) return(rv); } while (lp > curlp); return(0); default: return(-1); } } backref(i, lp) register int i; register char *lp; { register char *bp; bp = braslist[i]; while (*bp++ == *lp++) if (bp >= braelist[i]) libc/gen/rin.c 444 0 33 604 2451002656 6427 /* @(#)rin.c 4.1 (Berkeley) 12/21/80 */ #include rin() { double d; register n, c, f; d = 0.; f = 0; n = 0; loop: c = getchar(); if(c == EOF) exit(); if(c == '-') { f++; goto loop; } if(c == '.') { n++; goto loop; } if(isdigit(c)) { if(n) n++; d = d*10.+c-'0'; goto loop; } if(f) d = -d; for(f=1; f #include static jmp_buf jmp; sleep(n) unsigned n; { int sleepx(); unsigned altime; int (*alsig)() = SIG_DFL; if (n==0) return; altime = alarm(1000); /* time to maneuver */ if (setjmp(jmp)) { signal(SIGALRM, alsig); alarm(altime); return; } if (altime) { if (altime > n) altime -= n; else { n = altime; altime = 1; } } alsig = signal(SIGALRM, sleepx); alarm(n); for(;;) pause(); /*NOTREACHED*/ } static sleepx() { longjmp(jmp, 1); } 80 */ #include #include static jmp_buf jmp; sleep(n) unsigned n; { int sleepx(); unsigned altime; int (*alsig)() = SIG_DFL; if (n==0) return; altime = alarm(1000); /* time to maneuver */ if (setjmp(jmp)) { signal(SIGALRM, alsig); alarm(altime); return; } if (altime) { if (altime > n) altime -= n; else { n = altime; altime = 1; } } alsig = signal(SIGALRM, sleepx); alarm(n); for(;;) pause(); /*NOTREACHED*/ } stlibc/gen/strcat.c 444 0 33 435 2451002657 7142 ((/* @(#)strcat.c 4.1 (Berkeley) 12/21/80 */ /* * Concatenate s2 on the end of s1. S1's space must be large enough. * Return s1. */ char * strcat(s1, s2) register char *s1, *s2; { register char *os1; os1 = s1; while (*s1++) ; --s1; while (*s1++ = *s2++) ; return(os1); } IGALRM, alsig); alarm(altime); return; } if (altime) { if (altime > n) altime -= n; else { n = altime; altime = 1; /,5̈ /,"libc/gen/strcatn.c 444 0 33 575 2451002660 7317 /* @(#)strcatn.c 4.1 (Berkeley) 12/21/80 */ /* * Concatenate s2 on the end of s1. S1's space must be large enough. * At most n characters are moved. * Return s1. */ char * strcatn(s1, s2, n) register char *s1, *s2; register n; { register char *os1; os1 = s1; while (*s1++) ; --s1; while (*s1++ = *s2++) if (--n < 0) { *--s1 = '\0'; break; } return(os1); } else { n = altime; altime = 1; /,5܈ /,"libc/gen/strcmp.c 444 0 33 341 2451002660 7140 /* @(#)strcmp.c 4.1 (Berkeley) 12/21/80 */ /* * Compare strings: s1>s2: >0 s1==s2: 0 s1s2: >0 s1==s2: 0 s1= 0 && *s1 == *s2++) if (*s1++ == '\0') return(0); return(n<0 ? 0 : *s1 - *--s2); } ; --s1; while (*s1++ = *s2++) if (--n < 0) { *--s1 = '\0'; break; } return(os1); } else { n = altime; altime = 1; /,5 /,"libc/gen/strcpy.c 444 0 33 357 2451002662 7165 /* @(#)strcpy.c 4.1 (Berkeley) 12/21/80 */ /* * Copy string s2 to s1. s1 must be large enough. * return s1 */ char * strcpy(s1, s2) register char *s1, *s2; { register char *os1; os1 = s1; while (*s1++ = *s2++) ; return(os1); } return(0); return(n<0 ? 0 : *s1 - *--s2); } ; --s1; while (*s1++ = *s2++) if (--n < 0) { *--s1 = '\0'; break; } return(os1); } else { n = altime; altime = 1; /,5  /,"libc/gen/strcpyn.c 444 0 33 552 2451002662 7340 /* @(#)strcpyn.c 4.1 (Berkeley) 12/21/80 */ /* * Copy s2 to s1, truncating or null-padding to always copy n bytes * return s1 */ char * strcpyn(s1, s2, n) register char *s1, *s2; { register i; register char *os1; os1 = s1; for (i = 0; i < n; i++) if ((*s1++ = *s2++) == '\0') { while (++i < n) *s1++ = '\0'; return(os1); } return(os1); } } return(os1); } else { n = altime; altime = 1; /,5 /,"libc/gen/strlen.c 444 0 33 311 2451002663 7137 /* @(#)strlen.c 4.1 (Berkeley) 12/21/80 */ /* * Returns the number of * non-NULL bytes in string argument. */ strlen(s) register char *s; { register n; n = 0; while (*s++) n++; return(n); } gister char *os1; os1 = s1; for (i = 0; i < n; i++) if ((*s1++ = *s2++) == '\0') { while (++i < n) *s1++ = '\0'; return(os1); } return(os1); } } return(os1); } else { n = altime; altime = 1; /,5, /,"libc/gen/strncat.c 444 0 33 575 2451002663 7322 /* @(#)strncat.c 4.1 (Berkeley) 12/21/80 */ /* * Concatenate s2 on the end of s1. S1's space must be large enough. * At most n characters are moved. * Return s1. */ char * strncat(s1, s2, n) register char *s1, *s2; register n; { register char *os1; os1 = s1; while (*s1++) ; --s1; while (*s1++ = *s2++) if (--n < 0) { *--s1 = '\0'; break; } return(os1); } else { n = altime; altime = 1; /,5< /,"libc/gen/strncmp.c 444 0 33 434 2451002664 7325 /* @(#)strncmp.c 4.1 (Berkeley) 12/21/80 */ /* * Compare strings (at most n bytes): s1>s2: >0 s1==s2: 0 s1= 0 && *s1 == *s2++) if (*s1++ == '\0') return(0); return(n<0 ? 0 : *s1 - *--s2); } ; --s1; while (*s1++ = *s2++) if (--n < 0) { *--s1 = '\0'; break; } return(os1); } else { n = altime; altime = 1; /,5L /,"libc/gen/strncpy.c 444 0 33 552 2451002664 7342 /* @(#)strncpy.c 4.1 (Berkeley) 12/21/80 */ /* * Copy s2 to s1, truncating or null-padding to always copy n bytes * return s1 */ char * strncpy(s1, s2, n) register char *s1, *s2; { register i; register char *os1; os1 = s1; for (i = 0; i < n; i++) if ((*s1++ = *s2++) == '\0') { while (++i < n) *s1++ = '\0'; return(os1); } return(os1); } } return(os1); } else { n = altime; altime = 1; /,5\ /,"libc/gen/stty.c 444 0 33 401 2451002664 6634 ((/* @(#)stty.c 4.1 (Berkeley) 12/21/80 */ /* * Writearound to old stty and gtty system calls */ #include stty(fd, ap) struct sgtty *ap; { return(ioctl(fd, TIOCSETP, ap)); } gtty(fd, ap) struct sgtty *ap; { return(ioctl(fd, TIOCGETP, ap)); } if ((*s1++ = *s2++) == '\0') { while (++i < n) *s1++ = '\0'; return(os1); } return(os1); } } return(os1); } else { n = altime; altime = 1; /,5l /,"libc/gen/swab.c 444 0 33 422 2451002665 6571 /* @(#)swab.c 4.1 (Berkeley) 12/21/80 */ /* * Swap bytes in 16-bit [half-]words * for going between the 11 and the interdata */ swab(pf, pt, n) register short *pf, *pt; register n; { n /= 2; while (--n >= 0) { *pt++ = (*pf << 8) + ((*pf >> 8) & 0377); pf++; } } ++) == '\0') { while (++i < n) *s1++ = '\0'; return(os1); } return(os1); } } return(os1); } else { n = altime; altime = 1; /,5| /,"libc/gen/tell.c 444 0 33 205 2451002665 6574 /* @(#)tell.c 4.1 (Berkeley) 12/21/80 */ /* * return offset in file. */ long lseek(); long tell(f) { return(lseek(f, 0L, 1)); } wab(pf, pt, n) register short *pf, *pt; register n; { n /= 2; while (--n >= 0) { *pt++ = (*pf << 8) + ((*pf >> 8) & 0377); pf++; } } ++) == '\0') { while (++i < n) *s1++ = '\0'; return(os1); } return(os1); } } return(os1); } else { n = altime; altime = 1; /,5 /,"libc/gen/timezone.c 444 0 33 1732 2451002666 7515 /* @(#)timezone.c 4.1 (Berkeley) 12/21/80 */ /* * The arguments are the number of minutes of time * you are westward from Greenwich and whether DST is in effect. * It returns a string * giving the name of the local timezone. * * Sorry, I don't know all the names. */ static struct zone { int offset; char *stdzone; char *dlzone; } zonetab[] = { 4*60, "AST", "ADT", /* Atlantic */ 5*60, "EST", "EDT", /* Eastern */ 6*60, "CST", "CDT", /* Central */ 7*60, "MST", "MDT", /* Mountain */ 8*60, "PST", "PDT", /* Pacific */ 0, "GMT", 0, /* Greenwich */ -1 }; char *timezone(zone, dst) { register struct zone *zp; static char czone[10]; char *sign; for (zp=zonetab; zp->offset!=-1; zp++) if (zp->offset==zone) { if (dst && zp->dlzone) return(zp->dlzone); if (!dst && zp->stdzone) return(zp->stdzone); } if (zone<0) { zone = -zone; sign = "+"; } else sign = "-"; sprintf(czone, "GMT%s%d:%02d", sign, zone/60, zone%60); return(czone); } ST", "MDT", /* Mountain */ 8*60, "PSlibc/gen/:errfix 444 0 33 50 2424115606 6762 ?sys_nerr? 1,.-5g/\.data/s//\.text/ w q /* Greenwich */ -1 }; char *timezone(zone, dst) { register struct zone *zp; static char czone[10]; char *sign; for (zp=zonetab; zp->offset!=-1; zp++) if (zp->offset==zone) { if (dst && zp->dlzone) return(zp->dlzone); if (!dst && zp->stdzone) return(zp->stdzone); } if (zone<0) { zone = -zone; sign = "+"; } else sign = "-"; sprintf(czone, "GMT%/,5 /,"libc/gen/ttyname.c 444 0 33 1670 2451002667 7346 /* @(#)ttyname.c 4.1 (Berkeley) 12/21/80 */ /* * ttyname(f): return "/dev/ttyXX" which the the name of the * tty belonging to file f. * NULL if it is not a tty */ #define NULL 0 #include #include #include static char dev[] = "/dev/"; char *strcpy(); char *strcat(); char * ttyname(f) { struct stat fsb; struct stat tsb; struct direct db; static char rbuf[32]; register df; if (isatty(f)==0) return(NULL); if (fstat(f, &fsb) < 0) return(NULL); if ((fsb.st_mode&S_IFMT) != S_IFCHR) return(NULL); if ((df = open(dev, 0)) < 0) return(NULL); while (read(df, (char *)&db, sizeof(db)) == sizeof(db)) { if (db.d_ino == 0) continue; if (db.d_ino != fsb.st_ino) continue; strcpy(rbuf, dev); strcat(rbuf, db.d_name); if (stat(rbuf, &tsb) < 0) continue; if (tsb.st_dev==fsb.st_dev && tsb.st_ino==fsb.st_ino) { close(df); return(rbuf); } } close(df); return(NULL); } ==0) return(NULL); if (fstat(f, &fsb) < 0) return(NULL); if ((fsb.libc/gen/ttyslot.c 444 0 33 1665 2451002667 7413 /* @(#)ttyslot.c 4.1 (Berkeley) 12/21/80 */ /* * Return the number of the slot in the utmp file * corresponding to the current user: try for file 0, 1, 2. * Definition is the line number in the /etc/ttys file. */ char *ttyname(); char *getttys(); char *rindex(); static char ttys[] = "/etc/ttys"; #define NULL 0 ttyslot() { register char *tp, *p; register s, tf; if ((tp=ttyname(0))==NULL && (tp=ttyname(1))==NULL && (tp=ttyname(2))==NULL) return(0); if ((p = rindex(tp, '/')) == NULL) p = tp; else p++; if ((tf=open(ttys, 0)) < 0) return(0); s = 0; while (tp = getttys(tf)) { s++; if (strcmp(p, tp)==0) { close(tf); return(s); } } close(tf); return(0); } static char * getttys(f) { static char line[32]; register char *lp; lp = line; for (;;) { if (read(f, lp, 1) != 1) return(NULL); if (*lp =='\n') { *lp = '\0'; return(line+2); } if (lp >= &line[32]) return(line+2); lp++; } } ame(2))==NULL) return(0); if ((p = rindex(tp, '/')) == NULL) p = tp; libc/gen/valloc.c 444 0 33 333 2451002670 7112 /* @(#)valloc.c 4.1 (Berkeley) 12/21/80 */ #include char *malloc(); char * valloc(i) int i; { char *cp = malloc(i + (VALSIZ-1)); int j; j = ((int)cp + (VALSIZ-1)) &~ (VALSIZ-1); return ((char *)j); } char line[32]; register char *lp; lp = line; for (;;) { if (read(f, lp, 1) != 1) return(NULL); if (*lp =='\n') { *lp = '\0'; return(line+2); } if (lp >= &line[32]) return(line+/,5܉ /,"libc/gen/Makefile 644 0 33 1332 2451007663 7157 # %W% (Berkeley) %G% CFLAGS= -O OBJS= atof.o atoi.o atol.o calloc.o chrtab.o crypt.o ctime.o ctype_.o \ ecvt.o errlst.o execvp.o frexp.o getenv.o getlogin.o \ index.o isatty.o l3tol.o ldexp.o ltol3.o \ malloc.o mktemp.o modf.o mon.o mpx.o nlist.o \ perror.o qsort.o rand.o regex.o rin.o rindex.o \ sleep.o strcat.o strcatn.o strcmp.o strcmpn.o strcpy.o \ strcpyn.o strlen.o strncat.o strncmp.o strncpy.o stty.o swab.o \ tell.o timezone.o ttyname.o ttyslot.o valloc.o .c.o: ${CC} ${CFLAGS} -c $*.c -ld -((x -r $*.o mv a.out $*.o .s.o: ${AS} -o $*.o $*.s -ld -x -r $*.o mv a.out $*.o all: ${OBJS} clean: rm -f ${OBJS} errlst.o: errlst.c cc -S errlst.c ed - <:errfix errlst.s as -o errlst.o errlst.s rm errlst.s mp.o modf.o mon.o mpx.o nlist.o \ perror.o qsort.o rand.o regex.o rin.o rindex.o \ sleep.o strcat.o strcatn.o strcmp.o strcmpn.o strcpy.o \ strcpyn.o strlen.o strncat.o strncmp.o strncpy.o stty.o swab.o \ tell.o timezone.o ttyname.o ttyslot.o valloc.o .c.o: ${CC} ${CFLAGS} -c $*.c -ld -libc/stdio/ 775 0 33 0 2552604314 6004 libc/stdio/clrerr.c 444 0 33 217 2451004030 7465 /* @(#)clrerr.c 4.1 (Berkeley) 12/21/80 */ #include clearerr(iop) register struct _iobuf *iop; { iop->_flag &= ~(_IOERR|_IOEOF); } < a9 ed 02552604314rrlst.< a9t.o 00000006004 errlst.s mp.o modf.o mon.o mpx.o nlist.o \ perror.o qsort.o rand.o regex.o rin.o rindex.o \ sleep.o strcat.o strcatn.o strcmp.o strcmpn.o strcpy.o \ strcpyn.o strlen.o strncat.o strncm strncpy./ C. /,"libc/stdio/data.c 444 0 33 472 2451004031 7111 /* @(#)data.c 4.1 (Berkeley) 12/21/80 */ #include char _sibuf[BUFSIZ]; char _sobuf[BUFSIZ]; struct _iobuf _iob[_NFILE] ={ { 0, _sibuf, _sibuf, _IOREAD, 0}, { 0, NULL, NULL, _IOWRT, 1}, { 0, NULL, NULL, _IOWRT+_IONBF, 2}, }; /* * Ptr to end of buffers */ struct _iobuf *_lastbuf ={ &_iob[_NFILE] }; cat.o strcatn.o strcmp.o strcmpn.o strcpy.o \ strcpyn.o strlen.o strncat.o strncm strncpy.//,5܆ /,"libc/stdio/doprnt.s 444 0 33 52723 2506755332 7616 /* @(#)doprnt.s 4.3 (Berkeley) 3/22/81 */ # C library -- conversions .globl __doprnt .globl __flsbuf #define vbit 1 #define flags r10 #define ndfnd 0 #define prec 1 #define zfill 2 #define minsgn 3 #define plssgn 4 #define numsgn 5 #define caps 6 #define blank 7 #define gflag 8 #define dpflag 9 #define width r9 #define ndigit r8 #define llafx r7 #define lrafx r6 #define fdesc -4(fp) #define exp -8(fp) #define sexp -12(fp) #define nchar -16(fp) #define sign -17(fp) .set ch.zer,'0 # cpp doesn't like single appostrophes .align 2 strtab: # translate table for detecting null and percent .byte 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 .byte 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 .byte ' ,'!,'",'#,'$, 0,'&,'','(,'),'*,'+,',,'-,'.,'/ .byte '0,'1,'2,'3,'4,'5,'6,'7,'8,'9,':,';,'<,'=,'>,'? .byte '@,'A,'B,'C,'D,'E,'F,'G,'H,'I,'J,'K,'L,'M,'N,'O .byte 'P,'Q,'R,'S,'T,'U,'V,'W,'X,'Y,'Z,'[,'\,'],'^,'_ .byte '`,'a,'b,'c,'d,'e,'f,'g,'h,'i,'j,'k,'l,'m,'n,'o .byte 'p,'q,'r,'s,'t,'u,'v,'w,'x,'y,'z,'{,'|,'},'~,127 .byte 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 .byte 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159 .byte 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175 .byte 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191 .byte 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207 .byte 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223 .byte 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239 .byte 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 strfoo: clrl r4 # fix interrupt race jbr strok # and try again strmore: movzbl (r1)+,r2 # one char tstb strtab[r2] # translate jeql stresc2 # bad guy in disguise (outbuf is full) strout2: # enter here to force out r2; r0,r1 must be set pushr $3 # save input descriptor pushl fdesc # FILE pushl r2 # the char calls $2,__flsbuf # please empty the buffer and handle 1 char tstl r0 # successful? jgeq strm1 # yes jbcs $31,nchar,strm1 # turn on sign bit of nchar to signify error strm1: incl nchar # count the char popr $3 # get input descriptor back strout: # enter via bsb with (r0,r1)=input descriptor movab strtab,r3 # table address movq *fdesc,r4 # output descriptor jbs $31,r4,strfoo # negative count is a no no strok: addl2 r0,nchar # we intend to move this many chars /******* Start bogus movtuc workaround *****/ clrl r2 tstl r0 bleq movdon movlp: tstl r4 bleq movdon movzbl (r1)+,r3 tstb strtab[r3] bneq 1f mnegl $1,r2 decl r1 brb movdon 1: movb r3,(r5)+ decl r4 sobgtr r0,movlp /******* End bogus movtuc workaround *** movtuc r0,(r1),$0,(r3),r4,(r5) movpsl r2 /* squirrel away condition codes */ /******* End equally bogus movtuc ****/ movdon: movq r4,*fdesc /* update output descriptor */ subl2 r0,nchar # some chars not moved jbs $vbit,r2,stresc # terminated by escape? sobgeq r0,strmore # no; but out buffer might be full stresc: rsb stresc2: incl r0 # fix the length decl r1 # and the addr movl $1 .word fmtbad-L5 # ? .word fmtbad-L5 # @ .word fmtbad-L5 # A .word fmtbad-L5 # B .word fmtbad-L5 # C .word decimal-L5 # D .word capital-L5 # E .word fmtbad-L5 # F .word capital-L5 # G .word fmtbad-L5 # H .word fmtbad-L5 # I .word fmtbad-L5 # J .word fmtbad-L5 # K .word fmtbad-L5 # L .word fmtbad-L5 # M .word fmtbad-L5 # N .word octal-L5 # O .word fmtbad-L5 # P .word fmtbad-L5 # Q .word fmtbad-L5 # R .word fmtbad-L5 # S .word fmtbad-L5 # T .word unsigned-L5 # U .word fmtbad-L5 # V .word fmtbad-L5 # W .word hex-L5 # X .word fmtbad-L5 # Y .word fmtbad-L5 # Z .word fmtbad-L5 # [ .word fmtbad-L5 # \ .word fmtbad-L5 # ] .word fmtbad-L5 # ^ .word fmtbad-L5 # _ .word fmtbad-L5 # ` .word fmtbad-L5 # a .word fmtbad-L5 # b .word charac-L5 # c .word decimal-L5 # d .word scien-L5 # e .word float-L5 # f .word general-L5 # g .word short-L5 # h .word fmtbad-L5 # i .word fmtbad-L5 # j .word fmtbad-L5 # k .word longorunsg-L5 # l .word fmtbad-L5 # m .word fmtbad-L5 # n .word octal-L5 # o .word fmtbad-L5 # p .word fmtbad-L5 # q .word fmtbad-L5 # r .word string-L5 # s .word fmtbad-L5 # t .word unsigned-L5 # u .word fmtbad-L5 # v .word fmtbad-L5 # w .word hex-L5 # x fmtbad: movb r0,(r5)+ # print the unfound character jeql errdone # dumb users who end the format with a % jbr prbuf capital: bisl2 $1 subl3 r1,r5,ndigit # raw width subl3 ndigit,width,r0 # pad length jleq padlno # in particular, no left padding jbs $minsgn,flags,padlno # extension for %0 flag causing left zero padding to field width jbs $zfill,flags,padlz # this bsbb needed even if %0 flag extension is removed bsbb padb # blank pad on left jbr padnlz padlz: movl llafx,r0 jleq padnlx # left zero pad requires left affix first subl2 r0,ndigit # part of total length will be transferred subl2 r0,width # and will account for part of minimum width bsbw strout # left affix padnlx: subl3 ndigit,width,r0 # pad length bsbb padz # zero pad on left padnlz: # end of extension for left zero padding padlno: # remaining: root, possible right padding subl2 ndigit,width # root reduces minimum width movl ndigit,r0 # root length p1: bsbw strout # transfer to output buffer p3: jbc $vbit,r2,padnpct # percent sign (or null byte via %c) ? decl r0 # yes; adjust count movzbl (r1)+,r2 # fetch byte movq *fdesc,r4 # output buffer descriptor sobgeq r4,p2 # room at the out [inn] ? bsbw strout2 # no; force it, then try rest jbr p3 # here we go 'round the mullberry bush, ... p2: movb r2,(r5)+ # hand-deposit the percent or null incl nchar # count it movq r4,*fdesc # store output descriptor jbr p1 # what an expensive hiccup! padnpct: movl width,r0 # size of pad jleq loop bsbb padb jbr loop padz: movb $'0,r2 jbr pad padb: movb $' ,r2 pad: subl2 r0,width # pad width decreases minimum width pushl r1 # save non-pad addr movl r0,llafx # remember width of pad subl2 r0,sp # allocate movc5 $0,(r0),r2,llafx,(sp) # create pad string movl llafx,r0 # length movl sp,r1 # addr bsbw strout addl2 llafx,sp # deallocate movl (sp)+,r1 # recover non-pad addr rsb pone: .byte 0x1C # packed 1 charac: movl (ap)+,r0 # word containing the char movb r0,(r5)+ # one byte, that's all prbuf: movl sp,r1 # addr first byte jbr prstr space: bisl2 $1n, e>=n gfmtf: movl r7,r6 subl2 r0,ndigit # n-e-1 movab 16(sp),r1 bsbw fedit g1: jbs $numsgn,flags,g2 jbs $dpflag,flags,g2 # dont strip if no decimal point g3: cmpb -(r5),$'0 # strip trailing zeroes jeql g3 cmpb (r5),$'. # and trailing decimal point jeql g2 incl r5 g2: jbc $gflag,flags,eexp jbr prnum gfmte: movab 16(sp),r1 # packed source bsbw eedit jbsc $gflag,flags,g1 # gflag now means "use %f" [hence no exponent] general: jbs $prec,flags,gn1 movl $6,ndigit # default precision is 6 significant digits gn1: tstl ndigit # cannot allow precision of 0 jgtr gn2 movl $1,ndigit # change 0 to 1, willy-nilly gn2: jbcs $gflag,flags,L23 jbr L23 # 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 movab -0200(r2),r2 # unbias mull2 $59,r2 # 59/196: 3rd convergent continued frac of log10(2) jlss eneg movab 196(r2),r2 eneg: movab -98(r2),r2 divl2 $196,r2 bsbw 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 jsb 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 # if precision >= 17, must round here movl ndigit,r7 # so figure out what precision is pushab scien cmpl (sp)+,(sp) jleq gm1 # who called us? addl2 exp,r7 # float; adjust for exponent gm1: cmpl r7,$17 jlss gm2 cmpd r5,$0d0.5 # must round here; check fraction jlss gm2 bisb2 $0x10,8+4(sp) # increment l.s. digit gm2: # end of "round here" code 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 .align 2 lsb: .long 0x00010000 # lsb in the crazy floating-point format # return 10^r2 as a double float in r0||r1 and 8 extra bits of precision in r4 # preserve r2, r5||r6 expten: movd $0d1.0,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,$0d1.0,r0 # by taking reciprocal cmpl $28,r2 jneq enm28 addl2 lsb,r1 # 10**-28 needs lsb incremented enm28: mnegl r2,r2 # original exponent of 10 el2: addl3 $5*8,r2,r3 # negative bit positions are illegal? jbc r3,xlsbh-5,eoklsb subl2 lsb,r1 # lsb was too high eoklsb: movzbl xprec[r2],r4 # 8 extra bits 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 # whether lsb is too high or not .byte 1:0,1:0,1:0,1:0,1:1,1:0,1:1,1:0 # -40 thru -33 .byte 1:0,1:1,1:0,1:0,1:0,1:0,1:1,1:0 # -32 thru -25 .byte 1:0,1:0,1:1,1:1,1:1,1:1,1:0,1:0 # -24 thru -17 .byte 1:0,1:1,1:0,1:0,1:1,1:1,1:1,1:1 # -16 thru -9 .byte 1:1,1:1,1:1,1:0,1:0,1:0,1:0,1:1 # -8 thru -1 xlsbh: .byte 1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0 # 0 thru 7 .byte 1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0 # 8 thru 15 .byte 1:0,1:0,1:0,1:0,1:0,1:0,1:0,1:0 # 16 thru 23 .byte 1:0,1:1,1:1,1:0,1:1,1:1,1:1,1:1 # 24 thru 31 .byte 1:1,1:1,1:1,1:1,1:1,1:1,1:1 # 32 thru 38 # bytes of extra precision .byte 0x56,0x76,0xd3,0x88,0xb5,0x62 # -38 thru -33 .byte 0xba,0xf5,0x32,0x3e,0x0e,0x48,0xdb,0x51 # -32 thru -25 .byte 0x53,0x27,0xb1,0xef,0xeb,0xa5,0x07,0x49 # -24 thru -17 .byte 0x5b,0xd9,0x0f,0x13,0xcd,0xff,0xbf,0x97 # -16 thru -9 .byte 0xfd,0xbc,0xb6,0x23,0x2c,0x3b,0x0a,0xcd # -8 thru -1 xprec: .byte 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 # 0 thru 7 .byte 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 # 8 thru 15 .byte 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 # 16 thru 23 .byte 0x00,0xa0,0xc8,0x3a,0x84,0xe4,0xdc,0x92 # 24 thru 31 .byte 0x9b,0x00,0xc0,0x58,0xae,0x18,0xef # 32 thru 38 b,0x51 # -32 thru -25 .byte 0x53,0x27,0xb1,0libc/stdio/doscan.c 444 0 33 10726 2451004036 7517 /* @(#)doscan.c 4.1 (Berkeley) 12/21/80 */ #include #include #define SPC 01 #define STP 02 #define SHORT 0 #define REGULAR 1 #define LONG 2 #define INT 0 #define FLOAT 1 char *_getccl(); char _sctab[128] = { 0,0,0,0,0,0,0,0, 0,SPC,SPC,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, SPC,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, }; _doscan(iop, fmt, argp) FILE *iop; register char *fmt; register int **argp; { register int ch; int nmatch, len, ch1; int **ptr, fileended, size; nmatch = 0; fileended = 0; for (;;) switch (ch = *fmt++) { case '\0': return (nmatch); case '%': if ((ch = *fmt++) == '%') goto def; ptr = 0; if (ch != '*') ptr = argp++; else ch = *fmt++; len = 0; size = REGULAR; while (isdigit(ch)) { len = len*10 + ch - '0'; ch = *fmt++; } if (len == 0) len = 30000; if (ch=='l') { size = LONG; ch = *fmt++; } else if (ch=='h') { size = SHORT; ch = *fmt++; } else if (ch=='[') fmt = _getccl(fmt); if (isupper(ch)) { ch = tolower(ch); size = LONG; } if (ch == '\0') return(-1); if (_innum(ptr, ch, len, size, iop, &fileended) && ptr) nmatch++; if (fileended) return(nmatch? nmatch: -1); break; case ' ': case '\n': case '\t': while ((ch1 = getc(iop))==' ' || ch1=='\t' || ch1=='\n') ; if (ch1 != EOF) ungetc(ch1, iop); break; default: def: ch1 = getc(iop); if (ch1 != ch) { if (ch1==EOF) return(-1); ungetc(ch1, iop); return(nmatch); } } } _innum(ptr, type, len, size, iop, eofptr) int **ptr, *eofptr; struct _iobuf *iop; { extern double atof(); register char *np; char numbuf[64]; register c, base; int expseen, scale, negflg, c1, ndigit; long lcval; if (type=='c' || type=='s' || type=='[') return(_instr(ptr? *(char **)ptr: (char *)NULL, type, len, iop, eofptr)); lcval = 0; ndigit = 0; scale = INT; if (type=='e'||type=='f') scale = FLOAT; base = 10; if (type=='o') base = 8; else if (type=='x') base = 16; np = numbuf; expseen = 0; negflg = 0; while ((c = getc(iop))==' ' || c=='\t' || c=='\n'); if (c=='-') { negflg++; *np++ = c; c = getc(iop); len--; } else if (c=='+') { len--; c = getc(iop); } for ( ; --len>=0; *np++ = c, c = getc(iop)) { if (isdigit(c) || base==16 && ('a'<=c && c<='f' || 'A'<=c && c<='F')) { ndigit++; if (base==8) lcval <<=3; else if (base==10) lcval = ((lcval<<2) + lcval)<<1; else lcval <<= 4; c1 = c; if (isdigit(c)) c -= '0'; else if ('a'<=c && c<='f') c -= 'a'-10; else c -= 'A'-10; lcval += c; c = c1; continue; } else if (c=='.') { if (base!=10 || scale==INT) break; ndigit++; continue; } else if ((c=='e'||c=='E') && expseen==0) { if (base!=10 || scale==INT || ndigit==0) break; expseen++; *np++ = c; c = getc(iop); if (c!='+'&&c!='-'&&('0'>c||c>'9')) break; } else break; } if (negflg) lcval = -lcval; if (c != EOF) { ungetc(c, iop); *eofptr = 0; } else *eofptr = 1; if (ptr==NULL || np==numbuf) return(0); *np++ = 0; switch((scale<<4) | size) { case (FLOAT<<4) | SHORT: case (FLOAT<<4) | REGULAR: **(float **)ptr = atof(numbuf); break; case (FLOAT<<4) | LONG: **(double **)ptr = atof(numbuf); break; case (INT<<4) | SHORT: **(short **)ptr = lcval; break; case (INT<<4) | REGULAR: **(int **)ptr = lcval; break; case (INT<<4) | LONG: **(long **)ptr = lcval; break; } return(1); } _instr(ptr, type, len, iop, eofptr) register char *ptr; register struct _iobuf *iop; int *eofptr; { register ch; register char *optr; int ignstp; *eofptr = 0; optr = ptr; if (type=='c' && len==30000) len = 1; ignstp = 0; if (type=='s') ignstp = SPC; while (_sctab[ch = getc(iop)] & ignstp) if (ch==EOF) break; ignstp = SPC; if (type=='c') ignstp = 0; else if (type=='[') ignstp = STP; while (ch!=EOF && (_sctab[ch]&ignstp)==0) { if (ptr) *ptr++ = ch; if (--len <= 0) break; ch = getc(iop); } if (ch != EOF) { if (len > 0) ungetc(ch, iop); *eofptr = 0; } else *eofptr = 1; if (ptr && ptr!=optr) { if (type!='c') *ptr++ = '\0'; return(1); } return(0); } char * _getccl(s) register char *s; { register c, t; t = 0; if (*s == '^') { t++; s++; } for (c = 0; c < 128; c++) if (t) _sctab[c] &= ~STP; else _sctab[c] |= STP; while (((c = *s++)&0177) != ']') { if (t) _sctab[c++] |= STP; else _sctab[c++] &= ~STP; if (c==0) return(--s); } return(s); } } if (ch != EOF) { if (len > 0) unge((libc/stdio/error.c 444 0 33 271 2451004036 7333 /* @(#)error.c 4.1 (Berkeley) 12/21/80 */ #include _error(s) register char *s; { static reentered; if (reentered++) _exit(0177); write(2, s, strlen(s)); exit(0176); } ster c, t; t = 0; if (*s == '^') { t++; s++; } for (c = 0; c < 128; c++) if (t) _sctab[c] &= ~STP; else _sctab[c] |= STP; while (((c = *s++)&0177) != ']') { if (t) _sctab[c++] |= STP; else _sctab[c++] &= ~/,5  /,"libc/stdio/stdio.h 444 0 33 1647 2502613721 7365 /* @(#)stdio.h 1.1 (Berkeley) 3/9/81 */ #define BUFSIZ 1024 #define _NFILE 20 # ifndef FILE extern struct _iobuf { int _cnt; char *_ptr; char *_base; short _flag; char _file; } _iob[_NFILE]; # endif #define _IOREAD 01 #define _IOWRT 02 #define _IONBF 04 #define _IOMYBUF 010 #define _IOEOF 020 #define _IOERR 040 #define _IOSTRG 0100 #define _IOLBF 0200 #define _IORW 0400 #define NULL 0 #define FILE struct _iobuf #define EOF (-1) #define stdin (&_iob[0]) #define stdout (&_iob[1]) #define stderr (&_iob[2]) #define getc(p) (--(p)->_cnt>=0? *(p)->_ptr++&0377:_filbuf(p)) #define getchar() getc(stdin) #define putc(x,p) (--(p)->_cnt>=0? ((int)(*(p)->_ptr++=(unsigned)(x))):_flsbuf((unsigned)(x),p)) #define putchar(x) putc(x,stdout) #define feof(p) (((p)->_flag&_IOEOF)!=0) #define ferror(p) (((p)->_flag&_IOERR)!=0) #define fileno(p) ((p)->_file) FILE *fopen(); FILE *fdopen(); FILE *freopen(); long ftell(); char *fgets(); efine EOF (-1) #define stdin (&_iob[0]) #define stdout (&_iob[1]) #define stderr (&_iob[libc/stdio/fgetc.c 444 0 33 151 2451004040 7262 /* @(#)fgetc.c 4.1 (Berkeley) 12/21/80 */ #include fgetc(fp) FILE *fp; { return(getc(fp)); } putc(x,p) (--(p)->_cnt>=0? ((int)(*(p)->_ptr++=(unsigned)(x))):_flsbuf((unsigned)(x),p)) #define putchar(x) putc(x,stdout) #define feof(p) (((p)->_flag&_IOEOF)!=0) #define ferror(p) (((p)->_flag&_IOERR)!=0) #define fileno(p) ((p)->_file) FILE *fopen(); FILE *fdopen(); FILE *freopen(); long ftell(); char *fgets(/,5, /,"libc/stdio/fgets.c 444 0 33 460 2451004041 7306 /* @(#)fgets.c 4.1 (Berkeley) 12/21/80 */ #include char * fgets(s, n, iop) char *s; register FILE *iop; { register c; register char *cs; cs = s; while (--n>0 && (c = getc(iop))>=0) { *cs++ = c; if (c=='\n') break; } if (c<0 && cs==s) return(NULL); *cs++ = '\0'; return(s); } OERR)!=0) #define fileno(p) ((p)->_file) FILE *fopen(); FILE *fdopen(); FILE *freopen(); long ftell(); char *fgets(/,5< /,"libc/stdio/fdopen.c 444 0 33 1242 2502613713 7501 /* @(#)fdopen.c 4.2 (Berkeley) 3/9/81 */ /* * Unix routine to do an "fopen" on file descriptor * The mode has to be repeated because you can't query its * status */ #include #include FILE * fdopen(fd, mode) register char *mode; { extern int errno; register FILE *iop; extern FILE *_lastbuf; for (iop = _iob; iop->_flag&(_IOREAD|_IOWRT|_IORW); iop++) if (iop >= _lastbuf) return(NULL); iop->_cnt = 0; iop->_file = fd; if (*mode != 'r') { iop->_flag |= _IOWRT; if (*mode == 'a') lseek(fd, 0L, 2); } else iop->_flag |= _IOREAD; if (mode[1] == '+') { iop->_flag &= ~(_IOREAD|_IOWRT); iop->_flag |= _IORW; } return(iop); } us */ #include #include FILE * fdopen(fd, mode) register char *mode; { extern int errno; register FILE *iop; extern FILE *_lastbuf; for (iop = _iob; iop->_flag&(_IOREAD|_IOWRT|_IORW); iop++) if (iop >= _lastbuf) return(NULL); iop->_cnt = 0; iop->_file = fd; if (*mode != 'r') { iop->_flag |= _IOWRT; if (*mode libc/stdio/filbuf.c 444 0 33 1625 2531733560 7507 /* @(#)filbuf.c 4.3 (Berkeley) 5/19/81 */ #include char *malloc(); _filbuf(iop) register FILE *iop; { static char smallbuf[_NFILE]; if (iop->_flag & _IORW) iop->_flag |= _IOREAD; if ((iop->_flag&_IOREAD) == 0) return(EOF); if (iop->_flag&_IOSTRG) return(EOF); tryagain: if (iop->_base==NULL) { if (iop->_flag&_IONBF) { iop->_base = &smallbuf[fileno(iop)]; goto tryagain; } if ((iop->_base = malloc(BUFSIZ)) == NULL) { iop->_flag |= _IONBF; goto tryagain; } iop->_flag |= _IOMYBUF; } if (iop == stdin && (stdout->_flag&_IOLBF)) fflush(stdout); iop->_cnt = read(fileno(iop), iop->_base, iop->_flag&_IONBF?1:BUFSIZ); iop->_ptr = iop->_base; if (--iop->_cnt < 0) { if (iop->_cnt == -1) { iop->_flag |= _IOEOF; if (iop->_flag & _IORW) iop->_flag &= ~_IOREAD; } else iop->_flag |= _IOERR; iop->_cnt = 0; return(-1); } return(*iop->_ptr++&0377); } } if ((iop->_base = malloc(BUFSIZ)) == NULL) { iop->_flag |= _IONBF; goto tryagain; } iop->_flalibc/stdio/flsbuf.c 444 0 33 4226 2502613714 7515 /* @(#)flsbuf.c 4.2 (Berkeley) 3/9/81 */ #include char *malloc(); _flsbuf(c, iop) register FILE *iop; { register char *base; register n, rn; char c1; extern char _sobuf[]; if (iop->_flag & _IORW) { iop->_flag |= _IOWRT; iop->_flag &= ~_IOEOF; } if ((iop->_flag&_IOWRT)==0) return(EOF); tryagain: if (iop->_flag&_IOLBF) { base = iop->_base; *iop->_ptr++ = c; if (iop->_ptr >= base+BUFSIZ || c == '\n') { n = write(fileno(iop), base, rn = iop->_ptr - base); iop->_ptr = base; } else rn = n = 0; iop->_cnt = 0; } else if (iop->_flag&_IONBF) { c1 = c; rn = 1; n = write(fileno(iop), &c1, rn); iop->_cnt = 0; } else { if ((base=iop->_base)==NULL) { if (iop==stdout) { if (isatty(fileno(stdout))) iop->_flag |= _IOLBF; iop->_base = _sobuf; iop->_ptr = _sobuf; goto tryagain; } if ((iop->_base=base=malloc(BUFSIZ)) == NULL) { iop->_flag |= _IONBF; goto tryagain; } iop->_flag |= _IOMYBUF; rn = n = 0; } else if ((rn = n = iop->_ptr - base) > 0) { iop->_ptr = base; n = write(fileno(iop), base, n); } iop->_cnt = BUFSIZ-1; *base++ = c; iop->_ptr = base; } if (rn != n) { iop->_flag |= _IOERR; return(EOF); } return(c); } fflush(iop) register struct _iobuf *iop; { register char *base; register n; if ((iop->_flag&(_IONBF|_IOWRT))==_IOWRT && (base=iop->_base)!=NULL && (n=iop->_ptr-base)>0) { iop->_ptr = base; iop->_cnt = (iop->_flag&(_IOLBF|_IONBF)) ? 0 : BUFSIZ; if (write(fileno(iop), base, n)!=n) { iop->_flag |= _IOERR; return(EOF); } } return(0); } /* * Flush buffers on exit */ _cleanup() { register struct _iobuf *iop; extern struct _iobuf *_lastbuf; for (iop = _iob; iop < _lastbuf; iop++) fclose(iop); } fclose(iop) register struct _iobuf *iop; { register r; r = EOF; if (iop->_flag&(_IOREAD|_IOWRT|_IORW) && (iop->_flag&_IOSTRG)==0) { r = fflush(iop); if (close(fileno(iop)) < 0) r = EOF; if (iop->_flag&_IOMYBUF) free(iop->_base); if (iop->_flag&(_IOMYBUF|_IONBF((|_IOLBF)) iop->_base = NULL; } iop->_flag &= ~(_IOREAD|_IOWRT|_IOLBF|_IONBF|_IOMYBUF|_IOERR|_IOEOF|_IOSTRG|_IORW); iop->_cnt = 0; return(r); } truct _iobuf *_lastbuf; for (iop = _iob; iop < _lastbuf; iop++) fclose(iop); } fclose(iop) register struct _iobuf *iop; { register r; r = EOF; if (iop->_flag&(_IOREAD|_IOWRT|_IORW) && (iop->_flag&_IOSTRG)==0) { r = fflush(iop); if (close(fileno(iop)) < 0) r = EOF; if (iop->_flag&_IOMYBUF) free(iop->_base); if (iop->_flag&(_IOMYBUF|_IONBFlibc/stdio/fprintf.c 444 0 33 253 2451004045 7652 /* @(#)fprintf.c 4.1 (Berkeley) 12/21/80 */ #include fprintf(iop, fmt, args) FILE *iop; char *fmt; { _doprnt(fmt, &args, iop); return(ferror(iop)? EOF: 0); } f; for (iop = _iob; iop < _lastbuf; iop++) fclose(iop); } fclose(iop) register struct _iobuf *iop; { register r; r = EOF; if (iop->_flag&(_IOREAD|_IOWRT|_IORW) && (iop->_flag&_IOSTRG)==0) { r = fflush(iop); if (close(fileno(iop)) < 0) /,5| /,"libc/stdio/fputc.c 444 0 33 157 2451004046 7327 /* @(#)fputc.c 4.1 (Berkeley) 12/21/80 */ #include fputc(c, fp) FILE *fp; { return(putc(c, fp)); } _doprnt(fmt, &args, iop); return(ferror(iop)? EOF: 0); } f; for (iop = _iob; iop < _lastbuf; iop++) fclose(iop); } fclose(iop) register struct _iobuf *iop; { register r; r = EOF; if (iop->_flag&(_IOREAD|_IOWRT|_IORW) && (iop->_flag&_IOSTRG)==0) { r = fflush(iop); if (close(fileno(iop)) < 0) /,5 /,"libc/stdio/fputs.c 444 0 33 303 2451004047 7341 /* @(#)fputs.c 4.1 (Berkeley) 12/21/80 */ #include fputs(s, iop) register char *s; register FILE *iop; { register r; register c; while (c = *s++) r = putc(c, iop); return(r); } p < _lastbuf; iop++) fclose(iop); } fclose(iop) register struct _iobuf *iop; { register r; r = EOF; if (iop->_flag&(_IOREAD|_IOWRT|_IORW) && (iop->_flag&_IOSTRG)==0) { r = fflush(iop); if (close(fileno(iop)) < 0) /,5 /,"libc/stdio/fopen.c 444 0 33 1605 2502613715 7342 /* @(#)fopen.c 4.2 (Berkeley) 3/9/81 */ #include #include FILE * fopen(file, mode) char *file; register char *mode; { extern int errno; register f, rw; register FILE *iop; extern FILE *_lastbuf; for (iop = _iob; iop->_flag&(_IOREAD|_IOWRT|_IORW); iop++) if (iop >= _lastbuf) return(NULL); rw = mode[1] == '+'; if (*mode=='w') { f = creat(file, 0666); if (rw && f>=0) { close(f); f = open(file, 2); } } else if (*mode=='a') { if ((f = open(file, rw? 2: 1)) < 0) { if (errno == ENOENT) { f = creat(file, 0666); if (rw && f>=0) { close(f); f = open(file, 2); } } } if (f >= 0) lseek(f, 0L, 2); } else f = open(file, rw? 2: 0); if (f < 0) return(NULL); iop->_cnt = 0; iop->_file = f; if (rw) iop->_flag |= _IORW; else if (*mode != 'r') iop->_flag |= _IOWRT; else iop->_flag |= _IOREAD; return(iop); } if (rw && f>=0) { close(f); f = open(file, 2); } } else if (*mode=='a') { if ((f = open(file, rw? 2: 1)) < 0) libc/stdio/freopen.c 444 0 33 1436 2502613716 7674 /* @(#)freopen.c 4.2 (Berkeley) 3/9/81 */ #include #include FILE * freopen(file, mode, iop) char *file; register char *mode; register FILE *iop; { extern int errno; register f, rw; rw = mode[1] == '+'; fclose(iop); if (*mode=='w') { f = creat(file, 0666); if (rw && f>=0) { close(f); f = open(file, 2); } } else if (*mode=='a') { if ((f = open(file, rw? 2: 1)) < 0) { if (errno == ENOENT) { f = creat(file, 0666); if (rw && f>=0) { close(f); f = open(file, 2); } } } if (f >= 0) lseek(f, 0L, 2); } else f = open(file, rw? 2: 0); if (f < 0) return(NULL); iop->_cnt = 0; iop->_file = f; if (rw) iop->_flag |= _IORW; else if (*mode != 'r') iop->_flag |= _IOWRT; else iop->_flag |= _IOREAD; return(iop); } if (rw && f>=0) { close(f); f = open(file, 2); } } else if (*mode=='a') { if ((f = open(file, rw? 2: 1)) < 0) { if (errno == ENOENT) { f = creat(file, 0666); if (rw && f>=0) { close(f); f = oplibc/stdio/fstab.c 444 0 33 4320 2451004051 7315 /* @(#)fstab.c 4.1 (Berkeley) 12/21/80 */ #include #include #include static struct fstab fs; static FILE *fs_file = 0; static char *fs_string(back, string, lg, end) char *string, *back; int lg; /* length of field to stuff into */ char end; { register char *cp; for (cp = string; *cp && *cp != end; cp++) continue; if (*cp == '\0') return(0); *cp = '\0'; strncpy(back, string, lg-1); return(cp+1); } static char *fs_digit(backp, string, end) int *backp; char *string; char end; { register int value = 0; register char *cp; for (cp = string; *cp && isdigit(*cp); cp++){ value *= 10; value += *cp - '0'; } if (*cp == '\0') return(0); *backp = value; while ( *cp && *cp != end) cp++; if (*cp == '\0') return(0); return(cp+1); } static int fstabscan(fsp) struct fstab *fsp; { register char *cp; char buf[256]; if (fgets(buf, 256, fs_file) == NULL) return(EOF); cp = buf; cp = fs_string(&fsp->fs_spec[0], cp, FSNMLG, ':'); if (cp == 0) return(0); cp = fs_string(&fsp->fs_file[0], cp, FSNMLG, ':'); if (cp == 0) return(1); cp = fs_string(&fsp->fs_type[0], cp, 3, ':'); if (cp == 0) return(2); cp = fs_digit(&fsp->fs_freq, cp, ':'); if (cp == 0) return(3); cp = fs_digit(&fsp->fs_passno, cp, '\n'); if (cp == 0) return(4); return(5); } int setfsent() { if (fs_file) endfsent(); if ( (fs_file = fopen(FSTAB, "r")) == NULL){ fs_file = 0; return(0); } return(1); } int endfsent() { if (fs_file){ fclose(fs_file); } return(1); } struct fstab *getfsent() { int nfields; if ( (fs_file == 0) && (setfsent() == 0) ) return(0); nfields = fstabscan(&fs); if (nfields == EOF || nfields != FSTABNARGS) return(0); return(&fs); } struct fstab *getfsspec(name) char *name; { register struct fstab *fsp; if (setfsent() == 0) /* start from the beginning */ return(0); while( (fsp = getfsent()) != 0){ if (strncmp(fsp->fs_spec, name, sizeof(fsp->fs_spec)) == 0) return(fsp); } return(0); } struct fstab *getfsfile(name) char *name; { register struct fstab *fsp; if (setfsent() == 0) /* start from the beginning */ return(0); while ( (fsp = getfsent()) != 0){ if (strncmp(fsp->fs_file, name, sizeof(fsp->fs_spec)) == 0) return(fsp); } return(0); } e) char *name; { register struct fstab *fsp; if (setfsent() == 0) /* start from the beginning */ return(0); while( (fsp = getfsent()) != 0){ if (strncmp(fsp->fs_spec, name, sizeof(fsp->fs_spec)) == 0) return(fsp); } return(0); } struct fstab *getfsfile(name) char *name; { register struct libc/stdio/fseek.c 444 0 33 2042 2502613717 7326 ((/* @(#)fseek.c 4.2 (Berkeley) 3/9/81 */ /* * Seek for standard library. Coordinates with buffering. */ #include long lseek(); fseek(iop, offset, ptrname) FILE *iop; long offset; { register resync, c; long p; iop->_flag &= ~_IOEOF; if (iop->_flag&_IOREAD) { if (ptrname<2 && iop->_base && !(iop->_flag&_IONBF)) { c = iop->_cnt; p = offset; if (ptrname==0) p += c - lseek(fileno(iop),0L,1); else offset -= c; if(!(iop->_flag&_IORW) && c>0&&p<=c && p>=iop->_base-iop->_ptr){ iop->_ptr += (int)p; iop->_cnt -= (int)p; return(0); } resync = offset&01; } else resync = 0; if (iop->_flag & _IORW) { iop->_ptr = iop->_base; iop->_flag &= ~_IOREAD; } p = lseek(fileno(iop), offset-resync, ptrname); iop->_cnt = 0; if (resync) getc(iop); } else if (iop->_flag & (_IOWRT|_IORW)) { fflush(iop); if (iop->_flag & _IORW) { iop->_cnt = 0; iop->_flag &= ~_IOWRT; iop->_ptr = iop->_base; } p = lseek(fileno(iop), offset, ptrname); } return(p==-1?-1:0); } int)p; iop->_cnt -= (int)p; return(0); } resync = offset&01; } else resync = 0; if (iop->_flag & _IORW) { iop->_ptr = iop->_base; iop->_flag &= ~_IOREAD; } p = lseek(fileno(iop), offset-resync, ptrname); iop->_cnt = 0; if (resync) getc(iop); } else if (iop->_flag & (_IOWRT|_IORW)) { fflush(iop); if (iop->_flag & _IORW) { iop->_cnt = 0; iop->_flag &= ~_IOWRT; iop->_ptr = iop->_base; } p = lseek(fileno(iop), offset, ptlibc/stdio/gcvt.c 444 0 33 2033 2451004053 7162 /* @(#)gcvt.c 4.1 (Berkeley) 12/21/80 */ /* * gcvt - Floating output conversion to * minimal length string */ char *ecvt(); char * gcvt(number, ndigit, buf) double number; char *buf; { int sign, decpt; register char *p1, *p2; register i; p1 = ecvt(number, ndigit, &decpt, &sign); p2 = buf; if (sign) *p2++ = '-'; for (i=ndigit-1; i>0 && p1[i]=='0'; i--) ndigit--; if (decpt >= 0 && decpt-ndigit > 4 || decpt < 0 && decpt < -3) { /* use E-style */ decpt--; *p2++ = *p1++; *p2++ = '.'; for (i=1; i #undef getchar getchar() { return(getc(stdin)); } = decpt%10 + '0'; } else { if (decpt<=0) { if (*p1!='0') *p2++ = '.'; while (decpt<0) { decpt++; *p2++ = '0'; } } for (i=1; i<=ndigit; i++) { *p2++ = *p1++; if (i==decpt) *p2++ = '.'; } if (ndigit #include #define CL ':' #define CM ',' #define NL '\n' #define MAXGRP 100 static char GROUP[] = "/etc/group"; static FILE *grf = NULL; static char line[BUFSIZ+1]; static struct group group; static char *gr_mem[MAXGRP]; setgrent() { if( !grf ) grf = fopen( GROUP, "r" ); else rewind( grf ); } endgrent() { if( grf ){ fclose( grf ); grf = NULL; } } static char * grskip(p,c) register char *p; register c; { while( *p && *p != c ) ++p; if( *p ) *p++ = 0; return( p ); } struct group * getgrent() { register char *p, **q; if( !grf && !(grf = fopen( GROUP, "r" )) ) return(NULL); if( !(p = fgets( line, BUFSIZ, grf )) ) return(NULL); group.gr_name = p; group.gr_passwd = p = grskip(p,CL); group.gr_gid = atoi( p = grskip(p,CL) ); group.gr_mem = gr_mem; p = grskip(p,CL); grskip(p,NL); q = gr_mem; while( *p ){ *q++ = p; p = grskip(p,CM); } *q = NULL; return( &group ); } char *p; register c; { while( *p && *p !libc/stdio/getgrgid.c 444 0 33 373 2451004054 10001 /* @(#)getgrgid.c 4.1 (Berkeley) 12/21/80 */ #include struct group * getgrgid(gid) register gid; { register struct group *p; struct group *getgrent(); setgrent(); while( (p = getgrent()) && p->gr_gid != gid ); endgrent(); return(p); } swd = p = grskip(p,CL); group.gr_gid = atoi( p = grskip(p,CL) ); group.gr_mem = gr_mem; p = grskip(p,CL); grskip(p,NL); q = gr_mem; while( *p ){ *q++ = p; p = /,5 /,"libc/stdio/getgrnam.c 444 0 33 412 2451004055 10004 /* @(#)getgrnam.c 4.1 (Berkeley) 12/21/80 */ #include struct group * getgrnam(name) register char *name; { register struct group *p; struct group *getgrent(); setgrent(); while( (p = getgrent()) && strcmp(p->gr_name,name) ); endgrent(); return(p); } p(p,CL); group.gr_gid = atoi( p = grskip(p,CL) ); group.gr_mem = gr_mem; p = grskip(p,CL); grskip(p,NL); q = gr_mem; while( *p ){ *q++ = p; p = /,5, /,"libc/stdio/getpass.c 444 0 33 1457 2550216121 7677 /* @(#)getpass.c 4.2 (Berkeley) 7/1/81 */ #include #include #include char * getpass(prompt) char *prompt; { struct sgttyb ttyb; int flags; register char *p; register c; FILE *fi; static char pbuf[9]; int (*signal())(); int (*sig)(); if ((fi = fdopen(open("/dev/tty", 2), "r")) == NULL) fi = stdin; else setbuf(fi, (char *)NULL); sig = signal(SIGINT, SIG_IGN); gtty(fileno(fi), &ttyb); flags = ttyb.sg_flags; ttyb.sg_flags &= ~ECHO; stty(fileno(fi), &ttyb); fprintf(stderr, "%s", prompt); fflush(stderr); for (p=pbuf; (c = getc(fi))!='\n' && c!=EOF;) { if (p < &pbuf[8]) *p++ = c; } *p = '\0'; fprintf(stderr, "\n"); fflush(stderr); ttyb.sg_flags = flags; stty(fileno(fi), &ttyb); signal(SIGINT, sig); if (fi != stdin) fclose(fi); return(pbuf); } tty", 2), "r")) == NULL) fi = stdin; else setbuf(fi, (char *)NULL); sig = signal(SIGINT, SIG_IGN); gtty(fileno(fi), &ttyb); flags = ttyb.sg_flags; ttyb.sg_flags &= ~ECHO; stty(fileno(fi), &ttyb); fplibc/stdio/getpw.c 444 0 33 1116 2451004057 7352 ((/* @(#)getpw.c 4.1 (Berkeley) 12/21/80 */ #include getpw(uid, buf) int uid; char buf[]; { static FILE *pwf; register n, c; register char *bp; if(pwf == 0) pwf = fopen("/etc/passwd", "r"); if(pwf == NULL) return(1); rewind(pwf); for (;;) { bp = buf; while((c=getc(pwf)) != '\n') { if(c == EOF) return(1); *bp++ = c; } *bp++ = '\0'; bp = buf; n = 3; while(--n) while((c = *bp++) != ':') if(c == '\n') return(1); while((c = *bp++) != ':') { if(c<'0' || c>'9') continue; n = n*10+c-'0'; } if(n == uid) return(0); } } int uid; char buf[]; { static FILE *pwf; register n, c; register char *bp; if(pwf == 0) pwf = fopen("/etc/passwd", "r"); if(pwf == NULL) return(1); rewind(pwf); for (;;) { bp = buf; while((c=getc(pwf)) != '\n') { if(c == EOF) return(1); *bp++ = c; } *bp++ = '\0'; bp = buf; n = 3; while(--n) while((c = *bp++) != ':') if(c == '\n') return(1); while((c = *bp++) != ':') { if(c<'0' || libc/stdio/getpwent.c 444 0 33 2040 2451004060 10050 /* @(#)getpwent.c 4.1 (Berkeley) 12/21/80 */ #include #include static char PASSWD[] = "/etc/passwd"; static char EMPTY[] = ""; static FILE *pwf = NULL; static char line[BUFSIZ+1]; static struct passwd passwd; setpwent() { if( pwf == NULL ) pwf = fopen( PASSWD, "r" ); else rewind( pwf ); } endpwent() { if( pwf != NULL ){ fclose( pwf ); pwf = NULL; } } static char * pwskip(p) register char *p; { while( *p && *p != ':' ) ++p; if( *p ) *p++ = 0; return(p); } struct passwd * getpwent() { register char *p; if (pwf == NULL) { if( (pwf = fopen( PASSWD, "r" )) == NULL ) return(0); } p = fgets(line, BUFSIZ, pwf); if (p==NULL) return(0); passwd.pw_name = p; p = pwskip(p); passwd.pw_passwd = p; p = pwskip(p); passwd.pw_uid = atoi(p); p = pwskip(p); passwd.pw_gid = atoi(p); passwd.pw_quota = 0; passwd.pw_comment = EMPTY; p = pwskip(p); passwd.pw_gecos = p; p = pwskip(p); passwd.pw_dir = p; p = pwskip(p); passwd.pw_shell = p; while(*p && *p != '\n') p++; *p = '\0'; return(&passwd); } p; if (pwf == NULL) { if( (pwf = fopen( PASSWD, "r" )) == NULL ) return(0); } p = fgets(line, BUFSIZ, pwf); if (p==NULL) return(0); passwd.pw_name = p; p = pwskip(p); passwd.pw_passwd = p; p = pwskip(p); passwd.pw_uid = atoi(p); p = pwskip(p); passwd.pw_gid = atoi(p); passwd.pw_quota = 0; passwd.pw_comment = EMPTY; p = pwskip(p); passwd.pw_gecos = p; p = pwskip(p); passwd.pw_dir = p; p = pwskip(p); passwd.pw_shell = p; while(*p && *p != '\n') p++; libc/stdio/getpwnam.c 444 0 33 404 2451004060 10017 /* @(#)getpwnam.c 4.1 (Berkeley) 12/21/80 */ #include struct passwd * getpwnam(name) char *name; { register struct passwd *p; struct passwd *getpwent(); setpwent(); while( (p = getpwent()) && strcmp(name,p->pw_name) ); endpwent(); return(p); } pw_uid = atoi(p); p = pwskip(p); passwd.pw_gid = atoi(p); passwd.pw_quota = 0; passwd.pw_comment = EMPTY; p = pwskip(p); passwd.pw_gecos = p; p = pwskip(/,5l /,"libc/stdio/getpwuid.c 444 0 33 376 2451004061 10036 /* @(#)getpwuid.c 4.1 (Berkeley) 12/21/80 */ #include struct passwd * getpwuid(uid) register uid; { register struct passwd *p; struct passwd *getpwent(); setpwent(); while( (p = getpwent()) && p->pw_uid != uid ); endpwent(); return(p); } p); } pw_uid = atoi(p); p = pwskip(p); passwd.pw_gid = atoi(p); passwd.pw_quota = 0; passwd.pw_comment = EMPTY; p = pwskip(p); passwd.pw_gecos = p; p = pwskip(/,5| /,"libc/stdio/gets.c 444 0 33 372 2451004061 7144 /* @(#)gets.c 4.1 (Berkeley) 12/21/80 */ #include char * gets(s) char *s; { register c; register char *cs; cs = s; while ((c = getchar()) != '\n' && c >= 0) *cs++ = c; if (c<0 && cs==s) return(NULL); *cs++ = '\0'; return(s); } ; } p); } pw_uid = atoi(p); p = pwskip(p); passwd.pw_gid = atoi(p); passwd.pw_quota = 0; passwd.pw_comment = EMPTY; p = pwskip(p); passwd.pw_gecos = p; p = pwskip(/,5 /,"libc/stdio/getw.c 444 0 33 366 2451004062 7154 /* @(#)getw.c 4.1 (Berkeley) 12/21/80 */ #include getw(iop) register FILE *iop; { register i; register char *p; int w; p = (char *)&w; for (i=sizeof(int); --i>=0;) *p++ = getc(iop); if (feof(iop)) return(EOF); return(w); } ; } ; } p); } pw_uid = atoi(p); p = pwskip(p); passwd.pw_gid = atoi(p); passwd.pw_quota = 0; passwd.pw_comment = EMPTY; p = pwskip(p); passwd.pw_gecos = p; p = pwskip(/,5 /,"libc/stdio/intss.c 444 0 33 326 2550215325 7350 /* @(#)intss.c 4.2 (Berkeley) 7/1/81 */ #include /* * Name refers to ``in TSS'', i.e. in the * TSS operating system and thus that input is a terminal. */ intss() { return (isatty(fileno(stdin))); } )) return(EOF); return(w); } ; } ; } p); } pw_uid = atoi(p); p = pwskip(p); passwd.pw_gid = atoi(p); passwd.pw_quota = 0; passwd.pw_comment = EMPTY; p = pwskip(p); passwd.pw_gecos = p; p = pwskip(/,5 /,"libc/stdio/popen.c 444 0 33 2062 2451004063 7343 /* @(#)popen.c 4.1 (Berkeley) 12/21/80 */ #include #include #define tst(a,b) (*mode == 'r'? (b) : (a)) #define RDR 0 #define WTR 1 static int popen_pid[20]; FILE * popen(cmd,mode) char *cmd; char *mode; { int p[2]; register myside, hisside, pid; if(pipe(p) < 0) return NULL; myside = tst(p[WTR], p[RDR]); hisside = tst(p[RDR], p[WTR]); if((pid = vfork()) == 0) { /* myside and hisside reverse roles in child */ close(myside); dup2(hisside, tst(0, 1)); close(hisside); execl("/bin/sh", "sh", "-c", cmd, 0); _exit(1); } if(pid == -1) return NULL; popen_pid[myside] = pid; close(hisside); return(fdopen(myside, mode)); } pclose(ptr) FILE *ptr; { register f, r, (*hstat)(), (*istat)(), (*qstat)(); int status; f = fileno(ptr); fclose(ptr); istat = signal(SIGINT, SIG_IGN); qstat = signal(SIGQUIT, SIG_IGN); hstat = signal(SIGHUP, SIG_IGN); while((r = wait(&status)) != popen_pid[f] && r != -1) ; if(r == -1) status = -1; signal(SIGINT, istat); signal(SIGQUIT, qstat); signal(SIGHUP, hstat); return(status); } if(pid == -1) return NULL; popen_pid[myside] = pid; close(hisside); return(fdopen(myside, mode)); } pclose(ptr) FILE *ptr; { register f, r, (*hstat)(), (*istat)(), (*qstat)(); int status; f = fileno(ptr); fclose(ptr); istat = signal(SIGINT, SIG_IGN); qstat = signal(SIGQUIT, SIG_IGN); hstat = signal(SIGHUP, SIG_IGN); while((r = wait(&status)) != popen_pid[f] && r != -1) ; if(r == -1) status = -1; signal(SIGINT, istat); signal(SIGQUIT, q((libc/stdio/printf.c 444 0 33 237 2451004064 7507 /* @(#)printf.c 4.1 (Berkeley) 12/21/80 */ #include printf(fmt, args) char *fmt; { _doprnt(fmt, &args, stdout); return(ferror(stdout)? EOF: 0); } lose(ptr) FILE *ptr; { register f, r, (*hstat)(), (*istat)(), (*qstat)(); int status; f = fileno(ptr); fclose(ptr); istat = signal(SIGINT, SIG_IGN); qstat = signal(SIGQUIT, SIG_IGN); hstat = signal(SIGHUP, SIG_IGN); while((r = wait(&status)) != popen_p/,5̈ /,"libc/stdio/putchar.c 444 0 33 261 2451004065 7651 /* @(#)putchar.c 4.1 (Berkeley) 12/21/80 */ /* * A subroutine version of the macro putchar */ #include #undef putchar putchar(c) register c; { putc(c, stdout); } r; { register f, r, (*hstat)(), (*istat)(), (*qstat)(); int status; f = fileno(ptr); fclose(ptr); istat = signal(SIGINT, SIG_IGN); qstat = signal(SIGQUIT, SIG_IGN); hstat = signal(SIGHUP, SIG_IGN); while((r = wait(&status)) != popen_p/,5܈ /,"libc/stdio/puts.c 444 0 33 241 2451004066 7175 /* @(#)puts.c 4.1 (Berkeley) 12/21/80 */ #include puts(s) register char *s; { register c; while (c = *s++) putchar(c); return(putchar('\n')); } c(c, stdout); } r; { register f, r, (*hstat)(), (*istat)(), (*qstat)(); int status; f = fileno(ptr); fclose(ptr); istat = signal(SIGINT, SIG_IGN); qstat = signal(SIGQUIT, SIG_IGN); hstat = signal(SIGHUP, SIG_IGN); while((r = wait(&status)) != popen_p/,5 /,"libc/stdio/putw.c 444 0 33 333 2451004067 7204 /* @(#)putw.c 4.1 (Berkeley) 12/21/80 */ #include putw(w, iop) register FILE *iop; { register char *p; register i; p = (char *)&w; for (i=sizeof(int); --i>=0;) putc(*p++, iop); return(ferror(iop)); } ), (*qstat)(); int status; f = fileno(ptr); fclose(ptr); istat = signal(SIGINT, SIG_IGN); qstat = signal(SIGQUIT, SIG_IGN); hstat = signal(SIGHUP, SIG_IGN); while((r = wait(&status)) != popen_p/,5 /,"libc/stdio/rdwr.c 444 0 33 1236 2451004067 7206 /* @(#)rdwr.c 4.1 (Berkeley) 12/21/80 */ #include fread(ptr, size, count, iop) unsigned size, count; register char *ptr; register FILE *iop; { register c; unsigned ndone, s; ndone = 0; if (size) for (; ndone= 0) *ptr++ = c; else return(ndone); } while (--s); } return(ndone); } fwrite(ptr, size, count, iop) unsigned size, count; register char *ptr; register FILE *iop; { register unsigned s; unsigned ndone; ndone = 0; if (size) for (; ndone= 0) *ptr++ = c; else return(ndone); } while (--s); } return(ndone); } fwrite(ptr, size, count, iop) unsigned size, count; register char *ptr; register FILE *iop; { register unsigned s; unsigned ndone; ndonlibc/stdio/ftell.c 444 0 33 1055 2502613720 7334 /* @(#)ftell.c 4.2 (Berkeley) 3/9/81 */ /* * Return file offset. * Coordinates with buffering. */ #include long lseek(); long ftell(iop) FILE *iop; { long tres; register adjust; if (iop->_cnt < 0) iop->_cnt = 0; if (iop->_flag&_IOREAD) adjust = - iop->_cnt; else if (iop->_flag&(_IOWRT|_IORW)) { adjust = 0; if (iop->_flag&_IOWRT && iop->_base && (iop->_flag&_IONBF)==0) adjust = iop->_ptr - iop->_base; } else return(-1); tres = lseek(fileno(iop), 0L, 1); if (tres<0) return(tres); tres += adjust; return(tres); } Return file offset. * Coordinates with buffering. */ #include long lseek(); long ftell(iop) FILE *iop; { long tres; register adjust; if (iop->_cnt < 0) iop->_cnt = 0; if (iop->_flag&_IOREAD) adjust = - iop->_cnt; else if (iop->_flag&(_IOWRT|_IORW)) { adjust = 0; if (iop->_flag&_IOWRT && iop->_base && (iop->_flag&_IONBF)==0) adjust = iop->_ptr - iop->_base; } else return(-1); tres = lseek(fileno(iop), 0L, 1); if (tres<0) retlibc/stdio/scanf.c 444 0 33 707 2451004071 7277 /* @(#)scanf.c 4.1 (Berkeley) 12/21/80 */ #include scanf(fmt, args) char *fmt; { return(_doscan(stdin, fmt, &args)); } fscanf(iop, fmt, args) FILE *iop; char *fmt; { return(_doscan(iop, fmt, &args)); } sscanf(str, fmt, args) register char *str; char *fmt; { FILE _strbuf; _strbuf._flag = _IOREAD|_IOSTRG; _strbuf._ptr = _strbuf._base = str; _strbuf._cnt = 0; while (*str++) _strbuf._cnt++; return(_doscan(&_strbuf, fmt, &args)); } , /,"libc/stdio/setbuf.c 444 0 33 523 2451004072 7472 /* @(#)setbuf.c 4.1 (Berkeley) 12/21/80 */ #include setbuf(iop, buf) register struct _iobuf *iop; char *buf; { if (iop->_base != NULL && iop->_flag&_IOMYBUF) free(iop->_base); iop->_flag &= ~(_IOMYBUF|_IONBF|_IOLBF); if ((iop->_base = buf) == NULL) iop->_flag |= _IONBF; else iop->_ptr = iop->_base; iop->_cnt = 0; } _strbuf._base = str; _strbuf._cnt = 0; while (*str++) _strbuf._cnt++; return/,5< /,"libc/stdio/sprintf.c 444 0 33 436 2451004072 7672 /* @(#)sprintf.c 4.1 (Berkeley) 12/21/80 */ #include char *sprintf(str, fmt, args) char *str, *fmt; { struct _iobuf _strbuf; _strbuf._flag = _IOWRT+_IOSTRG; _strbuf._ptr = str; _strbuf._cnt = 32767; _doprnt(fmt, &args, &_strbuf); putc('\0', &_strbuf); return(str); } F; else iop->_ptr = iop->_base; iop->_cnt = 0; } _strbuf._base = str; _strbuf._cnt = 0; while (*str++) _strbuf._cnt++; return/,5L /,"((libc/stdio/strout.c 444 0 33 657 2451004073 7553 /* @(#)strout.c 4.1 (Berkeley) 12/21/80 */ #include _strout(count, string, adjust, file, fillch) register char *string; register count; int adjust; register struct _iobuf *file; { while (adjust < 0) { if (*string=='-' && fillch=='0') { putc(*string++, file); count--; } putc(fillch, file); adjust++; } while (--count>=0) putc(*string++, file); while (adjust) { putc(fillch, file); adjust--; } } ,5\ /,"libc/stdio/stuff.c 444 0 33 127 2451004074 7333 /* @(#)stuff.c 4.1 (Berkeley) 12/21/80 */ int yyportlib =1; wdleng() { return(32); } djust, file, fillch) register char *string; register count; int adjust; register struct _iobuf *file; { while (adjust < 0) { if (*string=='-' && fillch=='0') { putc(*string++, file); count--; } putc(fillch, file); adjust++; } while (--count>=0) putc(*string++, file); while (adjust) { putc(fillch, file); adju/,5l /,"libc/stdio/system.c 444 0 33 676 2451004074 7541 /* @(#)system.c 4.1 (Berkeley) 12/21/80 */ #include system(s) char *s; { int status, pid, w; register int (*istat)(), (*qstat)(); if ((pid = vfork()) == 0) { execl("/bin/sh", "sh", "-c", s, 0); _exit(127); } istat = signal(SIGINT, SIG_IGN); qstat = signal(SIGQUIT, SIG_IGN); while ((w = wait(&status)) != pid && w != -1) ; if (w == -1) status = -1; signal(SIGINT, istat); signal(SIGQUIT, qstat); return(status); } 5| /,"libc/stdio/tmpnam.c 444 0 33 220 2451004075 7473 /* @(#)tmpnam.c 4.1 (Berkeley) 12/21/80 */ char *tmpnam(s) char *s; { static seed; sprintf(s, "temp.%d.%d", getpid(), seed++); return(s); } if ((pid = vfork()) == 0) { execl("/bin/sh", "sh", "-c", s, 0); _exit(127); } istat = signal(SIGINT, SIG_IGN); qstat = signal(SIGQUIT, SIG_IGN); while ((w = wait(&status)) != pid && w != -1) ; if (w == -1) status = -1; signal(SIGINT, istat); signal(SIGQUIT, q/,5 /,"libc/stdio/ungetc.c 444 0 33 477 2451004076 7503 /* @(#)ungetc.c 4.1 (Berkeley) 12/21/80 */ #include ungetc(c, iop) register FILE *iop; { if (c == EOF) return(-1); if ((iop->_flag&_IOREAD)==0 || iop->_ptr <= iop->_base) if (iop->_ptr == iop->_base && iop->_cnt==0) *iop->_ptr++; else return(-1); iop->_cnt++; *--iop->_ptr = c; return(0); } atus)) != pid && w != -1) ; if (w == -1) status = -1; signal(SIGINT, istat); signal(SIGQUIT, q/,5 /,"libc/stdio/Makefile 644 0 33 1343 2451011155 7521 # %W% (Berkeley) %G% CFLAGS= -O OBJS= clrerr.o data.o doprnt.o doscan.o error.o \ fdopen.o fgetc.o fgets.o filbuf.o flsbuf.o fopen.o \ fprintf.o fputc.o fputs.o freopen.o fseek.o fstab.o ftell.o \ gcvt.o getchar.o getgrent.o getgrgid.o getgrnam.o \ getpass.o getpw.o getpwent.o getpwnam.o getpwuid.o gets.o getw.o \ intss.o popen.o printf.o putchar.o puts.o putw.o \ rdwr.o rew.o scanf.o setbuf.o sprintf.o strout.o stuff.o system.o \ tmpnam.o ungetc.o .c.o: ${CC} ${CFLAGS} -c $*.c -ld -x -r $*.o mv a.out $*.o .s.o: ${AS} -o $*.o $*.s -ld -x -r $*.o mv a.out $*.o all: ${OBJS} clean: rm -f ${OBJS} doprnt.o: cp doprnt.s doprnt.c cc -E doprnt.c | as -o doprnt.o -ld -x -r doprnt.o mv a.out doprnt.o rm -f doprnt.c getgrgid.o getgrnam.o \ getpass.o getpw.o getpwent.o getpwnam.o getpwuid.o gets.o getw.o \ intss.o popen.o printf.o putchar.o puts.o putw.o \ rdwr.o rew.o scanf.o setbuf.o sprintf.o strout.o stuff.o system.o \ tmpnam.o ungetc.o .c.o: ${CC} ${CFLAGS} -c $*.c -ld -x -r $*.o mv libc/stdio/rew.c 444 0 33 427 2502613721 7006 /* @(#)rew.c 4.2 (Berkeley) 3/9/81 */ #include rewind(iop) register struct _iobuf *iop; { fflush(iop); lseek(fileno(iop), 0L, 0); iop->_cnt = 0; iop->_ptr = iop->_base; iop->_flag &= ~(_IOERR|_IOEOF); if (iop->_flag & _IORW) iop->_flag &= ~(_IOREAD|_IOWRT); } .o getpwnam.o getpwuid.o gets.o getw.o \ intss.o popen.o printf.o putchar.o puts.o putw.o \ rdwr.o rew.o scanf.o setbuf.o sprintf.o strout./,5 /,"libc/stdio/t 644 0 33 1012 2506750642 6254 /******* Start bogus movtuc workaround *****/ clrl r2 tstl r0 bleq movdon movlp: tstl r4 bleq movdon movzbl (r1)+,r3 tstb strtab[r3] bneq 1f mnegl $1,r2 decl r1 brb movdon 1: movb r3,(r5)+ decl r4 sobgtr r0,movlp /******* End bogus movtuc workaround *** movtuc r0,(r1),$0,(r3),r4,(r5) movpsl r2 /* squirrel away condition codes */ /******* End equally bogus movtuc ****/ movdon: movq r4,*fdesc /* update output descriptor */ tart bogus movtuc workaround *****/ clrl r2 tstl r0 bleq movdon movlp: tstl r4 bleq movdon movzbl (r1)+,r3 tstb strtab[r3] bneq 1f mnegl $1,r2 decl r1 brb movdon 1: movb r3,(r5)+ decl r4 sobgtr r0,movlp /******* End bogus movtuc workaround *** movtuc r0,(r1),$0,(r3),r4,(r5) movpsl r2 /* squirrel away condition codes */ /******* End equally bogus movtuc ****/ movdon: movq r4,*fdesc /* update output desclibc/sys/ 775 0 33 0 2552604333 5501 libc/sys/_exit.s 444 0 33 374 2451005235 7034 ((# @(#)_exit.s 4.1 (Berkeley) 12/21/80 # C library -- _exit # _exit(code) # code is return in r0 to system # Same as plain exit, for user who want to define their own exit. .set exit,1 .globl __exit .align 1 __exit: .word 0x0000 chmk $exit halt r0,movlp /******* End bogus movtuc workaround *** movtuc r0,(r1),$0,(r3),r4,(r5) movpsl r2 /* squirrel away conditi odes */ / C. /,"libc/sys/abort.s 444 0 33 177 2451005236 7035 # @(#)abort.s 4.1 (Berkeley) 12/21/80 # C library -- abort .globl _abort .align 1 _abort: .word 0x0000 halt clrl r0 ret , for user who want to define their own exit. .set exit,1 .globl __exit .align 1 __exit: .word 0x0000 chmk $exit halt r0,movlp /******* End bogus movtuc workaround *** movtuc r0,(r1),$0,(r3),r4,(r5) movpsl r2 /* squirrel away conditi odes */ //,5܆ /,"libc/sys/abs.s 444 0 33 263 2451005236 6467 # @(#)abs.s 4.1 (Berkeley) 12/21/80 # abs - int absolute value. # fabs - floating abs .globl _abs .align 1 _abs: .word 0x0000 movl 4(ap),r0 bgeq absl mnegl r0,r0 absl: ret exit,1 .globl __exit .align 1 __exit: .word 0x0000 chmk $exit halt r0,movlp /******* End bogus movtuc workaround *** movtuc r0,(r1),$0,(r3),r4,(r5) movpsl r2 /* squirrel away conditi odes */ //,5 /,"libc/sys/access.s 444 0 33 413 2451005237 7161 # @(#)access.s 4.1 (Berkeley) 12/21/80 # access(file, request) # test ability to access file in all indicated ways # 1 - read # 2 - write # 4 - execute .set access,33 .globl _access _access: .word 0x0000 chmk $access bcc noerror jmp cerror noerror: ret ****** End bogus movtuc workaround *** movtuc r0,(r1),$0,(r3),r4,(r5) movpsl r2 /* squirrel away conditi odes */ //,5 /,"libc/sys/acct.s 444 0 33 257 2451005237 6640 # @(#)acct.s 4.1 (Berkeley) 12/21/80 # C library -- acct .set acct,51 .globl _acct .globl cerror _acct: .word 0x0000 chmk $acct bcc noerror jmp cerror noerror: ret lobl _access _access: .word 0x0000 chmk $access bcc noerror jmp cerror noerror: ret ****** End bogus movtuc workaround *** movtuc r0,(r1),$0,(r3),r4,(r5) movpsl r2 /* squirrel away conditi odes */ //,5  /,"libc/sys/alarm.s 444 0 33 342 2451005240 7007 # @(#)alarm.s 4.1 (Berkeley) 12/21/80 # C library - alarm, pause .set alarm,27 .globl _alarm .set pause,29 .globl _pause .align 1 _alarm: .word 0x0000 chmk $alarm ret .align 1 _pause: .word 0x0000 chmk $pause ret bcc noerror jmp cerror noerror: ret ****** End bogus movtuc workaround *** movtuc r0,(r1),$0,(r3),r4,(r5) movpsl r2 /* squirrel away conditi odes */ //,5 /,"libc/sys/alloca.s 444 0 33 534 2451005240 7151 # @(#)alloca.s 4.1 (Berkeley) 12/21/80 # like alloc, but automatic # automatic free in return .globl _alloca _alloca: .word 0x0000 subl2 4(ap),sp # crude allocation movl 16(fp),r1 # pc movq 8(fp),ap # new (old) ap and fp bicl2 $3,sp # 4-byte align addl2 $7*4,sp # reuse space of mscp movl sp,r0 # return value jmp (r1) # funny return /* squirrel away conditi odes */ //,5, /,"libc/sys/cerror.s 444 0 33 244 2451005241 7211 # @(#)cerror.s 4.1 (Berkeley) 12/21/80 # C return sequence which # sets errno, returns -1. .globl cerror .comm _errno,4 cerror: movl r0,_errno mnegl $1,r0 ret ion movl 16(fp),r1 # pc movq 8(fp),ap # new (old) ap and fp bicl2 $3,sp # 4-byte align addl2 $7*4,sp # reuse space of mscp movl sp,r0 # return value jmp (r1) # funny return /* squirrel away conditi odes */ //,5< /,"libc/sys/chdir.s 444 0 33 311 2451005241 7001 # @(#)chdir.s 4.1 (Berkeley) 12/21/80 # C library -- chdir # error = chdir(string); .set chdir,12 .globl _chdir _chdir: .word 0x0000 chmk $chdir bcc noerror jmp cerror noerror: clrl r0 ret ap # new (old) ap and fp bicl2 $3,sp # 4-byte align addl2 $7*4,sp # reuse space of mscp movl sp,r0 # return value jmp (r1) # funny return /* squirrel away conditi odes */ //,5L /,"libc/sys/chmod.s 444 0 33 317 2451005242 7011 # @(#)chmod.s 4.1 (Berkeley) 12/21/80 # C library -- chmod # error = chmod(string, mode); .set chmod,15 .globl _chmod _chmod: .word 0x0000 chmk $chmod bcc noerror jmp cerror noerror: clrl r0 ret ew (old) ap and fp bicl2 $3,sp # 4-byte align addl2 $7*4,sp # reuse space of mscp movl sp,r0 # return value jmp (r1) # funny return /* squirrel away conditi odes */ //,5\ /,"libc/sys/chown.s 444 0 33 320 2451005242 7027 ((# @(#)chown.s 4.1 (Berkeley) 12/21/80 # C library -- chown # error = chown(string, owner); .set chown,16 .globl _chown _chown: .word 0x0000 chmk $chown bcc noerror jmp cerror noerror: clrl r0 ret w (old) ap and fp bicl2 $3,sp # 4-byte align addl2 $7*4,sp # reuse space of mscp movl sp,r0 # return value jmp (r1) # funny return /* squirrel away conditi odes */ //,5l /,"libc/sys/chroot.s 444 0 33 330 2451005243 7211 # @(#)chroot.s 4.1 (Berkeley) 12/21/80 # C library -- chroot # error = chroot(string); .set chroot,61 .globl _chroot .globl cerror _chroot: .word 0x0000 chmk $chroot bcc noerror jmp cerror noerror: ret ap and fp bicl2 $3,sp # 4-byte align addl2 $7*4,sp # reuse space of mscp movl sp,r0 # return value jmp (r1) # funny return /* squirrel away conditi odes */ //,5| /,"libc/sys/close.s 444 0 33 307 2451005243 7024 # @(#)close.s 4.1 (Berkeley) 12/21/80 # C library -- close # error = close(file); .set close,6 .globl _close _close: .word 0x0000 chmk $close bcc noerror jmp cerror noerror: clrl r0 ret or noerror: ret ap and fp bicl2 $3,sp # 4-byte align addl2 $7*4,sp # reuse space of mscp movl sp,r0 # return value jmp (r1) # funny return /* squirrel away conditi odes */ //,5 /,"libc/sys/creat.s 444 0 33 334 2451005244 7016 # @(#)creat.s 4.1 (Berkeley) 12/21/80 # C library -- creat # file = creat(string, mode); # # file == -1 if error .set creat,8 .globl _creat _creat: .word 0x0000 chmk $creat bcc noerror jmp cerror noerror: ret nd fp bicl2 $3,sp # 4-byte align addl2 $7*4,sp # reuse space of mscp movl sp,r0 # return value jmp (r1) # funny return /* squirrel away conditi odes */ //,5 /,"libc/sys/dup.s 444 0 33 423 2451005244 6507 # @(#)dup.s 4.1 (Berkeley) 12/21/80 # C library -- dup # f = dup(of [ ,nf]) # f == -1 for error .set dup,41 .globl _dup .globl _dup2 .globl cerror _dup2: .word 0x0000 bisb2 $0100,4(ap) brb L1 _dup: .word 0x0000 L1: chmk $dup bcc noerror jmp cerror noerror: ret use space of mscp movl sp,r0 # return value jmp (r1) # funny return /* squirrel away conditi odes */ //,5 /,"libc/sys/execl.s 444 0 33 271 2451005245 7021 # @(#)execl.s 4.1 (Berkeley) 12/21/80 # C library -- execl # execl(file, arg1, arg2, ... , 0); # .globl _execl _execl: .word 0x0000 pushab 8(ap) pushl 4(ap) calls $2,_execv ret 4(ap) brb L1 _dup: .word 0x0000 L1: chmk $dup bcc noerror jmp cerror noerror: ret use space of mscp movl sp,r0 # return value jmp (r1) # funny return /* squirrel away conditi odes */ //,5 /,"libc/sys/execle.s 444 0 33 402 2451005245 7162 # @(#)execle.s 4.1 (Berkeley) 12/21/80 # C library -- execle # execle(file, arg1, arg2, ... , env); # .globl _execle _execle: .word 0x0000 movl (ap),r0 # nargs pushl (ap)[r0] # env pushab 8(ap) # argv pushl 4(ap) # file calls $3,_execve ret or noerror: ret use space of mscp movl sp,r0 # return value jmp (r1) # funny return /* squirrel away conditi odes */ //,5̇ /,"libc/sys/execv.s 444 0 33 502 2451005246 7031 # @(#)execv.s 4.1 (Berkeley) 12/21/80 # C library -- execv # execv(file, argv); # # where argv is a vector argv[0] ... argv[x], 0 # last vector element must be 0 .globl _execv .globl _environ _execv: .word 0x0000 pushl _environ # default environ pushl 8(ap) # argv pushl 4(ap) # file calls $3,_execve ret jmp (r1) # funny return /* squirrel away conditi odes */ //,5܇ /,"libc/sys/execve.s 444 0 33 374 2451005246 7205 # @(#)execve.s 4.1 (Berkeley) 12/21/80 # C library -- execve # execve(file, argv, env); # # where argv is a vector argv[0] ... argv[x], 0 # last vector element must be 0 .set exece,59 .globl _execve _execve: .word 0x0000 chmk $exece jmp cerror pushl 8(ap) # argv pushl 4(ap) # file calls $3,_execve ret jmp (r1) # funny return /* squirrel away conditi odes */ //,5 /,"libc/sys/exit.s 444 0 33 332 2451005247 6672 # @(#)exit.s 4.1 (Berkeley) 12/21/80 # C library -- exit # exit(code) # code is return in r0 to system .set exit,1 .globl _exit .globl __cleanup .align 1 _exit: .word 0x0000 calls $0,__cleanup chmk $exit halt 0x0000 chmk $exece jmp cerror pushl 8(ap) # argv pushl 4(ap) # file calls $3,_execve ret jmp (r1) # funny return /* squirrel away conditi odes */ //,5 /,"libc/sys/fabs.s 444 0 33 205 2451005250 6625 ((# @(#)fabs.s 4.1 (Berkeley) 12/21/80 .globl _fabs .align 1 _fabs: .word 0x0000 movd 4(ap),r0 bgeq fabsl mnegd r0,r0 fabsl: ret lobl __cleanup .align 1 _exit: .word 0x0000 calls $0,__cleanup chmk $exit halt 0x0000 chmk $exece jmp cerror pushl 8(ap) # argv pushl 4(ap) # file calls $3,_execve ret jmp (r1) # funny return /* squirrel away conditi odes */ //,5  /,"libc/sys/fork.s 444 0 33 527 2451005250 6662 # @(#)fork.s 4.1 (Berkeley) 12/21/80 # C library -- fork # pid = fork(); # # r1 == 0 in parent process, r1 == 1 in child process. # r0 == pid of child in parent, r0 == pid of parent in child. .set fork,2 .globl _fork _fork: .word 0x0000 chmk $fork bcc forkok jmp cerror forkok: jlbc r1,parent clrl r0 # signify child parent: ret turn /* squirrel away conditi odes */ //,5 /,"libc/sys/fstat.s 444 0 33 344 2451005251 7040 # @(#)fstat.s 4.1 (Berkeley) 12/21/80 # C library -- fstat # error = fstat(file, statbuf); # char statbuf[34] .set fstat,28 .globl _fstat _fstat: .word 0x0000 chmk $fstat bcc noerror jmp cerror noerror: clrl r0 ret .word 0x0000 chmk $fork bcc forkok jmp cerror forkok: jlbc r1,parent clrl r0 # signify child parent: ret turn /* squirrel away conditi odes */ //,5, /,"libc/sys/getcsw.s 444 0 33 232 2451005251 7207 # @(#)getcsw.s 4.1 (Berkeley) 12/21/80 # C library - getcsw # csw = getcsw(); .set getcsw,38 .globl _getcsw _getcsw: .word 0x0000 chmk $getcsw ret ord 0x0000 chmk $fstat bcc noerror jmp cerror noerror: clrl r0 ret .word 0x0000 chmk $fork bcc forkok jmp cerror forkok: jlbc r1,parent clrl r0 # signify child parent: ret turn /* squirrel away conditi odes */ //,5< /,"libc/sys/getgid.s 444 0 33 452 2451005252 7163 # @(#)getgid.s 4.1 (Berkeley) 12/21/80 # C library -- getgid # gid = getgid(); # .set getgid,47 .globl _getgid _getgid: .word 0x0000 chmk $getgid ret # C library -- getegid # gid = getegid(); # returns effective gid .globl _getegid _getegid: .word 0x0000 chmk $getgid movl r1,r0 ret arent clrl r0 # signify child parent: ret turn /* squirrel away conditi odes */ //,5L /,"libc/sys/getpid.s 444 0 33 326 2451005252 7174 # @(#)getpid.s 4.1 (Berkeley) 12/21/80 # getpid -- get process ID .set getpid,20 .globl _getpid _getpid: .word 0x0000 chmk $getpid ret .globl _getppid _getppid: .word 0x0000 chmk $getpid movl r1,r0 ret ective gid .globl _getegid _getegid: .word 0x0000 chmk $getgid movl r1,r0 ret arent clrl r0 # signify child parent: ret turn /* squirrel away conditi odes */ //,5\ /,"libc/sys/getuid.s 444 0 33 455 2451005253 7205 # @(#)getuid.s 4.1 (Berkeley) 12/21/80 # C library -- getuid # uid = getuid(); # .set getuid,24 .globl _getuid _getuid: .word 0x0000 chmk $getuid ret # C library -- geteuid # uid = geteuid(); # returns effective uid .globl _geteuid _geteuid: .word 0x0000 chmk $getuid movl r1,r0 ret nt clrl r0 # signify child parent: ret turn /* squirrel away conditi odes */ //,5l /,"libc/sys/ioctl.s 444 0 33 376 2451005253 7040 # @(#)ioctl.s 4.1 (Berkeley) 12/21/80 # C library -- ioctl # ioctl(fdes,command,arg) # struct * arg; # # result == -1 if error .set ioctl,54 .globl _ioctl .globl cerror _ioctl: .word 0x0000 chmk $ioctl bcc noerror jmp cerror noerror: ret : .word 0x0000 chmk $getuid movl r1,r0 ret nt clrl r0 # signify child parent: ret turn /* squirrel away conditi odes */ //,5| /,"libc/sys/itol.s 444 0 33 263 2451005254 6671 # @(#)itol.s 4.1 (Berkeley) 12/21/80 # # Convert pair of integers to a long # .globl _itol _itol: .word 0x0000 ashl $16,4(ap),r0 bicl3 $0xffff0000,8(ap),r1 addl2 r1,r0 ret _ioctl: .word 0x0000 chmk $ioctl bcc noerror jmp cerror noerror: ret : .word 0x0000 chmk $getuid movl r1,r0 ret nt clrl r0 # signify child parent: ret turn /* squirrel away conditi odes */ //,5 /,"libc/sys/kill.s 444 0 33 267 2451005254 6661 # @(#)kill.s 4.1 (Berkeley) 12/21/80 # C library -- kill .set kill,37 .globl _kill .globl cerror _kill: .word 0x0000 chmk $kill bcc noerror jmp cerror noerror: clrl r0 ret ctl: .word 0x0000 chmk $ioctl bcc noerror jmp cerror noerror: ret : .word 0x0000 chmk $getuid movl r1,r0 ret nt clrl r0 # signify child parent: ret turn /* squirrel away conditi odes */ //,5 /,"libc/sys/link.s 444 0 33 335 2451005255 6660 ((# @(#)link.s 4.1 (Berkeley) 12/21/80 # C library -- link # error = link(old-file, new-file); # .set link,9 .globl _link .globl cerror _link: .word 0x0000 chmk $link bcc noerror jmp cerror noerror: clrl r0 ret oerror jmp cerror noerror: ret : .word 0x0000 chmk $getuid movl r1,r0 ret nt clrl r0 # signify child parent: ret turn /* squirrel away conditi odes */ //,5 /,"libc/sys/locv.s 444 0 33 422 2451005256 6664 # @(#)locv.s 4.1 (Berkeley) 12/21/80 # C library -- long output conversion .globl _locv _locv: .word 0x0000 subl2 $8,sp cvtlp 4(ap),$11,(sp) editpc $11,(sp),edpat,str skpc $' ,$11,str movl r1,r0 ret .data edpat: .byte 0xaa,0x01,0x91,0x44,0x00,0x00 str: .space 13 k $getuid movl r1,r0 ret nt clrl r0 # signify child parent: ret turn /* squirrel away conditi odes */ //,5 /,"libc/sys/lseek.s 444 0 33 332 2451005256 7024 # @(#)lseek.s 4.1 (Berkeley) 12/21/80 # C library -- lseek # error = lseek(file, offset, ptr); .set lseek,19 .globl _lseek .globl cerror _lseek: .word 0x0000 chmk $lseek bcc noerror jmp cerror noerror: ret pat: .byte 0xaa,0x01,0x91,0x44,0x00,0x00 str: .space 13 k $getuid movl r1,r0 ret nt clrl r0 # signify child parent: ret turn /* squirrel away conditi odes */ //,5̈ /,"libc/sys/ltod.s 444 0 33 420 2451005257 6662 # @(#)ltod.s 4.1 (Berkeley) 12/21/80 # C library # return floating-point from long integer # d = ltod(l) .globl _ltod _ltod: .word 0x0000 cvtld 4(ap),r0 ret # return long integer from floating # dtol(d, l) .globl _dtol _dtol: .word 0x0000 cvtdl 4(ap),*12(ap) ret 3 k $getuid movl r1,r0 ret nt clrl r0 # signify child parent: ret turn /* squirrel away conditi odes */ //,5܈ /,"libc/sys/ltoi.s 444 0 33 207 2451005257 6672 # @(#)ltoi.s 4.1 (Berkeley) 12/21/80 # # ltoi(long) returns the long as an int. .globl _ltoi _ltoi: .word 0x0000 movl 4(ap),r0 ret 0000 cvtld 4(ap),r0 ret # return long integer from floating # dtol(d, l) .globl _dtol _dtol: .word 0x0000 cvtdl 4(ap),*12(ap) ret 3 k $getuid movl r1,r0 ret nt clrl r0 # signify child parent: ret turn /* squirrel away conditi odes */ //,5 /,"libc/sys/makdir.s 444 0 33 335 2451005260 7166 # @(#)makdir.s 4.1 (Berkeley) 12/21/80 # C library -- makdir # error = makdir(string); .set mknod,14 .globl _makdir .globl cerror _makdir: .word 0x0000 chmk $mknod bcc noerror jmp cerror noerror: clrl r0 ret tol _dtol: .word 0x0000 cvtdl 4(ap),*12(ap) ret 3 k $getuid movl r1,r0 ret nt clrl r0 # signify child parent: ret turn /* squirrel away conditi odes */ //,5 /,"libc/sys/mcount.s 444 0 33 427 2451005260 7226 # @(#)mcount.s 4.1 (Berkeley) 12/21/80 # count subroutine called during profiling .globl mcount .comm countbase,4 mcount: movl (r0),r1 beql init incr: incl (r1) return: rsb init: movl countbase,r1 beql return addl2 $8,countbase movl (sp),(r1)+ movl r1,(r0) brb incr tuid movl r1,r0 ret nt clrl r0 # signify child parent: ret turn /* squirrel away conditi odes */ //,5  /,"libc/sys/mdate.s 444 0 33 275 2451005261 7015 # @(#)mdate.s 4.1 (Berkeley) 12/21/80 # C library-- mdate .set mdate,30 .globl _mdate .globl cerror _mdate: .word 0x0000 chmk $mdate bcc noerror jmp cerror noerror: clrl r0 ret l countbase,r1 beql return addl2 $8,countbase movl (sp),(r1)+ movl r1,(r0) brb incr tuid movl r1,r0 ret nt clrl r0 # signify child parent: ret turn /* squirrel away conditi odes */ //,5 /,"libc/sys/mknod.s 444 0 33 353 2451005262 7031 # @(#)mknod.s 4.1 (Berkeley) 12/21/80 # C library -- mknod # error = mknod(string, mode, major.minor); .set mknod,14 .globl _mknod .globl cerror _mknod: .word 0x0000 chmk $mknod bcc noerror jmp cerror noerror: clrl r0 ret e movl (sp),(r1)+ movl r1,(r0) brb incr tuid movl r1,r0 ret nt clrl r0 # signify child parent: ret turn /* squirrel away conditi odes */ //,5, /,"libc/sys/mount.s 444 0 33 340 2451005262 7057 # @(#)mount.s 4.1 (Berkeley) 12/21/80 # C library -- mount # error = mount(dev, file, flag) .set mount,21 .globl _mount .globl cerror _mount: .word 0x0000 chmk $mount bcc noerror jmp cerror noerror: clrl r0 ret rl r0 ret e movl (sp),(r1)+ movl r1,(r0) brb incr tuid movl r1,r0 ret nt clrl r0 # signify child parent: ret turn /* squirrel away conditi odes */ //,5< /,"libc/sys/mpxcall.s 444 0 33 346 2451005263 7364 ((# @(#)mpxcall.s 4.1 (Berkeley) 12/21/80 # C library -- mpxcall # mpxcall(file, buffer, count); # # .set mpxcall,56 .globl _mpxcall .globl cerror _mpxcall: .word 0x0000 chmk $mpxcall bcc noerror jmp cerror noerror: ret ret e movl (sp),(r1)+ movl r1,(r0) brb incr tuid movl r1,r0 ret nt clrl r0 # signify child parent: ret turn /* squirrel away conditi odes */ //,5L /,"libc/sys/nargs.s 444 0 33 213 2451005263 7027 # @(#)nargs.s 4.1 (Berkeley) 12/21/80 # C library -- nargs .globl _nargs _nargs: .word 0x0000 movzbl *8(fp),r0 # 8(fp) is old ap ret l cerror _mpxcall: .word 0x0000 chmk $mpxcall bcc noerror jmp cerror noerror: ret ret e movl (sp),(r1)+ movl r1,(r0) brb incr tuid movl r1,r0 ret nt clrl r0 # signify child parent: ret turn /* squirrel away conditi odes */ //,5\ /,"libc/sys/nexect.s 444 0 33 706 2451005264 7213 # @(#)nexect.s 4.1 (Berkeley) 12/21/80 # C library -- exect # exect(file, argv, env); # # where argv is a vector argv[0] ... argv[x], 0 # last vector element must be 0 # # The same as execve except that it sets the TBIT causing # a trace trap on the first instruction of the executed process, # to give a chance to set breakpoints. .globl _exect .globl cerror .set execve,59 _exect: .word 0x0000 bispsw $0x10 # set tbit chmk $execve jmp cerror l /,"libc/sys/nice.s 444 0 33 320 2451005264 6633 # @(#)nice.s 4.1 (Berkeley) 12/21/80 # C library-- nice # error = nice(hownice) .set nice,34 .globl _nice .globl cerror _nice: .word 0x0000 chmk $nice bcc noerror jmp cerror noerror: clrl r0 ret ets the TBIT causing # a trace trap on the first instruction of the executed process, # to give a chance to set breakpoints. .globl _exect .globl cerror .set execve,59 _exect: .word 0x0000 bispsw $0x10 # se/,5| /,"libc/sys/open.s 444 0 33 346 2451005265 6667 # @(#)open.s 4.1 (Berkeley) 12/21/80 # C library -- open # file = open(string, mode) # # file == -1 means error .set open,5 .globl _open .globl cerror _open: .word 0x0000 chmk $open bcc noerror jmp cerror noerror: ret a trace trap on the first instruction of the executed process, # to give a chance to set breakpoints. .globl _exect .globl cerror .set execve,59 _exect: .word 0x0000 bispsw $0x10 # se/,5 /,"libc/sys/pipe.s 444 0 33 373 2451005265 6663 # @(#)pipe.s 4.1 (Berkeley) 12/21/80 # pipe -- C library # pipe(f) # int f[2]; .set pipe,42 .globl _pipe .globl cerror _pipe: .word 0x0000 chmk $pipe bcc noerror jmp cerror noerror: movl 4(ap),r2 movl r0,(r2)+ movl r1,(r2) clrl r0 ret first instruction of the executed process, # to give a chance to set breakpoints. .globl _exect .globl cerror .set execve,59 _exect: .word 0x0000 bispsw $0x10 # se/,5 /,"libc/sys/prof.s 444 0 33 164 2451005267 6674 # @(#)prof.s 4.1 (Berkeley) 12/21/80 # profil .set prof,44 .globl _profil _profil: .word 0x0000 chmk $prof ret cerror _pipe: .word 0x0000 chmk $pipe bcc noerror jmp cerror noerror: movl 4(ap),r2 movl r0,(r2)+ movl r1,(r2) clrl r0 ret first instruction of the executed process, # to give a chance to set breakpoints. .globl _exect .globl cerror .set execve,59 _exect: .word 0x0000 bispsw $0x10 # se/,5 /,"libc/sys/ptrace.s 444 0 33 400 2451005270 7167 # @(#)ptrace.s 4.1 (Berkeley) 12/21/80 # ptrace -- C library # result = ptrace(req, pid, addr, data); .set ptrace,26 .globl _ptrace .globl cerror .globl _errno _ptrace: .word 0x0000 clrl _errno chmk $ptrace bcc noerror jmp cerror noerror: ret instruction of the executed process, # to give a chance to set breakpoints. .globl _exect .globl cerror .set execve,59 _exect: .word 0x0000 bispsw $0x10 # se/,5 /,"libc/sys/read.s 444 0 33 405 2451005270 6631 # @(#)read.s 4.1 (Berkeley) 12/21/80 # C library -- read # nread = read(file, buffer, count); # # nread ==0 means eof; nread == -1 means error .set read,3 .globl _read .globl cerror _read: .word 0x0000 chmk $read bcc noerror jmp cerror noerror: ret ruction of the executed process, # to give a chance to set breakpoints. .globl _exect .globl cerror .set execve,59 _exect: .word 0x0000 bispsw $0x10 # se/,5̉ /,"libc/sys/reset.s 444 0 33 1420 2451005271 7057 # @(#)reset.s 4.1 (Berkeley) 12/21/80 # C library -- reset, setexit # reset(x) # will generate a "return" from # the last call to # setexit() # by restoring r6 - r12, ap, fp # and doing a return. # The returned value is x; on the original # call the returned value is 0. # # useful for going back to the main loop # after a horrible error in a lowlevel # routine. .globl _setexit .globl _reset .align 1 _setexit: .word 0x0000 movab setsav,r0 movq r6,(r0)+ movq r8,(r0)+ movq r10,(r0)+ movq 8(fp),(r0)+ # ap, fp movab 4(ap),(r0)+ # sp movl 16(fp),(r0) # pc clrl r0 ret .align 1 _reset: .word 0x0000 movl 4(ap),r0 # returned value movab setsav,r1 movq (r1)+,r6 movq (r1)+,r8 movq (r1)+,r10 movq (r1)+,r12 movl (r1)+,sp jmp *(r1) .data setsav: .space 10*4 # # useful for going back to the main loop # after a horrible error in a lowlevel # routine. .globl _setexit .globl _reset .align 1 _setexit: .word 0x0000 movab setsav,r0 movq r6,(r0)+ movq r8,(r0)+ movq r10,(r0)+ movq 8(fp),(r0)+ ((libc/sys/sbrk.s 444 0 33 1112 2451005271 6674 # @(#)sbrk.s 4.1 (Berkeley) 12/21/80 #old = sbrk(increment); # #sbrk gets increment more core, and returns a pointer # to the beginning of the new core area # .set break,17 .globl _sbrk .globl _end .globl cerror .align 1 _sbrk: .word 0x0000 addl3 nd,4(ap),-(sp) pushl $1 movl ap,r3 movl sp,ap chmk $break bcc noerr1 jmp cerror noerr1: movl nd,r0 addl2 4(r3),nd ret .globl _brk # brk(value) # as described in man2. # returns 0 for ok, -1 for error. _brk: .word 0x0000 chmk $break bcc noerr2 jmp cerror noerr2: movl 4(ap),nd clrl r0 ret .data nd: .long _end increment more core, and returns a pointer # to the beginning of the new core area # .set break,17 .globl _sbrk .globl _end .globl cerror .align 1 _sbrk: .word 0x0000 addl3 nd,4(ap),-(sp) pushl $1 movl ap,r3 movl sp,ap chmk $break bcc noerr1 jmp cerror noerr1: movl nd,r0 addl2 4(r3),nd ret .globl _brk # brk(value) # as described in man2. # returns 0 for ok, -1 for error. _brk: .word 0x0000 chmk $break bcc noerr2libc/sys/setgid.s 444 0 33 334 2451005272 7200 # @(#)setgid.s 4.1 (Berkeley) 12/21/80 # C library -- setgid # error = setgid(uid); .set setgid,46 .globl _setgid .globl cerror _setgid: .word 0x0000 chmk $setgid bcc noerror jmp cerror noerror: clrl r0 ret gn 1 _sbrk: .word 0x0000 addl3 nd,4(ap),-(sp) pushl $1 movl ap,r3 movl sp,ap chmk $break bcc noerr1 jmp cerror noerr1: movl nd,r0 addl2 4(r3),nd ret .globl _brk # brk(value) # as describ/,5 /,"libc/sys/setjmp.s 444 0 33 1163 2451005272 7244 # @(#)setjmp.s 4.1 (Berkeley) 12/21/80 # C library -- setjmp, longjmp # longjmp(a,v) # will generate a "return(v)" from # the last call to # setjmp(a) # by restoring r6-pc from 'a' # and doing a return. # .globl _setjmp .globl _longjmp .align 1 _setjmp: .word 0x0000 movl 4(ap),r0 movq r6,(r0)+ movq r8,(r0)+ movq r10,(r0)+ movq 8(fp),(r0)+ # ap, fp movab 8(ap),(r0)+ # sp movl 16(fp),(r0) # pc clrl r0 ret .align 1 _longjmp: .word 0x0000 movl 8(ap),r0 # return(v) movl 4(ap),r1 movq (r1)+,r6 movq (r1)+,r8 movq (r1)+,r10 movq (r1)+,r12 movl (r1)+,sp tstl r0 bneq L1 movzbl $1,r0 L1: jmp *(r1) from # the last call to # setjmp(a) # by restoring r6-pc from 'a' # and doing a return. # .globl _setjmp .globl _longjmp .align 1 _setjmp: .word 0x0000 movl 4(ap),r0 movq r6,(r0)+ movq r8,(r0)+ movq r10,(r0)+ movq 8(fp),(r0)+ # ap, fp movab 8(ap),(r0)+ # sp movl 16(fp),(r0) # pc clrl r0 ret .align 1 _longjmp: .word 0x0000 movl 8(ap),r0 # return(v) movl 4(ap),r1 movq (r1libc/sys/setuid.s 444 0 33 334 2451005273 7217 # @(#)setuid.s 4.1 (Berkeley) 12/21/80 # C library -- setuid # error = setuid(uid); .set setuid,23 .globl _setuid .globl cerror _setuid: .word 0x0000 chmk $setuid bcc noerror jmp cerror noerror: clrl r0 ret p .globl _longjmp .align 1 _setjmp: .word 0x0000 movl 4(ap),r0 movq r6,(r0)+ movq r8,(r0)+ movq r10,(r0)+ movq 8(fp),(r0)+ # ap, fp movab 8(ap),(r0)+ # sp movl 16(fp),(r0) # pc clrl r0 /,5 /,"libc/sys/signal.s 444 0 33 570 2451005274 7202 # @(#)signal.s 4.1 (Berkeley) 12/21/80 # C library -- signal # signal(n, 0); /* default action on signal(n) */ # signal(n, odd); /* ignore signal(n) */ # signal(n, label); /* goto label on signal(n) */ # returns old label, only one level. .set signal,48 .globl _signal .globl cerror .align 1 _signal: .word 0x0000 chmk $signal bcc noerror jmp cerror noerror: ret 0)+ # sp movl 16(fp),(r0) # pc clrl r0 /,5, /,"libc/sys/stat.s 444 0 33 356 2451005274 6702 # @(#)stat.s 4.1 (Berkeley) 12/21/80 # C library -- stat # error = stat(string, statbuf); # char statbuf[36] .set stat,18 .globl _stat .globl cerror _stat: .word 0x0000 chmk $stat bcc noerror jmp cerror noerror: clrl r0 ret . .set signal,48 .globl _signal .globl cerror .align 1 _signal: .word 0x0000 chmk $signal bcc noerror jmp cerror noerror: ret 0)+ # sp movl 16(fp),(r0) # pc clrl r0 /,5< /,"libc/sys/stime.s 444 0 33 316 2451005275 7045 # @(#)stime.s 4.1 (Berkeley) 12/21/80 .set stime,25 .globl _stime .globl cerror _stime: .word 0x0000 movl *4(ap),4(ap) # copy time to set chmk $stime bcc noerror jmp cerror noerror: clrl r0 ret cerror noerror: clrl r0 ret . .set signal,48 .globl _signal .globl cerror .align 1 _signal: .word 0x0000 chmk $signal bcc noerror jmp cerror noerror: ret 0)+ # sp movl 16(fp),(r0) # pc clrl r0 /,5L /,"libc/sys/sync.s 444 0 33 147 2451005275 6702 # @(#)sync.s 4.1 (Berkeley) 12/21/80 .set sync,36 .globl _sync _sync: .word 0x0000 chmk $sync ret 0 movl *4(ap),4(ap) # copy time to set chmk $stime bcc noerror jmp cerror noerror: clrl r0 ret cerror noerror: clrl r0 ret . .set signal,48 .globl _signal .globl cerror .align 1 _signal: .word 0x0000 chmk $signal bcc noerror jmp cerror noerror: ret 0)+ # sp movl 16(fp),(r0) # pc clrl r0 /,5\ /,"libc/sys/syscall.s 444 0 33 337 2451005276 7402 # @(#)syscall.s 4.1 (Berkeley) 12/21/80 .globl _syscall .globl cerror _syscall: .word 0x0000 movl 4(ap),r0 # syscall number subl3 $1,(ap)+,(ap) # one fewer arguments chmk r0 # do it bcs L1 ret L1: jmp cerror clrl r0 ret . .set signal,48 .globl _signal .globl cerror .align 1 _signal: .word 0x0000 chmk $signal bcc noerror jmp cerror noerror: ret 0)+ # sp movl 16(fp),(r0) # pc clrl r0 /,5l /,"((libc/sys/time.s 444 0 33 431 2451005276 6661 # @(#)time.s 4.1 (Berkeley) 12/21/80 # C library -- time # tvec = time(tvec); # .set time,13 .globl _time _time: .word 0x0000 chmk $time movl 4(ap),r1 beql nostore movl r0,(r1) nostore: ret # ftime # .set ftime,35 .globl _ftime _ftime: .word 0x0000 chmk $ftime ret error .align 1 _signal: .word 0x0000 chmk $signal bcc noerror jmp cerror noerror: ret 0)+ # sp movl 16(fp),(r0) # pc clrl r0 /,5| /,"libc/sys/times.s 444 0 33 202 2451005277 7041 # @(#)times.s 4.1 (Berkeley) 12/21/80 # C library -- times .set times,43 .globl _times _times: .word 0x0000 chmk $times ret chmk $time movl 4(ap),r1 beql nostore movl r0,(r1) nostore: ret # ftime # .set ftime,35 .globl _ftime _ftime: .word 0x0000 chmk $ftime ret error .align 1 _signal: .word 0x0000 chmk $signal bcc noerror jmp cerror noerror: ret 0)+ # sp movl 16(fp),(r0) # pc clrl r0 /,5 /,"libc/sys/umask.s 444 0 33 316 2451005277 7046 # @(#)umask.s 4.1 (Berkeley) 12/21/80 # C library -- umask # omask = umask(mode); .set umask,60 .globl _umask .globl cerror _umask: .word 0x0000 chmk $umask bcc noerror jmp cerror noerror: ret me # .set ftime,35 .globl _ftime _ftime: .word 0x0000 chmk $ftime ret error .align 1 _signal: .word 0x0000 chmk $signal bcc noerror jmp cerror noerror: ret 0)+ # sp movl 16(fp),(r0) # pc clrl r0 /,5 /,"libc/sys/umount.s 444 0 33 323 2451005300 7236 # @(#)umount.s 4.1 (Berkeley) 12/21/80 # C library -- umount/ .set umount,22 .globl _umount .globl cerror .comm _errno,4 _umount: .word 0x0000 chmk $umount bcc noerror jmp cerror noerror: clrl r0 ret .set ftime,35 .globl _ftime _ftime: .word 0x0000 chmk $ftime ret error .align 1 _signal: .word 0x0000 chmk $signal bcc noerror jmp cerror noerror: ret 0)+ # sp movl 16(fp),(r0) # pc clrl r0 /,5 /,"libc/sys/unlink.s 444 0 33 341 2451005300 7207 # @(#)unlink.s 4.1 (Berkeley) 12/21/80 # C library -- unlink # error = unlink(string); # .set unlink,10 .globl _unlink .globl cerror _unlink: .word 0x0000 chmk $unlink bcc noerror jmp cerror noerror: clrl r0 ret .globl _ftime _ftime: .word 0x0000 chmk $ftime ret error .align 1 _signal: .word 0x0000 chmk $signal bcc noerror jmp cerror noerror: ret 0)+ # sp movl 16(fp),(r0) # pc clrl r0 /,5 /,"libc/sys/utime.s 444 0 33 326 2451005301 7036 # @(#)utime.s 4.1 (Berkeley) 12/21/80 # C library -- utime # error = utime(string,timev); .globl _utime .globl cerror .set utime,30 _utime: .word 0x0000 chmk $utime bcc noerror jmp cerror noerror: ret rl r0 ret .globl _ftime _ftime: .word 0x0000 chmk $ftime ret error .align 1 _signal: .word 0x0000 chmk $signal bcc noerror jmp cerror noerror: ret 0)+ # sp movl 16(fp),(r0) # pc clrl r0 /,5̊ /,"libc/sys/vadvise.s 444 0 33 327 2451005302 7356 # @(#)vadvise.s 4.1 (Berkeley) 12/21/80 # C library -- vadvise # error = vadvise(how); .set vadvise,64+8 .globl _vadvise _vadvise: .word 0x0000 chmk $vadvise bcc noerror jmp cerror noerror: clrl r0 ret l r0 ret .globl _ftime _ftime: .word 0x0000 chmk $ftime ret error .align 1 _signal: .word 0x0000 chmk $signal bcc noerror jmp cerror noerror: ret 0)+ # sp movl 16(fp),(r0) # pc clrl r0 /,5܊ /,"libc/sys/vfork.s 444 0 33 1336 2451005302 7065 # @(#)vfork.s 4.1 (Berkeley) 12/21/80 # C library -- vfork # pid = vfork(); # # r1 == 0 in parent process, r1 == 1 in child process. # r0 == pid of child in parent, r0 == pid of parent in child. # # trickery here, due to keith sklower, uses ret to clear the stack, # and then returns with a jump indirect, since only one person can return # with a ret off this stack... we do the ret before we vfork! # .set vfork,66 .globl _vfork _vfork: .word 0x0000 movl 16(fp),r2 movab here,16(fp) ret here: chmk $vfork bcc vforkok jmp verror vforkok: tstl r1 # child process ? bneq child # yes bcc parent # if c-bit not set, fork ok .globl _errno verror: movl r0,_errno mnegl $1,r0 jmp (r2) child: clrl r0 parent: jmp (r2) keith sklower, uses ret to clear the stack, # and then returns with a jump indirect, since only one person can return # with a ret off this stack... we do the ret before we vfork! # .set vfork,66 .globl _vfork _vfork: .word 0x0000 movl 16(fp),r2 movab here,16(fp) ret here: chmk $vlibc/sys/vhangup.s 444 0 33 241 2451005303 7361 # @(#)vhangup.s 4.1 (Berkeley) 12/21/80 # vhangup -- revoke access to terminal .set vhangup,64+12 .globl _vhangup _vhangup: .word 0x0000 chmk $vhangup ret rno mnegl $1,r0 jmp (r2) child: clrl r0 parent: jmp (r2) keith sklower, uses ret to clear the stack, # and then returns with a jump indirect, since only one person can return # with a ret off this stack... we do the ret before we vfork! # .set vfork,66/,5 /,"libc/sys/vlimit.s 444 0 33 434 2451005303 7221 ((# @(#)vlimit.s 4.1 (Berkeley) 12/21/80 # C library -- vlimit # oldvalue = vlimit(what, newvalue); # if newvalue == -1 old value is returned and the limit is not changed .set vlimit,64+13 .globl _vlimit _vlimit: .word 0x0000 chmk $vlimit bcc noerror jmp cerror noerror: ret with a jump indirect, since only one person can return # with a ret off this stack... we do the ret before we vfork! # .set vfork,66/,5  /,"libc/sys/vread.s 444 0 33 417 2451005304 7020 # @(#)vread.s 4.1 (Berkeley) 12/21/80 # C library -- vread # nread = vread(file, buffer, count); # # nread ==0 means eof; nread == -1 means error .set vread,3+64 .globl _vread .globl cerror _vread: .word 0x0000 chmk $vread bcc noerror jmp cerror noerror: ret oerror: ret with a jump indirect, since only one person can return # with a ret off this stack... we do the ret before we vfork! # .set vfork,66/,5 /,"libc/sys/vtimes.s 444 0 33 212 2451005304 7217 # @(#)vtimes.s 4.1 (Berkeley) 12/21/80 # C library -- times .set vtimes,64+43 .globl _vtimes _vtimes: .word 0x0000 chmk $vtimes ret ns error .set vread,3+64 .globl _vread .globl cerror _vread: .word 0x0000 chmk $vread bcc noerror jmp cerror noerror: ret oerror: ret with a jump indirect, since only one person can return # with a ret off this stack... we do the ret before we vfork! # .set vfork,66/,5, /,"libc/sys/vwait.s 444 0 33 717 2451005305 7055 # @(#)vwait.s 4.1 (Berkeley) 12/21/80 # C library -- vwait # pid = vwait(0, &vms); # or, # pid = vwait(&status, &vms); # # pid == -1 if error # status indicates fate of process, if given # vms is a vmstat structure .set vwait,64+7 .globl _vwait .globl cerror .align 1 _vwait: .word 0x0000 chmk $vwait bcc noerror jmp cerror noerror: tstl 4(ap) # status desired? beql nostatus # no movl r1,*4(ap) # store child's status nostatus: ret  /,"libc/sys/vwrite.s 444 0 33 407 2451005305 7237 # @(#)vwrite.s 4.1 (Berkeley) 12/21/80 # C library -- vwrite # nwritten = vwrite(file, buffer, count); # # nwritten == -1 means error .set vwrite,4+64 .globl _vwrite .globl cerror _vwrite: .word 0x0000 chmk $vwrite bcc noerror jmp cerror noerror: ret lobl cerror .align 1 _vwait: .word 0x0000 chmk $vwait bcc noerror jmp cerror noerror: tstl 4(ap) # status desired? beql nostatus # no movl r1,*4/,5L /,"libc/sys/wait.s 444 0 33 621 2451005306 6662 # @(#)wait.s 4.1 (Berkeley) 12/21/80 # C library -- wait # pid = wait(0); # or, # pid = wait(&status); # # pid == -1 if error # status indicates fate of process, if given .set wait,7 .globl _wait .globl cerror .align 1 _wait: .word 0x0000 chmk $wait bcc noerror jmp cerror noerror: tstl 4(ap) # status desired? beql nostatus # no movl r1,*4(ap) # store child's status nostatus: ret us # no movl r1,*4/,5\ /,"libc/sys/write.s 444 0 33 375 2451005306 7056 # @(#)write.s 4.1 (Berkeley) 12/21/80 # C library -- write # nwritten = write(file, buffer, count); # # nwritten == -1 means error .set write,4 .globl _write .globl cerror _write: .word 0x0000 chmk $write bcc noerror jmp cerror noerror: ret $wait bcc noerror jmp cerror noerror: tstl 4(ap) # status desired? beql nostatus # no movl r1,*4(ap) # store child's status nostatus: ret us # no movl r1,*4/,5l /,"libc/sys/Makefile 644 0 33 1372 2451010314 7213 # %W% (Berkeley) %G% OBJS= _exit.o abort.o abs.o access.o acct.o alarm.o alloca.o \ cerror.o chdir.o chmod.o chown.o chroot.o close.o creat.o \ dup.o execl.o execle.o execv.o execve.o exit.o \ fabs.o fork.o fstat.o getcsw.o getgid.o getpid.o getuid.o \ ioctl.o itol.o kill.o link.o locv.o lseek.o ltod.o ltoi.o \ makdir.o mcount.o mdate.o mknod.o mount.o mpxcall.o \ nargs.o nexect.o nice.o open.o pipe.o prof.o ptrace.o \ read.o reset.o sbrk.o setgid.o setjmp.o setuid.o signal.o \ stat.o stime.o sync.o syscall.o time.o times.o \ umask.o umount.o unlink.o utime.o \ vadvise.o vfork.o vhangup.o vlimit.o vread.o vtimes.o \ vwait.o vwrite.o wait.o write.o .s.o: ${AS} -o $*.o $*.s -ld -x -r $*.o mv a.out $*.o all: ${OBJS} clean: rm -f ${OBJS} d.o \ ioctl.o itol.o kill.o link.o locv.o lseek.o ltod.o ltoi.o \ makdir.o mcount.o mdate.o mknod.o mount.o mpxcall.o \ nargs.o nexect.o nice.o open.o pipe.o prof.o ptrace.o \ read.o reset.o sbrk.o setgid.o setjmp.o setuid.o signal.o \ stat.o stime.o sync.olibc/Makefile 644 0 33 1216 2504307565 6412 DESTDIR= all: libc.a crtx libc.a: cd crt; make cd sys; make cd gen; make cd stdio; make ls crt/*.o gen/*.o sys/*.o stdio/*.o | sort -t/ +1 > t1 ar cr libc.a `lorder \`cat t1\` | tsort`; ar ma flsbuf.o libc.a exit.o rm -f t1 crtx: cd csu; make clean: for i in */.; do cd $$i; make clean; cd ..; done rm -f t1 *.o errlst.o: gen/errlst.c cc -S gen/errlst.c ed - t1 ar cr libc.a `lorder \`cat t1\` | tsort`; ar ma flsbuf.o libc.a exit.o rm -f t1 crtx: cd csu; make clean: for i in */.; do cd $$i; make clean; cd ..; done rm -f t1 *.o errlst.o: gen/errlst.c cc -S gen/errlst.c ed - link; if (p == 0) { incr = (n < MINSBRK/sizeof (int) ? MINSBRK/sizeof(int) : n); p = (struct element *) sbrk(incr * sizeof (int)); if ((int *)q + q->size == (int *)p) { q->size += incr; q = findpred(n); p = q->link; } else { p->link = 0; p->size = incr; q->link = p; } } if (p->size == n || p->size == n+1) q->link = p->link; else { x = (struct element *)(((int *) p) + n); x->size = p->size - n; p->size = n; q->link = x; x->link = p->link; } rover = q->link; if (rover == 0) rover = &avail; return ((char *)(&p->link)); } static struct element * findpred(n) unsigned n; { register struct element *p, *q, *q0; for (q = rover; p = (q->link); q = p) if (p->size >= n) return (q); q0 = q; if (rover != &avail) { q = &avail; for (;;) { p = q->link; if (p->size >= n) return (q); if (p == rover) break; q = p; } } return (q0); } free(px) char *px; { register struct element *p0, *p, *q; p0 = (struct element *)((int *)px - 1); q = p0 > rover ? rover : &avail; while ((p = q->link) && p <= p0) q = p; if ((int *)p0 < (int *)q + q->size) return; rover = q->link = p0; if ((int *)p && (int *)p == (int *)p0 + p0->size) { p0->size += p->size; p0->link = p->link; } else p0->link = p; if ((int *)p0 == (int *)q + q->size) { q->size += p0->size; q->link = p0->link; rover = q; } } char * realloc(px, size) char *px; register unsigned size; { register struct element *p0, *p, *next; struct element *q; unsigned n, p0size; p0 = (struct element *)((int *)px - 1); p0size = p0->size; free(px); n = (size + sizeof (int) - 1) / sizeof (int) + 1; if (n == 1) n = 2; q = findpred(n); p = q->link; if (p == 0) { q = 0; p = (struct element *)((int *)malloc(size) - 1); } next = p->link; if (p != p0) bcopy((char *)&p->link, (char *)&p0->link, p0size); if (q == 0) goto ret; if (p->size > n + 1) { q->link = (struct element *)((int *)p + n); q->link->link = next; q->link->size = p->size - n; p->size = n; } else q->link = next; ret: return ((char *)(&p->link)); } bcopy(to, from, size) register char *to, *from; register unsigned size; { if (size == 0) return; do *to++ = *from++; while (--size); } p = (struct element *)((int *)malloc(size) - 1); } next = p->link; if (p != p0) bcopy((char *)&p->link, (char *)&p0->link, p0silibc/sys/Makefile 644 0 33 1372 2451010314 7213 # %W% (Berkeley) %G% OBJS= _exit.o abort.o abs.o access.o acct.o alarm.o alloca.o \ cerror.o chdir.o chmod.o chown.o chroot.o close.o creat.o \ dup.o execl.o execle.o execv.o execve.o exit.o \ fabs.o fork.o fstat.o getcsw.o getgid.o getpid.o getuid.o \ ioctl.o itol.o kill.o link.o locv.o lseek.o ltod.o ltoi.o \ makdir.o mcount.o mdate.o mknod.o mount.o mpxcall.o \ nargs.o nexect.o nice.o open.o pipe.o prof.o ptrace.o \ read.o reset.o sbrk.o setgid.o setjmp.o setuid.o signal.o \ stat.o stime.o sync.o syscall.o time.o times.o \ umask.o umount.o unlink.o utime.o \ vadvise.o vfork.o vhangup.o vlimit.o vread.o vtimes.o \ vwait.o vwrite.o wait.o write.o .s.o: ${AS} -o $*.o $*.s -ld -x -r $*.o mv a.out $*.o all: ${OBJS} clean: rm -f ${OBJS} d.o \ ioctl.o itol.o kill.o link.o locv.o lseek.o ltod.o ltoi.o \ makdir.o mcount.o mdate.o mknod.o mount.o mpxcall.o \ nargs.o nexect.o nice.o open.o pipe.o prof.o ptrace.o \ read.o reset.o sbrk.o setgid.o setjmp.o setuid.o signal.o \ stat.o stime.o sync.olibc/Makefile 644 0 33 1216 2504307565 6412 DESTDIR= all: libc.a crtx libc.a: cd crt; make cd sys; make cd gen; make cd stdio; make ls crt/*.o gen/*.o sys/*.o stdio/*.o | sort -t/ +1 > t1 ar cr libc.a `lorder \`cat t1\` | tsort`; ar ma flsbuf.o libc.a exit.o rm -f t1 crtx: cd csu; make clean: for i in */.; do cd $$i; make clean; cd ..; done rm -f t1 *.o errlst.o: gen/errlst.c cc -S gen/errlst.c ed - t1 ar cr libc.a `lorder \`cat t1\` | tsort`; ar ma flsbuf.o libc.a exit.o rm -f t1 crtx: cd csu; make clean: for i in */.; do cd $$i; make clean; cd ..; done rm -f t1 *.o errlst.o: gen/errlst.c cc -S gen/errlst.c ed - 1P?rp1Э1P*1P2QQPP=P˴PP{PL1PW1Pl1Pm$Pw1R1({P1  OP&PPP P 2PPP?ЭP1sЭP1d/諾1R JPPPzS}p?P e\SNFA502G$PPPP22~{P2~P|ﵜЭÜi}2~靖]1F >r~[qJ}2~_D]2~2~߭\ &Э6?+7r2~~EPZR2~|72~2~߭ ;P 1.Э,1;izPPd|2~nS\2~2~ 0xP'zPPb 1| P~JP/2P t2Pt2P~2~Bg1~nPP2Pʚ@0j1{R{]P @:2w<P+=aC{ Q{96,P;1%լ1,,J &PP^ݬ2PhP%1P&1P)1P*1P+P-%P|11~~ﭙ蓮1P#1y~uݭPd~tĭN~^:3~CҭPP1q~)ȭ1Z ̘2PP#1P(1P*(P-YP@@P~`ݬ~PzP~~xTO~_;6~F"PP)1Hӗ1r^ P1[y.1烙ޖŗvwﴗﰗ/Wݏ~nPG~PwЭ_ ~cP /.Э* 4P^ЭG 1VP["m-Ы#іȖΖ͖ᅱPz1~ Pet^ ]P14x.‘+x"16A12,~ P)w2PP~w+ԑw^w<u P~DP7 нӕ!ЭPt•2P@ ﰕP~PP.ڑ`w'bw1 xhc 5wP ,wPxPPPD P2PPլ 1~P ^vP@IP#1D@/ҔP2~wPP vPD@}{v.1Y nPvP @`1mPVRdPRvR(vP0PnPPVR`PRvRĘvP@~ xPP2QQPPu~P2QPQ }2PPГƓ1ux uX 1kutauTޑWuo MuOՔ2PPmPVRfPRvRЭ@u]PPN[[[t ;PܔP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ad variabletoo many breakpointsbad a68 framebad a68 linkaddress wrap aroundunexpected `='wait error: process disappeared!process terminatedtry againsyntax errornewline expectedbkpt: command too longbad file formatnot enough space for symbolsfilename too longcannot openbad core magic number$<< nesting too deep[Ï&[P PQPA҈ [k ^Ь [愈Ь麗[[ K杻P@YidYZ((12PЏ@vp ,`jjPxPPPP#ݬ5VP9P1P@#2PxPPP2PP .:F[Rw1ݽc11fݽc1ݽc1ݽc1*ѭ41$ |ݬaP2PЭ@hoѭ4 BP2QPA@oec2P@)oAѭ41ݽ8c1jPP{:V1ݬPݬPݭ11ݬP1ݬPݬvPݭݽbl*iݬ1*Xݬ1*G12P2@?njPP jPP2P@pKb 2~CbgZ2PQPQ1l[[ [11 2PmP~a ݬ2PP2QQP~PTPaOQrP~?2PPHm1m=m8mPPP~^ԭ[&ݬPPK؄[[ЬP@`PPP ЬP@`ЭP^ЬЬ p~`^ЬЬWIޭPЭQέRA`PxRPPP[PPPPP[ 0[~W[~,խ׭խ@(#)optab.c 4.1 5/14/815!5o !5O !5 !5= !5X 6 66` 6a 6@ !6A '6 -6 36  @ @96! @ @ @?6 E6 K6 P6  W6  ^6x c6 @ @h6y m6  q6  v6  |6  6  6  6  6  6 6 6 6 6 6 6 6 666 6 6 6 6 666 6 7 7 7 77 7 #7 (7 -7 27 87 =7 C7 H7 N7R7 V71!Z7 _70!d7 h7 l7@@r7 @x7~7 7 7 7 7 7 77|777|777) @@7- @ @7q 7Q 7 75 @@77 @ @7  7 7  7 @ @7l8L888h 8v  8j &8i ,8H 28V 88J >8I D8 J8n P8N V8 @\8 b86 @h8& @@ @n8$ @@ @t8 @ @z8k 8K 8  @ @83 8m 8M 82 888888f 8g 8F 8G 8 8 8' @ @ @8 8 88 @@@8{ 9t  9T  9z 9 9 9 "9 &9+90959:9  @9@@G9 L9@P9@T9[9: @`99 @ @g9m9 s9 y9 ~99r 9R 9 9 9@9~E9D9B9~C9>A99( @@9, @ @9p 9P 9 94 @@99} 9. @@ @9/ @@ @9 : ::< : :#:):d /:e 5:D ;:E A: G: M:% @ @ @R: X: ^:b:u @h:U @n: s:  @z:  @:@:E:D:B:C:?A: : ::@:: :: :* @@:; @: : :+ @@:::b ;c  ;B ;C ; ; #;" @ @);# @ @ @/; 5; ;;B;G;s L;S Q; V; [;(_;e;k; q; w; }; ;;;;;;;;;;;;;;;;;;;;;;;<<<<<#<)<0<6<<<B<E<J<O<V<[<a<f<k<o<w<|<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<=== ===="='=.=4=;=?=E=J=P=T=Z=_=e=i=n=r=w={=============================>> >>>>>$>)>.>3>8>>>D>J>M>acbbacbdacbfacblacbwadawiaddb2addb3addd2addd3addf2addf3addl2addl3addp4addp6addw2addw3adwcaobleqaoblssashlashpashqbbcbbccbbccibbcsbbsbbscbbssbbssibccbcsbeqlbeqlubgeqbgequbgtrbgtrubicb2bicb3bicl2bicl3bicpswbicw2bicw3bisb2bisb3bisl2bisl3bispswbisw2bisw3bitbbitlbitwblbsblbcbleqblequblssblssubneqbnequbptbrbbrwbsbbbsbwbvcbvscallgcallscasebcaselcasewchmechmkchmschmuclrbclrdclrfclrlclrqclrwcmpbcmpc3cmpc5cmpdcmpfcmplcmpp3cmpp4cmpvcmpwcmpzvcrccvtbdcvtbfcvtblcvtbwcvtdbcvtdfcvtdlcvtdwcvtfbcvtfdcvtflcvtfwcvtlbcvtldcvtlfcvtlpcvtlwcvtplcvttpcvtptcvtpscvtrdlcvtrflcvtspcvtwbcvtwdcvtwfcvtwldecbdecldecwdivb2divb3divd2divd3divf2divf3divl2divl3divpdivw2divw3editpcedivemoddemodfemulextvextzvffcffshaltincbinclincwindexinsqueinsvjmpjsbldpctxloccmatchcmcombmcomlmcomwmfprmnegbmnegdmnegfmneglmnegwmovabmovadmovafmovalmovaqmovawmovbmovc3movc5movdmovfmovlmovpmovpslmovqmovtcmovtucmovwmovzblmovzbwmovzwlmtprmulb2mulb3muld2muld3mulf2mulf3mull2mull3mulpmulw2mulw3noppolydpolyfpoprproberprobewpushabpushadpushafpushalpushaqpushawpushlpushrreiremqueretrotlrsbsbwcscancskpcsobgeqsobgtrspancsubb2subb3subd2subd3subf2subf3subl2subl3subp4subp6subw2subw3svpctxtstbtstdtstftstltstwxfcxorb2xorb3xorl2xorl3xorw2xorw3escdesceescfindirexitforkreadwriteopenclosewaitcreatlinkunlinkexecchdirtimemknodchmodchownbreakstatseekgetpidmountumountsetuidgetuidstimeptracealarmfstatpause30sttygttyaccessnicesleepsynckillcswsetpgrptellduppipetimesprofiltiusetgidgetgidsignal495051525354555657585960616263r0r1r2r3r4r5r6r7r8r9r10r11apfpsppc0.50.56250.6250.68750.750.81250.8750.93751.01.1251.251.3751.51.6251.751.8752.02.252.52.753.03.253.53.754.04.55.05.56.06.57.07.58.09.010.011.012.013.014.015.016.018.020.022.024.026.028.030.032.036.040.044.048.052.056.060.064.072.080.088.096.0104.0112.0120.0%r%RЬ[ЬZjPP^Ь[2P^eZHTHPP 1oU2P@oP  * ֭ﵭ ֭֭ÏGP2QQP ֭Ï~Ho2G~@4oG1  GGÏGPP lGfG+ÏTG~n2?G~/@n4GÏ%GPG ^Ь\Э1~u1%쑽- l֭r߭EPꑽ.֭߭.PޭnЭн2PPԭ瘭P֭PD40jhjjjjjjj4jBj0jjJ$jjjjjjjjjTjhjjjjjjjjajj~1]1}2P1z ~2~1:@b7T u2QQPRQRRPR2QPRPPխ lޭݭP౭1{2PPࢭꑭr ' 2PPЭP֭`~2PP  2PPޭlЭP֭`1^\~"P[2P@kkk2P@kkkݬC~  ^Ь[9$2P PQQP0PPkPk`0k2P ^ޭPP["Ѭd2PPPP-kkPP ޭP[PPLݬ ~8Pݬ ~y;3{ 0PWPQPQQjjޭP[P^Ь(խέPP-j  +ujojPޭQ2RPBax ފ ޭP2QA`붭ޭP2QA`P0PP jj^ޭ[ˏPP-άݬѬ  APAPP[,ޭ[iPi`iլSd;2d~6d%xiP xiP 6vioi1լbd2d~Y6BIi x2iP2cd xiPL i?dU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 [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPI8@j~\S^\wP[ЬPЬPЬRRQ{RPPR PRPPլQP$P@(#)crt0.c 4.3 (Berkeley) 1/13/82@(#)access.c 4.5 2/2/82not in write modeaddress out of segmentbad p0br or p1br in pcbpage table botchpage not valid/reclaimabledata address not foundtext address not found@(#)command.c 4.3 5/15/81zX"= "^i=:%16t=%8t:%16tadb @(#)expr.c 4.3 5/15/81@(#)format.c 4.1 5/14/81 %s:%16tx%16m%T%M:%16t%16t%-8u%-16U%-8o%-8r%-8r%-16R%-8x%-16X%-24Y%-8q%-16Q%-8o%-16O%-8d%-16D%-16.9f%-32.18FSHELL/bin/shsh-c!^?^%c@(#)input.c 4.1 5/14/81 @(#)main.c 4.2 5/15/81PH-w-k%s adb /usr/lib/adb@(#)opset.c 4.1 5/14/81%s%8t[%s]%s(%s)-(%s)(%s)+(%s)$%s$%r %R: %f@(#)output.c 4.2 2/2/82%+.16e%s%X%D @(#)pcs.c 4.1 5/14/81%d: killedbreakpoint%16tstopped at%16t@(#)print.c 4.5 2/2/82\أXԣTУP̣Ċ|Ȋ̊ЊȣԊģ׊ۊފ2<@DW^huʋ܋*8GQ[eoyь?Wm/not debugging kernel must have 2 <= radix <= 16radix=%d base tenvariables = %Q ? map/ mappcs id = %d no process sigtrampstart?%s(%R) from %X %8t%s:%10t? %R %s:%12t%R No algol 68 on VAXbreakpoints count%8tbkpt%24tcommand %-8.8d%24t%s%12t`%s' -b1 = %-16Re1 = %-16Rf1 = %-16R b2 = %-16Re2 = %-16Rf2 = %-16R%s%6t%R %16t:%16t () ()p1lrp1brp0lrp0brkspespssppslpcuspfpapr11r10r9r8r7r6r5r4r3r2r1r0hangupinterruptquitillegal instructiontrace/BPTIOTEMTfloating exceptionkilledbus errormemory faultbad system callbroken pipealarm callterminatedsignal 16stop (signal)stop (tty)continue (signal)child terminationstop (tty input)stop (tty output)input available (signal)cpu timelimitfile sizelimitsignal 26signal 27signal 28signal 29signal 30signal 31reserved addressing faultpriviliged instruction faultreserved operand faultinteger overflow trapinteger divide by zero trapfloating overflow trapfloating/decimal divide by zero trapfloating underflow trapdecimal overflow trapsubscript out of range trapfloating overflow faultfloating divide by zero faultfloating undeflow fault%Z%%M% %I% %G%%s: running %s: cannot execute %s: cannot open %s: cannot create cannot set breakpoint: - core dumped@(#)setup.c 4.6 82/02/13x~Error reading symbol|string table Not enough space for symbol|string table Old format a.out - no string table _Sysmap_Syssizesbr %X slr %X _masterpaddrcorefile not from this programp0br %X p0lr %X p1br %X p1lr %X -cannot open `%s' a.outcore@(#)sym.c 4.1 5/14/81%R%s+%R%s+%RM:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDecUnknown error: >  AAAAAABBBBBB TTLbin/login 4755 0 12 40000 2552577270 5707 0 ((^Юn PPՀPpPP/ P'^ԭ<<ݏݏ}tB*ݏt3*g8*#]8@X8Q8)0ݏt*0ݏut)ݭ)4(PPϜ0ԭ߭ݏtϷ)ԭω07ѬЬPݠ7Ԭ7^7[W0"N6L6PG6`P :6aPP P _ѭy&[9ϝe7dPg7ϭ.^7ϵ/Q7Pݠ 0'P߭ݏt(,7PDݏw7PݠϨ/ϚPP[U6Pݠ[&P6Pՠrw/ϼ-7P#]W5U5PP5` B5ݭϊ#׽ЭPРQ֠aPݭ9PP5ώ$=V%խJ]6Pՠ@~P2..ϨPP~.ݭݭϱ$խF.aЭPd2..]PP5~.ݭϨݭb$5P . ϸ5Pݠ kPϧ5PݠP5խ0϶.ϴPϫ.ϫ.l5P.խ1?U5ϼK$PPOϠ.X&P>~ݭ/ݭ$P~44ݭd)ݭ%խ2V.&P!P/Ͻ4ݭ-)ݭϝ%ԭϴ+Pխ1+ϴ%Pό4P ~ݭ ߭ݭϝ%P խ߭߭ϾP-ϥG4P ~ݭϑ߭ϙ/ݭ#P~߭ ߭ݭp(ݭ$4Pݠ ݠݭ)3Pݠ ϔ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cc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~=PYjt~P  BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[71xݏ PZZ  YYX ZYYXZYZ~lPY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP [ [[[6 Ь[Z = 8[ePZ~PZ ݫ_ ԫ(( kZP{P[P[P[P/[PZ[ZZPXYX/P[Y[ZuPX\YPXO![[ݬP1yk  k~!P[tJ[ Ь[Zk[ZZP Ь[ЬZkPkPzQQP^ݬPP߭ݬP6.&@80( 91)! ;3+# =5-% ?7/'(08@ '/7?&.6>%- 5=$, 4<#+ 3;"* 2:!) 1991)! :2*" ;3+# <4,$?7/'>6.&=5-%      )4%/7(3-!0,1'8"5.*2$                                                                                                                                     M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/bin/shPATH:/bin:/usr/binsh/dev/ttyr%s /etc/passwdrrUnknown error: #(=(=8/etc/ttys/dev/Jbin/ps 755 0 12 50000 2552577274 5202 @ e^Юn PPՀPpPP? P8^@.P@&8P\\G-׬լ1ЬP`Y11PC1i\11PSV\1u10Pcw[PPPg[1Nb[1E][1<iYk[=[C[Y[?L[iY[3[12[1PaZ1PeP@jEYY PZiZZ1Pg1VPkZ1PsZvPt1.PuZWPPl1hZ@Pv1&Px1v1JPwZP1 ZiݬݬAݬݬ>P=P=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ѭԏ ݭ!Pѭԏ 2P PPPPPЭYY12XYXYXݭݭݭX[PWXXYZ Xj1yj~ݭݭ~Ь[EW GG4WGG%ЪVݭ1 [kP` Z1nЬ[\#XX$PX 鑫+PPPYkw+ݏݬPZY1ZZkalYPPPݬPZ<︄3ݏݬ}PZYZZ]ݬPZZ)Z YPPPݬTPZZ1hZY kr  XP` ^ЬP ЬP 1Ѭ sՠn iмZЬլ ~PPZPPZЬP )Z%ѭZPQáPѭPQP­P[[ЬP PQРЬP ݬ [~ЬP~qPԼ[h׼ ЬP֠ZݬzNЬP BPЬP ԼЬP ЬPPQРݬ ݬЬP~PѭPP D [L ﴂP@X[ݬUPZZݬ [(P[''''''''( (0(<(N(^(p(|(((((((()))):)I)X)p)})))))Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large\~ݬPPЬЬ ~Ŭ PP~ݬ^]YìPPPYxY~ݭ PPYЭЬ[YZ+Yݭ[ݭ[PPhY[[]ZYݭKZYݭ[YЭ[/ZݭPP[Z[pYZYZZ[>ìPíQPQݬY~Э1ݭݬY1[YݭZ2YЭZ14 ^Ь[ЬZkj׭^Ь[ЬZЬ Ykij׭^Ь[ЬZԭլ05Ьj ЪP֪`P ZPYY׭֭ѭ ЭP^Ь[ЬZԭլ.3ЬYj ЪP֪` Z~ Y ֭ѭ ЭPЬ[[ ~kЫ0   Ь[  P ݏ) P ի ߘP@ﲄ [lG   P2PPݫ~5 PkЫk!k    k1WP֫pPPR RR RP|PpPrPP"{Ь[ի ݫ Ь ЫkЬ[ЬZЬ YY kPYP kPzQQP Ь[ZZZPЬ[ЬZЬ Y[X[Y{XPЬ[ЬZ[XY YY  YXP  !"#$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dev/devproc table swapper pagedaemon ip input %.*s error reading kmem at %x kmem/vmcorememdrum/vmunix%s: No namelist nswapmaxslpccpuecmxno room for text table text tableps: specify only one of s,l,v and u SSIZ %s COMMAND ps: error reading %s from %s.rCan't open . in /dev consoledrumfloppynullttyd0??ps: cant read u for pid %d from %s ps: cant read indir pte to get u for pid %d from %s ps: cant read page table for u of pid %d from %s ps: cant read page %d of u of pid %d from %s ()ps: error locating command name for pid %d ()%6x%4d%6u%6u%3d%4d%3d%5x%4d%5d %5x %4.4s %-2.2s%3ld:%02ld%-8.8s %5d%5.1f%5.1f%5d%5d %4.4s%5u %4.4s%3d%3d%7d%5d%5d xx%5d%5d%4d%5.1f%5.1f%4d %5u %4.4svstodbvstodb *ipps: ran out of memory @(#)ps.c 4.13 (Berkeley) 81/07/08_proc_Usrptmap_usrpt_text_nswap_maxslp_ccpu_ecmx_nproc_ntext_hz F UID PID PPID CP PRI NI ADDR SZ RSS WCHAN STAT TT TIMEUSER PID %CPU %MEM SZ RSS TT STAT TIME PID TT STAT TIME SL RE PAGEIN SIZE RSS LIM TSIZ TRS %CPU %MEMSSIZ PID TT STAT TIME1@rzA]ݬ5@3elB#"3h@?ØGe@lB,k$d!r@AA@@@JGSrCu%طK@0qi9IE4Ÿ@;\)@3fG@@@@@@@A@@A/etc/passwdrrrUnknown error: #  AAAAAABBBBBB TTHbin/sh 755 0 12 45700 2532143215 5163  C( ^Юn PPՀPpPPCPP?^ЬZѬ1-Ъ[ʏLkÏDYP@CwLUCYikYikiёkc"ѬFLЪKj5K.KjZPZYjZZYЭP֭P[ II=IIIPP[IZIjZI[=A[6A,A#APPAJA AA@bS@@[[G,P>I[G[PP%IЬ[ [@{P  +P[ kЬԫ^[Pլլ  *P[ЬkЬЬ Ь[ݬPZH ";H Z xHPP&P;9PU[ [9ZPZZݏp0PZ~[fPYYZ,PZ[  ݬTP[[PG&PPPZ G|P[ZP PPG [8+ݏ P[1qG^dG|1cPݏ2P[ݏ!P> Ь[G[P  )PZ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1ݬݫ߭߭ݬ ݫPݬ߭ݬݫ1ݭݭ1ݫrݬݫe1ݫVP1ݫCP1ݫPԭի 7P6*"ݫ RPeP`Э6 3ЭP`ݭݫսݭbP1ԭGݫMPPPѭQQPQ&ݫ$PZRLLD>1/Э1<ݫP1[ݬݫ 1XݫPXЫ[[1kխD~PWPXPWWXPݫa[[н^߭լݬЬլ ݬ] P PtQPQPP@)7*(ЬRPQbPЬP}V}X}Z}Э`PЬPЬQ}V}X}Z}\Ё^PP;0+QPlP^߭ݬTPPP<,Pݬݏ tݬݬݏtݬ6< PЬPЬRRQ{RPRPPPRRP ~\S^\w P [Ь PЬPЬRRQ{RPPR PRPPլQP P^Ь[    PPYYX1XX߭~PYj ~:P   BЫZ֫ZPѫPѬ ZPPXPZ~=PYZkn 1mЫZ3[LK1xݏWPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~hPY PP[ [[[  Ь[Z = 8[ePZ~PZ ݫs ԫ kZPxnvtsierku Vnewline @ "2@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@//tmp/sh-M VERSION sys137 DATE 1978 Nov 6 14:29:22 bad option(s)you have mail no spacesyntax errorbad numberparameter not setbad substitutioncannot createillegal iorestrictedcannot make pipecannot open - core dumpedarg list too longtext busytoo bigcannot executenot foundbad file numbercannot shiftbad directorybad trapis read onlyis not an identifierPATHHOMEMAILFILEMATCHIFSPS1PS2 :/bin:/usr/bin: -end of file unexpected at line /dev/null+ > $ # .profile(I +I"0I5I9I!>IAIGIJI$OITIYI\IbIdI(fImIrIIIIIIIIIIIIexportreadonlyJ JJJJJ!J&J +J -JtH lH4J:J @J IJOJTJYJ_Jinesaccasefordoneifwhiledothenelseeliffiuntil{}HangupQuitIllegal instructionTrace/BPT trapIOT trapEMT trapFloating exceptionKilledBus errorMemory faultBad system callAlarm callTerminatedSignal 16cdreadset:traploginwaiteval.newgrpchdirbreakc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Pf kPˏ@PP"PPݫЫ[Ь[k8ݬݫЫ[ѬF Ѭd[Zм[[PPRv1P;1F1xP11`P1VP1 ݬ@լݏIݬݏQլ 15ݏIݬ լ1P1լÏP[P@Aм[Ь  ЬPѰ1РPՠЬPРPРP`[PPP 111111w1[YQPPPPP[ЬPаP@ ЬPݠ` ЬPݠPݏIݬ[= ЬPݠ,ݏIݬ ЬPݠЬPЬ ݬլ ݏIݬ ^ݬ5լ  #Ь PPZZݏЬPݠݬ ݬЬPݠլ  Z#aլ #ЬPPZݏZЬPݠݬ ݬЬPݠլݬݬ ЬPݠЬPݠaݬ ݬЬPݠoլ  #Ь PPYլ "ЬPPX"PZPݏЬPݠ$YXЬPРPݠZ"ݬ ݬЬPРPݠլ X"լ  Y"ЬPa1ЬPѠ1ѠՠРP`լ1ݏIݬլ 1ݏIݬ 1{PPP1P1p1PP1PL11PQ11{PV1&PT PS1VPU11GPX1 PW1-PY1f1PP  g8м {YѬЬP׬P [XмP@MݬEXмPPdP_P^?P_MPb]PcTPdKPfBhvX1ЬPРP@ڞ:֞OXݬ (ЬPݠ︞/XЬPݠﭞX爵XЬPݠH:WЬPѠ 1_ yyWЬPˏP@`^WЬPݠ MW^Ь[k 1>Ыѽ^ЭPРРYРX1ѽѽЭPРWРVѽfW( PYJ[TPV PZ1ZYW[3PW PZZYV[d V PYѽ ѽ1fg^yݦ PjЦѽέPPЧYЦXh ѽhЧXXݭYݫTP_kYЭXݭ7ݬ8 ݬ7[ށȞVUݬݬﺞU^PxPPPP PPxPﳖUխ%ѭ@ ݭr ݭwxUzxeU[_kVݫY;UЬPPB%PDPFPL PW ~T[kЬP@WL4ЬPРPP  $ PPPP ЬPР[ЬPРZ[[PPZZQQPQPPЬPРPP bZRRJ<bZRRЬPˏPPLWѬѬPPPP Ь[kZZ ЫP`dPZ^ЫPZZѻ^ѻ ЫPРPZ_.ѫ$ѫѫˏPP PZNѻ^ЫPPZ ѻ^ЫPPZ DѻN:ЫPѰ^,ѫѫˏP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#LP#\#v##&L&LL #  ##  ' &  8&  D& S&  l&  @ N@NO@N:@:b@bg@g @ @L;@;n@n@ @ @aaaaaaaa cvtZLl AL,A1 movzZLl AL,A1 cvtZLd AL,A1 movzZLl AL,A1 cvtld A1,A1 cvtZLZF AL,A1 movzZRl AL,A1 movzZRl AL,A1 cvtZRl AL,A1 cvtZRl AL,A1 .long CL .word CL .byte CL jbr CL jmp *AL jmp (AL) ZS subl2 ZT,sp ZSZSZS movl AR,A1 pushl AR ZS movl (sp)+,AR extv $H,$S,AR,A1 extzv $H,$S,AR,A1 extv $H,$S,AR,-(sp) extzv $H,$S,AR,-(sp) cmpl AL,AR ZP cmpw AL,AR ZP cmpb AL,AR ZP cmpw AL,AR ZP cmpb AL,AR ZP cmpd AL,AR ZP cvtfd AR,A1 cmpd AL,A1 ZP cvtfd AL,A1 cmpd A1,AR ZP cmpf AL,AR ZP movl $1,A1 ZN calls ZC,CL calls ZC,(AL) calls ZC,*AL calls ZC,*AL extzv AR,ZU,AL,AL subl3 AR,$32,A1 extzv AR,A1,AL,AL subl3 AR,$32,A1 extzv AR,A1,AL,AL extzv AR,ZU,AL,A1 ashl AR,AL,AL ashl AR,AL,AL ZB AR,A1 ashl A1,AL,AL ashl AR,AL,A1 ashl AR,AL,A1 ZB AR,A1 ashl A1,AL,A1 ZE ZE ZE ZE ZD ZD ZD ZD ZA insv AR,$H,$S,AL extv $H,$S,AR,AL extzv $H,$S,AR,AL HELP HELP HELP movd AR,A1 movZF AR,A1 ZA ZA tstZR AR pushl AR cvtZRl AR,-(sp) movzZRl AR,-(sp) movd AR,-(sp) cvtfd AR,-(sp) mnegZL AL,A1 mcomZL AL,A1 cvtZLl AL,A1 mcoml A1,A1 bitl ZZ,AL bitw ZZ,AL bitb ZZ,AL bicl2 AR,AL OL2 AR,AL OL2 AR,AL OL3 AR,AL,A1 divl3 AR,AL,A1 mull2 AR,A1 subl2 A1,AL divl3 AR,AL,A1 mull2 AR,A1 subl3 A1,AL,A1 incZL AL incZL AL incZL AL cvtZLl AL,AL incZL AL movzZLl AL,AL decZL AL decZL AL decZL AL cvtZLl AL,AL decZL AL movzZLl AL,AL incZL AL incZL AL cvtZLl AL,AL incZL AL movzZLl AL,AL decZL AL decZL AL cvtZLl AL,AL decZL AL movzZLl AL,AL OL2 AR,AL OL2 AR,AL OW2 AR,AL OW2 AR,AL OB2 AR,AL OB2 AR,AL OW2 AR,AL cvtZLl AL,AL OW2 AR,AL movzZLl AL,AL OB2 AR,AL cvtZLl AL,AL OB2 AR,AL movzZLl AL,AL OL2 AR,AL OL3 AR,AL,A1 OD2 AR,AL OF2 AR,AL cvtfd AR,A1 OD2 A1,AL cvtfd AL,A1 OD2 AR,A1 cvtdf A1,AL OD2 AR,AL OD3 AR,AL,A1 cvtfd AL,A1 OD2 AR,A1 cvtfd AR,A1 OD3 A1,AL,A1 OF3 AR,AL,A1 cvtfd A1,A1 help; I'm in trouble ĬݬP[P[Z~PYԊY[PݬЬ[Ь Z+PPPXZkw+ݏݬPYX1YYkalXPPPݬ"PY<\3ݏݬPYXYYݬPYY)YXPPPݬPYYPjYX(( kr  ZPݬ \~ݬ+ЬP PPFVSVVVUUЏUUdЏdU}PP1RU#Q yPPRyPVVPWQRU=;Q yPPRyPPRQQVW{VQWPVW{ VPVPPVPRUQyPPRyPPPPnPVnQPdP`VPSrPPRpP~Ь[  P ݏ- P ի ߘP@e [U>U +U  P2PPݫ~% PkЫk!k    k1WP֫pPPR RR RP|PpTPrPP" YЬ[ի ݫ Ь Ыk Ь[ZZZPЬ[ЬZ[XY YY  YXPx^BЬ2߭ \~ݬ׭ ЭP֭` ߭rЬP  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭W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VYWXPNORQvwy{RQ}STszux STVYWXPNOVYWXPNORQ RQSTVYWXSTLVYWXPNOVYWXRQPNORQSTRQSTVYWXPSNTOvwy{RQ|}~szuxvSwy{|}~szuxvwy{|}szuxnRKHk}*}r(\>zG.pGGGGGm:P}*}!GGaT.G!GGGGG5G($_:'GGGlGGMGGGm5UGG G &GG/jGGGG|dtGGF9 [R} {x/v$)us:olkfe d\ZVOH ##%%&&&"""( ))++ ,,..'/' 000233111115566**--447!!89:$$$$$$$$$$$$$$$$$;;;<  "!#19 2!449826326:2!373338374 0298:4778 :46 223258599::::::::8332 8395)*$%9&+,-(/.((57363599999522229573'+399972233933399bad bdtydimension table overflowwhiles, fors, etc. too deeply nestednon-constant case expressioncase not in switchswitch table overflowduplicate default in switchdefault not inside switchswitch table overflowduplicate case in switch, %dyacc stack overflowsyntax errorfunction level error$%dFAKEstructure typed union member must be namedfield outside of structureillegal field sizefield outside of structurezero or negative subscriptfunction declaration in bad contextold-fashioned initialization: use =nesting too deepillegal breakillegal continuestatement not reachedvoid function %s cannot return valueloop not entered at toploop not entered at toploop not entered at topprecedence confusion possible: parenthesize!old-fashioned assignment operator& before array or function: ignoredstructure reference must be addressableundeclared initializer name %s\+vo+u+z+++++++++++++++++FIELD[%d]%W% (Berkeley) %G%SNULLAUTOEXTERNSTATICREGISTEREXTDEFLABELULABELMOSPARAMSTNAMEMOUUNAMETYPEDEFFORTRANENAMEMOEUFORTRANUSTATIC 1@_0  "'`(2)3{4}5[6]7* ?:+ - /<%>&|^! L~M,88;9. D< S>U= ::3171<1)B1G1/L1*U1\1.d1,g1n1's11x1-|111%1&111$11(110111 1111+1PCC/364r1 vax uts3.0Release: %s rwccom:can't open %s abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$01234567890123456789abcdefABCDEF  01234567abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$123456789  unexpected EOFnewline in string or char constantnon-null byte ignored in string initializerempty character constanttoo many characters in character constantunexpected EOFillegal character: %03o (octal)illegal hex constantnewline in BCD constantBCD constant exceeds 6 charactersgcos BCD constant illegalambiguous assignment: assignment op taken=<%c illegal=>%c illegalyylex error, character %03o (octal)out of switch in yylexbad asm constructionbad AR_?? action0,0,LL%d LL%d: Ran out of memory (savestr)ran out of memory (hash)ran out of hash tables%W% (Berkeley) %G%asmautobreakcharcasecontinuedoubledefaultdoexternelseenumforfloatfortrangotoifintlongreturnregisterswitchstructsizeofshortstatictypedefunsignedunionvoidwhile9defid calltyreducedefid( %s (%d), , %s, (%d,%d) ), level %d modified to , %s previous def'n: , %s, (%d,%d) ), level %d declared argument %s is missing previous class: %s redeclaration of: %sredeclaration of %s new entry made void type for %s dimoff, sizoff, offset: %d, %d, %d parameter stack overflowbcsave errorparameter reset errorswitch errordclargs() %s (%d) dclstruct( %s ), szindex = %d ??gummy structure memberillegal zero sized structure member: %szero sized structure dimtab[%d,%d,%d] = %d,%d,%d member %s(%d) redeclaration of formal parameter, %scompiler takes alignment of functioncompiler takes size of functionunknown sizeinitialization alignment errorinoff errorbeginit(), curid = %d instk((%d, %o,%d,%d, %d) no automatic aggregate initializationinsane structure member listendinit(), inoff = %d too many initializersempty array declarationbad scalar initializationcannot initialize extern or union} expecteddoinit(%o) illegal initializationillegal {irbrace(): paramno = %d on entry too many local variablesStructure too largetoo many local variablesillegal field typefield too bigzero size fieldstructure too largestructure too largenidcl error .lcomm L%d,%d .lcomm %s,%d illegal type combinationtymerge: arg 1Null dimensionarray of functions is illegalfunction returns illegal typea function is declared as an argumentfunction illegal in structure or unionfunction has illegal storage classillegal use of fieldillegal classillegal classillegal classillegal register declarationillegal classillegal classfortran declaration must apply to functionfortran function has wrong typeillegal class: %dSymbol table full nonunique entry for %s from %d to %d lookup( %s, %d ), stwart=%d, instruct=%d symbol table fullsymbol table full%s undefinedremoving %s from stab[ %d], flags %o level %d symbol table full%s redefinition hides earlier one %d hidden in %d unhide uncovered %d from %d unhide fails%W% (Berkeley) %G%>buildtree( %s, %o, %o ) constant argument to NOTconstant in conditional contextdivision by 0.illegal lhs of assignment operator%s undefinedmember of structure or union requiredmember %s==%s? illegal member use: %snonunique name demands struct/union or struct/union pointerstruct/union or struct/union pointer requiredundefined structure or unionillegal member use: %sillegal indirectionunacceptable operand of &assignment of different structurestype clash in conditionalillegal functionillegal functionother code %dchkstr( %s(%d), %d ) undefined structure or uniongummy structureillegal member use: perhaps %s.%s?division by 0division by 0illegal comparison of enumsenumeration type clash, operator %sillegal combination of pointer and integer, op %sillegal structure pointer combinationillegal array size combinationillegal pointer combinationpointer requiredillegal oconvert: %dillegal pointer subtractionillegal types in :void type illegal in expressiontymatch(%o): %o %s %o => %o constant expectedconstant too big for cross-compileroperands of %s have incompatible typessizeof returns 0 %o) %s, %ld, %d, , %d, %d statement not reachedL%d%W% (Berkeley) %G%>PQTURSXYVW& error%W% (Berkeley) %G% B   cvtblcvtwlmovlmovlmovfmovd movzbl movzwlmovlmovl ret jbr L%d .align %d .text .data .data 1 .data 2 .stab illegal location counterL%d: .lcomm L%d,%d movab L%d,r1 movab L%d,r0 .set L%d,0x%x .align 1 .word L%d jbr L%d L%d: movab L%d,r0 jsb mcount .data .align 2 L%d: .long 0 .text %s %d(ap),r%d bad argumentbad argument .globl %s %s: " .ascii "\%c\%o" .ascii "%c" .space %d illegal field type%s, line %d: movl casel r0,$%ld,$%ld L%d: .word L%d-L%d L%d: L%d: cmpl r0,$%ld jeql L%d cmpl r0,$%d jeql L%d jbr L%d jgtr L%d jgtr L%d L%d: %W% (Berkeley) %G%HCbad conversionincode: field > int .long 0x%x %s 0%c%.20e .double.float .long 0x%x .comm %s,%ld 0,%d,%d 0,%d,%d 0,%d,0 0,%d,L%d 0,%d,%s 0,%d,%d 0,%d,%d No .stab for %s .stabn .stabs "%s", 0%o, .stabd 0%o,0,0%o 1,0,%d 0,0,LL%d LL%d: 0,%d,_%s %W% (Berkeley) %G%E#E(E.E5E;EBEFELEQEVE\EcEkErEyEQPUTSRYXWVbad option: %cstore called on: SZEROSONESMONESPECIAL+%d|order( %o, ) order( %o, ), cookie , rewrite %s no table entry for op %sillegal initializationexpression causes compiler loop: try simplifying %o) %s %s size=%d align=%d, , NOPREFMUSTDO PREF %s, SU= %d %W% (Berkeley) %G%SANYSAREGSTAREGSBREGSTBREGSCCSNAMESCONSFLDSOREGSTARNMSTARREGINTEMPFORARGSWADDII I J=J JJJJJ J<#J'J+J/J3J4J7J:J=J@JCJFJIJLJOJRJVJZJ]J`JcJ  fJqJ|JJJJJJJJ<J>J=J?J%s, line %d: # line %d, file %s L%d: subl2 $%ld,sp movab -%ld(sp),sp jbr L%d %s%cno hoptab for %sdflwbzzzcode- bad typel clrl %s clr mnegmoval ,cvtmovzlcvt ,cvtl ,movmovzcvtcvt ,movlcvtl->%d<-$%d %sincdec %saddsub2 ,->%d<-dfl->%d<-$%ld$%d$%dSTASG badSTASG-rstructure size <0=0 or >65535 movb movw movl movq movc3 $%d,, illegal zzzcode %s %s,%s movfmovdmovlillegal makeor2 shumul:op=%d,lop=%d,rop=%d prname=%s,plty=%d, prlval=%D $%ld%sillegal conputinsputupput$%s*-(%s)+[%s]bad arg temp%ld(ap)(%s)*%s(%s)%s-+illegal address%ld%s%s+%ld addl2 $%d,sp jbr L%d bad conditional branch: %saddress of OREG taken%W% (Berkeley) %G%addsubmuldivbisxorbicaddsubmuldivbisxorbicr0r1r2r3r4r5r6r7r8r9r10r11apfpsppc jeql L%d jneq L%d jleq L%d jlss L%d jgeq L%d jgtr L%d jlequ L%d jlssu L%d jgequ L%d jgtru L%d udivuremudivurem%?%= @<<A<<= 0B>>C>>= 0|h|=i ^h^=i N++ O-- E->FCALLIFCALLP==Q!=R<=S<T>U>YUGTXUGEWULTVULE]A>>!TYPE6[mCBRANCHgFLDjPMCONVkPVCONV$RETURN oCAST %GOTObSTASG cSTARGdSTCALLfUSTCALL#T)T.T3T9T=TBTHTOTUT]TdTjTpTwTTTT RR too many errorscannot recover from earlier errors: goodbye! compiler error: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lbcvtldScvtlfCcvtlw#cvtrdl5cvtr((fl4cvtwbcvtwdRcvtwfBcvtwl2decb decl decw divb2qdivb3divd2udivd3divf2tdivf3divl2sdivl3divw2rdivw3extvextzvincb incl incw insvjmpmcombmcomlmcomwmnegbmnegdmnegfmneglmnegwmovab0movad0movaf0moval0movaq0movaw0movb movd movf movl movq movw movzbl)1movzbw)!movzwl)2mulb2qmulb3muld2umuld3mulf2tmulf3mull2smull3mulw2rmulw3pushab1pushad1pushaf1pushal1pushaq1pushaw1pushlret!sobgeq+sobgtr,subb2qsubb3subd2usubd3subf2tsubf3subl2ssubl3subw2rsubw3tstbtstdtstftstltstwxorb2qxorb3xorl2sxorl3xorw2rxorw3movc34.globl.text$.data%.bss&.align'.word*.long2.set3.lcomm;.comm<.end(rsb5jsb6mfpr7mtpr8prober9probew:adawiaddp4addp6adwcashpbicpswbispswbptbsbbbsbwchmechmkchmschmucmpc3cmpc5cmpp3cmpp4cmpvcmpzvcrccvtlpcvtplcvttpcvtptcvtpscvtspdivpeditpcedivemoddemodfemulffcffshaltindexinsqueldpctxloccmatchcmovc5movpmovpslmovtcmovtucmulpnoppolydpolyfpoprpushrreiremquerotlsbwcscancskpcspancsubp4subp6svpctxxfcescdesceescfPЬ[Ь Z+PPPXZ kw+ݏݬPYX1YY$ kalXPPPݬ2 PY<#+3ݏݬPYXYY ݬ PYY)YXPPPݬ PYYPjYX kr  ZPݬ \~ݬ[ЬP PPP|\~ݬPPЬ[  P ݏ} P ի ߘP@) [[f S  P2PPݫ~ PkЫk!k    k1WP֫Ь[ի ݫ6 Ь ЫkЬ[ЬZЬ YY kPYP kPzQQP^BЬ2߭ \~ݬ׭ ЭP֭` ߭rЬP  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj ~P  BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[[1xݏPZZ  YYX ZYYXZYZ~@PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP([ [[[R  Ь[Z = 8[ePZ~9PZ ݫ3 ԫ kZP{@P^߭ݬ\PPPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6.rr|mp~*PYY[^k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [rP YPƏPxPbPZxPZPPZx~@PZZZPZPxPZPPjjrw1xYP[PdZ]UXkIBk[P Ь[[ZZZ)jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j~\S^\_PCЬPЬPЬRRQ{RPPR PRPPPP@(#)c20.c 4.5 7/5/81@  ' ` 5 @B.long (Optimizer: out of space rC2: can't find %s wC2: can't create %s %d iterations %d jumps to jumps %d inst. after jumps %d jumps to .+1 %d redundant labels %d cross-jumps %d code motions %d branches reversed %d redundant moves %d simplified addresses %d loops inverted %d redundant jumps %d common seqs before jmp's %d skips over jumps %d sob's added %d redundant tst's %d jump on bit %d field operations %dK core ? %s %s %s%c.text L%d:%s:%s %s%cL%d mova%c L%d,%s bwlq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VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~ PYjst~P  BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[p1xݏPZZ  YYX ZYYXZYZ~8PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PPD[ [[[n Ь[Z = 8[ePZ~9PZ ݫ+ ԫ kZP{8P^߭ݬTPPPPݬݏ tݬݬݏtݬ6|.nf`cQT~*PY=[Bk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [PYPƏPxP׏bPZxďPZPPZxﴏ~@PZZZPZP}x~PZPPjjg[1xYP[PHZA9<k-&k[P Ь[[ZZZ jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPm@j8~\S^\_PCЬPЬPЬRRQ{RPPR PRPPPP$G((((((((LX[ !"#$%&'   !"#$%&'  /dev/ttyAre you sure you want to clobber the floppy? Are you sure you want to clobber the floppy? arff: bad option `%c' arff: one of [%s] must be specified arff: only one of [%s] allowed usage: ar [%s][%s] archive files ... arff: %s not found arff: phase error on %s %c - %s %d entries remaining in directory segment %d. Tempfile: %6.6s %3.3s %02d/%02d/%02d %d %-25.9s %d x - %s r+rarff: too many directory segments arff: read error block %d arff: read error block %d arff: write error block %d arff: write error block %d r - %s %s will not fit in currently used file on floppy a - %s %s: no slot for file %s: internal error, added then not found Directory segment #%d full on %s arff: couldn't open %s d - %s @(#)arff.c 4.7 (Berkeley) 81/07/08rxtd/dev/floppyvf ABCDEFGHIJKLMNOPQRSTUVWXYZ$.@0123456789 abcdefghijklmnopqrstuvwxyz$.@0123456789M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDecUnknown error: #ppԵetc/rc 644 0 12 3167 2607347214 5146 HOME=/; export HOME PATH=/bin:/usr/bin if [ $1x = autobootx ] then echo Automatic reboot in progress... >/dev/console date >/dev/console /etc/fsck -p >/dev/console case $? in 0) date >/dev/console ;; 4) /etc/reboot -n ;; 8) echo "Automatic reboot failed... help!" >/dev/console exit 1 ;; 12) echo "Reboot interrupted" >/dev/console exit 1 ;; *) echo "Unknown error in reboot" > /dev/console exit 1 ;; esac else date >/dev/console fi rm -f /etc/nologin : should fix up the password lock file here if present cp /dev/null /etc/mtab chmod 666 /etc/motd /etc/swapon -a >/dev/console /etc/mount -a >/dev/console echo preserving editor files >/dev/console (cd /tmp; /usr/lib/ex3.6preserve -a) echo clearing /tmp >/dev/console (cd /tmp; rm -f *) echo -n starting daemons: >/dev/console /etc/update; echo -n ' update' >/dev/console /etc/cron; echo -n ' cron' >/dev/console /etc/accton /usr/adm/acct; echo -n ' accounting' >/dev/console if [ -d /usr/net/bin ]; then sh /usr/net/bin/start & echo -n ' network' >/dev/console fi /etc/comsat; echo -n ' mail' >/dev/console if [ -f /dev/cul0 ]; then /usr/lib/dnd > /usr/adm/dndbug echo -n ' dialer' >/dev/console fi cd /usr/spool rm -f uucp/LCK.* if [ -f /dev/lp ]; then rm -f lpd/lock; /usr/lib/lpd; echo -n ' printer' >/dev/console fi if [ -f /dev/vpd ]; then rm -f vpd/lock; /usr/lib/vpd; echo -n ' versatec' >/dev/console fi if [ -f /dev/vad ]; then rm -f vad/lock; /usr/lib/vad; echo -n ' varian' >/dev/console fi echo '.' >/dev/console date >/dev/console /etc/savecore /usr/crash 2>&1 > /dev/console exit 0 if [ -f /dev/cul0 ]; then /usr/lib/dnd > /usr/adm/dndbug echo -n ' dialer' >/dev/console fi cd /usr/spool rm -f uucp/LCK.* if [ -f /dev/lp ]; then rm -f lpd/lock; /usr/lib/lpd; echo -n ' printer' >/dev/console fi if [ -f /dev/vpd ]; then rm -f vpd/lock; /usr/lib/vpd; echo -n ' versatec' >/dev/console fi if [ -f /dev/vad ]; then rm -f vad/lock; /usr/lib/vad; echo -n ' varian' >/devetc/bad144 755 0 12 22000 2532066601 5522 0^Юn PPՀPpPP P ^׬Ѭ!DϐϏaσςgϓ[ЬP`k_PX[kЬP`<JIJ=<T[kA'&[k1ЬPݠ'լ1$PPBϯëPx P~ϭPϽfݏϰPϾqVϊ-<σPP1P1?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ(( Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj ~P   BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[1xݏPZZ  YYX ZYYXZYZ~HPY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PPd[ [[[  Ь[Z = 8[ePZ~YPZ ݫ; ԫ kZP{ Ь[ЬZkPkPzQQP(P^߭ݬDPPPݬݏ tݬݬݏtݬ6.&r&jdgUX~*PYA[Fk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [&PYPƏPxPbPZxPZPPZx~@PZZZPZPxPZPPjjk&_1xYP[PLZE=@k1*k[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPq@jH~\S^\_-P$CЬPЬPЬRRQ{RPPR PRPPPP`i`  2a2 usage: bad type disk [ snum [ bn ... ] ] e.g.: bad rk07 hk0 %s: not a known disk type known types: %s /dev/r%scbad block information at 0x%x in %s: %s: can't read bad block info (wrong type disk?) cartidge serial number: %d(10) alignment cartridge bt_flag=%x(16)? sn=%d, cn=%d, tn=%d, sn=%d bad: too many bad sectors specified limited to 126 by information format limited to %d (only 2 tracks of sectors) %d: out of range [0,%d) for %s @(#)bad144.c 4.2 (Berkeley) 81/05/11rk06rk07rm03rm05rp06rm80rp05rp07Unknown error: #""0&etc/badsect 755 0 12 12000 2532066617 6156  ^Юn PPՀPpPP  P$^ԭ׬լ ݭݼ#P~ݼiPϑ l֭Ь[ZYk94 ZPQPQ0QZY[[kPP P P+P-k0YZPZPP H [ P  P@X[ݬ)PZZݬ6 %[P[ ,DNhz.=M\m-Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large Ь[ZZZPP! P^Ь[    PPYYX1XX߭~PYj~P  BЫZ֫ZPѫPѬ ZPPXPZ~=PYZkn 1mЫZ3[` 1xݏPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏP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ʏPPAЫZ;ZY4Z P2PPkYZ~lPY PP [ [[[" Ь[Z = 8[ePZ~uPZ ݫ ԫ kZP{ Ь[Zk[ZZP Ь[ЬZkPkPzQQPP^߭ݬxPPPl\Ь[ЬZ[Y[YPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6Ь[ѬP ѫѫk֫k׫ЫP`PH1.$u:1 u21,1/11 1~*PY 1[1k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ0 [ uP0YPƏPxP0bPZx0PZPPZx0~@PZZZ]0V0PZPI0xJ0PZPPjj30 u'01xYP[P0Z 000k//k[P Ь[[ZZZ/jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP9/@jH~\S^\_-P$CЬPЬPЬRRQ{RPPR PRPPP%P7 HG:9LM *O. VNU T;<()01ASQPB01+2'!82%>$I=#/K?,-" &6345@CDEFJJR ""%"$$# ++++""" HGEDC7B:;@?9<A>=8((        $$$$$&&&&   0*000" %# !/1)'(2+,-.config: %s at line %d %s connected to non-controller%s %d not definedno %s's to wildcardOHNO!!!ubambaonly uba's and mba's should be connected to the nexuscan't give specific nexus numberstimezone is unreasonableyacc stack overflowsyntax errorHZ specification obsolete; deleteubambambaubambauba%s must be connected to a nexuscan't specify slave--not to masterusage: config rDon't forget to run "make depend" ..//ccTTTT UU UUU U%U +U 2U@UFULUQUVU\U_UbUkUoUxUpC@                        fONhNRNONONMhONhONOOO OhOOhOOQ$OL,OhO4ODOSOMxM 1|g 'M! n'$ Tg,,d 7 > Cr,)In4O.WN`hOiYRq|SxSNS|TOT Hh ehk :lk ,pkoT 68lT(f@JVt) : .BJ)3?P#FDOo Z# d!m+)t zBP$7$j%'M'.*;BC ?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ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VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYjX~P  BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[X1xݏPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[ Ь[Z = 8[ePZ~uPZ ݫ ԫ kZP(({ Ь[Zk[ZZP Ь[ЬZkPkPzQQPP^߭ݬxPPPЬ[ЬZ[Y[YPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6,Ь[ѬP ѫѫk֫k׫ЫP`PЬPЬRRQ{RPRPPPRRP.>>~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [>P|YPƏPxPcbPZxPPZPPZx@~@PZZZPZP x PZPPjj>1xYP[PZkk[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j~\S^\wP[ЬPЬPЬRRQ{RPPR PRPPլQPPLthe epochrwCannot open %s level %c dump on %s %-16s %c %sUnknown intermediate format in %s, line %d /etc/dumpdates/etc/dumpdatesw%s: Can not open %s to update. /etc/dumpdates/etc/ddater/dev//dev/%16s %c %[^ ] @(#)dumpitime.c 1.1 (Berkeley) 10/13/80O@>A@/dev/rmt8/dev/rrp1g/etc/dumpdatesubad key '%c%' Date of this level %c dump: %s Date of last level %c dump: %s Dumping %s (%s) to %s Cannot open %s mapping (Pass I) [regular files] mapping (Pass II) [directories] estimated %ld tape blocks on %3.2f tape(s). dumping (Pass III) [directories] dumping (Pass IV) [regular files] DUMP: %ld tape blocks on %d tape(s) DUMP IS DONE DUMP IS DONE! SIGHUP() try rewriting SIGTRAP() try rewriting SIGFPE() try rewriting SIGBUS() try rewriting SIGSEGV() ABORTING! SIGALRM() try rewriting SIGTERM() try rewriting Rewriting attempted as response to unknown signal. /r@(#)dumpmain.c 1.2 (Berkeley) 10/16/80pR@C/dev/ttyrfopen on /dev/tty fails yes Yes no No "Yes" or "No" ONLY! NEEDS ATTENTION: %s: ("yes" or "no") Interrupt received. Do >>>YOU<<< know what are you doing? Do you really want to abort dump?operatorNo entry in /etc/group for %s. operator/etc/utmprCannot open /etc/utmp ttydttyd/dev/w Message from the dump program to all operators at %d:%02d ... %3.2f%% done, finished in %d:%02d DUMP: Can't open %s for dump table information. /etc/fstabrwroDump these file systems: Last dump(s) done (Dump '>' file systems): ??%c %8s (%6s) Last dump: Level %c, Date %s @(#)dumpoptr.c 1.4 (Berkeley) 12/17/80UTape write error on tape %d TAPE ERROR! Do you want to restart?This tape will rewind. After it is rewound, replace the faulty tape with a new one; this dump volume will be rewritten. Tape rewinding Change Tapes: Mount tape #%d CHANGE TAPES! Is the new tape mounted and ready to go?Do you want to abort?Context save fork fails in parent %d Parent %d waiting for child %d has another child %d return Child %d returns LOB status %o Bad return code from dump: %d Cannot open tape. Do you want to retry the open?Tape %d begins with blocks from ino %d Waiting parent receives interrupt The ENTIRE dump is aborted. @(#)dumptape.c 1.3 (Berkeley) 3/11/810Vbread: lseek fails (This should not happen)bread from %s [block %d]: c=0x%x, regc=0x%x, &c=0x%x, n=0x%x More than %d block read errors from %d DUMP IS AILING! This is an unrecoverable error. Do you want to attempt to continue?@(#)dumptraverse.c 1.1 (Berkeley) 10/13/80JanFebMarAprMayJunJulAugSepOctNovDecV@(#)unctime.c 1.3 (Berkeley) 81/04/18M:/Day Mon 00 00:00:00 1900 Sun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ЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPy'@j~\S^\wP[Ь{PЬPЬRRQ{RPPR PRPPլQP!PPMtMMBad -t option %c option? Incompatible options: -n and -%s sSCan't get memory Can't open checklist file: %s /etc/fstabrwrofork/Can't stat root Can't stat %s Can't stat %s %s is not a character device Can't make sense out of name %s Can't make sense out of name %s /r** Checking %s ** Phase 1 - Check Blocks and Sizes UNKNOWN FILE TYPE I=%uCLEARLINK COUNT TABLE OVERFLOWCONTINUEPARTIALLY ALLOCATED INODE I=%uCLEARINTERNAL ERROR: dups with -p** Phase 1b - Rescan For More DUPS ** Phase 2 - Check Pathnames ROOT INODE UNALLOCATED. TERMINATING. ROOT INODE NOT DIRECTORYFIXDUPS/BAD IN ROOT INODE CONTINUE** Phase 3 - Check Connectivity ..** Phase 4 - Check Reference Counts UNREFUNREFBAD/DUPFREE INODE COUNT WRONG IN SUPERBLK (FIXED) FIX** Phase 5 - Check Free List (Ignored) %d BAD BLKS IN FREE LIST %d DUP BLKS IN FREE LIST %ld BLK(S) MISSING FREE BLK COUNT WRONG IN SUPERBLK (FIXED) FIXBAD FREE LIST (SALVAGED) SALVAGE** Phase 6 - Salvage Free List %ld files %ld blocks %ld free ***** FILE SYSTEM WAS MODIFIED ***** %s: %s: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY. %s: BADEXCESSIVE BAD BLKS I=%uCONTINUEDUPEXCESSIVE DUP BLKS I=%uCONTINUEDUP TABLE OVERFLOW.CONTINUEDUPI OUT OF RANGEUNALLOCATEDDUP/BADBAD BLOCKS IN FREE LIST.EXCESSIVE BAD BLKS IN FREE LIST.CONTINUEEXCESSIVE DUP BLKS IN FREE LIST.CONTINUE%ld %s I=%u %s %s=%sDIRFILENAME=%sREMOVEUNREFLINK COUNT %sDIRFILE COUNT %d SHOULD BE %d (ADJUSTED) ADJUST%s %sDIRFILECLEAR (CLEARED) /Can't stat root Can't stat %s file is not a block or character device; OKCan't open %s %sNO WRITE ACCESS (NO WRITE) Size check: fsize %ld isize %d File System: %.12s NEED SCRATCH FILE (%ld BLKS) ENTER FILENAME: Can't create %s INTERNAL ERROR: GOT TO reply() %s? no yes Invalid -s argument, defaults assumed Fatal I/O error Fatal I/O error Fatal I/O error CAN NOT %s: BLK %ldCONTINUEProgram terminated DIRECTORY MISALIGNED I=%u I=%u OWNER=%s %d MODE=%o %s: SIZE=%ld MTIME=%12.12s %4.4s BAD FREEBLK COUNT Default free list spacing assumed UNREF %s DIRFILE (RECONNECTED) RECONNECTSORRY. NO lost+found DIRECTORY SORRY. NO lost+found DIRECTORY SORRY. NO SPACE IN lost+found DIRECTORY DIR I=%u CONNECTED. PARENT WAS I=%u SEEKREADSEEKWRITE@(#)fsck.c 4.13 (Berkeley) 81/03/09lost+found/etc/fstabM:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/etc/fstabr/etc/passwdrUnknown error: #  AAAAAABBBBBB ,d,d$Phetc/halt 755 0 12 24000 2532110027 5465  ^Юn PPՀPpPP P ^P׬լ1խ% χ @d /"ϞsϲP5 "}RZI[ ݏφP #. i[1 Ϻ!)Z ϱ  ϊ ݭ7 ϔ'ݼP1ݼϬPԭ1ݼϖPZ1)!Ϙm1x[~N [1 ϝ ݬ) @oP[F[χ A! 4! !p ![c[ ^߭M ߭χP PPݭ/ЭPl~ЭPݠ РP@ЭPРP@ϙЭPݠݠϹݭϋݭݬ P5^߭ 2P&PPxPPPP2nP2mPЬ[[Ѭ  P PQ QQPQ0QQ P PPP0PP[Pݬ \~ݬЬP PP%4PЬ[,XXbPX 鑫+PPPYkw+ݏݬPZY1ZZEkalYPPPݬcPZ<3ݏݬ}PZYZZݬ%PZZ)Z9YPPPݬPZZ1hZY kr  XP ^ЬP ЬP 1Ѭ sՠn iмZЬլ ~PPZPPZЬP )Z%ѭZPQáPѭPQP­P[[ЬP PQРЬP ݬ [~ЬP~PԼ[h׼ ЬP֠ZݬNЬP BPЬP ԼЬP ЬPPQРݬ ݬЬP~PѭPP [P@X[ݬPZZݬflU[P[?H.  ( 2 L ^ p  ! 1 @ Q e y  Error 0Not ownerNo such file or directory((No such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too largeЬ[  P ݏ P ի ߘP@ [""   P2PPݫ~ PkЫk!k    k1WP֫ Ь[ZZZPЬ[ЬZ[XY YY  YXP$ЬPlP30$ ЬQPa#  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~APYjl ~P   BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3["1xݏPZZ  YYX ZYYXZYZ~pPY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP [ [[[.  Ь[Z = 8[ePZ~-PZ ݫc ԫ kZP{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%3d processes %d/%d processes LOC S F POIP PRI SIG UID SLP TIM CPU NI PGRP PID PPID ADDR RSS SRSS SIZE WCHAN LINK TEXTP CLKT %8x %2d %4x %4d %3d %8x %4d %3d %3d %4d %3d %6d %6d %6d %8x %4x %4x %5x %7x %7x %7x %u 1 cons # RAW CAN OUT MODE ADDR DEL COL STATE PGRP DISC %d dz lines %d dh lines %2d%4d%4d%4d%4d%4d%4d%4d%8.1o %8.1x%3d%4d %6d ntty net pcb %x arg %.1x %9.1x segflg %d error %d uids %d,%d,%d,%d procp %.1x ap %.1x r_val? %.1x %.1x base, count, offset %.1x %.1x %ld cdir rdir %.1x %.1x dbuf %.14s dirp %.1x dent %d %.14s pdir %.1o file %9.1x %9.1x pofile %9.1x %9.1x ssav %9.1x sigs %.1x code %.1x ar0 %.1x prof %X %X %X %X eosys %d sep %d ttyp %.1x ttyd %d,%d exdata %.1D comm %.14s start %D acflag %D fpflag %D cmask %D sizes %.1x %.1x %.1x vm %D cvm %D %3d/%3d files %d/%d open files LOC FLG CNT INO OFFS %8x %4d%9.1x %ld %3d/%3d 00k swap %d used (%d text), %d free, %d missing CHAN FLAGS INDEX LINE GROUP FILE TTYP CTLX PGRP OTTYP OLINE DATQ CTLY %3d %8x %3d %8x %8x %8x %8x %6d %8x %3d %8x %8x CHAN FLAGS INDEX LINE GROUP FILE TTYP CTLX PGRP %3d %8x %3d %8x %8x %8x %8x %6d GROUP STATE INDEX ROT *GROUP *INODE *FILE ROTM DATQ %3d %8x %8x %3d %8x %8x %8x %3d %3d @(#)pstat.c 4.9 (Berkeley) 5/7/81/dev/kmem/vmunix_inode_text_proc_dz_tty_dz_cnt_cons_file_Usrptmap_usrpt_nswap_swapmap_dh11_ndh11_groups_chans_schans_nproc_ntext_nfile_ninode_nswapmapr  AAAAAABBBBBB LLG@Petc/reboot 755 0 12 22000 2532140507 6033 $^Юn PPՀPpPP P^YX׬ԭEݼoPX*ݼ[P\1׬լdP/XFZ ݏ8P +ϬZ_ϯoX h A~ ݭ7 ϒIϸixZ~L Z1Xϛ ݬ' zωP[F[υ 2 % n [9[ ^߭K ߭υPPPݭ-ЭPl~ЭPݠ РP@ЭPРP@ЭPݠݠϪݭωݭݬ P5^߭ 2Pl-[P[H  " 4 D P b r   ) = N ] l Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such de((vice or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too largeЬ[  P ݏe P ի ߘP@ [P"   P2PPݫ~ PkЫk!k    k1WP֫ Ь[ZZZPЬ[ЬZ[XY YY  YXP$ЬPlP 0   ЬQPa#  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYjl~P   BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[`1xݏPZZ  YYX ZYYXZYZ~HPY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[. Ь[Z = 8[ePZ~YPZ ݫ; ԫ kZP{ Ь[ЬZkPkPzQQP(P^߭ݬDPPPݬݏ tݬݬݏtݬ6.(~ (vpsad~*PYM[Rk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [ (PYPƏPxPbPZxPZPPZx~@PZZZPZPxPZPPjjw (k1xYP[PXZQILk=6k[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP} @j~\S^\_PCЬPЬPЬRRQ{RPPR PRPPPqP0/usr/adm/wtmpTX\`dhlptx|-q-nusage: reboot [ -n ][ -q ] reboot: can't idle init reboot: killCAUTION: some process(es) wouldn't die reboot~shutdown/usr/adm/shutdownloga%02d:%02d %s %s %2d, %4d. Halted for reboot. @(#)reboot.c 4.5 (Berkeley) 4/21/81SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDecM:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDecUnknown error: ###$(etc/renice 755 0 12 22000 2532141206 6003 ^Юn PPՀPpPP PD ^ѬѬ"ϓPЬPݠPѬ ЬPРPϺPPPPѭϐPPω?ϐ v[ngݭݭ ߭ݭϙݏpݭPJM%ݭݭύ ߭ݭPݭݭs ŏp~ݭ.ŏpPPZ[2(PP p[[Z[ZݭώϡϚ~PP~ݭj}[τíPPݭݭ ߭ݭ|ĬݬP[P[Z~&PYԊY[Pݬݬ \~ݬ ЬP PPЬ[ZYk94 ZPQPQ0QZY[[kPP P P+P-k0YZPZPQP^ЬZV0jP`-ԪjPWWW ZVjݬQPPPݭ ߭ѭԏ"ѭԏѭԏ ݭPѭԏ 2P PPPPPЭYY12XYXYXݭݭݭXsPWXXYZ Xj1yj~ݭݭ~*Ь[EW GG4WGG%ЪVݭ1 [kP` Z1nЬ[XXPX 鑫+PPPYkw+ݏݬPZY1ZZykalYPPPݬPZXh  $ : L X j y  % ; J V i Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large^Ь[ЬZԭլ05Ьj ЪP֪`P ZoPYY׭֭ѭ ЭP^Ь[ЬZԭլ.3ЬYj ЪP֪` Z~o Y ֭ѭ ЭPЬ[  P ݏ P ի ߘP@* [D   P2PPݫ~ PkЫk!k    k1WP֫ Ь[ZZZP((   !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj~P   BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[T1xݏPZZ  YYX ZYYXZYZ~(PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~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ݬPPP<,PЬ[ЬZ[Y[YPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6|.T7nP7f`cQT~*PY=[Bk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [P7PYPƏPxPbPZxPZPPZx~@PZZZPZP}x~PZPPjjgP7[1xYP[PHZA9<k-&k[P Ь[[ZZZ jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPm@j~\S^\_PCЬPЬPЬRRQ{RPPR PRPPPm P0+W+`+h+n+w+++++++++++++++++++++usage: savecore dirname [ system ] /dev/dev/Can't find device %d,%d /vmunix/vmunix: dumpdev not in namelist /vmunix: dumplo not in namelist /vmunix: time not in namelist /vmunix: physmem not in namelist /vmunix: version not in namelist /vmunix: panicstr not in namelist /dev/kmemrCouldn't fdopen kmem rWarning: vmunix version mismatch: %sand %srSystem went down at %sDump time is unreasonable /minfreeDump omitted, not enough space on device rbounds/vmunixvmunix.%dvmcore.%dSaving %d bytes of image in vmcore.%d boundsw%d /usr/adm/shutdownloga%02d:%02d %s %s %2d, %4d. Reboot after panic: %s readlseekwrite@(#)savecore.c 4.7 (Berkeley) 81/05/20_dumpdev_dumplo_time_physmem_version_panicstrSunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDecM:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDecrUnknown error: #22-h7etc/shutdown 755 0 12 30000 2552577560 6432 $ ((^Юn PPՀPpPP# P^* PϽ.׬լOѬЬP`ϰ$@Kϓ P$(Y 0ЬP`ϕP׬[pЬP`X-JPr'[5$}(  'Pk2#/#[PPh #[1G[ мKϠ-[ЬP׬PKϊ-'PPPP])P /P[[NЭPl~ЭPݠ РP@ϕЭPРP@lЭPݠݠ [ϋW'Zj [wZjϔ'ώ' [[[ ϶[ݬ P5^߭ 2P?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnop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^3PP3xPҭPPPɭPʭ^ԭԭ[3KYZYP@-P@.xYYZZ[[ЭPЬ[լ~ЬP2kQPQrPP2@kZ2Yլ P2@kY2kP2@kXYZZYJIJZXZYZZP2@kPYPZQPAkZZP2kQPQk2kPP@k. Ь[2Zk2kP2@kZ¬ Z2kPPPPYZYP2kPPZ@kY IJZYY k2kPPЬ[2ZYYP2@kPPZ#YP2@kZYYP2kQPQ2kPPPPZP$.L ݏݬmP@ Pݬ P5^߭ 2P6X6j6|666666667 77-7=7L7]7q777777777 88Error 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large@) Ь["ZZ#PZ jkr kaݬ- +   ZP*0ЬRPQbP,"\~ݬ#"PPЬ[[ ~kЫ0   Ь[  P ݏP ի ߘP@VR [Z! o!F  P2PPݫ~9PkЫk!k    k1WP֫Ь[ի ݫ^ Ь Ыk.PP Ь[ZZZPЬ[ЬZЬ YY kPYP kPzQQPlݬݬ;:0, ЬQPa#QP^BЬ2߭ \~ݬ׭ ЭP֭` ߭rЬP  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj~P w-o- BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[Z1xݏsPZZ  YYX ZYYXZYZ~ PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[ Ь[Z = 8[ePZ~PZ ݫ ԫ kZP{P[P[P[P/[PZ[Z((Z&PXYX/P[Y[ZuPX\YPXOE[[ݬP1yk  k^EP[[ Ь[Zk[ZZP Ь[ЬZkPkPzQQP^ݬPP߭ݬPNBNENQEy_NlNoNrNuNxN{N~N@NNNNNBCPLNNN^N!N[unknown]amnesiavaxamnesiavaxMAILER-DAEMON/bin/mail...local%mail-d$u/bin/csh...prog%mail-fc$u/usr/net/bin/sendberkmail...berk%mail-m$h-t$u-h$c/usr/lib/mailers/arpa...arpa%mail$f$h$u/bin/mail...uucp%mail-d$h!$u!@(#)main.c 2.3 1/10/81/tmp/mailtXXXXXX/tmp/mailxXXXXXXNo "from" personMore than one "from" personBad hop count (%s)/dev/nullw%s -f and -a are mutually exclusiveMessage-Id: <%s> Who are you? (uid=%d)networkuucpFrom person = "%s" Usage: /etc/delivermail [flags] addr...Infinite forwarding loop (%s->%s)address overflow@Noone to send to!wCan't create %s@(#)maketemp.c 2.3 12/6/80wCannot create %sMessage-Id: <%s> EOH From >EOH? senderfrommessage-idw MAIL DELETED BECAUSE OF LACK OF DISK SPACE Out of disk space for temp fileCannot write %s/dev/nullwrCannot reopen %s%ld.%d.%s@%s@(#)parse.c 2.5 1/8/81multichar errorsyntax errorparse("%s"): host "%s" user "%s" mailer %d Unbalanced ')'multiple < specUnbalanced `>'()<>@!.,;:\" ()<>@!.,;:\" Address too longUnbalanced '('Unbalanced '"'Unbalanced '<'@(#)alias.c 2.2 12/6/80--- alias --- /usr/lib/aliases%s (%s, %s) aliased to %s @(#)deliver.c 2.5 2/5/81deliver(%s [%d, `%s', `%s']) name too longpipeCannot forkCannot dup to zero!Cannot exec %s wwait%s: stat %ookBad m_badstat %dunknown mailer response %d%serror %dFrom From %s %sFrom %s %sputheader: write errorBroken piperecipient(%s) (%s in SendQ) (%s in AliasQ) -f-rToo many parameters to %s%dInterpolated argv is: %s aFrom %s %s @(#)savemail.c 2.2 1/10/81rootCannot parse root!wrCannot open %s Message from %s Errors occurred while sending mail, transcript follows: savemail: stdout: write err/dev/nullwCan't parse myself!Can't return mail to %sCan't return mail to %s (pw=%u)/usr/tmp/dead.letteraCannot save mail, sorry ----- Mail saved at %s savemail: dead.letter: write errLetter saved in dead.letter ----- Cannot open %sTo: %s Subject: Unable to deliver mail ----- Transcript of session follows ----- ----- Unsent message follows ----- errhdr: I/O error@(#)addr.c 2.1 11/5/80@(#)err.c 2.2 1/10/81: %s: error %ddelivermail: %s %s... @(#)matchhdr.c 2.1 11/5/80@(#)sysexits.c 2.1 11/5/80WW,W>WKWXWlW{WWWW Bad usageData format errorCannot open inputUser unknownHost unknownService unavailableInternal errorOperating system errorSystem file missingCan't create outputI/O error@(#)util.c 2.1 11/5/80Out of memory!!=951-)%! 11r4G(f3YC!d&Yo;VVu7{ʉ0- T;/> [2/a1<=`fvK_zlG6$C w$M670)Yn!N6V1p&83)]H+ܝ<5;71g$+#) n0%a3 $ 2nV01}D9R7N:#68W)9:{2}x|~L'\/qö.pag.dircannot open database %s items not in pairs entry too big split not paired bad delitem bad block M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/etc/utmp/etc/passwdrr/#  AAAAAABBBBBB uu,\/etc/ttys/dev/0 r<<,L$y/6N>dILPQt YDQai4Rq{RTpLV4dVhVVWP p +++O,/fd/ p0)P04;0>~1ID1Tp1_q2fq03n|3w3v34$4D5T508H888~8$9$99y :0:@:$T::::(:1:9:@:I:Sf<;\fCeyElEsE}FFF;GGGGGG H(H!@HlH|HAHHH 7 KdKK K'K/K8E>D~JrLS~L\FDLfpHLp9LL{ PLyXL\LVM<"0|3D1!(H|[F H\G BL\ CN\ P\  oR\ bT\ V\( X\3 Z\< \\G 9^\N `\X Fb\a d\k h\s NN p\ \ \ \ \ \:I.Z94q26d/8d  \Fv3 t 'V/$@:7p?JQ HYrbluHtx3| + H] tL].D5;Gt$4+03hZ$9A|H6 0T:,/Xhj VE :p:G:  (4 30 8 P]= X]B p KPU*!\'dplu16n088?K98:0::LDTH8K z WVW+#9P *N2Mp0: :Bp1LGRKYG_dZiT5v}H '`] d] h] al] p] "pa `pq tq xqGt!)H' &])|) j"e>*:!y#(*12)9T(A r%KNT&V%_))h0+p`Wwy4X~+K?+ -:,O.fCQu0E~<113HdK 4 ,\ X08 y`J :( :1 3G9 qA 4EK uS F[ VHa @Hg lHn  Kt 7|J} 0 MK crt0.oversion.oconf.o_SccsId_BerkLocalmain.o_SccsIdmaketemp.o_SccsIdparse.o_Sc((csIdalias.o_SccsIddeliver.o_SccsIdsavemail.o_SccsIdaddr.o_SccsIderr.o_SccsIdmatchhdr.o_SccsIdsysexits.o_SccsIdutil.o_SccsIdbmove.o-ldbmabort.ochmod.octime.ofputs.ofreopen.ogetgid.ogetlogin.ofprintf.ogetpwnam.ogetpwuid.ogetpwent.oatoi.ofgets.ogetuid.oindex.omktemp.oaccess.ofopen.ocreat.oerrlst.odup.ofdopen.opipe.oprintf.orew.octype_.ofilbuf.osetbuf.osetgid.osetuid.ostrlen.ostrncmp.o_exit.oexecv.oexecve.osignal.olseek.otime.ogetpid.osprintf.odoprnt.oflsbuf.oexit.odata.ottyslot.orindex.ostrcmp.ottyname.oclose.ofstat.oisatty.oopen.oread.ostat.ostrcat.ostrcpy.ostty.oioctl.oungetc.ounlink.ourem.omalloc.osbrk.oudiv.ovfork.owait.owrite.ocerror.o_exitstart_main_environ_Version_UseMsgId_ArpaHost_MyLocName_UucpLocal_DaemonName_Mailer_ParseTab_getname_getlogin_getuid_getpwuid_strcpy_ttypath_ttyname_errno_stat_ArpaFmt_FromFlag_Debug_MailBack_BerkNet_WriteBack_HasXscrpt_NoAlias_ForceMail_MeToo_SaveFrom_IgnrDot_SuprErrs_Errors_InFileName_Transcript_From_To_HopCount_ExitStat_SendQ_AliasQ_signal_finis__iob_setbuf_syserr_atoi_freopen_openxscrpt_printf_maketemp_MsgId_strcmp_index_parse_usrerr_strlen_sendto_recipient_alias_strcat_deliver_savemail_unlink_mktemp_chmod_MsgSize_GotHdr_creat_close_fopen_fgets__ctype___filbuf_ungetc_makemsgid_fprintf_strncmp_fputs_matchhdr_prescan_fclose_time_getpid_sprintf_xalloc_makelower_any_lhs_rhs_dbminit_sameaddr_fetch_tkoffq_putonq_forward_stripquotes_getpwnam_giveresponse_mailfile_putheader_buildargv_pipe_rewind_vfork_dup__exit_setuid_execv_fflush_pipesig_fdopen_wait_N_SysEx_SysExMsg_ctime_bmove_errhdr_getgid_setgid_setpwent_open_write_read_sys_nerr_sys_errlist_lower_malloc_bitno_maxbno_blkno_hmask_pagbuf_dirbuf_dirf_pagf_dbrdonly_fstat_forder_calchash_getbit_dbm_access_makdatum_cmpdatum_delete_delitem_lseek_store_additem_clrbuf_setbit_firstkey_firsthash_nextkey_hashinc_chkblk_hitab_hltab_abortcerror_localtime_asctime_ftime_gmtime_dysize__flsbuf_getegid_ttyslot__doprnt_getpwent_endpwent_geteuiduremudiv_access__lastbuf_dup2_free_execve_getppid_isatty__sobuf__cleanup__sibuf_rindex_gtty_stty_ioctl_sbrk_realloc_end_brkitno_maxbno_blkno_hmask_pagbuf_dirbuf_dirf_pagf_dbrdonly_fstat_forder_calchash_getbit_dbm_access_makdatum_cmpdatum_delete_delitem_lseek_store_additem_clrbuf_setbit_firstkey_firsthash_nextketc/dumpdir 755 0 12 26000 2552577551 6230 $8^Юn PPՀP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[ЬZ[Y[YPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6 PЬPЬRRQ{RPRPPPRRP.$ ~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ^ [ PPYPƏPxP7bPZx$PZPPZx~@PZZZPZPݿx޿PZPPjjǿ 1xYP[P憎Zkk[P Ь[[ZZZmjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP;@jP~\S^\_5P,CЬPЬPЬRRQ{RPPR PRPPPݵP%/dev/rmt8$rstXXXXXX wdumpdir: %s - cannot create directory temporary %s: cannot open tape Tape is not a dump tape Dump date: %sDumped from: %sTape is not volume 1 of the dump r/Can't find directory header! /PANIC - can't find directory %d /...r/%5d %s%-.14s Missing address (header) block Mount volume %d Cannot open tape! Not a dump tape.Try again Wrong tape. Try again Checksum error %o @(#)dumpdir.c 4.4 (Berkeley) 2/28/81M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/'8etc/getty 755 0 33 14000 2574142324 5706  L^Юn PPՀPpPP  P ^0Ѭ ЬPРP`ԭ [ k [[ [ Ϭ [ ]XU KFAϢ߭ݏtϤ߭ݏtϔ = < ϸ ϯ7 ϦݫϞ&yPm 1#ϣ@ϞϙϩώϢσϛxp Fd ϴ Wϔ1 ^OOO3[߭vP_ZPZHZ 1Z [x~ZaZzQZAZZ9Z#[1r[1mZ@ k d1NZ _ZZ1DkZ {{&y [[kP@| kP PPk[kPЬ[~k^P@ PʏPQPQQ߭ό^ԭլݏP|PݭݭVխѭ¬ Э!Pݬx+ЬP}V}X}Z}Э`PЬPЬQ}V}X}Z}\Ё^PPݬݬݬ;z0lPݬݏ tݬݬݏtݬ6Pi P^Ь[    PPYYX1XX߭~PYj ~P    BЫZ֫ZPѫPѬ ZPPXPZ~=PYZkn 1mЫZ3[1xݏ_PZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~hPY PPd [ [[[  Ь[Z = 8[ePZ~-PZ ݫ ԫ kZPP^߭ݬPPPP.8B4:47%(~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [4PYPƏPxPbPZxPZPPZx~@PZZZe^PZPQxRPZPPjj;4/1xYP[PZ kk[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPA@j~\S^\sPWЬPЬPЬRRQ{RPPR PRPPXBerkeley 4.1 VAX/UNIX (Amnesia-Vax)0,{L e0--11e22 35L 5344 66 77 89 98!,ii0 ll /bin/loginlogin@(#)getty.c 4.4 (Berkeley) 8/13/81 login: login: login: login: login: :login: login: login: login: login: login: login: login: login: login: *  AAAAAABBBBBB  L((etc/icheck 755 0 12 20000 2552577554 6007 S^Юn PPՀPpPP PL^B_1Pm+Ps(ϩX ݼviPdfZfTfNмP`-ΘPPb[ЬPݠϋPPPK^׬[[Kϱ^׬ϰfP ^qfPPPݬPefPݬϩxfݬϗEfCfCf=f?f?f?f?fCfϖݏ0?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj~P TT BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[P1xݏPZZ  YYX ZYYXZYZ~(PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP0[ [[[Z Ь[Z = 8[ePZ~9PZ ݫ ԫ kZP{(P^߭ݬDPPPݬݏ tݬݬݏtݬ6xZ.ojZobZ\Z_ZMZPZ~*PY9Z[>Zk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZY [oPYYPƏPxPYbPZxYPZPPZxY~@PZZZYYPZPyYxzYPZPPjjcYoWY1xYP[PDYZ=Y5Y8Yk)Y"Yk[P Ь[[ZZZ YjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPiX@j4~\S^\_PCЬPЬPЬRRQ{RPPR PRPPPWPBad flag cannot open %s %s: Check fsize and isize: %ld, %u Not enough core; duplicates unchecked freefiles %6u (r=%u,d=%u,b=%u,c=%u) used %7ld (i=%ld,ii=%ld,iii=%ld,d=%ld) free %7ld %ld missing missing%5ld bad mode %u data (small)1st indirectdata (large)2nd indirectdata (huge)3rd indirectdata (garg)%ld bad; inode=%u, class=%s %ld dup; inode=%u, class=%s %ld arg; inode=%u, class=%s Bad free list, s.b. count = %d Bad free list, entry count of block %ld = %d read error %ld No update write error %ld @(#)icheck.c 4.2 (Berkeley) 81/02/07kkoetc/sa 755 0 12 34000 2532141476 5155 , ((^Юn PPՀPpPP+ P%,^ P+I Z0Ѭ1ЬPРP`-׬ЬP`PЭQA`ЬP`PA`PP0FQQQQQQQQQQH0B9v֭1ID/ /L/ a/... >/. +/.. /.~ .1r. .1^.1U.1L..1= *PЬQaQЭRBaQ0QQP)1j.1e.1`.1c.1)). Ѭr*.׬ЬP`-o -1.[1[Zdm[YY- -PYPPY1j1j~ԭЭP@j? Ѫ f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ܒX^Ь[    PPYYX1XX߭~PYj ~P   BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[/1xݏPZZ  YYX ZYYXZYZ~(PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP< [ [[[f  Ь[Z = 8[ePZ~9P((Z ݫ ԫ kZP{(P^߭ݬDPPPݬݏ tݬݬݏtݬ6.==~*PY}[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ> [=P0YPƏPxPbPZxPZPPZx~@PZZZPZPxPZPPjj=1xYP[PZy|kmfk[P Ь[[ZZZMjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j@~\S^\_%PCЬPЬPЬRRQ{RPPR PRPPPP.pCCCaF@A@CpCaFCpCpC@@@/usr/adm/acct***other/usr/adm/usracctw/usr/adm/savacctwCan't save %.14s %-8s%-8d%7u %9.2fcpu %10.0ftio %12.0fk*sec %8.0f%9s%8.2f%%reu/suscp%8.1fre/cp%10.0favio%10.0ftio%10.0fk%10.0fk*sec%11.2f%s%11.2f%s%9s%8.2f%%Only 1 file with -s rCan't open %s %3d%6.1fcp %6dmem %6dio %.14s /usr/adm/savacctr/usr/adm/usracctrCategorizing commands used %d times or fewer as **junk** **junk**%.14s--%04xPreposterous user id, %d: ignored @(#)sa.c 4.2 (Berkeley) 81/02/28/etc/passwdrr 5 500=usr/ucb/last 755 0 33 24000 2552600627 6326  "^Юn PPՀPpPP PH^ԭ"Ϫ׬ЬϹ"Ьϯ"[cx[Pϣ"P`PLϊx[Pϊ"P`P4x[Pv"P`P x[Pb"P`Ux[QN"QPa[[G"9PP6 ώ߭ݭϿ PǏ PPϰϥ׭%!P P~ݭI $ŏ ~ݭxݏ Ϟ!ݭzPPP@ω!Y1nYϸPP+Y~YP P~ݭYY~b { [[+ [P@7+9Y [P@(+Ϸ K4ЩK4խ1խ&5/ 1Y [P@*N P[խέݭ߭ϳ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)1xYP[P)Z)))k))k[P Ь[[ZZZ)jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP )@j\~\S^\_AP8CЬ#PЬPЬRRQ{RPPR PRPPPP ~tty/usr/adm/wtmp/usr/adm/wtmp%-*.*s %-*.*s %10.10s %5.5s still logged in - %s- %5.5s (%5.5s) (%ld+%5.5s) ~shutdowndown crash wtmp begins %10.10s %5.5s interrupted %10.10s %5.5s reboot@(#)last.c 4.3 (Berkeley) 2/28/81M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/etc/passwdrrUnknown error: # > >#Fusr/ucb/lastcomm 755 0 33 22000 2532110413 7163 x2^Юn PPՀPpPP P@0^)mEP P@:"\EP P@)"MEP>EϚAP ϙ%E~#EPǏPPP1tx ~~ ݏϳ~P P14xP2P P@φ!1xP<~"PxP<~PnPvЭxP@RxP@>xP@2xP@!~?֭AЭP@xP@P-ЭP@xP2P P@ ϬP ֭ѭѬѭ@xP@ϭϤPVPgP~xP2P P@z xP@pχ ׭խ1׭խ1 [ЬP P׬x[[լ[PЬP֬ЬQ֬`aωPzP֬֬ݬ P5^߭A 2P?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR d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SZZG~[[Z6ZZ[^ZZ$TZZz/[[ZѬZZj.Z5PZ5P/kk1AЬ[[E[Pݠ P)F :H<3 F 7^߭߭6߭߭߭2<~߭E Ь[[ЋZ)ݏ)9k<j~P()ݏ~)ZPl) Ь[ЬZjk ѫЪ $$Ь[ЬZkjPëQQPY(PVXVfP`fPՠfPРXh1h% h~<7XhPPDC*****O*;*.*{Xkj~ë~ݬ ŏdYPլ Ь QQJ {GZ(J!JPZPJxJPZPPjjI I1xYP[PIII ZIIIkIIk[P Ь[[ZIPZP ZI P |tZZNIjPPjj@I j;I D ^Ь[ [t[PPݬ2PZZ[ZP[Z~(1PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PPH@jP ^ԭԭfH[LkZЬPՠ(k PPP[Z~[[ZkZ[[HH~ݭݭW4x7r; 4VV:p 4@T? 6R: 4 4G$$)7.G,8?166L&Y5#Ԫ?-C44@53D3KPV(%];dhAo8u|lF07B4B&tFNhA69 p )G 1  !%.2EJQU_dw{! $9>RWns\~ݬЬZЬ[ЬY-M$k-Ѭ0 ~hZݬ\֬ լ  ՘~HZ ݬ9׬ լ @(#)sh.c 4.2 3/11/81./usr/ucb/bin/usr/bina.outstatus0HOMEhomeUSERuserTERMtermPATHpathshell/bin/csh/tmp/shverboseechoargvprompt# % Switching to new tty driver... Warning: no access to tty; thus no job control in this shell... /.cshrc/.loginlogout Reverting to old tty driver... /.logoutjobsInterrupted%d? mailYou have %smail. new %s in %s. New mailMail@(#)sh.dol.c 4.2 5/3/81\'`"AmbiguousUnmatched %c '`" Word too long$< line too longNo file for $0Variable syntax-*Subscript out of rangehtrqxeBad : mod in $$\'`"<< terminator not found<<Line overflow$\`@(#)sh.err.c 4.1 10/9/80%s: @(#)sh.exec.c 4.1 10/9/80No match/Command not found/bin/sh%d hits, %d misses, %2d%% @(#)sh.exp.c 4.1 10/9/80||&&^=<>Divide by 0Mod by 0!~(Expression syntax{{ ... }Missing }erwxfdzoMissing file name+-*/%()!~^|&>>==!==~!~@(#)sh.func.c 4.5 81/06/19%job%job &Too few argumentsToo many argumentsCan't from terminalaliasunaliasToo dangerous to alias that/bin/login/bin/newgrp/usr/bin/newgrpNot login shellEmpty ifthenImproper thenSyntax errorNot in while/foreachInvalid variableWords not ()'eddefault'"then/endif not foundendsw not foundend not foundlabel not found-n%o Improper masknoraisecputimesecondsfilesizekbytesdatasizestacksizecoredumpsizememoryuseNo such limitLimits cannot be raised hoursminutesmegabytesunlimitedImproper or unknown scale factorBad scaling; did you mean ``%s''?%s %d %sCan't suspend a login shell (yet)@(#)sh.glob.c 4.2 3/11/81`{[*?noglobnonomatch{}Unknown user: %sMissing ]Arguments too longPathname too longUnmatched `` ... `Too many words from ``@(#)sh.hist.c 4.1 10/9/80history10-r%6d @(#)sh.lex.c 4.1 10/9/80# '`" ;&<>()| Unmatched "'` Expansion buf ovflo:^$*-%Bad ! formNo prev sub Bad substituteNo prev lhsRhs too longBad ! modifier: Modifier failedSubst buf ovflo-$*Bad ! arg selector(=~: \ }No prev search: Event not foundReset tty pgrp from %d to %d ignoreeof Use "logout" to logout. Use "exit" to leave csh. @(#)sh.misc.c 4.1 10/9/80i=%d, j=%d: Out of memory /usr/bill/cshcoreUndefined variable@(#)sh.parse.c 4.1 10/9/80Alias loop;& Too many )'sToo many ('s<>()Badly placed (Missing name for redirectAmbiguous output redirectCan't << within ()'sAmbiguous input redirectBadly placed ()'sInvalid null command@(#)sh.print.c 4.1 10/9/80%d.%d%d:%d%d@(#)sh.sem.c 4.1 10/9/80nicenohupNo more processes/dev/nullnoclobberCan't make pipe%s: File exists@(#)sh.set.c 4.1 10/9/80Missing )histcharsSubscript errorBadly formed numberNo more wordsWarning: ridiculously long PATH truncated @(#)sh.proc.c 4.6 (Berkeley) 81/05/03childnotify BUG: waiting for background job! BUG: process flushed twice( | ; << < >> > ...[%d] %d[%d]%s %c %5d %-21sRunning Exit %-16dDoneBUG: status=%-9o | (core dumped) (wd: (wd now: ) -lUsage: jobs [ -l ]%s Bad signal numberUnknown signal; kill -l lists signals%s: Already stopped Arguments should be jobs or process id's%s There are stopped jobs%%%+No current job%-%#No previous jobNo such jobNo job matches patternNo job control in this shellNo job control in subshells@(#)sh.dir.c 4.1 10/9/80dirsUsage: dirs [ -l ]~%sNo home directoryCan't change to home directory./../cdpathNo other directoryDirectory stack not that deepBad directoryDirectory stack emptycwd@(#)sh.time.c 4.1 10/9/80%Uu %Ss %E %P %X+%Dk %I+%Oio %Fpf+%Ww%d%%@(#)alloc.c 4.1 10/9/80assertion botched: %s allocp>=allocs && allocp<=alloctallock()q>p&&qalloctp>clearbusy(allocs[1].ptr)&&p<=alloctp->ptr > allocp && p->ptr <= alloct%6o %5d %s BUSYFREE%d used, %d free, %l end @(#)sh.init.c 4.1 10/9/80@allocbgbreakbreakswcasecdchdircontinueelseendendifendswevalexecexitfggotohashstatkillonintrpopdpushdrehashrepeatsetsetenvshiftsourcestopsuspendswitchumaskunhashunlimitunsetunsetenvwaitwhilelabelHUPHangupINTInterruptQUITQuitILLIllegal instructionTRAPTrace/BPT trapIOTIOT trapEMTEMT trapFPEFloating exceptionKILLKilledBUSBus errorSEGVSegmentation faultSYSBad system callPIPEBroken pipeALRMAlarm clockTerminatedSignal 16STOPStopped (signal)TSTPStoppedCONTContinuedCHLDChild exitedTTINStopped (tty input)TTOUStopped (tty output)TINTTty input interruptXCPUCputime limit exceededXFSZFilesize limit exceededSignal 26Signal 27Signal 28Signal 29Signal 30Signal 31Signal 32@(#)printf.c 4.1 10/9/80^Ь[Ь Ь\[PZY Y%ZZݭPP[QQ~8Y!cdefg+l-.o0123456789abcdef^U|YPPQPA2QM..._ekvvvvvvvvvPPs1PxzPu1Pr1TPP*1CP1(null)XPZPЌRR:PbQURQpPPoPxPdHPu1[~RS T RSTSVQЌPRSPQAVRe;0Tn n8 n;  ~Z0nݭQUUYPPZPPPQU1ilPP n4 n  n錪  nPUP^QZ1Z1ZZZZ IiY>IY HhX>HXZ1VXZZ1KЌXЌ\Ќ[10ZXXWWVWWWWPPnW3PWPP#VWP֭WP-WxWP@(RnVЭPPX'(AcխXVVVV()cXP%VVX8Wn 1GDeB+B+D.@0RVQPVPQ'խQRVPЎ((PR QPVPRPQQPRQPRPc0XZXXPPnX.PXPP֭XPP/XxXP@ZlxXPSPQXWQPQ`WWѭ+WPP!PЭWXWPPXWn4WníWX1XWPPXWn4WnWX(nVXP08Xn ׭n8ne QZ+Q; ?a1AZ11pUorUUUR>B€R R RZqPURRRRR dUR R8tPTUPUP  t|UPUP  PpPT~3SRRRRTRdcPSTRgPPRRT BCG@M [u+p^/֬Ь++h2+<+1JP+ 7+u+v.-_+z+FT+o+1+6+wP e[++TJ++AP /+!+,*****\*D<*PP12*PPl*f*/P TH*P [[K*[PPPZ*P[ZQPQJ`ZZ )P/K`[PP)PvQA`[)PK*K`ݬ PݬN_1ά%CP'4ݏݬ'0ЬPЬQQɏPQ0Ь[ЬZ[[  PK?)YZK6)ZZZZ Z9ZZ[ePZZ ZZZYKr)YPЬ[ЬZ[[  DPK(YZK(ZZ ZZZ[PZZ ZZZYK)YPЬ[[ [Ь[[  K(~ɏ[~Ь[[  K( yP~[LPݬ: Ь[K'ZljKH(~[ЬPЬ QլQP PQPЬ[Zj7݊[ PYYP Ь[ЬZk =ZPk=P//QP'P[kݬk P8[P/P ph [Ь[k:[kk[P42PP ݏ&P[[*[P[[*[xP[[P*[\P[[jP**~*[/P[[o*[P[[`*[ P[[Q*k [kk*PЬ[ZYk94 ZPQPQ0QZY[[kPP P P+P-k0YZPZPЬ [ЬY׬&k ЫP֫`P [PZZZ Z YPЬPQP% P! " PЬ[|XXPX 鑫+PPPYkw+ݏݬPZY1ZZ kalYPPPݬ PZ 4D\f(4FUet&2EError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too large@)[*LЬRPQbPЬ[[o~kЫ0   PSЬRUT TTT +T-TST|PT04T9/Q yPVyPPVPWQ0TTPQUSUTǑT.SVTeTE[TT+T-STT0T9V FfV>FVSVVVUUЏUUdЏdU}PP1RU#Q yPPRyPVVPWQRU=;Q yPPRyPPRQQVW{VQWPVW{ VPVPPVPRUQyPPRyPPPPnPVnQPdP`VPSrPPRpP~Ь[  P ݏP ի ߘP@" [X R P2PPݫ~yPkЫk!k    k1WP֫pPPR RR RP|Pp PrPP" ^ԭլݏP!|PݭpݭVխѭ¬ Э!:Pݬ`!+ЬP}V}X}Z}Э`PЬPЬQ}V}X}Z}\Ё^PP Ь[ZZZPݬݬݬ;Bݬ  ЬQPa#+QP^Ь[    PPYYX1XX߭~PYjT~P  BЫZ֫ZPѫPѬ ZPPXPZ~9PYZkn 1mЫZ3[h1xݏyPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~dPY PP[ [[[ Ь[Z = 8[ePZ~MPZ ݫ ԫ kZP Ь[ЬZkPkPzQQPPP^߭ݬPPP|l\PЬ[ЬZ[Y[YPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6< P~\S^\yPpЬ[PЬPЬRRQ{RPPR PRPPЭRBQP<PbPbMkPP!^.[s<Y71PU;P3k֫pN@pCaFpCJE@}oR@|1p|/...getwd: cannot open .. ..getwd: read error in .. getwd: read error in .. getwd: can't change back /etc/passwdrrUnknown error: #hbin/diff 755 0 12 46000 2532077122 5456 @^Юn PPՀPpPP? P:@WG@TG_GЬeGGE.׬Ѭ1nЬP`P`-ЬP`[׬11PS11PD1Fϓ?FϷF[F{jϩFcϪF\[Ͻ$PF[kP@ϼDkS?REu$HV?[%1Pc1nSFkP@DtFk1,PPh1Fk?D$[(F1[FPb1T[[>D#ϽPf1)PeEPrPlϹE1fPsϱE1VѬϩ>dDχ#Z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    PPYYX1XX߭~PYj ~P  BЫZ֫ZPѫPѬ ZPPXPZ~qPYZkn 1mЫZ3[DF1xݏPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP [ [[[  Ь[Z = 8[ePZ~uPZ ݫ ԫ kZP{ Ь[Zk[ZZP Ь[ЬZkPkPzQQPPP^߭ݬPPP|lPЬ[ЬZ[Y[YPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6 PЬPЬRRQ{RPRPPPRRP.XX|mp~*PYY[^k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [XP YPƏPxPbPZxPZPPZx~@PZZZPZPxPZPPjjXw1xYP[PdZ]UXkIBk[P Ь[[ZZZ)jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j~\S^\wP[ЬPЬPЬRRQ{RPPR PRPPլQPyP@(#)diff.c 4.1 10/9/80/bin/diff/usr/lib/diffh/usr/bin/prFILE1FILE2diff: -c: bad count diff: use -Sstart diff: -%s: unknown option diff: two filename arguments required diff: -h doesn't support -e, -f, -c, or -I -diff: -diff: diff: ran out of memory diff: files too big, try -h @CfCiClCdiff: can't specify -I with directories diff: warning: shouldn't give -s or -l with -e diff - : %.*s : %.*s Only in %.*sOnly in %.*sCommon identical filesBinary files which differCommon subdirectories diff: ran out of memory : Only in %.*s %.*s diff: diff: ran out of memory diff: Common subdirectories: %s and %s Files %s and %s are identical Binary files %s and %s differ ed - %.*s << '-*-END-*-' %s%s %s w q -*-END-*- %s %sNo more processesdiff: No more processes @(#)diffdir.c 4.5 (Berkeley) 81/02/28pr-h-f@(#)diffreg.c 4.1 10/9/80diffhdiff: --diff: can't specify - - -No differences encountered /tmp/dXXXXXdiff: diff: -diff: can't specify - with other arg directory %s/%srdiff: rrrr*** %s %s--- %s %s*************** *** , ! - --- , ----- ! + ,, < --- > . #endif %s %d%s%d#else %s%s !#ifnd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,; :ܒX^Ь[    PPYYX1XX߭~PYj0~P  BЫZ֫ZPѫPѬ ZPPXPZ~YPYZkn 1mЫZ3[8=1xݏCPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬP((Ь[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP [ [[[  Ь[Z = 8[ePZ~PZ ݫ ԫ kZP{P[P[P[P/[PZ[ZZ> PXYX/P[Y[ZuPX\YPXO`&[[ݬP1yk  k>&P[W[ Ь[Zk[ZZP Ь[ЬZkPkPzQQP^ݬPP߭ݬP rmail: cannot reopen %s for reading wmail: cannot open %s Mail saved in %s researcresearchnull name mail: can't create proc for remote %s %suux - %s!rmail \(%s\)uux - %s!rmail %sw/bin/mailUsage: mail [ -f ] people . . . mail: can't send to %s /amail: cannot append to %s /dev/mail%s@%d amnesiavaxvax.lock/usr/spool/mail/tmXXXXXXM:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/etc/utmp/etc/passwdrr/Unknown error: #/bin/shsh-c/bin/shsh-cNNh>/etc/ttys/dev/4Xbin/make 755 0 12 52474 2532124014 5470 xD;^Юn PPՀPpPPG Ph@^HԭlX~HP@VX֭䕽uHP@8X֭䕽 X2ЭP@%@P`-ЭP@`PЭP@֭ѭHHW1XЭP@1H@P`-ЭP@PЭQA`1PPS!DDDDDDDDDDDDDDDDeDDDDDDDnw8G2GGE֭1xFFFFFFFFFFPѭP FP@PP@FP@֭1PЭP@֭ѭ1խFxP FgF FU PFF> PEF& P[ЫEEFT*2PtE2PdEԭMЭP@>ݭ P[ ݭ P[֭߭[E ֭ѭխ:DE^#߭DD <^D`DXDPEР<ݭP.ݭWP ݭEPS])ݭ+=iT aT=fES+)2<HEs PY3Щ[)ЫZЪPݠݬ <PPjZZk[[PC ݬ0C ݬ0^CPCPC ADݬ;P5RPDݬ*PPЬSSSP YD S S:P^լ=AD,B!ЭPݠРP~.D,нխB D,zBЭPݠݠD{,нխGB1ЭPݠCR,ЭPՠ C<,լЭP ~C ,ѭA C ,ЭPР~ЭPР6C+"ЭPՠРPݠC+нխЭPР-fC+ЭPݠ]C+нխнխ1zнխ11C^+8P8p^Ь[Լ P3A ݬݫ!C"+OS8 PЫ  PPPPԭԭԭԭݫS Pԭԭ pЫYЩZjZ\ЭZZiYYЫY1KԭЩZb߭~ݪ1Ps@ݭЪPݠlB^*ѭЭѭЪPݠp PpjZZ PP1թ1ѭխխթ@@ݫAp PAp?ݩPAЭ?E P3թ"խݫA^Nk$ЩѭЭiYY1$?YY1gЩ1ЭPРPРxxݫP1v͐;AhP >1AЭPР1(ЭPРPРt|xt'PP1XtPP߭~ݭPѭЭPݠp( PpA>ݭЭPݠq@,(ѭЭb@X>PJ@ЭPРнխ ЭPРխ1Iѭ խխխ3ЭP4нԭխ1нխ1нحխ1ViY1A1 Pݫ?[phP?AխݭݭAP}խ Ppv?P0ݫi?ЭPРխ?ЭPРн<ݫ3?&֭ݫ9?E?<ݫ PD>P7խլ ݫ?<լխݫ?M&_<լV<PPP<4խPPP ѭЭЭЭ ЭPH^ <;P;1>Р;ݭ>%;ݭ-֭-瑽@ݭݭݭQPխd;Pмլ1WHЬPݠ:D;ԭH Ь[kP;Cլ :6[: =P;PP=$I1:ݬ[ PZJxZP xZ~v=Z~=$լ==h$BI1ZP ^Ь[ЫPРЭZP*P?P[ PPkݭPPkԫZЬYiPPZYiǏZPďPPZZ[0KUPݠݬ1P [PǏPQďQQP[KT[PݬxPPcP^<P<P <9P[$9kݬwPԫ  ԫ[88ЬP`. P&P[8ݬ@2T[[P /P֬PЬ[[e%P~:PYYZ <YPЬ[ЬZЬ YYiЬ P^Ь[ЬZЬ Y[Zí[PíZQPQ Z{zP֭ѭ[iP Ь[[PZZPj;c^Ь[ЬZd#; P;;[}j ;ZPl}PP[k  kkk k[kk[i߭fPՠZݠePZЭP k1|k$[k1zk$1rޭYk(k{k(1`)P1^^ݬPPP 1ЭPЬЭPF ЭP ff:ݬ.PRT:ݬ.P>B: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FFIXESNo suffix list. No arguments or description file@ *** %s removed. .PRECIOUS-rDescription file errorOpen directories: %d: %s Macros: %s = %s %s: done=%d (MAIN NAME) depends on: %s commands: %s @(#)main.c 4.1 (Berkeley) 81/02/28Kdoname(%s,%d) TIME(%s)=%ld @?@Too many command lines for `%s' *TIME(%s)=%ld *<@?.DEFAULT<Don't know how to make %s Don't know how to make %s@`%s' not remade because of errors `%s' is up to date. @touch(%s) %s%s *** Error code %d*** Termination code %d (ignored) @(#)doname.c 4.1 (Berkeley) 81/02/28LHash table overflowout of memoryout of memoryinfinitely recursive macro?@*<?Warning: %s changed after being used Make: %s. Stop. Stop. line %d: %s$? list too long @(#)misc.c 4.1 (Berkeley) 81/02/28dNNNNNNNNNO OOO O'O/O6O>OFOQOXOoOvOOOOOOOOOP.P:PIPPPgPPPPPPPPPPQ-Q:QJQQQgQvQ}QQQQQQQQQR;RRRRRRRRRRSAS}./rDirectory %s: Cannot openaUser %s, %s rcannot open %s! %s is not an archive%s is not an object module@(#)files.c 4.2 (Berkeley) 81/02/28.SUFFIXES : .out .o .c .f .e .r .y .yr .ye .l .s .cl .pYACC=yaccYACCR=yacc -rYACCE=yacc -eYFLAGS=LEX=lexLFLAGS=CC=ccAS=asPC=pcPFLAGS=CFLAGS=RC=f77RFLAGS=FC=f77EFLAGS=FFLAGS=LOADLIBES=.c.o : $(CC) $(CFLAGS) -c $<.p.o : $(PC) $(PFLAGS) -c $<.cl.o : class -c $<.e.o .r.o .f.o : $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $<.s.o : $(AS) -o $@ $<.y.o : $(YACC) $(YFLAGS) $< $(CC) $(CFLAGS) -c y.tab.c rm y.tab.c mv y.tab.o $@.yr.o: $(YACCR) $(YFLAGS) $< $(RC) $(RFLAGS) -c y.tab.r rm y.tab.r mv y.tab.o $@.ye.o : $(YACCE) $(YFLAGS) $< $(EC) $(RFLAGS) -c y.tab.e rm y.tab.e mv y.tab.o $@.l.o : $(LEX) $(LFLAGS) $< $(CC) $(CFLAGS) -c lex.yy.c rm lex.yy.c mv lex.yy.o $@.y.c : $(YACC) $(YFLAGS) $< mv y.tab.c $@.l.c : $(LEX) $(LFLAGS) $< mv lex.yy.c $@.yr.r: $(YACCR) $(YFLAGS) $< mv y.tab.r $@.ye.e : $(YACCE) $(YFLAGS) $< mv y.tab.e $@.s.out .c.out .o.out : $(CC) $(CFLAGS) $< $(LOADLIBES) -o $@.f.out .r.out .e.out : $(FC) $(EFLAGS) $(RFLAGS) $(FFLAGS) $< $(LOADLIBES) -o $@ -rm $*.o.y.out : $(YACC) $(YFLAGS) $< $(CC) $(CFLAGS) y.tab.c $(LOADLIBES) -ly -o $@ rm y.tab.c.l.out : $(LEX) $(LFLAGS) $< $(CC) $(CFLAGS) lex.yy.c $(LOADLIBES) -ll -o $@ rm lex.yy.cS/bin/shsh-c-ceCouldn't load Shellbad wait codeCannot load %stouch: file %s does not exist. Cannot touch %s @(#)dosys.c 4.1 (Berkeley) 81/02/28U        Bad character %c (octal %o), line %dline too longyacc stack overflowsyntax errorInconsistent rules lines for `%s' Multiple rules lines for `%s' .SUFFIXESToo many lefts%dMust be a separator on rules line %s@(#)gram.y 4.1 (Berkeley) 81/02/28M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/bin/shPATH:/bin:/usr/binsh/etc/passwdrr  AAAAAABBBBBB __Xp/shPATH:/bin:/usr/binsh/etc/passwdrr  AAAAAABBBBBB __bin/mv 4755 0 12 24000 2532125216 5206 ^Юn PPՀPpPP PЬ[Ѭ|Ѭ-׬[kXJѬ\Ϝ ݫP[<ϐ PʏPP@ZѬ1ݫݫbPi\XhhPPfJ^Ͽݫ6ϭPPϵѬ*+ P@k.P< PʏPP@YZP@kJkPYZPZPYP ^ϰݬP#ݬq b P<ρPʏPP@ψݬϐP1ݬݬP ݬL1oP ,^ݬ%P1<PʏPP@#ݬ%ϦQ %ϗBPݬ^PTݬ߭ޭ ߭ݬP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# BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[1xݏ;PZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~HPY PPh [ [[[  Ь[Z = 8[ePZ~YPZ ݫ ԫ kZP{ Ь[ЬZkPkPzQQPP^߭ݬxPPPdTPЬ[ЬZ[Y[YPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6 P.))~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZf [)PXYPƏPxP?bPZx,PZPPZx~@PZZZPZPxPZPPjj)1xYP[PZkk[P Ь[[ZZZujPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j~\S^\wP[ЬPЬPЬRRQ{RPPR PRPPլQPPmv: cannot access %s usage: mv [-if] f1 f2; or mv [-if] d1 d2; or mv [-if] f1 ... fn d1 mv: cannot access %s mv: directory rename only %s/%smv: %s is a directory remove %s? mv: %s and %s are identical override protection %o for %s? mv: cannot unlink %s mv: try again /bin/cpcpmv: cannot exec cp mv: cannot unlink %s mv: %s exists mv :target name too long /mv: %s exists mv: ?? source == target, source exists and target doesnt ...mv: cannot rename %s mv: cannot locate parent mv: no write access to %s mv: no write access to %s mv: cannot move directories across devices mv: Sorry, path names including %s aren't allowed ..mv: cannot link %s to %s mv: %s: cannot unlink /..mv: %s: cannot unlink mv: cannot link %s to %s mv: cannot link %s and %s mv: ?? cannot unlink %s .mv: cannot access %s mv: cannot move a directory into itself ..mv: name too long /...../@(#)mv.c 4.4 (Berkeley) 81/04/26H%H%!)bin/od 755 0 12 22000 2552577272 5157 (^Юn PPՀPpPP P^) YѬ1м[k-k1PPhF1PXc{PHXePDEYLYE:Y0Y&YY  POPc PbPd1wPwPo1n1]Px1s1N׬ϐ ύτѬ;мP`+2ϑݼϕPݼπύN׬ѬݼϓX3Y IIEYYP24QPQX DϽXZq2PPP~ϪPZOXZPP~ϐm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8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~QPYjL ~P g _  BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[h1xݏPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP[ [[[  Ь[Z = 8[ePZ~YPZ ݫ[ ԫ kZP{ Ь[ЬZkPkPzQQP`P^߭ݬTPPP0 Pݬݏ tݬݬݏtݬ6 P ."" ~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ ["PYPƏPxP{bPZxhPZPPZxX~@PZZZ5.PZP!x"PZPPjj "1xYP[PZkk[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j~\S^\wP[ЬoPЬPЬRRQ{RPPR PRPPլQP!P8rm: unknown option %s ..rm: cannot remove `..' rm: %s nonexistent %s not changed remove directory %s? rm: cannot read %s? %s/%.14srm: %s directory rm: remove %s? rm: override protection %o for %s? rm: %s not removed rm: remove %s? /bin/rmdirrmdir/usr/bin/rmdirrmdirrm: can't find rmdir @(#)rm.c 4.3 (Berkeley) 1/4/81#bin/rmdir 4755 0 12 16000 2532141423 5700 ^Юn PPՀPpPP P Ѭ%ϫ` ЬP`׬ϖPPP6 ΰ^ݬ ϐPQQPPѭP ׭// P֭9ݭ P+ݭ P%W)D P PϧϯX Pwϱ" ω PQQPͰݰf ϽPQQPͰݰB PjYa<ϫ `PQP1hQPQQPͰݰ1ݬ \~ݬЬP PP!\ Ь[ZZZP  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOP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efghijklmnopqrstuvwxyz{|}~T7RBdݭRNP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R\tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~PYj ~P wo BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[!1xݏPZZ  YYX ZYYXZYZ~(PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PPt[ [[[  Ь[Z = 8[ePZ~9PZ ݫ ԫ kZP{(P^߭ݬDPPPݬݏ tݬݬݏtݬ6D.767.(+~*PY[ k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [7PYPƏPxPbPZxPZPPZx|~@PZZZYRPZPExFPZPPjj/7#1xYP[PZ kk[P Ь[[ZZZjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP5@jx~\S^\_]PTCЬ?PЬPЬRRQ{RPPR PRPPPP((!usage: mkfs filsys proto/size [ m n ] %s: cannot create %s: cannot open r%s: cannot open isize = %D d--777 0 0 $ %s: cannot open init m/n = %d %d %ld/%ld: bad ratio -bcd-u-g%c/%s: bad octal mode digit %s: cannot open ...%c/%s: bad mode %s: bad number EOF read error: %ld write error: %D out of free space indirect block full too many bad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<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~1PYjP ~P  BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[41xݏPZZ  YYX ZYYXZYZ~`PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~PY PP [ [[[  Ь[Z = 8[ePZ~9PZ ݫS ԫ kZP{`P^߭ݬDPPP0 ݬݏ tݬݬݏtݬ6 PЬPЬRRQ{RPRPPPRRP.**qt~*PY][bk$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ [*PYPƏPxPbPZxPZPPZx~@PZZZPZPxPZPPjj*{1xYP[PhZaY\kMFk[P Ь[[ZZZ-jPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@j ~\S^\_ P CЬ{ PЬPЬRRQ{RPPR PRPPPP4/dev/rmt80rstXXXXXX Usage: restor x file file..., restor r filesys, or restor t Bad key character %c restor: %s - cannot create directory temporary %s: cannot open tape Tape is not a dump tape Dump date: %sDumped from: %sTape is not a dump tape Tape is not volume 1 of the dump %s: not on the tape %s: inode %u Mount desired tape volume: Specify volume #: Volume numbers are positive numerics tape is not dump tape Wrong volume (%d) Can't find inode mask! end of tape extract file %u %u%s: cannot create file %s: cannot open Enter starting volume number: Last chance before scribbling on %s. Missing volume record Tape is not volume %d Missing header block End of tape Unknown header type Resynced at inode %u %u: ilist too small Can't find directory header! /Missing address (header) block Tape read error: inode %u Mount volume %d Cannot open tape! Not a dump tape.Try again Wrong tape. Try again /disk write error %ld read error %ld Out of space. Checksum error %o @(#)restor.c 4.3 (Berkeley) 6/3/81M:/Day Mon 00 00:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/|"|"6*sys/ 755 0 12 0 2632233641 4562 sys/GENERIC/ 775 0 33 0 2732201360 5635 sys/GENERIC/ioconf.c 664 0 33 11054 2632234011 7362 #include "../h/param.h" #include "../h/pte.h" #include "../h/buf.h" #include "../h/map.h" #include "../h/mbavar.h" #include "../h/vm.h" #include "../h/ubavar.h" #define C (caddr_t) extern struct mba_driver hpdriver; extern struct mba_driver hpdriver; extern struct mba_driver hpdriver; extern struct mba_driver hpdriver; extern struct mba_driver htdriver; extern struct mba_driver mtdriver; struct mba_device mbdinit[] = { /* Device, Unit, Mba, Drive, Dk */ { &hpdriver, 0, '?', 0, 1 }, { &hpdriver, 1, '?', '?', 1 }, { &hpdriver, 2, '?', '?', 1 }, { &hpdriver, 3, '?', '?', 1 }, { &htdriver, 0, '?', '?', 0 }, { &mtdriver, 0, '?', '?', 0 }, 0 }; struct mba_slave mbsinit [] = { /* Driver, Ctlr, Unit, Slave */ { &htdriver, 0, 0, 0 }, { &htdriver, 0, 1, 1 }, { &mtdriver, 0, 0, 0 }, { &mtdriver, 0, 1, 1 }, 0 }; extern struct uba_driver hkdriver; extern Xrkintr0(); int (*hkint0[])() = { Xrkintr0, 0 } ; extern struct uba_driver lpdriver; extern Xlpintr0(); int (*lpint0[])() = { Xlpintr0, 0 } ; extern struct uba_driver tmdriver; extern Xtmintr0(); int (*tmint0[])() = { Xtmintr0, 0 } ; extern struct uba_driver scdriver; extern Xupintr0(); int (*scint0[])() = { Xupintr0, 0 } ; extern struct uba_driver udadriver; extern Xudintr0(); int (*udaint0[])() = { Xudintr0, 0 } ; extern struct uba_driver dndriver; extern Xdnintr0(); int (*dnint0[])() = { Xdnintr0, 0 } ; extern struct uba_driver dhdriver; extern Xdhrint0(), Xdhxint0(); int (*dhint0[])() = { Xdhrint0, Xdhxint0, 0 } ; extern struct uba_driver dhdriver; extern Xdhrint1(), Xdhxint1(); int (*dhint1[])() = { Xdhrint1, Xdhxint1, 0 } ; extern struct uba_driver dzdriver; extern Xdzrint0(), Xdzxint0(); int (*dzint0[])() = { Xdzrint0, Xdzxint0, 0 } ; extern struct uba_driver dzdriver; extern Xdzrint1(), Xdzxint1(); int (*dzint1[])() = { Xdzrint1, Xdzxint1, 0 } ; extern struct uba_driver dzdriver; extern Xdzrint2(), Xdzxint2(); int (*dzint2[])() = { Xdzrint2, Xdzxint2, 0 } ; extern struct ((uba_driver dzdriver; extern Xdzrint3(), Xdzxint3(); int (*dzint3[])() = { Xdzrint3, Xdzxint3, 0 } ; extern struct uba_driver dzdriver; extern Xdzrint4(), Xdzxint4(); int (*dzint4[])() = { Xdzrint4, Xdzxint4, 0 } ; extern struct uba_driver dzdriver; extern Xdzrint5(), Xdzxint5(); int (*dzint5[])() = { Xdzrint5, Xdzxint5, 0 } ; extern struct uba_driver dzdriver; extern Xdzrint6(), Xdzxint6(); int (*dzint6[])() = { Xdzrint6, Xdzxint6, 0 } ; extern struct uba_driver dzdriver; extern Xdzrint7(), Xdzxint7(); int (*dzint7[])() = { Xdzrint7, Xdzxint7, 0 } ; extern struct uba_driver zsdriver; extern Xtsintr0(); int (*zsint0[])() = { Xtsintr0, 0 } ; struct uba_ctlr ubminit[] = { /* driver, ctlr, ubanum, alive, intr, addr */ { &hkdriver, 0, '?', 0, hkint0, C 0177440 }, { &tmdriver, 0, '?', 0, tmint0, C 0172520 }, { &scdriver, 0, '?', 0, scint0, C 0176700 }, { &udadriver, 0, '?', 0, udaint0, C 0177550 }, { &zsdriver, 0, '?', 0, zsint0, C 0172520 }, 0 }; struct uba_device ubdinit[] = { /* driver, unit, ctlr, ubanum, slave, intr, addr, dk, flags*/ { &hkdriver, 0, 0, '?', 0, 0, C 00 , 1, 0x0 }, { &hkdriver, 1, 0, '?', 1, 0, C 00 , 1, 0x0 }, { &lpdriver, 0, -1, '?', -1, lpint0, C 0177514, 0, 0x0 }, { &tmdriver, 0, 0, '?', 0, 0, C 00 , 0, 0x0 }, { &tmdriver, 1, 0, '?', 1, 0, C 00 , 0, 0x0 }, { &scdriver, 0, 0, '?', 0, 0, C 00 , 1, 0x0 }, { &scdriver, 1, 0, '?', 1, 0, C 00 , 1, 0x0 }, { &udadriver, 0, 0, '?', 0, 0, C 00 , 1, 0x0 }, { &udadriver, 1, 0, '?', 1, 0, C 00 , 1, 0x0 }, { &dndriver, 0, -1, '?', -1, dnint0, C 0160020, 0, 0x0 }, { &dhdriver, 0, -1, '?', -1, dhint0, C 0160020, 0, 0x0 }, { &dhdriver, 1, -1, '?', -1, dhint1, C 0160040, 0, 0x0 }, { &dzdriver, 0, -1, '?', -1, dzint0, C 0160100, 0, 0xff }, { &dzdriver, 1, -1, '?', -1, dzint1, C 0160110, 0, 0xff }, { &dzdriver, 2, -1, '?', -1, dzint2, C 0160120, 0, 0xff }, { &dzdriver, 3, -1, '?', -1, dzint3, C 0160130, 0, 0xff }, { &dzdriver, 4, -1, '?', -1, dzint4, C 0160140, 0, 0xff }, { &dzdriver, 5, -1, '?', -1, dzint5, C 0160150, 0, 0xff }, { &dzdriver, 6, -1, '?', -1, dzint6, C 0160160, 0, 0xff }, { &dzdriver, 7, -1, '?', -1, dzint7, C 0160170, 0, 0xff }, { &zsdriver, 0, 0, '?', 0, 0, C 00 , 0, 0x0 }, 0 }; dzdriver, 2, -1, '?', -1, dzint2, C 0160120, 0, 0xff }, { &dzdriver, 3, -1, '?', -1, dzint3, C 0160130, 0, 0xff }, { &dzdriver, 4, -1, '?', -1, dzint4, C 0160140, 0, 0xff }, { &dzdriver, 5, -1, '?', -1, dzint5, C 0160150, 0, 0xff }, { &dzdriver, 6, -1, '?', -1, dzint6, C 0160160, 0, 0xff }, { &dzdriver, 7, -1, '?', -1, dzint7, C 0160170, 0, 0xff }, { &zsdriver, 0, 0, '?', sys/GENERIC/ubglue.s 664 0 33 4656 2632234012 7403 .globl _Xrkintr0 .align 2 _Xrkintr0: pushr $0x3f pushl $0 calls $1,_rkintr popr $0x3f rei .globl _Xlpintr0 .align 2 _Xlpintr0: pushr $0x3f pushl $0 calls $1,_lpintr popr $0x3f rei .globl _Xtmintr0 .align 2 _Xtmintr0: pushr $0x3f pushl $0 calls $1,_tmintr popr $0x3f rei .globl _Xupintr0 .align 2 _Xupintr0: pushr $0x3f pushl $0 calls $1,_upintr popr $0x3f rei .globl _Xudintr0 .align 2 _Xudintr0: pushr $0x3f pushl $0 calls $1,_udintr popr $0x3f rei .globl _Xdnintr0 .align 2 _Xdnintr0: pushr $0x3f pushl $0 calls $1,_dnintr popr $0x3f rei .globl _Xdhrint0 .align 2 _Xdhrint0: pushr $0x3f pushl $0 calls $1,_dhrint popr $0x3f rei .globl _Xdhxint0 .align 2 _Xdhxint0: pushr $0x3f pushl $0 calls $1,_dhxint popr $0x3f rei .globl _Xdhrint1 .align 2 _Xdhrint1: pushr $0x3f pushl $1 calls $1,_dhrint popr $0x3f rei .globl _Xdhxint1 .align 2 _Xdhxint1: pushr $0x3f pushl $1 calls $1,_dhxint popr $0x3f rei .globl _Xdzrint0 .align 2 _Xdzrint0: pushr $0x3f pushl $0 calls $1,_dzrint popr $0x3f rei .globl _Xdzxint0 .align 2 _Xdzxint0: pushr $0x3f movl $0,r0 jbr _dzdma .globl _Xdzrint1 .align 2 _Xdzrint1: pushr $0x3f pushl $1 calls $1,_dzrint popr $0x3f rei .globl _Xdzxint1 .align 2 _Xdzxint1: pushr $0x3f movl $1,r0 jbr _dzdma .globl _Xdzrint2 .align 2 _Xdzrint2: pushr $0x3f pushl $2 calls $1,_dzrint popr $0x3f rei .globl _Xdzxint2 .align 2 _Xdzxint2: pushr $0x3f movl $2,r0 jbr _dzdma .globl _Xdzrint3 .align 2 _Xdzrint3: pushr $0x3f pushl $3 calls $1,_dzrint popr $0x3f rei .globl _Xdzxint3 .align 2 _Xdzxint3: pushr $0x3f movl $3,r0 jbr _dzdma .globl _Xdzrint4 .align 2 _Xdzrint4: pushr $0x3f pushl $4 calls $1,_dzrint popr $0x3f rei .globl _Xdzxint4 .align 2 _Xdzxint4: pushr $0x3f movl $4,r0 jbr _dzdma .globl _Xdzrint5 .align 2 _Xdzrint5: pushr $0x3f pushl $5 calls $1,_dzrint popr $0x3f rei .globl _Xdzxint5 .align 2 _Xdzxint5: pushr $0x3f movl $5,r0 jbr _dzdma .globl _Xdzrint6 .align 2 _Xdzrint6: pushr $0x3f pushl $6 calls $1,_dzrint popr $0x3f rei .globl _Xdzxint6 .align 2 _Xdzxint6: pushr $0x3f movl $6,r0 jbr _dzdma .globl _Xdzrint7 .align 2 _Xdzrint7: pushr $0x3f pushl $7 calls $1,_dzrint popr $0x3f rei .globl _Xdzxint7 .align 2 _Xdzxint7: pushr $0x3f movl $7,r0 jbr _dzdma .globl _Xtsintr0 .align 2 _Xtsintr0: pushr $0x3f pushl $0 calls $1,_tsintr popr $0x3f rei int5 .align 2 _Xdzxint5: pushr $0x3f movl $5,r0 jbr _dzdma .globl _Xdzrint6 sys/GENERIC/makefile 664 0 33 63474 2650362151 7465 IDENT=-DGENERIC -DVAX7ZZ -DVAX750 -DVAX780 PARAM=-DHZ=60 -DTIMEZONE=0 -DDST=0 -DMAXUSERS=8 # # Makefile for Berkeley Virtual Vax/Unix, February 1981 # # This makefile is constructed from a machine description: # config machine # Most changes should be made in the machine description # /usr/sys/conf/``machineid'' # after which you should do # config machineid # Generic makefile changes should be made in # /usr/sys/conf/makefile # after which config should be rerun for all machines. # # N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE # IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING # # -DINSECURE old style non-vanishing suid bits # -DUNFAST don't compile in inline expansions and speedups # -DPGINPROF gather statistics about pagein/pageout activity # -DDISKMON monitor disk cacheing activity (bio.c) # -DINTRLVE compile in code for file systems interleaved across drives # -DTRACE compile in kernel tracing hooks # C2= /lib/c2 COPTS= ${IDENT} -DKERNEL -DVMUNIX CFLAGS= -O ${COPTS} AHEADS= ../h/pcb.m OBJS=acct.o alloc.o calloc.o clock.o fio.o iget.o ioctl.o machdep.o \ main.o nami.o partab.o pipe.o prf.o prim.o rdwri.o rmap.o sig.o \ slp.o subr.o sys.o sys1.o sys2.o sys3.o sys4.o sysent.o text.o \ trap.o vmdrum.o vmmem.o vmmon.o vmpage.o vmproc.o vmpt.o \ vmsched.o vmsubr.o vmswap.o vmsys.o udiv.o urem.o autoconf.o \ bio.o conf.o cons.o dh.o dkbad.o dkleave.o dn.o dsort.o dz.o \ flp.o hp.o ht.o lp.o mba.o mem.o mx1.o mx2.o mt.o rk.o sw.o tm.o \ ts.o tty.o ttynew.o ttyold.o tu.o uba.o uda.o up.o vaxcpu.o CFILES=../sys/acct.c ../sys/alloc.c ../sys/calloc.c ../sys/clock.c \ ../sys/fio.c ../sys/iget.c ../sys/ioctl.c ../sys/machdep.c \ ../sys/main.c ../sys/nami.c ../sys/partab.c ../sys/pipe.c \ ../sys/prf.c ../sys/prim.c ../sys/rdwri.c ../sys/rmap.c \ ../sys/sig.c ../sys/slp.c ../sys/subr.c ../sys/sys.c \ ../sys/sys1.c ../sys/sys2.c ../sys/sys3.c ../sys/sys4.c \ ../sys/sysent.c ../sys/text.c ../sys/trap.c ../sys/vmdrum.c \ ../sys/vmmem.c ../sys/vmmon.c ../sys/vmpage.c ../sys/vmproc.c \ ../sys/vmpt.c ../sys/vmsched.c ../sys/vmsubr.c ../sys/vmswap.c \ ../sys/vmsys.c ../dev/autoconf.c ../dev/bio.c ../dev/conf.c \ ../dev/cons.c ../dev/dh.c ../dev/dkbad.c ../dev/dkleave.c \ ../dev/dn.c ../dev/dsort.c ../dev/dz.c ../dev/flp.c ../dev/hp.c \ ../dev/ht.c ../dev/lp.c ../dev/mba.c ../dev/mem.c ../dev/mx1.c \ ../dev/mx2.c ../dev/mt.c ../dev/rk.c ../dev/sw.c ../dev/tm.c \ ../dev/ts.c ../dev/tty.c ../dev/ttynew.c ../dev/ttyold.c \ ../dev/tu.c ../dev/uba.c ../dev/uda.c ../dev/up.c \ ../dev/vaxcpu.c vmunix: makefile locore.o ${OBJS} ioconf.o param.o swapgeneric.o @echo loading vmunix @rm -f vmunix @sh ../conf/newvers.sh @cc $(CFLAGS) -c vers.c @ld -n -o vmunix -e start -x -T 80000000 locore.o ${OBJS} vers.o ioconf.o param.o swapgeneric.o @echo rearranging symbols @-symorder ../sys/symbols.sort vmunix @size vmunix @chmod 755 vmunix swapgeneric.o: ../dev/swapgeneric.c ${CC} -I. -c -S ${COPTS} ../dev/swapgeneric.c ${C2} swapgeneric.s | sed -f ../sys/asm.sed | ${AS} -o swapgeneric.o rm -f swapgeneric.s all: vmunix clean: rm -f eddep *vmunix* tags *.o locore.i [a-tv-z]*.s touch errs linterrs lint: /tmp @lint -hbxn -I. -DGENERIC ${COPTS} ../sys/Locore.c \ ${CFILES} ../dev/swapgeneric.c ioconf.c | \ grep -v 'struct/union .* never defined' | \ grep -v 'possible pointer alignment problem' ../sys/symbols.sort: ../sys/symbols.raw grep -v '^#' ../sys/symbols.raw \ | sed 's/^ //' | sort | uniq > ../sys/symbols.sort locore.o: assym.s ${AHEADS} ../sys/scb.s .((./sys/locore.s ubglue.s \ ../h/mtpr.h ../h/trap.h ../h/psl.h ../h/pte.h ../h/cpu.h ../h/mtpr.h mba.h cat assym.s ../sys/scb.s ../sys/locore.s ubglue.s > locore.c cc -E -DLOCORE ${COPTS} locore.c > locore.i @echo 'as -o locore.o $${AHEADS} locore.i' @as -o locore.o ${AHEADS} locore.i @rm locore.i # the following is necessary because autoconf.o depends on #if GENERIC autoconf.o: makefile # the following are necessary because the files depend on the types of # vax cpu's included in the system configuration clock.o machdep.o autoconf.o conf.o cons.o flp.o mba.o uba.o vaxcpu.o : makefile assym.s: ../h/param.h ../h/pte.h ../h/buf.h ../h/vmparam.h ../h/vmmeter.h \ ../h/dir.h ../h/cmap.h ../h/map.h ../h/ubavar.h ../h/proc.h cc ${IDENT} ../conf/genassym.c; ./a.out >assym.s; rm -f a.out ../h/param.h: /usr/include/signal.h touch ./touch ../h/param.h ../h/tty.h: /usr/include/sgtty.h ../h/ioctl.h touch ./touch ../h/tty.h ../h/user.h: ../h/pcb.h ../h/dmap.h ../h/vtimes.h ../h/types.h \ /usr/include/errno.h touch ./touch ../h/user.h ../h/vm.h: ../h/vmmac.h ../h/vmmeter.h ../h/vmparam.h ../h/vmsystm.h touch ./touch ../h/vm.h ../sys/sysent.c: ../sys/vmsysent.c touch ./touch ../sys/sysent.c touch: ../conf/touch.c cc ../conf/touch.c -o touch depend: grep '^#include' ${CFILES} | grep -v '<' | \ sed 's/:[^"]*"\([^"]*\)".*/: \1/' | \ sed 's/\.c/.o/' | sed 's,../[a-z]*/,,' | \ awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \ else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \ else rec = rec " " $$2 } } \ END { print rec } ' > makedep echo '$$r makedep' >>eddep echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep echo '$$r makedep' >>eddep echo 'w' >>eddep cp makefile makefile.bak ed - makefile < eddep rm eddep makedep tags: /usr/ucb/ctags ${CFILES} print: @pr -f makefile ../sys/TODO linterrs @/usr/ucb/ctags -x ${CFILES} | pr -f -h XREF @(size vmunix *.o) | pr -f -h sizes @ls -ls | pr -f @cd ../h; ls -ls | pr -f ; pr -f *.m *.h @cd ../sys; pr -f asm.sed Locore.c scb.s locore.s @pr -f ${CFILES} ioconf.o: ioconf.c ../h/param.h ../h/pte.h ../h/buf.h ../h/map.h \ ../h/mbavar.h ../h/vm.h ../h/ubavar.h ${CC} -I. -c -S ${COPTS} ioconf.c ${C2} ioconf.s | sed -f ../sys/asm.sed | ${AS} -o ioconf.o rm -f ioconf.s param.c: ../sys/param.c cp ../sys/param.c . param.o: param.c makefile ${CC} -c -O ${IDENT} ${PARAM} param.c acct.o: ../sys/acct.c ${CC} -I. -c -S ${COPTS} ../sys/acct.c ${C2} acct.s | sed -f ../sys/asm.sed | ${AS} -o acct.o rm -f acct.s alloc.o: ../sys/alloc.c ${CC} -I. -c -S ${COPTS} ../sys/alloc.c ${C2} alloc.s | sed -f ../sys/asm.sed | ${AS} -o alloc.o rm -f alloc.s calloc.o: ../sys/calloc.c ${CC} -I. -c -S ${COPTS} ../sys/calloc.c ${C2} calloc.s | sed -f ../sys/asm.sed | ${AS} -o calloc.o rm -f calloc.s clock.o: ../sys/clock.c ${CC} -I. -c -S ${COPTS} ../sys/clock.c ${C2} clock.s | sed -f ../sys/asm.sed | ${AS} -o clock.o rm -f clock.s fio.o: ../sys/fio.c ${CC} -I. -c -S ${COPTS} ../sys/fio.c ${C2} fio.s | sed -f ../sys/asm.sed | ${AS} -o fio.o rm -f fio.s iget.o: ../sys/iget.c ${CC} -I. -c -S ${COPTS} ../sys/iget.c ${C2} iget.s | sed -f ../sys/asm.sed | ${AS} -o iget.o rm -f iget.s ioctl.o: ../sys/ioctl.c ${CC} -I. -c -S ${COPTS} ../sys/ioctl.c ${C2} ioctl.s | sed -f ../sys/asm.sed | ${AS} -o ioctl.o rm -f ioctl.s machdep.o: ../sys/machdep.c ${CC} -I. -c -S ${COPTS} ../sys/machdep.c ${C2} machdep.s | sed -f ../sys/asm.sed | ${AS} -o machdep.o rm -f machdep.s main.o: ../sys/main.c ${CC} -I. -c -S ${COPTS} ../sys/main.c ${C2} main.s | sed -f ../sys/asm.sed | ${AS} -o main.o rm -f main.s nami.o: ../sys/nami.c ${CC} -I. -c -S ${COPTS} ../sys/nami.c ${C2} nami.s | sed -f ../sys/asm.sed | ${AS} -o nami.o rm -f nami.s partab.o: ../sys/partab.c ${CC} -I. -c -S ${COPTS} ../sys/partab.c ${C2} partab.s | sed -f ../sys/asm.sed | ${AS} -o partab.o rm -f partab.s pipe.o: ../sys/pipe.c ${CC} -I. -c -S ${COPTS} ../sys/pipe.c ${C2} pipe.s | sed -f ../sys/asm.sed | ${AS} -o pipe.o rm -f pipe.s prf.o: ../sys/prf.c ${CC} -I. -c -S ${COPTS} ../sys/prf.c ${C2} prf.s | sed -f ../sys/asm.sed | ${AS} -o prf.o rm -f prf.s prim.o: ../sys/prim.c ${CC} -I. -c -S ${COPTS} ../sys/prim.c ${C2} prim.s | sed -f ../sys/asm.sed | ${AS} -o prim.o rm -f prim.s rdwri.o: ../sys/rdwri.c ${CC} -I. -c -S ${COPTS} ../sys/rdwri.c ${C2} rdwri.s | sed -f ../sys/asm.sed | ${AS} -o rdwri.o rm -f rdwri.s rmap.o: ../sys/rmap.c ${CC} -I. -c -S ${COPTS} ../sys/rmap.c ${C2} rmap.s | sed -f ../sys/asm.sed | ${AS} -o rmap.o rm -f rmap.s sig.o: ../sys/sig.c ${CC} -I. -c -S ${COPTS} ../sys/sig.c ${C2} sig.s | sed -f ../sys/asm.sed | ${AS} -o sig.o rm -f sig.s slp.o: ../sys/slp.c ${CC} -I. -c -S ${COPTS} ../sys/slp.c ${C2} slp.s | sed -f ../sys/asm.sed | ${AS} -o slp.o rm -f slp.s subr.o: ../sys/subr.c ${CC} -I. -c -S ${COPTS} ../sys/subr.c ${C2} subr.s | sed -f ../sys/asm.sed | ${AS} -o subr.o rm -f subr.s sys.o: ../sys/sys.c ${CC} -I. -c -S ${COPTS} ../sys/sys.c ${C2} sys.s | sed -f ../sys/asm.sed | ${AS} -o sys.o rm -f sys.s sys1.o: ../sys/sys1.c ${CC} -I. -c -S ${COPTS} ../sys/sys1.c ${C2} sys1.s | sed -f ../sys/asm.sed | ${AS} -o sys1.o rm -f sys1.s sys2.o: ../sys/sys2.c ${CC} -I. -c -S ${COPTS} ../sys/sys2.c ${C2} sys2.s | sed -f ../sys/asm.sed | ${AS} -o sys2.o rm -f sys2.s sys3.o: ../sys/sys3.c ${CC} -I. -c -S ${COPTS} ../sys/sys3.c ${C2} sys3.s | sed -f ../sys/asm.sed | ${AS} -o sys3.o rm -f sys3.s sys4.o: ../sys/sys4.c ${CC} -I. -c -S ${COPTS} ../sys/sys4.c ${C2} sys4.s | sed -f ../sys/asm.sed | ${AS} -o sys4.o rm -f sys4.s sysent.o: ../sys/sysent.c ${CC} -I. -c -S ${COPTS} ../sys/sysent.c ${C2} sysent.s | sed -f ../sys/asm.sed | ${AS} -o sysent.o rm -f sysent.s text.o: ../sys/text.c ${CC} -I. -c -S ${COPTS} ../sys/text.c ${C2} text.s | sed -f ../sys/asm.sed | ${AS} -o text.o rm -f text.s trap.o: ../sys/trap.c ${CC} -I. -c -S ${COPTS} ../sys/trap.c ${C2} trap.s | sed -f ../sys/asm.sed | ${AS} -o trap.o rm -f trap.s vmdrum.o: ../sys/vmdrum.c ${CC} -I. -c -S ${COPTS} ../sys/vmdrum.c ${C2} vmdrum.s | sed -f ../sys/asm.sed | ${AS} -o vmdrum.o rm -f vmdrum.s vmmem.o: ../sys/vmmem.c ${CC} -I. -c -S ${COPTS} ../sys/vmmem.c ${C2} vmmem.s | sed -f ../sys/asm.sed | ${AS} -o vmmem.o rm -f vmmem.s vmmon.o: ../sys/vmmon.c ${CC} -I. -c -S ${COPTS} ../sys/vmmon.c ${C2} vmmon.s | sed -f ../sys/asm.sed | ${AS} -o vmmon.o rm -f vmmon.s vmpage.o: ../sys/vmpage.c ${CC} -I. -c -S ${COPTS} ../sys/vmpage.c ${C2} vmpage.s | sed -f ../sys/asm.sed | ${AS} -o vmpage.o rm -f vmpage.s vmproc.o: ../sys/vmproc.c ${CC} -I. -c -S ${COPTS} ../sys/vmproc.c ${C2} vmproc.s | sed -f ../sys/asm.sed | ${AS} -o vmproc.o rm -f vmproc.s vmpt.o: ../sys/vmpt.c ${CC} -I. -c -S ${COPTS} ../sys/vmpt.c ${C2} vmpt.s | sed -f ../sys/asm.sed | ${AS} -o vmpt.o rm -f vmpt.s vmsched.o: ../sys/vmsched.c ${CC} -I. -c -S ${COPTS} ../sys/vmsched.c ${C2} vmsched.s | sed -f ../sys/asm.sed | ${AS} -o vmsched.o rm -f vmsched.s vmsubr.o: ../sys/vmsubr.c ${CC} -I. -c -S ${COPTS} ../sys/vmsubr.c ${C2} vmsubr.s | sed -f ../sys/asm.sed | ${AS} -o vmsubr.o rm -f vmsubr.s vmswap.o: ../sys/vmswap.c ${CC} -I. -c -S ${COPTS} ../sys/vmswap.c ${C2} vmswap.s | sed -f ../sys/asm.sed | ${AS} -o vmswap.o rm -f vmswap.s vmsys.o: ../sys/vmsys.c ${CC} -I. -c -S ${COPTS} ../sys/vmsys.c ${C2} vmsys.s | sed -f ../sys/asm.sed | ${AS} -o vmsys.o rm -f vmsys.s udiv.o: ../sys/udiv.s ${AS} -o udiv.o ../sys/udiv.s urem.o: ../sys/urem.s ${AS} -o urem.o ../sys/urem.s autoconf.o: ../dev/autoconf.c ${CC} -I. -c -S ${COPTS} ../dev/autoconf.c ${C2} -i autoconf.s | sed -f ../sys/asm.sed | ${AS} -o autoconf.o rm -f autoconf.s bio.o: ../dev/bio.c ${CC} -I. -c -S ${COPTS} ../dev/bio.c ${C2} bio.s | sed -f ../sys/asm.sed | ${AS} -o bio.o rm -f bio.s conf.o: ../dev/conf.c ${CC} -I. -c -S ${COPTS} ../dev/conf.c ${C2} conf.s | sed -f ../sys/asm.sed | ${AS} -o conf.o rm -f conf.s cons.o: ../dev/cons.c ${CC} -I. -c -S ${COPTS} ../dev/cons.c ${C2} cons.s | sed -f ../sys/asm.sed | ${AS} -o cons.o rm -f cons.s dh.o: ../dev/dh.c ${CC} -I. -c -S ${COPTS} ../dev/dh.c ${C2} -i dh.s | sed -f ../sys/asm.sed | ${AS} -o dh.o rm -f dh.s dkbad.o: ../dev/dkbad.c ${CC} -I. -c -S ${COPTS} ../dev/dkbad.c ${C2} dkbad.s | sed -f ../sys/asm.sed | ${AS} -o dkbad.o rm -f dkbad.s dkleave.o: ../dev/dkleave.c ${CC} -I. -c -S ${COPTS} ../dev/dkleave.c ${C2} dkleave.s | sed -f ../sys/asm.sed | ${AS} -o dkleave.o rm -f dkleave.s dn.o: ../dev/dn.c ${CC} -I. -c -S ${COPTS} ../dev/dn.c ${C2} -i dn.s | sed -f ../sys/asm.sed | ${AS} -o dn.o rm -f dn.s dsort.o: ../dev/dsort.c ${CC} -I. -c -S ${COPTS} ../dev/dsort.c ${C2} dsort.s | sed -f ../sys/asm.sed | ${AS} -o dsort.o rm -f dsort.s dz.o: ../dev/dz.c ${CC} -I. -c -S ${COPTS} ../dev/dz.c ${C2} -i dz.s | sed -f ../sys/asm.sed | ${AS} -o dz.o rm -f dz.s flp.o: ../dev/flp.c ${CC} -I. -c -S ${COPTS} ../dev/flp.c ${C2} flp.s | sed -f ../sys/asm.sed | ${AS} -o flp.o rm -f flp.s hp.o: ../dev/hp.c ${CC} -I. -c -S ${COPTS} ../dev/hp.c ${C2} -i hp.s | sed -f ../sys/asm.sed | ${AS} -o hp.o rm -f hp.s ht.o: ../dev/ht.c ${CC} -I. -c -S ${COPTS} ../dev/ht.c ${C2} -i ht.s | sed -f ../sys/asm.sed | ${AS} -o ht.o rm -f ht.s lp.o: ../dev/lp.c ${CC} -I. -c -S ${COPTS} ../dev/lp.c ${C2} -i lp.s | sed -f ../sys/asm.sed | ${AS} -o lp.o rm -f lp.s mba.o: ../dev/mba.c ${CC} -I. -c -S ${COPTS} ../dev/mba.c ${C2} -i mba.s | sed -f ../sys/asm.sed | ${AS} -o mba.o rm -f mba.s mem.o: ../dev/mem.c ${CC} -I. -c -S ${COPTS} ../dev/mem.c ${C2} mem.s | sed -f ../sys/asm.sed | ${AS} -o mem.o rm -f mem.s mx1.o: ../dev/mx1.c ${CC} -I. -c -S ${COPTS} ../dev/mx1.c ${C2} mx1.s | sed -f ../sys/asm.sed | ${AS} -o mx1.o rm -f mx1.s mx2.o: ../dev/mx2.c ${CC} -I. -c -S ${COPTS} ../dev/mx2.c ${C2} mx2.s | sed -f ../sys/asm.sed | ${AS} -o mx2.o rm -f mx2.s mt.o: ../dev/mt.c ${CC} -I. -c -S ${COPTS} ../dev/mt.c ${C2} -i mt.s | sed -f ../sys/asm.sed | ${AS} -o mt.o rm -f mt.s rk.o: ../dev/rk.c ${CC} -I. -c -S ${COPTS} ../dev/rk.c ${C2} -i rk.s | sed -f ../sys/asm.sed | ${AS} -o rk.o rm -f rk.s sw.o: ../dev/s((w.c ${CC} -I. -c -S ${COPTS} ../dev/sw.c ${C2} sw.s | sed -f ../sys/asm.sed | ${AS} -o sw.o rm -f sw.s tm.o: ../dev/tm.c ${CC} -I. -c -S ${COPTS} ../dev/tm.c ${C2} -i tm.s | sed -f ../sys/asm.sed | ${AS} -o tm.o rm -f tm.s ts.o: ../dev/ts.c ${CC} -I. -c -S ${COPTS} ../dev/ts.c ${C2} -i ts.s | sed -f ../sys/asm.sed | ${AS} -o ts.o rm -f ts.s tty.o: ../dev/tty.c ${CC} -I. -c -S ${COPTS} ../dev/tty.c ${C2} tty.s | sed -f ../sys/asm.sed | ${AS} -o tty.o rm -f tty.s ttynew.o: ../dev/ttynew.c ${CC} -I. -c -S ${COPTS} ../dev/ttynew.c ${C2} ttynew.s | sed -f ../sys/asm.sed | ${AS} -o ttynew.o rm -f ttynew.s ttyold.o: ../dev/ttyold.c ${CC} -I. -c -S ${COPTS} ../dev/ttyold.c ${C2} ttyold.s | sed -f ../sys/asm.sed | ${AS} -o ttyold.o rm -f ttyold.s tu.o: ../dev/tu.c ${CC} -I. -c -S ${COPTS} ../dev/tu.c ${C2} tu.s | sed -f ../sys/asm.sed | ${AS} -o tu.o rm -f tu.s uba.o: ../dev/uba.c ${CC} -I. -c -S ${COPTS} ../dev/uba.c ${C2} -i uba.s | sed -f ../sys/asm.sed | ${AS} -o uba.o rm -f uba.s uda.o: ../dev/uda.c ${CC} -I. -c -S ${COPTS} ../dev/uda.c ${C2} -i uda.s | sed -f ../sys/asm.sed | ${AS} -o uda.o rm -f uda.s up.o: ../dev/up.c ${CC} -I. -c -S ${COPTS} ../dev/up.c ${C2} -i up.s | sed -f ../sys/asm.sed | ${AS} -o up.o rm -f up.s vaxcpu.o: ../dev/vaxcpu.c ${CC} -I. -c -S ${COPTS} ../dev/vaxcpu.c ${C2} vaxcpu.s | sed -f ../sys/asm.sed | ${AS} -o vaxcpu.o rm -f vaxcpu.s # DO NOT DELETE THIS LINE -- make depend uses it acct.o: ../h/param.h ../h/systm.h ../h/acct.h ../h/dir.h ../h/user.h acct.o: ../h/inode.h ../h/proc.h ../h/seg.h alloc.o: ../h/param.h ../h/systm.h ../h/mount.h ../h/filsys.h ../h/fblk.h alloc.o: ../h/conf.h ../h/buf.h ../h/inode.h ../h/ino.h ../h/dir.h ../h/user.h calloc.o: ../h/param.h ../h/dir.h ../h/user.h ../h/proc.h ../h/vm.h ../h/pte.h calloc.o: ../h/cmap.h clock.o: ../h/param.h ../h/systm.h ../h/dk.h ../h/callout.h ../h/seg.h clock.o: ../h/dir.h ../h/user.h ../h/proc.h ../h/reg.h ../h/psl.h ../h/vm.h clock.o: ../h/buf.h ../h/text.h ../h/vlimit.h ../h/mtpr.h ../h/clock.h clock.o: ../h/cpu.h bk.h dh.h dz.h fio.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/filsys.h fio.o: ../h/file.h ../h/conf.h ../h/inode.h ../h/reg.h ../h/acct.h ../h/mount.h iget.o: ../h/param.h ../h/systm.h ../h/mount.h ../h/dir.h ../h/user.h iget.o: ../h/inode.h ../h/ino.h ../h/filsys.h ../h/conf.h ../h/buf.h iget.o: ../h/inline.h ioctl.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/tty.h ioctl.o: ../h/proc.h ../h/inode.h ../h/file.h ../h/conf.h machdep.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/map.h machdep.o: ../h/reg.h ../h/mtpr.h ../h/clock.h ../h/pte.h ../h/vm.h ../h/proc.h machdep.o: ../h/psl.h ../h/buf.h ../h/ubavar.h ../h/ubareg.h ../h/cons.h machdep.o: ../h/reboot.h ../h/conf.h ../h/mem.h ../h/cpu.h ../h/inode.h machdep.o: ../h/file.h ../h/text.h ../h/clist.h ../h/callout.h ../h/cmap.h machdep.o: ../h/rpb.h main.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/filsys.h main.o: ../h/mount.h ../h/map.h ../h/proc.h ../h/inode.h ../h/seg.h ../h/conf.h main.o: ../h/buf.h ../h/mtpr.h ../h/pte.h ../h/clock.h ../h/vm.h ../h/cmap.h main.o: ../h/text.h ../h/vlimit.h ../h/clist.h nami.o: ../h/param.h ../h/systm.h ../h/inode.h ../h/mount.h ../h/dir.h nami.o: ../h/user.h ../h/buf.h ../h/conf.h pipe.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/inode.h pipe.o: ../h/file.h ../h/reg.h ../h/inline.h ../h/proc.h prf.o: ../h/param.h ../h/systm.h ../h/seg.h ../h/buf.h ../h/conf.h ../h/mtpr.h prf.o: ../h/reboot.h ../h/vm.h ../h/msgbuf.h ../h/dir.h ../h/user.h ../h/tty.h prim.o: ../h/param.h ../h/systm.h ../h/conf.h ../h/buf.h ../h/tty.h prim.o: ../h/clist.h rdwri.o: ../h/param.h ../h/systm.h ../h/inode.h ../h/dir.h ../h/user.h rdwri.o: ../h/buf.h ../h/conf.h ../h/cmap.h ../h/vlimit.h ../h/proc.h rmap.o: ../h/param.h ../h/systm.h ../h/map.h ../h/dir.h ../h/user.h ../h/proc.h rmap.o: ../h/mtpr.h ../h/text.h sig.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/proc.h sig.o: ../h/inode.h ../h/reg.h ../h/text.h ../h/seg.h ../h/mtpr.h ../h/pte.h sig.o: ../h/psl.h ../h/vm.h ../h/buf.h ../h/vlimit.h slp.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/proc.h ../h/file.h slp.o: ../h/inode.h ../h/vm.h ../h/pte.h ../h/inline.h ../h/mtpr.h subr.o: ../h/param.h ../h/systm.h ../h/conf.h ../h/inode.h ../h/dir.h subr.o: ../h/user.h ../h/buf.h ../h/proc.h ct.h sys.o: ../h/param.h ../h/systm.h ../h/conf.h ../h/dir.h ../h/user.h ../h/tty.h sys.o: ../h/proc.h sys1.o: ../h/param.h ../h/systm.h ../h/map.h ../h/mtpr.h ../h/dir.h ../h/user.h sys1.o: ../h/proc.h ../h/buf.h ../h/reg.h ../h/inode.h ../h/seg.h ../h/acct.h sys1.o: /usr/include/wait.h ../h/pte.h ../h/vm.h ../h/text.h ../h/psl.h sys1.o: ../h/vlimit.h ../h/file.h sys2.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/reg.h ../h/file.h sys2.o: ../h/inode.h ../h/pte.h ../h/vm.h ../h/buf.h ../h/mtpr.h ../h/proc.h sys2.o: ../h/inline.h sys3.o: ../h/param.h ../h/systm.h ../h/mount.h ../h/ino.h ../h/reg.h ../h/buf.h sys3.o: ../h/filsys.h ../h/dir.h ../h/user.h ../h/inode.h ../h/file.h sys3.o: ../h/conf.h ../h/stat.h ../h/inline.h sys4.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/reg.h sys4.o: ../h/inode.h ../h/proc.h ../h/clock.h ../h/mtpr.h ../h/timeb.h sys4.o: ../h/times.h ../h/reboot.h sysent.o: ../h/param.h ../h/systm.h ../h/vmsysent.h ../sys/vmsysent.c text.o: ../h/param.h ../h/systm.h ../h/map.h ../h/dir.h ../h/user.h ../h/proc.h text.o: ../h/text.h ../h/inode.h ../h/buf.h ../h/seg.h ../h/pte.h ../h/mtpr.h text.o: ../h/vm.h ../h/cmap.h trap.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/proc.h ../h/reg.h trap.o: ../h/seg.h ../h/trap.h ../h/psl.h ../h/pte.h ../h/inline.h ../h/mtpr.h vmdrum.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/proc.h vmdrum.o: ../h/buf.h ../h/text.h ../h/map.h ../h/pte.h ../h/vm.h ../h/cmap.h vmmem.o: ../h/param.h ../h/systm.h ../h/pte.h ../h/cmap.h ../h/dir.h vmmem.o: ../h/user.h ../h/proc.h ../h/mtpr.h ../h/text.h ../h/vm.h ../h/file.h vmmem.o: ../h/inode.h ../h/buf.h ../h/mount.h ../h/trace.h ../h/map.h vmmon.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/vmmeter.h vmmon.o: ../h/trace.h ../h/mtpr.h vmpage.o: ../h/param.h ../h/systm.h ../h/inode.h ../h/dir.h ../h/user.h vmpage.o: ../h/proc.h ../h/reg.h ../h/pte.h ../h/buf.h ../h/text.h ../h/mtpr.h vmpage.o: ../h/cmap.h ../h/vm.h ../h/file.h ../h/trace.h vmproc.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/proc.h vmproc.o: ../h/mtpr.h ../h/pte.h ../h/map.h ../h/cmap.h ../h/text.h ../h/vm.h vmpt.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/proc.h ../h/map.h vmpt.o: ../h/mtpr.h ../h/pte.h ../h/cmap.h ../h/vm.h ../h/buf.h ../h/text.h vmpt.o: ../h/mount.h ../h/inode.h vmsched.o: ../h/param.h ../h/systm.h ../h/seg.h ../h/dir.h ../h/user.h vmsched.o: ../h/proc.h ../h/text.h ../h/vm.h ../h/cmap.h vmsubr.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/vm.h vmsubr.o: ../h/proc.h ../h/mtpr.h ../h/pte.h ../h/cmap.h ../h/inode.h vmsubr.o: ../h/buf.h ../h/text.h vmswap.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/proc.h vmswap.o: ../h/text.h ../h/map.h ../h/buf.h ../h/pte.h ../h/mtpr.h ../h/cmap.h vmswap.o: ../h/vm.h vmsys.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/proc.h vmsys.o: ../h/reg.h ../h/file.h ../h/inode.h ../h/vm.h ../h/buf.h ../h/pte.h vmsys.o: ../h/cmap.h ../h/tty.h ../h/mtpr.h ../h/vlimit.h ../h/trace.h autoconf.o: mba.h ../h/param.h ../h/systm.h ../h/map.h ../h/nexus.h ../h/pte.h autoconf.o: ../h/buf.h ../h/mbareg.h ../h/mbavar.h ../h/dk.h ../h/vm.h autoconf.o: ../h/ubareg.h ../h/ubavar.h ../h/mtpr.h ../h/cpu.h ../h/scb.h autoconf.o: ../h/mem.h bio.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/buf.h ../h/conf.h bio.o: ../h/proc.h ../h/seg.h ../h/pte.h ../h/vm.h ../h/trace.h conf.o: ../h/param.h ../h/systm.h ../h/buf.h ../h/tty.h ../h/conf.h ../h/text.h conf.o: ../h/dir.h ../h/user.h ../h/proc.h ../h/file.h ../h/inode.h ../h/acct.h conf.o: ../h/pte.h hp.h tu.h rk.h te.h ts.h mu.h ra.h up.h ct.h dh.h dz.h lp.h conf.o: va.h vp.h pty.h dn.h bk.h cons.o: ../h/param.h ../h/conf.h ../h/dir.h ../h/user.h ../h/tty.h ../h/systm.h cons.o: ../h/cons.h ../h/mtpr.h ../h/mx.h ../h/cpu.h dh.o: dh.h bk.h ../h/param.h ../h/conf.h ../h/dir.h ../h/user.h ../h/tty.h dh.o: ../h/map.h ../h/pte.h ../h/buf.h ../h/vm.h ../h/ubareg.h ../h/ubavar.h dh.o: ../h/bk.h ../h/clist.h ../h/mx.h ../h/file.h dkbad.o: ../h/param.h ../h/buf.h ../h/dkbad.h dkleave.o: ../h/param.h ../h/buf.h dn.o: dn.h ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/buf.h dn.o: ../h/map.h ../h/pte.h ../h/ubavar.h ../h/conf.h ../h/ioctl.h dsort.o: ../h/param.h ../h/systm.h ../h/buf.h dz.o: dz.h bk.h ../h/param.h ../h/systm.h ../h/tty.h ../h/dir.h ../h/user.h dz.o: ../h/map.h ../h/pte.h ../h/buf.h ../h/vm.h ../h/ubavar.h ../h/conf.h dz.o: ../h/pdma.h ../h/bk.h ../h/file.h ../h/mx.h flp.o: ../h/flp.h ../h/param.h ../h/systm.h ../h/conf.h ../h/dir.h ../h/user.h flp.o: ../h/mtpr.h ../h/buf.h ../h/cons.h ../h/cpu.h hp.o: hp.h ../h/param.h ../h/systm.h ../h/dk.h ../h/buf.h ../h/conf.h hp.o: ../h/dir.h ../h/user.h ../h/map.h ../h/pte.h ../h/mbareg.h ../h/mbavar.h hp.o: ../h/mtpr.h ../h/vm.h ../h/cmap.h ../h/dkbad.h ../h/hpreg.h ht.o: tu.h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h ht.o: ../h/file.h ../h/user.h ../h/map.h ../h/pte.h ../h/mbareg.h ../h/mbavar.h ht.o: ../h/mtio.h ../h/ioctl.h ../h/cmap.h ../h/cpu.h ../h/htreg.h lp.o: lp.h ../h/param.h ../h/dir.h ../h/user.h ../h/buf.h ../h/systm.h lp.o: ../h/map.h ../h/pte.h ../h/ubavar.h ../h/ioctl.h ../h/tty.h mba.o: mba.h ../h/param.h ../h/systm.h ../h/dk.h ../h/buf.h ../h/conf.h mba.o: ../h/dir.h ../h/user.h ../h/proc.h ../h/map.h ../h/pte.h ../h/mbareg.h mba.o: ../h/mbavar.h ../h/mtpr.h ../h/vm.h mem.o: ../h/param.h ../h/dir.h ../h/user.h ../h/conf.h ../h/buf.h ../h/systm.h mem.o: ../h/pte.h ../h/mtpr.h ../h/vm.h ../h/cmap.h mx1.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/reg.h ../h/proc.h mx1.o: ../h/tty.h ../h/inode.h ../h/mx.h ../h/file.h ../h/conf.h mx2.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/proc.h ../h/tty.h mx2.o: ../h/inode.h ../h/mx.h ../h/file.h ../h/conf.h ../h/buf.h mt.o: mu.h ../h/param.((h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h mt.o: ../h/file.h ../h/user.h ../h/map.h ../h/pte.h ../h/mbareg.h ../h/mbavar.h mt.o: ../h/mtio.h ../h/ioctl.h ../h/cmap.h ../h/cpu.h ../h/mtreg.h rk.o: rk.h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h rk.o: ../h/user.h ../h/pte.h ../h/map.h ../h/vm.h ../h/ubareg.h ../h/ubavar.h rk.o: ../h/dk.h ../h/cpu.h ../h/cmap.h ../h/dkbad.h ../h/rkreg.h sw.o: ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h ../h/user.h sw.o: ../h/inode.h ../h/map.h tm.o: te.h ts.h ../h/param.h ../h/systm.h ../h/buf.h ../h/dir.h ../h/conf.h tm.o: ../h/user.h ../h/file.h ../h/map.h ../h/pte.h ../h/vm.h ../h/ubareg.h tm.o: ../h/ubavar.h ../h/mtio.h ../h/ioctl.h ../h/cmap.h ../h/cpu.h tm.o: ../h/tmreg.h ts.o: ts.h ../h/param.h ../h/systm.h ../h/buf.h ../h/dir.h ../h/conf.h ts.o: ../h/user.h ../h/file.h ../h/map.h ../h/pte.h ../h/vm.h ../h/ubareg.h ts.o: ../h/ubavar.h ../h/mtio.h ../h/ioctl.h ../h/cmap.h ../h/cpu.h ts.o: ../h/tsreg.h tty.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/tty.h ../h/proc.h tty.o: ../h/mx.h ../h/inode.h ../h/file.h ../h/reg.h ../h/conf.h ../h/buf.h tty.o: ../h/dk.h ttynew.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/tty.h ttynew.o: ../h/proc.h ../h/mx.h ../h/inode.h ../h/file.h ../h/reg.h ../h/conf.h ttynew.o: ../h/buf.h ../h/dk.h ttyold.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/tty.h ttyold.o: ../h/proc.h ../h/mx.h ../h/inode.h ../h/file.h ../h/reg.h ../h/conf.h ttyold.o: ../h/buf.h ../h/dk.h tu.o: ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h ../h/user.h tu.o: ../h/mtpr.h ../h/cpu.h uba.o: ../h/param.h ../h/systm.h ../h/cpu.h ../h/map.h ../h/pte.h ../h/buf.h uba.o: ../h/vm.h ../h/ubareg.h ../h/ubavar.h ../h/dir.h ../h/user.h ../h/proc.h uba.o: ../h/conf.h ../h/mtpr.h ../h/nexus.h ../h/dk.h uda.o: ra.h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h uda.o: ../h/user.h ../h/pte.h ../h/map.h ../h/vm.h ../h/ubareg.h ../h/ubavar.h uda.o: ../h/dk.h ../h/cpu.h ../h/cmap.h ../h/udareg.h ../h/mscp.h up.o: up.h ../h/param.h ../h/systm.h ../h/cpu.h ../h/nexus.h ../h/dk.h up.o: ../h/buf.h ../h/conf.h ../h/dir.h ../h/user.h ../h/map.h ../h/pte.h up.o: ../h/mtpr.h ../h/vm.h ../h/ubavar.h ../h/ubareg.h ../h/cmap.h up.o: ../h/upreg.h vaxcpu.o: ../h/param.h ../h/pte.h ../h/ubareg.h ../h/nexus.h ../h/cpu.h .h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h uda.o: ../h/user.h ../h/pte.h ../h/map.h ../h/vm.h ../h/ubareg.h ../h/ubavar.h uda.o: ../h/dk.h ../h/cpu.h ../h/cmap.h ../h/udareg.h sys/GENERIC/bk.h 664 0 33 16 2632234014 6425 #define NBK 0 .o: up.h ../h/param.h ../h/systm.h ../h/cpu.h ../h/nexus.h ../h/dk.h up.o: ../h/buf.h ../h/conf.h ../h/dir.h ../h/user.h ../h/map.h ../h/pte.h up.o: ../h/mtpr.h ../h/vm.h ../h/ubavar.h ../h/ubareg.h ../h/cmap.h up.o: ../h/upreg.h vaxcpu.o: ../h/param.h ../h/pte.h ../h/ubareg.h ../h/nexus.h ../h/cpu.h .h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h uda.o: ../h/user.h ../h/pte.h ../h/map.h /hL,hL5< /,"sys/GENERIC/ct.h 664 0 33 16 2632234014 6437 #define NCT 0 .o: up.h ../h/param.h ../h/systm.h ../h/cpu.h ../h/nexus.h ../h/dk.h up.o: ../h/buf.h ../h/conf.h ../h/dir.h ../h/user.h ../h/map.h ../h/pte.h up.o: ../h/mtpr.h ../h/vm.h ../h/ubavar.h ../h/ubareg.h ../h/cmap.h up.o: ../h/upreg.h vaxcpu.o: ../h/param.h ../h/pte.h ../h/ubareg.h ../h/nexus.h ../h/cpu.h .h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h uda.o: ../h/user.h ../h/pte.h ../h/map.h /hL,hL5< /,"sys/GENERIC/dh.h 664 0 33 16 2632234014 6424 #define NDH 2 .o: up.h ../h/param.h ../h/systm.h ../h/cpu.h ../h/nexus.h ../h/dk.h up.o: ../h/buf.h ../h/conf.h ../h/dir.h ../h/user.h ../h/map.h ../h/pte.h up.o: ../h/mtpr.h ../h/vm.h ../h/ubavar.h ../h/ubareg.h ../h/cmap.h up.o: ../h/upreg.h vaxcpu.o: ../h/param.h ../h/pte.h ../h/ubareg.h ../h/nexus.h ../h/cpu.h .h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h uda.o: ../h/user.h ../h/pte.h ../h/map.h /hL,hL5< /,"sys/GENERIC/dn.h 664 0 33 16 2632234014 6432 #define NDN 1 .o: up.h ../h/param.h ../h/systm.h ../h/cpu.h ../h/nexus.h ../h/dk.h up.o: ../h/buf.h ../h/conf.h ../h/dir.h ../h/user.h ../h/map.h ../h/pte.h up.o: ../h/mtpr.h ../h/vm.h ../h/ubavar.h ../h/ubareg.h ../h/cmap.h up.o: ../h/upreg.h vaxcpu.o: ../h/param.h ../h/pte.h ../h/ubareg.h ../h/nexus.h ../h/cpu.h .h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h uda.o: ../h/user.h ../h/pte.h ../h/map.h /hL,hL5< /,"sys/GENERIC/dz.h 664 0 33 16 2632234014 6446 #define NDZ 8 .o: up.h ../h/param.h ../h/systm.h ../h/cpu.h ../h/nexus.h ../h/dk.h up.o: ../h/buf.h ../h/conf.h ../h/dir.h ../h/user.h ../h/map.h ../h/pte.h up.o: ../h/mtpr.h ../h/vm.h ../h/ubavar.h ../h/ubareg.h ../h/cmap.h up.o: ../h/upreg.h vaxcpu.o: ../h/param.h ../h/pte.h ../h/ubareg.h ../h/nexus.h ../h/cpu.h .h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h uda.o: ../h/user.h ../h/pte.h ../h/map.h /hL,hL5Ȇ< /,"sys/GENERIC/hp.h 664 0 33 16 2632234014 6440 #define NHP 4 .o: up.h ../h/param.h ../h/systm.h ../h/cpu.h ../h/nexus.h ../h/dk.h up.o: ../h/buf.h ../h/conf.h ../h/dir.h ../h/user.h ../h/map.h ../h/pte.h up.o: ../h/mtpr.h ../h/vm.h ../h/ubavar.h ../h/ubareg.h ../h/cmap.h up.o: ../h/upreg.h vaxcpu.o: ../h/param.h ../h/pte.h ../h/ubareg.h ../h/nexus.h ../h/cpu.h .h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h uda.o: ../h/user.h ../h/pte.h ../h/map.h /hL,hL5؆< /,"sys/GENERIC/tu.h 664 0 33 34 2632234014 6461 #define NTU 2 #define NHT 1 param.h ../h/systm.h ../h/cpu.h ../h/nexus.h ../h/dk.h up.o: ../h/buf.h ../h/conf.h ../h/dir.h ../h/user.h ../h/map.h ../h/pte.h up.o: ../h/mtpr.h ../h/vm.h ../h/ubavar.h ../h/ubareg.h ../h/cmap.h up.o: ../h/upreg.h vaxcpu.o: ../h/param.h ../h/pte.h ../h/ubareg.h ../h/nexus.h ../h/cpu.h .h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h uda.o: ../h/user.h ../h/pte.h ../h/map.h /hL,hL5< /,"sys/GENERIC/lp.h 664 0 33 16 2632234014 6444 ((#define NLP 1 #define NHT 1 param.h ../h/systm.h ../h/cpu.h ../h/nexus.h ../h/dk.h up.o: ../h/buf.h ../h/conf.h ../h/dir.h ../h/user.h ../h/map.h ../h/pte.h up.o: ../h/mtpr.h ../h/vm.h ../h/ubavar.h ../h/ubareg.h ../h/cmap.h up.o: ../h/upreg.h vaxcpu.o: ../h/param.h ../h/pte.h ../h/ubareg.h ../h/nexus.h ../h/cpu.h .h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h uda.o: ../h/user.h ../h/pte.h ../h/map.h /hL,hL5< /,"sys/GENERIC/mba.h 664 0 33 17 2632234014 6571 #define NMBA 4 define NHT 1 param.h ../h/systm.h ../h/cpu.h ../h/nexus.h ../h/dk.h up.o: ../h/buf.h ../h/conf.h ../h/dir.h ../h/user.h ../h/map.h ../h/pte.h up.o: ../h/mtpr.h ../h/vm.h ../h/ubavar.h ../h/ubareg.h ../h/cmap.h up.o: ../h/upreg.h vaxcpu.o: ../h/param.h ../h/pte.h ../h/ubareg.h ../h/nexus.h ../h/cpu.h .h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h uda.o: ../h/user.h ../h/pte.h ../h/map.h /hL,hL5< /,"sys/GENERIC/mu.h 664 0 33 34 2632234015 6453 #define NMU 2 #define NMT 1 param.h ../h/systm.h ../h/cpu.h ../h/nexus.h ../h/dk.h up.o: ../h/buf.h ../h/conf.h ../h/dir.h ../h/user.h ../h/map.h ../h/pte.h up.o: ../h/mtpr.h ../h/vm.h ../h/ubavar.h ../h/ubareg.h ../h/cmap.h up.o: ../h/upreg.h vaxcpu.o: ../h/param.h ../h/pte.h ../h/ubareg.h ../h/nexus.h ../h/cpu.h .h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h uda.o: ../h/user.h ../h/pte.h ../h/map.h /hL,hL5< /,"sys/GENERIC/pty.h 664 0 33 17 2632234015 6647 #define NPTY 0 define NMT 1 param.h ../h/systm.h ../h/cpu.h ../h/nexus.h ../h/dk.h up.o: ../h/buf.h ../h/conf.h ../h/dir.h ../h/user.h ../h/map.h ../h/pte.h up.o: ../h/mtpr.h ../h/vm.h ../h/ubavar.h ../h/ubareg.h ../h/cmap.h up.o: ../h/upreg.h vaxcpu.o: ../h/param.h ../h/pte.h ../h/ubareg.h ../h/nexus.h ../h/cpu.h .h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h uda.o: ../h/user.h ../h/pte.h ../h/map.h /hL,hL5(< /,"sys/GENERIC/rk.h 664 0 33 34 2632234015 6446 #define NRK 2 #define NHK 1 param.h ../h/systm.h ../h/cpu.h ../h/nexus.h ../h/dk.h up.o: ../h/buf.h ../h/conf.h ../h/dir.h ../h/user.h ../h/map.h ../h/pte.h up.o: ../h/mtpr.h ../h/vm.h ../h/ubavar.h ../h/ubareg.h ../h/cmap.h up.o: ../h/upreg.h vaxcpu.o: ../h/param.h ../h/pte.h ../h/ubareg.h ../h/nexus.h ../h/cpu.h .h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h uda.o: ../h/user.h ../h/pte.h ../h/map.h /hL,hL58< /,"sys/GENERIC/te.h 664 0 33 34 2632234015 6442 #define NTE 2 #define NTM 1 param.h ../h/systm.h ../h/cpu.h ../h/nexus.h ../h/dk.h up.o: ../h/buf.h ../h/conf.h ../h/dir.h ../h/user.h ../h/map.h ../h/pte.h up.o: ../h/mtpr.h ../h/vm.h ../h/ubavar.h ../h/ubareg.h ../h/cmap.h up.o: ../h/upreg.h vaxcpu.o: ../h/param.h ../h/pte.h ../h/ubareg.h ../h/nexus.h ../h/cpu.h .h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h uda.o: ../h/user.h ../h/pte.h ../h/map.h /hL,hL5H< /,"sys/GENERIC/ts.h 664 0 33 34 2632234015 6460 #define NTS 1 #define NZS 1 param.h ../h/systm.h ../h/cpu.h ../h/nexus.h ../h/dk.h up.o: ../h/buf.h ../h/conf.h ../h/dir.h ../h/user.h ../h/map.h ../h/pte.h up.o: ../h/mtpr.h ../h/vm.h ../h/ubavar.h ../h/ubareg.h ../h/cmap.h up.o: ../h/upreg.h vaxcpu.o: ../h/param.h ../h/pte.h ../h/ubareg.h ../h/nexus.h ../h/cpu.h .h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h uda.o: ../h/user.h ../h/pte.h ../h/map.h /hL,hL5X< /,"sys/GENERIC/ra.h 664 0 33 35 2632234015 6435 #define NRA 2 #define NUDA 1 aram.h ../h/systm.h ../h/cpu.h ../h/nexus.h ../h/dk.h up.o: ../h/buf.h ../h/conf.h ../h/dir.h ../h/user.h ../h/map.h ../h/pte.h up.o: ../h/mtpr.h ../h/vm.h ../h/ubavar.h ../h/ubareg.h ../h/cmap.h up.o: ../h/upreg.h vaxcpu.o: ../h/param.h ../h/pte.h ../h/ubareg.h ../h/nexus.h ../h/cpu.h .h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h uda.o: ../h/user.h ../h/pte.h ../h/map.h /hL,hL5h< /,"sys/GENERIC/up.h 664 0 33 34 2632234015 6456 #define NUP 2 #define NSC 1 aram.h ../h/systm.h ../h/cpu.h ../h/nexus.h ../h/dk.h up.o: ../h/buf.h ../h/conf.h ../h/dir.h ../h/user.h ../h/map.h ../h/pte.h up.o: ../h/mtpr.h ../h/vm.h ../h/ubavar.h ../h/ubareg.h ../h/cmap.h up.o: ../h/upreg.h vaxcpu.o: ../h/param.h ../h/pte.h ../h/ubareg.h ../h/nexus.h ../h/cpu.h .h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h uda.o: ../h/user.h ../h/pte.h ../h/map.h /hL,hL5x< /,"sys/GENERIC/errs 664 0 33 422 2664317470 6614 cat assym.s ../sys/scb.s ../sys/locore.s ubglue.s > locore.c cc -E -DLOCORE -DGENERIC -DVAX7ZZ -DVAX750 -DVAX780 -DKERNEL -DVMUNIX locore.c > locore.i as -o locore.o ${AHEADS} locore.i loading vmunix rearranging symbols text data bss dec hex 123060 27528 24628 175216 2ac70 e.h ../h/ubareg.h ../h/nexus.h ../h/cpu.h .h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h uda.o: ../h/user.h ../h/pte.h ../h/map.h /hL,hL5< /,"sys/GENERIC/va.h 664 0 33 16 2632234015 6440 ((#define NVA 0 /sys/scb.s ../sys/locore.s ubglue.s > locore.c cc -E -DLOCORE -DGENERIC -DVAX7ZZ -DVAX750 -DVAX780 -DKERNEL -DVMUNIX locore.c > locore.i as -o locore.o ${AHEADS} locore.i loading vmunix rearranging symbols text data bss dec hex 123060 27528 24628 175216 2ac70 e.h ../h/ubareg.h ../h/nexus.h ../h/cpu.h .h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h uda.o: ../h/user.h ../h/pte.h ../h/map.h /hL,hL5< /,"sys/GENERIC/vp.h 664 0 33 16 2632234015 6457 #define NVP 0 /sys/scb.s ../sys/locore.s ubglue.s > locore.c cc -E -DLOCORE -DGENERIC -DVAX7ZZ -DVAX750 -DVAX780 -DKERNEL -DVMUNIX locore.c > locore.i as -o locore.o ${AHEADS} locore.i loading vmunix rearranging symbols text data bss dec hex 123060 27528 24628 175216 2ac70 e.h ../h/ubareg.h ../h/nexus.h ../h/cpu.h .h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h uda.o: ../h/user.h ../h/pte.h ../h/map.h /hL,hL5< /,"sys/GENERIC/assym.s 664 0 33 734 2662315354 7241 #ifdef LOCORE #define P_LINK 0 #define P_RLINK 4 #define P_ADDR 8 #define P_PRI 13 #define P_STAT 15 #define P_WCHAN 76 #define SSLEEP 1 #define SRUN 3 #define UBA_BRRVR 48 #define UH_UBA 0 #define UH_VEC 8 #define UH_SIZE 52 #define RP_FLAG 12 #define V_SWTCH 0 #define V_TRAP 4 #define V_SYSCALL 8 #define V_INTR 12 #define V_PDMA 16 #define UPAGES 8 #define CLSIZE 2 #define SYSPTSIZE 1536 #define USRPTSIZE 1024 #else asm(".set U_ARG,120"); asm(".set U_QSAV,140"); #endif /,"sys/GENERIC/touch 775 0 33 14162 2662315325 7027  ^Юn PPՀPpPP  Pp1׬լ1 ]PPݼP1EMT[bjs|y8dt7  ~<r  ;,  d  ($0:fC. I3Q l YtaLBiq\ {y lN8d  7  crt0.otouch.ochmod.operror.oerrlst.ostrlen.olseek.oexit.oclose.oopen.oread.ostat.owrite.ocerror.oflsbuf.odata.oisatty.ostty.oioctl.omalloc.osbrk.oudiv.o_exitstart_main_environ_stat_chmod_open_lseek_read_write_close_perrorcerror_errno_sys_nerr_sys_errlist_strlen__cleanup__flsbuf__iob_isatty__sobuf_malloc_fflush_fclose__lastbuf_free__sibuf_gtty_stty_ioctludiv_sbrk_realloc_end_brkd  7  crt0.otouch.ochmod.operror.oerrlst.ostrlen.olseek.oexit.oclose.oopen.oread.ostat.owrite.ocerror.oflsbuf.odata.oisatty.ostty.oioctl.omalloc.osbrk.oudiv.o_exitstart_main_environ_stat_chmod_open_lseek_read_write_close_perrorcerror_errno_sys_nerr_sys_errlist_strlen__cleanup__flsbuf__iobsys/GENERIC/makefile.bak 664 0 33 63501 2650362141 10207 ((IDENT=-DGENERIC -DVAX7ZZ -DVAX750 -DVAX780 PARAM=-DHZ=60 -DTIMEZONE=0 -DDST=0 -DMAXUSERS=8 # # Makefile for Berkeley Virtual Vax/Unix, February 1981 # # This makefile is constructed from a machine description: # config machine # Most changes should be made in the machine description # /usr/sys/conf/``machineid'' # after which you should do # config machineid # Generic makefile changes should be made in # /usr/sys/conf/makefile # after which config should be rerun for all machines. # # N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE # IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING # # -DINSECURE old style non-vanishing suid bits # -DUNFAST don't compile in inline expansions and speedups # -DPGINPROF gather statistics about pagein/pageout activity # -DDISKMON monitor disk cacheing activity (bio.c) # -DINTRLVE compile in code for file systems interleaved across drives # -DTRACE compile in kernel tracing hooks # C2= /lib/c2 COPTS= ${IDENT} -DKERNEL -DVMUNIX CFLAGS= -O ${COPTS} AHEADS= ../h/pcb.m OBJS=acct.o alloc.o calloc.o clock.o fio.o iget.o ioctl.o machdep.o \ main.o nami.o partab.o pipe.o prf.o prim.o rdwri.o rmap.o sig.o \ slp.o subr.o sys.o sys1.o sys2.o sys3.o sys4.o sysent.o text.o \ trap.o vmdrum.o vmmem.o vmmon.o vmpage.o vmproc.o vmpt.o \ vmsched.o vmsubr.o vmswap.o vmsys.o udiv.o urem.o autoconf.o \ bio.o conf.o cons.o dh.o dkbad.o dkleave.o dn.o dsort.o dz.o \ flp.o hp.o ht.o lp.o mba.o mem.o mx1.o mx2.o mt.o rk.o sw.o tm.o \ ts.o tty.o ttynew.o ttyold.o tu.o uba.o uda.o up.o vaxcpu.o CFILES=../sys/acct.c ../sys/alloc.c ../sys/calloc.c ../sys/clock.c \ ../sys/fio.c ../sys/iget.c ../sys/ioctl.c ../sys/machdep.c \ ../sys/main.c ../sys/nami.c ../sys/partab.c ../sys/pipe.c \ ../sys/prf.c ../sys/prim.c ../sys/rdwri.c ../sys/rmap.c \ ../sys/sig.c ../sys/slp.c ../sys/subr.c ../sys/sys.c \ ../sys/sys1.c ../sys/sys2.c ../sys/sys3.c ../sys/sys4.c \ ../sys/sysent.c ../sys/text.c ../sys/trap.c ../sys/vmdrum.c \ ../sys/vmmem.c ../sys/vmmon.c ../sys/vmpage.c ../sys/vmproc.c \ ../sys/vmpt.c ../sys/vmsched.c ../sys/vmsubr.c ../sys/vmswap.c \ ../sys/vmsys.c ../dev/autoconf.c ../dev/bio.c ../dev/conf.c \ ../dev/cons.c ../dev/dh.c ../dev/dkbad.c ../dev/dkleave.c \ ../dev/dn.c ../dev/dsort.c ../dev/dz.c ../dev/flp.c ../dev/hp.c \ ../dev/ht.c ../dev/lp.c ../dev/mba.c ../dev/mem.c ../dev/mx1.c \ ../dev/mx2.c ../dev/mt.c ../dev/rk.c ../dev/sw.c ../dev/tm.c \ ../dev/ts.c ../dev/tty.c ../dev/ttynew.c ../dev/ttyold.c \ ../dev/tu.c ../dev/uba.c ../dev/uda.c ../dev/up.c \ ../dev/vaxcpu.c vmunix: makefile locore.o ${OBJS} ioconf.o param.o swapgeneric.o @echo loading vmunix @rm -f vmunix @sh ../conf/newvers.sh @cc $(CFLAGS) -c vers.c @ld -n -o vmunix -e start -x -T 80000000 locore.o ${OBJS} vers.o ioconf.o param.o swapgeneric.o @echo rearranging symbols @-symorder ../sys/symbols.sort vmunix @size vmunix @chmod 755 vmunix swapgeneric.o: ../dev/swapgeneric.c ${CC} -I. -c -S ${COPTS} ../dev/swapgeneric.c ${C2} swapgeneric.s | sed -f ../sys/asm.sed | ${AS} -o swapgeneric.o rm -f swapgeneric.s all: vmunix clean: rm -f eddep *vmunix* tags *.o locore.i [a-tv-z]*.s touch errs linterrs lint: /tmp @lint -hbxn -I. -DGENERIC ${COPTS} ../sys/Locore.c \ ${CFILES} ../dev/swapgeneric.c ioconf.c | \ grep -v 'struct/union .* never defined' | \ grep -v 'possible pointer alignment problem' ../sys/symbols.sort: ../sys/symbols.raw grep -v '^#' ../sys/symbols.raw \ | sed 's/^ //' | sort | uniq > ../sys/symbols.sort locore.o: assym.s ${AHEADS} ../sys/scb.s ../sys/locore.s ubglue.s \ ../h/mtpr.h ../h/trap.h ../h/psl.h ../h/pte.h ../h/cpu.h ../h/mtpr.h mba.h cat assym.s ../sys/scb.s ../sys/locore.s ubglue.s > locore.c cc -E -DLOCORE ${COPTS} locore.c > locore.i @echo 'as -o locore.o $${AHEADS} locore.i' @as -o locore.o ${AHEADS} locore.i @rm locore.i # the following is necessary because autoconf.o depends on #if GENERIC autoconf.o: makefile # the following are necessary because the files depend on the types of # vax cpu's included in the system configuration clock.o machdep.o autoconf.o conf.o cons.o flp.o mba.o uba.o vaxcpu.o : makefile assym.s: ../h/param.h ../h/pte.h ../h/buf.h ../h/vmparam.h ../h/vmmeter.h \ ../h/dir.h ../h/cmap.h ../h/map.h ../h/ubavar.h ../h/proc.h cc ${IDENT} ../conf/genassym.c; ./a.out >assym.s; rm -f a.out ../h/param.h: /usr/include/signal.h touch ./touch ../h/param.h ../h/tty.h: /usr/include/sgtty.h ../h/ioctl.h touch ./touch ../h/tty.h ../h/user.h: ../h/pcb.h ../h/dmap.h ../h/vtimes.h ../h/types.h \ /usr/include/errno.h touch ./touch ../h/user.h ../h/vm.h: ../h/vmmac.h ../h/vmmeter.h ../h/vmparam.h ../h/vmsystm.h touch ./touch ../h/vm.h ../sys/sysent.c: ../sys/vmsysent.c touch ./touch ../sys/sysent.c touch: ../conf/touch.c cc ../conf/touch.c -o touch depend: grep '^#include' ${CFILES} | grep -v '<' | \ sed 's/:[^"]*"\([^"]*\)".*/: \1/' | \ sed 's/\.c/.o/' | sed 's,../[a-z]*/,,' | \ awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \ else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \ else rec = rec " " $$2 } } \ END { print rec } ' > makedep echo '$$r makedep' >>eddep echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep echo '$$r makedep' >>eddep echo 'w' >>eddep cp makefile makefile.bak ed - makefile < eddep rm eddep makedep tags: /usr/ucb/ctags ${CFILES} print: @pr -f makefile ../sys/TODO linterrs @/usr/ucb/ctags -x ${CFILES} | pr -f -h XREF @(size vmunix *.o) | pr -f -h sizes @ls -ls | pr -f @cd ../h; ls -ls | pr -f ; pr -f *.m *.h @cd ../sys; pr -f asm.sed Locore.c scb.s locore.s @pr -f ${CFILES} ioconf.o: ioconf.c ../h/param.h ../h/pte.h ../h/buf.h ../h/map.h \ ../h/mbavar.h ../h/vm.h ../h/ubavar.h ${CC} -I. -c -S ${COPTS} ioconf.c ${C2} ioconf.s | sed -f ../sys/asm.sed | ${AS} -o ioconf.o rm -f ioconf.s param.c: ../sys/param.c cp ../sys/param.c . param.o: param.c makefile ${CC} -c -O ${IDENT} ${PARAM} param.c acct.o: ../sys/acct.c ${CC} -I. -c -S ${COPTS} ../sys/acct.c ${C2} acct.s | sed -f ../sys/asm.sed | ${AS} -o acct.o rm -f acct.s alloc.o: ../sys/alloc.c ${CC} -I. -c -S ${COPTS} ../sys/alloc.c ${C2} alloc.s | sed -f ../sys/asm.sed | ${AS} -o alloc.o rm -f alloc.s calloc.o: ../sys/calloc.c ${CC} -I. -c -S ${COPTS} ../sys/calloc.c ${C2} calloc.s | sed -f ../sys/asm.sed | ${AS} -o calloc.o rm -f calloc.s clock.o: ../sys/clock.c ${CC} -I. -c -S ${COPTS} ../sys/clock.c ${C2} clock.s | sed -f ../sys/asm.sed | ${AS} -o clock.o rm -f clock.s fio.o: ../sys/fio.c ${CC} -I. -c -S ${COPTS} ../sys/fio.c ${C2} fio.s | sed -f ../sys/asm.sed | ${AS} -o fio.o rm -f fio.s iget.o: ../sys/iget.c ${CC} -I. -c -S ${COPTS} ../sys/iget.c ${C2} iget.s | sed -f ../sys/asm.sed | ${AS} -o iget.o rm -f iget.s ioctl.o: ../sys/ioctl.c ${CC} -I. -c -S ${COPTS} ../sys/ioctl.c ${C2} ioctl.s | sed -f ../sys/asm.sed | ${AS} -o ioctl.o rm -f ioctl.s machdep.o: ../sys/machdep.c ${CC} -I. -c -S ${COPTS} ../sys/machdep.c ${C2} machdep.s | sed -f ../sys/asm.sed | ${AS} -o machdep.o rm -f machdep.s main.o: ../sys/main.c ${CC} -I. -c -S ${COPTS} ../sys/main.c ${C2} main.s | sed -f ../sys/asm.sed | ${AS} -o main.o rm -f main.s nami.o: ../sys/nami.c ${CC} -I. -c -S ${COPTS} ../sys/nami.c ${C2} nami.s | sed -f ../sys/asm.sed | ${AS} -o nami.o rm -f nami.s partab.o: ../sys/partab.c ${CC} -I. -c -S ${COPTS} ../sys/partab.c ${C2} partab.s | sed -f ../sys/asm.sed | ${AS} -o partab.o rm -f partab.s pipe.o: ../sys/pipe.c ${CC} -I. -c -S ${COPTS} ../sys/pipe.c ${C2} pipe.s | sed -f ../sys/asm.sed | ${AS} -o pipe.o rm -f pipe.s prf.o: ../sys/prf.c ${CC} -I. -c -S ${COPTS} ../sys/prf.c ${C2} prf.s | sed -f ../sys/asm.sed | ${AS} -o prf.o rm -f prf.s prim.o: ../sys/prim.c ${CC} -I. -c -S ${COPTS} ../sys/prim.c ${C2} prim.s | sed -f ../sys/asm.sed | ${AS} -o prim.o rm -f prim.s rdwri.o: ../sys/rdwri.c ${CC} -I. -c -S ${COPTS} ../sys/rdwri.c ${C2} rdwri.s | sed -f ../sys/asm.sed | ${AS} -o rdwri.o rm -f rdwri.s rmap.o: ../sys/rmap.c ${CC} -I. -c -S ${COPTS} ../sys/rmap.c ${C2} rmap.s | sed -f ../sys/asm.sed | ${AS} -o rmap.o rm -f rmap.s sig.o: ../sys/sig.c ${CC} -I. -c -S ${COPTS} ../sys/sig.c ${C2} sig.s | sed -f ../sys/asm.sed | ${AS} -o sig.o rm -f sig.s slp.o: ../sys/slp.c ${CC} -I. -c -S ${COPTS} ../sys/slp.c ${C2} slp.s | sed -f ../sys/asm.sed | ${AS} -o slp.o rm -f slp.s subr.o: ../sys/subr.c ${CC} -I. -c -S ${COPTS} ../sys/subr.c ${C2} subr.s | sed -f ../sys/asm.sed | ${AS} -o subr.o rm -f subr.s sys.o: ../sys/sys.c ${CC} -I. -c -S ${COPTS} ../sys/sys.c ${C2} sys.s | sed -f ../sys/asm.sed | ${AS} -o sys.o rm -f sys.s sys1.o: ../sys/sys1.c ${CC} -I. -c -S ${COPTS} ../sys/sys1.c ${C2} sys1.s | sed -f ../sys/asm.sed | ${AS} -o sys1.o rm -f sys1.s sys2.o: ../sys/sys2.c ${CC} -I. -c -S ${COPTS} ../sys/sys2.c ${C2} sys2.s | sed -f ../sys/asm.sed | ${AS} -o sys2.o rm -f sys2.s sys3.o: ../sys/sys3.c ${CC} -I. -c -S ${COPTS} ../sys/sys3.c ${C2} sys3.s | sed -f ../sys/asm.sed | ${AS} -o sys3.o rm -f sys3.s sys4.o: ../sys/sys4.c ${CC} -I. -c -S ${COPTS} ../sys/sys4.c ${C2} sys4.s | sed -f ../sys/asm.sed | ${AS} -o sys4.o rm -f sys4.s sysent.o: ../sys/sysent.c ${CC} -I. -c -S ${COPTS} ../sys/sysent.c ${C2} sysent.s | sed -f ../sys/asm.sed | ${AS} -o sysent.o rm -f sysent.s text.o: ../sys/text.c ${CC} -I. -c -S ${COPTS} ../sys/text.c ${C2} text.s | sed -f ../sys/asm.sed | ${AS} -o text.o rm -f text.s trap.o: ../sys/trap.c ${CC} -I. -c -S ${COPTS} ../sys/trap.c ${C2} trap.s | sed -f ../sys/asm.sed | ${AS} -o trap.o rm -f trap.s vmdrum.o: ../sys/vmdrum.c ${CC} -I. -c -S ${COPTS} ../sys/vmdrum.c ${C2} vmdrum.s | sed -f ../sys/asm.sed | ${AS} -o vmdrum.o rm -f vmdrum.s vmmem.o: ../sys/vmmem.c ${CC} -I. -c -S ${COPTS} ../sys/vmmem.c ${C2} vmmem.s | sed -f ../sys/asm.sed | ${AS} -o vmmem.o rm -f vmmem.s vmmon.o: ../sys/vmmon.c ${CC} -I. -c -S ${COPTS} ../sys/vmmon.c ${C2} vmmon.s | sed -f ../sys/asm.sed | ${AS} -o vmmon.o rm -f vmmon.s vmpage.o: ../sys/vmpage.c ${CC} -I. -c -S ${COPTS} ../sys/vmpage.c ${C2} vmpage.s | sed -f ../sys/asm.sed | ${AS} -o vmpage.o rm -f vmpage.s vmproc.o((: ../sys/vmproc.c ${CC} -I. -c -S ${COPTS} ../sys/vmproc.c ${C2} vmproc.s | sed -f ../sys/asm.sed | ${AS} -o vmproc.o rm -f vmproc.s vmpt.o: ../sys/vmpt.c ${CC} -I. -c -S ${COPTS} ../sys/vmpt.c ${C2} vmpt.s | sed -f ../sys/asm.sed | ${AS} -o vmpt.o rm -f vmpt.s vmsched.o: ../sys/vmsched.c ${CC} -I. -c -S ${COPTS} ../sys/vmsched.c ${C2} vmsched.s | sed -f ../sys/asm.sed | ${AS} -o vmsched.o rm -f vmsched.s vmsubr.o: ../sys/vmsubr.c ${CC} -I. -c -S ${COPTS} ../sys/vmsubr.c ${C2} vmsubr.s | sed -f ../sys/asm.sed | ${AS} -o vmsubr.o rm -f vmsubr.s vmswap.o: ../sys/vmswap.c ${CC} -I. -c -S ${COPTS} ../sys/vmswap.c ${C2} vmswap.s | sed -f ../sys/asm.sed | ${AS} -o vmswap.o rm -f vmswap.s vmsys.o: ../sys/vmsys.c ${CC} -I. -c -S ${COPTS} ../sys/vmsys.c ${C2} vmsys.s | sed -f ../sys/asm.sed | ${AS} -o vmsys.o rm -f vmsys.s udiv.o: ../sys/udiv.s ${AS} -o udiv.o ../sys/udiv.s urem.o: ../sys/urem.s ${AS} -o urem.o ../sys/urem.s autoconf.o: ../dev/autoconf.c ${CC} -I. -c -S ${COPTS} ../dev/autoconf.c ${C2} -i autoconf.s | sed -f ../sys/asm.sed | ${AS} -o autoconf.o rm -f autoconf.s bio.o: ../dev/bio.c ${CC} -I. -c -S ${COPTS} ../dev/bio.c ${C2} bio.s | sed -f ../sys/asm.sed | ${AS} -o bio.o rm -f bio.s conf.o: ../dev/conf.c ${CC} -I. -c -S ${COPTS} ../dev/conf.c ${C2} conf.s | sed -f ../sys/asm.sed | ${AS} -o conf.o rm -f conf.s cons.o: ../dev/cons.c ${CC} -I. -c -S ${COPTS} ../dev/cons.c ${C2} cons.s | sed -f ../sys/asm.sed | ${AS} -o cons.o rm -f cons.s dh.o: ../dev/dh.c ${CC} -I. -c -S ${COPTS} ../dev/dh.c ${C2} -i dh.s | sed -f ../sys/asm.sed | ${AS} -o dh.o rm -f dh.s dkbad.o: ../dev/dkbad.c ${CC} -I. -c -S ${COPTS} ../dev/dkbad.c ${C2} dkbad.s | sed -f ../sys/asm.sed | ${AS} -o dkbad.o rm -f dkbad.s dkleave.o: ../dev/dkleave.c ${CC} -I. -c -S ${COPTS} ../dev/dkleave.c ${C2} dkleave.s | sed -f ../sys/asm.sed | ${AS} -o dkleave.o rm -f dkleave.s dn.o: ../dev/dn.c ${CC} -I. -c -S ${COPTS} ../dev/dn.c ${C2} -i dn.s | sed -f ../sys/asm.sed | ${AS} -o dn.o rm -f dn.s dsort.o: ../dev/dsort.c ${CC} -I. -c -S ${COPTS} ../dev/dsort.c ${C2} dsort.s | sed -f ../sys/asm.sed | ${AS} -o dsort.o rm -f dsort.s dz.o: ../dev/dz.c ${CC} -I. -c -S ${COPTS} ../dev/dz.c ${C2} -i dz.s | sed -f ../sys/asm.sed | ${AS} -o dz.o rm -f dz.s flp.o: ../dev/flp.c ${CC} -I. -c -S ${COPTS} ../dev/flp.c ${C2} flp.s | sed -f ../sys/asm.sed | ${AS} -o flp.o rm -f flp.s hp.o: ../dev/hp.c ${CC} -I. -c -S ${COPTS} ../dev/hp.c ${C2} -i hp.s | sed -f ../sys/asm.sed | ${AS} -o hp.o rm -f hp.s ht.o: ../dev/ht.c ${CC} -I. -c -S ${COPTS} ../dev/ht.c ${C2} -i ht.s | sed -f ../sys/asm.sed | ${AS} -o ht.o rm -f ht.s lp.o: ../dev/lp.c ${CC} -I. -c -S ${COPTS} ../dev/lp.c ${C2} -i lp.s | sed -f ../sys/asm.sed | ${AS} -o lp.o rm -f lp.s mba.o: ../dev/mba.c ${CC} -I. -c -S ${COPTS} ../dev/mba.c ${C2} -i mba.s | sed -f ../sys/asm.sed | ${AS} -o mba.o rm -f mba.s mem.o: ../dev/mem.c ${CC} -I. -c -S ${COPTS} ../dev/mem.c ${C2} mem.s | sed -f ../sys/asm.sed | ${AS} -o mem.o rm -f mem.s mx1.o: ../dev/mx1.c ${CC} -I. -c -S ${COPTS} ../dev/mx1.c ${C2} mx1.s | sed -f ../sys/asm.sed | ${AS} -o mx1.o rm -f mx1.s mx2.o: ../dev/mx2.c ${CC} -I. -c -S ${COPTS} ../dev/mx2.c ${C2} mx2.s | sed -f ../sys/asm.sed | ${AS} -o mx2.o rm -f mx2.s mt.o: ../dev/mt.c ${CC} -I. -c -S ${COPTS} ../dev/mt.c ${C2} -i mt.s | sed -f ../sys/asm.sed | ${AS} -o mt.o rm -f mt.s rk.o: ../dev/rk.c ${CC} -I. -c -S ${COPTS} ../dev/rk.c ${C2} -i rk.s | sed -f ../sys/asm.sed | ${AS} -o rk.o rm -f rk.s sw.o: ../dev/sw.c ${CC} -I. -c -S ${COPTS} ../dev/sw.c ${C2} sw.s | sed -f ../sys/asm.sed | ${AS} -o sw.o rm -f sw.s tm.o: ../dev/tm.c ${CC} -I. -c -S ${COPTS} ../dev/tm.c ${C2} -i tm.s | sed -f ../sys/asm.sed | ${AS} -o tm.o rm -f tm.s ts.o: ../dev/ts.c ${CC} -I. -c -S ${COPTS} ../dev/ts.c ${C2} -i ts.s | sed -f ../sys/asm.sed | ${AS} -o ts.o rm -f ts.s tty.o: ../dev/tty.c ${CC} -I. -c -S ${COPTS} ../dev/tty.c ${C2} tty.s | sed -f ../sys/asm.sed | ${AS} -o tty.o rm -f tty.s ttynew.o: ../dev/ttynew.c ${CC} -I. -c -S ${COPTS} ../dev/ttynew.c ${C2} ttynew.s | sed -f ../sys/asm.sed | ${AS} -o ttynew.o rm -f ttynew.s ttyold.o: ../dev/ttyold.c ${CC} -I. -c -S ${COPTS} ../dev/ttyold.c ${C2} ttyold.s | sed -f ../sys/asm.sed | ${AS} -o ttyold.o rm -f ttyold.s tu.o: ../dev/tu.c ${CC} -I. -c -S ${COPTS} ../dev/tu.c ${C2} tu.s | sed -f ../sys/asm.sed | ${AS} -o tu.o rm -f tu.s uba.o: ../dev/uba.c ${CC} -I. -c -S ${COPTS} ../dev/uba.c ${C2} -i uba.s | sed -f ../sys/asm.sed | ${AS} -o uba.o rm -f uba.s uda.o: ../dev/uda.c ${CC} -I. -c -S ${COPTS} ../dev/uda.c ${C2} -i uda.s | sed -f ../sys/asm.sed | ${AS} -o uda.o rm -f uda.s up.o: ../dev/up.c ${CC} -I. -c -S ${COPTS} ../dev/up.c ${C2} -i up.s | sed -f ../sys/asm.sed | ${AS} -o up.o rm -f up.s vaxcpu.o: ../dev/vaxcpu.c ${CC} -I. -c -S ${COPTS} ../dev/vaxcpu.c ${C2} vaxcpu.s | sed -f ../sys/asm.sed | ${AS} -o vaxcpu.o rm -f vaxcpu.s # DO NOT DELETE THIS LINE -- make depend uses it acct.o: ../h/param.h ../h/systm.h ../h/acct.h ../h/dir.h ../h/user.h acct.o: ../h/inode.h ../h/proc.h ../h/seg.h alloc.o: ../h/param.h ../h/systm.h ../h/mount.h ../h/filsys.h ../h/fblk.h alloc.o: ../h/conf.h ../h/buf.h ../h/inode.h ../h/ino.h ../h/dir.h ../h/user.h calloc.o: ../h/param.h ../h/dir.h ../h/user.h ../h/proc.h ../h/vm.h ../h/pte.h calloc.o: ../h/cmap.h clock.o: ../h/param.h ../h/systm.h ../h/dk.h ../h/callout.h ../h/seg.h clock.o: ../h/dir.h ../h/user.h ../h/proc.h ../h/reg.h ../h/psl.h ../h/vm.h clock.o: ../h/buf.h ../h/text.h ../h/vlimit.h ../h/mtpr.h ../h/clock.h clock.o: ../h/cpu.h bk.h dh.h dz.h fio.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/filsys.h fio.o: ../h/file.h ../h/conf.h ../h/inode.h ../h/reg.h ../h/acct.h ../h/mount.h iget.o: ../h/param.h ../h/systm.h ../h/mount.h ../h/dir.h ../h/user.h iget.o: ../h/inode.h ../h/ino.h ../h/filsys.h ../h/conf.h ../h/buf.h iget.o: ../h/inline.h ioctl.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/tty.h ioctl.o: ../h/proc.h ../h/inode.h ../h/file.h ../h/conf.h machdep.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/map.h machdep.o: ../h/reg.h ../h/mtpr.h ../h/clock.h ../h/pte.h ../h/vm.h ../h/proc.h machdep.o: ../h/psl.h ../h/buf.h ../h/ubavar.h ../h/ubareg.h ../h/cons.h machdep.o: ../h/reboot.h ../h/conf.h ../h/mem.h ../h/cpu.h ../h/inode.h machdep.o: ../h/file.h ../h/text.h ../h/clist.h ../h/callout.h ../h/cmap.h machdep.o: ../h/rpb.h main.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/filsys.h main.o: ../h/mount.h ../h/map.h ../h/proc.h ../h/inode.h ../h/seg.h ../h/conf.h main.o: ../h/buf.h ../h/mtpr.h ../h/pte.h ../h/clock.h ../h/vm.h ../h/cmap.h main.o: ../h/text.h ../h/vlimit.h ../h/clist.h nami.o: ../h/param.h ../h/systm.h ../h/inode.h ../h/mount.h ../h/dir.h nami.o: ../h/user.h ../h/buf.h ../h/conf.h pipe.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/inode.h pipe.o: ../h/file.h ../h/reg.h ../h/inline.h ../h/proc.h prf.o: ../h/param.h ../h/systm.h ../h/seg.h ../h/buf.h ../h/conf.h ../h/mtpr.h prf.o: ../h/reboot.h ../h/vm.h ../h/msgbuf.h ../h/dir.h ../h/user.h ../h/tty.h prim.o: ../h/param.h ../h/systm.h ../h/conf.h ../h/buf.h ../h/tty.h prim.o: ../h/clist.h rdwri.o: ../h/param.h ../h/systm.h ../h/inode.h ../h/dir.h ../h/user.h rdwri.o: ../h/buf.h ../h/conf.h ../h/cmap.h ../h/vlimit.h ../h/proc.h rmap.o: ../h/param.h ../h/systm.h ../h/map.h ../h/dir.h ../h/user.h ../h/proc.h rmap.o: ../h/mtpr.h ../h/text.h sig.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/proc.h sig.o: ../h/inode.h ../h/reg.h ../h/text.h ../h/seg.h ../h/mtpr.h ../h/pte.h sig.o: ../h/psl.h ../h/vm.h ../h/buf.h ../h/vlimit.h slp.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/proc.h ../h/file.h slp.o: ../h/inode.h ../h/vm.h ../h/pte.h ../h/inline.h ../h/mtpr.h subr.o: ../h/param.h ../h/systm.h ../h/conf.h ../h/inode.h ../h/dir.h subr.o: ../h/user.h ../h/buf.h ../h/proc.h ct.h sys.o: ../h/param.h ../h/systm.h ../h/conf.h ../h/dir.h ../h/user.h ../h/tty.h sys.o: ../h/proc.h sys1.o: ../h/param.h ../h/systm.h ../h/map.h ../h/mtpr.h ../h/dir.h ../h/user.h sys1.o: ../h/proc.h ../h/buf.h ../h/reg.h ../h/inode.h ../h/seg.h ../h/acct.h sys1.o: /usr/include/wait.h ../h/pte.h ../h/vm.h ../h/text.h ../h/psl.h sys1.o: ../h/vlimit.h ../h/file.h sys2.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/reg.h ../h/file.h sys2.o: ../h/inode.h ../h/pte.h ../h/vm.h ../h/buf.h ../h/mtpr.h ../h/proc.h sys2.o: ../h/inline.h sys3.o: ../h/param.h ../h/systm.h ../h/mount.h ../h/ino.h ../h/reg.h ../h/buf.h sys3.o: ../h/filsys.h ../h/dir.h ../h/user.h ../h/inode.h ../h/file.h sys3.o: ../h/conf.h ../h/stat.h ../h/inline.h sys4.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/reg.h sys4.o: ../h/inode.h ../h/proc.h ../h/clock.h ../h/mtpr.h ../h/timeb.h sys4.o: ../h/times.h ../h/reboot.h sysent.o: ../h/param.h ../h/systm.h ../h/vmsysent.h ../sys/vmsysent.c text.o: ../h/param.h ../h/systm.h ../h/map.h ../h/dir.h ../h/user.h ../h/proc.h text.o: ../h/text.h ../h/inode.h ../h/buf.h ../h/seg.h ../h/pte.h ../h/mtpr.h text.o: ../h/vm.h ../h/cmap.h trap.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/proc.h ../h/reg.h trap.o: ../h/seg.h ../h/trap.h ../h/psl.h ../h/pte.h ../h/inline.h ../h/mtpr.h vmdrum.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/proc.h vmdrum.o: ../h/buf.h ../h/text.h ../h/map.h ../h/pte.h ../h/vm.h ../h/cmap.h vmmem.o: ../h/param.h ../h/systm.h ../h/pte.h ../h/cmap.h ../h/dir.h vmmem.o: ../h/user.h ../h/proc.h ../h/mtpr.h ../h/text.h ../h/vm.h ../h/file.h vmmem.o: ../h/inode.h ../h/buf.h ../h/mount.h ../h/trace.h ../h/map.h vmmon.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/vmmeter.h vmmon.o: ../h/trace.h ../h/mtpr.h vmpage.o: ../h/param.h ../h/systm.h ../h/inode.h ../h/dir.h ../h/user.h vmpage.o: ../h/proc.h ../h/reg.h ../h/pte.h ../h/buf.h ../h/text.h ../h/mtpr.h vmpage.o: ../h/cmap.h ../h/vm.h ../h/file.h ../h/trace.h vmproc.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/proc.h vmproc.o: ../h/mtpr.h ../h/pte.h ../h/map.h ../h/cmap.h ../h/text.h ../h/vm.h vmpt.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/proc.h ../h/map.h vmpt.o: ../h/mt((pr.h ../h/pte.h ../h/cmap.h ../h/vm.h ../h/buf.h ../h/text.h vmpt.o: ../h/mount.h ../h/inode.h vmsched.o: ../h/param.h ../h/systm.h ../h/seg.h ../h/dir.h ../h/user.h vmsched.o: ../h/proc.h ../h/text.h ../h/vm.h ../h/cmap.h vmsubr.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/vm.h vmsubr.o: ../h/proc.h ../h/mtpr.h ../h/pte.h ../h/cmap.h ../h/inode.h vmsubr.o: ../h/buf.h ../h/text.h vmswap.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/proc.h vmswap.o: ../h/text.h ../h/map.h ../h/buf.h ../h/pte.h ../h/mtpr.h ../h/cmap.h vmswap.o: ../h/vm.h vmsys.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/proc.h vmsys.o: ../h/reg.h ../h/file.h ../h/inode.h ../h/vm.h ../h/buf.h ../h/pte.h vmsys.o: ../h/cmap.h ../h/tty.h ../h/mtpr.h ../h/vlimit.h ../h/trace.h autoconf.o: mba.h ../h/param.h ../h/systm.h ../h/map.h ../h/nexus.h ../h/pte.h autoconf.o: ../h/buf.h ../h/mbareg.h ../h/mbavar.h ../h/dk.h ../h/vm.h autoconf.o: ../h/ubareg.h ../h/ubavar.h ../h/mtpr.h ../h/cpu.h ../h/scb.h autoconf.o: ../h/mem.h bio.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/buf.h ../h/conf.h bio.o: ../h/proc.h ../h/seg.h ../h/pte.h ../h/vm.h ../h/trace.h conf.o: ../h/param.h ../h/systm.h ../h/buf.h ../h/tty.h ../h/conf.h ../h/text.h conf.o: ../h/dir.h ../h/user.h ../h/proc.h ../h/file.h ../h/inode.h ../h/acct.h conf.o: ../h/pte.h hp.h tu.h rk.h te.h ts.h mu.h ra.h up.h tj.h ct.h dh.h dz.h conf.o: lp.h va.h vp.h pty.h dn.h bk.h cons.o: ../h/param.h ../h/conf.h ../h/dir.h ../h/user.h ../h/tty.h ../h/systm.h cons.o: ../h/cons.h ../h/mtpr.h ../h/mx.h ../h/cpu.h dh.o: dh.h bk.h ../h/param.h ../h/conf.h ../h/dir.h ../h/user.h ../h/tty.h dh.o: ../h/map.h ../h/pte.h ../h/buf.h ../h/vm.h ../h/ubareg.h ../h/ubavar.h dh.o: ../h/bk.h ../h/clist.h ../h/mx.h ../h/file.h dkbad.o: ../h/param.h ../h/buf.h ../h/dkbad.h dkleave.o: ../h/param.h ../h/buf.h dn.o: dn.h ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/buf.h dn.o: ../h/map.h ../h/pte.h ../h/ubavar.h ../h/conf.h ../h/ioctl.h dsort.o: ../h/param.h ../h/systm.h ../h/buf.h dz.o: dz.h bk.h ../h/param.h ../h/systm.h ../h/tty.h ../h/dir.h ../h/user.h dz.o: ../h/map.h ../h/pte.h ../h/buf.h ../h/vm.h ../h/ubavar.h ../h/conf.h dz.o: ../h/pdma.h ../h/bk.h ../h/file.h ../h/mx.h flp.o: ../h/flp.h ../h/param.h ../h/systm.h ../h/conf.h ../h/dir.h ../h/user.h flp.o: ../h/mtpr.h ../h/buf.h ../h/cons.h ../h/cpu.h hp.o: hp.h ../h/param.h ../h/systm.h ../h/dk.h ../h/buf.h ../h/conf.h hp.o: ../h/dir.h ../h/user.h ../h/map.h ../h/pte.h ../h/mbareg.h ../h/mbavar.h hp.o: ../h/mtpr.h ../h/vm.h ../h/cmap.h ../h/dkbad.h ../h/hpreg.h ht.o: tu.h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h ht.o: ../h/file.h ../h/user.h ../h/map.h ../h/pte.h ../h/mbareg.h ../h/mbavar.h ht.o: ../h/mtio.h ../h/ioctl.h ../h/cmap.h ../h/cpu.h ../h/htreg.h lp.o: lp.h ../h/param.h ../h/dir.h ../h/user.h ../h/buf.h ../h/systm.h lp.o: ../h/map.h ../h/pte.h ../h/ubavar.h ../h/ioctl.h ../h/tty.h mba.o: mba.h ../h/param.h ../h/systm.h ../h/dk.h ../h/buf.h ../h/conf.h mba.o: ../h/dir.h ../h/user.h ../h/proc.h ../h/map.h ../h/pte.h ../h/mbareg.h mba.o: ../h/mbavar.h ../h/mtpr.h ../h/vm.h mem.o: ../h/param.h ../h/dir.h ../h/user.h ../h/conf.h ../h/buf.h ../h/systm.h mem.o: ../h/pte.h ../h/mtpr.h ../h/vm.h ../h/cmap.h mx1.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/reg.h ../h/proc.h mx1.o: ../h/tty.h ../h/inode.h ../h/mx.h ../h/file.h ../h/conf.h mx2.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/proc.h ../h/tty.h mx2.o: ../h/inode.h ../h/mx.h ../h/file.h ../h/conf.h ../h/buf.h mt.o: mu.h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h mt.o: ../h/file.h ../h/user.h ../h/map.h ../h/pte.h ../h/mbareg.h ../h/mbavar.h mt.o: ../h/mtio.h ../h/ioctl.h ../h/cmap.h ../h/cpu.h ../h/mtreg.h rk.o: rk.h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h rk.o: ../h/user.h ../h/pte.h ../h/map.h ../h/vm.h ../h/ubareg.h ../h/ubavar.h rk.o: ../h/dk.h ../h/cpu.h ../h/cmap.h ../h/dkbad.h ../h/rkreg.h sw.o: ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h ../h/user.h sw.o: ../h/inode.h ../h/map.h tm.o: te.h ts.h ../h/param.h ../h/systm.h ../h/buf.h ../h/dir.h ../h/conf.h tm.o: ../h/user.h ../h/file.h ../h/map.h ../h/pte.h ../h/vm.h ../h/ubareg.h tm.o: ../h/ubavar.h ../h/mtio.h ../h/ioctl.h ../h/cmap.h ../h/cpu.h tm.o: ../h/tmreg.h ts.o: ts.h ../h/param.h ../h/systm.h ../h/buf.h ../h/dir.h ../h/conf.h ts.o: ../h/user.h ../h/file.h ../h/map.h ../h/pte.h ../h/vm.h ../h/ubareg.h ts.o: ../h/ubavar.h ../h/mtio.h ../h/ioctl.h ../h/cmap.h ../h/cpu.h ts.o: ../h/tsreg.h tty.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/tty.h ../h/proc.h tty.o: ../h/mx.h ../h/inode.h ../h/file.h ../h/reg.h ../h/conf.h ../h/buf.h tty.o: ../h/dk.h ttynew.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/tty.h ttynew.o: ../h/proc.h ../h/mx.h ../h/inode.h ../h/file.h ../h/reg.h ../h/conf.h ttynew.o: ../h/buf.h ../h/dk.h ttyold.o: ../h/param.h ../h/systm.h ../h/dir.h ../h/user.h ../h/tty.h ttyold.o: ../h/proc.h ../h/mx.h ../h/inode.h ../h/file.h ../h/reg.h ../h/conf.h ttyold.o: ../h/buf.h ../h/dk.h tu.o: ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h ../h/user.h tu.o: ../h/mtpr.h ../h/cpu.h uba.o: ../h/param.h ../h/systm.h ../h/cpu.h ../h/map.h ../h/pte.h ../h/buf.h uba.o: ../h/vm.h ../h/ubareg.h ../h/ubavar.h ../h/dir.h ../h/user.h ../h/proc.h uba.o: ../h/conf.h ../h/mtpr.h ../h/nexus.h ../h/dk.h uda.o: ra.h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h uda.o: ../h/user.h ../h/pte.h ../h/map.h ../h/vm.h ../h/ubareg.h ../h/ubavar.h uda.o: ../h/dk.h ../h/cpu.h ../h/cmap.h ../h/udareg.h ../h/mscp.h up.o: up.h ../h/param.h ../h/systm.h ../h/cpu.h ../h/nexus.h ../h/dk.h up.o: ../h/buf.h ../h/conf.h ../h/dir.h ../h/user.h ../h/map.h ../h/pte.h up.o: ../h/mtpr.h ../h/vm.h ../h/ubavar.h ../h/ubareg.h ../h/cmap.h up.o: ../h/upreg.h vaxcpu.o: ../h/param.h ../h/pte.h ../h/ubareg.h ../h/nexus.h ../h/cpu.h .h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h uda.o: ../h/user.h ../h/pte.h ../h/map.h ../h/vm.h ../h/ubareg.h ../h/ubavar.h uda.o: ../h/dk.h ../h/cpu.h ../h/cmap.h ../h/udarsys/GENERIC/udiv.o 664 0 33 240 2662317776 7052 (<ЬPЬRRQ{RPPR PRPP  &#udivdivnodivretnoneh up.o: ../h/mtpr.h ../h/vm.h ../h/ubavar.h ../h/ubareg.h ../h/cmap.h up.o: ../h/upreg.h vaxcpu.o: ../h/param.h ../h/pte.h ../h/ubareg.h ../h/nexus.h ../h/cpu.h .h ../h/param.h ../h/systm.h ../h/buf.h ../h/conf.h ../h/dir.h uda.o: ../h/user.h ../h/pte.h ../h/m/hL,hL5< /,"sys/GENERIC/locore.c 664 0 33 57751 2664317320 7420 #ifdef LOCORE #define P_LINK 0 #define P_RLINK 4 #define P_ADDR 8 #define P_PRI 13 #define P_STAT 15 #define P_WCHAN 76 #define SSLEEP 1 #define SRUN 3 #define UBA_BRRVR 48 #define UH_UBA 0 #define UH_VEC 8 #define UH_SIZE 52 #define RP_FLAG 12 #define V_SWTCH 0 #define V_TRAP 4 #define V_SYSCALL 8 #define V_INTR 12 #define V_PDMA 16 #define UPAGES 8 #define CLSIZE 2 #define SYSPTSIZE 1536 #define USRPTSIZE 1024 #else asm(".set U_ARG,120"); asm(".set U_QSAV,140"); #endif /* scb.s 4.9 81/05/13 */ /* * System control block */ .set INTSTK,1 # handle this interrupt on the interrupt stack .set HALT,3 # halt if this interrupt occurs _scb: .globl _scb #define STRAY .long _Xstray+INTSTK #define STRAY8 STRAY;STRAY;STRAY;STRAY;STRAY;STRAY;STRAY;STRAY #define STRAY15 STRAY;STRAY;STRAY;STRAY;STRAY;STRAY;STRAY;STRAY8 #define KS(a) .long _X/**/a #define IS(a) .long _X/**/a+INTSTK #define STOP(a) .long _X/**/a+HALT /* 000 */ STRAY; IS(machcheck); IS(kspnotval); STOP(powfail); /* 010 */ KS(privinflt); KS(xfcflt); KS(resopflt); KS(resadflt); /* 020 */ KS(protflt); KS(transflt); KS(tracep); KS(bptflt); /* 030 */ KS(compatflt); KS(arithtrap); STRAY; STRAY; /* 040 */ KS(syscall); KS(chme); KS(chms); KS(chmu); /* 050 */ STRAY; IS(cmrd); STRAY; STRAY; /* 060 */ IS(wtime); STRAY; STRAY; STRAY; /* 070 */ STRAY; STRAY; STRAY; STRAY; /* 080 */ STRAY; STRAY; KS(astflt); STRAY; /* 090 */ STRAY; STRAY; STRAY; STRAY; /* 0a0 */ IS(softclock); STRAY; STRAY; STRAY; /* 0b0 */ STRAY; STRAY; STRAY; STRAY; /* 0c0 */ IS(hardclock); STRAY; STRAY; STRAY; /* 0d0 */ STRAY; STRAY; STRAY; STRAY; /* 0e0 */ STRAY; STRAY; STRAY; STRAY; /* 0f0 */ IS(consdin); IS(consdout); IS(cnrint); IS(cnxint); /* 100 */ IS(nexzvec); STRAY15; /* ipl 0x14, nexus 0-15 */ /* 140 */ IS(nexzvec); STRAY15; /* ipl 0x15, nexus 0-15 */ /* 180 */ IS(nexzvec); STRAY15; /* ipl 0x16, nexus 0-15 */ /* 1c0 */ IS(nexzvec); STRAY15; /* ipl 0x17, nexus 0-15 */ .globl _UNIvec _UNIvec: .space 512 # 750 unibus intr vector # 1st UBA jump table on 780's /* locore.s 4.55- 82/02/17 */ #include "../h/mtpr.h" #include "../h/trap.h" #include "../h/psl.h" #include "../h/pte.h" #include "../h/cpu.h" #include "../h/nexus.h" #include "../h/ubareg.h" #include "dz.h" #include "mba.h" .set HIGH,0x1f # mask for total disable .set MCKVEC,4 # offset into scb of machine check vector .set NBPG,512 .set PGSHIFT,9 .set NISP,3 # number of interrupt stack pages /* * User structure is UPAGES at top of user space. */ .globl _u .set _u,0x80000000 - UPAGES*NBPG (( /* * Restart parameter block * This is filled in in machdep.c in startup(). * It MUST be page aligned. * When auto-restart occurs, we run restart() in machdep.c, which * takes a core-dump and then cold-starts. */ .globl _rpb _rpb: .space 508 erpb: .space 4 .globl _intstack _intstack: .space NISP*NBPG eintstack: /* * Do a dump. * Called by auto-restart. * May be called manually. */ .align 2 .globl _doadump _doadump: nop; nop # .word 0x0101 #define _rpbmap _Sysmap+8 # scb, UNIvec, rpb, istack*4 bicl2 $PG_PROT,_rpbmap bisl2 $PG_KW,_rpbmap tstl _rpb+RP_FLAG # dump only once! bneq 1f incl _rpb+RP_FLAG mtpr $0,$TBIA movl sp,erpb movab erpb,sp mfpr $PCBB,-(sp) mfpr $MAPEN,-(sp) mfpr $IPL,-(sp) mtpr $0,$MAPEN mtpr $HIGH,$IPL pushr $0x3fff calls $0,_dumpsys 1: halt /* * Interrupt vector routines */ .globl _waittime #define SCBVEC(name) .align 2; .globl _X/**/name; _X/**/name #define PANIC(msg) clrl _waittime; pushab 1f; \ calls $1,_panic; 1: .asciz msg #define PRINTF(n,msg) pushab 1f; calls $n+1,_printf; MSG(msg) #define MSG(msg) .data; 1: .asciz msg; .text #define PUSHR pushr $0x3f #define POPR popr $0x3f SCBVEC(machcheck): PUSHR; pushab 6*4(sp); calls $1,_machinecheck; POPR; addl2 (sp)+,sp; rei SCBVEC(kspnotval): PUSHR; PANIC("KSP not valid"); SCBVEC(powfail): halt SCBVEC(chme): SCBVEC(chms): SCBVEC(chmu): PUSHR; PANIC("CHM? in kernel"); SCBVEC(stray): PUSHR; PRINTF(0, "stray scb interrupt\n"); POPR; rei SCBVEC(nexzvec): PUSHR; mfpr $IPL,-(sp); PRINTF(1, "nexus stray intr ipl%x\n"); POPR; rei SCBVEC(cmrd): PUSHR; calls $0,_memerr; POPR; rei SCBVEC(wtime): PUSHR; pushl 6*4(sp); PRINTF(1,"write timeout %x\n"); POPR; PANIC("wtimo"); #if NMBA > 0 SCBVEC(mba3int): PUSHR; pushl $3; brb 1f SCBVEC(mba2int): PUSHR; pushl $2; brb 1f SCBVEC(mba1int): PUSHR; pushl $1; brb 1f SCBVEC(mba0int): PUSHR; pushl $0 1: calls $1,_mbintr POPR incl _cnt+V_INTR rei #endif #if VAX780 /* * Registers for the uba handling code */ #define rUBANUM r0 #define rUBAHD r1 #define rUVEC r3 #define rUBA r4 /* r2,r5 are scratch */ SCBVEC(ua3int): PUSHR; movl $3,rUBANUM; moval _uba_hd+(3*UH_SIZE),rUBAHD; brb 1f SCBVEC(ua2int): PUSHR; movl $2,rUBANUM; moval _uba_hd+(2*UH_SIZE),rUBAHD; brb 1f SCBVEC(ua1int): PUSHR; movl $1,rUBANUM; moval _uba_hd+(1*UH_SIZE),rUBAHD; brb 1f SCBVEC(ua0int): PUSHR; movl $0,rUBANUM; moval _uba_hd+(0*UH_SIZE),rUBAHD; 1: incl _cnt+V_INTR mfpr $IPL,r2 /* r2 = mfpr(IPL); */ movl UH_UBA(rUBAHD),rUBA /* uba = uhp->uh_uba; */ movl UBA_BRRVR-0x14*4(rUBA)[r2],rUVEC /* uvec = uba->uba_brrvr[r2-0x14] */ ubanorm: bleq ubaerror addl2 UH_VEC(rUBAHD),rUVEC /* uvec += uh->uh_vec */ bicl3 $3,(rUVEC),r1 jmp 2(r1) /* 2 skips ``pushr $0x3f'' */ ubaerror: PUSHR; calls $0,_ubaerror; POPR /* ubaerror r/w's r0-r5 */ tstl rUVEC; jneq ubanorm /* rUVEC contains result */ POPR rei #endif SCBVEC(cnrint): PUSHR; calls $0,_cnrint; POPR; incl _cnt+V_INTR; rei SCBVEC(cnxint): PUSHR; calls $0,_cnxint; POPR; incl _cnt+V_INTR; rei SCBVEC(hardclock): PUSHR pushl 4+6*4(sp); pushl 4+6*4(sp); calls $2,_hardclock # hardclock(pc,psl) POPR; incl _cnt+V_INTR ## temp so not to break vmstat -= HZ rei SCBVEC(softclock): PUSHR pushl 4+6*4(sp); pushl 4+6*4(sp); calls $2,_softclock # softclock(pc,psl) POPR; rei #if defined(VAX750) || defined(VAX7ZZ) SCBVEC(consdin): PUSHR; calls $0,_turintr; POPR; incl _cnt+V_INTR; rei SCBVEC(consdout): PUSHR; calls $0,_tuxintr; POPR; incl _cnt+V_INTR; rei #else SCBVEC(consdin): halt SCBVEC(consdout): halt #endif #if NDZ > 0 /* * DZ pseudo dma routine: * r0 - controller number */ .align 1 .globl _dzdma _dzdma: mull2 $8*20,r0 movab _dzpdma(r0),r3 # pdma structure base # for this controller dzploop: movl r3,r0 movl (r0)+,r1 # device register address movzbl 1(r1),r2 # get line number bitb $0x80,r2 # TRDY on? beql dzprei # no bicb2 $0xf8,r2 # clear garbage bits mull2 $20,r2 addl2 r2,r0 # point at line's pdma structure movl (r0)+,r2 # p_mem cmpl r2,(r0)+ # p_mem < p_end ? bgequ dzpcall # no, go call dzxint movb (r2)+,6(r1) # dztbuf = *p_mem++ movl r2,-8(r0) brb dzploop # check for another line dzprei: POPR incl _cnt+V_PDMA rei dzpcall: pushl r3 pushl (r0)+ # push tty address calls $1,*(r0) # call interrupt rtn movl (sp)+,r3 brb dzploop # check for another line #endif /* * Stray UNIBUS interrupt catch routines */ .data .align 2 #define PJ PUSHR;jsb _Xustray .globl _catcher _catcher: PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ .globl _cold _cold: .long 1 .data .text SCBVEC(ustray): blbc _cold,1f mfpr $IPL,r11 subl3 $_catcher+8,(sp)+,r10 ashl $-1,r10,r10 POPR rei 1: subl3 $_catcher+8,(sp)+,r0 ashl $-1,r0,-(sp) mfpr $IPL,-(sp) PRINTF(2, "uba?: stray intr ipl %x vec %o\n") POPR rei /* * Trap and fault vector routines */ #define TRAP(a) pushl $a; brw alltraps /* * Ast delivery (profiling and/or reschedule) */ SCBVEC(astflt): pushl $0; TRAP(ASTFLT) SCBVEC(privinflt): pushl $0; TRAP(PRIVINFLT) SCBVEC(xfcflt): pushl $0; TRAP(XFCFLT) SCBVEC(resopflt): pushl $0; TRAP(RESOPFLT) SCBVEC(resadflt): pushl $0; TRAP(RESADFLT) SCBVEC(bptflt): pushl $0; TRAP(BPTFLT) SCBVEC(compatflt): TRAP(COMPATFLT); SCBVEC(tracep): pushl $0; TRAP(TRCTRAP) SCBVEC(arithtrap): TRAP(ARITHTRAP) SCBVEC(protflt): blbs (sp)+,segflt TRAP(PROTFLT) segflt: TRAP(SEGFLT) SCBVEC(transflt): bitl $1,(sp)+ bnequ tableflt TRAP(PAGEFLT) tableflt: TRAP(TABLEFLT) alltraps: mfpr $USP,-(sp); calls $0,_trap; mtpr (sp)+,$USP incl _cnt+V_TRAP addl2 $8,sp # pop type, code mtpr $HIGH,$IPL ## dont go to a higher IPL (GROT) rei SCBVEC(syscall): pushl $SYSCALL mfpr $USP,-(sp); calls $0,_syscall; mtpr (sp)+,$USP incl _cnt+V_SYSCALL addl2 $8,sp # pop type, code mtpr $HIGH,$IPL ## dont go to a higher IPL (GROT) rei /* * System page table */ #define vaddr(x) ((((x)-_Sysmap)/4)*NBPG+0x80000000) #define SYSMAP(mname, vname, npte) \ _/**/mname: .globl _/**/mname; \ .space npte*4; \ .globl _/**/vname; \ .set _/**/vname,vaddr(_/**/mname) .data .align 2 SYSMAP(Sysmap ,Sysbase ,SYSPTSIZE ) SYSMAP(UMBAbeg ,umbabeg ,0 ) SYSMAP(Nexmap ,nexus ,16*MAXNNEXUS ) SYSMAP(UMEMmap ,umem ,16*MAXNUBA ) SYSMAP(UMBAend ,umbaend ,0 ) SYSMAP(Usrptmap ,usrpt ,USRPTSIZE ) SYSMAP(Forkmap ,forkutl ,UPAGES ) SYSMAP(Xswapmap ,xswaputl ,UPAGES ) SYSMAP(Xswap2map,xswap2utl ,UPAGES ) SYSMAP(Swapmap ,swaputl ,UPAGES ) SYSMAP(Pushmap ,pushutl ,UPAGES ) SYSMAP(Vfmap ,vfutl ,UPAGES ) SYSMAP(CMAP1 ,CADDR1 ,1 ) SYSMAP(CMAP2 ,CADDR2 ,1 ) SYSMAP(mcrmap ,mcr ,1 ) SYSMAP(mmap ,vmmap ,1 ) SYSMAP(msgbufmap,msgbuf ,CLSIZE ) SYSMAP(camap ,cabase ,16*CLSIZE ) SYSMAP(ecamap ,calimit ,0 ) #ifdef BBNNET SYSMAP(Netmap ,netutl ,NNETPAGES*CLSIZE) #endif eSysmap: .globl _Syssize .set _Syssize,(eSysmap-_Sysmap)/4 .text /* * Initialization * * ipl 0x1f; mapen 0; scbb, pcbb, sbr, slr, isp, ksp not set */ .data .globl _cpu _cpu: .long 0 .text .globl start start: .word 0 /* set system control block base and system page table params */ mtpr $_scb-0x80000000,$SCBB mtpr $_Sysmap-0x80000000,$SBR mtpr $_Syssize,$SLR /* double map the kernel into the virtual user addresses of phys mem */ mtpr $_Sysmap,$P0BR mtpr $_Syssize,$P0LR /* set ISP and get cpu type */ movl $_intstack+NISP*NBPG,sp mfpr $SID,r0 movab _cpu,r1 extzv $24,$8,r0,(r1) /* init RPB */ movab _rpb,r0 movl r0,(r0)+ # rp_selfref movab _doadump,r1 movl r1,(r0)+ # rp_dumprout movl $0x1f,r2 clrl r3 1: addl2 (r1)+,r3; sobgtr r2,1b movl r3,(r0)+ # rp_chksum /* count up memory */ clrl r7 1: pushl $4; pushl r7; calls $2,_badaddr; tstl r0; bneq 9f acbl $8096*1024-1,$64*1024,r7,1b 9: /* clear memory from kernel bss and pages for proc 0 u. and page table */ movab _edata,r6 movab _end,r5 bbcc $31,r5,0f; 0: addl2 $(UPAGES*NBPG)+NBPG+NBPG,r5 1: clrq (r6); acbl r5,$8,r6,1b /* trap() and syscall() save r0-r11 in the entry mask (per ../h/reg.h) */ bisw2 $0x0fff,_trap bisw2 $0x0fff,_syscall calls $0,_fixctlrmask /* initialize system page table: scb and int stack writeable */ clrl r2 movab eintstack,r1; bbcc $31,r1,0f; 0: ashl $-PGSHIFT,r1,r1 1: bisl3 $PG_V|PG_KW,r2,_Sysmap[r2]; aoblss r1,r2,1b /* make rpb read-only as red zone for interrupt stack */ bicl2 $PG_PROT,_rpbmap bisl2 $PG_KR,_rpbmap /* make kernel text space read-only */ movab _etext+NBPG-1,r1; bbcc $31,r1,0f; 0: ashl $-PGSHIFT,r1,r1 1: bisl3 $PG_V|PG_KR,r2,_Sysmap[r2]; aoblss r1,r2,1b /* make kernel data, bss, read-write */ movab _end+NBPG-1,r1; bbcc $31,r1,0f; 0:; ashl $-PGSHIFT,r1,r1 1: bisl3 $PG_V|PG_KW,r2,_Sysmap[r2]; aoblss r1,r2,1b /* now go to mapped mode */ mtpr $1,$TBIA; mtpr $1,$MAPEN; jmp *$0f; 0: /* init mem sizes */ ashl $-PGSHIFT,r7,_maxmem movl _maxmem,_physmem movl _maxmem,_freemem /* setup context for proc[0] == Scheduler */ movab _end+NBPG-1,r6 bicl2 $NBPG-1,r6 # make page boundary /* setup page table for proc[0] */ bbcc $31,r6,0f; 0: ashl $-PGSHIFT,r6,r3 # r3 = btoc(r6) bisl3 $PG_V|PG_KW,r3,_Usrptmap # init first upt entry incl r3 movab _usrpt,r0 mtpr r0,$TBIS /* init p0br, p0lr */ mtpr r0,$P0BR mtpr $0,$P0LR /* init p1br, p1lr */ movab NBPG(r0),r0 movl $0x200000-UPAGES,r1 mtpr r1,$P1LR mnegl r1,r1 moval -4*UPAGES(r0)[r1],r2 mtpr r2,$P1BR /* setup mapping for UPAGES of _u */ movl $UPAGES,r2; movab _u+NBPG*UPAGES,r1; addl2 $UPAGES,r3; jbr 2f 1: decl r3 moval -NBPG(r1),r1; bisl3 $PG_V|PG_URKW,r3,-(r0) mtpr r1,$TBIS 2: sobgeq r2,1b /* initialize (slightly) the pcb */ movab UPAGES*NBPG(r1),PCB_KSP(r1) mnegl $1,PCB_ESP(r1) mnegl $1,PCB_SSP(r1) movl r1,PCB_USP(r1) mfpr $P0BR,PCB_P0BR(r1) mfpr $P0LR,PCB_P0LR(r1) movb $4,PCB_P0LR+3(r1) # disable ast mfpr $P1BR,PCB_P1BR(r1) mfpr $P1LR,PCB_P1LR(r1) movl $CLSIZE,PCB_SZPT(r1) # init u.u_pcb.pcb_szpt movl r1((1,PCB_R11(r1) movab 1f,PCB_PC(r1) # initial pc clrl PCB_PSL(r1) # mode(k,k), ipl=0 ashl $PGSHIFT,r3,r3 mtpr r3,$PCBB # first pcbb /* set regs, p0br, p0lr, p1br, p1lr, astlvl, ksp and change to kernel mode */ ldpctx rei /* put signal trampoline code in u. area */ 1: movab _u,r0 movc3 $12,sigcode,PCB_SIGC(r0) /* save reboot flags in global _boothowto */ movl r11,_boothowto /* calculate firstaddr, and call main() */ movab _end+NBPG-1,r0; bbcc $31,r0,0f; 0:; ashl $-PGSHIFT,r0,-(sp) addl2 $UPAGES+1,(sp); calls $1,_main /* proc[1] == /etc/init now running here; run icode */ pushl $PSL_CURMOD|PSL_PRVMOD; pushl $0; rei /* signal trampoline code: it is known that this code takes exactly 12 bytes */ /* in ../h/pcb.h and in the movc3 above */ sigcode: calls $3,1(pc) rei .word 0x7f # registers 0-6 (6==sp/compat) callg (ap),*12(ap) ret /* * Primitives */ /* * badaddr(addr, len) * see if access addr with a len type instruction causes a machine check * len is length of access (1=byte, 2=short, 4=long) */ .globl _badaddr _badaddr: .word 0 movl $1,r0 mfpr $IPL,r1 mtpr $HIGH,$IPL movl _scb+MCKVEC,r2 movl 4(ap),r3 movl 8(ap),r4 movab 9f+INTSTK,_scb+MCKVEC bbc $0,r4,1f; tstb (r3) 1: bbc $1,r4,1f; tstw (r3) 1: bbc $2,r4,1f; tstl (r3) 1: clrl r0 # made it w/o machine checks 2: movl r2,_scb+MCKVEC mtpr r1,$IPL ret .align 2 9: casel _cpu,$1,$VAX_MAX 0: .word 8f-0b # 1 is 780 .word 5f-0b # 2 is 750 .word 5f-0b # 3 is 7ZZ 5: #if defined(VAX750) || defined(VAX7ZZ) mtpr $0xf,$MCESR #endif brb 1f 8: #if VAX780 mtpr $0,$SBIFS #endif 1: addl2 (sp)+,sp # discard mchchk trash movab 2b,(sp) rei _addupc: .globl _addupc .word 0x0 movl 8(ap),r2 # &u.u_prof subl3 8(r2),4(ap),r0 # corrected pc blss 9f extzv $1,$31,r0,r0 # logical right shift extzv $1,$31,12(r2),r1 # ditto for scale emul r1,r0,$0,r0 ashq $-14,r0,r0 tstl r1 bneq 9f incl r0 bicl2 $1,r0 cmpl r0,4(r2) # length bgequ 9f addl2 (r2),r0 # base probew $3,$2,(r0) beql 8f addw2 12(ap),(r0) 9: ret 8: clrl 12(r2) ret _Copyin: .globl _Copyin # <<>> movl 12(sp),r0 # copy length blss ersb movl 4(sp),r1 # copy user address cmpl $NBPG,r0 # probing one page or less ? bgeq cishort # yes ciloop: prober $3,$NBPG,(r1) # bytes accessible ? beql ersb # no addl2 $NBPG,r1 # incr user address ptr acbl $NBPG+1,$-NBPG,r0,ciloop # reduce count and loop cishort: prober $3,r0,(r1) # bytes accessible ? beql ersb # no movc3 12(sp),*4(sp),*8(sp) clrl r0 rsb ersb: mnegl $1,r0 rsb _Copyout: .globl _Copyout # <<>> movl 12(sp),r0 # get count blss ersb movl 8(sp),r1 # get user address cmpl $NBPG,r0 # can do in one probew? bgeq coshort # yes coloop: probew $3,$NBPG,(r1) # bytes accessible? beql ersb # no addl2 $NBPG,r1 # increment user address acbl $NBPG+1,$-NBPG,r0,coloop # reduce count and loop coshort: probew $3,r0,(r1) # bytes accessible? beql ersb # no movc3 12(sp),*4(sp),*8(sp) clrl r0 rsb /* * non-local goto's */ .globl _Setjmp _Setjmp: movq r6,(r0)+ movq r8,(r0)+ movq r10,(r0)+ movq r12,(r0)+ addl3 $4,sp,(r0)+ movl (sp),(r0) clrl r0 rsb .globl _Longjmp _Longjmp: movq (r0)+,r6 movq (r0)+,r8 movq (r0)+,r10 movq (r0)+,r12 movl (r0)+,r1 cmpl r1,sp # must be a pop bgequ lj2 pushab lj1 calls $1,_panic lj2: movl r1,sp jmp *(r0) # ``rsb'' lj1: .asciz "longjmp" .globl _whichqs .globl _qs .globl _cnt .globl _noproc .comm _noproc,4 .globl _runrun .comm _runrun,4 /* * The following primitives use the fancy VAX instructions * much like VMS does. _whichqs tells which of the 32 queues _qs * have processes in them. Setrq puts processes into queues, Remrq * removes them from queues. The running process is on no queue, * other processes are on a queue related to p->p_pri, divided by 4 * actually to shrink the 0-127 range of priorities into the 32 available * queues. */ /* * Setrq(p), using fancy VAX instructions. * * Call should be made at spl6(), and p->p_stat should be SRUN */ .globl _Setrq # <<>> _Setrq: tstl P_RLINK(r0) ## firewall: p->p_rlink must be 0 beql set1 ## pushab set3 ## calls $1,_panic ## set1: movzbl P_PRI(r0),r1 # put on queue which is p->p_pri / 4 ashl $-2,r1,r1 movaq _qs[r1],r2 insque (r0),*4(r2) # at end of queue bbss r1,_whichqs,set2 # mark queue non-empty set2: rsb set3: .asciz "setrq" /* * Remrq(p), using fancy VAX instructions * * Call should be made at spl6(). */ .globl _Remrq # <<>> _Remrq: movzbl P_PRI(r0),r1 ashl $-2,r1,r1 bbsc r1,_whichqs,rem1 pushab rem3 # it wasn't recorded to be on its q calls $1,_panic rem1: remque (r0),r2 beql rem2 bbss r1,_whichqs,rem2 rem2: clrl P_RLINK(r0) ## for firewall checking rsb rem3: .asciz "remrq" /* * Masterpaddr is the p->p_addr of the running process on the master * processor. When a multiprocessor system, the slave processors will have * an array of slavepaddr's. */ .globl _masterpaddr .data _masterpaddr: .long 0 .text sw0: .asciz "swtch" /* * Swtch(), using fancy VAX instructions */ .globl _Swtch _Swtch: # <<>> movl $1,_noproc clrl _runrun sw1: ffs $0,$32,_whichqs,r0 # look for non-empty queue bneq sw1a mtpr $0,$IPL # must allow interrupts here brw sw1 # this is an idle loop! sw1a: mtpr $0x18,$IPL # lock out all so _whichqs==_qs bbcc r0,_whichqs,sw1 # proc moved via lbolt interrupt movaq _qs[r0],r1 remque *(r1),r2 # r2 = p = highest pri process bvc sw2 # make sure something was there sw1b: pushab sw0 calls $1,_panic sw2: beql sw3 insv $1,r0,$1,_whichqs # still more procs in this queue sw3: clrl _noproc tstl P_WCHAN(r2) ## firewalls bneq sw1b ## movzbl P_STAT(r2),r3 ## cmpl $SRUN,r3 ## bneq sw1b ## clrl P_RLINK(r2) ## movl *P_ADDR(r2),r0 movl r0,_masterpaddr ashl $PGSHIFT,r0,r0 # r0 = pcbb(p) /* mfpr $PCBB,r1 # resume of current proc is easy * cmpl r0,r1 */ beql res0 incl _cnt+V_SWTCH /* fall into... */ /* * Resume(pf) */ .globl _Resume # <<>> _Resume: mtpr $0x18,$IPL # no interrupts, please movl _CMAP2,_u+PCB_CMAP2 # yech svpctx mtpr r0,$PCBB ldpctx movl _u+PCB_CMAP2,_CMAP2 # yech mtpr $_CADDR2,$TBIS res0: tstl _u+PCB_SSWAP beql res1 movl _u+PCB_SSWAP,r0 clrl _u+PCB_SSWAP movab _Longjmp,(sp) movl $PSL_PRVMOD,4(sp) # ``cheating'' (jfr) res1: rei /* * {fu,su},{byte,word}, all massaged by asm.sed to jsb's */ .globl _Fuword _Fuword: prober $3,$4,(r0) beql fserr movl (r0),r0 rsb fserr: mnegl $1,r0 rsb .globl _Fubyte _Fubyte: prober $3,$1,(r0) beql fserr movzbl (r0),r0 rsb .globl _Suword _Suword: probew $3,$4,(r0) beql fserr movl r1,(r0) clrl r0 rsb .globl _Subyte _Subyte: probew $3,$1,(r0) beql fserr movb r1,(r0) clrl r0 rsb /* * Copy 1 relocation unit (NBPG bytes) * from user virtual address to physical address */ _copyseg: .globl _copyseg .word 0x0 bisl3 $PG_V|PG_KW,8(ap),_CMAP2 mtpr $_CADDR2,$TBIS # invalidate entry for copy movc3 $NBPG,*4(ap),_CADDR2 ret /* * zero out physical memory * specified in relocation units (NBPG bytes) */ _clearseg: .globl _clearseg .word 0x0 bisl3 $PG_V|PG_KW,4(ap),_CMAP1 mtpr $_CADDR1,$TBIS movc5 $0,(sp),$0,$NBPG,_CADDR1 ret /* * Check address. * Given virtual address, byte count, and rw flag * returns 0 on no access. */ _useracc: .globl _useracc .word 0x0 movl 4(ap),r0 # get va movl 8(ap),r1 # count tstl 12(ap) # test for read access ? bneq userar # yes cmpl $NBPG,r1 # can we do it in one probe ? bgeq uaw2 # yes uaw1: probew $3,$NBPG,(r0) beql uaerr # no access addl2 $NBPG,r0 acbl $NBPG+1,$-NBPG,r1,uaw1 uaw2: probew $3,r1,(r0) beql uaerr movl $1,r0 ret userar: cmpl $NBPG,r1 bgeq uar2 uar1: prober $3,$NBPG,(r0) beql uaerr addl2 $NBPG,r0 acbl $NBPG+1,$-NBPG,r1,uar1 uar2: prober $3,r1,(r0) beql uaerr movl $1,r0 ret uaerr: clrl r0 ret /* * kernacc - check for kernel access privileges * * We can't use the probe instruction directly because * it ors together current and previous mode. */ .globl _kernacc _kernacc: .word 0x0 movl 4(ap),r0 # virtual address bbcc $31,r0,kacc1 bbs $30,r0,kacerr mfpr $SBR,r2 # address and length of page table (system) bbss $31,r2,0f; 0: mfpr $SLR,r3 brb kacc2 kacc1: bbsc $30,r0,kacc3 mfpr $P0BR,r2 # user P0 mfpr $P0LR,r3 brb kacc2 kacc3: mfpr $P1BR,r2 # user P1 (stack) mfpr $P1LR,r3 kacc2: addl3 8(ap),r0,r1 # ending virtual address addl2 $NBPG-1,r1 ashl $-PGSHIFT,r0,r0 ashl $-PGSHIFT,r1,r1 bbs $31,4(ap),kacc6 bbc $30,4(ap),kacc6 cmpl r0,r3 # user stack blss kacerr # address too low brb kacc4 kacc6: cmpl r1,r3 # compare last page to P0LR or SLR bgtr kacerr # address too high kacc4: movl (r2)[r0],r3 bbc $31,4(ap),kacc4a bbc $31,r3,kacerr # valid bit is off kacc4a: cmpzv $27,$4,r3,$1 # check protection code bleq kacerr # no access allowed tstb 12(ap) bneq kacc5 # only check read access cmpzv $27,$2,r3,$3 # check low 2 bits of prot code beql kacerr # no write access kacc5: aoblss r1,r0,kacc4 # next page movl $1,r0 # no errors ret kacerr: clrl r0 # error ret .globl _Xrkintr0 .align 2 _Xrkintr0: pushr $0x3f pushl $0 calls $1,_rkintr popr $0x3f rei .globl _Xlpintr0 .align 2 _Xlpintr0: pushr $0x3f pushl $0 calls $1,_lpintr popr $0x3f rei .globl _Xtmintr0 .align 2 _Xtmintr0: pushr $0x3f pushl $0 calls $1,_tmintr popr $0x3f rei .globl _Xupintr0 .align 2 _Xupintr0: pushr $0x3f pushl $0 calls $1,_upintr popr $0x3f rei .globl _Xudintr0 .align 2 _Xudintr0: pushr $0x3f pushl $0 calls $1,_udintr popr $0x3f rei .globl _Xdnintr0 .align 2 _Xdnintr0: pushr $0x3f pushl $0 calls $1,_dnintr popr $0x3f rei .globl _Xdhrint0 .align 2 _Xdhrint0: pushr $0x3f pushl $0 calls $1,_dhrint popr $0x3f rei .globl _Xdhxint0 .align 2 _Xdhxint0: pushr $0x3f pushl $0 calls $1,_dhxint popr $0x3f rei .globl _Xdhrint1 .align 2 _Xdhrint1: pushr $0x3f pushl $1 calls $1,_dhrint popr $0x3f rei .globl _Xdhxint1 .align 2 _Xdhxint1: pushr $0x3f pushl $1 calls $1,_dhxint po((pr $0x3f rei .globl _Xdzrint0 .align 2 _Xdzrint0: pushr $0x3f pushl $0 calls $1,_dzrint popr $0x3f rei .globl _Xdzxint0 .align 2 _Xdzxint0: pushr $0x3f movl $0,r0 jbr _dzdma .globl _Xdzrint1 .align 2 _Xdzrint1: pushr $0x3f pushl $1 calls $1,_dzrint popr $0x3f rei .globl _Xdzxint1 .align 2 _Xdzxint1: pushr $0x3f movl $1,r0 jbr _dzdma .globl _Xdzrint2 .align 2 _Xdzrint2: pushr $0x3f pushl $2 calls $1,_dzrint popr $0x3f rei .globl _Xdzxint2 .align 2 _Xdzxint2: pushr $0x3f movl $2,r0 jbr _dzdma .globl _Xdzrint3 .align 2 _Xdzrint3: pushr $0x3f pushl $3 calls $1,_dzrint popr $0x3f rei .globl _Xdzxint3 .align 2 _Xdzxint3: pushr $0x3f movl $3,r0 jbr _dzdma .globl _Xdzrint4 .align 2 _Xdzrint4: pushr $0x3f pushl $4 calls $1,_dzrint popr $0x3f rei .globl _Xdzxint4 .align 2 _Xdzxint4: pushr $0x3f movl $4,r0 jbr _dzdma .globl _Xdzrint5 .align 2 _Xdzrint5: pushr $0x3f pushl $5 calls $1,_dzrint popr $0x3f rei .globl _Xdzxint5 .align 2 _Xdzxint5: pushr $0x3f movl $5,r0 jbr _dzdma .globl _Xdzrint6 .align 2 _Xdzrint6: pushr $0x3f pushl $6 calls $1,_dzrint popr $0x3f rei .globl _Xdzxint6 .align 2 _Xdzxint6: pushr $0x3f movl $6,r0 jbr _dzdma .globl _Xdzrint7 .align 2 _Xdzrint7: pushr $0x3f pushl $7 calls $1,_dzrint popr $0x3f rei .globl _Xdzxint7 .align 2 _Xdzxint7: pushr $0x3f movl $7,r0 jbr _dzdma .globl _Xtsintr0 .align 2 _Xtsintr0: pushr $0x3f pushl $0 calls $1,_tsintr popr $0x3f rei int5 .align 2 _Xdzxintsys/GENERIC/locore.o 664 0 33 65475 2664317337 7446 82  U i  @   ʏxȏ19^^~8~~8???^?KSP not valid?h[CHM? in kernel?| =??~z &????ݮn ?wtimo??????PIQ.?PQ?PQ?P}QRaTBS ScQ?U?S??C?G?/?3?ݮݮ??ݮݮ?????ďPSSPЀQRRRRRPЀRRRԺ?S݀ЎS [ÏZxZZ?ÏPxP~~ I?1`1X1P1H1@18 12 1(1" 11 1 1~ڎ^~ڎ^ڏڏ ڏ ڏڏ Џ ^>Pc:QPacPPYQQRSSRSWWP~W"VUUU|fUVRQQxQQɏRBk QRʏxd ȏY QQxQQɏRB4 QRQQxQQɏRB QR98xW^XSMHAVʏVVxVSɏS'SoPP:P PЏQQ QQARR RQSSQɏSpQ:RaQ P TW X \`[<HԡLx SSSP( ,l[}vPPxP~ ncݏl PQARЬSЬT'-TcTcTcPRQ7 &0^nЬRâP1PP QzQPPyPPQPPP bP ` `Ԣ Ю P:ЮQяP a%QP Pa ( PPЮ PЮQяP aQP Pa( P}V}X}Z}\^n`P}V}X}Z}\ЀQQ^ Q^longjmpՠ % QxQQ~AR`Qsetrq QxQQQ `RQzԠremrqswtchb\ TP1PA~@9QR % PբLݚSSԢвPP5x PP+C5BP7.5ڏ:)!PnЏ ``PP ``P `Q`P `Q`Pɏ4ڏ:(Qɏ4ڏ:,n.ЬPЬQլ 0яQ `OPQ Q`4PяQ `PQ Q`PPЬPPPr RR SPR S R SPQQxPPxQQ PS/QS(@bSSS SQPPP?-???? ??????????????????P1?u??P1?]??P1~?E??P1f?-??P1N???P16???P1???P1??stray scb interrupt nexus stray intr ipl%x write timeout %x ??????????????????x?p?h?`?X?P?H?@?8?0?(? ?????????????????????x?p?h?`?X?P?H?@?8?0?(? ?????????????????????x?p?h?`?X?P?H?@?8?0?(? ?????????????????????x?p?h?`?X?P?H?@?8?0?(? ???uba?: stray intr ipl %x vec %o ((((  $(,048<@DHLPTX\`dhlptx|  $(,048<@DHLPTX\`dhlptx|   " , 2 M H \ J l I r y K I  K  L  L M  L  I   K ; R C S O U _ U o U  U S [ \ S ] S ^ S _ ` S !a )S 7c lS L )m 2S Hn QS `gnu|  m n  -<GM dn        Znv    K -4K D P h ovK       K   S ).4;CJP      / ? O _ o        / DLT\dlt| $,4<DLT\dlt| $,4<DLT\dlt| $,4<DLT\dlt| $,4<  $+29@ G$N(U,\0c4j8r<z@DHLPTX\`dhl T h  *3>IS^gp|@          ! ).16;E O X`is $ , 4 H X h x   $/:CL.S[<chjqrx{x# 3 3 788H H*4H?JHS\IenGPYajr{H(x~ttt(&/8CLS]fow,$/4=FLOX`hsxj_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_cp_time_dk_busy_dk_time_dk_seek_dk_xfer_dk_wds_dk_mspw_tk_nin_tk_nout_callfree_callout_calltodo_ncallout_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_text_textNTEXT_ntext_cpu_percpu_hardclockL139_nrscale_avenrun_ccpu_u_psignal_setpri_unhang_softclockL175_dhtimer_dztimer_wakeup_vmpago_setrun_unsleep_Remrq_Setrq_vmmeter_timeoutL230_ttrstrt_panic_whichqs_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forsys/GENERIC/fio.o 664 0 33 5642 2662315563 6703  Ь[[ K Z PZP ^Ь[ЫZ2k2PP<PˏPZZ~Z~|ZsЭPP P0P`FPp^2PPPPPxPPXZЫZЪP2QPQ]<PʏPPLYթi YY2PPPPPPX:[ [[ѭ`2~2~[ݭ2~h ^Ь[2PP2PPPPZ<PʏPP PP0GP`Pp2ݬ2~xZPPZ!ݬ2~ZPP`Z Ь[ЬZZ62~Pk [koPd xZZW xZZZP<QPQ 8f_P[P [PP[5 PP[K#[Kc[P[P PZu ["[Jԫ [[P [[[ [[wh&Pfile7 7 \: u; ; < , 4 4 $+ 1( C) Z= e> ,  +  7 "C /7 87 ID S7 ^7 m7 7 G H 7 < 7 7 7 7 7 7 7 !,M 4( 9M ?M O7 ]M k) s( M P 7 #,39BHQZbhow!,H3(9x?FLW^fnv~ $v  #*18=FKRZ _j_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_file_fileNFILE_nfile_bdevsw_cdevsw_linesw_swdevt_inode_inodeNINODE_ninode_rootdir_mpxip_mount_getfL94_u_closefL100_plock_wakeup_iput_bflush_binval_openiL130_accessL144_getfs_xrele_ownerL157_uchar_namei_suserL165_ufallocL171_lastf_fallocL180_tablefullunin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpsys/GENERIC/iget.o 664 0 33 10662 2662315674 7077 , Z[[PPN[PZP[PN[K?[?2P<QQP~PP2PďPPP[ÏPP[PP [P2NPŀ?2P<QQP~IPW2G?P|1/PZSkk [k2ZѪ[ j ZZk[P2NPďPPP[ÏPP[P1x1V2PďPP~P[NtGmNe[PƏPPPGTkԫH<PPP~2~+PYiY[x1ЩX<PPPQxQQQPQxQPPXX[ Y1Ь[ЬZj  Ъ[Y ZPPXW WЬ[1k[.Bk<~2~dFkVP[kk k[4?2P<QQP~PZ[PǏPPY2JPPY NJ<2JPďPPPXÏPPXP*NNNYk"2NPPY2NPkk k[^Ь[Fk12~_<PPP~2~BPZj Z2Ъ<PPPQxQQQPQxQPPЭPЭP ЭP ЭPЫ Y[XW5<PʏPP0!<PʏPPp WW k ЭPм4k ЭPм 8k ЭPl( ^49,sno imtinodeiputiaddress > 2^24 itrunc) = '+ ;< WB `< n) {) B < E F G $ $ '.H I) V) e= p= ~) = < ) < I J J P   R B ) < < < ) *) 6=H J= S= |R T I J ZaU  V W H   DY vI J J Y J Y F $^ /F 6VF hF pF z  F F F F F F F F a F #,39BHQZbhow!,3H:(@xFMTairy,~ D "-07>EMfS&\afnu} _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_mount_zdmap_zvmsU_ARGU_QSAV_inode_inodeNINODE_ninode_rootdir_mpxip_bdevsw_cdevsw_linesw_swdevt_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_inohash_ifreel_ihinitL109_ifindL119urem_igetL127_tablefull_u_sleep_panic_bread_brelse_iput_iexpandL151L158_itrunc_ifree_iupdat_wakeupL180_getfs_printf_bwrite_bdwriteL200_free_tloopL222_maknodeL235_ialloc_wdirL242_writeidev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_mount_zdmasys/GENERIC/ioctl.o 664 0 33 3712 2662315722 7231 d`ts2 tfVU2tH^YiP[k bѩfPiQA`ѩfPiQA`ЫZ<PʏPPXX RX0Iѩf7X X@%ëݩ߭ ^PP lЎPPݩݩ2~2PPPPPxPPP`ЬP> > > "> '> 0> 7C> MC _> p> > D > > > > > %E 0> S9 #,39BHQZbhow!,H3(9x?F O X~agry}< &\16_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_tthiwat_ttlowat_pidhash_proc_procNPROC_nproc_qs_whichqs_inode_inodeNINODE_ninode_rootdir_mpxip_file_fileNFILE_nfile_bdevsw_cdevsw_linesw_swdevt_sttyL102_u_ioctl_gttyL108L112_getf_Copyout_Setjmp_nullioctlL128me_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runsys/GENERIC/machdep.o 664 0 33 23060 2662316025 7533  4YZZPɏPZZ9ڮn^x ~ X .ЏP P~x~P4 P  ( & & PP   2 x PɏPXX2x PXPXX, PXPXX , PXPXXx PXPXXx PXPXXŏPPXPXX PXPXXŏpPXPyXXqŏLfPXP]WXXOxHPXPXX L [} j u }  | |  B Q h              < D K l          Z "[ ^Y fnv} Z [ | | %,| =Y pxQ  |   |  |    [ 5 =  J  P  W ^ | d k | q  x  U  |      | [   ~ / 8 G M T | b h o | }   |  | [  |  | : A | Z a | 8<@DHLP`hlt|#,39BHQZbhow!,H3(9x?FOYalt}ttt( (2~;ALSW`en t{ ,%07=HOV^iu  !*2= ENSZ]fksx>    H:  d #,10 :? F M$ TY gl_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_swapmap_nswapmap_argmap_kernelmap_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_pidhash_proc_procNPROC_nproc_qs_whichqs_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_numuba_bdevsw_cdevsw_linesw_swdevt_nmcr_mcraddr_cpu_percpu_inode_inodeNINODE_ninode_rootdir_mpxip_file_fileNFILE_nfile_text_textNTEXT_ntext_cfree_nclist_cfreelist_cfreecount_callfree_callout_calltodo_ncallout_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_icode_szicode_startupL194_msgbufmap_printfudiv_panic_Sysmap_clearseg_meminit_rminit_configure_tocons_sysphysL227_suser_u_clkinitL234_clksetL255_sendsigL265_growbad_psignal_dortiL276_memintvl_Copyin_Fuword_ipcreg_memenableL290_timeout_memerrL305_tbisclTBISL324_waittime_bootL333_update_sleep_doadumpL356_dumpsysL363_mc780_mc750_mc7ZZ_rpb_machinecheckL416reecount_callfree_callout_calltodo_ncallout_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_icode_szicode_startupL194_msgbufmap_printfudiv_panic_Sysmap_clearseg_meminit_rminit_configure_tocons_sysphysL227_suser_u_clkinitL234_clksetL255_sendsigL265_growbad_psignal_dortiL276_memintvl_Copyin_Fuword_ipcreg_memenableL290_timeout_memerrL305_tbisclTBISL324_waittime_bootL333_update_sleep_doadumpL356_dumpsysL3sys/GENERIC/main.o 664 0 33 11421 2662316071 7055  @ ݬZێPPX.2.PxPPPxPPXP ݪZp.[[PPЏ_KPЏK ЏK[[Џ?@ݏڮn^ݏڮn^.'|3>u<~2~P<~2~P(H(HxPxPPPƏPPPxQP.mP_P6UPxHPxPP2QP%PP.PSP PPPP~e ^P.2~2PPPPPPP`2g~_P[ Gk[:4/[,ЫZʞʟʡʾ/ʲYIʲ Yʤ^ZZЪ Ъ ЪЏj,ZZ,ZYD,YPP[x YPPZЪЪP[[Џk[iYY`X Nս?9 /   ǏPx P ZZ[ ,Z [,ZP[PԪ [[PP[[ZjZy ZoPxPPdPZP[VY[ Yi[Ciinitbinitn o . Kp Uq \p bp yp p p r s  x 6 6  !x (p /p 5p >$ Cp L$ Qp Xy _ f@ . . z . @ p p . {  . . z | } %p +p 3p :~ @| H N X. d p w 8   p    ( (    !C HC [< k=  > 8   ;          V ' 0? 8D M@ `h tj |j k i h 9  #,39BHQZbhow!,H3(9x?FMV`hs~|),2<DMSZatftltq(x!*08>IPW_jv| \,j((&+29AJOW \a_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_mount_swapmap_nswapmap_argmap_kernelmap_pidhash_proc_procNPROC_nproc_qs_whichqs_inode_inodeNINODE_ninode_rootdir_mpxip_bdevsw_cdevsw_linesw_swdevt_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_text_textNTEXT_ntext_cfree_nclist_cfreelist_cfreecount_mainL171_rqinit_startup_u_setredzone_ihinit_bhinit_cinit_binit_bswinit_iinit_iget_setupclock_newproc_pageout_szicode_expand_swpexpand_icode_Copyout_schedL203_bread_panic_brelse_clkinitL215_swfreeL235L242_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_text_textNTEXT_ntextsys/GENERIC/nami.o 664 0 33 5623 2662316115 7043 ^[PZP/[[<~2~PZZ/Z լpjXZ[PYYZPZZ/=Z951hZ!$ѬZ[BPYPZZ/Z!1[ PPBkӏOխ ݭx~[P2~P P1KЭPРXXjhխ1XX1MԭVPЭQXRQSA`Cb=PЭQA` ֭ѭ6X( ^խ ݭѬZݏ[P11Q1,. P1 P[ P[[<PʏPP@6ݏ@[b!1 9ԭԭ[-).!. 1s1)խ ݭѬ1Zݏ[P1[խ11}֭ѭ1[<~2~P[1N1PxPqPЎPbP[[[P> > #' 3? Q> W> g> q> > ( > @ > ( @ ( A ( ( > 0B :> DC QD cB z> > > > > B E > )> ;) K) X@ c) pA > E > > > > > > > > B E )> :> R@ X> d? x> > > > J > #,39BHQZbhow!,3@HQX_Hf(lxry~, 't.3:?G_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_inode_inodeNINODE_ninode_rootdir_mpxip_mount_zdmap_zvmsU_ARGU_QSAV_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_nameiL105_u_iget_iput_plock_brelse_bmap_bread_access_scharL167_ucharL171_Fubyte_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rasys/GENERIC/partab.o 664 0 33 470 2662316126 7345   _partabeiL105_u_iget_iput_plock_brelse_bmap_bread_access_scharL167_ucharL171_Fubyte_nblkdev_nchrde/hL,hL5< /,"sys/GENERIC/pipe.o 664 0 33 4473 2662316152 7057 dl^2~P[PZRPY0Эi[j[kЭP@[ Ь[ЫZ]ЫRZaCѫԫԪZ~7jj jZ$j Zjjժjj jZZ~Ь[ЫYZii YiZii iYy*ii iY{ 9 <eѩ(ii iYBY~51aЩZZP2PPPZYii iY1Y~1Ь[k [kkЬ[kk k[ 8 9 ': 09 ;: @: H: s: |; : > : ? ? @ ? *: 1: E@ a? g: ? : : C ? @ : : D ? #? <@ ]? #,39BHQZbhow!,H3(9x?FMZbkrx~  *"'H.3_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_inode_inodeNINODE_ninode_rootdir_mpxip_file_fileNFILE_nfile_pidhash_proc_procNPROC_nproc_qs_whichqs_pipeL96_ialloc_falloc_u_iput_readpL105_readi_wakeup_sleep_writepL122_psignal_writei_plockL141_preleL148_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umsys/GENERIC/prf.o 664 0 33 6572 2662316211 6707 H8\~ݬ\~ݬ^Ь[ЬZ1Xݬ X11PD1W1P%11gPXY1jYWW1KWPxPYPPX ݬ X_WWPxPPPPPYP2խ ݬ ,8XX 1ݬ X֭㑽 1֭jЭP֭`X1ݬ Xݬ %1PO1Yݬ Yj1Pc1.[Pb{ЊYjݬ ЭP֭`~YԭYWݬ <yЭP֭`W1խ7ݬ >Y)Pd Y1wPs13 Po1ZZXX%1((VXXPPl1wPuPx1i ^Ѭ լݬ -άޭ[ݬݬ@ݬݬPPݬ {~ޭP[P^PPPЬlݬ@\PݭJݬ%6ЬPݠ PaP~ЬPPxP~ݬЬ[լDAZ:<5PPY[  Z Z[ZYPڎ[h[ c[Z8ێPPQ`0Џ`0vt l_]PRQ[A`G[[50123456789abcdefpanic: %s %s: table is full %s%d%c: hard error sn%d "E;r&<Z CQ[ f{! ! ^ d 0e ;e Df nJ {J J J J J J J J g #,39BHQZbhow!,1:@GOW]h,q{ttt( (2;DMWaiHp(vx|  (t &._hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_msgbuf_zdmap_zvmsU_ARGU_QSAV_tthiwat_ttlowat_printfL121_prf_uprintfL127L131_putchar_printnL182uremudiv_panicL195_boot_tablefullL203_harderrL209L214_u_ttyoutput_ttstart_cnputcuf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_klseql_klsdist_klin_ksys/GENERIC/prim.o 664 0 33 6614 2662316255 7074 DЬ[PPXkYkԫЫzY֫k-ZZԫԫjZ1B<ЫZ ZjjZyqjdXPڎYP^Ь[ЬZլ 1PPXkeZ֬ ׬ K֫kcYYԫЫ iYXPڎíZPkԫЫXPڎPЫY YiiY1[}w1E^Ь[PPkkZݭPڎZPPPZ«ZkZkZլЫYYXZXYXҬPiQPQ YZ«ZY^Ь[ЬZPPXk.1kZ1kYPPYPЫ YëZ?­Z­kiiY~voiZkZk0ViYNGA92,k ԫЫkXPڎЬ[PPXЫYk/Z XPڎPjjZYY)Y$ YZjjZjjZYkYXPڎPЬ[ЬZPZVPPWЬ PРYռ U^XPhTMhXYЬ PY.Y$ YX.h hXh!hXYZZЬ PYZVPP WPڎZP Ь[ЬZkZZZPZPP^Ь[PPXkYy׫ЫP`Yk&ЫZZԫЫjZyEPP:ЫZZjZjZ ZjZDjZ<5ԽXPڎYP ݬ[ݬ P[ Ь[PPZ ZPڎP[ݬ[x~ZPڎPneg q flush =6 E6 L7 R8 n6 v6 }7 8 8 ; 8 6 6 7 8 8 ; 8 X6 `6 g7 m8 x8 ; 8 B i6 q6 x7 ~8 8 ; 8 6 6 7 8 8 ; 8 6 6 $7 ?6 L6 S7 6 6 7 6 6 7 t6 |6 7 6 6 7  6 %4#,39BHQZbhow!,4<DLQZ`gow},  #(r05< A:INTY_ d_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_bdevsw_cdevsw_linesw_swdevt_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_tthiwat_ttlowat_cfree_nclist_cfreelist_cfreecount_cwaiting_getcL92_wakeup_q_to_bL107_ndqbL120_ndflushL132_printf_putcL152_b_to_qL162_nextcL175_unputcL182_catqL194_putwL201pid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swasys/GENERIC/rdwri.o 664 0 33 7730 2662316313 7247 p^Ь[2PP1<PʏPP 2PPPPPPsk<PˏPYY  Y02~2PPPPPxPPP`xMЭ >ZZPP* ZPPPXY`GYp>PPPѭXЭXݭ[P խPP3HPPݭ2~ݭ2~PЭHЭPà$PXPXP ЭPà$PPX`'X*ЭPZ~; ^P$0XЭPZ~( ^XXXZXPP kPP ݭX1E ^Ь[2PP1<PʏPP 2PPPPPqP,<PʏPPYY  Y0#Bk2~2PPPPPxPP P`<PʏPP,PPkx ZZPP ZPPPXY`%Ypݭ[PPխ ݭ2~aPݭ2~OXݭ2~8ݭ2~(P#XZ~ ^P$0XЭPZ~( ^XXX ݭ\<PʏPP@ЭPZP` ݭ/ZXPPkPPݭd ݭX:Y@ YBk  1=ѬЬPЬPѬЬPЬPЬ[ЬZ:լ Z[ ^Z[ ^PY-dլ  Z[o Ze[( ^ZRZSZH J J DK NJ 8 J J J J J L J % 1M >N Q _O oP J J Q J J J J J J 3R 9J AJ cJ K J 8 J J J J J U !J *J 4J DJ VJ zL V W X P J J Y J J &J -J 4J :J FR sZ [ \ J J J J !J 3J 9Y FJ NQ ]J mJ wJ J J J #,39BHQZbhow!,3@((HQXH_(exkrw, ~ &18<ELQT\bks{P_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_inode_inodeNINODE_ninode_rootdir_mpxip_zdmap_zvmsU_ARGU_QSAV_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_pidhash_proc_procNPROC_nproc_qs_whichqs_readiL120_u_mem_no_bmap_geteblk_clrbuf_breada_bread_Copyout_brelse_writeiL152_psignal_mfind_munhash_getblk_Copyin_bwrite_bawrite_bdwrite_maxL185_minL190_iomoveL196nd_noproc_panicstr_wantin_boothowtosys/GENERIC/rmap.o 664 0 33 4037 2662316335 7060 TD Ь[[ZЬxP[PPkЬjЬ ^Ь[[Zլ[Ѭ ZX1h1[`ǏPx PPPPPPPPh=PhPPuYíhPìPЭhխY~ݭ=TYPШY¬hXШh[YPPPPYPUXh1BP^Ь[Ь Z1[YYi YѩZYUPPZJPPZ1[թ1[ZPP[ZPP1ii1YЩi[ZPPi[ZPP1[[iRЩXZXZiX[iYX[YPP/Y~ݩЬPݠeYP}`ԩЩiѬArmallocrmalloc swapmap%s: rmap ovflo, lost [%d,%d) bad rmfree9$ KR9 h$ $ $  9  < !' ) 1 7' >= EL9 #,39BHQZbhow!,5?GRHY(_xel~u{ $_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_swapmap_nswapmap_argmap_kernelmap_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_text_textNTEXT_ntext_rminitL87_rmallocL92_panic_rmfreeL113_printf_wakeup_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_swapmap_nswapmap_argmap_kernelmap_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_text_textNTEXT_ntext_rminitL87_rmallocL92_panisys/GENERIC/sig.o 664 0 33 15045 2662316405 6722  `T` Ь[Z2&PP[ ݬZpZZ^Ь[ЬZZ ZPxPPP 4XZ1ȭZPP _zzzzzVzuukzuu\ҭPPPPPPYxYYҭPPPPPPYYXX Xʏ3XPPYPPBP1[1ˏ+PɏPڮn^1  ZPPRRRR 21[\ 1 [ЎPj2 [ЎP[1XZ+pDPѫlP [jʭYPڎ ʭZ[X1h ZPP \2իL [X1#իL2 [1w ^i[Ы ʫ ʏ3խPݭ PPPPZZPxPʭZ , '[~2iP ߘZJPPPmPhZPP[P1UZPP0NNNpPѫlP [1 [ ~1 1Ь[ ݫlp ݫl^![ZZPxP W1JYaYY ;Z ZJY!PȭȭJPYZYZPP ZZ PZPPx PPPP$XLEP[ݏ+P[ݏ[P1<PʏPP鵫Lױ[2~[x Bx :}W[x #PPVx N[a[OPPx PPPѬPPìPP PPPPP[[Px PPPm[~yoP[Y~NP [P dZj UP ݪuP[4P*(ND=2(3Ъ 7Ъ+j  [PQ2(PQPPpP[[PPOxN41>qbP`ЎPOPTB;7(P1#ЎP[1[x[P@PРPYD1Щ

2:?GMRYbhznszh  _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_inode_inodeNINODE_ninode_rootdir_mpxip_text_textNTEXT_ntext_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_ipc_gsignalL150_psignalL160_u_Remrq_Setrq_stop_unsleep_setrun_issigL232_Swtch_procxmt_printfL274_wakeup_psigL281_panic_sendsig_exit_coreL315_schar_namei_maknode_access_itrunc_writei_iput_growL331_chksize_swpexpand_expand_ptraceL343_ipcreg_pfind_sleepL357_useracc_Fuword_chgprot_Suword_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_ipc_gsignalL150_psignalL160_u_Remrq_Setrq_stop_unsleep_setrun_issigL232_Swtch_procxmt_printfL274_wakeup_psigL281_panic_sendsig_exit_coreL315_schar_namei_maknode_access_itrunc_writei_iput_growL331_chksize_swpexpand_expand_ptraceL343_ipcreg_pfind_sleepL3sys/GENERIC/slp.o 664 0 33 11514 2662316447 6741 <D`[PPYլ ի ЬL P@Zjk[jѬ{ի@ ˫P3P(իL ['PЎPfիLCP~Nի, ˫P5PP~YPڎ8^[PPYZXիT ѫT Ԭ լ  ì TZЬ T8߭X( ^HЎPPXݬݬ լ XX 8 ߭( ^ZZTԫTYPڎXPЬ[PPYիLLP@7ZjZj[kjԫLYPڎ^Ь[PP[P@X}ԪLji1 ZЎP )ˏPɏPڮn^ !g}XY*ժ  ZѪL[1WZYiZݭPڎ[x[PPx[QPx[P [ Ь[PPZPP$6[} [ЎPZPڎ )ˏPɏPڮn^ !}uoLb Ь[PPZPPPP2PPZѫ<@50ZZZZPQPQ) ˏRPɏPEڮn^Z ZP[0uZ-[Z[2(PP2&PPpZZ[Z n8YԪTˏ PP լ hh;ZPƏpPPh$$&&լPЩPPPP((*YlЩЩլ&Ԫ8Ъ84Ъ40.84PP'Щ00Щ44Щ88..84PPԪ<Щ@@ԪLvd`2(P?PQ?QQPXHljdZPƏpPPHSMXH`(HWPլHKH>PРPLXXP P ݬZPPPZЎPP լ1PZ\uP  Z |vpZg1PԠ\WQKZZ Go Np YZ lt v v Z Z Z w _ x 1Z Ay GZ UZ az jZ tf Z Z Z } Z f Z Z Z o p + A G P c_ kZ so zp Z z Z Z z Z  Z z Z  o p Z Z t =z FZ MZ TZ [Z `Z fZ kZ so zp v v v z Z Z #,39BHQZbhow!,H3(9x?FLW^erzttt(!*3<FPU^dks{,~ #(.7?GLV_ e jqx: f   B_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_file_fileNFILE_nfile_inode_inodeNINODE_ninode_rootdir_mpxip_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_pidhash_proc_procNPROC_nproc_qs_whichqs_readL151_u_Setjmp_readp_sleep_readi_wakeup_writeL177_writep_writei_vrdwrL200_getf_useracc_vtopte_tbiscl_min_vmemfre((e_vinifod_openL244_uchar_namei_open1_creatL251_maknodeL259_access_itrunc_falloc_openi_iput_closeL279_closef_seekL287_linkL297_suser_iupdat_wdir_mknodL314_saccessL325_lotsfree_minfree_desfree_saferss_forkstat_swptstat_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_pidhash_proc_procNPROC_nproc_qs_whichqs_readL151_u_Setjmp_readp_sleep_readi_wakeup_writeL177_writep_writei_vrdwrL200_getf_useracc_vtopte_tbiscl_min_vmemfresys/GENERIC/sys3.o 664 0 33 7336 2662316677 7040 H ZjP[kЫPPPݪݫ7 ZP[ݪ[ [ ^Ь[Fky[pఫⰫ䰫氫 谫 2PPì <PPP~2~-PYЩZ<PPPQxQQQPQxQPPZЪ4Ъ8Ъ"   N@&+27<C0J OTV [ckt y  _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_inode_inodeNINODE_ninode_rootdir_mpxip_pidhash_proc_procNPROC_nproc_qs_whichqs_gtimeL91_uudiv_clkset_ftimeL99_Copyout_stimeL110_suser_setuidL117_getuidL123_setgidL128_getgidL134_getpidL139_syncL144_update_niceL150_setpri_unlinkL159_uchar_namei_iget_xrele_writei_iput_chdirL176_chdirec_chrootL182L187_access_prele_plock_chmodL200_owner_chownL208_ssigL214_pause_killL232_pfind_psignal_inferior_timesL257_profilL263_alarmL268L272_sleep_umaskL281_utimeL286_Copyin_iupdat_setpgrpL296_spgrpL307L328_rebootL337_boot_syslockL344_uudiv_clkset_ftimeL99_Copyout_stimeL110_suser_setuidL117_getuidL123_setgidL128_getgidL134_getpidL139_syncL144_update_niceL150_setpri_unlinkL159_uchar_namei_iget_xrele_writei_iput_chdirL176_chdirec_chrootL182L187_access_prele_plock_chmodL200_owner_chownL208_ssigL214_pause_killL232_pfind_psignal_inferior_timesL257_psys/GENERIC/sysent.o 664 0 33 10112 2662316763 7462 % & ' ( $) ,* 4+ <, D- L. T/ \0 d1 l2 t3 |4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H $I ,J 4K <L D% LM TN \O dP l% tQ |R S % % T U V W X Y % % Z [ \ % % % % ] ^ $_ ,` 4a <b Dc L% T% \% dd le t% |% % % % % % f % % % % % % % % % % % % % % $% ,% 4% <% D% L% T% \g d% l% t% |% % % % % % % % h % % % i % % % % #,39BHQZbhow!,4;BHNU[bhou}#)06<ENSY`hpx~ $,2_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_sysent_nosys_rexit_fork_read_write_open_close_wait_creat_link_unlink_exec_chdir_gtime_mknod_chmod_chown_sbreak_stat_seek_getpid_smount_sumount_setuid_getuid_stime_ptrace_alarm_fstat_pause_utime_stty_gtty_saccess_nice_ftime_sync_kill_nullsys_setpgrp_dup_pipe_times_profil_setgid_getgid_ssig_sysacct_sysphys_syslock_ioctl_reboot_mpxchan_exece_umask_chroot_vfork_vread_vwrite_segalloc_segfree_segsync_vadvise_vhangup_vlimit_vswapon_vtimes_resuba_futzt_nosys_rexit_fork_read_write_open_close_wait_creat_link_unlink_exec_chdir_gtime_mknod_chmod_chown_sbreak_stat_seek_getpid_smount_sumount_setuid_getuid_stime_ptrace_alarm_fstat_pause_utime_stty_gtty_saccess_nice_ftime_sync_kill_nullsys_setpgrp_dup_pipe_times_profil_setgid_getgid_ssig_sysacct_sysphys_syslock_ioctl_reboot_mpxchan_exece_umask_chroot_vfork_vread_vwrite_segalloc_sys/GENERIC/text.o 664 0 33 11023 2662317016 7113 0P PРP[[AЫDKRtWt]tb(ir{!)0 58Z?@HRY_fow| `   $ )27>C_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_swapmap_nswapmap_argmap_kernelmap_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_text_textNTEXT_ntext_inode_inodeNINODE_ninode_rootdir_mpxip_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_xfreeL161_u_xlock_xunlink_vmemfree_panic_iput_sleep_vsxfree_xccdec_xallocL183_xwait_xlink_xunlock_tablefull_psignal_vsxalloc_swkill_settprot_readiL211L217L221_wakeupL227_vsswap_swap_xumountL241_xuntext_xreleL251L260L267_vinitptL273_xreplL285_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_xfreeL161_u_xlock_xunlink_vmemfree_panic_iput_sleep_vsxfree_xccdec_xallocL183_xwait_xlink_xunlock_tablefull_psignal_vsxalloc_swkill_settprot_readiL211L217L221_wakeupL227_vsswap_swap_xumountL241_xuntext_xreleL251L260L267_vinitpsys/GENERIC/trap.o 664 0 33 6050 2662317046 7064 <Hp^\[ˏPP [ЬPP !DDDDDDDDDDDDDDDDDDDh vgݬݬ ݬwpc ZZ(QYթ ˩P,P! PYЎP~Aέ~ݫ  Z1]ˏPɏPڮn^dP 1:ݬq;P 1Ь Z1ݫJP1ݬ 9P Z1P"Zݬ ZѬ 1Z1Z1Ь 1"^\[}ˏPP [ZgѬ ? P~@XXZЎPpPYZYP~@^XxhPPY Yj  1(Yj*ЫЎP PG 6(Э8 &{sxt`Wէ ˧PqPf [PWЎPH~@έ~dݫ dtrap type %d, code = %x, pc = %x trapptable faultsyscall 1 *1 2 3 1 4 1 5 6  7 8 1 1 1 '9 / 91 J1 W1 h1 w1 1 9 1 1 : : 3 1 ; 1 1 '1 AH3 O1 Z1 w. . > . 1 1 1 1 1 1 1 1 1 @ 1 1 1 1 $1 41 >A F1 N1 \1 d1 l1 5 6  7 8 1 1 1 9  1 #,39BHQZbhow!,H3(9x?F~OU`gkt|_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_sysent_trapL94_u_printf_panic_psignal_issig_psig_Setrq_Swtch_addupc_grow_pagein_syscallL141_Fuwordok_Setjmp_dorti_nosysL167_nullsysL172stflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_sysent_trapL94_u_printf_panic_psignal_issig_psig_Setrq_Swtch_addupc_grow_pagein_syscallL141_Fuwordok_sys/GENERIC/vmdrum.o 664 0 33 10354 2662317124 7447 8`^Ь [ЬZѫ[YЬXZ[ЬYZXk[ݬ2P Zݬ P[ݭ ^PP^Ь[ЬZ YXZWjЪ1XAYb[Pgg%XjZݭP A2PY%[ X[լ gY gYYXYYYWZPPWPPP X1\X[[jP ^ЬPѠ40 ЬZԭ}ЬPí4[[2[[wpPIݭ74PƏPPP~JCЬQP0ЬPՠ0+ݠ4ݬ#PЬPѭ41uFP ^ЬZԭ/í[[2[j[ԊѭЬPF2ՠ0-ݠ04PƏPPP~ЬPԠ0Ь[ЬZЬYXYPPPPYP XY3kkP k1kPP sPkXݬݬ XZݬXZXYZkhkPaѬ  [ЬQСPQ2@RPRR@;[ЬQP<&Xk~kkPPYѬ [1)[1# ^Ь[ЬZЬ YѬ1Ѭ1P1ǏZPx PPPZPPѭYY2&~x ~x Z~ǏZPǏZQx QQQZQQ@P~[ݭxZPXP~ЫPQ2@RPRR@Z­YY1oPP߭ݬYZѬЏP PPPZQQQPZ0PP2y~x ~x ~ݭ[^Ѭ#2.PxPPxPPXP$PZQQxQQQPx0PXPxZQQPPXݭXP % F M i d | * $ %  i   i  * " $ + % G * $ % * $ % ' (  '  (  A $ % % . ) 5 A < ) F ) K A ] $ m $ A A $ ) * A $ $ A B     & ' 0 q ; $ O k f ' p q { $  i j s s    i . s G s N x #,39BHQZbhow!,29@KTZbHi(oxu|~ttt($+5>GOYbkt~,"+5=HQ V]elrz@  t ' 05:f BG P U \a h` qv{ :  _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_text_textNTEXT_ntext_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_file_fileNFILE_nfile_inode_inodeNINODE_ninode_rootdir_mpxip_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_mount_swapmap_nswapmap_argmap_kernelmap_vmemallL166_panic_wakeup_sleep_imin_memall_vmemfreeL183_memfreeudiv_distpte_u_munlinkL219L224_ptetov_mfindL274_wmemallL293_rmalloc_Usrptmap_usrpt_vmaccess_rmf((ree_wmemfreeL303_mhashL308_getfsx_munhashL316L332_mpurgeL340_meminitL358_mwaitL370_mlock_munlockL376L382_vslockL390_vtopte_Fubyte_vsunlockL402_inodeNINODE_ninode_rootdir_mpxip_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_mount_swapmap_nswapmap_argmap_kernelmap_vmemallL166_panic_wakeup_sleep_imin_memall_vmemfreeL183_memfreeudiv_distpte_u_munlinkL219L224_ptetov_mfindL274_wmemallL293_rmalloc_Usrptmap_usrpt_vmaccess_rmfsys/GENERIC/vmmon.o 664 0 33 1615 2662317234 7253 #,39BHQZbhow!,H3(9x?FtKtQtV(]_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_cnt_rate_sum_total!,H3(9x?sys/GENERIC/vmpage.o 664 0 33 23463 2662317341 7422 <^MЬP PPPXX[X0XX[PZj cj1jPѭfjPP~zP PoP?ݫP]X[RPZj j~:X1WjPP~P P P j~EѭaЫPP@jjj jPP ѭZXݫPg j~X<j5dX[ePЭЭЭ̭ȰP1jju'X[(Pѭ ѭ&իP ЫPPР~6PPݭ2%~ѭ%WW~ Wѭ151'[ЭP@ ЭP@,ЭP@ L ݭ2~P1jˏjjj jPP XLݏx X~ЭPݠ( ^ݭ'jȭj1P fݭѭ P PPP߭ZX[ PXX[PЭЭPPj jPP 2~ݏ@x ~x X~x~[l|xPPxݭ[HPZj jPP ѭ&ZݭݫP ЫPPFݫP X[PZW1jPP~P PPЭPѭ-ЭPQ!խW ݭ2~ݭ֭X j~~Xѭ <ZYXPXZWW1I  o/*bѭ\ë0PPPx ~PPPP~['x~PPPP~[ ^լ Ԭ PЬQP4 QPì4PP ԭ1~ЬPPQx0QQXPxQQPZj1UjPjPZP~QP PFP[kjjjj jPP jjPjj1P1j~j jjj jPP ЬP,߭ZЬP0~ݬxPlݭݬkPj~2\~ݏ x ~x ~ݭݬ<!ЬP<Z }ѭ 1x^PPPP~Pԭԭ PPYi1%PPhPcQQQYQPQ FhShhh hPP PPXݭZ ӏ  ѫ<@1PP1PQQPѫ [p zv i q f 1 g q h  )1 0k 6q L Rq [ sh l i @i Gq Xi ]q qi vq }q q q q q q 1 k q q % 1 8 Aq N ah mh q q q 5  2  ^ % E n q #,39BHQZbhow!,H3(9x?F~OU`gkt}ttt( )29CLU]gpy,  )08=DMW^hpz   , $)19ATIRY`en sxN  _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_swapmap_nswapmap_argmap_kernelmap_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_text_textNTEXT_ntext_mount_inode_inodeNINODE_ninode_rootdir_mpxip_vgetptL162_panic_rmalloc_Usrptmap_usrpt_vmaccess_rmfree_clearseg_vinitptL179_vinifod_swap_u_distpteL199_vrelptL211_vmemfree_vpassptL218_vusizeL235_vgetuL240_setredzone_vrelswuL254_vgetswuL259_vreluL264_ptexpandL273_memall_Resume_Setjmp_kmcopy_swapout_sleep_SwtchL298_chgprotL305udiv_munhash_tbiscl_settprotL315uf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_text_textNTEXT_ntext_mount_inode_inodeNINODE_ninode_rootdir_mpxip_vgetptL162_panic_rmalloc_Usrptmap_usrpt_vmaccess_rmfree_clearseg_vinitptL179_vinifod_swap_u_distpteL199_vrelptL211_vmemfree_vpassptL218_vusizeL235_vgetuL240_setredzone_vrelswuL254_vgetswuL259_vreluL264_ptexpandL273_memall_Resume_Setjmp_kmcopy_swapout_ssys/GENERIC/vmsched.o 664 0 33 14716 2662317547 7605   PPP 72 PP PPPP (  P P PP  (v \x RPP ;] -(PPƏPP> 8 .  PPP x PP(^ԭԭZKqEP)PP s1ԭ2౭V[1P~1P rNPx^QQP9PxIQQPPPDPQPQPPQPPxPPPQѭ,իP ЫPPH[ZЭp[[zPP1iի<ҘPPիP ЫPPFˏ8 PPP  [ЎP]Pݫ8ݫ4[H1xѭ<P/'P12ԭPѭPЪDժPЪPPE ЪPP2BPPݭPPǭQPQ,ZP}ݭsPlZYԭ  ԭE7[1ˏ8 PP1[YիP ЫPPF䘫PP * ЭPQPQ[Z1խЫ<իPЫPPЫPQ2@PEQQPPѭ P@W֭Wѧ6ЧvhXШPѭ ШXըШWЭ[gp[[21խ;Z2"X&h[PQQPPѭ[ZЭШXXխխZխ1ѭP  ZЎPPխ>Ъ<ժPЪPPЪPQ2@PEQQPPݭvPPkԭݪ8ݪ4ZWP1Jݭ@P91iP*"1xAPPPP~ ~PPxPPPPPP[ZY"xjPkP~PjkikZ[Y[hjPPP_P?1* PQPPQ& PP[[[PP[QQP QQQPZ\WPPZZQQQP?8-~% ^ԭ.,*&Z[ժ<O4@Ъ8[[7PP  Ы\[☫PP4@LZZyuqmi[[[S1 >9384PP=2?P= 2Mb  L M "-3L 8M BKL PM [akry  X L M   (5" C KR PX< ^; e[ lt7 y7 ; ) ;* O: Tf\ ] " "    ^ ?I_ S= X: l= u` = _ = W ) drV ~W W W * W -J\ |_ = ] = _ =   = [ = _ = "; ): 2; 9< @: I< O6 V7 ]8 qc 6   6 7 6 8 6 6 7 6 8 6 ;  )    %e + 2e <@ B@ G> M= R: `: eov~L M @ @ ) e 9 9 9 9 . 9 9 CM9 U9 c/ k9 q9 w9 }9 9 9 9 9 9 ) * 9 9 9  9 9 - 5 9 B J 9 U f 9 n 9 { 9 9 9 9 9 9 9 9 9 9 9 ; 9 R    #,39BHQZb((how!,H3(9x?F~OU`gktz0 4 , 8 < ttt(@    # , 5 >HRX_fqz$ ( D x . %-85 : ?P E M R_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_text_textNTEXT_ntext_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_slowscan_fastscan_avenrun_setupclockL118_nbig_bigp_bplist_printf_schedL139_imax_Remrq_swapout_sleep_imin_swapin_vmmeterL209udiv_vmtotal_wakeup_vmpagoL220L226_cexp_loadavL275oc_procNPROC_nproc_qs_whichqs_text_textNTEXTsys/GENERIC/vmsubr.o 664 0 33 7503 2662317616 7443 Ь[Ь ZЬXYhxYPP`QQhXYZݬЬ[ЬZЬ YȏZ:ڮn^ZYY Ь[ЬZx0PXPZPëXZ~p2.PxPPxPPXP$Px8QQPZP#x0PXPZPx0PXPPZPP0PЏP PPP2.QxQQxQQXQ$QZQQQP Ь[ЬZZ0 xZPXPZ0Zx0PXPë0ZQxQQQP2.PxPPxPPXP$PЏQ QQQZQxQQQP^Ь[Ь Z1kkkZ ЬP@PPPkkPkk"Ѭ ЬP@HX[P`HkX[֬1Ѭ 1y9ڮn^ݬZP PǏPQxQQQPݬíPPP~PYYPPYխ1ЭPxQQWkkkkP*kѬ &ЬP@xkkX[P`HkX[Yݭ$)Ygkkk kPP [Yլ19ڮn^ ^Ь[Ѭ  [Pԭ xѬ ­׭խխí P@խݭ2~jPAPX֭έPxPPPZЭPxZQQP`ݭ(խ1aѭЭP^ ЬP PPɏP:ڮn^ P@[ޭP`:ڮn^[P^ЬP PPɏP:ڮn^ P@vޭP`ke:ڮn^Ь[ [ʏxkȏxkլ~:ڮn^vbmap5e - - - j Al - - j - m - 29o p m m s s  & 2s 8 Qs hs n  s  #,39BHQZbhow!,H3(9x?FNW]dktptvt{( ~&-1:@GNYbhpw, : j( -2: ?fHMPW]e jqxJ_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_pidhash_proc_procNPROC_nproc_qs_whichqs_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_inode_inodeNINODE_ninode_rootdir_mpxip_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_text_textNTEXT_ntext_uaccessL157_vmaccessL165_ptetovL173udiv_vtopteL179_vinifodL187_u_vbmap_imin_brelseL219_panic_bread_getmemcL241_mmap_putmemcL246_setredzoneL251can_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_pidhash_proc_procNPROC_nproc_qs_whichqs_cmap_ecmap_ncmap_firstfree_maxfree_ecmxsys/GENERIC/vmswap.o 664 0 33 11264 2662317711 7455 4@Ь[ЫPZ Z48P0PPƏPPPP.[P*[P[Z ZPu[YxYP@]QxYPP`RQR 4=YY0['Z[Zԫ<PPX [ЎP  eH XPڎ1P^Ь[ZYҭPPPZzYPPXȭfZ[ҭPPPPȭEXPڎYZ[0Y[%P[ԭ1ЬЬ  իP#ЫPPE ЫPPЫPQ@B[ݫPЫ~YY[2*ЫZ<PʏPP ЪP2QPQkY [[YP~[kbkP@eիkPP(P/?kPѫ@9cP. ѫ_ ѫ_Џ_kPЫ@kǏPQP@c f f )k 3l :m Il Sl ]l il zl v [ y X 0l ?l E| Sl dl j| xl k l l l  . C/ Rl _l jl ol l k l l l l #,39BHQZbhow!,H3(9x?F~OU`gktzttt(!+4=EOXajt~,  !( /4;CH$PU\_i@otD~NXb,~ N _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_file_fileNFILE_nfile_inode_inodeNINODE_ninode_rootdir_mpxip_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_tthiwat_ttlowat_vforkL161_fork1_vreadL167_vrdwr_vwriteL173_resubaL178_suser_u_ubareset_futzL186_segallocL191_segfreeL196_segsyncL201_both_vadviseL207udiv_vtimesL224_Copyout_vmsaddL235_vhangupL241_forceclose_gsignalL250_vlimitL261_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_tthiwat_ttlowat_vforkL161_fork1_vreadL167_vrdwr_vwriteL173_resubaL178_suser_u_sys/GENERIC/urem.o 664 0 33 242 2662320000 7023 (<ЬPЬRRQ{RPRPPPRRP  &uremdivnodivnzeroretn_vlimitL261_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_/hL,hL5h< /,"sys/GENERIC/param.o 664 0 33 2420 2662323360 7207 $<T v#,39BHQZbhow!, 3:BIS [aioz_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_nproc_ntext_ninode_nfile_ncallout_nclist_nbuf_nswbuf_proc_procNPROC_text_textNTEXT_inode_inodeNINODE_file_fileNFILE_callout_cfree_buf_swbuf_swsize_swpf_buffers_cmap_ecmap_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_arsys/GENERIC/param.c 444 0 33 2452 2632245641 7176 ((/* param.c 4.2 81/04/02 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/text.h" #include "../h/inode.h" #include "../h/file.h" #include "../h/callout.h" #include "../h/clist.h" #include "../h/cmap.h" /* * System parameter formulae. * * This file is copied into each directory where we compile * the kernel; it should be modified there to suit local taste * if necessary. * * Compiled with -DHZ=xx -DTIMEZONE=x -DDST=x -DMAXUSERS=xx */ int hz = HZ; int timezone = TIMEZONE; int dstflag = DST; #define NPROC (20 + 8 * MAXUSERS) int nproc = NPROC; int ntext = 24 + MAXUSERS; int ninode = (NPROC + 16 + MAXUSERS) + 32; int nfile = 8 * (NPROC + 16 + MAXUSERS) / 10 + 32; int ncallout = 16 + MAXUSERS; int nclist = 100 + 16 * MAXUSERS; /* * These are initialized at bootstrap time * to values dependent on memory size */ int nbuf, nswbuf; /* * These have to be allocated somewhere; allocating * them here forces loader errors if this file is omitted. */ struct proc *proc, *procNPROC; struct text *text, *textNTEXT; struct inode *inode, *inodeNINODE; struct file *file, *fileNFILE; struct callout *callout; struct cblock *cfree; struct buf *buf, *swbuf; short *swsize; int *swpf; char *buffers; struct cmap *cmap, *ecmap; 16 * MAXUSERS; /* * These are initialized at bootstrap time * to values dependent on memory size */ int nbuf, nswbuf; /* * These have to be allocated somewhere; allocating * them here forces loader errors isys/GENERIC/bio.o 664 0 33 15501 2662320153 6701  X Z[ZЪ[ Z[?ݬ2~P[k[Pk2[2PPPPPPP`_[  [ݬ2~BP?ݬ2~P[k*k2[2PPPPPPP`լ `ݬ 2~PNݬ 2~LPZj Z.ȏj2Z2PPPPPPP`[ݬ2~[4[P Ь[kZʏk2 Z^[2PPPPPPP`Z[[q Zk  [  Ь[ k2PPPPPPZ Z [ȏk[Ь[k[?Ь[k [k kkPPYӏkZЪ P[Ъ [ Z6k yZk ZZЪP[ Ъ[Z ʏkYPڎxY2PYP?PQ?QQPQ QAZЪ[ѫ YkPЫ[[ZPݬ2~Pݬ2~P^xXѬЏxX2PXP?PQ?QQPQ QAZk[{PЪ[Uѫ XKDk@PkPPPЫPЫ Ы PЫkݭPڎk[PЫ[[Z2PPPPPP P?Y ѩ Y ,YYY iY1<PЩ [PPЫPЫ Ы PЫkݭPڎ kk[1kЫPЫЫPЫЪZЪP[[X 1 ^jZ,PxZ Ѫ Z ,ZZZPЪ [PPЫPЫ Ы PЫkݭPڎ kk[ ЏkЫPЫЫPЫЪZЪP[[[PЬ[P [mkP[ Ь[k Ak k1k &PPZ [P,PPPP2`[P,PxPPP`$ǏPP[~ZPڎk [ k[ ЬPР[2ZԋZЬPԠ$^PRIBH@[Ы 7PPɬPkӏ`k2ѬP PPP P PPPЬ( 1[P,PPPxPPPQxQQ8PxQQPYЬ P P~ݬPXZ+hPh oYPYh`XZZx 1Ь 1ݬݏ5PZZЬ  3[P,PxPP PЬ `[P,PPPP`[2PPPPPPP` Z vP [kPZkk(ӏլ :tݬpZZP PPPլ1PʏX8kD [;(( ~P^ЬP2(~լ ݭݭЬP2(~ ݬЬP  ^DNkPPЫPЫ Ы PЫkݭPڎ[P7ZЪ [ kЫ [[Z,ZZP ^Ь[ѬPPPPPk[k(1k xt h[ЫZBP ZЫݭ[[P [BkݬZݭ/P k [PZZZk1NʏXkЫ$[ЬPѠ<Ь[k3yp ZЪ[kЫ[[Z ZZblkdevdup iodoneIO err in pushswap bad ptebig pushhard IO err in swappid %d: killed due to no swap space killed on swap error sorry, pid %d was %sT ,W2 aZ j~2 Z 2 &Z 8BfZ }2 Z 2 h "/ */ 1/ 8h a/ / / / T .oT m   n / (/ 1/ m / / / =m n n 1 + - + . A 0A 71 >0 J7 Rh hwh 0 0 m 0 0 0 C C /+ B7 nx n y + . + - '2 <Cn Wm n 0 0 0 0 0 h 7 h   | ) 3 ? | P W } c ~  / / Z  Z  $ Z < m I Z Q Z Y Z p Z x Z Z m Z h Z Z  Z  H Z Q Z Z T T #,39BHQZbhow!,H3(9x?FKTZaiqw,~t tt((1<ELV_hpz  6zp  J :  ).3;@GLQX_h mrz |  r    " V  !_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_pidhash_proc_procNPROC_nproc_qs_whichqs_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_bufhash_bhinitL140_breadL147_getblk_u_iowait_breadaL153_incore_brelse_bwriteL166_geterror_bdwriteL177_bawriteL185L189_wakeupL207_baddrL215L220_sleep_panic_geteblkL242L253_iodoneL260_clrbufL273_swapL281_vtopte_imin_swkillL311_printf_uprintf_psignal_bflushL325_physioL338_useracc_vslock_vsunlock_minphysL354L359_binvalL366reemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_bufhash_bhinitL140_breadL147_getblk_u_iowait_bsys/GENERIC/conf.o 664 0 33 16501 2662320220 7051 $ h((I I J K L M N O (I ,I 0P 4Q <I @I DR HS PT TT XU \T dV hW lX pY xZ |[ \ ] ^ _ ` a b c d T e I f g T T T T k l m n o I I h p q r s t $u (v ,j 0w 4I 8x <y @z DI HI PI TI X{ \| `T dI hI pI tI x} |~ T T I L M    T I T T T T T I I I I   T T I     T T I      $I (I 0T 4T 8T <T @T DI HI PI TI X \ `T dT h p t x |    i I I   T T  V W    T    T  T T  Z [    T  T T T T T $T (I 0I 4I 8T <I @T DT HI P^ T_ X \ ` dT hT pT tT xT |T T I T T T T T T I T   T  T T T T T T T T T T e I   T T  T T T T T $T (T P TI X \ ` d h lI pI tI xT |T T T T T T T T T        I  I      I I I I I #,39BHQZbhow !,1:@GOW]h,q{  PH(x~ %,9AJQZfnv )5=ENZbnv`| $,5=FOW`hqy %.7@HQZckt} '0:CLT]e nu}_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_tthiwat_ttlowat_bdevsw_cdevsw_linesw_swdevt_text_textNTEXT_ntext_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_file_fileNFILE_nfile_inode_inodeNINODE_ninode_rootdir_mpxip_nulldev_hpstrategy_hpdump_htopen_htclose_htstrategy_htdump_upstrategy_updump_rkstrategy_rkdump_nodev_swstrategy_tmopen_tmclose_tmstrategy_tmdump_tsopen_tsclose_tsstrategy_tsdump_mtopen_mtclose_mtstrategy_mtdump_tuopen_tuclose_tustrategy_udopen_udstrategy_uddump_cons_dh11_dz_tty_cnopen_cnclose_cnread_cnwrite_cnioctl_dzopen_dzclose_dzread_dzwrite_dzioctl_dzstop_dzreset_syopen_syread_sywrite_syioctl_mmread_mmwrite_hpread_hpwrite_htread_htwrite_htioctl_swread_swwrite_flopen_flclose_flread_flwrite_mxopen_mxclose_mxread_mxwrite_mxioctl_rkread_rkwrite_rkreset_dhopen_dhclose_dhread_dhwrite_dhioctl_dhstop_dhreset_upread_upwrite_upreset_tmread_tmwrite_tmioctl_tmreset_lpopen_lpclose_lpwrite_lpreset_tsread_tswrite_tsioctl_tsreset_mtread_mtwrite_mtioctl_dnopen_dnclose_dnwrite_udread_udwrite_udreset_ttyopen_ttread_ttwrite_nullioctl_ttyinput_ttyrend_ntyopen_ntyclose_ntread_ntwrite_ntyinput_ntyrend_ttstart_mcread_mcwrite_nldisp_acctbuf_acctp_mem_norite_mxopen_mxclose_mxread_mxwrite_mxioctl_rkread_rkwrite_rkreset_dhopen_dhclose_dhread_dhwrite_dhioctl_dhstop_dhreset_upread_upwrite_upreset_tmread_tmwrite_tmioctl_tmresys/GENERIC/cons.o 664 0 33 5174 2662320247 7063 0[$ԫ(<[< :< ێPɏ@P~ ڮn^"ێPɏ@P~"ڮn^[2~AP(PP`r[[AP(PP`[UL[[AP(PP`.[[AP(P P` !ێPP[ӏ[ [ZZ[AP(PP`[ݬ ݬ[AP(PP`PPݬݬ ݬ[PQ~|[  G PT^gox )1:AJS[emx}` , v$)16?GMV_gl_bdevsw_cdevsw_linesw_swdevt_zdmap_zvmsU_ARGU_QSAV_tthiwat_ttlowat_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_cpu_percpu_cons_partab_cnopenL85_cnstart_ttychars_u_cncloseL95_ttyclose_cnreadL101_cnwriteL106_cnrintL((111_cnrfl_cnioctlL119_consdone_ttioctl_cnxintL128_conxflL136_mcstart_wakeup_getc_ttrstrt_timeout_cnputcL158nb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_cpu_percpu_cons_partab_cnopenL85_cnstart_ttychars_u_cncloseL95_ttyclose_cnreadL101_cnwriteL106_cnrintLsys/GENERIC/dh.o 664 0 33 13774 2662320347 6542 X PЬYi2XXiPЬPPQ2QAЬYiXXiP^ZxZPPYZ IWMŏ`ZPPP[<-#ЧXX4$ԫ(<PP2P@1Lx&PP~2~ 2QPA2Pˏ@P2QPAxYPPPPP@0h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owat_swapmap_nswapmap_argmap_kernelmap_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_numuba_cfree_nclist_cfreelist_cfreecount_file_fileNFILE_nfile_dhinfo_dhstd_dhdriver_dhprobe_dhattach_dminfo_dmstd_dmdriver_dmprobe_dmattach_dhsar_dhsoftCAR_dh11_ndh11_dhact_dh_ubinfo_cbaseL129L135L139L145_dhopenL150_u_dhstart_uballoc_ttychars_dhparam_dmopen_dhcloseL167_dmctl_ttyclose_dhreadL175_dhwriteL180_dhrintL184_wakeup_printf_dhioctlL202_ttioctlL219_dhxintL230_ndflushL245_mcstart_ndqb_getc_ttrstrt_timeout_dhstopL264_dhresetL271_ubarelse_dhtimerL287L294_sleepL305_dmintrL317_ttstart_gsignal_flushttyinfosys/GENERIC/dkbad.o 664 0 33 556 2662320360 7141 `Ь[xPx QQPPYZ[PxZQQP<`PxPP[QxZRRQ<QQPXYXZPYXX ZZ~P '/5@,ISZ^_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_isbadL29rt_ndqb_getc_ttrstrt_timeout_dhstopL264_dhreset/hL,hL5< /,"sys/GENERIC/dkleave.o 664 0 33 44 2662320364 7463 [xPx QQPPYZ[PxZQQP<`PxPP[QxZRRQ<QQPXYXZPYXX ZZ~P '/5@,ISZ^_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_isbadL29rt_ndqb_getc_ttrstrt_timeout_dhstopL264_dhreset/hL,hL5< /,"sys/GENERIC/dn.o 664 0 33 4565 2662320416 6523 \0(ЬYiXXi^PxPPPPթ Щ PѠ$$(Щ PѪ$$ Щ Yթ Щ Z YZЩ Yթ Щ PѠ$$Щ PѪ$$Щ Y#,39BHQZbhow!,1:@GOW]h,q{_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_disksortL81@GOW]h,q{_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wasys/GENERIC/dz.o 664 0 33 13350 2662320524 6547 (`(ЬY @iЏXXiZ ZZPЬ[2PxPPP@Z2PxPPď`P@YXЫjY NZ`YX2P3@sme_P PPZZ ZPŏ`ZP@[ZPPP4G$ԫ(<<H[FFGȫ:ZZEP<)<[鳏<еdZP[2~AP(PP` ^ZxZŏ`ZP@X[[AP(PP`ZPxPP5QЭRBaSPSSBaл4PBa< Z[Pď`P@[[AP(PP`Pď`P@[[AP(P P`^ԭxPPPPPxWWPYŏ`WPPPX1[a1ZPď`PXP[ŏ`PP[Pv< Z :ZTZZխݬt Z(2:Pʏ?PP)2:Pʏ?PP@[ZAP(PP`2Z1YZxZYŏ`ZP@[ݬ ݬ[AP(PP`PPݬݬ ݬ[gPѬ t Ѭ t ZpЬPPxt_R<ZPxPPIQPQQI л4PIZPxPPIQPQZXЬ[ŏ`[P@Z[PY`Pix[PxPPPF [ FP@PxPP[QQPPX P :XȏPX:XF XXЬ[PPYЫ4Z <<<ë~[~A[AP(P P` [/ի <28PPPxPPjQRPRRYPڎ^Ь[Ы4ZjYPP!<1@<@GPPPЫQ2@{PQP&@<ի,[~ݫ,\ [~OիF : PD[~1PX <ЫЪX28PPPxPPQPQQݭPڎݏ[~PX[~PXXPP~[<Ь[Ы4ZPPY <Ъ<~2>~PYPPX<[[1Kx~4}^ԭݭ[x[P@TYf2PP\W[PxPPP[Px[~"ŏ`[P@Z<![-[t i c c ] a { 3 @ V co xi X | ] # X #,39BHQZbhow!, 5 >HE(KxQXaks~,ttt( &/6@IRZdmv (,0T)3;XFKPX`iq vyD*| ,VJ $-39BHJO TYbluz_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_tthiwat_ttlowat_zdmap_zvmsU_ARGU_QSAV_swapmap_nswapmap_argmap_kernelmap_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_numuba_bdevsw_cdevsw_linesw_swdevt_file_fileNFILE_nfile_dzinfo_dzstd_dzdriver_dzprobe_dzattach_dz_tty_dz_cnt_dzact_dz_brk_dzsoftCAR_dz_timer_dzpdma_dz_speedsL172L179_dzxint_dzscan_timeout_dzopenL190_u_dzstart_ttychars_dzparam_dzmodem_s((leep_dzcloseL207_ttyclose_dzreadL214_dzwriteL219_dzrintL223_wakeup_printf_dzioctlL242_ttioctlL259L268_ndflushL279_mcstart_ndqb_getc_ttrstrt_dzstopL296L302L308_gsignal_flushtty_dztimerL324_dzresetL332_swptstat_numuba_bdevsw_cdevsw_linesw_swdevt_file_fileNFILE_nfile_dzinfo_dzstd_dzdriver_dzprobe_dzattach_dz_tty_dz_cnt_dzact_dz_brk_dzsoftCAR_dz_timer_dzpdma_dz_speedsL172L179_dzxint_dzscan_timeout_dzopenL190_u_dzstart_ttychars_dzparam_dzmodem_ssys/GENERIC/flp.o 664 0 33 5762 2662320577 6713 P PPy[RݏaPZ(x< ѫ  ӏ%$Ы$%լZݫЬkPa [kPk Ѭ1JZݫo1q1.[|Ыtԫ$"ێPPUkPPݏ ݏ #ڮn^ ,Z2#PP9djPPݏ ݏ #ڮn^ PPP PP[ɏ[~#ڮn^ [ɏ[~#ڮn^jPP 1w[ɏ[~#ڮn^ת1Qݏ #ڮn^V2PPP9Ъ21j$Z1 Ь[Z[ 2PPPMˏPP!PPת״jjΪ$ZˏPPˏPPjPPT1{6 ; 8 8 %< ,8 28 <8 C? I8 R; e8 lB s8 {8 8 ; C ; ; ; ; 8 8 D E ; B 3; LE R; eqz8 8 8 8 8 8 8 8 B8 k8 t8 }8 8 8 8 8 8 8 D 8 8 8 8 F8 L8 W8 j8 sD 8 #,39BHQZbhow!,4<DLHS(Yx_fktz,8N $v-^5:jCHMU Za f_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_bdevsw_cdevsw_linesw_swdevt_zdmap_zvmsU_ARGU_QSAV_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_cpu_percpu_fltab_flopenL97_u_geteblk_flcloseL104_brelse_flstrategyL110_sleep_min_wakeup_iomove_flstart_flreadL134_flwriteL139L143_conxflL153_cnrflL174d_runin_runosys/GENERIC/hp.o 664 0 33 15740 2662320757 6556  8hЬP2P P@@ [ЬP "2kPxPPnPPgP} RЬP2 PvR@ ^Ь[2PPЫPxP2PPPxPXX~HZt o2P P@ Yի [Ы PxQQPaBЭP2QQPxQQP$P[Z~ժ$ ZPk[^Ь[ЫDZЫY2P P@/ XjӏjPӏ@2P@12P,P@2P@ jЫ@PxQQQQP , qj2$xPЫ@QP ЭPЭP22Px PPPЭQP2P2QQP2hQ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@v  00=DCLR attn hp%d: write locked hpmbsr=%b er1=%b er2=%bDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBCDVCSSEDPE mr=%o mr2=%o hp%d%c: soft ecc sn%d hp+<* }k | } ~ !Fv Yt gv  u Sxx x b    " 6= QX ^e sw w w w w   s    's -4 Y;B   ,u 3  ` F k     X`dhpt|k #,39BHQZbhow!,5>GPYajr{,H(x *2:CIPWt\tbtg(nw  &. 9 DT O [ f o x , >T  ((B $,19>C:JS^fknw _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_cp_time_dk_busy_dk_time_dk_seek_dk_xfer_dk_wds_dk_mspw_tk_nin_tk_nout_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_zdmap_zvmsU_ARGU_QSAV_swapmap_nswapmap_argmap_kernelmap_nummba_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_hp6_sizes_rm3_sizes_rm5_sizes_rm80_sizes_hp7_sizes_hpSDIST_hpRDIST_hptypes_hpinfo_hpdriver_hpattach_hpustart_hpstart_hpdtint_hpst_hp_offset_rhpbuf_bhpbuf_hpbad_hpinit_hprecal_hpseekL177_hpstrategyL184_disksort_mbustart_iodoneL198_printfL216L220_hpecc_harderr_mbsr_bits_hpreadL265_u_minphys_physio_hpwriteL273L279_getmemc_putmemc_isbad_hpdumpL305maxslp_lotsfree_minfree_desfrsys/GENERIC/ht.o 664 0 33 14645 2662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YSSCPESSDWNIDBTMBOTSLAtu%d: not online tu%d: no write ring tu%d: can't change density in mid-tape tu%d: hard error bn%d mbsr=%b er=%b ds=%b tu%d: hard error bn%d er=%b ds=%b httuQ SR wQ R J Y  '[ .Y gQ R H _ &5a Gb fR nJ d Q R H YR cH f ZQ R G q{h i NQ nR xH i ,R 6H Y n R G o Y n R G #o 6R CJ RY [Y pQ Q R H Y u Y . 9 Q Y Z v w Y B J J . F O X     $(,0J #,39BHQZbhow!,1:@GOW]h,q{H(x#)16>,F,N W_ is|:8( x  ^V  T%*49AFQY^fk(s| p   _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_file_fileNFILE_nfile_zdmap_zvmsU_ARGU_QSAV_swapmap_nswapmap_argmap_kernelmap_nummba_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_cpu_percpu_rhtbuf_chtbuf_httypes_htinfo_htdriver_htattach_htslave_htustart_htdtint_htndtint_tu_softc_tutoht_hter_bits_htds_bitsL144L148_htopenL154_u_htcommand_uprintf_htcloseL168L174_sleep_htstrategy_iowait_wakeupL189_mbustartL197_clrbufL221_mbsr_bits_printfL240_htreadL263_htphys_minphys_physio_htwriteL271L276_htioctlL282_Copyin_geterror_Copyout_htdumpL314_htdwrite_hteof_htwaitL325L332L339ummba_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_cpu_percpu_rhtbuf_chtbuf_hsys/GENERIC/lp.o 664 0 33 6640 2662321240 6525 8Ph(ЬP2P(PPP[ ЬY@iXXiPPxPPP[P#([PPPY KXVШZ2jPPC rP$PPP  M~2~;P 2~PxPP(P@[ 2~gݫ$ PxPP(P@Y'Щ$PРZ[Z~2~[ݏP[Ь[PxPP(PPPXt[a[z [][PP`0P{P|#P}P~+(W)W'W !W^WW2~pר-[ШZШY[ 1[PP?T KpZY 2~YZ~ZYj 2~YZPPPZ^ըYU[2~`[ Ԩ֨YZPPxP~PZZ[2~YZZ2ZZYPxPP(P@[k GPPxP~C ![k P![ݬP(P@ZЬP@YЩX@hj[ժ  ZP h: j 2hPP@h[j   Z=ժ  PxPP(P((PP[PxPP@ZЪY  x~2~  iki2iPPPxP~ ~YI['2PPYEzЫZ@jYYL lp%dlp9 K9 \: kC ~C D  F 9 J 9 5M CMC ZN x9 +Hn9 S - 4S @T T9 `: {V W 9 :  F LS a: {[  : H (x#,29AIOZ,cmq{ #,5=FNW^gpx  ( 2"%.6?dHQV^ glty~JZ_zdmap_zvmsU_ARGU_QSAV_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_swapmap_nswapmap_argmap_kernelmap_numuba_tthiwat_ttlowat_lp_softc_lpinfo_lpstd_lpdriver_lpprobe_lpattachL128L132_lpopenL139_u_geteblk_lptout_timeout_lpcanon_lpcloseL151_brelse_lpwriteL157_iomove_minL167_lpoutput_lpintrL204_sleep_putcL215_getc_wakeupL226_lpresetL234_printf_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumsys/GENERIC/mba.o 664 0 33 7734 2662321325 6662 |Ь[ЫZ[kPРP`P}\,ԫ$ԫ4Ъ ZЫHYԫ<թ,[,Щ0P[<[0$i Y( 2 P@wx PPk$^Ь[]Ъ<,VЪDPˏPP\ЭP2PPPxP~jPݠ-ЭPР Ԫ4Ԫ$ݭЫ,ZЪЪDPӏ@kjPՠ ZjPР P`PX 9P 1PPXЪ@YZP ЭPΠPPXD -x PPs2 P@hЭPxP2 QPAR^4P@?[ЫZЪЭݬDPˏЭk1Ы,YxPPx PPЩXݭYiPРP`P,P8PK<ի, k [:ԩ4Ш Xkԩ$Щ<,թ Ypݭ PPPPWWxWPPG YiPՠԩ$YiPРP`PP#Ph1gԩ4ЩXШ Xթ^Ь[Ы@ZЫZWЭPРP PЭPˏPP Pӏ PЭPР(PPЭӏIYY1ЭPxYQQP`Q YЭPxYQQP`QɏQY4ЭPˏP PP@X׭~XPX`QɏQӏ!ЭPÏPPƏP@X9ݭݭPX'hP XPX`QɏQ׭ԇЭPЬPЬP DTBUSYNRCONFCRDCBHUNGPGENEDMCPEATTNSPEDTCMP DTABT DLT WCKUP WCKLWR MXFMBEXCMDPEMAPPEINVMAPERRCONFRDSISTIMORDTIMOmbustart%s%d: not ready mba%d: control bus hung cbhungmbintrmbintrmba: zero upagemba, zero entry'.f Cg t' % j g d% ( ) J j f % GNf btg g Z@ f o p #q 3r ELf #,39BHQZbhow!,5>GPYajr{,H(x~ %)2;EMX`hpyttt($.9CHOW`emwp_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_cp_time_dk_busy_dk_time_dk_seek_dk_xfer_dk_wds_dk_mspw_tk_nin_tk_nout_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_swapmap_nswapmap_argmap_kernelmap_nummba_mba_hd_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_mbsr_bits_mbustartL161_panic_iodone_mbstartL183_printf_mbasetup_mbintrL200L231_Sysmap_usrpt_Usrptmap_vtopte_mbainitL253bswlist_bclnlist_bdevsw_cdevsw_lsys/GENERIC/mem.o 664 0 33 7126 2662321362 6675 PPxy1ЎPPP PPPYYɏY:ڮn^ h[][~jPZ ?PP~ZMPZZ"[~4 ^P1CLRYaioz,!*1:CLU]fnw~ttt((1:((BLU^gq{l _zdmap_zvmsU_ARGU_QSAV_bdevsw_cdevsw_linesw_swdevt_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_mmreadL140_u_Fubyte_mmap_min_Copyout_kernacc_useracc_UNIcpy_mmwriteL171_CopyinL194curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_mmreadL14sys/GENERIC/mx1.o 664 0 33 11725 2662321514 6643 PP[ZAլ xZPPŏLZPPPYթԩi[PڎYPZլPPZP[PڎP [K ,Kz[P[[.ݬZZYY!I[(ݬY;P[ [IZݬ#[P[Y ^߭ЭPݠ ^ԭԭԭнPP EEEEE@EнPP AfsTTzjխݭPPЭPРЭPѠZf[K([P8[L[!x[Px[P2PPP[x[P[([P1Vѽ12~P P0P2eQQPЭQPF'P[lP1ݭK<PˏP[D[0 [p%ЭP[K^ЭPѠ ݭ>Э9-&PP P0P~PP152P[PЭQPЭPݭЭKЭPЭAЭPԠЭPЭ ЭPЭPЭPЭP[x[PQQP`[ЭPЭЭPԠݭTPЭPРЭP<PʏPP MP01t2PʏPPݭݭPЭPݭPЭP2PP2PPPPPxPPPď`PPЭPՠ,1ݭ,PЭPЭ,ЭPЭЭPЭPЭ ЭPЭQA ݭ1cݭݭDPP1P+Pݭݭݭ PPPQݭݭPPݠ ݭЭPРPЭPЭЭPЭPЭխP PPЭPЭ2PʏPPݭPխ1ЭPԠЭPP ЭQР ЭP5$ЭQ$1ݭPݭ PЭPРЭP<PʏPP[[ 12ЭP2PP2PPPPPxPPךPď`PPPЭPР Э[ЭPЭ ЭPЭQA$[ЭPЭ,ЭPЭ ЭPЭQA#խݭݭ8PP1Z(&խت&խ ЭP2&2&ݭݭPPݭݠЭЭ[[K[[K[Ь[^k k5kUիPЫP2P[YЩZXݩ oZ'H!ի ݫV[M[DPk[5 Ь[ PPZZP[J#Z^Ь[ЬZ[ZRP PZ[[PիPPPYI[IZYPYY ZЬ[ZЫ[ի[PZPլPѬP[ZݬPxZQQP`PYPY[YP[PP[ZZ[P= +< x> > F I J F M WF gN : O ? 9 P 9 :   Q +F COR bS i> }F > F S F T U F V +J :> N X F ?9 jY X F Z Y Y +>R ? N N @9 F Y F F Y ] &F <A LA _ _ ` a b F d F F 'F 5#,39BHQZbhow!,H3(9x?F~OU`gkt } ( %*n38;BGNU^ ckqyV p ' ,1_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_tthiwat_ttlowat_inode_inodeNINODE_ninode_rootdir_mpxip_file_fileNFILE_nfile_bdevsw_cdevsw_linesw_swdevt_chans_schans_groups_mpxline_mpxdev_mcdebugs_challocL109_gpallocL120_u_addchL129_plock_prele_mpxchanL141_Copyin_getf_mcread_mxopen_ialloc_falloc_iput_uchar_namei_maknode_mtree_cpx_xcp_wakeup_detach_mxfalloc_gsignalL246_closef_chdrain_chfree_chwakeL261_ufallocL268_mup_mdownL282L289p_zvmsU_ARGU_QSAV_pidhash_proc_procNPsys/GENERIC/mx2.o 664 0 33 20227 2662321740 6642 $8[[  PKP^ݬP[kP@ZѪݫPYiY Щ $$jjYѫphaYn2~PxPPP~Y Y& i iY Y 12ZP2&Ь[ZOPY YZ2蔊ÏZPP k^Ь [ЫZˏ2~PYЩX<PʏPP0Z1խѭG[ kѫZ [[)Z4 jOZ{ jX1P@,YԨBhXZ [2kPʏPPѫX [[XXxԭѭ1bЭP@]֭XO Ь[ЬZZPZP ^ݬ'P[PZ2jPʏPPPݪݭPP~ݭPڎ[~ݭPڎ1Bm 1>Y[ PZ1#ZI PЪ& jNѭ( Z Y Y Z3ݪ P(PP`PP Z( խ Z8PѭY Y ݏ@(Z~ZFT DBݭ߭P ^14^ݬ5P"P[2kPʏPPP ݫPԭ1 ߭ԭ赭֭谭2~ݭOP[knz2tЭhխ1 k Ы  $Ы ݭ(P P`P.R .֭ k ݭ߭ ^խ1]ݭ[fЭЭ 1ЭЬ[ի[P([PPZZ k>[PZP5Y ~PP krk k P(P ^Ь[4[Z)$PPjdk kݭPڎZZPݭPڎZ` ^Ь[([P4[PPZPPXkEݭPڎ[!k[<P[ZkZ}jkݭPڎZPݏZ[Ь[4[P([PPZ$k2[okZ~PCPk ݫPjd2kPPPZ(PYk[ kZ^Ь[ЬZnd aPdPPYZY߭[`PYYYPZY߭GZ[Y߭5PY^Ь[ЬZЬ YPPYP2kQPQ4j/2kPYPPkYZ~ Y[O Z k Z~ݭPڎ Ь[ЬZ k k[  Z ^Ь[߭y82PP oPP'[P[(([kk4[~ݭPڎk߭@[~߭k[1y2kPPPk1l2kPPPk["1V^ݬP~P2PˏPѭ;ЬPPxPx @ЭPР2E @> ߭ݬ  ^ ߭ЭPݠݬ ߭ ^ ^Ь[[VkPPPЫ Z k Ѫ,[ԫ Ԫ,խ([~[ ([~k 4[~ Ь[[s[~r([ZZ[ZZPZZE4[ZZ8ZZ-ZZ"Ь[ЫZY[IIԫZЬ[ [kЬ[ЬZPPYj k k[Z~Z kYPڎ ^Ь[[ZPP[PZ2~`Z2 ~SݭPڎЬ[PPZ([Y&k[rPY~ i[~ݬ ݬkի [1P[kݫ@ݬ@[~ZPڎЬ[ЫZjPPPYP@EZ~Z[ЪZYPڎ[P Ь[Ы[իZPP*[kPP@[2PxPPPZZ[PЬ[PPZЫYxZZPPZЩYթZPЬ[PPPQQQPQQP2@PPP2QPQ[ZP@[k֘P@XPPPQQQPQQP@4 YZЪY[P Ь[ЫZ jPЪZZP @ @M G )9M @M HM \R sH 4 4 S M V 4 W  M P %M *M 3[ BP LP UQ |5 6 S G 0_ :B5 j6 s4 {4 W ` W M e M M $M 5M CM _V sM Q M M M M M M  : 2@M NUk [M M M M m M e  M k "M CSM ZM bM lM tM : M M M m V M M M *M ObP ou uQ |Q 4 W M x 2M IXex nx V V M | 6M\x rM M ~ k   & x 5 x _ j x k M M   V x  k )  5 x X k w M ~ e M 4 4  m $ ] j y  x  x x x x x x  x  D S \    M V    & V ? ~ o | x 2\#,39BHQZbhow!,H3(9x?F~OU`gkt }  &,/9@(HQXbjorz2n   ^  %- 2L 90AIR[dir wp b  D  ~ `    ! ) 0 5:?EJR W]bg lqv {_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_tthiwat_ttlowat_inode_inodeNINODE_ninode_rootdir_mpxip_file_fileNFILE_nfile_bdevsw_cdevsw_linesw_swdevt_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_chans_groups_mpxline_cmask_mcdebugs_getmpxL127_u_mxopenL133_mxnmbuf_nmsize_addch_plock_mpxname_scontrol_sleep_prele_chdrain_chfreeL154_uchar_mxcloseL162_zero_iput_detachL188_m_eot_mxreadL196_getf_msread_nextcp_cpx_sdata_mcread_iomove_mxrstrt_Copyout_mxwriteL233_mswrite_xcp_mxwcontrolL255_mxmove_passc_mcwriteL266_wakeupL274_msgenabL289_gsignalL306_q_to_b_b_to_qL315_mcstartL326L332_chwake_mxioctlL353_Copyin_sioctlL369_wflush_flushL380L384L390_getcL397_tsleepL403_putwL409L420L428L439L445L457133_mxnmbuf_nmsize_addch_plock_mpxname_scontrol_sleep_prele_chdrain_chfreeL154_uchar_mxcloseL162_zero_iput_detachL188_m_eot_mxreadL196_getf_msread_nextcp_cpx_sdata_mcread_iomove_mxrstrt_Copyout_mxwriteL233_mswrite_xcp_mxwcontrolL255_mxmove_passc_mcwriteL266_wakeupL274_msgenabL289_gsignalL306_q_to_b_b_to_qL315_sys/GENERIC/mt.o 664 0 33 14535 2662322102 6552 t P ^ЬP2PP@[ЬPРDZPPԭЬP2P @0ժˏ,PP1ӏ@'ЬЬP2ЬPЬQ2QA~ЪݭPڎЭP^PP[[/[PPPY`P2@4P@,Z 2PPP22~ E[ ,8[ 1ЭP2QPQ$[ giԩЏ@B Ь[PPPPZ[ [2P P~2~2~jP2@P,P@[Pիkȏ@k[k kPЬ$Ь ԫ [*լ [ӏ@k [ʏkЬ[2PPP2@P@xZԫ ZYPթ [ ЩP[ [թ ZEP^Ь[ЫDZЫY2PPPP@XhiiP2PPP2@P,PPYP_ PP PPiЩ$Yi  PPШ PѭPJѫ4-2PˏP1xPȩ$PP2QQQPA0PЩ2PPPPP PѭP ݏ PíP~,xPPPݏ PP~ xPPPЬ[ЫZ2PPPP@Yjѫ4?P9P2P1PЬ[ЫDZЫYˏP2QQQPQ2PˏP2PPPP@vX i< PPPPu&&&&'&&&&&u<~< ~"ݬݩ 2PˏP~i2@DWWӏD ѫ4֨ԩ$P2PˏP~֨Щ$ ֨2PPP2@P,PPYPiѫ4Щ$ê$4Щ$ЪP4hh2PˏP~;i1Z2PˏP~ ^Ь[ЫDZЫY,ˏ,Y2PPPѭPPPݭPYЭPx@0PPP@X PP ^X=<~< ~ݩ 2PˏP~lX2@DWWӏD12PPP2@.P,PPYPѩ$ ˏPPЭ$P PèPέ~ݏP&ݭݏP PPШP2PˏP~z PѨP PíP2PˏP~Uei1Yhh2PˏP~D2PPP2@4P,PPYP112~2~P2@P,P@Hݬ:ݬP2@P,P@^P2@~[[KqY 'xAPPPP@DZPPP^PPPP[P2@ P,P@ZЬPPmPm1߭ݬ  ^P2PPЭYYխ2P@eWW 2PPWY@ݏݭlPVVW2~2Vر&ժ$!Z3YЭY1}j 谫2~ݬ ߭ ^P ^ԭP[ˏHPРZZP2QxQQQPPYA8t 0 3 RDYPRESONL REW PE BOT EOT FPTAVAILSHRMAINTDSE mu%d: not online mu%d: no write ring mu%d: can't change density in mid-tape mt: wrong unit! mu%d: blank tape mu%d: offline mu%d: no write ring mu%d: hard error bn%d mbsr=%b er=%x ds=%b mt: unit %d random interrupt mu%d: blank tape mu%d: no write ring mu%d: offline mu%d: hard error bn%d er=%o ds=%b mtmuR ~S R S J Y 0LS[ ZY R S H _ <Ka ]b |S J d R S H Cf g g R _fj R k j 6=j bS lG j #*j MR j S H ((g -g Y`j j S H Y p S G %q 28Y Ap SS ^G dkq ~S J Y Y R R S H  Y , w : Y o  g  Y x  y  Y . B 6 J D J   $(J #,39BHQZbhow!,1:@GOW]h,q{H(x#)16>,F,Nt W_x is|88   j#(27?DINVafnsp{*$ _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_file_fileNFILE_nfile_zdmap_zvmsU_ARGU_QSAV_swapmap_nswapmap_argmap_kernelmap_nummba_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_cpu_percpu_rmtbuf_cmtbuf_mttypes_mtinfo_mtdriver_mtattach_mtslave_mtustart_mtstart_mtdtint_mtndtint_mu_softc_mutomt_mtds_bitsL144L148_mtopenL158_u_mtcommand_uprintf_mtcloseL172L178_sleep_mtstrategy_iowait_wakeupL193_mbustartL201_clrbuf_minL217L223_printf_mbsr_bitsL258_mtreadL297_mtphys_minphys_physio_mtwriteL305L310_mtioctlL316_Copyin_geterror_Copyout_mtdumpL352_nswapmap_argmap_kernelmap_nummba_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_cpu_percpu_rmtbuf_cmtbuf_mttypes_mtinfo_mtdriver_mtattach_mtslsys/GENERIC/rk.o 664 0 33 22320 2662322231 6540  X YYP Ь[ЬPkЬP k[a 2ZZ2 PPkP2kPP  ЬPkPЬ[vnt _Y2Pv@D2 P2QxQQQxPPPQ[a2PxPP2P@  ^Ь[2PPPxP2PPPxPXX1HZ2P P@Yի Ы PxQQPahЭP2QQPxQQP$P2P,P@hW[W\է"Z. $[ի ի ݪ$;Pk[" ^Ь[ԭ[1xPP2P,P@YЫ$XШWը4V2P2@PPPg 2P2@PPPgWTЩ Z42P2@PPPgW3x P2QxQQPP@ 12P P@2P,P@J2P2@i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ds=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSSVALCDAPIP WRL DDTDRDYVVDROTSPLSACLOOFFDRADCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk%d%c: soft ecc sn%d hk%d<%d>hk%d: lost interrupt rkhk={   { [ m g u 1l Gt   V t ":J[kg w v Hvg u u V X 7l K   ' 2BPj sz u  k 0g rl V   &- I  m m nu u   : b   z    ! z ' . J t  > N   + ? z v C _ k |  g  l t   ! *k =g Ot Xl |  l  d .DRh r  dul k  #,4=DJSYbksy *2=BKQX`hny((,H(x ttt!((1:ENU_hqy #*5>DLVal,u~04~XX\tX  "+7<FPYafksz 4   X &+4_rkpip_rknosval_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_zdmap_zvmsU_ARGU_QSAV_swapmap_nswapmap_argmap_kernelmap_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_numuba_cp_time_dk_busy_dk_time_dk_seek_dk_xfer_dk_wds_dk_mspw_tk_nin_tk_nout_cpu_percpu_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_rk_softc_rk7_sizes_rk6_sizes_rktypes_rkminfo_rkdinfo_rkip_rkstd_hkdriver_rkprobe_rkslave_rkattach_rkdgo_rkutab_rkcyl_rkbad_brkbuf_rkst_rk_offset_rrkbuf_rkwstartL192L198_rkwaitL207_rkwatch_timeout_rkstrategyL216_disksort_rkustart_rkstart_iodoneL232L250_printf_ubagoL270_rkintrL274_rkecc_harderr_ubadoneL325_rkreadL332_u_minphys_physio_rkwriteL340L346_ubapurge_getmemc_putmemc_isbad_rkresetL368L384_ubareset_rkdumpL402_ubainit_maxfree_ecmx_cmhash_rk_softc_rk7_sizes_rk6_sizes_rktypes_rkminfo_rkdinfo_rkip_rkstd_hkdriver_rkprobe_rkslave_rkattach_rkdgo_rkutab_rkcyl_rkbad_brkbuf_rkst_rk_offset_rrkbuf_rkwstartL192L198_rkwaitL207_rkwatch_timeout_rkstrategyL216_disksort_rkustart_rkstart_iodoneL23sys/GENERIC/sw.o 664 0 33 5211 2662322261 6540 d`^Ь[PǏPǏ Px PPP PPPP k[Ǐ PPPPxPPvx PP  R[2PPPPPPP`.ݬ# ݬ ^P[<PʏPP`[2PP[2PPPPPPKZ*j!ժ/ÏZPP~Zj  xPx PP[1[&ZZ2Z[M oZPP~SZ~Z~[Zx PP[[1qswstrategyargmapswap7 TB e n ~1 C . F ? G F ? G L M ?N HO ZO m vN }1 N 1 N 1  1   = R < -; 4R @; GS N Y #,39BHQZbhow!,1:@GOW]h,q{H(x, (/7<EMV[d ipwz _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_zdmap_zvmsU_ARGU_QSAV_inode_inodeNINODE_ninode_rootdir_mpxip_swapmap_nswapmap_argmap_kernelmap_rswbuf_swstrategyL110_iodone_panic_swreadL120_minphys_physio_swwriteL126_vswaponL131_uchar_namei_u_iput_swfreeL145_rminit_rmfreemem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_zdmap_zvmsU_ARGU_QSAV_inode_inodeNINODE_ninode_rootdir_mpxip_swapmap_nswapmap_argmap_kernelmap_rswbuf_swstsys/GENERIC/tm.o 664 0 33 17442 2662322376 6567  ,H ЬP@ ~PPPPЬPР$PЬQ2QA^PP[[![PPPY`KZD<2 PxPPɏAPȏ`LEݏ@2~& < PʏPPAC[ * 8[ /ЭP<QPQ"[ ³ iԩЏ@BP%Џ@B~2~P Ь[PPPPZ[ [2-2~62~' 2~2~jP2@P,P@[Pիkȏ@k[k kPά Ь$ԫ [*լ [ӏ@k [ʏk^Ь[2PP,P@[Yԫ PЭP@FPР$Zթ  [ ԩժ,Y,Ъ0PYY0ЩP[ [ժ4 ZP ^Ь[ЫXЩ,Ы,YЩ Z2PPЭP@VPP@WЫX2 PxPPPh g$jի [yԫDЪ Zh2PPP2@VP,PPZP[Ѫ$@Ѫ$ 42,(4ݏ,<ΪP P~PPѪ$ Ѫ$ 11 PP j1O PPjЪ$Z1.j  PPЧ PѭP>ΪPPjիD  4<PɭP<VY4 PѭP$ PPP $ P­PPݏ,<2PPP P~PP<PȪ$PP Ь[ЫZxPʏPȫPP^ЬP@ZЪ,ЭPР [2PPЭP@PРYPPPXѪ44i2,Џ@Bi kЪ4WԪ4<PP1,i@ib[$WΫPPԪDЭPЫ 2PP$Z[ЭPР,ЭPՠ 1QԠժ,18Э,192PPP2@P,PP[Pktetmm Ad _k nb }r  s $u +r k v}w k d _ /s Xg| y} c b 8b Dk   d _   D    >a db tk   =d G`  d `    #d -_ k  d  w b k /d 9_ r  d `  r  d  `   ' b 6 r B k K r i a   b c  k $ k 4 W k h d s _ r r   r  g u r Z b b     6 Q   b $a #,39BHQZbhow!,1:@GOW]h,q{H(x tt#t((/8ALU\fox, ,&X.6 = GP$Y*c jt yFv  "(07 <2DIS[bglty b D z  >   _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_zdmap_zvmsU_ARGU_QSAV_file_fileNFILE_nfile_swapmap_nswapmap_argmap_kernelmap_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_numuba_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_cpu_percpu_ctmbuf_rtmbuf_tmminfo_tedinfo_teutab_tetotm_tmstd_tmdriver_tmprobe_tmslave_tmattach_tmdgo_te_softcL177_badaddrL183L187_tmopenL193_u_sleep_tmcommand_uprintf_tmtimer_timeout_tmcloseL215L221_tmstrategy_iowait_wakeupL234_tmstartL244_ubadone_iodone_imax_imin_clrbuf_ubagoL276_tmintrL280_tmseteof_printf_panicL321L328_tmreadL336_tmphys_minphys_physio_tmwriteL344L349_tmresetL355_tmioctlL374_Copyin_geterror_Copyout_tmdumpL407_ubainit_tmwait_tmdwrite_tmeofL421L427L434fo_tedinfo_teutab_tetotm_tmstd_tmdriver_tmprobe_tmslave_tmattach_tmdgo_te_softcL177_badaddrL183L187_tmopenL193_u_sleep_tmcommand_uprintf_tmtimer_timeout_tmcloseL215L221_tmstrategy_iowait_wakeupsys/GENERIC/ts.o 664 0 33 17231 2662322510 6557  HЬPdYYЬPPPPPZ[PЬP PPPP[[!4[PPPY`KZ=[P2~@'[ "[ 4PPiԩЏ@B Ь[P4PPPZ[ [61 2~ 2~ݏ2~ݏ2~jЬ[4[P@ZKYЩX2=,[PZ,[P4,[P@T2~IPWWWW,2@jX ,PPWWPWP1*֨12PPP,PP[PЫ$PP P 11y«1q 18Ь[2PPZ4ZP@@Y2PPP,PP[P: PѩP P<QQPPЩ P<QQPPP P2~s2~P,P@t2~3X2~P,P@t4gPP[[KOX4[P@4YxPPZZZPPXH [12PPXԫ4ԫ0Ы0,4XP@ 4XP@ի$xPˏP~M[HZ4Ѫ$[.),XP@|Yԩԩի,Y,Ы0PYY0X[XX1. ^4PPP[P,P@ZЬPPmPm1߭ݬ  ^P2PPbbbblllЭYYխY1ݭ2P@2~%ժ$ ;ZmYЭYjⰫ䰫ݬ ߭1 ^P ^ԭ P[ˏ(PРZZЏ@BXXЫYY-ѭPЭPPZYPݭF­խYxYoYV<PPPY>PЬ[ЬZЬ YY#XZPPW ɏ [[Wh Ь[<ZZݬP:L  ts%d: not online ts%d: no write ring ts%d: success ts%d: write locked ts%d: offline ts%d: hard error bn%d xs0=%bTMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOT xs1=%bDLT-COR CRS TIG DBF SCK -IPRSYNIPOIEDPOSPOLUNCMTE xs2=%bOPMSIPBPE CAF - WCF - DTP xs3=%bLMXOPIREVCRFDCKNOILXSRIB tsintr ts%d<%d>tszsfj ub p s p j $3F^sj {a _ _ _ w (J_ oz | } b c )]b ij   _  f j a b 7j      $ - LS t{ `  ` +2 LS n_ j _ #)p 2 H` NU cip r `  b p j p a  ) j 7 j P W ` g b c   j _  p  % p c n  p p Z b b  / T l u ~     b $a ((#,39BHQZbhow!,1:@GOW]h,q{H(x tt#t((/8ALU\fox, ,&,. 5 ?H:QL[b4lqv{Pf<  4 ',49AHRW_dlu}Z     _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_zdmap_zvmsU_ARGU_QSAV_file_fileNFILE_nfile_swapmap_nswapmap_argmap_kernelmap_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_numuba_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_cpu_percpu_ctsbuf_rtsbuf_tsminfo_tsdinfo_tsutab_tsstd_zsdriver_tsprobe_tsslave_tsattach_tsdgo_ts_softcL176L183L188_tsopenL193_u_tsinit_tscommand_uprintf_tscloseL207L213_ubasetup_tswaitL222_sleep_tsstrategy_iowait_wakeupL237_tsstartL245_ubadone_iodone_clrbuf_ubagoL269_tsintrL273_printf_panic_tsseteofL336_tsreadL344_tsphys_minphys_physio_tswriteL352L357_tsresetL363_tsioctlL379_Copyin_geterror_Copyout_tsdumpL412_ubainit_tsdwrite_tseofL425L431L438percpu_ctsbuf_rtsbuf_tsminfo_tsdinfo_tsutab_tsstd_zsdriver_tsprobe_tsslave_tsattach_tsdgo_ts_softcL176L183L188_tsopenL193_u_tsinit_tscommand_uprintf_tscloseL207L213_ubasetup_tswaitL222_sleep_tsstrategy_iowait_wakeupL237_tsstartL245_ubadone_iodone_clrbuf_ubagoL269_tsintrL273_printf_panic_tsseteofL336_tsreadL344sys/GENERIC/tty.o 664 0 33 11674 2662322601 6757 D(Ь[TUVWXY#C@DJKLMNOPRЬ[P<[$<[~ի[P Ь[APPZ [~QP[D;[~4<[28PPPPPxPPP`[~P[P@HIRZPڎ Ь[ kPPZk[F <Z$[~W~P <E[&Ь[~s<[ Ь[PPZ!<[$ZPڎ $^Ь[< P28ЬPPvt*1Pt1P tcPt1AP&>["  2&~P tW1Pf1)PPrt Pt/1sPut#1gP~t P}t 1PPtЬPPtt11P t11Pt11PPt1fAݬ ߭ ^P11߭ݬ  ^Pѭ e1tPA[AP(PP`խݬ [ݭ(PP`"AP1$<1<1߭ݬ / ^P1UPA#Ѭ t [O[P1A: Ѭ t [e2:PʏP2QʏQPQJ% [~[( k [P( `kޭP( `  Pի  v[m < FGCD::1<[1FGCD:ݬ ߭ ^P151 <1լ ݭ[o1߭ݬ  ^P1T[~ݬ  ^P1ݬ T[~ ^P11dJ[~ݬ z ^P11Dݬ J[~Z ^P11$APP8P PGݬ ߭, ^P1R1ի ЫPPPP[PP P [Ы ܳ":k>[~ݬ  ^P11ݬ >[~ ^P11s߭ݬ  ^P12PPȭPPP1L߭ݬ g ^P12PPʭP߭ݬ E ^P1kP1 ݬ P[~ ^P1F1ݬ [~ ^P1*1ݬ ЎPPZ .[1Z[ZAP(PP`1Pt113P t1`Pt1Y1P t1C1Pt1,Pt1iPt11Pt1|1Pst1$1Prt1/1P|t1,Pvt15Put1n1Pwt141sP~t1hP}t1|1VPt1$1G|`{}~ABCDEFGHIJKLMNOPQRSTUVWXYZddddddd22xxx}}}}ttrstrt: arg was 0! ioccom canqoU X Y Y 9 X X @]\ r` d d .d ;d Dd Ye a hU "f 3d Dg Sh \d y: : d g i (Wj k Y f (g Eg bf g f f i l 7g Sf ng g g f f m d "d =: #,39BHQZbhow!,H3(9x?FOX~agry} &,/9BKT]fnwDH " x  "%.7?GNT[dl_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_tthiwat_ttlowat_pidhash_proc_procNPROC_nproc_qs_whichqs_inode_inodeNINODE_ninode_rootdir_mpxip_file_fileNFILE_nfile_bdevsw_cdevsw_linesw_swdevt_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_cp_time_dk_busy_dk_time_dk_seek_dk_xfer_dk_wds_dk_mspw_tk_nin_tk_nout_partab_maptab_ttycharsL130_wflushttyL135_sleep_flushttyL145_getc_wakeup_ttyblockL164_putc_ttstart_ttrstrtL174_printfL181_ttioctlL187_u_gsignal_Copyout_Copyin_nldisp_canon_catq_panic_ntypend_FubyteNPROC_nproc_qs_whichqs_inode_inodeNINODE_ninode_rootdir_mpxisys/GENERIC/ttynew.o 664 0 33 17726 2662322733 7503 l$ Ь[Z8&[62>(>>&<~,1Y1aR0[PCQPQ [PDQPQZZP/ [[PCQPQj1ZZP 1[PDQPQW P&jPHQPQj~@R[\RRRZ/%BZ[u [PXQPQ1:BP­PPPBP­PPխ1Z׭jGPЪQ2@PQP11Z[Ps P 2>~zժ,>Fj Z_DZ[RP* P 2>~<ժ, ݪ,-Z$Z[ P <VW<P11^Ь[ЬZ:P&PPZ~[P[P[[[:[ i2:PʏPP UBPP[P.PPWZ~[ fP[[\WPڎBP[PPB[P P6:m Y%[PQPQZݏ\P1@[[A[ZZݏ\P1[a [z [[ :Z P[~ P`[PZ~[PBZYKtX[[XPP[08m[1yPZ~ɏ[~;1^iڗi:XXi"iPPPP~ P[X[i :XXiPȏPP[[[ii1y:[1m :XX [ [XXiѭ Z~ݏ֭Ь[<1P?P&>1ja 2&~;3,R<1ի,P` ` Pl[PP P [P[%1W:vPkPk18[PP1.<.ի,QP`s` PwP1:[P [PPZPjPX1:Y  Y:"YRGIIYRYPKQPQL2>~X11YAYZ YY\R7YPXQPQ:7Y~P':[YyPXZ^PY1,R <)k3$[~V~9P <['E kP^Ь[GP2@<1P1d PdPPYޭZYZ1ѫ;P:P1YPYPVH[VPV1ѫPYGYHY=ѫ1BPP&>1>[P /& 2&~[1D*Yj?PYXBH[j~P1[Y1:PYXH[~XZrPWWXXeBPXPPBXZXYW[G?8X1ѫ1ZYѫ1[1[<ի,( P`` P[P[~1s^Ь[ЬZ:P[[P1H Zd[ [Z1[[KePPPP99A99@1:[A [Z P1HPPj1sPPBX RPIBЪYZi~JYZPYYP RݭPڎBPPXBPXPPBXXX=ZPRZݏ\RZ[ZC~HЬ[ [P PPPz׬ ^Ь[LPP [L~u[  PPЫZ[j~NZ [~PZZЫZ[j~(Z[PZZRݭPڎkHI Ь[ЬZRP:[[: Z[s[ : [ PY[PP [ [ [PP7Zݏ^/[[[?[: `[@[Z[~ Ь[ЬZ[ "[PXQPQ[PYQPQ [  :PP ^Ь[ЬZ Z~^ ({)}!|^~'`ttyrub S S "S HT YT Y Z [ ]  ` /5M H] 9 c %f }c g h i -i 6ei n{` i i k >( O]k ln Z [ h 6U( lk h c k h Z [ 3k AN Y N N Muk O k p qk S S S h  s S t  s  + S U ` ^ u k S  S t S S P  P  h .  5 s { u  ` k f (  S  S S ; x A S y  S S S S S S S h   s  f   $ s / O E U f ]  d s Y N f  s f f  S  S  t 7 s j   O  { '| i%| >I| ^#,39BHQZbhow!,H3(9x?F O X~agry} &,/9BKT]fnw N^ F'j0;DNW_> gm x z     _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_tthiwat_ttlowat_pidhash_proc_procNPROC_nproc_qs_whichqs_inode_inodeNINODE_ninode_rootdir_mpxip_file_fileNFILE_nfile_bdevsw_cdevsw_linesw_swdevt_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_cp_time_dk_busy_dk_time_dk_seek_dk_xfer_dk_wds_dk_mspw_tk_nin_tk_nout_partab_maptab_ntyopenL130_u_wflushtty_ntycloseL139_ntyrendL144_b_to_q_sdata_wakeup_ntyinput_ttyblock_ntypendL160_getcL167_ntyout_flushtty_ntyecho_ntyretype_ttstart_scontrol_gsignal_unputc_ntyrub_putc_ntyoutput_ntbreakc_catqL262_max_ntreadL319_sleep_getf_passc_ntwriteL359_iomoveL391_ntyrubo_panic_nextcL428L436L447L461L465_swbuf_nswbuf_swsize_swpf_bfreelist_bsys/GENERIC/ttyold.o 664 0 33 11563 2662323021 7450 X` Ь[Z8&[62>(>>&<[[PWQPQ"<Z28PPPPPxPPP`[PVQPQPP[ժ,[ݪ,[2>~[ Y [j ZY[A [Z [Z["Y[ [PXQPQ [PYQPQ3"YZݏ_P@Ъ,X XIZ@Y0Z['[PDQPQ"Y Z  Z ^Ь[ЬZ:[[:[Z~[[ D2:PʏPP 0BPP[Z~[BP[PPB[:>Y[PQPQZݏ\Q[[a [z [[ : Z #Z~[ BZYKX[[XPP[&.f[Z~ɏ[~ii:PPXXi"iPPPP~P[X[i :PPXXiPȏPPPP[[[ii1z:[1n :PPXX [ [XXiѭ Z~ݏ&֭ Ь[<PPPZի 6ZPڎի  [~PP kP[[ Pի,P``ZPڎP^Ь[GP2@<PW1\Ld ?PdPPYޭZYZ@1#P][$<ի,=5P`` YYYP[P[~ѫP:nYPYP19[~[<[~**Yj?PYX7[~bYѫPѫPY1:YX[~XZ2PWWXX%BP((XPPBXZXY[ 1 ({)}!|^~'`S S "S PV  Y  Z [ \  LP  Z _ ` b "M 5b `\ \ d 9 e !f Bd g[ [ _ ` \ N '[ W^Z pN wN [ O [ Li [ Y l /m 8GS Qn y( S S S q S \ S S n S S S ,m Va\ sm }O Z N \ #,39BHQZbhow!,H3(9x?F O X~agry} &,/9BKT]fnw B\ ",6?JOT\ ahouf~_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_zdmap_zvmsU_ARGU_QSAV_tthiwat_ttlowat_pidhash_proc_procNPROC_nproc_qs_whichqs_inode_inodeNINODE_ninode_rootdir_mpxip_file_fileNFILE_nfile_bdevsw_cdevsw_linesw_swdevt_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_cp_time_dk_busy_dk_time_dk_seek_dk_xfer_dk_wds_dk_mspw_tk_nin_tk_nout_partab_maptab_ttyopenL130_u_ttycloseL137_wflushtty_canonL143_getc_b_to_q_putc_ttstart_ttyrendL172_sdata_wakeup_ttyinput_ttyblockL186_flushtty_scontrol_gsignal_ttyoutputL214_max_ttreadL260_passc_sleep_getf_ttwriteL276_iomovee_inodeNINODE_ninode_rootdir_mpxip_file_fileNFILE_nfile_bdevsw_cdevsw_linesw_swdevt_buf_buffers_nbuf_swbuf_nswbuf_swsize_swsys/GENERIC/tu.o 664 0 33 14701 2662323070 6562  88PQQPQ^ V PPPPڎP[R~<-rhbUڮn^ݏ@ڮn^[Pڎ6ڮn^-$P%PB~jPP( |PPPpyڮn^ݏAڮn^l Ь[ѫ  k[&ԫ PPPPڎPZ  [ P[ [ ZPڎ[kPPPPPЫy sd~^2V~nPSkPPPEЫEЫA"4 ێPPPPZێPPڮn^ZPP )RnnZ1<~<}~p~`n`[kЫ R[=GZ :20>Z PPP~2~P1W zus x1.kZW \1C8;PPJ-PP@-11@ݏ@ڮn^ [(zs1kX[pmPP~BYTiWЫ GQ$[*1#~~ ڮn^1Z#1)ێPPP`~ڮn^PP,l"7iqTݏ@ڮn^> /8%"1=ێPݏ@ڮn^ ڮn^&1D ێPPݏ@ڮn^1sfl1f\S1+CPPR5PPH? 3ڮn^1c1. 1Ь[ЬZx YGL(Ua fn6w|   _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_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PxVQQPȏ``W P PP@Y׭hɭ[P RDTO RDS CRDCXTERCXTMODPPEIVMRMRPFLEBUBSTOUBSSYNTO uba: zero upageuba zero uentryuba%d: reset uba%d: hung uba%d: too many zero vectors uba%d: sbi fault sr=%b cnfgr=%b  PARFLTWSQFLTURDFLTISQFLTMXTFLTXMTFLTuba%d: uba error sr=%b fmer=%x fubar=%o uba crazyERROR LIMIT h G{] ` a h )h 0$ n o R 1p Cn q r (s <t Lu ^eq h $ y Ap [y j$ h 5y @y IP~ Y_X v}~ $ h  ~ (L 4! Fh XL ~ ~ ~ !)0q 6Oh $ r #,39BHQZbhow!,19BLT_dmsz,ttt(!*3;ENW`jt|H(x~ )1:FMRZdm r|   0' ,T9XC`MR>\a_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_cpu_percpu_swapmap_nswapmap_argmap_kernelmap_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_numuba_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_bdevsw_cdevsw_linesw_swdevt_nexus_cp_time_dk_busy_dk_time_dk_seek_dk_xfer_dk_wds_dk_mspw_tk_nin_tk_nout_ubasr_bits_ubagoL167_uba_hd_ubasetup_ubadoneL185_ubarelseL191_sleep_rmalloc_rmfree_panic_Sysmap_usrpt_Usrptmap_vtopte_uballocL229L233_wakeup_ubapurgeL249_ubaresetL258_printf_ubainitL269_unhangL284_ubawatchL295_ubawedgecnt_ubacrazy_ubaerrorL307_ubaremapL324forkstat_swptstat_numuba_zdmap_zvmsU_ARGU_QSAV_pidhash_proc_procNPROC_nproc_qs_whichqs_bdevsw_cdevsw_linesw_swdevt_nexus_cp_time_dk_busy_dk_time_dk_seek_dk_xfer_dk_wds_dk_mspw_tk_nin_tk_nout_ubasr_bits_ubagoL167_uba_hd_ubasetup_ubadoneL185_ubarelseL191_sleep_rmalloc_rmfree_panic_Sysmap_usrpt_Usrptmap_vtopte_uballocL229L233_wakeup_ubapurgeL249_ubaresetL25sys/GENERIC/uda.o 664 0 33 21330 2662323216 6701 h8\@P@Y[4P(( Щ ZPPЬ[2Pv@2 P2QxQQQxPPPQ[a2PЏ@}PxPPP[[KbZ2PP@DYPi(i 2~!ݪ$iP ^P@[ЬP@ЭP֠4ŏP@ZЭPР'ݏZ2~PˏЭP PȏPЭQPk ^Ь[2PPPxP2PPPxPWW1G5ZЪ$YZxPhxPlGի  PPxPlGP2P,P@Xը [ ШP[ [ԫ ըԨթ,X,Щ0PXX0թ4>,թݩO l2~YPYPk[9^Ь[2PP@!WЫ,Y2ԫ4#ի [~2~PЩ Z ԩЩ,֫4ЫЭP2PPg; Z2g~ЭP2PˏP~ 2~}2PPPxPP@qV1|[rPX﷧: Щ,92 ~F 'ȏ(21PP&P'P*, ȏ(2P ݭZ2~PZj!P"PP 2PPPxPP l ЪPQxQQQPlЭ$ȏ(2,xPP?֩$2P@1xP2QPAթЩ,Ы0PYY0ԩЪ 2P,P@YY ЩЩPZ Z1^ЬP@[ЫZPP@XŏP@W2~2h~ 2hPP 1q2h~ݬ gݬ V2PʏdoPP h[6P*QQQPPh PȏPPP2QPQ Pȏ PQPPxPPPh2Pʏ?PP@hШYHP >@Lh28 7uda: ubinfo %x uda: um_ubinfo == 0 raudasa %o, state %d uda: bring unit %d online udintr: state %d, udasa %o uda%d: random interrupt ignored uda%d: interrupt in unknown state %d ignored uda%d: fatal error (%o) uda: purge bdp %d uda: command ring transition uda: unit %d online raOFFLINE uda: unit %d attention rastatus %o uda: unknown packet uda%d:%d: %s error, softhardcontroller error, event 0%o host memory access error, event 0%o, addr 0%o disk transfer error, unit %d, grp %d, cyl %d, sec %d, trk %d, lbn %d, retry %d, level %d SDI error, unit %d, event 0%o, cyl %d small disk error, unit %d, event 0%o, cyl %d unknown error, unit %d, format 0%o, event 0%o uda%drauda f R v #v IOY dl i k { f } { f j *g N k i i /s x\    f \   CL el wk e  \ 9 n\ T W X t 2j Bf Sg Ze ho    \ t ]d o e    e  &l   & : s { i e    e   P s t T    8 A R Y }       ( g ; f q g { r   {  + r 1 8 M j k r f k s s t s >t NDHLTX\k `dj #,39BHQZbhow!,1:@GOW]h,q{H(xtt t( )4=DNW`hr{ $-3;EPUh_hqz 28XX,  #,49CL U_&glt~,$    > `_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_zdmap_zvmsU_ARGU_QSAV_swapmap_nswapmap_argmap_kernelmap_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_numuba_cp_time_dk_busy_dk_time_dk_seek_dk_xfer_dk_wds_dk_mspw_tk_nin_tk_nout_cpu_percpu_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_udadebug_uda_softc_uda_ra_sizes_radsize_udminfo_uddinfo_udip_udstd_udadriver_udprobe_udslave_udattach_rudbuf_udutab_udwtabL185_uba_hdL189L193_udopenL200_u_udinit_sleepL212_uballoc_udstrategyL221_printf_udstart_iodoneL243_ubarelse_harderr_udgetcp_ubasetup_udintrL274_wakeup_ubapurge_udrspL320_uderrorL363L386_udreadL392_minphys_physio_udwriteL400_udresetL407_uddumpL430pw_tk_nin_tk_nout_cpu_percpu_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_udadebug_uda_softc_uda_ra_sizes_radsize_udminfo_uddinfo_udip_udstd_udadriver_udprobe_udslave_udattach_rudbuf_udutab_udwtabL185_uba_hdL189L193_udopenL200_u_udinit_sleepL212_uballoc_usys/GENERIC/up.o 664 0 33 20202 2662323277 6560  0XX YYPЬ[kЬP  kPP Ь[ 2Pv@@2 P2QxQQQxPPPQ[a2PxPPЫZj    ^Ь[2PPPxP2PPPxPXX1HZ2P P@s Yի Ы PxQQPahЭP2QQPxQQP$P2P,P@W[Wէ"Z. $[ի ի ݪ$Pk[X^Ь[ԭ[13Ы$XxPP32P,P@%YЩ Z1]ը41թ1)ШW @ IgQg< PʏPP2PxPP2P P@9 VЪ ЭP2QQPRQRRP2fPP P2fQQPRQRRPЪ$P<QQP6g1<PPP­PP2fPP2fP PѭPU$,Eg x P2QxQQPPYg=xPP2P@$ѩԩը,Y,Ш0PYY0ЭP^Ь[Щ,Ы,YPЩ Z֫42PPPxPP@XЪ 2 2P P@ ЭPЭQ2PPQRPRRQЭPЭQ2aQQPЭP2`PЭQPQRPRRQШW<PPPPԭ֭ѭ < Pʏ?PPd2PPPxP~ < Pʏ?PP*r ԫ4ԫDЪ ԩjZ1J y$xPPPΪPPPjyqЭX=PЬPР[ЬPPQxQʏQQPPk^Ь[KXШV2PxPP@<PPPɽPЭPԠԽը4@f1@f1xШ,YЩ Z2PPPxPP@WxPP<PPP2 QPQ @ @fPPP1խ2PPPxP~ 3ԭ֭ѭ 峏 Q2PPPxP~jI@fԭˏDPP1ը4GfЭPԠ ЭP֠ 4D<Z/ <"~< ~<~yԨ4< PʏPP1nWPЭPР PPPPCKV$Ef1ZѨD%j ˏDP@P PPMf1/ЭPԠ Ԩ4ը4[ѨDOf ԭԨ4ԨDЩ,ԩԩ$Ъ 2PPPPP$Zթ W(( >2M=X2rR >2B8X `7 @7 007qxUup%d: not ready (flakey) up%d: word count != 0 up%d: write locked upcs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPEup%d%c: soft ecc sn%d sc%d<%d>sc%d: lost interrupt upsc@x H PW ]x lr- m f l ^t j x ( t :f Kry y f ( * yl z 18 RY s |  k f cl p(  z   OX ^hr| \ j m   -w 3: V ^ ow u| t    k  f  l  t  ' : B I  R k e f w t l  l   c }     l k #,39BHQZbhow!,19@IR[dmu~,H( x!+3>FOU\cthtnts(z  +4:BL V`PiTr{X`8XX 6 ).8BHKSX]elqy~@|  _hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_cpu_percpu_nexus_cp_time_dk_busy_dk_time_dk_seek_dk_xfer_dk_wds_dk_mspw_tk_nin_tk_nout_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_bdevsw_cdevsw_linesw_swdevt_zdmap_zvmsU_ARGU_QSAV_swapmap_nswapmap_argmap_kernelmap_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_numuba_cmap_ecmap_ncmap_firstfree_maxfree_ecmx_cmhash_up_softc_up_sizes_fj_sizes_upSDIST_upRDIST_upminfo_updinfo_upip_upstd_scdriver_upprobe_upslave_upattach_updgo_uputab_upst_up_offset_rupbuf_upwstart_upseek_upwaitdryL191L197L202_upwatch_timeout_upstrategyL212_disksort_upustart_upstart_iodoneL228L252_printf_ubagoL272_upintrL276_harderr_upecc_ubadone_upreadL330_u_minphys_physio_upwriteL338L344_ubapurge_getmemc_putmemc_upresetL356L372_ubareset_updumpL390_ubainitncmap_firstfree_maxfree_ecmx_cmhash_up_softc_up_sizes_fj_sizes_upSDIST_upRDIST_upminfo_updinfo_upip_upstd_scdriver_upprobe_upslave_upattach_updgo_uputab_upst_up_offset_rupbuf_upwstart_upseek_upwaitdryL191L197L202_upwatch_timeout_upstrategyL212_disksort_upustart_upstart_iodoneL228L252_printf_ubagoL272_upintrL276_harderr_upecc_ubadone_sys/GENERIC/vaxcpu.o 664 0 33 641 2662323311 7374 `(     () <dx \#.9C<M_nexus_cpu_percpu_umaddr780_umaddr750_umaddr7ZZ_nexty750_nexty7ZZupu/hL,hL5x< /,"sys/GENERIC/ioconf.o 664 0 33 11543 2662323342 7412 ????????????P ?`P?h?ph?P???XL???????x?? ?@?H?P?X?`?h?p?x?) L) ) ) 0* |+ * * ,+ 8+ P. X0 `2 h4 p6 x8 : ; = > @ A C D F G I J L M O P R S U V X Z L[ X\ ] 0^ <Z Z ` ,L[ x[ \ \ ] (] Ta `b b c c 0c <\c hc c c  c 8^  '/5@,IS\fnyttt(!*3=GOXblvPX`hpx(($,6@HR\dnx )3=HR[eoy_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_swapmap_nswapmap_argmap_kernelmap_nummba_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_numuba_mbdinit_hpdriver_htdriver_mtdriver_mbsinit_hkint0_Xrkintr0_lpint0_Xlpintr0_tmint0_Xtmintr0_scint0_Xupintr0_udaint0_Xudintr0_dnint0_Xdnintr0_dhint0_Xdhrint0_Xdhxint0_dhint1_Xdhrint1_Xdhxint1_dzint0_Xdzrint0_Xdzxint0_dzint1_Xdzrint1_Xdzxint1_dzint2_Xdzrint2_Xdzxint2_dzint3_Xdzrint3_Xdzxint3_dzint4_Xdzrint4_Xdzxint4_dzint5_Xdzrint5_Xdzxint5_dzint6_Xdzrint6_Xdzxint6_dzint7_Xdzrint7_Xdzxint7_zsint0_Xtsintr0_ubminit_hkdriver_tmdriver_scdriver_udadriver_zsdriver_ubdinit_lpdriver_dndriver_dhdriver_dzdrivernt0_Xrkintr0_lpint0_Xlpintr0_tmint0_Xtmintr0_scint0_Xupintr0_udaint0_Xudintr0_dnint0_Xdnintr0_dhint0_Xdhrint0_Xdhxint0_dhint1_Xdhrint1_Xdhxisys/GENERIC/vers.o 664 0 33 171 2664317367 7063 @ Berkeley VAX/UNIX Version 4.9 Wed Feb 17 15:27:46 PST 1982  _versiont4_Xdzrint4_Xdzxint4_dzint5_Xdzrint5_Xdzxint5_dzint6_Xdzrint6_Xdzxint6_dzint7_Xdzrint7_Xdzxint7_zsint0_Xtsintr0_ubminit_hkdriver_tmdriver_scdriver_udadriver_zsdriver_ubdinit_lpdriver_dndriver_dhdriver_dzdrivernt0_Xrkintr0_lpint0_Xlpintr0_tmint0_Xtmintr0_scint0_Xupint/hL,hL5< /,"sys/GENERIC/version 664 0 33 2 2664317361 7257 9 @ Berkeley VAX/UNIX Version 4.9 Wed Feb 17 15:27:46 PST 1982  _versiont4_Xdzrint4_Xdzxint4_dzint5_Xdzrint5_Xdzxint5_dzint6_Xdzrint6_Xdzxint6_dzint7_Xdzrint7_Xdzxint7_zsint0_Xtsintr0_ubminit_hkdriver_tmdriver_scdriver_udadriver_zsdriver_ubdinit_lpdriver_dndriver_dhdriver_dzdrivernt0_Xrkintr0_lpint0_Xlpintr0_tmint0_Xtmintr0_scint0_Xupint/hL,hL5< /,"sys/GENERIC/swapgeneric.o 664 0 33 5700 2662323407 10424  P@|^||YYiEЩP`|ЩP}~0~7 ~P0P1.:xԭYhd[C 72ki-kPݠ#3ji.jPݠ'5L[kZ,ZjYi2PPPPPxPPxQQP2PPP2PP2PPPPPxPPQQQP2PPP2PP2~PPЩ nЩf ێPP!ێPP[[  [[>[P Ь[*P#AP@ZP +PЬ[ PZZPPP Д[[ 22 20'0root device? bad/missing unit number use hp%%d, up%%d, ra%%d or hk%%d root on %s0 root on %s0 no suitable root hpuprahk L T "(pwT }T V T W  T 3E 9E A@ G@ Z@ jA pA xD ~D = B Z Z N $O (8P <LQ P  $)28?GOU`,is{ttt(#,5?IQU_hpy!*2;BKT\fny0 _bdevsw_cdevsw_linesw_swdevt_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_nummba_mba_hd_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_numuba_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_genericconf_hpdriver_scdriver_udadriver_hkdriver_setconfL152_printf_gets_mbdinit_ubdinit_getcharL188_cnputcL197esscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_fosys/GENERIC/vers.c 664 0 33 122 2664317362 7036 char version[] = "Berkeley VAX/UNIX Version 4.9 Wed Feb 17 15:27:46 PST 1982\n"; time_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_genericconf_hpdriver_scdriver_udadriver_hkdriver_setconfL152_printf_gets_mbdinit_ubdinit/hL,hL5Ȍ< /,"sys/GENERIC/vmunix 755 0 33 522303 2664317467 7265 k4`3\ U i  @   ((ʏx_ȏT19^^~8~~8?.?X/?^? C>KSP not valid? >CHM? in kernel?D;??~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  k[Jԫ dPPPPڎPZ [ P[ [ ZPڎn[8[ekPPPPPЫ ~2~nPkPPPЫЫo4 ێPPPPZbێPPڮn^NZA;9<PP )RnnZ1m<~<~~h[kЫ [HZ S>ZTzPgPP4.~N2 ~P*1W  1. 18PPPPw1b1X@kiݏ@ڮn^ dEg[(R/YK1k0[PP~ݑЫ $[F1~z~چڮn^1ZvmS 1L)ێPP7P0`~ڮn^"ﺆPP,l"7ﮆؐݏ@ڮn^ rﳐ~1=ێPݏ@ڮn^|oITQZڮn^:1D ,)ێPP܅ݏ@ڮn^111+PPPP? }ڮn^E1;1. d1Ь[ЬZx YQ,թݩ{\2~PYPk[Q8^Ь[2PP@]WЫ,Y2ԫ4qQ#իz[~2~PЩ Z ԩЩ,֫4ЫЭP2PPg;~zZl2g~ЭP2PˏP~_z2~}2PPPxPP@V1|[rPX﷧: Щ,q2 ~ zȏ(21qPPP&P'P*, ȏ(2P ݭZ2~PZj!P"PP 2PPPxPP ? ЪPQxQQQPOЭ$ȏ(2,xPPC֩$2P@]xP2QPA[թЩ,Ы0PYY0ԩЪ 2P,P@7YY ЩЩPZ Z1^ЬP@.[ЫZPP@XŏP@W2~2h~x}2hPP 1q2h~ݬxWݬpxF2PʏdoPP h[PNQQQPPh PȏPPP2QPQ Pȏ PQPPxPPPh2Pʏ?PP@hШYHP 2^24 itrunc ^\ /etc/init$$1>KXfp{real mem = %d sys pt too smallno memoryavail mem = %d usrptWARNING: preposterous time in file systemWARNING: todr too smallWARNING: clock %s %d dayslostgained -- CHECK AND RESET THE DATE! mcr%d: soft ecc addr %x syn %x mcr%d: soft ecc addr %x syn %x mcr%d: soft ecc addr %x syn %x syncing disks... done halting (in tight loop); hit ^P HALT dumping to dev %x, offset %d dump device bad device not ready area improper i/o errorsucceededmachine check %x: %s%s abort fault%s %s cpues %x upc %x va/viba %x dreg %x tber %x %x timo %x parity %x sbier %x pc %x psl %x sbifs %x va %x errpc %x mdr %x smr %x rdtimo %x tbgpar %x cacherr %x buserr %x mcesr %x pc %x psl %x mcsr %x params %x,%x pc %x psl %x mcesr %x mchkcp readctrl str parcp tbuf parcp cache parcp rdtimocp rdsucode lostib tbuf parib rdsib rd timoib cache parctrl str parmemory errorcp cache parwrite bus errcorr dataucode lostbad irdtb parbad retrybad intr idcant write ptemunkn mcr erriib rd errnxm refcp rdsunalgn iorefnonlw iorefbad ioaddrunalgn ubaddriinitbinit0123456789abcdefpanic: %s %s: table is full %s%d%c: hard error sn%d neg q flush rmallocrmalloc swapmap%s: rmap ovflo, lost [%d,%d) bad rmfreeissig psigpsig actioncoresleepwakeupsetrunno procsnewproc vforknewproc i_vfdcntexeceexeca rmallocexitinit diedprocumountpw{}~ւ2lz„nP$}؆rlT~_00ԋܐ|Fp·E&npRpp8h500Cppn̒pppp`lxppp pppppppvpppppppppppppppppppppppppppppppppppppppxfree rssizetextxalloctext rssizelost texttrap type %d, code = %x, pc = %x trapptable faultsyscallvsexpandvmdrum NDMAPvsxallocvsswapvstodbvstodb *ipvmemall sizevmemfreevmemfree vrpagesvmemfree vfdcntmemalldup mem allocbad mem allocmemall ecmapmemall mfindmemall intrans|wantmemfreebad mem freedup mem freemhashmunhashmunhashmunhash mfinddup page unlockvslockpageinpagein pg_filenopagein PG_FTEXTpagein u.u_ofilepagein mfindpagein intrans|wantpagein c_page chgdpagein u.u_ofilepagein u.u_vrpagespagein i_vfdcntpagein pfnumbad c_pagepageout klsizecleanup CSYScleanup centerklustervrelvm rssvrelvm vrpagesexpandvgetptvgetuptexpand Ak@M{@Ķ~@]μ@WARNING: should run interleaved swap with >= 2Mb vbmapswapinswapoutswapout rssizeswapoutswdsptswdspt4 , $  x h X H cpu type %d not configured mba%d at tr%d %d mba'suba%d at tr%d 5 uba'sdr32mcr%d at tr%d 5 mcr'smpmnexus type %x unsupported (at tr %d) not configured %s%d at %s%d slave %d %s%d at mba%d drive %d uba%s%d at uba%d csr %o zero vector didn't interrupt vec %o, ipl %x %s%d at %s%d slave %d %s%d at uba%d csr %o zero vector didn't interrupt vec %o, ipl %x blkdevdup iodoneIO err in pushswap bad ptebig pushhard IO err in swappid %d: killed due to no swap space killed on swap error sorry, pid %d was %sbmbm (*+,R4bmbmbmbm\erXmXmuXmwxytZt[Z\dȰXmbmXmXmXmXmTbmbmgr20 tmbmnZnnbmbmbmbm>~@Xmbmbmbmbmz%%XmXmbm*+22z2 3XmbmXmXmXmXmXmbmbmbmbmuuXmXmbmHnzXmXmbmVKLNOUbmbmXmXmXmXmXmbmbmbmbmnVnXmXmqNxx J   hbmbmXmXm@wx@Xmր5f6Xm6XmXm9t>~Xm XmXmXmXmXmXmbmbmbmXmbmXmXmbmZt[abbXmXmXmXmXmXmXmbmXmXmXmXmXmXmbmXm XmXmXmXmXmXmXmXmXmXmXmbmXXmXmXmXmXmXmXmXmXm̨bm21jbmbmbmXmXmXmXmXmXmXmXmXmXm`ڠB1xbmbmVKLhQQUbmbmbmbmbmPj./ ./( dh%d: silo overflow dh%d: NXM dh%ddhdm /8/`dn&2qv >d`@@6 > >2MPk2rR >%@s?1= a >JT+jRJ2" "#0H2 7/ `70///\0/2 @v0 00=DCLR attn hp%d: write locked hpmbsr=%b er1=%b er2=%bDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBCDVCSSEDPE mr=%o mr2=%o hp%d%c: soft ecc sn%d hp()*,**D-.0L233CORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLAtu%d: not online tu%d: no write ring tu%d: can't change density in mid-tape tu%d: hard error bn%d mbsr=%b er=%b ds=%b tu%d: hard error bn%d er=%b ds=%b httuL553 4 lp%dlp DTBUSYNRCONFCRDCBHUNGPGENEDMCPEATTNSPEDTCMP DTABT DLT WCKUP WCKLWR MXFMBEXCMDPEMAPPEINVMAPERRCONFRDSISTIMORDTIMOmbustart%s%d: not ready mba%d: control bus hung cbhungmbintrmbintrmba: zero upagemba, zero entry @ @AYY\](^_$566RDYPRESONL REW PE BOT EOT FPTAVAILSHRMAINTDSE mu%d: not online mu%d: no write ring mu%d: can't change density in mid-tape mt: wrong unit! mu%d: blank tape mu%d: offline mu%d: no write ring mu%d: hard error bn%d mbsr=%b er=%x ds=%b mt: unit %d random interrupt mu%d: blank tape mu%d: no write ring mu%d: offline mu%d: hard error bn%d er=%o ds=%b mtmu >0'l >+i dd|ddPjl799B/6B(7 00F7 irk%d: not ready (came back!) rk%d: write locked rkcs2=%b ds=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSSVALCDAPIP WRL DDTDRDYVVDROTSPLSACLOOFFDRADCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk%d%c: soft ecc sn%d hk%d<%d>hk%d: lost interrupt rkhkswstrategyargmapswapPtww((w| 9D:G:  @te%d: not online te%d: no write ring te%d: can't change density in mid-tape te%d: hard error bn%d er=%b ILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTURtmintrte%d: lost interrupt tm%d<%d>tetmP$^p҈L:;;  ts%d: not online ts%d: no write ring ts%d: success ts%d: write locked ts%d: offline ts%d: hard error bn%d xs0=%bTMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOT xs1=%bDLT-COR CRS TIG DBF SCK -IPRSYNIPOIEDPOSPOLUNCMTE xs2=%bOPMSIPBPE CAF - WCF - DTP xs3=%bLMXOPIREVCRFDCKNOILXSRIB tsintr ts%d<%d>tszs|`{}~ABCDEFGHIJKLMNOPQRSTUVWXYZddddddd22xxx}}}}ttrstrt: arg was 0! ioccom canq^ ({)}!|^~'`ttyrub  ({)}!|^~'`tu%d: %d soft errors, %d chksum errors, %d hard errors ON tu: no bp! active %d tu pk_mod %d neither data nor end: %o %o TU protocol error, state %d %o %d %d TU receive state error %d %o tuxintr: state %d ON2 OFF NO IE OFF2 new state %d tu: read stalled %X %X %X %X %X %X %X %X  RDTO RDS CRDCXTERCXTMODPPEIVMRMRPFLEBUBSTOUBSSYNTO uba: zero upageuba zero uentryuba%d: reset uba%d: hung uba%d: too many zero vectors uba%d: sbi fault sr=%b cnfgr=%b  PARFLTWSQFLTURDFLTISQFLTMXTFLTXMTFLTuba%d: uba error sr=%b fmer=%x fubar=%o uba crazyERROR LIMIT > >@Lh\?BȭB 7uda: ubinfo %x uda: um_ubinfo == 0 raudasa %o, state %d uda: bring unit %d online udintr: state %d, udasa %o uda%d: random interrupt ignored uda%d: interrupt in unknown state %d ignored uda%d: fatal error (%o) uda: purge bdp %d uda: command ring transition uda: unit %d online raOFFLINE uda: unit %d attention rastatus %o uda: unknown packet uda%d:%d: %s error, softhardcontroller error, event 0%o host memory access error, event 0%o, addr 0%o disk transfer error, unit %d, grp %d, cyl %d, sec %d, trk %d, lbn %d, retry %d, level %d SDI error, unit %d, event 0%o, cyl %d small disk error, unit %d, event 0%o, cyl %d unknown error, unit %d, format 0%o, event 0%o uda%drauda > >2M=X2rR >2BHCDD `7B @7C 007qxUup%d: not ready (flakey) up%d: word count != 0 up%d: write locked upcs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPEup%d%c: soft ecc sn%d sc%d<%d>sc%d: lost interrupt upsc     () DE EE,EBerkeley VAX/UNIX Version 4.9 Wed Feb 17 15:27:46 PST 1982 0?0??0??0??X2??(5??X2X2(5(5(8HXhx (p7?,H $9?  U) U- V5 ,V=!&D\KX_gv^olwv)ESE0tjP8T|d$(".*84^ <HFXPhZN>bDxlvEFGHIJK (  lNpN_tN! VN;2 |W9 W} H VWN ^XW vX` "Xh  Xn dXu &X} X XT X  X v$X w&X (X  ,X .X 0X 4X J8X GX8  =XSN zX X& (XB5 Dt&Dx&p&|&&{  =  -\ \9X  \ &! \* X&; ed&E \&N `&W ?T&+ j N(\t Q8\z <\ @\)  \@ P\ p t x k0 V c/ N.n6d zy$Y.3' `1 `: `D N+3T `_ |Nf kLEn  %T Y f 1 . ol { f vd <n Z% x l` N l% > & " ^' '" r) @x(0 (9 a@ )H KS a\ ad )l q Z+z @. ~ N/ / &0 r< < 0 0 0 1#w a a a a a Ha a N a( a4 5; $D "1M zV V^ Ai ((=:q h5z ~5 06 "7 _ u7 W0  8 ,: pH:  8 x v Ae >  A  @ LA z? ' Jg0 9 A DL S v[ adja Eh ?p Ev jF} \Q ^G tH NK  ZJ K ¬ D  Ea iL 6L M N O eO *P+RP kPQt.I(<07@xIFVNZVS/nV[7 WdXl aqPYz\[,`\wo])_m ]adKerl1lXmbm fmzmlm Fn(Zn1n:n@tnGOtY`wi*q/y Xwu8Dlzz{L<|T{$}}~>ւT2;2r"„(/8?F؆L·QwTY&bk%4t|ԋW~LRql yڎ1 P,ܐb^&n&2̒-4F=XEuNxV-p]'|f^0Co?`vOl}xA9 l|vIKԔq.~P ojR#Z-5f;0DMZT\el|tzȥ6|JM6°l%u % >Xe$%d Tb  b( c0F6`&?3If Q.X_F_gp5y`bTh&l&& TXc Hcph^&h1 c oc @@ nc`* c2 "c: dB dG$'P4'YC(emn#xZL[jmxmGEMHJ Hd<Ft{  (Z*&+/G,;(R4CmOW \ecrkmuwjwx y8-tmZ t[ Z\dLȰO}  #Jh E3ZT;D4L'U^:frow20Id>~@z%%422'z2 3'uuMHtnz :VKLN"RO+U4n<VnE qN*V]_Ngxpx y`J   I@E@Bր5Mf669>i~a  agb_b'z /8gAIhXR*[̨dl2urj!`ڠ Bnx hQGQEp.]|.ޑ |T   (=./h.9+PBjL 5(Te.[#.en^x $0 %4  8 @ Pb ̽D j-J1T~ F`p /K/#d- h5WB  Q I 4  HBB'B.NJ5Y:X?IGsJQ NVZWbVjJoJv5}8K G <NLW MV 5(YHYQ\[#]dJ(^m_w  MءfP5[``b ܡ > 9Z6)(7h7   4l7p7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1 i1?2PP?ݭYЭPРP`Pp4gPPP(Э PP?6.X$2PЭQxPPPY`2 ~2~ЭPݠ2~ЭPݠQYЭPРP`,Y1Y1g2PP ?1N <PP P PݭPխЬPՠЬPPQР12Z2~ݭнP`Pխ ЬPՠխ<~52~iPݠZ1Z[Z4PPP(Щ PZQЩ(RxQQQPaZսЭ PP2PЭQxPPPY`YЭPРP`,Yi1T[PHQPA;PA@ˀ+Q@ˀA@PA@@Ь[2 P PZЬP PYɏYYZ9ڮn^cpu type %d not configured mba%d at tr%d %d mba'suba%d at tr%d 5 uba'sdr32mcr%d at tr%d 5 mcr'smpmnexus type %x unsupported (at tr %d) not configured %s%d at %s%d slave %d %s%d at mba%d drive %d uba%s%d at uba%d csr %o zero vector didn't interrupt vec %o, ipl %x %s%d at %s%d slave %d %s%d at uba%d csr %o zero vector didn't interrupt vec %o, ipl %x X (.l Cm Sn Y[ `o ryp \ ( \ r t \ 18p >\ DKp S3 Y`p fmp s\ \ 3 p 3 3 \ V p V p W V   w 3x ?EW SV \d\ jY pwp }Y Y Z Y W $ ,z 3{ E3 M4 T3 ]4 c3 kr|3 ~ p \ p p 4 9] B] J] v  V h    W , \V k   V 't V p p p V V h 3 aV V V h ] ] ]  p + : V r t V  p   p  p  V " h \ V \ \ \ \ _ ` a b d e f g #,39BHQZbhow!,5?GRY^gmt|,%,t1t7t<(CLU`ipz$ !+54 >GPYbju z  8  P"+09rFKT]bjrz_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_swapmap_nswapmap_argmap_kernelmap_nexus_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_nummba_mba_hd_cp_time_dk_busy_dk_time_dk_seek_dk_xfer_dk_wds_dk_mspw_tk_nin_tk_nout_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_numuba_cpu_percpu_nmcr_mcraddr_cold_nexnum_dkn_mbaintv_Xmba0int_Xmba1int_Xmba2int_Xmba3int_ubaintv_Xua0int_Xua1int_Xua2int_Xua3int_uba_hd_configureL163_probenexus_Sysmap_Sysbase_setconf_memenable_printfL179_Nexmap_nxaccess_badaddr_mbafind_setscbnex_UMEMmap_umem_unifind_ubawatch_timeoutL240_mbaconfig_mbsinitL256_mbdinit_fixctlrmaskL275_ubminit_ubdinitL285_calloc_rminit_UNIvec_catcherL344_scbL348p_lotsfree_minfree_desfree_saferss_forkstat_swptstat_numuba_cpu_percpu_nmcr_mcraddr_cold_nexnum_dkn_mbaintv_Xmba0int_Xmba1int_Xmba2int_Xmba3int_ubaintv_Xua0int_Xua1int_Xua2int_Xua3int_uba_hd_configureL163_probenexus_Sysmap_Sysbase_setconf_memenable_printfL179_Nexmap_nxaccess_badaddr_mbafsys/GENERIC/autoconf.o 644 0 33 16272 2732201347 7753 $ p@ ^>ێPP[QP2kQQPB[TZʏxjȏj:ڮn^[k~  ^Ь[ЫlfZ_P2QPQ1kxPP@Gݭ- Z2P1ի P@2@jyPP*11P1Q1P 1D1P17~z u   l  Z1qk ^XݭZC;5 (" 1K P@, P(PxP@ЭP@x PP@ݭZx1/    1ZmPZ@d^1 19P1uP(1 P 11`P)11UPA!P01q P+115P@1)PCPB1^Ь[4P[4PЬP@.[[Zԭ1ˏ1ѭ ݭ߭PYlg5XZhiR M?@XYhPРP`P.2~2~iPݠ2~hPݠ   XhZ֭[PZP1JЬ[ЬZY1 1iPРXXh1 ZP2hQQP汫?㱫?2~2~2~iPݠ:5D( 2P4P@WWH2PY@ Ы@@@P2QxQQQPD2PiQxPP$PY`   YйP`YPLYi1P[ˏiP `L[ˏkY_ZˏiP `,ZˏjPPY^ԭ4/P@'ݏЭQP0ݏЭPݠ0PPP%P(&ЭPCЭP2ЭPЬЭPЬݏЭQPԭxPxPPPЭQЭRxQQQPa֭ѭ쏀ЭP2(ݬݬ/խЬPPQРЬP`ЬPЏXh112PP?><PP P PݭPխ)ЬPՠ ЬPPQРLXЬPՠ2ZݭнP`Pխխ<~|2~ЭPݠdZSZ[Z/%4P@Э2PЭQxPP PX`Ш PZQШRxQQQPaZսYi1 i1?2PP?ݭYЭPРP`Pp4gPPP(Э PP?6.X$2PЭQxPPPY`2 ~2~ЭPݠ2~ЭPݠQYЭPРP`,Y1Y1g2PP ?1N <PP P PݭPխЬPՠЬPPQР12Z2~ݭнP`Pխ ЬPՠխ<~52~iPݠZ1Z[Z4PPP(Щ PZQЩ(RxQQQPaZսЭ PP2PЭQxPPPY`YЭPРP`,Yi1T[PHQPA;PA@ˀ+Q@ˀA@PA@@Ь[2 P PZЬP PYɏYYZ9ڮn^cpu type %d not configured mba%d at tr%d %d mba'suba%d at tr%d 5 uba'sdr32mcr%d at tr%d 5 mcr'smpmnexus type %x unsupported (at tr %d) not configured %s%d at %s%d slave %d %s%d at mba%d drive %d uba%s%d at uba%d csr %o zero vector didn't interrupt vec %o, ipl %x %s%d at %s%d slave %d %s%d at uba%d csr %o zero vector didn't interrupt vec %o, ipl %x X (.l Cm Sn Y[ `o ryp \ ( \ r t \ 18p >\ DKp S3 Y`p fmp s\ \ 3 p 3 3 \ V ((p V p W V   w 3x ?EW SV \d\ jY pwp }Y Y Z Y W $ ,z 3{ E3 M4 T3 ]4 c3 kr|3 ~ p \ p p 4 9] B] J] v  V h    W , \V k   V 't V p p p V V h 3 aV V V h ] ] ]  p + : V r t V  p   p  p  V " h \ V \ \ \ \ _ ` a b d e f g #,39BHQZbhow!,5?GRY^gmt|,%,t1t7t<(CLU`ipz$ !+54 >GPYbju z  8  P"+09rFKT]bjrz_hz_timezone_dstflag_canonb_version_lbolt_time_bootime_hand_nblkdev_nchrdev_nswdev_mpid_runin_runout_runrun_kmapwnt_curpri_maxmem_physmem_nswap_updlock_rablock_rootdev_dumpdev_dumplo_swapdev_argdev_pipedev_vmmap_umbabeg_umbaend_noproc_panicstr_wantin_boothowto_swapmap_nswapmap_argmap_kernelmap_nexus_buf_buffers_nbuf_swbuf_nswbuf_swsize_swpf_bfreelist_bswlist_bclnlist_nummba_mba_hd_cp_time_dk_busy_dk_time_dk_seek_dk_xfer_dk_wds_dk_mspw_tk_nin_tk_nout_klseql_klsdist_klin_kltxt_klout_cnt_rate_sum_total_freemem_avefree_avefree30_deficit_nscan_multprog_desscan_maxpgio_maxslp_lotsfree_minfree_desfree_saferss_forkstat_swptstat_numuba_cpu_percpu_nmcr_mcraddr_cold_nexnum_dkn_mbaintv_Xmba0int_Xmba1int_Xmba2int_Xmba3int_ubaintv_Xua0int_Xua1int_Xua2int_Xua3int_uba_hd_configureL163_probenexus_Sysmap_Sysbase_setconf_memenable_printfL179_Nexmap_nxaccess_badaddr_mbafind_setscbnex_UMEMmap_umem_unifind_ubawatch_timeoutL240_mbaconfig_mbsinitL256_mbdinit_fixctlrmaskL275_ubminit_ubdinitL285_calloc_rminit_UNIvec_catcherL344_scbL348p_lotsfree_minfree_desfree_saferss_forkstat_swptstat_numuba_cpu_percpu_nmcr_mcraddr_cold_nexnum_dkn_mbaintv_Xmba0int_Xmba1int_Xmba2int_Xmba3int_ubaintv_Xua0int_Xua1int_Xua2int_Xua3int_uba_hd_configureL163_probenexus_Sysmap_Sysbase_setconf_memenable_printfL179_Nexmap_nxaccess_badaddr_mbafsys/sys/ 775 0 33 0 2523003515 5377 sys/sys/locore.s 444 0 33 47067 2664317136 7202 /* locore.s 4.55- 82/02/17 */ #include "../h/mtpr.h" #include "../h/trap.h" #include "../h/psl.h" #include "../h/pte.h" #include "../h/cpu.h" #include "../h/nexus.h" #include "../h/ubareg.h" #include "dz.h" #include "mba.h" .set HIGH,0x1f # mask for total disable .set MCKVEC,4 # offset into scb of machine check vector .set NBPG,512 .set PGSHIFT,9 .set NISP,3 # number of interrupt stack pages /* * User structure is UPAGES at top of user space. */ .globl _u .set _u,0x80000000 - UPAGES*NBPG /* * Restart parameter block * This is filled in in machdep.c in startup(). * It MUST be page aligned. * When auto-restart occurs, we run restart() in machdep.c, which * takes a core-dump and then cold-starts. */ .globl _rpb _rpb: .space 508 erpb: .space 4 .globl _intstack _intstack: .space NISP*NBPG eintstack: /* * Do a dump. * Called by auto-restart. * May be called manually. */ .align 2 .globl _doadump _doadump: nop; nop # .word 0x0101 #define _rpbmap _Sysmap+8 # scb, UNIvec, rpb, istack*4 bicl2 $PG_PROT,_rpbmap bisl2 $PG_KW,_rpbmap tstl _rpb+RP_FLAG # dump only once! bneq 1f incl _rpb+RP_FLAG mtpr $0,$TBIA movl sp,erpb movab erpb,sp mfpr $PCBB,-(sp) mfpr $MAPEN,-(sp) mfpr $IPL,-(sp) mtpr $0,$MAPEN mtpr $HIGH,$IPL pushr $0x3fff calls $0,_dumpsys 1: halt /* * Interrupt vector routines */ .globl _waittime #define SCBVEC(name) .align 2; .globl _X/**/name; _X/**/name #define PANIC(msg) clrl _waittime; pushab 1f; \ calls $1,_panic; 1: .asciz msg #define PRINTF(n,msg) pushab 1f; calls $n+1,_printf; MSG(msg) #define MSG(msg) .data; 1: .asciz msg; .text #define PUSHR pushr $0x3f #define POPR popr $0x3f SCBVEC(machcheck): PUSHR; pushab 6*4(sp); calls $1,_machinecheck; POPR; addl2 (sp)+,sp; rei SCBVEC(kspnotval): PUSHR; PANIC("KSP not valid"); SCBVEC(powfail): halt SCBVEC(chme): SCBVEC(chms): SCBVEC(chmu): PUSHR; PANIC("CHM? in kernel"); SCBVEC(stray): PUSHR; PRINTF(0, "stray scb interrupt\n"); POPR; rei SCBVEC(nexzvec): PUSHR; mfpr $IPL,-(sp); PRINTF(1, "nexus stray intr ipl%x\n"); POPR; rei SCBVEC(cmrd): PUSHR; calls $0,_memerr; POPR; rei SCBVEC(wtime): PUSHR; pushl 6*4(sp); PRINTF(1,"write timeout %x\n"); POPR; PANIC("wtimo"); #if NMBA > 0 SCBVEC(mba3int): PUSHR; pushl $3; brb 1f SCBVEC(mba2int): PUSHR; pushl $2; brb 1f SCBVEC(mba1int): PUSHR; pushl $1; brb 1f SCBVEC(mba0int): PUSHR; pushl $0 1: calls $1,_mbintr POPR incl _cnt+V_INTR rei #endif #if VAX780 /* * Registers for the uba handling code */ #define rUBANUM r0 #define rUBAHD r1 #define rUVEC r3 #define rUBA r4 /* r2,r5 are scratch */ SCBVEC(ua3int): PUSHR; movl $3,rUBANUM; moval _uba_hd+(3*UH_SIZE),rUBAHD; brb 1f SCBVEC(ua2int): PUSHR; movl $2,rUBANUM; moval _uba_hd+(2*UH_SIZE),rUBAHD; brb 1f SCBVEC(ua1int): PUSHR; movl $1,rUBANUM; moval _uba_hd+(1*UH_SIZE),rUBAHD; brb 1f SCBVEC(ua0int): PUSHR; movl $0,rUBANUM; moval _uba_hd+(0*UH_SIZE),rUBAHD; 1: incl _cnt+V_INTR mfpr $IPL,r2 /* r2 = mfpr(IPL); */ movl UH_UBA(rUBAHD),rUBA /* uba = uhp->uh_uba; */ movl UBA_BRRVR-0x14*4(rUBA)[r2],rUVEC /* uvec = uba->uba_brrvr[r2-0x14] */ ubanorm: bleq ubaerror addl2 UH_VEC(rUBAHD),rUVEC /* uvec += uh->uh_vec */ bicl3 $3,(rUVEC),r1 jmp 2(r1) /* 2 skips ``pushr $0x3f'' */ ubaerror: PUSHR; calls $0,_ubaerror; POPR /* ubaerror r/w's r0-r5 */ tstl rUVEC; jneq ubanorm /* rUVEC contains result */ POPR rei #endif SCBVEC(cnrint): PUSHR; calls $0,_cnrint; POPR; incl _cnt+V_INTR; rei SCBVEC(cnxint): PUSHR; calls $0,_cnxint; POPR; incl _cnt+V_INTR; rei SCBVEC(hardclock): PUSHR pushl 4+6*4(sp); pushl 4+6*4(sp); calls $2,_hardclock # hardclock(pc,psl) POPR; incl _cnt+V_INTR ## temp so not to break vmstat -= HZ rei SCBVEC(softclock): PUSHR pushl 4+6*4(sp); pushl 4+6*4(sp); calls $2,_softclock # softclock(pc,psl) POPR; rei #if defined(VAX750) || defined(VAX7ZZ) SCBVEC(consdin): PUSHR; calls $0,_turintr; POPR; incl _cnt+V_INTR; rei SCBVEC(consdout): PUSHR; calls $0,_tuxintr; POPR; incl _cnt+V_INTR; rei #else SCBVEC(consdin): halt SCBVEC(consdout): halt #endif #if NDZ > 0 /* * DZ pseudo dma routine: * r0 - controller number */ .align 1 .globl _dzdma _dzdma: mull2 $8*20,r0 movab _dzpdma(r0),r3 # pdma structure base # for this controller dzploop: movl r3,r0 movl (r0)+,r1 # device register address movzbl 1(r1),r2 # get line number bitb $0x80,r2 # TRDY on? beql dzprei # no bicb2 $0xf8,r2 # clear garbage bits mull2 $20,r2 addl2 r2,r0 # point at line's pdma structure movl (r0)+,r2 # p_mem cmpl r2,(r0)+ # p_mem < p_end ? bgequ dzpcall # no, go call dzxint movb (r2)+,6(r1) # dztbuf = *p_mem++ movl r2,-8(r0) brb dzploop # check for another line dzprei: POPR incl _cnt+V_PDMA rei dzpcall: pushl r3 pushl (r0)+ # push tty address calls $1,*(r0) # call interrupt rtn movl (sp)+,r3 brb dzploop # check for another line #endif /* * Stray UNIBUS interrupt catch routines */ .data .align 2 #define PJ PUSHR;jsb _Xustray .globl _catcher _catcher: PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;((PJ;PJ;PJ;PJ PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ .globl _cold _cold: .long 1 .data .text SCBVEC(ustray): blbc _cold,1f mfpr $IPL,r11 subl3 $_catcher+8,(sp)+,r10 ashl $-1,r10,r10 POPR rei 1: subl3 $_catcher+8,(sp)+,r0 ashl $-1,r0,-(sp) mfpr $IPL,-(sp) PRINTF(2, "uba?: stray intr ipl %x vec %o\n") POPR rei /* * Trap and fault vector routines */ #define TRAP(a) pushl $a; brw alltraps /* * Ast delivery (profiling and/or reschedule) */ SCBVEC(astflt): pushl $0; TRAP(ASTFLT) SCBVEC(privinflt): pushl $0; TRAP(PRIVINFLT) SCBVEC(xfcflt): pushl $0; TRAP(XFCFLT) SCBVEC(resopflt): pushl $0; TRAP(RESOPFLT) SCBVEC(resadflt): pushl $0; TRAP(RESADFLT) SCBVEC(bptflt): pushl $0; TRAP(BPTFLT) SCBVEC(compatflt): TRAP(COMPATFLT); SCBVEC(tracep): pushl $0; TRAP(TRCTRAP) SCBVEC(arithtrap): TRAP(ARITHTRAP) SCBVEC(protflt): blbs (sp)+,segflt TRAP(PROTFLT) segflt: TRAP(SEGFLT) SCBVEC(transflt): bitl $1,(sp)+ bnequ tableflt TRAP(PAGEFLT) tableflt: TRAP(TABLEFLT) alltraps: mfpr $USP,-(sp); calls $0,_trap; mtpr (sp)+,$USP incl _cnt+V_TRAP addl2 $8,sp # pop type, code mtpr $HIGH,$IPL ## dont go to a higher IPL (GROT) rei SCBVEC(syscall): pushl $SYSCALL mfpr $USP,-(sp); calls $0,_syscall; mtpr (sp)+,$USP incl _cnt+V_SYSCALL addl2 $8,sp # pop type, code mtpr $HIGH,$IPL ## dont go to a higher IPL (GROT) rei /* * System page table */ #define vaddr(x) ((((x)-_Sysmap)/4)*NBPG+0x80000000) #define SYSMAP(mname, vname, npte) \ _/**/mname: .globl _/**/mname; \ .space npte*4; \ .globl _/**/vname; \ .set _/**/vname,vaddr(_/**/mname) .data .align 2 SYSMAP(Sysmap ,Sysbase ,SYSPTSIZE ) SYSMAP(UMBAbeg ,umbabeg ,0 ) SYSMAP(Nexmap ,nexus ,16*MAXNNEXUS ) SYSMAP(UMEMmap ,umem ,16*MAXNUBA ) SYSMAP(UMBAend ,umbaend ,0 ) SYSMAP(Usrptmap ,usrpt ,USRPTSIZE ) SYSMAP(Forkmap ,forkutl ,UPAGES ) SYSMAP(Xswapmap ,xswaputl ,UPAGES ) SYSMAP(Xswap2map,xswap2utl ,UPAGES ) SYSMAP(Swapmap ,swaputl ,UPAGES ) SYSMAP(Pushmap ,pushutl ,UPAGES ) SYSMAP(Vfmap ,vfutl ,UPAGES ) SYSMAP(CMAP1 ,CADDR1 ,1 ) SYSMAP(CMAP2 ,CADDR2 ,1 ) SYSMAP(mcrmap ,mcr ,1 ) SYSMAP(mmap ,vmmap ,1 ) SYSMAP(msgbufmap,msgbuf ,CLSIZE ) SYSMAP(camap ,cabase ,16*CLSIZE ) SYSMAP(ecamap ,calimit ,0 ) #ifdef BBNNET SYSMAP(Netmap ,netutl ,NNETPAGES*CLSIZE) #endif eSysmap: .globl _Syssize .set _Syssize,(eSysmap-_Sysmap)/4 .text /* * Initialization * * ipl 0x1f; mapen 0; scbb, pcbb, sbr, slr, isp, ksp not set */ .data .globl _cpu _cpu: .long 0 .text .globl start start: .word 0 /* set system control block base and system page table params */ mtpr $_scb-0x80000000,$SCBB mtpr $_Sysmap-0x80000000,$SBR mtpr $_Syssize,$SLR /* double map the kernel into the virtual user addresses of phys mem */ mtpr $_Sysmap,$P0BR mtpr $_Syssize,$P0LR /* set ISP and get cpu type */ movl $_intstack+NISP*NBPG,sp mfpr $SID,r0 movab _cpu,r1 extzv $24,$8,r0,(r1) /* init RPB */ movab _rpb,r0 movl r0,(r0)+ # rp_selfref movab _doadump,r1 movl r1,(r0)+ # rp_dumprout movl $0x1f,r2 clrl r3 1: addl2 (r1)+,r3; sobgtr r2,1b movl r3,(r0)+ # rp_chksum /* count up memory */ clrl r7 1: pushl $4; pushl r7; calls $2,_badaddr; tstl r0; bneq 9f acbl $8096*1024-1,$64*1024,r7,1b 9: /* clear memory from kernel bss and pages for proc 0 u. and page table */ movab _edata,r6 movab _end,r5 bbcc $31,r5,0f; 0: addl2 $(UPAGES*NBPG)+NBPG+NBPG,r5 1: clrq (r6); acbl r5,$8,r6,1b /* trap() and syscall() save r0-r11 in the entry mask (per ../h/reg.h) */ bisw2 $0x0fff,_trap bisw2 $0x0fff,_syscall calls $0,_fixctlrmask /* initialize system page table: scb and int stack writeable */ clrl r2 movab eintstack,r1; bbcc $31,r1,0f; 0: ashl $-PGSHIFT,r1,r1 1: bisl3 $PG_V|PG_KW,r2,_Sysmap[r2]; aoblss r1,r2,1b /* make rpb read-only as red zone for interrupt stack */ bicl2 $PG_PROT,_rpbmap bisl2 $PG_KR,_rpbmap /* make kernel text space read-only */ movab _etext+NBPG-1,r1; bbcc $31,r1,0f; 0: ashl $-PGSHIFT,r1,r1 1: bisl3 $PG_V|PG_KR,r2,_Sysmap[r2]; aoblss r1,r2,1b /* make kernel data, bss, read-write */ movab _end+NBPG-1,r1; bbcc $31,r1,0f; 0:; ashl $-PGSHIFT,r1,r1 1: bisl3 $PG_V|PG_KW,r2,_Sysmap[r2]; aoblss r1,r2,1b /* now go to mapped mode */ mtpr $1,$TBIA; mtpr $1,$MAPEN; jmp *$0f; 0: /* init mem sizes */ ashl $-PGSHIFT,r7,_maxmem movl _maxmem,_physmem movl _maxmem,_freemem /* setup context for proc[0] == Scheduler */ movab _end+NBPG-1,r6 bicl2 $NBPG-1,r6 # make page boundary /* setup page table for proc[0] */ bbcc $31,r6,0f; 0: ashl $-PGSHIFT,r6,r3 # r3 = btoc(r6) bisl3 $PG_V|PG_KW,r3,_Usrptmap # init first upt entry incl r3 movab _usrpt,r0 mtpr r0,$TBIS /* init p0br, p0lr */ mtpr r0,$P0BR mtpr $0,$P0LR /* init p1br, p1lr */ movab NBPG(r0),r0 movl $0x200000-UPAGES,r1 mtpr r1,$P1LR mnegl r1,r1 moval -4*UPAGES(r0)[r1],r2 mtpr r2,$P1BR /* setup mapping for UPAGES of _u */ movl $UPAGES,r2; movab _u+NBPG*UPAGES,r1; addl2 $UPAGES,r3; jbr 2f 1: decl r3 moval -NBPG(r1),r1; bisl3 $PG_V|PG_URKW,r3,-(r0) mtpr r1,$TBIS 2: sobgeq r2,1b /* initialize (slightly) the pcb */ movab UPAGES*NBPG(r1),PCB_KSP(r1) mnegl $1,PCB_ESP(r1) mnegl $1,PCB_SSP(r1) movl r1,PCB_USP(r1) mfpr $P0BR,PCB_P0BR(r1) mfpr $P0LR,PCB_P0LR(r1) movb $4,PCB_P0LR+3(r1) # disable ast mfpr $P1BR,PCB_P1BR(r1) mfpr $P1LR,PCB_P1LR(r1) movl $CLSIZE,PCB_SZPT(r1) # init u.u_pcb.pcb_szpt movl r11,PCB_R11(r1) movab 1f,PCB_PC(r1) # initial pc clrl PCB_PSL(r1) # mode(k,k), ipl=0 ashl $PGSHIFT,r3,r3 mtpr r3,$PCBB # first pcbb /* set regs, p0br, p0lr, p1br, p1lr, astlvl, ksp and change to kernel mode */ ldpctx rei /* put signal trampoline code in u. area */ 1: movab _u,r0 movc3 $12,sigcode,PCB_SIGC(r0) /* save reboot flags in global _boothowto */ movl r11,_boothowto /* calculate firstaddr, and call main() */ movab _end+NBPG-1,r0; bbcc $31,r0,0f; 0:; ashl $-PGSHIFT,r0,-(sp) addl2 $UPAGES+1,(sp); calls $1,_main /* proc[1] == /etc/init now running here; run icode */ pushl $PSL_CURMOD|PSL_PRVMOD; pushl $0; rei /* signal trampoline code: it is known that this code takes exactly 12 bytes */ /* in ../h/pcb.h and in the movc3 above */ sigcode: calls $3,1(pc) rei .word 0x7f # registers 0-6 (6==sp/compat) callg (ap),*12(ap) ret /* * Primitives */ /* * badaddr(addr, len) * see if access addr with a len type instruction causes a machine check * len is length of access (1=byte, 2=short, 4=long) */ .globl _badaddr _badaddr: .word 0 movl $1,r0 mfpr $IPL,r1 mtpr $HIGH,$IPL movl _scb+MCKVEC,r2 movl 4(ap),r3 movl 8(ap),r4 movab 9f+INTSTK,_scb+MCKVEC bbc $0,r4,1f; tstb (r3) 1: bbc $1,r4,1f; tstw (r3) 1: bbc $2,r4,1f; tstl (r3) 1: clrl r0 # made it w/o machine checks 2: movl r2,_scb+MCKVEC mtpr r1,$IPL ret .align 2 9: casel _cpu,$1,$VAX_MAX 0: .word 8f-0b # 1 is 780 .word 5f-0b # 2 is 750 .word 5f-0b # 3 is 7ZZ 5: #if defined(VAX750) || defined(VAX7ZZ) mtpr $0xf,$MCESR #endif brb 1f 8: #if VAX780 mtpr $0,$SBIFS #endif 1: addl2 (sp)+,sp # discard mchchk trash movab 2b,(sp) rei _addupc: .globl _addupc .word 0x0 movl 8(ap),r2 # &u.u_prof subl3 8(r2),4(ap),r0 # corrected pc blss 9f extzv $1,$31,r0,r0 # logical right shift extzv $1,$31,12(r2),r1 # ditto for scale emul r1,r0,$0,r0 ashq $-14,r0,r0 tstl r1 bneq 9f incl r0 bicl2 $1,r0 cmpl r0,4(r2) # length bgequ 9f addl2 (r2),r0 # base probew $3,$2,(r0) beql 8f addw2 12(ap),(r0) 9: ret 8: clrl 12(r2) ret _Copyin: .globl _Copyin # <<>> movl 12(sp),r0 # copy length blss ersb movl 4(sp),r1 # copy user address cmpl $NBPG,r0 # probing one page or less ? bgeq cishort # yes ciloop: prober $3,$NBPG,(r1) # bytes accessible ? beql ersb # no addl2 $NBPG,r1 # incr user address ptr acbl $NBPG+1,$-NBPG,r0,ciloop # reduce count and loop cishort: prober $3,r0,(r1) # bytes accessible ? beql ersb # no movc3 12(sp),*4(sp),*8(sp) clrl r0 rsb ersb: mnegl $1,r0 rsb _Copyout: .globl _Copyout # <<>> movl 12(sp),r0 # get count blss ersb movl 8(sp),r1 # get user address cmpl $NBPG,r0 # can do in one probew? bgeq coshort # yes coloop: probew $3,$NBPG,(r1) # bytes accessible? beql ersb # no addl2 $NBPG,r1 # increment user address acbl $NBPG+1,$-NBPG,r0,coloop # reduce count and loop coshort: probew $3,r0,(r1) # bytes accessible? beql ersb # no movc3 12(sp),*4(sp),*8(sp) clrl r0 rsb /* * non-local goto's */ .globl _Setjmp _Setjmp: movq r6,(r0)+ movq r8,(r0)+ movq r10,(r0)+ movq r12,(r0)+ addl3 $4,sp,(r0)+ movl (sp),(r0) clrl r0 rsb .globl _Longjmp _Longjmp: movq (r0)+,r6 movq (r0)+,r8 movq (r0)+,r10 movq (r0)+,r12 movl (r0)+,r1 cmpl r1,sp # must be a pop bgequ lj2 pushab lj1 calls $1,_panic lj2: movl r1,sp jmp *(r0) # ``rsb'' lj1: .asciz "longjmp" .globl _whichqs .globl _qs .globl _cnt .globl _noproc .comm _noproc,4 .globl _runrun .comm _runrun,4 /* * The following primitives use the fancy VAX instructions * much like VMS does. _whichqs tells which of the 32 queues _qs * have processes in them. Setrq puts processes into queues, Remrq * removes them from queues. The running process is on no queue, * other processes are on a queue related to p->p_pri, divided by 4 * actually to shrink the 0-127 range of priorities into the 32 available * queues. */ /* * Setrq(p), using fancy VAX instructions. * * Call should be made at spl6(), and p->p_stat should be SRUN */ .globl _Setrq # <<>> _Setrq: tstl P_RLINK(r0) ## firewall: p->p_rlink must be 0 beql set1 ## pushab set3 ## calls $1,_panic ## set1: movzbl P_PRI(r0),r1 # put on queue which is p->p_pri / 4 ashl $-2,r1,r1 movaq _qs[r1],r2 insque (r0),*4(r2) # at end of queue bbss r1,_whichqs,set2 # mark queue non-empty set2: rsb set3: .asciz "setrq" /* * Remrq(p), using fancy VAX instructions * * Call should be made at spl6(). */ .globl _Remrq # <<>> _Remrq: movzbl P_PRI(r0),r1 ashl $-2,r1,r1 bbsc r1,_whichqs,rem1 pushab rem3 # it wasn't recorded to be on its q calls $1,_panic rem1: remque (r0),r2 beql rem2 bbss r1,_whichqs,rem2 rem2: clrl P_RLINK(r0) ## for firewall checking rsb rem3: .asciz "remrq" /* * Masterpaddr is the p->p_addr of the running process on the master * processor. When a multiprocessor system, the slave processors will have * an array of slavepaddr's. */ .globl _masterpaddr .data _masterpaddr: .long 0 .text sw0: .asciz "swtch" /* * Swtch(), using fancy VAX instructions */ .globl _Swtch _Swtch: # <<>> movl $1,_noproc clrl _runrun sw1: ffs $0,$32,_whichqs,r0 # look for non-empty queue bneq sw1a mtpr $0,$IPL # must allow interrupts here brw sw1 # this is an idle loop! sw1a: mtpr $0x18,$IPL # lock out all so _whichqs==_qs bbcc r0,_whichqs,sw1 # proc moved via lbolt interrupt movaq _qs[r0],r1 remque *(r1),r2 # r2 = p = highest pri process bvc sw2 # make sure something was there sw1b: pushab sw0 calls $1,_panic sw2: beql sw3 insv $1,r0,$1,_whichqs # still more procs in this queue sw3: clrl _noproc tstl P_WCHAN(r2) ## firewalls bneq sw1b ## movzbl P_STAT(r2),r3 ## cmpl $SRUN,r3 ## bneq sw1b ## clrl P_RLINK(r2) ## movl *P_ADDR(r2),r0 movl r0,_masterpaddr ashl $PGSHIFT,r0,r0 # r0 = pcbb(p) /* mfpr $PCBB,r1 # resume of current proc is easy * cmpl r0,r1 */ beql res0 incl _cnt+V_SWTCH /* fall into... */ /* * Resume(pf) */ .globl _Resume # <<>> _Resume: mtpr $0x18,$IPL # no interrupts, please movl _CMAP2,_u+PCB_CMAP2 # yech svpctx mtpr r0,$PCBB ldpctx movl _u+PCB_CMAP2,_CMAP2 # yech mtpr $_CADDR2,$TBIS res0: tstl _u+PCB_SSWAP beql res1 movl _u+PCB_SSWAP,r0 clrl _u+PCB_SSWAP movab _Longjmp,(sp) movl $PSL_PRVMOD,4(sp) # ``cheating'' (jfr) res1: rei /* * {fu,su},{byte,word}, all massaged by asm.sed to jsb's */ .globl _Fuword _Fuword: prober $3,$4,(r0) beql fserr movl (r0),r0 rsb fserr: mnegl $1,r0 rsb .globl _Fubyte _Fubyte: prober $3,$1,(r0) beql fserr movzbl (r0),r0 rsb .globl _Suword _Suword: probew $3,$4,(r0) beql fserr movl r1,(r0) clrl r0 rsb .globl _Subyte _Subyte: probew $3,$1,(r0) beql fserr movb r1,(r0) clrl r0 rsb /* * Copy 1 relocation unit (NBPG bytes) * from user virtual address to physical address */ _copyseg: .globl _copyseg .word 0x0 bisl3 $PG_V|PG_KW,8(ap),_CMAP2 mtpr $_CADDR2,$TBIS # invalidate entry for copy movc3 $NBPG,*4(ap),_CADDR2 ret /* * zero out physical memory * specified in relocation units (NBPG bytes) */ _clearseg: .globl _clearseg .word 0x0 bisl3 $PG_V|PG_KW,4(ap),_CMAP1 mtpr $_CADDR1,$TBIS movc5 $0,(sp),$0,$NBPG,_CADDR1 ret /* * Check address. * Given virtual address, byte count, and rw flag * returns 0 on no access. */ _useracc: .globl _useracc .word 0x0 movl 4(ap),r0 # get va movl 8(ap),r1 # count tstl 12(ap) # test for read access ? bneq userar # yes cmpl $NBPG,r1 # can we do it in one probe ? bgeq uaw2 # yes uaw1: probew $3,$NBPG,(r0) beql uaerr # no access addl2 $NBPG,r0 acbl $NBPG+1,$-NBPG,r1,uaw1 uaw2: probew $3,r1,(r0) beql uaerr movl $1,r0 ret userar: cmpl $NBPG,r1 bgeq uar2 uar1: prober $3,$NBPG,(r0) beql uaerr addl2 $NBPG,r0 acbl $NBPG+1,$-NBPG,r1,uar1 uar2: prober $3,r1,(r0) beql uaerr movl $1,r0 ret uaerr: clrl r0 ret /* * kernacc - check for kernel access privileges * * We can't use the probe instruction directly because * it ors together current and previous mode. */ .globl _kernacc _kernacc: .word 0x0 movl 4(ap),r0 # virtual address bbcc $31,r0,kacc1 bbs $30,r0,kacerr mfpr $SBR,r2 # address and length of page table (system) bbss $31,r2,0f; 0: mfpr $SLR,r3 brb kacc2 kacc1: bbsc $30,r0,kacc3 mfpr $P0BR,r2 # user P0 mfpr $P0LR,r3 brb kacc2 kacc3: mfpr $P1BR,r2 # user P1 (stack) mfpr $P1LR,r3 kacc2: addl3 8(ap),r0,r1 # ending virtual address addl2 $NBPG-1,r1 ashl $-PGSHIFT,r0,r0 ashl $-PGSHIFT,r1,r1 bbs $31,4(ap),kacc6 bbc $30,4(ap),kacc6 cmpl r0,r3 # user stack blss kacerr # address too low brb kacc4 kacc6: cmpl r1,r3 # compare last page to P0LR or SLR bgtr kacerr # address too high kacc4: movl (r2)[r0],r3 bbc $31,4(ap),kacc4a bbc $31,r3,kacerr # valid bit is off kacc4a: cmpzv $27,$4,r3,$1 # check protection code bleq kacerr # no access allowed tstb 12(ap) bneq kacc5 # only check read access cmpzv $27,$2,r3,$3 # check low 2 bits of prot code beql kacerr # no write access kacc5: aoblss r1,r0,kacc4 # next page movl $1,r0 # no errors ret kacerr: clrl r0 # error ret o low brb kacc4 kacc6: cmpl r1,r3 # compare last page to P0LR or SLR bgtr kacerr # address too high kacc4: movl (r2)[r0],r3 bbc $31,4(ap),kacc4a bbc $31,r3,kacerr # valid bit is off kacc4a: cmpzv $27,$4,r3,$1 # check protection code bleq kacerr # no access allowed tstb 12(ap) bneq kacc5 # only check read access cmpzv $27,$2,r3,$3 # check low 2 bits of prot code beql kacerr # no write access kacc5: aoblss r1,r0,kacc4 # next page movl sys/sys/machdep.c 664 0 33 40071 2624301760 7260 /* machdep.c 4.40- 81/10/27 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/map.h" #include "../h/reg.h" #include "../h/mtpr.h" #include "../h/clock.h" #include "../h/pte.h" #include "../h/vm.h" #include "../h/proc.h" #include "../h/psl.h" #include "../h/buf.h" #include "../h/ubavar.h" #include "../h/ubareg.h" #include "../h/cons.h" #include "../h/reboot.h" #include "../h/conf.h" #include "../h/mem.h" #include "../h/cpu.h" #include "../h/inode.h" #include "../h/file.h" #include "../h/text.h" #include "../h/clist.h" #include "../h/callout.h" #include "../h/cmap.h" #include #include "../h/rpb.h" int icode[] = { 0x9f19af9f, /* pushab [&"init",0]; pushab */ 0x02dd09af, /* "/etc/init"; pushl $2 */ 0xbc5c5ed0, /* movl sp,ap; chmk */ 0x2ffe110b, /* $exec; brb .; "/ */ 0x2f637465, /* etc/ */ 0x74696e69, /* init" */ 0x00000000, /* \0\0\0"; 0 */ 0x00000014, /* [&"init", */ 0x00000000, /* 0] */ }; int szicode = sizeof(icode); /* * Declare these as initialized data so we can patch them. */ int nbuf = 0; int nswbuf = 0; /* * Machine-dependent startup code */ startup(firstaddr) int firstaddr; { register int unixsize; register unsigned i; register struct pte *pte; register caddr_t v; /* * Initialize error message buffer (at end of core). */ maxmem -= CLSIZE; pte = msgbufmap; for (i = 0; i < CLSIZE; i++) *(int *)pte++ = PG_V | PG_KW | (maxmem + i); mtpr(TBIA, 1); /* * Good {morning,afternoon,evening,night}. */ printf(version); printf("real mem = %d\n", ctob(maxmem)); /* * First determine how many buffers are reasonable. * Current alg is 32 per megabyte, with min of 32. * We allocate 1/2 as many swap buffer headers as file i/o buffers. */ if (nbuf == 0) { nbuf = (32 * physmem) / btoc(1024*1024); if (nbuf < 32) nbuf = 32; } if (nswbuf == 0) { nswbuf = (nbuf / 2) &~ 1; /* force even */ if (nswbuf > 256) nswbuf = 256; /* sanity */ } /* * Allocate space for system data structures. */ v = (caddr_t)(0x80000000 | (firstaddr * NBPG)); #define valloc(name, type, num) \ (name) = (type *)(v); (v) = (caddr_t)((name)+(num)) #define valloclim(name, type, num, lim) \ (name) = (type *)(v); (v) = (caddr_t)((lim) = ((name)+(num))) valloc(buffers, char, BSIZE*nbuf); valloc(buf, struct buf, nbuf); valloc(swbuf, struct buf, nswbuf); valloc(swsize, short, nswbuf); /* note: nswbuf is even */ valloc(swpf, int, nswbuf); valloclim(inode, struct inode, ninode, inodeNINODE); valloclim(file, struct file, nfile, fileNFILE); valloclim(proc, struct proc, nproc, procNPROC); valloclim(text, struct text, ntext, textNTEXT); valloc(cfree, struct cblock, nclist); valloc(callout, struct callout, ncallout); valloc(swapmap, struct map, nswapmap = nproc * 2); valloc(argmap, struct map, ARGMAPSIZE); valloc(kernelmap, struct map, nproc); /* * Now allocate space for core map */ ncmap = (physmem*NBPG - ((int)v &~ 0x80000000)) / (NBPG*CLSIZE + sizeof (struct cmap)); valloclim(cmap, struct cmap, ncmap, ecmap); if ((((int)(ecmap+1))&~0x80000000) > SYSPTSIZE*NBPG) panic("sys pt too small"); /* * Clear allocated space, and make r/w entries * for the space in the kernel map. */ unixsize = btoc((int)(ecmap+1) &~ 0x80000000); if (unixsize >= physmem - 8*UPAGES) panic("no memory"); pte = &Sysmap[firstaddr]; for (i = firstaddr; i < unixsize; i++) { *(int *)(&Sysmap[i]) = PG_V | PG_KW | i; clearseg(i); } mtpr(TBIA, 1); /* * Initialize callouts */ callfree = callout; for (i = 1; i < ncallout; i++) callout[i-1].c_next = &callout[i]; /* * Initialize memory allocator and swap * and user page table maps. * * THE USER PAGE TABLE MAP IS CALLED ``kernelmap'' * WHICH IS A VERY UNDESCRIPTIVE AND INCONSISTENT NAME. */ meminit(unixsize, maxmem); maxmem = freemem; printf("avail mem = %d\n", ctob(maxmem)); rminit(kernelmap, USRPTSIZE, 1, "usrpt", nproc); /* * Configure the system. */ configure(); /* * Clear restart inhibit flags. */ tocons(TXDB_CWSI); tocons(TXDB_CCSI); } /* * set up a physical address * into users virtual address space. */ sysphys() { if(!suser()) return; u.u_error = EINVAL; } /* * Initialze the clock, based on the time base which is, e.g. * from a filesystem. Base provides the time to within six months, * and the time of year clock provides the rest. */ clkinit(base) time_t base; { register unsigned todr = mfpr(TODR); long deltat; int year = YRREF; if (base < 5*SECYR) { printf("WARNING: preposterous time in file sy((stem"); time = 6*SECYR + 186*SECDAY + SECDAY/2; clkset(); goto check; } /* * Have been told that VMS keeps time internally with base TODRZERO. * If this is correct, then this routine and VMS should maintain * the same date, and switching shouldn't be painful. * (Unfortunately, VMS keeps local time, so when you run UNIX * and VMS, VMS runs on GMT...). */ if (todr < TODRZERO) { printf("WARNING: todr too small"); time = base; /* * Believe the time in the file system for lack of * anything better, resetting the TODR. */ clkset(); goto check; } /* * Sneak to within 6 month of the time in the filesystem, * by starting with the time of the year suggested by the TODR, * and advancing through succesive years. Adding the number of * seconds in the current year takes us to the end of the current year * and then around into the next year to the same position. */ for (time = (todr-TODRZERO)/100; time < base-SECYR/2; time += SECYR) { if (LEAPYEAR(year)) time += SECDAY; year++; } /* * See if we gained/lost two or more days; * if so, assume something is amiss. */ deltat = time - base; if (deltat < 0) deltat = -deltat; if (deltat < 2*SECDAY) return; printf("WARNING: clock %s %d days", time < base ? "lost" : "gained", deltat / SECDAY); check: printf(" -- CHECK AND RESET THE DATE!\n"); } /* * Reset the TODR based on the time value; used when the TODR * has a preposterous value and also when the time is reset * by the stime system call. Also called when the TODR goes past * TODRZERO + 100*(SECYEAR+2*SECDAY) (e.g. on Jan 2 just after midnight) * to wrap the TODR around. */ clkset() { int year = YRREF; unsigned secyr; unsigned yrtime = time; /* * Whittle the time down to an offset in the current year, * by subtracting off whole years as long as possible. */ for (;;) { secyr = SECYR; if (LEAPYEAR(year)) secyr += SECDAY; if (yrtime < secyr) break; yrtime -= secyr; year++; } mtpr(TODR, TODRZERO + yrtime*100); } #ifdef PGINPROF /* * Return the difference (in microseconds) * between the current time and a previous * time as represented by the arguments. * If there is a pending clock interrupt * which has not been serviced due to high * ipl, return error code. */ vmtime(otime, olbolt, oicr) register int otime, olbolt, oicr; { if (mfpr(ICCS)&ICCS_INT) return(-1); else return(((time-otime)*60 + lbolt-olbolt)*16667 + mfpr(ICR)-oicr); } #endif /* * Send an interrupt to process * * SHOULD CHANGE THIS TO PASS ONE MORE WORK SO THAT ALL INFORMATION * PROVIDED BY HARDWARE IS AVAILABLE TO THE USER PROCESS. */ sendsig(p, n) int (*p)(); { register int *usp, *regs; regs = u.u_ar0; usp = (int *)regs[SP]; usp -= 5; if ((int)usp <= USRSTACK - ctob(u.u_ssize)) (void) grow((unsigned)usp); ; /* Avoid asm() label botch */ #ifndef lint asm("probew $3,$20,(r11)"); asm("beql bad"); #else if (useracc((caddr_t)usp, 0x20, 1)) goto bad; #endif *usp++ = n; if (n == SIGILL || n == SIGFPE) { *usp++ = u.u_code; u.u_code = 0; } else *usp++ = 0; *usp++ = (int)p; *usp++ = regs[PC]; *usp++ = regs[PS]; regs[SP] = (int)(usp - 5); regs[PS] &= ~(PSL_CM|PSL_FPD); regs[PC] = (int)u.u_pcb.pcb_sigc; return; asm("bad:"); bad: /* * Process has trashed its stack; give it an illegal * instruction to halt it in its tracks. */ u.u_signal[SIGILL] = SIG_DFL; u.u_procp->p_siga0 &= ~(1<<(SIGILL-1)); u.u_procp->p_siga1 &= ~(1<<(SIGILL-1)); psignal(u.u_procp, SIGILL); } dorti() { struct frame frame; register int sp; register int reg, mask; extern int ipcreg[]; (void) copyin((caddr_t)u.u_ar0[FP], (caddr_t)&frame, sizeof (frame)); sp = u.u_ar0[FP] + sizeof (frame); u.u_ar0[PC] = frame.fr_savpc; u.u_ar0[FP] = frame.fr_savfp; u.u_ar0[AP] = frame.fr_savap; mask = frame.fr_mask; for (reg = 0; reg <= 11; reg++) { if (mask&1) { u.u_ar0[ipcreg[reg]] = fuword((caddr_t)sp); sp += 4; } mask >>= 1; } sp += frame.fr_spa; u.u_ar0[PS] = (u.u_ar0[PS] & 0xffff0000) | frame.fr_psw; if (frame.fr_s) sp += 4 + 4 * (fuword((caddr_t)sp) & 0xff); /* phew, now the rei */ u.u_ar0[PC] = fuword((caddr_t)sp); sp += 4; u.u_ar0[PS] = fuword((caddr_t)sp); sp += 4; u.u_ar0[PS] |= PSL_USERSET; u.u_ar0[PS] &= ~PSL_USERCLR; u.u_ar0[SP] = (int)sp; } /* * Memenable enables the memory controlle corrected data reporting. * This runs at regular intervals, turning on the interrupt. * The interrupt is turned off, per memory controller, when error * reporting occurs. Thus we report at most once per memintvl. */ int memintvl = MEMINTVL; memenable() { register struct mcr *mcr; register int m; for (m = 0; m < nmcr; m++) { mcr = mcraddr[m]; switch (cpu) { #if VAX780 case VAX_780: M780_ENA(mcr); break; #endif #if VAX750 case VAX_750: M750_ENA(mcr); break; #endif #if VAX7ZZ case VAX_7ZZ: M7ZZ_ENA(mcr); break; #endif } } if (memintvl > 0) timeout(memenable, (caddr_t)0, memintvl); } /* * Memerr is the interrupt routine for corrected read data * interrupts. It looks to see which memory controllers have * unreported errors, reports them, and disables further * reporting for a time on those controller. */ memerr() { register struct mcr *mcr; register int m; for (m = 0; m < nmcr; m++) { mcr = mcraddr[m]; switch (cpu) { #if VAX780 case VAX_780: if (M780_ERR(mcr)) { printf("mcr%d: soft ecc addr %x syn %x\n", m, M780_ADDR(mcr), M780_SYN(mcr)); M780_INH(mcr); } break; #endif #if VAX750 case VAX_750: if (M750_ERR(mcr)) { printf("mcr%d: soft ecc addr %x syn %x\n", m, M750_ADDR(mcr), M750_SYN(mcr)); M750_INH(mcr); } break; #endif #if VAX7ZZ case VAX_7ZZ: if (M7ZZ_ERR(mcr)) { struct mcr amcr; amcr.mc_reg[0] = mcr->mc_reg[0]; printf("mcr%d: soft ecc addr %x syn %x\n", m, M7ZZ_ADDR(&amcr), M7ZZ_SYN(&amcr)); M7ZZ_INH(mcr); } break; #endif } } } /* * Invalidate single all pte's in a cluster */ tbiscl(v) unsigned v; { register caddr_t addr; /* must be first reg var */ register int i; asm(".set TBIS,58"); addr = ptob(v); for (i = 0; i < CLSIZE; i++) { #ifdef lint mtpr(TBIS, addr); #else asm("mtpr r11,$TBIS"); #endif addr += NBPG; } } int waittime = -1; boot(paniced, arghowto) int paniced, arghowto; { register int howto; /* r11 == how to boot */ register int devtype; /* r10 == major of root dev */ howto = arghowto; if ((howto&RB_NOSYNC)==0 && waittime < 0 && bfreelist[0].b_forw) { waittime = 0; update(); printf("syncing disks... "); while (++waittime <= 5) sleep((caddr_t)&lbolt, PZERO); printf("done\n"); } splx(0x1f); /* extreme priority */ devtype = major(rootdev); if (howto&RB_HALT) { printf("halting (in tight loop); hit\n\t^P\n\tHALT\n\n"); mtpr(IPL, 0x1f); for (;;) ; } else { if (paniced == RB_PANIC) doadump(); tocons(TXDB_BOOT); } #if defined(VAX750) || defined(VAX7ZZ) if (cpu != VAX_780) { asm("movl r11,r5"); } /* boot flags go in r5 */ #endif for (;;) asm("halt"); #ifdef lint printf("howto %d, devtype %d\n", howto, devtype); #endif /*NOTREACHED*/ } tocons(c) { while ((mfpr(TXCS)&TXCS_RDY) == 0) continue; mtpr(TXDB, c); } /* * Doadump comes here after turning off memory management and * getting on the dump stack, either when called above, or by * the auto-restart code. */ dumpsys() { rpb.rp_flag = 1; if ((minor(dumpdev)&07) != 1) return; printf("\ndumping to dev %x, offset %d\n", dumpdev, dumplo); printf("dump "); switch ((*bdevsw[major(dumpdev)].d_dump)(dumpdev)) { case ENXIO: printf("device bad\n"); break; case EFAULT: printf("device not ready\n"); break; case EINVAL: printf("area improper\n"); break; case EIO: printf("i/o error"); break; default: printf("succeeded"); break; } } /* * Machine check error recovery code. * Print out the machine check frame and then give up. */ #if defined(VAX780) char *mc780[] = { "cp read", "ctrl str par", "cp tbuf par", "cp cache par", "cp rdtimo", "cp rds", "ucode lost", 0, 0, 0, "ib tbuf par", 0, "ib rds", "ib rd timo", 0, "ib cache par" }; #endif #if defined(VAX750) char *mc750[] = { 0, "ctrl str par", "memory error", "cp cache par", "write bus err","corr data", "ucode lost", "bad ird", }; #endif #if VAX7ZZ #define NMC7ZZ 12 char *mc7ZZ[] = { "tb par", "bad retry", "bad intr id", "cant write ptem", "unkn mcr err", "iib rd err", "nxm ref", "cp rds", "unalgn ioref", "nonlw ioref", "bad ioaddr", "unalgn ubaddr", }; #endif /* * Frame for each cpu */ struct mc780frame { int mc8_bcnt; /* byte count == 0x28 */ int mc8_summary; /* summary parameter (as above) */ int mc8_cpues; /* cpu error status */ int mc8_upc; /* micro pc */ int mc8_vaviba; /* va/viba register */ int mc8_dreg; /* d register */ int mc8_tber0; /* tbuf error reg 0 */ int mc8_tber1; /* tbuf error reg 1 */ int mc8_timo; /* timeout address divided by 4 */ int mc8_parity; /* parity */ int mc8_sbier; /* sbi error register */ int mc8_pc; /* trapped pc */ int mc8_psl; /* trapped psl */ }; struct mc750frame { int mc5_bcnt; /* byte count == 0x28 */ int mc5_summary; /* summary parameter (as above) */ int mc5_va; /* virtual address register */ int mc5_errpc; /* error pc */ int mc5_mdr; int mc5_svmode; /* saved mode register */ int mc5_rdtimo; /* read lock timeout */ int mc5_tbgpar; /* tb group parity error register */ int mc5_cacherr; /* cache error register */ int mc5_buserr; /* bus error register */ int mc5_mcesr; /* machine check status register */ int mc5_pc; /* trapped pc */ int mc5_psl; /* trapped psl */ }; struct mc7ZZframe { int mc3_bcnt; /* byte count == 0xc */ int mc3_summary; /* summary parameter */ int mc3_parm[2]; /* parameter 1 and 2 */ int mc3_pc; /* trapped pc */ int mc3_psl; /* trapped psl */ }; machinecheck(cmcf) caddr_t cmcf; { register u_int type = ((struct mc780frame *)cmcf)->mc8_summary; printf("machine check %x: ", type); switch (cpu) { #if VAX780 case VAX_780: printf("%s%s\n", mc780[type&0xf], (type&0xf0) ? " abort" : " fault"); break; #endif #if VAX750 case VAX_750: printf("%((s\n", mc750[type&0x7]); break; #endif #if VAX7ZZ case VAX_7ZZ: if (type < NMC7ZZ) printf("%s", mc7ZZ[type]); printf("\n"); break; #endif } switch (cpu) { #if VAX780 case VAX_780: { register struct mc780frame *mcf = (struct mc780frame *)cmcf; register int sbifs; printf("\tcpues %x upc %x va/viba %x dreg %x tber %x %x\n", mcf->mc8_cpues, mcf->mc8_upc, mcf->mc8_vaviba, mcf->mc8_dreg, mcf->mc8_tber0, mcf->mc8_tber1); sbifs = mfpr(SBIFS); printf("\ttimo %x parity %x sbier %x pc %x psl %x sbifs %x\n", mcf->mc8_timo*4, mcf->mc8_parity, mcf->mc8_sbier, mcf->mc8_pc, mcf->mc8_psl, sbifs); /* THE FUNNY BITS IN THE FOLLOWING ARE FROM THE ``BLACK */ /* BOOK AND SHOULD BE PUT IN AN ``sbi.h'' */ mtpr(SBIFS, sbifs &~ 0x2000000); mtpr(SBIER, mfpr(SBIER) | 0x70c0); break; } #endif #if VAX750 case VAX_750: { register struct mc750frame *mcf = (struct mc750frame *)cmcf; printf("\tva %x errpc %x mdr %x smr %x rdtimo %x tbgpar %x cacherr %x\n", mcf->mc5_va, mcf->mc5_errpc, mcf->mc5_mdr, mcf->mc5_svmode, mcf->mc5_rdtimo, mcf->mc5_tbgpar, mcf->mc5_cacherr); printf("\tbuserr %x mcesr %x pc %x psl %x mcsr %x\n", mcf->mc5_buserr, mcf->mc5_mcesr, mcf->mc5_pc, mcf->mc5_psl, mfpr(MCSR)); mtpr(MCESR, 0xf); break; } #endif #if VAX7ZZ case VAX_7ZZ: { register struct mc7ZZframe *mcf = (struct mc7ZZframe *)cmcf; printf("params %x,%x pc %x psl %x mcesr %x\n", mcf->mc3_parm[0], mcf->mc3_parm[1], mcf->mc3_pc, mcf->mc3_psl, mfpr(MCESR)); mtpr(MCESR, 0xf); break; } #endif } panic("mchk"); } imo, mcf->mc5_tbgpar, mcf->mc5_cacherr); printf("\tbuserr %x mcesr %x pc %x psl %x mcsr %x\n", mcf->mc5_buserr, mcf->mc5_mcesr, mcf->mc5_pc, mcf->mc5_psl, mfpr(MCSR)); mtpr(MCESR, 0xf); break; } #endif #if VAX7ZZ case VAX_7ZZ: { register struct mc7ZZframe *mcf = (struct mc7ZZframe *)cmcf; printf("params %x,%x pc %x psl %x mcesr %x\n", mcf->mc3_parm[0], mcf->mc3_parm[1], mcf->mc3_pc, mcf->mc3_psl, mfpr(MCESR)); mtsys/sys/Locore.c 444 0 33 10037 2574131135 7076 /* Locore.c 4.12 81/08/29 */ #include "dz.h" #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/pte.h" #include "../h/vm.h" #include "../h/tty.h" #include "../h/proc.h" #include "../h/buf.h" #include "../h/ubavar.h" #include "../h/ubareg.h" #include "../h/nexus.h" #include "../h/msgbuf.h" /* * Pseudo file for lint to show what is used/defined in locore.s. */ struct scb scb; int (*UNIvec[128])(); struct rpb rpb; int intstack[3*128]; int masterpaddr; /* p_addr of current process on master cpu */ struct user u; doadump() { dumpsys(); } Xmba3int() { } Xmba2int() { } Xmba1int() { } Xmba0int() { } lowinit() { /* * Pseudo-uses of globals. */ lowinit(); intstack[0] = intstack[1]; rpb = rpb; scb = scb; maxmem = physmem = freemem = 0; u = u; fixctlrmask(); main(0); /* * Routines called from interrupt vectors. */ panic("Machine check"); printf("Write timeout"); (*UNIvec[0])(); ubaerror(0, (struct uba_hd *)0, 0, 0, (struct uba_regs *)0); cnrint(0); cnxint(0); consdin(); consdout(); #if NDZ > 0 dzdma(); #endif hardclock((caddr_t)0, 0); softclock((caddr_t)0, 0); trap(0, 0, (unsigned)0, 0, 0); syscall(0, 0, (unsigned)0, 0, 0); if (vmemall((struct pte *)0, 0, (struct proc *)0, 0)) return; /* use value */ if (forceclose((dev_t)0)) return; /* use value */ machinecheck((caddr_t)0); memerr(); boothowto = 0; } consdin() { } consdout() { } #if NDZ > 0 dzdma() { dzxint((struct tty *)0); } #endif int catcher[256]; int cold = 1; Xustray() { } struct pte Sysmap[6*NPTEPG]; char Sysbase[6*NPTEPG*NBPG]; int umbabeg; struct pte Nexmap[16][16]; struct nexus nexus[MAXNNEXUS]; struct pte UMEMmap[4][16]; char umem[4][16*NBPG]; int umbaend; struct pte Usrptmap[USRPTSIZE]; struct pte usrpt[USRPTSIZE*NPTEPG]; struct pte Forkmap[UPAGES]; struct user forkutl; struct pte Xswapmap[UPAGES]; struct user xswaputl; struct pte Xswap2map[UPAGES]; struct user xswap2utl; struct pte Swapmap[UPAGES]; struct user swaputl; struct pte Pushmap[UPAGES]; struct user pushutl; struct pte Vfmap[UPAGES]; struct user vfutl; struct pte CMAP1; char CADDR1[NBPG]; struct pte CMAP2; char CADDR2[NBPG]; struct pte mmap[1]; char vmmap[NBPG]; struct pte msgbufmap[CLSIZE]; struct msgbuf msgbuf; struct pte camap[32]; int cabase; #ifdef unneeded char caspace[32*NBPG]; #endif int calimit; /*ARGSUSED*/ badaddr(addr, len) caddr_t addr; int len; { return (0); } /*ARGSUSED*/ addupc(pc, prof, n) int pc; struct uprof *prof; { } /*ARGSUSED*/ copyin(udaddr, kaddr, n) caddr_t udaddr, kaddr; unsigned n; { return (0); } /*ARGSUSED*/ copyout(kaddr, udaddr, n) caddr_t kaddr, udaddr; unsigned n; { return (0); } /*ARGSUSED*/ setjmp(lp) label_t lp; { return (0); } /*ARGSUSED*/ longjmp(lp) label_t lp; { /*NOTREACHED*/ } /*ARGSUSED*/ setrq(p) struct proc *p; { } /*ARGSUSED*/ remrq(p) struct proc *p; { } swtch() { if (whichqs) whichqs = 0; } /*ARGSUSED*/ resume(pcbpf) unsigned pcbpf; { } /*ARGSUSED*/ fubyte(base) caddr_t base; { return (0); } /*ARGSUSED*/ subyte(base, i) caddr_t base; { return (0); } /*ARGSUSED*/ suibyte(base, i) caddr_t base; { return (0); } /*ARGSUSED*/ fuword(base) caddr_t base; { return (0); } /*ARGSUSED*/ fuiword(base) caddr_t base; { return (0); } /*ARGSUSED*/ suword(base, i) caddr_t base; { return (0); } /*ARGSUSED*/ suiword(base, i) caddr_t base; { return (0); } /*ARGSUSED*/ copyseg(udaddr, pf) caddr_t udaddr; unsigned pf; { CMAP1 = CMAP1; CADDR1[0] = CADDR1[0]; } /*ARGSUSED*/ clearseg(pf) unsigned pf; { CMAP2 = CMAP2; CADDR2[0] = CADDR2[0]; } /*ARGSUSED*/ useracc(udaddr, bcnt, rw) caddr_t udaddr; unsigned bcnt; { return (0); } /*ARGSUSED*/ kernacc(addr, bcnt, rw) caddr_t addr; unsigned bcnt; { return (0); } /*VARARGS1*/ /*ARGSUSED*/ mtpr(reg, value) int reg, value; { } /*ARGSUSED*/ mfpr(reg) int reg; { return (0); } spl0() { return (0); } spl4() { return (0); } spl5() { return (0); } spl6() { return (0); } spl7() { return (0); } /*ARGSUSED*/ splx(s) int s; { } /*ARGSUSED*/ bcopy(from, to, count) caddr_t from, to; unsigned count; { ; } /*ARGSUSED*/ ffs(i) { return (0); } rw) caddr_t udaddr; unsigned bcnt; { return (0); } /*ARGSUSED*/ kernacc(addr, bcnt, rw) caddr_t addr; unsigned bcnt; { return (0); } /*VARARGS1*/ /*ARGSUSED*/ mtpr(reg, value) int reg, value; { } /*ARGSUSED*/ mfpr(reg) int reg; { return (0); } spl0() { return (0); } spl4() { return (0); } spl5() { return (0); } spl6() { return (0); } spl7() { return (0); } /*ARGSUSED*/ splx(s) int s; { } /*ARGSUSED*/ bcopy(from, to, count) caddr_t from, to; unsigned count; { ; } /*ARGsys/sys/acct.c 444 0 33 3744 2503321153 6545 /* acct.c 4.4 81/03/08 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/acct.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/inode.h" #include "../h/proc.h" #include "../h/seg.h" struct inode *acctp; /* * Perform process accounting functions. */ sysacct() { register struct inode *ip; register struct a { char *fname; } *uap; uap = (struct a *)u.u_ap; if (suser()) { if (uap->fname==NULL) { if (ip = acctp) { plock(ip); iput(ip); acctp = NULL; } return; } if (acctp) { u.u_error = EBUSY; return; } ip = namei(uchar, 0); if(ip == NULL) return; if((ip->i_mode & IFMT) != IFREG) { u.u_error = EACCES; iput(ip); return; } acctp = ip; prele(ip); } } struct acct acctbuf; /* * On exit, write a record on the accounting file. */ acct() { register i; register struct inode *ip; off_t siz; register struct acct *ap = &acctbuf; if ((ip=acctp)==NULL) return; plock(ip); for (i=0; iac_comm); i++) ap->ac_comm[i] = u.u_comm[i]; ap->ac_utime = compress((long)u.u_vm.vm_utime); ap->ac_stime = compress((long)u.u_vm.vm_stime); ap->ac_etime = compress((long)(time - u.u_start)); ap->ac_btime = u.u_start; ap->ac_uid = u.u_ruid; ap->ac_gid = u.u_rgid; ap->ac_mem = 0; if (i = u.u_vm.vm_utime + u.u_vm.vm_stime) ap->ac_mem = (u.u_vm.vm_ixrss + u.u_vm.vm_idsrss) / i; ap->ac_io = compress((long)(u.u_vm.vm_inblk + u.u_vm.vm_oublk)); ap->ac_tty = u.u_ttyd; ap->ac_flag = u.u_acflag; siz = ip->i_size; u.u_offset = siz; u.u_base = (caddr_t)ap; u.u_count = sizeof(acctbuf); u.u_segflg = 1; u.u_error = 0; writei(ip); if(u.u_error) ip->i_size = siz; prele(ip); } /* * Produce a pseudo-floating point representation * with 3 bits base-8 exponent, 13 bits fraction. */ compress(t) register long t; { register exp = 0, round = 0; while (t >= 8192) { exp++; round = t&04; t >>= 3; } if (round) { t++; if (t >= 8192) { t >>= 3; exp++; } } return((exp<<13) + t); } siz = ip->i_size; u.u_offsesys/sys/alloc.c 444 0 33 21405 2503321156 6742 ((/* alloc.c 4.8 81/03/08 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/mount.h" #include "../h/filsys.h" #include "../h/fblk.h" #include "../h/conf.h" #include "../h/buf.h" #include "../h/inode.h" #include "../h/ino.h" #include "../h/dir.h" #include "../h/user.h" typedef struct fblk *FBLKP; /* * alloc will obtain the next available * free disk block from the free list of * the specified device. * The super block has up to NICFREE remembered * free blocks; the last of these is read to * obtain NICFREE more . . . */ struct buf * alloc(dev) dev_t dev; { daddr_t bno; register struct filsys *fp; register struct buf *bp; register int i; fp = getfs(dev); while (fp->s_flock) sleep((caddr_t)&fp->s_flock, PINOD); do { if (fp->s_nfree <= 0) goto nospace; if (fp->s_nfree > NICFREE) { fserr(fp, "bad free count"); goto nospace; } bno = fp->s_free[--fp->s_nfree]; if (bno == 0) goto nospace; } while (badblock(fp, bno)); if (fp->s_nfree <= 0) { fp->s_flock++; bp = bread(dev, bno); if ((bp->b_flags&B_ERROR) == 0) { fp->s_nfree = ((FBLKP)(bp->b_un.b_addr))->df_nfree; bcopy((caddr_t)((FBLKP)(bp->b_un.b_addr))->df_free, (caddr_t)fp->s_free, sizeof(fp->s_free)); } brelse(bp); fp->s_flock = 0; wakeup((caddr_t)&fp->s_flock); if (fp->s_nfree <= 0) goto nospace; } bp = getblk(dev, bno); clrbuf(bp); fp->s_fmod = 1; fp->s_tfree--; return (bp); nospace: fp->s_nfree = 0; fp->s_tfree = 0; fserr(fp, "file system full"); /* THIS IS A KLUDGE... */ /* SHOULD RATHER SEND A SIGNAL AND SUSPEND THE PROCESS IN A */ /* STATE FROM WHICH THE SYSTEM CALL WILL RESTART */ uprintf("\n%s: write failed, file system is full\n", fp->s_fsmnt); for (i = 0; i < 5; i++) sleep((caddr_t)&lbolt, PRIBIO); /* END KLUDGE */ u.u_error = ENOSPC; return (NULL); } /* * place the specified disk block * back on the free list of the * specified device. */ free(dev, bno) dev_t dev; daddr_t bno; { register struct filsys *fp; register struct buf *bp; fp = getfs(dev); fp->s_fmod = 1; while (fp->s_flock) sleep((caddr_t)&fp->s_flock, PINOD); if (badblock(fp, bno)) return; if (fp->s_nfree <= 0) { fp->s_nfree = 1; fp->s_free[0] = 0; } if (fp->s_nfree >= NICFREE) { fp->s_flock++; bp = getblk(dev, bno); ((FBLKP)(bp->b_un.b_addr))->df_nfree = fp->s_nfree; bcopy((caddr_t)fp->s_free, (caddr_t)((FBLKP)(bp->b_un.b_addr))->df_free, sizeof(fp->s_free)); fp->s_nfree = 0; bwrite(bp); fp->s_flock = 0; wakeup((caddr_t)&fp->s_flock); } fp->s_free[fp->s_nfree++] = bno; fp->s_tfree++; fp->s_fmod = 1; } /* * Check that a block number is in the * range between the I list and the size * of the device. * This is used mainly to check that a * garbage file system has not been mounted. */ badblock(fp, bn) register struct filsys *fp; daddr_t bn; { if (bn < fp->s_isize || bn >= fp->s_fsize) { fserr(fp, "bad block"); return(1); } return(0); } /* * Allocate an unused inode on the specified device. * Used with file creation. The algorithm keeps up to * NICINOD spare inodes in the super block. When this runs out, * the inodes are searched to pick up more. We keep searching * foreward on the device, remembering the number of inodes * which are freed behind our search point for which there is no * room in the in-core table. When this number passes a threshold * (or if we search to the end of the ilist without finding any inodes) * we restart the search from the beginning. */ struct inode * ialloc(dev) dev_t dev; { register struct filsys *fp; register struct buf *bp; register struct inode *ip; int i; struct dinode *dp; ino_t ino, inobas; int first; daddr_t adr; fp = getfs(dev); while (fp->s_ilock) sleep((caddr_t)&fp->s_ilock, PINOD); loop: if (fp->s_ninode > 0) { ino = fp->s_inode[--fp->s_ninode]; ip = iget(dev, ino); if (ip == NULL) return(NULL); if (ip->i_mode == 0) { for (i=0; ii_un.i_addr[i] = 0; fp->s_fmod = 1; fp->s_tinode--; return(ip); } /* * Inode was allocated after all. * Look some more. */ iput(ip); goto loop; } fp->s_ilock++; /* * If less than 4*NICINOD inodes are known * to be free behind the current search point, * then search forward; else search from beginning. */ if (fp->s_nbehind < 4 * NICINOD) { first = 1; ino = fp->s_lasti; if (itoo(ino)) panic("ialloc"); adr = itod(ino); } else { fromtop: first = 0; ino = 1; adr = SUPERB+1; fp->s_nbehind = 0; } /* * This is the search for free inodes. */ for(; adr < fp->s_isize; adr++) { inobas = ino; bp = bread(dev, adr); if ((bp->b_flags&B_CACHE) == 0) u.u_vm.vm_inblk--; /* no charge! */ if (bp->b_flags & B_ERROR) { brelse(bp); ino += INOPB; continue; } dp = bp->b_un.b_dino; for (i=0; idi_mode != 0 || ifind(dev, ino)) goto cont; fp->s_inode[fp->s_ninode++] = ino; if (fp->s_ninode >= NICINOD) break; cont: ino++; dp++; } brelse(bp); if (fp->s_ninode >= NICINOD) break; } /* * If the search didn't net a full superblock of inodes, * then try it again from the beginning of the ilist. */ if (fp->s_ninode < NICINOD && first) goto fromtop; fp->s_lasti = inobas; fp->s_ilock = 0; wakeup((caddr_t)&fp->s_ilock); if (fp->s_ninode > 0) goto loop; fserr(fp, "out of inodes"); uprintf("\n%s: create failed, no inodes free\n", fp->s_fsmnt); u.u_error = ENOSPC; return (NULL); } /* * Free the specified inode on the specified device. * The algorithm stores up to NICINOD inodes in the super * block and throws away any more. It keeps track of the * number of inodes thrown away which preceded the current * search point in the file system. This lets us rescan * for more inodes from the beginning only when there * are a reasonable number of inodes back there to reallocate. */ ifree(dev, ino) dev_t dev; ino_t ino; { register struct filsys *fp; fp = getfs(dev); fp->s_tinode++; if (fp->s_ilock) return; if (fp->s_ninode >= NICINOD) { if (fp->s_lasti > ino) fp->s_nbehind++; return; } fp->s_inode[fp->s_ninode++] = ino; fp->s_fmod = 1; } /* * getfs maps a device number into * a pointer to the incore super * block. The algorithm is a linear * search through the mount table. * A consistency check of the * in core free-block and i-node * counts is performed. * * panic: no fs -- the device is not mounted. * this "cannot happen" */ struct filsys * getfs(dev) dev_t dev; { register struct mount *mp; register struct filsys *fp; for (mp = &mount[0]; mp < &mount[NMOUNT]; mp++) if (mp->m_bufp != NULL && mp->m_dev == dev) { fp = mp->m_bufp->b_un.b_filsys; if (fp->s_nfree > NICFREE || fp->s_ninode > NICINOD) { fserr(fp, "bad count"); fp->s_nfree = 0; fp->s_ninode = 0; } return(fp); } panic("no fs"); return (NULL); } /* * Fserr prints the name of a file system * with an error diagnostic, in the form * filsys: error message */ fserr(fp, cp) struct filsys *fp; char *cp; { printf("%s: %s\n", fp->s_fsmnt, cp); } /* * Getfsx returns the index in the file system * table of the specified device. The swap device * is also assigned a pseudo-index. The index may * be used as a compressed indication of the location * of a block, recording * * rather than * * provided the information need remain valid only * as long as the file system is mounted. */ getfsx(dev) dev_t dev; { register struct mount *mp; if (dev == swapdev) return (MSWAPX); for(mp = &mount[0]; mp < &mount[NMOUNT]; mp++) if (mp->m_dev == dev) return (mp - &mount[0]); return (-1); } /* * Update is the internal name of 'sync'. It goes through the disk * queues to initiate sandbagged IO; goes through the inodes to write * modified nodes; and it goes through the mount table to initiate modified * super blocks. */ update() { register struct inode *ip; register struct mount *mp; register struct buf *bp; struct filsys *fp; if (updlock) return; updlock++; /* * Write back modified superblocks. * Consistency check that the superblock * of each file system is still in the buffer cache. */ for (mp = &mount[0]; mp < &mount[NMOUNT]; mp++) if (mp->m_bufp != NULL) { fp = mp->m_bufp->b_un.b_filsys; if (fp->s_fmod==0 || fp->s_ilock!=0 || fp->s_flock!=0 || fp->s_ronly!=0) continue; bp = getblk(mp->m_dev, SUPERB); fp->s_fmod = 0; fp->s_time = time; if (bp->b_un.b_filsys != fp) panic("update"); bwrite(bp); } /* * Write back each (modified) inode. */ for (ip = inode; ip < inodeNINODE; ip++) if((ip->i_flag&ILOCK)==0 && ip->i_count) { ip->i_flag |= ILOCK; ip->i_count++; iupdat(ip, &time, &time, 0); iput(ip); } updlock = 0; /* * Force stale buffer cache information to be flushed, * for all devices. */ bflush(NODEV); } ly!=0) continue; bp = getblk(mp->m_dev, SUPERB); fp->s_fmod = 0; fp->s_time = time; if (bp->b_un.b_filsys != fp) panic("update"); bwrite(bp); } /* * Write back each (modified) inode. */ for (ip = inode; ip < inodeNINODE;sys/sys/asm.sed 444 0 33 3035 2516564177 6760 s,81/04/15 4.9 asm.sed,81/04/15 4.9 asm.sed, s/calls $0,_spl0/mfpr $18,r0\ mtpr $0,$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,_bcopy/movc3 8(sp),*(sp),*4(sp)\ addl2 $12,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,_setjmp/movl (sp)+,r0 \ jsb _Setjmp/ s/calls $1,_longjmp/movl (sp)+,r0 \ jsb _Longjmp/ s/calls $1,_ffs/ffs $0,$32,(sp)+,r0 \ bneq 1f \ mnegl $1,r0 \ 1: \ incl r0/ s $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,_setjmp/movl (sp)+,r0 \ jsb _Setjmp/ s/calls $1,_longjmp/movl (sp)+,r0 \ jsb _Longjmp/ s/calls $1,_ffs/ffs $0,$32,(sp)+,r0 \ bneq 1f \ sys/sys/calloc.c 444 0 33 1741 2522772350 7075 /* calloc.c 4.2 81/04/28 */ #include "../h/param.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/vm.h" #include "../h/pte.h" #include "../h/cmap.h" extern cabase, calimit; extern struct pte camap[]; caddr_t cacur = (caddr_t)&cabase; caddr_t camax = (caddr_t)&cabase; int cax = 0; /* * This is a kernel-mode storage allocator. * It is very primitive, currently, in that * there is no way to give space back. * It serves, for the time being, the needs of * auto-configuration code and the like which * need to allocate some stuff at boot time. */ caddr_t calloc(size) int size; { register caddr_t res; register int i; if (cacur+size >= (caddr_t)&calimit) panic("calloc"); while (cacur+size > camax) { (void) vmemall(&camap[cax], CLSIZE, &proc[0], CSYS); vmaccess(&camap[cax], camax, CLSIZE); for (i = 0; i < CLSIZE; i++) clearseg(camap[cax++].pg_pfnum); camax += NBPG * CLSIZE; } res = cacur; cacur += size; return (res); } ng, the needs of * auto-configsys/sys/clock.c 444 0 33 24774 2574131256 6767 /* clock.c 4.25 81/08/31 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dk.h" #include "../h/callout.h" #include "../h/seg.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/reg.h" #include "../h/psl.h" #include "../h/vm.h" #include "../h/buf.h" #include "../h/text.h" #include "../h/vlimit.h" #include "../h/mtpr.h" #include "../h/clock.h" #include "../h/cpu.h" #include "bk.h" #include "dh.h" #include "dz.h" /* * Hardclock is called straight from * the real time clock interrupt. * We limit the work we do at real clock interrupt time to: * reloading clock * decrementing time to callouts * recording cpu time usage * modifying priority of current process * arrange for soft clock interrupt * kernel pc profiling * * At software (softclock) interrupt time we: * implement callouts * maintain date * lightning bolt wakeup (every second) * alarm clock signals * jab the scheduler * * On the vax softclock interrupts are implemented by * software interrupts. Note that we may have multiple softclock * interrupts compressed into one (due to excessive interrupt load), * but that hardclock interrupts should never be lost. */ /*ARGSUSED*/ hardclock(pc, ps) caddr_t pc; { register struct callout *p1; register struct proc *pp; register int s, cpstate; /* * reprime clock */ clkreld(); /* * update callout times */ for (p1 = calltodo.c_next; p1 && p1->c_time <= 0; p1 = p1->c_next) ; if (p1) p1->c_time--; /* * Maintain iostat and per-process cpu statistics */ if (!noproc) { s = u.u_procp->p_rssize; u.u_vm.vm_idsrss += s; if (u.u_procp->p_textp) { register int xrss = u.u_procp->p_textp->x_rssize; s += xrss; u.u_vm.vm_ixrss += xrss; } if (s > u.u_vm.vm_maxrss) u.u_vm.vm_maxrss = s; if ((u.u_vm.vm_utime+u.u_vm.vm_stime+1)/hz > u.u_limit[LIM_CPU]) { psignal(u.u_procp, SIGXCPU); if (u.u_limit[LIM_CPU] < INFINITY - 5) u.u_limit[LIM_CPU] += 5; } } /* * Update iostat information. */ if (USERMODE(ps)) { u.u_vm.vm_utime++; if(u.u_procp->p_nice > NZERO) cpstate = CP_NICE; else cpstate = CP_USER; } else { cpstate = CP_SYS; if (noproc) cpstate = CP_IDLE; else u.u_vm.vm_stime++; } cp_time[cpstate]++; for (s = 0; s < DK_NDRIVE; s++) if (dk_busy&(1<p_cpticks++; if(++pp->p_cpu == 0) pp->p_cpu--; if(pp->p_cpu % 4 == 0) { (void) setpri(pp); if (pp->p_pri >= PUSER) pp->p_pri = pp->p_usrpri; } } /* * Time moves on. */ ++lbolt; #if VAX780 /* * On 780's, impelement a fast UBA watcher, * to make sure uba's don't get stuck. */ if (cpu == VAX_780 && panicstr == 0 && !BASEPRI(ps)) unhang(); #endif /* * Schedule a software interrupt for the rest * of clock activities. */ setsoftclock(); } /* * The digital decay cpu usage priority assignment is scaled to run in * time as expanded by the 1 minute load average. Each second we * multiply the the previous cpu usage estimate by * nrscale*avenrun[0] * The following relates the load average to the period over which * cpu usage is 90% forgotten: * loadav 1 5 seconds * loadav 5 24 seconds * loadav 10 47 seconds * loadav 20 93 seconds * This is a great improvement on the previous algorithm which * decayed the priorities by a constant, and decayed away all knowledge * of previous activity in about 20 seconds. Under heavy load, * the previous algorithm degenerated to round-robin with poor response * time when there was a high load average. */ #undef ave #define ave(a,b) ((int)(((int)(a*b))/(b+1))) int nrscale = 2; double avenrun[]; /* * Constant for decay filter for cpu usage field * in process table (used by ps au). */ double ccpu = 0.95122942450071400909; /* exp(-1/20) */ /* * Software clock interrupt. * This routine runs at lower priority than device interrupts. */ /*ARGSUSED*/ softclock(pc, ps) caddr_t pc; { register struct callout *p1; register struct proc *pp; register int a, s; caddr_t arg; int (*func)(); /* * Perform callouts (but not after panic's!) */ if (panicstr == 0) { for (;;) { s = spl7(); if ((p1 = calltodo.c_next) == 0 || p1->c_time > 0) { splx(s); break; } calltodo.c_next = p1->c_next; arg = p1->c_arg; func = p1->c_func; p1->c_next = callfree; callfree = p1; (void) splx(s); (*func)(arg); } } /* * Drain silos. */ #if NDH > 0 s = spl5(); dhtimer(); splx(s); #endif #if NDZ > 0 s = spl5(); dztimer(); splx(s); #endif /* * If idling and processes are waiting to swap in, * check on them. */ if (noproc && runin) { runin = 0; wakeup((caddr_t)&runin); } /* * Run paging daemon every 1/4 sec. */ if (lbolt % (hz/4) == 0) { vmpago(); } /* * Reschedule every 1/10 sec. */ if (lbolt % (hz/10) == 0) { runrun++; aston(); } /* * Lightning bolt every second: * sleep timeouts * process priority recomputation * process %cpu averaging * virtual memory metering * kick swapper if processes want in */ if (lbolt >= hz) { /* * This doesn't mean much on VAX since we run at * software interrupt time... if hardclock() * calls softclock() directly, it prevents * this code from running when the priority * was raised when the clock interrupt occurred. */ if (BASEPRI(ps)) return; /* * If we didn't run a few times because of * long blockage at high ipl, we don't * really want to run this code several times, * so squish out all multiples of hz here. */ time += lbolt / hz; lbolt %= hz; /* * Wakeup lightning bolt sleepers. * Processes sleep on lbolt to wait * for short amounts of time (e.g. 1 second). */ wakeup((caddr_t)&lbolt); /* * Recompute process priority and process * sleep() system calls as well as internal * sleeps with timeouts (tsleep() kernel routine). */ for (pp = proc; pp < procNPROC; pp++) if (pp->p_stat && pp->p_stat!=SZOMB) { /* * Increase resident time, to max of 127 seconds * (it is kept in a character.) For * loaded processes this is time in core; for * swapped processes, this is time on drum. */ if (pp->p_time != 127) pp->p_time++; /* * If process has clock counting down, and it * expires, set it running (if this is a tsleep()), * or give it an SIGALRM (if the user process * is using alarm signals. */ if (pp->p_clktim && --pp->p_clktim == 0) if (pp->p_flag & STIMO) { s = spl6(); switch (pp->p_stat) { case SSLEEP: (( setrun(pp); break; case SSTOP: unsleep(pp); break; } pp->p_flag &= ~STIMO; splx(s); } else psignal(pp, SIGALRM); /* * If process is blocked, increment computed * time blocked. This is used in swap scheduling. */ if (pp->p_stat==SSLEEP || pp->p_stat==SSTOP) if (pp->p_slptime != 127) pp->p_slptime++; /* * Update digital filter estimation of process * cpu utilization for loaded processes. */ if (pp->p_flag&SLOAD) pp->p_pctcpu = ccpu * pp->p_pctcpu + (1.0 - ccpu) * (pp->p_cpticks/(float)hz); /* * Recompute process priority. The number p_cpu * is a weighted estimate of cpu time consumed. * A process which consumes cpu time has this * increase regularly. We here decrease it by * a fraction based on load average giving a digital * decay filter which damps out in about 5 seconds * when seconds are measured in time expanded by the * load average. * * If a process is niced, then the nice directly * affects the new priority. The final priority * is in the range 0 to 255, to fit in a character. */ pp->p_cpticks = 0; a = ave((pp->p_cpu & 0377), avenrun[0]*nrscale) + pp->p_nice - NZERO; if (a < 0) a = 0; if (a > 255) a = 255; pp->p_cpu = a; (void) setpri(pp); /* * Now have computed new process priority * in p->p_usrpri. Carefully change p->p_pri. * A process is on a run queue associated with * this priority, so we must block out process * state changes during the transition. */ s = spl6(); if (pp->p_pri >= PUSER) { if ((pp != u.u_procp || noproc) && pp->p_stat == SRUN && (pp->p_flag & SLOAD) && pp->p_pri != pp->p_usrpri) { remrq(pp); pp->p_pri = pp->p_usrpri; setrq(pp); } else pp->p_pri = pp->p_usrpri; } splx(s); } /* * Perform virtual memory metering. */ vmmeter(); /* * If the swap process is trying to bring * a process in, have it look again to see * if it is possible now. */ if (runin!=0) { runin = 0; wakeup((caddr_t)&runin); } /* * If there are pages that have been cleaned, * jolt the pageout daemon to process them. * We do this here so that these pages will be * freed if there is an abundance of memory and the * daemon would not be awakened otherwise. */ if (bclnlist != NULL) wakeup((caddr_t)&proc[2]); /* * If the trap occurred from usermode, * then check to see if it has now been * running more than 10 minutes of user time * and should thus run with reduced priority * to give other processes a chance. */ if (USERMODE(ps)) { pp = u.u_procp; if (pp->p_uid && pp->p_nice == NZERO && u.u_vm.vm_utime > 600 * hz) pp->p_nice = NZERO+4; (void) setpri(pp); pp->p_pri = pp->p_usrpri; } } /* * If trapped user-mode, give it a profiling tick. */ if (USERMODE(ps) && u.u_prof.pr_scale) { u.u_procp->p_flag |= SOWEUPC; aston(); } } /* * Timeout is called to arrange that * fun(arg) is called in tim/hz seconds. * An entry is linked into the callout * structure. The time in each structure * entry is the number of hz's more * than the previous entry. * In this way, decrementing the * first entry has the effect of * updating all entries. * * The panic is there because there is nothing * intelligent to be done if an entry won't fit. */ timeout(fun, arg, tim) int (*fun)(); caddr_t arg; { register struct callout *p1, *p2, *pnew; register int t; int s; /* DEBUGGING CODE */ int ttrstrt(); if (fun == ttrstrt && arg == 0) panic("timeout ttrstr arg"); /* END DEBUGGING CODE */ t = tim; s = spl7(); pnew = callfree; if (pnew == NULL) panic("timeout table overflow"); callfree = pnew->c_next; pnew->c_arg = arg; pnew->c_func = fun; for (p1 = &calltodo; (p2 = p1->c_next) && p2->c_time < t; p1 = p2) t -= p2->c_time; p1->c_next = pnew; pnew->c_next = p2; pnew->c_time = t; if (p2) p2->c_time -= t; splx(s); } p2, sys/sys/fio.c 444 0 33 11340 2503321171 6417 /* fio.c 4.8 81/03/08 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/filsys.h" #include "../h/file.h" #include "../h/conf.h" #include "../h/inode.h" #include "../h/reg.h" #include "../h/acct.h" #include "../h/mount.h" /* * Convert a user supplied * file descriptor into a pointer * to a file structure. * Only task is to check range * of the descriptor. */ struct file * getf(f) register int f; { register struct file *fp; if ((unsigned)f >= NOFILE || (fp = u.u_ofile[f]) == NULL) { u.u_error = EBADF; return (NULL); } return (fp); } /* * Internal form of close. * Decrement reference count on * file structure. * Also make sure the pipe protocol * does not constipate. * * Decrement reference count on the inode following * removal to the referencing file structure. * Call device handler on last close. */ closef(fp) register struct file *fp; { register struct inode *ip; register struct mount *mp; int flag, mode; dev_t dev; register int (*cfunc)(); if(fp == NULL) return; if (fp->f_count > 1) { fp->f_count--; return; } ip = fp->f_inode; flag = fp->f_flag; dev = (dev_t)ip->i_un.i_rdev; mode = ip->i_mode & IFMT; plock(ip); fp->f_count = 0; if(flag & FPIPE) { ip->i_mode &= ~(IREAD|IWRITE); wakeup((caddr_t)ip+1); wakeup((caddr_t)ip+2); } iput(ip); switch(mode) { case IFCHR: case IFMPC: cfunc = cdevsw[major(dev)].d_close; break; case IFBLK: /* * We don't want to really close the device if it is mounted */ for (mp = mount; mp < &mount[NMOUNT]; mp++) if (mp->m_bufp != NULL && mp->m_dev == dev) return; case IFMPB: cfunc = bdevsw[major(dev)].d_close; break; default: return; } if ((flag & FMP) == 0) { for(fp=file; fp < fileNFILE; fp++) if (fp->f_count && (ip=fp->f_inode)->i_un.i_rdev==dev && (ip->i_mode&IFMT) == mode) return; if (mode == IFBLK) { /* * on last close of a block device (that isn't mounted) * we must invalidate any in core blocks */ bflush(dev); binval(dev); } } (*cfunc)(dev, flag, fp); } /* * openi called to allow handler * of special files to initialize and * validate before actual IO. */ openi(ip, rw) register struct inode *ip; { dev_t dev; register unsigned int maj; dev = (dev_t)ip->i_un.i_rdev; maj = major(dev); switch(ip->i_mode&IFMT) { case IFCHR: case IFMPC: if(maj >= nchrdev) goto bad; (*cdevsw[maj].d_open)(dev, rw); break; case IFBLK: case IFMPB: if(maj >= nblkdev) goto bad; (*bdevsw[maj].d_open)(dev, rw); } return; bad: u.u_error = ENXIO; } /* * Check mode permission on inode pointer. * Mode is READ, WRITE or EXEC. * In the case of WRITE, the * read-only status of the file * system is checked. * Also in WRITE, prototype text * segments cannot be written. * The mode is shifted to select * the owner/group/other fields. * The super user is granted all * permissions. */ access(ip, mode) register struct inode *ip; { register m; m = mode; if(m == IWRITE) { if(getfs(ip->i_dev)->s_ronly != 0) { u.u_error = EROFS; return(1); } if (ip->i_flag&ITEXT) /* try to free text */ xrele(ip); if(ip->i_flag & ITEXT) { u.u_error = ETXTBSY; return(1); } } if(u.u_uid == 0) return(0); if(u.u_uid != ip->i_uid) { m >>= 3; if(u.u_gid != ip->i_gid) m >>= 3; } if((ip->i_mode&m) != 0) return(0); u.u_error = EACCES; return(1); } /* * Look up a pathname and test if * the resultant inode is owned by the * current user. * If not, try for super-user. * If permission is granted, * return inode pointer. */ struct inode * owner() { register struct inode *ip; ip = namei(uchar, 0); if(ip == NULL) return(NULL); if(u.u_uid == ip->i_uid) return(ip); if(suser()) return(ip); iput(ip); return(NULL); } /* * Test if the current user is the * super user. */ suser() { if(u.u_uid == 0) { u.u_acflag |= ASU; return(1); } u.u_error = EPERM; return(0); } /* * Allocate a user file descriptor. */ ufalloc() { register i; for(i=0; if_count == 0) goto slot; for (fp = file; fp < lastf; fp++) if (fp->f_count == 0) goto slot; tablefull("file"); u.u_error = ENFILE; return (NULL); slot: u.u_ofile[i] = fp; fp->f_count++; fp->f_un.f_offset = 0; lastf = fp + 1; return (fp); } tialize the descriptor * to point at the file structure. */ struct file * falloc() { register struct file *fp; register i; i = ufalloc(); if (i < 0) return(NULL); if (lastf == 0) lastf = file; for (fp = lastf; fp < fileNFILE; fp++) if (fp->f_count == 0) goto slot; for sys/sys/iget.c 444 0 33 17340 2503321174 6603 ((/* iget.c 4.4 81/03/08 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/mount.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/inode.h" #include "../h/ino.h" #include "../h/filsys.h" #include "../h/conf.h" #include "../h/buf.h" #include "../h/inline.h" #define INOHSZ 63 #define INOHASH(dev,ino) (((dev)+(ino))%INOHSZ) short inohash[INOHSZ]; short ifreel; /* * Initialize hash links for inodes * and build inode free list. */ ihinit() { register int i; register struct inode *ip = inode; ifreel = 0; for (i = 0; i < ninode-1; i++, ip++) ip->i_hlink = i+1; ip->i_hlink = -1; for (i = 0; i < INOHSZ; i++) inohash[i] = -1; } /* * Find an inode if it is incore. * This is the equivalent, for inodes, * of ``incore'' in bio.c or ``pfind'' in subr.c. */ struct inode * ifind(dev, ino) dev_t dev; ino_t ino; { register struct inode *ip; for (ip = &inode[inohash[INOHASH(dev,ino)]]; ip != &inode[-1]; ip = &inode[ip->i_hlink]) if (ino==ip->i_number && dev==ip->i_dev) return (ip); return ((struct inode *)0); } /* * Look up an inode by device,inumber. * If it is in core (in the inode structure), * honor the locking protocol. * If it is not in core, read it in from the * specified device. * If the inode is mounted on, perform * the indicated indirection. * In all cases, a pointer to a locked * inode structure is returned. * * panic: no imt -- if the mounted file * system is not in the mount table. * "cannot happen" */ struct inode * iget(dev, ino) dev_t dev; ino_t ino; { register struct inode *ip; register struct mount *mp; register struct buf *bp; register struct dinode *dp; register int slot; loop: slot = INOHASH(dev, ino); ip = &inode[inohash[slot]]; while (ip != &inode[-1]) { if(ino == ip->i_number && dev == ip->i_dev) { if((ip->i_flag&ILOCK) != 0) { ip->i_flag |= IWANT; sleep((caddr_t)ip, PINOD); goto loop; } if((ip->i_flag&IMOUNT) != 0) { for(mp = &mount[0]; mp < &mount[NMOUNT]; mp++) if(mp->m_inodp == ip) { dev = mp->m_dev; ino = ROOTINO; goto loop; } panic("no imt"); } ip->i_count++; ip->i_flag |= ILOCK; return(ip); } ip = &inode[ip->i_hlink]; } if(ifreel < 0) { tablefull("inode"); u.u_error = ENFILE; return(NULL); } ip = &inode[ifreel]; ifreel = ip->i_hlink; ip->i_hlink = inohash[slot]; inohash[slot] = ip - inode; ip->i_dev = dev; ip->i_number = ino; ip->i_flag = ILOCK; ip->i_count++; ip->i_un.i_lastr = 0; bp = bread(dev, itod(ino)); /* * Check I/O errors */ if((bp->b_flags&B_ERROR) != 0) { brelse(bp); iput(ip); return(NULL); } dp = bp->b_un.b_dino; dp += itoo(ino); iexpand(ip, dp); brelse(bp); return(ip); } iexpand(ip, dp) register struct inode *ip; register struct dinode *dp; { register char *p1, *p2; register int i; ip->i_mode = dp->di_mode; ip->i_nlink = dp->di_nlink; ip->i_uid = dp->di_uid; ip->i_gid = dp->di_gid; ip->i_size = dp->di_size; p1 = (char *)ip->i_un.i_addr; p2 = (char *)dp->di_addr; for(i=0; ii_count == 1) { ip->i_flag |= ILOCK; if(ip->i_nlink <= 0) { itrunc(ip); ip->i_mode = 0; ip->i_flag |= IUPD|ICHG; ifree(ip->i_dev, ip->i_number); } IUPDAT(ip, &time, &time, 0); prele(ip); i = INOHASH(ip->i_dev, ip->i_number); x = ip - inode; if (inohash[i] == x) { inohash[i] = ip->i_hlink; } else { for (jp = &inode[inohash[i]]; jp != &inode[-1]; jp = &inode[jp->i_hlink]) if (jp->i_hlink == x) { jp->i_hlink = ip->i_hlink; goto done; } panic("iput"); } done: ip->i_hlink = ifreel; ifreel = x; ip->i_flag = 0; ip->i_number = 0; } else prele(ip); ip->i_count--; } /* * Check accessed and update flags on * an inode structure. * If any is on, update the inode * with the current time. * If waitfor is given, then must insure * i/o order so wait for write to complete. */ iupdat(ip, ta, tm, waitfor) register struct inode *ip; time_t *ta, *tm; int waitfor; { register struct buf *bp; struct dinode *dp; register char *p1, *p2; register int i; if((ip->i_flag&(IUPD|IACC|ICHG)) != 0) { if(getfs(ip->i_dev)->s_ronly) return; bp = bread(ip->i_dev, itod(ip->i_number)); if (bp->b_flags & B_ERROR) { brelse(bp); return; } dp = bp->b_un.b_dino; dp += itoo(ip->i_number); dp->di_mode = ip->i_mode; dp->di_nlink = ip->i_nlink; dp->di_uid = ip->i_uid; dp->di_gid = ip->i_gid; dp->di_size = ip->i_size; p1 = (char *)dp->di_addr; p2 = (char *)ip->i_un.i_addr; for(i=0; ii_mode&IFMT)!=IFMPC && (ip->i_mode&IFMT)!=IFMPB) printf("iaddress > 2^24\n"); } if(ip->i_flag&IACC) dp->di_atime = *ta; if(ip->i_flag&IUPD) dp->di_mtime = *tm; if(ip->i_flag&ICHG) dp->di_ctime = time; ip->i_flag &= ~(IUPD|IACC|ICHG); if (waitfor) bwrite(bp); else bdwrite(bp); } } /* * Free all the disk blocks associated * with the specified inode structure. * The blocks of the file are removed * in reverse order. This FILO * algorithm will tend to maintain * a contiguous free list much longer * than FIFO. */ itrunc(ip) register struct inode *ip; { register i; dev_t dev; daddr_t bn; struct inode itmp; if (ip->i_vfdcnt) panic("itrunc"); i = ip->i_mode & IFMT; if (i!=IFREG && i!=IFDIR) return; /* * Clean inode on disk before freeing blocks * to insure no duplicates if system crashes. */ itmp = *ip; itmp.i_size = 0; for (i = 0; i < NADDR; i++) itmp.i_un.i_addr[i] = 0; itmp.i_flag |= ICHG|IUPD; iupdat(&itmp, &time, &time, 1); ip->i_flag &= ~(IUPD|IACC|ICHG); /* * Now return blocks to free list... if machine * crashes, they will be harmless MISSING blocks. */ dev = ip->i_dev; for(i=NADDR-1; i>=0; i--) { bn = ip->i_un.i_addr[i]; if(bn == (daddr_t)0) continue; ip->i_un.i_addr[i] = (daddr_t)0; switch(i) { default: free(dev, bn); break; case NADDR-3: tloop(dev, bn, 0, 0); break; case NADDR-2: tloop(dev, bn, 1, 0); break; case NADDR-1: tloop(dev, bn, 1, 1); } } ip->i_size = 0; /* * Inode was written and flags updated above. * No need to modify flags here. */ } tloop(dev, bn, f1, f2) dev_t dev; daddr_t bn; { register i; register struct buf *bp; register daddr_t *bap; daddr_t nb; bp = NULL; for(i=NINDIR-1; i>=0; i--) { if(bp == NULL) { bp = bread(dev, bn); if (bp->b_flags & B_ERROR) { brelse(bp); return; } bap = bp->b_un.b_daddr; } nb = bap[i]; if(nb == (daddr_t)0) continue; if(f1) { brelse(bp); bp = NULL; tloop(dev, nb, f2, 0); } else free(dev, nb); } if(bp != NULL) brelse(bp); free(dev, bn); } /* * Make a new file. */ struct inode * maknode(mode) { register struct inode *ip; ip = ialloc(u.u_pdir->i_dev); if(ip == NULL) { iput(u.u_pdir); return(NULL); } ip->i_flag |= IACC|IUPD|ICHG; if((mode&IFMT) == 0) mode |= IFREG; ip->i_mode = mode & ~u.u_cmask; ip->i_nlink = 1; ip->i_uid = u.u_uid; ip->i_gid = u.u_gid; /* * Make sure inode goes to disk before directory entry. */ iupdat(ip, &time, &time, 1); wdir(ip); return(ip); } /* * Write a directory entry with * parameters left as side effects * to a call to namei. */ wdir(ip) struct inode *ip; { u.u_dent.d_ino = ip->i_number; bcopy((caddr_t)u.u_dbuf, (caddr_t)u.u_dent.d_name, DIRSIZ); u.u_count = sizeof(struct direct); u.u_segflg = 1; u.u_base = (caddr_t)&u.u_dent; writei(u.u_pdir); iput(u.u_pdir); } ip->i_uid = u.u_uid; ip->i_gid = u.u_gid; /* * Make sure inode goes to disk before directory entry. */ iupdat(ip, &time, &time, 1); wdir(ip); return(ip); } /* * Write a directory entry with * parameters left as side effects * to a call to namei. */ wdir(ip) struct inode sys/sys/ioctl.c 444 0 33 3330 2503321256 6740 /* ioctl.c 4.4 81/03/08 */ /* * Ioctl. */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/tty.h" #include "../h/proc.h" #include "../h/inode.h" #include "../h/file.h" #include "../h/conf.h" /* * stty/gtty writearound */ stty() { u.u_arg[2] = u.u_arg[1]; u.u_arg[1] = TIOCSETP; ioctl(); } gtty() { u.u_arg[2] = u.u_arg[1]; u.u_arg[1] = TIOCGETP; ioctl(); } /* * ioctl system call * Check legality, execute common code, and switch out to individual * device routine. */ ioctl() { register struct file *fp; register struct inode *ip; register struct a { int fdes; int cmd; caddr_t cmarg; } *uap; register dev_t dev; register fmt; uap = (struct a *)u.u_ap; if ((fp = getf(uap->fdes)) == NULL) return; if ((fp->f_flag & (FREAD|FWRITE)) == 0) { u.u_error = EBADF; return; } if (uap->cmd==FIOCLEX) { u.u_pofile[uap->fdes] |= EXCLOSE; return; } if (uap->cmd==FIONCLEX) { u.u_pofile[uap->fdes] &= ~EXCLOSE; return; } ip = fp->f_inode; fmt = ip->i_mode & IFMT; if (fmt != IFCHR && fmt != IFMPC) { /* begin local */ if (uap->cmd==FIONREAD && (fmt == IFREG || fmt == IFDIR)) { off_t nread = ip->i_size - fp->f_un.f_offset; if (copyout((caddr_t)&nread, uap->cmarg, sizeof(off_t))) u.u_error = EFAULT; } else /* end local */ u.u_error = ENOTTY; return; } dev = ip->i_un.i_rdev; u.u_r.r_val1 = 0; if ((u.u_procp->p_flag&SNUSIG) && setjmp(u.u_qsav)) { u.u_eosys = RESTARTSYS; return; } (*cdevsw[major(dev)]((.d_ioctl)(dev, uap->cmd, uap->cmarg, 0); } /* * Do nothing specific version of line * discipline specific ioctl command. */ /*ARGSUSED*/ nullioctl(tp, cmd, addr) struct tty *tp; caddr_t addr; { return (cmd); } copyout((caddr_t)&nread, uap->cmarg, sizeof(off_t))) u.u_error = EFAULT; } else /* end local */ u.u_error = ENOTTY; return; } dev = ip->i_un.i_rdev; u.u_r.r_val1 = 0; if ((u.u_procp->p_flag&SNUSIG) && setjmp(u.u_qsav)) { u.u_eosys = RESTARTSYS; return; } (*cdevsw[major(dev)]sys/sys/main.c 444 0 33 13020 2624304067 6574 /* main.c 4.18- 81/08/24 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/filsys.h" #include "../h/mount.h" #include "../h/map.h" #include "../h/proc.h" #include "../h/inode.h" #include "../h/seg.h" #include "../h/conf.h" #include "../h/buf.h" #include "../h/mtpr.h" #include "../h/pte.h" #include "../h/clock.h" #include "../h/vm.h" #include "../h/cmap.h" #include "../h/text.h" #include "../h/vlimit.h" #include "../h/clist.h" /* * Initialization code. * Called from cold start routine as * soon as a stack and segmentation * have been established. * Functions: * clear and free user core * turn on clock * hand craft 0th process * call all initialization routines * fork - process 0 to schedule * - process 2 to page out * - process 1 execute bootstrap * * loop at loc 13 (0xd) in user mode -- /etc/init * cannot be executed. */ main(firstaddr) { register int i; register struct proc *p; rqinit(); startup(firstaddr); /* * set up system process 0 (swapper) */ p = &proc[0]; p->p_p0br = (struct pte *)mfpr(P0BR); p->p_szpt = 1; p->p_addr = uaddr(p); p->p_stat = SRUN; p->p_flag |= SLOAD|SSYS; p->p_nice = NZERO; setredzone(p->p_addr, (caddr_t)&u); u.u_procp = p; u.u_cmask = CMASK; for (i = 1; i < sizeof(u.u_limit)/sizeof(u.u_limit[0]); i++) switch (i) { case LIM_STACK: u.u_limit[i] = 512*1024; continue; case LIM_DATA: u.u_limit[i] = ctob(MAXDSIZ); continue; default: u.u_limit[i] = INFINITY; continue; } p->p_maxrss = INFINITY/NBPG; clkstart(); /* * Initialize devices and * set up 'known' i-nodes */ ihinit(); bhinit(); cinit(); binit(); bswinit(); iinit(); rootdir = iget(rootdev, (ino_t)ROOTINO); rootdir->i_flag &= ~ILOCK; u.u_cdir = iget(rootdev, (ino_t)ROOTINO); u.u_cdir->i_flag &= ~ILOCK; u.u_rdir = NULL; u.u_dmap = zdmap; u.u_smap = zdmap; /* * Set the scan rate and other parameters of the paging subsystem. */ setupclock(); /* * make page-out daemon (process 2) * the daemon has ctopt(nswbuf*CLSIZE*KLMAX) pages of page * table so that it can map dirty pages into * its address space during asychronous pushes. */ mpid = 1; proc[0].p_szpt = clrnd(ctopt(nswbuf*CLSIZE*KLMAX + UPAGES)); proc[1].p_stat = SZOMB; /* force it to be in proc slot 2 */ if (newproc(0)) { proc[2].p_flag |= SLOAD|SSYS; proc[2].p_dsize = u.u_dsize = nswbuf*CLSIZE*KLMAX; pageout(); } /* * make init process and * enter scheduling loop */ mpid = 0; proc[1].p_stat = 0; proc[0].p_szpt = CLSIZE; if (newproc(0)) { expand(clrnd((int)btoc(szicode)), P0BR); (void) swpexpand(u.u_dsize, 0, &u.u_dmap, &u.u_smap); (void) copyout((caddr_t)icode, (caddr_t)0, (unsigned)szicode); /* * Return goes to loc. 0 of user init * code just copied out. */ return; } proc[0].p_szpt = 1; sched(); } /* * iinit is called once (from main) * very early in initialization. * It reads the root's super block * and initializes the current date * from the last modified date. * * panic: iinit -- cannot read the super * block. Usually because of an IO error. */ iinit() { register struct buf *bp; register struct filsys *fp; register int i; (*bdevsw[major(rootdev)].d_open)(rootdev, 1); bp = bread(rootdev, SUPERB); if(u.u_error) panic("iinit"); bp->b_flags |= B_LOCKED; /* block can never be re-used */ brelse(bp); mount[0].m_dev = rootdev; mount[0].m_bufp = bp; fp = bp->b_un.b_filsys; fp->s_flock = 0; fp->s_ilock = 0; fp->s_ronly = 0; fp->s_lasti = 1; fp->s_nbehind = 0; fp->s_fsmnt[0] = '/'; for (i = 1; i < sizeof(fp->s_fsmnt); i++) fp->s_fsmnt[i] = 0; clkinit(fp->s_time); bootime = time; } /* * Initialize the buffer I/O system by freeing * all buffers and setting all device buffer lists to empty. */ binit() { register struct buf *bp; register struct buf *dp; register int i; struct bdevsw *bdp; struct swdevt *swp; for (dp = bfreelist; dp < &bfreelist[BQUEUES]; dp++) { dp->b_forw = dp->b_back = dp->av_forw = dp->av_back = dp; dp->b_flags = B_HEAD; } dp--; /* dp = &bfreelist[BQUEUES-1]; */ for (i=0; ib_dev = NODEV; bp->b_un.b_addr = buffers + i * BSIZE; bp->b_back = dp; bp->b_forw = dp->b_forw; dp->b_forw->b_back = bp; dp->b_forw = bp; bp->b_flags = B_BUSY|B_INVAL; brelse(bp); } for (bdp = bdevsw; bdp->d_open; bdp++) nblkdev++; /* * Count swap devices, and adjust total swap space available. * Some of this space will not be available until a vswapon() * system is issued, usually when the system goes multi-user. */ nswdev = 0; for (swp = swdevt; swp->sw_dev; swp++) nswdev++; if (nswdev == 0) panic("binit"); if (nswdev > 1) nswap = (nswap/DMMAX)*DMMAX; nswap *= nswdev; maxpgio *= nswdev; swfree(0); } /* * Initialize linked list of free swap * headers. These do not actually point * to buffers, but rather to pages that * are being swapped in and out. */ bswinit() { register int i; register struct buf *sp = swbuf; bswlist.av_forw = sp; for (i=0; iav_forw = sp+1; sp->av_forw = NULL; } /* * Initialize clist by freeing all character blocks, then count * number of character devices. (Once-only routine) */ cinit() { register int ccp; register struct cblock *cp; register struct cdevsw *cdp; ccp = (int)cfree; ccp = (ccp+CROUND) & ~CROUND; for(cp=(struct cblock *)ccp; cp < &cfree[nclist-1]; cp++) { cp->c_next = cfreelist; cfreelist = cp; cfreecount += CBSIZE; } ccp = 0; for(cdp = cdevsw; cdp->d_open; cdp++) ccp++; nchrdev = ccp; } ->av_forw = sp+1; sp->av_forw = NULL; } /* * Initialize clist by freeing all character blocks, then count * number of character devices. (Once-only routine) */ cinit() { register int ccp; register struct cblock *cp; register struct cdevsw *cdp; ccp = (int)cfree; ccp = (ccp+CROUND) & ~CROUND; for(cp=(struct cblock *)ccp; cp < &cfree[nclist-1]; cp++) { cp->c_next = cfreelist; cfreelist = cp; cfreecount += CBSIZE; } ccp = 0; for(cdp = cdevsw; cdp->d_open; cdp++) ccp++; nsys/sys/nami.c 444 0 33 10324 2531444636 6604 /* nami.c 4.5 81/03/09 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/inode.h" #include "../h/mount.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/buf.h" #include "../h/conf.h" /* * Convert a pathname into a pointer to * an inode. Note that the inode is locked. * * func = function called to get next char of name * &uchar if name is in user space * &schar if name is in system space * flag = 0 if name is sought * 1 if name is to be created * 2 if name is to be deleted */ struct inode * namei(func, flag) int (*func)(); { register struct inode *dp; register c; register char *cp; struct buf *bp; register struct direct *ep; int i; dev_t d; off_t eo; /* * If name starts with '/' start from * root; otherwise start from current dir. */ dp = u.u_cdir; if((c=(*func)()) == '/') if ((dp = u.u_rdir) == NULL) dp = rootdir; (void) iget(dp->i_dev, dp->i_number); while(c == '/') c = (*func)(); if(c == '\0' && flag != 0) u.u_error = ENOENT; cloop: /* * Here dp contains pointer * to last component matched. */ if(u.u_error) goto out; if(c == '\0') return(dp); /* * If there is another component, * Gather up name into * users' dir buffer. */ cp = &u.u_dbuf[0]; while (c != '/' && c != '\0' && u.u_error == 0 ) { if (mpxip!=NULL && c=='!') break; if (flag==1 && c == ('/'|0200)) { u.u_error = ENOENT; goto out; } if (cp < &u.u_dbuf[DIRSIZ]) *cp++ = c; c = (*func)(); } while(cp < &u.u_dbuf[DIRSIZ]) *cp++ = '\0'; while(c == '/') c = (*func)(); if (c == '!' && mpxip != NULL) { iput(dp); plock(mpxip); mpxip->i_count++; return(mpxip); } seloop: /* * dp must be a directory and * must have X permission. */ if((dp->i_mode&IFMT) != IFDIR) u.u_error = ENOTDIR; (void) access(dp, IEXEC); if(u.u_error) goto out; /* * set up to search a directory */ u.u_offset = 0; u.u_segflg = 1; eo = 0; bp = NULL; if (dp == u.u_rdir && u.u_dbuf[0] == '.' && u.u_dbuf[1] == '.' && u.u_dbuf[2] == 0) goto cloop; eloop: /* * If at the end of the directory, * the search failed. Report what * is appropriate as per flag. */ if(u.u_offset >= dp->i_size) { if(bp != NULL) brelse(bp); if(flag==1 && c=='\0' && dp->i_nlink) { if(access(dp, IWRITE)) goto out; u.u_pdir = dp; if(eo) u.u_offset = eo-sizeof(struct direct); else dp->i_flag |= IUPD|ICHG; return(NULL); } u.u_error = ENOENT; goto out; } /* * If offset is on a block boundary, * read the next d((irectory block. * Release previous if it exists. */ if((u.u_offset&BMASK) == 0) { if(bp != NULL) brelse(bp); bp = bread(dp->i_dev, bmap(dp, (daddr_t)(u.u_offset>>BSHIFT), B_READ)); if (bp->b_flags & B_ERROR) { brelse(bp); goto out; } ep = (struct direct *)bp->b_un.b_addr; } else ep++; /* * Note first empty directory slot * in eo for possible creat. * String compare the directory entry * and the current component. * If they do not match, go back to eloop. */ u.u_offset += sizeof(struct direct); if(ep->d_ino == 0) { if(eo == 0) eo = u.u_offset; goto eloop; } for(i=0; id_name[i]) goto eloop; if(u.u_dbuf[i] == 0) break; } /* * Here a component matched in a directory. * If there is more pathname, go back to * cloop, otherwise return. */ bcopy((caddr_t)ep, (caddr_t)&u.u_dent, sizeof(struct direct)); if(bp != NULL) brelse(bp); if(flag==2 && c=='\0') { if(access(dp, IWRITE)) goto out; return(dp); } d = dp->i_dev; if(u.u_dent.d_ino == ROOTINO) if(dp->i_number == ROOTINO) if(u.u_dent.d_name[1] == '.') for(i=1; ii_count++; plock(dp); goto seloop; } iput(dp); dp = iget(d, u.u_dent.d_ino); if(dp == NULL) return(NULL); goto cloop; out: iput(dp); return(NULL); } /* * Return the next character from the * kernel string pointed at by dirp. */ schar() { return(*u.u_dirp++ & 0377); } /* * Return the next character from the * user string pointed at by dirp. */ uchar() { register c; c = fubyte(u.u_dirp++); if(c == -1) u.u_error = EFAULT; return(c); } p); dp = mount[i].m_inodp; dp->i_count++; plock(dp); goto seloop; } iput(dp); dp = iget(d, u.u_dent.d_ino); if(dp == NULL) return(NULL); goto cloop; out: iput(dp); return(NULL); } /* * Return the next character from the * kernel string pointed at by dirp. */ schar() {sys/sys/param.c 444 0 33 2452 2531445172 6737 /* param.c 4.2 81/04/02 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/text.h" #include "../h/inode.h" #include "../h/file.h" #include "../h/callout.h" #include "../h/clist.h" #include "../h/cmap.h" /* * System parameter formulae. * * This file is copied into each directory where we compile * the kernel; it should be modified there to suit local taste * if necessary. * * Compiled with -DHZ=xx -DTIMEZONE=x -DDST=x -DMAXUSERS=xx */ int hz = HZ; int timezone = TIMEZONE; int dstflag = DST; #define NPROC (20 + 8 * MAXUSERS) int nproc = NPROC; int ntext = 24 + MAXUSERS; int ninode = (NPROC + 16 + MAXUSERS) + 32; int nfile = 8 * (NPROC + 16 + MAXUSERS) / 10 + 32; int ncallout = 16 + MAXUSERS; int nclist = 100 + 16 * MAXUSERS; /* * These are initialized at bootstrap time * to values dependent on memory size */ int nbuf, nswbuf; /* * These have to be allocated somewhere; allocating * them here forces loader errors if this file is omitted. */ struct proc *proc, *procNPROC; struct text *text, *textNTEXT; struct inode *inode, *inodeNINODE; struct file *file, *fileNFILE; struct callout *callout; struct cblock *cfree; struct buf *buf, *swbuf; short *swsize; int *swpf; char *buffers; struct cmap *cmap, *ecmap; 16 * MAXUSERS; /* * These are initialized at bootstrap time * to values dependent on memory size */ int nbuf, nswbuf; /* * These have to be allocated somewhere; allocating * them here forces loader errors isys/sys/partab.c 444 0 33 3434 2503321202 7073 /* partab.c 4.2 81/03/08 */ /* * Table giving parity for characters and indicating * character classes to tty driver. In particular, * if the low 6 bits are 0, then the character needs * no special processing on output. */ char partab[] = { 0001,0201,0201,0001,0201,0001,0001,0201, 0202,0004,0003,0201,0005,0206,0201,0001, 0201,0001,0001,0201,0001,0201,0201,0001, 0001,0201,0201,0001,0201,0001,0001,0201, 0200,0000,0000,0200,0000,0200,0200,0000, 0000,0200,0200,0000,0200,0000,0000,0200, 0000,0200,0200,0000,0200,0000,0000,0200, 0200,0000,0000,0200,0000,0200,0200,0000, 0200,0000,0000,0200,0000,0200,0200,0000, 0000,0200,0200,0000,0200,0000,0000,0200, 0000,0200,0200,0000,0200,0000,0000,0200, 0200,0000,0000,0200,0000,0200,0200,0000, 0000,0200,0200,0000,0200,0000,0000,0200, 0200,0000,0000,0200,0000,0200,0200,0000, 0200,0000,0000,0200,0000,0200,0200,0000, 0000,0200,0200,0000,0200,0000,0000,0201, /* * 7 bit ascii ends with the last character above, * but we contine through all 256 codes for the sake * of the tty output routines which use special vax * instructions which need a 256 character trt table. */ 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007 }; 0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0007,0007,0007,0007,0007,0007, 0007,0007,0sys/sys/pipe.c 444 0 33 7117 2503321203 6562 /* pipe.c 4.3 81/03/08 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/inode.h" #include "../h/file.h" #include "../h/reg.h" #include "../h/inline.h" #include "../h/proc.h" /* * Max allowable buffering per pipe. * This is also the max size of the * file created to implement the pipe. * If this size is bigger than 5120, * pipes will be implemented with large * files, which is probably not good. */ #define PIPSIZ 4096 /* * The sys-pipe entry. * Allocate an inode on the root device. * Allocate 2 file structures. * Put it all together with flags. */ pipe() { register struct inode *ip; register struct file *rf, *wf; int r; ip = ialloc(pipedev); if(ip == NULL) return; rf = falloc(); if(rf == NULL) { iput(ip); return; } r = u.u_r.r_val1; wf = falloc(); if(wf == NULL) { rf->f_count = 0; u.u_ofile[r] = NULL; iput(ip); return; } u.u_r.r_val2 = u.u_r.r_val1; u.u_r.r_val1 = r; wf->f_flag = FWRITE|FPIPE; wf->f_inode = ip; rf->f_flag = FREAD|FPIPE; rf->f_inode = ip; ip->i_count = 2; ip->i_mode = IFREG; ip->i_flag = IACC|IUPD|ICHG|IPIPE; } /* * Read call directed to a pipe. */ readp(fp) register struct file *fp; { register struct inode *ip; ip = fp->f_inode; loop: /* * Very conservative locking. */ plock(ip); /* * If nothing in the pipe, wait. */ if (ip->i_size == 0) { /* * If there are not both reader and * writer active, return without * satisfying read. */ prele(ip); if(ip->i_count < 2) return; ip->i_mode |= IREAD; sleep((caddr_t)ip+2, PPIPE); goto loop; } /* * Read and return */ u.u_offset = fp->f_un.f_offset; readi(ip); fp->f_un.f_offset = u.u_offset; /* * If reader has caught up with writer, reset * offset and size to 0. */ if (fp->f_un.f_offset == ip->i_size) { fp->f_un.f_offset = 0; ip->i_size = 0; if(ip->i_mode & IWRITE) { ip->i_mode &= ~IWRITE; wakeup((caddr_t)ip+1); } } prele(ip); } /* * Write call directed to a pipe. */ writep(fp) register struct file *fp; { register unsigned c; register struct inode *ip; ip = fp->f_inode; c = u.u_count; loop: /* * If error or all done, return. */ if (u.u_error) return; plock(ip); if(c == 0) { prele(ip); u.u_count = 0; return; } /* * If there are not both read and * write sides of the pipe active, * return error and signal too. */ if(ip->i_count < 2) { prele(ip); u.u_error = EPIPE; psignal(u.u_procp, SIGPIPE); return; } /* * If the pipe is full, * wait for reads to deplete * and truncate it. */ if(ip->i_size >= PIPSIZ) { ip->i_mode |= IWRITE; prele(ip); sleep((caddr_t)ip+1, PPIPE); goto loop; } /* * Write what is possible and * loop back. * If writing less than PIPSIZ, it always goes. * One can therefore get a file > PIPSIZ if write * sizes do not divide PIPSIZ. */ u.u_offset = ip->i_size; u.u_count = MIN(c, PIPSIZ); c -= u.u_count; writei(ip); prele(ip); if(ip->i_mode&IREAD) { ip->i_mode &= ~IREAD; w((akeup((caddr_t)ip+2); } goto loop; } #ifdef plock #undef plock #endif #ifdef prele #undef prele #endif /* * Lock a pipe. * If its already locked, * set the WANT bit and sleep. */ plock(ip) register struct inode *ip; { while(ip->i_flag&ILOCK) { ip->i_flag |= IWANT; sleep((caddr_t)ip, PINOD); } ip->i_flag |= ILOCK; } /* * Unlock a pipe. * If WANT bit is on, * wakeup. * This routine is also used * to unlock inodes in general. */ prele(ip) register struct inode *ip; { ip->i_flag &= ~ILOCK; if(ip->i_flag&IWANT) { ip->i_flag &= ~IWANT; wakeup((caddr_t)ip); } } prele #undef prele #endif /* * Lock a pipe. * If its already locked, * set the WANT bit and sleep. */ plock(ip) register struct inode *ip; { while(ip->i_flag&ILOCK) { ip->i_flag |= IWANT; sleep((caddr_t)ip, PINOD); } ip->i_flag |= ILOCK; } /* * Unlock a pipe. * If WANT bit is on, * wakeup. * This routine is also used * to unlock inodes in general. */ prele(ip) register struct inode *ip; { ip->i_flag &= ~ILOCsys/sys/prf.c 444 0 33 11044 2552370100 6432 /* prf.c 4.18 81/06/11 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/seg.h" #include "../h/buf.h" #include "../h/conf.h" #include "../h/mtpr.h" #include "../h/reboot.h" #include "../h/vm.h" #include "../h/msgbuf.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/tty.h" /* * In case console is off, * panicstr contains argument to last * call to panic. */ char *panicstr; /* * Scaled down version of C Library printf. * Used to print diagnostic information directly on console tty. * Since it is not interrupt driven, all system activities are * suspended. Printf should not be used for chit-chat. * * One additional format: %b is supported to decode error registers. * Usage is: * printf("reg=%b\n", regval, "*"); * Where is the output base expressed as a control character, * e.g. \10 gives octal; \20 gives hex. Each arg is a sequence of * characters, the first of which gives the bit number to be inspected * (origin 1), and the next characters (up to a control character, i.e. * a character <= 32), give the name of the register. Thus * printf("reg=%b\n", 3, "\10\2BITTWO\1BITONE\n"); * would produce output: * reg=2 */ /*VARARGS1*/ printf(fmt, x1) char *fmt; unsigned x1; { prf(fmt, &x1, 0); } /* * Uprintf prints to the current user's terminal, * guarantees not to sleep (so can be called by interrupt routines) * and does no watermark checking - (so no verbose messages). */ /*VARARGS1*/ uprintf(fmt, x1) char *fmt; unsigned x1; { prf(fmt, &x1, 2); } prf(fmt, adx, touser) register char *fmt; register u_int *adx; { register int b, c, i; char *s; int any; loop: while ((c = *fmt++) != '%') { if(c == '\0') return; putchar(c, touser); } again: c = *fmt++; /* THIS CODE IS VAX DEPENDENT IN HANDLING %l? AND %c */ switch (c) { case 'l': goto again; case 'x': case 'X': b = 16; goto number; case 'd': case 'D': case 'u': /* what a joke */ b = 10; goto number; case 'o': case 'O': b = 8; number: printn((u_long)*adx, b, touser); break; case 'c': b = *adx; for (i = 24; i >= 0; i -= 8) if (c = (b >> i) & 0x7f) putchar(c, touser); break; case 'b': b = *adx++; s = (char *)*adx; printn((u_long)b, *s++, touser); any = 0; if (b) { putchar('<', touser); while (i = *s++) { if (b & (1 << (i-1))) { if (any) putchar(',', touser); any = 1; for (; (c = *s) > 32; s++) putchar(c, touser); } else for (; *s > 32; s++) ; } if (any) putchar('>', touser); } break; case 's': s = (char *)*adx; while (c = *s++) putchar(c, touser); break; case '%': putchar('%', touser); break; } adx++; goto loop; } /* * Printn prints a number n in base b. * We don't use recursion to avoid deep kernel stacks. */ printn(n, b, touser) u_long n; { char prbuf[11]; register char *cp; if (b == 10 && (int)n < 0) { putchar('-', touser); n = (unsigned)(-(int)n); } cp = prbuf; do { *cp++ = "0123456789abcdef"[n%b]; n /= b; } while (n); do putchar(*--cp, touser); while (cp > prbuf); } /* * Panic is called on unresolvable fatal errors. * It prints "panic: mesg", and then reboots. * If we are called twice, then we avoid trying to * sync the disks as this often leads to recursive panics. */ panic(s) char *s; { int bootopt = panicstr ? RB_AUTOBOOT : RB_AUTOBOOT|RB_NOSYNC; panicstr = s; printf("panic: %s\n", s); (void) spl0(); boot(RB_PANIC, bootopt); } /* * Warn that a system table is full. */ tablefull(tab) char *tab; { printf("%s: table is full\n", tab); } /* * Hard error is the preface to plaintive error messages * about failing disk transfers. */ harderr(bp, cp) struct buf *bp; char *cp; { printf("%s%d%c: hard error sn%d ", cp, dkunit(bp), 'a'+(minor(bp->b_dev)&07), bp->b_blkno); } /* * Print a character on console or users terminal. * If destination is console then the last MSGBUFS characters * are saved in msgbuf for inspection later. */ /*ARGSUSED*/ putchar(c, touser) register int c; { if (touser) { register struct tty *tp = u.u_ttyp; if (tp && (tp->t_state&CARR_ON)) { register s = spl6(); if (c == '\n') ttyoutput('\r', tp); ttyoutput(c, tp); ttstart(tp); splx(s); } return; } if (c != '\0' && c != '\r' && c != 0177 && mfpr(MAPEN)) { if (msgbuf.msg_magic != MSG_MAGIC) { msgbuf.msg_bufx = 0; msgbuf.msg_magic = MSG_MAGIC; } if (msgbuf.msg_bufx < 0 || msgbuf.msg_bufx >= MSG_BSIZE) msgbuf.msg_bufx = 0; msgbuf.msg_bufc[msgbuf.msg_bufx++] = c; } if (c == 0) return; cnputc(c); } *tp = u.u_ttyp; if (tp && (tp->t_state&CARR_ON)) { register s = spl6(); if (c == '\n') ttyoutput('\r', tp); ttyoutput(c, tp); ttstart(tp); splx(s); } return; } if (c != '\0' && c != '\r' && c != 0177 && mfpr(MAPEN)) { if (msgbuf.msg_magic != MSG_MAGIC) { msgbuf.msg_bufx = 0; msgbuf.msg_magic = MSG_MAGIC; } if (msgbuf.msg_bufx < 0 || msgbuf.msg_bufx >= MSG_BSIZE) msgbuf.msg_bufx = 0; msgbuf.msg_bufc[msgbuf.msg_bufx++] = c; } sys/sys/prim.c 444 0 33 15711 2522400677 6631 /* prim.c 4.11 81/04/17 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/conf.h" #include "../h/buf.h" #include "../h/tty.h" #include "../h/clist.h" char cwaiting; /* * Character list get/put */ getc(p) register struct clist *p; { register struct cblock *bp; register int c, s; s = spl5(); if (p->c_cc <= 0) { c = -1; p->c_cc = 0; p->c_cf = p->c_cl = NULL; } else { c = *p->c_cf++ & 0377; if (--p->c_cc<=0) { bp = (struct cblock *)(p->c_cf-1); bp = (struct cblock *) ((int)bp & ~CROUND); p->c_cf = NULL; p->c_cl = NULL; bp->c_next = cfreelist; cfreelist = bp; cfreecount += CBSIZE; if (cwaiting) { wakeup(&cwaiting); cwaiting = 0; } } else if (((int)p->c_cf & CROUND) == 0){ bp = (struct cblock *)(p->c_cf); bp--; p->c_cf = bp->c_next->c_info; bp->c_next = cfreelist; cfreelist = bp; cfreecount += CBSIZE; if (cwaiting) { wakeup(&cwaiting); cwaiting = 0; } } } splx(s); return(c); } /* * copy clist to buffer. * return number of bytes moved. */ q_to_b(q, cp, cc) register struct clist *q; register char *cp; { register struct cblock *bp; register int s; char *acp; if (cc <= 0) return(0); s = spl5(); if (q->c_cc <= 0) { q->c_cc = 0; q->c_cf = q->c_cl = NULL; splx(s); return(0); } acp = cp; cc++; while (--cc) { *cp++ = *q->c_cf++; if (--q->c_cc <= 0) { bp = (struct cblock *)(q->c_cf-1); bp = (struct cblock *)((int)bp & ~CROUND); q->c_cf = q->c_cl = NULL; bp->c_next = cfreelist; cfreelist = bp; cfreecount += CBSIZE; if (cwaiting) { wakeup(&cwaiting); cwaiting = 0; } break; } if (((int)q->c_cf & CROUND) == 0) { bp = (struct cblock *)(q->c_cf); bp--; q->c_cf = bp->c_next->c_info; bp->c_next = cfreelist; cfreelist = bp; cfreecount += CBSIZE; if (cwaiting) { wakeup(&cwaiting); cwaiting = 0; } } } splx(s); return(cp-acp); } /* * Return count of contiguous characters * in clist starting at q->c_cf. * Stop counting if flag&character is non-null. */ ndqb(q, flag) register struct clist *q; { register cc; int s; s = spl5(); if (q->c_cc <= 0) { cc = -q->c_cc; goto out; } cc = ((int)q->c_cf + CBSIZE) & ~CROUND; cc -= (int)q->c_cf; if (q->c_cc < cc) cc = q->c_cc; if (flag) { register char *p, *end; p = q->c_cf; end = p; end += cc; while (p < end) { if (*p & flag) { cc = (int)p; cc -= (int)q->c_cf; break; } p++; } } out: splx(s); return(cc); } /* * Flush cc bytes from q. */ ndflush(q, cc) register struct clist *q; register cc; { register struct cblock *bp; char *end; int rem; register s; s = spl5(); if (q->c_cc < 0) { printf("neg q flush\n"); goto out; } if (q->c_cc == 0) { goto out; } while (cc>0 && q->c_cc) { bp = (struct cblock *)((int)q->c_cf & ~CROUND); if ((int)bp == (((int)q->c_cl-1) & ~CROUND)) { end = q->c_cl; } else { end = (char *)((int)bp + sizeof (struct cblock)); } rem = end - q->c_cf; if (cc >= rem) { cc -= rem; q->c_cc -= r((em; q->c_cf = bp->c_next->c_info; bp->c_next = cfreelist; cfreelist = bp; cfreecount += CBSIZE; if (cwaiting) { wakeup(&cwaiting); cwaiting = 0; } } else { q->c_cc -= cc; q->c_cf += cc; if (q->c_cc <= 0) { bp->c_next = cfreelist; cfreelist = bp; cfreecount += CBSIZE; if (cwaiting) { wakeup(&cwaiting); cwaiting = 0; } } break; } } if (q->c_cc <= 0) { q->c_cf = q->c_cl = NULL; q->c_cc = 0; } out: splx(s); } putc(c, p) register struct clist *p; { register struct cblock *bp; register char *cp; register s; s = spl5(); if ((cp = p->c_cl) == NULL || p->c_cc < 0 ) { if ((bp = cfreelist) == NULL) { splx(s); return(-1); } cfreelist = bp->c_next; cfreecount -= CBSIZE; bp->c_next = NULL; p->c_cf = cp = bp->c_info; } else if (((int)cp & CROUND) == 0) { bp = (struct cblock *)cp - 1; if ((bp->c_next = cfreelist) == NULL) { splx(s); return(-1); } bp = bp->c_next; cfreelist = bp->c_next; cfreecount -= CBSIZE; bp->c_next = NULL; cp = bp->c_info; } *cp++ = c; p->c_cc++; p->c_cl = cp; splx(s); return(0); } /* * copy buffer to clist. * return number of bytes not transfered. */ b_to_q(cp, cc, q) register char *cp; struct clist *q; register int cc; { register char *cq; register struct cblock *bp; register s, acc; if (cc <= 0) return(0); acc = cc; s = spl5(); if ((cq = q->c_cl) == NULL || q->c_cc < 0) { if ((bp = cfreelist) == NULL) goto out; cfreelist = bp->c_next; cfreecount -= CBSIZE; bp->c_next = NULL; q->c_cf = cq = bp->c_info; } while (cc) { if (((int)cq & CROUND) == 0) { bp = (struct cblock *) cq - 1; if ((bp->c_next = cfreelist) == NULL) goto out; bp = bp->c_next; cfreelist = bp->c_next; cfreecount -= CBSIZE; bp->c_next = NULL; cq = bp->c_info; } *cq++ = *cp++; cc--; } out: q->c_cl = cq; q->c_cc += acc-cc; splx(s); return(cc); } /* * Given a non-NULL pointter into the list (like c_cf which * always points to a real character if non-NULL) return the pointer * to the next character in the list or return NULL if no more chars. * * Callers must not allow getc's to happen between nextc's so that the * pointer becomes invalid. Note that interrupts are NOT masked. */ char * nextc(p, cp) register struct clist *p; register char *cp; { if (p->c_cc && ++cp != p->c_cl) { if (((int)cp & CROUND) == 0) return (((struct cblock *)cp)[-1].c_next->c_info); return (cp); } return (0); } /* * Remove the last character in the list and return it. */ unputc(p) register struct clist *p; { register struct cblock *bp; register int c, s; struct cblock *obp; s = spl5(); if (p->c_cc <= 0) c = -1; else { c = *--p->c_cl; if (--p->c_cc <= 0) { bp = (struct cblock *)p->c_cl; bp = (struct cblock *)((int)bp & ~CROUND); p->c_cl = p->c_cf = NULL; bp->c_next = cfreelist; cfreelist = bp; cfreecount += CBSIZE; } else if (((int)p->c_cl & CROUND) == sizeof(bp->c_next)) { p->c_cl = (char *)((int)p->c_cl & ~CROUND); bp = (struct cblock *)p->c_cf; bp = (struct cblock *)((int)bp & ~CROUND); while (bp->c_next != (struct cblock *)p->c_cl) bp = bp->c_next; obp = bp; p->c_cl = (char *)(bp + 1); bp = bp->c_next; bp->c_next = cfreelist; cfreelist = bp; cfreecount += CBSIZE; obp->c_next = NULL; } } splx(s); return (c); } /* * Put the chars in the from que * on the end of the to que. * * SHOULD JUST USE q_to_b AND THEN b_to_q HERE. */ catq(from, to) struct clist *from, *to; { register c; while ((c = getc(from)) >= 0) (void) putc(c, to); } /* * integer (2-byte) get/put * using clists */ #ifdef unneeded getw(p) register struct clist *p; { register int s; if (p->c_cc <= 1) return(-1); s = getc(p); return(s | (getc(p)<<8)); } #endif putw(c, p) register struct clist *p; { register s; s = spl5(); if (cfreelist==NULL) { splx(s); return(-1); } (void) putc(c, p); (void) putc(c>>8, p); splx(s); return(0); } HERE. */ catq(from, to) struct clist *from, *to; { resys/sys/rdwri.c 444 0 33 12374 2503321207 7001 /* rdwri.c 4.6 81/03/08 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/inode.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/buf.h" #include "../h/conf.h" #include "../h/cmap.h" #include "../h/vlimit.h" #include "../h/proc.h" /* * Read the file corresponding to * the inode pointed at by the argument. * The actual read arguments are found * in the variables: * u_base core address for destination * u_offset byte offset in file * u_count number of bytes to read * u_segflg read to kernel/user/user I */ readi(ip) register struct inode *ip; { struct buf *bp; dev_t dev; daddr_t lbn, bn; off_t diff; register int on, type; register unsigned n; extern int mem_no; if(u.u_count == 0) return; dev = (dev_t)ip->i_un.i_rdev; if (u.u_offset < 0 && ((ip->i_mode&IFMT) != IFCHR || mem_no != major(dev))) { u.u_error = EINVAL; return; } ip->i_flag |= IACC; type = ip->i_mode&IFMT; if (type==IFCHR || type==IFMPC) { (*cdevsw[major(dev)].d_read)(dev); return; } do { lbn = bn = u.u_offset >> BSHIFT; on = u.u_offset & BMASK; n = MIN((unsigned)(BSIZE-on), u.u_count); if (type!=IFBLK && type!=IFMPB) { diff = ip->i_size - u.u_offset; if (diff <= 0) return; if (diff < n) n = diff; bn = bmap(ip, bn, B_READ); if (u.u_error) return; dev = ip->i_dev; } else rablock = bn+1; if ((long)bn<0) { bp = geteblk(); clrbuf(bp); } else if (ip->i_un.i_lastr+1==lbn) bp = breada(dev, bn, rablock); else bp = bread(dev, bn); ip->i_un.i_lastr = lbn; n = MIN(n, BSIZE-bp->b_resid); if (n!=0) { #ifdef UNFAST iomove(bp->b_un.b_addr+on, n, B_READ); #else if (u.u_segflg != 1) { if (copyout(bp->b_un.b_addr+on, u.u_base, n)) { u.u_error = EFAULT; goto bad; } } else bcopy(bp->b_un.b_addr+on, u.u_base, n); u.u_base += n; u.u_offset += n; u.u_count -= n; bad: ; #endif } if (n+on==BSIZE || u.u_offset==ip->i_size) { if (ip->i_flag&IPIPE) bp->b_flags &= ~B_DELWRI; /* cancel i/o */ bp->b_flags |= B_AGE; } brelse(bp); } while(u.u_error==0 && u.u_count!=0 && n!=0); } /* * Write the file corresponding to * the inode pointed at by the argument. * The actual write arguments are found * in the variables: * u_base core address for source * u_offset byte offset in file * u_count number of bytes to write * u_segflg write to kernel/user/user I */ writei(ip) register struct inode *ip; { struct buf *bp; dev_t dev; daddr_t bn; register int on, type; register unsigned n; extern int mem_no; dev = (dev_t)ip->i_un.i_rdev; if(u.u_offset < 0 && ((ip->i_mode&IFMT) != IFCHR || mem_no != major(dev)) ) { u.u_error = EINVAL; return; } type = ip->i_mode&IFMT; if (type==IFCHR || type==IFMPC) { ip->i_flag |= IUPD|ICHG; (*cdevsw[major(dev)].d_write)(dev); return; } if (u.u_count == 0) return; if ((ip->i_mode&IFMT)==IFREG && u.u_offset + u.u_count > u.u_limit[LIM_FSIZE]) { psignal(u.u_procp, SIGXFSZ); u.u_error = EMFILE; return; } do { bn = u.u_offset >> BSHIFT; on = u.u_offset & BMASK; n = MIN((unsigned)(BSIZE-on), u.u_count); if (type!=IFBLK && type!=IFMPB) { bn = bmap(ip, bn, B_WRITE); if((long)bn<0) return; dev = ip->i_dev; } if (bn && mfind(dev, bn)) munhash(dev, bn); if(n == BSIZE) bp = getblk(dev, bn); else bp = bread(dev, bn); #ifdef UNFAST iomove(bp->b_un.b_addr+on, n, B_WRITE); #else if (u.u_segflg != 1) { if (copyin(u.u_base, bp->b_un.b_addr+on, n)) { u.u_error = EFAULT; goto bad; } } else bcopy(u.u_base, bp->b_un.b_addr+on, n); u.u_base += n; u.u_offset += n; u.u_count -= n; bad: ; #endif if(u.u_error != 0) brelse(bp); else { if ((ip->i_mode&IFMT) == IFDIR && ((struct direct *)(bp->b_un.b_addr+on))->d_ino == 0) /* * Writing to clear a directory entry. * Must insure the write occurs before * the inode is freed, or may end up * pointing at a new (different) file * if inode is quickly allocated again * and system crashes. */ bwrite(bp); else if (n+on==BSIZE && (ip->i_flag&IPIPE) == 0) { bp->b_flags |= B_AGE; bawrite(bp); } else bdwrite(bp); } if(u.u_offset > ip->i_size && (type==IFDIR || type==IFREG)) ip->i_size = u.u_offset; ip->i_flag |= IUPD|ICHG; #ifndef INSECURE ip->i_mode &= ~(ISUID|ISGID); #endif } while(u.u_error==0 && u.u_count!=0); } /* * Return the logical maximum * of the 2 arguments. */ unsigned max(a, b) unsigned a, b; { if(a > b) return(a); return(b); } /* * Return the logical minimum * of the 2 arguments. */ unsigned min(a, b) unsigned a, b; { if(a < b) return(a); return(b); } /* * Move n bytes at byte location * &bp->b_un.b_addr[o] to/from (flag) the * user/kernel (u.segflg) area starting at u.base. * Update all the arguments by the number * of bytes moved. */ iomove(cp, n, flag) register caddr_t cp; register unsigned n; { register int t; if (n==0) return; if (u.u_segflg != 1) { if (flag==B_WRITE) t = copyin(u.u_base, (caddr_t)cp, n); else t = copyout((caddr_t)cp, u.u_base, n); if (t) { u.u_error = EFAULT; return; } } else if (flag == B_WRITE) bcopy(u.u_base, (caddr_t)cp, n); else bcopy((caddr_t)cp, u.u_base, n); u.u_base += n; u.u_offset += n; u.u_count -= n; } date all the arguments by the number * of bytes moved. */ iomove(cp, n, flag) register caddr_t cp; register unsigned n; { register int t; if (n==0) return; if (u.u_segflg != 1) { if (flag==B_WRITE) t = copyin(u.u_base, (caddr_t)cp, n); else ((sys/sys/rmap.c 444 0 33 14716 2503321261 6613 /* rmap.c 4.4 81/03/08 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/map.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/mtpr.h" #include "../h/text.h" /* * Resource map handling routines. * * A resource map is an array of structures each * of which describes a segment of the address space of an available * resource. The segments are described by their base address and * length, and sorted in address order. Each resource map has a fixed * maximum number of segments allowed. Resources are allocated * by taking part or all of one of the segments of the map. * * Returning of resources will require another segment if * the returned resources are not adjacent in the address * space to an existing segment. If the return of a segment * would require a slot which is not available, then one of * the resource map segments is discarded after a warning is printed. * Returning of resources may also cause the map to collapse * by coalescing two existing segments and the returned space * into a single segment. In this case the resource map is * made smaller by copying together to fill the resultant gap. * * N.B.: the current implementation uses a dense array and does * not admit the value ``0'' as a legal address, since that is used * as a delimiter. */ /* * Initialize map mp to have (mapsize-2) segments * and to be called ``name'', which we print if * the slots become so fragmented that we lose space. * The map itself is initialized with size elements free * starting at addr. */ rminit(mp, size, addr, name, mapsize) register struct map *mp; int size, addr; char *name; int mapsize; { register struct mapent *ep = (struct mapent *)(mp+1); mp->m_name = name; /* N.B.: WE ASSUME HERE THAT sizeof (struct map) == sizeof (struct mapent) */ /* * One of the mapsize slots is taken by the map structure, * segments has size 0 and addr 0, and acts as a delimiter. * We insure that we never use segments past the end of * the array which is given by mp->m_limit. * Instead, when excess segments occur we discard some resources. */ mp->m_limit = (struct mapent *)&mp[mapsize]; /* * Simulate a rmfree(), but with the option to * call with size 0 and addr 0 when we just want * to initialize without freeing. */ ep->m_size = size; ep->m_addr = addr; } /* * Allocate 'size' units from the given * map. Return the base of the allocated space. * In a map, the addresses are increasing and the * list is terminated by a 0 size. * * Algorithm is first-fit. * * This routine knows about the interleaving of the swapmap * and handles that. */ rmalloc(mp, size) register struct map *mp; { register struct mapent *ep = (struct mapent *)(mp+1); register int addr; register struct mapent *bp; swblk_t first, rest; if (size <= 0 || mp == swapmap && size > DMMAX) panic("rmalloc"); /* * Search for a piece of the resource map which has enough * free space to accomodate the request. */ for (bp = ep; bp->m_size; bp++) { if (bp->m_size >= size) { /* * If allocating from swapmap, * then have to respect interleaving * boundaries. */ if (mp == swapmap && (first = DMMAX - bp->m_addr%DMMAX) < bp->m_size) { if (bp->m_size - first < size) continue; addr = bp->m_addr + first; rest = bp->m_size - first - size; bp->m_size = first; if (rest) rmfree(swapmap, rest, addr+size); return (addr); } /* * Allocate from the map. * If there is no space left of the piece * we allocated from, move the rest of * the pieces to the left. */ addr = bp->m_addr; bp->m_addr += size; if ((bp->m_size -= size) == 0) { do { bp++; (bp-1)->m_addr = bp->m_addr; } while ((bp-1)->m_size = bp->m_size); } if (mp == swapmap && addr % CLSIZE) panic("rmalloc swapmap"); return (addr); } } return (0); } /* * Free the previously allocated space at addr * of size units into the specified map. * Sort addr into map and combine on * one or both ends if possible. */ rmfree(mp, size, addr) struct map *mp; register int size, addr; { struct mapent *firstbp; register struct mapent *bp; register int t; /* * Both address and size must be * positive, or the protocol has broken down. */ if (addr <= 0 || size <= 0) goto badrmfree; /* * Locate the piece of the map which starts after the * returned space (or the end of the map). */ firstbp = bp = (struct mapent *)(mp + 1); for (; bp->m_addr <= addr && bp->m_size != 0; bp++) continue; /* * If the piece on the left abuts us, * then we should combine with it. */ if (bp > firstbp && (bp-1)->m_addr+(bp-1)->m_size >= addr) { /* * Check no overlap (internal error). */ if ((bp-1)->m_addr+(bp-1)->m_size > addr) goto badrmfree; /* * Add into piece on the left by increasing its size. */ (bp-1)->m_size += size; /* * If the combined piece abuts the piece on * the right now, compress it in also, * by shifting the remaining pieces of the map over. */ if (bp->m_addr && addr+size >= bp->m_addr) { if (addr+size > bp->m_addr) goto badrmfree; (bp-1)->m_size += bp->m_size; while (bp->m_size) { bp++; (bp-1)->m_addr = bp->m_addr; (bp-1)->m_size = bp->m_size; } } goto done; } /* * Don't abut on the left, check for abutting on * the right. */ if (addr+size >= bp->m_addr && bp->m_size) { if (addr+size > bp->m_addr) goto badrmfree; bp->m_addr -= size; bp->m_size += size; goto done; } /* * Don't abut at all. Make a new entry * and check for map overflow. */ do { t = bp->m_addr; bp->m_addr = addr; addr = t; t = bp->m_size; bp->m_size = size; bp++; } while (size = t); /* * Segment at bp is to be the delimiter; * If there is not room for it * then the table is too full * and we must discard something. */ if (bp+1 > mp->m_limit) { /* * Back bp up to last available segment. * which contains a segment already and must * be made into the delimiter. * Discard second to last entry, * since it is presumably smaller than the last * and move the last entry back one. */ bp--; printf("%s: rmap ovflo, lost [%d,%d)\n", mp->m_name, (bp-1)->m_addr, (bp-1)->m_addr+(bp-1)->m_size); bp[-1] = bp[0]; bp[0].m_size = bp[0].m_addr = 0; } done: /* * THIS IS RIDICULOUS... IT DOESN'T BELONG HERE! */ if ((mp == kernelmap) && kmapwnt) { kmapwnt = 0; wakeup((caddr_t)kernelmap); } return; badrmfree: panic("bad rmfree"); } the delimiter. * Discard second to last entry, sys/sys/scb.s 444 0 33 3050 2530074310 6410 /* scb.s 4.9 81/05/13 */ /* * System control block */ .set INTSTK,1 # handle this interrupt on the interrupt stack .set HALT,3 # halt if this interrupt occurs _scb: .globl _scb #define STRAY .long _Xstray+INTSTK #define STRAY8 STRAY;STRAY;STRAY;STRAY;STRAY;STRAY;STRAY;STRAY #define STRAY15 STRAY;STRAY;STRAY;STRAY;STRAY;STRAY;STRAY;STRAY8 #define KS(a) .long _X/**/a #define IS(a) .long _X/**/a+INTSTK #define STOP(a) .long _X/**/a+HALT /* 000 */ STRAY; IS(machcheck); IS(kspnotval); STOP(powfail); /* 010 */ KS(privinflt); KS(xfcflt); KS(resopflt); KS(resadflt); /* 020 */ KS(protflt); KS(transflt); KS(tracep); KS(bptflt); /* 030 */ KS(compatflt); KS(arithtrap); STRAY; STRAY; /* 040 */ KS(syscall); KS(chme); KS(chms); KS(chmu); /* 050 */ STRAY; IS(cmrd); STRAY; STRAY; /* 060 */ IS(wtime); STRAY; STRAY; STRAY; /* 070 */ STRAY; STRAY; STRAY; STRAY; /* 080 */ STRAY; STRAY; KS(astflt); STRAY; /* 090 */ STRAY; STRAY; STRAY; STRAY; /* 0a0 */ IS(softclock); STRAY; STRAY; STRAY; /* 0b0 */ STRAY; STRAY; STRAY; STRAY; /* 0c0 */ IS(hardclock); STRAY; STRAY; STRAY; /* 0d0 */ STRAY; STRAY; STRAY; STRAY; /* 0e0 */ STRAY; STRAY; STRAY; STRAY; /* 0f0 */ IS(consdin); IS(consdout); IS(cnrint); IS(cnxint); /* 100 */ IS(nexzvec); STRAY15; /* ipl 0x14, nexus 0-15 */ /* 140 */ IS(nexzvec); STRAY15; /* ipl 0x15, nexus 0-15 */ /* 180 */ IS(nexzvec); STRAY15; /* ipl 0x16, nexus 0-15 */ /* 1c0 */ IS(nexzvec); STRAY15; /* ipl 0x17, nexus 0-15 */ .globl _UNIvec _UNIvec: .space 512 # 750 unibus intr vector # 1st UBA jump table on 780's clock); STRAY; STRAY; STRAY; /* 0d0 */ STRAY; STRAY; STRAY; STRAY; /* 0e0 */ STRAY; STRAY; STRAY; STRAY; /* 0f0 */ IS(consdin); IS(consdout); IS(cnrint); IS(cnxint); /* 100 */ IS(nexzvec); STRAY15; /* ipl 0x14, nexus 0-15 */ /* 140 */ IS(nexzvec); STRAY15; /* ipl 0x15, nexus 0-15 */ /* 180 */ IS(nexzvec); STRAY15; /* ipl 0x16, nexus 0-15 */ /* 1c0 */ IS(nexzvec); STRAY15; /* ipl 0x17, nexus 0-15 */ .globl _UNIvec _UNIvec: .space 512 # 750 unibus intr vesys/sys/sig.c 444 0 33 34721 2551017307 6442 ((/* sig.c 4.12 81/07/03 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/inode.h" #include "../h/reg.h" #include "../h/text.h" #include "../h/seg.h" #include "../h/mtpr.h" #include "../h/pte.h" #include "../h/psl.h" #include "../h/vm.h" #include "../h/buf.h" #include "../h/vlimit.h" /* * Priority for tracing */ #define IPCPRI PZERO /* * Tracing variables. * Used to pass trace command from * parent to child being traced. * This data base cannot be * shared and is locked * per user. */ struct { int ip_lock; int ip_req; int *ip_addr; int ip_data; } ipc; /* * Send the specified signal to * all processes with 'pgrp' as * process group. * Called by tty.c for quits and * interrupts. */ gsignal(pgrp, sig) register pgrp; { register struct proc *p; if(pgrp == 0) return; for(p = proc; p < procNPROC; p++) if(p->p_pgrp == pgrp) psignal(p, sig); } /* * Send the specified signal to * the specified process. */ psignal(p, sig) register struct proc *p; register int sig; { register s; register int (*action)(); long sigmask; if((unsigned)sig >= NSIG) return; sigmask = (1L << (sig-1)); /* * If proc is traced, always give parent a chance. * Otherwise get the signal action from the bits in the proc table. */ if (p->p_flag & STRC) action = SIG_DFL; else { s = (p->p_siga1&sigmask) != 0; s <<= 1; s |= (p->p_siga0&sigmask) != 0; action = (int(*)())s; /* * If the signal is ignored, we forget about it immediately. */ if (action == SIG_IGN) return; } #define mask(sig) (1<<(sig-1)) #define stops (mask(SIGSTOP)|mask(SIGTSTP)|mask(SIGTTIN)|mask(SIGTTOU)) if (sig) { p->p_sig |= sigmask; switch (sig) { case SIGTERM: if ((p->p_flag&STRC) != 0 || action != SIG_DFL) break; /* fall into ... */ case SIGKILL: if (p->p_nice > NZERO) p->p_nice = NZERO; break; case SIGCONT: p->p_sig &= ~stops; break; case SIGSTOP: case SIGTSTP: case SIGTTIN: case SIGTTOU: p->p_sig &= ~mask(SIGCONT); break; } } #undef mask #undef stops /* * Defer further processing for signals which are held. */ if (action == SIG_HOLD) return; s = spl6(); switch (p->p_stat) { case SSLEEP: /* * If process is sleeping at negative priority * we can't interrupt the sleep... the signal will * be noticed when the process returns through * trap() or syscall(). */ if (p->p_pri <= PZERO) goto out; /* * Process is sleeping and traced... make it runnable * so it can discover the signal in issig() and stop * for the parent. */ if (p->p_flag&STRC) goto run; switch (sig) { case SIGSTOP: case SIGTSTP: case SIGTTIN: case SIGTTOU: /* * These are the signals which by default * stop a process. */ if (action != SIG_DFL) goto run; /* * Don't clog system with children of init * stopped from the keyboard. */ if (sig != SIGSTOP && p->p_pptr == &proc[1]) { psignal(p, SIGKILL); p->p_sig &= ~sigmask; splx(s); return; } /* * If a child in vfork(), stopping could * cause deadlock. */ if (p->p_flag&SVFORK) goto out; p->p_sig &= ~sigmask; p->p_cursig = sig; stop(p); goto out; case SIGTINT: case SIGCHLD: /* * These signals are special in that they * don't get propogated... if the process * isn't interested, forget it. */ if (action != SIG_DFL) goto run; p->p_sig &= ~sigmask; /* take it away */ goto out; default: /* * All other signals cause the process to run */ goto run; } /*NOTREACHED*/ case SSTOP: /* * If traced process is already stopped, * then no further action is necessary. */ if (p->p_flag&STRC) goto out; switch (sig) { case SIGKILL: /* * Kill signal always sets processes running. */ goto run; case SIGCONT: /* * If the process catches SIGCONT, let it handle * the signal itself. If it isn't waiting on * an event, then it goes back to run state. * Otherwise, process goes back to sleep state. */ if (action != SIG_DFL || p->p_wchan == 0) goto run; p->p_stat = SSLEEP; goto out; case SIGSTOP: case SIGTSTP: case SIGTTIN: case SIGTTOU: /* * Already stopped, don't need to stop again. * (If we did the shell could get confused.) */ p->p_sig &= ~sigmask; /* take it away */ goto out; default: /* * If process is sleeping interruptibly, then * unstick it so that when it is continued * it can look at the signal. * But don't setrun the process as its not to * be unstopped by the signal alone. */ if (p->p_wchan && p->p_pri > PZERO) unsleep(p); goto out; } /*NOTREACHED*/ default: /* * SRUN, SIDL, SZOMB do nothing with the signal, * other than kicking ourselves if we are running. * It will either never be noticed, or noticed very soon. */ if (p == u.u_procp && !noproc) aston(); goto out; } /*NOTREACHED*/ run: /* * Raise priority to at least PUSER. */ if (p->p_pri > PUSER) if ((p != u.u_procp || noproc) && p->p_stat == SRUN && (p->p_flag & SLOAD)) { remrq(p); p->p_pri = PUSER; setrq(p); } else p->p_pri = PUSER; setrun(p); out: splx(s); } /* * Returns true if the current * process has a signal to process. * The signal to process is put in p_cursig. * This is asked at least once each time a process enters the * system (though this can usually be done without actually * calling issig by checking the pending signal masks.) * A signal does not do anything * directly to a process; it sets * a flag that asks the process to * do something to itself. */ issig() { register struct proc *p; register int sig; long sigbits; long sigmask; p = u.u_procp; for (;;) { sigbits = p->p_sig; if ((p->p_flag&STRC) == 0) sigbits &= ~p->p_ignsig; if (p->p_flag&SVFORK) #define bit(a) (1<<(a-1)) sigbits &= ~(bit(SIGSTOP)|bit(SIGTSTP)|bit(SIGTTIN)|bit(SIGTTOU)); if (sigbits == 0) break; sig = ffs(sigbits); sigmask = 1L << (sig-1); p->p_sig &= ~sigmask; /* take the signal! */ p->p_cursig = sig; if (p->p_flag&STRC && (p->p_flag&SVFORK)==0) { /* * If traced, always stop, and stay * stopped until released by the parent. */ do { stop(p); swtch(); } while (!procxmt() && p->p_flag&STRC); /* * If parent wants us to take the signal, * then it will leave it in p->p_cursig; * otherwise we just look for signals again. */ sig = p->p_cursig; if (sig == 0) continue; } switch (u.u_signal[sig]) { case SIG_DFL: /* * Don't take default actions on system processes. */ if (p <= &proc[2]) break; switch (sig) { case SIGTSTP: case SIGTTIN: case SIGTTOU: /* * Children of init aren't allowed to stop * on signals from the keyboard. */ if (p->p_pptr == &proc[1]) { psignal(p, SIGKILL); continue; } /* fall into ... */ case SIGSTOP: if (p->p_flag&STRC) continue; stop(p); swtch(); continue; case SIGTINT: case SIGCONT: case SIGCHLD: /* * These signals are normally not * sent if the action is the default. * This can happen only if you reset the * signal action from an action which was * not deferred to SIG_DFL before the * system gets a chance to post the signal. */ continue; /* == ignore */ default: goto send; } /*NOTREACHED*/ case SIG_HOLD: case SIG_IGN: /* * Masking above should prevent us * ever trying to take action on a held * or ignored signal, unless process is traced. */ if ((p->p_flag&STRC) == 0) printf("issig\n"); continue; default: /* * This signal has an action, let * psig process it. */ goto send; } /*NOTREACHED*/ } /* * Didn't find a signal to send. */ p->p_cursig = 0; return (0); send: /* * Let psig process the signal. */ return (sig); } #ifndef vax ffs(mask) register long mask; { register int i; for(i=1; i>= 1; } return(0); } #endif /* * Put the argument process into the stopped * state and notify the parent via wakeup and/or signal. */ stop(p) register struct proc *p; { p->p_stat = SSTOP; p->p_flag &= ~SWTED; wakeup((caddr_t)p->p_pptr); /* * Avoid sending signal to parent if process is traced */ if (p->p_flag&STRC) return; psignal(p->p_pptr, SIGCHLD); } /* * Perform the action specified by * the current signal. * The usual sequence is: * if(issig()) * psig(); * The signal bit has already been cleared by issig, * and the current signal number stored in p->p_cursig. */ psig() { register struct proc *rp = u.u_procp; register int n = rp->p_cursig; long sigmask = 1L << (n-1); register int (*action)(); if (rp->p_cursig == 0) panic("psig"); action = u.u_signal[n]; if (action != SIG_DFL) { if (action == SIG_IGN || action == SIG_HOLD) panic("psig action"); u.u_error = 0; if(n != SIGILL && n != SIGTRAP) u.u_signal[n] = 0; /* * If this catch value indicates automatic holding of * subsequent signals, set the hold value. */ if (SIGISDEFER(action)) { (void) spl6(); if ((int)SIG_HOLD & 1) rp->p_siga0 |= sigmask; else rp->p_siga0 &= ~sigmask; if ((int)SIG_HOLD & 2) rp->p_siga1 |= sigmask; else rp->p_siga1 &= ~sigmask; u.u_signal[n] = SIG_HOLD; (void) spl0(); action = SIGUNDEFER(action); } sendsig(action, n); rp->p_cursig = 0; return; } switch (n) { case SIGILL: case SIGIOT: case SIGBUS: case SIGQUIT: case SIGTRAP: case SIGEMT: case SIGFPE: case SIGSEGV: case SIGSYS: u.u_arg[0] = n; if(core()) n += 0200; } exit(n); } #ifdef unneeded int corestop = 0; #endif /* * Create a core image on the file "core" * If you are looking for protection glitches, * there are probably a wealth of them here * when this occurs to a suid command. * * It writes UPAGES block of the * user.h area followed by the entire * data+stack segments. */ core() { register struct inode *ip;(( extern schar(); #ifdef unneeded if (corestop) { int i; for (i = 0; i < 10; i++) if (u.u_comm[i]) putchar(u.u_comm[i], 0); printf(", uid %d\n", u.u_uid); if (corestop&2) asm("halt"); } #endif if (ctob(UPAGES+u.u_dsize+u.u_ssize) >= u.u_limit[LIM_CORE]) return (0); u.u_error = 0; u.u_dirp = "core"; ip = namei(schar, 1); if(ip == NULL) { if(u.u_error) return(0); ip = maknode(0666); if (ip==NULL) return(0); } if(!access(ip, IWRITE) && (ip->i_mode&IFMT) == IFREG && ip->i_vfdcnt == 0 && u.u_uid == u.u_ruid && ip->i_nlink == 1) { itrunc(ip); u.u_offset = 0; u.u_base = (caddr_t)&u; u.u_count = ctob(UPAGES); u.u_segflg = 1; writei(ip); u.u_base = (char *)ctob(u.u_tsize); u.u_count = ctob(u.u_dsize); u.u_segflg = 0; writei(ip); u.u_base = (char *)(USRSTACK - ctob(u.u_ssize)); u.u_count = ctob(u.u_ssize); writei(ip); } else u.u_error = EFAULT; iput(ip); return(u.u_error==0); } /* * grow the stack to include the SP * true return if successful. */ grow(sp) unsigned sp; { register si; if(sp >= USRSTACK-ctob(u.u_ssize)) return(0); si = clrnd(btoc((USRSTACK-sp)) - u.u_ssize + SINCR); if (ctob(u.u_ssize+si) > u.u_limit[LIM_STACK]) return(0); if (chksize(u.u_tsize, u.u_dsize, u.u_ssize+si)) return(0); if (swpexpand(u.u_dsize, u.u_ssize+si, &u.u_dmap, &u.u_smap)==0) return(0); expand(si, P1BR); return(1); } /* * sys-trace system call. */ ptrace() { register struct proc *p; register struct a { int req; int pid; int *addr; int data; } *uap; uap = (struct a *)u.u_ap; if (uap->req <= 0) { u.u_procp->p_flag |= STRC; return; } p = pfind(uap->pid); if (p == 0 || p->p_stat != SSTOP || p->p_ppid != u.u_procp->p_pid) { u.u_error = ESRCH; return; } while (ipc.ip_lock) sleep((caddr_t)&ipc, IPCPRI); ipc.ip_lock = p->p_pid; ipc.ip_data = uap->data; ipc.ip_addr = uap->addr; ipc.ip_req = uap->req; p->p_flag &= ~SWTED; while (ipc.ip_req > 0) { if (p->p_stat==SSTOP) setrun(p); sleep((caddr_t)&ipc, IPCPRI); } u.u_r.r_val1 = ipc.ip_data; if (ipc.ip_req < 0) u.u_error = EIO; ipc.ip_lock = 0; wakeup((caddr_t)&ipc); } int ipcreg[] = {R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, AP, FP, SP, PC}; /* * Code that the child process * executes to implement the command * of the parent process in tracing. */ procxmt() { register int i; register *p; register struct text *xp; if (ipc.ip_lock != u.u_procp->p_pid) return(0); u.u_procp->p_slptime = 0; i = ipc.ip_req; ipc.ip_req = 0; switch (i) { /* read user I */ case 1: if (!useracc((caddr_t)ipc.ip_addr, 4, B_READ)) goto error; ipc.ip_data = fuiword((caddr_t)ipc.ip_addr); break; /* read user D */ case 2: if (!useracc((caddr_t)ipc.ip_addr, 4, B_READ)) goto error; ipc.ip_data = fuword((caddr_t)ipc.ip_addr); break; /* read u */ case 3: i = (int)ipc.ip_addr; if (i<0 || i >= ctob(UPAGES)) goto error; ipc.ip_data = ((physadr)&u)->r[i>>2]; break; /* write user I */ /* Must set up to allow writing */ case 4: /* * If text, must assure exclusive use */ if (xp = u.u_procp->p_textp) { if (xp->x_count!=1 || xp->x_iptr->i_mode&ISVTX) goto error; xp->x_iptr->i_flag &= ~ITEXT; } i = -1; if (chgprot((caddr_t)ipc.ip_addr, RW) && chgprot((caddr_t)ipc.ip_addr+(sizeof(int)-1), RW)) i = suiword((caddr_t)ipc.ip_addr, ipc.ip_data); (void) chgprot((caddr_t)ipc.ip_addr, RO); (void) chgprot((caddr_t)ipc.ip_addr+(sizeof(int)-1), RO); if (i < 0) goto error; if (xp) xp->x_flag |= XWRIT; break; /* write user D */ case 5: if (suword((caddr_t)ipc.ip_addr, 0) < 0) goto error; (void) suword((caddr_t)ipc.ip_addr, ipc.ip_data); break; /* write u */ case 6: i = (int)ipc.ip_addr; p = (int *)&((physadr)&u)->r[i>>2]; for (i=0; i<16; i++) if (p == &u.u_ar0[ipcreg[i]]) goto ok; if (p == &u.u_ar0[PS]) { ipc.ip_data |= PSL_CURMOD|PSL_PRVMOD; ipc.ip_data &= ~PSL_USERCLR; goto ok; } goto error; ok: *p = ipc.ip_data; break; /* set signal and continue */ /* one version causes a trace-trap */ case 9: case 7: if ((int)ipc.ip_addr != 1) u.u_ar0[PC] = (int)ipc.ip_addr; if ((unsigned)ipc.ip_data > NSIG) goto error; u.u_procp->p_cursig = ipc.ip_data; /* see issig */ if (i == 9) u.u_ar0[PS] |= PSL_T; wakeup((caddr_t)&ipc); return (1); /* force exit */ case 8: wakeup((caddr_t)&ipc); exit(u.u_procp->p_cursig); default: error: ipc.ip_req = -1; } wakeup((caddr_t)&ipc); return(0); } _data; break; /* set signal and continue */sys/sys/slp.c 444 0 33 20034 2552370111 6442 /* slp.c 4.14 81/06/11 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/file.h" #include "../h/inode.h" #include "../h/vm.h" #include "../h/pte.h" #include "../h/inline.h" #include "../h/mtpr.h" #define SQSIZE 0100 /* Must be power of 2 */ #define HASH(x) (( (int) x >> 5) & (SQSIZE-1)) struct proc *slpque[SQSIZE]; /* * Give up the processor till a wakeup occurs * on chan, at which time the process * enters the scheduling queue at priority pri. * The most important effect of pri is that when * pri<=PZERO a signal cannot disturb the sleep; * if pri>PZERO signals will be processed. * Callers of this routine must be prepared for * premature return, and check that the reason for * sleeping has gone away. */ sleep(chan, pri) caddr_t chan; { register struct proc *rp, **hp; register s; rp = u.u_procp; s = spl6(); if (chan==0 || rp->p_stat != SRUN || rp->p_rlink) panic("sleep"); rp->p_wchan = chan; rp->p_slptime = 0; rp->p_pri = pri; hp = &slpque[HASH(chan)]; rp->p_link = *hp; *hp = rp; if(pri > PZERO) { if(ISSIG(rp)) { if (rp->p_wchan) unsleep(rp); rp->p_stat = SRUN; (void) spl0(); goto psig; } if (rp->p_wchan == 0) goto out; rp->p_stat = SSLEEP; (void) spl0(); swtch(); if(ISSIG(rp)) goto psig; } else { rp->p_stat = SSLEEP; (void) spl0(); swtch(); } out: splx(s); return; /* * If priority was low (>PZERO) and * there has been a signal, * execute non-local goto to * the qsav location. * (see trap1/trap.c) */ psig: longjmp(u.u_qsav); /*NOTREACHED*/ } /* * Sleep on chan at pri. * Return in no more than the indicated number of seconds. * (If seconds==0, no timeout implied) * Return TS_OK if chan was awakened normally * TS_TIME if timeout occurred * TS_SIG if asynchronous signal occurred */ tsleep(chan, pri, seconds) caddr_t chan; { label_t lqsav; register struct proc *pp; register sec, n, rval; pp = u.u_procp; n = spl7(); sec = 0; rval = 0; if (pp->p_clktim && pp->p_clktimp_flag |= STIMO; sec = pp->p_clktim-seconds; pp->p_clktim = seconds; } bcopy((caddr_t)u.u_qsav, (caddr_t)lqsav, sizeof (label_t)); if (setjmp(u.u_qsav)) rval = TS_SIG; else { sleep(chan, pri); if ((pp->p_flag&STIMO)==0 && seconds) rval = TS_TIME; else rval = TS_OK; } pp->p_flag &= ~STIMO; bcopy((caddr_t)lqsav, (caddr_t)u.u_qsav, sizeof (label_t)); if (sec > 0) pp->p_clktim += sec; else pp->p_clktim = 0; splx(n); return(rval); } /* * Remove a process from its wait queue */ unsleep(p) register struct proc *p; { register struct proc **hp; register s; s = spl6(); if (p->p_wchan) { hp = &slpque[HASH(p->p_wchan)]; while (*hp != p) hp = &(*hp)->p_link; *hp = p->p_link; p->p_wchan = 0; } splx(s); } /* * Wake up all processes sleeping on chan. */ wakeup(chan) register caddr_t chan; { register struct proc *p, **q, **h; int s; s = spl6(); h = &slpque[HASH(chan)]; restart: for (q = h; p = *q; ) { if (p->p_rlink || p->p_stat != SSLEEP && p->p_stat != SSTOP) panic("wakeup"); if (p->p_wchan==chan) { p->p_wchan = 0; *q = p->p_link; p->p_slptime = 0; if (p->p_stat == SSLEEP) { /* OPTIMIZED INLINE EXPANSION OF setrun(p) */ p->p_stat = SRUN; if (p->p_flag & SLOAD) setrq(p); if(p->p_pri < curpri) { runrun++; aston(); } if ((p->p_flag&SLOAD) == 0) { if (runout != 0) { runout = 0; wakeup((caddr_t)&runout); } wantin++; } /* END INLINE EXPANSION */ goto restart; } } else q = &p->p_link; } splx(s); } /* * Initialize the (doubly-linked) run queues * to be empty. */ rqinit() { register int i; for (i = 0; i < NQS; i++) qs[i].ph_link = qs[i].ph_rlink = (struct proc *)&qs[i]; } /* * Set the process running; * arrange for it to be swapped in if necessary. */ setrun(p) register struct proc *p; { register s; s = spl6(); switch (p->p_stat) { case 0: case SWAIT: case SRUN: case SZOMB: default: panic("setrun"); case SSTOP: case SSLEEP: unsleep(p); /* e.g. when sending signals */ break; case SIDL: break; } p->p_stat = SRUN; if (p->p_flag & SLOAD) setrq(p); splx(s); if(p->p_pri < curpri) { runrun++; aston(); } if ((p->p_flag&SLOAD) == 0) { if(runout != 0) { runout = 0; wakeup((caddr_t)&runout); } wantin++; } } /* * Set user priority. * The rescheduling flag (runrun) * is set if the priority is better * than the currently running process. */ setpri(pp) register struct proc *pp; { register p; p = (pp->p_cpu & 0377)/4; p += PUSER + 2*(pp->p_nice - NZERO); if (pp->p_rssize > pp->p_maxrss && freemem < desfree) p += 2*4; /* effectively, nice(4) */ if(p > 127) p = 127; if(p < curpri) { runrun++; aston(); } pp->p_usrpri = p; return(p); } /* * Create a new process-- the internal version of * sys fork. * It returns 1 in the new process, 0 in the old. */ newproc(isvfork) { register struct proc *p; register struct proc *rpp((, *rip; register int n; p = NULL; /* * First, just locate a slot for a process * and copy the useful info from this process into it. * The panic "cannot happen" because fork has already * checked for the existence of a slot. */ retry: mpid++; if(mpid >= 30000) { mpid = 0; goto retry; } for(rpp = proc; rpp < procNPROC; rpp++) { if(rpp->p_stat == NULL && p==NULL) p = rpp; if (rpp->p_pid==mpid || rpp->p_pgrp==mpid) goto retry; } if ((rpp = p)==NULL) panic("no procs"); /* * make proc entry for new proc */ rip = u.u_procp; rpp->p_stat = SIDL; rpp->p_clktim = 0; rpp->p_flag = SLOAD | (rip->p_flag & (SPAGI|SDETACH|SNUSIG)); if (isvfork) { rpp->p_flag |= SVFORK; rpp->p_ndx = rip->p_ndx; } else rpp->p_ndx = rpp - proc; rpp->p_uid = rip->p_uid; rpp->p_pgrp = rip->p_pgrp; rpp->p_nice = rip->p_nice; rpp->p_textp = isvfork ? 0 : rip->p_textp; rpp->p_pid = mpid; rpp->p_ppid = rip->p_pid; rpp->p_pptr = rip; rpp->p_time = 0; rpp->p_cpu = 0; rpp->p_siga0 = rip->p_siga0; rpp->p_siga1 = rip->p_siga1; /* take along any pending signals, like stops? */ if (isvfork) { rpp->p_tsize = rpp->p_dsize = rpp->p_ssize = 0; rpp->p_szpt = clrnd(ctopt(UPAGES)); forkstat.cntvfork++; forkstat.sizvfork += rip->p_dsize + rip->p_ssize; } else { rpp->p_tsize = rip->p_tsize; rpp->p_dsize = rip->p_dsize; rpp->p_ssize = rip->p_ssize; rpp->p_szpt = rip->p_szpt; forkstat.cntfork++; forkstat.sizfork += rip->p_dsize + rip->p_ssize; } rpp->p_rssize = 0; rpp->p_maxrss = rip->p_maxrss; rpp->p_wchan = 0; rpp->p_slptime = 0; rpp->p_pctcpu = 0; rpp->p_cpticks = 0; n = PIDHASH(rpp->p_pid); p->p_idhash = pidhash[n]; pidhash[n] = rpp - proc; /* * make duplicate entries * where needed */ multprog++; for(n=0; nf_count++; if(!isvfork && u.u_vrpages[n]) u.u_ofile[n]->f_inode->i_vfdcnt++; } u.u_cdir->i_count++; if (u.u_rdir) u.u_rdir->i_count++; /* * Partially simulate the environment * of the new process so that when it is actually * created (by copying) it will look right. */ rip->p_flag |= SKEEP; /* prevent parent from being swapped */ if (procdup(rpp, isvfork)) return (1); (void) spl6(); rpp->p_stat = SRUN; setrq(rpp); (void) spl0(); /* SSWAP NOT NEEDED IN THIS CASE AS u.u_pcb.pcb_sswap SUFFICES */ /* rpp->p_flag |= SSWAP; */ rip->p_flag &= ~SKEEP; if (isvfork) { u.u_procp->p_xlink = rpp; u.u_procp->p_flag |= SNOVM; while (rpp->p_flag & SVFORK) sleep((caddr_t)rpp, PZERO - 1); if ((rpp->p_flag & SLOAD) == 0) panic("newproc vfork"); uaccess(rpp, Vfmap, &vfutl); u.u_procp->p_xlink = 0; vpassvm(rpp, u.u_procp, &vfutl, &u, Vfmap); for (n = 0; n < NOFILE; n++) if (vfutl.u_vrpages[n]) { if ((u.u_vrpages[n] = vfutl.u_vrpages[n] - 1) == 0) if (--u.u_ofile[n]->f_inode->i_vfdcnt < 0) panic("newproc i_vfdcnt"); vfutl.u_vrpages[n] = 0; } u.u_procp->p_flag &= ~SNOVM; rpp->p_ndx = rpp - proc; rpp->p_flag |= SVFDONE; wakeup((caddr_t)rpp); } return (0); } pp->p_flag & SLOAD) == 0) panic("newproc vfork"); uaccess(rpp, Vfmap, &vfutl); u.u_procp->p_xlink = 0; vpassvm(rpp, u.u_procp, &vfutl, &u, Vfmap); for (n = 0; n < NOFILE; n++) if (vfutl.u_vrpages[n]) { if ((u.u_vrpages[n] = vfutl.u_vrpages[n] - 1) == 0) if (--u.u_ofile[n]->f_inode->i_vfdcnt < 0) panic("newproc i_vfdcnt"); vfutl.u_vrpages[n] = 0; } u.u_procp->p_flag &= ~SNOVM; rpp->p_ndx = rpp - proc; rpp->p_flag |= SVFDONE; wakeup((caddsys/sys/subr.c 444 0 33 10430 2624052567 6632 /* subr.c 4.8 81/08/31 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/conf.h" #include "../h/inode.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/buf.h" #include "../h/proc.h" /* * Bmap defines the structure of file system storage * by returning the physical block number on a device given the * inode and the logical block number in a file. * When convenient, it also leaves the physical * block number of the next block of the file in rablock * for use in read-ahead. */ daddr_t bmap(ip, bn, rwflg) register struct inode *ip; daddr_t bn; { register i; struct buf *bp, *nbp; int j, sh; daddr_t nb, *bap; dev_t dev; if(bn < 0) { u.u_error = EFBIG; return((daddr_t)0); } dev = ip->i_dev; rablock = 0; /* * blocks 0..NADDR-4 are direct blocks */ if(bn < NADDR-3) { i = bn; nb = ip->i_un.i_addr[i]; if(nb == 0) { if(rwflg==B_READ || (bp = alloc(dev))==NULL) return((daddr_t)-1); nb = dbtofsb(bp->b_blkno); if ((ip->i_mode&IFMT) == IFDIR) /* * Write directory blocks synchronously * so they never appear with garbage in * them on the disk. */ bwrite(bp); else bdwrite(bp); ip->i_un.i_addr[i] = nb; ip->i_flag |= IUPD|ICHG; } if(i < NADDR-4) rablock = ip->i_un.i_addr[i+1]; return(nb); } /* * addresses NADDR-3, NADDR-2, and NADDR-1 * have single, double, triple indirect blocks. * the first step is to determine * how many levels of indirection. */ sh = 0; nb = 1; bn -= NADDR-3; for(j=3; j>0; j--) { sh += NSHIFT; nb <<= NSHIFT; if(bn < nb) break; bn -= nb; } if(j == 0) { u.u_error = EFBIG; return((daddr_t)0); } /* * fetch the first indirect block */ nb = ip->i_un.i_addr[NADDR-j]; if(nb == 0) { if(rwflg==B_READ || (bp = alloc(dev))==NULL) return((daddr_t)-1); nb = dbtofsb(bp->b_blkno); /* * Write synchronously so that indirect blocks * never point at garbage. */ bwrite(bp); ip->i_un.i_addr[NADDR-j] = nb; ip->i_flag |= IUPD|ICHG; } /* * fetch through the indirect blocks */ for(; j<=3; j++) { bp = bread(dev, nb); if(bp->b_flags & B_ERROR) { brelse(bp); return((daddr_t)0); } bap = bp->b_un.b_daddr; sh -= NSHIFT; i = (bn>>sh) & NMASK; nb = bap[i]; if(nb == 0) { if(rwflg==B_READ || (nbp = alloc(dev))==NULL) { brelse(bp); return((daddr_t)-1); } nb = dbtofsb(nbp->b_blkno); if (j < 3 || (ip->i_mode&IFMT) == IFDIR) /* * Write synchronously so indirect blocks * never point at garbage and blocks * in directories never contain garbage. */ bwrite(nbp); else bdwrite(nbp); bap[i] = nb; bdwrite(bp); } else brelse(bp); } /* * calculate read-ahead. */ if(i < NINDIR-1) rablock = bap[i+1]; return(nb); } /* * Pass back c to the user at his location u_base; * update u_base, u_count, and u_offset. Return -1 * on the last character of the user's read. * u_base is in the user address space unless u_segflg is set. */ passc(c) register c; { register id; if((id = u.u_segflg) == 1) *u.u_base = c; else if(id?suibyte(u.u_base, c):subyte(u.u_base, c) < 0) { u.u_error = EFAULT; return(-1); } u.u_count--; u.u_offset++; u.u_base++; return(u.u_count == 0? -1: 0); } #include "ct.h" /* * Pick up and return the next character from the user's * write call at location u_base; * update u_base, u_count, and u_offset. Return -1 * when u_count is exhausted. u_base is in the user's * address space unless u_segflg is set. */ cpass() { register c, id; if(u.u_count == 0) return(-1); if((id = u.u_segflg) == 1) c = *u.u_base; else if((c = id==0?fubyte(u.u_base):fuibyte(u.u_base)) < 0) { u.u_error = EFAULT; return(-1); } u.u_count--; u.u_offset++; u.u_base++; return(c&0377); } /* * Routine which sets a user error; placed in * illegal entries in the bdevsw and cdevsw tables. */ nodev() { u.u_error = ENODEV; } /* * Null routine; placed in insignificant entries * in the bdevsw and cdevsw tables. */ nulldev() { } imin(a, b) { return (a < b ? a : b); } imax(a, b) { return (a > b ? a : b); } struct proc * pfind(pid) int pid; { register struct proc *p; for (p = &proc[pidhash[PIDHASH(pid)]]; p != &proc[0]; p = &proc[p->p_idhash]) if (p->p_pid == pid) return (p); return ((struct proc *)0); } error; placed in * illegal entries in the bdevsw and cdevsw tables. */ nodev() { u.u_error = ENODEV; } /* * Null routine; placed in insignificant entries * in the bdevsw and cdevsw tables. */ nulldev() { } imin(a, b) { sys/sys/symbols.raw 644 0 33 1027 2526706526 7704 # symbols.raw 4.4 81/05/03 _version #dmesg _msgbuf #iostat _dk_busy _dk_time _dk_xfer _dk_wds _tk_nin _tk_nout _dk_seek _cp_time _dk_mspw # _io_info #ps _proc _Usrptmap _usrpt _text _nswap _maxslp _ccpu _ecmx #pstat _inode _text _proc _dz_tty _dz_cnt _cons _file _Usrptmap _usrpt _nswap _swapmap # _dh11 # _ndh11 #vmstat _cp_time _rate _total _deficit _forkstat _sum _firstfree _maxfree # _rectime # _pgintime _dk_xfer _bootime #w _proc _swapdev _Usrptmap _usrpt _nswap _avenrun _bootime /03 _version #dmesg _msgbuf #iostat _dk_busy _dk_time _dk_xfer _dk_wds _tk_nin _tk_nout _dk_seek _cp_time _dk_mspw # _io_info #ps _proc _Usrptmap _usrpt _text _nswap _maxslp _ccpu _ecmx #pstat _inode _text _proc _dz_tty _dz_cnt _cons _file _Usrptmap _usrpt _nswap _swapmap # _dh11 # _ndh11 #vmstat _cp_time _rate _total _deficit _forkstat _sum _firstfree _maxfree # _rectime # _pgintime _dk_xfer _bootime #w _proc _swapdev _Usrptmap _usrpt _nsw((sys/sys/symbols.sort 644 0 33 445 2505217025 10051 _Usrptmap _avenrun _bootime _ccpu _cons _cp_time _deficit _dh11 _dk_busy _dk_mspw _dk_seek _dk_time _dk_wds _dk_xfer _dz_cnt _dz_tty _ecmx _file _firstfree _forkstat _inode _maxfree _maxslp _msgbuf _ndh11 _nswap _proc _rate _sum _swapdev _swapmap _text _tk_nin _tk_nout _total _usrpt _version rptmap _usrpt _nswap _swapmap # _dh11 # _ndh11 #vmstat _cp_time _rate _total _deficit _forkstat _sum _firstfree _max/hL,hL5< /,"sys/sys/sys.c 444 0 33 1603 2503321215 6440 /* sys.c 4.3 81/03/08 */ /* * Indirect driver for controlling tty. */ #include "../h/param.h" #include "../h/systm.h" #include "../h/conf.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/tty.h" #include "../h/proc.h" /*ARGSUSED*/ syopen(dev, flag) { if(u.u_ttyp == NULL || (u.u_procp->p_flag&SDETACH)) { u.u_error = ENXIO; return; } (*cdevsw[major(u.u_ttyd)].d_open)(u.u_ttyd, flag); } /*ARGSUSED*/ syread(dev) { if (u.u_procp->p_flag&SDETACH) { u.u_error = ENXIO; return; } (*cdevsw[major(u.u_ttyd)].d_read)(u.u_ttyd); } /*ARGSUSED*/ sywrite(dev) { if (u.u_procp->p_flag&SDETACH) { u.u_error = ENXIO; return; } (*cdevsw[major(u.u_ttyd)].d_write)(u.u_ttyd); } /*ARGSUSED*/ syioctl(dev, cmd, addr, flag) caddr_t addr; { if (u.u_procp->p_flag&SDETACH) { u.u_error = ENXIO; return; } (*cdevsw[major(u.u_ttyd)].d_ioctl)(u.u_ttyd, cmd, addr, flag); } open)(u.u_ttyd, flag); } /*ARGSUSED*/ syread(dev) { if (u.u_procp->p_flag&SDETACH) { u.u_error = ENXIO; return; } (*sys/sys/sys1.c 444 0 33 35104 2526706535 6565 /* sys1.c 4.12 81/04/28 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/map.h" #include "../h/mtpr.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/buf.h" #include "../h/reg.h" #include "../h/inode.h" #include "../h/seg.h" #include "../h/acct.h" #include "/usr/include/wait.h" #include "../h/pte.h" #include "../h/vm.h" #include "../h/text.h" #include "../h/psl.h" #include "../h/vlimit.h" #include "../h/file.h" /* * exec system call, with and without environments. */ struct execa { char *fname; char **argp; char **envp; }; exec() { ((struct execa *)u.u_ap)->envp = NULL; exece(); } exece() { register nc; register char *cp; register struct buf *bp; register struct execa *uap; int na, ne, ucp, ap, c; int indir, uid, gid; char *sharg; struct inode *ip; swblk_t bno; char cfname[DIRSIZ]; char cfarg[SHSIZE]; if ((ip = namei(uchar, 0)) == NULL) return; bno = 0; bp = 0; indir = 0; uid = u.u_uid; gid = u.u_gid; if (ip->i_mode & ISUID) uid = ip->i_uid; if (ip->i_mode & ISGID) gid = ip->i_gid; again: if(access(ip, IEXEC)) goto bad; if((u.u_procp->p_flag&STRC) && access(ip, IREAD)) goto bad; if((ip->i_mode & IFMT) != IFREG || (ip->i_mode & (IEXEC|(IEXEC>>3)|(IEXEC>>6))) == 0) { u.u_error = EACCES; goto bad; } /* * Read in first few bytes of file for segment sizes, ux_mag: * 407 = plain executable * 410 = RO text * 413 = demand paged RO text * Also an ASCII line beginning with #! is * the file name of a ``shell'' and arguments may be prepended * to the argument list if given here. * * SHELL NAMES ARE LIMITED IN LENGTH. * * ONLY ONE ARGUMENT MAY BE PASSED TO THE SHELL FROM * THE ASCII LINE. */ u.u_base = (caddr_t)&u.u_exdata; u.u_count = sizeof(u.u_exdata); u.u_offset = 0; u.u_segflg = 1; readi(ip); u.u_segflg = 0; if(u.u_error) goto bad; if (u.u_count > sizeof(u.u_exdata) - sizeof(u.u_exdata.Ux_A) && u.u_exdata.ux_shell[0] != '#') { u.u_error = ENOEXEC; goto bad; } switch (u.u_exdata.ux_mag) { case 0407: u.u_exdata.ux_dsize += u.u_exdata.ux_tsize; u.u_exdata.ux_tsize = 0; break; case 0413: case 0410: if (u.u_exdata.ux_tsize == 0) { u.u_error = ENOEXEC; goto bad; } break; default: if (u.u_exdata.ux_shell[0] != '#' || u.u_exdata.ux_shell[1] != '!' || indir) { u.u_error = ENOEXEC; goto bad; } cp = &u.u_exdata.ux_shell[2]; /* skip "#!" */ while (cp < &u.u_exdata.ux_shell[SHSIZE]) { if (*cp == '\t') *cp = ' '; else if (*cp == '\n') { *cp = '\0'; break; } cp++; } if (*cp != '\0') { u.u_error = ENOEXEC; goto bad; } cp = &u.u_exdata.ux_shell[2]; while (*cp == ' ') cp++; u.u_dirp = cp; while (*cp && *cp != ' ') cp++; sharg = NULL; if (*cp) { *cp++ = '\0'; while (*cp == ' ') cp++; if (*cp) { bcopy((caddr_t)cp, (caddr_t)cfarg, SHSIZE); sharg = cfarg; } } bcopy((caddr_t)u.u_dbuf, (caddr_t)cfname, DIRSIZ); indir = 1; iput(ip); ip = namei(schar, 0); if (ip == NULL) return; goto again; } /* * Collect arguments on "file" in swap space. */ na = 0; ne = 0; nc = 0; uap = (struct execa *)u.u_ap; if ((bno = rmalloc(argmap, ctod(clrnd((int) btoc(NCARGS))))) == 0) { swkill(u.u_procp, "exece"); goto bad; } if (bno % CLSIZE) panic("execa rmalloc"); if (uap->argp) for (;;) { ap = NULL; if (indir && (na == 1 || na == 2 && sharg)) ap = (int)uap->fname; else if (uap->argp) { ap = fuword((caddr_t)uap->argp); uap->argp++; } if (ap==NULL && uap->envp) { uap->argp = NULL; if ((ap = fuword((caddr_t)uap->envp)) == NULL) break; uap->envp++; ne++; } if (ap==NULL) break; na++; if(ap == -1) u.u_error = EFAULT; do { if (nc >= NCARGS-1) u.u_error = E2BIG; if (indir && na == 2 && sharg != NULL) c = *sharg++ & 0377; else if ((c = fubyte((caddr_t)ap++)) < 0) u.u_error = EFAULT; if (u.u_error) { if (bp) brelse(bp); bp = 0; goto badarg; } if ((nc&BMASK) == 0) { if (bp) bdwrite(bp); bp = getblk(argdev, (daddr_t)(dbtofsb(bno)+(nc>>BSHIFT))); cp = bp->b_un.b_addr; } nc++; *cp++ = c; } while (c>0); } if (bp) bdwrite(bp); bp = 0; nc = (nc + NBPW-1) & ~(NBPW-1); if (indir) bcopy((caddr_t)cfname, (caddr_t)u.u_dbuf, DIRSIZ); getxfile(ip, nc + (na+4)*NBPW, uid, gid); if (u.u_error) { badarg: for (c = 0; c < nc; c += BSIZE) if (bp = baddr(argdev, dbtofsb(bno)+(c>>BSHIFT))) { bp->b_flags |= B_AGE; /* throw away */ bp->b_flags &= ~B_DELWRI; /* cancel io */ brelse(bp); bp = 0; } goto bad; } /* * copy back arglist */ ucp = USRSTACK - nc - NBPW; ap = ucp - na*NBPW - 3*NBPW; u.u_ar0[SP] = ap; (void) suword((caddr_t)ap, na-ne); nc = 0; for (;;) { ap += NBPW; if (na==ne) { (void) suword((caddr_t)ap, 0); ap += NBPW; } if (--na < 0) break; (void) suword((caddr_t)ap, ucp); do { if ((nc&BMASK) == 0) { if (bp) brelse(bp); bp = bread(argdev, (daddr_t)(dbtofsb(bno)+(nc>>BSHIFT))); bp->b_flags |= B_AGE; /* throw away */ bp->b_flags &= ~B_DELWRI; /* cancel io */ cp = bp->b_un.b_addr; } (void) subyte((caddr_t)ucp++, (c = *cp++)); nc++; } while(c&0377); } (void) suword((caddr_t)ap, 0); (void) suword((caddr_t)ucp, 0); setregs(); bad: if (bp) brelse(bp); if (bno) rmfree(argmap, ctod(clrnd((int) btoc(NCARGS))), bno); iput(ip); } /* * Read in and set up memory for executed file. */ getxfile(ip, nargc, uid, gid) register struct inode *ip; { register size_t ts, ds, ss; int pagi; if (u.u_exdata.ux_mag == 0413) pagi = SPAGI; else pagi = 0; if(u.u_exdata.ux_tsize!=0 && (ip->i_flag&ITEXT)==0 && ip->i_count!=1) { register struct file *fp; for (fp = file; fp < fileNFILE; fp++) if (fp->f_inode == ip && (fp->f_flag&FWRITE)) { u.u_error = ETXTBSY; goto bad; } } /* * find text and data sizes * try them out for possible * exceed of max sizes */ ts = clrnd(btoc(u.u_exdata.ux_tsize)); ds = clrnd(btoc((u.u_exdata.ux_dsize+u.u_exdata.ux_bsize))); ss = clrnd(SSIZE + btoc(nargc)); if (chksize(ts, ds, ss)) goto bad; u.u_cdmap = zdmap; u.u_csmap = zdmap; if (swpexpand(ds, ss, &u.u_cdmap, &u.u_csmap) == NULL) goto bad; /* * At this point, committed to the new image! * Release virtual memory resources of old process, and * initialize the virtual memory of the new process. * If we resulted from vfork(), instead wakeup our * parent who will set SVFDONE when he has taken back * our resources. */ u.u_prof.pr_scale = 0; if ((u.u_procp->p_flag & SVFORK) == 0) vrelvm(); else { u.u_procp->p_flag &= ~SVFORK; u.u_procp->p_flag |= SKEEP; wakeup((caddr_t)u.u_procp); while ((u.u_procp->p_flag & SVFDONE) == 0) sleep((caddr_t)u.u_procp, PZERO - 1); u.u_procp->p_flag &= ~(SVFDONE|SKEEP); } u.u_procp->p_flag &= ~(SPAGI|SSEQL|SUANOM|SNUSIG); u.u_procp->p_flag |= pagi; u.u_dmap = u.u_cdmap; u.u_smap = u.u_csmap; vgetvm(ts, ds, ss); if (pagi == 0) { /* * Read in data segment. */ u((.u_base = (char *)ctob(ts); u.u_offset = sizeof(u.u_exdata)+u.u_exdata.ux_tsize; u.u_count = u.u_exdata.ux_dsize; readi(ip); } xalloc(ip, pagi); if (pagi && u.u_procp->p_textp) vinifod((struct fpte *)dptopte(u.u_procp, 0), PG_FTEXT, u.u_procp->p_textp->x_iptr, 1 + ts/CLSIZE, (int)btoc(u.u_exdata.ux_dsize)); /* THIS SHOULD BE DONE AT A LOWER LEVEL, IF AT ALL */ mtpr(TBIA, 0); /* * set SUID/SGID protections, if no tracing */ if ((u.u_procp->p_flag&STRC)==0) { #ifndef MELB if(u.u_uid != 0) #endif { u.u_uid = uid; u.u_procp->p_uid = uid; } u.u_gid = gid; } else psignal(u.u_procp, SIGTRAP); u.u_tsize = ts; u.u_dsize = ds; u.u_ssize = ss; bad: return; } /* * Clear registers on exec */ setregs() { register int (**rp)(); register i; long sigmask; for(rp = &u.u_signal[0], sigmask = 1L; rp < &u.u_signal[NSIG]; sigmask <<= 1, rp++) { switch (*rp) { case SIG_IGN: case SIG_DFL: case SIG_HOLD: continue; default: /* * Normal or deferring catch; revert to default. */ (void) spl6(); *rp = SIG_DFL; if ((int)*rp & 1) u.u_procp->p_siga0 |= sigmask; else u.u_procp->p_siga1 &= ~sigmask; if ((int)*rp & 2) u.u_procp->p_siga1 |= sigmask; else u.u_procp->p_siga1 &= ~sigmask; (void) spl0(); continue; } } /* for(rp = &u.u_ar0[0]; rp < &u.u_ar0[16];) *rp++ = 0; */ u.u_ar0[PC] = u.u_exdata.ux_entloc + 2; /* skip over entry mask */ for(i=0; irval & 0377) << 8); } /* * Release resources. * Save u. area for parent to look at. * Enter zombie state. * Wake up parent and init processes, * and dispose of children. */ exit(rv) { register int i; register struct proc *p, *q; register struct file *f; register int x; #ifdef PGINPROF vmsizmon(); #endif p = u.u_procp; p->p_flag &= ~(STRC|SULOCK); p->p_flag |= SWEXIT; p->p_clktim = 0; (void) spl6(); if ((int)SIG_IGN & 1) p->p_siga0 = ~0; else p->p_siga0 = 0; if ((int)SIG_IGN & 2) p->p_siga1 = ~0; else p->p_siga1 = 0; (void) spl0(); p->p_cpticks = 0; p->p_pctcpu = 0; for(i=0; ip_flag & SVFORK) == 0) vrelvm(); else { p->p_flag &= ~SVFORK; wakeup((caddr_t)p); while ((p->p_flag & SVFDONE) == 0) sleep((caddr_t)p, PZERO - 1); p->p_flag &= ~SVFDONE; } for(i=0; ip_stat = SZOMB; noproc = 1; i = PIDHASH(p->p_pid); x = p - proc; if (pidhash[i] == x) pidhash[i] = p->p_idhash; else { for (i = pidhash[i]; i != 0; i = proc[i].p_idhash) if (proc[i].p_idhash == x) { proc[i].p_idhash = p->p_idhash; goto done; } panic("exit"); } if (p->p_pid == 1) panic("init died"); done: ((struct xproc *)p)->xp_xstat = rv; /* overlay */ ((struct xproc *)p)->xp_vm = u.u_vm; /* overlay */ vmsadd(&((struct xproc *)p)->xp_vm, &u.u_cvm); for(q = proc; q < procNPROC; q++) if(q->p_pptr == p) { q->p_pptr = &proc[1]; q->p_ppid = 1; wakeup((caddr_t)&proc[1]); /* * Traced processes are killed * since their existence means someone is screwing up. * Stopped processes are sent a hangup and a continue. * This is designed to be ``safe'' for setuid * processes since they must be willing to tolerate * hangups anyways. */ if (q->p_flag&STRC) { q->p_flag &= ~STRC; psignal(q, SIGKILL); } else if (q->p_stat == SSTOP) { psignal(q, SIGHUP); psignal(q, SIGCONT); } /* * Protect this process from future * tty signals, clear TSTP/TTIN/TTOU if pending, * and set SDETACH bit on procs. */ (void) spgrp(q, -1); } wakeup((caddr_t)p->p_pptr); psignal(p->p_pptr, SIGCHLD); swtch(); } wait() { struct vtimes vm; struct vtimes *vp; if ((u.u_ar0[PS] & PSL_ALLCC) != PSL_ALLCC) { wait1(0, (struct vtimes *)0); return; } vp = (struct vtimes *)u.u_ar0[R1]; wait1(u.u_ar0[R0], &vm); if (u.u_error) return; (void) copyout((caddr_t)&vm, (caddr_t)vp, sizeof (struct vtimes)); } /* * Wait system call. * Search for a terminated (zombie) child, * finally lay it to rest, and collect its status. * Look also for stopped (traced) children, * and pass back status from them. */ wait1(options, vp) register options; struct vtimes *vp; { register f; register struct proc *p; f = 0; loop: for(p = proc; p < procNPROC; p++) if(p->p_pptr == u.u_procp) { f++; if(p->p_stat == SZOMB) { u.u_r.r_val1 = p->p_pid; u.u_r.r_val2 = ((struct xproc *)p)->xp_xstat; ((struct xproc *)p)->xp_xstat = 0; if (vp) *vp = ((struct xproc *)p)->xp_vm; vmsadd(&u.u_cvm, &((struct xproc *)p)->xp_vm); ((struct xproc *)p)->xp_vm = zvms; p->p_stat = NULL; p->p_pid = 0; p->p_ppid = 0; p->p_pptr = 0; p->p_sig = 0; p->p_siga0 = 0; p->p_siga1 = 0; p->p_pgrp = 0; p->p_flag = 0; p->p_wchan = 0; p->p_cursig = 0; return; } if (p->p_stat == SSTOP && (p->p_flag&SWTED)==0 && (p->p_flag&STRC || options&WUNTRACED)) { p->p_flag |= SWTED; u.u_r.r_val1 = p->p_pid; u.u_r.r_val2 = (p->p_cursig<<8) | WSTOPPED; return; } } if (f==0) { u.u_error = ECHILD; return; } if (options&WNOHANG) { u.u_r.r_val1 = 0; return; } if ((u.u_procp->p_flag&SNUSIG) && setjmp(u.u_qsav)) { u.u_eosys = RESTARTSYS; return; } sleep((caddr_t)u.u_procp, PWAIT); goto loop; } /* * fork system call. */ fork() { u.u_cdmap = zdmap; u.u_csmap = zdmap; if (swpexpand(u.u_dsize, u.u_ssize, &u.u_cdmap, &u.u_csmap) == 0) { u.u_r.r_val2 = 0; return; } fork1(0); } fork1(isvfork) { register struct proc *p1, *p2; register a; a = 0; p2 = NULL; for(p1 = proc; p1 < procNPROC; p1++) { if (p1->p_stat==NULL && p2==NULL) p2 = p1; else { if (p1->p_uid==u.u_uid && p1->p_stat!=NULL) a++; } } /* * Disallow if * No processes at all; * not su and too many procs owned; or * not su and would take last slot. */ if (p2==NULL) tablefull("proc"); if (p2==NULL || (u.u_uid!=0 && (p2==procNPROC-1 || a>MAXUPRC))) { u.u_error = EAGAIN; if (!isvfork) { (void) vsexpand(0, &u.u_cdmap, 1); (void) vsexpand(0, &u.u_csmap, 1); } goto out; } p1 = u.u_procp; if(newproc(isvfork)) { u.u_r.r_val1 = p1->p_pid; u.u_r.r_val2 = 1; /* child */ u.u_start = time; u.u_acflag = AFORK; return; } u.u_r.r_val1 = p2->p_pid; out: u.u_r.r_val2 = 0; } /* * break system call. * -- bad planning: "break" is a dirty word in C. */ sbreak() { struct a { char *nsiz; }; register int n, d; /* * set n to new data size * set d to new-old */ n = btoc(((struct a *)u.u_ap)->nsiz); if (!u.u_sep) n -= ctos(u.u_tsize) * stoc(1); if (n < 0) n = 0; d = clrnd(n - u.u_dsize); if (ctob(u.u_dsize+d) > u.u_limit[LIM_DATA]) { u.u_error = ENOMEM; return; } if (chksize(u.u_tsize, u.u_dsize+d, u.u_ssize)) return; if (swpexpand(u.u_dsize+d, u.u_ssize, &u.u_dmap, &u.u_smap)==0) return; expand(d, P0BR); } rty word in C. */ sbreak() { struct a { char *nsiz; }; register int n, d; /* * set n to new data size * set d to new-old */ n = btoc(((struct a *)u.u_ap)->nsiz); if (!u.u_sep) n -= ctos(u.u_tsize) * stoc(1); if (n < 0) n = 0; d = clrnd(n - u.u_dsize); if (ctob(u.u_dsize+d) > u.u_limit[LIM_DATA]) { u.u_error = ENOMEM; return; } if (chksize(u.u_tsize, u.u_dsize+d, u.u_ssize)) return; if (swpexpand(u.u_dsize+d,sys/sys/sys2.c 444 0 33 21000 2516240343 6541 /* sys2.c 4.7 81/04/13 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/reg.h" #include "../h/file.h" #include "../h/inode.h" #include "../h/pte.h" #include "../h/vm.h" #include "../h/buf.h" #include "../h/mtpr.h" #include "../h/proc.h" #include "../h/inline.h" /* * READ AND WRITE ARE NEAR DUPLICATES OF EACH OTHER TO SAVE * AS MUCH TIME AS POSSIBLE. */ /* * read system call */ read() { register struct file *fp; register struct inode *ip; register struct a { int fdes; char *cbuf; unsigned count; } *uap; uap = (struct a *)u.u_ap; if ((int)uap->count < 0) { u.u_error = EINVAL; return; } GETF(fp, uap->fdes); if((fp->f_flag&FREAD) == 0) { u.u_error = EBADF; return; } u.u_base = (caddr_t)uap->cbuf; u.u_count = uap->count; u.u_segflg = 0; if ((u.u_procp->p_flag&SNUSIG) && setjmp(u.u_qsav)) { if (u.u_count == uap->count) u.u_eosys = RESTARTSYS; } else if((fp->f_flag&FPIPE) != 0) readp(fp); else { ip = fp->f_inode; if (fp->f_flag&FMP) u.u_offset = 0; else u.u_offset = fp->f_un.f_offset; if((ip->i_mode&(IFCHR&IFBLK)) == 0) plock(ip); readi(ip); if((ip->i_mode&(IFCHR&IFBLK)) == 0) prele(ip); if ((fp->f_flag&FMP) == 0) fp->f_un.f_offset += uap->count-u.u_count; } u.u_r.r_val1 = uap->count-u.u_count; } /* * write system call */ write() { register struct file *fp; register struct inode *ip; register struct a { int fdes; char *cbuf; unsigned count; } *uap; uap = (struct a *)((u.u_ap; if ((int)uap->count < 0) { u.u_error = EINVAL; return; } GETF(fp, uap->fdes); if((fp->f_flag&FWRITE) == 0) { u.u_error = EBADF; return; } u.u_base = (caddr_t)uap->cbuf; u.u_count = uap->count; u.u_segflg = 0; if ((u.u_procp->p_flag&SNUSIG) && setjmp(u.u_qsav)) { if (u.u_count == uap->count) u.u_eosys = RESTARTSYS; } else if((fp->f_flag&FPIPE) != 0) writep(fp); else { ip = fp->f_inode; if (fp->f_flag&FMP) u.u_offset = 0; else u.u_offset = fp->f_un.f_offset; if((ip->i_mode&(IFCHR&IFBLK)) == 0) plock(ip); writei(ip); if((ip->i_mode&(IFCHR&IFBLK)) == 0) prele(ip); if ((fp->f_flag&FMP) == 0) fp->f_un.f_offset += uap->count-u.u_count; } u.u_r.r_val1 = uap->count-u.u_count; } /* * common code for virtual read/write calls * check permissions, set base, count, and offset, * and switch out to readi, writei, or pipe code. */ vrdwr(mode) register mode; { register struct file *fp; register struct inode *ip; register struct pte *pte; int npf, n; register struct a { int fdes; char *cbuf; unsigned count; } *uap; uap = (struct a *)u.u_ap; if ((int)uap->count < 0) { u.u_error = EINVAL; return; } fp = getf(uap->fdes); if(fp == NULL) return; if((fp->f_flag&mode) == 0) { u.u_error = EBADF; return; } u.u_base = (caddr_t)uap->cbuf; u.u_count = uap->count; u.u_segflg = 0; if ((u.u_procp->p_flag&SNUSIG) && setjmp(u.u_qsav)) { if (u.u_count == uap->count) u.u_eosys = RESTARTSYS; } else if((fp->f_flag&FPIPE) != 0) { if(mode == FREAD) readp(fp); else writep(fp); } else { ip = fp->f_inode; if (fp->f_flag&FMP) u.u_offset = 0; else u.u_offset = fp->f_un.f_offset; if((ip->i_mode&IFMT)==IFREG) { if (((int)u.u_base & CLOFSET) || (fp->f_un.f_offset & CLOFSET)) { u.u_error = EINVAL; return; } if (!useracc(u.u_base, u.u_count, B_WRITE)) { u.u_error = EFAULT; return; } } if((ip->i_mode&(IFCHR&IFBLK)) == 0) plock(ip); if((ip->i_mode&IFMT)==IFREG) { pte = vtopte(u.u_procp, btop(u.u_base)); npf = clbase(btop((caddr_t)u.u_count)); if (mode == FWRITE) { for (n = npf; n > 0; n -= CLSIZE) { if (pte->pg_fod==0 && (anycl(pte,pg_vreadm) || anycl(pte, pg_m))) { u.u_count = NBPG * CLSIZE; pte->pg_vreadm = 0; if (anycl(pte, pg_m)) { pte->pg_swapm = 1; pte->pg_m = 0; } distcl(pte); tbiscl(btop(u.u_base)); writei(ip); } else { u.u_base += NBPG * CLSIZE; u.u_offset += NBPG * CLSIZE; } pte += CLSIZE; } u.u_count = uap->count - npf * NBPG; } else if (mode == FREAD && u.u_offset < ip->i_size) { npf = clbase(min((unsigned)npf, btop(ip->i_size - u.u_offset))); u.u_procp->p_rssize -= vmemfree(pte, npf); if (u.u_vrpages[uap->fdes] == 0) ip->i_vfdcnt++; vinifod((struct fpte *)pte, uap->fdes, ip, u.u_offset >> BSHIFT, npf); if (u.u_vrpages[uap->fdes] == 0) ip->i_vfdcnt--; n = npf * NBPG; u.u_base += n; u.u_offset += n; u.u_count -= n; } } if(mode == FREAD) readi(ip); else writei(ip); if((ip->i_mode&(IFCHR&IFBLK)) == 0) prele(ip); if ((fp->f_flag&FMP) == 0) fp->f_un.f_offset += uap->count-u.u_count; } u.u_r.r_val1 = uap->count-u.u_count; } /* * open system call */ open() { register struct inode *ip; register struct a { char *fname; int rwmode; } *uap; uap = (struct a *)u.u_ap; ip = namei(uchar, 0); if(ip == NULL) return; open1(ip, ++uap->rwmode, 0); } /* * creat system call */ creat() { register struct inode *ip; register struct a { char *fname; int fmode; } *uap; uap = (struct a *)u.u_ap; ip = namei(uchar, 1); if(ip == NULL) { if(u.u_error) return; ip = maknode(uap->fmode&07777&(~ISVTX)); if (ip==NULL) return; open1(ip, FWRITE, 2); } else open1(ip, FWRITE, 1); } /* * common code for open and creat. * Check permissions, allocate an open file structure, * and call the device open routine if any. */ open1(ip, mode, trf) register struct inode *ip; register mode; { register struct file *fp; int i; if(trf != 2) { if(mode&FREAD) (void) access(ip, IREAD); if(mode&FWRITE) { (void) access(ip, IWRITE); if((ip->i_mode&IFMT) == IFDIR) u.u_error = EISDIR; } } if(trf==1&&ip->i_vfdcnt) u.u_error = ETXTBSY; if(u.u_error) goto out; if(trf == 1) itrunc(ip); prele(ip); if ((fp = falloc()) == NULL) goto out; fp->f_flag = mode&(FREAD|FWRITE); fp->f_inode = ip; i = u.u_r.r_val1; openi(ip, mode&(FREAD|FWRITE)); if(u.u_error == 0) return; u.u_ofile[i] = NULL; fp->f_count--; out: iput(ip); } /* * close system call */ close() { register struct file *fp; register struct a { int fdes; } *uap; uap = (struct a *)u.u_ap; fp = getf(uap->fdes); if(fp == NULL) return; if (u.u_vrpages[uap->fdes]) { u.u_error = ETXTBSY; return; } u.u_ofile[uap->fdes] = NULL; closef(fp); } /* * seek system call */ seek() { register struct file *fp; register struct a { int fdes; off_t off; int sbase; } *uap; uap = (struct a *)u.u_ap; fp = getf(uap->fdes); if(fp == NULL) return; if(fp->f_flag&(FPIPE|FMP)) { u.u_error = ESPIPE; return; } if(uap->sbase == 1) uap->off += fp->f_un.f_offset; else if(uap->sbase == 2) uap->off += fp->f_inode->i_size; fp->f_un.f_offset = uap->off; u.u_r.r_off = uap->off; } /* * link system call */ link() { register struct inode *ip, *xp; register struct a { char *target; char *linkname; } *uap; uap = (struct a *)u.u_ap; ip = namei(uchar, 0); if(ip == NULL) return; if((ip->i_mode&IFMT)==IFDIR && !suser()) goto out1; ip->i_nlink++; ip->i_flag |= ICHG; iupdat(ip, &time, &time, 1); prele(ip); u.u_dirp = (caddr_t)uap->linkname; xp = namei(uchar, 1); if(xp != NULL) { u.u_error = EEXIST; iput(xp); goto out; } if (u.u_error) goto out; if(u.u_pdir->i_dev != ip->i_dev) { iput(u.u_pdir); u.u_error = EXDEV; goto out; } wdir(ip); out: if (u.u_error) { ip->i_nlink--; ip->i_flag |= ICHG; } out1: iput(ip); } /* * mknod system call */ mknod() { register struct inode *ip; register struct a { char *fname; int fmode; int dev; } *uap; uap = (struct a *)u.u_ap; if(suser()) { ip = namei(uchar, 1); if(ip != NULL) { u.u_error = EEXIST; goto out; } } if(u.u_error) return; ip = maknode(uap->fmode); if (ip == NULL) return; if (uap->dev) { /* * Want to be able to use this to make badblock * inodes, so don't truncate the dev number. */ ip->i_un.i_rdev = uap->dev; ip->i_flag |= IACC|IUPD|ICHG; } out: iput(ip); } /* * access system call */ saccess() { register svuid, svgid; register struct inode *ip; register struct a { char *fname; int fmode; } *uap; uap = (struct a *)u.u_ap; svuid = u.u_uid; svgid = u.u_gid; u.u_uid = u.u_ruid; u.u_gid = u.u_rgid; ip = namei(uchar, 0); if (ip != NULL) { if (uap->fmode&(IREAD>>6)) (void) access(ip, IREAD); if (uap->fmode&(IWRITE>>6)) (void) access(ip, IWRITE); if (uap->fmode&(IEXEC>>6)) (void) access(ip, IEXEC); iput(ip); } u.u_uid = svuid; u.u_gid = svgid; } sys/sys/sys3.c 444 0 33 12125 2503321223 6543 /* sys3.c 4.9 81/03/08 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/mount.h" #include "../h/ino.h" #include "../h/reg.h" #include "../h/buf.h" #include "../h/filsys.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/inode.h" #include "../h/file.h" #include "../h/conf.h" #include "../h/stat.h" #include "../h/inline.h" /* * the fstat system call. */ fstat() { register struct file *fp; register struct a { int fdes; struct stat *sb; } *uap; uap = (struct a *)u.u_ap; fp = getf(uap->fdes); if(fp == NULL) return; stat1(fp->f_inode, uap->sb, fp->f_flag&FPIPE? fp->f_un.f_offset: 0); } /* * the stat system call. */ stat() { register struct inode *ip; register struct a { char *fname; struct stat *sb; } *uap; uap = (struct a *)u.u_ap; ip = namei(uchar, 0); if(ip == NULL) return; stat1(ip, uap->sb, (off_t)0); iput(ip); } /* * The basic routine for fstat and stat: * get the inode and pass appropriate parts back. */ stat1(ip, ub, pipeadj) register struct inode *ip; struct stat *ub; off_t pipeadj; { register struct dinode *dp; register struct buf *bp; struct stat ds; IUPDAT(ip, &time, &time, 0); /* * first copy from inode table */ ds.st_dev = ip->i_dev; ds.st_ino = ip->i_number; ds.st_mode = ip->i_mode; ds.st_nlink = ip->i_nlink; ds.st_uid = ip->i_uid; ds.st_gid = ip->i_gid; ds.st_rdev = (dev_t)ip->i_un.i_rdev; ds.st_size = ip->i_size - pipeadj; /* * next the dates in the disk */ bp = bread(ip->i_dev, itod(ip->i_number)); dp = bp->b_un.b_dino; dp += itoo(ip->i_number); ds.st_atime = dp->di_atime; ds.st_mtime = dp->di_mtime; ds.st_ctime = dp->di_ctime; brelse(bp); if (copyout((caddr_t)&ds, (caddr_t)ub, sizeof(ds)) < 0) u.u_error = EFAULT; } /* * the dup system call. */ dup() { register struct file *fp; register struct a { int fdes; int fdes2; } *uap; register i, m; uap = (struct a *)u.u_ap; m = uap->fdes & ~077; uap->fdes &= 077; fp = getf(uap->fdes); if(fp == NULL) return; if ((m&0100) == 0) { if ((i = ufalloc()) < 0) return; } else { i = uap->fdes2; if (i<0 || i>=NOFILE) { u.u_error = EBADF; return; } if (u.u_vrpages[i]) { u.u_error = ETXTBSY; return; } u.u_r.r_val1 = i; } if (i!=uap->fdes) { if (u.u_ofile[i]!=NULL) closef(u.u_ofile[i]); u.u_ofile[i] = fp; fp->f_count++; } } /* * the mount system call. */ smount() { dev_t dev; register struct inode *ip; register struct mount *mp; struct mount *smp; register struct filsys *fp; struct buf *bp; register stru((ct a { char *fspec; char *freg; int ronly; } *uap; register char *cp; uap = (struct a *)u.u_ap; dev = getmdev(); if(u.u_error) return; u.u_dirp = (caddr_t)uap->freg; ip = namei(uchar, 0); if(ip == NULL) return; if(ip->i_count!=1 || (ip->i_mode&(IFBLK&IFCHR))!=0) goto out; smp = NULL; for(mp = &mount[0]; mp < &mount[NMOUNT]; mp++) { if(mp->m_bufp != NULL) { if(dev == mp->m_dev) goto out; } else if(smp == NULL) smp = mp; } mp = smp; if(mp == NULL) goto out; (*bdevsw[major(dev)].d_open)(dev, !uap->ronly); if(u.u_error) goto out; bp = bread(dev, SUPERB); if(u.u_error) { brelse(bp); goto out1; } mp->m_inodp = ip; mp->m_dev = dev; bp->b_flags |= B_LOCKED; mp->m_bufp = bp; fp = bp->b_un.b_filsys; fp->s_ilock = 0; fp->s_flock = 0; fp->s_ronly = uap->ronly & 1; fp->s_nbehind = 0; fp->s_lasti = 1; u.u_dirp = uap->freg; for (cp = fp->s_fsmnt; cp < &fp->s_fsmnt[sizeof (fp->s_fsmnt) - 1]; ) if ((*cp++ = uchar()) == 0) u.u_dirp--; /* get 0 again */ *cp = 0; brelse(bp); ip->i_flag |= IMOUNT; prele(ip); return; out: u.u_error = EBUSY; out1: iput(ip); } /* * the umount system call. */ sumount() { dev_t dev; register struct inode *ip; register struct mount *mp; struct buf *bp; int stillopen, flag; register struct a { char *fspec; }; dev = getmdev(); if(u.u_error) return; xumount(dev); /* remove unused sticky files from text table */ update(); for(mp = &mount[0]; mp < &mount[NMOUNT]; mp++) if(mp->m_bufp != NULL && dev == mp->m_dev) goto found; u.u_error = EINVAL; return; found: stillopen = 0; for(ip = inode; ip < inodeNINODE; ip++) if (ip->i_number != 0 && dev == ip->i_dev) { u.u_error = EBUSY; return; } else if (ip->i_number != 0 && (ip->i_mode&IFMT) == IFBLK && ip->i_un.i_rdev == dev) stillopen++; ip = mp->m_inodp; ip->i_flag &= ~IMOUNT; plock(ip); iput(ip); if ((bp = getblk(dev, SUPERB)) != mp->m_bufp) panic("umount"); bp->b_flags &= ~B_LOCKED; flag = !bp->b_un.b_filsys->s_ronly; mp->m_bufp = NULL; brelse(bp); mpurge(mp - &mount[0]); if (!stillopen) { (*bdevsw[major(dev)].d_close)(dev, flag); binval(dev); } } /* * Common code for mount and umount. * Check that the user's argument is a reasonable * thing on which to mount, and return the device number if so. */ dev_t getmdev() { dev_t dev; register struct inode *ip; if (!suser()) return(NODEV); ip = namei(uchar, 0); if(ip == NULL) return(NODEV); if((ip->i_mode&IFMT) != IFBLK) u.u_error = ENOTBLK; dev = (dev_t)ip->i_un.i_rdev; if(major(dev) >= nblkdev) u.u_error = ENXIO; iput(ip); return(dev); } v)].d_close)(dev, flag); binval(dev); } } /* * Common code for mount and umount. * Check that the user's argument is a reasonable * thing on which to mount, and return the device number if so. */ dev_t getmdev() { dev_t dev; register struct inode *ip; if (!suser()) return(NODEV); ip = namei(uchar, 0); if(ip == NULL) return(NODEV); if((ip->i_mode&IFMT) != IFBLK) u.u_error = ENOTBLK; dev = (dev_t)ip->i_usys/sys/sys4.c 444 0 33 24322 2624052732 6560 /* sys4.c 4.10 81/07/22 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/reg.h" #include "../h/inode.h" #include "../h/proc.h" #include "../h/clock.h" #include "../h/mtpr.h" #include "../h/timeb.h" #include "../h/times.h" #include "../h/reboot.h" /* * Everything in this file is a routine implementing a system call. */ /* * return the current time (old-style entry) */ gtime() { u.u_r.r_time = time; if (clkwrap()) clkset(); } /* * New time entry-- return TOD with milliseconds, timezone, * DST flag */ ftime() { register struct a { struct timeb *tp; } *uap; struct timeb t; register unsigned ms; uap = (struct a *)u.u_ap; (void) spl7(); t.time = time; ms = lbolt; (void) spl0(); if (ms > hz) { ms -= hz; t.time++; } t.millitm = (1000*ms)/hz; t.timezone = timezone; t.dstflag = dstflag; if (copyout((caddr_t)&t, (caddr_t)uap->tp, sizeof(t)) < 0) u.u_error = EFAULT; if (clkwrap()) clkset(); } /* * Set the time */ stime() { register struct a { time_t time; } *uap; uap = (struct a *)u.u_ap; if(suser()) { bootime += uap->time - time; time = uap->time; clkset(); } } setuid() { register uid; register struct a { int uid; } *uap; uap = (struct a *)u.u_ap; uid = uap->uid; if(u.u_ruid == uid || u.u_uid == uid || suser()) { u.u_uid = uid; u.u_procp->p_uid = uid; u.u_ruid = uid; } } getuid() { u.u_r.r_val1 = u.u_ruid; u.u_r.r_val2 = u.u_uid; } setgid() { register gid; register struct a { int gid; } *uap; uap = (struct a *)u.u_ap; gid = uap->gid; if(u.u_rgid == gid || u.u_gid == gid || suser()) { u.u_gid = gid; u.u_rgid = gid; } } getgid() { u.u_r.r_val1 = u.u_rgid; u.u_r.r_val2 = u.u_gid; } getpid() { u.u_r.r_val1 = u.u_procp->p_pid; u.u_r.r_val2 = u.u_procp->p_ppid; } sync() { update(); } nice() { register n; register struct a { int niceness; } *uap; uap = (struct a *)u.u_ap; n = uap->niceness + u.u_procp->p_nice; if(n >= 2*NZERO) n = 2*NZERO -1; if(n < 0) n = 0; if (n < u.u_procp->p_nice && !suser()) return; u.u_procp->p_nice = n; (void) setpri(u.u_procp); /* IF RUNNING MAY HAVE WRONG p->p_pri, BUT WILL FIX ITSELF QUICKLY */ } /* * Unlink system call. * Hard to avoid races here, especially * in unlinking directories. */ unlink() { register struct inode *ip, *pp; struct a { char *fname; }; pp = namei(uchar, 2); if(pp == NULL) return; /* * Check for unlink(".") * to avoid hanging on the iget */ if (pp->i_number == u.u_dent.d_ino) { ip = pp; ip->i_count++; } else ip = iget(pp->i_dev, u.u_dent.d_ino); if(ip == NULL) goto out1; if((ip->i_mode&IFMT)==IFDIR && !suser()) goto out; /* * Don't unlink a mounted file. */ if (ip->i_dev != pp->i_dev) { u.u_error = EBUSY; goto out; } if (ip->i_flag&ITEXT) xrele(ip); /* try once to free text */ /* if ((ip->i_flag&ITEXT) && ip->i_nlink==1) { u.u_error = ETXTBSY; goto out; } */ u.u_offset -= sizeof(struct direct); u.u_base = (caddr_t)&u.u_dent; u.u_count = sizeof(struct direct); u.u_dent.d_ino = 0; writei(pp); ip->i_nlink--; ip->i_flag |= ICHG; out: iput(ip); out1: iput(pp); } chdir() { chdirec(&u.u_cdir); } chroot() { if (suser()) chdirec(&u.u_rdir); } chdirec(ipp) register struct inode **ipp; { register struct inode *ip; struct a { char *fname; }; ip = namei(uchar, 0); if(ip == NULL) return; if((ip->i_mode&IFMT) != IFDIR) { u.u_error = ENOTDIR; goto bad; } if(access(ip, IEXEC)) goto bad; prele(ip); if (*ipp) { plock(*ipp); iput(*ipp); } *ipp = ip; return; bad: iput(ip); } chmod() { register struct inode *ip; register struct a { char *fname; int fmode; } *uap; uap = (struct a *)u.u_ap; if ((ip = owner()) == NULL) return; ip->i_mode &= ~07777; if (u.u_uid) uap->fmode &= ~ISVTX; ip->i_mode |= uap->fmode&07777; ip->i_flag |= ICHG; if (ip->i_flag&ITEXT && (ip->i_mode&ISVTX)==0) xrele(ip); iput(ip); } chown() { register struct inode *ip; register struct a { char *fname; int uid; int gid; } *uap; uap = (struct a *)u.u_ap; if (!suser() || (ip = owner()) == NULL) return; ip->i_uid = uap->uid; ip->i_gid = uap->gid; ip->i_flag |= ICHG; #ifndef INSECURE ip->i_mode &= ~(ISUID|ISGID); #endif iput(ip); } ssig() { register int (*f)(); struct a { int signo; int (*fun)(); } *uap; register struct proc *p = u.u_procp; register a; long sigmask; uap = (struct a *)u.u_ap; a = uap->signo & SIGNUMMASK; f = uap->fun; if(a<=0 || a>=NSIG || a==SIGKILL || a==SIGSTOP || a==SIGCONT && (f == SIG_IGN || f == SIG_HOLD)) { u.u_error = EINVAL; return; } if ((uap->signo &~ SIGNUMMASK) || (f != SIG_DFL && f != SIG_IGN && SIGISDEFER(f))) u.u_procp->p_flag |= SNUSIG; /* * Don't clobber registers if we are to simulate * a ret+rti. */ if ((uap->signo&SIGDORTI) == 0) u.u_r.r_val1 = (int)u.u_signal[a]; /* * Change setting atomically. */ (void) spl6(); sigmask = 1L << (a-1); if (u.u_signal[a] == SIG_IGN) p->p_sig &= ~sigmask; /* never to be seen again */ u.u_signal[a] = f; if (f != SIG_DFL && f != SIG_IGN && f != SIG_HOLD) f = SIG_CATCH; if ((int)f & 1) p->p_siga0 |= sigmask; else p->p_siga0 &= ~sigmask; if ((int)f & 2) p->p_siga1 |= sigmask; else p->p_siga1 &= ~sigmask; (void) spl0(); /* * Now handle options. */ if (uap->signo & SIGDOPAUSE) { /* * Simulate a PDP11 style wait instrution which * atomically lowers priority, enables interrupts * and hangs. */ pause(); /*NOTREACHED*/ } if (uap->signo & SIGDORTI) u.u_eosys = SIMULATERTI; } kill() { register struct proc *p; register a, sig; register struct a { int pid; int signo; } *uap; int f, priv; uap = (struct a *)u.u_ap; f = 0; a = uap->pid; priv = 0; sig = uap->signo; if (sig < 0) /* * A negative signal means send to process group. */ uap->signo = -uap->signo; if (uap->signo == 0 || uap->signo > NSIG) { u.u_error = EINVAL; return; } if (a > 0 && sig > 0) { p = pfind(a); if (p == 0 || u.u_uid && u.u_uid != p->p_uid) { u.u_error = ESRCH; return; } psignal(p, uap->signo); return; } if (a==-1 && u.u_uid==0) { priv++; a = 0; sig = -1; /* like sending to pgrp */ } else if(a==0) { /* * Zero process id means send to my process group. */ sig = -1; a = u.u_procp->p_pgrp; if (a == 0) { u.u_error = EINVAL; return; } } for(p = proc; p < procNPROC; p++) { if(p->p_stat == NULL) continue; if(sig > 0) { if (p->p_pid != a) continue; } else if (p->p_pgrp!=a && priv==0 || p<=&proc[2] || (p->p_flag&SS((YS) || (priv && p==u.u_procp)) continue; if(u.u_uid != 0 && u.u_uid != p->p_uid && (uap->signo != SIGCONT || !inferior(p))) continue; f++; psignal(p, uap->signo); } if(f == 0) u.u_error = ESRCH; } times() { register struct a { time_t (*times)[4]; } *uap; struct tms tms; tms.tms_utime = u.u_vm.vm_utime; tms.tms_stime = u.u_vm.vm_stime; tms.tms_cutime = u.u_cvm.vm_utime; tms.tms_cstime = u.u_cvm.vm_stime; uap = (struct a *)u.u_ap; if (copyout((caddr_t)&tms, (caddr_t)uap->times, sizeof(struct tms)) < 0) u.u_error = EFAULT; } profil() { register struct a { short *bufbase; unsigned bufsize; unsigned pcoffset; unsigned pcscale; } *uap; uap = (struct a *)u.u_ap; u.u_prof.pr_base = uap->bufbase; u.u_prof.pr_size = uap->bufsize; u.u_prof.pr_off = uap->pcoffset; u.u_prof.pr_scale = uap->pcscale; } /* * alarm clock signal */ alarm() { register struct proc *p; register c; register struct a { int deltat; } *uap; uap = (struct a *)u.u_ap; p = u.u_procp; c = p->p_clktim; p->p_clktim = uap->deltat; u.u_r.r_val1 = c; } /* * indefinite wait. * no one should wakeup(&u) */ pause() { for(;;) sleep((caddr_t)&u, PSLEP); } /* * mode mask for creation of files */ umask() { register struct a { int mask; } *uap; register t; uap = (struct a *)u.u_ap; t = u.u_cmask; u.u_cmask = uap->mask & 0777; u.u_r.r_val1 = t; } /* * Set IUPD and IACC times on file. * Can't set ICHG. */ utime() { register struct a { char *fname; time_t *tptr; } *uap; register struct inode *ip; time_t tv[2]; uap = (struct a *)u.u_ap; if ((ip = owner()) == NULL) return; if (copyin((caddr_t)uap->tptr, (caddr_t)tv, sizeof(tv))) { u.u_error = EFAULT; } else { ip->i_flag |= IACC|IUPD|ICHG; iupdat(ip, &tv[0], &tv[1], 0); } iput(ip); } /* * Setpgrp on specified process and its descendants. * Pid of zero implies current process. * Pgrp -1 is getpgrp system call returning * current process group. */ setpgrp() { register struct proc *top; register struct a { int pid; int pgrp; } *uap; uap = (struct a *)u.u_ap; if (uap->pid == 0) top = u.u_procp; else { top = pfind(uap->pid); if (top == 0) { u.u_error = ESRCH; return; } } if (uap->pgrp <= 0) { u.u_r.r_val1 = top->p_pgrp; return; } #ifdef notdef u.u_r.r_val1 = spgrp(top, uap->pgrp); if (u.u_r.r_val1 == 0) u.u_error = EPERM; #else if (top->p_uid != u.u_uid && u.u_uid && !inferior(top)) u.u_error = EPERM; else top->p_pgrp = uap->pgrp; #endif } spgrp(top, npgrp) register struct proc *top; { register struct proc *pp, *p; int f = 0; for (p = top; npgrp == -1 || u.u_uid == p->p_uid || !u.u_uid || inferior(p); p = pp) { if (npgrp == -1) { #define bit(a) (1<<(a-1)) p->p_sig &= ~(bit(SIGTSTP)|bit(SIGTTIN)|bit(SIGTTOU)); p->p_flag |= SDETACH; } else p->p_pgrp = npgrp; f++; /* * Search for children. */ for (pp = proc; pp < procNPROC; pp++) if (pp->p_pptr == p) goto cont; /* * Search for siblings. */ for (; p != top; p = p->p_pptr) for (pp = p + 1; pp < procNPROC; pp++) if (pp->p_pptr == p->p_pptr) goto cont; break; cont: ; } return (f); } /* * Is p an inferior of the current process? */ inferior(p) register struct proc *p; { for (; p != u.u_procp; p = p->p_pptr) if (p <= &proc[2]) return (0); return (1); } reboot() { register struct a { int opt; }; if (suser()) boot(RB_BOOT, ((struct a *)u.u_ap)->opt); } /* * lock user into core as much * as possible. swapping may still * occur if core grows. */ syslock() { register struct proc *p; register struct a { int flag; } *uap; uap = (struct a *)u.u_ap; if(suser()) { p = u.u_procp; p->p_flag &= ~SULOCK; if(uap->flag) p->p_flag |= SULOCK; } } p; { for (; p != u.u_procp; p = p->p_pptr) if (p <= &proc[2]) return (0); return (1); } reboot() { register struct a { int opt; }; if (suser()) boot(RB_BOOT, ((struct a *)u.u_ap)->opt); } /* * lock user into core as much * as possible. swapping may still * occur if core grows. */sys/sys/sysent.c 444 0 33 6222 2662316745 7173 /* sysent.c 4.4 81/03/08 */ /* * This table is the switch used to transfer * to the appropriate routine for processing a system call. * Each row contains the number of arguments expected * and a pointer to the routine. */ #include "../h/param.h" #include "../h/systm.h" int alarm(); int chdir(); int chmod(); int chown(); int chroot(); int close(); int creat(); int dup(); int exec(); int exece(); int fork(); int fstat(); int getgid(); int getpid(); int getuid(); int gtime(); int gtty(); int ioctl(); int kill(); int link(); int mknod(); int mpxchan(); int nice(); int ftime(); int nosys(); int nullsys(); int open(); int pause(); int pipe(); int profil(); int ptrace(); int read(); int reboot(); int rexit(); int saccess(); int sbreak(); int seek(); int setgid(); int setpgrp(); int setuid(); int smount(); int ssig(); int stat(); int stime(); int stty(); int sumount(); int sync(); int sysacct(); int syslock(); int sysphys(); int times(); int umask(); int unlink(); int utime(); int wait(); int write(); #include "../h/vmsysent.h" struct sysent sysent[128] = { 0, nosys, /* 0 = indir */ 1, rexit, /* 1 = exit */ 0, fork, /* 2 = fork */ 3, read, /* 3 = read */ 3, write, /* 4 = write */ 2, open, /* 5 = open */ 1, close, /* 6 = close */ 0, wait, /* 7 = wait */ 2, creat, /* 8 = creat */ 2, link, /* 9 = link */ 1, unlink, /* 10 = unlink */ 2, exec, /* 11 = exec */ 1, chdir, /* 12 = chdir */ 0, gtime, /* 13 = time */ 3, mknod, /* 14 = mknod */ 2, chmod, /* 15 = chmod */ 3, chown, /* 16 = chown; now 3 args */ 1, sbreak, /* 17 = break */ 2, stat, /* 18 = stat */ 3, seek, /* 19 = seek */ 0, getpid, /* 20 = getpid */ 3, smount, /* 21 = mount */ 1, sumount, /* 22 = umount */ 1, setuid, /* 23 = setuid */ 0, getuid, /* 24 = getuid */ 1, stime, /* 25 = stime */ 4, ptrace, /* 26 = ptrace */ 1, alarm, /* 27 = alarm */ 2, fstat, /* 28 = fstat */ 0, pause, /* 29 = pause */ 2, utime, /* 30 = utime */ 2, stty, /* 31 = stty */ 2, gtty, /* 32 = gtty */ 2, saccess, /* 33 = access */ 1, nice, /* 34 = nice */ 1, ftime, /* 35 = ftime; formally sleep; */ 0, sync, /* 36 = sync */ 2, kill, /* 37 = kill */ 0, nullsys, /* 38 = switch; inoperative */ 2, setpgrp, /* 39 = setpgrp */ 0, nosys, /* 40 = tell - obsolete */ 2, dup, /* 41 = dup */ 0, pipe, /* 42 = pipe */ 1, times, /* 43 = times */ 4, profil, /* 44 = prof */ 0, nosys, /* 45 = tiu */ 1, setgid, /* 46 = setgid */ 0, getgid, /* 47 = getgid */ 2, ssig, /* 48 = sig */ 0, nosys, /* 49 = reserved for USG */ 0, nosys, /* 50 = reserved for USG */ 1, sysacct, /* 51 = turn acct off/on */ 3, sysphys, /* 52 = set user physical addresses */ 1, syslock, /* 53 = lock user in core */ 3, ioctl, /* 54 = ioctl */ 1, reboot, /* 55 = reboot */ 4, mpxchan, /* 56 = creat mpx comm channel */ 0, nosys, /* 57 = reserved for USG */ 0, nosys, /* 58 = reserved for USG */ 3, exece, /* 59 = exece */ 1, umask, /* 60 = umask */ 1, chroot, /* 61 = chroot */ 0, nosys, /* 62 = reserved to local sites */ 0, nosys, /* 63 = used internally */ #include "../sys/vmsysent.c" }; ff/on */ 3, sysphys, /* 52 = set user physical addresses */ 1, syslock, /* 53 = lock user in core */ 3, ioctl, /* 54 = ioctl */ 1, reboot, /* 55 = reboot */ 4, mpxchan, /* 56 = creat mpx comm channel */ 0, nosys, /* 57 = reserved for USG */ 0, nosys, /* 58 = reserved for USG */ 3, exece, /* 59 = exece */ 1, umask, /* 60 = umask */ 1, chsys/sys/text.c 444 0 33 13136 2503321230 6627 /* text.c 4.5 81/03/08 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/map.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/text.h" #include "../h/inode.h" #include "../h/buf.h" #include "../h/seg.h" #include "../h/pte.h" #include "../h/mtpr.h" #include "../h/vm.h" #include "../h/cmap.h" /* * relinquish use of the shared text segment * of a process. */ xfree() { register struct text *xp; register struct inode *ip; if((xp=u.u_procp->p_textp) == NULL) return; xlock(xp); ip = xp->x_iptr; if(--xp->x_count==0 && (ip->i_mode&ISVTX)==0) { xunlink(u.u_procp); xp->x_rssize -= vmemfree(tptopte(u.u_procp, 0), u.u_tsize); if (xp->x_rssize != 0) panic("xfree rssize"); ip->i_flag &= ~ITEXT; if (ip->i_flag&ILOCK) ip->i_count--; else iput(ip); while (xp->x_poip) sleep((caddr_t)&xp->x_poip, PSWP+1); vsxfree(xp, xp->x_size); xp->x_flag &= ~XLOCK; xp->x_iptr = NULL; } else { xp->x_flag &= ~XLOCK; xccdec(xp, u.u_procp); } u.u_procp->p_textp = NULL; } /* * Attach to a shared text segment. * If there is no shared text, just return. * If there is, hook up to it: * if it is not currently being used, it has to be read * in from the inode (ip); the written bit is set to force it * to be written out as appropriate. * If it is being used, but is not currently in core, * a swap has to be done to get it back. */ xalloc(ip, pagi) register struct inode *ip; { register struct text *xp; register size_t ts; register struct tex((t *xp1; if(u.u_exdata.ux_tsize == 0) return; again: xp1 = NULL; for (xp = text; xp < textNTEXT; xp++) { if(xp->x_iptr == NULL) { if(xp1 == NULL) xp1 = xp; continue; } if ((xp->x_count > 0 || (xp->x_iptr->i_mode&ISVTX)) && xp->x_iptr == ip) { if (xp->x_flag&XLOCK) { xwait(xp); goto again; } xlock(xp); xp->x_count++; u.u_procp->p_textp = xp; xlink(u.u_procp); xunlock(xp); return; } } if((xp=xp1) == NULL) { tablefull("text"); psignal(u.u_procp, SIGKILL); return; } xp->x_flag = XLOAD|XLOCK; if (pagi) xp->x_flag |= XPAGI; ts = clrnd(btoc(u.u_exdata.ux_tsize)); xp->x_size = ts; if (vsxalloc(xp) == NULL) { swkill(u.u_procp, "xalloc"); return; } xp->x_count = 1; xp->x_ccount = 0; xp->x_rssize = 0; xp->x_iptr = ip; ip->i_flag |= ITEXT; ip->i_count++; u.u_procp->p_textp = xp; xlink(u.u_procp); if (pagi == 0) { u.u_count = u.u_exdata.ux_tsize; u.u_offset = sizeof(u.u_exdata); u.u_base = 0; u.u_segflg = 2; settprot(RW); u.u_procp->p_flag |= SKEEP; readi(ip); u.u_procp->p_flag &= ~SKEEP; } settprot(RO); u.u_segflg = 0; xp->x_flag |= XWRIT; xp->x_flag &= ~XLOAD; xunlock(xp); } /* * Lock and unlock a text segment from swapping */ xlock(xp) register struct text *xp; { while(xp->x_flag&XLOCK) { xp->x_flag |= XWANT; sleep((caddr_t)xp, PSWP); } xp->x_flag |= XLOCK; } /* * Wait for xp to be unlocked if it is currently locked. */ xwait(xp) register struct text *xp; { xlock(xp); xunlock(xp); } xunlock(xp) register struct text *xp; { if (xp->x_flag&XWANT) wakeup((caddr_t)xp); xp->x_flag &= ~(XLOCK|XWANT); } /* * Decrement the in-core usage count of a shared text segment. * When it drops to zero, free the core space. */ xccdec(xp, p) register struct text *xp; register struct proc *p; { if (xp==NULL || xp->x_ccount==0) return; xlock(xp); if (--xp->x_ccount == 0) { if (xp->x_flag & XWRIT) { vsswap(p, tptopte(p, 0), CTEXT, 0, xp->x_size, (struct dmap *)0); if (xp->x_flag & XPAGI) swap(p, xp->x_ptdaddr, (caddr_t)tptopte(p, 0), xp->x_size * sizeof (struct pte), B_WRITE, B_PAGET, swapdev, 0); xp->x_flag &= ~XWRIT; } else xp->x_rssize -= vmemfree(tptopte(p, 0), xp->x_size); if (xp->x_rssize != 0) panic("text rssize"); } xunlink(p); xunlock(xp); } /* * free the swap image of all unused saved-text text segments * which are from device dev (used by umount system call). */ xumount(dev) register dev; { register struct text *xp; for (xp = text; xp < textNTEXT; xp++) if (xp->x_iptr!=NULL && dev==xp->x_iptr->i_dev) xuntext(xp); } /* * remove a shared text segment from the text table, if possible. */ xrele(ip) register struct inode *ip; { register struct text *xp; if ((ip->i_flag&ITEXT)==0) return; for (xp = text; xp < textNTEXT; xp++) if (ip==xp->x_iptr) xuntext(xp); } /* * remove text image from the text table. * the use count must be zero. */ xuntext(xp) register struct text *xp; { register struct inode *ip; xlock(xp); if (xp->x_count) { xunlock(xp); return; } ip = xp->x_iptr; xp->x_flag &= ~XLOCK; xp->x_iptr = NULL; vsxfree(xp, xp->x_size); ip->i_flag &= ~ITEXT; if (ip->i_flag&ILOCK) ip->i_count--; else iput(ip); } /* * Add a process to those sharing a text segment by * getting the page tables and then linking to x_caddr. */ xlink(p) register struct proc *p; { register struct text *xp = p->p_textp; if (xp == 0) return; vinitpt(p); p->p_xlink = xp->x_caddr; xp->x_caddr = p; xp->x_ccount++; } xunlink(p) register struct proc *p; { register struct text *xp = p->p_textp; register struct proc *q; if (xp == 0) return; if (xp->x_caddr == p) { xp->x_caddr = p->p_xlink; p->p_xlink = 0; return; } for (q = xp->x_caddr; q->p_xlink; q = q->p_xlink) if (q->p_xlink == p) { q->p_xlink = p->p_xlink; p->p_xlink = 0; return; } panic("lost text"); } /* * Replace p by q in a text incore linked list. * Used by vfork(), internally. */ xrepl(p, q) struct proc *p, *q; { register struct text *xp = q->p_textp; if (xp == 0) return; xunlink(p); q->p_xlink = xp->x_caddr; xp->x_caddr = q; } xp == 0) return; if (xp->x_caddr == p) { xp->x_caddr = p->p_xlink; p->p_xlink = 0; return; } for (q = xp->x_caddr; q->p_xlink; q = q->p_xlink) if (q->p_xlink == p) { q->p_xlink = p->p_xlink; p->p_xlink = 0; return; } panic("lost text"); } /* * Replace p by q in a text incore linked list. * Used by vfork(), internally. */ xrepl(p, q) struct proc *p, *q; { register struct text *xp = q->sys/sys/trap.c 444 0 33 11562 2552574232 6632 /* trap.c 4.10 81/07/09 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/reg.h" #include "../h/seg.h" #include "../h/trap.h" #include "../h/psl.h" #include "../h/pte.h" #include "../h/inline.h" #include "../h/mtpr.h" #define USER 040 /* user-mode flag added to type */ struct sysent sysent[128]; /* * Called from the trap handler when a processor trap occurs. */ /*ARGSUSED*/ trap(sp, type, code, pc, psl) unsigned code; { register int *locr0 = ((int *)&psl)-PS; register int i; register struct proc *p; time_t syst; syst = u.u_vm.vm_stime; if (USERMODE(locr0[PS])) { type |= USER; u.u_ar0 = locr0; } switch (type) { default: printf("trap type %d, code = %x, pc = %x\n", type, code, pc); panic("trap"); case PROTFLT + USER: /* protection fault */ i = SIGBUS; break; case PRIVINFLT + USER: /* privileged instruction fault */ case RESADFLT + USER: /* reserved addressing fault */ case RESOPFLT + USER: /* resereved operand fault */ u.u_code = type &~ USER; i = SIGILL; break; case ASTFLT + USER: /* Allow process switch */ astoff(); if ((u.u_procp->p_flag & SOWEUPC) && u.u_prof.pr_scale) { addupc(pc, &u.u_prof, 1); u.u_procp->p_flag &= ~SOWEUPC; } goto out; case ARITHTRAP + USER: u.u_code = code; i = SIGFPE; break; /* * If the user SP is above the stack segment, * grow the stack automatically. */ case SEGFLT + USER: if (grow((unsigned)locr0[SP]) || grow(code)) goto out; i = SIGSEGV; break; case TABLEFLT: /* allow page table faults in kernel mode */ case TABLEFLT + USER: /* page table fault */ panic("ptable fault"); case PAGEFLT: /* allow page faults in kernel mode */ case PAGEFLT + USER: /* page fault */ i = u.u_error; pagein(code); u.u_error = i; if (type == PAGEFLT) return; goto out; case BPTFLT + USER: /* bpt instruction fault */ case TRCTRAP + USER: /* trace trap */ locr0[PS] &= ~PSL_T; i = SIGTRAP; break; case XFCFLT + USER: /* xfc instruction fault */ i = SIGEMT; break; case COMPATFLT + USER: /* compatibility mode fault */ u.u_code = code; i = SIGILL; break; } psignal(u.u_procp, i); out: p = u.u_procp; if (p->p_cursig || ISSIG(p)) psig(); p->p_pri = p->p_usrpri; if (runrun) { /* * Since we are u.u_procp, clock will normally just change * our priority without moving us from one queue to another * (since the running process is not on a queue.) * If that happened after we setrq ourselves but before we * swtch()'ed, we might not be on the queue indicated by * our priority. */ (void) spl6(); setrq(p); swtch(); } if (u.u_prof.pr_scale && (syst -= u.u_vm.vm_stime)) addupc(locr0[PC], &u.u_prof, (int)-syst); curpri = p->p_pri; } /* * Called from the trap handler when a system call occurs */ /*ARGSUSED*/ syscall(sp, type, code, pc, psl) unsigned code; { register int *locr0 = ((int *)&psl)-PS; register caddr_t params; /* known to be r10 below */ register int i; /* known to be r9 below */ register struct sysent *callp; register struct proc *p; time_t syst; int opc; syst = u.u_vm.vm_stime; if (!USERMODE(locr0[PS])) panic("syscall"); u.u_ar0 = locr0; params = (caddr_t)locr0[AP] + NBPW; u.u_error = 0; opc = pc - 2; if (code > 63) opc -= 2; callp = &sysent[code&0177]; if (callp == sysent) { i = fuword(params); params += NBPW; callp = &sysent[i&0177]; } if (i = callp->sy_narg * sizeof (int)) { asm("prober $3,r9,(r10)"); /* GROT */ asm("bnequ ok"); /* GROT */ u.u_error = EFAULT; /* GROT */ goto bad; /* GROT */ asm("ok:"); /* GROT */ asm("movc3 r9,(r10),_u+U_ARG"); /* GROT */ } u.u_ap = u.u_arg; u.u_dirp = (caddr_t)u.u_arg[0]; u.u_r.r_val1 = 0; u.u_r.r_val2 = locr0[R1]; if (setjmp(u.u_qsav)) { if (u.u_error == 0 && u.u_eosys == JUSTRETURN) u.u_error = EINTR; } else { u.u_eosys = JUSTRETURN; (*(callp->sy_call))(); } locr0[PS] &= ~PSL_C; if (u.u_eosys == RESTARTSYS) pc = opc; else if (u.u_eosys == SIMULATERTI) dorti(); else if (u.u_error) { bad: locr0[R0] = u.u_error; locr0[PS] |= PSL_C; /* carry bit */ } else { locr0[R0] = u.u_r.r_val1; locr0[R1] = u.u_r.r_val2; } p = u.u_procp; if (p->p_cursig || ISSIG(p)) psig(); p->p_pri = p->p_usrpri; if (runrun) { /* * Since we are u.u_procp, clock will normally just change * our priority without moving us from one queue to another * (since the running process is not on a queue.) * If that happened after we setrq ourselves but before we * swtch()'ed, we might not be on the queue indicated by * our priority. */ (void) spl6(); setrq(p); swtch(); } if (u.u_prof.pr_scale && (syst -= u.u_vm.vm_stime)) addupc(locr0[PC], &u.u_prof, (int)-syst); curpri = p->p_pri; } /* * nonexistent system call-- set fatal error code. */ nosys() { u.u_error = 100; } /* * Ignored system call */ nullsys() { } queue to another * (since the running process is not on a queue.) * If that happened after we setrq ourselves but before we * swtch()((sys/sys/udiv.s 444 0 33 2175 2340667532 6634 # # udiv - unsigned division for vax-11 # # arguments: dividend, divisor. # result: quotient. # uses r0-r2 # # If 1 < divisor <= 2147483647, zero-extend the dividend # to 64 bits and let ediv do the work. If the divisor is 1, # ediv will overflow if bit 31 of the dividend is on, so # just return the dividend unchanged. If the divisor is 0, # do the ediv also, so it will generate the proper exception. # All other values of the divisor have bit 31 on: in this case # the quotient must be 0 if divisor > dividend, and 1 otherwise, # provided that the comparison is made as unsigned. # .text .align 1 .globl udiv udiv: .word 0x0000 movl 4(ap),r0 # Dividend movl 8(ap),r2 # Divisor jeql div # If divisor=0, force exception cmpl r2,$1 # If divisor <= 1 (signed), jleq nodiv # no division is necessary div: clrl r1 # Zero-extend the dividend ediv r2,r0,r0,r2 # Divide. q->r0, r->r2 (discarded) ret nodiv: jeql retn # If divisor=1, return dividend cmpl r0,r2 # Unsigned comparison between jgequ one # dividend and divisor clrl r0 # Dividend < divisor, return 0 ret one: movl $1,r0 # Dividend >= divisor, return 1 retn: ret movl 4(ap),r0 # Dividend movl 8(ap),r2 # Divisor jeql div # If divisor=0, force exception cmpl r2,$1 # If divisor <= 1 (signed), jleq nodiv # no division is necessary div: clrl r1 # Zero-extend the dividend ediv r2,r0,r0,r2 # Divide. q->r0, r->r2 (discarded) ret nodiv: jeql retn # If divisor=1, return dividend cmpl r0,r2 # Unsigned comparison between jgequ one # divsys/sys/urem.s 444 0 33 2304 2340667532 6627 # # urem - unsigned remainder for vax-11 # # arguments: dividend, divisor # result: remainder # uses r0-r2 # # if 1 < divisor <= 2147483647, zero-extend the dividend # to 64 bits and let ediv do the work. If the divisor is 1, # ediv will overflow if bit 31 of the dividend is on, so # just return 0. If the divisor is 0, do the ediv also, # so it will generate the proper exception. All other values # of the divisor have bit 31 on: in this case the remainder # must be the dividend if divisor > dividend, and the dividend # minus the divisor otherwise. The comparison must be unsigned. # .text .align 1 .globl urem urem: .word 0x0000 movl 4(ap),r0 # Dividend movl 8(ap),r2 # Divisor jeql div # If divisor=0, force exception cmpl r2,$1 # If divisor <= 1 (signed), jleq nodiv # no division is necessary div: clrl r1 # Zero-extend the dividend ediv r2,r0,r2,r0 # Divide. q->r2 (discarded), r->r0 ret nodiv: jneq nzero # If divisor=1, return 0 clrl r0 # (because doing the divide will overflow ret # if the dividend has its high bit on) nzero: cmpl r0,r2 # If dividend < divisor (unsigned) jlssu retn # remainder is dividend subl2 r2,r0 # else remainder is dividend - divisor retn: ret divisor=0, force exception cmpl r2,$1 # If divisor <= 1 (signed), jleq nodiv # no division is necessary div: clrl r1 # Zero-extend the dividend ediv r2,r0,r2,r0 # Divide. q->r2 (discarded), r->r0 ret nodiv: jneq nzero # If divisor=1, return 0 clrl r0 # (because doing the divide will overflow ret # sys/sys/TODO 444 0 33 2666 2516564230 6172 /* TODO 4.10 81/04/15 */ 1. Minor - Put u.u_ttyd in proc structure and fix sys.c (/dev/tty) and chfile() - Turn the u. and kernel stack around and use a virtual hole as redzone - Hash the process groups in the proc table so wakeups are fast - Use pointers for process hashing, not indices. - Also use pointers in inode table. - Discard init code after boot. - Allocate spt at boot - Cleanup handling of file table. - Add child and sibling pointers in proc table. - Remove all linear searches of tables. - Deal with dh NXM problem - Test rm80 sse code - Find and fix ttrstrt problem - Why did up drive give i/o errors after uba reset when tape was hung? - Incorporate good stuff from ghg's system - Fix rpb autorestart - Handle sbi alert/fault - Get multi-porting code to work 2. Error logging/handling - Improve error logging, by adding a binary error log file - Write a user mode program to decipher the error log file - Log soft device errors and produce a dec-like error log - (cn,tn,sn) for disks; soft errors; ecc: pat, pos - Write a better analyze program more like sda 3. New stuff - File system (new data structures, new policies) - Vm primitives (segmentation, copy-on-write) - Ipc (fast datagrams, named pipes, vc stuff) - Local net support (chaosnet, etc.) - Incorporate bbn arpa net support - Project support - Sccs replacement 4. Benchmarking - Get hardware clock - Run jm's benchmarks - Run tracing experiments oft device errors and produce a dec-like error log - (cn,tn,sn) for diskssys/sys/vmdrum.c 444 0 33 14323 2503321233 7157 /* vmdrum.c 4.3 81/03/08 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/buf.h" #include "../h/text.h" #include "../h/map.h" #include "../h/pte.h" #include "../h/vm.h" #include "../h/cmap.h" /* * Expand the swap area for both the data and stack segments. * If space is not available for both, retract and return 0. */ swpexpand(ds, ss, dmp, smp) size_t ds, ss; register struct dmap *dmp, *smp; { register struct dmap *tmp; register int ts; size_t ods; /* * If dmap isn't growing, do smap first. * This avoids anomalies if smap will try to grow and * fail, which otherwise would shrink ds without expanding * ss, a rather curious side effect! */ if (dmp->dm_alloc > ds) { tmp = dmp; ts = ds; dmp = smp; ds = ss; smp = tmp; ss = ts; } ods = dmp->dm_size; if (vsexpand(ds, dmp, 0) == 0) goto bad; if (vsexpand(ss, smp, 0) == 0) { (void) vsexpand(ods, dmp, 1); goto bad; } return (1); bad: u.u_error = ENOMEM; return (0); } /* * Expand or contract the virtual swap segment mapped * by the argument diskmap so as to just allow the given size. * * FOR NOW CANT RELEASE UNLESS SHRINKING TO ZERO, SINCE PAGEOUTS MAY * BE IN PROGRESS... TYPICALLY NEVER SHRINK ANYWAYS, SO DOESNT MATTER MUCH */ vsexpand(vssize, dmp, canshrink) register size_t vssize; register struct dmap *dmp; { register int blk = DMMIN; register int vsbase = 0; register swblk_t *ip = dmp->dm_map; size_t oldsize = dmp->dm_size; size_t oldalloc = dmp->dm_alloc; while (vsbase < oldalloc || vsbase < vssize) { if (vsbase >= oldalloc) { *ip = rmalloc(swapmap, ctod(blk)); if (*ip == 0) { dmp->dm_size = vsbase; if (vsexpand(oldsize, dmp, 1) == 0) panic("vsexpand"); return (0); } dmp->dm_alloc += blk; } else if (vssize == 0 || vsbase >= vssize && canshrink) { rmfree(swapmap, ctod(blk), *ip); *ip = 0; dmp->dm_alloc -= blk; } vsbase += blk; if (blk < DMMAX) blk *= 2; ip++; if (ip - dmp->dm_map > NDMAP) panic("vmdrum NDMAP"); } dmp->dm_size = vssize; return (1); } /* * Allocate swap space for a text segment, * in chunks of at most DMTEXT pages. */ vsxalloc(xp) struct text *xp; { register int blk; register swblk_t *dp; swblk_t vsbase; if (xp->x_size > NXDAD * DMTEXT) panic("vsxalloc"); dp = xp->x_daddr; for (vsbase = 0; vsbase < xp->x_size; vsbase += DMTEXT) { blk = xp->x_size - vsbase; if (blk > DMTEXT) blk = DMTEXT; if ((*dp++ = rmalloc(swapmap, blk)) == 0) { vsxfree(xp, vsbase); return (0); } } if (xp->x_flag & XPAGI) { xp->x_ptdaddr = rmalloc(swapmap, clrnd(ctopt(xp->x_size))); if (xp->x_ptdaddr == 0) { vsxfree(xp, xp->x_size); return (0); } } return (1); } /* * Free the swap space of a text segment which * has been allocated ts pages. */ vsxfree(xp, ts) struct text *xp; int ts; { register int blk; register swblk_t *dp; swblk_t vsbase; dp = xp->x_daddr; for (vsbase = 0; vsbase < ts; vsbase += DMTEXT) { blk = ts - vsbase; if (blk > DMTEXT) blk = DMTEXT; rmfree(swapmap, blk, *dp); *dp++ = 0; } if ((xp->x_flag&XPAGI) && xp->x_ptdaddr) { rmfree(swapmap, clrnd(ctopt(xp->x_size)), xp->x_ptdaddr); xp->x_ptdaddr = 0; } } /* * Swap a segment of virtual memory to disk, * by locating the contiguous dirty pte's * and calling vschunk with each chunk. */ vsswap(p, pte, type, vsbase, vscount, dmp) struct proc *p; register struct pte *pte; int type; register int vsbase, vscount; struct dmap *dmp; { register i((nt size = 0; if (vscount % CLSIZE) panic("vsswap"); for (;;) { if (vscount == 0 || !dirtycl(pte)) { if (size) { vschunk(p, vsbase, size, type, dmp); vsbase += size; size = 0; } if (vscount == 0) return; vsbase += CLSIZE; if (pte->pg_fod == 0 && pte->pg_pfnum) if (type == CTEXT) p->p_textp->x_rssize -= vmemfree(pte, CLSIZE); else p->p_rssize -= vmemfree(pte, CLSIZE); } else { size += CLSIZE; mwait(pte->pg_pfnum); if (anycl(pte, pg_m)) zapcl(pte, pg_vreadm) = 1; } vscount -= CLSIZE; if (type == CSTACK) pte -= CLSIZE; else pte += CLSIZE; } } vschunk(p, base, size, type, dmp) register struct proc *p; register int base, size; int type; struct dmap *dmp; { register struct pte *pte; struct dblock db; unsigned v; if (type == CTEXT) { while (size > 0) { db.db_size = DMTEXT - base % DMTEXT; if (db.db_size > size) db.db_size = size; swap(p, p->p_textp->x_daddr[base/DMTEXT] + base%DMTEXT, ptob(tptov(p, base)), ctob(db.db_size), B_WRITE, 0, swapdev, 0); p->p_textp->x_rssize -= vmemfree(tptopte(p, base), db.db_size); base += db.db_size; size -= db.db_size; } return; } do { vstodb(base, size, dmp, &db, type == CSTACK); v = type==CSTACK ? sptov(p, base+db.db_size-1) : dptov(p, base); swap(p, db.db_base, ptob(v), ctob(db.db_size), B_WRITE, 0, swapdev, 0); pte = type==CSTACK ? sptopte(p, base+db.db_size-1) : dptopte(p, base); p->p_rssize -= vmemfree(pte, db.db_size); base += db.db_size; size -= db.db_size; } while (size != 0); } /* * Given a base/size pair in virtual swap area, * return a physical base/size pair which is the * (largest) initial, physically contiguous block. */ vstodb(vsbase, vssize, dmp, dbp, rev) register int vsbase, vssize; struct dmap *dmp; register struct dblock *dbp; { register int blk = DMMIN; register swblk_t *ip = dmp->dm_map; if (vsbase < 0 || vssize < 0 || vsbase + vssize > dmp->dm_size) panic("vstodb"); while (vsbase >= blk) { vsbase -= blk; if (blk < DMMAX) blk *= 2; ip++; } if (*ip + blk > nswap) panic("vstodb *ip"); dbp->db_size = imin(vssize, blk - vsbase); dbp->db_base = *ip + (rev ? blk - (vsbase + dbp->db_size) : vsbase); } /* * Convert a virtual page number * to its corresponding disk block number. * Used in pagein/pageout to initiate single page transfers. */ swblk_t vtod(p, v, dmap, smap) register struct proc *p; unsigned v; struct dmap *dmap, *smap; { struct dblock db; int tp; if (isatsv(p, v)) { tp = vtotp(p, v); return (p->p_textp->x_daddr[tp/DMTEXT] + tp%DMTEXT); } if (isassv(p, v)) vstodb(vtosp(p, v), 1, smap, &db, 1); else vstodb(vtodp(p, v), 1, dmap, &db, 0); return (db.db_base); } sbase); } /* * Convert a virtual page number * to its corresponding disk block number. * Used in pagein/pageout to initiate single page transfers. */ swblk_t vtod(p, v, dmap, smap) register struct proc *p; unsigned v; struct dmap *dmap, *smap; { struct dblock db; int tp; if (isatsv(p, v)sys/sys/vmmem.c 444 0 33 30677 2552571630 7014 /* vmmem.c 4.7 81/07/09 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/pte.h" #include "../h/cmap.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/mtpr.h" #include "../h/text.h" #include "../h/vm.h" #include "../h/file.h" #include "../h/inode.h" #include "../h/buf.h" #include "../h/mount.h" #include "../h/trace.h" #include "../h/map.h" /* * Allocate memory, and always succeed * by jolting page-out daemon * so as to obtain page frames. * To be used in conjunction with vmemfree(). */ vmemall(pte, size, p, type) register struct pte *pte; int size; struct proc *p; { register int m; if (size <= 0 || size > maxmem) panic("vmemall size"); while (size > 0) { if (freemem < desfree) wakeup((caddr_t)&proc[2]); /* jolt daemon */ while (freemem == 0) sleep((caddr_t)&freemem, PSWP+2); m = imin(size, freemem); (void) memall(pte, m, p, type); size -= m; pte += m; } if (freemem < desfree) wakeup((caddr_t)&proc[2]); /* jolt daemon */ /* * Always succeeds, but return success for * vgetu and vgetpt (e.g.) which call either * memall or vmemall depending on context. */ return (1); } /* * Free valid and reclaimable page frames belonging to the * count pages starting at pte. If a page is valid * or reclaimable and locked (but not a system page), then * we simply mark the page as c_gone and let the pageout * daemon free the page when it is through with it. * If a page is reclaimable, and already in the free list, then * we mark the page as c_gone, and (of course) don't free it. * * Determines the largest contiguous cluster of * valid pages and frees them in one call to memfree. */ vmemfree(pte, count) register struct pte *pte; register int count; { register struct cmap *c; register struct pte *spte; register int j; int size, pcnt, fileno; if (count % CLSIZE) panic("vmemfree"); for (size = 0, pcnt = 0; count > 0; pte += CLSIZE, count -= CLSIZE) { if (pte->pg_fod == 0 && pte->pg_pfnum) { c = &cmap[pgtocm(pte->pg_pfnum)]; pcnt += CLSIZE; if (c->c_lock && c->c_type != CSYS) { for (j = 0; j < CLSIZE; j++) *(int *)(pte+j) &= (PG_PROT|PG_VREADM); c->c_gone = 1; goto free; } if (c->c_free) { pcnt -= CLSIZE; for (j = 0; j < CLSIZE; j++) *(int *)(pte+j) &= (PG_PROT|PG_VREADM); if (c->c_type == CTEXT) distpte(&text[c->c_ndx], (int)c->c_page, pte); c->c_gone = 1; goto free; } if (size == 0) spte = pte; size += CLSIZE; continue; } if (pte->pg_fod) { fileno = ((struct fpte *)pte)->pg_fileno; if (fileno < NOFILE) if ((u.u_vrpages[fileno] -= CLSIZE) <= 0) { if (u.u_vrpages[fileno] < 0) panic("vmemfree vrpages"); if (--u.u_ofile[fileno]->f_inode->i_vfdcnt < 0) panic("vmemfree vfdcnt"); } for (j = 0; j < CLSIZE; j++) *(int *)(pte+j) &= (PG_PROT|PG_VREADM); } free: if (size) { memfree(spte, size, 1); size = 0; } } if (size) memfree(spte, size, 1); return (pcnt); } /* * Unlink a page frame from the free list - * * Performed if the page being reclaimed * is in the free list. */ munlink(pf) unsigned pf; { register int next, prev; next = cmap[pgtocm(pf)].c_next; prev = cmap[pgtocm(pf)].c_prev; cmap[prev].c_next = next; cmap[next].c_prev = prev; cmap[pgtocm(pf)].c_free = 0; if (freemem < minfree) wakeup((caddr_t)&proc[2]); /* jolt paging daemon */ freemem -= CLSIZE; } /* * Allocate memory - * * The free list appears as a doubly linked list * in the core map with cmap[0] serving as a header. */ memall(pte, size, p, type) register struct pte *pte; int size; struct proc *p; { register struct cmap *c; register struct pte *rpte; register struct proc *rp; int i, j, next, curpos; unsigned pf; struct cmap *c1, *c2; if (size % CLSIZE) panic("memall"); if (size > freemem) return (0); #ifdef TRACE trace(TR_MALL, size, u.u_procp->p_pid); #endif for (i = size; i > 0; i -= CLSIZE) { curpos = cmap[CMHEAD].c_next; c = &cmap[curpos]; if (c->c_free == 0) panic("dup mem alloc"); if (cmtopg(curpos) > maxfree) panic("bad mem alloc"); if (c->c_gone == 0 && c->c_type != CSYS) { if (c->c_type == CTEXT) rp = text[c->c_ndx].x_caddr; else rp = &proc[c->c_ndx]; while (rp->p_flag & SNOVM) rp = rp->p_xlink; switch (c->c_type) { case CTEXT: rpte = tptopte(rp, c->c_page); break; case CDATA: rpte = dptopte(rp, c->c_page); break; case CSTACK: rpte = sptopte(rp, c->c_page); break; } zapcl(rpte, pg_pfnum) = 0; if (c->c_type == CTEXT) distpte(&text[c->c_ndx], (int)c->c_page, rpte); } switch (type) { case CSYS: c->c_ndx = p->p_ndx; break; case CTEXT: c->c_page = vtotp(p, ptetov(p, pte)); c->c_ndx = p->p_textp - &text[0]; break; case CDATA: c->c_page = vtodp(p, ptetov(p, pte)); c->c_ndx = p->p_ndx; break; case CSTACK: c->c_page = vtosp(p, ptetov(p, pte)); c->c_ndx = p->p_ndx; break; } if (c->c_blkno) { /* * This is very like munhash(), except * that we really don't want to bother * to calculate a dev to pass to it. */ j = CMHASH(c->c_blkno); c1 = &cmap[cmhash[j]]; if (c1 == c) cmhash[j] = c1->c_hlink; else { for (;;) { if (c1 == ecmap) panic("memall ecmap"); c2 = c1; c1 = &cmap[c2->c_hlink]; if (c1 == c) break; } c2->c_hlink = c1->c_hlink; } if (mfind(c->c_mdev == MSWAPX ? swapdev : mount[c->c_mdev].m_dev, (daddr_t)c->c_blkno)) panic("memall mfind"); c1->c_mdev = 0; c1->c_blkno = 0; c1->c_hlink = 0; } pf = cmtopg(curpos); for (j = 0; j < CLSIZE; j++) *(int *)pte++ = pf++; c->c_free = 0; c->c_gone = 0; if (c->c_intrans || c->c_want) panic("memall intrans|want"); c->c_lock = 1; c->c_type = type; freemem -= CLSIZE; next = c->c_next; cmap[CMHEAD].c_next = next; cmap[next].c_prev = CMHEAD; } return (size); } /* * Free memory - * * The page frames being returned are inserted * to the head/tail of the free list depending * on whether there is any possible future use of them. * * If the freemem count had been zero, * the processes sleeping for memory * are awakened. */ memfree(pte, size, detach) register struct pte *pte; register int size; { register int i, j, prev, next; register struct cmap *c; if (size % CLSIZE) panic("memfree"); if (freemem < CLSIZE * KLMAX) wakeup((caddr_t)&freemem); while (size > 0) { size -= CLSIZE; i = pte->pg_pfnum; if (i < firstfree || i > maxfree) panic("bad mem free"); (( i = pgtocm(i); c = &cmap[i]; if (c->c_free) panic("dup mem free"); if (detach && c->c_type != CSYS) { for (j = 0; j < CLSIZE; j++) *(int *)(pte+j) &= (PG_PROT|PG_VREADM); c->c_gone = 1; } if (detach && c->c_blkno == 0) { next = cmap[CMHEAD].c_next; cmap[next].c_prev = i; c->c_prev = CMHEAD; c->c_next = next; cmap[CMHEAD].c_next = i; } else { prev = cmap[CMHEAD].c_prev; cmap[prev].c_next = i; c->c_next = CMHEAD; c->c_prev = prev; cmap[CMHEAD].c_prev = i; } c->c_free = 1; freemem += CLSIZE; pte += CLSIZE; } } /* * Allocate wired-down (non-paged) pages in kernel virtual memory. */ caddr_t wmemall(pmemall, n) int (*pmemall)(), n; { int npg; caddr_t va; register int a; npg = btoc(n); a = rmalloc(kernelmap, npg); if (a == 0) return (0); if ((*pmemall)(&Usrptmap[a], npg, &proc[0], CSYS) == 0) { rmfree(kernelmap, npg, a); return (0); } va = (caddr_t) kmxtob(a); vmaccess(&Usrptmap[a], va, npg); return (va); } wmemfree(va, n) caddr_t va; int n; { register int a; int npg; a = btokmx((struct pte *) va); npg = btoc(n); (void) memfree(&Usrptmap[a], npg, 0); rmfree(kernelmap, npg, a); } /* * Enter clist block c on the hash chains. * It contains file system block bn from device dev. * Dev must either be a mounted file system or the swap device * so we panic if getfsx() cannot find it. */ mhash(c, dev, bn) register struct cmap *c; dev_t dev; daddr_t bn; { register int i = CMHASH(bn); c->c_hlink = cmhash[i]; cmhash[i] = c - cmap; c->c_blkno = bn; i = getfsx(dev); if (i == -1) panic("mhash"); c->c_mdev = i; } /* * Pull the clist entry of off the hash chains. * We have checked before calling (using mfind) that the * entry really needs to be unhashed, so panic if we can't * find it (can't happen). */ munhash(dev, bn) dev_t dev; daddr_t bn; { register int i = CMHASH(bn); register struct cmap *c1, *c2; c1 = &cmap[cmhash[i]]; if (c1 == ecmap) panic("munhash"); if (c1->c_blkno == bn && getfsx(dev) == c1->c_mdev) cmhash[i] = c1->c_hlink; else { for (;;) { c2 = c1; c1 = &cmap[c2->c_hlink]; if (c1 == ecmap) panic("munhash"); if (c1->c_blkno == bn && getfsx(dev) == c1->c_mdev) break; } c2->c_hlink = c1->c_hlink; } if (mfind(dev, bn)) panic("munhash mfind"); c1->c_mdev = 0; c1->c_blkno = 0; c1->c_hlink = 0; } /* * Look for block bn of device dev in the free pool. * Currently it should not be possible to find it unless it is * c_free and c_gone, although this may later not be true. * (This is because active texts are locked against file system * writes by the system.) */ struct cmap * mfind(dev, bn) dev_t dev; daddr_t bn; { register struct cmap *c1 = &cmap[cmhash[CMHASH(bn)]]; while (c1 != ecmap) { if (c1->c_blkno == bn && c1->c_mdev == getfsx(dev)) return (c1); c1 = &cmap[c1->c_hlink]; } return ((struct cmap *)0); } /* * Purge blocks from device dev from incore cache * before umount(). */ mpurge(mdev) int mdev; { register struct cmap *c1, *c2; register int i; for (i = 0; i < CMHSIZ; i++) { more: c1 = &cmap[cmhash[i]]; if (c1 == ecmap) continue; if (c1->c_mdev == mdev) cmhash[i] = c1->c_hlink; else { for (;;) { c2 = c1; c1 = &cmap[c1->c_hlink]; if (c1 == ecmap) goto cont; if (c1->c_mdev == mdev) break; } c2->c_hlink = c1->c_hlink; } c1->c_mdev = 0; c1->c_blkno = 0; c1->c_hlink = 0; goto more; cont: ; } } /* * Initialize core map */ meminit(first, last) int first, last; { register int i; register struct cmap *c; firstfree = clrnd(first); maxfree = clrnd(last - (CLSIZE - 1)); freemem = maxfree - firstfree; ecmx = ecmap - cmap; if (ecmx < freemem / CLSIZE) freemem = ecmx * CLSIZE; for (i = 1; i <= freemem / CLSIZE; i++) { cmap[i-1].c_next = i; c = &cmap[i]; c->c_prev = i-1; c->c_free = 1; c->c_gone = 1; c->c_type = CSYS; c->c_mdev = 0; c->c_blkno = 0; } cmap[freemem / CLSIZE].c_next = CMHEAD; for (i = 0; i < CMHSIZ; i++) cmhash[i] = ecmx; cmap[CMHEAD].c_prev = freemem / CLSIZE; cmap[CMHEAD].c_type = CSYS; avefree = freemem; hand = 0; } /* * Wait for frame pf to become unlocked * if it is currently locked. * * THIS ROUTINE SHOULD TAKE A CMAP STRUCTURE AS ARGUMENT. */ mwait(pf) unsigned pf; { mlock(pf); munlock(pf); } /* * Lock a page frame. * * THIS ROUTINE SHOULD TAKE A CMAP STRUCTURE AS ARGUMENT. */ mlock(pf) unsigned pf; { register struct cmap *c = &cmap[pgtocm(pf)]; while (c->c_lock) { c->c_want = 1; sleep((caddr_t)c, PSWP+1); } c->c_lock = 1; } /* * Unlock a page frame. * * THIS ROUTINE SHOULD TAKE A CMAP STRUCTURE AS ARGUMENT. */ munlock(pf) unsigned pf; { register struct cmap *c = &cmap[pgtocm(pf)]; if (c->c_lock == 0) panic("dup page unlock"); if (c->c_want) wakeup((caddr_t)c); c->c_lock = 0; c->c_want = 0; } /* * Lock a virtual segment. * * For each cluster of pages, if the cluster is not valid, * touch it to fault it in, otherwise just lock page frame. * Called from physio to ensure that the pages * participating in raw i/o are valid and locked. * We use SDLYU to keep pagein from unlocking pages, * so they make it safely back here locked. */ vslock(base, count) caddr_t base; { register unsigned v; register int npf; register struct pte *pte; u.u_procp->p_flag |= SDLYU; v = btop(base); pte = vtopte(u.u_procp, v); npf = btoc(count + ((int)base & CLOFSET)); while (npf > 0) { if (pte->pg_v) mlock(pte->pg_pfnum); else if (fubyte((caddr_t)ctob(v)) < 0) panic("vslock"); pte += CLSIZE; v += CLSIZE; npf -= CLSIZE; } u.u_procp->p_flag &= ~SDLYU; } /* * Unlock a virtual segment. */ vsunlock(base, count, rw) caddr_t base; { register struct pte *pte; register int npf; pte = vtopte(u.u_procp, btop(base)); npf = btoc(count + ((int)base & CLOFSET)); while (npf > 0) { munlock(pte->pg_pfnum); if (rw == B_READ) /* Reading from device writes memory */ pte->pg_m = 1; pte += CLSIZE; npf -= CLSIZE; } } if (fubyte((caddr_t)ctob(v)) < 0) panic("vslock"); pte += sys/sys/vmmon.c 444 0 33 2263 2526706723 7001 /* vmmon.c 4.6 81/04/28 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/vmmeter.h" #include "../h/trace.h" #include "../h/mtpr.h" #ifdef PGINPROF int pmonmin = PMONMIN; int pres = PRES; int rmonmin = RMONMIN; int rres = RRES; vmsizmon() { register int i; i = (u.u_dsize / DRES) < NDMON ? (u.u_dsize / DRES):NDMON; dmon[i] += u.u_vm.vm_utime - u.u_outime; i = (u.u_ssize / SRES) < NSMON ? (u.u_ssize / SRES):NSMON; smon[i] += u.u_vm.vm_utime - u.u_outime; u.u_outime = u.u_vm.vm_utime; } vmfltmon(hist, atime, amin, res, nmax) register unsigned int *hist; register int atime, amin, res, nmax; { register int i; i = (atime - amin) / res; if (i>=0 && i= TRCSIZ) { tracex += (TRCSIZ - x); x = 0; } argp = &args; tracep = &tracebuf[x]; tracex += nargs; *tracep++ = (time*60 + lbolt+1)*16667 + mfpr(ICR); nargs--; do *tracep++ = *argp++; while (--nargs > 0); } #endif i = (atime - amin) / res; if (i>=0 && i= TRCSIZ) { tracex += (TRCSIZ - x); x = 0; sys/sys/vmpage.c 444 0 33 61476 2531444607 7153 /* vmpage.c 4.16 81/05/12 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/inode.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/reg.h" #include "../h/pte.h" #include "../h/buf.h" #include "../h/text.h" #include "../h/mtpr.h" #include "../h/cmap.h" #include "../h/vm.h" #include "../h/file.h" #include "../h/trace.h" int nohash = 0; /* * Handle a page fault. * * Basic outline * If page is allocated, but just not valid: * Wait if intransit, else just revalidate * Done * Compute from which page operation would take place * If page is text page, and filling from file system or swap space: * If in free list cache, reattach it and then done * Allocate memory for page in * If block here, restart because we could have swapped, etc. * Lock process from swapping for duration * Update pte's to reflect that page is intransit. * If page is zero fill on demand: * Clear pages and flush free list cache of stale cacheing * for this swap page (e.g. before initializing again due * to 407/410 exec). * If page is fill from file and in buffer cache: * Copy the page from the buffer cache. * If not a fill on demand: * Determine swap address and cluster to page in * Do the swap to bring the page in * Instrument the pagein * After swap validate the required new page * Leave prepaged pages reclaimable (not valid) * Update shared copies of text page tables * Complete bookkeeping on pages brought in: * No longer intransit * Hash text pa((ges into core hash structure * Unlock pages (modulo raw i/o requirements) * Flush translation buffer * Process pagein is done */ #ifdef TRACE #define pgtrace(e) trace(e,v,u.u_procp->p_pid) #else #define pgtrace(e) #endif int preptofree = 1; /* send pre-paged pages to free list */ pagein(virtaddr) unsigned virtaddr; { register struct proc *p; register struct pte *pte; register struct inode *ip; register unsigned v; unsigned pf; int type, fileno, prot; struct pte opte; struct buf *bp; dev_t dev; register int i; int klsize; unsigned vsave; struct cmap *c; int j; daddr_t bn, bncache, bnswap; #ifdef PGINPROF int otime, olbolt, oicr, a, s; s = spl6(); otime = time, olbolt = lbolt, oicr = mfpr(ICR); #endif cnt.v_faults++; /* * Classify faulted page into a segment and get a pte * for the faulted page. */ vsave = v = clbase(btop(virtaddr)); p = u.u_procp; if (isatsv(p, v)) type = CTEXT; else if (isassv(p, v)) type = CSTACK; else type = CDATA; pte = vtopte(p, v); if (pte->pg_v) panic("pagein"); /* * If page is reclaimable, reclaim it. * If page is text and intransit, sleep while it is intransit, * If it is valid after the sleep, we are done. * Otherwise we have to start checking again, since page could * even be reclaimable now (we may have swapped for a long time). */ restart: if (pte->pg_fod == 0 && pte->pg_pfnum) { if (type == CTEXT && cmap[pgtocm(pte->pg_pfnum)].c_intrans) { pgtrace(TR_INTRANS); sleep((caddr_t)p->p_textp, PSWP+1); pgtrace(TR_EINTRANS); pte = vtopte(p, v); if (pte->pg_v) { valid: if (p->p_flag & SDLYU) mlock(pte->pg_pfnum); tbiscl(v); cnt.v_intrans++; return; } goto restart; } /* * If page is in the free list, then take * it back into the resident set, updating * the size recorded for the resident set. */ if (cmap[pgtocm(pte->pg_pfnum)].c_free) { pgtrace(TR_FRECLAIM); munlink(pte->pg_pfnum); cnt.v_pgfrec++; if (type == CTEXT) p->p_textp->x_rssize += CLSIZE; else p->p_rssize += CLSIZE; } else pgtrace(TR_RECLAIM); pte->pg_v = 1; if (anycl(pte, pg_m)) pte->pg_m = 1; distcl(pte); if (type == CTEXT) distpte(p->p_textp, vtotp(p, v), pte); u.u_vm.vm_minflt++; cnt.v_pgrec++; if (p->p_flag & SDLYU) mlock(pte->pg_pfnum); tbiscl(v); #ifdef PGINPROF a = vmtime(otime, olbolt, oicr); rectime += a; if (a >= 0) vmfltmon(rmon, a, rmonmin, rres, NRMON); splx(s); #endif return; } #ifdef PGINPROF splx(s); #endif /* * is where data comes from/goes to. * is where data is cached from/to. * is where data will eventually go. */ if (pte->pg_fod == 0) { fileno = -1; bnswap = bncache = bn = dbtofsb(vtod(p, v, &u.u_dmap, &u.u_smap)); dev = swapdev; } else { fileno = ((struct fpte *)pte)->pg_fileno; bn = ((struct fpte *)pte)->pg_blkno; bnswap = dbtofsb(vtod(p, v, &u.u_dmap, &u.u_smap)); if (fileno > PG_FMAX) panic("pagein pg_fileno"); if (fileno == PG_FTEXT) { if (p->p_textp == 0) panic("pagein PG_FTEXT"); dev = p->p_textp->x_iptr->i_dev; bncache = bn; } else if (fileno == PG_FZERO) { dev = swapdev; bncache = bnswap; } else { if (u.u_ofile[fileno] == NULL) panic("pagein u.u_ofile"); ip = u.u_ofile[fileno]->f_inode; dev = ip->i_dev; } } klsize = 1; opte = *pte; /* * Check for text detached but in free list. * This can happen only if the page is filling * from a inode or from the swap device, (e.g. not when reading * in 407/410 execs to a zero fill page.) */ if (type == CTEXT && fileno != PG_FZERO && !nohash) { c = mfind(dev, bncache); if (c) { if (c->c_type != CTEXT || c->c_gone == 0 || c->c_free == 0) panic("pagein mfind"); p->p_textp->x_rssize += CLSIZE; /* * Following code mimics memall(). */ pf = cmtopg(c - cmap); munlink(pf); for (j = 0; j < CLSIZE; j++) { *(int *)pte = pf++; pte->pg_prot = opte.pg_prot; pte++; } pte -= CLSIZE; c->c_free = 0; c->c_gone = 0; if (c->c_intrans || c->c_want) panic("pagein intrans|want"); c->c_lock = 1; if (c->c_page != vtotp(p, v)) panic("pagein c_page chgd"); c->c_ndx = p->p_textp - &text[0]; if (dev == swapdev) { cnt.v_xsfrec++; pgtrace(TR_XSFREC); } else { cnt.v_xifrec++; pgtrace(TR_XIFREC); } cnt.v_pgrec++; u.u_vm.vm_minflt++; if (dev != swapdev) { c = mfind(swapdev, bnswap); if (c) munhash(swapdev, bnswap); pte->pg_swapm = 1; } goto skipswap; } } /* * Wasn't reclaimable or reattachable. * Have to prepare to bring the page in. * We allocate the page before locking so we will * be swappable if there is no free memory. * If we block we have to start over, since anything * could have happened. */ if (freemem < CLSIZE * KLMAX) { pgtrace(TR_WAITMEM); while (freemem < CLSIZE * KLMAX) sleep((caddr_t)&freemem, PSWP+2); pgtrace(TR_EWAITMEM); pte = vtopte(p, v); if (pte->pg_v) goto valid; goto restart; } /* * Now can get memory and committed to bringing in the page. * Lock this process, get a page, * construct the new pte, and increment * the (process or text) resident set size. */ p->p_flag |= SPAGE; (void) memall(pte, CLSIZE, p, type); pte->pg_prot = opte.pg_prot; pf = pte->pg_pfnum; cmap[pgtocm(pf)].c_intrans = 1; distcl(pte); if (type == CTEXT) { p->p_textp->x_rssize += CLSIZE; distpte(p->p_textp, vtotp(p, v), pte); } else p->p_rssize += CLSIZE; /* * Two cases: either fill on demand (zero, or from file or text) * or from swap space. */ if (opte.pg_fod) { pte->pg_swapm = 1; if (fileno == PG_FZERO || fileno == PG_FTEXT) { /* * Flush any previous text page use of this * swap device block. */ if (type == CTEXT) { c = mfind(swapdev, bnswap); if (c) munhash(swapdev, bnswap); } /* * If zero fill, short-circuit hard work * by just clearing pages. */ if (fileno == PG_FZERO) { pgtrace(TR_ZFOD); for (i = 0; i < CLSIZE; i++) clearseg(pf+i); if (type != CTEXT) cnt.v_zfod += CLSIZE; goto skipswap; } pgtrace(TR_EXFOD); cnt.v_exfod += CLSIZE; } else { /* * Vreading block... update summary information. */ if (u.u_ofile[fileno] == NULL) panic("pagein u.u_ofile"); if ((u.u_vrpages[fileno] -= CLSIZE) <= 0) { if (u.u_vrpages[fileno] < 0) panic("pagein u.u_vrpages"); if (--ip->i_vfdcnt < 0) panic("pagein i_vfdcnt"); } cnt.v_vrfod += CLSIZE; pgtrace(TR_VRFOD); } /* * Check that block is not in file system buffer cache. * The way the cache is handled now, this * happens only once every 2 days. */ if (bp = baddr(dev, bn)) { #ifdef TRACE if (type != CTEXT) trace(TR_XFODHIT, dev, bn); #endif pgtrace(TR_CACHEFOD); pte->pg_v = 1; prot = *(int *)pte & PG_PROT; pte->pg_prot = 0; *(int *)pte |= PG_UW; distcl(pte); tbiscl(v); /* THIS ASSUMES THAT CLSIZE*NBPG==BSIZE */ bcopy(bp->b_un.b_addr, ptob(v), BSIZE); brelse(bp); pte->pg_prot = 0; *(int *)pte |= prot; goto skipswap; } #ifdef TRACE if (type != CTEXT) trace(TR_XFODMISS, dev, bn); #endif } else { if (opte.pg_pfnum) panic("pagein pfnum"); pgtrace(TR_SWAPIN); /* * Fill from swap area. Try to find adjacent * pages to bring in also. */ v = kluster(p, v, pte, B_READ, &klsize, (type == CTEXT) ? kltxt : ((p->p_flag & SSEQL) ? klseql : klin), bn); /* THIS COULD BE COMPUTED INCREMENTALLY... */ bncache = bn = dbtofsb(vtod(p, v, &u.u_dmap, &u.u_smap)); pte->pg_vreadm = opte.pg_vreadm; } distcl(pte); swap(p, fsbtodb(bn), ptob(v), klsize * ctob(CLSIZE), B_READ, B_PGIN, dev, 0); #ifdef TRACE trace(TR_PGINDONE, vsave, u.u_procp->p_pid); #endif /* * Instrumentation. */ u.u_vm.vm_majflt++; cnt.v_pgin++; cnt.v_pgpgin += klsize * CLSIZE; #ifdef PGINPROF a = vmtime(otime, olbolt, oicr) / 100; pgintime += a; if (a >= 0) vmfltmon(pmon, a, pmonmin, pres, NPMON); #endif skipswap: /* * Fix page table entries. * * Only page requested in is validated, and rest of pages * can be ``reclaimed''. This allows system to reclaim prepaged pages * quickly if they are not used and memory is tight. */ pte = vtopte(p, vsave); pte->pg_v = 1; distcl(pte); if (type == CTEXT) { distpte(p->p_textp, vtotp(p, vsave), pte); if (opte.pg_fod) p->p_textp->x_flag |= XWRIT; wakeup((caddr_t)p->p_textp); } /* * Memall returned page(s) locked. Unlock all * pages in cluster. If locking pages for raw i/o * leave the page which was required to be paged in locked, * but still unlock others. * If text pages, hash into the cmap situation table. */ pte = vtopte(p, v); for (i = 0; i < klsize; i++) { c = &cmap[pgtocm(pte->pg_pfnum)]; c->c_intrans = 0; if (type == CTEXT && c->c_blkno == 0 && bncache && !nohash) { mhash(c, dev, bncache); bncache++; } if (v != vsave || (p->p_flag & SDLYU) == 0) munlock(pte->pg_pfnum); if (v != vsave && type != CTEXT && preptofree) { /* * Throw pre-paged data/stack pages at the * bottom of the free list. */ p->p_rssize -= CLSIZE; memfree(pte, CLSIZE, 0); } tbiscl(v); /* conservative ? */ v += CLSIZE; pte += CLSIZE; } /* * All done. */ p->p_flag &= ~SPAGE; /* * If process is declared fifo, memory is tight, * and this was a data page-in, free memory * klsdist pagein clusters away from the current fault. */ if ((p->p_flag&SSEQL) && freemem < lotsfree && type == CDATA) { int k = (vtodp(p, vsave) / CLSIZE) / klseql; #ifdef notdef if (vsave > u.u_vsave) k -= klsdist; else k += klsdist; dpageout(p, k * klseql * CLSIZE, klout*CLSIZE); u.u_vsave = vsave; #else dpageout(p, (k - klsdist) * klseql * CLSIZE, klout*CLSIZE); dpageout(p, (k + klsdist) * klseql * CLSIZE, klout*CLSIZE); #endif } } #if defined(BERT) int dmod = 1000000; int dcnt; #endif /* * Take away n pages of data space * starting at data page dp. * Used to take pages away from sequential processes. * Mimics pieces of code in pageout() below. */ dpageout(((p, dp, n) struct proc *p; int dp, n; { register struct cmap *c; int i, klsize; register struct pte *pte; unsigned v; daddr_t daddr; if (dp < 0) { n += dp; dp = 0; } if (dp + n > p->p_dsize) n = p->p_dsize - dp; #if defined(BERT) if (++dcnt % dmod == 0) printf("dp %d, n %d\n", dp, n); #endif for (i = 0; i < n; i += CLSIZE, dp += CLSIZE) { pte = dptopte(p, dp); if (pte->pg_fod || pte->pg_pfnum == 0) continue; c = &cmap[pgtocm(pte->pg_pfnum)]; if (c->c_lock || c->c_free) continue; if (pte->pg_v) { pte->pg_v = 0; if (anycl(pte, pg_m)) pte->pg_m = 1; distcl(pte); } if (dirtycl(pte)) { if (bswlist.av_forw == NULL) continue; mlock(pte->pg_pfnum); if (anycl(pte, pg_m)) { pte->pg_vreadm = 1; pte->pg_m = 0; } pte->pg_swapm = 0; distcl(pte); p->p_poip++; v = kluster(p, dptov(p, dp), pte, B_WRITE, &klsize, klout, (daddr_t)0); /* THIS ASSUMES THAT p == u.u_procp */ daddr = vtod(p, v, &u.u_dmap, &u.u_smap); swap(p, daddr, ptob(v), klsize * ctob(CLSIZE), B_WRITE, B_DIRTY, swapdev, pte->pg_pfnum); } else { if (c->c_gone == 0) p->p_rssize -= CLSIZE; memfree(pte, CLSIZE, 0); cnt.v_seqfree += CLSIZE; } } } int fifo = 0; /* * The page out daemon, which runs as process 2. * * As long as there are at least lotsfree pages, * this process is not run. When the number of free * pages stays in the range desfree to lotsfree, * this daemon runs through the pages in the loop * at a rate determined in vmsched(), simulating the missing * hardware reference bit, and cleaning pages and transferring * them to the free list. */ pageout() { register struct proc *rp; register struct text *xp; register struct cmap *c; register struct pte *pte; int count, pushes; swblk_t daddr; unsigned v; int maxhand = pgtocm(maxfree); int klsize; loop: /* * Before sleeping, look to see if there are any swap I/O headers * in the ``cleaned'' list that correspond to dirty * pages that have been pushed asynchronously. If so, * empty the list by calling cleanup(). * * N.B.: We guarantee never to block while the cleaned list is nonempty. */ (void) spl6(); if (bclnlist != NULL) cleanup(); sleep((caddr_t)&proc[2], PSWP+1); (void) spl0(); count = 0; pushes = 0; while (nscan < desscan && freemem < lotsfree) { top: /* * An iteration of the clock pointer (hand) around the loop. * Look at the page at hand. If it is a * locked (for physical i/o e.g.), system (u., page table) * or free, then leave it alone. * Otherwise, find a process and text pointer for the * page, and a virtual page number in either the * process or the text image. */ c = &cmap[hand]; if (c->c_lock || c->c_free) goto skip; switch (c->c_type) { case CSYS: goto skip; case CTEXT: xp = &text[c->c_ndx]; rp = xp->x_caddr; v = tptov(rp, c->c_page); pte = tptopte(rp, c->c_page); break; case CDATA: case CSTACK: rp = &proc[c->c_ndx]; while (rp->p_flag & SNOVM) rp = rp->p_xlink; xp = rp->p_textp; if (c->c_type == CDATA) { v = dptov(rp, c->c_page); pte = dptopte(rp, c->c_page); } else { v = sptov(rp, c->c_page); pte = sptopte(rp, c->c_page); } break; } if (pte->pg_pfnum != cmtopg(hand)) panic("bad c_page"); /* * If page is valid; make invalid but reclaimable. * If this pte is not valid, then it must be reclaimable * and we can add it to the free list. */ if (pte->pg_v) { pte->pg_v = 0; if (anycl(pte, pg_m)) pte->pg_m = 1; distcl(pte); if (c->c_type == CTEXT) distpte(xp, vtotp(rp, v), pte); if ((rp->p_flag & (SSEQL|SUANOM)) || fifo || rp->p_rssize > rp->p_maxrss) goto take; } else { take: if (c->c_type != CTEXT) { /* * Guarantee a minimal investment in data * space for jobs in balance set. */ if (rp->p_rssize < saferss - rp->p_slptime) goto skip; } /* * If the page is currently dirty, we * have to arrange to have it cleaned before it * can be freed. We mark it clean immediately. * If it is reclaimed while being pushed, then modified * again, we are assured of the correct order of * writes because we lock the page during the write. * This guarantees that a swap() of this process (and * thus this page), initiated in parallel, will, * in fact, push the page after us. * * The most general worst case here would be for * a reclaim, a modify and a swapout to occur * all before the single page transfer completes. */ if (dirtycl(pte)) { /* * Limit pushes to avoid saturating * pageout device. * * MAGIC 4 BECAUSE WE RUN EVERY 1/4 SEC (clock) */ if (pushes > maxpgio / 4) goto skip; pushes++; /* * If the process is being swapped out * or about to exit, do not bother with its * dirty pages */ if (rp->p_flag & (SLOCK|SWEXIT)) goto skip; /* * Now carefully make sure that there will * be a header available for the push so that * we will not block waiting for a header in * swap(). The reason this is important is * that we (proc[2]) are the one who cleans * dirty swap headers and we could otherwise * deadlock waiting for ourselves to clean * swap headers. The sleep here on &proc[2] * is actually (effectively) a sleep on both * ourselves and &bswlist, and this is known * to iodone and swap in bio.c. That is, * &proc[2] will be awakened both when dirty * headers show up and also to get the pageout * daemon moving. */ (void) spl6(); if (bclnlist != NULL) cleanup(); if (bswlist.av_forw == NULL) { bswlist.b_flags |= B_WANTED; sleep((caddr_t)&proc[2], PSWP+2); (void) spl0(); /* * Page disposition may have changed * since process may have exec'ed, * forked, exited or just about * anything else... try this page * frame again, from the top. */ goto top; } (void) spl0(); mlock((unsigned)cmtopg(hand)); uaccess(rp, Pushmap, &pushutl); /* * Now committed to pushing the page... */ if (anycl(pte, pg_m)) { pte->pg_vreadm = 1; pte->pg_m = 0; } pte->pg_swapm = 0; distcl(pte); if (c->c_type == CTEXT) { xp->x_poip++; distpte(xp, vtotp(rp, v), pte); } else rp->p_poip++; v = kluster(rp, v, pte, B_WRITE, &klsize, klout, (daddr_t)0); if (klsize == 0) panic("pageout klsize"); daddr = vtod(rp, v, &pushutl.u_dmap, &pushutl.u_smap); swap(rp, daddr, ptob(v), klsize * ctob(CLSIZE), B_WRITE, B_DIRTY, swapdev, pte->pg_pfnum); /* * The cleaning of this page will be * completed later, in cleanup() called * (synchronously) by us (proc[2]). In * the meantime, the page frame is locked * so no havoc can result. */ goto skip; } /* * Decrement the resident set size of the current * text object/process, and put the page in the * free list. Note that we don't give memfree the * pte as its argument, since we don't want to destroy * the pte. If it hasn't already been discarded * it may yet have a chance to be reclaimed from * the free list. */ if (c->c_gone == 0) if (c->c_type == CTEXT) xp->x_rssize -= CLSIZE; else rp->p_rssize -= CLSIZE; memfree(pte, CLSIZE, 0); cnt.v_dfree += CLSIZE; /* * We managed to add a page to the free list, * so we give ourselves another couple of trips * around the loop. */ count = 0; } skip: cnt.v_scan++; nscan++; if (++hand >= maxhand) { hand = 0; cnt.v_rev++; if (count > 2) { /* * Extremely unlikely, but we went around * the loop twice and didn't get anywhere. * Don't cycle, stop till the next clock tick. */ goto loop; } count++; } } goto loop; } /* * Process the ``cleaned'' list. * * Scan through the linked list of swap I/O headers * and free the corresponding pages that have been * cleaned by being written back to the paging area. * If the page has been reclaimed during this time, * we do not free the page. As they are processed, * the swap I/O headers are removed from the cleaned * list and inserted into the free list. */ cleanup() { register struct buf *bp; register struct proc *rp; register struct text *xp; register struct cmap *c; register struct pte *pte; unsigned pf; register int i; int s, center; for (;;) { s = spl6(); if ((bp = bclnlist) == 0) break; bclnlist = bp->av_forw; splx(s); pte = dptopte(&proc[2], btop(bp->b_un.b_addr)); center = 0; for (i = 0; i < bp->b_bcount; i += CLSIZE * NBPG) { pf = pte->pg_pfnum; munlock(pf); c = &cmap[pgtocm(pf)]; if (pf != bp->b_pfcent) { if (c->c_gone) { memfree(pte, CLSIZE, 0); cnt.v_dfree += CLSIZE; } goto skip; } center++; switch (c->c_type) { case CSYS: panic("cleanup CSYS"); case CTEXT: xp = &text[c->c_ndx]; xp->x_poip--; if (xp->x_poip == 0) wakeup((caddr_t)&xp->x_poip); break; case CDATA: case CSTACK: rp = &proc[c->c_ndx]; while (rp->p_flag & SNOVM) rp = rp->p_xlink; rp->p_poip--; if (rp->p_poip == 0) wakeup((caddr_t)&rp->p_poip); break; } if (c->c_gone == 0) { switch (c->c_type) { case CTEXT: pte = tptopte(xp->x_caddr, c->c_page); break; case CDATA: pte = dptopte(rp, c->c_page); break; case CSTACK: pte = sptopte(rp, c->c_page); break; } if (pte->pg_v) goto skip; if (c->c_type == CTEXT) xp->x_rssize -= CLSIZE; else rp->p_rssize -= CLSIZE; } memfree(pte, CLSIZE, 0); cnt.v_dfree += CLSIZE; skip: pte += CLSIZE; } if (center != 1) panic("cleanup center"); bp->b_flags = 0; bp->av_forw = bswlist.av_forw; bswlist.av_forw = bp; if (bswlist.b_flags & B_WANTED) { bswlist.b_flags &= ~B_WANTED; wakeup((caddr_t)&bswlist); } } splx(s); } /* * Kluster locates pages adjacent to the argument pages * that are immediately ((available to include in the pagein/pageout, * and given the availability of memory includes them. * It knows that the process image is contiguous in chunks; * an assumption here is that CLSIZE * KLMAX is a divisor of DMMIN, * so that by looking at KLMAX chunks of pages, all such will * necessarily be mapped swap contiguous. */ int noklust; int klicnt[KLMAX]; int klocnt[KLMAX]; kluster(p, v, pte0, rw, pkl, klsize, bn0) register struct proc *p; unsigned v; struct pte *pte0; int rw, *pkl, klsize; daddr_t bn0; { int type, cl, clmax; int kloff, k, klmax; register struct pte *pte; int klback, klforw; register int i; unsigned v0; daddr_t bn; if (rw == B_READ) klicnt[0]++; else klocnt[0]++; *pkl = 1; if (noklust || klsize <= 1 || klsize > KLMAX || (klsize & (klsize - 1))) return (v); if (rw == B_READ && freemem < CLSIZE * KLMAX) return (v); if (isassv(p, v)) { type = CSTACK; cl = vtosp(p, v) / CLSIZE; clmax = p->p_ssize / CLSIZE; } else if (isadsv(p, v)) { type = CDATA; cl = vtodp(p, v) / CLSIZE; clmax = p->p_dsize / CLSIZE; } else { type = CTEXT; cl = vtotp(p, v) / CLSIZE; clmax = p->p_textp->x_size / CLSIZE; } kloff = cl & (klsize - 1); pte = pte0; bn = bn0; for (k = kloff; --k >= 0;) { if (type == CSTACK) pte += CLSIZE; else pte -= CLSIZE; if (type == CTEXT && rw == B_READ && bn) { bn--; if (mfind(swapdev, bn)) break; } if (!klok(pte, rw)) break; } klback = (kloff - k) - 1; pte = pte0; if ((cl - kloff) + klsize > clmax) klmax = clmax - (cl - kloff); else klmax = klsize; bn = bn0; for (k = kloff; ++k < klmax;) { if (type == CSTACK) pte -= CLSIZE; else pte += CLSIZE; if (type == CTEXT && rw == B_READ && bn) { bn++; if (mfind(swapdev, bn)) break; } if (!klok(pte, rw)) break; } klforw = (k - kloff) - 1; if (klforw + klback == 0) return (v); pte = pte0; if (type == CSTACK) { pte -= klforw * CLSIZE; v -= klforw * CLSIZE; } else { pte -= klback * CLSIZE; v -= klback * CLSIZE; } *pkl = klforw + klback + 1; if (rw == B_READ) klicnt[0]--, klicnt[*pkl - 1]++; else klocnt[0]--, klocnt[*pkl - 1]++; v0 = v; for (i = 0; i < *pkl; i++) { if (pte == pte0) goto cont; if (rw == B_WRITE) { mlock(pte->pg_pfnum); if (anycl(pte, pg_m)) { pte->pg_vreadm = 1; pte->pg_m = 0; } pte->pg_swapm = 0; distcl(pte); if (type == CTEXT) distpte(p->p_textp, vtotp(p, v), pte); } else { struct pte opte; int pf; opte = *pte; if (memall(pte, CLSIZE, p, type) == 0) panic("kluster"); pte->pg_prot = opte.pg_prot; pf = pte->pg_pfnum; cmap[pgtocm(pf)].c_intrans = 1; distcl(pte); if (type == CTEXT) { p->p_textp->x_rssize += CLSIZE; distpte(p->p_textp, vtotp(p, v), pte); } else p->p_rssize += CLSIZE; /* if (opte.pg_fod == 0) */ pte->pg_vreadm = opte.pg_vreadm; distcl(pte); } cont: pte += CLSIZE; v += CLSIZE; } return (v0); } klok(pte, rw) register struct pte *pte; int rw; { register struct cmap *c; if (rw == B_WRITE) { if (pte->pg_fod) return (0); if (pte->pg_pfnum == 0) return (0); c = &cmap[pgtocm(pte->pg_pfnum)]; if (c->c_lock || c->c_intrans) return (0); if (!dirtycl(pte)) return (0); return (1); } else { if (pte->pg_fod) return (0); if (pte->pg_pfnum) return (0); return (1); } } vreadm = opte.pg_vreadm; distcl(pte); } cont: pte += CLSIZE; v += CLSIZE; } return (v0); } klok(pte, rw) register struct pte *pte; int rw; { register struct cmap *c; if (rw == Bsys/sys/vmproc.c 444 0 33 21311 2503321172 7150 /* vmproc.c 4.5 81/03/08 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/mtpr.h" #include "../h/pte.h" #include "../h/map.h" #include "../h/cmap.h" #include "../h/text.h" #include "../h/vm.h" /* * Get virtual memory resources for a new process. * Called after page tables are allocated, but before they * are initialized, we initialize the memory management registers, * and then expand the page tables for the data and stack segments * creating zero fill pte's there. Text pte's are set up elsewhere. * * SHOULD FREE EXTRA PAGE TABLE PAGES HERE OR SOMEWHERE. */ vgetvm(ts, ds, ss) size_t ts, ds, ss; { mtpr(P0LR, ts); u.u_pcb.pcb_p0lr = ts | AST_NONE; mtpr(P1LR, P1TOP - UPAGES); u.u_pcb.pcb_p1lr = P1TOP - UPAGES; u.u_procp->p_tsize = ts; u.u_tsize = ts; expand((int)ss, P1BR); expand((int)ds, P0BR); } /* * Release the virtual memory resources (memory * pages, and swap area) associated with the current process. * Caller must not be swappable. Used at exit or execl. */ vrelvm() { register struct proc *p = u.u_procp; register int n; /* * Release memory; text first, then data and stack pages. */ xfree(); p->p_rssize -= vmemfree(dptopte(p, 0), p->p_dsize); p->p_rssize -= vmemfree(sptopte(p, p->p_ssize - 1), p->p_ssize); if (p->p_rssize != 0) panic("vrelvm rss"); /* * Wait for all page outs to complete, then * release swap space. */ p->p_swrss = 0; while (p->p_poip) sleep((caddr_t)&p->p_poip, PSWP+1); (void) vsexpand((size_t)0, &u.u_dmap, 1); (void) vsexpand((size_t)0, &u.u_smap, 1); p->p_tsize = 0; p->p_dsize = 0; p->p_ssize = 0; u.u_tsize = 0; u.u_dsize = 0; u.u_ssize = 0; /* * Consistency check that there are no mapped pages left. */ for (n = 0; n < NOFILE; n++) if (u.u_vrpages[n]) panic("vrelvm vrpages"); } /* * Pass virtual memory resources from p to q. * P's u. area is up, q's is uq. Used internally * when starting/ending a vfork(). */ vpassvm(p, q, up, uq, umap) register struct proc *p, *q; register struct user *up, *uq; struct pte *umap; { /* * Pass fields related to vm sizes. */ uq->u_tsize = q->p_tsize = p->p_tsize; up->u_tsize = p->p_tsize = 0; uq->u_dsize = q->p_dsize = p->p_dsize; up->u_dsize = p->p_dsize = 0; uq->u_ssize = q->p_ssize = p->p_ssize; up->u_ssize = p->p_ssize = 0; /* * Pass proc table paging statistics. */ q->p_swrss = p->p_swrss; p->p_swrss = 0; q->p_rssize = p->p_rssize; p->p_rssize = 0; q->p_poip = p->p_poip; p->p_poip = 0; /* * Relink text segment. */ q->p_textp = p->p_textp; xrepl(p, q); p->p_textp = 0; /* * Pass swap space maps. */ uq->u_dmap = up->u_dmap; up->u_dmap = zdmap; uq->u_smap = up->u_smap; up->u_smap = zdmap; /* * Pass u. paging statistics. */ uq->u_outime = up->u_outime; up->u_outime = 0; uq->u_vm = up->u_vm; up->u_vm = zvms; uq->u_cvm = up->u_cvm; up->u_cvm = zvms; /* * And finally, pass the page tables themselves. * On return we are running on the other set of * page tables, but still with the same u. area. */ vpasspt(p, q, up, uq, umap); } /* * Change the size of the data+stack regions of the process. * If the size is shrinking, it's easy-- just release virtual memory. * If it's growing, initalize new page table entries as * 'zero fill on demand' pages. */ expand(change, region) { register struct proc *p; register struct pte *base, *p0, *p1; struct pte proto; int a0, a1; p = u.u_procp; if (change == 0) return; if (change % CLSIZE) panic("expand"); #ifdef PGINPROF vmsizmon(); #endif /* * Update the sizes to reflect the change. Note that we may * swap as a result of a ptexpand, but this will work, because * the routines which swap out will get the current text and data * sizes from the arguments they are passed, and when the process * resumes the lengths in the proc structure are used to * build the new page tables. */ if (region == P0BR) { p->p_dsize += change; u.u_dsize += change; } else { p->p_ssize += change; u.u_ssize += change; } /* * Compute the end of the text+data regions and the beginning * of the stack region in the page tables, * and expand the page tables if necessary. */ p0 = (struct pte *)mfpr(P0BR) + mfpr(P0LR); p1 = (struct pte *)mfpr(P1BR) + mfpr(P1LR); if (change > p1 - p0) ptexpand(clrnd(ctopt(change - (p1 - p0)))); /* PTEXPAND SHOULD GIVE BACK EXCESS PAGE TABLE PAGES */ /* * Compute the base of the allocated/freed region. */ if (region == P0BR) { base = (struct pte *)mfpr(P0BR); base += (a0 = mfpr(P0LR)) + (change > 0 ? 0 : change); } else { base = (struct pte *)mfpr(P1BR); base += (a1 = mfpr(P1LR)) - (change > 0 ? change : 0); } /* * If we shrunk, give back the virtual memory. */ if (change < 0) p->p_rssize -= vmemfree(base, -change); /* * Update the processor length registers and copies in the pcb. */ if (region == P0BR) { mtpr(P0LR, a0 + change); u.u_pcb.pcb_p0lr = a0 + change | (u.u_pcb.pcb_p0lr & AST_CLR); } else { mtpr(P1LR, a1 - change); u.u_pcb.pcb_p1lr = a1 - change; } /* * If shrinking, clear pte's, otherwise * initialize zero fill on demand pte's. */ *(int *)&proto = PG_UW; if (change < 0) change = -change; else { proto.pg_fod = 1; ((struct fpte *)&proto)->pg_fileno = PG_FZERO; cnt.v_nzfod += change; } while (--change >= 0) *base++ = proto; /* * We changed mapping for the current process, * so must flush the translation buffer. */ mtpr(TBIA,0); } /* * Create a duplicate copy of the current process * in process slot p, which has been partially initialized * by newproc(). * * Could deadlock here if two large proc's get page tables * and then each gets part of his UPAGES if they then have * consumed all the available memory. This can only happen when * USRPTSIZE + UPAGES * NPROC > maxmem * which is impossible except on systems with tiny real memories, * when large procs stupidly fork() instead of vfork(). */ procdup(p, isvfork) register struct proc *p; { register int n; /* * Allocate page tab((les for new process, waiting * for memory to be free. */ while (vgetpt(p, vmemall) == 0) { kmapwnt++; sleep((caddr_t)kernelmap, PSWP+4); } /* * Snapshot the current u. area pcb and get a u. * for the new process, a copy of our u. */ resume(pcbb(u.u_procp)); (void) vgetu(p, vmemall, Forkmap, &forkutl, &u); /* * Arrange for a non-local goto when the new process * is started, to resume here, returning nonzero from setjmp. */ forkutl.u_pcb.pcb_sswap = u.u_ssav; if (setjmp(forkutl.u_ssav)) /* * Return 1 in child. */ return (1); /* * If the new process is being created in vfork(), then * exchange vm resources with it. We want to end up with * just a u. area and an empty p0 region, so initialize the * prototypes in the other area before the exchange. */ if (isvfork) { forkutl.u_pcb.pcb_p0lr = u.u_pcb.pcb_p0lr & AST_CLR; forkutl.u_pcb.pcb_p1lr = P1TOP - UPAGES; vpassvm(u.u_procp, p, &u, &forkutl, Forkmap); /* * Add extra mapping references to files which * have been vread() so that they can't be closed * during the vork(). */ for (n = 0; n < NOFILE; n++) if (forkutl.u_vrpages[n] != 0) forkutl.u_vrpages[n]++; /* * Return 0 in parent. */ return (0); } /* * A real fork; clear vm statistics of new process * and link into the new text segment. * Equivalent things happen during vfork() in vpassvm(). */ forkutl.u_vm = zvms; forkutl.u_cvm = zvms; forkutl.u_dmap = u.u_cdmap; forkutl.u_smap = u.u_csmap; forkutl.u_outime = 0; /* * Attach to the text segment. */ if (p->p_textp) { p->p_textp->x_count++; xlink(p); } /* * Duplicate data and stack space of current process * in the new process. */ vmdup(p, dptopte(p, 0), dptov(p, 0), p->p_dsize, CDATA); vmdup(p, sptopte(p, p->p_ssize - 1), sptov(p, p->p_ssize - 1), p->p_ssize, CSTACK); /* * Return 0 in parent. */ return (0); } vmdup(p, pte, v, count, type) struct proc *p; register struct pte *pte; register unsigned v; register size_t count; int type; { register struct pte *opte = vtopte(u.u_procp, v); register int i; while (count != 0) { count -= CLSIZE; if (opte->pg_fod) { v += CLSIZE; for (i = 0; i < CLSIZE; i++) *(int *)pte++ = *(int *)opte++; continue; } opte += CLSIZE; (void) vmemall(pte, CLSIZE, p, type); p->p_rssize += CLSIZE; for (i = 0; i < CLSIZE; i++) { copyseg((caddr_t)ctob(v+i), (pte+i)->pg_pfnum); *(int *)(pte+i) |= (PG_V|PG_M) + PG_UW; } v += CLSIZE; munlock(pte->pg_pfnum); pte += CLSIZE; } } /* * Check that a process will not be too large. */ chksize(ts, ds, ss) size_t ts, ds, ss; { if (ts>MAXTSIZ || ds>MAXDSIZ || ss>MAXSSIZ) { u.u_error = ENOMEM; return(1); } return (0); } + = *(int *)opte++; continue; } opte += CLSIZE; (void) vmemall(pte, CLSIZE, p, type); p->p_rssize += CLSIZE; for (i = 0; i < CLSIZE; i++) { copyseg((caddr_t)ctob(v+i), (pte+i)->pg_pfnum); *(int *)(pte+i) |= (PG_V|PG_M) + PG_UW; } v += CLSIZE; munlock(pte->pg_pfnum); pte += CLSIZE; }sys/sys/vmpt.c 444 0 33 34027 2516564220 6647 /* vmpt.c 4.11 81/04/15 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/map.h" #include "../h/mtpr.h" #include "../h/pte.h" #include "../h/cmap.h" #include "../h/vm.h" #include "../h/buf.h" #include "../h/text.h" #include "../h/mount.h" #include "../h/inode.h" /* * Get page tables for process p. Allocator * for memory is argument; process must be locked * from swapping if vmemall is used; if memall is * used, call will return w/o waiting for memory. * In any case an error return results if no user * page table space is available. */ vgetpt(p, pmemall) register struct proc *p; int (*pmemall)(); { register int a; register int i; if (p->p_szpt == 0) panic("vgetpt"); /* * Allocate space in the kernel map for this process. * Then allocate page table pages, and initialize the * process' p0br and addr pointer to be the kernel * virtual addresses of the base of the page tables and * the pte for the process pcb (at the base of the u.). */ a = rmalloc(kernelmap, p->p_szpt); if (a == 0) return (0); if ((*pmemall)(&Usrptmap[a], p->p_szpt, p, CSYS) == 0) { rmfree(kernelmap, p->p_szpt, a); return (0); } p->p_p0br = kmxtob(a); p->p_addr = uaddr(p); /* * Now validate the system page table entries for the * user page table pages, flushing old translations * for these kernel virtual addresses. Clear the new * page table pages for clean post-mortems. */ vmaccess(&Usrptmap[a], (caddr_t)p->p_p0br, p->p_szpt); for (i = 0; i < p->p_szpt; i++) clearseg(Usrptmap[a + i].pg_pfnum); return (1); } /* * Initialize text portion of page table. */ vinitpt(p) struct proc *p; { register struct text *xp; register struct proc *q; register struct pte *pte; register int i; struct pte proto; xp = p->p_textp; if (xp == 0) return; pte = tptopte(p, 0); /* * If there is another instance of same text in core * then just copy page tables from other process. */ if (q = xp->x_caddr) { bcopy((caddr_t)tptopte(q, 0), (caddr_t)pte, (unsigned) (sizeof(struct pte) * xp->x_size)); goto done; } /* * Initialize text page tables, zfod if we are loading * the text now; unless the process is demand loaded, * this will suffice as the text will henceforth either be * read from a file or demand paged in. */ *(int *)&proto = PG_URKR; if (xp->x_flag & XLOAD) { proto.pg_fod = 1; ((struct fpte *)&proto)->pg_fileno = PG_FZERO; } for (i = 0; i < xp->x_size; i++) *pte++ = proto; if ((xp->x_flag & XPAGI) == 0) goto done; /* * Text is demand loaded. If process is not loaded (i.e. being * swapped in) then retrieve page tables from swap area. Otherwise * this is the first time and we must initialize the page tables * from the blocks in the file system. */ if (xp->x_flag & XLOAD) vinifod((struct fpte *)tptopte(p, 0), PG_FTEXT, xp->x_iptr, (daddr_t)1, xp->x_size); else swap(p, xp->x_ptdaddr, (caddr_t)tptopte(p, 0), xp->x_size * sizeof (struct pte), B_READ, B_PAGET, swapdev, 0); done: /* * In the case where we are overlaying ourself with new page * table entries, old user-space translations should be flushed. */ if (p == u.u_procp) mtpr(TBIA, 0); } /* * Update the page tables of all processes linked * to a particular text segment, by distributing * dpte to the the text page at virtual frame v. * * Note that invalidation in the translation buffer for * the current process is the responsibility of the caller. */ distpte(xp, tp, dpte) struct text *xp; register size_t tp; register struct pte *dpte; { register struct proc *p; register struct pte *pte; register int i; for (p = xp->x_caddr; p; p = p->p_xlink) { pte = tptopte(p, tp); if (pte != dpte) for (i = 0; i < CLSIZE; i++) pte[i] = dpte[i]; } } /* * Release page tables of process p. */ vrelpt(p) register struct proc *p; { register int a; if (p->p_szpt == 0) return; a = btokmx(p->p_p0br); (void) vmemfree(&Usrptmap[a], p->p_szpt); rmfree(kernelmap, p->p_szpt, a); } #define Xu(a) t = up->u_pcb.a; up->u_pcb.a = uq ->u_pcb.a; uq->u_pcb.a = t; #define Xup(a) tp = up->u_pcb.a; up->u_pcb.a = uq ->u_pcb.a; uq->u_pcb.a = tp; #define Xp(a) t = p->a; p->a = q->a; q->a = t; #define Xpp(a) tp = p->a; p->a = q->a; q->a = tp; /* * Pass the page tables of process p to process q. * Used during vfork(). P and q are not symmetric; * p is the giver and q the receiver; after calling vpasspt * p will be ``cleaned out''. Thus before vfork() we call vpasspt * with the child as q and give it our resources; after vfork() we * call vpasspt with the child as p to steal our resources back. * We are cognizant of whether we are p or q because we have to * be careful to keep our u. area and restore the other u. area from * umap after we temporarily put our u. area in both p and q's page tables. */ vpasspt(p, q, up, uq, umap) register struct proc *p, *q; register struct user *up, *uq; struct pte *umap; { int t; int s; struct pte *tp; register int i; s = spl7(); /* conservative, and slightly paranoid */ Xu(pcb_szpt); Xu(pcb_p0lr); Xu(pcb_p1lr); Xup(pcb_p0br); Xup(pcb_p1br); /* * The u. area is contained in the process' p1 region. * Thus we map the current u. area into the process virtual space * of both sets of page tables we will deal with so that it * will stay with us as we rearrange memory management. */ for (i = 0; i < UPAGES; i++) if (up == &u) q->p_addr[i] = p->p_addr[i]; else p->p_addr[i] = q->p_addr[i]; mtpr(TBIA, 0); /* * Now have u. double mapped, and have flushed * any stale translations to new u. area. * Switch the page tables. */ Xpp(p_p0br); Xp(p_szpt); Xpp(p_addr); mtpr(P0BR, u.u_pcb.pcb_p0br); mtpr(P1BR, u.u_pcb.pcb_p1br); mtpr(P0LR, u.u_pcb.pcb_p0lr &~ AST_CLR); mtpr(P1LR, u.u_pcb.pcb_p1lr); /* * Now running on the ``other'' set of page tables. * Flush translation to insure that we get correct u. * Resurrect the u. for the other process in the other * (our old) set of page tables. Thus the other u. has moved * from its old (our current) set of page tables to our old * (its current) set of page tables, while we have kept our * u. by mapping it into the other page table and then keeping * the other page table. */ mtpr(TBIA, 0); for (i = 0; i < UPAGES; i++) { int pf; struct pte *pte; if (up == &u) { pf = umap[i].pg_pfnum; pte = &q->p_addr[i]; pte->pg_pfnum = pf; } else { pf = umap[i].pg_pfnum; pte = &p->p_addr[i]; pte->pg_pfnum = pf; } } mtpr(TBIA, 0); splx(s); } /* * Compute n((umber of pages to be allocated to the u. area * and data and stack area page tables, which are stored on the * disk immediately after the u. area. */ /*ARGSUSED*/ vusize(p, utl) register struct proc *p; struct user *utl; { register int tsz = p->p_tsize / NPTEPG; /* * We do not need page table space on the disk for page * table pages wholly containing text. This is well * understood in the code in vmswap.c. */ return (clrnd(UPAGES + clrnd(ctopt(p->p_tsize+p->p_dsize+p->p_ssize+UPAGES)) - tsz)); } /* * Get u area for process p. If a old u area is given, * then copy the new area from the old, else * swap in as specified in the proc structure. * * Since argument map/newu is potentially shared * when an old u. is provided we have to be careful not * to block after beginning to use them in this case. * (This is not true when called from swapin() with no old u.) */ vgetu(p, palloc, map, newu, oldu) register struct proc *p; int (*palloc)(); register struct pte *map; register struct user *newu; struct user *oldu; { register int i; if ((*palloc)(p->p_addr, clrnd(UPAGES), p, CSYS) == 0) return (0); /* * New u. pages are to be accessible in map/newu as well * as in process p's virtual memory. */ for (i = 0; i < UPAGES; i++) { map[i] = p->p_addr[i]; *(int *)(p->p_addr + i) |= PG_URKW | PG_V; } setredzone(p->p_addr, (caddr_t)0); vmaccess(map, (caddr_t)newu, UPAGES); /* * New u.'s come from forking or inswap. */ if (oldu) { bcopy((caddr_t)oldu, (caddr_t)newu, UPAGES * NBPG); newu->u_procp = p; } else { swap(p, p->p_swaddr, (caddr_t)0, ctob(UPAGES), B_READ, B_UAREA, swapdev, 0); if (newu->u_pcb.pcb_ssp != -1 || newu->u_pcb.pcb_esp != -1 || newu->u_tsize != p->p_tsize || newu->u_dsize != p->p_dsize || newu->u_ssize != p->p_ssize || newu->u_procp != p) panic("vgetu"); } /* * Initialize the pcb copies of the p0 and p1 region bases and * software page table size from the information in the proc structure. */ newu->u_pcb.pcb_p0br = p->p_p0br; newu->u_pcb.pcb_p1br = p->p_p0br + p->p_szpt * NPTEPG - P1TOP; newu->u_pcb.pcb_szpt = p->p_szpt; return (1); } /* * Release swap space for a u. area. */ vrelswu(p, utl) struct proc *p; struct user *utl; { rmfree(swapmap, ctod(vusize(p, utl)), p->p_swaddr); /* p->p_swaddr = 0; */ /* leave for post-mortems */ } /* * Get swap space for a u. area. */ vgetswu(p, utl) struct proc *p; struct user *utl; { p->p_swaddr = rmalloc(swapmap, ctod(vusize(p, utl))); return (p->p_swaddr); } /* * Release u. area, swapping it out if desired. * * Note: we run on the old u. after it is released into swtch(), * and are safe because nothing can happen at interrupt time. */ vrelu(p, swapu) register struct proc *p; { register int i; struct pte uu[UPAGES]; if (swapu) swap(p, p->p_swaddr, (caddr_t)0, ctob(UPAGES), B_WRITE, B_UAREA, swapdev, 0); for (i = 0; i < UPAGES; i++) uu[i] = p->p_addr[i]; (void) vmemfree(uu, clrnd(UPAGES)); } #ifdef unneeded int ptforceswap; #endif /* * Expand a page table, assigning new kernel virtual * space and copying the page table entries over both * in the system map and as necessary in the user page table space. */ ptexpand(change) register int change; { register struct pte *p1, *p2; register int i; register int spages, ss = P1TOP - mfpr(P1LR); register int kold = btokmx((struct pte *)mfpr(P0BR)); int knew, tdpages; int szpt = u.u_pcb.pcb_szpt; int s; if (change <= 0 || change % CLSIZE) panic("ptexpand"); /* * Change is the number of new page table pages needed. * Kold is the old index in the kernelmap of the page tables. * Allocate a new kernel map segment of size szpt+change for * the page tables, and the new page table pages in the * middle of this new region. */ top: #ifdef unneeded if (ptforceswap) goto bad; #endif if ((knew=rmalloc(kernelmap, szpt+change)) == 0) goto bad; spages = ss/NPTEPG; tdpages = szpt - spages; if (memall(&Usrptmap[knew+tdpages], change, u.u_procp, CSYS) == 0) { rmfree(kernelmap, szpt+change, knew); goto bad; } /* * Spages pages of u.+stack page tables go over unchanged. * Tdpages of text+data page table may contain a few stack * pages which need to go in one of the newly allocated pages; * this is a rough cut. */ kmcopy(knew, kold, tdpages); kmcopy(knew+tdpages+change, kold+tdpages, spages); /* * Validate and clear the newly allocated page table pages in the * center of the new region of the kernelmap. * Then flush translation since we changed * the kernel page tables. */ i = knew + tdpages; p1 = &Usrptmap[i]; p2 = p1 + change; while (p1 < p2) { *(int *)p1 |= PG_V | PG_KW; clearseg(p1->pg_pfnum); p1++; i++; } mtpr(TBIA, 0); /* * Move the stack or u. pte's which are before the newly * allocated pages into the last of the newly allocated pages. * They are taken from the end of the current p1 region, * and moved to the end of the new p1 region. There are * ss % NPTEPG such pte's. */ p1 = (struct pte *)mfpr(P1BR) + mfpr(P1LR); p2 = kmxtob(knew+szpt+change) - ss; for (i = ss - NPTEPG*spages; i != 0; i--) *p2++ = *p1++; /* * Now switch to the new page tables. */ mtpr(TBIA, 0); /* paranoid */ s = spl7(); /* conservative */ u.u_procp->p_p0br = kmxtob(knew); u.u_pcb.pcb_p0br = kmxtob(knew); u.u_pcb.pcb_p1br = kmxtob(knew+szpt+change) - P1TOP; u.u_pcb.pcb_szpt += change; u.u_procp->p_szpt += change; u.u_procp->p_addr = uaddr(u.u_procp); mtpr(P0BR, u.u_procp->p_p0br); mtpr(P1BR, u.u_pcb.pcb_p1br); mtpr(TBIA, 0); splx(s); /* * Finally, free old kernelmap. */ if (szpt) rmfree(kernelmap, szpt, kold); return; bad: /* * Swap out the process so that the unavailable * resource will be allocated upon swapin. * * When resume is executed for the process, * here is where it will resume. */ resume(pcbb(u.u_procp)); if (setjmp(u.u_ssav)) return; if (swapout(u.u_procp, (size_t)(mfpr(P0LR) - u.u_tsize), ss - UPAGES) == 0) { /* * No space to swap... it is inconvenient to try * to exit, so just wait a bit and hope something * turns up. Could deadlock here. * * SOMEDAY REFLECT ERROR BACK THROUGH expand TO CALLERS * (grow, sbreak) SO CAN'T DEADLOCK HERE. */ sleep((caddr_t)&lbolt, PRIBIO); goto top; } /* * Set SSWAP bit, so that when process is swapped back in * swapin will set u.u_pcb.pcb_sswap to u_sswap and force a * return from the setjmp() above. */ u.u_procp->p_flag |= SSWAP; swtch(); /* no return */ } kmcopy(to, from, count) register int to; int from; register int count; { register struct pte *tp = &Usrptmap[to]; register struct pte *fp = &Usrptmap[from]; while (count != 0) { *tp++ = *fp++; to++; count--; } } /* * Change protection codes of text segment. * Have to flush translation buffer since this * affect virtual memory mapping of current process. */ chgprot(addr, tprot) caddr_t addr; long tprot; { unsigned v; int tp; register struct pte *pte; register struct cmap *c; v = clbase(btop(addr)); if (!isatsv(u.u_procp, v)) { u.u_error = EFAULT; return (0); } tp = vtotp(u.u_procp, v); pte = tptopte(u.u_procp, tp); if (pte->pg_fod == 0 && pte->pg_pfnum) { c = &cmap[pgtocm(pte->pg_pfnum)]; if (c->c_blkno && c->c_mdev != MSWAPX) munhash(mount[c->c_mdev].m_dev, (daddr_t)c->c_blkno); } *(int *)pte &= ~PG_PROT; *(int *)pte |= tprot; distcl(pte); tbiscl(v); return (1); } settprot(tprot) long tprot; { register int *ptaddr, i; ptaddr = (int *)mfpr(P0BR); for (i = 0; i < u.u_tsize; i++) { ptaddr[i] &= ~PG_PROT; ptaddr[i] |= tprot; } mtpr(TBIA, 0); } vtotp(u.u_procp, v); pte = tptopte(u.u_procp, tp); if (pte->pg_fod == 0 && pte->pg_pfnum) { c = &cmap[pgtocm(pte->pg_pfnum)]; if (c->c_blkno && c->c_mdev != MSWAPX) munhash(mount[c->c_mdev].m_dev, (daddr_t)c->c_blkno); } *(int *)pte &= ~PG_PROT; *(int *)pte |= tprot; distcl(pte); tbiscl(v); return (1); } settprot(tprot) long tprot; { register int *ptaddr, i; ptaddr = (int *)mfpr(P0BR); for (i = 0; i < u.u_tsize; i++) { ptaddr[i] &= ~PG_PROT; ptaddr[i] |= tprotsys/sys/vmsched.c 444 0 33 30705 2632747447 7326 /* vmsched.c 4.16 81/12/02 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/seg.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/text.h" #include "../h/vm.h" #include "../h/cmap.h" int maxslp = MAXSLP; int saferss = SAFERSS; /* * The following parameters control operation of the page replacement * algorithm. They are initialized to 0, and then computed at boot time * based on the size of the system. If they are patched non-zero in * a loaded vmunix they are left alone and may thus be changed per system * using adb on the loaded system. */ int maxpgio = 0; int minfree = 0; int desfree = 0; int lotsfree = 0; int slowscan = 0; int fastscan = 0; int klin = KLIN; int klseql = KLSEQL; int klsdist = KLSDIST; int kltxt = KLTXT; int klout = KLOUT; int multprog = -1; /* so we don't count process 2 */ double avenrun[3]; /* load average, of runnable procs */ /* * Setup the paging constants for the clock algorithm. * Called after the system is initialized and the amount of memory * and number of paging devices is known. */ setupclock() { /* * Setup thresholds for paging: * lotsfree is threshold where paging daemon turns on * desfree is amount of memory desired free. if less * than this for extended period, do swapping * minfree is minimal amount of free memory which is * tolerable. * * Strategy of 4/22/81: * lotsfree is 1/4 of memory free. * desfree is 200k bytes, but at most 1/8 of memory * minfree is 64k bytes, but at m((ost 1/2 of desfree */ if (lotsfree == 0) lotsfree = LOOPPAGES / 4; if (desfree == 0) { desfree = (200*1024) / NBPG; if (desfree > LOOPPAGES / 8) desfree = LOOPPAGES / 8; } if (minfree == 0) { minfree = (64*1024) / NBPG; if (minfree > desfree/2) minfree = desfree / 2; } /* * Maxpgio thresholds how much paging is acceptable. * This figures that 2/3 busy on an arm is all that is * tolerable for paging. We assume one operation per disk rev. */ if (maxpgio == 0) maxpgio = (DISKRPM * 2) / 3; /* * Clock to scan using max of ~~10% of processor time for sampling, * this estimated to allow maximum of 200 samples per second. * This yields a ``fastscan'' of roughly (with CLSIZE=2): * <=1m 2m 3m 4m 8m * 5s 10s 15s 20s 40s */ if (nswdev == 1 && physmem*NBPG > 2*1024*(1024-16)) printf("WARNING: should run interleaved swap with >= 2Mb\n"); if (fastscan == 0) fastscan = (LOOPPAGES/CLSIZE) / 200; if (fastscan < 5) fastscan = 5; if (nswdev == 2) maxpgio = (maxpgio * 3) / 2; /* * Set slow scan time to 1/2 the fast scan time. */ if (slowscan == 0) slowscan = 2 * fastscan; #ifdef notdef printf("slowscan %d, fastscan %d, maxpgio %d\n", slowscan, fastscan, maxpgio); printf("lotsfree %d, desfree %d, minfree %d\n", lotsfree, desfree, minfree); #endif } /* * The main loop of the scheduling (swapping) process. * * The basic idea is: * see if anyone wants to be swapped in; * swap out processes until there is room; * swap him in; * repeat. * If the paging rate is too high, or the average free memory * is very low, then we do not consider swapping anyone in, * but rather look for someone to swap out. * * The runout flag is set whenever someone is swapped out. * Sched sleeps on it awaiting work. * * Sched sleeps on runin whenever it cannot find enough * core (by swapping out or otherwise) to fit the * selected swapped process. It is awakened when the * core situation changes and in any case once per second. * * sched DOESN'T ACCOUNT FOR PAGE TABLE SIZE IN CALCULATIONS. */ #define swappable(p) \ (((p)->p_flag&(SSYS|SLOCK|SULOCK|SLOAD|SPAGE|SKEEP|SWEXIT|SPHYSIO))==SLOAD) /* insure non-zero */ #define nz(x) (x != 0 ? x : 1) #define NBIG 4 #define MAXNBIG 10 int nbig = NBIG; struct bigp { struct proc *bp_proc; int bp_pri; struct bigp *bp_link; } bigp[MAXNBIG], bplist; sched() { register struct proc *rp, *p, *inp; int outpri, inpri, rppri; int sleeper, desperate, deservin, needs, divisor; register struct bigp *bp, *nbp; int biggot, gives; loop: wantin = 0; deservin = 0; sleeper = 0; p = 0; /* * See if paging system is overloaded; if so swap someone out. * Conditions for hard outswap are: * if need kernel map (mix it up). * or * 1. if there are at least 2 runnable processes (on the average) * and 2. the paging rate is excessive or memory is now VERY low. * and 3. the short (5-second) and longer (30-second) average * memory is less than desirable. */ if (kmapwnt || (avenrun[0] >= 2 && imax(avefree, avefree30) < desfree && (rate.v_pgin + rate.v_pgout > maxpgio || avefree < minfree))) { desperate = 1; goto hardswap; } desperate = 0; /* * Not desperate for core, * look for someone who deserves to be brought in. */ outpri = -20000; for (rp = proc; rp < procNPROC; rp++) switch(rp->p_stat) { case SRUN: if ((rp->p_flag&SLOAD) == 0) { rppri = rp->p_time - rp->p_swrss / nz((maxpgio/2) * (klin * CLSIZE)) + rp->p_slptime - (rp->p_nice-NZERO)*8; if (rppri > outpri) { if (rp->p_poip) continue; if (rp->p_textp && rp->p_textp->x_poip) continue; p = rp; outpri = rppri; } } continue; case SSLEEP: case SSTOP: if ((freemem < desfree || rp->p_rssize == 0) && rp->p_slptime > maxslp && (!rp->p_textp || (rp->p_textp->x_flag&XLOCK)==0) && swappable(rp)) { /* * Kick out deadwood. */ (void) spl6(); rp->p_flag &= ~SLOAD; if (rp->p_stat == SRUN) remrq(rp); (void) spl0(); (void) swapout(rp, rp->p_dsize, rp->p_ssize); goto loop; } continue; } /* * No one wants in, so nothing to do. */ if (outpri == -20000) { (void) spl6(); if (wantin) { wantin = 0; sleep((caddr_t)&lbolt, PSWP); } else { runout++; sleep((caddr_t)&runout, PSWP); } (void) spl0(); goto loop; } /* * Decide how deserving this guy is. If he is deserving * we will be willing to work harder to bring him in. * Needs is an estimate of how much core he will need. * If he has been out for a while, then we will * bring him in with 1/2 the core he will need, otherwise * we are conservative. */ deservin = 0; divisor = 1; if (outpri > maxslp/2) { deservin = 1; divisor = 2; } needs = p->p_swrss; if (p->p_textp && p->p_textp->x_ccount == 0) needs += p->p_textp->x_swrss; needs = imin(needs, lotsfree); if (freemem - deficit > needs / divisor) { deficit += needs; if (swapin(p)) goto loop; deficit -= imin(needs, deficit); } hardswap: /* * Need resources (kernel map or memory), swap someone out. * Select the nbig largest jobs, then the oldest of these * is ``most likely to get booted.'' */ inp = p; sleeper = 0; if (nbig > MAXNBIG) nbig = MAXNBIG; if (nbig < 1) nbig = 1; biggot = 0; bplist.bp_link = 0; for (rp = proc; rp < procNPROC; rp++) { if (!swappable(rp)) continue; if (rp->p_stat==SZOMB) continue; if (rp == inp) continue; if (rp->p_textp && rp->p_textp->x_flag&XLOCK) continue; if (rp->p_slptime > maxslp && (rp->p_stat==SSLEEP&&rp->p_pri>PZERO||rp->p_stat==SSTOP)) { if (sleeper < rp->p_slptime) { p = rp; sleeper = rp->p_slptime; } } else if (!sleeper && (rp->p_stat==SRUN||rp->p_stat==SSLEEP)) { rppri = rp->p_rssize; if (rp->p_textp) rppri += rp->p_textp->x_rssize/rp->p_textp->x_ccount; if (biggot < nbig) nbp = &bigp[biggot++]; else { nbp = bplist.bp_link; if (nbp->bp_pri > rppri) continue; bplist.bp_link = nbp->bp_link; } for (bp = &bplist; bp->bp_link; bp = bp->bp_link) if (rppri < bp->bp_link->bp_pri) break; nbp->bp_link = bp->bp_link; bp->bp_link = nbp; nbp->bp_pri = rppri; nbp->bp_proc = rp; } } if (!sleeper) { p = NULL; inpri = -1000; for (bp = bplist.bp_link; bp; bp = bp->bp_link) { rp = bp->bp_proc; rppri = rp->p_time+rp->p_nice-NZERO; if (rppri >= inpri) { p = rp; inpri = rppri; } } } /* * If we found a long-time sleeper, or we are desperate and * found anyone to swap out, or if someone deserves to come * in and we didn't find a sleeper, but found someone who * has been in core for a reasonable length of time, then * we kick the poor luser out. */ if (sleeper || desperate && p || deservin && inpri > maxslp) { (void) spl6(); p->p_flag &= ~SLOAD; if (p->p_stat == SRUN) remrq(p); (void) spl0(); if (desperate) { /* * Want to give this space to the rest of * the processes in core so give them a chance * by increasing the deficit. */ gives = p->p_rssize; if (p->p_textp) gives += p->p_textp->x_rssize / p->p_textp->x_ccount; gives = imin(gives, lotsfree); deficit += gives; } else gives = 0; /* someone else taketh away */ if (swapout(p, p->p_dsize, p->p_ssize) == 0) deficit -= imin(gives, deficit); goto loop; } /* * Want to swap someone in, but can't * so wait on runin. */ (void) spl6(); runin++; sleep((caddr_t)&runin, PSWP); (void) spl0(); goto loop; } vmmeter() { register unsigned *cp, *rp, *sp; deficit -= imin(deficit, imax(deficit / 10, ((klin * CLSIZE) / 2) * maxpgio / 2)); ave(avefree, freemem, 5); ave(avefree30, freemem, 30); /* v_pgin is maintained by clock.c */ cp = &cnt.v_first; rp = &rate.v_first; sp = &sum.v_first; while (cp <= &cnt.v_last) { ave(*rp, *cp, 5); *sp += *cp; *cp = 0; rp++, cp++, sp++; } if (time % 5 == 0) { vmtotal(); rate.v_swpin = cnt.v_swpin; sum.v_swpin += cnt.v_swpin; cnt.v_swpin = 0; rate.v_swpout = cnt.v_swpout; sum.v_swpout += cnt.v_swpout; cnt.v_swpout = 0; } if (avefree < minfree && runout || proc[0].p_slptime > maxslp/2) { runout = 0; runin = 0; wakeup((caddr_t)&runin); wakeup((caddr_t)&runout); } } vmpago() { register int vavail; register int scanrate; /* * Compute new rate for clock; if * nonzero, restart clock. * Rate ranges linearly from one rev per * slowscan seconds when there is lotsfree memory * available to one rev per fastscan seconds when * there is no memory available. */ nscan = desscan = 0; vavail = freemem - deficit; if (vavail < 0) vavail = 0; if (freemem >= lotsfree) return; scanrate = (slowscan * vavail + fastscan * (lotsfree - vavail)) / nz(lotsfree); desscan = (LOOPPAGES / CLSIZE) / nz(scanrate); /* * DIVIDE BY 4 TO ACCOUNT FOR RUNNING 4* A SECOND (see clock.c) */ desscan /= 4; wakeup((caddr_t)&proc[2]); } vmtotal() { register struct proc *p; register struct text *xp; int nrun = 0; total.t_vmtxt = 0; total.t_avmtxt = 0; total.t_rmtxt = 0; total.t_armtxt = 0; for (xp = text; xp < textNTEXT; xp++) if (xp->x_iptr) { total.t_vmtxt += xp->x_size; total.t_rmtxt += xp->x_rssize; for (p = xp->x_caddr; p; p = p->p_xlink) switch (p->p_stat) { case SSTOP: case SSLEEP: if (p->p_slptime >= maxslp) continue; /* fall into... */ case SRUN: case SIDL: total.t_avmtxt += xp->x_size; total.t_armtxt += xp->x_rssize; goto next; } next: ; } total.t_vm = 0; total.t_avm = 0; total.t_rm = 0; total.t_arm = 0; total.t_rq = 0; total.t_dw = 0; total.t_pw = 0; total.t_sl = 0; total.t_sw = 0; for (p = proc; p < procNPROC; p++) { if (p->p_flag & SSYS) continue; if (p->p_stat && p->p_stat != SZOMB) { total.t_vm += p->p_dsize + p->p_ssize; total.t_rm += p->p_rssize; switch (p->p_stat) { case SSLEEP: case SSTOP: if (p->p_pri <= PZERO) nrun++; if (p->p_flag & SPAGE) total.t_pw++; else if (p->p_flag & SLOAD) { if (p->p_pri <= PZERO) total.t_dw++; else if (p->p_slptime < maxslp) total.t_sl++; } else if (p->p_slptim((e < maxslp) total.t_sw++; if (p->p_slptime < maxslp) goto active; break; case SRUN: case SIDL: nrun++; if (p->p_flag & SLOAD) total.t_rq++; else total.t_sw++; active: total.t_avm += p->p_dsize + p->p_ssize; total.t_arm += p->p_rssize; break; } } } total.t_vm += total.t_vmtxt; total.t_avm += total.t_avmtxt; total.t_rm += total.t_rmtxt; total.t_arm += total.t_armtxt; total.t_free = avefree; loadav(avenrun, nrun); } /* * Constants for averages over 1, 5, and 15 minutes * when sampling at 5 second intervals. */ double cexp[3] = { 0.9200444146293232, /* exp(-1/12) */ 0.9834714538216174, /* exp(-1/60) */ 0.9944598480048967, /* exp(-1/180) */ }; /* * Compute a tenex style load average of a quantity on * 1, 5 and 15 minute intervals. */ loadav(avg, n) register double *avg; int n; { register int i; for (i = 0; i < 3; i++) avg[i] = cexp[i] * avg[i] + n * (1.0 - cexp[i]); } avefree; loadav(avenrun, nrun); } /* * Constants for avesys/sys/vmsubr.c 444 0 33 13123 2535000526 7164 /* vmsubr.c 4.6 81/05/28 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/vm.h" #include "../h/proc.h" #include "../h/mtpr.h" #include "../h/pte.h" #include "../h/cmap.h" #include "../h/inode.h" #include "../h/buf.h" #include "../h/text.h" /* * Make uarea of process p addressible at kernel virtual * address uarea through sysmap locations starting at map. */ uaccess(p, map, uarea) register struct proc *p; struct pte *map; register struct user *uarea; { register int i; register struct pte *mp = map; for (i = 0; i < UPAGES; i++) { *(int *)mp = 0; mp->pg_pfnum = p->p_addr[i].pg_pfnum; mp++; } vmaccess(map, (caddr_t)uarea, UPAGES); } /* * Validate the kernel map for size ptes which * start at ppte in the sysmap, and which map * kernel virtual addresses starting with vaddr. */ vmaccess(ppte, vaddr, size) register struct pte *ppte; register caddr_t vaddr; register int size; { while (size != 0) { *(int *)ppte++ |= PG_V|PG_KW; mtpr(TBIS, vaddr); vaddr += NBPG; --size; } } /* * Convert a pte pointer to * a virtual page number. */ ptetov(p, pte) register struct proc *p; register struct pte *pte; { if (isatpte(p, pte)) return (tptov(p, ptetotp(p, pte))); else if (isadpte(p, pte)) return (dptov(p, ptetodp(p, pte))); else return (sptov(p, ptetosp(p, pte))); } /* * Convert a virtual page * number to a pte address. */ struct pte * vtopte(p, v) register struct proc *p; register unsigned v; { if (isatsv(p, v)) return (tptopte(p, vtotp(p, v))); else if (isadsv(p, v)) return (dptopte(p, vtodp(p, v))); else return (sptopte(p, vtosp(p, v))); } struct buf *vbmap(); /* * Initialize the page tables for paging from an inode, * by scouring up the indirect blocks in order. * Corresponding area of memory should have been vmemfree()d * first or just created. */ vinifod(pte, fileno, ip, bstart, count) register struct fpte *pte; int fileno; register struct inode *ip; daddr_t bstart; size_t count; { register int i, j; struct buf *bp; int indx; register daddr_t *pp; while (count > 0) { if (bstart < NADDR - 3) { ((struct pte *)pte)->pg_vreadm = 0; pte->pg_fod = 1; pte->pg_fileno = fileno; pte->pg_blkno = ip ? ip->i_un.i_addr[bstart] : 0; if (pte->pg_blkno == 0) { pte->pg_fileno = PG_FZERO; pte->pg_blkno = 0; cnt.v_nzfod += CLSIZE; } else if (fileno == PG_FTEXT) cnt.v_nexfod += CLSIZE; else { cnt.v_nvrfod += CLSIZE; u.u_vrpages[fileno] += CLSIZE; } for (j = 1; j < CLSIZE; j++) pte[j] = pte[0]; pte += CLSIZE; bstart++; count -= CLSIZE; } else { mtpr(TBIA, 0); /* conservative */ bp = vbmap(ip, bstart); indx = (bstart - (NADDR - 3)) % NINDIR; i = imin((NINDIR - indx) * CLSIZE, count); bstart += i / CLSIZE; count -= i; if (bp) { pp = &bp->b_un.b_daddr[indx]; do { ((struct pte *)pte)->pg_vreadm = 0; pte->pg_fod = 1; pte->pg_blkno = *pp++; if (pte->pg_blkno) { pte->pg_fileno = fileno; if (fileno == PG_FTEXT) cnt.v_nexfod += CLSIZE; else { cnt.v_nvrfod += CLSIZE; u.u_vrpages[fileno] += CLSIZE; } } else { pte->pg_fileno = PG_FZERO; pte->pg_blkno = 0; cnt.v_nzfod += CLSIZE; } for (j = 1; j < CLSIZE; j++) pte[j] = pte[0]; pte += CLSIZE; } while ((i -= CLSIZE) > 0); brelse(bp); } else { cnt.v_nzfod += i; do { ((struct pte *)pte)->pg_vreadm = 0; pte->pg_fod = 1; pte->pg_fileno = PG_FZERO; distcl(pte); pte += CLSIZE; } while ((i -= CLSIZE) > 0); } } } mtpr(TBIA, 0); /* necessary! */ } /* * Vbmap returns a block full of indirect pointers for a given block offset * in a file. It returns 0 if a missing address block was encountered, * in which case the pages can be normal zfod pages. */ struct buf * vbmap(ip, bn) register struct inode *ip; daddr_t bn; { register i; struct buf *bp; int j, sh; daddr_t nb; dev_t dev = ip->i_dev; if (bn < NADDR-3) panic("vbmap"); if (ip == 0) return (0); /* * addresses NADDR-3, NADDR-2, and NADDR-1 * have single, double, triple indirect blocks. * the first step is to determine * how many levels of indirection. */ sh = 0; nb = 1; bn -= NADDR-3; for (j = 3; j > 0; j--) { sh += NSHIFT; nb <<= NSHIFT; if(bn < nb) break; bn -= nb; } if (j == 0) goto noblk; /* * fetch the address from the inode */ nb = ip->i_un.i_addr[NADDR-j]; /* * fetch through the indirect blocks */ for (;;) { if (nb == 0) return (0); bp = bread(dev, nb); if (bp->b_flags & B_ERROR) { brelse(bp); goto noblk; } if (j == 3) break; j++; sh -= NSHIFT; i = (bn>>sh) & NMASK; nb = bp->b_un.b_daddr[i]; brelse(bp); if (nb == 0) goto noblk; } return (bp); noblk: return ((struct buf *)0); } getmemc(addr) caddr_t addr; { register int c; struct pte savemap; savemap = mmap[0]; *(int *)mmap = PG_V | PG_KR | btop(addr); mtpr(TBIS, vmmap); c = *(char *)&vmmap[(int)addr & PGOFSET]; mmap[0] = savemap; mtpr(TBIS, vmmap); return (c & 0377); } putmemc(addr, val) caddr_t addr; { struct pte savemap; savemap = mmap[0]; *(int *)mmap = PG_V | PG_KW | btop(addr); mtpr(TBIS, vmmap); *(char *)&vmmap[(int)addr & PGOFSET] = val; mmap[0] = savemap; mtpr(TBIS, vmmap); } /* * Set a red zone in the kernel stack after the u. area. */ setredzone(pte, vaddr) register struct pte *pte; caddr_t vaddr; { pte += (sizeof (struct user) + NBPG - 1) / NBPG; *(int *)pte &= ~PG_PROT; *(int *)pte |= PG_URKR; if (vaddr) mtpr(TBIS, vaddr + sizeof (struct user)); } ddr, val) caddr_t addr; { struct pte savemap; savemap = mmap[0]; *(int *)mmap = PG_V | PG_KW | btop(addr); mtpr(TBIS, vmmap); *(char *)&vmmap[(int)addr & PGOFSET] = val; mmap[0] = savemap; mtpr(TBIS, vmmap); } /* * Set a red zone in the kernel stack after the u. area. */ setredzone(pte, vaddr) register struct pte *pte; caddr_t vaddr; { pte += (sizeof (struct user) + NBPG - 1) / NBPG; *(int *)pte &= ~PG_PROT; sys/sys/vmswap.c 444 0 33 12061 2552536343 7175 /* vmswap.c 4.3 81/06/11 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/text.h" #include "../h/map.h" #include "../h/buf.h" #include "../h/pte.h" #include "../h/mtpr.h" #include "../h/cmap.h" #include "../h/vm.h" /* * Swap a process in. */ swapin(p) register struct proc *p; { register struct text *xp; register int i, s; if (xp = p->p_textp) xlock(xp); p->p_szpt = clrnd(ctopt(p->p_ssize+p->p_dsize+p->p_tsize+UPAGES)); if (vgetpt(p, memall) == 0) goto nomem; if (vgetu(p, memall, Swapmap, &swaputl, (struct user *)0) == 0) { vrelpt(p); goto nomem; } swdspt(p, &swaputl, B_READ); /* * Make sure swdspt didn't smash u. pte's */ for (i = 0; i < UPAGES; i++) { if (Swapmap[i].pg_pfnum != p->p_addr[i].pg_pfnum) panic("swapin"); } vrelswu(p, &swaputl); if (xp) { xlink(p); xunlock(xp); } p->p_rssize = 0; s = spl6(); if (p->p_stat == SRUN) setrq(p); p->p_flag |= SLOAD; if (p->p_flag & SSWAP) { swaputl.u_pcb.pcb_sswap = u.u_ssav; p->p_flag &= ~SSWAP; } splx(s); p->p_time = 0; multprog++; cnt.v_swpin++; return (1); nomem: if (xp) xunlock(xp); return (0); } int xswapwant, xswaplock; /* * Swap out process p. * ds and ss are the old data size and the stack size * of the process, and are supplied during page table * expansion swaps. */ swapout(p, ds, ss) register struct proc *p; size_t ds, ss; { register struct pte *map; register struct user *utl; register int a; int s; int rc = 1; s = 1; map = Xswapmap; utl = &xswaputl; if (xswaplock & s) if ((xswaplock & 2) == 0) { s = 2; map = Xswap2map; utl = &xswap2utl; } a = spl6(); while (xswaplock & s) { xswapwant |= s; sleep((caddr_t)map, PSWP); } xswaplock |= s; splx(a); uaccess(p, map, utl); if (vgetswu(p, utl) == 0) { swkill(p, "swapout"); rc = 0; goto out; } utl->u_vm.vm_nswap++; utl->u_odsize = ds; utl->u_ossize = ss; p->p_flag |= SLOCK; if (p->p_textp) { if (p->p_textp->x_ccount =((= 1) p->p_textp->x_swrss = p->p_textp->x_rssize; xccdec(p->p_textp, p); } p->p_swrss = p->p_rssize; vsswap(p, dptopte(p, 0), CDATA, 0, ds, &utl->u_dmap); vsswap(p, sptopte(p, CLSIZE-1), CSTACK, 0, ss, &utl->u_smap); if (p->p_rssize != 0) panic("swapout rssize"); swdspt(p, utl, B_WRITE); vrelu(p, 1); if ((p->p_flag & SLOAD) && (p->p_stat != SRUN || p != u.u_procp)) panic("swapout"); p->p_flag &= ~SLOAD; vrelpt(p); p->p_flag &= ~SLOCK; p->p_time = 0; multprog--; cnt.v_swpout++; if(runout) { runout = 0; wakeup((caddr_t)&runout); } out: xswaplock &= ~s; if (xswapwant & s) { xswapwant &= ~s; wakeup((caddr_t)map); } if (rc == 0) { a = spl6(); p->p_flag |= SLOAD; if (p != u.u_procp && p->p_stat == SRUN) setrq(p); splx(a); } return (rc); } /* * Swap the data and stack page tables in or out. * Only hard thing is swapping out when new pt size is different than old. * If we are growing new pt pages, then we must spread pages with 2 swaps. * If we are shrinking pt pages, then we must merge stack pte's into last * data page so as not to lose them (and also do two swaps). */ swdspt(p, utl, rdwri) register struct proc *p; register struct user *utl; { register int szpt, tsz, ssz; int tdlast, slast, tdsz; register struct pte *pte; register int i; szpt = clrnd(ctopt(p->p_tsize+p->p_dsize+p->p_ssize+UPAGES)); tsz = p->p_tsize / NPTEPG; if (szpt == p->p_szpt) { swptstat.pteasy++; swpt(rdwri, p, 0, tsz, (p->p_szpt - tsz) * NBPG - UPAGES * sizeof (struct pte)); goto check; } if (szpt < p->p_szpt) swptstat.ptshrink++; else swptstat.ptexpand++; ssz = clrnd(ctopt(utl->u_ossize+UPAGES)); if (szpt < p->p_szpt && utl->u_odsize && (utl->u_ossize+UPAGES)) { /* * Page tables shrinking... see if last text+data and * last stack page must be merged... if so, copy * stack pte's from last stack page to end of last * data page, and decrease size of stack pt to be swapped. */ tdlast = (p->p_tsize + utl->u_odsize) % (NPTEPG * CLSIZE); slast = (utl->u_ossize + UPAGES) % (NPTEPG * CLSIZE); if (tdlast && slast && tdlast + slast <= (NPTEPG * CLSIZE)) { swptstat.ptpack++; tdsz = clrnd(ctopt(p->p_tsize + utl->u_odsize)); bcopy((caddr_t)sptopte(p, utl->u_ossize - 1), (caddr_t)&p->p_p0br[tdsz * NPTEPG - slast], (unsigned)(slast * sizeof (struct pte))); ssz -= CLSIZE; } } if (ssz) swpt(rdwri, p, szpt - ssz - tsz, p->p_szpt - ssz, ssz * NBPG); if (utl->u_odsize) swpt(rdwri, p, 0, tsz, (clrnd(ctopt(p->p_tsize + utl->u_odsize)) - tsz) * NBPG); check: for (i = 0; i < utl->u_odsize; i++) { pte = dptopte(p, i); if (pte->pg_v || pte->pg_fod == 0 && (pte->pg_pfnum||pte->pg_m)) panic("swdspt"); } for (i = 0; i < utl->u_ossize; i++) { pte = sptopte(p, i); if (pte->pg_v || pte->pg_fod == 0 && (pte->pg_pfnum||pte->pg_m)) panic("swdspt"); } } swpt(rdwri, p, doff, a, n) int rdwri; struct proc *p; int doff, a, n; { if (n <= 0) return; swap(p, p->p_swaddr + ctod(UPAGES) + doff, (caddr_t)&p->p_p0br[a * NPTEPG], n, rdwri, B_PAGET, swapdev, 0); } 0; i < utl->u_odsize; i++) { pte = dptopte(p, i); if (pte->pg_v || pte->pg_fod == 0 && (pte->pg_pfnum||pte->pg_m)) panic("swdspt"); } for (i = 0; i < utl->u_ossize; i++) { pte = sptopte(p, i); if (pte->pg_v || pte->pg_fod == 0 && (pte->pg_pfnum||pte->pg_m)) panic("swdspt"); } } swpt(rdwri, p, doff, a, n) int rdwri; struct proc *p; int doff, a, n; { if (n <= 0) return; swap(p, p->p_swaddr + ctod(UPAGES) + doff, (caddr_t)&p->p_p0bsys/sys/vmsys.c 444 0 33 11265 2522400704 7032 /* vmsys.c 4.11 81/04/23 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/reg.h" #include "../h/file.h" #include "../h/inode.h" #include "../h/vm.h" #include "../h/buf.h" #include "../h/pte.h" #include "../h/cmap.h" #include "../h/tty.h" #include "../h/mtpr.h" #include "../h/vlimit.h" #include "../h/trace.h" #include vfork() { fork1(1); } vread() { vrdwr(FREAD); } vwrite() { vrdwr(FWRITE); } resuba() { if (suser()) ubareset(u.u_arg[0]); } futz() { } segalloc() { u.u_error = EIO; } segfree() { u.u_error = EIO; } segsync() { u.u_error = EIO; } int both; vadvise() { register struct a { int anom; } *uap; register struct proc *rp = u.u_procp; int oanom = rp->p_flag & SUANOM; register struct pte *pte; register struct cmap *c; register int i; uap = (struct a *)u.u_ap; #ifdef TRACE trace(TR_VADVISE, uap->anom, u.u_procp->p_pid); #endif rp->p_flag &= ~(SSEQL|SUANOM); switch (uap->anom) { case VA_ANOM: rp->p_flag |= SUANOM; break; case VA_SEQL: rp->p_flag |= SSEQL; break; } if (both || (oanom && (rp->p_flag & SUANOM) == 0)) { for (i = 0; i < rp->p_dsize; i += CLSIZE) { pte = dptopte(rp, i); if (pte->pg_v) { c = &cmap[pgtocm(pte->pg_pfnum)]; if (c->c_lock) continue; pte->pg_v = 0; if (anycl(pte, pg_m)) pte->pg_m = 1; distcl(pte); } } mtpr(TBIA, 0); } } vtimes() { register struct a { struct vtimes *par_vm; struct vtimes *ch_vm; } *uap = (struct a *)u.u_ap; if (uap->par_vm == 0) goto onlych; if (copyout((caddr_t)&u.u_vm, (caddr_t)uap->par_vm, sizeof(struct vtimes)) < 0) u.u_error = EFAULT; onlych: if (uap->ch_vm == 0) return; if (copyout((caddr_t)&u.u_cvm, (caddr_t)uap->ch_vm, sizeof(struct vtimes)) < 0) u.u_error = EFAULT; } vmsadd(vp, wp) register struct vtimes *vp, *wp; { vp->vm_utime += wp->vm_utime; vp->vm_stime += wp->vm_stime; vp->vm_nswap += wp->vm_nswap; vp->vm_idsrss += wp->vm_idsrss; vp->vm_ixrss += wp->vm_ixrss; if (vp->vm_maxrss < wp->vm_maxrss) vp->vm_maxrss = wp->vm_maxrss; vp->vm_majflt += wp->vm_majflt; vp->vm_minflt += wp->vm_minflt; vp->vm_inblk += wp->vm_inblk; vp->vm_oublk += wp->vm_oublk; } /* * Revoke access the current tty by all processes. * Used only by the super-user in init * to give ``clean'' terminals at login. */ vhangup() { if (!suser()) return; if (u.u_ttyp == NULL) return; forceclose(u.u_ttyd); if ((u.u_ttyp->t_state) & ISOPEN) gsignal(u.u_ttyp->t_pgrp, SIGHUP); } forceclose(dev) dev_t dev; { register struct file *fp; register struct inode *ip; register int n = 0; for (fp = &file[0]; fp < fileNFILE; fp++) { if (fp->f_count==0) continue; ip = fp->f_inode; if ((ip->i_mode & IFMT) != IFCHR) continue; if (ip->i_un.i_rdev != dev) continue; fp->f_flag &= ~(FREAD|FWRITE); n++; } return (n); } /* * Affect per-process limits. * To just return old limit, specify negative new limit. */ vlimit() { register struct a { unsigned which; int limit; } *uap; uap = (struct a *)u.u_ap; if (uap->which > NLIMITS) { u.u_error = EINVAL; return; } u.u_r.r_val1 = u.u_limit[uap->which]; if (uap->limit < 0) return; switch (uap->which) { case LIM_DATA: if (uap->limit > ctob(MAXDSIZ)) uap->limit = ctob(MAXDSIZ); break; case LIM_STACK: if (uap->limit > ctob(MAXSSIZ)) uap->limit = ctob(MAXSSIZ); break; } if (u.u_limit[LIM_NORAISE] && uap->limit > u.u_limit[uap->which] && !suser()) { u.u_error = EACCES; return; } u.u_limit[uap->which] = uap->limit; if (uap->which == LIM_MAXRSS) u.u_procp->p_maxrss = uap->limit/NBPG; } #ifdef TRACE int nvualarm; vtrace() { register struct a { int request; int value; } *uap; int vdoualarm(); uap = (struct a *)u.u_ap; switch (uap->request) { case VTR_DISABLE: /* disable a trace point */ case VTR_ENABLE: /* enable a trace point */ if (uap->value < 0 || uap->value >= TR_NFLAGS) u.u_error = EINVAL; else { u.u_r.r_val1 = traceflags[uap->value]; traceflags[uap->value] = uap->request; } break; case VTR_VALUE: /* return a trace point setting */ if (uap->value < 0 || uap->value >= TR_NFLAGS) u.u_error = EINVAL; else u.u_r.r_val1 = traceflags[uap->value]; break; case VTR_UALARM: /* set a real-time ualarm, less than 1 min */ if (uap->value <= 0 || uap->value > 60 * hz || nvualarm > 5) u.u_error = EINVAL; else { nvualarm++; timeout(vdoualarm, (caddr_t)u.u_procp->p_pid, uap->value); } break; case VTR_STAMP: trace(TR_STAMP, uap->value, 0); break; } } vdoualarm(arg) int arg; { register struct proc *p; p = pfind(arg); if (p) psignal(p, 16); nvualarm--; } #endif VAL; else u.u_r.r_val1 = traceflags[uap->value]; break; case VTR_UALARM: /* set a real-time ualarm, less than 1 min */ if (uap->value <= 0 || uap->value > 60 * hz || nvualarm > 5) u.u_error = EINVAL; else { nvualarm++; timeout(vdoualarm, (caddr_t)u.u_procp->p_pid, uap->value); } break; cassys/sys/vmsysent.c 444 0 33 4624 2531444652 7534 /* vmsysent.c 4.10 81/04/13 */ /* * This table is the switch used to transfer * to the appropriate routine for processing a vmunix special system call. * Each row contains the number of arguments expected * and a pointer to the routine. */ 0, nosys, /* 64 +0 = nosys */ 0, nosys, /* 64 +1 = nosys */ 0, vfork, /* 64 +2 = vfork */ 3, vread, /* 64 +3 = vread */ 3, vwrite, /* 64 +4 = vwrite */ 3, segalloc, /* 64 +5 = segalloc */ 1, segfree, /* 64 +6 = segfree */ 1, segsync, /* 64 +((7 = segsync */ 1, vadvise, /* 64 +8 = vadvise */ 0, nosys, /* 64 +9 = nosys */ 0, nosys, /* 64+10 = nosys */ 0, nosys, /* 64+11 = nosys */ 1, vhangup, /* 64+12 = vhangup */ 2, vlimit, /* 64+13 = vlimit */ 0, nosys, /* 64+14 = nosys */ 0, nosys, /* 64+15 = nosys */ 0, nosys, /* 64+16 = nosys */ 0, nosys, /* 64+17 = nosys */ 0, nosys, /* 64+18 = nosys */ 0, nosys, /* 64+19 = nosys */ 0, nosys, /* 64+20 = nosys */ 1, vswapon, /* 64+21 = vswapon */ 0, nosys, /* 64+22 = nosys */ 0, nosys, /* 64+23 = nosys */ 0, nosys, /* 64+24 = nosys */ 0, nosys, /* 64+25 = nosys */ 0, nosys, /* 64+26 = nosys */ 0, nosys, /* 64+27 = nosys */ 0, nosys, /* 64+28 = nosys */ 0, nosys, /* 64+29 = nosys */ 0, nosys, /* 64+30 = nosys */ 0, nosys, /* 64+31 = nosys */ 0, nosys, /* 64+32 = nosys */ 0, nosys, /* 64+33 = nosys */ 0, nosys, /* 64+34 = nosys */ 0, nosys, /* 64+35 = nosys */ 0, nosys, /* 64+36 = nosys */ 0, nosys, /* 64+37 = nosys */ 0, nosys, /* 64+38 = nosys */ 0, nosys, /* 64+39 = nosys */ 0, nosys, /* 64+40 = nosys */ 0, nosys, /* 64+41 = nosys */ 0, nosys, /* 64+42 = nosys */ 2, vtimes, /* 64+43 = vtimes */ 0, nosys, /* 64+44 = nosys */ 0, nosys, /* 64+45 = nosys */ 0, nosys, /* 64+46 = nosys */ 0, nosys, /* 64+47 = nosys */ 0, nosys, /* 64+48 = nosys */ 0, nosys, /* 64+49 = nosys */ 0, nosys, /* 64+50 = nosys */ #ifdef TRACE 2, vtrace, /* 64+51 = vtrace */ #else 0, nosys, /* 64+51 = nosys */ #endif 0, nosys, /* 64+52 = nosys */ 0, nosys, /* 64+53 = nosys */ 0, nosys, /* 64+54 = nosys */ 1, resuba, /* 64+55 = resuba */ 0, nosys, /* 64+56 = nosys */ 0, nosys, /* 64+57 = nosys */ 0, nosys, /* 64+58 = nosys */ 5, futz, /* 64+59 = futz */ 0, nosys, /* 64+60 = nosys */ 0, nosys, /* 64+61 = nosys */ 0, nosys, /* 64+62 = nosys */ 0, nosys, /* 64+63 = nosys */ /* 64+50 = nosys */ #ifdef TRACE 2, vtrace, /* 64+51 = vtrace */ #else 0, nosys, /* 64+51 = nosys */sys/floppy/ 775 0 33 0 2513527105 6077 sys/floppy/dump 644 0 33 102 2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ЬZXXXX%1DPba1PO1PD ZY YYYjFjYWWWPxPYPPX XWЊYjЭP֭`~YԭY<TЭP֭`W >?1yWPxPPPPPYP)խ ,XX X֭鑽 ֭jЭP֭`X1!XPX11Pd1Pc1 1PlXXPPo11Pu1Ps1|1Px11 ^Ѭ լ-Gάޭ[ݬݬ @,ݬݬ PP֘{~ ޭP[PЬ[20uY"PY["PZ"[~#[  Z" P!~P[[  [[j[P Ь[*P#DP@ZP +PЬ[ 4PZZPP P  Z[[ڬ۬P( ^>P~xPPAPgP11xPP` PxPfP`P֭vNO@H#$ԭԭЭԭѭ1Oԭ/xPնP` PxPVP`P֭ѭխ Џ[[ Ь[xTPxPP~P QQ`ZЫXP@ իXѫX "ЫXP2@PŏBPX Z ^Ь[xTPxPP P QQ`Zԭ[PЫdTǏB((PPPPPPPPPQQQPQQjZjZ2PxPP2QPQQxlPPPPxPʏPɏPѬjZ2 PPݭ[2jPPX*2 ~2~2~2~2~jZ5ѭ 1P֭1խ ,ЫlPЬ[k Ь[[1ЫXZԫl[ZPZPЬ[[^Ь[xTPxPP=P QQ`WЫTYXWxYZ[PΫlPPѬZP)ѬZPѬ  ZPPPɬZPPP<ݭ[5PxPP2PP QP P@P˶pP  ˏTPP =PիXѫXЫXP@o  ЫXP@P X^?<<%ȏֵȏϵ2 ﹵ﱵﭵ掠冀ЭPɏQ PPQ ЭPPЭP ^Ь[[PZЫd ˏTPPЫlPQxQQQPѬ!P"PPPZ ݭ[bPݭ[RЫlP ^Ь[ԭZk96 PQPQ0QZ[[kPP P P+P-k0ZέPЭPЬZЬY[ [[ ЬZЬY[ Y[[ ЬPЬRRQ{RPRPPPRRPЬPЬRRQ{RPPR PRPP:PЬSRbcPRbr  &0^n1/dev/rmt8\/ tapeTape? Disk? Last chance before scribbling on %s. diskMissing volume record Tape is not volume %d Missing header block End of tape Unknown header type Resynced at inode %u %u: ilist too small Missing address (header) block Tape read error: inode %u Mount volume %d Cannot open tape! Not a dump tape.Try again Wrong tape. Try again disk write error %D read error %D Out of space Checksum error %o @(#)restor.c 4.3 (Berkeley) 6/3/81null path %s not found bn negative bn ovf %D bn void %D bn void %D not a directory zero length directory Seek not from beginning of file No more file slotsBad device Unknown device Bad unit specifier Missing offset specification Can't write files yet.. Sorry Exit called%s Trap %o 3X3p^3F 3%D%t% 3#H#3(&'3<*l)**3~-|+hphtuptmhktsmtra&vd62M2R%s1 JTJ2" 7H3 `7X3/83/h3832 @vx3unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry DR2 `75 @75up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPE0123456789abcdef`       @ ` ` rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry Pte error: er=%bILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOTts: unrecovered error ts: recovered by retry Anot a tape mt hard error: er=%b mt error: er=%b mt: unrecovered error mt: recovered by retry h >Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error LRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOTts: unrecovered error ts: recovered by retry Anot a tape mt hard error: er=%b mt errsys/floppy/cat 644 0 33 25414 2662344107 6706 Џ^6!PԀP^Tu!<^U!߭߭PP ݭݭzP} Ь[ԫ`PPPPXPd2lp[h[p[ZPPQxQQQPQxQPPZj Ъ Z~[~ ^Ь[kj &X[k/[ZjZj/jjݬ[gP8ݬP0jZ[[> Pݬ<~kЭP^Ь[Ь[Yլ  1eѬ ЬZJЭPԭ xѬ ­׭խխ ݬ1jí P@ݬ1Q֭ѭЭP@8CxPXPdx P@(h2l[x P@(ЭPЭ@8x P@(έPxPPPZJ1|ݬ41 ^Ь[լ1[Y<PʏPP@ 10 12ԭd֭ѭ@>ЭP֭P[pPPXPdp[h2l[-p[ZԭZ~ݬPЭPˏXW2GPPXWGWJ JP P@wYիXѫX ЫXP@ sЫXP2@P2QQPPX^Ь[ЫTЫdxPxPPCP`PQxQQQP{PЭQA`P P@ЭPӏ@ ЭP2$ЭPЭQ2PPQЭP2PPQRPRRQЭPЭQ2aQQPЭQ2aQQPRQRRPЭPЭ(xPPЭQPݬ[XЭPӏӏ@@ЭPˏ~ЭPˏ~ݭݭݭsPPЫlP^Ь[xTPxPPAP`PˏTQxQQQPYԭЭPˏQ2@PPQ֭ЭP@xT~: i[JЫXZ(l[5PЏXX[ZPZPЬ[[^Ь[xTPxPP@P`PˏTQxQQQPWY2ZW gZ$ΫlѬ gPѬѬݬ[gWЧXЧX gXX gPˏ~ˏX~|Y PY[1@Y j2PlP Ь[ЫZZ ^Ь[xTPxPP?P`xTPxPP?P`PˏTQxQQQPZЫhP PˏhlPP PЭ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@,87P877pP  ˏTPP7 =PիXѫXЫXP@s  ЫXP@T X^[7< 7Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error LRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A1sys/floppy/upmboo.cmd 644 0 33 257 2526705661 10145 ! ! BOOTSTRAP ON UP, GOING MULTI USER ! SET DEF HEX SET DEF LONG SET REL:0 HALT UNJAM INIT LOAD BOOT D R10 2 ! DEVICE CHOICE 2=UP D R11 0 ! 0= AUTOBOOT START 2 or: er=%b mt error: er=%b mt: unrecovered error mt: recovered by retry h >Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error LRBOTCH7SDWNWRLRWSTUR recovered by retry P/hL,hL5Ȇ< /,"((sys/floppy/btape 644 0 33 441 2425170343 7157 HALT ! HALT PROCESSOR UNJAM ! UNJAM SBI DEPOSIT 50000 20009FDE DEPOSIT+ D0512001 DEPOSIT+ 3204A101 DEPOSIT+ C113C08F DEPOSIT+ A1D40424 DEPOSIT+ 008FD00C DEPOSIT+ C1800000 DEPOSIT+ 8F320800 DEPOSIT+ 10A1FE00 DEPOSIT+ 00C139D0 DEPOSIT+ 0004 START 50000 WAIT DONE START 0 ra: open error, STCONra: open error, ONLINra: bad unitra: I/O error LRBOTCH7SDWNWRLRWSTUR recovered by retry P/hL,hL5؆< /,"sys/floppy/upsboo.cmd 644 0 33 263 2526705661 10150 ! ! BOOTSTRAP ON UP, LEAVING SINGLE USER ! SET DEF HEX SET DEF LONG SET REL:0 HALT UNJAM INIT LOAD BOOT D R10 2 ! DEVICE CHOICE 2=UP D R11 2 ! 2= RB_SINGLE START 2 000 DEPOSIT+ 8F320800 DEPOSIT+ 10A1FE00 DEPOSIT+ 00C139D0 DEPOSIT+ 0004 START 50000 WAIT DONE START 0 ra: open error, STCONra: open error, ONLINra: bad unitra: I/O error LRBOTCH7SDWNWRLRWSTUR recovered by retry P/hL,hL5< /,"sys/floppy/restar.cmd 644 0 33 242 2526705661 10136 ! RESTART COMMMAND FILE SET DEF HEX SET DEF LONG SET REL:0 HALT ! HALT PROCESSOR UNJAM ! UNJAM SBI INIT ! INITIALIZE PROCESSOR D PC C00 D PSL 0 C SINGLE START 2 000 DEPOSIT+ 8F320800 DEPOSIT+ 10A1FE00 DEPOSIT+ 00C139D0 DEPOSIT+ 0004 START 50000 WAIT DONE START 0 ra: open error, STCONra: open error, ONLINra: bad unitra: I/O error LRBOTCH7SDWNWRLRWSTUR recovered by retry P/hL,hL5< /,"sys/floppy/defboo.hk 644 0 33 420 2515513475 7727 ! ! BOOTSTRAP BY BOOT() SYSCALL ! GO MULTI-USER AFTER CHECKING; BOOT FROM DEFAULT DEVICE ! SET DEF HEX SET DEF LONG SET REL:0 HALT UNJAM INIT LOAD BOOT D/G B 0 ! BOOT PARAMETERS: MULTI USER AFTER CHECK D/G A 3 ! DEV TO BOOT FROM (0=HP, 2=UP, 3=HK) START 2 T DONE START 0 ra: open error, STCONra: open error, ONLINra: bad unitra: I/O error LRBOTCH7SDWNWRLRWSTUR recovered by retry P/hL,hL5< /,"sys/floppy/hpmboo.cmd 644 0 33 257 2526705661 10130 ! ! BOOTSTRAP ON RP, GOING MULTI USER ! SET DEF HEX SET DEF LONG SET REL:0 HALT UNJAM INIT LOAD BOOT D R10 0 ! DEVICE CHOICE 0=HP D R11 0 ! 0= AUTOBOOT START 2 OOT PARAMETERS: MULTI USER AFTER CHECK D/G A 3 ! DEV TO BOOT FROM (0=HP, 2=UP, 3=HK) START 2 T DONE START 0 ra: open error, STCONra: open error, ONLINra: bad unitra: I/O error LRBOTCH7SDWNWRLRWSTUR recovered by retry P/hL,hL5< /,"sys/floppy/anyboo.cmd 644 0 33 321 2526705660 10122 ! ! BOOTSTRAP ANY DEVICE TO A SINGLE USER SHELL ! SET DEF HEX SET DEF LONG SET REL:0 HALT UNJAM INIT LOAD BOOT D R11 3 ! 3=RB_ASKNAME+RB_SINGLE ! R10 NICHTS ! D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A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOTts: unrecovered error ts: recoversys/floppy/hpsboo.cmd 644 0 33 263 2526705661 10133 ! ! BOOTSTRAP ON RP, LEAVING SINGLE USER ! SET DEF HEX SET DEF LONG SET REL:0 HALT UNJAM INIT LOAD BOOT D R10 0 ! DEVICE CHOICE 0=HP D R11 2 ! 2= RB_SINGLE START 2 ONra: open error, ONLINra: bad unitra: I/O error LRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRL/hL,hL5H< /,"sys/floppy/defboo.up 644 0 33 420 2515513475 7751 ! ! BOOTSTRAP BY BOOT() SYSCALL ! GO MULTI-USER AFTER CHECKING; BOOT FROM DEFAULT DEVICE ! SET DEF HEX SET DEF LONG SET REL:0 HALT UNJAM INIT LOAD BOOT D/G B 0 ! BOOT PARAMETERS: MULTI USER AFTER CHECK D/G A 2 ! DEV TO BOOT FROM (0=HP, 2=UP, 3=HK) START 2 by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRL/hL,hL5X< /,"sys/floppy/defboo.hp 644 0 33 420 2515513475 7734 ! ! BOOTSTRAP BY BOOT() SYSCALL ! GO MULTI-USER AFTER CHECKING; BOOT FROM DEFAULT DEVICE ! SET DEF HEX SET DEF LONG SET REL:0 HALT UNJAM INIT LOAD BOOT D/G B 0 ! BOOT PARAMETERS: MULTI USER AFTER CHECK D/G A 0 ! DEV TO BOOT FROM (0=HP, 2=UP, 3=HK) START 2 by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRL/hL,hL5h< /,"sys/h/ 775 0 33 0 2650355044 5020 sys/h/pk.h 644 0 33 4233 2522401226 5660 struct header { char sync; char ksize; unsigned short sum; char cntl; char ccntl; }; #define HDRSIZ 6 struct pack { short p_state; /* line state */ short p_bits; /* mask for getepack */ short p_rsize; /* input packet size */ short p_xsize; /* output packet size */ struct header p_ihbuf; /* input header */ struct header p_ohbuf; /* output header */ char *p_rptr; char p_mode; char **p_ipool; char p_xcount; /* # active output buffers */ char p_rcount; char p_nout,p_tout; char p_lpsize; /* log(psize/32) */ char p_timer; char p_obusy; char p_srxmit; char p_rwindow; /* window size */ char p_swindow; char p_msg; /* control msg */ char p_rmsg; /* repeated control msg */ char p_ps,p_pr; /* last packet sent, recv'd */ char p_rpr; char p_nxtps; /* next output seq number */ char p_imap; /* bit map of input buffers */ char p_pscopy; /* newest output packet */ char *p_ob[8]; /* output buffers */ char *p_ib[8]; /* input buffers */ char p_os[8]; /* output buffer status */ char p_is[8]; /* input buffer status */ short p_osum[8]; /* output checksums */ short p_isum[8]; /* input checksums */ DSYSTEM; }; #define CHECK 0125252 #define SYN 020 #define MOD8 7 #define ISCNTL(a) ((a & 0300)==0) #define MIN(a,b) ((apg_fod == 0 && (pte)->pg_pfnum && \ ((pte)->pg_m || (pte)->pg_swapm)) #ifndef LOCORE #ifdef KERNEL struct pte *vtopte(); /* utilities defined in locore.s */ extern struct pte Sysmap[]; extern struct pte Usrptmap[]; extern struct pte usrpt[]; extern struct pte Swapmap[]; extern struct pte Forkmap[]; extern struct pte Xswapmap[]; extern struct pte Xswap2map[]; extern struct pte Pushmap[]; extern struct pte Vfmap[]; extern struct pte mmap[]; extern struct pte msgbufmap[]; extern struct pte camap[]; extern struct pte Nexmap[][16]; #endif #endif (pte)->pg_m || (pte)->pg_swapm)) #ifndef LOCORE #ifdef KERNEL struct pte *vtopte(); /* utilities defined in locore.s */ extern struct pte Sysmap[]; extern struct pte Usrptmap[]; extern struct pte usrpt[]; extern struct pte Swapmap[]; extern struct pte Forkmap[]; extern struct pte Xswapmap[]; extern struct pte Xswap2map[]; extern struct pte Pushmap[]; extern struct pte Vfmap[]; extern struct pte mmap[]; extern struct pte msgbufmap[]; extern struct pte camap[]; extern struct pte Nexmap[][16]; sys/h/psl.h 444 0 33 2051 2522400373 6040 /* psl.h 4.4 81/04/22 */ /* * VAX program status longword */ #define PSL_C 0x00000001 /* carry bit */ #define PSL_V 0x00000002 /* overflow bit */ #define PSL_Z 0x00000004 /* zero bit */ #define PSL_N 0x00000008 /* negative bit */ #define PSL_ALLCC 0x0000000f /* all cc bits - unlikely */ #define PSL_T 0x00000010 /* trace enable bit */ #define PSL_IV 0x00000020 /* integer overflow enable bit */ #define PSL_FU 0x00000040 /* floating point underflow enable */ #define PSL_DV 0x00000080 /* decimal overflow enable bit */ #define PSL_IPL 0x001f0000 /* interrupt priority level */ #define PSL_PRVMOD 0x00c00000 /* previous mode (all on is user) */ #define PSL_CURMOD 0x03000000 /* current mode (all on is user) */ #define PSL_IS 0x04000000 /* interrupt stack */ #define PSL_FPD 0x08000000 /* first part done */ #define PSL_TP 0x40000000 /* trace pending */ #define PSL_CM 0x80000000 /* compatibility mode */ #define PSL_MBZ 0x3020ff00 /* must be zero bits */ #define PSL_USERSET (PSL_PRVMOD|PSL_CURMOD) #define PSL_USERCLR (PSL_IS|PSL_IPL|PSL_MBZ) 1f0000 /* interrupt priority level */ #define PSL_PRVMOD 0x00c00000 /* previous mode (all on is user) */ #define PSL_CURMOD 0x03000000 /* current mode (all on is user) */ #define PSL_IS 0x04000000 /* interrupt stack */ #define PSL_FPD 0x08000000 /* first part done */ #define PSL_TP 0x40000000 /* trace pending */ #define PSL_CM 0x80000000 /* compatibility mode */ #define PSL_MBZ 0x3020ff00 /* must be zero bits */ #define PSL_USERSET (PSL_PRVMOD|PSL_CURMOD) #defsys/h/pcb.m 444 0 33 1352 2506431474 6026 ((/* pcb.m 4.3 81/02/23 */ /* * VAX process control block */ .set PCB_KSP, 0 .set PCB_ESP, 4 .set PCB_SSP, 8 .set PCB_USP, 12 .set PCB_R0, 16 .set PCB_R1, 20 .set PCB_R2, 24 .set PCB_R3, 28 .set PCB_R4, 32 .set PCB_R5, 36 .set PCB_R6, 40 .set PCB_R7, 44 .set PCB_R8, 48 .set PCB_R9, 52 .set PCB_R10, 56 .set PCB_R11, 60 .set PCB_R12, 64 .set PCB_R13, 68 .set PCB_PC, 72 .set PCB_PSL, 76 .set PCB_P0BR, 80 .set PCB_P0LR, 84 .set PCB_P1BR, 88 .set PCB_P1LR, 92 /* * Software pcb extension */ .set PCB_SZPT, 96 /* number of user page table pages */ .set PCB_CMAP2, 100 /* saved cmap2 across cswitch (ick) */ .set PCB_SSWAP, 104 /* flag for non-local goto */ .set PCB_SIGC, 108 /* signal trampoline code */ , 36 .set PCB_R6, 40 .set PCB_R7, 44 .set PCB_R8, 48 .set PCB_R9, 52 .set PCB_R10, 56 .set PCB_R11, 60 .set PCB_R12, 64 .set PCB_R13, 68 .set PCB_PC, 72 .set PCB_PSL, 76 .set PCB_P0BR, 80 .set PCB_P0LR, 84 .set PCB_P1BR, 88 .set PCB_P1LR, 92 /* * Software psys/h/param.h 444 0 33 11163 2732201257 6371 /* param.h 4.12 81/06/11 */ /* * Tunable variables which do not usually vary per system. * * The sizes of most system tables are configured * into each system description. The file system buffer * cache size is assigned based on available memory. * The tables whose sizes don't vary often are given here. */ #define NMOUNT 15 /* number of mountable file systems */ #define MSWAPX 15 /* pseudo mount table index for swapdev */ #define MAXUPRC 25 /* max processes per user */ #define SSIZE 4 /* initial stack size (*512 bytes) */ #define SINCR 4 /* increment of stack (*512 bytes) */ #define NOFILE 20 /* max open files per process */ /* NOFILE MUST NOT BE >= 31; SEE pte.h */ #define CANBSIZ 256 /* max size of typewriter line */ #define NCARGS 10240 /* # characters in exec arglist */ /* * priorities * probably should not be * altered too much */ #define PSWP 0 #define PINOD 10 #define PRIBIO 20 #define PRIUBA 24 #define PZERO 25 #define PPIPE 26 #define PWAIT 30 #define PSLEP 40 #define PUSER 50 #define NZERO 20 /* * signals * dont change */ #ifndef NSIG #include #endif /* * Return values from tsleep(). */ #define TS_OK 0 /* normal wakeup */ #define TS_TIME 1 /* timed-out wakeup */ #define TS_SIG 2 /* asynchronous signal wakeup */ /* * fundamental constants of the implementation-- * cannot be changed easily. */ #define NBBY 8 /* number of bits in a byte */ #define NBPW sizeof(int) /* number of bytes in an integer */ #define NBPG 512 #define PGOFSET (NBPG-1) /* byte offset into page */ #define PGSHIFT 9 /* LOG2(NBPG) */ #define UPAGES 8 /* pages of u-area */ #define NULL 0 #define CMASK 0 /* default mask for file creation */ #define NODEV (dev_t)(-1) #define ROOTINO ((ino_t)2) /* i number of all roots */ #define SUPERB ((daddr_t)1) /* block number of the super block */ #define DIRSIZ 14 /* max characters per directory */ /* * Clustering of hardware pages on machines with ridiculously small * page sizes is done here. The paging subsystem deals with units of * CLSIZE pte's describing NBPG (from vm.h) pages each... BSIZE must * be CLSIZE*NBPG in the current implementation, that is the paging subsystem * deals with the same size blocks that the file system uses. * * NOTE: SSIZE, SINCR and UPAGES must be multiples of CLSIZE */ #define CLSIZE 2 #define CLOFSET (CLSIZE*NBPG-1) /* for clusters, like PGOFSET */ /* give the base virtual address (first of CLSIZE) */ #define clbase(i) ((i) &~ (CLSIZE-1)) /* round a number of clicks up to a whole cluster */ #define clrnd(i) (((i) + (CLSIZE-1)) &~ (CLSIZE-1)) #if CLSIZE==1 #define BSIZE 512 /* size of secondary block (bytes) */ #define INOPB 8 /* 8 inodes per block */ #define BMASK 0777 /* BSIZE-1 */ #define BSHIFT 9 /* LOG2(BSIZE) */ #define NMASK 0177 /* NINDIR-1 */ #define NSHIFT 7 /* LOG2(NINDIR) */ #define NICINOD 100 /* number of superblock inodes */ #define NICFREE 50 /* number of superblock free blocks */ #endif #if CLSIZE==2 #define BSIZE 1024 #define INOPB 16 #define BMASK 01777 #define BSHIFT 10 #define NMASK 0377 #define NSHIFT 8 #define NICINOD 100 #define NICFREE 178 #endif #if CLSIZE==4 #define BSIZE 2048 #define INOPB 32 #define BMASK 03777 #define BSHIFT 11 #define NMASK 0777 #define NSHIFT 9 #define NICINOD 100 #define NICFREE 434 #endif #ifndef INTRLVE /* macros replacing interleaving functions */ #define dkblock(bp) ((bp)->b_blkno) #define dkunit(bp) (minor((bp)->b_dev) >> 3) #endif /* inumber to disk address and inumber to disk offset */ #define itod(x) ((daddr_t)((((unsigned)(x)+2*INOPB-1)/INOPB))) #define itoo(x) ((int)(((x)+2*INOPB-1)%INOPB)) /* file system blocks to disk blocks and back */ #define fsbtodb(b) ((b)*CLSIZE) #define dbtofsb(b) ((b)/CLSIZE) #define NINDIR (BSIZE/sizeof(daddr_t)) #define CBSIZE 28 /* number of chars in a clist block */ #define CROUND 0x1F /* clist rounding; sizeof(int *) + CBSIZE -1*/ /* * Macros for fast min/max */ #define MIN(a,b) (((a)<(b))?(a):(b)) #define MAX(a,b) (((a)>(b))?(a):(b)) /* * Some macros for units conversion */ /* Core clicks (512 bytes) to segments and vice versa */ #define ctos(x) (x) #define stoc(x) (x) /* Core clicks (512 bytes) to disk blocks */ #define ctod(x) (x) /* clicks to bytes */ #define ctob(x) ((x)<<9) /* bytes to clicks */ #define btoc(x) ((((unsigned)(x)+511)>>9)) #ifndef KERNEL #include #else #include "../h/types.h" #endif /* * Machine-dependent bits and macros */ #define UMODE PSL_CURMOD /* usermode bits */ #define USERMODE(ps) (((ps) & UMODE) == UMODE) #define BASEPRI(ps) (((ps) & PSL_IPL) != 0) /* * Provide about n microseconds of delay */ #define DELAY(n) { register int N = (n); while (--N > 0); } blocks */ #define ctod(x) (x) /* clicks to bytes */ #define ctob(x) ((x)<<9) /* bytes to clicks */ #define btoc(x) ((((unsigned)(x)+511)>>9)) #ifndef KERNEL #include #else #include "../h/types.h" #endif /* * Machine-dependent bits and macros */ #define UMODE PSL_CURMOD /* usermode bits */ #define USERMODE(ps) (((ps) & UMODE) == UMODE) #define BASEPRI(ps) (((ps) & PSL_IPL) sys/h/mem.h 444 0 33 5353 2512563723 6040 /* mem.h 4.9 81/04/03 */ /* * Memory controller registers * * The way in which the data is stored in these registers varies * per cpu, so we define macros here to mask that. */ struct mcr { int mc_reg[3]; }; /* * Compute maximum possible number of memory controllers, * for sizing of the mcraddr array. */ #if VAX780 #define MAXNMCR 4 #else #define MAXNMCR 1 #endif /* * For each processor type we define 5 macros: * M???_INH(mcr) inhibits further crd interrupts from mcr * M???_ENA(mcr) enables another crd interrupt from mcr * M???_ERR(mcr) tells whether an error is waiting * M???_SYN(mcr) gives the syndrome bits of the error * M???_ADDR(mcr) gives the address of the error */ #if VAX780 #define M780_ICRD 0x40000000 /* inhibit crd interrupts, in [2] */ #define M780_HIER 0x20000000 /* high error rate, in reg[2] */ #define M780_ERLOG 0x10000000 /* error log request, in reg[2] */ /* on a 780, memory crd's occur only when bit 15 is set in the SBIER */ /* register; bit 14 there is an error bit which we also clear */ /* these bits are in the back of the ``red book'' (or in the VMS code) */ #define M780_INH(mcr) \ (((mcr)->mc_reg[2] = (M780_ICRD|M780_HIER|M780_ERLOG)), mtpr(SBIER, 0)) #define M780_ENA(mcr) \ (((mcr)->mc_reg[2] = (M780_HIER|M780_ERLOG)), mtpr(SBIER, 3<<14)) #define M780_ERR(mcr) \ ((mcr)->mc_reg[2] & (M780_ERLOG)) #define M780_SYN(mcr) ((mcr)->mc_reg[2] & 0xff) #define M780_ADDR(mcr) (((mcr)->mc_reg[2] >> 8) & 0xfffff) #endif #if VAX750 #define M750_ICRD 0x10000000 /* inhibit crd interrupts, in [1] */ #define M750_UNCORR 0xc0000000 /* uncorrectable error, in [0] */ #define M750_CORERR 0x40000000 /* correctable error, in [0] */ #define M750_INH(mcr) ((mcr)->mc_reg[1] = M750_ICRD) #define M750_ENA(mcr) ((mcr)->mc_reg[0] = (M750_UNCORR|M750_CORERR), \ (mcr)->mc_reg[1] = 0) #define M750_ERR(mcr) ((mcr)->mc_reg[0] & (M750_UNCORR|M750_CORERR)) #define M750_SYN(mcr) ((mcr)->mc_reg[0] & 0x3f) #define M750_ADDR(mcr) (((mcr)->mc_reg[0] >> 8) & 0x7fff) #endif #if VAX7ZZ #define M7ZZ_CRD 0x40000000 /* crd, in [1] */ #define M7ZZ_FTBPE 0x20000000 /* force tbuf parity error, in [1] */ #define M7ZZ_ENACRD 0x10000000 /* enable crd interrupt, in [1] */ #define M7ZZ_MME 0x08000000 /* mem-man enable (ala ipr), in [1] */ #define M7ZZ_DM 0x04000000 /* diagnostic mode, in [1] */ #define M7ZZ_DISECC 0x02000000 /* disable ecc, in [1] */ #define M7ZZ_INH(mcr) ((mcr)->mc_reg[1] = M7ZZ_MME) #define M7ZZ_ENA(mcr) ((mcr)->mc_reg[1] = (M7ZZ_MME|M7ZZ_ENACRD)) #define M7ZZ_ERR(mcr) ((mcr)->mc_reg[1] & M7ZZ_CRD) #define M7ZZ_SYN(mcr) ((mcr)->mc_reg[0] & 0x7f) #define M7ZZ_ADDR(mcr) (((mcr)->mc_reg[0] >> 8) & 0x7fff) #endif #define MEMINTVL (60*60*10) /* 10 minutes */ #ifdef KERNEL int nmcr; struct mcr *mcraddr[MAXNMCR]; #endif */ #define M7ZZ_DM 0x04000000 /* diagnostic mode, in [1] */ #define M7ZZ_DISECC 0x02000000 /* disable ecc, in [1] */ #define M7ZZ_INH(mcr) ((mcr)->mc_reg[1] = M7ZZ_MME) #define M7ZZ_ENA(mcr) ((mcr)->mc_reg[1] = (M7ZZ_MME|M7ZZ_ENACRD)) #define M7ZZ_ERR(mcr) ((mcr)->mc_reg[1]((sys/h/clock.h 444 0 33 2020 2506431476 6343 /* clock.h 4.5 81/02/23 */ /* * VAX clock registers */ #define ICCS_RUN 0x00000001 #define ICCS_TRANS 0x00000010 #define ICCS_SS 0x00000020 #define ICCS_IE 0x00000040 #define ICCS_INT 0x00000080 #define ICCS_ERR 0x80000000 #define SECDAY ((unsigned)(24*60*60)) /* seconds per day */ #define SECYR ((unsigned)(365*SECDAY)) /* per common year */ /* * TODRZERO is the what the TODR should contain when the ``year'' begins. * The TODR should always contain a number between 0 and SECYR+SECDAY. */ #define TODRZERO ((unsigned)(1<<28)) #define YRREF 1970 #define LEAPYEAR(year) ((year)%4==0) /* good till time becomes negative */ /* * Start a 60 HZ clock. */ #define clkstart() {\ mtpr(NICR, -16667); /* 16.667 milli-seconds */\ mtpr(ICCS, ICCS_RUN+ICCS_IE+ICCS_TRANS+ICCS_INT+ICCS_ERR);\ } #define clkreld() mtpr(ICCS, ICCS_RUN+ICCS_IE+ICCS_INT+ICCS_ERR) #define clkwrap() (((unsigned)mfpr(TODR) - TODRZERO)/100 > SECYR+SECDAY) /* * Software clock is software interrupt level 8 */ #define setsoftclock() mtpr(SIRR, 0x8) signed)(1<<28)) #define YRREF 1970 #define LEAPYEAR(year) ((year)%4==0) /* good till time becomes negative */ /* * Start a 60 HZ clock. */ #define clkstart() {\ mtpr(NICR, -16667); /* 16.667 milli-seconds */\ mtpr(ICCS, ICCS_RUN+ICCS_IE+ICCS_TRANS+ICCS_INT+ICCS_ERR);\ } #define clkreld() mtpr(ICCS, ICCS_RUN+ICCS_IE+ICCS_INT+ICCS_ERR) #define clkwrap() (((unsigned)mfpr(TODR) - TODRZERO)/100 > SECYR+SECDAY) /* * Software clock is software interrupt level 8 */ #define setsoftclock() sys/h/hpreg.h 444 0 33 11365 2574143201 6400 /* hpreg.h 4.9 81/08/31 */ struct hpdevice { int hpcs1; /* control and status register 1 */ int hpds; /* drive status */ int hper1; /* error register 1 */ int hpmr; /* maintenance */ int hpas; /* attention summary */ int hpda; /* desired address register */ int hpdt; /* drive type */ int hpla; /* look ahead */ int hpsn; /* serial number */ int hpof; /* offset register */ int hpdc; /* desired cylinder address register */ int hpcc; /* current cylinder */ /* on an rp drive, mr2 is called er2 and er2 is called er3 */ /* we use rm terminology here */ int hpmr2; /* maintenance register 2 */ int hper2; /* error register 2 */ int hpec1; /* burst error bit position */ int hpec2; /* burst error bit pattern */ }; /* hpcs1 */ #define HP_SC 0100000 /* special condition */ #define HP_TRE 0040000 /* transfer error */ #define HP_DVA 0004000 /* drive available */ #define HP_RDY 0000200 /* controller ready */ #define HP_IE 0000100 /* interrupt enable */ /* bits 5-1 are the command */ #define HP_GO 0000001 /* commands */ #define HP_NOP 000 /* no operation */ #define HP_UNLOAD 002 /* offline drive */ #define HP_SEEK 004 /* seek */ #define HP_RECAL 006 /* recalibrate */ #define HP_DCLR 010 /* drive clear */ #define HP_RELEASE 012 /* release */ #define HP_OFFSET 014 /* offset */ #define HP_RTC 016 /* return to centerline */ #define HP_PRESET 020 /* read-in preset */ #define HP_PACK 022 /* pack acknowledge */ #define HP_SEARCH 030 /* search */ #define HP_DIAGNOSE 034 /* diagnose drive */ #define HP_WCDATA 050 /* write check data */ #define HP_WCHDR 052 /* write check header and data */ #define HP_WCOM 060 /* write data */ #define HP_WHDR 062 /* write header */ #define HP_WTRACKD 064 /* write track descriptor */ #define HP_RCOM 070 /* read data */ #define HP_RHDR 072 /* read header and data */ #define HP_RTRACKD 074 /* read track descriptor */ /* hpds */ #define HPDS_ATA 0100000 /* attention active */ #define HPDS_ERR 0040000 /* composite drive error */ #define HPDS_PIP 0020000 /* positioning in progress */ #define HPDS_MOL 0010000 /* medium on line */ #define HPDS_WRL 0004000 /* write locked */ #define HPDS_LST 0002000 /* last sector transferred */ #define HPDS_PGM 0001000 /* programmable */ #define HPDS_DPR 0000400 /* drive present */ #define HPDS_DRY 0000200 /* drive ready */ #define HPDS_VV 0000100 /* volume valid */ /* bits 1-5 are spare */ #define HPDS_OM 0000001 /* offset mode */ #define HPDS_DREADY (HPDS_DPR|HPDS_DRY|HPDS_MOL|HPDS_VV) #define HPDS_BITS \ "\10\20ATA\17ERR\16PIP\15MOL\14WRL\13LST\12PGM\11DPR\10DRY\7VV\1OM" /* hper1 */ #define HPER1_DCK 0100000 /* data check */ #define HPER1_UNS 0040000 /* drive unsafe */ #define HPER1_OPI 0020000 /* operation incomplete */ #define HPER1_DTE 0010000 /* drive timing error */ #define HPER1_WLE 0004000 /* write lock error */ #define HPER1_IAE 0002000 /* invalid address error */ #define HPER1_AOE 0001000 /* address overflow error */ #define HPER1_HCRC 0000400 /* header crc error */ #define HPER1_HCE 0000200 /* header compare error */ #define HPER1_ECH 0000100 /* ecc hard error */ #define HPER1_WCF 0000040 /* write clock fail */ #define HPER1_FER 0000020 /* format error */ #define HPER1_PAR 0000010 /* parity error */ #define HPER1_RMR 0000004 /* register modification refused */ #define HPER1_ILR 0000002 /* illegal register */ #define HPER1_ILF 0000001 /* illegal function */ #define HPER1_BITS \ "\10\20DCK\17UNS\16OPI\15DTE\14WLE\13IAE\12AOE\11HCRC\10HCE\ \7ECH\6WCF\5FER\4PAR\3RMR\2ILR\1ILF" #define HPER1_HARD \ (HPER1_WLE|HPER1_IAE|HPER1_AOE|\ HPER1_FER|HPER1_RMR|HPER1_ILR|HPER1_ILF) /* hper2 */ #define HPER2_BSE 0100000 /* bad sector error */ #define HPER2_SKI 0040000 /* seek incomplete */ #define HPER2_OPE 0020000 /* operator plug error */ #define HPER2_IVC 0010000 /* invalid command */ #define HPER2_LSC 0004000 /* loss of system clock */ #define HPER2_LBC 0002000 /* loss of bit check */ #define HPER2_DVC 0000200 /* device check */ #define HPER2_SSE 0000040 /* skip sector error (rm80) */ #define HPER2_DPE 0000010 /* data parity error */ #define HPER2_BITS \ "\10\20BSE\17SKI\16OPE\15IVC\14LSC\13LBC\10DVC\5SSE\4DPE" #define HPER2_HARD (HPER2_OPE) /* hpof */ #define HPOF_CMO 0100000 /* command modifier */ #define HPOF_MTD 0040000 /* move track descriptor */ #define HPOF_FMT22 0010000 /* 16 bit format */ #define HPOF_ECI 0004000 /* ecc inhibit */ #define HPOF_HCI 0002000 /* header compare inhibit */ #define HPOF_SSEI 0001000 /* skip sector inhibit */ #define HPOF_P400 020 /* +400 uinches */ #define HPOF_M400 0220 /* -400 uinches */ #define HPOF_P800 040 /* +800 uinches */ #define HPOF_M800 0240 /* -800 uinches */ #define HPOF_P1200 060 /* +1200 uinches */ #define HPOF_M1200 0260 /* -1200 uinches */ e HPOF_MTD 0040000 /* move track descriptor */ #define HPOF_FMT22 0010000 /* 16 bit format */ #define HPOF_ECI 0004000 /* ecc inhibit */ #define HPOF_HCI 0002000 /* header compare inhibit */ #define HPOF_SSEI 0001000 /* skip sector inhibit */ #define HPOF_P400 sys/h/acct.h 444 0 33 1445 2506431477 6175 /* acct.h 4.3 81/03/09 */ /* * Accounting structures; * these use a comp_t type which is a 3 bits base 8 * exponent, 13 bit fraction ``floating point'' number. */ typedef u_short comp_t; struct acct { char ac_comm[10]; /* Accounting command name */ comp_t ac_utime; /* Accounting user time */ comp_t ac_stime; /* Accounting system time */ comp_t ac_etime; /* Accounting elapsed time */ time_t ac_btime; /* Beginning time */ short ac_uid; /* Accounting user ID */ short ac_gid; /* Accounting group ID */ short ac_mem; /* average memory usage */ comp_t ac_io; /* number of disk IO blocks */ dev_t ac_tty; /* control typewriter */ char ac_flag; /* Accounting flag */ }; #define AFORK 01 /* has executed fork, but no exec */ #define ASU 02 /* used super-user privileges */ r time */ comp_t ac_stime; /* Accounting system time */ comp_t ac_etime; /* Accounting elapsed time */ time_t ac_btime; /* Beginning time */ short ac_uid; /* Accounting user ID */ short ac_gid; /* Accountingsys/h/bk.h 444 0 33 717 2506431477 5640 /* bk.h 4.2 81/02/19 */ /* * Macro definition of bk.c/netinput(). * This is used to replace a call to * (*linesw[tp->t_line].l_rint)(c,tp); * with * * if (tp->t_line == NETLDISC) * BKINPUT(c, tp); * else * (*linesw[tp->t_line].l_rint)(c,tp); */ #define BKINPUT(c, tp) { \ if ((tp)->t_rec == 0) { \ *(tp)->t_cp++ = c; \ if (++(tp)->t_inbuf == BSIZE || (c) == '\n') { \ (tp)->t_rec = 1; \ wakeup((caddr_t)&(tp)->t_rawq); \ } \ } \ }  /,"((sys/h/buf.h 444 0 33 10365 2526706017 6055 /* buf.h 4.13 81/05/09 */ /* * The header for buffers in the buffer pool and otherwise used * to describe a block i/o request is given here. The routines * which manipulate these things are given in bio.c. * * Each buffer in the pool is usually doubly linked into 2 lists: * hashed into a chain by so it can be located in the cache, * and (usually) on (one of several) queues. These lists are circular and * doubly linked for easy removal. * * There are currently three queues for buffers: * one for buffers which must be kept permanently (super blocks) * one for buffers containing ``useful'' information (the cache) * one for buffers containing ``non-useful'' information * (and empty buffers, pushed onto the front) * The latter two queues contain the buffers which are available for * reallocation, are kept in lru order. When not on one of these queues, * the buffers are ``checked out'' to drivers which use the available list * pointers to keep track of them in their i/o active queues. */ /* * Bufhd structures used at the head of the hashed buffer queues. * We only need three words for these, so this abbreviated * definition saves some space. */ struct bufhd { long b_flags; /* see defines below */ struct buf *b_forw, *b_back; /* fwd/bkwd pointer in chain */ }; struct buf { long b_flags; /* too much goes here to describe */ struct buf *b_forw, *b_back; /* hash chain (2 way street) */ struct buf *av_forw, *av_back; /* position on free list if not BUSY */ #define b_actf av_forw /* alternate names for driver queue */ #define b_actl av_back /* head - isn't history wonderful */ long b_bcount; /* transfer count */ #define b_active b_bcount /* driver queue head: drive active */ short b_error; /* returned after I/O */ dev_t b_dev; /* major+minor device name */ union { caddr_t b_addr; /* low order core address */ int *b_words; /* words for clearing */ struct filsys *b_filsys; /* superblocks */ struct dinode *b_dino; /* ilist */ daddr_t *b_daddr; /* indirect block */ } b_un; daddr_t b_blkno; /* block # on device */ long b_resid; /* words not transferred after error */ #define b_errcnt b_resid /* while i/o in progress: # retries */ #define b_pfcent b_resid /* garbage: don't ask */ struct proc *b_proc; /* proc doing physical or swap I/O */ }; #define BQUEUES 3 /* number of free buffer queues */ #define BQ_LOCKED 0 /* super-blocks &c */ #define BQ_LRU 1 /* lru, useful buffers */ #define BQ_AGE 2 /* rubbish */ #ifdef KERNEL struct buf *buf; /* the buffer pool itself */ char *buffers; int nbuf; struct buf *swbuf; /* swap I/O headers */ int nswbuf; short *swsize; int *swpf; struct buf bfreelist[BQUEUES]; /* heads of available lists */ struct buf bswlist; /* head of free swap header list */ struct buf *bclnlist; /* head of cleaned page list */ struct buf *alloc(); struct buf *baddr(); struct buf *getblk(); struct buf *geteblk(); struct buf *bread(); struct buf *breada(); unsigned minphys(); #endif /* * These flags are kept in b_flags. */ #define B_WRITE 0x000000 /* non-read pseudo-flag */ #define B_READ 0x000001 /* read when I/O occurs */ #define B_DONE 0x000002 /* transaction finished */ #define B_ERROR 0x000004 /* transaction aborted */ #define B_BUSY 0x000008 /* not on av_forw/back list */ #define B_PHYS 0x000010 /* physical IO */ #define B_XXX 0x000020 /* was B_MAP, alloc UNIBUS on pdp-11 */ #define B_WANTED 0x000040 /* issue wakeup when BUSY goes off */ #define B_AGE 0x000080 /* delayed write for correct aging */ #define B_ASYNC 0x000100 /* don't wait for I/O completion */ #define B_DELWRI 0x000200 /* write at exit of avail list */ #define B_TAPE 0x000400 /* this is a magtape (no bdwrite) */ #define B_UAREA 0x000800 /* add u-area to a swap operation */ #define B_PAGET 0x001000 /* page in/out of page table space */ #define B_DIRTY 0x002000 /* dirty page to be pushed out async */ #define B_PGIN 0x004000 /* pagein op, so swap() can count it */ #define B_CACHE 0x008000 /* did bread find us in the cache ? */ #define B_INVAL 0x010000 /* does not contain valid info */ #define B_LOCKED 0x020000 /* locked in core (not reusable) */ #define B_HEAD 0x040000 /* a buffer header, not a buffer */ #define B_BAD 0x100000 /* bad block revectoring in progress */ */ #define B_PAGET 0x001000 /* page in/out of page table space */ #define B_DIRTY 0x002000 /* dirty page to be pushed out async */ #define B_PGIN 0x004000 /* pagein op, so swap() can count it */ #define B_CACHE 0x008000 /* did bread find us in the cache ? */ #desys/h/upreg.h 444 0 33 13632 2512505122 6410 /* upreg.h 4.5 81/04/02 */ /* * Unibus rm emulation via sc21: * registers and bits. */ struct updevice { u_short upcs1; /* control and status register 1 */ short upwc; /* word count register */ u_short upba; /* UNIBUS address register */ u_short upda; /* desired address register */ u_short upcs2; /* control and status register 2 */ u_short upds; /* drive Status */ u_short uper1; /* error register 1 */ u_short upas; /* attention summary */ u_short upla; /* look ahead */ u_short updb; /* data buffer */ u_short upmr; /* maintenance */ u_short updt; /* drive type */ u_short upsn; /* serial number */ u_short upof; /* offset register */ u_short updc; /* desired cylinder address register */ u_short uphr; /* holding register */ u_short upmr2; /* maintenance register 2 */ u_short uper2; /* error register 2 */ u_short upec1; /* burst error bit position */ u_short upec2; /* burst error bit pattern */ }; /* Other bits of upcs1 */ #define UP_SC 0100000 /* special condition */ #define UP_TRE 0040000 /* transfer error */ #define UP_PSEL 0010000 /* port select */ #define UP_DVA 0004000 /* drive available */ /* bits 8 and 9 are the extended address bits */ #define UP_RDY 0000200 /* controller ready */ #define UP_IE 0000100 /* interrupt enable */ /* bits 5-1 are the command */ #define UP_GO 0000001 /* commands */ #define UP_NOP 000 #define UP_SEEK 004 /* seek */ #define UP_RECAL 006 /* recalibrate */ #define UP_DCLR 010 /* drive clear */ #define UP_RELEASE 012 /* release */ #define UP_OFFSET 014 /* offset */ #define UP_RTC 016 /* return to center-line */ #define UP_PRESET 020 /* read-in preset */ #define UP_PACK 022 /* pack acknowledge */ #define UP_DMABAND 024 /* dma bandwidth set */ #define UP_SEARCH 030 /* search */ #define UP_WCDATA 050 /* write check data */ #define UP_WCHDR 052 /* write check header and data */ #define UP_WCOM 060 /* write */ #define UP_WHDR 062 /* write header and data */ #define UP_RCOM 070 /* read data */ #define UP_RHDR 072 /* read header and data */ #define UP_BOOT 074 /* boot */ #define UP_FORMAT 076 /* format */ /* upcs2 */ #define UPCS2_DLT 0100000 /* data late */ #define UPCS2_WCE 0040000 /* write check error */ #define UPCS2_UPE 0020000 /* UNIBUS parity error */ #define UPCS2_NED 0010000 /* nonexistent drive */ #define UPCS2_NEM 0004000 /* nonexistent memory */ #define UPCS2_PGE 0002000 /* programming error */ #define UPCS2_MXF 0001000 /* missed transfer */ #define UPCS2_MDPE 0000400 /* massbus data parity error (0) */ #define UPCS2_OR 0000200 /* output ready */ #define UPCS2_IR 0000100 /* input ready */ #define UPCS2_CLR 0000040 /* controller clear */ #define UPCS2_PAT 0000020 /* parity test */ #define UPCS2_BAI 0000010 /* address increment inhibit */ /* bits 0-2 are drive select */ #define UPCS2_BITS \ "\10\20DLT\17WCE\16UPE\15NED\14NEM\13PGE\12MXF\11MDPE\ \10OR\7IR\6CLR\5PAT\4BAI" /* upds */ #define UPDS_ATA 0100000 /* attention active */ #define UPDS_ERR 0040000 /* composite drive error */ #define UPDS_PIP 0020000 /* positioning in progress */ #define UPDS_MOL 0010000 /* medium on line */ #define UPDS_WRL 0004000 /* write locked */ #define UPDS_LST 0002000 /* last sector transferred */ #define UPDS_PGM 0001000 /* programmable */ #define UPDS_DPR 0000400 /* drive present */ #define UPDS_DRY 0000200 /* drive ready */ #define UPDS_VV 0000100 /* volume valid */ /* bits 1-5 are spare */ #define UPDS_OM 0000001 /* offset mode */ #define UPDS_DREADY (UPDS_DPR|UPDS_DRY|UPDS_MOL|UPDS_VV) #define UPDS_BITS \ "\10\20ATA\17ERR\16PIP\15MOL\14WRL\13LST\12PGM\11DPR\10DRY\7VV\1OM" /* uper1 */ #define UPER1_DCK 0100000 /* data check */ #define UPER1_UNS 0040000 /* drive unsafe */ #define UPER1_OPI 0020000 /* operation incomplete */ #define UPER1_DTE 0010000 /* drive timing error */ #define UPER1_WLE 0004000 /* write lock error */ #define UPER1_IAE 0002000 /* invalid address error */ #define UPER1_AOE 0001000 /* address overflow error */ #define UPER1_HCRC 0000400 /* header crc error */ #define UPER1_HCE 0000200 /* header compare error */ #define UPER1_ECH 0000100 /* ecc hard error */ #define UPER1_WCF 0000040 /* write clock fail (0) */ #define UPER1_FER 0000020 /* format error */ #define UPER1_PAR 0000010 /* parity error */ #define UPER1_RMR 0000004 /* register modification refused */ #define UPER1_ILR 0000002 /* illegal register */ #define UPER1_ILF 0000001 /* illegal function */ #define UPER1_BITS \ "\10\20DCK\17UNS\16OPI\15DTE\14WLE\13IAE\12AOE\11HCRC\10HCE\ \7ECH\6WCF\5FER\4PAR\3RMR\2ILR\((1ILF" /* uphr */ /* write these int uphr and then read back values */ #define UPHR_MAXCYL 0100027 /* max cyl address */ #define UPHR_MAXTRAK 0100030 /* max track address */ #define UPHR_MAXSECT 0100031 /* max sector address */ /* uper2 */ #define UPER2_BSE 0100000 /* bad sector error */ #define UPER2_SKI 0040000 /* seek incomplete */ #define UPER2_OPE 0020000 /* operator plug error */ #define UPER2_IVC 0010000 /* invalid command */ #define UPER2_LSC 0004000 /* loss of sector clock */ #define UPER2_LBC 0002000 /* loss of bit clock */ #define UPER2_MDS 0001000 /* multiple drive select */ #define UPER2_DCU 0000400 /* dc power unsafe */ #define UPER2_DVC 0000200 /* device check */ #define UPER2_ACU 0000100 /* ac power unsafe */ /* bits 5 and 4 are spare */ #define UPER2_DPE 0000010 /* data parity error (0) */ /* bits 2-0 are spare */ #define UPER2_BITS \ "\10\20BSE\17SKI\16OPE\15IVC\14LSC\13LBC\12MDS\11DCU\10DVC\7ACU\4DPE" /* upof */ #define UPOF_FMT22 0010000 /* 16 bit format */ #define UPOF_ECI 0004000 /* ecc inhibit */ #define UPOF_HCI 0002000 /* header compare inhibit */ /* THE SC21 ACTUALLY JUST IMPLEMENTS ADVANCE/RETARD... */ #define UPOF_P400 0020 /* +400 uinches */ #define UPOF_M400 0220 /* -400 uinches */ #define UPOF_P800 0040 /* +800 uinches */ #define UPOF_M800 0240 /* -800 uinches */ #define UPOF_P1200 0060 /* +1200 uinches */ #define UPOF_M1200 0260 /* -1200 uinches */ 2MDS\11DCU\10DVC\7ACU\4DPE" /* upof */ #define UPOF_FMT22 0010000 /* 16 bit format */ #define UPOF_Esys/h/cmap.h 444 0 33 2776 2506431501 6177 /* cmap.h 4.5 81/03/09 */ /* * core map entry */ struct cmap { unsigned int c_next:13, /* index of next free list entry */ c_prev:13, /* index of previous free list entry */ c_mdev:4, /* which mounted dev this is from */ c_lock:1, /* locked for raw i/o or pagein */ c_want:1, /* wanted */ c_page:16, /* virtual page number in segment */ c_hlink:13, /* hash link for */ c_intrans:1, /* intransit bit */ c_free:1, /* on the free list */ c_gone:1, /* associated page has been released */ c_type:2, /* type CSYS or CTEXT or CSTACK or CDATA */ c_blkno:20, /* disk block this is a copy of */ c_ndx:10; /* index of owner proc or text */ }; #define CMHEAD 0 /* * Shared text pages are not totally abandoned when a process * exits, but are remembered while in the free list hashed by * off the cmhash structure so that they can be reattached * if another instance of the program runs again soon. */ #define CMHSIZ 512 /* SHOULD BE DYNAMIC */ #define CMHASH(bn) ((bn)&(CMHSIZ-1)) #ifdef KERNEL struct cmap *cmap; struct cmap *ecmap; int ncmap; struct cmap *mfind(); int firstfree, maxfree; int ecmx; /* cmap index of ecmap */ short cmhash[CMHSIZ]; #endif /* bits defined in c_type */ #define CSYS 0 /* none of below */ #define CTEXT 1 /* belongs to shared text segment */ #define CDATA 2 /* belongs to data segment */ #define CSTACK 3 /* belongs to stack segment */ #define pgtocm(x) ((((x)-firstfree) / CLSIZE) + 1) #define cmtopg(x) ((((x)-1) * CLSIZE) + firstfree) MHsys/h/conf.h 444 0 33 2037 2512733277 6206 /* conf.h 4.7 81/04/03 */ /* * Declaration of block device * switch. Each entry (row) is * the only link between the * main unix code and the driver. * The initialization of the * device switches is in the * file conf.c. */ struct bdevsw { int (*d_open)(); int (*d_close)(); int (*d_strategy)(); int (*d_dump)(); int d_flags; }; #ifdef KERNEL struct bdevsw bdevsw[]; #endif /* * Character device switch. */ struct cdevsw { int (*d_open)(); int (*d_close)(); int (*d_read)(); int (*d_write)(); int (*d_ioctl)(); int (*d_stop)(); int (*d_reset)(); struct tty *d_ttys; }; #ifdef KERNEL struct cdevsw cdevsw[]; #endif /* * tty line control switch. */ struct linesw { int (*l_open)(); int (*l_close)(); int (*l_read)(); char *(*l_write)(); int (*l_ioctl)(); int (*l_rint)(); int (*l_rend)(); int (*l_meta)(); int (*l_start)(); int (*l_modem)(); }; #ifdef KERNEL struct linesw linesw[]; #endif /* * Swap device information */ struct swdevt { dev_t sw_dev; int sw_freed; }; #ifdef KERNEL struct swdevt swdevt[]; #endif top)(); int (*d_reset)(); struct tty *d_ttys; }; #ifdef KERNEL struct cdevsw cdevsw[]; #endif /* * tty line control switch. */ struct linesw { int (*l_open)(); int (*l_close)(); int (*l_read)(); char *(*l_write)(); int (*l_ioctl)(); int (*l_rint)(); int (*l_rend)(); int (*l_meta)(); int (*l_start)(); int (*l_modem)(); }; #ifdef KERNEL struct linesw linesw[]; #endif /* * Swap device information */ struct swdevt { dev_t sw_dev; int sw_freed; }; #ifdef KERNEL sys/h/ioctl.h 444 0 33 10105 2624052063 6375 /* ioctl.h 4.8 81/08/31 */ /* * ioctl definitions, and special character and local tty definitions */ #ifndef _IOCTL_ #define _IOCTL_ struct tchars { char t_intrc; /* interrupt */ char t_quitc; /* quit */ char t_startc; /* start output */ char t_stopc; /* stop output */ char t_eofc; /* end-of-file */ char t_brkc; /* input delimiter (like nl) */ }; struct ltchars { char t_suspc; /* stop process signal */ char t_dsuspc; /* delayed stop process signal */ char t_rprntc; /* reprint line */ char t_flushc; /* flush output (toggles) */ char t_werasc; /* word erase */ char t_lnextc; /* literal next character */ }; /* * local mode settings */ #define LCRTBS 0000001 /* correct backspacing for crt */ #define LPRTERA 0000002 /* printing terminal \ ... / erase */ #define LCRTERA 0000004 /* do " \b " to wipe out character */ #define LTILDE 0000010 /* IIASA - hazeltine tilde kludge */ #define LMDMBUF 0000020 /* IIASA - start/stop output on carrier intr */ #define LLITOUT 0000040 /* IIASA - suppress any output translations */ #define LTOSTOP 0000100 /* send stop for any background tty output */ #define LFLUSHO 0000200 /* flush output sent to terminal */ #define LNOHANG 0000400 /* IIASA - don't send hangup on carrier drop */ #define LETXACK 0001000 /* IIASA - diablo style buffer hacking */ #define LCRTKIL 0002000 /* erase whole line on kill with " \b " */ #define LINTRUP 0004000 /* interrupt on every input char - SIGTINT */ #define LCTLECH 0010000 /* echo control characters as ^X */ #define LPENDIN 0020000 /* tp->t_rawq is waiting to be reread */ #define LDECCTQ 0040000 /* only ^Q starts after ^S */ #define LNOFLSH 0100000 /* dont flush output on signals */ /* local state */ #define LSBKSL 01 /* state bit for lowercase backslash work */ #define LSQUOT 02 /* last character input was \ */ #define LSERASE 04 /* within a \.../ for LPRTRUB */ #define LSLNCH 010 /* next character is literal */ #define LSTYPEN 020 /* retyping suspended input (LPENDIN) */ #define LSCNTTB 040 /* counting width of tab; leave LFLUSHO alone */ /* * tty ioctl commands */ #define TIOCGETD (('t'<<8)|0) /* get line discipline */ #define TIOCSETD (('t'<<8)|1) /* set line discipline */ #define TIOCHPCL (('t'<<8)|2) /* set hangup line on close bit */ #define TIOCMODG (('t'<<8)|3) /* modem bits get (???) */ #define TIOCMODS (('t'<<8)|4) /* modem bits set (???) */ #define TIOCGETP (('t'<<8)|8) /* get parameters - like old gtty */ #define TIOCSETP (('t'<<8)|9) /* set parameters - like old stty */ #define TIOCSETN (('t'<<8)|10) /* set params w/o flushing buffers */ #define TIOCEXCL (('t'<<8)|13) /* set exclusive use of tty */ #define TIOCNXCL (('t'<<8)|14) /* reset exclusive use of tty */ #define TIOCFLUSH (('t'<<8)|16) /* flush buffers */ #define TIOCSETC (('t'<<8)|17) /* set special characters */ #define TIOCGETC (('t'<<8)|18) /* get special characters */ #define TIOCIOANS (('t'<<8)|20) #define TIOCSIGNAL (('t'<<8)|21) #define TIOCUTTY (('t'<<8)|22) /* locals, from 127 down */ #define TIOCLBIS (('t'<<8)|127) /* bis local mode bits */ #define TIOCLBIC (('t'<<8)|126) /* bic local mode bits */ #define TIOCLSET (('t'<<8)|125) /* set entire local mode word */ #define TIOCLGET (('t'<<8)|124) /* get local modes */ #define TIOCSBRK (('t'<<8)|123) /* set break bit */ #define TIOCCBRK (('t'<<8)|122) /* clear break bit */ #define TIOCSDTR (('t'<<8)|121) /* set data terminal ready */ #define TIOCCDTR (('t'<<8)|120) /* clear data terminal ready */ #define TIOCGPGRP (('t'<<8)|119) /* get pgrp of tty */ #define TIOCSPGRP (('t'<<8)|118) /* set pgrp of tty */ #define TIOCSLTC (('t'<<8)|117) /* set local special characters */ #define TIOCGLTC (('t'<<8)|116) /* get local special characters */ #define TIOCOUTQ (('t'<<8)|115) /* number of chars in output queue */ #define TIOCSTI (('t'<<8)|114) /* simulate a terminal in character */ #define OTTYDISC 0 /* old, v7 std tty driver */ #define NETLDISC 1 /* line discip for berk net */ #define NTTYDISC 2 /* new tty discipline */ #define FIOCLEX (('f'<<8)|1) #define FIONCLEX (('f'<<8)|2) /* another local(( */ #define FIONREAD (('f'<<8)|127) /* get # bytes to read */ #endif aracters */ #define TIOCGLTC (('t'<<8)|116) /* get local special characters */ #define TIOCOUTQ (('t'<<8)|115) /* number of chars in output queue */ #define TIOCSTI (('t'<<8)|114) /* simulate a terminal in character */ #define OTTYDISC 0 /* old, v7 std tty driver */ #define NETLDISC 1 /* line discip for berk net */ #define NTTYDISC 2 /* new tty discipline */ #define FIOCLEX (('f'<<8)|1) #define FIONCLEX (('f'<<8)|2) /* another localsys/h/dir.h 444 0 33 171 2506431503 6002 /* dir.h 4.2 81/02/19 */ #ifndef DIRSIZ #define DIRSIZ 14 #endif struct direct { ino_t d_ino; char d_name[DIRSIZ]; }; ocal special characters */ #define TIOCOUTQ (('t'<<8)|115) /* number of chars in output queue */ #define TIOCSTI (('t'<<8)|114) /* simulate a terminal in character */ #define OTTYDISC 0 /* old, v7 std tty driver */ #define NETLDISC 1 /* line discip for berk net */ #define NTTYDISC 2 /* new tty/hL,hL5< /,"sys/h/dmap.h 444 0 33 1461 2522400364 6167 /* dmap.h 4.3 81/04/23 */ /* * Definitions for the mapping of vitual swap * space to the physical swap area - the disk map. */ #define NDMAP 16 /* size of the swap area map */ #define DMMIN 32 /* the initial block size in clicks */ #define DMMAX 1024 /* max block size alloc on drum = .5M byte */ #define DMTEXT 1024 /* size of blocks of pure text = .5M byte */ struct dmap { swblk_t dm_size; /* current size used by process */ swblk_t dm_alloc; /* amount of physical swap space allocated */ swblk_t dm_map[NDMAP]; /* first disk block number in each chunk */ }; #ifdef KERNEL struct dmap zdmap; #endif /* * The following structure is that ``returned'' * from a call to vstodb(). */ struct dblock { swblk_t db_base; /* base of physical contig drum block */ swblk_t db_size; /* size of block */ }; / #define DMTEXT 1024 /* size of blocks of pure text = .5M byte */ struct dmap { swblk_t dm_size; /* current size used by process */ swblk_t dm_alloc; /* amount of physical swap space allocated */ swblksys/h/fblk.h 444 0 33 132 2506431504 6140 /* fblk.h 4.2 81/02/19 */ struct fblk { int df_nfree; daddr_t df_free[NICFREE]; }; zdmap; #endif /* * The following structure is that ``returned'' * from a call to vstodb(). */ struct dblock { swblk_t db_base; /* base of physical contig drum block */ swblk_t db_size; /* size of block */ }; / #define DMTEXT 1024 /* size of blocks of pure text = .5M byte */ struct dmap { swblk_t dm_size; /* current siz/hL,hL5< /,"sys/h/file.h 444 0 33 1260 2512460634 6167 /* file.h 4.5 81/03/09 */ /* * One file structure is allocated * for each open/creat/pipe call. * Main use is to hold the read/write * pointer associated with each open * file. */ struct file { short f_flag; short f_count; /* reference count */ struct inode *f_inode; /* pointer to inode structure */ union { off_t f_offset; /* read/write character pointer */ struct chan *f_chan; /* mpx channel pointer */ } f_un; }; #ifdef KERNEL struct file *file, *fileNFILE; /* the file table itself */ int nfile; struct file *getf(); struct file *falloc(); #endif /* flags */ #define FREAD 01 #define FWRITE 02 #define FPIPE 04 #define FMPX 010 #define FMPY 020 #define FMP 030 file. */ struct file { short f_flag; short f_count; /* reference count */ struct inode *f_inode; /* pointer to inode structure */ union { off_t f_offset; /* read/write character pointer */ struct chan *f_chan; /* mpx channel pointer */ } f_un; }; #ifdef KERNEL struct file *file, *fileNFILE; /* the file table itself */ insys/h/filsys.h 444 0 33 2134 2506431505 6560 /* filsys.h 4.3 81/03/03 */ /* * Structure of the super-block */ struct filsys { unsigned short s_isize; /* size in blocks of i-list */ daddr_t s_fsize; /* size in blocks of entire volume */ short s_nfree; /* number of addresses in s_free */ daddr_t s_free[NICFREE]; /* free block list */ short s_ninode; /* number of i-nodes in s_inode */ ino_t s_inode[NICINOD]; /* free i-node list */ char s_flock; /* lock during free list manipulation */ char s_ilock; /* lock during i-list manipulation */ char s_fmod; /* super block modified flag */ char s_ronly; /* mounted read-only flag */ time_t s_time; /* last super block update */ daddr_t s_tfree; /* total free blocks*/ ino_t s_tinode; /* total free inodes */ short s_dinfo[2]; /* interleave stuff */ #define s_m s_dinfo[0] #define s_n s_dinfo[1] char s_fsmnt[12]; /* ordinary file mounted on */ /* end not maintained */ ino_t s_lasti; /* start place for circular search */ ino_t s_nbehind; /* est # free inodes before s_lasti */ }; #ifdef KERNEL struct filsys *getfs(); #endif nly; /* mounted read-only flag */ time_t s_time; /* last super block update */ daddr_t s_tfree; /* total free blocks*/ ino_t s_tinode; /* total free inodes */ short s_dinfo[2]; /* interleave stuff */ #define s_m s_dinfo[0] #define s_n s_dinfo[1] char s_fsmnt[12]; /* ordinary file mounted on */ /* end not maintained */ ino_t s_lasti; /* start place for circular search */ ino_t s_nbehinsys/h/flp.h 444 0 33 2763 2506431505 6040 /* flp.h 4.4 81/02/25 */ #if VAX780 /* * Console floppy command/status and sectoring information. */ #define FL_FFC 0x200 /* floppy function complete */ #define FL_ERR 0x80 /* error bit in floppy status byte */ #define FL_PERR 0x905 /* floppy protocol error */ #define FL_DATA 0x100 /* floppy data select code */ #define FL_RS 0x900 /* floppy read sector command */ #define FL_WS 0x901 /* floppy write sector command*/ #define FL_STAT 0x902 /* floppy get status command*/ #define FL_CANCEL 0x904 /* cancel floppy function */ #define RXFTRK 77 /* tracks/floppy */ #define RXSTRK 26 /* sectors/track */ #define RXBYSEC 128 /* bytes/sector */ #define MAXSEC (RXFTRK*RXSTRK) /* sectors/floppy */ /* * In the floppy driver routines, the device active byte is used * not as a boolean, but as an indicator of the state we are in. * That is, it contains what to do on the next interrupt. */ #define FL_IDLE 0 /* floppy idle */ #define FL_MAND 1 /* about to send read/write command */ #define FL_SEC 2 /* about to send sector # to LSI */ #define FL_TRACK 3 /* about to send track # to LSI */ #define FL_DAX 4 /* transmitting data */ #define FL_DAR 5 /* receiving data */ #define FL_COM 6 /* completing transmission */ #define FL_CAN 7 /* give cancel order - we had an error, and are to restart */ #define FLERRS 5 /* number of retries before quitting */ /* * The state byte is used to retain exclusivity, * and contains the busy flag. */ #define FL_OPEN 1 #define FL_BUSY 2 #endif ine FL_SEC 2sys/h/inline.h 444 0 33 1727 2506431505 6534 ((/* inline.h 4.3 81/02/26 */ /* * Definitions of inlines, and macro replacements * for them if UNFAST (latter only scantily tested). */ #ifndef UNFAST #define plock(ip) \ { \ while ((ip)->i_flag & ILOCK) { \ (ip)->i_flag |= IWANT; \ sleep((caddr_t)(ip), PINOD); \ } \ (ip)->i_flag |= ILOCK; \ } #define prele(ip) \ { \ (ip)->i_flag &= ~ILOCK; \ if ((ip)->i_flag&IWANT) { \ (ip)->i_flag &= ~IWANT; \ wakeup((caddr_t)(ip)); \ } \ } #define GETF(fp, fd) { \ if ((unsigned)(fd) >= NOFILE || ((fp) = u.u_ofile[fd]) == NULL) { \ u.u_error = EBADF; \ return; \ } \ } #define IUPDAT(ip, t1, t2, waitfor) { \ if (ip->i_flag&(IUPD|IACC|ICHG)) \ iupdat(ip, t1, t2, waitfor); \ } #define ISSIG(p) ((p)->p_sig && \ ((p)->p_flag&STRC || ((p)->p_sig &~ (p)->p_ignsig)) && issig()) #else #define GETF(fp, fd) { \ (fp) = getf(fd); \ if ((fp) == NULL) \ return; \ } #define IUPDAT(ip, t1, t2, waitfor) iupdat(ip, t1, t2, waitfor) #define ISSIG(p) issig(p) #endif { \ if ((unsigned)(fd) >= NOFILE || ((fpsys/h/ino.h 444 0 33 1076 2506431506 6041 /* ino.h 4.2 81/02/19 */ /* * Inode structure as it appears on * a disk block. */ struct dinode { unsigned short di_mode; /* mode and type of file */ short di_nlink; /* number of links to file */ short di_uid; /* owner's user id */ short di_gid; /* owner's group id */ off_t di_size; /* number of bytes in file */ char di_addr[40]; /* disk block addresses */ time_t di_atime; /* time last accessed */ time_t di_mtime; /* time last modified */ time_t di_ctime; /* time created */ }; /* * the 40 address bytes: * 39 used; 13 addresses * of 3 bytes each. */ on * a disk block. */ struct dinode { unsigned short di_mode; /* mode and type of file */ short di_nlink; /* number of links to file */ short di_uid; /* owner's user id */ short di_gid; /* owner's group id */ off_t di_size; /* number of bytes in file */ char di_addr[40]; /* disk block addresses */ time_t di_atime; /* time last accessed */ time_t di_mtime; /* time last modified */ time_t di_ctime; /* time created */ }; /* * the 40 adsys/h/inode.h 444 0 33 5251 2506431506 6351 /* inode.h 4.5 81/03/09 */ /* * The I node is the focus of all * file activity in unix. There is a unique * inode allocated for each active file, * each current directory, each mounted-on * file, text file, and the root. An inode is 'named' * by its dev/inumber pair. (iget/iget.c) * Data, from mode on, is read in * from permanent inode on volume. */ #define NADDR 13 #define NINDEX 6 struct group { short g_state; char g_index; char g_rot; struct group *g_group; struct inode *g_inode; struct file *g_file; short g_rotmask; short g_datq; struct chan *g_chans[NINDEX]; }; struct inode { char i_flag; char i_count; /* reference count */ dev_t i_dev; /* device where inode resides */ ino_t i_number; /* i number, 1-to-1 with device address */ unsigned short i_mode; short i_nlink; /* directory entries */ short i_uid; /* owner */ short i_gid; /* group of owner */ off_t i_size; /* size of file */ union { struct { daddr_t I_addr[NADDR]; /* if normal file/directory */ daddr_t I_lastr; /* last read (for read-ahead) */ } i_f; #define i_addr i_f.I_addr #define i_lastr i_f.I_lastr struct { daddr_t I_rdev; /* i_addr[0] */ struct group I_group; /* multiplexor group file */ } i_d; #define i_rdev i_d.I_rdev #define i_group i_d.I_group } i_un; short i_vfdcnt; /* number of fd's vreading this inode */ short i_hlink; /* link in hash chain (iget/iput/ifind) */ }; #ifdef KERNEL struct inode *inode, *inodeNINODE; int ninode; struct inode *rootdir; /* pointer to inode of root directory */ struct inode *mpxip; /* mpx virtual inode */ struct inode *ialloc(); struct inode *ifind(); struct inode *iget(); struct inode *owner(); struct inode *maknode(); struct inode *namei(); #endif /* flags */ #define ILOCK 01 /* inode is locked */ #define IUPD 02 /* file has been modified */ #define IACC 04 /* inode access time to be updated */ #define IMOUNT 010 /* inode is mounted on */ #define IWANT 020 /* some process waiting on lock */ #define ITEXT 040 /* inode is pure text prototype */ #define ICHG 0100 /* inode has been changed */ #define IPIPE 0200 /* inode is a pipe */ /* modes */ #define IFMT 0170000 /* type of file */ #define IFDIR 0040000 /* directory */ #define IFCHR 0020000 /* character special */ #define IFBLK 0060000 /* block special */ #define IFREG 0100000 /* regular */ #define IFMPC 0030000 /* multiplexed char special */ #define IFMPB 0070000 /* multiplexed block special */ #define ISUID 04000 /* set user id on execution */ #define ISGID 02000 /* set group id on execution */ #define ISVTX 01000 /* save swapped text even after use */ #define IREAD 0400 /* read, write, execute permissions */ #define IWRITE 0200 #define IEXEC 0100 directory */ #define IFCHR 0020000 /* character special */ #define IFBLK 0060000 /* block special */ #define IFREG 0100000 /* regular */ #define IFMPC 0030000 /* multiplexed char special */ #define IFMPB 0070000 /* multiplexed block special */ #define ISUID 04000 /* set user id on execution */ #define ISGID 02000 /* set group id on exsys/h/user.h 444 0 33 11312 2662315410 6242 /* user.h 4.8 81/04/28 */ #ifdef KERNEL #include "../h/pcb.h" #include "../h/dmap.h" #include "../h/vtimes.h" #include "assym.s" #else #include #include #include #endif /* * The user structure. * One allocated per process. * Contains all per process data * that doesn't need to be referenced * while the process is swapped. * The user block is UPAGES*NBPG bytes * long; resides at virtual user * loc 0x80000000-UPAGES*NBPG; contains the system * stack per user; is cross referenced * with the proc structure for the * same process. */ #define SHSIZE 32 struct user { struct pcb u_pcb; int u_arg[5]; /* arguments to current system call */ label_t u_qsav; /* for non-local gotos on interrupts */ char u_segflg; /* 0:user D; 1:system; 2:user I */ char u_error; /* return error code */ short u_uid; /* effective user id */ short u_gid; /* effective group id */ short u_ruid; /* real user id */ short u_rgid; /* real group id */ struct proc *u_procp; /* pointer to proc structure */ int *u_ap; /* pointer to arglist */ union { /* syscall return values */ struct { int R_val1; int R_val2; } u_rv; #define r_val1 u_rv.R_val1 #define r_val2 u_rv.R_val2 off_t r_off; time_t r_time; } u_r; caddr_t u_base; /* base address for IO */ unsigned int u_count; /* bytes remaining for IO */ off_t u_offset; /* offset in file for IO */ struct inode *u_cdir; /* pointer to inode of current directory */ struct inode *u_rdir; /* root directory of current process */ char u_dbuf[DIRSIZ]; /* current pathname component */ caddr_t u_dirp; /* pathname pointer */ struct direct u_dent; /* current directory entry */ struct inode *u_pdir; /* inode of parent directory of dirp */ struct file *u_ofile[NOFILE]; /* pointers to file structures of open files */ char u_pofile[NOFILE]; /* per-process flags of open files */ #define EXCLOSE 01 /* auto-close on exec */ label_t u_ssav; /* label variable for swapping */ int (*u_signal[NSIG])(); /* disposition of signals */ int u_code; /* ``code'' to trap */ /* on SIGILL code passes compatibility mode fault address */ /* on SIGFPE code passes more specific kind of floating point fault */ int *u_ar0; /* address of users saved R0 */ struct uprof { /* profile arguments */ short *pr_base; /* buffer base */ unsigned pr_size; /* buffer size */ unsigned pr_off; /* pc offset */ unsigned pr_scale; /* pc scaling */ } u_prof; char u_eosys; /* special action on end of syscall */ char u_sep; /* flag for I and D separation */ struct tty *u_ttyp; /* controlling tty pointer */ dev_t u_ttyd; /* controlling tty dev */ union { struct { /* header of executable file */ int Ux_mag; /* magic number */ unsigned Ux_tsize; /* text size */ unsigned Ux_dsize; /* data size */ unsigned Ux_bsize; /* bss size */ unsigned Ux_ssize; /* symbol table size */ unsigned Ux_entloc; /* entry location */ unsigned Ux_unused; unsigned Ux_relflg; } Ux_A; char ux_shell[SHSIZE]; /* #! and name of interpreter */ } u_exdata; #define ux_mag Ux_A.Ux_mag #define ux_tsize Ux_A.Ux_tsize #define ux_dsize Ux_A.Ux_dsize #define ux_bsize Ux_A.Ux_bsize #define ux_ssize Ux_A.Ux_ssize #define ux_entloc Ux_A.Ux_entloc #define ux_unused Ux_A.Ux_unused #define ux_relflg Ux_A.Ux_relflg char u_comm[DIRSIZ]; time_t u_start; char u_acflag; short u_fpflag; /* unused now, will be later */ short u_cmask; /* mask for file creation */ size_t u_tsize; /* text size (clicks) */ size_t u_dsize; /* data size (cli((cks) */ size_t u_ssize; /* stack size (clicks) */ struct vtimes u_vm; /* stats for this proc */ struct vtimes u_cvm; /* sum of stats for reaped children */ struct dmap u_dmap; /* disk map for data segment */ struct dmap u_smap; /* disk map for stack segment */ struct dmap u_cdmap, u_csmap; /* shadows of u_dmap, u_smap, for use of parent during fork */ time_t u_outime; /* user time at last sample */ size_t u_odsize, u_ossize; /* for (clumsy) expansion swaps */ size_t u_vrpages[NOFILE]; /* number vread pages hanging on fd */ int u_limit[8]; /* see */ #ifdef notdef unsigned u_vsave; /* saved previous fault page number */ #endif int u_stack[1]; /* * kernel stack per user * extends from u + UPAGES*512 * backward not to reach here */ /* SHOULD INSTEAD GROW STACK BACKWARDS ABOVE u. TOWARDS A VIRTUAL HOLE */ }; /* u_eosys values */ #define JUSTRETURN 0 #define RESTARTSYS 1 #define SIMULATERTI 2 /* u_error codes */ #include #ifdef KERNEL extern struct user u; extern struct user swaputl; extern struct user forkutl; extern struct user xswaputl; extern struct user xswap2utl; extern struct user pushutl; extern struct user vfutl; #endif stack per user * extends from u + UPAGES*512 * backward not to reach here */ /* SHOULD INSTEAD GROW STACK BACKWARDS ABOVE u. TOWARDS A VIRTUAL HOLE */ }; /* u_eosys values */ #define JUSTRETURN 0 #define RESTARTSYS 1 #define SIMULATERTI 2 /* u_error codes */ #include #ifdef KERsys/h/map.h 444 0 33 3115 2506431510 6020 /* map.h 4.5 81/02/28 */ /* * Resource Allocation Maps. * * Associated routines manage sub-allocation of an address space using * an array of segment descriptors. The first element of this array * is a map structure, describing the arrays extent and the name * of the controlled object. Each additional structure represents * a free segment of the address space. * * A call to rminit initializes a resource map and may also be used * to free some address space for the map. Subsequent calls to rmalloc * and rmfree allocate and free space in the resource map. If the resource * map becomes too fragmented to be described in the available space, * then some of the resource is discarded. This may lead to critical * shortages, but is better than not checking (as the previous versions * of these routines did) or giving up and calling panic(). The routines * could use linked lists and call a memory allocator when they run * out of space, but that would not solve the out of space problem when * called at interrupt time. * * N.B.: The address 0 in the resource address space is not available * as it is used internally by the resource map routines. */ struct map { struct mapent *m_limit; /* address of last slot in map */ char *m_name; /* name of resource */ /* we use m_name when the map overflows, in warning messages */ }; struct mapent { int m_size; /* size of this segment of the map */ int m_addr; /* resource-space addr of start of segment */ }; #ifdef KERNEL struct map *swapmap; int nswapmap; struct map *argmap; #define ARGMAPSIZE 16 struct map *kernelmap; #endif e is not available * as it is used internally by the resource map routines. */ struct map { struct mapent *m_limit; /* address of last slot in map */ char *m_name; /* name of resource */ /* we use m_name when the map overflows, in warning messages */ }; struct mapent { int m_size; /* size of this segment of the map */ int m_addr; /* resource-space addr of start of segment */ }; #ifdef KERNEL struct map *swapmap; int nswapsys/h/nexus.h 444 0 33 4540 2512563723 6421 /* nexus.h 4.10 81/04/03 */ /* * Information about nexus's. * * Each machine has an address of backplane slots (nexi). * Each nexus is some type of adapter, whose code is the low * byte of the first word of the adapter address space. * At boot time the system looks through the array of available * slots and finds the interconnects for the machine. */ #if VAX780 #define NNEX780 16 #define NEX780 ((struct nexus *)0x20000000) #endif #if VAX750 #define NNEX750 16 #define NEX750 ((struct nexus *)0xf20000) #endif #if VAX7ZZ #define NNEX7ZZ 16 #define NEX7ZZ ((struct nexus *)0xf20000) #endif #define NEXSIZE 0x2000 #define MAXNNEXUS 16 #ifndef LOCORE struct nexus { union nexcsr { long nex_csr; u_char nex_type; } nexcsr; long nex_pad[NEXSIZE / sizeof (long) - 1]; }; #ifdef KERNEL struct nexus nexus[MAXNNEXUS]; #endif #endif /* * Bits in high word of nexus's. */ #define SBI_PARFLT (1<<31) /* sbi parity fault */ #define SBI_WSQFLT (1<<30) /* write sequence fault */ #define SBI_URDFLT (1<<29) /* unexpected read data fault */ #define SBI_ISQFLT (1<<28) /* interlock sequence fault */ #define SBI_MXTFLT (1<<27) /* multiple transmitter fault */ #define SBI_XMTFLT (1<<26) /* transmit fault */ #define NEX_CFGFLT (0xfc000000) #ifndef LOCORE #if VAX780 #define NEXFLT_BITS \ "\20\40PARFLT\37WSQFLT\36URDFLT\35ISQFLT\34MXTFLT\33XMTFLT" #endif #endif #define NEX_APD (1<<23) /* adaptor power down */ #define NEX_APU (1<<22) /* adaptor power up */ #define MBA_OT (1<<21) /* overtemperature */ #define UBA_UBINIT (1<<18) /* unibus init */ #define UBA_UBPDN (1<<17) /* unibus power down */ #define UBA_UBIC (1<<16) /* unibus initialization complete */ /* * Types for nex_type. */ #define NEX_ANY 0 /* pseudo for handling 11/750 */ #define NEX_MEM4 0x08 /* 4K chips, non-interleaved mem */ #define NEX_MEM4I 0x09 /* 4K chips, interleaved mem */ #define NEX_MEM16 0x10 /* 16K chips, non-interleaved mem */ #define NEX_MEM16I 0x11 /* 16K chips, interleaved mem */ #define NEX_MBA 0x20 /* Massbus adaptor */ #define NEX_UBA0 0x28 /* Unibus adaptor */ #define NEX_UBA1 0x29 /* 4 flavours for 4 addr spaces */ #define NEX_UBA2 0x2a #define NEX_UBA3 0x2b #define NEX_DR32 0x30 /* DR32 user i'face to SBI */ #define NEX_MPM0 0x40 /* Multi-port mem */ #define NEX_MPM1 0x41 /* Who knows why 4 different ones ? */ #define NEX_MPM2 0x42 #define NEX_MPM3 0x43 define NEX_MEM16 0x10 /* 16K chips, non-interleaved mem */ #define NEX_MEM16I 0x11 /* 16K chips, interleaved mem */ #define NEX_MBA 0x20 /* Massbus adaptor sys/h/mount.h 444 0 33 513 2506431510 6364 /* mount.h 4.3 81/02/26 */ /* * Mount structure. * One allocated on every mount. * Used to find the super block. */ struct mount { dev_t m_dev; /* device mounted */ struct buf *m_bufp; /* pointer to superblock */ struct inode *m_inodp; /* pointer to mounted on inode */ }; #ifdef KERNEL struct mount mount[NMOUNT]; #endif define NEX_MPM3 0x43 define NEX_MEM16 0x10 /* 16K chips, non-interleaved mem */ #define /hL,hL5H< /,"sys/h/mtpr.h 444 0 33 5255 2506431511 6235 /* mtpr.h 4.5 81/02/25 */ /* * VAX processor register numbers */ #define KSP 0x0 /* kernel stack pointer */ #define ESP 0x1 /* exec stack pointer */ #define SSP 0x2 /* supervisor stack pointer */ #define USP 0x3 /* user stack pointer */ #define ISP 0x4 /* interrupt stack pointer */ #define P0BR 0x8 /* p0 base register */ #define P0LR 0x9 /* p0 length register */ #define P1BR 0xa /* p1 base register */ #define P1LR 0xb /* p1 length register */ #define SBR 0xc /* system segment base register */ #define SLR 0xd /* system segment length register */ #define PCBB 0x10 /* process control block base */ #define SCBB 0x11 /* system control block base */ #define IPL 0x12 /* interrupt priority level */ #define ASTLVL 0x13 /* async. system trap level */ #define SIRR 0x14 /* software interrupt request */ #define SISR 0x15 /* software interrupt summary */ #define ICCS 0x18 /* interval clock control */ #define NICR 0x19 /* next interval count */ #define ICR 0x1a /* interval count */ #define TODR 0x1b /* time of year (day) */ #define RXCS 0x20 /* console receiver control and status */ #define RXDB 0x21 /* console receiver data buffer */ #define TXCS 0x22 /* console transmitter control and status */ #define TXDB 0x23 /* console transmitter data buffer */ #define MAPEN 0x38 /* memory management enable */ #define TBIA 0x39 /* translation buffer invalidate all */ #define TBIS 0x3a /* translation buffer invalidate single */ #define PMR 0x3d /* performance monitor enable */ #define SID 0x3e /* system(( identification */ #if VAX780 #define ACCS 0x28 /* accelerator control and status */ #define ACCR 0x29 /* accelerator maintenance */ #define WCSA 0x2c /* WCS address */ #define WCSD 0x2d /* WCS data */ #define SBIFS 0x30 /* SBI fault and status */ #define SBIS 0x31 /* SBI silo */ #define SBISC 0x32 /* SBI silo comparator */ #define SBIMT 0x33 /* SBI maintenance */ #define SBIER 0x34 /* SBI error register */ #define SBITA 0x35 /* SBI timeout address */ #define SBIQC 0x36 /* SBI quadword clear */ #define MBRK 0x3c /* micro-program breakpoint */ #endif #if VAX750 #define MCSR 0x17 /* machine check status register */ #define CSRS 0x1c /* console storage receive status register */ #define CSRD 0x1d /* console storage receive data register */ #define CSTS 0x1e /* console storage transmit status register */ #define CSTD 0x1f /* console storage transmit data register */ #define TBDR 0x24 /* translation buffer disable register */ #define CADR 0x25 /* cache disable register */ #define MCESR 0x26 /* machine check error summary register */ #define CAER 0x27 /* cache error */ #define IUR 0x37 /* init unibus register */ #define TB 0x3b /* translation buffer */ #endif tus register */ #define CSRD 0x1d /* console storage receive data register */ #define CSTS 0x1e /* console storage transmit status register */ #define CSTD 0x1f /* console storage transmit data register */ #define TBDR 0x24 /* translation buffer disable register */ #define CADR 0x25 /* cache disable register */ #define MCESR 0x26 /sys/h/mx.h 444 0 33 4244 2506431512 5675 /* mx.h 4.3 81/02/25 */ #define NGROUPS 10 /* number of mpx files permitted at one time */ #define NCHANS 20 /* number of channel structures */ #define NPORTS 30 /* number of channels to i/o ports */ #define CNTLSIZ 10 #define NLEVELS 4 #define NMSIZE 50 /* max size of mxlstn file name */ /* * header returned on read of mpx */ struct rh { short index; short count; short ccount; }; /* * head expected on write of mpx */ struct wh { short index; short count; short ccount; char *data; }; struct mx_args { char *m_name; int m_cmd; int m_arg[3]; }; #ifdef KERNEL /* * internal structure for channel */ struct chan { short c_flags; char c_index; char c_line; struct group *c_group; struct file *c_fy; struct tty *c_ttyp; struct clist c_ctlx; int c_pgrp; struct tty *c_ottyp; char c_oline; union { struct clist datq; } cx; union { struct clist datq; struct chan *c_chan; } cy; struct clist c_ctly; }; struct schan { short c_flags; char c_index; char c_line; struct group *c_group; struct file *c_fy; struct tty *c_ttyp; struct clist c_ctlx; int c_pgrp; }; /* * flags */ #define INUSE 01 #define SIOCTL 02 #define XGRP 04 #define YGRP 010 #define WCLOSE 020 #define ISGRP 0100 #define BLOCK 0200 #define EOTMARK 0400 #define SIGBLK 01000 #define BLKMSG 01000 #define ENAMSG 02000 #define WFLUSH 04000 #define NMBUF 010000 #define PORT 020000 #define ALT 040000 #define FBLOCK 0100000 #endif /* * mpxchan command codes */ #define MPX 5 #define MPXN 6 #define CHAN 1 #define JOIN 2 #define EXTR 3 #define ATTACH 4 #define CONNECT 7 #define DETACH 8 #define DISCON 9 #define DEBUG 10 #define NPGRP 11 #define CSIG 12 #define PACK 13 #define NDEBUGS 30 /* * control channel message codes */ #define M_WATCH 1 #define M_CLOSE 2 #define M_EOT 3 #define M_OPEN 4 #define M_BLK 5 #define M_UBLK 6 #define DO_BLK 7 #define DO_UBLK 8 #define M_IOCTL 12 #define M_IOANS 13 #define M_SIG 14 /* * debug codes other than mpxchan cmds */ #define MCCLOSE 29 #define MCOPEN 28 #define ALL 27 #define SCON 26 #define MSREAD 25 #define SDATA 24 #define MCREAD 23 #define MCWRITE 22 /* mux io controls */ #define MXLSTN (('x'<<8)|1) #define MXNBLK (('x'<<8)|2) e NDEBUGS 30 /* * control channel message codes */ #define M_WATCH 1 #define M_CLOSE 2 #define M_EOT 3 #define M_OPEN 4 #define M_BLK 5 #define M_UBLK 6 #define DO_BLK 7 #define DO_UBLK 8 #define M_IOCTL 12 #define M_IOANS 13 #define M_SIG 14 /* * debug codes other than mpxchan cmds */ #define MCCLOSE 29 #define MCOPEN 28 #define ALL 27 #defsys/h/vcmd.h 444 0 33 233 2506431512 6154 /* vcmd.h 4.3 81/02/25 */ #define VPRINT 0100 #define VPLOT 0200 #define VPRINTPLOT 0400 #define VGETSTATE (('v'<<8)|0) #define VSETSTATE (('v'<<8)|1) '<<8)|2) e NDEBUGS 30 /* * control channel message codes */ #define M_WATCH 1 #define M_CLOSE 2 #define M_EOT 3 #define M_OPEN 4 #define M_BLK 5 #define M_UBLK 6 #define DO_BLK 7 #define DO_UBLK 8 #define M_IOCTL 12 #define M_IOANS 13 #define M_SIG 14 /* * debu/hL,hL5x< /,"sys/h/pcb.h 444 0 33 2502 2531444552 6016 /* pcb.h 4.5 81/05/14 */ /* * VAX process control block */ struct pcb { int pcb_ksp; /* kernel stack pointer */ int pcb_esp; /* exec stack pointer */ int pcb_ssp; /* supervisor stack pointer */ int pcb_usp; /* user stack pointer */ int pcb_r0; int pcb_r1; int pcb_r2; int pcb_r3; int pcb_r4; int pcb_r5; int pcb_r6; int pcb_r7; int pcb_r8; int pcb_r9; int pcb_r10; int pcb_r11; int pcb_r12; #define pcb_ap pcb_r12 int pcb_r13; #define pcb_fp pcb_r13 int pcb_pc; /* program counter */ int pcb_psl; /* program status longword */ struct pte *pcb_p0br; /* seg 0 base register */ int pcb_p0lr; /* seg 0 length register and astlevel */ struct pte *pcb_p1br; /* seg 1 base register */ int pcb_p1lr; /* seg 1 length register and pme */ /* * Software pcb (extension) */ int pcb_szpt; /* number of pages of user page table */ int pcb_cmap2; int *pcb_sswap; int pcb_sigc[3]; }; #define AST_NONE 0x04000000 /* ast level */ #define AST_USER 0x03000000 /* ast for user mode */ #define ASTLVL_NONE 4 #define ASTLVL_USER 3 #define AST_CLR 0x07000000 #define aston() \ { \ u.u_pcb.pcb_p0lr = (u.u_pcb.pcb_p0lr &~ AST_CLR) | AST_USER; \ mtpr(ASTLVL, ASTLVL_USER); \ } #define astoff() \ { \ u.u_pcb.pcb_p0lr = (u.u_pcb.pcb_p0lr &~ AST_CLR) | AST_NONE; \ mtpr(ASTLVL, ASTLVL_NONE); \ } * number of pages of user page table */ int pcb_cmap2; int *pcb_sswap; int pcb_sigc[3]; }; #define AST_NONE 0x04000000 /* ast level */ #define AST_USER 0x03000000 /* ast for user mode */sys/h/pdma.h 444 0 33 175 2506431513 6152 /* pdma.h 4.2 81/02/19 */ struct pdma { struct device *p_addr; char *p_mem; char *p_end; int p_arg; int (*p_fcn)(); }; pcb.pcb_p0lr &~ AST_CLR) | AST_USER; \ mtpr(ASTLVL, ASTLVL_USER); \ } #define astoff() \ { \ u.u_pcb.pcb_p0lr = (u.u_pcb.pcb_p0lr &~ AST_CLR) | AST_NONE; \ mtpr(ASTLVL, ASTLVL_NONE); \ } * number of pages of user page table */ int pcb_cmap2; int *pcb_sswap; int pcb_sigc[3]; }; #de/hL,hL5< /,"sys/h/proc.h 444 0 33 11611 2522400370 6224 /* proc.h 4.8 81/04/23 */ /* * One structure allocated per active * process. It contains all data needed * about the process while the * process may be swapped out. * Other per process data (user.h) * is swapped with the process. */ struct proc { struct proc *p_link; /* linked list of running processes */ struct proc *p_rlink; struct pte *p_addr; /* u-area kernel map address */ char p_usrpri; /* user-priority based on p_cpu and p_nice */ char p_pri; /* priority, negative is high */ char p_cpu; /* cpu usage for scheduling */ char p_stat; char p_time; /* resident time for scheduling */ char p_nice; /* nice for cpu usage */ char p_slptime; /* time since last block */ char p_cursig; long p_sig; /* signals pending to this process */ long p_siga0; /* low bit of 2 bit signal action */ long p_siga1; /* high bit of 2 bit signal action */ #define p_ignsig p_siga0 /* ignored signal mask */ int p_flag; short p_uid; /* user id, used to direct tty signals */ short p_pgrp; /* name of process ((group leader */ short p_pid; /* unique process id */ short p_ppid; /* process id of parent */ short p_poip; /* count of page outs in progress */ short p_szpt; /* copy of page table size */ size_t p_tsize; /* size of text (clicks) */ size_t p_dsize; /* size of data space (clicks) */ size_t p_ssize; /* copy of stack size (clicks) */ size_t p_rssize; /* current resident set size in clicks */ size_t p_maxrss; /* copy of u.u_limit[MAXRSS] */ size_t p_swrss; /* resident set size before last swap */ swblk_t p_swaddr; /* disk address of u area when swapped */ caddr_t p_wchan; /* event process is awaiting */ struct text *p_textp; /* pointer to text structure */ int p_clktim; /* time to alarm clock signal */ struct pte *p_p0br; /* page table base P0BR */ struct proc *p_xlink; /* linked list of procs sharing same text */ short p_cpticks; /* ticks of cpu time */ float p_pctcpu; /* %cpu for this process during p_time */ short p_ndx; /* proc index for memall (because of vfork) */ short p_idhash; /* hashed based on p_pid for kill+exit+... */ struct proc *p_pptr; /* pointer to process structure of parent */ }; #define PIDHSZ 63 #define PIDHASH(pid) ((pid) % PIDHSZ) #ifdef KERNEL short pidhash[PIDHSZ]; struct proc *pfind(); #endif #ifdef KERNEL struct proc *proc, *procNPROC; /* the proc table itself */ int nproc; #define NQS 32 /* 32 run queues */ struct prochd { struct proc *ph_link; /* linked list of running processes */ struct proc *ph_rlink; } qs[NQS]; int whichqs; /* bit mask summarizing non-empty qs's */ #endif /* stat codes */ #define SSLEEP 1 /* awaiting an event */ #define SWAIT 2 /* (abandoned state) */ #define SRUN 3 /* running */ #define SIDL 4 /* intermediate state in process creation */ #define SZOMB 5 /* intermediate state in process termination */ #define SSTOP 6 /* process being traced */ /* flag codes */ #define SLOAD 0x000001 /* in core */ #define SSYS 0x000002 /* swapper or pager process */ #define SLOCK 0x000004 /* process being swapped out */ #define SSWAP 0x000008 /* save area flag */ #define STRC 0x000010 /* process is being traced */ #define SWTED 0x000020 /* another tracing flag */ #define SULOCK 0x000040 /* user settable lock in core */ #define SPAGE 0x000080 /* process in page wait state */ #define SKEEP 0x000100 /* another flag to prevent swap out */ #define SDLYU 0x000200 /* delayed unlock of pages */ #define SWEXIT 0x000400 /* working on exiting */ #define SPHYSIO 0x000800 /* doing physical i/o (bio.c) */ #define SVFORK 0x001000 /* process resulted from vfork() */ #define SVFDONE 0x002000 /* another vfork flag */ #define SNOVM 0x004000 /* no vm, parent in a vfork() */ #define SPAGI 0x008000 /* init data space on demand, from inode */ #define SSEQL 0x010000 /* user warned of sequential vm behavior */ #define SUANOM 0x020000 /* user warned of random vm behavior */ #define STIMO 0x040000 /* timing out during sleep */ #define SDETACH 0x080000 /* detached inherited by init */ #define SNUSIG 0x100000 /* using new signal mechanism */ #define SOWEUPC 0x200000 /* owe process an addupc() call at next ast */ /* * parallel proc structure * to replace part with times * to be passed to parent process * in ZOMBIE state. * * THIS SHOULD BE DONE WITH A union() CONSTRUCTION */ struct xproc { struct proc *xp_link; struct proc *xp_rlink; struct pte *xp_addr; char xp_usrpri; char xp_pri; /* priority, negative is high */ char xp_cpu; /* cpu usage for scheduling */ char xp_stat; char xp_time; /* resident time for scheduling */ char xp_nice; /* nice for cpu usage */ char xp_slptime; char p_cursig; int xp_sig; /* signals pending to this process */ int xp_siga0; int xp_siga1; int xp_flag; short xp_uid; /* user id, used to direct tty signals */ short xp_pgrp; /* name of process group leader */ short xp_pid; /* unique process id */ short xp_ppid; /* process id of parent */ short xp_xstat; /* Exit status for wait */ struct vtimes xp_vm; }; r scheduling */ char xp_stat; char xp_time; /* resident time for scheduling */ char xp_nice; /* nice for cpu usage *sys/h/mtio.h 444 0 33 2664 2624052065 6230 /* mtio.h 4.7 81/11/03 */ /* * Structures and definitions for mag tape io control commands */ /* mag tape io control commands */ #define MTIOCTOP (('m'<<8)|1) /* do a mag tape op */ #define MTIOCGET (('m'<<8)|2) /* get mag tape status */ /* structure for MTIOCTOP - mag tape op command */ struct mtop { short mt_op; /* operations defined below */ daddr_t mt_count; /* how many of them */ }; /* operations */ #define MTWEOF 0 /* write an end-of-file record */ #define MTFSF 1 /* forward space file */ #define MTBSF 2 /* backward space file */ #define MTFSR 3 /* forward space record */ #define MTBSR 4 /* backward space record */ #define MTREW 5 /* rewind */ #define MTOFFL 6 /* rewind and put the drive offline */ #define MTNOP 7 /* no operation, sets status only */ /* structure for MTIOCGET - mag tape get status command */ struct mtget { short mt_type; /* type of magtape device */ /* the following two registers are grossly device dependent */ short mt_dsreg; /* ``drive status'' register */ short mt_erreg; /* ``error'' register */ /* end device-dependent registers */ short mt_resid; /* residual count */ /* the following two are not yet implemented */ daddr_t mt_fileno; /* file number of current position */ daddr_t mt_blkno; /* block number of current position */ /* end not yet implemented */ }; /* * Constants for mt_type byte */ #define MT_ISTS 01 #define MT_ISHT 02 #define MT_ISTM 03 #define MT_ISMT 04 #define MT_ISUT 05 pendent */ short mt_dsreg; /* ``drive status'' register */ short mt_erreg;sys/h/ubavar.h 444 0 33 15110 2624052066 6547 /* ubavar.h 4.21 81/10/27 */ /* * This file contains definitions related to the kernel structures * for dealing with the unibus adapters. * * Each uba has a uba_hd structure. * Each unibus controller which is not a device has a uba_ctlr structure. * Each unibus device has a uba_device structure. */ #ifndef LOCORE /* * Per-uba structure. * * This structure holds the interrupt vector for the uba, * and its address in physical and virtual space. At boot time * we determine the devices attached to the uba's and their * interrupt vectors, filling in uh_vec. We free the map * register and bdp resources of the uba into the structures * defined here. * * During normal operation, resources are allocated and returned * to the structures here. We watch the number of passive releases * on each uba, and if the number is excessive may reset the uba. * * When uba resources are needed and not available, or if a device * which can tolerate no other uba activity (rk07) gets on the bus, * then device drivers may have to wait to get to the bus and are * queued here. It is also possible for processes to block in * the unibus driver in resource wait (mrwant, bdpwant); these * wait states are also recorded here. */ struct uba_hd { struct uba_regs *uh_uba; /* virt addr of uba */ struct uba_regs *uh_physuba; /* phys addr of uba */ int (**uh_vec)(); /* interrupt vector */ struct uba_device *uh_actf; /* head of queue to transfer */ struct uba_device *uh_actl; /* tail of queue to transfer */ short uh_mrwant; /* someone is waiting for map reg */ short uh_bdpwant; /* someone awaits bdp's */ int uh_bdpfree; /* free bdp's */ int uh_hangcnt; /* number of ticks hung */ int uh_zvcnt; /* number of 0 vectors */ int uh_errcnt; /* number of errors */ int uh_lastiv; /* last free interrupt vector */ short uh_users; /* transient bdp use count */ short uh_xclu; /* an rk07 is using this uba! */ #define UAMSIZ 25 struct map *uh_map; /* buffered data path regs free */ }; #ifndef LOCORE /* * Per-controller structure. * (E.g. one for each disk and tape controller, and other things * which use and release buffered data paths.) * * If a controller has devices attached, then there are * cross-referenced uba_drive structures. * This structure is the one which is queued in unibus resource wait, * and saves the information about unibus resources which are used. * The queue of devices waiting to transfer is also attached here. */ struct uba_ctlr { struct uba_driver *um_driver; short um_ctlr; /* controller index in driver */ short um_ubanum; /* the uba it is on */ short um_alive; /* controller exists */ int (**um_intr)(); /* interrupt handler(s) */ caddr_t um_addr; /* address of device in i/o space */ struct uba_hd *um_hd; /* the driver saves the prototype command here for use in its go routine */ int um_cmd; /* communication to dgo() */ int um_ubinfo; /* save unibus registers, etc */ struct buf um_tab; /* queue of devices for this controller */ }; /* * Per ``device'' structure. * (A controller has devices or uses and releases buffered data paths). * (Everything else is a ``device''.) * * If a controller has many drives attached, then there will * be several uba_device structures associated with a single uba_ctlr * structure. * * This structure contains all the information necessary to run * a unibus device such as a dz or a dh. It also contains information * for slaves of unibus controllers as to which device on the slave * this is. A flags field here can also be given in the s((ystem specification * and is used to tell which dz lines are hard wired or other device * specific parameters. */ struct uba_device { struct uba_driver *ui_driver; short ui_unit; /* unit number on the system */ short ui_ctlr; /* mass ctlr number; -1 if none */ short ui_ubanum; /* the uba it is on */ short ui_slave; /* slave on controller */ int (**ui_intr)(); /* interrupt handler(s) */ caddr_t ui_addr; /* address of device in i/o space */ short ui_dk; /* if init 1 set to number for iostat */ short ui_flags; /* parameter from system specification */ short ui_alive; /* device exists */ short ui_type; /* driver specific type information */ caddr_t ui_physaddr; /* phys addr, for standalone (dump) code */ /* this is the forward link in a list of devices on a controller */ struct uba_device *ui_forw; /* if the device is connected to a controller, this is the controller */ struct uba_ctlr *ui_mi; struct uba_hd *ui_hd; }; #endif /* * Per-driver structure. * * Each unibus driver defines entries for a set of routines * as well as an array of types which are acceptable to it. * These are used at boot time by the configuration program. */ struct uba_driver { int (*ud_probe)(); /* see if a driver is really there */ int (*ud_slave)(); /* see if a slave is there */ int (*ud_attach)(); /* setup driver for a slave */ int (*ud_dgo)(); /* fill csr/ba to start transfer */ u_short *ud_addr; /* device csr addresses */ char *ud_dname; /* name of a device */ struct uba_device **ud_dinfo; /* backpointers to ubdinit structs */ char *ud_mname; /* name of a controller */ struct uba_ctlr **ud_minfo; /* backpointers to ubminit structs */ short ud_xclu; /* want exclusive use of bdp's */ }; #endif /* * Flags to UBA map/bdp allocation routines */ #define UBA_NEEDBDP 1 /* transfer needs a bdp */ #define UBA_CANTWAIT 2 /* don't block me */ #define UBA_NEED16 4 /* need 16 bit addresses only */ #define UBA_HAVEBDP 8 /* use bdp specified in high bits */ #ifndef LOCORE #ifdef KERNEL /* * UBA related kernel variables */ int numuba; /* number of uba's */ extern struct uba_hd uba_hd[]; /* * Ubminit and ubdinit initialize the mass storage controller and * device tables specifying possible devices. */ extern struct uba_ctlr ubminit[]; extern struct uba_device ubdinit[]; /* * UNIbus device address space is mapped by UMEMmap * into virtual address umem[][]. */ extern struct pte UMEMmap[][16]; /* uba device addr pte's */ extern char umem[][16*NBPG]; /* uba device addr space */ /* * Since some VAXen vector their first (and only) unibus interrupt * vector just adjacent to the system control block, we must * allocate space there when running on ``any'' cpu. This space is * used for the vector for uba0 on all cpu's. */ extern int (*UNIvec[])(); /* unibus vec for uba0 */ #if VAX780 /* * On 780's, we must set the scb vectors for the nexus of the * UNIbus adaptors to vector to locore unibus adaptor interrupt dispatchers * which make 780's look like the other VAXen. */ extern Xua0int(), Xua1int(), Xua2int(), Xua3int(); #endif VAX780 #endif KERNEL #endif !LOCORE cent to the system control block, we must * allocate space there when running on ``any'' cpu. This space is * used for the vector for uba0 on all cpu's. */ extern int (*UNIvec[])(); /* unibus vec for uba0 */ #if VAX780 /* * On 780's, we must set the scb vectors for the nexus of the * UNIbus adaptors to vector to locore unibus adaptor interrupt dispatchers * which make 780's look like the other VAXen. */ extern Xua0int(), Xua1sys/h/reg.h 444 0 33 671 2506431516 6012 /* reg.h 4.2 81/02/19 */ /* * Location of the users' stored * registers relative to R0. * Usage is u.u_ar0[XX]. */ #define R0 (-18) #define R1 (-17) #define R2 (-16) #define R3 (-15) #define R4 (-14) #define R5 (-13) #define R6 (-12) #define R7 (-11) #define R8 (-10) #define R9 (-9) #define R10 (-8) #define R11 (-7) #define R12 (-21) #define R13 (-20) #define AP (-21) #define FP (-20) #define SP (-5) #define PS (-1) #define PC (-2) ,hL5؈< /,"sys/h/seg.h 444 0 33 173 2506431516 6010 /* seg.h 4.2 81/02/19 */ /* * Mapper addresses and bits */ #define RO PG_URKR /* access abilities */ #define RW PG_UW ine R0 (-18) #define R1 (-17) #define R2 (-16) #define R3 (-15) #define R4 (-14) #define R5 (-13) #define R6 (-12) #define R7 (-11) #define R8 (-10) #define R9 (-9) #define R10 (-8) #define R11 (-7) #define R12 (-21) #define R13 (-20) #define AP (-21) #define FP (-20) #define SP (-5) #define PS /hL,hL5< /,"sys/h/stat.h 444 0 33 1621 2506431516 6224 /* stat.h 4.2 81/02/19 */ struct stat { dev_t st_dev; ino_t st_ino; unsigned short st_mode; short st_nlink; short st_uid; short st_gid; dev_t st_rdev; off_t st_size; time_t st_atime; time_t st_mtime; time_t st_ctime; }; #define S_IFMT 0170000 /* type of file */ #define S_IFDIR 0040000 /* directory */ #define S_IFCHR 0020000 /* character special */ #define S_IFBLK 0060000 /* block special */ #define S_IFREG 0100000 /* regular */ #define S_IFMPC 0030000 /* multiplexed char special */ #define S_IFMPB 0070000 /* multiplexed block special */ #define S_ISUID 0004000 /* set user id on execution */ #define S_ISGID 0002000 /* set group id on execution */ #define S_ISVTX 0001000 /* save swapped text even after use */ #define S_IREAD 0000400 /* read permission, owner */ #define S_IWRITE 0000200 /* write permission, owner */ #define S_IEXEC 0000100 /* execute/search permission, owner */ pecial */ #define S_IFREG 0100000 /* regular */ #define S_IFMPC 0030000 /* multiplexed char special */ #definsys/h/systm.h 444 0 33 4360 2552367100 6431 /* systm.h 4.17 81/05/05 */ /* * Random set of variables * used by more than one * routine. */ int hz; /* frequency of the clock */ int timezone; /* minutes west from greenwich */ int dstflag; /* daylight savings time in effect? */ char canonb[CANBSIZ]; /* buffer for erase and kill (#@) */ char version[]; /* system version */ int lbolt; /* time of day in 60th not in time */ time_t time; /* time in sec from 1970 */ time_t bootime; /* time at which booted */ int hand; /* current index into coremap used by daemon */ /* * Nblkdev is the number of entries * (rows) in the block switch. It is * set in binit/bio.c by making * a pass over the switch. * Used in bounds checking on major * device numbers. */ int nblkdev; /* * Number of character switch entries. * Set by cinit/prim.c */ int nchrdev; int nswdev; /* number of swap devices */ int mpid; /* generic for unique process id's */ char runin; /* scheduling flag */ char runout; /* scheduling flag */ int runrun; /* scheduling flag */ char kmapwnt; /* kernel map want flag */ char curpri; /* more scheduling */ int maxmem; /* actual max memory per process */ int physmem; /* physical memory on this CPU */ int nswap; /* size of swap space */ int updlock; /* lock for sync */ daddr_t rablock; /* block to be read ahead */ extern int intstack[]; /* stack for interrupts */ dev_t rootdev; /* device of the root */ dev_t dumpdev; /* device to take dumps on */ long dumplo; /* offset into dumpdev */ dev_t swapdev; /* swapping device */ dev_t argdev; /* device for argument lists */ dev_t pipedev; /* pipe device */ extern int icode[]; /* user init code */ extern int szicode; /* its size */ dev_t getmdev(); daddr_t bmap(); caddr_t calloc(); unsigned max(); unsigned min(); int memall(); int uchar(), schar(); int vmemall(); char *wmemall(); swblk_t vtod(); /* * Structure of the system-entry table */ extern struct sysent { int sy_narg; /* total number of arguments */ int (*sy_call)(); /* handler */ } sysent[]; char vmmap[]; /* poor name! */ int umbabeg,umbaend; /* where sensitive vm begins/ends */ int noproc; /* no one is running just now */ extern int catcher[256]; char *panicstr; int wantin; int boothowto; /* reboot flags, from console subsystem */ nsigned min(); int memall(); int uchar(), schar(); int vmemall(); char *wmemall(); swblk_t vtod(); /* * Structure of the system-entry table */ extern struct sysent { int sy_narg; /* total number of arguments */ int (*sy_call)(); /* handler */ } sysent[]; char vmma((sys/h/text.h 444 0 33 2076 2506431517 6243 /* text.h 4.4 81/03/09 */ /* * Text structure. * One allocated per pure * procedure on swap device. * Manipulated by text.c */ #define NXDAD 12 /* param.h:MAXTSIZ / dmap.h:DMTEXT */ struct text { swblk_t x_daddr[NXDAD]; /* disk addresses of DMTEXT-page segments */ swblk_t x_ptdaddr; /* disk address of page table */ size_t x_size; /* size (clicks) */ struct proc *x_caddr; /* ptr to linked proc, if loaded */ struct inode *x_iptr; /* inode of prototype */ short x_rssize; short x_swrss; char x_count; /* reference count */ char x_ccount; /* number of loaded references */ char x_flag; /* traced, written flags */ char x_slptime; short x_poip; /* page out in progress count */ }; #ifdef KERNEL struct text *text, *textNTEXT; int ntext; #endif #define XTRC 01 /* Text may be written, exclusive use */ #define XWRIT 02 /* Text written into, must swap out */ #define XLOAD 04 /* Currently being read from file */ #define XLOCK 010 /* Being swapped in or out */ #define XWANT 020 /* Wanted for swapping */ #define XPAGI 040 /* Page in on demand from inode */ ed references */ char x_flag; /* traced, written flags */ char x_slptime; short x_poip; /* page out in progress count */ }; #ifdef KERNEL struct text *text, *textNTEXT; int ntext; #endif #define XTRC 01 /* Text may be written, exclusive use */ #define XWRIT 02 /* Text written into, must swap out */ #define XLOAD 04 /* Currently being read from file */ #define XLOCK 010 /* Being swapped in or out */ #define XWANT 020 /* Wanted for swapsys/h/timeb.h 444 0 33 250 2506431520 6321 /* timeb.h 4.2 81/02/19 */ /* * Structure returned by ftime system call */ struct timeb { time_t time; unsigned short millitm; short timezone; short dstflag; }; n progress count */ }; #ifdef KERNEL struct text *text, *textNTEXT; int ntext; #endif #define XTRC 01 /* Text may be written, exclusive use */ #define XWRIT 02 /* Text written into, must swap out */ #define XLOAD 04 /* Currently being read from fi/hL,hL5(< /,"sys/h/times.h 444 0 33 376 2506431520 6353 /* times.h 4.2 81/02/19 */ /* * Structure returned by times() */ struct tms { time_t tms_utime; /* user time */ time_t tms_stime; /* system time */ time_t tms_cutime; /* user time, children */ time_t tms_cstime; /* system time, children */ }; #define XTRC 01 /* Text may be written, exclusive use */ #define XWRIT 02 /* Text written into, must swap out */ #define XLOAD 04 /* Currently being read from fi/hL,hL58< /,"sys/h/trap.h 444 0 33 1500 2506431521 6207 /* trap.h 4.6 81/03/03 */ /* * Trap type values */ /* The first three constant values are known to the real world */ #define RESADFLT 0 /* reserved addressing fault */ #define PRIVINFLT 1 /* privileged instruction fault */ #define RESOPFLT 2 /* reserved operand fault */ /* End of known constants */ #define BPTFLT 3 /* bpt instruction fault */ #define XFCFLT 4 /* xfc instruction fault */ #define SYSCALL 5 /* chmk instruction (syscall trap) */ #define ARITHTRAP 6 /* arithmetic trap */ #define ASTFLT 7 /* software level 2 trap (ast deliv) */ #define SEGFLT 8 /* segmentation fault */ #define PROTFLT 9 /* protection fault */ #define TRCTRAP 10 /* trace trap */ #define COMPATFLT 11 /* compatibility mode fault */ #define PAGEFLT 12 /* page fault */ #define TABLEFLT 13 /* page table fault */ efine BPTFLT 3 /* bpt instruction fault */ #define XFCFLT 4 /* xfc instruction fault */ #define SYSCALL 5 /* chmk instruction (syscall trap) */ #define ARITHTRAP 6 /* arithmetic trap */sys/h/tty.h 444 0 33 10207 2662315676 6124 /* tty.h 4.5 81/06/11 */ #ifdef KERNEL #include "../h/ioctl.h" #else #include #endif #include /* * A clist structure is the head * of a linked list queue of characters. * The characters are stored in * blocks containing a link and CBSIZE (param.h) * characters. The routines getc, putc, ... in prim.c * manipulate these structures. */ struct clist { int c_cc; /* character count */ char *c_cf; /* pointer to first char */ char *c_cl; /* pointer to last char */ }; /* * A tty structure is needed for * each UNIX character device that * is used for normal terminal IO. * The routines in tty.c handle the * common code associated with * these structures. The definition * and device dependent code is in * each driver. (cons.c, dh.c, dz.c, kl.c) */ struct tty { union { struct { struct clist T_rawq; struct clist T_canq; } t_t; #define t_rawq t_nu.t_t.T_rawq /* raw characters or partial line */ #define t_canq t_nu.t_t.T_canq /* complete input lines */ struct { struct buf *T_bufp; char *T_cp; int T_inbuf; int T_rec; } t_n; #define t_bufp t_nu.t_n.T_bufp /* buffer allocated to protocol */ #define t_cp t_nu.t_n.T_cp /* pointer into the ripped off buffer */ #define t_inbuf t_nu.t_n.T_inbuf /* number chars in the buffer */ #define t_rec t_nu.t_n.T_rec /* have a complete record */ } t_nu; struct clist t_outq; /* output list to device */ int (*t_oproc)(); /* routine to start output */ int (*t_iproc)(); /* routine to start input */ struct chan *t_chan; /* destination channel */ caddr_t t_linep; /* aux line discipline pointer */ caddr_t t_addr; /* device address */ dev_t t_dev; /* device number */ short t_flags; /* mode, settable by ioctl call */ short t_state; /* internal state, not visible externally */ short t_pgrp; /* process group name */ char t_delct; /* number of delimiters in raw q */ char t_line; /* line discipline */ char t_col; /* printing column of device */ char t_erase; /* erase character */ char t_kill; /* kill character */ char t_char; /* character temporary */ char t_ispeed; /* input speed */ char t_ospeed; /* output speed */ /* begin local */ char t_rocount; /* chars input since a ttwrite() */ char t_rocol; /* t_col when first input this line */ struct ltchars t_lchr; /* local special characters */ short t_local; /* local mode word */ short t_lstate; /* local state bits */ /* end local */ union { struct tchars t_chr; struct clist t_ctlq; } t_un; }; #define tun tp->t_un.t_chr #define tlun tp->t_lchr #define TTIPRI 28 #define TTOPRI 29 #define CTRL(c) ('c'&037) /* default special characters */ #define CERASE '#' #define CEOT CTRL(d) #define CKILL '@' #define CQUIT 034 /* FS, cntl shift L */ #define CINTR 0177 /* DEL */ #define CSTOP CTRL(s) #define CSTART CTRL(q) #define CBRK 0377 /* limits */ #define NSPEEDS 16 #define TTMASK 15 #ifdef KERNEL short tthiwat[NSPEEDS], ttlowat[NSPEEDS]; #define TTHIWAT(tp) tthiwat[(tp)->t_ospeed&TTMASK] #define TTLOWAT(tp) ttlowat[(tp)->t_ospeed&TTMASK] #endif #define TTYHOG 255 /* hardware bits */ #define DONE 0200 #define IENABLE 0100 /* internal state bits */ #define TIMEOUT 01 /* delay timeout in progress */ #define WOPEN 02 /* waiting for open to complete */ #define ISOPEN 04 /* device is open */ #define FLUSH 010 /* outq has been flushed during DMA */ #define CARR_ON 020 /* software copy of carrier-present */ #define BUSY 040 /* output in progress */ #define ASLEEP 0100 /* wakeup when output done */ #define XCLUDE 0200 /* exclusive-use flag against open */ #define TTSTOP 0400 /* output stopped by ctl-s */ #define HUPCLS 01000 /* hang up upon last close */ #define TBLOCK 02000 /* tandem queue blocked */ #define SPEEDS 04000 /* t_ispeed and t_ospeed used by driver */ #define NDQB 010000 #define EXTPROC 020000 /* external processor (kmc) */ #define FSLEEP 040000 /* Wakeup on input framing */ #define BEXT 0100000 /* use (external) system buffers */ /* define partab character types */ #define ORDINARY 0 #define CONTROL 1 #define BACKSPACE 2 #define NEWL((INE 3 #define TAB 4 #define VTAB 5 #define RETURN 6 /* define dmctl actions */ #define DMSET 0 #define DMBIS 1 #define DMBIC 2 m queue blocked */ #define SPEEDS 04000 /* t_ispeed and t_ospeed used by driver */ #define NDQB 010000 #define EXTPROC 020000 /* external processor (kmc) */ #define FSLEEP 040000 /* Wakeup on input framing */ #define BEXT 0100000 /* use (external) system buffers */ /* define partab character types */ #define ORDINARY 0 #define CONTROL 1 #define BACKSPACE 2 #define NEWLsys/h/vmparam.h 444 0 33 6047 2522400415 6713 /* vmparam.h 4.10 81/04/24 */ /* * Machine dependent constants */ #define NPTEPG (NBPG/(sizeof (struct pte))) /* number of ptes per page */ #define USRSTACK (0x80000000-UPAGES*NBPG) /* Start of user stack */ #define P1TOP 0x200000 /* boundary between P0 and P1 regions */ /* * Virtual memory related constants */ #define SLOP 32 #define MAXTSIZ (6*2048-SLOP) /* max text size (clicks) */ #define MAXDSIZ (12*1024-32-SLOP) /* max data size (clicks) */ #define MAXSSIZ (12*1024-32-SLOP) /* max stack size (clicks) */ /* * Sizes of the system and user portions of the system page table. */ /* SYSPTSIZE IS SILLY; IT SHOULD BE COMPUTED AT BOOT TIME */ #define SYSPTSIZE (12*NPTEPG) #define USRPTSIZE (8*NPTEPG) /* * The size of the clock loop. */ #define LOOPPAGES (maxfree - firstfree) /* * The time for a process to be blocked before being very swappable. * This is a number of seconds which the system takes as being a non-trivial * amount of real time. You probably shouldn't change this; * it is used in subtle ways (fractions and multiples of it are, that is, like * half of a ``long time'', almost a long time, etc.) * It is related to human patience and other factors which don't really * change over time. */ #define MAXSLP 20 /* * A swapped in process is given a small amount of core without being bothered * by the page replacement algorithm. Basically this says that if you are * swapped in you deserve some resources. We protect the last SAFERSS * pages against paging and will just swap you out rather than paging you. * Note that each process has at least UPAGES+CLSIZE pages which are not * paged anyways (this is currently 8+2=10 pages or 5k bytes), so this * number just means a swapped in process is given around 25k bytes. * Just for fun: current memory prices are 4600$ a megabyte on VAX (4/22/81), * so we loan each swapped in process memory worth 100$, or just admit * that we don't consider it worthwhile and swap it out to disk which costs * $30/mb or about $0.75. */ #define SAFERSS 32 /* nominal ``small'' resident set size protected against replacement */ /* * DISKRPM is used to estimate the number of paging i/o operations * which one can expect from a single disk controller. */ #define DISKRPM 60 /* * Klustering constants. Klustering is the gathering * of pages together for pagein/pageout, while clustering * is the treatment of hardware page size as though it were * larger than it really is. * * KLMAX gives maximum cluster size in CLSIZE page (cluster-page) * units. Note that KLMAX*CLSIZE must be <= DMMIN in dmap.h. */ #define KLMAX (32/CLSIZE) #define KLSEQL (16/CLSIZE) /* in klust if vadvise(VA_SEQL) */ #define KLIN (8/CLSIZE) /* default data/stack in klust */ #define KLTXT (4/CLSIZE) /* default text in klust */ #define KLOUT (32/CLSIZE) /* * KLSDIST is the advance or retard of the fifo reclaim for sequential * processes data space. */ #define KLSDIST 3 /* klusters advance/retard for seq. fifo */ #ifdef KERNEL int klseql; int klsdist; int klin; int kltxt; int klout; #endif SIZE must be <= DMMIN in dmap.h. */ #define KLMAX (32/CLSIZE) #define KLSEQL (16/CLSIZE) /* in klust if vadvise(VA_SEQL) */ #define KLIN (8/CLSIZE) /* default data/stack in klust */ #define KLTXT (4/CLSIZE) /* default text in klust */ #define KLOUT (32/CLSIZE) /* * KLSDIST is the advance or retard of the fifo reclaim for sequential * processes data space. */ #define KLSDIST 3 /* klusters advance/retard for seq. fifo */ #ifdef KERNEL int klseql; int klsdist; sys/h/clist.h 444 0 33 370 2506431522 6344 /* clist.h 4.4 81/03/09 */ /* * Raw structures for the character list routines. */ struct cblock { struct cblock *c_next; char c_info[CBSIZE]; }; #ifdef KERNEL struct cblock *cfree; int nclist; struct cblock *cfreelist; int cfreecount; #endif ) /* default text in klust */ #define KLOUT (32/CLSIZE) /* * KLSDIST is the advance or retard of the fifo reclaim for sequential * processes data space. */ #define KLS/hL,hL5x< /,"sys/h/vmmeter.h 444 0 33 5666 2522400415 6735 /* vmmeter.h 4.6 4/24/81 */ /* * Virtual memory related instrumentation */ struct vmmeter { #define v_first v_swtch unsigned v_swtch; /* context switches */ unsigned v_trap; /* calls to trap */ unsigned v_syscall; /* calls to syscall() */ unsigned v_intr; /* device interrupts */ unsigned v_pdma; /* pseudo-dma interrupts */ unsigned v_pswpin; /* pages swapped in */ unsigned v_pswpout; /* pages swapped out */ unsigned v_pgin; /* pageins */ unsigned v_pgout; /* pageouts */ unsigned v_pgpgin; /* pages paged in */ unsigned v_pgpgout; /* pages paged out */ unsigned v_intrans; /* intransit blocking page faults */ unsigned v_pgrec; /* total page reclaims */ unsigned v_xsfrec; /* found in free list rather than on swapdev */ unsigned v_xifrec; /* found in free list rather than in filsys */ unsigned v_exfod; /* pages filled on demand from executables */ unsigned v_zfod; /* pages zero filled on demand */ unsigned v_vrfod; /* fills of pages mapped by vread() */ unsigned v_nexfod; /* number of exfod's created */ unsigned v_nzfod; /* number of zfod's created */ unsigned v_nvrfod; /* number of vrfod's created */ unsigned v_pgfrec; /* page reclaims from free list */ unsigned v_faults; /* total faults taken */ unsigned v_scan; /* scans in page out daemon */ unsigned v_rev; /* revolutions of the hand */ unsigned v_seqfree; /* pages taken from sequential programs */ unsigned v_dfree; /* pages freed by daemon */ #define v_last v_dfree unsigned v_swpin; /* swapins */ unsigned v_swpout; /* swapouts */ }; #ifdef KERNEL struct vmmeter cnt, rate, sum; #endif /* systemwide totals computed every five seconds */ struct vmtotal { short t_rq; /* length of the run queue */ short t_dw; /* jobs in ``disk wait'' (neg priority) */ short t_pw; /* jobs in page wait */ short t_sl; /* jobs sleeping in core */ short t_sw; /* swapped out runnable/short block jobs */ int t_vm; /* total virtual memory */ int t_avm; /* active virtual memory */ short t_rm; /* total real memory in use */ short t_arm; /* active real memory */ int t_vmtxt; /* virtual memory used by text */ int t_avmtxt; /* active virtual memory used by text */ short t_rmtxt; /* real memory used by text */ short t_armtxt; /* active real memory used by text */ short t_free; /* free memory pages */ }; #ifdef KERNEL struct vmtotal total; #endif /* * Optional instrumentation. */ #ifdef PGINPROF #define NDMON 128 #define NSMON 128 #define DRES 20 #define SRES 5 #define PMONMIN 20 #define PRES 50 #define NPMON 64 #define RMONMIN 130 #define RRES 5 #define NRMON 64 /* data and stack size distribution counters */ unsigned int dmon[NDMON+1]; unsigned int smon[NSMON+1]; /* page in time distribution counters */ unsigned int pmon[NPMON+2]; /* reclaim time distribution counters */ unsigned int rmon[NRMON+2]; int pmonmin; int pres; int rmonmin; int rres; unsigned rectime; /* accumulator for reclaim times */ unsigned pgintime; /* accumulator for page in times */ #endif ine PMONMIN 20 #define PRES 50 #define NPMON 64 #define RMONMIN 130 #defisys/h/vm.h 444 0 33 573 2662315472 5665 /* vm.h 4.3 81/04/23 */ /* * #include "../h/vm.h" * or #include in a user program * is a quick way to include all the vm header files. */ #ifdef KERNEL #include "../h/vmparam.h" #include "../h/vmmac.h" #include "../h/vmmeter.h" #include "../h/vmsystm.h" #else #include #include #include #include #endif gned pgintime; /* accumulator for page i/hL,hL5< /,"((sys/h/pk.p 644 0 33 3701 2522401226 5667 /* pk.p 4.1 12/17/80 */ /* * kernel level */ #ifdef KERNEL #define PADDR ((struct pack *)tp->t_linep) #define TURNOFF pkturnoff(tp) #ifdef VMUNIX #define UCOUNT u.u_count #else #define UCOUNT uio->u_count #endif #define S tp #define P pk->p_ttyp #define SDEF struct tty *tp #define FS , tp #define SIGNAL psignal(u.u_procp, SIGPIPE) #define TERROR pk->p_istate == R_ERROR #define SETERROR u.u_error = EIO #define OBUSY tp->t_state&BUSY #define ODEAD ((tp->t_state&CARR_ON)==0) char *getepack(); #define GETEPACK getepack(pk->p_bits) #define FREEPACK(a,b) freepack(a, b) #define q1 tp->t_rawq #define q2 tp->t_canq #define q3 tp->t_outq #define LOCK s = spl6() #define UNLOCK splx(s) #define DSYSTEM struct tty *p_ttyp #define ISYSTEM tp = pk->p_ttyp #define SLEEP(a, b) sleep((caddr_t)a, b) #define SLEEPNO (tp->t_chan!=NULL) #define WAKEUP(a) wakeup((caddr_t)a) #define PKGETPKT(p) #define DTOM(a) dtom(a) #include "../h/param.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/pk.h" #include "../h/tty.h" #include "../h/buf.h" #include "../h/proc.h" #include "../h/local.h" #include "../h/file.h" #ifdef PDP #include "../h/var.h" #endif #endif /* * user level */ #ifdef USER #define SLEEP(a, b) #define SIGNAL #define WAKEUP(a) #define DSYSTEM int p_ifn, p_ofn #define ISYSTEM #define GETEPACK malloc(pk->p_xsize) #define FREEPACK(a, b) free(a) #define OBUSY 0 #define PKGETPKT(p) pkgetpack(p); #define DTOM(a) 1; #define S ipk, ibuf, icount #define SDEF int icount; char *ibuf; struct pack *ipk #define UCOUNT icount #define IOMOVE(p, c, f) pkmove(p, ibuf, c, f) ; ibuf += c; UCOUNT -= c #define PADDR ipk #define TURNOFF #define LOCK #define UNLOCK #define SETERROR #define GENERROR(p, s) #define PACKSIZE 64 #define WINDOWS 3 #define PKDEBUG(l, f, s) { extern Debug; if (Debug >= l) fprintf(stderr, f, s);} #define PKASSERT(e, f, v) if (!(e)) {\ fprintf(stderr, "AERROR - (%s) ", "e");\ fprintf(stderr, f, v);\ pkfail();}; #endif pk, ibuf, icount #define SDEF int icount; char *ibuf; struct psys/h/vmsysent.h 444 0 33 774 2522400415 7121 /* vmsysent.h 4.4 81/03/03 */ /* * Externals for functions defined in vmsys.c. */ int nosys(); int nullsys(); int vfork(); /* later, just fork? */ int vread(); /* deprecated */ int vwrite(); /* deprecated */ int vadvise(); /* later, segadvise */ int vhangup(); /* should just do in exit() */ int vlimit(); int vswapon(); int vtimes(); #ifdef TRACE int vtrace(); #endif int segalloc(); /* not in yet */ int segfree(); /* not in yet */ int segsync(); /* not in yet */ int resuba(); int futz(); "sys/h/vtimes.h 444 0 33 1516 2506431525 6563 /* vtimes.h 4.2 81/02/19 */ /* * Structure returned by vtimes() and in vwait(). * In vtimes() two of these are returned, one for the process itself * and one for all its children. In vwait() these are combined * by adding componentwise (except for maxrss, which is max'ed). */ struct vtimes { int vm_utime; /* user time (60'ths) */ int vm_stime; /* system time (60'ths) */ /* divide next two by utime+stime to get averages */ unsigned vm_idsrss; /* integral of d+s rss */ unsigned vm_ixrss; /* integral of text rss */ int vm_maxrss; /* maximum rss */ int vm_majflt; /* major page faults */ int vm_minflt; /* minor page faults */ int vm_nswap; /* number of swaps */ int vm_inblk; /* block reads */ int vm_oublk; /* block writes */ }; #ifdef KERNEL struct vtimes zvms; /* an empty (componentwise 0) structure */ #endif s) */ int vm_stime; /* system time (60'ths) */ /* divide next two by utime+stime to get averages */ unsigned vm_idsrss; /* integral of d+s rss */ unsigned vm_ixrss; /* intsys/h/dk.h 444 0 33 575 2506431525 5636 /* dk.h 4.2 81/02/19 */ /* * Instrumentation */ #define CPUSTATES 4 #define CP_USER 0 #define CP_NICE 1 #define CP_SYS 2 #define CP_IDLE 3 #define DK_NDRIVE 4 #ifdef KERNEL long cp_time[CPUSTATES]; int dk_busy; long dk_time[DK_NDRIVE]; long dk_seek[DK_NDRIVE]; long dk_xfer[DK_NDRIVE]; long dk_wds[DK_NDRIVE]; float dk_mspw[DK_NDRIVE]; long tk_nin; long tk_nout; #endif / /* divide next two by utime+stime to/hL,hL5؉< /,"sys/h/vlimit.h 444 0 33 757 2516240237 6545 /* vlimit.h 4.3 81/04/13 */ /* * Limits for u.u_limit[i], per process, inherited. */ #define LIM_NORAISE 0 /* if <> 0, can't raise limits */ #define LIM_CPU 1 /* max secs cpu time */ #define LIM_FSIZE 2 /* max size of file created */ #define LIM_DATA 3 /* max growth of data space */ #define LIM_STACK 4 /* max growth of stack */ #define LIM_CORE 5 /* max size of ``core'' file */ #define LIM_MAXRSS 6 /* max desired data+stack core usage */ #define NLIMITS 6 #define INFINITY 0x7fffffff ,"sys/h/ubareg.h 444 0 33 10563 2512563725 6550 /* ubareg.h 4.22 81/04/03 */ /* * VAX UNIBUS adapter registers */ #ifndef LOCORE /* * UBA hardware registers */ struct uba_regs { int uba_cnfgr; /* configuration register */ int uba_cr; /* control register */ int uba_sr; /* status register */ int uba_dcr; /* diagnostic control register */ int uba_fmer; /* failed map entry register */ int uba_fubar; /* failed UNIBUS address register */ int pad1[2]; int uba_brsvr[4]; int uba_brrvr[4]; /* receive vector registers */ int uba_dpr[16]; /* buffered data path register */ int pad2[480]; struct pte uba_map[496]; /* unibus map register */ int pad3[16]; /* no maps for device address space */ }; #endif #if VAX780 /* uba_cnfgr */ #define UBACNFGR_UBINIT 0x00040000 /* unibus init asserted */ #define UBACNFGR_UBPDN 0x00020000 /* unibus power down */ #define UBACNFGR_UBIC 0x00010000 /* unibus init complete */ /* uba_cr */ #define UBACR_MRD16 0x40000000 /* map reg disable bit 4 */ #define UBACR_MRD8 0x20000000 /* map reg disable bit 3 */ #define UBACR_MRD4 0x10000000 /* map reg disable bit 2 */ #define UBACR_MRD2 0x08000000 /* map reg disable bit 1 */ #define UBACR_MRD1 0x04000000 /* map reg disable bit 0 */ #define UBACR_IFS 0x00000040 /* interrupt field switch */ #define UBACR_BRIE 0x00000020 /* BR interrupt enable */ #define UBACR_USEFIE 0x00000010 /* UNIBUS to SBI error field IE */ #define UBACR_SUEFIE 0x00000008 /* SBI to UNIBUS error field IE */ #define UBACR_CNFIE 0x00000004 /* configuration IE */ #define UBACR_UPF 0x00000002 /* UNIBUS power fail */ #define UBACR_ADINIT 0x00000001 /* adapter init */ /* uba_sr */ #define UBASR_BR7FULL 0x08000000 /* BR7 receive vector reg full */ #define UBASR_BR6FULL 0x04000000 /* BR6 receive vector reg full */ #define UBASR_BR5FULL 0x02000000 /* BR5 receive vector reg full */ #define UBASR_BR4FULL 0x01000000 /* BR4 receive vector reg full */ #define UBASR_RDTO 0x00000400 /* UNIBUS to SBI read data timeout */ #define UBASR_RDS 0x00000200 /* read data substitute */ #define UBASR_CRD 0x00000100 /* corrected read data */ #define UBASR_CXTER 0x00000080 /* command transmit error */ #define UBASR_CXTMO 0x00000040 /* command transmit timeout */ #define UBASR_DPPE 0x00000020 /* data path parity error */ #define UBASR_IVMR 0x00000010 /* invalid map register */ #define UBASR_MRPF 0x00000008 /* map register parity failure */ #define UBASR_LEB 0x00000004 /* lost error */ #define UBASR_UBSTO 0x00000002 /* UNIBUS select timeout */ #define UBASR_UBSSYNTO 0x00000001 /* UNIBUS slave sync timeout */ #define UBASR_BITS \ "\20\13R((DTO\12RDS\11CRD\10CXTER\7CXTMO\6DPPE\5IVMR\4MRPF\3LEB\2UBSTO\1UBSSYNTO" /* uba_brrvr[] */ #define UBABRRVR_AIRI 0x80000000 /* adapter interrupt request */ #define UBABRRVR_DIV 0x0000ffff /* device interrupt vector field */ #endif VAX780 /* uba_dpr */ #if VAX780 #define UBADPR_BNE 0x80000000 /* buffer not empty - purge */ #define UBADPR_BTE 0x40000000 /* buffer transfer error */ #define UBADPR_DPF 0x20000000 /* DP function (RO) */ #define UBADPR_BS 0x007f0000 /* buffer state field */ #define UBADPR_BUBA 0x0000ffff /* buffered UNIBUS address */ #endif VAX780 #if VAX750 #define UBADPR_ERROR 0x80000000 /* error occurred */ #define UBADPR_NXM 0x40000000 /* nxm from memory */ #define UBADPR_UCE 0x20000000 /* uncorrectable error */ #define UBADPR_PURGE 0x00000001 /* purge bdp */ #endif VAX750 /* uba_mr[] */ #define UBAMR_MRV 0x80000000 /* map register valid */ #define UBAMR_BO 0x02000000 /* byte offset bit */ #define UBAMR_DPDB 0x01e00000 /* data path designator field */ #define UBAMR_SBIPFN 0x000fffff /* SBI page address field */ #define UBAMR_DPSHIFT 21 /* shift to data path designator */ /* * Number of UNIBUS map registers. We can't use the last 8k of UNIBUS * address space for i/o transfers since it is used by the devices, * hence have slightly less than 256K of UNIBUS address space. */ #define NUBMREG 496 /* * Number of unibus buffered data paths and possible uba's per cpu type. */ #define NBDP780 15 #define NBDP750 3 #define NBDP7ZZ 0 #define MAXNBDP 15 #define NUBA780 4 #define NUBA750 1 #define NUBA7ZZ 1 #if VAX780 #define MAXNUBA 4 #else #define MAXNUBA 1 #endif /* * Formulas for locations of the last 8k of UNIBUS memory * for each possible uba. */ #if VAX7ZZ #define UMEM7ZZ ((u_short *)(0xffe000)) #endif #if VAX750 #define UMEM750(i) ((u_short *)(0xffe000-(i)*0x40000)) #endif #if VAX780 #define UMEM780(i) ((u_short *)(0x2013e000+(i)*0x40000)) #endif uba's per cpu type. */ #define NBDP780 15 #define NBDP750 3 #define NBDP7ZZ 0 #define MAXNBDP 15 #define NUBA780 4 #define NUBA750 1 #definsys/h/dkbad.h 444 0 33 2475 2527134574 6335 /* dkbad.h 4.3 81/05/10 */ /* * Definitions needed to perform bad sector * revectoring ala DEC STD 144. * * The bad sector information is located in the * first 5 even numbered sectors of the last * track of the disk pack. There are five * identical copies of the information, described * by the dkbad structure. * * Replacement sectors are allocated starting with * the first sector before the bad sector information * and working backwards towards the beginning of * the disk. A maximum of 126 bad sectors are supported. * The position of the bad sector in the bad sector table * determines which replacement sector it corresponds to. * * The bad sector information and replacement sectors * are conventionally only accessible through the * 'c' file system partition of the disk. If that * partition is used for a file system, the user is * responsible for making sure that it does not overlap * the bad sector information or any replacement sector.s */ struct dkbad { long bt_csn; /* cartridge serial number */ u_short bt_mbz; /* unused; should be 0 */ u_short bt_flag; /* -1 => alignment cartridge */ struct bt_bad { u_short bt_cyl; /* cylinder number of bad sector */ u_short bt_trksec; /* track and sector number */ } bt_bad[126]; }; #define ECC 0 #define SSE 1 #define BSE 2 #define CONT 3 used for a file system, the user is * responsible for making sure that it does not overlap * the bad sector information or any replacement sector.s */ struct dkbad { long bt_csn; /* cartrisys/h/mtreg.h 444 0 33 11406 2632476676 6431 /* mtreg.h 4.1 81/11/11 */ struct mtdevice { int mtcs; /* control status register */ int mter; /* error register */ int mtca; /* command address, rec cnt, skp cnt reg */ int mtmr1; /* maintenance register */ int mtas; /* attention summary register */ int mtbc; /* byte count register */ int mtdt; /* drive type register */ int mtds; /* drive status register */ int mtsn; /* serial number register */ int mtmr2; /* maintenance register */ int mtmr3; /* maintenance register */ int mtner; /* non-data transfer error register */ int mtncs[4]; /* non-data transfer command registers */ int mtia; /* internal address */ int mtid; /* internal data */ }; /* mtcs */ #define MT_GO 000001 /* go bit */ #define MT_NOOP 000002 /* no operation */ #define MT_UNLOAD 000004 /* unload tape */ #define MT_REW 000006 /* rewind */ #define MT_SENSE 000010 /* sense */ #define MT_DSE 000012 /* data security erase */ #define MT_WTMPE 000014 /* write phase encoded tape mark */ #define MT_WTM MT_WTMPE /* generic write tape mark */ #define MT_WTMGCR 000016 /* write GCR tape mark */ #define MT_SFORW 000020 /* space forward record */ #define MT_SREV 000022 /* space reverse record */ #define MT_SFORWF 000024 /* space forward file */ #define MT_SREVF 000026 /* space reverse file */ #define MT_SFORWE 000030 /* space forward either */ #define MT_SREVE 000032 /* space reverse either */ #define MT_ERGPE 000034 /* erase tape, set PE */ #define MT_ERASE MT_ERGPE /* generic erase tape */ #define MT_ERGGCR 000036 /* erase tape, set GCR */ #define MT_CLSPE 000040 /* close file PE */ #define MT_CLS MT_CLSPE /* generic close file */ #define MT_CLSGCR 000042 /* close file GCR */ #define MT_SLEOT 000044 /* space to logical EOT */ #define MT_SFLEOT 000046 /* space forward file, stop on LEOT */ #define MT_WCHFWD 000050 /* write check forward */ #define MT_WCHREV 000056 /* write check reverse */ #define MT_WRITEPE 000060 /* write phase encoded */ #define MT_WRITE MT_WRITEPE /* generic write */ #define MT_WRITEGCR 000062 /* write group coded */ #define MT_READ 000070 /* read forward */ #define MT_EXSNS 000072 /* read extended sense error log */ #define MT_READREV 000076 /* read reverse */ #define MT_GCR 000002 /* make generic ops GCR ops */ /* mtds */ #define MTDS_RDY 0100000 /* tape ready */ #define MTDS_PRES 0040000 /* tape unit has power */ #define MTDS_ONL 0020000 /* online */ #define MTDS_REW 0010000 /* tape rewinding */ #define MTDS_PE 0004000 /* tape set for phase encoded */ #define MTDS_BOT 0002000 /* tape at BOT */ #define MTDS_EOT 0001000 /* tape at EOT */ #define MTDS_FPT 0000400 /* write protected */ #define MTDS_AVAIL 0000200 /* unit available */ #define MTDS_SHR 0000100 /* unit is shared */ #define MTDS_MAINT 0000040 /* maintenance mode */ #define MTDS_DSE 0000020 /* DSE in progress */ #define MTDS_BITS \ "\10\20RDY\17PRES\16ONL\15REW\14PE\13BOT\12EOT\11FPT\10AVAIL\ \7SHR\6MAINT\5DSE" /* mter */ #define MTER_INTCODE 0377 /* mask for interrupt code */ /* interrupt codes */ #define MTER_DONE 001 /* operation complete */ #define MTER_TM 002 /* unexpected tape mark */ #define MTER_BOT 003 /* unexpected BOT detected */ #define MTER_EOT 004 /* tape positioned beyond EOT */ #define MTER_LEOT 005 /* unexpected LEOT detected */ #define MTER_NOOP 006 /* no-op completed */ #define MTER_RWDING 007 /* rewinding */ #define MTER_FPT 010 /* write protect error */ #define MTER_NOTRDY 011 /* not ready */ #define MTER_NOTAVL 012 /* not available */ #define MTER_OFFLINE 013 /* offline */ #define MTER_NONEX 014 /* unit does not exist */ #define MTER_NOTCAP 015 /* not capable */ #define MTER_ONLINE 017 /* tape came online */ #define MTER_LONGREC 020 /* long tape record */ #define MTER_SHRTREC 021 /* short tape record */ #define MTER_RETRY 022 /* retry */ #define MTER_RDOPP 023 /* read opposite */ #define MTER_UNREAD 024 /* unreadable */ #define MTER_ERROR 025 /* error */ #define MTER_EOTERR 026 /* EOT error */ #define MTER_BADTAPE 027 /* tape position lost */ #define MTER_TMFLTA 030 /* TM fault A */ #define MTER_TUFLTA 031 /* TU fault A */ #define MTER_TMFLTB 032 /* TM fault B */ #define MTER_MBFLT 034 /* Massbus fault */ #define MTER_KEYFAIL 077 /* keypad entry error */ /* mtdt */ #define MTDT_NSA 0100000 /* not sector addressed; always 1 */ #define MTDT_TAP 0040000 /* tape; always 1 */ #define MTDT_MOH 0020000 /* moving head; always 0 */ #define MTDT_7CH 0010000 /* 7 channel; always 0 */ #define MTDT_DRQ 0004000 /* drive request required */ #define MTDT_SPR 0002000 /* slave present; always 1 ??? */ /* bit 9 is spare */ /* bits 8-0 are formatter/transport type */ /* mtid */ #define MTID_RDY 0100000 /* controller ready */ #define MTID_CLR 0040000 /* controller clear */ #define b_repcnt b_bcount #define b_command b_resid d; always 1 */ #define MTDT_TAP 0040000 /* tape; always 1 */ #define MTDT_MOH 0020000 /* moving head; always 0 */ #define MTDT_7CH 0010000 /* 7 channel; always 0 */ #define MTDT_DRQ 0004000 /* drive request required */ #define MTDT_SPR 0002000 /sys/h/vmmac.h 444 0 33 6145 2522400414 6351 ((/* vmmac.h 4.3 81/04/23 */ /* * Virtual memory related conversion macros */ /* Core clicks to number of pages of page tables needed to map that much */ #define ctopt(x) (((x)+NPTEPG-1)/NPTEPG) /* Virtual page numbers to text|data|stack segment page numbers and back */ #define vtotp(p, v) ((int)(v)) #define vtodp(p, v) ((int)((v) - (p)->p_tsize)) #define vtosp(p, v) ((int)(btop(USRSTACK) - 1 - (v))) #define tptov(p, i) ((unsigned)(i)) #define dptov(p, i) ((unsigned)((p)->p_tsize + (i))) #define sptov(p, i) ((unsigned)(btop(USRSTACK) - 1 - (i))) /* Tell whether virtual page numbers are in text|data|stack segment */ #define isassv(p, v) ((v) & P1TOP) #define isatsv(p, v) ((v) < (p)->p_tsize) #define isadsv(p, v) ((v) >= (p)->p_tsize && !isassv(p, v)) /* Tell whether pte's are text|data|stack */ #define isaspte(p, pte) ((pte) > sptopte(p, (p)->p_ssize)) #define isatpte(p, pte) ((pte) < dptopte(p, 0)) #define isadpte(p, pte) (!isaspte(p, pte) && !isatpte(p, pte)) /* Text|data|stack pte's to segment page numbers and back */ #define ptetotp(p, pte) ((pte) - (p)->p_p0br) #define ptetodp(p, pte) ((pte) - ((p)->p_p0br + (p)->p_tsize)) #define ptetosp(p, pte) \ (((p)->p_p0br + (p)->p_szpt*NPTEPG - UPAGES - 1) - (pte)) #define tptopte(p, i) ((p)->p_p0br + (i)) #define dptopte(p, i) ((p)->p_p0br + (p)->p_tsize + (i)) #define sptopte(p, i) \ (((p)->p_p0br + (p)->p_szpt*NPTEPG - UPAGES - 1) - (i)) /* Bytes to pages without rounding, and back */ #define btop(x) (((unsigned)(x)) >> PGSHIFT) #define ptob(x) ((caddr_t)((x) << PGSHIFT)) /* Turn virtual addresses into kernel map indices */ #define kmxtob(a) (usrpt + (a) * NPTEPG) #define btokmx(b) (((b) - usrpt) / NPTEPG) /* User area address and pcb bases */ #define uaddr(p) (&((p)->p_p0br[(p)->p_szpt * NPTEPG - UPAGES])) #define pcbb(p) ((p)->p_addr[0].pg_pfnum) /* Average new into old with aging factor time */ #define ave(smooth, cnt, time) \ smooth = ((time - 1) * (smooth) + (cnt)) / (time) /* * Page clustering macros. * * dirtycl(pte) is the page cluster dirty? * anycl(pte,fld) does any pte in the cluster has fld set? * zapcl(pte,fld) = val set all fields fld in the cluster to val * distcl(pte) distribute high bits to cluster; note that * distcl copies everything but pg_pfnum, * INCLUDING pg_m!!! * * In all cases, pte must be the low pte in the cluster, even if * the segment grows backwards (e.g. the stack). */ #define H(pte) ((struct hpte *)(pte)) #if CLSIZE==1 #define dirtycl(pte) dirty(pte) #define anycl(pte,fld) ((pte)->fld) #define zapcl(pte,fld) (pte)->fld #define distcl(pte) #endif #if CLSIZE==2 #define dirtycl(pte) (dirty(pte) || dirty((pte)+1)) #define anycl(pte,fld) ((pte)->fld || (((pte)+1)->fld)) #define zapcl(pte,fld) (pte)[1].fld = (pte)[0].fld #endif #if CLSIZE==4 #define dirtycl(pte) \ (dirty(pte) || dirty((pte)+1) || dirty((pte)+2) || dirty((pte)+3)) #define anycl(pte,fld) \ ((pte)->fld || (((pte)+1)->fld) || (((pte)+2)->fld) || (((pte)+3)->fld)) #define zapcl(pte,fld) \ (pte)[3].fld = (pte)[2].fld = (pte)[1].fld = (pte)[0].fld #endif #ifndef distcl #define distcl(pte) zapcl(H(pte),pg_high) #endif rty(pte) || dirty((pte)+1)) #define anycl(pte,fld) ((pte)->fld || (((pte)+1)->fld)) #define zapcl(pte,fld) (pte)[1].fld = (pte)[0].fld #endif #if CLSIZE==4 #define dirtycl(pte) \ (dirty(pte) || dirty((pte)+1) || dirty((pte)+2) || dirty((pte)+3)) #define anycl(pte,fld) \ ((pte)->fld || (((pte)+1)->fld) || (((pte)+2)->fld) || (((pte)+3)->fld)) #define zapcl(pte,fld) \ (pte)[3].fld = (pte)[2].fld =sys/h/trace.h 444 0 33 4440 2624052065 6350 /* trace.h 4.8 81/07/25 */ /* * File system buffer tracing points; all trace */ #define TR_BREADHIT 0 /* buffer read found in cache */ #define TR_BREADMISS 1 /* buffer read not in cache */ #define TR_BWRITE 2 /* buffer written */ #define TR_BREADHITRA 3 /* buffer read-ahead found in cache */ #define TR_BREADMISSRA 4 /* buffer read-ahead not in cache */ #define TR_XFODMISS 5 /* exe fod read */ #define TR_XFODHIT 6 /* exe fod read */ #define TR_BRELSE 7 /* brelse */ /* * Memory allocator trace points; all trace the amount of memory involved */ #define TR_MALL 10 /* memory allocated */ /* * Paging trace points: all are */ #define TR_INTRANS 20 /* page intransit block */ #define TR_EINTRANS 21 /* page intransit wait done */ #define TR_FRECLAIM 22 /* reclaim from free list */ #define TR_RECLAIM 23 /* reclaim from loop */ #define TR_XSFREC 24 /* reclaim from free list instead of drum */ #define TR_XIFREC 25 /* reclaim from free list instead of fsys */ #define TR_WAITMEM 26 /* wait for memory in pagein */ #define TR_EWAITMEM 27 /* end memory wait in pagein */ #define TR_ZFOD 28 /* zfod page fault */ #define TR_EXFOD 29 /* exec fod page fault */ #define TR_VRFOD 30 /* vread fod page fault */ #define TR_CACHEFOD 31 /* fod in file system cache */ #define TR_SWAPIN 32 /* drum page fault */ #define TR_PGINDONE 33 /* page in done */ #define TR_SWAPIO 34 /* swap i/o request arrives */ /* * System call trace points. */ #define TR_VADVISE 40 /* vadvise occurred with */ /* * Miscellaneous */ #define TR_STAMP 50 /* user said vtrace(VTR_STAMP, value); */ /* * This defines the size of the trace flags array. */ #define TR_NFLAGS 100 /* generous */ #define TRCSIZ 4096 /* * Specifications of the vtrace() system call, which takes one argument. */ #define VTRACE 64+51 #define VTR_DISABLE 0 /* set a trace flag to 0 */ #define VTR_ENABLE 1 /* set a trace flag to 1 */ #define VTR_VALUE 2 /* return value of a trace flag */ #define VTR_UALARM 3 /* set alarm to go off (sig 16) */ /* in specified number of hz */ #define VTR_STAMP 4 /* user specified stamp */ #ifdef KERNEL #ifdef TRACE char traceflags[TR_NFLAGS]; struct proc *traceproc; int tracebuf[TRCSIZ]; unsigned tracex; int tracewhich; #define trace(a,b,c) if (traceflags[a]) trace1(a,b,c) #endif #endif CE 64+51 #define VTR_DISABLE 0 /* set a trace flag to 0 */ #define VTR_ENABLE 1 /* set a trace flag to 1 */ #define VTR_VALUE 2 /* return value of a trace flag */ #define VTR_UALARM 3 /* set alarm to go off (sig 16) */sys/h/mbareg.h 444 0 33 7527 2526706052 6523 /* mbareg.h 4.15 81/05/03 */ /* * VAX MASSBUS adapter registers */ struct mba_regs { int mba_csr; /* configuration register */ int mba_cr; /* control register */ int mba_sr; /* status register */ int mba_var; /* virtual address register */ int mba_bcr; /* byte count register */ int mba_dr; int mba_pad1[250]; struct mba_drv { /* per drive registers */ int mbd_cs1; /* control status */ int mbd_ds; /* drive status */ int mbd_er1; /* error register */ int mbd_mr1; /* maintenance register */ int mbd_as; /* attention status */ int mbd_da; /* desired address (disks) */ #define mbd_fc mbd_da /* frame count (tapes) */ int mbd_dt; /* drive type */ int mbd_la; /* look ahead (disks) */ #define mbd_ck mbd_la /* ??? (tapes) */ int mbd_sn; /* serial number */ int mbd_of; /* ??? */ #define mbd_tc mbd_of /* ??? */ int mbd_fill[22]; } mba_drv[8]; struct pte mba_map[256]; /* io space virtual map */ int mba_pad2[256*5]; /* to size of a nexus */ }; /* * Bits in mba_cr */ #define MBCR_INIT 0x1 /* init mba */ #define MBCR_IE 0x4 /* enable mba interrupts */ /* * Bits in mba_sr */ #define MBSR_DTBUSY 0x80000000 /* data transfer busy */ #define MBSR_NRCONF 0x40000000 /* no response confirmation */ #define MBSR_CRD 0x20000000 /* corrected read data */ #define MBSR_CBHUNG 0x00800000 /* control bus hung */ #define MBSR_PGE 0x00080000 /* programming error */ #define MBSR_NED 0x00040000 /* non-existant drive */ #define MBSR_MCPE 0x00020000 /* massbus control parity error */ #define MBSR_ATTN 0x00010000 /* attention from massbus */ #define MBSR_SPE 0x00004000 /* silo parity error */ #define MBSR_DTCMP 0x00002000 /* data transfer completed */ #define MBSR_DTABT 0x00001000 /* data transfer aborted */ #define MBSR_DLT 0x00000800 /* data late */ #define MBSR_WCKUP 0x00000400 /* write check upper */ #define MBSR_WCKLWR 0x00000200 /* write check lower */ #define MBSR_MXF 0x00000100 /* miss transfer error */ #define MBSR_MBEXC 0x00000080 /* massbus exception */ #define MBSR_MDPE 0x00000040 /* massbus data parity error */ #define MBSR_MAPPE 0x00000020 /* page frame map parity error */ #define MBSR_INVMAP 0x00000010 /* invalid map */ #define MBSR_ERRCONF 0x00000008 /* error confirmation */ #define MBSR_RDS 0x00000004 /* read data substitute */ #define MBSR_ISTIMO 0x00000002 /* interface sequence timeout */ #define MBSR_RDTIMO 0x00000001 /* read data timeout */ #define MBSR_BITS \ "\20\40DTBUSY\37NRCONF\36CRD\30CBHUNG\24PGE\23NED\22MCPE\21ATTN\ \17SPE\16DTCMP\15DTABT\14DLT\13WCKUP\12WCKLWR\11MXF\10MBEXC\7MDPE\ \6MAPPE\5INVMAP\4ERRCONF\3RDS\2ISTIMO\1RDTIMO" #define MBSR_HARD (MBSR_PGE|MBSR_ERRCONF|MBSR_ISTIMO|MBSR_RDTIMO) #define MBSR_EBITS (~(MBSR_DTBUSY|MBSR_CRD|MBSR_ATTN|MBSR_DTCMP)) #ifdef KERNEL extern char mbsr_bits[]; #endif /* * Commands for mbd_cs1 */ #define MB_WCOM 0x30 #define MB_RCOM 0x38 #define MB_GO 0x1 /* * Bits in mbd_ds. */ #define MBDS_ERR 0x00004000 /* error in drive */ #define MBDS_MOL 0x00001000 /* medium on line */ #define MBDS_DPR 0x00000100 /((* drive present */ #define MBDS_DRY 0x00000080 /* drive ready */ #define MBDS_DREADY (MBDS_MOL|MBDS_DPR|MBDS_DRY) /* * Bits in mbd_dt */ #define MBDT_NSA 0x8000 /* not sector addressible */ #define MBDT_TAP 0x4000 /* is a tape */ #define MBDT_MOH 0x2000 /* moving head */ #define MBDT_7CH 0x1000 /* 7 channel */ #define MBDT_DRQ 0x800 /* drive request required */ #define MBDT_SPR 0x400 /* slave present */ #define MBDT_TYPE 0x1ff #define MBDT_MASK (MBDT_NSA|MBDT_TAP|MBDT_TYPE) /* type codes for disk drives */ #define MBDT_RP04 020 #define MBDT_RP05 021 #define MBDT_RP06 022 #define MBDT_RP07 042 #define MBDT_RM03 024 #define MBDT_RM05 027 #define MBDT_RM80 026 /* type codes for tape drives */ #define MBDT_TM03 050 #define MBDT_TE16 051 #define MBDT_TU45 052 #define MBDT_TU77 054 #define MBDT_TU78 0101 /* can't handle these (yet) */ /* drive request required */ #define MBDT_SPR 0x400 /* slave present */ #define MBDT_TYPE 0x1ff #define MBDT_MASK (MBDT_NSA|MBDT_TAP|MBDT_TYPE) /* type codes for dissys/h/vmsystm.h 444 0 33 2474 2522400415 6772 /* vmsystm.h 4.3 81/04/23 */ /* * Miscellaneous virtual memory subsystem variables and structures. */ #ifdef KERNEL int freemem; /* remaining blocks of free memory */ int avefree; /* moving average of remaining free blocks */ int avefree30; /* 30 sec (avefree is 5 sec) moving average */ int deficit; /* estimate of needs of new swapped in procs */ int nscan; /* number of scans in last second */ int multprog; /* current multiprogramming degree */ int desscan; /* desired pages scanned per second */ /* writable copies of tunables */ int maxpgio; /* max paging i/o per sec before start swaps */ int maxslp; /* max sleep time before very swappable */ int lotsfree; /* max free before clock freezes */ int minfree; /* minimum free pages before swapping begins */ int desfree; /* no of pages to try to keep free via daemon */ int saferss; /* no pages not to steal; decays with slptime */ #endif /* * Fork/vfork accounting. */ struct forkstat { int cntfork; int cntvfork; int sizfork; int sizvfork; }; #ifdef KERNEL struct forkstat forkstat; #endif /* * Swap kind accounting. */ struct swptstat { int pteasy; /* easy pt swaps */ int ptexpand; /* pt expansion swaps */ int ptshrink; /* pt shrinking swaps */ int ptpack; /* pt swaps involving spte copying */ }; #ifdef KERNEL struct swptstat swptstat; #endif via daemon */ int saferss; /* no pages not to steal; decays with slptime */ #endif /* * Fork/vfork accounting. */ struct forkstat { int cntfork; int cntvfork; int sizfork; int sizvfork; }sys/h/mscp.h 444 0 33 23337 2624052064 6241 /* mscp.h 81/10/26 1.1 */ /* * Definitions for the Mass Storage Control Protocol */ /* * Control message opcodes */ #define M_OP_ABORT 0001 /* Abort command */ #define M_OP_GTCMD 0002 /* Get command status command */ #define M_OP_GTUNT 0003 /* Get unit status command */ #define M_OP_STCON 0004 /* Set controller characteristics command */ #define M_OP_SEREX 0007 /* Serious exception end message */ #define M_OP_AVAIL 0010 /* Available command */ #define M_OP_ONLIN 0011 /* Online command */ #define M_OP_STUNT 0012 /* Set unit characteristics command */ #define M_OP_DTACP 0013 /* Determine access paths command */ #define M_OP_ACCES 0020 /* Access command */ #define M_OP_CMPCD 0021 /* Compare controller data command */ #define M_OP_ERASE 0022 /* Erase command */ #define M_OP_FLUSH 0023 /* Flush command */ #define M_OP_REPLC 0024 /* Replace command */ #define M_OP_COMP 0040 /* Compare host data command */ #define M_OP_READ 0041 /* Read command */ #define M_OP_WRITE 0042 /* Write command */ #define M_OP_AVATN 0100 /* Available attention message */ #define M_OP_DUPUN 0101 /* Duplicate unit number attention message */ #define M_OP_ACPTH 0102 /* Access path attention message */ #define M_OP_END 0200 /* End message flag */ /* * Generic command modifiers */ #define M_MD_EXPRS 0100000 /* Express request */ #define M_MD_COMP 0040000 /* Compare */ #define M_MD_CLSEX 0020000 /* Clear serious exception */ #define M_MD_ERROR 0010000 /* Force error */ #define M_MD_SCCHH 0004000 /* Suppress caching (high speed) */ #define M_MD_SCCHL 0002000 /* Suppress caching (low speed) */ #define M_MD_SECOR 0001000 /* Suppress error correction */ #define M_MD_SEREC 0000400 /* Suppress error recovery */ #define M_MD_SSHDW 0000200 /* Suppress shadowing */ #define M_MD_WBKNV 0000100 /* Write back (non-volatile) */ #define M_MD_WBKVL 0000040 /* Write back (volatile) */ #define M_MD_WRSEQ 0000020 /* Write shadow set one unit at a time */ /* * AVAILABLE command modifiers */ #define M_MD_ALLCD 0000002 /* All class drivers */ #define M_MD_SPNDW 0000001 /* Spin down */ /* * FLUSH command modifiers */ #define M_MD_FLENU 0000001 /* Flush entire unit */ #define M_MD_VOLTL 0000002 /* Volatile only */ /* * GET UNIT STATUS command modifiers */ #define M_MD_NXUNT 0000001 /* Next unit */ /* * ONLINE command modifiers */ #define M_MD_RIP 0000001 /* Allow self destruction */ #define M_MD_IGNMF 0000002 /* Ignore media format error */ /* * ONLINE and SET UNIT CHARACTERISTICS command modifiers */ #define M_MD_ALTHI 0000040 /* Alter host identifier */ #define M_MD_SHDSP 0000020 /* Shadow unit specified */ #define M_MD_CLWBL 0000010 /* Clear write-back data lost */ #define M_MD_STWRP 0000004 /* Set write protect */ /* * REPLACE command modifiers */ #define M_MD_PRIMR 0000001 /* Primary replacement block */ /* * End message flags */ #define M_EF_BBLKR 0200 /* Bad block reported */ #define M_EF_BBLKU 0100 /* Bad block unreported */ #define M_EF_ERLOG 0040 /* Error log generated */ #define M_EF_SEREX 0020 /* Serious exception */ /* * Controller flags */ #define M_CF_ATTN 0200 /* Enable attention messages */ #define M_CF_MISC 0100 /* Enable miscellaneous error log messages */ #define M_CF_OTHER 0040 /* Enable other host's error log messages */ #define M_CF_THIS 0020 /* Enable this host's error log messages */ #define M_CF_MLTHS 0004 /* Multi-host */ #define M_CF_SHADW 0002 /* Shadowing */ #define M_CF_576 0001 /* 576 byte sectors */ /* * Unit flags */ #define M_UF_REPLC 0100000 /* Controller initiated bad block replacement */ #define M_UF_INACT 0040000 /* Inactive shadow set unit */ #define M_UF_WRTPH 0020000 /* Write protect (hardware) */ #define M_UF_WRTPS 0010000 /* Write protect (software or volume) */ #define M_UF_SCCHH 0004000 /* Suppress caching (high speed) */ #define M_UF_SCCHL 0002000 /* Suppress caching (low speed) */ #define M_UF_RMVBL 0000200 /* Removable media */ #define M_UF_WBKNV 0000100 /* Write back (non-volatile) */ #define M_UF_576 0000004 /* 576 byte sectors */ #define M_UF_CMPWR 0000002 /* Compare writes */ #define M_UF_CMPRD 0000001 /* Compare reads */ /* * Status codes */ #define M_ST_MASK 037 /* Status code mask */ #define M_ST_SUCC 000 /* Success */ #define M_ST_ICMD 001 /* Invalid command */ #define M_ST_ABRTD 002 /* Command aborted */ #define M_ST_OFFLN 003 /* Unit offline */ #define M_ST_AVLBL 004 /* Unit available */ #define M_ST_MFMTE 005 /* Media format error */ #define M_ST_WRTPR 006 /* Write protected */ #define M_ST_COMP 007 /* Compare error */ #define M_ST_DATA 010 /* Data error */ #define M_ST_HSTBF 011 /* Host buffer access error */ #define M_ST_CNTLR 012 /* Controller error */ #define M_ST_DRIVE 013 /* Drive error */ #define M_ST_DIAG 037 /* Message from an internal diagnostic */ typedef short quad[4]; /* a word-aligned quadword */ /* * An MSCP packet */ struct mscp { struct mscp_header mscp_header;/* device specific header */ long mscp_cmdref; /* command reference number */ short mscp_unit; /* unit number */ short mscp_xxx1; /* unused */ u_char mscp_opcode; /* opcode */ u_char mscp_flags; /* end message flags */ short mscp_modifier; /* modifiers */ union { struct { long Mscp_bytecnt; /* byte count */ long Mscp_buffer; /* buffer descriptor */ long Mscp_xxx2[2]; /* unused */ long Mscp_lbn; /* logical block number */ long Mscp_xxx4; /* unused */ long *Mscp_dscptr; /* pointer to descriptor (software) */ long Mscp_sftwds[4]; /* software words, padding */ } mscp_generic; struct { short Mscp_version; /* MSCP version */ short Mscp_cntflgs; /* controller flags */ short Mscp_hsttmo; /* host timeout */ short Mscp_usefrac; /* use fraction */ long Mscp_time; /* time and date */ } mscp_setcntchar; struct { short Mscp_multunt; /* multi-unit code */ short Mscp_unitflgs; /* unit flags */ long Mscp_hostid; /* host identifier */ quad Mscp_unitid; /* unit identifier */ long Mscp_mediaid; /* media type identifier */ short Mscp_shdwunt; /* shadow unit */ short Mscp_shdwsts; /* shadow status */ short Mscp_track; /* track size */ short Mscp_group; /* group size */ short Mscp_cylinder; /* cylinder size */ short Mscp_xxx3; /* reserved */ short Mscp_rctsize; /* RCT table size */ char Mscp_rbns; /* RBNs / track */ char Mscp_rctcpys; /* RCT copies */ } mscp_getunitsts; } mscp_un; }; /* * generic packet */ #define mscp_bytecnt mscp_un.mscp_generic.Mscp_bytecnt #define mscp_buffer mscp_un.mscp_generic.Mscp_buffer #define mscp_lbn mscp_un.mscp_generic.Mscp_lbn #define mscp_dscptr mscp_un.mscp_generic.Mscp_dscp((tr #define mscp_sftwds mscp_un.mscp_generic.Mscp_sftwds #define mscp_status mscp_modifier /* * Abort / Get Command Status packet */ #define mscp_outref mscp_bytecnt /* * Online / Set Unit Characteristics packet */ #define mscp_errlgfl mscp_lbn #define mscp_copyspd mscp_shdwsts /* * Replace packet */ #define mscp_rbn mscp_bytecnt /* * Set Controller Characteristics packet */ #define mscp_version mscp_un.mscp_setcntchar.Mscp_version #define mscp_cntflgs mscp_un.mscp_setcntchar.Mscp_cntflgs #define mscp_hsttmo mscp_un.mscp_setcntchar.Mscp_hsttmo #define mscp_usefrac mscp_un.mscp_setcntchar.Mscp_usefrac #define mscp_time mscp_un.mscp_setcntchar.Mscp_time /* * Get Unit Status end packet */ #define mscp_multunt mscp_un.mscp_getunitsts.Mscp_multunt #define mscp_unitflgs mscp_un.mscp_getunitsts.Mscp_unitflgs #define mscp_hostid mscp_un.mscp_getunitsts.Mscp_hostid #define mscp_unitid mscp_un.mscp_getunitsts.Mscp_unitid #define mscp_mediaid mscp_un.mscp_getunitsts.Mscp_mediaid #define mscp_shdwunt mscp_un.mscp_getunitsts.Mscp_shdwunt #define mscp_shdwsts mscp_un.mscp_getunitsts.Mscp_shdwsts #define mscp_track mscp_un.mscp_getunitsts.Mscp_track #define mscp_group mscp_un.mscp_getunitsts.Mscp_group #define mscp_cylinder mscp_un.mscp_getunitsts.Mscp_cylinder #define mscp_rctsize mscp_un.mscp_getunitsts.Mscp_rctsize #define mscp_rbns mscp_un.mscp_getunitsts.Mscp_rbns #define mscp_rctcpys mscp_un.mscp_getunitsts.Mscp_rctcpys /* * Online / Set Unit Characteristics end packet */ #define mscp_untsize mscp_dscptr #define mscp_volser mscp_sftwds[0] /* * Set Controller Characteristics end packet */ #define mscp_cnttmo mscp_hsttmo #define mscp_cntcmdl mscp_usefrac #define mscp_cntid mscp_unitid /* * Error Log message format codes */ #define M_FM_CNTERR 0 /* Controller error */ #define M_FM_BUSADDR 1 /* Host memory access error */ #define M_FM_DISKTRN 2 /* Disk transfer error */ #define M_FM_SDI 3 /* SDI error */ #define M_FM_SMLDSK 4 /* Small disk error */ /* * Error Log message flags */ #define M_LF_SUCC 0200 /* Operation successful */ #define M_LF_CONT 0100 /* Operation continuing */ #define M_LF_SQNRS 0001 /* Sequence number reset */ /* * MSCP Error Log packet * * NOTE: MSCP packet must be padded to this size. */ struct mslg { struct mscp_header mslg_header;/* device specific header */ long mslg_cmdref; /* command reference number */ short mslg_unit; /* unit number */ short mslg_seqnum; /* sequence number */ u_char mslg_format; /* format */ u_char mslg_flags; /* error log message flags */ short mslg_event; /* event code */ quad mslg_cntid; /* controller id */ u_char mslg_cntsvr; /* controller software version */ u_char mslg_cnthvr; /* controller hardware version */ short mslg_multunt; /* multi-unit code */ quad mslg_unitid; /* unit id */ u_char mslg_unitsvr; /* unit software version */ u_char mslg_unithvr; /* unit hardware version */ short mslg_group; /* group */ long mslg_volser; /* volume serial number */ long mslg_cylinder; /* cylinder */ short mslg_track; /* track */ short mslg_sector; /* sector */ long mslg_lbn; /* logical block number */ u_char mslg_level; /* level */ u_char mslg_retry; /* retry */ }; #define mslg_busaddr mslg_unitid #define mslg_sdecyl mslg_group ti-unit code */ quad mslg_unitid; /* unit id */ u_char mslg_unitsvr; /* unit software version */ u_char mslg_unithvr; /* unit hardware version */ short mslg_group; /* group */ long mslg_volser; /* volume serial number */ long mslg_cylinder; /* cylinder */ short mslg_track; /sys/h/udareg.h 444 0 33 2767 2624052067 6535 /* udareg.h 81/10/26 1.1 */ /* * UDA-50 registers and structures */ struct udadevice { short udaip; /* initialization and polling */ short udasa; /* status and address */ }; #define UDA_ERR 0100000 /* error bit */ #define UDA_STEP4 0040000 /* step 4 has started */ #define UDA_STEP3 0020000 /* step 3 has started */ #define UDA_STEP2 0010000 /* step 2 has started */ #define UDA_STEP1 0004000 /* step 1 has started */ #define UDA_NV 0002000 /* no host settable interrupt vector */ #define UDA_QB 0001000 /* controller supports Q22 bus */ #define UDA_DI 0000400 /* controller implements diagnostics */ #define UDA_IE 0000200 /* interrupt enable */ #define UDA_PI 0000001 /* host requests adapter purge interrupts */ #define UDA_GO 0000001 /* start operation, after init */ /* * UDA Communications Area */ struct udaca { short ca_xxx1; /* unused */ char ca_xxx2; /* unused */ char ca_bdp; /* BDP to purge */ short ca_cmdint; /* command queue transition interrupt flag */ short ca_rspint; /* response queue transition interrupt flag */ long ca_rspdsc[NRSP];/* response descriptors */ long ca_cmddsc[NCMD];/* command descriptors */ }; #define ca_ringbase ca_rspdsc[0] #define UDA_OWN 0x80000000 /* UDA owns this descriptor */ #define UDA_INT 0x40000000 /* allow interrupt on ring transition */ /* * MSCP packet info */ struct mscp_header { short uda_msglen; /* length of MSCP packet */ char uda_credits; /* low 4 bits: credits, high 4 bits: msgtype */ char uda_vcid; /* virtual circuit id */ }; response sys/h/reboot.h 444 0 33 771 2506431533 6527 /* reboot.h 4.2 81/02/19 */ /* * Arguments to reboot system call. * These are passed to boot program in r11, * and on to init. */ #define RB_AUTOBOOT 0 /* flags for system auto-booting itself */ #define RB_ASKNAME 1 /* ask for file name to reboot from */ #define RB_SINGLE 2 /* reboot to single user only */ #define RB_NOSYNC 4 /* dont sync before reboot */ #define RB_HALT 8 /* don't reboot, just halt */ #define RB_PANIC 0 /* reboot due to panic */ #define RB_BOOT 1 /* reboot due to boot() */ "sys/h/mbavar.h 444 0 33 10405 2516240217 6536 /* mbavar.h 4.15 81/04/08 */ /* * This file contains definitions related to the kernel structures * for dealing with the massbus adapters. * * Each mba has a mba_hd structure. * Each massbus device has a mba_device structure. * Each massbus slave has a mba_slave structure. * * At boot time we prowl the structures and fill in the pointers * for devices which we find. */ /* * Per-mba structure. * * The initialization routine uses the information in the mbdinit table * to initialize the what is attached to each massbus slot information. * It counts the number of devices on each mba (to see if bothering to * search/seek is appropriate). * * During normal operation, the devices attached to the mba which wish * to transfer are queued on the mh_act? links. */ struct mba_hd { short mh_active; /* set if mba is active */ short mh_ndrive; /* number of devices, to avoid seeks */ struct mba_regs *mh_mba; /* virt addr of mba */ struct mba_regs *mh_physmba; /* phys addr of mba */ struct mba_device *mh_mbip[8]; /* what is attached to each dev */ struct mba_device *mh_actf; /* head of queue to transfer */ struct mba_device *mh_actl; /* tail of queue to transfer */ }; /* * Per-device structure * (one for each RM/RP disk, and one for each tape formatter). * * This structure is used by the device driver as its argument * to the massbus driver, and by the massbus driver to locate * the device driver for a particular massbus slot. * * The device drivers hang ready buffers on this structure, * and the massbus driver will start i/o on the first such buffer * when appropriate. */ struct mba_device { struct mba_driver *mi_driver; short mi_unit; /* unit number to the system */ short mi_mbanum; /* the mba it is on */ short mi_drive; /* controller on mba */ short mi_dk; /* driver number for iostat */ short mi_alive; /* device exists */ short mi_type; /* driver specific unit type */ struct buf mi_tab; /* head of queue for this device */ struct mba_device *mi_forw; /* we could compute these every time, but hereby save time */ struct mba_regs *mi_mba; struct mba_drv *mi_drv; struct mba_hd *mi_hd; }; /* * Tape formatter slaves are specified by * the following information which is used * at boot time to initialize the tape driver * internal tables. */ struct mba_slave { struct mba_driver *ms_driver; short ms_ctlr; /* which of several formatters */ short ms_unit; /* which unit to system */ short ms_slave; /* which slave to formatter */ short ms_alive; }; /* * Per device-type structure. * * Each massbus driver defines entries for a set of routines used * by the massbus driver, as well as an array of types which are * acceptable to it. */ struct mba_driver { int (*md_attach)(); /* attach a device */ int (*md_slave)(); /* attach a slave */ int (*md_ustart)(); /* unit start routine */ int (*md_start)(); /* setup a data transfer */ int (*md_dtint)(); /* data transfer complete */ int (*md_ndint)(); /* non-data transfer interrupt */ short *md_type; /* array of drive ty((pe codes */ char *md_dname, *md_sname; /* device, slave names */ struct mba_device **md_info; /* backpointers to mbinit structs */ }; /* * Possible return values from unit start routines. */ #define MBU_NEXT 0 /* skip to next operation */ #define MBU_BUSY 1 /* dual port busy; wait for intr */ #define MBU_STARTED 2 /* non-data transfer started */ #define MBU_DODATA 3 /* data transfer ready; start mba */ /* * Possible return values from data transfer interrupt handling routines */ #define MBD_DONE 0 /* data transfer complete */ #define MBD_RETRY 1 /* error occurred, please retry */ #define MBD_RESTARTED 2 /* driver restarted i/o itself */ /* * Possible return values from non-data-transfer interrupt handling routines */ #define MBN_DONE 0 /* non-data transfer complete */ #define MBN_RETRY 1 /* failed; retry the operation */ #define MBN_SKIP 2 /* don't do anything */ /* * Clear attention status for specified device. */ #define mbclrattn(mi) ((mi)->mi_mba->mba_drv[0].mbd_as = 1 << (mi)->mi_drive) /* * Kernel definitions related to mba. */ #ifdef KERNEL int nummba; #if NMBA > 0 struct mba_hd mba_hd[NMBA]; extern Xmba0int(), Xmba1int(), Xmba2int(), Xmba3int(); extern struct mba_device mbdinit[]; extern struct mba_slave mbsinit[]; #endif #endif ata transfer complete */ #define MBN_RETRY 1 /* failed; retry the operation */ #define MBN_SKIP 2 /* don't do anything */ /* * Clear attention status for specified device. */ #define mbclrattn(mi) ((mi)->mi_mba->mba_drv[0].mbd_as = 1 << (mi)->mi_sys/h/msgbuf.h 444 0 33 346 2624302232 6510 /* msgbuf.h 4.2 81/02/19 */ #define MSG_MAGIC 0x063060 #define MSG_BSIZE (NBPG*CLSIZE - 2 * sizeof (long)) struct msgbuf { long msg_magic; long msg_bufx; char msg_bufc[MSG_BSIZE]; }; #ifdef KERNEL struct msgbuf msgbuf; #endif slave mbsinit[]; #endif #endif ata transfer complete */ #define MBN_RETRY 1 /* failed; retry the operation */ #define MBN_SKIP 2 /* don't do anything */ /* * Clear attention status for s/hL,hL5< /,"sys/h/rpb.h 444 0 33 1007 2526706052 6034 /* rpb.h 4.3 81/05/01 */ /* * The restart parameter block, which is a page in (very) low * core which runs after a crash. Currently, the restart * procedure takes a dump. */ struct rpb { struct rpb *rp_selfref; /* self-reference */ int (*rp_dumprout)(); /* routine to be called */ long rp_checksum; /* checksum of 31 words of dumprout */ long rp_flag; /* set to 1 when dumprout runs */ /* the dump stack grows from the end of the rpb page not to reach here */ }; #ifdef KERNEL extern struct rpb rpb; #endif h 4.3 81/05/01 */ /* * The restart parameter block, which is a page in (very) low * core which runs after a crash. Currently, the restart * procedure takes a dump. */ struct rpb { struct rpb *rp_selfref; /* self-reference */ int (*rp_dumprout)(); /* routine to be called */ long rp_checksum; /* checksum of 31 words of dumprout */ long rp_flag; /* set to 1 when dumprout runs */ /* the dump stack grows from the end of the rpb page not to reach here */ }; #ifdef KERNEL extern struct rpb rpb; sys/h/scb.h 444 0 33 3711 2506431541 6020 /* scb.h 4.3 81/02/21 */ /* * VAX System control block layout */ struct scb { int (*scb_stray)(); /* reserved */ int (*scb_machchk)(); /* machine chack */ int (*scb_kspinval)(); /* KSP invalid */ int (*scb_powfail)(); /* power fail */ int (*scb_resinstr)(); /* reserved instruction */ int (*scb_custinst)(); /* XFC instr */ int (*scb_resopnd)(); /* reserved operand */ int (*scb_resaddr)(); /* reserved addr mode */ int (*scb_acv)(); /* access control violation */ int (*scb_tnv)(); /* translation not valid */ int (*scb_tracep)(); /* trace pending */ int (*scb_bpt)(); /* breakpoint instr */ int (*scb_compat)(); /* compatibility mode fault */ int (*scb_arith)(); /* arithmetic fault */ int (*scb_stray2)(); int (*scb_stray3)(); int (*scb_chmk)(); /* CHMK instr */ int (*scb_chme)(); /* CHME instr */ int (*scb_chms)(); /* CHMS instr */ int (*scb_chmu)(); /* CHMU instr */ int (*scb_sbisilo)(); /* SBI silo compare */ int (*scb_cmrd)(); /* corrected mem read data */ int (*scb_sbialert)(); /* SBI alert */ int (*scb_sbiflt)(); /* SBI fault */ int (*scb_wtime)(); /* memory write timeout */ int (*scb_stray4[8])(); int (*scb_soft[15])(); /* software interrupt */ int (*scb_timer)(); /* interval timer interrupt */ int (*scb_stray5[7])(); int (*scb_stray6[4])(); int (*scb_csdr)(); /* console storage receive */ int (*scb_csdx)(); /* console storage transmit */ int (*scb_ctr)(); /* console terminal receive */ int (*scb_ctx)(); /* console terminal transmit */ int (*scb_ipl14[16])(); /* device interrupts IPL 14 */ int (*scb_ipl15[16])(); /* " " IPL 15 */ int (*scb_ipl16[16])(); /* " " IPL 16 */ int (*scb_ipl17[16])(); /* " " IPL 17 */ int (*scb_ubaint[128])(); /* Unibus device intr */ }; #ifdef KERNEL extern struct scb scb; /* scb.scb_ubaint is the same as UNIvec */ #endif #define scbentry(f, how) ((int (*)())(((int)f)+how)) #define SCB_KSTACK 0 #define SCB_ISTACK 1 #define SCB_WCS 2 #define SCB_HALT 3 /* console terminal transmit */ int (*scb_ipl14[16])(sys/h/rkreg.h 444 0 33 11337 2526706052 6412 /* rkreg.h 4.2 81/05/09 */ #define NRK7CYL 815 #define NRK6CYL 411 #define NRKSECT 22 #define NRKTRK 3 struct rkdevice { short rkcs1; /* control status reg 1 */ short rkwc; /* word count */ u_short rkba; /* bus address */ short rkda; /* disk address */ short rkcs2; /* control status reg 2 */ short rkds; /* drive status */ short rker; /* driver error register */ short rkatt; /* attention status/offset register */ short rkcyl; /* current cylinder register */ short rkxxx; short rkdb; /* data buffer register */ short rkmr1; /* maint reg 1 */ short rkec1; /* burst error bit position */ short rkec2; /* burst error bit pattern */ short rkmr2; /* maint reg 2 */ short rkmr3; /* maint reg 3 */ }; /* rkcs1 */ #define RK_CCLR 0100000 /* controller clear (also error) */ #define RK_CERR RK_CCLR #define RK_DI 0040000 /* drive interrupt */ #define RK_DTCPAR 0020000 /* drive to controller parity */ #define RK_CFMT 0010000 /* 18 bit word format */ #define RK_CTO 0004000 /* controller timeout */ #define RK_CDT 0002000 /* drive type (rk07/rk06) */ /* bits 8 and 9 are the extended bus address */ #define RK_CRDY 0000200 /* controller ready */ #define RK_IE 0000100 /* interrupt enable */ /* bits 1 to 4 are the function code */ #define RK_GO 0000001 /* commands */ #define RK_SELECT 000 /* select drive */ #define RK_PACK 002 /* pack acknowledge */ #define RK_DCLR 004 /* drive clear */ #define RK_UNLOAD 006 /* unload */ #define RK_START 010 /* start spindle */ #define RK_RECAL 012 /* recalibrate */ #define RK_OFFSET 014 /* offset */ #define RK_SEEK 016 /* seek */ #define RK_READ 020 /* read data */ #define RK_WRITE 022 /* write data */ #define RK_RHDR 026 /* read header */ #define RK_WHDR 030 /* write header */ /* rkcs2 */ #define RKCS2_DLT 0100000 /* data late */ #define RKCS2_WCE 0040000 /* write check */ #define RKCS2_UPE 0020000 /* unibus parity */ #define RKCS2_NED 0010000 /* non-existant drive */ #define RKCS2_NEM 0004000 /* non-existant memory */ #define RKCS2_PGE 0002000 /* programming error */ #define RKCS2_MDS 0001000 /* multiple drive select */ #define RKCS2_UFE 0000400 /* unit field error */ #define RKCS2_OR 0000200 /* output ready */ #define RKCS2_IR 0000100 /* input ready */ #define RKCS2_SCLR 0000040 /* subsystem clear */ #define RKCS2_BAI 0000020 /* bus address increment inhibit */ #define RKCS2_RLS 0000010 /* release */ /* bits 0-2 are drive select */ #define RKCS2_BITS \ "\10\20DLT\17WCE\16UPE\15NED\14NEM\13PGE\12MDS\11UFE\ \10OR\7IR\6SCLR\5BAI\4RLS" #define RKCS2_HARD (RKCS2_NED|RKCS2_PGE) /* rkds */ #define RKDS_SVAL 0100000 /* status valid */ #define RKDS_CDA 0040000 /* current drive attention */ #define RKDS_PIP 0020000 /* positioning in progress */ /* bit 12 is spare */ #define RKDS_WRL 0004000 /* write lock */ /* bits 9 and 10 are spare */ #define RKDS_DDT 0000400 /* disk drive type */ #define RKDS_DRDY 0000200 /* drive ready */ #define RKDS_VV 0000100 /* volume valid */ #define RKDS_DROT 0000040 /* drive off track */ #((define RKDS_SPLS 0000020 /* speed loss */ #define RKDS_ACLO 0000010 /* ac low */ #define RKDS_OFF 0000004 /* offset mode */ #define RKDS_DRA 0000001 /* drive available */ #define RKDS_DREADY (RKDS_DRA|RKDS_VV|RKDS_DRDY) #define RKDS_BITS \ "\10\20SVAL\17CDA\16PIP\14WRL\11DDT\ \10DRDY\7VV\6DROT\5SPLS\4ACLO\3OFF\1DRA" #define RKDS_HARD (RKDS_ACLO|RKDS_SPLS) /* rker */ #define RKER_DCK 0100000 /* data check */ #define RKER_UNS 0040000 /* drive unsafe */ #define RKER_OPI 0020000 /* operation incomplete */ #define RKER_DTE 0010000 /* drive timing error */ #define RKER_WLE 0004000 /* write lock error */ #define RKER_IDAE 0002000 /* invalid disk address error */ #define RKER_COE 0001000 /* cylinder overflow error */ #define RKER_HRVC 0000400 /* header vertical redundancy check */ #define RKER_BSE 0000200 /* bad sector error */ #define RKER_ECH 0000100 /* hard ecc error */ #define RKER_DTYE 0000040 /* drive type error */ #define RKER_FMTE 0000020 /* format error */ #define RKER_DRPAR 0000010 /* control-to-drive parity error */ #define RKER_NXF 0000004 /* non-executable function */ #define RKER_SKI 0000002 /* seek incomplete */ #define RKER_ILF 0000001 /* illegal function */ #define RKER_BITS \ "\10\20DCK\17UNS\16OPI\15DTE\14WLE\13IDAE\12COE\11HRVC\ \10BSE\7ECH\6DTYE\5FMTE\4DRPAR\3NXF\2SKI\1ILF" #define RKER_HARD \ (RKER_WLE|RKER_IDAE|RKER_COE|RKER_DTYE|RKER_FMTE|RKER_ILF) /* offset bits in rkas */ #define RKAS_P400 0020 /* +400 RK06, +200 RK07 */ #define RKAS_M400 0220 /* -400 RK06, -200 RK07 */ #define RKAS_P800 0040 /* +800 RK06, +400 RK07 */ #define RKAS_M800 0240 /* -800 RK06, -400 RK07 */ #define RKAS_P1200 0060 /* +800 RK06, +400 RK07 */ #define RKAS_M1200 0260 /* -1200 RK06, -1200 RK07 */ 6OPI\15DTE\14WLE\13IDAE\12COE\11HRVC\ \10BSE\7ECH\6DTYE\5FMTE\4DRPAR\3NXF\2SKI\1ILF" #define RKER_HARD \ (RKER_WLE|RKER_IDAE|RKER_COE|RKER_DTYE|RKER_FMTE|RKER_ILF) /* offset bits in rkas */ #define RKAS_P400 0020 /* +400 RK06, +200 RK07 */ #define RKAS_M400 0220 /* -400 RK06, -200sys/h/htreg.h 444 0 33 10151 2506432324 6376 /* htreg.h 4.1 81/03/21 */ struct htdevice { int htcs1; /* control status register */ int htds; /* drive status register */ int hter; /* error register */ int htmr; /* maintenance register */ int htas; /* attention status register */ int htfc; /* frame counter */ int htdt; /* drive type register */ int htck; /* nrzi check (crc) error character */ int htsn; /* serial number register */ int httc; /* tape controll register */ }; /* htcs1 */ #define HT_GO 000001 /* go bit */ #define HT_SENSE 000000 /* no operations (sense) */ #define HT_REWOFFL 000002 /* rewind offline */ #define HT_REW 000006 /* rewind */ #define HT_DCLR 000010 /* drive clear */ #define HT_RIP 000020 /* read in preset */ #define HT_ERASE 000024 /* erase */ #define HT_WEOF 000026 /* write tape mark */ #define HT_SFORW 000030 /* space forward */ #define HT_SREV 000032 /* space reverse */ #define HT_WCHFWD 000050 /* write check forward */ #define HT_WCHREV 000056 /* write check reverse */ #define HT_WCOM 000060 /* write forward */ #define HT_RCOM 000070 /* read forward */ #define HT_RREV 000076 /* read reverse */ /* htds */ #define HTDS_ATA 0100000 /* attention active */ #define HTDS_ERR 0040000 /* composite error */ #define HTDS_PIP 0020000 /* positioning in progress */ #define HTDS_MOL 0010000 /* medium on line */ #define HTDS_WRL 0004000 /* write lock */ #define HTDS_EOT 0002000 /* end of tape */ /* bit 9 is unused */ #define HTDS_DPR 0000400 /* drive present (always 1) */ #define HTDS_DRY 0000200 /* drive ready */ #define HTDS_SSC 0000100 /* slave status change */ #define HTDS_PES 0000040 /* phase-encoded status */ #define HTDS_SDWN 0000020 /* settle down */ #define HTDS_IDB 0000010 /* identification burst */ #define HTDS_TM 0000004 /* tape mark */ #define HTDS_BOT 0000002 /* beginning of tape */ #define HTDS_SLA 0000001 /* slave attention */ #define HTDS_BITS \ "\10\20ATA\17ERR\16PIP\15MOL\14WRL\13EOT\11DPR\10DRY\ \7SSC\6PES\5SDWN\4IDB\3TM\2BOT\1SLA" /* hter */ #define HTER_CORCRC 0100000 /* correctible data or ecc */ #define HTER_UNS 0040000 /* unsafe */ #define HTER_OPI 0020000 /* operation incomplete */ #define HTER_DTE 0010000 /* drive timing error */ #define HTER_NEF 0004000 /* non-executable function */ #define HTER_CSITM 0002000 /* correctable skew/illegal tape mark */ #define HTER_FCE 0001000 /* frame count error */ #define HTER_NSG 0000400 /* non-standard gap */ #define HTER_PEFLRC 0000200 /* format error or lrc error */ #define HTER_INCVPE 0000100 /* incorrectable data error or vertical parity error */ #define HTER_DPAR 0000040 /* data parity error */ #define HTER_FMT 0000020 /* format error */ #define HTER_CPAR 0000010 /* control bus parity error */ #define HTER_RMR 0000004 /* register modification refused */ #define HTER_ILR 0000002 /* illegal register */ #define HTER_ILF 0000001 /* illegal function */ #define HTER_BITS \ "\10\20CORCRC\17UNS\16OPI\15DTE\14NEF\13CSITM\12FCE\11NSG\10PEFLRC\ \7INCVPE\6DPAR\5FMT\4CPAR\3RMR\2ILR\1ILF" #define HTER_HARD \ (HTER_UNS|HTER_OPI|HTER_NEF|HTER_DPAR|HTER_FMT|HTER_CPAR| \ HTER_RMR|HTER_ILR|HTER_ILF) /* htdt */ #define HTDT_NSA 0100000 /* not sector addressed; always 1 */ #define HTDT_TAP 0040000 /* tape; always 1 */ #define HTDT_MOH 0020000 /* moving head; always 0 */ #define HTDT_7CH 0010000 /* 7 channel; always 0 */ #define HTDT_DRQ 0004000 /* drive requested; always 0 */ #define HTDT_SPR 0002000 /* slave present */ /* bit 9 is spare */ /* bits 8-0 are formatter/transport type */ /* httc */ #define HTTC_ACCL 0100000 /* transport is not reading/writing */ #define HTTC_FCS 0040000 /* frame count status */ #define HTTC_SAC 0020000 /* slave address change */ #define HTTC_EAODTE 0010000 /* enable abort on data xfer errors */ /* bits 8-10 are density select */ #define HTTC_800BPI 0001400 /* in bits 8-10, dens=1600 */ #define HTTC_1600BPI 0002000 /* in bits 8-10, dens=800 */ /* bits 4-7 are format select */ #define HTTC_PDP11 0000300 /* in bits 4-7, pdp11 normal format */ #define HTTC_EVEN 0000010 /* select even parity */ /* bits 0 - 2 are slave select */ #define b_repcnt b_bcount #define b_command b_resid efine HTTC_SAC 0020000 /* slave address change */ #define HTTC_EAODTE 0010000 /* enable abort on data xfer errors */ /* bits 8-10 are density select */ #define HTTC_800BPI 0001400 /* in bits 8-10, dens=1600 */ #define HTTC_1600BPI 0002000 /* in bits 8-10, dens=800 */ /* bits 4-7 are format select */ #define HTTC_PDP11 0000300 /* in bits 4-7, pdp11 normal format */ #define HTTC_EVEN 0000010 /* selecsys/h/types.h 444 0 33 1505 2506432324 6414 /* types.h 4.1 81/03/21 */ /* * Basic system types and major/minor device constructing/busting macros. */ /* major part of a device */ #define major(x) ((int)(((unsigned)(x)>>8)&0377)) /* minor part of a device */ #define minor(x) ((int)((x)&0377)) /* make a device number */ #define makedev(x,y) ((dev_t)(((x)<<8) | (y))) typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; /* SHOULD USE long RATHER THAN int HERE BUT IT WOULD GIVE LINT ON THE KERNEL */ /* GASTRIC DISTRESS AND DON'T HAVE TIME TO FIX THAT JUST NOW */ typedef struct _physadr { int r[1]; } *physadr; typedef int daddr_t; typedef char * caddr_t; typedef u_short ino_t; typedef int swblk_t; typedef int size_t; typedef int time_t; typedef int label_t[14]; typedef short dev_t; typedef int off_t; ))) typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; /* SHOULD USE long RATHER THAN int HERE BUT IT WOULD GIVE LINsys/h/tsreg.h 444 0 33 13061 2624344035 6416 /* tsreg.h 4.2 81/11/11 */ /* * TS11 controller registers */ struct tsdevice { u_short tsdb; /* data buffer */ u_short tssr; /* status register */ }; /* Bits in (unibus) status register */ #define TS_SC 0100000 /* special condition (error) */ #define TS_UPE 0040000 /* Unibus parity error */ #define TS_SPE 0020000 /* serial bus parity error */ #define TS_RMR 0010000 /* register modification refused */ #define TS_NXM 0004000 /* nonexistant memory */ #define TS_NBA 0002000 /* need buffer address */ #define TS_XMEM 0001400 /* Unibus xmem bits */ #define TS_SSR 0000200 /* subsytem ready */ #define TS_OFL 0000100 /* off-line */ #define TS_FTC 0000060 /* fatal termination class */ #define TS_TC 0000016 /* termination class */ #define TS_SUCC 000 /* successful termination */ #define TS_ATTN 002 /* attention */ #define TS_ALERT 004 /* tape status alert */ #define TS_REJECT 06 /* function reject */ #define TS_RECOV 010 /* recoverable error */ #define TS_RECNM 012 /* recoverable error, no tape ((motion */ #define TS_UNREC 014 /* unrecoverable error */ #define TS_FATAL 016 /* fatal error */ #define TSSR_BITS \ "\10\20SC\17UPE\16SPE\15RMR\14NXM\13NBA\12A17\11A16\10SSR\ \7OFL\6FC1\5FC0\4TC2\3TC1\2TC0\1-" #define b_repcnt b_bcount #define b_command b_resid /* status message */ struct ts_sts { u_short s_sts; /* packet header */ u_short s_len; /* packet length */ u_short s_rbpcr; /* residual frame count */ u_short s_xs0; /* extended status 0 - 3 */ u_short s_xs1; u_short s_xs2; u_short s_xs3; }; /* Error codes in xstat 0 */ #define TS_TMK 0100000 /* tape mark detected */ #define TS_RLS 0040000 /* record length short */ #define TS_LET 0020000 /* logical end of tape */ #define TS_RLL 0010000 /* record length long */ #define TS_WLE 0004000 /* write lock error */ #define TS_NEF 0002000 /* non-executable function */ #define TS_ILC 0001000 /* illegal command */ #define TS_ILA 0000400 /* illegal address */ #define TS_MOT 0000200 /* capstan is moving */ #define TS_ONL 0000100 /* on-line */ #define TS_IES 0000040 /* interrupt enable status */ #define TS_VCK 0000020 /* volume check */ #define TS_PED 0000010 /* phase-encoded drive */ #define TS_WLK 0000004 /* write locked */ #define TS_BOT 0000002 /* beginning of tape */ #define TS_EOT 0000001 /* end of tape */ #define TSXS0_BITS \ "\10\20TMK\17RLS\16LET\15RLL\14WLE\13NEF\12ILC\11ILA\10MOT\ \7ONL\6IES\5VCK\4PED\3WLK\2BOT\1EOT" /* Error codes in xstat 1 */ #define TS_DLT 0100000 /* data late */ #define TS_COR 0020000 /* correctable data */ #define TS_CRS 0010000 /* crease detected */ #define TS_TIG 0004000 /* trash in the gap */ #define TS_DBF 0002000 /* deskew buffer full */ #define TS_SCK 0001000 /* speed check */ #define TS_IPR 0000200 /* invalid preamble */ #define TS_SYN 0000100 /* synchronization failure */ #define TS_IPO 0000040 /* invalid postamble */ #define TS_IED 0000020 /* invalid end of data */ #define TS_POS 0000010 /* postamble short */ #define TS_POL 0000004 /* postamble long */ #define TS_UNC 0000002 /* uncorrectable data */ #define TS_MTE 0000001 /* multitrack error */ #define TSXS1_BITS \ "\10\20DLT\17-\16COR\15CRS\14TIG\13DBF\12SCK\11-\10IPR\ \7SYN\6IPO\5IED\4POS\3POL\2UNC\1MTE" /* Error codes in xstat 2 */ #define TS_OPM 0100000 /* operation in progress */ #define TS_SIP 0040000 /* silo parity error */ #define TS_BPE 0020000 /* serial bus parity error */ #define TS_CAF 0010000 /* capstan acceleration failure */ #define TS_WCF 0002000 /* write card fail */ #define TS_DTP 0000400 /* dead track parity */ #define TS_DT 0000377 /* dead tracks */ #define TSXS2_BITS \ "\10\20OPM\17SIP\16BPE\15CAF\14-\13WCF\12-\11DTP" /* Error codes in xstat 3 */ #define TS_MEC 0177400 /* microdiagnostic error code */ #define TS_LMX 0000200 /* limit exceeded */ #define TS_OPI 0000100 /* operation incomplete */ #define TS_REV 0000040 /* reverse */ #define TS_CRF 0000020 /* capstan response fail */ #define TS_DCK 0000010 /* density check */ #define TS_NOI 0000004 /* noise record */ #define TS_LXS 0000002 /* limit exceeded statically */ #define TS_RIB 0000001 /* reverse into BOT */ #define TSXS3_BITS \ "\10\10LMX\7OPI\6REV\5CRF\4DCK\3NOI\2LXS\1RIB" /* command message */ struct ts_cmd { u_short c_cmd; /* command */ u_short c_loba; /* low order buffer address */ u_short c_hiba; /* high order buffer address */ #define c_repcnt c_loba u_short c_size; /* byte count */ }; /* commands and command bits */ #define TS_ACK 0100000 /* ack - release command packet */ #define TS_CVC 0040000 /* clear volume check */ #define TS_IE 0000200 #define TS_RCOM 0000001 #define TS_REREAD 0001001 /* read data retry */ #define TS_SETCHR 0000004 /* set characteristics */ #define TS_WCOM 0000005 #define TS_REWRITE 0001005 /* write data retry */ #define TS_RETRY 0001000 /* retry bit for read and write */ #define TS_SFORW 0000010 /* forward space record */ #define TS_SREV 0000410 /* reverse space record */ #define TS_SFORWF 0001010 /* forward space file */ #define TS_SREVF 0001410 /* reverse space file */ #define TS_REW 0002010 /* rewind */ #define TS_OFFL 0000412 /* unload */ #define TS_WEOF 0000011 /* write tape mark */ #define TS_SENSE 0000017 /* get status */ /* characteristics data */ struct ts_char { long char_addr; /* address of status packet */ u_short char_size; /* its size */ u_short char_mode; /* characteristics */ }; /* characteristics */ #define TS_ESS 0200 /* enable skip tape marks stop */ #define TS_ENB 0100 /* ??? */ #define TS_EAI 0040 /* enable attention interrupts */ #define TS_ERI 0020 /* enable message buffer release interrupts */ * unload */ #define TS_WEOF 0000011 /* write tape mark */ #define TS_SENSE 0000017 /* get status */ /* characteristics data */ struct ts_char { long char_addr; /* address of status packet */ u_short char_size; /* its size */ u_short char_mode; /* characteristics */ }; /* characteristics */ #define TS_ESS 0200 /* enable skip tape marks stop */ #define TS_ENB 0100 /* ??? */ #define TS_EAI 0040 /* enable attention interrupts */ #define TS_ERI 0020sys/conf/ 775 0 33 0 2526723105 5515 sys/conf/BERT 644 0 33 1655 2531444475 6274 # # Configuration file for UC Berkeley ARPAVAX # cpu "VAX780" cpu "VAX750" cpu "VAX7ZZ" options TRACE ident BERT timezone 8 dst maxusers 24 config hpup vmunix config up upvmunix config rk rkvmunix controller mba0 at nexus ? controller uba0 at nexus ? disk hp0 at mba? drive 0 pseudo-device pty pseudo-device bk controller hk0 at uba0 csr 0177440 vector rkintr disk rk0 at hk0 drive 0 disk rk1 at hk0 drive 1 controller tm0 at uba0 csr 0172520 vector tmintr tape te0 at tm0 drive 0 controller sc0 at uba0 csr 0176700 vector upintr disk up0 at sc0 drive 0 device dh0 at uba0 csr 0160020 vector dhrint dhxint device dh1 at uba0 csr 0160040 vector dhrint dhxint device dh2 at uba0 csr 0160060 vector dhrint dhxint device dm0 at uba0 csr 0170500 vector dmintr device dm1 at uba0 csr 0170520 vector dmintr device dm2 at uba0 csr 0170520 vector dmintr device dz0 at uba0 csr 0160100 flags 0xc0 vector dzrint dzxint r tm0 at uba0 csr 0172520 vector tmintr tape te0 at tm0 drive 0 controller sc0 atsys/conf/newvers.sh 664 0 33 402 2531444524 7604 if [ ! -r version ]; then echo 0 > version; fi touch version awk ' { version = $1 + 1; }\ END { printf "char version[] = \"Berkeley VAX/UNIX Version 4.%d ", version > "vers.c";\ printf "%d\n", version > "version"; }' < version echo `date`'\n";' >> vers.c ector dmintr device dm1 at uba0 csr 0170520 vector dmintr device dm2 at uba0 csr 0170520 vector dmintr device dz0 at uba0 csr 0160100 flags 0xc0 vector dzrin/hL,hL5h< /,"sys/conf/touch.c 644 0 33 770 2552365010 7046 #include #include main(argc, argv) int argc; char **argv; { argc--, argv++; while (argc > 0) { struct stat stb; int c, f; if (stat(*argv, &stb) < 0) goto bad; if (chmod(*argv, stb.st_mode | 0200) < 0) goto bad; f = open(*argv, 2); if (f < 0) goto bad; lseek(f, 0, 0); read(f, &c, 1); lseek(f, 0, 0); write(f, &c, 1); close(f); chmod(*argv, stb.st_mode); argc--, argv++; continue; bad: perror(*argv); argc--, argv++; continue; } } "sys/conf/files 644 0 33 3544 2650355062 6634 sys/acct.c standard sys/alloc.c standard sys/calloc.c standard sys/clock.c standard sys/fio.c standard sys/iget.c standard sys/ioctl.c standard sys/machdep.c standard sys/main.c standard sys/nami.c standard sys/partab.c standard sys/pipe.c standard sys/prf.c standard sys/prim.c standard sys/rdwri.c standard sys/rmap.c standard sys/sig.c standard sys/slp.c standard sys/subr.c standard sys/sys.c standard sys/sys1.c standard sys/sys2.c standard sys/sys3.c standard sys/sys4.c standard sy((s/sysent.c standard sys/text.c standard sys/trap.c standard sys/vmdrum.c standard sys/vmmem.c standard sys/vmmon.c standard sys/vmpage.c standard sys/vmproc.c standard sys/vmpt.c standard sys/vmsched.c standard sys/vmsubr.c standard sys/vmswap.c standard sys/vmsys.c standard sys/udiv.s standard sys/urem.s standard dev/autoconf.c standard device-driver dev/bio.c standard dev/bk.c optional bk device-driver dev/conf.c standard dev/cons.c standard dev/ct.c optional ct device-driver dev/dh.c optional dh device-driver dev/dkbad.c standard dev/dkleave.c standard dev/dn.c optional dn device-driver dev/dsort.c standard dev/dz.c optional dz device-driver dev/flp.c standard dev/hp.c optional hp device-driver dev/ht.c optional tu device-driver dev/lp.c optional lp device-driver dev/mba.c optional mba device-driver dev/mem.c standard dev/mx1.c standard dev/mx2.c standard dev/mt.c optional mu device-driver dev/pty.c optional pty dev/rk.c optional rk device-driver dev/sw.c standard dev/tm.c optional te device-driver dev/ts.c optional ts device-driver dev/tty.c standard dev/ttynew.c standard dev/ttyold.c standard dev/tu.c standard dev/uba.c standard device-driver dev/uda.c optional ra device-driver dev/up.c optional up device-driver dev/va.c optional va device-driver dev/vaxcpu.c standard dev/vp.c optional vp device-driver v/mx1.c standard dev/mx2.c standard dev/mt.c optional mu device-driver dev/pty.c optional pty dev/rk.c optional rk device-driver dev/sw.c standard devsys/conf/makefile 644 0 33 7550 2574136700 7311 # # Makefile for Berkeley Virtual Vax/Unix, February 1981 # # This makefile is constructed from a machine description: # config machine # Most changes should be made in the machine description # /usr/sys/conf/``machineid'' # after which you should do # config machineid # Generic makefile changes should be made in # /usr/sys/conf/makefile # after which config should be rerun for all machines. # # N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE # IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING # # -DINSECURE old style non-vanishing suid bits # -DUNFAST don't compile in inline expansions and speedups # -DPGINPROF gather statistics about pagein/pageout activity # -DDISKMON monitor disk cacheing activity (bio.c) # -DINTRLVE compile in code for file systems interleaved across drives # -DTRACE compile in kernel tracing hooks # C2= /lib/c2 COPTS= ${IDENT} -DKERNEL -DVMUNIX CFLAGS= -O ${COPTS} AHEADS= ../h/pcb.m %OBJS %CFILES %LOAD clean: rm -f eddep *vmunix* tags *.o locore.i [a-tv-z]*.s touch errs linterrs lint: /tmp @lint -hbxn -I. -DGENERIC ${COPTS} ../sys/Locore.c \ ${CFILES} ../dev/swapgeneric.c ioconf.c | \ grep -v 'struct/union .* never defined' | \ grep -v 'possible pointer alignment problem' ../sys/symbols.sort: ../sys/symbols.raw grep -v '^#' ../sys/symbols.raw \ | sed 's/^ //' | sort | uniq > ../sys/symbols.sort locore.o: assym.s ${AHEADS} ../sys/scb.s ../sys/locore.s ubglue.s \ ../h/mtpr.h ../h/trap.h ../h/psl.h ../h/pte.h ../h/cpu.h ../h/mtpr.h mba.h cat assym.s ../sys/scb.s ../sys/locore.s ubglue.s > locore.c cc -E -DLOCORE ${COPTS} locore.c > locore.i @echo 'as -o locore.o $${AHEADS} locore.i' @as -o locore.o ${AHEADS} locore.i @rm locore.i # the following is necessary because autoconf.o depends on #if GENERIC autoconf.o: makefile # the following are necessary because the files depend on the types of # vax cpu's included in the system configuration clock.o machdep.o autoconf.o conf.o cons.o flp.o mba.o uba.o vaxcpu.o : makefile assym.s: ../h/param.h ../h/pte.h ../h/buf.h ../h/vmparam.h ../h/vmmeter.h \ ../h/dir.h ../h/cmap.h ../h/map.h ../h/ubavar.h ../h/proc.h cc ${IDENT} ../conf/genassym.c; ./a.out >assym.s; rm -f a.out ../h/param.h: /usr/include/signal.h touch ./touch ../h/param.h ../h/tty.h: /usr/include/sgtty.h ../h/ioctl.h touch ./touch ../h/tty.h ../h/user.h: ../h/pcb.h ../h/dmap.h ../h/vtimes.h ../h/types.h \ /usr/include/errno.h touch ./touch ../h/user.h ../h/vm.h: ../h/vmmac.h ../h/vmmeter.h ../h/vmparam.h ../h/vmsystm.h touch ./touch ../h/vm.h ../sys/sysent.c: ../sys/vmsysent.c touch ./touch ../sys/sysent.c touch: ../conf/touch.c cc ../conf/touch.c -o touch depend: grep '^#include' ${CFILES} | grep -v '<' | \ sed 's/:[^"]*"\([^"]*\)".*/: \1/' | \ sed 's/\.c/.o/' | sed 's,../[a-z]*/,,' | \ awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \ else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \ else rec = rec " " $$2 } } \ END { print rec } ' > makedep echo '$$r makedep' >>eddep echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep echo '$$r makedep' >>eddep echo 'w' >>eddep cp makefile makefile.bak ed - makefile < eddep rm eddep makedep tags: /usr/ucb/ctags ${CFILES} print: @pr -f makefile ../sys/TODO linterrs @/usr/ucb/ctags -x ${CFILES} | pr -f -h XREF @(size vmunix *.o) | pr -f -h sizes @ls -ls | pr -f @cd ../h; ls -ls | pr -f ; pr -f *.m *.h @cd ../sys; pr -f asm.sed Locore.c scb.s locore.s @pr -f ${CFILES} ioconf.o: ioconf.c ../h/param.h ../h/pte.h ../h/buf.h ../h/map.h \ ../h/mbavar.h ../h/vm.h ../h/ubavar.h ${CC} -I. -c -S ${COPTS} ioconf.c ${C2} ioconf.s | sed -f ../sys/asm.sed | ${AS} -o ioconf.o rm -f ioconf.s param.c: ../sys/param.c cp ../sys/param.c . param.o: param.c makefile ${CC} -c -O ${IDENT} ${PARAM} param.c %RULES # DO NOT DELETE THIS LINE -- make depend uses it | pr -f @cd ../h; ls -ls | pr -f ; pr -f *.m *.h @cd ../sys; pr -f asm.sed Locore.c scb.s locore.s @pr -f ${CFILES} ioconf.o: ioconf.c ../h/param.hsys/conf/genassym.c 644 0 33 3435 2522400246 7571 #define VAX780 1 #define VAX750 1 #include "../h/param.h" #include "../h/pte.h" #include "../h/buf.h" #include "../h/vmmeter.h" #include "../h/vmparam.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/cmap.h" #include "../h/map.h" #include "../h/ubareg.h" #include "../h/ubavar.h" #include "../h/proc.h" #include "../h/rpb.h" main() { register struct proc *p = (struct proc *)0; register struct uba_regs *uba = (struct uba_regs *)0; register struct uba_hd *uh = (struct uba_hd *)0; register struct vmmeter *vm = (struct vmmeter *)0; register struct user *up = (struct user *)0; struct rpb *rp = (struct rpb *)0; printf("#ifdef LOCORE\n"); printf("#define\tP_LINK %d\n", &p->p_link); printf("#define\tP_RLINK %d\n", &p->p_rlink); printf("#define\tP_ADDR %d\n", &p->p_addr); printf("#define\tP_PRI %d\n", &p->p_pri); printf("#define\tP_STAT %d\n", &p->p_stat); printf("#define\tP_WCHAN %d\n", &p->p_wchan); printf("#define\tSSLEEP %d\n", SSLEEP); printf("#define\tSRUN %d\n", SRUN); printf("#define\tUBA_BRRVR %d\n", uba->uba_brrvr); printf("#define\tUH_UBA %d\n", &uh->uh_uba); printf("#define\tUH_VEC %d\n", &uh->uh_vec); printf("#define\tUH_SIZE %d\n", sizeof (struct uba_hd)); printf("#define\tRP_FLAG %d\n", &rp->rp_flag); printf("#define\tV_SWTCH %d\n", &vm->v_swtch); printf("#define\tV_TRAP %d\n", &vm->v_trap); printf("#define\tV_SYSCALL %d\n", &vm->v_syscall); printf("#define\tV_INTR %d\n", &vm->v_intr); printf("#define\tV_PDMA %d\n", &vm->v_pdma); printf("#define\tUPAGES %d\n", UPAGES); printf("#define\tCLSIZE %d\n", CLSIZE); printf("#define\tSYSPTSIZE %d\n", SYSPTSIZE); printf("#define\tUSRPTSIZE %d\n", USRPTSIZE); printf("#else\n"); printf("asm(\".set\tU_ARG,%d\");\n", up->u_arg); printf("asm(\".set\tU_QSAV,%d\");\n", up->u_qsav); printf("#endif\n"); } printf("#define\tV_TRAP %d\n", &vm->v_trap); printf("#define\tV_SYSCALL %d\n", &vm->v_syscall); printf("#define\tV_INTR %d\n", &vm->v_intr); printf("#define\tV_PDMA %d\n", &vm->v_pdma); printf("#define\tUPAGES %d\n", UPAGsys/conf/GENERIC 644 0 33 3403 2624304355 6600 # # GENERIC VAX # cpu "VAX780" cpu "VAX750" cpu "VAX7ZZ" ident GENERIC timezone 0 maxusers 8 config generic vmunix controller mba0 at nexus ? controller mba1 at nexus ? controller mba2 at nexus ? controller mba3 at nexus ? controller uba0 at nexus ? controller uba1 at nexus ? controller uba2 at nexus ? controller uba3 at nexus ? disk hp0 at mba? drive 0 disk hp1 at mba? drive ? disk hp2 at mba? drive ? disk hp3 at mba? drive ? master ht0 at mba? drive ? tape tu0 at ht0 slave 0 tape tu1 at ht0 slave 1 master mt0 at mba? drive ? tape mu0 at mt0 slave 0 tape mu1 at mt0 slave 1 controller hk0 at uba? csr 0177440 vector rkintr disk rk0 at hk0 drive 0 disk rk1 at hk0 drive 1 device lp0 at uba? csr 0177514 vector lpintr controller tm0 at uba? csr 0172520 vector tmintr tape te0 at tm0 drive 0 tape te1 at tm0 drive 1 controller sc0 at uba? csr 0176700 vector upintr disk up0 at sc0 drive 0 disk up1 at sc0 drive 1 controller uda0 at uba? csr 0177550 vector udintr disk ra0 at uda0 drive 0 d((isk ra1 at uda0 drive 1 device dn0 at uba? csr 0160020 vector dnintr device dh0 at uba? csr 0160020 vector dhrint dhxint device dh1 at uba? csr 0160040 vector dhrint dhxint device dz0 at uba? csr 0160100 flags 0xff vector dzrint dzxint device dz1 at uba? csr 0160110 flags 0xff vector dzrint dzxint device dz2 at uba? csr 0160120 flags 0xff vector dzrint dzxint device dz3 at uba? csr 0160130 flags 0xff vector dzrint dzxint device dz4 at uba? csr 0160140 flags 0xff vector dzrint dzxint device dz5 at uba? csr 0160150 flags 0xff vector dzrint dzxint device dz6 at uba? csr 0160160 flags 0xff vector dzrint dzxint device dz7 at uba? csr 0160170 flags 0xff vector dzrint dzxint controller zs0 at uba? csr 0172520 vector tsintr device ts0 at zs0 drive 0 t uba? csr 0160110 flags 0xff vector dzrint dzxint device dz2 at uba? csr 0160120 flags 0xff vector dzrint dzxint device dz3 at uba? csr 0160130 flags 0xff vector dzrint dzxint device dz4 at uba? csr 0160140 flags 0xff vector dzrint dzxint device dzsys/stand/ 775 0 33 0 2732240231 5672 sys/stand/sys.o 664 0 33 7160 2650356725 7000 0( Ь[ԫ`PPPPXPd2lp[h[p[ZPPQxQQQPQxQPPZj Ъ Z~[~ ^Ь[kj]rX[k/[ZjZj/jjݬ[gP8ݬP0jZ[[Pݬ<~kЭP^Ь[Ь[Yլ 1eѬ ЬZJЭPԭ xѬ ­׭խխ ݬ1jí P@ݬ1Q֭ѭЭP@\CxPXPdx P@Ah2l[0x P@$ЭPЭ@x P@ έPxPPPZJ1|ݬ1 ^Ь[լ1[Y<PʏPP@ 10 12ԭd֭ѭ@>ЭP֭P[pPPXPdp[h2l[Mp[ZԭZ~ݬPmba_cr = MBCR_INIT; for (i = 0; i < nuba; i++) if (!badloc(ubaddr[i])) if (cpu == VAX_780) ubaddr[i]->uba_cr = UBACR_ADINIT; if (cpu != VAX_780) mtpr(IUR,0); /* give unibus devices a chance to recover... */ if (nuba > 0) DELAY(2000000); } (mbaddr750) / sizeosys/stand/ht.c 444 0 33 4102 2632503405 6533 /* ht.c 4.6 81/12/01 */ /* * TM03/TU?? tape driver */ #include "../h/htreg.h" #include "../h/param.h" #include "../h/inode.h" #include "../h/pte.h" #include "../h/mbareg.h" #include "saio.h" #include "savax.h" short httypes[] = { MBDT_TM03, MBDT_TE16, MBDT_TU45, MBDT_TU77, 0 }; #define MASKREG(reg) ((reg)&0xffff) htopen(io) register struct iob *io; { register int skip; register struct htdevice *htaddr = (struct htdevice *)mbadrv(io->i_unit); int i; for (i = 0; httypes[i]; i++) if (httypes[i] == (htaddr->htdt&MBDT_TYPE)) goto found; _stop("not a tape\n"); found: mbainit(UNITTOMBA(io->i_unit)); htaddr->htcs1 = HT_DCLR|HT_GO; htstrategy(io, HT_REW); skip = io->i_boff; while (skip--) { io->i_cc = -1; while (htstrategy(io, HT_SFORW)) ; DELAY(65536); htstrategy(io, HT_SENSE); } } htclose(io) register struct iob *io; { htstrategy(io, HT_REW); } htstrategy(io, func) register struct iob *io; int func; { register int den, errcnt, ds; int er; short fc; register struct htde((vice *htaddr = (struct htdevice *)mbadrv(io->i_unit); errcnt = 0; retry: den = HTTC_1600BPI|HTTC_PDP11; htquiet(htaddr); htaddr->htcs1 = HT_DCLR|HT_GO; htaddr->httc = den; htaddr->htfc = -io->i_cc; if (func == HT_SREV) { htaddr->htfc = -1; htaddr->htcs1 = HT_SREV|HT_GO; return (0); } if (func == READ || func == WRITE) mbastart(io, func); else htaddr->htcs1 = func|HT_GO; htquiet(htaddr); ds = htaddr->htds; er = htaddr->hter; if (ds & HTDS_TM) { htaddr->htcs1 = HT_DCLR|HT_GO; return (0); } if (ds & HTDS_ERR) { htaddr->htcs1 = HT_DCLR|HT_GO; if ((er & HTER_CORCRC) == 0) { printf("ht error: ds=%b, er=%b\n", MASKREG(ds), HTDS_BITS, MASKREG(er), HTER_BITS); if (errcnt == 10) { printf("ht: unrecovered error\n"); return (-1); } errcnt++; htstrategy(io, HT_SREV); goto retry; } } if (errcnt) printf("ht: recovered by retry\n"); fc = htaddr->htfc; return (io->i_cc+fc); } htquiet(htaddr) register struct htdevice *htaddr; { register int s; do s = htaddr->htds; while ((s & HTDS_DRY) == 0); } _GO; if ((er & HTER_CORCRC) == 0) { printf("ht error: ds=%b, er=%b\n", MASKREG(ds), HTDS_BITS, MASKREG(er), HTER_BITS); if (errcnt == 10) { printf("ht: unrecovered error\n"); return (-1); } errcnt++; htstrategy(io, HT_SREV); goto retry; } } if (errcnt) printf("ht: recovered by retry\n"); fc = htaddr->htfc; return (io->i_cc+fc); } htquiet(htaddr) register struct htdevice *htaddr; { register sys/stand/makefile 644 0 33 6674 2732200373 7475 # makefile 4.13 81/12/01 DESTDIR= CFLAGS= -O -DSTANDALONE ${COPTS} COPTS= -DVAX780 -DVAX750 -DVAX7ZZ RELOC= 70000 SRCS= sys.c conf.c prf.c machdep.c \ autoconf.c hp.c ht.c mba.c mt.c rk.c tm.c ts.c up.c uba.c uda.c DRIVERS=autoconf.o hp.o ht.o mba.o mt.o rk.o tm.o ts.o up.o uba.o uda.o ALL= /usr/lib/libsa.a srt0.o boot cat ls icheck mkfs restor \ tpicheck tpmkfs tprestor sboot all: ${ALL} /usr/lib/libsa.a: sys.o conf.o ${DRIVERS} prf.o machdep.o ar crv ${DESTDIR}/usr/lib/libsa.a $? ranlib ${DESTDIR}/usr/lib/libsa.a ${DRIVERS}: cc -c -S ${COPTS} $*.c /lib/c2 -i $*.s | as -o $*.o rm $*.s boot: boot.o bootconf.o relsrt0.o ${DESTDIR}/usr/lib/libsa.a ld -N -T ${RELOC} relsrt0.o boot.o bootconf.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=boot ibs=32 skip=1; rm b.out bootconf.o: conf.c cp conf.c bootconf.c cc -c ${COPTS} -DBOOT bootconf.c rm bootconf.c sboot: boot.c relsrt0.o ${DESTDIR}/usr/lib/libsa.a cp boot.c sboot.c; chmod +w sboot.c cc -c -O -DJUSTASK sboot.c rm sboot.c ld -N -T ${RELOC} relsrt0.o sboot.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=sboot ibs=32 skip=1; rm b.out cat: cat.o srt0.o ${DESTDIR}/usr/lib/libsa.a ld -N srt0.o cat.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=cat ibs=32 skip=1; rm b.out ls: ls.o srt0.o ${DESTDIR}/usr/lib/libsa.a ld -N srt0.o ls.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=ls ibs=32 skip=1; rm b.out imptst: imptst.o srt0.o ld -N srt0.o imptst.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=imptst ibs=32 skip=1; rm b.out mkfs.o: /usr/src/cmd/mkfs.c cc ${CFLAGS} -c /usr/src/cmd/mkfs.c mkfs: mkfs.o srt0.o ${DESTDIR}/usr/lib/libsa.a ld -N srt0.o mkfs.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=mkfs ibs=32 skip=1; rm b.out restor.o: /usr/src/cmd/restor.c cc ${CFLAGS} -c /usr/src/cmd/restor.c restor: restor.o srt0.o ${DESTDIR}/usr/lib/libsa.a ld -N srt0.o restor.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=restor ibs=32 skip=1; rm b.out icheck.o: /usr/src/cmd/icheck.c cc ${CFLAGS} -c /usr/src/cmd/icheck.c icheck: icheck.o srt0.o ${DESTDIR}/usr/lib/libsa.a ld -N srt0.o icheck.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=icheck ibs=32 skip=1; rm b.out tpmkfs: mkfs.o tpsrt0.o ${DESTDIR}/usr/lib/libsa.a ld -N tpsrt0.o mkfs.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=tpmkfs ibs=32 skip=1; rm b.out tprestor: restor.o tpsrt0.o ${DESTDIR}/usr/lib/libsa.a ld -N tpsrt0.o restor.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=tprestor ibs=32 skip=1; rm b.out tpicheck: icheck.o tpsrt0.o ${DESTDIR}/usr/lib/libsa.a ld -N tpsrt0.o icheck.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=tpicheck ibs=32 skip=1; rm b.out srt0.o: srt0.c cc -E -DRELOC=0x${RELOC} ${COPTS} srt0.c | as -o srt0.o tpsrt0.o: srt0.c cc -E -DRELOC=0x${RELOC} -DTP ${COPTS} srt0.c | as -o tpsrt0.o relsrt0.o: srt0.c cc -E -DRELOC=0x${RELOC} -DREL ${COPTS} srt0.c | as -o relsrt0.o print: @pr -f makefile @/usr/ucb/ls -l | pr -f @pr -f *.h *.c clean: rm -f *.o *.exe *.i rm -f a.out b.out boot cat ls icheck mkfs restor rpboot \ tpicheck tpmkfs tprestor sboot lint: lint ${COPTS} -hxbn boot.c ${SRCS} | \ grep -v 'possible pointer alignment' | \ grep -v 'struct/union .* never defined' install: ${ALL} cp tprestor $$DESTDIR/tp/restor cp tpicheck $$DESTDIR/tp/icheck cp tpmkfs $$DESTDIR/tp/mkfs cp sboot $$DESTDIR/tp/boot cp boot icheck mkfs restor cat ls ../floppy cp boot $$DESTDIR file @/usr/ucb/ls -l | pr -f @pr -f *.h *.c clean: rm -f *.o *.esys/stand/conf.o 644 0 33 2432 2732200425 7064 x Ь[[2PxPP|P`Ь[[2PxPP|P`Ь[[2PxPPP`Ь[[2PxPPP`t ttthpuphkrahttmtsmt2Nj     $ ( ,04 8 <@D H L PT X \ `d h l pt x |! x $(26<?CXMQtZ^jr~"_devsw_b_blknos_iob_devreadL17_devwriteL22_devopenL27_devcloseL32_nullsysL37_hpstrategy_hpopen_upstrategy_upopen_rkstrategy_rkopen_udstrategy_udopen_htstrategy_htopen_htclose_tmstrategy_tmopen_tmclose_tsstrategy_tsopen_tsclose_mtstrategy_mtopen_mtcloser~"_devsys/stand/srt0.c 444 0 33 2355 2512564010 7014 /* srt0.c 4.8 81/04/03 */ #include "../h/mtpr.h" #define LOCORE #include "../h/cpu.h" /* * Startup code for standalone system * Non-relocating version -- for programs which are loaded by boot */ .globl _end .globl _edata .globl _main .globl __rtt .globl _configure .globl _cpu .globl _openfirst .set HIGH,31 # mask for total disable entry: .globl entry .word 0x0 mtpr $HIGH,$IPL # just in case #ifdef REL movl $RELOC,sp #else movl $RELOC-0x2400,sp #endif start: movl aedata,r0 clr: clrl (r0)+ cmpl r0,sp jlss clr #ifdef REL movc3 aend,*$0,(sp) jmp *abegin begin: #endif mtpr $0,$SCBB calls $0,_configure movl $1,_openfirst calls $0,_main #ifndef TP jmp start #else ret #endif .data #ifdef REL abegin: .long begin aend: .long _end-RELOC aedata: .long _edata-RELOC #else aedata: .long _edata #endif __rtt: .word 0x0 jmp start .globl _badloc _badloc: .word 0 movl $1,r0 movl 4(ap),r3 movl $4,r2 movab 9f,(r2) tstl (r3) 1: clrl r0 # made it w/o machine checks 2: movl $4,r2 clrl (r2) ret .align 2 9: casel _cpu,$1,$VAX_MAX 0: .word 8f-0b # 1 is 780 .word 5f-0b # 2 is 750 .word 5f-0b # 3 is 7ZZ 5: mtpr $0xf,$MCESR brb 1f 8: mtpr $0,$SBIFS 1: addl2 (sp)+,sp # discard mchchk trash movab 2b,(sp) rei aend: .long _end-RELOC aedata: .long _edata-RELOC #else aedata: .long _edata #endif __rtt: .word 0x0 jmp start .globl _badloc _badloc: .word 0 movl $1,r0 movl 4(ap),r3 movl $4,r2 movab 9f,(r2) tstl (r3) 1: clrl r0 # made it w/o machine checks 2: movl $4,r2 clrlsys/stand/conf.c 444 0 33 2255 2732200205 7045 ((/* conf.c 4.9 81/12/01 */ #include "../h/param.h" #include "../h/inode.h" #include "../h/pte.h" #include "../h/mbareg.h" #include "saio.h" devread(io) register struct iob *io; { return( (*devsw[io->i_ino.i_dev].dv_strategy)(io, READ) ); } devwrite(io) register struct iob *io; { return( (*devsw[io->i_ino.i_dev].dv_strategy)(io, WRITE) ); } devopen(io) register struct iob *io; { (*devsw[io->i_ino.i_dev].dv_open)(io); } devclose(io) register struct iob *io; { (*devsw[io->i_ino.i_dev].dv_close)(io); } nullsys() { ; } int nullsys(); int hpstrategy(), hpopen(); int upstrategy(), upopen(); int rkstrategy(), rkopen(); int udstrategy(), udopen(); #ifndef BOOT int htstrategy(), htopen(), htclose(); int tmstrategy(), tmopen(), tmclose(); int tsstrategy(), tsopen(), tsclose(); int mtstrategy(), mtopen(), mtclose(); #endif struct devsw devsw[] = { "hp", hpstrategy, hpopen, nullsys, "up", upstrategy, upopen, nullsys, "hk", rkstrategy, rkopen, nullsys, "ra", udstrategy, udopen, nullsys, #ifndef BOOT "ht", htstrategy, htopen, htclose, "tm", tmstrategy, tmopen, tmclose, "ts", tsstrategy, tsopen, tsclose, "mt", mtstrategy, mtopen, mtclose, #endif 0,0,0,0 }; tstrategy(), htopen(), htclose(); int tmstrategy(), tmopen(), tmclose(); int tsstrategy(), tsopen(), tsclose(); int mtstrategy(), mtopen(), mtclose(); #endif struct devsw devsw[] = { "hp", hpstrategy, hpopen, nullsys, "up", upstrategy, upopen, nullsys, "hk", rkstrategy, rkopen, nullsys, "ra", udstrategy, udopen, nullsys, #ifndefsys/stand/cat.c 444 0 33 302 2506442323 6646 /* cat.c 4.2 81/03/15 */ main() { int c, i; char buf[50]; do { printf("File: "); gets(buf); i = open(buf, 0); } while (i <= 0); while ((c = getc(i)) > 0) putchar(c); exit(0); } , htclose(); int tmstrategy(), tmopen(), tmclose(); int tsstrategy(), tsopen(), tsclose(); int mtstrategy(), mtopen(), mtclose(); #endif struct devsw devsw[] = { "hp", hpstrategy, hpopen, nullsys, "up", upstrategy, upopen,/hL,hL5Ȇ< /,"sys/stand/boot.c.sam 444 0 33 4020 2650401611 7635 /* boot.c 4.6 81/12/01 */ #include "../h/param.h" #include "../h/ino.h" #include "../h/inode.h" #include "../h/filsys.h" #include "../h/dir.h" #include "../h/vm.h" #include #include "saio.h" #include /* * Boot program... arguments passed in r10 and r11 determine * whether boot stops to ask for system name and which device * boot comes from. */ /* Types in r10 specifying major device */ char devname[][2] = { 'h','p', /* 0 = hp */ 0,0, /* 1 = ht */ 'u','p', /* 2 = up */ 'h','k', /* 3 = hk */ 0,0, /* 4 = sw */ 0,0, /* 5 = tm */ 0,0, /* 6 = ts */ 0,0, /* 7 = mt */ 0,0, /* 8 = tu */ 'r','a', /* 9 = ra */ }; char line[100] = "xx(0,0)vmunix"; int retry = 0; main() { register howto, devtype; /* howto=r11, devtype=r10 */ int io; #ifdef lint howto = 0; devtype = 0; #endif printf("\nBoot\n"); #ifdef JUSTASK howto = RB_ASKNAME|RB_SINGLE; #else if ((howto&RB_ASKNAME)==0) { if (devtype>=0 && devtype= 0) copyunix(howto, io); if (++retry > 2) howto = RB_SINGLE|RB_ASKNAME; } } /*ARGSUSED*/ copyunix(howto, io) register howto, io; { struct exec x; register int i; char *addr; i = read(io, (char *)&x, sizeof x); if (i != sizeof x || x.a_magic != 0410) _stop("Bad format\n"); printf("%d", x.a_text); if (read(io, (char *)0, x.a_text) != x.a_text) goto shread; addr = (char *)x.a_text; while ((int)addr & CLOFSET) *addr++ = 0; printf("+%d", x.a_data); if (read(io, addr, x.a_data) != x.a_data) goto shread; addr += x.a_data; printf("+%d", x.a_bss); x.a_bss += 128*512; /* slop */ for (i = 0; i < x.a_bss; i++) *addr++ = 0; x.a_entry &= 0x7fffffff; printf(" start 0x%x\n", x.a_entry); (*((int (*)()) x.a_entry))(); _exit(); shread: _stop("Short read\n"); } rmat\n"); printf("%d", x.a_text); if (read(io, (char *)0, x.a_text) != x.a_text) goto shread; addr = (char *)x.a_text; while ((int)addr & CLOFSET) *addr++ = 0; printf("+%d", x.a_data); if (read(io, addr, x.a_data) != x.a_data) goto shread; addr += x.a_data; printf("+%d", x.a_bss); x.a_bss += 128*512; /* slop */ for (i = 0; i < x.a_bss; i++) *addr++ = 0; x.a_entry &= 0x7fffffff; printf(" start 0x%x\n", x.a_entry); (*((int (*)()) x.a_entry))(); _exit(); shread: _stop("Shsys/stand/hp.c 444 0 33 4625 2527153632 6547 /* hp.c 4.6 81/05/10 */ /* * RP??/RM?? disk driver */ #include "../h/param.h" #include "../h/inode.h" #include "../h/hpreg.h" #include "../h/pte.h" #include "../h/mbareg.h" #include "saio.h" #include "savax.h" #define MASKREG(reg) ((reg)&0xffff) char hp_type[MAXNMBA*8] = { 0 }; /* THIS SHOULD BE READ IN OFF THE PACK, PER DRIVE */ short hp6_off[8] = { 0, 38, 0, -1, -1, -1, 118, -1 }; short rm3_off[8] = { 0, 100, 0, -1, -1, -1, 310, -1 }; short rm5_off[8] = { 0, 27, 0, 562, 589, 681, 562, 82 }; short rm80_off[8] = { 0, 37, 0, -1, -1, -1, 115, 305 }; short hp7_off[8] = { 0, 10, 0, 330, 340, 500, 330, 50 }; /* END SHOULD BE READ IN */ short hptypes[] = { MBDT_RM03, MBDT_RM05, MBDT_RP06, MBDT_RM80, MBDT_RP05, MBDT_RP07, 0 }; struct hpst { short nsect; short ntrak; short nspc; short ncyl; short *off; } hpst[] = { 32, 5, 32*5, 823, rm3_off, /* RM03 */ 32, 19, 32*19, 823, rm5_off, /* RM05 */ 22, 19, 22*19, 815, hp6_off, /* RP06 */ 31, 14, 31*14, 559, rm80_off, /* RM80 */ 22, 19, 22*19, 411, hp6_off, /* RP06 */ 50, 32, 50*32, 630, hp7_off, /* RP07 */ }; hpopen(io) register struct iob *io; { register unit = io->i_unit; struct hpdevice *hpaddr = (struct hpdevice *)mbadrv(unit); register struct hpst *st; mbainit(UNITTOMBA(io->i_unit)); if (hp_type[unit] == 0) { register type = hpaddr->hpdt & MBDT_TYPE; register int i; for (i = 0; hptypes[i]; i++) if (hptypes[i] == type) goto found; _stop("unknown drive type"); found: hp_type[unit] = i; } st = &hpst[hp_type[unit]]; if (io->i_boff < 0 || io->i_boff > 7 || st->off[io->i_boff]== -1) _stop("hp bad minor"); io->i_boff = st->off[io->i_boff] * st->nspc; } hpstrategy(io, func) register struct iob *io; { int unit = io->i_unit; daddr_t bn = io->i_bn; struct hpdevice *hpaddr = (struct hpdevice *)mbadrv(unit); struct hpst *st = &hpst[hp_type[unit]]; int cn, tn, sn; if ((hpaddr->hpds & HPDS_VV) == 0) { hpaddr->hpcs1 = HP_DCLR|HP_GO; hpaddr->hpcs1 = HP_PRESET|HP_GO; hpaddr->hpof = HPOF_FMT22; } cn = bn/st->nspc; sn = bn%st->nspc; tn = sn/st->nsect; sn = sn%st->nsect; hpaddr->hpdc = cn; hpaddr->hpda = (tn << 8) + sn; mbastart(io, func); while ((hpaddr->hpds & HPDS_DRY) == 0) ; if (hpaddr->hpds&HPDS_ERR) { printf("hp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b\n", cn, tn, sn, MASKREG(hpaddr->hpds), HPDS_BITS, MASKREG(hpaddr->hper1), HPER1_BITS); return (-1); } return (io->i_cc); } hpcs1 = HP_DCLR|HP_GO; hpaddr->hpcs1 = HP_PRESET|HP_GO; hpaddr->hpof = HPOF_FMT22; } cn = bn/st->nspcsys/stand/prf.o 664 0 33 2503 2650357506 6743 \~ݬ^Ь[ЬZXXXX%1DPba1PO1PD ZY YYYjFjYWWWPxPYPPX XWЊYjЭP֭`~YԭY<TЭP֭`W >?1yWPxPPPPPYP)խ ,XX X֭鑽 ֭jЭP֭`X1!XPX11Pd1Pc1 1PlXXPPo11Pu1Ps1|1Px11 ^Ѭ լ-Gάޭ[ݬݬ@ ݬݬPP֘{~ ޭP[PЬ[20uY"PY["PZ"[~#[  Z"x kP!^P[[  [[j[P Ь[*P#DP@ZP +PЬ[ 4PZZPP P  Z[[0123456789abcdef +xC  2 H V b py ((   ""*.38<BHQU[ __printfL13_prfL18_putchar_printnL67uremudivL79_mfpr_mtpr_getcharL91_getsL99bcdef +xC  2 H V b py sys/stand/rk.c 444 0 33 3604 2560207176 6550 /* rk.c 4.4 81/07/25 */ /* * RK611/RK07 */ #include "../h/param.h" #include "../h/rkreg.h" #include "../h/inode.h" #include "../h/pte.h" #include "../h/ubareg.h" #include "saio.h" #include "savax.h" u_short rkstd[] = { 0777440 }; short rk_off[] = { 0, 241, 0, -1, -1, -1, 393, -1 }; rkopen(io) register struct iob *io; { register struct rkdevice *rkaddr = (struct rkdevice *)ubamem(io->i_unit, rkstd[0]); if (rk_off[io->i_boff] == -1 || io->i_boff < 0 || io->i_boff > 7) _stop("rk bad unit"); io->i_boff = rk_off[io->i_boff] * NRKSECT*NRKTRK; rkaddr->rkcs2 = RKCS2_SCLR; rkwait(rkaddr); } rkstrategy(io, func) register struct iob *io; { register struct rkdevice *rkaddr = (struct rkdevice *)ubamem(io->i_unit, rkstd[0]); int com; daddr_t bn; short dn, cn, sn, tn; int ubinfo, errcnt = 0; retry: ubinfo = ubasetup(io, 1); bn = io->i_bn; dn = io->i_unit; cn = bn/(NRKSECT*NRKTRK); sn = bn%NRKSECT; tn = (bn / NRKSECT) % NRKTRK; rkaddr->rkcs2 = dn; rkaddr->rkcs1 = RK_CDT|RK_PACK|RK_GO; rkwait(rkaddr); rkaddr->rkcs1 = RK_CDT|RK_DCLR|RK_GO; rkwait(rkaddr); rkaddr->rkda = sn | (tn << 8); rkaddr->rkcyl = cn; rkaddr->rkba = ubinfo; rkaddr->rkwc = -(io->i_cc >> 1); com = RK_CDT|((ubinfo>>8)&0x300)|RK_GO; if (func == READ) com |= RK_READ; else com |= RK_WRITE; rkaddr->rkcs1 = com; rkwait(rkaddr); while ((rkaddr->rkds & RKDS_SVAL) == 0) ; ubafree(io, ubinfo); if (rkaddr->rkcs1 & RK_CERR) { printf("rk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b\n", cn, tn, sn, rkaddr->rkcs2, RKCS2_BITS, rkaddr->rker, RKER_BITS); rkaddr->rkcs1 = RK_CDT|RK_DCLR|RK_GO; rkwait(rkaddr); if (errcnt == 10) { printf("rk: unrecovered error\n"); return (-1); } errcnt++; goto retry; } if (errcnt) printf("rk: recovered by retry\n"); return (io->i_cc); } rkwait(rkaddr) register struct rkdevice *rkaddr; { while ((rkaddr->rkcs1 & RK_CRDY) == 0) ; } if (rkaddr->rkcs1 & RK_CERR) { printf("rk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b\n", cn, tn, sn, rkaddr->rkcsys/stand/ls.c 444 0 33 1062 2506442324 6542 /* ls.c 4.2 81/03/15 */ #include "../h/param.h" #include "../h/inode.h" #include "../h/ino.h" #include "../h/dir.h" #include "saio.h" char line[100]; main() { int i; printf("ls\n"); do { printf(": "); gets(line); i = open(line, 0); } while (i < 0); ls(i); } ls(io) register io; { struct direct d; register i; while (read(io, (char *)&d, sizeof d) == sizeof d) { if (d.d_ino == 0) continue; printf("%d\t", d.d_ino); for (i=0; ii_unit); struct mba_drv *drv = mbadrv(io->i_unit); register struct pte *pte = mba->mba_map; int npf; unsigned v; int o; int vaddr; v = btop(io->i_ma); o = (int)io->i_ma & PGOFSET; npf = btoc(io->i_cc + o); vaddr = o; while (--npf >= 0) *(int *)pte++ = v++ | PG_V; mba->mba_sr = -1; mba->mba_bcr = -io->i_cc; mba->mba_var = vaddr; if (func == WRITE) drv->mbd_cs1 = MB_WCOM | MB_GO; else drv->mbd_cs1 = MB_RCOM | MB_GO; } mbainit(mbanum) int mbanum; { register struct mba_regs *mba = mbaddr[mbanum]; /* SHOULD BADADDR IT */ if (mbaact & (1<mba_cr = MBCR_INIT; mbaact |= 1<i_ma); o = (int)io->i_ma & PGOFSET; npf = btoc(io->i_cc + o); sys/stand/uba.c 444 0 33 2414 2624323133 6672 /* uba.c 4.5 81/11/12 */ #include "../h/param.h" #include "../h/inode.h" #include "../h/cpu.h" #include "../h/pte.h" #include "../h/ubareg.h" #include "../h/vm.h" #include "saio.h" #include "savax.h" /* * Note... this routine does not * really allocate; unless bdp == 2 * you always get the same space. * When bdp == 2 you get some other space. */ ubasetup(io, bdp) register struct iob *io; int bdp; { int npf; unsigned v; register struct pte *pte; int o, temp, reg; static int lastreg = 128+64; v = btop(io->i_ma); o = (int)io->i_ma & PGOFSET; npf = btoc(io->i_cc + o) +1; if (bdp == 2) { reg = lastreg; lastreg += npf; bdp = 0; } else reg = 0; pte = &ubauba(io->i_unit)->uba_map[reg]; temp = (bdp << 21) | UBAMR_MRV; if (bdp && (o & 01)) temp |= UBAMR_BO; v &= 0x1fffff; /* drop to physical addr */ while (--npf != 0) *(int *)pte++ = v++ | temp; *(int *)pte++ = 0; return ((bdp << 28) | (reg << 9) | o); } ubafree(io, mr) struct iob *io; int mr; { register int bdp; bdp = (mr >> 28) & 0x0f; if (bdp == 0) return; switch (cpu) { case VAX_780: ubauba(io->i_unit)->uba_dpr[bdp] |= UBADPR_BNE; break; case VAX_750: ubauba(io->i_unit)->uba_dpr[bdp] |= UBADPR_PURGE|UBADPR_NXM|UBADPR_UCE; break; case VAX_7ZZ: break; } } UBAMR_BO; v &= 0x1fffff; /* drop to physical addr */ while (--npf != 0) *(int *)pte++ = v++ | temp; *(int *)pte++ = 0; return ((bdp << 28) | (reg << 9) | o); } ubafree(io, mr) struct iob *io; int mr; { register int bdp; bdp = (msys/stand/prf.c 444 0 33 6641 2526707467 6741 /* prf.c 4.3 81/05/05 */ #include "../h/param.h" #include "../h/cons.h" #include "../h/mtpr.h" /* * Scaled down version of C Library printf. * Used to print diagnostic information directly on console tty. * Since it is not interrupt driven, all system activities are * suspended. Printf should not be used for chit-chat. * * One additional format: %b is supported to decode error registers. * Usage is: * printf("reg=%b\n", regval, "*"); * Where is the output base expressed as a co((ntrol character, * e.g. \10 gives octal; \20 gives hex. Each arg is a sequence of * characters, the first of which gives the bit number to be inspected * (origin 1), and the next characters (up to a control character, i.e. * a character <= 32), give the name of the register. Thus * printf("reg=%b\n", 3, "\10\2BITTWO\1BITONE\n"); * would produce output: * reg=2 */ /*VARARGS1*/ printf(fmt, x1) char *fmt; unsigned x1; { prf(fmt, &x1); } prf(fmt, adx) register char *fmt; register u_int *adx; { register int b, c, i; char *s; int any; loop: while ((c = *fmt++) != '%') { if(c == '\0') return; putchar(c); } again: c = *fmt++; /* THIS CODE IS VAX DEPENDENT IN HANDLING %l? AND %c */ switch (c) { case 'l': goto again; case 'x': case 'X': b = 16; goto number; case 'd': case 'D': case 'u': /* what a joke */ b = 10; goto number; case 'o': case 'O': b = 8; number: printn((u_long)*adx, b); break; case 'c': b = *adx; for (i = 24; i >= 0; i -= 8) if (c = (b >> i) & 0x7f) putchar(c); break; case 'b': b = *adx++; s = (char *)*adx; printn((u_long)b, *s++); any = 0; if (b) { putchar('<'); while (i = *s++) { if (b & (1 << (i-1))) { if (any) putchar(','); any = 1; for (; (c = *s) > 32; s++) putchar(c); } else for (; *s > 32; s++) ; } putchar('>'); } break; case 's': s = (char *)*adx; while (c = *s++) putchar(c); break; } adx++; goto loop; } /* * Printn prints a number n in base b. * We don't use recursion to avoid deep kernel stacks. */ printn(n, b) u_long n; { char prbuf[11]; register char *cp; if (b == 10 && (int)n < 0) { putchar('-'); n = (unsigned)(-(int)n); } cp = prbuf; do { *cp++ = "0123456789abcdef"[n%b]; n /= b; } while (n); do putchar(*--cp); while (cp > prbuf); } /* * Print a character on console. * Attempts to save and restore device * status. * * Whether or not printing is inhibited, * the last MSGBUFS characters * are saved in msgbuf for inspection later. */ putchar(c) register c; { register s, timo; timo = 30000; /* * Try waiting for the console tty to come ready, * otherwise give up after a reasonable time. */ while((mfpr(TXCS)&TXCS_RDY) == 0) if(--timo == 0) break; if(c == 0) return; s = mfpr(TXCS); mtpr(TXCS,0); mtpr(TXDB, c&0xff); if(c == '\n') putchar('\r'); putchar(0); mtpr(TXCS, s); } getchar() { register c; while((mfpr(RXCS)&RXCS_DONE) == 0) ; c = mfpr(RXDB)&0177; if (c=='\r') c = '\n'; putchar(c); return(c); } gets(buf) char *buf; { register char *lp; register c; lp = buf; for (;;) { c = getchar() & 0177; store: switch(c) { case '\n': case '\r': c = '\n'; *lp++ = '\0'; return; case '\b': case '#': lp--; if (lp < buf) lp = buf; continue; case '@': case 'u'&037: lp = buf; putchar('\n'); continue; default: *lp++ = c; } } } ) { register c; while((mfpr(RXCS)&RXCS_DONE) == 0) ; c = mfpr(RXDB)&0177; if (c=='\r') sys/stand/sys.c 444 0 33 17672 2506744213 7002 /* sys.c 4.4 81/03/22 */ #include #include #include #include #include #include "saio.h" ino_t dlook(); static openi(n,io) register struct iob *io; { register struct dinode *dp; io->i_offset = 0; io->i_bn = fsbtodb(itod(n)) + io->i_boff; io->i_cc = BSIZE; io->i_ma = io->i_buf; devread(io); dp = (struct dinode *)io->i_buf; dp = &dp[itoo(n)]; io->i_ino.i_number = n; io->i_ino.i_mode = dp->di_mode; io->i_ino.i_size = dp->di_size; l3tol((char *)io->i_ino.i_un.i_addr, (char *)dp->di_addr, NADDR); } static find(path, file) register char *path; struct iob *file; { register char *q; char c; int n; if (path==NULL || *path=='\0') { printf("null path\n"); return(0); } openi((ino_t) ROOTINO, file); while (*path) { while (*path == '/') path++; q = path; while(*q != '/' && *q != '\0') q++; c = *q; *q = '\0'; if ((n=dlook(path, file))!=0) { if (c=='\0') break; openi(n, file); *q = c; path = q; continue; } else { printf("%s not found\n",path); return(0); } } return(n); } static daddr_t sbmap(io, bn) register struct iob *io; daddr_t bn; { register i; register struct inode *ip; int j, sh; daddr_t nb, *bap; int ibn = bn; ip = &io->i_ino; if(bn < 0) { printf("bn negative\n"); return((daddr_t)0); } /* * blocks 0..NADDR-4 are direct blocks */ if(bn < NADDR-3) { i = bn; nb = ip->i_un.i_addr[i]; return(nb); } /* * addresses NADDR-3, NADDR-2, and NADDR-1 * have single, double, triple indirect blocks. * the first step is to determine * how many levels of indirection. */ sh = 0; nb = 1; bn -= NADDR-3; for(j=3; j>0; j--) { sh += NSHIFT; nb <<= NSHIFT; if(bn < nb) break; bn -= nb; } if(j == 0) { printf("bn ovf %D\n",bn); return((daddr_t)0); } /* * fetch the address from the inode */ nb = ip->i_un.i_addr[NADDR-j]; if(nb == 0) { printf("bn void %D\n",bn); return((daddr_t)0); } /* * fetch through the indirect blocks */ for(; j<=3; j++) { if (blknos[j] != nb) { io->i_bn = fsbtodb(nb) + io->i_boff; io->i_ma = b[j]; io->i_cc = BSIZE; devread(io); bap = (daddr_t *)b[j]; blknos[j] = nb; } bap = (daddr_t *)b[j]; sh -= NSHIFT; i = (bn>>sh) & NMASK; nb = bap[i]; if(nb == 0) { printf("bn void %D\n",bn); return((daddr_t)0); } } return(nb); } static ino_t dlook(s, io) char *s; register struct iob *io; { register struct direct *dp; register struct inode *ip; daddr_t bn; int n,dc; if (s==NULL || *s=='\0') return(0); ip = &io->i_ino; if ((ip->i_mode&IFMT)!=IFDIR) { printf("not a directory\n"); return(0); } n = ip->i_size/sizeof(struct direct); if (n==0) { printf("zero length directory\n"); return(0); } dc = BSIZE; bn = (daddr_t)0; while(n--) { if (++dc >= BSIZE/sizeof(struct direct)) { io->i_bn = fsbtodb(sbmap(io, bn++)) + io->i_boff; io->i_ma = io->i_buf; io->i_cc = BSIZE; devread(io); dp = (struct direct *)io->i_buf; dc = 0; } if (match(s, dp->d_name)) return(dp->d_ino); dp++; } return(0); } static match(s1,s2) register char *s1,*s2; { register cc; cc = DIRSIZ; while (cc--) { if (*s1 != *s2) return(0); if (*s1++ && *s2++) continue; else return(1); } return(1); } lseek(fdesc, addr, ptr) int fdesc; off_t addr; int ptr; { register struct iob *io; if (ptr != 0) { printf("Seek not from beginning of file\n"); return(-1); } fdesc -= 3; if (fdesc < 0 || fdesc >= NFILES || ((io = &iob[fdesc])->i_flgs&F_ALLOC) == 0) return(-1); io->i_offset = addr; io->i_bn = fsbtodb(addr/BSIZE) + io->i_boff; io->i_cc = 0; return(0); } getc(fdesc) int fdesc; { register struct iob *io; register char *p; register c; int off; if (fdesc >= 0 && fdesc <= 2) return(getchar()); fdesc -= 3; if (fdesc < 0 || fdesc >= NFILES || ((io = &iob[fdesc])->i_flgs&F_ALLOC) == 0) return(-1); p = io->i_ma; if (io->i_cc <= 0) { io->i_bn = fsbtodb(io->i_offset/(off_t)BSIZE); if (io->i_flgs&F_FILE) io->i_bn = fsbtodb(sbmap(io, dbtofsb(io->i_bn))) + io->i_boff; io->i_ma = io->i_buf; io->i_cc = BSIZE; devread(io); if (io->i_flgs&F_FILE) { off = io->i_offset % (off_t)BSIZE; if (io->i_offset+(BSIZE-off) >= io->i_ino.i_size) io->i_cc = io->i_ino.i_size - io->i_offset + off; io->i_cc -= off; if (io->i_cc <= 0) return(-1); } else off = 0; p = &io->i_buf[off]; } io->i_cc--; io->i_offset++; c = (unsigned)*p++; io->i_ma = p; return(c); } /* does this port? getw(fdesc) int fdesc; { register w,i; register char *cp; int val; for (i = 0, val = 0, cp = &val; i < sizeof(val); i++) { w = getc(fdesc); if (w < 0) { if (i == 0) return(-1); else return(val); } *cp++ = w; } return(val); } */ read(fdesc, buf, count) int fdesc; char *buf; int count; { register i; register struct iob *file; if (fdesc >= 0 & fdesc <= 2) { i = count; do { *buf = getchar(); } while (--i && *buf++ != '\n'); return(count - i); } fdesc -= 3; if (fdesc < 0 || fdesc >= NFILES || ((file = &iob[fdesc])->i_flgs&F_ALLOC) == 0) return(-1); if ((file->i_flgs&F_READ) == 0) return(-1); if ((file->i_flgs&F_FILE) == 0) { file->i_cc = count; file->i_ma = buf; i = devread(file); file->i_bn += CLSIZE; return(i); } else { if (file->i_offset+count > file->i_ino.i_size) count = file->i_ino.i_size - file->i_offset; if ((i = count) <= 0) return(0); do { *buf++ = getc(fdesc+3); } while (--i); return(count); } } write(fdesc, buf, count) int fdesc; char *buf; int count; { register i; register struct iob *file; if (fdesc >= 0 && fdesc <= 2) { i = count; while (i--) putchar(*buf++); return(count); } fdesc -= 3; if (fdesc < 0 || fdesc >= NFILES || ((file = &iob[fdesc])->i_flgs&F_ALLOC) == 0) return(-1); if ((file->i_flgs&F_WRITE) == 0) return(-1); file->i_cc = count; file->i_ma = buf; i = devwrite(file); file->i_bn += CLSIZE; return(i); } int openfirst = 1; open(str, how) char *str; int how; { register char *cp; int i; register struct iob *file; register struct devsw *dp; int fdesc; long atol(); if (openfirst) { for (i = 0; i < NFILES; i++) iob[i].i_flgs = 0; openfirst = 0; } for (fdesc = 0; fdesc < NFILES; fdesc++) if (iob[fdesc].i_flgs == 0) goto gotfile; _stop("No more file slots"); gotfile: (file = &iob[fdesc])->i_flgs |= F_ALLOC; for (cp = str; *cp && *cp != '('; cp++) ; if (*cp != '(') { printf("Bad device\n"); file->i_flgs = 0; return(-1); } *cp++ = '\0'; for (dp = devsw; dp->dv_name; dp++) { if (match(str, dp((->dv_name)) goto gotdev; } printf("Unknown device\n"); file->i_flgs = 0; return(-1); gotdev: *(cp-1) = '('; file->i_ino.i_dev = dp-devsw; file->i_unit = *cp++ - '0'; if (*cp >= '0' && *cp <= '9') file->i_unit = file->i_unit * 10 + *cp++ - '0'; if (file->i_unit < 0 || file->i_unit > 31) { printf("Bad unit specifier\n"); file->i_flgs = 0; return(-1); } if (*cp++ != ',') { badoff: printf("Missing offset specification\n"); file->i_flgs = 0; return(-1); } file->i_boff = atol(cp); for (;;) { if (*cp == ')') break; if (*cp++) continue; goto badoff; } devopen(file); if (*++cp == '\0') { file->i_flgs |= how+1; file->i_cc = 0; file->i_offset = 0; return(fdesc+3); } if ((i = find(cp, file)) == 0) { file->i_flgs = 0; return(-1); } if (how != 0) { printf("Can't write files yet.. Sorry\n"); file->i_flgs = 0; return(-1); } openi(i, file); file->i_offset = 0; file->i_cc = 0; file->i_flgs |= F_FILE | (how+1); return(fdesc+3); } close(fdesc) int fdesc; { struct iob *file; fdesc -= 3; if (fdesc < 0 || fdesc >= NFILES || ((file = &iob[fdesc])->i_flgs&F_ALLOC) == 0) return(-1); if ((file->i_flgs&F_FILE) == 0) devclose(file); file->i_flgs = 0; return(0); } exit() { _stop("Exit called"); } _stop(s) char *s; { int i; for (i = 0; i < NFILES; i++) if (iob[i].i_flgs != 0) close(i); printf("%s\n", s); _rtt(); } trap(ps) int ps; { printf("Trap %o\n", ps); for (;;) ; } lgs |= F_FILE | (how+1); return(fdesc+3); } close(fdesc) int fdesc; sys/stand/autoconf.o 664 0 33 2044 2732240144 7760 PX^>PPPAPgP11xPP`PxPP`P֭vxHcXMԭ9.ԭЭԭѭ1Oԭ8xP P`PxPP`P֭ѭ 7խ Џ[[`       @ ` `    = G V in ty           - ;  !)P4`?pJU`kv_cpu_mbaddr_mbaact_umaddr_ubaddr_ubaddr780_umaddr780_mbaddr780_ubaddr750_umaddr750_mbaddr750_ubaddr7ZZ_umaddr7ZZ_configureL26_mfpr_badloc_mtpr          - ;  !)P4`?pJU`kv_cpu_mbaddr_mbaact_umaddr_ubaddr_ubaddr780_umaddr780_mbaddr780_ubaddr750_umaddr750_mbaddr750_ubaddr7ZZ_umaddr7ZZsys/stand/saio.h 444 0 33 1355 2506442325 7072 /* saio.h 4.4 3/15/81 */ /* * header file for standalone package */ /* * io block: includes an * inode, cells for the use of seek, etc, * and a buffer. */ struct iob { char i_flgs; struct inode i_ino; int i_unit; daddr_t i_boff; daddr_t i_cyloff; off_t i_offset; daddr_t i_bn; char *i_ma; int i_cc; char i_buf[BSIZE]; }; #define F_READ 01 #define F_WRITE 02 #define F_ALLOC 04 #define F_FILE 010 /* * dev switch */ struct devsw { char *dv_name; int (*dv_strategy)(); int (*dv_open)(); int (*dv_close)(); }; struct devsw devsw[]; /* * request codes. Must be the same a F_XXX above */ #define READ 1 #define WRITE 2 #define NBUFS 4 char b[NBUFS][BSIZE]; daddr_t blknos[NBUFS]; #define NFILES 4 struct iob iob[NFILES]; ff; daddr_t i_cyloff; off_t i_offset; daddr_t i_bn; char *i_ma; int i_cc; char i_buf[BSIZE]; }; #define F_READ 01 #define F_WRITE 02 #define F_ALLOC 04 #define F_FILE 010 /* * dev switch */ struct devsw { char *dv_name; int (*dv_strategy)(); int (*dv_open)(); isys/stand/savax.h 444 0 33 2005 2506442325 7252 /* savax.h 4.2 81/03/15 */ /* * Standalone definitions peculiar to vaxen * The mba devices in the standalone system are addressed as * xx(unit,section) * where unit is * 8*mbanum+drive * The mbadrv macro gives the address of the device registers * for the specified unit; the mbamba macro gives the address of the * mba registers themselves. * * The uba devices are also addressed by giving, as unit, * 8*ubanum+drive * The ubamem macro converts a specified unibus address (ala pdp-11) * into a unibus memory address space address. */ int cpu; /* see */ #define MAXNMBA 4 struct mba_regs **mbaddr; int mbaact; caddr_t *umaddr; struct uba_regs **ubaddr; #define UNITTOMBA(unit) ((unit)>>3) #define UNITTODRIVE(unit) ((unit)&07) #define mbamba(unit) (mbaddr[UNITTOMBA(unit)]) #define mbadrv(unit) (&mbamba(unit)->mba_drv[UNITTODRIVE(unit)]) #define UNITTOUBA(unit) ((unit)>>3) #define ubauba(unit) (ubaddr[UNITTOUBA(unit)]) #define ubamem(unit, off) ((umaddr[UNITTOUBA(unit)]+(off&017777))) memory address space address. */ int cpu; /* see */ #define MAXNMBA 4 struct mba_regs **mbaddr; int mbaact; caddr_t *umaddr; struct uba_regs **ubaddr; #define UNITTOMBA(unit) ((unit)>>3) #define UNITTODRIVE(unit) ((unit)&07) #define mbamba(unit) (mbaddr[UNITTOMBA(unit)]) #define mbadrv(unit) (&mbamba(unit)->mba_drv[UNITTODRIVE(unit)]) #define UNITTOUBA(unit) ((unit)>>3) #define ubauba(unit) (ubaddr[UNITTOUBA(unit)]) #define ubamem(unit, off) ((umaddr[UNITTOUBA(unit)]+(off&01777sys/stand/ts.c 444 0 33 4735 2632747270 6574 /* ts.c 4.4 81/12/01 */ /* * TS11 tape driver */ #include "../h/param.h" #include "../h/tsreg.h" #include "../h/inode.h" #include "../h/pte.h" #include "../h/ubareg.h" #include "saio.h" #include "savax.h" u_short tsstd[] = { 0772520 }; struct iob ctsbuf; u_short ts_uba; /* Unibus address of ts structure */ struct tsdevice *tsaddr = 0; struct ts { struct ts_cmd ts_cmd; struct ts_char ts_char; struct ts_sts ts_sts; } ts; tsopen(io) register struct iob *io; { static struct ts *ts_ubaddr; long i = 0; if (tsaddr == 0) tsaddr = ubamem(io->i_unit, tsstd[0]); tsaddr->tssr = 0; while ((tsaddr->tssr & TS_SSR)==0) { if (++i > 1000000) { printf("ts: not ready\n"); return; } } if (tsaddr->tssr&TS_OFL) { printf("ts: offline\n"); return; } if (tsaddr->tssr&TS_NBA) { int i; ctsbuf.i_ma = (caddr_t) &ts; ctsbuf.i_cc = sizeof(ts); if (ts_ubaddr == 0) ts_ubaddr = (struct ts *)ubasetup(&ctsbuf, 2); ts_uba = (u_short)((long)ts_ubaddr + (((long)ts_ubaddr>>16)&03)); ts.ts_char.char_addr = (int)&ts_ubaddr->ts_sts; ts.ts_char.char_size = sizeof(ts.ts_sts); ts.ts_char.char_mode = TS_ESS; ts.ts_cmd.c_cmd = TS_ACK|TS_SETCHR; i = (int)&ts_ubaddr->ts_char; ts.ts_cmd.c_loba = i; ts.ts_cmd.c_hiba = (i>>16)&3; ts.ts_cmd.c_size = sizeof(ts.ts_char); tsaddr->tsdb = ts_uba; } tsstrategy(io, TS_REW); if (io->i_cc = io->i_boff) tsstrategy(io, TS_SFORWF); } tsclose(io) register struct iob *io; { tsstrategy(io, TS_REW); } tsstrategy(io, func) register struct iob *io; { register int errcnt, info = 0; errcnt = 0; retry: while ((tsaddr->tssr & TS_SSR) == 0) DELAY(100); if (func == TS_REW || func == TS_SFORWF) ts.ts_cmd.c_repcnt = io->i_cc; else { info = ubasetup(io, 1); ts.ts_cmd.c_size = io->i_cc; ts.ts_cmd.c_loba = info; ts.ts_cmd.c_hiba = (info>>16)&3; } if (func == READ) func = TS_RCOM; else if (func == WRITE) func = TS_WCOM; ts.ts_cmd.c_cmd = TS_ACK|TS_CVC|func; tsaddr->tsdb = ts_uba; do DELAY(100) while ((tsaddr->tssr & TS_SSR) == 0); if (info) ubafree(io, info); if (ts.ts_sts.s_xs0 & TS_TMK) return (0); if (tsaddr->tssr & TS_SC) { printf("ts tape error: er=%b, xs0=%b", tsaddr->tssr, TSSR_BITS, ts.ts_sts.s_xs0, TSXS0_BITS); if (errcnt==10) { printf("ts: unrecovered error\n"); return (-1); } errcnt++; if (func == TS_RCOM || func == TS_WCOM) func |= TS_RETRY; goto retry; } if (errcnt) printf("ts: recovered by retry\n"); return (io->i_cc - ts.ts_sts.s_rbpcr); } le ((tsaddr->tssr & TS_SSR) == 0); ((sys/stand/tm.c 444 0 33 3324 2632747253 6560 /* tm.c 4.6 81/12/01 */ /* * TM11/TE?? */ #include "../h/param.h" #include "../h/inode.h" #include "../h/pte.h" #include "../h/ubareg.h" #include "saio.h" #include "savax.h" #include "../h/tmreg.h" u_short tmstd[] = { 0172520 }; tmopen(io) register struct iob *io; { register skip; tmstrategy(io, TM_REW); skip = io->i_boff; while (skip--) { io->i_cc = 0; tmstrategy(io, TM_SFORW); } } tmclose(io) register struct iob *io; { tmstrategy(io, TM_REW); } tmstrategy(io, func) register struct iob *io; { register int com, unit, errcnt; register struct tmdevice *tmaddr = (struct tmdevice *)ubamem(io->i_unit, tmstd[0]); int word, info; unit = io->i_unit; errcnt = 0; retry: tmquiet(tmaddr); com = (unit<<8); info = ubasetup(io, 1); tmaddr->tmbc = -io->i_cc; tmaddr->tmba = info; if (func == READ) tmaddr->tmcs = com | TM_RCOM | TM_GO; else if (func == WRITE) tmaddr->tmcs = com | TM_WCOM | TM_GO; else if (func == TM_SREV) { tmaddr->tmbc = -1; tmaddr->tmcs = com | TM_SREV | TM_GO; return (0); } else tmaddr->tmcs = com | func | TM_GO; for (;;) { word = tmaddr->tmcs; if (word&TM_CUR) break; } ubafree(io, info); word = tmaddr->tmer; if (word&TMER_EOT) return(0); if (word < 0) { if (errcnt == 0) printf("te error: er=%b", tmaddr->tmer, TMER_BITS); if (errcnt==10) { printf("\n"); return(-1); } errcnt++; tmstrategy(io, TM_SREV); goto retry; } if (errcnt) printf(" recovered by retry\n"); return (io->i_cc+tmaddr->tmbc); } tmquiet(tmaddr) register struct tmdevice *tmaddr; { register word; for (;;) { word = tmaddr->tmcs; if (word&TM_CUR) break; } for (;;) { word = tmaddr->tmer; if ((word&TMER_TUR) && (word&TMER_SDWN)==0) break; } } rd < 0) { if (errcnt == 0) printf("te error: er=%b", tmaddr->tmer, TMER_BITS); if (errcnt==10) { printf("\n"); return(-1); } errcnt++; tmstrategy(io, TM_SREV); goto retry; } if (errcnt) printf(" recovered by retry\n"); return (io->i_cc+tmaddr->tmbc); } tmquiet(tmaddr) regsys/stand/hp.o 664 0 33 3200 2650357022 6547 ,0^Ь[ЫTZxZPxPPP`PZQxQQQPxT~J>ЭPˏXW2G'PPXWGhWJJP P@YիXѫX ЫXP@ ;AЫXP2@P2QQPPX^Ь[ЫTЫdxPxPP P`PQxQQQPPЭQA`P P@pЭPӏ@ ЭP2$ЭPЭQ2PPQЭP2PPQRPRRQЭPЭQ2aQQPЭQ2aQQPRQRRPЭPЭ(xPPЭQPݬ[HЭPӏӏ@@ЭPˏ~HЭPˏ~ݭݭݭPЫlP&vd62M2R%s1 JTJ2" 7H `7X/8/h82 @vxunknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF < C]lt{   $    (08@I8RH[Xdhnxw_devsw_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_hp_type_hp6_off_rm3_off_rm5_off_rm80_off_hp7_off_hptypes_hpst_hpopenL30_mbainit__stop_hpstrategyL46_mbastart_printf  (08@I8RH[Xdhnxw_devsw_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_hp_sys/stand/up.c 444 0 33 4401 2522400561 6543 /* up.c 4.9 81/04/18 */ #include "../h/param.h" #include "../h/inode.h" #include "../h/upreg.h" #include "../h/pte.h" #include "../h/ubareg.h" #include "saio.h" #include "savax.h" u_short ubastd[] = { 0776700 }; char up_gottype[MAXNUBA*8] = { 0 }; char up_type[MAXNUBA*8] = { 0 }; short up_off[] = { 0, 27, 68, -1, -1, -1, -1, 82 }; short fj_off[] = { 0, 50, 0, -1, -1, -1, -1, 155 }; struct upst { short nsect; short ntrak; short nspc; short ncyl; short *off; } upst[] = { 32, 19, 32*19, 823, up_off, 32, 10, 32*10, 823, fj_off, }; upopen(io) register struct iob *io; { register struct updevice *upaddr = (struct updevice *)ubamem(io->i_unit, ubastd[0]); register struct upst *st; while ((upaddr->upcs1 & UP_DVA) == 0) ; if (up_gottype[io->i_unit] == 0) { upaddr->uphr = UPHR_MAXTRAK; if (upaddr->uphr == 9) up_type[io->i_unit] = 1; /* fuji kludge */ upaddr->upcs2 = UPCS2_CLR; up_gottype[io->i_unit] = 1; } st = &upst[up_type[io->i_unit]]; if (io->i_boff < 0 || io->i_boff > 7 || st->off[io->i_boff] == -1) _stop("up bad unit"); io->i_boff = st->off[io->i_boff] * st->nspc; } upstrategy(io, func) register struct iob *io; { int unit, nspc, ns, cn, tn, sn; daddr_t bn; int info; register short *rp; register struct updevice *upaddr = (struct updevice *)ubamem(io->i_unit, ubastd[0]); register struct upst *st = &upst[up_type[io->i_unit]]; unit = io->i_unit; bn = io->i_bn; cn = bn/st->nspc; sn = bn%st->nspc; tn = sn/st->nsect; sn = sn%st->nsect; upaddr->upcs2 = unit; if ((upaddr->upds & UPDS_VV) == 0) { upaddr->upcs1 = UP_DCLR|UP_GO; upaddr->upcs1 = UP_PRESET|UP_GO; upaddr->upof = UPOF_FMT22; } if ((upaddr->upds & UPDS_DREADY) != UPDS_DREADY) _stop("up not ready"); info = ubasetup(io, 1); rp = (short *) &upaddr->upda; upaddr->updc = cn; *rp = (tn << 8) + sn; *--rp = info; *--rp = -io->i_cc / sizeof (short); if (func == READ) *--rp = UP_RCOM|UP_GO; else *--rp = UP_WCOM|UP_GO; do { DELAY(25); } while ((upaddr->upcs1 & UP_RDY) == 0); if (upaddr->upds & UPDS_ERR) { printf("up error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b\n", cn, tn, sn, upaddr->upcs2, UPCS2_BITS, upaddr->uper1, UPER1_BITS, upaddr->uper2, UPER2_BITS); return (-1); } ubafree(io, info); return (io->i_cc); } >upda; upaddr->updc = cn; *rp = (tn << 8) + sn; *--rp = info; *--rp = -io->i_cc / sizeof (short); if (func == READ) *--rp = UP_RCOM|UP_GO; else *--rp = UP_WCOM|UP_GO; do { DELAY(25); } while ((upaddr->upcs1 & UP_RDY) == 0); if (upaddr->updssys/stand/ht.o 664 0 33 2545 2650357052 6571 ^Ь[xTPxPPP`PˏTQxQQQPYԭЭPˏQ2@PPQ֭ЭP@xT~ i[JЫXZ(l[5PЏXX[ZPZPЬ[[^Ь[xTPxPPP`PˏTQxQQQPWY2ZW gZ$ΫlѬ gPѬѬݬ[gWЧXЧX gXX gPˏ~ˏX~t]Y KPY[1@Y &2PlP Ь[ЫZZ()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry  H\dk x  G W{     (08@IQU\eqz~ _devsw_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_httypes_htopenL23__stop_mbainit_htstrategy_htcloseL43L47_htquiet_mbastart_printfL68 W{     ((sys/stand/mba.o 664 0 33 1063 2650357071 6710 ( ^Ь[xTPxPPP`xTPxPPP`PˏTQxQQQPZЫhP PˏhlPP PЭ ɏ֭ЭPΫlPЭQPЭPЭ Ѭ19xP5P`[xPPPP"PxPP *      (08@J NW[_devsw_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_mbastartL22_mbainitL31P`xTPxPPP`PˏTQxQQQPZЫhP PˏhlPP PЭ ɏ֭ЭPΫlPЭQPЭPЭ Ѭ19xP5P`[xPPPP"PxPP *      (08@J NW[_devsw_b_blknos_iob_cpu_mbaddrsys/stand/mt.o 664 0 33 2264 2650357126 6576 h^Ь[xTPxPPP`PˏTQxQQQPYԭЭPˏQ2@PPQ֭ЭP@xT~2@DXXӏD[2ЫXZl[ZPZPЬ[[Ь[xTPxPPP`PˏTQxQQQPWZѬѬ0Ыlԧݬ[ˏYYX2VV.ΫlPxPPȬPP0ˏYЧˏ,XXPPS$SS$$$$$$$$$$$gˏ~zS2@DVVӏDPx*Pˏ~MZ Z1Z ZЫlPAnot a tape mt hard error: er=%b mt error: er=%b mt: unrecovered error mt: recovered by retry  H\dk x  "       (08@IQU\eqz~_devsw_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_mttypes_mtopenL23__stop_mbainit_mtstrategy_mtcloseL43L47_mbastart_printfk x  "       (08@IQU\eqz~sys/stand/rk.o 664 0 33 2551 2650357166 6575  Ь[xTPxPPP QQ`ZЫXP@ իXѫX ЫXP2@PŏBPX Z ^Ь[xTPxPPwP jQQ`Zԭ[[PЫdTǏBPPPPPPPPPQQQPQQjZjZ2PxPP2QPQQxlPPPPxPʏPɏPѬjZ2 PPݭ[2jPPX2 ~2~2~2~2~xUjZ5ѭ 4P֭1խ ЫlPЬ[k rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry  +AH Sj  _s      (08@GOW [bjpv z_devsw_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_rkstd_rk_off_rkopenL24__stop_rkwait_rkstrategyL33_ubasetup_ubafree_printfL53 _s     sys/stand/tm.o 664 0 33 2020 2650357215 6563 lp Ь[[1ЫXZԫl[ZPZPЬ[[^Ь[xTPxPPP QQ`WЫTYXWxYZ[yPΫlPPѬZP)ѬZPѬ  ZPPPɬZPPP<ݭ[Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error  &/5 = B J R Y ` fl   ! 2 ;Ubi t            `kr ~    (08@HpPX]hqy }| _devsw_b_blknos_iob_cpu_mbaddr_mbaact_umaddr_ubaddr_udastd_cudbuf_udaddr_uda_ud_ubaddr_uda_off_udopenL29_ubasetup_udcmd__stopL51_udstrategyL62_printf_ubafreer ~    (08@HpPX]hqy }| sys/stand/machdep.o 664 0 33 247 2650357532 7537 Hڬ۬P(  #_mtprL13_mfprL18_bcopyL23rintf_ubafreer ~    (08@HpPX]hqy }/hL,hL5x< /,"sys/stand/srt0.o 664 0 33 757 2650357607 7037 8P((Џ^&PԀP^PЬSRbcPRb &0^n  ' . 4 . G <',7<B H8OSD[_end_edata_main__rtt_configure_cpu_openfirstHIGHentrystartaedataclr_badloc,"sys/stand/boot.o 664 0 33 2321 2732200412 7075  ^[xZqZ lxZP@_xZP@rxZP@cr@iTPP P[*[[cV$^Ь[ЬZ ߭Z9PYY  ѭ UݭQ ݭZP1Э֭ӏݭݭݭZPOݭY֭YYݭsh[hpuphkraxx(0,0)vmunix Boot : : %s Bad format %d+%d+%d start 0x%x Short read  %27BGOU\ dk ~      )0 ? SZ     $* 17 ((;CISY]cjq_devsw_b_blknos_iob_devname_line_retry_mainL20_printf_open_copyunix_getsL41_read__stop__exit dk ~      )0 ? SZ     $* 17 sys/stand/relsrt0.o 664 0 33 1141 2650357664 7551 LX88Џ^BPԀP^(0n ,PЬSRbcPRbz &0^n(2 9 @ F  "6 O X',7<B HTOSPXL_,e`m_end_edata_main__rtt_configure_cpu_openfirstHIGHentrystartaedataclraendabeginbegin_badloc,PЬSRbcPRbz &0^n(2 9 @ F  "6 O X',7<B HTOSPXL_,e`m_end_edsys/stand/cat.o 664 0 33 517 2650357767 6717 X`8<^M߭߭PP ݭݭPFile:   $ 8 B Q  "+17_mainL12_printf_gets_open_putchar_getc_exitX',7<B/hL,hL5< /,"sys/stand/boot.c 444 0 33 4020 2732200060 7052 /* boot.c 4.6 81/12/01 */ #include "../h/param.h" #include "../h/ino.h" #include "../h/inode.h" #include "../h/filsys.h" #include "../h/dir.h" #include "../h/vm.h" #include #include "saio.h" #include /* * Boot program... arguments passed in r10 and r11 determine * whether boot stops to ask for system name and which device * boot comes from. */ /* Types in r10 specifying major device */ char devname[][2] = { 'h','p', /* 0 = hp */ 0,0, /* 1 = ht */ 'u','p', /* 2 = up */ 'h','k', /* 3 = hk */ 0,0, /* 4 = sw */ 0,0, /* 5 = tm */ 0,0, /* 6 = ts */ 0,0, /* 7 = mt */ 0,0, /* 8 = tu */ 'r','a', /* 9 = ra */ }; char line[100] = "xx(0,0)vmunix"; int retry = 0; main() { register howto, devtype; /* howto=r11, devtype=r10 */ int io; #ifdef lint howto = 0; devtype = 0; #endif printf("\nBoot\n"); #ifdef JUSTASK howto = RB_ASKNAME|RB_SINGLE; #else if ((howto&RB_ASKNAME)==0) { if (devtype>=0 && devtype= 0) copyunix(howto, io); if (++retry > 2) howto = RB_SINGLE|RB_ASKNAME; } } /*ARGSUSED*/ copyunix(howto, io) register howto, io; { struct exec x; register int i; char *addr; i = read(io, (char *)&x, sizeof x); if (i != sizeof x || x.a_magic != 0410) _stop("Bad format\n"); printf("%d", x.a_text); if (read(io, (char *)0, x.a_text) != x.a_text) goto shread; addr = (char *)x.a_text; while ((int)addr & CLOFSET) *addr++ = 0; printf("+%d", x.a_data); if (read(io, addr, x.a_data) != x.a_data) goto shread; addr += x.a_data; printf("+%d", x.a_bss); x.a_bss += 128*512; /* slop */ for (i = 0; i < x.a_bss; i++) *addr++ = 0; x.a_entry &= 0x7fffffff; printf(" start 0x%x\n", x.a_entry); (*((int (*)()) x.a_entry))(); _exit(); shread: _stop("Short read\n"); } rmat\n"); printf("%d", x.a_text); if (read(io, (char *)0, x.a_text) != x.a_text) goto shread; addr = (char *)x.a_text; while ((int)addr & CLOFSET) *addr++ = 0; printf("+%d", x.a_data); if (read(io, addr, x.a_data) != x.a_data) goto shread; addr += x.a_data; printf("+%d", x.a_bss); x.a_bss += 128*512; /* slop */ for (i = 0; i < x.a_bss; i++) *addr++ = 0; x.a_entry &= 0x7fffffff; printf(" start 0x%x\n", x.a_entry); (*((int (*)()) x.a_entry))(); _exit(); shread: _stop("Shsys/stand/ls.o 664 0 33 1111 2650360030 6546 ^PPP ^Ь[A<<~OZJJ~9wZ+f߭[X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ZЫhP PˏhlPP PЭ ɏ֭ЭPΫlPЭQPЭPЭ Ѭ19xP=P`[xPPPP=PxPP=^Ь[xTPxPP=P`PˏTQxQQQPYԭЭPˏQ2@PPQ֭ЭP@xT~N2@DXXӏD[2ЫXZl[ZPZPЬ[[Ь[xTPxPP<P`PˏTQxQQQPWZѬѬ0Ыlԧݬ[ˏYYX2VV.ΫlPxPPȬPP0ˏYЧˏ,XXPPS$SS$$$$$$$$$$$gˏ~w 2@DVVӏDPN Pˏ~a4 Z Z1Z n ЫlP Ь[xTPxPP;P ]QQ`ZЫXP@Q իXѫX KЫXP2@)PŏBPX Z ^Ь[xTPxPP3;P QQ`Zԭ[PЫdTǏBPPPPPPPPPQQQPQQjZjZ2PxPP2QPQQxlPPPPxPʏPɏPѬjZ2 PPݭ[2jPPX~2 ~?2~2~2~2~i jZ5ѭ H P֭1խ , ЫlPЬ[k Ь[[1ЫXZԫl[ZPZPЬ[[^Ь[xTPxPPe9P QQ`WЫTYXWxYZ[PΫlPPѬZP)ѬZPѬ  ZPPPɬZPPP<ݭ[?1yWPxPPPPPYP)խ ,XX X֭鑽 ֭jЭP֭`X1!XPX11Pd1Pc1 1PlXXPPo11Pu1Ps1|1Px11 ^Ѭ լ-Gάޭ[ݬݬ@ ݬݬPP֘{~ ޭP[PЬ[20uY"PY["PZ"[~#[  Z" P!~P[[  [[j[P Ь[*P#DP@ZP +PЬ[ 4PZZPP P  Z[[ڬ۬P(  ^Ь[ԭZk96 PQPQ0QZ[[kPP P P+P-k0ZέPЭPЬZЬY[ [[ ЬPЬRRQ{RPRPPPRRPЬPЬRRQ{RPPR PRPP +PЬSRbcPRb  &0^nFile: null path %s not found bn negative bn ovf %D bn void %D bn void %D not a directory zero length directory Seek not from beginning of file No more file slotsBad device Unknown device Bad unit specifier Missing offset specification Can't write files yet.. Sorry Exit called%s Trap %o `#  c#Tf#0i#l# 4 o#n,\r#u# hpuphkrahttmtsmt`       @ ` `&vd62M2R%s1 JTJ2" 7$ `7$/#/ $#2 @v0$unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry Anot a tape mt hard error: er=%b mt error: er=%b mt: unrecovered error mt: recovered by retry rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry Pte error: er=%bILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOTts: unrecovered error ts: recovered by retry DR2 `7T) @7d)up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPEh >Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error 0123456789abcdefDR2 `7T) @7d)up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEsys/stand/icheck.o 664 0 33 13402 2650360127 7413  8d^    P ^PPPݬPPݬ ݬ qke_YSMGA;ݏ/<PPxPPPPE f v    &       + 4 ;B I O[x ~  #D J[n {            C Z u {               / N T z       .  /     $ C J. Y `1 ry      3  9  ?  E  K  Q  W  ` g  {         @4!(.4:@DIQYairz< < J~fl   @"'8/4;AFM R_sccsid_sblock_itab_iaddr_blist_bmap_sflg_mflg_dflg_fi_ino_nrfile_ndfile_nbfile_ncfile_ndirect_nindir_niindir_niiindir_nfree_ndup_nerror_mainL42L38_printf_gets_checkL47_open_bread_pass1_makefree_close_chk_alloc_dupedL93_l3tolL135L148L154_bfreeL169_bwriteL182_lseek_readL195_writeL202   @"'8/4;AFM R_sccsid_sblock_itab_iaddr_blist_bmap_sflg_mflg_dflg_fi_ino_nrfilesys/stand/ls 664 0 33 25554 2732200666 6363 Џ^!PԀP^ !^!R!ELLPPP ^Ь[A<<~W!ZJJ~A!Z3!߭[`P Ь[ԫ`PPPPXPd2lp[h[p[ZPPQxQQQPQxQPPZj Ъ Z~[~ ^Ь[kj &X[k/[ZjZj/jjݬ[gP8ݬP0jZ[[F Pݬ<~kЭP^Ь[Ь[Yլ  1eѬ ЬZJЭPԭ xѬ ­׭խխ ݬ1jí P@ݬ1Q֭ѭЭP@8CxPXPdx P@(h2l[x P@(ЭPЭ@8x P@(έPxPPPZJ1|ݬ<1 ^Ь[լ1[Y<PʏPP@ 10 12ԭd֭ѭ@>ЭP֭P[pPPXPdp[h2l[-p[ZԭZ~ݬPnP" "PPAPgP11xP'DP`!PxPDP`P֭vKC C%CH@C%C"Cԭ&CCԭЭԭѭ1Oԭ/xP}CP`kPxPdCP`P֭ѭխ Џ[[^Ь[ЫTZxZPxPPCP`PZQxQQQPxT~Ju>ЭPˏXW2GPPXWG WJ5J.P P@YիXѫX ЫXP@ ?ЫXP2@P2QQPPX^Ь[ЫTЫdxPxPP=BP`PQxQQQPPЭQA`P P@ЭPӏ@ ЭP2$ЭPЭQ2PPQЭP2PPQRPRRQЭPЭQ2aQQPЭQ2aQQPRQRRPЭPЭ(xPPЭQPݬ[XЭPӏӏ@@+ЭPˏ~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ZPP P  Z[[ڬ۬P(  ^Ь[ԭZk96 PQPQ0QZ[[kPP P P+P-k0ZέPЭPЬZЬY[ [[ ЬPЬRRQ{RPRPPPRRPЬPЬRRQ{RPPR PRPPl+`PЬSRbcPRb  &0^nls : %d %c null path %s not found bn negative bn ovf %D bn void %D bn void %D not a directory zero length directory Seek not from beginning of file No more file slotsBad device Unknown device Bad unit specifier Missing offset specification Can't write files yet.. Sorry Exit called%s Trap %o #H t < #j< #< #< #` N ##T>#Hx6hpuphkrahttmtsmt`       @ ` `&vd62M2R%s1 JTJ2" 7`$ `7p$/P$/$P$2 @v$unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry Anot a tape mt hard error: er=%b mt error: er=%b mt: unrecovered error mt: recovered by retry rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry Pte error: er=%bILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOTts: unrecovered error ts: recovered by retry DR2 `7) @7)up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPEh >Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error 0123456789abcdefDR2 `7) @7)up bad unitup not rsys/stand/mkfs.o 664 0 33 14672 2650360210 7130 < |<^< ' ߭߭P߭PPԬ}1ԭԭ:ѭ0ѭ9^ QH P0QQP֭0PЭQA`Э ѭ2PPx~b a Ѭ\ЬPݠ P ЬPݠP P P 2     H'<2PP~+ ԭPЭQA`ݭ'z֭ЭPΜ^ݏ@ݏ ݏ`ݏ X~Pݏ 5~_P<-QPQNPRP6ͬiͬͬP@Ͱͬ  1t1\Ͱͬ߭ ^CЬP<PPPЭP<}QPQq b[TݭFDЬP<PPPQxQQQPQxQPPЬPЬPЭQЬPЭQ ЬPЭQ ЬPЭQРЭP4ЭP8ЭP<ЬP<PʏPP 1P@P`P1ԭ!ѭ "ЭPPQRxQQQR@ b֭ѭѼ EЬQP<ԭ PЭQ@ A P@ ݬ ЬPݠ<c ~ ~ݭ@ЬP<~ePfile sys size: file system: %s: cannot open isize = %D d--777 0 0 $ m/n = %d %d %ld/%ld: bad ratio -bcd-u-g%c/%s: bad octal mode digit %s: cannot open ...%c/%s: bad mode %s: bad number EOF read error: %ld write error: %D out of free space indirect block full too many bad blocks ilist too small bad mode %o @(#)mkfs.c 4.2 (Berkeley) 4/20/81  "' -4 > J Q ] d j v      # 7 >L Siow|             '. ; G NW] b h q    1 ;B I ~  M^fn u    ! " %0DSm s      % +2 9 T r      *  '! =D M ` g* v },               6 < G L ] c r |      " U \  c  p  w        %  +  w ~        # 0 ; Y e          ,  8    7     $  -  < ").42<BHO@ TD Y`ekos{R| vj ^ l   %*,16;@E4 MRY^_sccsid_utime_fin_fsi_fso_charp_buf_fbun_string_fsun_fsys_proto_f_n_f_m_error_ino_mainL36L32_printf_gets_open_exit_atoi_wtfs_bflist_cfileL73_getstr_g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ize: %ld, %u Not enough core; duplicates unchecked freefiles %u (r=%u,d=%u,b=%u,c=%u) used %ld (i=%ld,ii=%ld,iii=%ld,d=%ld) free %ld %ld missing missing%5ld bad mode %u data (small)1st indirectdata (large)2nd indirectdata (huge)3rd indirectdata (garg)%ld bad; inode=%u, class=%s %ld dup; inode=%u, class=%s %ld arg; inode=%u, class=%s Bad free list, s.b. count = %d Bad free list, entry count of block %ld = %d read error %ld No update write error %ld @(#)icheck.c 4.2 (Berkeley) 81/02/07null path %s not found bn negative bn ovf %D bn void %D bn void %D not a directory zero length directory Seek not from beginning of file No more file slotsBad device Unknown device Bad unit specifier Missing offset specification Can't write files yet.. Sorry Exit called%s Trap %o Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error 0123456789abcdefDR2 `705 @7@5up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTEsys/stand/restor.o 664 0 33 17612 2650360313 7507  D^ ݏr ^ PP PPR Pr p߭f߭ZPSPK Z 0)P ݏ< PPxPPPQ P1   P  K l P$ uo P^VY P* =70* P1 1P[#<3~+ %[  P PP͜P͜PݬݏݬgP`x PP@I  CЬ[ЬZЬ YY Ь[2ZZ[[?ŏ[Pzݏŏ[P@ݬŏ[Px ~ݏݬPݬzŏ[P[1\ Z[YRŏGP3ݬ ݬŏ+P@+ŏPŏPŏZPŏQZ[[1ex ~ݏŏZP@Pݬvmݬ ݬŏZP@`ŏZPŏZPЬ^<PӏPЬԽ׭ 8^Ь[kF<^<+PP~Pݏݭݏ@ݬ<PP~xPPQQP~^<PӏPf F M T c h            )! /5 <FLS \! b io v      &      ) * 6* G S Y ag o v|               % ,3 9 ? D L SZ f k q w       /    3  h n v      'V ]i p   8    !  &  % 29 @ JRZa nx   (6 C J? Y `@ ry !              $ , D K? ` f m8  !     6 / O y            $ *  4  :  @  O  W  ]  e  o v   !        F k      > E  l          *  ) ' B  J  V * o  )       !  d#)15 ?H2NU\@b@h4ow   ( " d P      */4 =EK, T[ e o~x     F    %*/ 49>CHMRW ]b_sccsid_spcl_sblock_fi_ino_maxi_curino_mt_tapename_magtape_mbuf_eflag_volno_tino_dino_taddr_curbno_dumpmap_clrimap_bct_tbf_cache_curcache_mainL37_doitL44_printf_gets_open_getchar_dread_readhdr_exit_checkvol_gethead_ishead_checktype_close_dwrite_readbitsuremudiv_getdino_itrunc_clri_putdino_l3tol_rstrskip_rstrfile_getfile_ltol3L118_readtape_clearbufL141_read_flsht_copyL165L169L176L183_lseek_writeL195L207L215_bfree_tloopL233L243_ballocL256L252_bmapL264L279_checksumL285L290L294L303L308L314L318L322L326L331_doneL339_dino_taddr_curbno_dumpmap_clrimap_bct_tbf_cache_curcache_mainL37_doitL44_printf_gets_open_getchar_drsys/stand/mkfs 664 0 33 34734 2732200711 6674 Џ^.PԀP^E0^.)_q,RqE.)߭j,߭P_9߭{PH9F9P29Ԭ)91ԭԭ:ѭ0ѭ9VE>.A) P0QQP֭(EPЭQA`ЭAѭ2PP@x~-(-8Ѭ\ЬPݠ ,P-ЬPݠx,Pi-P P 2S-Q- I-@-;-5-D&-D--`-8(<6@PP2@'<&@PP~@?- (CCԭ7PЭQA`7ݭ'nC֭ЭP~~PͤQA`͜͜0͜7">͜+&B͜0͜PͤQQQxQPPЭP֭P[pPPXPdp[h2l[-p[ZԭZ~ݬPnP##PPAPgP11xPQP`PxPQP`P֭v/QQ QH$Q QQԭ QvQԭЭԭѭ1Oԭ/xPUQP`PxPЭPˏXW2GPPXWGWJJP P@YիXѫX ЫXP@ ?ЫXP2@P2QQPPX^Ь[ЫTЫdxPxPPPP`PQxQQQPPЭQA`P P@ЭPӏ@ ЭP2$ЭPЭQ2PPQЭP2PPQRPRRQЭPЭQ2aQQPЭQ2aQQPRQRRPЭPЭ(xPPЭQPݬ[XЭPӏӏ@@ЭPˏ~ЭPˏ~ݭݭݭPЫlP^Ь[xTPxPPNP`PˏTQxQQ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Z"[~#[  Z" P!~P[[  [[j[P Ь[*P#DP@ZP +PЬ[ 4PZZPP P  Z[[ڬ۬P(  ^Ь[ԭZk96 PQPQ0QZ[[kPP P P+P-k0ZέPЭPЬZЬY[ [[ ЬZЬY[ Y[[ Ь[ZYk94 ZPQPQ0QZY[[kPP P P+P-k0YZPZPЬPЬRRQ{RPRPPPRRPЬPЬRRQ{RPPR PRPP9\PЬSRbcPRb  &0^nL0file sys size: file system: %s: cannot open isize = %D d--777 0 0 $ m/n = %d %d %ld/%ld: bad ratio -bcd-u-g%c/%s: bad octal mode digit %s: cannot open ...%c/%s: bad mode %s: bad number EOF read error: %ld write error: %D out of free space indirect block full too many bad blocks ilist too small bad mode %o @(#)mkfs.c 4.2 (Berkeley) 4/20/81null path %s not found bn negative bn ovf %D bn void %D bn void %D not a directory zero length directory Seek not from beginning of file No more file slotsBad device Unknown device Bad unit specifier Missing offset specification Can't write files yet.. Sorry Exit called%s Trap %o 0232$8$6292)'<2?2R  @ ((B2"|!"E2hpuphkrahttmtsmt`       @ ` `&vd62M2R%s1 JTJ2" 72 `72/2/222 @v3unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry Anot a tape mt hard error: er=%b mt error: er=%b mt: unrecovered error mt: recovered by retry rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry Pte error: er=%bILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOTts: unrecovered error ts: recovered by retry DR2 `7$8 @748up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPEh >Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error 0123456789abcdefsys/stand/mt.c 444 0 33 4104 2633227302 6542 /* mt.c 4.1 81/12/01 */ /* * TM78/TU78 tape driver */ #include "../h/mtreg.h" #include "../h/param.h" #include "../h/inode.h" #include "../h/pte.h" #include "../h/mbareg.h" #include "saio.h" #include "savax.h" short mttypes[] = { MBDT_TU78, 0 }; #define MASKREG(reg) ((reg)&0xffff) mtopen(io) register struct iob *io; { register int skip; register struct mtdevice *mtaddr = (struct mtdevice *)mbadrv(io->i_unit); int i; for (i = 0; mttypes[i]; i++) if (mttypes[i] == (mtaddr->mtdt&MBDT_TYPE)) goto found; _stop("not a tape\n"); found: mbainit(UNITTOMBA(io->i_unit)); mtaddr->mtid = MTID_CLR; DELAY(250); while ((mtaddr->mtid & MTID_RDY) == 0) ; mtstrategy(io, MT_REW); skip = io->i_boff; while (skip--) { io->i_cc = -1; mtstrategy(io, MT_SFORWF); } } mtclose(io) register struct iob *io; { mtstrategy(io, MT_REW); } mtstrategy(io, func) register struct iob *io; int func; { register int errcnt, s, ic; register struct mtdevice *mtaddr = (struct mtdevice *)mbadrv(io->i_unit); errcnt = 0; retry: if (func == READ || func == WRITE) { mtaddr->mtca = 1<<2; /* 1 record */ mtaddr->mtbc = io->i_cc; mtaddr->mter = 0; mbastart(io, func); do s = mtaddr->mter & MTER_INTCODE; while (s == 0); ic = s; DELAY(2000); } else { mtaddr->mtas = -1; mtaddr->mtncs[0] = (-io->i_cc << 8)|func|MT_GO; rwait: do s = mtaddr->mtas&0xffff; while (s == 0); mtaddr->mtas = mtaddr->mtas; /* clear attention */ ic = mtaddr->mtner & MTER_INTCODE; } switch (ic) { case MTER_TM: case MTER_EOT: case MTER_LEOT: return (0); case MTER_DONE: break; case MTER_RWDING: goto rwait; default: printf("mt hard error: er=%b\n", MASKREG(mtaddr->mter)); mtaddr->mtid = MTID_CLR; DELAY(250); while ((mtaddr->mtid & MTID_RDY) == 0) ; return (-1); case MTER_RETRY: printf("mt error: er=%b\n", MASKREG(mtaddr->mter)); if (errcnt == 10) { printf("mt: unrecovered error\n"); return (-1); } errcnt++; goto retry; } if (errcnt) printf("mt: recovered by retry\n"); return (io->i_cc); /* NO PARTIAL RECORD READS!!! */ } break; case MTER_RWDING: goto rwait; default: printf("mt hard error: er=%b\n", MASKREG(mtaddr->mter)); mtaddr->mtid = MTID_CLR; DELAY(250); while ((mtaddr->mtid & MTID_RDY) == 0) ; return (-1); case MTER_RETRY: printf("mt error: er=%b\n", MASKREG(mtaddr->mter)); if (errcnt == 10) { printf("mt: unrecovered error\n"); return (-1); } errcnt++; goto retry; } if (errcnt) printf("mt: recovered bsys/stand/tpsrt0.o 664 0 33 743 2650360342 7364 4P (Џ^"PԀP^PЬSRbcPRb &0^n  ' .  . G 8',7<B H4OS@[_end_edata_main__rtt_configure_cpu_openfirstHIGHentrystartaedataclr_badloc,"sys/stand/restor 664 0 33 35254 2732200726 7256 Џ^.PԀP^`1^1/ /ݏr ^/s*B"-rBCP\BPUB.PPR Pr.*߭,߭PAPw...)[,P ݏ=<=PPxPPPAp9Q P].)A.C9 P-A.Q)9K 9l P$$.)8 PNA8Y P*.(@\=8 P1a @1<@PP~^,P<~@PP~n,PPxQQQ2cPQPJ@<:>~1Μ^(d5͜>[[#Kw͜Ѭ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Y[ [[ ЬZЬY[ Y[[ ЬPЬRRQ{RPRPPPRRPЬPЬRRQ{RPPR PRPP:PЬSRbcPRbr  &0^n1/dev/rmt8\/ tapeTape? Disk? Last chance before scribbling on %s. diskMissing volume record Tape is not volume %d Missing header block End of tape Unknown header type Resynced at inode %u %u: ilist too small Missing address (header) block Tape read error: inode %u Mount volume %d Cannot open tape! Not a dump tape.Try again Wrong tape. Try again disk write error %D read error %D Out of space Checksum error %o @(#)restor.c 4.3 (Berkeley) 6/3/81null path %s not found bn negative bn ovf %D bn void %D bn void %D not a directory zero length directory Seek not from beginning of file No more file slotsBad device Unknown device Bad unit specifier Missing offset specification Can't write files yet.. Sorry Exit called%s Trap %o 33%$3< 3J*H( 33 ! 3#4"#3zhpuphkrahttmtsmt`       @ ` `&vd62M2R%s1 JTJ2" 73 `73/3/332 @v3unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry Anot a tape mt hard erro((r: er=%b mt error: er=%b mt: unrecovered error mt: recovered by retry rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry Pte error: er=%bILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOTts: unrecovered error ts: recovered by retry DR2 `78 @79up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPEh >Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error 0123456789abcdefDR2 `78 @79up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIsys/stand/conf.c.sam 444 0 33 2205 2650401574 7632 /* conf.c 4.9 81/12/01 */ #include "../h/param.h" #include "../h/inode.h" #include "../h/pte.h" #include "../h/mbareg.h" #include "saio.h" devread(io) register struct iob *io; { return( (*devsw[io->i_ino.i_dev].dv_strategy)(io, READ) ); } devwrite(io) register struct iob *io; { return( (*devsw[io->i_ino.i_dev].dv_strategy)(io, WRITE) ); } devopen(io) register struct iob *io; { (*devsw[io->i_ino.i_dev].dv_open)(io); } devclose(io) register struct iob *io; { (*devsw[io->i_ino.i_dev].dv_close)(io); } nullsys() { ; } int nullsys(); int hpstrategy(), hpopen(); int htstrategy(), htopen(), htclose(); int upstrategy(), upopen(); int tmstrategy(), tmopen(), tmclose(); int tsstrategy(), tsopen(), tsclose(); int mtstrategy(), mtopen(), mtclose(); int rkstrategy(), rkopen(); int udstrategy(), udopen(); struct devsw devsw[] = { "hp", hpstrategy, hpopen, nullsys, "ht", htstrategy, htopen, htclose, "up", upstrategy, upopen, nullsys, "tm", tmstrategy, tmopen, tmclose, "hk", rkstrategy, rkopen, nullsys, "ts", tsstrategy, tsopen, tsclose, "mt", mtstrategy, mtopen, mtclose, "ra", udstrategy, udopen, nullsys, 0,0,0,0 }; n(); int tmstrategy(), tmopen(), tmclose(); int tsstrategy(), tsopen(), tsclose(); int mtstrategy(), mtopen(), mtclose(); int rkstrategy(), rkopen(); int udstrategy(), udopen(); struct devsw devsw[] = { "hp", hpstrategy, hpopen, nullsys, "ht", htstrategy, htopen, htclose, "up", upstrategy, upopen, nullsys, "tm", tmstrategy, tmopen, tmclose, "hk", rkstrategy, rkopen, sys/stand/tpicheck 664 0 33 33344 2732200736 7531 Џ^*PԀP^lM-^z*&N) P ^EPPPݬHP5Pݬ*A&Bݬ*)& ݏ59<5PPxPPP更5P<5QQPPPѭ<5~5*%P *q%G9;[ #PK`[[[Dݏ@8[CZ  xZP@8Z[܀Ҁ<8[ݏ4[w83切[)ݭDP9PY"1eѬ ЬZJЭPԭ xѬ ­׭խխ ݬ!1jí P@ݬ!1Q֭ѭЭP@ CxPXPdx P@wh2l[x P@vЭPЭ@نx P@vέPxPPPZJ1|ݬd!1 ^Ь[լ1[Y<PʏPP@ 9!10 9!12ԭd֭ѭ@>ЭP֭P[pPPXPdp[h2l[-p[ZԭZ~ݬPnP:$4$PPAPgP11xPP`!PxPP`P֭vsʑHˑM1HhMJԭNGrԭЭԭѭ1Oԭ/xPQP`kPxP8P`P֭ѭխ Џ[[^Ь[ЫTZxZPxPPP`PZQxQQQPxT~J>ЭPˏXW2GPPXWG4WJ]JVP P@YիXѫX ЫXP@ ?ЫXP2@P2QQPPX^Ь[ЫTЫdxPxPPP`PQxQQQPPЭQA`P P@<ЭPӏ@ ЭP2$ЭPЭQ2PPQЭP2PPQRPRRQЭPЭQ2aQQPЭQ2aQQPRQRRPЭPЭ(xPPЭQPݬ[XЭPӏӏ@@SЭPˏ~ЭPˏ~ݭݭݭPЫlP^Ь[xTPxPP׎P`PˏTQxQQQPYԭЭPˏQ2@PPQ֭ЭP@wxT~: i[JЫXZ(l[5PЏXX[ZPZPЬ[[^Ь[xTPxPPP`PˏTQxQQQPWY2ZW gZ$ΫlѬ gPѬѬݬ[gWЧX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(  ^Ь[ԭZk96 PQPQ0QZ[[kPP P P+P-k0ZέPЭPЬZЬY[ [[ ЬPЬRRQ{RPRPPPRRPЬPЬRRQ{RPPR PRPP6PЬSRbcPRb  &0^nP-File: cannot open %s %s: Check fsize and isize: %ld, %u Not enough core; duplicates unchecked freefiles %u (r=%u,d=%u,b=%u,c=%u) used %ld (i=%ld,ii=%ld,iii=%ld,d=%ld) free %ld %ld missing missing%5ld bad mode %u data (small)1st indirectdata (large)2nd indirectdata (huge)3rd indirectdata (garg)%ld bad; inode=%u, class=%s %ld dup; inode=%u, class=%s %ld arg; inode=%u, class=%s Bad free list, s.b. count = %d Bad free list, entry count of block %ld = %d read error %ld No update write error %ld @(#)icheck.c 4.2 (Berkeley) 81/02/07null path %s not found bn negative bn ovf %D bn void %D bn void %D not a directory zero length directory Seek not from beginning of file No more file slotsBad device Unknown device Bad unit specifier Missing offset specification Can't write files yet.. Sorry Exit called%s Trap %o 8/;/! >/HA/V&T$D/G/J/@M/hpuphkrahttmtsmt`       @ ` `&vd62M2R%s1 JTJ2" 7/ `7//////2 @v0unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry Anot a tape mt hard error: er=%b mt error: er=%b mt: unrecovered error mt: recovered by retry rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry Pte error: er=%bILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOTts: unrecovered error ts: recovered by retry DR2 `7,5 @7<5up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPEh >Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error 0123456789abcdefDR2 `7,5 @7<5up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLEsys/stand/tpmkfs 664 0 33 34730 2732200750 7237 Џ^.PԀP^A0^.)_q,RqE.)߭j,߭P_9߭{PH9F9P29Ԭ)91ԭԭ:ѭ0ѭ9VE>.A) P0QQP֭(EPЭQA`ЭAѭ2PP@x~-(-8Ѭ\ЬPݠ ,P-ЬPݠx,Pi-P P 2S-Q- I-@-;-5-D&-D--`-8(<6@PP2@'<&@PP~@?- (CCԭ7PЭQA`7ݭ'nC֭ЭP~~PͤQA`͜͜0͜7">͜+&B͜0͜PͤQQQxQPPЭP֭P[pPPXPdp[h2l[-p[ZԭZ~ݬPnP##PPAPgP11xPQP`PxPQP`P֭v/QQ QH$Q QQԭ QvQԭЭԭѭ1Oԭ/xPUQP`PxPЭPˏXW2GPPXWGWJJP P@YիXѫX ЫXP@ ?ЫXP2@P2QQPPX^Ь[ЫTЫdxPxPPPP`PQxQQQPPЭQA`P P@ЭPӏ@ ЭP2$ЭPЭQ2PPQЭP2PPQRPRRQЭPЭQ2aQQPЭQ2aQQPRQRRPЭP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PPo11Pu1Ps1|1Px11 ^Ѭ լ-Gάޭ[ݬݬ;@ ݬݬNPP֘{~ ޭP[PЬ[20uY"PY["PZ"[~#[  Z" P!~P[[  [[j[P Ь[*P#DP@ZP +PЬ[ 4PZZPP P  Z[[ڬ۬P(  ^Ь[ԭZk96 PQPQ0QZ[[kPP P P+P-k0ZέPЭPЬZЬY[ [[ ЬZЬY[ Y[[ Ь(([ZYk94 ZPQPQ0QZY[[kPP P P+P-k0YZPZPЬPЬRRQ{RPRPPPRRPЬPЬRRQ{RPPR PRPP9`PЬSRbcPRb  &0^nH0file sys size: file system: %s: cannot open isize = %D d--777 0 0 $ m/n = %d %d %ld/%ld: bad ratio -bcd-u-g%c/%s: bad octal mode digit %s: cannot open ...%c/%s: bad mode %s: bad number EOF read error: %ld write error: %D out of free space indirect block full too many bad blocks ilist too small bad mode %o @(#)mkfs.c 4.2 (Berkeley) 4/20/81null path %s not found bn negative bn ovf %D bn void %D bn void %D not a directory zero length directory Seek not from beginning of file No more file slotsBad device Unknown device Bad unit specifier Missing offset specification Can't write files yet.. Sorry Exit called%s Trap %o ,2/2$4$2252)'82;2N < >2"x!"A2hpuphkrahttmtsmt`       @ ` `&vd62M2R%s1 JTJ2" 72 `72/2/222 @v2unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry Anot a tape mt hard error: er=%b mt error: er=%b mt: unrecovered error mt: recovered by retry rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry Pte error: er=%bILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOTts: unrecovered error ts: recovered by retry DR2 `7 8 @708up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPEh >Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error 0123456789abcdefsys/stand/uda.c 444 0 33 5561 2632747315 6715 /* uda.c 4.1 81/12/01 */ /* * UDA50/RAxx disk device driver */ #include "../h/param.h" #include "../h/inode.h" #include "../h/pte.h" #include "../h/ubareg.h" #include "saio.h" #include "savax.h" /* * Parameters for the communications area */ #define NRSPL2 0 #define NCMDL2 0 #define NRSP (1<i_unit, udastd[0]); if (ud_ubaddr == 0) { cudbuf.i_ma = (caddr_t)&uda; cudbuf.i_cc = sizeof(uda); ud_ubaddr = (struct uda *)ubasetup(&cudbuf, 2); } udaddr->udaip = 0; while ((udaddr->udasa & UDA_STEP1) == 0) ; udaddr->udasa = UDA_ERR; while ((udaddr->udasa & UDA_STEP2) == 0) ; udaddr->udasa = (short)&ud_ubaddr->uda_ca.ca_ringbase; while ((udaddr->udasa & UDA_STEP3) == 0) ; udaddr->udasa = (short)(((int)&ud_ubaddr->uda_ca.ca_ringbase) >> 16); while ((udaddr->udasa & UDA_STEP4) == 0) ; udaddr->udasa = UDA_GO; uda.uda_ca.ca_rspdsc[0] = (long)&ud_ubaddr->uda_rsp.mscp_cmdref; uda.uda_ca.ca_cmddsc[0] = (long)&ud_ubaddr->uda_cmd.mscp_cmdref; uda.uda_cmd.mscp_cntflgs = 0; if (udcmd(M_OP_STCON) == 0) { _stop("ra: open error, STCON"); return; } uda.uda_cmd.mscp_unit = io->i_unit&7; if (udcmd(M_OP_ONLIN) == 0) { _stop("ra: open error, ONLIN"); return; } if (io->i_boff < 0 || io->i_boff > 7 || uda_off[io->i_boff] == -1) _stop("ra: bad unit"); io->i_boff = uda_off[io->i_boff]; } struct mscp * udcmd(op) int op; { struct mscp *mp; int i; uda.uda_cmd.mscp_opcode = op; uda.uda_rsp.mscp_header.uda_msglen = sizeof (struct mscp); uda.uda_cmd.mscp_header.uda_msglen = sizeof (struct mscp); uda.uda_ca.ca_rspdsc[0] |= UDA_OWN|UDA_INT; uda.uda_ca.ca_cmddsc[0] |= UDA_OWN|UDA_INT; i = udaddr->udaip; for (;;) { if (uda.uda_ca.ca_cmdint) uda.uda_ca.ca_cmdint = 0; if (uda.uda_ca.ca_rspint) break; } uda.uda_ca.ca_rspint = 0; mp = &uda.uda_rsp; if (mp->mscp_opcode != (op|M_OP_END) || (mp->mscp_status&M_ST_MASK) != M_ST_SUCC) return(0); return(mp); } udstrategy(io, func) register struct iob *io; { register struct mscp *mp; int ubinfo; ubinfo = ubasetup(io, 1); mp = &uda.uda_cmd; mp->mscp_lbn = io->i_bn; mp->mscp_unit = io->i_unit&7; mp->mscp_bytecnt = io->i_cc; mp->mscp_buffer = (ubinfo & 0x3ffff) | (((ubinfo>>28)&0xf)<<24); if ((mp = udcmd(func == READ ? M_OP_READ : M_OP_WRITE)) == 0) { printf("ra: I/O error\n"); ubafree(io, ubinfo); return(-1); } ubafree(io, ubinfo); return(io->i_cc); } ) != M_ST_SUCC) return(0); return(mp); } udstrategy(io, func) register struct iob *io; { register struct mscp *mp; int ubinfo; ubinfo sys/stand/tprestor 664 0 33 35250 2732200757 7622 Џ^.PԀP^\1^1/ /ݏr ^/s*B"-rBCP\BPUB.PPR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ݬݬPP֘{~ ޭP[PЬ[20uY"PY["PZ"[~#[  Z" P!~P[[  [[j[P Ь[*P#DP@ZP +PЬ[ 4PZZPP P  Z[[ڬ۬P(  ^Ь[ԭZk96 PQPQ0QZ[[kPP P P+P-k0ZέPЭPЬZЬY[ [[ ЬZЬY[ Y[[ ЬPЬRRQ{RPRPPPRRPЬPЬRRQ{RPPR PRPP:PЬSRbcPRbr  &0^n1/dev/rmt8X/ tapeTape? Disk? Last chance before scribbling on %s. diskMissing volume record Tape is not volume %d Missing header block End of tape Unknown header type Resynced at inode %u %u: ilist too small Missing address (header) block Tape read error: inode %u Mount volume %d Cannot open tape! Not a dump tape.Try again Wrong tape. Try again disk write error %D read error %D Out of space Checksum error %o @(#)restor.c 4.3 (Berkeley) 6/3/81null path %s not found bn negative bn ovf %D bn void %D bn void %D not a directory zero length directory Seek not from beginning of file No more file slotsBad device Unknown device Bad unit specifier Missing offset specification Can't write files yet.. Sorry Exit called%s Trap %o 2|2%$|38|3F*D(|3 3! 3#0"~#3vhpuphkrahttmtsmt`       @ ` `&vd62M2R%s1 JTJ2" 73 `7((3/3/332 @v3unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry Anot a tape mt hard error: er=%b mt error: er=%b mt: unrecovered error mt: recovered by retry rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry Pte error: er=%bILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOTts: unrecovered error ts: recovered by retry DR2 `78 @79up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPEh >Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error 0123456789abcdefDR2 `78 @79up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE sys/stand/errs 664 0 33 3456 2650402414 6667 cc -O -DSTANDALONE -DVAX780 -DVAX750 -DVAX7ZZ -c conf.c ar crv /usr/lib/libsa.a conf.o r - conf.o ranlib /usr/lib/libsa.a cc -O -DSTANDALONE -DVAX780 -DVAX750 -DVAX7ZZ -c boot.c ld -N -T 70000 relsrt0.o boot.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=boot ibs=32 skip=1; rm b.out 361+1 records in 22+1 records out ld -N srt0.o cat.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=cat ibs=32 skip=1; rm b.out 344+1 records in 21+1 records out ld -N srt0.o ls.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=ls ibs=32 skip=1; rm b.out 347+1 records in 21+1 records out ld -N srt0.o icheck.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=icheck ibs=32 skip=1; rm b.out 439+1 records in 27+1 records out ld -N srt0.o mkfs.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=mkfs ibs=32 skip=1; rm b.out 462+1 records in 28+1 records out ld -N srt0.o restor.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=restor ibs=32 skip=1; rm b.out 469+1 records in 29+1 records out ld -N tpsrt0.o icheck.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=tpicheck ibs=32 skip=1; rm b.out 439+1 records in 27+1 records out ld -N tpsrt0.o mkfs.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=tpmkfs ibs=32 skip=1; rm b.out 462+1 records in 28+1 records out ld -N tpsrt0.o restor.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=tprestor ibs=32 skip=1; rm b.out 469+1 records in 29+1 records out cp boot.c sboot.c; chmod +w sboot.c cc -c -O -DJUSTASK sboot.c rm sboot.c ld -N -T 70000 relsrt0.o sboot.o -lsa -lc cp a.out b.out; strip b.out; dd if=b.out of=sboot ibs=32 skip=1; rm b.out 359+1 records in 22+1 records out cp tprestor $DESTDIR/tp/restor cp tpicheck $DESTDIR/tp/icheck cp tpmkfs $DESTDIR/tp/mkfs cp sboot $DESTDIR/tp/boot cp boot icheck mkfs restor cat ls ../floppy cp boot $DESTDIR cp a.out b.out; strip b.out; dd if=b.out of=tprestor ibs=32 skip=1; rm b.out 469+1 records in 29+1 records out cp boot.c sboot.c; chmod +w sboot.c cc -c -O -DJUSTASK sboot.c rm sboot.c ld -N -T 70000 relsrt0.osys/stand/sboot.o 664 0 33 2161 2732240175 7274 p ^[[YJ5PP P[ w$^Ь[ЬZ ߭ZoPYY  ѭ SPݭO@ݭZ2P1Э֭ӏݭݭݭZPOݭY֭YYݭhpuphkraxx(0,0)vmunix Boot : : %s Bad format %d+%d+%d start 0x%x Short read  ! '. 6<C KR em      $ LS ^ dk  p$*17 ;CIOvY]cjq_devsw_b_blknos_iob_devname_line_retry_mainL20_printf_gets_open_copyunixL38_read__stop__exit. 6<C KR em      $ LS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Э ɏ֭ЭPΫlPЭQPЭPЭ Ѭ19xP>P`[xPPPP>PxPP>^Ь[xTPxPPo>P`PˏTQxQQQPYԭЭPˏQ2@PPQ֭ЭP@oxT~N2@DXXӏD[2ЫXZl[ZPZPЬ[[Ь[xTPxPP=P`PˏTQxQQQPWZѬѬ0Ыlԧݬ[ˏYYX2VV.ΫlPxPPȬPP0ˏYЧˏ,XXPPS$SS$$$$$$$$$$$gˏ~Rw 2@DVVӏDPPN Pˏ~%4 Z Z1Z 2 ЫlP Ь[xTPxPPj<P !QQ`ZЫXP@ իXѫX ЫXP2@PŏBPX Z ^Ь[xTPxPP;P QQ`Zԭ[PЫdTǏBPPPPPPPPPQQQPQQjZjZ2PxPP2QPQQxlPPPPxPʏPɏPѬjZ2 PPݭ[2jPPXB2 ~2~2~2~2~i jZ5ѭ IH P֭1խ D, ЫlPЬ[k Ь[[1ЫXZԫl[ZPZPЬ[[^Ь[xTPxPP):P QQ`WЫTYXWxYZ[PΫlPPѬZP)ѬZPѬ  ZPPPɬZPPP<ݭ[?1yWPxPPPPPYP)խ ,XX X֭鑽 ֭jЭP֭`X1!XPX11Pd1Pc1 1PlXXPPo11Pu1Ps1|1Px11 ^Ѭ լ-Gάޭ[ݬݬ@ ݬݬPP֘{~ ޭP[PЬ[20uY"PY["PZ"[~#[  Z" P!~P[[  [[j[P Ь[*P#DP@ZP +PЬ[ 4PZZPP P  Z[[ڬ۬P(  ^Ь[ԭZk96 PQPQ0QZ[[kPP P P+P-k0ZέPЭPЬZЬY[ [[ ЬPЬRRQ{RPRPPPRRPЬPЬRRQ{RPPR PRPP,X-`PЬSRbcPRbF  &0^nhpuphkraxx(0,0)vmunix Boot : : %s Bad format %d+%d+%d start 0x%x Short read null path %s not found bn negative bn ovf %D bn void %D bn void %D not a directory zero length directory Seek not from beginning of file No more file slotsBad device Unknown device Bad unit specifier Missing offset specification Can't write files yet.. Sorry Exit called%s Trap %o l%8 d  o%Z r%x u% x%P| >{%t~%D.%8h&hpuphkrahttmtsmt`       @ ` `&vd62M2R%s1 JTJ2" 7 & `7&/%/,&%2 @v<&unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry Anot a tape mt hard error: er=%b mt error: er=%b mt: unrecovered error mt: recovered by retry rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry Pte error: er=%bILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOTts: unrecovered error ts: recovered by retry DR2 `7`+ @7p+up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPEh >Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error 0123456789abcdefDR2 `7`+ @7p+up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM sys/stand/a.out 755 0 33 36224 2732240200 6754 " + Џ^"PԀP^(|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o>P`PˏTQxQQQPYԭЭPˏQ2@PPQ֭ЭP@oxT~N2@DXXӏD[2ЫXZl[ZPZPЬ[[Ь[xTPxPP=P`PˏTQxQQQPWZѬѬ0Ыlԧݬ[ˏYYX2VV.ΫlPxPPȬPP0ˏYЧˏ,XXPPS$SS$$$$$$$$$$$gˏ~Rw 2@DVVӏDPPN Pˏ~%4 Z Z1Z 2 ЫlP Ь[xTPxPPj<P !QQ`ZЫXP@ իXѫX ЫXP2@PŏBPX Z ^Ь[xTPxPP;P QQ`Zԭ[PЫdTǏBPPPPPPPPPQQQPQQjZjZ2PxPP2QPQQxlPPPPxPʏPɏPѬjZ2 PPݭ[2jPPXB2 ~2~2~2~2~i jZ5ѭ IH P֭1խ D, ЫlPЬ[k Ь[[1ЫXZԫl[ZPZPЬ[[^Ь[xTPxPP):P QQ`WЫTYXWxYZ[PΫlPPѬZP)ѬZPѬ  ZPPPɬZPPP<ݭ[?1yWPxPPPPPYP)խ ,XX X֭鑽 ֭jЭP֭`X1!XPX11Pd1Pc1 1PlXXPPo11Pu1Ps1|1Px11 ^Ѭ լ-Gάޭ[ݬݬ@ ݬݬPP֘{~ ޭP[PЬ[20uY"PY["PZ"[~#[  Z" P!~P[[  [[j[P Ь[*P#DP@ZP +PЬ[ 4PZZPP P  Z[[ڬ۬P(  ^Ь[ԭZk96 PQPQ0QZ[[kPP P P+P-k0ZέPЭPЬZЬY[ [[ ЬPЬRRQ{RPRPPPRRPЬPЬRRQ{RPPR PRPP,X-`PЬSRbcPRbF  &0^nhpuphkraxx(0,0)vmunix Boot : : %s Bad format %d+%d+%d start 0x%x Short read null path %s not found bn negative bn ovf %D bn void %D bn void %D not a directory zero length directory Seek not from beginning of file No more file slotsBad device Unknown device Bad unit specifier Missing offset specification Can't write files yet.. Sorry Exit called%s Trap %o l%8 d  o%Z r%x u% x%P| >{%t~%D.%8h&hpuphkrahttmtsmt`       @ ` `&vd62M2R%s1 JTJ2" 7 & `7&/%/,&%2 @v<&unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF()*,not a tape ht error: ds=%b, er=%b ATAERRPIP MOL WRL EOT DPRDRYSSCPESSDWNIDBTMBOTSLACORCRCUNSOPI DTE NEF CSITM FCE NSGPEFLRCINCVPEDPARFMTCPARRMRILRILFht: unrecovered error ht: recovered by retry Anot a tape mt hard error: er=%b mt error: er=%b mt: unrecovered error mt: recovered by retry rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry Pte error: er=%bILCEOFCRE PAE BGL EOT RLE BTENXMSELRBOTCH7SDWNWRLRWSTUR recovered by retry Pts: not ready ts: offline ts tape error: er=%b, xs0=%bSCUPESPE RMR NXM NBA A17 A16SSROFLFC1FC0TC2TC1TC0-TMKRLSLET RLL WLE NEF ILC ILAMOTONLIESVCKPEDWLKBOTEOTts: unrecovered error ts: recovered by retry DR2 `7`+ @7p+up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%((b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPEh >Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error 0123456789abcdef " $")"0,6L> BFL P TX\`g.mt{    d |  t h x ! %)t. 26: >CXGKOSX\`f jnt x|  !!t"@"H"p" X-~Ln"A  -# O "A$!  -$  =, 0=1":#@h#GOyH!U\[HekJF r@"y "i$B!  t!& ; 6  ' G8 d mZ " x* 6>GPJZ| R>[ gjtoxmD,. 8h & <N 0N N <N%%F%%% @%%%*!0!6o%?%H &Q &Z,&d <&mL&v\&|2t?d'd{P(4((fpmtd)R(* O KpS,,* xS+ +@+$0`+,p+4+:,B RSJ\,R XW PXbl,kprw N H"p"!relsrt0.oHIGHstartaedataclraendabeginbeginsboot.oL20L38sys.oL18L25L42L63L77_openi_find_dlook_sbmap_matchL86L94L108L125L138L182L190L195L206conf.oL17L22L27L32L37autoconf.oL26hp.oL30L46ht.oL23L43L47L68mba.oL22L31mt.oL23L43L47rk.oL24L33L53tm.oL23L31L35L62ts.oL31L27L46L50up.oL28L40uba.oL22L33uda.oL29L51L62prf.oL13L18L67L79L91L99machdep.oL13L18L23atol.ol3tol.o_exit.ourem.oudiv.o_end_edata_main__rtt_configure_cpu_openfirstentry_badloc_devsw_b_blknos_iob_devname_line_retry_printf_gets_open_copyunix_read__stop__exit_devread_l3tol_lseek_getc_getchar_write_putchar_devwrite_atol_devopen_close_devclose_exit_trap_nullsys_hpstrategy_hpopen_upstrategy_upopen_rkstrategy_rkopen_udstrategy_udopen_htstrategy_htopen_htclose_tmstrategy_tmopen_tmclose_tsstrategy_tsopen_tsclose_mtstrategy_mtopen_mtclose_mbaddr_mbaact_umaddr_ubaddr_ubaddr780_umaddr780_mbaddr780_ubaddr750_umaddr750_mbaddr750_ubaddr7ZZ_umaddr7ZZ_mfpr_mtpr_hp_type_hp6_off_rm3_off_rm5_off_rm80_off_hp7_off_hptypes_hpst_mbainit_mbastart_httypes_htquiet_mttypes_rkstd_rk_off_rkwait_ubasetup_ubafree_tmstd_tmquiet_tsstd_ctsbuf_ts_uba_tsaddr_ts_ubastd_up_gottype_up_type_up_off_fj_off_upst_udastd_cudbuf_udaddr_uda_ud_ubaddr_uda_off_udcmd_prf_printnuremudiv_bcopylose_mtstrategy_mtopen_mtclose_mbaddr_mbaact_umaddr_ubaddr_ubaddr780_umaddr780_mbaddr780_ubaddr750_umaddr750_mbaddr750_ubaddr7ZZ_umaddr7ZZ_mfpr_mtpr_hp_type_hp6_off_rm3_off_rm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[kPP P P+P-k0ZέPЭPЬZЬY[ [[ ЬPЬRRQ{RPRPPPRRPЬPЬRRQ{RPPR PRPP,I0"DPЬSRbcPRbB &0^nhpuphkraxx(0,0)vmunix Boot : : %s Bad format %d+%d+%d start 0x%x Short read   xvx,x!xhpuphkranull path %s not found bn negative bn ovf %D bn void %D bn void %D not a directory zero length directory Seek not from beginning of file No more file slotsBad device Unknown device Bad unit specifier Missing offset specification Can't write files yet.. Sorry Exit called%s Trap %o `       @ ` `&vd62M2R%s1 JTJ2" 7 `7//2 @v unknown drive typehp bad minorhp error: (cyl,trk,sec)=(%d,%d,%d) ds=%b er1=%b ATAERRPIP MOL WRL LST PGM DPRDRYVVOMDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILF rk bad unitrk error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er=%b DLTWCEUPE NED NEM PGE MDS UFEORIRSCLRBAIRLSDCKUNSOPI DTE WLE IDAE COE HRVCBSEECHDTYEFMTEDRPARNXFSKIILFrk: unrecovered error rk: recovered by retry DR2 `7x  @7 up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPEh >Lra: open error, STCONra: open error, ONLINra: bad unitra: I/O error 0123456789abcdefDR2 `7x  @7 up bad unitup not readyup error: (cyl,trk,sec)=(%d,%d,%d) cs2=%b er1=%b er2=%b DLTWCEUPE NED NEM PGE MXF MDPEORIRCLRPATBAIDCKUNSOPI DTE WLE IAE AOE HCRCHCEECHWCFFERPARRMRILRILFBSESKIOPE IVC LSC LBC MDS DCUDVCACUDPEh >Lra: open error, STCONra: open error, ONLINsys/stand/conf.c.ancient 444 0 33 1767 2506442323 10504 /* conf.c 4.7 81/03/15 */ #include "../h/param.h" #include "../h/inode.h" #include "../h/pte.h" #include "../h/mbareg.h" #include "saio.h" devread(io) register struct iob *io; { return( (*devsw[io->i_ino.i_dev].dv_strategy)(io, READ) ); } devwrite(io) register struct iob *io; { return( (*devsw[io->i_ino.i_dev].dv_strategy)(io, WRITE) ); } devopen(io) register struct iob *io; { (*devsw[io->i_ino.i_dev].dv_open)(io); } devclose(io) register struct iob *io; { (*devsw[io->i_ino.i_dev].dv_close)(io); } nullsys() { ; } int nullsys(); int hpstrategy(), hpopen(); int htstrategy(), htopen(), htclose(); int upstrategy(), upopen(); int tmstrategy(), tmopen(), tmclose(); int tsstrategy(), tsopen(), tsclose(); int rkopen(),rkstrategy(); struct devsw devsw[] = { "hp", hpstrategy, hpopen, nullsys, "ht", htstrategy, htopen, htclose, "up", upstrategy, upopen, nullsys, "tm", tmstrategy, tmopen, tmclose, "hk", rkstrategy, rkopen, nullsys, "ts", tsstrategy, tsopen, tsclose, 0,0,0,0 }; dv_close)sys/stand/boot.c.ancient 444 0 33 3625 2506743617 10527 /* boot.c 4.4 81/03/22 */ #include "../h/param.h" #include "../h/ino.h" #include "../h/inode.h" #include "../h/filsys.h" #include "../h/dir.h" #include "../h/vm.h" #include #include "saio.h" #include /* * Boot program... arguments passed in r10 and r11 determine * whether boot stops to ask for system name and which device * boot comes from. */ /* Types in r10 specifying major device */ char devname[][2] = { 'h','p', /* 0 = hp */ 0,0, /* 1 = ht */ 'u','p', /* 2 = up */ 'h','k', /* 3 = hk */ }; char line[100] = "xx(0,0)vmunix"; int retry = 0; main() { register howto, devtype; /* howto=r11, devtype=r10 */ int io; #ifdef lint howto = 0; devtype = 0; #endif printf("\nBoot\n"); #ifdef JUSTASK howto = RB_ASKNAME|RB_SINGLE; #else if ((howto&RB_ASKNAME)==0) { if (devtype>=0 && devtype= 0) copyunix(howto, io); if (++retry > 2) howto = RB_SINGLE|RB_ASKNAME; } } /*ARGSUSED*/ copyunix(howto, io) register howto, io; { struct exec x; register int i; char *addr; i = read(io, (char *)&x, sizeof x); if (i != sizeof x || x.a_magic != 0410) _stop("Bad format\n"); printf("%d", x.a_text); if (read(io, (char *)0, x.a_text) != x.a_text) goto shread; addr = (char *)x.a_text; while ((int)addr & CLOFSET) *addr++ = 0; printf("+%d", x.a_data); if (read(io, addr, x.a_data) != x.a_data) goto shread; addr += x.a_data; printf("+%d", x.a_bss); x.a_bss += 128*512; /* slop */ for (i = 0; i < x.a_bss; i++) *addr++ = 0; x.a_entry &= 0x7fffffff; printf(" start 0x%x\n", x.a_entry); (*((int (*)()) x.a_entry))(); _exit(); shread: _stop("Short read\n"); } rmat\n"); printf("%d", x.a_text); if (read(io, (char *)0, x.a_text) != x.a_text) goto shread; addr = (sys/stand/bootconf.o 644 0 33 1536 2732200417 7755 \ Ь[[2PxPPP`Ь[[2PxPPP`Ь[[2PxPPP`Ь[[2PxPPP`hpuphkra8Xx     $ ( ,04 8 < $("26D?CdMQZ^jr~_devsw_b_blknos_iob_devreadL17_devwriteL22_devopenL27_devcloseL32_nullsysL37_hpstrategy_hpopen_upstrategy_upopen_rkstrategy_rkopen_udstrategy_udopen  $ ( ,04 8 < $("2sys/dev/ 775 0 33 0 2706134722 5347 ((sys/dev/swaphk.c 644 0 33 1014 2522400312 7052 #include "../h/param.h" #include "../h/conf.h" /* * Single rk07 configuration * root on hk00 * paging on hk01 */ dev_t rootdev = makedev(3, 0); dev_t pipedev = makedev(3, 0); dev_t argdev = makedev(3, 1); dev_t dumpdev = makedev(3, 1); long dumplo = 10032 - 2 * 2048; /* not enough... */ /* * Nswap is the basic number of blocks of swap per * swap device, and is multiplied by nswdev after * nswdev is determined at boot. */ int nswap = 10032; struct swdevt swdevt[] = { makedev(3, 1), 1, /* hk0b */ 0, 0, }; /h/param.h" #include "../h/conf.h" /* * Single rk07 configuration * root on hk00 * paging on hk01 */ dev_t rootdev = makedev(3, 0); dev_t pipedev = makedev(3, 0); dev_t argdev = makedev(3, 1); dev_t dumpdev = makedev(3, 1); long dumplo = 10032 - 2 * 2048; /* not enough... */ /* * Nswap is the basic number of blocks of swap per * swap device, and is multiplied by nswdev after * nswdev is determined at boot. */ int nswap = 10032; struct swdevt swdevt[] = { makedev(3, 1), 1, /* hk0b */sys/dev/autoconf.c 444 0 33 33563 2624064021 7435 /* autoconf.c 4.32 81/11/11 */ /* * Setup the system to run on the current machine. * * Configure() is called at boot time and initializes the uba and mba * device tables and the memory controller monitoring. Available * devices are determined (from possibilities mentioned in ioconf.c), * and the drivers are initialized. * * N.B.: A lot of the conditionals based on processor type say * #if VAX780 * and * #if VAX750 * which may be incorrect after more processors are introduced if they * are like either of these machines. * * TODO: * use pcpu info about whether a ubasr exists */ #include "mba.h" #include "../h/param.h" #include "../h/systm.h" #include "../h/map.h" #include "../h/nexus.h" #include "../h/pte.h" #include "../h/buf.h" #include "../h/mbareg.h" #include "../h/mbavar.h" #include "../h/dk.h" #include "../h/vm.h" #include "../h/ubareg.h" #include "../h/ubavar.h" #include "../h/mtpr.h" #include "../h/cpu.h" #include "../h/scb.h" #include "../h/mem.h" /* * The following several variables are related to * the configuration process, and are used in initializing * the machine. */ int cold; /* if 1, still working on cold-start */ int nexnum; /* current nexus number */ int dkn; /* number of iostat dk numbers assigned so far */ /* * Addresses of the (locore) routines which bootstrap us from * hardware traps to C code. Filled into the system control block * as necessary. */ #if NMBA > 0 int (*mbaintv[4])() = { Xmba0int, Xmba1int, Xmba2int, Xmba3int }; #endif #if VAX780 int (*ubaintv[4])() = { Xua0int, Xua1int, Xua2int, Xua3int }; #endif /* * This allocates the space for the per-uba information, * such as buffered data path usage. */ struct uba_hd uba_hd[MAXNUBA]; /* * Determine mass storage and memory configuration for a machine. * Get cpu type, and then switch out to machine specific procedures * which will probe adaptors to see what is out there. */ configure() { union cpusid cpusid; register struct percpu *ocp; register int *ip; extern char Sysbase[]; cpusid.cpusid = mfpr(SID); for (ocp = percpu; ocp->pc_cputype; ocp++) if (ocp->pc_cputype == cpusid.cpuany.cp_type) { probenexus(ocp); /* * Write protect the scb. It is strange * that this code is here, but this is as soon * as we are done mucking with it, and the * write-enable was done in assembly language * to which we will never return. */ ip = (int *)Sysmap; *ip &= ~PG_PROT; *ip |= PG_KR; mtpr(TBIS, Sysbase); #if GENERIC setconf(); #endif cold = 0; memenable(); return; } printf("cpu type %d not configured\n", cpusid.cpuany.cp_type); asm("halt"); } /* * Probe nexus space, finding the interconnects * and setting up and probing mba's and uba's for devices. */ /*ARGSUSED*/ probenexus(pcpu) register struct percpu *pcpu; { register struct nexus *nxv; struct nexus *nxp = pcpu->pc_nexbase; union nexcsr nexcsr; int i; nexnum = 0, nxv = nexus; for (; nexnum < pcpu->pc_nnexus; nexnum++, nxp++, nxv++) { nxaccess(nxp, Nexmap[nexnum]); if (badaddr((caddr_t)nxv, 4)) continue; if (pcpu->pc_nextype && pcpu->pc_nextype[nexnum] != NEX_ANY) nexcsr.nex_csr = pcpu->pc_nextype[nexnum]; else nexcsr = nxv->nexcsr; if (nexcsr.nex_csr&NEX_APD) continue; switch (nexcsr.nex_type) { case NEX_MBA: printf("mba%d at tr%d\n", nummba, nexnum); if (nummba >= NMBA) { printf("%d mba's", nummba); goto unconfig; } #if NMBA > 0 mbafind(nxv, nxp); nummba++; #endif break; case NEX_UBA0: case NEX_UBA1: case NEX_UBA2: case NEX_UBA3: printf("uba%d at tr%d\n", numuba, nexnum); if (numuba >= 4) { printf("5 uba's"); goto unsupp; } #if VAX780 if (cpu == VAX_780) setscbnex(ubaintv[numuba]); #endif i = nexcsr.nex_type - NEX_UBA0; unifind((struct uba_regs *)nxv, (struct uba_regs *)nxp, umem[i], pcpu->pc_umaddr[i], UMEMmap[i]); #if VAX780 if (cpu == VAX_780) ((struct uba_regs *)nxv)->uba_cr = UBACR_IFS|UBACR_BRIE| UBACR_USEFIE|UBACR_SUEFIE; #endif numuba++; break; case NEX_DR32: /* there can be more than one... are there other codes??? */ printf("dr32"); goto unsupp; case NEX_MEM4: case NEX_MEM4I: case NEX_MEM16: case NEX_MEM16I: printf("mcr%d at tr%d\n", nmcr, nexnum); if (nmcr >= 4) { printf("5 mcr's"); goto unsupp; } mcraddr[nmcr++] = (struct mcr *)nxv; break; case NEX_MPM0: case NEX_MPM1: case NEX_MPM2: case NEX_MPM3: printf("mpm"); goto unsupp; default: printf("nexus type %x", nexcsr.nex_type); unsupp: printf(" unsupported (at tr %d)\n", nexnum); continue; unconfig: printf(" not configured\n"); continue; } } #if VAX780 if (cpu == VAX_780) { int ubawatch(); timeout(ubawatch, (caddr_t)0, hz); } #endif } #if NMBA > 0 struct mba_device *mbaconfig(); /* * Find devices attached to a particular mba * and look for each device found in the massbus * initialization tables. */ mbafind(nxv, nxp) struct nexus *nxv, *nxp; { register struct mba_regs *mdp; register struct mba_drv *mbd; register struct mba_device *mi; register struct mba_slave *ms; int dn, dt; struct mba_device fnd; mdp = (struct mba_regs *)nxv; mba_hd[nummba].mh_mba = mdp; mba_hd[nummba].mh_physmba = (struct mba_regs *)nxp; setscbnex(mbaintv[nummba]); fnd.mi_mba = mdp; fnd.mi_mbanum = nummba; for (mbd = mdp->mba_drv, dn = 0; mbd < &mdp->mba_drv[8]; mbd++, dn++) { dt = mbd->mbd_dt & 0xffff; if (dt == 0) continue; if (dt == MBDT_MOH) continue; fnd.mi_drive = dn; if ((mi = mbaconfig(&fnd, dt)) && (dt & MBDT_TAP)) { for (ms = mbsinit; ms->ms_driver; ms++) if (ms->ms_driver == mi->mi_driver && ms->ms_alive == 0 && (ms->ms_ctlr == mi->mi_unit || ms->ms_ctlr=='?')) { if ((*ms->ms_driver->md_slave)(mi, ms)) { printf("%s%d at %s%d slave %d\n", ms->ms_driver->md_sname, ms->ms_unit, mi->mi_driver->md_dname, mi->mi_unit, ms->ms_slave); ms->ms_alive = 1; ms->ms_ctlr = mi->mi_unit; } } } } mdp->mba_cr = MBCR_INIT; mdp->mba_cr = MBCR_IE; } /* * Have found a massbus device; * see if it is in the configuration table. * If so, fill in its data. */ struct mba_device * mbaconfig(ni, type) register struct mba_device *ni; register int type; { register struct mba_device *mi; register short *tp; register struct mba_hd *mh; for (mi = mbdinit; mi->mi_driver; mi++) { if (mi->mi_alive) continue; tp = mi->mi_driver->md_type; for (mi->mi_type = 0; *tp; tp++, mi->mi_type++) if (*tp == (type&MBDT_TYPE)) goto found; continue; found: #define match(fld) (ni->fld == mi->fld || mi->fld == '?') if (!match(mi_drive) || !match(mi_mbanum)) continue; printf("%s%d at mba%d drive %d", mi->mi_driver->md_dname, mi->mi_unit, ni->mi_mbanum, ni->mi_drive); printf("\n"); mi->mi_alive = 1; mh = &mba_hd[ni->mi_mbanum]; mi->mi_hd = mh; mh->mh_mbip[ni->mi_drive] = mi; mh->mh_ndrive++; mi->mi_mba = ni->mi_mba; mi->mi_drv = &mi->mi_mba->mba_drv[ni->mi_drive]; mi->mi_driver->md_info[mi->mi_unit] = mi; mi->mi_mbanum = ni->mi_mbanum; mi->mi_drive = ni->mi_drive; if (mi->mi_dk && dkn < DK_NDRIVE) mi->mi_dk = dkn++; else mi->mi_dk = -1; (*mi->mi_driver->md_attach)(mi); return (mi); } return (0); } #endif /* * Fixctlrmask fixes the masks of the driver ctlr routines * which otherwise save r10 and r11 where the interrupt and br * level are passed through. */ fixctlrmask() { register struct uba_ctlr *um; register struct uba_device *ui; register struct uba_driver *ud; #define phys(a,b) ((b)(((int)(a))&0x7fffffff)) for (um = ubminit; ud = phys(um->um_driver, struct uba_driver *); um++) *phys(ud->ud_probe, short *) &= ~0xc00; for (ui = ubdinit; ud = phys(ui->ui_driver, struct uba_driver *); ui++) *phys(ud->ud_probe, short *) &= ~0xc00; } /* * Find devices on a UNIBUS. * Uses per-driver routine to set into , * and then fills in the tables, with help from a per-driver * slave initialization routine. */ unifind(vubp, pubp, vumem, pumem, memmap) struct uba_regs *vubp, *pubp; cadd((r_t vumem, pumem; struct pte *memmap; { #ifndef lint register int br, cvec; /* MUST BE r11, r10 */ #else /* * Lint doesn't realize that these * can be initialized asynchronously * when devices interrupt. */ register int br = 0, cvec = 0; #endif register struct uba_device *ui; register struct uba_ctlr *um; u_short *reg, addr; struct uba_hd *uhp; struct uba_driver *udp; int i, (**ivec)(), haveubasr = 0; /* * Initialize the UNIBUS, by freeing the map * registers and the buffered data path registers */ uhp = &uba_hd[numuba]; uhp->uh_map = (struct map *)calloc(UAMSIZ * sizeof (struct map)); rminit(uhp->uh_map, NUBMREG, 1, "uba", UAMSIZ); switch (cpu) { #if VAX780 case VAX_780: uhp->uh_bdpfree = (1<uh_bdpfree = (1<uh_uba = vubp; uhp->uh_physuba = pubp; /* HAVE TO DO SOMETHING SPECIAL FOR SECOND UNIBUS ON COMETS HERE */ if (numuba == 0) uhp->uh_vec = UNIvec; else uhp->uh_vec = (int(**)())calloc(512); for (i = 0; i < 128; i++) uhp->uh_vec[i] = scbentry(&catcher[i*2], SCB_ISTACK); /* * Set last free interrupt vector for devices with * programmable interrupt vectors. Use is to decrement * this number and use result as interrupt vector. */ uhp->uh_lastiv = 0x200; /* THIS IS A CHEAT: USING THE FACT THAT UMEM and NEXI ARE SAME SIZE */ nxaccess((struct nexus *)pumem, memmap); #if VAX780 if (haveubasr) { vubp->uba_sr = vubp->uba_sr; vubp->uba_cr = UBACR_IFS|UBACR_BRIE; } #endif /* * Map the first page of UNIBUS i/o * space to the first page of memory * for devices which will need to dma * output to produce an interrupt. */ *(int *)(&vubp->uba_map[0]) = UBAMR_MRV; #define ubaddr(off) (u_short *)((int)vumem + ((off)&0x1fff)) /* * Check each unibus mass storage controller. * For each one which is potentially on this uba, * see if it is really there, and if it is record it and * then go looking for slaves. */ for (um = ubminit; udp = um->um_driver; um++) { if (um->um_ubanum != numuba && um->um_ubanum != '?') continue; addr = (u_short)um->um_addr; reg = ubaddr(addr); if (badaddr((caddr_t)reg, 2)) continue; #if VAX780 if (haveubasr && vubp->uba_sr) { vubp->uba_sr = vubp->uba_sr; continue; } #endif cvec = 0x200; i = (*udp->ud_probe)(reg); #if VAX780 if (haveubasr && vubp->uba_sr) { vubp->uba_sr = vubp->uba_sr; continue; } #endif if (i == 0) continue; printf("%s%d at uba%d csr %o ", udp->ud_mname, um->um_ctlr, numuba, addr); if (cvec == 0) { printf("zero vector\n"); continue; } if (cvec == 0x200) { printf("didn't interrupt\n"); continue; } printf("vec %o, ipl %x\n", cvec, br); um->um_alive = 1; um->um_ubanum = numuba; um->um_hd = &uba_hd[numuba]; um->um_addr = (caddr_t)reg; udp->ud_minfo[um->um_ctlr] = um; for (ivec = um->um_intr; *ivec; ivec++) { um->um_hd->uh_vec[cvec/4] = scbentry(*ivec, SCB_ISTACK); cvec += 4; } for (ui = ubdinit; ui->ui_driver; ui++) { if (ui->ui_driver != udp || ui->ui_alive || ui->ui_ctlr != um->um_ctlr && ui->ui_ctlr != '?' || ui->ui_ubanum != numuba && ui->ui_ubanum != '?') continue; if ((*udp->ud_slave)(ui, reg)) { ui->ui_alive = 1; ui->ui_ctlr = um->um_ctlr; ui->ui_ubanum = numuba; ui->ui_hd = &uba_hd[numuba]; ui->ui_addr = (caddr_t)reg; ui->ui_physaddr = pumem + (addr&0x1fff); if (ui->ui_dk && dkn < DK_NDRIVE) ui->ui_dk = dkn++; else ui->ui_dk = -1; ui->ui_mi = um; /* ui_type comes from driver */ udp->ud_dinfo[ui->ui_unit] = ui; printf("%s%d at %s%d slave %d\n", udp->ud_dname, ui->ui_unit, udp->ud_mname, um->um_ctlr, ui->ui_slave); (*udp->ud_attach)(ui); } } } /* * Now look for non-mass storage peripherals. */ for (ui = ubdinit; udp = ui->ui_driver; ui++) { if (ui->ui_ubanum != numuba && ui->ui_ubanum != '?' || ui->ui_alive || ui->ui_slave != -1) continue; addr = (u_short)ui->ui_addr; reg = ubaddr(addr); if (badaddr((caddr_t)reg, 2)) continue; #if VAX780 if (haveubasr && vubp->uba_sr) { vubp->uba_sr = vubp->uba_sr; continue; } #endif cvec = 0x200; i = (*udp->ud_probe)(reg, um->um_ctlr); #if VAX780 if (haveubasr && vubp->uba_sr) { vubp->uba_sr = vubp->uba_sr; continue; } #endif if (i == 0) continue; printf("%s%d at uba%d csr %o ", ui->ui_driver->ud_dname, ui->ui_unit, numuba, addr); if (cvec == 0) { printf("zero vector\n"); continue; } if (cvec == 0x200) { printf("didn't interrupt\n"); continue; } printf("vec %o, ipl %x\n", cvec, br); ui->ui_hd = &uba_hd[numuba]; for (ivec = ui->ui_intr; *ivec; ivec++) { ui->ui_hd->uh_vec[cvec/4] = scbentry(*ivec, SCB_ISTACK); cvec += 4; } ui->ui_alive = 1; ui->ui_ubanum = numuba; ui->ui_addr = (caddr_t)reg; ui->ui_physaddr = pumem + (addr&0x1fff); ui->ui_dk = -1; /* ui_type comes from driver */ udp->ud_dinfo[ui->ui_unit] = ui; (*udp->ud_attach)(ui); } } setscbnex(fn) int (*fn)(); { register struct scb *scbp = &scb; scbp->scb_ipl14[nexnum] = scbp->scb_ipl15[nexnum] = scbp->scb_ipl16[nexnum] = scbp->scb_ipl17[nexnum] = scbentry(fn, SCB_ISTACK); } /* * Make a nexus accessible at physical address phys * by mapping kernel ptes starting at pte. * * WE LEAVE ALL NEXI MAPPED; THIS IS PERHAPS UNWISE * SINCE MISSING NEXI DONT RESPOND. BUT THEN AGAIN * PRESENT NEXI DONT RESPOND TO ALL OF THEIR ADDRESS SPACE. */ nxaccess(physa, pte) struct nexus *physa; register struct pte *pte; { register int i = btop(sizeof (struct nexus)); register unsigned v = btop(physa); do *(int *)pte++ = PG_V|PG_KW|v++; while (--i > 0); mtpr(TBIA, 0); } ISTACK); } /* * Make a nexus accessible at physical address phys * by mapping kernel ptes starting at pte. * * WE LEAVE ALL NEXI MAPPED;sys/dev/bio.c 444 0 33 42315 2624051301 6360 /* bio.c 4.23 81/07/25 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/buf.h" #include "../h/conf.h" #include "../h/proc.h" #include "../h/seg.h" #include "../h/pte.h" #include "../h/vm.h" #include "../h/trace.h" /* * The following several routines allocate and free * buffers with various side effects. In general the * arguments to an allocate routine are a device and * a block number, and the value is a pointer to * to the buffer header; the buffer is marked "busy" * so that no one else can touch it. If the block was * already in core, no I/O need be done; if it is * already busy, the process waits until it becomes free. * The following routines allocate a buffer: * getblk * bread * breada * baddr (if it is incore) * Eventually the buffer must be released, possibly with the * side effect of writing it out, by using one of * bwrite * bdwrite * bawrite * brelse */ struct buf bfreelist[BQUEUES]; struct buf bswlist, *bclnlist; #define BUFHSZ 63 struct bufhd bufhash[BUFHSZ]; #define BUFHASH(dev, dblkno) \ ((struct buf *)&bufhash[((int)(dev)+(int)(dblkno)) % BUFHSZ]) /* * Initialize hash links for buffers. */ bhinit() { register int i; register struct bufhd *bp; for (bp = bufhash, i = 0; i < BUFHSZ; i++, bp++) bp->b_forw = bp->b_back = (struct buf *)bp; } /* #define DISKMON 1 */ #ifdef DISKMON struct { int nbuf; long nread; long nreada; long ncache; long nwrite; long bufcount[64]; } io_info; #endif /* * Swap IO headers - * They contain the necessary information for the swap I/O. * At any given time, a swap header can be in three * different lists. When free it is in the free list, * when allocated and the I/O queued, it is on the swap * device list, and finally, if the operation was a dirty * page push, when the I/O completes, it is inserted * in a list of cleaned pages to be processed by the pageout daemon. */ struct buf *swbuf; short *swsize; /* CAN WE JUST USE B_BCOUNT? */ int *swpf; #ifndef UNFAST #define notavail(bp) \ { \ int s = spl6(); \ (bp)->av_back->av_forw = (bp)->av_forw; \ (bp)->av_forw->av_back = (bp)->av_back; \ (bp)->b_flags |= B_BUSY; \ splx(s); \ } #endif /* * Read in (if necessary) the block and return a buffer pointer. */ struct buf * bread(dev, blkno) dev_t dev; daddr_t blkno; { register struct buf *bp; bp = getblk(dev, blkno); if (bp->b_flags&B_DONE) { #ifdef TRACE trace(TR_BREADHIT, dev, blkno); #endif #ifdef DISKMON io_info.ncache++; #endif return(bp); } bp->b_flags |= B_READ; bp->b_bcount = BSIZE; (*bdevsw[major(dev)].d_strategy)(bp); #ifdef TRACE trace(TR_BREADMISS, dev, blkno); #endif #ifdef DISKMON io_info.nread++; #endif u.u_vm.vm_inblk++; /* pay for read */ iowait(bp); return(bp); } /* * Read in the block, like bread, but also start I/O on the * read-ahead block (which is not allocated to the caller) */ struct buf * breada(dev, blkno, rablkno) dev_t dev; daddr_t blkno, rablkno; { register struct buf *bp, *rabp; bp = NULL; if (!incore(dev, blkno)) { bp = getblk(dev, blkno); if ((bp->b_flags&B_DONE) == 0) { bp->b_flags |= B_READ; bp->b_bcount = BSIZE; (*bdevsw[major(dev)].d_strategy)(bp); #ifdef TRACE trace(TR_BREADMISS, dev, blkno); #endif #ifdef DISKMON io_info.nread++; #endif u.u_vm.vm_inblk++; /* pay for read */ } #ifdef TRACE else trace(TR_BREADHIT, dev, blkno); #endif } if (rablkno && !incore(dev, rablkno)) { rabp = getblk(dev, rablkno); if (rabp->b_flags & B_DONE) { brelse(rabp); #ifdef TRACE(( trace(TR_BREADHITRA, dev, blkno); #endif } else { rabp->b_flags |= B_READ|B_ASYNC; rabp->b_bcount = BSIZE; (*bdevsw[major(dev)].d_strategy)(rabp); #ifdef TRACE trace(TR_BREADMISSRA, dev, rablock); #endif #ifdef DISKMON io_info.nreada++; #endif u.u_vm.vm_inblk++; /* pay in advance */ } } if(bp == NULL) return(bread(dev, blkno)); iowait(bp); return(bp); } /* * Write the buffer, waiting for completion. * Then release the buffer. */ bwrite(bp) register struct buf *bp; { register flag; flag = bp->b_flags; bp->b_flags &= ~(B_READ | B_DONE | B_ERROR | B_DELWRI | B_AGE); bp->b_bcount = BSIZE; #ifdef DISKMON io_info.nwrite++; #endif if ((flag&B_DELWRI) == 0) u.u_vm.vm_oublk++; /* noone paid yet */ #ifdef TRACE trace(TR_BWRITE, bp->b_dev, bp->b_blkno); #endif (*bdevsw[major(bp->b_dev)].d_strategy)(bp); if ((flag&B_ASYNC) == 0) { iowait(bp); brelse(bp); } else if (flag & B_DELWRI) bp->b_flags |= B_AGE; else geterror(bp); } /* * Release the buffer, marking it so that if it is grabbed * for another purpose it will be written out before being * given up (e.g. when writing a partial block where it is * assumed that another write for the same block will soon follow). * This can't be done for magtape, since writes must be done * in the same order as requested. */ bdwrite(bp) register struct buf *bp; { register int flags; if ((bp->b_flags&B_DELWRI) == 0) u.u_vm.vm_oublk++; /* noone paid yet */ flags = bdevsw[major(bp->b_dev)].d_flags; if(flags & B_TAPE) bawrite(bp); else { bp->b_flags |= B_DELWRI | B_DONE; brelse(bp); } } /* * Release the buffer, start I/O on it, but don't wait for completion. */ bawrite(bp) register struct buf *bp; { bp->b_flags |= B_ASYNC; bwrite(bp); } /* * release the buffer, with no I/O implied. */ brelse(bp) register struct buf *bp; { register struct buf *flist; register s; if (bp->b_flags&B_WANTED) wakeup((caddr_t)bp); if (bfreelist[0].b_flags&B_WANTED) { bfreelist[0].b_flags &= ~B_WANTED; wakeup((caddr_t)bfreelist); } if (bp->b_flags&B_ERROR) if (bp->b_flags & B_LOCKED) bp->b_flags &= ~B_ERROR; /* try again later */ else bp->b_dev = NODEV; /* no assoc */ s = spl6(); if (bp->b_flags & (B_ERROR|B_INVAL)) { /* block has no info ... put at front of most free list */ flist = &bfreelist[BQUEUES-1]; flist->av_forw->av_back = bp; bp->av_forw = flist->av_forw; flist->av_forw = bp; bp->av_back = flist; } else { if (bp->b_flags & B_LOCKED) flist = &bfreelist[BQ_LOCKED]; else if (bp->b_flags & B_AGE) flist = &bfreelist[BQ_AGE]; else flist = &bfreelist[BQ_LRU]; flist->av_back->av_forw = bp; bp->av_back = flist->av_back; flist->av_back = bp; bp->av_forw = flist; } bp->b_flags &= ~(B_WANTED|B_BUSY|B_ASYNC|B_AGE); splx(s); } /* * See if the block is associated with some buffer * (mainly to avoid getting hung up on a wait in breada) */ incore(dev, blkno) dev_t dev; daddr_t blkno; { register struct buf *bp; register struct buf *dp; register int dblkno = fsbtodb(blkno); dp = BUFHASH(dev, dblkno); for (bp = dp->b_forw; bp != dp; bp = bp->b_forw) if (bp->b_blkno == dblkno && bp->b_dev == dev && !(bp->b_flags & B_INVAL)) return (1); return (0); } struct buf * baddr(dev, blkno) dev_t dev; daddr_t blkno; { if (incore(dev, blkno)) return (bread(dev, blkno)); return (0); } /* * Assign a buffer for the given block. If the appropriate * block is already associated, return it; otherwise search * for the oldest non-busy buffer and reassign it. */ struct buf * getblk(dev, blkno) dev_t dev; daddr_t blkno; { register struct buf *bp, *dp, *ep; register int dblkno = fsbtodb(blkno); #ifdef DISKMON register int i; #endif if ((unsigned)blkno >= 1 << (sizeof(int)*NBBY-PGSHIFT)) blkno = 1 << ((sizeof(int)*NBBY-PGSHIFT) + 1); dblkno = fsbtodb(blkno); dp = BUFHASH(dev, dblkno); loop: (void) spl0(); for (bp = dp->b_forw; bp != dp; bp = bp->b_forw) { if (bp->b_blkno != dblkno || bp->b_dev != dev || bp->b_flags&B_INVAL) continue; (void) spl6(); if (bp->b_flags&B_BUSY) { bp->b_flags |= B_WANTED; sleep((caddr_t)bp, PRIBIO+1); goto loop; } (void) spl0(); #ifdef DISKMON i = 0; dp = bp->av_forw; while ((dp->b_flags & B_HEAD) == 0) { i++; dp = dp->av_forw; } if (i<64) io_info.bufcount[i]++; #endif notavail(bp); bp->b_flags |= B_CACHE; return(bp); } if (major(dev) >= nblkdev) panic("blkdev"); (void) spl6(); for (ep = &bfreelist[BQUEUES-1]; ep > bfreelist; ep--) if (ep->av_forw != ep) break; if (ep == bfreelist) { /* no free blocks at all */ ep->b_flags |= B_WANTED; sleep((caddr_t)ep, PRIBIO+1); goto loop; } (void) spl0(); bp = ep->av_forw; notavail(bp); if (bp->b_flags & B_DELWRI) { bp->b_flags |= B_ASYNC; bwrite(bp); goto loop; } #ifdef TRACE trace(TR_BRELSE, bp->b_dev, bp->b_blkno); #endif bp->b_flags = B_BUSY; bp->b_back->b_forw = bp->b_forw; bp->b_forw->b_back = bp->b_back; bp->b_forw = dp->b_forw; bp->b_back = dp; dp->b_forw->b_back = bp; dp->b_forw = bp; bp->b_dev = dev; bp->b_blkno = dblkno; return(bp); } /* * get an empty block, * not assigned to any particular device */ struct buf * geteblk() { register struct buf *bp, *dp; loop: (void) spl6(); for (dp = &bfreelist[BQUEUES-1]; dp > bfreelist; dp--) if (dp->av_forw != dp) break; if (dp == bfreelist) { /* no free blocks */ dp->b_flags |= B_WANTED; sleep((caddr_t)dp, PRIBIO+1); goto loop; } (void) spl0(); bp = dp->av_forw; notavail(bp); if (bp->b_flags & B_DELWRI) { bp->b_flags |= B_ASYNC; bwrite(bp); goto loop; } #ifdef TRACE trace(TR_BRELSE, bp->b_dev, bp->b_blkno); #endif bp->b_flags = B_BUSY|B_INVAL; bp->b_back->b_forw = bp->b_forw; bp->b_forw->b_back = bp->b_back; bp->b_forw = dp->b_forw; bp->b_back = dp; dp->b_forw->b_back = bp; dp->b_forw = bp; bp->b_dev = (dev_t)NODEV; return(bp); } /* * Wait for I/O completion on the buffer; return errors * to the user. */ iowait(bp) register struct buf *bp; { (void) spl6(); while ((bp->b_flags&B_DONE)==0) sleep((caddr_t)bp, PRIBIO); (void) spl0(); geterror(bp); } #ifdef UNFAST /* * Unlink a buffer from the available list and mark it busy. * (internal interface) */ notavail(bp) register struct buf *bp; { register s; s = spl6(); bp->av_back->av_forw = bp->av_forw; bp->av_forw->av_back = bp->av_back; bp->b_flags |= B_BUSY; splx(s); } #endif /* * Mark I/O complete on a buffer. If the header * indicates a dirty page push completion, the * header is inserted into the ``cleaned'' list * to be processed by the pageout daemon. Otherwise * release it if I/O is asynchronous, and wake * up anyone waiting for it. */ iodone(bp) register struct buf *bp; { register int s; if (bp->b_flags & B_DONE) panic("dup iodone"); bp->b_flags |= B_DONE; if (bp->b_flags & B_DIRTY) { if (bp->b_flags & B_ERROR) panic("IO err in push"); s = spl6(); bp->av_forw = bclnlist; bp->b_bcount = swsize[bp - swbuf]; bp->b_pfcent = swpf[bp - swbuf]; cnt.v_pgout++; cnt.v_pgpgout += bp->b_bcount / NBPG; bclnlist = bp; if (bswlist.b_flags & B_WANTED) wakeup((caddr_t)&proc[2]); splx(s); return; } if (bp->b_flags&B_ASYNC) brelse(bp); else { bp->b_flags &= ~B_WANTED; wakeup((caddr_t)bp); } } /* * Zero the core associated with a buffer. */ clrbuf(bp) struct buf *bp; { register *p; register c; p = bp->b_un.b_words; c = BSIZE/sizeof(int); do *p++ = 0; while (--c); bp->b_resid = 0; } /* * swap I/O - * * If the flag indicates a dirty page push initiated * by the pageout daemon, we map the page into the i th * virtual page of process 2 (the daemon itself) where i is * the index of the swap header that has been allocated. * We simply initialize the header and queue the I/O but * do not wait for completion. When the I/O completes, * iodone() will link the header to a list of cleaned * pages to be processed by the pageout daemon. */ swap(p, dblkno, addr, nbytes, rdflg, flag, dev, pfcent) struct proc *p; swblk_t dblkno; caddr_t addr; int flag, nbytes; dev_t dev; unsigned pfcent; { register struct buf *bp; register int c; int p2dp; register struct pte *dpte, *vpte; (void) spl6(); while (bswlist.av_forw == NULL) { bswlist.b_flags |= B_WANTED; sleep((caddr_t)&bswlist, PSWP+1); } bp = bswlist.av_forw; bswlist.av_forw = bp->av_forw; (void) spl0(); bp->b_flags = B_BUSY | B_PHYS | rdflg | flag; if ((bp->b_flags & (B_DIRTY|B_PGIN)) == 0) if (rdflg == B_READ) sum.v_pswpin += btoc(nbytes); else sum.v_pswpout += btoc(nbytes); bp->b_proc = p; if (flag & B_DIRTY) { p2dp = ((bp - swbuf) * CLSIZE) * KLMAX; dpte = dptopte(&proc[2], p2dp); vpte = vtopte(p, btop(addr)); for (c = 0; c < nbytes; c += NBPG) { if (vpte->pg_pfnum == 0 || vpte->pg_fod) panic("swap bad pte"); *dpte++ = *vpte++; } bp->b_un.b_addr = (caddr_t)ctob(p2dp); } else bp->b_un.b_addr = addr; while (nbytes > 0) { c = imin(ctob(120), nbytes); bp->b_bcount = c; bp->b_blkno = dblkno; bp->b_dev = dev; if (flag & B_DIRTY) { swpf[bp - swbuf] = pfcent; swsize[bp - swbuf] = nbytes; } #ifdef TRACE trace(TR_SWAPIO, dev, bp->b_blkno); #endif (*bdevsw[major(dev)].d_strategy)(bp); if (flag & B_DIRTY) { if (c < nbytes) panic("big push"); return; } (void) spl6(); while((bp->b_flags&B_DONE)==0) sleep((caddr_t)bp, PSWP); (void) spl0(); bp->b_un.b_addr += c; bp->b_flags &= ~B_DONE; if (bp->b_flags & B_ERROR) { if ((flag & (B_UAREA|B_PAGET)) || rdflg == B_WRITE) panic("hard IO err in swap"); swkill(p, (char *)0); } nbytes -= c; dblkno += btoc(c); } (void) spl6(); bp->b_flags &= ~(B_BUSY|B_WANTED|B_PHYS|B_PAGET|B_UAREA|B_DIRTY); bp->av_forw = bswlist.av_forw; bswlist.av_forw = bp; if (bswlist.b_flags & B_WANTED) { bswlist.b_flags &= ~B_WANTED; wakeup((caddr_t)&bswlist); wakeup((caddr_t)&proc[2]); } (void) spl0(); } /* * If rout == 0 then killed on swap error, else * rout is the name of the routine where we ran out of * swap space. */ swkill(p, rout) struct proc *p; char *rout; { char *mesg; printf("pid %d: ", p->p_pid); if (rout)(( printf(mesg = "killed due to no swap space\n"); else printf(mesg = "killed on swap error\n"); uprintf("sorry, pid %d was %s", p->p_pid, mesg); /* * To be sure no looping (e.g. in vmsched trying to * swap out) mark process locked in core (as though * done by user) after killing it so noone will try * to swap it out. */ psignal(p, SIGKILL); p->p_flag |= SULOCK; } /* * make sure all write-behind blocks * on dev (or NODEV for all) * are flushed out. * (from umount and update) */ bflush(dev) dev_t dev; { register struct buf *bp; register struct buf *flist; loop: (void) spl6(); for (flist = bfreelist; flist < &bfreelist[BQUEUES]; flist++) for (bp = flist->av_forw; bp != flist; bp = bp->av_forw) { if (bp->b_flags&B_DELWRI && (dev == NODEV||dev==bp->b_dev)) { bp->b_flags |= B_ASYNC; notavail(bp); bwrite(bp); goto loop; } } (void) spl0(); } /* * Raw I/O. The arguments are * The strategy routine for the device * A buffer, which will always be a special buffer * header owned exclusively by the device for this purpose * The device number * Read/write flag * Essentially all the work is computing physical addresses and * validating them. * If the user has the proper access privilidges, the process is * marked 'delayed unlock' and the pages involved in the I/O are * faulted and locked. After the completion of the I/O, the above pages * are unlocked. */ physio(strat, bp, dev, rw, mincnt) int (*strat)(); register struct buf *bp; unsigned (*mincnt)(); { register int c; char *a; if (useracc(u.u_base,u.u_count,rw==B_READ?B_WRITE:B_READ) == NULL) { u.u_error = EFAULT; return; } (void) spl6(); while (bp->b_flags&B_BUSY) { bp->b_flags |= B_WANTED; sleep((caddr_t)bp, PRIBIO+1); } bp->b_error = 0; bp->b_proc = u.u_procp; bp->b_un.b_addr = u.u_base; while (u.u_count != 0) { bp->b_flags = B_BUSY | B_PHYS | rw; bp->b_dev = dev; bp->b_blkno = u.u_offset >> PGSHIFT; bp->b_bcount = u.u_count; (*mincnt)(bp); c = bp->b_bcount; u.u_procp->p_flag |= SPHYSIO; vslock(a = bp->b_un.b_addr, c); (*strat)(bp); (void) spl6(); while ((bp->b_flags&B_DONE) == 0) sleep((caddr_t)bp, PRIBIO); vsunlock(a, c, rw); u.u_procp->p_flag &= ~SPHYSIO; if (bp->b_flags&B_WANTED) wakeup((caddr_t)bp); (void) spl0(); bp->b_un.b_addr += c; u.u_count -= c; u.u_offset += c; if (bp->b_flags&B_ERROR) break; } bp->b_flags &= ~(B_BUSY|B_WANTED|B_PHYS); u.u_count = bp->b_resid; geterror(bp); } /*ARGSUSED*/ unsigned minphys(bp) struct buf *bp; { if (bp->b_bcount > 60 * 1024) bp->b_bcount = 60 * 1024; } /* * Pick up the device's error number and pass it to the user; * if there is an error but the number is 0 set a generalized * code. Actually the latter is always true because devices * don't yet return specific errors. */ geterror(bp) register struct buf *bp; { if (bp->b_flags&B_ERROR) if ((u.u_error = bp->b_error)==0) u.u_error = EIO; } /* * Invalidate in core blocks belonging to closed or umounted filesystem * * This is not nicely done at all - the buffer ought to be removed from the * hash chains & have its dev/blkno fields clobbered, but unfortunately we * can't do that here, as it is quite possible that the block is still * being used for i/o. Eventually, all disc drivers should be forced to * have a close routine, which ought ensure that the queue is empty, then * properly flush the queues. Until that happy day, this suffices for * correctness. ... kre */ binval(dev) dev_t dev; { register struct buf *bp; register struct bufhd *hp; #define dp ((struct buf *)hp) for (hp = bufhash; hp < &bufhash[BUFHSZ]; hp++) for (bp = dp->b_forw; bp != dp; bp = bp->b_forw) if (bp->b_dev == dev) bp->b_flags |= B_INVAL; } being used for i/o. Eventually, all disc drivers should be forced to * have a close routine, which ought ensure that the queue is empty, then * properly flush the queues. Until that happy day, this suffices for * correctness. ... kre */ binval(dev) dev_t dev; { register struct buf *bp; registersys/dev/bk.c 444 0 33 7322 2506427523 6176 /* bk.c 4.6 81/03/11 */ #include "bk.h" #if NBK > 0 #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/tty.h" #include "../h/proc.h" #include "../h/mx.h" #include "../h/inode.h" #include "../h/file.h" #include "../h/conf.h" #include "../h/buf.h" /* * Line discipline for Berkeley network. * * This supplies single lines to a user level program * with a minimum of fuss. Lines are newline terminated. * * This discipline requires that tty device drivers call * the line specific l_ioctl routine from their ioctl routines, * assigning the result to cmd so that we can refuse most tty specific * ioctls which are unsafe because we have ambushed the * teletype input queues, overlaying them with other information. */ /* * Open as networked discipline. Called when discipline changed * with ioctl, this assigns a buffer to the line for input, and * changing the interpretation of the information in the tty structure. */ /*ARGSUSED*/ bkopen(dev, tp) dev_t dev; register struct tty *tp; { register struct buf *bp; if (u.u_error) return; /* paranoia */ if (tp->t_line == NETLDISC) { u.u_error = EBUSY; /* sometimes the network */ return; /* ... opens /dev/tty */ } bp = geteblk(); flushtty(tp, FREAD|FWRITE); tp->t_bufp = bp; tp->t_cp = (char *)bp->b_un.b_addr; tp->t_inbuf = 0; tp->t_rec = 0; } /* * Break down... called when discipline changed or from device * close routine. */ bkclose(tp) register struct tty *tp; { register s; s = spl5(); wakeup((caddr_t)&tp->t_rawq); if (tp->t_bufp) { brelse(tp->t_bufp); tp->t_bufp = 0; } else printf("bkclose: no buf\n"); tp->t_cp = 0; tp->t_inbuf = 0; tp->t_rec = 0; tp->t_line = 0; /* paranoid: avoid races */ splx(s); } /* * Read from a network line. * Characters have been buffered in a system buffer and are * now dumped back to the user in one fell swoop, and with a * minimum of fuss. Note that no input is accepted when a record * is waiting. Our clearing tp->t_rec here allows further input * to accumulate. */ bkread(tp) register struct tty *tp; { register int i; register s; if ((tp->t_state&CARR_ON)==0) return (-1); s = spl5(); while (tp->t_rec == 0 && tp->t_line == NETLDISC) sleep((caddr_t)&tp->t_rawq, TTIPRI); splx(s); if (tp->t_line != NETLDISC) return (-1); i = MIN(tp->t_inbuf, (int)u.u_count); if (copyout(tp->t_bufp->b_un.b_addr, u.u_base, (unsigned)i)) { u.u_error = EFAULT; return (-1); } u.u_count -= i; u.u_base += i; u.u_offset += i; tp->t_cp = (char *)tp->t_bufp->b_un.b_addr; tp->t_inbuf = 0; tp->t_rec = 0; return (0); } /* * Low level character input routine. * Stuff the character in the buffer, and wake up the top * half after setting t_rec if this completes the record * or if the buffer is (ick!) full. * * Thisis where the formatting should get done to allow * 8 character data paths through escapes. * * This rutine should be expanded in-line in the receiver * interrupt routine of the dh-11 to make it run as fast as possible. */ bkinput(c, tp) register c; register struct tty *tp; { if (tp->t_rec) return; *tp->t_cp++ = c; if (++tp->t_inbuf == BSIZE || c == '\n') { tp->t_rec = 1; wakeup((caddr_t)&tp->t_rawq); } } /* * This routine is called whenever a ioctl is about to be performed * and gets a chance to reject the ioctl. We reject all teletype * oriented ioctl's except those which set the discipline, and * those which get parameters (gtty and get special characters). */ /*ARGSUSED*/ bkioctl(tp, cmd, addr) struct tty *tp; caddr_t addr; { if ((cmd>>8) != 't') return (cmd); switch (cmd) { case TIOCSETD: case TIOCGETD: case TIOCGETP: case TIOCGETC: return (cmd); } u.u_error = ENOTTY; return (0); } #endif his routine is called whenever a ioctl is about to be performed * and gets a chance to reject the ioctl. We reject all teletype * oriented ioctl's except those which set the discipline, and * those which get parameters (gtty and get special characters). */ /*ARGSUSED*/ bkioctl(tp, cmd, addr) strusys/dev/conf.c 444 0 33 21537 2650361747 6560 /* conf.c 4.40- 81/11/11 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/buf.h" #include "../h/tty.h" #include "../h/conf.h" #include "../h/text.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/file.h" #include "../h/inode.h" #include "../h/acct.h" #include "../h/pte.h" int nulldev(); int nodev(); #include "hp.h" #if NHP > 0 int hpstrategy(),hpread(),hpwrite(),hpintr(),hpdump(); #else #define hpstrategy nodev #define hpread nodev #define hpwrite nodev #define hpintr nodev #define hpdump nodev #endif #include "tu.h" #if NHT > 0 int htopen(),htclose(),htstrategy(),htread(),htwrite(),htdump(),htioctl(); #else #define htopen nodev #define htclose nodev #define htstrategy nodev #define htread nodev #define htwrite nodev #define htdump nodev #define htioctl nodev #endif #include "rk.h" #if NHK > 0 int rkstrategy(),rkread(),rkwrite(),rkintr(),rkdump(),rkreset(); #else #define rkstrategy nodev #define rkread nodev #define rkwrite nodev #define r((kintr nodev #define rkdump nodev #define rkreset nodev #endif #include "te.h" #if NTE > 0 int tmopen(),tmclose(),tmstrategy(),tmread(),tmwrite(); int tmioctl(),tmdump(),tmreset(); #else #define tmopen nodev #define tmclose nodev #define tmstrategy nodev #define tmread nodev #define tmwrite nodev #define tmioctl nodev #define tmdump nodev #define tmreset nodev #endif #include "ts.h" #if NTS > 0 int tsopen(),tsclose(),tsstrategy(),tsread(),tswrite(); int tsioctl(),tsdump(),tsreset(); #else #define tsopen nodev #define tsclose nodev #define tsstrategy nodev #define tsread nodev #define tswrite nodev #define tsioctl nodev #define tsdump nodev #define tsreset nodev #endif #include "mu.h" #if NMT > 0 int mtopen(),mtclose(),mtstrategy(),mtread(),mtwrite(); int mtioctl(),mtdump(); #else #define mtopen nodev #define mtclose nodev #define mtstrategy nodev #define mtread nodev #define mtwrite nodev #define mtioctl nodev #define mtdump nodev #endif #include "ra.h" #if NUDA > 0 int udopen(),udstrategy(),udread(),udwrite(),udreset(),uddump(); #else #define udopen nodev #define udstrategy nodev #define udread nodev #define udwrite nodev #define udreset nulldev #define uddump nodev #endif #include "up.h" #if NSC > 0 int upstrategy(),upread(),upwrite(),upreset(),updump(); #else #define upstrategy nodev #define upread nodev #define upwrite nodev #define upreset nulldev #define updump nodev #endif #if defined(VAX750) || defined(VAX7ZZ) int tuopen(),tuclose(),tustrategy(); #else #define tuopen nodev #define tuclose nodev #define tustrategy nodev #endif int swstrategy(),swread(),swwrite(); struct bdevsw bdevsw[] = { nulldev, nulldev, hpstrategy, hpdump, 0, /*0*/ htopen, htclose, htstrategy, htdump, B_TAPE, /*1*/ nulldev, nulldev, upstrategy, updump, 0, /*2*/ nulldev, nulldev, rkstrategy, rkdump, 0, /*3*/ nodev, nodev, swstrategy, nodev, 0, /*4*/ tmopen, tmclose, tmstrategy, tmdump, B_TAPE, /*5*/ tsopen, tsclose, tsstrategy, tsdump, B_TAPE, /*6*/ mtopen, mtclose, mtstrategy, mtdump, B_TAPE, /*7*/ tuopen, tuclose, tustrategy, nodev, B_TAPE, /*8*/ udopen, nulldev, udstrategy, uddump, 0, /*9*/ nodev, nodev, nodev, nodev, 0, /*10*/ 0, }; int cnopen(),cnclose(),cnread(),cnwrite(),cnioctl(); struct tty cons; #include "ct.h" #if NCT > 0 int ctopen(),ctclose(),ctwrite(); #else #define ctopen nulldev #define ctclose nulldev #define ctwrite nulldev #endif #include "dh.h" #if NDH == 0 #define dhopen nodev #define dhclose nodev #define dhread nodev #define dhwrite nodev #define dhioctl nodev #define dhstop nodev #define dhreset nulldev #define dh11 0 #else int dhopen(),dhclose(),dhread(),dhwrite(),dhioctl(),dhstop(),dhreset(); struct tty dh11[]; #endif #if VAX780 int flopen(),flclose(),flread(),flwrite(); #endif #include "dz.h" #if NDZ == 0 #define dzopen nodev #define dzclose nodev #define dzread nodev #define dzwrite nodev #define dzioctl nodev #define dzstop nodev #define dzreset nulldev #define dz_tty 0 #else int dzopen(),dzclose(),dzread(),dzwrite(),dzioctl(),dzstop(),dzreset(); struct tty dz_tty[]; #endif #include "lp.h" #if NLP > 0 int lpopen(),lpclose(),lpwrite(),lpreset(); #else #define lpopen nodev #define lpclose nodev #define lpwrite nodev #define lpreset nulldev #endif int syopen(),syread(),sywrite(),syioctl(); int mmread(),mmwrite(); #include "va.h" #if NVA > 0 int vaopen(),vaclose(),vawrite(),vaioctl(),vareset(); #else #define vaopen nodev #define vaclose nodev #define vawrite nodev #define vaopen nodev #define vaioctl nodev #define vareset nulldev #endif #include "vp.h" #if NVP > 0 int vpopen(),vpclose(),vpwrite(),vpioctl(),vpreset(); #else #define vpopen nodev #define vpclose nodev #define vpwrite nodev #define vpioctl nodev #define vpreset nulldev #endif int mxopen(),mxclose(),mxread(),mxwrite(),mxioctl(); int mcread(); char *mcwrite(); #include "pty.h" #if NPTY > 0 int ptsopen(), ptsclose(), ptsread(), ptswrite(); int ptcopen(), ptcclose(), ptcread(), ptcwrite(); int ptyioctl(); struct tty pt_tty[]; #else #define ptsopen nodev #define ptsclose nodev #define ptsread nodev #define ptswrite nodev #define ptcopen nodev #define ptcclose nodev #define ptcread nodev #define ptcwrite nodev #define ptyioctl nodev #define pt_tty 0 #endif #include "dn.h" #if NDN > 0 int dnopen(), dnclose(), dnwrite(); #else #define dnopen nodev #define dnclose nodev #define dnwrite nodev #endif struct cdevsw cdevsw[] = { cnopen, cnclose, cnread, cnwrite, /*0*/ cnioctl, nulldev, nulldev, &cons, dzopen, dzclose, dzread, dzwrite, /*1*/ dzioctl, dzstop, dzreset, dz_tty, syopen, nulldev, syread, sywrite, /*2*/ syioctl, nulldev, nulldev, 0, nulldev, nulldev, mmread, mmwrite, /*3*/ nodev, nulldev, nulldev, 0, nulldev, nulldev, hpread, hpwrite, /*4*/ nodev, nodev, nulldev, 0, htopen, htclose, htread, htwrite, /*5*/ htioctl, nodev, nulldev, 0, vpopen, vpclose, nodev, vpwrite, /*6*/ vpioctl, nulldev, vpreset, 0, nulldev, nulldev, swread, swwrite, /*7*/ nodev, nodev, nulldev, 0, #if VAX780 flopen, flclose, flread, flwrite, /*8*/ nodev, nodev, nulldev, 0, #else nodev, nodev, nodev, nodev, /*8*/ nodev, nodev, nodev, 0, #endif mxopen, mxclose, mxread, mxwrite, /*9*/ mxioctl, nulldev, nulldev, 0, vaopen, vaclose, nodev, vawrite, /*10*/ vaioctl, nulldev, vareset, 0, nulldev, nulldev, rkread, rkwrite, /*11*/ nodev, nodev, rkreset, 0, dhopen, dhclose, dhread, dhwrite, /*12*/ dhioctl, dhstop, dhreset, dh11, nulldev, nulldev, upread, upwrite, /*13*/ nodev, nodev, upreset, 0, tmopen, tmclose, tmread, tmwrite, /*14*/ tmioctl, nodev, tmreset, 0, lpopen, lpclose, nodev, lpwrite, /*15*/ nodev, nodev, lpreset, 0, tsopen, tsclose, tsread, tswrite, /*16*/ tsioctl, nodev, tsreset, 0, nodev, nodev, nodev, nodev, /*17*/ nodev, nodev, nulldev, 0, ctopen, ctclose, nodev, ctwrite, /*18*/ nodev, nodev, nulldev, 0, mtopen, mtclose, mtread, mtwrite, /*19*/ mtioctl, nodev, nodev, 0, ptsopen, ptsclose, ptsread, ptswrite, /*20*/ ptyioctl, nulldev, nodev, pt_tty, ptcopen, ptcclose, ptcread, ptcwrite, /*21*/ ptyioctl, nulldev, nodev, pt_tty, dnopen, dnclose, nodev, dnwrite, /*22*/ nodev, nodev, nodev, 0, nodev, nodev, nodev, nodev, /*23*/ nodev, nodev, nodev, 0, udopen, nulldev, udread, udwrite, /*24*/ nodev, nodev, udreset, 0, nodev, nodev, nodev, nodev, /*25*/ nodev, nodev, nodev, 0, /* 25-29 reserved to local sites */ 0, }; int ttyopen(),ttread(),nullioctl(),ttstart(); char *ttwrite(); int ttyinput(),ttyrend(); #include "bk.h" #if NBK > 0 int bkopen(),bkclose(),bkread(),bkinput(),bkioctl(); #endif int ntyopen(),ntyclose(),ntread(); char *ntwrite(); int ntyinput(),ntyrend(); struct linesw linesw[] = { ttyopen, nulldev, ttread, ttwrite, nullioctl, ttyinput, ttyrend, nulldev, nulldev, nulldev, /* 0 */ #if NBK > 0 bkopen, bkclose, bkread, ttwrite, bkioctl, bkinput, nodev, nulldev, ttstart, nulldev, /* 1 */ #else nodev, nodev, nodev, (char *(*)())nodev, nodev, nodev, nodev, nodev, nodev, nodev, #endif ntyopen, ntyclose, ntread, ntwrite, nullioctl, ntyinput, ntyrend, nulldev, ttstart, nulldev, /* 2 */ mxopen, mxclose, mcread, mcwrite, mxioctl, nulldev, nulldev, nulldev, nulldev, nulldev, /* 3 */ 0 }; int nldisp = 3; struct buf bfreelist[BQUEUES]; /* buffer chain headers */ struct buf bswlist; /* free list of swap headers */ struct buf *bclnlist; /* header for list of cleaned pages */ struct acct acctbuf; struct inode *acctp; int mem_no = 3; /* major device number of memory special file */ /* * Swapdev is a fake device implemented * in sw.c used only internally to get to swstrategy. * It cannot be provided to the users, because the * swstrategy routine munches the b_dev and b_blkno entries * before calling the appropriate driver. This would horribly * confuse, e.g. the hashing routines. Instead, /dev/drum is * provided as a character (raw) device. */ dev_t swapdev = makedev(4, 0); extern struct user u; node *acctp; int mem_no = 3; /* major device number of memory special file */ /* * Swapdev is a fake device implemented * in sw.c used only internally to gesys/dev/cons.c 444 0 33 6531 2633227204 6540 /* cons.c 4.11 81/12/03 */ /* * VAX console driver and floppy interface */ #include "../h/param.h" #include "../h/conf.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/tty.h" #include "../h/systm.h" #include "../h/cons.h" #include "../h/mtpr.h" #include "../h/mx.h" #include "../h/cpu.h" struct tty cons; int cnstart(); int ttrstrt(); char partab[]; /*ARGSUSED*/ cnopen(dev, flag) dev_t dev; { register struct tty *tp; tp = &cons; tp->t_oproc = cnstart; tp->t_iproc = NULL; if ((tp->t_state&ISOPEN) == 0) { ttychars(tp); tp->t_state = ISOPEN|CARR_ON; tp->t_flags = EVENP|ECHO|XTABS|CRMOD; } if (tp->t_state&XCLUDE && u.u_uid != 0) { u.u_error = EBUSY; return; } mtpr(RXCS, mfpr(RXCS)|RXCS_IE); mtpr(TXCS, mfpr(TXCS)|TXCS_IE); (*linesw[tp->t_line].l_open)(dev, tp); } /*ARGSUSED*/ cnclose(dev) dev_t dev; { register struct tty *tp; tp = &cons; (*linesw[tp->t_line].l_close)(tp); ttyclose(tp); } /*ARGSUSED*/ cnread(dev) dev_t dev; { register struct tty *tp; tp = &cons; (*linesw[tp->t_line].l_read)(tp); } /*ARGSUSED*/ cnwrite(dev) dev_t dev; { register struct tty *tp; tp = &cons; (*linesw[tp->t_line].l_write)(tp); } /* * Got a level-20 receive interrupt - * the LSI wants to give us a character. * Catch the character, and see who it goes to. */ /*ARGSUSED*/ cnrint(dev) dev_t dev; { register int c; register struct tty *tp; c = mfpr(RXDB); if (c&RXDB_ID) { #if VAX780 if (cpu == VAX_780) cnrfl(c); #endif return; } tp = &cons; (*linesw[tp->t_line].l_rint)(((c, tp); } /*ARGSUSED*/ cnioctl(dev, cmd, addr, flag) dev_t dev; caddr_t addr; { register struct tty *tp; tp = &cons; cmd = (*linesw[tp->t_line].l_ioctl)(tp, cmd, addr); if (cmd == 0) return; if (ttioctl(tp, cmd, addr, flag) == 0) u.u_error = ENOTTY; } int consdone = 1; /* * Got a level-20 transmission interrupt - * the LSI wants another character. First, * see if we can send something to the typewriter. * If not, try the floppy. */ /*ARGSUSED*/ cnxint(dev) dev_t dev; { register struct tty *tp; consdone++; tp = &cons; tp->t_state &= ~BUSY; if (tp->t_line) (*linesw[tp->t_line].l_start)(tp); else cnstart(tp); #if VAX780 if (cpu==VAX_780 && (tp->t_state & BUSY) == 0) conxfl(); #endif } cnstart(tp) register struct tty *tp; { register c; register s; s = spl5(); if (tp->t_state & (TIMEOUT|BUSY|TTSTOP)) goto out; if (tp->t_state&ASLEEP && tp->t_outq.c_cc <= TTLOWAT(tp)) { tp->t_state &= ~ASLEEP; if (tp->t_chan) mcstart(tp->t_chan, (caddr_t)&tp->t_outq); else wakeup((caddr_t)&tp->t_outq); } if (tp->t_outq.c_cc == 0) goto out; if (consdone == 0) return; c = getc(&tp->t_outq); if (tp->t_flags&RAW || tp->t_local&LLITOUT) mtpr(TXDB, c&0xff); else if (c<=0177) mtpr(TXDB, (c | (partab[c]&0200))&0xff); else { timeout(ttrstrt, (caddr_t)tp, (c&0177)); tp->t_state |= TIMEOUT; goto out; } consdone = 0; tp->t_state |= BUSY; out: splx(s); } /* * Print a character on console. * Attempts to save and restore device * status. */ cnputc(c) register c; { register s, timo; timo = 30000; /* * Try waiting for the console tty to come ready, * otherwise give up after a reasonable time. */ while((mfpr(TXCS)&TXCS_RDY) == 0) if(--timo == 0) break; if(c == 0) return; s = mfpr(TXCS); mtpr(TXCS, 0); mtpr(TXDB, c&0xff); if(c == '\n') cnputc('\r'); cnputc(0); mtpr(TXCS, s); } nsdone = 0; tp->t_state |= BUSY; out: splx(s); } /* * Print a character on console. * Attempts to save and restore device * status. */ cnputc(c) register c;sys/dev/ct.c 444 0 33 4407 2551524245 6210 /* ct.c 4.6 81/07/05 */ #include "ct.h" #if NCT > 0 /* * GP DR11C driver used for C/A/T * * BUGS: * This driver hasn't been tested in 4.1bsd */ #include "../h/param.h" #include "../h/systm.h" #include "../h/tty.h" #include "../h/pte.h" #include "../h/map.h" #include "../h/buf.h" #include "../h/ubareg.h" #include "../h/ubavar.h" #include "../h/conf.h" #include "../h/dir.h" #include "../h/user.h" #define PCAT (PZERO+9) #define CATHIWAT 100 #define CATLOWAT 30 struct ct_softc { int sc_openf; struct clist sc_oq; } ct_softc[NCT]; struct ctdevice { short ctcsr; short ctbuf; }; int ctprobe(), ctattach(), ctintr(); struct uba_device *ctdinfo[NCT]; u_short ctstd[] = { 0 }; struct uba_driver ctdriver = { ctprobe, 0, ctattach, 0, ctstd, "ct", ctdinfo }; #define CTUNIT(dev) (minor(dev)) ctprobe(reg) caddr_t reg; { register int br, cvec; /* value-result */ register struct ctdevice *ctaddr = (struct ctdevice *)reg; ctaddr->ctcsr = IENABLE; DELAY(10000); ctaddr->ctcsr = 0; } /*ARGSUSED*/ ctattach(ui) register struct uba_device *ui; { } ctopen(dev) dev_t dev; { register struct ct_softc *sc; register struct uba_device *ui; register struct ctdevice *ctaddr; if (CTUNIT(dev) >= NCT || (ui = ctdinfo[CTUNIT(dev)]) == 0 || ui->ui_alive == 0 || (sc = &ct_softc[CTUNIT(dev)])->sc_openf) { u.u_error = ENXIO; return; } sc->sc_openf = 1; ctaddr->ctcsr |= IENABLE; } ctclose(dev) dev_t dev; { ct_softc[CTUNIT(dev)].sc_openf = 0; ctintr(dev); } ctwrite(dev) dev_t dev; { register struct ct_softc *sc = &ct_softc[CTUNIT(dev)]; register int c; while ((c=cpass()) >= 0) { (void) spl5(); while (sc->sc_oq.c_cc > CATHIWAT) sleep((caddr_t)&sc->sc_oq, PCAT); while (putc(c, &sc->sc_oq) < 0) sleep((caddr_t)&lbolt, PCAT); ctintr(dev); (void) spl0(); } } ctintr(dev) dev_t dev; { register int c; register struct ct_softc *sc = &ct_softc[CTUNIT(dev)]; register struct ctdevice *ctaddr = (struct ctdevice *)ctdinfo[CTUNIT(dev)]->ui_addr; if (ctaddr->ctcsr&DONE) { if ((c = getc(&sc->sc_oq)) >= 0) { #if MH135A c |= (c & 01) << 8; /* for dr11c bug */ #endif ctaddr->ctbuf = c; if (sc->sc_oq.c_cc==0 || sc->sc_oq.c_cc==CATLOWAT) wakeup(&sc->sc_oq); } else { if (sc->sc_openf==0) ctaddr->ctcsr = 0; } } } #endif oid) spl0(); } } ctintr(dev) dev_t dev; { register int c; register struct ct_softc *sc = &ct_softc[CTUNIT(dev)]; register struct ctdevice *ctaddr = (struct ctdevice *)ctdinfo[CTUNIT(dev)]->ui_addr; if (ctaddr->ctcsr&DONE) { if ((c = gsys/dev/dz.c 444 0 33 23445 2574131420 6234 /* dz.c 4.29 81/08/31 */ #include "dz.h" #if NDZ > 0 /* * DZ-11 Driver * * This driver mimics dh.c; see it for explanation of common code. */ #include "bk.h" #include "../h/param.h" #include "../h/systm.h" #include "../h/tty.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/map.h" #include "../h/pte.h" #include "../h/buf.h" #include "../h/vm.h" #include "../h/ubavar.h" #include "../h/conf.h" #include "../h/pdma.h" #include "../h/bk.h" #include "../h/file.h" #include "../h/mx.h" /* * Driver information for auto-configuration stuff. */ int dzprobe(), dzattach(), dzrint(); struct uba_device *dzinfo[NDZ]; u_short dzstd[] = { 0 }; struct uba_driver dzdriver = { dzprobe, 0, dzattach, 0, dzstd, "dz", dzinfo }; #define NDZLINE (NDZ*8) /* * Registers and bits */ /* Bits in dzlpr */ #define BITS7 020 #define BITS8 030 #define TWOSB 040 #define PENABLE 0100 #define OPAR 0200 /* Bits in dzrbuf */ #define DZ_PE 010000 #define DZ_FE 020000 #define DZ_DO 040000 /* Bits in dzcsr */ #define DZ_CLR 020 /* Reset dz */ #define DZ_MSE 040 /* Master Scan Enable */ #define DZ_RIE 0100 /* Receiver Interrupt Enable */ #define DZ_SAE 010000 /* Silo Alarm Enable */ #define DZ_TIE 040000 /* Transmit Interrupt Enable */ #define DZ_IEN (DZ_MSE|DZ_RIE|DZ_TIE|DZ_SAE) /* Flags for modem-control */ #define DZ_ON 1 #define DZ_OFF 0 int dzstart(), dzxint(), dzdma(); int ttrstrt(); struct tty dz_tty[NDZLINE]; int dz_cnt = { NDZLINE }; int dzact; struct device { short dzcsr; /* control-status register */ short dzrbuf; /* receiver buffer */ #define dzlpr dzrbuf /* line parameter reg is write of dzrbuf */ char dztcr; /* transmit control register */ char dzdtr; /* data terminal ready */ char dztbuf; /* transmit buffer */ char dzbrk; /* break control */ #define dzmsr dzbrk /* modem status register */ }; /* * Software copy of dzbrk since it isn't readable */ char dz_brk[NDZ]; char dzsoftCAR[NDZ]; /* * The dz doesn't interrupt on carrier transitions, so * we have to use a timer to watch it. */ char dz_timer; /* timer started? */ /* * Pdma structures for fast output code */ struct pdma dzpdma[NDZLINE]; char dz_speeds[] = { 0,020,021,022,023,024,0,025,026,027,030,032,034,036,0,0 }; dzprobe(reg) caddr_t reg; { register int br, cvec; register struct device *dzaddr = (struct device *)reg; #ifdef lint br = 0; cvec = br; br = cvec; #endif dzaddr->dzcsr = DZ_TIE|DZ_MSE; dzaddr->dztcr = 1; /* enable any line */ DELAY(100000); dzaddr->dzcsr = DZ_CLR; /* reset everything */ if (cvec && cvec != 0x200) cvec -= 4; return (1); } dzattach(ui) register struct uba_device *ui; { register struct pdma *pdp = &dzpdma[ui->ui_unit*8]; register struct tty *tp = &dz_tty[ui->ui_unit*8]; register int cntr; extern dzscan(); for (cntr = 0; cntr < 8; cntr++) { pdp->p_addr = (struct device *)ui->ui_addr; pdp->p_arg = (int)tp; pdp->p_fcn = dzxint; pdp++, tp++; } dzsoftCAR[ui->ui_unit] = ui->ui_flags; if (dz_timer == 0) { dz_timer++; timeout(dzscan, (caddr_t)0, hz); } } /*ARGSUSED*/ dzopen(dev, flag) dev_t dev; { register struct tty *tp; register int unit; unit = minor(dev); if (unit >= dz_cnt || dzpdma[unit].p_addr == 0) { u.u_error = ENXIO; return; } tp = &dz_tty[unit]; tp->t_addr = (caddr_t)&dzpdma[unit]; tp->t_oproc = dzstart; tp->t_iproc = NULL; tp->t_state |= WOPEN; if ((tp->t_state & ISOPEN) == 0) { ttychars(tp); tp->t_ospeed = tp->t_ispeed = B300; tp->t_flags = ODDP|EVENP|ECHO; /* tp->t_state |= HUPCLS; */ dzparam(unit); } else if (tp->t_state&XCLUDE && u.u_uid != 0) { u.u_error = EBUSY; return; } dzmodem(unit, DZ_ON); (void) spl5(); while ((tp->t_state & CARR_ON) == 0) { tp->t_state |= WOPEN; sleep((caddr_t)&tp->t_rawq, TTIPRI); } (void) spl0(); (*linesw[tp->t_line].l_open)(dev, tp); } /*ARGSUSED*/ dzclose(dev, flag) dev_t dev; { register struct tty *tp; register int unit; int dz; unit = minor(dev); dz = unit >> 3; tp = &dz_tty[unit]; (*linesw[tp->t_line].l_close)(tp); ((struct pdma *)(tp->t_addr))->p_addr->dzbrk = (dz_brk[dz] &= ~(1 << (unit&07))); if (tp->t_state & HUPCLS) dzmodem(unit, DZ_OFF); ttyclose(tp); } dzread(dev) dev_t dev; { register struct tty *tp; tp = &dz_tty[minor(dev)]; (*linesw[tp->t_line].l_read)(tp); } dzwrite(dev) dev_t dev; { register struct tty *tp; tp = &dz_tty[minor(dev)]; (*linesw[tp->t_line].l_write)(tp); } /*ARGSUSED*/ dzrint(dz) int dz; { register struct tty *tp; register int c; register struct device *dzaddr; register struct tty *tp0; register int unit; int overru((n = 0; if ((dzact & (1<dzrbuf) < 0) { /* char present */ tp = tp0 + ((c>>8)&07); if (tp >= &dz_tty[dz_cnt]) continue; if ((tp->t_state & ISOPEN) == 0) { wakeup((caddr_t)&tp->t_rawq); continue; } if (c&DZ_FE) if (tp->t_flags & RAW) c = 0; else c = tun.t_intrc; if (c&DZ_DO && overrun == 0) { printf("dz%d: silo overflow\n", dz); overrun = 1; } if (c&DZ_PE) if (((tp->t_flags & (EVENP|ODDP)) == EVENP) || ((tp->t_flags & (EVENP|ODDP)) == ODDP)) continue; #if NBK > 0 if (tp->t_line == NETLDISC) { c &= 0177; BKINPUT(c, tp); } else #endif (*linesw[tp->t_line].l_rint)(c, tp); } } /*ARGSUSED*/ dzioctl(dev, cmd, addr, flag) dev_t dev; caddr_t addr; { register struct tty *tp; register int unit = minor(dev); register int dz = unit >> 3; tp = &dz_tty[unit]; cmd = (*linesw[tp->t_line].l_ioctl)(tp, cmd, addr); if (cmd == 0) return; if (ttioctl(tp, cmd, addr, flag)) { if (cmd==TIOCSETP || cmd==TIOCSETN) dzparam(unit); } else switch(cmd) { case TIOCSBRK: ((struct pdma *)(tp->t_addr))->p_addr->dzbrk = (dz_brk[dz] |= 1 << (unit&07)); break; case TIOCCBRK: ((struct pdma *)(tp->t_addr))->p_addr->dzbrk = (dz_brk[dz] &= ~(1 << (unit&07))); break; case TIOCSDTR: dzmodem(unit, DZ_ON); break; case TIOCCDTR: dzmodem(unit, DZ_OFF); break; default: u.u_error = ENOTTY; } } dzparam(unit) register int unit; { register struct tty *tp; register struct device *dzaddr; register int lpr; tp = &dz_tty[unit]; dzaddr = dzpdma[unit].p_addr; dzaddr->dzcsr = DZ_IEN; dzact |= (1<<(unit>>3)); if (tp->t_ispeed == 0) { dzmodem(unit, DZ_OFF); /* hang up line */ return; } lpr = (dz_speeds[tp->t_ispeed]<<8) | (unit & 07); if ((tp->t_local&LLITOUT) || (tp->t_flags&RAW)) lpr |= BITS8; else lpr |= (BITS7|PENABLE); if ((tp->t_flags & EVENP) == 0) lpr |= OPAR; if (tp->t_ispeed == B110) lpr |= TWOSB; dzaddr->dzlpr = lpr; } dzxint(tp) register struct tty *tp; { register struct pdma *dp; register s; s = spl5(); /* block pdma interrupts */ dp = (struct pdma *)tp->t_addr; tp->t_state &= ~BUSY; if (tp->t_state & FLUSH) tp->t_state &= ~FLUSH; else ndflush(&tp->t_outq, dp->p_mem-tp->t_outq.c_cf); if (tp->t_line) (*linesw[tp->t_line].l_start)(tp); else dzstart(tp); if (tp->t_outq.c_cc == 0 || (tp->t_state&BUSY)==0) dp->p_addr->dztcr &= ~(1 << (minor(tp->t_dev)&07)); splx(s); } dzstart(tp) register struct tty *tp; { register struct pdma *dp; register struct device *dzaddr; register int cc; int s; dp = (struct pdma *)tp->t_addr; dzaddr = dp->p_addr; s = spl5(); if (tp->t_state & (TIMEOUT|BUSY|TTSTOP)) goto out; if (tp->t_state&ASLEEP && tp->t_outq.c_cc <= TTLOWAT(tp)) { tp->t_state &= ~ASLEEP; if (tp->t_chan) mcstart(tp->t_chan, (caddr_t)&tp->t_outq); else wakeup((caddr_t)&tp->t_outq); } if (tp->t_outq.c_cc == 0) goto out; if (tp->t_flags&RAW || tp->t_local&LLITOUT) cc = ndqb(&tp->t_outq, 0); else { cc = ndqb(&tp->t_outq, 0200); if (cc == 0) { cc = getc(&tp->t_outq); timeout(ttrstrt, (caddr_t)tp, (cc&0x7f) + 6); tp->t_state |= TIMEOUT; goto out; } } tp->t_state |= BUSY; dp->p_end = dp->p_mem = tp->t_outq.c_cf; dp->p_end += cc; dzaddr->dztcr |= 1 << (minor(tp->t_dev) & 07); /* force intr */ out: splx(s); } /* * Stop output on a line. */ /*ARGSUSED*/ dzstop(tp, flag) register struct tty *tp; { register struct pdma *dp; register int s; dp = (struct pdma *)tp->t_addr; s = spl5(); if (tp->t_state & BUSY) { dp->p_end = dp->p_mem; if ((tp->t_state&TTSTOP)==0) tp->t_state |= FLUSH; } splx(s); } dzmodem(unit, flag) register int unit; { register struct device *dzaddr; register char bit; dzaddr = dzpdma[unit].p_addr; bit = 1<<(unit&07); if (flag == DZ_OFF) dzaddr->dzdtr &= ~bit; else dzaddr->dzdtr |= bit; } dzscan() { register i; register struct device *dzaddr; register bit; register struct tty *tp; for (i = 0; i < dz_cnt ; i++) { dzaddr = dzpdma[i].p_addr; if (dzaddr == 0) continue; tp = &dz_tty[i]; bit = 1<<(i&07); if ((dzsoftCAR[i>>3]&bit) || (dzaddr->dzmsr&bit)) { /* carrier present */ if ((tp->t_state & CARR_ON) == 0) { wakeup((caddr_t)&tp->t_rawq); tp->t_state |= CARR_ON; } } else { if ((tp->t_state&CARR_ON) && (tp->t_local&LNOHANG)==0) { /* carrier lost */ if (tp->t_state&ISOPEN) { gsignal(tp->t_pgrp, SIGHUP); gsignal(tp->t_pgrp, SIGCONT); dzaddr->dzdtr &= ~bit; flushtty(tp, FREAD|FWRITE); } tp->t_state &= ~CARR_ON; } } } timeout(dzscan, (caddr_t)0, 2*hz); } dztimer() { int dz; for (dz = 0; dz < NDZ; dz++) dzrint(dz); } /* * Reset state of driver if UBA reset was necessary. * Reset parameters and restart transmission on open lines. */ dzreset(uban) int uban; { register int unit; register struct tty *tp; register struct uba_device *ui; for (unit = 0; unit < NDZLINE; unit++) { ui = dzinfo[unit >> 3]; if (ui == 0 || ui->ui_ubanum != uban || ui->ui_alive == 0) continue; if (unit%8 == 0) printf(" dz%d", unit>>3); tp = &dz_tty[unit]; if (tp->t_state & (ISOPEN|WOPEN)) { dzparam(unit); dzmodem(unit, DZ_ON); tp->t_state &= ~BUSY; dzstart(tp); } } dztimer(); } #endif nd restart transmission on open lines. */ dzreset(uban) int uban; { register int unit; register struct tty *tp; register struct uba_device *ui; for (unit = 0; unit < NDZLINE; unit++) { ui = dzinfo[unit >> 3]; sys/dev/dkleave.c 444 0 33 766 2506427525 7204 /* dkleave.c 4.2 81/03/08 */ #ifdef INTRLVE #include "../h/param.h" #include "../h/buf.h" daddr_t dkblock(bp) register struct buf *bp; { register int dminor; if (((dminor=minor(bp->b_dev))&0100) == 0) return(bp->b_blkno); dminor >>= 3; dminor &= 07; dminor++; return(bp->b_blkno/dminor); } dkunit(bp) register struct buf *bp; { register int dminor; dminor = minor(bp->b_dev) >> 3; if ((dminor&010) == 0) return(dminor); dminor &= 07; dminor++; return(bp->b_blkno%dminor); } #endif "sys/dev/dsort.c 444 0 33 5256 2506427525 6743 /* dsort.c 4.3 81/03/08 */ /* * Seek sort for disks. We depend on the driver * which calls us using b_resid as the current cylinder number. * * The argument dp structure holds a b_actf activity chain pointer * on which we keep two queues, sorted in ascending cylinder order. * The first queue holds those requests which are positioned after * the current cylinder (in the first request); the second holds * requests which came in after their cylinder number was passed. * Thus we implement a one way scan, retracting after reaching the * end of the drive to the first request on the second queue, * at which time it becomes the first queue. * * A one-way scan is natural because of the way UNIX read-ahead * blocks are allocated. */ #include "../h/param.h" #include "../h/systm.h" #include "../h/buf.h" #define b_cylin b_resid disksort(dp, bp) register struct buf *dp, *bp; { register struct buf *ap; /* * If nothing on the activity queue, then * we become the only thing. */ ap = dp->b_actf; if(ap == NULL) { dp->b_actf = bp; dp->b_actl = bp; bp->av_forw = NULL; return; } /* * If we lie after the first (currently active) * request, then we must locate the second request list * and add ourselves to it. */ if (bp->b_cylin < ap->b_cylin) { while (ap->av_forw) { /* * Check for an ``inversion'' in the * normally ascending cylinder numbers, * indicating the start of the second request list. */ if (ap->av_forw->b_cylin < ap->b_cylin) { /* * Search the second request list * for the first request at a larger * cylinder number. We go before that; * if there is no such request, we go at end. */ do { if (bp->b_cylin < ap->av_forw->b_cylin) goto insert; ap = ap->av_forw; } while (ap->av_forw); goto insert; /* after last */ } ap = ap->av_forw; } /* * No inversions... we will go after the last, and * be the first request in the second request list. */ goto insert; } /* * Request is at/after the current request... * sort in the first request list. */ while (ap->av_forw) { /* * We want to go after the current request * if there is an inversion after it (i.e. it is * the end of the first request list), or if * the next request is a larger cylinder than our request. */ if (ap->av_forw->b_cylin < ap->b_cylin || bp->b_cylin < ap->av_forw->b_cylin) goto insert; ap = ap->av_forw; } /* * Neither a second list nor a larger * request... we go at the end of the first list, * which is the same as the end of the whole schebang. */ insert: bp->av_forw = ap->av_forw; ap->av_forw = bp; if (ap == dp->b_actl) dp->b_actl = bp; } ter it (i.e. it is * the end of the first request list), or if * the next request is a larger cylinder than our request. */ if (ap->av_forw->b_cylin < ap->b_cylin || bp->b_cylin < ap->av_forw->b_cylin) goto insert; ap = ap->av_forw; } /* * Neither a second list nor a larger * request... we go at the end of th((sys/dev/dh.c 444 0 33 41746 2634513260 6221 /* dh.c 4.39 81/12/07 */ #include "dh.h" #if NDH > 0 /* * DH-11/DM-11 driver */ #include "bk.h" #include "../h/param.h" #include "../h/conf.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/tty.h" #include "../h/map.h" #include "../h/pte.h" #include "../h/buf.h" #include "../h/vm.h" #include "../h/ubareg.h" #include "../h/ubavar.h" #include "../h/bk.h" #include "../h/clist.h" #include "../h/mx.h" #include "../h/file.h" /* * Definition of the driver for the auto-configuration program. * There is one definition for the dh and one for the dm. */ int dhprobe(), dhattach(), dhrint(), dhxint(); struct uba_device *dhinfo[NDH]; u_short dhstd[] = { 0 }; struct uba_driver dhdriver = { dhprobe, 0, dhattach, 0, dhstd, "dh", dhinfo }; int dmprobe(), dmattach(), dmintr(); struct uba_device *dminfo[NDH]; u_short dmstd[] = { 0 }; struct uba_driver dmdriver = { dmprobe, 0, dmattach, 0, dmstd, "dm", dminfo }; struct dhdevice { union { short dhcsr; /* control-status register */ char dhcsrl; /* low byte for line select */ } un; short dhrcr; /* receive character register */ short dhlpr; /* line parameter register */ u_short dhcar; /* current address register */ short dhbcr; /* byte count register */ u_short dhbar; /* buffer active register */ short dhbreak; /* break control register */ short dhsilo; /* silo status register */ }; /* Bits in dhcsr */ #define DH_TI 0100000 /* transmit interrupt */ #define DH_SI 0040000 /* storage interrupt */ #define DH_TIE 0020000 /* transmit interrupt enable */ #define DH_SIE 0010000 /* storage interrupt enable */ #define DH_MC 0004000 /* master clear */ #define DH_NXM 0002000 /* non-existant memory */ #define DH_MM 0001000 /* maintenance mode */ #define DH_CNI 0000400 /* clear non-existant memory interrupt */ #define DH_RI 0000200 /* receiver interrupt */ #define DH_RIE 0000100 /* receiver interrupt enable */ /* Bits in dhlpr */ #define BITS6 01 #define BITS7 02 #define BITS8 03 #define TWOSB 04 #define PENABLE 020 /* DEC manuals incorrectly say this bit causes generation of even parity. */ #define OPAR 040 #define HDUPLX 040000 #define DH_IE (DH_TIE|DH_SIE|DH_RIE) /* Bits in dhrcr */ #define DH_PE 0010000 /* parity error */ #define DH_FE 0020000 /* framing error */ #define DH_DO 0040000 /* data overrun */ struct dmdevice { short dmcsr; /* control status register */ short dmlstat; /* line status register */ short dmpad1[2]; }; /* bits in dm csr */ #define DM_RF 0100000 /* ring flag */ #define DM_CF 0040000 /* carrier flag */ #define DM_CTS 0020000 /* clear to send */ #define DM_SRF 0010000 /* secondary receive flag */ #define DM_CS 0004000 /* clear scan */ #define DM_CM 0002000 /* clear multiplexor */ #define DM_MM 0001000 /* maintenance mode */ #define DM_STP 0000400 /* step */ #define DM_DONE 0000200 /* scanner is done */ #define DM_IE 0000100 /* interrupt enable */ #define DM_SE 0000040 /* scan enable */ #define DM_BUSY 0000020 /* scan busy */ /* bits in dm lsr */ #define DML_RNG 0000200 /* ring */ #define DML_CAR 0000100 /* carrier detect */ #define DML_CTS 0000040 /* clear to send */ #define DML_SR 0000020 /* secondary receive */ #define DML_ST 0000010 /* secondary transmit */ #define DML_RTS 0000004 /* request to send */ #define DML_DTR 0000002 /* data terminal ready */ #define DML_LE 0000001 /* line enable */ #define DML_ON (DML_DTR|DML_RTS|DML_LE) #define DML_OFF (DML_LE) /* * Local variables for the driver */ short dhsar[NDH]; /* software copy of last bar */ short dhsoftCAR[NDH]; struct tty dh11[NDH*16]; int ndh11 = NDH*16; int dhact; /* mask of active dh's */ int dhstart(), ttrstrt(); /* * The clist space is mapped by the driver onto each UNIBUS. * The UBACVT macro converts a clist space address for unibus uban * into an i/o space address for the DMA routine. */ int dh_ubinfo[MAXNUBA]; /* info about allocated unibus map */ int cbase[MAXNUBA]; /* base address in unibus map */ #define UBACVT(x, uban) (cbase[uban] + ((x)-(char *)cfree)) /* * Routine for configuration to force a dh to interrupt. * Set to transmit at 9600 baud, and cause a transmitter interrupt. */ /*ARGSUSED*/ dhprobe(reg) caddr_t reg; { register int br, cvec; /* these are ``value-result'' */ register struct dhdevice *dhaddr = (struct dhdevice *)reg; #ifdef lint br = 0; cvec = br; br = cvec; #endif #ifndef notdef dhaddr->un.dhcsr = DH_RIE|DH_MM|DH_RI; DELAY(1000); dhaddr->un.dhcsr = 0; #else dhaddr->un.dhcsr = DH_TIE; DELAY(5); dhaddr->dhlpr = (B9600 << 10) | (B9600 << 6) | BITS7|PENABLE; dhaddr->dhbcr = -1; dhaddr->dhcar = 0; dhaddr->dhbar = 1; DELAY(100000); /* wait 1/10'th of a sec for interrupt */ dhaddr->un.dhcsr = 0; if (cvec && cvec != 0x200) cvec -= 4; /* transmit -> receive */ #endif return (1); } /* * Routine called to attach a dh. */ dhattach(ui) struct uba_device *ui; { dhsoftCAR[ui->ui_unit] = ui->ui_flags; } /* * Configuration routine to cause a dm to interrupt. */ dmprobe(reg) caddr_t reg; { register int br, vec; /* value-result */ register struct dmdevice *dmaddr = (struct dmdevice *)reg; #ifdef lint br = 0; vec = br; br = vec; #endif dmaddr->dmcsr = DM_DONE|DM_IE; DELAY(20); dmaddr->dmcsr = 0; return (1); } /*ARGSUSED*/ dmattach(ui) struct uba_device *ui; { /* no local state to set up */ } /* * Open a DH11 line, mapping the clist onto the uba if this * is the first dh on this uba. Turn on this dh if this is * the first use of it. Also do a dmopen to wait for carrier. */ /*ARGSUSED*/ dhopen(dev, flag) dev_t dev; { register struct tty *tp; register int unit, dh; register struct dhdevice *addr; register struct uba_device *ui; int s; unit = minor(dev); dh = unit >> 4; if (unit >= NDH*16 || (ui = dhinfo[dh])== 0 || ui->ui_alive == 0) { u.u_error = ENXIO; return; } tp = &dh11[unit]; if (tp->t_state&XCLUDE && u.u_uid!=0) { u.u_error = EBUSY; return; } addr = (struct dhdevice *)ui->ui_addr; tp->t_addr = (caddr_t)addr; tp->t_oproc = dhstart; tp->t_iproc = NULL; tp->t_state |= WOPEN; /* * While setting up state for this uba and this dh, * block uba resets which can clear the state. */ s = spl5(); if (dh_ubinfo[ui->ui_ubanum] == 0) { /* 512+ is a kludge to try to get around a hardware problem */ dh_ubinfo[ui->ui_ubanum] = uballoc(ui->ui_ubanum, (caddr_t)cfree, 512+nclist*sizeof(struct cblock), 0); cbase[ui->ui_ubanum] = dh_ubinfo[ui->ui_ubanum]&0x3ffff; } if ((dhact&(1<un.dhcsr |= DH_IE; dhact |= (1<dhsilo = 16; } splx(s); /* * If this is first open, initialze tty state to default. */ if ((tp->t_state&ISOPEN) == 0) { ttychars(tp); if (tp->t_ispeed == 0) { tp->t_ispeed = B300; tp->t_ospeed = B300; tp->t_flags = ODDP|EVENP|ECHO; } dhparam(unit); } /* * Wait for carrier, then process line discipline specific open. */ dmopen(dev); (*linesw[tp->t_line].l_open)(dev, tp); } /* * Close a DH11 line, turning off the DM11. */ /*ARGSUSED*/ dhclose(dev, flag) dev_t dev; int flag; { register struct tty *tp; register unit; unit = minor(dev); tp = &dh11[unit]; (*linesw[tp->t_line].l_close)(tp); ((struct dhdevice *)(tp->t_addr))->dhbreak &= ~(1<<(unit&017)); if (tp->t_state&HUPCLS || (tp->t_state&ISOPEN)==0) dmctl(unit, DML_OFF, DMSET); ttyclose(tp); } dhread(dev) dev_t dev; { register struct tty *tp; tp = &dh11[minor(dev)]; (*linesw[tp->t_line].l_read)(tp); } dhwrite(dev) dev_t dev; { register struct tty *tp; tp = &dh11[minor(dev)]; (*linesw[tp->t_line].l_write)(tp); } /* * DH11 receiver interrupt. */ dhrint(dh) int dh; { register struct tty *tp; register c; register struct dhdevice *addr; register struct tty *tp0; register struct uba_device *ui; int overrun = 0; ui = dhinfo[dh]; if (ui == 0 || ui->ui_alive == 0) return; addr = (struct dhdevice *)ui->ui_addr; tp0 = &dh11[dh<<4]; /* * Loop fetching characters from the silo for this * dh until there are no more in the silo. */ while ((c = addr->dhrcr) < 0) { tp = tp0 + ((c>>8)&0xf); if ((tp->t_state&ISOPEN)==0) { wakeup((caddr_t)tp); continue; } if (c & DH_PE) if ((tp->t_flags&(EVENP|ODDP))==EVENP || (tp->t_flags&(EVENP|ODDP))==ODDP ) continue; if ((c & DH_DO) && overrun == 0) { printf("dh%d: silo overflow\n", dh); overrun = 1; } if (c & DH_FE) /* * At framing error (break) generate * a null (in raw mode, for getty), or a * interrupt (in cooked/cbreak mode). */ if (tp->t_flags&RAW) c = 0; else c = tun.t_intrc; #if NBK > 0 if (tp->t_line == NETLDISC) { c &= 0177; BKINPUT(c, tp); } else #endif (*linesw[tp->t_line].l_rint)(c, tp); } } /* * Ioctl for DH11. */ /*ARGSUSED*/ dhioctl(dev, cmd, addr, flag) caddr_t addr; { register struct tty *tp; register unit = minor(dev); tp = &dh11[unit]; cmd = (*linesw[tp->t_line].l_ioctl)(tp, cmd, addr); if (cmd == 0) return; if (ttioctl(tp, cmd, addr, flag)) { if (cmd==TIOCSETP || cmd==TIOCSETN) dhparam(unit); } else switch(cmd) { case TIOCSBRK: ((struct dhdevice *)(tp->t_addr))->dhbreak |= 1<<(unit&017); break; case TIOCCBRK: ((struct dhdevice *)(tp->t_addr))->dhbreak &= ~(1<<(unit&017)); break; case TIOCSDTR: dmctl(unit, DML_DTR|DML_RTS, DMBIS); break; case TIOCCDTR: dmctl(unit, DML_DTR|DML_RTS, DMBIC); break; default: u.u_error = ENOTTY; } } /* * Set parameters from open or stty into the DH hardware * registers. */ dhparam(unit) register int unit; { register struct tty *tp; register struct dhdevice *addr; register int lpar; int s; tp = &dh11[unit]; addr = (struct dhdevice *)tp->t_a((ddr; /* * Block interrupts so parameters will be set * before the line interrupts. */ s = spl5(); addr->un.dhcsrl = (unit&0xf) | DH_IE; if ((tp->t_ispeed)==0) { tp->t_state |= HUPCLS; dmctl(unit, DML_OFF, DMSET); return; } lpar = ((tp->t_ospeed)<<10) | ((tp->t_ispeed)<<6); if ((tp->t_ispeed) == B134) lpar |= BITS6|PENABLE|HDUPLX; else if ((tp->t_flags&RAW) || (tp->t_local&LLITOUT)) lpar |= BITS8; else lpar |= BITS7|PENABLE; if ((tp->t_flags&EVENP) == 0) lpar |= OPAR; if ((tp->t_ospeed) == B110) lpar |= TWOSB; addr->dhlpr = lpar; splx(s); } /* * DH11 transmitter interrupt. * Restart each line which used to be active but has * terminated transmission since the last interrupt. */ dhxint(dh) int dh; { register struct tty *tp; register struct dhdevice *addr; short ttybit, bar, *sbar; register struct uba_device *ui; register int unit; u_short cntr; ui = dhinfo[dh]; addr = (struct dhdevice *)ui->ui_addr; if (addr->un.dhcsr & DH_NXM) { addr->un.dhcsr |= DH_CNI; printf("dh%d: NXM\n", dh); } sbar = &dhsar[dh]; bar = *sbar & ~addr->dhbar; unit = dh * 16; ttybit = 1; addr->un.dhcsr &= (short)~DH_TI; for (; bar; unit++, ttybit <<= 1) { if (bar & ttybit) { *sbar &= ~ttybit; bar &= ~ttybit; tp = &dh11[unit]; tp->t_state &= ~BUSY; if (tp->t_state&FLUSH) tp->t_state &= ~FLUSH; else { addr->un.dhcsrl = (unit&017)|DH_IE; /* * Do arithmetic in a short to make up * for lost 16&17 bits. */ cntr = addr->dhcar - UBACVT(tp->t_outq.c_cf, ui->ui_ubanum); ndflush(&tp->t_outq, (int)cntr); } if (tp->t_line) (*linesw[tp->t_line].l_start)(tp); else dhstart(tp); } } } /* * Start (restart) transmission on the given DH11 line. */ dhstart(tp) register struct tty *tp; { register struct dhdevice *addr; register int car, dh, unit, nch; int s; unit = minor(tp->t_dev); dh = unit >> 4; unit &= 0xf; addr = (struct dhdevice *)tp->t_addr; /* * Must hold interrupts in following code to prevent * state of the tp from changing. */ s = spl5(); /* * If it's currently active, or delaying, no need to do anything. */ if (tp->t_state&(TIMEOUT|BUSY|TTSTOP)) goto out; /* * If there are sleepers, and output has drained below low * water mark, wake up the sleepers. */ if ((tp->t_state&ASLEEP) && tp->t_outq.c_cc<=TTLOWAT(tp)) { tp->t_state &= ~ASLEEP; if (tp->t_chan) mcstart(tp->t_chan, (caddr_t)&tp->t_outq); else wakeup((caddr_t)&tp->t_outq); } /* * Now restart transmission unless the output queue is * empty. */ if (tp->t_outq.c_cc == 0) goto out; if (tp->t_flags&RAW || tp->t_local&LLITOUT) nch = ndqb(&tp->t_outq, 0); else { nch = ndqb(&tp->t_outq, 0200); /* * If first thing on queue is a delay process it. */ if (nch == 0) { nch = getc(&tp->t_outq); timeout(ttrstrt, (caddr_t)tp, (nch&0x7f)+6); tp->t_state |= TIMEOUT; goto out; } } /* * If characters to transmit, restart transmission. */ if (nch) { car = UBACVT(tp->t_outq.c_cf, dhinfo[dh]->ui_ubanum); addr->un.dhcsrl = unit|((car>>12)&0x30)|DH_IE; /* * The following nonsense with short word * is to make sure the dhbar |= word below * is done with an interlocking bisw2 instruction. */ { short word = 1 << unit; dhsar[dh] |= word; addr->dhcar = car; addr->dhbcr = -nch; addr->dhbar |= word; } tp->t_state |= BUSY; } out: splx(s); } /* * Stop output on a line, e.g. for ^S/^Q or output flush. */ /*ARGSUSED*/ dhstop(tp, flag) register struct tty *tp; { register struct dhdevice *addr; register int unit, s; addr = (struct dhdevice *)tp->t_addr; /* * Block input/output interrupts while messing with state. */ s = spl5(); if (tp->t_state & BUSY) { /* * Device is transmitting; stop output * by selecting the line and setting the byte * count to -1. We will clean up later * by examining the address where the dh stopped. */ unit = minor(tp->t_dev); addr->un.dhcsrl = (unit&017) | DH_IE; if ((tp->t_state&TTSTOP)==0) tp->t_state |= FLUSH; addr->dhbcr = -1; } splx(s); } /* * Reset state of driver if UBA reset was necessary. * Reset the csrl and lpr registers on open lines, and * restart transmitters. */ dhreset(uban) int uban; { register int dh, unit; register struct tty *tp; register struct uba_device *ui; int i; if (dh_ubinfo[uban] == 0) return; ubarelse(uban, &dh_ubinfo[uban]); dh_ubinfo[uban] = uballoc(uban, (caddr_t)cfree, 512+nclist*sizeof (struct cblock), 0); cbase[uban] = dh_ubinfo[uban]&0x3ffff; dh = 0; for (dh = 0; dh < NDH; dh++) { ui = dhinfo[dh]; if (ui == 0 || ui->ui_alive == 0 || ui->ui_ubanum != uban) continue; printf(" dh%d", dh); ((struct dhdevice *)ui->ui_addr)->un.dhcsr |= DH_IE; ((struct dhdevice *)ui->ui_addr)->dhsilo = 16; unit = dh * 16; for (i = 0; i < 16; i++) { tp = &dh11[unit]; if (tp->t_state & (ISOPEN|WOPEN)) { dhparam(unit); dmctl(unit, DML_ON, DMSET); tp->t_state &= ~BUSY; dhstart(tp); } unit++; } } dhtimer(); } /* * At software clock interrupt time or after a UNIBUS reset * empty all the dh silos. */ dhtimer() { register int dh; for (dh = 0; dh < NDH; dh++) dhrint(dh); } /* * Turn on the line associated with dh dev. */ dmopen(dev) dev_t dev; { register struct tty *tp; register struct dmdevice *addr; register struct uba_device *ui; register int unit; register int dm; int s; unit = minor(dev); dm = unit >> 4; tp = &dh11[unit]; unit &= 0xf; if (dm >= NDH || (ui = dminfo[dm]) == 0 || ui->ui_alive == 0 || (dhsoftCAR[dm]&(1<t_state |= CARR_ON; return; } addr = (struct dmdevice *)ui->ui_addr; s = spl5(); addr->dmcsr &= ~DM_SE; while (addr->dmcsr & DM_BUSY) ; addr->dmcsr = unit; addr->dmlstat = DML_ON; if (addr->dmlstat&DML_CAR) tp->t_state |= CARR_ON; addr->dmcsr = DM_IE|DM_SE; while ((tp->t_state&CARR_ON)==0) sleep((caddr_t)&tp->t_rawq, TTIPRI); splx(s); } /* * Dump control bits into the DM registers. */ dmctl(dev, bits, how) dev_t dev; int bits, how; { register struct uba_device *ui; register struct dmdevice *addr; register int unit, s; int dm; unit = minor(dev); dm = unit >> 4; if ((ui = dminfo[dm]) == 0 || ui->ui_alive == 0) return; addr = (struct dmdevice *)ui->ui_addr; s = spl5(); addr->dmcsr &= ~DM_SE; while (addr->dmcsr & DM_BUSY) ; addr->dmcsr = unit & 0xf; switch(how) { case DMSET: addr->dmlstat = bits; break; case DMBIS: addr->dmlstat |= bits; break; case DMBIC: addr->dmlstat &= ~bits; break; } addr->dmcsr = DM_IE|DM_SE; splx(s); } /* * DM11 interrupt; deal with carrier transitions. */ dmintr(dm) register int dm; { register struct uba_device *ui; register struct tty *tp; register struct dmdevice *addr; ui = dminfo[dm]; if (ui == 0) return; addr = (struct dmdevice *)ui->ui_addr; if (addr->dmcsr&DM_DONE) { if (addr->dmcsr&DM_CF) { tp = &dh11[(dm<<4)+(addr->dmcsr&0xf)]; wakeup((caddr_t)&tp->t_rawq); if ((tp->t_state&WOPEN)==0 && (tp->t_local&LMDMBUF)) { if (addr->dmlstat & DML_CAR) { tp->t_state &= ~TTSTOP; ttstart(tp); } else if ((tp->t_state&TTSTOP) == 0) { tp->t_state |= TTSTOP; dhstop(tp, 0); } } else if ((addr->dmlstat&DML_CAR)==0) { if ((tp->t_state&WOPEN)==0 && (tp->t_local&LNOHANG)==0) { gsignal(tp->t_pgrp, SIGHUP); gsignal(tp->t_pgrp, SIGCONT); addr->dmlstat = 0; flushtty(tp, FREAD|FWRITE); } tp->t_state &= ~CARR_ON; } else tp->t_state |= CARR_ON; } addr->dmcsr = DM_IE|DM_SE; } } #endif L_CAR) { tp->t_state sys/dev/flp.c 444 0 33 12575 2506427525 6413 /* flp.c 4.5 81/03/08 */ #if VAX780 #include "../h/flp.h" #include "../h/param.h" #include "../h/systm.h" #include "../h/conf.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/mtpr.h" #include "../h/buf.h" #include "../h/cons.h" #include "../h/cpu.h" struct { short fl_state; /* open and busy flags */ short fl_active; /* driver state flag */ struct buf *fl_buf; /* buffer we're using */ unsigned char *fl_xaddr; /* transfer address */ short fl_errcnt; } fltab; /*ARGSUSED*/ flopen(dev, flag) dev_t dev; int flag; { struct buf *geteblk(); #if VAX750 if (cpu != VAX_780) { u.u_error = ENXIO; return; } #endif if (fltab.fl_state != 0) { u.u_error = ENXIO; return; } fltab.fl_state = FL_OPEN; fltab.fl_buf = geteblk(); fltab.fl_active = FL_IDLE; } /*ARGSUSED*/ flclose(dev, flag) dev_t dev; int flag; { brelse(fltab.fl_buf); fltab.fl_state = 0; } flstrategy(rw) int rw; { register struct buf *bp; register unsigned i; /* * Assume one block read/written for each call - * and enforce this by checking for block size of 128. * Use the b_blkno field to address * physical, 128-byte blocks (u.u_offset/128). * This is checked for validity, and is further interpreted as: * * track# * (sectors/track) + sector # */ if (u.u_count == 0) return; (void) spl4(); while (fltab.fl_state & FL_BUSY) sleep((caddr_t)&fltab, PRIBIO); fltab.fl_state |= FL_BUSY; (void) spl0(); bp = fltab.fl_buf; while ((i = min(RXBYSEC, u.u_count)) != 0) { bp->b_blkno = u.u_offset>>7; if (bp->b_blkno >= MAXSEC || (u.u_offset & 0177) != 0) { /* block number out of range */ /* or offset in middle of block */ u.u_error = ENXIO; break; } if (rw == B_WRITE) { iomove(bp->b_un.b_addr, i, B_WRITE); if (u.u_error != 0) break; } bp->b_flags = rw; (void) spl4(); flstart(); while ((bp->b_flags & B_DONE) == 0) sleep((caddr_t)bp, PRIBIO); (void) spl0(); if (bp->b_flags & B_ERROR) { u.u_error = EIO; break; } if (rw == B_READ) { iomove(bp->b_((un.b_addr, i, B_READ); if (u.u_error != 0) break; } } u.u_count = bp->b_resid; fltab.fl_state &= ~FL_BUSY; wakeup((caddr_t)&fltab); } /*ARGSUSED*/ flread(dev) dev_t dev; { flstrategy(B_READ); } /*ARGSUSED*/ flwrite(dev) dev_t dev; { flstrategy(B_WRITE); } flstart() { register struct buf *bp; bp = fltab.fl_buf; fltab.fl_active = FL_MAND; fltab.fl_errcnt = 0; fltab.fl_xaddr = (unsigned char *) bp->b_un.b_addr; bp->b_resid = 0; bp->b_bcount = RXBYSEC; /* always transfer a full sector */ if ((mfpr(TXCS) & TXCS_RDY) == 0) /* not ready to receive order */ return; /* * Wake up floppy LSI software with command */ fltab.fl_active = FL_SEC; if ((bp->b_flags&B_READ) == B_READ) mtpr(TXDB, FL_RS); else mtpr(TXDB, FL_WS); } /* * See if we want to transmit something * to the floppy - and do it */ conxfl() { register int databyte; register struct buf *bp; bp = fltab.fl_buf; switch (fltab.fl_active) { case FL_MAND: /* send command */ if ((bp->b_flags&B_READ) == B_READ) mtpr(TXDB,FL_RS); else mtpr(TXDB, FL_WS); fltab.fl_active = FL_SEC; break; case FL_SEC: /* send sector address */ databyte = (int)bp->b_blkno % RXSTRK + 1; mtpr(TXDB, FL_DATA | databyte); fltab.fl_active = FL_TRACK; break; case FL_TRACK: /* send track address */ databyte = (int)bp->b_blkno / RXSTRK; mtpr(TXDB , FL_DATA | databyte); if ((bp->b_flags&B_READ) == B_READ) /* prepare to receive complete */ fltab.fl_active = FL_COM; else /* prepare to send data */ fltab.fl_active = FL_DAX; break; case FL_DAX: databyte = *(fltab.fl_xaddr++); mtpr(TXDB, FL_DATA | databyte); if (--bp->b_bcount == 0) fltab.fl_active = FL_COM; break; case FL_CAN: /* give cancel order */ mtpr(TXDB, FL_CANCEL); if (++fltab.fl_errcnt <= FLERRS) { /* If error count permits, retry order */ fltab.fl_active = FL_MAND; bp->b_bcount = RXBYSEC; fltab.fl_xaddr = (unsigned char *) bp->b_un.b_addr; } else { /* * We're really stupid today - call it an * error and give up */ bp->b_flags |= B_ERROR | B_DONE; bp->b_resid = -RXBYSEC; fltab.fl_active = FL_IDLE; wakeup((caddr_t)bp); } } } cnrfl(c) int c; { register int datum; register struct buf *bp; datum = c; bp = fltab.fl_buf; if (datum == FL_PERR) { /* * Got a protocol error - cancel the * current function and try again if error count isn't * too great. First, though, make sure that an actual * transaction is in progress (so a spurious error from * the LSI won't screw us up too much! */ if (fltab.fl_active != FL_IDLE) fltab.fl_active = FL_CAN; } else switch(fltab.fl_active ) { case FL_DAR: /* expecting a datum */ if ((c&RXDB_ID) != FL_DATA) goto error; *(fltab.fl_xaddr++) = (c & RXDB_DATA); if (--bp->b_bcount==0) { fltab.fl_active = FL_IDLE; bp->b_flags |= B_DONE; wakeup((caddr_t)bp); } break; case FL_COM: /* expecting a "function complete" */ if ((c&RXDB_ID)!= FL_FFC || (c&FL_ERR) == FL_ERR){ error: bp->b_flags |= B_ERROR | B_DONE; bp->b_resid = -bp->b_bcount; fltab.fl_active = FL_IDLE; wakeup((caddr_t)bp); } else if ((bp->b_flags&B_READ) == B_READ) /* got function complete, now get data */ fltab.fl_active = FL_DAR; else { /* got function complete on write - finish up */ fltab.fl_active = FL_IDLE; bp->b_flags |= B_DONE; wakeup((caddr_t)bp); } break; } } #endif COM: /* expecting a "function complete" */ if ((c&RXDB_ID)!= FL_FFC || (c&FL_ERR) == FL_ERR){ error: bp->b_flags |= B_ERROR |sys/dev/hp.c 444 0 33 33131 2552573565 6237 /* hp.c 4.41 81/07/09 */ #ifdef HPDEBUG int hpdebug; #endif #ifdef HPBDEBUG int hpbdebug; #endif #include "hp.h" #if NHP > 0 /* * HP disk driver for RP0x+RMxx * * TODO: * check RM80 skip sector handling when ECC's occur later * check offset recovery handling * see if DCLR and/or RELEASE set attention status * print bits of mr && mr2 symbolically */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dk.h" #include "../h/buf.h" #include "../h/conf.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/map.h" #include "../h/pte.h" #include "../h/mbareg.h" #include "../h/mbavar.h" #include "../h/mtpr.h" #include "../h/vm.h" #include "../h/cmap.h" #include "../h/dkbad.h" #include "../h/hpreg.h" /* THIS SHOULD BE READ OFF THE PACK, PER DRIVE */ struct size { daddr_t nblocks; int cyloff; } hp6_sizes[8] = { 15884, 0, /* A=cyl 0 thru 37 */ 33440, 38, /* B=cyl 38 thru 117 */ 340670, 0, /* C=cyl 0 thru 814 */ 0, 0, 0, 0, 0, 0, #ifndef NOBADSECT 291280, 118, /* G=cyl 118 thru 814 */ #else 291346, 118, #endif 0, 0, }, rm3_sizes[8] = { 15884, 0, /* A=cyl 0 thru 99 */ 33440, 100, /* B=cyl 100 thru 309 */ 131680, 0, /* C=cyl 0 thru 822 */ 0, 0, 0, 0, 0, 0, #ifndef NOBADSECT 81984, 310, /* G=cyl 310 thru 822 */ #else 82080, 310, #endif 0, 0, }, rm5_sizes[8] = { 15884, 0, /* A=cyl 0 thru 26 */ 33440, 27, /* B=cyl 27 thru 81 */ 500384, 0, /* C=cyl 0 thru 822 */ 15884, 562, /* D=cyl 562 thru 588 */ 55936, 589, /* E=cyl 589 thru 680 */ #ifndef NOBADSECT 86240, 681, /* F=cyl 681 thru 822 */ 158592, 562, /* G=cyl 562 thru 822 */ #else 86636, 681, 158688, 562, #endif 291346, 82, /* H=cyl 82 thru 561 */ }, rm80_sizes[8] = { 15884, 0, /* A=cyl 0 thru 36 */ 33440, 37, /* B=cyl 37 thru 114 */ 242606, 0, /* C=cyl 0 thru 558 */ 0, 0, 0, 0, 0, 0, 82080, 115, /* G=cyl 115 thru 304 */ 110143, 305, /* H=cyl 305 thru 558 */ }, hp7_sizes[8] = { 15844, 0, /* A=cyl 0 thru 9 */ 64000, 10, /* B=cyl 10 thru 49 */ 1008000,0, /* C=cyl 0 thru 629 */ 15884, 330, /* D=cyl 330 thru 339 */ 256000, 340, /* E=cyl 340 thru 499 */ 207850, 500, /* F=cyl 500 thru 629 */ 479850, 330, /* G=cyl 330 thru 629 */ 448000, 50, /* H=cyl 50 thru 329 */ }; /* END OF STUFF WHICH SHOULD BE READ IN PER DISK */ #define _hpSDIST 2 #define _hpRDIST 3 int hpSDIST = _hpSDIST; int hpRDIST = _hpRDIST; short hptypes[] = { MBDT_RM03, MBDT_RM05, MBDT_RP06, MBDT_RM80, MBDT_RP05, MBDT_RP07, 0 }; struct mba_device *hpinfo[NHP]; int hpattach(),hpustart(),hpstart(),hpdtint(); struct mba_driver hpdriver = { hpattach, 0, hpustart, hpstart, hpdtint, 0, hptypes, "hp", 0, hpinfo }; struct hpst { short nsect; short ntrak; short nspc; short ncyl; struct size *sizes; } hpst[] = { 32, 5, 32*5, 823, rm3_sizes, /* RM03 */ 32, 19, 32*19, 823, rm5_sizes, /* RM05 */ 22, 19, 22*19, 815, hp6_sizes, /* RP06 */ 31, 14, 31*14, 559, rm80_sizes, /* RM80 */ 22, 19, 22*19, 411, hp6_sizes, /* RP05 */ 50, 32, 50*32, 630, hp7_sizes, /* RP07 */ }; u_char hp_offset[16] = { HPOF_P400, HPOF_M400, HPOF_P400, HPOF_M400, HPOF_P800, HPOF_M800, HPOF_P800, HPOF_M800, HPOF_P1200, HPOF_M1200, HPOF_P1200, HPOF_M1200, 0, 0, 0, 0, }; struct buf rhpbuf[NHP]; #ifndef NOBADSECT struct buf bhpbuf[NHP]; struct dkbad hpbad[NHP]; #endif char hpinit[NHP]; char hprecal[NHP]; #define b_cylin b_resid #ifdef INTRLVE daddr_t dkblock(); #endif int hpseek; /*ARGSUSED*/ hpattach(mi, slave) struct mba_device *mi; { register struct hpst *st = &hpst[mi->mi_type]; if (mi->mi_dk >= 0) dk_mspw[mi->mi_dk] = 1.0 / 60 / (st->nsect * 256); } hpstrategy(bp) register struct buf *bp; { register struct mba_device *mi; register struct hpst *st; register int unit; long sz, bn; int xunit = minor(bp->b_dev) & 07; sz = bp->b_bcount; sz = (sz+511) >> 9; unit = dkunit(bp); if (unit >= NHP) goto bad; mi = hpinfo[unit]; if (mi == 0 || mi->mi_alive == 0) goto bad; st = &hpst[mi->mi_type]; if (bp->b_blkno < 0 || (bn = dkblock(bp))+sz > st->sizes[xunit].nblocks) goto bad; bp->b_cylin = bn/st->nspc + st->sizes[xunit].cyloff; (void) spl5(); disksort(&mi->mi_tab, bp); if (mi->mi_tab.b_active == 0) mbustart(mi); (void) spl0(); return; bad: bp->b_flags |= B_ERROR; iodone(bp); return; } hpustart(mi) register struct mba_device *mi; { register struct hpdevice *hpaddr = (struct hpdevice *)mi->mi_drv; register struct buf *bp = mi->mi_tab.b_actf; register struct hpst *st = &hpst[mi->mi_type]; daddr_t bn; int sn, dist; hpaddr->hpcs1 = 0; if ((hpaddr->hpcs1&HP_DVA) == 0) return (MBU_BUSY); if ((hpaddr->hpds & HPDS_VV) == 0 || hpinit[mi->mi_unit] == 0) { #ifndef NOBADSECT struct buf *bbp = &bhpbuf[mi->mi_unit]; #endif hpinit[mi->mi_unit] = 1; hpaddr->hpcs1 = HP_DCLR|HP_GO; if (mi->mi_mba->mba_drv[0].mbd_as & (1<mi_drive)) printf("DCLR attn\n"); hpaddr->hpcs1 = HP_PRESET|HP_GO; hpaddr->hpof = HPOF_FMT22; mbclrattn(mi); #ifndef NOBADSECT bbp->b_flags = B_READ|B_BUSY; bbp->b_dev = bp->b_dev; bbp->b_bcount = 512; bbp->b_un.b_addr = (caddr_t)&hpbad[mi->mi_unit]; bbp->b_blkno = st->ncyl*st->nspc - st->nsect; bbp->b_cylin = st->ncyl - 1; mi->mi_tab.b_actf = bbp; bbp->av_forw = bp; bp = bbp; #endif } if (mi->mi_tab.b_active || mi->mi_hd->mh_ndrive == 1) return (MBU_DODATA); if ((hpaddr->hpds & HPDS_DREADY) != HPDS_DREADY) return (MBU_DODATA); bn = dkblock(bp); sn = bn%st->nspc; sn = (sn+st->nsect-hpSDIST)%st->nsect; if (bp->b_cylin == (hpaddr->hpdc & 0xffff)) { if (hpseek) return (MBU_DODATA); dist = ((hpaddr->hpla & 0xffff)>>6) - st->nsect + 1; if (dist < 0) dist += st->nsect; if (dist > st->nsect - hpRDIST) return (MBU_DODATA); } else hpaddr->hpdc = bp->b_cylin; if (hpseek) hpaddr->hpcs1 = HP_SEEK|HP_GO; else { hpaddr->hpda = sn; hpaddr->hpcs1 = HP_SEARCH|HP_GO; } return (MBU_STARTED); } hpstart(mi) register struct mba_device *mi; { register struct hpdevice *hpaddr = (struct hpdevice *)mi->mi_drv; register struct buf *bp = mi->mi_tab.b_actf; register struct hpst *st = &hpst[mi->mi_type]; daddr_t bn; int sn, tn; bn ((= dkblock(bp); sn = bn%st->nspc; tn = sn/st->nsect; sn %= st->nsect; hpaddr->hpdc = bp->b_cylin; hpaddr->hpda = (tn << 8) + sn; return(0); } hpdtint(mi, mbsr) register struct mba_device *mi; int mbsr; { register struct hpdevice *hpaddr = (struct hpdevice *)mi->mi_drv; register struct buf *bp = mi->mi_tab.b_actf; int retry = 0; #ifndef NOBADSECT if (bp->b_flags&B_BAD) { if (hpecc(mi, CONT)) return(MBD_RESTARTED); } #endif if (hpaddr->hpds&HPDS_ERR || mbsr&MBSR_EBITS) { #ifdef HPDEBUG if (hpdebug) { int dc = hpaddr->hpdc, da = hpaddr->hpda; printf("hperr: bp %x cyl %d blk %d as %o ", bp, bp->b_cylin, bp->b_blkno, hpaddr->hpas&0xff); printf("dc %x da %x\n",dc&0xffff, da&0xffff); printf("errcnt %d ", mi->mi_tab.b_errcnt); printf("mbsr=%b ", mbsr, mbsr_bits); printf("er1=%b er2=%b\n", hpaddr->hper1, HPER1_BITS, hpaddr->hper2, HPER2_BITS); DELAY(1000000); } #endif if (hpaddr->hper1&HPER1_WLE) { printf("hp%d: write locked\n", dkunit(bp)); bp->b_flags |= B_ERROR; } else if (++mi->mi_tab.b_errcnt > 27 || mbsr & MBSR_HARD || hpaddr->hper1 & HPER1_HARD || hpaddr->hper2 & HPER2_HARD) { hard: harderr(bp, "hp"); if (mbsr & (MBSR_EBITS &~ (MBSR_DTABT|MBSR_MBEXC))) printf("mbsr=%b ", mbsr, mbsr_bits); printf("er1=%b er2=%b", hpaddr->hper1, HPER1_BITS, hpaddr->hper2, HPER2_BITS); if (hpaddr->hpmr) printf(" mr=%o", hpaddr->hpmr&0xffff); if (hpaddr->hpmr2) printf(" mr2=%o", hpaddr->hpmr2&0xffff); printf("\n"); bp->b_flags |= B_ERROR; hprecal[mi->mi_unit] = 0; } else if (hpaddr->hper2 & HPER2_BSE) { #ifndef NOBADSECT if (hpecc(mi, BSE)) return(MBD_RESTARTED); else #endif goto hard; } else if (hptypes[mi->mi_type] == MBDT_RM80 && hpaddr->hper2&HPER2_SSE) { (void) hpecc(mi, SSE); return (MBD_RESTARTED); } else if ((hpaddr->hper1&(HPER1_DCK|HPER1_ECH))==HPER1_DCK) { if (hpecc(mi, ECC)) return (MBD_RESTARTED); /* else done */ } else retry = 1; hpaddr->hpcs1 = HP_DCLR|HP_GO; if ((mi->mi_tab.b_errcnt&07) == 4) { hpaddr->hpcs1 = HP_RECAL|HP_GO; hprecal[mi->mi_unit] = 1; return(MBD_RESTARTED); } if (retry) return (MBD_RETRY); } #ifdef HPDEBUG else if (hpdebug && hprecal[mi->mi_unit]) { printf("recal %d ", hprecal[mi->mi_unit]); printf("errcnt %d\n", mi->mi_tab.b_errcnt); printf("mbsr=%b ", mbsr, mbsr_bits); printf("er1=%b er2=%b\n", hpaddr->hper1, HPER1_BITS, hpaddr->hper2, HPER2_BITS); } #endif switch (hprecal[mi->mi_unit]) { case 1: hpaddr->hpdc = bp->b_cylin; hpaddr->hpcs1 = HP_SEEK|HP_GO; hprecal[mi->mi_unit]++; return (MBD_RESTARTED); case 2: if (mi->mi_tab.b_errcnt < 16 || (bp->b_flags & B_READ) == 0) goto donerecal; hpaddr->hpof = hp_offset[mi->mi_tab.b_errcnt & 017]|HPOF_FMT22; hpaddr->hpcs1 = HP_OFFSET|HP_GO; hprecal[mi->mi_unit]++; return (MBD_RESTARTED); donerecal: case 3: hprecal[mi->mi_unit] = 0; return (MBD_RETRY); } bp->b_resid = -(mi->mi_mba->mba_bcr) & 0xffff; if (mi->mi_tab.b_errcnt >= 16) { /* * This is fast and occurs rarely; we don't * bother with interrupts. */ hpaddr->hpcs1 = HP_RTC|HP_GO; while (hpaddr->hpds & HPDS_PIP) ; mbclrattn(mi); } hpaddr->hpof = HPOF_FMT22; hpaddr->hpcs1 = HP_RELEASE|HP_GO; return (MBD_DONE); } hpread(dev) dev_t dev; { register int unit = minor(dev) >> 3; if (unit >= NHP) u.u_error = ENXIO; else physio(hpstrategy, &rhpbuf[unit], dev, B_READ, minphys); } hpwrite(dev) dev_t dev; { register int unit = minor(dev) >> 3; if (unit >= NHP) u.u_error = ENXIO; else physio(hpstrategy, &rhpbuf[unit], dev, B_WRITE, minphys); } hpecc(mi, flag) register struct mba_device *mi; int flag; { register struct mba_regs *mbp = mi->mi_mba; register struct hpdevice *rp = (struct hpdevice *)mi->mi_drv; register struct buf *bp = mi->mi_tab.b_actf; register struct hpst *st = &hpst[mi->mi_type]; int npf, o; int bn, cn, tn, sn; int bcr; bcr = mbp->mba_bcr & 0xffff; if (bcr) bcr |= 0xffff0000; /* sxt */ #ifndef NOBADSECT if (flag == CONT) npf = bp->b_error; else #endif npf = btop(bcr + bp->b_bcount); o = (int)bp->b_un.b_addr & PGOFSET; bn = dkblock(bp); cn = bp->b_cylin; sn = bn%(st->nspc) + npf; tn = sn/st->nsect; sn %= st->nsect; cn += tn/st->ntrak; tn %= st->ntrak; switch (flag) { case ECC: { register int i; caddr_t addr; struct pte mpte; int bit, byte, mask; npf--; /* because block in error is previous block */ printf("hp%d%c: soft ecc sn%d\n", dkunit(bp), 'a'+(minor(bp->b_dev)&07), bp->b_blkno + npf); mask = rp->hpec2&0xffff; i = (rp->hpec1&0xffff) - 1; /* -1 makes 0 origin */ bit = i&07; i = (i&~07)>>3; byte = i + o; while (i < 512 && (int)ptob(npf)+i < bp->b_bcount && bit > -11) { mpte = mbp->mba_map[npf+btop(byte)]; addr = ptob(mpte.pg_pfnum) + (byte & PGOFSET); putmemc(addr, getmemc(addr)^(mask<hpof |= HPOF_SSEI; mbp->mba_bcr = -(bp->b_bcount - (int)ptob(npf)); break; #ifndef NOBADSECT case BSE: #ifdef HPBDEBUG if (hpbdebug) printf("hpecc, BSE: bn %d cn %d tn %d sn %d\n", bn, cn, tn, sn); #endif if ((bn = isbad(&hpbad[mi->mi_unit], cn, tn, sn)) < 0) return(0); bp->b_flags |= B_BAD; bp->b_error = npf + 1; bn = st->ncyl*st->nspc - st->nsect - 1 - bn; cn = bn/st->nspc; sn = bn%st->nspc; tn = sn/st->nsect; sn %= st->nsect; mbp->mba_bcr = -512; #ifdef HPBDEBUG if (hpbdebug) printf("revector to cn %d tn %d sn %d\n", cn, tn, sn); #endif break; case CONT: #ifdef HPBDEBUG if (hpbdebug) printf("hpecc, CONT: bn %d cn %d tn %d sn %d\n", bn,cn,tn,sn); #endif npf = bp->b_error; bp->b_flags &= ~B_BAD; mbp->mba_bcr = -(bp->b_bcount - (int)ptob(npf)); if ((mbp->mba_bcr & 0xffff) == 0) return(0); break; #endif } rp->hpcs1 = HP_DCLR|HP_GO; if (rp->hpof&HPOF_SSEI) sn++; rp->hpdc = cn; rp->hpda = (tn<<8) + sn; mbp->mba_sr = -1; mbp->mba_var = (int)ptob(npf) + o; rp->hpcs1 = bp->b_flags&B_READ ? HP_RCOM|HP_GO : HP_WCOM|HP_GO; mi->mi_tab.b_errcnt = 0; /* error has been corrected */ return (1); } #define DBSIZE 20 hpdump(dev) dev_t dev; { register struct mba_device *mi; register struct mba_regs *mba; struct hpdevice *hpaddr; char *start; int num, unit; register struct hpst *st; num = maxfree; start = 0; unit = minor(dev) >> 3; if (unit >= NHP) return (ENXIO); #define phys(a,b) ((b)((int)(a)&0x7fffffff)) mi = phys(hpinfo[unit],struct mba_device *); if (mi == 0 || mi->mi_alive == 0) return (ENXIO); mba = phys(mi->mi_hd, struct mba_hd *)->mh_physmba; mba->mba_cr = MBCR_INIT; hpaddr = (struct hpdevice *)&mba->mba_drv[mi->mi_drive]; if ((hpaddr->hpds & HPDS_VV) == 0) { hpaddr->hpcs1 = HP_DCLR|HP_GO; hpaddr->hpcs1 = HP_PRESET|HP_GO; hpaddr->hpof = HPOF_FMT22; } st = &hpst[mi->mi_type]; if (dumplo < 0 || dumplo + num >= st->sizes[minor(dev)&07].nblocks) return (EINVAL); while (num > 0) { register struct pte *hpte = mba->mba_map; register int i; int blk, cn, sn, tn; daddr_t bn; blk = num > DBSIZE ? DBSIZE : num; bn = dumplo + btop(start); cn = bn/st->nspc + st->sizes[minor(dev)&07].cyloff; sn = bn%st->nspc; tn = sn/st->nsect; sn = sn%st->nsect; hpaddr->hpdc = cn; hpaddr->hpda = (tn << 8) + sn; for (i = 0; i < blk; i++) *(int *)hpte++ = (btop(start)+i) | PG_V; mba->mba_sr = -1; mba->mba_bcr = -(blk*NBPG); mba->mba_var = 0; hpaddr->hpcs1 = HP_WCOM | HP_GO; while ((hpaddr->hpds & HPDS_DRY) == 0) ; if (hpaddr->hpds&HPDS_ERR) return (EIO); start += blk*NBPG; num -= blk; } return (0); } #endif btop(start); cn = bn/st->nspc + st->sizes[minor(dev)&07].cyloff; sn = bn%st->nspc; tn = sn/st->nsect; sn = sn%st->nsect; hpaddr->hpdc = cn; hpaddr->hpda = (tn << 8) + sn; for (i = 0; i < blk; i++) *(int *)hpte++ = (btop(start)+i) | PG_V; mba->mba_sr = -1; mba->mba_bcr = -(blk*NBPG); mba->mba_var = 0; hpaddr->hpcs1 = HP_WCOM | HP_GO; while ((hpaddr->hpds & HPDS_DRY) == 0) ; if (hpaddr->hpdsys/dev/tm.c 444 0 0 54231 2633227213 6210 /* tm.c 4.45 81/12/03 */ #include "te.h" #include "ts.h" #if NTM > 0 /* * TM11/TE10 tape driver * * TODO: * test driver with more than one slave * test driver with more than one controller * test reset code * what happens if you offline tape during rewind? * test using file system on tape */ #include "../h/param.h" #include "../h/systm.h" #include "../h/buf.h" #include "../h/dir.h" #include "../h/conf.h" #include "../h/user.h" #include "../h/file.h" #include "../h/map.h" #include "../h/pte.h" #include "../h/vm.h" #include "../h/ubareg.h" #include "../h/ubavar.h" #include "../h/mtio.h" #include "../h/ioctl.h" #include "../h/cmap.h" #include "../h/cpu.h" #include "../h/tmreg.h" /* * There is a ctmbuf per tape controller. * It is used as the token to pass to the internal routines * to execute tape ioctls, and also acts as a lock on the slaves * on the controller, since there is only one per controller. * In particular, when the tape is rewinding on close we release * the user process but any further attempts to use the tape drive * before the rewind completes will hang waiting for ctmbuf. */ struct buf ctmbuf[NTM]; /* * Raw tape operations use rtmbuf. The driver * notices when rtmbuf is being used and allows the user * program to continue after errors and read records * not of the standard length (BSIZE). */ struct buf rtmbuf[NTM]; /* * Driver unibus interface routines and variables. */ int tmprobe(), tmslave(), tmattach(), tmdgo(), tmintr(); struct uba_ctlr *tmminfo[NTM]; struct uba_((device *tedinfo[NTE]; struct buf teutab[NTE]; short tetotm[NTE]; u_short tmstd[] = { 0772520, 0 }; struct uba_driver tmdriver = { tmprobe, tmslave, tmattach, tmdgo, tmstd, "te", tedinfo, "tm", tmminfo, 0 }; /* bits in minor device */ #define TEUNIT(dev) (minor(dev)&03) #define TMUNIT(dev) (tetotm[TEUNIT(dev)]) #define T_NOREWIND 04 #define T_1600BPI 08 #define INF (daddr_t)1000000L /* * Software state per tape transport. * * 1. A tape drive is a unique-open device; we refuse opens when it is already. * 2. We keep track of the current position on a block tape and seek * before operations by forward/back spacing if necessary. * 3. We remember if the last operation was a write on a tape, so if a tape * is open read write and the last thing done is a write we can * write a standard end of tape mark (two eofs). * 4. We remember the status registers after the last command, using * then internally and returning them to the SENSE ioctl. * 5. We remember the last density the tape was used at. If it is * not a BOT when we start using it and we are writing, we don't * let the density be changed. */ struct te_softc { char sc_openf; /* lock against multiple opens */ char sc_lastiow; /* last op was a write */ daddr_t sc_blkno; /* block number, for block device tape */ daddr_t sc_nxrec; /* position of end of tape, if known */ u_short sc_erreg; /* copy of last erreg */ u_short sc_dsreg; /* copy of last dsreg */ short sc_resid; /* copy of last bc */ #ifdef unneeded short sc_lastcmd; /* last command to handle direction changes */ #endif u_short sc_dens; /* prototype command with density info */ daddr_t sc_timo; /* time until timeout expires */ short sc_tact; /* timeout is active */ } te_softc[NTM]; #ifdef unneeded int tmgapsdcnt; /* DEBUG */ #endif /* * States for um->um_tab.b_active, the per controller state flag. * This is used to sequence control in the driver. */ #define SSEEK 1 /* seeking */ #define SIO 2 /* doing seq i/o */ #define SCOM 3 /* sending control command */ #define SREW 4 /* sending a drive rewind */ /* * Determine if there is a controller for * a tm at address reg. Our goal is to make the * device interrupt. */ tmprobe(reg) caddr_t reg; { register int br, cvec; /* must be r11,r10; value-result */ #ifdef lint br = 0; cvec = br; br = cvec; #endif ((struct tmdevice *)reg)->tmcs = TM_IE; /* * If this is a tm11, it ought to have interrupted * by now, if it isn't (ie: it is a ts04) then we just * hope that it didn't interrupt, so autoconf will ignore it. * Just in case, we will reference one * of the more distant registers, and hope for a machine * check, or similar disaster if this is a ts. * * Note: on an 11/780, badaddr will just generate * a uba error for a ts; but our caller will notice that * so we won't check for it. */ if (badaddr((caddr_t)&((struct tmdevice *)reg)->tmrd, 2)) return (0); return (1); } /* * Due to a design flaw, we cannot ascertain if the tape * exists or not unless it is on line - ie: unless a tape is * mounted. This is too servere a restriction to bear, * so all units are assumed to exist. */ /*ARGSUSED*/ tmslave(ui, reg) struct uba_device *ui; caddr_t reg; { return (1); } /* * Record attachment of the unit to the controller. */ /*ARGSUSED*/ tmattach(ui) struct uba_device *ui; { /* * Tetotm is used in TMUNIT to index the ctmbuf and rtmbuf * arrays given a te unit number. */ tetotm[ui->ui_unit] = ui->ui_mi->um_ctlr; } int tmtimer(); /* * Open the device. Tapes are unique open * devices, so we refuse if it is already open. * We also check that a tape is available, and * don't block waiting here; if you want to wait * for a tape you should timeout in user code. */ tmopen(dev, flag) dev_t dev; int flag; { register int teunit; register struct uba_device *ui; register struct te_softc *sc; int olddens, dens; teunit = TEUNIT(dev); if (teunit>=NTE || (sc = &te_softc[teunit])->sc_openf || (ui = tedinfo[teunit]) == 0 || ui->ui_alive == 0) { u.u_error = ENXIO; return; } olddens = sc->sc_dens; dens = TM_IE | TM_GO | (ui->ui_slave << 8); if ((minor(dev) & T_1600BPI) == 0) dens |= TM_D800; sc->sc_dens = dens; get: tmcommand(dev, TM_SENSE, 1); if (sc->sc_erreg&TMER_SDWN) { sleep((caddr_t)&lbolt, PZERO+1); goto get; } sc->sc_dens = olddens; if ((sc->sc_erreg&(TMER_SELR|TMER_TUR)) != (TMER_SELR|TMER_TUR)) { uprintf("te%d: not online\n", teunit); u.u_error = EIO; return; } if ((flag&FWRITE) && (sc->sc_erreg&TMER_WRL)) { uprintf("te%d: no write ring\n", teunit); u.u_error = EIO; return; } if ((sc->sc_erreg&TMER_BOT) == 0 && (flag&FWRITE) && dens != sc->sc_dens) { uprintf("te%d: can't change density in mid-tape\n", teunit); u.u_error = EIO; return; } sc->sc_openf = 1; sc->sc_blkno = (daddr_t)0; sc->sc_nxrec = INF; sc->sc_lastiow = 0; sc->sc_dens = dens; (void) spl6(); if (sc->sc_tact == 0) { sc->sc_timo = INF; sc->sc_tact = 1; timeout(tmtimer, (caddr_t)dev, 5*hz); } (void) spl0(); } /* * Close tape device. * * If tape was open for writing or last operation was * a write, then write two EOF's and backspace over the last one. * Unless this is a non-rewinding special file, rewind the tape. * Make the tape available to others. */ tmclose(dev, flag) register dev_t dev; register flag; { register struct te_softc *sc = &te_softc[TEUNIT(dev)]; if (flag == FWRITE || (flag&FWRITE) && sc->sc_lastiow) { tmcommand(dev, TM_WEOF, 1); tmcommand(dev, TM_WEOF, 1); tmcommand(dev, TM_SREV, 1); } if ((minor(dev)&T_NOREWIND) == 0) /* * 0 count means don't hang waiting for rewind complete * rather ctmbuf stays busy until the operation completes * preventing further opens from completing by * preventing a TM_SENSE from completing. */ tmcommand(dev, TM_REW, 0); sc->sc_openf = 0; } /* * Execute a command on the tape drive * a specified number of times. */ tmcommand(dev, com, count) dev_t dev; int com, count; { register struct buf *bp; bp = &ctmbuf[TMUNIT(dev)]; (void) spl5(); while (bp->b_flags&B_BUSY) { /* * This special check is because B_BUSY never * gets cleared in the non-waiting rewind case. */ if (bp->b_repcnt == 0 && (bp->b_flags&B_DONE)) break; bp->b_flags |= B_WANTED; sleep((caddr_t)bp, PRIBIO); } bp->b_flags = B_BUSY|B_READ; (void) spl0(); bp->b_dev = dev; bp->b_repcnt = -count; bp->b_command = com; bp->b_blkno = 0; tmstrategy(bp); /* * In case of rewind from close, don't wait. * This is the only case where count can be 0. */ if (count == 0) return; iowait(bp); if (bp->b_flags&B_WANTED) wakeup((caddr_t)bp); bp->b_flags &= B_ERROR; } /* * Queue a tape operation. */ tmstrategy(bp) register struct buf *bp; { int teunit = TEUNIT(bp->b_dev); register struct uba_ctlr *um; register struct buf *dp; /* * Put transfer at end of unit queue */ dp = &teutab[teunit]; bp->av_forw = NULL; (void) spl5(); um = tedinfo[teunit]->ui_mi; if (dp->b_actf == NULL) { dp->b_actf = bp; /* * Transport not already active... * put at end of controller queue. */ dp->b_forw = NULL; if (um->um_tab.b_actf == NULL) um->um_tab.b_actf = dp; else um->um_tab.b_actl->b_forw = dp; um->um_tab.b_actl = dp; } else dp->b_actl->av_forw = bp; dp->b_actl = bp; /* * If the controller is not busy, get * it going. */ if (um->um_tab.b_active == 0) tmstart(um); (void) spl0(); } /* * Start activity on a tm controller. */ tmstart(um) register struct uba_ctlr *um; { register struct buf *bp, *dp; register struct tmdevice *addr = (struct tmdevice *)um->um_addr; register struct te_softc *sc; register struct uba_device *ui; int teunit, cmd; daddr_t blkno; /* * Look for an idle transport on the controller. */ loop: if ((dp = um->um_tab.b_actf) == NULL) return; if ((bp = dp->b_actf) == NULL) { um->um_tab.b_actf = dp->b_forw; goto loop; } teunit = TEUNIT(bp->b_dev); ui = tedinfo[teunit]; /* * Record pre-transfer status (e.g. for TM_SENSE) */ sc = &te_softc[teunit]; addr = (struct tmdevice *)um->um_addr; addr->tmcs = (ui->ui_slave << 8); sc->sc_dsreg = addr->tmcs; sc->sc_erreg = addr->tmer; sc->sc_resid = addr->tmbc; /* * Default is that last command was NOT a write command; * if we do a write command we will notice this in tmintr(). */ sc->sc_lastiow = 0; if (sc->sc_openf < 0 || (addr->tmcs&TM_CUR) == 0) { /* * Have had a hard error on a non-raw tape * or the tape unit is now unavailable * (e.g. taken off line). */ bp->b_flags |= B_ERROR; goto next; } if (bp == &ctmbuf[TMUNIT(bp->b_dev)]) { /* * Execute control operation with the specified count. */ if (bp->b_command == TM_SENSE) goto next; /* * Set next state; give 5 minutes to complete * rewind, or 10 seconds per iteration (minimum 60 * seconds and max 5 minutes) to complete other ops. */ if (bp->b_command == TM_REW) { um->um_tab.b_active = SREW; sc->sc_timo = 5 * 60; } else { um->um_tab.b_active = SCOM; sc->sc_timo = imin(imax(10*(int)-bp->b_repcnt,60),5*60); } if (bp->b_command == TM_SFORW || bp->b_command == TM_SREV) addr->tmbc = bp->b_repcnt; goto dobpcmd; } /* * The following checks handle boundary cases for operation * on non-raw tapes. On raw tapes the initialization of * sc->sc_nxrec by tmphys causes them to be skipped normally * (except in the case of retries). */ if (dbtofsb(bp->b_blkno) > sc->sc_nxrec) { /* * Can't read past known end-of-file. */ bp->b_flags |= B_ERROR; bp->b_error = ENXIO; goto next; } if (dbtofsb(bp->b_blkno) == sc->sc_nxrec && bp->b_flags&B_READ) { /* * Reading at end of file returns 0 bytes. */ bp->b_resid = bp->b_bcount; clrbuf(bp); goto next; } if ((bp->b_flags&B_READ) == 0) /* * Writing sets EOF */ sc->sc_nxrec = dbtofsb(bp->b_blkno) + 1; /* * If the data transfer command is in the correct place, * set up all the registers except the csr, and give * control over to the UNIBUS adapter routines, to * wait for resources to start the i/o. */ if ((blkno = sc->sc_blkno) == dbtofsb(bp->b_blkno)) { (( addr->tmbc = -bp->b_bcount; if ((bp->b_flags&B_READ) == 0) { if (um->um_tab.b_errcnt) cmd = TM_WIRG; else cmd = TM_WCOM; } else cmd = TM_RCOM; um->um_tab.b_active = SIO; um->um_cmd = sc->sc_dens|cmd; #ifdef notdef if (tmreverseop(sc->sc_lastcmd)) while (addr->tmer & TMER_SDWN) tmgapsdcnt++; sc->sc_lastcmd = TM_RCOM; /* will serve */ #endif sc->sc_timo = 60; /* premature, but should serve */ (void) ubago(ui); return; } /* * Tape positioned incorrectly; * set to seek forwards or backwards to the correct spot. * This happens for raw tapes only on error retries. */ um->um_tab.b_active = SSEEK; if (blkno < dbtofsb(bp->b_blkno)) { bp->b_command = TM_SFORW; addr->tmbc = blkno - dbtofsb(bp->b_blkno); } else { bp->b_command = TM_SREV; addr->tmbc = dbtofsb(bp->b_blkno) - blkno; } sc->sc_timo = imin(imax(10 * -addr->tmbc, 60), 5 * 60); dobpcmd: #ifdef notdef /* * It is strictly necessary to wait for the tape * to stop before changing directions, but the TC11 * handles this for us. */ if (tmreverseop(sc->sc_lastcmd) != tmreverseop(bp->b_command)) while (addr->tmer & TM_SDWN) tmgapsdcnt++; sc->sc_lastcmd = bp->b_command; #endif /* * Do the command in bp. */ addr->tmcs = (sc->sc_dens | bp->b_command); return; next: /* * Done with this operation due to error or * the fact that it doesn't do anything. * Release UBA resources (if any), dequeue * the transfer and continue processing this slave. */ if (um->um_ubinfo) ubadone(um); um->um_tab.b_errcnt = 0; dp->b_actf = bp->av_forw; iodone(bp); goto loop; } /* * The UNIBUS resources we needed have been * allocated to us; start the device. */ tmdgo(um) register struct uba_ctlr *um; { register struct tmdevice *addr = (struct tmdevice *)um->um_addr; addr->tmba = um->um_ubinfo; addr->tmcs = um->um_cmd | ((um->um_ubinfo >> 12) & 0x30); } /* * Tm interrupt routine. */ /*ARGSUSED*/ tmintr(tm11) int tm11; { struct buf *dp; register struct buf *bp; register struct uba_ctlr *um = tmminfo[tm11]; register struct tmdevice *addr; register struct te_softc *sc; int teunit; register state; if ((dp = um->um_tab.b_actf) == NULL) return; bp = dp->b_actf; teunit = TEUNIT(bp->b_dev); addr = (struct tmdevice *)tedinfo[teunit]->ui_addr; sc = &te_softc[teunit]; /* * If last command was a rewind, and tape is still * rewinding, wait for the rewind complete interrupt. */ if (um->um_tab.b_active == SREW) { um->um_tab.b_active = SCOM; if (addr->tmer&TMER_RWS) { sc->sc_timo = 5*60; /* 5 minutes */ return; } } /* * An operation completed... record status */ sc->sc_timo = INF; sc->sc_dsreg = addr->tmcs; sc->sc_erreg = addr->tmer; sc->sc_resid = addr->tmbc; if ((bp->b_flags & B_READ) == 0) sc->sc_lastiow = 1; state = um->um_tab.b_active; um->um_tab.b_active = 0; /* * Check for errors. */ if (addr->tmcs&TM_ERR) { while (addr->tmer & TMER_SDWN) ; /* await settle down */ /* * If we hit the end of the tape file, update our position. */ if (addr->tmer&TMER_EOF) { tmseteof(bp); /* set blkno and nxrec */ state = SCOM; /* force completion */ /* * Stuff bc so it will be unstuffed correctly * later to get resid. */ addr->tmbc = -bp->b_bcount; goto opdone; } /* * If we were reading raw tape and the only error was that the * record was too long, then we don't consider this an error. */ if (bp == &rtmbuf[TMUNIT(bp->b_dev)] && (bp->b_flags&B_READ) && (addr->tmer&(TMER_HARD|TMER_SOFT)) == TMER_RLE) goto ignoreerr; /* * If error is not hard, and this was an i/o operation * retry up to 8 times. */ if ((addr->tmer&TMER_HARD)==0 && state==SIO) { if (++um->um_tab.b_errcnt < 7) { sc->sc_blkno++; ubadone(um); goto opcont; } } else /* * Hard or non-i/o errors on non-raw tape * cause it to close. */ if (sc->sc_openf>0 && bp != &rtmbuf[TMUNIT(bp->b_dev)]) sc->sc_openf = -1; /* * Couldn't recover error */ printf("te%d: hard error bn%d er=%b\n", minor(bp->b_dev)&03, bp->b_blkno, sc->sc_erreg, TMER_BITS); bp->b_flags |= B_ERROR; goto opdone; } /* * Advance tape control FSM. */ ignoreerr: switch (state) { case SIO: /* * Read/write increments tape block number */ sc->sc_blkno++; goto opdone; case SCOM: /* * For forward/backward space record update current position. */ if (bp == &ctmbuf[TMUNIT(bp->b_dev)]) switch (bp->b_command) { case TM_SFORW: sc->sc_blkno -= bp->b_repcnt; break; case TM_SREV: sc->sc_blkno += bp->b_repcnt; break; } goto opdone; case SSEEK: sc->sc_blkno = dbtofsb(bp->b_blkno); goto opcont; default: panic("tmintr"); } opdone: /* * Reset error count and remove * from device queue. */ um->um_tab.b_errcnt = 0; dp->b_actf = bp->av_forw; bp->b_resid = -addr->tmbc; ubadone(um); iodone(bp); /* * Circulate slave to end of controller * queue to give other slaves a chance. */ um->um_tab.b_actf = dp->b_forw; if (dp->b_actf) { dp->b_forw = NULL; if (um->um_tab.b_actf == NULL) um->um_tab.b_actf = dp; else um->um_tab.b_actl->b_forw = dp; um->um_tab.b_actl = dp; } if (um->um_tab.b_actf == 0) return; opcont: tmstart(um); } tmtimer(dev) int dev; { register struct te_softc *sc = &te_softc[TEUNIT(dev)]; register short x; if (sc->sc_timo != INF && (sc->sc_timo -= 5) < 0) { printf("te%d: lost interrupt\n", TEUNIT(dev)); sc->sc_timo = INF; x = spl5(); tmintr(TMUNIT(dev)); (void) splx(x); } timeout(tmtimer, (caddr_t)dev, 5*hz); } tmseteof(bp) register struct buf *bp; { register int teunit = TEUNIT(bp->b_dev); register struct tmdevice *addr = (struct tmdevice *)tedinfo[teunit]->ui_addr; register struct te_softc *sc = &te_softc[teunit]; if (bp == &ctmbuf[TMUNIT(bp->b_dev)]) { if (sc->sc_blkno > dbtofsb(bp->b_blkno)) { /* reversing */ sc->sc_nxrec = dbtofsb(bp->b_blkno) - addr->tmbc; sc->sc_blkno = sc->sc_nxrec; } else { /* spacing forward */ sc->sc_blkno = dbtofsb(bp->b_blkno) + addr->tmbc; sc->sc_nxrec = sc->sc_blkno - 1; } return; } /* eof on read */ sc->sc_nxrec = dbtofsb(bp->b_blkno); } tmread(dev) dev_t dev; { tmphys(dev); if (u.u_error) return; physio(tmstrategy, &rtmbuf[TMUNIT(dev)], dev, B_READ, minphys); } tmwrite(dev) dev_t dev; { tmphys(dev); if (u.u_error) return; physio(tmstrategy, &rtmbuf[TMUNIT(dev)], dev, B_WRITE, minphys); } /* * Check that a raw device exists. * If it does, set up sc_blkno and sc_nxrec * so that the tape will appear positioned correctly. */ tmphys(dev) dev_t dev; { register int teunit = TEUNIT(dev); register daddr_t a; register struct te_softc *sc; register struct uba_device *ui; if (teunit >= NTE || (ui=tedinfo[teunit]) == 0 || ui->ui_alive == 0) { u.u_error = ENXIO; return; } sc = &te_softc[teunit]; a = dbtofsb(u.u_offset >> 9); sc->sc_blkno = a; sc->sc_nxrec = a + 1; } tmreset(uban) int uban; { register struct uba_ctlr *um; register tm11, teunit; register struct uba_device *ui; register struct buf *dp; for (tm11 = 0; tm11 < NTM; tm11++) { if ((um = tmminfo[tm11]) == 0 || um->um_alive == 0 || um->um_ubanum != uban) continue; printf(" tm%d", tm11); um->um_tab.b_active = 0; um->um_tab.b_actf = um->um_tab.b_actl = 0; if (um->um_ubinfo) { printf("<%d>", (um->um_ubinfo>>28)&0xf); ubadone(um); } ((struct tmdevice *)(um->um_addr))->tmcs = TM_DCLR; for (teunit = 0; teunit < NTE; teunit++) { if ((ui = tedinfo[teunit]) == 0 || ui->ui_mi != um || ui->ui_alive == 0) continue; dp = &teutab[teunit]; dp->b_active = 0; dp->b_forw = 0; if (um->um_tab.b_actf == NULL) um->um_tab.b_actf = dp; else um->um_tab.b_actl->b_forw = dp; um->um_tab.b_actl = dp; if (te_softc[teunit].sc_openf > 0) te_softc[teunit].sc_openf = -1; } tmstart(um); } } /*ARGSUSED*/ tmioctl(dev, cmd, addr, flag) caddr_t addr; dev_t dev; { int teunit = TEUNIT(dev); register struct te_softc *sc = &te_softc[teunit]; register struct buf *bp = &ctmbuf[TMUNIT(dev)]; register callcount; int fcount; struct mtop mtop; struct mtget mtget; /* we depend of the values and order of the MT codes here */ static tmops[] = {TM_WEOF,TM_SFORW,TM_SREV,TM_SFORW,TM_SREV,TM_REW,TM_OFFL,TM_SENSE}; switch (cmd) { case MTIOCTOP: /* tape operation */ if (copyin((caddr_t)addr, (caddr_t)&mtop, sizeof(mtop))) { u.u_error = EFAULT; return; } switch(mtop.mt_op) { case MTWEOF: callcount = mtop.mt_count; fcount = 1; break; case MTFSF: case MTBSF: callcount = mtop.mt_count; fcount = INF; break; case MTFSR: case MTBSR: callcount = 1; fcount = mtop.mt_count; break; case MTREW: case MTOFFL: case MTNOP: callcount = 1; fcount = 1; break; default: u.u_error = ENXIO; return; } if (callcount <= 0 || fcount <= 0) { u.u_error = ENXIO; return; } while (--callcount >= 0) { tmcommand(dev, tmops[mtop.mt_op], fcount); if ((mtop.mt_op == MTFSR || mtop.mt_op == MTBSR) && bp->b_resid) { u.u_error = EIO; break; } if ((bp->b_flags&B_ERROR) || sc->sc_erreg&TMER_BOT) break; } geterror(bp); return; case MTIOCGET: mtget.mt_dsreg = sc->sc_dsreg; mtget.mt_erreg = sc->sc_erreg; mtget.mt_resid = sc->sc_resid; mtget.mt_type = MT_ISTM; if (copyout((caddr_t)&mtget, addr, sizeof(mtget))) u.u_error = EFAULT; return; default: u.u_error = ENXIO; } } #define DBSIZE 20 tmdump() { register struct uba_device *ui; register struct uba_regs *up; register struct tmdevice *addr; int blk, num; int start; start = 0; num = maxfree; #define phys(a,b) ((b)((int)(a)&0x7fffffff)) if (tedinfo[0] == 0) return (ENXIO); ui = phys(tedinfo[0], struct uba_device *); up = phys(ui->ui_hd, struct uba_hd *)->uh_physuba; ubainit(up); DELAY(1000000); addr = (struct tmdevice *)ui->ui_physaddr; tmwait(addr); addr->tmcs = TM_DCLR | TM_GO; while (num > 0) { blk = num > DBSIZE ? DBSIZE : num; tmdwrite(start, blk, addr, up); start += blk; num -= blk; } tmeof(addr); tmeof(addr); tmwait(addr); if (addr->tmcs&TM_ERR)(( return (EIO); addr->tmcs = TM_REW | TM_GO; tmwait(addr); return (0); } tmdwrite(dbuf, num, addr, up) register dbuf, num; register struct tmdevice *addr; struct uba_regs *up; { register struct pte *io; register int npf; tmwait(addr); io = up->uba_map; npf = num+1; while (--npf != 0) *(int *)io++ = (dbuf++ | (1<tmbc = -(num*NBPG); addr->tmba = 0; addr->tmcs = TM_WCOM | TM_GO; } tmwait(addr) register struct tmdevice *addr; { register s; do s = addr->tmcs; while ((s & TM_CUR) == 0); } tmeof(addr) struct tmdevice *addr; { tmwait(addr); addr->tmcs = TM_WEOF | TM_GO; } #endif e *addr; struct uba_regs *up; { register struct pte *io; register int npf; tmwait(addr); io = up->uba_map; npf = num+1; while (--npf != 0) *(int *)io++ = (dbuf++ | (1<tmbc = -(num*NBPG); addr->tmba = 0; addr->tmcs = TM_WCOM | TM_GO; } tmwait(addr) register struct tmdevice *addr; { registesys/dev/lp.c 444 0 33 14306 2560207040 6223 /* lp.c 4.20 81/07/25 */ #include "lp.h" #if NLP > 0 /* * LP-11 Line printer driver * * This driver has been modified to work on printers where * leaving IENABLE set would cause continuous interrupts. * * TODO: * Test driver on multiple printers */ #include "../h/param.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/buf.h" #include "../h/systm.h" #include "../h/map.h" #include "../h/pte.h" #include "../h/ubavar.h" #include "../h/ioctl.h" #include "../h/tty.h" #define LPPRI (PZERO+8) #define IENABLE 0100 #define DONE 0200 #define ERROR 0100000 #define LPLWAT 650 #define LPHWAT 800 #define MAXCOL 132 #define CAP 1 #define LPUNIT(dev) (minor(dev) >> 3) struct lpdevice { short lpsr; short lpbuf; }; struct lp_softc { struct clist sc_outq; int sc_state; int sc_physcol; int sc_logcol; int sc_physline; char sc_flags; int sc_lpchar; struct buf *sc_inbuf; } lp_softc[NLP]; struct uba_device *lpinfo[NLP]; int lpprobe(), lpattach(), lptout(); u_short lpstd[] = { 0177514 }; struct uba_driver lpdriver = { lpprobe, 0, lpattach, 0, lpstd, "lp", lpinfo }; /* bits for state */ #define OPEN 1 /* device is open */ #define TOUT 2 /* timeout is active */ #define MOD 4 /* device state has been modified */ #define ASLP 8 /* awaiting draining of printer */ extern lbolt; int lptout(); lpattach(ui) struct uba_device *ui; { register struct lp_softc *sc; sc = &lp_softc[ui->ui_unit]; sc->sc_lpchar = -1; } lpprobe(reg) caddr_t reg; { register int br, cvec; /* value-result */ register struct lpdevice *lpaddr = (struct lpdevice *)reg; #ifdef lint br = 0; cvec = br; br = cvec; #endif lpaddr->lpsr = IENABLE; DELAY(5); lpaddr->lpsr = 0; return (1); } /*ARGSUSED*/ lpopen(dev, flag) dev_t dev; int flag; { register int unit; register struct lpdevice *lpaddr; register struct lp_softc *sc; register struct uba_device *ui; if ((unit = LPUNIT(dev)) >= NLP || (sc = &lp_softc[unit])->sc_state&OPEN || (ui = lpinfo[unit]) == 0 || ui->ui_alive == 0) { u.u_error = ENXIO; return; } lpaddr = (struct lpdevice *)ui->ui_addr; if (lpaddr->lpsr&ERROR) { u.u_error = EIO; return; } sc->sc_state |= OPEN; sc->sc_inbuf = geteblk(); sc->sc_flags = minor(dev) & 07; (void) spl4(); if ((sc->sc_state&TOUT) == 0) { sc->sc_state |= TOUT; timeout(lptout, (caddr_t)dev, 10*hz); } (void) spl0(); lpcanon(dev, '\f'); } /*ARGSUSED*/ lpclose(dev, flag) dev_t dev; int flag; { register struct lp_softc *sc = &lp_softc[LPUNIT(dev)]; lpcanon(dev, '\f'); brelse(sc->sc_inbuf); sc->sc_state &= ~OPEN; } lpwrite(dev) dev_t dev; { register unsigned n; register char *cp; register struct lp_softc *sc = &lp_softc[LPUNIT(dev)]; while (n = min(BSIZE, u.u_count)) { cp = sc->sc_inbuf->b_un.b_addr; iomove(cp, n, B_WRITE); do lpcanon(dev, *cp++); while (--n); } } lpcanon(dev, c) dev_t dev; register int c; { register int logcol, physcol; register struct lp_softc *sc = &lp_softc[LPUNIT(dev)]; if (sc->sc_flags&CAP) { register c2; if (c>='a' && c<='z') c += 'A'-'a'; else switch (c) { case '{': c2 = '('; goto esc; case '}': c2 = ')'; goto esc; case '`': c2 = '\''; goto esc; case '|': c2 = '!'; goto esc; case '~': c2 = '^'; esc: lpcanon(dev, c2); sc->sc_logcol--; c = '-'; } } logcol = sc->sc_logcol; physcol = sc->sc_physcol; if (c == ' ') logcol++; else switch(c) { case '\t': logcol = (logcol+8) & ~7; break; case '\f': if (sc->sc_physline == 0 && physcol == 0) break; /* fall into ... */ case '\n': lpoutput(dev, c); if (c == '\f') sc->sc_physline = 0; else sc->sc_physline++; physcol = 0; /* fall into ... */ case '\r': logcol = 0; (void) spl4(); lpintr(LPUNIT(dev)); (void) spl0(); break; case '\b': if (logcol > 0) logcol--; break; default: if (logcol < physcol) { lpoutput(dev, '\r'); physcol = 0; } if (logcol < MAXCOL) { while (logcol > physcol) { lpoutput(dev, ' '); physcol++; } lpoutput(dev, c); physcol++; } logcol++; } if (logcol > 1000) /* ignore long lines */ logcol = 1000; sc->sc_logcol = logcol; sc->sc_physcol = physcol; } lpoutput(dev, c) dev_t dev; int c; { register struct lp_softc *sc = &lp_softc[LPUNIT(dev)]; if (sc->sc_outq.c_cc >= LPHWAT) { (void) spl4(); lpintr(LPUNIT(dev)); /* unchoke */ while (sc->sc_outq.c_cc >= LPHWAT) { sc->sc_state |= ASLP; /* must be ERROR */ sleep((caddr_t)sc, LPPRI); } (void) spl0(); } while (putc(c, &sc->sc_outq)) sleep((caddr_t)&lbolt, LPPRI); } lpintr(lp11) int lp11; { register int n; register struct lp_softc *sc = &lp_softc[lp11]; register struct uba_device *ui = lpinfo[lp11]; register struct lpdevice *lpaddr = (struct lpdevice *)ui->ui_addr; lpaddr->lpsr &= ~IENABLE; n = sc->sc_outq.c_cc; if (sc->sc_lpchar < 0) sc->sc_lpchar = getc(&sc->sc_outq); while ((lpaddr->lpsr&DONE) && sc->sc_lpchar >= 0) { lpaddr->lpbuf = sc->sc_lpchar; sc->sc_lpchar = getc(&sc->sc_outq); } sc->sc_state |= MOD; if (sc->sc_outq.c_cc > 0 && (lpaddr->lpsr&ERROR)==0) lpaddr->lpsr |= IENABLE; /* ok and more to do later */ if (n>LPLWAT && sc->sc_outq.c_cc<=LPLWAT && sc->sc_state&ASLP) { sc->sc_state &= ~ASLP; wakeup((caddr_t)sc); /* top half should go on */ } } lptout(dev) dev_t dev; { register struct lp_softc *sc; register struct uba_device *ui; register struct lpdevice *lpaddr; sc = &lp_softc[LPUNIT(dev)]; ui = lpinfo[LPUNIT(dev)]; lpaddr = (struct lpdevice *) ui->ui_addr; if ((sc->sc_state&MOD) != 0) { sc->sc_state &= ~MOD; /* something happened */ timeout(lptout, (caddr_t)dev, 2*hz); /* so don't sweat */ return; } if ((sc->sc_state&OPEN) == 0) { sc->sc_state &= ~TOUT; /* no longer open */ lpaddr->lpsr = 0; return; } if (sc->sc_outq.c_cc && (lpaddr->lpsr&DONE) && (lpaddr->lpsr&ERROR)==0) lpintr(LPUNIT(dev)); /* ready to go */ timeout(lptout, (caddr_t)dev, 10*hz); } lpreset(uban) int uban; { register struct uba_device *ui; register struct lpdevice *lpaddr; register int unit; for (unit = 0; unit < NLP; unit++) { if ((ui = lpinfo[unit]) == 0 || ui->ui_ubanum != uban || ui->ui_alive == 0) continue; printf(" lp%d", unit); lpaddr = (struct lpdevice *)ui->ui_addr; lpaddr->lpsr |= IENABLE; } } } if (sc->sc_outq.c_cc && (lpaddr->lpsr&DONE) && (lpaddr->lpsr&ERROR)==0) lpintr(LPUNIT(dev)); /* ready to go */ timeout(lptout, (caddr_t)dev, 10*hz); } lpreset(uban) int uban; { register struct uba_device *ui; register struct lpdevice *lpaddr; register int unit; for (unit = 0; unit < NLP; unit++) {sys/dev/mba.c 444 0 33 22021 2632475451 6355 /* mba.c 4.21 81/10/27 */ #include "mba.h" #if NMBA > 0 /* * Massbus driver, arbitrates a massbus among attached devices. */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dk.h" #include "../h/buf.h" #include "../h/conf.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/map.h" #include "../h/pte.h" #include "../h/mbareg.h" #include "../h/mbavar.h" #include "../h/mtpr.h" #include "../h/vm.h" char mbsr_bits[] = MBSR_BITS; /* * Start activity on a massbus device. * We are given the device's mba_device structure and activate * the device via the unit start routine. The unit start * routine may indicate that it is finished (e.g. if the operation * was a ``sense'' on a tape drive), that the (multi-ported) unit * is busy (we will get an interrupt later), that it started the * unit (e.g. for a non-data transfer operation), or that it has * set up a data transfer operation and we should start the massbus adaptor. */ mbustart(mi) register struct mba_device *mi; { register struct buf *bp; /* i/o operation at head of queue */ register struct mba_hd *mhp; /* header for mba device is on */ loop: /* * Get the first thing to do off device queue. */ bp = mi->mi_tab.b_actf; if (bp == NULL) return; /* * Let the drivers unit start routine have at it * and then process the request further, per its instructions. */ switch ((*mi->mi_driver->md_ustart)(mi)) { case MBU_NEXT: /* request is complete (e.g. ``sense'') */ mi->mi_tab.b_active = 0; mi((->mi_tab.b_errcnt = 0; mi->mi_tab.b_actf = bp->av_forw; iodone(bp); goto loop; case MBU_DODATA: /* all ready to do data transfer */ /* * Queue the device mba_device structure on the massbus * mba_hd structure for processing as soon as the * data path is available. */ mhp = mi->mi_hd; mi->mi_forw = NULL; if (mhp->mh_actf == NULL) mhp->mh_actf = mi; else mhp->mh_actl->mi_forw = mi; mhp->mh_actl = mi; /* * If data path is idle, start transfer now. * In any case the device is ``active'' waiting for the * data to transfer. */ mi->mi_tab.b_active = 1; if (mhp->mh_active == 0) mbstart(mhp); return; case MBU_STARTED: /* driver started a non-data transfer */ /* * Mark device busy during non-data transfer * and count this as a ``seek'' on the device. */ if (mi->mi_dk >= 0) { dk_seek[mi->mi_dk]++; dk_busy |= (1 << mi->mi_dk); } mi->mi_tab.b_active = 1; return; case MBU_BUSY: /* dual port drive busy */ /* * We mark the device structure so that when an * interrupt occurs we will know to restart the unit. */ mi->mi_tab.b_flags |= B_BUSY; return; default: panic("mbustart"); } } /* * Start an i/o operation on the massbus specified by the argument. * We peel the first operation off its queue and insure that the drive * is present and on-line. We then use the drivers start routine * (if any) to prepare the drive, setup the massbus map for the transfer * and start the transfer. */ mbstart(mhp) register struct mba_hd *mhp; { register struct mba_device *mi; struct buf *bp; register struct mba_regs *mbp; register int com; loop: /* * Look for an operation at the front of the queue. */ if ((mi = mhp->mh_actf) == NULL) { return; } if ((bp = mi->mi_tab.b_actf) == NULL) { mhp->mh_actf = mi->mi_forw; goto loop; } /* * If this device isn't present and on-line, then * we screwed up, and can't really do the operation. * Only check for non-tapes because tape drivers check * ONLINE themselves and because TU78 registers are * different. */ if ((mi->mi_drv->mbd_dt & MBDT_TAP) == 0) if ((mi->mi_drv->mbd_ds & MBDS_DREADY) != MBDS_DREADY) { printf("%s%d: not ready\n", mi->mi_driver->md_dname, dkunit(bp)); mi->mi_tab.b_actf = bp->av_forw; mi->mi_tab.b_errcnt = 0; mi->mi_tab.b_active = 0; bp->b_flags |= B_ERROR; iodone(bp); goto loop; } /* * We can do the operation; mark the massbus active * and let the device start routine setup any necessary * device state for the transfer (e.g. desired cylinder, etc * on disks). */ mhp->mh_active = 1; if (mi->mi_driver->md_start) { if ((com = (*mi->mi_driver->md_start)(mi)) == 0) com = (bp->b_flags & B_READ) ? MB_RCOM|MB_GO : MB_WCOM|MB_GO; } else com = (bp->b_flags & B_READ) ? MB_RCOM|MB_GO : MB_WCOM|MB_GO; /* * Setup the massbus control and map registers and start * the transfer. */ mbp = mi->mi_mba; mbp->mba_sr = -1; /* conservative */ mbp->mba_var = mbasetup(mi); mbp->mba_bcr = -bp->b_bcount; mi->mi_drv->mbd_cs1 = com; if (mi->mi_dk >= 0) { dk_busy |= 1 << mi->mi_dk; dk_xfer[mi->mi_dk]++; dk_wds[mi->mi_dk] += bp->b_bcount >> 6; } } /* * Take an interrupt off of massbus mbanum, * and dispatch to drivers as appropriate. */ mbintr(mbanum) int mbanum; { register struct mba_hd *mhp = &mba_hd[mbanum]; register struct mba_regs *mbp = mhp->mh_mba; register struct mba_device *mi; register struct buf *bp; register int drive; int mbasr, as; /* * Read out the massbus status register * and attention status register and clear * the bits in same by writing them back. */ mbasr = mbp->mba_sr; mbp->mba_sr = mbasr; #if VAX750 if (mbasr&MBSR_CBHUNG) { printf("mba%d: control bus hung\n", mbanum); panic("cbhung"); } #endif /* note: the mbd_as register is shared between drives */ as = mbp->mba_drv[0].mbd_as & 0xff; mbp->mba_drv[0].mbd_as = as; /* * If the mba was active, process the data transfer * complete interrupt; otherwise just process units which * are now finished. */ if (mhp->mh_active) { /* * Clear attention status for drive whose data * transfer related operation completed, * and give the dtint driver * routine a chance to say what is next. */ mi = mhp->mh_actf; as &= ~(1 << mi->mi_drive); dk_busy &= ~(1 << mi->mi_dk); bp = mi->mi_tab.b_actf; switch ((*mi->mi_driver->md_dtint)(mi, mbasr)) { case MBD_DONE: /* all done, for better or worse */ /* * Flush request from drive queue. */ mi->mi_tab.b_errcnt = 0; mi->mi_tab.b_actf = bp->av_forw; iodone(bp); /* fall into... */ case MBD_RETRY: /* attempt the operation again */ /* * Dequeue data transfer from massbus queue; * if there is still a i/o request on the device * queue then start the next operation on the device. * (Common code for DONE and RETRY). */ mhp->mh_active = 0; mi->mi_tab.b_active = 0; mhp->mh_actf = mi->mi_forw; if (mi->mi_tab.b_actf) mbustart(mi); break; case MBD_RESTARTED: /* driver restarted op (ecc, e.g.) /* * Note that mhp->mh_active is still on. */ break; default: panic("mbintr"); } } /* * Service drives which require attention * after non-data-transfer operations. */ while (drive = ffs(as)) { drive--; /* was 1 origin */ as &= ~(1 << drive); mi = mhp->mh_mbip[drive]; if (mi == NULL) continue; /* * If driver has a handler for non-data transfer * interrupts, give it a chance to tell us what to do. */ if (mi->mi_driver->md_ndint) { mi->mi_tab.b_active = 0; switch ((*mi->mi_driver->md_ndint)(mi)) { case MBN_DONE: /* operation completed */ mi->mi_tab.b_errcnt = 0; bp = mi->mi_tab.b_actf; mi->mi_tab.b_actf = bp->av_forw; iodone(bp); /* fall into common code */ case MBN_RETRY: /* operation continues */ if (mi->mi_tab.b_actf) mbustart(mi); break; case MBN_SKIP: /* ignore unsol. interrupt */ break; default: panic("mbintr"); } } else /* * If there is no non-data transfer interrupt * routine, then we should just * restart the unit, leading to a mbstart() soon. */ mbustart(mi); } /* * If there is an operation available and * the massbus isn't active, get it going. */ if (mhp->mh_actf && !mhp->mh_active) mbstart(mhp); /* THHHHATS all folks... */ } /* * Setup the mapping registers for a transfer. */ mbasetup(mi) register struct mba_device *mi; { register struct mba_regs *mbap = mi->mi_mba; struct buf *bp = mi->mi_tab.b_actf; register int i; int npf; unsigned v; register struct pte *pte, *io; int o; int vaddr; struct proc *rp; io = mbap->mba_map; v = btop(bp->b_un.b_addr); o = (int)bp->b_un.b_addr & PGOFSET; npf = btoc(bp->b_bcount + o); rp = bp->b_flags&B_DIRTY ? &proc[2] : bp->b_proc; vaddr = o; if (bp->b_flags & B_UAREA) { for (i = 0; i < UPAGES; i++) { if (rp->p_addr[i].pg_pfnum == 0) panic("mba: zero upage"); *(int *)io++ = rp->p_addr[i].pg_pfnum | PG_V; } } else if ((bp->b_flags & B_PHYS) == 0) { pte = &Sysmap[btop(((int)bp->b_un.b_addr)&0x7fffffff)]; while (--npf >= 0) *(int *)io++ = pte++->pg_pfnum | PG_V; } else { if (bp->b_flags & B_PAGET) pte = &Usrptmap[btokmx((struct pte *)bp->b_un.b_addr)]; else pte = vtopte(rp, v); while (--npf >= 0) { if (pte->pg_pfnum == 0) panic("mba, zero entry"); *(int *)io++ = pte++->pg_pfnum | PG_V; } } *(int *)io++ = 0; return (vaddr); } /* * Init and interrupt enable a massbus adapter. */ mbainit(mp) struct mba_regs *mp; { mp->mba_cr = MBCR_INIT; mp->mba_cr = MBCR_IE; } #endif ]; while (--npf >= 0) *(int *)io++ = pte++->pg_pfnum | PG_V; } else { if (bp->b_flags & B_PAGET) pte = &Usrptmap[btokmx((struct pte *)bp->b_un.b_addr)]; else pte = vtopte(rp, v); while (--npf >= 0) { if (pte->pg_pfnum == 0) panic("mba, zero entry"); *(int *)io++ = pte++->pg_pfnum | PG_V; } } *(int *)io++ = 0; return (vaddr); } /* * Init and interrupt enable a massbus adapter. */ mbainit(mp) struct mba_regs *mp; { mp->mba_cr = MBCR_INIT; mp->mba_cr = Msys/dev/mem.c 444 0 33 6532 2506427527 6366 /* mem.c 4.3 81/03/08 */ /* * Memory special file * minor device 0 is physical memory * minor device 1 is kernel memory * minor device 2 is EOF/RATHOLE * minor device 3 is unibus memory (addressed by shorts) */ #include "../h/param.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/conf.h" #include "../h/buf.h" #include "../h/systm.h" #include "../h/pte.h" #include "../h/mtpr.h" #include "../h/vm.h" #include "../h/cmap.h" mmread(dev) { register int o; register unsigned c, v; switch (minor(dev)) { case 0: while (u.u_count != 0 && u.u_error == 0) { if (fubyte(u.u_base) == -1) goto fault; v = btop(u.u_offset); if (v >= physmem) goto fault; *(int *)mmap = v | (PG_V | PG_KR); mtpr(TBIS, vmmap); o = (int)u.u_offset & PGOFSET; c = min((unsigned)(NBPG - o), u.u_count); c = min(c, (unsigned)(NBPG - ((int)u.u_base&PGOFSET))); if (copyout((caddr_t)&vmmap[o], u.u_base, c)) goto fault; u.u_count -= c; u.u_base += c; u.u_offset += c; } return; case 1: if ((caddr_t)u.u_offset < (caddr_t)&umbabeg && (caddr_t)u.u_offset + u.u_count >= (caddr_t)&umbabeg) goto fault; if ((caddr_t)u.u_offset >= (caddr_t)&umbabeg && (caddr_t)u.u_offset < (caddr_t)&umbaend) goto fault; if (!kernacc((caddr_t)u.u_offset, u.u_count, B_READ)) goto fault; if (copyout((caddr_t)u.u_offset, u.u_base, u.u_count)) goto fault; c = u.u_count; u.u_count = 0; u.u_base += c; u.u_offset += c; return; case 2: return; case 3: if (!kern((acc((caddr_t)u.u_offset, u.u_count, B_READ)) goto fault; if (!useracc(u.u_base, u.u_count, B_WRITE)) goto fault; UNIcpy((caddr_t)u.u_offset, u.u_base, u.u_count, B_READ); c = u.u_count; u.u_count = 0; u.u_base += c; u.u_offset += c; return; } fault: u.u_error = EFAULT; return; } mmwrite(dev) { register int o; register unsigned c, v; switch (minor(dev)) { case 0: while (u.u_count != 0 && u.u_error == 0) { if (fubyte(u.u_base) == -1) goto fault; v = btop(u.u_offset); if (v >= physmem) goto fault; *(int *)mmap = v | (PG_V | PG_KW); mtpr(TBIS, vmmap); o = (int)u.u_offset & PGOFSET; c = min((unsigned)(NBPG - o), u.u_count); c = min(c, (unsigned)(NBPG - ((int)u.u_base&PGOFSET))); if (copyin(u.u_base, (caddr_t)&vmmap[o], c)) goto fault; u.u_count -= c; u.u_base += c; u.u_offset += c; } return; case 1: if (!kernacc((caddr_t)u.u_offset, u.u_count, B_WRITE)) goto fault; if (copyin(u.u_base, (caddr_t)u.u_offset, u.u_count)) goto fault; u.u_base += u.u_count; u.u_offset += u.u_count; u.u_count = 0; return; case 2: u.u_offset += u.u_count; u.u_count = 0; return; case 3: if (!kernacc((caddr_t)u.u_offset, u.u_count, B_WRITE)) goto fault; if (!useracc(u.u_base, u.u_count, B_READ)) goto fault; UNIcpy((caddr_t)u.u_offset, u.u_base, u.u_count, B_WRITE); u.u_base += u.u_count; u.u_offset += u.u_count; u.u_count = 0; return; } fault: u.u_error = EFAULT; return; } /* * UNIBUS Address Space <--> User Space transfer */ UNIcpy(uniadd, usradd, bknt, direct) caddr_t uniadd, usradd; unsigned bknt; { register short *from, *to; register int i; if (direct == B_READ) { from = (short *) uniadd; to = (short *) usradd; } else { from = (short *) usradd; to = (short *) uniadd; } for (i = (bknt>>1); i > 0; i--) *to++ = *from++; } B_WRITE); u.u_base += u.u_count; u.u_offset += u.u_count; u.u_count = 0; return; } fault: u.u_error = EFAULT; return; } /* * UNIBUS Address Space <--> Usys/dev/mx1.c 444 0 33 23670 2506427527 6337 /* mx1.c 4.6 81/03/11 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/reg.h" #include "../h/proc.h" #include "../h/tty.h" #include "../h/inode.h" #include "../h/mx.h" #include "../h/file.h" #include "../h/conf.h" /* * Multiplexor: clist version * * installation: * requires a line in cdevsw - * mxopen, mxclose, mxread, mxwrite, mxioctl, 0, * * also requires a line in linesw - * mxopen, mxclose, mcread, mcwrite, mxioctl, nulldev, nulldev, * * The linesw entry for mpx should be the last one in the table. * 'nldisp' (number of line disciplines) should not include the * mpx line. This is to prevent mpx from being enabled by an ioctl. */ struct chan chans[NCHANS]; struct schan schans[NPORTS]; struct group *groups[NGROUPS]; int mpxline; struct chan *xcp(); dev_t mpxdev = -1; char mcdebugs[NDEBUGS]; /* * Allocate a channel, set c_index to index. */ struct chan * challoc(index, isport) { register s,i; register struct chan *cp; s = spl6(); for(i=0;i<((isport)?NPORTS:NCHANS);i++) { cp = (isport)? (struct chan *)(schans+i): chans+i; if(cp->c_group == NULL) { cp->c_index = index; cp->c_pgrp = 0; cp->c_flags = 0; splx(s); return(cp); } } splx(s); return(NULL); } /* * Allocate a group table cell. */ gpalloc() { register i; for (i=NGROUPS-1; i>=0; i--) if (groups[i]==NULL) { groups[i]++; return(i); } u.u_error = ENXIO; return(i); } /* * Add a channel to the group in * inode ip. */ struct chan * addch(ip, isport) struct inode *ip; { register struct chan *cp; register struct group *gp; register i; plock(ip); gp = &ip->i_un.i_group; for(i=0;ig_chans[i]; if (cp == NULL) { if ((cp=challoc(i, isport)) != NULL) { gp->g_chans[i] = cp; cp->c_group = gp; } break; } cp = NULL; } prele(ip); return(cp); } /* * Mpxchan system call. */ mpxchan() { extern mxopen(), mcread(), sdata(), scontrol(); struct inode *ip, *gip; struct tty *tp; struct file *fp, *chfp, *gfp; struct chan *cp; struct group *gp, *ngp; struct mx_args vec; struct a { int cmd; int *argvec; } *uap; dev_t dev; register int i; /* * Common setup code. */ uap = (struct a *)u.u_ap; (void) copyin((caddr_t)uap->argvec, (caddr_t)&vec, sizeof vec); gp = NULL; gfp = NULL; cp = NULL; switch(uap->cmd) { case NPGRP: if (vec.m_arg[1] < 0) break; case CHAN: case JOIN: case EXTR: case ATTACH: case DETACH: case CSIG: gfp = getf(vec.m_arg[1]); if (gfp==NULL) return; gip = gfp->f_inode; gp = &gip->i_un.i_group; if (gp->g_inode != gip) { u.u_error = ENXIO; return; } } switch(uap->cmd) { /* * Create an MPX file. */ case MPX: case MPXN: if (mpxdev < 0) { for (i=0; linesw[i].l_open; i++) { if (linesw[i].l_read==mcread) { mpxline = i; for (i=0; cdevsw[i].d_open; i++) { if (cdevsw[i].d_open==mxopen) { mpxdev = (dev_t)(i<<8); } } } } if (mpxdev < 0) { u.u_error = ENXIO; return; } } if (uap->cmd==MPXN) { if ((ip=ialloc(pipedev))==NULL) return; ip->i_mode = ((vec.m_arg[1]&0777)+IFMPC) & ~u.u_cmask; ip->i_flag = IACC|IUPD|ICHG; } else { u.u_dirp = vec.m_name; ip = namei(uchar,1); if (ip != NULL) { i = ip->i_mode&IFMT; u.u_error = EEXIST; if (i==IFMPC || i==IFMPB) { i = minor(ip->i_un.i_rdev); gp = groups[i]; if (gp && gp->g_inode==ip) u.u_error = EBUSY; } iput(ip); return; } if (u.u_error) return; ip = maknode((vec.m_arg[1]&0777)+IFMPC); if (ip == NULL) return; } if ((i=gpalloc()) < 0) { iput(ip); return; } if ((fp=falloc()) == NULL) { iput(ip); groups[i] = NULL; return; } ip->i_un.i_rdev = (daddr_t)(mpxdev+i); ip->i_count++; prele(ip); gp = &ip->i_un.i_group; groups[i] = gp; gp->g_inode = ip; gp->g_state = INUSE|ISGRP; gp->g_group = NULL; gp->g_file = fp; gp->g_index = 0; gp->g_rotmask = 1; gp->g_rot = 0; gp->g_datq = 0; for(i=0;ig_chans[i++] = NULL; fp->f_flag = FREAD|FWRITE|FMP; fp->f_inode = ip; fp->f_un.f_chan = NULL; return; /* * join file descriptor (arg 0) to group (arg 1) * return channel number */ case JOIN: if ((fp=getf(vec.m_arg[0]))==NULL) return; ip = fp->f_inode; switch (ip->i_mode & IFMT) { case IFMPC: if ((fp->f_flag&FMP) != FMP) { u.u_error = ENXIO; return; } ngp = &ip->i_un.i_group; if (mtree(ngp, gp) == NULL) return; fp->f_count++; u.u_r.r_val1 = cpx((struct chan *)ngp); return; case IFCHR: dev = (dev_t)ip->i_un.i_rdev; tp = cdevsw[major(dev)].d_ttys; if (tp==NULL) { u.u_error = ENXIO; return; } tp = &tp[minor(dev)]; if (tp->t_chan) { u.u_error = ENXIO; return; } if ((cp=addch(gip, 1))==NULL) { u.u_error = ENXIO; return; } tp->t_chan = cp; cp->c_fy = fp; fp->f_count++; cp->c_ttyp = tp; cp->c_line = tp->t_line; cp->c_flags = XGRP+PORT; u.u_r.r_val1 = cpx(cp); return; default: u.u_error = ENXIO; return; } /* * Attach channel (arg 0) to group (arg 1). */ case ATTACH: cp = xcp(gp, vec.m_arg[0]); if (cp==NULL || cp->c_flags&ISGRP) { u.u_error = ENXIO; return; } u.u_r.r_val1 = cpx(cp); wakeup((caddr_t)cp); return; case DETACH: cp = xcp(gp, vec.m_arg[0]); if (cp==NULL) { u.u_error = ENXIO; return; } (void) detach(cp); return; /* * Extract channel (arg 0) from group (arg 1). */ case EXTR: cp = xcp(gp, vec.m_arg[0]); if (cp==NULL) { u.u_error = ENXIO; return; } if (cp->c_flags & ISGRP) { (void) mxfalloc(((struct group *)cp)->g_file); return; } if ((fp=cp->c_fy) != NULL) { (void) mxfalloc(fp); return; } if ((fp=falloc()) == NULL) return; fp->f_inode = gip; gip->i_count++; fp->f_un.f_chan = cp; fp->f_flag = (vec.m_arg[2]) ? (FREAD|FWRITE|FMPY) : (FREAD|FWRITE|FMPX); cp->c_fy = fp; return; /* * Make new chan on group (arg 1). */ case CHAN: if((gfp->f_flag&FMP)==FMP)cp = addch(gip, 0); if(cp == NULL){ u.u_error = ENXIO; return; } cp->c_flags = XGRP; cp->c_fy = NULL; cp->c_ttyp = cp->c_ottyp = (struct tty *)cp; cp->c_line = cp->c_oline = mpxline; u.u_r.r_val1 = cpx(cp); return; /* * Connect fd (arg 0) to channel fd (arg 1). * (arg 2 < 0) => fd to chan only * (arg 2 > 0) => chan to fd only * (arg 2 == 0) => both directions */ case CONNECT: if ((fp=getf(vec.m_arg[0]))==NULL) return; if ((chfp=getf(vec.m_arg[1]))==NULL) return; ip = fp->f_inode; i = ip->i_mode&IFMT; if (i!=IFCHR) { u.u_error = ENXIO; return; } dev = (dev_t)ip->i_un.i_rdev; tp = cdevsw[major(dev)].d_ttys; if (tp==NULL) { u.u_error = ENXIO; return; } tp = &tp[minor(dev)]; if (!(chfp->f_flag&FMPY)) { u.u_error = ENXIO; return; } cp = chfp->f_un.f_chan; if (cp==NULL || cp->c_flags&PORT) { u.u_error = ENXIO; return; } i = vec.m_arg[2]; if (i>=0) { cp->c_ottyp = tp; cp->c_oline = tp->t_line; } if (i<=0) { tp->t_chan = cp; cp->c_ttyp = tp; cp->c_line = tp->t_line; } u.u_r.r_val1 = 0; return; case NPGRP: { register struct proc *pp; if (gp != NULL) { cp = xcp(gp, vec.m_arg[0]); if (cp==NULL) { u.u_error = ENXIO; return; } } pp = u.u_procp; pp->p_pgrp = pp->p_pid; if (vec.m_arg[2]) pp->p_pgrp = vec.m_arg[2]; if (gp != NULL) cp->c_pgrp = pp->p_pgrp; u.u_r.r_val1 = pp->p_pgrp; return; } case CSIG: cp = xcp(gp, vec.m_arg[0]((); if (cp==NULL) { u.u_error = ENXIO; return; } gsignal(cp->c_pgrp, vec.m_arg[2]); u.u_r.r_val1 = vec.m_arg[2]; return; case DEBUG: i = vec.m_arg[0]; if (i<0 || i>NDEBUGS) return; mcdebugs[i] = vec.m_arg[1]; if (i==ALL) for(i=0;ic_flags&ISGRP) { sub = (struct group *)cp; master = sub->g_group; index = sub->g_index; closef(sub->g_file); if (master != NULL) master->g_chans[index] = NULL; return(0); } else if (cp->c_flags&PORT && cp->c_ttyp != NULL) { closef(cp->c_fy); chdrain(cp); chfree(cp); return(0); } if (cp->c_flags & WCLOSE) { if (cp->c_fy) { if (cp->c_fy->f_count) return(1); chdrain(cp); chfree(cp); return(0); } } cp->c_flags |= WCLOSE; chwake(cp); return(1); } mxfalloc(fp) register struct file *fp; { register i; if (fp==NULL) { u.u_error = ENXIO; return(-1); } i = ufalloc(); if (i < 0) return(i); u.u_ofile[i] = fp; fp->f_count++; u.u_r.r_val1 = i; return(i); } /* * Grow a branch on a tree. */ mtree(sub,master) register struct group *sub, *master; { register i; int mtresiz, stresiz; if ((mtresiz=mup(master,sub)) == NULL) { u.u_error = ENXIO; return(NULL); } if ((stresiz=mdown(sub,master)) <= 0) { u.u_error = ENXIO; return(NULL); } if (sub->g_group != NULL) { u.u_error = ENXIO; return(NULL); } if (stresiz+mtresiz > NLEVELS) { u.u_error = ENXIO; return(NULL); } for (i=0;ig_chans[i] != NULL) continue; master->g_chans[i] = (struct chan *)sub; sub->g_group = master; sub->g_index = i; return(1); } u.u_error = ENXIO; return(NULL); } mup(master,sub) struct group *master, *sub; { register struct group *top; register int depth; depth = 1; top = master; while (top->g_group) { depth++; top = top->g_group; } if(top == sub) return(NULL); return(depth); } mdown(sub,master) struct group *sub, *master; { register int maxdepth, i, depth; if(sub == (struct group *)NULL || (sub->g_state&ISGRP) == 0) return(0); if(sub == master) return(-1); maxdepth = 0; for(i=0; ig_chans[i],master)) == -1) return(-1); maxdepth = (depth>maxdepth) ? depth: maxdepth; } return(maxdepth+1); } = master; while (top->g_group) { depth++; top = top->g_group; } sys/dev/mx2.c 444 0 33 35677 2624051512 6336 /* mx2.c 4.7 81/09/11 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/tty.h" #include "../h/inode.h" #include "../h/mx.h" #include "../h/file.h" #include "../h/conf.h" #include "../h/buf.h" /* * multiplexor driver */ struct chan chans[NCHANS]; struct group *groups[NGROUPS]; int mpxline; short cmask[16] ={ 01, 02, 04, 010, 020, 040, 0100, 0200, 0400, 01000, 02000, 04000, 010000, 020000, 040000, 0100000 }; #define IOMOVE iomove struct chan *xcp(),*addch(),*nextcp(); #define HIQ 100 #define LOQ 20 #define FP ((struct file *)cp) char mcdebugs[NDEBUGS]; struct group * getmpx(dev) dev_t dev; { register d; d = minor(dev); if (d >= NGROUPS) { u.u_error = ENXIO; return(NULL); } return(groups[d]); } /*ARGSUSED*/ mxopen(dev, flag) { register struct group *gp; register struct file *fp; register struct chan *cp; int msg; if ((gp=getmpx(dev)) == NULL) { return; } if (!(gp->g_state&INUSE)) { u.u_error = ENXIO; return; } fp = u.u_ofile[u.u_r.r_val1]; if (fp->f_inode != gp->g_inode) { u.u_error = ENXIO; return; } if ((cp=addch(gp->g_inode,0)) == NULL) { u.u_error = ENXIO; return; } cp->c_flags = XGRP; cp->c_ottyp = cp->c_ttyp = (struct tty *)cp; cp->c_line = cp->c_oline = mpxline; fp->f_flag |= FMPY; fp->f_flag |= FREAD+FWRITE; fp->f_un.f_chan = cp; if (gp->g_inode == mpxip) { plock(mpxip); mpxname(cp); msg = M_OPEN; } else msg = M_WATCH; scontrol(cp, msg+(cp->c_index<<8), u.u_uid); sleep((caddr_t)cp,TTIPRI); if (cp->c_flags&NMBUF) prele(mpxip); if (cp->c_flags & WCLOSE) { chdrain(cp); chfree(cp); u.u_error = ENXIO; return; } cp->c_fy = fp; cp->c_pgrp = u.u_procp->p_pgrp; } char mxnmbuf[NMSIZE]; int nmsize; mpxname(cp) register struct chan *cp; { register char *np; register c; np = mxnmbuf; u.u_dirp = (caddr_t)u.u_arg[0]; while (np < &mxnmbuf[NMSIZE]) { c = uchar(); if (c <= 0) break; *np++ = c; } *np++ = '\0'; nmsize = np - mxnmbuf; cp->c_flags |= NMBUF; } mxclose(dev, flag, fp) dev_t dev; register struct file *fp; { register struct chan *cp = fp->f_un.f_chan; register struct group *gp; register struct inode *ip; int i, fmp; fmp = flag&FMP; if ((gp=getmpx(dev)) == NULL) return; ip = gp->g_inode; if (ip==NULL || (ip->i_mode&IFMT)!=IFMPC) { return; } /* * close a channel */ if (cp!=NULL && fmp && fmp!=FMP) { for(fp=file; fp< fileNFILE; fp++) if(fp->f_count && fp->f_flag&FMP && fp->f_un.f_chan==cp){ return; } chdrain(cp); if ((cp->c_flags&WCLOSE)==0) { scontrol(cp, M_CLOSE, 0); cp->c_flags |= WCLOSE; } else { chfree(cp); } goto out; } for(fp=file; fp < fileNFILE; fp++) { if (fp->f_count && (fp->f_flag&FMP)==FMP && fp->f_inode==ip) return; } if (ip == mpxip) { mpxip = NULL; prele(ip); } for(i=0;ig_chans[i]); out: plock(ip); if (ip->i_count == 1) { groups[minor(dev)] = NULL; zero((caddr_t)gp, sizeof (struct group)); ip->i_mode = IFREG + 0666; ip->i_un.i_rdev = 0; ip->i_flag |= IUPD|ICHG; iput(ip); return; } prele(ip); } zero(s, cc) register char *s; register cc; { while (cc--) *s++ = 0; } char m_eot[] ={ M_EOT, 0, 0, 0}; /* * Mxread + mxwrite are entered from cdevsw * for all read/write calls. Operations on * an mpx file are handled here. * Calls are made through linesw to handle actual * data movement. */ mxread(dev) { register struct group *gp; register struct chan *cp; register esc; struct rh h; caddr_t base; unsigned count; int s, xfr, more, fmp; if ((gp=getmpx(dev))==NULL || (FP=getf(u.u_arg[0]))==NULL) { u.u_error = ENXIO; return; } fmp = FP->f_flag & FMP; if (fmp != FMP) { if (u.u_count == 0) return; msread(fmp, FP->f_un.f_chan); return; } if ((int)u.u_base & 1) { u.u_error = ENXIO; return; } s = spl6(); if (u.u_count == 0) { if (gp->g_datq == 0) u.u_error = ENXIO; splx(s); return; } while (gp->g_datq == 0) { sleep((caddr_t)&gp->g_datq, TTIPRI); } splx(s); while (gp->g_datq && u.u_count >= CNTLSIZ + 2) { esc = 0; cp = nextcp(gp); if (cp==NULL) { continue; } h.index = cpx(cp); if (count = cp->c_ctlx.c_cc) { count += CNTLSIZ; if (cp->c_flags&NMBUF) count += nmsize; if (count > u.u_count) { (void) sdata(cp); return; } esc++; } base = u.u_base; count = u.u_count; u.u_base += sizeof h; u.u_count -= sizeof h; xfr = u.u_count; if (esc) { more = mcread(cp); } else { more = (*linesw[cp->c_line].l_read)(cp->c_ttyp); } if (more > 0) (void) sdata(cp); if (more < 0) scontrol(cp, M_CLOSE, 0); (void) spl0(); if (xfr == u.u_count) { esc++; IOMOVE((caddr_t)m_eot, sizeof m_eot, B_READ); } xfr -= u.u_count; if (esc) { h.count = 0; h.ccount = xfr; } else { h.count = xfr; h.ccount = 0; mxrstrt(cp, &cp->cx.datq, BLOCK|ALT); } if (u.u_count && (xfr&1)) { u.u_base++; u.u_count--; } (void) copyout((caddr_t)&h, base, sizeof h); } } mxwrite(dev) { register struct chan *cp; struct wh h; struct group *gp; int ucount, esc, fmp, burpcount; caddr_t ubase, hbase; if ((gp=getmpx(dev))==NULL || (FP=getf(u.u_arg[0]))==NULL) { return; } fmp = FP->f_flag & FMP; if (fmp != FMP) { mswrite(fmp, FP->f_un.f_chan); return; } burpcount = 0; while (u.u_count >= sizeof h) { hbase = u.u_base; IOMOVE((caddr_t)&h, sizeof h, B_WRITE); if (u.u_error) return; esc = 0; if (h.count==0) { esc++; h.count = h.ccount; } cp = xcp(gp, h.index); if (cp==NULL || cp->c_flags&ISGRP) { u.u_error = ENXIO; return; } ucount = u.u_count; ubase = u.u_base; u.u_count = h.count; u.u_base = h.data; if (esc==0) { struct tty *tp; caddr_t waddr; int line; if (cp->c_flags&PORT) { line = cp->c_line; tp = cp->c_ttyp; } else { line = cp->c_oline; tp = cp->c_ottyp; } loop: waddr = (caddr_t)(*linesw[line].l_write)(tp); if (u.u_count) { if (gp->g_state&ENAMSG) { burpcount++; cp->c_flags |= BLKMSG; /* scontrol(cp, M_BLK, u.u_count); */ h.ccount = -1; h.count = u.u_count; h.data = u.u_base; (void) copyout((caddr_t)&h, hbase, sizeof h); } else { if(waddr == 0) { u.u_error = ENXIO; return; } sleep(waddr, TTOPRI); goto loop; } } } else { mxwcontrol(cp); } u.u_count = ucount; u.u_base = ubase; } u.u_count = burpcount; } /* * Mcread and mcwrite move data on an mpx file. * Transfer addr and length is controlled by mxread/mxwrite. * Kernel-to-Kernel and other special transfers are not * yet in. */ mcread(cp) register struct chan *cp; { register struct clist *q; register char *np; q = (cp->c_ctlx.c_cc) ? &cp->c_ctlx : &cp->cx.datq; (void) mxmove(q, B_READ); if (cp->c_flags&NMBUF && q == &cp->c_ctlx) { np = mxnmbuf; while (nmsize--) (void) passc(*np++); cp->c_flags &= ~NMBUF; prele(mpxip); } if (cp->c_flags&PORT) return(cp->c_ctlx.c_cc + cp->c_ttyp->t_rawq.c_cc); else return(cp->c_ctlx.c_cc + cp->cx.datq((.c_cc); } caddr_t mcwrite(cp) register struct chan *cp; { register struct clist *q; int s; q = &cp->cy.datq; while (u.u_count) { s = spl6(); if (q->c_cc > HIQ || (cp->c_flags&EOTMARK)) { cp->c_flags |= SIGBLK; splx(s); break; } splx(s); (void) mxmove(q, B_WRITE); } wakeup((caddr_t)q); return((caddr_t)q); } /* * Msread and mswrite move bytes * between user and non-multiplexed channel. */ msread(fmp, cp) register struct chan *cp; { register struct clist *q; int s; q = (fmp&FMPX) ? &cp->cx.datq : &cp->cy.datq; s = spl6(); while (q->c_cc == 0) { if (cp->c_flags&WCLOSE) { u.u_error = ENXIO; goto out; } if (cp->c_flags & EOTMARK) { cp->c_flags &= ~EOTMARK; if(msgenab(cp)) scontrol(cp, M_UBLK, 0); else { wakeup((caddr_t)cp); wakeup((caddr_t)q); } goto out; } sleep((caddr_t)q,TTIPRI); } if (cp->c_flags&WCLOSE) { u.u_error = ENXIO; goto out; } splx(s); while (mxmove(q, B_READ) > 0) ; mxrstrt(cp, q, SIGBLK); return; out: splx(s); } mswrite(fmp, cp) register struct chan *cp; { register struct clist *q; register int cc; q = (fmp&FMPX) ? &cp->cy.datq : &cp->cx.datq; while (u.u_count) { (void) spl6(); if (cp->c_flags&WCLOSE) { gsignal(cp->c_pgrp, SIGPIPE); (void) spl0(); return; } if (q->c_cc>= HIQ || cp->c_flags&FBLOCK) { if (cp->c_flags&WCLOSE) { gsignal(cp->c_pgrp, SIGPIPE); (void) spl0(); return; } (void) sdata(cp); cp->c_flags |= BLOCK; sleep((caddr_t)q+1,TTOPRI); (void) spl0(); continue; } (void) spl0(); cc = mxmove(q, B_WRITE); if (cc < 0) break; } if (fmp&FMPX) { if (cp->c_flags&YGRP) (void) sdata(cp); else wakeup((caddr_t)q); } else { if (cp->c_flags&XGRP) (void) sdata(cp); else wakeup((caddr_t)q); } } /* * move chars between clist and user space. */ mxmove(q, dir) register struct clist *q; register dir; { register cc; char cbuf[HIQ]; cc = MIN(u.u_count, sizeof cbuf); if (dir == B_READ) cc = q_to_b(q, cbuf, cc); if (cc <= 0) return(cc); IOMOVE((caddr_t)cbuf, (unsigned)cc, dir); if (dir == B_WRITE) cc = b_to_q(cbuf, cc, q); return(cc); } mxrstrt(cp, q, b) register struct chan *cp; register struct clist *q; register b; { int s; s = spl6(); if (cp->c_flags&b && q->c_ccc_flags &= ~b; if (b&ALT) wakeup((caddr_t)q+1); else if (b&(BLKMSG)) scontrol(cp, M_UBLK, 0); else wakeup((caddr_t)q); } if (cp->c_flags&WFLUSH) wakeup((caddr_t)q+2); splx(s); } /* * called from driver start or xint routines * to wakeup output sleeper. */ mcstart(cp, q) register struct chan *cp; register caddr_t q; { if (cp->c_flags&(BLKMSG)) { cp->c_flags &= ~BLKMSG; scontrol(cp, M_UBLK, 0); } else wakeup((caddr_t)q); } mxwcontrol(cp) register struct chan *cp; { short cmd; struct sgttyb vec; int s; IOMOVE((caddr_t)&cmd, sizeof cmd, B_WRITE); if (u.u_error) return; switch(cmd) { /* * not ready to queue this up yet. */ case M_EOT: s = spl6(); while (cp->c_flags & EOTMARK) if(msgenab(cp)){ scontrol(cp, M_BLK, 0); goto out; } else sleep((caddr_t)cp, TTOPRI); cp->c_flags |= EOTMARK; out: wakeup((caddr_t)&cp->cy.datq); splx(s); break; case M_IOCTL: break; case M_IOANS: if (cp->c_flags&SIOCTL) { IOMOVE((caddr_t)&vec, sizeof vec, B_WRITE); (void) b_to_q((caddr_t)&vec, sizeof vec, &cp->c_ctly); cp->c_flags &= ~SIOCTL; wakeup((caddr_t)cp); } break; case M_BLK: cp->c_flags |= FBLOCK; break; case M_UBLK: cp->c_flags &= ~FBLOCK; chwake(cp); break; default: u.u_error = ENXIO; } } /*ARGSUSED*/ mxioctl(dev, cmd, addr, flag) caddr_t addr; { struct group *gp; int fmp; struct file *fp; struct { short c_ctl; short c_cmd; struct sgttyb c_vec; } ctlbuf; if ((gp=getmpx(dev))==NULL || (fp=getf(u.u_arg[0]))==NULL) { return; } fmp = fp->f_flag & FMP; if (fmp == FMP) { switch(cmd) { case MXLSTN: if (mpxip == NULL) { mpxip = gp->g_inode; } else { u.u_error = ENXIO; return; } break; case MXNBLK: gp->g_state |= ENAMSG; break; default: u.u_error = ENXIO; return; } } else { ctlbuf.c_ctl = M_IOCTL; ctlbuf.c_cmd = cmd; (void) copyin(addr, (caddr_t)&ctlbuf.c_vec, sizeof (struct sgttyb)); sioctl(fp->f_un.f_chan, (char *)&ctlbuf, sizeof ctlbuf); (void) copyout((caddr_t)&ctlbuf, addr, sizeof (struct sgttyb)); } } chdrain(cp) register struct chan *cp; { register struct tty *tp; int wflag; chwake(cp); wflag = (cp->c_flags&WCLOSE)==0; tp = cp->c_ttyp; if (tp == NULL) /* prob not required */ return; if (cp->c_flags&PORT && tp->t_chan == cp) { cp->c_ttyp = NULL; tp->t_chan = NULL; return; } if (wflag) wflush(cp,&cp->cx.datq); else flush(&cp->cx.datq); if (!(cp->c_flags&YGRP)) { flush(&cp->cy.datq); } } chwake(cp) register struct chan *cp; { register char *p; wakeup((caddr_t)cp); flush(&cp->c_ctlx); p = (char *)&cp->cx.datq; wakeup((caddr_t)p); wakeup((caddr_t)++p); wakeup((caddr_t)++p); p = (char *)&cp->cy.datq; wakeup((caddr_t)p); wakeup((caddr_t)++p); wakeup((caddr_t)++p); } chfree(cp) register struct chan *cp; { register struct group *gp; register i; gp = cp->c_group; if (gp==NULL) return; i = cp->c_index; if (cp == gp->g_chans[i]) { gp->g_chans[i] = NULL; } cp->c_group = NULL; wakeup((caddr_t)gp); } flush(q) register struct clist *q; { while(q->c_cc) (void) getc(q); } wflush(cp,q) register struct chan *cp; register struct clist *q; { register s; s = spl6(); if(q->c_cc && (cp->c_flags&WCLOSE) == 0) { cp->c_flags |= WFLUSH; (void) sdata(cp); (void) tsleep((caddr_t)q+2, TTOPRI, 30); } flush(q); cp->c_flags &= ~WFLUSH; splx(s); } scontrol(cp,event,value) register struct chan *cp; short event,value; { register struct clist *q; int s; q = &cp->c_ctlx; s = spl6(); if (sdata(cp) == NULL) return; (void) putw(event,q); (void) putw(value,q); splx(s); } sioctl(cp, vec, cc) register struct chan *cp; char *vec; { register s; register struct clist *q; s = spl6(); q = &cp->cx.datq; while (q->c_cc) { cp->c_flags |= BLOCK; if (sdata(cp)==NULL) { u.u_error = ENXIO; return; } sleep((caddr_t)q+1, TTOPRI); } (void) b_to_q(vec, cc, &cp->c_ctlx); cp->c_flags |= SIOCTL; while (cp->c_flags&SIOCTL) { if (cp->c_ctlx.c_cc) if (sdata(cp)==NULL) { u.u_error = ENXIO; return; } sleep((caddr_t)cp, TTOPRI); } (void) q_to_b(&cp->c_ctly, vec, cp->c_ctly.c_cc); splx(s); } sdata(cp) struct chan *cp; { register struct group *gp = (struct group *)cp; register struct group *ngp; register int s; ngp = gp->g_group; if (ngp==NULL || (ngp->g_state&ISGRP)==0) return(NULL); s = spl6(); do { ngp->g_datq |= cmask[gp->g_index]; wakeup((caddr_t)&ngp->g_datq); gp = ngp; } while(ngp=ngp->g_group); splx(s); return((int)gp); } struct chan * xcp(gp, x) register struct group *gp; register short x; { register int i; while (gp->g_group) gp=gp->g_group; for (i=0;i= NINDEX) break; if (gp==NULL || (gp->g_state&ISGRP)==0) return((struct chan *)NULL); gp = (struct group *)gp->g_chans[x&017]; x >>= 4; } return((struct chan *)gp); } cpx(cp) register struct chan *cp; { register x; register struct group *gp; x = (-1<<4) + cp->c_index; gp = cp->c_group; while (gp->g_group) { x <<= 4; x |= gp->g_index; gp = gp->g_group; } return(x); } struct chan * nextcp(gp) register struct group *gp; { register struct group *lgp, *ngp; do { while ((gp->g_datq & cmask[gp->g_rot]) == 0) { gp->g_rot = (gp->g_rot+1)%NINDEX; } lgp = gp; gp = (struct group *)gp->g_chans[gp->g_rot]; } while (gp!=NULL && gp->g_state&ISGRP); lgp->g_datq &= ~cmask[lgp->g_rot]; lgp->g_rot = (lgp->g_rot+1)%NINDEX; while (ngp=lgp->g_group) { ngp->g_datq &= ~cmask[lgp->g_index]; if (ngp->g_datq) break; lgp = ngp; } return((struct chan *)gp); } msgenab(cp) register struct chan *cp; { register struct group *gp; for(gp=cp->c_group;gp;gp=gp->g_group) if(gp->g_state & ENAMSG)return(1); return(0); } t = (gp->g_rot+1)%NINDEX; } lgp = gp; gp = (struct group *)sys/dev/tty.c 444 0 33 23325 2560200411 6424 /* tty.c 4.12 81/07/22 */ /* * TTY subroutines common to more than one line discipline */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/tty.h" #include "../h/proc.h" #include "../h/mx.h" #include "../h/inode.h" #include "../h/file.h" #include "../h/reg.h" #include "../h/conf.h" #include "../h/buf.h" #include "../h/dk.h" char partab[]; /* * Input mapping table-- if an entry is non-zero, when the * corresponding character is typed preceded by "\" the escape * sequence is replaced by the table value. Mostly used for * upper-case only terminals. */ char maptab[] ={ 000,000,000,000,000,000,000,000, 000,000,000,000,000,000,000,000, 000,000,000,000,000,000,000,000, 000,000,000,000,000,000,000,000, 000,'|',000,000,000,000,000,'`', '{','}',000,000,000,000,000,000, 000,000,000,000,000,000,000,000, 000,000,000,000,000,000,000,000, 000,000,000,000,000,000,000,000, 000,000,000,000,000,000,000,000, 000,000,000,000,000,000,000,000, 000,000,000,000,000,000,'~',000, 000,'A','B','C','D','E','F','G', 'H','I','J','K','L','M','N','O', 'P','Q','R','S','T','U','V','W', 'X','Y','Z',000,000,000,000,000, }; short tthiwat[16] = { 100,100,100,100,100,100,100,200,200,400,400,400,650,650,650,650 }; short ttlowat[16] = { 30, 30, 30, 30, 30, 30, 30, 50, 50,120,120,120,125,125,125,125 }; #define OBUFSIZ 100 /* * set default control characters. */ ttychars(tp) register struct tty *tp; { tun.t_intrc = CINTR; tun.t_quitc = CQUIT; tun.t_startc(( = CSTART; tun.t_stopc = CSTOP; tun.t_eofc = CEOT; tun.t_brkc = CBRK; tp->t_erase = CERASE; tp->t_kill = CKILL; /* begin local */ tlun.t_suspc = CTRL(z); tlun.t_dsuspc = CTRL(y); tlun.t_rprntc = CTRL(r); tlun.t_flushc = CTRL(o); tlun.t_werasc = CTRL(w); tlun.t_lnextc = CTRL(v); tp->t_local = 0; tp->t_lstate = 0; /* end local */ } /* * Wait for output to drain, then flush input waiting. */ wflushtty(tp) register struct tty *tp; { (void) spl5(); while (tp->t_outq.c_cc && tp->t_state&CARR_ON) { (*tp->t_oproc)(tp); tp->t_state |= ASLEEP; sleep((caddr_t)&tp->t_outq, TTOPRI); } flushtty(tp, FREAD|FWRITE); (void) spl0(); } /* * flush all TTY queues */ flushtty(tp, rw) register struct tty *tp; { register s; if (tp->t_line == NETLDISC) return; s = spl6(); if (rw & FREAD) { while (getc(&tp->t_canq) >= 0) ; wakeup((caddr_t)&tp->t_rawq); } if (rw & FWRITE) { wakeup((caddr_t)&tp->t_outq); tp->t_state &= ~TTSTOP; (*cdevsw[major(tp->t_dev)].d_stop)(tp); while (getc(&tp->t_outq) >= 0) ; } if (rw & FREAD) { while (getc(&tp->t_rawq) >= 0) ; tp->t_delct = 0; tp->t_rocount = 0; /* local */ tp->t_rocol = 0; tp->t_lstate = 0; } splx(s); } /* * Send stop character on input overflow. */ ttyblock(tp) register struct tty *tp; { register x; x = tp->t_rawq.c_cc + tp->t_canq.c_cc; if (tp->t_rawq.c_cc > TTYHOG) { flushtty(tp, FREAD|FWRITE); tp->t_state &= ~TBLOCK; } if (x >= TTYHOG/2) { if (putc(tun.t_stopc, &tp->t_outq)==0) { tp->t_state |= TBLOCK; tp->t_char++; ttstart(tp); } } } /* * Restart typewriter output following a delay * timeout. * The name of the routine is passed to the timeout * subroutine and it is called during a clock interrupt. */ ttrstrt(tp) register struct tty *tp; { if (tp == 0) { printf("ttrstrt: arg was 0!\n"); return; } tp->t_state &= ~TIMEOUT; ttstart(tp); } /* * Start output on the typewriter. It is used from the top half * after some characters have been put on the output queue, * from the interrupt routine to transmit the next * character, and after a timeout has finished. */ ttstart(tp) register struct tty *tp; { register s; s = spl5(); if((tp->t_state&(TIMEOUT|TTSTOP|BUSY)) == 0) (*tp->t_oproc)(tp); splx(s); } /* * Common code for tty ioctls. */ /*ARGSUSED*/ ttioctl(tp, com, addr, flag) register struct tty *tp; caddr_t addr; { int dev; unsigned t; struct sgttyb iocb; struct clist tq; extern int nldisp; register c; int temp; /* * This is especially so that isatty() will * fail when carrier is gone. */ if ((tp->t_state&CARR_ON) == 0) { u.u_error = EBADF; return (1); } dev = tp->t_dev; /* * If the ioctl involves modification, * insist on being able to write the device, * and hang if in the background. */ switch(com) { case TIOCSETD: case TIOCSETP: case TIOCSETN: case TIOCFLUSH: case TIOCSETC: case TIOCSLTC: case TIOCSPGRP: case TIOCLBIS: case TIOCLBIC: case TIOCLSET: case TIOCSTI: /* this is reasonable, but impractical... if ((flag & FWRITE) == 0) { u.u_error = EBADF; return (1); } */ while (tp->t_line == NTTYDISC && u.u_procp->p_pgrp != tp->t_pgrp && tp == u.u_ttyp && (u.u_procp->p_flag&SVFORK) == 0 && u.u_signal[SIGTTOU] != SIG_IGN && u.u_signal[SIGTTOU] != SIG_HOLD && (u.u_procp->p_flag&SDETACH)==0) { gsignal(u.u_procp->p_pgrp, SIGTTOU); sleep((caddr_t)&lbolt, TTOPRI); } break; } /* * Process the ioctl. */ switch(com) { /* * Get discipline number */ case TIOCGETD: t = tp->t_line; if (copyout((caddr_t)&t, addr, sizeof(t))) u.u_error = EFAULT; break; /* * Set line discipline */ case TIOCSETD: if (copyin(addr, (caddr_t)&t, sizeof(t))) { u.u_error = EFAULT; break; } if (t >= nldisp) { u.u_error = ENXIO; break; } (void) spl5(); if (tp->t_line) (*linesw[tp->t_line].l_close)(tp); if (t) (*linesw[t].l_open)(dev, tp, addr); if (u.u_error==0) tp->t_line = t; (void) spl0(); break; /* * Prevent more opens on channel */ case TIOCEXCL: tp->t_state |= XCLUDE; break; case TIOCNXCL: tp->t_state &= ~XCLUDE; break; /* * Set new parameters */ case TIOCSETP: case TIOCSETN: if (copyin(addr, (caddr_t)&iocb, sizeof(iocb))) { u.u_error = EFAULT; return(1); } (void) spl5(); if (tp->t_line == 0) { if (com == TIOCSETP) wflushtty(tp); while (canon(tp)>=0) ; #ifdef notdef wakeup((caddr_t)&tp->t_rawq); #endif } else if (tp->t_line == NTTYDISC) { if (tp->t_flags&RAW || iocb.sg_flags&RAW || com == TIOCSETP) wflushtty(tp); else if ((tp->t_flags&CBREAK) != (iocb.sg_flags&CBREAK)) { if (iocb.sg_flags & CBREAK) { catq(&tp->t_rawq, &tp->t_canq); tq = tp->t_rawq; tp->t_rawq = tp->t_canq; tp->t_canq = tq; } else { tp->t_local |= LPENDIN; if (tp->t_canq.c_cc) panic("ioccom canq"); #ifdef notdef if (tp->t_chan) (void) sdata(tp->t_chan); else #endif wakeup((caddr_t)&tp->t_rawq); } } } if ((tp->t_state&SPEEDS)==0) { tp->t_ispeed = iocb.sg_ispeed; tp->t_ospeed = iocb.sg_ospeed; } tp->t_erase = iocb.sg_erase; tp->t_kill = iocb.sg_kill; tp->t_flags = iocb.sg_flags; if (tp->t_flags & RAW) { tp->t_state &= ~TTSTOP; ttstart(tp); } (void) spl0(); break; /* * Send current parameters to user */ case TIOCGETP: iocb.sg_ispeed = tp->t_ispeed; iocb.sg_ospeed = tp->t_ospeed; iocb.sg_erase = tp->t_erase; iocb.sg_kill = tp->t_kill; iocb.sg_flags = tp->t_flags; if (copyout((caddr_t)&iocb, addr, sizeof(iocb))) u.u_error = EFAULT; break; /* * Hang up line on last close */ case TIOCHPCL: tp->t_state |= HUPCLS; break; case TIOCFLUSH: { int flags; if (addr == 0) flags = FREAD|FWRITE; else if (copyin(addr, (caddr_t)&flags, sizeof (flags))) { u.u_error = EFAULT; return(1); } flushtty(tp, flags); break; } /* * Set and fetch special characters */ case TIOCSETC: if (copyin(addr, (caddr_t)&tun, sizeof(struct tchars))) u.u_error = EFAULT; break; case TIOCGETC: if (copyout((caddr_t)&tun, addr, sizeof(struct tchars))) u.u_error = EFAULT; break; /* local ioctls */ /* * Set/get local special characters. */ case TIOCSLTC: if (copyin(addr, (caddr_t)&tlun, sizeof (struct ltchars))) u.u_error = EFAULT; break; case TIOCGLTC: if (copyout((caddr_t)&tlun, addr, sizeof (struct ltchars))) u.u_error = EFAULT; break; /* * Return number of characters immediately available. */ case FIONREAD: { off_t nread; switch (tp->t_line) { case NETLDISC: nread = tp->t_rec ? tp->t_inbuf : 0; break; case 0: (void) spl5(); while (canon(tp)>=0) ; (void) spl0(); /* fall into ... */ case NTTYDISC: if (tp->t_local & LPENDIN) ntypend(tp); nread = tp->t_canq.c_cc; if (tp->t_flags & (RAW|CBREAK)) nread += tp->t_rawq.c_cc; break; } if (copyout((caddr_t)&nread, addr, sizeof (off_t))) u.u_error = EFAULT; break; } /* * Should allow SPGRP and GPGRP only if tty open for reading. */ case TIOCSPGRP: if (copyin(addr, (caddr_t)&tp->t_pgrp, sizeof (tp->t_pgrp))) u.u_error = EFAULT; break; case TIOCGPGRP: if (copyout((caddr_t)&tp->t_pgrp, addr, sizeof(tp->t_pgrp))) u.u_error = EFAULT; break; /* * Modify local mode word. */ case TIOCLBIS: if (copyin(addr, (caddr_t)&temp, sizeof (tp->t_local))) u.u_error = EFAULT; else tp->t_local |= temp; break; case TIOCLBIC: if (copyin(addr, (caddr_t)&temp, sizeof (tp->t_local))) u.u_error = EFAULT; else tp->t_local &= ~temp; break; case TIOCLSET: if (copyin(addr, (caddr_t)&temp, sizeof (tp->t_local))) u.u_error = EFAULT; else tp->t_local = temp; break; case TIOCLGET: if (copyout((caddr_t)&tp->t_local, addr, sizeof(tp->t_local))) u.u_error = EFAULT; break; /* * Return number of characters in * the output. */ case TIOCOUTQ: if (copyout((caddr_t)&tp->t_outq.c_cc, addr, sizeof(tp->t_outq.c_cc))) u.u_error = EFAULT; break; /* * Simulate typing of a character at the terminal. */ case TIOCSTI: c = fubyte(addr); if (u.u_uid && u.u_ttyp != tp || c < 0) u.u_error = EFAULT; else (*linesw[tp->t_line].l_rint)(c, tp); break; /* end of locals */ default: return(0); } return(1); } eof(tp->t_local))) u.u_error = EFAULT; break; /* * Return number of characters in * the output. */ case TIOCOUTQ: if (copyout((caddr_t)&tp->t_outq.c_cc, addr, sizeof(tp->t_outq.c_cc))) u.u_error = EFAULT; break; /* * Simulate typing of a character at the terminal. */ cassys/dev/pty.c 444 0 33 13456 2624051521 6433 /* pty.c 4.8 81/08/14 */ /* * Pseudo-teletype Driver * (Actually two drivers, requiring two entries in 'cdevsw') */ #include "pty.h" #if NPTY > 0 #include "../h/param.h" #include "../h/systm.h" #include "../h/tty.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/conf.h" #include "../h/buf.h" #include "../h/file.h" #define NPTY 16 /* Number of pseudo-teletypes */ #define BUFSIZ 100 /* Chunk size iomoved from user */ #define ALLDELAYS (NLDELAY|TBDELAY|XTABS|CRDELAY|VTDELAY) /* * A pseudo-teletype is a special device which is not unlike a pipe. * It is used to communicate between two processes. However, it allows * one to simulate a teletype, including mode setting, interrupt, and * multiple end of files (all not possible on a pipe). There are * really two drivers here. One is the device which looks like a TTY * and can be thought of as the slave device, and hence its routines * are prefixed with 'pts' (PTY Slave). The other driver can be * thought of as the controlling device, ((and its routines are prefixed * by 'ptc' (PTY Controller). To type on the simulated keyboard of the * PTY, one does a 'write' to the controlling device. To get the * simulated printout from the PTY, one does a 'read' on the controlling * device. Normally, the controlling device is called 'ptyx' and the * slave device is called 'ttyx' (to make programs like 'who' happy). */ struct tty pt_tty[NPTY]; /* TTY headers for PTYs */ /*ARGSUSED*/ ptsopen(dev, flag) dev_t dev; { /* Open for PTY Slave */ register struct tty *tp; if(minor(dev) >= NPTY) { u.u_error = ENXIO; return; } tp = &pt_tty[minor(dev)]; if((tp->t_state & ISOPEN) == 0) { ttychars(tp); /* Set up default chars */ tp->t_flags = 0; /* No features (nor raw mode) */ } else if(tp->t_state&XCLUDE && u.u_uid != 0) { u.u_error = EBUSY; return; } if(tp->t_oproc) /* Ctrlr still around. */ tp->t_state |= CARR_ON; while((tp->t_state & CARR_ON) == 0) { tp->t_state |= WOPEN; sleep((caddr_t)&tp->t_rawq, TTIPRI); } (*linesw[tp->t_line].l_open)(dev, tp); } ptsclose(dev) dev_t dev; { /* Close slave part of PTY */ register struct tty *tp; tp = &pt_tty[minor(dev)]; (*linesw[tp->t_line].l_close)(tp); } ptsread(dev) dev_t dev; { /* Read from PTY, i.e. from data written by controlling device */ register struct tty *tp; tp = &pt_tty[minor(dev)]; if(tp->t_oproc) { (*linesw[tp->t_line].l_read)(tp); /* Wakeup other half if sleeping */ wakeup((caddr_t)&tp->t_rawq.c_cf); } } ptswrite(dev) dev_t dev; { /* Write on PTY, i.e. to be read from controlling device */ register struct tty *tp; tp = &pt_tty[minor(dev)]; /* Wait for controlling device to be opened */ if(tp->t_oproc) (*linesw[tp->t_line].l_write)(tp); } ptsstart(tp) struct tty *tp; { /* Called by 'ttstart' to output a character. Merely wakes up controlling half, which does actual work */ if(tp->t_state & TTSTOP) return; wakeup((caddr_t)&tp->t_outq.c_cf); } /*ARGSUSED*/ ptcopen(dev, flag) dev_t dev; { /* Open for PTY Controller */ register struct tty *tp; if(minor(dev) >= NPTY) { u.u_error = ENXIO; return; } tp = &pt_tty[minor(dev)]; if(tp->t_oproc) { u.u_error = EIO; return; } tp->t_oproc = ptsstart; /* Set address of start routine */ tp->t_iproc = 0; if(tp->t_state & WOPEN) wakeup((caddr_t)&tp->t_rawq); tp->t_state |= CARR_ON; } ptcclose(dev) dev_t dev; { /* Close controlling part of PTY */ register struct tty *tp; tp = &pt_tty[minor(dev)]; if(tp->t_state & ISOPEN) gsignal(tp->t_pgrp, SIGHUP); tp->t_state &= ~CARR_ON; /* Virtual carrier is gone */ flushtty(tp, FREAD|FWRITE); /* Clean things up */ tp->t_oproc = 0; /* Mark as closed */ } ptcread(dev) dev_t dev; { /* Read from PTY's output buffer */ register struct tty *tp; tp = &pt_tty[minor(dev)]; if((tp->t_state&(CARR_ON|ISOPEN)) == 0) return; while(tp->t_outq.c_cc == 0 || /* Wait for something to arrive */ (tp->t_state&TTSTOP)) /* (Woken by ptsstart) */ sleep((caddr_t)&tp->t_outq.c_cf, TTIPRI); while(tp->t_outq.c_cc && passc(getc(&tp->t_outq)) >= 0); if(tp->t_outq.c_cc <= TTLOWAT(tp) && (tp->t_state&ASLEEP)) { tp->t_state &= ~ASLEEP; if(tp->t_chan) mcstart(tp->t_chan, (caddr_t)&tp->t_outq); else wakeup((caddr_t)&tp->t_outq); } } ptcwrite(dev) dev_t dev; { /* Stuff characters into PTY's input buffer */ register struct tty *tp; register char *cp, *ce; register int cc; char locbuf[BUFSIZ]; tp = &pt_tty[minor(dev)]; if((tp->t_state&(CARR_ON|ISOPEN)) == 0) return; while(u.u_count) { cc = MIN(u.u_count, BUFSIZ); cp = locbuf; iomove(cp, (unsigned)cc, B_WRITE); if(u.u_error) break; ce = cp + cc; while(cp < ce) { while(tp->t_delct && tp->t_rawq.c_cc >= TTYHOG - 2) { wakeup((caddr_t)&tp->t_rawq); /* Better than just flushing it! */ /* Wait for something to be read */ sleep((caddr_t)&tp->t_rawq.c_cf, TTOPRI); } (*linesw[tp->t_line].l_rint)(*cp++, tp); } } } /* Note: Both slave and controlling device have the same routine for */ /* 'ioctl' (but note check for controller - 4/12/78:mob)*/ /*ARGSUSED*/ ptyioctl(dev, cmd, addr, flag) caddr_t addr; dev_t dev; { /* Read and write status bits */ register struct tty *tp; register int tbd; #ifdef BLAND register int nld; #endif tp = &pt_tty[minor(dev)]; /* if controller stty then must flush to prevent a hang */ if(cdevsw[major(dev)].d_open == ptcopen && cmd == TIOCSETP) while(getc(&tp->t_outq) >= 0); if(ttioctl(tp, cmd, addr, dev)) { if(cmd == TIOCSETP || cmd == TIOCSETN) { #ifdef BLAND nld = tp->t_flags & NLDELAY; #endif tbd = tp->t_flags & TBDELAY; tp->t_flags &= ~ALLDELAYS; if(tbd == TBDELAY) /* Wants tab expansion */ tp->t_flags |= tbd; #ifdef BLAND if(nld == NLDELAY) /* Allow ANN ARBOR mode. */ tp->t_flags |= nld; #endif } } else u.u_error = ENOTTY; } #endif revent a hang */ if(cdevsw[major(dev)].d_open == ptcopen && cmd == TIOCSETP) while(getc(&tp->t_outq) >= 0); if(ttioctl(tp, cmd, addr, dev)) { if(cmd == TIOCSETP || cmd == TIOCSETN) { #ifdef BLAND nld =sys/dev/rk.c 444 0 33 41752 2560202022 6224 /* rk.c 4.36 81/07/25 */ #include "rk.h" #if NHK > 0 int rkpip; /* DEBUG */ int rknosval; /* DEBUG */ #ifdef RKDEBUG int rkdebug; #endif #ifdef RKBDEBUG int rkbdebug; #endif /* * RK611/RK0[67] disk driver * * This driver mimics up.c; see it for an explanation of common code. * * TODO: * Learn why we lose an interrupt sometime when spinning drives down */ #include "../h/param.h" #include "../h/systm.h" #include "../h/buf.h" #include "../h/conf.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/pte.h" #include "../h/map.h" #include "../h/vm.h" #include "../h/ubareg.h" #include "../h/ubavar.h" #include "../h/dk.h" #include "../h/cpu.h" #include "../h/cmap.h" #include "../h/dkbad.h" #include "../h/rkreg.h" struct rk_softc { int sc_softas; int sc_ndrive; int sc_wticks; int sc_recal; } rk_softc[NHK]; /* THIS SHOULD BE READ OFF THE PACK, PER DRIVE */ struct size { daddr_t nblocks; int cyloff; } rk7_sizes[8] ={ 15884, 0, /* A=cyl 0 thru 240 */ 10032, 241, /* B=cyl 241 thru 392 */ 53790, 0, /* C=cyl 0 thru 814 */ 0, 0, 0, 0, 0, 0, 27786, 393, /* G=cyl 393 thru 813 */ 0, 0, }, rk6_sizes[8] ={ 15884, 0, /* A=cyl 0 thru 240 */ 11154, 241, /* B=cyl 241 thru 409 */ 27126, 0, /* C=cyl 0 thru 410 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; /* END OF STUFF WHICH SHOULD BE READ IN PER DISK */ short rktypes[] = { RK_CDT, 0 }; int rkprobe(), rkslave(), rkattach(), rkdgo(), rkintr(); struct uba_ctlr *rkminfo[NHK]; struct uba_device *rkdinfo[NRK]; struct uba_device *rkip[NHK][4]; u_short rkstd[] = { 0777440, 0 }; struct uba_driver hkdriver = { rkprobe, rkslave, rkattach, rkdgo, rkstd, "rk", rkdinfo, "hk", rkminfo, 1 }; struct buf rkutab[NRK]; short rkcyl[NRK]; #ifndef NOBADSECT struct dkbad rkbad[NRK]; struct buf brkbuf[NRK]; #endif struct rkst { short nsect; short ntrak; short nspc; short ncyl; struct size *sizes; } rkst[] = { NRKSECT, NRKTRK, NRKSECT*NRKTRK, NRK7CYL, rk7_sizes, NRKSECT, NRKTRK, NRKSECT*NRKTRK, NRK6CYL, rk6_sizes, }; u_char rk_offset[16] = { RKAS_P400,RKAS_M400,RKAS_P400,RKAS_M400,RKAS_P800,RKAS_M800,RKAS_P800, RKAS_M800,RKAS_P1200,RKAS_M1200,RKAS_P1200,RKAS_M1200,0,0,0,0 }; struct buf rrkbuf[NRK]; #define b_cylin b_resid #ifdef INTRLVE daddr_t dkblock(); #endif int rkwstart, rkwatch(); rkprobe(reg) caddr_t reg; { register int br, cvec; #ifdef lint br = 0; cvec = br; br = cvec; #endif ((struct rkdevice *)reg)->rkcs1 = RK_CDT|RK_IE|RK_CRDY; DELAY(10); ((struct rkdevice *)reg)->rkcs1 = RK_CDT; return (1); } rkslave(ui, reg) struct uba_device *ui; caddr_t reg; { register struct rkdevice *rkaddr = (struct rkdevice *)reg; ui->ui_type = 0; rkaddr->rkcs1 = RK_CCLR; rkaddr->rkcs2 = ui->ui_slave; rkaddr->rkcs1 = RK_CDT|RK_DCLR|RK_GO; rkwait(rkaddr); DELAY(50); if (rkaddr->rkcs2&RKCS2_NED || (rkaddr->rkds&RKDS_SVAL) == 0) { rkaddr->rkcs1 = RK_CCLR; return (0); } if (rkaddr->rkcs1&RK_CERR && rkaddr->rker&RKER_DTYE) { ui->ui_type = 1; rkaddr->rkcs1 = RK_CCLR; } return (1); } rkattach(ui) register struct uba_device *ui; { if (rkwstart == 0) { timeout(rkwatch, (caddr_t)0, hz); rkwstart++; } if (ui->ui_dk >= 0) dk_mspw[ui->ui_dk] = 1.0 / (60 * NRKSECT * 256); rkip[ui->ui_ctlr][ui->ui_slave] = ui; rk_softc[ui->ui_ctlr].sc_ndrive++; rkcyl[ui->ui_unit] = -1; ui->ui_flags = 0; } rkstrategy(bp) register struct buf *bp; { register struct uba_device *ui; register struct rkst *st; register int unit; register struct buf *dp; int xunit = minor(bp->b_dev) & 07; long bn, sz; sz = (bp->b_bcount+511) >> 9; unit = dkunit(bp); if (unit >= NRK) goto bad; ui = rkdinfo[unit]; if (ui == 0 || ui->ui_alive == 0) goto bad; st = &rkst[ui->ui_type]; if (bp->b_blkno < 0 || (bn = dkblock(bp))+sz > st->sizes[xunit].nblocks) goto bad; bp->b_cylin = bn/st->nspc + st->sizes[xunit].cyloff; (void) spl5(); dp = &rkutab[ui->ui_unit]; disksort(dp, bp); if (dp->b_active == 0) { (void) rkustart(ui); bp = &ui->ui_mi->um_tab; if (bp->b_actf && bp->b_active == 0) (void) rkstart(ui->ui_mi); } (void) spl0(); return; bad: bp->b_flags |= B_ERROR; iodone(bp); return; } rkustart(ui) register struct uba_device *ui; { register struct buf *bp, *dp; register struct uba_ctlr *um; register struct rkdevice *rkaddr; int didie = 0; if (ui == 0) return (0); dk_busy &= ~(1<ui_dk); dp = &rkutab[ui->ui_unit]; um = ui->ui_mi; rkaddr = (struct rkdevice *)um->um_addr; if (um->um_tab.b_active) { rk_softc[um->um_ctlr].sc_softas |= 1<ui_slave; return (0); } rkaddr->rkcs1 = rktypes[ui->ui_type]|RK_CERR; rkadd((r->rkcs2 = ui->ui_slave; rkaddr->rkcs1 = rktypes[ui->ui_type]|RK_DCLR|RK_GO; rkwait(rkaddr); if ((bp = dp->b_actf) == NULL) { rkaddr->rkcs1 = rktypes[ui->ui_type]|RK_DCLR|RK_GO; rkwait(rkaddr); return (0); } if ((rkaddr->rkds & RKDS_VV) == 0 || ui->ui_flags == 0) { /* SHOULD WARN SYSTEM THAT THIS HAPPENED */ #ifndef NOBADSECT struct rkst *st = &rkst[ui->ui_type]; struct buf *bbp = &brkbuf[ui->ui_unit]; #endif rkaddr->rkcs1 = rktypes[ui->ui_type]|RK_PACK|RK_GO; ui->ui_flags = 1; #ifndef NOBADSECT bbp->b_flags = B_READ|B_BUSY; bbp->b_dev = bp->b_dev; bbp->b_bcount = 512; bbp->b_un.b_addr = (caddr_t)&rkbad[ui->ui_unit]; bbp->b_blkno = st->ncyl*st->nspc - st->nsect; bbp->b_cylin = st->ncyl - 1; dp->b_actf = bbp; bbp->av_forw = bp; bp = bbp; #endif rkwait(rkaddr); } if (dp->b_active) goto done; dp->b_active = 1; if ((rkaddr->rkds & RKDS_DREADY) != RKDS_DREADY) goto done; if (rk_softc[um->um_ctlr].sc_ndrive == 1) goto done; if (bp->b_cylin == rkcyl[ui->ui_unit]) goto done; rkaddr->rkcyl = bp->b_cylin; rkcyl[ui->ui_unit] = bp->b_cylin; rkaddr->rkcs1 = rktypes[ui->ui_type]|RK_IE|RK_SEEK|RK_GO; didie = 1; if (ui->ui_dk >= 0) { dk_busy |= 1<ui_dk; dk_seek[ui->ui_dk]++; } goto out; done: if (dp->b_active != 2) { dp->b_forw = NULL; if (um->um_tab.b_actf == NULL) um->um_tab.b_actf = dp; else um->um_tab.b_actl->b_forw = dp; um->um_tab.b_actl = dp; dp->b_active = 2; } out: return (didie); } rkstart(um) register struct uba_ctlr *um; { register struct buf *bp, *dp; register struct uba_device *ui; register struct rkdevice *rkaddr; struct rkst *st; daddr_t bn; int sn, tn, cmd; loop: if ((dp = um->um_tab.b_actf) == NULL) return (0); if ((bp = dp->b_actf) == NULL) { um->um_tab.b_actf = dp->b_forw; goto loop; } um->um_tab.b_active++; ui = rkdinfo[dkunit(bp)]; bn = dkblock(bp); st = &rkst[ui->ui_type]; sn = bn%st->nspc; tn = sn/st->nsect; sn %= st->nsect; rkaddr = (struct rkdevice *)ui->ui_addr; retry: rkaddr->rkcs1 = RK_CCLR; rkaddr->rkcs2 = ui->ui_slave; rkaddr->rkcs1 = rktypes[ui->ui_type]|RK_DCLR|RK_GO; rkwait(rkaddr); if ((rkaddr->rkds&RKDS_SVAL) == 0) { rknosval++; goto nosval; } if (rkaddr->rkds&RKDS_PIP) { rkpip++; goto retry; } if ((rkaddr->rkds&RKDS_DREADY) != RKDS_DREADY) { printf("rk%d: not ready", dkunit(bp)); if ((rkaddr->rkds&RKDS_DREADY) != RKDS_DREADY) { printf("\n"); rkaddr->rkcs1 = rktypes[ui->ui_type]|RK_DCLR|RK_GO; rkwait(rkaddr); rkaddr->rkcs1 = RK_CCLR; rkwait(rkaddr); um->um_tab.b_active = 0; um->um_tab.b_errcnt = 0; dp->b_actf = bp->av_forw; dp->b_active = 0; bp->b_flags |= B_ERROR; iodone(bp); goto loop; } printf(" (came back!)\n"); } nosval: rkaddr->rkcyl = bp->b_cylin; rkcyl[ui->ui_unit] = bp->b_cylin; rkaddr->rkda = (tn << 8) + sn; rkaddr->rkwc = -bp->b_bcount / sizeof (short); if (bp->b_flags & B_READ) cmd = rktypes[ui->ui_type]|RK_IE|RK_READ|RK_GO; else cmd = rktypes[ui->ui_type]|RK_IE|RK_WRITE|RK_GO; um->um_cmd = cmd; (void) ubago(ui); return (1); } rkdgo(um) register struct uba_ctlr *um; { register struct rkdevice *rkaddr = (struct rkdevice *)um->um_addr; rkaddr->rkba = um->um_ubinfo; rkaddr->rkcs1 = um->um_cmd|((um->um_ubinfo>>8)&0x300); } rkintr(rk11) int rk11; { register struct uba_ctlr *um = rkminfo[rk11]; register struct uba_device *ui; register struct rkdevice *rkaddr = (struct rkdevice *)um->um_addr; register struct buf *bp, *dp; int unit; struct rk_softc *sc = &rk_softc[um->um_ctlr]; int as = (rkaddr->rkatt >> 8) | sc->sc_softas; int needie = 1; sc->sc_wticks = 0; sc->sc_softas = 0; if (um->um_tab.b_active) { dp = um->um_tab.b_actf; bp = dp->b_actf; ui = rkdinfo[dkunit(bp)]; dk_busy &= ~(1 << ui->ui_dk); #ifndef NOBADSECT if (bp->b_flags&B_BAD) if (rkecc(ui, CONT)) return; #endif if (rkaddr->rkcs1 & RK_CERR) { int recal; u_short ds = rkaddr->rkds; u_short cs2 = rkaddr->rkcs2; u_short er = rkaddr->rker; #ifdef RKDEBUG if (rkdebug) { printf("cs2=%b ds=%b er=%b\n", cs2, RKCS2_BITS, ds, RKDS_BITS, er, RKER_BITS); } #endif if (er & RKER_WLE) { printf("rk%d: write locked\n", dkunit(bp)); bp->b_flags |= B_ERROR; } else if (++um->um_tab.b_errcnt > 28 || ds&RKDS_HARD || er&RKER_HARD || cs2&RKCS2_HARD) { hard: harderr(bp, "rk"); printf("cs2=%b ds=%b er=%b\n", cs2, RKCS2_BITS, ds, RKDS_BITS, er, RKER_BITS); bp->b_flags |= B_ERROR; sc->sc_recal = 0; } else if (er & RKER_BSE) { #ifndef NOBADSECT if (rkecc(ui, BSE)) return; else #endif goto hard; } else um->um_tab.b_active = 0; if (cs2&RKCS2_MDS) { rkaddr->rkcs2 = RKCS2_SCLR; goto retry; } recal = 0; if (ds&RKDS_DROT || er&(RKER_OPI|RKER_SKI|RKER_UNS) || (um->um_tab.b_errcnt&07) == 4) recal = 1; if ((er & (RKER_DCK|RKER_ECH)) == RKER_DCK) if (rkecc(ui, ECC)) return; rkaddr->rkcs1 = RK_CCLR; rkaddr->rkcs2 = ui->ui_slave; rkaddr->rkcs1 = rktypes[ui->ui_type]|RK_DCLR|RK_GO; rkwait(rkaddr); if (recal && um->um_tab.b_active == 0) { rkaddr->rkcs1 = rktypes[ui->ui_type]|RK_IE|RK_RECAL|RK_GO; rkcyl[ui->ui_unit] = -1; sc->sc_recal = 0; goto nextrecal; } } retry: switch (sc->sc_recal) { case 1: rkaddr->rkcyl = bp->b_cylin; rkcyl[ui->ui_unit] = bp->b_cylin; rkaddr->rkcs1 = rktypes[ui->ui_type]|RK_IE|RK_SEEK|RK_GO; goto nextrecal; case 2: if (um->um_tab.b_errcnt < 16 || (bp->b_flags&B_READ) == 0) goto donerecal; rkaddr->rkatt = rk_offset[um->um_tab.b_errcnt & 017]; rkaddr->rkcs1 = rktypes[ui->ui_type]|RK_IE|RK_OFFSET|RK_GO; /* fall into ... */ nextrecal: sc->sc_recal++; rkwait(rkaddr); um->um_tab.b_active = 1; return; donerecal: case 3: sc->sc_recal = 0; um->um_tab.b_active = 0; break; } ubadone(um); if (um->um_tab.b_active) { um->um_tab.b_active = 0; um->um_tab.b_errcnt = 0; um->um_tab.b_actf = dp->b_forw; dp->b_active = 0; dp->b_errcnt = 0; dp->b_actf = bp->av_forw; bp->b_resid = -rkaddr->rkwc * sizeof(short); iodone(bp); if (dp->b_actf) if (rkustart(ui)) needie = 0; } as &= ~(1<ui_slave); } for (unit = 0; as; as >>= 1, unit++) if (as & 1) { ui = rkip[rk11][unit]; if (ui) { if (rkustart(rkip[rk11][unit])) needie = 0; } else { rkaddr->rkcs1 = RK_CCLR; rkaddr->rkcs2 = unit; rkaddr->rkcs1 = RK_DCLR|RK_GO; rkwait(rkaddr); rkaddr->rkcs1 = RK_CCLR; } } if (um->um_tab.b_actf && um->um_tab.b_active == 0) if (rkstart(um)) needie = 0; if (needie) rkaddr->rkcs1 = RK_IE; } rkwait(addr) register struct rkdevice *addr; { while ((addr->rkcs1 & RK_CRDY) == 0) ; } rkread(dev) dev_t dev; { register int unit = minor(dev) >> 3; if (unit >= NRK) u.u_error = ENXIO; else physio(rkstrategy, &rrkbuf[unit], dev, B_READ, minphys); } rkwrite(dev) dev_t dev; { register int unit = minor(dev) >> 3; if (unit >= NRK) u.u_error = ENXIO; else physio(rkstrategy, &rrkbuf[unit], dev, B_WRITE, minphys); } rkecc(ui, flag) register struct uba_device *ui; { register struct rkdevice *rk = (struct rkdevice *)ui->ui_addr; register struct buf *bp = rkutab[ui->ui_unit].b_actf; register struct uba_ctlr *um = ui->ui_mi; register struct rkst *st; struct uba_regs *ubp = ui->ui_hd->uh_uba; caddr_t addr; int reg, npf, o, cmd, ubaddr; int bn, cn, tn, sn; #ifndef NOBADSECT if (flag == CONT) npf = bp->b_error; else #endif npf = btop((rk->rkwc * sizeof(short)) + bp->b_bcount); reg = btop(um->um_ubinfo&0x3ffff) + npf; o = (int)bp->b_un.b_addr & PGOFSET; bn = dkblock(bp); st = &rkst[ui->ui_type]; cn = bp->b_cylin; sn = bn%st->nspc + npf; tn = sn/st->nsect; sn %= st->nsect; cn += tn/st->ntrak; tn %= st->ntrak; ubapurge(um); um->um_tab.b_active++; /* Either complete or continuing... */ switch (flag) { case ECC: { register int i; int bit, byte, mask; npf--; reg--; printf("rk%d%c: soft ecc sn%d\n", dkunit(bp), 'a'+(minor(bp->b_dev)&07), bp->b_blkno + npf); mask = rk->rkec2; i = rk->rkec1 - 1; /* -1 makes 0 origin */ bit = i&07; i = (i&~07)>>3; byte = i + o; while (i < 512 && (int)ptob(npf)+i < bp->b_bcount && bit > -11) { addr = ptob(ubp->uba_map[reg+btop(byte)].pg_pfnum)+ (byte & PGOFSET); putmemc(addr, getmemc(addr)^(mask<rkwc == 0) return (0); npf++; reg++; break; } #ifndef NOBADSECT case BSE: #ifdef RKBDEBUG if (rkbdebug) printf("rkecc, BSE: bn %d cn %d tn %d sn %d\n", bn, cn, tn, sn); #endif if ((bn = isbad(&rkbad[ui->ui_unit], cn, tn, sn)) < 0) return(0); bp->b_flags |= B_BAD; bp->b_error = npf + 1; bn = st->ncyl*st->nspc - st->nsect - 1 - bn; cn = bn/st->nspc; sn = bn%st->nspc; tn = sn/st->nsect; sn %= st->nsect; #ifdef RKBDEBUG if (rkbdebug) printf("revector to cn %d tn %d sn %d\n", cn, tn, sn); #endif rk->rkwc = -(512 / sizeof (short)); break; case CONT: #ifdef RKBDEBUG if (rkbdebug) printf("rkecc, CONT: bn %d cn %d tn %d sn %d\n", bn,cn,tn,sn); #endif bp->b_flags &= ~B_BAD; rk->rkwc = -((bp->b_bcount - (int)ptob(npf)) / sizeof (short)); if (rk->rkwc == 0) return(0); break; #endif } rk->rkcs1 = RK_CCLR; rk->rkcs2 = ui->ui_slave; rk->rkcs1 = rktypes[ui->ui_type]|RK_DCLR|RK_GO; rkwait(rk); rk->rkcyl = cn; rk->rkda = (tn << 8) | sn; ubaddr = (int)ptob(reg) + o; rk->rkba = ubaddr; cmd = (bp->b_flags&B_READ ? RK_READ : RK_WRITE)|RK_IE|RK_GO; cmd |= (ubaddr >> 8) & 0x300; cmd |= rktypes[ui->ui_type]; rk->rkcs1 = cmd; um->um_tab.b_errcnt = 0; /* error has been corrected */ return (1); } rkreset(uban) int uban; { register struct uba_ctlr *um; register struct uba_device *ui; register rk11, unit; for (rk11 = 0; rk11 < NHK; rk11++) { if ((um = rkminfo[rk11]) == 0 || um->um_ubanum != uban || um->um_alive == 0) continue; printf(" hk%d", rk11); um->um_tab.b_active = 0; um->um_tab.b_actf = um->um_tab.b_actl = 0; rk_softc[um->um_ctlr].sc_recal = 0; if (um->um_ubinfo) { printf("<%d>", (um->um_ubinfo>>28)&0xf); ubadon((e(um); } for (unit = 0; unit < NRK; unit++) { if ((ui = rkdinfo[unit]) == 0) continue; if (ui->ui_alive == 0 || ui->ui_mi != um) continue; rkutab[unit].b_active = 0; (void) rkustart(ui); } (void) rkstart(um); } } rkwatch() { register struct uba_ctlr *um; register rk11, unit; register struct rk_softc *sc; timeout(rkwatch, (caddr_t)0, hz); for (rk11 = 0; rk11 < NHK; rk11++) { um = rkminfo[rk11]; if (um == 0 || um->um_alive == 0) continue; sc = &rk_softc[rk11]; if (um->um_tab.b_active == 0) { for (unit = 0; unit < NRK; unit++) if (rkutab[unit].b_active && rkdinfo[unit]->ui_mi == um) goto active; sc->sc_wticks = 0; continue; } active: sc->sc_wticks++; if (sc->sc_wticks >= 20) { sc->sc_wticks = 0; printf("hk%d: lost interrupt\n", rk11); ubareset(um->um_ubanum); } } } #define DBSIZE 20 rkdump(dev) dev_t dev; { struct rkdevice *rkaddr; char *start; int num, blk, unit; struct size *sizes; register struct uba_regs *uba; register struct uba_device *ui; register short *rp; struct rkst *st; unit = minor(dev) >> 3; if (unit >= NRK) return (ENXIO); #define phys(cast, addr) ((cast)((int)addr & 0x7fffffff)) ui = phys(struct uba_device *, rkdinfo[unit]); if (ui->ui_alive == 0) return (ENXIO); uba = phys(struct uba_hd *, ui->ui_hd)->uh_physuba; ubainit(uba); rkaddr = (struct rkdevice *)ui->ui_physaddr; num = maxfree; start = 0; rkaddr->rkcs1 = RK_CCLR; rkaddr->rkcs2 = unit; rkaddr->rkcs1 = rktypes[ui->ui_type]|RK_DCLR|RK_GO; rkwait(rkaddr); if ((rkaddr->rkds & RKDS_VV) == 0) { rkaddr->rkcs1 = rktypes[ui->ui_type]|RK_IE|RK_PACK|RK_GO; rkwait(rkaddr); } st = &rkst[ui->ui_type]; sizes = phys(struct size *, st->sizes); if (dumplo < 0 || dumplo + num >= sizes[minor(dev)&07].nblocks) return (EINVAL); while (num > 0) { register struct pte *io; register int i; int cn, sn, tn; daddr_t bn; blk = num > DBSIZE ? DBSIZE : num; io = uba->uba_map; for (i = 0; i < blk; i++) *(int *)io++ = (btop(start)+i) | (1<<21) | UBAMR_MRV; *(int *)io = 0; bn = dumplo + btop(start); cn = bn/st->nspc + sizes[minor(dev)&07].cyloff; sn = bn%st->nspc; tn = sn/st->nsect; sn = sn%st->nsect; rkaddr->rkcyl = cn; rp = (short *) &rkaddr->rkda; *rp = (tn << 8) + sn; *--rp = 0; *--rp = -blk*NBPG / sizeof (short); *--rp = rktypes[ui->ui_type]|RK_GO|RK_WRITE; rkwait(rkaddr); if (rkaddr->rkcs1 & RK_CERR) return (EIO); start += blk*NBPG; num -= blk; } return (0); } #endif nt *)io++ = (btop(starsys/dev/sw.c 444 0 33 5033 2506427531 6227 /* sw.c 4.4 81/03/08 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/buf.h" #include "../h/conf.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/inode.h" #include "../h/map.h" struct buf rswbuf; /* * Indirect driver for multi-controller paging. */ swstrategy(bp) register struct buf *bp; { int sz, off, seg; dev_t dev; sz = (bp->b_bcount+511)/512; off = bp->b_blkno % DMMAX; if (bp->b_blkno+sz > nswap || off+sz > DMMAX) { bp->b_flags |= B_ERROR; iodone(bp); return; } seg = bp->b_blkno / DMMAX; dev = swdevt[seg % nswdev].sw_dev; seg /= nswdev; bp->b_blkno = seg*DMMAX + off; bp->b_dev = dev; if (dev == 0) panic("swstrategy"); (*bdevsw[major(dev)].d_strategy)(bp); } swread(dev) { physio(swstrategy, &rswbuf, dev, B_READ, minphys); } swwrite(dev) { physio(swstrategy, &rswbuf, dev, B_WRITE, minphys); } /* * System call swapon(name) enables swapping on device name, * which must be in the swdevsw. Return EBUSY * if already swapping on this device. */ vswapon() { register struct inode *ip; dev_t dev; register struct swdevt *sp; ip = namei(uchar, 0); if (ip == NULL) return; if ((ip->i_mode&IFMT) != IFBLK) { u.u_error = ENOTBLK; iput(ip); return; } dev = (dev_t)ip->i_un.i_rdev; iput(ip); if (major(dev) >= nblkdev) { u.u_error = ENXIO; return; } /* * Search starting at second table entry, * since first (primary swap area) is freed at boot. */ for (sp = &swdevt[1]; sp->sw_dev; sp++) if (sp->sw_dev == dev) { if (sp->sw_freed) { u.u_error = EBUSY; return; } swfree(sp - swdevt); return; } u.u_error = ENODEV; } /* * Swfree(index) frees the index'th portion of the swap map. * Each of the nswdev devices provides 1/nswdev'th of the swap * space, which is laid out with blocks of DMMAX pages circularly * among the devices. */ swfree(index) int index; { register swblk_t vsbase; register int blk; swdevt[index].sw_freed = 1; for (vsbase = index*DMMAX; vsbase < nswap; vsbase += nswdev*DMMAX) { blk = nswap - vsbase; if (blk > DMMAX) blk = DMMAX; if (vsbase == 0) { /* * Can't free a block starting at 0 in the swapmap * but need some space for argmap so use 1/2 this * hunk which needs special treatment anyways. */ argdev = swdevt[0].sw_dev; rminit(argmap, blk/2-CLSIZE, CLSIZE, "argmap", ARGMAPSIZE); /* * First of all chunks... initialize the swapmap * the second half of the hunk. */ rminit(swapmap, blk/2, blk/2, "swap", nswapmap); } else rmfree(swapmap, blk, vsbase); } } MMAX) blk = DMMAX; if (vsbase == 0) { /* * Can't free a block starting at 0 in the swapmap * but need some space for argmap so use 1/2 this * hunk which needs special treatment anyways. */ argdev = swdevt[0].sw_dev; rminit(argmap, blk/2-CLSIZE, CLSIZE, "argmap", ARGMAPSIZE); /* * First of all chunks... initialize the swapmap * the second half of the hunk. */ rminit(swapmap, blk/2, blk/2, "swap", nswapmap); } else rmfree(ssys/dev/swaphkhk.c 644 0 33 1064 2624051542 7414 #include "../h/param.h" #include "../h/conf.h" /* * Dual rk07 configuration * root on hk0a * paging on hk0b, then hk1b */ dev_t rootdev = makedev(3, 0); dev_t pipedev = makedev(3, 0); dev_t argdev = makedev(3, 1); dev_t dumpdev = makedev(3, 1); long dumplo = 10032 - 2 * 2048; /* not enough... */ /* * Nswap is the basic number of blocks of swap per * swap device, and is multiplied by nswdev after * nswdev is determined at boot. */ int nswap = 10032; struct swdevt swdevt[] = { makedev(3, 1), 0, /* hk0b */ makedev(3, 9), 0, /* hk1b */ 0, 0, }; Dual rk07 configuration * root on hk0a * paging on hk0b, then hk1b */ dev_t rootdev = makedev(3, 0); dev_t pipedev = makedev(3, 0); dev_t argdev = makedev(3, 1); dev_t dumpdev = makedev(3, 1); long dumplo = 10032 - 2 * 2048; /* not enough... */ /* * Nswap is the basic number of blocks of swap per * swap device, and is multiplied by nswdev after * nswdev is determined at boot. */ int nswap = 10032; struct swdevt swdevt[] = { makedev(3, 1), 0, /sys/dev/swapgeneric.c 644 0 33 5664 2633227206 10117 /* swapgeneric.c 4.12 81/12/03 */ #include "mba.h" #include "../h/param.h" #include "../h/conf.h" #include "../h/pte.h" #include "../h/buf.h" #include "../h/mbareg.h" #include "../h/mbavar.h" #include "../h/vm.h" #include "../h/ubareg.h" #include "../h/ubavar.h" #include "../h/systm.h" #include "../h/reboot.h" #include "../h/cons.h" #include "../h/mtpr.h" /* * Generic configuration; all in one */ dev_t rootdev, pipedev, argdev, dumpdev; int nswap; struct swdevt swdevt[] = { -1, 1, 0, 0, }; long dumplo; extern struct mba_driver hpdriver; extern struct uba_driver scdriver; extern struct uba_driver hkdriver; extern struct uba_driver udadriver; struct genericconf { caddr_t gc_driver; char *gc_name; dev_t gc_root; long gc_nswap; long gc_dumplo; } genericconf[] = { (caddr_t)&hpdriver, "hp", makedev(0, 0), 33440, 33440 - 10*2048, (caddr_t)&scdriver, "up", makedev(2, 0), 33440, 33440 - 10*2048, (caddr_t)&udadriver, "ra", makedev(9, 0), 33440, 33440 - 10*2048, (caddr_t)&hkdriver, "hk", makedev(3, 0), 10032, 10032 - 2*(2048+1024), 0, }; setconf() { register struct mba_device *mi; register struct uba_device *ui; register struct genericconf *gc; int unit; if (boothowto & RB_ASKNAME) { char name[128]; retry: printf("root device? "); gets(name); for (gc = genericconf; gc->gc_driver; gc++) if (gc->gc_name[0] == name[0] && gc->gc_name[1] == name[1]) goto gotit; goto bad; gotit: if (name[2] >= '0' && name[2] <= '7' && name[3] == 0) { unit = name[2] - '0'; goto found; } printf("bad/missing unit number\n"); bad: printf("use hp%%d, up%%d, ra%%d or hk%%d\n"); goto retry; } unit = 0; for (gc = genericconf; gc->gc_driver; gc++) { for (mi = mbdinit; mi->mi_driver; mi++) { if (mi->mi_alive == 0) continue; if (mi->mi_unit == 0 && mi->mi_driver == (struct mba_driver *)gc->gc_driver) { printf("root on %s0\n", mi->mi_driver->md_dname); goto found; } } for (ui = ubdinit; ui->ui_driver; ui++) { if (ui->ui_alive == 0) continue((; if (ui->ui_unit == 0 && ui->ui_driver == (struct uba_driver *)gc->gc_driver) { printf("root on %s0\n", ui->ui_driver->ud_dname); goto found; } } } printf("no suitable root\n"); asm("halt"); found: gc->gc_root = makedev(major(gc->gc_root), unit*8); rootdev = pipedev = gc->gc_root; swdevt[0].sw_dev = argdev = dumpdev = makedev(major(rootdev), minor(rootdev)+1); nswap = gc->gc_nswap; dumplo = gc->gc_dumplo; } getchar() { register c; while((mfpr(RXCS)&RXCS_DONE) == 0) ; c = mfpr(RXDB)&0177; if (c=='\r') c = '\n'; cnputc(c); return(c); } gets(cp) char *cp; { register char *lp; register c; lp = cp; for (;;) { c = getchar() & 0177; switch(c) { case '\n': case '\r': *lp++ = '\0'; return; case '\b': case '#': lp--; if (lp < cp) lp = cp; continue; case '@': case 'u'&037: lp = cp; cnputc('\n'); continue; default: *lp++ = c; } } } = gc->gc_dumplo; } getchar() { register c; while((mfpr(RXCS)&RXCS_DONE)sys/dev/swaphp.c 644 0 33 775 2522400313 7055 #include "../h/param.h" #include "../h/conf.h" /* * Single rp0?/rm?? configuration * root on hp0a * paging on hp0b */ dev_t rootdev = makedev(0, 0); dev_t pipedev = makedev(0, 0); dev_t argdev = makedev(0, 1); dev_t dumpdev = makedev(0, 1); long dumplo = 33440 - 10 * 2048; /* * Nswap is the basic number of blocks of swap per * swap device, and is multiplied by nswdev after * nswdev is determined at boot. */ int nswap = 33440; struct swdevt swdevt[] = { makedev(0, 1), 0, /* hp0b */ 0, 0, }; sys/dev/swaphphp.c 644 0 33 1047 2531444542 7432 #include "../h/param.h" #include "../h/conf.h" /* * Dual rp0?/rm?? configuration * root on hp0a * paging on hp0b and then hp1b */ dev_t rootdev = makedev(0, 0); dev_t pipedev = makedev(0, 0); dev_t argdev = makedev(0, 1); dev_t dumpdev = makedev(0, 1); int dumplo = 33440 - 10 * 2048; /* * Nswap is the basic number of blocks of swap per * swap device, and is multiplied by nswdev after * nswdev is determined at boot. */ int nswap = 33440; struct swdevt swdevt[] = { makedev(0, 1), 0, /* hp0b */ makedev(0, 9), 0, /* hp1b */ 0, 0, }; conf.h" /* * Dual rp0?/rm?? configuration * root on hp0a * paging on hp0b and then hp1b */ dev_t rootdev = makedev(0, 0); dev_t pipedev = makedev(0, 0); dev_t argdev = makedev(0, 1); dev_t dumpdev = makedev(0, 1); int dumplo = 33440 - 10 * 2048; /* * Nswap is the basic number of blocks of swap per * swap device, and is multiplied by nswdev after * nswdev is determined at boot. */ int nswap = 33440; struct swdevt swdevt[] = { makedev(0, 1), 0, /* hp0b */ masys/dev/swaphpup.c 644 0 33 1042 2522400313 7426 #include "../h/param.h" #include "../h/conf.h" /* * RP0?+UP0? configuration * root on hp0a * paging on hp0b and then up0b */ dev_t rootdev = makedev(0, 0); dev_t pipedev = makedev(0, 0); dev_t argdev = makedev(0, 1); dev_t dumpdev = makedev(0, 1); int dumplo = 33340 - 10 * 2048; /* * Nswap is the basic number of blocks of swap per * swap device, and is multiplied by nswdev after * nswdev is determined at boot. */ int nswap = 33440; struct swdevt swdevt[] = { makedev(0, 1), 0, /* hp0b */ makedev(2, 1), 0, /* up0b */ 0, 0, }; ../h/conf.h" /* * RP0?+UP0? configuration * root on hp0a * paging on hp0b and then up0b */ dev_t rootdev = makedev(0, 0); dev_t pipedev = makedev(0, 0); dev_t argdev = makedev(0, 1); dev_t dumpdev = makedev(0, 1); int dumplo = 33340 - 10 * 2048; /* * Nswap is the basic number of blocks of swap per * swap device, and is multiplied by nswdev after * nswdev is determined at boot. */ int nswap = 33440; struct swdevt swdevt[] = { makedev(0, 1), 0, /* hp0b */ makedevsys/dev/swapup.c 644 0 33 1046 2522400313 7102 #include "../h/param.h" #include "../h/conf.h" /* * Single storage module (ampex or cdc 300M or fujitsu 160m) configuration * root on up0a * paging on up0b */ dev_t rootdev = makedev(2, 0); dev_t pipedev = makedev(2, 0); dev_t argdev = makedev(2, 1); dev_t dumpdev = makedev(2, 1); long dumplo = 33440 - 10 * 2048; /* * Nswap is the basic number of blocks of swap per * swap device, and is multiplied by nswdev after * nswdev is determined at boot. */ int nswap = 33440; struct swdevt swdevt[] = { makedev(2, 1), 0, /* up0b */ 0, 0, }; /conf.h" /* * Single storage module (ampex or cdc 300M or fujitsu 160m) configuration * root on up0a * paging on up0b */ dev_t rootdev = makedev(2, 0); dev_t pipedev = makedev(2, 0); dev_t argdev = makedev(2, 1); dev_t dumpdev = makedev(2, 1); long dumplo = 33440 - 10 * 2048; /* * Nswap is the basic number of blocks of swap per * swap device, and is multiplied by nswdev after * nswdev is determined at boot. */ int nswap = 33440; struct swdevt swdevt[] = { maksys/dev/ht.c 444 0 33 32144 2624051456 6234 /* ht.c 4.20 81/10/27 */ #include "tu.h" #if NHT > 0 /* * TM03/TU?? tape driver * * TODO: * cleanup messages on errors * test ioctl's * see how many rewind interrups we get if we kick when not at BOT * fixup rle error on block tape code */ #include "../h/param.h" #include "../h/systm.h" #include "../h/buf.h" #include "../h/conf.h" #include "../h/dir.h" #include "../h/file.h" #include "../h/user.h" #include "../h/map.h" #include "../h/pte.h" #include "../h/mbareg.h" #include "../h/mbavar.h" #include "../h/mtio.h" #include "../h/ioctl.h" #include "../h/cmap.h" #include "../h/cpu.h" #include "../h/htreg.h" struct buf rhtbuf[NHT]; struct buf chtbuf[NHT]; short httypes[] = { MBDT_TM03, MBDT_TE16, MBDT_TU45, MBDT_TU77, 0 }; struct mba_device *htinfo[NHT]; int htattach(), htslave(), htustart(), htndtint(), htdtint(); struct mba_driver htdriver = { htattach, htslave, htustart, 0, htdtint, htndtint, httypes, "ht", "tu", htinfo }; #define MASKREG(r) ((r) & 0xffff) /* bits in minor device */ #define TUUNIT(dev) (minor(dev)&03) #define H_NOREWIND 04 #define H_1600BPI 08 #define HTUNIT(dev) (tutoht[TUUNIT(dev)]) #define INF (daddr_t)1000000L /* a block number that wont exist */ struct tu_softc { char sc_openf; char sc_flags; daddr_t sc_blkno; daddr_t sc_nxrec; u_short sc_erreg; u_short sc_dsreg; short sc_resid; short sc_dens; struct mba_device *sc_mi; int sc_slave; } tu_softc[NTU]; short tutoht[NTU]; /* * Bits for sc_flags. */ #define H_WRITTEN 1 /* last operation was a write */ #define H_ERASED 2 /* last write retry was an erase gap */ #define H_REWIND 4 /* last unit start was a rewind */ char hter_bits[] = HTER_BITS; char htds_bits[] = HTDS_BITS; /*ARGSUSED*/ htattach(mi) struct mba_device *mi; { } htslave(mi, ms) struct mba_device *mi; struct mba_slave *ms; { register struct tu_softc *sc = &tu_softc[ms->ms_unit]; register struct htdevice *htaddr = (struct htdevice *)mi->mi_drv; htaddr->httc = ms->ms_slave; if (htaddr->htdt & HTDT_SPR) { sc->sc_mi = mi; sc->sc_slave = ms->ms_slave; tutoht[ms->ms_unit] = mi->mi_unit; return (1); } else return (0); } htopen(dev, flag) dev_t dev; int flag; { register int tuunit; register struct mba_device *mi; register struct tu_softc *sc; int olddens, dens; tuunit = TUUNIT(dev); if (tuunit >= NTU || (sc = &tu_softc[tuunit])->sc_openf || (mi = htinfo[HTUNIT(dev)]) == 0 || mi->mi_alive == 0) { u.u_error = ENXIO; return; } olddens = sc->sc_dens; dens = sc->sc_dens = ((minor(dev)&H_1600BPI)?HTTC_1600BPI:HTTC_800BPI)| HTTC_PDP11|sc->sc_slave; htcommand(dev, HT_SENSE, 1); sc->sc_dens = olddens; if ((sc->sc_dsreg & HTDS_MOL) == 0) { uprintf("tu%d: not online\n", tuunit); u.u_error = EIO; return; } if ((flag&FWRITE) && (sc->sc_dsreg&HTDS_WRL)) { uprintf("tu%d: no write ring\n", tuunit); u.u_error = EIO; return; } if ((sc->sc_dsreg & HTDS_BOT) == 0 && (flag&FWRITE) && dens != sc->sc_dens) { uprintf("tu%d: can't change density in mid-tape\n", tuunit); u.u_error = EIO; return; } sc-((>sc_openf = 1; sc->sc_blkno = (daddr_t)0; sc->sc_nxrec = INF; sc->sc_flags = 0; sc->sc_dens = dens; } htclose(dev, flag) register dev_t dev; register flag; { register struct tu_softc *sc = &tu_softc[TUUNIT(dev)]; if (flag == FWRITE || ((flag&FWRITE) && (sc->sc_flags&H_WRITTEN))) { htcommand(dev, HT_WEOF, 1); htcommand(dev, HT_WEOF, 1); htcommand(dev, HT_SREV, 1); } if ((minor(dev)&H_NOREWIND) == 0) htcommand(dev, HT_REW, 0); sc->sc_openf = 0; } htcommand(dev, com, count) dev_t dev; int com, count; { register struct buf *bp; bp = &chtbuf[HTUNIT(dev)]; (void) spl5(); while (bp->b_flags&B_BUSY) { if(bp->b_repcnt == 0 && (bp->b_flags&B_DONE)) break; bp->b_flags |= B_WANTED; sleep((caddr_t)bp, PRIBIO); } bp->b_flags = B_BUSY|B_READ; (void) spl0(); bp->b_dev = dev; bp->b_command = com; bp->b_repcnt = count; bp->b_blkno = 0; htstrategy(bp); if (count == 0) return; iowait(bp); if (bp->b_flags&B_WANTED) wakeup((caddr_t)bp); bp->b_flags &= B_ERROR; } htstrategy(bp) register struct buf *bp; { register struct mba_device *mi = htinfo[HTUNIT(bp->b_dev)]; register struct buf *dp; bp->av_forw = NULL; dp = &mi->mi_tab; (void) spl5(); if (dp->b_actf == NULL) dp->b_actf = bp; else dp->b_actl->av_forw = bp; dp->b_actl = bp; if (dp->b_active == 0) mbustart(mi); (void) spl0(); } htustart(mi) register struct mba_device *mi; { register struct htdevice *htaddr = (struct htdevice *)mi->mi_drv; register struct buf *bp = mi->mi_tab.b_actf; register struct tu_softc *sc = &tu_softc[TUUNIT(bp->b_dev)]; daddr_t blkno; htaddr->httc = sc->sc_dens; if (bp == &chtbuf[HTUNIT(bp->b_dev)] && bp->b_command == HT_SENSE) { htaddr->htcs1 = HT_SENSE|HT_GO; mbclrattn(mi); } sc->sc_dsreg = htaddr->htds; sc->sc_erreg = htaddr->hter; sc->sc_resid = htaddr->htfc; sc->sc_flags &= ~(H_WRITTEN|H_REWIND); if ((htaddr->htdt & HTDT_SPR) == 0 || (htaddr->htds & HTDS_MOL) == 0) if (sc->sc_openf > 0) sc->sc_openf = -1; if (sc->sc_openf < 0) { bp->b_flags |= B_ERROR; return (MBU_NEXT); } if (bp != &chtbuf[HTUNIT(bp->b_dev)]) { if (dbtofsb(bp->b_blkno) > sc->sc_nxrec) { bp->b_flags |= B_ERROR; bp->b_error = ENXIO; return (MBU_NEXT); } if (dbtofsb(bp->b_blkno) == sc->sc_nxrec && bp->b_flags&B_READ) { bp->b_resid = bp->b_bcount; clrbuf(bp); return (MBU_NEXT); } if ((bp->b_flags&B_READ)==0) sc->sc_nxrec = dbtofsb(bp->b_blkno) + 1; } else { if (bp->b_command == HT_SENSE) return (MBU_NEXT); if (bp->b_command == HT_REW) sc->sc_flags |= H_REWIND; else htaddr->htfc = -bp->b_bcount; htaddr->htcs1 = bp->b_command|HT_GO; return (MBU_STARTED); } if ((blkno = sc->sc_blkno) == dbtofsb(bp->b_blkno)) { htaddr->htfc = -bp->b_bcount; if ((bp->b_flags&B_READ) == 0) { if (mi->mi_tab.b_errcnt) { if ((sc->sc_flags & H_ERASED) == 0) { sc->sc_flags |= H_ERASED; htaddr->htcs1 = HT_ERASE | HT_GO; return (MBU_STARTED); } sc->sc_flags &= ~H_ERASED; } if (htaddr->htds & HTDS_EOT) { bp->b_resid = bp->b_bcount; return (MBU_NEXT); } } return (MBU_DODATA); } if (blkno < dbtofsb(bp->b_blkno)) { htaddr->htfc = blkno - dbtofsb(bp->b_blkno); htaddr->htcs1 = HT_SFORW|HT_GO; } else { htaddr->htfc = dbtofsb(bp->b_blkno) - blkno; htaddr->htcs1 = HT_SREV|HT_GO; } return (MBU_STARTED); } htdtint(mi, mbsr) register struct mba_device *mi; int mbsr; { register struct htdevice *htaddr = (struct htdevice *)mi->mi_drv; register struct buf *bp = mi->mi_tab.b_actf; register struct tu_softc *sc; int ds, er, mbs; sc = &tu_softc[TUUNIT(bp->b_dev)]; ds = sc->sc_dsreg = MASKREG(htaddr->htds); er = sc->sc_erreg = MASKREG(htaddr->hter); sc->sc_resid = MASKREG(htaddr->htfc); mbs = mbsr; sc->sc_blkno++; if((bp->b_flags & B_READ) == 0) sc->sc_flags |= H_WRITTEN; if ((ds&(HTDS_ERR|HTDS_MOL)) != HTDS_MOL || mbs & MBSR_EBITS) { htaddr->htcs1 = HT_DCLR|HT_GO; mbclrattn(mi); if (bp == &rhtbuf[HTUNIT(bp->b_dev)]) { er &= ~HTER_FCE; mbs &= ~(MBSR_DTABT|MBSR_MBEXC); } if (bp->b_flags & B_READ && ds & HTDS_PES) er &= ~(HTER_CSITM|HTER_CORCRC); if (er&HTER_HARD || mbs&MBSR_EBITS || (ds&HTDS_MOL) == 0 || er && ++mi->mi_tab.b_errcnt >= 7) { if ((ds & HTDS_MOL) == 0 && sc->sc_openf > 0) sc->sc_openf = -1; if ((er&HTER_HARD) == HTER_FCE && (mbs&MBSR_EBITS) == (MBSR_DTABT|MBSR_MBEXC) && (ds&HTDS_MOL)) goto noprint; printf("tu%d: hard error bn%d mbsr=%b er=%b ds=%b\n", TUUNIT(bp->b_dev), bp->b_blkno, mbsr, mbsr_bits, sc->sc_erreg, hter_bits, sc->sc_dsreg, htds_bits); noprint: bp->b_flags |= B_ERROR; return (MBD_DONE); } if (er) return (MBD_RETRY); } bp->b_resid = 0; if (bp->b_flags & B_READ) if (ds&HTDS_TM) { /* must be a read, right? */ bp->b_resid = bp->b_bcount; sc->sc_nxrec = dbtofsb(bp->b_blkno); } else if(bp->b_bcount > MASKREG(htaddr->htfc)) bp->b_resid = bp->b_bcount - MASKREG(htaddr->htfc); return (MBD_DONE); } htndtint(mi) register struct mba_device *mi; { register struct htdevice *htaddr = (struct htdevice *)mi->mi_drv; register struct buf *bp = mi->mi_tab.b_actf; register struct tu_softc *sc; int er, ds, fc; ds = MASKREG(htaddr->htds); er = MASKREG(htaddr->hter); fc = MASKREG(htaddr->htfc); if (er) { htaddr->htcs1 = HT_DCLR|HT_GO; mbclrattn(mi); } if (bp == 0) return (MBN_SKIP); sc = &tu_softc[TUUNIT(bp->b_dev)]; sc->sc_dsreg = ds; sc->sc_erreg = er; sc->sc_resid = fc; if (bp == &chtbuf[HTUNIT(bp->b_dev)]) { switch (bp->b_command) { case HT_REWOFFL: /* offline is on purpose; don't do anything special */ ds |= HTDS_MOL; break; case HT_SREV: /* if backspace file hit bot, its not an error */ if (er == (HTER_NEF|HTER_FCE) && ds&HTDS_BOT && bp->b_repcnt == INF) er &= ~HTER_NEF; break; } er &= ~HTER_FCE; if (er == 0) ds &= ~HTDS_ERR; } if ((ds & (HTDS_ERR|HTDS_MOL)) != HTDS_MOL) { if ((ds & HTDS_MOL) == 0 && sc->sc_openf > 0) sc->sc_openf = -1; printf("tu%d: hard error bn%d er=%b ds=%b\n", TUUNIT(bp->b_dev), bp->b_blkno, sc->sc_erreg, hter_bits, sc->sc_dsreg, htds_bits); bp->b_flags |= B_ERROR; return (MBN_DONE); } if (bp == &chtbuf[HTUNIT(bp->b_dev)]) { if (sc->sc_flags & H_REWIND) return (ds & HTDS_BOT ? MBN_DONE : MBN_RETRY); bp->b_resid = -sc->sc_resid; return (MBN_DONE); } if (ds & HTDS_TM) if (sc->sc_blkno > dbtofsb(bp->b_blkno)) { sc->sc_nxrec = dbtofsb(bp->b_blkno) - fc; sc->sc_blkno = sc->sc_nxrec; } else { sc->sc_blkno = dbtofsb(bp->b_blkno) + fc; sc->sc_nxrec = sc->sc_blkno - 1; } else sc->sc_blkno = dbtofsb(bp->b_blkno); return (MBN_RETRY); } htread(dev) dev_t dev; { htphys(dev); if (u.u_error) return; physio(htstrategy, &rhtbuf[HTUNIT(dev)], dev, B_READ, minphys); } htwrite(dev) { htphys(dev); if (u.u_error) return; physio(htstrategy, &rhtbuf[HTUNIT(dev)], dev, B_WRITE, minphys); } htphys(dev) dev_t dev; { register int htunit; register struct tu_softc *sc; register struct mba_device *mi; daddr_t a; htunit = HTUNIT(dev); if (htunit >= NHT || (mi = htinfo[htunit]) == 0 || mi->mi_alive == 0) { u.u_error = ENXIO; return; } a = u.u_offset >> 9; sc = &tu_softc[TUUNIT(dev)]; sc->sc_blkno = dbtofsb(a); sc->sc_nxrec = dbtofsb(a)+1; } /*ARGSUSED*/ htioctl(dev, cmd, addr, flag) dev_t dev; int cmd; caddr_t addr; int flag; { register struct tu_softc *sc = &tu_softc[TUUNIT(dev)]; register struct buf *bp = &chtbuf[HTUNIT(dev)]; register callcount; int fcount; struct mtop mtop; struct mtget mtget; /* we depend of the values and order of the MT codes here */ static htops[] = {HT_WEOF,HT_SFORW,HT_SREV,HT_SFORW,HT_SREV,HT_REW,HT_REWOFFL,HT_SENSE}; switch (cmd) { case MTIOCTOP: /* tape operation */ if (copyin((caddr_t)addr, (caddr_t)&mtop, sizeof(mtop))) { u.u_error = EFAULT; return; } switch(mtop.mt_op) { case MTWEOF: callcount = mtop.mt_count; fcount = 1; break; case MTFSF: case MTBSF: callcount = mtop.mt_count; fcount = INF; break; case MTFSR: case MTBSR: callcount = 1; fcount = mtop.mt_count; break; case MTREW: case MTOFFL: callcount = 1; fcount = 1; break; default: u.u_error = ENXIO; return; } if (callcount <= 0 || fcount <= 0) { u.u_error = ENXIO; return; } while (--callcount >= 0) { htcommand(dev, htops[mtop.mt_op], fcount); if ((mtop.mt_op == MTFSR || mtop.mt_op == MTBSR) && bp->b_resid) { u.u_error = EIO; break; } if ((bp->b_flags&B_ERROR) || sc->sc_dsreg&HTDS_BOT) break; } geterror(bp); return; case MTIOCGET: mtget.mt_dsreg = sc->sc_dsreg; mtget.mt_erreg = sc->sc_erreg; mtget.mt_resid = sc->sc_resid; mtget.mt_type = MT_ISHT; if (copyout((caddr_t)&mtget, addr, sizeof(mtget))) u.u_error = EFAULT; return; default: u.u_error = ENXIO; } } #define DBSIZE 20 htdump() { register struct mba_device *mi; register struct mba_regs *mp; register struct htdevice *htaddr; int blk, num; int start; start = 0; num = maxfree; #define phys(a,b) ((b)((int)(a)&0x7fffffff)) if (htinfo[0] == 0) return (ENXIO); mi = phys(htinfo[0], struct mba_device *); mp = phys(mi->mi_hd, struct mba_hd *)->mh_physmba; mp->mba_cr = MBCR_IE; htaddr = (struct htdevice *)&mp->mba_drv[mi->mi_drive]; htaddr->httc = HTTC_PDP11|HTTC_1600BPI; htaddr->htcs1 = HT_DCLR|HT_GO; while (num > 0) { blk = num > DBSIZE ? DBSIZE : num; htdwrite(start, blk, htaddr, mp); start += blk; num -= blk; } hteof(htaddr); hteof(htaddr); htwait(htaddr); if (htaddr->htds&HTDS_ERR) return (EIO); htaddr->htcs1 = HT_REW|HT_GO; return (0); } htdwrite(dbuf, num, htaddr, mp) register dbuf, num; register struct htdevice *htaddr; struct mba_regs *mp; { register struct pte *io; register int i; htwait(htaddr); io = mp->mba_map; for (i = 0; i < num; i++) *(int *)io++ = dbuf++ | PG_V; htaddr->htfc = -(num*NBPG); mp->mba_sr = -1; mp->mba_bcr = -(num*NBPG); mp->mba_var = 0; htaddr->htcs1 = HT_WCOM|HT_GO; } htwait(htaddr) struct htdevice *htaddr; { register s; do s = htaddr->htds; while ((s & HTDS_DRY) == 0); } h((teof(htaddr) struct htdevice *htaddr; { htwait(htaddr); htaddr->htcs1 = HT_WEOF|HT_GO; } #endif addr; struct mba_regs *mp; { register struct pte *io; register int i; htwait(htaddr); io = mp->mba_map; for (i = 0; i < num; i++) *(int *)io++ = dbuf++ | PG_V; htaddr->htfc = -(num*NBPG); mp->mba_sr = -1; mp->mba_bcr = -(num*NBPG); mp->mba_var = 0; htaddr->htcs1 = HT_WCOM|HT_GO; } htwait(htaddr) struct htdevice *htaddr; { register s; do s = htaddr->htds; while ((s & HTDS_DRY) == 0); } hsys/dev/ts.c 444 0 33 51450 2636770406 6256 /* ts.c 4.22 81/12/14 */ #include "ts.h" #if NTS > 0 /* * TS11 tape driver * * TODO: * write dump code */ #include "../h/param.h" #include "../h/systm.h" #include "../h/buf.h" #include "../h/dir.h" #include "../h/conf.h" #include "../h/user.h" #include "../h/file.h" #include "../h/map.h" #include "../h/pte.h" #include "../h/vm.h" #include "../h/ubareg.h" #include "../h/ubavar.h" #include "../h/mtio.h" #include "../h/ioctl.h" #include "../h/cmap.h" #include "../h/cpu.h" #include "../h/tsreg.h" /* * There is a ctsbuf per tape controller. * It is used as the token to pass to the internal routines * to execute tape ioctls. * In particular, when the tape is rewinding on close we release * the user process but any further attempts to use the tape drive * before the rewind completes will hang waiting for ctsbuf. */ struct buf ctsbuf[NTS]; /* * Raw tape operations use rtsbuf. The driver * notices when rtsbuf is being used and allows the user * program to continue after errors and read records * not of the standard length (BSIZE). */ struct buf rtsbuf[NTS]; /* * Driver unibus interface routines and variables. */ int tsprobe(), tsslave(), tsattach(), tsdgo(), tsintr(); struct uba_ctlr *tsminfo[NTS]; struct uba_device *tsdinfo[NTS]; struct buf tsutab[NTS]; u_short tsstd[] = { 0772520, 0 }; /*** PROBABLY DON'T NEED ALL THESE SINCE CONTROLLER == DRIVE ***/ struct uba_driver zsdriver = { tsprobe, tsslave, tsattach, tsdgo, tsstd, "ts", tsdinfo, "zs", tsminfo, 0 }; /* bits in minor device */ #define TSUNIT(dev) (minor(dev)&03) #define T_NOREWIND 04 #define INF (daddr_t)1000000L /* * Software state per tape transport. * Also contains hardware state in message packets. * * 1. A tape drive is a unique-open device; we refuse opens when it is already. * 2. We keep track of the current position on a block tape and seek * before operations by forward/back spacing if necessary. * 3. We remember if the last operation was a write on a tape, so if a tape * is open read write and the last thing done is a write we can * write a standard end of tape mark (two eofs). * 4. We remember the status registers after the last command, using * then internally and returning them to the SENSE ioctl. */ struct ts_softc { char sc_openf; /* lock against multiple opens */ char sc_lastiow; /* last op was a write */ short sc_resid; /* copy of last bc */ daddr_t sc_blkno; /* block number, for block device tape */ daddr_t sc_nxrec; /* position of end of tape, if known */ struct ts_cmd sc_cmd; /* the command packet */ struct ts_sts sc_sts; /* status packet, for returned status */ struct ts_char sc_char; /* characteristics packet */ struct ts_softc *sc_ubaddr; /* Unibus address of ts_softc structure */ u_short sc_uba; /* Unibus addr of cmd pkt for tsdb */ short sc_mapped; /* is ts_sfotc mapped in Unibus space? */ } ts_softc[NTS]; /* * States for um->um_tab.b_active, the per controller state flag. * This is used to sequence control in the driver. */ #define SSEEK 1 /* seeking */ #define SIO 2 /* doing seq i/o */ #define SCOM 3 /* sending control command */ #define SREW 4 /* sending a drive rewind */ /* * Determine if there is a controller for * a ts at address reg. Our goal is to make the * device interrupt. */ /*ARGSUSED*/ tsprobe(reg) caddr_t reg; { register int br, cvec; /* must be r11,r10; value-result */ #ifdef lint br = 0; cvec = br; br = cvec; #endif ((struct tsdevice *)reg)->tssr = 0; DELAY(100); if ((((struct tsdevice *)reg)->tssr & TS_NBA) == 0) return(0); /* IT'S TOO HARD TO MAKE THIS THING INTERRUPT JUST TO FIND ITS VECTOR */ cvec = ((unsigned)reg) & 07 ? 0260 : 0224; br = 0x15; return (1); } /* * TS11 only supports one drive per controller; * check for ui_slave == 0. * * DO WE REALLY NEED THIS ROUTINE??? */ /*ARGSUSED*/ tsslave(ui, reg) struct uba_device *ui; caddr_t reg; { if (ui->ui_slave) /* non-zero slave not allowed */ return(0); return (1); } /* * Record attachment of the unit to the controller. * * SHOULD THIS ROUTINE DO ANYTHING??? */ /*ARGSUSED*/ tsattach(ui) struct uba_device *ui; { } /* * Open the device. Tapes are unique open * devices, so we refuse if it is already open. * We also check that a tape is available, and * don't block waiting here; if you want to wait * for a tape you should timeout in user code. */ tsopen(dev, flag) dev_t dev; int flag; { register int tsunit; register struct uba_device *ui; register struct ts_softc *sc; tsunit = TSUNIT(dev); if (tsunit>=NTS || (sc = &ts_softc[tsunit])->sc_openf || (ui = tsdinfo[tsunit]) == 0 || ui->ui_alive == 0) { u.u_error = ENXIO; return; } if (tsinit(tsunit)) { u.u_error = ENXIO; return; } tscommand(dev, TS_SENSE, 1); if ((sc->sc_sts.s_xs0&TS_ONL) == 0) { uprintf("ts%d: not online\n", tsunit); u.u_error = EIO; return; } if ((flag&(FREAD|FWRITE)) == FWRITE && (sc->sc_sts.s_xs0&TS_WLK)) { uprintf("ts%d: no write ring\n", tsunit); u.u_error = EIO; return; } sc->sc_openf = 1; sc->sc_blkno = (daddr_t)0; sc->sc_nxrec = INF; sc->sc_lastiow = 0; } /* * Close tape device. * * If tape was open for writing or last operation was * a write, then write two EOF's and backspace over the last one. * Unless this is a non-rewinding special file, rewind the tape. * Make the tape available to others. */ tsclose(dev, flag) register dev_t dev; register flag; { register struct ts_softc *sc = &ts_softc[TSUNIT(dev)]; if (flag == FWRITE || (flag&FWRITE) && sc->sc_lastiow) { tscommand(dev, TS_WEOF, 1); tscommand(dev, TS_WEOF, 1); tscommand(dev, TS_SREV, 1); } if ((minor(dev)&T_NOREWIND) == 0) /* * 0 count means don't hang waiting for rewind complete * rather ctsbuf stays busy until the operation completes * preventing further opens from completing by * preventing a TS_SENSE from completing. */ tscommand(dev, TS_REW, 0); sc->sc_openf = 0; } /* * Initialize the TS11. Set up Unibus mapping for command * packets and set device characteristics. */ tsinit(unit) register int unit; { register struct ts_softc *sc = &ts_softc[unit]; register struct uba_ctlr *um = tsminfo[unit]; register struct tsdevice *addr = (struct tsdevice *)um->um_addr; register int i; /* * Map the command and message packets into Unibus * address space. We do all the command and message * packets at once to minimize the amount of Unibus * mapping necessary. */ if (sc->sc_mapped == 0) { ctsbuf[unit].b_un.b_addr = (caddr_t)sc; ctsbuf[unit].b_bcount = sizeof(*sc); i = ubasetup(um->um_ubanum, &ctsbuf[unit], 0); i &= 0777777; sc->sc_ubaddr = (struct ts_softc *)i; sc->sc_mapped++; } /* * Now initialize the TS11 controller. * Set the characteristics. */ if (addr->tssr & (TS_NBA|TS_OFL)) { addr->tssr = 0; /* subsystem initialize */ tswait(addr); i = (int)&sc->sc_ubaddr->sc_cmd; /* Unibus addr of cmd */ sc->sc_uba = (u_short)(i + ((i>>16)&3)); sc->sc_char.char_addr = (int)&sc->sc_ubaddr->sc_sts; sc->sc_char.char_size = sizeof(struct ts_sts); sc->sc_char.char_mode = TS_ESS; sc->sc_cmd.c_cmd = TS_ACK | TS_SETCHR; i = (int)&sc->sc_ubaddr->sc_char; sc->sc_cmd.c_loba = i; sc->sc_cmd.c_hiba = (i>>16)&3; sc->sc_cmd.c_size = sizeof(struct ts_char); addr->tsdb = sc->sc_uba; tswait(addr); if (addr->tssr & TS_NBA) return(1); } return(0); } /* * Execute a command on the tape drive * a specified number of times. */ tscommand(dev, com, count) dev_t dev; int com, count; { register struct buf *bp; bp = &ctsbuf[TSUNIT(dev)]; (void) spl5(); while (bp->b_flags&B_BUSY) { /* * This special check is because B_BUSY never * gets cleared in the non-waiting rewind case. */ if (bp->b_repcnt == 0 && (bp->b_flags&B_DONE)) break; bp->b_flags |= B_WANTED; sleep((caddr_t)bp, PRIBIO); } bp->b_flags = B_BUSY|B_READ; (void) spl0(); bp->b_dev = dev; bp->b_repcnt = count; bp->b_command = com; bp->b_blkno = 0; tsstrategy(bp); /* * In case of rewind from close, don't wait. * This is the only case where count can be 0. */ if (count == 0) return; iowait(bp); if (bp->b_flags&B_WANTED) wakeup((caddr_t)bp); bp->b_flags &= B_ERROR; } /* * Queue a tape operation. */ tsstrategy(bp) register struct buf *bp; { int tsunit = TSUNIT(bp->b_dev); register struct uba_ctlr *um; register struct buf *dp; /* * Put transfer at end of controller queue */ bp->av_forw = NULL; um = tsdinfo[tsunit]->ui_mi; dp = &tsutab[tsunit]; (void) spl5(); if (dp->b_actf == NULL) dp->b_actf = bp; else dp->b_actl->av_forw = bp; dp->b_actl = bp; um->um_tab.b_actf = um->um_tab.b_actl = dp; /* * If the controller is not busy, get * it going. */ if (um->um_tab.b_active == 0) tsstart(um); (void) spl0(); } /* * Start activity on a ts controller. */ tsstart(um) register struct uba_ctlr *um; { register struct buf *bp; register struct tsdevice *addr = (struct tsdevice *)um->um_addr; register struct ts_softc *sc; register struct ts_cmd *tc; register struct uba_device *ui; int tsunit, cmd; daddr_t blkno; /* * Start the controller if there is something for it to do. */ loop: if ((bp = um->um((_tab.b_actf->b_actf) == NULL) return; tsunit = TSUNIT(bp->b_dev); ui = tsdinfo[tsunit]; sc = &ts_softc[tsunit]; tc = &sc->sc_cmd; /* * Default is that last command was NOT a write command; * if we do a write command we will notice this in tsintr(). */ sc->sc_lastiow = 0; if (sc->sc_openf < 0 || (addr->tssr&TS_OFL)) { /* * Have had a hard error on a non-raw tape * or the tape unit is now unavailable * (e.g. taken off line). */ bp->b_flags |= B_ERROR; goto next; } if (bp == &ctsbuf[TSUNIT(bp->b_dev)]) { /* * Execute control operation with the specified count. */ um->um_tab.b_active = bp->b_command == TS_REW ? SREW : SCOM; tc->c_repcnt = bp->b_repcnt; goto dobpcmd; } /* * The following checks handle boundary cases for operation * on non-raw tapes. On raw tapes the initialization of * sc->sc_nxrec by tsphys causes them to be skipped normally * (except in the case of retries). */ if (dbtofsb(bp->b_blkno) > sc->sc_nxrec) { /* * Can't read past known end-of-file. */ bp->b_flags |= B_ERROR; bp->b_error = ENXIO; goto next; } if (dbtofsb(bp->b_blkno) == sc->sc_nxrec && bp->b_flags&B_READ) { /* * Reading at end of file returns 0 bytes. */ bp->b_resid = bp->b_bcount; clrbuf(bp); goto next; } if ((bp->b_flags&B_READ) == 0) /* * Writing sets EOF */ sc->sc_nxrec = dbtofsb(bp->b_blkno) + 1; /* * If the data transfer command is in the correct place, * set up all the registers except the csr, and give * control over to the UNIBUS adapter routines, to * wait for resources to start the i/o. */ if ((blkno = sc->sc_blkno) == dbtofsb(bp->b_blkno)) { tc->c_size = bp->b_bcount; if ((bp->b_flags&B_READ) == 0) cmd = TS_WCOM; else cmd = TS_RCOM; if (um->um_tab.b_errcnt) cmd |= TS_RETRY; um->um_tab.b_active = SIO; tc->c_cmd = TS_ACK | TS_CVC | TS_IE | cmd; (void) ubago(ui); return; } /* * Tape positioned incorrectly; * set to seek forwards or backwards to the correct spot. * This happens for raw tapes only on error retries. */ um->um_tab.b_active = SSEEK; if (blkno < dbtofsb(bp->b_blkno)) { bp->b_command = TS_SFORW; tc->c_repcnt = dbtofsb(bp->b_blkno) - blkno; } else { bp->b_command = TS_SREV; tc->c_repcnt = blkno - dbtofsb(bp->b_blkno); } dobpcmd: /* * Do the command in bp. */ tc->c_cmd = TS_ACK | TS_CVC | TS_IE | bp->b_command; addr->tsdb = sc->sc_uba; return; next: /* * Done with this operation due to error or * the fact that it doesn't do anything. * Release UBA resources (if any), dequeue * the transfer and continue processing this slave. */ if (um->um_ubinfo) ubadone(um); um->um_tab.b_errcnt = 0; um->um_tab.b_actf->b_actf = bp->av_forw; iodone(bp); goto loop; } /* * The UNIBUS resources we needed have been * allocated to us; start the device. */ tsdgo(um) register struct uba_ctlr *um; { register struct tsdevice *addr = (struct tsdevice *)um->um_addr; register struct ts_softc *sc = &ts_softc[um->um_ctlr]; register int i; i = um->um_ubinfo & 0777777; sc->sc_cmd.c_loba = i; sc->sc_cmd.c_hiba = (i>>16)&3; addr->tsdb = sc->sc_uba; } /* * Ts interrupt routine. */ /*ARGSUSED*/ tsintr(ts11) int ts11; { register struct buf *bp; register struct uba_ctlr *um = tsminfo[ts11]; register struct tsdevice *addr; register struct ts_softc *sc; int tsunit; register state; if ((bp = um->um_tab.b_actf->b_actf) == NULL) return; tsunit = TSUNIT(bp->b_dev); addr = (struct tsdevice *)tsdinfo[tsunit]->ui_addr; /* * If last command was a rewind, and tape is still * rewinding, wait for the rewind complete interrupt. * * SHOULD NEVER GET AN INTERRUPT IN THIS STATE. */ if (um->um_tab.b_active == SREW) { um->um_tab.b_active = SCOM; if ((addr->tssr&TS_SSR) == 0) return; } /* * An operation completed... record status */ sc = &ts_softc[tsunit]; if ((bp->b_flags & B_READ) == 0) sc->sc_lastiow = 1; state = um->um_tab.b_active; um->um_tab.b_active = 0; /* * Check for errors. */ if (addr->tssr&TS_SC) { switch (addr->tssr & TS_TC) { case TS_UNREC: /* unrecoverable */ case TS_FATAL: /* fatal error */ case TS_ATTN: /* attention (shouldn't happen) */ case TS_RECNM: /* recoverable, no motion */ break; case TS_SUCC: /* success termination */ printf("ts%d: success\n", TSUNIT(minor(bp->b_dev))); goto ignoreerr; case TS_ALERT: /* tape status alert */ /* * If we hit the end of the tape file, * update our position. */ if (sc->sc_sts.s_xs0 & (TS_TMK|TS_EOT)) { tsseteof(bp); /* set blkno and nxrec */ state = SCOM; /* force completion */ /* * Stuff bc so it will be unstuffed correctly * later to get resid. */ sc->sc_sts.s_rbpcr = bp->b_bcount; goto opdone; } /* * If we were reading raw tape and the record was too long * or too short, then we don't consider this an error. */ if (bp == &rtsbuf[TSUNIT(bp->b_dev)] && (bp->b_flags&B_READ) && sc->sc_sts.s_xs0&(TS_RLS|TS_RLL)) goto ignoreerr; case TS_RECOV: /* recoverable, tape moved */ /* * If this was an i/o operation retry up to 8 times. */ if (state==SIO) { if (++um->um_tab.b_errcnt < 7) { ubadone(um); goto opcont; } else sc->sc_blkno++; } else { /* * Non-i/o errors on non-raw tape * cause it to close. */ if (sc->sc_openf>0 && bp != &rtsbuf[TSUNIT(bp->b_dev)]) sc->sc_openf = -1; } break; case TS_REJECT: /* function reject */ if (state == SIO && sc->sc_sts.s_xs0 & TS_WLE) printf("ts%d: write locked\n", TSUNIT(bp->b_dev)); if ((sc->sc_sts.s_xs0 & TS_ONL) == 0) printf("ts%d: offline\n", TSUNIT(bp->b_dev)); break; } /* * Couldn't recover error */ printf("ts%d: hard error bn%d xs0=%b", TSUNIT(bp->b_dev), bp->b_blkno, sc->sc_sts.s_xs0, TSXS0_BITS); if (sc->sc_sts.s_xs1) printf(" xs1=%b", sc->sc_sts.s_xs1, TSXS1_BITS); if (sc->sc_sts.s_xs2) printf(" xs2=%b", sc->sc_sts.s_xs2, TSXS2_BITS); if (sc->sc_sts.s_xs3) printf(" xs3=%b", sc->sc_sts.s_xs3, TSXS3_BITS); printf("\n"); bp->b_flags |= B_ERROR; goto opdone; } /* * Advance tape control FSM. */ ignoreerr: switch (state) { case SIO: /* * Read/write increments tape block number */ sc->sc_blkno++; goto opdone; case SCOM: /* * For forward/backward space record update current position. */ if (bp == &ctsbuf[TSUNIT(bp->b_dev)]) switch (bp->b_command) { case TS_SFORW: sc->sc_blkno += bp->b_repcnt; break; case TS_SREV: sc->sc_blkno -= bp->b_repcnt; break; } goto opdone; case SSEEK: sc->sc_blkno = dbtofsb(bp->b_blkno); goto opcont; default: panic("tsintr"); } opdone: /* * Reset error count and remove * from device queue. */ um->um_tab.b_errcnt = 0; um->um_tab.b_actf->b_actf = bp->av_forw; bp->b_resid = sc->sc_sts.s_rbpcr; ubadone(um); iodone(bp); if (um->um_tab.b_actf->b_actf == 0) return; opcont: tsstart(um); } tsseteof(bp) register struct buf *bp; { register int tsunit = TSUNIT(bp->b_dev); register struct ts_softc *sc = &ts_softc[tsunit]; if (bp == &ctsbuf[TSUNIT(bp->b_dev)]) { if (sc->sc_blkno > dbtofsb(bp->b_blkno)) { /* reversing */ sc->sc_nxrec = dbtofsb(bp->b_blkno) - sc->sc_sts.s_rbpcr; sc->sc_blkno = sc->sc_nxrec; } else { /* spacing forward */ sc->sc_blkno = dbtofsb(bp->b_blkno) + sc->sc_sts.s_rbpcr; sc->sc_nxrec = sc->sc_blkno - 1; } return; } /* eof on read */ sc->sc_nxrec = dbtofsb(bp->b_blkno); } tsread(dev) dev_t dev; { tsphys(dev); if (u.u_error) return; physio(tsstrategy, &rtsbuf[TSUNIT(dev)], dev, B_READ, minphys); } tswrite(dev) dev_t dev; { tsphys(dev); if (u.u_error) return; physio(tsstrategy, &rtsbuf[TSUNIT(dev)], dev, B_WRITE, minphys); } /* * Check that a raw device exists. * If it does, set up sc_blkno and sc_nxrec * so that the tape will appear positioned correctly. */ tsphys(dev) dev_t dev; { register int tsunit = TSUNIT(dev); register daddr_t a; register struct ts_softc *sc; register struct uba_device *ui; if (tsunit >= NTS || (ui=tsdinfo[tsunit]) == 0 || ui->ui_alive == 0) { u.u_error = ENXIO; return; } sc = &ts_softc[tsunit]; a = dbtofsb(u.u_offset >> 9); sc->sc_blkno = a; sc->sc_nxrec = a + 1; } tsreset(uban) int uban; { register struct uba_ctlr *um; register struct uba_device *ui; register struct buf *dp; register ts11; for (ts11 = 0; ts11 < NTS; ts11++) { if ((um = tsminfo[ts11]) == 0 || um->um_alive == 0 || um->um_ubanum != uban) continue; printf(" ts%d", ts11); um->um_tab.b_active = 0; um->um_tab.b_actf = um->um_tab.b_actl = 0; if (ts_softc[ts11].sc_openf > 0) ts_softc[ts11].sc_openf = -1; if (um->um_ubinfo) { printf("<%d>", (um->um_ubinfo>>28)&0xf); ubadone(um); } if ((ui = tsdinfo[ts11]) && ui->ui_mi == um && ui->ui_alive) { dp = &tsutab[ts11]; dp->b_active = 0; dp->b_forw = 0; if (um->um_tab.b_actf == NULL) um->um_tab.b_actf = dp; else um->um_tab.b_actl->b_forw = dp; um->um_tab.b_actl = dp; } (void) tsinit(ts11); tsstart(um); } } /*ARGSUSED*/ tsioctl(dev, cmd, addr, flag) caddr_t addr; dev_t dev; { int tsunit = TSUNIT(dev); register struct ts_softc *sc = &ts_softc[tsunit]; register struct buf *bp = &ctsbuf[TSUNIT(dev)]; register callcount; int fcount; struct mtop mtop; struct mtget mtget; /* we depend of the values and order of the MT codes here */ static tsops[] = {TS_WEOF,TS_SFORWF,TS_SREVF,TS_SFORW,TS_SREV,TS_REW,TS_OFFL,TS_SENSE}; switch (cmd) { case MTIOCTOP: /* tape operation */ if (copyin((caddr_t)addr, (caddr_t)&mtop, sizeof(mtop))) { u.u_error = EFAULT; return; } switch(mtop.mt_op) { case MTWEOF: callcount = mtop.mt_count; fcount = 1; break; case MTFSF: case MTBSF: case MTFSR: case MTBSR: callcount = 1; fcount = mtop.mt_count; break; case MTREW: case MTOFFL: case MTNOP: callcount = 1; fcount = 1; break; default: u.u_error = ENXIO; return; } if (callcount <= 0 || fcount <= 0) { u.u_error = ENXIO; return; } while (--callcount >= 0) { tscommand(dev, tsops[mtop.mt_op], f((count); if ((mtop.mt_op == MTFSR || mtop.mt_op == MTBSR) && bp->b_resid) { u.u_error = EIO; break; } if ((bp->b_flags&B_ERROR) || sc->sc_sts.s_xs0&TS_BOT) break; } geterror(bp); return; case MTIOCGET: mtget.mt_dsreg = 0; mtget.mt_erreg = sc->sc_sts.s_xs0; mtget.mt_resid = sc->sc_resid; mtget.mt_type = MT_ISTS; if (copyout((caddr_t)&mtget, addr, sizeof(mtget))) u.u_error = EFAULT; return; default: u.u_error = ENXIO; } } #define DBSIZE 20 tsdump() { register struct uba_device *ui; register struct uba_regs *up; register struct tsdevice *addr; int blk, num; int start; start = 0; num = maxfree; #define phys(a,b) ((b)((int)(a)&0x7fffffff)) if (tsdinfo[0] == 0) return (ENXIO); ui = phys(tsdinfo[0], struct uba_device *); up = phys(ui->ui_hd, struct uba_hd *)->uh_physuba; ubainit(up); DELAY(1000000); addr = (struct tsdevice *)ui->ui_physaddr; addr->tssr = 0; tswait(addr); while (num > 0) { blk = num > DBSIZE ? DBSIZE : num; tsdwrite(start, blk, addr, up); start += blk; num -= blk; } tseof(addr); tseof(addr); tswait(addr); if (addr->tssr&TS_SC) return (EIO); addr->tssr = 0; tswait(addr); return (0); } tsdwrite(dbuf, num, addr, up) register dbuf, num; register struct tsdevice *addr; struct uba_regs *up; { register struct pte *io; register int npf; tswait(addr); io = up->uba_map; npf = num+1; while (--npf != 0) *(int *)io++ = (dbuf++ | (1<tsbc = -(num*NBPG); addr->tsba = 0; addr->tscs = TS_WCOM | TM_GO; #endif } tswait(addr) register struct tsdevice *addr; { register s; do s = addr->tssr; while ((s & TS_SSR) == 0); } tseof(addr) struct tsdevice *addr; { tswait(addr); #ifdef notyet addr->tscs = TS_WEOF | TM_GO; #endif } #endif struct pte *io; register int npf; tswait(addr); io = up->uba_map; npf = num+1; while (--npf != 0) *(int *)io++ = (dbuf++ | (1<tsbc = -(numsys/dev/uba.c 444 0 33 27025 2624051622 6365 /* uba.c 4.36 81/10/27 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/cpu.h" #include "../h/map.h" #include "../h/pte.h" #include "../h/buf.h" #include "../h/vm.h" #include "../h/ubareg.h" #include "../h/ubavar.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/conf.h" #include "../h/mtpr.h" #include "../h/nexus.h" #include "../h/dk.h" #if VAX780 char ubasr_bits[] = UBASR_BITS; #endif /* * Do transfer on device argument. The controller * and uba involved are implied by the device. * We queue for resource wait in the uba code if necessary. * We return 1 if the transfer was started, 0 if it was not. * If you call this routine with the head of the queue for a * UBA, it will automatically remove the device from the UBA * queue before it returns. If some other device is given * as argument, it will be added to the request queue if the * request cannot be started immediately. This means that * passing a device which is on the queue but not at the head * of the request queue is likely to be a disaster. */ ubago(ui) register struct uba_device *ui; { register struct uba_ctlr *um = ui->ui_mi; register struct uba_hd *uh; register int s, unit; uh = &uba_hd[um->um_ubanum]; s = spl6(); if (um->um_driver->ud_xclu && uh->uh_users > 0 || uh->uh_xclu) goto rwait; um->um_ubinfo = ubasetup(um->um_ubanum, um->um_tab.b_actf->b_actf, UBA_NEEDBDP|UBA_CANTWAIT); if (um->um_ubinfo == 0) goto rwait; uh->uh_users++; if (um->um_driver->ud_xclu) uh->uh_xclu = 1; splx(s); if (ui->ui_dk >= 0) { unit = ui->ui_dk; dk_busy |= 1<uh_actf == ui) uh->uh_actf = ui->ui_forw; (*um->um_driver->ud_dgo)(um); if (ui->ui_dk >= 0) { dk_xfer[unit]++; dk_wds[unit] += um->um_tab.b_actf->b_actf->b_bcount>>6; } return (1); rwait: if (uh->uh_actf != ui) { ui->ui_forw = NULL; if (uh->uh_actf == NULL) uh->uh_actf = ui; else uh->uh_actl->ui_forw = ui; uh->uh_actl = ui; } splx(s); return (0); } ubadone(um) register struct uba_ctlr *um; { register struct uba_hd *uh = &uba_hd[um->um_ubanum]; if (um->um_driver->ud_xclu) uh->uh_xclu = 0; uh->uh_users--; ubarelse(um->um_ubanum, &um->um_ubinfo); } /* * Allocate and setup UBA map registers, and bdp's * Flags says whether bdp is needed, whether the caller can't * wait (e.g. if the caller is at interrupt level). * * Return value: * Bits 0-8 Byte offset * Bits 9-17 Start map reg. no. * Bits 18-27 No. mapping reg's * Bits 28-31 BDP no. */ ubasetup(uban, bp, flags) struct buf *bp; { register struct uba_hd *uh = &uba_hd[uban]; register int temp, i; int npf, reg, bdp; unsigned v; register struct pte *pte, *io; struct proc *rp; int a, o, ubinfo; #if VAX7ZZ if (cpu == VAX_7ZZ) flags &= ~UBA_NEEDBDP; #endif v = btop(bp->b_un.b_addr); o = (int)bp->b_un.b_addr & PGOFSET; npf = btoc(bp->b_bcount + o) + 1; a = spl6(); while ((reg = rmalloc(uh->uh_map, npf)) == 0) { if (flags & UBA_CANTWAIT) { splx(a); return (0); } uh->uh_mrwant++; sleep((caddr_t)uh->uh_map, PSWP); } bdp = 0; if (flags & UBA_NEEDBDP) { while ((bdp = ffs(uh->uh_bdpfree)) == 0) { if (flags & UBA_CANTWAIT) { rmfree(uh->uh_map, npf, reg); splx(a); return (0); } uh->uh_bdpwant++; sleep((caddr_t)uh->uh_map, PSWP); } uh->uh_bdpfree &= ~(1 << (bdp-1)); } else if (flags & UBA_HAVEBDP) bdp = (flags >> 28) & 0xf; splx(a); reg--; ubinfo = (bdp << 28) | (npf << 18) | (reg << 9) | o; io = &uh->uh_uba->uba_map[reg]; temp = (bdp << 21) | UBAMR_MRV; rp = bp->b_flags&B_DIRTY ? &proc[2] : bp->b_proc; if (bdp && (o & 01)) temp |= UBAMR_BO; if (bp->b_flags & B_UAREA) { for (i = UPAGES - bp->b_bcount / NBPG; i < UPAGES; i++) { if (rp->p_addr[i].pg_pfnum == 0) panic("uba: zero upage"); *(int *)io++ = rp->p_addr[i].pg_pfnum | temp; } } else if ((bp->b_flags & B_PHYS) == 0) { pte = &Sysmap[btop(((int)bp->b_un.b_addr)&0x7fffffff)]; while (--npf != 0) *(int *)io++ = pte++->pg_pfnum | temp; } else { if (bp->b_flags & B_PAGET) pte = &Usrptmap[btokmx((struct pte *)bp->b_un.b_addr)]; else pte = vtopte(rp, v); while (--npf != 0) { if (pte->pg_pfnum == 0) panic("uba zero uentry"); *(int *)io++ = pte++->pg_pfnum | temp; } } *(int *)io++ = 0; return (ubinfo); } /* * Non buffer setup interface... set up a buffer and call ubasetup. */ uballoc(uban, addr, bcnt, flags) int uban; caddr_t addr; int bcnt, flags; { struct buf ubabuf; ubabuf.b_un.b_addr = addr; ubabuf.b_flags = B_BUSY; ubabuf.b_bcount = bcnt; /* that's all the fields ubasetup() needs */ return (ubasetup(uban, &ubabuf, flags)); } /* * Release resources on uba uban, and then unblock resource waiters. * The map register parameter is by value since we need to block * against uba resets on 11/780's. */ ubarelse(uban, amr) int *amr; { register struct uba_hd *uh = &uba_hd[uban]; register int bdp, reg, npf, s; int mr; /* * Carefully see if we should release the space, since * it may be released asynchronously at uba reset time. */ s = spl6(); mr = *amr; if (mr == 0) { /* * A ubareset() occurred before we got around * to releasing the space... no need to bother. */ splx(s); return; } *amr = 0; splx(s); /* let interrupts in, we're safe for a while */ bdp = (mr >> 28) & 0x0f; if (bdp) { switch (cpu) { #if VAX780 case VAX_780: uh->uh_uba->uba_dpr[bdp] |= UBADPR_BNE; break; #endif #if VAX750 case VAX_750: uh->uh_uba->uba_dpr[bdp] |= UBADPR_PURGE|UBADPR_NXM|UBADPR_UCE; break; #endif } uh->uh_bdpfree |= 1 << (bdp-1); /* atomic */ if (uh->uh_bdpwant) { uh->uh_bdpwant = 0; wakeup((caddr_t)uh->uh_map); } } /* * Put back the registers in the resource map. * The map code must not be reentered, so we do this * at high ipl. */ npf = (mr >> 18) & 0x3ff; reg = ((mr >> 9) & 0x1ff) + 1; s = spl6(); rmfree(uh->uh_map, npf, reg); splx(s); /* * Wakeup sleepers for map registers, * and also, if there are processes blocked in dgo(), * give them a chance at the UNIBUS. */ if (uh->uh_mrwant) { uh->uh_mrwant = 0; wakeup((caddr_t)uh->uh_map); } while (uh->uh_actf && ubago(uh->uh_actf)) ; } ubapurge(um) register struct uba_ctlr *um; { register struct uba_hd *uh = um->um_hd; register int bdp = (um->um_ubinfo >> 28) & 0x0f; switch (cpu) { #if VAX780 case VAX_780: uh->uh_uba->uba_dpr[bdp] |= UBADPR_BNE; break; #endif #if VAX750 case VAX_750: uh->uh_uba->uba_dpr[bdp] |= UBADPR_PURGE|UBADPR_NXM|UBADPR_UCE; break; #endif } } /* * Generate a reset on uba number uban. Then * call each device in the character device table, * giving it a chance to clean up so as to be able to continue. */ ubareset(uban) int uban; { register struct cdevsw *cdp; register struct uba_hd *uh = &uba_hd[uban]; int s; s = spl6(); uh->uh_users = 0; uh->uh_zvcnt = 0; uh->uh_xclu = 0; uh->uh_hangcnt = 0; uh->uh_actf = uh->uh_actl = 0; uh->uh_bdpwant = 0; uh->uh_mrwant = 0; wakeup((caddr_t)&uh->uh_bdpwant); wakeup((caddr_t)&uh->uh_mrwant); printf("uba%d: reset", uban); ubainit(uh->uh_uba); for (cdp = cdevsw; cdp->d_open; cdp++) (*cdp->d_reset)(uban); printf("\n"); splx(s); } /* * Init a uba. This is called with a pointer * rather than a virtual address since it is called * by code which runs with memory mapping disabled. * In these cases we really don't need the interrupts * enabled, but since we run with ipl high, we don't care * if they are, they will never happen anyways. */ ubainit(uba) register struct uba_regs *uba; { switch (cpu) { #if VAX780 case VAX_780: uba->ub((a_cr = UBACR_ADINIT; uba->uba_cr = UBACR_IFS|UBACR_BRIE|UBACR_USEFIE|UBACR_SUEFIE; while ((uba->uba_cnfgr & UBACNFGR_UBIC) == 0) ; break; #endif #if VAX750 case VAX_750: #endif #if VAX7ZZ case VAX_7ZZ: #endif #if defined(VAX750) || defined(VAX7ZZ) mtpr(IUR, 0); /* give devices time to recover from power fail */ /* THIS IS PROBABLY UNNECESSARY */ DELAY(500000); /* END PROBABLY UNNECESSARY */ break; #endif } } #if VAX780 /* * Check to make sure the UNIBUS adaptor is not hung, * with an interrupt in the register to be presented, * but not presenting it for an extended period (5 seconds). */ unhang() { register int uban; for (uban = 0; uban < numuba; uban++) { register struct uba_hd *uh = &uba_hd[uban]; register struct uba_regs *up = uh->uh_uba; if (up->uba_sr == 0) return; up->uba_sr = UBASR_CRD|UBASR_LEB; uh->uh_hangcnt++; if (uh->uh_hangcnt > 5*hz) { uh->uh_hangcnt = 0; printf("uba%d: hung\n", uban); ubareset(uban); } } } /* * This is a timeout routine which decrements the ``i forgot to * interrupt'' counts, on an 11/780. This prevents slowly growing * counts from causing a UBA reset since we are interested only * in hang situations. */ ubawatch() { register struct uba_hd *uh; register int uban; if (panicstr) return; for (uban = 0; uban < numuba; uban++) { uh = &uba_hd[uban]; if (uh->uh_hangcnt) uh->uh_hangcnt--; } } int ubawedgecnt = 10; int ubacrazy = 500; /* * This routine is called by the locore code to * process a UBA error on an 11/780. The arguments are passed * on the stack, and value-result (through some trickery). * In particular, the uvec argument is used for further * uba processing so the result aspect of it is very important. * It must not be declared register. */ /*ARGSUSED*/ ubaerror(uban, uh, xx, uvec, uba) register int uban; register struct uba_hd *uh; int uvec; register struct uba_regs *uba; { register sr, s; if (uvec == 0) { uh->uh_zvcnt++; if (uh->uh_zvcnt > 250000) { printf("uba%d: too many zero vectors\n"); ubareset(uban); } uvec = 0; return; } if (uba->uba_cnfgr & NEX_CFGFLT) { printf("uba%d: sbi fault sr=%b cnfgr=%b\n", uban, uba->uba_sr, ubasr_bits, uba->uba_cnfgr, NEXFLT_BITS); ubareset(uban); uvec = 0; return; } sr = uba->uba_sr; s = spl7(); printf("uba%d: uba error sr=%b fmer=%x fubar=%o\n", uban, uba->uba_sr, ubasr_bits, uba->uba_fmer, 4*uba->uba_fubar); splx(s); uba->uba_sr = sr; uvec &= UBABRRVR_DIV; if (++uh->uh_errcnt % ubawedgecnt == 0) { if (uh->uh_errcnt > ubacrazy) panic("uba crazy"); printf("ERROR LIMIT "); ubareset(uban); uvec = 0; return; } return; } #endif /* * This routine allows remapping of previously * allocated UNIBUS bdp and map resources * onto different memory addresses. * It should only be used by routines which need * small fixed length mappings for long periods of time * (like the ARPANET ACC IMP interface). * It only maps kernel addresses. */ ubaremap(uban, ubinfo, addr) int uban; register unsigned ubinfo; caddr_t addr; { register struct uba_hd *uh = &uba_hd[uban]; register struct pte *pte, *io; register int temp, bdp; int npf, o; o = (int)addr & PGOFSET; bdp = (ubinfo >> 28) & 0xf; npf = (ubinfo >> 18) & 0x3ff; io = &uh->uh_uba->uba_map[(ubinfo >> 9) & 0x1ff]; temp = (bdp << 21) | UBAMR_MRV; /* * If using buffered data path initiate purge * of old data and set byte offset bit if next * transfer will be from odd address. */ if (bdp) { switch (cpu) { #if VAX780 case VAX_780: uh->uh_uba->uba_dpr[bdp] |= UBADPR_BNE; break; #endif #if VAX750 case VAX_750: uh->uh_uba->uba_dpr[bdp] |= UBADPR_PURGE|UBADPR_NXM|UBADPR_UCE; break; #endif } if (o & 1) temp |= UBAMR_BO; } /* * Set up the map registers, leaving an invalid reg * at the end to guard against wild unibus transfers. */ pte = &Sysmap[btop(((int)addr)&0x7fffffff)]; while (--npf != 0) *(int *)io++ = pte++->pg_pfnum | temp; *(int *)io = 0; /* * Return effective UNIBUS address. */ return (ubinfo | o); } pr[bdp] |= UBADPR_BNE; break; #endif #if VAX750 case VAX_750: uh->uh_uba->uba_dpr[bdp] |= UBADPR_PURGE|UBADPR_NXM|UBADPR_UCE; break; #endif } if (o & 1) temp |= UBAMR_BO; } /* * Set up the map registers, leaving an invalid reg * at the end to guard against wild unibus transfers. */ pte = &Sysmap[btop(((int)addr)&0x7fffffff)]; while (--npf != 0) *(int *)io++ = pte++->pg_pfnum | temp; *(int *)io = 0; /* * Return effective UNIBUS address. */ resys/dev/ttynew.c 444 0 33 44136 2624051601 7147 /* ttynew.c 4.13 81/07/22 */ /* * New version of tty driver, supported * as NTTYDISC. Adapted from a tty.c written * by J.E.Kulp of IIASA, Austria (jekulp@mc) */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/tty.h" #include "../h/proc.h" #include "../h/mx.h" #include "../h/inode.h" #include "../h/file.h" #include "../h/reg.h" #include "../h/conf.h" #include "../h/buf.h" #include "../h/dk.h" char partab[]; /* * Input mapping table-- if an entry is non-zero, when the * corresponding character is typed preceded by "\" the escape * sequence is replaced by the table value. Mostly used for * upper-case only terminals. */ char maptab[]; /* see tty.c */ /* * shorthand */ #define q1 tp->t_rawq #define q2 tp->t_canq #define q3 tp->t_outq #define q4 tp->t_un.t_ctlq #define OBUFSIZ 100 /* * routine called on opens while tp->t_line == NTTYDISC * establishes a process group for distribution of * quits and interrupts from the tty. * (actually, pp->p_pgrp can't be 0 when this routine * is called since NTTYDISC is not the default discipline) */ ntyopen(dev, tp) dev_t dev; register struct tty *tp; { register struct proc *pp; pp = u.u_procp; tp->t_dev = dev; if(pp->p_pgrp == 0) { u.u_ttyp = tp; u.u_ttyd = dev; if (tp->t_pgrp == 0) tp->t_pgrp = pp->p_pid; pp->p_pgrp = tp->t_pgrp; } tp->t_state &= ~WOPEN; tp->t_state |= ISOPEN; if (tp->t_line != NTTYDISC) wflushtty(tp); } /* * clean tp on last close */ ntyclose(tp) register struct tty *tp; { wflushtty(tp); /* let ttyclose do the work if we are really closing */ } /* * block transfer input handler. */ ntyrend(tp, pb, pe) register struct tty *tp; register char *pb, *pe; { int tandem; tandem = tp->t_flags&TANDEM; if (tp->t_flags&RAW) { (void) b_to_q(pb, pe-pb, &tp->t_rawq); if (tp->t_chan) (void) sdata(tp->t_chan); wakeup((caddr_t)&tp->t_rawq); } else { tp->t_flags &= ~TANDEM; while (pb < pe) ntyinput(*pb++, tp); tp->t_flags |= tandem; } if (tandem) ttyblock(tp); } /* * reinput pending characters after state switch * call at spl5(). */ ntypend(tp) register struct tty *tp; { struct clist tq; register c; tp->t_local &= ~LPENDIN; tp->t_lstate |= LSTYPEN; tq = tp->t_rawq; tp->t_rawq.c_cc = 0; tp->t_rawq.c_cf = tp->t_rawq.c_cl = 0; while ((c = getc(&tq)) >= 0) ntyinput(c, tp); tp->t_lstate &= ~LSTYPEN; } /* * Place a character on raw TTY input queue, putting in delimiters * and waking up top half as needed. * Also echo if required. * The arguments are the character and the appropriate * tty structure. */ ntyinput(c, tp) register c; register struct tty *tp; { register int t_flags; int i; if (tp->t_local&LPENDIN) ntypend(tp); tk_nin++; c &= 0377; t_flags = tp->t_flags; if (t_flags&TANDEM) ttyblock(tp); if ((t_flags&RAW)==0) { if ((tp->t_lstate&LSTYPEN) == 0) c &= 0177; /* check for literal nexting very first */ if (tp->t_lstate&LSLNCH) { c |= 0200; tp->t_lstate &= ~LSLNCH; } if (c==tlun.t_lnextc) { if (tp->t_flags&ECHO) ntyout("^\b", tp); tp->t_lstate |= LSLNCH; /* check for output control functions */ } else if (c==tun.t_stopc) { if ((tp->t_state&TTSTOP)==0) { tp->t_state |= TTSTOP; (*cdevsw[major(tp->t_dev)].d_stop)(tp); return; } if (c!=tun.t_startc) return; } else if (c==tun.t_startc) { tp->t_state &= ~TTSTOP; tp->t_local &= ~LFLUSHO; ttstart(tp); return; } else if (c==tlun.t_flushc) { if (tp->t_local & LFLUSHO) tp->t_local &= ~LFLUSHO; else { flushtty(tp, FWRITE); ntyecho(c, tp); if (tp->t_rawq.c_cc+tp->t_canq.c_cc) ntyretype(tp); tp->t_local |= LFLUSHO; } ttstart(tp); return; } else if (c==tlun.t_suspc || c==tun.t_intrc || c==tun.t_quitc) { if ((tp->t_local & LNOFLSH) == 0) flushtty(tp, c==tlun.t_suspc ? FREAD : FREAD|FWRITE); ntyecho(c, tp); c = c==tun.t_intrc ? SIGINT : ((c==tun.t_quitc) ? SIGQUIT : SIGTSTP); if (tp->t_chan) scontrol(tp->t_chan, M_SIG, c); gsignal(tp->t_pgrp, c); /* check for buffer editing functions - cooked mode */ } else if ((t_flags&CBREAK) == 0) { if ((tp->t_lstate&LSQUOT) && (c==tp->t_erase||c==tp->t_kill)) { ntyrub(unputc(&tp->t_rawq), tp); c |= 0200; } if (c==tp->t_erase) { if (tp->t_rawq.c_cc) ntyrub(unputc(&tp->t_rawq), tp); } else if (c==tp->t_kill) { if (tp->t_local&LCRTKIL && tp->t_rawq.c_cc == tp->t_rocount) { while (tp->t_rawq.c_cc) ntyrub(unputc(&tp->t_rawq), tp); } else { ntyecho(c, tp); ntyecho('\n', tp); while (getc(&tp->t_rawq) > 0) ; tp->t_rocount = 0; } tp->t_lstate = 0; } else if (c==tlun.t_werasc) { if (tp->t_rawq.c_cc == 0) goto out; do { c = unputc(&tp->t_rawq); if (c != ' ' && c != '\t') goto erasenb; ntyrub(c, tp); } while (tp->t_rawq.c_cc); goto out; erasenb: do { ntyrub(c, tp); if (tp->t_rawq.c_cc == 0) goto out; c = unputc(&tp->t_rawq); } wh((ile (c != ' ' && c != '\t'); (void) putc(c, &tp->t_rawq); } else if (c==tlun.t_rprntc) { ntyretype(tp); /* check for cooked mode input buffer overflow */ } else if (tp->t_rawq.c_cc + tp->t_canq.c_cc > TTYHOG) { /* we should start a timeout that flushes the buffer if it stays full - same in CBREAK */ if (tp->t_outq.c_cc < TTHIWAT(tp)) (void) ntyoutput(CTRL(g), tp); /* put data char in q for user and wakeup if a break char */ } else if (putc(c, &tp->t_rawq) >= 0) { if (!ntbreakc(c, tp)) { if (tp->t_rocount++ == 0) tp->t_rocol = tp->t_col; } else { tp->t_rocount = 0; catq(&tp->t_rawq, &tp->t_canq); if (tp->t_chan) (void) sdata(tp->t_chan); wakeup((caddr_t)&tp->t_rawq); if (tp->t_local&LINTRUP) gsignal(tp->t_pgrp, SIGTINT); } tp->t_lstate &= ~LSQUOT; if (c == '\\') tp->t_lstate |= LSQUOT; if (tp->t_lstate&LSERASE) { tp->t_lstate &= ~LSERASE; (void) ntyoutput('/', tp); } i = tp->t_col; ntyecho(c, tp); if (c==tun.t_eofc && tp->t_flags&ECHO) { i = MIN(2, tp->t_col - i); while (i > 0) { (void) ntyoutput('\b', tp); i--; } } } /* CBREAK mode */ } else if (tp->t_rawq.c_cc > TTYHOG) { if (tp->t_outq.c_cc < TTHIWAT(tp)) (void) ntyoutput(CTRL(g), tp); } else if (putc(c, &tp->t_rawq) >= 0) { if (tp->t_local&LINTRUP) gsignal(tp->t_pgrp, SIGTINT); if (tp->t_chan) (void) sdata(tp->t_chan); wakeup((caddr_t)&tp->t_rawq); ntyecho(c, tp); } /* RAW mode */ } else if (tp->t_rawq.c_cc > TTYHOG) flushtty(tp, FREAD|FWRITE); else { if (putc(c, &tp->t_rawq) >= 0) { if (tp->t_local&LINTRUP) gsignal(tp->t_pgrp, SIGTINT); if (tp->t_chan) (void) sdata(tp->t_chan); wakeup((caddr_t)&tp->t_rawq); } ntyecho(c, tp); } out: if (tp->t_local & LDECCTQ && tp->t_state & TTSTOP && tun.t_startc != tun.t_stopc) return; tp->t_state &= ~TTSTOP; tp->t_local &= ~LFLUSHO; ttstart(tp); } /* * put character on TTY output queue, adding delays, * expanding tabs, and handling the CR/NL bit. * It is called both from the top half for output, and from * interrupt level for echoing. * The arguments are the character and the tty structure. * Returns < 0 if putc succeeds, otherwise returns char to resend * Must be recursive. */ ntyoutput(c, tp) register c; register struct tty *tp; { register char *colp; register ctype; if (tp->t_flags&RAW || tp->t_local&LLITOUT) { if (tp->t_local&LFLUSHO) return (-1); if (putc(c, &tp->t_outq)) return(c); tk_nout++; return (-1); } /* * Ignore EOT in normal mode to avoid hanging up * certain terminals. */ c &= 0177; if (c==CEOT && (tp->t_flags&CBREAK)==0) return (-1); /* * Turn tabs to spaces as required */ if (c=='\t' && (tp->t_flags&TBDELAY)==XTABS) { register int s; c = 8 - (tp->t_col&7); if ((tp->t_local&LFLUSHO) == 0) { s = spl5(); /* don't interrupt tabs */ c -= b_to_q(" ", c, &tp->t_outq); tk_nout += c; splx(s); } tp->t_col += c; return (c ? -1 : '\t'); } tk_nout++; /* * for upper-case-only terminals, * generate escapes. */ if (tp->t_flags&LCASE) { colp = "({)}!|^~'`"; while(*colp++) if(c == *colp++) { if (ntyoutput('\\', tp) >= 0) return (c); c = colp[-2]; break; } if ('A'<=c && c<='Z') { if (ntyoutput('\\', tp) >= 0) return (c); } else if ('a'<=c && c<='z') c += 'A' - 'a'; } /* * turn to if desired. */ if (c=='\n' && tp->t_flags&CRMOD) if (ntyoutput('\r', tp) >= 0) return (c); if (c=='~' && tp->t_local<ILDE) c = '`'; if ((tp->t_local&LFLUSHO) == 0 && putc(c, &tp->t_outq)) return (c); /* * Calculate delays. * The numbers here represent clock ticks * and are not necessarily optimal for all terminals. * The delays are indicated by characters above 0200. * In raw mode there are no delays and the * transmission path is 8 bits wide. */ colp = &tp->t_col; ctype = partab[c]; c = 0; switch (ctype&077) { case ORDINARY: (*colp)++; case CONTROL: break; case BACKSPACE: if (*colp) (*colp)--; break; case NEWLINE: ctype = (tp->t_flags >> 8) & 03; if(ctype == 1) { /* tty 37 */ if (*colp) c = max(((unsigned)*colp>>4) + 3, (unsigned)6); } else if(ctype == 2) { /* vt05 */ c = 6; } *colp = 0; break; case TAB: ctype = (tp->t_flags >> 10) & 03; if(ctype == 1) { /* tty 37 */ c = 1 - (*colp | ~07); if(c < 5) c = 0; } *colp |= 07; (*colp)++; break; case VTAB: if(tp->t_flags & VTDELAY) /* tty 37 */ c = 0177; break; case RETURN: ctype = (tp->t_flags >> 12) & 03; if(ctype == 1) { /* tn 300 */ c = 5; } else if(ctype == 2) { /* ti 700 */ c = 10; } else if(ctype == 3) { /* concept 100 */ int i; if ((i = *colp) >= 0) for (; i<9; i++) (void) putc(0177, &tp->t_outq); } *colp = 0; } if(c && (tp->t_local&LFLUSHO) == 0) (void) putc(c|0200, &tp->t_outq); return (-1); } /* * Called from device's read routine after it has * calculated the tty-structure given as argument. */ ntread(tp) register struct tty *tp; { register struct clist *qp; register c, first; if ((tp->t_state&CARR_ON)==0) return(0); loop: (void) spl5(); if (tp->t_local&LPENDIN) ntypend(tp); (void) spl0(); while (tp == u.u_ttyp && u.u_procp->p_pgrp != tp->t_pgrp) { if (u.u_signal[SIGTTIN] == SIG_IGN || u.u_signal[SIGTTIN] == SIG_HOLD || (u.u_procp->p_flag&SDETACH) || u.u_procp->p_flag&SVFORK) return (0); gsignal(u.u_procp->p_pgrp, SIGTTIN); sleep((caddr_t)&lbolt, TTIPRI); } if (tp->t_flags&RAW) { (void) spl5(); if (tp->t_rawq.c_cc <= 0) { if ((tp->t_state&CARR_ON)==0 || (tp->t_chan && getf(u.u_ap[0])->f_flag&FMP)) { (void) spl0(); return (0); } if (tp->t_local&LINTRUP && u.u_signal[SIGTINT] != SIG_DFL) { u.u_error = EIO; (void) spl0(); return (0); } sleep((caddr_t)&tp->t_rawq, TTIPRI); (void) spl0(); goto loop; } (void) spl0(); while (tp->t_rawq.c_cc && passc(getc(&tp->t_rawq))>=0) ; return (0); } else { qp = tp->t_flags & CBREAK ? &tp->t_rawq : &tp->t_canq; (void) spl5(); if (qp->c_cc <= 0) { if ((tp->t_state&CARR_ON)==0 || (tp->t_chan!=NULL && getf(u.u_ap[0])->f_flag&FMP)) { (void) spl0(); return (0); } if (tp->t_local&LINTRUP && u.u_signal[SIGTINT] != SIG_DFL) { u.u_error = EIO; (void) spl0(); return (0); } sleep((caddr_t)&tp->t_rawq, TTIPRI); (void) spl0(); goto loop; } (void) spl0(); first = 1; while ((c = getc(qp)) >= 0) { if (tp->t_flags&CRMOD && c == '\r') c = '\n'; if (tp->t_flags&LCASE && c <= 0177) if (tp->t_lstate&LSBKSL) { if (maptab[c]) c = maptab[c]; tp->t_lstate &= ~LSBKSL; } else if (c >= 'A' && c <= 'Z') c += 'a' - 'A'; else if (c == '\\') { tp->t_lstate |= LSBKSL; continue; } if (c == tlun.t_dsuspc) { gsignal(tp->t_pgrp, SIGTSTP); if (first) { sleep((caddr_t)&lbolt, TTIPRI); goto loop; } break; } if (c == tun.t_eofc && (tp->t_flags&CBREAK)==0) break; if (passc(c & 0177) < 0) break; if ((tp->t_flags&CBREAK)==0 && ntbreakc(c, tp)) break; first = 0; } tp->t_lstate &= ~LSBKSL; } if (tp->t_state&TBLOCK && tp->t_rawq.c_cc < TTYHOG/5) { if (putc(tun.t_startc, &tp->t_outq)==0) { tp->t_state &= ~TBLOCK; ttstart(tp); } tp->t_char = 0; } return (tp->t_rawq.c_cc + tp->t_canq.c_cc); } /* * Called from the device's write routine after it has * calculated the tty-structure given as argument. */ caddr_t ntwrite(tp) register struct tty *tp; { #ifdef vax /* * THE POSITIONING OF CP, CC, AND CE ARE CRITICAL * AND MUST NOT BE CHANGED WITHOUT PATCHING * THE 'ASM' INLINES BELOW. WATCH OUT. */ #endif register char *cp; register int cc, ce; register i; char obuf[OBUFSIZ]; register c; int hiwat = TTHIWAT(tp); if ((tp->t_state&CARR_ON)==0) return (NULL); loop: while (u.u_procp->p_pgrp != tp->t_pgrp && tp == u.u_ttyp && (tp->t_local<OSTOP) && (u.u_procp->p_flag&SVFORK)==0 && u.u_signal[SIGTTOU] != SIG_IGN && u.u_signal[SIGTTOU] != SIG_HOLD && (u.u_procp->p_flag&SDETACH)==0) { gsignal(u.u_procp->p_pgrp, SIGTTOU); sleep((caddr_t)&lbolt, TTIPRI); } while (u.u_count) { cc = MIN(u.u_count, OBUFSIZ); cp = obuf; iomove(cp, (unsigned)cc, B_WRITE); if (u.u_error) break; if (tp->t_outq.c_cc > hiwat) goto ovhiwat; if (tp->t_local&LFLUSHO) continue; if (tp->t_flags&LCASE || tp->t_local<ILDE) { while (cc--) { c = *cp++; tp->t_rocount = 0; while((c = ntyoutput(c, tp)) >= 0) { /* out of clists, wait a bit */ ttstart(tp); sleep((caddr_t)&lbolt, TTOPRI); tp->t_rocount = 0; } if (tp->t_outq.c_cc > hiwat) goto ovhiwat; } continue; } while (cc) { if (tp->t_flags&RAW || tp->t_local&LLITOUT) ce = cc; else { #ifdef vax asm(" scanc r9,(r10),_partab,$077"); asm(" subl3 r0,r9,r8"); #else ce=0; while(((partab[*(unsigned char *)(cp+ce)]&077)==0)&&(cet_rocount = 0; if (ntyoutput(*cp, tp) >= 0) { ttstart(tp); sleep((caddr_t)&lbolt, TTOPRI); continue; } cp++; cc--; if (tp->t_outq.c_cc > hiwat) goto ovhiwat; } } tp->t_rocount = 0; i=b_to_q(cp,ce,&tp->t_outq); ce-=i; tk_nout+=ce; tp->t_col+=ce; cp+=ce; cc-=ce; if (i) { ttstart(tp); sleep((caddr_t)&lbolt, TTOPRI); } if (ce || tp->t_outq.c_cc > hiwat) goto ovhiwat; } } ttstart(tp); return(NULL); ovhiwat: (void) spl5(); u.u_base -= cc; u.u_offset -= cc; u.u_count += cc; if (tp->t_outq.c_cc <= hiwat) { (void) spl0(); goto loop; } ttstart(tp); tp->t_state |= ASLEEP; if (tp->t_chan && u.u_segflg == 0 && (getf(u.u_ap[0])->f_flag&FMP)) { (void) spl0(); return ((caddr_t)&tp->t_outq); } sleep((caddr_t)&tp->t_outq, TTOPRI); (void) spl0(); goto loop; } /* * Rubout one character from the rawq of tp * as cleanly as possible. */ ntyrub(c, tp) register c; registe((r struct tty *tp; { register char *cp; register int savecol; int s; char *nextc(); if ((tp->t_flags&ECHO)==0) return; tp->t_local &= ~LFLUSHO; c &= 0377; if (tp->t_local&LCRTBS) { if (tp->t_rocount == 0) { /* * Screwed by ttwrite; retype */ ntyretype(tp); return; } if (c==('\t'|0200) || c==('\n'|0200)) ntyrubo(tp, 2); else switch(partab[c&=0177] & 0177) { case ORDINARY: if (tp->t_flags&LCASE && c >= 'A' && c <= 'Z') ntyrubo(tp, 2); else ntyrubo(tp, 1); break; case VTAB: case BACKSPACE: case CONTROL: case RETURN: if (tp->t_local & LCTLECH) ntyrubo(tp, 2); break; case TAB: if (tp->t_rocount < tp->t_rawq.c_cc) { ntyretype(tp); return; } s = spl5(); savecol = tp->t_col; tp->t_lstate |= LSCNTTB; tp->t_local |= LFLUSHO; tp->t_col = tp->t_rocol; for (cp = tp->t_rawq.c_cf; cp; cp = nextc(&tp->t_rawq, cp)) ntyecho(*cp, tp); tp->t_local &= ~LFLUSHO; tp->t_lstate &= ~LSCNTTB; splx(s); /* * savecol will now be length of the tab */ savecol -= tp->t_col; tp->t_col += savecol; if (savecol > 8) savecol = 8; /* overflow screw */ while (--savecol >= 0) (void) ntyoutput('\b', tp); break; default: panic("ttyrub"); } } else if (tp->t_local&LPRTERA) { if ((tp->t_lstate&LSERASE) == 0) { (void) ntyoutput('\\', tp); tp->t_lstate |= LSERASE; } ntyecho(c, tp); } else ntyecho(tp->t_erase, tp); tp->t_rocount--; } /* * Crt back over cnt chars perhaps * erasing them. */ ntyrubo(tp, cnt) register struct tty *tp; int cnt; { while (--cnt >= 0) ntyout(tp->t_local&LCRTERA ? "\b \b" : "\b", tp); } /* * Reprint the rawq line. * We assume c_cc has already been checked. */ ntyretype(tp) register struct tty *tp; { register char *cp; char *nextc(); int s; if (tlun.t_rprntc != 0377) ntyecho(tlun.t_rprntc, tp); (void) ntyoutput('\n', tp); s = spl5(); for (cp = tp->t_canq.c_cf; cp; cp = nextc(&tp->t_canq, cp)) ntyecho(*cp, tp); for (cp = tp->t_rawq.c_cf; cp; cp = nextc(&tp->t_rawq, cp)) ntyecho(*cp, tp); tp->t_lstate &= ~LSERASE; splx(s); tp->t_rocount = tp->t_rawq.c_cc; tp->t_rocol = 0; } /* * Echo a typed character to the terminal */ ntyecho(c, tp) register c; register struct tty *tp; { if ((tp->t_lstate & LSCNTTB) == 0) tp->t_local &= ~LFLUSHO; if ((tp->t_flags&ECHO) == 0) return; c &= 0377; if (tp->t_flags&RAW) { (void) ntyoutput(c, tp); return; } if (c == '\r' && tp->t_flags&CRMOD) c = '\n'; if (tp->t_local&LCTLECH) { if ((c&0177) <= 037 && c!='\t' && c!='\n' || (c&0177)==0177) { (void) ntyoutput('^', tp); c &= 0177; if (c == 0177) c = '?'; else if (tp->t_flags&LCASE) c += 'a' - 1; else c += 'A' - 1; } } (void) ntyoutput(c & 0177, tp); } /* * Is c a break char for tp? */ ntbreakc(c, tp) register c; register struct tty *tp; { return (c == '\n' || c == tun.t_eofc || c == tun.t_brkc || c == '\r' && (tp->t_flags&CRMOD)); } /* * send string cp to tp */ ntyout(cp, tp) register char *cp; register struct tty *tp; { register char c; while (c = *cp++) (void) ntyoutput(c, tp); } c &= 0177; if (c == 0177) c = '?'; else if (tp->t_flags&LCASE) c += 'a' - 1; else c += 'A' - 1; } } (void) ntyoutput(c & 0177, tp); } /* * Is c a break char for tp? */ ntbreakc(c, tp) register c; register struct tty *tp; { return (c == '\n' || c == tun.t_eofc || c == tun.t_brkc || c == '\r' && (tp->t_flags&CRMOD)); } /* * send string cp to tp */ ntyout(cp, tp) register char *cp; sys/dev/ttyold.c 444 0 33 22476 2624051601 7137 /* ttyold.c 4.9 81/07/22 */ /* * general TTY subroutines */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/tty.h" #include "../h/proc.h" #include "../h/mx.h" #include "../h/inode.h" #include "../h/file.h" #include "../h/reg.h" #include "../h/conf.h" #include "../h/buf.h" #include "../h/dk.h" char partab[]; /* * Input mapping table-- if an entry is non-zero, when the * corresponding character is typed preceded by "\" the escape * sequence is replaced by the table value. Mostly used for * upper-case only terminals. */ char maptab[]; #define OBUFSIZ 100 /* * routine called on first teletype open. * establishes a process group for distribution * of quits and interrupts from the tty. */ ttyopen(dev, tp) dev_t dev; register struct tty *tp; { register struct proc *pp; pp = u.u_procp; tp->t_dev = dev; if(pp->p_pgrp == 0) { u.u_ttyp = tp; u.u_ttyd = dev; if (tp->t_pgrp == 0) tp->t_pgrp = pp->p_pid; pp->p_pgrp = tp->t_pgrp; } tp->t_state &= ~WOPEN; tp->t_state |= ISOPEN; tp->t_line = 0; /* conservative */ } /* * clean tp on last close */ ttyclose(tp) register struct tty *tp; { tp->t_pgrp = 0; wflushtty(tp); tp->t_state = 0; tp->t_line = 0; } /* * transfer raw input list to canonical list, * doing erase-kill processing and handling escapes. * It waits until a full line has been typed in cooked mode, * or until any character has been typed in raw mode. */ canon(tp) register struct tty *tp; { register char *bp; char *bp1; register int c; int mc; int s; if ((tp->t_flags&(RAW|CBREAK))==0 && tp->t_delct==0 || (tp->t_flags&(RAW|CBREAK))!=0 && tp->t_rawq.c_cc==0) { return(-1); } s = spl0(); loop: bp = &canonb[2]; while ((c=getc(&tp->t_rawq)) >= 0) { if ((tp->t_flags&(RAW|CBREAK))==0) { if (c==0377) { tp->t_delct--; break; } if (bp[-1]!='\\') { if (c==tp->t_erase) { if (bp > &canonb[2]) bp--; continue; } if (c==tp->t_kill) goto loop; if (c==tun.t_eofc) continue; } else { mc = maptab[c]; if (c==tp->t_erase || c==tp->t_kill) mc = c; if (mc && (mc==c || (tp->t_flags&LCASE))) { if (bp[-2] != '\\') c = mc; bp--; } } } *bp++ = c; if (bp>=canonb+CANBSIZ) break; } bp1 = &canonb[2]; (void) b_to_q(bp1, bp-bp1, &tp->t_canq); if (tp->t_state&TBLOCK && tp->t_rawq.c_cc < TTYHOG/5) { if (putc(tun.t_startc, &tp->t_outq)==0) { tp->t_state &= ~TBLOCK; ttstart(tp); } tp->t_char = 0; } splx(s); return(0); } /* * block transfer input handler. */ ttyrend(tp, pb, pe) register struct tty *tp; register char *pb, *pe; { int tandem; tandem = tp->t_flags&TANDEM; if (tp->t_flags&RAW) { (void) b_to_q(pb, pe-pb, &tp->t_rawq); if (tp->t_chan) (void) sdata(tp->t_chan); wakeup((caddr_t)&tp->t_rawq); } else { tp->t_flags &= ~TANDEM; while (pb < pe) ttyinput(*pb++, tp); tp->t_flags |= tandem; } if (tandem) ttyblock(tp); } /* * Place a character on raw TTY input queue, putting in delimiters * and waking up top half as needed. * Also echo if required. * The arguments are the character and the appropriate * tty structure. */ ttyinput(c, tp) register c; register struct tty *tp; { register int t_flags; register struct chan *cp; tk_nin += 1; c &= 0377; t_flags = tp->t_flags; if (t_flags&TANDEM) ttyblock(tp); if ((t_flags&RAW)==0) { c &= 0177; if (tp->t_state&TTSTOP) { if (c==tun.t_startc) { tp->t_state &= ~TTSTOP; ttstart(tp); return; } if (c==tun.t_stopc) return; if ((tp->t_local & LDECCTQ) == 0) { tp->t_state &= ~TTSTOP; ttstart(tp); } } else { if (c==tun.t_stopc) { tp->t_state |= TTSTOP; (*cdevsw[major(tp->t_dev)].d_stop)(tp); return; } if (c==tun.t_startc) return; } if (c==tun.t_quitc || c==tun.t_intrc) { if ((tp->t_local & LNOFLSH) == 0) flushtty(tp, FREAD|FWRITE); c = (c==tun.t_intrc) ? SIGINT:SIGQUIT; if (tp->t_chan) scontrol(tp->t_chan, M_SIG, c); gsignal(tp->t_pgrp, c); return; } if (c=='\r' && t_flags&CRMOD) c = '\n'; } if (tp->t_rawq.c_cc>TTYHOG) { flushtty(tp, FREAD|FWRITE); return; } if (t_flags&LCASE && c>='A' && c<='Z') c += 'a'-'A'; (void) putc(c, &tp->t_rawq); if (t_flags&(RAW|CBREAK)||(c=='\n'||c==tun.t_eofc||c==tun.t_brkc)) { if ((t_flags&(RAW|CBREAK))==0 && putc(0377, &tp->t_rawq)==0) tp->t_delct++; if ((cp=tp->t_chan)!=NULL) (void) sdata(cp); wakeup((caddr_t)&tp->t_rawq); } if (t_flags&ECHO) { ttyoutput(c, tp); if (c==tp->t_kill && (t_flags&(RAW|CBREAK))==0) ttyoutput('\n', tp); ttstart(tp); } } /* * put character on TTY output queue, adding delays, * expanding tabs, and handling the CR/NL bit. * It is called both from the top half for output, and from * interrupt level for echoing. * The arguments are the character and the tty structure. */ ttyoutput(c, tp) register c; register struct tty *tp; { register char *colp; register ctype; /* * Ignore EOT in normal mode to avoid hanging up * certain terminals. * In raw mode dump the char unchanged. */ if ((tp->t_flags&RAW)==0) { c &= 0177; if ((tp->t_flags&CBREAK)==0 && c==CEOT) return; } else { tk_nout++; (void) putc(c, &tp->t_outq); return; } /* * Turn tabs to spaces as required */ if (c=='\t' && (tp->t_flags&TBDELAY)==XTABS) { c = 8 - (tp->t_col & 7); (void) b_to_q(" ", c, &tp->t_outq); tp->t_col += c; tk_nout += c; return; } tk_nout++; /* * for upper-case-only terminals, * generate escapes. */ if (tp->t_flags&LCASE) { colp = "({)}!|^~'`"; while(*colp++) if(c == *colp++) { ttyoutput('\\', tp); c = colp[-2]; break; } if ('a'<=c && c<='z') c += 'A' - 'a'; } /* * turn to if desired. */ if (c=='\n' && tp->t_flags&CRMOD) ttyoutput('\r', tp); (void) putc(c, &tp->t_outq); /* * Calculate delays. * The numbers here represent clock ticks * and are not necessarily optimal for all terminals. * The delays are indicated by characters above 0200. * In raw mode the((re are no delays and the * transmission path is 8 bits wide. */ colp = &tp->t_col; ctype = partab[c]; c = 0; switch (ctype&077) { /* ordinary */ case 0: (*colp)++; /* non-printing */ case 1: break; /* backspace */ case 2: if (*colp) (*colp)--; break; /* newline */ case 3: ctype = (tp->t_flags >> 8) & 03; if(ctype == 1) { /* tty 37 */ if (*colp) c = max(((unsigned)*colp>>4) + 3, (unsigned)6); } else if(ctype == 2) { /* vt05 */ c = 6; } *colp = 0; break; /* tab */ case 4: ctype = (tp->t_flags >> 10) & 03; if(ctype == 1) { /* tty 37 */ c = 1 - (*colp | ~07); if(c < 5) c = 0; } *colp |= 07; (*colp)++; break; /* vertical motion */ case 5: if(tp->t_flags & VTDELAY) /* tty 37 */ c = 0177; break; /* carriage return */ case 6: ctype = (tp->t_flags >> 12) & 03; if(ctype == 1) { /* tn 300 */ c = 5; } else if(ctype == 2) { /* ti 700 */ c = 10; } else if(ctype == 3) { /* concept 100 */ int i; if ((i = *colp) >= 0) for (; i<9; i++) (void) putc(0177, &tp->t_outq); } *colp = 0; } if(c) (void) putc(c|0200, &tp->t_outq); } /* * Called from device's read routine after it has * calculated the tty-structure given as argument. */ ttread(tp) register struct tty *tp; { register s; if ((tp->t_state&CARR_ON)==0) return(-1); s = spl5(); if (tp->t_canq.c_cc==0) while (canon(tp)<0) if (tp->t_chan==NULL || (getf(u.u_ap[0])->f_flag&FMP)==0) { sleep((caddr_t)&tp->t_rawq, TTIPRI); } else { splx(s); return(0); } splx(s); while (tp->t_canq.c_cc && passc(getc(&tp->t_canq))>=0) ; return(tp->t_rawq.c_cc+tp->t_canq.c_cc); } /* * Called from the device's write routine after it has * calculated the tty-structure given as argument. */ caddr_t ttwrite(tp) register struct tty *tp; { /* * THE POSITIONING OF CP, CC, AND CE ARE CRITICAL * AND MUST NOT BE CHANGED WITHOUT PATCHING * THE 'ASM' INLINES BELOW. WATCH OUT. */ register char *cp; register int cc, ce; register i; char obuf[OBUFSIZ]; int hiwat = TTHIWAT(tp); if ((tp->t_state&CARR_ON)==0) return(NULL); while (u.u_count) { cc = MIN(u.u_count, OBUFSIZ); cp = obuf; iomove(cp, (unsigned)cc, B_WRITE); if (u.u_error) break; (void) spl5(); while (tp->t_outq.c_cc > hiwat) { ttstart(tp); tp->t_state |= ASLEEP; if (tp->t_chan && u.u_segflg == 0 && (getf(u.u_ap[0])->f_flag&FMP)) { u.u_base -= cc; u.u_offset -= cc; u.u_count += cc; (void) spl0(); return((caddr_t)&tp->t_outq); } sleep((caddr_t)&tp->t_outq, TTOPRI); } (void) spl0(); if (tp->t_flags&LCASE) { while (cc--) ttyoutput(*cp++,tp); continue; } while (cc) { if (tp->t_flags&RAW) ce=cc; else { #ifdef vax asm(" scanc r9,(r10),_partab,$077"); asm(" subl3 r0,r9,r8"); #else ce=0; while(((partab[*(unsigned char *)(cp+ce)]&077)==0)&&(cet_outq); ce-=i; tk_nout+=ce; tp->t_col+=ce; cp+=ce; cc-=ce; check: if (tp->t_outq.c_cc > hiwat) { (void) spl5(); while (tp->t_outq.c_cc > hiwat) { ttstart(tp); tp->t_state |= ASLEEP; sleep((caddr_t)&tp->t_outq, TTOPRI); } (void) spl0(); } } } ttstart(tp); return(NULL); } hile(((partab[*(unsigned char *)(cp+ce)]&077)==0)&&(cet_outq); sys/dev/up.c 444 0 33 51304 2624325504 6242 /* up.c 4.41 81/11/12 */ #include "up.h" #if NSC > 0 /* * UNIBUS disk driver with overlapped seeks and ECC recovery. * * TODO: * Add bad sector forwarding code * Check that offset recovery code works */ #include "../h/param.h" #include "../h/systm.h" #include "../h/cpu.h" #include "../h/nexus.h" #include "../h/dk.h" #include "../h/buf.h" #include "../h/conf.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/map.h" #include "../h/pte.h" #include "../h/mtpr.h" #include "../h/vm.h" #include "../h/ubavar.h" #include "../h/ubareg.h" #include "../h/cmap.h" #include "../h/upreg.h" struct up_softc { int sc_softas; int sc_ndrive; int sc_wticks; int sc_recal; } up_softc[NSC]; /* THIS SHOULD BE READ OFF THE PACK, PER DRIVE */ struct size { daddr_t nblocks; int cyloff; } up_sizes[8] = { 15884, 0, /* A=cyl 0 thru 26 */ 33440, 27, /* B=cyl 27 thru 81 */ 495520, 0, /* C=cyl 0 thru 814 */ 15884, 562, /* D=cyl 562 thru 588 */ 55936, 589, /* E=cyl 589 thru 680 */ #ifndef NOBADSECT 81376, 681, /* F=cyl 681 thru 814 */ 153728, 562, /* G=cyl 562 thru 814 */ #else 81472, 681, 153824, 562, #endif 291346, 82, /* H=cyl 82 thru 561 */ }, fj_sizes[8] = { 15884, 0, /* A=cyl 0 thru 49 */ 33440, 50, /* B=cyl 50 thru 154 */ 263360, 0, /* C=cyl 0 thru 822 */ 0, 0, 0, 0, 0, 0, 0, 0, #ifndef NOBADSECT 213664, 155, /* H=cyl 155 thru 822 */ #else 213760, 155, #endif }; /* END OF STUFF WHICH SHOULD BE READ IN PER DISK */ /* * On a 780 upSDIST could be 2, but * in the interest of 750's... */ #define _upSDIST 3 /* 1.5 msec */ #define _upRDIST 4 /* 2.0 msec */ int upSDIST = _upSDIST; int upRDIST = _upRDIST; int upprobe(), upslave(), upattach(), updgo(), upintr(); struct uba_ctlr *upminfo[NSC]; struct uba_device *updinfo[NUP]; struct uba_device *upip[NSC][4]; u_short upstd[] = { 0776700, 0774400, 0776300, 0 }; struct uba_driver scdriver = { upprobe, upslave, upattach, updgo, upstd, "up", updinfo, "sc", upminfo }; struct buf uputab[NUP]; struct upst { short nsect; short ntrak; short nspc; short ncyl; struct size *sizes; } upst[] = { 32, 19, 32*19, 823, up_sizes, /* 9300/cdc */ /* 9300 actually has 815 cylinders... */ 32, 10, 32*10, 823, fj_sizes, /* fujitsu 160m */ }; u_char up_offset[16] = { UPOF_P400, UPOF_M400, UPOF_P400, UPOF_M400, UPOF_P800, UPOF_M800, UPOF_P800, UPOF_M800, UPOF_P1200, UPOF_M1200, UPOF_P1200, UPOF_M1200, 0, 0, 0, 0 }; struct buf rupbuf[NUP]; #define b_cylin b_resid #ifdef INTRLVE daddr_t dkblock(); #endif int upwstart, upwatch(); /* Have started guardian */ int upseek; int upwaitdry; /*ARGSUSED*/ upprobe(reg) caddr_t reg; { register int br, cvec; #ifdef lint br = 0; cvec = br; br = cvec; #endif ((struct updevice *)reg)->upcs1 = UP_IE|UP_RDY; DELAY(10); ((struct updevice *)reg)->upcs1 = 0; return (1); } upslave(ui, reg) struct uba_device *ui; caddr_t reg; { register struct updevice *upaddr = (struct updevice *)reg; upaddr->upcs1 = 0; /* conservative */ upaddr->upcs2 = ui->ui_slave; if (upaddr->upcs2&UPCS2_NED) { upaddr->upcs1 = UP_DCLR|UP_GO; return (0); } return (1); } upattach(ui) register struct uba_device *ui; { register struct updevice *upaddr; if (upwstart == 0) { timeout(upwatch, (caddr_t)0, hz); upwstart++; } if (ui->ui_dk >= 0) dk_mspw[ui->ui_dk] = .0000020345; upip[ui->ui_ctlr][ui->ui_slave] = ui; up_softc[ui->ui_ctlr].sc_ndrive++; upaddr = (struct updevice *)ui->ui_addr; upaddr->upcs1 = 0; upaddr->upcs2 = ui->ui_slave; upaddr->uphr = UPHR_MAXTRAK; if (upaddr->uphr == 9) ui->ui_type = 1; /* fujitsu hack */ upaddr->upcs2 = UPCS2_CLR; /* upaddr->uphr = UPHR_MAXCYL; printf("maxcyl %d\n", upaddr->uphr); upaddr->uphr = UPHR_MAXTRAK; printf("maxtrak %d\n", upaddr->uphr); upaddr->uphr = UPHR_MAXSECT; printf("maxsect %d\n", upaddr->uphr); */ } upstrategy(bp) register struct buf *bp; { register struct uba_device *ui; register struct upst *st; register int unit; register struct buf *dp; int xunit = minor(bp->b_dev) & 07; long bn, sz; sz = (bp->b_bcount+511) >> 9; unit = dkunit(bp); if (unit >= NUP) goto bad; ui = updinfo[unit]; if (ui == 0 || ui->ui_alive == 0) goto bad; st = &upst[ui->ui_type]; if (bp->b_blkno < 0 || (bn = dkblock(bp))+sz > st->sizes[xunit].nblocks) goto bad; bp->b_cylin = bn/st->nspc + st->sizes[xunit].cyloff; (void) spl5(); dp = &uputab[ui->ui_unit]; disksort(dp, bp); if (dp->b_active == 0) { (void) upustart(ui); bp = &ui->ui_mi->um_tab; if (bp->b_actf && bp->b_active == 0) (void) upstart(ui->ui_mi); } (void) spl0(); return; bad: bp->b_flags |= B_ERROR; iodone(bp); return; } /* * Unit start routine. * Seek the drive to be where the data is * and then generate another interrupt * to actually start the transfer. * If there is only one drive on the controller, * or we are very close to the data, don't * bother with the search. If called after * searching once, don't bother to look where * we are, just queue for transfer (to avoid * positioning forever without transferrring.) */ upustart(ui) register struct uba_device *ui; { register struct buf *bp, *dp; register struct uba_ctlr *um; register struct updevice *upaddr; register struct upst *st; daddr_t bn; int sn, csn; /* * The SC21 cancels commands if you just say * cs1 = UP_IE * so we are cautious about handling of cs1. * Also don't bother to clear as bits other than in upintr(). */ int didie = 0; if (ui == 0) return (0); um = ui->ui_mi; dk_busy &= ~(1<ui_dk); dp = &uputab[ui->ui_unit]; if ((bp = dp->b_actf) == NULL) goto out; /* * If the controller is active, just remember * that this device would like to be positioned... * if we tried to position now we would confuse the SC21. */ if (um->um_tab.b_active) { up_softc[um->um_ctlr].sc_softas |= 1<ui_slave; return (0); } /* * If we have already positioned this drive, * then just put it on the ready queue. */ if (dp->b_active) goto done; dp->b_active = 1; upaddr = (struct updevice *)um->um_addr; upaddr->upcs2 = ui->ui_slave; /* * If drive has just come(( up, * setup the pack. */ if ((upaddr->upds & UPDS_VV) == 0) { /* SHOULD WARN SYSTEM THAT THIS HAPPENED */ upaddr->upcs1 = UP_IE|UP_DCLR|UP_GO; upaddr->upcs1 = UP_IE|UP_PRESET|UP_GO; upaddr->upof = UPOF_FMT22; didie = 1; } /* * If drive is offline, forget about positioning. */ if ((upaddr->upds & (UPDS_DPR|UPDS_MOL)) != (UPDS_DPR|UPDS_MOL)) goto done; /* * If there is only one drive, * dont bother searching. */ if (up_softc[um->um_ctlr].sc_ndrive == 1) goto done; /* * Figure out where this transfer is going to * and see if we are close enough to justify not searching. */ st = &upst[ui->ui_type]; bn = dkblock(bp); sn = bn%st->nspc; sn = (sn + st->nsect - upSDIST) % st->nsect; if (bp->b_cylin - upaddr->updc) goto search; /* Not on-cylinder */ else if (upseek) goto done; /* Ok just to be on-cylinder */ csn = (upaddr->upla>>6) - sn - 1; if (csn < 0) csn += st->nsect; if (csn > st->nsect - upRDIST) goto done; search: upaddr->updc = bp->b_cylin; /* * Not on cylinder at correct position, * seek/search. */ if (upseek) upaddr->upcs1 = UP_IE|UP_SEEK|UP_GO; else { upaddr->upda = sn; upaddr->upcs1 = UP_IE|UP_SEARCH|UP_GO; } didie = 1; /* * Mark unit busy for iostat. */ if (ui->ui_dk >= 0) { dk_busy |= 1<ui_dk; dk_seek[ui->ui_dk]++; } goto out; done: /* * Device is ready to go. * Put it on the ready queue for the controller * (unless its already there.) */ if (dp->b_active != 2) { dp->b_forw = NULL; if (um->um_tab.b_actf == NULL) um->um_tab.b_actf = dp; else um->um_tab.b_actl->b_forw = dp; um->um_tab.b_actl = dp; dp->b_active = 2; } out: return (didie); } /* * Start up a transfer on a drive. */ upstart(um) register struct uba_ctlr *um; { register struct buf *bp, *dp; register struct uba_device *ui; register struct updevice *upaddr; struct upst *st; daddr_t bn; int dn, sn, tn, cmd, waitdry; loop: /* * Pull a request off the controller queue */ if ((dp = um->um_tab.b_actf) == NULL) return (0); if ((bp = dp->b_actf) == NULL) { um->um_tab.b_actf = dp->b_forw; goto loop; } /* * Mark controller busy, and * determine destination of this request. */ um->um_tab.b_active++; ui = updinfo[dkunit(bp)]; bn = dkblock(bp); dn = ui->ui_slave; st = &upst[ui->ui_type]; sn = bn%st->nspc; tn = sn/st->nsect; sn %= st->nsect; upaddr = (struct updevice *)ui->ui_addr; /* * Select drive if not selected already. */ if ((upaddr->upcs2&07) != dn) upaddr->upcs2 = dn; /* * Check that it is ready and online */ waitdry = 0; while ((upaddr->upds&UPDS_DRY) == 0) { if (++waitdry > 512) break; upwaitdry++; } if ((upaddr->upds & UPDS_DREADY) != UPDS_DREADY) { printf("up%d: not ready", dkunit(bp)); if ((upaddr->upds & UPDS_DREADY) != UPDS_DREADY) { printf("\n"); um->um_tab.b_active = 0; um->um_tab.b_errcnt = 0; dp->b_actf = bp->av_forw; dp->b_active = 0; bp->b_flags |= B_ERROR; iodone(bp); goto loop; } /* * Oh, well, sometimes this * happens, for reasons unknown. */ printf(" (flakey)\n"); } /* * Setup for the transfer, and get in the * UNIBUS adaptor queue. */ upaddr->updc = bp->b_cylin; upaddr->upda = (tn << 8) + sn; upaddr->upwc = -bp->b_bcount / sizeof (short); if (bp->b_flags & B_READ) cmd = UP_IE|UP_RCOM|UP_GO; else cmd = UP_IE|UP_WCOM|UP_GO; um->um_cmd = cmd; (void) ubago(ui); return (1); } /* * Now all ready to go, stuff the registers. */ updgo(um) struct uba_ctlr *um; { register struct updevice *upaddr = (struct updevice *)um->um_addr; upaddr->upba = um->um_ubinfo; upaddr->upcs1 = um->um_cmd|((um->um_ubinfo>>8)&0x300); } /* * Handle a disk interrupt. */ upintr(sc21) register sc21; { register struct buf *bp, *dp; register struct uba_ctlr *um = upminfo[sc21]; register struct uba_device *ui; register struct updevice *upaddr = (struct updevice *)um->um_addr; register unit; struct up_softc *sc = &up_softc[um->um_ctlr]; int as = (upaddr->upas & 0377) | sc->sc_softas; int needie = 1, waitdry, err; sc->sc_wticks = 0; sc->sc_softas = 0; /* * If controller wasn't transferring, then this is an * interrupt for attention status on seeking drives. * Just service them. */ if (um->um_tab.b_active == 0) { if (upaddr->upcs1 & UP_TRE) upaddr->upcs1 = UP_TRE; goto doattn; } /* * Get device and block structures, and a pointer * to the uba_device for the drive. Select the drive. */ dp = um->um_tab.b_actf; bp = dp->b_actf; ui = updinfo[dkunit(bp)]; dk_busy &= ~(1 << ui->ui_dk); if ((upaddr->upcs2&07) != ui->ui_slave) upaddr->upcs2 = ui->ui_slave; /* * Check for and process errors on * either the drive or the controller. */ if ((err = (upaddr->upds&UPDS_ERR) || (upaddr->upcs1&UP_TRE)) || upaddr->upwc != 0) { if (!err) printf("up%d: word count != 0\n", dkunit(bp)); waitdry = 0; while ((upaddr->upds & UPDS_DRY) == 0) { if (++waitdry > 512) break; upwaitdry++; } if (upaddr->uper1&UPER1_WLE) { /* * Give up on write locked devices * immediately. */ printf("up%d: write locked\n", dkunit(bp)); bp->b_flags |= B_ERROR; } else if (++um->um_tab.b_errcnt > 27) { /* * After 28 retries (16 without offset, and * 12 with offset positioning) give up. */ harderr(bp, "up"); printf("cs2=%b er1=%b er2=%b\n", upaddr->upcs2, UPCS2_BITS, upaddr->uper1, UPER1_BITS, upaddr->uper2, UPER2_BITS); bp->b_flags |= B_ERROR; } else { /* * Retriable error. * If a soft ecc, correct it (continuing * by returning if necessary. * Otherwise fall through and retry the transfer */ um->um_tab.b_active = 0; /* force retry */ if ((upaddr->uper1&(UPER1_DCK|UPER1_ECH))==UPER1_DCK) if (upecc(ui)) return; } /* * Clear drive error and, every eight attempts, * (starting with the fourth) * recalibrate to clear the slate. */ upaddr->upcs1 = UP_TRE|UP_IE|UP_DCLR|UP_GO; needie = 0; if ((um->um_tab.b_errcnt&07) == 4 && um->um_tab.b_active == 0) { upaddr->upcs1 = UP_RECAL|UP_IE|UP_GO; sc->sc_recal = 0; goto nextrecal; } } /* * Advance recalibration finite state machine * if recalibrate in progress, through * RECAL * SEEK * OFFSET (optional) * RETRY */ switch (sc->sc_recal) { case 1: upaddr->updc = bp->b_cylin; upaddr->upcs1 = UP_SEEK|UP_IE|UP_GO; goto nextrecal; case 2: if (um->um_tab.b_errcnt < 16 || (bp->b_flags&B_READ) == 0) goto donerecal; upaddr->upof = up_offset[um->um_tab.b_errcnt & 017] | UPOF_FMT22; upaddr->upcs1 = UP_IE|UP_OFFSET|UP_GO; goto nextrecal; nextrecal: sc->sc_recal++; um->um_tab.b_active = 1; return; donerecal: case 3: sc->sc_recal = 0; um->um_tab.b_active = 0; break; } /* * If still ``active'', then don't need any more retries. */ if (um->um_tab.b_active) { /* * If we were offset positioning, * return to centerline. */ if (um->um_tab.b_errcnt >= 16) { upaddr->upof = UPOF_FMT22; upaddr->upcs1 = UP_RTC|UP_GO|UP_IE; while (upaddr->upds & UPDS_PIP) DELAY(25); needie = 0; } um->um_tab.b_active = 0; um->um_tab.b_errcnt = 0; um->um_tab.b_actf = dp->b_forw; dp->b_active = 0; dp->b_errcnt = 0; dp->b_actf = bp->av_forw; bp->b_resid = (-upaddr->upwc * sizeof(short)); iodone(bp); /* * If this unit has more work to do, * then start it up right away. */ if (dp->b_actf) if (upustart(ui)) needie = 0; } as &= ~(1<ui_slave); /* * Release unibus resources and flush data paths. */ ubadone(um); doattn: /* * Process other units which need attention. * For each unit which needs attention, call * the unit start routine to place the slave * on the controller device queue. */ while (unit = ffs(as)) { unit--; /* was 1 origin */ as &= ~(1<upas = 1<um_tab.b_actf && um->um_tab.b_active == 0) if (upstart(um)) needie = 0; if (needie) upaddr->upcs1 = UP_IE; } upread(dev) dev_t dev; { register int unit = minor(dev) >> 3; if (unit >= NUP) u.u_error = ENXIO; else physio(upstrategy, &rupbuf[unit], dev, B_READ, minphys); } upwrite(dev) dev_t dev; { register int unit = minor(dev) >> 3; if (unit >= NUP) u.u_error = ENXIO; else physio(upstrategy, &rupbuf[unit], dev, B_WRITE, minphys); } /* * Correct an ECC error, and restart the i/o to complete * the transfer if necessary. This is quite complicated because * the transfer may be going to an odd memory address base and/or * across a page boundary. */ upecc(ui) register struct uba_device *ui; { register struct updevice *up = (struct updevice *)ui->ui_addr; register struct buf *bp = uputab[ui->ui_unit].b_actf; register struct uba_ctlr *um = ui->ui_mi; register struct upst *st; struct uba_regs *ubp = ui->ui_hd->uh_uba; register int i; caddr_t addr; int reg, bit, byte, npf, mask, o, cmd, ubaddr; int bn, cn, tn, sn; /* * Npf is the number of sectors transferred before the sector * containing the ECC error, and reg is the UBA register * mapping (the first part of) the transfer. * O is offset within a memory page of the first byte transferred. */ npf = btop((up->upwc * sizeof(short)) + bp->b_bcount) - 1; reg = btop(um->um_ubinfo&0x3ffff) + npf; o = (int)bp->b_un.b_addr & PGOFSET; printf("up%d%c: soft ecc sn%d\n", dkunit(bp), 'a'+(minor(bp->b_dev)&07), bp->b_blkno + npf); mask = up->upec2; #ifdef UPECCDEBUG printf("npf %d reg %x o %d mask %o pos %d\n", npf, reg, o, mask, up->upec1); #endif /* * Flush the buffered data path, and compute the * byte and bit position of the error. The variable i * is the byte offset in the transfer, the variable byte * is the offset from a page boundary in main memory. */ ubapurge(um); i = up->upec1 - 1; /* -1 makes 0 origin */ bit = i&07; i = (i&~07)>>3; byte = i + o; /* * Correct while possible bits remain of mask. Since mask * contains 11 bits, we continue while the bit offset is > -1((1. * Also watch out for end of this block and the end of the whole * transfer. */ while (i < 512 && (int)ptob(npf)+i < bp->b_bcount && bit > -11) { addr = ptob(ubp->uba_map[reg+btop(byte)].pg_pfnum)+ (byte & PGOFSET); #ifdef UPECCDEBUG printf("addr %x map reg %x\n", addr, *(int *)(&ubp->uba_map[reg+btop(byte)])); printf("old: %x, ", getmemc(addr)); #endif putmemc(addr, getmemc(addr)^(mask<um_tab.b_active++; /* Either complete or continuing... */ if (up->upwc == 0) return (0); /* * Have to continue the transfer... clear the drive, * and compute the position where the transfer is to continue. * We have completed npf+1 sectors of the transfer already; * restart at offset o of next sector (i.e. in UBA register reg+1). */ #ifdef notdef up->uper1 = 0; up->upcs1 |= UP_GO; #else up->upcs1 = UP_TRE|UP_IE|UP_DCLR|UP_GO; bn = dkblock(bp); st = &upst[ui->ui_type]; cn = bp->b_cylin; sn = bn%st->nspc + npf + 1; tn = sn/st->nsect; sn %= st->nsect; cn += tn/st->ntrak; tn %= st->ntrak; up->updc = cn; up->upda = (tn << 8) | sn; ubaddr = (int)ptob(reg+1) + o; up->upba = ubaddr; cmd = (ubaddr >> 8) & 0x300; cmd |= UP_IE|UP_GO|UP_RCOM; up->upcs1 = cmd; #endif return (1); } /* * Reset driver after UBA init. * Cancel software state of all pending transfers * and restart all units and the controller. */ upreset(uban) int uban; { register struct uba_ctlr *um; register struct uba_device *ui; register sc21, unit; for (sc21 = 0; sc21 < NSC; sc21++) { if ((um = upminfo[sc21]) == 0 || um->um_ubanum != uban || um->um_alive == 0) continue; printf(" sc%d", sc21); um->um_tab.b_active = 0; um->um_tab.b_actf = um->um_tab.b_actl = 0; up_softc[sc21].sc_recal = 0; if (um->um_ubinfo) { printf("<%d>", (um->um_ubinfo>>28)&0xf); ubadone(um); } ((struct updevice *)(um->um_addr))->upcs2 = UPCS2_CLR; for (unit = 0; unit < NUP; unit++) { if ((ui = updinfo[unit]) == 0) continue; if (ui->ui_alive == 0 || ui->ui_mi != um) continue; uputab[unit].b_active = 0; (void) upustart(ui); } (void) upstart(um); } } /* * Wake up every second and if an interrupt is pending * but nothing has happened increment a counter. * If nothing happens for 20 seconds, reset the UNIBUS * and begin anew. */ upwatch() { register struct uba_ctlr *um; register sc21, unit; register struct up_softc *sc; timeout(upwatch, (caddr_t)0, hz); for (sc21 = 0; sc21 < NSC; sc21++) { um = upminfo[sc21]; if (um == 0 || um->um_alive == 0) continue; sc = &up_softc[sc21]; if (um->um_tab.b_active == 0) { for (unit = 0; unit < NUP; unit++) if (uputab[unit].b_active && updinfo[unit]->ui_mi == um) goto active; sc->sc_wticks = 0; continue; } active: sc->sc_wticks++; if (sc->sc_wticks >= 20) { sc->sc_wticks = 0; printf("sc%d: lost interrupt\n", sc21); ubareset(um->um_ubanum); } } } #define DBSIZE 20 updump(dev) dev_t dev; { struct updevice *upaddr; char *start; int num, blk, unit; struct size *sizes; register struct uba_regs *uba; register struct uba_device *ui; register short *rp; struct upst *st; unit = minor(dev) >> 3; if (unit >= NUP) return (ENXIO); #define phys(cast, addr) ((cast)((int)addr & 0x7fffffff)) ui = phys(struct uba_device *, updinfo[unit]); if (ui->ui_alive == 0) return (ENXIO); uba = phys(struct uba_hd *, ui->ui_hd)->uh_physuba; ubainit(uba); upaddr = (struct updevice *)ui->ui_physaddr; DELAY(2000000); num = maxfree; start = 0; upaddr->upcs2 = unit; DELAY(100); if ((upaddr->upcs1&UP_DVA) == 0) return (EFAULT); if ((upaddr->upds & UPDS_VV) == 0) { upaddr->upcs1 = UP_DCLR|UP_GO; upaddr->upcs1 = UP_PRESET|UP_GO; upaddr->upof = UPOF_FMT22; } if ((upaddr->upds & UPDS_DREADY) != UPDS_DREADY) return (EFAULT); st = &upst[ui->ui_type]; sizes = phys(struct size *, st->sizes); if (dumplo < 0 || dumplo + num >= sizes[minor(dev)&07].nblocks) return (EINVAL); while (num > 0) { register struct pte *io; register int i; int cn, sn, tn; daddr_t bn; blk = num > DBSIZE ? DBSIZE : num; io = uba->uba_map; for (i = 0; i < blk; i++) *(int *)io++ = (btop(start)+i) | (1<<21) | UBAMR_MRV; *(int *)io = 0; bn = dumplo + btop(start); cn = bn/st->nspc + sizes[minor(dev)&07].cyloff; sn = bn%st->nspc; tn = sn/st->nsect; sn = sn%st->nsect; upaddr->updc = cn; rp = (short *) &upaddr->upda; *rp = (tn << 8) + sn; *--rp = 0; *--rp = -blk*NBPG / sizeof (short); *--rp = UP_GO|UP_WCOM; do { DELAY(25); } while ((upaddr->upcs1 & UP_RDY) == 0); if (upaddr->upds&UPDS_ERR) return (EIO); start += blk*NBPG; num -= blk; } return (0); } #endif rt)+i) | (1<<21) | UBAMR_MRV; *(int *)io = 0; bn = dumplo + btop(start); cn = bn/st->nspc + sizes[minor(dev)&07].cyloff; sn = bn%st->nspc; tn = sn/st->nsect; sn = sn%st->nsect; upaddr->updc = cn; rp = (short *) &upaddr->upda; *rp = (tn << 8) + sn; *--rp = 0; *--rp = -blk*NBPG / sizeof (short);sys/dev/va.c 444 0 33 15352 2552504037 6227 /* va.c 4.10 81/07/08 */ #include "va.h" #if NVA > 0 /* * Varian printer plotter */ #include "../h/param.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/buf.h" #include "../h/systm.h" #include "../h/map.h" #include "../h/pte.h" #include "../h/ubareg.h" #include "../h/ubavar.h" #include "../h/vcmd.h" unsigned minvaph(); #define VAPRI (PZERO-1) struct vadevice { u_short vaba; /* buffer address */ short vawc; /* word count (2's complement) */ union { short Vacsw; /* control status as word */ struct { /* control status as bytes */ char Vacsl; char Vacsh; } vacsr; } vacs; short vadata; /* programmed i/o data buffer */ }; #define vacsw vacs.Vacsw #define vacsh vacs.vacsr.Vacsh #define vacsl vacs.vacsr.Vacsl /* vacsw bits */ #define VA_ERROR 0100000 /* some error has occurred */ #define VA_NPRTIMO 0001000 /* DMA timeout error */ #define VA_NOTREADY 0000400 /* something besides NPRTIMO */ #define VA_DONE 0000200 #define VA_IENABLE 0000100 /* interrupt enable */ #define VA_SUPPLIESLOW 0000004 #define VA_BOTOFFORM 0000002 #define VA_BYTEREVERSE 0000001 /* reverse byte order in words */ /* vacsh command bytes */ #define VAPLOT 0000340 #define VAPRINT 0000100 #define VAPRINTPLOT 0000160 #define VAAUTOSTEP 0000244 #define VANOAUTOSTEP 0000045 #define VAFORMFEED 0000263 #define VASLEW 0000265 #define VASTEP 0000064 struct va_softc { char sc_openf; char sc_busy; int sc_state; int sc_wc; struct buf *sc_bp; int sc_ubinfo; } va_softc[NVA]; #define VAUNIT(dev) (minor(dev)) struct buf rvabuf[NVA]; int vaprobe(), vaattach(); struct uba_device *vadinfo[NVA]; u_short vastd[] = { 0764000, 0 }; struct uba_driver vadriver = { vaprobe, 0, vaattach, 0, vastd, "va", vadinfo }; vaprobe(reg) caddr_t reg; { register int br, cvec; /* value-result */ register struct vadevice *vaaddr = (struct vadevice *)reg; vaaddr->vacsl = VA_IENABLE; vaaddr->vaba = 0; vaaddr->vacsh = VAPLOT; vaaddr->vacsl = 0; vaaddr->vawc = -1; DELAY(10000); vaaddr->vacsl = 0; } /*ARGSUSED*/ vaattach(ui) struct uba_device *ui; { } vaopen(dev) dev_t dev; { register struct va_softc *sc; register struct vadevice *vaaddr; register struct uba_device *ui; if (VAUNIT(dev) >= NVA || (sc = &va_softc[minor(dev)])->sc_openf || (ui = vadinfo[VAUNIT(dev)]) == 0 || ui->ui_alive == 0) { u.u_error = ENXIO; return; } vaaddr = (struct vadevice *)ui->ui_addr; sc->sc_openf = 1; vaaddr->vawc = 0; sc->sc_wc = 0; sc->sc_state = 0; vaaddr->vacsl = VA_IENABLE; vatimo(dev); vacmd(dev, VPRINT); if (u.u_error) vaclose(dev); } vastrategy(bp) register struct buf *bp; { register int e; register struct va_softc *sc = &va_softc[VAUNIT(bp->b_dev)]; register struct uba_device *ui = vadinfo[VAUNIT(bp->b_dev)]; register struct vadevice *vaaddr = (struct vadevice *)ui->ui_addr; (void) spl4(); while (sc->sc_busy) sleep((caddr_t)sc, VAPRI); sc->sc_busy = 1; sc->sc_bp = bp; sc->sc_ubinfo = ubasetup(ui->ui_ubanum, bp, UBA_NEEDBDP); if (e = vawait(bp->b_dev)) goto brkout; sc->sc_wc = -(bp->b_bcount/2); vastart(bp->b_dev); e = vawait(bp->b_dev); sc->sc_wc = 0; if (sc->sc_state & VPRINTPLOT) { sc->sc_state = (sc->sc_state & ~VPRINTPLOT) | VPLOT; vaaddr->vacsh = VAAUTOSTEP; e |= vawait(bp->b_dev); } (void) spl0(); brkout: ubarelse(ui->ui_ubanum, &sc->sc_ubinfo); sc->sc_bp = 0; sc->sc_busy = 0; iodone(bp); if (e) u.u_error = EIO; wakeup((caddr_t)sc); } int vablock = 16384; unsigned minvaph(bp) struct buf *bp; { if (bp->b_bcount > vablock) bp->b_bcount = vablock; } /*ARGSUSED*/ vawrite(dev) dev_t dev; { physio(vastrategy, &rvabuf[VAUNIT(dev)], dev, B_WRITE, minvaph); } vawait(dev) dev_t dev; { register struct vadevice *vaaddr = (struct vadevice *)vadinfo[VAUNIT(dev)]->ui_addr; register int e; while (((e = vaaddr->vacsw) & (VA_DONE|VA_ERROR)) == 0) sleep((caddr_t)&va_softc[VAUNIT(dev)], VAPRI); if (e & VA_NPRTIMO) printf("va%d: npr timeout\n", VAUNIT(dev)); return (e & VA_ERROR); } vastart(dev) dev_t; { register struct va_softc *sc = &va_softc[VAUNIT(dev)]; register struct vadevice *vaaddr = (struct vadevice *)vadinfo[VAUNIT(dev)]->ui_addr; if (sc->sc_wc == 0) return; vaaddr->vaba = sc->sc_ubinfo; vaaddr->vacsl = (sc->sc_ubinfo >> 12) & 0x30; vaaddr->vawc = sc->sc_wc; } /*ARGSUSED*/ vaioctl(dev, cmd, addr, flag) register caddr_t addr; { register int vcmd; register struct va_softc *sc = &va_softc[VAUNIT(dev)]; switch (cmd) { case VGETSTATE: (void) suword(addr, sc->sc_state); return; case VSETSTATE: vcmd = fuword(addr); if (((vcmd == -1) { u.u_error = EFAULT; return; } vacmd(dev, vcmd); return; default: u.u_error = ENOTTY; return; } } vacmd(dev, vcmd) dev_t dev; int vcmd; { register struct va_softc *sc = &va_softc[VAUNIT(dev)]; register struct vadevice *vaaddr = (struct vadevice *)vadinfo[VAUNIT(dev)]->ui_addr; (void) spl4(); (void) vawait(dev); switch (vcmd) { case VPLOT: /* Must turn on plot AND autostep modes. */ vaaddr->vacsh = VAPLOT; if (vawait(dev)) u.u_error = EIO; vaaddr->vacsh = VAAUTOSTEP; break; case VPRINT: vaaddr->vacsh = VAPRINT; break; case VPRINTPLOT: vaaddr->vacsh = VAPRINTPLOT; break; } sc->sc_state = (sc->sc_state & ~(VPLOT|VPRINT|VPRINTPLOT)) | vcmd; if (vawait(dev)) u.u_error = EIO; (void) spl0(); } vatimo(dev) dev_t dev; { register struct va_softc *sc = &va_softc[VAUNIT(dev)]; if (sc->sc_openf) timeout(vatimo, (caddr_t)dev, hz/10); vaintr(dev); } /*ARGSUSED*/ vaintr(dev) dev_t dev; { register struct va_softc *sc = &va_softc[VAUNIT(dev)]; wakeup((caddr_t)sc); } vaclose(dev) dev_t dev; { register struct va_softc *sc = &va_softc[VAUNIT(dev)]; register struct vadevice *vaaddr = (struct vadevice *)vadinfo[VAUNIT(dev)]->ui_addr; sc->sc_openf = 0; sc->sc_busy = 0; sc->sc_state = 0; sc->sc_ubinfo = 0; vaaddr->vacsl = 0; } vareset(uban) int uban; { register int va11; register struct uba_device *ui; register struct va_softc *sc = va_softc; register struct vadevice *vaaddr; for (va11 = 0; va11 < NVA; va11++, sc++) { if ((ui = vadinfo[va11]) == 0 || ui->ui_alive == 0 || ui->ui_ubanum != uban || sc->sc_openf == 0) continue; printf(" va%d", va11); vaaddr = (struct vadevice *)ui->ui_addr; vaaddr->vacsl = VA_IENABLE; if (sc->sc_state & VPLOT) { vaaddr->vacsh = VAPLOT; DELAY(10000); vaaddr->vacsh = VAAUTOSTEP; } else if (sc->sc_state & VPRINTPLOT) vaaddr->vacsh = VPRINTPLOT; else vaaddr->vacsh = VAPRINTPLOT; DELAY(10000); if (sc->sc_busy == 0) continue; if (sc->sc_ubinfo) { printf("<%d>", (sc->sc_ubinfo>>28)&0xf); ubarelse(ui->ui_ubanum, &sc->sc_ubinfo); } sc->sc_ubinfo = ubasetup(ui->ui_ubanum, sc->sc_bp, UBA_NEEDBDP); sc->sc_wc = -(sc->sc_bp->b_bcount/2); vastart(sc->sc_bp->b_dev); } } #endif & VPLOT) { vaaddr->vacsh = VAPLOT; DELAY(10000); vaaddr->vacsh = VAAUTOSTEP; } else if (sc->sc_state & VPRINTPLOT) vaaddr->vacsh = VPRINTPLOT; else vaaddr->vacsh = VAPRINTPLOT; DELAY(10000); if (sc->sc_busy == 0) continue; if (sc->sc_ubinfo) { prisys/dev/vaxcpu.c 444 0 33 2636 2516240205 7102 /* vaxcpu.c 4.5 81/04/13 */ #include "../h/param.h" #include "../h/pte.h" #include "../h/ubareg.h" #include "../h/nexus.h" #include "../h/cpu.h" /* * Initialization of per-cpu data structures. */ /* * These are the (fixed) addresses of the (last 8k bytes of) * unibus memory for each of the possible unibus adapters. Note that the * unibus memory addresses are actually indexed by the unibus adapter type code. */ #if VAX780 caddr_t umaddr780[4] = { (caddr_t) UMEM780(0), (caddr_t) UMEM780(1), (caddr_t) UMEM780(2), (caddr_t) UMEM780(3) }; #endif #if VAX750 caddr_t umaddr750[2] = { (caddr_t) UMEM750(0), (caddr_t) UMEM750(1), }; #endif #if VAX7ZZ caddr_t umaddr7ZZ[1] = { (caddr_t) UMEM7ZZ }; #endif /* * Information to patch around the stupidity of configuration * registers not returning types on some of the processors. */ #if VAX750 short nexty750[NNEX750] = { NEX_MEM16, NEX_MEM16, NEX_MEM16, NEX_MEM16, NEX_MBA, NEX_MBA, NEX_MBA, NEX_MBA, NEX_UBA0, NEX_UBA1, NEX_ANY, NEX_ANY, NEX_ANY, NEX_ANY, NEX_ANY, NEX_ANY }; #endif #if VAX7ZZ short nexty7ZZ[NNEX7ZZ] = { NEX_MEM16, NEX_ANY, NEX_ANY, NEX_ANY, NEX_ANY, NEX_ANY, NEX_ANY, NEX_ANY, }; #endif struct percpu percpu[] = { #if VAX780 VAX_780, NNEX780, NEX780, umaddr780, NBDP780, 1, 0, #endif #if VAX750 VAX_750, NNEX750, NEX750, umaddr750, NBDP750, 0, nexty750, #endif #if VAX7ZZ VAX_7ZZ, NNEX7ZZ, NEX7ZZ, umaddr7ZZ, NBDP7ZZ, 0, nexty7ZZ, #endif 0, }; 6, NEX_MBA, NEX_MBA, NEX_MBA, NEX_MBA, NEX_UBA0, NEX_UBA1, NEX_ANY, NEX_ANY, NEX_ANY, NEX_ANY, sys/dev/vp.c 444 0 33 15455 2512326204 6244 /* vp.c 4.9 81/04/02 */ #include "vp.h" #if NVP > 0 /* * Versatec matrix printer/plotter * dma interface driver * * SETUP NOTES: * Set up both print and plot interrupts to go through the same vector * Give the address of the plcsr register in the config specification */ #include "../h/param.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/buf.h" #include "../h/systm.h" #include "../h/map.h" #include "../h/pte.h" #include "../h/ubavar.h" #include "../h/ubareg.h" #include "../h/vcmd.h" unsigned minvpph(); #define VPPRI (PZERO-1) struct vpdevice { short plbcr; short pbxaddr; short prbcr; u_short pbaddr; short plcsr; short plbuf; short prcsr; u_short prbuf; }; #define VP_ERROR 0100000 #define VP_DTCINTR 0040000 #define VP_DMAACT 0020000 #define VP_READY 0000200 #define VP_IENABLE 0000100 #define VP_TERMCOM 0000040 #define VP_FFCOM 0000020 #define VP_EOTCOM 0000010 #define VP_CLRCOM 0000004 #define VP_RESET 0000002 #define VP_SPP 0000001 struct vp_softc { int sc_state; int sc_count; int sc_bufp; struct buf *sc_bp; int sc_ubinfo; } vp_softc[NVP]; /* sc_state bits */ #define VPSC_BUSY 0001000 #define VPSC_MODE 0000700 #define VPSC_SPP 0000400 #define VPSC_PLOT 0000200 #define VPSC_PRINT 0000100 #define VPSC_CMNDS 0000076 #define VPSC_OPEN 0000001 struct uba_device *vpdinfo[NVP]; #define VPUNIT(dev) (minor(dev)) struct buf rvpbuf[NVP]; int vpprobe(), vpattach(); struct uba_device *vpdinfo[NVP]; u_short vpstd[] = { 0777500, 0 }; struct uba_driver vpdriver = { vpprobe, 0, vpattach, 0, vpstd, "vp", vpdinfo }; vpprobe(reg) caddr_t reg; { register int br, cvec; /* value-result */ register struct vpdevice *vpaddr = (struct vpdevice *)(reg-010); vpaddr->prcsr = VP_IENABLE|VP_DTCINTR; vpaddr->pbaddr = 0; vpaddr->pbxaddr = 0; vpaddr->prbcr = 1; DELAY(10000); vpaddr->prcsr = 0; #ifdef ERNIE /* UNTIL REWIRED, GET INTERRUPT AT 200 BUT WANT 174 */ if (cvec == 0200) { printf("vp reset vec from 200 to 174\n"); cvec = 0174; } #endif } /*ARGSUSED*/ vpattach(ui) struct uba_device *ui; { ui->ui_addr -= 010; ui->ui_physaddr -= 010; } vpopen(dev) dev_t dev; { register struct vp_softc *sc; register struct vpdevice *vpaddr; register struct uba_device *ui; if (VPUNIT(dev) >= NVP || ((sc = &vp_softc[minor(dev)])->sc_state&VPSC_OPEN) || (ui = vpdinfo[VPUNIT(dev)]) == 0 || ui->ui_alive == 0) { u.u_error = ENXIO; return; } vpaddr = (struct vpdevice *)ui->ui_addr; sc->sc_state = VPSC_OPEN|VPSC_PRINT | VP_CLRCOM|VP_RESET; sc->sc_count = 0; vpaddr->prcsr = VP_IENABLE|VP_DTCINTR; vptimo(dev); while (sc->sc_state & VPSC_CMNDS) { (void) spl4(); if (vpwait(dev)) { vpclose(dev); u.u_error = EIO; return; } vpstart(dev); (void) spl0(); } } vpstrategy(bp) register struct buf *bp; { register int e; register struct vp_softc *sc = &vp_softc[VPUNIT(bp->b_dev)]; register struct uba_device *ui = vpdinfo[VPUNIT(bp->b_dev)]; register struct vpdevice *vpaddr = (struct vpdevice *)ui->ui_addr; (void) spl4(); while (sc->sc_state & VPSC_BUSY) sleep((caddr_t)sc, VPPRI); sc->sc_state |= VPSC_BUSY; sc->sc_bp = bp; sc->sc_ubinfo = ubasetup(ui->ui_ubanum, bp, UBA_NEEDBDP); if (e = vpwait(bp->b_dev)) goto brkout; sc->sc_count = bp->b_bcount; vpstart(bp->b_dev); while (((sc->sc_state&VPSC_PLOT) ? vpaddr->plcsr : vpaddr->prcsr) & VP_DMAACT) sleep((caddr_t)sc, VPPRI); sc->sc_count = 0; if ((sc->sc_state&VPSC_MODE) == VPSC_SPP) sc->sc_state = (sc->sc_state &~ VPSC_MODE) | VPSC_PLOT; (void) spl0(); brkout: ubarelse(ui->ui_ubanum, &sc->sc_ubinfo); sc->sc_state &= ~VPSC_BUSY; sc->sc_bp = 0; iodone(bp); if (e) u.u_error = EIO; wakeup((caddr_t)sc); } int vpblock = 16384; unsigned minvpph(bp) struct buf *bp; { if (bp->b_bcount > vpblock) bp->b_bcount = vpblock; } /*ARGSUSED*/ vpwrite(dev) dev_t dev; { physio(vpstrategy, &rvpbuf[VPUNIT(dev)], dev, B_WRITE, minvpph); } vpwait(dev) dev_t dev; { register struct vpdevice *vpaddr = (struct vpdevice *)vpdinfo[VPUNIT(dev)]->ui_addr; register struct vp_softc *sc = &vp_softc[VPUNIT(dev)]; register int e; for (;;) { e = (sc->sc_state & VPSC_PLOT) ? vpaddr->plcsr : vpaddr->prcsr; if (e & (VP_READY|VP_ERROR)) break; sleep((caddr_t)sc, VPPRI); } /* I wish i could tell whether an error indicated an npr timeout */ return (e & VP_ERROR); } vpstart(dev) dev_t; { register struct vp_softc *sc = &vp_softc[VPUNIT(dev)]; register struct vpdevice *vpaddr = (struct vpdevice *)vpdinfo[VPUNIT(dev)]->ui_addr; short bit; if (sc->sc_count) { vpaddr->pbaddr = sc->sc_ubinfo; vpaddr->pbxaddr = (sc->sc_ubinfo>>12)&0x30; if (sc->sc_state & (VPSC_PRINT|VPSC_SPP)) vpaddr->prbcr = sc->sc_count; else vpaddr->plbcr = sc->sc_count; return; } for (bit = 1; bit != 0; bit <<= 1) if (sc->sc_state&bit&VPSC_CMNDS) { vpaddr->plcsr |= bit; sc->sc_state &= ~bit; return; } } /*ARGSUSED*/ vpioctl(dev, cmd, addr, flag) dev_t dev; int cmd; register caddr_t addr; int flag; { register int m; register struct vp_softc *sc = &vp_softc[VPUNIT(dev)]; register struct vpde((vice *vpaddr = (struct vpdevice *)vpdinfo[VPUNIT(dev)]->ui_addr; switch (cmd) { case VGETSTATE: (void) suword(addr, sc->sc_state); return; case VSETSTATE: m = fuword(addr); if (m == -1) { u.u_error = EFAULT; return; } sc->sc_state = (sc->sc_state & ~VPSC_MODE) | (m&(VPSC_MODE|VPSC_CMNDS)); break; default: u.u_error = ENOTTY; return; } (void) spl4(); (void) vpwait(dev); if (sc->sc_state&VPSC_SPP) vpaddr->plcsr |= VP_SPP; else vpaddr->plcsr &= ~VP_SPP; sc->sc_count = 0; while (sc->sc_state & VPSC_CMNDS) { (void) vpwait(dev); vpstart(dev); } (void) spl0(); } vptimo(dev) dev_t dev; { register struct vp_softc *sc = &vp_softc[VPUNIT(dev)]; if (sc->sc_state&VPSC_OPEN) timeout(vptimo, (caddr_t)dev, hz/10); vpintr(dev); } /*ARGSUSED*/ vpintr(dev) dev_t dev; { register struct vp_softc *sc = &vp_softc[VPUNIT(dev)]; wakeup((caddr_t)sc); } vpclose(dev) dev_t dev; { register struct vp_softc *sc = &vp_softc[VPUNIT(dev)]; register struct vpdevice *vpaddr = (struct vpdevice *)vpdinfo[VPUNIT(dev)]->ui_addr; sc->sc_state = 0; sc->sc_count = 0; vpaddr->plcsr = 0; } vpreset(uban) int uban; { register int vp11; register struct uba_device *ui; register struct vp_softc *sc = vp_softc; register struct vpdevice *vpaddr; for (vp11 = 0; vp11 < NVP; vp11++, sc++) { if ((ui = vpdinfo[vp11]) == 0 || ui->ui_alive == 0 || ui->ui_ubanum != uban || (sc->sc_state&VPSC_OPEN) == 0) continue; printf(" vp%d", vp11); vpaddr = (struct vpdevice *)ui->ui_addr; vpaddr->prcsr = VP_IENABLE|VP_DTCINTR; if ((sc->sc_state & VPSC_BUSY) == 0) continue; if (sc->sc_ubinfo) { printf("<%d>", (sc->sc_ubinfo>>28)&0xf); ubarelse(ui->ui_ubanum, &sc->sc_ubinfo); } sc->sc_count = sc->sc_bp->b_bcount; vpstart(sc->sc_bp->b_dev); } } #endif 11 < NVP; vp11++, sc++) { if ((ui = vpdinfo[vp11]) == 0 || ui->ui_alive == 0 || ui->ui_ubanum != uban || (sc->sc_state&VPSC_OPEN) == 0) continue; printf(" vp%d", vp11); vpaddr = (struct vpdevice *sys/dev/swapupup.c 644 0 33 1123 2522400313 7443 #include "../h/param.h" #include "../h/conf.h" /* * Dual storage module (ampex or cdc 300M or fujitsu 160m) configuration * root on up0a * paging on up0b, then also up1b */ dev_t rootdev = makedev(2, 0); dev_t pipedev = makedev(2, 0); dev_t argdev = makedev(2, 1); dev_t dumpdev = makedev(2, 1); long dumplo = 33440 - 10 * 2048; /* * Nswap is the basic number of blocks of swap per * swap device, and is multiplied by nswdev after * nswdev is determined at boot. */ int nswap = 33440; struct swdevt swdevt[] = { makedev(2, 1), 0, /* up0b */ makedev(2, 9), 0, /* up1b */ 0, 0, }; cdc 300M or fujitsu 160m) configuration * root on up0a * paging on up0b, then also up1b */ dev_t rootdev = makedev(2, 0); dev_t pipedev = makedev(2, 0); dev_t argdev = makedev(2, 1); dev_t dumpdev = makedev(2, 1); long dumplo = 33440 - 10 * 2048; /* * Nswap is the basic number of blocks of swap per * swap device, and is multiplied by nswdev after * nswdev is determined at boot. */ int nswap = 33440; struct swdevt swdsys/dev/dkbad.c 444 0 33 1114 2527134571 6641 /* dkbad.c 4.3 81/05/10 */ #ifndef NOBADSECT #include "../h/param.h" #include "../h/buf.h" #include "../h/dkbad.h" /* * Search the bad sector table looking for * the specified sector. Return index if found. * Return -1 if not found. */ isbad(bt, cyl, trk, sec) register struct dkbad *bt; { register int i; register long blk, bblk; blk = ((long)cyl << 16) + (trk << 8) + sec; for (i = 0; i < 126; i++) { bblk = ((long)bt->bt_bad[i].bt_cyl << 16) + bt->bt_bad[i].bt_trksec; if (blk == bblk) return (i); if (blk < bblk || bblk < 0) break; } return (-1); } #endif de "../h/buf.h" #include "../h/dkbad.h" /* * Search the bad sector table looking for * the specified sector. Return index if found. * Return -1 if not found. */ isbad(bt, cyl, trk, sec) register struct dkbad *bt; { register int i; register long blk, bblk; blk = ((long)cyl << 16) + (trk << 8) + sec; for (i = 0; i < 126; i++) { bblk = ((long)bt->bt_bad[i].bt_cyl << 16) + bt->bt_bad[i].bt_trksec; if (blk == bblk) resys/dev/swapuphp.c 644 0 33 1042 2526723276 7452 #include "../h/param.h" #include "../h/conf.h" /* * UP0?+PP0? configuration * root on up0a * paging on up0b and then hp0b */ dev_t rootdev = makedev(2, 0); dev_t pipedev = makedev(2, 0); dev_t argdev = makedev(2, 1); dev_t dumpdev = makedev(2, 1); int dumplo = 33340 - 10 * 2048; /* * Nswap is the basic number of blocks of swap per * swap device, and is multiplied by nswdev after * nswdev is determined at boot. */ int nswap = 33440; struct swdevt swdevt[] = { makedev(2, 1), 0, /* up0b */ makedev(0, 1), 0, /* hp0b */ 0, 0, }; ../h/conf.h" /* * UP0?+PP0? configuration * root on up0a * paging on up0b and then hp0b */ dev_t rootdev = makedev(2, 0); dev_t pipedev = makedev(2, 0); dev_t argdev = makedev(2, 1); dev_t dumpdev = makedev(2, 1); int dumplo = 33340 - 10 * 2048; /* * Nswap is the basic number of blocks of swap per * swap device, and is multiplied by nswdev after * nswdev is determined at boot. */ int nswap = 33440; struct swdevt swdevt[] = { makedev(2, 1), 0, /* up0b */ makedevsys/dev/dn.c 444 0 33 7465 2711062440 6202 /* dn.c 4.4 82/01/12 */ #include "dn.h" #if NDN > 0 /* * DN-11 ACU interface */ #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/buf.h" #include "../h/map.h" #include "../h/pte.h" #include "../h/ubavar.h" #include "../h/conf.h" #include "../h/ioctl.h" struct dndevice { u_short dn_reg[4]; }; struct uba_device *dninfo[NDN]; int dnprobe(), dnattach(); u_short dnstd[] = { 0175200 }; struct uba_driver dndriver = { dnprobe, 0, dnattach, 0, dnstd, "dn", dninfo }; #define CRQ 0x001 /* call request */ #define DPR 0x002 /* digit present */ #define MENABLE 0x004 /* master enable */ #define MAINT 0x008 /* maintenance mode */ #define PND 0x010 /* present next digit */ #define DSS 0x020 /* data set status */ #define IENABLE 0x040 /* interrupt enable */ #define DONE 0x080 /* operation complete */ #define DLO 0x1000 /* data line occupied */ #define ACR 0x4000 /* abandon call and retry */ #define PWI 0x8000 /* power indicate */ #define DNPRI (PZERO+5) #define DNUNIT(dev) (minor(dev)>>2) #define DNREG(dev) ((dev)&03) #define OBUFSIZ 40 /* largest phone # dialer can handle */ /* * There's no good way to determine the correct number of dialers attached * to a single device (especially when dialers such as Vadic-821 MACS * exist which can address four chassis, each with its own dialer). */ dnprobe(reg) caddr_t reg; { register int br, cvec; /* value-result, must be r11, r10 */ register struct dndevice *dnaddr = (struct dndevice *)reg; /* * If there's at least one dialer out there it better be * at chassis 0. */ dnaddr->dn_reg[0] = MENABLE|IENABLE|DONE; DELAY(5); dnaddr->dn_reg[0] = 0; } dnattach(ui) struct uba_device *ui; {} /*ARGSUSED*/ dnopen(dev, flag) dev_t dev; { register struct dndevice *dp; register u_short unit, *dnreg; register struct uba_device *ui; register short dialer; if ((unit = DNUNIT(dev)) >= NDN || (ui = dninfo[unit]) == 0 || ui->ui_alive == 0) { u.u_error = ENXIO; return; } dialer = DNREG(dev); dp = (struct dndevice *)ui->ui_addr; if (dp->dn_reg[dialer] & PWI) { u.u_error = ENXIO; return; } dnreg = &(dp->dn_reg[dialer]); if (*dnreg&(DLO|CRQ)) { u.u_error = EBUSY; return; } dp->dn_reg[0] |= MENABLE; *dnreg = IENABLE|MENABLE|CRQ; } /*ARGSUSED*/ dnclose(dev, flag) dev_t dev; { register struct dndevice *dp; dp = (struct dndevice *)dninfo[DNUNIT(dev)]->ui_addr; dp->dn_reg[DNREG(dev)] = MENABLE; } dnwrite(dev) dev_t dev; { register u_short *dnreg; register int cc; register struct dndevice *dp; char buf[OBUFSIZ]; register char *cp; extern lbolt; dp = (struct dndevice *)dninfo[DNUNIT(dev)]->ui_addr; dnreg = &(dp->dn_reg[DNREG(dev)]); cc = MIN(u.u_count, OBUFSIZ); cp = buf; iomove(cp, (unsigned)cc, B_WRITE); if (u.u_error) return; while ((*dnreg & (PWI|ACR|DSS)) == 0 && cc >= 0) { spl4(); if ((*dnreg & PND) == 0 || cc == 0) sleep((caddr_t)dnreg, DNPRI); else switch(*cp) { case '-': sleep((caddr_t)&lbolt, DNPRI); sleep((caddr_t)&lbolt, DNPRI); bre((ak; case 'f': *dnreg &= ~CRQ; sleep((caddr_t)&lbolt, DNPRI); *dnreg |= CRQ; break; case '*': case ':': *cp = 012; goto dial; case '#': case ';': *cp = 013; goto dial; case 'e': case '<': *cp = 014; goto dial; case 'w': case '=': *cp = 015; goto dial; default: if (*cp < '0' || *cp > '9') break; dial: *dnreg = (*cp << 8) | (IENABLE|MENABLE|DPR|CRQ); sleep((caddr_t)dnreg, DNPRI); } cp++, cc--; spl0(); } if (*dnreg & (PWI|ACR)) u.u_error = EIO; } dnintr(dev) dev_t dev; { register u_short *basereg, *dnreg; basereg = (u_short *)dninfo[dev]->ui_addr; *basereg &= ~MENABLE; for (dnreg = basereg; dnreg < basereg + 4; dnreg++) if (*dnreg & DONE) { *dnreg &= ~(DONE|DPR); wakeup((caddr_t)dnreg); } *basereg |= MENABLE; } #endif ult: if (*cp < '0' || *cp > '9') break; dial: *dnreg = (*cp << 8) | (IENABLE|MENABLE|DPR|CRQ); sleep((caddr_t)dnreg, DNPRI); } cp++, cc--; spl0(); } if (*dnreg & (PWI|ACR)) u.u_esys/dev/mt.c 444 0 33 33563 2624051472 6245 /* mt.c 1.2 81/10/27 */ #include "mu.h" #if NMT > 0 /* * TM78/TU78 tape driver * * Behavior in complex error situations is uncertain... * * TODO: * test error recovery * add odd byte count kludge from VMS driver * write dump routine */ #include "../h/param.h" #include "../h/systm.h" #include "../h/buf.h" #include "../h/conf.h" #include "../h/dir.h" #include "../h/file.h" #include "../h/user.h" #include "../h/map.h" #include "../h/pte.h" #include "../h/mbareg.h" #include "../h/mbavar.h" #include "../h/mtio.h" #include "../h/ioctl.h" #include "../h/cmap.h" #include "../h/cpu.h" #include "../h/mtreg.h" struct buf rmtbuf[NMT]; struct buf cmtbuf[NMT]; short mttypes[] = { MBDT_TU78, 0 }; struct mba_device *mtinfo[NMT]; int mtattach(), mtslave(), mtustart(), mtstart(), mtndtint(), mtdtint(); struct mba_driver mtdriver = { mtattach, mtslave, mtustart, mtstart, mtdtint, mtndtint, mttypes, "mt", "mu", mtinfo }; #define MASKREG(r) ((r) & 0xffff) /* bits in minor device */ #define MUUNIT(dev) (minor(dev)&03) #define H_NOREWIND 04 #define H_6250BPI 08 #define MTUNIT(dev) (mutomt[MUUNIT(dev)]) #define INF (daddr_t)1000000L /* a block number that wont exist */ struct mu_softc { char sc_openf; char sc_flags; daddr_t sc_blkno; daddr_t sc_nxrec; u_short sc_erreg; u_short sc_dsreg; short sc_resid; short sc_dens; struct mba_device *sc_mi; int sc_slave; } mu_softc[NMU]; short mutomt[NMU]; /* * Bits for sc_flags. */ #define H_WRITTEN 1 /* last operation was a write */ char mtds_bits[] = MTDS_BITS; /*ARGSUSED*/ mtattach(mi) struct mba_device *mi; { } mtslave(mi, ms) struct mba_device *mi; struct mba_slave *ms; { register struct mu_softc *sc = &mu_softc[ms->ms_unit]; register struct mtdevice *mtaddr = (struct mtdevice *)mi->mi_drv; int s = spl7(), rtn = 0; mtaddr->mtas = -1; mtaddr->mtncs[ms->ms_slave] = MT_SENSE|MT_GO; while (mtaddr->mtas == 0) ; if ((mtaddr->mtner & MTER_INTCODE) == MTER_DONE && (mtaddr->mtds & MTDS_PRES)) { sc->sc_mi = mi; sc->sc_slave = ms->ms_slave; mutomt[ms->ms_unit] = mi->mi_unit; rtn = 1; } mtaddr->mtas = mtaddr->mtas; splx(s); return (rtn); } mtopen(dev, flag) dev_t dev; int flag; { register int muunit; register struct mba_device *mi; register struct mu_softc *sc; int olddens, dens; muunit = MUUNIT(dev); if (muunit >= NMU || (sc = &mu_softc[muunit])->sc_openf || (mi = mtinfo[MTUNIT(dev)]) == 0 || mi->mi_alive == 0) { u.u_error = ENXIO; return; } olddens = sc->sc_dens; dens = sc->sc_dens = (minor(dev)&H_6250BPI) ? MT_GCR : 0; mtcommand(dev, MT_SENSE, 1); sc->sc_dens = olddens; if ((sc->sc_dsreg & MTDS_ONL) == 0) { uprintf("mu%d: not online\n", muunit); u.u_error = EIO; return; } if ((flag&FWRITE) && (sc->sc_dsreg&MTDS_FPT)) { uprintf("mu%d: no write ring\n", muunit); u.u_error = EIO; return; } if ((sc->sc_dsreg & MTDS_BOT) == 0 && (flag&FWRITE) && dens != sc->sc_dens) { uprintf("mu%d: can't change density in mid-tape\n", muunit); u.u_error = EIO; return; } sc->sc_openf = 1; sc->sc_blkno = (daddr_t)0; sc->sc_nxrec = INF; sc->sc_flags = 0; sc->sc_dens = dens; } mtclose(dev, flag) register dev_t dev; register flag; { register struct mu_softc *sc = &mu_softc[MUUNIT(dev)]; if (flag == FWRITE || ((flag&FWRITE) && (sc->sc_flags&H_WRITTEN))) mtcommand(dev, MT_CLS|sc->sc_dens, 1); if ((minor(dev)&H_NOREWIND) == 0) mtcommand(dev, MT_REW, 0); sc->sc_openf = 0; } mtcommand(dev, com, count) dev_t dev; int com, count; { register struct buf *bp; bp = &cmtbuf[MTUNIT(dev)]; (void) spl5(); while (bp->b_flags&B_BUSY) { if(bp->b_repcnt == 0 && (bp->b_flags&B_DONE)) break; bp->b_flags |= B_WANTED; sleep((caddr_t)bp, PRIBIO); } bp->b_flags = B_BUSY|B_READ; (void) spl0(); bp->b_dev = dev; bp->b_command = com; bp->b_repcnt = count; bp->b_blkno = 0; mtstrategy(bp); if (count == 0) return; iowait(bp); if (bp->b_flags&B_WANTED) wakeup((caddr_t)bp); bp->b_flags &= B_ERROR; } mtstrategy(bp) register struct buf *bp; { register struct mba_device *mi = mtinfo[MTUNIT(bp->b_dev)]; register struct buf *dp; bp->av_forw = NULL; dp = &mi->mi_tab; (void) spl5(); if (dp->b_actf == NULL) dp->b_actf = bp; else dp->b_actl->av_forw = bp; dp->b_actl = bp; if (dp->b_active == 0) mbustart(mi); (void) spl0(); } mtustart(mi) register struct mba_device *mi; { register struct mtdevice *mtaddr = (struct mtdevice *)mi->mi_drv; register struct buf *bp = mi->mi_tab.b_actf; register struct mu_softc *sc = &mu_softc[MUUNIT(bp->b_dev)]; daddr_t blkno; sc->sc_flags &= ~H_WRITTEN; if (sc->sc_openf < 0) { bp->b_flags |= B_ERROR; return (MBU_NEXT); } if (bp != &cmtbuf[MTUNIT(bp->b_dev)]) { if (dbtofsb(bp->b_blkno) > sc->sc_nxrec) { bp->b_flags |= B_ERROR; bp->b_error = ENXIO; return (MBU_NEXT); } if (dbtofsb(bp->b_blkno) == sc->sc_nxrec && bp->b_flags&B_READ) { bp->b_resid = bp->b_bcount; clrbuf(bp); return (MBU_NEXT); } if ((bp->b_flags&B_READ)==0) sc->sc_nxrec = dbtofsb(bp->b_blkno) + 1; } else { mtaddr->mtncs[MUUNIT(bp->b_dev)] = (bp->b_repcnt<<8)|bp->b_command|MT_GO; return (MBU_STARTED); } if ((blkno = sc->sc_blkno) == dbtofsb(bp->b_blkno)) { if (mi->mi_tab.b_errcnt == 2) { mtaddr->mtca = MUUNIT(bp->b_dev); } else { mtaddr->mtbc = bp->b_bcount; mtaddr->mtca = (1<<2)|MUUNIT(bp->b_dev); } return (MBU_DODATA); } if (blkno < dbtofsb(bp->b_blkno)) mtaddr->mtncs[MUUNIT(bp->b_dev)] = (min(dbtofsb(bp->b_blkno) - blkno, 0377)<<8)| MT_SFORW|MT_GO; else mtaddr->mtncs[MUUNIT(bp->b_dev)] = (min(blkno - dbtofsb(bp->b_blkno), 0377)<<8)| MT_SREV|MT_GO; return (MBU_STARTED); } mtstart(mi) register struct mba_device *mi; { register struct buf *bp = mi->mi_tab.b_actf; register struct mu_softc *sc = &mu_softc[MUUNIT(bp->b_dev)]; if (bp->b_flags & B_READ) if (mi->mi_tab.b_errcnt == 2) return(MT_READREV|MT_GO); else return(MT_READ|MT_GO); else return(MT_WRITE|sc->sc_dens|MT_GO); } mtdtint(mi, mbsr) register struct mba_device *mi; int mbsr; { register struct mtdevice *mtaddr = (struct mtdevice *)mi->mi_drv; register struct buf *bp = mi->mi_tab.b_actf; register struct mu_softc *sc; /* I'M NOT SURE IF THIS SHOULD ALWAYS BE THE CASE SO FOR NOW... */ if ((mtaddr->mtca&3) != MUUNIT(bp->b_dev)) { printf("mt: wrong unit!\n"); mtaddr->mtca = MUUNIT(bp->b_dev); } sc = &mu_softc[MUUNIT(bp->b_dev)]; sc->sc_erreg = mtaddr->mter; if((bp->b_flags & B_READ) == 0) sc->sc_flags |= H_WRITTEN; switch (sc->sc_erreg & MTER_INTCODE) { case MTER_DONE: case MTER_LONGREC: if (mi->mi_tab.b_errcnt != 2) sc->sc_blkno++; bp->b_resid = 0; break; case MTER_NOTCAP: printf("mu%d: blank tape\n", MUUNIT(bp->b_dev)); goto err; case MTER_TM: case MTER_EOT: sc->sc_blkno++; err: bp->b_resid = bp->b_bcount; sc->sc_nxrec = dbtofsb(bp->b_blkno); break; case MTER_SHRTREC: sc->sc_blkno++; if (bp != &rmtbuf[MTUNIT(bp->b_dev)]) bp->b_flags |= B_ERROR; if (mi->mi_tab.b_errcnt == 2) bp->b_bcount = bp->b_resid; /* restore saved value */ bp->b_resid = bp->b_bcount - mtaddr->mtbc; break; case MTER_RDOPP: mi->mi_tab.b_errcnt = 2; /* indicate "read opposite" */ bp->b_resid = bp->b_bcount; /* save it */ bp->b_bcount = mtaddr->mtbc; /* use this instead */ return(MBD_RETRY); case MTER_RETRY: mi->mi_tab.b_errcnt = 1; /* indicate simple retry */ return(MBD_RETRY); case MTER_OFFLINE: if (sc->sc_openf > 0) { sc->sc_openf = -1; printf("mu%d: offline\n", MUUNIT(bp->b_dev)); } bp->b_flags |= B_ERROR; break; case MTER_FPT: printf("mu%d: no write ring\n", MUUNIT(bp->b_dev)); bp->b_flags |= B_ERROR; break; default: printf("mu%d: hard error bn%d mbsr=%b er=%x ds=%b\n", MUUNIT(bp->b_dev), bp->b_blkno, mbsr, mbsr_bits, sc->sc_erreg, sc->sc_dsreg, mtds_bits); bp->b_flags |= B_ERROR; mtaddr->mtid = MTID_CLR; /* reset the TM78 */ DELAY(250); while ((mtaddr->mtid & MTID_RDY) == 0) /* wait for it */ ; return (MBD_DONE); } /* CHECK FOR MBA ERROR WHEN NO OTHER ERROR INDICATED? */ return (MBD_DONE); } mtndtint(mi) register struct mba_device *mi; { register struct mtdevice *mtaddr = (struct mtdevice *)mi->mi_drv; register struct buf *bp = mi->mi_tab.b_actf; register struct mu_softc *sc; int er, fc, unit; unit = (mtaddr->mtner >> 8) & 3; er = MASKREG(mtaddr->mtner); /* WILL THIS OCCUR IF ANOTHER DRIVE COMES ONLINE? */ if (bp == 0 || unit != MUUNIT(bp->b_dev)) { /* consistency check */ if ((er & MTER_INTCODE) != MTER_ONLINE) printf("mt: unit %d random interrupt\n", unit); return (MBN_SKIP); } if (bp == 0) return (MBN_S((KIP); fc = (mtaddr->mtncs[unit] >> 8) & 0xff; sc = &mu_softc[unit]; sc->sc_erreg = er; sc->sc_resid = fc; switch (er & MTER_INTCODE) { case MTER_DONE: if (bp == &cmtbuf[MTUNIT(bp->b_dev)]) { done: if (bp->b_command == MT_SENSE) sc->sc_dsreg = MASKREG(mtaddr->mtds); bp->b_resid = fc; return (MBN_DONE); } /* this is UGLY! (but is it correct?) */ if ((fc = dbtofsb(bp->b_blkno) - sc->sc_blkno) < 0) sc->sc_blkno -= min(0377, -fc); else sc->sc_blkno += min(0377, fc); return (MBN_RETRY); case MTER_RWDING: return (MBN_SKIP); /* ignore "rewind started" interrupt */ case MTER_NOTCAP: printf("mu%d: blank tape\n", MUUNIT(bp->b_dev)); case MTER_TM: case MTER_EOT: case MTER_LEOT: if (sc->sc_blkno > dbtofsb(bp->b_blkno)) { sc->sc_nxrec = dbtofsb(bp->b_blkno) + fc; sc->sc_blkno = sc->sc_nxrec; } else { sc->sc_blkno = dbtofsb(bp->b_blkno) - fc; sc->sc_nxrec = sc->sc_blkno - 1; } return (MBN_RETRY); case MTER_FPT: printf("mu%d: no write ring\n", MUUNIT(bp->b_dev)); bp->b_flags |= B_ERROR; return (MBN_DONE); case MTER_OFFLINE: if (sc->sc_openf > 0) { sc->sc_openf = -1; printf("mu%d: offline\n", MUUNIT(bp->b_dev)); } bp->b_flags |= B_ERROR; return (MBN_DONE); case MTER_BOT: if (bp == &cmtbuf[MTUNIT(bp->b_dev)]) goto done; /* FALL THROUGH */ default: printf("mu%d: hard error bn%d er=%o ds=%b\n", MUUNIT(bp->b_dev), bp->b_blkno, sc->sc_erreg, sc->sc_dsreg, mtds_bits); mtaddr->mtid = MTID_CLR; /* reset the TM78 */ DELAY(250); while ((mtaddr->mtid & MTID_RDY) == 0) /* wait for it */ ; bp->b_flags |= B_ERROR; return (MBN_DONE); } /* NOTREACHED */ } mtread(dev) dev_t dev; { mtphys(dev); if (u.u_error) return; physio(mtstrategy, &rmtbuf[MTUNIT(dev)], dev, B_READ, minphys); } mtwrite(dev) { mtphys(dev); if (u.u_error) return; physio(mtstrategy, &rmtbuf[MTUNIT(dev)], dev, B_WRITE, minphys); } mtphys(dev) dev_t dev; { register int mtunit; register struct mu_softc *sc; register struct mba_device *mi; daddr_t a; mtunit = MTUNIT(dev); if (mtunit >= NMT || (mi = mtinfo[mtunit]) == 0 || mi->mi_alive == 0) { u.u_error = ENXIO; return; } a = u.u_offset >> 9; sc = &mu_softc[MUUNIT(dev)]; sc->sc_blkno = dbtofsb(a); sc->sc_nxrec = dbtofsb(a)+1; } /*ARGSUSED*/ mtioctl(dev, cmd, addr, flag) dev_t dev; int cmd; caddr_t addr; int flag; { register struct mu_softc *sc = &mu_softc[MUUNIT(dev)]; register struct buf *bp = &cmtbuf[MTUNIT(dev)]; register callcount; register int n, op; int fcount; struct mtop mtop; struct mtget mtget; /* we depend of the values and order of the MT codes here */ static mtops[] = {MT_WTM,MT_SFORWF,MT_SREVF,MT_SFORW,MT_SREV,MT_REW,MT_UNLOAD,MT_SENSE}; switch (cmd) { case MTIOCTOP: /* tape operation */ if (copyin((caddr_t)addr, (caddr_t)&mtop, sizeof(mtop))) { u.u_error = EFAULT; return; } switch(mtop.mt_op) { case MTWEOF: callcount = mtop.mt_count; fcount = 1; break; case MTFSF: case MTBSF: callcount = mtop.mt_count; fcount = 1; break; case MTFSR: case MTBSR: callcount = 1; fcount = mtop.mt_count; break; case MTREW: case MTOFFL: callcount = 1; fcount = 1; break; default: u.u_error = ENXIO; return; } if (callcount <= 0 || fcount <= 0) { u.u_error = ENXIO; return; } op = mtops[mtop.mt_op]; if (op == MT_WTM) op |= sc->sc_dens; while (--callcount >= 0) { register int n; do { n = min(fcount, 0xff); mtcommand(dev, op, n); fcount -= n; } while (fcount); if ((mtop.mt_op == MTFSR || mtop.mt_op == MTBSR) && bp->b_resid) { u.u_error = EIO; break; } if (bp->b_flags&B_ERROR) break; } geterror(bp); return; case MTIOCGET: mtget.mt_erreg = sc->sc_erreg; mtget.mt_resid = sc->sc_resid; mtcommand(dev, MT_SENSE, 1); /* update drive status */ mtget.mt_dsreg = sc->sc_dsreg; mtget.mt_type = MT_ISMT; if (copyout((caddr_t)&mtget, addr, sizeof(mtget))) u.u_error = EFAULT; return; default: u.u_error = ENXIO; } } #define DBSIZE 20 mtdump() { register struct mba_device *mi; register struct mba_regs *mp; register struct mtdevice *mtaddr; int blk, num; int start; start = 0; num = maxfree; #define phys(a,b) ((b)((int)(a)&0x7fffffff)) if (mtinfo[0] == 0) return (ENXIO); mi = phys(mtinfo[0], struct mba_device *); mp = phys(mi->mi_hd, struct mba_hd *)->mh_physmba; mp->mba_cr = MBCR_IE; mtaddr = (struct mtdevice *)&mp->mba_drv[mi->mi_drive]; #ifdef notyet mtaddr->mttc = MTTC_PDP11|MTTC_1600BPI; mtaddr->mtcs1 = MT_DCLR|MT_GO; while (num > 0) { blk = num > DBSIZE ? DBSIZE : num; mtdwrite(start, blk, mtaddr, mp); start += blk; num -= blk; } mteof(mtaddr); mteof(mtaddr); mtwait(mtaddr); if (mtaddr->mtds&MTDS_ERR) return (EIO); mtaddr->mtcs1 = MT_REW|MT_GO; return (0); } mtdwrite(dbuf, num, mtaddr, mp) register dbuf, num; register struct mtdevice *mtaddr; struct mba_regs *mp; { register struct pte *io; register int i; mtwait(mtaddr); io = mp->mba_map; for (i = 0; i < num; i++) *(int *)io++ = dbuf++ | PG_V; mtaddr->mtfc = -(num*NBPG); mp->mba_sr = -1; mp->mba_bcr = -(num*NBPG); mp->mba_var = 0; mtaddr->mtcs1 = MT_WCOM|MT_GO; } mtwait(mtaddr) struct mtdevice *mtaddr; { register s; do s = mtaddr->mtds; while ((s & MTDS_DRY) == 0); } mteof(mtaddr) struct mtdevice *mtaddr; { mtwait(mtaddr); mtaddr->mtcs1 = MT_WEOF|MT_GO; #endif notyet } #endif mba_regs *mp; { register struct pte *io; register int i; mtwait(mtaddr); io = mp->mba_map; for (i = 0; i < num; i++) *(int *)io++ = dsys/dev/tu.c 644 0 33 30360 2657033220 6244 /* tu.c 82/02/01 4.5 */ #if defined(VAX750) || defined(VAX7ZZ) /* * TU58 DECtape II device driver * * This driver controls the console TU58s on a VAX-11/750 or VAX-11/7ZZ. * It could be easily modified for a Unibus TU58. The TU58 * is treated as a block device (only). Error detection and * recovery is almost non-existant. It is assumed that the * TU58 will follow the RSP protocol exactly, very few protocol * errors are checked for. It is assumed that the 750 uses standard * RSP while the 7ZZ uses Modified RSP (MRSP). At the time when 750's * are converted to MRSP (by replacing EPROMS in the TU58), the tests * based on MRSP can be removed. */ #define NTU ((cpu == VAX_750) ? 1 : 2) #define MRSP (cpu != VAX_750) #include "../h/param.h" #include "../h/systm.h" #include "../h/buf.h" #include "../h/conf.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/mtpr.h" #include "../h/cpu.h" #define printd if(tudebug) printf #ifdef printd int tudebug; /* printd */ #endif printd #define NTUBLK 512 /* number of blocks on a TU58 cassette */ #define TUIPL ((cpu == VAX_750) ? 0x17 : 0x14) /* * Device register bits */ #define READY 0200 /* transmitter ready */ #define DONE 0200 /* receiver done */ #define IE 0100 /* interrupt enable */ #define BREAK 1 /* send break */ /* * Structure of a command packet */ struct packet { u_char pk_flag; /* indicates packet type (cmd, data, etc.) */ u_char pk_mcount; /* length of packet (bytes) */ u_char pk_op; /* operation to perform (read, write, etc.) */ char pk_mod; /* modifier for op or returned status */ u_char pk_unit; /* unit number */ u_char pk_sw; /* switches */ u_short pk_seq; /* sequence number, always zero */ u_short pk_count; /* requested byte count for read or write */ u_short pk_block; /* block number for read, write, or seek */ u_short pk_chksum; /* checksum, by words with end around carry */ }; struct packet tucmd; /* a command sent to the TU58 */ struct packet tudata; /* a command or data returned from TU58 */ /* * State information */ struct tu { u_char *rbptr; /* pointer to buffer for read */ int rcnt; /* how much to read */ u_char *wbptr; /* pointer to buffer for write */ int wcnt; /* how much to write */ int state; /* current state of tansfer operation */ int flag; /* read in progress flag */ char *addr; /* real buffer data address */ int count; /* real requested count */ int serrs; /* count of soft errors */ int cerrs; /* count of checksum errors */ int herrs; /* count of hard errors */ } tu; /* * States */ #define INIT1 0 /* sending nulls */ #define INIT2 1 /* sending inits */ #define IDLE 2 /* initialized, no transfer in progress */ #define SENDH 3 /* sending header */ #define SENDD 4 /* sending data */ #define SENDC 5 /* sending checksum */ #define SENDR 6 /* sending read command packet */ #define SENDW 7 /* sending write command packet */ #define GETH 8 /* reading header */ #define GETD 9 /* reading data */ #define GETC 10 /* reading checksum */ #define GET 11 /* reading an entire packet */ #define WAIT 12 /* waiting for continue */ /* * Packet Flags */ #define TUF_DATA 1 /* data packet */ #define TUF_CMD 2 /* command packet */ #define TUF_INITF 4 /* initialize */ #define TUF_CONT 020 /* continue */ #define TUF_XOFF 023 /* flow control */ /* * Op Codes */ #define TUOP_INIT 1 /* initialize */ #define TUOP_READ 2 /* read block */ #define TUOP_WRITE 3 /* write block */ #define TUOP_SEEK 5 /* seek to block */ #define TUOP_DIAGNOSE 7 /* run micro-diagnostics */ #define TUOP_END 0100 /* end packet */ /* * Switches */ #define TUSW_MRSP 010 /* use Modified RSP */ u_char tunull[2] = { 0, 0 }; /* nulls to send for initialization */ u_char tuinit[2] = { TUF_INITF, TUF_INITF }; /* inits to send */ int tutimer = 0; struct buf tutab; /* I/O queue header */ /* * Open the TU58 */ /*ARGSUSED*/ tuopen(dev, flag) { extern int tuwatch(); register s; #ifdef lint turintr(); tuwintr(); #endif if (minor(dev) >= NTU) { u.u_error = ENXIO; return; } if (tutimer == 0)(( { tutimer++; timeout(tuwatch, (caddr_t)0, hz); } s = splx(TUIPL); if (tu.state != IDLE) { tureset(); sleep((caddr_t)&tu, PZERO); tutab.b_active = NULL; if (tu.state != IDLE) { /* couldn't initialize */ u.u_error = ENXIO; tu.state = INIT1; tu.rcnt = tu.wcnt = 0; mtpr(CSTS, 0); mtpr(CSRS, 0); } } else mtpr(CSRS, IE); splx(s); } /* * Close the TU58 */ tuclose(dev) { if (tutab.b_active == 0) { mtpr(CSRS, 0); tutimer = 0; } if (tu.serrs + tu.cerrs + tu.herrs != 0) { /* any errors ? */ uprintf("tu%d: %d soft errors, %d chksum errors, %d hard errors\n", minor(dev), tu.serrs, tu.cerrs, tu.herrs); tu.serrs = tu.cerrs = tu.herrs = 0; } } /* * Reset the TU58 */ tureset() { tu.state = INIT1; tu.wbptr = tunull; tu.wcnt = sizeof tunull; tucmd.pk_flag = TUF_CMD; tucmd.pk_mcount = sizeof tucmd - 4; tucmd.pk_mod = 0; tucmd.pk_seq = 0; tucmd.pk_sw = MRSP ? TUSW_MRSP : 0; tutab.b_active++; mtpr(CSRS, 0); mtpr(CSTS, IE|BREAK); tuxintr(); /* start output */ return; } /* * Strategy routine for block I/O */ tustrategy(bp) register struct buf *bp; { register int s; if (bp->b_blkno >= NTUBLK) { /* block number out of range? */ bp->b_flags |= B_ERROR; iodone(bp); return; } bp->av_forw = NULL; s = splx(TUIPL); if (tutab.b_actf == NULL) tutab.b_actf = bp; else tutab.b_actl->av_forw = bp; tutab.b_actl = bp; if (tutab.b_active == NULL) tustart(); splx(s); } /* * Start the transfer */ tustart() { register struct buf *bp; if ((bp = tutab.b_actf) == NULL) return; if (tu.state != IDLE) { tureset(); return; } tutab.b_active++; tutab.b_errcnt = 0; tucmd.pk_op = bp->b_flags&B_READ ? TUOP_READ : TUOP_WRITE; tucmd.pk_unit = minor(bp->b_dev); tucmd.pk_count = tu.count = bp->b_bcount; tucmd.pk_block = bp->b_blkno; tucmd.pk_chksum = tuchk(*((short *)&tucmd), (caddr_t)&tucmd.pk_op, (int)tucmd.pk_mcount); tu.state = bp->b_flags&B_READ ? SENDR : SENDW; tu.addr = bp->b_un.b_addr; tu.count = bp->b_bcount; tu.wbptr = (u_char *)&tucmd; tu.wcnt = sizeof tucmd; tuxintr(); } /* * TU58 receiver interrupt */ turintr() { register struct buf *bp; register int c; c = mfpr(CSRD)&0xff; /* get the char, clear the interrupt */ if (MRSP) { while ((mfpr(CSTS)&READY) == 0) ; mtpr(CSTD, TUF_CONT); /* ACK */ } if (tu.rcnt) { /* still waiting for data? */ *tu.rbptr++ = c; /* yup, put it there */ if (--tu.rcnt) /* decrement count, any left? */ return; /* get some more */ } /* * We got all the data we were expecting for now, * switch on the state of the transfer. */ switch(tu.state) { case INIT2: if (c == TUF_CONT) /* did we get the expected continue? */ tu.state = IDLE; else tu.state = INIT1; /* bad news... */ tu.flag = 0; wakeup((caddr_t)&tu); tustart(); break; case WAIT: /* waiting for continue */ if (c != TUF_CONT) { tu.state = INIT1; /* bad news... */ break; } tu.flag = 0; tudata.pk_flag = TUF_DATA; tudata.pk_mcount = MIN(128, tu.count); tudata.pk_chksum = tuchk(*((short *)&tudata), (caddr_t)tu.addr, (int)tudata.pk_mcount); tu.state = SENDH; tu.wbptr = (u_char *)&tudata; tu.wcnt = 2; tuxintr(); break; case GETH: /* got header, get data */ if (tudata.pk_flag == TUF_DATA) /* data message? */ tu.rbptr = (u_char *)tu.addr; /* yes put in buffer */ tu.rcnt = tudata.pk_mcount; /* amount to get */ tu.state = GETD; break; case GETD: /* got data, get checksum */ tu.rbptr = (u_char *)&tudata.pk_chksum; tu.rcnt = sizeof tudata.pk_chksum; tu.state = GETC; break; case GET: case GETC: /* got entire packet */ #ifdef notdef if (tudata.pk_chksum != tuchk(*((short *)&tudata), tudata.pk_flag == TUF_DATA ? tu.addr : &tudata.pk_op, (int)tudata.pk_mcount)) tu.cerrs++; #endif if (tudata.pk_flag == TUF_DATA) { /* data packet, advance to next */ tu.addr += tudata.pk_mcount; tu.count -= tudata.pk_mcount; tu.state = GETH; tu.rbptr = (u_char *)&tudata; /* next packet */ tu.rcnt = 2; } else if (tudata.pk_flag==TUF_CMD && tudata.pk_op==TUOP_END) { /* end packet, idle and reenable transmitter */ tu.state = IDLE; tu.flag = 0; mtpr(CSTS, IE); printd("ON "); if ((bp = tutab.b_actf) == NULL) { printf("tu: no bp!\n"); printf("active %d\n", tutab.b_active); tustart(); return; } if (tudata.pk_mod < 0) { /* hard error */ bp->b_flags |= B_ERROR; tu.herrs++; harderr(bp, "tu"); printf(" pk_mod %d\n", -tudata.pk_mod); } else if (tudata.pk_mod > 0) /* soft error */ tu.serrs++; tutab.b_active = NULL; tutab.b_actf = bp->av_forw; bp->b_resid = tu.count; iodone(bp); tustart(); } else { printf("neither data nor end: %o %o\n", tudata.pk_flag&0xff, tudata.pk_op&0xff); mtpr(CSRS, 0); /* flush the rest */ tu.state = INIT1; } break; case IDLE: case INIT1: break; default: if (c == TUF_INITF) { printf("TU protocol error, state %d\n", tu.state); printf("%o %d %d\n", tucmd.pk_op, tucmd.pk_count, tucmd.pk_block); tutab.b_active = NULL; if (bp = tutab.b_actf) { bp->b_flags |= B_ERROR; tutab.b_actf = bp->av_forw; iodone(bp); } tu.state = INIT1; } else { printf("TU receive state error %d %o\n", tu.state, c); /* tu.state = INIT1; */ wakeup((caddr_t)&tu); } } } /* * TU58 transmitter interrupt */ tuxintr() { top: if (tu.wcnt) { /* still stuff to send, send one byte */ while ((mfpr(CSTS) & READY) == 0) ; mtpr(CSTD, *tu.wbptr++); tu.wcnt--; return; } /* * Last message byte was sent out. * Switch on state of transfer. */ printd("tuxintr: state %d\n", tu.state); switch(tu.state) { case INIT1: /* two nulls sent, remove break, send inits */ mtpr(CSTS, IE); printd("ON2 "); tu.state = INIT2; tu.wbptr = tuinit; tu.wcnt = sizeof tuinit; goto top; case INIT2: /* inits sent, wait for continue */ (void) mfpr(CSRD); mtpr(CSRS, IE); tu.flag = 1; break; case IDLE: /* stray interrupt? */ break; case SENDR: /* read cmd packet sent, get ready for data */ tu.state = GETH; tu.rbptr = (u_char *)&tudata; tu.rcnt = 2; tu.flag = 1; mtpr(CSTS, 0); /* disable transmitter interrupts */ printd("OFF "); break; case SENDW: /* write cmd packet sent, wait for continue */ tu.state = WAIT; tu.flag = 1; if ((mfpr(CSRS)&IE) == 0) { printf("NO IE\n"); mtpr(CSRS, IE); } break; case SENDH: /* header sent, send data */ tu.state = SENDD; tu.wbptr = (u_char *)tu.addr; tu.wcnt = tudata.pk_mcount; goto top; case SENDD: /* data sent, send checksum */ tu.state = SENDC; tu.wbptr = (u_char *)&tudata.pk_chksum; tu.wcnt = sizeof tudata.pk_chksum; goto top; case SENDC: /* checksum sent, wait for continue */ tu.addr += tudata.pk_mcount; /* update buffer address */ tu.count -= tudata.pk_mcount; /* and count */ if (tu.count == 0) { /* all done? */ tu.state = GET; /* set up to get end packet */ tu.rbptr = (u_char *)&tudata; tu.rcnt = sizeof tudata; tu.flag = 1; mtpr(CSTS, 0); printd("OFF2 "); } else { tu.state = WAIT; /* wait for continue */ tu.flag = 1; } break; default: /* random interrupt, probably from MRSP ACK */ break; } printd(" new state %d\n", tu.state); } /* * Compute checksum TU58 fashion */ tuchk(word, cp, n) register word; register unsigned short *cp; { register c = n >> 1; register long temp; do { temp = *cp++; /* temp, only because vax cc won't *r++ */ word += temp; } while (--c > 0); if (n & 1) word += *(unsigned char *)cp; while (word & 0xFFFF0000) word = (word & 0xFFFF) + (word >> 16); return (word); } tuwatch() { register int s; register struct buf *bp; if (tutimer == 0) { tu.flag = 0; return; } if (tu.flag) tu.flag++; if (tu.flag > 40) { printf("tu: read stalled\n"); printf("%X %X %X %X %X %X %X %X\n", tu.rbptr, tu.rcnt, tu.wbptr, tu.wcnt, tu.state, tu.flag, tu.addr, tu.count); tu.flag = 0; s = splx(TUIPL); (void) mfpr(CSRD); mtpr(CSRS, IE); /* in case we were flushing */ mtpr(CSTS, IE); tu.state = IDLE; if (tutab.b_active) { if (++tutab.b_errcnt > 1) { if (bp = tutab.b_actf) { bp->b_flags |= B_ERROR; iodone(bp); } } else tustart(); } else wakeup((caddr_t)&tu); splx(s); } timeout(tuwatch, (caddr_t)0, hz); } #endif printf("%X %X %X %X %X %X %X %X\n", tu.rbptr, tu.rcnt, tu.wbptr, tu.wcnt, tu.state, tu.flag, tu.addr, tu.count); tu.flag = 0; s = splx(TUIPL); (void) mfpr(CSRD); mtpr(CSRS, IE); /* in case we were flushing */ mtpr(CSTS, IE); tu.state = IDLE; if (tutab.bsys/dev/uda.c 444 0 33 46577 2624051633 6406 /* uda.c 1.2 81/10/27 */ #include "ra.h" #if NUDA > 0 /* * UDA50/RAxx disk device driver * * Restrictions: * Unit numbers must be less than 8. * * TO DO: * write dump code * test on 750 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/buf.h" #include "../h/conf.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/pte.h" #include "../h/map.h" #include "../h/vm.h" #include "../h/ubareg.h" #include "../h/ubavar.h" #include "../h/dk.h" #include "../h/cpu.h" #include "../h/cmap.h" int udadebug; #define printd if(udadebug&1)printf /* * Parameters for the communications area */ #define NRSPL2 3 #define NCMDL2 3 #define NRSP (1<sc_ivec = (uba_hd[numuba].uh_lastiv -= 4); return(1); } udslave(ui, reg) struct uba_device *ui; caddr_t reg; { /* * TOO HARD TO FIND OUT IF DISK IS THERE UNTIL * INITIALIZED. WE'LL FIND OUT WHEN WE FIRST * TRY TO ACCESS IT. */ return(1); } udattach(ui) register struct uba_device *ui; { if (ui->ui_dk > 0) dk_mspw[ui->ui_dk] = 1.0 / (60 * 31 * 256); /* approx */ ui->ui_flags = 0; udip[ui->ui_ctlr][ui->ui_slave] = ui; radsize[ui->ui_unit] = (daddr_t)0xffffff; /* max possible size */ } /* * Open a UDA. Initialize the device and * set the unit online. */ udopen(dev, flag) dev_t dev; int flag; { register int unit; register struct uba_device *ui; register struct uda_softc *sc; unit = minor(dev) >> 3; if (unit >= NRA || (ui = uddinfo[unit]) == 0 || ui->ui_alive == 0) { u.u_error = ENXIO; return; } sc = &uda_softc[ui->ui_ctlr]; (void) spl5(); if (sc->sc_state != S_RUN) { if (sc->sc_state == S_IDLE) udinit(ui->ui_ctlr); sleep(ui->ui_mi, 0); /* wait for initialization to complete */ if (sc->sc_state != S_RUN) { u.u_error = EIO; return; } } (void) spl0(); /* SHOULD PROBABLY FORCE AN ONLINE ATTEMPT TO SEE IF DISK IS REALLY THERE */ } /* * Initialize a UDA. Set up UBA mapping registers, * initialize data structures, and start hardware * initialization sequence. */ udinit(d) int d; { register struct uda_softc *sc; register struct uda *ud; struct udadevice *udaddr; struct uba_ctlr *um; sc = &uda_softc[d]; um = udminfo[d]; um->um_tab.b_active++; ud = &uda[d]; udaddr = (struct udadevice *)um->um_addr; if (sc->sc_mapped == 0) { /* * Map the communications area and command * and response packets into Unibus address * space. */ sc->sc_ubainfo = uballoc(um->um_ubanum, (caddr_t)ud, sizeof (struct uda), 0); sc->sc_uda = (struct uda *)(sc->sc_ubainfo & 0x3ffff); sc->sc_mapped = 1; } /* * Start the hardware initialization sequence. */ udaddr->udaip = 0; /* start initialization */ while ((udaddr->udasa & UDA_STEP1) == 0) ; udaddr->udasa = UDA_ERR|(NCMDL2<<11)|(NRSPL2<<8)|UDA_IE|(sc->sc_ivec/4); /* * Initialization continues in interrupt routine. */ sc->sc_state = S_STEP1; sc->sc_credits = 0; } udstrategy(bp) register struct buf *bp; { register struct uba_device *ui; register struct uba_ctlr *um; register struct buf *dp; register int unit; int xunit = minor(bp->b_dev) & 07; daddr_t sz, maxsz; sz = (bp->b_bcount+511) >> 9; unit = dkunit(bp); if (unit >= NRA) goto bad; ui = uddinfo[unit]; um = ui->ui_mi; if (ui == 0 || ui->ui_alive == 0) goto bad; if ((maxsz = ra_sizes[xunit].nblocks) < 0) maxsz = radsize[unit] - ra_sizes[xunit].blkoff; if (bp->b_blkno < 0 || bp->b_blkno+sz > maxsz || ra_sizes[xunit].blkoff >= radsize[unit]) goto bad; (void) spl5(); /* * Link the buffer onto the drive queue */ dp = &udutab[ui->ui_unit]; if (dp->b_actf == 0) dp->b_actf = bp; else dp->b_actl->av_forw = bp; dp->b_actl = bp; bp->av_forw = 0; /* * Link the drive onto the controller queue */ if (dp->b_active == 0) { dp->b_forw = NULL; if (um->um_tab.b_actf == NULL) um->um_tab.b_actf = dp; else um->um_tab.b_actl->b_forw = dp; um->um_tab.b_actl = dp; dp->b_active = 1; } if (um->um_tab.b_active == 0) { #if defined(VAX750) if (cpu == VAX_750) { if (um->um_ubinfo != 0) printf("uda: ubinfo %x\n",um->um_ubinfo); else um->um_ubinfo = uballoc(um->um_ubanum, 0, 0, UBA_NEEDBDP); } #endif (void) udstart(um); } (void) spl0(); return; bad: bp->b_flags |= B_ERROR; iodone(bp); return; } udstart(um) register struct uba_ctlr *um; { register struct buf *bp, *dp; register struct mscp *mp; register struct uda_softc *sc; register struct uba_device *ui; struct udadevice *udaddr; int i; sc = &uda_softc[um->um_ctlr]; loop: if ((dp = um->um_tab.b_actf) == NULL) { /* * Release uneeded UBA resources and return */ um->um_tab.b_active = 0; #if defined(VAX750) if (cpu == VAX_750) { if (um->um_ubinfo == 0) printf("uda: um_ubinfo == 0\n"); else ubarelse(um->um_ubanum, &um->um_ubinfo); } #endif return(0); } if ((bp = dp->b_actf) == NULL) { /* * No more requests for this drive, remove * from controller queue and look at next drive. * We know we're at the head of the controller queue. */ dp->b_active = 0; um->um_tab.b_actf = dp->b_forw; goto loop; } um->um_tab.b_active++; udaddr = (struct udadevice *)um->um_addr; if ((udaddr->udasa&UDA_ERR) || sc->sc_state != S_RUN) { harderr(bp, "ra"); printf("udasa %o, state %d\n", udaddr->udasa&0xffff, sc->sc_state); udinit(um->um_ctlr); /* SHOULD REQUEUE OUTSTANDING REQUESTS, LIKE UDRESET */ return; } ui = uddinfo[dkunit(bp)]; /* * If no credits, can't issue any commands * until some outstanding commands complete. */ if (sc->sc_credits < 2) return(0); if ((mp = udgetcp(um)) == NULL) return(0); sc->sc_credits--; /* committed to issuing a command */ if (ui->ui_flags == 0) { /* not online */ mp->mscp_opcode = M_OP_ONLIN; mp->mscp_unit = ui->ui_slave; dp->b_active = 2; um->um_tab.b_actf = dp->b_forw; /* remove from controller q */ printd("uda: bring unit %d online\n", ui->ui_slave); *((long *)mp->mscp_dscptr) |= UDA_OWN|UDA_INT; i = udaddr->udaip; goto loop; } switch (cpu) { case VAX_780: i = UBA_NEEDBDP|UBA_CANTWAIT; break; case VAX_750: i = um->um_ubinfo|UBA_HAVEBDP|UBA_CANTWAIT; break; case VAX_7ZZ: i = UBA_CANTWAIT; break; } if ((i = ubasetup(um->um_ubanum, bp, i)) == 0) { mp->mscp_opcode = M_OP_GTUNT; mp->mscp_unit = ui->ui_slave; *((long *)mp->mscp_dscptr) |= UDA_OWN|UDA_INT; i = udaddr->udaip; /* initiate polling */ return(1); /* wait for interrupt */ } mp->mscp_cmdref = (long)bp; /* pointer to get back */ mp->mscp_opcode = bp->b_flags&B_READ ? M_OP_READ : M_OP_WRITE; mp->mscp_unit = ui->ui_slave; mp->mscp_lbn = bp->b_blkno + ra_sizes[minor(bp->b_dev)&7].blkoff; mp->mscp_bytecnt = bp->b_bcount; mp->mscp_buffer = (i & 0x3ffff) | (((i>>28)&0xf)<<24); #if defined(VAX750) if (cpu == VAX_750) i &= 0xfffffff; /* mask off bdp */ #endif bp->b_ubinfo = i; /* save mapping info */ *((long *)mp->mscp_dscptr) |= UDA_OWN|UDA_INT; i = udaddr->udaip; /* initiate polling */ if (ui->ui_dk >= 0) { dk_busy |= 1<ui_dk; dp->b_qsize++; dk_xfer[ui->ui_dk]++; dk_wds[ui->ui_dk] += bp->b_bcount>>6; } /* * Move drive to the end of the controller queue */ if (dp->b_forw != NULL) { um->um_tab.b_actf = dp->b_forw; um->um_tab.b_actl->b_forw = dp; um->um_tab.b_actl = dp; dp->b_forw = NULL; } /* * Move buffer to I/O wait queue */ dp->b_actf = bp->av_forw; dp = &udwtab[um->um_ctlr]; bp->av_forw = dp; bp->av_back = dp->av_back; dp->av_back->av_forw = bp; dp->av_back = bp; goto loop; } /* * UDA interrupt routine. */ udintr(d) int d; { register struct uba_ctlr *um = udminfo[d]; register struct udadevice *udaddr = (struct udadevice *)um->um_addr; struct buf *bp; register int i; register struct uda_softc *sc = &uda_softc[d]; register struct uda *ud = &uda[d]; struct uda *uud; struct mscp *mp; printd("udintr: state %d, udasa %o\n", sc->sc_state, udaddr->udasa); switch (sc->sc_state) { case S_IDLE: printf("uda%d: random interrupt ignored\n", d); return; case S_STEP1: #define STEP1GOOD (UDA_STEP2|UDA_IE|(NCMDL2<<3)|NRSPL2) if ((udaddr->udasa&(UDA_ERR|STEP1GOOD)) != STEP1GOOD) { sc->sc_state = S_IDLE; wakeup(um); return; } udaddr->udasa = ((int)&sc->sc_uda->uda_ca.ca_ringbase)| (cpu == VAX_780 ? UDA_PI : 0); sc->sc_state = S_STEP2; return; case S_STEP2: #define STEP2GOOD (UDA_STEP3|UDA_IE|(sc->sc_ivec/4)) if ((udaddr->udasa&(UDA_ERR|STEP2GOOD)) != STEP2GOOD) { sc->sc_state = S_IDLE; wakeup(um); return; } udaddr->udasa = ((int)&sc->sc_uda->uda_ca.ca_ringbase)>>16; sc->sc_state = S_STEP3; return; case S_STEP3: #define STEP3GOOD UDA_STEP4 if ((udaddr->udasa&(UDA_ERR|STEP3GOOD)) != STEP3GOOD) { sc->sc_state = S_IDLE; wakeup(um); return; } udaddr->udasa = UDA_GO; sc->sc_state = S_SCHAR; /* * Initialize the data structures. */ uud = sc->sc_uda; f((or (i = 0; i < NRSP; i++) { ud->uda_ca.ca_rspdsc[i] = UDA_OWN|UDA_INT| (long)&uud->uda_rsp[i].mscp_cmdref; ud->uda_rsp[i].mscp_dscptr = &ud->uda_ca.ca_rspdsc[i]; ud->uda_rsp[i].mscp_header.uda_msglen = sizeof (struct mscp); } for (i = 0; i < NCMD; i++) { ud->uda_ca.ca_cmddsc[i] = UDA_INT| (long)&uud->uda_cmd[i].mscp_cmdref; ud->uda_cmd[i].mscp_dscptr = &ud->uda_ca.ca_cmddsc[i]; ud->uda_cmd[i].mscp_header.uda_msglen = sizeof (struct mscp); } bp = &udwtab[d]; bp->av_forw = bp->av_back = bp; sc->sc_lastcmd = 0; sc->sc_lastrsp = 0; if ((mp = udgetcp(um)) == NULL) { sc->sc_state = S_IDLE; wakeup(um); return; } mp->mscp_opcode = M_OP_STCON; mp->mscp_cntflgs = M_CF_ATTN|M_CF_MISC|M_CF_THIS; *((long *)mp->mscp_dscptr) |= UDA_OWN|UDA_INT; i = udaddr->udaip; /* initiate polling */ return; case S_SCHAR: case S_RUN: break; default: printf("uda%d: interrupt in unknown state %d ignored\n", d, sc->sc_state); return; } if (udaddr->udasa&UDA_ERR) { printf("uda%d: fatal error (%o)\n", d, udaddr->udasa&0xffff); udaddr->udaip = 0; wakeup(um); } /* * Check for a buffer purge request. */ if (ud->uda_ca.ca_bdp) { /* * THIS IS A KLUDGE. * Maybe we should change the entire * UBA interface structure. */ int s = spl7(); i = um->um_ubinfo; printd("uda: purge bdp %d\n", ud->uda_ca.ca_bdp); um->um_ubinfo = ud->uda_ca.ca_bdp<<28; ubapurge(um); um->um_ubinfo = i; (void) splx(s); ud->uda_ca.ca_bdp = 0; udaddr->udasa = 0; /* signal purge complete */ } /* * Check for response ring transition. */ if (ud->uda_ca.ca_rspint) { ud->uda_ca.ca_rspint = 0; for (i = sc->sc_lastrsp;; i++) { i %= NRSP; if (ud->uda_ca.ca_rspdsc[i]&UDA_OWN) break; udrsp(um, ud, sc, i); ud->uda_ca.ca_rspdsc[i] |= UDA_OWN; } sc->sc_lastrsp = i; } /* * Check for command ring transition. */ if (ud->uda_ca.ca_cmdint) { printd("uda: command ring transition\n"); ud->uda_ca.ca_cmdint = 0; } udstart(um); } /* * Process a response packet */ udrsp(um, ud, sc, i) register struct uba_ctlr *um; register struct uda *ud; register struct uda_softc *sc; int i; { register struct mscp *mp; struct uba_device *ui; struct buf *dp, *bp; int st; mp = &ud->uda_rsp[i]; mp->mscp_header.uda_msglen = sizeof (struct mscp); sc->sc_credits += mp->mscp_header.uda_credits & 0xf; if ((mp->mscp_header.uda_credits & 0xf0) > 0x10) return; /* * If it's an error log message (datagram), * pass it on for more extensive processing. */ if ((mp->mscp_header.uda_credits & 0xf0) == 0x10) { uderror(um, (struct mslg *)mp); return; } if (mp->mscp_unit >= 8) return; if ((ui = udip[um->um_ctlr][mp->mscp_unit]) == 0) return; st = mp->mscp_status&M_ST_MASK; switch (mp->mscp_opcode) { case M_OP_STCON|M_OP_END: if (st == M_ST_SUCC) sc->sc_state = S_RUN; else sc->sc_state = S_IDLE; um->um_tab.b_active = 0; wakeup(um); break; case M_OP_ONLIN|M_OP_END: /* * Link the drive onto the controller queue */ dp = &udutab[ui->ui_unit]; dp->b_forw = NULL; if (um->um_tab.b_actf == NULL) um->um_tab.b_actf = dp; else um->um_tab.b_actl->b_forw = dp; um->um_tab.b_actl = dp; if (st == M_ST_SUCC) { ui->ui_flags = 1; /* mark it online */ radsize[ui->ui_unit] = (daddr_t)mp->mscp_untsize; printd("uda: unit %d online\n", mp->mscp_unit); } else { harderr(dp->b_actf, "ra"); printf("OFFLINE\n"); while (bp = dp->b_actf) { dp->b_actf = bp->av_forw; bp->b_flags |= B_ERROR; iodone(bp); } } dp->b_active = 1; break; case M_OP_AVATN: printd("uda: unit %d attention\n", mp->mscp_unit); ui->ui_flags = 0; /* it went offline and we didn't notice */ break; case M_OP_READ|M_OP_END: case M_OP_WRITE|M_OP_END: bp = (struct buf *)mp->mscp_cmdref; ubarelse(um->um_ubanum, &bp->b_resid); /* * Unlink buffer from I/O wait queue. */ bp->av_back->av_forw = bp->av_forw; bp->av_forw->av_back = bp->av_back; dp = &udutab[ui->ui_unit]; if (ui->ui_dk >= 0) if (--dp->b_qsize == 0) dk_busy &= ~(1<ui_dk); if (st == M_ST_OFFLN || st == M_ST_AVLBL) { ui->ui_flags = 0; /* mark unit offline */ /* * Link the buffer onto the front of the drive queue */ if ((bp->av_forw = dp->b_actf) == 0) dp->b_actl = bp; dp->b_actf = bp; /* * Link the drive onto the controller queue */ if (dp->b_active == 0) { dp->b_forw = NULL; if (um->um_tab.b_actf == NULL) um->um_tab.b_actf = dp; else um->um_tab.b_actl->b_forw = dp; um->um_tab.b_actl = dp; dp->b_active = 1; } return; } if (st != M_ST_SUCC) { harderr(bp, "ra"); printf("status %o\n", mp->mscp_status); bp->b_flags |= B_ERROR; } bp->b_resid = bp->b_bcount - mp->mscp_bytecnt; iodone(bp); break; case M_OP_GTUNT|M_OP_END: break; default: printf("uda: unknown packet\n"); } } /* * Process an error log message * * For now, just log the error on the console. * Only minimal decoding is done, only "useful" * information is printed. Eventually should * send message to an error logger. */ uderror(um, mp) register struct uba_ctlr *um; register struct mslg *mp; { printf("uda%d:%d: %s error, ", um->um_ctlr, mp->mslg_seqnum, mp->mslg_flags&M_LF_SUCC ? "soft" : "hard"); switch (mp->mslg_format) { case M_FM_CNTERR: printf("controller error, event 0%o\n", mp->mslg_event); break; case M_FM_BUSADDR: printf("host memory access error, event 0%o, addr 0%o\n", mp->mslg_event, *((long *)&mp->mslg_busaddr[0])); break; case M_FM_DISKTRN: printf("disk transfer error, unit %d, grp %d, cyl %d, sec %d, ", mp->mslg_unit, mp->mslg_group, mp->mslg_cylinder, mp->mslg_sector); printf("trk %d, lbn %d, retry %d, level %d\n", mp->mslg_track, mp->mslg_lbn, mp->mslg_retry, mp->mslg_level); break; case M_FM_SDI: printf("SDI error, unit %d, event 0%o, cyl %d\n", mp->mslg_unit, mp->mslg_event, mp->mslg_cylinder); break; case M_FM_SMLDSK: printf("small disk error, unit %d, event 0%o, cyl %d\n", mp->mslg_unit, mp->mslg_event, mp->mslg_sdecyl); break; default: printf("unknown error, unit %d, format 0%o, event 0%o\n", mp->mslg_unit, mp->mslg_format, mp->mslg_event); } } /* * Find an unused command packet */ struct mscp * udgetcp(um) struct uba_ctlr *um; { register struct mscp *mp; register struct udaca *cp; register struct uda_softc *sc; register int i; cp = &uda[um->um_ctlr].uda_ca; sc = &uda_softc[um->um_ctlr]; i = sc->sc_lastcmd; if ((cp->ca_cmddsc[i] & (UDA_OWN|UDA_INT)) == UDA_INT) { cp->ca_cmddsc[i] &= ~UDA_INT; mp = &uda[um->um_ctlr].uda_cmd[i]; mp->mscp_unit = mp->mscp_modifier = 0; mp->mscp_opcode = mp->mscp_flags = 0; mp->mscp_bytecnt = mp->mscp_buffer = 0; mp->mscp_errlgfl = mp->mscp_copyspd = 0; sc->sc_lastcmd = (i + 1) % NCMD; return(mp); } return(NULL); } udread(dev) dev_t dev; { register int unit = minor(dev) >> 3; if (unit >= NRA) u.u_error = ENXIO; else physio(udstrategy, &rudbuf[unit], dev, B_READ, minphys); } udwrite(dev) dev_t dev; { register int unit = minor(dev) >> 3; if (unit >= NRA) u.u_error = ENXIO; else physio(udstrategy, &rudbuf[unit], dev, B_WRITE, minphys); } udreset(uban) int uban; { register struct uba_ctlr *um; register struct uba_device *ui; register struct buf *bp, *dp; register int unit; struct buf *nbp; int d; for (d = 0; d < NUDA; d++) { if ((um = udminfo[d]) == 0 || um->um_ubanum != uban || um->um_alive == 0) continue; printf(" uda%d", d); um->um_tab.b_active = 0; um->um_tab.b_actf = um->um_tab.b_actl = 0; uda_softc[d].sc_state = S_IDLE; for (unit = 0; unit < NRA; unit++) { if ((ui = uddinfo[unit]) == 0) continue; if (ui->ui_alive == 0 || ui->ui_mi != um) continue; udutab[unit].b_active = 0; udutab[unit].b_qsize = 0; } for (bp = udwtab[d].av_forw; bp != &udwtab[d]; bp = nbp) { nbp = bp->av_forw; ubarelse(uban, &bp->b_ubinfo); /* * Link the buffer onto the drive queue */ dp = &udutab[dkunit(bp)]; if (dp->b_actf == 0) dp->b_actf = bp; else dp->b_actl->av_forw = bp; dp->b_actl = bp; bp->av_forw = 0; /* * Link the drive onto the controller queue */ if (dp->b_active == 0) { dp->b_forw = NULL; if (um->um_tab.b_actf == NULL) um->um_tab.b_actf = dp; else um->um_tab.b_actl->b_forw = dp; um->um_tab.b_actl = dp; dp->b_active = 1; } } udinit(d); } } uddump() { return(ENXIO); } fer onto the drive queue */ dp = &udutab[dkunit(bp)]; if (dp->b_actf == 0) dp->b_actf = bp; else dp->b_actl-sys/mdec/ 775 0 33 0 2650355330 5477 sys/mdec/Makefile 644 0 33 3127 2650355352 7231 ALL= htboot mtboot tmboot tsboot hpboot hkboot upboot noboot noboot \ httoggle mttoggle tmtoggle tstoggle all: ${ALL} htboot: htboot.s as htboot.s nm -u a.out strip a.out dd if=a.out of=b.out bs=32 skip=1 dd if=b.out of=htboot conv=sync mtboot: mtboot.s as mtboot.s nm -u a.out strip a.out dd if=a.out of=b.out bs=32 skip=1 dd if=b.out of=mtboot conv=sync tmboot: tmboot.s as tmboot.s nm -u a.out strip a.out dd if=a.out of=b.out bs=32 skip=1 dd if=b.out of=tmboot conv=sync tsboot: tsboot.s(( as tsboot.s nm -u a.out strip a.out dd if=a.out of=b.out bs=32 skip=1 dd if=b.out of=tsboot conv=sync hpboot: hpboot.s as hpboot.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=b.out dd if=b.out of=hpboot conv=sync hkboot: hkboot.s as hkboot.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=b.out dd if=b.out of=hkboot conv=sync upboot: upboot.s as upboot.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=b.out dd if=b.out of=upboot conv=sync httoggle: httoggle.s as httoggle.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=httoggle mttoggle: mttoggle.s as mttoggle.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=mttoggle tstoggle: tstoggle.s as tstoggle.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=tstoggle tmtoggle: tmtoggle.s as tmtoggle.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=tmtoggle noboot: echo | dd of=noboot conv=sync clean: rm -f a.out b.out ${ALL} install: cp *boot /usr/mdec rm -f /usr/mdec/mboot ln /usr/mdec/htboot /usr/mdec/mboot rm -f /usr/mdec/uboot ln /usr/mdec/hpboot /usr/mdec/uboot ggle.s as mttoggle.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=mttoggle tstoggle: tstoggle.s as tstoggle.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=tstoggle tmtoggle: tmtoggle.s as tmtoggle.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=tmtoggle noboot: echo | dd of=noboot conv=sync clean: rm -f a.out b.out ${ALL} install: cp *boot /usr/mdec rm -f /usr/mdec/mboot ln /usr/msys/mdec/htboot.s 644 0 33 13665 2527153643 7306 /* * VAX tape boot block for distribution tapes * works on massbus tu10/te16/tu45/tu77 * * reads a program from a tp directory on a tape and executes it * program must be stripped of the header and is loaded ``bits as is'' * you can return to this loader via ``ret'' as you are called ``calls $0,ent'' */ .set RELOC,0x70000 /* a.out defines */ .set HDRSIZ,040 /* size of file header for VAX */ .set MAGIC,0410 /* file type id in header */ .set TSIZ,4 /* text size */ .set DSIZ,8 /* data size */ .set BSIZ,12 /* bss size */ .set TENT,024 /* task header entry loc */ /* tp directory definitions */ .set FILSIZ,38 /* tp direc offset for file size */ .set BNUM,44 /* tp dir offset for start block no. */ .set ENTSIZ,64 /* size of 1 TP dir entry, bytes */ .set PTHSIZ,32 /* size of TP path name, bytes */ .set BLKSIZ,512 /* tape block size, bytes */ .set NUMDIR,24 /* no. of dir blocks on tape */ .set ENTBLK,8 /* no. of dir entries per tape block */ /* processor registers and bits */ .set RXCS,32 .set RXDB,33 .set TXCS,34 .set TXDB,35 .set RXCS_DONE,0x80 .set TXCS_RDY,0x80 .set TXCS_pr,7 /* bit position of TXCS ready bit */ .set RXCS_pd,7 /* bit position of RXCS done bit */ /* MBA registers */ .set MBA_CSR,0 /* configuration and status register */ .set MBA_CR,4 /* MBA control reg */ .set MBA_SR,8 /* MBA status reg */ .set MBA_VAR,12 /* MBA virt addr reg */ .set MBA_BCR,16 /* MBA byte count reg */ .set MBA_MAP,0x800 /* start of MBA map reg's */ .set MRV,0x80000000 /* TE16/TU45/TU77 mba registers */ .set HTCS1,0 /* HT control 1 reg */ .set HTDS,4 /* status reg */ .set HTER,8 /* error reg */ .set HTAS,16 /* attention summary */ .set HTFC,20 /* frame count */ .set HTTC,36 /* HT tape control */ /* HT commands */ .set GO,1 /* GO bit */ .set HT_REW,6 /* rewind, on-line */ .set HT_DCLR,010 /* drive clear */ .set HT_SREV,032 /* space reverse */ .set HT_RCOM,070 /* read forward */ /* HT bits */ .set ERR,040000 /* composite error bit in status reg */ .set TCHAR,012300 /* unit 0, odd parity, PDP11, 1600 BPI NRZ, */ /* abort on error - for tape controller */ .set DRDY,0200 /* HT/drive ready in status reg */ .set HT_pd,7 /* bit position of HT DRDY bit */ .set HT_pe,14 /* bit position of HT ERROR bit */ /* local stack variables */ .set tapa,-4 /* desired tape addr */ .set mtapa,-8 /* current tape addr */ .set name,-8-PTHSIZ /* operator-typed file name */ /* register usage */ .set rMBA,r10 .set rHT,r11 /* initialization */ init: mull2 $0x80,%rHT addl2 $0x400,%rHT addl2 %rMBA,%rHT movl $RELOC,fp /* core loc to which to move this program */ addl3 $name,fp,sp /* set stack pointer, leaving room for locals */ clrl r0 1: movc3 $end,(r0),(fp) /* move boot up to relocated position */ jmp start+RELOC start: movl $1,MBA_CR(%rMBA) /* MBA init */ movl $TCHAR,HTTC(%rHT) /* drive no., etc. */ movl $HT_DCLR+GO,HTCS1(%rHT) /* drive clear */ bsbw rew /* rewind input tape */ movab name(fp),r4 /* start of filename storage */ movzbl $'=,r0 /* prompt character */ bsbw putc /* output char to main console */ /* read in a file name */ movl r4,r1 /* loc at which to store file name */ nxtc: bsbw getc /* get input char's in file name */ cmpb r0,$012 /* terminator ? */ beql nullc movb r0,(r1)+ brb nxtc nullc: subl3 r4,r1,r9 /* size of path name */ beql start /* dumb operator */ clrb (r1)+ incl r9 /* user-specified TP filename has been stored at name(fp) */ /* read in entire tp directory contents into low core */ dirred: movl $8,tapa(fp) /* tp directory starts at block 8 */ movl $(NUMDIR*BLKSIZ),r6 /* no. bytes in total dir */ bsbw taper /* read no. bytes indicated */ /* search entire directory for user-specified file name */ clrl r5 /* dir buff loc = 0 */ nxtdir: cmpc3 r9,(r5),(r4) /* see if dir entry matches filename */ beql fndfil /* found match */ acbl $NUMDIR*BLKSIZ-1,$ENTSIZ,r5,nxtdir /* see if done with tp dir */ brw start /* entry not in directory; start over */ /* found desired tp dir entry */ fndfil: movzwl BNUM(r5),tapa(fp) /* start block no., 2 bytes */ addl2 $7,tapa(fp) /* skip 7 boot blocks */ movzwl FILSIZ(r5),r6 /* low 2 bytes file size */ insv FILSIZ-1(r5),$16,$8,r6 /* file size, high byte */ cmpl r6,$RELOC-512 /* check if file fits below stack */ blss filok /* file o.k. */ brw start /* file too large */ /* time to read in desired file from tape */ filok: movl r6,r7 /* save r6 */ bsbb taper bsbw rew /* clear core */ subl3 r7,$RELOC-4,r0 /* no. bytes to clear */ 1: clrb (r7)+ sobgtr r0,1b /* time to jump to start of file & execute */ addl3 $20,fp,ap clrl r5 calls $0,(r5) brw start /* taper: movcTAPE (r6),tapa(fp),0 */ rew2: bsbb rew /* beginning of tape */ taper0: bsbb rrec /* advance 1 block; never want blk0 */ taper: clrl r0 /* page no. */ cmpl mtapa(fp),tapa(fp) /* current position .vs. desired */ bgtr rew2 blss taper0 1: bsbb rrec acbl $1,$-BLKSIZ,r6,1b rsb /* rew: rewind the tape */ rew: clrl mtapa(fp) /* current position */ movl $HT_REW+GO,HTCS1(%rHT) /* rewind */ rsb /* rrec: read 1 block from mag tape into page (r0) */ rrec: /* pushl r0; movzbl $'r,r0; bsbw putc; movl (sp)+,r0; */ movl HTDS(%rHT),r2 bbc $HT_pd,r2,rrec /* HT & drive ready ? */ movl $-BLKSIZ,MBA_BCR(%rMBA) bisl3 $MRV,r0,MBA_MAP(%rMBA) clrl MBA_VAR(%rMBA) movl $HT_RCOM+GO,HTCS1(%rHT) /* read forward */ 1: movl HTDS(%rHT),r2 bbc $HT_pd,r2,1b movl HTER(%rHT),r2 bbc $HT_pe,r2,2f /* any read errors ? */ clrl HTDS(%rHT) /* clear status - try to recover */ mnegl $1,HTFC(%rHT) /* frame count for backspace */ movl $HT_SREV+GO,HTCS1(%rHT) /* space reverse */ brb rrec 2: incl r0 /* next page no. */ incl mtapa(fp) /* mag tape block position */ rsb getc: mfpr $RXCS,r0 bbc $RXCS_pd,r0,getc /* receiver ready ? */ mfpr $RXDB,r0 extzv $0,$7,r0,r0 cmpb r0,$015 bneq putc bsbb putc movb $0,r0 bsbb putc movb $012,r0 putc: mfpr $TXCS,r2 bbc $TXCS_pr,r2,putc /* transmitter ready ? */ extzv $0,$7,r0,r0 mtpr r0,$TXDB rsb end: tatus - try to recover */ mnegl $1,HTFC(%rHT) /* frame count for backspacsys/mdec/tmtoggle.s 644 0 33 572 2511710463 7552 /* * Prototype toggle in bootstrap code for tm type tapes. * If on anything but a 780 with the drive on uba0 * this will have to be repaired by patching uba and umem. */ begin: movl uba,r1 movl $0x80200000,0x800(r1) clrl 0x804(r1) movl umem,r2 bisl2 $0172520,r2 mnegw $512,4(r2) clrw 6(r2) movw $03,2(r2) halt .align 2 uba: .long 0x20006000 umem: .long 0x2013e000 ter ready ? */ extzv $0,$7,r0,r0 mtpr r0/hL,hL5x< /,"sys/mdec/httoggle.s 644 0 33 670 2506752773 7562 /* * Prototype toggle in bootstrap code for ht type tapes. * If on anything but a 780 with a tape at slave 1 of mba 1 * this will have to be repaired by patching mba and ht. */ movl mba,r10 mull3 ht,$0x80,r11 addl3 r11,r10,r11 addl2 $0x400,r11 movl $1,4(r10) movl $9,(r11) cvtwl $012300,0x24(r11) clrl 12(r10) movl $0x80000000,0x800(r10) cvtwl $-512,16(r10) movl $0x39,(r11) halt .align 2 mba: .long 0x20012000 ht: .long 0 ,hL5< /,"((sys/mdec/tsboot.s 644 0 33 12510 2506753545 7311 /* * VAX tape boot block for distribution tapes * works on unibus ts11 * * reads a program from a tp directory on a tape and executes it * program must be stripped of the header and is loaded ``bits as is'' * you can return to this loader via ``ret'' as you are called ``calls $0,ent'' */ .set RELOC,0x70000 /* a.out defines */ .set HDRSIZ,040 /* size of file header for VAX */ .set MAGIC,0410 /* file type id in header */ .set TSIZ,4 /* text size */ .set DSIZ,8 /* data size */ .set BSIZ,12 /* bss size */ .set TENT,024 /* task header entry loc */ /* tp directory definitions */ .set FILSIZ,38 /* tp direc offset for file size */ .set BNUM,44 /* tp dir offset for start block no. */ .set ENTSIZ,64 /* size of 1 TP dir entry, bytes */ .set PTHSIZ,32 /* size of TP path name, bytes */ .set BLKSIZ,512 /* tape block size, bytes */ .set NUMDIR,24 /* no. of dir blocks on tape */ .set ENTBLK,8 /* no. of dir entries per tape block */ /* processor registers and bits */ .set RXCS,32 .set RXDB,33 .set TXCS,34 .set TXDB,35 .set RXCS_DONE,0x80 .set TXCS_RDY,0x80 .set TXCS_pr,7 /* bit position of TXCS ready bit */ .set RXCS_pd,7 /* bit position of RXCS done bit */ /* UBA registers */ .set UBA_DPR1,68 .set UBA_MAP,2048 .set BNE,0x80000000 .set MRV,0x80000000 .set MR_BDP1,0x200000 /* TS UBA registers */ .set TSDB,0 .set TSSR,2 /* TS commands and bits */ .set TSA,0x200 /* page 1, ts command buffer relocation */ .set TS_ACK,0100000 /* ack packet */ .set TS_CVC,040000 /* clear volume check */ .set TS_SETCHR,4 /* set characteristics */ .set TS_READ,1 /* read */ .set TS_RETRY,01000 /* retry, or with read */ .set TS_REWIND,02010 /* local stack variables */ .set tapa,-4 /* desired tape addr */ .set mtapa,-8 /* current tape addr */ .set name,-8-PTHSIZ /* operator-typed file name */ /* register usage */ .set rUBA,r10 .set rTS,r11 /* ===== */ /* initialization */ init: movl $RELOC,fp /* core loc to which to move this program */ addl3 $name,fp,sp /* set stack pointer; leave room for locals */ clrl r0 1: movc3 $end,(r0),(fp) /* move boot up to relocated position */ jmp start+RELOC start: ashl $-9,$RELOC,r0 bisl3 $MRV,r0,UBA_MAP+4(%rUBA) clrw TSSR(%rTS) bsbw tsquiet movw $TSA+setchr,TSDB(%rTS) bsbw tsquiet bsbw rew /* rewind input tape */ movab name(fp),r4 /* start of filename storage */ movzbl $'=,r0 /* prompt character */ bsbw putc /* output char to main console */ /* read in a file name */ movl r4,r1 /* loc at which to store file name */ nxtc: bsbw getc /* get input char's in file name */ cmpb r0,$012 /* terminator ? */ beql nullc movb r0,(r1)+ brb nxtc nullc: subl3 r4,r1,r9 /* size of path name */ beql start /* dumb operator */ clrb (r1)+ incl r9 /* user-specified TP filename has been stored at name(fp) */ /* read in entire tp directory contents into low core */ dirred: movl $8,tapa(fp) /* tp directory starts at block 8 */ movl $(NUMDIR*BLKSIZ),r6 /* no. bytes in total dir */ bsbw taper /* read no. bytes indicated */ /* search entire directory for user-specified file name */ clrl r5 /* dir buff loc = 0 */ nxtdir: cmpc3 r9,(r5),(r4) /* see if dir entry matches filename */ beql fndfil /* found match */ acbl $NUMDIR*BLKSIZ-1,$ENTSIZ,r5,nxtdir /* see if done with tp dir */ brw start /* entry not in directory; start over */ /* found desired tp dir entry */ fndfil: movzwl BNUM(r5),tapa(fp) /* start block no., 2 bytes */ addl2 $7,tapa(fp) /* skip 7 boot blocks */ movzwl FILSIZ(r5),r6 /* low 2 bytes file size */ insv FILSIZ-1(r5),$16,$8,r6 /* file size, high byte */ cmpl r6,$RELOC-512 /* check if file fits below stack */ blss filok /* file o.k. */ brw start /* file too large */ /* time to read in desired file from tape */ filok: movl r6,r7 /* save r6 */ bsbb taper bsbw rew /* clear core */ subl3 r7,$RELOC-4,r0 /* no. bytes to clear */ 1: clrb (r7)+ sobgtr r0,1b /* time to jump to start of file & execute */ addl3 $20,fp,ap clrl r5 calls $0,(r5) brw start /* taper: movcTAPE (r6),tapa(fp),0 */ rew2: bsbb rew /* beginning of tape */ taper0: bsbb rrec /* advance 1 block; never want blk 0 */ taper: clrl r0 /* page no. */ cmpl mtapa(fp),tapa(fp) /* current position .vs. desired */ bgtr rew2 blss taper0 1: bsbb rrec acbl $1,$-BLKSIZ,r6,1b rsb /* rew: rewind the tape */ rew: clrl mtapa(fp) /* current position */ movw $TSA+rewind,TSDB(%rTS) bsbb tsquiet rsb /* rrec: read 1 block from mag tape into page (r0) */ rrec: /* pushl r0; movzbl $'r,r0; bsbw putc; movl (sp)+,r0; */ bisl3 $MRV,r0,UBA_MAP(%rUBA) movw $TS_ACK|TS_CVC|TS_READ,tsread 1: movw $TSA+tsread,TSDB(%rTS) bsbb tsquiet /* bisl2 $BNE,UBA_DPR1(%rUBA) */ tstw TSSR(%rTS) bgeq 2f bisw2 $TS_RETRY,tsread brb 1b 2: incl r0 /* next page no. */ incl mtapa(fp) /* mag tape block position */ rsb tsquiet: tstb TSSR(%rTS) bgeq tsquiet rsb getc: mfpr $RXCS,r0 bbc $RXCS_pd,r0,getc /* receiver ready ? */ mfpr $RXDB,r0 extzv $0,$7,r0,r0 cmpb r0,$015 bneq putc bsbb putc movb $0,r0 bsbb putc movb $012,r0 putc: mfpr $TXCS,r2 bbc $TXCS_pr,r2,putc /* transmitter ready ? */ extzv $0,$7,r0,r0 mtpr r0,$TXDB rsb .align 2 setchr: .word TS_ACK|TS_CVC|TS_SETCHR .long TSA+char .word 0xe char: .long TSA+tsstat .word 0xe .word 0 tsread: .word TS_ACK|TS_CVC|TS_READ .long 0 .word BLKSIZ rewind: .word TS_ACK|TS_CVC|TS_REWIND .long 0 .word 0 tsstat: .space 7*2 end: _pd,r0,getc /* receiver ready ? */ mfpr $RXDB,r0 extzv $0,$7,r0,r0 cmpb r0,$015 bneq putc bsbb putc movb $0,r0 bsbb putc movb $012,r0 putc: mfpr $TXCS,r2 bbc $TXCS_pr,r2,putcsys/mdec/hpboot.s 644 0 33 11371 2552367416 7275 /* * RP??/RM?? disk boot program to load "/boot" from * a UNIX filesystem (starting at block 1 on pack on * drive 0) into low core and to execute that file. * This program can only read regular small version 7 files * from the root of a UNIX filesystem. */ .set BLKSIZ,1024 /* file system block size */ .set RELOC,0x70000 .set HDRSIZ,040 .set INOSIZ,64 /* no. bytes/inode entry */ .set INOBLK,BLKSIZ/INOSIZ /* no. inodes/disc block */ .set INOMSK,0xfffffff0 /* changes with inode size */ .set NAMSIZ,14 /* bytes in directory name */ .set ENTADR,024 /* offset to entry addr in a.out */ .set DIRSIZ,16 /* size of directory entry, bytes */ .set ROOTINO,2 /* root dir inode no. */ .set NBOO,1 .set NSUP,1 /* MBA registers */ .set M_cr,4 /* MBA control reg */ .set M_var,12 /* MBA virt addr reg */ .set M_bc,16 /* MBA byte count reg */ .set M_map,0x800 /* start of MBA map reg's */ .set MBAinit,1 /* MBA init bit in MBA control reg */ /* Drive information */ .set RP6TRK,19 .set RP6SEC,22 .set RM3SEC,32 .set RM3TRK,5 .set RM5SEC,32 .set RM5TRK,19 .set RM80SEC,31 .set RM80TRK,14 .set RP7TRK,32 .set RP7SEC,50 .set RP6typ,022 .set RM3typ,024 .set RM5typ,027 .set RM80typ,026 .set RP7typ,042 .set RP,0x400 /* start of drive registers */ .set RP_cr,RP+0 /* control status register */ .set RP_sr,RP+4 /* drive status reg */ .set RP_stk,RP+0x14 /* desired track/sector reg */ .set RP_dt,RP+0x18 /* drive type reg */ .set RP_off,RP+0x24 /* RP offset reg */ .set RP_cyl,RP+0x28 /* desired cyl reg */ /* RP06 function codes, status bits */ .set RP_GO,1 /* go */ .set RP_RED,070 /* read */ .set RP_DC,010 /* drive clear */ .set RP_RIP,020 /* read in preset */ .set RP_FMT,0x1000 /* format 22 */ .set RP_MOL,0x1000 /* medium on line */ .set RP_DRY,0200 /* drive ready */ .set RP_ERR,040000 /* composite error */ .set RP_pDRY,7 /* bit position of RP_DRY */ .set RP_pERR,14 /* bit position of RP_ERR */ init: .word 0 /* entry mask for DEC monitor */ nop;nop;nop;nop;nop;nop;nop;nop /* some no-ops for 750 boot to skip */ nop;nop; start: movl r5,r11 movl $RELOC,sp moval init,r6 movc3 $end,(r6),(sp) jmp *$RELOC+start1 /* running relocated */ start1: /* get cpu type */ .set SID,0x3e mfpr $SID,r0 extzv $24,$8,r0,r0 ashl $2,r0,r1 /* get mba location and init it */ moval physMBA,r2 addl3 r1,r2,r3 movl (r3),r9 movl $MBAinit,M_cr(r9) /* read-in-preset the drive and set format */ movl $RP_RIP+RP_GO,RP_cr(r9) movl $RP_FMT,RP_off(r9) /* get drive type */ movl RP_dt(r9),r0 cmpb $RP6typ,r0; bneq 1f; movzwl $(RP6SEC<<8)|RP6TRK,r1; 1: cmpb $RM3typ,r0; bneq 1f; movzwl $(RM3SEC<<8)|RM3TRK,r1; 1: cmpb $RM5typ,r0; bneq 1f; movzwl $(RM5SEC<<8)|RM5TRK,r1; 1: cmpb $RM80typ,r0; bneq 1f; movzwl $(RM80SEC<<8)|RM80TRK,r1; 1: cmpb $RP7typ,r0; bneq 1f; movzwl $(RP7SEC<<8)|RP7TRK,r1; 1: movzbl r1,*$rptrk ashl $-8,r1,r1 movzbl r1,*$rpsec mull3 *$rpsec,*$rptrk,*$rpst start2: /* search for ``boot'' program in root inode */ movl $names+RELOC,r6 movzbl $ROOTINO,r0 nxti: clrw *$bno bsbw iget tstb (r6) beql getfil get1b: bsbw rmblk beql start2 movl $buf,r7 nxtent: tstw (r7) beql dirchk cmpc3 $NAMSIZ,(r6),2(r7) bneq dirchk movzwl (r7),r0 addl2 $NAMSIZ,r6 brb nxti dirchk: acbl $buf+BLKSIZ-1,$DIRSIZ,r7,nxtent brb get1b /* found inode, get desired file */ getfil: clrl bufptr getlop: bsbb rmblk beql clear addl2 $BLKSIZ,bufptr brb getlop /* clear core and execute program */ clear: movl *$size,r3 clrcor: clrq (r3) acbl $RELOC,$8,r3,clrcor /* run loaded program */ clrl(( r10 /* major("/dev/hp0a") */ calls $0,*$0 brw start2 /* iget: get inode whose number is in r0 */ iget: addl3 $(INOBLK*(NBOO+NSUP))-1,r0,r8 divl3 $INOBLK,r8,r4 bsbw rblk bicl2 $INOMSK,r8 mull2 $INOSIZ,r8 addl2 $buf,r8 movc3 $time-inode,(r8),*$inode rsb /* rmblk: read block bno into addr */ rmblk: movzwl *$bno,r0 addw2 $3,*$bno addl2 $addr,r0 /* this boot assumes only small files (<=20 blocks) */ extzv $0,$24,(r0),r4 bneq rblk rsb /* rblk: read block in r4 */ rblk: mull2 $BLKSIZ/512,r4 clrl r5 ediv *$rpst,r4,RP_cyl(r9),r1 clrl r2 ediv *$rpsec,r1,r1,r0 insv r1,$8,$5,r0 movl r0,RP_stk(r9) movl $-BLKSIZ,M_bc(r9) ashl $-9,bufptr,r0 bisl3 $0x80000000,r0,M_map(r9) incl r0 bisl3 $0x80000000,r0,M_map+4(r9) clrl M_var(r9) movl $RP_RED+RP_GO,RP_cr(r9) rprdy: movl RP_sr(r9),r0 bbc $RP_pDRY,r0,rprdy bbs $RP_pERR,r0,rperr bicpsw $2 rsb rperr: halt bufptr: .long buf names: .byte 'b,'o,'o,'t,0,0,0,0,0,0,0,0,0,0 .byte 0 .align 2 physMBA: .long 0 .long 0x20010000 .long 0xf28000 end: .set buf,RELOC-1536 .set inode,RELOC-512 .set mode,inode .set nlink,mode+2 .set uid,nlink+2 .set gid,uid+2 .set size,gid+2 .set addr,size+4 .set time,addr+40 .set bno,time+12 .set rptrk,bno+4 .set rpsec,rptrk+4 .set rpst,rpsec+4 RP_RED+RP_GO,RP_cr(r9) rprdy: movl RP_sr(r9),r0 bbc $RP_pDRY,r0,rprdy bbs $RP_pERR,r0,rperr bicpsw $2 rsb rperr: halt bufptr: .long buf names: .byte 'b,'o,'o,'t,0,0,0,0,0,0,0,0,0,0 .byte 0 .align 2 physMBA: .long 0 .long 0x20010000 .long 0xf28000sys/mdec/hkboot.s 644 0 33 11002 2512563110 7240 /* * RK07 disk boot program to load "/boot" from * a UNIX filesystem (starting at block 1 on pack on * drive 0) into low core and to execute that file. * * This program can only read regular small 1k byte (3bsd+) files * from the root of a UNIX filesystem. */ .set BLKSIZ,1024 /* file system block size */ .set RELOC,0x50000 .set INOSIZ,64 /* no. bytes/inode entry */ .set INOBLK,BLKSIZ/INOSIZ /* no. inodes/disc block */ .set INOMSK,0xfffffff0 /* changes with inode size */ .set NAMSIZ,14 /* bytes in directory name */ .set ENTADR,024 /* offset to entry addr in a.out */ .set DIRSIZ,16 /* size of directory entry, bytes */ .set ROOTINO,2 /* root dir inode no. */ .set NBOO,1 .set NSUP,1 .set SID,62 /* system ID register */ /* UBA registers */ .set UBA_CNFGR,0 /* UBA configuration register */ .set UBA_CR,4 /* UBA control register offset */ .set UBA_MAP,0x800 /* UBA offset to map reg's */ .set UBAinit,1 /* UBA init bit in UBA control reg */ .set pUBIC,16 /* Unibus init complete */ /* RK611 registers and bits */ .set HK,0177440-0160000 /* address of RK611 */ .set HK_cs1,HK+0 /* control and status */ .set HK_wc,HK+2 /* word count */ .set HK_ba,HK+4 /* bus address */ .set HK_da,HK+6 /* disk address */ .set HK_dc,HK+020 /* desired cylinder */ .set HKSECT,22 .set HKTRAC,3 .set HKST,HKSECT*HKTRAC .set HK_GO,1 /* go bit */ .set HK_PACK,2 /* pack acknowledge */ .set HK_RCOM,020 /* read command */ .set HK_SEL7,02000 /* select RK07 disk */ .set HK_pRDY,7 /* position of ready bit */ .set HK_pERR,15 /* position of error bit */ init: /* r9 UBA address */ /* r10 umem addr */ .word 0 /* entry mask for dec monitor */ nop;nop;nop;nop;nop;nop;nop;nop /* some no-ops for 750 boot to skip */ nop;nop; /* get cpu type and find the first uba */ mfpr $SID,r0 extzv $24,$8,r0,r0 /* get cpu type */ ashl $2,r0,r1 movab physUBA,r2 /* get physUBA[cpu] */ addl2 r1,r2 movl (r2),r9 movab physUMEM,r2 /* get physUMEM[cpu] */ addl2 r1,r2 movl (r2),r10 /* if 780, init uba */ cmpl r0,$1 bneq 2f movl $UBAinit,UBA_CR(r9) 1: bbc $pUBIC,UBA_CNFGR(r9),1b 2: /* init rk611, set vv in drive 0; if any errors, give up */ movw $HK_SEL7+HK_GO,HK_cs1(r10) 1: movw HK_cs1(r10),r0 bbc $HK_pRDY,r0,1b bbs $HK_pERR,r0,9f movw $HK_SEL7+HK_PACK+HK_GO,HK_cs1(r10) 1: movw HK_cs1(r10),r0 bbc $HK_pRDY,r0,1b bbc $HK_pERR,r0,start 9: halt /* relocate to high core */ start: movl r5,r11 /* boot flags */ movl $RELOC,sp moval init,r6 movc3 $end,(r6),(sp) jmp *$RELOC+start2 /* now running relocated */ /* search for ``boot'' in root inode */ start2: movl $names+RELOC,r6 movzbl $ROOTINO,r0 nxti: clrw *$bno bsbw iget tstb (r6) beql getfil get1b: bsbw rmblk beql start2 movl $buf,r7 nxtent: tstw (r7) beql dirchk cmpc3 $NAMSIZ,(r6),2(r7) bneq dirchk movzwl (r7),r0 addl2 $NAMSIZ,r6 brb nxti dirchk: acbl $buf+BLKSIZ-1,$DIRSIZ,r7,nxtent brb get1b /* found inode for desired file... read it in */ getfil: clrl bufptr getlop: bsbb rmblk beql clear addl2 $BLKSIZ,bufptr brb getlop clear: movl *$size,r3 clrcor: clrq (r3) acbl $RELOC,$8,r3,clrcor /* run loaded program */ movl $3,r10 /* major("/dev/hk0a") */ calls $0,*$0 brw start2 /* iget: get inode block whose # is in r0 */ iget: addl3 $(INOBLK*(NBOO+NSUP))-1,r0,r8 divl3 $INOBLK,r8,r4 bsbw rblk bicl2 $INOMSK,r8 mull2 $INOSIZ,r8 addl2 $buf,r8 movc3 $time-inode,(r8),*$inode rsb /* rmblk: read in bno into addr */ rmblk: movzwl *$bno,r0 addw2 $3,*$bno addl2 $addr,r0 /* this boot assumes only small files (<=20 blocks) */ extzv $0,$24,(r0),r4 bneq rblk rsb /* rblk: read disk block whose number is in r4 */ rblk: mull2 $BLKSIZ/512,r4 clrl r5 ediv $HKST,r4,r0,r1 movw r0,HK_dc(r10) clrl r2 ediv $HKSECT,r1,r1,r0 insv r1,$8,$3,r0 movw r0,HK_da(r10) movw $-BLKSIZ/2,HK_wc(r10) ashl $-9,bufptr,r0 bisl3 $0x80000000,r0,UBA_MAP(r9) incl r0 bisl3 $0x80000000,r0,UBA_MAP+4(r9) clrw HK_ba(r10) movw $HK_SEL7+HK_RCOM+HK_GO,HK_cs1(r10) hkrdy: movw HK_cs1(r10),r0 bbc $HK_pRDY,r0,hkrdy bbs $HK_pERR,r0,hkerr bicpsw $2 rsb hkerr: halt /* ungraceful */ bufptr: .long buf names: .byte 'b,'o,'o,'t,0,0,0,0,0,0,0,0,0,0 .byte 0 physUBA: .long 0 .long 0x20006000 /* 11/780 */ .long 0xf30000 /* 11/750 */ .long 0xf26000 /* 11/7ZZ */ physUMEM: .long 0 .long 0x2013e000 /* 11/780 */ .long 0xffe000 /* 11/750 */ .long 0xffe000 /* 11/7ZZ */ end: .set buf,RELOC-1536 .set inode,RELOC-512 .set mode,inode .set nlink,mode+2 .set uid,nlink+2 .set gid,uid+2 .set size,gid+2 .set addr,size+4 .set time,addr+40 .set bno,time+12 hkerr: halt /* ungraceful */ bufptr: .long buf names: .byte 'b,'o,'o,'t,0,0,0,0,0,0,0,0,0,0 .byte 0 physUBA: .long 0 .long 0x20006000 /* 11/780 */ .long 0xf30000 /* 11/750 */ .long 0xf26000 /* 11/7ZZ */ physUMEM: .long 0 .long 0x2013e000 /* 11/780 */ .long 0xffe000 /* 11/750 */ .long 0xffe000 /* 11/7ZZ */ end: .set buf,RELOC-1536 .set inode,RELOC-512 .set mode,inode .set nlink,mode+2 .set uid,nlink+2 .set gid,uid+2 .set size,gid+2 .set addr,size+4 .set time,addr+40 .set bno,time+1sys/mdec/tmboot.s 644 0 33 11762 2511710706 7277 /* * VAX tape boot block for distribution tapes * works on unibus tm03 * * reads a program from a tp directory on a tape and executes it * program must be stripped of the header and is loaded ``bits as is'' * you can return to this loader via ``ret'' as you are called ``calls $0,ent'' */ .set RELOC,0x70000 /* a.out defines */ .set HDRSIZ,040 /* size of file header for VAX */ .set MAGIC,0410 /* file type id in header */ .set TSIZ,4 /* text size */ .set DSIZ,8 /* data size */ .set BSIZ,12 /* bss size */ .set TENT,024 /* task header entry loc */ /* tp directory definitions */ .set FILSIZ,38 /* tp direc offset for file size */ .set BNUM,44 /* tp dir offset for start block no. */ .set ENTSIZ,64 /* size of 1 TP dir entry, bytes */ .set PTHSIZ,32 /* size of TP path name, bytes */ .set BLKSIZ,512 /* tape block size, bytes */ .set NUMDIR,24 /* no. of dir blocks on tape */ .set ENTBLK,8 /* no. of dir entries per tape block */ /* processor registers and bits */ .set RXCS,32 .set RXDB,33 .set TXCS,34 .set TXDB,35 .set RXCS_DONE,0x80 .set TXCS_RDY,0x80 .set TXCS_pr,7 /* bit position of TXCS ready bit */ .set RXCS_pd,7 /* bit position of RXCS done bit */ /* UBA registers */ .set UBA_DPR1,68 .set UBA_MAP,2048 .set BNE,0x80000000 .set MRV,0x80000000 .set MR_BDP1,0x200000 /* TM UBA registers */ .set TMER,0 .set TMCS,2 .set TMBC,4 .set TMBA,6 /* TM commands and bits */ .set GO,1 .set TM_REW,016 .set TM_RCOM,02 .set TM_SREV,012 .set TM_DCLR,010000 .set TM_crdy,7 .set TM_gapsd,3 .set TMDENS,0 /* 1600 bpi */ /* local stack variables */ .set tapa,-4 /* desired tape addr */ .set mtapa,-8 /* current tape addr */ .set name,-8-PTHSIZ /* operator-typed file name */ /* register usage */ .set rUBA,r10 .set rTM,r11 /* ===== */ /* initialization */ init: movl $RELOC,fp /* core loc to which to move this program */ addl3 $name,fp,sp /* set stack pointer; leave room for locals */ clrl r0 1: movc3 $end,(r0),(fp) /* move boot up to relocated position */ jmp start+RELOC start: bsbw rew /* rewind input tape */ movab name(fp),r4 /* start of filename storage */ movzbl $'=,r0 /* prompt character */ bsbw putc /* output char to main console */ /* read in a file name */ movl r4,r1 /* loc at which to store file name */ nxtc: bsbw getc /* get input char's in file name */ cmpb r0,$012 /* terminator ? */ beql nullc movb r0,(r1)+ brb nxtc nullc: subl3 r4,r1,r9 /* size of path name */ beql start /* dumb operator */ clrb (r1)+ incl r9 /* user-specified TP filename has been(( stored at name(fp) */ /* read in entire tp directory contents into low core */ dirred: movl $8,tapa(fp) /* tp directory starts at block 8 */ movl $(NUMDIR*BLKSIZ),r6 /* no. bytes in total dir */ bsbw taper /* read no. bytes indicated */ /* search entire directory for user-specified file name */ clrl r5 /* dir buff loc = 0 */ nxtdir: cmpc3 r9,(r5),(r4) /* see if dir entry matches filename */ beql fndfil /* found match */ acbl $NUMDIR*BLKSIZ-1,$ENTSIZ,r5,nxtdir /* see if done with tp dir */ brw start /* entry not in directory; start over */ /* found desired tp dir entry */ fndfil: movzwl BNUM(r5),tapa(fp) /* start block no., 2 bytes */ addl2 $7,tapa(fp) /* skip 7 boot blocks */ movzwl FILSIZ(r5),r6 /* low 2 bytes file size */ insv FILSIZ-1(r5),$16,$8,r6 /* file size, high byte */ cmpl r6,$RELOC-512 /* check if file fits below stack */ blss filok /* file o.k. */ brw start /* file too large */ /* time to read in desired file from tape */ filok: movl r6,r7 /* save r6 */ bsbb taper bsbw rew /* clear core */ subl3 r7,$RELOC-4,r0 /* no. bytes to clear */ 1: clrb (r7)+ sobgtr r0,1b /* time to jump to start of file & execute */ addl3 $20,fp,ap clrl r5 calls $0,(r5) brw start /* taper: movcTAPE (r6),tapa(fp),0 */ rew2: bsbb rew /* beginning of tape */ taper0: bsbb rrec /* advance 1 block; never want blk 0 */ taper: clrl r0 /* page no. */ cmpl mtapa(fp),tapa(fp) /* current position .vs. desired */ bgtr rew2 blss taper0 1: bsbb rrec acbl $1,$-BLKSIZ,r6,1b rsb /* rew: rewind the tape */ rew: clrl mtapa(fp) /* current position */ movw $TM_REW+TMDENS+GO,TMCS(%rTM) rsb /* rrec: read 1 block from mag tape into page (r0) */ rrec: /* pushl r0; movzbl $'r,r0; bsbw putc; movl (sp)+,r0; */ jsb tmquiet movw $-BLKSIZ,TMBC(%rTM) bisl3 $MRV|MR_BDP1,r0,UBA_MAP(%rUBA) movw $0,TMBA(%rTM) movw $TM_RCOM+TMDENS+GO,TMCS(%rTM) jsb tmquiet bisl2 $BNE,UBA_DPR1(%rUBA) tstw TMER(%rTM) jgeq 2f mnegw $1,TMBC(%rTM) movw $TM_SREV+TMDENS+GO,TMCS(%rTM) jmp rrec 2: incl r0 /* next page no. */ incl mtapa(fp) /* mag tape block position */ rsb getc: mfpr $RXCS,r0 bbc $RXCS_pd,r0,getc /* receiver ready ? */ mfpr $RXDB,r0 extzv $0,$7,r0,r0 cmpb r0,$015 bneq putc bsbb putc movb $0,r0 bsbb putc movb $012,r0 putc: mfpr $TXCS,r2 bbc $TXCS_pr,r2,putc /* transmitter ready ? */ extzv $0,$7,r0,r0 mtpr r0,$TXDB rsb tmquiet: movw TMCS(%rTM),r2 bbc $TM_crdy,r2,tmquiet 1: movw TMER(%rTM),r2 blbc r2,1b /* low bit == TUR */ bbs $TM_gapsd,r2,1b rsb end: c 2: incl r0 sys/mdec/errs 664 0 33 3577 2636753600 6504 as htboot.s nm -u a.out strip a.out dd if=a.out of=b.out bs=32 skip=1 11+0 records in 11+0 records out dd if=b.out of=htboot conv=sync 0+1 records in 1+0 records out as mtboot.s nm -u a.out strip a.out dd if=a.out of=b.out bs=32 skip=1 12+1 records in 12+1 records out dd if=b.out of=mtboot conv=sync 0+1 records in 1+0 records out as tmboot.s nm -u a.out strip a.out dd if=a.out of=b.out bs=32 skip=1 10+1 records in 10+1 records out dd if=b.out of=tmboot conv=sync 0+1 records in 1+0 records out as tsboot.s nm -u a.out strip a.out dd if=a.out of=b.out bs=32 skip=1 12+1 records in 12+1 records out dd if=b.out of=tsboot conv=sync 0+1 records in 1+0 records out as hpboot.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=b.out 15+1 records in 15+1 records out dd if=b.out of=hpboot conv=sync 0+1 records in 1+0 records out as hkboot.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=b.out 15+0 records in 15+0 records out dd if=b.out of=hkboot conv=sync 0+1 records in 1+0 records out as upboot.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=b.out 15+1 records in 15+1 records out dd if=b.out of=upboot conv=sync 0+1 records in 1+0 records out as utboot.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=b.out 12+1 records in 12+1 records out dd if=b.out of=utboot conv=sync 0+1 records in 1+0 records out echo | dd of=noboot conv=sync 0+1 records in 1+0 records out as httoggle.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=httoggle 2+1 records in 2+1 records out as mttoggle.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=mttoggle 2+1 records in 2+1 records out as tmtoggle.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=tmtoggle 1+1 records in 1+1 records out as tstoggle.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=tstoggle 3+1 records in 3+1 records out as uttoggle.s nm -u a.out strip a.out dd if=a.out bs=32 skip=1 of=uttoggle 2+0 records in 2+0 records out u a.out strip a.out dd if=a.out bs=32 skip=1 of=httoggle 2+1 records in 2+1 records out as mttoggle.s nm -u a.out strip a.out dd sys/mdec/a.out 664 0 33 700 2661567047 6526 ď[[Z[Џ]]^P(`mЏ@DЏPPЫDPP0T=P07TQ0P PTQYYЏ0V0]U)Yed/@U1<,<&V%VV1uVW 05WPP]\Ue1T8Pѭ+Vԭԫ,0Ы,RЫʏRRЏЏɏPԪ ԫЪ9kЫRʏRЏQQRPbP0)ЎPP֭ PP!PPPP  P P"RRPPP#L5< /,"sys/mdec/b.out 664 0 33 640 2661567050 6524 ď[[Z[Џ]]^P(`mЏ@DЏPPЫDPP0T=P07TQ0P PTQYYЏ0V0]U)Yed/@U1<,<&V%VV1uVW 05WPP]\Ue1T8Pѭ+Vԭԫ,0Ы,RЫʏRRЏЏɏPԪ ԫЪ9kЫRʏRЏQQRPbP0)ЎPP֭ PP!PPPP  P P"RRPPP#PP /hL,hL5< /,"sys/mdec/tstoggle.s 644 0 33 1320 2506753607 7603 /* * Prototype toggle in bootstrap code for ts type tapes. * If on anything but a 780 with the drive on uba0 * this will have to be repaired by patching uba and umem. */ .set UBA0,0x20006000 .set UMEM0,0x2013e000 .set UBA_MAP,0x800 .set TSADDR,0772520-0760000 start: movl uba,r10 movl mrv,UBA_MAP(r10) addl3 mrv,$1,UBA_MAP+4(r10) addl3 umem,$TSADDR,r11 clrw 2(r11) 1: tstb 2(r11) bgeq 1b movw $0x200+setchr,(r11) 1: tstb 2(r11) bgeq 1b movw $0x200+read,(r11) halt .align 2 uba: .long UBA0 umem: .long UMEM0 mrv: .long 0x80000000 setchr: .word 0xc004,0x200+char,0,0x8 # set characteristics command char: .word 0x200+status,0,0xe,0 # characteristics read: .word 0xc001,0,0,0x200 # read command status: 0x2013e000 .set UBA_MAP,0x800 .set TSADDR,0772520-0760000 start: movl uba,r10 movl mrv,UBA_MAP(r10) addl3 mrv,$1,UBA_MAP+4(r10) addl3 umem,$TSADDR,r11 clrw 2(r11) 1: tstb 2(r11) bgeq 1b movw $0x200+setchr,(r11) 1: tstb 2(r11) bgeq 1b movw $0x200+read,(r11) halt .align 2 uba: .long UBA0 umesys/mdec/htboot 664 0 33 1000 2636753462 7011 ď[[Z[Џ]]^P(^`mЏ$ k0T=P0TQ0P PTQYΔYЏ0V0]U)Yed/@U1<,<&V%VV1VW 05WPP]\Ue1cPѭVԭkЫRRЏɏPԪ 9kЫRRЫRR ԫkP֭ PP!PPPP  P P"RRPPP#sys/mdec/mtboot 664 0 33 1000 2661567051 7011 ((ď[[Z[Џ]]^P(`mЏ@DЏPPЫDPP0T=P07TQ0P PTQYYЏ0V0]U)Yed/@U1<,<&V%VV1uVW 05WPP]\Ue1T8Pѭ+Vԭԫ,0Ы,RЫʏRRЏЏɏPԪ ԫЪ9kЫRʏRЏQQRPbP0)ЎPP֭ PP!PPPP  P P"RRPPP#sys/mdec/tmboot 664 0 33 1000 2636753502 7011 Џ]]^P(T`m0T=P0TQ0P PTQYݔYЏ0V0]U)Yed/@U1<,<&V%VV1VW 05WPP]\Ue1r PѭVԭlɏ PNȏDk P֭ PP!PPPP  P P"RRPPP#RRkRRRsys/mdec/tsboot 664 0 33 1000 2636753507 7024 Џ]]^P(`mxPɏP0Xk00T=P0TQ0P PTQYYЏ0V0]U)Yed/@U1<,<&V%VV1rVW 05WPP]\Ue1Q#PѭVԭpk1ɏPbhk MP֭ PP!PPPP  P P"RRPPP#`xsys/mdec/hpboot 664 0 33 1000 2636753514 7003 U[Џ^V(fn)>PPPxPQRQRScYЏ$PP<QP< QP< QP<Q"P< 2QQDxQQQHşHDLЏVP@0ef+0ЏWg)fPPPxPQRQRbYRQRbZPi  PPP  PPPU[Џ^V(fnЏVP@0ff+0ЏWg)fPPPxPQRQRbYRQRbZPiЏ@KLPP  PPU[Џ^V(fnPPPD PHЏVP@0ff+0ЏWg)fZ;[[Z[[ k2$Ԫ Џ29k  .align 2 mba: .long 0x20012000 mt: .long 0 * this will have to be repaired by patching mba and mt. */ movl mba,r10 mull3 mt,$0x80,r11 addl3 r11,r10,r11 addl2 $0x400,r11 movzbl $1,4(r10) movzbl $4,8(r11) /* drive zero, one record */ clrl 12(r10) /* set address to zero */ movl $0x80000000,0x800(r10) /* validate map register */ cv/hL,hL5؇< /,"sys/mdec/mttoggle 664 0 33 124 2636753562 7323 FZC[[Z[[Ԫ Џ2<ЫDPP9k  2 mba: .long 0x20012000 mt: .long 0 * this will have to be repaired by patching mba and mt. */ movl mba,r10 mull3 mt,$0x80,r11 addl3 r11,r10,r11 addl2 $0x400,r11 movzbl $1,4(r10) movzbl $4,8(r11) /* drive zero, one record */ clrl 12(r10) /* set address to zero */ movl $0x80000000,0x800(r10) /* validate map register */ cv/hL,hL5< /,"sys/mdec/tmtoggle 664 0 33 70 2636753570 7302 *QЏ RȏPR`  <ЫDPP9k  2 mba: .long 0x20012000 mt: .long 0 * this will have to be repaired by patching mba and mt. */ movl mba,r10 mull3 mt,$0x80,r11 addl3 r11,r10,r11 addl2 $0x400,r11 movzbl $1,4(r10) movzbl $4,8(r11) /* drive zero, one record */ clrl 12(r10) /* set address to zero */ movl $0x80000000,0x800(r10) /* validate map register */ cv/hL,hL5< /,"sys/mdec/tstoggle 664 0 33 144 2636753575 7337 :Z;2$P[Lk\k`  Td20012000 mt: .long 0 * this will have to be repaired by patching mba and mt. */ movl mba,r10 mull3 mt,$0x80,r11 addl3 r11,r10,r11 addl2 $0x400,r11 movzbl $1,4(r10) movzbl $4,8(r11) /* drive zero, one record */ clrl 12(r10) /* set address to zero */ movl $0x80000000,0x800(r10) /* validate map register */ cv/hL,hL5(< /,"usr/games/chase 755 0 12 52000 2450374164 6770 Hp^Юn PPՀPpPPG PA1DѬ*ЬPݠ,PGЬPݠ,PGp7P-ݏhH,iG ݏ|H,ݏHݏH,,1pF ݏH!,ݏHݏHf,FFxLݏH+F%L!LPL`PʏP ݏM4P 1pÏ]PPݏM4ݏ< 5ݏ< 5oMIݏOI@MIݏOI@# XPPX PeMXPPX PGM5MP3MP-MPXXPP@PML!ݏ IL'JJPJ`PʏP ݏM2PD1T L%!*L tL!gLݏM=1J-JP&J`PʏP ݏM2P?;)L'LL ݏIKWK : 4K) Kt Kg KZ ?1 P@HP P xK iK\K ~U1^11@?K=KK KqP1s19C1K1JJ1J1JJ1J11J1JJ1J1JJ1Pq1sIPjPhP,dPiYPm PkCPn8Pu1IPt1"Ps1 Py111]I I 4UPIP#UPPII I UPIPTPPIIIoI2bIP[IQxPPPP`PHIQ2QA`XݏI)II 7I[YYIA11kݫH HCkHk kHkѫH׫ ѫH֫kݫH-2HPHQxPPPP`PqHQ2QA`X@=LHI] [Y1#MH[YY_@wk0HZXXB@&XYkjѫ%@X ZXѕ(kݫG[ݏ@G [YGM ^11?[hGcGZGAG-ݏ|4Gk݋ݏIGd GG1w1[[*?D=F: [PFO [PFO [P@F[[[><vݏXF [P}FU [PrFU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%s *MUNCH*You have been captured and eaten by robots. You ran into an electric field and are now dead. You have defeated all the robots! Move Control y u i \|/ h-j-k /|\ n m , Commands: t - Teleport s - Last stand q - Quit ? - Show yourself ^l - redraw screen Key I - You = - Robot X - Electric fence @ - Junk heapTERMNN0O@OHO\O^OdOOONNOO OOOO O$O(O,O4O1D$KKGݏ`KG ?JFݏ`KF>JQJ J V CP`CPvPC{J ^1,w]PP]32P2QQPP)ݏ(E)J(P'J ݏ*El$]PPJ=P ݏ8EHЭI$^)nPPpPgfBP^1ԭѭ3IPЭQA`IRЭSA`CbIPЭQCbA`֭nzIRdRPjPPPݭ`I'Ï]PPݏCECI<)&I$Ix^1`8AHսЭP`ݏGE ^1,(HbݏKE 1ԭѭEHPЭQA`0ЭP֭PwH aPP_H֭ IHݏKݏUE 5HW,HP P HDPPHP PDDPPGGP P@@~GOԭGPЭQA`GPЭQA`.֭GG^11ԭ ~G'qGݏ`EMWGJGʏPP#,GݏhE&o:P@hD FFw~FRP@+D P PPP@F% FK~ݏjEz1P@YFԭFPЭQA`+FPЭQA`oFPЭQA`֭խ+=FV>P`T?PvP>"FF ^1z:V>P`+?PvP> EݏKݏE% E_ݏKݏE ݬݏEݏxIF#81CÏ]PPݏEkEd%PQE#ǐzattxÏ]PtQA`@Ï]PtQA`-tÏ]PtQÏ]RxSA`CbxtÏ]PxQA`x18ttx,Ï]PtQA`az1tCÏ]PPݏKV8ttx[DPtQ.A`tt^11V<PqP=1DV<~G<<PpP~ݏEݏEC,CʏPP@AѭnKݏE#6^1MЬ[[_CSCFC[) P<6 A{ AfAP ! AEAP =^Ь XЬWЬVЬVXBVխ W BWXݭVFP[HYrԭЭP@֭ѭYݫݫݫ[PݭTPIIZ IPZPYYV[P ^Ь[ЬXЬWЬVЬ XP2QPQ'WP2 QPQVXP2QPQWP2QPQPV2P2QQPXPVխ2P2 QQPWPWXݭV:PY2PXP2 PWPZЭP@J֭ZZV YPЬ YЬXЬWЬV 4PZ1hW<P Ze1KWPZHݪ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YX1XX߭ ~PYjh ~P  BЫZ֫ZPѫPѬ ZPPXPZ ~2PYZkn 1mЫZ3[hI1xݏhPZZ  YYX ZYYXZYZ ~PY2kZXY 1ЬPЬ[ PʏPP@ЫZ:ZY3Z P2PPkYZ ~_PY PP [ [[[,  Ь[Z < 7[gPZ ~YPZ ݫ ԫ kZP} Ь[ЬZkPkPzQQPP^߭ݬPPP|l\PЬ[ЬZ[Y[YPЬ[ЬZ[YYPݬݏ tݬݬݏtݬ6Ь[ѬP ѫѫk֫k׫ЫP`P.TT~*PY[k$jkkZjxYP[PZPxYP[PP[1[Zk[[ZZ^ [TPPYPƏPxP7bPZx$PZPPZx~@PZZZPZPxPZPPjjT1xYP[PZkk[P Ь[[ZZZmjPPj ^Ь[ [[PPݬNPZZ[ZP[Z~PYYYЭPЭQ`aЭP׭PZ[xYPZPP[xYPZP[PP@jd~\S^\_IP@CЬ+PЬPЬRRQ{RPPR PRPPPI P@PF FFFF#F(F1F=FO||\//\@AR $\_8z.h1q G<"s>NDM K2/usr/dict/wordsrno dictionarycan't stat%s %s Guesses: Word: %s Guess: You already guessed '%c' The answer was %s. You win, the word is %s %s %s Average of %4.2f errors in %.0f words. Do you want to play again? ______ | | | | | | __|____ | |___ |________|TERMJJJJJ KKKt8tYk;Pt0K6N 66A6sݏ]qqP[ѫ]5.TN 5[P{5[xsns[$NJ5LsAsP/sMP5[P[qPm4+NPNP`NPMP<T[5-( [2PP [ k[[^Ь[2XЫ8Z ժQrѫt orY ݫPYxP P@Wr+PPP1Wm$ZPxWQQPû`P$ZQxWRRQûaQQP$ZQxWRRQЫRâQ$ZRxWSSRЫSãRRQQPVVX$ZPxWQQP}`VXWW 1 xP P@{PPPďP@LZZY1QЫP}`葫D1ѫ Iq4ѫ;q*3q~=P#q ~)PëqPëpQQPë pQë pRRQQPP$X Sg<PFë p~KPëp~KPՄɄ[~^߭[OP1ѭjpѭdp [ѭ1ЫPѭxeRխ` PѫPyݭJR6ݭ<[~6Ы8P#P.PЭ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[[YHZJJZZJJZYYPK}QPQZJ}P0[Q Q@1JaJ}P0[Q QZQ@ZZ[[1V^ZЬPJ|QQA`JH@ZԭլíЭZJBJ\ ZZJP0Q Q@PJaQQPPJk0ZZZ[K_PxZQoQKGRxRRK<SxSSSRK.SxSSSRK SSSSRKSxSSSRRQxPP@aYxZPP[YPPKYPPKYPPKxYPPPPKZZ1NZJ~P@PJQQPPJ. ZZJAJ Z֭ѭ1ZJ[JJ[J ZZJ/{P@J@Z^[KLB[[1[@.ZZPPPxPYPPPPKZ[Z[֬Y[KB[[KZ{K0[[Y֬YK YZYY9Y.YZZPxPYPP;[PZP@[PZP[QZQ@A[PZP@ZZ[[[Q4[[YZxYY[PZP@.PPYZ.YY9YYZYYKM[[ K?8 /+$Pݬ P5^߭2PXj| -=L]q .D^|0Rp!B[uError 0Not ownerNo such file or directoryNo such processInterrupted system callI/O errorNo such device or addressArg list too longExec format errorBad file numberNo childrenNo more processesNot enough corePermission deniedBad addressBlock device requiredMount device busyFile existsCross-device linkNo such deviceNot a directoryIs a directoryInvalid argumentFile table overflowToo many open filesNot a typewriterText file busyFile too largeNo space left on deviceIllegal seekRead-only file systemToo many linksBroken pipeArgument too largeResult too largeOperation would blockOperation now in progressOperation already in progressSocket operation on non-socketDestination address requiredMessage too longProtocol wrong type for socketProtocol not availableProtocol not supportedSocket type not supportedOperation not supported on socketProtocol family not supportedAddress family not supported by protocol familyAddress already in useCan't assign requested addressNetwork is downNetwork is unreachableNetwork dropped connection on resetSoftware caused connection abortConnection reset by peerNo buffer space availableSocket is already connectedSocket is not connectedCan't send after socket shutdownToo many references: can't spliceConnection timed outConnection refusedl\~ݬBkPP^Ь[ЬZԭլ05Ьj ЪP֪`P ZoPYY׭֭ѭ ЭP^Ь[ЬZԭլ.3ЬYj ЪP֪` Z~ Y ֭ѭ ЭPЬ[  P ݏP ի ߘP@ [sj j  P2PPݫ~PkЫk!k    k1WP֫Ь[ի ݫ~ Ь Ыk.PP^ԭլݏP|PݭݭVխѭ¬ Э!rPݬ8ЬPЭ `ЭPЬPPЬQaPPQ Qa  (Џ 7^Сݏ+ Vlongjmp botch  Ь[ZZZPЬ[ЬZЬ YY kPYP kPzQQPЬ[ЬZ[XY YY  YXPݬiݬݬ;0 ЬQPa#QP^BЬ2߭ \~ݬ"׭ ЭP֭` ߭rЬP  !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~1T7RBdݭRIP֭S}TTPRPTSCRQSTP}TPRPPQRЭP^Ь[Ь Ь\ԭIY HhX>HXZ1XZZ1 Z ЌYZYYЌXXXZX0XWWVWWWWPPnW#VWP֭WPHWxWP@QWVS00S,aVcc8Va0VUQnSW-WЭP0PVVPPVP(PacЭP,a0PcXPZ Z.έPPXXPPX,a0PcXPPVVPPX(PacXP@ R]RRPPXPX,a0PcSUDeB+XZX0XWWWWPPnW֭WPP=WxWP@Z=Q&QVPPn8neVQZ1, 1%WVXЭ1P0PPX(WVPXQ0Z Z u0e.UZ1Q0ZZXXXZ1.1+pU1rUUURR;RRRƏR0qPURRRRR dUR R_tPTUPUP  tUPUPXWюnWW qU  PpPT~MSRRRRTRdcPSTRgPPRQRR(RSSAQBbT BCG@M [u+pPB<Vvӈb2>HQS'I[#,; :ܒX^Ь[    PPYYX1XX߭~iPYj_~P ﻪﳪ BЫZ֫ZPѫPѬ ZPPXPZ~PYZkn 1mЫZ3[$s1xݏPZZ  YYX ZYYXZYZ~PY2kZXY 1ЬPЬ[2 PʏPPAЫZ;ZY4Z P2PPkYZ~,PY PP][ [[[^ Ь[Z = 8[ePZ~-PZ ݫs ԫ kZP{ Ь[ЬZkPkPzQQP^ݬPP߭ݬP throw something

forward until find something zap a wand in a direction identify trap type search for trap/secret door go down a staircase go up a staircase rest for a while inventory inventory single item quaff potion read paper eat food wield a weapon wear armor take armor off put on ring remove ring drop object call object recall what's been discovered examine/set options redraw screen repeat last message cancel command shell escape save game quitFight what @ %d,%dwait! That's a mimic!your hands stop glowing redthe %s appears confusedThe rust vanishes instantlyyour armor appears to be weaker now. Oh my!your armor weakensyou are transfixed by the gaze of the floating eyeyou feel a sting in your arm and now feel weakera sting has weakened youa sting momentarily weakens yousting has no effectyou suddenly feel weaker%dd1your purse feels lightershe stole %s!welcome to level %dDamage for %dd%d came out %d, dplus = %d, add_dam = %d, def_arm = %dthe hit scored an excellent hit on hit have injured has injured swing and hit swings and hits miss misses swing and miss swings and misses barely miss barely misses don't hit doesn't hitthe %s hits you hit the %sthe %s misses you missed you have defeated 000d0amberaquamarineblackbluebrownclearcrimsoncyanecrugreengreymagentaorangepinkplaidpurplesilvertantangerinetopazturquoisevermilionvioletwhiteyellowabagaksalaankhappargarzeashbanbarbekbinbitbjorblubotbubytcompconcoscredalfdandendoengerkeshevsfafidforfrifugangarglengopgrehahehydipishivjokhokliklislechmanmarmimikmonmungmurnejnelgnepnernesnihninorgoxoxypaypetplupopotprokrearhovrorogrolsasansatseesefsehshuskisnasnesniksnososolsristasuntabthertoxtroltuetursumunivalvivvlyvomwahwedwergwexwhonwunxoyotyuzantzapzebzimzokzonzumagatealexandriteamethystcarneliandiamondemeraldgermaniumgranitegarnetjadekryptonitelapis lazulimoonstoneobsidianonyxopalpearlperidotrubysaphirestibotantalitetiger eyetaaffeitezirconavocado woodbalsabamboobanyanbirchcedarcherrycinnibarcypressdogwooddriftwoodebonyelmeucalyptusfallhemlockhollyironwoodkukui woodmahoganymanzanitamapleoakenpersimmon woodpecanpinepoplarredwoodrosewoodspruceteakwalnutzebrawoodaluminumberylliumbonebrassbronzecopperelectrumironleadmagnesiummercurynickelpewterplatinumsteelsilicontintitaniumtungstenzincthingspotionsscrollsringswandsticks Bad percentages for %s: %3d%% %s [hit RETURN to continue]--More--Level: %d Gold: %-5d Hp: %*d(%*d) Str: %-2d Ac: %-2d Exp: %d/%ld Hungry Weak Faintingran out of memory after %d itemsmTsdVv0Uvy4xYWizard's password: mTHOME/rogue.saveROGUEOPTSSay, who the hell are you? slime-mold-sSEEDHello %s, welcome to dungeon #%dHello %s, just a moment while I dig the dungeon...Ok, if you want to exit that badly, I'll have to allow it really quit?You quit with %d gold piecesSHELL/bin/shshell-iNo shelly [Press return to continue]a trapdooryou found a trapdoora beartrapyou found a beartrapa sleeping gas trapyou found a sleeping gas trapan arrow trapyou found an arrow trapa teleport trapyou found a teleport trapa dart trapyou found a poison dart trapwierd trap: %dNon-object %d,%deatugh, you would get ill if you ate thatthat's Inedible!my, that was a yummy %syuk, this food tastes awfulyum, that tasted goodyou faint from exhaustionThat's already in usewhich direction? direction: started a wandering %scan't find monster in wake_monsterthe umber hulk's gaze has confused youwhich monster do you wish to wipe outplease specifiy a letter between 'A' and 'Z'there will be no more %ssyou are still stuck in the bear trapyou are being heldyou fell into a trap!you are caught in a bear trapa strange white mist envelops you and you fall asleepoh no! An arrow shot youthe arrow killed youan arrow shoots past youa small dart just hit you in the shoulderthe dart killed youa small dart whizzes by your ear and vanishesterseTerse output: flushFlush typeahead during battle: jumpShow position only at end of run: stepDo inventories one line at a time: askmeAsk me about unidentified things: passgoFollow turnings in passageways: nameName: fruitFruit: fileSave file: TrueFalse(T or F)you can't carry anything elsethe scroll turns to dust as you pick it upyou now have %s (%c)%c) %s empty handednothing appropriateyou are empty handedyou don't have anything appropriateWhere did you pick a '%s' up???you aren't carrying anythinga) %sitem: which item do you wish to inventory: '%s' not in packrange is 'a' to '%c'which object do you want to what? (* for list): please specify a letter between 'a' and '%c'error in connection tableswarning, connectivity problem on this levelquaffyuk! Why would you want to drink that?that's undrinkablewait, what's going on here. Huh? What? Who?you feel very sick nowyou feel momentarily sickyou begin to feel betteryou feel stronger, now. What bulging muscles!you have a strange feeling for a momentYou sense the presence of magic on this level.--More--you have a strange feeling for a moment, then it passesyou can't movethis potion tastes like %s juiceyou suddenly feel much more skillfulyou begin to feel much betteryou feel yourself moving much fasterhey, this tastes great. It make you feel warm all overa cloak of darkness falls around youthis potion tastes extremely dullwhat an odd tasting potion!put onit would be difficult to wrap that around a fingernot a ringyou already have a ring on each handwearing twoyou are now wearing no ringsyou aren't wearing any ringsnot wearing such a ringwas wearing %s(%c)left or right ring? left hand or right hand? L or Rplease type L or R __________ / \ / REST \ / IN \ / PEACE \ / \ | | | killed by a | | 1980 | *| * * * | * ________)/\\_//(\/(/\)/\//\/|_)_______killedA total winnernamesedit Top Ten Rogueists: Rank Score Name %d %d %s: %s on level %d by a (%d) (%s). %d Au%2d @ @ @ @ @ @@@ @ @ @ @ @@ @@ @ @ @ @ @ @ @@@ @ @ @ @ @ @@@ @@@@ @@@ @ @@@ @ @@@@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @@@@ @ @ @@@@@ @ @ @ @ @ @ @ @ @@ @ @ @ @ @ @ @ @ @ @ @@@ @@@ @@ @ @ @ @@@@ @@@@ @@@ @@@ @@ @ Congratulations, you have made it to the light of day! You have joined the elite ranks of those who have escaped the Dungeons of Doom alive. You journey home and sell all your loot at a great profit and are admitted to the fighters guild. Worth Item%c) %5d %s %5d Gold Pieces starvationGodin a gone roomsave file (%s)? please answer Y or Nfile name: File exists. Do you wish to overwrite it?Please answer Y or Nfile name: %sjunk-rCannot unlink file Sorry, saved game is out of date. Sorry, saved game is not in the same file. Sorry, file has been touched, so this score won't be recorded %s: %sCannot restore from a linked file TERMreadthere is nothing on it to readnothing to readas you read the scroll, it vanishesyour hands begin to glow redyour armor glows faintly for a momentyou hear a faint cry of anguish in the distancethis scroll is an identify scrolloh, now this scroll has a map on itYou begin to feel greedy and you sense gold.--More--you feel a pull downwardyou feel a strange sense of lossyour %s glows blue for a momentyou hear maniacal laughter in the distanceyou feel as if somebody is watching over youyou hear a high pitched humming noisethis scroll seems to be blankyou have been granted the boon of genocidewhat a puzzling scroll!2d3zap withyou can't zap with that!nothing happensthe corridor glows and then fadesthe room is lit by a shimmering blue lightyou are too weak to use itmissle vanishesthe missle vanishes with a puff of smoke3d8what a bizarre schtick!you have a tingling feeling6d6the %s bouncesthe flame bouncesoff the dragon%s missesthe %s whizzes past the %sthe %s hitsyou are hit by the %sthe %s whizzes by you [%d] [%d charges]A scroll %d scrolls of %scalled %stitled '%s'A potion %d potions of %s(%s)called %s(%s)A%s %s potion%d %s potionsA%s %s%d %ssSome food%d rations of food%d A%s %s %s [armor class The Amulet of Yen((dorA%s %s of %s%s(%s)A%s ring of %s(%s)A ring called %s(%s)A%s %s ringPicked up something funny %sSomething bizarre %s (being worn) (weapon in hand) (on left hand) (on right hand)there is something there alreadydropdropped %syou can't. It appears to be cursedPicked a bad armor %dPicked a bad kind of objectbad pick_one: %d from %d items%s: %d%%for what type of object do you want a list? (* for all)Not a typePlease type one of %c%c%c%c (ESCAPE to quit)NothingHaven't discovered anythingstick about any %ssthrowthe %s vanishes as it hits the ground%s%d+,%s%dwieldyou can't wield armorwielding %s (%c)You don't have anything in your pack to identifyYou must identify somethingtype of item: which %c do you want? (0-f)blessing? (+,-,n)how much?wizard's Password:---More (level map)---MA|Bp"T~`%3*~{}; _e@(#)vers.c 4.22 (Berkeley) 2/9/824.22#!(!3!=!C!J![!`!i!w!}!!!!!!!!#2?KU_d ! ! !! !! ""d  """  /"3" P@"F"  "L" V"Z" xl"p" !w" !~" "" d""d % /""@ V""F "" "" "" ""2  x""( ##  ^## 7 "%# *#:# 2"?# V"F#X#f#s#y##d##2## #K#i##$,N#$ $$-$d;$C$U$ie$q$$$$$$ $ $$ -$ 6$ $ %%%,% #;%C%|R% X% Ka%Jk%Jp%Ju%6% % % ^% ,%%T%2%?%/%h&j&k &l&y&u"&b.&n;&HI&JS&K]&Le&Yp&U&B&N&t&f&z&^ 's$'>A'<V'.i'i{'I'q'r'e'w'W'T'P'R'd(c(D!(o@( U(d(y(!(S(Q( (P@ (P؟@ (+++++++,, ,,, ,',,,2,(9,@,D,N,T,^,h,o,u,,|,,,,A,,,,,,,,!,B#,,,,,,,,,,,,,,,,u#n$,=,,,,,,--- ----- -#-&--(d,*---,q,1-4-7-;-?-,D-I-M-(Q-"T-X-\-a-e-i-n-r-v-v-z-~-9-''-&#----5,-------------------------------'.<#. ...-#.-.b-.".&.*...2.6.;.?.D.H.(.K.O.R.W.[._.c.g.k.o.u.(.2.(.,.,...2..,.2.2..<...?/^ //!/2N,<T,F+/,5/P;>^>>>>>>?>B?i???(?""d"!d""d"uG` ""d l"!d""d`""d! #`uG "d ibgggpCMust play from a tty. Sorry, you may not play rogue over the network. Sorry, %s, but the system is too loaded now. Try again later. Meanwhile, why not enjoy a%s %s? However, since you're a good guy, it's up to you /usr/games/lib/rogue_rollThe load is too high to be playing. Please leave in %0.1f minutesPlease save your game. You have %0.1f minutesLast warning. You have %0.1f minutes to leaveThe load is rather high, O exalted oneSorry. You took too long. You are dead The load has dropped back down. You have a reprieve/etc/utmprThe score file is very busy. Do you want to wait longer for it to become free so your score can get posted? If so, type "y" /tmp/.roguelockTERM \nzp|TLdhtľȾ̾H8Xо`Ծؾ<Dxxxx|dumb:licoambseohzinmimsncosulxnalbcbtcdceclcmdcdldmdoedeihoicimipllmandpcsesfsosrtatetiucueupusvbvsvesgugjunknownllllllllllllllllllllllllllllllllllllllmmmmm m mmmmmmmmmm m"m$m&m(m*m,m.m0m2m4m6m8m:mm@mBmDmFmHmJmLmNmPmRmTmVmXmZm\m^m`mbmdmfmhmjmlmnmpmrmtmvmxmzm|m~mmmmmmmmmmmmmmmmmmmmmmmmmmm^@^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^[^\^]^~^_ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~^?TERMCAPTERM/etc/termcap/etc/termcapTermcap entry too long Bad termcap entry Infinite tc= loop Termcap entry too long E^^\\::n r t bf OOPS5MS7) :2*" <4,$ >6.&@80( 91)! ;3+# =5-% ?7/'(08@ '/7?&.6>%- 5=$, 4<#+ 3;"* 2:!) 1991)! :2*" ;3+# <4,$?7/'>6.&=5-%      )4%/7(3-!0,1'8"5.*2$                                                                                                                                     M:/Day Mon 00 0((0:00:00 1900 SunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDec/etc/passwdrr/dev/ttyr%s Unknown error: >  AAAAAABBBBBB Tt/dev/(/dev/ttyr%s Unknown error: >  AAAAAABBBBBB usr/games/worm 755 0 12 44000 2611654240 6665 <| ^Юn PPՀPpPP; P8^ѬЬPݠo+P;; ;; @>+6-P+m-J,;,B,C<C<7C<vC<7<`YC~ P?=C~9C~P>**P>P>P> r:>a < > > K:>~&: =g5߭6P٘~7P.>9">>P >PԠ ݏ@>`Y=[16PZ[ ZkjЫݏoZ)YZ[Y_9Z=ZPԠ= ݼЬPݠ=~o=h@5*<J4N=~^)xP)xPPP~'ǬPQĬQQPA~PЬQP@~PݼЬPݠ<2<P<QxPPP`P2QA` ^ NPw<t0~U<NH<Y  ^&)4<[-<PРZPPLu1Pw1Pu{Pn1 ;T;PР PԠ;PР P6Э;1Z1Z1[1ZH7A[6;P 1APJPH[7P PP:PK1 ZPk1Pj1n1Ph[.;616ݏo:X[Z:2:P:QxPPP`P2QA`P@81PP0PP>61646*6ݏDx:66_:R:_+Pl15 ' l2PԠ ЭP::PЭ ЭPZ[ݏ@ݭDЭ99c5 &% 766753%5W5 %^v=~6\6?7)0r&P$J&=<6=@6m1<6< 6M1 658 }8l8 _8pC%Ь[2X2PPYЫP`WIVZ JfJfJgZZXXZZJPH`JQH`aYZ镫  HfHfffHgHgg[ Ь[[75+55[ P48/P+43~"P[4[[43s;8!b;#!uh$z4 r4!;;PM4PB4P34 +4::P4:::3/ :g :R 343P ! x:) 3P r3^Ь XЬWЬVЬVX#:Vխ W:WXݭVFP[HYrԭЭP@ ֭ѭYݫ ݫ ݫ [ PݭD PIIZ IPZPYYV[P ^Ь[ЬXЬWЬVЬ XP2QPQ'WP2 QPQVXP2QPQWP2QPQPV2P2QQPXPVխ2P2 QQPWPWXݭV:PY2PXP2 PWPZ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